@atproto/oauth-provider-ui 0.3.3 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/authorization-page-CUmylUsp.js +20 -0
- package/dist/authorization-page-CUmylUsp.js.map +1 -0
- package/dist/bundle-manifest.json +79 -79
- package/dist/error-page-BSIrbq_G.js +2 -0
- package/dist/{error-page-QY8FHhOr.js.map → error-page-BSIrbq_G.js.map} +1 -1
- package/dist/{error-view-3rFNXZAL.js → error-view-BrIEEpo5.js} +2 -2
- package/dist/error-view-BrIEEpo5.js.map +1 -0
- package/package.json +5 -5
- package/dist/authorization-page-kKQmXCNt.js +0 -20
- package/dist/authorization-page-kKQmXCNt.js.map +0 -1
- package/dist/error-page-QY8FHhOr.js +0 -2
- package/dist/error-view-3rFNXZAL.js.map +0 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var nd=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);import{r as w,j as l,c as se,L as sd,A as id,u as z,U as ad,C as od,a as br,b as $t,T as R,E as cd,d as xr,e as dd,B as Ha,f as Wa,g as ii,R as ud,h as ld,N as ai,i as oi,k as nn,l as fd,m as hd,n as pd,o as md,p as Ka,S as _d,I as gd,q as yd,s as ci,t as di,X as vd,v as bd,w as xd,x as Ed,y as Sd}from"./error-view-BrIEEpo5.js";var sm=nd((om,yc)=>{const Xa=w.createContext(null),kn={didCatch:!1,error:null};class wd extends w.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=kn}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var r,n,s=arguments.length,i=new Array(s),a=0;a<s;a++)i[a]=arguments[a];(r=(n=this.props).onReset)===null||r===void 0||r.call(n,{args:i,reason:"imperative-api"}),this.setState(kn)}}componentDidCatch(t,r){var n,s;(n=(s=this.props).onError)===null||n===void 0||n.call(s,t,r)}componentDidUpdate(t,r){const{didCatch:n}=this.state,{resetKeys:s}=this.props;if(n&&r.error!==null&&Td(t.resetKeys,s)){var i,a;(i=(a=this.props).onReset)===null||i===void 0||i.call(a,{next:s,prev:t.resetKeys,reason:"keys"}),this.setState(kn)}}render(){const{children:t,fallbackRender:r,FallbackComponent:n,fallback:s}=this.props,{didCatch:i,error:a}=this.state;let c=t;if(i){const d={error:a,resetErrorBoundary:this.resetErrorBoundary};if(typeof r=="function")c=r(d);else if(n)c=w.createElement(n,d);else if(s!==void 0)c=s;else throw a}return w.createElement(Xa.Provider,{value:{didCatch:i,error:a,resetErrorBoundary:this.resetErrorBoundary}},c)}}function Td(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((r,n)=>!Object.is(r,t[n]))}function Id(e){if(e==null||typeof e.didCatch!="boolean"||typeof e.resetErrorBoundary!="function")throw new Error("ErrorBoundaryContext not found")}function jd(){const e=w.useContext(Xa);Id(e);const[t,r]=w.useState({error:null,hasError:!1}),n=w.useMemo(()=>({resetBoundary:()=>{e.resetErrorBoundary(),r({error:null,hasError:!1})},showBoundary:s=>r({error:s,hasError:!0})}),[e.resetErrorBoundary]);if(t.hasError)throw t.error;return n}function Ee({customizationData:e,title:t,subtitle:r,htmlTitle:n=typeof t=="string"?t:void 0,className:s,children:i,...a}){return l.jsxs("div",{...a,className:se(s,"flex flex-col items-center","md:flex md:flex-row md:items-center md:justify-stretch","min-w-screen min-h-screen"),children:[n&&l.jsx("title",{children:n}),l.jsxs("div",{className:se("px-6 pt-4","w-full","md:max-w-lg","flex flex-row items-center","md:flex-col md:items-end","md:self-stretch","md:max-w-fix md:w-1/2 md:p-4","md:text-right","md:dark:border-r md:dark:border-slate-700","md:bg-slate-100 md:dark:bg-slate-800"),children:[l.jsxs("div",{className:"grid grow content-center md:justify-items-end",children:[t&&l.jsx("h1",{className:"text-primary text-xl font-semibold md:my-4 md:text-2xl lg:text-5xl",children:t},"title"),r&&l.jsx("p",{className:"hidden max-w-xs text-slate-600 md:block dark:text-slate-400",children:r},"subtitle")]}),l.jsx(sd,{className:"m-1 md:m-2"},"localeSelector")]}),l.jsx("main",{className:"w-full p-6 md:max-w-3xl md:px-12",children:i})]})}function Rd(e,t,r){if(!e)return[t];const n=e.findIndex(r);return n===-1?[...e,t]:[...e.slice(0,n),t,...e.slice(n+1)]}function nt(e,t){const{showBoundary:r}=jd();return w.useCallback(async(...n)=>{try{return await e(...n)}catch(s){throw s instanceof ad&&r(s),s}},t.concat(r))}function Cd({sessions:e=[],onRedirected:t}){const[r]=w.useState(()=>new id),[n,s]=w.useState(e),{i18n:i,_:a}=z(),{locale:c}=i,d=w.useCallback(k=>{s(P=>{var U;return k===(((U=P.find($=>$.selected))==null?void 0:U.account.sub)||null)?P:P.map($=>({...$,selected:$.account.sub===k}))})},[s]),u=w.useCallback(({account:k,ephemeralToken:P,consentRequired:U=!0,selected:$=!0,loginRequired:B=!1})=>{const V={account:k,ephemeralToken:P,selected:$,loginRequired:B,consentRequired:U};s(K=>Rd(K,V,F=>F.account.sub===k.sub).map(F=>!$||F===V||!F.selected?F:{...F,selected:!1}))},[s]),f=w.useCallback(k=>{window.location.href=String(k),t&&setTimeout(t)},[t]),p=nt(async(k,P)=>{const U=await r.fetch("POST","/sign-in",{...k,locale:c},{signal:P});u(U)},[r,c,u]),g=nt(async(k,P)=>{await r.fetch("POST","/reset-password-request",{...k,locale:c},{signal:P})},[r,c]),_=nt(async(k,P)=>{await r.fetch("POST","/reset-password-confirm",k,{signal:P})},[r]),x=nt(async(k,P)=>{await r.fetch("POST","/verify-handle-availability",k,{signal:P})},[r]),S=nt(async(k,P)=>{const U=await r.fetch("POST","/sign-up",{...k,locale:c},{signal:P});u(U)},[r,c,u]),I=nt(async(k,P)=>{var B;const U=(B=n.find(V=>V.account.sub===k))==null?void 0:B.ephemeralToken,{url:$}=await r.fetch("POST","/consent",{sub:k,scope:P},{bearer:U});f($)},[r,n,f]),D=nt(async()=>{const{url:k}=await r.fetch("POST","/reject",{});f(k)},[r,f]);return{sessions:n,selectSub:d,doSignIn:p,doInitiatePasswordReset:g,doConfirmResetPassword:_,doValidateNewHandle:x,doSignUp:S,doConsent:I,doReject:D}}function wt(e,t){return w.useCallback(()=>e(t),[e,t])}function Dd({clientId:e,clientMetadata:t,clientTrusted:r}){const[n,s]=w.useState(!1),i=r?t.logo_uri:void 0,a=t.client_name||e;return w.useEffect(()=>{s(!1)},[i]),i&&!n?l.jsx("img",{"aria-hidden":!0,src:i,alt:a,className:"-ml-1 size-8",onError:()=>s(!0)}):l.jsx("div",{"aria-hidden":!0,className:"bg-primary flex size-8 items-center justify-center overflow-hidden rounded-full text-white",children:l.jsx(od,{className:"size-4"})})}function ce({color:e="grey",transparent:t=!1,loading:r=void 0,shape:n="rounded",children:s,className:i,type:a="button",role:c="Button",disabled:d=!1,...u}){const f=a==="submit"||u.onClick!=null;return l.jsx("button",{role:c,type:a,disabled:d||r===!0,tabIndex:(u==null?void 0:u.tabIndex)??(f?0:-1),...u,className:se("touch-manipulation overflow-hidden","truncate tracking-wide",f?"cursor-pointer":null,n==="circle"?"rounded-full":"rounded-md",n==="circle"?"size-8":null,n==="rounded"?"px-6 py-2":n==="padded"?"p-2":void 0,"transition duration-300 ease-in-out","outline-none","focus:ring-primary focus:ring-2 focus:ring-offset-1 focus:ring-offset-white dark:focus:ring-offset-black",e==="primary"?se("accent-slate-100",t?"text-primary bg-transparent":"bg-primary text-primary-contrast"):e==="grey"?se("accent-primary","text-slate-600 dark:text-slate-300","hover:bg-gray-200 dark:hover:bg-gray-700",t?"bg-transparent":"bg-gray-100 dark:bg-gray-800"):void 0,"disabled:opacity-50",i),children:s})}function Nd(e,t){w.useEffect(()=>{const r=n=>{!n.defaultPrevented&&e.current&&!e.current.contains(n.target)&&t(n)};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r)}},[e,t])}function kd(e){const t=r=>{r.key==="Escape"&&(r.preventDefault(),e())};w.useEffect(()=>(window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t)}),[e])}function we({hint:e,image:t,title:r,description:n,append:s,className:i,children:a,...c}){const{i18n:d,_:u}=z(),[f,p]=w.useState(!1),g=w.useCallback(()=>p(!1),[]),_=w.useRef(null);kd(g),Nd(_,g);const x=a!=null,S=br("details-card-");return l.jsxs("div",{ref:_,className:i,...c,children:[l.jsxs("div",{className:"flex items-center justify-start gap-2",children:[l.jsx("div",{className:"ml-2 flex w-8 flex-grow-0 items-center justify-center","aria-hidden":!0,children:t}),l.jsxs("div",{className:"flex flex-1 flex-col","aria-describedby":x?S:void 0,children:[r&&l.jsx("h3",{children:r}),n&&l.jsx("p",{className:"text-sm",children:n})]}),s&&l.jsx("div",{className:"flex shrink-0 grow-0 items-center justify-center",children:s}),x&&l.jsx(ce,{onClick:I=>{I.defaultPrevented||(I.preventDefault(),p(D=>!D))},shape:"circle",title:f?d._({id:"183A6G"}):e??d._({id:"xAo8pm"}),"aria-expanded":f,"aria-label":f?d._({id:"183A6G"}):e??d._({id:"xAo8pm"}),"aria-haspopup":"true","aria-controls":S,children:"?"})]}),x&&l.jsx($t,{className:"mt-4",hidden:!f,id:S,"aria-hidden":!f,children:a})]})}var st={},Pn={},Lr={},ui;function yt(){if(ui)return Lr;ui=1,Object.defineProperty(Lr,"__esModule",{value:!0}),Lr.isScopeStringFor=e;function e(t,r){if(t.length>r.length){const n=t.charCodeAt(r.length);return n!==58&&n!==63?!1:t.startsWith(r)}else return t===r}return Lr}var Tt={},li;function Er(){if(li)return Tt;li=1,Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.minIdx=e,Tt.knownValuesValidator=t,Tt.isNonNullable=r;function e(n,s){return n===-1?s:s===-1?n:Math.min(n,s)}function t(n){const s=new Set(n);return i=>s.has(i)}function r(n){return n!=null}return Tt}var An={},sr={},ir={},fi;function vt(){if(fi)return ir;fi=1,Object.defineProperty(ir,"__esModule",{value:!0}),ir.ScopeStringSyntax=void 0;const e=Er();class t{constructor(a,c,d){Object.defineProperty(this,"prefix",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"positional",{enumerable:!0,configurable:!0,writable:!0,value:c}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:d})}*keys(){this.params&&(yield*this.params.keys())}getSingle(a){var d;if(!((d=this.params)!=null&&d.has(a)))return;const c=this.params.getAll(a);return c.length>1?null:c[0]}getMulti(a){var c;if((c=this.params)!=null&&c.has(a))return this.params.getAll(a)}toString(){var c;let a=this.prefix;return this.positional!==void 0&&(a+=`:${s(encodeURIComponent(this.positional))}`),(c=this.params)!=null&&c.size&&(a+=`?${s(this.params.toString())}`),a}static fromString(a){const c=a.indexOf("?"),d=a.indexOf(":"),u=(0,e.minIdx)(c,d);if(u===-1)return new t(a);const f=a.slice(0,u),p=d!==-1?c===-1?decodeURIComponent(a.slice(d+1)):d<c?decodeURIComponent(a.slice(d+1,c)):void 0:void 0,g=c!==-1&&c<a.length-1?new URLSearchParams(a.slice(c+1)):void 0;return new t(f,p,g)}}ir.ScopeStringSyntax=t;const r=new Set([":","/","+",",","@","%"]),n=new Map(Array.from(r,i=>[encodeURIComponent(i),i]).filter(([i,a])=>i!==a&&i.length===3&&i.startsWith("%")));function s(i){let a=i.length-2;for(let c=0;c<a;c++)if(i.charCodeAt(c)===37){const d=i.slice(c,c+3),u=n.get(d);u&&(i=`${i.slice(0,c)}${u}${i.slice(c+d.length)}`,c+=u.length-1,a-=d.length-u.length)}return i}return ir}var hi;function Lt(){if(hi)return sr;hi=1,Object.defineProperty(sr,"__esModule",{value:!0}),sr.Parser=void 0;const e=vt();class t{constructor(s,i,a){Object.defineProperty(this,"prefix",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"schema",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"positionalName",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"schemaKeys",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.schemaKeys=new Set(Object.keys(i))}format(s){const i=new URLSearchParams;let a;for(const c of this.schemaKeys){const d=s[c];if(d===void 0)continue;const u=this.schema[c],f=u.normalize?u.normalize(d):d;if(!(!u.required&&(u.default===f||u.multiple&&u.default&&r(u.default,f))))if(Array.isArray(f))if(c===this.positionalName&&f.length===1)a=String(f[0]);else{const p=new Set(f.map(String));for(const g of p)i.append(c,g)}else c===this.positionalName?a=String(f):i.set(c,String(f))}return new e.ScopeStringSyntax(this.prefix,a,i).toString()}parse(s){for(const a of s.keys())if(!this.schemaKeys.has(a))return null;const i=Object.create(null);for(const a of this.schemaKeys){const c=this.schema[a],d=c.multiple?s.getMulti(a):s.getSingle(a);if(d===null)return null;if(d!==void 0){if(a===this.positionalName&&s.positional!==void 0)return null;if(c.multiple){if(!d.length||!d.every(c.validate))return null}else if(!c.validate(d))return null;i[a]=d}else if(a===this.positionalName&&s.positional!==void 0){const{positional:u}=s;if(!c.validate(u))return null;i[a]=c.multiple?[u]:u}else{if(c.required)return null;i[a]=c.default}}return i}}sr.Parser=t;function r(n,s){for(const i of n)if(!s.includes(i))return!1;for(const i of s)if(!n.includes(i))return!1;return!0}return sr}var pi;function mn(){return pi||(pi=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.AccountPermission=e.ACCOUNT_ACTIONS=e.ACCOUNT_ATTRIBUTES=void 0;const t=Lt(),r=vt(),n=yt(),s=Er();e.ACCOUNT_ATTRIBUTES=Object.freeze(["email","repo","status"]),e.ACCOUNT_ACTIONS=Object.freeze(["read","manage"]);class i{constructor(c,d){Object.defineProperty(this,"attr",{enumerable:!0,configurable:!0,writable:!0,value:c}),Object.defineProperty(this,"action",{enumerable:!0,configurable:!0,writable:!0,value:d})}matches(c){return this.attr===c.attr&&(this.action==="manage"||this.action===c.action)}toString(){return i.parser.format(this)}static fromString(c){if(!(0,n.isScopeStringFor)(c,"account"))return null;const d=r.ScopeStringSyntax.fromString(c);return i.fromSyntax(d)}static fromSyntax(c){const d=i.parser.parse(c);return d?new i(d.attr,d.action):null}static scopeNeededFor(c){return i.parser.format(c)}}e.AccountPermission=i,Object.defineProperty(i,"parser",{enumerable:!0,configurable:!0,writable:!0,value:new t.Parser("account",{attr:{multiple:!1,required:!0,validate:(0,s.knownValuesValidator)(e.ACCOUNT_ATTRIBUTES)},action:{multiple:!1,required:!1,validate:(0,s.knownValuesValidator)(e.ACCOUNT_ACTIONS),default:"read"}},"attr")})}(An)),An}var On={},it={},mi;function Pd(){if(mi)return it;mi=1,Object.defineProperty(it,"__esModule",{value:!0}),it.isMime=t,it.isAccept=r,it.matchesAccept=s,it.matchesAnyAccept=a;function e(c){const d=c.indexOf("/");return!(d===-1||d===0||d===c.length-1||c.includes("/",d+1)||c.includes(" "))}function t(c){return e(c)&&!c.includes("*")}function r(c){return typeof c!="string"?!1:c==="*/*"?!0:e(c)?!c.includes("*")||c.endsWith("/*"):!1}function n(c,d){return c==="*/*"?!0:c.endsWith("/*")?d.startsWith(c.slice(0,-1)):c===d}function s(c,d){return t(d)&&n(c,d)}function i(c,d){for(const u of c)if(n(u,d))return!0;return!1}function a(c,d){return t(d)&&i(c,d)}return it}var _i;function Sr(){return _i||(_i=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BlobPermission=e.DEFAULT_ACCEPT=void 0;const t=Pd(),r=Lt(),n=vt(),s=yt();e.DEFAULT_ACCEPT=Object.freeze(["*/*"]);class i{constructor(u){Object.defineProperty(this,"accept",{enumerable:!0,configurable:!0,writable:!0,value:u})}matches(u){return(0,t.matchesAnyAccept)(this.accept,u.mime)}toString(){return i.parser.format(this)}static fromString(u){if(!(0,s.isScopeStringFor)(u,"blob"))return null;const f=n.ScopeStringSyntax.fromString(u);return i.fromSyntax(f)}static fromSyntax(u){const f=i.parser.parse(u);return f?new i(f.accept):null}static scopeNeededFor(u){return i.parser.format({accept:[u.mime]})}}e.BlobPermission=i,Object.defineProperty(i,"parser",{enumerable:!0,configurable:!0,writable:!0,value:new r.Parser("blob",{accept:{multiple:!0,required:!0,validate:t.isAccept,normalize:d=>d.includes("*/*")?e.DEFAULT_ACCEPT:d.map(a).filter(c).sort()}},"accept")});function a(d){return typeof d=="string"?d.toLowerCase():d}function c(d,u,f){if(typeof d!="string"||d.endsWith("/*"))return!0;const p=d.split("/",1)[0];return!f.includes(`${p}/*`)}}(On)),On}var Un={},gi;function _n(){return gi||(gi=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.IdentityPermission=e.IDENTITY_ATTRIBUTES=void 0;const t=Lt(),r=vt(),n=yt(),s=Er();e.IDENTITY_ATTRIBUTES=Object.freeze(["handle","*"]);class i{constructor(c){Object.defineProperty(this,"attr",{enumerable:!0,configurable:!0,writable:!0,value:c})}matches(c){return this.attr==="*"||this.attr===c.attr}toString(){return i.parser.format(this)}static fromString(c){if(!(0,n.isScopeStringFor)(c,"identity"))return null;const d=r.ScopeStringSyntax.fromString(c);return i.fromSyntax(d)}static fromSyntax(c){const d=i.parser.parse(c);return d?new i(d.attr):null}static scopeNeededFor(c){return i.parser.format(c)}}e.IdentityPermission=i,Object.defineProperty(i,"parser",{enumerable:!0,configurable:!0,writable:!0,value:new t.Parser("identity",{attr:{multiple:!1,required:!0,validate:(0,s.knownValuesValidator)(e.IDENTITY_ATTRIBUTES)}},"attr")})}(Un)),Un}var Zn={},at={},le={},be={},ot={},xe={},Br={},$n={},yi;function gn(){return yi||(yi=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getParsedType=e.ZodParsedType=e.objectUtil=e.util=void 0;var t;(function(s){s.assertEqual=d=>d;function i(d){}s.assertIs=i;function a(d){throw new Error}s.assertNever=a,s.arrayToEnum=d=>{const u={};for(const f of d)u[f]=f;return u},s.getValidEnumValues=d=>{const u=s.objectKeys(d).filter(p=>typeof d[d[p]]!="number"),f={};for(const p of u)f[p]=d[p];return s.objectValues(f)},s.objectValues=d=>s.objectKeys(d).map(function(u){return d[u]}),s.objectKeys=typeof Object.keys=="function"?d=>Object.keys(d):d=>{const u=[];for(const f in d)Object.prototype.hasOwnProperty.call(d,f)&&u.push(f);return u},s.find=(d,u)=>{for(const f of d)if(u(f))return f},s.isInteger=typeof Number.isInteger=="function"?d=>Number.isInteger(d):d=>typeof d=="number"&&isFinite(d)&&Math.floor(d)===d;function c(d,u=" | "){return d.map(f=>typeof f=="string"?`'${f}'`:f).join(u)}s.joinValues=c,s.jsonStringifyReplacer=(d,u)=>typeof u=="bigint"?u.toString():u})(t||(e.util=t={}));var r;(function(s){s.mergeShapes=(i,a)=>({...i,...a})})(r||(e.objectUtil=r={})),e.ZodParsedType=t.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);const n=s=>{switch(typeof s){case"undefined":return e.ZodParsedType.undefined;case"string":return e.ZodParsedType.string;case"number":return isNaN(s)?e.ZodParsedType.nan:e.ZodParsedType.number;case"boolean":return e.ZodParsedType.boolean;case"function":return e.ZodParsedType.function;case"bigint":return e.ZodParsedType.bigint;case"symbol":return e.ZodParsedType.symbol;case"object":return Array.isArray(s)?e.ZodParsedType.array:s===null?e.ZodParsedType.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?e.ZodParsedType.promise:typeof Map<"u"&&s instanceof Map?e.ZodParsedType.map:typeof Set<"u"&&s instanceof Set?e.ZodParsedType.set:typeof Date<"u"&&s instanceof Date?e.ZodParsedType.date:e.ZodParsedType.object;default:return e.ZodParsedType.unknown}};e.getParsedType=n}($n)),$n}var Pe={},vi;function Es(){if(vi)return Pe;vi=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.ZodError=Pe.quotelessJson=Pe.ZodIssueCode=void 0;const e=gn();Pe.ZodIssueCode=e.util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);const t=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:");Pe.quotelessJson=t;let r=class Ja extends Error{get errors(){return this.issues}constructor(s){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};const i=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,i):this.__proto__=i,this.name="ZodError",this.issues=s}format(s){const i=s||function(d){return d.message},a={_errors:[]},c=d=>{for(const u of d.issues)if(u.code==="invalid_union")u.unionErrors.map(c);else if(u.code==="invalid_return_type")c(u.returnTypeError);else if(u.code==="invalid_arguments")c(u.argumentsError);else if(u.path.length===0)a._errors.push(i(u));else{let f=a,p=0;for(;p<u.path.length;){const g=u.path[p];p===u.path.length-1?(f[g]=f[g]||{_errors:[]},f[g]._errors.push(i(u))):f[g]=f[g]||{_errors:[]},f=f[g],p++}}};return c(this),a}static assert(s){if(!(s instanceof Ja))throw new Error(`Not a ZodError: ${s}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,e.util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(s=i=>i.message){const i={},a=[];for(const c of this.issues)c.path.length>0?(i[c.path[0]]=i[c.path[0]]||[],i[c.path[0]].push(s(c))):a.push(s(c));return{formErrors:a,fieldErrors:i}}get formErrors(){return this.flatten()}};return Pe.ZodError=r,r.create=n=>new r(n),Pe}var bi;function Qa(){if(bi)return Br;bi=1,Object.defineProperty(Br,"__esModule",{value:!0});const e=gn(),t=Es(),r=(n,s)=>{let i;switch(n.code){case t.ZodIssueCode.invalid_type:n.received===e.ZodParsedType.undefined?i="Required":i=`Expected ${n.expected}, received ${n.received}`;break;case t.ZodIssueCode.invalid_literal:i=`Invalid literal value, expected ${JSON.stringify(n.expected,e.util.jsonStringifyReplacer)}`;break;case t.ZodIssueCode.unrecognized_keys:i=`Unrecognized key(s) in object: ${e.util.joinValues(n.keys,", ")}`;break;case t.ZodIssueCode.invalid_union:i="Invalid input";break;case t.ZodIssueCode.invalid_union_discriminator:i=`Invalid discriminator value. Expected ${e.util.joinValues(n.options)}`;break;case t.ZodIssueCode.invalid_enum_value:i=`Invalid enum value. Expected ${e.util.joinValues(n.options)}, received '${n.received}'`;break;case t.ZodIssueCode.invalid_arguments:i="Invalid function arguments";break;case t.ZodIssueCode.invalid_return_type:i="Invalid function return type";break;case t.ZodIssueCode.invalid_date:i="Invalid date";break;case t.ZodIssueCode.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(i=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(i=`${i} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?i=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?i=`Invalid input: must end with "${n.validation.endsWith}"`:e.util.assertNever(n.validation):n.validation!=="regex"?i=`Invalid ${n.validation}`:i="Invalid";break;case t.ZodIssueCode.too_small:n.type==="array"?i=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?i=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?i=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?i=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:i="Invalid input";break;case t.ZodIssueCode.too_big:n.type==="array"?i=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?i=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?i=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?i=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?i=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:i="Invalid input";break;case t.ZodIssueCode.custom:i="Invalid input";break;case t.ZodIssueCode.invalid_intersection_types:i="Intersection results could not be merged";break;case t.ZodIssueCode.not_multiple_of:i=`Number must be a multiple of ${n.multipleOf}`;break;case t.ZodIssueCode.not_finite:i="Number must be finite";break;default:i=s.defaultError,e.util.assertNever(n)}return{message:i}};return Br.default=r,Br}var xi;function Ss(){if(xi)return xe;xi=1;var e=xe&&xe.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(xe,"__esModule",{value:!0}),xe.getErrorMap=xe.setErrorMap=xe.defaultErrorMap=void 0;const t=e(Qa());xe.defaultErrorMap=t.default;let r=t.default;function n(i){r=i}xe.setErrorMap=n;function s(){return r}return xe.getErrorMap=s,xe}var ar={},Ei;function eo(){return Ei||(Ei=1,function(e){var t=ar&&ar.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(e,"__esModule",{value:!0}),e.isAsync=e.isValid=e.isDirty=e.isAborted=e.OK=e.DIRTY=e.INVALID=e.ParseStatus=e.addIssueToContext=e.EMPTY_PATH=e.makeIssue=void 0;const r=Ss(),n=t(Qa()),s=_=>{const{data:x,path:S,errorMaps:I,issueData:D}=_,k=[...S,...D.path||[]],P={...D,path:k};if(D.message!==void 0)return{...D,path:k,message:D.message};let U="";const $=I.filter(B=>!!B).slice().reverse();for(const B of $)U=B(P,{data:x,defaultError:U}).message;return{...D,path:k,message:U}};e.makeIssue=s,e.EMPTY_PATH=[];function i(_,x){const S=(0,r.getErrorMap)(),I=(0,e.makeIssue)({issueData:x,data:_.data,path:_.path,errorMaps:[_.common.contextualErrorMap,_.schemaErrorMap,S,S===n.default?void 0:n.default].filter(D=>!!D)});_.common.issues.push(I)}e.addIssueToContext=i;class a{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(x,S){const I=[];for(const D of S){if(D.status==="aborted")return e.INVALID;D.status==="dirty"&&x.dirty(),I.push(D.value)}return{status:x.value,value:I}}static async mergeObjectAsync(x,S){const I=[];for(const D of S){const k=await D.key,P=await D.value;I.push({key:k,value:P})}return a.mergeObjectSync(x,I)}static mergeObjectSync(x,S){const I={};for(const D of S){const{key:k,value:P}=D;if(k.status==="aborted"||P.status==="aborted")return e.INVALID;k.status==="dirty"&&x.dirty(),P.status==="dirty"&&x.dirty(),k.value!=="__proto__"&&(typeof P.value<"u"||D.alwaysSet)&&(I[k.value]=P.value)}return{status:x.value,value:I}}}e.ParseStatus=a,e.INVALID=Object.freeze({status:"aborted"});const c=_=>({status:"dirty",value:_});e.DIRTY=c;const d=_=>({status:"valid",value:_});e.OK=d;const u=_=>_.status==="aborted";e.isAborted=u;const f=_=>_.status==="dirty";e.isDirty=f;const p=_=>_.status==="valid";e.isValid=p;const g=_=>typeof Promise<"u"&&_ instanceof Promise;e.isAsync=g}(ar)),ar}var Ln={},Si;function Ad(){return Si||(Si=1,Object.defineProperty(Ln,"__esModule",{value:!0})),Ln}var E={},or={},wi;function Od(){if(wi)return or;wi=1,Object.defineProperty(or,"__esModule",{value:!0}),or.errorUtil=void 0;var e;return function(t){t.errToObj=r=>typeof r=="string"?{message:r}:r||{},t.toString=r=>typeof r=="string"?r:r==null?void 0:r.message}(e||(or.errorUtil=e={})),or}var Ti;function Ud(){if(Ti)return E;Ti=1;var e=E&&E.__classPrivateFieldGet||function(y,o,h,m){if(h==="a"&&!m)throw new TypeError("Private accessor was defined without a getter");if(typeof o=="function"?y!==o||!m:!o.has(y))throw new TypeError("Cannot read private member from an object whose class did not declare it");return h==="m"?m:h==="a"?m.call(y):m?m.value:o.get(y)},t=E&&E.__classPrivateFieldSet||function(y,o,h,m,v){if(m==="m")throw new TypeError("Private method is not writable");if(m==="a"&&!v)throw new TypeError("Private accessor was defined without a setter");if(typeof o=="function"?y!==o||!v:!o.has(y))throw new TypeError("Cannot write private member to an object whose class did not declare it");return m==="a"?v.call(y,h):v?v.value=h:o.set(y,h),h},r,n;Object.defineProperty(E,"__esModule",{value:!0}),E.boolean=E.bigint=E.array=E.any=E.coerce=E.ZodFirstPartyTypeKind=E.late=E.ZodSchema=E.Schema=E.custom=E.ZodReadonly=E.ZodPipeline=E.ZodBranded=E.BRAND=E.ZodNaN=E.ZodCatch=E.ZodDefault=E.ZodNullable=E.ZodOptional=E.ZodTransformer=E.ZodEffects=E.ZodPromise=E.ZodNativeEnum=E.ZodEnum=E.ZodLiteral=E.ZodLazy=E.ZodFunction=E.ZodSet=E.ZodMap=E.ZodRecord=E.ZodTuple=E.ZodIntersection=E.ZodDiscriminatedUnion=E.ZodUnion=E.ZodObject=E.ZodArray=E.ZodVoid=E.ZodNever=E.ZodUnknown=E.ZodAny=E.ZodNull=E.ZodUndefined=E.ZodSymbol=E.ZodDate=E.ZodBoolean=E.ZodBigInt=E.ZodNumber=E.ZodString=E.datetimeRegex=E.ZodType=void 0,E.NEVER=E.void=E.unknown=E.union=E.undefined=E.tuple=E.transformer=E.symbol=E.string=E.strictObject=E.set=E.record=E.promise=E.preprocess=E.pipeline=E.ostring=E.optional=E.onumber=E.oboolean=E.object=E.number=E.nullable=E.null=E.never=E.nativeEnum=E.nan=E.map=E.literal=E.lazy=E.intersection=E.instanceof=E.function=E.enum=E.effect=E.discriminatedUnion=E.date=void 0;const s=Ss(),i=Od(),a=eo(),c=gn(),d=Es();class u{constructor(o,h,m,v){this._cachedPath=[],this.parent=o,this.data=h,this._path=m,this._key=v}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const f=(y,o)=>{if((0,a.isValid)(o))return{success:!0,data:o.value};if(!y.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const h=new d.ZodError(y.common.issues);return this._error=h,this._error}}};function p(y){if(!y)return{};const{errorMap:o,invalid_type_error:h,required_error:m,description:v}=y;if(o&&(h||m))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return o?{errorMap:o,description:v}:{errorMap:(C,j)=>{var O,A;const{message:Z}=y;return C.code==="invalid_enum_value"?{message:Z??j.defaultError}:typeof j.data>"u"?{message:(O=Z??m)!==null&&O!==void 0?O:j.defaultError}:C.code!=="invalid_type"?{message:j.defaultError}:{message:(A=Z??h)!==null&&A!==void 0?A:j.defaultError}},description:v}}class g{get description(){return this._def.description}_getType(o){return(0,c.getParsedType)(o.data)}_getOrReturnCtx(o,h){return h||{common:o.parent.common,data:o.data,parsedType:(0,c.getParsedType)(o.data),schemaErrorMap:this._def.errorMap,path:o.path,parent:o.parent}}_processInputParams(o){return{status:new a.ParseStatus,ctx:{common:o.parent.common,data:o.data,parsedType:(0,c.getParsedType)(o.data),schemaErrorMap:this._def.errorMap,path:o.path,parent:o.parent}}}_parseSync(o){const h=this._parse(o);if((0,a.isAsync)(h))throw new Error("Synchronous parse encountered promise.");return h}_parseAsync(o){const h=this._parse(o);return Promise.resolve(h)}parse(o,h){const m=this.safeParse(o,h);if(m.success)return m.data;throw m.error}safeParse(o,h){var m;const v={common:{issues:[],async:(m=h==null?void 0:h.async)!==null&&m!==void 0?m:!1,contextualErrorMap:h==null?void 0:h.errorMap},path:(h==null?void 0:h.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:o,parsedType:(0,c.getParsedType)(o)},b=this._parseSync({data:o,path:v.path,parent:v});return f(v,b)}"~validate"(o){var h,m;const v={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:o,parsedType:(0,c.getParsedType)(o)};if(!this["~standard"].async)try{const b=this._parseSync({data:o,path:[],parent:v});return(0,a.isValid)(b)?{value:b.value}:{issues:v.common.issues}}catch(b){!((m=(h=b==null?void 0:b.message)===null||h===void 0?void 0:h.toLowerCase())===null||m===void 0)&&m.includes("encountered")&&(this["~standard"].async=!0),v.common={issues:[],async:!0}}return this._parseAsync({data:o,path:[],parent:v}).then(b=>(0,a.isValid)(b)?{value:b.value}:{issues:v.common.issues})}async parseAsync(o,h){const m=await this.safeParseAsync(o,h);if(m.success)return m.data;throw m.error}async safeParseAsync(o,h){const m={common:{issues:[],contextualErrorMap:h==null?void 0:h.errorMap,async:!0},path:(h==null?void 0:h.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:o,parsedType:(0,c.getParsedType)(o)},v=this._parse({data:o,path:m.path,parent:m}),b=await((0,a.isAsync)(v)?v:Promise.resolve(v));return f(m,b)}refine(o,h){const m=v=>typeof h=="string"||typeof h>"u"?{message:h}:typeof h=="function"?h(v):h;return this._refinement((v,b)=>{const C=o(v),j=()=>b.addIssue({code:d.ZodIssueCode.custom,...m(v)});return typeof Promise<"u"&&C instanceof Promise?C.then(O=>O?!0:(j(),!1)):C?!0:(j(),!1)})}refinement(o,h){return this._refinement((m,v)=>o(m)?!0:(v.addIssue(typeof h=="function"?h(m,v):h),!1))}_refinement(o){return new ve({schema:this,typeName:L.ZodEffects,effect:{type:"refinement",refinement:o}})}superRefine(o){return this._refinement(o)}constructor(o){this.spa=this.safeParseAsync,this._def=o,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:h=>this["~validate"](h)}}optional(){return Ie.create(this,this._def)}nullable(){return Ye.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ye.create(this)}promise(){return St.create(this,this._def)}or(o){return Ht.create([this,o],this._def)}and(o){return Wt.create(this,o,this._def)}transform(o){return new ve({...p(this._def),schema:this,typeName:L.ZodEffects,effect:{type:"transform",transform:o}})}default(o){const h=typeof o=="function"?o:()=>o;return new er({...p(this._def),innerType:this,defaultValue:h,typeName:L.ZodDefault})}brand(){return new Dn({typeName:L.ZodBranded,type:this,...p(this._def)})}catch(o){const h=typeof o=="function"?o:()=>o;return new tr({...p(this._def),innerType:this,catchValue:h,typeName:L.ZodCatch})}describe(o){const h=this.constructor;return new h({...this._def,description:o})}pipe(o){return rr.create(this,o)}readonly(){return nr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}E.ZodType=g,E.Schema=g,E.ZodSchema=g;const _=/^c[^\s-]{8,}$/i,x=/^[0-9a-z]+$/,S=/^[0-9A-HJKMNP-TV-Z]{26}$/i,I=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,D=/^[a-z0-9_-]{21}$/i,k=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,P=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,U=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,$="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let B;const V=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,K=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,F=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ae=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,M=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,te=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,X="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",re=new RegExp(`^${X}$`);function zt(y){let o="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return y.precision?o=`${o}\\.\\d{${y.precision}}`:y.precision==null&&(o=`${o}(\\.\\d+)?`),o}function Ve(y){return new RegExp(`^${zt(y)}$`)}function Xs(y){let o=`${X}T${zt(y)}`;const h=[];return h.push(y.local?"Z?":"Z"),y.offset&&h.push("([+-]\\d{2}:?\\d{2})"),o=`${o}(${h.join("|")})`,new RegExp(`^${o}$`)}E.datetimeRegex=Xs;function vc(y,o){return!!((o==="v4"||!o)&&V.test(y)||(o==="v6"||!o)&&F.test(y))}function bc(y,o){if(!k.test(y))return!1;try{const[h]=y.split("."),m=h.replace(/-/g,"+").replace(/_/g,"/").padEnd(h.length+(4-h.length%4)%4,"="),v=JSON.parse(atob(m));return!(typeof v!="object"||v===null||!v.typ||!v.alg||o&&v.alg!==o)}catch{return!1}}function xc(y,o){return!!((o==="v4"||!o)&&K.test(y)||(o==="v6"||!o)&&ae.test(y))}class ge extends g{_parse(o){if(this._def.coerce&&(o.data=String(o.data)),this._getType(o)!==c.ZodParsedType.string){const b=this._getOrReturnCtx(o);return(0,a.addIssueToContext)(b,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.string,received:b.parsedType}),a.INVALID}const m=new a.ParseStatus;let v;for(const b of this._def.checks)if(b.kind==="min")o.data.length<b.value&&(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{code:d.ZodIssueCode.too_small,minimum:b.value,type:"string",inclusive:!0,exact:!1,message:b.message}),m.dirty());else if(b.kind==="max")o.data.length>b.value&&(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{code:d.ZodIssueCode.too_big,maximum:b.value,type:"string",inclusive:!0,exact:!1,message:b.message}),m.dirty());else if(b.kind==="length"){const C=o.data.length>b.value,j=o.data.length<b.value;(C||j)&&(v=this._getOrReturnCtx(o,v),C?(0,a.addIssueToContext)(v,{code:d.ZodIssueCode.too_big,maximum:b.value,type:"string",inclusive:!0,exact:!0,message:b.message}):j&&(0,a.addIssueToContext)(v,{code:d.ZodIssueCode.too_small,minimum:b.value,type:"string",inclusive:!0,exact:!0,message:b.message}),m.dirty())}else if(b.kind==="email")U.test(o.data)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{validation:"email",code:d.ZodIssueCode.invalid_string,message:b.message}),m.dirty());else if(b.kind==="emoji")B||(B=new RegExp($,"u")),B.test(o.data)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{validation:"emoji",code:d.ZodIssueCode.invalid_string,message:b.message}),m.dirty());else if(b.kind==="uuid")I.test(o.data)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{validation:"uuid",code:d.ZodIssueCode.invalid_string,message:b.message}),m.dirty());else if(b.kind==="nanoid")D.test(o.data)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{validation:"nanoid",code:d.ZodIssueCode.invalid_string,message:b.message}),m.dirty());else if(b.kind==="cuid")_.test(o.data)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{validation:"cuid",code:d.ZodIssueCode.invalid_string,message:b.message}),m.dirty());else if(b.kind==="cuid2")x.test(o.data)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{validation:"cuid2",code:d.ZodIssueCode.invalid_string,message:b.message}),m.dirty());else if(b.kind==="ulid")S.test(o.data)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{validation:"ulid",code:d.ZodIssueCode.invalid_string,message:b.message}),m.dirty());else if(b.kind==="url")try{new URL(o.data)}catch{v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{validation:"url",code:d.ZodIssueCode.invalid_string,message:b.message}),m.dirty()}else b.kind==="regex"?(b.regex.lastIndex=0,b.regex.test(o.data)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{validation:"regex",code:d.ZodIssueCode.invalid_string,message:b.message}),m.dirty())):b.kind==="trim"?o.data=o.data.trim():b.kind==="includes"?o.data.includes(b.value,b.position)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{code:d.ZodIssueCode.invalid_string,validation:{includes:b.value,position:b.position},message:b.message}),m.dirty()):b.kind==="toLowerCase"?o.data=o.data.toLowerCase():b.kind==="toUpperCase"?o.data=o.data.toUpperCase():b.kind==="startsWith"?o.data.startsWith(b.value)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{code:d.ZodIssueCode.invalid_string,validation:{startsWith:b.value},message:b.message}),m.dirty()):b.kind==="endsWith"?o.data.endsWith(b.value)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{code:d.ZodIssueCode.invalid_string,validation:{endsWith:b.value},message:b.message}),m.dirty()):b.kind==="datetime"?Xs(b).test(o.data)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{code:d.ZodIssueCode.invalid_string,validation:"datetime",message:b.message}),m.dirty()):b.kind==="date"?re.test(o.data)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{code:d.ZodIssueCode.invalid_string,validation:"date",message:b.message}),m.dirty()):b.kind==="time"?Ve(b).test(o.data)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{code:d.ZodIssueCode.invalid_string,validation:"time",message:b.message}),m.dirty()):b.kind==="duration"?P.test(o.data)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{validation:"duration",code:d.ZodIssueCode.invalid_string,message:b.message}),m.dirty()):b.kind==="ip"?vc(o.data,b.version)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{validation:"ip",code:d.ZodIssueCode.invalid_string,message:b.message}),m.dirty()):b.kind==="jwt"?bc(o.data,b.alg)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{validation:"jwt",code:d.ZodIssueCode.invalid_string,message:b.message}),m.dirty()):b.kind==="cidr"?xc(o.data,b.version)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{validation:"cidr",code:d.ZodIssueCode.invalid_string,message:b.message}),m.dirty()):b.kind==="base64"?M.test(o.data)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{validation:"base64",code:d.ZodIssueCode.invalid_string,message:b.message}),m.dirty()):b.kind==="base64url"?te.test(o.data)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{validation:"base64url",code:d.ZodIssueCode.invalid_string,message:b.message}),m.dirty()):c.util.assertNever(b);return{status:m.value,value:o.data}}_regex(o,h,m){return this.refinement(v=>o.test(v),{validation:h,code:d.ZodIssueCode.invalid_string,...i.errorUtil.errToObj(m)})}_addCheck(o){return new ge({...this._def,checks:[...this._def.checks,o]})}email(o){return this._addCheck({kind:"email",...i.errorUtil.errToObj(o)})}url(o){return this._addCheck({kind:"url",...i.errorUtil.errToObj(o)})}emoji(o){return this._addCheck({kind:"emoji",...i.errorUtil.errToObj(o)})}uuid(o){return this._addCheck({kind:"uuid",...i.errorUtil.errToObj(o)})}nanoid(o){return this._addCheck({kind:"nanoid",...i.errorUtil.errToObj(o)})}cuid(o){return this._addCheck({kind:"cuid",...i.errorUtil.errToObj(o)})}cuid2(o){return this._addCheck({kind:"cuid2",...i.errorUtil.errToObj(o)})}ulid(o){return this._addCheck({kind:"ulid",...i.errorUtil.errToObj(o)})}base64(o){return this._addCheck({kind:"base64",...i.errorUtil.errToObj(o)})}base64url(o){return this._addCheck({kind:"base64url",...i.errorUtil.errToObj(o)})}jwt(o){return this._addCheck({kind:"jwt",...i.errorUtil.errToObj(o)})}ip(o){return this._addCheck({kind:"ip",...i.errorUtil.errToObj(o)})}cidr(o){return this._addCheck({kind:"cidr",...i.errorUtil.errToObj(o)})}datetime(o){var h,m;return typeof o=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:o}):this._addCheck({kind:"datetime",precision:typeof(o==null?void 0:o.precision)>"u"?null:o==null?void 0:o.precision,offset:(h=o==null?void 0:o.offset)!==null&&h!==void 0?h:!1,local:(m=o==null?void 0:o.local)!==null&&m!==void 0?m:!1,...i.errorUtil.errToObj(o==null?void 0:o.message)})}date(o){return this._addCheck({kind:"date",message:o})}time(o){return typeof o=="string"?this._addCheck({kind:"time",precision:null,message:o}):this._addCheck({kind:"time",precision:typeof(o==null?void 0:o.precision)>"u"?null:o==null?void 0:o.precision,...i.errorUtil.errToObj(o==null?void 0:o.message)})}duration(o){return this._addCheck({kind:"duration",...i.errorUtil.errToObj(o)})}regex(o,h){return this._addCheck({kind:"regex",regex:o,...i.errorUtil.errToObj(h)})}includes(o,h){return this._addCheck({kind:"includes",value:o,position:h==null?void 0:h.position,...i.errorUtil.errToObj(h==null?void 0:h.message)})}startsWith(o,h){return this._addCheck({kind:"startsWith",value:o,...i.errorUtil.errToObj(h)})}endsWith(o,h){return this._addCheck({kind:"endsWith",value:o,...i.errorUtil.errToObj(h)})}min(o,h){return this._addCheck({kind:"min",value:o,...i.errorUtil.errToObj(h)})}max(o,h){return this._addCheck({kind:"max",value:o,...i.errorUtil.errToObj(h)})}length(o,h){return this._addCheck({kind:"length",value:o,...i.errorUtil.errToObj(h)})}nonempty(o){return this.min(1,i.errorUtil.errToObj(o))}trim(){return new ge({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ge({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ge({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(o=>o.kind==="datetime")}get isDate(){return!!this._def.checks.find(o=>o.kind==="date")}get isTime(){return!!this._def.checks.find(o=>o.kind==="time")}get isDuration(){return!!this._def.checks.find(o=>o.kind==="duration")}get isEmail(){return!!this._def.checks.find(o=>o.kind==="email")}get isURL(){return!!this._def.checks.find(o=>o.kind==="url")}get isEmoji(){return!!this._def.checks.find(o=>o.kind==="emoji")}get isUUID(){return!!this._def.checks.find(o=>o.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(o=>o.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(o=>o.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(o=>o.kind==="cuid2")}get isULID(){return!!this._def.checks.find(o=>o.kind==="ulid")}get isIP(){return!!this._def.checks.find(o=>o.kind==="ip")}get isCIDR(){return!!this._def.checks.find(o=>o.kind==="cidr")}get isBase64(){return!!this._def.checks.find(o=>o.kind==="base64")}get isBase64url(){return!!this._def.checks.find(o=>o.kind==="base64url")}get minLength(){let o=null;for(const h of this._def.checks)h.kind==="min"&&(o===null||h.value>o)&&(o=h.value);return o}get maxLength(){let o=null;for(const h of this._def.checks)h.kind==="max"&&(o===null||h.value<o)&&(o=h.value);return o}}E.ZodString=ge,ge.create=y=>{var o;return new ge({checks:[],typeName:L.ZodString,coerce:(o=y==null?void 0:y.coerce)!==null&&o!==void 0?o:!1,...p(y)})};function Ec(y,o){const h=(y.toString().split(".")[1]||"").length,m=(o.toString().split(".")[1]||"").length,v=h>m?h:m,b=parseInt(y.toFixed(v).replace(".","")),C=parseInt(o.toFixed(v).replace(".",""));return b%C/Math.pow(10,v)}class qe extends g{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(o){if(this._def.coerce&&(o.data=Number(o.data)),this._getType(o)!==c.ZodParsedType.number){const b=this._getOrReturnCtx(o);return(0,a.addIssueToContext)(b,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.number,received:b.parsedType}),a.INVALID}let m;const v=new a.ParseStatus;for(const b of this._def.checks)b.kind==="int"?c.util.isInteger(o.data)||(m=this._getOrReturnCtx(o,m),(0,a.addIssueToContext)(m,{code:d.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:b.message}),v.dirty()):b.kind==="min"?(b.inclusive?o.data<b.value:o.data<=b.value)&&(m=this._getOrReturnCtx(o,m),(0,a.addIssueToContext)(m,{code:d.ZodIssueCode.too_small,minimum:b.value,type:"number",inclusive:b.inclusive,exact:!1,message:b.message}),v.dirty()):b.kind==="max"?(b.inclusive?o.data>b.value:o.data>=b.value)&&(m=this._getOrReturnCtx(o,m),(0,a.addIssueToContext)(m,{code:d.ZodIssueCode.too_big,maximum:b.value,type:"number",inclusive:b.inclusive,exact:!1,message:b.message}),v.dirty()):b.kind==="multipleOf"?Ec(o.data,b.value)!==0&&(m=this._getOrReturnCtx(o,m),(0,a.addIssueToContext)(m,{code:d.ZodIssueCode.not_multiple_of,multipleOf:b.value,message:b.message}),v.dirty()):b.kind==="finite"?Number.isFinite(o.data)||(m=this._getOrReturnCtx(o,m),(0,a.addIssueToContext)(m,{code:d.ZodIssueCode.not_finite,message:b.message}),v.dirty()):c.util.assertNever(b);return{status:v.value,value:o.data}}gte(o,h){return this.setLimit("min",o,!0,i.errorUtil.toString(h))}gt(o,h){return this.setLimit("min",o,!1,i.errorUtil.toString(h))}lte(o,h){return this.setLimit("max",o,!0,i.errorUtil.toString(h))}lt(o,h){return this.setLimit("max",o,!1,i.errorUtil.toString(h))}setLimit(o,h,m,v){return new qe({...this._def,checks:[...this._def.checks,{kind:o,value:h,inclusive:m,message:i.errorUtil.toString(v)}]})}_addCheck(o){return new qe({...this._def,checks:[...this._def.checks,o]})}int(o){return this._addCheck({kind:"int",message:i.errorUtil.toString(o)})}positive(o){return this._addCheck({kind:"min",value:0,inclusive:!1,message:i.errorUtil.toString(o)})}negative(o){return this._addCheck({kind:"max",value:0,inclusive:!1,message:i.errorUtil.toString(o)})}nonpositive(o){return this._addCheck({kind:"max",value:0,inclusive:!0,message:i.errorUtil.toString(o)})}nonnegative(o){return this._addCheck({kind:"min",value:0,inclusive:!0,message:i.errorUtil.toString(o)})}multipleOf(o,h){return this._addCheck({kind:"multipleOf",value:o,message:i.errorUtil.toString(h)})}finite(o){return this._addCheck({kind:"finite",message:i.errorUtil.toString(o)})}safe(o){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:i.errorUtil.toString(o)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:i.errorUtil.toString(o)})}get minValue(){let o=null;for(const h of this._def.checks)h.kind==="min"&&(o===null||h.value>o)&&(o=h.value);return o}get maxValue(){let o=null;for(const h of this._def.checks)h.kind==="max"&&(o===null||h.value<o)&&(o=h.value);return o}get isInt(){return!!this._def.checks.find(o=>o.kind==="int"||o.kind==="multipleOf"&&c.util.isInteger(o.value))}get isFinite(){let o=null,h=null;for(const m of this._def.checks){if(m.kind==="finite"||m.kind==="int"||m.kind==="multipleOf")return!0;m.kind==="min"?(h===null||m.value>h)&&(h=m.value):m.kind==="max"&&(o===null||m.value<o)&&(o=m.value)}return Number.isFinite(h)&&Number.isFinite(o)}}E.ZodNumber=qe,qe.create=y=>new qe({checks:[],typeName:L.ZodNumber,coerce:(y==null?void 0:y.coerce)||!1,...p(y)});class ze extends g{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(o){if(this._def.coerce)try{o.data=BigInt(o.data)}catch{return this._getInvalidInput(o)}if(this._getType(o)!==c.ZodParsedType.bigint)return this._getInvalidInput(o);let m;const v=new a.ParseStatus;for(const b of this._def.checks)b.kind==="min"?(b.inclusive?o.data<b.value:o.data<=b.value)&&(m=this._getOrReturnCtx(o,m),(0,a.addIssueToContext)(m,{code:d.ZodIssueCode.too_small,type:"bigint",minimum:b.value,inclusive:b.inclusive,message:b.message}),v.dirty()):b.kind==="max"?(b.inclusive?o.data>b.value:o.data>=b.value)&&(m=this._getOrReturnCtx(o,m),(0,a.addIssueToContext)(m,{code:d.ZodIssueCode.too_big,type:"bigint",maximum:b.value,inclusive:b.inclusive,message:b.message}),v.dirty()):b.kind==="multipleOf"?o.data%b.value!==BigInt(0)&&(m=this._getOrReturnCtx(o,m),(0,a.addIssueToContext)(m,{code:d.ZodIssueCode.not_multiple_of,multipleOf:b.value,message:b.message}),v.dirty()):c.util.assertNever(b);return{status:v.value,value:o.data}}_getInvalidInput(o){const h=this._getOrReturnCtx(o);return(0,a.addIssueToContext)(h,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.bigint,received:h.parsedType}),a.INVALID}gte(o,h){return this.setLimit("min",o,!0,i.errorUtil.toString(h))}gt(o,h){return this.setLimit("min",o,!1,i.errorUtil.toString(h))}lte(o,h){return this.setLimit("max",o,!0,i.errorUtil.toString(h))}lt(o,h){return this.setLimit("max",o,!1,i.errorUtil.toString(h))}setLimit(o,h,m,v){return new ze({...this._def,checks:[...this._def.checks,{kind:o,value:h,inclusive:m,message:i.errorUtil.toString(v)}]})}_addCheck(o){return new ze({...this._def,checks:[...this._def.checks,o]})}positive(o){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:i.errorUtil.toString(o)})}negative(o){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:i.errorUtil.toString(o)})}nonpositive(o){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:i.errorUtil.toString(o)})}nonnegative(o){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:i.errorUtil.toString(o)})}multipleOf(o,h){return this._addCheck({kind:"multipleOf",value:o,message:i.errorUtil.toString(h)})}get minValue(){let o=null;for(const h of this._def.checks)h.kind==="min"&&(o===null||h.value>o)&&(o=h.value);return o}get maxValue(){let o=null;for(const h of this._def.checks)h.kind==="max"&&(o===null||h.value<o)&&(o=h.value);return o}}E.ZodBigInt=ze,ze.create=y=>{var o;return new ze({checks:[],typeName:L.ZodBigInt,coerce:(o=y==null?void 0:y.coerce)!==null&&o!==void 0?o:!1,...p(y)})};class Gt extends g{_parse(o){if(this._def.coerce&&(o.data=!!o.data),this._getType(o)!==c.ZodParsedType.boolean){const m=this._getOrReturnCtx(o);return(0,a.addIssueToContext)(m,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.boolean,received:m.parsedType}),a.INVALID}return(0,a.OK)(o.data)}}E.ZodBoolean=Gt,Gt.create=y=>new Gt({typeName:L.ZodBoolean,coerce:(y==null?void 0:y.coerce)||!1,...p(y)});class et extends g{_parse(o){if(this._def.coerce&&(o.data=new Date(o.data)),this._getType(o)!==c.ZodParsedType.date){const b=this._getOrReturnCtx(o);return(0,a.addIssueToContext)(b,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.date,received:b.parsedType}),a.INVALID}if(isNaN(o.data.getTime())){const b=this._getOrReturnCtx(o);return(0,a.addIssueToContext)(b,{code:d.ZodIssueCode.invalid_date}),a.INVALID}const m=new a.ParseStatus;let v;for(const b of this._def.checks)b.kind==="min"?o.data.getTime()<b.value&&(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{code:d.ZodIssueCode.too_small,message:b.message,inclusive:!0,exact:!1,minimum:b.value,type:"date"}),m.dirty()):b.kind==="max"?o.data.getTime()>b.value&&(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{code:d.ZodIssueCode.too_big,message:b.message,inclusive:!0,exact:!1,maximum:b.value,type:"date"}),m.dirty()):c.util.assertNever(b);return{status:m.value,value:new Date(o.data.getTime())}}_addCheck(o){return new et({...this._def,checks:[...this._def.checks,o]})}min(o,h){return this._addCheck({kind:"min",value:o.getTime(),message:i.errorUtil.toString(h)})}max(o,h){return this._addCheck({kind:"max",value:o.getTime(),message:i.errorUtil.toString(h)})}get minDate(){let o=null;for(const h of this._def.checks)h.kind==="min"&&(o===null||h.value>o)&&(o=h.value);return o!=null?new Date(o):null}get maxDate(){let o=null;for(const h of this._def.checks)h.kind==="max"&&(o===null||h.value<o)&&(o=h.value);return o!=null?new Date(o):null}}E.ZodDate=et,et.create=y=>new et({checks:[],coerce:(y==null?void 0:y.coerce)||!1,typeName:L.ZodDate,...p(y)});class Pr extends g{_parse(o){if(this._getType(o)!==c.ZodParsedType.symbol){const m=this._getOrReturnCtx(o);return(0,a.addIssueToContext)(m,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.symbol,received:m.parsedType}),a.INVALID}return(0,a.OK)(o.data)}}E.ZodSymbol=Pr,Pr.create=y=>new Pr({typeName:L.ZodSymbol,...p(y)});class Yt extends g{_parse(o){if(this._getType(o)!==c.ZodParsedType.undefined){const m=this._getOrReturnCtx(o);return(0,a.addIssueToContext)(m,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.undefined,received:m.parsedType}),a.INVALID}return(0,a.OK)(o.data)}}E.ZodUndefined=Yt,Yt.create=y=>new Yt({typeName:L.ZodUndefined,...p(y)});class Ft extends g{_parse(o){if(this._getType(o)!==c.ZodParsedType.null){const m=this._getOrReturnCtx(o);return(0,a.addIssueToContext)(m,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.null,received:m.parsedType}),a.INVALID}return(0,a.OK)(o.data)}}E.ZodNull=Ft,Ft.create=y=>new Ft({typeName:L.ZodNull,...p(y)});class bt extends g{constructor(){super(...arguments),this._any=!0}_parse(o){return(0,a.OK)(o.data)}}E.ZodAny=bt,bt.create=y=>new bt({typeName:L.ZodAny,...p(y)});class tt extends g{constructor(){super(...arguments),this._unknown=!0}_parse(o){return(0,a.OK)(o.data)}}E.ZodUnknown=tt,tt.create=y=>new tt({typeName:L.ZodUnknown,...p(y)});class Ne extends g{_parse(o){const h=this._getOrReturnCtx(o);return(0,a.addIssueToContext)(h,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.never,received:h.parsedType}),a.INVALID}}E.ZodNever=Ne,Ne.create=y=>new Ne({typeName:L.ZodNever,...p(y)});class Ar extends g{_parse(o){if(this._getType(o)!==c.ZodParsedType.undefined){const m=this._getOrReturnCtx(o);return(0,a.addIssueToContext)(m,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.void,received:m.parsedType}),a.INVALID}return(0,a.OK)(o.data)}}E.ZodVoid=Ar,Ar.create=y=>new Ar({typeName:L.ZodVoid,...p(y)});class ye extends g{_parse(o){const{ctx:h,status:m}=this._processInputParams(o),v=this._def;if(h.parsedType!==c.ZodParsedType.array)return(0,a.addIssueToContext)(h,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.array,received:h.parsedType}),a.INVALID;if(v.exactLength!==null){const C=h.data.length>v.exactLength.value,j=h.data.length<v.exactLength.value;(C||j)&&((0,a.addIssueToContext)(h,{code:C?d.ZodIssueCode.too_big:d.ZodIssueCode.too_small,minimum:j?v.exactLength.value:void 0,maximum:C?v.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:v.exactLength.message}),m.dirty())}if(v.minLength!==null&&h.data.length<v.minLength.value&&((0,a.addIssueToContext)(h,{code:d.ZodIssueCode.too_small,minimum:v.minLength.value,type:"array",inclusive:!0,exact:!1,message:v.minLength.message}),m.dirty()),v.maxLength!==null&&h.data.length>v.maxLength.value&&((0,a.addIssueToContext)(h,{code:d.ZodIssueCode.too_big,maximum:v.maxLength.value,type:"array",inclusive:!0,exact:!1,message:v.maxLength.message}),m.dirty()),h.common.async)return Promise.all([...h.data].map((C,j)=>v.type._parseAsync(new u(h,C,h.path,j)))).then(C=>a.ParseStatus.mergeArray(m,C));const b=[...h.data].map((C,j)=>v.type._parseSync(new u(h,C,h.path,j)));return a.ParseStatus.mergeArray(m,b)}get element(){return this._def.type}min(o,h){return new ye({...this._def,minLength:{value:o,message:i.errorUtil.toString(h)}})}max(o,h){return new ye({...this._def,maxLength:{value:o,message:i.errorUtil.toString(h)}})}length(o,h){return new ye({...this._def,exactLength:{value:o,message:i.errorUtil.toString(h)}})}nonempty(o){return this.min(1,o)}}E.ZodArray=ye,ye.create=(y,o)=>new ye({type:y,minLength:null,maxLength:null,exactLength:null,typeName:L.ZodArray,...p(o)});function xt(y){if(y instanceof H){const o={};for(const h in y.shape){const m=y.shape[h];o[h]=Ie.create(xt(m))}return new H({...y._def,shape:()=>o})}else return y instanceof ye?new ye({...y._def,type:xt(y.element)}):y instanceof Ie?Ie.create(xt(y.unwrap())):y instanceof Ye?Ye.create(xt(y.unwrap())):y instanceof Te?Te.create(y.items.map(o=>xt(o))):y}class H extends g{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const o=this._def.shape(),h=c.util.objectKeys(o);return this._cached={shape:o,keys:h}}_parse(o){if(this._getType(o)!==c.ZodParsedType.object){const A=this._getOrReturnCtx(o);return(0,a.addIssueToContext)(A,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.object,received:A.parsedType}),a.INVALID}const{status:m,ctx:v}=this._processInputParams(o),{shape:b,keys:C}=this._getCached(),j=[];if(!(this._def.catchall instanceof Ne&&this._def.unknownKeys==="strip"))for(const A in v.data)C.includes(A)||j.push(A);const O=[];for(const A of C){const Z=b[A],oe=v.data[A];O.push({key:{status:"valid",value:A},value:Z._parse(new u(v,oe,v.path,A)),alwaysSet:A in v.data})}if(this._def.catchall instanceof Ne){const A=this._def.unknownKeys;if(A==="passthrough")for(const Z of j)O.push({key:{status:"valid",value:Z},value:{status:"valid",value:v.data[Z]}});else if(A==="strict")j.length>0&&((0,a.addIssueToContext)(v,{code:d.ZodIssueCode.unrecognized_keys,keys:j}),m.dirty());else if(A!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const A=this._def.catchall;for(const Z of j){const oe=v.data[Z];O.push({key:{status:"valid",value:Z},value:A._parse(new u(v,oe,v.path,Z)),alwaysSet:Z in v.data})}}return v.common.async?Promise.resolve().then(async()=>{const A=[];for(const Z of O){const oe=await Z.key,$r=await Z.value;A.push({key:oe,value:$r,alwaysSet:Z.alwaysSet})}return A}).then(A=>a.ParseStatus.mergeObjectSync(m,A)):a.ParseStatus.mergeObjectSync(m,O)}get shape(){return this._def.shape()}strict(o){return i.errorUtil.errToObj,new H({...this._def,unknownKeys:"strict",...o!==void 0?{errorMap:(h,m)=>{var v,b,C,j;const O=(C=(b=(v=this._def).errorMap)===null||b===void 0?void 0:b.call(v,h,m).message)!==null&&C!==void 0?C:m.defaultError;return h.code==="unrecognized_keys"?{message:(j=i.errorUtil.errToObj(o).message)!==null&&j!==void 0?j:O}:{message:O}}}:{}})}strip(){return new H({...this._def,unknownKeys:"strip"})}passthrough(){return new H({...this._def,unknownKeys:"passthrough"})}extend(o){return new H({...this._def,shape:()=>({...this._def.shape(),...o})})}merge(o){return new H({unknownKeys:o._def.unknownKeys,catchall:o._def.catchall,shape:()=>({...this._def.shape(),...o._def.shape()}),typeName:L.ZodObject})}setKey(o,h){return this.augment({[o]:h})}catchall(o){return new H({...this._def,catchall:o})}pick(o){const h={};return c.util.objectKeys(o).forEach(m=>{o[m]&&this.shape[m]&&(h[m]=this.shape[m])}),new H({...this._def,shape:()=>h})}omit(o){const h={};return c.util.objectKeys(this.shape).forEach(m=>{o[m]||(h[m]=this.shape[m])}),new H({...this._def,shape:()=>h})}deepPartial(){return xt(this)}partial(o){const h={};return c.util.objectKeys(this.shape).forEach(m=>{const v=this.shape[m];o&&!o[m]?h[m]=v:h[m]=v.optional()}),new H({...this._def,shape:()=>h})}required(o){const h={};return c.util.objectKeys(this.shape).forEach(m=>{if(o&&!o[m])h[m]=this.shape[m];else{let b=this.shape[m];for(;b instanceof Ie;)b=b._def.innerType;h[m]=b}}),new H({...this._def,shape:()=>h})}keyof(){return Js(c.util.objectKeys(this.shape))}}E.ZodObject=H,H.create=(y,o)=>new H({shape:()=>y,unknownKeys:"strip",catchall:Ne.create(),typeName:L.ZodObject,...p(o)}),H.strictCreate=(y,o)=>new H({shape:()=>y,unknownKeys:"strict",catchall:Ne.create(),typeName:L.ZodObject,...p(o)}),H.lazycreate=(y,o)=>new H({shape:y,unknownKeys:"strip",catchall:Ne.create(),typeName:L.ZodObject,...p(o)});class Ht extends g{_parse(o){const{ctx:h}=this._processInputParams(o),m=this._def.options;function v(b){for(const j of b)if(j.result.status==="valid")return j.result;for(const j of b)if(j.result.status==="dirty")return h.common.issues.push(...j.ctx.common.issues),j.result;const C=b.map(j=>new d.ZodError(j.ctx.common.issues));return(0,a.addIssueToContext)(h,{code:d.ZodIssueCode.invalid_union,unionErrors:C}),a.INVALID}if(h.common.async)return Promise.all(m.map(async b=>{const C={...h,common:{...h.common,issues:[]},parent:null};return{result:await b._parseAsync({data:h.data,path:h.path,parent:C}),ctx:C}})).then(v);{let b;const C=[];for(const O of m){const A={...h,common:{...h.common,issues:[]},parent:null},Z=O._parseSync({data:h.data,path:h.path,parent:A});if(Z.status==="valid")return Z;Z.status==="dirty"&&!b&&(b={result:Z,ctx:A}),A.common.issues.length&&C.push(A.common.issues)}if(b)return h.common.issues.push(...b.ctx.common.issues),b.result;const j=C.map(O=>new d.ZodError(O));return(0,a.addIssueToContext)(h,{code:d.ZodIssueCode.invalid_union,unionErrors:j}),a.INVALID}}get options(){return this._def.options}}E.ZodUnion=Ht,Ht.create=(y,o)=>new Ht({options:y,typeName:L.ZodUnion,...p(o)});const ke=y=>y instanceof Xt?ke(y.schema):y instanceof ve?ke(y.innerType()):y instanceof Jt?[y.value]:y instanceof Ge?y.options:y instanceof Qt?c.util.objectValues(y.enum):y instanceof er?ke(y._def.innerType):y instanceof Yt?[void 0]:y instanceof Ft?[null]:y instanceof Ie?[void 0,...ke(y.unwrap())]:y instanceof Ye?[null,...ke(y.unwrap())]:y instanceof Dn||y instanceof nr?ke(y.unwrap()):y instanceof tr?ke(y._def.innerType):[];class Or extends g{_parse(o){const{ctx:h}=this._processInputParams(o);if(h.parsedType!==c.ZodParsedType.object)return(0,a.addIssueToContext)(h,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.object,received:h.parsedType}),a.INVALID;const m=this.discriminator,v=h.data[m],b=this.optionsMap.get(v);return b?h.common.async?b._parseAsync({data:h.data,path:h.path,parent:h}):b._parseSync({data:h.data,path:h.path,parent:h}):((0,a.addIssueToContext)(h,{code:d.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[m]}),a.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(o,h,m){const v=new Map;for(const b of h){const C=ke(b.shape[o]);if(!C.length)throw new Error(`A discriminator value for key \`${o}\` could not be extracted from all schema options`);for(const j of C){if(v.has(j))throw new Error(`Discriminator property ${String(o)} has duplicate value ${String(j)}`);v.set(j,b)}}return new Or({typeName:L.ZodDiscriminatedUnion,discriminator:o,options:h,optionsMap:v,...p(m)})}}E.ZodDiscriminatedUnion=Or;function Cn(y,o){const h=(0,c.getParsedType)(y),m=(0,c.getParsedType)(o);if(y===o)return{valid:!0,data:y};if(h===c.ZodParsedType.object&&m===c.ZodParsedType.object){const v=c.util.objectKeys(o),b=c.util.objectKeys(y).filter(j=>v.indexOf(j)!==-1),C={...y,...o};for(const j of b){const O=Cn(y[j],o[j]);if(!O.valid)return{valid:!1};C[j]=O.data}return{valid:!0,data:C}}else if(h===c.ZodParsedType.array&&m===c.ZodParsedType.array){if(y.length!==o.length)return{valid:!1};const v=[];for(let b=0;b<y.length;b++){const C=y[b],j=o[b],O=Cn(C,j);if(!O.valid)return{valid:!1};v.push(O.data)}return{valid:!0,data:v}}else return h===c.ZodParsedType.date&&m===c.ZodParsedType.date&&+y==+o?{valid:!0,data:y}:{valid:!1}}class Wt extends g{_parse(o){const{status:h,ctx:m}=this._processInputParams(o),v=(b,C)=>{if((0,a.isAborted)(b)||(0,a.isAborted)(C))return a.INVALID;const j=Cn(b.value,C.value);return j.valid?(((0,a.isDirty)(b)||(0,a.isDirty)(C))&&h.dirty(),{status:h.value,value:j.data}):((0,a.addIssueToContext)(m,{code:d.ZodIssueCode.invalid_intersection_types}),a.INVALID)};return m.common.async?Promise.all([this._def.left._parseAsync({data:m.data,path:m.path,parent:m}),this._def.right._parseAsync({data:m.data,path:m.path,parent:m})]).then(([b,C])=>v(b,C)):v(this._def.left._parseSync({data:m.data,path:m.path,parent:m}),this._def.right._parseSync({data:m.data,path:m.path,parent:m}))}}E.ZodIntersection=Wt,Wt.create=(y,o,h)=>new Wt({left:y,right:o,typeName:L.ZodIntersection,...p(h)});class Te extends g{_parse(o){const{status:h,ctx:m}=this._processInputParams(o);if(m.parsedType!==c.ZodParsedType.array)return(0,a.addIssueToContext)(m,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.array,received:m.parsedType}),a.INVALID;if(m.data.length<this._def.items.length)return(0,a.addIssueToContext)(m,{code:d.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),a.INVALID;!this._def.rest&&m.data.length>this._def.items.length&&((0,a.addIssueToContext)(m,{code:d.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),h.dirty());const b=[...m.data].map((C,j)=>{const O=this._def.items[j]||this._def.rest;return O?O._parse(new u(m,C,m.path,j)):null}).filter(C=>!!C);return m.common.async?Promise.all(b).then(C=>a.ParseStatus.mergeArray(h,C)):a.ParseStatus.mergeArray(h,b)}get items(){return this._def.items}rest(o){return new Te({...this._def,rest:o})}}E.ZodTuple=Te,Te.create=(y,o)=>{if(!Array.isArray(y))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Te({items:y,typeName:L.ZodTuple,rest:null,...p(o)})};class Kt extends g{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(o){const{status:h,ctx:m}=this._processInputParams(o);if(m.parsedType!==c.ZodParsedType.object)return(0,a.addIssueToContext)(m,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.object,received:m.parsedType}),a.INVALID;const v=[],b=this._def.keyType,C=this._def.valueType;for(const j in m.data)v.push({key:b._parse(new u(m,j,m.path,j)),value:C._parse(new u(m,m.data[j],m.path,j)),alwaysSet:j in m.data});return m.common.async?a.ParseStatus.mergeObjectAsync(h,v):a.ParseStatus.mergeObjectSync(h,v)}get element(){return this._def.valueType}static create(o,h,m){return h instanceof g?new Kt({keyType:o,valueType:h,typeName:L.ZodRecord,...p(m)}):new Kt({keyType:ge.create(),valueType:o,typeName:L.ZodRecord,...p(h)})}}E.ZodRecord=Kt;class Ur extends g{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(o){const{status:h,ctx:m}=this._processInputParams(o);if(m.parsedType!==c.ZodParsedType.map)return(0,a.addIssueToContext)(m,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.map,received:m.parsedType}),a.INVALID;const v=this._def.keyType,b=this._def.valueType,C=[...m.data.entries()].map(([j,O],A)=>({key:v._parse(new u(m,j,m.path,[A,"key"])),value:b._parse(new u(m,O,m.path,[A,"value"]))}));if(m.common.async){const j=new Map;return Promise.resolve().then(async()=>{for(const O of C){const A=await O.key,Z=await O.value;if(A.status==="aborted"||Z.status==="aborted")return a.INVALID;(A.status==="dirty"||Z.status==="dirty")&&h.dirty(),j.set(A.value,Z.value)}return{status:h.value,value:j}})}else{const j=new Map;for(const O of C){const A=O.key,Z=O.value;if(A.status==="aborted"||Z.status==="aborted")return a.INVALID;(A.status==="dirty"||Z.status==="dirty")&&h.dirty(),j.set(A.value,Z.value)}return{status:h.value,value:j}}}}E.ZodMap=Ur,Ur.create=(y,o,h)=>new Ur({valueType:o,keyType:y,typeName:L.ZodMap,...p(h)});class rt extends g{_parse(o){const{status:h,ctx:m}=this._processInputParams(o);if(m.parsedType!==c.ZodParsedType.set)return(0,a.addIssueToContext)(m,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.set,received:m.parsedType}),a.INVALID;const v=this._def;v.minSize!==null&&m.data.size<v.minSize.value&&((0,a.addIssueToContext)(m,{code:d.ZodIssueCode.too_small,minimum:v.minSize.value,type:"set",inclusive:!0,exact:!1,message:v.minSize.message}),h.dirty()),v.maxSize!==null&&m.data.size>v.maxSize.value&&((0,a.addIssueToContext)(m,{code:d.ZodIssueCode.too_big,maximum:v.maxSize.value,type:"set",inclusive:!0,exact:!1,message:v.maxSize.message}),h.dirty());const b=this._def.valueType;function C(O){const A=new Set;for(const Z of O){if(Z.status==="aborted")return a.INVALID;Z.status==="dirty"&&h.dirty(),A.add(Z.value)}return{status:h.value,value:A}}const j=[...m.data.values()].map((O,A)=>b._parse(new u(m,O,m.path,A)));return m.common.async?Promise.all(j).then(O=>C(O)):C(j)}min(o,h){return new rt({...this._def,minSize:{value:o,message:i.errorUtil.toString(h)}})}max(o,h){return new rt({...this._def,maxSize:{value:o,message:i.errorUtil.toString(h)}})}size(o,h){return this.min(o,h).max(o,h)}nonempty(o){return this.min(1,o)}}E.ZodSet=rt,rt.create=(y,o)=>new rt({valueType:y,minSize:null,maxSize:null,typeName:L.ZodSet,...p(o)});class Et extends g{constructor(){super(...arguments),this.validate=this.implement}_parse(o){const{ctx:h}=this._processInputParams(o);if(h.parsedType!==c.ZodParsedType.function)return(0,a.addIssueToContext)(h,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.function,received:h.parsedType}),a.INVALID;function m(j,O){return(0,a.makeIssue)({data:j,path:h.path,errorMaps:[h.common.contextualErrorMap,h.schemaErrorMap,(0,s.getErrorMap)(),s.defaultErrorMap].filter(A=>!!A),issueData:{code:d.ZodIssueCode.invalid_arguments,argumentsError:O}})}function v(j,O){return(0,a.makeIssue)({data:j,path:h.path,errorMaps:[h.common.contextualErrorMap,h.schemaErrorMap,(0,s.getErrorMap)(),s.defaultErrorMap].filter(A=>!!A),issueData:{code:d.ZodIssueCode.invalid_return_type,returnTypeError:O}})}const b={errorMap:h.common.contextualErrorMap},C=h.data;if(this._def.returns instanceof St){const j=this;return(0,a.OK)(async function(...O){const A=new d.ZodError([]),Z=await j._def.args.parseAsync(O,b).catch(Nn=>{throw A.addIssue(m(O,Nn)),A}),oe=await Reflect.apply(C,this,Z);return await j._def.returns._def.type.parseAsync(oe,b).catch(Nn=>{throw A.addIssue(v(oe,Nn)),A})})}else{const j=this;return(0,a.OK)(function(...O){const A=j._def.args.safeParse(O,b);if(!A.success)throw new d.ZodError([m(O,A.error)]);const Z=Reflect.apply(C,this,A.data),oe=j._def.returns.safeParse(Z,b);if(!oe.success)throw new d.ZodError([v(Z,oe.error)]);return oe.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...o){return new Et({...this._def,args:Te.create(o).rest(tt.create())})}returns(o){return new Et({...this._def,returns:o})}implement(o){return this.parse(o)}strictImplement(o){return this.parse(o)}static create(o,h,m){return new Et({args:o||Te.create([]).rest(tt.create()),returns:h||tt.create(),typeName:L.ZodFunction,...p(m)})}}E.ZodFunction=Et;class Xt extends g{get schema(){return this._def.getter()}_parse(o){const{ctx:h}=this._processInputParams(o);return this._def.getter()._parse({data:h.data,path:h.path,parent:h})}}E.ZodLazy=Xt,Xt.create=(y,o)=>new Xt({getter:y,typeName:L.ZodLazy,...p(o)});class Jt extends g{_parse(o){if(o.data!==this._def.value){const h=this._getOrReturnCtx(o);return(0,a.addIssueToContext)(h,{received:h.data,code:d.ZodIssueCode.invalid_literal,expected:this._def.value}),a.INVALID}return{status:"valid",value:o.data}}get value(){return this._def.value}}E.ZodLiteral=Jt,Jt.create=(y,o)=>new Jt({value:y,typeName:L.ZodLiteral,...p(o)});function Js(y,o){return new Ge({values:y,typeName:L.ZodEnum,...p(o)})}class Ge extends g{constructor(){super(...arguments),r.set(this,void 0)}_parse(o){if(typeof o.data!="string"){const h=this._getOrReturnCtx(o),m=this._def.values;return(0,a.addIssueToContext)(h,{expected:c.util.joinValues(m),received:h.parsedType,code:d.ZodIssueCode.invalid_type}),a.INVALID}if(e(this,r,"f")||t(this,r,new Set(this._def.values),"f"),!e(this,r,"f").has(o.data)){const h=this._getOrReturnCtx(o),m=this._def.values;return(0,a.addIssueToContext)(h,{received:h.data,code:d.ZodIssueCode.invalid_enum_value,options:m}),a.INVALID}return(0,a.OK)(o.data)}get options(){return this._def.values}get enum(){const o={};for(const h of this._def.values)o[h]=h;return o}get Values(){const o={};for(const h of this._def.values)o[h]=h;return o}get Enum(){const o={};for(const h of this._def.values)o[h]=h;return o}extract(o,h=this._def){return Ge.create(o,{...this._def,...h})}exclude(o,h=this._def){return Ge.create(this.options.filter(m=>!o.includes(m)),{...this._def,...h})}}E.ZodEnum=Ge,r=new WeakMap,Ge.create=Js;class Qt extends g{constructor(){super(...arguments),n.set(this,void 0)}_parse(o){const h=c.util.getValidEnumValues(this._def.values),m=this._getOrReturnCtx(o);if(m.parsedType!==c.ZodParsedType.string&&m.parsedType!==c.ZodParsedType.number){const v=c.util.objectValues(h);return(0,a.addIssueToContext)(m,{expected:c.util.joinValues(v),received:m.parsedType,code:d.ZodIssueCode.invalid_type}),a.INVALID}if(e(this,n,"f")||t(this,n,new Set(c.util.getValidEnumValues(this._def.values)),"f"),!e(this,n,"f").has(o.data)){const v=c.util.objectValues(h);return(0,a.addIssueToContext)(m,{received:m.data,code:d.ZodIssueCode.invalid_enum_value,options:v}),a.INVALID}return(0,a.OK)(o.data)}get enum(){return this._def.values}}E.ZodNativeEnum=Qt,n=new WeakMap,Qt.create=(y,o)=>new Qt({values:y,typeName:L.ZodNativeEnum,...p(o)});class St extends g{unwrap(){return this._def.type}_parse(o){const{ctx:h}=this._processInputParams(o);if(h.parsedType!==c.ZodParsedType.promise&&h.common.async===!1)return(0,a.addIssueToContext)(h,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.promise,received:h.parsedType}),a.INVALID;const m=h.parsedType===c.ZodParsedType.promise?h.data:Promise.resolve(h.data);return(0,a.OK)(m.then(v=>this._def.type.parseAsync(v,{path:h.path,errorMap:h.common.contextualErrorMap})))}}E.ZodPromise=St,St.create=(y,o)=>new St({type:y,typeName:L.ZodPromise,...p(o)});class ve extends g{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===L.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(o){const{status:h,ctx:m}=this._processInputParams(o),v=this._def.effect||null,b={addIssue:C=>{(0,a.addIssueToContext)(m,C),C.fatal?h.abort():h.dirty()},get path(){return m.path}};if(b.addIssue=b.addIssue.bind(b),v.type==="preprocess"){const C=v.transform(m.data,b);if(m.common.async)return Promise.resolve(C).then(async j=>{if(h.value==="aborted")return a.INVALID;const O=await this._def.schema._parseAsync({data:j,path:m.path,parent:m});return O.status==="aborted"?a.INVALID:O.status==="dirty"||h.value==="dirty"?(0,a.DIRTY)(O.value):O});{if(h.value==="aborted")return a.INVALID;const j=this._def.schema._parseSync({data:C,path:m.path,parent:m});return j.status==="aborted"?a.INVALID:j.status==="dirty"||h.value==="dirty"?(0,a.DIRTY)(j.value):j}}if(v.type==="refinement"){const C=j=>{const O=v.refinement(j,b);if(m.common.async)return Promise.resolve(O);if(O instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return j};if(m.common.async===!1){const j=this._def.schema._parseSync({data:m.data,path:m.path,parent:m});return j.status==="aborted"?a.INVALID:(j.status==="dirty"&&h.dirty(),C(j.value),{status:h.value,value:j.value})}else return this._def.schema._parseAsync({data:m.data,path:m.path,parent:m}).then(j=>j.status==="aborted"?a.INVALID:(j.status==="dirty"&&h.dirty(),C(j.value).then(()=>({status:h.value,value:j.value}))))}if(v.type==="transform")if(m.common.async===!1){const C=this._def.schema._parseSync({data:m.data,path:m.path,parent:m});if(!(0,a.isValid)(C))return C;const j=v.transform(C.value,b);if(j instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:h.value,value:j}}else return this._def.schema._parseAsync({data:m.data,path:m.path,parent:m}).then(C=>(0,a.isValid)(C)?Promise.resolve(v.transform(C.value,b)).then(j=>({status:h.value,value:j})):C);c.util.assertNever(v)}}E.ZodEffects=ve,E.ZodTransformer=ve,ve.create=(y,o,h)=>new ve({schema:y,typeName:L.ZodEffects,effect:o,...p(h)}),ve.createWithPreprocess=(y,o,h)=>new ve({schema:o,effect:{type:"preprocess",transform:y},typeName:L.ZodEffects,...p(h)});class Ie extends g{_parse(o){return this._getType(o)===c.ZodParsedType.undefined?(0,a.OK)(void 0):this._def.innerType._parse(o)}unwrap(){return this._def.innerType}}E.ZodOptional=Ie,Ie.create=(y,o)=>new Ie({innerType:y,typeName:L.ZodOptional,...p(o)});class Ye extends g{_parse(o){return this._getType(o)===c.ZodParsedType.null?(0,a.OK)(null):this._def.innerType._parse(o)}unwrap(){return this._def.innerType}}E.ZodNullable=Ye,Ye.create=(y,o)=>new Ye({innerType:y,typeName:L.ZodNullable,...p(o)});class er extends g{_parse(o){const{ctx:h}=this._processInputParams(o);let m=h.data;return h.parsedType===c.ZodParsedType.undefined&&(m=this._def.defaultValue()),this._def.innerType._parse({data:m,path:h.path,parent:h})}removeDefault(){return this._def.innerType}}E.ZodDefault=er,er.create=(y,o)=>new er({innerType:y,typeName:L.ZodDefault,defaultValue:typeof o.default=="function"?o.default:()=>o.default,...p(o)});class tr extends g{_parse(o){const{ctx:h}=this._processInputParams(o),m={...h,common:{...h.common,issues:[]}},v=this._def.innerType._parse({data:m.data,path:m.path,parent:{...m}});return(0,a.isAsync)(v)?v.then(b=>({status:"valid",value:b.status==="valid"?b.value:this._def.catchValue({get error(){return new d.ZodError(m.common.issues)},input:m.data})})):{status:"valid",value:v.status==="valid"?v.value:this._def.catchValue({get error(){return new d.ZodError(m.common.issues)},input:m.data})}}removeCatch(){return this._def.innerType}}E.ZodCatch=tr,tr.create=(y,o)=>new tr({innerType:y,typeName:L.ZodCatch,catchValue:typeof o.catch=="function"?o.catch:()=>o.catch,...p(o)});class Zr extends g{_parse(o){if(this._getType(o)!==c.ZodParsedType.nan){const m=this._getOrReturnCtx(o);return(0,a.addIssueToContext)(m,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.nan,received:m.parsedType}),a.INVALID}return{status:"valid",value:o.data}}}E.ZodNaN=Zr,Zr.create=y=>new Zr({typeName:L.ZodNaN,...p(y)}),E.BRAND=Symbol("zod_brand");class Dn extends g{_parse(o){const{ctx:h}=this._processInputParams(o),m=h.data;return this._def.type._parse({data:m,path:h.path,parent:h})}unwrap(){return this._def.type}}E.ZodBranded=Dn;class rr extends g{_parse(o){const{status:h,ctx:m}=this._processInputParams(o);if(m.common.async)return(async()=>{const b=await this._def.in._parseAsync({data:m.data,path:m.path,parent:m});return b.status==="aborted"?a.INVALID:b.status==="dirty"?(h.dirty(),(0,a.DIRTY)(b.value)):this._def.out._parseAsync({data:b.value,path:m.path,parent:m})})();{const v=this._def.in._parseSync({data:m.data,path:m.path,parent:m});return v.status==="aborted"?a.INVALID:v.status==="dirty"?(h.dirty(),{status:"dirty",value:v.value}):this._def.out._parseSync({data:v.value,path:m.path,parent:m})}}static create(o,h){return new rr({in:o,out:h,typeName:L.ZodPipeline})}}E.ZodPipeline=rr;class nr extends g{_parse(o){const h=this._def.innerType._parse(o),m=v=>((0,a.isValid)(v)&&(v.value=Object.freeze(v.value)),v);return(0,a.isAsync)(h)?h.then(v=>m(v)):m(h)}unwrap(){return this._def.innerType}}E.ZodReadonly=nr,nr.create=(y,o)=>new nr({innerType:y,typeName:L.ZodReadonly,...p(o)});function Qs(y,o){const h=typeof y=="function"?y(o):typeof y=="string"?{message:y}:y;return typeof h=="string"?{message:h}:h}function ei(y,o={},h){return y?bt.create().superRefine((m,v)=>{var b,C;const j=y(m);if(j instanceof Promise)return j.then(O=>{var A,Z;if(!O){const oe=Qs(o,m),$r=(Z=(A=oe.fatal)!==null&&A!==void 0?A:h)!==null&&Z!==void 0?Z:!0;v.addIssue({code:"custom",...oe,fatal:$r})}});if(!j){const O=Qs(o,m),A=(C=(b=O.fatal)!==null&&b!==void 0?b:h)!==null&&C!==void 0?C:!0;v.addIssue({code:"custom",...O,fatal:A})}}):bt.create()}E.custom=ei,E.late={object:H.lazycreate};var L;(function(y){y.ZodString="ZodString",y.ZodNumber="ZodNumber",y.ZodNaN="ZodNaN",y.ZodBigInt="ZodBigInt",y.ZodBoolean="ZodBoolean",y.ZodDate="ZodDate",y.ZodSymbol="ZodSymbol",y.ZodUndefined="ZodUndefined",y.ZodNull="ZodNull",y.ZodAny="ZodAny",y.ZodUnknown="ZodUnknown",y.ZodNever="ZodNever",y.ZodVoid="ZodVoid",y.ZodArray="ZodArray",y.ZodObject="ZodObject",y.ZodUnion="ZodUnion",y.ZodDiscriminatedUnion="ZodDiscriminatedUnion",y.ZodIntersection="ZodIntersection",y.ZodTuple="ZodTuple",y.ZodRecord="ZodRecord",y.ZodMap="ZodMap",y.ZodSet="ZodSet",y.ZodFunction="ZodFunction",y.ZodLazy="ZodLazy",y.ZodLiteral="ZodLiteral",y.ZodEnum="ZodEnum",y.ZodEffects="ZodEffects",y.ZodNativeEnum="ZodNativeEnum",y.ZodOptional="ZodOptional",y.ZodNullable="ZodNullable",y.ZodDefault="ZodDefault",y.ZodCatch="ZodCatch",y.ZodPromise="ZodPromise",y.ZodBranded="ZodBranded",y.ZodPipeline="ZodPipeline",y.ZodReadonly="ZodReadonly"})(L||(E.ZodFirstPartyTypeKind=L={}));const Sc=(y,o={message:`Input not instance of ${y.name}`})=>ei(h=>h instanceof y,o);E.instanceof=Sc;const ti=ge.create;E.string=ti;const ri=qe.create;E.number=ri;const wc=Zr.create;E.nan=wc;const Tc=ze.create;E.bigint=Tc;const ni=Gt.create;E.boolean=ni;const Ic=et.create;E.date=Ic;const jc=Pr.create;E.symbol=jc;const Rc=Yt.create;E.undefined=Rc;const Cc=Ft.create;E.null=Cc;const Dc=bt.create;E.any=Dc;const Nc=tt.create;E.unknown=Nc;const kc=Ne.create;E.never=kc;const Pc=Ar.create;E.void=Pc;const Ac=ye.create;E.array=Ac;const Oc=H.create;E.object=Oc;const Uc=H.strictCreate;E.strictObject=Uc;const Zc=Ht.create;E.union=Zc;const $c=Or.create;E.discriminatedUnion=$c;const Lc=Wt.create;E.intersection=Lc;const Bc=Te.create;E.tuple=Bc;const Mc=Kt.create;E.record=Mc;const Vc=Ur.create;E.map=Vc;const qc=rt.create;E.set=qc;const zc=Et.create;E.function=zc;const Gc=Xt.create;E.lazy=Gc;const Yc=Jt.create;E.literal=Yc;const Fc=Ge.create;E.enum=Fc;const Hc=Qt.create;E.nativeEnum=Hc;const Wc=St.create;E.promise=Wc;const si=ve.create;E.effect=si,E.transformer=si;const Kc=Ie.create;E.optional=Kc;const Xc=Ye.create;E.nullable=Xc;const Jc=ve.createWithPreprocess;E.preprocess=Jc;const Qc=rr.create;E.pipeline=Qc;const ed=()=>ti().optional();E.ostring=ed;const td=()=>ri().optional();E.onumber=td;const rd=()=>ni().optional();return E.oboolean=rd,E.coerce={string:y=>ge.create({...y,coerce:!0}),number:y=>qe.create({...y,coerce:!0}),boolean:y=>Gt.create({...y,coerce:!0}),bigint:y=>ze.create({...y,coerce:!0}),date:y=>et.create({...y,coerce:!0})},E.NEVER=a.INVALID,E}var Ii;function ji(){return Ii||(Ii=1,function(e){var t=ot&&ot.__createBinding||(Object.create?function(n,s,i,a){a===void 0&&(a=i);var c=Object.getOwnPropertyDescriptor(s,i);(!c||("get"in c?!s.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(n,a,c)}:function(n,s,i,a){a===void 0&&(a=i),n[a]=s[i]}),r=ot&&ot.__exportStar||function(n,s){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,n,i)};Object.defineProperty(e,"__esModule",{value:!0}),r(Ss(),e),r(eo(),e),r(Ad(),e),r(gn(),e),r(Ud(),e),r(Es(),e)}(ot)),ot}var Ri;function ws(){return Ri||(Ri=1,function(e){var t=be&&be.__createBinding||(Object.create?function(a,c,d,u){u===void 0&&(u=d);var f=Object.getOwnPropertyDescriptor(c,d);(!f||("get"in f?!c.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return c[d]}}),Object.defineProperty(a,u,f)}:function(a,c,d,u){u===void 0&&(u=d),a[u]=c[d]}),r=be&&be.__setModuleDefault||(Object.create?function(a,c){Object.defineProperty(a,"default",{enumerable:!0,value:c})}:function(a,c){a.default=c}),n=be&&be.__importStar||function(a){if(a&&a.__esModule)return a;var c={};if(a!=null)for(var d in a)d!=="default"&&Object.prototype.hasOwnProperty.call(a,d)&&t(c,a,d);return r(c,a),c},s=be&&be.__exportStar||function(a,c){for(var d in a)d!=="default"&&!Object.prototype.hasOwnProperty.call(c,d)&&t(c,a,d)};Object.defineProperty(e,"__esModule",{value:!0}),e.z=void 0;const i=n(ji());e.z=i,s(ji(),e),e.default=i}(be)),be}var ct={},Ci;function wr(){if(Ci)return ct;Ci=1,Object.defineProperty(ct,"__esModule",{value:!0}),ct.InvalidDidError=ct.DidError=void 0;class e extends Error{constructor(n,s,i,a=400,c){super(s,{cause:c}),Object.defineProperty(this,"did",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:a})}get statusCode(){return this.status}toString(){return`${this.constructor.name} ${this.code} (${this.did}): ${this.message}`}static from(n,s){if(n instanceof e)return n;const i=n instanceof Error?n.message:typeof n=="string"?n:"An unknown error occurred",a=(typeof(n==null?void 0:n.statusCode)=="number"?n.statusCode:void 0)??(typeof(n==null?void 0:n.status)=="number"?n.status:void 0);return new e(s,i,"did-unknown-error",a,n)}}ct.DidError=e;class t extends e{constructor(n,s,i){super(n,s,"did-invalid",400,i)}}return ct.InvalidDidError=t,ct}var cr={},Di;function to(){if(Di)return cr;Di=1,Object.defineProperty(cr,"__esModule",{value:!0}),cr.isFragment=e,cr.isHexDigit=t;function e(r,n=0,s=r.length){let i;for(let a=n;a<s;a++)if(i=r.charCodeAt(a),!(i>=65&&i<=90||i>=97&&i<=122||i>=48&&i<=57||i===45||i===46||i===95||i===126)){if(!(i===33||i===36||i===38||i===39||i===40||i===41||i===42||i===43||i===44||i===59||i===61)){if(!(i===58||i===64)){if(!(i===47||i===63))if(i===37){if(a+2>=s||!t(r.charCodeAt(a+1))||!t(r.charCodeAt(a+2)))return!1;a+=2}else return!1}}}return!0}function t(r){return r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102}return cr}var dt={},Fe={},Ni;function Zd(){if(Ni)return Fe;Ni=1,Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.DID_PLC_PREFIX=void 0,Fe.isDidPlc=s,Fe.asDidPlc=i,Fe.assertDidPlc=a;const e=wr(),t="did:plc:";Fe.DID_PLC_PREFIX=t;const r=t.length,n=32;function s(d){if(typeof d!="string"||d.length!==n||!d.startsWith(t))return!1;for(let u=r;u<n;u++)if(!c(d.charCodeAt(u)))return!1;return!0}function i(d){return a(d),d}function a(d){if(typeof d!="string")throw new e.InvalidDidError(typeof d,"DID must be a string");if(!d.startsWith(t))throw new e.InvalidDidError(d,"Invalid did:plc prefix");if(d.length!==n)throw new e.InvalidDidError(d,`did:plc must be ${n} characters long`);for(let u=r;u<n;u++)if(!c(d.charCodeAt(u)))throw new e.InvalidDidError(d,`Invalid character at position ${u}`)}const c=d=>d>=97&&d<=122||d>=50&&d<=55;return Fe}var Bn={},fe={},ki;function Ts(){if(ki)return fe;ki=1,Object.defineProperty(fe,"__esModule",{value:!0}),fe.didSchema=fe.DID_PREFIX=void 0,fe.assertDidMethod=s,fe.extractDidMethod=i,fe.assertDidMsid=a,fe.assertDid=c,fe.isDid=d,fe.asDid=u;const e=ws(),t=wr(),r="did:";fe.DID_PREFIX=r;const n=r.length;function s(f,p=0,g=f.length){if(!Number.isFinite(g)||!Number.isFinite(p)||g<p||g>f.length)throw new TypeError("Invalid start or end position");if(g===p)throw new t.InvalidDidError(f,"Empty method name");let _;for(let x=p;x<g;x++)if(_=f.charCodeAt(x),(_<97||_>122)&&(_<48||_>57))throw new t.InvalidDidError(f,`Invalid character at position ${x} in DID method name`)}function i(f){const p=f.indexOf(":",n);return f.slice(n,p)}function a(f,p=0,g=f.length){if(!Number.isFinite(g)||!Number.isFinite(p)||g<p||g>f.length)throw new TypeError("Invalid start or end position");if(g===p)throw new t.InvalidDidError(f,"DID method-specific id must not be empty");let _;for(let x=p;x<g;x++)if(_=f.charCodeAt(x),(_<97||_>122)&&(_<65||_>90)&&(_<48||_>57)&&_!==46&&_!==45&&_!==95){if(_===58){if(x===g-1)throw new t.InvalidDidError(f,'DID cannot end with ":"');continue}if(_===37){if(_=f.charCodeAt(++x),(_<48||_>57)&&(_<65||_>70))throw new t.InvalidDidError(f,`Invalid pct-encoded character at position ${x}`);if(_=f.charCodeAt(++x),(_<48||_>57)&&(_<65||_>70))throw new t.InvalidDidError(f,`Invalid pct-encoded character at position ${x}`);if(x>=g)throw new t.InvalidDidError(f,`Incomplete pct-encoded character at position ${x-2}`);continue}throw new t.InvalidDidError(f,`Disallowed character in DID at position ${x}`)}}function c(f){if(typeof f!="string")throw new t.InvalidDidError(typeof f,"DID must be a string");const{length:p}=f;if(p>2048)throw new t.InvalidDidError(f,"DID is too long (2048 chars max)");if(!f.startsWith(r))throw new t.InvalidDidError(f,`DID requires "${r}" prefix`);const g=f.indexOf(":",n);if(g===-1)throw new t.InvalidDidError(f,"Missing colon after method name");s(f,n,g),a(f,g+1,p)}function d(f){try{return c(f),!0}catch(p){if(p instanceof t.DidError)return!1;throw p}}function u(f){return c(f),f}return fe.didSchema=e.z.string().superRefine((f,p)=>{try{return c(f),!0}catch(g){return p.addIssue({code:e.z.ZodIssueCode.custom,message:g instanceof Error?g.message:"Unexpected error"}),!1}}),fe}var Pi;function $d(){return Pi||(Pi=1,function(e){var f;Object.defineProperty(e,"__esModule",{value:!0}),e.DID_WEB_PREFIX=void 0,e.isDidWeb=s,e.asDidWeb=i,e.assertDidWeb=a,e.didWebToUrl=c,e.urlToDidWeb=d,e.buildDidWebUrl=u;const t=wr(),r=Ts();e.DID_WEB_PREFIX="did:web:";const n=((f=URL.canParse)==null?void 0:f.bind(URL))??((p,g)=>{try{return new URL(p,g),!0}catch{return!1}});function s(p){if(typeof p!="string"||!p.startsWith(e.DID_WEB_PREFIX)||p.charAt(e.DID_WEB_PREFIX.length)===":")return!1;try{(0,r.assertDidMsid)(p,e.DID_WEB_PREFIX.length)}catch{return!1}return n(u(p))}function i(p){return a(p),p}function a(p){if(typeof p!="string")throw new t.InvalidDidError(typeof p,"DID must be a string");if(!p.startsWith(e.DID_WEB_PREFIX))throw new t.InvalidDidError(p,"Invalid did:web prefix");if(p.charAt(e.DID_WEB_PREFIX.length)===":")throw new t.InvalidDidError(p,"did:web MSID must not start with a colon");if((0,r.assertDidMsid)(p,e.DID_WEB_PREFIX.length),!n(u(p)))throw new t.InvalidDidError(p,"Invalid Web DID")}function c(p){try{return new URL(u(p))}catch(g){throw new t.InvalidDidError(p,"Invalid Web DID",g)}}function d(p){const g=p.port?`%3A${p.port}`:"",_=p.pathname==="/"?"":p.pathname.replaceAll("/",":");return`did:web:${p.hostname}${g}${_}`}function u(p){const g=e.DID_WEB_PREFIX.length,_=p.indexOf(":",g),S=(_===-1?p.slice(g):p.slice(g,_)).replaceAll("%3A",":"),I=_===-1?"":p.slice(_).replaceAll(":","/");return`${S.startsWith("localhost")&&(S.length===9||S.charCodeAt(9)===58)?"http":"https"}://${S}${I}`}}(Bn)),Bn}var Ai;function ro(){return Ai||(Ai=1,function(e){var t=dt&&dt.__createBinding||(Object.create?function(n,s,i,a){a===void 0&&(a=i);var c=Object.getOwnPropertyDescriptor(s,i);(!c||("get"in c?!s.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(n,a,c)}:function(n,s,i,a){a===void 0&&(a=i),n[a]=s[i]}),r=dt&&dt.__exportStar||function(n,s){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,n,i)};Object.defineProperty(e,"__esModule",{value:!0}),r(Zd(),e),r($d(),e)}(dt)),dt}var Oi;function Ld(){if(Oi)return le;Oi=1,Object.defineProperty(le,"__esModule",{value:!0}),le.isAtprotoAudience=le.atprotoDidSchema=void 0,le.isAtprotoDid=s,le.asAtprotoDid=i,le.assertAtprotoDid=a,le.assertAtprotoDidWeb=c,le.isAtprotoDidWeb=d,le.extractPdsUrl=_;const e=ws(),t=wr(),r=to(),n=ro();le.atprotoDidSchema=e.z.string().refine(s,'Atproto only allows "plc" and "web" DID methods');function s(S){return(0,n.isDidPlc)(S)||d(S)}function i(S){return a(S),S}function a(S){if(typeof S!="string")throw new t.InvalidDidError(typeof S,"DID must be a string");if(S.startsWith(n.DID_PLC_PREFIX))(0,n.assertDidPlc)(S);else if(S.startsWith(n.DID_WEB_PREFIX))c(S);else throw new t.InvalidDidError(S,'Atproto only allows "plc" and "web" DID methods')}function c(S){if((0,n.assertDidWeb)(S),u(S))throw new t.InvalidDidError(S,"Atproto does not allow path components in Web DIDs");if(p(S))throw new t.InvalidDidError(S,"Atproto does not allow port numbers in Web DIDs, except for localhost")}function d(S){return!(!(0,n.isDidWeb)(S)||u(S)||p(S))}function u(S){return S.includes(":",n.DID_WEB_PREFIX.length)}function f(S){return S==="did:web:localhost"||S.startsWith("did:web:localhost:")||S.startsWith("did:web:localhost%3A")}function p(S){if(f(S))return!1;const I=S.indexOf(":",n.DID_WEB_PREFIX.length);return I===-1?S.includes("%3A",n.DID_WEB_PREFIX.length):S.lastIndexOf("%3A",I)!==-1}const g=S=>{if(typeof S!="string")return!1;const I=S.indexOf("#");return I===-1||S.indexOf("#",I+1)!==-1?!1:(0,r.isFragment)(S,I+1)&&s(S.slice(0,I))};le.isAtprotoAudience=g;function _(S){var D;const I=(D=S.service)==null?void 0:D.find(x,S);if(!I)throw new t.DidError(S.id,`Identity "${S.id}" does not have a PDS URL`,"did-service-not-found");try{return new URL(I.serviceEndpoint)}catch(k){throw new t.DidError(S.id,`Invalid PDS URL in DID document: ${I.serviceEndpoint}`,"did-document-format-error",void 0,k)}}function x(S){return typeof S.serviceEndpoint=="string"&&S.type==="AtprotoPersonalDataServer"&&(S.id.startsWith("#")?S.id==="#atproto_pds":S.id===`${this.id}#atproto_pds`)}return le}var Mn={},Ui;function Bd(){return Ui||(Ui=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.didDocumentValidator=e.didDocumentSchema=void 0;const t=ws(),r=Ts(),n=to(),s=t.z.string().url("RFC3968 compliant URI"),i=t.z.union([r.didSchema,t.z.array(r.didSchema)]),a=t.z.union([s.refine(_=>{const x=_.indexOf("#");return x===-1?!1:(0,n.isFragment)(_,x+1)},{message:"Missing or invalid fragment in RFC3968 URI"}),t.z.string().refine(_=>_.charCodeAt(0)===35,{message:"Fragment must start with #"}).refine(_=>(0,n.isFragment)(_,1),{message:"Invalid char in URI fragment"})]),c=t.z.object({id:a,type:t.z.string().min(1),controller:i,publicKeyJwk:t.z.record(t.z.string(),t.z.unknown()).optional(),publicKeyMultibase:t.z.string().optional()}),d=a,u=t.z.union([t.z.string(),t.z.array(t.z.string())]),f=t.z.union([s,t.z.record(t.z.string(),s),t.z.array(t.z.union([s,t.z.record(t.z.string(),s)])).nonempty()]),p=t.z.object({id:d,type:u,serviceEndpoint:f}),g=t.z.union([a,c]);e.didDocumentSchema=t.z.object({"@context":t.z.union([t.z.literal("https://www.w3.org/ns/did/v1"),t.z.array(t.z.string().url()).nonempty().refine(_=>_[0]==="https://www.w3.org/ns/did/v1",{message:"First @context must be https://www.w3.org/ns/did/v1"})]),id:r.didSchema,controller:i.optional(),alsoKnownAs:t.z.array(s).optional(),service:t.z.array(p).optional(),authentication:t.z.array(g).optional(),verificationMethod:t.z.array(t.z.union([c,a])).optional()}),e.didDocumentValidator=e.didDocumentSchema.superRefine(({id:_,service:x},S)=>{if(x){const I=new Set;for(let D=0;D<x.length;D++){const k=x[D],P=k.id.startsWith("#")?`${_}${k.id}`:k.id;I.has(P)?S.addIssue({code:t.z.ZodIssueCode.custom,message:`Duplicate service id (${k.id}) found in the document`,path:["service",D,"id"]}):I.add(P)}}})}(Mn)),Mn}var Zi;function no(){return Zi||(Zi=1,function(e){var t=at&&at.__createBinding||(Object.create?function(n,s,i,a){a===void 0&&(a=i);var c=Object.getOwnPropertyDescriptor(s,i);(!c||("get"in c?!s.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(n,a,c)}:function(n,s,i,a){a===void 0&&(a=i),n[a]=s[i]}),r=at&&at.__exportStar||function(n,s){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,n,i)};Object.defineProperty(e,"__esModule",{value:!0}),r(Ld(),e),r(Bd(),e),r(wr(),e),r(Ts(),e),r(ro(),e)}(at)),at}var dr={},ut={},Vn={},$i;function so(){return $i||($i=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DisallowedDomainError=e.UnsupportedDomainError=e.ReservedHandleError=e.InvalidHandleError=e.isValidTld=e.isValidHandle=e.normalizeAndEnsureValidHandle=e.normalizeHandle=e.ensureValidHandleRegex=e.ensureValidHandle=e.DISALLOWED_TLDS=e.INVALID_HANDLE=void 0,e.INVALID_HANDLE="handle.invalid",e.DISALLOWED_TLDS=[".local",".arpa",".invalid",".localhost",".internal",".example",".alt",".onion"];const t=p=>{if(!/^[a-zA-Z0-9.-]*$/.test(p))throw new c("Disallowed characters in handle (ASCII letters, digits, dashes, periods only)");if(p.length>253)throw new c("Handle is too long (253 chars max)");const g=p.split(".");if(g.length<2)throw new c("Handle domain needs at least two parts");for(let _=0;_<g.length;_++){const x=g[_];if(x.length<1)throw new c("Handle parts can not be empty");if(x.length>63)throw new c("Handle part too long (max 63 chars)");if(x.endsWith("-")||x.startsWith("-"))throw new c("Handle parts can not start or end with hyphens");if(_+1===g.length&&!/^[a-zA-Z]/.test(x))throw new c("Handle final component (TLD) must start with ASCII letter")}};e.ensureValidHandle=t;const r=p=>{if(!/^([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$/.test(p))throw new c("Handle didn't validate via regex");if(p.length>253)throw new c("Handle is too long (253 chars max)")};e.ensureValidHandleRegex=r;const n=p=>p.toLowerCase();e.normalizeHandle=n;const s=p=>{const g=(0,e.normalizeHandle)(p);return(0,e.ensureValidHandle)(g),g};e.normalizeAndEnsureValidHandle=s;const i=p=>{try{(0,e.ensureValidHandle)(p)}catch(g){if(g instanceof c)return!1;throw g}return!0};e.isValidHandle=i;const a=p=>!e.DISALLOWED_TLDS.some(g=>p.endsWith(g));e.isValidTld=a;class c extends Error{}e.InvalidHandleError=c;class d extends Error{}e.ReservedHandleError=d;class u extends Error{}e.UnsupportedDomainError=u;class f extends Error{}e.DisallowedDomainError=f}(Vn)),Vn}var Ae={},Li;function io(){if(Li)return Ae;Li=1,Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.InvalidDidError=Ae.ensureValidDidRegex=Ae.ensureValidDid=void 0;const e=n=>{if(!n.startsWith("did:"))throw new r('DID requires "did:" prefix');if(!/^[a-zA-Z0-9._:%-]*$/.test(n))throw new r("Disallowed characters in DID (ASCII letters, digits, and a couple other characters only)");const{length:s,1:i}=n.split(":");if(s<3)throw new r("DID requires prefix, method, and method-specific content");if(!/^[a-z]+$/.test(i))throw new r("DID method must be lower-case letters");if(n.endsWith(":")||n.endsWith("%"))throw new r('DID can not end with ":" or "%"');if(n.length>2*1024)throw new r("DID is too long (2048 chars max)")};Ae.ensureValidDid=e;const t=n=>{if(!/^did:[a-z]+:[a-zA-Z0-9._:%-]*[a-zA-Z0-9._-]$/.test(n))throw new r("DID didn't validate via regex");if(n.length>2*1024)throw new r("DID is too long (2048 chars max)")};Ae.ensureValidDidRegex=t;class r extends Error{}return Ae.InvalidDidError=r,Ae}var he={},Bi;function ao(){if(Bi)return he;Bi=1,Object.defineProperty(he,"__esModule",{value:!0}),he.InvalidNsidError=he.NSID=void 0,he.ensureValidNsid=t,he.parseNsid=r,he.isValidNsid=n,he.validateNsid=s,he.ensureValidNsidRegex=f,he.validateNsidRegex=p;class e{static parse(x){return new e(x)}static create(x,S){const I=[...x.split(".").reverse(),S].join(".");return new e(I)}static isValid(x){return n(x)}static from(x){return x instanceof e?x:Array.isArray(x)?new e(x.join(".")):new e(String(x))}constructor(x){Object.defineProperty(this,"segments",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.segments=r(x)}get authority(){return this.segments.slice(0,this.segments.length-1).reverse().join(".")}get name(){return this.segments.at(this.segments.length-1)}toString(){return this.segments.join(".")}}he.NSID=e;function t(_){const x=s(_);if(!x.success)throw new g(x.message)}function r(_){const x=s(_);if(!x.success)throw new g(x.message);return x.value}function n(_){return p(_).success}function s(_){if(_.length>317)return{success:!1,message:"NSID is too long (317 chars max)"};if(i(_))return{success:!1,message:"Disallowed characters in NSID (ASCII letters, digits, dashes, periods only)"};const x=_.split(".");if(x.length<3)return{success:!1,message:"NSID needs at least three parts"};for(const S of x){if(S.length<1)return{success:!1,message:"NSID parts can not be empty"};if(S.length>63)return{success:!1,message:"NSID part too long (max 63 chars)"};if(c(S)||d(S))return{success:!1,message:"NSID parts can not start or end with hyphen"}}return a(x[0])?{success:!1,message:"NSID first part may not start with a digit"}:u(x[x.length-1])?{success:!0,value:x}:{success:!1,message:"NSID name part must be only letters and digits (and no leading digit)"}}function i(_){return!/^[a-zA-Z0-9.-]*$/.test(_)}function a(_){const x=_.charCodeAt(0);return x>=48&&x<=57}function c(_){return _.charCodeAt(0)===45}function d(_){return _.charCodeAt(_.length-1)===45}function u(_){return!a(_)&&!_.includes("-")}function f(_){const x=p(_);if(!x.success)throw new g(x.message)}function p(_){return _.length>317?{success:!1,message:"NSID is too long (317 chars max)"}:/^[a-zA-Z](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?:\.[a-zA-Z](?:[a-zA-Z0-9]{0,62})?)$/.test(_)?{success:!0,value:_}:{success:!1,message:"NSID didn't validate via regex"}}class g extends Error{}return he.InvalidNsidError=g,he}var lt={},ft={},Mi;function Md(){if(Mi)return ft;Mi=1,Object.defineProperty(ft,"__esModule",{value:!0}),ft.ensureValidAtUriRegex=ft.ensureValidAtUri=void 0;const e=io(),t=so(),r=ao(),n=i=>{const a=i.split("#");if(a.length>2)throw new Error('ATURI can have at most one "#", separating fragment out');const c=a[1]||null;if(i=a[0],!/^[a-zA-Z0-9._~:@!$&')(*+,;=%/-]*$/.test(i))throw new Error("Disallowed characters in ATURI (ASCII)");const d=i.split("/");if(d.length>=3&&(d[0]!=="at:"||d[1].length!==0))throw new Error('ATURI must start with "at://"');if(d.length<3)throw new Error("ATURI requires at least method and authority sections");try{d[2].startsWith("did:")?(0,e.ensureValidDid)(d[2]):(0,t.ensureValidHandle)(d[2])}catch{throw new Error("ATURI authority must be a valid handle or DID")}if(d.length>=4){if(d[3].length===0)throw new Error("ATURI can not have a slash after authority without a path segment");if(!(0,r.isValidNsid)(d[3]))throw new Error("ATURI requires first path segment (if supplied) to be valid NSID")}if(d.length>=5&&d[4].length===0)throw new Error("ATURI can not have a slash after collection, unless record key is provided");if(d.length>=6)throw new Error("ATURI path can have at most two parts, and no trailing slash");if(a.length>=2&&c==null)throw new Error("ATURI fragment must be non-empty and start with slash");if(c!=null){if(c.length===0||c[0]!=="/")throw new Error("ATURI fragment must be non-empty and start with slash");if(!/^\/[a-zA-Z0-9._~:@!$&')(*+,;=%[\]/-]*$/.test(c))throw new Error("Disallowed characters in ATURI fragment (ASCII)")}if(i.length>8*1024)throw new Error("ATURI is far too long")};ft.ensureValidAtUri=n;const s=i=>{const a=/^at:\/\/(?<authority>[a-zA-Z0-9._:%-]+)(\/(?<collection>[a-zA-Z0-9-.]+)(\/(?<rkey>[a-zA-Z0-9._~:@!$&%')(*+,;=-]+))?)?(#(?<fragment>\/[a-zA-Z0-9._~:@!$&%')(*+,;=\-[\]/\\]*))?$/,c=i.match(a);if(!c||!c.groups)throw new Error("ATURI didn't validate via regex");const d=c.groups;try{(0,t.ensureValidHandleRegex)(d.authority)}catch{try{(0,e.ensureValidDidRegex)(d.authority)}catch{throw new Error("ATURI authority must be a valid handle or DID")}}if(d.collection&&!(0,r.isValidNsid)(d.collection))throw new Error("ATURI collection path segment must be a valid NSID");if(i.length>8*1024)throw new Error("ATURI is far too long")};return ft.ensureValidAtUriRegex=s,ft}var Vi;function Vd(){return Vi||(Vi=1,function(e){var t=lt&<.__createBinding||(Object.create?function(c,d,u,f){f===void 0&&(f=u);var p=Object.getOwnPropertyDescriptor(d,u);(!p||("get"in p?!d.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return d[u]}}),Object.defineProperty(c,f,p)}:function(c,d,u,f){f===void 0&&(f=u),c[f]=d[u]}),r=lt&<.__exportStar||function(c,d){for(var u in c)u!=="default"&&!Object.prototype.hasOwnProperty.call(d,u)&&t(d,c,u)};Object.defineProperty(e,"__esModule",{value:!0}),e.AtUri=e.ATP_URI_REGEX=void 0,r(Md(),e),e.ATP_URI_REGEX=/^(at:\/\/)?((?:did:[a-z0-9:%-]+)|(?:[a-z0-9][a-z0-9.:-]*))(\/[^?#\s]*)?(\?[^#\s]+)?(#[^\s]+)?$/i;const n=/^(\/[^?#\s]*)?(\?[^#\s]+)?(#[^\s]+)?$/i;class s{constructor(d,u){Object.defineProperty(this,"hash",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"host",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pathname",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"searchParams",{enumerable:!0,configurable:!0,writable:!0,value:void 0});let f;if(u){if(f=i(u),!f)throw new Error(`Invalid at uri: ${u}`);const p=a(d);if(!p)throw new Error(`Invalid path: ${d}`);Object.assign(f,p)}else if(f=i(d),!f)throw new Error(`Invalid at uri: ${d}`);this.hash=f.hash,this.host=f.host,this.pathname=f.pathname,this.searchParams=f.searchParams}static make(d,u,f){let p=d;return u&&(p+="/"+u),f&&(p+="/"+f),new s(p)}get protocol(){return"at:"}get origin(){return`at://${this.host}`}get hostname(){return this.host}set hostname(d){this.host=d}get search(){return this.searchParams.toString()}set search(d){this.searchParams=new URLSearchParams(d)}get collection(){return this.pathname.split("/").filter(Boolean)[0]||""}set collection(d){const u=this.pathname.split("/").filter(Boolean);u[0]=d,this.pathname=u.join("/")}get rkey(){return this.pathname.split("/").filter(Boolean)[1]||""}set rkey(d){const u=this.pathname.split("/").filter(Boolean);u[0]||(u[0]="undefined"),u[1]=d,this.pathname=u.join("/")}get href(){return this.toString()}toString(){let d=this.pathname||"/";d.startsWith("/")||(d=`/${d}`);let u=this.searchParams.toString();u&&!u.startsWith("?")&&(u=`?${u}`);let f=this.hash;return f&&!f.startsWith("#")&&(f=`#${f}`),`at://${this.host}${d}${u}${f}`}}e.AtUri=s;function i(c){const d=e.ATP_URI_REGEX.exec(c);if(d)return{hash:d[5]||"",host:d[2]||"",pathname:d[3]||"",searchParams:new URLSearchParams(d[4]||"")}}function a(c){const d=n.exec(c);if(d)return{hash:d[3]||"",pathname:d[1]||"",searchParams:new URLSearchParams(d[2]||"")}}}(lt)),lt}var Oe={},qi;function qd(){if(qi)return Oe;qi=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.InvalidTidError=Oe.isValidTid=Oe.ensureValidTid=void 0;const e=13,t=/^[234567abcdefghij][234567abcdefghijklmnopqrstuvwxyz]{12}$/,r=i=>{if(i.length!==e)throw new s(`TID must be ${e} characters`);if(!t.test(i))throw new s("TID syntax not valid (regex)")};Oe.ensureValidTid=r;const n=i=>i.length===e&&t.test(i);Oe.isValidTid=n;class s extends Error{}return Oe.InvalidTidError=s,Oe}var qn={},zi;function zd(){return zi||(zi=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.InvalidRecordKeyError=e.isValidRecordKey=e.ensureValidRecordKey=void 0;const t=s=>{if(s.length>512||s.length<1)throw new n("record key must be 1 to 512 characters");if(!/^[a-zA-Z0-9_~.:-]{1,512}$/.test(s))throw new n("record key syntax not valid (regex)");if(s==="."||s==="..")throw new n('record key can not be "." or ".."')};e.ensureValidRecordKey=t;const r=s=>{try{(0,e.ensureValidRecordKey)(s)}catch(i){if(i instanceof n)return!1;throw i}return!0};e.isValidRecordKey=r;class n extends Error{}e.InvalidRecordKeyError=n}(qn)),qn}var zn={},Gi;function Gd(){return Gi||(Gi=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.InvalidDatetimeError=e.normalizeDatetimeAlways=e.normalizeDatetime=e.isValidDatetime=e.ensureValidDatetime=void 0;const t=a=>{const c=new Date(a);if(isNaN(c.getTime()))throw new i("datetime did not parse as ISO 8601");if(c.toISOString().startsWith("-"))throw new i("datetime normalized to a negative time");if(!/^[0-9]{4}-[01][0-9]-[0-3][0-9]T[0-2][0-9]:[0-6][0-9]:[0-6][0-9](.[0-9]{1,20})?(Z|([+-][0-2][0-9]:[0-5][0-9]))$/.test(a))throw new i("datetime didn't validate via regex");if(a.length>64)throw new i("datetime is too long (64 chars max)");if(a.endsWith("-00:00"))throw new i('datetime can not use "-00:00" for UTC timezone');if(a.startsWith("000"))throw new i("datetime so close to year zero not allowed")};e.ensureValidDatetime=t;const r=a=>{try{(0,e.ensureValidDatetime)(a)}catch(c){if(c instanceof i)return!1;throw c}return!0};e.isValidDatetime=r;const n=a=>{if((0,e.isValidDatetime)(a)){const u=new Date(a).toISOString();if((0,e.isValidDatetime)(u))return u}if(!/.*(([+-]\d\d:?\d\d)|[a-zA-Z])$/.test(a)){const u=new Date(a+"Z");if(!isNaN(u.getTime())){const f=u.toISOString();if((0,e.isValidDatetime)(f))return f}}const c=new Date(a);if(isNaN(c.getTime()))throw new i("datetime did not parse as any timestamp format");const d=c.toISOString();if((0,e.isValidDatetime)(d))return d;throw new i("datetime normalized to invalid timestamp string")};e.normalizeDatetime=n;const s=a=>{try{return(0,e.normalizeDatetime)(a)}catch(c){if(c instanceof i)return new Date(0).toISOString();throw c}};e.normalizeDatetimeAlways=s;class i extends Error{}e.InvalidDatetimeError=i}(zn)),zn}var Yi;function Yd(){return Yi||(Yi=1,function(e){var t=ut&&ut.__createBinding||(Object.create?function(n,s,i,a){a===void 0&&(a=i);var c=Object.getOwnPropertyDescriptor(s,i);(!c||("get"in c?!s.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(n,a,c)}:function(n,s,i,a){a===void 0&&(a=i),n[a]=s[i]}),r=ut&&ut.__exportStar||function(n,s){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,n,i)};Object.defineProperty(e,"__esModule",{value:!0}),r(so(),e),r(io(),e),r(ao(),e),r(Vd(),e),r(qd(),e),r(zd(),e),r(Gd(),e)}(ut)),ut}var Fi;function Is(){if(Fi)return dr;Fi=1,Object.defineProperty(dr,"__esModule",{value:!0}),dr.isNsid=void 0;const e=Yd(),t=r=>typeof r=="string"&&(0,e.isValidNsid)(r);return dr.isNsid=t,dr}var ur={},Hi;function Fd(){if(Hi)return ur;Hi=1,Object.defineProperty(ur,"__esModule",{value:!0}),ur.LexPermissionSyntax=void 0;class e{constructor(r){Object.defineProperty(this,"lexPermission",{enumerable:!0,configurable:!0,writable:!0,value:r})}get prefix(){return this.lexPermission.resource}get positional(){}get(r){if(r!=="type"&&r!=="resource"&&Object.hasOwn(this.lexPermission,r))return this.lexPermission[r]}*keys(){for(const r of Object.keys(this.lexPermission))this.get(r)!==void 0&&(yield r)}getSingle(r){const n=this.get(r);return Array.isArray(n)?null:n}getMulti(r){const n=this.get(r);if(n!==void 0)return Array.isArray(n)?n:null}toJSON(){return this.lexPermission}}return ur.LexPermissionSyntax=e,ur}var Gn={},Wi;function Tr(){return Wi||(Wi=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RepoPermission=e.isCollectionParam=e.isRepoAction=e.REPO_ACTIONS=e.isNsid=void 0;const t=Is();Object.defineProperty(e,"isNsid",{enumerable:!0,get:function(){return t.isNsid}});const r=Lt(),n=vt(),s=yt(),i=Er();e.REPO_ACTIONS=Object.freeze(["create","update","delete"]),e.isRepoAction=(0,i.knownValuesValidator)(e.REPO_ACTIONS);const a=u=>u==="*"||(0,t.isNsid)(u);e.isCollectionParam=a;class c{constructor(f,p){Object.defineProperty(this,"collection",{enumerable:!0,configurable:!0,writable:!0,value:f}),Object.defineProperty(this,"action",{enumerable:!0,configurable:!0,writable:!0,value:p})}matches({action:f,collection:p}){return this.action.includes(f)&&(this.collection.includes("*")||this.collection.includes(p))}toString(){return c.parser.format(this)}static fromString(f){if(!(0,s.isScopeStringFor)(f,"repo"))return null;const p=n.ScopeStringSyntax.fromString(f);return c.fromSyntax(p)}static fromSyntax(f){const p=c.parser.parse(f);return p?new c(p.collection,p.action):null}static scopeNeededFor(f){return c.parser.format({collection:[f.collection],action:[f.action]})}}e.RepoPermission=c,Object.defineProperty(c,"parser",{enumerable:!0,configurable:!0,writable:!0,value:new r.Parser("repo",{collection:{multiple:!0,required:!0,validate:e.isCollectionParam,normalize:u=>u.length>1?u.includes("*")?["*"]:[...new Set(u)].sort():u},action:{multiple:!0,required:!1,validate:e.isRepoAction,default:e.REPO_ACTIONS,normalize:u=>u===e.REPO_ACTIONS?e.REPO_ACTIONS:e.REPO_ACTIONS.filter(d,u)}},"collection")});function d(u){return this.includes(u)}}(Gn)),Gn}var Yn={},Ki;function Ir(){return Ki||(Ki=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RpcPermission=e.isAudParam=e.isLxmParam=e.isNsid=e.isAtprotoAudience=void 0;const t=no();Object.defineProperty(e,"isAtprotoAudience",{enumerable:!0,get:function(){return t.isAtprotoAudience}});const r=Is();Object.defineProperty(e,"isNsid",{enumerable:!0,get:function(){return r.isNsid}});const n=Lt(),s=vt(),i=yt(),a=u=>u==="*"||(0,r.isNsid)(u);e.isLxmParam=a;const c=u=>u==="*"||(0,t.isAtprotoAudience)(u);e.isAudParam=c;class d{constructor(f,p){Object.defineProperty(this,"aud",{enumerable:!0,configurable:!0,writable:!0,value:f}),Object.defineProperty(this,"lxm",{enumerable:!0,configurable:!0,writable:!0,value:p})}matches(f){const{aud:p,lxm:g}=this;return(p==="*"||p===f.aud)&&(g.includes("*")||g.includes(f.lxm))}toString(){return d.parser.format(this)}static fromString(f){if(!(0,i.isScopeStringFor)(f,"rpc"))return null;const p=s.ScopeStringSyntax.fromString(f);return d.fromSyntax(p)}static fromSyntax(f){const p=d.parser.parse(f);return!p||p.aud==="*"&&p.lxm.includes("*")?null:new d(p.aud,p.lxm)}static scopeNeededFor(f){return d.parser.format({aud:f.aud,lxm:[f.lxm]})}}e.RpcPermission=d,Object.defineProperty(d,"parser",{enumerable:!0,configurable:!0,writable:!0,value:new n.Parser("rpc",{lxm:{multiple:!0,required:!0,validate:e.isLxmParam,normalize:u=>u.length>1&&u.includes("*")?["*"]:[...new Set(u)].sort()},aud:{multiple:!1,required:!0,validate:e.isAudParam}},"lxm")})}(Yn)),Yn}var Xi;function oo(){return Xi||(Xi=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.IncludeScope=e.isNsid=void 0;const t=no(),r=Is();Object.defineProperty(e,"isNsid",{enumerable:!0,get:function(){return r.isNsid}});const n=Lt(),s=Fd(),i=vt(),a=yt(),c=Sr(),d=Tr(),u=Ir();class f{constructor(x,S=void 0){Object.defineProperty(this,"nsid",{enumerable:!0,configurable:!0,writable:!0,value:x}),Object.defineProperty(this,"aud",{enumerable:!0,configurable:!0,writable:!0,value:S})}toString(){return f.parser.format(this)}toPermissions(x){return x.permissions.map(this.parsePermission,this).filter(this.isAllowedPermission,this)}parsePermission(x){return x.resource==="rpc"&&x.inheritAud===!0&&x.aud===void 0&&this.aud!==void 0?p({...x,inheritAud:void 0,aud:this.aud}):p(x)}isAllowedPermission(x){return x instanceof u.RpcPermission?x.lxm.every(this.isParentAuthorityOf,this):x instanceof d.RepoPermission?x.collection.every(this.isParentAuthorityOf,this):x instanceof c.BlobPermission}isParentAuthorityOf(x){if(x==="*")return!1;const S=this.nsid,I=S.lastIndexOf(".");if(I===-1)throw new TypeError('Dot character (".") missing from lexicon NSID');if(I>=x.length-1)return!1;for(let D=I;D>=0;D--)if(S.charCodeAt(D)!==x.charCodeAt(D))return!1;return!0}static fromString(x){if(!(0,a.isScopeStringFor)(x,"include"))return null;const S=i.ScopeStringSyntax.fromString(x);return f.fromSyntax(S)}static fromSyntax(x){const S=f.parser.parse(x);return S?new f(S.nsid,S.aud):null}}e.IncludeScope=f,Object.defineProperty(f,"parser",{enumerable:!0,configurable:!0,writable:!0,value:new n.Parser("include",{nsid:{multiple:!1,required:!0,validate:r.isNsid},aud:{multiple:!1,required:!1,validate:t.isAtprotoAudience}},"nsid")});function p(_){return g(_,"repo")?d.RepoPermission.fromSyntax(new s.LexPermissionSyntax(_)):g(_,"rpc")?u.RpcPermission.fromSyntax(new s.LexPermissionSyntax(_)):g(_,"blob")?c.BlobPermission.fromSyntax(new s.LexPermissionSyntax(_)):null}function g(_,x){return _.resource===x}}(Zn)),Zn}var Ji;function Hd(){return Ji||(Ji=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.STATIC_SCOPE_VALUES=e.isScopeStringFor=void 0,e.isStaticScopeValue=u,e.isAtprotoOauthScope=f,e.normalizeAtprotoOauthScope=p,e.normalizeAtprotoOauthScopeValue=g;const t=yt();Object.defineProperty(e,"isScopeStringFor",{enumerable:!0,get:function(){return t.isScopeStringFor}});const r=Er(),n=mn(),s=Sr(),i=_n(),a=oo(),c=Tr(),d=Ir();e.STATIC_SCOPE_VALUES=Object.freeze(["atproto","transition:email","transition:generic","transition:chat.bsky"]);function u(_){return e.STATIC_SCOPE_VALUES.includes(_)}function f(_){return u(_)||n.AccountPermission.fromString(_)!=null||s.BlobPermission.fromString(_)!=null||i.IdentityPermission.fromString(_)!=null||a.IncludeScope.fromString(_)!=null||c.RepoPermission.fromString(_)!=null||d.RpcPermission.fromString(_)!=null}function p(_){return _.split(" ").map(g).filter(r.isNonNullable).sort().join(" ")}function g(_){if(u(_))return _;for(const x of[n.AccountPermission,s.BlobPermission,i.IdentityPermission,a.IncludeScope,c.RepoPermission,d.RpcPermission]){const S=x.fromString(_);if(S)return S.toString()}return null}}(Pn)),Pn}var lr={},Qi;function js(){if(Qi)return lr;Qi=1,Object.defineProperty(lr,"__esModule",{value:!0}),lr.ScopeMissingError=void 0;class e extends Error{get statusCode(){return this.status}constructor(r){super(`Missing required scope "${r}"`),Object.defineProperty(this,"scope",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ScopeMissingError"}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:403}),Object.defineProperty(this,"expose",{enumerable:!0,configurable:!0,writable:!0,value:!0})}}return lr.ScopeMissingError=e,lr}var fr={},hr={},Fn={},ea;function co(){return ea||(ea=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ScopesSet=e.ScopeMissingError=void 0;const t=js();Object.defineProperty(e,"ScopeMissingError",{enumerable:!0,get:function(){return t.ScopeMissingError}});const r=mn(),n=Sr(),s=_n(),i=Tr(),a=Ir();class c extends Set{matches(g,_){for(const x of this)if(u(x,g,_))return!0;return!1}assert(g,_){if(!this.matches(g,_)){const x=d(g,_);throw new t.ScopeMissingError(x)}}some(g){for(const _ of this)if(g(_))return!0;return!1}every(g){for(const _ of this)if(!g(_))return!1;return!0}*filter(g){for(const _ of this)g(_)&&(yield _)}*map(g){for(const _ of this)yield g(_)}static fromString(g){return new c(g==null?void 0:g.split(" "))}}e.ScopesSet=c;function d(p,g){switch(p){case"account":return r.AccountPermission.scopeNeededFor(g);case"identity":return s.IdentityPermission.scopeNeededFor(g);case"repo":return i.RepoPermission.scopeNeededFor(g);case"rpc":return a.RpcPermission.scopeNeededFor(g);case"blob":return n.BlobPermission.scopeNeededFor(g)}throw new TypeError(`Unknown resource: ${p}`)}function u(p,g,_){const x=f(g,p);return x?x.matches(_):!1}function f(p,g){switch(p){case"account":return r.AccountPermission.fromString(g);case"identity":return s.IdentityPermission.fromString(g);case"repo":return i.RepoPermission.fromString(g);case"rpc":return a.RpcPermission.fromString(g);case"blob":return n.BlobPermission.fromString(g);default:return null}}}(Fn)),Fn}var ta;function uo(){if(ta)return hr;ta=1,Object.defineProperty(hr,"__esModule",{value:!0}),hr.ScopePermissions=void 0;const e=js(),t=mn(),r=Sr(),n=_n(),s=Tr(),i=Ir(),a=co();class c{constructor(u){Object.defineProperty(this,"scopes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.scopes=new a.ScopesSet(u?typeof u=="string"?u.split(" "):u:void 0)}allowsAccount(u){return this.scopes.matches("account",u)}assertAccount(u){if(!this.allowsAccount(u)){const f=t.AccountPermission.scopeNeededFor(u);throw new e.ScopeMissingError(f)}}allowsIdentity(u){return this.scopes.matches("identity",u)}assertIdentity(u){if(!this.allowsIdentity(u)){const f=n.IdentityPermission.scopeNeededFor(u);throw new e.ScopeMissingError(f)}}allowsBlob(u){return this.scopes.matches("blob",u)}assertBlob(u){if(!this.allowsBlob(u)){const f=r.BlobPermission.scopeNeededFor(u);throw new e.ScopeMissingError(f)}}allowsRepo(u){return this.scopes.matches("repo",u)}assertRepo(u){if(!this.allowsRepo(u)){const f=s.RepoPermission.scopeNeededFor(u);throw new e.ScopeMissingError(f)}}allowsRpc(u){return this.scopes.matches("rpc",u)}assertRpc(u){if(!this.allowsRpc(u)){const f=i.RpcPermission.scopeNeededFor(u);throw new e.ScopeMissingError(f)}}}return hr.ScopePermissions=c,hr}var ra;function Wd(){if(ra)return fr;ra=1,Object.defineProperty(fr,"__esModule",{value:!0}),fr.ScopePermissionsTransition=void 0;const e=uo();class t extends e.ScopePermissions{get hasTransitionGeneric(){return this.scopes.has("transition:generic")}get hasTransitionEmail(){return this.scopes.has("transition:email")}get hasTransitionChatBsky(){return this.scopes.has("transition:chat.bsky")}allowsAccount(n){return n.attr==="email"&&n.action==="read"&&this.hasTransitionEmail?!0:super.allowsAccount(n)}allowsBlob(n){return this.hasTransitionGeneric?!0:super.allowsBlob(n)}allowsRepo(n){return this.hasTransitionGeneric?!0:super.allowsRepo(n)}allowsRpc(n){const{lxm:s}=n;return this.hasTransitionGeneric&&s==="*"||this.hasTransitionGeneric&&!s.startsWith("chat.bsky.")||this.hasTransitionChatBsky&&s.startsWith("chat.bsky.")?!0:super.allowsRpc(n)}}return fr.ScopePermissionsTransition=t,fr}var na;function Kd(){return na||(na=1,function(e){var t=st&&st.__createBinding||(Object.create?function(n,s,i,a){a===void 0&&(a=i);var c=Object.getOwnPropertyDescriptor(s,i);(!c||("get"in c?!s.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(n,a,c)}:function(n,s,i,a){a===void 0&&(a=i),n[a]=s[i]}),r=st&&st.__exportStar||function(n,s){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,n,i)};Object.defineProperty(e,"__esModule",{value:!0}),r(Hd(),e),r(js(),e),r(Wd(),e),r(uo(),e),r(co(),e),r(mn(),e),r(Sr(),e),r(_n(),e),r(oo(),e),r(Tr(),e),r(Ir(),e)}(st)),st}var de=Kd();const Rs=w.forwardRef(({className:e,invalid:t,disabled:r,...n},s)=>l.jsx("input",{...n,type:"checkbox",ref:s,disabled:r,className:se(["block size-4 rounded-md border-2","accent-primary","transition duration-300 ease-in-out","outline-none","focus:ring-primary focus:ring-2 focus:ring-offset-1 focus:ring-offset-white dark:focus:ring-offset-black",t&&"accent-error focus:border-error",r&&"bg-contrast-50 text-contrast-500 cursor-not-allowed",e])}));Rs.displayName="Checkbox";function Xd({scope:e,permissionSets:t,clientTrusted:r=!1,clientFirstParty:n=!1,allowEmail:s,onAllowEmail:i,className:a="",...c}){const d=w.useMemo(()=>Array.from(new Set(e==null?void 0:e.split(" ").map(f=>de.IncludeScope.fromString(f)).filter(f=>f!=null))),[e]),u=w.useMemo(()=>new de.ScopePermissionsTransition(e),[e]);return u.scopes.size===0||u.scopes.size===1&&u.scopes.has("atproto")?null:l.jsxs("div",{className:`flex flex-col gap-2 ${a}`,...c,role:"list",children:[l.jsx(tu,{permissions:u,allowEmail:s,onAllowEmail:i}),l.jsx(au,{permissions:u}),l.jsx(ru,{permissions:u}),l.jsx(su,{permissions:u}),l.jsx(iu,{permissions:u}),l.jsx(Jd,{includeScopes:d,permissionSets:t}),l.jsx(nu,{permissions:u}),(!n||!r)&&l.jsx(eu,{className:"mt-2",permissions:u})]})}function Jd({includeScopes:e,permissionSets:t}){return e.length?l.jsx(l.Fragment,{children:e.map((r,n)=>l.jsx(Qd,{includeScope:r,permissionSet:t[r.nsid]},n))}):null}function Qd({includeScope:e,permissionSet:t}){const{nsid:r}=e,n=w.useMemo(()=>{if(!t)return null;const s=e.toPermissions(t);return new de.ScopePermissionsTransition(s.map(i=>i.toString()))},[e,t]);return l.jsxs(we,{role:"listitem",image:po(r)?l.jsx(Ha,{className:"size-6"}):Cs(r)?l.jsx(Wa,{className:"size-6"}):r.startsWith("com.atproto.moderation.")?l.jsx(ud,{className:"size-6"}):l.jsx(ld,{className:"size-6"}),title:l.jsx(ii,{object:t,property:"title",fallback:r}),description:l.jsx(ii,{object:t,property:"detail",fallback:t!=null&&t.title?r:null}),children:[l.jsx("p",{className:"mt-1",children:l.jsx(R,{id:"ZEwA2R"})}),n?l.jsxs(l.Fragment,{children:[l.jsx(lo,{className:"mt-2",permissions:n}),l.jsx(fo,{className:"mt-2",permissions:n})]}):null]})}function eu({permissions:e,type:t="alert",prominent:r=!0,...n}){return w.useMemo(()=>e.allowsIdentity({attr:"*"}),[e])?l.jsx($t,{...n,type:t,prominent:r,children:l.jsx("p",{children:l.jsx(R,{id:"zb3TS0",components:{0:l.jsx("b",{}),1:l.jsx("b",{})}})})}):null}function tu({permissions:e,allowEmail:t,onAllowEmail:r}){const{i18n:n,_:s}=z(),i=w.useMemo(()=>["manage","read"].find(a=>e.allowsAccount({attr:"email",action:a})),[e]);return i?l.jsx("label",{className:r?"cursor-pointer":void 0,children:l.jsx(we,{role:"listitem",image:l.jsx(cd,{className:"size-6"}),title:n._({id:"O3oNi5"}),description:i==="manage"?l.jsx(R,{id:"FLm/n9"}):l.jsx(R,{id:"fEvm25"}),append:r&&l.jsx(Rs,{className:"m-2",checked:t,onChange:a=>r(a.target.checked)})})}):null}function ru({permissions:e}){const{i18n:t,_:r}=z();return e.allowsAccount({attr:"status",action:"manage"})?l.jsx(we,{role:"listitem",image:l.jsx(dd,{className:"size-6"}),title:t._({id:"AeXO77"}),description:t._({id:"NKHn7N"})}):null}function nu({permissions:e}){return w.useMemo(()=>{if(e.allowsAccount({attr:"repo",action:"manage"}))return!1;let r=!1;for(const n of e.scopes){const s=de.RpcPermission.fromString(n);if(s){if(r=!0,ho(s.aud)||s.lxm.every(ts))continue;return!1}const i=de.RepoPermission.fromString(n);if(i){if(r=!0,i.collection.every(ts))continue;return!1}}return r},[e])?null:l.jsxs(l.Fragment,{children:[l.jsx(cu,{permissions:e}),l.jsx(ou,{permissions:e})]})}function su({permissions:e}){const t=w.useMemo(()=>e.scopes.some(uu),[e]),r=w.useMemo(()=>e.scopes.some(lu),[e]);return t||r?l.jsx(we,{role:"listitem",image:l.jsx(Ha,{className:"size-6"}),title:"Bluesky",description:t&&r?l.jsx(R,{id:"0ZqxWk"}):l.jsx(R,{id:"YRqkn2"})}):null}function iu({permissions:e}){const{i18n:t,_:r}=z();return w.useMemo(()=>e.hasTransitionChatBsky||e.scopes.some(du),[e])?l.jsx(we,{role:"listitem",image:l.jsx(Wa,{className:"size-6"}),title:t._({id:"AHZflp"}),description:t._({id:"yZDyOS"})}):null}function au({permissions:e}){const{i18n:t,_:r}=z(),n=w.useMemo(()=>e.allowsIdentity({attr:"*"})?"*":e.allowsIdentity({attr:"handle"})?"handle":null,[e]);return n?l.jsx(we,{role:"listitem",image:l.jsx(xr,{className:"h-6"}),title:t._({id:"ePYQjq"}),description:n==="*"?l.jsx(R,{id:"hqGoYC",components:{0:l.jsx("b",{}),1:l.jsx("b",{})}}):l.jsx(R,{id:"lbjZdy",components:{0:l.jsx("b",{})}})}):null}function ou({permissions:e}){const{i18n:t,_:r}=z();return e.hasTransitionGeneric?l.jsx(we,{role:"listitem",image:l.jsx(oi,{className:"size-6"}),title:t._({id:"OX6vme"}),description:l.jsx(R,{id:"17SnJo",components:{0:l.jsx("b",{})}}),children:l.jsx("p",{children:l.jsx(sa,{})})}):e.scopes.some(n=>de.RpcPermission.fromString(n)!=null)?l.jsxs(we,{role:"listitem",image:l.jsx(oi,{className:"size-6"}),title:t._({id:"OX6vme"}),description:t._({id:"RZlEhS"}),children:[l.jsx("p",{children:l.jsx(sa,{})}),l.jsx("p",{className:"mt-1",children:l.jsx(R,{id:"ZEwA2R"})}),l.jsx(lo,{className:"mt-2",permissions:e})]}):null}function sa(){return l.jsx(R,{id:"sVs8xu"})}function lo({permissions:e,className:t="",...r}){const n=w.useMemo(()=>{const s=new Map;for(const i of e.scopes){const a=de.RpcPermission.fromString(i);if(!a)continue;let c=s.get(a.aud);c||s.set(a.aud,c=new Set);for(const d of a.lxm)c.add(d)}return Array.from(s.entries()).sort(([i],[a])=>i.localeCompare(a)).map(([i,a])=>[i,a.has("*")?["*"]:Array.from(a).sort((c,d)=>c.localeCompare(d))])},[e]);return n.length?l.jsxs("table",{className:`w-full table-auto ${t}`,...r,children:[l.jsx("thead",{children:l.jsxs("tr",{className:"text-sm",children:[l.jsx("th",{className:"text-left font-normal",children:l.jsx(R,{id:"b4SMYa"})}),l.jsx("th",{className:"text-left font-normal",children:l.jsx(R,{id:"nURwxX"})})]})}),l.jsx("tbody",{children:n.map(([s,i])=>i.map((a,c,d)=>l.jsxs("tr",{className:"text-xs",children:[l.jsx("td",{className:c>0?"pt-1":void 0,children:l.jsx(fu,{lxm:a})}),c===0&&l.jsx("td",{className:"align-top",rowSpan:d.length,children:l.jsx(hu,{aud:s})})]},a)))})]}):null}function cu({permissions:e}){const{i18n:t,_:r}=z();return e.hasTransitionGeneric||e.allowsAccount({attr:"repo",action:"manage"})||e.allowsRepo({collection:"*",action:"create"})&&e.allowsRepo({collection:"*",action:"delete"})&&e.allowsRepo({collection:"*",action:"update"})?l.jsxs(we,{role:"listitem",image:l.jsx(ai,{className:"size-6"}),title:t._({id:"IreQBq"}),description:t._({id:"NnNRWU"}),children:[l.jsx("p",{children:l.jsx(ia,{})}),l.jsx("p",{className:"mt-1",children:l.jsx(R,{id:"jhMKee",components:{0:l.jsx("b",{})}})})]}):e.scopes.some(n=>de.RepoPermission.fromString(n)!=null)?l.jsxs(we,{role:"listitem",image:l.jsx(ai,{className:"size-6"}),title:t._({id:"IreQBq"}),description:t._({id:"xs63gu"}),children:[l.jsx("p",{children:l.jsx(ia,{})}),l.jsx("p",{className:"mt-1",children:l.jsx(R,{id:"ZEwA2R"})}),l.jsx(fo,{className:"mt-2",permissions:e})]}):null}function ia(){return l.jsx(R,{id:"Gmgygg"})}function fo({permissions:e,className:t,...r}){const{i18n:n,_:s}=z(),i=w.useMemo(()=>{const u=new Map;for(const f of e.scopes){const p=de.RepoPermission.fromString(f);if(p)for(const g of p.collection)if(u.has(g)){const _=u.get(g);for(const x of p.action)_[x]=!0}else u.set(g,{create:p.action.includes("create"),update:p.action.includes("update"),delete:p.action.includes("delete")})}return u},[e]),a=w.useMemo(()=>e.hasTransitionGeneric?[new de.BlobPermission(["*/*"])]:Array.from(e.scopes.map(u=>de.BlobPermission.fromString(u))).filter(u=>u!=null),[e]);if(!i.size)return null;const c=i.get("*"),d=w.useMemo(()=>Array.from(i.entries()).sort(([u],[f])=>u.localeCompare(f)),[i]);return l.jsxs("table",{className:`w-full table-auto text-left ${t}`,...r,children:[l.jsx("thead",{children:l.jsxs("tr",{className:"text-sm",children:[l.jsx("th",{className:"font-normal",children:n._({id:"q+hNag"})}),l.jsx("th",{className:"text-center font-normal",children:n._({id:"hYgDIe"})}),l.jsx("th",{className:"text-center font-normal",children:n._({id:"EkH9pt"})}),l.jsx("th",{className:"text-center font-normal",children:n._({id:"cnGeoo"})})]})}),l.jsxs("tbody",{children:[d.map(([u,f],p)=>l.jsxs("tr",{className:"text-xs",children:[l.jsx("td",{className:p>0?"pt-1":void 0,children:l.jsx(pu,{coll:u})}),l.jsx("td",{className:"text-center",children:c!=null&&c.create||f.create?l.jsx(nn,{className:"inline-block size-3"}):null}),l.jsx("td",{className:"text-center",children:c!=null&&c.update||f.update?l.jsx(nn,{className:"inline-block size-3"}):null}),l.jsx("td",{className:"text-center",children:c!=null&&c.delete||f.delete?l.jsx(nn,{className:"inline-block size-3"}):null})]},u)),a.length>0&&l.jsxs("tr",{children:[l.jsx("td",{className:"pt-2",children:l.jsx(R,{id:"4X0Qky"})}),l.jsx("td",{colSpan:3,className:"pt-2 text-center",children:l.jsx(R,{id:"sCtyHQ"})})]})]})]})}function ho(e){return e==="did:web:bsky.app#bsky_appview"}function po(e){return e.startsWith("app.bsky.")}function Cs(e){return e.startsWith("chat.bsky.")}function du(e){if(e==="transition:chat.bsky")return!0;const t=de.RpcPermission.fromString(e);return!t||ho(t.aud)?!1:t.lxm.includes("*")||t.lxm.some(Cs)}function ts(e){return e==="*"?!1:e==="com.atproto.moderation.createReport"||po(e)||Cs(e)}function uu(e){if(e==="transition:generic")return!0;const t=de.RepoPermission.fromString(e);return t?t.collection.includes("*")||t.collection.some(ts):!1}function lu(e){if(e==="transition:generic")return!0;const t=de.RpcPermission.fromString(e);return t?t.lxm.includes("app.bsky.actor.getPreferences")||t.lxm.includes("app.bsky.graph.block")||t.lxm.includes("app.bsky.graph.muteActor")||t.lxm.includes("app.bsky.graph.muteActorList")||t.lxm.includes("app.bsky.graph.muteThread")||t.lxm.includes("app.bsky.graph.unmuteActor")||t.lxm.includes("app.bsky.graph.unmuteActorList")||t.lxm.includes("app.bsky.graph.unmuteThread")||t.lxm.includes("app.bsky.graph.getMutes")||t.lxm.includes("*"):!1}function fu({lxm:e,...t}){return e==="*"?l.jsx(Ct,{...t,children:l.jsx(R,{id:"P5xSNt"})}):l.jsx(mo,{...t,nsid:e})}function hu({aud:e,...t}){if(e.startsWith("did:web:api.bsky.app#"))return l.jsx(Ct,{...t,title:e,children:l.jsx(R,{id:"3GEYP0"})});if(e.startsWith("did:web:api.bsky.chat#"))return l.jsx(Ct,{...t,title:e,children:l.jsx(R,{id:"eglFj/"})});if(e.startsWith("did:web:")&&e.includes("#")){const r=e.slice(8,e.indexOf("#"));return l.jsx(Ct,{...t,title:e,children:l.jsx(R,{id:"BO3Kuy",values:{domain:r},components:{0:l.jsx("b",{})}})})}return e==="*"?l.jsx(Ct,{...t,children:l.jsx(R,{id:"UuQciw"})}):l.jsx(_o,{...t,title:e,children:e})}function pu({coll:e,...t}){return e==="*"?l.jsx(Ct,{...t,children:l.jsx(R,{id:"a6yfpg"})}):l.jsx(mo,{...t,nsid:e})}function Ct({children:e,className:t="",...r}){return l.jsx("em",{...r,className:`text-slate-500 ${t}`,children:e})}function mo({nsid:e,...t}){return l.jsx(_o,{...t,children:e.split(".").map((r,n)=>n===0?r:l.jsxs(w.Fragment,{children:[".",l.jsx("wbr",{}),r]},n))})}function _o({children:e,className:t="",...r}){return l.jsx("code",{...r,className:`text-slate-500 ${t}`,children:e})}function Ds({actions:e,cancel:t,append:r,children:n,prepend:s,disabled:i,inert:a=i,...c}){return l.jsxs("form",{...c,inert:a,className:"flex flex-col gap-4",children:[s&&l.jsx("div",{children:s},"prepend"),l.jsx("div",{className:"space-y-4",children:n},"children"),r&&l.jsx("div",{children:r},"append"),(e||t)&&l.jsxs("div",{className:"flex flex-row-reverse flex-wrap items-center justify-end space-x-2 space-x-reverse",children:[e,l.jsx("div",{className:"flex-auto"}),t]},"buttons")]})}function aa({account:e,...t}){return l.jsx("b",{...t,children:e.preferred_username||e.email||e.sub})}const mu=e=>{try{const t=new URL(e);return t.protocol==="https:"&&t.pathname==="/oauth-client-metadata.json"&&!t.port&&!t.search}catch{return!1}};function _u({url:e,proto:t=!1,host:r=!0,path:n=!1,query:s=!1,hash:i=!1,as:a="span",...c}){const d=w.useMemo(()=>e instanceof URL?e:new URL(e),[e]);return l.jsxs(a,{...c,children:[t&&l.jsx(pr,{value:`${d.protocol}//`,...t===!0?null:t}),r&&l.jsx(pr,{value:d.host,...r===!0?{faded:!1,bold:!0}:r}),n&&l.jsx(pr,{value:d.pathname,...n===!0?null:n}),s&&l.jsx(pr,{value:d.search,...s===!0?null:s}),i&&l.jsx(pr,{value:d.hash,...i===!0?null:i})]})}function pr({value:e,faded:t=!0,bold:r=!1}){const n=r?"b":"span";return l.jsx(n,{className:t?"opacity-50":"",children:e})}function gu({clientId:e,clientMetadata:t,clientTrusted:r,...n}){const s=w.useMemo(()=>{try{return new URL(e)}catch{return null}},[e]);if(r&&t.client_name)return l.jsx("span",{...n,children:t.client_name});if((s==null?void 0:s.protocol)==="http:")return l.jsx("span",{...n,children:l.jsx(R,{id:"eYNzrj"})});if((s==null?void 0:s.protocol)==="https:"){const i=mu(e);return l.jsx(_u,{...n,url:s,proto:!i,host:!0,path:!i,query:!i,hash:!1})}return l.jsx("span",{...n,children:e})}function yu(e){return e.startsWith("transition:")}function vu(e){const t=de.AccountPermission.fromString(e);return t?t.matches({attr:"email",action:"read"}):!1}function bu(e){return e==null?void 0:e.split(" ").filter(t=>!vu(t)).join(" ")}function xu({clientId:e,clientMetadata:t,clientTrusted:r,clientFirstParty:n,permissionSets:s,account:i,scope:a,onConsent:c,consentLabel:d,onReject:u,rejectLabel:f,onBack:p,backLabel:g,..._}){const{i18n:x,_:S}=z(),[I,D]=w.useState(!0),k=!(a!=null&&a.split(" ").some(yu));return l.jsxs(Ds,{..._,onSubmit:P=>{P.preventDefault();const U=k&&!I?bu(a):a;c(U)},cancel:p&&l.jsx(ce,{onClick:p,children:g||l.jsx(R,{id:"iH8pgl"})}),actions:l.jsxs(l.Fragment,{children:[l.jsx(ce,{type:"submit",color:"primary",children:d||l.jsx(R,{id:"yIVrHZ"})}),l.jsx(ce,{onClick:u,children:f||l.jsx(R,{id:"54JiGG"})})]}),children:[l.jsx(we,{image:l.jsx(Dd,{clientId:e,clientMetadata:t,clientTrusted:r}),title:l.jsx(gu,{clientId:e,clientMetadata:t,clientTrusted:r}),description:!a||a==="atproto"?l.jsx(R,{id:"AM8FL/",components:{0:l.jsx(aa,{account:i})}}):l.jsx(R,{id:"sUabXh",components:{0:l.jsx(aa,{account:i})}}),hint:x._({id:"69Gavs"}),children:a?l.jsxs(l.Fragment,{children:[l.jsx("p",{children:l.jsx(R,{id:"Poe314"})}),l.jsx("ul",{className:"mt-2",children:a.split(" ").map(P=>l.jsx("li",{children:l.jsx("code",{children:P})},P))})]}):null}),l.jsx(Xd,{scope:a,permissionSets:s,clientTrusted:r,clientFirstParty:n,allowEmail:k?I:!0,onAllowEmail:k?D:void 0}),l.jsx("p",{children:l.jsx(R,{id:"TQzU6E",values:{0:d||l.jsx(R,{id:"yIVrHZ"})},components:{0:l.jsx("b",{}),1:l.jsx("a",{role:"link",href:t.tos_uri,rel:"nofollow noopener",target:"_blank",className:t.tos_uri?"text-primary underline":void 0}),2:l.jsx("a",{role:"link",href:t.policy_uri,rel:"nofollow noopener",target:"_blank",className:t.policy_uri?"text-primary underline":void 0})}})})]})}function Eu({clientId:e,clientMetadata:t,clientTrusted:r,clientFirstParty:n,permissionSets:s,account:i,scope:a,onConsent:c,onReject:d,onBack:u,title:f,subtitle:p=l.jsx(R,{id:"QdVx1C",values:{0:i.preferred_username||i.email||i.sub},components:{0:l.jsx("b",{className:"text-slate-800 dark:text-slate-200"})}}),...g}){const{i18n:_,_:x}=z();return l.jsx(Ee,{...g,title:f??_._({id:"yIVrHZ"}),subtitle:p,children:l.jsx(xu,{clientId:e,clientMetadata:t,clientTrusted:r,clientFirstParty:n,permissionSets:s,account:i,scope:a,onBack:u,onConsent:c,onReject:d})})}const yn=w.createContext({disabled:!1});yn.displayName="FieldsetContext";function Be({label:e,children:t,disabled:r,...n}){const s=br({prefix:"fieldset-"}),i=w.useMemo(()=>({disabled:r??!1,labelId:e?s:void 0}),[r,e,s]);return l.jsxs("fieldset",{...n,"aria-labelledby":s,disabled:r,children:[e&&l.jsx("legend",{id:s,className:"mb-1 text-sm font-medium text-slate-600 dark:text-slate-400",children:e},"title"),l.jsx("div",{className:"flex flex-col space-y-4",children:l.jsx(yn,{value:i,children:t})})]})}function Su(e,{ref:t,onLoading:r,onError:n}={}){const[s,i]=w.useState(!1),[a,c]=w.useState(),d=w.useCallback(_=>{c(_),n==null||n(_)},[n]),u=w.useCallback(_=>{i(_),r==null||r(_)},[r]),f=w.useRef(null),p=w.useRef(null);w.useEffect(()=>(p.current=()=>{var _;(_=f.current)==null||_.abort(),f.current=null,d(void 0),u(!1)},()=>{p.current=null}),[d,u]),w.useImperativeHandle(t,()=>({reset:()=>{var _;return(_=p.current)==null?void 0:_.call(p)}}),[]),w.useEffect(()=>()=>{var _;(_=f.current)==null||_.abort(),f.current=null},[]);const g=w.useCallback(async()=>{var S;(S=f.current)==null||S.abort(),u(!0),d(void 0);const _=new AbortController,{signal:x}=_;f.current=_;try{await e(x)}catch(I){_===f.current?d(I instanceof Error?I:new Error(String(I))):wu(x,I)||console.warn("Async action error after abort",I)}finally{_===f.current&&(f.current=null,u(!1)),_.abort()}},[e,u,d]);return{loading:s,error:a,run:g}}function wu(e,t){return e.aborted&&(e.reason===t||e.reason===(t==null?void 0:t.cause)||t instanceof DOMException&&t.name==="AbortError")}const Tu=({error:e})=>l.jsx(fd,{error:e});function Bt({invalid:e,disabled:t,onSubmit:r,submitLabel:n,onCancel:s=void 0,cancelLabel:i,errorRender:a=Tu,ref:c,onLoading:d,onError:u,children:f,...p}){const{run:g,loading:_,error:x}=Su(r,{ref:c,onError:u,onLoading:d}),S=w.useCallback(I=>{I.preventDefault(),I.currentTarget.reportValidity()&&!t&&!e&&g()},[t,e,g]);return l.jsx(Ds,{...p,onSubmit:S,disabled:t||_,prepend:x!=null?a({error:x}):void 0,cancel:s&&l.jsx(ce,{onClick:s,children:i||l.jsx(R,{id:"dEgA5A"})}),actions:l.jsx(ce,{color:"primary",type:"submit",loading:_,disabled:t,children:n||l.jsx(R,{id:"hQRttt"})}),children:f})}const Ze=8,Iu=/(\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])/,Mr=/[A-Z]/,Vr=/[a-z]/,qr=/[0-9]/,zr=/[^a-zA-Z0-9]/;var mt=function(e){return e[e.weak=1]="weak",e[e.moderate=2]="moderate",e[e.strong=3]="strong",e[e.extra=4]="extra",e}({});function go(e){return e.length<Ze?1:e.length>=Ze+12?4:e.length>=Ze+8?Ue(e,[zr])||Ue(e,[Mr,Vr,qr],2)?4:3:e.length>=Ze&&Ue(e,[Iu])?3:e.length>=Ze+6?Ue(e,[zr])||Ue(e,[Mr,Vr,qr],2)?3:2:e.length>=Ze+4?Ue(e,[zr])||Ue(e,[Mr,Vr,qr],2)?2:1:e.length>=Ze&&(Ue(e,[zr])||Ue(e,[Mr,Vr,qr]))?2:1}function Ue(e,t,r=t.length){if(r<1||r>t.length)throw new TypeError("Invalid regexpsCountToMatch");for(const n of t)if(n.test(e)&&(r--,r===0))return!0;return!1}function ju({password:e,...t}){const{i18n:r,_:n}=z(),s=go(e);return l.jsx("span",{...t,"aria-label":r._({id:"osAB4a"}),children:s===mt.extra?l.jsx(R,{id:"/Ltc/k"}):s===mt.strong?l.jsx(R,{id:"LLx/nr"}):s===mt.moderate?l.jsx(R,{id:"dvYuhh"}):e?l.jsx(R,{id:"9ls/Vs"}):l.jsx(R,{id:"VU3Nrn"})})}function Ru({password:e,className:t,...r}){const{i18n:n,_:s}=z(),i=e?go(e):0,a="bg-gray-300 dark:bg-slate-500",c=i===mt.extra||i===mt.strong?"bg-success":i===mt.moderate?"bg-warning":"bg-error";return l.jsx("div",{...r,className:se("flex h-1 w-full space-x-2",t),role:"meter","aria-label":n._({id:"xfNKwI"}),"aria-valuemin":0,"aria-valuemax":mt.extra,"aria-valuenow":i,children:Array.from({length:4},(d,u)=>l.jsx("div",{className:`h-1 w-1/4 rounded-sm ${i>u?c:a}`},u))})}function Cu(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function Qe(e){return t=>{for(const r of e)r&&Cu(r,t)}}function Du({visible:e,toggleVisible:t,onClick:r,...n}){const{i18n:s,_:i}=z();return l.jsx(ce,{...n,shape:"padded",onClick:a=>{r==null||r(a),a.defaultPrevented||t()},"aria-label":e?s._({id:"vLyv1R"}):s._({id:"huXYDE"}),children:e?l.jsx(hd,{className:"w-5","aria-hidden":!0}):l.jsx(pd,{className:"w-5","aria-hidden":!0})})}function dn({icon:e,append:t,bellow:r,actionable:n,className:s,children:i,onFocus:a,onBlur:c,...d}){const[u,f]=w.useState(!1);return n??(n=d.onClick!=null),l.jsxs("div",{...d,onFocus:p=>{a==null||a(p),p.defaultPrevented||f(!0)},onBlur:p=>{c==null||c(p),p.defaultPrevented||f(!1)},className:se("min-h-12","max-w-full","overflow-hidden","rounded-lg","transition duration-300 ease-in-out","outline-none","focus:ring-primary focus:ring-2 focus:ring-offset-1 focus:ring-offset-white dark:focus:ring-offset-black","has-focus:ring-primary has-focus:ring-2 has-focus:ring-offset-1 has-focus:ring-offset-white dark:has-focus:ring-offset-black","bg-gray-100 dark:bg-gray-800",n?"cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-700":void 0,s),children:[l.jsxs("div",{className:se("px-1","min-h-12 w-full","flex items-center justify-stretch","rounded-lg",r?"rounded-bl-none rounded-br-none":void 0,"text-slate-600 dark:text-slate-300"),children:[e&&l.jsx("div",{className:se("flex shrink-0 grow-0 items-center justify-center","mx-2",u?"text-primary":"text-slate-500"),children:e}),i,l.jsx("div",{className:"ml-1 flex shrink-0 grow-0 items-center",children:t})]}),r&&l.jsx("div",{className:se("space-x-2 px-3 py-2","flex flex-row items-center gap-1","rounded-br-2 rounded-bl-2","bg-gray-200 dark:bg-slate-700","text-gray-700 dark:text-gray-300","text-sm italic"),children:r})]})}function Mt({icon:e,append:t,bellow:r,className:n,onFocus:s,onBlur:i,ref:a,disabled:c,title:d,"aria-label":u=d,"aria-labelledby":f,placeholder:p=u,...g}){const _=w.useContext(yn),x=w.useRef(null),S=w.useRef(!1);return l.jsx(dn,{icon:e,append:t,bellow:r,className:se("cursor-text",n),tabIndex:-1,actionable:!1,onClick:I=>{var D;x.current!==I.target&&(I.preventDefault(),I.stopPropagation(),(D=x.current)==null||D.focus())},onMouseDown:I=>{S.current&&I.target!==x.current&&(I.preventDefault(),I.stopPropagation())},children:l.jsx("input",{...g,disabled:c??_.disabled,title:d,placeholder:p,"aria-label":u,"aria-labelledby":f??_.labelId,ref:Qe([a,x]),className:"outline-hidden w-full text-ellipsis bg-transparent bg-clip-padding text-base text-inherit dark:placeholder-gray-500",onFocus:I=>{s==null||s(I),I.defaultPrevented||(S.current=!0)},onBlur:I=>{i==null||i(I),I.defaultPrevented||(S.current=!1)}})})}function yo({autoHide:e=!0,onBlur:t,onChange:r,append:n,autoComplete:s="current-password",icon:i=l.jsx(md,{className:"w-5"}),value:a,defaultValue:c=a,ref:d,title:u,dir:f="auto",autoCapitalize:p="none",autoCorrect:g="off",spellCheck:_="false",...x}){const{i18n:S,_:I}=z(),D=w.useRef(null),[k,P]=w.useState(!1),[U,$]=w.useState(typeof c=="string"?c:""),B=w.useCallback(V=>{r==null||r(V),$(V.target.value)},[r]);return l.jsx(Mt,{...x,title:u??S._({id:"8ZsakT"}),ref:Qe([d,D]),dir:f,autoCapitalize:p,autoCorrect:g,spellCheck:_,icon:i,onBlur:e?V=>{t==null||t(V),V.defaultPrevented||P(!1)}:t,value:U,onChange:B,type:k?"text":"password",autoComplete:s,append:l.jsxs(l.Fragment,{children:[l.jsx(Du,{className:"m-1",visible:k,toggleVisible:()=>{var V;P(K=>!K),(V=D.current)==null||V.focus()}}),n]})})}function vo({password:e="",onPassword:t,onChange:r,autoComplete:n="new-password",minLength:s=Ze,...i}){const{i18n:a,_:c}=z(),[d,u]=w.useState(e),f=w.useCallback(p=>{const{value:g}=p.target;r==null||r(p),!p.defaultPrevented&&(u(g),t==null||t(p.target.validity.valid?g:void 0))},[r,t]);return l.jsx(yo,{...i,placeholder:a._({id:"3tOlz6"}),"aria-label":a._({id:"0StR7t"}),title:a._({id:"5CqSPX",values:{MIN_PASSWORD_LENGTH:Ze}}),minLength:s,onChange:f,value:d,autoComplete:n,bellow:l.jsxs(l.Fragment,{children:[l.jsx(Ru,{password:d}),l.jsx(ju,{className:"grow-1 min-w-max text-xs text-gray-500 dark:text-gray-400",password:d})]})})}const Nu="XXXXX-XXXXX";function bo({example:e=Nu,onToken:t,icon:r=l.jsx(Ka,{className:"w-5"}),title:n=e,onChange:s,value:i,defaultValue:a=i,...c}){const{i18n:d,_:u}=z(),[f,p]=w.useState(typeof a=="string"?a:"");return l.jsx(Mt,{...c,type:"text",autoCapitalize:"characters",autoCorrect:"off",autoComplete:"one-time-code",spellCheck:"false",minLength:11,maxLength:11,dir:"auto",icon:r,pattern:"^[A-Z2-7]{5}-[A-Z2-7]{5}$",placeholder:d._({id:"0hTJM+",values:{example:e}}),title:n,value:f,onChange:g=>{const{value:_,selectionEnd:x,selectionStart:S}=g.currentTarget,I=oa(_);g.currentTarget.value=I;const D=x??S;if(D!=null){const k=oa(_.slice(0,D));g.currentTarget.selectionStart=g.currentTarget.selectionEnd=k.length}p(I),s==null||s(g),g.isDefaultPrevented()||t==null||t(I.length===11?I:null)}})}function oa(e){const t=e.toUpperCase().replaceAll(/[^A-Z2-7]/g,"");return t.length<=5?t:`${t.slice(0,5)}-${t.slice(5,10)}`}function ku({onSubmit:e,invalid:t,...r}){const n=br({prefix:"reset-pwd-email-"}),s=w.useRef(null),[i,a]=w.useState(null),[c,d]=w.useState(void 0);return l.jsxs(Bt,{...r,onSubmit:u=>{if(i&&c)return e({token:i,password:c},u)},invalid:t||!i||!c,children:[l.jsx($t,{id:n,type:"status",children:l.jsx(R,{id:"imRJNy"})}),l.jsx(Be,{label:l.jsx(R,{id:"vJgYMA"}),children:l.jsx(bo,{name:"code","aria-labelledby":n,enterKeyHint:"next",required:!0,autoFocus:!0,onToken:u=>{var f;a(u),u&&((f=s.current)==null||f.focus())}})}),l.jsx(Be,{label:l.jsx(R,{id:"/nT6AE"}),children:l.jsx(vo,{ref:s,name:"password",enterKeyHint:"done",required:!0,password:c,onPassword:d})})]})}function xo({onEmail:e,autoCapitalize:t="none",autoComplete:r="email",autoCorrect:n="off",dir:s="auto",icon:i=l.jsx(xr,{className:"w-5"}),onBlur:a,onChange:c,pattern:d="^[^@]+@[^@]+\\.[^@]+$",spellCheck:u="false",value:f,defaultValue:p=f,title:g,..._}){const{i18n:x,_:S}=z(),[I,D]=w.useState(typeof p=="string"?p:""),k=w.useCallback(P=>{const U=P.target.value.toLowerCase();D(U),c==null||c(P),e==null||e(P.target.validity.valid?U:void 0)},[c,e]);return l.jsx(Mt,{..._,title:g??x._({id:"ATGYL1"}),type:"email",autoCapitalize:t,autoCorrect:n,dir:s,spellCheck:u,icon:i,pattern:d,autoComplete:r,value:I,onChange:k,onBlur:a})}function Pu({emailDefault:e,onSubmit:t,invalid:r,ref:n,...s}){const{i18n:i,_:a}=z(),c=br({prefix:"reset-pwd-email-"}),[d,u]=w.useState(e),f=w.useRef(null),p=w.useCallback(g=>{if(d)return t({email:d},g)},[d,t]);return l.jsx(Bt,{...s,ref:Qe([n,f]),invalid:r||!d,onSubmit:p,children:l.jsxs(Be,{label:l.jsx(R,{id:"ATGYL1"}),children:[l.jsx(xo,{name:"email",placeholder:i._({id:"xRPn3U"}),"aria-labelledby":c,title:i._({id:"ATGYL1"}),required:!0,autoFocus:!0,value:d,onEmail:g=>{var _;(_=f.current)==null||_.reset(),u(g)}}),l.jsx($t,{type:"status",id:c,children:l.jsx(R,{id:"cHrOqs"})})]})})}function Au({emailDefault:e,onresetPasswordRequest:t,onResetPasswordConfirm:r,onBack:n,...s}){const{i18n:i,_:a}=z(),[c,d]=w.useState(0);if(c===0)return l.jsxs(Ee,{...s,title:s.title||i._({id:"dn8X5t"}),subtitle:s.subtitle||l.jsx(R,{id:"Esfg1M"}),children:[l.jsx(Pu,{emailDefault:e,submitLabel:l.jsx(R,{id:"hXzOVo"}),onSubmit:async(u,f)=>{await t(u,f),f.aborted||d(1)},cancelLabel:l.jsx(R,{id:"iH8pgl"}),onCancel:n}),l.jsx("hr",{className:"my-5 border-gray-300 dark:border-gray-700"}),l.jsx("center",{children:l.jsx(ce,{transparent:!0,onClick:()=>d(1),children:l.jsx(R,{id:"FTT4a4"})})})]});if(c===1)return l.jsx(Ee,{...s,title:s.title||i._({id:"KbS2K9"}),subtitle:s.subtitle||l.jsx(R,{id:"xg/UcZ"}),children:l.jsx(ku,{submitLabel:l.jsx(R,{id:"hXzOVo"}),onSubmit:async(u,f)=>{await r(u,f),f.aborted||d(2)},cancelLabel:l.jsx(R,{id:"iH8pgl"}),onCancel:n})});if(c===2)return l.jsx(Ee,{...s,title:s.title||i._({id:"fSy6T1"}),subtitle:s.subtitle||l.jsx(R,{id:"+qGdcW"}),children:l.jsxs("center",{children:[l.jsx("h2",{className:"pb-2 text-xl font-bold",children:l.jsx(R,{id:"DKeVgZ"})}),l.jsx("p",{className:"pb-4",children:l.jsx(R,{id:"67nRLM"})}),l.jsx(ce,{color:"primary",onClick:n,children:l.jsx(R,{id:"UaXeX3"})})]})});throw new Error(`Invalid view: ${c}`)}function Ou({className:e,children:t,id:r,ref:n,disabled:s,title:i,"aria-label":a=i,"aria-labelledby":c,...d}){const u=br("input-checkbox-"),f=w.useRef(null),p=w.useRef(null),g=w.useContext(yn),_=r??u;return l.jsx(dn,{className:se("cursor-pointer",e),icon:l.jsx(Rs,{...d,disabled:s??g.disabled,title:i,"aria-label":a,"aria-labelledby":t?void 0:c??g.labelId,ref:Qe([n,p]),id:_}),tabIndex:-1,onClick:({target:x})=>{var S,I;x!==f.current&&x!==p.current&&((S=p.current)==null||S.click(),(I=p.current)==null||I.focus())},children:t&&l.jsx("label",{ref:f,htmlFor:_,className:"block w-full cursor-pointer select-none leading-[1.6]",children:t})})}function Gr({usernameDefault:e="",usernameReadonly:t=!1,rememberDefault:r=!1,onSubmit:n,onBack:s,backLabel:i,onForgotPassword:a,ref:c,invalid:d,children:u,...f}){const{i18n:p,_:g}=z(),[_,x]=w.useState(e),[S,I]=w.useState(""),[D,k]=w.useState(r),[P,U]=w.useState(null),[$,B]=w.useState(null),[V,K]=w.useState(!1),F=w.useRef(null),ae=w.useCallback(()=>{U(null),B(null)},[U,B]),M=w.useCallback(()=>{var X;ae(),(X=F.current)==null||X.reset()},[ae,F]),te=w.useCallback(async X=>{try{await n({username:_,password:S,remember:D,...$?{[$.type]:P}:{}},X)}catch(re){if(X.aborted)return;if(re instanceof _d){B(re);return}throw re instanceof gd&&ae(),re}},[_,S,D,$,P,n]);return l.jsxs(Bt,{...f,ref:Qe([c,F]),onLoading:K,onCancel:s,cancelLabel:i??p._({id:"iH8pgl"}),append:u,invalid:d||!_||!S||$!=null&&!P,submitLabel:$?l.jsx(R,{id:"UwGV9B"}):l.jsx(R,{id:"yKDCQ1"}),onSubmit:te,children:[l.jsx(Be,{disabled:V,label:l.jsx(R,{id:"sJGljQ"}),children:l.jsx(Mt,{icon:l.jsx(xr,{className:"w-5"}),name:"username",type:"text",title:p._({id:"nZx9mr"}),autoCapitalize:"none",autoCorrect:"off",autoComplete:"username",spellCheck:"false",dir:"auto",enterKeyHint:"next",required:!0,readOnly:t,disabled:t,autoFocus:!t,value:_,onChange:X=>{M(),x(X.target.value)}})}),l.jsx(Be,{disabled:V,label:l.jsx(R,{id:"8ZsakT"}),children:l.jsx(yo,{name:"password",onChange:X=>{M(),I(X.target.value)},append:a&&l.jsx(ce,{className:"text-sm",type:"button",onClick:()=>{a(_!=null&&_.includes("@")?_:void 0)},"aria-label":p._({id:"slOprG"}),children:l.jsx(R,{id:"F4OP4y"})}),enterKeyHint:$?"next":"done",disabled:V,autoFocus:t,required:!0})}),l.jsx($t,{role:"alert",title:l.jsx(R,{id:"r6y+jM"}),children:l.jsx(R,{id:"+Z2ZNt"})}),l.jsx(Ou,{name:"remember",title:p._({id:"1TxdLU"}),enterKeyHint:$?"next":"done",checked:D,onChange:X=>k(X.target.checked),children:l.jsx(R,{id:"1TxdLU"})}),$&&l.jsx(Be,{disabled:V,label:l.jsx(R,{id:"4blS0m"}),children:l.jsxs("div",{children:[l.jsx(bo,{title:p._({id:"ioZOzk"}),enterKeyHint:"done",required:!0,autoFocus:!0,value:P??"",onToken:U}),l.jsx("p",{className:"text-sm text-slate-600 dark:text-slate-400",children:l.jsx(R,{id:"B+Yy3b",values:{0:$.hint}})})]})},"2fa")]})}function Uu({src:e,alt:t}){const[r,n]=w.useState(!1);return w.useEffect(()=>{n(!1)},[e]),e&&!r?l.jsx("img",{"aria-hidden":!0,src:e,alt:t,className:"-ml-1 h-6 w-6 rounded-full",onError:()=>n(!0)}):l.jsx("div",{"aria-hidden":!0,className:"bg-primary border-primary h-6 w-6 overflow-hidden rounded-full border-2 border-solid text-white",children:l.jsx(yd,{className:"-mx-1 -mb-1"})})}function Zu({accounts:e,onAccount:t,onOther:r=void 0,onBack:n,onSignUp:s,backLabel:i,children:a,...c}){const{i18n:d,_:u}=z();return l.jsxs(Ds,{...c,append:a,actions:s&&l.jsx(ce,{onClick:s,color:"primary",transparent:!0,children:l.jsx(R,{id:"e+RpCP"})}),cancel:n&&l.jsx(ce,{onClick:n,children:i||l.jsx(R,{id:"iH8pgl"})}),children:[l.jsx("p",{className:"text-sm font-medium text-slate-600 dark:text-slate-400",children:l.jsx(R,{id:"FT1MVS"})}),e.map(f=>l.jsx(dn,{tabIndex:0,onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&t(f)},onClick:()=>t(f),role:"button","aria-label":d._({id:"N9o7n5",values:{0:f.name}}),icon:l.jsx(Uu,{src:f.picture,alt:d._({id:"kfcRb0"})}),append:l.jsx(ci,{"aria-hidden":!0,className:"h-4"}),children:l.jsxs("span",{className:"flex flex-wrap items-center",children:[f.name&&l.jsx("span",{className:"mr-2 truncate font-medium","arial-label":d._({id:"6YtxFj"}),children:f.name}),l.jsx("span",{className:"truncate text-sm text-neutral-500 dark:text-neutral-400","arial-label":d._({id:"sJGljQ"}),children:f.preferred_username||f.email||f.sub})]})},f.sub)),r&&l.jsx(dn,{tabIndex:0,onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&r()},onClick:r,"aria-label":d._({id:"cR9UpQ"}),role:"button",append:l.jsx(ci,{"aria-hidden":!0,className:"h-4"}),icon:l.jsx(xr,{"aria-hidden":!0,className:"h-4"}),children:l.jsx("span",{className:"truncate text-slate-700 dark:text-slate-400",children:l.jsx(R,{id:"+TaG50"})})},"other")]})}function $u({loginHint:e,sessions:t,selectSub:r,onSignIn:n,onSignUp:s,onForgotPassword:i,onBack:a,backLabel:c,title:d,subtitle:u,...f}){const{i18n:p,_:g}=z(),_=w.useMemo(()=>t.find(k=>k.selected),[t]),x=w.useCallback(()=>r(null),[r]),S=w.useMemo(()=>t.map(k=>k.account),[t]),[I,D]=w.useState(t.length===0);return d??(d=p._({id:"cQae5I"})),w.useEffect(()=>{_&&D(!1)},[_]),_?_.loginRequired?l.jsx(Ee,{...f,title:d,subtitle:u??l.jsx(R,{id:"HaGV2g"}),children:l.jsx(Gr,{onSubmit:n,onForgotPassword:i,onBack:x,usernameDefault:_.account.preferred_username||_.account.sub,usernameReadonly:!0,rememberDefault:!0})}):null:e?l.jsx(Ee,{...f,title:d,subtitle:u??l.jsx(R,{id:"NgaR6B"}),children:l.jsx(Gr,{onSubmit:n,onForgotPassword:i,onBack:a,backLabel:c,usernameDefault:e,usernameReadonly:!0})}):t.length===0?l.jsx(Ee,{...f,title:d,subtitle:u??l.jsx(R,{id:"T0KLp4"}),children:l.jsx(Gr,{onSubmit:n,onForgotPassword:i,onBack:a,backLabel:c})}):I?l.jsx(Ee,{...f,title:d,subtitle:u??l.jsx(R,{id:"T0KLp4"}),children:l.jsx(Gr,{onSubmit:n,onForgotPassword:i,onBack:()=>D(!1)})}):l.jsx(Ee,{...f,title:d,subtitle:u??l.jsx(R,{id:"o3dwub"}),children:l.jsx(Zu,{accounts:S,onAccount:k=>r(k.sub),onOther:()=>D(!0),onBack:a,backLabel:c,onSignUp:s})})}const $e=e=>e!=null&&e!==!1,Lu=e=>$e(e)&&e.invalid===!0,Bu=e=>!$e(e)||e.invalid===!1;function Mu(e){const t=e.findIndex($e),r=e.findLastIndex($e),n=e.findIndex(Lu),[s,i]=w.useState(t),a=w.useCallback(P=>P!==-1&&e[P]?(i(P),!0):!1,[e.map($e).join()]),c=e.findLastIndex((P,U)=>$e(P)&&U<s),d=e.findIndex((P,U)=>$e(P)&&U>s),u=w.useCallback(()=>a(t),[a,t]),f=w.useCallback(()=>a(r),[a,r]),p=w.useCallback(()=>a(c),[a,c]),g=w.useCallback(()=>a(d),[a,d]),_=w.useCallback(()=>a(n),[a,n]),x=s+1+e.reduce((P,U,$)=>$>=s||$e(U)?P:P-1,0),S=e.filter($e).length,I=e.every(Bu),D=s===-1||!e[s]?void 0:e[s],k=s===-1;return w.useEffect(()=>{k&&u()},[k]),{current:D,currentPosition:x,count:S,completed:I,atFirst:x===1,atLast:x===S,toFirst:u,toLast:f,toPrev:p,toNext:g,toRequired:_}}function Vu({prevLabel:e,nextLabel:t,onBack:r,backLabel:n,onDone:s,doneLabel:i,steps:a,className:c,...d}){var B,V;const{atFirst:u,atLast:f,count:p,current:g,currentPosition:_,completed:x,toNext:S,toPrev:I,toRequired:D}=Mu(a),k=w.useCallback(()=>{S()||D()},[S,D]),P={current:!0,invalid:g?g.invalid:!1,prevLabel:u&&n||e||l.jsx(R,{id:"iH8pgl"}),prev:u?r:I,nextLabel:f&&i||t||l.jsx(R,{id:"hXzOVo"}),next:f&&x?s:k},U=(B=g==null?void 0:g.titleRender)==null?void 0:B.call(g,P),$=(V=g==null?void 0:g.contentRender)==null?void 0:V.call(g,P);return l.jsxs("div",{className:se(c,"flex flex-col"),...d,children:[l.jsx("p",{className:"text-slate-500 dark:text-slate-400",children:l.jsx(R,{id:"BEx8rG",values:{currentPosition:_,count:p}})}),U&&l.jsx("h2",{className:"mb-4 text-xl font-medium",children:U}),$]})}function qu({links:e,className:t,...r}){const n=e==null?void 0:e.find(s=>s.rel==="help");return n?l.jsx("p",{...r,className:se("rounded-md bg-slate-100 p-3 text-sm text-slate-800 dark:bg-slate-800 dark:text-slate-400",t),children:l.jsx(R,{id:"87VTIH",components:{0:l.jsx("a",{role:"link",href:n.href,rel:n.rel,target:"_blank",className:"text-primary"})}})}):null}function zu({inviteCodeRequired:e=!0,credentials:t,onCredentials:r,onNext:n,nextLabel:s,onPrev:i,prevLabel:a,children:c,ref:d,invalid:u,...f}){const{i18n:p,_:g}=z(),[_,x]=w.useState(t==null?void 0:t.email),[S,I]=w.useState(t==null?void 0:t.password),[D,k]=w.useState(t==null?void 0:t.inviteCode),P=w.useRef(null),U=()=>{var B;return(B=P.current)==null?void 0:B.reset()},$=w.useMemo(()=>_&&S&&(!e||D)?{email:_,password:S,inviteCode:e?D:void 0}:void 0,[_,S,D,e]);return w.useEffect(()=>{r==null||r($)},[$,r]),l.jsxs(Bt,{...f,ref:Qe([d,P]),invalid:u||!$,onCancel:i,cancelLabel:a,onSubmit:n,submitLabel:s,append:c,children:[e&&l.jsx(Be,{label:l.jsx(R,{id:"6KlkHI"}),children:l.jsx(Mt,{icon:l.jsx(Ka,{className:"w-5"}),autoFocus:!0,name:"inviteCode",title:p._({id:"6KlkHI"}),placeholder:p._({id:"jxqcgY"}),required:!0,value:D||"",onChange:B=>{k(B.target.value||void 0),U()},enterKeyHint:"next"})}),l.jsx(Be,{label:l.jsx(R,{id:"O3oNi5"}),children:l.jsx(xo,{autoFocus:!e,name:"email",enterKeyHint:"next",required:!0,defaultValue:_,onEmail:B=>{x(B),U()}})}),l.jsx(Be,{label:l.jsx(R,{id:"8ZsakT"}),children:l.jsx(vo,{name:"password",enterKeyHint:"next",required:!0,password:S,onPassword:B=>{I(B),U()}})})]})}function Hn({links:e,className:t,...r}){const n=e==null?void 0:e.find(i=>i.rel==="terms-of-service"),s=e==null?void 0:e.find(i=>i.rel==="privacy-policy");return l.jsx("p",{className:se("text-sm text-slate-500 dark:text-slate-400",t),...r,children:l.jsx(R,{id:"mBUXx0",values:{0:n?l.jsx(di,{className:"text-primary underline",link:n,children:l.jsx(R,{id:"xowcRf"})}):l.jsx(R,{id:"xowcRf"}),1:s?l.jsx(di,{className:"text-primary underline",link:s,children:l.jsx(R,{id:"LcET2C"})}):l.jsx(R,{id:"LcET2C"})}})})}const Gu=18,Eo=3,So=30,Yu=e=>Eo+e.length<=So&&e.startsWith(".")&&!e.endsWith(".");function Fu(e){const t=Eo,r=Math.min(Gu,So-e.length),n=w.useCallback(s=>{const i=s.length>=t&&s.length<=r,a=/^[a-z0-9][a-z0-9-]+[a-z0-9]$/g.test(s);return{validLength:i,validCharset:a,valid:i&&a}},[r,t]);return{minLength:t,maxLength:r,validateSegment:n}}function Hu({domains:e,onNext:t,nextLabel:r,onPrev:n,prevLabel:s,handle:i,onHandle:a,invalid:c,children:d,ref:u,...f}){const{i18n:p,_:g}=z(),_=e.filter(Yu),x=w.useRef(null),[S,I]=w.useState(()=>{const M=_.findIndex(te=>i==null?void 0:i.endsWith(te));return M===-1?0:M}),[D,k]=w.useState(()=>(i==null?void 0:i.split(".")[0])||"");w.useEffect(()=>{I(M=>Math.min(M,_.length-1))},[_.length]);const P=_[S]||_[0]||null,{minLength:U,maxLength:$,validateSegment:B}=Fu(P),V=B(D),K=P&&V.valid?`${D}${P}`:void 0;w.useEffect(()=>{var M;(M=x.current)==null||M.reset(),a==null||a(K)},[a,K]);const F=w.useRef(null),ae=`@${D}${P}`;return l.jsxs(Bt,{...f,ref:Qe([u,x]),onCancel:n,cancelLabel:s,onSubmit:t,submitLabel:r,invalid:c||!K,append:d,children:[l.jsxs("div",{children:[l.jsx(ca,{hasValue:!!D,valid:V.validLength,children:l.jsx(R,{id:"4Rgp24",values:{minLength:U,maxLength:$}})}),l.jsx(ca,{hasValue:!!D,valid:V.validCharset,children:l.jsx(R,{id:"yDlXDJ"})})]}),l.jsx(Mt,{ref:F,icon:l.jsx(xr,{className:"w-5"}),name:"handle",type:"text",title:p._({id:"LX2sHe"}),pattern:"[a-z0-9][a-z0-9\\-]+[a-z0-9]",minLength:U,maxLength:$,autoCapitalize:"none",autoCorrect:"off",autoComplete:"off",dir:"auto",enterKeyHint:"done",autoFocus:!0,required:!0,value:D,onChange:M=>{const te=M.target.value.toLowerCase(),X=M.target.selectionStart,re=M.target.selectionEnd;M.target.value=te,M.target.setSelectionRange(X,re),k(te)},append:_.length>1&&l.jsx("select",{onClick:M=>M.stopPropagation(),onMouseDown:M=>M.stopPropagation(),value:S,"aria-label":p._({id:"HB+TbB"}),onChange:M=>{var te;I(Number(M.target.value)),(te=F.current)==null||te.focus()},className:se("block w-full","text-sm","accent-primary","cursor-pointer","bg-gray-100 dark:bg-gray-800","hover:bg-gray-200 dark:hover:bg-gray-700","transition duration-300 ease-in-out","outline-none","focus:ring-primary focus:ring-2 focus:ring-offset-1 focus:ring-offset-white dark:focus:ring-offset-black","text-slate-600 dark:text-slate-300","rounded-lg","p-2 pr-1"),children:_.map((M,te)=>l.jsx("option",{value:te,children:M},M))}),bellow:l.jsx(R,{id:"r/b/p8",values:{0:D.length?l.jsx("strong",{className:"text-gray-800 dark:text-gray-200",children:ae}):l.jsx("span",{"aria-hidden":!0,className:"w-24 rounded-md bg-gray-300 p-2 dark:bg-slate-600"})}})}),l.jsx($t,{type:"status",children:l.jsx(R,{id:"B9VwbO"})})]})}function ca({valid:e,hasValue:t,children:r,className:n,...s}){const{i18n:i,_:a}=z();return l.jsxs("div",{...s,className:se("flex flex-row items-center gap-2",n),children:[t?l.jsx(l.Fragment,{children:e?l.jsx(nn,{className:"text-success inline-block h-4 w-4",title:i._({id:"nfagfM"})}):l.jsx(vd,{className:"text-error inline-block h-4 w-4",title:i._({id:"JHB/Ky"})})}):l.jsx("div",{"aria-hidden":!0,className:"flex h-4 w-4 items-center justify-center",children:l.jsx("div",{className:"h-2 w-2 rounded-full bg-gray-300 dark:bg-slate-600"})}),l.jsx("div",{className:"text-sm",children:r})]})}function pe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rs(e,t){return rs=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},rs(e,t)}function Wu(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,rs(e,t)}var wo=Object.defineProperty,Ku=Object.defineProperties,Xu=Object.getOwnPropertyDescriptors,un=Object.getOwnPropertySymbols,To=Object.prototype.hasOwnProperty,Io=Object.prototype.propertyIsEnumerable,da=(e,t,r)=>t in e?wo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,T=(e,t)=>{for(var r in t||(t={}))To.call(t,r)&&da(e,r,t[r]);if(un)for(var r of un(t))Io.call(t,r)&&da(e,r,t[r]);return e},q=(e,t)=>Ku(e,Xu(t)),Ju=(e,t)=>{var r={};for(var n in e)To.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&un)for(var n of un(e))t.indexOf(n)<0&&Io.call(e,n)&&(r[n]=e[n]);return r},jo=(e,t)=>{for(var r in t)wo(e,r,{get:t[r],enumerable:!0})},Ns=(e,t,r)=>new Promise((n,s)=>{var i=d=>{try{c(r.next(d))}catch(u){s(u)}},a=d=>{try{c(r.throw(d))}catch(u){s(u)}},c=d=>d.done?n(d.value):Promise.resolve(d.value).then(i,a);c((r=r.apply(e,t)).next())});function Qu(e){return Object.entries(e).filter(([,t])=>t||t===!1).map(([t,r])=>`${encodeURIComponent(t)}=${encodeURIComponent(String(r))}`).join("&")}function Ro(e){let t=e&&e.ownerDocument||document,r=t.defaultView||t.parentWindow||window;return{document:t,window:r}}function Co(e){return e||document.head}var el="hCaptcha-script",sn="hCaptchaOnLoad",ns="script-error",Rt="@hCaptcha/loader",Do=Object.prototype.toString;function No(e){switch(Do.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return Me(e,Error)}}function Vt(e,t){return Do.call(e)===`[object ${t}]`}function ks(e){return Vt(e,"ErrorEvent")}function ua(e){return Vt(e,"DOMError")}function tl(e){return Vt(e,"DOMException")}function Xe(e){return Vt(e,"String")}function ko(e){return e===null||typeof e!="object"&&typeof e!="function"}function Pt(e){return Vt(e,"Object")}function vn(e){return typeof Event<"u"&&Me(e,Event)}function rl(e){return typeof Element<"u"&&Me(e,Element)}function nl(e){return Vt(e,"RegExp")}function Ps(e){return!!(e&&e.then&&typeof e.then=="function")}function sl(e){return Pt(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function Po(e){return typeof e=="number"&&e!==e}function Me(e,t){try{return e instanceof t}catch{return!1}}function Ao(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue))}function Nt(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function la(e,t){if(!Array.isArray(e))return"";let r=[];for(let n=0;n<e.length;n++){let s=e[n];try{Ao(s)?r.push("[VueViewModel]"):r.push(String(s))}catch{r.push("[value cannot be serialized]")}}return r.join(t)}function il(e,t,r=!1){return Xe(e)?nl(t)?t.test(e):Xe(t)?r?e===t:e.includes(t):!1:!1}function jr(e,t=[],r=!1){return t.some(n=>il(e,n,r))}function al(e,t,r=250,n,s,i,a){if(!i.exception||!i.exception.values||!a||!Me(a.originalException,Error))return;let c=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;c&&(i.exception.values=ol(ss(e,t,s,a.originalException,n,i.exception.values,c,0),r))}function ss(e,t,r,n,s,i,a,c){if(i.length>=r+1)return i;let d=[...i];if(Me(n[s],Error)){fa(a,c);let u=e(t,n[s]),f=d.length;ha(u,s,f,c),d=ss(e,t,r,n[s],s,[u,...d],u,f)}return Array.isArray(n.errors)&&n.errors.forEach((u,f)=>{if(Me(u,Error)){fa(a,c);let p=e(t,u),g=d.length;ha(p,`errors[${f}]`,g,c),d=ss(e,t,r,u,s,[p,...d],p,g)}}),d}function fa(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism=q(T({},e.mechanism),{is_exception_group:!0,exception_id:t})}function ha(e,t,r,n){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism=q(T({},e.mechanism),{type:"chained",source:t,exception_id:r,parent_id:n})}function ol(e,t){return e.map(r=>(r.value&&(r.value=Nt(r.value,t)),r))}function Yr(e){return e&&e.Math==Math?e:void 0}var Q=typeof globalThis=="object"&&Yr(globalThis)||typeof window=="object"&&Yr(window)||typeof self=="object"&&Yr(self)||typeof global=="object"&&Yr(global)||function(){return this}()||{};function Rr(){return Q}function Oo(e,t,r){let n=r||Q,s=n.__SENTRY__=n.__SENTRY__||{};return s[e]||(s[e]=t())}var an=Rr(),cl=80;function At(e,t={}){try{let r=e,n=5,s=[],i=0,a=0,c=" > ",d=c.length,u,f=Array.isArray(t)?t:t.keyAttrs,p=!Array.isArray(t)&&t.maxStringLength||cl;for(;r&&i++<n&&(u=dl(r,f),!(u==="html"||i>1&&a+s.length*d+u.length>=p));)s.push(u),a+=u.length,r=r.parentNode;return s.reverse().join(c)}catch{return"<unknown>"}}function dl(e,t){let r=e,n=[],s,i,a,c,d;if(!r||!r.tagName)return"";n.push(r.tagName.toLowerCase());let u=t&&t.length?t.filter(p=>r.getAttribute(p)).map(p=>[p,r.getAttribute(p)]):null;if(u&&u.length)u.forEach(p=>{n.push(`[${p[0]}="${p[1]}"]`)});else if(r.id&&n.push(`#${r.id}`),s=r.className,s&&Xe(s))for(i=s.split(/\s+/),d=0;d<i.length;d++)n.push(`.${i[d]}`);let f=["aria-label","type","name","title","alt"];for(d=0;d<f.length;d++)a=f[d],c=r.getAttribute(a),c&&n.push(`[${a}="${c}"]`);return n.join("")}function ul(){try{return an.document.location.href}catch{return""}}function ll(e){return an.document&&an.document.querySelector?an.document.querySelector(e):null}var fl="Sentry Logger ",is=["debug","info","warn","error","log","assert","trace"],ln={};function Uo(e){if(!("console"in Q))return e();let t=Q.console,r={},n=Object.keys(ln);n.forEach(s=>{let i=ln[s];r[s]=t[s],t[s]=i});try{return e()}finally{n.forEach(s=>{t[s]=r[s]})}}function hl(){let e=!1,t={enable:()=>{e=!0},disable:()=>{e=!1}};return typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?is.forEach(r=>{t[r]=(...n)=>{e&&Uo(()=>{Q.console[r](`${fl}[${r}]:`,...n)})}}):is.forEach(r=>{t[r]=()=>{}}),t}var N=hl(),pl=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function ml(e){return e==="http"||e==="https"}function bn(e,t=!1){let{host:r,path:n,pass:s,port:i,projectId:a,protocol:c,publicKey:d}=e;return`${c}://${d}${t&&s?`:${s}`:""}@${r}${i?`:${i}`:""}/${n&&`${n}/`}${a}`}function _l(e){let t=pl.exec(e);if(!t){console.error(`Invalid Sentry Dsn: ${e}`);return}let[r,n,s="",i,a="",c]=t.slice(1),d="",u=c,f=u.split("/");if(f.length>1&&(d=f.slice(0,-1).join("/"),u=f.pop()),u){let p=u.match(/^\d+/);p&&(u=p[0])}return Zo({host:i,pass:s,path:d,projectId:u,port:a,protocol:r,publicKey:n})}function Zo(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function gl(e){if(!(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__))return!0;let{port:t,projectId:r,protocol:n}=e;return["protocol","publicKey","host","projectId"].find(s=>e[s]?!1:(N.error(`Invalid Sentry Dsn: ${s} missing`),!0))?!1:r.match(/^\d+$/)?ml(n)?t&&isNaN(parseInt(t,10))?(N.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(N.error(`Invalid Sentry Dsn: Invalid protocol ${n}`),!1):(N.error(`Invalid Sentry Dsn: Invalid projectId ${r}`),!1)}function yl(e){let t=typeof e=="string"?_l(e):Zo(e);if(!(!t||!gl(t)))return t}var Ce=class extends Error{constructor(e,t="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=t}};function ie(e,t,r){if(!(t in e))return;let n=e[t],s=r(n);typeof s=="function"&&$o(s,n),e[t]=s}function As(e,t,r){try{Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0})}catch{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function $o(e,t){try{let r=t.prototype||{};e.prototype=t.prototype=r,As(e,"__sentry_original__",t)}catch{}}function Os(e){return e.__sentry_original__}function vl(e){return Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}function Lo(e){if(No(e))return T({message:e.message,name:e.name,stack:e.stack},ma(e));if(vn(e)){let t=T({type:e.type,target:pa(e.target),currentTarget:pa(e.currentTarget)},ma(e));return typeof CustomEvent<"u"&&Me(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function pa(e){try{return rl(e)?At(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function ma(e){if(typeof e=="object"&&e!==null){let t={};for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}else return{}}function bl(e,t=40){let r=Object.keys(Lo(e));if(r.sort(),!r.length)return"[object has no keys]";if(r[0].length>=t)return Nt(r[0],t);for(let n=r.length;n>0;n--){let s=r.slice(0,n).join(", ");if(!(s.length>t))return n===r.length?s:Nt(s,t)}return""}function Ke(e){return as(e,new Map)}function as(e,t){if(Pt(e)){let r=t.get(e);if(r!==void 0)return r;let n={};t.set(e,n);for(let s of Object.keys(e))typeof e[s]<"u"&&(n[s]=as(e[s],t));return n}if(Array.isArray(e)){let r=t.get(e);if(r!==void 0)return r;let n=[];return t.set(e,n),e.forEach(s=>{n.push(as(s,t))}),n}return e}var Bo=50,_a=/\(error: (.*)\)/,ga=/captureMessage|captureException/;function xl(...e){let t=e.sort((r,n)=>r[0]-n[0]).map(r=>r[1]);return(r,n=0)=>{let s=[],i=r.split(`
|
|
2
|
+
`);for(let a=n;a<i.length;a++){let c=i[a];if(c.length>1024)continue;let d=_a.test(c)?c.replace(_a,"$1"):c;if(!d.match(/\S*Error: /)){for(let u of t){let f=u(d);if(f){s.push(f);break}}if(s.length>=Bo)break}}return El(s)}}function El(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(t[t.length-1].function||"")&&t.pop(),t.reverse(),ga.test(t[t.length-1].function||"")&&(t.pop(),ga.test(t[t.length-1].function||"")&&t.pop()),t.slice(0,Bo).map(r=>q(T({},r),{filename:r.filename||t[t.length-1].filename,function:r.function||"?"}))}var Wn="<anonymous>";function Je(e){try{return!e||typeof e!="function"?Wn:e.name||Wn}catch{return Wn}}var os=Rr();function Sl(){if(!("fetch"in os))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function cs(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function wl(){if(!Sl())return!1;if(cs(os.fetch))return!0;let e=!1,t=os.document;if(t&&typeof t.createElement=="function")try{let r=t.createElement("iframe");r.hidden=!0,t.head.appendChild(r),r.contentWindow&&r.contentWindow.fetch&&(e=cs(r.contentWindow.fetch)),t.head.removeChild(r)}catch(r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return e}var Fr=Rr();function Tl(){let e=Fr.chrome,t=e&&e.app&&e.app.runtime,r="history"in Fr&&!!Fr.history.pushState&&!!Fr.history.replaceState;return!t&&r}var ne=Rr(),Dt="__sentry_xhr_v2__",gr={},ya={};function Il(e){if(!ya[e])switch(ya[e]=!0,e){case"console":jl();break;case"dom":Ol();break;case"xhr":Dl();break;case"fetch":Rl();break;case"history":Nl();break;case"error":Ul();break;case"unhandledrejection":Zl();break;default:(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.warn("unknown instrumentation type:",e);return}}function _e(e,t){gr[e]=gr[e]||[],gr[e].push(t),Il(e)}function Se(e,t){if(!(!e||!gr[e]))for(let r of gr[e]||[])try{r(t)}catch(n){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.error(`Error while triggering instrumentation handler.
|
|
3
|
+
Type: ${e}
|
|
4
|
+
Name: ${Je(r)}
|
|
5
|
+
Error:`,n)}}function jl(){"console"in Q&&is.forEach(function(e){e in Q.console&&ie(Q.console,e,function(t){return ln[e]=t,function(...r){Se("console",{args:r,level:e});let n=ln[e];n&&n.apply(Q.console,r)}})})}function Rl(){wl()&&ie(Q,"fetch",function(e){return function(...t){let{method:r,url:n}=Cl(t),s={args:t,fetchData:{method:r,url:n},startTimestamp:Date.now()};return Se("fetch",T({},s)),e.apply(Q,t).then(i=>(Se("fetch",q(T({},s),{endTimestamp:Date.now(),response:i})),i),i=>{throw Se("fetch",q(T({},s),{endTimestamp:Date.now(),error:i})),i})}})}function ds(e,t){return!!e&&typeof e=="object"&&!!e[t]}function va(e){return typeof e=="string"?e:e?ds(e,"url")?e.url:e.toString?e.toString():"":""}function Cl(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){let[r,n]=e;return{url:va(r),method:ds(n,"method")?String(n.method).toUpperCase():"GET"}}let t=e[0];return{url:va(t),method:ds(t,"method")?String(t.method).toUpperCase():"GET"}}function Dl(){if(!ne.XMLHttpRequest)return;let e=XMLHttpRequest.prototype;ie(e,"open",function(t){return function(...r){let n=r[1],s=this[Dt]={method:Xe(r[0])?r[0].toUpperCase():r[0],url:r[1],request_headers:{}};Xe(n)&&s.method==="POST"&&n.match(/sentry_key/)&&(this.__sentry_own_request__=!0);let i=()=>{let a=this[Dt];if(a&&this.readyState===4){try{a.status_code=this.status}catch{}Se("xhr",{args:r,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:this})}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?ie(this,"onreadystatechange",function(a){return function(...c){return i(),a.apply(this,c)}}):this.addEventListener("readystatechange",i),ie(this,"setRequestHeader",function(a){return function(...c){let[d,u]=c,f=this[Dt];return f&&(f.request_headers[d.toLowerCase()]=u),a.apply(this,c)}}),t.apply(this,r)}}),ie(e,"send",function(t){return function(...r){let n=this[Dt];return n&&r[0]!==void 0&&(n.body=r[0]),Se("xhr",{args:r,startTimestamp:Date.now(),xhr:this}),t.apply(this,r)}})}var Hr;function Nl(){if(!Tl())return;let e=ne.onpopstate;ne.onpopstate=function(...r){let n=ne.location.href,s=Hr;if(Hr=n,Se("history",{from:s,to:n}),e)try{return e.apply(this,r)}catch{}};function t(r){return function(...n){let s=n.length>2?n[2]:void 0;if(s){let i=Hr,a=String(s);Hr=a,Se("history",{from:i,to:a})}return r.apply(this,n)}}ie(ne.history,"pushState",t),ie(ne.history,"replaceState",t)}var kl=1e3,Wr,Kr;function Pl(e,t){if(!e||e.type!==t.type)return!0;try{if(e.target!==t.target)return!0}catch{}return!1}function Al(e){if(e.type!=="keypress")return!1;try{let t=e.target;if(!t||!t.tagName)return!0;if(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable)return!1}catch{}return!0}function ba(e,t=!1){return r=>{if(!r||Kr===r||Al(r))return;let n=r.type==="keypress"?"input":r.type;Wr===void 0?(e({event:r,name:n,global:t}),Kr=r):Pl(Kr,r)&&(e({event:r,name:n,global:t}),Kr=r),clearTimeout(Wr),Wr=ne.setTimeout(()=>{Wr=void 0},kl)}}function Ol(){if(!ne.document)return;let e=Se.bind(null,"dom"),t=ba(e,!0);ne.document.addEventListener("click",t,!1),ne.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(r=>{let n=ne[r]&&ne[r].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(ie(n,"addEventListener",function(s){return function(i,a,c){if(i==="click"||i=="keypress")try{let d=this,u=d.__sentry_instrumentation_handlers__=d.__sentry_instrumentation_handlers__||{},f=u[i]=u[i]||{refCount:0};if(!f.handler){let p=ba(e);f.handler=p,s.call(this,i,p,c)}f.refCount++}catch{}return s.call(this,i,a,c)}}),ie(n,"removeEventListener",function(s){return function(i,a,c){if(i==="click"||i=="keypress")try{let d=this,u=d.__sentry_instrumentation_handlers__||{},f=u[i];f&&(f.refCount--,f.refCount<=0&&(s.call(this,i,f.handler,c),f.handler=void 0,delete u[i]),Object.keys(u).length===0&&delete d.__sentry_instrumentation_handlers__)}catch{}return s.call(this,i,a,c)}}))})}var Xr=null;function Ul(){Xr=ne.onerror,ne.onerror=function(e,t,r,n,s){return Se("error",{column:n,error:s,line:r,msg:e,url:t}),Xr&&!Xr.__SENTRY_LOADER__?Xr.apply(this,arguments):!1},ne.onerror.__SENTRY_INSTRUMENTED__=!0}var Jr=null;function Zl(){Jr=ne.onunhandledrejection,ne.onunhandledrejection=function(e){return Se("unhandledrejection",e),Jr&&!Jr.__SENTRY_LOADER__?Jr.apply(this,arguments):!0},ne.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}function $l(){let e=typeof WeakSet=="function",t=e?new WeakSet:[];function r(s){if(e)return t.has(s)?!0:(t.add(s),!1);for(let i=0;i<t.length;i++)if(t[i]===s)return!0;return t.push(s),!1}function n(s){if(e)t.delete(s);else for(let i=0;i<t.length;i++)if(t[i]===s){t.splice(i,1);break}}return[r,n]}function ue(){let e=Q,t=e.crypto||e.msCrypto,r=()=>Math.random()*16;try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(r=()=>t.getRandomValues(new Uint8Array(1))[0])}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,n=>(n^(r()&15)>>n/4).toString(16))}function Mo(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function We(e){let{message:t,event_id:r}=e;if(t)return t;let n=Mo(e);return n?n.type&&n.value?`${n.type}: ${n.value}`:n.type||n.value||r||"<unknown>":r||"<unknown>"}function us(e,t,r){let n=e.exception=e.exception||{},s=n.values=n.values||[],i=s[0]=s[0]||{};i.value||(i.value=t||""),i.type||(i.type="Error")}function vr(e,t){let r=Mo(e);if(!r)return;let n={type:"generic",handled:!0},s=r.mechanism;if(r.mechanism=T(T(T({},n),s),t),t&&"data"in t){let i=T(T({},s&&s.data),t.data);r.mechanism.data=i}}function xa(e){if(e&&e.__sentry_captured__)return!0;try{As(e,"__sentry_captured__",!0)}catch{}return!1}function Ll(e){return Array.isArray(e)?e:[e]}function Bl(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function Ml(){return"npm"}function Vl(){return!Bl()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function ql(e,t){return e.require(t)}function He(e,t=100,r=1/0){try{return ls("",e,t,r)}catch(n){return{ERROR:`**non-serializable** (${n})`}}}function Vo(e,t=3,r=100*1024){let n=He(e,t);return Fl(n)>r?Vo(e,t-1,r):n}function ls(e,t,r=1/0,n=1/0,s=$l()){let[i,a]=s;if(t==null||["number","boolean","string"].includes(typeof t)&&!Po(t))return t;let c=zl(e,t);if(!c.startsWith("[object "))return c;if(t.__sentry_skip_normalization__)return t;let d=typeof t.__sentry_override_normalization_depth__=="number"?t.__sentry_override_normalization_depth__:r;if(d===0)return c.replace("object ","");if(i(t))return"[Circular ~]";let u=t;if(u&&typeof u.toJSON=="function")try{let _=u.toJSON();return ls("",_,d-1,n,s)}catch{}let f=Array.isArray(t)?[]:{},p=0,g=Lo(t);for(let _ in g){if(!Object.prototype.hasOwnProperty.call(g,_))continue;if(p>=n){f[_]="[MaxProperties ~]";break}let x=g[_];f[_]=ls(_,x,d-1,n,s),p++}return a(t),f}function zl(e,t){try{if(e==="domain"&&t&&typeof t=="object"&&t._events)return"[Domain]";if(e==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&t===global)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(Ao(t))return"[VueViewModel]";if(sl(t))return"[SyntheticEvent]";if(typeof t=="number"&&t!==t)return"[NaN]";if(typeof t=="function")return`[Function: ${Je(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;let r=Gl(t);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(r){return`**non-serializable** (${r})`}}function Gl(e){let t=Object.getPrototypeOf(e);return t?t.constructor.name:"null prototype"}function Yl(e){return~-encodeURI(e).split(/%..|./).length}function Fl(e){return Yl(JSON.stringify(e))}var Le;(function(e){e[e.PENDING=0]="PENDING";let t=1;e[e.RESOLVED=t]="RESOLVED";let r=2;e[e.REJECTED=r]="REJECTED"})(Le||(Le={}));function _t(e){return new me(t=>{t(e)})}function Us(e){return new me((t,r)=>{r(e)})}var me=class{constructor(e){me.prototype.__init.call(this),me.prototype.__init2.call(this),me.prototype.__init3.call(this),me.prototype.__init4.call(this),this._state=Le.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(t){this._reject(t)}}then(e,t){return new me((r,n)=>{this._handlers.push([!1,s=>{if(!e)r(s);else try{r(e(s))}catch(i){n(i)}},s=>{if(!t)n(s);else try{r(t(s))}catch(i){n(i)}}]),this._executeHandlers()})}catch(e){return this.then(t=>t,e)}finally(e){return new me((t,r)=>{let n,s;return this.then(i=>{s=!1,n=i,e&&e()},i=>{s=!0,n=i,e&&e()}).then(()=>{if(s){r(n);return}t(n)})})}__init(){this._resolve=e=>{this._setResult(Le.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(Le.REJECTED,e)}}__init3(){this._setResult=(e,t)=>{if(this._state===Le.PENDING){if(Ps(t)){t.then(this._resolve,this._reject);return}this._state=e,this._value=t,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===Le.PENDING)return;let e=this._handlers.slice();this._handlers=[],e.forEach(t=>{t[0]||(this._state===Le.RESOLVED&&t[1](this._value),this._state===Le.REJECTED&&t[2](this._value),t[0]=!0)})}}};function Hl(e){let t=[];function r(){return e===void 0||t.length<e}function n(a){return t.splice(t.indexOf(a),1)[0]}function s(a){if(!r())return Us(new Ce("Not adding Promise because buffer limit was reached."));let c=a();return t.indexOf(c)===-1&&t.push(c),c.then(()=>n(c)).then(null,()=>n(c).then(null,()=>{})),c}function i(a){return new me((c,d)=>{let u=t.length;if(!u)return c(!0);let f=setTimeout(()=>{a&&a>0&&c(!1)},a);t.forEach(p=>{_t(p).then(()=>{--u||(clearTimeout(f),c(!0))},d)})})}return{$:t,add:s,drain:i}}function Kn(e){if(!e)return{};let t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};let r=t[6]||"",n=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:r,hash:n,relative:t[5]+r+n}}var Wl=["fatal","error","warning","log","info","debug"];function Kl(e){return e==="warn"?"warning":Wl.includes(e)?e:"log"}var qo=Rr(),fs={nowSeconds:()=>Date.now()/1e3};function Xl(){let{performance:e}=qo;if(!e||!e.now)return;let t=Date.now()-e.now();return{now:()=>e.now(),timeOrigin:t}}function Jl(){try{return ql(yc,"perf_hooks").performance}catch{return}}var Xn=Vl()?Jl():Xl(),Ea=Xn===void 0?fs:{nowSeconds:()=>(Xn.timeOrigin+Xn.now())/1e3},xn=fs.nowSeconds.bind(fs),gt=Ea.nowSeconds.bind(Ea),De=(()=>{let{performance:e}=qo;if(!e||!e.now)return;let t=3600*1e3,r=e.now(),n=Date.now(),s=e.timeOrigin?Math.abs(e.timeOrigin+r-n):t,i=s<t,a=e.timing&&e.timing.navigationStart,c=typeof a=="number"?Math.abs(a+r-n):t,d=c<t;return i||d?s<=c?e.timeOrigin:a:n})(),hs="baggage",zo="sentry-",Ql=/^sentry-/,ef=8192;function tf(e){if(!Xe(e)&&!Array.isArray(e))return;let t={};if(Array.isArray(e))t=e.reduce((n,s)=>{let i=Sa(s);return T(T({},n),i)},{});else{if(!e)return;t=Sa(e)}let r=Object.entries(t).reduce((n,[s,i])=>{if(s.match(Ql)){let a=s.slice(zo.length);n[a]=i}return n},{});if(Object.keys(r).length>0)return r}function ps(e){if(!e)return;let t=Object.entries(e).reduce((r,[n,s])=>(s&&(r[`${zo}${n}`]=s),r),{});return rf(t)}function Sa(e){return e.split(",").map(t=>t.split("=").map(r=>decodeURIComponent(r.trim()))).reduce((t,[r,n])=>(t[r]=n,t),{})}function rf(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((t,[r,n],s)=>{let i=`${encodeURIComponent(r)}=${encodeURIComponent(n)}`,a=s===0?i:`${t},${i}`;return a.length>ef?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.warn(`Not adding key: ${r} with val: ${n} to baggage header due to exceeding baggage size limits.`),t):a},"")}var nf=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function sf(e){if(!e)return;let t=e.match(nf);if(!t)return;let r;return t[3]==="1"?r=!0:t[3]==="0"&&(r=!1),{traceId:t[1],parentSampled:r,parentSpanId:t[2]}}function af(e,t){let r=sf(e),n=tf(t),{traceId:s,parentSpanId:i,parentSampled:a}=r||{},c={traceId:s||ue(),spanId:ue().substring(16),sampled:a};return i&&(c.parentSpanId=i),n&&(c.dsc=n),{traceparentData:r,dynamicSamplingContext:n,propagationContext:c}}function Zs(e=ue(),t=ue().substring(16),r){let n="";return r!==void 0&&(n=r?"-1":"-0"),`${e}-${t}${n}`}function Cr(e,t=[]){return[e,t]}function of(e,t){let[r,n]=e;return[r,[...n,t]]}function wa(e,t){let r=e[1];for(let n of r){let s=n[0].type;if(t(n,s))return!0}return!1}function ms(e,t){return(t||new TextEncoder).encode(e)}function cf(e,t){let[r,n]=e,s=JSON.stringify(r);function i(a){typeof s=="string"?s=typeof a=="string"?s+a:[ms(s,t),a]:s.push(typeof a=="string"?ms(a,t):a)}for(let a of n){let[c,d]=a;if(i(`
|
|
6
|
+
${JSON.stringify(c)}
|
|
7
|
+
`),typeof d=="string"||d instanceof Uint8Array)i(d);else{let u;try{u=JSON.stringify(d)}catch{u=JSON.stringify(He(d))}i(u)}}return typeof s=="string"?s:df(s)}function df(e){let t=e.reduce((s,i)=>s+i.length,0),r=new Uint8Array(t),n=0;for(let s of e)r.set(s,n),n+=s.length;return r}function uf(e,t){let r=typeof e.data=="string"?ms(e.data,t):e.data;return[Ke({type:"attachment",length:r.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),r]}var lf={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor"};function Ta(e){return lf[e]}function Go(e){if(!e||!e.sdk)return;let{name:t,version:r}=e.sdk;return{name:t,version:r}}function ff(e,t,r,n){let s=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return T(T(T({event_id:e.event_id,sent_at:new Date().toISOString()},t&&{sdk:t}),!!r&&n&&{dsn:bn(n)}),s&&{trace:Ke(T({},s))})}function hf(e,t,r){let n=[{type:"client_report"},{timestamp:xn(),discarded_events:e}];return Cr(t?{dsn:t}:{},[n])}function pf(e,t=Date.now()){let r=parseInt(`${e}`,10);if(!isNaN(r))return r*1e3;let n=Date.parse(`${e}`);return isNaN(n)?6e4:n-t}function mf(e,t){return e[t]||e.all||0}function _f(e,t,r=Date.now()){return mf(e,t)>r}function gf(e,{statusCode:t,headers:r},n=Date.now()){let s=T({},e),i=r&&r["x-sentry-rate-limits"],a=r&&r["retry-after"];if(i)for(let c of i.trim().split(",")){let[d,u]=c.split(":",2),f=parseInt(d,10),p=(isNaN(f)?60:f)*1e3;if(!u)s.all=n+p;else for(let g of u.split(";"))s[g]=n+p}else a?s.all=n+pf(a,n):t===429&&(s.all=n+60*1e3);return s}var $s="production";function Ls(){return Oo("globalEventProcessors",()=>[])}function yf(e){Ls().push(e)}function fn(e,t,r,n=0){return new me((s,i)=>{let a=e[n];if(t===null||typeof a!="function")s(t);else{let c=a(T({},t),r);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&a.id&&c===null&&N.log(`Event processor "${a.id}" dropped event`),Ps(c)?c.then(d=>fn(e,d,r,n+1).then(s)).then(null,i):fn(e,c,r,n+1).then(s).then(null,i)}})}function vf(e){let t=gt(),r={sid:ue(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>xf(r)};return e&&Ot(r,e),r}function Ot(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||gt(),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:ue()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{let r=e.timestamp-e.started;e.duration=r>=0?r:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}function bf(e,t){let r={};e.status==="ok"&&(r={status:"exited"}),Ot(e,r)}function xf(e){return Ke({sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did=="number"||typeof e.did=="string"?`${e.did}`:void 0,duration:e.duration,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}var Ef=100,kt=class{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=Ia()}static clone(e){let t=new kt;return e&&(t._breadcrumbs=[...e._breadcrumbs],t._tags=T({},e._tags),t._extra=T({},e._extra),t._contexts=T({},e._contexts),t._user=e._user,t._level=e._level,t._span=e._span,t._session=e._session,t._transactionName=e._transactionName,t._fingerprint=e._fingerprint,t._eventProcessors=[...e._eventProcessors],t._requestSession=e._requestSession,t._attachments=[...e._attachments],t._sdkProcessingMetadata=T({},e._sdkProcessingMetadata),t._propagationContext=T({},e._propagationContext)),t}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{},this._session&&Ot(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags=T(T({},this._tags),e),this._notifyScopeListeners(),this}setTag(e,t){return this._tags=q(T({},this._tags),{[e]:t}),this._notifyScopeListeners(),this}setExtras(e){return this._extra=T(T({},this._extra),e),this._notifyScopeListeners(),this}setExtra(e,t){return this._extra=q(T({},this._extra),{[e]:t}),this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return t===null?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){let e=this.getSpan();return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;if(typeof e=="function"){let t=e(this);return t instanceof kt?t:this}return e instanceof kt?(this._tags=T(T({},this._tags),e._tags),this._extra=T(T({},this._extra),e._extra),this._contexts=T(T({},this._contexts),e._contexts),e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),e._requestSession&&(this._requestSession=e._requestSession),e._propagationContext&&(this._propagationContext=e._propagationContext)):Pt(e)&&(e=e,this._tags=T(T({},this._tags),e.tags),this._extra=T(T({},this._extra),e.extra),this._contexts=T(T({},this._contexts),e.contexts),e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession),e.propagationContext&&(this._propagationContext=e.propagationContext)),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=Ia(),this}addBreadcrumb(e,t){let r=typeof t=="number"?t:Ef;if(r<=0)return this;let n=T({timestamp:xn()},e),s=this._breadcrumbs;return s.push(n),this._breadcrumbs=s.length>r?s.slice(-r):s,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(e,t={},r){if(this._extra&&Object.keys(this._extra).length&&(e.extra=T(T({},this._extra),e.extra)),this._tags&&Object.keys(this._tags).length&&(e.tags=T(T({},this._tags),e.tags)),this._user&&Object.keys(this._user).length&&(e.user=T(T({},this._user),e.user)),this._contexts&&Object.keys(this._contexts).length&&(e.contexts=T(T({},this._contexts),e.contexts)),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts=T({trace:this._span.getTraceContext()},e.contexts);let i=this._span.transaction;if(i){e.sdkProcessingMetadata=T({dynamicSamplingContext:i.getDynamicSamplingContext()},e.sdkProcessingMetadata);let a=i.name;a&&(e.tags=T({transaction:a},e.tags))}}this._applyFingerprint(e);let n=this._getBreadcrumbs(),s=[...e.breadcrumbs||[],...n];return e.breadcrumbs=s.length>0?s:void 0,e.sdkProcessingMetadata=q(T(T({},e.sdkProcessingMetadata),this._sdkProcessingMetadata),{propagationContext:this._propagationContext}),fn([...r||[],...Ls(),...this._eventProcessors],e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=T(T({},this._sdkProcessingMetadata),e),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}_getBreadcrumbs(){return this._breadcrumbs}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}_applyFingerprint(e){e.fingerprint=e.fingerprint?Ll(e.fingerprint):[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}};function Ia(){return{traceId:ue(),spanId:ue().substring(16)}}var Yo=4,Sf=100,Bs=class{constructor(e,t=new kt,r=Yo){this._version=r,this._stack=[{scope:t}],e&&this.bindClient(e)}isOlderThan(e){return this._version<e}bindClient(e){let t=this.getStackTop();t.client=e,e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){let e=kt.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return this.getStack().length<=1?!1:!!this.getStack().pop()}withScope(e){let t=this.pushScope();try{e(t)}finally{this.popScope()}}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,t){let r=this._lastEventId=t&&t.event_id?t.event_id:ue(),n=new Error("Sentry syntheticException");return this._withClient((s,i)=>{s.captureException(e,q(T({originalException:e,syntheticException:n},t),{event_id:r}),i)}),r}captureMessage(e,t,r){let n=this._lastEventId=r&&r.event_id?r.event_id:ue(),s=new Error(e);return this._withClient((i,a)=>{i.captureMessage(e,t,q(T({originalException:e,syntheticException:s},r),{event_id:n}),a)}),n}captureEvent(e,t){let r=t&&t.event_id?t.event_id:ue();return e.type||(this._lastEventId=r),this._withClient((n,s)=>{n.captureEvent(e,q(T({},t),{event_id:r}),s)}),r}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){let{scope:r,client:n}=this.getStackTop();if(!n)return;let{beforeBreadcrumb:s=null,maxBreadcrumbs:i=Sf}=n.getOptions&&n.getOptions()||{};if(i<=0)return;let a=xn(),c=T({timestamp:a},e),d=s?Uo(()=>s(c,t)):c;d!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",d,t),r.addBreadcrumb(d,i))}setUser(e){this.getScope().setUser(e)}setTags(e){this.getScope().setTags(e)}setExtras(e){this.getScope().setExtras(e)}setTag(e,t){this.getScope().setTag(e,t)}setExtra(e,t){this.getScope().setExtra(e,t)}setContext(e,t){this.getScope().setContext(e,t)}configureScope(e){let{scope:t,client:r}=this.getStackTop();r&&e(t)}run(e){let t=ja(this);try{e(this)}finally{ja(t)}}getIntegration(e){let t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){let r=this._callExtensionMethod("startTransaction",e,t);if((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&!r){let n=this.getClient();console.warn(n?`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
|
|
8
|
+
Sentry.addTracingExtensions();
|
|
9
|
+
Sentry.init({...});
|
|
10
|
+
`:"Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")}return r}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){let e=this.getStackTop().scope,t=e.getSession();t&&bf(t),this._sendSessionUpdate(),e.setSession()}startSession(e){let{scope:t,client:r}=this.getStackTop(),{release:n,environment:s=$s}=r&&r.getOptions()||{},{userAgent:i}=Q.navigator||{},a=vf(T(T({release:n,environment:s,user:t.getUser()},i&&{userAgent:i}),e)),c=t.getSession&&t.getSession();return c&&c.status==="ok"&&Ot(c,{status:"exited"}),this.endSession(),t.setSession(a),a}shouldSendDefaultPii(){let e=this.getClient(),t=e&&e.getOptions();return!!(t&&t.sendDefaultPii)}_sendSessionUpdate(){let{scope:e,client:t}=this.getStackTop(),r=e.getSession();r&&t&&t.captureSession&&t.captureSession(r)}_withClient(e){let{scope:t,client:r}=this.getStackTop();r&&e(r,t)}_callExtensionMethod(e,...t){let r=Dr().__SENTRY__;if(r&&r.extensions&&typeof r.extensions[e]=="function")return r.extensions[e].apply(this,t);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.warn(`Extension method ${e} couldn't be found, doing nothing.`)}};function Dr(){return Q.__SENTRY__=Q.__SENTRY__||{extensions:{},hub:void 0},Q}function ja(e){let t=Dr(),r=_s(t);return Fo(t,e),r}function ee(){let e=Dr();if(e.__SENTRY__&&e.__SENTRY__.acs){let t=e.__SENTRY__.acs.getCurrentHub();if(t)return t}return wf(e)}function wf(e=Dr()){return(!Tf(e)||_s(e).isOlderThan(Yo))&&Fo(e,new Bs),_s(e)}function Tf(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function _s(e){return Oo("hub",()=>new Bs,e)}function Fo(e,t){if(!e)return!1;let r=e.__SENTRY__=e.__SENTRY__||{};return r.hub=t,!0}function Ms(e){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let t=ee().getClient(),r=e||t&&t.getOptions();return!!r&&(r.enableTracing||"tracesSampleRate"in r||"tracesSampler"in r)}function Nr(e){return ee().getScope().getTransaction()}var Ra=!1;function If(){Ra||(Ra=!0,_e("error",gs),_e("unhandledrejection",gs))}function gs(){let e=Nr();if(e){let t="internal_error";(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log(`[Tracing] Transaction: ${t} -> Global error occured`),e.setStatus(t)}}gs.tag="sentry_tracingErrorCallback";var Ho=class{constructor(e=1e3){this._maxlen=e,this.spans=[]}add(e){this.spans.length>this._maxlen?e.spanRecorder=void 0:this.spans.push(e)}},Wo=class{constructor(e={}){this.traceId=e.traceId||ue(),this.spanId=e.spanId||ue().substring(16),this.startTimestamp=e.startTimestamp||gt(),this.tags=e.tags||{},this.data=e.data||{},this.instrumenter=e.instrumenter||"sentry",this.origin=e.origin||"manual",e.parentSpanId&&(this.parentSpanId=e.parentSpanId),"sampled"in e&&(this.sampled=e.sampled),e.op&&(this.op=e.op),e.description&&(this.description=e.description),e.name&&(this.description=e.name),e.status&&(this.status=e.status),e.endTimestamp&&(this.endTimestamp=e.endTimestamp)}get name(){return this.description||""}set name(e){this.setName(e)}startChild(e){let t=new Wo(q(T({},e),{parentSpanId:this.spanId,sampled:this.sampled,traceId:this.traceId}));if(t.spanRecorder=this.spanRecorder,t.spanRecorder&&t.spanRecorder.add(t),t.transaction=this.transaction,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&t.transaction){let r=e&&e.op||"< unknown op >",n=t.transaction.name||"< unknown name >",s=t.transaction.spanId,i=`[Tracing] Starting '${r}' span on transaction '${n}' (${s}).`;t.transaction.metadata.spanMetadata[t.spanId]={logMessage:i},N.log(i)}return t}setTag(e,t){return this.tags=q(T({},this.tags),{[e]:t}),this}setData(e,t){return this.data=q(T({},this.data),{[e]:t}),this}setStatus(e){return this.status=e,this}setHttpStatus(e){this.setTag("http.status_code",String(e)),this.setData("http.response.status_code",e);let t=jf(e);return t!=="unknown_error"&&this.setStatus(t),this}setName(e){this.description=e}isSuccess(){return this.status==="ok"}finish(e){if((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&this.transaction&&this.transaction.spanId!==this.spanId){let{logMessage:t}=this.transaction.metadata.spanMetadata[this.spanId];t&&N.log(t.replace("Starting","Finishing"))}this.endTimestamp=typeof e=="number"?e:gt()}toTraceparent(){return Zs(this.traceId,this.spanId,this.sampled)}toContext(){return Ke({data:this.data,description:this.description,endTimestamp:this.endTimestamp,op:this.op,parentSpanId:this.parentSpanId,sampled:this.sampled,spanId:this.spanId,startTimestamp:this.startTimestamp,status:this.status,tags:this.tags,traceId:this.traceId})}updateWithContext(e){return this.data=e.data||{},this.description=e.description,this.endTimestamp=e.endTimestamp,this.op=e.op,this.parentSpanId=e.parentSpanId,this.sampled=e.sampled,this.spanId=e.spanId||this.spanId,this.startTimestamp=e.startTimestamp||this.startTimestamp,this.status=e.status,this.tags=e.tags||{},this.traceId=e.traceId||this.traceId,this}getTraceContext(){return Ke({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,trace_id:this.traceId})}toJSON(){return Ke({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,start_timestamp:this.startTimestamp,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this.endTimestamp,trace_id:this.traceId,origin:this.origin})}};function jf(e){if(e<400&&e>=100)return"ok";if(e>=400&&e<500)switch(e){case 401:return"unauthenticated";case 403:return"permission_denied";case 404:return"not_found";case 409:return"already_exists";case 413:return"failed_precondition";case 429:return"resource_exhausted";default:return"invalid_argument"}if(e>=500&&e<600)switch(e){case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline_exceeded";default:return"internal_error"}return"unknown_error"}function En(e,t,r){let n=t.getOptions(),{publicKey:s}=t.getDsn()||{},{segment:i}=r&&r.getUser()||{},a=Ke({environment:n.environment||$s,release:n.release,user_segment:i,public_key:s,trace_id:e});return t.emit&&t.emit("createDsc",a),a}var Ko=class extends Wo{constructor(e,t){super(e),delete this.description,this._measurements={},this._contexts={},this._hub=t||ee(),this._name=e.name||"",this.metadata=q(T({source:"custom"},e.metadata),{spanMetadata:{}}),this._trimEnd=e.trimEnd,this.transaction=this;let r=this.metadata.dynamicSamplingContext;r&&(this._frozenDynamicSamplingContext=T({},r))}get name(){return this._name}set name(e){this.setName(e)}setName(e,t="custom"){this._name=e,this.metadata.source=t}initSpanRecorder(e=1e3){this.spanRecorder||(this.spanRecorder=new Ho(e)),this.spanRecorder.add(this)}setContext(e,t){t===null?delete this._contexts[e]:this._contexts[e]=t}setMeasurement(e,t,r=""){this._measurements[e]={value:t,unit:r}}setMetadata(e){this.metadata=T(T({},this.metadata),e)}finish(e){let t=this._finishTransaction(e);if(t)return this._hub.captureEvent(t)}toContext(){let e=super.toContext();return Ke(q(T({},e),{name:this.name,trimEnd:this._trimEnd}))}updateWithContext(e){return super.updateWithContext(e),this.name=e.name||"",this._trimEnd=e.trimEnd,this}getDynamicSamplingContext(){if(this._frozenDynamicSamplingContext)return this._frozenDynamicSamplingContext;let e=this._hub||ee(),t=e.getClient();if(!t)return{};let r=e.getScope(),n=En(this.traceId,t,r),s=this.metadata.sampleRate;s!==void 0&&(n.sample_rate=`${s}`);let i=this.metadata.source;return i&&i!=="url"&&(n.transaction=this.name),this.sampled!==void 0&&(n.sampled=String(this.sampled)),n}setHub(e){this._hub=e}_finishTransaction(e){if(this.endTimestamp!==void 0)return;this.name||((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this.name="<unlabeled transaction>"),super.finish(e);let t=this._hub.getClient();if(t&&t.emit&&t.emit("finishTransaction",this),this.sampled!==!0){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","transaction");return}let r=this.spanRecorder?this.spanRecorder.spans.filter(i=>i!==this&&i.endTimestamp):[];this._trimEnd&&r.length>0&&(this.endTimestamp=r.reduce((i,a)=>i.endTimestamp&&a.endTimestamp?i.endTimestamp>a.endTimestamp?i:a:i).endTimestamp);let n=this.metadata,s=T({contexts:q(T({},this._contexts),{trace:this.getTraceContext()}),spans:r,start_timestamp:this.startTimestamp,tags:this.tags,timestamp:this.endTimestamp,transaction:this.name,type:"transaction",sdkProcessingMetadata:q(T({},n),{dynamicSamplingContext:this.getDynamicSamplingContext()})},n.source&&{transaction_info:{source:n.source}});return Object.keys(this._measurements).length>0&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),s.measurements=this._measurements),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log(`[Tracing] Finishing ${this.op} transaction: ${this.name}.`),s}},on={idleTimeout:1e3,finalTimeout:3e4,heartbeatInterval:5e3},Rf="finishReason",It=["heartbeatFailed","idleTimeout","documentHidden","finalTimeout","externalFinish","cancelled"],Cf=class extends Ho{constructor(e,t,r,n){super(n),this._pushActivity=e,this._popActivity=t,this.transactionSpanId=r}add(e){e.spanId!==this.transactionSpanId&&(e.finish=t=>{e.endTimestamp=typeof t=="number"?t:gt(),this._popActivity(e.spanId)},e.endTimestamp===void 0&&this._pushActivity(e.spanId)),super.add(e)}},Df=class extends Ko{constructor(e,t,r=on.idleTimeout,n=on.finalTimeout,s=on.heartbeatInterval,i=!1){super(e,t),this._idleHub=t,this._idleTimeout=r,this._finalTimeout=n,this._heartbeatInterval=s,this._onScope=i,this.activities={},this._heartbeatCounter=0,this._finished=!1,this._idleTimeoutCanceledPermanently=!1,this._beforeFinishCallbacks=[],this._finishReason=It[4],i&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log(`Setting idle transaction on scope. Span ID: ${this.spanId}`),t.configureScope(a=>a.setSpan(this))),this._restartIdleTimeout(),setTimeout(()=>{this._finished||(this.setStatus("deadline_exceeded"),this._finishReason=It[3],this.finish())},this._finalTimeout)}finish(e=gt()){if(this._finished=!0,this.activities={},this.op==="ui.action.click"&&this.setTag(Rf,this._finishReason),this.spanRecorder){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log("[Tracing] finishing IdleTransaction",new Date(e*1e3).toISOString(),this.op);for(let t of this._beforeFinishCallbacks)t(this,e);this.spanRecorder.spans=this.spanRecorder.spans.filter(t=>{if(t.spanId===this.spanId)return!0;t.endTimestamp||(t.endTimestamp=e,t.setStatus("cancelled"),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(t,void 0,2)));let r=t.startTimestamp<e,n=(this._finalTimeout+this._idleTimeout)/1e3,s=t.endTimestamp-this.startTimestamp<n;if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){let i=JSON.stringify(t,void 0,2);r?s||N.log("[Tracing] discarding Span since it finished after Transaction final timeout",i):N.log("[Tracing] discarding Span since it happened after Transaction was finished",i)}return r&&s}),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log("[Tracing] flushing IdleTransaction")}else(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log("[Tracing] No active IdleTransaction");if(this._onScope){let t=this._idleHub.getScope();t.getTransaction()===this&&t.setSpan(void 0)}return super.finish(e)}registerBeforeFinishCallback(e){this._beforeFinishCallbacks.push(e)}initSpanRecorder(e){if(!this.spanRecorder){let t=n=>{this._finished||this._pushActivity(n)},r=n=>{this._finished||this._popActivity(n)};this.spanRecorder=new Cf(t,r,this.spanId,e),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log("Starting heartbeat"),this._pingHeartbeat()}this.spanRecorder.add(this)}cancelIdleTimeout(e,{restartOnChildSpanChange:t}={restartOnChildSpanChange:!0}){this._idleTimeoutCanceledPermanently=t===!1,this._idleTimeoutID&&(clearTimeout(this._idleTimeoutID),this._idleTimeoutID=void 0,Object.keys(this.activities).length===0&&this._idleTimeoutCanceledPermanently&&(this._finishReason=It[5],this.finish(e)))}setFinishReason(e){this._finishReason=e}_restartIdleTimeout(e){this.cancelIdleTimeout(),this._idleTimeoutID=setTimeout(()=>{!this._finished&&Object.keys(this.activities).length===0&&(this._finishReason=It[1],this.finish(e))},this._idleTimeout)}_pushActivity(e){this.cancelIdleTimeout(void 0,{restartOnChildSpanChange:!this._idleTimeoutCanceledPermanently}),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log(`[Tracing] pushActivity: ${e}`),this.activities[e]=!0,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log("[Tracing] new activities count",Object.keys(this.activities).length)}_popActivity(e){if(this.activities[e]&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log(`[Tracing] popActivity ${e}`),delete this.activities[e],(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log("[Tracing] new activities count",Object.keys(this.activities).length)),Object.keys(this.activities).length===0){let t=gt();this._idleTimeoutCanceledPermanently?(this._finishReason=It[5],this.finish(t)):this._restartIdleTimeout(t+this._idleTimeout/1e3)}}_beat(){if(this._finished)return;let e=Object.keys(this.activities).join("");e===this._prevHeartbeatString?this._heartbeatCounter++:this._heartbeatCounter=1,this._prevHeartbeatString=e,this._heartbeatCounter>=3?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus("deadline_exceeded"),this._finishReason=It[0],this.finish()):this._pingHeartbeat()}_pingHeartbeat(){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`),setTimeout(()=>{this._beat()},this._heartbeatInterval)}};function Nf(){let e=this.getScope().getSpan();return e?{"sentry-trace":e.toTraceparent()}:{}}function Xo(e,t,r){if(!Ms(t))return e.sampled=!1,e;if(e.sampled!==void 0)return e.setMetadata({sampleRate:Number(e.sampled)}),e;let n;return typeof t.tracesSampler=="function"?(n=t.tracesSampler(r),e.setMetadata({sampleRate:Number(n)})):r.parentSampled!==void 0?n=r.parentSampled:typeof t.tracesSampleRate<"u"?(n=t.tracesSampleRate,e.setMetadata({sampleRate:Number(n)})):(n=1,e.setMetadata({sampleRate:n})),kf(n)?n?(e.sampled=Math.random()<n,e.sampled?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log(`[Tracing] starting ${e.op} transaction - ${e.name}`),e):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(n)})`),e)):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log(`[Tracing] Discarding transaction because ${typeof t.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),e.sampled=!1,e):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.warn("[Tracing] Discarding transaction because of invalid sample rate."),e.sampled=!1,e)}function kf(e){return Po(e)||!(typeof e=="number"||typeof e=="boolean")?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(e)} of type ${JSON.stringify(typeof e)}.`),!1):e<0||e>1?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${e}.`),!1):!0}function Pf(e,t){let r=this.getClient(),n=r&&r.getOptions()||{},s=n.instrumenter||"sentry",i=e.instrumenter||"sentry";s!==i&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.error(`A transaction was started with instrumenter=\`${i}\`, but the SDK is configured with the \`${s}\` instrumenter.
|
|
11
|
+
The transaction will not be sampled. Please use the ${s} instrumentation to start transactions.`),e.sampled=!1);let a=new Ko(e,this);return a=Xo(a,n,T({parentSampled:e.parentSampled,transactionContext:e},t)),a.sampled&&a.initSpanRecorder(n._experiments&&n._experiments.maxSpans),r&&r.emit&&r.emit("startTransaction",a),a}function Ca(e,t,r,n,s,i,a){let c=e.getClient(),d=c&&c.getOptions()||{},u=new Df(t,e,r,n,a,s);return u=Xo(u,d,T({parentSampled:t.parentSampled,transactionContext:t},i)),u.sampled&&u.initSpanRecorder(d._experiments&&d._experiments.maxSpans),c&&c.emit&&c.emit("startTransaction",u),u}function Af(){let e=Dr();e.__SENTRY__&&(e.__SENTRY__.extensions=e.__SENTRY__.extensions||{},e.__SENTRY__.extensions.startTransaction||(e.__SENTRY__.extensions.startTransaction=Pf),e.__SENTRY__.extensions.traceHeaders||(e.__SENTRY__.extensions.traceHeaders=Nf),If())}function Of(e,t){return ee().captureException(e,{captureContext:t})}function Uf(e){ee().withScope(e)}var Zf="7";function $f(e){let t=e.protocol?`${e.protocol}:`:"",r=e.port?`:${e.port}`:"";return`${t}//${e.host}${r}${e.path?`/${e.path}`:""}/api/`}function Lf(e){return`${$f(e)}${e.projectId}/envelope/`}function Bf(e,t){return vl(T({sentry_key:e.publicKey,sentry_version:Zf},t&&{sentry_client:`${t.name}/${t.version}`}))}function Mf(e,t={}){let r=typeof t=="string"?t:t.tunnel,n=typeof t=="string"||!t._metadata?void 0:t._metadata.sdk;return r||`${Lf(e)}?${Bf(e,n)}`}function Vf(e,t){return t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=[...e.sdk.integrations||[],...t.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...t.packages||[]]),e}function qf(e,t,r,n){let s=Go(r),i=T(T({sent_at:new Date().toISOString()},s&&{sdk:s}),!!n&&t&&{dsn:bn(t)}),a="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return Cr(i,[a])}function zf(e,t,r,n){let s=Go(r),i=e.type&&e.type!=="replay_event"?e.type:"event";Vf(e,r&&r.sdk);let a=ff(e,s,n,t);return delete e.sdkProcessingMetadata,Cr(a,[[{type:i},e]])}var Da=[];function Gf(e,t){let r={};return t.forEach(n=>{n&&Jo(e,n,r)}),r}function Jo(e,t,r){if(r[t.name]=t,Da.indexOf(t.name)===-1&&(t.setupOnce(yf,ee),Da.push(t.name)),e.on&&typeof t.preprocessEvent=="function"){let n=t.preprocessEvent.bind(t);e.on("preprocessEvent",(s,i)=>n(s,i,e))}if(e.addEventProcessor&&typeof t.processEvent=="function"){let n=t.processEvent.bind(t),s=Object.assign((i,a)=>n(i,a,e),{id:t.name});e.addEventProcessor(s)}(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log(`Integration installed: ${t.name}`)}function Yf(e,t,r,n,s){let{normalizeDepth:i=3,normalizeMaxBreadth:a=1e3}=e,c=q(T({},t),{event_id:t.event_id||r.event_id||ue(),timestamp:t.timestamp||xn()}),d=r.integrations||e.integrations.map(g=>g.name);Ff(c,e),Kf(c,d),t.type===void 0&&Hf(c,e.stackParser);let u=n;r.captureContext&&(u=kt.clone(u).update(r.captureContext));let f=_t(c),p=s&&s.getEventProcessors?s.getEventProcessors():[];if(u){if(u.getAttachments){let g=[...r.attachments||[],...u.getAttachments()];g.length&&(r.attachments=g)}f=u.applyToEvent(c,r,p)}else f=fn([...p,...Ls()],c,r);return f.then(g=>(g&&Wf(g),typeof i=="number"&&i>0?Xf(g,i,a):g))}function Ff(e,t){let{environment:r,release:n,dist:s,maxValueLength:i=250}=t;"environment"in e||(e.environment="environment"in t?r:$s),e.release===void 0&&n!==void 0&&(e.release=n),e.dist===void 0&&s!==void 0&&(e.dist=s),e.message&&(e.message=Nt(e.message,i));let a=e.exception&&e.exception.values&&e.exception.values[0];a&&a.value&&(a.value=Nt(a.value,i));let c=e.request;c&&c.url&&(c.url=Nt(c.url,i))}var Na=new WeakMap;function Hf(e,t){let r=Q._sentryDebugIds;if(!r)return;let n,s=Na.get(t);s?n=s:(n=new Map,Na.set(t,n));let i=Object.keys(r).reduce((a,c)=>{let d,u=n.get(c);u?d=u:(d=t(c),n.set(c,d));for(let f=d.length-1;f>=0;f--){let p=d[f];if(p.filename){a[p.filename]=r[c];break}}return a},{});try{e.exception.values.forEach(a=>{a.stacktrace.frames.forEach(c=>{c.filename&&(c.debug_id=i[c.filename])})})}catch{}}function Wf(e){let t={};try{e.exception.values.forEach(n=>{n.stacktrace.frames.forEach(s=>{s.debug_id&&(s.abs_path?t[s.abs_path]=s.debug_id:s.filename&&(t[s.filename]=s.debug_id),delete s.debug_id)})})}catch{}if(Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];let r=e.debug_meta.images;Object.keys(t).forEach(n=>{r.push({type:"sourcemap",code_file:n,debug_id:t[n]})})}function Kf(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function Xf(e,t,r){if(!e)return null;let n=T(T(T(T(T({},e),e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(s=>T(T({},s),s.data&&{data:He(s.data,t,r)}))}),e.user&&{user:He(e.user,t,r)}),e.contexts&&{contexts:He(e.contexts,t,r)}),e.extra&&{extra:He(e.extra,t,r)});return e.contexts&&e.contexts.trace&&n.contexts&&(n.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(n.contexts.trace.data=He(e.contexts.trace.data,t,r))),e.spans&&(n.spans=e.spans.map(s=>(s.data&&(s.data=He(s.data,t,r)),s))),n}var ka="Not capturing exception because it's already been captured.",Jf=class{constructor(e){if(this._options=e,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=yl(e.dsn):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.warn("No DSN provided, client will not send events."),this._dsn){let t=Mf(this._dsn,e);this._transport=e.transport(q(T({recordDroppedEvent:this.recordDroppedEvent.bind(this)},e.transportOptions),{url:t}))}}captureException(e,t,r){if(xa(e)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log(ka);return}let n=t&&t.event_id;return this._process(this.eventFromException(e,t).then(s=>this._captureEvent(s,t,r)).then(s=>{n=s})),n}captureMessage(e,t,r,n){let s=r&&r.event_id,i=ko(e)?this.eventFromMessage(String(e),t,r):this.eventFromException(e,r);return this._process(i.then(a=>this._captureEvent(a,r,n)).then(a=>{s=a})),s}captureEvent(e,t,r){if(t&&t.originalException&&xa(t.originalException)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log(ka);return}let n=t&&t.event_id;return this._process(this._captureEvent(e,t,r).then(s=>{n=s})),n}captureSession(e){typeof e.release!="string"?(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),Ot(e,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){let t=this._transport;return t?this._isClientDoneProcessing(e).then(r=>t.flush(e).then(n=>r&&n)):_t(!0)}close(e){return this.flush(e).then(t=>(this.getOptions().enabled=!1,t))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}setupIntegrations(e){(e&&!this._integrationsInitialized||this._isEnabled()&&!this._integrationsInitialized)&&(this._integrations=Gf(this,this._options.integrations),this._integrationsInitialized=!0)}getIntegrationById(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){Jo(this,e,this._integrations)}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let r=zf(e,this._dsn,this._options._metadata,this._options.tunnel);for(let s of t.attachments||[])r=of(r,uf(s,this._options.transportOptions&&this._options.transportOptions.textEncoder));let n=this._sendEnvelope(r);n&&n.then(s=>this.emit("afterSendEvent",e,s),null)}sendSession(e){let t=qf(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}recordDroppedEvent(e,t,r){if(this._options.sendClientReports){let n=`${e}:${t}`;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log(`Adding outcome: "${n}"`),this._outcomes[n]=this._outcomes[n]+1||1}}on(e,t){this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(t)}emit(e,...t){this._hooks[e]&&this._hooks[e].forEach(r=>r(...t))}_updateSessionFromEvent(e,t){let r=!1,n=!1,s=t.exception&&t.exception.values;if(s){n=!0;for(let a of s){let c=a.mechanism;if(c&&c.handled===!1){r=!0;break}}}let i=e.status==="ok";(i&&e.errors===0||i&&r)&&(Ot(e,q(T({},r&&{status:"crashed"}),{errors:e.errors||Number(n||r)})),this.captureSession(e))}_isClientDoneProcessing(e){return new me(t=>{let r=0,n=1,s=setInterval(()=>{this._numProcessing==0?(clearInterval(s),t(!0)):(r+=n,e&&r>=e&&(clearInterval(s),t(!1)))},n)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,t,r){let n=this.getOptions(),s=Object.keys(this._integrations);return!t.integrations&&s.length>0&&(t.integrations=s),this.emit("preprocessEvent",e,t),Yf(n,e,t,r,this).then(i=>{if(i===null)return i;let{propagationContext:a}=i.sdkProcessingMetadata||{};if(!(i.contexts&&i.contexts.trace)&&a){let{traceId:c,spanId:d,parentSpanId:u,dsc:f}=a;i.contexts=T({trace:{trace_id:c,span_id:d,parent_span_id:u}},i.contexts);let p=f||En(c,this,r);i.sdkProcessingMetadata=T({dynamicSamplingContext:p},i.sdkProcessingMetadata)}return i})}_captureEvent(e,t={},r){return this._processEvent(e,t,r).then(n=>n.event_id,n=>{if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){let s=n;s.logLevel==="log"?N.log(s.message):N.warn(s)}})}_processEvent(e,t,r){let n=this.getOptions(),{sampleRate:s}=n,i=ec(e),a=Qo(e),c=e.type||"error",d=`before send for type \`${c}\``;if(a&&typeof s=="number"&&Math.random()>s)return this.recordDroppedEvent("sample_rate","error",e),Us(new Ce(`Discarding event because it's not included in the random sample (sampling rate = ${s})`,"log"));let u=c==="replay_event"?"replay":c;return this._prepareEvent(e,t,r).then(f=>{if(f===null)throw this.recordDroppedEvent("event_processor",u,e),new Ce("An event processor returned `null`, will not send event.","log");if(t.data&&t.data.__sentry__===!0)return f;let p=eh(n,f,t);return Qf(p,d)}).then(f=>{if(f===null)throw this.recordDroppedEvent("before_send",u,e),new Ce(`${d} returned \`null\`, will not send event.`,"log");let p=r&&r.getSession();!i&&p&&this._updateSessionFromEvent(p,f);let g=f.transaction_info;if(i&&g&&f.transaction!==e.transaction){let _="custom";f.transaction_info=q(T({},g),{source:_})}return this.sendEvent(f,t),f}).then(null,f=>{throw f instanceof Ce?f:(this.captureException(f,{data:{__sentry__:!0},originalException:f}),new Ce(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
12
|
+
Reason: ${f}`))})}_process(e){this._numProcessing++,e.then(t=>(this._numProcessing--,t),t=>(this._numProcessing--,t))}_sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)return this._transport.send(e).then(null,t=>{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.error("Error while sending event:",t)});(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.error("Transport disabled")}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.keys(e).map(t=>{let[r,n]=t.split(":");return{reason:r,category:n,quantity:e[t]}})}};function Qf(e,t){let r=`${t} must return \`null\` or a valid event.`;if(Ps(e))return e.then(n=>{if(!Pt(n)&&n!==null)throw new Ce(r);return n},n=>{throw new Ce(`${t} rejected with ${n}`)});if(!Pt(e)&&e!==null)throw new Ce(r);return e}function eh(e,t,r){let{beforeSend:n,beforeSendTransaction:s}=e;return Qo(t)&&n?n(t,r):ec(t)&&s?s(t,r):t}function Qo(e){return e.type===void 0}function ec(e){return e.type==="transaction"}var th=30;function tc(e,t,r=Hl(e.bufferSize||th)){let n={},s=a=>r.drain(a);function i(a){let c=[];if(wa(a,(p,g)=>{let _=Ta(g);if(_f(n,_)){let x=Pa(p,g);e.recordDroppedEvent("ratelimit_backoff",_,x)}else c.push(p)}),c.length===0)return _t();let d=Cr(a[0],c),u=p=>{wa(d,(g,_)=>{let x=Pa(g,_);e.recordDroppedEvent(p,Ta(_),x)})},f=()=>t({body:cf(d,e.textEncoder)}).then(p=>(p.statusCode!==void 0&&(p.statusCode<200||p.statusCode>=300)&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.warn(`Sentry responded with status code ${p.statusCode} to sent event.`),n=gf(n,p),p),p=>{throw u("network_error"),p});return r.add(f).then(p=>p,p=>{if(p instanceof Ce)return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.error("Skipped sending event because buffer is full."),u("queue_overflow"),_t();throw p})}return i.__sentry__baseTransport__=!0,{send:i,flush:s}}function Pa(e,t){if(!(t!=="event"&&t!=="transaction"))return Array.isArray(e)?e[1]:void 0}var Aa="7.73.0",rc={};jo(rc,{FunctionToString:()=>Vs,InboundFilters:()=>qs});var Oa,Vs=class{static __initStatic(){this.id="FunctionToString"}constructor(){this.name=Vs.id}setupOnce(){Oa=Function.prototype.toString;try{Function.prototype.toString=function(...e){let t=Os(this)||this;return Oa.apply(t,e)}}catch{}}};Vs.__initStatic();var rh=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],nh=[/^.*healthcheck.*$/,/^.*healthy.*$/,/^.*live.*$/,/^.*ready.*$/,/^.*heartbeat.*$/,/^.*\/health$/,/^.*\/healthz$/],qs=class{static __initStatic(){this.id="InboundFilters"}constructor(e={}){this.name=qs.id,this._options=e}setupOnce(e,t){}processEvent(e,t,r){let n=r.getOptions(),s=sh(this._options,n);return ih(e,s)?null:e}};qs.__initStatic();function sh(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:rh],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[],...e.disableTransactionDefaults?[]:nh],ignoreInternal:e.ignoreInternal!==void 0?e.ignoreInternal:!0}}function ih(e,t){return t.ignoreInternal&&lh(e)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.warn(`Event dropped due to being internal Sentry Error.
|
|
13
|
+
Event: ${We(e)}`),!0):ah(e,t.ignoreErrors)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
14
|
+
Event: ${We(e)}`),!0):oh(e,t.ignoreTransactions)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
15
|
+
Event: ${We(e)}`),!0):ch(e,t.denyUrls)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.warn(`Event dropped due to being matched by \`denyUrls\` option.
|
|
16
|
+
Event: ${We(e)}.
|
|
17
|
+
Url: ${hn(e)}`),!0):dh(e,t.allowUrls)?!1:((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
18
|
+
Event: ${We(e)}.
|
|
19
|
+
Url: ${hn(e)}`),!0)}function ah(e,t){return e.type||!t||!t.length?!1:uh(e).some(r=>jr(r,t))}function oh(e,t){if(e.type!=="transaction"||!t||!t.length)return!1;let r=e.transaction;return r?jr(r,t):!1}function ch(e,t){if(!t||!t.length)return!1;let r=hn(e);return r?jr(r,t):!1}function dh(e,t){if(!t||!t.length)return!0;let r=hn(e);return r?jr(r,t):!0}function uh(e){let t=[];e.message&&t.push(e.message);let r;try{r=e.exception.values[e.exception.values.length-1]}catch{}return r&&r.value&&(t.push(r.value),r.type&&t.push(`${r.type}: ${r.value}`)),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&t.length===0&&N.error(`Could not extract message for event ${We(e)}`),t}function lh(e){try{return e.exception.values[0].type==="SentryError"}catch{}return!1}function fh(e=[]){for(let t=e.length-1;t>=0;t--){let r=e[t];if(r&&r.filename!=="<anonymous>"&&r.filename!=="[native code]")return r.filename||null}return null}function hn(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch{}return t?fh(t):null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.error(`Cannot extract url for event ${We(e)}`),null}}var Y=Q,ys=0;function nc(){return ys>0}function hh(){ys++,setTimeout(()=>{ys--})}function Ut(e,t={},r){if(typeof e!="function")return e;try{let s=e.__sentry_wrapped__;if(s)return s;if(Os(e))return e}catch{return e}let n=function(){let s=Array.prototype.slice.call(arguments);try{r&&typeof r=="function"&&r.apply(this,arguments);let i=s.map(a=>Ut(a,t));return e.apply(this,i)}catch(i){throw hh(),Uf(a=>{a.addEventProcessor(c=>(t.mechanism&&(us(c,void 0),vr(c,t.mechanism)),c.extra=q(T({},c.extra),{arguments:s}),c)),Of(i)}),i}};try{for(let s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=e[s])}catch{}$o(n,e),As(e,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get(){return e.name}})}catch{}return n}function sc(e,t){let r=zs(e,t),n={type:t&&t.name,value:gh(t)};return r.length&&(n.stacktrace={frames:r}),n.type===void 0&&n.value===""&&(n.value="Unrecoverable error caught"),n}function ph(e,t,r,n){let s=ee().getClient(),i=s&&s.getOptions().normalizeDepth,a={exception:{values:[{type:vn(t)?t.constructor.name:n?"UnhandledRejection":"Error",value:bh(t,{isUnhandledRejection:n})}]},extra:{__serialized__:Vo(t,i)}};if(r){let c=zs(e,r);c.length&&(a.exception.values[0].stacktrace={frames:c})}return a}function Jn(e,t){return{exception:{values:[sc(e,t)]}}}function zs(e,t){let r=t.stacktrace||t.stack||"",n=_h(t);try{return e(r,n)}catch{}return[]}var mh=/Minified React error #\d+;/i;function _h(e){if(e){if(typeof e.framesToPop=="number")return e.framesToPop;if(mh.test(e.message))return 1}return 0}function gh(e){let t=e&&e.message;return t?t.error&&typeof t.error.message=="string"?t.error.message:t:"No error message"}function yh(e,t,r,n){let s=r&&r.syntheticException||void 0,i=Gs(e,t,s,n);return vr(i),i.level="error",r&&r.event_id&&(i.event_id=r.event_id),_t(i)}function vh(e,t,r="info",n,s){let i=n&&n.syntheticException||void 0,a=vs(e,t,i,s);return a.level=r,n&&n.event_id&&(a.event_id=n.event_id),_t(a)}function Gs(e,t,r,n,s){let i;if(ks(t)&&t.error)return Jn(e,t.error);if(ua(t)||tl(t)){let a=t;if("stack"in t)i=Jn(e,t);else{let c=a.name||(ua(a)?"DOMError":"DOMException"),d=a.message?`${c}: ${a.message}`:c;i=vs(e,d,r,n),us(i,d)}return"code"in a&&(i.tags=q(T({},i.tags),{"DOMException.code":`${a.code}`})),i}return No(t)?Jn(e,t):Pt(t)||vn(t)?(i=ph(e,t,r,s),vr(i,{synthetic:!0}),i):(i=vs(e,t,r,n),us(i,`${t}`),vr(i,{synthetic:!0}),i)}function vs(e,t,r,n){let s={message:t};if(n&&r){let i=zs(e,r);i.length&&(s.exception={values:[{value:t,stacktrace:{frames:i}}]})}return s}function bh(e,{isUnhandledRejection:t}){let r=bl(e),n=t?"promise rejection":"exception";return ks(e)?`Event \`ErrorEvent\` captured as ${n} with message \`${e.message}\``:vn(e)?`Event \`${xh(e)}\` (type=${e.type}) captured as ${n}`:`Object captured as ${n} with keys: ${r}`}function xh(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function Eh(e,{metadata:t,tunnel:r,dsn:n}){let s=T(T({event_id:e.event_id,sent_at:new Date().toISOString()},t&&t.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}}),!!r&&!!n&&{dsn:bn(n)}),i=Sh(e);return Cr(s,[i])}function Sh(e){return[{type:"user_report"},e]}var wh=class extends Jf{constructor(e){let t=Y.SENTRY_SDK_SOURCE||Ml();e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:`${t}:@sentry/browser`,version:Aa}],version:Aa},super(e),e.sendClientReports&&Y.document&&Y.document.addEventListener("visibilitychange",()=>{Y.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,t){return yh(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",r){return vh(this._options.stackParser,e,t,r,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled()){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.warn("SDK not enabled, will not capture user feedback.");return}let t=Eh(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(t)}_prepareEvent(e,t,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,r)}_flushOutcomes(){let e=this._clearOutcomes();if(e.length===0){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log("No outcomes to send");return}if(!this._dsn){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log("No dsn provided, will not send outcomes");return}(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log("Sending outcomes:",e);let t=hf(e,this._options.tunnel&&bn(this._dsn));this._sendEnvelope(t)}},_r;function Th(){if(_r)return _r;if(cs(Y.fetch))return _r=Y.fetch.bind(Y);let e=Y.document,t=Y.fetch;if(e&&typeof e.createElement=="function")try{let r=e.createElement("iframe");r.hidden=!0,e.head.appendChild(r);let n=r.contentWindow;n&&n.fetch&&(t=n.fetch),e.head.removeChild(r)}catch(r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return _r=t.bind(Y)}function Ih(){_r=void 0}function jh(e,t=Th()){let r=0,n=0;function s(i){let a=i.body.length;r+=a,n++;let c=T({body:i.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:r<=6e4&&n<15},e.fetchOptions);try{return t(e.url,c).then(d=>(r-=a,n--,{statusCode:d.status,headers:{"x-sentry-rate-limits":d.headers.get("X-Sentry-Rate-Limits"),"retry-after":d.headers.get("Retry-After")}}))}catch(d){return Ih(),r-=a,n--,Us(d)}}return tc(e,s)}var Rh=4;function Ch(e){function t(r){return new me((n,s)=>{let i=new XMLHttpRequest;i.onerror=s,i.onreadystatechange=()=>{i.readyState===Rh&&n({statusCode:i.status,headers:{"x-sentry-rate-limits":i.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":i.getResponseHeader("Retry-After")}})},i.open("POST",e.url);for(let a in e.headers)Object.prototype.hasOwnProperty.call(e.headers,a)&&i.setRequestHeader(a,e.headers[a]);i.send(r.body)})}return tc(e,t)}var Sn="?",Dh=30,Nh=40,kh=50;function Ys(e,t,r,n){let s={filename:e,function:t,in_app:!0};return r!==void 0&&(s.lineno=r),n!==void 0&&(s.colno=n),s}var Ph=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Ah=/\((\S*)(?::(\d+))(?::(\d+))\)/,Oh=e=>{let t=Ph.exec(e);if(t){if(t[2]&&t[2].indexOf("eval")===0){let s=Ah.exec(t[2]);s&&(t[2]=s[1],t[3]=s[2],t[4]=s[3])}let[r,n]=ic(t[1]||Sn,t[2]);return Ys(n,r,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}},Uh=[Dh,Oh],Zh=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,$h=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Lh=e=>{let t=Zh.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){let s=$h.exec(t[3]);s&&(t[1]=t[1]||"eval",t[3]=s[1],t[4]=s[2],t[5]="")}let r=t[3],n=t[1]||Sn;return[n,r]=ic(n,r),Ys(r,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},Bh=[kh,Lh],Mh=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Vh=e=>{let t=Mh.exec(e);return t?Ys(t[2],t[1]||Sn,+t[3],t[4]?+t[4]:void 0):void 0},qh=[Nh,Vh],zh=[Uh,Bh,qh],Gh=xl(...zh),ic=(e,t)=>{let r=e.indexOf("safari-extension")!==-1,n=e.indexOf("safari-web-extension")!==-1;return r||n?[e.indexOf("@")!==-1?e.split("@")[0]:Sn,r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},qt=class{static __initStatic(){this.id="GlobalHandlers"}constructor(e){this.name=qt.id,this._options=T({onerror:!0,onunhandledrejection:!0},e),this._installFunc={onerror:Yh,onunhandledrejection:Fh}}setupOnce(){Error.stackTraceLimit=50;let e=this._options;for(let t in e){let r=this._installFunc[t];r&&e[t]&&(Kh(t),r(),this._installFunc[t]=void 0)}}};qt.__initStatic();function Yh(){_e("error",e=>{let[t,r,n]=cc();if(!t.getIntegration(qt))return;let{msg:s,url:i,line:a,column:c,error:d}=e;if(nc()||d&&d.__sentry_own_request__)return;let u=d===void 0&&Xe(s)?Wh(s,i,a,c):ac(Gs(r,d||s,void 0,n,!1),i,a,c);u.level="error",oc(t,d,u,"onerror")})}function Fh(){_e("unhandledrejection",e=>{let[t,r,n]=cc();if(!t.getIntegration(qt))return;let s=e;try{"reason"in e?s=e.reason:"detail"in e&&"reason"in e.detail&&(s=e.detail.reason)}catch{}if(nc()||s&&s.__sentry_own_request__)return!0;let i=ko(s)?Hh(s):Gs(r,s,void 0,n,!0);i.level="error",oc(t,s,i,"onunhandledrejection")})}function Hh(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function Wh(e,t,r,n){let s=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,i=ks(e)?e.message:e,a="Error",c=i.match(s);return c&&(a=c[1],i=c[2]),ac({exception:{values:[{type:a,value:i}]}},t,r,n)}function ac(e,t,r,n){let s=e.exception=e.exception||{},i=s.values=s.values||[],a=i[0]=i[0]||{},c=a.stacktrace=a.stacktrace||{},d=c.frames=c.frames||[],u=isNaN(parseInt(n,10))?void 0:n,f=isNaN(parseInt(r,10))?void 0:r,p=Xe(t)&&t.length>0?t:ul();return d.length===0&&d.push({colno:u,filename:p,function:"?",in_app:!0,lineno:f}),e}function Kh(e){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log(`Global Handler attached: ${e}`)}function oc(e,t,r,n){vr(r,{handled:!1,type:n}),e.captureEvent(r,{originalException:t})}function cc(){let e=ee(),t=e.getClient(),r=t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[e,r.stackParser,r.attachStacktrace]}var Xh=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],Fs=class{static __initStatic(){this.id="TryCatch"}constructor(e){this.name=Fs.id,this._options=T({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},e)}setupOnce(){this._options.setTimeout&&ie(Y,"setTimeout",Ua),this._options.setInterval&&ie(Y,"setInterval",Ua),this._options.requestAnimationFrame&&ie(Y,"requestAnimationFrame",Jh),this._options.XMLHttpRequest&&"XMLHttpRequest"in Y&&ie(XMLHttpRequest.prototype,"send",Qh);let e=this._options.eventTarget;e&&(Array.isArray(e)?e:Xh).forEach(ep)}};Fs.__initStatic();function Ua(e){return function(...t){let r=t[0];return t[0]=Ut(r,{mechanism:{data:{function:Je(e)},handled:!1,type:"instrument"}}),e.apply(this,t)}}function Jh(e){return function(t){return e.apply(this,[Ut(t,{mechanism:{data:{function:"requestAnimationFrame",handler:Je(e)},handled:!1,type:"instrument"}})])}}function Qh(e){return function(...t){let r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(n=>{n in r&&typeof r[n]=="function"&&ie(r,n,function(s){let i={mechanism:{data:{function:n,handler:Je(s)},handled:!1,type:"instrument"}},a=Os(s);return a&&(i.mechanism.data.handler=Je(a)),Ut(s,i)})}),e.apply(this,t)}}function ep(e){let t=Y,r=t[e]&&t[e].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(ie(r,"addEventListener",function(n){return function(s,i,a){try{typeof i.handleEvent=="function"&&(i.handleEvent=Ut(i.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Je(i),target:e},handled:!1,type:"instrument"}}))}catch{}return n.apply(this,[s,Ut(i,{mechanism:{data:{function:"addEventListener",handler:Je(i),target:e},handled:!1,type:"instrument"}}),a])}}),ie(r,"removeEventListener",function(n){return function(s,i,a){let c=i;try{let d=c&&c.__sentry_wrapped__;d&&n.call(this,s,d,a)}catch{}return n.call(this,s,c,a)}}))}var Qr=1024,wn=class{static __initStatic(){this.id="Breadcrumbs"}constructor(e){this.name=wn.id,this.options=T({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},e)}setupOnce(){if(this.options.console&&_e("console",np),this.options.dom&&_e("dom",rp(this.options.dom)),this.options.xhr&&_e("xhr",sp),this.options.fetch&&_e("fetch",ip),this.options.history&&_e("history",ap),this.options.sentry){let e=ee().getClient();e&&e.on&&e.on("beforeSendEvent",tp)}}};wn.__initStatic();function tp(e){ee().addBreadcrumb({category:`sentry.${e.type==="transaction"?"transaction":"event"}`,event_id:e.event_id,level:e.level,message:We(e)},{event:e})}function rp(e){function t(r){let n,s=typeof e=="object"?e.serializeAttribute:void 0,i=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;i&&i>Qr&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.warn(`\`dom.maxStringLength\` cannot exceed ${Qr}, but a value of ${i} was configured. Sentry will use ${Qr} instead.`),i=Qr),typeof s=="string"&&(s=[s]);try{let a=r.event;n=op(a)?At(a.target,{keyAttrs:s,maxStringLength:i}):At(a,{keyAttrs:s,maxStringLength:i})}catch{n="<unknown>"}n.length!==0&&ee().addBreadcrumb({category:`ui.${r.name}`,message:n},{event:r.event,name:r.name,global:r.global})}return t}function np(e){let t={category:"console",data:{arguments:e.args,logger:"console"},level:Kl(e.level),message:la(e.args," ")};if(e.level==="assert")if(e.args[0]===!1)t.message=`Assertion failed: ${la(e.args.slice(1)," ")||"console.assert"}`,t.data.arguments=e.args.slice(1);else return;ee().addBreadcrumb(t,{input:e.args,level:e.level})}function sp(e){let{startTimestamp:t,endTimestamp:r}=e,n=e.xhr[Dt];if(!t||!r||!n)return;let{method:s,url:i,status_code:a,body:c}=n,d={method:s,url:i,status_code:a},u={xhr:e.xhr,input:c,startTimestamp:t,endTimestamp:r};ee().addBreadcrumb({category:"xhr",data:d,type:"http"},u)}function ip(e){let{startTimestamp:t,endTimestamp:r}=e;if(r&&!(e.fetchData.url.match(/sentry_key/)&&e.fetchData.method==="POST"))if(e.error){let n=e.fetchData,s={data:e.error,input:e.args,startTimestamp:t,endTimestamp:r};ee().addBreadcrumb({category:"fetch",data:n,level:"error",type:"http"},s)}else{let n=q(T({},e.fetchData),{status_code:e.response&&e.response.status}),s={input:e.args,response:e.response,startTimestamp:t,endTimestamp:r};ee().addBreadcrumb({category:"fetch",data:n,type:"http"},s)}}function ap(e){let t=e.from,r=e.to,n=Kn(Y.location.href),s=Kn(t),i=Kn(r);s.path||(s=n),n.protocol===i.protocol&&n.host===i.host&&(r=i.relative),n.protocol===s.protocol&&n.host===s.host&&(t=s.relative),ee().addBreadcrumb({category:"navigation",data:{from:t,to:r}})}function op(e){return!!e&&!!e.target}var cp="cause",dp=5,Tn=class{static __initStatic(){this.id="LinkedErrors"}constructor(e={}){this.name=Tn.id,this._key=e.key||cp,this._limit=e.limit||dp}setupOnce(){}preprocessEvent(e,t,r){let n=r.getOptions();al(sc,n.stackParser,n.maxValueLength,this._key,this._limit,e,t)}};Tn.__initStatic();var In=class{static __initStatic(){this.id="HttpContext"}constructor(){this.name=In.id}setupOnce(){}preprocessEvent(e){if(!Y.navigator&&!Y.location&&!Y.document)return;let t=e.request&&e.request.url||Y.location&&Y.location.href,{referrer:r}=Y.document||{},{userAgent:n}=Y.navigator||{},s=T(T(T({},e.request&&e.request.headers),r&&{Referer:r}),n&&{"User-Agent":n}),i=q(T(T({},e.request),t&&{url:t}),{headers:s});e.request=i}};In.__initStatic();var jn=class{static __initStatic(){this.id="Dedupe"}constructor(){this.name=jn.id}setupOnce(e,t){}processEvent(e){if(e.type)return e;try{if(up(e,this._previousEvent))return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return this._previousEvent=e}};jn.__initStatic();function up(e,t){return t?!!(lp(e,t)||fp(e,t)):!1}function lp(e,t){let r=e.message,n=t.message;return!(!r&&!n||r&&!n||!r&&n||r!==n||!uc(e,t)||!dc(e,t))}function fp(e,t){let r=Za(t),n=Za(e);return!(!r||!n||r.type!==n.type||r.value!==n.value||!uc(e,t)||!dc(e,t))}function dc(e,t){let r=$a(e),n=$a(t);if(!r&&!n)return!0;if(r&&!n||!r&&n||(r=r,n=n,n.length!==r.length))return!1;for(let s=0;s<n.length;s++){let i=n[s],a=r[s];if(i.filename!==a.filename||i.lineno!==a.lineno||i.colno!==a.colno||i.function!==a.function)return!1}return!0}function uc(e,t){let r=e.fingerprint,n=t.fingerprint;if(!r&&!n)return!0;if(r&&!n||!r&&n)return!1;r=r,n=n;try{return r.join("")===n.join("")}catch{return!1}}function Za(e){return e.exception&&e.exception.values&&e.exception.values[0]}function $a(e){let t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch{return}}var lc={};jo(lc,{Breadcrumbs:()=>wn,Dedupe:()=>jn,GlobalHandlers:()=>qt,HttpContext:()=>In,LinkedErrors:()=>Tn,TryCatch:()=>Fs});var G=Q;function hp(){G&&G.document?G.document.addEventListener("visibilitychange",()=>{let e=Nr();if(G.document.hidden&&e){let t="cancelled";(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log(`[Tracing] Transaction: ${t} -> since tab moved to the background, op: ${e.op}`),e.status||e.setStatus(t),e.setTag("visibilitychange","document.hidden"),e.finish()}}):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.warn("[Tracing] Could not set up background tab detection due to lack of global document")}var Hs=(e,t,r)=>{let n,s;return i=>{t.value>=0&&(i||r)&&(s=t.value-(n||0),(s||n===void 0)&&(n=t.value,t.delta=s,e(t)))}},pp=()=>`v3-${Date.now()}-${Math.floor(Math.random()*8999999999999)+1e12}`,mp=()=>{let e=G.performance.timing,t=G.performance.navigation.type,r={entryType:"navigation",startTime:0,type:t==2?"back_forward":t===1?"reload":"navigate"};for(let n in e)n!=="navigationStart"&&n!=="toJSON"&&(r[n]=Math.max(e[n]-e.navigationStart,0));return r},fc=()=>G.__WEB_VITALS_POLYFILL__?G.performance&&(performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]||mp()):G.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0],hc=()=>{let e=fc();return e&&e.activationStart||0},Ws=(e,t)=>{let r=fc(),n="navigate";return r&&(G.document.prerendering||hc()>0?n="prerender":n=r.type.replace(/_/g,"-")),{name:e,value:typeof t>"u"?-1:t,rating:"good",delta:0,entries:[],id:pp(),navigationType:n}},kr=(e,t,r)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let n=new PerformanceObserver(s=>{t(s.getEntries())});return n.observe(Object.assign({type:e,buffered:!0},r||{})),n}}catch{}},Rn=(e,t)=>{let r=n=>{(n.type==="pagehide"||G.document.visibilityState==="hidden")&&(e(n),t&&(removeEventListener("visibilitychange",r,!0),removeEventListener("pagehide",r,!0)))};addEventListener("visibilitychange",r,!0),addEventListener("pagehide",r,!0)},_p=e=>{let t=Ws("CLS",0),r,n=0,s=[],i=c=>{c.forEach(d=>{if(!d.hadRecentInput){let u=s[0],f=s[s.length-1];n&&s.length!==0&&d.startTime-f.startTime<1e3&&d.startTime-u.startTime<5e3?(n+=d.value,s.push(d)):(n=d.value,s=[d]),n>t.value&&(t.value=n,t.entries=s,r&&r())}})},a=kr("layout-shift",i);if(a){r=Hs(e,t);let c=()=>{i(a.takeRecords()),r(!0)};return Rn(c),c}},cn=-1,gp=()=>G.document.visibilityState==="hidden"&&!G.document.prerendering?0:1/0,yp=()=>{Rn(({timeStamp:e})=>{cn=e},!0)},Ks=()=>(cn<0&&(cn=gp(),yp()),{get firstHiddenTime(){return cn}}),vp=e=>{let t=Ks(),r=Ws("FID"),n,s=c=>{c.startTime<t.firstHiddenTime&&(r.value=c.processingStart-c.startTime,r.entries.push(c),n(!0))},i=c=>{c.forEach(s)},a=kr("first-input",i);n=Hs(e,r),a&&Rn(()=>{i(a.takeRecords()),a.disconnect()},!0)},La={},bp=e=>{let t=Ks(),r=Ws("LCP"),n,s=a=>{let c=a[a.length-1];if(c){let d=Math.max(c.startTime-hc(),0);d<t.firstHiddenTime&&(r.value=d,r.entries=[c],n())}},i=kr("largest-contentful-paint",s);if(i){n=Hs(e,r);let a=()=>{La[r.id]||(s(i.takeRecords()),i.disconnect(),La[r.id]=!0,n(!0))};return["keydown","click"].forEach(c=>{addEventListener(c,a,{once:!0,capture:!0})}),Rn(a,!0),a}};function Qn(e){return typeof e=="number"&&isFinite(e)}function Zt(e,t){var r=t,{startTimestamp:n}=r,s=Ju(r,["startTimestamp"]);return n&&e.startTimestamp>n&&(e.startTimestamp=n),e.startChild(T({startTimestamp:n},s))}function J(e){return e/1e3}function pc(){return G&&G.addEventListener&&G.performance}var Ba=0,W={},Re,yr;function xp(){let e=pc();if(e&&De){e.mark&&G.performance.mark("sentry-tracing-init"),Ip();let t=wp(),r=Tp();return()=>{t&&t(),r&&r()}}return()=>{}}function Ep(){kr("longtask",e=>{for(let t of e){let r=Nr();if(!r)return;let n=J(De+t.startTime),s=J(t.duration);r.startChild({description:"Main UI thread blocked",op:"ui.long-task",origin:"auto.ui.browser.metrics",startTimestamp:n,endTimestamp:n+s})}})}function Sp(){kr("event",e=>{for(let t of e){let r=Nr();if(!r)return;if(t.name==="click"){let n=J(De+t.startTime),s=J(t.duration);r.startChild({description:At(t.target),op:`ui.interaction.${t.name}`,origin:"auto.ui.browser.metrics",startTimestamp:n,endTimestamp:n+s})}}},{durationThreshold:0})}function wp(){return _p(e=>{let t=e.entries.pop();t&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log("[Measurements] Adding CLS"),W.cls={value:e.value,unit:""},yr=t)})}function Tp(){return bp(e=>{let t=e.entries.pop();t&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log("[Measurements] Adding LCP"),W.lcp={value:e.value,unit:"millisecond"},Re=t)})}function Ip(){vp(e=>{let t=e.entries.pop();if(!t)return;let r=J(De),n=J(t.startTime);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log("[Measurements] Adding FID"),W.fid={value:e.value,unit:"millisecond"},W["mark.fid"]={value:r+n,unit:"second"}})}function jp(e){let t=pc();if(!t||!G.performance.getEntries||!De)return;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log("[Tracing] Adding & adjusting spans using Performance API");let r=J(De),n=t.getEntries(),s,i;if(n.slice(Ba).forEach(a=>{let c=J(a.startTime),d=J(a.duration);if(!(e.op==="navigation"&&r+c<e.startTimestamp))switch(a.entryType){case"navigation":{Cp(e,a,r),s=r+J(a.responseStart),i=r+J(a.requestStart);break}case"mark":case"paint":case"measure":{Rp(e,a,c,d,r);let u=Ks(),f=a.startTime<u.firstHiddenTime;a.name==="first-paint"&&f&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log("[Measurements] Adding FP"),W.fp={value:a.startTime,unit:"millisecond"}),a.name==="first-contentful-paint"&&f&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log("[Measurements] Adding FCP"),W.fcp={value:a.startTime,unit:"millisecond"});break}case"resource":{let u=a.name.replace(G.location.origin,"");Np(e,a,u,c,d,r);break}}}),Ba=Math.max(n.length-1,0),kp(e),e.op==="pageload"){typeof s=="number"&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log("[Measurements] Adding TTFB"),W.ttfb={value:(s-e.startTimestamp)*1e3,unit:"millisecond"},typeof i=="number"&&i<=s&&(W["ttfb.requestTime"]={value:(s-i)*1e3,unit:"millisecond"})),["fcp","fp","lcp"].forEach(c=>{if(!W[c]||r>=e.startTimestamp)return;let d=W[c].value,u=r+J(d),f=Math.abs((u-e.startTimestamp)*1e3),p=f-d;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log(`[Measurements] Normalized ${c} from ${d} to ${f} (${p})`),W[c].value=f});let a=W["mark.fid"];a&&W.fid&&(Zt(e,{description:"first input delay",endTimestamp:a.value+J(W.fid.value),op:"ui.action",origin:"auto.ui.browser.metrics",startTimestamp:a.value}),delete W["mark.fid"]),"fcp"in W||delete W.cls,Object.keys(W).forEach(c=>{e.setMeasurement(c,W[c].value,W[c].unit)}),Pp(e)}Re=void 0,yr=void 0,W={}}function Rp(e,t,r,n,s){let i=s+r,a=i+n;return Zt(e,{description:t.name,endTimestamp:a,op:t.entryType,origin:"auto.resource.browser.metrics",startTimestamp:i}),i}function Cp(e,t,r){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(n=>{en(e,t,n,r)}),en(e,t,"secureConnection",r,"TLS/SSL","connectEnd"),en(e,t,"fetch",r,"cache","domainLookupStart"),en(e,t,"domainLookup",r,"DNS"),Dp(e,t,r)}function en(e,t,r,n,s,i){let a=i?t[i]:t[`${r}End`],c=t[`${r}Start`];!c||!a||Zt(e,{op:"browser",origin:"auto.browser.browser.metrics",description:s||r,startTimestamp:n+J(c),endTimestamp:n+J(a)})}function Dp(e,t,r){Zt(e,{op:"browser",origin:"auto.browser.browser.metrics",description:"request",startTimestamp:r+J(t.requestStart),endTimestamp:r+J(t.responseEnd)}),Zt(e,{op:"browser",origin:"auto.browser.browser.metrics",description:"response",startTimestamp:r+J(t.responseStart),endTimestamp:r+J(t.responseEnd)})}function Np(e,t,r,n,s,i){if(t.initiatorType==="xmlhttprequest"||t.initiatorType==="fetch")return;let a={};"transferSize"in t&&(a["http.response_transfer_size"]=t.transferSize),"encodedBodySize"in t&&(a["http.response_content_length"]=t.encodedBodySize),"decodedBodySize"in t&&(a["http.decoded_response_content_length"]=t.decodedBodySize),"renderBlockingStatus"in t&&(a["resource.render_blocking_status"]=t.renderBlockingStatus);let c=i+n,d=c+s;Zt(e,{description:r,endTimestamp:d,op:t.initiatorType?`resource.${t.initiatorType}`:"resource.other",origin:"auto.resource.browser.metrics",startTimestamp:c,data:a})}function kp(e){let t=G.navigator;if(!t)return;let r=t.connection;r&&(r.effectiveType&&e.setTag("effectiveConnectionType",r.effectiveType),r.type&&e.setTag("connectionType",r.type),Qn(r.rtt)&&(W["connection.rtt"]={value:r.rtt,unit:"millisecond"})),Qn(t.deviceMemory)&&e.setTag("deviceMemory",`${t.deviceMemory} GB`),Qn(t.hardwareConcurrency)&&e.setTag("hardwareConcurrency",String(t.hardwareConcurrency))}function Pp(e){Re&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log("[Measurements] Adding LCP Data"),Re.element&&e.setTag("lcp.element",At(Re.element)),Re.id&&e.setTag("lcp.id",Re.id),Re.url&&e.setTag("lcp.url",Re.url.trim().slice(0,200)),e.setTag("lcp.size",Re.size)),yr&&yr.sources&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log("[Measurements] Adding CLS Data"),yr.sources.forEach((t,r)=>e.setTag(`cls.source.${r+1}`,At(t.node))))}var bs=["localhost",/^\/(?!\/)/],xs={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,tracingOrigins:bs,tracePropagationTargets:bs};function Ap(e){let{traceFetch:t,traceXHR:r,tracePropagationTargets:n,tracingOrigins:s,shouldCreateSpanForRequest:i,enableHTTPTimings:a}=T({traceFetch:xs.traceFetch,traceXHR:xs.traceXHR},e),c=typeof i=="function"?i:f=>!0,d=f=>$p(f,n||s),u={};t&&_e("fetch",f=>{let p=Lp(f,c,d,u);a&&p&&Ma(p)}),r&&_e("xhr",f=>{let p=Mp(f,c,d,u);a&&p&&Ma(p)})}function Op(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function Ma(e){let t=e.data.url,r=new PerformanceObserver(n=>{n.getEntries().forEach(s=>{Op(s)&&s.name.endsWith(t)&&(Zp(s).forEach(i=>e.setData(...i)),r.disconnect())})});r.observe({entryTypes:["resource"]})}function Up(e){let t="unknown",r="unknown",n="";for(let s of e){if(s==="/"){[t,r]=e.split("/");break}if(!isNaN(Number(s))){t=n==="h"?"http":n,r=e.split(n)[1];break}n+=s}return n===e&&(t=n),{name:t,version:r}}function je(e=0){return((De||performance.timeOrigin)+e)/1e3}function Zp(e){let{name:t,version:r}=Up(e.nextHopProtocol),n=[];return n.push(["network.protocol.version",r],["network.protocol.name",t]),De?[...n,["http.request.redirect_start",je(e.redirectStart)],["http.request.fetch_start",je(e.fetchStart)],["http.request.domain_lookup_start",je(e.domainLookupStart)],["http.request.domain_lookup_end",je(e.domainLookupEnd)],["http.request.connect_start",je(e.connectStart)],["http.request.secure_connection_start",je(e.secureConnectionStart)],["http.request.connection_end",je(e.connectEnd)],["http.request.request_start",je(e.requestStart)],["http.request.response_start",je(e.responseStart)],["http.request.response_end",je(e.responseEnd)]]:n}function $p(e,t){return jr(e,t||bs)}function Lp(e,t,r,n){if(!Ms()||!e.fetchData)return;let s=t(e.fetchData.url);if(e.endTimestamp&&s){let g=e.fetchData.__span;if(!g)return;let _=n[g];if(_){if(e.response){_.setHttpStatus(e.response.status);let x=e.response&&e.response.headers&&e.response.headers.get("content-length"),S=parseInt(x);S>0&&_.setData("http.response_content_length",S)}else e.error&&_.setStatus("internal_error");_.finish(),delete n[g]}return}let i=ee(),a=i.getScope(),c=i.getClient(),d=a.getSpan(),{method:u,url:f}=e.fetchData,p=s&&d?d.startChild({data:{url:f,type:"fetch","http.method":u},description:`${u} ${f}`,op:"http.client",origin:"auto.http.browser"}):void 0;if(p&&(e.fetchData.__span=p.spanId,n[p.spanId]=p),r(e.fetchData.url)&&c){let g=e.args[0];e.args[1]=e.args[1]||{};let _=e.args[1];_.headers=Bp(g,c,a,_,p)}return p}function Bp(e,t,r,n,s){let i=s||r.getSpan(),a=i&&i.transaction,{traceId:c,sampled:d,dsc:u}=r.getPropagationContext(),f=i?i.toTraceparent():Zs(c,void 0,d),p=a?a.getDynamicSamplingContext():u||En(c,t,r),g=ps(p),_=typeof Request<"u"&&Me(e,Request)?e.headers:n.headers;if(_)if(typeof Headers<"u"&&Me(_,Headers)){let x=new Headers(_);return x.append("sentry-trace",f),g&&x.append(hs,g),x}else if(Array.isArray(_)){let x=[..._,["sentry-trace",f]];return g&&x.push([hs,g]),x}else{let x="baggage"in _?_.baggage:void 0,S=[];return Array.isArray(x)?S.push(...x):x&&S.push(x),g&&S.push(g),q(T({},_),{"sentry-trace":f,baggage:S.length>0?S.join(","):void 0})}else return{"sentry-trace":f,baggage:g}}function Mp(e,t,r,n){let s=e.xhr,i=s&&s[Dt];if(!Ms()||s&&s.__sentry_own_request__||!s||!i)return;let a=t(i.url);if(e.endTimestamp&&a){let p=s.__sentry_xhr_span_id__;if(!p)return;let g=n[p];g&&(g.setHttpStatus(i.status_code),g.finish(),delete n[p]);return}let c=ee(),d=c.getScope(),u=d.getSpan(),f=a&&u?u.startChild({data:q(T({},i.data),{type:"xhr","http.method":i.method,url:i.url}),description:`${i.method} ${i.url}`,op:"http.client",origin:"auto.http.browser"}):void 0;if(f&&(s.__sentry_xhr_span_id__=f.spanId,n[s.__sentry_xhr_span_id__]=f),s.setRequestHeader&&r(i.url))if(f){let p=f&&f.transaction,g=p&&p.getDynamicSamplingContext(),_=ps(g);Va(s,f.toTraceparent(),_)}else{let p=c.getClient(),{traceId:g,sampled:_,dsc:x}=d.getPropagationContext(),S=Zs(g,void 0,_),I=x||(p?En(g,p,d):void 0),D=ps(I);Va(s,S,D)}return f}function Va(e,t,r){try{e.setRequestHeader("sentry-trace",t),r&&e.setRequestHeader(hs,r)}catch{}}function Vp(e,t=!0,r=!0){if(!G||!G.location){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.warn("Could not initialize routing instrumentation due to invalid location");return}let n=G.location.href,s;t&&(s=e({name:G.location.pathname,startTimestamp:De?De/1e3:void 0,op:"pageload",origin:"auto.pageload.browser",metadata:{source:"url"}})),r&&_e("history",({to:i,from:a})=>{if(a===void 0&&n&&n.indexOf(i)!==-1){n=void 0;return}a!==i&&(n=void 0,s&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log(`[Tracing] Finishing current transaction with op: ${s.op}`),s.finish()),s=e({name:G.location.pathname,op:"navigation",origin:"auto.navigation.browser",metadata:{source:"url"}}))})}var qp="BrowserTracing",zp=T(q(T({},on),{markBackgroundTransactions:!0,routingInstrumentation:Vp,startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0,enableLongTask:!0,_experiments:{}}),xs),Gp=class{constructor(e){this.name=qp,this._hasSetTracePropagationTargets=!1,Af(),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&(this._hasSetTracePropagationTargets=!!(e&&(e.tracePropagationTargets||e.tracingOrigins))),this.options=T(T({},zp),e),this.options._experiments.enableLongTask!==void 0&&(this.options.enableLongTask=this.options._experiments.enableLongTask),e&&!e.tracePropagationTargets&&e.tracingOrigins&&(this.options.tracePropagationTargets=e.tracingOrigins),this._collectWebVitals=xp(),this.options.enableLongTask&&Ep(),this.options._experiments.enableInteractions&&Sp()}setupOnce(e,t){this._getCurrentHub=t;let r=t().getClient(),n=r&&r.getOptions(),{routingInstrumentation:s,startTransactionOnLocationChange:i,startTransactionOnPageLoad:a,markBackgroundTransactions:c,traceFetch:d,traceXHR:u,shouldCreateSpanForRequest:f,enableHTTPTimings:p,_experiments:g}=this.options,_=n&&n.tracePropagationTargets,x=_||this.options.tracePropagationTargets;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&this._hasSetTracePropagationTargets&&_&&N.warn("[Tracing] The `tracePropagationTargets` option was set in the BrowserTracing integration and top level `Sentry.init`. The top level `Sentry.init` value is being used."),s(S=>{let I=this._createRouteTransaction(S);return this.options._experiments.onStartRouteTransaction&&this.options._experiments.onStartRouteTransaction(I,S,t),I},a,i),c&&hp(),g.enableInteractions&&this._registerInteractionListener(),Ap({traceFetch:d,traceXHR:u,tracePropagationTargets:x,shouldCreateSpanForRequest:f,enableHTTPTimings:p})}_createRouteTransaction(e){if(!this._getCurrentHub){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.warn(`[Tracing] Did not create ${e.op} transaction because _getCurrentHub is invalid.`);return}let t=this._getCurrentHub(),{beforeNavigate:r,idleTimeout:n,finalTimeout:s,heartbeatInterval:i}=this.options,a=e.op==="pageload",c=a?qa("sentry-trace"):"",d=a?qa("baggage"):"",{traceparentData:u,dynamicSamplingContext:f,propagationContext:p}=af(c,d),g=q(T(T({},e),u),{metadata:q(T({},e.metadata),{dynamicSamplingContext:u&&!f?{}:f}),trimEnd:!0}),_=typeof r=="function"?r(g):g,x=_===void 0?q(T({},g),{sampled:!1}):_;x.metadata=x.name!==g.name?q(T({},x.metadata),{source:"custom"}):x.metadata,this._latestRouteName=x.name,this._latestRouteSource=x.metadata&&x.metadata.source,x.sampled===!1&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log(`[Tracing] Will not send ${x.op} transaction because of beforeNavigate.`),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.log(`[Tracing] Starting ${x.op} transaction on scope`);let{location:S}=G,I=Ca(t,x,n,s,!0,{location:S},i),D=t.getScope();return a&&u?D.setPropagationContext(p):D.setPropagationContext({traceId:I.traceId,spanId:I.spanId,parentSpanId:I.parentSpanId,sampled:I.sampled}),I.registerBeforeFinishCallback(k=>{this._collectWebVitals(),jp(k)}),I}_registerInteractionListener(){let e,t=()=>{let{idleTimeout:r,finalTimeout:n,heartbeatInterval:s}=this.options,i="ui.action.click",a=Nr();if(a&&a.op&&["navigation","pageload"].includes(a.op)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.warn(`[Tracing] Did not create ${i} transaction because a pageload or navigation transaction is in progress.`);return}if(e&&(e.setFinishReason("interactionInterrupted"),e.finish(),e=void 0),!this._getCurrentHub){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.warn(`[Tracing] Did not create ${i} transaction because _getCurrentHub is invalid.`);return}if(!this._latestRouteName){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&N.warn(`[Tracing] Did not create ${i} transaction because _latestRouteName is missing.`);return}let c=this._getCurrentHub(),{location:d}=G,u={name:this._latestRouteName,op:i,trimEnd:!0,metadata:{source:this._latestRouteSource||"url"}};e=Ca(c,u,r,n,!0,{location:d},s)};["click"].forEach(r=>{addEventListener(r,t,{once:!1,capture:!0})})}};function qa(e){let t=ll(`meta[name=${e}]`);return t?t.getAttribute("content"):void 0}var mc={};Y.Sentry&&Y.Sentry.Integrations&&(mc=Y.Sentry.Integrations);T(T(T({},mc),rc),lc);var Yp="https://d233059272824702afc8c43834c4912d@sentry.hcaptcha.com/6",tn=null;function _c(e,t){if(e===!1)return es(e);if(tn)return es(tn,t);let r=new wh({dsn:Yp,transport:window.fetch?jh:Ch,stackParser:Gh,integrations:[new wn,new qt,new Tn,new jn,new In,new Gp]});return tn=new Bs(r),es(tn,t)}function es(e,t={key:"source",value:"@hCaptcha/loader"}){return{addBreadcrumb:r=>{e&&e.addBreadcrumb(r)},captureMessage:r=>{e&&e.withScope(function(n){n.setTag(t.key,t.value),e.captureMessage(r)})},captureException:r=>{e&&e.withScope(function(n){n.setTag(t.key,t.value),e.captureEvent({message:ns,level:"error",extra:r})})}}}function Fp({scriptLocation:e,query:t,loadAsync:r=!0,crossOrigin:n,apihost:s="https://js.hcaptcha.com",cleanup:i=!0,secureApi:a=!1,scriptSource:c=""}={}){let d=Co(e),u=Ro(d);return new Promise((f,p)=>{let g=u.document.createElement("script");g.id=el,c?g.src=`${c}?onload=${sn}`:a?g.src=`${s}/1/secure-api.js?onload=${sn}`:g.src=`${s}/1/api.js?onload=${sn}`,g.crossOrigin=n,g.async=r;let _=(x,S)=>{try{!a&&i&&d.removeChild(g),S(x)}catch(I){p(I)}};g.onload=x=>_(x,f),g.onerror=x=>_(x,p),g.src+=t!==""?`&${t}`:"",d.appendChild(g)})}var rn=[];function Hp(e={cleanup:!0},t){try{t.addBreadcrumb({category:Rt,message:"hCaptcha loader params",data:e});let r=Co(e.scriptLocation),n=Ro(r),s=rn.find(({scope:a})=>a===n.window);if(s)return t.addBreadcrumb({category:Rt,message:"hCaptcha already loaded"}),s.promise;let i=new Promise((a,c)=>Ns(this,null,function*(){try{n.window[sn]=()=>{t.addBreadcrumb({category:Rt,message:"hCaptcha script called onload function"}),a(n.window.hcaptcha)};let d=Qu({custom:e.custom,render:e.render,sentry:e.sentry,assethost:e.assethost,imghost:e.imghost,reportapi:e.reportapi,endpoint:e.endpoint,host:e.host,recaptchacompat:e.recaptchacompat,hl:e.hl});yield Fp(T({query:d},e)),t.addBreadcrumb({category:Rt,message:"hCaptcha loaded",data:s})}catch(d){t.addBreadcrumb({category:Rt,message:"hCaptcha failed to load",data:d});let u=rn.findIndex(f=>f.scope===n.window);u!==-1&&rn.splice(u,1),t.captureException(d),c(new Error(ns))}}));return rn.push({promise:i,scope:n.window}),i}catch(r){return t.captureException(r),Promise.reject(new Error(ns))}}function gc(e,t=0){return Ns(this,null,function*(){let r=t<2?"Retry loading hCaptcha Api":"Exceeded maximum retries",n=_c(e.sentry);try{return yield Hp(e,n)}catch(s){return n.addBreadcrumb({SENTRY_SOURCE:Rt,message:r,data:{error:s}}),t>=2?(n.captureException(s),Promise.reject(s)):(t+=1,gc(e,t))}})}function Wp(){return Ns(this,arguments,function*(e={}){return yield gc(e)})}function za(e){var t=e&&e.ownerDocument||document,r=t.defaultView||t.parentWindow||window;return{document:t,window:r}}function Ga(e){return e||document.head}var jt={key:"source",value:"@hCaptcha/react"},mr={mounted:"hCaptcha component mounted",expired:"hCaptcha expired",unmounted:"hCaptcha component unmounted",reset:"hCaptcha reset",removed:"hCaptcha removed"},Kp=function(e){Wu(t,e);function t(n){var s;return s=e.call(this,n)||this,s._hcaptcha=void 0,s.renderCaptcha=s.renderCaptcha.bind(pe(s)),s.resetCaptcha=s.resetCaptcha.bind(pe(s)),s.removeCaptcha=s.removeCaptcha.bind(pe(s)),s.isReady=s.isReady.bind(pe(s)),s._onReady=null,s.loadCaptcha=s.loadCaptcha.bind(pe(s)),s.handleOnLoad=s.handleOnLoad.bind(pe(s)),s.handleSubmit=s.handleSubmit.bind(pe(s)),s.handleExpire=s.handleExpire.bind(pe(s)),s.handleError=s.handleError.bind(pe(s)),s.handleOpen=s.handleOpen.bind(pe(s)),s.handleClose=s.handleClose.bind(pe(s)),s.handleChallengeExpired=s.handleChallengeExpired.bind(pe(s)),s.ref=w.createRef(),s.apiScriptRequested=!1,s.sentryHub=null,s.captchaId="",s.state={isApiReady:!1,isRemoved:!1,elementId:n.id},s}var r=t.prototype;return r.componentDidMount=function(){var s=this,i=Ga(this.props.scriptLocation),a=za(i);this._hcaptcha=a.window.hcaptcha||void 0;var c=typeof this._hcaptcha<"u";if(this.sentryHub=_c(this.props.sentry,jt),this.sentryHub.addBreadcrumb({category:jt.value,message:mr.mounted}),c){this.setState({isApiReady:!0},function(){s.renderCaptcha()});return}this.loadCaptcha()},r.componentWillUnmount=function(){var s=this._hcaptcha,i=this.captchaId;this.isReady()&&(s.reset(i),s.remove(i),this.sentryHub.addBreadcrumb({category:jt.value,message:mr.unmounted}))},r.shouldComponentUpdate=function(s,i){return!(this.state.isApiReady!==i.isApiReady||this.state.isRemoved!==i.isRemoved)},r.componentDidUpdate=function(s){var i=this,a=["sitekey","size","theme","tabindex","languageOverride","endpoint"],c=a.every(function(d){return s[d]===i.props[d]});c||this.removeCaptcha(function(){i.renderCaptcha()})},r.loadCaptcha=function(){if(!this.apiScriptRequested){var s=this.props,i=s.apihost,a=s.assethost,c=s.endpoint,d=s.host,u=s.imghost,f=s.languageOverride,p=s.reCaptchaCompat,g=s.reportapi,_=s.sentry,x=s.custom,S=s.loadAsync,I=s.scriptLocation,D=s.scriptSource,k=s.secureApi,P=s.cleanup,U=P===void 0?!0:P,$={render:"explicit",apihost:i,assethost:a,endpoint:c,hl:f,host:d,imghost:u,recaptchacompat:p===!1?"off":null,reportapi:g,sentry:_,custom:x,loadAsync:S,scriptLocation:I,scriptSource:D,secureApi:k,cleanup:U};Wp($).then(this.handleOnLoad,this.handleError).catch(this.handleError),this.apiScriptRequested=!0}},r.renderCaptcha=function(s){var i=this,a=this.props.onReady,c=this.state.isApiReady,d=this.captchaId;if(!(!c||d)){var u=Object.assign({"open-callback":this.handleOpen,"close-callback":this.handleClose,"error-callback":this.handleError,"chalexpired-callback":this.handleChallengeExpired,"expired-callback":this.handleExpire,callback:this.handleSubmit},this.props,{hl:this.props.hl||this.props.languageOverride,languageOverride:void 0}),f=this._hcaptcha,p=f.render(this.ref.current,u);this.captchaId=p,this.setState({isRemoved:!1},function(){s&&s(),a&&a(),i._onReady&&i._onReady(p)})}},r.resetCaptcha=function(){var s=this._hcaptcha,i=this.captchaId;this.isReady()&&(s.reset(i),this.sentryHub.addBreadcrumb({category:jt.value,message:mr.reset}))},r.removeCaptcha=function(s){var i=this._hcaptcha,a=this.captchaId;this.isReady()&&(this.setState({isRemoved:!0},function(){i.remove(a),s&&s()}),this.sentryHub.addBreadcrumb({category:jt.value,message:mr.removed}))},r.handleOnLoad=function(){var s=this;this.setState({isApiReady:!0},function(){try{var i=Ga(s.props.scriptLocation),a=za(i);s._hcaptcha=a.window.hcaptcha,s.renderCaptcha(function(){var c=s.props.onLoad;c&&c()})}catch(c){s.sentryHub.captureException(c)}})},r.handleSubmit=function(s){var i=this.props.onVerify,a=this.state.isRemoved,c=this._hcaptcha,d=this.captchaId;if(!(typeof c>"u"||a)){var u=c.getResponse(d),f=c.getRespKey(d);i&&i(u,f)}},r.handleExpire=function(){var s=this.props.onExpire,i=this._hcaptcha,a=this.captchaId;this.isReady()&&(i.reset(a),s&&s(),this.sentryHub.addBreadcrumb({category:jt.value,message:mr.expired}))},r.handleError=function(s){var i=this.props.onError,a=this._hcaptcha,c=this.captchaId;this.isReady()&&a.reset(c),i&&i(s)},r.isReady=function(){var s=this.state,i=s.isApiReady,a=s.isRemoved;return i&&!a},r.handleOpen=function(){!this.isReady()||!this.props.onOpen||this.props.onOpen()},r.handleClose=function(){!this.isReady()||!this.props.onClose||this.props.onClose()},r.handleChallengeExpired=function(){!this.isReady()||!this.props.onChalExpired||this.props.onChalExpired()},r.execute=function(s){var i=this;s===void 0&&(s=null),s=typeof s=="object"?s:null;try{var a=this._hcaptcha,c=this.captchaId;if(!this.isReady()){var d,u=new Promise(function(f,p){i._onReady=function(g){try{var _=i._hcaptcha;s&&s.async?_.execute(g,s).then(f).catch(p):f(_.execute(g,s))}catch(x){p(x)}}});return(d=s)!=null&&d.async?u:null}return a.execute(c,s)}catch(f){return this.sentryHub.captureException(f),s&&s.async?Promise.reject(f):null}},r.close=function(){var s=this._hcaptcha,i=this.captchaId;if(this.isReady())return s.close(i)},r.setData=function(s){var i=this._hcaptcha,a=this.captchaId;this.isReady()&&(s&&typeof s!="object"&&(s=null),i.setData(a,s))},r.getResponse=function(){var s=this._hcaptcha;return s.getResponse(this.captchaId)},r.getRespKey=function(){var s=this._hcaptcha;return s.getRespKey(this.captchaId)},r.render=function(){var s=this.state.elementId;return w.createElement("div",{ref:this.ref,id:s})},t}(w.Component);const ht=typeof window>"u"?null:window.matchMedia("(prefers-color-scheme: dark)");function Xp(){const[e,t]=w.useState(ht!=null&&ht.matches?"dark":"light");return w.useEffect(()=>{if(!ht)return;const r=()=>{t(ht.matches?"dark":"light")};return ht.addEventListener("change",r),()=>{ht.removeEventListener("change",r)}},[]),e}function Jp({siteKey:e,token:t,onToken:r,prevLabel:n,onPrev:s,nextLabel:i,onNext:a,ref:c,invalid:d,children:u,...f}){const p=w.useRef(null),g=Xp(),[_,x]=w.useState(t),S=w.useCallback(()=>{var k;(k=p.current)==null||k.execute()},[]),I=w.useCallback((k,P)=>{x(k),r(k,P)},[r]),D=w.useCallback(k=>{if(_)return a(k);if(p.current)p.current.execute();else throw new Error("Unable to load hCaptcha")},[_,a]);return l.jsx(Bt,{...f,cancelLabel:n,onCancel:s,submitLabel:i,onSubmit:D,append:u,invalid:d||!_,children:l.jsx(Kp,{theme:g,sitekey:e,onLoad:S,onVerify:I,ref:Qe([c,p])})})}function Qp({customizationData:{availableUserDomains:e=[],hcaptchaSiteKey:t=void 0,inviteCodeRequired:r=!0,links:n}={},onValidateNewHandle:s,onDone:i,onBack:a,backLabel:c,title:d,subtitle:u,...f}){const{i18n:p,_:g}=z(),[_,x]=w.useState(void 0),[S,I]=w.useState(void 0),[D,k]=w.useState(void 0),P=t==null?void 0:D||!1,U=w.useCallback($=>{if(_&&S&&P!==!1)return i({..._,handle:S,hcaptchaToken:P},$)},[_,S,P,i]);return l.jsxs(Ee,{...f,title:d??p._({id:"IS0nrP"}),subtitle:u??l.jsx(R,{id:"qjBGxf"}),children:[l.jsx(Vu,{doneLabel:l.jsx(R,{id:"e+RpCP"}),onBack:a,backLabel:c,onDone:U,steps:[{invalid:!S,titleRender:()=>l.jsx(R,{id:"khEQ02"}),contentRender:({prev:$,prevLabel:B,next:V,nextLabel:K,invalid:F})=>l.jsx(Hu,{className:"grow",invalid:F,domains:e,handle:S,onHandle:I,prevLabel:B,onPrev:$,nextLabel:K,onNext:async ae=>{if(S&&await s({handle:S},ae),!ae.aborted)return V(ae)},children:l.jsx(Hn,{links:n})})},{invalid:!_,titleRender:()=>l.jsx(R,{id:"gdRnT7"}),contentRender:({prev:$,prevLabel:B,next:V,nextLabel:K,invalid:F})=>l.jsx(zu,{className:"grow",invalid:F,prevLabel:B,onPrev:$,nextLabel:K,onNext:V,inviteCodeRequired:r,credentials:_,onCredentials:x,children:l.jsx(Hn,{links:n})})},t!=null&&{invalid:P===!1,titleRender:()=>l.jsx(R,{id:"aIar4b"}),contentRender:({prev:$,prevLabel:B,next:V,nextLabel:K,invalid:F})=>l.jsx(Jp,{className:"grow",invalid:F,siteKey:t,token:D,onToken:k,prevLabel:B,onPrev:$,nextLabel:K,onNext:V,children:l.jsx(Hn,{links:n})})}]}),l.jsx(qu,{className:"mt-4",links:n})]})}function em({onSignUp:e,onSignIn:t,onCancel:r,...n}){const{i18n:s,_:i}=z();return l.jsxs(bd,{...n,title:n.title??s._({id:"OX6vme"}),children:[e&&l.jsx(ce,{className:"m-1 w-60 min-w-min max-w-full",color:t?"primary":void 0,onClick:e,children:l.jsx(R,{id:"mpt9T+"})}),t&&l.jsx(ce,{className:"m-1 w-60 min-w-min max-w-full",color:e?void 0:"primary",onClick:t,children:l.jsx(R,{id:"yKDCQ1"})}),r&&l.jsx(ce,{className:"m-1 w-60 min-w-min max-w-full",onClick:r,children:l.jsx(R,{id:"dEgA5A"})})]})}function tm({authorizeData:e,initialSessions:t,customizationData:r,...n}){var zt;const{i18n:s,_:i}=z(),a=e.loginHint!=null,c=!a&&!!((zt=r==null?void 0:r.availableUserDomains)!=null&&zt.length),d=!c||t.length?2:0,[u,f]=w.useState(d),p=wt(f,5),g=wt(f,2),_=wt(f,3),x=wt(f,1),S=wt(f,4),[I,D]=w.useState(void 0),{sessions:k,selectSub:P,doValidateNewHandle:U,doSignUp:$,doSignIn:B,doInitiatePasswordReset:V,doConfirmResetPassword:K,doConsent:F,doReject:ae}=Cd({sessions:t,onRedirected:p}),M=!c||k.length?2:0,te=wt(f,M),X=c?x:void 0,re=k.find(Ve=>Ve.selected&&!Ve.loginRequired);if(w.useEffect(()=>{re&&(re.consentRequired?S():F(re.account.sub))},[re,F,S]),w.useEffect(()=>{u===1&&!c&&f(M)},[u,M,!c]),w.useEffect(()=>{u===4&&!re&&f(M)},[u,M,!re]),w.useEffect(()=>{u===0&&M!==0&&f(M)},[u,M]),u===0)return l.jsx(em,{...n,customizationData:r,onSignIn:g,onSignUp:X,onCancel:ae});if(u===1)return l.jsx(Qp,{...n,customizationData:r,onValidateNewHandle:U,onBack:te,onDone:$});if(u===3)return l.jsx(Au,{...n,emailDefault:I,onresetPasswordRequest:V,onResetPasswordConfirm:K,onBack:te});if(u===2)return l.jsx($u,{...n,loginHint:e.loginHint,sessions:k,selectSub:P,onSignIn:B,onSignUp:X,onBack:M===2?ae:te,backLabel:M===2?s._({id:"dEgA5A"}):void 0,onForgotPassword:Ve=>{_(),D(Ve)}});if(u===4)return re?l.jsx(Eu,{...n,clientId:e.clientId,clientMetadata:e.clientMetadata,clientTrusted:e.clientTrusted,clientFirstParty:e.clientFirstParty,permissionSets:e.permissionSets,account:re.account,scope:e.scope,onConsent:Ve=>F(re.account.sub,Ve),onReject:ae,onBack:a?void 0:()=>{P(null),te()}}):null;if(u===5)return l.jsx(Ee,{...n,title:n.title??s._({id:"UCOd1e"}),children:l.jsx(R,{id:"qq6QQ5"})});throw new Error("Unexpected application state")}const{__authorizeData:pn,__customizationData:Ya,__sessions:rm}=window,pt=new URL(window.location.href);pt.pathname==="/oauth/authorize"&&!pt.searchParams.has("request_uri")&&(pt.search="",pt.searchParams.set("client_id",pn.clientId),pt.searchParams.set("request_uri",pn.requestUri),window.history.replaceState(history.state,"",pt.pathname+pt.search));const nm=document.getElementById("root");var Fa;xd.createRoot(nm).render(l.jsx(w.StrictMode,{children:l.jsx(Ed,{userLocales:(Fa=pn.uiLocales)==null?void 0:Fa.split(" "),children:l.jsx(wd,{fallbackRender:({error:e})=>l.jsx(Sd,{error:e,customizationData:Ya}),children:l.jsx(tm,{authorizeData:pn,customizationData:Ya,initialSessions:rm})})})}))});export default sm();
|
|
20
|
+
//# sourceMappingURL=authorization-page-CUmylUsp.js.map
|