@mcpjam/inspector 3.23.0 → 3.23.1

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.
Files changed (27) hide show
  1. package/dist/client/assets/{app-bootstrap-LFJyqXyJ.js → app-bootstrap-CQqrl4C7.js} +261 -261
  2. package/dist/client/assets/{chunk-D32TOXHM-BUV_xiWV.js → chunk-D32TOXHM-DVfEl7a2.js} +5 -5
  3. package/dist/client/assets/{dead-clicks-autocapture-CxJBitTm.js → dead-clicks-autocapture-BMs5s_2R.js} +2 -2
  4. package/dist/client/assets/{error-reporting-DxIXZRUY.js → error-reporting-CblWFSJy.js} +3 -3
  5. package/dist/client/assets/{error-reporting-CVi5-krC.js → error-reporting-DOand_j6.js} +1 -1
  6. package/dist/client/assets/{exception-autocapture-Bg4q4N1V.js → exception-autocapture-CSwGNOGc.js} +2 -2
  7. package/dist/client/assets/{first-run-oauth-return-DwlOc8tB.js → first-run-oauth-return-BCNTs2GH.js} +2 -2
  8. package/dist/client/assets/{highlighted-body-KQOG7T2V-C7XGGDHW.js → highlighted-body-KQOG7T2V-CKM1-SzP.js} +2 -2
  9. package/dist/client/assets/{index-Bg3o2MnW.js → index-BOOlzn8y.js} +3 -3
  10. package/dist/client/assets/{jszip.min-Bvbvu43m.js → jszip.min-Cip-l759.js} +2 -2
  11. package/dist/client/assets/{mermaid-MCJ5UELQ-lcpM5A51.js → mermaid-MCJ5UELQ-Bb4-qZ6h.js} +1 -1
  12. package/dist/client/assets/{posthog-recorder-B6Kr_Wgg.js → posthog-recorder-D19wbsQ5.js} +2 -2
  13. package/dist/client/assets/{preload-helper-Ck6Mr4it.js → preload-helper-BerMOtKS.js} +2 -2
  14. package/dist/client/assets/{project-route-Cd8OyMXr.js → project-route-DPRRfvoQ.js} +2 -2
  15. package/dist/client/assets/{react-dom-SjTQD9U3.js → react-dom-Du9nuv92.js} +2 -2
  16. package/dist/client/assets/{rolldown-runtime-C03pXr1T.js → rolldown-runtime-Dhvrsp_z.js} +1 -1
  17. package/dist/client/assets/{surveys-D0hPG0xq.js → surveys-D_UpP5nz.js} +2 -2
  18. package/dist/client/assets/telemetry-files-f95e29335ba26785.js +1 -0
  19. package/dist/client/assets/{trace-timeline-boAVWttK.js → trace-timeline-B7Z76l-t.js} +1 -1
  20. package/dist/client/assets/{trace-timeline-CZ0d0iER.js → trace-timeline-Dy5i1YGh.js} +2 -2
  21. package/dist/client/assets/{use-reduced-motion-C6Vd_wvn.js → use-reduced-motion-DdBQj6R3.js} +2 -2
  22. package/dist/client/assets/{web-vitals-BmkdweHF.js → web-vitals-BEx8xJAE.js} +2 -2
  23. package/dist/client/index.html +8 -8
  24. package/dist/server/harness-install-cli.js +3 -3
  25. package/dist/server/index.js +5 -5
  26. package/package.json +1 -1
  27. package/dist/client/assets/telemetry-files-0bf75a54db264a5a.js +0 -1
@@ -1,4 +1,4 @@
1
- import{o as F_}from"./rolldown-runtime-C03pXr1T.js";import{A as DI,At as ee,B as UI,Bt as H_,Ct as qI,D as jI,Dt as _t,E as zI,Et as ge,F as FI,Gt as B_,H as ca,Ht as HI,I as BI,It as w,Jt as VI,Kt as GI,L as Np,Mt as V_,N as WI,Nt as G_,P as JI,Pt as Je,Rt as st,St as W_,Tt as KI,V as YI,Xt as XI,Yt as ZI,Z as J_,_ as QI,_t as eA,a as tA,at as ri,b as Dp,bt as Oe,ct as rA,dt as K_,et as Mi,ft as iA,g as nA,ht as Y_,j as sA,jt as ct,k as oA,kt as Le,nt as aA,o as cA,ot as lA,pt as it,st as Up,tt as Hc,u as X_,ut as uA,v as dA,vt as Q,wt as Z_,x as Q_,zt as bt}from"./project-route-Cd8OyMXr.js";import{n as pA,t as hA}from"./react-dom-SjTQD9U3.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"3.23.0"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c4f58dd1-d97e-4b83-a372-158e9a3d2bdd",e._sentryDebugIdIdentifier="sentry-dbid-c4f58dd1-d97e-4b83-a372-158e9a3d2bdd")}catch{}})();var ey="phc_dTOPniyUNU2kD8Jx8yHMXSqiZHM8I91uWopTMX6EBE9",fA={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"},Yf;Yf||(Yf={});function mA(e){return GI(iA,e)}var la=F_(pA(),1);function td(e){return Array.isArray(e)?e.map(td):e&&typeof e=="object"?Object.fromEntries(Object.entries(e).sort(([t],[r])=>t<r?-1:t>r?1:0).map(([t,r])=>[t,td(r)])):e}function gA(e){return JSON.stringify(td(e))}function pB(e,t){if(t==="openai-apps"){const i=e;return typeof i?.type=="string"?i.type.replace("openai:",""):"unknown"}const r=e;return typeof r?.method=="string"?r.method:r?.result!==void 0?"result":r?.error!==void 0?"error":"unknown"}var Xf=e=>{let t;const r=new Set,i=(l,u)=>{const p=typeof l=="function"?l(t):l;if(!Object.is(p,t)){const d=t;t=u??(typeof p!="object"||p===null)?p:Object.assign({},t,p),r.forEach(h=>h(t,d))}},n=()=>t,a={setState:i,getState:n,getInitialState:()=>c,subscribe:l=>(r.add(l),()=>r.delete(l))},c=t=e(i,n,a);return a},qp=(e=>e?Xf(e):Xf),vA=e=>e;function _A(e,t=vA){const r=la.useSyncExternalStore(e.subscribe,la.useCallback(()=>t(e.getState()),[e,t]),la.useCallback(()=>t(e.getInitialState()),[e,t]));return la.useDebugValue(r),r}var Zf=e=>{const t=qp(e),r=i=>_A(t,i);return Object.assign(r,t),r},yA=(e=>e?Zf(e):Zf),hB=Object.freeze({maxObservations:24,maxSummaryChars:400,maxEvidenceRefs:8,maxEvidenceRefChars:200,maxModelIdChars:128,maxVersionChars:64}),fB=Object.freeze({status:"not-requested",reason:"not_requested",detail:"this run did not request model-backed observations, so nothing was charged"}),bA="missingInputMessage";function Qf(e){if(!(!e||typeof e!="object"||!("missingInput"in e)))switch(e.missingInput){case"tasksProbe":case"logProbe":case"inputRequiredProbe":case"toolCallProbe":case"login":return e.missingInput;default:return}}function jp(e){if(e.status!=="skipped"||e.skipReason!=="could-not-run")return;const t=e.details,r=Qf(t)??Qf(t&&typeof t=="object"&&"details"in t?t.details:void 0);if(r)return r;const i=typeof e.id=="string"?e.id:"",n=ty(e.error);if(i.startsWith("tasks-")&&(n.startsWith("no probe tool could be selected automatically:")||n.startsWith("no listed tool advertises `execution.taskSupport`")))return"tasksProbe";if(i==="modern-logs-require-log-level"&&n.startsWith("No logProbe configured"))return"logProbe";if(i==="modern-undeclared-capability-error"&&n.startsWith("No inputRequiredProbe configured"))return"inputRequiredProbe";if(i==="modern-tool-output-schema-conformant"&&/^\d+ tool\(s\) declare an outputSchema, but no tools\/call fixture was configured:/.test(n))return"toolCallProbe"}function rd(e){return jp(e)!==void 0}var SA={tasksProbe:"Select a tool that creates a task in setup, then run again.",logProbe:"Select a tool that emits logs in setup, then run again.",inputRequiredProbe:"Select a tool that asks for input in setup, then run again.",toolCallProbe:"Select a tool to check output in setup, then run again.",login:"This server needs a login. Log in, then run again."};function em(e){if(!e||typeof e!="object")return;const t=e[bA];return typeof t=="string"&&t.trim()?t:void 0}function mB(e){const t=jp(e);if(!t)return;const r=e.details;return em(r)??em(r&&typeof r=="object"&&"details"in r?r.details:void 0)??SA[t]}var wA=/^(?:the probed tool )?("(?:[^"\\]|\\.)*") returned a normal result/;function gB(e){if(e.status!=="skipped"||e.skipReason!=="could-not-run"||typeof e.id!="string"||!e.id.startsWith("tasks-"))return;const t=wA.exec(ty(e.error));if(!t)return;let r;try{r=JSON.parse(t[1])}catch{return}if(typeof r=="string")return EA(r)}function EA(e){return`"${e}" did not create a task, so there was nothing to check. Select a tool that creates a task in setup, or change its arguments so it does, then run again.`}function ty(e){return typeof e=="string"?e:e&&typeof e=="object"&&"message"in e&&typeof e.message=="string"?e.message:""}function Bc(e){return e.status==="skipped"&&e.skipReason==="could-not-run"}function ry(e){return e.status==="skipped"&&e.skipReason!=="could-not-run"}function iy(e){if(e.some(i=>i.status==="failed"))return{outcome:"failed"};const t=e.filter(i=>Bc(i)&&(!rd(i)||jp(i)==="login"));if(t.length===0)return e.length===0?{outcome:"incomplete",incompleteReason:"no checks were selected, so this run establishes nothing"}:e.every(rd)?{outcome:"incomplete",incompleteReason:"every selected check needs input from setup, so this run establishes nothing"}:{outcome:"passed"};const r=Array.from(new Set(t.map(i=>i.error?.message??"reason unavailable")));return{outcome:"incomplete",incompleteReason:`${t.length} of ${e.length} selected check(s) could not run, so this run does not establish conformance (${t.map(i=>i.id).join(", ")}): ${r.join(" ")}`}}function ny(e){const t=e.filter(s=>s.status==="passed").length,r=e.filter(s=>s.status==="failed").length,i=e.filter(Bc).length,n=e.filter(ry).length;return`${t}/${e.length} checks passed, ${r} failed, ${i} could not run, ${n} not applicable`}var vB=Object.freeze({toolNameMaxChars:128,maxFeatureClaims:10,maxToolCalls:2}),kA=/^[A-Za-z]:[\\/]/,IA=/[\u0000-\u001f\u007f]/,AA=new TextEncoder;function RA(e){return AA.encode(e).length}function TA(e){let t=e.length;for(;t>0;){const r=e[t-1];if(r!=="."&&r!==" ")break;t-=1}return e.slice(0,t)}function sy(e){if(typeof e!="string"||e.length===0)return{ok:!1,code:"PATH_EMPTY",message:"path is empty"};if(e.includes("\0"))return{ok:!1,code:"PATH_NUL_BYTE",message:"path contains a NUL byte"};if(IA.test(e))return{ok:!1,code:"PATH_INVALID_CHARACTER",message:"path contains control characters"};if(e.startsWith("/")||e.startsWith("\\")||kA.test(e))return{ok:!1,code:"PATH_ABSOLUTE",message:`absolute paths are not allowed: "${e}"`};const t=e.replace(/\\/g,"/").split("/").filter(r=>r!==""&&r!==".");for(const r of t){if(r==="..")return{ok:!1,code:"PATH_TRAVERSAL",message:`path traversal ("..") is not allowed: "${e}"`};if(r.includes(":"))return{ok:!1,code:"PATH_INVALID_CHARACTER",message:`path segments must not contain ":" (drive prefix / alternate data stream): "${e}"`};const i=TA(r);if(i===""||i==="."||i==="..")return{ok:!1,code:"PATH_INVALID_CHARACTER",message:`path segment "${r}" is not portable (empty or dot name after trailing dot/space stripping)`}}return t.length===0?{ok:!1,code:"PATH_EMPTY",message:"path is empty"}:{ok:!0,path:t.join("/").normalize("NFC")}}function CA(e){return e.normalize("NFKC").toLowerCase()}function ua(e,t){return t===e||t.startsWith(`${e}/`)}function kn(e,t){const r=sy(t);return r.ok?{ok:!0,path:e===""?r.path:`${e}/${r.path}`}:r.code==="PATH_ABSOLUTE"||r.code==="PATH_TRAVERSAL"?{ok:!1,code:"PATH_ESCAPES_ROOT",message:`referenced path escapes the bundle root: "${t}"`}:r}function PA(e,t,r){e.length>t.maxEntries&&r.error("BUNDLE_TOO_MANY_ENTRIES",`bundle has ${e.length} entries; the limit is ${t.maxEntries}`);const i=new Set,n=new Map,s=[];let o=0,a=!1;for(const c of e){if(c.kind==="symlink"||c.kind==="hardlink"){r.error("PATH_LINK_ENTRY",`${c.kind} entries are not allowed`,{path:c.path});continue}const l=sy(c.path);if(!l.ok){r.error(l.code,l.message,{path:c.path});continue}const u=l.path;if(RA(u)>t.maxPathBytes){r.error("PATH_TOO_LONG",`path exceeds ${t.maxPathBytes} bytes`,{path:u});continue}if(u.split("/").length>t.maxPathDepth){r.error("PATH_TOO_DEEP",`path exceeds nesting depth ${t.maxPathDepth}`,{path:u});continue}if(i.has(u)){r.error("PATH_DUPLICATE",`duplicate normalized path: "${u}"`,{path:c.path});continue}i.add(u);const p=CA(u),d=n.get(p);if(d!==void 0){r.error("PATH_CASE_COLLISION",`"${u}" collides with "${d}" on case-insensitive filesystems`,{path:u});continue}if(n.set(p,u),c.kind!=="directory"){if(!Number.isFinite(c.size)||c.size<0){r.error("FILE_SIZE_MISMATCH","entry declares an invalid size",{path:u});continue}if(c.size>t.maxFileBytes){r.error("FILE_TOO_LARGE",`file exceeds the per-file limit of ${t.maxFileBytes} bytes`,{path:u});continue}o+=c.size,!a&&o>t.maxTotalBytes&&(a=!0,r.error("BUNDLE_TOO_LARGE",`total uncompressed content exceeds ${t.maxTotalBytes} bytes`)),s.push({sourcePath:c.path,path:u,size:c.size,executable:((c.mode??0)&73)!==0})}}return s.sort((c,l)=>c.path<l.path?-1:c.path>l.path?1:0),s}var id=class extends Error{code;issues;constructor(e){const t=e.find(i=>i.severity==="error"),r=t?.code??"MANIFEST_INVALID_FIELD";super(t?`plugin bundle validation failed: ${t.code}: ${t.message}`:"plugin bundle validation failed"),this.name="PluginBundleError",this.code=r,this.issues=e}},rn=class{all=[];error(e,t,r){this.all.push({code:e,severity:"error",message:t,...r})}warn(e,t,r){this.all.push({code:e,severity:"warning",message:t,...r})}hasErrors(){return this.all.some(e=>e.severity==="error")}issues(){return[...this.all]}warnings(){return this.all.filter(e=>e.severity==="warning")}throwIfErrors(){if(this.hasErrors())throw new id(this.issues())}absorbDemoted(e){for(const t of e.issues())this.all.push(t.severity==="error"?{...t,severity:"warning"}:t)}firstErrorMessage(){return this.all.find(e=>e.severity==="error")?.message}};var Po=/(secret|token|password|passwd|api[-_]?key|private[-_]?key|credential)/i,oy=/(bearer\s+\S|-----BEGIN|\b(?:sk|pk|rk|xox[a-z])-[A-Za-z0-9]|[a-z][a-z0-9+.-]*:\/\/[^/\s:@]*:[^/\s@]+@|[A-Za-z0-9+/_-]{40,})/i;function Vc(e){return oy.test(e)}var Us=Symbol("drop");function nd(e,t,r,i,n){if(r>32)return n.reportedTooDeep||(n.reportedTooDeep=!0,i.issues.error("VALUE_TOO_DEEP",`${i.label}: field "${t}" nests deeper than 32 levels`,i.context)),Us;if(typeof e=="string")return oy.test(e)?(i.issues.warn(i.secretCode,`${i.label}: value of "${t}" looks secret-bearing and is not stored`,i.context),Us):e;if(typeof e=="number"||typeof e=="boolean"||e===null)return e;if(Array.isArray(e)){const s=[];for(let o=0;o<e.length;o++){const a=nd(e[o],`${t}[${o}]`,r+1,i,n);a!==Us&&s.push(a)}return s}if(typeof e=="object"){const s={};for(const[o,a]of Object.entries(e)){const c=t===""?o:`${t}.${o}`;if(Po.test(o)){i.issues.warn(i.secretCode,`${i.label}: field "${c}" looks secret-bearing and is not stored`,i.context);continue}const l=nd(a,c,r+1,i,n);l!==Us&&(s[o]=l)}return s}return Us}function Gc(e,t){return nd(e,"",0,t,{reportedTooDeep:!1})}function ay(e){return["localhost","[::1]","::1"].includes(e)||/^127(?:\.\d{1,3}){3}$/.test(e)}var zp=(e,t)=>!/^[^:/?#]+:\/\/[^\\/?#]/.test(e)||/^[^:]*:[\\/]*[^\\/?#]*@|[\\\s]/.test(e)||t?.allowFragment!==!0&&e.includes("#")||[...e].some(r=>r<" "||r===""),OA=/^[a-z]+(?:[-_][a-z]+)+$/i,xA=e=>e.replace(/%(?!2f)([0-7][0-9a-f])/gi,(t,r)=>String.fromCharCode(Number.parseInt(r,16)));function Hl(e){return[e,xA(e)].some(t=>Vc(t)&&!OA.test(t))}function Fp(e){if(e.pathname.split("/").some(Hl))return!0;const t=e.hash.slice(1);if(Hl(t))return!0;for(const r of[e.searchParams,new URLSearchParams(t)])for(const[i,n]of r)if(Hl(n)||n!==""&&Po.test(i))return!0;return!1}function MA(e){let t;try{t=new URL(e)}catch{return{ok:!1,code:"MCP_INVALID_SERVER",message:'"url" is not a valid URL'}}return zp(e)?{ok:!1,code:"MCP_INVALID_SERVER",message:'"url" must be an absolute https:// URL (or a loopback http:// one) without credentials, a fragment, whitespace or backslashes'}:Fp(t)?{ok:!1,code:"MCP_INVALID_SERVER",message:'"url" looks like it carries a credential, which a plugin must not ship'}:t.protocol==="https:"?{ok:!0,loopbackHttp:!1}:t.protocol==="http:"&&ay(t.hostname)?{ok:!0,loopbackHttp:!0}:{ok:!1,code:"MCP_INSECURE_URL",message:"remote MCP servers must use HTTPS"}}function LA(e){if(typeof e!="string")return{ok:!1,code:"MCP_INVALID_SERVER",message:'"cwd" must be a string'};const t=/^(\.|\$\{PLUGIN_ROOT\}|\$\{PLUGIN_DATA\})(?:\/(.*))?$/s.exec(e);if(t===null||t[1]==="."&&t[2]===void 0)return{ok:!1,code:"MCP_INVALID_WORKING_DIRECTORY",message:'"cwd" must start with "./", "${PLUGIN_ROOT}", or "${PLUGIN_DATA}"'};const r=t[1]==="."?"${PLUGIN_ROOT}":t[1],i=t[2]??"";if(i.replace(/[/.]/g,"")===""&&!i.includes(".."))return{ok:!0,value:r};const n=kn("",i);return n.ok?{ok:!0,value:`${r}/${n.path}`}:{ok:!1,code:n.code,message:n.message}}var cy=/^\$\{[A-Za-z_][A-Za-z0-9_]*\}$/,tm=/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g,$A=/^\$\{(?:PLUGIN_ROOT|PLUGIN_DATA)\}[A-Za-z0-9._/-]*$/,rm=new Set(["PLUGIN_ROOT","PLUGIN_DATA"]),NA=/^[A-Za-z0-9.:/@,+_-]*$/,DA=/[A-Za-z0-9_-]{16,}/,UA=/(authorization|token|secret|api[-_]?key|cookie|password|credential)/i;function ly(e,t){return e.name<t.name?-1:e.name>t.name?1:0}function qA(e,t,r,i){if(r===void 0)return[];if(r===null||typeof r!="object"||Array.isArray(r))return i.error("MCP_INVALID_ENV",`server "${e}": "env" must be an object`,{componentKey:t}),null;const n=new Map,s=new Set;for(const[o,a]of Object.entries(r)){if(rm.has(o))return i.error("MCP_RESERVED_ENV_KEY",`server "${e}": env may not define "${o}" — it is client-controlled`,{componentKey:t}),null;if(typeof a!="string"){i.error("MCP_INVALID_ENV",`server "${e}": env "${o}" must be a string`,{componentKey:t});continue}if($A.test(a)){n.set(o,{name:o,required:!1,valueTemplate:a});continue}if(a===""||cy.test(a)){n.set(o,{name:o,required:!0});continue}const c=[...a.matchAll(tm)].map(l=>l[1]).filter(l=>!rm.has(l));if(c.length>0){const l=a.replace(tm,"");if(NA.test(l)&&!DA.test(l)&&!Po.test(o)){n.set(o,{name:o,required:!1,valueTemplate:a});for(const u of c)s.add(u);continue}}else if(!Po.test(o)&&!Vc(a)){n.set(o,{name:o,required:!1,value:a});continue}n.set(o,{name:o,required:!0}),i.warn("MCP_ENV_VALUE_OMITTED",`server "${e}": literal value of env "${o}" is not stored; configure it during setup`,{componentKey:t})}for(const o of s)n.has(o)||n.set(o,{name:o,required:!0});return[...n.values()].sort(ly)}function jA(e,t,r,i){if(r===void 0)return[];if(r===null||typeof r!="object"||Array.isArray(r))return i.error("MCP_INVALID_HEADERS",`server "${e}": "headers" must be an object`,{componentKey:t}),null;const n=[],s=new Set;for(const[o,a]of Object.entries(r)){if(s.has(o.toLowerCase()))return i.error("MCP_INVALID_HEADERS",`server "${e}": header "${o}" is declared more than once`,{componentKey:t}),null;if(s.add(o.toLowerCase()),typeof a!="string"){i.error("MCP_INVALID_HEADERS",`server "${e}": header "${o}" must be a string`,{componentKey:t});continue}const c=UA.test(o);if(a===""||cy.test(a)){n.push({name:o,secret:c});continue}const l=Vc(a);if(!c&&!l){n.push({name:o,secret:!1,value:a});continue}i.warn("MCP_HEADER_VALUE_OMITTED",`server "${e}": literal value of header "${o}" is not stored; configure it during setup`,{componentKey:t}),n.push({name:o,secret:c||l})}return n.sort(ly)}function zA(e,t,r,i){const n={},s=r.authentication;if(typeof s=="string"){const a=s.toLowerCase();a==="on_install"?n.timing="on_install":a==="on_use"&&(n.timing="on_use")}const o=r.oauth??(typeof s=="object"?s:void 0);if(o&&typeof o=="object"&&!Array.isArray(o)){const a=o,c=a.scopes;Array.isArray(c)&&c.every(p=>typeof p=="string")&&(n.scopes=c);const l={};for(const[p,d]of Object.entries(a))p!=="scopes"&&(l[p]=d);const u=Gc(l,{issues:i,secretCode:"MCP_SECRET_FIELD_OMITTED",label:`server "${e}": oauth`,context:{componentKey:t}});Object.keys(u).length>0&&(n.metadata=u)}return n}var FA={url:"https://developers.openai.com/plugins/deploy/submission-errors",capturedOn:"2026-11-13"},xr={plugin_manifest_missing:{table:"Plugin manifest errors",message:"ZIP must contain root `plugin.json` with a supported Agent Plugins schema, `.codex-plugin/plugin.json`, `.agent-plugin/plugin.json`, or `.claude-plugin/plugin.json` at the root or in its single top-level directory."},plugin_root_ambiguous:{table:"Plugin root errors",message:"ZIP must contain exactly one plugin root, either at the archive root or in one top-level directory."},plugin_root_has_siblings:{table:"Plugin root errors",message:"A ZIP with a top-level plugin directory must not contain sibling files."},plugin_name_missing:{table:"Plugin manifest errors",message:"`name` is required."},plugin_name_wrong_type:{table:"Plugin manifest errors",message:"`name` must be a string."},plugin_name_empty:{table:"Plugin manifest errors",message:"`name` must be non-empty."},plugin_name_too_long:{table:"Plugin manifest errors",message:"`name` must be 64 characters or fewer."},plugin_name_format:{table:"Plugin manifest errors",message:"`name` must start with an ASCII letter or digit and contain only ASCII letters, digits, `_`, or `-`."}},HA=/^(?!.*(?:--|\.\.))[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?$/;var uy=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;function BA(e){if(e===void 0)return["plugin_name_missing"];if(typeof e!="string")return["plugin_name_wrong_type"];if(e.trim()==="")return["plugin_name_empty"];const t=[];return e.length>64&&t.push("plugin_name_too_long"),uy.test(e)||t.push("plugin_name_format"),t}var VA='manifest "name" must be 1-64 lowercase [a-z0-9.-] chars with single separators (no "--" or "..")';function GA(e,t){const[r]=BA(e),i=t==="openai-compatible";return typeof e=="string"&&(e.length<=64&&HA.test(e)||i&&r===void 0)?{ok:!0,name:e}:{ok:!1,message:i&&r!==void 0?xr[r].message:VA}}var Ii="plugin.json",sd=Object.freeze({"1.0.0":"https://agent-plugins.org/schemas/1.0.0/plugin.schema.json"}),Yi="com.mcpjam",Hp=/\[TODO:/i,dy=["description","license"],py=["homepage","repository"],WA=new Set(["command","entrypoint","exec","install","install_script","postinstall","preinstall","run","script","scripts"]),JA=new Set(["$schema","name","version","author","keywords","extensions","interface",...dy,...py]);function od(e,t,r,i=0,n={reportedTooDeep:!1}){if(typeof e=="string"){Hp.test(e)&&r.error("MANIFEST_PLACEHOLDER",`manifest field "${t}" contains an unresolved placeholder`);return}if(i>32){n.reportedTooDeep||(n.reportedTooDeep=!0,r.error("VALUE_TOO_DEEP",`manifest field "${t}" nests deeper than 32 levels`));return}if(Array.isArray(e)){e.forEach((s,o)=>od(s,`${t}[${o}]`,r,i+1,n));return}if(e&&typeof e=="object")for(const[s,o]of Object.entries(e))od(o,t===""?s:`${t}.${s}`,r,i+1,n)}function im(e,t,r){if(typeof t!="string"){r.error("MANIFEST_INVALID_FIELD",`manifest field "${e}" must be a string URL`);return}let i;try{i=new URL(t)}catch{r.warn("MANIFEST_INVALID_FIELD",`manifest field "${e}" is not a valid URL; ignored`);return}if(i.username!==""||i.password!==""||Fp(i)){r.warn("MANIFEST_SECRET_FIELD_OMITTED",`manifest field "${e}" carries a credential; ignored`);return}if(zp(t,{allowFragment:!0})){r.warn("MANIFEST_INVALID_FIELD",`manifest field "${e}" is not a URL as written; ignored`);return}if(i.protocol!=="https:"){r.warn("MANIFEST_INSECURE_URL",`manifest field "${e}" must use HTTPS; ignored`);return}return t}function KA(e,t,r,i){const n=t[Yi];if(n===void 0)return;if(n===null||typeof n!="object"||Array.isArray(n)){i.warn("MANIFEST_INVALID_FIELD",`extension namespace "${Yi}" must be an object; ignored`);return}const s=n,o=s.displayName??s.display_name;o!==void 0&&(typeof o!="string"?i.warn("MANIFEST_INVALID_FIELD",`"${Yi}.displayName" must be a string; ignored`):e.displayName=o);for(const a of["icon","logo"]){const c=s[a];if(c===void 0)continue;if(typeof c!="string"){i.warn("MANIFEST_INVALID_FIELD",`"${Yi}.${a}" must be a bundle-relative path; ignored`);continue}const l=kn("",c);if(!l.ok){i.warn(l.code,`"${Yi}.${a}": ${l.message}`);continue}if(!r.has(l.path)){i.warn("MANIFEST_MISSING_FILE",`"${Yi}.${a}" references a file that is not in the bundle: "${l.path}"`,{path:l.path});continue}e[a]=l.path}}var Er="com.openai",hy=["logo","logoDark","composerIcon"];function un(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function YA(e,t,r,i){for(const{label:n,value:s}of t)if(s!==void 0){if(!un(s)){i.warn("MANIFEST_INVALID_FIELD",`"${n}" must be an object; ignored`);continue}s.displayName!==void 0&&typeof s.displayName!="string"?i.warn("MANIFEST_INVALID_FIELD",`"${n}.displayName" must be a string; ignored`):s.displayName?.trim()&&(Hp.test(s.displayName)?i.warn("MANIFEST_INVALID_FIELD",`"${n}.displayName" is an unresolved placeholder; ignored`):e.displayName=s.displayName);for(const o of hy){const a=s[o];if(a===void 0)continue;if(typeof a!="string"){i.warn("MANIFEST_INVALID_FIELD",`"${n}.${o}" must be a bundle-relative path; ignored`);continue}const c=kn("",a);if(!c.ok){i.warn(c.code,`"${n}.${o}": ${c.message}`);continue}if(!r.has(c.path)){i.warn("MANIFEST_MISSING_FILE",`"${n}.${o}" references a file that is not in the bundle: "${c.path}"`,{path:c.path});continue}e[o]=c.path}}}function XA(e,t){if(e.logo===void 0&&e.logoDark===void 0){t.warn("MANIFEST_DIRECTORY_ICON_MISSING",'plugin has no directory icon: OpenAI requires "interface.logo" (light) and "interface.logoDark" (dark), PNG');return}if(e.logo===void 0||e.logoDark===void 0){const r=e.logo===void 0?"logo":"logoDark";t.warn("MANIFEST_DIRECTORY_ICON_VARIANT_MISSING",`plugin directory icon has no ${r==="logo"?"light":"dark"} variant: add "interface.${r}"`)}}function ZA(e,t){const{filePaths:r,issues:i}=t;if(e===null||typeof e!="object"||Array.isArray(e))return i.error("MANIFEST_INVALID_JSON","plugin.json must contain a JSON object"),{manifest:null};const n=e,s=n.$schema,o=typeof s=="string"?Object.keys(sd).find(f=>sd[f]===s):void 0;if(o===void 0)return i.error("MANIFEST_UNSUPPORTED_SCHEMA",s===void 0?'manifest is missing the required "$schema" field':`manifest "$schema" is not a supported Agent Plugins schema: ${String(s)}`),{manifest:null};const a=GA(n.name,t.profile??"strict");if(!a.ok)return i.error("MANIFEST_INVALID_NAME",a.message),{manifest:null};const c={schemaVersion:o,name:a.name,extensions:{}};n.version!==void 0&&(typeof n.version!="string"||n.version.length===0?i.error("MANIFEST_INVALID_VERSION",'manifest "version" must be a non-empty string when present'):c.version=n.version);for(const f of dy){const m=n[f];if(m!==void 0){if(typeof m!="string"){i.error("MANIFEST_INVALID_FIELD",`manifest field "${f}" must be a string`);continue}c[f]=m}}for(const f of py){if(n[f]===void 0)continue;const m=im(f,n[f],i);m!==void 0&&(c[f]=m)}const l=n.author;if(l!==void 0)if(l&&typeof l=="object"&&!Array.isArray(l)){const f=l,m={};for(const v of Object.keys(f)){if(v==="name"||v==="email"||v==="url"){v!=="url"&&typeof f[v]!="string"&&i.error("MANIFEST_INVALID_FIELD",`manifest field "author.${v}" must be a string`);continue}i.warn("MANIFEST_UNKNOWN_FIELD",`manifest field "author.${v}" is not part of Agent Plugins ${o}; ignored`)}if(typeof f.name=="string"&&(m.name=f.name),typeof f.email=="string"&&(m.email=f.email),f.url!==void 0){const v=im("author.url",f.url,i);v!==void 0&&(m.url=v)}c.author=m}else i.error("MANIFEST_INVALID_FIELD",'manifest field "author" must be an object');const u=n.keywords;u!==void 0&&(!Array.isArray(u)||u.some(f=>typeof f!="string")?i.error("MANIFEST_INVALID_FIELD",'manifest field "keywords" must be an array of strings'):c.keywords=u);const p=un(n.extensions)?n.extensions[Er]:void 0,d=n.interface!==void 0||p!==void 0;YA(c,[{label:"interface",value:n.interface},{label:`extensions.${Er}.interface`,value:un(p)?p.interface:void 0}],r,i);const h=n.extensions;h!==void 0&&(h===null||typeof h!="object"||Array.isArray(h)?i.warn("MANIFEST_INVALID_FIELD",'manifest field "extensions" must be an object; ignored'):(c.extensions=Gc(eR(h),{issues:i,secretCode:"MANIFEST_SECRET_FIELD_OMITTED",label:"manifest extensions"}),KA(c,h,r,i))),d&&XA(c,i);for(const f of Object.keys(n))if(!JA.has(f)){if(WA.has(f)){i.error("MANIFEST_AMBIGUOUS_FIELD",`manifest field "${f}" is not supported and is execution-ambiguous; remove it`);continue}i.warn("MANIFEST_UNKNOWN_FIELD",`manifest field "${f}" is not part of Agent Plugins ${o}; ignored`)}return od(c,"",i),{manifest:c,onboardingSkill:un(p)?p.onboardingSkill:void 0}}var QA=new Set(["displayName",...hy]);function eR(e){const t=e[Er];if(!un(t))return e;const{onboardingSkill:r,...i}=t;return un(i.interface)&&(i.interface=Object.fromEntries(Object.entries(i.interface).filter(([n,s])=>!QA.has(n)||typeof s!="string"||!Hp.test(s)))),{...e,[Er]:i}}function tR(e,t,r,i){const n=e.extensions[Er],s=un(n)?{...n}:void 0;if(s!==void 0&&(delete s.onboardingSkill,e.extensions[Er]=s),t===void 0)return;const o=typeof t=="string"?kn("",t):null,a=o?.ok?r.find(c=>c.skillFilePath===o.path):void 0;if(a===void 0||s===void 0){i.warn("MANIFEST_MISSING_FILE","the onboarding skill this plugin names is not one of its loaded skills; onboarding is unavailable");return}e.onboarding={skillPath:a.skillFilePath,componentKey:a.componentKey},s.onboardingSkill=t}var rR={maxEntries:1e3,maxTotalBytes:104857600,maxFileBytes:10485760,maxPathBytes:512,maxPathDepth:20,maxSkills:20,maxMcpServers:20},fy=Object.freeze({strict:2,"openai-compatible":1}),Cr=".codex-plugin/plugin.json",my=".agent-plugin/plugin.json",gy=".claude-plugin/plugin.json",iR=".mcp.json",vy=[{path:Cr,layout:"codex"},{path:my,layout:"agent-legacy"},{path:gy,layout:"claude"}],nR=new Set(["skills","mcpServers","apps","interface","onboardingSkill","extensions"]),_y={hooks:"lifecycle hooks",commands:"slash commands",agents:"agents",outputStyles:"output styles",lspServers:"language servers"};function ii(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function yy(e,t){if(typeof e!="string")return!1;const r=kn("",e);return r.ok&&r.path===t}function by(e,t,r){const i=e.extensions,n=ii(i)?i[Er]:void 0,s=ii(n)?{...n}:{};for(const a of["interface","apps"])e[a]!==void 0&&s[a]===void 0&&(s[a]=e[a]);const o=e.onboardingSkill;return o!==void 0&&s.onboardingSkill===void 0?s.onboardingSkill=o:o!==void 0&&s.onboardingSkill!==o&&(r.warn("MANIFEST_INVALID_FIELD",`${t} declares two different onboarding skills; neither is used`,{path:t}),delete s.onboardingSkill),s}function Sy(e,t){const{[Er]:r,...i}=e??{};return Object.keys(t).length>0?{...i,[Er]:t}:i}function wy(e,t,r){for(const[i,n]of Object.entries(_y))e[i]!==void 0&&r.warn("UNSUPPORTED_COMPONENT",`"${i}" in ${t} declares ${n}, which MCPJam does not run; ignored`,{path:t})}function sR(e,t,{filePaths:r,issues:i}){if(e===void 0)return r.has(".mcp.json")?{legacyMcp:{kind:"file",path:iR}}:{};if(ii(e))return{legacyMcp:{kind:"inline",path:t,document:e}};const n=typeof e=="string"?kn("",e):null;if(n===null||!n.ok){const s=`"mcpServers" in ${t}: ${n===null?"must be a path or an object":n.message}`;return i.warn(n?.code??"MCP_INVALID_CONFIG",s,{path:t}),{skipped:{kind:"mcp-config",key:t,reason:s}}}return r.has(n.path)?{legacyMcp:{kind:"file",path:n.path}}:(i.warn("MANIFEST_MISSING_FILE",`"mcpServers" in ${t} names "${n.path}", which is not in the bundle`,{path:n.path}),{})}function oR(e,t,r){const{issues:i}=r,n=t.manifestPath,s={};for(const[c,l]of Object.entries(e))!nR.has(c)&&!(c in _y)&&(s[c]=l);const o=s.$schema;String(o).startsWith("https://agent-plugins.org/schemas/")||(s.$schema=sd["1.0.0"]);const a=e.extensions;if(a!==void 0&&!ii(a))s.extensions=a;else{const c=Sy(a,by(e,n,i));Object.keys(c).length>0&&(s.extensions=c)}if(e.skills!==void 0&&!yy(e.skills,"skills")){const c=typeof e.skills=="string"?`"${e.skills}"`:"a non-path value";i.warn("UNSUPPORTED_COMPONENT",`"skills" in ${n} names ${c}; skills are read only from "skills/"`,{path:n})}return wy(e,n,i),{interpretation:t,record:s,...sR(e.mcpServers,n,r)}}function aR(e,t,{readJson:r,issues:i}){const n=l=>(i.warn("MANIFEST_OVERLAY_IGNORED",`"${Cr}" is ignored: ${l}`,{path:Cr}),{interpretation:t,record:e}),s=e.extensions;if(s!==void 0&&!ii(s))return n(`"${Ii}" has no usable "extensions"`);if(ii(s?.["com.openai"]))return n(`"${Ii}" declares extensions["${Er}"], which replaces it`);const o=new rn,a=r(Cr,o);if(!ii(a))return n(o.firstErrorMessage()??"it must be a JSON object");for(const[l,u]of[["skills","skills"],["mcpServers","mcp.json"]])a[l]===void 0||yy(a[l],u)||i.warn("MANIFEST_OVERLAY_IGNORED",`"${l}" in ${Cr} is ignored: with a root plugin.json it is always "${u}"`,{path:Cr});wy(a,Cr,i);const c=by(a,Cr,i);return{interpretation:{...t,overlayPath:Cr},record:{...e,extensions:Sy(s,c)}}}function Ey(e,{filePaths:t,issues:r}){for(const{path:i}of vy)i===e||e==="plugin.json"&&i===".codex-plugin/plugin.json"||!t.has(i)||r.warn("MANIFEST_OVERLAY_IGNORED",`"${i}" is ignored: "${e}" is the manifest`,{path:i})}function cR(e){const{profile:t,filePaths:r,readJson:i,issues:n}=e,s={profile:t,revision:fy[t],layout:"agent-plugins",manifestPath:Ii},o=i(Ii,n);return t==="strict"||!ii(o)?{interpretation:s,record:o}:(Ey(Ii,e),r.has(".codex-plugin/plugin.json")?aR(o,s,e):{interpretation:s,record:o})}function lR(e){const{profile:t,location:r,readJson:i,issues:n}=e;if(r.layout==="agent-plugins")return cR(e);Ey(r.path,e);const s={profile:t,revision:fy[t],layout:r.layout,manifestPath:r.path},o=i(r.path,n);return ii(o)?oR(o,s,e):{interpretation:s,record:o}}var nm="2026-08-19",sm="https://developers.openai.com/plugins",ky=["quickstart","plugin-guidelines","reference","changelog","plan/use-case","plan/tools","concepts/plugins","concepts/skills","concepts/ui-guidelines","build/plugins","build/skills","build/mcp-server","build/chatgpt-ui","build/auth","build/monetization","build/examples","deploy/connect-chatgpt","deploy/submission","deploy/submission-errors","deploy/troubleshooting","guides/optimize-metadata","guides/submit-claude-plugin","guides/product-checkout-conversion-spec"],Iy=[{page:"help/plugins-in-chatgpt-and-codex",url:"https://help.openai.com/en/articles/20001256-plugins-in-chatgpt-and-codex"},{page:"help/submitting-apps-to-the-chatgpt-app-directory",url:"https://help.openai.com/en/articles/20001040-submitting-apps-to-the-chatgpt-app-directory"}],Ay={"app-guidelines":"plugin-guidelines"};function uR(e){return Object.hasOwn(Ay,e)}var _B=[...ky,...Iy.map(e=>e.page)],om={},dR=[...ky.map(e=>({page:e,url:`${sm}/${e}`,revisionUrl:`${sm}/${e}.md`,format:"markdown",revision:om[e]??null,snapshotDate:nm})),...Iy.map(e=>({page:e.page,url:e.url,revisionUrl:e.url,format:"html",revision:om[e.page]??null,snapshotDate:nm}))],pR=Object.freeze(Object.fromEntries(dR.map(e=>[e.page,e])));function gr(e,t){const r=pR[uR(e)?Ay[e]:e];return{page:r.page,section:t,url:r.url,revision:r.revision,snapshotDate:r.snapshotDate}}var Ua={maxCompressedBytes:104857600,maxUncompressedBytes:536870912,maxEntries:5e3},hR={portable:Ii,canonical:Cr,accepted:[my,gy]},er={nameMaxLength:100,pluginNameMaxLength:64,displayNameMaxLength:100,shortDescriptionMaxLength:255,descriptionMaxLength:2e3,defaultPromptMaxLength:255,toolNameMaxLength:64,skillNameMaxLength:64},Ry=["productivity","education","developer-tools","design","writing","research","data-analysis","marketing","sales","finance","health","travel","entertainment"],qa={minEdgePx:48,maxEdgePx:4096,mustBeSquare:!0,maxBytes:5242880,acceptedMimeTypes:["image/png","image/jpeg","image/webp","image/svg+xml"]},fR={lightBackground:"#FFFFFF",darkBackground:"#212121",minRatio:2},Xi={maxSkillMarkdownBytes:262144,maxPageBytes:1048576,maxSkillTotalBytes:5242880,maxImportedTotalBytes:8388608,maxSkills:5,maxPagesPerSkill:10},mR="/.well-known/openai-apps-challenge",gR="text/html;profile=mcp-app",vR="/mcp",_R=["readOnlyHint","destructiveHint","openWorldHint"],nn={successCount:5,failureCount:3},yR={originChangeRequiresNewPlugin:!0,uiContentChangesStayLive:!0,uiContentCacheSeconds:3600},yB={archiveLimits:Ua,manifestLocations:hR,fieldLimits:er,listingCategories:Ry,imageConstraints:qa,brandColorContrast:fR,mcpSkillLimits:Xi,domainVerificationPath:mR,appHtmlMime:gR,expectedMcpPath:vR,requiredToolAnnotations:_R,submissionTestCases:nn,releaseRules:yR,source:gr("deploy/submission","Host profile constants")},Ty={columns:["Resource","Lookup"],keys:["fixture","lookup"],placeholders:[["Sample Project",'get_project {"name": "Sample Project"}']],maxRows:20,grow:!0},bR="Upload new or existing plugin",SR={upload:{title:"Upload your plugin ZIP",intro:"Compress your plugin folder into a .zip file before uploading",layout:{blocks:[{widget:"upload",text:{drop:"Upload new or existing plugin",button:"Upload plugin",checked:"Errors block the upload; warnings require confirmation."}}]}},listing:{title:"Metadata & Skills",intro:"Package details are read-only here; edit them in your source package.",layout:{blocks:[{widget:"plugin-header",fields:["listing.displayName","listing.shortDescription"]},{heading:"Metadata",fields:["listing.description","listing.developer","listing.name","listing.category","listing.capabilities","listing.website","listing.support","listing.privacyPolicy","listing.terms","listing.starterPrompts"],text:{upload:"Upload new version"}},{heading:"Skills",widget:"skills",text:{passed:"Checks passed",attention:"Needs attention"}},{widget:"findings",text:{title:"Findings",all:"All",blocking:"Blocking",copy:"Copy findings"}}]}},mcp:{title:"MCPs",intro:"Your package can declare multiple MCP servers, but only one MCP server can be connected per plugin.",layout:{blocks:[{heading:"Connect MCP server",widget:"connect",fields:["mcp.serverUrl","mcp.verificationToken"],text:{authentication:"Authentication",authorize:"Your MCP server needs OAuth access before we can scan its tools.",settings:"You can define advanced settings in your mcp.json",domain:"Domain verification",verified:"Domain verified",reconnect:"Reconnect",rescan:"Rescan"}},{heading:"Tools",widget:"tools"}]}},reviewer:{title:"Review information",intro:"Read-only fields are managed by your plugin ZIP. To change read-only information, update your plugin ZIP and upload it again.",layout:{blocks:[{heading:"Countries and translations",note:"Its fields were not captured."},{heading:"Reviewer credentials",note:"Test credentials must work immediately with no additional setup required. Logging in must provide immediate access to a demo account.",fields:["reviewer.loginUrl","reviewer.tenant","reviewer.username","reviewer.passwordSecret","reviewer.signInSteps"]},{fields:["reviewer.identityTool","reviewer.identityArgs","reviewer.expectedIdentityPath","reviewer.expectedIdentity","reviewer.expectedOrganizationPath","reviewer.expectedOrganization","reviewer.fixtures"]},{heading:"Test cases",fields:["reviewer.testCases"]},{heading:"Negative test cases",fields:["reviewer.negativeTestCases"]},{heading:"Supporting content",fields:["reviewer.demoRecordingUrl","reviewer.releaseNotes"]},{widget:"drawer-actions",text:{back:"Back",next:"Next",save:"Save details"}}]}},submit:{title:"Submit for review",intro:"Complete the required policy attestations.",layout:{blocks:[{fields:["submit.developerIdentity"]},{fields:["submit.attestations"]},{widget:"non-blocking-findings",text:{title:"Non-blocking findings",body:"These findings do not block submission, but unresolved findings may lead to rejection during review."}},{fields:["submit.additionalContext"]},{widget:"submit",text:{cancel:"Cancel",submit:"Submit"}}]}},publish:{title:"Publish your approved plugin",intro:"Open the approved package version and select Publish plugin.",layout:{blocks:[{widget:"publish",text:{button:"Publish plugin"}}]}}},wR={"listing.displayName":{label:"Display name",packagePath:"plugin.json#/extensions/com.openai/interface/displayName",errors:{required:"Display name is required, non-empty, and single-line.",tooLong:"Display name must be 30 characters or fewer."}},"listing.shortDescription":{label:"Short description",packagePath:"plugin.json#/extensions/com.openai/interface/shortDescription",errors:{required:"Short description is required, non-empty, and single-line.",tooLong:"Short description must be 30 characters or fewer."}},"listing.description":{label:"About",packagePath:"plugin.json#/extensions/com.openai/interface/longDescription",errors:{required:"Long description is required and must be non-empty. Line breaks are allowed.",tooLong:"Long description must be 4,000 characters or fewer."}},"listing.developer":{label:"Developer",packagePath:"plugin.json#/extensions/com.openai/interface/developerName",errors:{required:"Developer name is required.",tooLong:"Developer name must be 80 characters or fewer."}},"listing.name":{label:"Package name",packagePath:"plugin.json#/name"},"listing.category":{label:"Category",packagePath:"plugin.json#/extensions/com.openai/interface/category",options:[{value:"Productivity",label:"Productivity"},{value:"Creativity",label:"Creativity"},{value:"Developer Tools",label:"Developer Tools"},{value:"Business & Operations",label:"Business & Operations"},{value:"Data & Analytics",label:"Data & Analytics"},{value:"Communication",label:"Communication"},{value:"Education & Research",label:"Education & Research"},{value:"Security",label:"Security"},{value:"Finance",label:"Finance"},{value:"Healthcare",label:"Healthcare"},{value:"Travel",label:"Travel"},{value:"Entertainment",label:"Entertainment"},{value:"Other",label:"Other"}]},"listing.capabilities":{label:"Capabilities",packagePath:"plugin.json#/extensions/com.openai/interface/capabilities"},"listing.website":{label:"Website",packagePath:"plugin.json#/extensions/com.openai/interface/websiteURL",errors:{required:"Website URL is required."}},"listing.support":{label:"Support",packagePath:"plugin.json#/extensions/com.openai/interface/supportURL"},"listing.privacyPolicy":{label:"Privacy policy",packagePath:"plugin.json#/extensions/com.openai/interface/privacyPolicyURL"},"listing.terms":{label:"Terms of service",packagePath:"plugin.json#/extensions/com.openai/interface/termsOfServiceURL"},"listing.starterPrompts":{label:"Starter prompts",packagePath:"plugin.json#/extensions/com.openai/interface/defaultPrompt"},"mcp.serverUrl":{label:"MCP Server URL",packagePath:"mcp.json#/mcpServers/*/url"},"mcp.verificationToken":{label:"Domain verification token",helper:"The portal issues this token in its MCP step."},"reviewer.loginUrl":{label:"Login URL"},"reviewer.tenant":{label:"Tenant",placeholder:"Choose an organization"},"reviewer.username":{label:"Username"},"reviewer.passwordSecret":{label:"Password",placeholder:"Demo account password"},"reviewer.signInSteps":{label:"Sign-in steps",placeholder:"Steps for this account"},"reviewer.identityTool":{label:"Identity tool",placeholder:"whoami",helper:"MCPJam's own check, not part of the portal: a read-only tool on your server that returns the signed-in account. MCPJam calls it as the reviewer."},"reviewer.identityArgs":{label:"Identity tool arguments",placeholder:"{}",helper:"Fixed JSON arguments, if the identity tool takes any."},"reviewer.expectedIdentityPath":{label:"Identity path",placeholder:"$.user.email",helper:"Where the tool's result names the account, as a JSON path."},"reviewer.expectedIdentity":{label:"Expected reviewer",placeholder:"review@example.com",helper:"The account reviewers sign in as."},"reviewer.expectedOrganizationPath":{label:"Organization path",placeholder:"$.organization.name",helper:"Where the tool's result names the organization or project, as a JSON path."},"reviewer.expectedOrganization":{label:"Expected organization",placeholder:"Sample Org",helper:"The organization or project reviewers should land in."},"reviewer.fixtures":{label:"Fixtures",helper:"MCPJam's own check: resources your test cases name, each with a read-only tool call that finds it in the reviewer's account."},"reviewer.testCases":{label:"Test cases",packagePath:"plugin.json#/extensions/com.openai/review/test_cases/positive"},"reviewer.negativeTestCases":{label:"Negative test cases",packagePath:"plugin.json#/extensions/com.openai/review/test_cases/negative"},"reviewer.demoRecordingUrl":{label:"Video walkthrough URL",packagePath:"plugin.json#/extensions/com.openai/review/demo_recording_url"},"reviewer.releaseNotes":{label:"Release notes",packagePath:"plugin.json#/extensions/com.openai/publication/release_notes"},"submit.developerIdentity":{label:"Developer identity"},"submit.attestations":{label:"Policy attestations",options:[{value:"terms-and-guidelines",label:"I have reviewed and agree to OpenAI's Terms and Plugin Guidelines. I confirm that my plugin is in compliance with those Terms and Guidelines."},{value:"applicable-laws",label:"I confirm that my plugin complies with all laws and regulations applicable to the industry it operates in. I understand that I am responsible for that compliance."},{value:"no-money-movement",label:"I confirm that my plugin does not initiate or execute money transfers, crypto transfers, or investment trades on behalf of users."},{value:"third-party-rights",label:"I confirm that I have all necessary rights to any third-party content or API endpoints accessed, displayed, or used by my plugin."},{value:"suitable-under-18",label:"I confirm that my plugin is suitable for individuals under 18 and does not include mature or adult content."},{value:"not-targeting-children",label:"I confirm that my plugin does not target children under 13 or share their personal information with OpenAI."}]},"submit.additionalContext":{label:"Additional Submission Context",helper:"Add any additional information that might be useful for the review team, including justification for any findings. This optional note is private to the review."}},ER=[{step:"upload",needs:["package"],reads:[],checks:["openai.package.archive","openai.package.manifest","openai.package.skills","openai.package.assets","openai.package.exclusions","openai.package.manifest-location","openai.package.observation.*","openai.migration.unsupported-surfaces","openai.migration.user-config","openai.migration.stdio-transport","openai.migration.host-language"]},{step:"listing",needs:["package"],reads:["listing.displayName","listing.shortDescription","listing.description"],checks:["openai.policy.non-promotional-package"]},{step:"listing",needs:[],reads:["listing.displayName","listing.shortDescription","listing.description"],checks:["openai.policy.non-promotional-listing"]},{step:"listing",needs:[],reads:["listing.displayName","listing.shortDescription","listing.description","listing.category"],checks:["openai.submission.listing-fields"]},{step:"listing",field:"listing.privacyPolicy",needs:[],reads:["listing.privacyPolicy","listing.support"],checks:["openai.submission.urls"]},{step:"listing",field:"listing.privacyPolicy",needs:[],reads:["listing.privacyPolicy"],checks:["openai.submission.privacy-disclosure","openai.policy.privacy-consistency"]},{step:"listing",needs:[],reads:[],checks:["openai.policy.originality","openai.policy.no-advertising","openai.policy.commerce","openai.feature.checkout"]},{step:"listing",needs:["server"],reads:["mcp.serverUrl"],checks:["openai.skills.extension","openai.skills.listing-complete","openai.skills.caps","openai.skills.digests","openai.skills.frontmatter","openai.skills.snapshot","openai.feature.imported-skills","openai.ui.screenshots"]},{step:"listing",needs:["server","model"],reads:["mcp.serverUrl"],checks:["openai.experience.listing-copy-placeholder","openai.experience.listing-copy-overpromises","openai.experience.skill-overlap"]},{step:"mcp",field:"mcp.serverUrl",needs:[],reads:["mcp.serverUrl"],checks:["openai.endpoint.https","openai.endpoint.path"]},{step:"mcp",field:"mcp.serverUrl",needs:["server"],reads:["mcp.serverUrl"],checks:["openai.endpoint.redirects-stay-https","openai.endpoint.redirects-terminate"]},{step:"mcp",field:"mcp.verificationToken",needs:["server"],reads:["mcp.serverUrl","mcp.verificationToken"],checks:["openai.domain.challenge-served","openai.domain.challenge-matches"]},{step:"mcp",field:"mcp.verificationToken",needs:[],reads:["mcp.verificationToken"],checks:["openai.submission.domain-token"]},{step:"mcp",needs:["server"],reads:["mcp.serverUrl"],checks:["openai.auth.challenge","openai.auth.prm-discoverable","openai.auth.prm-pointer","openai.auth.issuers-resolve","openai.auth.pkce-s256","openai.auth.rfc9207-iss","openai.auth.client-acquisition","openai.auth.runtime-challenge","openai.auth.unsupported-flows","openai.tools.annotations","openai.tools.descriptions","openai.tools.name-length","openai.tools.schemas","openai.tools.annotation-honesty","openai.tools.security-schemes","openai.profile.declared","openai.profile.input-empty","openai.profile.output-schema","openai.profile.read-only","openai.profile.description-honesty","openai.ui.mime","openai.ui.domain-present","openai.ui.domain-unique","openai.ui.csp-exact","openai.ui.output-schema","openai.ui.useful-without-ui","openai.submission.annotation-justifications","openai.submission.frame-domain-explanations","openai.release.origin","openai.release.contract","openai.release.schema-compatibility","openai.release.live-changes","openai.feature.profile-identification","openai.feature.ui-templates","openai.feature.cimd","openai.feature.lazy-authentication"]},{step:"mcp",needs:[],reads:[],checks:["openai.submission.scan-currency","openai.policy.predictable-side-effects","openai.policy.response-minimization"]},{step:"mcp",needs:["server","model"],reads:["mcp.serverUrl"],checks:["openai.experience.tool-descriptions-uninformative","openai.experience.tool-overlap","openai.experience.naming-inconsistent","openai.experience.destructive-tool-underexplained","openai.experience.auth-story-unclear","both.decision.annotation-matches-behaviour"]},{step:"mcp",needs:["model"],reads:["mcp.serverUrl","listing.displayName","listing.shortDescription","listing.description"],checks:["openai.decision.fair-play","openai.decision.secret-seeking"]},{step:"reviewer",needs:[],reads:["reviewer.demoRecordingUrl","reviewer.loginUrl","reviewer.username","reviewer.passwordSecret"],checks:["openai.submission.demo-access"]},{step:"reviewer",field:"reviewer.identityTool",needs:["server","reviewer"],reads:["mcp.serverUrl","reviewer.identityTool","reviewer.identityArgs","reviewer.expectedIdentityPath","reviewer.expectedIdentity","reviewer.expectedOrganizationPath","reviewer.expectedOrganization"],checks:["both.reviewer.identity"]},{step:"reviewer",field:"reviewer.fixtures",needs:["server","reviewer"],reads:["mcp.serverUrl","reviewer.fixtures","reviewer.testCases","reviewer.negativeTestCases","reviewer.signInSteps","reviewer.identityTool","reviewer.identityArgs","reviewer.expectedIdentityPath","reviewer.expectedIdentity","reviewer.expectedOrganizationPath","reviewer.expectedOrganization"],checks:["both.reviewer.fixtures"]},{step:"mcp",needs:["server"],reads:["mcp.serverUrl"],checks:["both.auth.client-signatures"]},{step:"reviewer",field:"reviewer.testCases",needs:[],reads:["reviewer.testCases","reviewer.negativeTestCases"],checks:["openai.submission.test-cases"]},{step:"reviewer",field:"reviewer.negativeTestCases",needs:[],reads:["reviewer.negativeTestCases"],checks:["openai.submission.test-case-quality"]},{step:"reviewer",field:"reviewer.releaseNotes",needs:[],reads:["reviewer.releaseNotes"],checks:["openai.submission.release-notes"]},{step:"reviewer",needs:[],reads:[],checks:["openai.submission.geography"]},{step:"submit",field:"submit.attestations",needs:[],reads:["submit.attestations"],checks:["openai.submission.attestations","openai.submission.attestation-truth"]},{step:"submit",field:"submit.developerIdentity",needs:[],reads:["submit.developerIdentity"],checks:["openai.submission.account"]},{step:"submit",needs:[],reads:[],checks:["openai.submission.profile-valid"]}],kR={"runtime-compatibility":"mcp","directory-policy":"mcp","plugin-package":"upload","release-contract":"mcp","optional-features":"mcp","submission-artifacts":"reviewer","experience-insights":"mcp"},ns={title:bR,steps:SR,fields:wR,placements:ER,laneSteps:kR},IR=["server","reviewer","model","package"];function Cy(e,t,r){return Object.keys(t).filter(i=>i.startsWith(`${e}.`)).map(i=>({key:i,...r[i],...t[i],errors:r[i].errors??{}}))}function Py(e,t){return t.flatMap(({checks:r,needs:i,...n})=>r.map(s=>({checkId:s,...n,needs:i.map(o=>{const a=IR.find(c=>c===o);if(!a)throw new Error(`${e} names an unknown need: ${o}`);return a})})))}var AR=ns.fields,am=ns.steps,Cn={format:"https-url"},Tt={managedBy:"package"};function mt(e,t={}){return{control:e,required:!0,...t}}function Vt(e,t={}){return{control:e,...t}}var RR={"listing.displayName":mt("text",{...Tt,maxLength:30}),"listing.shortDescription":mt("text",{...Tt,maxLength:30}),"listing.description":mt("textarea",{...Tt,maxLength:4e3}),"listing.developer":mt("text",{...Tt,maxLength:80}),"listing.name":mt("text",{...Tt,maxLength:er.pluginNameMaxLength}),"listing.category":Vt("select",Tt),"listing.capabilities":Vt("multi-select",{...Tt,freeEntry:!0,maxItems:20}),"listing.website":mt("text",{...Tt,...Cn}),"listing.support":mt("text",{...Tt,...Cn}),"listing.privacyPolicy":mt("text",{...Tt,...Cn}),"listing.terms":mt("text",{...Tt,...Cn}),"listing.starterPrompts":Vt("multi-select",{...Tt,freeEntry:!0,maxItems:3}),"mcp.serverUrl":mt("server",{...Tt,...Cn}),"mcp.verificationToken":Vt("text"),"reviewer.loginUrl":mt("text",Cn),"reviewer.tenant":Vt("text"),"reviewer.username":mt("text"),"reviewer.passwordSecret":mt("secret"),"reviewer.signInSteps":Vt("textarea",{requiredWith:["reviewer.tenant"]}),"reviewer.identityTool":Vt("text",{requiredWith:["reviewer.expectedIdentity","reviewer.expectedOrganization"]}),"reviewer.identityArgs":Vt("text"),"reviewer.expectedIdentityPath":Vt("text",{requiredWith:["reviewer.expectedIdentity"]}),"reviewer.expectedIdentity":Vt("text",{requiredWith:["reviewer.expectedIdentityPath"]}),"reviewer.expectedOrganizationPath":Vt("text",{requiredWith:["reviewer.expectedOrganization"]}),"reviewer.expectedOrganization":Vt("text",{requiredWith:["reviewer.expectedOrganizationPath"]}),"reviewer.fixtures":Vt("pairs",{pairs:Ty}),"reviewer.testCases":mt("rows",{...Tt,minItems:nn.successCount,maxItems:nn.successCount}),"reviewer.negativeTestCases":mt("rows",{...Tt,minItems:nn.failureCount,maxItems:nn.failureCount}),"reviewer.demoRecordingUrl":mt("text",{...Tt,format:"url"}),"reviewer.releaseNotes":mt("textarea",Tt),"submit.developerIdentity":mt("text"),"submit.attestations":mt("checkbox-group",{declaration:!0,minItems:ns.fields["submit.attestations"].options.length}),"submit.additionalContext":Vt("textarea")},bB={id:"chatgpt-plugin",directory:"openai",title:ns.title,version:"2026-11-13",source:{label:"OpenAI plugin submission docs and the ChatGPT plugin portal",url:"https://developers.openai.com/plugins/deploy/submission",capturedAt:"2026-11-13"},submissionUrl:"https://platform.openai.com/plugins",steps:Object.keys(am).map(e=>({id:e,...am[e],fields:Cy(e,RR,AR)})),placements:Py("chatgpt-plugin.json",ns.placements),laneSteps:ns.laneSteps},TR="2026-11-13",CR="2026-08-19";var PR=["directory","verification","submission","review-criteria","authentication","lazy-authentication","enterprise-managed-auth","troubleshooting","mcp-apps/cross-compatibility","mcp-apps/external-links","mcp-apps/troubleshooting","mcp-apps/design-guidelines"],OR=[{page:"directory",url:"https://claude.com/docs/directory/publish"},{page:"verification",url:"https://claude.com/docs/connectors/verification"}],xR=["directory","verification","submission","review-criteria","authentication"],MR={},LR=PR.map(e=>{const t=OR.find(i=>i.page===e),r=xR.includes(e)?TR:void 0;return{page:e,url:t?.url??`https://claude.com/docs/connectors/building/${e}`,revision:MR[e]??r??null,snapshotDate:r??CR}}),$R=Object.freeze(Object.fromEntries(LR.map(e=>[e.page,e])));function pi(e,t){const r=$R[e];return{page:r.page,section:t,url:r.url,revision:r.revision,snapshotDate:r.snapshotDate}}var NR=["https://claude.ai/api/mcp/auth_callback","https://claude.com/api/mcp/auth_callback"];var DR=".claudemcpcontent.com";var UR="text/html;profile=mcp-app",qR={toolListingMs:5e3,handshakeMs:3e3,widgetFirstPaintMs:3e3},jR={minViewportWidthPx:320,minTouchTargetPx:44},cm=200,Wt={nameMaxLength:100,oneLinerMaxLength:cm,taglineMaxLength:cm,descriptionMaxLength:2e3,categoriesMin:1,categoriesMax:5,useCasesMax:3,screenshotsMin:3,screenshotsMax:5,screenshotMinWidthPx:1e3,toolNameMaxLength:64},SB={callbackUrls:NR,loopbackRedirectIgnoresPort:!0,appContentDomainSuffix:DR,appContentDomainHashLength:32,appHtmlMime:UR,latencyBudgets:qR,appDesignBudgets:jR,submissionLimits:Wt,source:pi("directory","Host profile constants")},zR="Submit an MCP connector",FR={connection:{title:"Connection",intro:"Connect the server you want listed. We read its tools, resources, and auth from the live connection.",layout:{blocks:[{widget:"connector-picker",fields:["connection.serverUrl"],text:{notice:"This form is for remote MCP servers only.",noticeDetail:"Local MCP servers can be distributed inside plugins, but may not be supported in every Claude product.",add:"Add custom connector",addHelper:"A connector you add here stays in Settings → Connectors until you remove it.",choose:"Or choose a connector you’ve already added:",notConnected:"Not connected"}},{heading:"URL configuration",note:"Optional",fields:["connection.differentUrls"]}]}},tools:{title:"Tools",intro:"Review the tools we found and their annotations. Fix anything flagged on your server, then reconnect.",layout:{blocks:[{widget:"tool-list",text:{empty:"No server selected. Go back to the Connection step and pick a server."}}]}},listing:{title:"Listing",intro:"How your MCP server appears in the directory. You can edit this after you submit.",layout:{blocks:[{fields:["listing.name","listing.slug"]},{fields:["listing.oneLiner"]},{fields:["listing.description"]},{fields:["listing.categories"]},{fields:["listing.authorName","listing.authorUrl"]},{widget:"icon",fields:["listing.iconUrl"],text:{add:"Add custom icon URL"}},{widget:"listing-preview",text:{title:"How it reads in the directory",name:"Your server’s name",oneLiner:"One-liner appears here"}},{heading:"Links",note:"Help users learn more and get support.",fields:["listing.documentationUrl","listing.enterpriseAuthDocsUrl"]},{fields:["listing.support","listing.privacyPolicyUrl"]}]}},useCases:{title:"Use cases",intro:"Up to three things people can do with your MCP server, what they need before connecting, and whether it reads or writes. Shown to reviewers, not on your listing."},company:{title:"Company",intro:"Tell us about the company or organization behind this MCP server.",layout:{blocks:[{fields:["company.name"]},{fields:["company.website"]},{heading:"Primary contact",note:"We’ll use this contact for any questions about your submission.",fields:["company.contactName"]},{fields:["company.contactEmail"]},{fields:["company.role"]},{fields:["company.anthropicContact"]}]}},authentication:{title:"Authentication",intro:"Configure how users authenticate with your server. What you set here is applied to connections exactly as entered.",layout:{blocks:[{fields:["authentication.requirement"]},{heading:"Authentication methods",widget:"oauth-sign-in",fields:["authentication.oauthClient"],text:{title:"OAuth sign-in",headers:"Additional request headers",addHeader:"Add header",headersHelper:"Sent on every MCP request alongside the OAuth bearer token. Installers provide the values when they connect, unless you mark a header as held by Anthropic.",addStaticHeaders:"Add static headers"}}]}},dataHandling:{title:"Data handling",intro:"Tell reviewers what the MCP server reads, writes, and sends off-platform."},testLaunch:{title:"Test & launch",intro:"Give reviewers a way in, and confirm you’ve tested every tool.",layout:{blocks:[{fields:["testLaunch.instructions"]},{heading:"Self-tested",fields:["testLaunch.selfTested"]},{heading:"Reviewer check",note:"MCPJam's own, not part of Claude's form: who the reviewer is signed in as, and whether the resources your instructions name exist for them.",fields:["testLaunch.identityTool","testLaunch.identityArgs"]},{fields:["testLaunch.expectedIdentityPath","testLaunch.expectedIdentity"]},{fields:["testLaunch.expectedOrganizationPath","testLaunch.expectedOrganization"]},{fields:["testLaunch.fixtures"]}]}},compliance:{title:"Compliance",intro:"Confirm that your MCP server meets Anthropic’s directory policies. All items are required."},review:{title:"Review and submit",intro:"Confirm the details, then submit. Review can take a few weeks, and approval isn’t guaranteed.",layout:{blocks:[{widget:"submit",text:{submit:"Submit for review",missing:"Some steps are missing required fields — submit to highlight them."}}],review:[{id:"connection",title:"Connection",edit:"connection",rows:["connection.serverUrl",{label:"Captured tool list",error:"A captured tool list is required to submit. Connect your server on the Connection step, or reconnect it in Settings → Connectors, to capture it.",blank:"connection.serverUrl"}]},{id:"connection-auth",title:"Connection & authentication",edit:"authentication",rows:["authentication.requirement","authentication.oauthClient"]},{id:"listing",title:"Listing",edit:"listing",rows:["listing.name","listing.slug","listing.oneLiner","listing.description","listing.authorName","listing.categories","listing.documentationUrl","listing.support","listing.privacyPolicyUrl"]},{id:"useCases",title:"Use cases",edit:"useCases",rows:["useCases.pairs","useCases.prerequisites","useCases.access"]},{id:"company",title:"Company",edit:"company",rows:["company.name","company.website","company.contactName","company.contactEmail"]},{id:"authentication",title:"Authentication",edit:"authentication",rows:[],flat:!0},{id:"dataHandling",title:"Data handling",edit:"dataHandling",rows:["dataHandling.apiOwnership","dataHandling.healthData","dataHandling.sponsored"]},{id:"testLaunch",title:"Test & launch",edit:"testLaunch",rows:["testLaunch.instructions","testLaunch.selfTested"]},{id:"compliance",title:"Compliance",edit:"compliance",rows:["compliance.acknowledgments","compliance.additionalNotes"]}]}}},HR=JSON.parse(`{"connection.serverUrl":{"label":"Server URL","helper":"Servers already in the directory aren’t shown.","errors":{"required":"This field is required"}},"connection.differentUrls":{"label":"Users connect to different URLs","helper":"Leave this unchecked if every user connects to the same server URL."},"listing.name":{"label":"Name","placeholder":"My MCP server","errors":{"required":"This field is required"}},"listing.slug":{"label":"Slug","placeholder":"my-mcp-server","helper":"Permanent after submission. Lowercase letters, numbers, and hyphens.","errors":{"required":"Slug is required"}},"listing.oneLiner":{"label":"One-liner","placeholder":"A short tagline for your MCP server","errors":{"required":"This field is required"}},"listing.description":{"label":"Description","placeholder":"Describe what your MCP server does and its key features…","errors":{"required":"This field is required"}},"listing.categories":{"label":"Categories","placeholder":"Select categories","helper":"Categories are used to filter MCP servers in the directory. Select up to 5.","errors":{"required":"Select at least one category"}},"listing.authorName":{"label":"Author name","reviewLabel":"Author","placeholder":"Acme Inc.","helper":"Shown as “by …” on the listing.","errors":{"required":"An author is required to submit — add one on the Listing step, or fill in your company name and an https:// website to use those"}},"listing.authorUrl":{"label":"Author URL","placeholder":"https://example.com","helper":"If left blank, these default to your company name and website."},"listing.iconUrl":{"label":"Icon","helper":"The directory and Claude show the favicon from your server’s URL; we recommend leaving it at that. A custom icon replaces it in the directory listing only."},"listing.documentationUrl":{"label":"Documentation","placeholder":"https://docs.example.com","helper":"Public-facing docs shown to users. IT admins often review these when deciding whether to approve an MCP server.","errors":{"required":"This field is required"}},"listing.enterpriseAuthDocsUrl":{"label":"Enterprise managed auth documentation","placeholder":"https://docs.example.com/setup","helper":"Setup instructions for admins configuring enterprise managed auth for this connector. Linked from the admin setup flow."},"listing.support":{"label":"Support","reviewLabel":"Support URL","placeholder":"support@example.com or https://support.example.com","helper":"A support URL or email address.","errors":{"required":"This field is required"}},"listing.privacyPolicyUrl":{"label":"Privacy policy","placeholder":"https://example.com/privacy","errors":{"required":"This field is required"}},"useCases.pairs":{"label":"Use cases","helper":"Shown to reviewers, not on your public listing.","errors":{"required":"Add at least one use case with an example prompt"}},"useCases.prerequisites":{"label":"Prerequisites","placeholder":"A paid Acme account with admin permissions","helper":"The accounts, permissions or setup a user needs before connecting. Shown to reviewers.","errors":{"required":"This field is required"}},"useCases.access":{"label":"Read/write capabilities","helper":"Based on what your tools do; we check it against their annotations.","options":[{"value":"read-only","label":"Read only","help":"Retrieves data but never modifies it"},{"value":"write-only","label":"Write only","help":"Creates or modifies data but does not read it"},{"value":"read-write","label":"Read and write","help":"Both retrieves and modifies data"}],"errors":{"required":"This field is required"}},"company.name":{"label":"Company name","errors":{"required":"This field is required"}},"company.website":{"label":"Company website","placeholder":"https://example.com","errors":{"required":"This field is required"}},"company.contactName":{"label":"Full name","reviewLabel":"Primary contact","errors":{"required":"This field is required"}},"company.contactEmail":{"label":"Email","reviewLabel":"Contact email","helper":"Prefilled from your Claude account.","errors":{"required":"This field is required"}},"company.role":{"label":"Role","placeholder":"Software Engineer"},"company.anthropicContact":{"label":"Anthropic contact","placeholder":"Name or email (optional)","helper":"If you’ve been working with someone at Anthropic, let us know who."},"authentication.requirement":{"label":"Authentication requirement","options":[{"value":"always","label":"Always required","help":"Users connect and sign in before any tools or resources are available."},{"value":"when-asked","label":"Required when the server asks","help":"Claude connects without credentials first, then prompts to sign in if the server requires it."},{"value":"none","label":"None","help":"Anyone can use this server without signing in or providing credentials."}],"errors":{"required":"This field is required"}},"authentication.oauthClient":{"label":"OAuth client","options":[{"value":"dcr","label":"Dynamic Client Registration","help":"Clients register themselves with the server (RFC 7591)"},{"value":"cimd","label":"Client ID Metadata Document","help":"The server accepts a published client metadata URL"},{"value":"anthropic-held","label":"Anthropic-held client credentials","help":"Anthropic stores one client ID used for every connection"},{"value":"bring-your-own","label":"Installers bring their own OAuth client","help":"Each organization supplies a client ID it registered with the server"}],"errors":{"required":"This field is required"}},"dataHandling.apiOwnership":{"label":"API ownership","options":[{"value":"own","label":"We own the API","help":"The MCP server calls our own production APIs"},{"value":"partner-proxy","label":"We proxy a partner’s API with permission","help":"Calls go to a third-party API we’re authorized to integrate (e.g. Zapier-style)"},{"value":"third-party","label":"Calls a third-party API we don’t control","help":"Typically blocks listing — explain in Additional notes"}],"errors":{"required":"This field is required"}},"dataHandling.healthData":{"label":"Personal health data","helper":"Does this MCP server access, process, or store personal health information?","options":[{"value":"no","label":"No"},{"value":"yes","label":"Yes"},{"value":"depends","label":"Other / depends on configuration"}],"errors":{"required":"This field is required"}},"dataHandling.sponsored":{"label":"Sponsored or promoted content","reviewLabel":"Sponsored content","helper":"Sponsored, promoted, and advertising content is prohibited in the directory. Does this MCP server surface any?","options":[{"value":"no","label":"No"},{"value":"yes","label":"Yes"},{"value":"other","label":"Other"}],"errors":{"required":"This field is required"}},"testLaunch.instructions":{"label":"Test setup instructions","placeholder":"Sign up at example.com/signup with email reviewer@anthropic.com, then connect via OAuth using client_id=...","helper":"We reserve the right to manually review all servers. Provide clear test-account setup and access instructions. We’re working to automate this process to reduce the time it takes to get your server into the directory — write these instructions so they contain every link, credential, and step needed to autonomously access the MCP server. For enterprise accounts or servers that require a fully populated account, provide test credentials that grant access to a fully populated account for review."},"testLaunch.selfTested":{"label":"I have run every tool via MCP Inspector or as a custom connector in Claude","reviewLabel":"Self-tested"},"testLaunch.identityTool":{"label":"Identity tool","placeholder":"whoami","helper":"A read-only tool on your server that returns the signed-in account. MCPJam calls it as the reviewer."},"testLaunch.identityArgs":{"label":"Identity tool arguments","placeholder":"{}","helper":"Fixed JSON arguments, if the identity tool takes any."},"testLaunch.expectedIdentityPath":{"label":"Identity path","placeholder":"$.user.email","helper":"Where the tool's result names the account, as a JSON path."},"testLaunch.expectedIdentity":{"label":"Expected reviewer","placeholder":"review@example.com","helper":"The account reviewers sign in as."},"testLaunch.expectedOrganizationPath":{"label":"Organization path","placeholder":"$.organization.name","helper":"Where the tool's result names the organization or project, as a JSON path."},"testLaunch.expectedOrganization":{"label":"Expected organization","placeholder":"Sample Org","helper":"The organization or project reviewers should land in."},"testLaunch.fixtures":{"label":"Fixtures","helper":"Resources your instructions name, each with a read-only tool call that finds it in the reviewer's account."},"compliance.acknowledgments":{"label":"Policy acknowledgements","reviewLabel":"Policies acknowledged","options":[{"value":"developer-guidelines","label":"I have read and understand the MCP Directory developer guidelines."},{"value":"first-party-apis","label":"My server calls our own first-party APIs (or APIs we legitimately proxy with permission)."},{"value":"no-financial-transfers","label":"My MCP server does not transfer money, cryptocurrency, or other financial assets on a user’s behalf."},{"value":"no-generated-media","label":"My MCP server does not use AI models to generate images, video, or audio."},{"value":"clean-tool-descriptions","label":"Tool descriptions contain no instructions about model behavior, other tools, or external instruction sources, and no hidden or encoded text."},{"value":"minimal-conversation-data","label":"My MCP server does not collect conversation data beyond what is needed for its function."},{"value":"public-docs-by-launch","label":"Public documentation for this MCP server will be live by the publish date."}],"errors":{"required":"All policy items must be acknowledged","tooFew":"All policy items must be acknowledged"}},"compliance.additionalNotes":{"label":"Additional notes","reviewLabel":"Additional information","helper":"Optional. Anything else the review team should know about your MCP server."}}`),BR=[{step:"connection",field:"connection.serverUrl",needs:[],reads:["connection.serverUrl"],checks:["claude.endpoint.https"]},{step:"connection",field:"connection.serverUrl",needs:["server"],reads:["connection.serverUrl"],checks:["claude.endpoint.redirects-stay-https","claude.endpoint.redirects-terminate"]},{step:"tools",needs:["server"],reads:["connection.serverUrl"],checks:["claude.tools.name-length","claude.tools.title-present","claude.tools.behavior-hints-present","claude.tools.behavior-hints-consistent","claude.tools.no-catch-all-read-write","claude.tools.free-string-operation-parameter","claude.apps.resource-uri-modern","claude.apps.html-mime-profile","claude.apps.openai-only-widget","claude.apps.ui-domain-derivation","claude.apps.ui-domain-recommended-for-app-oauth","claude.apps.csp-shape","claude.apps.result-size-budget","claude.apps.instance-supersession","claude.apps.design.doctype","claude.apps.design.responsive-320","claude.apps.design.touch-targets","claude.apps.design.safe-area","claude.apps.design.theming","claude.apps.design.transparent-background","claude.apps.design.nested-scrolling","claude.apps.design.accessibility","claude.apps.design.display-mode"]},{step:"tools",needs:["server","model"],reads:["connection.serverUrl"],checks:["claude.experience.tool-descriptions-uninformative","claude.experience.tool-overlap","claude.experience.connector-purpose-unclear","claude.experience.destructive-tool-underexplained","claude.experience.app-copy-mismatched","both.decision.annotation-matches-behaviour"]},{step:"listing",needs:["server","model"],reads:["connection.serverUrl"],checks:["claude.experience.listing-copy-placeholder"]},{step:"listing",needs:[],reads:["listing.name","listing.slug","listing.oneLiner","listing.description","listing.categories","listing.authorName","company.name","company.website"],checks:["claude.submission.listing-fields"]},{step:"listing",needs:[],reads:["listing.documentationUrl","listing.privacyPolicyUrl","listing.support","listing.authorUrl","listing.iconUrl","listing.enterpriseAuthDocsUrl"],checks:["claude.submission.urls"]},{step:"listing",needs:[],reads:[],checks:["claude.submission.screenshots","claude.submission.screenshot-prompts"]},{step:"useCases",field:"useCases.access",needs:["server"],reads:["useCases.access","connection.serverUrl"],checks:["claude.submission.access-matches-annotations"]},{step:"useCases",field:"useCases.pairs",needs:[],reads:["useCases.pairs","useCases.prerequisites"],checks:["claude.submission.use-cases"]},{step:"company",needs:[],reads:["company.name","company.website","company.contactName","company.contactEmail"],checks:["claude.submission.company"]},{step:"authentication",field:"authentication.requirement",needs:[],reads:["authentication.requirement","authentication.oauthClient"],checks:["claude.submission.authentication"]},{step:"authentication",field:"authentication.requirement",needs:["server"],reads:["connection.serverUrl"],checks:["claude.auth.unauthenticated-challenge","claude.features.lazy-authentication"]},{step:"authentication",needs:["server"],reads:["connection.serverUrl"],checks:["claude.auth.challenge-names-resource-metadata","claude.auth.no-challenge-on-successful-operation","claude.auth.prm-discoverable","claude.auth.prm-resource-matches-entered-url","claude.auth.first-authorization-server-usable","claude.auth.pkce-s256-advertised","claude.auth.cimd-flag-consistent","claude.features.enterprise-managed-auth"]},{step:"authentication",field:"authentication.oauthClient",needs:["server"],reads:["connection.serverUrl","authentication.requirement","authentication.oauthClient"],checks:["claude.auth.client-acquisition-path","claude.submission.declared-auth-mode"]},{step:"authentication",needs:["server","reviewer"],reads:["connection.serverUrl"],checks:["claude.auth.rfc8707-resource-canonical","claude.auth.insufficient-scope-challenge-shape","claude.auth.access-token-audience","claude.intrusive.dynamic-registration","claude.intrusive.refresh-rotation","claude.intrusive.step-up-challenge"]},{step:"authentication",needs:["server","model"],reads:["connection.serverUrl"],checks:["claude.experience.consent-scope-unclear"]},{step:"dataHandling",needs:[],reads:["dataHandling.apiOwnership","dataHandling.healthData","dataHandling.sponsored"],readsConfirmation:!0,checks:["claude.submission.data-handling"]},{step:"testLaunch",field:"testLaunch.instructions",needs:[],reads:["testLaunch.instructions","authentication.requirement"],checks:["claude.submission.test-instructions"]},{step:"testLaunch",field:"testLaunch.identityTool",needs:["server","reviewer"],reads:["connection.serverUrl","testLaunch.identityTool","testLaunch.identityArgs","testLaunch.expectedIdentityPath","testLaunch.expectedIdentity","testLaunch.expectedOrganizationPath","testLaunch.expectedOrganization"],checks:["both.reviewer.identity"]},{step:"testLaunch",field:"testLaunch.fixtures",needs:["server","reviewer"],reads:["connection.serverUrl","testLaunch.fixtures","testLaunch.instructions","useCases.pairs","testLaunch.identityTool","testLaunch.identityArgs","testLaunch.expectedIdentityPath","testLaunch.expectedIdentity","testLaunch.expectedOrganizationPath","testLaunch.expectedOrganization"],checks:["both.reviewer.fixtures"]},{step:"authentication",needs:["server"],reads:["connection.serverUrl"],checks:["both.auth.client-signatures"]},{step:"compliance",field:"compliance.acknowledgments",needs:[],reads:["compliance.acknowledgments"],readsConfirmation:!0,checks:["claude.submission.attestations"]},{step:"compliance",field:"compliance.acknowledgments",needs:["server"],reads:["connection.serverUrl"],checks:["claude.scan.cross-tool-direction-candidates"]},{step:"compliance",field:"compliance.acknowledgments",needs:["server","model"],reads:["connection.serverUrl"],checks:["claude.decision.cross-tool-direction"]},{step:"review",needs:[],reads:["dataHandling.apiOwnership","dataHandling.healthData","dataHandling.sponsored"],checks:["claude.submission.artifact-quality"]},{step:"review",needs:[],reads:["useCases.access","dataHandling.apiOwnership","dataHandling.healthData","dataHandling.sponsored","testLaunch.selfTested","compliance.acknowledgments"],readsConfirmation:!0,checks:["claude.submission.declarations-confirmed"]},{step:"review",needs:[],reads:["connection.serverUrl","connection.differentUrls","useCases.access","company.role","company.anthropicContact","testLaunch.instructions","testLaunch.selfTested","compliance.additionalNotes"],readsConfirmation:!0,checks:["claude.submission.other-answers"]}],VR={"runtime-compatibility":"connection","directory-policy":"tools","optional-features":"authentication","submission-artifacts":"listing","experience-insights":"tools"},ss={title:zR,steps:FR,fields:HR,placements:BR,laneSteps:VR},GR=ss.fields,lm=ss.steps,Pn={declaration:!0},qs={format:"https-url"};function ot(e,t={}){return{control:e,required:!0,...t}}function xt(e,t={}){return{control:e,...t}}var WR={"connection.serverUrl":ot("server",{format:"url"}),"connection.differentUrls":xt("checkbox"),"listing.name":ot("text",{maxLength:Wt.nameMaxLength}),"listing.slug":ot("text",{format:"slug"}),"listing.oneLiner":ot("text",{maxLength:Wt.oneLinerMaxLength}),"listing.description":ot("textarea",{maxLength:Wt.descriptionMaxLength}),"listing.categories":ot("multi-select",{freeEntry:!0,minItems:Wt.categoriesMin,maxItems:Wt.categoriesMax}),"listing.authorName":ot("text",{requiredOn:"review",satisfiedBy:[{key:"company.name"},{key:"company.website",format:"https-url"}]}),"listing.authorUrl":xt("text",qs),"listing.iconUrl":xt("text",qs),"listing.documentationUrl":ot("text",qs),"listing.enterpriseAuthDocsUrl":xt("text",qs),"listing.support":ot("text",{format:"url-or-email"}),"listing.privacyPolicyUrl":ot("text",qs),"useCases.pairs":ot("pairs",{pairs:{columns:["Use case","Example prompt"],keys:["useCase","examplePrompt"],placeholders:[["Look up a product","What sizes are in stock at the Portland store?"],["Compare prices","Which fall items are marked down more than 30%?"],["Draft a product listing","Create a draft listing for the canvas tote."]],maxRows:Wt.useCasesMax}}),"useCases.prerequisites":ot("textarea"),"useCases.access":ot("radio",{...Pn,default:"read-only"}),"company.name":ot("text",{prefill:"organization-name"}),"company.website":ot("text",{format:"url"}),"company.contactName":ot("text",{prefill:"account-name"}),"company.contactEmail":ot("text",{format:"email",prefill:"account-email"}),"company.role":xt("text"),"company.anthropicContact":xt("text"),"authentication.requirement":ot("radio",{default:"always"}),"authentication.oauthClient":ot("radio",{default:"dcr"}),"dataHandling.apiOwnership":ot("radio-cards",{...Pn,default:"own"}),"dataHandling.healthData":ot("radio",{...Pn,default:"no"}),"dataHandling.sponsored":ot("radio",Pn),"testLaunch.instructions":xt("textarea"),"testLaunch.selfTested":xt("checkbox",Pn),"testLaunch.identityTool":xt("text",{requiredWith:["testLaunch.expectedIdentity","testLaunch.expectedOrganization"]}),"testLaunch.identityArgs":xt("text"),"testLaunch.expectedIdentityPath":xt("text",{requiredWith:["testLaunch.expectedIdentity"]}),"testLaunch.expectedIdentity":xt("text",{requiredWith:["testLaunch.expectedIdentityPath"]}),"testLaunch.expectedOrganizationPath":xt("text",{requiredWith:["testLaunch.expectedOrganization"]}),"testLaunch.expectedOrganization":xt("text",{requiredWith:["testLaunch.expectedOrganizationPath"]}),"testLaunch.fixtures":xt("pairs",{pairs:Ty}),"compliance.acknowledgments":ot("checkbox-group",{...Pn,minItems:ss.fields["compliance.acknowledgments"].options.length}),"compliance.additionalNotes":xt("textarea")},wB={id:"claude-connector",directory:"claude",title:ss.title,version:"2026-11-13",source:{label:"Claude directory portal: Submit an MCP connector",url:"https://claude.ai/directory/manage",capturedAt:"2026-11-13"},submissionUrl:"https://claude.ai/directory/manage",steps:Object.keys(lm).map(e=>({id:e,...lm[e],fields:Cy(e,WR,GR)})),placements:Py("claude-connector.json",ss.placements),laneSteps:ss.laneSteps};function Bp(e){return e.class==="required"||e.class==="runtime-blocker"}var EB=Object.freeze({maxQuestionsPerRun:24,maxKeyChars:200,maxNameChars:200,maxFieldChars:300,maxTextChars:2e3,maxReferences:10,maxQuoteChars:400}),JR=String.raw`(?:call|invoke|run|use|execute|trigger|poll|retry|re-?run|chain|pair|combine)`,kB=String.raw`(?:calling|using|running|invoking|executing|polling)`,KR=String.raw`(?:get|obtain|fetch|retrieve|look\s+up|find|read|take|copy|resolve|discover|check|verify|confirm|inspect|track|monitor|pass|provide|supply|send|feed|forward|hand|give|submit|${JR})`,YR=String.raw`(?:^|[,;:(\u2013\u2014]\s*|\s-\s+|\b(?:and|or|then|so|to|first|next|finally|afterwards|always|also|instead|otherwise|please|only|now|immediately)\s+)`,XR=String.raw`\b(?:must|should|shall|can|may|need\s+to|needs\s+to|have\s+to|has\s+to|be\s+sure\s+to|make\s+sure\s+to|remember\s+to|(?:do\s+not|don't)\s+forget\s+to|want\s+to)\s+(?:not\s+|also\s+|first\s+|always\s+|then\s+|still\s+)?`,IB=String.raw`(?:(?:the|a|an|this|that|it|its|tool|tools|first|also|again|only|then|always|now|before|after|with|together|alongside|along|instead|of|to|right|immediately|once|back)\s+){0,4}`,AB=String.raw`[^.;:!?,]{0,30}?`,RB=String.raw`(?:from|with|using|via|through|to|into|by\s+calling|by\s+running|returned\s+by|produced\s+by|output\s+(?:of|from)|result\s+of|response\s+(?:of|from))`,TB=String.raw`(?:before|after|once|until|prior\s+to|together\s+with|alongside|instead\s+of|in\s+place\s+of|rather\s+than)`,CB=new RegExp(`${YR}(?:${KR}|confirm|ask|wait|stop|ensure|tell|show|list|try|avoid|save|create|delete|update|refresh|compare)\\b|${XR}\\w`,"i"),Wc=e=>new RegExp(`\\b(?:${e})(?:e|es|ed|ing|s)?\\b`,"i"),PB=Wc("creat|add|insert|updat|edit|modif(?:y|ies|ied|ying)|chang|sav|writ|written|send|sent|post|publish|submit|submitt|upload|delet|remov|archiv|mov|renam|cancel|cancell|schedul|purchas|pay|paid|transfer|transferr|deploy|install|trigger|overwrit|overwritten"),OB=Wc("get|list|read|fetch|retriev|search|find|view|show|return|quer(?:y|ies|ied|ying)|inspect|describ|count|lookup"),xB=Wc("delet|remov|overwrit|overwritten|drop|dropp|destroy|eras|purg|wip|truncat|revok|replac|permanently|irreversibl"),MB=Wc("creat|add|insert|append|increment|generat|send|sent|post|submit|submitt"),LB=Object.freeze({maxTools:500,maxCases:1500,maxFixtures:50,maxCleanupSteps:50,maxIdLength:200,maxPlanLength:524288,maxCalls:3e3,maxConcurrency:4,minCallTimeoutMs:1e3,maxCallTimeoutMs:12e4});function ZR(e){const t=[];return ad(e,r=>{t.push(r)}),t}function QR(e){if(typeof e!="object"||e===null||Array.isArray(e))return;const{$fixture:t,value:r}=e;if(typeof t=="string")return{fixture:t,value:typeof r=="string"?r:""}}function ad(e,t){const r=QR(e);return r?t(r):Array.isArray(e)?e.map(i=>ad(i,t)):typeof e=="object"&&e!==null?Object.fromEntries(Object.entries(e).map(([i,n])=>[i,ad(n,t)])):e}function $B(e){const t=new Map(e.tools.map(a=>[a.tool,a])),r=a=>{const c=t.get(a.tool),l=c?.effect??"destructive";return(l==="destructive"?3:a.creates?.length?0:l==="read"?1:2)*2+(c?.openWorld===!1?0:1)},i=new Set(e.cases.flatMap(a=>a.creates??[])),n=e.cases.map((a,c)=>({testCase:a,index:c,rank:r(a),needs:ZR(a.arguments).map(l=>l.fixture).filter(l=>i.has(l)&&!a.creates?.includes(l))})).sort((a,c)=>a.rank-c.rank||a.index-c.index),s=new Set,o=[];for(;n.length>0;){const a=n.findIndex(({needs:l})=>l.every(u=>s.has(u))),[c]=n.splice(Math.max(a,0),1);o.push(c.testCase);for(const l of c.testCase.creates??[])s.add(l)}return o}var eT=e=>e/2**32|0,tT=e=>e>>>0;function rT(e,t,r,i){const n=eT(r),s=tT(r);e.setUint32(t,i?s:n,i),e.setUint32(t+4,i?n:s,i)}function um(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}var cd=e=>e?`"${e}" `:"";function iT(e,t=""){if(typeof e!="number")throw new TypeError(cd(t)+"expected number, got "+typeof e);if(!Number.isSafeInteger(e)||e<0)throw new RangeError(cd(t)+"expected integer >= 0, got "+e);return e}function Vp(e,t,r=""){if(um(e)&&(t===void 0||e.length===t))return e;t!==void 0&&iT(t,"length");const i=um(e),n=t!==void 0?` of length ${t}`:"",s=i?`length=${e.length}`:`type=${typeof e}`,o=cd(r)+"expected Uint8Array"+n+", got "+s;throw i?new RangeError(o):new TypeError(o)}var nT=(e,t)=>{if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError((t==="object"?"":`"${t}" `)+"expected object, got type="+typeof e)},dm=(e,t)=>{nT(e,t);const r=Object.getPrototypeOf(e);if(r!==Object.prototype&&r!==null)throw new TypeError(`"${t}" expected plain object`);if(Object.hasOwn(e,"__proto__"))throw new TypeError(`"${t}.__proto__" is not allowed`)};function pm(e,t=!0){if(e.destroyed)throw new Error("hash was destroyed");if(t&&e.finished)throw new Error("digest() was already called")}function sT(e,t){Vp(e,void 0,"output");const r=t.outputLen;if(!(e.length>=r))throw new RangeError('"output" expected length >= '+r)}function ld(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Bl(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function kr(e,t){return e<<32-t|e>>>t}var oT=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",aT=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function cT(e){if(Vp(e),oT)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=aT[e[r]];return t}function lT(e){if(typeof e!="string")throw new TypeError("string expected");const t=new TextEncoder().encode(e);try{return new Uint8Array(t)}finally{ld(t)}}function uT(e,t,r="opts"){return dm(e,"defaults"),t!==void 0&&dm(t,r),Object.assign(Object.create(null),e,t)}function dT(e,t={}){if(typeof e!="function")throw new TypeError('"hashCons" expected function, got type='+typeof e);t=uT({},t,"info");const r=(n,s)=>e(s).update(n).digest(),i=e(void 0);return r.outputLen=i.outputLen,r.blockLen=i.blockLen,r.canXOF=i.canXOF,r.create=n=>e(n),Object.assign(r,t),Object.freeze(r)}var pT=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function hT(e,t,r){return e&t^~e&r}function fT(e,t,r){return e&t^e&r^t&r}var mT=class{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,t,r,i){this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=i,this.buffer=new Uint8Array(e),this.view=Bl(this.buffer)}update(e){pm(this),Vp(e);const{view:t,buffer:r,blockLen:i}=this,n=e.length;let s=!1;for(let o=0;o<n;){const a=Math.min(i-this.pos,n-o);if(a===i){const c=Bl(e);for(;i<=n-o;o+=i)this.process(c,o);s=!0;continue}r.set(o===0&&a===n?e:e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===i&&(this.process(t,0),this.pos=0,s=!0)}return this.length+=e.length,s&&this.roundClean(),this}digestInto(e){pm(this),sT(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:i,isLE:n}=this;let{pos:s}=this;t[s++]=128,t.fill(0,s),this.padOffset>i-s&&(this.process(r,0),t.fill(0)),rT(r,i-8,this.length*8,n),this.process(r,0),this.roundClean();const o=e===t?r:Bl(e),a=this.outputLen,c=a/4,l=this.get();if(a%4||c>l.length)throw new Error("invalid outputLen");for(let u=0;u<c;u++)o.setUint32(4*u,l[u],n)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneIntoMeta(e){const{buffer:t,length:r,finished:i,destroyed:n,pos:s}=this;return e.destroyed=n,e.finished=i,e.length=r,e.pos=s,s&&e.buffer.set(t),e}clone(){return this._cloneInto()}},gT=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),vT=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),oi=new Uint32Array(64),_T=class extends mT{A=0;B=0;C=0;D=0;E=0;F=0;G=0;H=0;constructor(e,t){super(64,e,8,!1),this.A=t[0]|0,this.B=t[1]|0,this.C=t[2]|0,this.D=t[3]|0,this.E=t[4]|0,this.F=t[5]|0,this.G=t[6]|0,this.H=t[7]|0}get(){const{A:e,B:t,C:r,D:i,E:n,F:s,G:o,H:a}=this;return[e,t,r,i,n,s,o,a]}set(e,t,r,i,n,s,o,a){this.A=e|0,this.B=t|0,this.C=r|0,this.D=i|0,this.E=n|0,this.F=s|0,this.G=o|0,this.H=a|0}_cloneInto(e){return(e||=new this.constructor).set(...this.get()),this._cloneIntoMeta(e)}process(e,t){for(let u=0;u<16;u++,t+=4)oi[u]=e.getUint32(t,!1);for(let u=16;u<64;u++){const p=oi[u-15],d=oi[u-2],h=kr(p,7)^kr(p,18)^p>>>3,f=kr(d,17)^kr(d,19)^d>>>10;oi[u]=f+oi[u-7]+h+oi[u-16]|0}let{A:r,B:i,C:n,D:s,E:o,F:a,G:c,H:l}=this;for(let u=0;u<64;u++){const p=kr(o,6)^kr(o,11)^kr(o,25),d=l+p+hT(o,a,c)+vT[u]+oi[u]|0,h=(kr(r,2)^kr(r,13)^kr(r,22))+fT(r,i,n)|0;l=c,c=a,a=o,o=s+d|0,s=n,n=i,i=r,r=d+h|0}r=r+this.A|0,i=i+this.B|0,n=n+this.C|0,s=s+this.D|0,o=o+this.E|0,a=a+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(r,i,n,s,o,a,c,l)}roundClean(){ld(oi)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),ld(this.buffer)}},yT=class extends _T{constructor(){super(32,gT)}},bT=dT(()=>new yT,pT(1));function ST(e){return Bp(e)}var wT=["experience"];var ET=["claude.experience.tool-descriptions-uninformative","claude.experience.tool-overlap","claude.experience.connector-purpose-unclear","claude.experience.consent-scope-unclear","claude.experience.listing-copy-placeholder","claude.experience.destructive-tool-underexplained","claude.experience.app-copy-mismatched"],NB=Object.freeze({readinessKind:"claude-directory-readiness",observationKinds:wT,knownIds:ET,schemaVersion:"1"}),kT=[{id:"claude.experience.tool-descriptions-uninformative",title:"Tool descriptions may not tell Claude when to use the tool",lane:"experience-insights",class:"heuristic",source:pi("review-criteria","§Tool quality"),remediation:"Describe when a tool should be reached for, not only what it does; Claude picks tools from these sentences."},{id:"claude.experience.tool-overlap",title:"Two or more tools may cover the same job",lane:"experience-insights",class:"heuristic",source:pi("review-criteria","§Tool quality"),remediation:"Overlapping tools make selection ambiguous; consider merging them or sharpening what separates them."},{id:"claude.experience.connector-purpose-unclear",title:"What this connector is for may not be clear from its surface",lane:"experience-insights",class:"manual-review",source:pi("review-criteria","§Usefulness"),remediation:"A reviewer should be able to say what the connector is for from the listing and the tool names alone."},{id:"claude.experience.consent-scope-unclear",title:"It may not be clear to a user what they are authorizing",lane:"experience-insights",class:"manual-review",source:pi("authentication","§Consent"),remediation:"State which account is connected and what scope it grants, in the copy the user sees at consent time."},{id:"claude.experience.listing-copy-placeholder",title:"Listing copy may still contain placeholder text",lane:"experience-insights",class:"manual-review",source:pi("submission","§Listing"),remediation:"Review the listing fields for template text before submitting; reviewers reject placeholder copy."},{id:"claude.experience.destructive-tool-underexplained",title:"A destructive tool may not explain its consequences",lane:"experience-insights",class:"manual-review",source:pi("review-criteria","§Safety"),remediation:"Say plainly in the description what a destructive tool changes and whether it can be undone."},{id:"claude.experience.app-copy-mismatched",title:"An app's rendered copy may not match what its tool returns",lane:"experience-insights",class:"heuristic",source:pi("mcp-apps/design-guidelines","§Content"),remediation:"A widget that says something different from the tool's text response leaves the model and the user disagreeing."}],DB=Object.freeze({experienceLane:"experience-insights",engineVersion:"1",mappings:kT}),On={serverUrl:"serverUrl",pluginBundle:"pluginBundle",submissionProfile:"submissionProfile",draftSnapshot:"draftSnapshot",publishedSnapshot:"publishedSnapshot",toolListing:"toolListing",importedSkills:"importedSkills"},UB=Object.freeze({"skills-only":{hasMcpServer:!1,hasUploadedPackage:!0,hasImportedSkills:!1,requiredInputs:[On.pluginBundle],summary:"a skills package with no MCP server"},"mcp-only":{hasMcpServer:!0,hasUploadedPackage:!1,hasImportedSkills:!1,requiredInputs:[On.serverUrl],summary:"an MCP endpoint with no uploaded package"},"mcp-imported-skills":{hasMcpServer:!0,hasUploadedPackage:!1,hasImportedSkills:!0,requiredInputs:[On.serverUrl,On.importedSkills],summary:"an MCP endpoint whose skills are imported at scan time"},"mcp-uploaded-skills":{hasMcpServer:!0,hasUploadedPackage:!0,hasImportedSkills:!1,requiredInputs:[On.serverUrl,On.pluginBundle],summary:"an MCP endpoint plus an uploaded skills package"}}),qB=Object.freeze({"technical-preflight":["runtime-compatibility","directory-policy","plugin-package"],"submission-ready":["runtime-compatibility","directory-policy","plugin-package","submission-artifacts","release-contract"]});function IT(e){return typeof e=="object"&&e!==null&&e.readinessKind==="openai-directory-readiness"}var AT=["experience"];var RT=["openai.experience.tool-descriptions-uninformative","openai.experience.tool-overlap","openai.experience.naming-inconsistent","openai.experience.listing-copy-placeholder","openai.experience.listing-copy-overpromises","openai.experience.skill-overlap","openai.experience.destructive-tool-underexplained","openai.experience.auth-story-unclear"],jB=Object.freeze({readinessKind:"openai-directory-readiness",observationKinds:AT,knownIds:RT,schemaVersion:"1"}),TT=[{id:"openai.experience.tool-descriptions-uninformative",title:"Tool descriptions may not tell the model when to use the tool",lane:"experience-insights",class:"heuristic",source:gr("guides/optimize-metadata","§Tool descriptions"),remediation:"Describe when a tool should be reached for, not only what it does; the model picks tools from these sentences."},{id:"openai.experience.tool-overlap",title:"Two or more tools may cover the same job",lane:"experience-insights",class:"heuristic",source:gr("plan/tools","§Naming"),remediation:"Overlapping tools make selection ambiguous; consider merging them or sharpening the descriptions that separate them."},{id:"openai.experience.naming-inconsistent",title:"Tool names may not follow one convention",lane:"experience-insights",class:"heuristic",source:gr("plan/tools","§Naming"),remediation:"Pick one naming convention across the whole surface; mixed conventions read as two servers merged."},{id:"openai.experience.listing-copy-placeholder",title:"Listing copy may still contain placeholder text",lane:"experience-insights",class:"manual-review",source:gr("plugin-guidelines","§Listing quality"),remediation:"Review the listing fields for template text before submitting; reviewers reject placeholder copy."},{id:"openai.experience.listing-copy-overpromises",title:"Listing copy may claim capabilities the tools do not implement",lane:"experience-insights",class:"manual-review",source:gr("plugin-guidelines","§Listing quality"),remediation:"Check that every capability the listing advertises is reachable through a tool this server actually exposes."},{id:"openai.experience.skill-overlap",title:"Two or more skills may describe the same task",lane:"experience-insights",class:"heuristic",source:gr("plugin-guidelines","§Listing quality"),remediation:"Skills that overlap compete for the same trigger; separate their scopes or fold them together."},{id:"openai.experience.destructive-tool-underexplained",title:"A destructive tool may not explain its consequences",lane:"experience-insights",class:"manual-review",source:gr("plugin-guidelines","§Predictable side effects"),remediation:"Say plainly in the description what a destructive tool changes and whether it can be undone."},{id:"openai.experience.auth-story-unclear",title:"It may not be clear to a user what they are authorizing",lane:"experience-insights",class:"manual-review",source:gr("build/auth","§Consent"),remediation:"State which account is connected and what scope it grants, in the copy the user sees at consent time."}],zB=Object.freeze({experienceLane:"experience-insights",engineVersion:"2",mappings:TT}),CT=["oauth-dcr","oauth-cimd","oauth-preregistered","static-header","authless","custom-connection"],PT=["no-user-data","processes-user-data","stores-user-data","shares-with-third-parties"],OT=["ownsOrIsAuthorizedForService","accurateDataHandlingDisclosure","compliesWithUsagePolicies","noProhibitedContent","maintainsSecurityPractices","respondsToSecurityReports","keepsListingAccurate"],da=w().url().refine(e=>e.startsWith("https://"),{message:"must be an https:// URL"}),xT=ee({url:w().min(1),mimeType:w().min(1),widthPx:Le().int().positive(),heightPx:Le().int().positive(),prompt:w().min(1)}),FB=ee({name:w().min(1).max(Wt.nameMaxLength),tagline:w().min(1).max(Wt.oneLinerMaxLength),description:w().min(1).max(Wt.descriptionMaxLength),categories:Q(w().min(1)).min(Wt.categoriesMin).max(Wt.categoriesMax),slug:w().min(1).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/,"must be a lowercase kebab-case slug"),documentationUrl:da,privacyPolicyUrl:da,supportUrl:da,iconUrl:da,declaredAuthMode:it(CT),dataHandling:Q(it(PT)).min(1),screenshots:Q(xT).min(Wt.screenshotsMin).max(Wt.screenshotsMax),attestations:Je(it(OT),Oe())}),MT=FA;function Bt(e){return e.rows.map(t=>{const r=t.indexOf(": "),i=t.slice(0,r),n=e.targets?.[i];return{code:i,table:e.table,stage:e.stage,severity:e.severity??(e.warnings?.includes(i)?"warning":"error"),message:t.slice(r+2),...n?.field===void 0?{}:{document:e.document},...n,source:MT}})}var ir={kind:"present"},He={kind:"nonEmpty"},sn={kind:"nonEmpty",required:!0},ur={kind:"text"},Wn={kind:"text",singleLine:!0},Oo=(...e)=>({kind:"type",types:e}),qe=Oo("string"),ni=Oo("object"),ud=Oo("boolean"),dt=(e,t)=>t===void 0?{kind:"length",max:e}:{kind:"length",max:e,submissionMax:t},jt=e=>({kind:"pattern",pattern:e}),Oy=e=>({kind:"pattern",pattern:e,forbidden:!0}),LT=e=>({kind:"enum",values:e}),hm=e=>({kind:"count",max:e}),x=(e,...t)=>t.length>0?{field:e,rules:t}:{field:e},$e=e=>({path:e}),on="interface.displayName",_i="interface.shortDescription",an="interface.longDescription",bi="interface.developerName",io="interface.capabilities[]",dd="interface.defaultPrompt",no="interface.defaultPrompt[]",ja="(?:0|[1-9]\\d*)",fm=`(?:${ja}|\\d*[A-Za-z-][0-9A-Za-z-]*)`,$T=new RegExp(`^${ja}\\.${ja}\\.${ja}(?:-${fm}(?:\\.${fm})*)?(?:\\+[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$`),pd=/^#[0-9A-Fa-f]{6}$/,js=/^https:\/\/(?!:)[^\s/?#@]+(?:[/?#]\S*)?$/i,NT=Bt({table:"ZIP upload errors and warnings",stage:"upload",document:"plugin-manifest",warnings:["plugin_version_unchanged","mcp_configuration_excluded","claude_format_normalized","manifest_normalized","developer_name_defaulted"],rows:["plugin_name_mismatch: The package name in an update must match the existing plugin name.","plugin_version_unchanged: A new release must use a different manifest `version`; reusing the published version requires confirmation.","mcp_configuration_excluded: MCP configuration is excluded unless your organization is approved for local MCP submissions. For a local MCP plugin, ask your OpenAI representative to confirm the submitting organization is allowlisted. Submit remote MCP servers through **With MCP**.","app_configuration_excluded: ZIP uploads must not include `apps` or `.app.json`. Submit remote MCP servers through **With MCP**; for local MCP servers, follow the desktop-only submission instructions.","claude_format_normalized: `.claude-plugin/plugin.json` is converted to `.codex-plugin/plugin.json`, with missing interface defaults and normalized text fields added by the portal.","manifest_normalized: The portal saves the normalized manifest as `.codex-plugin/plugin.json`; changed fields require confirmation.","developer_name_defaulted: The listing’s developer name is set automatically from your selected verified developer identity, regardless of the name in your ZIP."],targets:{plugin_name_mismatch:x("name"),plugin_version_unchanged:x("version"),claude_format_normalized:$e(".claude-plugin/plugin.json"),manifest_normalized:$e(".codex-plugin/plugin.json"),developer_name_defaulted:x(bi)}}),DT=Bt({table:"ZIP structure and limit errors",stage:"upload",rows:["archive_empty: Archive must not be empty.","archive_too_large: Compressed ZIP must be 100 MB or less.","archive_format_not_zip: Archive must be a valid, uncorrupted ZIP file.","archive_member_path_empty: Archive entry path must not be empty.","archive_member_path_has_outer_whitespace: Archive entry path must not begin or end with whitespace.","archive_member_path_has_backslash: Archive entry path must use `/`, not backslashes.","archive_member_path_absolute: Archive entry path must be relative to the archive root.","archive_member_path_has_empty_segment: Archive entry path must not contain empty segments.","archive_member_path_has_parent_segment: Archive entry path must not contain `..` segments.","archive_member_path_too_deep: Archive entry path must contain at most 20 segments, including the filename.","archive_member_path_too_long: Archive entry path must be within the supported path-length limit.","archive_member_path_normalization_collision: Archive entry paths must remain unique after case and Unicode normalization.","archive_member_type_unsupported: Archive entries must be regular files or directories.","archive_member_too_large: Archive entry must not exceed 100 MiB.","archive_member_path_duplicate: Archive entry path must be unique.","archive_member_path_type_conflict: A file path cannot also be a directory or contain another archive entry.","archive_too_many_entries: Archive must not contain more than 5,000 entries.","archive_uncompressed_too_large: Extracted archive must not exceed 512 MiB.","archive_member_unreadable: Every archive entry must be readable, must not be encrypted, and must use supported compression."]}),UT=Bt({table:"Plugin root errors",stage:"upload",rows:["plugin_root_missing: The selected path must exist and be a directory containing a plugin.","archive_plugin_files_missing: A ZIP must contain a supported plugin manifest and at least one valid skill (or an approved local MCP server).",`plugin_root_ambiguous: ${xr.plugin_root_ambiguous.message}`,`plugin_root_has_siblings: ${xr.plugin_root_has_siblings.message}`]}),Gr="skills/<skill>/SKILL.md",zs="skills/<skill>/agents/openai.yaml",Vl="interface.display_name",Gl="interface.short_description",mm="interface.icon_small",gm="interface.icon_large",Wl="interface.brand_color",vm="interface.default_prompt",qT="policy.allow_implicit_invocation",jT=Bt({table:"Skill errors",stage:"upload",document:"skill-frontmatter",rows:["skill_manifest_missing: Skill must contain a `SKILL.md` file.","skill_bundle_too_large: Each compressed skill bundle must be within the MiB limit reported in the error.","skill_directory_hidden: Skill directory names must not begin with `.`.","skill_manifest_nested: Each skill directory must be an immediate child of `skills/`.","skill_manifest_not_regular_file: `SKILL.md` must be a regular file.","skill_manifest_unreadable: `SKILL.md` must be readable.","skill_manifest_invalid_utf8: `SKILL.md` must contain valid UTF-8.","skill_frontmatter_missing: `SKILL.md` must start with YAML front matter between `---` lines.","skill_frontmatter_unclosed: `SKILL.md` YAML front matter must end with `---`.","skill_frontmatter_yaml_malformed: `SKILL.md` front matter must contain valid YAML.","skill_frontmatter_wrong_type: `SKILL.md` front matter must contain a YAML mapping.","skill_name_missing: `name` is required and must not be empty.","skill_name_wrong_type: `name` must be a string.","skill_name_empty: `name` must be non-empty.","skill_name_character_unsupported: Skill front matter `name` must use supported text.","skill_description_missing: `description` is required and must not be empty.","skill_description_wrong_type: `description` must be a string.","skill_description_empty: `description` must be non-empty.","skill_description_too_long: `description` must be 1,024 characters or fewer.","skill_description_character_unsupported: Skill front matter `description` must use supported text.","skill_body_empty: Skill instructions must not be empty.","skill_identity_too_long: The combined plugin and skill name (`plugin-name:skill-name`) must be 64 characters or fewer.","skill_identity_duplicate: Each skill `name` must be unique within the plugin."],targets:{skill_manifest_missing:$e(Gr),skill_manifest_not_regular_file:$e(Gr),skill_manifest_unreadable:$e(Gr),skill_manifest_invalid_utf8:$e(Gr),skill_frontmatter_missing:$e(Gr),skill_frontmatter_unclosed:$e(Gr),skill_frontmatter_yaml_malformed:$e(Gr),skill_frontmatter_wrong_type:$e(Gr),skill_name_missing:x("name",ir),skill_name_wrong_type:x("name",qe),skill_name_empty:x("name",He),skill_name_character_unsupported:x("name",ur),skill_description_missing:x("description",ir),skill_description_wrong_type:x("description",qe),skill_description_empty:x("description",He),skill_description_too_long:x("description",dt(1024)),skill_description_character_unsupported:x("description",ur),skill_identity_duplicate:x("name")}}),zT=Bt({table:"Skill agent metadata errors",stage:"upload",document:"skill-agent",rows:["skill_agent_not_regular_file: `agents/openai.yaml` must be a regular file.","skill_agent_unreadable: `agents/openai.yaml` must be readable.","skill_agent_invalid_utf8: `agents/openai.yaml` must contain valid UTF-8.","skill_agent_yaml_malformed: `agents/openai.yaml` must contain valid YAML.","skill_agent_top_level_wrong_type: `agents/openai.yaml` must contain a YAML mapping at the top level.","skill_agent_interface_missing: `interface` is required in `agents/openai.yaml` when that file is included.","skill_agent_interface_wrong_type: `interface` in `agents/openai.yaml` must be a YAML mapping.","skill_agent_display_name_missing: `interface.display_name` is required and must not be empty.","skill_agent_display_name_wrong_type: `interface.display_name` must be a string.","skill_agent_display_name_empty: `interface.display_name` must not be empty.","skill_agent_short_description_missing: `interface.short_description` is required and must not be empty.","skill_agent_short_description_wrong_type: `interface.short_description` must be a string.","skill_agent_short_description_empty: `interface.short_description` must not be empty.","skill_agent_icon_small_wrong_type: `interface.icon_small` must be a non-empty relative file path when provided.","skill_agent_icon_small_empty: `interface.icon_small` must be a non-empty relative file path when provided, such as `assets/icon.png`.","skill_agent_icon_large_wrong_type: `interface.icon_large` must be a non-empty relative file path when provided.","skill_agent_icon_large_empty: `interface.icon_large` must be a non-empty relative file path when provided, such as `assets/icon.png`.","skill_agent_brand_color_wrong_type: `interface.brand_color` must be a string when provided.","skill_agent_brand_color_empty: `interface.brand_color` must be a non-empty six-digit hex color when provided, such as `#1ABCFE`.","skill_agent_brand_color_format: `interface.brand_color` must be a six-digit hex color, such as `#1ABCFE`.","skill_agent_default_prompt_wrong_type: `interface.default_prompt` must be a string when provided.","skill_agent_default_prompt_empty: `interface.default_prompt` must be non-empty when provided.","skill_agent_policy_wrong_type: `policy` must be a YAML mapping when provided.","skill_agent_allow_implicit_invocation_wrong_type: `policy` may contain only `products` and `allow_implicit_invocation`. `products` must contain `CHAT`, `CODEX`, or both, and `allow_implicit_invocation` must be `true` or `false`.","skill_agent_dependencies_wrong_type: `dependencies` must be a YAML mapping; only `tools` is supported.","skill_agent_dependency_unsupported: Only `dependencies.tools` is supported in `agents/openai.yaml`."],targets:{skill_agent_not_regular_file:$e(zs),skill_agent_unreadable:$e(zs),skill_agent_invalid_utf8:$e(zs),skill_agent_yaml_malformed:$e(zs),skill_agent_top_level_wrong_type:$e(zs),skill_agent_interface_missing:x("interface",ir),skill_agent_interface_wrong_type:x("interface",ni),skill_agent_display_name_missing:x(Vl,ir),skill_agent_display_name_wrong_type:x(Vl,qe),skill_agent_display_name_empty:x(Vl,He),skill_agent_short_description_missing:x(Gl,ir),skill_agent_short_description_wrong_type:x(Gl,qe),skill_agent_short_description_empty:x(Gl,He),skill_agent_icon_small_wrong_type:x(mm,qe),skill_agent_icon_small_empty:x(mm,He),skill_agent_icon_large_wrong_type:x(gm,qe),skill_agent_icon_large_empty:x(gm,He),skill_agent_brand_color_wrong_type:x(Wl,qe),skill_agent_brand_color_empty:x(Wl,He),skill_agent_brand_color_format:x(Wl,jt(pd)),skill_agent_default_prompt_wrong_type:x(vm,qe),skill_agent_default_prompt_empty:x(vm,He),skill_agent_policy_wrong_type:x("policy",ni),skill_agent_allow_implicit_invocation_wrong_type:x(qT,ud),skill_agent_dependencies_wrong_type:x("dependencies",ni),skill_agent_dependency_unsupported:x("dependencies")}}),FT=Bt({table:"Asset path errors",stage:"upload",rows:["declared_asset_path_wrong_type: The named asset field must be a file path string.","declared_asset_path_empty: The named asset field must not be empty.","declared_asset_path_has_outer_whitespace: The named asset field must not begin or end with whitespace.","declared_asset_path_has_control_character: The named asset field must not contain characters U+0000–U+001F or U+007F.","branding_asset_path_missing_root_prefix: The named asset field must start with `./`.","declared_asset_path_unsafe: The named asset field must be a relative path inside the plugin and must not contain an absolute path, drive prefix, or `..` traversal segment.","declared_asset_path_outside_package: The named asset field must reference a file inside the plugin.","declared_asset_file_missing: The named asset field references a file that does not exist.","declared_asset_not_regular_file: The named asset field must reference a file, not a directory or special file."]}),HT=Bt({table:"Image errors",stage:"upload",document:"plugin-manifest",rows:["plugin_logo_path_missing: `interface.logo` is required and must reference a square image.","plugin_composer_icon_path_missing: `interface.composerIcon` is required and must reference a square image.","image_file_unreadable: Image file must be readable.","image_file_too_large: Image must not exceed 5 MiB.","image_file_format_unsupported: Image filename must end in `.png`, `.jpg`, `.jpeg`, `.webp`, or `.svg`.","raster_image_decode_failed: Raster image must be a PNG, JPEG, or WebP file that can be decoded safely.","raster_image_extension_content_mismatch: Image filename extension must match the detected image format.","raster_image_not_square: Image must be square.","raster_image_dimensions_too_small: Image dimensions must be at least 48×48 pixels.","raster_image_dimensions_too_large: Image dimensions must not exceed 4,096×4,096 pixels.","svg_xml_malformed: SVG must contain valid UTF-8 XML.","svg_root_element_invalid: SVG root element must be `<svg>`.","svg_dimensions_missing: SVG must define a numeric `viewBox` or numeric `width` and `height`.","svg_dimensions_not_numeric: SVG dimensions must be numeric and omit units and percentages.","svg_dimensions_not_positive: SVG width and height must be positive finite numbers.","svg_dimensions_not_square: SVG dimensions must be square.","svg_dimensions_too_small: SVG dimensions must be at least 48×48 pixels."],targets:{plugin_logo_path_missing:x("interface.logo"),plugin_composer_icon_path_missing:x("interface.composerIcon")}}),BT=Bt({table:"Package warnings",stage:"upload",severity:"warning",rows:["duplicate_app_reference: Each server ID in `.app.json` must be referenced once; duplicate references are treated as one server.","undeclared_app_manifest_ignored: A root `.app.json` is imported only when the plugin-manifest `apps` field is set to `./.app.json`.","undeclared_mcp_manifest_ignored: A root `.mcp.json` is imported only when the plugin-manifest `mcpServers` field is set to `./.mcp.json`.","skill_file_ignored: Files directly under `skills/` aren't imported as skills; each skill must be in a directory containing `SKILL.md`.","skill_symlink_ignored: Symbolic links directly under `skills/` aren't imported as skills; each skill must be a real directory containing `SKILL.md`.","skill_frontmatter_adjusted: Skill `name` and `description` are normalized during import by trimming outer whitespace and collapsing internal whitespace.","skill_metadata_ignored: Skill interface settings must use the `interface` mapping in `agents/openai.yaml`; `metadata` in `SKILL.md` doesn't configure the interface."],targets:{duplicate_app_reference:$e(".app.json"),undeclared_app_manifest_ignored:$e(".app.json"),undeclared_mcp_manifest_ignored:$e(".mcp.json"),skill_file_ignored:$e("skills/"),skill_symlink_ignored:$e("skills/"),skill_metadata_ignored:$e(Gr)}}),VT=["Productivity","Creativity","Developer Tools","Business & Operations","Data & Analytics","Communication","Education & Research","Security","Finance","Healthcare","Travel","Entertainment","Other"],pa="interface.category",GT=LT(VT),_m="interface.capabilities",ha="interface.websiteURL",fa="interface.privacyPolicyURL",ma="interface.termsOfServiceURL",ga="interface.supportURL",va="interface.brandColor",_a="interface.brandColorDark",ya=dt(2048,1024),WT=Bt({table:"Listing and interface errors",stage:"upload",document:"plugin-manifest",rows:["plugin_interface_wrong_type: The plugin manifest's `interface` field must be a JSON object.","plugin_display_name_wrong_type: `interface.displayName` must be a string.","plugin_display_name_empty: `interface.displayName` is required and must be non-empty.","plugin_display_name_too_long: `interface.displayName` must be 80 characters or fewer for package validation and 30 characters or fewer for final directory submission.","plugin_display_name_character_unsupported: `interface.displayName` must use supported text.","plugin_short_description_missing: `interface.shortDescription` is required, must fit on one line, and must be 240 characters or fewer for package validation and 30 characters or fewer for final directory submission.","plugin_short_description_wrong_type: `interface.shortDescription` must be a string.","plugin_short_description_empty: `interface.shortDescription` must be non-empty.","plugin_short_description_too_long: `interface.shortDescription` must be 240 characters or fewer for package validation and 30 characters or fewer for final directory submission.","plugin_short_description_character_unsupported: `interface.shortDescription` must use supported text.","plugin_long_description_wrong_type: `interface.longDescription` must be a string.","plugin_long_description_empty: `interface.longDescription` is required and must be non-empty.","plugin_long_description_too_long: `interface.longDescription` must be 4,000 characters or fewer.","plugin_long_description_character_unsupported: `interface.longDescription` must use supported text. Line breaks are allowed.","plugin_developer_name_wrong_type: `interface.developerName` must be a string.","plugin_developer_name_empty: `interface.developerName` is required and must be non-empty.","plugin_developer_name_too_long: `interface.developerName` must be 120 characters or fewer for package validation and 80 characters or fewer for final directory submission.","plugin_developer_name_character_unsupported: `interface.developerName` must use supported text.","plugin_category_wrong_type: `interface.category` must be a string.","plugin_category_empty: `interface.category` must be non-empty when provided; omit it to use `Other`.","plugin_category_unknown: `interface.category` must be `Productivity`, `Creativity`, `Developer Tools`, `Business & Operations`, `Data & Analytics`, `Communication`, `Education & Research`, `Security`, `Finance`, `Healthcare`, `Travel`, `Entertainment`, or `Other`.","plugin_category_character_unsupported: `interface.category` must use supported text.","plugin_capabilities_wrong_type: `interface.capabilities` must be a list of strings.","plugin_capabilities_too_many: `interface.capabilities` must contain 20 entries or fewer.","plugin_capability_wrong_type: Each `interface.capabilities` entry must be a string.","plugin_capability_empty: Each `interface.capabilities` entry must be non-empty when provided.","plugin_capability_too_long: Each `interface.capabilities` entry must be 120 characters or fewer.","plugin_capability_character_unsupported: Each `interface.capabilities` entry must use supported text.","plugin_website_url_wrong_type: `interface.websiteURL` must be a string when provided.","plugin_website_url_empty: `interface.websiteURL` must be non-empty when provided.","plugin_website_url_format: `interface.websiteURL` must be an HTTPS URL.","plugin_website_url_too_long: `interface.websiteURL` must meet the listing URL length limits.","plugin_privacy_policy_url_wrong_type: `interface.privacyPolicyURL` must be a string when provided.","plugin_privacy_policy_url_empty: `interface.privacyPolicyURL` must be non-empty when provided.","plugin_privacy_policy_url_format: `interface.privacyPolicyURL` must be an HTTPS URL.","plugin_privacy_policy_url_too_long: `interface.privacyPolicyURL` must meet the listing URL length limits.","plugin_terms_of_service_url_wrong_type: `interface.termsOfServiceURL` must be a string when provided.","plugin_terms_of_service_url_empty: `interface.termsOfServiceURL` must be non-empty when provided.","plugin_terms_of_service_url_format: `interface.termsOfServiceURL` must be an HTTPS URL.","plugin_terms_of_service_url_too_long: `interface.termsOfServiceURL` must meet the listing URL length limits.","plugin_support_url_wrong_type: `interface.supportURL` must be a string when provided.","plugin_support_url_empty: `interface.supportURL` must be non-empty when provided.","plugin_support_url_format: `interface.supportURL` must be an HTTPS URL.","plugin_support_url_too_long: `interface.supportURL` must meet the listing URL length limits.","plugin_homepage_wrong_type: `homepage` must be a string when provided.","plugin_homepage_empty: `homepage` must be non-empty when provided.","plugin_homepage_format: `homepage` must be an HTTPS URL.","plugin_homepage_too_long: `homepage` must be 2,048 characters or fewer.","plugin_brand_color_wrong_type: `interface.brandColor` must be a string when provided.","plugin_brand_color_empty: `interface.brandColor` must be non-empty when provided.","plugin_brand_color_format: `interface.brandColor` must be a six-digit hex color, such as `#1ABCFE`.","plugin_brand_color_dark_wrong_type: `interface.brandColorDark` must be a string when provided.","plugin_brand_color_dark_empty: `interface.brandColorDark` must be non-empty when provided.","plugin_brand_color_dark_format: `interface.brandColorDark` must be a six-digit hex color, such as `#1ABCFE`.","plugin_brand_color_contrast: `interface.brandColor` must have at least 2:1 contrast against white.","plugin_brand_color_dark_contrast: `interface.brandColorDark` must have at least 2:1 contrast against `#212121`.","plugin_default_prompt_wrong_type: `interface.defaultPrompt` must be a string or list of strings.","plugin_default_prompt_too_many: `interface.defaultPrompt` must contain at most three prompts.","plugin_default_prompt_entry_wrong_type: Each `interface.defaultPrompt` entry must be a string.","plugin_default_prompt_empty: Each `interface.defaultPrompt` entry must be non-empty when provided.","plugin_default_prompt_too_long: Each `interface.defaultPrompt` entry must be 512 characters or fewer for package validation and 128 characters or fewer for final directory submission.","plugin_default_prompt_character_unsupported: Each `interface.defaultPrompt` entry must use supported text and fit on one line."],targets:{plugin_interface_wrong_type:x("interface",ni),plugin_display_name_wrong_type:x(on,qe),plugin_display_name_empty:x(on,sn),plugin_display_name_too_long:x(on,dt(80)),plugin_display_name_character_unsupported:x(on,ur),plugin_short_description_missing:x(_i,ir),plugin_short_description_wrong_type:x(_i,qe),plugin_short_description_empty:x(_i,He),plugin_short_description_too_long:x(_i,dt(240)),plugin_short_description_character_unsupported:x(_i,Wn),plugin_long_description_wrong_type:x(an,qe),plugin_long_description_empty:x(an,sn),plugin_long_description_too_long:x(an,dt(4e3)),plugin_long_description_character_unsupported:x(an,ur),plugin_developer_name_wrong_type:x(bi,qe),plugin_developer_name_empty:x(bi,sn),plugin_developer_name_too_long:x(bi,dt(120)),plugin_developer_name_character_unsupported:x(bi,ur),plugin_category_wrong_type:x(pa,qe),plugin_category_empty:x(pa,He),plugin_category_unknown:x(pa,GT),plugin_category_character_unsupported:x(pa,ur),plugin_capabilities_wrong_type:x(_m,Oo("array")),plugin_capabilities_too_many:x(_m,hm(20)),plugin_capability_wrong_type:x(io,qe),plugin_capability_empty:x(io,He),plugin_capability_too_long:x(io,dt(120)),plugin_capability_character_unsupported:x(io,ur),plugin_website_url_wrong_type:x(ha,qe),plugin_website_url_empty:x(ha,He),plugin_website_url_format:x(ha,jt(js)),plugin_website_url_too_long:x(ha,ya),plugin_privacy_policy_url_wrong_type:x(fa,qe),plugin_privacy_policy_url_empty:x(fa,He),plugin_privacy_policy_url_format:x(fa,jt(js)),plugin_privacy_policy_url_too_long:x(fa,ya),plugin_terms_of_service_url_wrong_type:x(ma,qe),plugin_terms_of_service_url_empty:x(ma,He),plugin_terms_of_service_url_format:x(ma,jt(js)),plugin_terms_of_service_url_too_long:x(ma,ya),plugin_support_url_wrong_type:x(ga,qe),plugin_support_url_empty:x(ga,He),plugin_support_url_format:x(ga,jt(js)),plugin_support_url_too_long:x(ga,ya),plugin_homepage_wrong_type:x("homepage",qe),plugin_homepage_empty:x("homepage",He),plugin_homepage_format:x("homepage",jt(js)),plugin_homepage_too_long:x("homepage",dt(2048)),plugin_brand_color_wrong_type:x(va,qe),plugin_brand_color_empty:x(va,He),plugin_brand_color_format:x(va,jt(pd)),plugin_brand_color_dark_wrong_type:x(_a,qe),plugin_brand_color_dark_empty:x(_a,He),plugin_brand_color_dark_format:x(_a,jt(pd)),plugin_brand_color_contrast:x(va),plugin_brand_color_dark_contrast:x(_a),plugin_default_prompt_wrong_type:x(dd,Oo("string","array")),plugin_default_prompt_too_many:x(dd,hm(3)),plugin_default_prompt_entry_wrong_type:x(no,qe),plugin_default_prompt_empty:x(no,He),plugin_default_prompt_too_long:x(no,dt(512,128)),plugin_default_prompt_character_unsupported:x(no,Wn)}}),JT=/^https:\/\/[^\s/?#]+(?:[/?#]\S*)?$/i,KT=Oy(/^[a-z][a-z\d+.-]*:\/\/[^\s/?#]*@/i),YT=/^(?:\.\/)?skills\/?$/,XT=/^(?:\.\/)?\.app\.json$/,ZT=/^(?:\.\/)?\.mcp\.json$/,QT=/^(?:asdk_app_|connector_|templated_apps_)[A-Za-z0-9][\w-]*$/,eC=Bt({table:"Plugin manifest errors",stage:"upload",document:"plugin-manifest",rows:[`plugin_manifest_missing: ${xr.plugin_manifest_missing.message}`,"plugin_manifest_not_file: Plugin manifest must be a regular JSON file.","plugin_manifest_unreadable: Plugin manifest must be readable UTF-8 text.","plugin_manifest_json_malformed: Plugin manifest must contain valid JSON; malformed syntax is reported with a line number.","plugin_manifest_root_not_object: Plugin manifest must contain a JSON object at the top level.","codex_manifest_parent_not_directory: `.codex-plugin` must be a directory.","codex_manifest_path_not_file: `.codex-plugin/plugin.json` must be a regular JSON file.","plugin_id_wrong_type: `id` must be a string when provided.","plugin_id_empty: `id` must be non-empty when provided.",`plugin_name_missing: ${xr.plugin_name_missing.message}`,`plugin_name_wrong_type: ${xr.plugin_name_wrong_type.message}`,`plugin_name_empty: ${xr.plugin_name_empty.message}`,`plugin_name_too_long: ${xr.plugin_name_too_long.message}`,`plugin_name_format: ${xr.plugin_name_format.message}`,"plugin_version_missing: `version` is required.","plugin_version_wrong_type: `version` must be a string.","plugin_version_empty: `version` must be a non-empty semantic-version string, such as `1.0.0`.","plugin_version_not_semver: `version` must use semantic versioning, such as `1.0.0`.","plugin_version_too_long: `version` must be 64 characters or fewer.","plugin_description_missing: `description` is required.","plugin_description_wrong_type: `description` must be a string.","plugin_description_empty: `description` must be non-empty.","plugin_description_too_long: `description` must be 1,024 characters or fewer.","plugin_description_character_unsupported: `description` must use supported text. Line breaks are allowed.","plugin_developer_missing: `author.name` is required. `interface.developerName` is also required and is reported separately.","plugin_author_wrong_type: `author` must be an object.","plugin_author_name_wrong_type: `author.name` must be a string.","plugin_author_name_empty: `author.name` must be non-empty.","plugin_author_name_too_long: `author.name` must be 120 characters or fewer.","plugin_author_name_character_unsupported: `author.name` must use supported text.","plugin_author_email_wrong_type: `author.email` must be a string when provided.","plugin_author_email_empty: `author.email` must be non-empty when provided.","plugin_author_email_too_long: `author.email` must be 320 characters or fewer.","plugin_author_email_character_unsupported: `author.email` must use supported text.","plugin_author_url_wrong_type: `author.url` must be a string when provided.","plugin_author_url_empty: `author.url` must be non-empty when provided.","plugin_author_url_not_https: `author.url` must be an HTTPS URL.","plugin_author_url_has_credentials: `author.url` must not contain credentials.","plugin_author_url_too_long: `author.url` must be 2,048 characters or fewer.","plugin_author_url_character_unsupported: `author.url` must use supported text."],targets:{codex_manifest_parent_not_directory:$e(".codex-plugin"),codex_manifest_path_not_file:$e(".codex-plugin/plugin.json"),plugin_id_wrong_type:x("id",qe),plugin_id_empty:x("id",He),plugin_name_missing:x("name",ir),plugin_name_wrong_type:x("name",qe),plugin_name_empty:x("name",He),plugin_name_too_long:x("name",dt(64)),plugin_name_format:x("name",jt(uy)),plugin_version_missing:x("version",ir),plugin_version_wrong_type:x("version",qe),plugin_version_empty:x("version",He),plugin_version_not_semver:x("version",jt($T)),plugin_version_too_long:x("version",dt(64)),plugin_description_missing:x("description",ir),plugin_description_wrong_type:x("description",qe),plugin_description_empty:x("description",He),plugin_description_too_long:x("description",dt(1024)),plugin_description_character_unsupported:x("description",ur),plugin_developer_missing:x("author.name",ir),plugin_author_wrong_type:x("author",ni),plugin_author_name_wrong_type:x("author.name",qe),plugin_author_name_empty:x("author.name",He),plugin_author_name_too_long:x("author.name",dt(120)),plugin_author_name_character_unsupported:x("author.name",ur),plugin_author_email_wrong_type:x("author.email",qe),plugin_author_email_empty:x("author.email",He),plugin_author_email_too_long:x("author.email",dt(320)),plugin_author_email_character_unsupported:x("author.email",ur),plugin_author_url_wrong_type:x("author.url",qe),plugin_author_url_empty:x("author.url",He),plugin_author_url_not_https:x("author.url",jt(JT)),plugin_author_url_has_credentials:x("author.url",KT),plugin_author_url_too_long:x("author.url",dt(2048)),plugin_author_url_character_unsupported:x("author.url",ur)}}),tC=Bt({table:"Plugin content errors",stage:"upload",document:"plugin-manifest",rows:["plugin_skills_path_wrong_type: `skills` must be a string path for the root `skills/` directory.","plugin_skills_path_empty: `skills` must be a non-empty path to the root `skills/` directory when provided.","plugin_skills_path_unsupported: `skills` must resolve to the root `skills/` directory.","plugin_skills_directory_missing: A declared root `skills/` directory must exist.","plugin_skills_path_not_directory: Root `skills/` must be a directory when declared.","plugin_apps_path_wrong_type: `apps` must be a string path for the root `.app.json`.","plugin_apps_path_empty: `apps` must be a non-empty path to the root `.app.json` when provided.","plugin_apps_path_unsupported: `apps` must resolve to the root `.app.json`.","plugin_apps_file_missing: A declared root `.app.json` file must exist.","plugin_apps_path_not_file: Root `.app.json` must be a regular file when declared.","plugin_mcp_path_wrong_type: `mcpServers` must be a string path for the root `.mcp.json`.","plugin_mcp_path_empty: `mcpServers` must be a nonempty path. Set it to `./.mcp.json` or remove the field.","plugin_mcp_path_unsupported: `mcpServers` must resolve to the root `.mcp.json`.","plugin_mcp_file_missing: `mcpServers` declares the root `.mcp.json`, but that file doesn't exist.","plugin_mcp_path_not_file: Root `.mcp.json` must be a regular file.","plugin_runtime_surface_missing: A public submission ZIP must contain at least one valid skill (or an approved local MCP server). Local and workspace packages can also reference an eligible MCP server."],targets:{plugin_skills_path_wrong_type:x("skills",qe),plugin_skills_path_empty:x("skills",He),plugin_skills_path_unsupported:x("skills",jt(YT)),plugin_skills_directory_missing:$e("skills/"),plugin_skills_path_not_directory:$e("skills/"),plugin_apps_path_wrong_type:x("apps",qe),plugin_apps_path_empty:x("apps",He),plugin_apps_path_unsupported:x("apps",jt(XT)),plugin_apps_file_missing:$e(".app.json"),plugin_apps_path_not_file:$e(".app.json"),plugin_mcp_path_wrong_type:x("mcpServers",qe),plugin_mcp_path_empty:x("mcpServers",He),plugin_mcp_path_unsupported:x("mcpServers",jt(ZT)),plugin_mcp_file_missing:$e(".mcp.json"),plugin_mcp_path_not_file:$e(".mcp.json")}}),rC=Bt({table:"MCP manifest errors",stage:"upload",document:"mcp-config",rows:["mcp_manifest_unreadable: `.mcp.json` must be readable UTF-8 text.","mcp_manifest_json_malformed: `.mcp.json` must contain valid JSON; malformed syntax is reported with a line number.","mcp_manifest_wrong_type: `.mcp.json` must contain a JSON object at the top level.","mcp_servers_missing: `.mcp.json` must contain the top-level `mcpServers` field.","mcp_servers_wrong_type: `mcpServers` must be an object.","mcp_server_name_empty: Every MCP server name must contain at least one non-whitespace character.","mcp_server_wrong_type: Each `mcpServers.<server-name>` value must be an object containing that server's declaration."],targets:{mcp_manifest_unreadable:$e(".mcp.json"),mcp_manifest_json_malformed:$e(".mcp.json"),mcp_manifest_wrong_type:$e(".mcp.json"),mcp_servers_missing:x("mcpServers",ir),mcp_servers_wrong_type:x("mcpServers",ni),mcp_server_name_empty:x("mcpServers"),mcp_server_wrong_type:x("mcpServers.*",ni)}}),iC=Bt({table:"MCP server reference errors",stage:"upload",document:"app-config",rows:["app_manifest_unreadable: `.app.json` must be readable UTF-8 text.","app_manifest_json_malformed: `.app.json` contains malformed JSON near the reported line.","app_manifest_wrong_type: `.app.json` must contain a JSON object at the top level.","app_entries_missing: `apps` is required.","app_entries_wrong_type: `apps` must be an object.","app_entry_wrong_type: Each server entry must be an object.","app_id_missing: Each server entry's `id` is required.","app_id_wrong_type: Each server entry's `id` must be a string.","app_id_format: Each server entry's `id` must begin with `asdk_app_`, `connector_`, or `templated_apps_`, followed by a letter or digit and then only letters, digits, `_`, or `-`.","app_entry_optional_wrong_type: Each server entry's `optional` value must be `true` or `false` when provided.","app_entry_required_wrong_type: Each server entry's `required` value must be `true` or `false` when provided.","app_not_eligible: A local or workspace package must reference an eligible, available MCP server. Directory submissions must use **With MCP** and submit the MCP server directly."],targets:{app_manifest_unreadable:$e(".app.json"),app_manifest_json_malformed:$e(".app.json"),app_manifest_wrong_type:$e(".app.json"),app_entries_missing:x("apps",ir),app_entries_wrong_type:x("apps",ni),app_entry_wrong_type:x("apps.*",ni),app_id_missing:x("apps.*.id",ir),app_id_wrong_type:x("apps.*.id",qe),app_id_format:x("apps.*.id",jt(QT)),app_entry_optional_wrong_type:x("apps.*.optional",ud),app_entry_required_wrong_type:x("apps.*.required",ud)}}),nC=Oy(/(?:^|\s)@\S/),sC=Bt({table:"Final metadata errors",stage:"submission",document:"plugin-manifest",rows:["submission_display_name_required: Display name is required, non-empty, and single-line.","submission_display_name_too_long: Display name must be 30 characters or fewer.","submission_display_name_character_unsupported: Display name must use supported text and fit on one line.","submission_subtitle_required: Short description is required, non-empty, and single-line.","submission_subtitle_too_long: Short description must be 30 characters or fewer.","submission_subtitle_character_unsupported: Short description must use supported text and fit on one line.","submission_description_required: Long description is required and must be non-empty. Line breaks are allowed.","submission_description_too_long: Long description must be 4,000 characters or fewer.","submission_description_character_unsupported: Long description must use supported text. Line breaks are allowed.","submission_developer_name_required: Developer name is required, non-empty, and single-line.","submission_developer_name_too_long: Developer name must be 80 characters or fewer.","submission_developer_name_character_unsupported: Developer name must use supported text and fit on one line.","plugin_capability_invalid: Each capability must be non-empty, use supported text, fit on one line, and be 120 characters or fewer.","plugin_default_prompt_mention: Starter prompts must not contain MCP server `@mentions`.","plugin_default_prompt_duplicate: Starter prompts must be unique after Unicode and whitespace normalization."],targets:{submission_display_name_required:x(on,sn),submission_display_name_too_long:x(on,dt(30)),submission_display_name_character_unsupported:x(on,Wn),submission_subtitle_required:x(_i,sn),submission_subtitle_too_long:x(_i,dt(30)),submission_subtitle_character_unsupported:x(_i,Wn),submission_description_required:x(an,sn),submission_description_too_long:x(an,dt(4e3)),submission_description_character_unsupported:x(an,ur),submission_developer_name_required:x(bi,sn),submission_developer_name_too_long:x(bi,dt(80)),submission_developer_name_character_unsupported:x(bi,Wn),plugin_capability_invalid:x(io,He,Wn,dt(120)),plugin_default_prompt_mention:x(no,nC),plugin_default_prompt_duplicate:x(dd)}}),oC=Bt({table:"MCP and review errors",stage:"submission",rows:["annotations_required: Every MCP tool must set `readOnlyHint`, `openWorldHint`, and `destructiveHint` accurately.","justification_required: Every MCP tool annotation must include a justification for its read-only, open-world, or destructive behavior.","scan_required: MCP tools must have a successful, current scan of the production MCP server.","domain_verification_required: The exact verification token must be hosted at the generated `/.well-known/openai-apps-challenge` URL on the MCP host or an allowed parent host, and **Verify Domain** must pass.","frame_domain_explanation_required: Every external frame domain reported by the MCP tool scan must have an explanation of why the UI needs it and what content it provides."]}),xy=[...sC,...oC,...NT,...DT,...UT,...eC,...WT,...tC,...rC,...jT,...zT,...FT,...HT,...iC,...BT],aC=xy,HB=Object.freeze(Object.fromEntries(xy.map(e=>[e.code,e]))),cC={"Final metadata errors":"listing-fields","MCP and review errors":"mcp-server","ZIP upload errors and warnings":"package-archive","ZIP structure and limit errors":"package-archive","Plugin root errors":"package-archive","Plugin manifest errors":"package-manifest","Listing and interface errors":"package-manifest","Plugin content errors":"package-manifest","MCP manifest errors":"package-manifest","Skill errors":"package-skills","Skill agent metadata errors":"package-skills","Asset path errors":"package-assets","Image errors":"package-assets","MCP server reference errors":"package-manifest","Package warnings":"package-manifest"},lC={mcp_configuration_excluded:"exclusions",app_configuration_excluded:"exclusions",skill_file_ignored:"package-skills",skill_symlink_ignored:"package-skills",skill_frontmatter_adjusted:"package-skills",skill_metadata_ignored:"package-skills"},uC=aC.map(e=>({id:e.code,category:lC[e.code]??cC[e.table],severity:e.severity==="warning"?"advisory":"blocking",message:e.message,...e.code==="plugin_name_too_long"?{limit:{name:"fieldLimits.pluginNameMaxLength",value:er.pluginNameMaxLength}}:{},source:{...gr("deploy/submission-errors",`§${e.table}`),snapshotDate:e.source.capturedOn}})),ne=e=>gr("deploy/submission-errors",e),dC=[{id:"archive-too-large",category:"package-archive",severity:"blocking",message:"The uploaded archive exceeds the maximum compressed size.",limit:{name:"archiveLimits.maxCompressedBytes",value:Ua.maxCompressedBytes},source:ne("§Shared package checks → Archive size")},{id:"archive-expands-too-large",category:"package-archive",severity:"blocking",message:"The archive's contents exceed the maximum uncompressed size when expanded.",limit:{name:"archiveLimits.maxUncompressedBytes",value:Ua.maxUncompressedBytes},source:ne("§Shared package checks → Archive size")},{id:"archive-too-many-entries",category:"package-archive",severity:"blocking",message:"The archive contains more entries than the maximum allowed.",limit:{name:"archiveLimits.maxEntries",value:Ua.maxEntries},source:ne("§Shared package checks → Entry count")},{id:"archive-encrypted-entry",category:"package-archive",severity:"blocking",message:"The archive contains an encrypted entry, which cannot be scanned.",source:ne("§Shared package checks → Archive integrity")},{id:"archive-path-traversal",category:"package-archive",severity:"blocking",message:"An entry path escapes the package root via a `..` segment.",source:ne("§Shared package checks → Entry paths")},{id:"archive-absolute-path",category:"package-archive",severity:"blocking",message:"An entry path is absolute rather than package-relative.",source:ne("§Shared package checks → Entry paths")},{id:"archive-backslash-path",category:"package-archive",severity:"blocking",message:"An entry path uses a backslash separator.",source:ne("§Shared package checks → Entry paths")},{id:"archive-empty-path-segment",category:"package-archive",severity:"blocking",message:"An entry path contains an empty or `.` segment.",source:ne("§Shared package checks → Entry paths")},{id:"archive-path-whitespace",category:"package-archive",severity:"blocking",message:"An entry path has leading or trailing whitespace.",source:ne("§Shared package checks → Entry paths")},{id:"archive-path-control-character",category:"package-archive",severity:"blocking",message:"An entry path contains a control character or NUL byte.",source:ne("§Shared package checks → Entry paths")},{id:"archive-duplicate-path",category:"package-archive",severity:"blocking",message:"Two entries normalize to the same path, including case-insensitive collisions.",source:ne("§Shared package checks → Entry paths")},{id:"archive-symlink-entry",category:"package-archive",severity:"blocking",message:"The archive contains a symlink or hardlink entry.",source:ne("§Shared package checks → Archive integrity")},{id:"manifest-missing",category:"package-manifest",severity:"blocking",message:"The package contains no plugin manifest.",source:ne("§Shared package checks → Manifest")},{id:"manifest-invalid-json",category:"package-manifest",severity:"blocking",message:"The plugin manifest is not valid JSON.",source:ne("§Shared package checks → Manifest")},{id:"manifest-name-missing",category:"package-manifest",severity:"blocking",message:"The manifest declares no plugin name.",source:ne("§Shared package checks → Manifest")},{id:"manifest-name-too-long",category:"package-manifest",severity:"blocking",message:"The manifest's plugin name exceeds the maximum length.",limit:{name:"fieldLimits.nameMaxLength",value:er.nameMaxLength},source:ne("§Shared package checks → Manifest")},{id:"manifest-version-invalid",category:"package-manifest",severity:"blocking",message:"The manifest's version is not a valid semantic version.",source:ne("§Shared package checks → Manifest")},{id:"interface-display-name-missing",category:"package-manifest",severity:"blocking",message:"The OpenAI interface document declares no display name.",source:ne("§Listing fields → Interface")},{id:"interface-display-name-too-long",category:"package-manifest",severity:"blocking",message:"The interface display name exceeds the maximum length.",limit:{name:"fieldLimits.displayNameMaxLength",value:er.displayNameMaxLength},source:ne("§Listing fields → Interface")},{id:"interface-short-description-too-long",category:"package-manifest",severity:"blocking",message:"The interface short description exceeds the maximum length.",limit:{name:"fieldLimits.shortDescriptionMaxLength",value:er.shortDescriptionMaxLength},source:ne("§Listing fields → Interface")},{id:"interface-default-prompt-too-long",category:"package-manifest",severity:"blocking",message:"The interface default prompt exceeds the maximum length.",limit:{name:"fieldLimits.defaultPromptMaxLength",value:er.defaultPromptMaxLength},source:ne("§Listing fields → Interface")},{id:"interface-brand-color-invalid",category:"package-manifest",severity:"blocking",message:"The brand color is not a six-digit hex value.",source:ne("§Listing fields → Interface")},{id:"interface-brand-color-low-contrast",category:"package-manifest",severity:"blocking",message:"The brand color does not meet the minimum contrast ratio against both the light and dark backgrounds.",source:ne("§Listing fields → Interface")},{id:"interface-yaml-invalid",category:"package-manifest",severity:"blocking",message:"The OpenAI interface document is not valid YAML.",source:ne("§Listing fields → Interface")},{id:"interface-unsupported-text",category:"package-manifest",severity:"blocking",message:"A text field contains control characters or Unicode line/paragraph separators.",source:ne("§Listing fields → Text")},{id:"skill-metadata-missing",category:"package-skills",severity:"blocking",message:"A skill directory contains no SKILL.md.",source:ne("§Skills → Structure")},{id:"skill-frontmatter-invalid",category:"package-skills",severity:"blocking",message:"A skill's SKILL.md frontmatter is missing or malformed.",source:ne("§Skills → Frontmatter")},{id:"skill-name-missing",category:"package-skills",severity:"blocking",message:"A skill's frontmatter declares no name.",source:ne("§Skills → Frontmatter")},{id:"skill-name-too-long",category:"package-skills",severity:"blocking",message:"A skill name exceeds the maximum length.",limit:{name:"fieldLimits.skillNameMaxLength",value:er.skillNameMaxLength},source:ne("§Skills → Frontmatter")},{id:"skill-description-missing",category:"package-skills",severity:"blocking",message:"A skill's frontmatter declares no description.",source:ne("§Skills → Frontmatter")},{id:"skill-name-collision",category:"package-skills",severity:"blocking",message:"Two skills in the package declare the same name.",source:ne("§Skills → Structure")},{id:"asset-unsupported-type",category:"package-assets",severity:"blocking",message:"An image is not one of the accepted formats.",source:ne("§Images → Format")},{id:"asset-too-large",category:"package-assets",severity:"blocking",message:"An image exceeds the maximum file size.",limit:{name:"imageConstraints.maxBytes",value:qa.maxBytes},source:ne("§Images → Size")},{id:"asset-too-small",category:"package-assets",severity:"blocking",message:"An image is smaller than the minimum edge length.",limit:{name:"imageConstraints.minEdgePx",value:qa.minEdgePx},source:ne("§Images → Dimensions")},{id:"asset-too-big-dimensions",category:"package-assets",severity:"blocking",message:"An image exceeds the maximum edge length.",limit:{name:"imageConstraints.maxEdgePx",value:qa.maxEdgePx},source:ne("§Images → Dimensions")},{id:"asset-not-square",category:"package-assets",severity:"blocking",message:"An image is not square.",source:ne("§Images → Dimensions")},{id:"asset-undecodable",category:"package-assets",severity:"blocking",message:"An image's dimensions could not be read from its bytes.",source:ne("§Images → Format")},{id:"asset-svg-malformed",category:"package-assets",severity:"blocking",message:"An SVG is not well-formed XML or has no `svg` root element.",source:ne("§Images → SVG")},{id:"asset-svg-no-dimensions",category:"package-assets",severity:"blocking",message:"An SVG declares neither a numeric width/height pair nor a numeric viewBox.",source:ne("§Images → SVG")},{id:"asset-missing",category:"package-assets",severity:"blocking",message:"An asset referenced by the manifest is absent from the package.",source:ne("§Images → Format")},{id:"listing-category-unknown",category:"listing-fields",severity:"blocking",message:"The listing names a category outside the supported set.",source:ne("§Listing fields → Categories")},{id:"listing-description-too-long",category:"listing-fields",severity:"blocking",message:"The listing description exceeds the maximum length.",limit:{name:"fieldLimits.descriptionMaxLength",value:er.descriptionMaxLength},source:ne("§Listing fields → Description")},{id:"listing-promotional-metadata",category:"listing-fields",severity:"blocking",message:"Listing metadata contains promotional language, pricing claims, or ranking claims.",source:ne("§Listing fields → Description")},{id:"listing-privacy-policy-missing",category:"listing-fields",severity:"blocking",message:"The listing declares no privacy policy URL.",source:ne("§Listing fields → Links")},{id:"listing-support-url-missing",category:"listing-fields",severity:"blocking",message:"The listing declares no support URL.",source:ne("§Listing fields → Links")},{id:"mcp-endpoint-not-https",category:"mcp-server",severity:"blocking",message:"The MCP endpoint is not served over HTTPS.",source:ne("§MCP tools → Endpoint")},{id:"mcp-endpoint-unreachable",category:"mcp-server",severity:"blocking",message:"The MCP endpoint could not be reached during the scan.",source:ne("§MCP tools → Endpoint")},{id:"mcp-tool-name-too-long",category:"mcp-server",severity:"blocking",message:"A tool name exceeds the maximum length.",limit:{name:"fieldLimits.toolNameMaxLength",value:er.toolNameMaxLength},source:ne("§MCP tools → Metadata")},{id:"mcp-tool-description-missing",category:"mcp-server",severity:"blocking",message:"A tool declares no description.",source:ne("§MCP tools → Metadata")},{id:"mcp-tool-annotations-missing",category:"mcp-server",severity:"blocking",message:"A tool is missing one or more of the required annotation hints.",source:ne("§MCP tools → Annotations")},{id:"mcp-tool-schema-invalid",category:"mcp-server",severity:"blocking",message:"A tool's input or output schema is not a valid JSON Schema object.",source:ne("§MCP tools → Schemas")},{id:"mcp-domain-not-verified",category:"mcp-server",severity:"blocking",message:"The MCP server's domain has not completed domain verification.",source:ne("§MCP tools → Domain verification")},{id:"mcp-csp-domain-missing",category:"mcp-server",severity:"blocking",message:"A UI resource loads from a domain absent from the declared content security policy.",source:ne("§MCP tools → Content security policy")},{id:"mcp-ui-domain-missing",category:"mcp-server",severity:"blocking",message:"A UI resource declares no `_meta.ui.domain`.",source:ne("§MCP tools → UI resources")},{id:"mcp-ui-domain-duplicate",category:"mcp-server",severity:"blocking",message:"Two UI resources declare the same `_meta.ui.domain`.",source:ne("§MCP tools → UI resources")},{id:"mcp-ui-mime-invalid",category:"mcp-server",severity:"blocking",message:"A UI resource does not declare the plugin UI MIME profile.",source:ne("§MCP tools → UI resources")},{id:"mcp-skill-too-many",category:"mcp-skills",severity:"blocking",message:"The server advertises more importable skills than the maximum.",limit:{name:"mcpSkillLimits.maxSkills",value:Xi.maxSkills},source:ne("§Skills → Imported from MCP")},{id:"mcp-skill-markdown-too-large",category:"mcp-skills",severity:"blocking",message:"An imported skill's markdown exceeds the maximum size.",limit:{name:"mcpSkillLimits.maxSkillMarkdownBytes",value:Xi.maxSkillMarkdownBytes},source:ne("§Skills → Imported from MCP")},{id:"mcp-skill-page-too-large",category:"mcp-skills",severity:"blocking",message:"An imported skill's supporting page exceeds the maximum size.",limit:{name:"mcpSkillLimits.maxPageBytes",value:Xi.maxPageBytes},source:ne("§Skills → Imported from MCP")},{id:"mcp-skill-too-many-pages",category:"mcp-skills",severity:"blocking",message:"An imported skill has more supporting pages than the maximum.",limit:{name:"mcpSkillLimits.maxPagesPerSkill",value:Xi.maxPagesPerSkill},source:ne("§Skills → Imported from MCP")},{id:"mcp-skill-total-too-large",category:"mcp-skills",severity:"blocking",message:"An imported skill's total footprint exceeds the maximum.",limit:{name:"mcpSkillLimits.maxSkillTotalBytes",value:Xi.maxSkillTotalBytes},source:ne("§Skills → Imported from MCP")},{id:"mcp-skills-total-too-large",category:"mcp-skills",severity:"blocking",message:"The imported skills exceed the maximum combined size.",limit:{name:"mcpSkillLimits.maxImportedTotalBytes",value:Xi.maxImportedTotalBytes},source:ne("§Skills → Imported from MCP")},{id:"mcp-skill-digest-mismatch",category:"mcp-skills",severity:"blocking",message:"An imported skill's declared digest does not match the resource served for it.",source:ne("§Skills → Imported from MCP")},{id:"mcp-skill-frontmatter-mismatch",category:"mcp-skills",severity:"blocking",message:"An imported skill's listing metadata disagrees with its SKILL.md frontmatter.",source:ne("§Skills → Imported from MCP")},{id:"mcp-skill-scan-failed",category:"mcp-skills",severity:"blocking",message:"The skill scan failed, so the draft's imported skills were not updated.",source:ne("§Skills → Imported from MCP")},{id:"review-success-tests-missing",category:"review-materials",severity:"blocking",message:"Fewer successful test cases were supplied than required.",limit:{name:"submissionTestCases.successCount",value:nn.successCount},source:ne("§Review materials → Test cases")},{id:"review-failure-tests-missing",category:"review-materials",severity:"blocking",message:"Fewer graceful-failure test cases were supplied than required.",limit:{name:"submissionTestCases.failureCount",value:nn.failureCount},source:ne("§Review materials → Test cases")},{id:"review-demo-credentials-missing",category:"review-materials",severity:"blocking",message:"The submission authenticates users but supplies no reviewer demo credentials.",source:ne("§Review materials → Demo access")},{id:"review-demo-recording-missing",category:"review-materials",severity:"blocking",message:"No demo recording was supplied.",source:ne("§Review materials → Demo access")},{id:"review-release-notes-missing",category:"review-materials",severity:"blocking",message:"An updated submission supplies no release notes.",source:ne("§Review materials → Release notes")},{id:"review-attestation-missing",category:"review-materials",severity:"blocking",message:"A required policy attestation was not affirmed.",source:ne("§Review materials → Attestations")},{id:"review-identity-not-verified",category:"review-materials",severity:"blocking",message:"The submitting account has not completed identity verification.",source:ne("§Review materials → Account")},{id:"review-write-permission-missing",category:"review-materials",severity:"blocking",message:"The submitting account lacks the app-write permission.",source:ne("§Review materials → Account")},{id:"review-geography-missing",category:"review-materials",severity:"blocking",message:"The submission declares no country availability.",source:ne("§Review materials → Availability")},{id:"review-annotation-justification-missing",category:"review-materials",severity:"advisory",message:"A tool annotated as destructive or open-world carries no justification for review.",source:ne("§Review materials → Test cases")},{id:"review-scan-stale",category:"review-materials",severity:"blocking",message:"The draft's scan predates the current server contract; re-run Scan Tools.",source:ne("§MCP tools → Scan")},{id:"exclusion-mcp-servers-in-skills-only",category:"exclusions",severity:"blocking",message:"A skills-only submission declares MCP servers, which that shape excludes.",source:ne("§Shared package checks → Excluded content")},{id:"exclusion-app-config-in-public-package",category:"exclusions",severity:"blocking",message:"The package contains an `.app.json`, which maps registered connections for local or workspace use and is excluded from a public submission.",source:ne("§Shared package checks → Excluded content")},{id:"exclusion-screenshots-without-ui",category:"exclusions",severity:"blocking",message:"Screenshots were supplied for a submission that renders no UI template.",source:ne("§Images → Screenshots")},{id:"exclusion-bundle-in-mcp-only",category:"exclusions",severity:"blocking",message:"An MCP-only submission supplies a package archive.",source:ne("§Shared package checks → Excluded content")},{id:"exclusion-unsupported-surface",category:"exclusions",severity:"blocking",message:"The package contains a surface the plugin directory does not support.",source:ne("§Shared package checks → Excluded content")},...uC],BB=Object.freeze(Object.fromEntries(dC.map(e=>[e.id,e]))),pC=["ownsOrIsAuthorizedForService","accurateDataDisclosure","compliesWithUsagePolicies","noProhibitedContent","maintainsSecurityPractices","respondsToSecurityReports","keepsListingAccurate"],hC=["none","account-identifiers","user-content","usage-analytics","payment-information","location","health","shared-with-third-parties"],fC=["in-submission-form","shared-out-of-band","not-required-authless"],Jl=w().url().refine(e=>e.startsWith("https://"),{message:"must be an https:// URL"}),ym=ee({prompt:w().min(1),expectation:w().min(1)}),mC=ee({reference:w().min(1),mimeType:w().min(1),widthPx:Le().int().positive(),heightPx:Le().int().positive(),prompt:w().min(1)}),VB=ee({name:w().min(1).max(er.nameMaxLength),shortDescription:w().min(1).max(er.shortDescriptionMaxLength),description:w().min(1).max(er.descriptionMaxLength),categories:Q(it(Ry)).min(1),privacyPolicyUrl:Jl,supportUrl:Jl,documentationUrl:Jl.optional(),testCases:ee({successful:Q(ym),gracefulFailure:Q(ym)}),demoCredentials:ee({provided:Oe(),delivery:it(fC)}),demoRecordingProvided:Oe(),screenshots:Q(mC).default([]),releaseNotes:w().min(1).optional(),identityVerified:Oe(),accountPermissions:Q(w().min(1)).default([]),availableCountries:Q(w().length(2)).default([]),dataResidencyEligible:Oe().optional(),privacyPolicyDataTypes:Q(it(hC)).default([]),annotationJustifications:Je(w(),w().min(1)).default({}),frameDomainExplanations:Je(w(),w().min(1)).default({}),domainVerificationToken:w().min(1).optional(),lastScanAt:w().datetime().optional(),hasPublishedVersion:Oe().optional(),attestations:V_(it(pC),Oe())}),GB=new TextDecoder("utf-8",{fatal:!1}),Gp=Symbol.for("yaml.alias"),gC=Symbol.for("yaml.document"),dn=Symbol.for("yaml.map"),My=Symbol.for("yaml.pair"),Wp=Symbol.for("yaml.scalar"),Wo=Symbol.for("yaml.seq"),zr=Symbol.for("yaml.node.type"),As=e=>!!e&&typeof e=="object"&&e[zr]===Gp,Jo=e=>!!e&&typeof e=="object"&&e[zr]===gC,Jp=e=>!!e&&typeof e=="object"&&e[zr]===dn,St=e=>!!e&&typeof e=="object"&&e[zr]===My,wt=e=>!!e&&typeof e=="object"&&e[zr]===Wp,Jc=e=>!!e&&typeof e=="object"&&e[zr]===Wo;function Yt(e){if(e&&typeof e=="object")switch(e[zr]){case dn:case Wo:return!0}return!1}function yt(e){if(e&&typeof e=="object")switch(e[zr]){case Gp:case dn:case Wp:case Wo:return!0}return!1}var Ly=e=>(wt(e)||Yt(e))&&!!e.anchor,Jt=Symbol("break visit"),$y=Symbol("skip children"),$r=Symbol("remove node");function Ko(e,t){const r=Ny(t);Jo(e)?Jn(null,e.contents,r,Object.freeze([e]))===$r&&(e.contents=null):Jn(null,e,r,Object.freeze([]))}Ko.BREAK=Jt;Ko.SKIP=$y;Ko.REMOVE=$r;function Jn(e,t,r,i){const n=Dy(e,t,r,i);if(yt(n)||St(n))return Uy(e,i,n),Jn(e,n,r,i);if(typeof n!="symbol"){if(Yt(t)){i=Object.freeze(i.concat(t));for(let s=0;s<t.items.length;++s){const o=Jn(s,t.items[s],r,i);if(typeof o=="number")s=o-1;else{if(o===Jt)return Jt;o===$r&&(t.items.splice(s,1),s-=1)}}}else if(St(t)){i=Object.freeze(i.concat(t));const s=Jn("key",t.key,r,i);if(s===Jt)return Jt;s===$r&&(t.key=null);const o=Jn("value",t.value,r,i);if(o===Jt)return Jt;o===$r&&(t.value=null)}}return n}async function Kp(e,t){const r=Ny(t);Jo(e)?await Kn(null,e.contents,r,Object.freeze([e]))===$r&&(e.contents=null):await Kn(null,e,r,Object.freeze([]))}Kp.BREAK=Jt;Kp.SKIP=$y;Kp.REMOVE=$r;async function Kn(e,t,r,i){const n=await Dy(e,t,r,i);if(yt(n)||St(n))return Uy(e,i,n),Kn(e,n,r,i);if(typeof n!="symbol"){if(Yt(t)){i=Object.freeze(i.concat(t));for(let s=0;s<t.items.length;++s){const o=await Kn(s,t.items[s],r,i);if(typeof o=="number")s=o-1;else{if(o===Jt)return Jt;o===$r&&(t.items.splice(s,1),s-=1)}}}else if(St(t)){i=Object.freeze(i.concat(t));const s=await Kn("key",t.key,r,i);if(s===Jt)return Jt;s===$r&&(t.key=null);const o=await Kn("value",t.value,r,i);if(o===Jt)return Jt;o===$r&&(t.value=null)}}return n}function Ny(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function Dy(e,t,r,i){if(typeof r=="function")return r(e,t,i);if(Jp(t))return r.Map?.(e,t,i);if(Jc(t))return r.Seq?.(e,t,i);if(St(t))return r.Pair?.(e,t,i);if(wt(t))return r.Scalar?.(e,t,i);if(As(t))return r.Alias?.(e,t,i)}function Uy(e,t,r){const i=t[t.length-1];if(Yt(i))i.items[e]=r;else if(St(i))e==="key"?i.key=r:i.value=r;else if(Jo(i))i.contents=r;else{const n=As(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${n} parent`)}}var vC={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},_C=e=>e.replace(/[!,[\]{}]/g,t=>vC[t]),qy=class Wr{constructor(t,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Wr.defaultYaml,t),this.tags=Object.assign({},Wr.defaultTags,r)}clone(){const t=new Wr(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Wr(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Wr.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Wr.defaultTags)}return t}add(t,r){this.atNextDocument&&(this.yaml={explicit:Wr.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Wr.defaultTags),this.atNextDocument=!1);const i=t.trim().split(/[ \t]+/),n=i.shift();switch(n){case"%TAG":{if(i.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;const[s,o]=i;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;const[s]=i;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{const o=/^\d+\.\d+$/.test(s);return r(6,`Unsupported YAML version ${s}`,o),!1}}default:return r(0,`Unknown directive ${n}`,!0),!1}}tagName(t,r){if(t==="!")return"!";if(t[0]!=="!")return r(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const o=t.slice(2,-1);return o==="!"||o==="!!"?(r(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&r("Verbatim tags must end with a >"),o)}const[,i,n]=t.match(/^(.*!)([^!]*)$/s);n||r(`The ${t} tag has no suffix`);const s=this.tags[i];if(s)try{return s+decodeURIComponent(n)}catch(o){return r(String(o)),null}return i==="!"?t:(r(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[r,i]of Object.entries(this.tags))if(t.startsWith(i))return r+_C(t.substring(i.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags);let n;if(t&&i.length>0&&yt(t.contents)){const s={};Ko(t.contents,(o,a)=>{yt(a)&&a.tag&&(s[a.tag]=!0)}),n=Object.keys(s)}else n=[];for(const[s,o]of i)s==="!!"&&o==="tag:yaml.org,2002:"||(!t||n.some(a=>a.startsWith(o)))&&r.push(`%TAG ${s} ${o}`);return r.join(`
1
+ import{o as F_}from"./rolldown-runtime-Dhvrsp_z.js";import{A as DI,At as ee,B as UI,Bt as H_,Ct as qI,D as jI,Dt as _t,E as zI,Et as ge,F as FI,Gt as B_,H as ca,Ht as HI,I as BI,It as w,Jt as VI,Kt as GI,L as Np,Mt as V_,N as WI,Nt as G_,P as JI,Pt as Je,Rt as st,St as W_,Tt as KI,V as YI,Xt as XI,Yt as ZI,Z as J_,_ as QI,_t as eA,a as tA,at as ri,b as Dp,bt as Oe,ct as rA,dt as K_,et as Mi,ft as iA,g as nA,ht as Y_,j as sA,jt as ct,k as oA,kt as Le,nt as aA,o as cA,ot as lA,pt as it,st as Up,tt as Hc,u as X_,ut as uA,v as dA,vt as Q,wt as Z_,x as Q_,zt as bt}from"./project-route-DPRRfvoQ.js";import{n as pA,t as hA}from"./react-dom-Du9nuv92.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"3.23.1"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="720308c2-3a2c-43cd-96c6-f61c52d26fef",e._sentryDebugIdIdentifier="sentry-dbid-720308c2-3a2c-43cd-96c6-f61c52d26fef")}catch{}})();var ey="phc_dTOPniyUNU2kD8Jx8yHMXSqiZHM8I91uWopTMX6EBE9",fA={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"},Yf;Yf||(Yf={});function mA(e){return GI(iA,e)}var la=F_(pA(),1);function td(e){return Array.isArray(e)?e.map(td):e&&typeof e=="object"?Object.fromEntries(Object.entries(e).sort(([t],[r])=>t<r?-1:t>r?1:0).map(([t,r])=>[t,td(r)])):e}function gA(e){return JSON.stringify(td(e))}function pB(e,t){if(t==="openai-apps"){const i=e;return typeof i?.type=="string"?i.type.replace("openai:",""):"unknown"}const r=e;return typeof r?.method=="string"?r.method:r?.result!==void 0?"result":r?.error!==void 0?"error":"unknown"}var Xf=e=>{let t;const r=new Set,i=(l,u)=>{const p=typeof l=="function"?l(t):l;if(!Object.is(p,t)){const d=t;t=u??(typeof p!="object"||p===null)?p:Object.assign({},t,p),r.forEach(h=>h(t,d))}},n=()=>t,a={setState:i,getState:n,getInitialState:()=>c,subscribe:l=>(r.add(l),()=>r.delete(l))},c=t=e(i,n,a);return a},qp=(e=>e?Xf(e):Xf),vA=e=>e;function _A(e,t=vA){const r=la.useSyncExternalStore(e.subscribe,la.useCallback(()=>t(e.getState()),[e,t]),la.useCallback(()=>t(e.getInitialState()),[e,t]));return la.useDebugValue(r),r}var Zf=e=>{const t=qp(e),r=i=>_A(t,i);return Object.assign(r,t),r},yA=(e=>e?Zf(e):Zf),hB=Object.freeze({maxObservations:24,maxSummaryChars:400,maxEvidenceRefs:8,maxEvidenceRefChars:200,maxModelIdChars:128,maxVersionChars:64}),fB=Object.freeze({status:"not-requested",reason:"not_requested",detail:"this run did not request model-backed observations, so nothing was charged"}),bA="missingInputMessage";function Qf(e){if(!(!e||typeof e!="object"||!("missingInput"in e)))switch(e.missingInput){case"tasksProbe":case"logProbe":case"inputRequiredProbe":case"toolCallProbe":case"login":return e.missingInput;default:return}}function jp(e){if(e.status!=="skipped"||e.skipReason!=="could-not-run")return;const t=e.details,r=Qf(t)??Qf(t&&typeof t=="object"&&"details"in t?t.details:void 0);if(r)return r;const i=typeof e.id=="string"?e.id:"",n=ty(e.error);if(i.startsWith("tasks-")&&(n.startsWith("no probe tool could be selected automatically:")||n.startsWith("no listed tool advertises `execution.taskSupport`")))return"tasksProbe";if(i==="modern-logs-require-log-level"&&n.startsWith("No logProbe configured"))return"logProbe";if(i==="modern-undeclared-capability-error"&&n.startsWith("No inputRequiredProbe configured"))return"inputRequiredProbe";if(i==="modern-tool-output-schema-conformant"&&/^\d+ tool\(s\) declare an outputSchema, but no tools\/call fixture was configured:/.test(n))return"toolCallProbe"}function rd(e){return jp(e)!==void 0}var SA={tasksProbe:"Select a tool that creates a task in setup, then run again.",logProbe:"Select a tool that emits logs in setup, then run again.",inputRequiredProbe:"Select a tool that asks for input in setup, then run again.",toolCallProbe:"Select a tool to check output in setup, then run again.",login:"This server needs a login. Log in, then run again."};function em(e){if(!e||typeof e!="object")return;const t=e[bA];return typeof t=="string"&&t.trim()?t:void 0}function mB(e){const t=jp(e);if(!t)return;const r=e.details;return em(r)??em(r&&typeof r=="object"&&"details"in r?r.details:void 0)??SA[t]}var wA=/^(?:the probed tool )?("(?:[^"\\]|\\.)*") returned a normal result/;function gB(e){if(e.status!=="skipped"||e.skipReason!=="could-not-run"||typeof e.id!="string"||!e.id.startsWith("tasks-"))return;const t=wA.exec(ty(e.error));if(!t)return;let r;try{r=JSON.parse(t[1])}catch{return}if(typeof r=="string")return EA(r)}function EA(e){return`"${e}" did not create a task, so there was nothing to check. Select a tool that creates a task in setup, or change its arguments so it does, then run again.`}function ty(e){return typeof e=="string"?e:e&&typeof e=="object"&&"message"in e&&typeof e.message=="string"?e.message:""}function Bc(e){return e.status==="skipped"&&e.skipReason==="could-not-run"}function ry(e){return e.status==="skipped"&&e.skipReason!=="could-not-run"}function iy(e){if(e.some(i=>i.status==="failed"))return{outcome:"failed"};const t=e.filter(i=>Bc(i)&&(!rd(i)||jp(i)==="login"));if(t.length===0)return e.length===0?{outcome:"incomplete",incompleteReason:"no checks were selected, so this run establishes nothing"}:e.every(rd)?{outcome:"incomplete",incompleteReason:"every selected check needs input from setup, so this run establishes nothing"}:{outcome:"passed"};const r=Array.from(new Set(t.map(i=>i.error?.message??"reason unavailable")));return{outcome:"incomplete",incompleteReason:`${t.length} of ${e.length} selected check(s) could not run, so this run does not establish conformance (${t.map(i=>i.id).join(", ")}): ${r.join(" ")}`}}function ny(e){const t=e.filter(s=>s.status==="passed").length,r=e.filter(s=>s.status==="failed").length,i=e.filter(Bc).length,n=e.filter(ry).length;return`${t}/${e.length} checks passed, ${r} failed, ${i} could not run, ${n} not applicable`}var vB=Object.freeze({toolNameMaxChars:128,maxFeatureClaims:10,maxToolCalls:2}),kA=/^[A-Za-z]:[\\/]/,IA=/[\u0000-\u001f\u007f]/,AA=new TextEncoder;function RA(e){return AA.encode(e).length}function TA(e){let t=e.length;for(;t>0;){const r=e[t-1];if(r!=="."&&r!==" ")break;t-=1}return e.slice(0,t)}function sy(e){if(typeof e!="string"||e.length===0)return{ok:!1,code:"PATH_EMPTY",message:"path is empty"};if(e.includes("\0"))return{ok:!1,code:"PATH_NUL_BYTE",message:"path contains a NUL byte"};if(IA.test(e))return{ok:!1,code:"PATH_INVALID_CHARACTER",message:"path contains control characters"};if(e.startsWith("/")||e.startsWith("\\")||kA.test(e))return{ok:!1,code:"PATH_ABSOLUTE",message:`absolute paths are not allowed: "${e}"`};const t=e.replace(/\\/g,"/").split("/").filter(r=>r!==""&&r!==".");for(const r of t){if(r==="..")return{ok:!1,code:"PATH_TRAVERSAL",message:`path traversal ("..") is not allowed: "${e}"`};if(r.includes(":"))return{ok:!1,code:"PATH_INVALID_CHARACTER",message:`path segments must not contain ":" (drive prefix / alternate data stream): "${e}"`};const i=TA(r);if(i===""||i==="."||i==="..")return{ok:!1,code:"PATH_INVALID_CHARACTER",message:`path segment "${r}" is not portable (empty or dot name after trailing dot/space stripping)`}}return t.length===0?{ok:!1,code:"PATH_EMPTY",message:"path is empty"}:{ok:!0,path:t.join("/").normalize("NFC")}}function CA(e){return e.normalize("NFKC").toLowerCase()}function ua(e,t){return t===e||t.startsWith(`${e}/`)}function kn(e,t){const r=sy(t);return r.ok?{ok:!0,path:e===""?r.path:`${e}/${r.path}`}:r.code==="PATH_ABSOLUTE"||r.code==="PATH_TRAVERSAL"?{ok:!1,code:"PATH_ESCAPES_ROOT",message:`referenced path escapes the bundle root: "${t}"`}:r}function PA(e,t,r){e.length>t.maxEntries&&r.error("BUNDLE_TOO_MANY_ENTRIES",`bundle has ${e.length} entries; the limit is ${t.maxEntries}`);const i=new Set,n=new Map,s=[];let o=0,a=!1;for(const c of e){if(c.kind==="symlink"||c.kind==="hardlink"){r.error("PATH_LINK_ENTRY",`${c.kind} entries are not allowed`,{path:c.path});continue}const l=sy(c.path);if(!l.ok){r.error(l.code,l.message,{path:c.path});continue}const u=l.path;if(RA(u)>t.maxPathBytes){r.error("PATH_TOO_LONG",`path exceeds ${t.maxPathBytes} bytes`,{path:u});continue}if(u.split("/").length>t.maxPathDepth){r.error("PATH_TOO_DEEP",`path exceeds nesting depth ${t.maxPathDepth}`,{path:u});continue}if(i.has(u)){r.error("PATH_DUPLICATE",`duplicate normalized path: "${u}"`,{path:c.path});continue}i.add(u);const p=CA(u),d=n.get(p);if(d!==void 0){r.error("PATH_CASE_COLLISION",`"${u}" collides with "${d}" on case-insensitive filesystems`,{path:u});continue}if(n.set(p,u),c.kind!=="directory"){if(!Number.isFinite(c.size)||c.size<0){r.error("FILE_SIZE_MISMATCH","entry declares an invalid size",{path:u});continue}if(c.size>t.maxFileBytes){r.error("FILE_TOO_LARGE",`file exceeds the per-file limit of ${t.maxFileBytes} bytes`,{path:u});continue}o+=c.size,!a&&o>t.maxTotalBytes&&(a=!0,r.error("BUNDLE_TOO_LARGE",`total uncompressed content exceeds ${t.maxTotalBytes} bytes`)),s.push({sourcePath:c.path,path:u,size:c.size,executable:((c.mode??0)&73)!==0})}}return s.sort((c,l)=>c.path<l.path?-1:c.path>l.path?1:0),s}var id=class extends Error{code;issues;constructor(e){const t=e.find(i=>i.severity==="error"),r=t?.code??"MANIFEST_INVALID_FIELD";super(t?`plugin bundle validation failed: ${t.code}: ${t.message}`:"plugin bundle validation failed"),this.name="PluginBundleError",this.code=r,this.issues=e}},rn=class{all=[];error(e,t,r){this.all.push({code:e,severity:"error",message:t,...r})}warn(e,t,r){this.all.push({code:e,severity:"warning",message:t,...r})}hasErrors(){return this.all.some(e=>e.severity==="error")}issues(){return[...this.all]}warnings(){return this.all.filter(e=>e.severity==="warning")}throwIfErrors(){if(this.hasErrors())throw new id(this.issues())}absorbDemoted(e){for(const t of e.issues())this.all.push(t.severity==="error"?{...t,severity:"warning"}:t)}firstErrorMessage(){return this.all.find(e=>e.severity==="error")?.message}};var Po=/(secret|token|password|passwd|api[-_]?key|private[-_]?key|credential)/i,oy=/(bearer\s+\S|-----BEGIN|\b(?:sk|pk|rk|xox[a-z])-[A-Za-z0-9]|[a-z][a-z0-9+.-]*:\/\/[^/\s:@]*:[^/\s@]+@|[A-Za-z0-9+/_-]{40,})/i;function Vc(e){return oy.test(e)}var Us=Symbol("drop");function nd(e,t,r,i,n){if(r>32)return n.reportedTooDeep||(n.reportedTooDeep=!0,i.issues.error("VALUE_TOO_DEEP",`${i.label}: field "${t}" nests deeper than 32 levels`,i.context)),Us;if(typeof e=="string")return oy.test(e)?(i.issues.warn(i.secretCode,`${i.label}: value of "${t}" looks secret-bearing and is not stored`,i.context),Us):e;if(typeof e=="number"||typeof e=="boolean"||e===null)return e;if(Array.isArray(e)){const s=[];for(let o=0;o<e.length;o++){const a=nd(e[o],`${t}[${o}]`,r+1,i,n);a!==Us&&s.push(a)}return s}if(typeof e=="object"){const s={};for(const[o,a]of Object.entries(e)){const c=t===""?o:`${t}.${o}`;if(Po.test(o)){i.issues.warn(i.secretCode,`${i.label}: field "${c}" looks secret-bearing and is not stored`,i.context);continue}const l=nd(a,c,r+1,i,n);l!==Us&&(s[o]=l)}return s}return Us}function Gc(e,t){return nd(e,"",0,t,{reportedTooDeep:!1})}function ay(e){return["localhost","[::1]","::1"].includes(e)||/^127(?:\.\d{1,3}){3}$/.test(e)}var zp=(e,t)=>!/^[^:/?#]+:\/\/[^\\/?#]/.test(e)||/^[^:]*:[\\/]*[^\\/?#]*@|[\\\s]/.test(e)||t?.allowFragment!==!0&&e.includes("#")||[...e].some(r=>r<" "||r===""),OA=/^[a-z]+(?:[-_][a-z]+)+$/i,xA=e=>e.replace(/%(?!2f)([0-7][0-9a-f])/gi,(t,r)=>String.fromCharCode(Number.parseInt(r,16)));function Hl(e){return[e,xA(e)].some(t=>Vc(t)&&!OA.test(t))}function Fp(e){if(e.pathname.split("/").some(Hl))return!0;const t=e.hash.slice(1);if(Hl(t))return!0;for(const r of[e.searchParams,new URLSearchParams(t)])for(const[i,n]of r)if(Hl(n)||n!==""&&Po.test(i))return!0;return!1}function MA(e){let t;try{t=new URL(e)}catch{return{ok:!1,code:"MCP_INVALID_SERVER",message:'"url" is not a valid URL'}}return zp(e)?{ok:!1,code:"MCP_INVALID_SERVER",message:'"url" must be an absolute https:// URL (or a loopback http:// one) without credentials, a fragment, whitespace or backslashes'}:Fp(t)?{ok:!1,code:"MCP_INVALID_SERVER",message:'"url" looks like it carries a credential, which a plugin must not ship'}:t.protocol==="https:"?{ok:!0,loopbackHttp:!1}:t.protocol==="http:"&&ay(t.hostname)?{ok:!0,loopbackHttp:!0}:{ok:!1,code:"MCP_INSECURE_URL",message:"remote MCP servers must use HTTPS"}}function LA(e){if(typeof e!="string")return{ok:!1,code:"MCP_INVALID_SERVER",message:'"cwd" must be a string'};const t=/^(\.|\$\{PLUGIN_ROOT\}|\$\{PLUGIN_DATA\})(?:\/(.*))?$/s.exec(e);if(t===null||t[1]==="."&&t[2]===void 0)return{ok:!1,code:"MCP_INVALID_WORKING_DIRECTORY",message:'"cwd" must start with "./", "${PLUGIN_ROOT}", or "${PLUGIN_DATA}"'};const r=t[1]==="."?"${PLUGIN_ROOT}":t[1],i=t[2]??"";if(i.replace(/[/.]/g,"")===""&&!i.includes(".."))return{ok:!0,value:r};const n=kn("",i);return n.ok?{ok:!0,value:`${r}/${n.path}`}:{ok:!1,code:n.code,message:n.message}}var cy=/^\$\{[A-Za-z_][A-Za-z0-9_]*\}$/,tm=/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g,$A=/^\$\{(?:PLUGIN_ROOT|PLUGIN_DATA)\}[A-Za-z0-9._/-]*$/,rm=new Set(["PLUGIN_ROOT","PLUGIN_DATA"]),NA=/^[A-Za-z0-9.:/@,+_-]*$/,DA=/[A-Za-z0-9_-]{16,}/,UA=/(authorization|token|secret|api[-_]?key|cookie|password|credential)/i;function ly(e,t){return e.name<t.name?-1:e.name>t.name?1:0}function qA(e,t,r,i){if(r===void 0)return[];if(r===null||typeof r!="object"||Array.isArray(r))return i.error("MCP_INVALID_ENV",`server "${e}": "env" must be an object`,{componentKey:t}),null;const n=new Map,s=new Set;for(const[o,a]of Object.entries(r)){if(rm.has(o))return i.error("MCP_RESERVED_ENV_KEY",`server "${e}": env may not define "${o}" — it is client-controlled`,{componentKey:t}),null;if(typeof a!="string"){i.error("MCP_INVALID_ENV",`server "${e}": env "${o}" must be a string`,{componentKey:t});continue}if($A.test(a)){n.set(o,{name:o,required:!1,valueTemplate:a});continue}if(a===""||cy.test(a)){n.set(o,{name:o,required:!0});continue}const c=[...a.matchAll(tm)].map(l=>l[1]).filter(l=>!rm.has(l));if(c.length>0){const l=a.replace(tm,"");if(NA.test(l)&&!DA.test(l)&&!Po.test(o)){n.set(o,{name:o,required:!1,valueTemplate:a});for(const u of c)s.add(u);continue}}else if(!Po.test(o)&&!Vc(a)){n.set(o,{name:o,required:!1,value:a});continue}n.set(o,{name:o,required:!0}),i.warn("MCP_ENV_VALUE_OMITTED",`server "${e}": literal value of env "${o}" is not stored; configure it during setup`,{componentKey:t})}for(const o of s)n.has(o)||n.set(o,{name:o,required:!0});return[...n.values()].sort(ly)}function jA(e,t,r,i){if(r===void 0)return[];if(r===null||typeof r!="object"||Array.isArray(r))return i.error("MCP_INVALID_HEADERS",`server "${e}": "headers" must be an object`,{componentKey:t}),null;const n=[],s=new Set;for(const[o,a]of Object.entries(r)){if(s.has(o.toLowerCase()))return i.error("MCP_INVALID_HEADERS",`server "${e}": header "${o}" is declared more than once`,{componentKey:t}),null;if(s.add(o.toLowerCase()),typeof a!="string"){i.error("MCP_INVALID_HEADERS",`server "${e}": header "${o}" must be a string`,{componentKey:t});continue}const c=UA.test(o);if(a===""||cy.test(a)){n.push({name:o,secret:c});continue}const l=Vc(a);if(!c&&!l){n.push({name:o,secret:!1,value:a});continue}i.warn("MCP_HEADER_VALUE_OMITTED",`server "${e}": literal value of header "${o}" is not stored; configure it during setup`,{componentKey:t}),n.push({name:o,secret:c||l})}return n.sort(ly)}function zA(e,t,r,i){const n={},s=r.authentication;if(typeof s=="string"){const a=s.toLowerCase();a==="on_install"?n.timing="on_install":a==="on_use"&&(n.timing="on_use")}const o=r.oauth??(typeof s=="object"?s:void 0);if(o&&typeof o=="object"&&!Array.isArray(o)){const a=o,c=a.scopes;Array.isArray(c)&&c.every(p=>typeof p=="string")&&(n.scopes=c);const l={};for(const[p,d]of Object.entries(a))p!=="scopes"&&(l[p]=d);const u=Gc(l,{issues:i,secretCode:"MCP_SECRET_FIELD_OMITTED",label:`server "${e}": oauth`,context:{componentKey:t}});Object.keys(u).length>0&&(n.metadata=u)}return n}var FA={url:"https://developers.openai.com/plugins/deploy/submission-errors",capturedOn:"2026-11-13"},xr={plugin_manifest_missing:{table:"Plugin manifest errors",message:"ZIP must contain root `plugin.json` with a supported Agent Plugins schema, `.codex-plugin/plugin.json`, `.agent-plugin/plugin.json`, or `.claude-plugin/plugin.json` at the root or in its single top-level directory."},plugin_root_ambiguous:{table:"Plugin root errors",message:"ZIP must contain exactly one plugin root, either at the archive root or in one top-level directory."},plugin_root_has_siblings:{table:"Plugin root errors",message:"A ZIP with a top-level plugin directory must not contain sibling files."},plugin_name_missing:{table:"Plugin manifest errors",message:"`name` is required."},plugin_name_wrong_type:{table:"Plugin manifest errors",message:"`name` must be a string."},plugin_name_empty:{table:"Plugin manifest errors",message:"`name` must be non-empty."},plugin_name_too_long:{table:"Plugin manifest errors",message:"`name` must be 64 characters or fewer."},plugin_name_format:{table:"Plugin manifest errors",message:"`name` must start with an ASCII letter or digit and contain only ASCII letters, digits, `_`, or `-`."}},HA=/^(?!.*(?:--|\.\.))[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?$/;var uy=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;function BA(e){if(e===void 0)return["plugin_name_missing"];if(typeof e!="string")return["plugin_name_wrong_type"];if(e.trim()==="")return["plugin_name_empty"];const t=[];return e.length>64&&t.push("plugin_name_too_long"),uy.test(e)||t.push("plugin_name_format"),t}var VA='manifest "name" must be 1-64 lowercase [a-z0-9.-] chars with single separators (no "--" or "..")';function GA(e,t){const[r]=BA(e),i=t==="openai-compatible";return typeof e=="string"&&(e.length<=64&&HA.test(e)||i&&r===void 0)?{ok:!0,name:e}:{ok:!1,message:i&&r!==void 0?xr[r].message:VA}}var Ii="plugin.json",sd=Object.freeze({"1.0.0":"https://agent-plugins.org/schemas/1.0.0/plugin.schema.json"}),Yi="com.mcpjam",Hp=/\[TODO:/i,dy=["description","license"],py=["homepage","repository"],WA=new Set(["command","entrypoint","exec","install","install_script","postinstall","preinstall","run","script","scripts"]),JA=new Set(["$schema","name","version","author","keywords","extensions","interface",...dy,...py]);function od(e,t,r,i=0,n={reportedTooDeep:!1}){if(typeof e=="string"){Hp.test(e)&&r.error("MANIFEST_PLACEHOLDER",`manifest field "${t}" contains an unresolved placeholder`);return}if(i>32){n.reportedTooDeep||(n.reportedTooDeep=!0,r.error("VALUE_TOO_DEEP",`manifest field "${t}" nests deeper than 32 levels`));return}if(Array.isArray(e)){e.forEach((s,o)=>od(s,`${t}[${o}]`,r,i+1,n));return}if(e&&typeof e=="object")for(const[s,o]of Object.entries(e))od(o,t===""?s:`${t}.${s}`,r,i+1,n)}function im(e,t,r){if(typeof t!="string"){r.error("MANIFEST_INVALID_FIELD",`manifest field "${e}" must be a string URL`);return}let i;try{i=new URL(t)}catch{r.warn("MANIFEST_INVALID_FIELD",`manifest field "${e}" is not a valid URL; ignored`);return}if(i.username!==""||i.password!==""||Fp(i)){r.warn("MANIFEST_SECRET_FIELD_OMITTED",`manifest field "${e}" carries a credential; ignored`);return}if(zp(t,{allowFragment:!0})){r.warn("MANIFEST_INVALID_FIELD",`manifest field "${e}" is not a URL as written; ignored`);return}if(i.protocol!=="https:"){r.warn("MANIFEST_INSECURE_URL",`manifest field "${e}" must use HTTPS; ignored`);return}return t}function KA(e,t,r,i){const n=t[Yi];if(n===void 0)return;if(n===null||typeof n!="object"||Array.isArray(n)){i.warn("MANIFEST_INVALID_FIELD",`extension namespace "${Yi}" must be an object; ignored`);return}const s=n,o=s.displayName??s.display_name;o!==void 0&&(typeof o!="string"?i.warn("MANIFEST_INVALID_FIELD",`"${Yi}.displayName" must be a string; ignored`):e.displayName=o);for(const a of["icon","logo"]){const c=s[a];if(c===void 0)continue;if(typeof c!="string"){i.warn("MANIFEST_INVALID_FIELD",`"${Yi}.${a}" must be a bundle-relative path; ignored`);continue}const l=kn("",c);if(!l.ok){i.warn(l.code,`"${Yi}.${a}": ${l.message}`);continue}if(!r.has(l.path)){i.warn("MANIFEST_MISSING_FILE",`"${Yi}.${a}" references a file that is not in the bundle: "${l.path}"`,{path:l.path});continue}e[a]=l.path}}var Er="com.openai",hy=["logo","logoDark","composerIcon"];function un(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function YA(e,t,r,i){for(const{label:n,value:s}of t)if(s!==void 0){if(!un(s)){i.warn("MANIFEST_INVALID_FIELD",`"${n}" must be an object; ignored`);continue}s.displayName!==void 0&&typeof s.displayName!="string"?i.warn("MANIFEST_INVALID_FIELD",`"${n}.displayName" must be a string; ignored`):s.displayName?.trim()&&(Hp.test(s.displayName)?i.warn("MANIFEST_INVALID_FIELD",`"${n}.displayName" is an unresolved placeholder; ignored`):e.displayName=s.displayName);for(const o of hy){const a=s[o];if(a===void 0)continue;if(typeof a!="string"){i.warn("MANIFEST_INVALID_FIELD",`"${n}.${o}" must be a bundle-relative path; ignored`);continue}const c=kn("",a);if(!c.ok){i.warn(c.code,`"${n}.${o}": ${c.message}`);continue}if(!r.has(c.path)){i.warn("MANIFEST_MISSING_FILE",`"${n}.${o}" references a file that is not in the bundle: "${c.path}"`,{path:c.path});continue}e[o]=c.path}}}function XA(e,t){if(e.logo===void 0&&e.logoDark===void 0){t.warn("MANIFEST_DIRECTORY_ICON_MISSING",'plugin has no directory icon: OpenAI requires "interface.logo" (light) and "interface.logoDark" (dark), PNG');return}if(e.logo===void 0||e.logoDark===void 0){const r=e.logo===void 0?"logo":"logoDark";t.warn("MANIFEST_DIRECTORY_ICON_VARIANT_MISSING",`plugin directory icon has no ${r==="logo"?"light":"dark"} variant: add "interface.${r}"`)}}function ZA(e,t){const{filePaths:r,issues:i}=t;if(e===null||typeof e!="object"||Array.isArray(e))return i.error("MANIFEST_INVALID_JSON","plugin.json must contain a JSON object"),{manifest:null};const n=e,s=n.$schema,o=typeof s=="string"?Object.keys(sd).find(f=>sd[f]===s):void 0;if(o===void 0)return i.error("MANIFEST_UNSUPPORTED_SCHEMA",s===void 0?'manifest is missing the required "$schema" field':`manifest "$schema" is not a supported Agent Plugins schema: ${String(s)}`),{manifest:null};const a=GA(n.name,t.profile??"strict");if(!a.ok)return i.error("MANIFEST_INVALID_NAME",a.message),{manifest:null};const c={schemaVersion:o,name:a.name,extensions:{}};n.version!==void 0&&(typeof n.version!="string"||n.version.length===0?i.error("MANIFEST_INVALID_VERSION",'manifest "version" must be a non-empty string when present'):c.version=n.version);for(const f of dy){const m=n[f];if(m!==void 0){if(typeof m!="string"){i.error("MANIFEST_INVALID_FIELD",`manifest field "${f}" must be a string`);continue}c[f]=m}}for(const f of py){if(n[f]===void 0)continue;const m=im(f,n[f],i);m!==void 0&&(c[f]=m)}const l=n.author;if(l!==void 0)if(l&&typeof l=="object"&&!Array.isArray(l)){const f=l,m={};for(const v of Object.keys(f)){if(v==="name"||v==="email"||v==="url"){v!=="url"&&typeof f[v]!="string"&&i.error("MANIFEST_INVALID_FIELD",`manifest field "author.${v}" must be a string`);continue}i.warn("MANIFEST_UNKNOWN_FIELD",`manifest field "author.${v}" is not part of Agent Plugins ${o}; ignored`)}if(typeof f.name=="string"&&(m.name=f.name),typeof f.email=="string"&&(m.email=f.email),f.url!==void 0){const v=im("author.url",f.url,i);v!==void 0&&(m.url=v)}c.author=m}else i.error("MANIFEST_INVALID_FIELD",'manifest field "author" must be an object');const u=n.keywords;u!==void 0&&(!Array.isArray(u)||u.some(f=>typeof f!="string")?i.error("MANIFEST_INVALID_FIELD",'manifest field "keywords" must be an array of strings'):c.keywords=u);const p=un(n.extensions)?n.extensions[Er]:void 0,d=n.interface!==void 0||p!==void 0;YA(c,[{label:"interface",value:n.interface},{label:`extensions.${Er}.interface`,value:un(p)?p.interface:void 0}],r,i);const h=n.extensions;h!==void 0&&(h===null||typeof h!="object"||Array.isArray(h)?i.warn("MANIFEST_INVALID_FIELD",'manifest field "extensions" must be an object; ignored'):(c.extensions=Gc(eR(h),{issues:i,secretCode:"MANIFEST_SECRET_FIELD_OMITTED",label:"manifest extensions"}),KA(c,h,r,i))),d&&XA(c,i);for(const f of Object.keys(n))if(!JA.has(f)){if(WA.has(f)){i.error("MANIFEST_AMBIGUOUS_FIELD",`manifest field "${f}" is not supported and is execution-ambiguous; remove it`);continue}i.warn("MANIFEST_UNKNOWN_FIELD",`manifest field "${f}" is not part of Agent Plugins ${o}; ignored`)}return od(c,"",i),{manifest:c,onboardingSkill:un(p)?p.onboardingSkill:void 0}}var QA=new Set(["displayName",...hy]);function eR(e){const t=e[Er];if(!un(t))return e;const{onboardingSkill:r,...i}=t;return un(i.interface)&&(i.interface=Object.fromEntries(Object.entries(i.interface).filter(([n,s])=>!QA.has(n)||typeof s!="string"||!Hp.test(s)))),{...e,[Er]:i}}function tR(e,t,r,i){const n=e.extensions[Er],s=un(n)?{...n}:void 0;if(s!==void 0&&(delete s.onboardingSkill,e.extensions[Er]=s),t===void 0)return;const o=typeof t=="string"?kn("",t):null,a=o?.ok?r.find(c=>c.skillFilePath===o.path):void 0;if(a===void 0||s===void 0){i.warn("MANIFEST_MISSING_FILE","the onboarding skill this plugin names is not one of its loaded skills; onboarding is unavailable");return}e.onboarding={skillPath:a.skillFilePath,componentKey:a.componentKey},s.onboardingSkill=t}var rR={maxEntries:1e3,maxTotalBytes:104857600,maxFileBytes:10485760,maxPathBytes:512,maxPathDepth:20,maxSkills:20,maxMcpServers:20},fy=Object.freeze({strict:2,"openai-compatible":1}),Cr=".codex-plugin/plugin.json",my=".agent-plugin/plugin.json",gy=".claude-plugin/plugin.json",iR=".mcp.json",vy=[{path:Cr,layout:"codex"},{path:my,layout:"agent-legacy"},{path:gy,layout:"claude"}],nR=new Set(["skills","mcpServers","apps","interface","onboardingSkill","extensions"]),_y={hooks:"lifecycle hooks",commands:"slash commands",agents:"agents",outputStyles:"output styles",lspServers:"language servers"};function ii(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function yy(e,t){if(typeof e!="string")return!1;const r=kn("",e);return r.ok&&r.path===t}function by(e,t,r){const i=e.extensions,n=ii(i)?i[Er]:void 0,s=ii(n)?{...n}:{};for(const a of["interface","apps"])e[a]!==void 0&&s[a]===void 0&&(s[a]=e[a]);const o=e.onboardingSkill;return o!==void 0&&s.onboardingSkill===void 0?s.onboardingSkill=o:o!==void 0&&s.onboardingSkill!==o&&(r.warn("MANIFEST_INVALID_FIELD",`${t} declares two different onboarding skills; neither is used`,{path:t}),delete s.onboardingSkill),s}function Sy(e,t){const{[Er]:r,...i}=e??{};return Object.keys(t).length>0?{...i,[Er]:t}:i}function wy(e,t,r){for(const[i,n]of Object.entries(_y))e[i]!==void 0&&r.warn("UNSUPPORTED_COMPONENT",`"${i}" in ${t} declares ${n}, which MCPJam does not run; ignored`,{path:t})}function sR(e,t,{filePaths:r,issues:i}){if(e===void 0)return r.has(".mcp.json")?{legacyMcp:{kind:"file",path:iR}}:{};if(ii(e))return{legacyMcp:{kind:"inline",path:t,document:e}};const n=typeof e=="string"?kn("",e):null;if(n===null||!n.ok){const s=`"mcpServers" in ${t}: ${n===null?"must be a path or an object":n.message}`;return i.warn(n?.code??"MCP_INVALID_CONFIG",s,{path:t}),{skipped:{kind:"mcp-config",key:t,reason:s}}}return r.has(n.path)?{legacyMcp:{kind:"file",path:n.path}}:(i.warn("MANIFEST_MISSING_FILE",`"mcpServers" in ${t} names "${n.path}", which is not in the bundle`,{path:n.path}),{})}function oR(e,t,r){const{issues:i}=r,n=t.manifestPath,s={};for(const[c,l]of Object.entries(e))!nR.has(c)&&!(c in _y)&&(s[c]=l);const o=s.$schema;String(o).startsWith("https://agent-plugins.org/schemas/")||(s.$schema=sd["1.0.0"]);const a=e.extensions;if(a!==void 0&&!ii(a))s.extensions=a;else{const c=Sy(a,by(e,n,i));Object.keys(c).length>0&&(s.extensions=c)}if(e.skills!==void 0&&!yy(e.skills,"skills")){const c=typeof e.skills=="string"?`"${e.skills}"`:"a non-path value";i.warn("UNSUPPORTED_COMPONENT",`"skills" in ${n} names ${c}; skills are read only from "skills/"`,{path:n})}return wy(e,n,i),{interpretation:t,record:s,...sR(e.mcpServers,n,r)}}function aR(e,t,{readJson:r,issues:i}){const n=l=>(i.warn("MANIFEST_OVERLAY_IGNORED",`"${Cr}" is ignored: ${l}`,{path:Cr}),{interpretation:t,record:e}),s=e.extensions;if(s!==void 0&&!ii(s))return n(`"${Ii}" has no usable "extensions"`);if(ii(s?.["com.openai"]))return n(`"${Ii}" declares extensions["${Er}"], which replaces it`);const o=new rn,a=r(Cr,o);if(!ii(a))return n(o.firstErrorMessage()??"it must be a JSON object");for(const[l,u]of[["skills","skills"],["mcpServers","mcp.json"]])a[l]===void 0||yy(a[l],u)||i.warn("MANIFEST_OVERLAY_IGNORED",`"${l}" in ${Cr} is ignored: with a root plugin.json it is always "${u}"`,{path:Cr});wy(a,Cr,i);const c=by(a,Cr,i);return{interpretation:{...t,overlayPath:Cr},record:{...e,extensions:Sy(s,c)}}}function Ey(e,{filePaths:t,issues:r}){for(const{path:i}of vy)i===e||e==="plugin.json"&&i===".codex-plugin/plugin.json"||!t.has(i)||r.warn("MANIFEST_OVERLAY_IGNORED",`"${i}" is ignored: "${e}" is the manifest`,{path:i})}function cR(e){const{profile:t,filePaths:r,readJson:i,issues:n}=e,s={profile:t,revision:fy[t],layout:"agent-plugins",manifestPath:Ii},o=i(Ii,n);return t==="strict"||!ii(o)?{interpretation:s,record:o}:(Ey(Ii,e),r.has(".codex-plugin/plugin.json")?aR(o,s,e):{interpretation:s,record:o})}function lR(e){const{profile:t,location:r,readJson:i,issues:n}=e;if(r.layout==="agent-plugins")return cR(e);Ey(r.path,e);const s={profile:t,revision:fy[t],layout:r.layout,manifestPath:r.path},o=i(r.path,n);return ii(o)?oR(o,s,e):{interpretation:s,record:o}}var nm="2026-08-19",sm="https://developers.openai.com/plugins",ky=["quickstart","plugin-guidelines","reference","changelog","plan/use-case","plan/tools","concepts/plugins","concepts/skills","concepts/ui-guidelines","build/plugins","build/skills","build/mcp-server","build/chatgpt-ui","build/auth","build/monetization","build/examples","deploy/connect-chatgpt","deploy/submission","deploy/submission-errors","deploy/troubleshooting","guides/optimize-metadata","guides/submit-claude-plugin","guides/product-checkout-conversion-spec"],Iy=[{page:"help/plugins-in-chatgpt-and-codex",url:"https://help.openai.com/en/articles/20001256-plugins-in-chatgpt-and-codex"},{page:"help/submitting-apps-to-the-chatgpt-app-directory",url:"https://help.openai.com/en/articles/20001040-submitting-apps-to-the-chatgpt-app-directory"}],Ay={"app-guidelines":"plugin-guidelines"};function uR(e){return Object.hasOwn(Ay,e)}var _B=[...ky,...Iy.map(e=>e.page)],om={},dR=[...ky.map(e=>({page:e,url:`${sm}/${e}`,revisionUrl:`${sm}/${e}.md`,format:"markdown",revision:om[e]??null,snapshotDate:nm})),...Iy.map(e=>({page:e.page,url:e.url,revisionUrl:e.url,format:"html",revision:om[e.page]??null,snapshotDate:nm}))],pR=Object.freeze(Object.fromEntries(dR.map(e=>[e.page,e])));function gr(e,t){const r=pR[uR(e)?Ay[e]:e];return{page:r.page,section:t,url:r.url,revision:r.revision,snapshotDate:r.snapshotDate}}var Ua={maxCompressedBytes:104857600,maxUncompressedBytes:536870912,maxEntries:5e3},hR={portable:Ii,canonical:Cr,accepted:[my,gy]},er={nameMaxLength:100,pluginNameMaxLength:64,displayNameMaxLength:100,shortDescriptionMaxLength:255,descriptionMaxLength:2e3,defaultPromptMaxLength:255,toolNameMaxLength:64,skillNameMaxLength:64},Ry=["productivity","education","developer-tools","design","writing","research","data-analysis","marketing","sales","finance","health","travel","entertainment"],qa={minEdgePx:48,maxEdgePx:4096,mustBeSquare:!0,maxBytes:5242880,acceptedMimeTypes:["image/png","image/jpeg","image/webp","image/svg+xml"]},fR={lightBackground:"#FFFFFF",darkBackground:"#212121",minRatio:2},Xi={maxSkillMarkdownBytes:262144,maxPageBytes:1048576,maxSkillTotalBytes:5242880,maxImportedTotalBytes:8388608,maxSkills:5,maxPagesPerSkill:10},mR="/.well-known/openai-apps-challenge",gR="text/html;profile=mcp-app",vR="/mcp",_R=["readOnlyHint","destructiveHint","openWorldHint"],nn={successCount:5,failureCount:3},yR={originChangeRequiresNewPlugin:!0,uiContentChangesStayLive:!0,uiContentCacheSeconds:3600},yB={archiveLimits:Ua,manifestLocations:hR,fieldLimits:er,listingCategories:Ry,imageConstraints:qa,brandColorContrast:fR,mcpSkillLimits:Xi,domainVerificationPath:mR,appHtmlMime:gR,expectedMcpPath:vR,requiredToolAnnotations:_R,submissionTestCases:nn,releaseRules:yR,source:gr("deploy/submission","Host profile constants")},Ty={columns:["Resource","Lookup"],keys:["fixture","lookup"],placeholders:[["Sample Project",'get_project {"name": "Sample Project"}']],maxRows:20,grow:!0},bR="Upload new or existing plugin",SR={upload:{title:"Upload your plugin ZIP",intro:"Compress your plugin folder into a .zip file before uploading",layout:{blocks:[{widget:"upload",text:{drop:"Upload new or existing plugin",button:"Upload plugin",checked:"Errors block the upload; warnings require confirmation."}}]}},listing:{title:"Metadata & Skills",intro:"Package details are read-only here; edit them in your source package.",layout:{blocks:[{widget:"plugin-header",fields:["listing.displayName","listing.shortDescription"]},{heading:"Metadata",fields:["listing.description","listing.developer","listing.name","listing.category","listing.capabilities","listing.website","listing.support","listing.privacyPolicy","listing.terms","listing.starterPrompts"],text:{upload:"Upload new version"}},{heading:"Skills",widget:"skills",text:{passed:"Checks passed",attention:"Needs attention"}},{widget:"findings",text:{title:"Findings",all:"All",blocking:"Blocking",copy:"Copy findings"}}]}},mcp:{title:"MCPs",intro:"Your package can declare multiple MCP servers, but only one MCP server can be connected per plugin.",layout:{blocks:[{heading:"Connect MCP server",widget:"connect",fields:["mcp.serverUrl","mcp.verificationToken"],text:{authentication:"Authentication",authorize:"Your MCP server needs OAuth access before we can scan its tools.",settings:"You can define advanced settings in your mcp.json",domain:"Domain verification",verified:"Domain verified",reconnect:"Reconnect",rescan:"Rescan"}},{heading:"Tools",widget:"tools"}]}},reviewer:{title:"Review information",intro:"Read-only fields are managed by your plugin ZIP. To change read-only information, update your plugin ZIP and upload it again.",layout:{blocks:[{heading:"Countries and translations",note:"Its fields were not captured."},{heading:"Reviewer credentials",note:"Test credentials must work immediately with no additional setup required. Logging in must provide immediate access to a demo account.",fields:["reviewer.loginUrl","reviewer.tenant","reviewer.username","reviewer.passwordSecret","reviewer.signInSteps"]},{fields:["reviewer.identityTool","reviewer.identityArgs","reviewer.expectedIdentityPath","reviewer.expectedIdentity","reviewer.expectedOrganizationPath","reviewer.expectedOrganization","reviewer.fixtures"]},{heading:"Test cases",fields:["reviewer.testCases"]},{heading:"Negative test cases",fields:["reviewer.negativeTestCases"]},{heading:"Supporting content",fields:["reviewer.demoRecordingUrl","reviewer.releaseNotes"]},{widget:"drawer-actions",text:{back:"Back",next:"Next",save:"Save details"}}]}},submit:{title:"Submit for review",intro:"Complete the required policy attestations.",layout:{blocks:[{fields:["submit.developerIdentity"]},{fields:["submit.attestations"]},{widget:"non-blocking-findings",text:{title:"Non-blocking findings",body:"These findings do not block submission, but unresolved findings may lead to rejection during review."}},{fields:["submit.additionalContext"]},{widget:"submit",text:{cancel:"Cancel",submit:"Submit"}}]}},publish:{title:"Publish your approved plugin",intro:"Open the approved package version and select Publish plugin.",layout:{blocks:[{widget:"publish",text:{button:"Publish plugin"}}]}}},wR={"listing.displayName":{label:"Display name",packagePath:"plugin.json#/extensions/com.openai/interface/displayName",errors:{required:"Display name is required, non-empty, and single-line.",tooLong:"Display name must be 30 characters or fewer."}},"listing.shortDescription":{label:"Short description",packagePath:"plugin.json#/extensions/com.openai/interface/shortDescription",errors:{required:"Short description is required, non-empty, and single-line.",tooLong:"Short description must be 30 characters or fewer."}},"listing.description":{label:"About",packagePath:"plugin.json#/extensions/com.openai/interface/longDescription",errors:{required:"Long description is required and must be non-empty. Line breaks are allowed.",tooLong:"Long description must be 4,000 characters or fewer."}},"listing.developer":{label:"Developer",packagePath:"plugin.json#/extensions/com.openai/interface/developerName",errors:{required:"Developer name is required.",tooLong:"Developer name must be 80 characters or fewer."}},"listing.name":{label:"Package name",packagePath:"plugin.json#/name"},"listing.category":{label:"Category",packagePath:"plugin.json#/extensions/com.openai/interface/category",options:[{value:"Productivity",label:"Productivity"},{value:"Creativity",label:"Creativity"},{value:"Developer Tools",label:"Developer Tools"},{value:"Business & Operations",label:"Business & Operations"},{value:"Data & Analytics",label:"Data & Analytics"},{value:"Communication",label:"Communication"},{value:"Education & Research",label:"Education & Research"},{value:"Security",label:"Security"},{value:"Finance",label:"Finance"},{value:"Healthcare",label:"Healthcare"},{value:"Travel",label:"Travel"},{value:"Entertainment",label:"Entertainment"},{value:"Other",label:"Other"}]},"listing.capabilities":{label:"Capabilities",packagePath:"plugin.json#/extensions/com.openai/interface/capabilities"},"listing.website":{label:"Website",packagePath:"plugin.json#/extensions/com.openai/interface/websiteURL",errors:{required:"Website URL is required."}},"listing.support":{label:"Support",packagePath:"plugin.json#/extensions/com.openai/interface/supportURL"},"listing.privacyPolicy":{label:"Privacy policy",packagePath:"plugin.json#/extensions/com.openai/interface/privacyPolicyURL"},"listing.terms":{label:"Terms of service",packagePath:"plugin.json#/extensions/com.openai/interface/termsOfServiceURL"},"listing.starterPrompts":{label:"Starter prompts",packagePath:"plugin.json#/extensions/com.openai/interface/defaultPrompt"},"mcp.serverUrl":{label:"MCP Server URL",packagePath:"mcp.json#/mcpServers/*/url"},"mcp.verificationToken":{label:"Domain verification token",helper:"The portal issues this token in its MCP step."},"reviewer.loginUrl":{label:"Login URL"},"reviewer.tenant":{label:"Tenant",placeholder:"Choose an organization"},"reviewer.username":{label:"Username"},"reviewer.passwordSecret":{label:"Password",placeholder:"Demo account password"},"reviewer.signInSteps":{label:"Sign-in steps",placeholder:"Steps for this account"},"reviewer.identityTool":{label:"Identity tool",placeholder:"whoami",helper:"MCPJam's own check, not part of the portal: a read-only tool on your server that returns the signed-in account. MCPJam calls it as the reviewer."},"reviewer.identityArgs":{label:"Identity tool arguments",placeholder:"{}",helper:"Fixed JSON arguments, if the identity tool takes any."},"reviewer.expectedIdentityPath":{label:"Identity path",placeholder:"$.user.email",helper:"Where the tool's result names the account, as a JSON path."},"reviewer.expectedIdentity":{label:"Expected reviewer",placeholder:"review@example.com",helper:"The account reviewers sign in as."},"reviewer.expectedOrganizationPath":{label:"Organization path",placeholder:"$.organization.name",helper:"Where the tool's result names the organization or project, as a JSON path."},"reviewer.expectedOrganization":{label:"Expected organization",placeholder:"Sample Org",helper:"The organization or project reviewers should land in."},"reviewer.fixtures":{label:"Fixtures",helper:"MCPJam's own check: resources your test cases name, each with a read-only tool call that finds it in the reviewer's account."},"reviewer.testCases":{label:"Test cases",packagePath:"plugin.json#/extensions/com.openai/review/test_cases/positive"},"reviewer.negativeTestCases":{label:"Negative test cases",packagePath:"plugin.json#/extensions/com.openai/review/test_cases/negative"},"reviewer.demoRecordingUrl":{label:"Video walkthrough URL",packagePath:"plugin.json#/extensions/com.openai/review/demo_recording_url"},"reviewer.releaseNotes":{label:"Release notes",packagePath:"plugin.json#/extensions/com.openai/publication/release_notes"},"submit.developerIdentity":{label:"Developer identity"},"submit.attestations":{label:"Policy attestations",options:[{value:"terms-and-guidelines",label:"I have reviewed and agree to OpenAI's Terms and Plugin Guidelines. I confirm that my plugin is in compliance with those Terms and Guidelines."},{value:"applicable-laws",label:"I confirm that my plugin complies with all laws and regulations applicable to the industry it operates in. I understand that I am responsible for that compliance."},{value:"no-money-movement",label:"I confirm that my plugin does not initiate or execute money transfers, crypto transfers, or investment trades on behalf of users."},{value:"third-party-rights",label:"I confirm that I have all necessary rights to any third-party content or API endpoints accessed, displayed, or used by my plugin."},{value:"suitable-under-18",label:"I confirm that my plugin is suitable for individuals under 18 and does not include mature or adult content."},{value:"not-targeting-children",label:"I confirm that my plugin does not target children under 13 or share their personal information with OpenAI."}]},"submit.additionalContext":{label:"Additional Submission Context",helper:"Add any additional information that might be useful for the review team, including justification for any findings. This optional note is private to the review."}},ER=[{step:"upload",needs:["package"],reads:[],checks:["openai.package.archive","openai.package.manifest","openai.package.skills","openai.package.assets","openai.package.exclusions","openai.package.manifest-location","openai.package.observation.*","openai.migration.unsupported-surfaces","openai.migration.user-config","openai.migration.stdio-transport","openai.migration.host-language"]},{step:"listing",needs:["package"],reads:["listing.displayName","listing.shortDescription","listing.description"],checks:["openai.policy.non-promotional-package"]},{step:"listing",needs:[],reads:["listing.displayName","listing.shortDescription","listing.description"],checks:["openai.policy.non-promotional-listing"]},{step:"listing",needs:[],reads:["listing.displayName","listing.shortDescription","listing.description","listing.category"],checks:["openai.submission.listing-fields"]},{step:"listing",field:"listing.privacyPolicy",needs:[],reads:["listing.privacyPolicy","listing.support"],checks:["openai.submission.urls"]},{step:"listing",field:"listing.privacyPolicy",needs:[],reads:["listing.privacyPolicy"],checks:["openai.submission.privacy-disclosure","openai.policy.privacy-consistency"]},{step:"listing",needs:[],reads:[],checks:["openai.policy.originality","openai.policy.no-advertising","openai.policy.commerce","openai.feature.checkout"]},{step:"listing",needs:["server"],reads:["mcp.serverUrl"],checks:["openai.skills.extension","openai.skills.listing-complete","openai.skills.caps","openai.skills.digests","openai.skills.frontmatter","openai.skills.snapshot","openai.feature.imported-skills","openai.ui.screenshots"]},{step:"listing",needs:["server","model"],reads:["mcp.serverUrl"],checks:["openai.experience.listing-copy-placeholder","openai.experience.listing-copy-overpromises","openai.experience.skill-overlap"]},{step:"mcp",field:"mcp.serverUrl",needs:[],reads:["mcp.serverUrl"],checks:["openai.endpoint.https","openai.endpoint.path"]},{step:"mcp",field:"mcp.serverUrl",needs:["server"],reads:["mcp.serverUrl"],checks:["openai.endpoint.redirects-stay-https","openai.endpoint.redirects-terminate"]},{step:"mcp",field:"mcp.verificationToken",needs:["server"],reads:["mcp.serverUrl","mcp.verificationToken"],checks:["openai.domain.challenge-served","openai.domain.challenge-matches"]},{step:"mcp",field:"mcp.verificationToken",needs:[],reads:["mcp.verificationToken"],checks:["openai.submission.domain-token"]},{step:"mcp",needs:["server"],reads:["mcp.serverUrl"],checks:["openai.auth.challenge","openai.auth.prm-discoverable","openai.auth.prm-pointer","openai.auth.issuers-resolve","openai.auth.pkce-s256","openai.auth.rfc9207-iss","openai.auth.client-acquisition","openai.auth.runtime-challenge","openai.auth.unsupported-flows","openai.tools.annotations","openai.tools.descriptions","openai.tools.name-length","openai.tools.schemas","openai.tools.annotation-honesty","openai.tools.security-schemes","openai.profile.declared","openai.profile.input-empty","openai.profile.output-schema","openai.profile.read-only","openai.profile.description-honesty","openai.ui.mime","openai.ui.domain-present","openai.ui.domain-unique","openai.ui.csp-exact","openai.ui.output-schema","openai.ui.useful-without-ui","openai.submission.annotation-justifications","openai.submission.frame-domain-explanations","openai.release.origin","openai.release.contract","openai.release.schema-compatibility","openai.release.live-changes","openai.feature.profile-identification","openai.feature.ui-templates","openai.feature.cimd","openai.feature.lazy-authentication"]},{step:"mcp",needs:[],reads:[],checks:["openai.submission.scan-currency","openai.policy.predictable-side-effects","openai.policy.response-minimization"]},{step:"mcp",needs:["server","model"],reads:["mcp.serverUrl"],checks:["openai.experience.tool-descriptions-uninformative","openai.experience.tool-overlap","openai.experience.naming-inconsistent","openai.experience.destructive-tool-underexplained","openai.experience.auth-story-unclear","both.decision.annotation-matches-behaviour"]},{step:"mcp",needs:["model"],reads:["mcp.serverUrl","listing.displayName","listing.shortDescription","listing.description"],checks:["openai.decision.fair-play","openai.decision.secret-seeking"]},{step:"reviewer",needs:[],reads:["reviewer.demoRecordingUrl","reviewer.loginUrl","reviewer.username","reviewer.passwordSecret"],checks:["openai.submission.demo-access"]},{step:"reviewer",field:"reviewer.identityTool",needs:["server","reviewer"],reads:["mcp.serverUrl","reviewer.identityTool","reviewer.identityArgs","reviewer.expectedIdentityPath","reviewer.expectedIdentity","reviewer.expectedOrganizationPath","reviewer.expectedOrganization"],checks:["both.reviewer.identity"]},{step:"reviewer",field:"reviewer.fixtures",needs:["server","reviewer"],reads:["mcp.serverUrl","reviewer.fixtures","reviewer.testCases","reviewer.negativeTestCases","reviewer.signInSteps","reviewer.identityTool","reviewer.identityArgs","reviewer.expectedIdentityPath","reviewer.expectedIdentity","reviewer.expectedOrganizationPath","reviewer.expectedOrganization"],checks:["both.reviewer.fixtures"]},{step:"mcp",needs:["server"],reads:["mcp.serverUrl"],checks:["both.auth.client-signatures"]},{step:"reviewer",field:"reviewer.testCases",needs:[],reads:["reviewer.testCases","reviewer.negativeTestCases"],checks:["openai.submission.test-cases"]},{step:"reviewer",field:"reviewer.negativeTestCases",needs:[],reads:["reviewer.negativeTestCases"],checks:["openai.submission.test-case-quality"]},{step:"reviewer",field:"reviewer.releaseNotes",needs:[],reads:["reviewer.releaseNotes"],checks:["openai.submission.release-notes"]},{step:"reviewer",needs:[],reads:[],checks:["openai.submission.geography"]},{step:"submit",field:"submit.attestations",needs:[],reads:["submit.attestations"],checks:["openai.submission.attestations","openai.submission.attestation-truth"]},{step:"submit",field:"submit.developerIdentity",needs:[],reads:["submit.developerIdentity"],checks:["openai.submission.account"]},{step:"submit",needs:[],reads:[],checks:["openai.submission.profile-valid"]}],kR={"runtime-compatibility":"mcp","directory-policy":"mcp","plugin-package":"upload","release-contract":"mcp","optional-features":"mcp","submission-artifacts":"reviewer","experience-insights":"mcp"},ns={title:bR,steps:SR,fields:wR,placements:ER,laneSteps:kR},IR=["server","reviewer","model","package"];function Cy(e,t,r){return Object.keys(t).filter(i=>i.startsWith(`${e}.`)).map(i=>({key:i,...r[i],...t[i],errors:r[i].errors??{}}))}function Py(e,t){return t.flatMap(({checks:r,needs:i,...n})=>r.map(s=>({checkId:s,...n,needs:i.map(o=>{const a=IR.find(c=>c===o);if(!a)throw new Error(`${e} names an unknown need: ${o}`);return a})})))}var AR=ns.fields,am=ns.steps,Cn={format:"https-url"},Tt={managedBy:"package"};function mt(e,t={}){return{control:e,required:!0,...t}}function Vt(e,t={}){return{control:e,...t}}var RR={"listing.displayName":mt("text",{...Tt,maxLength:30}),"listing.shortDescription":mt("text",{...Tt,maxLength:30}),"listing.description":mt("textarea",{...Tt,maxLength:4e3}),"listing.developer":mt("text",{...Tt,maxLength:80}),"listing.name":mt("text",{...Tt,maxLength:er.pluginNameMaxLength}),"listing.category":Vt("select",Tt),"listing.capabilities":Vt("multi-select",{...Tt,freeEntry:!0,maxItems:20}),"listing.website":mt("text",{...Tt,...Cn}),"listing.support":mt("text",{...Tt,...Cn}),"listing.privacyPolicy":mt("text",{...Tt,...Cn}),"listing.terms":mt("text",{...Tt,...Cn}),"listing.starterPrompts":Vt("multi-select",{...Tt,freeEntry:!0,maxItems:3}),"mcp.serverUrl":mt("server",{...Tt,...Cn}),"mcp.verificationToken":Vt("text"),"reviewer.loginUrl":mt("text",Cn),"reviewer.tenant":Vt("text"),"reviewer.username":mt("text"),"reviewer.passwordSecret":mt("secret"),"reviewer.signInSteps":Vt("textarea",{requiredWith:["reviewer.tenant"]}),"reviewer.identityTool":Vt("text",{requiredWith:["reviewer.expectedIdentity","reviewer.expectedOrganization"]}),"reviewer.identityArgs":Vt("text"),"reviewer.expectedIdentityPath":Vt("text",{requiredWith:["reviewer.expectedIdentity"]}),"reviewer.expectedIdentity":Vt("text",{requiredWith:["reviewer.expectedIdentityPath"]}),"reviewer.expectedOrganizationPath":Vt("text",{requiredWith:["reviewer.expectedOrganization"]}),"reviewer.expectedOrganization":Vt("text",{requiredWith:["reviewer.expectedOrganizationPath"]}),"reviewer.fixtures":Vt("pairs",{pairs:Ty}),"reviewer.testCases":mt("rows",{...Tt,minItems:nn.successCount,maxItems:nn.successCount}),"reviewer.negativeTestCases":mt("rows",{...Tt,minItems:nn.failureCount,maxItems:nn.failureCount}),"reviewer.demoRecordingUrl":mt("text",{...Tt,format:"url"}),"reviewer.releaseNotes":mt("textarea",Tt),"submit.developerIdentity":mt("text"),"submit.attestations":mt("checkbox-group",{declaration:!0,minItems:ns.fields["submit.attestations"].options.length}),"submit.additionalContext":Vt("textarea")},bB={id:"chatgpt-plugin",directory:"openai",title:ns.title,version:"2026-11-13",source:{label:"OpenAI plugin submission docs and the ChatGPT plugin portal",url:"https://developers.openai.com/plugins/deploy/submission",capturedAt:"2026-11-13"},submissionUrl:"https://platform.openai.com/plugins",steps:Object.keys(am).map(e=>({id:e,...am[e],fields:Cy(e,RR,AR)})),placements:Py("chatgpt-plugin.json",ns.placements),laneSteps:ns.laneSteps},TR="2026-11-13",CR="2026-08-19";var PR=["directory","verification","submission","review-criteria","authentication","lazy-authentication","enterprise-managed-auth","troubleshooting","mcp-apps/cross-compatibility","mcp-apps/external-links","mcp-apps/troubleshooting","mcp-apps/design-guidelines"],OR=[{page:"directory",url:"https://claude.com/docs/directory/publish"},{page:"verification",url:"https://claude.com/docs/connectors/verification"}],xR=["directory","verification","submission","review-criteria","authentication"],MR={},LR=PR.map(e=>{const t=OR.find(i=>i.page===e),r=xR.includes(e)?TR:void 0;return{page:e,url:t?.url??`https://claude.com/docs/connectors/building/${e}`,revision:MR[e]??r??null,snapshotDate:r??CR}}),$R=Object.freeze(Object.fromEntries(LR.map(e=>[e.page,e])));function pi(e,t){const r=$R[e];return{page:r.page,section:t,url:r.url,revision:r.revision,snapshotDate:r.snapshotDate}}var NR=["https://claude.ai/api/mcp/auth_callback","https://claude.com/api/mcp/auth_callback"];var DR=".claudemcpcontent.com";var UR="text/html;profile=mcp-app",qR={toolListingMs:5e3,handshakeMs:3e3,widgetFirstPaintMs:3e3},jR={minViewportWidthPx:320,minTouchTargetPx:44},cm=200,Wt={nameMaxLength:100,oneLinerMaxLength:cm,taglineMaxLength:cm,descriptionMaxLength:2e3,categoriesMin:1,categoriesMax:5,useCasesMax:3,screenshotsMin:3,screenshotsMax:5,screenshotMinWidthPx:1e3,toolNameMaxLength:64},SB={callbackUrls:NR,loopbackRedirectIgnoresPort:!0,appContentDomainSuffix:DR,appContentDomainHashLength:32,appHtmlMime:UR,latencyBudgets:qR,appDesignBudgets:jR,submissionLimits:Wt,source:pi("directory","Host profile constants")},zR="Submit an MCP connector",FR={connection:{title:"Connection",intro:"Connect the server you want listed. We read its tools, resources, and auth from the live connection.",layout:{blocks:[{widget:"connector-picker",fields:["connection.serverUrl"],text:{notice:"This form is for remote MCP servers only.",noticeDetail:"Local MCP servers can be distributed inside plugins, but may not be supported in every Claude product.",add:"Add custom connector",addHelper:"A connector you add here stays in Settings → Connectors until you remove it.",choose:"Or choose a connector you’ve already added:",notConnected:"Not connected"}},{heading:"URL configuration",note:"Optional",fields:["connection.differentUrls"]}]}},tools:{title:"Tools",intro:"Review the tools we found and their annotations. Fix anything flagged on your server, then reconnect.",layout:{blocks:[{widget:"tool-list",text:{empty:"No server selected. Go back to the Connection step and pick a server."}}]}},listing:{title:"Listing",intro:"How your MCP server appears in the directory. You can edit this after you submit.",layout:{blocks:[{fields:["listing.name","listing.slug"]},{fields:["listing.oneLiner"]},{fields:["listing.description"]},{fields:["listing.categories"]},{fields:["listing.authorName","listing.authorUrl"]},{widget:"icon",fields:["listing.iconUrl"],text:{add:"Add custom icon URL"}},{widget:"listing-preview",text:{title:"How it reads in the directory",name:"Your server’s name",oneLiner:"One-liner appears here"}},{heading:"Links",note:"Help users learn more and get support.",fields:["listing.documentationUrl","listing.enterpriseAuthDocsUrl"]},{fields:["listing.support","listing.privacyPolicyUrl"]}]}},useCases:{title:"Use cases",intro:"Up to three things people can do with your MCP server, what they need before connecting, and whether it reads or writes. Shown to reviewers, not on your listing."},company:{title:"Company",intro:"Tell us about the company or organization behind this MCP server.",layout:{blocks:[{fields:["company.name"]},{fields:["company.website"]},{heading:"Primary contact",note:"We’ll use this contact for any questions about your submission.",fields:["company.contactName"]},{fields:["company.contactEmail"]},{fields:["company.role"]},{fields:["company.anthropicContact"]}]}},authentication:{title:"Authentication",intro:"Configure how users authenticate with your server. What you set here is applied to connections exactly as entered.",layout:{blocks:[{fields:["authentication.requirement"]},{heading:"Authentication methods",widget:"oauth-sign-in",fields:["authentication.oauthClient"],text:{title:"OAuth sign-in",headers:"Additional request headers",addHeader:"Add header",headersHelper:"Sent on every MCP request alongside the OAuth bearer token. Installers provide the values when they connect, unless you mark a header as held by Anthropic.",addStaticHeaders:"Add static headers"}}]}},dataHandling:{title:"Data handling",intro:"Tell reviewers what the MCP server reads, writes, and sends off-platform."},testLaunch:{title:"Test & launch",intro:"Give reviewers a way in, and confirm you’ve tested every tool.",layout:{blocks:[{fields:["testLaunch.instructions"]},{heading:"Self-tested",fields:["testLaunch.selfTested"]},{heading:"Reviewer check",note:"MCPJam's own, not part of Claude's form: who the reviewer is signed in as, and whether the resources your instructions name exist for them.",fields:["testLaunch.identityTool","testLaunch.identityArgs"]},{fields:["testLaunch.expectedIdentityPath","testLaunch.expectedIdentity"]},{fields:["testLaunch.expectedOrganizationPath","testLaunch.expectedOrganization"]},{fields:["testLaunch.fixtures"]}]}},compliance:{title:"Compliance",intro:"Confirm that your MCP server meets Anthropic’s directory policies. All items are required."},review:{title:"Review and submit",intro:"Confirm the details, then submit. Review can take a few weeks, and approval isn’t guaranteed.",layout:{blocks:[{widget:"submit",text:{submit:"Submit for review",missing:"Some steps are missing required fields — submit to highlight them."}}],review:[{id:"connection",title:"Connection",edit:"connection",rows:["connection.serverUrl",{label:"Captured tool list",error:"A captured tool list is required to submit. Connect your server on the Connection step, or reconnect it in Settings → Connectors, to capture it.",blank:"connection.serverUrl"}]},{id:"connection-auth",title:"Connection & authentication",edit:"authentication",rows:["authentication.requirement","authentication.oauthClient"]},{id:"listing",title:"Listing",edit:"listing",rows:["listing.name","listing.slug","listing.oneLiner","listing.description","listing.authorName","listing.categories","listing.documentationUrl","listing.support","listing.privacyPolicyUrl"]},{id:"useCases",title:"Use cases",edit:"useCases",rows:["useCases.pairs","useCases.prerequisites","useCases.access"]},{id:"company",title:"Company",edit:"company",rows:["company.name","company.website","company.contactName","company.contactEmail"]},{id:"authentication",title:"Authentication",edit:"authentication",rows:[],flat:!0},{id:"dataHandling",title:"Data handling",edit:"dataHandling",rows:["dataHandling.apiOwnership","dataHandling.healthData","dataHandling.sponsored"]},{id:"testLaunch",title:"Test & launch",edit:"testLaunch",rows:["testLaunch.instructions","testLaunch.selfTested"]},{id:"compliance",title:"Compliance",edit:"compliance",rows:["compliance.acknowledgments","compliance.additionalNotes"]}]}}},HR=JSON.parse(`{"connection.serverUrl":{"label":"Server URL","helper":"Servers already in the directory aren’t shown.","errors":{"required":"This field is required"}},"connection.differentUrls":{"label":"Users connect to different URLs","helper":"Leave this unchecked if every user connects to the same server URL."},"listing.name":{"label":"Name","placeholder":"My MCP server","errors":{"required":"This field is required"}},"listing.slug":{"label":"Slug","placeholder":"my-mcp-server","helper":"Permanent after submission. Lowercase letters, numbers, and hyphens.","errors":{"required":"Slug is required"}},"listing.oneLiner":{"label":"One-liner","placeholder":"A short tagline for your MCP server","errors":{"required":"This field is required"}},"listing.description":{"label":"Description","placeholder":"Describe what your MCP server does and its key features…","errors":{"required":"This field is required"}},"listing.categories":{"label":"Categories","placeholder":"Select categories","helper":"Categories are used to filter MCP servers in the directory. Select up to 5.","errors":{"required":"Select at least one category"}},"listing.authorName":{"label":"Author name","reviewLabel":"Author","placeholder":"Acme Inc.","helper":"Shown as “by …” on the listing.","errors":{"required":"An author is required to submit — add one on the Listing step, or fill in your company name and an https:// website to use those"}},"listing.authorUrl":{"label":"Author URL","placeholder":"https://example.com","helper":"If left blank, these default to your company name and website."},"listing.iconUrl":{"label":"Icon","helper":"The directory and Claude show the favicon from your server’s URL; we recommend leaving it at that. A custom icon replaces it in the directory listing only."},"listing.documentationUrl":{"label":"Documentation","placeholder":"https://docs.example.com","helper":"Public-facing docs shown to users. IT admins often review these when deciding whether to approve an MCP server.","errors":{"required":"This field is required"}},"listing.enterpriseAuthDocsUrl":{"label":"Enterprise managed auth documentation","placeholder":"https://docs.example.com/setup","helper":"Setup instructions for admins configuring enterprise managed auth for this connector. Linked from the admin setup flow."},"listing.support":{"label":"Support","reviewLabel":"Support URL","placeholder":"support@example.com or https://support.example.com","helper":"A support URL or email address.","errors":{"required":"This field is required"}},"listing.privacyPolicyUrl":{"label":"Privacy policy","placeholder":"https://example.com/privacy","errors":{"required":"This field is required"}},"useCases.pairs":{"label":"Use cases","helper":"Shown to reviewers, not on your public listing.","errors":{"required":"Add at least one use case with an example prompt"}},"useCases.prerequisites":{"label":"Prerequisites","placeholder":"A paid Acme account with admin permissions","helper":"The accounts, permissions or setup a user needs before connecting. Shown to reviewers.","errors":{"required":"This field is required"}},"useCases.access":{"label":"Read/write capabilities","helper":"Based on what your tools do; we check it against their annotations.","options":[{"value":"read-only","label":"Read only","help":"Retrieves data but never modifies it"},{"value":"write-only","label":"Write only","help":"Creates or modifies data but does not read it"},{"value":"read-write","label":"Read and write","help":"Both retrieves and modifies data"}],"errors":{"required":"This field is required"}},"company.name":{"label":"Company name","errors":{"required":"This field is required"}},"company.website":{"label":"Company website","placeholder":"https://example.com","errors":{"required":"This field is required"}},"company.contactName":{"label":"Full name","reviewLabel":"Primary contact","errors":{"required":"This field is required"}},"company.contactEmail":{"label":"Email","reviewLabel":"Contact email","helper":"Prefilled from your Claude account.","errors":{"required":"This field is required"}},"company.role":{"label":"Role","placeholder":"Software Engineer"},"company.anthropicContact":{"label":"Anthropic contact","placeholder":"Name or email (optional)","helper":"If you’ve been working with someone at Anthropic, let us know who."},"authentication.requirement":{"label":"Authentication requirement","options":[{"value":"always","label":"Always required","help":"Users connect and sign in before any tools or resources are available."},{"value":"when-asked","label":"Required when the server asks","help":"Claude connects without credentials first, then prompts to sign in if the server requires it."},{"value":"none","label":"None","help":"Anyone can use this server without signing in or providing credentials."}],"errors":{"required":"This field is required"}},"authentication.oauthClient":{"label":"OAuth client","options":[{"value":"dcr","label":"Dynamic Client Registration","help":"Clients register themselves with the server (RFC 7591)"},{"value":"cimd","label":"Client ID Metadata Document","help":"The server accepts a published client metadata URL"},{"value":"anthropic-held","label":"Anthropic-held client credentials","help":"Anthropic stores one client ID used for every connection"},{"value":"bring-your-own","label":"Installers bring their own OAuth client","help":"Each organization supplies a client ID it registered with the server"}],"errors":{"required":"This field is required"}},"dataHandling.apiOwnership":{"label":"API ownership","options":[{"value":"own","label":"We own the API","help":"The MCP server calls our own production APIs"},{"value":"partner-proxy","label":"We proxy a partner’s API with permission","help":"Calls go to a third-party API we’re authorized to integrate (e.g. Zapier-style)"},{"value":"third-party","label":"Calls a third-party API we don’t control","help":"Typically blocks listing — explain in Additional notes"}],"errors":{"required":"This field is required"}},"dataHandling.healthData":{"label":"Personal health data","helper":"Does this MCP server access, process, or store personal health information?","options":[{"value":"no","label":"No"},{"value":"yes","label":"Yes"},{"value":"depends","label":"Other / depends on configuration"}],"errors":{"required":"This field is required"}},"dataHandling.sponsored":{"label":"Sponsored or promoted content","reviewLabel":"Sponsored content","helper":"Sponsored, promoted, and advertising content is prohibited in the directory. Does this MCP server surface any?","options":[{"value":"no","label":"No"},{"value":"yes","label":"Yes"},{"value":"other","label":"Other"}],"errors":{"required":"This field is required"}},"testLaunch.instructions":{"label":"Test setup instructions","placeholder":"Sign up at example.com/signup with email reviewer@anthropic.com, then connect via OAuth using client_id=...","helper":"We reserve the right to manually review all servers. Provide clear test-account setup and access instructions. We’re working to automate this process to reduce the time it takes to get your server into the directory — write these instructions so they contain every link, credential, and step needed to autonomously access the MCP server. For enterprise accounts or servers that require a fully populated account, provide test credentials that grant access to a fully populated account for review."},"testLaunch.selfTested":{"label":"I have run every tool via MCP Inspector or as a custom connector in Claude","reviewLabel":"Self-tested"},"testLaunch.identityTool":{"label":"Identity tool","placeholder":"whoami","helper":"A read-only tool on your server that returns the signed-in account. MCPJam calls it as the reviewer."},"testLaunch.identityArgs":{"label":"Identity tool arguments","placeholder":"{}","helper":"Fixed JSON arguments, if the identity tool takes any."},"testLaunch.expectedIdentityPath":{"label":"Identity path","placeholder":"$.user.email","helper":"Where the tool's result names the account, as a JSON path."},"testLaunch.expectedIdentity":{"label":"Expected reviewer","placeholder":"review@example.com","helper":"The account reviewers sign in as."},"testLaunch.expectedOrganizationPath":{"label":"Organization path","placeholder":"$.organization.name","helper":"Where the tool's result names the organization or project, as a JSON path."},"testLaunch.expectedOrganization":{"label":"Expected organization","placeholder":"Sample Org","helper":"The organization or project reviewers should land in."},"testLaunch.fixtures":{"label":"Fixtures","helper":"Resources your instructions name, each with a read-only tool call that finds it in the reviewer's account."},"compliance.acknowledgments":{"label":"Policy acknowledgements","reviewLabel":"Policies acknowledged","options":[{"value":"developer-guidelines","label":"I have read and understand the MCP Directory developer guidelines."},{"value":"first-party-apis","label":"My server calls our own first-party APIs (or APIs we legitimately proxy with permission)."},{"value":"no-financial-transfers","label":"My MCP server does not transfer money, cryptocurrency, or other financial assets on a user’s behalf."},{"value":"no-generated-media","label":"My MCP server does not use AI models to generate images, video, or audio."},{"value":"clean-tool-descriptions","label":"Tool descriptions contain no instructions about model behavior, other tools, or external instruction sources, and no hidden or encoded text."},{"value":"minimal-conversation-data","label":"My MCP server does not collect conversation data beyond what is needed for its function."},{"value":"public-docs-by-launch","label":"Public documentation for this MCP server will be live by the publish date."}],"errors":{"required":"All policy items must be acknowledged","tooFew":"All policy items must be acknowledged"}},"compliance.additionalNotes":{"label":"Additional notes","reviewLabel":"Additional information","helper":"Optional. Anything else the review team should know about your MCP server."}}`),BR=[{step:"connection",field:"connection.serverUrl",needs:[],reads:["connection.serverUrl"],checks:["claude.endpoint.https"]},{step:"connection",field:"connection.serverUrl",needs:["server"],reads:["connection.serverUrl"],checks:["claude.endpoint.redirects-stay-https","claude.endpoint.redirects-terminate"]},{step:"tools",needs:["server"],reads:["connection.serverUrl"],checks:["claude.tools.name-length","claude.tools.title-present","claude.tools.behavior-hints-present","claude.tools.behavior-hints-consistent","claude.tools.no-catch-all-read-write","claude.tools.free-string-operation-parameter","claude.apps.resource-uri-modern","claude.apps.html-mime-profile","claude.apps.openai-only-widget","claude.apps.ui-domain-derivation","claude.apps.ui-domain-recommended-for-app-oauth","claude.apps.csp-shape","claude.apps.result-size-budget","claude.apps.instance-supersession","claude.apps.design.doctype","claude.apps.design.responsive-320","claude.apps.design.touch-targets","claude.apps.design.safe-area","claude.apps.design.theming","claude.apps.design.transparent-background","claude.apps.design.nested-scrolling","claude.apps.design.accessibility","claude.apps.design.display-mode"]},{step:"tools",needs:["server","model"],reads:["connection.serverUrl"],checks:["claude.experience.tool-descriptions-uninformative","claude.experience.tool-overlap","claude.experience.connector-purpose-unclear","claude.experience.destructive-tool-underexplained","claude.experience.app-copy-mismatched","both.decision.annotation-matches-behaviour"]},{step:"listing",needs:["server","model"],reads:["connection.serverUrl"],checks:["claude.experience.listing-copy-placeholder"]},{step:"listing",needs:[],reads:["listing.name","listing.slug","listing.oneLiner","listing.description","listing.categories","listing.authorName","company.name","company.website"],checks:["claude.submission.listing-fields"]},{step:"listing",needs:[],reads:["listing.documentationUrl","listing.privacyPolicyUrl","listing.support","listing.authorUrl","listing.iconUrl","listing.enterpriseAuthDocsUrl"],checks:["claude.submission.urls"]},{step:"listing",needs:[],reads:[],checks:["claude.submission.screenshots","claude.submission.screenshot-prompts"]},{step:"useCases",field:"useCases.access",needs:["server"],reads:["useCases.access","connection.serverUrl"],checks:["claude.submission.access-matches-annotations"]},{step:"useCases",field:"useCases.pairs",needs:[],reads:["useCases.pairs","useCases.prerequisites"],checks:["claude.submission.use-cases"]},{step:"company",needs:[],reads:["company.name","company.website","company.contactName","company.contactEmail"],checks:["claude.submission.company"]},{step:"authentication",field:"authentication.requirement",needs:[],reads:["authentication.requirement","authentication.oauthClient"],checks:["claude.submission.authentication"]},{step:"authentication",field:"authentication.requirement",needs:["server"],reads:["connection.serverUrl"],checks:["claude.auth.unauthenticated-challenge","claude.features.lazy-authentication"]},{step:"authentication",needs:["server"],reads:["connection.serverUrl"],checks:["claude.auth.challenge-names-resource-metadata","claude.auth.no-challenge-on-successful-operation","claude.auth.prm-discoverable","claude.auth.prm-resource-matches-entered-url","claude.auth.first-authorization-server-usable","claude.auth.pkce-s256-advertised","claude.auth.cimd-flag-consistent","claude.features.enterprise-managed-auth"]},{step:"authentication",field:"authentication.oauthClient",needs:["server"],reads:["connection.serverUrl","authentication.requirement","authentication.oauthClient"],checks:["claude.auth.client-acquisition-path","claude.submission.declared-auth-mode"]},{step:"authentication",needs:["server","reviewer"],reads:["connection.serverUrl"],checks:["claude.auth.rfc8707-resource-canonical","claude.auth.insufficient-scope-challenge-shape","claude.auth.access-token-audience","claude.intrusive.dynamic-registration","claude.intrusive.refresh-rotation","claude.intrusive.step-up-challenge"]},{step:"authentication",needs:["server","model"],reads:["connection.serverUrl"],checks:["claude.experience.consent-scope-unclear"]},{step:"dataHandling",needs:[],reads:["dataHandling.apiOwnership","dataHandling.healthData","dataHandling.sponsored"],readsConfirmation:!0,checks:["claude.submission.data-handling"]},{step:"testLaunch",field:"testLaunch.instructions",needs:[],reads:["testLaunch.instructions","authentication.requirement"],checks:["claude.submission.test-instructions"]},{step:"testLaunch",field:"testLaunch.identityTool",needs:["server","reviewer"],reads:["connection.serverUrl","testLaunch.identityTool","testLaunch.identityArgs","testLaunch.expectedIdentityPath","testLaunch.expectedIdentity","testLaunch.expectedOrganizationPath","testLaunch.expectedOrganization"],checks:["both.reviewer.identity"]},{step:"testLaunch",field:"testLaunch.fixtures",needs:["server","reviewer"],reads:["connection.serverUrl","testLaunch.fixtures","testLaunch.instructions","useCases.pairs","testLaunch.identityTool","testLaunch.identityArgs","testLaunch.expectedIdentityPath","testLaunch.expectedIdentity","testLaunch.expectedOrganizationPath","testLaunch.expectedOrganization"],checks:["both.reviewer.fixtures"]},{step:"authentication",needs:["server"],reads:["connection.serverUrl"],checks:["both.auth.client-signatures"]},{step:"compliance",field:"compliance.acknowledgments",needs:[],reads:["compliance.acknowledgments"],readsConfirmation:!0,checks:["claude.submission.attestations"]},{step:"compliance",field:"compliance.acknowledgments",needs:["server"],reads:["connection.serverUrl"],checks:["claude.scan.cross-tool-direction-candidates"]},{step:"compliance",field:"compliance.acknowledgments",needs:["server","model"],reads:["connection.serverUrl"],checks:["claude.decision.cross-tool-direction"]},{step:"review",needs:[],reads:["dataHandling.apiOwnership","dataHandling.healthData","dataHandling.sponsored"],checks:["claude.submission.artifact-quality"]},{step:"review",needs:[],reads:["useCases.access","dataHandling.apiOwnership","dataHandling.healthData","dataHandling.sponsored","testLaunch.selfTested","compliance.acknowledgments"],readsConfirmation:!0,checks:["claude.submission.declarations-confirmed"]},{step:"review",needs:[],reads:["connection.serverUrl","connection.differentUrls","useCases.access","company.role","company.anthropicContact","testLaunch.instructions","testLaunch.selfTested","compliance.additionalNotes"],readsConfirmation:!0,checks:["claude.submission.other-answers"]}],VR={"runtime-compatibility":"connection","directory-policy":"tools","optional-features":"authentication","submission-artifacts":"listing","experience-insights":"tools"},ss={title:zR,steps:FR,fields:HR,placements:BR,laneSteps:VR},GR=ss.fields,lm=ss.steps,Pn={declaration:!0},qs={format:"https-url"};function ot(e,t={}){return{control:e,required:!0,...t}}function xt(e,t={}){return{control:e,...t}}var WR={"connection.serverUrl":ot("server",{format:"url"}),"connection.differentUrls":xt("checkbox"),"listing.name":ot("text",{maxLength:Wt.nameMaxLength}),"listing.slug":ot("text",{format:"slug"}),"listing.oneLiner":ot("text",{maxLength:Wt.oneLinerMaxLength}),"listing.description":ot("textarea",{maxLength:Wt.descriptionMaxLength}),"listing.categories":ot("multi-select",{freeEntry:!0,minItems:Wt.categoriesMin,maxItems:Wt.categoriesMax}),"listing.authorName":ot("text",{requiredOn:"review",satisfiedBy:[{key:"company.name"},{key:"company.website",format:"https-url"}]}),"listing.authorUrl":xt("text",qs),"listing.iconUrl":xt("text",qs),"listing.documentationUrl":ot("text",qs),"listing.enterpriseAuthDocsUrl":xt("text",qs),"listing.support":ot("text",{format:"url-or-email"}),"listing.privacyPolicyUrl":ot("text",qs),"useCases.pairs":ot("pairs",{pairs:{columns:["Use case","Example prompt"],keys:["useCase","examplePrompt"],placeholders:[["Look up a product","What sizes are in stock at the Portland store?"],["Compare prices","Which fall items are marked down more than 30%?"],["Draft a product listing","Create a draft listing for the canvas tote."]],maxRows:Wt.useCasesMax}}),"useCases.prerequisites":ot("textarea"),"useCases.access":ot("radio",{...Pn,default:"read-only"}),"company.name":ot("text",{prefill:"organization-name"}),"company.website":ot("text",{format:"url"}),"company.contactName":ot("text",{prefill:"account-name"}),"company.contactEmail":ot("text",{format:"email",prefill:"account-email"}),"company.role":xt("text"),"company.anthropicContact":xt("text"),"authentication.requirement":ot("radio",{default:"always"}),"authentication.oauthClient":ot("radio",{default:"dcr"}),"dataHandling.apiOwnership":ot("radio-cards",{...Pn,default:"own"}),"dataHandling.healthData":ot("radio",{...Pn,default:"no"}),"dataHandling.sponsored":ot("radio",Pn),"testLaunch.instructions":xt("textarea"),"testLaunch.selfTested":xt("checkbox",Pn),"testLaunch.identityTool":xt("text",{requiredWith:["testLaunch.expectedIdentity","testLaunch.expectedOrganization"]}),"testLaunch.identityArgs":xt("text"),"testLaunch.expectedIdentityPath":xt("text",{requiredWith:["testLaunch.expectedIdentity"]}),"testLaunch.expectedIdentity":xt("text",{requiredWith:["testLaunch.expectedIdentityPath"]}),"testLaunch.expectedOrganizationPath":xt("text",{requiredWith:["testLaunch.expectedOrganization"]}),"testLaunch.expectedOrganization":xt("text",{requiredWith:["testLaunch.expectedOrganizationPath"]}),"testLaunch.fixtures":xt("pairs",{pairs:Ty}),"compliance.acknowledgments":ot("checkbox-group",{...Pn,minItems:ss.fields["compliance.acknowledgments"].options.length}),"compliance.additionalNotes":xt("textarea")},wB={id:"claude-connector",directory:"claude",title:ss.title,version:"2026-11-13",source:{label:"Claude directory portal: Submit an MCP connector",url:"https://claude.ai/directory/manage",capturedAt:"2026-11-13"},submissionUrl:"https://claude.ai/directory/manage",steps:Object.keys(lm).map(e=>({id:e,...lm[e],fields:Cy(e,WR,GR)})),placements:Py("claude-connector.json",ss.placements),laneSteps:ss.laneSteps};function Bp(e){return e.class==="required"||e.class==="runtime-blocker"}var EB=Object.freeze({maxQuestionsPerRun:24,maxKeyChars:200,maxNameChars:200,maxFieldChars:300,maxTextChars:2e3,maxReferences:10,maxQuoteChars:400}),JR=String.raw`(?:call|invoke|run|use|execute|trigger|poll|retry|re-?run|chain|pair|combine)`,kB=String.raw`(?:calling|using|running|invoking|executing|polling)`,KR=String.raw`(?:get|obtain|fetch|retrieve|look\s+up|find|read|take|copy|resolve|discover|check|verify|confirm|inspect|track|monitor|pass|provide|supply|send|feed|forward|hand|give|submit|${JR})`,YR=String.raw`(?:^|[,;:(\u2013\u2014]\s*|\s-\s+|\b(?:and|or|then|so|to|first|next|finally|afterwards|always|also|instead|otherwise|please|only|now|immediately)\s+)`,XR=String.raw`\b(?:must|should|shall|can|may|need\s+to|needs\s+to|have\s+to|has\s+to|be\s+sure\s+to|make\s+sure\s+to|remember\s+to|(?:do\s+not|don't)\s+forget\s+to|want\s+to)\s+(?:not\s+|also\s+|first\s+|always\s+|then\s+|still\s+)?`,IB=String.raw`(?:(?:the|a|an|this|that|it|its|tool|tools|first|also|again|only|then|always|now|before|after|with|together|alongside|along|instead|of|to|right|immediately|once|back)\s+){0,4}`,AB=String.raw`[^.;:!?,]{0,30}?`,RB=String.raw`(?:from|with|using|via|through|to|into|by\s+calling|by\s+running|returned\s+by|produced\s+by|output\s+(?:of|from)|result\s+of|response\s+(?:of|from))`,TB=String.raw`(?:before|after|once|until|prior\s+to|together\s+with|alongside|instead\s+of|in\s+place\s+of|rather\s+than)`,CB=new RegExp(`${YR}(?:${KR}|confirm|ask|wait|stop|ensure|tell|show|list|try|avoid|save|create|delete|update|refresh|compare)\\b|${XR}\\w`,"i"),Wc=e=>new RegExp(`\\b(?:${e})(?:e|es|ed|ing|s)?\\b`,"i"),PB=Wc("creat|add|insert|updat|edit|modif(?:y|ies|ied|ying)|chang|sav|writ|written|send|sent|post|publish|submit|submitt|upload|delet|remov|archiv|mov|renam|cancel|cancell|schedul|purchas|pay|paid|transfer|transferr|deploy|install|trigger|overwrit|overwritten"),OB=Wc("get|list|read|fetch|retriev|search|find|view|show|return|quer(?:y|ies|ied|ying)|inspect|describ|count|lookup"),xB=Wc("delet|remov|overwrit|overwritten|drop|dropp|destroy|eras|purg|wip|truncat|revok|replac|permanently|irreversibl"),MB=Wc("creat|add|insert|append|increment|generat|send|sent|post|submit|submitt"),LB=Object.freeze({maxTools:500,maxCases:1500,maxFixtures:50,maxCleanupSteps:50,maxIdLength:200,maxPlanLength:524288,maxCalls:3e3,maxConcurrency:4,minCallTimeoutMs:1e3,maxCallTimeoutMs:12e4});function ZR(e){const t=[];return ad(e,r=>{t.push(r)}),t}function QR(e){if(typeof e!="object"||e===null||Array.isArray(e))return;const{$fixture:t,value:r}=e;if(typeof t=="string")return{fixture:t,value:typeof r=="string"?r:""}}function ad(e,t){const r=QR(e);return r?t(r):Array.isArray(e)?e.map(i=>ad(i,t)):typeof e=="object"&&e!==null?Object.fromEntries(Object.entries(e).map(([i,n])=>[i,ad(n,t)])):e}function $B(e){const t=new Map(e.tools.map(a=>[a.tool,a])),r=a=>{const c=t.get(a.tool),l=c?.effect??"destructive";return(l==="destructive"?3:a.creates?.length?0:l==="read"?1:2)*2+(c?.openWorld===!1?0:1)},i=new Set(e.cases.flatMap(a=>a.creates??[])),n=e.cases.map((a,c)=>({testCase:a,index:c,rank:r(a),needs:ZR(a.arguments).map(l=>l.fixture).filter(l=>i.has(l)&&!a.creates?.includes(l))})).sort((a,c)=>a.rank-c.rank||a.index-c.index),s=new Set,o=[];for(;n.length>0;){const a=n.findIndex(({needs:l})=>l.every(u=>s.has(u))),[c]=n.splice(Math.max(a,0),1);o.push(c.testCase);for(const l of c.testCase.creates??[])s.add(l)}return o}var eT=e=>e/2**32|0,tT=e=>e>>>0;function rT(e,t,r,i){const n=eT(r),s=tT(r);e.setUint32(t,i?s:n,i),e.setUint32(t+4,i?n:s,i)}function um(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}var cd=e=>e?`"${e}" `:"";function iT(e,t=""){if(typeof e!="number")throw new TypeError(cd(t)+"expected number, got "+typeof e);if(!Number.isSafeInteger(e)||e<0)throw new RangeError(cd(t)+"expected integer >= 0, got "+e);return e}function Vp(e,t,r=""){if(um(e)&&(t===void 0||e.length===t))return e;t!==void 0&&iT(t,"length");const i=um(e),n=t!==void 0?` of length ${t}`:"",s=i?`length=${e.length}`:`type=${typeof e}`,o=cd(r)+"expected Uint8Array"+n+", got "+s;throw i?new RangeError(o):new TypeError(o)}var nT=(e,t)=>{if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError((t==="object"?"":`"${t}" `)+"expected object, got type="+typeof e)},dm=(e,t)=>{nT(e,t);const r=Object.getPrototypeOf(e);if(r!==Object.prototype&&r!==null)throw new TypeError(`"${t}" expected plain object`);if(Object.hasOwn(e,"__proto__"))throw new TypeError(`"${t}.__proto__" is not allowed`)};function pm(e,t=!0){if(e.destroyed)throw new Error("hash was destroyed");if(t&&e.finished)throw new Error("digest() was already called")}function sT(e,t){Vp(e,void 0,"output");const r=t.outputLen;if(!(e.length>=r))throw new RangeError('"output" expected length >= '+r)}function ld(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Bl(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function kr(e,t){return e<<32-t|e>>>t}var oT=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",aT=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function cT(e){if(Vp(e),oT)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=aT[e[r]];return t}function lT(e){if(typeof e!="string")throw new TypeError("string expected");const t=new TextEncoder().encode(e);try{return new Uint8Array(t)}finally{ld(t)}}function uT(e,t,r="opts"){return dm(e,"defaults"),t!==void 0&&dm(t,r),Object.assign(Object.create(null),e,t)}function dT(e,t={}){if(typeof e!="function")throw new TypeError('"hashCons" expected function, got type='+typeof e);t=uT({},t,"info");const r=(n,s)=>e(s).update(n).digest(),i=e(void 0);return r.outputLen=i.outputLen,r.blockLen=i.blockLen,r.canXOF=i.canXOF,r.create=n=>e(n),Object.assign(r,t),Object.freeze(r)}var pT=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function hT(e,t,r){return e&t^~e&r}function fT(e,t,r){return e&t^e&r^t&r}var mT=class{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,t,r,i){this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=i,this.buffer=new Uint8Array(e),this.view=Bl(this.buffer)}update(e){pm(this),Vp(e);const{view:t,buffer:r,blockLen:i}=this,n=e.length;let s=!1;for(let o=0;o<n;){const a=Math.min(i-this.pos,n-o);if(a===i){const c=Bl(e);for(;i<=n-o;o+=i)this.process(c,o);s=!0;continue}r.set(o===0&&a===n?e:e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===i&&(this.process(t,0),this.pos=0,s=!0)}return this.length+=e.length,s&&this.roundClean(),this}digestInto(e){pm(this),sT(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:i,isLE:n}=this;let{pos:s}=this;t[s++]=128,t.fill(0,s),this.padOffset>i-s&&(this.process(r,0),t.fill(0)),rT(r,i-8,this.length*8,n),this.process(r,0),this.roundClean();const o=e===t?r:Bl(e),a=this.outputLen,c=a/4,l=this.get();if(a%4||c>l.length)throw new Error("invalid outputLen");for(let u=0;u<c;u++)o.setUint32(4*u,l[u],n)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneIntoMeta(e){const{buffer:t,length:r,finished:i,destroyed:n,pos:s}=this;return e.destroyed=n,e.finished=i,e.length=r,e.pos=s,s&&e.buffer.set(t),e}clone(){return this._cloneInto()}},gT=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),vT=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),oi=new Uint32Array(64),_T=class extends mT{A=0;B=0;C=0;D=0;E=0;F=0;G=0;H=0;constructor(e,t){super(64,e,8,!1),this.A=t[0]|0,this.B=t[1]|0,this.C=t[2]|0,this.D=t[3]|0,this.E=t[4]|0,this.F=t[5]|0,this.G=t[6]|0,this.H=t[7]|0}get(){const{A:e,B:t,C:r,D:i,E:n,F:s,G:o,H:a}=this;return[e,t,r,i,n,s,o,a]}set(e,t,r,i,n,s,o,a){this.A=e|0,this.B=t|0,this.C=r|0,this.D=i|0,this.E=n|0,this.F=s|0,this.G=o|0,this.H=a|0}_cloneInto(e){return(e||=new this.constructor).set(...this.get()),this._cloneIntoMeta(e)}process(e,t){for(let u=0;u<16;u++,t+=4)oi[u]=e.getUint32(t,!1);for(let u=16;u<64;u++){const p=oi[u-15],d=oi[u-2],h=kr(p,7)^kr(p,18)^p>>>3,f=kr(d,17)^kr(d,19)^d>>>10;oi[u]=f+oi[u-7]+h+oi[u-16]|0}let{A:r,B:i,C:n,D:s,E:o,F:a,G:c,H:l}=this;for(let u=0;u<64;u++){const p=kr(o,6)^kr(o,11)^kr(o,25),d=l+p+hT(o,a,c)+vT[u]+oi[u]|0,h=(kr(r,2)^kr(r,13)^kr(r,22))+fT(r,i,n)|0;l=c,c=a,a=o,o=s+d|0,s=n,n=i,i=r,r=d+h|0}r=r+this.A|0,i=i+this.B|0,n=n+this.C|0,s=s+this.D|0,o=o+this.E|0,a=a+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(r,i,n,s,o,a,c,l)}roundClean(){ld(oi)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),ld(this.buffer)}},yT=class extends _T{constructor(){super(32,gT)}},bT=dT(()=>new yT,pT(1));function ST(e){return Bp(e)}var wT=["experience"];var ET=["claude.experience.tool-descriptions-uninformative","claude.experience.tool-overlap","claude.experience.connector-purpose-unclear","claude.experience.consent-scope-unclear","claude.experience.listing-copy-placeholder","claude.experience.destructive-tool-underexplained","claude.experience.app-copy-mismatched"],NB=Object.freeze({readinessKind:"claude-directory-readiness",observationKinds:wT,knownIds:ET,schemaVersion:"1"}),kT=[{id:"claude.experience.tool-descriptions-uninformative",title:"Tool descriptions may not tell Claude when to use the tool",lane:"experience-insights",class:"heuristic",source:pi("review-criteria","§Tool quality"),remediation:"Describe when a tool should be reached for, not only what it does; Claude picks tools from these sentences."},{id:"claude.experience.tool-overlap",title:"Two or more tools may cover the same job",lane:"experience-insights",class:"heuristic",source:pi("review-criteria","§Tool quality"),remediation:"Overlapping tools make selection ambiguous; consider merging them or sharpening what separates them."},{id:"claude.experience.connector-purpose-unclear",title:"What this connector is for may not be clear from its surface",lane:"experience-insights",class:"manual-review",source:pi("review-criteria","§Usefulness"),remediation:"A reviewer should be able to say what the connector is for from the listing and the tool names alone."},{id:"claude.experience.consent-scope-unclear",title:"It may not be clear to a user what they are authorizing",lane:"experience-insights",class:"manual-review",source:pi("authentication","§Consent"),remediation:"State which account is connected and what scope it grants, in the copy the user sees at consent time."},{id:"claude.experience.listing-copy-placeholder",title:"Listing copy may still contain placeholder text",lane:"experience-insights",class:"manual-review",source:pi("submission","§Listing"),remediation:"Review the listing fields for template text before submitting; reviewers reject placeholder copy."},{id:"claude.experience.destructive-tool-underexplained",title:"A destructive tool may not explain its consequences",lane:"experience-insights",class:"manual-review",source:pi("review-criteria","§Safety"),remediation:"Say plainly in the description what a destructive tool changes and whether it can be undone."},{id:"claude.experience.app-copy-mismatched",title:"An app's rendered copy may not match what its tool returns",lane:"experience-insights",class:"heuristic",source:pi("mcp-apps/design-guidelines","§Content"),remediation:"A widget that says something different from the tool's text response leaves the model and the user disagreeing."}],DB=Object.freeze({experienceLane:"experience-insights",engineVersion:"1",mappings:kT}),On={serverUrl:"serverUrl",pluginBundle:"pluginBundle",submissionProfile:"submissionProfile",draftSnapshot:"draftSnapshot",publishedSnapshot:"publishedSnapshot",toolListing:"toolListing",importedSkills:"importedSkills"},UB=Object.freeze({"skills-only":{hasMcpServer:!1,hasUploadedPackage:!0,hasImportedSkills:!1,requiredInputs:[On.pluginBundle],summary:"a skills package with no MCP server"},"mcp-only":{hasMcpServer:!0,hasUploadedPackage:!1,hasImportedSkills:!1,requiredInputs:[On.serverUrl],summary:"an MCP endpoint with no uploaded package"},"mcp-imported-skills":{hasMcpServer:!0,hasUploadedPackage:!1,hasImportedSkills:!0,requiredInputs:[On.serverUrl,On.importedSkills],summary:"an MCP endpoint whose skills are imported at scan time"},"mcp-uploaded-skills":{hasMcpServer:!0,hasUploadedPackage:!0,hasImportedSkills:!1,requiredInputs:[On.serverUrl,On.pluginBundle],summary:"an MCP endpoint plus an uploaded skills package"}}),qB=Object.freeze({"technical-preflight":["runtime-compatibility","directory-policy","plugin-package"],"submission-ready":["runtime-compatibility","directory-policy","plugin-package","submission-artifacts","release-contract"]});function IT(e){return typeof e=="object"&&e!==null&&e.readinessKind==="openai-directory-readiness"}var AT=["experience"];var RT=["openai.experience.tool-descriptions-uninformative","openai.experience.tool-overlap","openai.experience.naming-inconsistent","openai.experience.listing-copy-placeholder","openai.experience.listing-copy-overpromises","openai.experience.skill-overlap","openai.experience.destructive-tool-underexplained","openai.experience.auth-story-unclear"],jB=Object.freeze({readinessKind:"openai-directory-readiness",observationKinds:AT,knownIds:RT,schemaVersion:"1"}),TT=[{id:"openai.experience.tool-descriptions-uninformative",title:"Tool descriptions may not tell the model when to use the tool",lane:"experience-insights",class:"heuristic",source:gr("guides/optimize-metadata","§Tool descriptions"),remediation:"Describe when a tool should be reached for, not only what it does; the model picks tools from these sentences."},{id:"openai.experience.tool-overlap",title:"Two or more tools may cover the same job",lane:"experience-insights",class:"heuristic",source:gr("plan/tools","§Naming"),remediation:"Overlapping tools make selection ambiguous; consider merging them or sharpening the descriptions that separate them."},{id:"openai.experience.naming-inconsistent",title:"Tool names may not follow one convention",lane:"experience-insights",class:"heuristic",source:gr("plan/tools","§Naming"),remediation:"Pick one naming convention across the whole surface; mixed conventions read as two servers merged."},{id:"openai.experience.listing-copy-placeholder",title:"Listing copy may still contain placeholder text",lane:"experience-insights",class:"manual-review",source:gr("plugin-guidelines","§Listing quality"),remediation:"Review the listing fields for template text before submitting; reviewers reject placeholder copy."},{id:"openai.experience.listing-copy-overpromises",title:"Listing copy may claim capabilities the tools do not implement",lane:"experience-insights",class:"manual-review",source:gr("plugin-guidelines","§Listing quality"),remediation:"Check that every capability the listing advertises is reachable through a tool this server actually exposes."},{id:"openai.experience.skill-overlap",title:"Two or more skills may describe the same task",lane:"experience-insights",class:"heuristic",source:gr("plugin-guidelines","§Listing quality"),remediation:"Skills that overlap compete for the same trigger; separate their scopes or fold them together."},{id:"openai.experience.destructive-tool-underexplained",title:"A destructive tool may not explain its consequences",lane:"experience-insights",class:"manual-review",source:gr("plugin-guidelines","§Predictable side effects"),remediation:"Say plainly in the description what a destructive tool changes and whether it can be undone."},{id:"openai.experience.auth-story-unclear",title:"It may not be clear to a user what they are authorizing",lane:"experience-insights",class:"manual-review",source:gr("build/auth","§Consent"),remediation:"State which account is connected and what scope it grants, in the copy the user sees at consent time."}],zB=Object.freeze({experienceLane:"experience-insights",engineVersion:"2",mappings:TT}),CT=["oauth-dcr","oauth-cimd","oauth-preregistered","static-header","authless","custom-connection"],PT=["no-user-data","processes-user-data","stores-user-data","shares-with-third-parties"],OT=["ownsOrIsAuthorizedForService","accurateDataHandlingDisclosure","compliesWithUsagePolicies","noProhibitedContent","maintainsSecurityPractices","respondsToSecurityReports","keepsListingAccurate"],da=w().url().refine(e=>e.startsWith("https://"),{message:"must be an https:// URL"}),xT=ee({url:w().min(1),mimeType:w().min(1),widthPx:Le().int().positive(),heightPx:Le().int().positive(),prompt:w().min(1)}),FB=ee({name:w().min(1).max(Wt.nameMaxLength),tagline:w().min(1).max(Wt.oneLinerMaxLength),description:w().min(1).max(Wt.descriptionMaxLength),categories:Q(w().min(1)).min(Wt.categoriesMin).max(Wt.categoriesMax),slug:w().min(1).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/,"must be a lowercase kebab-case slug"),documentationUrl:da,privacyPolicyUrl:da,supportUrl:da,iconUrl:da,declaredAuthMode:it(CT),dataHandling:Q(it(PT)).min(1),screenshots:Q(xT).min(Wt.screenshotsMin).max(Wt.screenshotsMax),attestations:Je(it(OT),Oe())}),MT=FA;function Bt(e){return e.rows.map(t=>{const r=t.indexOf(": "),i=t.slice(0,r),n=e.targets?.[i];return{code:i,table:e.table,stage:e.stage,severity:e.severity??(e.warnings?.includes(i)?"warning":"error"),message:t.slice(r+2),...n?.field===void 0?{}:{document:e.document},...n,source:MT}})}var ir={kind:"present"},He={kind:"nonEmpty"},sn={kind:"nonEmpty",required:!0},ur={kind:"text"},Wn={kind:"text",singleLine:!0},Oo=(...e)=>({kind:"type",types:e}),qe=Oo("string"),ni=Oo("object"),ud=Oo("boolean"),dt=(e,t)=>t===void 0?{kind:"length",max:e}:{kind:"length",max:e,submissionMax:t},jt=e=>({kind:"pattern",pattern:e}),Oy=e=>({kind:"pattern",pattern:e,forbidden:!0}),LT=e=>({kind:"enum",values:e}),hm=e=>({kind:"count",max:e}),x=(e,...t)=>t.length>0?{field:e,rules:t}:{field:e},$e=e=>({path:e}),on="interface.displayName",_i="interface.shortDescription",an="interface.longDescription",bi="interface.developerName",io="interface.capabilities[]",dd="interface.defaultPrompt",no="interface.defaultPrompt[]",ja="(?:0|[1-9]\\d*)",fm=`(?:${ja}|\\d*[A-Za-z-][0-9A-Za-z-]*)`,$T=new RegExp(`^${ja}\\.${ja}\\.${ja}(?:-${fm}(?:\\.${fm})*)?(?:\\+[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$`),pd=/^#[0-9A-Fa-f]{6}$/,js=/^https:\/\/(?!:)[^\s/?#@]+(?:[/?#]\S*)?$/i,NT=Bt({table:"ZIP upload errors and warnings",stage:"upload",document:"plugin-manifest",warnings:["plugin_version_unchanged","mcp_configuration_excluded","claude_format_normalized","manifest_normalized","developer_name_defaulted"],rows:["plugin_name_mismatch: The package name in an update must match the existing plugin name.","plugin_version_unchanged: A new release must use a different manifest `version`; reusing the published version requires confirmation.","mcp_configuration_excluded: MCP configuration is excluded unless your organization is approved for local MCP submissions. For a local MCP plugin, ask your OpenAI representative to confirm the submitting organization is allowlisted. Submit remote MCP servers through **With MCP**.","app_configuration_excluded: ZIP uploads must not include `apps` or `.app.json`. Submit remote MCP servers through **With MCP**; for local MCP servers, follow the desktop-only submission instructions.","claude_format_normalized: `.claude-plugin/plugin.json` is converted to `.codex-plugin/plugin.json`, with missing interface defaults and normalized text fields added by the portal.","manifest_normalized: The portal saves the normalized manifest as `.codex-plugin/plugin.json`; changed fields require confirmation.","developer_name_defaulted: The listing’s developer name is set automatically from your selected verified developer identity, regardless of the name in your ZIP."],targets:{plugin_name_mismatch:x("name"),plugin_version_unchanged:x("version"),claude_format_normalized:$e(".claude-plugin/plugin.json"),manifest_normalized:$e(".codex-plugin/plugin.json"),developer_name_defaulted:x(bi)}}),DT=Bt({table:"ZIP structure and limit errors",stage:"upload",rows:["archive_empty: Archive must not be empty.","archive_too_large: Compressed ZIP must be 100 MB or less.","archive_format_not_zip: Archive must be a valid, uncorrupted ZIP file.","archive_member_path_empty: Archive entry path must not be empty.","archive_member_path_has_outer_whitespace: Archive entry path must not begin or end with whitespace.","archive_member_path_has_backslash: Archive entry path must use `/`, not backslashes.","archive_member_path_absolute: Archive entry path must be relative to the archive root.","archive_member_path_has_empty_segment: Archive entry path must not contain empty segments.","archive_member_path_has_parent_segment: Archive entry path must not contain `..` segments.","archive_member_path_too_deep: Archive entry path must contain at most 20 segments, including the filename.","archive_member_path_too_long: Archive entry path must be within the supported path-length limit.","archive_member_path_normalization_collision: Archive entry paths must remain unique after case and Unicode normalization.","archive_member_type_unsupported: Archive entries must be regular files or directories.","archive_member_too_large: Archive entry must not exceed 100 MiB.","archive_member_path_duplicate: Archive entry path must be unique.","archive_member_path_type_conflict: A file path cannot also be a directory or contain another archive entry.","archive_too_many_entries: Archive must not contain more than 5,000 entries.","archive_uncompressed_too_large: Extracted archive must not exceed 512 MiB.","archive_member_unreadable: Every archive entry must be readable, must not be encrypted, and must use supported compression."]}),UT=Bt({table:"Plugin root errors",stage:"upload",rows:["plugin_root_missing: The selected path must exist and be a directory containing a plugin.","archive_plugin_files_missing: A ZIP must contain a supported plugin manifest and at least one valid skill (or an approved local MCP server).",`plugin_root_ambiguous: ${xr.plugin_root_ambiguous.message}`,`plugin_root_has_siblings: ${xr.plugin_root_has_siblings.message}`]}),Gr="skills/<skill>/SKILL.md",zs="skills/<skill>/agents/openai.yaml",Vl="interface.display_name",Gl="interface.short_description",mm="interface.icon_small",gm="interface.icon_large",Wl="interface.brand_color",vm="interface.default_prompt",qT="policy.allow_implicit_invocation",jT=Bt({table:"Skill errors",stage:"upload",document:"skill-frontmatter",rows:["skill_manifest_missing: Skill must contain a `SKILL.md` file.","skill_bundle_too_large: Each compressed skill bundle must be within the MiB limit reported in the error.","skill_directory_hidden: Skill directory names must not begin with `.`.","skill_manifest_nested: Each skill directory must be an immediate child of `skills/`.","skill_manifest_not_regular_file: `SKILL.md` must be a regular file.","skill_manifest_unreadable: `SKILL.md` must be readable.","skill_manifest_invalid_utf8: `SKILL.md` must contain valid UTF-8.","skill_frontmatter_missing: `SKILL.md` must start with YAML front matter between `---` lines.","skill_frontmatter_unclosed: `SKILL.md` YAML front matter must end with `---`.","skill_frontmatter_yaml_malformed: `SKILL.md` front matter must contain valid YAML.","skill_frontmatter_wrong_type: `SKILL.md` front matter must contain a YAML mapping.","skill_name_missing: `name` is required and must not be empty.","skill_name_wrong_type: `name` must be a string.","skill_name_empty: `name` must be non-empty.","skill_name_character_unsupported: Skill front matter `name` must use supported text.","skill_description_missing: `description` is required and must not be empty.","skill_description_wrong_type: `description` must be a string.","skill_description_empty: `description` must be non-empty.","skill_description_too_long: `description` must be 1,024 characters or fewer.","skill_description_character_unsupported: Skill front matter `description` must use supported text.","skill_body_empty: Skill instructions must not be empty.","skill_identity_too_long: The combined plugin and skill name (`plugin-name:skill-name`) must be 64 characters or fewer.","skill_identity_duplicate: Each skill `name` must be unique within the plugin."],targets:{skill_manifest_missing:$e(Gr),skill_manifest_not_regular_file:$e(Gr),skill_manifest_unreadable:$e(Gr),skill_manifest_invalid_utf8:$e(Gr),skill_frontmatter_missing:$e(Gr),skill_frontmatter_unclosed:$e(Gr),skill_frontmatter_yaml_malformed:$e(Gr),skill_frontmatter_wrong_type:$e(Gr),skill_name_missing:x("name",ir),skill_name_wrong_type:x("name",qe),skill_name_empty:x("name",He),skill_name_character_unsupported:x("name",ur),skill_description_missing:x("description",ir),skill_description_wrong_type:x("description",qe),skill_description_empty:x("description",He),skill_description_too_long:x("description",dt(1024)),skill_description_character_unsupported:x("description",ur),skill_identity_duplicate:x("name")}}),zT=Bt({table:"Skill agent metadata errors",stage:"upload",document:"skill-agent",rows:["skill_agent_not_regular_file: `agents/openai.yaml` must be a regular file.","skill_agent_unreadable: `agents/openai.yaml` must be readable.","skill_agent_invalid_utf8: `agents/openai.yaml` must contain valid UTF-8.","skill_agent_yaml_malformed: `agents/openai.yaml` must contain valid YAML.","skill_agent_top_level_wrong_type: `agents/openai.yaml` must contain a YAML mapping at the top level.","skill_agent_interface_missing: `interface` is required in `agents/openai.yaml` when that file is included.","skill_agent_interface_wrong_type: `interface` in `agents/openai.yaml` must be a YAML mapping.","skill_agent_display_name_missing: `interface.display_name` is required and must not be empty.","skill_agent_display_name_wrong_type: `interface.display_name` must be a string.","skill_agent_display_name_empty: `interface.display_name` must not be empty.","skill_agent_short_description_missing: `interface.short_description` is required and must not be empty.","skill_agent_short_description_wrong_type: `interface.short_description` must be a string.","skill_agent_short_description_empty: `interface.short_description` must not be empty.","skill_agent_icon_small_wrong_type: `interface.icon_small` must be a non-empty relative file path when provided.","skill_agent_icon_small_empty: `interface.icon_small` must be a non-empty relative file path when provided, such as `assets/icon.png`.","skill_agent_icon_large_wrong_type: `interface.icon_large` must be a non-empty relative file path when provided.","skill_agent_icon_large_empty: `interface.icon_large` must be a non-empty relative file path when provided, such as `assets/icon.png`.","skill_agent_brand_color_wrong_type: `interface.brand_color` must be a string when provided.","skill_agent_brand_color_empty: `interface.brand_color` must be a non-empty six-digit hex color when provided, such as `#1ABCFE`.","skill_agent_brand_color_format: `interface.brand_color` must be a six-digit hex color, such as `#1ABCFE`.","skill_agent_default_prompt_wrong_type: `interface.default_prompt` must be a string when provided.","skill_agent_default_prompt_empty: `interface.default_prompt` must be non-empty when provided.","skill_agent_policy_wrong_type: `policy` must be a YAML mapping when provided.","skill_agent_allow_implicit_invocation_wrong_type: `policy` may contain only `products` and `allow_implicit_invocation`. `products` must contain `CHAT`, `CODEX`, or both, and `allow_implicit_invocation` must be `true` or `false`.","skill_agent_dependencies_wrong_type: `dependencies` must be a YAML mapping; only `tools` is supported.","skill_agent_dependency_unsupported: Only `dependencies.tools` is supported in `agents/openai.yaml`."],targets:{skill_agent_not_regular_file:$e(zs),skill_agent_unreadable:$e(zs),skill_agent_invalid_utf8:$e(zs),skill_agent_yaml_malformed:$e(zs),skill_agent_top_level_wrong_type:$e(zs),skill_agent_interface_missing:x("interface",ir),skill_agent_interface_wrong_type:x("interface",ni),skill_agent_display_name_missing:x(Vl,ir),skill_agent_display_name_wrong_type:x(Vl,qe),skill_agent_display_name_empty:x(Vl,He),skill_agent_short_description_missing:x(Gl,ir),skill_agent_short_description_wrong_type:x(Gl,qe),skill_agent_short_description_empty:x(Gl,He),skill_agent_icon_small_wrong_type:x(mm,qe),skill_agent_icon_small_empty:x(mm,He),skill_agent_icon_large_wrong_type:x(gm,qe),skill_agent_icon_large_empty:x(gm,He),skill_agent_brand_color_wrong_type:x(Wl,qe),skill_agent_brand_color_empty:x(Wl,He),skill_agent_brand_color_format:x(Wl,jt(pd)),skill_agent_default_prompt_wrong_type:x(vm,qe),skill_agent_default_prompt_empty:x(vm,He),skill_agent_policy_wrong_type:x("policy",ni),skill_agent_allow_implicit_invocation_wrong_type:x(qT,ud),skill_agent_dependencies_wrong_type:x("dependencies",ni),skill_agent_dependency_unsupported:x("dependencies")}}),FT=Bt({table:"Asset path errors",stage:"upload",rows:["declared_asset_path_wrong_type: The named asset field must be a file path string.","declared_asset_path_empty: The named asset field must not be empty.","declared_asset_path_has_outer_whitespace: The named asset field must not begin or end with whitespace.","declared_asset_path_has_control_character: The named asset field must not contain characters U+0000–U+001F or U+007F.","branding_asset_path_missing_root_prefix: The named asset field must start with `./`.","declared_asset_path_unsafe: The named asset field must be a relative path inside the plugin and must not contain an absolute path, drive prefix, or `..` traversal segment.","declared_asset_path_outside_package: The named asset field must reference a file inside the plugin.","declared_asset_file_missing: The named asset field references a file that does not exist.","declared_asset_not_regular_file: The named asset field must reference a file, not a directory or special file."]}),HT=Bt({table:"Image errors",stage:"upload",document:"plugin-manifest",rows:["plugin_logo_path_missing: `interface.logo` is required and must reference a square image.","plugin_composer_icon_path_missing: `interface.composerIcon` is required and must reference a square image.","image_file_unreadable: Image file must be readable.","image_file_too_large: Image must not exceed 5 MiB.","image_file_format_unsupported: Image filename must end in `.png`, `.jpg`, `.jpeg`, `.webp`, or `.svg`.","raster_image_decode_failed: Raster image must be a PNG, JPEG, or WebP file that can be decoded safely.","raster_image_extension_content_mismatch: Image filename extension must match the detected image format.","raster_image_not_square: Image must be square.","raster_image_dimensions_too_small: Image dimensions must be at least 48×48 pixels.","raster_image_dimensions_too_large: Image dimensions must not exceed 4,096×4,096 pixels.","svg_xml_malformed: SVG must contain valid UTF-8 XML.","svg_root_element_invalid: SVG root element must be `<svg>`.","svg_dimensions_missing: SVG must define a numeric `viewBox` or numeric `width` and `height`.","svg_dimensions_not_numeric: SVG dimensions must be numeric and omit units and percentages.","svg_dimensions_not_positive: SVG width and height must be positive finite numbers.","svg_dimensions_not_square: SVG dimensions must be square.","svg_dimensions_too_small: SVG dimensions must be at least 48×48 pixels."],targets:{plugin_logo_path_missing:x("interface.logo"),plugin_composer_icon_path_missing:x("interface.composerIcon")}}),BT=Bt({table:"Package warnings",stage:"upload",severity:"warning",rows:["duplicate_app_reference: Each server ID in `.app.json` must be referenced once; duplicate references are treated as one server.","undeclared_app_manifest_ignored: A root `.app.json` is imported only when the plugin-manifest `apps` field is set to `./.app.json`.","undeclared_mcp_manifest_ignored: A root `.mcp.json` is imported only when the plugin-manifest `mcpServers` field is set to `./.mcp.json`.","skill_file_ignored: Files directly under `skills/` aren't imported as skills; each skill must be in a directory containing `SKILL.md`.","skill_symlink_ignored: Symbolic links directly under `skills/` aren't imported as skills; each skill must be a real directory containing `SKILL.md`.","skill_frontmatter_adjusted: Skill `name` and `description` are normalized during import by trimming outer whitespace and collapsing internal whitespace.","skill_metadata_ignored: Skill interface settings must use the `interface` mapping in `agents/openai.yaml`; `metadata` in `SKILL.md` doesn't configure the interface."],targets:{duplicate_app_reference:$e(".app.json"),undeclared_app_manifest_ignored:$e(".app.json"),undeclared_mcp_manifest_ignored:$e(".mcp.json"),skill_file_ignored:$e("skills/"),skill_symlink_ignored:$e("skills/"),skill_metadata_ignored:$e(Gr)}}),VT=["Productivity","Creativity","Developer Tools","Business & Operations","Data & Analytics","Communication","Education & Research","Security","Finance","Healthcare","Travel","Entertainment","Other"],pa="interface.category",GT=LT(VT),_m="interface.capabilities",ha="interface.websiteURL",fa="interface.privacyPolicyURL",ma="interface.termsOfServiceURL",ga="interface.supportURL",va="interface.brandColor",_a="interface.brandColorDark",ya=dt(2048,1024),WT=Bt({table:"Listing and interface errors",stage:"upload",document:"plugin-manifest",rows:["plugin_interface_wrong_type: The plugin manifest's `interface` field must be a JSON object.","plugin_display_name_wrong_type: `interface.displayName` must be a string.","plugin_display_name_empty: `interface.displayName` is required and must be non-empty.","plugin_display_name_too_long: `interface.displayName` must be 80 characters or fewer for package validation and 30 characters or fewer for final directory submission.","plugin_display_name_character_unsupported: `interface.displayName` must use supported text.","plugin_short_description_missing: `interface.shortDescription` is required, must fit on one line, and must be 240 characters or fewer for package validation and 30 characters or fewer for final directory submission.","plugin_short_description_wrong_type: `interface.shortDescription` must be a string.","plugin_short_description_empty: `interface.shortDescription` must be non-empty.","plugin_short_description_too_long: `interface.shortDescription` must be 240 characters or fewer for package validation and 30 characters or fewer for final directory submission.","plugin_short_description_character_unsupported: `interface.shortDescription` must use supported text.","plugin_long_description_wrong_type: `interface.longDescription` must be a string.","plugin_long_description_empty: `interface.longDescription` is required and must be non-empty.","plugin_long_description_too_long: `interface.longDescription` must be 4,000 characters or fewer.","plugin_long_description_character_unsupported: `interface.longDescription` must use supported text. Line breaks are allowed.","plugin_developer_name_wrong_type: `interface.developerName` must be a string.","plugin_developer_name_empty: `interface.developerName` is required and must be non-empty.","plugin_developer_name_too_long: `interface.developerName` must be 120 characters or fewer for package validation and 80 characters or fewer for final directory submission.","plugin_developer_name_character_unsupported: `interface.developerName` must use supported text.","plugin_category_wrong_type: `interface.category` must be a string.","plugin_category_empty: `interface.category` must be non-empty when provided; omit it to use `Other`.","plugin_category_unknown: `interface.category` must be `Productivity`, `Creativity`, `Developer Tools`, `Business & Operations`, `Data & Analytics`, `Communication`, `Education & Research`, `Security`, `Finance`, `Healthcare`, `Travel`, `Entertainment`, or `Other`.","plugin_category_character_unsupported: `interface.category` must use supported text.","plugin_capabilities_wrong_type: `interface.capabilities` must be a list of strings.","plugin_capabilities_too_many: `interface.capabilities` must contain 20 entries or fewer.","plugin_capability_wrong_type: Each `interface.capabilities` entry must be a string.","plugin_capability_empty: Each `interface.capabilities` entry must be non-empty when provided.","plugin_capability_too_long: Each `interface.capabilities` entry must be 120 characters or fewer.","plugin_capability_character_unsupported: Each `interface.capabilities` entry must use supported text.","plugin_website_url_wrong_type: `interface.websiteURL` must be a string when provided.","plugin_website_url_empty: `interface.websiteURL` must be non-empty when provided.","plugin_website_url_format: `interface.websiteURL` must be an HTTPS URL.","plugin_website_url_too_long: `interface.websiteURL` must meet the listing URL length limits.","plugin_privacy_policy_url_wrong_type: `interface.privacyPolicyURL` must be a string when provided.","plugin_privacy_policy_url_empty: `interface.privacyPolicyURL` must be non-empty when provided.","plugin_privacy_policy_url_format: `interface.privacyPolicyURL` must be an HTTPS URL.","plugin_privacy_policy_url_too_long: `interface.privacyPolicyURL` must meet the listing URL length limits.","plugin_terms_of_service_url_wrong_type: `interface.termsOfServiceURL` must be a string when provided.","plugin_terms_of_service_url_empty: `interface.termsOfServiceURL` must be non-empty when provided.","plugin_terms_of_service_url_format: `interface.termsOfServiceURL` must be an HTTPS URL.","plugin_terms_of_service_url_too_long: `interface.termsOfServiceURL` must meet the listing URL length limits.","plugin_support_url_wrong_type: `interface.supportURL` must be a string when provided.","plugin_support_url_empty: `interface.supportURL` must be non-empty when provided.","plugin_support_url_format: `interface.supportURL` must be an HTTPS URL.","plugin_support_url_too_long: `interface.supportURL` must meet the listing URL length limits.","plugin_homepage_wrong_type: `homepage` must be a string when provided.","plugin_homepage_empty: `homepage` must be non-empty when provided.","plugin_homepage_format: `homepage` must be an HTTPS URL.","plugin_homepage_too_long: `homepage` must be 2,048 characters or fewer.","plugin_brand_color_wrong_type: `interface.brandColor` must be a string when provided.","plugin_brand_color_empty: `interface.brandColor` must be non-empty when provided.","plugin_brand_color_format: `interface.brandColor` must be a six-digit hex color, such as `#1ABCFE`.","plugin_brand_color_dark_wrong_type: `interface.brandColorDark` must be a string when provided.","plugin_brand_color_dark_empty: `interface.brandColorDark` must be non-empty when provided.","plugin_brand_color_dark_format: `interface.brandColorDark` must be a six-digit hex color, such as `#1ABCFE`.","plugin_brand_color_contrast: `interface.brandColor` must have at least 2:1 contrast against white.","plugin_brand_color_dark_contrast: `interface.brandColorDark` must have at least 2:1 contrast against `#212121`.","plugin_default_prompt_wrong_type: `interface.defaultPrompt` must be a string or list of strings.","plugin_default_prompt_too_many: `interface.defaultPrompt` must contain at most three prompts.","plugin_default_prompt_entry_wrong_type: Each `interface.defaultPrompt` entry must be a string.","plugin_default_prompt_empty: Each `interface.defaultPrompt` entry must be non-empty when provided.","plugin_default_prompt_too_long: Each `interface.defaultPrompt` entry must be 512 characters or fewer for package validation and 128 characters or fewer for final directory submission.","plugin_default_prompt_character_unsupported: Each `interface.defaultPrompt` entry must use supported text and fit on one line."],targets:{plugin_interface_wrong_type:x("interface",ni),plugin_display_name_wrong_type:x(on,qe),plugin_display_name_empty:x(on,sn),plugin_display_name_too_long:x(on,dt(80)),plugin_display_name_character_unsupported:x(on,ur),plugin_short_description_missing:x(_i,ir),plugin_short_description_wrong_type:x(_i,qe),plugin_short_description_empty:x(_i,He),plugin_short_description_too_long:x(_i,dt(240)),plugin_short_description_character_unsupported:x(_i,Wn),plugin_long_description_wrong_type:x(an,qe),plugin_long_description_empty:x(an,sn),plugin_long_description_too_long:x(an,dt(4e3)),plugin_long_description_character_unsupported:x(an,ur),plugin_developer_name_wrong_type:x(bi,qe),plugin_developer_name_empty:x(bi,sn),plugin_developer_name_too_long:x(bi,dt(120)),plugin_developer_name_character_unsupported:x(bi,ur),plugin_category_wrong_type:x(pa,qe),plugin_category_empty:x(pa,He),plugin_category_unknown:x(pa,GT),plugin_category_character_unsupported:x(pa,ur),plugin_capabilities_wrong_type:x(_m,Oo("array")),plugin_capabilities_too_many:x(_m,hm(20)),plugin_capability_wrong_type:x(io,qe),plugin_capability_empty:x(io,He),plugin_capability_too_long:x(io,dt(120)),plugin_capability_character_unsupported:x(io,ur),plugin_website_url_wrong_type:x(ha,qe),plugin_website_url_empty:x(ha,He),plugin_website_url_format:x(ha,jt(js)),plugin_website_url_too_long:x(ha,ya),plugin_privacy_policy_url_wrong_type:x(fa,qe),plugin_privacy_policy_url_empty:x(fa,He),plugin_privacy_policy_url_format:x(fa,jt(js)),plugin_privacy_policy_url_too_long:x(fa,ya),plugin_terms_of_service_url_wrong_type:x(ma,qe),plugin_terms_of_service_url_empty:x(ma,He),plugin_terms_of_service_url_format:x(ma,jt(js)),plugin_terms_of_service_url_too_long:x(ma,ya),plugin_support_url_wrong_type:x(ga,qe),plugin_support_url_empty:x(ga,He),plugin_support_url_format:x(ga,jt(js)),plugin_support_url_too_long:x(ga,ya),plugin_homepage_wrong_type:x("homepage",qe),plugin_homepage_empty:x("homepage",He),plugin_homepage_format:x("homepage",jt(js)),plugin_homepage_too_long:x("homepage",dt(2048)),plugin_brand_color_wrong_type:x(va,qe),plugin_brand_color_empty:x(va,He),plugin_brand_color_format:x(va,jt(pd)),plugin_brand_color_dark_wrong_type:x(_a,qe),plugin_brand_color_dark_empty:x(_a,He),plugin_brand_color_dark_format:x(_a,jt(pd)),plugin_brand_color_contrast:x(va),plugin_brand_color_dark_contrast:x(_a),plugin_default_prompt_wrong_type:x(dd,Oo("string","array")),plugin_default_prompt_too_many:x(dd,hm(3)),plugin_default_prompt_entry_wrong_type:x(no,qe),plugin_default_prompt_empty:x(no,He),plugin_default_prompt_too_long:x(no,dt(512,128)),plugin_default_prompt_character_unsupported:x(no,Wn)}}),JT=/^https:\/\/[^\s/?#]+(?:[/?#]\S*)?$/i,KT=Oy(/^[a-z][a-z\d+.-]*:\/\/[^\s/?#]*@/i),YT=/^(?:\.\/)?skills\/?$/,XT=/^(?:\.\/)?\.app\.json$/,ZT=/^(?:\.\/)?\.mcp\.json$/,QT=/^(?:asdk_app_|connector_|templated_apps_)[A-Za-z0-9][\w-]*$/,eC=Bt({table:"Plugin manifest errors",stage:"upload",document:"plugin-manifest",rows:[`plugin_manifest_missing: ${xr.plugin_manifest_missing.message}`,"plugin_manifest_not_file: Plugin manifest must be a regular JSON file.","plugin_manifest_unreadable: Plugin manifest must be readable UTF-8 text.","plugin_manifest_json_malformed: Plugin manifest must contain valid JSON; malformed syntax is reported with a line number.","plugin_manifest_root_not_object: Plugin manifest must contain a JSON object at the top level.","codex_manifest_parent_not_directory: `.codex-plugin` must be a directory.","codex_manifest_path_not_file: `.codex-plugin/plugin.json` must be a regular JSON file.","plugin_id_wrong_type: `id` must be a string when provided.","plugin_id_empty: `id` must be non-empty when provided.",`plugin_name_missing: ${xr.plugin_name_missing.message}`,`plugin_name_wrong_type: ${xr.plugin_name_wrong_type.message}`,`plugin_name_empty: ${xr.plugin_name_empty.message}`,`plugin_name_too_long: ${xr.plugin_name_too_long.message}`,`plugin_name_format: ${xr.plugin_name_format.message}`,"plugin_version_missing: `version` is required.","plugin_version_wrong_type: `version` must be a string.","plugin_version_empty: `version` must be a non-empty semantic-version string, such as `1.0.0`.","plugin_version_not_semver: `version` must use semantic versioning, such as `1.0.0`.","plugin_version_too_long: `version` must be 64 characters or fewer.","plugin_description_missing: `description` is required.","plugin_description_wrong_type: `description` must be a string.","plugin_description_empty: `description` must be non-empty.","plugin_description_too_long: `description` must be 1,024 characters or fewer.","plugin_description_character_unsupported: `description` must use supported text. Line breaks are allowed.","plugin_developer_missing: `author.name` is required. `interface.developerName` is also required and is reported separately.","plugin_author_wrong_type: `author` must be an object.","plugin_author_name_wrong_type: `author.name` must be a string.","plugin_author_name_empty: `author.name` must be non-empty.","plugin_author_name_too_long: `author.name` must be 120 characters or fewer.","plugin_author_name_character_unsupported: `author.name` must use supported text.","plugin_author_email_wrong_type: `author.email` must be a string when provided.","plugin_author_email_empty: `author.email` must be non-empty when provided.","plugin_author_email_too_long: `author.email` must be 320 characters or fewer.","plugin_author_email_character_unsupported: `author.email` must use supported text.","plugin_author_url_wrong_type: `author.url` must be a string when provided.","plugin_author_url_empty: `author.url` must be non-empty when provided.","plugin_author_url_not_https: `author.url` must be an HTTPS URL.","plugin_author_url_has_credentials: `author.url` must not contain credentials.","plugin_author_url_too_long: `author.url` must be 2,048 characters or fewer.","plugin_author_url_character_unsupported: `author.url` must use supported text."],targets:{codex_manifest_parent_not_directory:$e(".codex-plugin"),codex_manifest_path_not_file:$e(".codex-plugin/plugin.json"),plugin_id_wrong_type:x("id",qe),plugin_id_empty:x("id",He),plugin_name_missing:x("name",ir),plugin_name_wrong_type:x("name",qe),plugin_name_empty:x("name",He),plugin_name_too_long:x("name",dt(64)),plugin_name_format:x("name",jt(uy)),plugin_version_missing:x("version",ir),plugin_version_wrong_type:x("version",qe),plugin_version_empty:x("version",He),plugin_version_not_semver:x("version",jt($T)),plugin_version_too_long:x("version",dt(64)),plugin_description_missing:x("description",ir),plugin_description_wrong_type:x("description",qe),plugin_description_empty:x("description",He),plugin_description_too_long:x("description",dt(1024)),plugin_description_character_unsupported:x("description",ur),plugin_developer_missing:x("author.name",ir),plugin_author_wrong_type:x("author",ni),plugin_author_name_wrong_type:x("author.name",qe),plugin_author_name_empty:x("author.name",He),plugin_author_name_too_long:x("author.name",dt(120)),plugin_author_name_character_unsupported:x("author.name",ur),plugin_author_email_wrong_type:x("author.email",qe),plugin_author_email_empty:x("author.email",He),plugin_author_email_too_long:x("author.email",dt(320)),plugin_author_email_character_unsupported:x("author.email",ur),plugin_author_url_wrong_type:x("author.url",qe),plugin_author_url_empty:x("author.url",He),plugin_author_url_not_https:x("author.url",jt(JT)),plugin_author_url_has_credentials:x("author.url",KT),plugin_author_url_too_long:x("author.url",dt(2048)),plugin_author_url_character_unsupported:x("author.url",ur)}}),tC=Bt({table:"Plugin content errors",stage:"upload",document:"plugin-manifest",rows:["plugin_skills_path_wrong_type: `skills` must be a string path for the root `skills/` directory.","plugin_skills_path_empty: `skills` must be a non-empty path to the root `skills/` directory when provided.","plugin_skills_path_unsupported: `skills` must resolve to the root `skills/` directory.","plugin_skills_directory_missing: A declared root `skills/` directory must exist.","plugin_skills_path_not_directory: Root `skills/` must be a directory when declared.","plugin_apps_path_wrong_type: `apps` must be a string path for the root `.app.json`.","plugin_apps_path_empty: `apps` must be a non-empty path to the root `.app.json` when provided.","plugin_apps_path_unsupported: `apps` must resolve to the root `.app.json`.","plugin_apps_file_missing: A declared root `.app.json` file must exist.","plugin_apps_path_not_file: Root `.app.json` must be a regular file when declared.","plugin_mcp_path_wrong_type: `mcpServers` must be a string path for the root `.mcp.json`.","plugin_mcp_path_empty: `mcpServers` must be a nonempty path. Set it to `./.mcp.json` or remove the field.","plugin_mcp_path_unsupported: `mcpServers` must resolve to the root `.mcp.json`.","plugin_mcp_file_missing: `mcpServers` declares the root `.mcp.json`, but that file doesn't exist.","plugin_mcp_path_not_file: Root `.mcp.json` must be a regular file.","plugin_runtime_surface_missing: A public submission ZIP must contain at least one valid skill (or an approved local MCP server). Local and workspace packages can also reference an eligible MCP server."],targets:{plugin_skills_path_wrong_type:x("skills",qe),plugin_skills_path_empty:x("skills",He),plugin_skills_path_unsupported:x("skills",jt(YT)),plugin_skills_directory_missing:$e("skills/"),plugin_skills_path_not_directory:$e("skills/"),plugin_apps_path_wrong_type:x("apps",qe),plugin_apps_path_empty:x("apps",He),plugin_apps_path_unsupported:x("apps",jt(XT)),plugin_apps_file_missing:$e(".app.json"),plugin_apps_path_not_file:$e(".app.json"),plugin_mcp_path_wrong_type:x("mcpServers",qe),plugin_mcp_path_empty:x("mcpServers",He),plugin_mcp_path_unsupported:x("mcpServers",jt(ZT)),plugin_mcp_file_missing:$e(".mcp.json"),plugin_mcp_path_not_file:$e(".mcp.json")}}),rC=Bt({table:"MCP manifest errors",stage:"upload",document:"mcp-config",rows:["mcp_manifest_unreadable: `.mcp.json` must be readable UTF-8 text.","mcp_manifest_json_malformed: `.mcp.json` must contain valid JSON; malformed syntax is reported with a line number.","mcp_manifest_wrong_type: `.mcp.json` must contain a JSON object at the top level.","mcp_servers_missing: `.mcp.json` must contain the top-level `mcpServers` field.","mcp_servers_wrong_type: `mcpServers` must be an object.","mcp_server_name_empty: Every MCP server name must contain at least one non-whitespace character.","mcp_server_wrong_type: Each `mcpServers.<server-name>` value must be an object containing that server's declaration."],targets:{mcp_manifest_unreadable:$e(".mcp.json"),mcp_manifest_json_malformed:$e(".mcp.json"),mcp_manifest_wrong_type:$e(".mcp.json"),mcp_servers_missing:x("mcpServers",ir),mcp_servers_wrong_type:x("mcpServers",ni),mcp_server_name_empty:x("mcpServers"),mcp_server_wrong_type:x("mcpServers.*",ni)}}),iC=Bt({table:"MCP server reference errors",stage:"upload",document:"app-config",rows:["app_manifest_unreadable: `.app.json` must be readable UTF-8 text.","app_manifest_json_malformed: `.app.json` contains malformed JSON near the reported line.","app_manifest_wrong_type: `.app.json` must contain a JSON object at the top level.","app_entries_missing: `apps` is required.","app_entries_wrong_type: `apps` must be an object.","app_entry_wrong_type: Each server entry must be an object.","app_id_missing: Each server entry's `id` is required.","app_id_wrong_type: Each server entry's `id` must be a string.","app_id_format: Each server entry's `id` must begin with `asdk_app_`, `connector_`, or `templated_apps_`, followed by a letter or digit and then only letters, digits, `_`, or `-`.","app_entry_optional_wrong_type: Each server entry's `optional` value must be `true` or `false` when provided.","app_entry_required_wrong_type: Each server entry's `required` value must be `true` or `false` when provided.","app_not_eligible: A local or workspace package must reference an eligible, available MCP server. Directory submissions must use **With MCP** and submit the MCP server directly."],targets:{app_manifest_unreadable:$e(".app.json"),app_manifest_json_malformed:$e(".app.json"),app_manifest_wrong_type:$e(".app.json"),app_entries_missing:x("apps",ir),app_entries_wrong_type:x("apps",ni),app_entry_wrong_type:x("apps.*",ni),app_id_missing:x("apps.*.id",ir),app_id_wrong_type:x("apps.*.id",qe),app_id_format:x("apps.*.id",jt(QT)),app_entry_optional_wrong_type:x("apps.*.optional",ud),app_entry_required_wrong_type:x("apps.*.required",ud)}}),nC=Oy(/(?:^|\s)@\S/),sC=Bt({table:"Final metadata errors",stage:"submission",document:"plugin-manifest",rows:["submission_display_name_required: Display name is required, non-empty, and single-line.","submission_display_name_too_long: Display name must be 30 characters or fewer.","submission_display_name_character_unsupported: Display name must use supported text and fit on one line.","submission_subtitle_required: Short description is required, non-empty, and single-line.","submission_subtitle_too_long: Short description must be 30 characters or fewer.","submission_subtitle_character_unsupported: Short description must use supported text and fit on one line.","submission_description_required: Long description is required and must be non-empty. Line breaks are allowed.","submission_description_too_long: Long description must be 4,000 characters or fewer.","submission_description_character_unsupported: Long description must use supported text. Line breaks are allowed.","submission_developer_name_required: Developer name is required, non-empty, and single-line.","submission_developer_name_too_long: Developer name must be 80 characters or fewer.","submission_developer_name_character_unsupported: Developer name must use supported text and fit on one line.","plugin_capability_invalid: Each capability must be non-empty, use supported text, fit on one line, and be 120 characters or fewer.","plugin_default_prompt_mention: Starter prompts must not contain MCP server `@mentions`.","plugin_default_prompt_duplicate: Starter prompts must be unique after Unicode and whitespace normalization."],targets:{submission_display_name_required:x(on,sn),submission_display_name_too_long:x(on,dt(30)),submission_display_name_character_unsupported:x(on,Wn),submission_subtitle_required:x(_i,sn),submission_subtitle_too_long:x(_i,dt(30)),submission_subtitle_character_unsupported:x(_i,Wn),submission_description_required:x(an,sn),submission_description_too_long:x(an,dt(4e3)),submission_description_character_unsupported:x(an,ur),submission_developer_name_required:x(bi,sn),submission_developer_name_too_long:x(bi,dt(80)),submission_developer_name_character_unsupported:x(bi,Wn),plugin_capability_invalid:x(io,He,Wn,dt(120)),plugin_default_prompt_mention:x(no,nC),plugin_default_prompt_duplicate:x(dd)}}),oC=Bt({table:"MCP and review errors",stage:"submission",rows:["annotations_required: Every MCP tool must set `readOnlyHint`, `openWorldHint`, and `destructiveHint` accurately.","justification_required: Every MCP tool annotation must include a justification for its read-only, open-world, or destructive behavior.","scan_required: MCP tools must have a successful, current scan of the production MCP server.","domain_verification_required: The exact verification token must be hosted at the generated `/.well-known/openai-apps-challenge` URL on the MCP host or an allowed parent host, and **Verify Domain** must pass.","frame_domain_explanation_required: Every external frame domain reported by the MCP tool scan must have an explanation of why the UI needs it and what content it provides."]}),xy=[...sC,...oC,...NT,...DT,...UT,...eC,...WT,...tC,...rC,...jT,...zT,...FT,...HT,...iC,...BT],aC=xy,HB=Object.freeze(Object.fromEntries(xy.map(e=>[e.code,e]))),cC={"Final metadata errors":"listing-fields","MCP and review errors":"mcp-server","ZIP upload errors and warnings":"package-archive","ZIP structure and limit errors":"package-archive","Plugin root errors":"package-archive","Plugin manifest errors":"package-manifest","Listing and interface errors":"package-manifest","Plugin content errors":"package-manifest","MCP manifest errors":"package-manifest","Skill errors":"package-skills","Skill agent metadata errors":"package-skills","Asset path errors":"package-assets","Image errors":"package-assets","MCP server reference errors":"package-manifest","Package warnings":"package-manifest"},lC={mcp_configuration_excluded:"exclusions",app_configuration_excluded:"exclusions",skill_file_ignored:"package-skills",skill_symlink_ignored:"package-skills",skill_frontmatter_adjusted:"package-skills",skill_metadata_ignored:"package-skills"},uC=aC.map(e=>({id:e.code,category:lC[e.code]??cC[e.table],severity:e.severity==="warning"?"advisory":"blocking",message:e.message,...e.code==="plugin_name_too_long"?{limit:{name:"fieldLimits.pluginNameMaxLength",value:er.pluginNameMaxLength}}:{},source:{...gr("deploy/submission-errors",`§${e.table}`),snapshotDate:e.source.capturedOn}})),ne=e=>gr("deploy/submission-errors",e),dC=[{id:"archive-too-large",category:"package-archive",severity:"blocking",message:"The uploaded archive exceeds the maximum compressed size.",limit:{name:"archiveLimits.maxCompressedBytes",value:Ua.maxCompressedBytes},source:ne("§Shared package checks → Archive size")},{id:"archive-expands-too-large",category:"package-archive",severity:"blocking",message:"The archive's contents exceed the maximum uncompressed size when expanded.",limit:{name:"archiveLimits.maxUncompressedBytes",value:Ua.maxUncompressedBytes},source:ne("§Shared package checks → Archive size")},{id:"archive-too-many-entries",category:"package-archive",severity:"blocking",message:"The archive contains more entries than the maximum allowed.",limit:{name:"archiveLimits.maxEntries",value:Ua.maxEntries},source:ne("§Shared package checks → Entry count")},{id:"archive-encrypted-entry",category:"package-archive",severity:"blocking",message:"The archive contains an encrypted entry, which cannot be scanned.",source:ne("§Shared package checks → Archive integrity")},{id:"archive-path-traversal",category:"package-archive",severity:"blocking",message:"An entry path escapes the package root via a `..` segment.",source:ne("§Shared package checks → Entry paths")},{id:"archive-absolute-path",category:"package-archive",severity:"blocking",message:"An entry path is absolute rather than package-relative.",source:ne("§Shared package checks → Entry paths")},{id:"archive-backslash-path",category:"package-archive",severity:"blocking",message:"An entry path uses a backslash separator.",source:ne("§Shared package checks → Entry paths")},{id:"archive-empty-path-segment",category:"package-archive",severity:"blocking",message:"An entry path contains an empty or `.` segment.",source:ne("§Shared package checks → Entry paths")},{id:"archive-path-whitespace",category:"package-archive",severity:"blocking",message:"An entry path has leading or trailing whitespace.",source:ne("§Shared package checks → Entry paths")},{id:"archive-path-control-character",category:"package-archive",severity:"blocking",message:"An entry path contains a control character or NUL byte.",source:ne("§Shared package checks → Entry paths")},{id:"archive-duplicate-path",category:"package-archive",severity:"blocking",message:"Two entries normalize to the same path, including case-insensitive collisions.",source:ne("§Shared package checks → Entry paths")},{id:"archive-symlink-entry",category:"package-archive",severity:"blocking",message:"The archive contains a symlink or hardlink entry.",source:ne("§Shared package checks → Archive integrity")},{id:"manifest-missing",category:"package-manifest",severity:"blocking",message:"The package contains no plugin manifest.",source:ne("§Shared package checks → Manifest")},{id:"manifest-invalid-json",category:"package-manifest",severity:"blocking",message:"The plugin manifest is not valid JSON.",source:ne("§Shared package checks → Manifest")},{id:"manifest-name-missing",category:"package-manifest",severity:"blocking",message:"The manifest declares no plugin name.",source:ne("§Shared package checks → Manifest")},{id:"manifest-name-too-long",category:"package-manifest",severity:"blocking",message:"The manifest's plugin name exceeds the maximum length.",limit:{name:"fieldLimits.nameMaxLength",value:er.nameMaxLength},source:ne("§Shared package checks → Manifest")},{id:"manifest-version-invalid",category:"package-manifest",severity:"blocking",message:"The manifest's version is not a valid semantic version.",source:ne("§Shared package checks → Manifest")},{id:"interface-display-name-missing",category:"package-manifest",severity:"blocking",message:"The OpenAI interface document declares no display name.",source:ne("§Listing fields → Interface")},{id:"interface-display-name-too-long",category:"package-manifest",severity:"blocking",message:"The interface display name exceeds the maximum length.",limit:{name:"fieldLimits.displayNameMaxLength",value:er.displayNameMaxLength},source:ne("§Listing fields → Interface")},{id:"interface-short-description-too-long",category:"package-manifest",severity:"blocking",message:"The interface short description exceeds the maximum length.",limit:{name:"fieldLimits.shortDescriptionMaxLength",value:er.shortDescriptionMaxLength},source:ne("§Listing fields → Interface")},{id:"interface-default-prompt-too-long",category:"package-manifest",severity:"blocking",message:"The interface default prompt exceeds the maximum length.",limit:{name:"fieldLimits.defaultPromptMaxLength",value:er.defaultPromptMaxLength},source:ne("§Listing fields → Interface")},{id:"interface-brand-color-invalid",category:"package-manifest",severity:"blocking",message:"The brand color is not a six-digit hex value.",source:ne("§Listing fields → Interface")},{id:"interface-brand-color-low-contrast",category:"package-manifest",severity:"blocking",message:"The brand color does not meet the minimum contrast ratio against both the light and dark backgrounds.",source:ne("§Listing fields → Interface")},{id:"interface-yaml-invalid",category:"package-manifest",severity:"blocking",message:"The OpenAI interface document is not valid YAML.",source:ne("§Listing fields → Interface")},{id:"interface-unsupported-text",category:"package-manifest",severity:"blocking",message:"A text field contains control characters or Unicode line/paragraph separators.",source:ne("§Listing fields → Text")},{id:"skill-metadata-missing",category:"package-skills",severity:"blocking",message:"A skill directory contains no SKILL.md.",source:ne("§Skills → Structure")},{id:"skill-frontmatter-invalid",category:"package-skills",severity:"blocking",message:"A skill's SKILL.md frontmatter is missing or malformed.",source:ne("§Skills → Frontmatter")},{id:"skill-name-missing",category:"package-skills",severity:"blocking",message:"A skill's frontmatter declares no name.",source:ne("§Skills → Frontmatter")},{id:"skill-name-too-long",category:"package-skills",severity:"blocking",message:"A skill name exceeds the maximum length.",limit:{name:"fieldLimits.skillNameMaxLength",value:er.skillNameMaxLength},source:ne("§Skills → Frontmatter")},{id:"skill-description-missing",category:"package-skills",severity:"blocking",message:"A skill's frontmatter declares no description.",source:ne("§Skills → Frontmatter")},{id:"skill-name-collision",category:"package-skills",severity:"blocking",message:"Two skills in the package declare the same name.",source:ne("§Skills → Structure")},{id:"asset-unsupported-type",category:"package-assets",severity:"blocking",message:"An image is not one of the accepted formats.",source:ne("§Images → Format")},{id:"asset-too-large",category:"package-assets",severity:"blocking",message:"An image exceeds the maximum file size.",limit:{name:"imageConstraints.maxBytes",value:qa.maxBytes},source:ne("§Images → Size")},{id:"asset-too-small",category:"package-assets",severity:"blocking",message:"An image is smaller than the minimum edge length.",limit:{name:"imageConstraints.minEdgePx",value:qa.minEdgePx},source:ne("§Images → Dimensions")},{id:"asset-too-big-dimensions",category:"package-assets",severity:"blocking",message:"An image exceeds the maximum edge length.",limit:{name:"imageConstraints.maxEdgePx",value:qa.maxEdgePx},source:ne("§Images → Dimensions")},{id:"asset-not-square",category:"package-assets",severity:"blocking",message:"An image is not square.",source:ne("§Images → Dimensions")},{id:"asset-undecodable",category:"package-assets",severity:"blocking",message:"An image's dimensions could not be read from its bytes.",source:ne("§Images → Format")},{id:"asset-svg-malformed",category:"package-assets",severity:"blocking",message:"An SVG is not well-formed XML or has no `svg` root element.",source:ne("§Images → SVG")},{id:"asset-svg-no-dimensions",category:"package-assets",severity:"blocking",message:"An SVG declares neither a numeric width/height pair nor a numeric viewBox.",source:ne("§Images → SVG")},{id:"asset-missing",category:"package-assets",severity:"blocking",message:"An asset referenced by the manifest is absent from the package.",source:ne("§Images → Format")},{id:"listing-category-unknown",category:"listing-fields",severity:"blocking",message:"The listing names a category outside the supported set.",source:ne("§Listing fields → Categories")},{id:"listing-description-too-long",category:"listing-fields",severity:"blocking",message:"The listing description exceeds the maximum length.",limit:{name:"fieldLimits.descriptionMaxLength",value:er.descriptionMaxLength},source:ne("§Listing fields → Description")},{id:"listing-promotional-metadata",category:"listing-fields",severity:"blocking",message:"Listing metadata contains promotional language, pricing claims, or ranking claims.",source:ne("§Listing fields → Description")},{id:"listing-privacy-policy-missing",category:"listing-fields",severity:"blocking",message:"The listing declares no privacy policy URL.",source:ne("§Listing fields → Links")},{id:"listing-support-url-missing",category:"listing-fields",severity:"blocking",message:"The listing declares no support URL.",source:ne("§Listing fields → Links")},{id:"mcp-endpoint-not-https",category:"mcp-server",severity:"blocking",message:"The MCP endpoint is not served over HTTPS.",source:ne("§MCP tools → Endpoint")},{id:"mcp-endpoint-unreachable",category:"mcp-server",severity:"blocking",message:"The MCP endpoint could not be reached during the scan.",source:ne("§MCP tools → Endpoint")},{id:"mcp-tool-name-too-long",category:"mcp-server",severity:"blocking",message:"A tool name exceeds the maximum length.",limit:{name:"fieldLimits.toolNameMaxLength",value:er.toolNameMaxLength},source:ne("§MCP tools → Metadata")},{id:"mcp-tool-description-missing",category:"mcp-server",severity:"blocking",message:"A tool declares no description.",source:ne("§MCP tools → Metadata")},{id:"mcp-tool-annotations-missing",category:"mcp-server",severity:"blocking",message:"A tool is missing one or more of the required annotation hints.",source:ne("§MCP tools → Annotations")},{id:"mcp-tool-schema-invalid",category:"mcp-server",severity:"blocking",message:"A tool's input or output schema is not a valid JSON Schema object.",source:ne("§MCP tools → Schemas")},{id:"mcp-domain-not-verified",category:"mcp-server",severity:"blocking",message:"The MCP server's domain has not completed domain verification.",source:ne("§MCP tools → Domain verification")},{id:"mcp-csp-domain-missing",category:"mcp-server",severity:"blocking",message:"A UI resource loads from a domain absent from the declared content security policy.",source:ne("§MCP tools → Content security policy")},{id:"mcp-ui-domain-missing",category:"mcp-server",severity:"blocking",message:"A UI resource declares no `_meta.ui.domain`.",source:ne("§MCP tools → UI resources")},{id:"mcp-ui-domain-duplicate",category:"mcp-server",severity:"blocking",message:"Two UI resources declare the same `_meta.ui.domain`.",source:ne("§MCP tools → UI resources")},{id:"mcp-ui-mime-invalid",category:"mcp-server",severity:"blocking",message:"A UI resource does not declare the plugin UI MIME profile.",source:ne("§MCP tools → UI resources")},{id:"mcp-skill-too-many",category:"mcp-skills",severity:"blocking",message:"The server advertises more importable skills than the maximum.",limit:{name:"mcpSkillLimits.maxSkills",value:Xi.maxSkills},source:ne("§Skills → Imported from MCP")},{id:"mcp-skill-markdown-too-large",category:"mcp-skills",severity:"blocking",message:"An imported skill's markdown exceeds the maximum size.",limit:{name:"mcpSkillLimits.maxSkillMarkdownBytes",value:Xi.maxSkillMarkdownBytes},source:ne("§Skills → Imported from MCP")},{id:"mcp-skill-page-too-large",category:"mcp-skills",severity:"blocking",message:"An imported skill's supporting page exceeds the maximum size.",limit:{name:"mcpSkillLimits.maxPageBytes",value:Xi.maxPageBytes},source:ne("§Skills → Imported from MCP")},{id:"mcp-skill-too-many-pages",category:"mcp-skills",severity:"blocking",message:"An imported skill has more supporting pages than the maximum.",limit:{name:"mcpSkillLimits.maxPagesPerSkill",value:Xi.maxPagesPerSkill},source:ne("§Skills → Imported from MCP")},{id:"mcp-skill-total-too-large",category:"mcp-skills",severity:"blocking",message:"An imported skill's total footprint exceeds the maximum.",limit:{name:"mcpSkillLimits.maxSkillTotalBytes",value:Xi.maxSkillTotalBytes},source:ne("§Skills → Imported from MCP")},{id:"mcp-skills-total-too-large",category:"mcp-skills",severity:"blocking",message:"The imported skills exceed the maximum combined size.",limit:{name:"mcpSkillLimits.maxImportedTotalBytes",value:Xi.maxImportedTotalBytes},source:ne("§Skills → Imported from MCP")},{id:"mcp-skill-digest-mismatch",category:"mcp-skills",severity:"blocking",message:"An imported skill's declared digest does not match the resource served for it.",source:ne("§Skills → Imported from MCP")},{id:"mcp-skill-frontmatter-mismatch",category:"mcp-skills",severity:"blocking",message:"An imported skill's listing metadata disagrees with its SKILL.md frontmatter.",source:ne("§Skills → Imported from MCP")},{id:"mcp-skill-scan-failed",category:"mcp-skills",severity:"blocking",message:"The skill scan failed, so the draft's imported skills were not updated.",source:ne("§Skills → Imported from MCP")},{id:"review-success-tests-missing",category:"review-materials",severity:"blocking",message:"Fewer successful test cases were supplied than required.",limit:{name:"submissionTestCases.successCount",value:nn.successCount},source:ne("§Review materials → Test cases")},{id:"review-failure-tests-missing",category:"review-materials",severity:"blocking",message:"Fewer graceful-failure test cases were supplied than required.",limit:{name:"submissionTestCases.failureCount",value:nn.failureCount},source:ne("§Review materials → Test cases")},{id:"review-demo-credentials-missing",category:"review-materials",severity:"blocking",message:"The submission authenticates users but supplies no reviewer demo credentials.",source:ne("§Review materials → Demo access")},{id:"review-demo-recording-missing",category:"review-materials",severity:"blocking",message:"No demo recording was supplied.",source:ne("§Review materials → Demo access")},{id:"review-release-notes-missing",category:"review-materials",severity:"blocking",message:"An updated submission supplies no release notes.",source:ne("§Review materials → Release notes")},{id:"review-attestation-missing",category:"review-materials",severity:"blocking",message:"A required policy attestation was not affirmed.",source:ne("§Review materials → Attestations")},{id:"review-identity-not-verified",category:"review-materials",severity:"blocking",message:"The submitting account has not completed identity verification.",source:ne("§Review materials → Account")},{id:"review-write-permission-missing",category:"review-materials",severity:"blocking",message:"The submitting account lacks the app-write permission.",source:ne("§Review materials → Account")},{id:"review-geography-missing",category:"review-materials",severity:"blocking",message:"The submission declares no country availability.",source:ne("§Review materials → Availability")},{id:"review-annotation-justification-missing",category:"review-materials",severity:"advisory",message:"A tool annotated as destructive or open-world carries no justification for review.",source:ne("§Review materials → Test cases")},{id:"review-scan-stale",category:"review-materials",severity:"blocking",message:"The draft's scan predates the current server contract; re-run Scan Tools.",source:ne("§MCP tools → Scan")},{id:"exclusion-mcp-servers-in-skills-only",category:"exclusions",severity:"blocking",message:"A skills-only submission declares MCP servers, which that shape excludes.",source:ne("§Shared package checks → Excluded content")},{id:"exclusion-app-config-in-public-package",category:"exclusions",severity:"blocking",message:"The package contains an `.app.json`, which maps registered connections for local or workspace use and is excluded from a public submission.",source:ne("§Shared package checks → Excluded content")},{id:"exclusion-screenshots-without-ui",category:"exclusions",severity:"blocking",message:"Screenshots were supplied for a submission that renders no UI template.",source:ne("§Images → Screenshots")},{id:"exclusion-bundle-in-mcp-only",category:"exclusions",severity:"blocking",message:"An MCP-only submission supplies a package archive.",source:ne("§Shared package checks → Excluded content")},{id:"exclusion-unsupported-surface",category:"exclusions",severity:"blocking",message:"The package contains a surface the plugin directory does not support.",source:ne("§Shared package checks → Excluded content")},...uC],BB=Object.freeze(Object.fromEntries(dC.map(e=>[e.id,e]))),pC=["ownsOrIsAuthorizedForService","accurateDataDisclosure","compliesWithUsagePolicies","noProhibitedContent","maintainsSecurityPractices","respondsToSecurityReports","keepsListingAccurate"],hC=["none","account-identifiers","user-content","usage-analytics","payment-information","location","health","shared-with-third-parties"],fC=["in-submission-form","shared-out-of-band","not-required-authless"],Jl=w().url().refine(e=>e.startsWith("https://"),{message:"must be an https:// URL"}),ym=ee({prompt:w().min(1),expectation:w().min(1)}),mC=ee({reference:w().min(1),mimeType:w().min(1),widthPx:Le().int().positive(),heightPx:Le().int().positive(),prompt:w().min(1)}),VB=ee({name:w().min(1).max(er.nameMaxLength),shortDescription:w().min(1).max(er.shortDescriptionMaxLength),description:w().min(1).max(er.descriptionMaxLength),categories:Q(it(Ry)).min(1),privacyPolicyUrl:Jl,supportUrl:Jl,documentationUrl:Jl.optional(),testCases:ee({successful:Q(ym),gracefulFailure:Q(ym)}),demoCredentials:ee({provided:Oe(),delivery:it(fC)}),demoRecordingProvided:Oe(),screenshots:Q(mC).default([]),releaseNotes:w().min(1).optional(),identityVerified:Oe(),accountPermissions:Q(w().min(1)).default([]),availableCountries:Q(w().length(2)).default([]),dataResidencyEligible:Oe().optional(),privacyPolicyDataTypes:Q(it(hC)).default([]),annotationJustifications:Je(w(),w().min(1)).default({}),frameDomainExplanations:Je(w(),w().min(1)).default({}),domainVerificationToken:w().min(1).optional(),lastScanAt:w().datetime().optional(),hasPublishedVersion:Oe().optional(),attestations:V_(it(pC),Oe())}),GB=new TextDecoder("utf-8",{fatal:!1}),Gp=Symbol.for("yaml.alias"),gC=Symbol.for("yaml.document"),dn=Symbol.for("yaml.map"),My=Symbol.for("yaml.pair"),Wp=Symbol.for("yaml.scalar"),Wo=Symbol.for("yaml.seq"),zr=Symbol.for("yaml.node.type"),As=e=>!!e&&typeof e=="object"&&e[zr]===Gp,Jo=e=>!!e&&typeof e=="object"&&e[zr]===gC,Jp=e=>!!e&&typeof e=="object"&&e[zr]===dn,St=e=>!!e&&typeof e=="object"&&e[zr]===My,wt=e=>!!e&&typeof e=="object"&&e[zr]===Wp,Jc=e=>!!e&&typeof e=="object"&&e[zr]===Wo;function Yt(e){if(e&&typeof e=="object")switch(e[zr]){case dn:case Wo:return!0}return!1}function yt(e){if(e&&typeof e=="object")switch(e[zr]){case Gp:case dn:case Wp:case Wo:return!0}return!1}var Ly=e=>(wt(e)||Yt(e))&&!!e.anchor,Jt=Symbol("break visit"),$y=Symbol("skip children"),$r=Symbol("remove node");function Ko(e,t){const r=Ny(t);Jo(e)?Jn(null,e.contents,r,Object.freeze([e]))===$r&&(e.contents=null):Jn(null,e,r,Object.freeze([]))}Ko.BREAK=Jt;Ko.SKIP=$y;Ko.REMOVE=$r;function Jn(e,t,r,i){const n=Dy(e,t,r,i);if(yt(n)||St(n))return Uy(e,i,n),Jn(e,n,r,i);if(typeof n!="symbol"){if(Yt(t)){i=Object.freeze(i.concat(t));for(let s=0;s<t.items.length;++s){const o=Jn(s,t.items[s],r,i);if(typeof o=="number")s=o-1;else{if(o===Jt)return Jt;o===$r&&(t.items.splice(s,1),s-=1)}}}else if(St(t)){i=Object.freeze(i.concat(t));const s=Jn("key",t.key,r,i);if(s===Jt)return Jt;s===$r&&(t.key=null);const o=Jn("value",t.value,r,i);if(o===Jt)return Jt;o===$r&&(t.value=null)}}return n}async function Kp(e,t){const r=Ny(t);Jo(e)?await Kn(null,e.contents,r,Object.freeze([e]))===$r&&(e.contents=null):await Kn(null,e,r,Object.freeze([]))}Kp.BREAK=Jt;Kp.SKIP=$y;Kp.REMOVE=$r;async function Kn(e,t,r,i){const n=await Dy(e,t,r,i);if(yt(n)||St(n))return Uy(e,i,n),Kn(e,n,r,i);if(typeof n!="symbol"){if(Yt(t)){i=Object.freeze(i.concat(t));for(let s=0;s<t.items.length;++s){const o=await Kn(s,t.items[s],r,i);if(typeof o=="number")s=o-1;else{if(o===Jt)return Jt;o===$r&&(t.items.splice(s,1),s-=1)}}}else if(St(t)){i=Object.freeze(i.concat(t));const s=await Kn("key",t.key,r,i);if(s===Jt)return Jt;s===$r&&(t.key=null);const o=await Kn("value",t.value,r,i);if(o===Jt)return Jt;o===$r&&(t.value=null)}}return n}function Ny(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function Dy(e,t,r,i){if(typeof r=="function")return r(e,t,i);if(Jp(t))return r.Map?.(e,t,i);if(Jc(t))return r.Seq?.(e,t,i);if(St(t))return r.Pair?.(e,t,i);if(wt(t))return r.Scalar?.(e,t,i);if(As(t))return r.Alias?.(e,t,i)}function Uy(e,t,r){const i=t[t.length-1];if(Yt(i))i.items[e]=r;else if(St(i))e==="key"?i.key=r:i.value=r;else if(Jo(i))i.contents=r;else{const n=As(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${n} parent`)}}var vC={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},_C=e=>e.replace(/[!,[\]{}]/g,t=>vC[t]),qy=class Wr{constructor(t,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Wr.defaultYaml,t),this.tags=Object.assign({},Wr.defaultTags,r)}clone(){const t=new Wr(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Wr(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Wr.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Wr.defaultTags)}return t}add(t,r){this.atNextDocument&&(this.yaml={explicit:Wr.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Wr.defaultTags),this.atNextDocument=!1);const i=t.trim().split(/[ \t]+/),n=i.shift();switch(n){case"%TAG":{if(i.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;const[s,o]=i;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;const[s]=i;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{const o=/^\d+\.\d+$/.test(s);return r(6,`Unsupported YAML version ${s}`,o),!1}}default:return r(0,`Unknown directive ${n}`,!0),!1}}tagName(t,r){if(t==="!")return"!";if(t[0]!=="!")return r(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const o=t.slice(2,-1);return o==="!"||o==="!!"?(r(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&r("Verbatim tags must end with a >"),o)}const[,i,n]=t.match(/^(.*!)([^!]*)$/s);n||r(`The ${t} tag has no suffix`);const s=this.tags[i];if(s)try{return s+decodeURIComponent(n)}catch(o){return r(String(o)),null}return i==="!"?t:(r(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[r,i]of Object.entries(this.tags))if(t.startsWith(i))return r+_C(t.substring(i.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags);let n;if(t&&i.length>0&&yt(t.contents)){const s={};Ko(t.contents,(o,a)=>{yt(a)&&a.tag&&(s[a.tag]=!0)}),n=Object.keys(s)}else n=[];for(const[s,o]of i)s==="!!"&&o==="tag:yaml.org,2002:"||(!t||n.some(a=>a.startsWith(o)))&&r.push(`%TAG ${s} ${o}`);return r.join(`
2
2
  `)}};qy.defaultYaml={explicit:!1,version:"1.2"};qy.defaultTags={"!!":"tag:yaml.org,2002:"};function jy(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(t)}return!0}function so(e,t,r,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let n=0,s=i.length;n<s;++n){const o=i[n],a=so(e,i,String(n),o);a===void 0?delete i[n]:a!==o&&(i[n]=a)}else if(i instanceof Map)for(const n of Array.from(i.keys())){const s=i.get(n),o=so(e,i,n,s);o===void 0?i.delete(n):o!==s&&i.set(n,o)}else if(i instanceof Set)for(const n of Array.from(i)){const s=so(e,i,n,n);s===void 0?i.delete(n):s!==n&&(i.delete(n),i.add(s))}else for(const[n,s]of Object.entries(i)){const o=so(e,i,n,s);o===void 0?delete i[n]:o!==s&&(i[n]=o)}return e.call(t,r,i)}function wr(e,t,r){if(Array.isArray(e))return e.map((i,n)=>wr(i,String(n),r));if(e&&typeof e.toJSON=="function"){if(!r||!Ly(e))return e.toJSON(t,r);const i={aliasCount:0,count:1,res:void 0};r.anchors.set(e,i),r.onCreate=s=>{i.res=s,delete r.onCreate};const n=e.toJSON(t,r);return r.onCreate&&r.onCreate(n),n}return typeof e=="bigint"&&!r?.keep?Number(e):e}var Yp=class{constructor(e){Object.defineProperty(this,zr,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:r,onAnchor:i,reviver:n}={}){if(!Jo(e))throw new TypeError("A document argument is required");const s={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},o=wr(this,"",s);if(typeof i=="function")for(const{count:a,res:c}of s.anchors.values())i(c,a);return typeof n=="function"?so(n,{"":o},"",o):o}},yC=class extends Yp{constructor(e){super(Gp),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){if(t?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let r;t?.aliasResolveCache?r=t.aliasResolveCache:(r=[],Ko(e,{Node:(n,s)=>{(As(s)||Ly(s))&&r.push(s)}}),t&&(t.aliasResolveCache=r));let i;for(const n of r){if(n===this)break;n.anchor===this.source&&(i=n)}if(i&&t){const{anchors:n,doc:s,maxAliasCount:o}=t;let a=n.get(i);if(a||(wr(i,null,t),a=n.get(i)),a?.res===void 0)throw new ReferenceError("This should not happen: Alias anchor was not resolved?");if(o>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=za(s,i,n)),a.count*a.aliasCount>o))throw new ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return i}toJSON(e,t){if(!t)return{source:this.source};const r=this.resolve(t.doc,t);if(!r){const i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(i)}return t.anchors.get(r).res}toString(e,t,r){const i=`*${this.source}`;if(e){if(jy(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const n=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(n)}if(e.implicitKey)return`${i} `}return i}};function za(e,t,r){if(As(t)){const i=t.resolve(e),n=r&&i&&r.get(i);return n?n.count*n.aliasCount:0}else if(Yt(t)){let i=0;for(const n of t.items){const s=za(e,n,r);s>i&&(i=s)}return i}else if(St(t)){const i=za(e,t.key,r),n=za(e,t.value,r);return Math.max(i,n)}return 1}var zy=e=>!e||typeof e!="function"&&typeof e!="object",at=class extends Yp{constructor(e){super(Wp),this.value=e}toJSON(e,t){return t?.keep?this.value:wr(this.value,e,t)}toString(){return String(this.value)}};at.BLOCK_FOLDED="BLOCK_FOLDED";at.BLOCK_LITERAL="BLOCK_LITERAL";at.PLAIN="PLAIN";at.QUOTE_DOUBLE="QUOTE_DOUBLE";at.QUOTE_SINGLE="QUOTE_SINGLE";var bC="tag:yaml.org,2002:";function SC(e,t,r){if(t){const i=r.filter(s=>s.tag===t),n=i.find(s=>!s.format)??i[0];if(!n)throw new Error(`Tag ${t} not found`);return n}return r.find(i=>i.identify?.(e)&&!i.format)}function cc(e,t,r){if(Jo(e)&&(e=e.contents),yt(e))return e;if(St(e)){const p=r.schema[dn].createNode?.(r.schema,null,r);return p.items.push(e),p}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:i,onAnchor:n,onTagObj:s,schema:o,sourceObjects:a}=r;let c;if(i&&e&&typeof e=="object"){if(c=a.get(e),c)return c.anchor??(c.anchor=n(e)),new yC(c.anchor);c={anchor:null,node:null},a.set(e,c)}t?.startsWith("!!")&&(t=bC+t.slice(2));let l=SC(e,t,o.tags);if(!l){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const p=new at(e);return c&&(c.node=p),p}l=e instanceof Map?o[dn]:Symbol.iterator in Object(e)?o[Wo]:o[dn]}s&&(s(l),delete r.onTagObj);const u=l?.createNode?l.createNode(r.schema,e,r):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(r.schema,e,r):new at(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function bm(e,t,r){let i=r;for(let n=t.length-1;n>=0;--n){const s=t[n];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){const o=[];o[s]=i,i=o}else i=new Map([[s,i]])}return cc(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}var wC=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done,Fy=class extends Yp{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(r=>yt(r)||St(r)?r.clone(e):r),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(wC(e))this.add(t);else{const[r,...i]=e,n=this.get(r,!0);if(Yt(n))n.addIn(i,t);else if(n===void 0&&this.schema)this.set(r,bm(this.schema,i,t));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(e){const[t,...r]=e;if(r.length===0)return this.delete(t);const i=this.get(t,!0);if(Yt(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${r}`)}getIn(e,t){const[r,...i]=e,n=this.get(r,!0);return i.length===0?!t&&wt(n)?n.value:n:Yt(n)?n.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!St(t))return!1;const r=t.value;return r==null||e&&wt(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){const[t,...r]=e;if(r.length===0)return this.has(t);const i=this.get(t,!0);return Yt(i)?i.hasIn(r):!1}setIn(e,t){const[r,...i]=e;if(i.length===0)this.set(r,t);else{const n=this.get(r,!0);if(Yt(n))n.setIn(i,t);else if(n===void 0&&this.schema)this.set(r,bm(this.schema,i,t));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}},EC=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function xo(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var Yn=(e,t,r)=>e.endsWith(`
3
3
  `)?xo(r,t):r.includes(`
4
4
  `)?`
@@ -59,7 +59,7 @@ Include resource parameter`,description:"Client generates code verifier and chal
59
59
  ${i.join(`
60
60
  `)}`}return r}function Hw(e=500){const t=new Set;return(r,i)=>{if(!r||!i)return!1;const n=`${r}:${i}`;return t.has(n)?!0:(t.add(n),t.size>e&&t.delete(t.values().next().value),!1)}}function W4(e=500){const t=Hw(e);return(r,i={})=>{try{if(r.tags?.source==="convex_auth_refusal")return{type:r.type,event_id:r.event_id,timestamp:r.timestamp,platform:r.platform,release:r.release,dist:r.dist,environment:r.environment,message:"Convex auth refusal diagnostic",level:"info",tags:{source:"convex_auth_refusal",auth_refusal_id:r.tags.auth_refusal_id,request_id:r.tags.request_id,convex_backend:r.tags.convex_backend},contexts:{auth_refusal:r.contexts?.auth_refusal}};const n=r.exception?.values,s=n?.find(u=>go(u.value??"")),o=go(s?.value??"");if(!o)return r;if(hf(i.originalException)||ff(i.originalException)||mf(i.originalException))return null;const a=Fw(s.value),c=typeof r.tags?.convex_backend=="string"?r.tags.convex_backend:a.convex_backend;if(t(c,o.requestId))return null;s.value=o.safeMessage,r.message&&(r.message=o.safeMessage),r.tags={...r.tags,...a,...c?{convex_backend:c}:{}};const l=Yd((typeof r.extra?.page_location=="string"?r.extra.page_location:void 0)??r.request?.url??(typeof window<"u"?window.location.href:""));r.request=l?{url:l}:void 0,r.breadcrumbs=void 0,r.extra={...typeof r.extra?.boundary=="string"?{boundary:r.extra.boundary}:{},...typeof r.extra?.componentStack=="string"?{componentStack:r.extra.componentStack}:{},...l?{page_location:l}:{}};for(const u of n??[])if(u!==s&&u.value&&(u.value=go(u.value)?.safeMessage??"Query failure cause"),u.stacktrace)for(const p of u.stacktrace.frames??[])delete p.vars;return r.transaction?.includes("/")&&(r.transaction=Yd(`https://route.invalid${r.transaction}`)?.replace("https://route.invalid","")),r}catch{return null}}}var vf=F_(hA(),1);function Qg(e){if(typeof e!="string"||e.trim().length===0)return null;try{const t=new URL(e.trim());return t.protocol!=="http:"&&t.protocol!=="https:"?null:t.origin}catch{return null}}function Tn(){if(typeof window>"u")return null;const e=window.__MCP_RUNTIME_CONFIG__;return!e||typeof e!="object"?null:e}function ia(e){return typeof e=="string"&&e.trim()?e:void 0}function J4(){return ia(Tn()?.convexUrl)}function K4(){return ia(Tn()?.convexSiteUrl)}function Y4(){return ia(Tn()?.workosClientId)}function X4(){return ia(Tn()?.workosApiHostname)}function ej(){return ia(Tn()?.sandboxOrigin)}function _f(){return Tn()?.doNotTrack===!0}function Z4(){return Tn()?.platformAgentDisabled!==!0}var Q4=Qg(ej())??Qg(void 0),e5="write",ev=null,tj=String(101376);function t5(){return ev?`https://discord.com/oauth2/authorize?${new URLSearchParams({client_id:ev,scope:"bot applications.commands",permissions:tj}).toString()}`:null}var Ta="mcpjam.project-transition.v1",r5=18e5;function Ca(e){if(!e||typeof e!="object")return!1;const t=e;return typeof t.sourceActor=="string"&&/^(guest|workos):.{1,200}$/.test(t.sourceActor)&&typeof t.path=="string"&&tA(t.path)&&typeof t.requestedProjectId=="string"&&cA(t.requestedProjectId)&&X_(t.path)===t.requestedProjectId&&typeof t.attempt=="string"&&/^[a-zA-Z0-9-]{1,80}$/.test(t.attempt)&&Number.isFinite(t.storedAt)&&t.storedAt<=Date.now()+1e3&&Date.now()-t.storedAt<18e5}function rj(e=()=>sessionStorage){let t=null;try{const o=JSON.parse(e().getItem(Ta)??"null");Ca(o)?t=o:e().removeItem(Ta)}catch{}const r=qp(()=>({marker:t}));let i=null;const n=o=>{if(!(o&&r.getState().marker?.attempt!==o)){r.setState({marker:null});try{e().removeItem(Ta)}catch{}}},s=(o,a=$d())=>{if(!i||i.path!==o)return;const c=r.getState().marker;if(c?.path===o&&Ca(c))return;const l={path:o,requestedProjectId:X_(o),attempt:a,storedAt:Date.now(),sourceActor:i.actor};if(Ca(l)){i=null;try{e().setItem(Ta,JSON.stringify(l))}catch{}r.setState({marker:l})}};return{store:r,clear:n,arm:s,isValid:Ca,remember(o,a){i={path:o,actor:a}},observeActor(o,a){i&&i.actor!==o&&(o.startsWith("workos:")&&s(a),i=null)}}}var ij=rj();function nj(){return window.location.pathname+window.location.search+window.location.hash}var ys="mcpjam.guest-transition.v1",tv=`${ys}.reloaded`,rv=`${ys}.handled`,vu=15e3,yc=6e4;function sj(e){if(!e||typeof e!="object")return null;const t=e;return typeof t.guestId!="string"||!t.guestId||t.guestId.length>200||typeof t.attempt!="string"||!/^[a-zA-Z0-9-]{1,80}$/.test(t.attempt)||!Number.isFinite(t.startedAt)||t.startedAt>Date.now()+1e3||Date.now()-t.startedAt>yc||!["started","completed","failed"].includes(t.phase)?null:{guestId:t.guestId,attempt:t.attempt,startedAt:t.startedAt,phase:t.phase}}function oj(e){const t=qp(()=>({status:"idle",attempt:null})),r=new Map;try{const d=JSON.parse(sessionStorage.getItem(rv)??"[]");if(Array.isArray(d))for(const h of d)Array.isArray(h)&&typeof h[0]=="string"&&/^[a-zA-Z0-9-]{1,80}$/.test(h[0])&&Number.isFinite(h[1])&&h[1]<=Date.now()+1e3&&Date.now()-h[1]<=yc&&r.set(h[0],h[1])}catch{}const i=d=>{for(const[h,f]of r)Date.now()-f>yc&&r.delete(h);r.set(d.attempt,d.startedAt);try{sessionStorage.setItem(rv,JSON.stringify([...r]))}catch{}};let n=null,s=null,o;const a=new Map,c=()=>{clearTimeout(o),s=null,t.setState({status:"idle",attempt:null})},l=()=>{clearTimeout(o),t.setState({status:"failed"})},u=d=>{if(d&&!e.allowAutomaticReload()){l();return}t.setState({status:"waiting"}),clearTimeout(o),o=setTimeout(l,vu);try{e.reload()}catch{l()}},p=d=>{const h=sj(d);!h||!n||h.guestId!==n||r.has(h.attempt)||s&&(h.startedAt<s.startedAt||h.startedAt===s.startedAt&&h.attempt!==s.attempt)||s?.attempt===h.attempt&&s.phase!=="started"||(e.beforeTransition?.(h),s=h,clearTimeout(o),t.setState({status:"waiting",attempt:h.attempt}),h.phase==="failed"?(l(),i(h)):h.phase==="completed"?(i(h),u(!0)):o=setTimeout(()=>{l(),i(h)},Math.max(0,vu-(Date.now()-h.startedAt))))};return{store:t,setGuest(d,h=!0){if(d!==n){n=d;const f=t.getState().status!=="idle";clearTimeout(o),s=null,f&&!h?(t.setState({status:"waiting",attempt:null}),o=setTimeout(l,vu)):c()}else!s&&h&&t.getState().status!=="idle"&&c()},getGuest:()=>n,receive:p,begin(d){let h=a.get(d);if(!h){h={message:{guestId:d,attempt:$d(),startedAt:Date.now(),phase:"started"},count:0,failed:!1},a.set(d,h);try{e.publish(h.message)}catch{}}h.count++;let f=!1;return m=>{if(!f&&(f=!0,h.failed||=!m,!--h.count)){a.delete(d);try{e.publish({...h.message,phase:h.failed?"failed":"completed"})}catch{}}}},revoked(d){return d&&d!==n?!0:n?(t.getState().status!=="idle"||p({guestId:n,attempt:$d(),startedAt:Date.now(),phase:"completed"}),!0):!1},retry:()=>u(!1),dispose:c}}var ao,Pi=oj({beforeTransition:e=>ij.arm(nj(),e.attempt),publish(e){try{ao?.postMessage(e)}catch{}try{localStorage.setItem(ys,JSON.stringify(e))}catch{}},reload:()=>{const e=Pi.getGuest();queueMicrotask(()=>{Pi.getGuest()===e&&window.location.reload()})},allowAutomaticReload(){try{const e=Number(sessionStorage.getItem(tv));return e&&Date.now()-e<yc?!1:(sessionStorage.setItem(tv,String(Date.now())),!0)}catch{return!1}}});function i5(){try{ao=new BroadcastChannel(ys),ao.onmessage=r=>(0,vf.flushSync)(()=>Pi.receive(r.data))}catch{}const e=aj,t=r=>{r.key===ys&&e()};return window.addEventListener("storage",t),window.addEventListener("pageshow",e),window.addEventListener("focus",e),document.addEventListener("visibilitychange",e),e(),()=>{ao?.close(),ao=void 0,window.removeEventListener("storage",t),window.removeEventListener("pageshow",e),window.removeEventListener("focus",e),document.removeEventListener("visibilitychange",e)}}function n5(e){const t=Pi.getGuest();return e&&e!==t?!0:t?(queueMicrotask(()=>{Pi.getGuest()===t&&(0,vf.flushSync)(()=>Pi.revoked(t))}),!0):!1}function aj(){queueMicrotask(()=>{try{(0,vf.flushSync)(()=>Pi.receive(JSON.parse(localStorage.getItem(ys)??"null")))}catch{}})}var cj=["timeout","network","upstream_status","bad_json","bad_payload","configuration"];var lj=["guest_session/exhausted","guest_session/unreachable","guest_session/bad_response","guest_session/http_4xx","guest_session/http_5xx","guest_session/timeout","guest_session/network","guest_session/upstream_status","guest_session/bad_json","guest_session/bad_payload","guest_session/configuration","guest_session/network/SELF_SIGNED_CERT_IN_CHAIN","guest_session/network/UNABLE_TO_GET_ISSUER_CERT_LOCALLY","guest_session/network/UNABLE_TO_VERIFY_LEAF_SIGNATURE","guest_session/network/DEPTH_ZERO_SELF_SIGNED_CERT","guest_session/network/CERT_HAS_EXPIRED","guest_session/network/ERR_TLS_CERT_ALTNAME_INVALID","guest_session/network/ECONNREFUSED","guest_session/network/ECONNRESET","guest_session/network/ENOTFOUND","guest_session/network/EAI_AGAIN","guest_session/network/ETIMEDOUT","guest_session/network/EHOSTUNREACH","guest_session/network/ENETUNREACH","guest_session/network/UND_ERR_CONNECT_TIMEOUT","guest_session/network/UND_ERR_SOCKET"];function uj(e){return lj.includes(e)}function s5(e){if(!e)return"guest_session/exhausted";const{httpStatus:t,details:r}=e;if(r){const i=`guest_session/network/${r.networkCode}`;return r.reason==="network"&&uj(i)?i:`guest_session/${r.reason}`}return t===void 0?"guest_session/unreachable":t<400?"guest_session/bad_response":t<500?"guest_session/http_4xx":"guest_session/http_5xx"}var dj=/^[A-Z][A-Z0-9_]{1,63}$/;function pj(e){return typeof e=="string"&&cj.includes(e)}function hj(e){if(!e||typeof e!="object")return;const{reason:t,upstreamStatus:r,networkCode:i}=e;if(!pj(t))return;const n={reason:t};return typeof r=="number"&&Number.isInteger(r)&&r>=100&&r<=599&&(n.upstreamStatus=r),typeof i=="string"&&dj.test(i)&&(n.networkCode=i),n}var Bw="mcpjam_guest_session_v1",Xd="mcpjam_guest_activated",Ml=3e5,Lt=null,gi=null,vi=null,Zi=null,Vw=!1,Oi=0,Zd=new Set,Qd=6e5,Qn=null,Ws=null;function Gw(){for(const e of Zd)e()}function yf(e){Ws!==null&&(clearTimeout(Ws),Ws=null),Qn=e,e&&(Ws=setTimeout(()=>{Ws=null,Qn===e&&yf(null)},Math.max(0,e.until-Date.now()))),Gw()}function Ww(){return Qn&&Qn.until<=Date.now()&&(Qn=null),Qn}function Ll(e){const t=Lt?.guestId??null,r=Lt?.token??null;Lt=e,(t!==(Lt?.guestId??null)||r!==(e?.token??null))&&Gw()}function o5(e){return Zd.add(e),()=>{Zd.delete(e)}}function a5(e){if(e)try{localStorage.getItem(Xd)!==e&&localStorage.setItem(Xd,e)}catch{}}function c5(e){if(!e)return!1;try{return localStorage.getItem(Xd)===e}catch{return!1}}function fj(){if(typeof window>"u")return;const e=window.__MCP_GUEST_BOOTSTRAP__;try{delete window.__MCP_GUEST_BOOTSTRAP__}catch{window.__MCP_GUEST_BOOTSTRAP__=void 0}e&&(typeof e.token!="string"||e.token.length===0||typeof e.expiresAt!="number"||typeof e.guestId!="string"||e.guestId.length===0||e.expiresAt-Ml<=Date.now()||(Lt={guestId:e.guestId,token:e.token,expiresAt:e.expiresAt}))}fj();function bf(){if(Vw)return null;try{const e=localStorage.getItem(Bw);if(!e)return null;const t=JSON.parse(e);return typeof t.token=="string"&&t.token.length>0?t.token:null}catch{return null}}function iv(){try{localStorage.removeItem(Bw)}catch{}Vw=!0}var co=class extends Error{status;upstreamFailure;constructor(e,t,r,i){super(e,i===void 0?void 0:{cause:i}),this.name="GuestSessionRequestError",this.status=t,this.upstreamFailure=r}},vo=class extends co{retryAfterMs;reason;constructor(e,t){super("Couldn't start a guest session. Sign in to continue."),this.name="GuestSessionRefusedError",this.retryAfterMs=e,this.reason=t}},mj=1e3;async function gj(e){if(typeof e.json!="function")return;let t;try{const r=await Promise.race([e.json(),new Promise(i=>{t=setTimeout(()=>i(void 0),mj)})]);return r&&typeof r=="object"?r:void 0}catch{return}finally{t!==void 0&&clearTimeout(t)}}function vj(e){if(!e)return"";const t=e.networkCode??(e.upstreamStatus!==void 0?String(e.upstreamStatus):void 0);return` (${e.reason}${t?` ${t}`:""})`}function _j(e){const t=e?Number.parseInt(e,10):NaN;return Number.isFinite(t)&&t>0?t*1e3:Qd}async function Sf(e,t){const r={mode:e};t&&(r.legacyToken=t);let i;try{i=await fetch("/api/web/guest-session",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)})}catch(s){throw new co(s instanceof Error?s.message:"network error",void 0,void 0,s)}if(i.status===204)return t&&iv(),null;if(i.status===429)throw new vo(_j(i.headers?.get?.("retry-after")),"rate_limited");if(i.status===403&&i.headers?.get?.("x-mcpjam-guest-refusal")==="GUEST_ACCESS_DISABLED")throw new vo(Qd,"guest_access_disabled");if(!i.ok){const s=await gj(i);if(i.status===403&&s?.code==="GUEST_ACCESS_DISABLED")throw new vo(Qd,"guest_access_disabled");const o=hj(s?.details);throw new co(`guest-session request failed: ${i.status} ${i.statusText}${vj(o)}`,i.status,o)}let n;try{n=await i.json()}catch(s){throw new co(`guest-session response was not valid JSON: ${s instanceof Error?s.message:String(s)}`,i.status)}if(typeof n?.token!="string"||typeof n?.expiresAt!="number")throw new co("guest-session response missing token or expiresAt",i.status);return t&&iv(),n}async function yj(){if(Lt&&Lt.expiresAt-Ml>Date.now())return Lt;if(Ww())return null;if(gi)return gi;const e=bf(),t=Oi;let r=Promise.resolve(null);return r=(async()=>{try{const i=await Sf("lookup_or_create",e);return i&&t===Oi&&Ll(i),i}catch(i){if(i instanceof vo)return yf({until:Date.now()+i.retryAfterMs,reason:i.reason}),null;throw console.error("Failed to create guest session:",i),i}finally{gi===r&&(gi=null)}})(),gi=r,r.catch(()=>{}),gi}async function bj(){try{return await yj()}catch{return null}}async function l5(){return(await bj())?.token??null}function ep(){return Lt&&Lt.expiresAt-Ml>Date.now()?Lt:null}async function Sj(){if(Lt&&Lt.expiresAt-Ml>Date.now())return Lt.token;if(vi)return(await vi)?.token??null;const e=bf(),t=Oi;let r=Promise.resolve(null);return r=(async()=>{try{const i=await Sf("lookup_only",e);return i&&t===Oi&&Ll(i),i}finally{vi===r&&(vi=null)}})(),vi=r,(await vi)?.token??null}async function u5(){const e=ep();if(e?.guestId)return e.guestId;try{await Sj()}catch{return null}return ep()?.guestId??null}function wj(){Oi+=1,Ll(null),gi=null,vi=null,Zi=null}async function d5(){const e=Lt?.guestId,t=e?Pi.begin(e):void 0;let r=!1,i=!1;try{const n=await fetch("/api/web/guest-session/revoke",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}});if(n.ok){i=!0;try{r=(await n.json())?.revoked===!0}catch{r=!1}}}catch(n){console.error("Failed to revoke guest session:",n)}finally{wj(),t?.(i)}return r}async function p5(){try{const e=await fetch("/api/web/guest-session/promotion-proof",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}});if(e.status===204||!e.ok)return null;const t=await e.json();return typeof t.token=="string"&&t.token.length>0?t.token:null}catch(e){return console.error("Failed to fetch guest promotion proof:",e),null}}async function Ej(){if(Zi)return(await Zi)?.token??null;if(Ww())return null;Oi+=1;const e=Oi;Lt=null,gi=null,vi=null,Zi=(async()=>{try{const t=await Sf("lookup_or_create",bf());return t&&e===Oi&&Ll(t),t}catch(t){if(t instanceof vo)return yf({until:Date.now()+t.retryAfterMs,reason:t.reason}),null;throw console.error("Failed to refresh guest session:",t),t}})(),Zi.catch(()=>{});try{return(await Zi)?.token??null}finally{Zi=null}}async function h5(){try{return await Ej()}catch{return null}}var M="u">typeof window?window:void 0,$t="u">typeof globalThis?globalThis:M,vt=$t?.navigator,G=$t?.document,Ze=$t?.location,Do=$t?.fetch,wf=$t?.XMLHttpRequest&&"withCredentials"in new $t.XMLHttpRequest?$t.XMLHttpRequest:void 0,nv=$t?.AbortController,kj=$t?.CompressionStream,qt=vt?.userAgent;function Jw(){return!(!M||M.navigator.onLine===!1)}var Js=typeof globalThis<"u"?globalThis:M;Js&&typeof self>"u"&&(Js.self=Js),Js&&typeof File>"u"&&(Js.File=function(){});var he=M??{},sv="0.9.0",ei={DEBUG:!1,LIB_VERSION:sv,LIB_NAME:"browser-common",JS_SDK_VERSION:sv},Pr=(function(e){return e.AnonymousId="anonymous_id",e.DistinctId="distinct_id",e.Props="props",e.EnablePersonProcessing="enable_person_processing",e.PersonMode="person_mode",e.FeatureFlagDetails="feature_flag_details",e.FeatureFlags="feature_flags",e.FeatureFlagPayloads="feature_flag_payloads",e.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",e.BootstrapFeatureFlags="bootstrap_feature_flags",e.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",e.OverrideFeatureFlags="override_feature_flags",e.Queue="queue",e.AiQueue="ai_queue",e.AiCaptureQueue="ai_capture_queue",e.LogsQueue="logs_queue",e.OptedOut="opted_out",e.SessionId="session_id",e.SessionStartTimestamp="session_start_timestamp",e.SessionLastTimestamp="session_timestamp",e.PersonProperties="person_properties",e.GroupProperties="group_properties",e.InstalledAppBuild="installed_app_build",e.InstalledAppVersion="installed_app_version",e.SessionReplay="session_replay",e.PushRegistered="push_registered",e.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",e.SurveyLastSeenDate="survey_last_seen_date",e.SurveysInProgress="surveys_in_progress",e.SurveysSeen="surveys_seen",e.Surveys="surveys",e.RemoteConfig="remote_config",e.FlagsEndpointWasHit="flags_endpoint_was_hit",e.DeviceId="device_id",e})({}),tp=(function(e){return e.GZipJS="gzip-js",e.Base64="base64",e})({}),Ij=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],Aj=["token"];function ve(e,t){return e.indexOf(t)!==-1}var $l=function(e){return e.trim()},rp=function(e){return e.replace(/^\$/,"")};function Kw(e){var t;const r=[];return(t=JSON.stringify(e,function(i,n){if(typeof n=="bigint")return n.toString();if(typeof n!="function"&&typeof n!="symbol"){if(n instanceof Error)return{name:n.name,message:n.message,stack:n.stack};if(n&&typeof n=="object"){for(;r.length>0&&r[r.length-1]!==this;)r.pop();if(r.includes(n))return"[Circular]";r.push(n)}return n}}))!==null&&t!==void 0?t:"null"}var Yw=Object.prototype,Ef=Yw.hasOwnProperty,Nl=Yw.toString,_e=Array.isArray||function(e){return Nl.call(e)==="[object Array]"},gt=e=>typeof e=="function",Pe=e=>e===Object(e)&&!_e(e),Kt=e=>{if(Pe(e)){for(const t in e)if(Ef.call(e,t))return!1;return!0}return!1},z=e=>e===void 0,Ae=e=>Nl.call(e)=="[object String]",_o=e=>Ae(e)&&e.trim().length===0,Qe=e=>e===null,we=e=>z(e)||Qe(e),nt=e=>Nl.call(e)=="[object Number]"&&e==e,Kr=e=>nt(e)&&e>0,Ft=e=>Nl.call(e)==="[object Boolean]",Rj=e=>ve(Ij,e),Tj=e=>ve(Aj,e);function Xw(e){return e===null||typeof e!="object"}function bc(e,t){return{}.toString.call(e)===`[object ${t}]`}function Ns(e){switch({}.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return Zw(e,Error)}}function kf(e){return"u">typeof Event&&Zw(e,Event)}function Zw(e,t){try{return e instanceof t}catch{return!1}}var Cj=[!0,"true",1,"1","yes"],_u=e=>ve(Cj,e),Pj=[!1,"false",0,"0","no"];function ov(e,t,r,i,n,s,o){try{var a=e[s](o),c=a.value}catch(l){r(l);return}a.done?t(c):Promise.resolve(c).then(i,n)}function We(e){return function(){var t=this,r=arguments;return new Promise(function(i,n){var s=e.apply(t,r);function o(c){ov(s,i,n,o,a,"next",c)}function a(c){ov(s,i,n,o,a,"throw",c)}o(void 0)})}}var Oj=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterestbot","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],av=function(e,t=[]){if(!e)return!1;const r=e.toLowerCase();return Oj.concat(t).some(i=>{const n=i.toLowerCase();return r.indexOf(n)!==-1})};function Lr(e,t,r,i,n){return t>r&&(i.warn("min cannot be greater than max."),t=r),nt(e)?e>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):t>e?(i.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),Lr(n??r,t,r,i))}var xj=class{constructor(e){this.C={},this.I=e.I,this.R=Lr(e.bucketSize,0,100,e.A),this.$=Lr(e.refillRate,0,this.R,e.A),this.O=Lr(e.refillInterval,0,864e5,e.A)}F(e,t){const r=Math.floor((t-e.lastAccess)/this.O);r>0&&(e.tokens=Math.min(e.tokens+r*this.$,this.R),e.lastAccess=e.lastAccess+r*this.O)}consumeRateLimit(e){var t;const r=Date.now(),i=String(e);let n=this.C[i];return n?this.F(n,r):(n={tokens:this.R,lastAccess:r},this.C[i]=n),n.tokens===0||(n.tokens--,n.tokens===0&&((t=this.I)===null||t===void 0||t.call(this,e)),n.tokens===0)}stop(){this.C={}}},bs="Mobile",Uo="Android",Sc="Tablet",Qw="Android Tablet",eE="iPad",tE="Apple Watch",Xa="Safari",Dl="BlackBerry",rE="Samsung Internet",Za="Chrome",iE="Chrome iOS",nE="Internet Explorer",sE="Internet Explorer Mobile",oE="Opera",aE="Microsoft Edge",Qa="Firefox",cE="Firefox iOS",wc="Nintendo",Ec="PlayStation",Ul="Xbox",lE="Android Mobile",uE="Mobile Safari",yu="Windows",dE="Windows Phone",cv="Nokia",ip="Ouya",Mj="Generic "+bs.toLowerCase(),pE="Generic "+Sc.toLowerCase(),np="Konqueror",hE="Oculus Browser",fE="Vivaldi",mE="Yandex",gE="Whale",vE="DuckDuckGo",_E="Pale Moon",yE="Waterfox",sp="Brave",bE="Claude",SE="Codex",wE="ChatGPT",EE="Google Search App",bu=new RegExp("Version/(\\d+(\\.\\d+)?)"),Su=new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),Lj=new RegExp(Ul,"i"),$j=new RegExp("PlayStation \\w+","i"),Nj=new RegExp("Nintendo \\w+","i"),If=new RegExp("BlackBerry|PlayBook|BB10","i"),Dj={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},kE=function(e,t,r,i){return t=t||"",(function(n){return n?.brave?sp:null})(r)||(i?.detectGoogleSearchApp&&ve(e,"GSA/")?EE:ve(e," OPR/")&&ve(e,"Mini")?"Opera Mini":ve(e," OPR/")?oE:If.test(e)?Dl:ve(e,"IEMobile")||ve(e,"WPDesktop")?sE:ve(e,"OculusBrowser")?hE:ve(e,"SamsungBrowser")?rE:ve(e,"Edge")||ve(e,"Edg/")?aE:ve(e,"Vivaldi/")?fE:ve(e,"YaBrowser/")?mE:ve(e,"Whale/")?gE:ve(e,"DuckDuckGo/")||ve(e,"Ddg/")?vE:ve(e,"Claude/")?bE:ve(e,"Codex/")?SE:ve(e,"ChatGPT/")?wE:ve(e,"FBIOS")?"Facebook Mobile":ve(e,"UCWEB")||ve(e,"UCBrowser")?"UC Browser":ve(e,"CriOS")?iE:ve(e,"CrMo")||ve(e,Za)?Za:ve(e,Uo)&&ve(e,Xa)?lE:ve(e,"FxiOS")?cE:ve(e.toLowerCase(),np.toLowerCase())?np:ve(e,"Brave/")?sp:((n,s)=>s&&ve(s,"Apple")||(function(o){return ve(o,Xa)&&!ve(o,Za)&&!ve(o,Uo)})(n))(e,t)?ve(e,bs)?uE:Xa:ve(e,"PaleMoon/")?_E:ve(e,"Waterfox/")?yE:ve(e,Qa)?Qa:ve(e,"MSIE")||ve(e,"Trident/")?nE:ve(e,"Gecko")?Qa:"")},Uj={[sE]:[new RegExp("rv:(\\d+(\\.\\d+)?)")],[aE]:[new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[Za]:[new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[iE]:[new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[Xa]:[bu],[uE]:[bu],[oE]:[new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[Qa]:[new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[cE]:[new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[np]:[new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[Dl]:[new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),bu],[lE]:[new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[rE]:[new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[hE]:[new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[fE]:[new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[mE]:[new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[gE]:[new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[sp]:[new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[bE]:[Su],[SE]:[Su],[wE]:[Su],[vE]:[new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[_E]:[new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[yE]:[new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[EE]:[new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[nE]:[new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[new RegExp("rv:(\\d+(\\.\\d+)?)")]},qj=function(e,t,r,i){const n=kE(e,t,r,i),s=Uj[n];if(z(s))return null;for(let o=0;s.length>o;o++){const a=e.match(s[o]);if(a)return parseFloat(a[a.length-2])}return null},lv=[[new RegExp("Xbox; Xbox (.*?)[);]","i"),e=>[Ul,e&&e[1]||""]],[new RegExp(wc,"i"),[wc,""]],[new RegExp(Ec,"i"),[Ec,""]],[If,[Dl,""]],[new RegExp(yu,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[dE,""];if(new RegExp(bs).test(t)&&!/IEMobile\b/.test(t))return["Windows Mobile",""];const r=/Windows NT ([0-9.]+)/i.exec(t);if(r&&r[1]){let i=Dj[r[1]]||"";return/arm/i.test(t)&&(i="RT"),[yu,i]}return[yu,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?["iOS",[e[3],e[4],e[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{let t="";return e&&e.length>=3&&(t=z(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),e=>e&&e[2]?[Uo,[e[2],e[3],e[4]||"0"].join(".")]:[Uo,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{const t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,["Chrome OS",""]],[/Linux|debian/i,["Linux",""]]],IE=function(e){for(let t=0;lv.length>t;t++){const[r,i]=lv[t],n=r.exec(e),s=n&&(gt(i)?i(n,e):i);if(s)return s}return["",""]},AE=function(e){return Nj.test(e)?wc:$j.test(e)?Ec:Lj.test(e)?Ul:new RegExp(ip,"i").test(e)?ip:new RegExp("(Windows Phone|WPDesktop)","i").test(e)?dE:/iPad/.test(e)?eE:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?tE:If.test(e)?Dl:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(cv,"i").test(e)?cv:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(bs).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?Uo:Qw:new RegExp("(pda|Mobile)","i").test(e)?Mj:new RegExp(Sc,"i").test(e)&&!new RegExp("Tablet pc","i").test(e)?pE:""},jj=function(e,t){var r;const i=AE(e);return i===eE||i===Qw||i==="Kobo"||i==="Kindle Fire"||i===pE?Sc:i===wc||i===Ul||i===Ec||i===ip?"Console":i===tE?"Wearable":i?bs:t?.userAgentDataPlatform==="Android"&&((r=t?.maxTouchPoints)!==null&&r!==void 0?r:0)>0?600>Math.min((n=t?.screenWidth)!==null&&n!==void 0?n:0,(s=t?.screenHeight)!==null&&s!==void 0?s:0)/((o=t?.devicePixelRatio)!==null&&o!==void 0?o:1)?bs:Sc:"Desktop";var n,s,o},wu=/\bFBAV\/(\d+(?:\.\d+)*)/i,uv=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",wu],[/\bFBAN\/EMA\b/i,"Facebook Lite",wu],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",wu],[/\bLinkedInApp(?:\]?\/(\d+(?:\.\d+)*))?\b/i,"LinkedIn"],[/\bTwitter(?:Android| for (?:iPhone|iPad|Android))(?:\/(\d+(?:\.\d+)*))?\b/i,"Twitter"],[/\b(?:musical_ly|trill)(?:[_/](\d+\.\d+(?:\.\d+)*))?(?=\b|_)/i,"TikTok",/\bapp_version\/(\d+(?:\.\d+)*)/i],[/\b(?:MicroMessenger|WeChat)\/(\d+(?:\.\d+)*)?/i,"WeChat"],[/\bLine\/(\d+(?:\.\d+)*)?/i,"Line"],[/\bGSA\/(\d+(?:\.\d+)*)?/i,"Google"],[/\[Pinterest\/(?:iOS|Android)\b|\bPinterest(?: for (?:Android(?: Tablet)?|iOS))?\/(\d+(?:\.\d+)*)/i,"Pinterest"],[/\b(?:WA4A|WAiOS)\/(\d+(?:\.\d+)*)?/i,"WhatsApp"],[/\bSnapchat[ /](\d+(?:\.\d+)*)?/i,"Snapchat"],[/\bBing(?:Web|Sapphire)\/(\d+(?:\.\d+)*)?/i,"Bing"],[/\bNAVER\(inapp; search;/i,"Naver",/\bNAVER\(inapp; search;[^;)]*; (\d+(?:\.\d+)*)/i],[/\bKAKAOTALK[ /](\d+\.\d+(?:\.\d+)*)?/i,"KakaoTalk"]],op="[Truncated]",na="[Unserializable]";function cs(e){let t="";for(let r=0;e.length>r;r++){const i=e.charCodeAt(r);if(55296>i||i>56319)t+=56320>i||i>57343?e[r]:"�";else{const n=e.charCodeAt(r+1);56320>n||n>57343?t+="�":(t+=e[r]+e[r+1],r++)}}return t}function RE(e,t){if(!t)return e;let r=[];try{r=Object.keys(t)}catch{r=[]}for(const i of r){let n;try{n=t[i]}catch{n=na}Object.defineProperty(e,i,{value:n,enumerable:!0,writable:!0,configurable:!0})}return e}var ec=3e5,TE=class{record(e){if(e.kind==="too-large")return;if(e.kind!=="retry-later")return void this.reset();if(!e.retryAfterMs)return;const t=this.isOpen(),r=Date.now(),i=Math.min(e.retryAfterMs,ec);if(!t)return this.ts=r,void(this.es=r+i);this.es=Math.max(this.es,Math.min(r+i,this.ts+ec))}remainingMs(){const e=Date.now();if(this.ts-5e3>e)return this.reset(),0;const t=Math.min(ec,Math.max(0,this.es-e));return t===0&&this.reset(),t}isOpen(){return this.remainingMs()>0}reset(){this.es=0,this.ts=0}constructor(){this.es=0,this.ts=0}},zj=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function dv(e,t){return typeof(r=e)=="string"&&zj.test(r)?e:t();var r}function CE(e,t){const r=new Error(t);try{Object.defineProperty(r,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch{}return r}function qi(e){return e&&e.split("#")[0]}function pv(e){try{return e()}catch{return}}function PE(e,t){const r=setTimeout(e,t);return r!=null&&r.unref&&r?.unref(),r}function hv(e,t,r){return OE.apply(this,arguments)}function OE(){return(OE=We(function*(e,t,r){let i;try{return yield Promise.race([e,new Promise((n,s)=>{i=PE(()=>{try{r?.(),n()}catch(o){s(o)}},t)})])}finally{clearTimeout(i)}})).apply(this,arguments)}var Pa,fv,Eu;function Fj(e){const t=globalThis._posthogChunkIds;if(!t)return;const r=Object.keys(t);return Eu&&r.length===fv||(fv=r.length,Eu=r.reduce((i,n)=>{Pa||(Pa={});const s=Pa[n];if(s)i[s[0]]=s[1];else{const o=e(n);for(let a=o.length-1;a>=0;a--){const c=o[a],l=c?.filename,u=t[n];if(l&&u){i[l]=u,Pa[n]=[l,u];break}}}return i},{})),Eu}function yo(e){return yo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yo(e)}function Hj(e,t,r){return(t=(function(i){var n=(function(s){if(yo(s)!="object"||!s)return s;var o=s[Symbol.toPrimitive];if(o!==void 0){var a=o.call(s,"string");if(yo(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(s)})(i);return yo(n)=="symbol"?n:n+""})(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,i)}return r}function S(e){for(var t=1;arguments.length>t;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?mv(Object(r),!0).forEach(function(i){Hj(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mv(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}var Bj=class{constructor(e,t,r=[]){this.coercers=e,this.stackParser=t,this.modifiers=r}buildFromUnknown(e,t={}){const r=t&&t.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,t,0).apply(e),n=this.buildParsingContext(t),s=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(s,r),$exception_level:"error"}}modifyFrames(e){var t=this;return We(function*(){for(const r of e)r.stacktrace&&r.stacktrace.frames&&_e(r.stacktrace.frames)&&(r.stacktrace.frames=yield t.applyModifiers(r.stacktrace.frames));return e})()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:(t=e.syntheticException)===null||t===void 0?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var r;let i,n;if(e.cause!=null&&(i=this.parseStacktrace(e.cause,t)),e.stack!=""&&e.stack!=null)try{n=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)}catch{}return S(S({},e),{},{cause:i,stack:n,errors:(r=e.errors)===null||r===void 0?void 0:r.map(s=>this.parseStacktrace(s,t))})}applyChunkIds(e,t){return e.map(r=>(r.filename&&t&&(r.chunk_id=t[r.filename]),r))}applyCoercers(e,t){for(const r of this.coercers)if(r.match(e))return r.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return We(function*(){let r=e;for(const i of t.modifiers)r=yield i(r);return r})()}convertToExceptionList(e,t){const r=[],i=(n,s,o)=>{var a;const c=r.length,l=s===void 0?S(S({type:typeof t.type=="string"&&t.type.length>0?t.type:"generic"},typeof t.handled=="boolean"?{handled:t.handled}:t.handled===void 0?{handled:!0}:{}),{},{synthetic:typeof t.synthetic=="boolean"?t.synthetic:n.synthetic,exception_id:c}):{type:"chained",source:o,synthetic:n.synthetic,exception_id:c,parent_id:s},u={type:n.type,value:n.value,mechanism:l};n.stack&&(u.stacktrace={type:"raw",frames:n.stack}),r.push(u),n.cause&&i(n.cause,c,"cause");for(const p of(a=n.errors)!==null&&a!==void 0?a:[])i(p,c,"member")};return i(e),r}buildParsingContext(e){var t;return{chunkIdMap:Fj(this.stackParser),skipFirstLines:(t=e.skipFirstLines)!==null&&t!==void 0?t:1}}getAggregateErrors(e){try{if(Ns(e)){let r=Object.getPrototypeOf(e);for(let i=0;r&&100>i;i++){var t;const n=(t=Object.getOwnPropertyDescriptor(r,"constructor"))===null||t===void 0?void 0:t.value;if(typeof n=="function"&&n.name==="AggregateError"){const s=e.errors;return _e(s)?s:void 0}r=Object.getPrototypeOf(r)}}}catch{}}buildCoercingContext(e,t,r=0){let i=0,n=0,s=!1;const o=new Set,a=[],c={},l=(d,h,f=0)=>{const m=u(h,f),v=m.apply;if(m.apply=$=>{a.push(d);try{return v($)}finally{a.pop()}},f>4||f>0&&a.indexOf(d)!==-1)return this.coerceFallback(m);const _=typeof d=="object"&&d!==null||typeof d=="function";if(f===0&&i>=50||_&&o.has(d))return;_&&o.add(d),f===0&&i++;const b=this.getAggregateErrors(d);let A,P;s||(s=!!b);try{if(A=this.applyCoercers(d,m),!A)throw c}catch($){if($===c)return void(f===0&&i--);if(!s)throw $;A=this.coerceFallback(m)}if(!b||i>=50)return A;try{P=b.length}catch{return A}if(!Number.isInteger(P)||0>P||P>4294967295)return A;const D=[];for(let $=0;50>i&&1e3>n&&P>$;$++){let q;n++;try{q=m.next(b[$])}catch{i++,q=this.coerceFallback(u(h+1))}q&&D.push(q)}return S(S({},A),{},{errors:D})},u=(d,h=0)=>S(S({},t),{},{syntheticException:d==0?t.syntheticException:void 0,mechanism:d==0?e:{},apply(f){const m=l(f,d,h+1);if(!m)throw c;return m},next:f=>l(f,d+1)}),p=u(r);return S(S({},p),{},{apply:d=>{var h;return(h=l(d,r))!==null&&h!==void 0?h:this.coerceFallback(p)}})}},Vj=/^([a-z][a-z0-9.+-]+):/i,Gj=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function Wj(e){if(!e||e==="<anonymous>")return!1;const t=Vj.exec(e);return!t||Gj.includes(t[1].toLowerCase())}function ap(e,t,r,i,n){const s={platform:e,filename:t,function:r==="<anonymous>"?"?":r,in_app:Wj(t)};return z(i)||(s.lineno=i),z(n)||(s.colno=n),s}var xE=(e,t)=>{const r=e.indexOf("safari-extension")!==-1,i=e.indexOf("safari-web-extension")!==-1;return r||i?[e.indexOf("@")!==-1?e.split("@")[0]:"?",r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Jj=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Kj=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Yj=/\((\S*)(?::(\d+))(?::(\d+))\)/,Xj=(e,t)=>{const r=Jj.exec(e);if(r){const[,n,s,o]=r;return ap(t,n,"?",+s,+o)}const i=Kj.exec(e);if(i){if(i[2]&&i[2].indexOf("eval")===0){const o=Yj.exec(i[2]);o&&(i[2]=o[1],i[3]=o[2],i[4]=o[3])}const[n,s]=xE(i[1]||"?",i[2]);return ap(t,s,n,i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},Zj=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Qj=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,ez=(e,t)=>{const r=Zj.exec(e);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){const s=Qj.exec(r[3]);s&&(r[1]=r[1]||"eval",r[3]=s[1],r[4]=s[2],r[5]="")}let i=r[3],n=r[1]||"?";return[n,i]=xE(n,i),ap(t,i,n,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},gv=/\(error: (.*)\)/;function Af(e,t){return e.filename===t.filename&&e.function===t.function&&e.module===t.module&&e.lineno===t.lineno&&e.colno===t.colno}function tz(e){for(let t=1;10>=t;t++){const r=e.length-2*t;if(0>r)break;let i=!0;for(let n=0;t>n;n++)if(!Af(e[r+n],e[r+t+n])){i=!1;break}if(i){for(let n=0;t>n;n++)e[r+n]=e[r+t+n];return e.length=r+t,{start:r,length:t}}}}function rz(e,t){const r=t.start+t.length,i=LE(e,t);i&&e.splice(r+i===e.length?r:t.start,i)}function ME(e,t){let r=t.start;for(;r>0&&Af(e[r-1],e[r-1+t.length]);)r--;return t.start-r}function LE(e,t){const r=t.start+t.length;let i=r;for(;e.length>i&&Af(e[i],e[i-t.length]);)i++;return i-r}function iz(e,t){const r=t[0];let i=e.length-(r?ME(e,r):0);for(const n of t)i-=LE(e,n);return i}function nz(e,t,r){for(let i=0;e.length>i;i++){const n=e[(t+i)%e.length],s=e[(r+i)%e.length];if(n!==s)return s>n}return!1}var sz=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){const r=Ae(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){const t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?`${t}: ${e.message}`:t}isDOMException(e){return bc(e,"DOMException")}isDOMError(e){return bc(e,"DOMError")}},oz=class{match(e){return Ns(e)}coerce(e,t){var r;const i=this.getStack(e),n=i===void 0?(r=t.syntheticException)===null||r===void 0?void 0:r.stack:void 0,s=!!n;return{type:this.getType(e),value:this.getMessage(e,t),stack:i??n,cause:e.cause?t.next(e.cause):void 0,synthetic:s}}getType(e){return e.name||e.constructor.name}getMessage(e,t){const r=e.message;return String(r.error&&typeof r.error.message=="string"?r.error.message:r)}getStack(e){try{const t=e.stacktrace;if(typeof t=="string"&&t.length>0)return t;const r=e.stack;return typeof r=="string"&&r.length>0?r:void 0}catch{return}}},az=class{match(e){return!!bc(e,"ErrorEvent")&&(e.error!=null||this.ar(e))}coerce(e,t){var r;if(e.error!=null)return t.apply(e.error);const i=t.apply(e.message);return S(S({},i),{},{stack:(r=this.lr(e))!==null&&r!==void 0?r:i.stack,synthetic:!0})}ar(e){return Ae(e.message)&&e.message.length>0}lr(e){var t,r;const i=e,n=(t=i.lineno)!==null&&t!==void 0?t:0,s=(r=i.colno)!==null&&r!==void 0?r:0;if(Ae(i.filename)&&i.filename.length!==0&&n!==0)return`Error
61
61
  at ${i.filename}:${n}:${s}`}},cz=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,lz=class{match(e){return typeof e=="string"}coerce(e,t){var r;const[i,n]=this.getInfos(e);return{type:i??"Error",value:n??e,stack:(r=t.syntheticException)===null||r===void 0?void 0:r.stack,synthetic:!0}}getInfos(e){let t="Error",r=e;const i=e.match(cz);return i&&(t=i[1],r=i[2]),[t,r]}},uz=["fatal","error","warning","log","info","debug"];function $E(e,t=40){const r=Object.keys(e);if(r.sort(),!r.length)return"[object has no keys]";for(let i=r.length;i>0;i--){const n=r.slice(0,i).join(", ");if(t>=n.length)return i===r.length?n:n.length>t?`${n.slice(0,t)}...`:n}return""}var dz=class{match(e){return typeof e=="object"&&e!==null}coerce(e,t){var r,i;const n=this.getErrorPropertyFromObject(e);return n?t.apply(n):{type:this.getType(e),value:this.getValue(e),stack:(r=this.getStack(e))!==null&&r!==void 0?r:(i=t.syntheticException)===null||i===void 0?void 0:i.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){if(kf(e))return e.constructor.name;const t="name"in e?e.name:void 0;return Ae(t)&&!_o(t)?t:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){let r=`'${e.name}' captured as exception`;return"message"in e&&typeof e.message=="string"&&(r+=` with message: '${e.message}'`),r}if("message"in e&&typeof e.message=="string")return e.message;const t=this.getObjectClassName(e);return`${t&&t!=="Object"?`'${t}'`:"Object"} captured as exception with keys: ${$E(e)}`}isSeverityLevel(e){return Ae(e)&&!_o(e)&&uz.indexOf(e)>=0}getStack(e){try{return Ae(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:Ae(e.stack)&&e.stack.length>0?e.stack:void 0}catch{return}}getErrorPropertyFromObject(e){for(const t in e)if({}.hasOwnProperty.call(e,t)){const r=e[t];if(Ns(r))return r}}getObjectClassName(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{return}}},pz=class{match(e){return kf(e)}coerce(e,t){var r;const i=e.constructor.name;return{type:i,value:`${i} captured as exception with keys: ${$E(e)}`,stack:(r=t.syntheticException)===null||r===void 0?void 0:r.stack,synthetic:!0}}},hz=class{match(e){return Xw(e)}coerce(e,t){var r;return{type:"Error",value:`Primitive value captured as exception: ${String(e)}`,stack:(r=t.syntheticException)===null||r===void 0?void 0:r.stack,synthetic:!0}}},fz=class{match(e){return bc(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!kf(e))return!1;try{const t=e.detail;return t!=null&&typeof t=="object"&&"reason"in t}catch{return!1}}coerce(e,t){var r;const i=this.getUnhandledRejectionReason(e);return Xw(i)?{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(i)}`,stack:(r=t.syntheticException)===null||r===void 0?void 0:r.stack,synthetic:!0}:t.apply(i)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&e.detail!=null&&typeof e.detail=="object"&&"reason"in e.detail)return e.detail.reason}catch{}return e}},kc="$message",Ic="$timestamp",mz=new Set([kc,Ic]),ku={enabled:!0,max_bytes:32768};function Ac(e){var t;return e?{enabled:(t=e.enabled)!==null&&t!==void 0?t:ku.enabled,max_bytes:vz(e.max_bytes,ku.max_bytes)}:S({},ku)}var gz=class{constructor(e){this.ns=[],this.ss=0,this.Ir=Ac(e)}setConfig(e){this.Ir=Ac(e),this.rs()}add(e){const t=(function(i){let n;try{n=Kw(i)}catch{return}try{const s=JSON.parse(n);if(!Pe(s))return;const o=s,a=o[kc],c=o[Ic];return!Ae(a)||a.trim().length===0||!Ae(c)&&!nt(c)?void 0:{step:o,json:n}}catch{return}})(e);if(!t)return;const r=(function(i){if("u">typeof TextEncoder)return new TextEncoder().encode(i).length;const n=encodeURIComponent(i);let s=0;for(let o=0;n.length>o;o++)n[o]==="%"?(s+=1,o+=2):s+=1;return s})(t.json);r>this.Ir.max_bytes||(this.ns.push({step:t.step,bytes:r}),this.ss+=r,this.rs())}getAttachable(){return this.ns.map(e=>e.step)}clear(){this.ns=[],this.ss=0}size(){return this.ns.length}rs(){for(;this.ss>this.Ir.max_bytes&&this.ns.length>0;){const e=this.ns.shift();e&&(this.ss-=e.bytes)}}};function vz(e,t){if(!nt(e)||e===1/0||e===-1/0)return t;const r=Math.floor(e);return 0>r?t:r}var vv=e=>{if(typeof e!="string")return e;try{return JSON.parse(e)}catch{return e}};function _v(e){return typeof e=="string"||e}function yv(e){return typeof e=="string"?e:void 0}var _z=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],NE="NativeGzipValidationError",cp=e=>e.length>=2&&e[0]===31&&e[1]===139,bv=(e,t)=>e===tp.GZipJS||t===tp.GZipJS||t==="gzip",Sv=e=>!(!e||typeof e!="object")&&("name"in e?String(e.name):"")==="NotReadableError",Ks,Oa=e=>{throw CE(NE,`Native gzip produced invalid output: ${e}`)},yz=(wv=We(function*(e,t){18>e.size&&Oa("too-short");const r=new Uint8Array(yield e.slice(0,10).arrayBuffer());cp(r)&&r[2]===8||Oa("invalid-header");const i=new DataView(yield e.slice(e.size-8).arrayBuffer());i.getUint32(0,!0)!==(s=>{const o=(()=>{if(Ks)return Ks;Ks=[];for(let c=0;256>c;c++){let l=c;for(let u=0;8>u;u++)l=1&l?3988292384^l>>>1:l>>>1;Ks[c]=l>>>0}return Ks})();let a=4294967295;for(let c=0;s.length>c;c++)a=o[255&(a^s[c])]^a>>>8;return(4294967295^a)>>>0})(t)&&Oa("invalid-crc");const n=t.length>>>0;i.getUint32(4,!0)!==n&&Oa("invalid-size")}),function(e,t){return wv.apply(this,arguments)}),wv;function lp(){return lp=We(function*(e,t=!0,r){try{const n=new TextEncoder().encode(e),s=new globalThis.CompressionStream("gzip"),o=s.writable.getWriter(),a=o.write(n).then(()=>o.close()).catch((i=We(function*(u){try{yield o.abort(u)}catch{}throw u}),function(u){return i.apply(this,arguments)})),c=new Response(s.readable).blob(),[l]=yield Promise.all([c,a]);return yield yz(l,n),l}catch(n){if(r?.rethrow)throw n;return t&&console.error("Failed to gzip compress data",n),null}var i}),lp.apply(this,arguments)}function DE(e,t){if(e==null)return{};var r,i,n=(function(o,a){if(o==null)return{};var c={};for(var l in o)if({}.hasOwnProperty.call(o,l)){if(a.includes(l))continue;c[l]=o[l]}return c})(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;s.length>i;i++)t.includes(r=s[i])||{}.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var bz={}.propertyIsEnumerable;function Rc(e,t){try{return UE(e,t,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch{return[]}}function Rf(e,t,r,i){if(0>=r.remainingNodes)return{stringValue:op};if(r.remainingNodes--,Ft(e))return{boolValue:e};if(typeof e=="bigint")return(function(n,s){const o=n.toString(),a=BigInt("9223372036854775808");return n>=a||-a>n?(s?.debug(`Attribute ${o} is outside the int64 range; encoding it as a string`),{stringValue:o}):{intValue:o}})(e,t);if(typeof e=="number"){if(!Number.isFinite(e))return{stringValue:String(e)};if(Number.isInteger(e)){if(Number.isSafeInteger(e))return{intValue:String(e)};if(typeof BigInt>"u")return{stringValue:String(e)};const n=BigInt(e).toString();return e>=9223372036854776e3||-9223372036854776e3>e?(t?.debug(`Attribute ${n} is outside the int64 range; encoding it as a string`),{stringValue:n}):{intValue:n}}return{doubleValue:e}}if(typeof e=="string")return{stringValue:cs(e)};if(typeof e=="function")return{stringValue:"[Function]"};if(typeof e=="symbol")return{stringValue:String(e)};if(typeof e=="object"&&e!==null){if(r.ancestors.has(e))return{stringValue:"[Circular]"};if(i>=20)return{stringValue:op};if(e instanceof Date){const n=e.getTime(),s=Number.isFinite(n)?e.toISOString():String(e);return{stringValue:typeof s=="string"?cs(s):String(s)}}r.ancestors.add(e);try{try{const n=e.toJSON;if(typeof n=="function")return Rf(n.call(e),t,r,i+1)}catch{}return _e(e)?{arrayValue:{values:Sz(e,t,r,i+1)}}:{kvlistValue:{values:UE(e,t,r,i+1)}}}finally{r.ancestors.delete(e)}}return{stringValue:cs(String(e))}}function Sz(e,t,r,i){const n=[],s=Math.min(e.length,1e3);let o=0;for(;s>o&&r.remainingNodes>0;o++)try{const a=o in e?e[o]:void 0;if(we(a))continue;n.push(Rf(a,t,r,i))}catch{n.push({stringValue:na})}return e.length>o&&n.push({stringValue:op}),n}function UE(e,t,r,i){const n=[];for(const s in e)if(bz.call(e,s)){if(!s){t?.debug("Dropping an attribute with an empty key");continue}if(n.length>=1e3||0>=r.remainingNodes){t?.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{const o=e[s];if(Qe(o)||z(o))continue;n.push({key:cs(s),value:Rf(o,t,r,i)})}catch{n.push({key:cs(s),value:{stringValue:na}})}}return n}function qE(e,t,r){return S(S(S(S({},RE({},e.resourceAttributes)),{},{"service.name":e.serviceName||"unknown_service"},e.environment&&{"deployment.environment":e.environment}),e.serviceVersion&&{"service.version":e.serviceVersion}),{},{"telemetry.sdk.name":t,"telemetry.sdk.version":r})}var wz=["service.name","deployment.environment","service.version","telemetry.sdk.name","telemetry.sdk.version"];function jE(e,t){const r=RE({},e),i={};for(const n of wz)({}).hasOwnProperty.call(r,n)&&(i[n]=r[n],delete r[n]);return[...Rc(r,t),...Rc(i,t)]}var Ev={darwin:"macOS",win32:"Windows",cygwin:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",netbsd:"NetBSD",sunos:"SunOS",aix:"AIX",haiku:"Haiku","Mac OS X":"macOS"},zE={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},Ez=zE.info;function kz(e){try{return cs(String(e))}catch{return na}}function Iz(e,t,r,i){const n=e.level||"info",{text:s,number:o}=zE[n]||Ez,a=(function(d=Date.now()){return String(d)+"000000"})(nt(i)?i:void 0),c={};t.distinctId&&(c.posthogDistinctId=t.distinctId),t.sessionId&&(c.sessionId=t.sessionId),t.windowId&&(c["window.id"]=t.windowId),we(t.sessionStartTimestamp)||(c.sessionStartTimestamp=String(t.sessionStartTimestamp)),we(t.lastActivityTimestamp)||(c.lastActivityTimestamp=String(t.lastActivityTimestamp)),t.currentUrl&&(c["url.full"]=t.currentUrl),t.screenName&&(c["screen.name"]=t.screenName),t.appState&&(c["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(c.feature_flags=t.activeFeatureFlags);const l=S({},c),u=e.attributes;if(u){let d=[];try{d=Object.keys(u)}catch{d=[]}for(const h of d){let f;try{f=u[h]}catch{f=na}Object.defineProperty(l,h,{value:f,enumerable:!0,writable:!0,configurable:!0})}}const p={timeUnixNano:a,observedTimeUnixNano:a,severityNumber:o,severityText:s,body:{stringValue:kz(e.body)},attributes:Rc(l,r)};return e.trace_id&&(p.traceId=e.trace_id),e.span_id&&(p.spanId=e.span_id),z(e.trace_flags)||(p.flags=e.trace_flags),p}function FE(e,t,r){return qE(e,t,r)}function HE(e,t,r,i){return{resourceLogs:[{resource:{attributes:jE(t)},scopeLogs:[{scope:{name:r,version:i},logRecords:e}]}]}}var BE=class{constructor(e){this.ls=e,this.us=0}get pending(){return!!this.hs}arm(e){this.clear(),this.us=Date.now()+e,this.hs=PE(()=>{this.hs=void 0,this.ls()},e)}armNoEarlierThan(e){this.hs&&Date.now()+e<=this.us||this.arm(e)}clear(){this.hs&&(clearTimeout(this.hs),this.hs=void 0)}};function VE(){return .75+.5*Math.random()}function GE(e,t,r,i){const n=Math.min(Math.max(0,t-1),6),s=e*Math.pow(2,n);return Math.round((i===void 0?s:Math.min(s,Math.max(i,e)))*r)}var Az=class{constructor(e,t,r,i,n,s=()=>Promise.resolve(),o){var a;this._instance=e,this.Ir=t,this.A=r,this.cs=i,this.ds=n,this.vs=s,this.fs=o,this.ps=new BE(()=>this.gs()),this.ys=null,this.bs=0,this._s=0,this.ws=new TE,this.ks=0,this.Ss=1,this.xs=0,this.Cs=0,this.$s=!1,this.Ts=t.maxBufferSize,this.Is=Math.max((a=t.maxQueueSize)!==null&&a!==void 0?a:t.maxBufferSize,t.maxBufferSize),this.Ms=t.flushIntervalMs,this.Es=t.maxBatchRecordsPerPost,this.Ps=t.rateCapWindowMs,this.Rs=t.maxLogsPerInterval}clearQueue(){this._s++,this._instance.setPersistedProperty(Pr.LogsQueue,[])}reset(){this.ps.clear(),this.xs=0,this.Cs=0,this.$s=!1,this.ks=0,this.Ss=1,this.ws.reset(),this.Es=this.Ir.maxBatchRecordsPerPost}onReconnect(){this.ks=0,this.Ss=1,this.ws.isOpen()?this.As()&&this.Fs():this.gs()}captureLog(e,t){var r;if(this._instance.isDisabled||this._instance.optedOut||!e?.body)return;const i=this.Os(e);if(i===null)return;if(!i.body)return void this.A.info("Log was rejected in beforeSend function");if(!this.Ds())return;const n={record:Iz(i,(r=t?.context)!==null&&r!==void 0?r:this.cs(),this.A,t?.occurredAtMs)};this.ds(()=>this.Ls(n))}Os(e){const t=this.Ir.beforeSend;if(!t)return e;const r=_e(t)?t:[t];let i=e;for(const n of r)try{const s=n(i);if(!s)return this.A.info("Log was rejected in beforeSend function"),null;i=s}catch(s){return this.A.error("Error in beforeSend function for log:",s),null}return i}Ds(){if(this.Rs===void 0)return!0;const e=Date.now(),t=e-this.xs;return this.Ps>t&&t>=0||(this.xs=e,this.Cs=0,this.$s=!1),this.Rs>this.Cs?(this.Cs++,!0):(this.$s||(this.A.warn(`captureLog dropping logs: exceeded ${this.Rs} logs per ${this.Ps}ms`),this.$s=!0),!1)}flush(){var e=this;return We(function*(){if(!e._instance.isDisabled)return e.ys||(e.ys=e.Ns().finally(()=>{e.ys=null})),e.ys})()}Ns(){var e=this;return We(function*(){var t;e.ps.clear();let r=(t=e._instance.getPersistedProperty(Pr.LogsQueue))!==null&&t!==void 0?t:[];if(r.length===0)return;const i=r.length;let n=0;for(;r.length>0&&i>n;){var s,o;const a=e._s;e.bs=0;const c=Math.min(r.length,e.Es),l=r.slice(0,c),u=HE(l.map(d=>d.record),e.qs(),(s=e.fs)!==null&&s!==void 0?s:e._instance.getLibraryId(),e._instance.getLibraryVersion()),p=yield e._instance.js(u);if(e._s!==a)return;if(p.kind==="too-large"&&l.length>1)e.Es=Math.max(1,Math.floor(l.length/2)),e.A.warn(`Logs batch of size ${l.length} was too large for the ingestion endpoint, reducing batch size to ${e.Es}`);else if(e.ws.record(p),e.ps.pending&&e.ps.arm(Math.max(e.Ms,e.ws.remainingMs())),p.kind==="retry-later"||(p.kind==="too-large"?e.A.warn("Dropping a single log record with batch size 1 — the record is larger than the server cap and cannot be split further."):p.kind==="ok"&&e.Ir.maxBatchRecordsPerPost>e.Es&&(e.Es=Math.min(e.Ir.maxBatchRecordsPerPost,e.Es+1)),yield e.Bs(l.length),r=(o=e._instance.getPersistedProperty(Pr.LogsQueue))!==null&&o!==void 0?o:[],n+=l.length,p.kind==="fatal"))throw p.error}})()}Bs(e){var t=this;return We(function*(){var r;const i=Math.max(0,e-t.bs),n=(r=t._instance.getPersistedProperty(Pr.LogsQueue))!==null&&r!==void 0?r:[];t._instance.setPersistedProperty(Pr.LogsQueue,n.slice(i)),yield t.vs()})()}qs(){return FE(this.Ir,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Ls(e){var t;if(this._instance.optedOut)return;const r=(t=this._instance.getPersistedProperty(Pr.LogsQueue))!==null&&t!==void 0?t:[];this.Is>r.length||(r.shift(),this.bs++,this.A.info("Logs queue is full, dropping oldest record.")),r.push(e),this._instance.setPersistedProperty(Pr.LogsQueue,r),this.Ts>r.length||this.ws.isOpen()?this.Fs():this.gs()}Fs(){this.ps.pending||this.ps.arm(Math.max(this.Ms,this.ws.remainingMs()))}Hs(){return Math.max(GE(this.Ms,this.ks,this.Ss,3e4),this.ws.remainingMs())}As(){const e=this._instance.getPersistedProperty(Pr.LogsQueue);return!!e&&e.length>0}shutdown(e){var t=this;return We(function*(){t.ps.clear();const r=t.flush().catch(()=>{});e!==void 0?yield hv(r,e):yield r})()}flushWithTimeout(e){var t=this;return We(function*(){const r=t.flush();yield hv(r,e,()=>{r.catch(()=>{})})})()}gs(){this.flush().then(()=>{this.ks=0,this.Ss=1},e=>{this.ks++,this.Ss=VE(),this.A.error("PostHog logs flush failed:",e)}).finally(()=>{!this._instance.isDisabled&&this.As()&&this.ps.armNoEarlierThan(this.Hs())})}},Iu=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function kv(e){return String(e)+"000000"}function Iv(e,t,r,i){let n="";return i&&(n=Object.keys(i).sort().map(s=>`${JSON.stringify(s)}:${JSON.stringify(i[s])}`).join(",")),`${e}\0${t}\0${r??""}\0${n}`}var Rz=class{constructor(e,t,r){this._instance=e,this.Ir=t,this.A=r,this.zs=new Map,this.ps=new BE(()=>this.flush().catch(i=>{this.A.error("Metrics flush failed:",i)})),this.ys=null,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.ws=new TE,this.ks=0,this.Ss=1,this.Gs=0}count(e,t=1,r){this.Zs({name:e,type:"count",value:t,unit:r?.unit,attributes:r?.attributes})}gauge(e,t,r){this.Zs({name:e,type:"gauge",value:t,unit:r?.unit,attributes:r?.attributes})}histogram(e,t,r){this.Zs({name:e,type:"histogram",value:t,unit:r?.unit,attributes:r?.attributes})}flush(){var e=this;const t=this.ys,r=(function(){var i=We(function*(){t&&(yield t.catch(()=>{})),yield e.Qs()});return function(){return i.apply(this,arguments)}})()().finally(()=>{this.ys===r&&(this.ys=null)});return this.ys=r,r}drainWindow(){if(this.zs.size===0)return null;const e=this.zs;return this.zs=new Map,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.Js(e)}reset(){this.Gs++,this.ws.reset(),this.ks=0,this.Ss=1,this.ps.clear(),this.zs=new Map,this.ys=null,this.Us=!1,this.Ws=new Map,this.Vs=new Set}Zs(e){if(this._instance.isDisabled||this._instance.optedOut)return;const t=this.Os(e);if(t===null)return;if(!t.name||typeof t.name!="string")return void this.A.warn("Dropping metric with empty name");if(typeof t.value!="number"||!Number.isFinite(t.value))return void this.A.warn(`Dropping metric '${t.name}': value must be a finite number`);if(t.type==="count"&&0>t.value)return void this.A.warn(`Dropping count '${t.name}': counters are monotonic, value must be >= 0`);let r,i;try{r=t.attributes?S({},t.attributes):void 0,i=Iv(t.type,t.name,t.unit,r)}catch(o){this.A.warn(`Dropping metric '${t.name}': attributes could not be serialized`,o);return}let n=this.zs.get(i);if(!n){if(!this.Ks())return;n={name:t.name,type:t.type,unit:t.unit,attributes:r,windowStartMs:Date.now()},this.zs.set(i,n)}const s=this.Ws.get(t.name);s===void 0?this.Ws.set(t.name,t.type):s===t.type||this.Vs.has(t.name)||(this.Vs.add(t.name),this.A.warn(`Metric name '${t.name}' is already used as a ${s}; recording it as a ${t.type} too will blend both series in charts. Use a distinct name.`)),this.Xs(n,t.value),this.Fs()}Ks(){return this.Ir.maxSeriesPerFlush>this.zs.size||(this.Us||(this.Us=!0,this.A.warn(`Metric series cap reached (${this.Ir.maxSeriesPerFlush} per flush window); dropping new series until the next flush. Reduce attribute cardinality.`)),!1)}Xs(e,t){switch(e.type){case"count":var r;e.total=((r=e.total)!==null&&r!==void 0?r:0)+t;break;case"gauge":e.last=t;break;case"histogram":{e.hist||(e.hist={count:0,sum:0,min:t,max:t,bucketCounts:new Array(Iu.length+1).fill(0)});const i=e.hist;i.count+=1,i.sum+=t,i.min=Math.min(i.min,t),i.max=Math.max(i.max,t),i.bucketCounts[(function(n,s){for(let o=0;s.length>o;o++)if(s[o]>=n)return o;return s.length})(t,Iu)]+=1;break}}}Os(e){const t=this.Ir.beforeSend;if(!t)return e;const r=_e(t)?t:[t];let i=e;for(const n of r)try{const s=n(i);if(!s)return this.A.info("Metric was rejected in beforeSend function"),null;i=s}catch(s){return this.A.error("Error in beforeSend function for metric:",s),null}return i}Fs(){this.ps.pending||this.ps.arm(this.Hs())}Hs(){return Math.max(GE(this.Ir.flushIntervalMs,this.ks,this.Ss,3e4),this.ws.remainingMs())}Qs(){var e=this;return We(function*(){if(e.ps.clear(),e.zs.size===0)return;const t=e.zs;e.zs=new Map,e.Us=!1,e.Ws=new Map,e.Vs=new Set;const r=e.Gs,i=yield e._instance.Ys(e.Js(t));if(r===e.Gs)switch(e.ws.record(i),i.kind==="retry-later"?(e.ks++,e.Ss=VE()):(e.ks=0,e.Ss=1),e.ps.pending&&e.ps.arm(e.Hs()),i.kind){case"ok":return;case"retry-later":e.ho(t),e.ps.armNoEarlierThan(e.Hs());return;case"too-large":e.A.warn("Metrics batch exceeded the server size limit and was dropped");return;case"fatal":e.A.error("Failed to send metrics batch:",i.error);return}})()}Js(e){return t=this.co(e),r=(function(s,o,a){return qE(s,o,a)})(this.Ir,this._instance.getLibraryId(),this._instance.getLibraryVersion()),i=this._instance.getLibraryId(),n=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:jE(r)},scopeMetrics:[{scope:{name:i,version:n},metrics:t}]}]};var t,r,i,n}co(e){const t=kv(Date.now()),r=new Map;for(const o of e.values()){var i;const a=Iv(o.type,o.name,o.unit,void 0);let c=r.get(a);c||(c=S({name:o.name},o.unit&&{unit:o.unit}),o.type==="count"?c.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:o.type==="gauge"?c.gauge={dataPoints:[]}:c.histogram={aggregationTemporality:1,dataPoints:[]},r.set(a,c));const l=Rc((i=o.attributes)!==null&&i!==void 0?i:{},this.A),u=kv(o.windowStartMs);if(o.type==="count"){var n;const p={attributes:l,startTimeUnixNano:u,timeUnixNano:t,asDouble:(n=o.total)!==null&&n!==void 0?n:0};c.sum.dataPoints.push(p)}else if(o.type==="gauge"){var s;const p={attributes:l,timeUnixNano:t,asDouble:(s=o.last)!==null&&s!==void 0?s:0};c.gauge.dataPoints.push(p)}else o.hist&&c.histogram.dataPoints.push({attributes:l,startTimeUnixNano:u,timeUnixNano:t,count:o.hist.count,sum:o.hist.sum,min:o.hist.min,max:o.hist.max,bucketCounts:o.hist.bucketCounts,explicitBounds:Iu})}return Array.from(r.values())}ho(e){for(const[i,n]of e){const s=this.zs.get(i);if(s)switch(s.windowStartMs=Math.min(s.windowStartMs,n.windowStartMs),s.type){case"count":var t,r;s.total=((t=s.total)!==null&&t!==void 0?t:0)+((r=n.total)!==null&&r!==void 0?r:0);break;case"gauge":break;case"histogram":if(n.hist)if(s.hist){s.hist.count+=n.hist.count,s.hist.sum+=n.hist.sum,s.hist.min=Math.min(s.hist.min,n.hist.min),s.hist.max=Math.max(s.hist.max,n.hist.max);for(let o=0;s.hist.bucketCounts.length>o;o++)s.hist.bucketCounts[o]+=n.hist.bucketCounts[o]}else s.hist=n.hist}else this.Ks()&&this.zs.set(i,n)}}},WE=(e,{debugEnabled:t}={})=>{const r={N(i,...n){M&&(ei.DEBUG||M.POSTHOG_DEBUG||t)&&!z(M.console)&&M.console&&("__rrweb_original__"in M.console[i]?M.console[i].__rrweb_original__:M.console[i])(e,...n)},debug(...i){r.N("debug",...i)},info(...i){r.N("log",...i)},warn(...i){r.N("warn",...i)},error(...i){r.N("error",...i)},critical(...i){console.error(e,...i)},uninitializedWarning(i){r.error(`You must initialize PostHog before calling ${i}`)},createLogger:(i,n)=>WE(`${e} ${i}`,n)};return r},Y=WE("[PostHog.js]"),tt=Y.createLogger,Tz=tt("[ExternalScriptsLoader]"),Tc=e=>{const t=G?.querySelectorAll("script");if(t){for(let r=0;t.length>r;r++)if(t[r].src===e||t[r].getAttribute("src")===e)return t[r]}},Qi=(e,t,r)=>{if(e.config.disable_external_dependency_loading)return Tz.warn(`${t} was requested but loading of external scripts is disabled.`),r("Loading of external scripts is disabled");const i=Tc(t);if(i){if(i.__posthog_loading_callback_fired)return r();const s=i.__posthog_loading_error;return s?r(s):(i.addEventListener("load",o=>{i.__posthog_loading_callback_fired=!0,r(void 0,o)}),void i.addEventListener("error",o=>{i.__posthog_loading_error=o,r(o)}))}const n=()=>{if(!G)return r("document not found");if(Tc(t))return Qi(e,t,r);let s=G.createElement("script");if(s.type="text/javascript",s.crossOrigin="anonymous",s.src=t,s.onload=a=>{s.__posthog_loading_callback_fired=!0,r(void 0,a)},s.onerror=a=>{s.__posthog_loading_error=a,r(a)},e.config.prepare_external_dependency_script&&(s=e.config.prepare_external_dependency_script(s)),!s)return r("prepare_external_dependency_script returned null");if(e.config.external_scripts_inject_target==="head")G.head.appendChild(s);else{const a=G.querySelectorAll("body > script");var o;a.length>0?(o=a[0].parentNode)===null||o===void 0||o.insertBefore(s,a[0]):G.body.appendChild(s)}};G?.body?n():G?.addEventListener("DOMContentLoaded",n)},Au={},Av=(e,t)=>{let r=`/static/${t}.js?v=${e.version}`;return t==="toolbar"&&(r=`${r}&t=${Math.floor(Date.now()/3e5)*3e5}`),e.requestRouter.endpointFor("assets",r)};he.__PosthogExtensions__=he.__PosthogExtensions__||{},he.__PosthogExtensions__.loadExternalDependency=(e,t,r)=>{if(t==="remote-config"){const n=e.requestRouter.endpointFor("assets",`/array/${e.config.token}/config.js`);Qi(e,n,r);return}const i=e.config.strict_script_versioning;if(i){const n=e.requestRouter.endpointFor("assets",`/static/${e.version}/${t}.js`),s=Au[n];if(i==="fallback"&&s){if(Tc(s))return void Qi(e,s,r);delete Au[n]}Qi(e,n,i==="fallback"?(o,a)=>{if(o)if(typeof o=="string")r(o);else{var c;const l=Av(e,t);Au[n]=l;const u=Tc(n);u==null||(c=u.parentNode)===null||c===void 0||c.removeChild(u),Qi(e,l,r)}else r(void 0,a)}:r);return}Qi(e,Av(e,t),r)},he.__PosthogExtensions__.loadSiteApp=(e,t,r)=>{const i=e.requestRouter.endpointFor("api",t);Qi(e,i,r)},ei.DEBUG=!1,ei.LIB_VERSION="1.435.3",ei.LIB_NAME="web";var ut=ei,Cz="$people_distinct_id",mr="distinct_id",Tf="$device_id",Ru="$device_model",Cc="__alias",Pz="__cmpns",Rv="$fbc",ls="$fbc_persistence",Tv="$fbp",bo="$fbp_persistence",up="__timers",JE="$autocapture_disabled_server_side",dp="$heatmaps_enabled_server_side",pp="$exception_capture_enabled_server_side",KE="$error_tracking_suppression_rules",hp="$error_tracking_capture_extension_exceptions",fp="$web_vitals_enabled_server_side",Cf="$dead_clicks_enabled_server_side",Pf="$product_tours_enabled_server_side",YE="$logs_capture_enabled_server_side",XE="$web_vitals_allowed_metrics",So="$session_recording_remote_config",Oz="$session_recording_enabled_server_side",xz="$replay_sample_rate",Mz="$replay_override_sampling",Lz="$replay_override_linked_flag",$z="$replay_override_url_trigger",Nz="$replay_override_event_trigger",es="$sesid",ZE="$session_is_sampled",Dz="$session_past_minimum_duration",Uz="$session_recording_url_trigger_activated_session",qz="$session_recording_event_trigger_activated_session",jz="$debug_first_full_snapshot_timestamp",zz="$sess_rec_flush_size",_r="$enabled_feature_flags",Zr="$active_feature_flags",mp="$early_access_features",mn="$feature_flag_details",Si="$feature_flag_payloads",gn="$feature_flag_request_id",wo="$minimal_flag_called_events",Tr="$override_feature_flags",en="$override_feature_flag_payloads",wi="$stored_person_properties",Ei="$stored_group_properties",QE="$groups",lo="$surveys",Pc="$surveys_loaded_at",ek="$surveys_activated",tk="$surveys_activated_session",rk="$surveys_activated_timestamps",gp="ph_product_tours",Fz="$product_tours_activated",Hz="$product_tours_activated_session",Bz="$conversations_widget_session_id",Vz="$conversations_ticket_id",Gz="$conversations_widget_state",Wz="$conversations_user_traits",ki="$flag_call_reported",uo="$flag_call_reported_session_id",qo="$feature_flag_errors",xi="$feature_flag_evaluated_at",zt="$user_state",vp="$client_session_props",Jz="$capture_rate_limit",ik="$initial_campaign_params",nk="$initial_referrer_info",ts="$initial_person_info",Of="$epp",Tu="$posthog_cookieless",sk="$cookieless_mode",ok="$sdk_debug_extensions_init_method",ak="$sdk_debug_extensions_init_time_ms",xf="$sdk_debug_recording_script_not_loaded",Mf="$sdk_debug_replay_stale_config",ck="$sdk_debug_replay_event_trigger_status",lk="$sdk_debug_replay_linked_flag_trigger_status",uk="$sdk_debug_replay_matched_recording_trigger_groups",dk="$sdk_debug_replay_pending_trigger_conditions",pk="$sdk_debug_replay_remote_trigger_matching_config",hk="$sdk_debug_replay_trigger_groups_count",fk="$sdk_debug_replay_url_trigger_status",Kz="$session_recording_start_reason",Lf="PostHog loadExternalDependency extension not found.",Qr="anonymous",tc="identified",mk="identified_only",jo="visibilitychange",Oc="beforeunload",$f="$pageview",Cv="$pageleave",gk="$identify",Pv="$groupidentify";function rs(e,t){_e(e)&&e.forEach(t)}function je(e,t){if(!we(e))if(_e(e))e.forEach(t);else if((r=>r instanceof FormData)(e))e.forEach((r,i)=>t(r,i));else for(const r in e)Ef.call(e,r)&&t(e[r],r)}var Ge=function(e,...t){for(const r of t)for(const i in r)r[i]!==void 0&&(e[i]=r[i]);return e};function rc(e){const t=Object.keys(e);let r=t.length;const i=new Array(r);for(;r--;)i[r]=[t[r],e[t[r]]];return i}var Yz=function(e){return function(...t){try{return e.apply(this,t)}catch(r){Y.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Y.critical(r)}}},Nf=function(e){const t={};return je(e,function(r,i){(Ae(r)&&r.length>0||nt(r))&&(t[i]=r)}),t};function vk(e){const t=S({},e);for(const r of["name","message","stack","cause","errors"])try{r in e&&(t[r]=e[r])}catch{}return t}var Xz=["herokuapp.com","vercel.app","netlify.app"];function Zz(e){const t=e?.hostname;if(!Ae(t))return!1;const r=t.split(".").slice(-2).join(".");for(const i of Xz)if(r===i)return!1;return!0}function Ne(e,t,r,i){const{capture:n=!1,passive:s=!0}=i??{};e?.addEventListener(t,r,{capture:n,passive:s})}function _p(e){return e.name==="ph_toolbar_internal"}var Eo=e=>{if(G){try{const t=e+"=",r=G.cookie.split(";").filter(i=>i.length);for(let i=0;r.length>i;i++){let n=r[i];for(;n.charAt(0)==" ";)n=n.substring(1,n.length);if(n.indexOf(t)===0)return decodeURIComponent(n.substring(t.length,n.length))}}catch{}return null}};Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return nt(e)&&isFinite(e)&&Math.floor(e)===e});var Qz=class yp{constructor(t){if(this.bytes=t,t.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,r,i,n){if(!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(i)||!Number.isInteger(n)||0>t||0>r||0>i||0>n||t>0xffffffffffff||r>4095||i>1073741823||n>4294967295)throw new RangeError("invalid field value");const s=new Uint8Array(16);return s[0]=t/Math.pow(2,40),s[1]=t/Math.pow(2,32),s[2]=t/Math.pow(2,24),s[3]=t/Math.pow(2,16),s[4]=t/256,s[5]=t,s[6]=112|r>>>8,s[7]=r,s[8]=128|i>>>24,s[9]=i>>>16,s[10]=i>>>8,s[11]=i,s[12]=n>>>24,s[13]=n>>>16,s[14]=n>>>8,s[15]=n,new yp(s)}toString(){let t="";for(let r=0;this.bytes.length>r;r++)t=t+(this.bytes[r]>>>4).toString(16)+(15&this.bytes[r]).toString(16),r!==3&&r!==5&&r!==7&&r!==9||(t+="-");if(t.length!==36)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new yp(this.bytes.slice(0))}equals(t){return this.compareTo(t)===0}compareTo(t){for(let r=0;16>r;r++){const i=this.bytes[r]-t.bytes[r];if(i!==0)return Math.sign(i)}return 0}},eF=class{generate(){const e=this.generateOrAbort();if(!z(e))return e;{this.Ct=0;const t=this.generateOrAbort();if(z(t))throw new Error("Could not generate UUID after timestamp reset");return t}}generateOrAbort(){const e=(()=>{const t=Date.now();return nt(t)&&isFinite(t)?Math.min(Math.max(Math.floor(t),0),0xffffffffffff):0})();if(e>this.Ct)this.Ct=e,this.Mt();else{if(this.Ct>=e+1e4)return;this.It++,this.It>4398046511103&&(this.Ct++,this.Mt())}return Qz.fromFieldsV7(this.Ct,Math.trunc(this.It/Math.pow(2,30)),this.It&Math.pow(2,30)-1,this.Tt.nextUint32())}Mt(){this.It=1024*this.Tt.nextUint32()+(1023&this.Tt.nextUint32())}constructor(){this.Ct=0,this.It=0,this.Tt=new tF}},_k=e=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(let t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};M&&!z(M.crypto)&&crypto.getRandomValues&&(_k=e=>crypto.getRandomValues(e));var tF=class{nextUint32(){return this.Rt.length>this.At||(_k(this.Rt),this.At=0),this.Rt[this.At++]}constructor(){this.Rt=new Uint32Array(8),this.At=1/0}},Ov,yr=()=>rF().toString(),rF=()=>(Ov||(Ov=new eF)).generate(),Ys="",iF=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,Dn=null,Xe={Et(){if(!Qe(Dn))return Dn;if(Dn=!1,G)try{const e=`__ph_cookie_support_${yr()}`;Xe.$t(e,"xyz"),Dn=Eo(e)==='"xyz"',Xe.Lt(e)}catch{Dn=!1}return Dn},Pt(e){Y.error("cookieStore error: "+e)},Ot:Eo,Dt(e){let t;try{t=JSON.parse(Xe.Ot(e))||{}}catch{}return t},$t(e,t,r,i,n){if(!G)return!1;try{let s="",o="";const a=(function(l,u){if(u){let p=(function(d,h=G){if(Ys)return Ys;if(!h||["localhost","127.0.0.1"].includes(d))return"";const f=d.split(".");let m=Math.min(f.length,8);const v="dmn_chk_"+yr();for(;!Ys&&m--;){const _=f.slice(m).join("."),b=v+"=1;domain=."+_+";path=/";h.cookie=b+";max-age=3",h.cookie.includes(v)&&(h.cookie=b+";max-age=0",Ys=_)}return Ys})(l);if(!p){const d=(h=>{const f=h.match(iF);return f?f[0]:""})(l);d!==p&&Y.info("Warning: cookie subdomain discovery mismatch",d,p),p=d}return p?"; domain=."+p:""}return""})(G.location.hostname,i);if(r){const l=new Date;l.setTime(l.getTime()+864e5*r),s="; expires="+l.toUTCString()}n&&(o="; secure");const c=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+a+o;return c.length>3686.4&&Y.warn("cookieStore warning: large cookie, len="+c.length),G.cookie=c,!0}catch{return!1}},Lt(e,t){if(G?.cookie&&(!t||!Qe(Eo(e))))try{Xe.$t(e,"",-1,t)}catch{return}}},Cu=null,Me={Et(){if(!Qe(Cu))return Cu;let e=!0;if(z(M))e=!1;else try{const t="__mplssupport__";Me.$t(t,"xyz"),Me.Ot(t)!=='"xyz"'&&(e=!1),Me.Lt(t)}catch{e=!1}return e||Y.error("localStorage unsupported; falling back to cookie store"),Cu=e,e},Pt(e){Y.error("localStorage error: "+e)},Ot(e){try{return M?.localStorage.getItem(e)}catch(t){Me.Pt(t)}return null},Dt(e){try{return JSON.parse(Me.Ot(e))||{}}catch{}return null},$t(e,t){try{return M?.localStorage.setItem(e,JSON.stringify(t)),!0}catch(r){Me.Pt(r)}return!1},Lt(e){try{M?.localStorage.removeItem(e)}catch(t){Me.Pt(t)}}},Pu=[wi,Zr,_r,mn,Si,gn,xi,qo,ki],tn=[Tf,mr,es,ZE,Of,ts,ls,zt],xc=e=>e+"_cpm",nF=["__proto__","constructor","prototype"],Ou=e=>{if(!Pe(e))return{};const t={};return Object.keys(e).forEach(r=>{nF.indexOf(r)===-1&&(t[r]=e[r])}),t},xu=(e,t=[])=>{const r={};return[...tn,...t].forEach(i=>{const n=e[i];z(n)||Qe(n)||n===""||(r[i]=n)}),r},yk=e=>{let t=5381,r=2166136261;for(let i=0;e.length>i;i++){const n=e.charCodeAt(i);t=33*t^n,r=Math.imul(r^n,16777619)}return e.length.toString(36)+"."+(t>>>0).toString(36)+"."+(r>>>0).toString(36)},xv=(e,t)=>({p:t,f:yk(JSON.stringify(e))}),Mv=(e,t)=>{if(!t)return{properties:[],isValid:!1};try{const r=Xe.Dt(xc(e)),i=r?.f===yk(t)&&_e(r.p);return{properties:i?r.p:[],isValid:i}}catch{return{properties:[],isValid:!1}}},Mu=(e,t)=>t+"|"+(Xe.Ot(xc(e))||""),Un={},bp={Et:()=>!0,Pt(e){Y.error("memoryStorage error: "+e)},Ot:e=>e in Un?Un[e]:null,Dt:e=>e in Un?Un[e]:null,$t:(e,t)=>(Un[e]=t,!0),Lt(e){delete Un[e]}},Vi=null,Be={Et(){if(!Qe(Vi))return Vi;if(Vi=!0,z(M))Vi=!1;else try{const e="__support__";Be.$t(e,"xyz"),Be.Ot(e)!=='"xyz"'&&(Vi=!1),Be.Lt(e)}catch{Vi=!1}return Vi},Pt(e){Y.error("sessionStorage error: ",e)},Ot(e){try{return M?.sessionStorage.getItem(e)}catch(t){Be.Pt(t)}return null},Dt(e){try{return JSON.parse(Be.Ot(e))||null}catch{}return null},$t(e,t){try{return M?.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(r){Be.Pt(r)}return!1},Lt(e){try{M?.sessionStorage.removeItem(e)}catch(t){Be.Pt(t)}}},sF=class{constructor(e){this._instance=e}get Ir(){return this._instance.config}get consent(){return this.Do()?0:this.Lo}isOptedOut(){return this.Ir.cookieless_mode==="always"||this.isRejected()||this.consent===-1&&this.Ir.cookieless_mode==="on_reject"}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Ir.opt_out_capturing_by_default}optInOut(e){this.No.$t(this.qo,e?1:0,this.Ir.cookie_expiration,this.Ir.cross_subdomain_cookie,this.Ir.secure_cookie)}reset(){this.No.Lt(this.qo,this.Ir.cross_subdomain_cookie)}get qo(){const{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:r}=this._instance.config;return r||(t?t+e:"__ph_opt_in_out_"+e)}get Lo(){const e=this.No.Ot(this.qo);return _u(e)?1:ve(Pj,e)?0:-1}get No(){const e=this.Ir.opt_out_capturing_persistence_type,t=e==="localStorage"?Me:Xe,r=t.Et()?t:bp;if(!this.jo||this.jo!==r){this.jo=r;const i=e==="localStorage"?Xe:Me;i.Ot(this.qo)&&(this.jo.Ot(this.qo)||this.optInOut(_u(i.Ot(this.qo))),i.Lt(this.qo,this.Ir.cross_subdomain_cookie))}return this.jo}Do(){return!!this.Ir.respect_dnt&&[vt?.doNotTrack,vt?.msDoNotTrack,he.doNotTrack,vt?.globalPrivacyControl].some(e=>_u(e))}};function bk(e,t){var r;const i=e==null||(r=e.config)===null||r===void 0?void 0:r.get_current_url;if(!gt(i))return t;try{const n=i(t);return Ae(n)&&n?n:t}catch(n){return Y.error("Error in get_current_url, falling back to window.location.href",n),t}}function Lv(e){var t;return e instanceof Element&&(e.id==="__POSTHOG_TOOLBAR__"||!!(!((t=e.closest)===null||t===void 0)&&t.call(e,".toolbar-global-fade-container")))}function jr(e){return!!e&&e.nodeType===1}function Pt(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Sk(e){return!!e&&e.nodeType===3}function Df(e){return!!e&&e.nodeType===11&&jr(e.host)}function Uf(e){return e?$l(e).split(/\s+/):[]}function $v(e,t){const r=(function(i){var n;const s=M==null||(n=M.location)===null||n===void 0?void 0:n.href;return z(s)?void 0:bk(i,s)})(t);return!!(r&&e&&e.some(i=>r.match(i)))}function Ss(e){let t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return Uf(t)}function wk(e){return we(e)?null:$l(e).split(/(\s+)/).filter(t=>Io(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function zo(e){let t="";return us(e)&&!Fo(e)&&e.childNodes&&e.childNodes.length&&je(e.childNodes,function(r){var i;Sk(r)&&r.textContent&&(t+=(i=wk(r.textContent))!==null&&i!==void 0?i:"")}),$l(t)}function ko(e){var t;return z(e.target)?e.srcElement||null:!((t=e.target)===null||t===void 0)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var qf=["a","button","form","input","select","textarea","label"];function Sp(e,t){const r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!r&&r.call(e,t)}catch{return!1}}function wp(e,t){if(z(t))return!0;for(const r of e)if(t.some(i=>Sp(r,i)))return!0;return!1}function Ek(e){const t=e.parentNode;return!(!t||!jr(t))&&t}var Lu=[".ph-no-autocapture","[data-ph-no-autocapture]"],kk=["next","previous","prev",">","<"],oF=[...kk,"+","-","−","–"],Nv=(e,t)=>/[a-z0-9]/i.test(t)?e.includes(t):e===t,Dv=[".ph-no-rageclick",".ph-no-capture"],aF=["","text","search","email","password","url","tel","number"];function Ik(e,t){if(!M||jf(e))return!1;let r,i,n;var s,o;if(Ft(t)?(r=!!t&&Dv,i=void 0,n=!1):(r=(s=t?.css_selector_ignorelist)!==null&&s!==void 0?s:Dv,i=t?.content_ignorelist,n=(o=t?.ignore_text_selection)!==null&&o!==void 0&&o),r===!1||n&&(function(c){return!(!c||!jr(c))&&(!!Pt(c,"textarea")||(Pt(c,"input")?ve(aF,(c.getAttribute("type")||"").toLowerCase()):(function(l){var u;if(l.isContentEditable)return!0;const p=(u=l.getAttribute)===null||u===void 0?void 0:u.call(l,"contenteditable");return p==="true"||p===""})(c)))})(e))return!1;const{targetElementList:a}=Ak(e,!1);return!(function(c,l){if(c===!1||z(c))return!1;let u;if(c===!0)u=kk;else{if(!_e(c))return!1;if(c.length>10)return Y.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;u=c.map(p=>p.toLowerCase())}return l.some(({safeText:p,ariaLabel:d})=>u.some(h=>Nv(p,h)||Nv(d,h)))})(i,a.map(c=>{var l;return{safeText:zo(c).toLowerCase(),ariaLabel:((l=c.getAttribute("aria-label"))===null||l===void 0?void 0:l.toLowerCase().trim())||""}}))&&!wp(a,r)}var jf=e=>!e||Pt(e,"html")||!jr(e),Ak=(e,t)=>{if(!M||jf(e))return{parentIsUsefulElement:!1,targetElementList:[]};let r=!1;const i=[e];let n=e;for(;n.parentNode&&!Pt(n,"body");){if(Df(n.parentNode)){i.push(n.parentNode.host),n=n.parentNode.host;continue}const s=Ek(n);if(!s)break;if(t||qf.indexOf(s.tagName.toLowerCase())>-1)r=!0;else try{const o=M.getComputedStyle(s);o&&o.getPropertyValue("cursor")==="pointer"&&(r=!0)}catch{}i.push(s),n=s}return{parentIsUsefulElement:r,targetElementList:i}};function us(e){const t=new Set;let r=0;for(let s=e;s.parentNode&&!Pt(s,"body");s=s.parentNode){if(r++>=1e3||t.has(s))return!1;t.add(s);const o=Ss(s);if(ve(o,"ph-sensitive")||ve(o,"ph-no-capture"))return!1}if(ve(Ss(e),"ph-include"))return!0;const i=e.type||"";if(Ae(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}const n=e.name||e.id||"";return!Ae(n)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,""))}function Fo(e){return!!(Pt(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Pt(e,"select")||Pt(e,"textarea")||e.getAttribute("contenteditable")==="true")}var Uv=new RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),qv=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,cF=[16,15,14,13],lF=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),jv=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),zv=/[0-9A-Za-z_]/;function uF(e){let t=0,r=!1;for(let i=e.length-1;i>=0;i--){let n=e.charCodeAt(i)-48;r&&(n*=2,n>9&&(n-=9)),t+=n,r=!r}return t%10==0}function Io(e,t=!0){return!(we(e)||Ae(e)&&(e=$l(e),(t?Uv.test((e||"").replace(/[- ]/g,"")):(function(r){let i;for(qv.lastIndex=0;i=qv.exec(r);){const n=i[2];if(!n)continue;const s=n.replace(/[- ]/g,"");for(let o=0;s.length>o;o++)for(const a of cF){const c=o+a;if(s.length>=c){const l=s.slice(o,c);if(Uv.test(l)&&uF(l))return!0}}}return!1})(e))||(t?lF.test(e):(function(r){let i;for(jv.lastIndex=0;i=jv.exec(r);){const n=i[1],s=i[3];if(!(n&&s&&zv.test(n)&&zv.test(s)))return!0}return!1})(e))))}function Fv(e){let t=zo(e);return t=`${t} ${Rk(e)}`.trim(),Io(t)?t:""}function Rk(e){let t="";return e&&e.childNodes&&e.childNodes.length&&je(e.childNodes,function(r){var i;if(r&&((i=r.tagName)===null||i===void 0?void 0:i.toLowerCase())==="span")try{const n=zo(r);t=`${t} ${n}`.trim(),r.childNodes&&r.childNodes.length&&(t=`${t} ${Rk(r)}`.trim())}catch(n){Y.error("[AutoCapture]",n)}}),t}function Hv(e){return e.replace(/"|\\"/g,'\\"')}function dF(e){const t=e.attr__class;if(t)return _e(t)?t:Uf(t)}var xa=tt("[Dead Clicks]"),pF=()=>!0,hF=e=>{var t;const r=!!(!((t=e.instance.persistence)===null||t===void 0)&&t.get_property(Cf)),i=e.instance.config.capture_dead_clicks;return Ft(i)?i:!!Pe(i)||r},Bv=class{get lazyLoadedDeadClicksAutocapture(){return this.Bo}constructor(e,t,r){this.instance=e,this.isEnabled=t,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(e){if(!e.ok)return;const t=e.config;"captureDeadClicks"in t&&(this.instance.persistence&&this.instance.persistence.register({[Cf]:t.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.Ho(()=>{this.zo()}):this.stop()}Ho(e){var t,r,i;!((t=he.__PosthogExtensions__)===null||t===void 0)&&t.initDeadClicksAutocapture?e():(r=he.__PosthogExtensions__)===null||r===void 0||(i=r.loadExternalDependency)===null||i===void 0||i.call(r,this.instance,"dead-clicks-autocapture",n=>{n?xa.error("failed to load script",n):e()})}zo(){var e;if(G){if(!this.Bo&&(!((e=he.__PosthogExtensions__)===null||e===void 0)&&e.initDeadClicksAutocapture)){const t=Pe(this.instance.config.capture_dead_clicks)?S({},this.instance.config.capture_dead_clicks):{};t.__onCapture=this.onCapture,this.onCapture&&(t.capture_dead_swipes=!1),this.Bo=he.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.Bo.start(G),xa.info("starting...")}}else xa.error("`document` not found. Cannot start.")}stop(){this.Bo&&(this.Bo.stop(),this.Bo=void 0,xa.info("stopping..."))}},Xs=tt("[SegmentIntegration]");function Vv(e,t,r=!0){const i=e.config.segment;if(!i)return t();const{analytics:n,filterProperties:s}=(a=>gt(a.register))(o=i)?{analytics:o}:o;var o;(function(a,c,l,u){const p=h=>{const f=()=>h.anonymousId()||yr();a.config.get_device_id=f,u&&h.id()&&(a.register({distinct_id:h.id(),$device_id:f()}),a.persistence.set_property(zt,tc)),l(u?void 0:h.anonymousId()||void 0)},d=c.user();"then"in d&&gt(d.then)?d.then(p):p(d)})(e,n,a=>{n.register(((c,l,{filterProperties:u}={})=>{typeof Promise<"u"&&Promise.resolve||Xs.warn("This browser does not have Promise support, and can not use the segment integration");const p=(d,h)=>{if(!h)return d;const f=!!l&&d.event.anonymousId===l&&!d.event.userId;f||d.event.userId||d.event.anonymousId===c.get_distinct_id()||(Xs.info("No userId set, resetting PostHog"),c.reset()),f||(l=void 0),d.event.userId&&d.event.userId!==c.get_distinct_id()&&(Xs.info("UserId set, identifying with PostHog"),c.identify(d.event.userId));let m=c.calculateEventProperties(h,d.event.properties);if(!we(u)){const v=d.event.properties||{},_={};for(const A of Object.keys(m))Ef.call(v,A)||(_[A]=m[A]);const b=((A,P)=>{const D=_e(A)?A:[A];let $=S({},P);for(const q of D)try{if($=q($),we($))return null}catch(j){return Xs.error("Error in Segment filterProperties:",j),null}return $})(u,_);if(we(b))return d;m=b}return d.event.properties=Object.assign({},m,d.event.properties),d};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded(){return!0},load(){return Promise.resolve()},track(d){return p(d,d.event.event)},page(d){return p(d,$f)},identify(d){return p(d,gk)},screen(d){return p(d,"$screen")}}})(e,a,{filterProperties:s})).then(()=>{t()},c=>{Xs.error("Failed to register the Segment integration",c),t()})},r)}var Tk="posthog-js";function Ck(e,{organization:t,projectId:r,prefix:i,severityAllowList:n=["error"],sendExceptionsToPostHog:s=!0}={}){return o=>{var a,c,l,u,p;if(n!=="*"&&!n.includes(o.level)||!e.__loaded)return o;o.tags||(o.tags={});const d=e.requestRouter.endpointFor("ui",`/project/${e.config.token}/person/${e.get_distinct_id()}`);o.tags["PostHog Person URL"]=d,e.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));const h=((a=o.exception)===null||a===void 0?void 0:a.values)||[],f=h.map(_=>S(S({},_),{},{stacktrace:_.stacktrace?S(S({},_.stacktrace),{},{type:"raw",frames:(_.stacktrace.frames||[]).map(b=>S(S({},b),{},{platform:"web:javascript"}))}):void 0})),m={$exception_message:((c=h[0])===null||c===void 0?void 0:c.value)||o.message,$exception_type:(l=h[0])===null||l===void 0?void 0:l.type,$exception_level:o.level,$exception_list:f,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:((u=h[0])===null||u===void 0?void 0:u.value)||o.message,$sentry_exception_type:(p=h[0])===null||p===void 0?void 0:p.type,$sentry_tags:o.tags};var v;return t&&r&&(m.$sentry_url=(i||"https://sentry.io/organizations/")+t+"/issues/?project="+r+"&query="+o.event_id),s&&((v=e.exceptions)===null||v===void 0||v.sendExceptionEvent(m)),o}}var fF=class{constructor(e,t,r,i,n,s){this.name=Tk,this.setupOnce=function(o){o(Ck(e,{organization:t,projectId:r,prefix:i,severityAllowList:n,sendExceptionsToPostHog:s==null||s}))}}},Gv=class{constructor(e){this.Uo=(t,r,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(Y.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:i}),this.Wo=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Vo()}Vo(){var e;this.Go=(e=this._instance.sessionManager)===null||e===void 0?void 0:e.onSessionId(this.Uo)}destroy(){var e;(e=this.Go)===null||e===void 0||e.call(this),this.Go=void 0}doPageView(e,t){var r;const i=this.Zo(e,t);return this.Wo={pathname:(r=M?.location.pathname)!==null&&r!==void 0?r:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),i}doPageLeave(e){var t;return this.Zo(e,(t=this.Wo)===null||t===void 0?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Wo)===null||e===void 0?void 0:e.pageViewId}}Zo(e,t){const r=this.Wo;if(!r)return{$pageview_id:t};let i={$pageview_id:t,$prev_pageview_id:r.pageViewId};const n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){let{maxScrollHeight:s,lastScrollY:o,maxScrollY:a,maxContentHeight:c,lastContentY:l,maxContentY:u}=n;if(!(z(s)||z(o)||z(a)||z(c)||z(l)||z(u))){s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),c=Math.ceil(c),l=Math.ceil(l),u=Math.ceil(u);const p=s>1?Lr(o/s,0,1,Y):1,d=s>1?Lr(a/s,0,1,Y):1,h=c>1?Lr(l/c,0,1,Y):1,f=c>1?Lr(u/c,0,1,Y):1;i=Ge(i,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:p,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:l,$prev_pageview_last_content_percentage:h,$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:f})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),i}},Zs=["flags","surveys"],mF={[Cz]:{exposure:"hidden"},[Cc]:{exposure:"hidden"},[Pz]:{exposure:"hidden"},[up]:{exposure:"hidden"},[ls]:{exposure:"hidden"},[bo]:{exposure:"hidden"},[JE]:{exposure:"event"},[dp]:{exposure:"hidden"},[YE]:{exposure:"hidden"},[pp]:{exposure:"event"},[KE]:{exposure:"hidden"},[hp]:{exposure:"event"},[fp]:{exposure:"event"},[Cf]:{exposure:"event"},[Pf]:{exposure:"hidden"},[XE]:{exposure:"event"},[So]:{exposure:"hidden"},[Oz]:{exposure:"hidden"},[es]:{exposure:"hidden"},[ZE]:{exposure:"event"},[xz]:{exposure:"event",shouldSkipFromEventProperties:e=>Qe(e)},[Dz]:{exposure:"event"},[Uz]:{exposure:"event"},[qz]:{exposure:"event"},[jz]:{exposure:"event"},[zz]:{exposure:"hidden"},[_r]:{exposure:"hidden",storageGroup:"flags"},[Zr]:{exposure:"hidden",storageGroup:"flags"},[mp]:{exposure:"hidden"},[mn]:{exposure:"hidden",storageGroup:"flags"},[Si]:{exposure:"hidden",storageGroup:"flags"},[gn]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[wo]:{exposure:"hidden",storageGroup:"flags"},[Tr]:{exposure:"hidden"},[en]:{exposure:"hidden"},[wi]:{exposure:"hidden"},[Ei]:{exposure:"hidden"},[lo]:{exposure:"hidden",storageGroup:"surveys"},[Pc]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[ek]:{exposure:"event"},[tk]:{exposure:"hidden"},[rk]:{exposure:"hidden"},[gp]:{exposure:"hidden"},[Fz]:{exposure:"hidden"},[Hz]:{exposure:"hidden"},[Bz]:{exposure:"event"},[Vz]:{exposure:"event"},[Gz]:{exposure:"event"},[Wz]:{exposure:"event"},[ki]:{exposure:"hidden"},[uo]:{exposure:"hidden"},[QE]:{exposure:"event"},[qo]:{exposure:"hidden"},[xi]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[zt]:{exposure:"hidden"},[vp]:{exposure:"hidden"},[Jz]:{exposure:"hidden"},[ik]:{exposure:"hidden"},[nk]:{exposure:"hidden"},[ts]:{exposure:"hidden"},[Of]:{exposure:"hidden"},[Mz]:{exposure:"event"},[Lz]:{exposure:"event"},[$z]:{exposure:"event"},[Nz]:{exposure:"event"},[ok]:{exposure:"event"},[ak]:{exposure:"event"},[xf]:{exposure:"hidden"},[Mf]:{exposure:"hidden"},[ck]:{exposure:"hidden"},[lk]:{exposure:"hidden"},[uk]:{exposure:"hidden"},[dk]:{exposure:"hidden"},[pk]:{exposure:"hidden"},[hk]:{exposure:"hidden"},[fk]:{exposure:"hidden"},[Kz]:{exposure:"event"}},gF=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],At=e=>{const t=mF[e];if(t)return t;for(const[r,i]of gF)if(e.indexOf(r)===0)return i},is=(e,t)=>{try{let r;return JSON.stringify(e,(i,n)=>{var s;return Ns(n)?((s=r)!==null&&s!==void 0||(r=new WeakMap),r.has(n)||r.set(n,vk(n)),r.get(n)):typeof n=="bigint"?n.toString():n},t)}catch{return Kw(e)}},si=e=>{const t=G?.createElement("a");return z(t)?null:(t.href=e,t)},ws=function(e,t){const r=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&");let i;for(let n=0;r.length>n;n++){const s=r[n].split("=");if(s[0]===t){i=s;break}}if(!_e(i)||2>i.length)return"";{let n=i[1];try{n=decodeURIComponent(n)}catch{Y.error("Skipping decoding for malformed query param: "+n)}return n.replace(/\+/g," ")}},Ho=function(e,t,r){if(!e||!t||!t.length)return e;const i=e.split("#"),n=i[1],s=(i[0]||"").split("?"),o=s[1],a=s[0],c=(o||"").split("&"),l=[];for(let p=0;c.length>p;p++){const d=c[p].split("=");_e(d)&&(t.includes(d[0])?l.push(d[0]+"="+r):l.push(c[p]))}let u=a;return o!=null&&(u+="?"+l.join("&")),n!=null&&(u+="#"+n),u},Mc=function(e,t){const r=e.match(new RegExp(t+"=([^&]*)"));return r?r[1]:null},Pk=(e,t)=>e>=t&&Jw(),Ok=(e,t,r,i)=>{if(e===0){if(Jw()){const n=t+1;return n===r&&i(),n}return t}return 0},Es=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],vF=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Es],Bo="<masked>",_F=["li_fat_id"];function xk(e,t,r){if(!G)return{};const i=t?[...Es,...r||[]]:[],n=Mk(Ho(G.URL,i,Bo),e),s=(function(){const o={};return je(_F,function(a){const c=Eo(a);o[a]=c||null}),o})();return Ge(s,n)}function Mk(e,t){const r=vF.concat(t||[]),i={};return je(r,function(n){const s=ws(e,n);i[n]=s||null}),i}function Lk(e){const t=(function(n){return n?n.search("https?://(.*)google.([^/?]*)")===0?"google":n.search("https?://(.*)bing.com")===0?"bing":n.search("https?://(.*)yahoo.com")===0?"yahoo":n.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null:null})(e),r=t!="yahoo"?"q":"p",i={};if(!Qe(t)){i.$search_engine=t;const n=G?ws(G.referrer,r):"";n.length&&(i.ph_keyword=n)}return i}function $k(){return navigator.language||navigator.userLanguage}function yF(){const e=$k();return typeof e=="string"?e.split("-")[0]:void 0}var Lc="$direct";function Nk(){return G?.referrer||Lc}function Dk(e,t,r=!1){const i=e?[...Es,...t||[]]:[],n=r?qi(Ze?.href):Ze?.href,s=n?.substring(0,1e3);return{r:Nk().substring(0,1e3),u:s?Ho(s,i,Bo):void 0}}function Uk(e,t=!1){var r;const{r:i,u:n}=e,s=t?qi(n):n,o={$referrer:i,$referring_domain:i==null?void 0:i==Lc?Lc:(r=si(i))===null||r===void 0?void 0:r.host};if(s){o.$current_url=s;const a=si(s);o.$host=a?.host,o.$pathname=a?.pathname;const c=Mk(s);Ge(o,c)}if(i){const a=Lk(i);Ge(o,a)}return o}function qk(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function bF(){try{return new Date().getTimezoneOffset()}catch{return}}var SF={flags:xi,surveys:Pc},wF=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Ma=e=>`${e}_cookie_identity_change_pending`,La=e=>{let t="",r=0;for(const i of e){const n=encodeURIComponent(JSON.stringify(i).slice(1,-1)).length;if(r+n>1e3)break;t+=i,r+=n}return t},lt="main",Yr=[_r,Zr,mn,Si,gn,xi,wo,wi],$u=e=>Yr.indexOf(e)!==-1,jk=[ls,bo],Wv=e=>jk.indexOf(e)!==-1,ui=(e,t)=>{try{return JSON.stringify(e)===JSON.stringify(t)}catch{return e===t}},qn=e=>{if(!e)return{};const t=JSON.parse(e);return Pe(t)?t:{}},Jv=(e,t)=>{je(e,(r,i)=>{const n=At(i);n&&n.exposure!=="event"||{}.hasOwnProperty.call(t,i)||delete e[i]})},Nu=class{constructor(e,t,r=!0){if(this.Qo={},this.Jo=!1,this.Ko=!1,this.Xo=!1,this.Yo=!1,this.ta=!1,this.ea=new Map,this.ia=!1,this.na=!1,this.sa=!1,this.ra=new Set,this.oa=new Set,this.Ir=e,this.aa=r,this.props={},this.la=void 0,this.ua=(i=>{let n="";return i.token&&(n=i.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),i.persistence_name?"ph_"+i.persistence_name:"ph_"+n+"_posthog"})(e),this.hi=e.disable_persistence||!!t,this.No=this.ha(e),this.Xo=this.ca(e),this.load(),this.da(),e.debug&&Y.info("Persistence loaded",e.persistence,S({},this.props)),this.update_config(e,e,t),this.save(),M){const i=()=>this.flush();Ne(M,"beforeunload",i,{capture:!1}),Ne(M,"pagehide",i,{capture:!1}),this.va=n=>{if(this.Jo&&(!n.storageArea||n.storageArea===M?.localStorage)&&n.key)if(n.key!==this.ua){if(this.Xo){const s=Zs.find(o=>n.key===this.fa(o));s&&this.pa(n.key,s)}}else this.pa(n.key,lt)},Ne(M,"storage",this.va)}}markCrossTabFeatureFlagChanges(e){Object.entries(e).forEach(([t,r])=>{const i=this.ea.get(t);if(!$u(t)||i===!0)return;if(r===!0)return void this.ga(t,!0);const n=new Set(i||[]);r.forEach(s=>n.add(s)),n.size&&this.ga(t,n)})}onCrossTabFeatureFlagChange(e){return this.oa.add(e),()=>this.oa.delete(e)}destroy(){this.va&&M&&(M.removeEventListener("storage",this.va),this.va=void 0),this.oa.clear()}pa(e,t,r=!0){if(this.hi)return!1;let i,n;try{if(n=Me.Ot(e),Qe(n)){const a=this.ma(t);return a.storageValue=null,t!==lt&&(a.persisted=!1),!1}i=qn(n)}catch{return!1}const s=t===lt?i:Me.Dt(this.ua);if(s&&this.ya(s))return!1;const o=this.ba(i,t,r);return t===lt&&this.Xo&&!ui(this._a().main,i)||this.wa(i,t,!0,n),o}ya(e){const t=this.props[mr],r=e[mr];return!z(t)&&!z(r)&&t!==r}wa(e,t,r,i){const n=this.ma(t);n.storageValue=i,t!==lt&&(n.persisted=r);try{n.fingerprint=this.ka(e,t)}catch{n.fingerprint=void 0}}ba(e,t,r){let i=!1;return Yr.forEach(n=>{var s;const o=(s=At(n))===null||s===void 0?void 0:s.storageGroup;if(t===lt&&this.Xo&&o||t!==lt&&o!==t)return;const a=n in e,c=this.Sa(n,a?e[n]:void 0),l=this.ea.has(n)?n in this.props:a;l===n in this.props&&ui(c,this.props[n])||(l?this.xa(n,c,!1):this.Ca(n,!1),i=!0)}),i&&r&&this.oa.forEach(n=>n()),i}$a(){if(!this.Jo)return!1;try{this.sa=!1;const e=Me.Ot(this.ua),t=this.ma(lt);let r,i=!1,n=!1;if(e!==t.storageValue)if(Qe(e))t.storageValue=null;else{if(r=qn(e),this.sa=!this.na&&this.ya(r),this.sa)return!1;n=this.ba(r,lt,!1),!this.Xo||ui(this._a().main,r)?this.wa(r,lt,!0,e):t.storageValue=e,i=!0}return this.Xo&&Zs.forEach(s=>{const o=Me.Ot(this.fa(s)),a=this.ma(s),c=r||{},l=i&&Yr.some(p=>{var d;return((d=At(p))===null||d===void 0?void 0:d.storageGroup)===s&&p in c});if(o===a.storageValue&&!l)return;if(Qe(o))return a.storageValue=null,a.persisted=!1,void(l&&(n=this.ba(c,s,!1)||n));const u=qn(o);n=this.ba(u,s,!1)||n,this.wa(u,s,!0,o)}),n}catch{return!1}}ga(e,t){this.ea.set(e,t);const r=At(e);r!=null&&r.volatile||(this.ma((this.Xo?r?.storageGroup:void 0)||lt).fingerprint=void 0,this.Ta(e))}Ia(){Yr.forEach(e=>this.ea.set(e,!0))}da(){if(this.Jo)try{const e=Me.Ot(this.ua),t=qn(e);this.ma(lt).storageValue=e,Yr.forEach(r=>{var i;const n=this.Xo?(i=At(r))===null||i===void 0?void 0:i.storageGroup:void 0,s=n?Me.Ot(this.fa(n)):null;if(n){const a=this.ma(n);a.storageValue=s,a.persisted=!Qe(s)}const o=n&&!Qe(s)?qn(s):t;r in this.props?this.Ma(r,o[r],this.props[r]):r in o&&this.ga(r,!0)})}catch{}}Sa(e,t){const r=this.ea.get(e);if(!r)return t;if(r===!0)return this.props[e];if(e==="$active_feature_flags"){const s=new Set(_e(t)?t:[]),o=new Set(_e(this.props[e])?this.props[e]:[]);return r.forEach(a=>o.has(a)?s.add(a):s.delete(a)),Array.from(s)}const i=Pe(t)?S({},t):{},n=Pe(this.props[e])?this.props[e]:{};return r.forEach(s=>{s in n?i[s]=n[s]:delete i[s]}),i}Ma(e,t,r){if(!$u(e))return;const i=this.ea.get(e);if(i===!0)return;let n=t;if(this.Jo)try{var s;const a=this.Xo?(s=At(e))===null||s===void 0?void 0:s.storageGroup:void 0,c=a?this.fa(a):this.ua;n=qn(Me.Ot(c))[e]}catch{}const o=new Set(i||[]);if(e==="$active_feature_flags"){if(!z(t)&&!_e(t)||!z(n)&&!_e(n)||!_e(r))return void this.ga(e,!0);const a=new Set(t||[]),c=new Set(n||[]),l=new Set(r);new Set([...a,...l]).forEach(u=>{a.has(u)!==l.has(u)&&o.add(u)}),o.forEach(u=>{c.has(u)===l.has(u)&&o.delete(u)})}else{if(!Pe(r))return void(ui(n,r)?this.ea.delete(e):this.ga(e,!0));{if(!z(t)&&!Pe(t)||z(t)&&Kt(r)&&z(n))return void this.ga(e,!0);const a=Pe(t)?t:{},c=Pe(n)?n:{};new Set([...Object.keys(a),...Object.keys(r)]).forEach(l=>{l in a==l in r&&ui(a[l],r[l])||o.add(l)}),o.forEach(l=>{l in c==l in r&&ui(c[l],r[l])&&o.delete(l)})}}o.size?this.ga(e,o):this.ea.delete(e)}Ea(){var e;const t=(e=this.Ir)===null||e===void 0?void 0:e.persistence_save_debounce_ms;return nt(t)&&t>0?t:0}Pa(e){if(this.Ir.cookieWinsOnConflict&&this.Ir.persistence.toLowerCase()==="localstorage+cookie")if(e)try{const t=xu(e,this.Ir.cookie_persisted_properties||[]),r=xv(t,this.Ir.cookie_persisted_properties||[]),i=JSON.stringify(t)+"|"+JSON.stringify(r),n=Xe.Ot(this.ua)||void 0;n&&Mu(this.ua,n)===i&&(this.Ra=i,this.Aa=n)}catch{}else try{const t=Xe.Ot(this.ua)||void 0;this.Ra=t?Mu(this.ua,t):void 0,this.Aa=t}catch{}}syncCookieProperties(){return this.Fa(this.Ir)}Fa(e,t=!1){if(this.hi&&!t||this.ta||!e.cookieWinsOnConflict||e.persistence.toLowerCase()!=="localstorage+cookie")return!1;let r;try{r=Xe.Ot(this.ua)||void 0}catch{}if(!r||r===this.Aa)return!1;const i=Mu(this.ua,r);let n;try{n=Ou(JSON.parse(r))}catch{return!1}if((Xe.Ot(this.ua)||void 0)!==r)return!1;this.Ra=i,this.Aa=r;const s=Mv(this.ua,r),o=[...tn,...s.properties],a={};if(Object.keys(n).forEach(m=>{const v=n[m];(z(v)||Qe(v)||v===""||m==="$user_state"&&v!=="anonymous"&&v!=="identified")&&(a[m]=!0,delete n[m])}),Kt(n))return!1;const c="distinct_id"in n||n.$user_state==="anonymous"||n.$user_state==="identified",l=this.props,u=l[mr],p=l[zt],d=Ge({},l);[...tn,...e.cookie_persisted_properties||[]].forEach(m=>{if(o.indexOf(m)!==-1&&!(m in n)&&!a[m]&&(c||m!=="distinct_id"&&m!=="$user_state")){const v=d[m];(s.isValid||tn.indexOf(m)===-1||v!==!1&&v!==0)&&delete d[m]}}),this.props=Ge(d,n),Yr.forEach(m=>{const v=m in this.props;m in l===v&&ui(l[m],this.props[m])||(v?this.Ma(m,l[m],this.props[m]):this.ga(m,!0))}),!c||"$user_state"in n||"$user_state"in this.props||this.xa(zt,Qr);const h=this.props[mr],f=this.props[zt];return!c||h===u&&f===p||(this.na=!0,this.Yo=!0,Be.$t(Ma(this.ua),!0),this.Ca(wi),this.Ca(Zr),this.Ca(_r),this.Ca(mn),this.Ca(Si),this.Ca(gn),this.Ca(xi),this.Ca(qo),this.Ca(ki),f!=="anonymous"||p!=="identified"&&n.$user_state!=="anonymous"&&(z(u)||h===u)||(Jv(this.props,n),this.Ca(Ei)),f==="identified"?this.props.$user_id=h:delete this.props.$user_id,this.Ca(Cc)),!0}consumeCookieIdentityChange(){const e=Ma(this.ua),t=this.Yo||!!Be.Ot(e);return this.Yo=!1,t&&Be.Lt(e),t}Oa(e=!1){return!(this.ta||this.hi&&!e||!this.Ir.cookieWinsOnConflict||this.Ir.persistence.toLowerCase()!=="localstorage+cookie"||(this.ta=!0,0))}Da(){this.ta&&(z(this.La)||(clearTimeout(this.La),this.La=void 0),delete this.Qo[lt],this.Na(!0))}qa(e=!0){if(this.ta)try{e?this.Da():z(this.La)||(clearTimeout(this.La),this.La=void 0)}finally{this.ta=!1}}isDisabled(){return!!this.hi}ha(e){wF.indexOf(e.persistence.toLowerCase())===-1&&(Y.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");const t=((o=[],a=!1)=>{const c=[...tn,...o];return S(S({},Me),{},{Dt(l){try{let p,d={};try{p=Xe.Ot(l)||void 0,d=p?Ou(JSON.parse(p)):{}}catch{}const h=JSON.parse(Me.Ot(l)||"{}");let f;if(a){const m=Mv(l,p),v=[...tn,...m.properties],_={};Object.keys(d).forEach(A=>{const P=d[A];Qe(P)||P===""||A==="$user_state"&&P!=="anonymous"&&P!=="identified"||(_[A]=P)});const b="distinct_id"in _||_.$user_state==="anonymous"||_.$user_state==="identified";if(Object.keys(_).length>0){var u;const A=h[mr],P=(u=h.$user_state)!==null&&u!==void 0?u:Qr;c.forEach(D=>{if(v.indexOf(D)!==-1&&!(D in d)&&(b||D!=="distinct_id"&&D!=="$user_state")){const $=h[D];(m.isValid||tn.indexOf(D)===-1||$!==!1&&$!==0)&&delete h[D]}}),!b||"$user_state"in d||"$user_state"in h||(h[zt]=Qr),!b||("distinct_id"in _?_[mr]:h[mr])===A&&("$user_state"in _?_[zt]:h[zt])===P||(Pu.forEach(D=>delete h[D]),_.$user_state==="identified"&&"distinct_id"in _?h.$user_id=_[mr]:delete h.$user_id,_.$user_state!=="identified"&&(delete h[QE],delete h[Ei]),delete h.__alias)}f=Ge(h,_)}else f=Ge(d,h);return Me.$t(l,f),f}catch{}return null},$t(l,u,p,d,h,f){const m=Me.$t(l,u,void 0,void 0,f);try{const v=xu(u,o);if(Object.keys(v).length){if(a){const _=xc(l),b=xv(v,o);if(Xe.$t(_,b,p,d,h,f),Xe.Ot(_)!==JSON.stringify(b)){Xe.Lt(_,d);const A=xu(u);return Xe.$t(l,A,p,d,h,f),m}}Xe.$t(l,v,p,d,h,f)}}catch(v){Me.Pt(v)}return m},Lt(l,u){try{M?.localStorage.removeItem(l),Xe.Lt(l,u),Xe.Lt(xc(l),u)}catch(p){Me.Pt(p)}}})})(e.cookie_persisted_properties||[],e.cookieWinsOnConflict);let r,i=!1,n=!1;const s=e.persistence.toLowerCase();return s==="localstorage"&&Me.Et()?(r=Me,n=!0):s==="localstorage+cookie"&&t.Et()?(r=t,n=!0,i=!0):s==="sessionstorage"&&Be.Et()?r=Be:s==="memory"?r=bp:s==="cookie"&&Xe.Et()?(r=Xe,i=!0):t.Et()?(r=t,n=!0,i=!0):Xe.Et()?(r=Xe,i=!0):r=bp,this.Jo=n,this.Ko=i,r}fa(e){return`${this.ua}__${e}`}ca(e){return this.Jo&&!!e.split_storage}properties(){const e={};return je(this.props,(t,r)=>{const i=At(r);if(!i||i.exposure==="event"){var n;if(!(i==null||(n=i.shouldSkipFromEventProperties)===null||n===void 0)&&n.call(i,t))return;e[r]=t}}),e}load(e=!1){if(this.hi&&!e)return;const t=this.Ir.cookieWinsOnConflict&&this.Ir.persistence.toLowerCase()==="localstorage+cookie",r=t?Me.Dt(this.ua):null;let i={};if(t)try{i=Ou(Xe.Dt(this.ua)),je(i,(a,c)=>{(z(a)||Qe(a)||a==="")&&delete i[c]})}catch{}const n=this.No.Dt(this.ua);if(n&&(this.props=Ge({},n)),this.Xo&&this.ja(),t&&n){var s,o;const a=r?.[mr],c=(s=r?.$user_state)!==null&&s!==void 0?s:Qr,l=n[mr],u=(o=n.$user_state)!==null&&o!==void 0?o:Qr;if(l!==a||u!==c){this.Yo=!0,Be.$t(Ma(this.ua),!0);const p=Ge({},this.props);Pu.forEach(h=>delete p[h]),u!=="anonymous"||c!=="identified"&&i.$user_state!=="anonymous"&&(z(a)||l===a)||(Jv(p,i),delete p[Ei]),this.props=p;const d=new Set;Pu.forEach(h=>{var f;const m=(f=At(h))===null||f===void 0?void 0:f.storageGroup;m&&d.add(m)}),d.forEach(h=>{const f={};je(this.props,(m,v)=>{var _;((_=At(v))===null||_===void 0?void 0:_.storageGroup)===h&&(f[v]=m)}),Kt(f)?(Me.Lt(this.fa(h)),this.Qo[h]={}):Me.$t(this.fa(h),f)&&(this.Qo[h]={persisted:!0,fingerprint:this.ka(f,h)})})}}Be.Ot(Ma(this.ua))&&(this.Yo=!0)}ja(){for(const e of Zs){const t=Me.Dt(this.fa(e));if(t&&!Kt(t)){const r=this.ma(e);r.persisted=!0,this.Ba(e)||(r.fingerprint=this.ka(t,e)),this.Ha(e,t)||Ge(this.props,t)}}}Ba(e){return Object.keys(this.props).some(t=>{var r;return((r=At(t))===null||r===void 0?void 0:r.storageGroup)===e})}Ha(e,t){const r=SF[e];if(!r)return!1;const i=t[r],n=this.props[r];return nt(i)&&nt(n)&&n>i}refreshKey(e){var t;if(this.hi||this.ra.has(e))return;const r=this.Xo?(t=At(e))===null||t===void 0?void 0:t.storageGroup:void 0,i=r?Me.Dt(this.fa(r)):this.No.Dt(this.ua);if(i&&e in i)this.xa(e,i[e],!1);else{if(r){const n=this.No.Dt(this.ua);if(n&&e in n)return void this.xa(e,n[e],!1)}this.Ca(e,!1)}}save(){if(this.hi)return;const e=this.Ea();e>0?z(this.La)&&(this.La=setTimeout(()=>{this.La=void 0,this.Na()},e)):this.Na()}flush(){z(this.La)||(clearTimeout(this.La),this.La=void 0,this.Na())}Na(e=!1){if(this.hi||this.ta&&!e)return;e||(this.syncCookieProperties(),this.Ir.cookieWinsOnConflict&&this.Ir.persistence.toLowerCase()==="localstorage+cookie"||jk.forEach(n=>this.refreshKey(n)));const t=!e&&!this.ia;t||(this.sa=!1);const r=!!t&&this.$a();if(this.sa)return void(this.Ir.debug&&Y.warn("skipping persistence write because storage belongs to a different distinct ID"));if(this.Xo)return this.za(),void(r&&this.oa.forEach(n=>n()));const i=this.Ua(this.No,this.ua,this.props,lt);i==="written"&&this.Pa(this.props),i!=="failed"&&(this.ea.clear(),this.na=!1,this.ra.clear()),r&&this.oa.forEach(n=>n())}za(){const{main:e,groups:t}=this._a(),r=this.Ua(this.No,this.ua,e,lt);r==="written"&&this.Pa(e),r!=="failed"&&(this.na=!1,this.ra.clear(),Yr.forEach(n=>{var s;(s=At(n))!==null&&s!==void 0&&s.storageGroup||this.ea.delete(n)}));for(const n of Zs){var i;const s=t[n];if(Kt(s)&&!(!((i=this.Qo[n])===null||i===void 0)&&i.persisted)){Yr.forEach(a=>{var c;((c=At(a))===null||c===void 0?void 0:c.storageGroup)===n&&this.ea.delete(a)});continue}const o=this.Ua(Me,this.fa(n),s,n);o!=="failed"&&Yr.forEach(a=>{const c=At(a);c?.storageGroup!==n||o!=="written"&&c.volatile||this.ea.delete(a)})}}_a(){const e={},t={flags:{},surveys:{}};return je(this.props,(r,i)=>{var n;const s=(n=At(i))===null||n===void 0?void 0:n.storageGroup;s?t[s][i]=r:e[i]=r}),{main:e,groups:t}}ka(e,t){if(t===lt)return JSON.stringify(e)+"|"+this.Wa+"|"+this.Va+"|"+this.Ga;const r={};return je(e,(i,n)=>{var s;r[n]=!((s=At(n))===null||s===void 0)&&s.volatile?"__volatile__":i}),JSON.stringify(r)}Ua(e,t,r,i){const n=this.ma(i);if(i!==lt&&!n.dirty&&!z(n.fingerprint))return"skipped";let s;try{if(s=this.ka(r,i),s===n.fingerprint)return n.dirty=!1,"skipped"}catch{s=void 0}return e.$t(t,r,this.Wa,this.Va,this.Ga,this.Ir.debug)?(n.dirty=!1,i!==lt&&(n.persisted=!0),z(s)||(n.fingerprint=s),this.Jo&&(n.storageValue=Me.Ot(t)),"written"):(this.Ir.debug&&Y.warn(`failed to persist storage entry "${t}"; will retry on next save`),"failed")}remove({keepGroupEntries:e=!1}={}){if(this.Ia(),z(this.La)||(clearTimeout(this.La),this.La=void 0),this.No.Lt(this.ua,!1),this.No.Lt(this.ua,!0),!e&&this.aa)for(const t of Zs)Me.Lt(this.fa(t));e?delete this.Qo[lt]:this.Qo={},this.Ra=void 0,this.Aa=void 0}clear(){this.remove(),this.props={}}register_once(e,t,r){if(Pe(e)){this.syncCookieProperties(),z(t)&&(t="None"),this.Wa=z(r)?this.Za:r;let i=!1;if(je(e,(n,s)=>{this.props.hasOwnProperty(s)&&this.props[s]!==t||(this.xa(s,n),i=!0)}),i)return this.save(),!0}return!1}register(e,t){if(Pe(e)){this.syncCookieProperties(),this.Wa=z(t)?this.Za:t;let r=!1;if(je(e,(i,n)=>{e.hasOwnProperty(n)&&(this.props[n]!==i||Pe(i)||_e(i))&&(this.xa(n,i),r=!0)}),r)return this.save(),!0}return!1}unregister(e){this.syncCookieProperties();const t=typeof e=="string"?[e]:e;let r=!1;for(const i of t)i in this.props&&(this.Ca(i),r=!0);r&&this.save()}update_campaign_params(){const e=G?.URL;if(e===this.la)return;const t=xk(this.Ir.custom_campaign_params,this.Ir.mask_personal_data_properties,this.Ir.custom_personal_data_properties),r=!Kt(Nf(t));return r&&this.register(t),this.la=e,r?t:void 0}update_search_keyword(){this.register((function(){const e=G?.referrer;return e?Lk(e):{}})())}update_referrer_info(){var e;this.register_once({$referrer:Nk(),$referring_domain:G?.referrer&&((e=si(G.referrer))===null||e===void 0?void 0:e.host)||Lc},void 0)}set_initial_person_info(){if(this.props.$initial_campaign_params||this.props.$initial_referrer_info)return;const e=Dk(this.Ir.mask_personal_data_properties,this.Ir.custom_personal_data_properties,this.Ir.disable_capture_url_hashes);this.register_once({[ts]:this.Ko?{r:La(e.r),u:e.u?La(e.u):void 0}:e},void 0)}get_initial_props(){const e={};je([nk,ik],r=>{const i=this.props[r];i&&je(i,function(n,s){e["$initial_"+rp(s)]=n})});const t=this.props[ts];if(t){const r=(function(i,n=!1){const s=Uk(i,n),o={};return je(s,function(a,c){o[`$initial_${rp(c)}`]=a}),o})(t,this.Ir.disable_capture_url_hashes);Ge(e,r)}return e}safe_merge(e){return je(this.props,function(t,r){r in e||(e[r]=t)}),e}update_config(e,t,r){const i=e.persistence!==t.persistence,n=!((h,f)=>{if(h.length!==f.length)return!1;const m=[...h].sort(),v=[...f].sort();return m.every((_,b)=>_===v[b])})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),s=i||n,o=e.cookieWinsOnConflict!==t.cookieWinsOnConflict,a=e.disable_persistence||!!r,c=!!this.hi&&!a;a||this.Fa(t,c),this.Ir=e,!a&&(i||n||o)&&(this.Ra=void 0,this.Aa=void 0,this.Fa(S(S({},e),{},{cookie_persisted_properties:t.cookie_persisted_properties}),c));const l=s||o?this.ha(e):this.No;this.Qa();const u=this.ca(e),p=s||u!==this.Xo,d=!a&&(p||e.cross_subdomain_cookie!==this.Va||e.secure_cookie!==this.Ga)&&this.Oa(c);this.ia=p;try{if(this.Za=this.Wa=e.cookie_expiration,this.set_disabled(a),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),p){const h=this.props;this.clear(),this.No=l,this.Xo=u,this.props=h,this.save()}else o&&(this.No=l,a||(delete this.Qo[lt],this.Na()))}finally{this.ia=!1,d&&this.qa()}}Qa(){const e=this.props[ts];if(!this.Ko||!Pe(e)||typeof e.r!="string")return;const t=La(e.r),r=typeof e.u=="string"?La(e.u):e.u;t===e.r&&r===e.u||this.xa(ts,S(S({},e),{},{r:t,u:r}))}set_disabled(e){this.hi=e,this.hi?this.remove():this.save()}set_cross_subdomain(e){e!==this.Va&&(this.Va=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.Ga&&(this.Ga=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){const r=this.props.__timers||{};r[e]=t,this.xa(up,r),this.save()}remove_event_timer(e){const t=this.props.__timers||{},r=t[e];return z(r)||(delete t[e],this.xa(up,t),this.save()),r}get_property(e){return this.props[e]}set_property(e,t){this.xa(e,t),this.save()}xa(e,t,r=!0){var i;const n=this.props[e];this.props[e]=t,r&&(e!=="distinct_id"&&e!=="$user_state"||n===t||(this.na=!0),Wv(e)&&!ui(n,t)&&this.ra.add(e),this.Ma(e,n,t),(i=At(e))!==null&&i!==void 0&&i.volatile||this.Ta(e))}Ca(e,t=!0){delete this.props[e],t&&($u(e)&&this.ga(e,!0),Wv(e)&&this.ra.add(e),this.Ta(e))}Ta(e){var t;const r=(t=At(e))===null||t===void 0?void 0:t.storageGroup;r&&(this.ma(r).dirty=!0)}ma(e){return this.Qo[e]||(this.Qo[e]={})}},rr={GZipJS:"gzip-js",Base64:"base64"},Qs={Activation:"events",Cancellation:"cancelEvents"},Du={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},tr={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},Uu={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_RESPONSE:"$survey_response",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_QUESTIONS:"$survey_questions",SURVEY_COMPLETED:"$survey_completed",PRODUCT_TOUR_ID:"$product_tour_id",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},Ep={Popover:"popover",Inline:"inline"};function $a(e){let t=!0;return{dispose(){if(t){t=!1;const r=e();r&&gt(r.then)&&r.then(void 0,()=>{})}}}}var EF={SHOWN:"product tour shown",DISMISSED:"product tour dismissed",COMPLETED:"product tour completed",STEP_SHOWN:"product tour step shown",STEP_COMPLETED:"product tour step completed",BUTTON_CLICKED:"product tour button clicked",STEP_SELECTOR_FAILED:"product tour step selector failed",BANNER_CONTAINER_SELECTOR_FAILED:"product tour banner container selector failed",BANNER_ACTION_CLICKED:"product tour banner action clicked"},Kv={TOUR_ID:"$product_tour_id",TOUR_NAME:"$product_tour_name",TOUR_ITERATION:"$product_tour_iteration",TOUR_RENDER_REASON:"$product_tour_render_reason",TOUR_STEP_ID:"$product_tour_step_id",TOUR_STEP_ORDER:"$product_tour_step_order",TOUR_STEP_TYPE:"$product_tour_step_type",TOUR_DISMISS_REASON:"$product_tour_dismiss_reason",TOUR_BUTTON_TEXT:"$product_tour_button_text",TOUR_BUTTON_ACTION:"$product_tour_button_action",TOUR_BUTTON_LINK:"$product_tour_button_link",TOUR_BUTTON_TOUR_ID:"$product_tour_button_tour_id",TOUR_STEPS_COUNT:"$product_tour_steps_count",TOUR_STEP_SELECTOR:"$product_tour_step_selector",TOUR_STEP_SELECTOR_FOUND:"$product_tour_step_selector_found",TOUR_STEP_ELEMENT_TAG:"$product_tour_step_element_tag",TOUR_STEP_ELEMENT_ID:"$product_tour_step_element_id",TOUR_STEP_ELEMENT_CLASSES:"$product_tour_step_element_classes",TOUR_STEP_ELEMENT_TEXT:"$product_tour_step_element_text",TOUR_ERROR:"$product_tour_error",TOUR_MATCHES_COUNT:"$product_tour_matches_count",TOUR_FAILURE_PHASE:"$product_tour_failure_phase",TOUR_WAITED_FOR_ELEMENT:"$product_tour_waited_for_element",TOUR_WAIT_DURATION_MS:"$product_tour_wait_duration_ms",TOUR_BANNER_SELECTOR:"$product_tour_banner_selector",TOUR_LINKED_SURVEY_ID:"$product_tour_linked_survey_id",USE_MANUAL_SELECTOR:"$use_manual_selector",INFERENCE_DATA_PRESENT:"$inference_data_present",TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},Yv=tt("[RateLimiter]"),kF=class{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{const r=t.text;if(r&&r.length)try{(JSON.parse(r).quota_limited||[]).forEach(i=>{Yv.info(`${i||"events"} is quota limited.`),this.serverLimits[i]=new Date().getTime()+6e4})}catch(i){Yv.warn(`could not rate limit - continuing. Error: "${i?.message}"`,{text:r});return}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return((e=this.instance.config.rate_limiting)===null||e===void 0?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max(((e=this.instance.config.rate_limiting)===null||e===void 0?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e=!1){var t,r,i;const{captureEventsBurstLimit:n,captureEventsPerSecond:s}=this,o=new Date().getTime(),a=(t=(r=this.instance.persistence)===null||r===void 0?void 0:r.get_property("$capture_rate_limit"))!==null&&t!==void 0?t:{tokens:n,last:o};a.tokens+=(o-a.last)/1e3*s,a.last=o,a.tokens>n&&(a.tokens=n);const c=1>a.tokens;if(c||e||(a.tokens=Math.max(0,a.tokens-1)),c&&!e){const l=(nt(a.dropped)?a.dropped:0)+1;a.dropped=l,!this.lastEventRateLimited&&this.Ja(l)&&(a.dropped=0)}return this.lastEventRateLimited=c,(i=this.instance.persistence)===null||i===void 0||i.set_property("$capture_rate_limit",a),{isRateLimited:c,remainingTokens:a.tokens}}Ka(e){const t=this.instance.config.property_denylist;return!_e(t)||!t.includes(e)}Xa(){var e;if(this.Ka("$current_url")&&this.Ka("$pathname")&&Ze?.pathname)return`${(e=Ze.origin)!==null&&e!==void 0?e:""}${Ze.pathname}`}Ja(e){var t,r;const{captureEventsBurstLimit:i,captureEventsPerSecond:n}=this,s=this.Xa(),o=this.Ka("$session_id")?(t=(r=this.instance).get_session_id)===null||t===void 0?void 0:t.call(r):void 0,a=[`${e} event(s) dropped since the last warning`,s?`triggered on ${s}`:void 0,o?`session ${o}`:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:`posthog-js client rate limited: ${a}. Config is set to ${n} events per second and ${i} events burst limit.`},{skip_client_rate_limiting:!0})}isServerRateLimited(e){const t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}},di=tt("[RemoteConfig]"),zk=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=he._POSTHOG_REMOTE_CONFIG)===null||e===void 0||(e=e[this._instance.config.token])===null||e===void 0?void 0:e.config}Ya(e){var t,r,i;!((t=he.__PosthogExtensions__)===null||t===void 0)&&t.loadExternalDependency?(r=he.__PosthogExtensions__)===null||r===void 0||(i=r.loadExternalDependency)===null||i===void 0||i.call(r,this._instance,"remote-config",()=>e(this.remoteConfig)):e()}tl(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets",`/array/${this._instance.config.token}/config`),callback:e})}load(){try{if(this.remoteConfig)return di.info("Using preloaded remote config",this.remoteConfig),void this.el(this.remoteConfig);if(this._instance.il())return void di.warn("Remote config is disabled. Falling back to local config.");this.Ya(e=>{if(!e)return di.info("No config found after loading remote JS config. Falling back to JSON."),void this.tl(t=>{this.el(t.json,t)});this.el(e)})}catch(e){di.error("Error loading remote config",e),this.el()}}el(e,t){!e&&t&&(t.statusCode===0?t.error||di.warn("Failed to fetch remote config from PostHog."):di.error("Failed to fetch remote config from PostHog."));try{this._instance.el(e?{ok:!0,config:e}:{ok:!1})}catch(i){di.error("Error applying remote config",i)}if(e?.hasFeatureFlags!==!1&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var r;(r=this._instance.featureFlags)===null||r===void 0||r.ensureFlagsLoaded()}catch(i){di.error("Error loading feature flags",i)}}},sr=Uint8Array,Ht=Uint16Array,ks=Uint32Array,zf=new sr([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Ff=new sr([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Xv=new sr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Fk=function(e,t){for(var r=new Ht(31),i=0;31>i;++i)r[i]=t+=1<<e[i-1];var n=new ks(r[30]);for(i=1;30>i;++i)for(var s=r[i];r[i+1]>s;++s)n[s]=s-r[i]<<5|i;return[r,n]},Hk=Fk(zf,2),kp=Hk[1];Hk[0][28]=258,kp[258]=28;for(var Zv=Fk(Ff,0)[1],Ip=new Ht(32768),et=0;32768>et;++et){var jn=(43690&et)>>>1|(21845&et)<<1;Ip[et]=((65280&(jn=(61680&(jn=(52428&jn)>>>2|(13107&jn)<<2))>>>4|(3855&jn)<<4))>>>8|(255&jn)<<8)>>>1}var Ao=function(e,t,r){for(var i=e.length,n=0,s=new Ht(t);i>n;++n)++s[e[n]-1];var o,a=new Ht(t);for(n=0;t>n;++n)a[n]=a[n-1]+s[n-1]<<1;if(r){o=new Ht(1<<t);var c=15-t;for(n=0;i>n;++n)if(e[n])for(var l=n<<4|e[n],u=t-e[n],p=a[e[n]-1]++<<u,d=p|(1<<u)-1;d>=p;++p)o[Ip[p]>>>c]=l}else for(o=new Ht(i),n=0;i>n;++n)o[n]=Ip[a[e[n]-1]++]>>>15-e[n];return o},wn=new sr(288);for(et=0;144>et;++et)wn[et]=8;for(et=144;256>et;++et)wn[et]=9;for(et=256;280>et;++et)wn[et]=7;for(et=280;288>et;++et)wn[et]=8;var $c=new sr(32);for(et=0;32>et;++et)$c[et]=5;var IF=Ao(wn,9,0),AF=Ao($c,5,0),Bk=function(e){return(e/8|0)+(7&e&&1)},Vk=function(e,t,r){(t==null||0>t)&&(t=0),(r==null||r>e.length)&&(r=e.length);var i=new(e instanceof Ht?Ht:e instanceof ks?ks:sr)(r-t);return i.set(e.subarray(t,r)),i},Br=function(e,t,r){var i=t/8|0;e[i]|=r<<=7&t,e[i+1]|=r>>>8},eo=function(e,t,r){var i=t/8|0;e[i]|=r<<=7&t,e[i+1]|=r>>>8,e[i+2]|=r>>>16},qu=function(e,t){for(var r=[],i=0;e.length>i;++i)e[i]&&r.push({s:i,f:e[i]});var n=r.length,s=r.slice();if(!n)return[new sr(0),0];if(n==1){var o=new sr(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort(function(D,$){return D.f-$.f}),r.push({s:-1,f:25001});var a=r[0],c=r[1],l=0,u=1,p=2;for(r[0]={s:-1,f:a.f+c.f,l:a,r:c};u!=n-1;)a=r[r[p].f>r[l].f?l++:p++],c=r[l!=u&&r[p].f>r[l].f?l++:p++],r[u++]={s:-1,f:a.f+c.f,l:a,r:c};var d=s[0].s;for(i=1;n>i;++i)s[i].s>d&&(d=s[i].s);var h=new Ht(d+1),f=Ap(r[u-1],h,0);if(f>t){i=0;var m=0,v=f-t,_=1<<v;for(s.sort(function(D,$){return h[$.s]-h[D.s]||D.f-$.f});n>i;++i){var b=s[i].s;if(t>=h[b])break;m+=_-(1<<f-h[b]),h[b]=t}for(m>>>=v;m>0;){var A=s[i].s;t>h[A]?m-=1<<t-h[A]++-1:++i}for(;i>=0&&m;--i){var P=s[i].s;h[P]==t&&(--h[P],++m)}f=t}return[new sr(h),f]},Ap=function(e,t,r){return e.s==-1?Math.max(Ap(e.l,t,r+1),Ap(e.r,t,r+1)):t[e.s]=r},Qv=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Ht(++t),i=0,n=e[0],s=1,o=function(c){r[i++]=c},a=1;t>=a;++a)if(e[a]==n&&a!=t)++s;else{if(!n&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(n),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(n);s=1,n=e[a]}return[r.subarray(0,i),t]},to=function(e,t){for(var r=0,i=0;t.length>i;++i)r+=e[i]*t[i];return r},ic=function(e,t,r){var i=r.length,n=Bk(t+2);e[n]=255&i,e[n+1]=i>>>8,e[n+2]=255^e[n],e[n+3]=255^e[n+1];for(var s=0;i>s;++s)e[n+s+4]=r[s];return 8*(n+4+i)},e_=function(e,t,r,i,n,s,o,a,c,l,u){Br(t,u++,r),++n[256];for(var p=qu(n,15),d=p[0],h=p[1],f=qu(s,15),m=f[0],v=f[1],_=Qv(d),b=_[0],A=_[1],P=Qv(m),D=P[0],$=P[1],q=new Ht(19),j=0;b.length>j;++j)q[31&b[j]]++;for(j=0;D.length>j;++j)q[31&D[j]]++;for(var J=qu(q,7),se=J[0],ce=J[1],T=19;T>4&&!se[Xv[T-1]];--T);var de,K,pe,L,oe=l+5<<3,y=to(n,wn)+to(s,$c)+o,X=to(n,d)+to(s,m)+o+14+3*T+to(q,se)+(2*q[16]+3*q[17]+7*q[18]);if(y>=oe&&X>=oe)return ic(t,u,e.subarray(c,c+l));if(Br(t,u,1+(y>X)),u+=2,y>X){de=Ao(d,h,0),K=d,pe=Ao(m,v,0),L=m;var te=Ao(se,ce,0);for(Br(t,u,A-257),Br(t,u+5,$-1),Br(t,u+10,T-4),u+=14,j=0;T>j;++j)Br(t,u+3*j,se[Xv[j]]);u+=3*T;for(var F=[b,D],R=0;2>R;++R){var Z=F[R];for(j=0;Z.length>j;++j)Br(t,u,te[ie=31&Z[j]]),u+=se[ie],ie>15&&(Br(t,u,Z[j]>>>5&127),u+=Z[j]>>>12)}}else de=IF,K=wn,pe=AF,L=$c;for(j=0;a>j;++j)if(i[j]>255){var ie;eo(t,u,de[257+(ie=i[j]>>>18&31)]),u+=K[ie+257],ie>7&&(Br(t,u,i[j]>>>23&31),u+=zf[ie]);var ue=31&i[j];eo(t,u,pe[ue]),u+=L[ue],ue>3&&(eo(t,u,i[j]>>>5&8191),u+=Ff[ue])}else eo(t,u,de[i[j]]),u+=K[i[j]];return eo(t,u,de[256]),u+K[256]},RF=new ks([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),TF=new sr(0),CF=(function(){for(var e=new ks(256),t=0;256>t;++t){for(var r=t,i=9;--i;)r=(1&r&&3988292384)^r>>>1;e[t]=r}return e})(),ju=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8};function PF(e,t){t===void 0&&(t={});var r=(function(){var d=4294967295;return{p(h){for(var f=d,m=0;h.length>m;++m)f=CF[255&f^h[m]]^f>>>8;d=f},d(){return 4294967295^d}}})(),i=e.length;r.p(e);var n,s,o,a,c,l,u=(a=10+((n=t).filename&&n.filename.length+1||0),c=8,(function(d,h,f,m,v,_){var b=d.length,A=new sr(m+b+5*(1+Math.floor(b/7e3))+v),P=A.subarray(m,A.length-v),D=0;if(!h||8>b)for(var $=0;b>=$;$+=65535){var q=$+65535;b>q?D=ic(P,D,d.subarray($,q)):(P[$]=_,D=ic(P,D,d.subarray($,b)))}else{for(var j=RF[h-1],J=j>>>13,se=8191&j,ce=(1<<f)-1,T=new Ht(32768),de=new Ht(ce+1),K=Math.ceil(f/3),pe=2*K,L=function(g){return(d[g]^d[g+1]<<K^d[g+2]<<pe)&ce},oe=new ks(25e3),y=new Ht(288),X=new Ht(32),te=0,F=0,R=($=0,0),Z=0,ie=0;b>$;++$){var ue=L($),ae=32767&$,Fe=de[ue];if(T[ae]=Fe,de[ue]=ae,$>=Z){var ze=b-$;if((te>7e3||R>24576)&&ze>423){D=e_(d,P,0,oe,y,X,F,R,ie,$-ie,D),R=te=F=0,ie=$;for(var Ie=0;286>Ie;++Ie)y[Ie]=0;for(Ie=0;30>Ie;++Ie)X[Ie]=0}var H=2,le=0,me=se,be=ae-Fe&32767;if(ze>2&&ue==L($-be))for(var Ue=Math.min(J,ze)-1,Re=Math.min(32767,$),Te=Math.min(258,ze);Re>=be&&--me&&ae!=Fe;){if(d[$+H]==d[$+H-be]){for(var Se=0;Te>Se&&d[$+Se]==d[$+Se-be];++Se);if(Se>H){if(H=Se,le=be,Se>Ue)break;var Ee=Math.min(be,Se-2),Ce=0;for(Ie=0;Ee>Ie;++Ie){var Ke=$-be+Ie+32768&32767,W=Ke-T[Ke]+32768&32767;W>Ce&&(Ce=W,Fe=Ke)}}}be+=(ae=Fe)-(Fe=T[ae])+32768&32767}if(le){oe[R++]=268435456|kp[H]<<18|Zv[le];var re=31&kp[H],I=31&Zv[le];F+=zf[re]+Ff[I],++y[257+re],++X[I],Z=$+H,++te}else oe[R++]=d[$],++y[d[$]]}}D=e_(d,P,_,oe,y,X,F,R,ie,$-ie,D),_||(D=ic(P,D,TF))}return Vk(A,0,m+Bk(D)+v)})(s=e,(o=t).level==null?6:o.level,o.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):12+o.mem,a,c,!l)),p=u.length;return(function(d,h){var f=h.filename;if(d[0]=31,d[1]=139,d[2]=8,d[8]=2>h.level?4:h.level==9?2:0,d[9]=3,h.mtime!=0&&ju(d,4,Math.floor(new Date(h.mtime||Date.now())/1e3)),f){d[3]=8;for(var m=0;f.length>=m;++m)d[m+10]=f.charCodeAt(m)}})(u,t),ju(u,p-8,r.d()),ju(u,p-4,i),u}var OF=!!wf||!!Do,Gk=new WeakMap,Wk="text/plain",zu=0,nc=!1,Jk=(e,t)=>{const[r,i]=e.split("#"),[n,s]=r.split("?");if(!s)return e;const o=s.split("&").filter(a=>a.split("=")[0]!==t).join("&");return`${n}${o?`?${o}`:""}${i?`#${i}`:""}`},sa=(e,t,r=!0)=>{var i;const[n,s]=e.split("?"),o=S({},t),a=(i=s?.split("&").map(l=>{var u;const[p,d]=l.split("="),h=r&&(u=o[p])!==null&&u!==void 0?u:d;return delete o[p],`${p}=${h}`}))!==null&&i!==void 0?i:[],c=(function(l,u="&"){let p,d;const h=[];return je(l,function(f,m){z(f)||z(m)||m==="undefined"||(p=encodeURIComponent((v=>v instanceof File)(f)?f.name:f.toString()),d=encodeURIComponent(m),h[h.length]=d+"="+p)}),h.join(u)})(o);return c&&a.push(c),a.length>0?`${n}?${a.join("&")}`:n},Fu=e=>{if(e.nl)return e.nl;const{data:t,compression:r}=e;if(!t)return;if(r===rr.GZipJS){const n=PF((function(s){var o=s.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(s);for(var a=new sr(s.length+(s.length>>>1)),c=0,l=function(h){a[c++]=h},u=0;o>u;++u){if(c+5>a.length){var p=new sr(c+8+(o-u<<1));p.set(a),a=p}var d=s.charCodeAt(u);128>d?l(d):2048>d?(l(192|d>>>6),l(128|63&d)):d>55295&&57344>d?(l(240|(d=65536+(1047552&d)|1023&s.charCodeAt(++u))>>>18),l(128|d>>>12&63),l(128|d>>>6&63),l(128|63&d)):(l(224|d>>>12),l(128|d>>>6&63),l(128|63&d))}return Vk(a,0,c)})(is(t)),{mtime:0});return{contentType:Wk,body:n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength),estimatedSize:n.byteLength}}if(r===rr.Base64){const n=(s=>"data="+encodeURIComponent(typeof s=="string"?s:is(s)))((function(s){return s&&btoa(encodeURIComponent(s).replace(/%([0-9A-F]{2})/g,(o,a)=>String.fromCharCode(parseInt(a,16))))})(is(t)));return{contentType:"application/x-www-form-urlencoded",body:n,estimatedSize:new Blob([n]).size}}const i=is(t);return{contentType:"application/json",body:i,estimatedSize:new Blob([i]).size}},Kk=e=>{const t=()=>e.transport==="sendBeacon"?{url:sa(e.url,{compression:rr.Base64}),encodedBody:Fu(S(S({},e),{},{compression:rr.Base64,nl:void 0}))}:{url:Jk(e.url,"compression"),encodedBody:Fu(S(S({},e),{},{compression:void 0,nl:void 0}))};let r;try{r=Fu(e)}catch(n){if(bv(e.compression,ws(e.url,"compression")))return Y.error("Failed to gzip request body, sending uncompressed payload",n),t();throw n}return r&&bv(e.compression,ws(e.url,"compression"))&&!((i=r.body)instanceof ArrayBuffer?cp(new Uint8Array(i)):ArrayBuffer.isView(i)&&cp(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?(nc=!0,t()):{url:e.url,encodedBody:r};var i},Yk=e=>{try{return Kk(e)}catch(r){var t;Y.error(r),(t=e.callback)===null||t===void 0||t.call(e,{statusCode:0,error:r});return}},xF=(function(){var e=We(function*(t){const r=yield(function(n){return lp.apply(this,arguments)})(is(t.data),ut.DEBUG,{rethrow:!0});if(!r)return t;const i=yield r.arrayBuffer();return S(S({},t),{},{nl:{contentType:Wk,body:i,estimatedSize:i.byteLength}})});return function(t){return e.apply(this,arguments)}})(),MF=/Failed to fetch|NetworkError|Load failed/i,Xk=e=>e?.name==="TypeError"&&MF.test(e?.message||""),Zk=e=>{try{const t=(function(r,i=Date.now()){if(typeof r!="string"||!r)return;const n=r.trim(),s=/^\d+\s*,/.test(n)?n.slice(0,n.indexOf(",")).trim():n;if(/^\d+$/.test(s)){const c=1e3*Math.min(Number(s),300);return c>0?c:void 0}if(!/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun)[a-z]*[ ,]/.test(s))return;const o=/^\w{3} \w{3} /.test(s)?s+" GMT":s,a=Date.parse(o)-i;return Number.isFinite(a)&&a>0?Math.min(a,ec):void 0})(e());return z(t)?void 0:Math.min(t,3e4)}catch{return}},Qk=e=>{const t=Yk(e);if(!t)return;const r=new wf;Gk.set(r,!0);const{url:i,encodedBody:n}=t;r.open(e.method||"GET",i,!0);const{contentType:s,body:o}=n??{};je(e.headers,function(a,c){r.setRequestHeader(c,a)}),s&&r.setRequestHeader("Content-Type",s),e.timeout&&(r.timeout=e.timeout),r.onreadystatechange=()=>{if(r.readyState===4){var a;const c={statusCode:r.status,text:r.responseText};if(r.status===200)try{c.json=JSON.parse(r.responseText)}catch{}(a=e.callback)===null||a===void 0||a.call(e,c,Zk(()=>r.getResponseHeader("Retry-After")))}},r.send(o)},eI=e=>{const t=Yk(e);if(!t)return;const{url:r,encodedBody:i}=t,{contentType:n,body:s,estimatedSize:o}=i??{},a=new Headers;je(e.headers,function(f,m){a.append(m,f)}),n&&a.append("Content-Type",n);let c=null,l=!1;if(nv){const f=new nv;c={signal:f.signal,timeout:setTimeout(()=>{l=!0;try{f.abort(CE("AbortError","PostHog request timed out"+((m=e.timeout)?` after ${m}ms`:"")))}catch(v){p(v)}var m},e.timeout)}}let u=!1;const p=f=>{var m;u||(u=!0,l&&f?.name==="AbortError"||Xk(f)?Y.warn(f):Y.error(f),(m=e.callback)===null||m===void 0||m.call(e,{statusCode:0,error:f}))};let d=0;const h=()=>{zu-=d,d=0,c&&clearTimeout(c.timeout)};try{const f=S({method:e?.method||"GET",headers:a,referrerPolicy:"strict-origin",body:s,signal:c?.signal},e.fetchOptions),m=o??(z(s)?0:void 0);f.keepalive=f.method==="POST"&&!e.sl&&f.keepalive!==!1&&f.body===s&&!z(m)&&m>=0&&52428.8>zu+m,f.keepalive&&(d=m,zu+=d),Do(r,f).then(v=>v.text().then(_=>{var b;if(u)return;const A={statusCode:v.status,text:_};if(v.status===200)try{A.json=JSON.parse(_)}catch(P){Y.error(P)}u=!0,h(),(b=e.callback)===null||b===void 0||b.call(e,A,Zk(()=>v.headers.get("Retry-After")))})).catch(v=>{h(),p(v)}).finally(h)}catch(f){h(),p(f)}},Rp=e=>{try{var t;const{url:r,encodedBody:i}=Kk(e),{contentType:n,body:s,estimatedSize:o}=i??{};if(!s)return;const a=s instanceof Blob?s:new Blob([s],{type:n});if(vt.sendBeacon(r,a))return;const c=_e(e.data)?e.data:(t=e.data)===null||t===void 0?void 0:t.batch;if(_e(c)&&c.length>1&&(o??0)>16384){const l=Math.ceil(c.length/2),u=p=>_e(e.data)?p:S(S({},e.data),{},{batch:p});Rp(S(S({},e),{},{data:u(c.slice(0,l))})),Rp(S(S({},e),{},{data:u(c.slice(l))}));return}Y.warn(`Beacon of ~${o??0} bytes was rejected by the browser, falling back to ${Do?"fetch":"XHR"}`),Do?eI(S(S({},e),{},{sl:!0})):Qk(e)}catch(r){Y.warn("Beacon send failed",r)}},t_=(e,t,r,i)=>{const n=i==="query"?t==="POST"?"sent_at":"_":void 0;return sa(r===rr.GZipJS?Jk(e,"compression"):e,S(S({},n?{[n]:Date.now().toString()}:{}),r===rr.GZipJS?{}:{compression:r}))},LF=(()=>{const e=[];return Do&&e.push({transport:"fetch",method:eI}),wf&&e.push({transport:"XHR",method:Qk}),vt!=null&&vt.sendBeacon&&e.push({transport:"sendBeacon",method:Rp}),e})(),tI=!OF&&qt?.indexOf("MSIE")===-1&&qt?.indexOf("Mozilla")===-1;function rI(e,t,r){var i,n,s;r&&(t=S(S({},t),{},{callback:o=>r(o)})),e.__loaded?tI?e.__request_queue.push(t):e.rateLimiter.isServerRateLimited(t.batchKey)?t.fireCallbackOnDrop&&((n=t.callback)===null||n===void 0||n.call(t,{statusCode:429})):(t.transport=t.transport||e.config.api_transport,t.headers=S(S({},e.config.request_headers),t.headers),t.compression=t.compression==="best-available"?(i=e.compression)!==null&&i!==void 0?i:t.compressionFallback:t.compression,(z(e.config.disable_beacon)?e.config.__preview_disable_beacon:e.config.disable_beacon)&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||e.config.fetch_options,((o,a)=>{var c,l,u;const p=S(S({},o),{},{callback:a??(v=>{var _;return(_=o.callback)===null||_===void 0?void 0:_.call(o,v)})});p.timeout=p.timeout||6e4;const d=(c=p.transport)!==null&&c!==void 0?c:"fetch";d==="sendBeacon"&&z(p.compression)&&p.data&&(p.compression=rr.Base64),p.method==="POST"&&p.data&&(p.timestampMode==="capture-body"?p.data=(v=>{var _,b;const A=(_e(v)?v:[v]).map(D=>S(S({},D),D.timestamp instanceof Date&&!isNaN(D.timestamp.getTime())?{timestamp:D.timestamp.toISOString()}:{})),P=A[0];return{api_key:(_=P==null||(b=P.properties)===null||b===void 0?void 0:b.token)!==null&&_!==void 0?_:P?.token,batch:A,sent_at:new Date().toISOString()}})(p.data):p.timestampMode==="body"&&(p.data=((v,_=new Date().toISOString())=>_e(v)?v.map(b=>S(S({},b),{},{sent_at:_})):S(S({},v),{},{sent_at:_}))(p.data))),p.url=t_(p.url,p.method,p.compression,p.timestampMode);const h=LF.filter(v=>!p.disableTransport||!v.transport||!p.disableTransport.includes(v.transport)),f=(l=(u=(function(v,_){for(let b=0;v.length>b;b++)if(_(v[b]))return v[b]})(h,v=>v.transport===d))===null||u===void 0?void 0:u.method)!==null&&l!==void 0?l:h[0].method;if(!f)throw new Error("No available transport method");const m=v=>{try{f(v)}catch(b){var _;Xk(b)?Y.warn(b):Y.error(b),(_=p.callback)===null||_===void 0||_.call(p,{statusCode:0,error:b})}};d!=="sendBeacon"&&!p.preferSyncCompression&&p.data&&p.compression===rr.GZipJS&&kj&&typeof Promise<"u"&&!nc?xF(p).then(v=>{m(v)}).catch(v=>{if(Sv(v))return nc=!0,void m(S(S({},p),{},{compression:void 0,url:t_(o.url,o.method,void 0,o.timestampMode)}));(_=>{if(!_||typeof _!="object")return!1;const b="name"in _?String(_.name):"";return Sv(_)||b===NE})(v)&&(nc=!0),m(p)}):m(p)})(t,(o,a)=>{var c,l,u;e.rateLimiter.checkForLimiting(o),400>o.statusCode||(c=(l=e.config).on_request_error)===null||c===void 0||c.call(l,o),r?r(o,a):(u=t.callback)===null||u===void 0||u.call(t,o)})):t.fireCallbackOnDrop&&((s=t.callback)===null||s===void 0||s.call(t,{statusCode:0}))}var $F=class{constructor(e,t){this.rl=!0,this.ol=[],this.al=Lr(t?.flush_interval_ms||3e3,250,5e3,Y.createLogger("flush interval"),3e3),this.ll=e}enqueue(e){this.ol.push(e),this.ul||this.hl()}unload(){this.cl();const e=this.ol.length>0?this.dl():{},t=Object.values(e);[...t.filter(r=>r.url.indexOf("/e")===0),...t.filter(r=>r.url.indexOf("/e")!==0)].map(r=>{this.vl(r,"sendBeacon")})}enable(){this.rl=!1,this.hl()}hl(){this.rl||(this.ul=setTimeout(()=>{if(this.cl(),this.ol.length>0){const e=this.dl();for(const t in e)this.vl(e[t])}},this.al))}vl(e,t){try{this.ll(e,t)}catch(r){Y.error(r)}}cl(){clearTimeout(this.ul),this.ul=void 0}dl(){const e={};return je(this.ol,t=>{var r;const i=t,n=((i?i.batchKey:null)||i.url)+(i.batchGroup?`:${i.batchGroup}`:"");z(e[n])&&(e[n]=S(S({},i),{},{data:[]})),(r=e[n].data)===null||r===void 0||r.push(i.data)}),this.ol=[],e}},NF=["retriesPerformedSoFar"],DF=class{constructor(e){this._instance=e,this.fl=!1,this.pl=3e3,this.ol=[],this.ol=[],this.gl=!0,this.resume()}resume(){if(!z(M)&&"onLine"in M.navigator){if(this.gl=M.navigator.onLine,this.ml)return;this.ml=()=>{this.gl=!0,this.yl()},this.bl=()=>{this.gl=!1},Ne(M,"online",this.ml),Ne(M,"offline",this.bl)}}get length(){return this.ol.length}retriableRequest(e,t){let{retriesPerformedSoFar:r}=e,i=DE(e,NF);Kr(r)&&(i.url=sa(i.url,{retry_count:r})),rI(this._instance,t?S(S({},i),{},{transport:t}):i,(n,s)=>{var o;if(n.statusCode!==200&&(400>n.statusCode||n.statusCode>=500)){if((n.statusCode===0?3:10)>(r??0))return void this.Ls(S({retriesPerformedSoFar:r},i),s);n.statusCode===0&&Y.warn(`Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after ${r??0} retries.`)}(o=i.callback)===null||o===void 0||o.call(i,n)})}Ls(e,t){const r=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=r+1;const i=Math.max((function(o){const a=3e3*Math.pow(2,o),c=a/2,l=Math.min(18e5,a),u=(Math.random()-.5)*(l-c);return Math.ceil(l+u)})(r),t??0),n=Date.now()+i;this.ol.push({retryAt:n,requestOptions:e});let s=`Enqueued failed request for retry in ${i}`;navigator.onLine||(s+=" (Browser is offline)"),Y.warn(s),this.fl||(this.fl=!0,this._l())}_l(){if(this.wl&&clearTimeout(this.wl),this.ol.length===0)return this.fl=!1,void(this.wl=void 0);this.wl=setTimeout(()=>{this.gl&&this.ol.length>0&&this.yl(),this._l()},this.pl)}yl(){const e=Date.now(),t=[],r=this.ol.filter(i=>e>i.retryAt||(t.push(i),!1));if(this.ol=t,r.length>0)for(const{requestOptions:i}of r)this.retriableRequest(i)}unload(){this.wl&&(clearTimeout(this.wl),this.wl=void 0),this.fl=!1,z(M)||(this.ml&&(M.removeEventListener("online",this.ml),this.ml=void 0),this.bl&&(M.removeEventListener("offline",this.bl),this.bl=void 0));for(const{requestOptions:e}of this.ol)try{this._instance._send_request(S(S({},e),{},{transport:"sendBeacon"}))}catch(t){Y.error(t)}this.ol=[]}},UF=class{constructor(e){this._instance=e,this.kl=()=>{var t,r,i,n;this.Sl||(this.Sl={});const s=this.scrollElement(),o=this.scrollY(),a=s?Math.max(0,s.scrollHeight-s.clientHeight):0,c=o+(s?.clientHeight||0),l=s?.scrollHeight||0;this.Sl.lastScrollY=Math.ceil(o),this.Sl.maxScrollY=Math.max(o,(t=this.Sl.maxScrollY)!==null&&t!==void 0?t:0),this.Sl.maxScrollHeight=Math.max(a,(r=this.Sl.maxScrollHeight)!==null&&r!==void 0?r:0),this.Sl.lastContentY=c,this.Sl.maxContentY=Math.max(c,(i=this.Sl.maxContentY)!==null&&i!==void 0?i:0),this.Sl.maxContentHeight=Math.max(l,(n=this.Sl.maxContentHeight)!==null&&n!==void 0?n:0)}}get xl(){return this._instance.config.scroll_root_selector}getContext(){return this.Sl}resetContext(){const e=this.Sl;return this.Sl=void 0,setTimeout(this.kl,0),e}startMeasuringScrollPosition(){Ne(M,"scroll",this.kl,{capture:!0}),Ne(M,"scrollend",this.kl,{capture:!0}),Ne(M,"resize",this.kl)}scrollElement(){if(this.xl){const r=_e(this.xl)?this.xl:[this.xl];for(const i of r){var e;const n=M==null||(e=M.document)===null||e===void 0?void 0:e.querySelector(i);if(n)return n}return}var t;return M==null||(t=M.document)===null||t===void 0?void 0:t.documentElement}Cl(e){var t,r;const i=e==="y"?"scrollTop":"scrollLeft";if(this.xl){const n=this.scrollElement();return n&&n[i]||0}return M?e==="y"?M.scrollY||M.pageYOffset||((t=M.document)===null||t===void 0||(t=t.documentElement)===null||t===void 0?void 0:t.scrollTop)||0:M.scrollX||M.pageXOffset||((r=M.document)===null||r===void 0||(r=r.documentElement)===null||r===void 0?void 0:r.scrollLeft)||0:0}scrollY(){return this.Cl("y")}scrollX(){return this.Cl("x")}},qF=e=>Dk(e?.config.mask_personal_data_properties,e?.config.custom_personal_data_properties,e?.config.disable_capture_url_hashes),r_=class{constructor(e,t,r,i){this.qe=n=>{const s=this.$l();if(s&&s.sessionId===n)return;const o={sessionId:n,props:this.Tl(this._instance)};this.Il.register({[vp]:o})},this._instance=e,this.Ml=t,this.Il=r,this.Tl=i||qF,this.Ml.onSessionId(this.qe)}$l(){return this.Il.props[vp]}getSetOnceProps(){var e;const t=(e=this.$l())===null||e===void 0?void 0:e.props;return t?"r"in t?Uk(t,this._instance.config.disable_capture_url_hashes):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){const e={};return je(Nf(this.getSetOnceProps()),(t,r)=>{r==="$current_url"&&(r="url"),e[`$session_entry_${rp(r)}`]=t}),e}},Nc=class{on(e,t){return this.El[e]||(this.El[e]=[]),this.El[e].push(t),()=>{this.El[e]=this.El[e].filter(r=>r!==t)}}emit(e,t){for(const r of this.El[e]||[])r(t);for(const r of this.El["*"]||[])r(e,t)}constructor(){this.El={}}},zn=tt("[SessionId]"),i_=864e5,n_=class{on(e,t){return this.Pl.on(e,t)}constructor(e,t,r){var i;if(this.Rl=null,this.Al=null,this.Fl=[],this.Ol=void 0,this.Dl=!1,this.Pl=new Nc,this.Ll=(s,o)=>!(!Kr(s)||!Kr(o))&&Math.abs(s-o)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Ir=e.config,this.Il=e.persistence,this.je=void 0,this.Xt=void 0,this._sessionStartTimestamp=null,this.Nl=void 0,this._sessionActivityTimestamp=null,this.ql=t||yr,this.jl=r||yr;const n=this.Ir.persistence_name||this.Ir.token;if(this._sessionTimeoutMs=1e3*Lr(this.Ir.session_idle_timeout_seconds||1800,60,36e3,zn.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Bl(),this.Hl="ph_"+n+"_window_id",this.zl="ph_"+n+"_primary_window_exists",this.Ul()){const s=Be.Dt(this.Hl),o=Be.Dt(this.zl);s&&!o?this.je=s:Be.Lt(this.Hl),Be.$t(this.zl,!0)}(i=this.Ir.bootstrap)!==null&&i!==void 0&&i.sessionID&&this.setBootstrapSessionId(this.Ir.bootstrap.sessionID),this.Wl()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return z(this.Fl)&&(this.Fl=[]),this.Fl.push(e),this.Xt&&e(this.Xt,this.je),()=>{this.Fl=this.Fl.filter(t=>t!==e)}}Ul(){return this.Ir.persistence!=="memory"&&!this.Il.hi&&Be.Et()}Vl(e){e!==this.je&&(this.je=e,this.Ul()&&Be.$t(this.Hl,e))}Gl(){return this.je?this.je:this.Ul()?Be.Dt(this.Hl):null}Zl(e){const t=this.Rl;return!Qe(t)&&!Qe(e)&&5e3>Math.abs(e-t)}Ql(e,t,r){const i=t!==this._sessionActivityTimestamp,n=!(e!==this.Xt||r!==this._sessionStartTimestamp);this._sessionStartTimestamp=r,this._sessionActivityTimestamp=t,this.Xt=e,n&&!i||n&&this.Zl(t)||(this.Rl=t,this.Il.register({[es]:[t,e,r]}))}Jl(){var e;const t=(e=this.Ir)===null||e===void 0?void 0:e.persistence_save_debounce_ms;return Kr(t)&&t>0}Kl(){this.Jl()?this.Il.refreshKey(es):(this.Il.flush(),this.Il.load())}Xl(){var e;if(Qe(this._sessionActivityTimestamp)||this._sessionActivityTimestamp===this.Rl)return;this.Kl();const[,t,r]=this.Yl();t===this.Xt&&r===this._sessionStartTimestamp&&(this.Rl=this._sessionActivityTimestamp,this.Il.register({[es]:[this._sessionActivityTimestamp,(e=this.Xt)!==null&&e!==void 0?e:null,this._sessionStartTimestamp]}),this.Il.flush())}tu(){const[e]=this.Yl(),t=Kr(e)?e:0,r=Kr(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(t,r)}eu(e){return this.Kl(),this.Ll(e,this.tu())}Yl(){const e=this.Il.props[es];return _e(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Rl=null,this.Nl=void 0,clearTimeout(this.iu),this.iu=void 0,this.Ql(null,null,null)}setBootstrapSessionId(e,t=!1){const r=((i,n=new Date().getTime())=>{try{const s=(o=>{const a=o.replace(/-/g,"");if(a.length!==32)throw new Error("Not a valid UUID");if(a[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(a.substring(0,12),16)})(i);return s>n+6e4?void zn.error("Bootstrap sessionID cannot be in the future"):s}catch(s){zn.error("Invalid sessionID in bootstrap",s);return}})(e);return!z(r)&&(t?this.Nl={sessionId:e,sessionStartTimestamp:r}:this.Ql(e,new Date().getTime(),r),!0)}destroy(){this.Dl=!0,this.Xl(),clearTimeout(this.iu),this.iu=void 0,this.Ol&&M&&(M.removeEventListener(Oc,this.Ol,{capture:!1}),this.Ol=void 0),this.Fl=[]}Wl(){this.Ol=()=>{this.Xl(),this.Ul()&&Be.Lt(this.zl)},Ne(M,Oc,this.Ol,{capture:!1})}checkAndGetSessionAndWindowId(e=!1,t=null,r=!1){if(this.Ir.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');const i=t||new Date().getTime(),n=this.Xt;if(r)this.Al=i;else if(Qe(this.Al)||this.Al>i||i-this.Al>=1e3){var s,o;(s=(o=this.Il).syncCookieProperties)===null||s===void 0||s.call(o),this.Al=i}let[,a,c]=this.Yl();const l=!z(n)&&a!==n,u=this.tu();let p=this.Gl();const d=this.Nl,h=!!d&&(d.sessionStartTimestamp>i+6e4||i-d.sessionStartTimestamp>i_),f=d?h:Kr(c)&&Math.abs(i-c)>i_;let m=!1,v=l,_=!a||!!d;const b=a;let A=!_&&!e&&this.Ll(i,u);if(A&&(A=this.eu(i),A||zn.info("cross-tab refresh kept the session alive",{sessionId:a}),[,a,c]=this.Yl(),A||(_=!a||!!d)),_||A||f){v=!1;const q=d&&!h;a=q?d.sessionId:this.ql(),p=this.jl(),zn.info("new session ID assigned",{sessionId:a,windowId:p,bootstrapped:!!q,changeReason:{noSessionId:_,activityTimeout:A,sessionPastMaximumLength:f}}),c=q?d.sessionStartTimestamp:i,this.Nl=void 0,m=!0}else p||(p=this.jl(),m=!0),v=v||a!==b,v&&(zn.info("adopted cross-tab session id",{sessionId:a,windowId:p}),m=!0);const P=Kr(u)&&e&&!f?u:i,D=Kr(c)?c:new Date().getTime();this.Vl(p),this.Ql(a,P,D),e||this.Bl();const $={noSessionId:_,activityTimeout:A,sessionPastMaximumLength:f,crossTabAdoption:v};return m&&this.Fl.forEach(q=>q(a,p,$)),{sessionId:a,windowId:p,sessionStartTimestamp:D,changeReason:m?$:void 0,lastActivityTimestamp:u}}Bl(){this.Dl||(clearTimeout(this.iu),this.iu=setTimeout(()=>{if(!this.Dl)if(this.eu(new Date().getTime())){const e=this.Xt;this.resetSessionId(),this.Pl.emit("forcedIdleReset",{idleSessionId:e})}else this.Bl()},1.1*this.sessionTimeoutMs))}},iI=function(e,t){if(!e)return!1;const r=e.userAgent;if(r&&av(r,t))return!0;try{const i=e?.userAgentData;if(i?.brands&&i.brands.some(n=>av(n?.brand,t)))return!0}catch{}return!!e.webdriver};function nI(){return(nI=We(function*(){const e=vt?.userAgentData;if(e?.getHighEntropyValues)try{const t=yield e.getHighEntropyValues(["model"]),r=t?.model;return Ae(r)&&r.length>0?r:void 0}catch(t){Y.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",t);return}})).apply(this,arguments)}function jF(e,t){let r=`$survey_${t}/${e.id}`;return e.current_iteration&&e.current_iteration>0&&(r=`$survey_${t}/${e.id}/${e.current_iteration}`),r}function sI(e){var t;return!!(!((t=e.conditions)===null||t===void 0||(t=t.events)===null||t===void 0||(t=t.values)===null||t===void 0)&&t.length)}var Dc=(e,t)=>{if(!(r=>{try{new RegExp(r)}catch{return!1}return!0})(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}},Na=e=>e.toLowerCase(),oI={exact:(e,t)=>t.some(r=>e.some(i=>r===i)),is_not:(e,t)=>t.every(r=>e.every(i=>r!==i)),regex:(e,t)=>t.some(r=>e.some(i=>Dc(r,i))),not_regex:(e,t)=>t.every(r=>e.every(i=>!Dc(r,i))),icontains:(e,t)=>t.map(Na).some(r=>e.map(Na).some(i=>r.includes(i))),not_icontains:(e,t)=>t.map(Na).every(r=>e.map(Na).every(i=>!r.includes(i))),gt:(e,t)=>t.some(r=>{const i=parseFloat(r);return!isNaN(i)&&e.some(n=>i>parseFloat(n))}),lt:(e,t)=>t.some(r=>{const i=parseFloat(r);return!isNaN(i)&&e.some(n=>i<parseFloat(n))})};function aI(e,t){return!e||Object.entries(e).every(([r,i])=>{const n=t?.[r];if(n==null)return!1;const s=oI[i.operator];return!!s&&s(i.values.map(String),[String(n)])})}function Hu(e,t,r){return is({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:r})}var Tp="custom",s_="i.posthog.com",zF=/^\/static\//,FF=["/s/","/e/","/i/"],HF=class{constructor(e){this.nu={},this.instance=e}get apiHost(){const e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){const e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e;let t=(e=this.instance.config.ui_host)===null||e===void 0?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace(`.${s_}`,".posthog.com")),t==="https://app.posthog.com"?"https://us.posthog.com":t}get region(){return this.nu[this.apiHost]||(this.nu[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":Tp),this.nu[this.apiHost]}su(e){if(!zF.test(e))return;const t=this.instance.config.asset_host;return typeof t=="string"&&t.trim().replace(/\/$/,"")||void 0}ru(e){const t=si(e);return t?t.protocol+"//"+t.host+t.pathname:void 0}ou(e,t,r){if(e==="ui")return r;let i=r;const n=this.instance.config.rewriteRequestPath;if(n){var s;const o=((s=si(r))===null||s===void 0?void 0:s.href)||r;i=n(new URL(o)).toString()}if(n&&e==="api"&&FF.some(o=>t.indexOf(o)===0)){const o=this.ru(i);if(o){const a=this.apiHost;let c=this.au;c?.apiHost===a&&c.rewriteRequestPath===n||(c={apiHost:a,rewriteRequestPath:n,urls:new Set},this.au=c),c.urls.add(o)}}return i}isIngestionEndpoint(e){const t=this.au,r=this.ru(e);return t?.apiHost===this.apiHost&&t.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!r&&t.urls.has(r)}endpointFor(e,t=""){if(t&&(t=t[0]==="/"?t:`/${t}`),e==="ui")return this.ou(e,t,this.uiHost+t);if(e==="flags")return this.ou(e,t,this.flagsApiHost+t);if(e==="assets"){const i=this.su(t);if(i)return this.ou(e,t,`${i}${t}`)}if(this.region===Tp)return this.ou(e,t,this.apiHost+t);const r=s_+t;switch(e){case"assets":return this.ou(e,t,`https://${this.region}-assets.${r}`);case"api":return this.ou(e,t,`https://${this.region}.${r}`)}}},De=tt("[Surveys]"),cI=e=>{try{const t=(r=>((i,n)=>`seenSurvey_${(function(s){return s.current_iteration&&s.current_iteration>0?`${s.id}_${s.current_iteration}`:s.id})(n)}`)(0,r))(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(t){De.error("Failed to persist survey seen state",t)}},BF=[Du.Popover,Du.Widget,Du.API],VF={ignoreConditions:!1,ignoreDelay:!1,displayType:Ep.Popover},GF=tt("[PostHog ExternalIntegrations]"),WF={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},JF=class{constructor(e){this._instance=e}Ho(e,t){var r,i;(r=he.__PosthogExtensions__)===null||r===void 0||(i=r.loadExternalDependency)===null||i===void 0||i.call(r,this._instance,e,n=>{if(n)return GF.error("failed to load script",n);t()})}startIfEnabledOrStop(){var e;for(const[n,s]of Object.entries((e=this._instance.config.integrations)!==null&&e!==void 0?e:{})){var t,r,i;s&&!((t=he.__PosthogExtensions__)!==null&&t!==void 0&&(t=t.integrations)!==null&&t!==void 0&&t[n])&&this.Ho(WF[n],()=>{var o;(o=he.__PosthogExtensions__)===null||o===void 0||(o=o.integrations)===null||o===void 0||(o=o[n])===null||o===void 0||o.start(this._instance)}),!s&&(r=he.__PosthogExtensions__)!==null&&r!==void 0&&(r=r.integrations)!==null&&r!==void 0&&r[n]&&((i=he.__PosthogExtensions__)===null||i===void 0||(i=i.integrations)===null||i===void 0||(i=i[n])===null||i===void 0||i.stop())}}},KF=class{constructor(e,t){this.A=e,this.bo=t,this.lu=new Map,this.To=!1}add(e){var t=this;return We(function*(){if(t.To)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(t.lu.has(e.name))throw new Error(`Browser extension "${e.name}" is already registered`);t.lu.set(e.name,e);try{const r=e.setup(t.bo);r&&(yield r)}catch(r){const i=t.lu.get(e.name)===e;i&&t.lu.delete(e.name),t.A.error(`Failed to set up browser extension "${e.name}"`,r),i&&t.uu(e)}})()}getExtension(e){return this.lu.get(e)}dispose(){if(this.To)return;this.To=!0;const e=Array.from(this.lu.values()).reverse();this.lu.clear();for(const t of e)this.uu(t)}uu(e){try{var t;const r=(t=e.dispose)===null||t===void 0?void 0:t.call(e);r&&gt(r.then)&&r.then(void 0,i=>{this.A.error(`Failed to dispose browser extension "${e.name}"`,i)})}catch(r){this.A.error(`Failed to dispose browser extension "${e.name}"`,r)}}},YF=class{constructor(e){this._instance=e}initialize(){}get(e){const t=this._instance.persistence;if(typeof e=="string")return t?.get_property(e);const r={};for(const i of e){const n=t?.get_property(i);z(n)||(r[i]=n)}return r}set(e,t){var r;(r=this._instance.persistence)===null||r===void 0||r.register(typeof e=="string"?{[e]:t}:e)}remove(e){var t;(t=this._instance.persistence)===null||t===void 0||t.unregister(e)}},o_="extensionsRemoteConfig",XF=class{constructor(e){this.instance=e,this.To=!1,this.A=Y,this.hu=e.cu,this.kv=new YF(e),this.onEvent=t=>$a(this.instance.on("eventCaptured",r=>{try{t({event:r.event,properties:r.properties})}catch(i){this.A.error("Browser extension event listener failed",i)}})),this.onRemoteConfig=t=>{if(this.To)return $a(()=>{});const r=n=>{try{t(n)}catch(s){this.A.error("Browser extension remote config listener failed",s)}},i=this.instance.du.on(o_,r);return this.hu&&r(this.hu),$a(i)},this.vu=new KF(Y.createLogger("[BrowserExtensions]"),this)}get logger(){return this.A}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var e;return(e=this.instance.get_property("$device_id"))!==null&&e!==void 0?e:this.distinctId}get deviceId(){const e=this.instance.get_property(Tf);return typeof e=="string"?e:void 0}get library(){return{name:ut.LIB_NAME,version:ut.LIB_VERSION}}get initialPersonProperties(){var e,t;return(e=(t=this.instance.persistence)===null||t===void 0?void 0:t.get_initial_props())!==null&&e!==void 0?e:{}}get groups(){return this.instance.getGroups()}get session(){try{var e,t,r,i;const n=(e=this.instance.sessionManager)===null||e===void 0?void 0:e.checkAndGetSessionAndWindowId(!0);return{sessionId:(t=n?.sessionId)!==null&&t!==void 0?t:"",windowId:(r=n?.windowId)!==null&&r!==void 0?r:"",sessionStartTimestamp:(i=n?.sessionStartTimestamp)!==null&&i!==void 0?i:0}}catch{return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get canCapture(){return this.instance.is_capturing()}get projectToken(){return this.instance.config.token}add(e){return this.vu.add(e)}getExtension(e){return this.vu.getExtension(e)}capture(e,t,r){r?this.instance.capture(e,t,{timestamp:r.timestamp,uuid:r.uuid,$set:r.set,$set_once:r.setOnce}):this.instance.capture(e,t)}registerDynamicEventProperties(e){return $a(this.instance.fu(e))}handleRemoteConfig(e){this.To||(this.hu=e,this.instance.du.emit(o_,e))}sendRequest(e){var t=this;return We(function*(r,i={}){var n;const s=t.instance.requestRouter.endpointFor((n=i.target)!==null&&n!==void 0?n:"api",r),o={method:i.method,url:i.query?sa(s,i.query):s,data:i.body,headers:i.headers,timeout:i.timeoutMs,fireCallbackOnDrop:!0,transport:i.transport,compression:i.compression,compressionFallback:i.target==="flags"&&i.compression==="best-available"?tp.Base64:void 0,timestampMode:i.sentAt};return i.transport==="sendBeacon"?(t.instance._send_request(o),{statusCode:202}):new Promise(a=>{o.callback=a,t.instance._send_request(o)})}).apply(this,arguments)}dispose(){this.To||(this.To=!0,this.vu.dispose())}},Ro={},Bu=0,To=()=>{},a_='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Fn="Surveys module not available",c_="sanitize_properties is deprecated. Use before_send instead",lI="Invalid value for property_denylist config: ",ZF=["$recording_status","$sdk_debug_recording_script_not_loaded","$sdk_debug_replay_url_trigger_status","$sdk_debug_replay_event_trigger_status","$sdk_debug_replay_linked_flag_trigger_status","$sdk_debug_replay_rrweb_error","$sdk_debug_replay_internal_buffer_length","$sdk_debug_replay_flushed_size"],QF=["$feature_flag_called","$$heatmap","$snapshot"],l_=e=>e.charAt(0)==="$"&&!ve(QF,e),e2=/^[A-Za-z0-9_-]{1,400}$/,u_=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,d_=/^fb\.[0-9]+\.[0-9]+\.[0-9]+$/,t2=["token","distinct_id",sk],po="posthog",r2=e=>{const t={};return e&&e!=="unset"&&("2025-11-30">e||(t.strictMinimumDuration=!0),"2026-05-30">e||(t.canvasCapture={resolutionScale:.6}),"2026-06-25">e||(t.streamNetworkBody=!0),"2026-08-30">e||(t.captureJsonLd=!0)),t},Vu=e=>{var t;return S({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Zz(G?.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:To,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:e??"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:Ze&&Ae(Ze?.search)&&Ze.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,reuseAnonymousId:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:(M==null||(t=M.location)===null||t===void 0?void 0:t.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,feature_flag_request_max_retries:1,surveys_request_timeout_ms:1e4,on_request_error(r){Y.error("Bad HTTP status: "+r.statusCode+" "+r.text)},get_device_id:r=>r,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:mk,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:To},(r=>({rageclick:r&&r>="2026-05-30"?{content_ignorelist:oF,ignore_text_selection:!0}:!r||"2025-11-30">r||{content_ignorelist:!0},capture_pageview:!r||"2025-05-24">r||"history_change",session_recording:r2(r),external_scripts_inject_target:r&&r>="2026-01-30"?"head":"body",internal_or_test_user_hostname:r&&r>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:r&&r>="2026-05-30"?250:0,split_storage:!(!r||"2026-05-30">r),detect_google_search_app:!(!r||"2026-05-30">r),disable_capture_url_hashes:!(!r||"2026-06-25">r),cookieWinsOnConflict:!(!r||r==="unset"||"2026-08-29">r)}))(e))},i2=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],p_=e=>{const t={};for(const[n,s]of i2)z(e[n])||(t[s]=e[n]);const r=Ge({},t,e),i=e.__preview_external_dependency_versioned_paths;return z(i)||(z(e.strict_script_versioning)&&(r.strict_script_versioning=!!i),Ae(i)&&z(e.asset_host)&&(r.asset_host=i)),_e(e.property_blacklist)&&(z(e.property_denylist)?r.property_denylist=e.property_blacklist:_e(e.property_denylist)?r.property_denylist=[...e.property_blacklist,...e.property_denylist]:Y.error(lI+e.property_denylist)),r},n2=class{constructor(){this.__forceAllowLocalhost=!1}get pu(){return this.__forceAllowLocalhost}set pu(e){Y.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},Co=class fi{gu(t){if(!t)return;const r=this.lu.indexOf(t);r!==-1&&this.lu.splice(r,1)}mu(t,r){var i;return this.gu(t),this.lu.push(r),(i=r.initialize)===null||i===void 0||i.call(r),r}yu(){return this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isRejected()}bu(){if(this._u||this.config.reuseAnonymousId||this.config.segment||this.yu())return;const t=this.config.persistence==="memory"||this.config.persistence==="sessionStorage";if(!t&&!this.config.disable_persistence||this.wu)return;let r,i,n;t?(r=`persistence is set to '${this.config.persistence}'`,i=this.config.persistence==="memory"?"on every page load":"for every new browser tab or window",n="Either set persistence to 'localStorage+cookie', keep this persistence and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."):(r="persistence is disabled (disable_persistence is true)",i="on every page load",n="Either set disable_persistence to false, keep persistence disabled and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."),this._u=!0,console.warn("[PostHog.js]",`${r} but no bootstrap.distinctID was provided. PostHog will mint a new distinct ID ${i}, so calling identify() merges a new ID onto the person each time. A person can then pass the distinct-ID limit and its events stop appearing on person pages and the session tab. ${n}`)}ku(){if(this.yu()||this.get_distinct_id()!=="$posthog_cookieless")return;const t=this.persistence;if(!t)return;this.Su()||t.load(!0);const r=this.get_distinct_id();if(!r||r==="$posthog_cookieless"){const i=this.config.get_device_id(yr());this.register({distinct_id:i,$device_id:i}),t.set_property(zt,Qr)}this.xu()}get decideEndpointWasHit(){var t,r;return(t=(r=this.featureFlags)===null||r===void 0?void 0:r.hasLoadedFlags)!==null&&t!==void 0&&t}get flagsEndpointWasHit(){var t,r;return(t=(r=this.featureFlags)===null||r===void 0?void 0:r.hasLoadedFlags)!==null&&t!==void 0&&t}constructor(){var t;this.Cu=!1,this.$u=!1,this.webPerformance=new n2,this.Tu=!1,this.version=ut.LIB_VERSION,this.Iu=new Set,this.Mu="",this.du=new Nc,this.lu=[],this.Eu=[],this.Pu=!1,this.wu=!1,this._u=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Vu(),this.SentryIntegration=fF,this.sentryIntegration=i=>(function(n,s){const o=Ck(n,s);return{name:Tk,processEvent:a=>o(a)}})(this,i),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Ru=!1,this.Au=null,this.Fu=null,this.Ou=null,this.scrollManager=new UF(this),this.pageViewManager=new Gv(this),this.rateLimiter=new kF(this),this.requestRouter=new HF(this),this.consent=new sF(this),this.externalIntegrations=new JF(this);const r=(t=fi.__defaultExtensionClasses)!==null&&t!==void 0?t:{};this.featureFlags=r.featureFlags&&new r.featureFlags(this),this.toolbar=r.toolbar&&new r.toolbar(this),this.surveys=r.surveys&&new r.surveys(this),this.conversations=r.conversations&&new r.conversations(this),this.logs=r.logs&&new r.logs(this),this.metrics=r.metrics&&new r.metrics(this),this.experiments=r.experiments&&new r.experiments(this),this.exceptions=r.exceptions&&new r.exceptions(this),this.people={set:(i,n,s)=>{const o=Ae(i)?{[i]:n}:i;this.setPersonProperties(o),s?.({})},set_once:(i,n,s)=>{const o=Ae(i)?{[i]:n}:i;this.setPersonProperties(void 0,o),s?.({})}},this.on("eventCaptured",i=>Y.info(`send "${i?.event}"`,i))}init(t,r,i){if(i&&i!==po){var n;const s=(n=Ro[i])!==null&&n!==void 0?n:new fi;return s._init(t,r,i),Ro[i]=s,Ro[po][i]=s,s}return this._init(t,r,i)}_init(t,r={},i){var n,s,o;const a=Ae(t)?t.trim():"";if(!a)return Y.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;var c;if(this.__loaded)return a!==((c=this.config)===null||c===void 0?void 0:c.token)?console.warn("[PostHog.js]",`You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('${a}', { ... }, 'project2')`):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=Vu(r.defaults),r.debug=this.Du(r.debug),this.Lu=r,this.Nu=[],r.person_profiles?this.Fu=r.person_profiles:r.process_person&&(this.Fu=r.process_person);const l=Vu(r.defaults),u=p_(r),p=Ge({},l,u,{name:i,token:a});Pe(l.rageclick)&&Pe(u.rageclick)&&(p.rageclick=Ge({},l.rageclick,u.rageclick)),Pe(l.session_recording)&&Pe(u.session_recording)&&(p.session_recording=Ge({},l.session_recording,u.session_recording)),this.set_config(p),this.config.on_xhr_error&&Y.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=r.disable_compression?void 0:rr.GZipJS;const d=this.Su();if(this.persistence=new Nu(this.config,d),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Nu(S(S({},this.config),{},{persistence:"sessionStorage"}),d,!1),this.Mu="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties",this.config.persistence!=="memory"&&!d&&Be.Et()){const _=Be.Dt(this.Mu);_e(_)&&_.forEach(b=>{Ae(b)&&this.Iu.add(b)})}else Be.Lt(this.Mu);const h=S({},this.persistence.props),f=S({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.qu=new $F((_,b)=>this.ju(_,b),this.config.request_queue_config),this.Bu=new DF(this),this.__request_queue=[];const m=this.yu();m||(this.sessionManager=new n_(this),this.sessionPropsManager=new r_(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((_,b,A)=>{(A!=null&&A.activityTimeout||A!=null&&A.sessionPastMaximumLength||A!=null&&A.crossTabAdoption)&&this.Hu()})),this.zu(),this.config.__preview_deferred_init_extensions?(Y.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Uu(m)},0)):(Y.info("Initializing extensions synchronously"),this.Uu(m)),ut.DEBUG=ut.DEBUG||this.config.debug,ut.DEBUG&&Y.info("Starting in debug mode",{this:this,config:r,thisC:S({},this.config),p:h,s:f}),this.config.identity_distinct_id&&!((n=r.bootstrap)!==null&&n!==void 0&&n.distinctID)&&(r.bootstrap=S(S({},r.bootstrap),{},{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));const v=(s=r.bootstrap)===null||s===void 0?void 0:s.distinctID;if(this.wu=!!v&&!_o(v),(o=r.bootstrap)===null||o===void 0?void 0:o.distinctID){const _=r.bootstrap.distinctID,b=this.get_distinct_id(),A=this.persistence.get_property(zt);if(r.bootstrap.isIdentifiedID&&b!=null&&b!==_&&A==="anonymous")this.identify(_);else if(r.bootstrap.isIdentifiedID&&b!=null&&b!==_&&A==="identified")Y.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{const P=this.config.get_device_id(yr()),D=r.bootstrap.isIdentifiedID?P:_;this.persistence.set_property(zt,r.bootstrap.isIdentifiedID?tc:Qr),this.register({distinct_id:_,$device_id:D})}}if(m)this.register_once({distinct_id:Tu,$device_id:null},"");else if(!this.get_distinct_id()){const _=this.config.get_device_id(yr());this.register_once({distinct_id:_,$device_id:_},""),this.persistence.set_property(zt,Qr)}return Ne(M,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),Ne(M,"pageshow",()=>{var _;this.Cu=!1,this.$u||(_=this.Bu)===null||_===void 0||_.resume()}),r.segment?Vv(this,()=>this.Wu()):this.Wu(),gt(this.config._onCapture)&&this.config._onCapture!==To&&(Y.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",_=>this.config._onCapture(_.event,_))),this.config.ip&&Y.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||(function(){return nI.apply(this,arguments)})().then(_=>{_&&this.register({[Ru]:_})}).catch(To),this}Vu(t){const r=t;return Ae(r.name)&&gt(r.setup)}Gu(t,r){this.Vu(t)?r.push(()=>{this.Zu().add(t).catch(()=>{var i;return(i=t.dispose)===null||i===void 0?void 0:i.call(t)}).catch(i=>{Y.error(`Failed to dispose browser extension "${t.name}"`,i)})}):this.lu.push(t)}zu(){var t,r,i;const n=(t=(r=this.config.__extensionClasses)===null||r===void 0?void 0:r.featureFlags)!==null&&t!==void 0?t:(i=fi.__defaultExtensionClasses)===null||i===void 0?void 0:i.featureFlags;var s,o,a;n&&(this.featureFlags&&this.featureFlags instanceof n||((s=this.Qu)===null||s===void 0||s.call(this),this.Qu=void 0,this.featureFlags=new n(this)),gt(this.featureFlags.onReloading)&&gt(this.featureFlags.setup)?this.Qu||(this.Qu=this.featureFlags.onReloading(()=>{this.du.emit("featureFlagsReloading",!0)}),this.Zu().add(this.featureFlags)):(o=(a=this.featureFlags).initialize)===null||o===void 0||o.call(a))}Uu(t){const r=performance.now(),i=S(S({},fi.__defaultExtensionClasses),this.config.__extensionClasses),n=[];var s,o,a,c,l,u,p;i.exceptions&&this.lu.push(this.exceptions=(s=this.exceptions)!==null&&s!==void 0?s:new i.exceptions(this)),i.historyAutocapture&&this.lu.push(this.historyAutocapture=new i.historyAutocapture(this)),i.tracingHeaders&&this.lu.push(this.tracingHeaders=new i.tracingHeaders(this)),i.siteApps&&this.lu.push(this.siteApps=new i.siteApps(this)),i.sessionRecording&&!t&&this.lu.push(this.sessionRecording=new i.sessionRecording(this)),this.config.disable_scroll_properties||n.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),i.autocapture&&this.Gu(this.autocapture=new i.autocapture(this),n),i.surveys&&this.Gu(this.surveys=(o=this.surveys)!==null&&o!==void 0?o:new i.surveys(this),n),i.logs&&this.Gu(this.logs=(a=this.logs)!==null&&a!==void 0?a:new i.logs(this),n),i.metrics&&this.lu.push(this.metrics=(c=this.metrics)!==null&&c!==void 0?c:new i.metrics(this)),i.conversations&&this.lu.push(this.conversations=(l=this.conversations)!==null&&l!==void 0?l:new i.conversations(this)),i.productTours&&this.lu.push(this.productTours=new i.productTours(this)),i.heatmaps&&this.lu.push(this.heatmaps=new i.heatmaps(this)),i.webVitalsAutocapture&&this.lu.push(this.webVitalsAutocapture=new i.webVitalsAutocapture(this)),i.exceptionObserver&&this.lu.push(this.exceptionObserver=new i.exceptionObserver(this)),i.deadClicksAutocapture&&this.lu.push(this.deadClicksAutocapture=new i.deadClicksAutocapture(this,hF)),i.toolbar&&this.lu.push(this.toolbar=(u=this.toolbar)!==null&&u!==void 0?u:new i.toolbar(this)),i.experiments&&this.lu.push(this.experiments=(p=this.experiments)!==null&&p!==void 0?p:new i.experiments(this)),this.lu.forEach(d=>{d.initialize&&n.push(()=>{var h;(h=d.initialize)===null||h===void 0||h.call(d)})}),n.push(()=>{if(this.Ju){const d=this.Ju;this.Ju=void 0,this.lu.forEach(h=>{var f;return(f=h.onRemoteConfig)===null||f===void 0?void 0:f.call(h,d)})}}),this.Ku(n,r)}Ku(t,r){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-r>=30&&t.length>0)return void setTimeout(()=>{this.Ku(t,r)},0);const n=t.shift();if(n)try{n()}catch(s){Y.error("Error initializing extension:",s)}}const i=Math.round(performance.now()-r);this.register_for_session({[ok]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[ak]:i}),this.config.__preview_deferred_init_extensions&&Y.info(`PostHog extensions initialized (${i}ms)`)}el(t){var r;if(!G||!G.body)return Y.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.el(t)},500);if(this.config.__preview_deferred_init_extensions&&(this.Ju=t),this.cu=t,this.compression=void 0,t.ok){var i;const n=t.config;n.supportedCompression&&!this.config.disable_compression&&(this.compression=ve(n.supportedCompression,rr.GZipJS)?rr.GZipJS:ve(n.supportedCompression,rr.Base64)?rr.Base64:void 0),(i=n.analytics)!==null&&i!==void 0&&i.endpoint&&(this.analyticsDefaultEndpoint=n.analytics.endpoint)}this.set_config({person_profiles:this.Fu?this.Fu:mk}),(r=this.Xu)===null||r===void 0||r.handleRemoteConfig(t),this.lu.forEach(n=>{var s;return(s=n.onRemoteConfig)===null||s===void 0?void 0:s.call(n,t)})}Wu(){try{this.config.loaded(this)}catch(t){Y.critical("`loaded` function failed",t)}if(this.Yu(),this.config.internal_or_test_user_hostname&&Ze?.hostname){const t=Ze.hostname,r=this.config.internal_or_test_user_hostname;(typeof r=="string"?t===r:r.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.yu())&&this.th()},1),this.eh=new zk(this),this.eh.load()}Yu(){var t;this.is_capturing()&&this.config.request_batching&&((t=this.qu)===null||t===void 0||t.enable())}_dom_loaded(){this.is_capturing()&&rs(this.__request_queue,t=>this.ju(t)),this.__request_queue=[],this.Yu()}_handle_unload(){var t,r,i,n,s,o;this.Cu=!0,(t=this.surveys)===null||t===void 0||(r=t.handlePageUnload)===null||r===void 0||r.call(t),(i=this.metrics)===null||i===void 0||i.flush("sendBeacon"),this.config.request_batching?(this.ih()&&this.capture(Cv),(n=this.logs)===null||n===void 0||n.flushLogs("sendBeacon"),(s=this.qu)===null||s===void 0||s.unload(),(o=this.Bu)===null||o===void 0||o.unload()):this.ih()&&this.capture(Cv,null,{transport:"sendBeacon"})}_send_request(t){rI(this,t)}ju(t,r){this.Bu?this.Bu.retriableRequest(t,r):this._send_request(r?S(S({},t),{},{transport:r}):t)}_execute_array(t){Bu++;try{let r;const i=[],n=[],s=[];rs(t,a=>{if(a)if(r=a[0],_e(r))s.push(a);else if(gt(a))try{a.call(this)}catch(c){Y.error("Error executing queued PostHog call",a,c)}else _e(a)&&r==="alias"?i.push(a):_e(a)&&r.indexOf("capture")!==-1&&gt(this[r])?s.push(a):n.push(a)});const o=function(a,c){rs(a,function(l){try{if(_e(l[0])){let u=c;je(l,function(p){u=u[p[0]].apply(u,p.slice(1))})}else c[l[0]].apply(c,l.slice(1))}catch(u){Y.error("Error executing queued PostHog call",l,u)}})};o(i,this),o(n,this),o(s,this)}finally{Bu--}}push(t){if(Bu>0&&_e(t)&&Ae(t[0])){const r=fi.prototype[t[0]];gt(r)&&r.apply(this,t.slice(1));return}this._execute_array([t])}get nh(){return{property:Rv,persistenceKey:ls,cookieName:"_fbc",pattern:u_,register:(t,r)=>{var i;return(i=this.persistence)===null||i===void 0?void 0:i.register({[ls]:{value:t,delivered:r}})},unregister:()=>{var t;return(t=this.persistence)===null||t===void 0?void 0:t.unregister(ls)}}}get sh(){return{property:Tv,persistenceKey:bo,cookieName:"_fbp",pattern:d_,register:(t,r)=>{var i;return(i=this.persistence)===null||i===void 0?void 0:i.register({[bo]:{value:t,delivered:r}})},unregister:()=>{var t;return(t=this.persistence)===null||t===void 0?void 0:t.unregister(bo)}}}rh(t){var r;const i=(r=this.persistence)===null||r===void 0?void 0:r.get_property(t.persistenceKey);return Ae(i)&&t.pattern.test(i)?{value:i,delivered:!1}:Pe(i)&&Ae(i.value)&&t.pattern.test(i.value)?{value:i.value,delivered:i.delivered===!0}:void 0}oh(t,r,i){return r===i?.value?{value:r,pending:!i.delivered}:(t.register(r,!1),{value:r,pending:!0})}ah(t){if(!this.config.save_campaign_params||this.yu())return;const r=Eo(t.cookieName);return Ae(r)&&t.pattern.test(r)?r:void 0}uh(t,r,i,n){if(!this.persistence)return;const s=this.nh;this.persistence.refreshKey(s.persistenceKey);const o=this.rh(s);if(n)return void s.unregister();if(i)return Ae(r)&&u_.test(r)?this.oh(s,r,o):void s.unregister();const a=Ae(t)&&e2.test(t)?t:void 0,c=this.ah(s);return c&&((l,u,p)=>{const d=l.split(".");if(u)return d[3]===u;if(!p)return!0;const h=p.value.split(".");return d[3]===h[3]||Number(d[2])>Number(h[2])})(c,a,o)?this.oh(s,c,o):a?o?.value.split(".")[3]===a?{value:o.value,pending:!o.delivered}:this.oh(s,`fb.1.${Date.now()}.${a}`,o):o?{value:o.value,pending:!o.delivered}:void 0}hh(t,r,i){if(!this.persistence)return;const n=this.sh;this.persistence.refreshKey(n.persistenceKey);const s=this.rh(n);if(i)return void n.unregister();if(r)return Ae(t)&&d_.test(t)?this.oh(n,t,s):void n.unregister();const o=this.ah(n);return o?this.oh(n,o,s):s?{value:s.value,pending:!s.delivered}:void 0}dh(t,r){if(!this.persistence)return;this.persistence.refreshKey(t.persistenceKey);const i=this.rh(t);i?.value!==r||i.delivered||t.register(r,!0)}capture(t,r,i){var n,s;if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this.qu))return void Y.uninitializedWarning("posthog.capture");if(!this.is_capturing())return;if(z(t)||!Ae(t))return void Y.error("No event name provided to posthog.capture");this.ku();const o=!this.config.opt_out_useragent_filter&&this._is_bot();if(o&&!this.config.__preview_capture_bot_pageviews)return;const a=i?.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(a?.isRateLimited)return void Y.critical("This capture call is ignored due to client rate limiting.");let c;r!=null&&r.$current_url&&!Ae(r?.$current_url)&&(Y.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),r==null||delete r.$current_url),t!=="$exception"||i!=null&&i.fh||Y.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&(c=this.sessionPersistence.update_campaign_params()),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();const l=new Date,u=i?.timestamp||l,p=dv(i?.uuid,yr);let d={uuid:p,event:t,properties:this.calculateEventProperties(t,r||{},u,p)};t==="$pageview"&&this.config.__preview_capture_bot_pageviews&&o&&(d.event="$bot_pageview",d.properties.$browser_type="bot"),a&&(d.properties.$lib_rate_limit_remaining_tokens=a.remainingTokens);const h=t==="$feature_flag_called"&&d.properties.$feature_flag_has_experiment===!1&&this.get_property("$minimal_flag_called_events")===!0;i!=null&&i.$set&&!h&&(d.$set=i?.$set);const f=Pe(r?.$set)?r.$set:void 0,m=_e(r?.$unset)?r.$unset:[],v=i?.$unset||[],_=K=>{var pe;const L=!!i?.$set&&K in i.$set;return{hasProvided:L||!!f&&K in f,provided:L?i==null||(pe=i.$set)===null||pe===void 0?void 0:pe[K]:f?.[K],unset:m.indexOf(K)!==-1||v.indexOf(K)!==-1}},b=_(Rv),A=_(Tv),P=[{channel:this.nh,hasProvided:b.hasProvided,update:this.uh(c?.fbclid,b.provided,b.hasProvided,b.unset)},{channel:this.sh,hasProvided:A.hasProvided,update:this.hh(A.provided,A.hasProvided,A.unset)}];for(const{channel:K,hasProvided:pe,update:L}of P)L&&d.properties.$process_person_profile===!0&&L.pending&&!pe&&!h&&(d.$set=S({[K.property]:L.value},d.$set));const D=i?.$unset;D&&(d.$unset=D);const $=h?void 0:this.ph(i?.$set_once,t!==Pv,t===gk);if($&&(d.$set_once=$),i!=null&&i._noTruncate||(q=this.config.properties_string_max_length,d=(function(K,pe){const L=new Set;return(function oe(y,X){if(y!==Object(y))return pe?pe(y):y;if(L.has(y))return;let te;if(L.add(y),_e(y))te=[],rs(y,F=>{te.push(oe(F))});else{const F={};je(Ns(y)?vk(y):y,(R,Z)=>{L.has(R)||(F[Z]=oe(R,Z))}),te=F}return te})(K)})(d,K=>Ae(K)?K.slice(0,q):K)),d.timestamp=u,z(i?.timestamp)||(d.properties.$event_time_override_provided=!0,d.properties.$event_time_override_system_time=l),h&&(d.properties=((K,pe=[])=>{const L={},oe=y=>{K[y]!==void 0&&(L[y]=K[y])};return _z.forEach(oe),pe.forEach(oe),L})(d.properties,t2)),t===tr.DISMISSED||t===tr.SENT){const K=r?.[Uu.SURVEY_ID],pe=r?.[Uu.SURVEY_ITERATION];cI({id:K,current_iteration:pe}),d.$set=S(S({},d.$set),{},{[jF({id:K,current_iteration:pe},t===tr.SENT?"responded":"dismissed")]:!0})}else t===tr.SHOWN&&(d.$set=S(S({},d.$set),{},{[Uu.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));var q;if(t===EF.SHOWN){const K=r?.[Kv.TOUR_TYPE];K&&(d.$set=S(S({},d.$set),{},{[`${Kv.TOUR_LAST_SEEN_DATE}/${K}`]:new Date().toISOString()}))}const j=S(S({},d.properties.$set),d.$set);if(Kt(j)||this.setPersonPropertiesForFlags(j),!we(this.config.before_send)){const K=this.Os(d);if(!K)return;d=K,d.uuid=dv(d.uuid,yr)}this.sessionRecording&&!this.Pu&&l_(t)&&(this.Pu=!0,setTimeout(()=>this.Pu=!1,3e4));const J=P.filter(({channel:K,update:pe})=>{var L,oe,y;const X=(L=(oe=d.$set)===null||oe===void 0?void 0:oe[K.property])!==null&&L!==void 0?L:Pe((y=d.properties)===null||y===void 0?void 0:y.$set)?d.properties.$set[K.property]:void 0;return pe?.pending&&X===pe.value});this.du.emit("eventCaptured",d);const se=(n=i?._url)!==null&&n!==void 0?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),ce=i?._batchKey==="recordings"||/\/s\/(?:\?|$)/.test(se),T=S(S(S({method:"POST",url:se,data:d,compression:"best-available",preferSyncCompression:i?.send_instantly,timestampMode:ce?"body":"capture-body",batchKey:i?._batchKey},ce&&(!((s=d.properties)===null||s===void 0)&&s.$session_id)?{batchGroup:d.properties.$session_id+(d.properties.$window_id?`-${d.properties.$window_id}`:"")}:{}),i?.transport?{transport:i.transport}:{}),J.length?{fireCallbackOnDrop:!0,callback:K=>{if(K.statusCode>=200&&300>K.statusCode)for(const{channel:pe,update:L}of J)this.dh(pe,L.value)}}:{});if(!this.config.request_batching||i&&!i?._batchKey||i?.send_instantly||J.length){var de;let K;!T.transport&&!T.callback&&Kt((de=this.config.request_headers)!==null&&de!==void 0?de:{})&&this.Cu&&(K="sendBeacon"),this.ju(T,K)}else this.qu.enqueue(T);return d}_addCaptureHook(t){return this.on("eventCaptured",r=>t(r.event,r))}getExtension(t){var r;return(r=this.Xu)===null||r===void 0?void 0:r.getExtension(t)}Zu(){var t;return(t=this.Xu)!==null&&t!==void 0?t:this.Xu=new XF(this)}fu(t){this.Eu.push(t);let r=!0;return()=>{if(!r)return;r=!1;const i=this.Eu.indexOf(t);i!==-1&&this.Eu.splice(i,1)}}gh(t=!0){var r,i,n;return!!(!((r=this.persistence)===null||r===void 0)&&r.consumeCookieIdentityChange())&&(this.Ou=null,this.persistence.get_property("$user_state")==="anonymous"&&((n=this.sessionPersistence)===null||n===void 0||n.clear(),this.Iu.clear(),this.mh()),(i=this.featureFlags)===null||i===void 0||i.reset(),t&&this.reloadFeatureFlags(),!0)}calculateEventProperties(t,r,i,n,s){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return r;this.persistence.syncCookieProperties(),this.gh();const o=s?void 0:this.persistence.remove_event_timer(t);let a=S({},r);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this.yu()&&(a[sk]=!0),t==="$snapshot"){const b=S(S({},this.persistence.properties()),this.sessionPersistence.properties());return a.distinct_id=b.distinct_id,(!Ae(a.distinct_id)&&!nt(a.distinct_id)||_o(a.distinct_id))&&Y.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}const c=(function(b,A,P,D=!1){var $,q,j,J;if(!qt)return{};const se=b?[...Es,...A||[]]:[],[ce,T]=IE(qt),[de,K]=(function(ie){for(let ue=0;uv.length>ue;ue++){const[ae,Fe,ze]=uv[ue],Ie=ie.match(ae);if(Ie){const H=ze&&ie.match(ze)||Ie;return[Fe,H?.[1]||""]}}return["",""]})(qt),pe=(function(){const ie="u">typeof navigator?navigator:void 0;return ie?.brave?{brave:!0}:{}})(),L={};z(P)||(L.detectGoogleSearchApp=P);const oe={},y=($=navigator)===null||$===void 0||($=$.userAgentData)===null||$===void 0?void 0:$.platform,X=(q=navigator)===null||q===void 0?void 0:q.maxTouchPoints,te=M==null||(j=M.screen)===null||j===void 0?void 0:j.width,F=M==null||(J=M.screen)===null||J===void 0?void 0:J.height,R=M?.devicePixelRatio;z(y)||(oe.userAgentDataPlatform=y),z(X)||(oe.maxTouchPoints=X),z(te)||(oe.screenWidth=te),z(F)||(oe.screenHeight=F),z(R)||(oe.devicePixelRatio=R);const Z=Ge(Nf({$os:ce,$os_version:T,$browser:kE(qt,navigator.vendor,pe,L),$webview_app:de,$webview_app_version:K,$device:AE(qt),$device_type:jj(qt,oe),$timezone:qk(),$timezone_offset:bF()}),{$current_url:Ho(D?qi(Ze?.href):Ze?.href,se,Bo),$host:Ze?.host,$pathname:Ze?.pathname,$raw_user_agent:qt.length>1e3?qt.substring(0,997)+"...":qt,$browser_version:qj(qt,navigator.vendor,pe,L),$browser_language:$k(),$browser_language_prefix:yF(),$screen_height:M?.screen.height,$screen_width:M?.screen.width,$viewport_height:M?.innerHeight,$viewport_width:M?.innerWidth,$lib:ei.LIB_NAME,$lib_version:ei.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return ei.SDK_DIST_CHANNEL&&(Z.$sdk_dist_channel=ei.SDK_DIST_CHANNEL),Z})(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){const{sessionId:b,windowId:A}=this.sessionManager.checkAndGetSessionAndWindowId(s,i.getTime(),!0);a.$session_id=b,a.$window_id=A}this.sessionPropsManager&&Ge(a,this.sessionPropsManager.getSessionProps());try{var l;if(this.sessionRecording){const b=this.sessionRecording.sdkDebugProperties,A=!this.Pu&&l_(t);for(const P in b)(A||ve(ZF,P))&&(a[P]=b[P])}a.$sdk_debug_retry_queue_size=(l=this.Bu)===null||l===void 0?void 0:l.length}catch(b){a.$sdk_debug_error_capturing_properties=String(b)}let u;if(this.requestRouter.region===Tp&&(a.$lib_custom_api_host=this.config.api_host),u=t!=="$pageview"||s?t!=="$pageleave"||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,n),a=Ge(a,u),t==="$pageview"&&G&&(a.title=G.title),!z(o)){const b=i.getTime()-o;a.$duration=parseFloat((b/1e3).toFixed(3))}qt&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser");const p=this.persistence.properties(),d=this.sessionPersistence.properties(),h=a.$groups,f=p.$groups;Pe(h)&&!Kt(h)&&(a.$groups=S(S({},Pe(f)?f:{}),h)),je(["$referrer","$referring_domain"],b=>{b in p&&delete d[b]});const m={};if(this.Eu.length>0)for(const b of this.Eu.slice())try{Ge(m,b())}catch(A){Y.error("Failed to produce browser extension event properties",A)}a=Ge({},c,p,d,S(S({},m),a)),a.$is_identified=this._isIdentified(),_e(this.config.property_denylist)?je(this.config.property_denylist,function(b){delete a[b]}):Y.error(lI+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);const v=this.config.sanitize_properties;v&&(Y.error(c_),a=v(a,t));const _=this.yh();return a.$process_person_profile=_,_&&!s&&this.bh("_calculate_event_properties"),a}ph(t,r=!0,i=!1){var n;if(!this.persistence||!this.yh()||this.Tu&&!i)return t;const s=this.persistence.get_initial_props(),o=(n=this.sessionPropsManager)===null||n===void 0?void 0:n.getSetOnceProps();let a=Ge({},s,o||{},t||{});const c=this.config.sanitize_properties;return c&&(Y.error(c_),a=c(a,"$set_once")),r&&(this.Tu=!0),Kt(a)?void 0:a}register(t,r){var i;(i=this.persistence)===null||i===void 0||i.register(t,r)}register_once(t,r,i){var n;(n=this.persistence)===null||n===void 0||n.register_once(t,r,i)}register_for_session(t){var r,i;(r=this.persistence)===null||r===void 0||r.syncCookieProperties(),this.gh(),(i=this.sessionPersistence)===null||i===void 0||i.register(t),Object.keys(t).forEach(n=>this.Iu.add(n)),this.mh()}unregister(t){var r;(r=this.persistence)===null||r===void 0||r.unregister(t)}unregister_for_session(t){var r;(r=this.sessionPersistence)===null||r===void 0||r.unregister(t),this.Iu.delete(t),this.mh()}_h(t,r){this.register({[t]:r})}Hu(){this.Iu.forEach(t=>{var r;(r=this.sessionPersistence)===null||r===void 0||r.unregister(t)}),this.Iu.clear(),this.mh()}mh(){var t;if(!this.Mu)return;if(this.config.persistence==="memory"||!((t=this.sessionPersistence)===null||t===void 0)&&t.hi||!Be.Et())return void Be.Lt(this.Mu);const r=[];this.Iu.forEach(i=>r.push(i)),r.length>0?Be.$t(this.Mu,r):Be.Lt(this.Mu)}getFeatureFlag(t,r){var i;return(i=this.featureFlags)===null||i===void 0?void 0:i.getFeatureFlag(t,r)}getFeatureFlagPayload(t){var r;return(r=this.featureFlags)===null||r===void 0?void 0:r.getFeatureFlagPayload(t)}getFeatureFlagResult(t,r){var i;return(i=this.featureFlags)===null||i===void 0?void 0:i.getFeatureFlagResult(t,r)}getAllFeatureFlags(){var t,r;return(t=(r=this.featureFlags)===null||r===void 0?void 0:r.getAllFeatureFlags())!==null&&t!==void 0?t:[]}isFeatureEnabled(t,r){var i,n;return(i=(n=this.featureFlags)===null||n===void 0?void 0:n.isFeatureEnabled(t,r))!==null&&i!==void 0?i:r?.defaultValue}reloadFeatureFlags(){var t;(t=this.featureFlags)===null||t===void 0||t.reloadFeatureFlags()}updateFlags(t,r,i){var n;(n=this.featureFlags)===null||n===void 0||n.updateFlags(t,r,i)}updateEarlyAccessFeatureEnrollment(t,r,i){var n;(n=this.featureFlags)===null||n===void 0||n.updateEarlyAccessFeatureEnrollment(t,r,i)}getEarlyAccessFeatures(t,r=!1,i){var n;return(n=this.featureFlags)===null||n===void 0?void 0:n.getEarlyAccessFeatures(t,r,i)}on(t,r){return this.du.on(t,r)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:Fn}),()=>{})}onSessionId(t){var r,i;return(r=(i=this.sessionManager)===null||i===void 0?void 0:i.onSessionId(t))!==null&&r!==void 0?r:()=>{}}getSurveys(t,r=!1){this.surveys?this.surveys.getSurveys(t,r):t([],{isLoaded:!1,error:Fn})}getActiveMatchingSurveys(t,r=!1){this.surveys?this.surveys.getActiveMatchingSurveys(t,r):t([],{isLoaded:!1,error:Fn})}onActiveMatchingSurveysChanged(t){return this.surveys?this.surveys.onActiveMatchingSurveysChanged(t):(t([],{isLoaded:!1,error:Fn}),()=>{})}renderSurvey(t,r){var i;(i=this.surveys)===null||i===void 0||i.renderSurvey(t,r)}displaySurvey(t,r=VF){var i;(i=this.surveys)===null||i===void 0||i.displaySurvey(t,r)}cancelPendingSurvey(t){var r;(r=this.surveys)===null||r===void 0||r.cancelPendingSurvey(t)}canRenderSurvey(t){var r,i;return(r=(i=this.surveys)===null||i===void 0?void 0:i.canRenderSurvey(t))!==null&&r!==void 0?r:{visible:!1,disabledReason:Fn}}canRenderSurveyAsync(t,r=!1){var i,n;return(i=(n=this.surveys)===null||n===void 0?void 0:n.canRenderSurveyAsync(t,r))!==null&&i!==void 0?i:Promise.resolve({visible:!1,disabledReason:Fn})}wh(t){return!t||_o(t)?(Y.critical("Unique user id has not been set in posthog.identify"),!1):t==="$posthog_cookieless"?(Y.critical(`The string "${t}" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.`),!1):!["distinct_id","distinctid"].includes(t.toLowerCase())&&!["undefined","null"].includes(t.toLowerCase())||(Y.critical(`The string "${t}" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.`),!1)}identify(t,r,i){if(!this.__loaded||!this.persistence)return Y.uninitializedWarning("posthog.identify");if(nt(t)&&(t=t.toString(),Y.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),!this.wh(t)||!this.bh("posthog.identify"))return;this.ku();const n=this.get_distinct_id(),s=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==n,o=this.gh(!1),a=this.persistence.Oa();let c=!1;try{const u=this.get_distinct_id();this.register({$user_id:t}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:u},""),t!==u&&t!==this.get_property("__alias")&&(this.unregister(Cc),this.register({distinct_id:t}));const p=(this.persistence.get_property("$user_state")||"anonymous")===Qr,d=t!==u,h=!d&&p;if(d&&p){var l;const f=this.config.reuseAnonymousId?{distinct_id:t}:{distinct_id:t,$anon_distinct_id:u};this.persistence.set_property(zt,tc),this.setPersonPropertiesForFlags({$set:r||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.Da(),this.capture("$identify",f,{$set:r||{},$set_once:i||{}})&&(this.Ou=Hu(t,r,i)),(l=this.featureFlags)===null||l===void 0||l.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:u)}else if(h){this.persistence.set_property(zt,tc);const f=r||{},m=i||{};this.setPersonPropertiesForFlags({$set:f,$set_once:m},!1),this.config.cookieWinsOnConflict&&this.persistence.Da(),this.capture("$set",{$set:f,$set_once:m})&&(this.Ou=Hu(t,r,i))}else(r||i)&&this.setPersonProperties(r,i);d||s||o?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(ki)):h&&(r||i)&&this.reloadFeatureFlags(),c=!0}finally{a&&this.persistence.qa(c)}}setPersonProperties(t,r){if(!t&&!r||!this.bh("posthog.setPersonProperties"))return;const i=Hu(this.get_distinct_id(),t,r);this.Ou!==i?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:r||{}},!0),this.capture("$set",{$set:t||{},$set_once:r||{}})&&(this.Ou=i)):Y.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}unsetPersonProperties(t){var r;const i=(_e(t)?t:[t]).filter(n=>Ae(n)&&n.length>0);i.length!==0&&this.bh("posthog.unsetPersonProperties")&&((r=this.featureFlags)===null||r===void 0||r.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.Ou=null)}group(t,r,i){var n;if(!t||!r)return void Y.error("posthog.group requires a group type and group key");(n=this.persistence)===null||n===void 0||n.syncCookieProperties(),this.gh();const s=this.getGroups(),o=s[t]!==r;if(o&&this.resetGroupPropertiesForFlags(t),this.register({$groups:S(S({},s),{},{[t]:r})}),(o||i)&&this.yh()){const a={$group_type:t,$group_key:r};i&&(a.$group_set=i),this.capture(Pv,a)}i&&this.setGroupPropertiesForFlags({[t]:i}),o&&!i&&this.reloadFeatureFlags()}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,r=!0){var i;(i=this.featureFlags)===null||i===void 0||i.setPersonPropertiesForFlags(t,r)}resetPersonPropertiesForFlags(t=!0){var r;(r=this.featureFlags)===null||r===void 0||r.resetPersonPropertiesForFlags(t)}setGroupPropertiesForFlags(t,r=!0){var i;this.bh("posthog.setGroupPropertiesForFlags")&&((i=this.featureFlags)===null||i===void 0||i.setGroupPropertiesForFlags(t,r))}resetGroupPropertiesForFlags(t){var r;(r=this.featureFlags)===null||r===void 0||r.resetGroupPropertiesForFlags(t)}reset(t){const r=Ft(t)?t:t?.resetDeviceID,i=Ft(t)||t==null?void 0:t.bootstrap;this.kh(r,!1,i)}kh(t,r=!1,i){var n,s,o,a,c,l;if(Y.info("reset"),!this.__loaded)return Y.uninitializedWarning("posthog.reset");const u=i?.sessionID;this.config.bootstrap=i||((n=this.Lu)===null||n===void 0?void 0:n.bootstrap)||{},(s=this.featureFlags)===null||s===void 0||(o=s.updateConfig)===null||o===void 0||o.call(s,this.config,this.il());const p=this.get_property(Tf),d=this.get_property(Ru),h=this.get_property(So);(a=this.sessionRecording)===null||a===void 0||a.flushBeforeIdentityReset();const f=this.is_capturing();this.consent.reset(),r||!f||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");const m=(c=this.persistence)===null||c===void 0||(l=c.Oa)===null||l===void 0?void 0:l.call(c);let v=!1;try{var _,b,A,P,D,$,q,j,J,se,ce,T,de;if((_=this.persistence)===null||_===void 0||_.clear(),(b=this.sessionPersistence)===null||b===void 0||b.clear(),this.Iu.clear(),this.mh(),z(h)||(se=this.persistence)===null||se===void 0||se.register({$session_recording_remote_config:h}),(A=this.surveys)===null||A===void 0||A.reset(),(P=this.featureFlags)===null||P===void 0||P.reset(),(D=this.conversations)===null||D===void 0||D.reset(),($=this.logs)===null||$===void 0||$.reset(),(q=this.metrics)===null||q===void 0||q.reset(),(j=this.persistence)===null||j===void 0||j.set_property("$user_state","anonymous"),(J=this.sessionManager)===null||J===void 0||J.resetSessionId(),this.Ou=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:Tu,$device_id:null},"");else{const L=this.config.get_device_id(yr());this.register_once({distinct_id:L,$device_id:t?L:p},""),t||z(d)||this.register({[Ru]:d})}if(this.register({$last_posthog_reset:new Date().toISOString()},1),i&&(i.distinctID&&!this.yu()&&((de=this.persistence)===null||de===void 0||de.set_property("$user_state",i.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:i.distinctID})),(ce=this.featureFlags)===null||ce===void 0||ce.initialize(),!we(u)&&!(!((T=this.sessionManager)===null||T===void 0)&&T.setBootstrapSessionId(u,!0)))){const L=S({},i);delete L.sessionID,this.config.bootstrap=L}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,v=!0}finally{var K,pe;m&&((K=this.persistence)===null||K===void 0||(pe=K.qa)===null||pe===void 0||pe.call(K,v))}this.reloadFeatureFlags()}shutdown(t){var r=this;return We(function*(){var i,n,s,o,a,c,l,u;if(r.__loaded){r.$u=!0,r.Zu().dispose(),(i=r.sessionRecording)===null||i===void 0||i.dispose(),(n=r.logs)===null||n===void 0||n.flushLogs("sendBeacon"),(s=r.metrics)===null||s===void 0||s.flush("sendBeacon"),(o=r.metrics)===null||o===void 0||o.dispose(),(a=r.qu)===null||a===void 0||a.unload(),(c=r.Bu)===null||c===void 0||c.unload();try{var p;(p=r.featureFlags)===null||p===void 0||p.destroy()}catch(d){Y.error("Error while destroying feature flags",d)}(l=r.persistence)===null||l===void 0||l.destroy(),(u=r.sessionPersistence)===null||u===void 0||u.destroy()}else Y.uninitializedWarning("posthog.shutdown")})()}setIdentity(t,r){var i;delete this.config.identity_claims,this.config.identity_distinct_id=t,this.config.identity_hash=r,this.alias(t),(i=this.conversations)===null||i===void 0||i.Sh()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,(t=this.conversations)===null||t===void 0||t.xh()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,r;return(t=(r=this.sessionManager)===null||r===void 0?void 0:r.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&t!==void 0?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";const{sessionId:r,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0);let n=this.requestRouter.endpointFor("ui",`/project/${this.config.token}/replay/${r}`);if(t?.withTimestamp&&i){var s;const o=(s=t.timestampLookBack)!==null&&s!==void 0?s:10;if(!i)return n;n+=`?t=${Math.max(Math.floor((new Date().getTime()-i)/1e3)-o,0)}`}return n}alias(t,r){return t===this.get_property("$people_distinct_id")?(Y.critical("Attempting to create alias for existing People user - aborting."),-2):this.bh("posthog.alias")?(z(r)&&(r=this.get_distinct_id()),t!==r?(this._h(Cc,t),this.capture("$create_alias",{alias:t,distinct_id:r})):(Y.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){const r=S({},this.config);if(Pe(t)){var i,n,s,o,a,c,l,u,p,d,h,f,m,v;Ge(this.config,p_(t));const b=this.Su();(i=this.persistence)===null||i===void 0||i.update_config(this.config,r,b),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Nu(S(S({},this.config),{},{persistence:"sessionStorage"}),b,!1);const A=this.Du(this.config.debug);var _;Ft(A)&&(this.config.debug=A),Ft(this.config.debug)&&(this.config.debug?(ut.DEBUG=!0,Me.Et()&&Me.$t("ph_debug",!0),Y.info("set_config",{config:t,oldConfig:r,newConfig:S({},this.config)})):(ut.DEBUG=!1,Me.Et()&&Me.Lt("ph_debug"))),(n=this.featureFlags)===null||n===void 0||(s=n.updateConfig)===null||s===void 0||s.call(n,this.config,this.il()),(o=this.exceptionObserver)===null||o===void 0||o.onConfigChange(),(a=this.exceptions)===null||a===void 0||a.onConfigChange(),(c=this.metrics)===null||c===void 0||c.onConfigChange(),(l=this.sessionRecording)===null||l===void 0||l.startIfEnabledOrStop(),(u=this.tracingHeaders)===null||u===void 0||u.startIfEnabledOrStop(),(p=this.autocapture)===null||p===void 0||p.startIfEnabled(),(d=this.heatmaps)===null||d===void 0||d.startIfEnabled(),("capture_pageview"in t||"disable_capture_url_hashes"in t)&&((_=this.historyAutocapture)===null||_===void 0||_.startIfEnabledOrStop()),(h=this.exceptionObserver)===null||h===void 0||h.startIfEnabledOrStop(),(f=this.deadClicksAutocapture)===null||f===void 0||f.startIfEnabledOrStop(),(m=this.surveys)===null||m===void 0||m.loadIfEnabled(),this.xu(),(v=this.externalIntegrations)===null||v===void 0||v.startIfEnabledOrStop(),!r.segment&&this.config.segment&&this.persistence&&Vv(this,To,!1)}}_overrideSDKInfo(t,r){ut.LIB_NAME=t,ut.LIB_VERSION=r}startSessionRecording(t){const r=t===!0,i={sampling:r||!!t?.sampling,linked_flag:r||!!t?.linked_flag,url_trigger:r||!!t?.url_trigger,event_trigger:r||!!t?.event_trigger};var n,s,o,a,c;Object.values(i).some(Boolean)&&((n=this.sessionManager)===null||n===void 0||n.checkAndGetSessionAndWindowId(),i.sampling&&((s=this.sessionRecording)===null||s===void 0||s.overrideSampling()),i.linked_flag&&((o=this.sessionRecording)===null||o===void 0||o.overrideLinkedFlag()),i.url_trigger&&((a=this.sessionRecording)===null||a===void 0||a.overrideTrigger("url")),i.event_trigger&&((c=this.sessionRecording)===null||c===void 0||c.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!!(!((t=this.sessionRecording)===null||t===void 0)&&t.started)}captureException(t,r){try{if(!this.exceptions)return;const i=this.exceptions.buildProperties(t,{handled:!0,syntheticException:new Error("PostHog syntheticException")});return this.exceptions.sendExceptionEvent(S(S({},i),r))}catch{return}}addExceptionStep(t,r){var i;(i=this.exceptions)===null||i===void 0||i.addExceptionStep(t,r)}captureLog(t){var r;(r=this.logs)===null||r===void 0||r.captureLog(t)}get logger(){var t,r;return(t=(r=this.logs)===null||r===void 0?void 0:r.logger)!==null&&t!==void 0?t:fi.Ch}startExceptionAutocapture(t){this.set_config({capture_exceptions:t==null||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var r,i;return(r=(i=this.toolbar)===null||i===void 0?void 0:i.loadToolbar(t))!==null&&r!==void 0&&r}get_property(t){var r;return(r=this.persistence)===null||r===void 0?void 0:r.props[t]}getSessionProperty(t){var r;return(r=this.sessionPersistence)===null||r===void 0?void 0:r.props[t]}toString(){var t;let r=(t=this.config.name)!==null&&t!==void 0?t:po;return r!==po&&(r="posthog."+r),r}_isIdentified(){var t,r;return((t=this.persistence)===null||t===void 0?void 0:t.get_property("$user_state"))==="identified"||((r=this.sessionPersistence)===null||r===void 0?void 0:r.get_property("$user_state"))==="identified"}yh(){var t,r;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Kt(this.getGroups())&&!(!((t=this.persistence)===null||t===void 0||(t=t.props)===null||t===void 0)&&t.__alias)&&!(!((r=this.persistence)===null||r===void 0||(r=r.props)===null||r===void 0)&&r.$epp))}ih(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&!!this.config.capture_pageview}createPersonProfile(){this.yh()||this.bh("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.bh("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}bh(t){return this.config.person_profiles==="never"?(Y.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.bu(),this._h(Of,!0),!0)}Su(){if(this.config.cookieless_mode==="always")return!0;const t=this.consent.isOptedOut();return this.config.disable_persistence||t&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!=="on_reject")}xu(){var t,r;const i=this.Su();var n,s,o;return this.is_capturing()||(n=this.logs)===null||n===void 0||n.$h(),((t=this.persistence)===null||t===void 0?void 0:t.hi)!==i&&((s=this.persistence)===null||s===void 0||s.set_disabled(i)),((r=this.sessionPersistence)===null||r===void 0?void 0:r.hi)!==i&&((o=this.sessionPersistence)===null||o===void 0||o.set_disabled(i)),i&&(this.Iu.clear(),this.mh()),i}opt_in_capturing(t){var r;if(this.config.cookieless_mode!=="always"){if(this.yu()){var i,n,s,o,a,c;(i=this.sessionRecording)===null||i===void 0||i.dispose({discardBufferedEvents:!0}),this.kh(!0,!0),(n=this.sessionManager)===null||n===void 0||n.destroy(),(s=this.pageViewManager)===null||s===void 0||s.destroy(),this.sessionManager=new n_(this),this.pageViewManager=new Gv(this),this.persistence&&(this.sessionPropsManager=new r_(this,this.sessionManager,this.persistence));const h=(o=(a=this.config.__extensionClasses)===null||a===void 0?void 0:a.sessionRecording)!==null&&o!==void 0?o:(c=fi.__defaultExtensionClasses)===null||c===void 0?void 0:c.sessionRecording;var l,u;h&&(this.sessionRecording=this.mu(this.sessionRecording,new h(this)),this.cu&&((l=this.sessionRecording)===null||l===void 0||(u=l.onRemoteConfig)===null||u===void 0||u.call(l,this.cu)))}var p,d;this.consent.optInOut(!0),this.xu(),this.Yu(),(r=this.sessionRecording)===null||r===void 0||r.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&((p=this.surveys)===null||p===void 0||p.loadIfEnabled()),(z(t?.captureEventName)||t!=null&&t.captureEventName)&&this.capture((d=t?.captureEventName)!==null&&d!==void 0?d:"$opt_in",t?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.th()}else Y.warn(a_)}opt_out_capturing(){if(this.config.cookieless_mode==="always")return void Y.warn(a_);const t=this.config.cookieless_mode==="on_reject"?this.sessionRecording:void 0;var r,i;t?.dispose({discardBufferedEvents:!0}),this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.kh(!0,!0),this.consent.optInOut(!1),this.xu(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:Tu,$device_id:null}),this.gu(t),this.sessionRecording=void 0,(r=this.sessionManager)===null||r===void 0||r.destroy(),(i=this.pageViewManager)===null||i===void 0||i.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.th(),this.Yu())}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){const t=this.consent.consent;return t===1?"granted":t===0?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.xu()}_is_bot(){return vt?iI(vt,this.config.custom_blocked_useragents):void 0}th(){G&&(G.visibilityState==="visible"?this.Ru||(this.Ru=!0,this.capture($f,{title:G.title},{send_instantly:!0}),this.Au&&(G.removeEventListener(jo,this.Au),this.Au=null)):this.Au||(this.Au=this.th.bind(this),Ne(G,jo,this.Au)))}debug(t){t===!1?(M?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(M?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}il(){const t=this.Lu||{};return"advanced_disable_flags"in t?!!t.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(Y.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(function(r,i,n,s,o){const a=i in r&&!we(r[i]),c=n in r&&!we(r[n]);return a?r[i]:!!c&&(o&&o.warn(`Config field '${n}' is deprecated. Please use '${i}' instead. The old field will be removed in a future major version.`),r[n])})(t,"advanced_disable_flags","advanced_disable_decide",0,Y)}Os(t){var r;if(we(this.config.before_send))return t;const i=Object.keys((r=t.properties)!==null&&r!==void 0?r:{}).filter(Tj),n=_e(this.config.before_send)?this.config.before_send:[this.config.before_send];let s=t;for(const o of n)try{if(s=o(s),we(s)){const a=`Event '${t.event}' was rejected in beforeSend function`;return Rj(t.event)?Y.warn(`${a}. This can cause unexpected behavior.`):Y.info(a),null}s.properties&&!Kt(s.properties)||Y.warn(`Event '${t.event}' has no properties after beforeSend function, this is likely an error.`)}catch(a){return Y.error(`Error in beforeSend function for event '${t.event}':`,a),null}for(const o of i)if(s.properties&&we(s.properties[o]))return Y.warn(`Event '${t.event}' had its '${o}' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped.`),null;return s}getPageViewId(){var t;return(t=this.pageViewManager.Wo)===null||t===void 0?void 0:t.pageViewId}captureTraceFeedback(t,r){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:r})}captureTraceMetric(t,r,i){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:r,$ai_metric_value:String(i)})}Du(t){const r=Ft(t)&&!t,i=Me.Et()&&Me.Ot("ph_debug")==="true";return!r&&(!!i||t)}};Co.__defaultExtensionClasses={},Co.Ch=(()=>{const e=()=>{};return{trace:e,debug:e,info:e,warn:e,error:e,fatal:e}})(),(function(e,t){for(let r=0;t.length>r;r++)e.prototype[t[r]]=Yz(e.prototype[t[r]])})(Co,["identify"]);var uI=class{constructor(e){this.disabled=e===!1;const t=Pe(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,r){if(this.disabled)return!1;const i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(t-i.y)<this.thresholdPx&&this.timeoutMs>r-i.timestamp){if(this.clicks.push({x:e,y:t,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:r}];return!1}},Gu="$copy_autocapture",Wu=tt("[AutoCapture]");function Ju(e,t){return t.length>e?t.slice(0,e)+"...":t}function s2(e){if(e.previousElementSibling)return e.previousElementSibling;let t=e;do t=t.previousSibling;while(t&&!jr(t));return t}function o2(e,{e:t,maskAllElementAttributes:r,maskAllText:i,elementAttributeIgnoreList:n,elementsChainAsString:s,disableCaptureUrlHashes:o}){var a,c;if(!jr(e))return{props:{}};const l=[e],u=new Set([e]);let p=e;for(;p.parentNode&&!Pt(p,"body")&&1e3>l.length;){if(Df(p.parentNode)){const $=p.parentNode.host;if(u.has($))break;u.add($),l.push($),p=$;continue}if(!jr(p.parentNode)||u.has(p.parentNode))break;u.add(p.parentNode),l.push(p.parentNode),p=p.parentNode}const d=t.type==="click"&&e.namespaceURI==="http://www.w3.org/2000/svg"?l.findIndex($=>Pt($,"button")||Pt($,"a")):-1;d>0&&(i=i||l.slice(0,d+1).some($=>!us($)||Fo($)));const h=[],f={};let m,v=!1,_=!1;if(je(l,$=>{const q=us($);if(Pt($,"a")&&!r&&!n?.includes("href")){const j=$.getAttribute("href");v=!!(q&&j&&Io(j))&&(o?qi(j):j)}ve(Ss($),"ph-no-capture")&&(_=!0),h.push((function(j,J,se,ce,T=!1){const de=j.tagName.toLowerCase(),K={tag_name:de};qf.indexOf(de)>-1&&!se&&(K.$el_text=de.toLowerCase()==="a"||de.toLowerCase()==="button"?Ju(1024,Fv(j)):Ju(1024,zo(j)));const pe=Ss(j);J||ce!=null&&ce.includes("class")||0>=pe.length||(K.classes=pe.filter(function(X){return X!==""})),je(j.attributes,function(X){var te;if((!Fo(j)||["name","id","class","aria-label"].indexOf(X.name)!==-1)&&!ce?.includes(X.name)&&!J&&Io(X.value)&&(!Ae(te=X.name)||te.substring(0,10)!=="_ngcontent"&&te.substring(0,7)!=="_nghost")){let F=X.value;X.name==="class"&&(F=Uf(F).join(" ")),K["attr__"+X.name]=Ju(1024,X.name==="href"&&T?qi(F):F)}});let L=1,oe=1,y=j;for(;y=s2(y);)L++,y.tagName===j.tagName&&oe++;return K.nth_child=L,K.nth_of_type=oe,K})($,r,i,n,o)),je((function(j){if(!us(j))return{};const J={};return je(j.attributes,function(se){if(se.name&&se.name.indexOf("data-ph-capture-attribute")===0){const ce=se.name.replace("data-ph-capture-attribute-",""),T=se.value;ce&&T&&Io(T)&&(J[ce]=T)}}),J})($),(j,J)=>{({}).hasOwnProperty.call(f,J)||(f[J]=j)})}),_)return{props:{},explicitNoCapture:_};if(d>0&&(e=l[d],h.splice(0,d)),i||(h[0].$el_text=Pt(e,"a")||Pt(e,"button")?Fv(e):zo(e)),v){var b,A;h[0].attr__href=v;const $=(b=si(v))===null||b===void 0?void 0:b.host,q=M==null||(A=M.location)===null||A===void 0?void 0:A.host;$&&q&&$!==q&&(m=v)}return{props:Ge((D=t.type,{$event_type:D,$ce_version:1}),s?{}:{$elements:h},{$elements_chain:(P=h,_e(P)?(function($){return $.map(q=>{var j,J;let se="";if(q.tag_name&&(se+=q.tag_name),q.attr_class){q.attr_class.sort();for(const de of q.attr_class)se+=`.${de.replace(/"/g,"")}`}const ce=S(S(S(S({},q.text?{text:q.text}:{}),{},{"nth-child":(j=q.nth_child)!==null&&j!==void 0?j:0,"nth-of-type":(J=q.nth_of_type)!==null&&J!==void 0?J:0},q.href?{href:q.href}:{}),q.attr_id?{attr_id:q.attr_id}:{}),q.attributes),T={};return rc(ce).sort(([de],[K])=>(function(pe,L){return L>pe?-1:pe>L?1:0})(de,K)).forEach(([de,K])=>T[Hv(de.toString())]=Hv(K.toString())),se+=":",se+=rc(T).map(([de,K])=>`${de}="${K}"`).join(""),se}).join(";")})((function($){return $.map(q=>{var j,J;const se={text:(j=q.$el_text)===null||j===void 0?void 0:j.slice(0,400),tag_name:q.tag_name,href:(J=q.attr__href)===null||J===void 0?void 0:J.slice(0,2048),attr_class:dF(q),attr_id:q.attr__id,nth_child:q.nth_child,nth_of_type:q.nth_of_type,attributes:{}};return rc(q).filter(([ce])=>ce.indexOf("attr__")===0).forEach(([ce,T])=>se.attributes[ce]=T),se})})(P)):"")},!((a=h[0])===null||a===void 0)&&a.$el_text?{$el_text:(c=h[0])===null||c===void 0?void 0:c.$el_text}:{},m&&t.type==="click"?{$external_click_url:m}:{},f),target:e};var P,D}var a2=class{do(){this.vo=void 0,clearTimeout(this.fo),this.fo=void 0}po(e){var t;if(!us(e))return!0;const r=(t=this.mo().css_selector_ignorelist)!==null&&t!==void 0?t:Lu,i=new Set;let n=e;for(;n;){if(i.size>=1e3||i.has(n))return!0;i.add(n);const s=n,o=Ss(s);if(ve(o,"ph-no-capture")||ve(o,"ph-sensitive")||Fo(s)||r.some(c=>Sp(s,c)))return!0;const a=n.parentNode;n=Df(a)?a.host:a&&jr(a)?a:null}return!1}yo(e){if(!this.isEnabled||e.type==="pointercancel")return void this.do();if(e.type==="pointerdown"){this.do();const i=ko(e);var t;e.isPrimary&&e.button===0&&!e.ctrlKey&&i&&jr(i)&&(this.vo={target:i,excluded:this.po(i),id:e.pointerId,x:e.clientX,y:e.clientY,released:!1,distinctId:(t=this.bo)===null||t===void 0?void 0:t.distinctId});return}const r=this.vo;r&&(e.pointerId!==r.id||Math.abs(e.clientX-r.x)>5||Math.abs(e.clientY-r.y)>5?this.do():e.type==="pointerup"&&(r.released=!0,this.fo=setTimeout(()=>this.do(),0)))}_o(e){var t;const r=this.vo;this.do();const i=ko(e);if(r?.released&&r.target.isConnected&&r.distinctId===((t=this.bo)===null||t===void 0?void 0:t.distinctId)&&e.pointerId===r.id&&(e.detail>0||e.pointerType==="touch"||e.pointerType==="pen")&&e.button===0&&5>=Math.abs(e.clientX-r.x)&&5>=Math.abs(e.clientY-r.y)&&i&&(Pt(i,"html")||Pt(i,"body"))){var n;if(r.excluded)return null;const s=(n=this.mo().css_selector_ignorelist)!==null&&n!==void 0?n:Lu;return[i,G?.documentElement,G?.body].some(o=>{if(!o)return!1;const a=Ss(o);return ve(a,"ph-no-capture")||ve(a,"ph-sensitive")||!us(o)||Fo(o)||s.some(c=>Sp(o,c))})?null:r.target}}constructor(e){this.wo=e,this.name="autocapture",this.ko=!1,this.So=null,this.xo=!1,this.Co=new Map,this.$o=!1,this.Ir={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.To=!1,this.wo.refresh(this.Ir),this.rageclicks=new uI(this.Ir.rageclick),this.Io=null}setup(e){this.Mo(),this.bo=e;const t=e.onRemoteConfig(this.onRemoteConfig.bind(this));this.To?t.dispose():(this.Eo=t,this.startIfEnabled())}dispose(){var e;this.To||(this.To=!0,this.bo=void 0,(e=this.Eo)===null||e===void 0||e.dispose(),this.Eo=void 0,this.Co.clear(),this.Io=null,this.Po())}mo(){return this.wo.refresh(this.Ir),this.Ir}Mo(){var e,t;return this.mo(),this.Ir.url_allowlist=(e=this.Ir.url_allowlist)===null||e===void 0?void 0:e.map(r=>new RegExp(r)),this.Ir.url_ignorelist=(t=this.Ir.url_ignorelist)===null||t===void 0?void 0:t.map(r=>new RegExp(r)),this.Ir}Ro(){if(!this.isBrowserSupported())return void Wu.info("Disabling Automatic Event Collection because this browser is not supported");if(!M||!G)return;const e=this.Ao=t=>{t=t||M?.event;try{if(t.type==="blur")return void this.do();if(t.type.indexOf("pointer")===0)return void this.yo(t);const r=t.type==="click"?this._o(t):void 0;if(Qe(r))return;this.Fo(t,"$autocapture",r)}catch(r){Wu.error("Failed to capture event",r)}};if(Ne(M,"blur",e),Ne(G,"submit",e,{capture:!0}),Ne(G,"change",e,{capture:!0}),Ne(G,"click",e,{capture:!0}),je(["pointerdown","pointermove","pointerup","pointercancel"],t=>{Ne(G,t,e,{capture:!0})}),this.mo().capture_copied_text){const t=this.Oo=r=>{r=r||M?.event;try{this.Fo(r,Gu)}catch(i){Wu.error("Failed to capture clipboard event",i)}};Ne(G,"copy",t,{capture:!0}),Ne(G,"cut",t,{capture:!0}),Ne(G,"paste",t,{capture:!0})}}Po(){this.do(),this.Ao&&(M?.removeEventListener("blur",this.Ao),je(["pointerdown","pointermove","pointerup","pointercancel"],e=>{G?.removeEventListener(e,this.Ao,!0)}),G?.removeEventListener("submit",this.Ao,!0),G?.removeEventListener("change",this.Ao,!0),G?.removeEventListener("click",this.Ao,!0),this.Ao=void 0),this.Oo&&(G?.removeEventListener("copy",this.Oo,!0),G?.removeEventListener("cut",this.Oo,!0),G?.removeEventListener("paste",this.Oo,!0),this.Oo=void 0),this.ko=!1}startIfEnabled(){this.isEnabled||this.do(),!this.To&&this.bo&&this.isEnabled&&!this.ko&&(this.Ro(),this.ko=!0)}onRemoteConfig(e){if(this.To)return;if(this.xo=!0,!e.ok)return void this.startIfEnabled();const t=e.config;t.elementsChainAsString&&(this.$o=t.elementsChainAsString);const r=t.autocapture_opt_out;var i;Ft(r)&&((i=this.bo)===null||i===void 0||i.kv.set("$autocapture_disabled_server_side",r),this.So=r),this.startIfEnabled()}setElementSelectors(e,t=this){if(this.To)return;e.size?this.Co.set(t,new Set(e)):this.Co.delete(t);const r=new Set;this.Co.forEach(i=>{i.forEach(n=>r.add(n))}),this.Io=r}getElementSelectors(e,t){var r;const i=[];return(r=this.Io)===null||r===void 0||r.forEach(n=>{G?.querySelectorAll(n)?.forEach(s=>{e!==s&&t!==s||ve(i,n)||i.push(n)})}),i}get isEnabled(){var e,t;if(this.To)return!1;const r=(e=this.bo)===null||e===void 0?void 0:e.kv.get(JE),i=this.So,n=this.mo();if(!n.remoteRequestsDisabled&&!this.xo)return!1;const s=n.remoteRequestsDisabled&&!this.xo;if(Qe(i)&&!Ft(r)&&!s)return!1;const o=(t=this.So)!==null&&t!==void 0?t:!!r;return!!n.enabled&&!o}Fo(e,t="$autocapture",r){if(!this.isEnabled)return void this.do();let i=r||ko(e);Sk(i)&&(i=i.parentNode||null);const n=this.Mo();var s;t==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&n.rageclick&&(s=this.rageclicks)!==null&&s!==void 0&&s.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&Ik(i,n.rageclick)&&this.Fo(e,"$rageclick",r);const o=t===Gu,a=o?S(S({},n),{},{dom_event_allowlist:void 0}):n;if(i&&(function(p,d,h,f,m,v){var _;if(!M||jf(p)||h?.url_allowlist&&!$v(h.url_allowlist,v)||h?.url_ignorelist&&$v(h.url_ignorelist,v))return!1;if(h?.dom_event_allowlist){const D=h.dom_event_allowlist;if(D&&!D.some($=>d.type===$))return!1}const{parentIsUsefulElement:b,targetElementList:A}=Ak(p,f);if(!(function(D,$){const q=$?.element_allowlist;if(z(q))return!0;for(const j of D)if(q.some(J=>j.tagName.toLowerCase()===J))return!0;return!1})(A,h)||!wp(A,h?.css_selector_allowlist)||wp(A,(_=h?.css_selector_ignorelist)!==null&&_!==void 0?_:Lu))return!1;try{const D=M.getComputedStyle(p);if(D&&D.getPropertyValue("cursor")==="pointer"&&d.type==="click")return!0}catch{}const P=p.tagName.toLowerCase();switch(P){case"html":return!1;case"form":return(m||["submit"]).indexOf(d.type)>=0;case"input":case"select":case"textarea":return(m||["change","click"]).indexOf(d.type)>=0;default:return b?(m||["click"]).indexOf(d.type)>=0:(m||["click"]).indexOf(d.type)>=0&&(qf.indexOf(P)>-1||p.getAttribute("contenteditable")==="true")}})(i,e,a,o,o?["copy","cut","paste"]:void 0,{config:{get_current_url:n.getCurrentUrl}})){var c;const{props:p,explicitNoCapture:d,target:h}=o2(i,{e,maskAllElementAttributes:n.maskAllElementAttributes,maskAllText:n.maskAllText,elementAttributeIgnoreList:n.element_attribute_ignorelist,elementsChainAsString:this.$o,disableCaptureUrlHashes:n.disableCaptureUrlHashes});if(d)return!1;const f=this.getElementSelectors(i,h);if(f&&f.length>0&&(p.$element_selectors=f),t===Gu){const m=e.type||"clipboard";if(m!=="paste"){var l,u;const v=M==null||(l=M.getSelection())===null||l===void 0?void 0:l.toString(),_=wk(v);if(!_)return!1;p.$selected_content=_,p.$clipboard_text_length=(u=v?.length)!==null&&u!==void 0?u:0}p.$copy_type=m}return(c=this.bo)===null||c===void 0||c.capture(t,p),!0}}isBrowserSupported(){return gt(G?.querySelectorAll)}},c2=class{constructor(e){this._instance=e}refresh(e){const t=this._instance.config,r=Pe(t.autocapture)?t.autocapture:void 0;e.enabled=!!t.autocapture,e.rageclick=t.rageclick,e.maskAllElementAttributes=t.mask_all_element_attributes,e.maskAllText=t.mask_all_text,e.disableCaptureUrlHashes=t.disable_capture_url_hashes,e.getCurrentUrl=t.get_current_url,e.remoteRequestsDisabled=this._instance.il(),e.url_allowlist=r?.url_allowlist,e.url_ignorelist=r?.url_ignorelist,e.dom_event_allowlist=r?.dom_event_allowlist,e.element_allowlist=r?.element_allowlist,e.css_selector_allowlist=r?.css_selector_allowlist,e.css_selector_ignorelist=r?.css_selector_ignorelist,e.element_attribute_ignorelist=r?.element_attribute_ignorelist,e.capture_copied_text=r?.capture_copied_text}},ro=tt("[ExceptionAutocapture]"),h_=()=>{},f_=e=>{var t;if(gt(e))return(t=e.__posthog_layer__)!==null&&t!==void 0?t:e.__rrweb_layer__};function Vo(e,t,r){try{if(!(t in e))return h_;const i={next:e[t]},n=r(function(...s){return i.next.apply(this,s)});return gt(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:i}})),e[t]=n,()=>{if(e[t]===n)return void(e[t]=i.next);let s=e[t],o=f_(s);for(;o;){if(o.next===n)return void(o.next=i.next);s=o.next,o=f_(s)}}}catch{return h_}}var l2=tt("[TracingHeaders]"),Gi=tt("[Web Vitals]"),m_=9e5,g_=["CLS","FCP","INP","LCP"],u2=["INP","LCP"],d2=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],Ku="disabled",v_="lazy_loading",Vr=tt("[SessionRecording]"),p2=[xf,Mf,ck,lk,uk,dk,pk,hk,fk],h2=tt("[Heatmaps]");function Yu(e){return Pe(e)&&"clientX"in e&&"clientY"in e&&nt(e.clientX)&&nt(e.clientY)}var Da=tt("[Product Tours]"),Xu=e=>{var t;return!e.config.disable_product_tours&&!!(!((t=e.persistence)===null||t===void 0)&&t.get_property(Pf))},f2=["$set_once","$set"],Ar=tt("[SiteApps]"),__="Error while initializing PostHog app with config id ",dI=(e,t)=>e?.then?e.then(t):t(e),Hn="SDK is not enabled or survey functionality is not yet loaded",y_="Disabled. Not loading surveys.",m2=class{constructor(e,t){this.wo=e,this.Th=t,this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Ih=!1,this.Mh=!1,this.Eh=[],this.Ph=[],this.Rh=null,this.Ah=null,this.To=!1,this.Fh=new Set,this.onRemoteConfig=r=>{if(this.To||this.Ir.disableSurveys)return;if(!r.ok)return this.Mh=!0,this.Oh({isLoaded:!1,error:"Remote config unavailable. Not loading surveys."}),De.warn("Remote config unavailable. Not loading surveys.");const i=r.config.surveys;if(we(i))return De.warn("Flags not loaded yet. Not loading surveys.");this.Dh=Ft(i)?i:i.length>0,De.info(`flags response received, isSurveysEnabled: ${this.Dh}`),this.loadIfEnabled()},this.Oh=r=>{this.Ph.slice().forEach(i=>this.Lh(i,r))}}setup(e){if(!this.To)return this.Nh=e,dI(e.kv.initialize(),()=>{if(this.Nh!==e||this.To)return;this.Nh=void 0,this.bo=e;const t=e.onRemoteConfig(this.onRemoteConfig);this.To?t.dispose():(this.Eo=t,this.loadIfEnabled())})}dispose(){var e,t,r,i,n;this.To||(this.To=!0,this.Nh=void 0,this.bo=void 0,(e=this.Eo)===null||e===void 0||e.dispose(),this.Eo=void 0,(t=this._surveyEventReceiver)===null||t===void 0||t.dispose(),this._surveyEventReceiver=null,(r=this._surveyManager)===null||r===void 0||(i=r.dispose)===null||i===void 0||i.call(r),this._surveyManager=null,this.Eh=[],this.Ph.forEach(s=>{s.active=!1}),this.Ph=[],(n=this.qh)===null||n===void 0||n.call(this),this.qh=void 0,this.Rh=null,this.Fh.forEach(s=>clearTimeout(s)),this.Fh.clear())}get Ir(){return this.wo.get()}initialize(){this.loadIfEnabled()}reset(){var e,t;(e=this._surveyManager)===null||e===void 0||(t=e.clearInMemoryInProgressSurveyState)===null||t===void 0||t.call(e);try{var r;(r=this._surveyEventReceiver)===null||r===void 0||r.reset(),localStorage.removeItem("lastSeenSurveyDate");const i=[];for(let n=0;n<localStorage.length;n++){const s=localStorage.key(n);(s!=null&&s.startsWith("seenSurvey_")||s!=null&&s.startsWith("inProgressSurvey_"))&&i.push(s)}i.forEach(n=>localStorage.removeItem(n))}catch{}this.Oh()}loadIfEnabled(){if(this.To||!this.bo)return;const e=this.Ir;if(this._surveyManager)return;if(this.Ih)return void De.info("Already initializing surveys, skipping...");if(e.disableSurveys)return void De.info(y_);if(e.cookielessMode&&this.wo.isOptedOut())return void De.info("Not loading surveys in cookieless mode without consent.");const t=this.wo.getExtensions();if(!t)return void this.jh("PostHog Extensions not found.");if(z(this.Dh)&&!e.advancedEnableSurveys)return;const r=this.Dh||e.advancedEnableSurveys;this.Ih=!0,this.Mh=!1;try{const i=t.generateSurveys;if(i)return this.Bh(i,r),void(this.Ih=!1);const n=t.loadExternalDependency;if(!n)return this.jh(Lf),void(this.Ih=!1);n(s=>{try{if(this.To)return;const o=this.wo.getExtensions();s||!o?.generateSurveys?this.jh("Could not load surveys script",s):this.Bh(o.generateSurveys,r)}finally{this.Ih=!1}})}catch(i){throw this.Ih=!1,this.jh("Error initializing surveys",i),i}}Bh(e,t){var r,i;if(this.To)return;this._surveyManager=e(t),this._surveyEventReceiver=this.wo.createEventReceiver(this.Oh);const n=(r=(i=this.bo)!==null&&i!==void 0?i:this.Th)===null||r===void 0?void 0:r.kv.get(lo);n&&this.Hh(n),De.info("Surveys loaded successfully"),this.zh(),this.Oh(),this.Uh({isLoaded:!0})}jh(e,t){this.Mh=!0,De.error(e,t),this.Oh({isLoaded:!1,error:e}),this.Uh({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.Eh.push(e),this._surveyManager&&this.Uh({isLoaded:!0}),()=>{this.Eh=this.Eh.filter(t=>t!==e)}}getSurveys(e,t=!1){var r;const i=(r=this.bo)!==null&&r!==void 0?r:this.Th;if(!i||this.To)return;if(this.Ir.disableSurveys)return De.info(y_),e([]);const n=i.kv.get(lo);if(n&&!t)return e(n,{isLoaded:!0}),void(this.Wh()&&this.getSurveys(()=>{},!0));if(this.Rh)return void this.Rh.then(({surveys:a,context:c})=>{this.To||e(a,c)}).catch(a=>De.error("Error in survey callback",a));const s=this.Vh("/api/surveys/",{method:"GET",query:{token:i.projectToken},sentAt:"query",timeoutMs:this.Ir.requestTimeoutMs}).then(a=>{try{return this.Gh(i,a)}catch(c){return De.error("Error processing surveys response",c),this.Gh(i,{statusCode:0,error:c})}},a=>this.Gh(i,{statusCode:0,error:a}));this.Rh=s;const o=()=>{this.Rh===s&&(this.Rh=null)};s.then(a=>{o(),this.To||(this.Oh(a.context),e(a.surveys,a.context))},o).catch(a=>De.error("Error in survey callback",a))}Vh(e,t){const r=this.bo;return r?r.sendRequest(e,t):new Promise(i=>i({statusCode:0,error:new Error(Hn)}))}Gh(e,t){if(this.To)return{surveys:[],context:{isLoaded:!1,error:Hn}};const r=t.statusCode;if(r!==200||!t.json){const n=`Surveys API could not be loaded, status: ${r}`;return r!==0?De.error(n):t.error||De.warn(n),this.Ah=Date.now(),{surveys:[],context:{isLoaded:!1,error:n}}}this.Ah=null;const i=t.json.surveys||[];return e.kv.set({[lo]:i,[Pc]:Date.now()}),this.Hh(i),{surveys:i,context:{isLoaded:!0}}}Hh(e){var t;const r=e.filter(i=>(function(n){return!(!n.start_date||n.end_date)})(i)&&(sI(i)||(function(n){var s;return!!(!((s=n.conditions)===null||s===void 0||(s=s.actions)===null||s===void 0||(s=s.values)===null||s===void 0)&&s.length)})(i)));(t=this._surveyEventReceiver)===null||t===void 0||t.replace(r)}Wh(){return this.Zh()&&!this.Rh&&!this.Qh()}Zh(){var e,t;const r=(e=(t=this.bo)!==null&&t!==void 0?t:this.Th)===null||e===void 0?void 0:e.kv.get(Pc);return nt(r)&&Date.now()-r>3e5}Qh(){return nt(this.Ah)&&3e5>Date.now()-this.Ah}markSurveyAsSeen(e,t){var r;const i={id:e,current_iteration:(r=t?.iteration)!==null&&r!==void 0?r:null};cI(i);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}this.Oh()}Uh(e){for(const t of this.Eh)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(r){De.error("Error in survey callback",r)}}getActiveMatchingSurveys(e,t=!1){if(!we(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);De.warn("init was not called")}onActiveMatchingSurveysChanged(e){var t,r;if(this.To)return()=>{};const i={callback:e,active:!0,revision:0};this.Ph.push(i),this.zh();const n=(t=(r=this.bo)!==null&&r!==void 0?r:this.Th)===null||t===void 0?void 0:t.kv.get(lo);return this.Ir.disableSurveys||!this._surveyManager&&this.Mh&&!this.Ih||!n&&!we(this.Ah)&&!this.Rh?this.Lh(i,{isLoaded:!1}):this._surveyManager&&this.Lh(i),()=>{var s;i.active=!1,this.Ph=this.Ph.filter(o=>o!==i),this.Ph.length===0&&((s=this.qh)===null||s===void 0||s.call(this),this.qh=void 0)}}zh(){var e,t,r;this._surveyManager&&this.Ph.length>0&&((e=this.qh)!==null&&e!==void 0||(this.qh=(t=(r=this.wo).onMatchingConditionsChanged)===null||t===void 0?void 0:t.call(r,this.Oh)))}Lh(e,t){if(this.To||!e.active)return;const r=++e.revision,i=n=>{if(!this.To&&e.active&&r===e.revision)try{const s=t??{isLoaded:!0},o=JSON.stringify([n,s]);if(o===e.lastResult)return;e.lastResult=o,e.callback(n,s)}catch(s){De.error("Error in active matching surveys callback",s)}};try{t&&!t.isLoaded?i([]):this.getActiveMatchingSurveys(i)}catch(n){De.error("Error in active matching surveys callback",n)}}Jh(e){let t=null;return this.getSurveys(r=>{var i;t=(i=r.find(n=>n.id===e))!==null&&i!==void 0?i:null}),t}Kh(e){if(we(this._surveyManager))return{eligible:!1,reason:Hn};const t=typeof e=="string"?this.Jh(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}Xh(e){if(!this.wo.isCapturing())return{eligible:!1,reason:"PostHog is not capturing, so a survey response cannot be recorded"};if(we(this._surveyManager))return{eligible:!1,reason:Hn};const t=typeof e=="string"?this.Jh(e):e;return t?this._surveyManager.checkSurveyRenderability(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(we(this._surveyManager))return De.warn("init was not called"),{visible:!1,disabledReason:Hn};const t=this.Xh(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return we(this._surveyManager)?(De.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Hn})):new Promise(r=>{this.getSurveys(i=>{var n;const s=(n=i.find(o=>o.id===e))!==null&&n!==void 0?n:null;if(s){const o=this.Xh(s);r({visible:o.eligible,disabledReason:o.reason})}else r({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,r){var i;if(!this.wo.isCapturing())return;if(we(this._surveyManager))return void De.warn("init was not called");const n=typeof e=="string"?this.Jh(e):e;if(!n?.id)return void De.warn("Survey not found");if(!BF.includes(n.type))return void De.warn(`Surveys of type ${n.type} cannot be rendered in the app`);const s=G?.querySelector(t);if(s){if(!((i=n.appearance)===null||i===void 0)&&i.surveyPopupDelaySeconds){De.info(`Rendering survey ${n.id} with delay of ${n.appearance.surveyPopupDelaySeconds} seconds`);const o=setTimeout(()=>{var a,c;this.Fh.delete(o),!this.To&&this.wo.isCapturing()&&(De.info(`Rendering survey ${n.id} with delay of ${(a=n.appearance)===null||a===void 0?void 0:a.surveyPopupDelaySeconds} seconds`),(c=this._surveyManager)===null||c===void 0||c.renderSurvey(n,s,r),De.info(`Survey ${n.id} rendered`))},1e3*n.appearance.surveyPopupDelaySeconds);this.Fh.add(o);return}this._surveyManager.renderSurvey(n,s,r)}else De.warn("Survey element not found")}displaySurvey(e,t){var r;if(!this.wo.isCapturing())return;if(we(this._surveyManager))return void De.warn("init was not called");const i=this.Jh(e);if(!i)return void De.warn("Survey not found");let n=i;if((r=i.appearance)!==null&&r!==void 0&&r.surveyPopupDelaySeconds&&t.ignoreDelay&&(n=S(S({},i),{},{appearance:S(S({},i.appearance),{},{surveyPopupDelaySeconds:0})})),t.displayType!==Ep.Popover&&t.initialResponses&&De.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),t.ignoreConditions===!1){const s=this.Kh(i);if(!s.eligible)return void De.warn("Survey is not eligible to be displayed: ",s.reason)}t.displayType!==Ep.Inline?this._surveyManager.handlePopoverSurvey(n,t):this.renderSurvey(n,t.selector,t.properties)}cancelPendingSurvey(e){we(this._surveyManager)?De.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e,t;(e=this._surveyManager)===null||e===void 0||(t=e.handlePageUnload)===null||t===void 0||t.call(e)}};function Bn(e,t,r){if(we(e))return!1;switch(r){case"exact":return e===t;case"contains":{const i=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(i,"i").test(e)}case"regex":try{return new RegExp(t).test(e)}catch{return!1}default:return!1}}var g2=class{constructor(e){this._instance=e,this.Yh=new Set,this.tc=new Set,this.ec=new Nc,this.nc=(t,r)=>this.sc(t,r)&&this.rc(t,r)&&this.oc(t,r)&&this.ac(t,r),this.sc=(t,r)=>!r?.event||t?.event===r?.event}init(){var e,t;z((e=this._instance)===null||e===void 0?void 0:e._addCaptureHook)||(this.lc=(t=this._instance)===null||t===void 0?void 0:t._addCaptureHook((r,i)=>{this.on(r,i)}))}dispose(){var e,t;(e=this.lc)===null||e===void 0||e.call(this),this.lc=void 0,(t=this._instance)===null||t===void 0||(t=t.autocapture)===null||t===void 0||t.setElementSelectors(new Set,this),this.ec=new Nc}register(e){var t,r;if(!z((t=this._instance)===null||t===void 0?void 0:t._addCaptureHook)&&(e.forEach(i=>{var n;this.Yh.add(i),(n=i.steps)===null||n===void 0||n.forEach(s=>{this.tc.add(s?.event||"")})}),(r=this._instance)===null||r===void 0?void 0:r.autocapture)){const i=new Set;this.Yh.forEach(n=>{var s;(s=n.steps)===null||s===void 0||s.forEach(o=>{o!=null&&o.selector&&i.add(o.selector)})}),this._instance.autocapture.setElementSelectors(i,this)}}replace(e){this.Yh.clear(),this.tc.clear(),this.register(e)}on(e,t){t!=null&&e.length!=0&&(this.tc.has(e)||this.tc.has(t.event))&&this.Yh.forEach(r=>{this.uc(t,r)&&this.ec.emit("actionCaptured",r.name)})}hc(e){this.onAction("actionCaptured",t=>e(t))}uc(e,t){if(t?.steps==null)return!1;for(const r of t.steps)if(this.nc(e,r))return!0;return!1}onAction(e,t){return this.ec.on(e,t)}rc(e,t){if(t?.url){var r;const i=e==null||(r=e.properties)===null||r===void 0?void 0:r.$current_url;if(!i||typeof i!="string"||!Bn(i,t.url,t.url_matching||"contains"))return!1}return!0}oc(e,t){return!!this.cc(e,t)&&!!this.dc(e,t)&&!!this.vc(e,t)}cc(e,t){var r;if(!t?.href)return!0;const i=this.fc(e);if(i.length>0)return i.some(s=>Bn(s.href,t.href,t.href_matching||"exact"));const n=(e==null||(r=e.properties)===null||r===void 0?void 0:r.$elements_chain)||"";return!!n&&Bn((function(s){const o=s.match(/(?::|")href="(.*?)"/);return o?o[1]:""})(n),t.href,t.href_matching||"exact")}dc(e,t){var r;if(!t?.text)return!0;const i=this.fc(e);if(i.length>0)return i.some(c=>Bn(c.text,t.text,t.text_matching||"exact")||Bn(c.$el_text,t.text,t.text_matching||"exact"));const n=(e==null||(r=e.properties)===null||r===void 0?void 0:r.$elements_chain)||"";return!!n&&(s=(function(c){const l=[],u=/(?::|")text="(.*?)"/g;let p;for(;!we(p=u.exec(c));)l.includes(p[1])||l.push(p[1]);return l})(n),o=t.text,a=t.text_matching||"exact",s.some(c=>Bn(c,o,a)));var s,o,a}vc(e,t){var r,i;if(!t?.selector)return!0;const n=e==null||(r=e.properties)===null||r===void 0?void 0:r.$element_selectors;if(n?.includes(t.selector))return!0;const s=(e==null||(i=e.properties)===null||i===void 0?void 0:i.$elements_chain)||"";if(t.selector_regex&&s)try{return new RegExp(t.selector_regex).test(s)}catch{return!1}return!1}fc(e){var t;return(e==null||(t=e.properties)===null||t===void 0?void 0:t.$elements)==null?[]:e?.properties.$elements}ac(e,t){return!t?.properties||t.properties.length===0||aI(t.properties.reduce((r,i)=>{const n=_e(i.value)?i.value.map(String):i.value!=null?[String(i.value)]:[];return r[i.key]={values:n,operator:i.operator||"exact"},r},{}),e?.properties)}},v2=class{constructor(e,t){var r,i;this.gc=[],this._instance=e,this.mc=t,this.yc=new Map,this.bc=new Map,this._c=new Map,this.wc=(r=this._instance)===null||r===void 0||(i=r.onSessionId)===null||i===void 0?void 0:i.call(r,n=>this.kc(n))}Sc(e){return!1}xc(){return null}Cc(e){}$c(){}Tc(e,t){return!!e&&aI(e.propertyFilters,t?.properties)}Ic(e,t){const r=new Map;return e.forEach(i=>{var n;(n=i.conditions)===null||n===void 0||(n=n[t])===null||n===void 0||(n=n.values)===null||n===void 0||n.forEach(s=>{if(s?.name){const o=r.get(s.name)||[];o.push(i.id),r.set(s.name,o)}})}),r}Mc(e,t,r){const i=(r===Qs.Activation?this.yc:this.bc).get(e);let n=[];return this.Ec(s=>{n=s.filter(o=>i?.includes(o.id))}),n.filter(s=>{var o;const a=(o=s.conditions)===null||o===void 0||(o=o[r])===null||o===void 0||(o=o.values)===null||o===void 0?void 0:o.find(c=>c.name===e);return this.Tc(a,t)})}register(e){this.Pc(e,!1)}replace(e){this.Pc(e,!0)}Pc(e,t){var r;z((r=this._instance)===null||r===void 0?void 0:r._addCaptureHook)||(this.Rc(e,t),this.Ac(e,t))}Ac(e,t){const r=e.filter(s=>{var o;return(o=s.conditions)===null||o===void 0||(o=o.actions)===null||o===void 0||(o=o.values)===null||o===void 0?void 0:o.length});var i;if(t&&this._c.clear(),r.length===0)return void(t&&((i=this.Fc)===null||i===void 0||i.replace([])));this.Fc||(this.Fc=new g2(this._instance),this.Fc.init(),this.Fc.hc(s=>this.onAction(s)));const n=[];r.forEach(s=>{var o;(o=s.conditions)===null||o===void 0||(o=o.actions)===null||o===void 0||o.values.forEach(a=>{if(n.push(a),a.name){var c;const l=(c=this._c.get(a.name))!==null&&c!==void 0?c:[];l.includes(s.id)||l.push(s.id),this._c.set(a.name,l)}})}),t?this.Fc.replace(n):this.Fc.register(n)}Oc(e,t){t.forEach((r,i)=>{var n;const s=(n=e.get(i))!==null&&n!==void 0?n:[];r.forEach(o=>{s.includes(o)||s.push(o)}),e.set(i,s)})}Rc(e,t){var r,i;const n=e.filter(c=>{var l,u;return((l=c.conditions)===null||l===void 0?void 0:l.events)&&((u=c.conditions)===null||u===void 0||(u=u.events)===null||u===void 0||(u=u.values)===null||u===void 0?void 0:u.length)>0}),s=e.filter(c=>{var l,u;return((l=c.conditions)===null||l===void 0?void 0:l.cancelEvents)&&((u=c.conditions)===null||u===void 0||(u=u.cancelEvents)===null||u===void 0||(u=u.values)===null||u===void 0?void 0:u.length)>0}),o=this.Ic(e,Qs.Activation),a=this.Ic(e,Qs.Cancellation);t?(this.yc=o,this.bc=a):(this.Oc(this.yc,o),this.Oc(this.bc,a)),(n.length!==0||s.length!==0||e.some(c=>{var l;return(l=c.conditions)===null||l===void 0||(l=l.actions)===null||l===void 0||(l=l.values)===null||l===void 0?void 0:l.length}))&&((r=this.lc)!==null&&r!==void 0||(this.lc=(i=this._instance)===null||i===void 0?void 0:i._addCaptureHook((c,l)=>{this.onEvent(c,l)})))}onEvent(e,t){var r,i;const n=this.Dc(),s=(t==null||(r=t.properties)===null||r===void 0?void 0:r.$survey_id)||(t==null||(i=t.properties)===null||i===void 0?void 0:i.$product_tour_id);if(s&&this.getActivatedIds().includes(s)){const a=this.Lc(e,s,t);if(a==="consume")return n.info("event consumed activated item, removing it",{event:e,itemId:s}),void this.Nc([s]);if(a==="persist")return n.info("shown item promoted to persisted activation",{event:e,itemId:s}),this.qc(s),void this.jc([s])}if(this.bc.has(e)){const a=this.Mc(e,t,Qs.Cancellation);a.length>0&&(n.info("cancel event matched, cancelling items",{event:e,itemsToCancel:a.map(c=>c.id)}),this.Nc(a.map(c=>c.id)),a.forEach(c=>this.Bc(c.id)))}if(!this.yc.has(e))return;n.info("event name matched",{event:e,eventPayload:t,items:this.yc.get(e)});const o=this.Mc(e,t,Qs.Activation);this.Hc(o.map(a=>a.id))}onAction(e){this._c.has(e)&&this.Hc(this._c.get(e)||[])}Hc(e){var t,r;if(e.length===0)return;const i=!!(!((t=this._instance)===null||t===void 0||(r=t.get_session_id)===null||r===void 0)&&r.call(t)),n=[];for(const s of e)i&&this.Sc(s)?this.qc(s)&&this.zc(s):n.push(s);n.length>0&&(this.gc=[...new Set([...this.gc,...n])]),this.Dc().info("updating activated items",{activatedItems:this.getActivatedIds()}),this.Uc()}qc(e){this.gc=this.gc.filter(r=>r!==e);const t=this.Wc();return!t.includes(e)&&(this.Vc([...t,e]),this.Gc(),!0)}Nc(e){const t=new Set(e);this.gc=this.gc.filter(n=>!t.has(n));const r=this.Zc(),i=r.filter(n=>!t.has(n));i.length!==r.length&&(this.Vc(i),i.length===0&&this.Qc()),this.jc(e),this.Uc()}Uc(){try{var e;(e=this.mc)===null||e===void 0||e.call(this)}catch(t){this.Dc().error("Error while handling activated items change",t)}}Jc(){var e;const t=this.xc();if(!t)return{};const r=(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0?void 0:e.props[t];return r&&typeof r=="object"?r:{}}zc(e){if(!this.xc())return;const t=this.Jc();this.Cc(S(S({},t),{},{[e]:Date.now()}))}jc(e){if(!this.xc())return;const t=this.Jc(),r={};let i=!1;for(const[n,s]of Object.entries(t))e.includes(n)?i=!0:r[n]=s;i&&(Kt(r)?this.$c():this.Cc(r))}Kc(){this.xc()&&this.$c()}getActivationTimestamp(e){if(!this.Wc().includes(e))return;const t=this.Jc()[e];return nt(t)?t:void 0}Zc(){var e;const t=this.Xc();return((e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0?void 0:e.props[t])||[]}Wc(){var e,t,r;const i=this.Zc();if(i.length===0)return[];const n=(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0?void 0:e.props[this.Yc()],s=(t=this._instance)===null||t===void 0||(r=t.get_session_id)===null||r===void 0?void 0:r.call(t);return s&&n===s?i:[]}Gc(){var e,t;const r=(e=this._instance)===null||e===void 0||(t=e.get_session_id)===null||t===void 0?void 0:t.call(e);r&&this.td(r)}Qc(){this.ed()}kc(e){var t;const r=(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0?void 0:t.props[this.Yc()];if(r&&r!==e){const i=this.Zc(),n=this.Jc();i.length>0&&(this.Vc([]),i.filter(s=>nt(n[s])).forEach(s=>this.Bc(s))),this.Qc(),this.Kc(),i.length>0&&this.Uc()}}getActivatedIds(){return[...new Set([...this.Wc(),...this.gc])].filter(e=>!this.nd(e))}dispose(){var e,t,r;(e=this.wc)===null||e===void 0||e.call(this),this.wc=void 0,(t=this.lc)===null||t===void 0||t.call(this),this.lc=void 0,(r=this.Fc)===null||r===void 0||r.dispose(),this.Fc=void 0}reset(){this.gc=[],this.Zc().length>0&&this.Vc([]),this.Qc(),this.Kc(),this.Uc()}getEventToItemsMap(){return this.yc}sd(){return this.Fc}},_2=class extends v2{constructor(e,t){super(e,t)}Xc(){return ek}Yc(){return tk}xc(){return rk}Cc(e){var t;(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0||t.register({$surveys_activated_timestamps:e})}$c(){var e;(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0||e.unregister("$surveys_activated_timestamps")}Sc(e){var t;let r;this.Ec(n=>{r=n.find(s=>s.id===e)});const i=r==null||(t=r.appearance)===null||t===void 0?void 0:t.surveyPopupDelaySeconds;return nt(i)&&i>0}rd(){return tr.SHOWN}Ec(e){var t;(t=this._instance)===null||t===void 0||t.getSurveys(e)}Bc(e){var t;(t=this._instance)===null||t===void 0||t.cancelPendingSurvey(e)}Dc(){return De}Vc(e){var t;(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0||t.register({$surveys_activated:e})}td(e){var t;(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0||t.register({$surveys_activated_session:e})}ed(){var e;(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0||e.unregister("$surveys_activated_session")}nd(){return!1}Lc(e,t,r){var i;if(e===tr.SENT&&(r==null||(i=r.properties)===null||i===void 0?void 0:i.$survey_completed)===!1)return"ignore";let n;return this.Ec(s=>{n=s.find(o=>o.id===t)}),!n||(function(s){var o;return sI(s)&&!!(!((o=s.conditions)===null||o===void 0||(o=o.events)===null||o===void 0)&&o.repeatedActivation)||s.schedule==="always"})(n)?e===tr.SHOWN?"consume":"ignore":e===tr.SHOWN?"persist":e===tr.DISMISSED||e===tr.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},y2=class{constructor(e){this._instance=e}initialize(){}get(e){if(typeof e=="string")return this._instance.get_property(e);const t={};for(const r of e){const i=this._instance.get_property(r);z(i)||(t[r]=i)}return t}set(e,t){this._instance.register(typeof e=="string"?{[e]:t}:e)}remove(e){typeof e!="string"?e.forEach(t=>this._instance.unregister(t)):this._instance.unregister(e)}},b2=class{constructor(e){this._instance=e}get(){const e=this._instance.config;return{disableSurveys:e.disable_surveys,cookielessMode:!!e.cookieless_mode,advancedEnableSurveys:e.advanced_enable_surveys,requestTimeoutMs:e.surveys_request_timeout_ms}}isOptedOut(){return this._instance.consent.isOptedOut()}isCapturing(){return this._instance.is_capturing()}getExtensions(){const e=he?.__PosthogExtensions__;if(!e)return;const{generateSurveys:t,loadExternalDependency:r}=e;return{generateSurveys:t?i=>t(this._instance,i):void 0,loadExternalDependency:r?i=>r(this._instance,"surveys",i):void 0}}createEventReceiver(e){return new _2(this._instance,e)}onMatchingConditionsChanged(e){const t=this._instance._addCaptureHook(s=>{s!=="$pageview"&&s!==tr.SHOWN&&s!==tr.DISMISSED&&s!==tr.SENT||e()}),r=()=>e();Ne(M,"PHSurveyShown",r);let i=!1;const n=this._instance.onFeatureFlags(()=>{i&&e()});return i=!0,()=>{i=!1,t(),n(),M?.removeEventListener("PHSurveyShown",r)}}},S2=M?.location?Mc(M.location.hash,"__posthog")||Mc(location.hash,"state"):null,b_="_postHogToolbarParams",S_=tt("[Toolbar]"),w_=tt("[FeatureFlags]"),w2=class{constructor(e,t=!1){this.od=!1,this.update(e,t)}update(e,t){this.ad=((r,i)=>{var n,s,o,a,c,l,u,p;return{bootstrap:{featureFlags:(n=(s=r.bootstrap)===null||s===void 0?void 0:s.featureFlags)!==null&&n!==void 0?n:void 0,featureFlagPayloads:(o=(a=r.bootstrap)===null||a===void 0?void 0:a.featureFlagPayloads)!==null&&o!==void 0?o:void 0},remoteRequestsDisabled:i,featureFlagsDisabled:!!r.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!r.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!r.advanced_feature_flags_dedup_per_session,cacheTtlMs:r.feature_flag_cache_ttl_ms,refreshIntervalMs:(c=r.remote_config_refresh_interval_ms)!==null&&c!==void 0?c:3e5,idleRefreshBackoff:z(r.remote_config_refresh_interval_ms),requestTimeoutMs:r.feature_flag_request_timeout_ms,requestMaxRetries:Math.max(0,(l=r.feature_flag_request_max_retries)!==null&&l!==void 0?l:1),compression:r.disable_compression?void 0:"best-available",evaluationContexts:(u=(p=r.evaluation_contexts)!==null&&p!==void 0?p:r.evaluation_environments)!==null&&u!==void 0?u:[],flagKeys:_e(r.flag_keys)?r.flag_keys:void 0}})(e,t),!e.evaluation_environments||e.evaluation_contexts||this.od||(w_.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.od=!0),z(e.flag_keys)||_e(e.flag_keys)||w_.error("Invalid flag_keys found:",e.flag_keys,"Expected array of non-empty strings")}get(){return this.ad}},E_=tt("[FeatureFlags]"),Wi=tt("[FeatureFlags]",{debugEnabled:!0}),Zu=`" failed. Feature flags didn't load in time.`,E2=[502,504],k_=["click","keydown","wheel","touchstart","pointerdown"],I_="connection_error",A_=e=>{const t={};for(let r=0;e.length>r;r++)t[e[r]]=!0;return t},R_=e=>{const t={};for(const[r,i]of rc(e||{}))i&&(t[r]=i);return t},T_=e=>Ns(e)&&(e.name==="RangeError"&&e.message.indexOf("Maximum call stack size exceeded")===0||e.name==="InternalError"&&e.message==="too much recursion"),fr=tt("[Error tracking]"),Cp="webkit-masked-url:",k2=[{value:"isolatedAPI.contexts.topHostname",exact:!1},{value:"No response from target",exact:!0}],I2=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",Cp],A2=["__firefox__","__gCrWeb"],C_="Refusing to render web experiment since the viewer is a likely bot",R2={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>Dc(t,e),not_regex:(e,t)=>!Dc(t,e),exact:(e,t)=>t===e,is_not:(e,t)=>t!==e},ar=tt("[Conversations]"),Ji="Conversations not available yet.";function P_(e,t){var r,i,n,s,o,a,c;const l=(r=e?.flushIntervalMs)!==null&&r!==void 0?r:3e3,u=(i=e?.maxBufferSize)!==null&&i!==void 0?i:100,p=t?.consoleCapture?void 0:(n=e?.maxLogsPerInterval)!==null&&n!==void 0?n:1e3,d=z(p)?Math.max(u,2048):Math.max(u,p),h=S(S({},(function(){let f="",m="";try{const v=vt?.userAgent;v&&([f,m]=IE(v))}catch{}return(function(v,_){const b=(function(A){if(A)return{}.hasOwnProperty.call(Ev,A)?Ev[A]:A})(v);return S(S({},b?{"os.name":b}:{}),_?{"os.version":_}:{})})(f,m)})()),e?.resourceAttributes);return{serviceName:(s=(o=h?.["service.name"])!==null&&o!==void 0?o:e?.serviceName)!==null&&s!==void 0?s:t?.serviceNameDefault,serviceVersion:(a=h?.["service.version"])!==null&&a!==void 0?a:e?.serviceVersion,environment:(c=h?.["deployment.environment"])!==null&&c!==void 0?c:e?.environment,resourceAttributes:h,beforeSend:e?.beforeSend,flushIntervalMs:l,maxBufferSize:u,maxQueueSize:d,maxBatchRecordsPerPost:100,rateCapWindowMs:l,maxLogsPerInterval:p,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}var T2=["debug","log","warn","error","info"],C2=e=>{for(;e?.__rrweb_original__;)e=e.__rrweb_original__;return e},O_="console",pI="__posthogHandledLogsRequestError",Qu=(e,t)=>{const r=e instanceof Error?e:new Error(t);return r[pI]=!0,r},x_=e=>!!e&&typeof e=="object"&&e[pI]===!0,Uc=tt("[NetworkMetrics]"),Hf=()=>{var e;return!(M==null||(e=M.performance)===null||e===void 0)&&e.now?M.performance.now():Date.now()},P2={"http:":80,"https:":443},O2=new Set(["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"]),hI=(e,t)=>{var r;const i=String(t);return{method:String(e).toUpperCase(),url:((r=si(i))===null||r===void 0?void 0:r.href)||i}},Pp=(e,t,r,i,n,s,o=!1)=>{try{var a,c;const l=n();if(!l)return;const u=r||void 0,p=Hf()-i,d=si(t.url);if(d&&d.protocol!=="http:"&&d.protocol!=="https:")return;const h={url:d?.href||t.url,method:t.method},f=gt(l.name)?l.name(h):Ae(l.name)?l.name:"http.client.request.duration";if(!f)return;const m=o&&!u?void 0:((_,b)=>_?400>_?void 0:String(_):b?.name||"_OTHER")(u,s),v=S(S(S(S(S({},(_=>{const b=O2.has(_)?_:"_OTHER";return S({"http.request.method":b},b==="_OTHER"&&_!==b?{"http.request.method_original":_}:{})})(h.method)),d?(_=>{return{"server.address":_.hostname.startsWith("[")&&_.hostname.endsWith("]")?_.hostname.slice(1,-1):_.hostname,"server.port":Number(_.port)||P2[_.protocol],"url.scheme":_.protocol.slice(0,-1),"url.template":(b=_.pathname,b.split("/").map(A=>(P=>/^\d+$/.test(P)||P.length>=8&&/^[0-9a-f-]*\d[0-9a-f-]*$/i.test(P))(A)?":id":A).join("/"))};var b})(d):{}),u?{"http.response.status_code":u}:{}),m?{"error.type":m}:{}),(a=l.attributes)===null||a===void 0?void 0:a.call(l,h,{status:u,durationMs:p}));(c=e.metrics)===null||c===void 0||c.histogram(f,p,{unit:"ms",attributes:v})}catch(l){Uc.error("Failed to record network metric",l)}},fI=()=>{},x2=(e,t)=>gt(M?.fetch)?Vo(M,"fetch",r=>function(...i){const n=Hf(),s=r.apply(this,i);if(!t())return s;try{var o,a,c;const[l,u]=i,p=hI((o=(a=u?.method)!==null&&a!==void 0?a:l?.method)!==null&&o!==void 0?o:"GET",(c=l?.url)!==null&&c!==void 0?c:l);return s.then(d=>(Pp(e,p,d?.status,n,t,void 0,!0),d),d=>{throw Pp(e,p,void 0,n,t,d),d})}catch(l){return Uc.error("Failed to observe fetch",l),s}}):fI,M2=(e,t)=>{var r;const i=M==null||(r=M.XMLHttpRequest)===null||r===void 0?void 0:r.prototype;if(!i)return fI;const n=new WeakMap,s=Vo(i,"open",a=>function(...c){try{Gk.has(this)||n.set(this,hI(c[0],c[1]))}catch(l){Uc.error("Failed to observe XHR open",l)}return a.apply(this,c)}),o=Vo(i,"send",a=>function(...c){let l;try{const u=n.get(this);if(u&&t()){const p=Hf();l=()=>{this.removeEventListener("loadend",l),Pp(e,u,this.status,p,t)},Ne(this,"loadend",l)}}catch(u){Uc.error("Failed to observe XHR send",u)}try{return a.apply(this,c)}catch(u){throw l&&this.removeEventListener("loadend",l),u}});return()=>{s(),o()}},ql={featureFlags:class{constructor(e){this.name="featureFlags",this.ld=!1,this.featureFlagEventHandlers=[],this.A=E_,this.ud={},this.hd={},this.dd=[],this.vd=!1,this.fd=!1,this.pd=0,this.gd=!1,this.md=!1,this.yd=!1,this.bd=!1,this._d=0,this.wd=!1,this.rn=()=>{const t=this.kd();this._d=0,t&&this.reloadFeatureFlags()},this.Sd=()=>{var t,r;const i=this.xd,n=(t=this.Cd)!==null&&t!==void 0?t:i;z(i)||z(n)||this.Ir.remoteRequestsDisabled||!G||G.visibilityState==="hidden"||Date.now()-((r=this.$d)!==null&&r!==void 0?r:0)<n||(this.Cd=this.wd||!this.Ir.idleRefreshBackoff?i:Math.min(2*n,36e5),this.wd=!1,this.reloadFeatureFlags(),this.Td())},this.Id=()=>{this.wd&&this.Cd===this.xd||this.Md()},this.sn=()=>{G?.visibilityState==="visible"&&this.Md()},"get"in e?this.wo=e:(this._instance=e,this.Ed=new w2(e.config,e.il()),this.wo=this.Ed)}updateConfig(e,t){var r;(r=this.Ed)===null||r===void 0||r.update(e,t),this.bo&&this.Pd()}setup(e){return this.Nh=e,this.A=e.logger.createLogger("[FeatureFlags]"),dI(e.kv.initialize(),()=>{this.Nh===e&&(this.Nh=void 0,this.bo=e,this.Rd(e))})}Rd(e){var t;if(this.bo===e)return M&&Ne(M,"online",this.rn),this.Pd(),this.Ad=e.registerDynamicEventProperties(()=>this.Fd()?this.ud:this.hd),this.Od=(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0?void 0:t.onCrossTabFeatureFlagChange(()=>{this.Dd(),this.Ld(),this.Nd()}),this.Ld(),this.initialize()}Md(){this.wd=!0,this.Cd=this.xd,this.Sd()}Pd(){const e=this.Ir.refreshIntervalMs,t=!this.Ir.remoteRequestsDisabled&&G&&!z(e)&&e>0?e:void 0;this.Ir.idleRefreshBackoff||(this.Cd=t),t!==this.xd&&(this.qd(),z(t)||(this.xd=t,this.Cd=t,this.Td(),G!=null&&G.addEventListener&&(Ne(G,jo,this.sn),rs(k_,r=>{Ne(G,r,this.Id,{capture:!0})}))))}Td(){z(this.xd)||(z(this.jd)||clearInterval(this.jd),this.$d=Date.now(),this.jd=setInterval(this.Sd,this.xd))}qd(){var e;z(this.jd)||(clearInterval(this.jd),this.jd=void 0,G==null||(e=G.removeEventListener)===null||e===void 0||e.call(G,"visibilitychange",this.sn),rs(k_,t=>{var r;G==null||(r=G.removeEventListener)===null||r===void 0||r.call(G,t,this.Id,{capture:!0})})),this.xd=void 0,this.Cd=void 0,this.wd=!1,this.$d=void 0}destroy(){this.Bd()}dispose(){this.Bd()}Bd(){var e,t;this.qd(),this.pd++,this.md=!1,this.Nh=void 0,this.bo&&(this.Hd(),(e=this.Ad)===null||e===void 0||e.dispose(),this.Ad=void 0,(t=this.Od)===null||t===void 0||t.call(this),this.Od=void 0,this.dd=[],M?.removeEventListener("online",this.rn),this.bo=void 0)}get Ir(){return this.wo.get()}zd(e){var t;return this.Ud&&e in this.Ud?this.Ud[e]:(t=this.bo)===null||t===void 0?void 0:t.kv.get(e)}Dd(){return!!this.Ud&&(this.Ud=void 0,!0)}Wd(){var e;return!z((e=this.bo)===null||e===void 0?void 0:e.kv.get("$enabled_feature_flags"))&&this.Dd()}$t(e){this.Vd(()=>{var t;return(t=this.bo)===null||t===void 0?void 0:t.kv.set(e)})}Gd(e,t,r){var i;if(!(!((i=this._instance)===null||i===void 0)&&i.persistence)||!e.$enabled_feature_flags)return;const n=this.zd("$enabled_feature_flags")||{},s=e.$enabled_feature_flags||{},o=t.flags||t.featureFlags,a=t.flags?Object.entries(t.flags).filter(([,_])=>!_?.failed).map(([_])=>_):[],c=!!t.errorsWhileComputingFlags&&!!t.flags,l=c?a:r&&!_e(o)?Object.keys(o||{}):Array.from(new Set([...Object.keys(n),...Object.keys(s)])),u=this.zd("$feature_flag_payloads")||{},p=e.$feature_flag_payloads||{},d=c||r?l:Array.from(new Set([...Object.keys(u),...Object.keys(p)])),h=!c&&!r,f=!!h||l,m=!!h||d,v={[Zr]:f,[_r]:f,[Si]:m};e.$feature_flag_details&&(v[mn]=f);for(const _ of[gn,xi,wo])z(e[_])||(v[_]=!0);this._instance.persistence.markCrossTabFeatureFlagChanges(v)}Lt(e){this.Vd(()=>{var t;return(t=this.bo)===null||t===void 0?void 0:t.kv.remove(e)})}Vd(e){try{e()}catch(t){this.A.error("Failed to update feature flag persistence",t)}}Ld(){const e={};for(const i of[Zr,Si,gn,Tr]){const n=this.zd(i);z(n)||(e[i]=n)}this.ud=e;const t=S({},e),r=this.zd(_r);if(r)for(const[i,n]of Object.entries(r))t[`$feature/${i}`]=n;this.hd=t}Fd(){const e=this.Ir.cacheTtlMs;if(!e||0>=e)return!1;const t=this.zd(xi);return typeof t!="number"||Date.now()-t>e}Zd(){return!!this.Fd()&&(this.bd||this.fd||(this.bd=!0,this.A.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Qd(){const e=this.Ir.evaluationContexts;return e?.length?e.filter(t=>{const r=t&&typeof t=="string"&&t.trim().length>0;return r||this.A.error("Invalid evaluation context found:",t,"Expected non-empty string"),r}):[]}Jd(){const e=this.Ir.flagKeys;if(!z(e))return e.filter(t=>{const r=t&&typeof t=="string"&&t.trim().length>0;return r||this.A.error("Invalid flag key found:",t,"Expected non-empty string"),r})}initialize(){var e,t;const r=this.Ir,i=(e=(t=r.bootstrap)===null||t===void 0?void 0:t.featureFlags)!==null&&e!==void 0?e:{};if(Object.keys(i).length){var n,s;const o=(n=(s=r.bootstrap)===null||s===void 0?void 0:s.featureFlagPayloads)!==null&&n!==void 0?n:{},a=Object.keys(i).filter(l=>!z(i[l])).reduce((l,u)=>(l[u]=i[u],l),{}),c=Object.keys(o).filter(l=>a[l]).reduce((l,u)=>(l[u]=o[u],l),{});return this.Kd({featureFlags:a,featureFlagPayloads:c},void 0,{persist:!1})}}updateFlags(e,t,r){var i,n;const s=r?.merge&&(i=this.zd("$enabled_feature_flags"))!==null&&i!==void 0?i:{},o=r?.merge&&(n=this.zd("$feature_flag_payloads"))!==null&&n!==void 0?n:{},a=S(S({},s),e),c=S(S({},o),t),l={};for(const[u,p]of Object.entries(a))l[u]={key:u,enabled:_v(p),variant:yv(p),reason:void 0,metadata:z(c?.[u])?void 0:{id:0,version:void 0,description:void 0,payload:c[u]}};this.Kd({flags:l})}get hasLoadedFlags(){return this.vd}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){const e=this.zd(mn),t=this.zd(Tr),r=this.zd(en);if(!r&&!t)return e||{};const i=Ge({},e||{}),n=[...new Set([...Object.keys(r||{}),...Object.keys(t||{})])];for(const a of n){var s;const c=i[a],l=t?.[a],u=z(l)?(s=c?.enabled)!==null&&s!==void 0&&s:!!l,p=z(l)?c?.variant:typeof l=="string"?l:void 0,d=r?.[a],h=S(S({},c),{},{enabled:u,variant:u?p??c?.variant:void 0});var o;u!==c?.enabled&&(h.original_enabled=c?.enabled),p!==c?.variant&&(h.original_variant=c?.variant),d&&(h.metadata=S(S({},c?.metadata),{},{payload:d,original_payload:c==null||(o=c.metadata)===null||o===void 0?void 0:o.payload})),i[a]=h}return this.ld||(this.A.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:r,finalDetails:i}),this.ld=!0),i}getAllFeatureFlags(){const e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map(r=>{const i=e[r];return{key:r,enabled:_v(i),variant:yv(i),payload:vv(t[r])}})}getFlagVariants(){const e=this.zd(_r),t=this.zd(Tr);if(!t)return e||{};const r=Ge({},e||{}),i=Object.keys(t);for(let n=0;i.length>n;n++)r[i[n]]=t[i[n]];return this.ld||(this.A.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:r}),this.ld=!0),r}getFlagPayloads(){const e=this.zd(Si),t=this.zd(en);if(!t)return e||{};const r=Ge({},e||{}),i=Object.keys(t);for(let n=0;i.length>n;n++)r[i[n]]=t[i[n]];return this.ld||(this.A.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:r}),this.ld=!0),r}reloadFeatureFlags(){this.gd||this.Ir.featureFlagsDisabled||this.kd()||(this.fd&&(this.md=!0),this.Xd||(this.dd.slice().forEach(e=>{try{e()}catch(t){this.A.error("Error while running feature flags reloading callback",t)}}),this.Xd=setTimeout(()=>{this.Yd()},5)))}Hd(){clearTimeout(this.Xd),this.Xd=void 0}onReloading(e){return this.dd.push(e),()=>{this.dd=this.dd.filter(t=>t!==e)}}ensureFlagsLoaded(){this.vd||this.fd||this.Xd||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.gd=e}resetFlagCallReported(){this.Lt(ki)}Yd(e){this.Hd();const t=this.bo;if(!t||this.Ir.remoteRequestsDisabled||this.kd())return;if(this.fd)return void(this.md=!0);const r={token:t.projectToken,distinct_id:t.distinctId,groups:t.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:S(S(S({},t.initialPersonProperties),this.zd("$stored_person_properties")||{}),{},{$lib:t.library.name,$lib_version:t.library.version}),group_properties:this.zd(Ei),timezone:qk()};z(t.deviceId)||(r.$device_id=t.deviceId),(e!=null&&e.disableFlags||this.Ir.featureFlagsDisabled)&&(r.disable_flags=!0);const i=this.Qd();i.length&&(r.evaluation_contexts=i);const n=this.Jd();z(n)||(r.flag_keys=n);const s=this.Ir.onlyEvaluateSurveyFeatureFlags,o="/flags/?v=2"+(s?"&only_evaluate_survey_feature_flags=true":""),a=this.pd;this.fd=!0;const c=()=>{this.md&&(this.md=!1,this.Yd())},l=f=>{var m,v;const _=(m=f.json)!==null&&m!==void 0?m:{},b=f.statusCode!==200;if(this.fd=!1,a!==this.pd)return void c();if(this.tv(f.statusCode),b||this.md||(this.$anon_distinct_id=void 0),r.disable_flags&&!this.md)return;this.yd=!b;const A=[];f.error?A.push(f.error instanceof Error&&f.error.name==="AbortError"?"timeout":f.error instanceof Error?I_:"unknown_error"):f.statusCode!==200&&A.push(`api_error_${f.statusCode}`),_.errorsWhileComputingFlags&&A.push("errors_while_computing_flags");const P=!!(!((v=_.quotaLimited)===null||v===void 0)&&v.includes("feature_flags"));P&&A.push("quota_limited"),this.$t({[qo]:A}),P?this.A.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):r.disable_flags||this.Kd(_,b,{partialResponse:s}),c()},u=f=>{this.fd=!1,a===this.pd&&(this.$t({[qo]:[I_]}),this.A.error("Feature flag request failed",f),this.Wd()&&this.Nd(!0)),c()};let p=this.Ir.requestMaxRetries;const d=()=>p>0&&a===this.pd,h=()=>{if(a!==this.pd||!this.bo||this.Ir.remoteRequestsDisabled)return this.fd=!1,void c();try{t.sendRequest(o,{target:"flags",method:"POST",body:r,compression:this.Ir.compression,sentAt:"body",timeoutMs:this.Ir.requestTimeoutMs}).then(f=>{if((m=>E2.includes(m.statusCode)||(v=>v.statusCode===0&&v.error instanceof Error&&v.error.name==="AbortError")(m))(f)&&d())return p--,void setTimeout(h,500);l(f)}).catch(u)}catch(f){u(f)}};h()}kd(){return Pk(this._d,3)}tv(e){this._d=Ok(e,this._d,3,()=>this.A.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes."))}getFeatureFlag(e,t={}){var r;if(t.fresh&&!this.yd)return;if(!(this.vd||this.getFlags()&&this.getFlags().length>0))return void this.A.warn('getFeatureFlag for key "'+e+Zu);if(this.Zd())return;const i=this.getFeatureFlagResult(e,t);return(r=i?.variant)!==null&&r!==void 0?r:i?.enabled}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){const t=this.getFeatureFlagResult(e,{send_event:!1});return t?.payload}getFeatureFlagResult(e,t={}){if(t.fresh&&!this.yd)return;if(!(this.vd||this.getFlags()&&this.getFlags().length>0))return void this.A.warn('getFeatureFlagResult for key "'+e+Zu);if(this.Zd())return;const r=this.getFlagVariants(),i=e in r,n=r[e],s=this.getFlagPayloads()[e],o=String(n),a=this.zd("$feature_flag_request_id")||void 0,c=this.zd("$feature_flag_evaluated_at")||void 0;let l,u=this.zd("$flag_call_reported")||{};if(this.Ir.deduplicateCallsPerSession){var p;const J=(p=this.bo)===null||p===void 0?void 0:p.session.sessionId,se=this.zd(uo);J&&J!==se&&(u={},l=J)}if(t.send_event||!("send_event"in t))if(e in u&&u[e].includes(o))l&&this.$t({[ki]:u,[uo]:l});else{var d,h,f,m,v,_,b,A,P,D,$,q;_e(u[e])?u[e].push(o):u[e]=[o],this.$t(S({[ki]:u},l?{[uo]:l}:{}));const J=this.getFeatureFlagDetails(e),se=[...(d=this.zd("$feature_flag_errors"))!==null&&d!==void 0?d:[]];z(n)&&se.push("flag_missing");const ce={$feature_flag:e,$feature_flag_response:n,$feature_flag_payload:s??null,$feature_flag_request_id:a,$feature_flag_evaluated_at:c,$feature_flag_bootstrapped_response:(h=(f=this.Ir.bootstrap)===null||f===void 0||(f=f.featureFlags)===null||f===void 0?void 0:f[e])!==null&&h!==void 0?h:null,$feature_flag_bootstrapped_payload:(m=(v=this.Ir.bootstrap)===null||v===void 0||(v=v.featureFlagPayloads)===null||v===void 0?void 0:v[e])!==null&&m!==void 0?m:null,$used_bootstrap_value:!this.yd};z(J==null||(_=J.metadata)===null||_===void 0?void 0:_.has_experiment)||(ce.$feature_flag_has_experiment=J.metadata.has_experiment),z(J==null||(b=J.metadata)===null||b===void 0?void 0:b.version)||(ce.$feature_flag_version=J.metadata.version);const T=(A=J==null||(P=J.reason)===null||P===void 0?void 0:P.description)!==null&&A!==void 0?A:J==null||(D=J.reason)===null||D===void 0?void 0:D.code;var j;T&&(ce.$feature_flag_reason=T),J!=null&&($=J.metadata)!==null&&$!==void 0&&$.id&&(ce.$feature_flag_id=J.metadata.id),z(J?.original_variant)&&z(J?.original_enabled)||(ce.$feature_flag_original_response=z(J.original_variant)?J.original_enabled:J.original_variant),J!=null&&(q=J.metadata)!==null&&q!==void 0&&q.original_payload&&(ce.$feature_flag_original_payload=J==null||(j=J.metadata)===null||j===void 0?void 0:j.original_payload),se.length&&(ce.$feature_flag_error=se.join(",")),this.ev(ce)}else l&&this.$t({[ki]:u,[uo]:l});return i?{key:e,enabled:!!n,variant:typeof n=="string"?n:void 0,payload:vv(s)}:void 0}ev(e){try{var t;(t=this.bo)===null||t===void 0||t.capture("$feature_flag_called",e)}catch(r){this.A.error("Failed to capture feature flag call",r)}}getRemoteConfigPayload(e,t){this.iv(e,t)}iv(e,t){var r=this;return We(function*(){const i=r.bo;if(!i)return;const n={distinct_id:i.distinctId,token:i.projectToken,person_properties:{$lib:i.library.name,$lib_version:i.library.version}},s=r.Qd();s.length&&(n.evaluation_contexts=s);const o=r.Jd();let a;z(o)||(n.flag_keys=o);try{var c;const l=(c=(yield i.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:n,compression:r.Ir.compression,sentAt:"body",timeoutMs:r.Ir.requestTimeoutMs})).json)===null||c===void 0?void 0:c.featureFlagPayloads;a=l?.[e]||void 0}catch(l){r.A.error("Remote config feature flag request failed",l);return}try{t(a)}catch(l){r.A.error("Remote config feature flag callback failed",l)}})()}isFeatureEnabled(e,t={}){if(t.fresh&&!this.yd)return t.defaultValue;if(!(this.vd||this.getFlags()&&this.getFlags().length>0))return this.A.warn('isFeatureEnabled for key "'+e+Zu),t.defaultValue;const r=this.getFeatureFlag(e,t);return z(r)?t.defaultValue:!!r}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t,r){this.Kd(e,t,r)}Kd(e,t,r){if(!this.bo)return;this.vd=!0;const i=((n,s={},o={},a={},c,l=E_)=>{const u=((A,P)=>{const D=A.flags;if(D){const $=Object.fromEntries(Object.keys(D).map(j=>{var J;return[j,(J=D[j].variant)!==null&&J!==void 0?J:D[j].enabled]})),q=Object.fromEntries(Object.keys(D).filter(j=>D[j].enabled).filter(j=>{var J;return!z((J=D[j].metadata)===null||J===void 0?void 0:J.payload)}).map(j=>{var J;return[j,(J=D[j].metadata)===null||J===void 0?void 0:J.payload]}));return S(S({},A),{},{featureFlags:$,featureFlagPayloads:q})}return A.featureFlags&&P.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),A})(n,l),p=u.flags,d=u.featureFlags,h=u.featureFlagPayloads;if(!d)return;const f=n.requestId,m=n.evaluatedAt;if(_e(d)){l.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");const A={};if(d)for(let P=0;d.length>P;P++)A[d[P]]=!0;return{[Zr]:d,[_r]:A,[wo]:!1}}let v=d,_=h,b=p;if(c?.partialResponse){const A=Object.keys(v),P=_||{};v=S(S({},s),v),_=S(S({},o),P),A.forEach(D=>{D in P||_==null||delete _[D]}),b=S(S({},a),b)}else if(n.errorsWhileComputingFlags)if(p){const A=new Set(Object.keys(p).filter(D=>{var $;return!(!(($=p[D])===null||$===void 0)&&$.failed)}));v=S(S({},s),Object.fromEntries(Object.entries(v).filter(([D])=>A.has(D))));const P=Object.fromEntries(Object.entries(_||{}).filter(([D])=>A.has(D)));_=S(S({},o),P),A.forEach(D=>{D in P||_==null||delete _[D]}),b=S(S({},a),Object.fromEntries(Object.entries(b||{}).filter(([D])=>A.has(D))))}else v=S(S({},s),v),_=S(S({},o),_),b=S(S({},a),b);return S(S({[Zr]:Object.keys(R_(v)),[_r]:v||{},[Si]:_||{},[mn]:b||{},[wo]:n.minimalFlagCalledEvents===!0},f?{[gn]:f}:{}),m?{[xi]:m}:{})})(e,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),r,this.A);if(i)if(r?.persist===!1){const n=!z(this.bo.kv.get(_r));this.Ud=i,n||this.$t(i)}else this.Dd(),this.Gd(i,e,!!r?.partialResponse),this.$t(i);else t&&this.Wd();t||(this.bd=!1),this.Nd(t)}override(e,t=!1){this.A.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){this.nv(e)}nv(e){if(this.bo){if(e===!1)return this.Lt([Tr,en]),this.Nd(),void Wi.info("All overrides cleared");if(_e(e))return this.$t({[Tr]:A_(e)}),this.Nd(),void Wi.info("Flag overrides set",{flags:e});if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var t;const r=e;this.ld=!!((t=r.suppressWarning)!==null&&t!==void 0&&t);const i={},n=r.flags,s=r.payloads;n&&(i[Tr]=_e(n)?A_(n):n),s&&(i[en]=s),Object.keys(i).length&&this.$t(i),n===!1&&s===!1?this.Lt([Tr,en]):n===!1?this.Lt(Tr):s===!1&&this.Lt(en),this.Nd(),n===!1?Wi.info("Flag overrides cleared"):n&&Wi.info("Flag overrides set",{flags:n}),s===!1?Wi.info("Payload overrides cleared"):s&&Wi.info("Payload overrides set",{payloads:s});return}if(e&&typeof e=="object")return this.$t({[Tr]:e}),this.Nd(),void Wi.info("Flag overrides set",{flags:e});this.A.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}else this.A.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.vd){const{flags:t,flagVariants:r}=this.sv();try{e(t,r)}catch(i){this.A.error("Error while running feature flags callback",i)}}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,r){var i;const n=(this.zd("$early_access_features")||[]).find(l=>l.flagKey===e),s={[`$feature_enrollment/${e}`]:t},o={$feature_flag:e,$feature_enrollment:t,$set:s};n&&(o.$early_access_feature_name=n.name),r&&(o.$feature_enrollment_stage=r);const a=S(S({},this.getFlagVariants()),{},{[e]:t});(i=this._instance)===null||i===void 0||(i=i.persistence)===null||i===void 0||i.markCrossTabFeatureFlagChanges({$active_feature_flags:[e],$enabled_feature_flags:[e],$stored_person_properties:Object.keys(s)}),this.$t({[Zr]:Object.keys(R_(a)),[_r]:a,[wi]:S(S({},this.zd("$stored_person_properties")||{}),s)}),this.Nd();try{var c;(c=this.bo)===null||c===void 0||c.capture("$feature_enrollment_update",o)}catch(l){this.A.error("Failed to capture early access feature enrollment",l)}}getEarlyAccessFeatures(e,t=!1,r){const i=this.zd(mp);!i||t?this.rv(e,r):e(i)}rv(e,t){var r=this;return We(function*(){const i=r.bo;if(!i)return;const n=t?`&${t.map(o=>`stage=${o}`).join("&")}`:"";let s;try{const o=yield i.sendRequest(`/api/early_access_features/?token=${i.projectToken}${n}`,{target:"api",method:"GET",sentAt:"query"});if(!o.json)return;s=o.json.earlyAccessFeatures,r.$t({[mp]:s})}catch(o){r.A.error("Early access feature request failed",o);return}try{e(s)}catch(o){r.A.error("Early access feature callback failed",o)}})()}sv(){const e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(r=>t[r]),flagVariants:Object.keys(t).filter(r=>t[r]).reduce((r,i)=>(r[i]=t[i],r),{})}}Nd(e){this.Ld();const{flags:t,flagVariants:r}=this.sv();this.featureFlagEventHandlers.forEach(i=>{try{i(t,r,{errorsLoading:e})}catch(n){this.A.error("Error while running feature flags callback",n)}})}setPersonPropertiesForFlags(e,t=!0){this.ov(e,t)}ov(e,t=!0){const r=this.zd("$stored_person_properties")||{},i=e?.$set||(e?.$set_once?{}:e),n=e?.$set_once,s={};if(n)for(const o in n)({}).hasOwnProperty.call(n,o)&&(o in r||(s[o]=n[o]));this.$t({[wi]:S(S(S({},r),s),i)}),t&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t=!0){const r=S({},this.zd("$stored_person_properties")||{});e.forEach(i=>{delete r[i]}),this.$t({[wi]:r}),t&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(e=!0){this.Lt(wi),e&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t=!0){const r=this.zd("$stored_group_properties")||{},i=S({},r);for(const n of Object.keys(e))i[n]=S(S({},r[n]),e[n]);this.$t({[Ei]:i}),t&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){const t=this.zd("$stored_group_properties")||{};this.$t({[Ei]:S(S({},t),{},{[e]:{}})})}else this.Lt(Ei)}reset(){this.pd++,this.md=!1,this.ud={},this.hd={},this.Ud=void 0,this.vd=!1,this.gd=!1,this.yd=!1,this.$anon_distinct_id=void 0,this.Hd(),this.ld=!1,this._d=0}}},L2={sessionRecording:class{get Ir(){return this._instance.config}get Il(){return this._instance.persistence}get started(){var e;return!!(!((e=this.av)===null||e===void 0)&&e.isStarted)}get status(){var e,t;return this.lv==="awaiting_config"||this.lv==="missing_config"?this.lv:(e=(t=this.av)===null||t===void 0?void 0:t.status)!==null&&e!==void 0?e:this.lv}constructor(e){if(this._instance=e,this._forceAllowLocalhostNetworkCapture=!1,this.lv=Ku,this.uv=void 0,this.hv=!1,this.Je=(()=>{var t,r;if(!G?.visibilityState||G.visibilityState==="visible")return!0;const i=M==null||(t=M.performance)===null||t===void 0||(r=t.getEntriesByType)===null||r===void 0?void 0:r.call(t,"visibility-state");return!i?.length||i.some(n=>n.name==="visible")})(),this.sn=()=>{var t,r;G?.visibilityState==="visible"&&(this.Je=!0,(t=this.av)===null||t===void 0||(r=t.setDocumentWasEverVisible)===null||r===void 0||r.call(t,!0))},!this._instance.sessionManager)throw Vr.error("started without valid sessionManager"),new Error("[SessionRecording] started without valid sessionManager. This is a bug.");if(this.Ir.cookieless_mode==="always")throw new Error('[SessionRecording] cannot be used with cookieless_mode="always"');G!=null&&G.addEventListener&&Ne(G,"visibilitychange",this.sn)}initialize(){this.startIfEnabledOrStop()}dispose({discardBufferedEvents:e=!1}={}){var t;this.hv=!0,G==null||(t=G.removeEventListener)===null||t===void 0||t.call(G,"visibilitychange",this.sn),e?this.dv(!0):this.stopRecording()}get vv(){var e;const t=!!(!((e=this._instance.get_property("$session_recording_remote_config"))===null||e===void 0)&&e.enabled),r=!this.Ir.disable_session_recording,i=this.Ir.disable_session_recording||this._instance.consent.isOptedOut();return M&&t&&r&&!i}startIfEnabledOrStop(e){var t;if(this.hv||this.vv&&(!((t=this.av)===null||t===void 0)&&t.isStarted))return;const r=!z(Object.assign)&&!z(Array.from);this.vv&&r?(this.fv(e),Vr.info("starting")):(this.lv=Ku,this.stopRecording())}fv(e){var t,r;if(this.vv)if(this.lv!=="awaiting_config"&&this.lv!=="missing_config"&&(this.lv=v_),(he==null||(t=he.__PosthogExtensions__)===null||t===void 0||(t=t.rrweb)===null||t===void 0?void 0:t.record)&&((r=he.__PosthogExtensions__)===null||r===void 0?void 0:r.initSessionRecording))this.pv(e);else{var i,n;const s=this._instance.sessionManager;(i=he.__PosthogExtensions__)===null||i===void 0||(n=i.loadExternalDependency)===null||n===void 0||n.call(i,this._instance,this.gv,o=>{if(!this.hv&&this.vv&&this._instance.sessionManager===s)return o?(this._instance.register_for_session({$sdk_debug_recording_script_not_loaded:!0}),Vr.error("could not load recorder",o)):void this.pv(e);this.lv="disabled"})}}stopRecording(){var e,t;(e=this.uv)===null||e===void 0||e.call(this),this.uv=void 0,(t=this.av)===null||t===void 0||t.stop()}dv(e=!1){var t,r;(t=this.uv)===null||t===void 0||t.call(this),this.uv=void 0,(r=this.av)===null||r===void 0||r.discard({discardProducerEvents:e})}mv(){var e,t;(e=this.Il)===null||e===void 0||e.unregister("$session_is_sampled"),(t=this.Il)===null||t===void 0||t.unregister("$replay_sample_rate")}yv(e,t){if(we(e))return null;const r=nt(e)?e:parseFloat(e);return typeof(i=r)!="number"||!Number.isFinite(i)||0>i||i>1?(Vr.warn(`${t} must be between 0 and 1. Ignoring invalid value:`,e),null):r;var i}bv(e){if(this.Il){var t,r;const i=this.Il,n=()=>{var s;const o=e.sessionRecording===!1?void 0:e.sessionRecording,a=this.yv((s=this.Ir.session_recording)===null||s===void 0?void 0:s.sampleRate,"session_recording.sampleRate"),c=this.yv(o?.sampleRate,"remote config sampleRate"),l=a??c;we(l)&&this.mv();const u=o?.minimumDurationMilliseconds;i.register({[So]:S(S({cache_timestamp:Date.now(),enabled:!!o},o),{},{networkPayloadCapture:S({capturePerformance:e.capturePerformance},o?.networkPayloadCapture),canvasRecording:{enabled:o?.recordCanvas,fps:o?.canvasFps,quality:o?.canvasQuality},sampleRate:l,minimumDurationMilliseconds:z(u)?null:u,endpoint:o?.endpoint,triggerMatchType:o?.triggerMatchType,masking:o?.masking,urlTriggers:o?.urlTriggers,version:o?.version,triggerGroups:o?.triggerGroups})})};n(),(t=this.uv)===null||t===void 0||t.call(this),this.uv=(r=this._instance.sessionManager)===null||r===void 0?void 0:r.onSessionId(n)}}onRemoteConfig(e){const t=e.ok?e.config:void 0;t&&"sessionRecording"in t?t.sessionRecording===!1?(this.bv(t),this.dv()):(this.bv(t),this.startIfEnabledOrStop()):(this.lv==="awaiting_config"&&(this.lv="missing_config",this._instance.register_for_session({[Mf]:!0}),Vr.warn("config refresh failed, recording will not start until page reload")),this.startIfEnabledOrStop())}log(e,t="log"){var r;!((r=this.av)===null||r===void 0)&&r.log?this.av.log(e,t):Vr.warn("log called before recorder was ready")}get gv(){var e,t;const r=(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0?void 0:e.get_property(So);return(r==null||(t=r.scriptConfig)===null||t===void 0?void 0:t.script)||"lazy-recorder"}_v(){const e=this._instance.get_property(So);if(!e)return!1;let t;try{t=typeof e=="object"?e:JSON.parse(e)}catch(r){return Vr.warn("persisted remote config for session recording is invalid and will be ignored",r),!1}return!we(t.cache_timestamp)&&36e5>=Date.now()-t.cache_timestamp}pv(e){var t,r,i;if(!this.hv&&this.vv&&this._instance.sessionManager){if(!(!((t=he.__PosthogExtensions__)===null||t===void 0)&&t.initSessionRecording))return Vr.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[xf]:!0});var n;if(this.av||(this.av=(n=he.__PosthogExtensions__)===null||n===void 0?void 0:n.initSessionRecording(this._instance,this.Je),this.av._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this._v()){if(this.lv==="missing_config"||this.lv==="awaiting_config")return;this.lv="awaiting_config",Vr.info("persisted remote config is stale, requesting fresh config before starting"),new zk(this._instance).load();return}this.lv=v_,(r=(i=this.av).setDocumentWasEverVisible)===null||r===void 0||r.call(i,this.Je),this.av.start(e)}else this.lv=Ku}onRRwebEmit(e){var t,r;(t=this.av)===null||t===void 0||(r=t.onRRwebEmit)===null||r===void 0||r.call(t,e)}overrideLinkedFlag(){var e,t;this.av||(t=this.Il)===null||t===void 0||t.register({$replay_override_linked_flag:!0}),(e=this.av)===null||e===void 0||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.av||(t=this.Il)===null||t===void 0||t.register({$replay_override_sampling:!0}),(e=this.av)===null||e===void 0||e.overrideSampling()}overrideTrigger(e){var t,r;this.av||(r=this.Il)===null||r===void 0||r.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(t=this.av)===null||t===void 0||t.overrideTrigger(e)}get sdkDebugProperties(){var e;const t={};for(const i of p2){var r;const n=(r=this._instance.sessionPersistence)===null||r===void 0?void 0:r.get_property(i);z(n)||(t[i]=n)}return S(S({},t),((e=this.av)===null||e===void 0?void 0:e.sdkDebugProperties)||{$recording_status:this.status})}tryAddCustomEvent(e,t){var r;return!!(!((r=this.av)===null||r===void 0)&&r.tryAddCustomEvent(e,t))}flushBeforeIdentityReset(){var e,t;(e=this.av)===null||e===void 0||(t=e.flushBeforeIdentityReset)===null||t===void 0||t.call(e)}}},$2={autocapture:class extends a2{constructor(e){super(new c2(e)),this.instance=e}},historyAutocapture:class{constructor(e){this.wv=!1,this._instance=e,this.Sv=this.xv()}initialize(){this.startIfEnabled()}get isEnabled(){const e=this.Cv();return!!(e.path||e.search||this.$v(e))}startIfEnabled(){this.isEnabled&&(Y.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.Sv=this.xv(),this.startIfEnabled()}stop(){this.Tv&&this.Tv(),this.Tv=void 0,this.Iv&&this.Iv(),this.Iv=void 0,Y.info("History API monitoring stopped")}monitorHistoryChanges(){M&&M.history&&(this.Mv("pushState"),this.Mv("replaceState"),this.Ev(),this.$v()&&this.Pv())}Mv(e){var t;if(!M||!((t=M.history[e])===null||t===void 0)&&t.__posthog_wrapped__)return;const r=this;Vo(M.history,e,i=>function(n,s,o){var a;r.Rv(o)&&r.Av(),i.call(this,n,s,o),r.Fv(e,!r.wv&&(M==null||(a=M.event)===null||a===void 0?void 0:a.type)!=="popstate")})}xv(){const e=M?.location;if(e?.pathname)return{pathname:e.pathname,search:e.search,hash:e.hash}}Cv(){const e=this._instance.config.capture_pageview;return e==="history_change"?{path:!0}:Pe(e)?e:{}}$v(e=this.Cv()){return!!e.hash&&!this._instance.config.disable_capture_url_hashes}Ov(e){const t=this.Cv(),r=this.Sv;return!(!r||!(t.path&&e.pathname!==r.pathname||t.search&&e.search!==r.search||this.$v(t)&&e.hash!==r.hash))}Fv(e,t=!1){try{t||this.Av();const r=this.xv();if(!r)return;if(this.Ov(r)){const i=()=>this._instance.capture($f,{navigation_type:e});t?(this.Dv=i,Promise.resolve().then(()=>this.Av())):i()}this.Sv=r}catch(r){Y.error(`Error capturing ${e} pageview`,r)}}Rv(e){var t,r;return!(we(e)||!M)&&((t=si(String(e)))===null||t===void 0?void 0:t.href)!==((r=M.location)===null||r===void 0?void 0:r.href)}Av(){const e=this.Dv;if(e){this.Dv=void 0,this.wv=!0;try{e()}catch(t){Y.error("Error capturing deferred pageview",t)}finally{this.wv=!1}this.Sv=this.xv()}}Ev(){if(this.Tv)return;const e=()=>{this.Fv("popstate")};Ne(M,"popstate",e),this.Tv=()=>{M&&M.removeEventListener("popstate",e)}}Pv(){if(this.Iv)return;const e=()=>{this.Fv("hashchange")};Ne(M,"hashchange",e),this.Iv=()=>{M&&M.removeEventListener("hashchange",e)}}},heatmaps:class{get Ir(){return this.instance.config}constructor(e){var t;this.Lv=!1,this.ko=!1,this.Nv=null,this.instance=e,this.Lv=!!(!((t=this.instance.persistence)===null||t===void 0)&&t.props[dp]),this.rageclicks=new uI(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){let e=5e3;return Pe(this.Ir.capture_heatmaps)&&this.Ir.capture_heatmaps.flush_interval_milliseconds&&(e=this.Ir.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return we(this.Ir.capture_heatmaps)?we(this.Ir.enable_heatmaps)?this.Lv:this.Ir.enable_heatmaps:this.Ir.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.ko)return;h2.info("starting..."),this.qv(),this.sn()}else{var e;clearInterval((e=this.Nv)!==null&&e!==void 0?e:void 0),this.jv(),this.getAndClearBuffer()}}onRemoteConfig(e){if(!e.ok)return;const t=e.config;if(!("heatmaps"in t))return;const r=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[dp]:r}),this.Lv=r,this.startIfEnabled()}getAndClearBuffer(){const e=this.Rt;return this.Rt=void 0,e}Bv(e){Yu(e.originalEvent)&&this.Mr(e.originalEvent,"deadclick")}sn(){this.Nv&&clearInterval(this.Nv),this.Nv=G?.visibilityState==="visible"?setInterval(this.yl.bind(this),this.flushIntervalMilliseconds):null}qv(){M&&G&&(this.Hv=this.yl.bind(this),Ne(M,Oc,this.Hv),this.zv=e=>this.Mr(e||M?.event),Ne(G,"click",this.zv,{capture:!0}),this.Uv=e=>this.Wv(e||M?.event),Ne(G,"mousemove",this.Uv,{capture:!0}),this.Vv=new Bv(this.instance,pF,this.Bv.bind(this)),this.Vv.startIfEnabledOrStop(),this.Gv=this.sn.bind(this),Ne(G,jo,this.Gv),this.ko=!0)}jv(){var e;M&&G&&(this.Hv&&M.removeEventListener(Oc,this.Hv),this.zv&&G.removeEventListener("click",this.zv,{capture:!0}),this.Uv&&G.removeEventListener("mousemove",this.Uv,{capture:!0}),this.Gv&&G.removeEventListener(jo,this.Gv),clearTimeout(this.Zv),(e=this.Vv)===null||e===void 0||e.stop(),this.ko=!1)}Qv(e,t){const r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),s=(function(o,a,c){let l=o;for(;l&&jr(l)&&!Pt(l,"body");){if(l===c)return!1;let h;try{var u,p,d;h=(u=(p=(d=l.ownerDocument)===null||d===void 0?void 0:d.defaultView)!==null&&p!==void 0?p:M)===null||u===void 0?void 0:u.getComputedStyle(l).position}catch{return!1}if(ve(a,h))return!0;l=Ek(l)}return!1})(ko(e),["fixed","sticky"],n);return{x:e.clientX+(s?0:i),y:e.clientY+(s?0:r),target_fixed:s,type:t}}Mr(e,t="click"){var r;if(Lv(e.target)||!Yu(e))return;const i=this.Qv(e,t);(r=this.rageclicks)!==null&&r!==void 0&&r.isRageClick(e.clientX,e.clientY,new Date().getTime())&&Ik(ko(e),this.instance.config.rageclick)&&this.Zs(S(S({},i),{},{type:"rageclick"})),this.Zs(i)}Wv(e){!Lv(e.target)&&Yu(e)&&(clearTimeout(this.Zv),this.Zv=setTimeout(()=>{this.Zs(this.Qv(e,"mousemove"))},500))}Zs(e){if(!M)return;const t=this.Ir.disable_capture_url_hashes?qi(M.location.href):M.location.href,r=this.Ir.custom_personal_data_properties,i=this.Ir.mask_personal_data_properties?[...Es,...r||[]]:[],n=Ho(t,i,Bo);this.Rt=this.Rt||{},this.Rt[n]||(this.Rt[n]=[]),this.Rt[n].push(e)}yl(){this.Rt&&!Kt(this.Rt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Bv,webVitalsAutocapture:class{constructor(e){var t;this._instance=e,this.Lv=!1,this.ko=!1,this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Jv=()=>{clearTimeout(this.Kv),this.Kv=void 0,this.Rt.metrics.length!==0&&(this._instance.capture("$web_vitals",S({$current_url:this.Rt.url},this.Rt.metrics.reduce((r,i)=>S(S({},r),{},{[`$web_vitals_${i.name}_event`]:S({},i),[`$web_vitals_${i.name}_value`]:i.value}),{}))),this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Xv=r=>{var i;if(this.Rt=this.Rt||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},we(r?.name)||we(r?.value))return void Gi.error("Invalid metric received",r);const n=typeof r.navigationURL=="string"?r.navigationURL:void 0,s=this.Yv(n);if(z(s))return;const o=nt(r.navigationId)||typeof r.navigationId=="string"?`navigation:${r.navigationId}`:`url:${s}`;if(this.tf&&r.value>=this.tf)return void Gi.error("Ignoring metric with value >= "+this.tf,r);this.Rt.navigationKey!==o&&(this.Jv(),this.Kv=setTimeout(this.Jv,this.flushToCaptureTimeoutMs)),z(this.Rt.navigationKey)&&(this.Rt.navigationKey=o,this.Rt.url=s),this.Rt.firstMetricTimestamp=z(this.Rt.firstMetricTimestamp)?Date.now():this.Rt.firstMetricTimestamp;const a=(i=this._instance.sessionManager)===null||i===void 0?void 0:i.checkAndGetSessionAndWindowId(!0),c=S(S(S({},r),n?{navigationURL:s}:{}),{},{$current_url:s,timestamp:Date.now()});if(delete c.entries,Pe(r.attribution)&&this.attributionMetrics.indexOf(r.name)>-1){const l={};for(const u of d2){const p=u==="url"&&typeof r.attribution[u]=="string"?this.Yv(r.attribution[u]):r.attribution[u];z(p)||(l[u]=p)}c.attribution=l}else delete c.attribution;z(a)||(c.$session_id=a.sessionId,c.$window_id=a.windowId),this.Rt.metrics.push(c),this.Rt.metrics.length===this.allowedMetrics.length&&this.Jv()},this.ef=()=>{if(this.ko)return;let r,i,n,s,o=!1;const a=he.__PosthogExtensions__,c=a?.postHogWebVitalsCallbacksByFlavor,l=c?.[this.if]||(this.if==="web-vitals"&&z(c)?a?.postHogWebVitalsCallbacks:void 0);if(!z(l)){const d=l.withoutAttribution,h=this.attributionMetrics;o=!z(d),r=h.indexOf("LCP")>-1?l.onLCP:d?.onLCP||l.onLCP,i=h.indexOf("CLS")>-1?l.onCLS:d?.onCLS||l.onCLS,n=h.indexOf("FCP")>-1?l.onFCP:d?.onFCP||l.onFCP,s=h.indexOf("INP")>-1?l.onINP:d?.onINP||l.onINP}if(!(r&&i&&n&&s))return void Gi.error("web vitals callbacks not loaded - not starting");const u={reportSoftNavs:this.useSoftNavs},p=o&&this.attributionMetrics.indexOf("INP")>-1?S(S({},u),{},{includeProcessedEventEntries:!1}):u;this.allowedMetrics.indexOf("LCP")>-1&&r(this.Xv.bind(this),u),this.allowedMetrics.indexOf("CLS")>-1&&i(this.Xv.bind(this),u),this.allowedMetrics.indexOf("FCP")>-1&&n(this.Xv.bind(this),u),this.allowedMetrics.indexOf("INP")>-1&&s(this.Xv.bind(this),p),this.ko=!0},this.Lv=!!(!((t=this._instance.persistence)===null||t===void 0)&&t.props[fp]),this.startIfEnabled()}get nf(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t;const r=Pe(this.nf)?(e=this.nf)===null||e===void 0?void 0:e.web_vitals_allowed_metrics:void 0;return we(r)?((t=this._instance.persistence)===null||t===void 0?void 0:t.props.$web_vitals_allowed_metrics)||g_:r}get flushToCaptureTimeoutMs(){return(Pe(this.nf)?this.nf.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){const e=Pe(this.nf)?this.nf.web_vitals_attribution:void 0;return Ft(e)?e?g_:[]:_e(e)?e:u2}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){const e=Pe(this.nf)?this.nf.__preview_web_vitals_soft_navs:void 0;return e!=null&&e}get tf(){const e=Pe(this.nf)&&nt(this.nf.__web_vitals_max_value)?this.nf.__web_vitals_max_value:m_;return e>0&&6e4>=e?m_:e}get isEnabled(){const e=Ze?.protocol;if(e!=="http:"&&e!=="https:")return Gi.info("Web Vitals are disabled on non-http/https protocols"),!1;const t=Pe(this.nf)?this.nf.web_vitals:Ft(this.nf)?this.nf:void 0;return Ft(t)?t:this.Lv}startIfEnabled(){this.isEnabled&&!this.ko&&(Gi.info("enabled, starting..."),this.Ho(this.ef))}onRemoteConfig(e){if(!e.ok)return;const t=e.config;if(!("capturePerformance"in t))return;const r=Pe(t.capturePerformance)&&!!t.capturePerformance.web_vitals,i=Pe(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[fp]:r}),this._instance.persistence.register({[XE]:i})),this.Lv=r,this.startIfEnabled()}get if(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}Ho(e){var t;const r=he.__PosthogExtensions__,i=this.if,n=r?.postHogWebVitalsCallbacksByFlavor;n?.[i]||i==="web-vitals"&&z(n)&&r?.postHogWebVitalsCallbacks?e():r==null||(t=r.loadExternalDependency)===null||t===void 0||t.call(r,this._instance,i,s=>{s?Gi.error("failed to load script",s):e()})}Yv(e){const t=e||M?.location.href;if(!t)return void Gi.error("Could not determine current URL");const r=this._instance.config.disable_capture_url_hashes?qi(t):t,i=this._instance.config.custom_personal_data_properties,n=this._instance.config.mask_personal_data_properties?[...Es,...i||[]]:[];return Ho(r,n,Bo)}}},N2={exceptionObserver:class{constructor(e){var t;this.ef=()=>{var r;if(!M||!this.isEnabled||!(!((r=he.__PosthogExtensions__)===null||r===void 0)&&r.errorWrappingFunctions))return;const i=he.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,n=he.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,s=he.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.sf&&this.Ir.capture_unhandled_errors&&(this.sf=i(this.captureException.bind(this))),!this.rf&&this.Ir.capture_unhandled_rejections&&(this.rf=n(this.captureException.bind(this))),!this.af&&this.Ir.capture_console_errors&&(this.af=s(this.captureException.bind(this)))}catch(o){ro.error("failed to start",o),this.lf()}},this._instance=e,this.uf=!!(!((t=this._instance.persistence)===null||t===void 0)&&t.props[pp]),this.wt=new xj(S(S({},(function(r={}){var i,n,s,o;return{refillRate:(i=(n=r.exceptionRateLimiterRefillRate)!==null&&n!==void 0?n:r.__exceptionRateLimiterRefillRate)!==null&&i!==void 0?i:1,bucketSize:(s=(o=r.exceptionRateLimiterBucketSize)!==null&&o!==void 0?o:r.__exceptionRateLimiterBucketSize)!==null&&s!==void 0?s:10}})(this._instance.config.error_tracking)),{},{refillInterval:1e4,A:ro})),this.Ir=this.hf(),this.startIfEnabledOrStop()}hf(){const e=this._instance.config.capture_exceptions;let t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Pe(e)?t=S(S({},t),e):(z(e)?this.uf:e)&&(t=S(S({},t),{},{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Ir.capture_console_errors||this.Ir.capture_unhandled_errors||this.Ir.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(ro.info("enabled"),this.lf(),this.Ho(this.ef)):this.lf()}Ho(e){var t,r,i;!((t=he.__PosthogExtensions__)===null||t===void 0)&&t.errorWrappingFunctions?e():(r=he.__PosthogExtensions__)===null||r===void 0||(i=r.loadExternalDependency)===null||i===void 0||i.call(r,this._instance,"exception-autocapture",n=>{if(n)return ro.error("failed to load script",n);e()})}lf(){var e,t,r;(e=this.sf)===null||e===void 0||e.call(this),this.sf=void 0,(t=this.rf)===null||t===void 0||t.call(this),this.rf=void 0,(r=this.af)===null||r===void 0||r.call(this),this.af=void 0}onRemoteConfig(e){if(!e.ok)return;const t=e.config;"autocaptureExceptions"in t&&(this.uf=!!t.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[pp]:this.uf}),this.Ir=this.hf(),this.startIfEnabledOrStop())}onConfigChange(){this.Ir=this.hf()}captureException(e){try{var t,r,i;const n=(t=e==null||(r=e.$exception_list)===null||r===void 0||(r=r[0])===null||r===void 0?void 0:r.type)!==null&&t!==void 0?t:"Exception";if(this.wt.consumeRateLimit(n))return void ro.info("Skipping exception capture because of client rate limiting.",{exception:n});(i=this._instance.exceptions)===null||i===void 0||i.sendExceptionEvent(e)}catch{}}},exceptions:class{constructor(e){var t,r;this.cf=[],this.df=new Bj([new sz,new fz,new az,new oz,new pz,new dz,new lz,new hz],(function(i,...n){return(s,o=0)=>{const a=[],c=s.split(`
62
- `),l=Math.min(c.length,o+1e3),u=[];for(let h=o;l>h;h++){const f=c[h];if(f.length>1024)continue;const m=gv.test(f)?f.replace(gv,"$1"):f;if(!m.match(/\S*Error: /)){for(const v of n){const _=v(m,i);if(_){a.push(_);const b=tz(a);if(b){for(let A=u.length-1;A>=0;A--){const P=u[A];if(b.start>=P.start+P.length)break;u.pop()}u.push(b)}break}}if(iz(a,u)>=50)break}}const p=[...u].sort((h,f)=>f.start-h.start),d=p[p.length-1];if(d){const h=ME(a,d);a.splice(d.start-h,h);for(const f of p)f.start-=h}for(const h of p)rz(a,h);return u.some(h=>h.start===0&&a.length===h.length)&&(function(h){const f=h.map(v=>`${v.function}|${v.filename}|${v.lineno}|${v.colno}|${v.module}`);let m=0;for(let v=1;f.length>v;v++)nz(f,v,m)&&(m=v);h.push(...h.splice(0,m))})(a),(function(h){if(!h.length)return[];const f=Array.from(h);return f.reverse(),f.slice(0,50).map(m=>{return S(S({},m),{},{filename:m.filename||(v=f,v[v.length-1]||{}).filename,function:m.function||"?"});var v})})(a)}})("web:javascript",Xj,ez)),this._instance=e,this.cf=(t=(r=this._instance.persistence)===null||r===void 0?void 0:r.get_property("$error_tracking_suppression_rules"))!==null&&t!==void 0?t:[],this.vf=Ac(this.ff()),this.pf=new gz(this.vf)}onConfigChange(){this.vf=Ac(this.ff()),this.pf.setConfig(this.vf)}onRemoteConfig(e){var t,r,i;if(!e.ok)return;const n=e.config;if(!("errorTracking"in n))return;const s=(t=(r=n.errorTracking)===null||r===void 0?void 0:r.suppressionRules)!==null&&t!==void 0?t:[],o=(i=n.errorTracking)===null||i===void 0?void 0:i.captureExtensionExceptions;this.cf=s,this._instance.persistence&&this._instance.persistence.register({[KE]:this.cf,[hp]:o})}get gf(){var e;const t=!!this._instance.get_property(hp),r=this._instance.config.error_tracking.captureExtensionExceptions;return(e=r??t)!==null&&e!==void 0&&e}buildProperties(e,t){return this.df.buildFromUnknown(e,{syntheticException:t?.syntheticException,mechanism:{handled:t?.handled}})}addExceptionStep(e,t){if(this.vf.enabled)try{if(!Ae(e)||e.trim().length===0)return void fr.warn("Ignoring exception step because message must be a non-empty string");const{sanitizedProperties:r,droppedKeys:i}=(function(n){if(!n)return{sanitizedProperties:{},droppedKeys:[]};const s=[];return{sanitizedProperties:Object.keys(n).reduce((o,a)=>mz.has(a)?(s.push(a),o):(o[a]=n[a],o),{}),droppedKeys:s}})(this.mf(t));i.length>0&&fr.warn("Ignoring reserved exception step fields",{droppedKeys:i}),this.pf.add(S({[kc]:e,[Ic]:new Date().toISOString()},r))}catch(r){fr.error("Failed to add exception step. Ignoring breadcrumb.",r)}}sendExceptionEvent(e){try{const t=e.$exception_list;if(this.yf(t)){if(this.bf(t))return this._f("Exception dropped: matched a suppression rule"),void fr.info("Skipping exception capture because a suppression rule matched");if(!this.gf&&this.wf(t))return this._f("Exception dropped: thrown by a browser extension"),void fr.info("Skipping exception capture because it was thrown by an extension");if(!this.gf&&this.kf(t))return this._f("Exception dropped: thrown by an injected browser script"),void fr.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Sf(t))return this._f("Exception dropped: thrown by the PostHog SDK"),void fr.info("Skipping exception capture because it was thrown by the PostHog SDK")}const r=this.vf.enabled&&we(e.$exception_steps)?this.xf(e):e,i=(function(){const n=globalThis._posthogReleaseId;return typeof n=="string"&&n.length>0?n:void 0})();i&&(r.$release_id=i);try{const n=this._instance.capture("$exception",r,{_noTruncate:!0,_batchKey:"exceptionEvent",fh:!0});return n&&this.pf.clear(),n}catch(n){T_(n)||fr.error("Failed to capture exception event. Dropping this exception.",n),this.pf.clear();return}}catch(t){T_(t)||fr.error("Failed to process exception event. Ignoring this exception.",t);return}}xf(e){try{const t=this.pf.getAttachable();return t.length===0?e:S(S({},e),{},{$exception_steps:t})}catch(t){return fr.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}_f(e){this.vf.enabled&&this.pf.add({[kc]:e,[Ic]:new Date().toISOString()})}mf(e){return Pe(e)?S({},e):{}}ff(){var e,t;return(e=(t=this._instance.config.error_tracking)===null||t===void 0?void 0:t.exception_steps)!==null&&e!==void 0?e:{}}bf(e){if(e.length===0)return!1;try{const t=e.reduce((r,{type:i,value:n})=>(Ae(i)&&i.length>0&&r.$exception_types.push(i),Ae(n)&&n.length>0&&r.$exception_values.push(n),r),{$exception_types:[],$exception_values:[]});return this.cf.some(r=>{const i=r.values.map(n=>{const s=oI[n.operator],o=t[n.key];if(!s||!o)return!1;const a=_e(n.value)?n.value:[n.value];return a.length>0&&s(a,o)});return r.type==="OR"?i.some(Boolean):i.every(Boolean)})}catch(t){return fr.warn("Failed to evaluate suppression rules. Capturing the exception.",t),!1}}wf(e){const t=e.flatMap(i=>{var n,s;return(n=(s=i.stacktrace)===null||s===void 0?void 0:s.frames)!==null&&n!==void 0?n:[]}),r=t.filter(({filename:i})=>!!i&&I2.some(n=>i.startsWith(n)));return r.length!==0&&(!r.every(({filename:i})=>!!i&&i.startsWith(Cp))||e.some(({type:i,value:n})=>i==="NoResponse"||Ae(n)&&k2.some(({value:s,exact:o})=>o?n===s:n.includes(s)))&&!t.some(({in_app:i,filename:n})=>i&&!n?.startsWith(Cp)))}kf(e){return e.some(({value:t})=>Ae(t)&&A2.some(r=>t.includes(r)))}Sf(e){if(e.length>0){var t,r,i,n;const s=(t=(r=e[0].stacktrace)===null||r===void 0?void 0:r.frames)!==null&&t!==void 0?t:[],o=s[s.length-1];return(i=o==null||(n=o.filename)===null||n===void 0?void 0:n.includes("posthog.com/static"))!==null&&i!==void 0&&i}return!1}yf(e){return!we(e)&&_e(e)}}},D2=S({productTours:class{get Il(){return this._instance.persistence}constructor(e){this.Cf=null,this.$f=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!e.ok)return;const t=e.config;if("productTours"in t){var r,i;if(this.Il&&this.Il.register({[Pf]:!!t.productTours}),!Xu(this._instance))return!this.Cf&&we((r=this.Il)===null||r===void 0?void 0:r.props.ph_product_tours)||Da.info("product tours disabled; stopping and clearing cached tours"),(i=this.Cf)===null||i===void 0||i.stop(),this.Cf=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.Cf&&Xu(this._instance)&&this.Ho(()=>this.Tf())}Ho(e){var t,r,i;!((t=he.__PosthogExtensions__)===null||t===void 0)&&t.generateProductTours?e():(r=he.__PosthogExtensions__)===null||r===void 0||(i=r.loadExternalDependency)===null||i===void 0||i.call(r,this._instance,"product-tours",n=>{n?Da.error("Could not load product tours script",n):e()})}Tf(){var e;!this.Cf&&(e=he.__PosthogExtensions__)!==null&&e!==void 0&&e.generateProductTours&&(this.Cf=he.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t=!1){if(_e(this.$f)&&!t)return void e(this.$f,{isLoaded:!0});const r=this.Il;if(r){const i=r.props[gp];if(_e(i)&&!t)return this.$f=i,void e(i,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/product_tours/?token=${this._instance.config.token}`),method:"GET",timestampMode:"query",callback:i=>{if(!Xu(this._instance))return void e([],{isLoaded:!0});const n=i.statusCode;if(n!==200||!i.json){const o=`Product Tours API could not be loaded, status: ${n}`;n===0?i.error||Da.warn(o):Da.error(o),e([],{isLoaded:!1,error:o});return}const s=_e(i.json.product_tours)?i.json.product_tours:[];this.$f=s,r&&r.register({[gp]:s}),e(s,{isLoaded:!0})}})}getActiveProductTours(e){we(this.Cf)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.Cf.getActiveProductTours(e)}showProductTour(e){var t;(t=this.Cf)===null||t===void 0||t.showTourById(e)}previewTour(e){this.Cf?this.Cf.previewTour(e):this.Ho(()=>{var t;this.Tf(),(t=this.Cf)===null||t===void 0||t.previewTour(e)})}dismissProductTour(){var e;(e=this.Cf)===null||e===void 0||e.dismissTour("user_clicked_skip")}nextStep(){var e;(e=this.Cf)===null||e===void 0||e.nextStep()}previousStep(){var e;(e=this.Cf)===null||e===void 0||e.previousStep()}clearCache(){var e;this.$f=null,(e=this.Il)===null||e===void 0||e.unregister("ph_product_tours")}resetTour(e){var t;(t=this.Cf)===null||t===void 0||t.resetTour(e)}resetAllTours(){var e;(e=this.Cf)===null||e===void 0||e.resetAllTours()}cancelPendingTour(e){var t;(t=this.Cf)===null||t===void 0||t.cancelPendingTour(e)}}},ql),U2={siteApps:class{constructor(e){this._instance=e,this.If=0,this.Mf=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Ef(e,t){if(!t)return;const r=this.globalsForEvent(t);this.Mf.push(r),this.Mf.length>1e3&&(this.Mf=this.Mf.slice(10))}get siteAppLoaders(){var e;return(e=he._POSTHOG_REMOTE_CONFIG)===null||e===void 0||(e=e[this._instance.config.token])===null||e===void 0?void 0:e.siteApps}initialize(){if(this.isEnabled){const e=this._instance._addCaptureHook(this.Ef.bind(this));this.Pf=()=>{e(),this.Mf=[],this.Pf=void 0}}}globalsForEvent(e){var t,r,i,n,s,o,a;if(!e)throw new Error("Event payload is required");const c={},l=this._instance.get_property("$groups")||[],u=this._instance.get_property("$stored_group_properties")||{};for(const[h,f]of Object.entries(u))c[h]={id:l[h],type:h,properties:f};const{$set_once:p,$set:d}=e;return{event:S(S({},DE(e,f2)),{},{properties:S(S(S({},e.properties),d?{$set:S(S({},(t=(r=e.properties)===null||r===void 0?void 0:r.$set)!==null&&t!==void 0?t:{}),d)}:{}),p?{$set_once:S(S({},(i=(n=e.properties)===null||n===void 0?void 0:n.$set_once)!==null&&i!==void 0?i:{}),p)}:{}),elements_chain:(s=(o=e.properties)===null||o===void 0?void 0:o.$elements_chain)!==null&&s!==void 0?s:"",distinct_id:(a=e.properties)===null||a===void 0?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}Rf(e){var t;const r=(t=e.tagName)===null||t===void 0?void 0:t.toLowerCase();return r==="style"&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(e)||(Ar.error("prepare_external_dependency_stylesheet returned null"),null):r==="script"&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(e)||(Ar.error("prepare_external_dependency_script returned null"),null):e}Af(){var e,t,r,i,n,s,o,a;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};const c=G?.defaultView,l=c==null||(e=c.Node)===null||e===void 0?void 0:e.prototype;if(!c||!l)return()=>{};if(this.If++,this.Ff)return this.Of();const u=[],p=this,d=new WeakSet,h=(v,_,b)=>{if(!v?.[_])return;const A=v[_];v[_]=b(A),u.push(()=>{v[_]=A})},f=v=>{if(d.has(v))return v;const _=p.Rf(v);return _&&d.add(_),_},m=v=>v.map(_=>typeof _=="string"?_:f(_)).filter(_=>!Qe(_));return h(l,"appendChild",v=>function(_){const b=f(_);return b?v.call(this,b):_}),h(l,"insertBefore",v=>function(_,b){const A=f(_);return A?v.call(this,A,b):_}),h(l,"replaceChild",v=>function(_,b){const A=f(_);return A?v.call(this,A,b):b}),[(t=c.Element)===null||t===void 0?void 0:t.prototype,(r=c.Document)===null||r===void 0?void 0:r.prototype,(i=c.DocumentFragment)===null||i===void 0?void 0:i.prototype].forEach(v=>{h(v,"append",_=>function(...b){return _.apply(this,m(b))}),h(v,"prepend",_=>function(...b){return _.apply(this,m(b))})}),[(n=c.Element)===null||n===void 0?void 0:n.prototype,(s=c.CharacterData)===null||s===void 0?void 0:s.prototype,(o=c.DocumentType)===null||o===void 0?void 0:o.prototype].forEach(v=>{h(v,"before",_=>function(...b){return _.apply(this,m(b))}),h(v,"after",_=>function(...b){return _.apply(this,m(b))}),h(v,"replaceWith",_=>function(...b){const A=m(b);return b.length&&!A.length?void 0:_.apply(this,A)})}),h((a=c.Element)===null||a===void 0?void 0:a.prototype,"insertAdjacentElement",v=>function(_,b){const A=f(b);return A?v.call(this,_,A):null}),this.Ff=()=>{u.forEach(v=>v()),this.Ff=void 0},this.Of()}Of(){let e=!1;return()=>{var t;e||(e=!0,this.If--,this.If===0&&((t=this.Ff)===null||t===void 0||t.call(this)))}}Df(e,t=!0){const r=this.Af();try{const i=e(r);return t&&r(),i}catch(i){throw r(),i}}setupSiteApp(e){const t=this.apps[e.id],r=()=>{var s;!t.errored&&this.Mf.length&&(Ar.info(`Processing ${this.Mf.length} events for site app with id ${e.id}`),this.Mf.forEach(o=>this.Df(()=>{var a;return(a=t.processEvent)===null||a===void 0?void 0:a.call(t,o)})),t.processedBuffer=!0),Object.values(this.apps).every(o=>o.processedBuffer||o.errored)&&((s=this.Pf)===null||s===void 0||s.call(this))};let i=!1;const n=s=>{t.errored=!s,t.loaded=!0,Ar.info(`Site app with id ${e.id} ${s?"loaded":"errored"}`),i&&r()};try{const{processEvent:s}=this.Df(o=>e.init({posthog:this._instance,callback(a){o(),n(a)}}),!1);s&&(t.processEvent=s),i=!0}catch(s){Ar.error(__+e.id,s),n(!1)}if(i&&t.loaded)try{r()}catch(s){Ar.error(`Error while processing buffered events PostHog app with config id ${e.id}`,s),t.errored=!0}}Lf(){const e=this.siteAppLoaders||[];for(const t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(const t of e)this.setupSiteApp(t)}Nf(e){if(Object.keys(this.apps).length===0)return;const t=this.globalsForEvent(e);for(const r of Object.values(this.apps))try{this.Df(()=>{var i;return(i=r.processEvent)===null||i===void 0?void 0:i.call(r,t)})}catch(i){Ar.error(`Error while processing event ${e.event} for site app ${r.id}`,i)}}onRemoteConfig(e){var t,r,i;if(!((t=this.siteAppLoaders)===null||t===void 0)&&t.length)return this.isEnabled?(this.Lf(),void this._instance.on("eventCaptured",a=>this.Nf(a))):void Ar.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((r=this.Pf)===null||r===void 0||r.call(this),!e.ok)return;const n=e.config;if(!((i=n.siteApps)===null||i===void 0)&&i.length)if(this.isEnabled)for(const{id:a,url:c}of n.siteApps){var s,o;he[`__$$ph_site_app_${a}`]=this._instance,(s=he.__PosthogExtensions__)===null||s===void 0||(o=s.loadSiteApp)===null||o===void 0||o.call(s,this._instance,c,l=>{if(l)return Ar.error(__+a,l)})}else Ar.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},q2={tracingHeaders:class{constructor(e){this._instance=e,this.qf=void 0,this.jf=void 0,this.Bf=void 0,this.ef=()=>{const t=this.Hf();var r,i;t?(z(this.qf)&&(this.qf=(r=he.__PosthogExtensions__)===null||r===void 0||(r=r.tracingHeadersPatchFns)===null||r===void 0?void 0:r._patchXHR(t,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),z(this.jf)&&(this.jf=(i=he.__PosthogExtensions__)===null||i===void 0||(i=i.tracingHeadersPatchFns)===null||i===void 0?void 0:i._patchFetch(t,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.lf()}}initialize(){this.startIfEnabledOrStop()}Ho(e){var t,r,i;!((t=he.__PosthogExtensions__)===null||t===void 0)&&t.tracingHeadersPatchFns?e():(r=he.__PosthogExtensions__)===null||r===void 0||(i=r.loadExternalDependency)===null||i===void 0||i.call(r,this._instance,"tracing-headers",n=>{if(n)return l2.error("failed to load script",n);e()})}zf(){var e,t;return(e=(t=this._instance.config.tracing_headers)!==null&&t!==void 0?t:this._instance.config.addTracingHeaders)!==null&&e!==void 0?e:this._instance.config.__add_tracing_headers}Hf(){const e=this.zf();return _e(e)?(_e(this.Bf)?this.Bf.splice(0,this.Bf.length,...e):this.Bf=[...e],e.length>0?this.Bf:void 0):(_e(this.Bf)&&this.Bf.splice(0),this.Bf=e||void 0,this.Bf)}lf(){var e,t;(e=this.qf)===null||e===void 0||e.call(this),(t=this.jf)===null||t===void 0||t.call(this),this.qf=void 0,this.jf=void 0}startIfEnabledOrStop(){this.Hf()?this.Ho(this.ef):this.lf()}}},j2=S({surveys:class extends m2{constructor(e){var t;super(new b2(e),(t=e,{get projectToken(){return t.config.token},kv:new y2(t)})),this._instance=e}Vh(e,t){const r=t.query?sa(e,t.query):e;return new Promise(i=>{var n;this._instance._send_request({method:t.method,url:this._instance.requestRouter.endpointFor((n=t.target)!==null&&n!==void 0?n:"api",r),data:t.body,headers:t.headers,timeout:t.timeoutMs,fireCallbackOnDrop:!0,transport:t.transport,compression:t.compression,timestampMode:t.sentAt,callback:i})})}}},ql),z2={toolbar:class{constructor(e){this.instance=e}Uf(e){he.ph_toolbar_state=e}Wf(){var e;return(e=he.ph_toolbar_state)!==null&&e!==void 0?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e=void 0,t=void 0,r=void 0){var i,n;if(_p(this.instance.config)||!M||!G)return!1;e=(i=e)!==null&&i!==void 0?i:M.location,r=(n=r)!==null&&n!==void 0?n:M.history;try{if(!t){try{M.localStorage.setItem("test","test"),M.localStorage.removeItem("test")}catch{return!1}t=M?.localStorage}const s=S2||Mc(e.hash,"__posthog")||Mc(e.hash,"state");let o;const a=s?pv(()=>JSON.parse(atob(decodeURIComponent(s))))||pv(()=>JSON.parse(decodeURIComponent(s))):null;return a&&a.action==="ph_authorize"?(o=a,o.source="url",o&&Object.keys(o).length>0&&(a.desiredHash?e.hash=a.desiredHash:r?r.replaceState(r.state,"",e.pathname+e.search):e.hash="")):(o=JSON.parse(t.getItem(b_)||"{}"),o.source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token||(this.loadToolbar(o),0))}catch{return!1}}Vf(e){const t=he.ph_load_toolbar||he.ph_load_editor;!we(t)&&gt(t)?t(e,this.instance):S_.warn("No toolbar load function found")}loadToolbar(e){const t=!!G?.getElementById("__POSTHOG_TOOLBAR__");if(!M||t)return!1;const r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,i=S(S({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(M.localStorage.setItem(b_,JSON.stringify(S(S({},i),{},{source:void 0}))),this.Wf()===2)this.Vf(i);else if(this.Wf()===0){var n,s;this.Uf(1),(n=he.__PosthogExtensions__)===null||n===void 0||(s=n.loadExternalDependency)===null||s===void 0||s.call(n,this.instance,"toolbar",o=>{if(o)return S_.error("[Toolbar] Failed to load",o),void this.Uf(0);this.Uf(2),this.Vf(i)}),Ne(M,"turbolinks:load",()=>{this.Uf(0),this.loadToolbar(i)})}return!0}Gf(e){return this.loadToolbar(e)}maybeLoadEditor(e=void 0,t=void 0,r=void 0){return this.maybeLoadToolbar(e,t,r)}}},F2=S({experiments:class Ut{get Ir(){return this._instance.config}constructor(t){this._instance=t,this.getWebExperimentsAndEvaluateDisplayLogic=(r=!1)=>{this.getWebExperiments(i=>{Ut.Zf("retrieved web experiments from the server"),this.Qf=new Map,i.forEach(n=>{if(n.feature_flag_key){var s;this.Qf&&(Ut.Zf("setting flag key ",n.feature_flag_key," to web experiment ",n),(s=this.Qf)===null||s===void 0||s.set(n.feature_flag_key,n));const o=this._instance.getFeatureFlag(n.feature_flag_key);Ae(o)&&n.variants[o]&&this.Jf(n.name,o,n.variants[o].transforms)}else if(n.variants)for(const o in n.variants){const a=n.variants[o];Ut.Kf(a,this._instance)&&this.Jf(n.name,o,a.transforms)}})},r)},this._instance.onFeatureFlags(r=>{this.onFeatureFlags(r)})}initialize(){}onFeatureFlags(t){if(this._is_bot())Ut.Zf(C_);else if(!this.Ir.disable_web_experiments){if(we(this.Qf))return this.Qf=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Ut.Zf("applying feature flags",t),t.forEach(r=>{var i;if(this.Qf&&(!((i=this.Qf)===null||i===void 0)&&i.has(r))){var n;const s=this._instance.getFeatureFlag(r),o=(n=this.Qf)===null||n===void 0?void 0:n.get(r);s&&o!=null&&o.variants[s]&&this.Jf(o.name,s,o.variants[s].transforms)}})}}previewWebExperiment(){const t=Ut.getWindowLocation();if(t?.search){const r=ws(t?.search,"__experiment_id"),i=ws(t?.search,"__experiment_variant");r&&i&&(Ut.Zf(`previewing web experiments ${r} && ${i}`),this.getWebExperiments(n=>{this.Xf(parseInt(r),i,n)},!1,!0))}}loadIfEnabled(){this.Ir.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,r,i){if(this.Ir.disable_web_experiments&&!i)return t([]);const n=this._instance.get_property("$web_experiments");if(n&&!r)return t(n);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/web_experiments/?token=${this.Ir.token}`),method:"GET",timestampMode:"query",callback:s=>t(s.statusCode===200&&s.json&&s.json.experiments||[])})}Xf(t,r,i){const n=i.filter(s=>s.id===t);n&&n.length>0&&(Ut.Zf(`Previewing web experiment [${n[0].name}] with variant [${r}]`),this.Jf(n[0].name,r,n[0].variants[r].transforms))}static Kf(t,r){return!we(t.conditions)&&Ut.Yf(t,r)&&Ut.tp(t)}static Yf(t,r){var i;if(we(t.conditions)||we((i=t.conditions)===null||i===void 0?void 0:i.url))return!0;const n=Ut.getWindowLocation();if(n){var s,o,a;const c=bk(r,n.href);return!(!((s=t.conditions)===null||s===void 0)&&s.url)||R2[(o=(a=t.conditions)===null||a===void 0?void 0:a.urlMatchType)!==null&&o!==void 0?o:"icontains"](t.conditions.url,c)}return!1}static getWindowLocation(){return M?.location}static tp(t){var r;if(we(t.conditions)||we((r=t.conditions)===null||r===void 0?void 0:r.utm))return!0;const i=xk();if(i.utm_source){var n,s,o,a,c,l,u,p;const d=!(!((n=t.conditions)===null||n===void 0||(n=n.utm)===null||n===void 0)&&n.utm_campaign)||((s=t.conditions)===null||s===void 0||(s=s.utm)===null||s===void 0?void 0:s.utm_campaign)==i.utm_campaign,h=!(!((o=t.conditions)===null||o===void 0||(o=o.utm)===null||o===void 0)&&o.utm_source)||((a=t.conditions)===null||a===void 0||(a=a.utm)===null||a===void 0?void 0:a.utm_source)==i.utm_source,f=!(!((c=t.conditions)===null||c===void 0||(c=c.utm)===null||c===void 0)&&c.utm_medium)||((l=t.conditions)===null||l===void 0||(l=l.utm)===null||l===void 0?void 0:l.utm_medium)==i.utm_medium,m=!(!((u=t.conditions)===null||u===void 0||(u=u.utm)===null||u===void 0)&&u.utm_term)||((p=t.conditions)===null||p===void 0||(p=p.utm)===null||p===void 0?void 0:p.utm_term)==i.utm_term;return d&&f&&m&&h}return!1}static Zf(t,...r){Y.info(`[WebExperiments] ${t}`,r)}Jf(t,r,i){this._is_bot()?Ut.Zf(C_):r!=="control"?i.forEach(n=>{if(n.selector){var s;Ut.Zf(`applying transform of variant ${r} for experiment ${t} `,n),((s=document)===null||s===void 0?void 0:s.querySelectorAll(n.selector))?.forEach(o=>{const a=o;n.html&&(a.innerHTML=n.html),n.css&&a.setAttribute("style",n.css)})}}):Ut.Zf("Control variants leave the page unmodified.")}_is_bot(){return vt&&this._instance?iI(vt,this.Ir.custom_blocked_useragents):void 0}}},ql),H2={conversations:class{constructor(e){this._instance=e,this.ep=void 0,this._conversationsManager=null,this.np=!1,this.ne=null,this.sp=!1}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(this._instance.config.disable_conversations||(this.rp=e.ok,!e.ok))return;const t=e.config.conversations;we(t)||(Ft(t)?this.ep=t:(this.ep=t.enabled,this.ne=t),this.loadIfEnabled())}reset(){var e;(e=this._conversationsManager)===null||e===void 0||e.reset(),this._conversationsManager=null,this.ep=void 0,this.ne=null,this.rp=void 0,this.sp=!1}loadIfEnabled(){if(this._conversationsManager||this.np||this._instance.config.disable_conversations||_p(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())return;const e=he?.__PosthogExtensions__;if(e&&!z(this.ep)&&this.ep)if(this.ne&&this.ne.token){this.np=!0;try{const t=e.initConversations;if(t)return this.op(t),void(this.np=!1);const r=e.loadExternalDependency;if(!r)return void this.ap(Lf);r(this._instance,"conversations",i=>{i||!e.initConversations?this.ap("Could not load conversations script",i):this.op(e.initConversations),this.np=!1})}catch(t){this.ap("Error initializing conversations",t),this.np=!1}}else ar.error("Conversations enabled but missing token in remote config.")}op(e){if(this.ne)try{this._conversationsManager=e(this.ne,this._instance),this.sp=!1,ar.info("Conversations loaded successfully")}catch(t){this.ap("Error completing conversations initialization",t)}else ar.error("Cannot complete initialization: remote config is null")}ap(e,t){ar.error(e,t),this._conversationsManager=null,this.np=!1,this.sp=!0}show(){this._conversationsManager?this._conversationsManager.show():ar.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.ep===!0&&!Qe(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":_p(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":this.rp===!1?"remote_config_failed":z(this.ep)?this.rp?"disabled_in_project":"remote_config_pending":this.ep?we(this.ne)||!this.ne.token?"missing_token":he?.__PosthogExtensions__?this.np?"initializing":this.sp?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var e,t;return(e=(t=this._conversationsManager)===null||t===void 0?void 0:t.isVisible())!==null&&e!==void 0&&e}sendMessage(e,t,r){var i=this;return We(function*(){return i._conversationsManager?i._conversationsManager.sendMessage(e,t,r):(ar.warn(Ji),null)})()}getMessages(e,t){var r=this;return We(function*(){return r._conversationsManager?r._conversationsManager.getMessages(e,t):(ar.warn(Ji),null)})()}markAsRead(e){var t=this;return We(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(ar.warn(Ji),null)})()}getTickets(e){var t=this;return We(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(ar.warn(Ji),null)})()}requestRestoreLink(e){var t=this;return We(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(ar.warn(Ji),null)})()}restoreFromToken(e){var t=this;return We(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(ar.warn(Ji),null)})()}restoreFromUrlToken(){var e=this;return We(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(ar.warn(Ji),null)})()}getCurrentTicketId(){var e,t;return(e=(t=this._conversationsManager)===null||t===void 0?void 0:t.getCurrentTicketId())!==null&&e!==void 0?e:null}getWidgetSessionId(){var e,t;return(e=(t=this._conversationsManager)===null||t===void 0?void 0:t.getWidgetSessionId())!==null&&e!==void 0?e:null}Sh(){var e;(e=this._conversationsManager)===null||e===void 0||e.setIdentity()}xh(){var e;(e=this._conversationsManager)===null||e===void 0||e.clearIdentity()}}},B2={logs:class{constructor(e){var t;this._instance=e,this.name="logs",this.lp=!1,this.up=!1,this.hp=!1,this.A=tt("[logs]"),this.cp=S(S({},this.A),{},{error:(...r)=>{r.some(x_)||this.A.error(...r)}}),this.ol=[],this.dp=[],this._d=0,this.To=!1,this.vp=[],this.fp=[],this.pp=!1,this.gp=!1,this.mp=()=>{var r,i;this.To||(this._d=0,(r=this.yp)===null||r===void 0||r.onReconnect(),(i=this.bp)===null||i===void 0||i.onReconnect())},this._instance&&(t=this._instance.config.logs)!==null&&t!==void 0&&t.captureConsoleLogs&&(this.lp=!0),M&&Ne(M,"online",this.mp)}_p(e,t,r,i){var n;const s=P_((n=this._instance)===null||n===void 0||(n=n.config)===null||n===void 0?void 0:n.logs,r);return[new Az(this.wp(e,t),s,this.cp,()=>this.kp(),o=>o(),void 0,i),s]}Sp(){var e;const t=(e=this._instance)===null||e===void 0||(e=e.config)===null||e===void 0?void 0:e.logs;var r;return this.yp&&this.xp===t||((r=this.yp)===null||r===void 0||r.reset(),this.xp=t,[this.yp,this.Cp]=this._p(()=>this.ol,i=>{this.ol=i})),this.yp}$p(){var e;const t=(e=this._instance)===null||e===void 0||(e=e.config)===null||e===void 0?void 0:e.logs;var r;return this.bp&&this.Tp===t||((r=this.bp)===null||r===void 0||r.reset(),this.Tp=t,[this.bp,this.Ip]=this._p(()=>this.dp,i=>{this.dp=i},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},O_)),this.bp}setup(e){var t;if(this.To)return;this.bo=e,(t=this._instance)!==null&&t!==void 0&&(t=t.config)!==null&&t!==void 0&&(t=t.logs)!==null&&t!==void 0&&t.captureConsoleLogs&&(this.lp=!0),(this.lp||this.Mp()&&this.Ep())&&this.Pp();let r=!1;const i=e.onRemoteConfig(n=>{var s;r=n.ok&&((s=n.config.logs)===null||s===void 0?void 0:s.captureConsoleLogs)===!0,this.onRemoteConfig(n)});this.To?i.dispose():(this.Eo=i,r||this.loadIfEnabled())}dispose(){var e,t,r,i;this.To||(this.To=!0,this.Rp(),(e=this.Eo)===null||e===void 0||e.dispose(),this.Eo=void 0,this.bo=void 0,this.hp=!1,M?.removeEventListener("online",this.mp),(t=this.Ap)===null||t===void 0||t.call(this),this.Ap=void 0,(r=this.yp)===null||r===void 0||r.reset(),(i=this.bp)===null||i===void 0||i.reset())}onRemoteConfig(e){var t,r;if(this.To)return;const i=e.ok?(t=e.config.logs)===null||t===void 0?void 0:t.captureConsoleLogs:void 0;we(i)?this.Fp():((r=this._instance)===null||r===void 0||(r=r.persistence)===null||r===void 0||r.register({$logs_capture_enabled_server_side:!!i}),i?(this.lp=!0,this.up||this.Pp(),this.loadIfEnabled()):this.Fp())}reset(){var e,t,r,i;this.Rp(),(e=this.yp)===null||e===void 0||e.clearQueue(),this.ol=[],(t=this.yp)===null||t===void 0||t.reset(),(r=this.bp)===null||r===void 0||r.clearQueue(),this.dp=[],(i=this.bp)===null||i===void 0||i.reset(),this._d=0}captureLog(e){this.To||this.Sp().captureLog(e)}captureConsoleLog(e){this.To||this.$p().captureLog(e)}captureBufferedConsoleLog(e,t,r){this.To||this.$p().captureLog(e,{context:t,occurredAtMs:r})}Ep(){var e;return!!(!((e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0||(e=e.props)===null||e===void 0)&&e[YE])}Mp(){var e,t,r;return!(!((e=this._instance)===null||e===void 0||(t=e.il)===null||t===void 0)&&t.call(e))||!!(!((r=he._POSTHOG_REMOTE_CONFIG)===null||r===void 0||(r=r[this._instance.config.token])===null||r===void 0)&&r.config)}$h(){var e;this.Rp(),(e=this.bp)===null||e===void 0||e.clearQueue(),this.dp=[]}Fp(){this.lp||this.Rp()}Pp(){var e;if(this.pp||!he?.console)return;const t=P_((e=this._instance)===null||e===void 0||(e=e.config)===null||e===void 0?void 0:e.logs).maxBufferSize;let r=!0;this.fp.push(()=>{r=!1});for(const i of T2){let n;try{n=C2(he.console[i])}catch{continue}n&&this.fp.push(Vo(he.console,i,s=>{const o=(...a)=>{try{r&&this.Op(i,a,t)}catch{}return s.apply(he.console,a)};return o.__rrweb_original__=n,o}))}this.pp=!0,this.Dp=setTimeout(()=>{this.Rp()},3e4)}Op(e,t,r){var i;if(this.pp&&!this.gp&&t.length!==0)if(!((i=this._instance)===null||i===void 0)&&i.is_capturing()){if(r>this.vp.length){this.gp=!0;try{this.vp.push({level:e,args:t,occurredAtMs:Date.now(),context:this.kp()})}finally{this.gp=!1}}}else this.Rp()}Rp(){if(this.vp=[],this.pp){this.pp=!1,this.Dp&&(clearTimeout(this.Dp),this.Dp=void 0);for(const e of this.fp)e();this.fp=[]}}Lp(){const e=this.vp;return this.Rp(),e}get logger(){return this.Np||(this.Np={trace:(e,t)=>this.captureLog({body:e,level:"trace",attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:"debug",attributes:t}),info:(e,t)=>this.captureLog({body:e,level:"info",attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:"warn",attributes:t}),error:(e,t)=>this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.Np}flushLogs(e){e?this.qp(e):(this.yp&&this.yp.flush().catch(t=>this.jp(t)),this.bp&&this.bp.flush().catch(t=>this.jp(t)))}jp(e){x_(e)||this.A.error("PostHog logs flush failed:",e)}loadIfEnabled(){if(this.To||!this.lp||this.up||this.hp)return;const e=he?.__PosthogExtensions__;if(!e)return this.A.error("PostHog Extensions not found."),void this.Rp();const t=e.loadExternalDependency;if(!t)return this.A.error(Lf),void this.Rp();this.hp=!0;try{t(this._instance,"logs",r=>{if(this.hp=!1,this.To||!this.lp)return;const i=e.logs;if(r||!i?.initializeLogs)this.A.error("Could not load logs script",r),this.Rp();else{var n;const a=this.Lp();var s,o;this.Ap=i.initializeLogs((n=this.bo)!==null&&n!==void 0?n:this._instance),this.up=!0,a.length>0&&((s=i.replayConsoleBuffer)===null||s===void 0||s.call(i,(o=this.bo)!==null&&o!==void 0?o:this._instance,a))}})}catch(r){throw this.hp=!1,r}}wp(e,t){const r=this._instance;return{get isDisabled(){return!1},get optedOut(){return!r.is_capturing()},getPersistedProperty:i=>i===Pr.LogsQueue?e():void 0,setPersistedProperty(i,n){var s;i===Pr.LogsQueue&&t((s=n)!==null&&s!==void 0?s:[])},js:i=>this.js(i),getLibraryId:()=>ut.LIB_NAME,getLibraryVersion:()=>ut.LIB_VERSION}}js(e){return new Promise(t=>{if(Pk(this._d,3))return void t({kind:"fatal",error:Qu(void 0,"logs endpoint is unreachable, dropping batch")});let r=!1;const i=s=>{r||(r=!0,clearTimeout(n),t(s))},n=setTimeout(()=>{this.A.warn("Logs request timed out before receiving a response"),i({kind:"retry-later",error:Qu(void 0,"logs request timed out")})},9e4);this._instance._send_request({method:"POST",url:this.Bp(),data:e,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:s=>{const o=s.statusCode;if(this.Hp(o),o>=200&&300>o)i({kind:"ok"});else if(o===413)i({kind:"too-large"});else if(o!==0&&o!==408&&o!==429&&500>o)i({kind:"fatal",error:new Error(`logs request failed with status ${o}`)});else{var a;o===0?(s.error||this.A.warn("Logs request failed before receiving an HTTP response"),i({kind:"retry-later",error:Qu(s.error,"logs request failed before receiving an HTTP response")})):i({kind:"retry-later",error:(a=s.error)!==null&&a!==void 0?a:new Error(`logs request failed with status ${o}`)})}}})})}Hp(e){(e!==0||this._instance.__loaded)&&(this._d=Ok(e,this._d,3,()=>this.A.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.")))}qp(e){this.ol.length>0&&this.zp(e,this.ol,this.Cp,ut.LIB_NAME,t=>{this.ol=t}),this.dp.length>0&&this.zp(e,this.dp,this.Ip,O_,t=>{this.dp=t})}zp(e,t,r,i,n){if(t.length===0)return;const s=t.map(a=>a.record);n([]);const o=HE(s,FE(r,ut.LIB_NAME,ut.LIB_VERSION),i,ut.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Bp(),data:o,compression:"best-available",batchKey:"logs",transport:e})}Bp(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}kp(){var e;const t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){const{sessionId:r,windowId:i,sessionStartTimestamp:n,lastActivityTimestamp:s}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);t.sessionId=r,t.windowId=i,we(n)||(t.sessionStartTimestamp=n),we(s)||(t.lastActivityTimestamp=s)}if(he!=null&&(e=he.location)!==null&&e!==void 0&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?qi(he.location.href):he.location.href),this._instance.featureFlags){const r=this._instance.featureFlags.getFlags();r&&r.length>0&&(t.activeFeatureFlags=r)}return t}}},V2={metrics:class{constructor(e){this._instance=e,this.A=tt("[metrics]"),this.To=!1}initialize(){this.onConfigChange()}onConfigChange(){var e;if(this.To)return;const t=!!(!((e=this._instance.config.metrics)===null||e===void 0)&&e.network);t&&!this.Up?this.Up=(r=>{let i=!0;const n=()=>i?(a=>{var c;const l=(c=a.config.metrics)===null||c===void 0?void 0:c.network;return l===!0?{}:l||void 0})(r):void 0,s=x2(r,n),o=M2(r,n);return()=>{i=!1,s(),o()}})(this._instance):!t&&this.Up&&(this.Up(),this.Up=void 0)}Sp(){var e;const t=(e=this._instance)===null||e===void 0||(e=e.config)===null||e===void 0?void 0:e.metrics;var r;return this.yp&&this.xp===t||((r=this.yp)===null||r===void 0||r.reset(),this.xp=t,this.yp=new Rz(this.wp(),(function(i){var n,s,o,a,c;const l=i?.resourceAttributes;return{serviceName:(n=l?.["service.name"])!==null&&n!==void 0?n:i?.serviceName,serviceVersion:(s=l?.["service.version"])!==null&&s!==void 0?s:i?.serviceVersion,environment:(o=l?.["deployment.environment"])!==null&&o!==void 0?o:i?.environment,resourceAttributes:l,beforeSend:i?.beforeSend,flushIntervalMs:(a=i?.flushIntervalMs)!==null&&a!==void 0?a:1e4,maxSeriesPerFlush:(c=i?.maxSeriesPerFlush)!==null&&c!==void 0?c:1e3}})(t),this.A)),this.yp}count(e,t=1,r){this.Sp().count(e,t,r)}gauge(e,t,r){this.Sp().gauge(e,t,r)}histogram(e,t,r){this.Sp().histogram(e,t,r)}flush(e){if(!this.yp)return Promise.resolve();if(e){const t=this.yp.drainWindow();return t&&this.Ys(t,e),Promise.resolve()}return this.yp.flush().catch(t=>this.A.error("PostHog metrics flush failed:",t))}reset(){var e;(e=this.yp)===null||e===void 0||e.reset()}dispose(){var e,t;this.To=!0,(e=this.Up)===null||e===void 0||e.call(this),this.Up=void 0,(t=this.yp)===null||t===void 0||t.reset()}wp(){const e=this._instance,t=this;return{get isDisabled(){return!1},get optedOut(){return!e.is_capturing()},Ys:r=>t.Ys(r),getLibraryId:()=>ut.LIB_NAME,getLibraryVersion:()=>ut.LIB_VERSION}}Ys(e,t){return new Promise(r=>{let i=!1;const n=o=>{i||(i=!0,clearTimeout(s),r(o))},s=setTimeout(()=>n({kind:"retry-later",error:new Error("metrics request timed out")}),9e4);this._instance._send_request(S(S({method:"POST",url:this.Wp(),data:e,compression:"best-available",batchKey:"metrics"},t&&{transport:t}),{},{fireCallbackOnDrop:!0,callback(o){const a=o.statusCode;if(a>=200&&300>a)n({kind:"ok"});else if(a===413)n({kind:"too-large"});else if(a!==0&&a!==408&&a!==429&&500>a)n({kind:"fatal",error:new Error(`metrics request failed with status ${a}`)});else{var c;n({kind:"retry-later",error:(c=o.error)!==null&&c!==void 0?c:new Error(`metrics request failed with status ${a}`)})}}}))})}Wp(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}};Co.__defaultExtensionClasses=S({},S(S(S(S(S(S(S(S(S(S(S(S(S({},ql),L2),$2),N2),D2),U2),j2),q2),z2),F2),H2),B2),V2));var G2=(function(){ut.SDK_DIST_CHANNEL="npm";const e=Ro[po]=new Co;return(function(){function t(){t.done||(t.done=!0,tI=!1,je(Ro,function(r){r._dom_loaded()}))}G?.addEventListener?G.readyState==="complete"?t():Ne(G,"DOMContentLoaded",t,{capture:!1}):M&&Y.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),e})(),W2=G2,f5=zI.flatMap(e=>{if(e.secretIn!=="path"||e.scope!=="page")return[];const t=`:${e.secretParam}`;if(!e.pattern.endsWith(t))return[];const r=e.pattern.slice(0,-t.length);return r.includes(":")?[]:[r]});function M_(e){return Dp(e).replace(/(\/organizations\/)[^/?#]+/g,"$1[redacted]")}var J2=Object.freeze({recording:"off",identity:"id_only",content:"strict"}),m5=Object.freeze({recording:"full",identity:"full",content:"full"});function g5(e){if(typeof e!="object"||e===null)return!1;const{recording:t,identity:r,content:i}=e;return(t==="full"||t==="masked"||t==="off")&&(r==="full"||r==="id_only")&&(i==="full"||i==="strict")}var K2="$mcpjam_telemetry_context";var Y2=64;function qc(e){return[...new Set(e.filter(t=>typeof t=="string"&&t.length>0&&t.length<=Y2))].sort().slice(0,8)}function X2(e){return{v:2,p:qc(e.projectIds),o:qc(e.organizationIds),r:e.policy.recording,i:e.policy.identity,c:e.policy.content}}function jc(e){return`${qc(e.projectIds).join(",")}|${qc(e.organizationIds).join(",")}`}var Z2=new Set(["class","style","role","type","dir","lang","rel","tabindex","width","height","colspan","rowspan","disabled","checked","selected","hidden","open","viewbox","xmlns","d","fill","stroke","stroke-width","stroke-linecap","stroke-linejoin","points","cx","cy","r","rx","ry","x","y","x1","x2","y1","y2","transform","opacity","aria-hidden","aria-expanded","aria-selected","aria-checked","aria-disabled","aria-pressed","aria-current","aria-orientation","data-state","data-side","data-align","data-orientation","data-disabled","data-highlighted","data-selected","data-active","data-open","data-slot","data-variant","data-size"]);function mI(e,t){const r=e.toLowerCase();return Z2.has(r)?r==="style"?pH(t):Q_(t):"***"}function jl(e){return e.replace(/\S/g,"*")}var Q2=new Set(["img","picture","video","audio","canvas","iframe","object","embed","image"]),En="[name]",gI="[redacted]",eH=new Set(["p","api","web","v1","mcp","about","api-keys","appearance","audit-log","bench","billing","budget","byok","callback","capabilities","cases","chat","ci-evals","client-config","clients","commit","compare","compatibility","computer","conformance","create","data-management","discord","edit","embed","environments","eval-server","evals","evaluate","evaluators","events","github","github-checks","home","host-compare","hosts","integrations","iterations","learning","login","members","models","new","oauth","oauth-flow","observability","organizations","plans","playground","plugins","profile","project-settings","prompts","readiness","redeem","registry","resources","results","runs","scenarios","score","secrets","servers","sessions","settings","shared","sharing","skills","slack","suite","support","swarms","tasks","test","tools","tracing","triggers","usage","user-testing","webmcp","xaa-flow"]),tH="[host]",L_="host.scrub.invalid",rH=["mcpjam.com","caniuse.dev"],iH=new Set(["localhost","127.0.0.1","[::1]","::1"]);function nH(e){const t=e.toLowerCase();if(iH.has(t)||rH.some(i=>t===i||t.endsWith(`.${i}`)))return!0;const r=globalThis.location?.hostname;return typeof r=="string"&&r.toLowerCase()===t}var sH=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function vI(e){return/^\d+$/.test(e)||sH.test(e)||/^[0-9a-z]{25,40}$/.test(e)&&/\d/.test(e)}function oH(e){return!e||e===En||e===gI||eH.has(e)||vI(e)?e:En}var aH="[key]",cH=new Set(["code","state","token","t","_token","access_token","id_token","refresh_token","key","api_key","apikey","secret","client_secret","password","sig","signature","auth","authorization","code_verifier","code_challenge","ticket","otp","nonce","jwt"]),lH=new Set(["tab","view","page","limit","cursor","before","after","sort","order","filter","status","plan","interval","surface","flow","mode","step","project","projectId","organizationId","org","session","sessionId","chatSessionId","tabId","sel","compose","host","v","ver","version","ip","compression","_","error","error_description","redirect_uri","resource","code_challenge_method","iss","browser","wire","codec","sharp","installation_id","accessVersion","distinct_id","q","search","privacy","server","run","case","suite","target","persona","iteration","checks","compare","compareTo","insights","replay","importJob","fromCommit","fromEvalServer","cwd","dir","_t"]);function uH(e,t){return cH.has(e.toLowerCase())?`${encodeURIComponent(e)}=${gI}`:lH.has(e)?`${encodeURIComponent(e)}=${vI(t)?encodeURIComponent(t):En}`:`${aH}=${En}`}function Go(e){const t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e);if(!t&&!e.startsWith("/"))return M_(e);const r=M_(e);try{const i=new URL(t?r.replace(/^([a-z][a-z0-9+.-]*:\/\/)\[host\]/i,`$1${L_}`):r,"http://scrub.invalid"),n=i.pathname.split("/").map(o=>oH(decodeURIComponent(o))).join("/"),s=[...i.searchParams].map(([o,a])=>uH(o,a)).join("&");return`${t?`${i.protocol}//${i.hostname!==L_&&nH(i.hostname)?i.host:tH}`:""}${n}${s?`?${s}`:""}`}catch{return En}}function $_(e){return typeof e!="string"||!/^[a-z][a-z0-9+.-]*:\/\//i.test(e)&&!e.startsWith("/")?En:Go(e)}var N_=/url\(\s*("(?:[^"\\\n]|\\[\s\S])*"|'(?:[^'\\\n]|\\[\s\S])*'|(?:[^"'()\s\\]|\\[\s\S])*)\s*\)|"(?:[^"\\\n]|\\[\s\S])*"|'(?:[^'\\\n]|\\[\s\S])*'/gi,dH=/[/:.]/;function D_(e){return(e.startsWith('"')||e.startsWith("'")?e.slice(1,-1):e).replace(/\\([\s\S])/g,"$1")}function pH(e){if(!/url\(|["'\\]/i.test(e))return e;const t=e.replace(N_,(i,n)=>{if(n!==void 0){const o=$_(D_(n));return`url(${JSON.stringify(o)})`}const s=D_(i);return JSON.stringify(dH.test(s)?$_(s):jl(s))}),r=t.replace(N_,"");return/url\(|["'\\]/i.test(r)?"***":t}function oa(){return hH()}function hH(){return typeof window<"u"&&window.isElectron===!0}function Bf(e=fH()){return e?dA(typeof e=="string"?{pathname:e}:e):!1}function fH(){if(typeof window>"u"||!window.location)return;const{pathname:e,search:t,hash:r}=window.location;return{pathname:e,search:t,hash:r}}function _I(){return!oa()||_f()?"off":"desktop"}function v5(e){return e.surface!=="hosted"||e.sharedLink?"off":e.recording===void 0?"pending":e.recording==="off"?"off":e.recording==="full"?"full":"masked"}var Op="mcpjam.telemetry.replayOffActor",Gn;function yI(){if(Gn!==void 0)return Gn;try{Gn=window.localStorage.getItem(Op)}catch{Gn=null}return Gn}function _5(e,t){if(e===null)return;const r=yI(),i=t?e:r===e?null:r;if(i!==r){Gn=i;try{i===null?window.localStorage.removeItem(Op):window.localStorage.setItem(Op,i)}catch{}}}function y5(e){const t=yI();return t===null?!1:e===void 0||e===t}var bI;function Vf(){return bI??(_I()==="off"?"off":"pending")}function b5(e){bI=e}function vr(){return ZI()!=="full"}var U_="https://redacted.invalid/",mH=["entryType","initiatorType","method","status","responseStatus","isInitial","startTime","endTime","duration","timeOrigin","timestamp","fetchStart","domainLookupStart","domainLookupEnd","connectStart","secureConnectionStart","connectEnd","requestStart","responseStart","responseEnd","redirectStart","redirectEnd","workerStart","transferSize","encodedBodySize","decodedBodySize","nextHopProtocol","renderBlockingStatus","deliveryType"];function SI(e){const t=r=>e==="masked"?Go(r):Dp(r);return function(i){const n=i.entryType===void 0&&!i.isInitial;try{const s={};for(const o of mH)i[o]!==void 0&&(s[o]=i[o]);return typeof i.name=="string"&&(s.name=t(i.name)),typeof i.url=="string"&&(s.url=t(i.url)),n&&!s.name&&(s.name=U_),s}catch{return n?{name:U_}:null}}}var gH=SI("full"),vH=SI("masked"),_H="data-ph-no-capture",wI=[...Q2].map(e=>e==="image"?"svg image":e).join(", "),yH={maskAllInputs:!0,maskInputOptions:{password:!0},maskTextSelector:"*",maskTextFn:jl,blockSelector:wI,maskAttributeFn:mI,recordHeaders:!1,recordBody:!1,maskCapturedNetworkRequestFn:gH,compress_events:!1},EI={maskAllInputs:!0,maskInputOptions:{password:!0},maskTextSelector:"*",maskTextFn:jl,blockSelector:wI,maskAttributeFn:mI,recordHeaders:!1,recordBody:!1,captureCanvas:{recordCanvas:!1},captureJsonLd:!1,recordCrossOriginIframes:!1,maskCapturedNetworkRequestFn:vH,compress_events:!1};function bH(e){return e==="masked"?{session_recording:EI,disable_session_recording:!0,autocapture:!1,capture_dead_clicks:!1,rageclick:!1,capture_exceptions:!1,disable_surveys:!0,enable_heatmaps:!1,capture_performance:!1,enable_recording_console_log:!1,mask_all_text:!0,mask_all_element_attributes:!0}:{session_recording:yH,disable_session_recording:!0,autocapture:!0,capture_dead_clicks:!0,rageclick:!0,capture_exceptions:oa(),disable_surveys:!1,enable_heatmaps:!0,enable_recording_console_log:!1,mask_all_text:!1,mask_all_element_attributes:!1}}var ed=null,Ki=!1,sc=null;function S5(){return sc}var ho=!1,xp=null;function SH(e){if(ho||Vf()!=="full"||!Array.isArray(e))return null;if(xp===null)return e;const t=xp,r=e.filter(i=>{const n=i?.timestamp;return typeof n=="number"&&n>=t});return r.length>0?r:null}function w5(e,t){if(sc!==e){ho=!0;try{sc?.stopSessionRecording?.()}finally{ho=!1}ed=null,Ki=!1}sc=e;try{const r=Vf(),i=vr()||r==="masked"?"masked":"full";if(i!==ed){if(Ki){ho=i==="masked";try{e.stopSessionRecording?.()}finally{ho=!1}Ki=!1}e.set_config?.(bH(i)),ed=i}const n=_I()==="hosted"&&r==="full"&&!vr()&&!Bf(t);n&&!Ki?(xp=Date.now(),e.startSessionRecording?.(),Ki=!0):!n&&Ki&&(e.stopSessionRecording?.(),Ki=!1)}catch{}}var wH=/\[[\w:.-]+(?:="[^"]*")?\]/g,EH=/#[^\s.#[>:]+/g;function kH(e){const t=e.replace(wH,"").replace(EH,""),r=t.search(/[["]/);return r===-1?t:t.slice(0,r)}var IH=new Set(["class","role","disabled","aria-disabled","data-sentry-component"]);function AH(e){const t={...e};typeof e.message=="string"&&(t.message=kH(e.message));const r=e.data;if(r&&typeof r=="object"){const i={...r};typeof r.url=="string"&&(i.url=Go(r.url)),typeof r.route=="string"&&(i.route=Go(r.route));const n=r.node;if(n&&typeof n=="object"){const s=n.attributes&&typeof n.attributes=="object"?Object.fromEntries(Object.entries(n.attributes).map(([o,a])=>[o,IH.has(o)?a:"***"])):n.attributes;i.node={...n,attributes:s,...typeof n.textContent=="string"?{textContent:jl(n.textContent)}:{}}}t.data=i}return t}function RH(e){const t=vr(),r=t?Go:Dp,i=e?.data,n=i?.payload;if(!i||!n)return e;if(t&&i.tag==="breadcrumb"&&n.category==="console")return null;if(t&&i.tag==="breadcrumb"&&typeof n.category=="string"&&n.category.startsWith("ui."))return{...e,data:{...i,payload:AH(n)}};if(i.tag==="breadcrumb"&&n.category==="navigation"){const s=n.data??{};return(typeof s.from!="string"||r(s.from)===s.from)&&(typeof s.to!="string"||r(s.to)===s.to)?e:{...e,data:{...i,payload:{...n,data:{...s,...typeof s.from=="string"?{from:r(s.from)}:{},...typeof s.to=="string"?{to:r(s.to)}:{}}}}}}if(i.tag==="performanceSpan"&&typeof n.description=="string")return r(n.description)===n.description?e:{...e,data:{...i,payload:{...n,description:r(n.description)}}};if(i.tag==="breadcrumb"&&typeof n.message=="string"){const s=Q_(n.message);return s===n.message?e:{...e,data:{...i,payload:{...n,message:s}}}}return e}var TH=["a[href]","area[href]","iframe","frame[src]","embed[src]","source","track","input[src]","[srcset]","object[data]","table[background]","td[background]","th[background]",'[style*="url(" i]','[style*="image-set(" i]'],E5={maskAllText:!0,maskAllInputs:!0,blockAllMedia:!0,maskAttributes:["title","placeholder","aria-label","aria-description","alt","action","formaction","poster","href","src","srcset","data","value"],block:[".rr-block",`[${_H}]`,...TH,`[style*='"']`,`[style*="'"]`,...QI()],networkDetailAllowUrls:[],networkCaptureBodies:!1,beforeAddRecordingEvent:RH},ji=null,Is,ti,Mp=new Set,oc=0,Lp=!1,zl=0,q_=!1,kI=!1,II=0;function AI(){const e=Fl();return q_&&!e&&(zl+=1),q_=e,e}function Ds(){if(oc>0){Lp=!0;return}kI=AI(),II=zl;for(const e of Mp)try{e()}catch{}}function k5(){return ji}function I5(e){e!==ji&&(ji=e,Is=void 0,ti=void 0,Ds())}function A5(e,t){if(e!==ji)return;const r=e===null?void 0:t;r!==Is&&(Is=r,Ds())}function R5(){Is!==void 0&&(Is=void 0,Ds())}function CH(e){return e!==null&&e===ji?Is:void 0}function PH(e=ji){return CH(e)==="full"&&Fl()}function T5(){return zl}function C5(e){return Mp.add(e),()=>Mp.delete(e)}var dr={projectIds:[],organizationIds:[]};function OH(e){const t=jc(dr),r=!!dr.sharedLink;dr={sharedLink:e.sharedLink,projectIds:e.projectIds.filter(i=>!!i),organizationIds:e.organizationIds.filter(i=>!!i)},(t!==jc(dr)||r!==!!dr.sharedLink)&&(ti=void 0,Ds())}function xH(e,t){const r=e&&e===ji&&t?{actor:e,context:jc(dr),content:t}:void 0;r?.actor===ti?.actor&&r?.context===ti?.context&&r?.content===ti?.content||(ti=r,Ds())}function P5(e,t,r){oc+=1;try{OH(e),xH(t,r)}finally{oc-=1,oc===0&&(Lp||Fl()!==kI||zl!==II)&&(Lp=!1,Ds())}}function Fl(){return ti?.actor===ji&&ti?.content==="full"&&ti.context===jc(dr)&&typeof window<"u"&&!window.isElectron&&!dr.sharedLink&&!Bf()&&dr.projectIds.length+dr.organizationIds.length>0}function MH(){const e=Fl(),t=Vf();return{projectIds:[...dr.projectIds],organizationIds:[...dr.organizationIds],policy:e?{recording:t==="full"||t==="masked"?t:"off",identity:PH()?"full":"id_only",content:"full"}:{...J2}}}function RI(e){if(!e)return e;try{const t=MH(),r={...e.properties??{},[K2]:X2(t)};if(e.event==="$snapshot"&&"$snapshot_data"in r){const i=SH(r.$snapshot_data);if(i===null)return null;r.$snapshot_data=i}return{...e,properties:r}}catch{return null}}XI(()=>AI()?"full":"strict");var LH=/\.[cm]?[jt]sx?$/,$H=/^(?:[a-z][a-z0-9+.-]*:\/\/|\/)/i;function NH(e,t){if(typeof e!="string"||!$H.test(e))return!1;let r;try{r=new URL(e,t)}catch{return!1}return r.origin!==t?!1:!LH.test(r.pathname)}function DH(e,t){return e.length===0?!1:e.every(r=>NH(r,t))}function UH(e,t){return e.length===0?!1:e.every(r=>DH(r,t))}var TI=`${ey}_tab`,qH=`ph_${TI}`;function jH(){let e="memory";try{const t=`${qH}_probe`;window.sessionStorage.setItem(t,"1");const r=window.sessionStorage.getItem(t)==="1";window.sessionStorage.removeItem(t),r&&(e="sessionStorage")}catch{}return{persistence:e,persistence_name:TI}}var CI=new Set(["caniuse.dev","www.caniuse.dev"]),zH=new Set(["score.mcpjam.com","www.score.mcpjam.com"]),FH=new Set([...CI,...zH]),O5="https://app.mcpjam.com";function HH(e){return CI.has(e.toLowerCase())}function x5(e=typeof window>"u"?void 0:window.location.hostname,t=typeof window>"u"?"":window.location.pathname){return t.replace(/\/+$/,"")==="/redeem"?!0:!!e&&HH(e)}function Gf(){return typeof window<"u"&&window.location?.origin?.startsWith("http")?`${window.location.origin}/tlm`:"/tlm"}function Wf(e){const t=ep()?.guestId,r=e&&Object.keys(e).length>0?e:void 0;return!t&&!r?{}:{bootstrap:{...t?{distinctID:t,isIdentifiedID:!1}:{},...r?{featureFlags:r}:{}}}}var PI={...jH(),advanced_disable_feature_flags:!0,advanced_disable_feature_flags_on_first_load:!0},OI=null;function $p(e=OI){if(e)for(const t of[e.persistence,e.sessionPersistence]){const r=t?.props;if(!(!t||!r)){try{const i=nA(r);if(i===r)continue;for(const n of Object.keys(r))n in i||delete r[n];Object.assign(r,i)}catch{delete r.$initial_person_info}try{t.save?.()}catch{}}}}function xI(e){if(e?.event!=="$exception"||typeof window>"u")return e;const t=e.properties?.$exception_list;if(!Array.isArray(t))return e;const r=t.map(i=>{const n=i?.stacktrace?.frames;return Array.isArray(n)?n.map(s=>s?.filename):[]});return UH(r,window.location.origin)?null:e}var BH=FH,VH=Gf()==="/tlm"||_f(),GH={advanced_disable_flags:!0,disable_surveys:!0,disable_external_dependency_loading:!0};function MI(e=typeof window>"u"?void 0:window.location?.hostname){const t=!!e&&BH.has(e.toLowerCase());return{capture_pageview:t?"history_change":!1,capture_pageleave:t}}var j_={api_host:Gf(),ui_host:"https://us.posthog.com",...Wf(),...MI(),...PI,person_profiles:"always",disable_beacon:!0,before_send:[xI,RI,e=>($p(),e)],disable_capture_url_hashes:!0,get capture_dead_clicks(){return!vr()},get autocapture(){return!vr()},get rageclick(){return!vr()},get disable_surveys(){return vr()},get enable_heatmaps(){return!vr()},get capture_exceptions(){return oa()&&!vr()},disable_session_recording:!0,session_recording:EI,enable_recording_console_log:!1,get mask_all_text(){return vr()},get mask_all_element_attributes(){return vr()},loaded:e=>{OI=e,$p(e),e.register({environment:"production",platform:zc(),version:"3.23.0",deployment:"self_hosted",source:"client"}),e.setPersonPropertiesForFlags?.({deployment:"self_hosted",platform:zc()})}};function WH(e){const t=Wf(e);return"bootstrap"in t?Object.defineProperties({},{...Object.getOwnPropertyDescriptors(j_),bootstrap:{value:t.bootstrap,enumerable:!0,configurable:!0,writable:!0}}):j_}var M5=()=>ey,L5=e=>VH?{api_host:Gf(),ui_host:"https://us.posthog.com",...Wf(e),...MI(),...PI,person_profiles:"always",disable_beacon:!0,disable_session_recording:!0,capture_exceptions:!1,..._f()?GH:{},opt_out_capturing_by_default:!0,before_send:[xI,RI,t=>($p(),t)],disable_capture_url_hashes:!0,loaded:t=>{t.setPersonPropertiesForFlags?.({deployment:"self_hosted",platform:zc()})}}:WH(e);function zc(){if(window?.isElectron){const e=navigator.userAgent.toLowerCase();return e.includes("mac")||e.includes("darwin")?"mac":e.includes("win")?"win":"electron"}return"npm"}function JH(){return"production"}function $5(e){const t=JH();return{location:e,platform:zc(),...t!==void 0?{environment:t}:{}}}var N5=5e3,ac=null;function D5(e=Date.now()){ac=e}function KH(e=Date.now()){if(ac===null)return!1;const t=e-ac;return t<0||t>1e4?(ac=null,!1):!0}var YH=yA((e,t)=>({status:"idle",kind:null,retryNonce:0,queriesPaused:!1,authConfirmed:!1,authEpoch:0,recoveryId:null,recoveryAt:0,pauseQueries:()=>e({queriesPaused:!0}),resumeQueries:()=>{t().authConfirmed&&e({queriesPaused:!1})},notifyFailure:r=>{if(KH()){e({status:"idle",kind:null});return}if(t().kind==="signed_out"){e({status:"failed"});return}e({status:"failed",kind:r})},retry:()=>e(r=>({status:"retrying",retryNonce:r.retryNonce+1})),clear:()=>e({status:"idle",kind:null})})),XH=/\(ref ([0-9a-f]{16})\)\s*$/,ZH=/^(?:\[CONVEX [A-Z]+\([^)]*\)\]\s*)?\[Request ID: ([0-9a-f]+)\]\s*([\s\S]*)$/,QH=/\[Request ID: ([0-9a-f]+)\]/,eB=/^\[[^\]]*\]\s*/,tB="Server Error",rB="Something went wrong",Fc=400;function LI(e){if(typeof e=="string")return e;try{if(e instanceof Error)return typeof e.message=="string"?e.message:null}catch{return null}return null}function z_(e){for(const t of e.split(`
62
+ `),l=Math.min(c.length,o+1e3),u=[];for(let h=o;l>h;h++){const f=c[h];if(f.length>1024)continue;const m=gv.test(f)?f.replace(gv,"$1"):f;if(!m.match(/\S*Error: /)){for(const v of n){const _=v(m,i);if(_){a.push(_);const b=tz(a);if(b){for(let A=u.length-1;A>=0;A--){const P=u[A];if(b.start>=P.start+P.length)break;u.pop()}u.push(b)}break}}if(iz(a,u)>=50)break}}const p=[...u].sort((h,f)=>f.start-h.start),d=p[p.length-1];if(d){const h=ME(a,d);a.splice(d.start-h,h);for(const f of p)f.start-=h}for(const h of p)rz(a,h);return u.some(h=>h.start===0&&a.length===h.length)&&(function(h){const f=h.map(v=>`${v.function}|${v.filename}|${v.lineno}|${v.colno}|${v.module}`);let m=0;for(let v=1;f.length>v;v++)nz(f,v,m)&&(m=v);h.push(...h.splice(0,m))})(a),(function(h){if(!h.length)return[];const f=Array.from(h);return f.reverse(),f.slice(0,50).map(m=>{return S(S({},m),{},{filename:m.filename||(v=f,v[v.length-1]||{}).filename,function:m.function||"?"});var v})})(a)}})("web:javascript",Xj,ez)),this._instance=e,this.cf=(t=(r=this._instance.persistence)===null||r===void 0?void 0:r.get_property("$error_tracking_suppression_rules"))!==null&&t!==void 0?t:[],this.vf=Ac(this.ff()),this.pf=new gz(this.vf)}onConfigChange(){this.vf=Ac(this.ff()),this.pf.setConfig(this.vf)}onRemoteConfig(e){var t,r,i;if(!e.ok)return;const n=e.config;if(!("errorTracking"in n))return;const s=(t=(r=n.errorTracking)===null||r===void 0?void 0:r.suppressionRules)!==null&&t!==void 0?t:[],o=(i=n.errorTracking)===null||i===void 0?void 0:i.captureExtensionExceptions;this.cf=s,this._instance.persistence&&this._instance.persistence.register({[KE]:this.cf,[hp]:o})}get gf(){var e;const t=!!this._instance.get_property(hp),r=this._instance.config.error_tracking.captureExtensionExceptions;return(e=r??t)!==null&&e!==void 0&&e}buildProperties(e,t){return this.df.buildFromUnknown(e,{syntheticException:t?.syntheticException,mechanism:{handled:t?.handled}})}addExceptionStep(e,t){if(this.vf.enabled)try{if(!Ae(e)||e.trim().length===0)return void fr.warn("Ignoring exception step because message must be a non-empty string");const{sanitizedProperties:r,droppedKeys:i}=(function(n){if(!n)return{sanitizedProperties:{},droppedKeys:[]};const s=[];return{sanitizedProperties:Object.keys(n).reduce((o,a)=>mz.has(a)?(s.push(a),o):(o[a]=n[a],o),{}),droppedKeys:s}})(this.mf(t));i.length>0&&fr.warn("Ignoring reserved exception step fields",{droppedKeys:i}),this.pf.add(S({[kc]:e,[Ic]:new Date().toISOString()},r))}catch(r){fr.error("Failed to add exception step. Ignoring breadcrumb.",r)}}sendExceptionEvent(e){try{const t=e.$exception_list;if(this.yf(t)){if(this.bf(t))return this._f("Exception dropped: matched a suppression rule"),void fr.info("Skipping exception capture because a suppression rule matched");if(!this.gf&&this.wf(t))return this._f("Exception dropped: thrown by a browser extension"),void fr.info("Skipping exception capture because it was thrown by an extension");if(!this.gf&&this.kf(t))return this._f("Exception dropped: thrown by an injected browser script"),void fr.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Sf(t))return this._f("Exception dropped: thrown by the PostHog SDK"),void fr.info("Skipping exception capture because it was thrown by the PostHog SDK")}const r=this.vf.enabled&&we(e.$exception_steps)?this.xf(e):e,i=(function(){const n=globalThis._posthogReleaseId;return typeof n=="string"&&n.length>0?n:void 0})();i&&(r.$release_id=i);try{const n=this._instance.capture("$exception",r,{_noTruncate:!0,_batchKey:"exceptionEvent",fh:!0});return n&&this.pf.clear(),n}catch(n){T_(n)||fr.error("Failed to capture exception event. Dropping this exception.",n),this.pf.clear();return}}catch(t){T_(t)||fr.error("Failed to process exception event. Ignoring this exception.",t);return}}xf(e){try{const t=this.pf.getAttachable();return t.length===0?e:S(S({},e),{},{$exception_steps:t})}catch(t){return fr.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}_f(e){this.vf.enabled&&this.pf.add({[kc]:e,[Ic]:new Date().toISOString()})}mf(e){return Pe(e)?S({},e):{}}ff(){var e,t;return(e=(t=this._instance.config.error_tracking)===null||t===void 0?void 0:t.exception_steps)!==null&&e!==void 0?e:{}}bf(e){if(e.length===0)return!1;try{const t=e.reduce((r,{type:i,value:n})=>(Ae(i)&&i.length>0&&r.$exception_types.push(i),Ae(n)&&n.length>0&&r.$exception_values.push(n),r),{$exception_types:[],$exception_values:[]});return this.cf.some(r=>{const i=r.values.map(n=>{const s=oI[n.operator],o=t[n.key];if(!s||!o)return!1;const a=_e(n.value)?n.value:[n.value];return a.length>0&&s(a,o)});return r.type==="OR"?i.some(Boolean):i.every(Boolean)})}catch(t){return fr.warn("Failed to evaluate suppression rules. Capturing the exception.",t),!1}}wf(e){const t=e.flatMap(i=>{var n,s;return(n=(s=i.stacktrace)===null||s===void 0?void 0:s.frames)!==null&&n!==void 0?n:[]}),r=t.filter(({filename:i})=>!!i&&I2.some(n=>i.startsWith(n)));return r.length!==0&&(!r.every(({filename:i})=>!!i&&i.startsWith(Cp))||e.some(({type:i,value:n})=>i==="NoResponse"||Ae(n)&&k2.some(({value:s,exact:o})=>o?n===s:n.includes(s)))&&!t.some(({in_app:i,filename:n})=>i&&!n?.startsWith(Cp)))}kf(e){return e.some(({value:t})=>Ae(t)&&A2.some(r=>t.includes(r)))}Sf(e){if(e.length>0){var t,r,i,n;const s=(t=(r=e[0].stacktrace)===null||r===void 0?void 0:r.frames)!==null&&t!==void 0?t:[],o=s[s.length-1];return(i=o==null||(n=o.filename)===null||n===void 0?void 0:n.includes("posthog.com/static"))!==null&&i!==void 0&&i}return!1}yf(e){return!we(e)&&_e(e)}}},D2=S({productTours:class{get Il(){return this._instance.persistence}constructor(e){this.Cf=null,this.$f=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!e.ok)return;const t=e.config;if("productTours"in t){var r,i;if(this.Il&&this.Il.register({[Pf]:!!t.productTours}),!Xu(this._instance))return!this.Cf&&we((r=this.Il)===null||r===void 0?void 0:r.props.ph_product_tours)||Da.info("product tours disabled; stopping and clearing cached tours"),(i=this.Cf)===null||i===void 0||i.stop(),this.Cf=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.Cf&&Xu(this._instance)&&this.Ho(()=>this.Tf())}Ho(e){var t,r,i;!((t=he.__PosthogExtensions__)===null||t===void 0)&&t.generateProductTours?e():(r=he.__PosthogExtensions__)===null||r===void 0||(i=r.loadExternalDependency)===null||i===void 0||i.call(r,this._instance,"product-tours",n=>{n?Da.error("Could not load product tours script",n):e()})}Tf(){var e;!this.Cf&&(e=he.__PosthogExtensions__)!==null&&e!==void 0&&e.generateProductTours&&(this.Cf=he.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t=!1){if(_e(this.$f)&&!t)return void e(this.$f,{isLoaded:!0});const r=this.Il;if(r){const i=r.props[gp];if(_e(i)&&!t)return this.$f=i,void e(i,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/product_tours/?token=${this._instance.config.token}`),method:"GET",timestampMode:"query",callback:i=>{if(!Xu(this._instance))return void e([],{isLoaded:!0});const n=i.statusCode;if(n!==200||!i.json){const o=`Product Tours API could not be loaded, status: ${n}`;n===0?i.error||Da.warn(o):Da.error(o),e([],{isLoaded:!1,error:o});return}const s=_e(i.json.product_tours)?i.json.product_tours:[];this.$f=s,r&&r.register({[gp]:s}),e(s,{isLoaded:!0})}})}getActiveProductTours(e){we(this.Cf)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.Cf.getActiveProductTours(e)}showProductTour(e){var t;(t=this.Cf)===null||t===void 0||t.showTourById(e)}previewTour(e){this.Cf?this.Cf.previewTour(e):this.Ho(()=>{var t;this.Tf(),(t=this.Cf)===null||t===void 0||t.previewTour(e)})}dismissProductTour(){var e;(e=this.Cf)===null||e===void 0||e.dismissTour("user_clicked_skip")}nextStep(){var e;(e=this.Cf)===null||e===void 0||e.nextStep()}previousStep(){var e;(e=this.Cf)===null||e===void 0||e.previousStep()}clearCache(){var e;this.$f=null,(e=this.Il)===null||e===void 0||e.unregister("ph_product_tours")}resetTour(e){var t;(t=this.Cf)===null||t===void 0||t.resetTour(e)}resetAllTours(){var e;(e=this.Cf)===null||e===void 0||e.resetAllTours()}cancelPendingTour(e){var t;(t=this.Cf)===null||t===void 0||t.cancelPendingTour(e)}}},ql),U2={siteApps:class{constructor(e){this._instance=e,this.If=0,this.Mf=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Ef(e,t){if(!t)return;const r=this.globalsForEvent(t);this.Mf.push(r),this.Mf.length>1e3&&(this.Mf=this.Mf.slice(10))}get siteAppLoaders(){var e;return(e=he._POSTHOG_REMOTE_CONFIG)===null||e===void 0||(e=e[this._instance.config.token])===null||e===void 0?void 0:e.siteApps}initialize(){if(this.isEnabled){const e=this._instance._addCaptureHook(this.Ef.bind(this));this.Pf=()=>{e(),this.Mf=[],this.Pf=void 0}}}globalsForEvent(e){var t,r,i,n,s,o,a;if(!e)throw new Error("Event payload is required");const c={},l=this._instance.get_property("$groups")||[],u=this._instance.get_property("$stored_group_properties")||{};for(const[h,f]of Object.entries(u))c[h]={id:l[h],type:h,properties:f};const{$set_once:p,$set:d}=e;return{event:S(S({},DE(e,f2)),{},{properties:S(S(S({},e.properties),d?{$set:S(S({},(t=(r=e.properties)===null||r===void 0?void 0:r.$set)!==null&&t!==void 0?t:{}),d)}:{}),p?{$set_once:S(S({},(i=(n=e.properties)===null||n===void 0?void 0:n.$set_once)!==null&&i!==void 0?i:{}),p)}:{}),elements_chain:(s=(o=e.properties)===null||o===void 0?void 0:o.$elements_chain)!==null&&s!==void 0?s:"",distinct_id:(a=e.properties)===null||a===void 0?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}Rf(e){var t;const r=(t=e.tagName)===null||t===void 0?void 0:t.toLowerCase();return r==="style"&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(e)||(Ar.error("prepare_external_dependency_stylesheet returned null"),null):r==="script"&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(e)||(Ar.error("prepare_external_dependency_script returned null"),null):e}Af(){var e,t,r,i,n,s,o,a;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};const c=G?.defaultView,l=c==null||(e=c.Node)===null||e===void 0?void 0:e.prototype;if(!c||!l)return()=>{};if(this.If++,this.Ff)return this.Of();const u=[],p=this,d=new WeakSet,h=(v,_,b)=>{if(!v?.[_])return;const A=v[_];v[_]=b(A),u.push(()=>{v[_]=A})},f=v=>{if(d.has(v))return v;const _=p.Rf(v);return _&&d.add(_),_},m=v=>v.map(_=>typeof _=="string"?_:f(_)).filter(_=>!Qe(_));return h(l,"appendChild",v=>function(_){const b=f(_);return b?v.call(this,b):_}),h(l,"insertBefore",v=>function(_,b){const A=f(_);return A?v.call(this,A,b):_}),h(l,"replaceChild",v=>function(_,b){const A=f(_);return A?v.call(this,A,b):b}),[(t=c.Element)===null||t===void 0?void 0:t.prototype,(r=c.Document)===null||r===void 0?void 0:r.prototype,(i=c.DocumentFragment)===null||i===void 0?void 0:i.prototype].forEach(v=>{h(v,"append",_=>function(...b){return _.apply(this,m(b))}),h(v,"prepend",_=>function(...b){return _.apply(this,m(b))})}),[(n=c.Element)===null||n===void 0?void 0:n.prototype,(s=c.CharacterData)===null||s===void 0?void 0:s.prototype,(o=c.DocumentType)===null||o===void 0?void 0:o.prototype].forEach(v=>{h(v,"before",_=>function(...b){return _.apply(this,m(b))}),h(v,"after",_=>function(...b){return _.apply(this,m(b))}),h(v,"replaceWith",_=>function(...b){const A=m(b);return b.length&&!A.length?void 0:_.apply(this,A)})}),h((a=c.Element)===null||a===void 0?void 0:a.prototype,"insertAdjacentElement",v=>function(_,b){const A=f(b);return A?v.call(this,_,A):null}),this.Ff=()=>{u.forEach(v=>v()),this.Ff=void 0},this.Of()}Of(){let e=!1;return()=>{var t;e||(e=!0,this.If--,this.If===0&&((t=this.Ff)===null||t===void 0||t.call(this)))}}Df(e,t=!0){const r=this.Af();try{const i=e(r);return t&&r(),i}catch(i){throw r(),i}}setupSiteApp(e){const t=this.apps[e.id],r=()=>{var s;!t.errored&&this.Mf.length&&(Ar.info(`Processing ${this.Mf.length} events for site app with id ${e.id}`),this.Mf.forEach(o=>this.Df(()=>{var a;return(a=t.processEvent)===null||a===void 0?void 0:a.call(t,o)})),t.processedBuffer=!0),Object.values(this.apps).every(o=>o.processedBuffer||o.errored)&&((s=this.Pf)===null||s===void 0||s.call(this))};let i=!1;const n=s=>{t.errored=!s,t.loaded=!0,Ar.info(`Site app with id ${e.id} ${s?"loaded":"errored"}`),i&&r()};try{const{processEvent:s}=this.Df(o=>e.init({posthog:this._instance,callback(a){o(),n(a)}}),!1);s&&(t.processEvent=s),i=!0}catch(s){Ar.error(__+e.id,s),n(!1)}if(i&&t.loaded)try{r()}catch(s){Ar.error(`Error while processing buffered events PostHog app with config id ${e.id}`,s),t.errored=!0}}Lf(){const e=this.siteAppLoaders||[];for(const t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(const t of e)this.setupSiteApp(t)}Nf(e){if(Object.keys(this.apps).length===0)return;const t=this.globalsForEvent(e);for(const r of Object.values(this.apps))try{this.Df(()=>{var i;return(i=r.processEvent)===null||i===void 0?void 0:i.call(r,t)})}catch(i){Ar.error(`Error while processing event ${e.event} for site app ${r.id}`,i)}}onRemoteConfig(e){var t,r,i;if(!((t=this.siteAppLoaders)===null||t===void 0)&&t.length)return this.isEnabled?(this.Lf(),void this._instance.on("eventCaptured",a=>this.Nf(a))):void Ar.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((r=this.Pf)===null||r===void 0||r.call(this),!e.ok)return;const n=e.config;if(!((i=n.siteApps)===null||i===void 0)&&i.length)if(this.isEnabled)for(const{id:a,url:c}of n.siteApps){var s,o;he[`__$$ph_site_app_${a}`]=this._instance,(s=he.__PosthogExtensions__)===null||s===void 0||(o=s.loadSiteApp)===null||o===void 0||o.call(s,this._instance,c,l=>{if(l)return Ar.error(__+a,l)})}else Ar.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},q2={tracingHeaders:class{constructor(e){this._instance=e,this.qf=void 0,this.jf=void 0,this.Bf=void 0,this.ef=()=>{const t=this.Hf();var r,i;t?(z(this.qf)&&(this.qf=(r=he.__PosthogExtensions__)===null||r===void 0||(r=r.tracingHeadersPatchFns)===null||r===void 0?void 0:r._patchXHR(t,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),z(this.jf)&&(this.jf=(i=he.__PosthogExtensions__)===null||i===void 0||(i=i.tracingHeadersPatchFns)===null||i===void 0?void 0:i._patchFetch(t,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.lf()}}initialize(){this.startIfEnabledOrStop()}Ho(e){var t,r,i;!((t=he.__PosthogExtensions__)===null||t===void 0)&&t.tracingHeadersPatchFns?e():(r=he.__PosthogExtensions__)===null||r===void 0||(i=r.loadExternalDependency)===null||i===void 0||i.call(r,this._instance,"tracing-headers",n=>{if(n)return l2.error("failed to load script",n);e()})}zf(){var e,t;return(e=(t=this._instance.config.tracing_headers)!==null&&t!==void 0?t:this._instance.config.addTracingHeaders)!==null&&e!==void 0?e:this._instance.config.__add_tracing_headers}Hf(){const e=this.zf();return _e(e)?(_e(this.Bf)?this.Bf.splice(0,this.Bf.length,...e):this.Bf=[...e],e.length>0?this.Bf:void 0):(_e(this.Bf)&&this.Bf.splice(0),this.Bf=e||void 0,this.Bf)}lf(){var e,t;(e=this.qf)===null||e===void 0||e.call(this),(t=this.jf)===null||t===void 0||t.call(this),this.qf=void 0,this.jf=void 0}startIfEnabledOrStop(){this.Hf()?this.Ho(this.ef):this.lf()}}},j2=S({surveys:class extends m2{constructor(e){var t;super(new b2(e),(t=e,{get projectToken(){return t.config.token},kv:new y2(t)})),this._instance=e}Vh(e,t){const r=t.query?sa(e,t.query):e;return new Promise(i=>{var n;this._instance._send_request({method:t.method,url:this._instance.requestRouter.endpointFor((n=t.target)!==null&&n!==void 0?n:"api",r),data:t.body,headers:t.headers,timeout:t.timeoutMs,fireCallbackOnDrop:!0,transport:t.transport,compression:t.compression,timestampMode:t.sentAt,callback:i})})}}},ql),z2={toolbar:class{constructor(e){this.instance=e}Uf(e){he.ph_toolbar_state=e}Wf(){var e;return(e=he.ph_toolbar_state)!==null&&e!==void 0?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e=void 0,t=void 0,r=void 0){var i,n;if(_p(this.instance.config)||!M||!G)return!1;e=(i=e)!==null&&i!==void 0?i:M.location,r=(n=r)!==null&&n!==void 0?n:M.history;try{if(!t){try{M.localStorage.setItem("test","test"),M.localStorage.removeItem("test")}catch{return!1}t=M?.localStorage}const s=S2||Mc(e.hash,"__posthog")||Mc(e.hash,"state");let o;const a=s?pv(()=>JSON.parse(atob(decodeURIComponent(s))))||pv(()=>JSON.parse(decodeURIComponent(s))):null;return a&&a.action==="ph_authorize"?(o=a,o.source="url",o&&Object.keys(o).length>0&&(a.desiredHash?e.hash=a.desiredHash:r?r.replaceState(r.state,"",e.pathname+e.search):e.hash="")):(o=JSON.parse(t.getItem(b_)||"{}"),o.source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token||(this.loadToolbar(o),0))}catch{return!1}}Vf(e){const t=he.ph_load_toolbar||he.ph_load_editor;!we(t)&&gt(t)?t(e,this.instance):S_.warn("No toolbar load function found")}loadToolbar(e){const t=!!G?.getElementById("__POSTHOG_TOOLBAR__");if(!M||t)return!1;const r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,i=S(S({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(M.localStorage.setItem(b_,JSON.stringify(S(S({},i),{},{source:void 0}))),this.Wf()===2)this.Vf(i);else if(this.Wf()===0){var n,s;this.Uf(1),(n=he.__PosthogExtensions__)===null||n===void 0||(s=n.loadExternalDependency)===null||s===void 0||s.call(n,this.instance,"toolbar",o=>{if(o)return S_.error("[Toolbar] Failed to load",o),void this.Uf(0);this.Uf(2),this.Vf(i)}),Ne(M,"turbolinks:load",()=>{this.Uf(0),this.loadToolbar(i)})}return!0}Gf(e){return this.loadToolbar(e)}maybeLoadEditor(e=void 0,t=void 0,r=void 0){return this.maybeLoadToolbar(e,t,r)}}},F2=S({experiments:class Ut{get Ir(){return this._instance.config}constructor(t){this._instance=t,this.getWebExperimentsAndEvaluateDisplayLogic=(r=!1)=>{this.getWebExperiments(i=>{Ut.Zf("retrieved web experiments from the server"),this.Qf=new Map,i.forEach(n=>{if(n.feature_flag_key){var s;this.Qf&&(Ut.Zf("setting flag key ",n.feature_flag_key," to web experiment ",n),(s=this.Qf)===null||s===void 0||s.set(n.feature_flag_key,n));const o=this._instance.getFeatureFlag(n.feature_flag_key);Ae(o)&&n.variants[o]&&this.Jf(n.name,o,n.variants[o].transforms)}else if(n.variants)for(const o in n.variants){const a=n.variants[o];Ut.Kf(a,this._instance)&&this.Jf(n.name,o,a.transforms)}})},r)},this._instance.onFeatureFlags(r=>{this.onFeatureFlags(r)})}initialize(){}onFeatureFlags(t){if(this._is_bot())Ut.Zf(C_);else if(!this.Ir.disable_web_experiments){if(we(this.Qf))return this.Qf=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Ut.Zf("applying feature flags",t),t.forEach(r=>{var i;if(this.Qf&&(!((i=this.Qf)===null||i===void 0)&&i.has(r))){var n;const s=this._instance.getFeatureFlag(r),o=(n=this.Qf)===null||n===void 0?void 0:n.get(r);s&&o!=null&&o.variants[s]&&this.Jf(o.name,s,o.variants[s].transforms)}})}}previewWebExperiment(){const t=Ut.getWindowLocation();if(t?.search){const r=ws(t?.search,"__experiment_id"),i=ws(t?.search,"__experiment_variant");r&&i&&(Ut.Zf(`previewing web experiments ${r} && ${i}`),this.getWebExperiments(n=>{this.Xf(parseInt(r),i,n)},!1,!0))}}loadIfEnabled(){this.Ir.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,r,i){if(this.Ir.disable_web_experiments&&!i)return t([]);const n=this._instance.get_property("$web_experiments");if(n&&!r)return t(n);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/web_experiments/?token=${this.Ir.token}`),method:"GET",timestampMode:"query",callback:s=>t(s.statusCode===200&&s.json&&s.json.experiments||[])})}Xf(t,r,i){const n=i.filter(s=>s.id===t);n&&n.length>0&&(Ut.Zf(`Previewing web experiment [${n[0].name}] with variant [${r}]`),this.Jf(n[0].name,r,n[0].variants[r].transforms))}static Kf(t,r){return!we(t.conditions)&&Ut.Yf(t,r)&&Ut.tp(t)}static Yf(t,r){var i;if(we(t.conditions)||we((i=t.conditions)===null||i===void 0?void 0:i.url))return!0;const n=Ut.getWindowLocation();if(n){var s,o,a;const c=bk(r,n.href);return!(!((s=t.conditions)===null||s===void 0)&&s.url)||R2[(o=(a=t.conditions)===null||a===void 0?void 0:a.urlMatchType)!==null&&o!==void 0?o:"icontains"](t.conditions.url,c)}return!1}static getWindowLocation(){return M?.location}static tp(t){var r;if(we(t.conditions)||we((r=t.conditions)===null||r===void 0?void 0:r.utm))return!0;const i=xk();if(i.utm_source){var n,s,o,a,c,l,u,p;const d=!(!((n=t.conditions)===null||n===void 0||(n=n.utm)===null||n===void 0)&&n.utm_campaign)||((s=t.conditions)===null||s===void 0||(s=s.utm)===null||s===void 0?void 0:s.utm_campaign)==i.utm_campaign,h=!(!((o=t.conditions)===null||o===void 0||(o=o.utm)===null||o===void 0)&&o.utm_source)||((a=t.conditions)===null||a===void 0||(a=a.utm)===null||a===void 0?void 0:a.utm_source)==i.utm_source,f=!(!((c=t.conditions)===null||c===void 0||(c=c.utm)===null||c===void 0)&&c.utm_medium)||((l=t.conditions)===null||l===void 0||(l=l.utm)===null||l===void 0?void 0:l.utm_medium)==i.utm_medium,m=!(!((u=t.conditions)===null||u===void 0||(u=u.utm)===null||u===void 0)&&u.utm_term)||((p=t.conditions)===null||p===void 0||(p=p.utm)===null||p===void 0?void 0:p.utm_term)==i.utm_term;return d&&f&&m&&h}return!1}static Zf(t,...r){Y.info(`[WebExperiments] ${t}`,r)}Jf(t,r,i){this._is_bot()?Ut.Zf(C_):r!=="control"?i.forEach(n=>{if(n.selector){var s;Ut.Zf(`applying transform of variant ${r} for experiment ${t} `,n),((s=document)===null||s===void 0?void 0:s.querySelectorAll(n.selector))?.forEach(o=>{const a=o;n.html&&(a.innerHTML=n.html),n.css&&a.setAttribute("style",n.css)})}}):Ut.Zf("Control variants leave the page unmodified.")}_is_bot(){return vt&&this._instance?iI(vt,this.Ir.custom_blocked_useragents):void 0}}},ql),H2={conversations:class{constructor(e){this._instance=e,this.ep=void 0,this._conversationsManager=null,this.np=!1,this.ne=null,this.sp=!1}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(this._instance.config.disable_conversations||(this.rp=e.ok,!e.ok))return;const t=e.config.conversations;we(t)||(Ft(t)?this.ep=t:(this.ep=t.enabled,this.ne=t),this.loadIfEnabled())}reset(){var e;(e=this._conversationsManager)===null||e===void 0||e.reset(),this._conversationsManager=null,this.ep=void 0,this.ne=null,this.rp=void 0,this.sp=!1}loadIfEnabled(){if(this._conversationsManager||this.np||this._instance.config.disable_conversations||_p(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())return;const e=he?.__PosthogExtensions__;if(e&&!z(this.ep)&&this.ep)if(this.ne&&this.ne.token){this.np=!0;try{const t=e.initConversations;if(t)return this.op(t),void(this.np=!1);const r=e.loadExternalDependency;if(!r)return void this.ap(Lf);r(this._instance,"conversations",i=>{i||!e.initConversations?this.ap("Could not load conversations script",i):this.op(e.initConversations),this.np=!1})}catch(t){this.ap("Error initializing conversations",t),this.np=!1}}else ar.error("Conversations enabled but missing token in remote config.")}op(e){if(this.ne)try{this._conversationsManager=e(this.ne,this._instance),this.sp=!1,ar.info("Conversations loaded successfully")}catch(t){this.ap("Error completing conversations initialization",t)}else ar.error("Cannot complete initialization: remote config is null")}ap(e,t){ar.error(e,t),this._conversationsManager=null,this.np=!1,this.sp=!0}show(){this._conversationsManager?this._conversationsManager.show():ar.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.ep===!0&&!Qe(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":_p(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":this.rp===!1?"remote_config_failed":z(this.ep)?this.rp?"disabled_in_project":"remote_config_pending":this.ep?we(this.ne)||!this.ne.token?"missing_token":he?.__PosthogExtensions__?this.np?"initializing":this.sp?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var e,t;return(e=(t=this._conversationsManager)===null||t===void 0?void 0:t.isVisible())!==null&&e!==void 0&&e}sendMessage(e,t,r){var i=this;return We(function*(){return i._conversationsManager?i._conversationsManager.sendMessage(e,t,r):(ar.warn(Ji),null)})()}getMessages(e,t){var r=this;return We(function*(){return r._conversationsManager?r._conversationsManager.getMessages(e,t):(ar.warn(Ji),null)})()}markAsRead(e){var t=this;return We(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(ar.warn(Ji),null)})()}getTickets(e){var t=this;return We(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(ar.warn(Ji),null)})()}requestRestoreLink(e){var t=this;return We(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(ar.warn(Ji),null)})()}restoreFromToken(e){var t=this;return We(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(ar.warn(Ji),null)})()}restoreFromUrlToken(){var e=this;return We(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(ar.warn(Ji),null)})()}getCurrentTicketId(){var e,t;return(e=(t=this._conversationsManager)===null||t===void 0?void 0:t.getCurrentTicketId())!==null&&e!==void 0?e:null}getWidgetSessionId(){var e,t;return(e=(t=this._conversationsManager)===null||t===void 0?void 0:t.getWidgetSessionId())!==null&&e!==void 0?e:null}Sh(){var e;(e=this._conversationsManager)===null||e===void 0||e.setIdentity()}xh(){var e;(e=this._conversationsManager)===null||e===void 0||e.clearIdentity()}}},B2={logs:class{constructor(e){var t;this._instance=e,this.name="logs",this.lp=!1,this.up=!1,this.hp=!1,this.A=tt("[logs]"),this.cp=S(S({},this.A),{},{error:(...r)=>{r.some(x_)||this.A.error(...r)}}),this.ol=[],this.dp=[],this._d=0,this.To=!1,this.vp=[],this.fp=[],this.pp=!1,this.gp=!1,this.mp=()=>{var r,i;this.To||(this._d=0,(r=this.yp)===null||r===void 0||r.onReconnect(),(i=this.bp)===null||i===void 0||i.onReconnect())},this._instance&&(t=this._instance.config.logs)!==null&&t!==void 0&&t.captureConsoleLogs&&(this.lp=!0),M&&Ne(M,"online",this.mp)}_p(e,t,r,i){var n;const s=P_((n=this._instance)===null||n===void 0||(n=n.config)===null||n===void 0?void 0:n.logs,r);return[new Az(this.wp(e,t),s,this.cp,()=>this.kp(),o=>o(),void 0,i),s]}Sp(){var e;const t=(e=this._instance)===null||e===void 0||(e=e.config)===null||e===void 0?void 0:e.logs;var r;return this.yp&&this.xp===t||((r=this.yp)===null||r===void 0||r.reset(),this.xp=t,[this.yp,this.Cp]=this._p(()=>this.ol,i=>{this.ol=i})),this.yp}$p(){var e;const t=(e=this._instance)===null||e===void 0||(e=e.config)===null||e===void 0?void 0:e.logs;var r;return this.bp&&this.Tp===t||((r=this.bp)===null||r===void 0||r.reset(),this.Tp=t,[this.bp,this.Ip]=this._p(()=>this.dp,i=>{this.dp=i},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},O_)),this.bp}setup(e){var t;if(this.To)return;this.bo=e,(t=this._instance)!==null&&t!==void 0&&(t=t.config)!==null&&t!==void 0&&(t=t.logs)!==null&&t!==void 0&&t.captureConsoleLogs&&(this.lp=!0),(this.lp||this.Mp()&&this.Ep())&&this.Pp();let r=!1;const i=e.onRemoteConfig(n=>{var s;r=n.ok&&((s=n.config.logs)===null||s===void 0?void 0:s.captureConsoleLogs)===!0,this.onRemoteConfig(n)});this.To?i.dispose():(this.Eo=i,r||this.loadIfEnabled())}dispose(){var e,t,r,i;this.To||(this.To=!0,this.Rp(),(e=this.Eo)===null||e===void 0||e.dispose(),this.Eo=void 0,this.bo=void 0,this.hp=!1,M?.removeEventListener("online",this.mp),(t=this.Ap)===null||t===void 0||t.call(this),this.Ap=void 0,(r=this.yp)===null||r===void 0||r.reset(),(i=this.bp)===null||i===void 0||i.reset())}onRemoteConfig(e){var t,r;if(this.To)return;const i=e.ok?(t=e.config.logs)===null||t===void 0?void 0:t.captureConsoleLogs:void 0;we(i)?this.Fp():((r=this._instance)===null||r===void 0||(r=r.persistence)===null||r===void 0||r.register({$logs_capture_enabled_server_side:!!i}),i?(this.lp=!0,this.up||this.Pp(),this.loadIfEnabled()):this.Fp())}reset(){var e,t,r,i;this.Rp(),(e=this.yp)===null||e===void 0||e.clearQueue(),this.ol=[],(t=this.yp)===null||t===void 0||t.reset(),(r=this.bp)===null||r===void 0||r.clearQueue(),this.dp=[],(i=this.bp)===null||i===void 0||i.reset(),this._d=0}captureLog(e){this.To||this.Sp().captureLog(e)}captureConsoleLog(e){this.To||this.$p().captureLog(e)}captureBufferedConsoleLog(e,t,r){this.To||this.$p().captureLog(e,{context:t,occurredAtMs:r})}Ep(){var e;return!!(!((e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0||(e=e.props)===null||e===void 0)&&e[YE])}Mp(){var e,t,r;return!(!((e=this._instance)===null||e===void 0||(t=e.il)===null||t===void 0)&&t.call(e))||!!(!((r=he._POSTHOG_REMOTE_CONFIG)===null||r===void 0||(r=r[this._instance.config.token])===null||r===void 0)&&r.config)}$h(){var e;this.Rp(),(e=this.bp)===null||e===void 0||e.clearQueue(),this.dp=[]}Fp(){this.lp||this.Rp()}Pp(){var e;if(this.pp||!he?.console)return;const t=P_((e=this._instance)===null||e===void 0||(e=e.config)===null||e===void 0?void 0:e.logs).maxBufferSize;let r=!0;this.fp.push(()=>{r=!1});for(const i of T2){let n;try{n=C2(he.console[i])}catch{continue}n&&this.fp.push(Vo(he.console,i,s=>{const o=(...a)=>{try{r&&this.Op(i,a,t)}catch{}return s.apply(he.console,a)};return o.__rrweb_original__=n,o}))}this.pp=!0,this.Dp=setTimeout(()=>{this.Rp()},3e4)}Op(e,t,r){var i;if(this.pp&&!this.gp&&t.length!==0)if(!((i=this._instance)===null||i===void 0)&&i.is_capturing()){if(r>this.vp.length){this.gp=!0;try{this.vp.push({level:e,args:t,occurredAtMs:Date.now(),context:this.kp()})}finally{this.gp=!1}}}else this.Rp()}Rp(){if(this.vp=[],this.pp){this.pp=!1,this.Dp&&(clearTimeout(this.Dp),this.Dp=void 0);for(const e of this.fp)e();this.fp=[]}}Lp(){const e=this.vp;return this.Rp(),e}get logger(){return this.Np||(this.Np={trace:(e,t)=>this.captureLog({body:e,level:"trace",attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:"debug",attributes:t}),info:(e,t)=>this.captureLog({body:e,level:"info",attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:"warn",attributes:t}),error:(e,t)=>this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.Np}flushLogs(e){e?this.qp(e):(this.yp&&this.yp.flush().catch(t=>this.jp(t)),this.bp&&this.bp.flush().catch(t=>this.jp(t)))}jp(e){x_(e)||this.A.error("PostHog logs flush failed:",e)}loadIfEnabled(){if(this.To||!this.lp||this.up||this.hp)return;const e=he?.__PosthogExtensions__;if(!e)return this.A.error("PostHog Extensions not found."),void this.Rp();const t=e.loadExternalDependency;if(!t)return this.A.error(Lf),void this.Rp();this.hp=!0;try{t(this._instance,"logs",r=>{if(this.hp=!1,this.To||!this.lp)return;const i=e.logs;if(r||!i?.initializeLogs)this.A.error("Could not load logs script",r),this.Rp();else{var n;const a=this.Lp();var s,o;this.Ap=i.initializeLogs((n=this.bo)!==null&&n!==void 0?n:this._instance),this.up=!0,a.length>0&&((s=i.replayConsoleBuffer)===null||s===void 0||s.call(i,(o=this.bo)!==null&&o!==void 0?o:this._instance,a))}})}catch(r){throw this.hp=!1,r}}wp(e,t){const r=this._instance;return{get isDisabled(){return!1},get optedOut(){return!r.is_capturing()},getPersistedProperty:i=>i===Pr.LogsQueue?e():void 0,setPersistedProperty(i,n){var s;i===Pr.LogsQueue&&t((s=n)!==null&&s!==void 0?s:[])},js:i=>this.js(i),getLibraryId:()=>ut.LIB_NAME,getLibraryVersion:()=>ut.LIB_VERSION}}js(e){return new Promise(t=>{if(Pk(this._d,3))return void t({kind:"fatal",error:Qu(void 0,"logs endpoint is unreachable, dropping batch")});let r=!1;const i=s=>{r||(r=!0,clearTimeout(n),t(s))},n=setTimeout(()=>{this.A.warn("Logs request timed out before receiving a response"),i({kind:"retry-later",error:Qu(void 0,"logs request timed out")})},9e4);this._instance._send_request({method:"POST",url:this.Bp(),data:e,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:s=>{const o=s.statusCode;if(this.Hp(o),o>=200&&300>o)i({kind:"ok"});else if(o===413)i({kind:"too-large"});else if(o!==0&&o!==408&&o!==429&&500>o)i({kind:"fatal",error:new Error(`logs request failed with status ${o}`)});else{var a;o===0?(s.error||this.A.warn("Logs request failed before receiving an HTTP response"),i({kind:"retry-later",error:Qu(s.error,"logs request failed before receiving an HTTP response")})):i({kind:"retry-later",error:(a=s.error)!==null&&a!==void 0?a:new Error(`logs request failed with status ${o}`)})}}})})}Hp(e){(e!==0||this._instance.__loaded)&&(this._d=Ok(e,this._d,3,()=>this.A.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.")))}qp(e){this.ol.length>0&&this.zp(e,this.ol,this.Cp,ut.LIB_NAME,t=>{this.ol=t}),this.dp.length>0&&this.zp(e,this.dp,this.Ip,O_,t=>{this.dp=t})}zp(e,t,r,i,n){if(t.length===0)return;const s=t.map(a=>a.record);n([]);const o=HE(s,FE(r,ut.LIB_NAME,ut.LIB_VERSION),i,ut.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Bp(),data:o,compression:"best-available",batchKey:"logs",transport:e})}Bp(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}kp(){var e;const t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){const{sessionId:r,windowId:i,sessionStartTimestamp:n,lastActivityTimestamp:s}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);t.sessionId=r,t.windowId=i,we(n)||(t.sessionStartTimestamp=n),we(s)||(t.lastActivityTimestamp=s)}if(he!=null&&(e=he.location)!==null&&e!==void 0&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?qi(he.location.href):he.location.href),this._instance.featureFlags){const r=this._instance.featureFlags.getFlags();r&&r.length>0&&(t.activeFeatureFlags=r)}return t}}},V2={metrics:class{constructor(e){this._instance=e,this.A=tt("[metrics]"),this.To=!1}initialize(){this.onConfigChange()}onConfigChange(){var e;if(this.To)return;const t=!!(!((e=this._instance.config.metrics)===null||e===void 0)&&e.network);t&&!this.Up?this.Up=(r=>{let i=!0;const n=()=>i?(a=>{var c;const l=(c=a.config.metrics)===null||c===void 0?void 0:c.network;return l===!0?{}:l||void 0})(r):void 0,s=x2(r,n),o=M2(r,n);return()=>{i=!1,s(),o()}})(this._instance):!t&&this.Up&&(this.Up(),this.Up=void 0)}Sp(){var e;const t=(e=this._instance)===null||e===void 0||(e=e.config)===null||e===void 0?void 0:e.metrics;var r;return this.yp&&this.xp===t||((r=this.yp)===null||r===void 0||r.reset(),this.xp=t,this.yp=new Rz(this.wp(),(function(i){var n,s,o,a,c;const l=i?.resourceAttributes;return{serviceName:(n=l?.["service.name"])!==null&&n!==void 0?n:i?.serviceName,serviceVersion:(s=l?.["service.version"])!==null&&s!==void 0?s:i?.serviceVersion,environment:(o=l?.["deployment.environment"])!==null&&o!==void 0?o:i?.environment,resourceAttributes:l,beforeSend:i?.beforeSend,flushIntervalMs:(a=i?.flushIntervalMs)!==null&&a!==void 0?a:1e4,maxSeriesPerFlush:(c=i?.maxSeriesPerFlush)!==null&&c!==void 0?c:1e3}})(t),this.A)),this.yp}count(e,t=1,r){this.Sp().count(e,t,r)}gauge(e,t,r){this.Sp().gauge(e,t,r)}histogram(e,t,r){this.Sp().histogram(e,t,r)}flush(e){if(!this.yp)return Promise.resolve();if(e){const t=this.yp.drainWindow();return t&&this.Ys(t,e),Promise.resolve()}return this.yp.flush().catch(t=>this.A.error("PostHog metrics flush failed:",t))}reset(){var e;(e=this.yp)===null||e===void 0||e.reset()}dispose(){var e,t;this.To=!0,(e=this.Up)===null||e===void 0||e.call(this),this.Up=void 0,(t=this.yp)===null||t===void 0||t.reset()}wp(){const e=this._instance,t=this;return{get isDisabled(){return!1},get optedOut(){return!e.is_capturing()},Ys:r=>t.Ys(r),getLibraryId:()=>ut.LIB_NAME,getLibraryVersion:()=>ut.LIB_VERSION}}Ys(e,t){return new Promise(r=>{let i=!1;const n=o=>{i||(i=!0,clearTimeout(s),r(o))},s=setTimeout(()=>n({kind:"retry-later",error:new Error("metrics request timed out")}),9e4);this._instance._send_request(S(S({method:"POST",url:this.Wp(),data:e,compression:"best-available",batchKey:"metrics"},t&&{transport:t}),{},{fireCallbackOnDrop:!0,callback(o){const a=o.statusCode;if(a>=200&&300>a)n({kind:"ok"});else if(a===413)n({kind:"too-large"});else if(a!==0&&a!==408&&a!==429&&500>a)n({kind:"fatal",error:new Error(`metrics request failed with status ${a}`)});else{var c;n({kind:"retry-later",error:(c=o.error)!==null&&c!==void 0?c:new Error(`metrics request failed with status ${a}`)})}}}))})}Wp(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}};Co.__defaultExtensionClasses=S({},S(S(S(S(S(S(S(S(S(S(S(S(S({},ql),L2),$2),N2),D2),U2),j2),q2),z2),F2),H2),B2),V2));var G2=(function(){ut.SDK_DIST_CHANNEL="npm";const e=Ro[po]=new Co;return(function(){function t(){t.done||(t.done=!0,tI=!1,je(Ro,function(r){r._dom_loaded()}))}G?.addEventListener?G.readyState==="complete"?t():Ne(G,"DOMContentLoaded",t,{capture:!1}):M&&Y.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),e})(),W2=G2,f5=zI.flatMap(e=>{if(e.secretIn!=="path"||e.scope!=="page")return[];const t=`:${e.secretParam}`;if(!e.pattern.endsWith(t))return[];const r=e.pattern.slice(0,-t.length);return r.includes(":")?[]:[r]});function M_(e){return Dp(e).replace(/(\/organizations\/)[^/?#]+/g,"$1[redacted]")}var J2=Object.freeze({recording:"off",identity:"id_only",content:"strict"}),m5=Object.freeze({recording:"full",identity:"full",content:"full"});function g5(e){if(typeof e!="object"||e===null)return!1;const{recording:t,identity:r,content:i}=e;return(t==="full"||t==="masked"||t==="off")&&(r==="full"||r==="id_only")&&(i==="full"||i==="strict")}var K2="$mcpjam_telemetry_context";var Y2=64;function qc(e){return[...new Set(e.filter(t=>typeof t=="string"&&t.length>0&&t.length<=Y2))].sort().slice(0,8)}function X2(e){return{v:2,p:qc(e.projectIds),o:qc(e.organizationIds),r:e.policy.recording,i:e.policy.identity,c:e.policy.content}}function jc(e){return`${qc(e.projectIds).join(",")}|${qc(e.organizationIds).join(",")}`}var Z2=new Set(["class","style","role","type","dir","lang","rel","tabindex","width","height","colspan","rowspan","disabled","checked","selected","hidden","open","viewbox","xmlns","d","fill","stroke","stroke-width","stroke-linecap","stroke-linejoin","points","cx","cy","r","rx","ry","x","y","x1","x2","y1","y2","transform","opacity","aria-hidden","aria-expanded","aria-selected","aria-checked","aria-disabled","aria-pressed","aria-current","aria-orientation","data-state","data-side","data-align","data-orientation","data-disabled","data-highlighted","data-selected","data-active","data-open","data-slot","data-variant","data-size"]);function mI(e,t){const r=e.toLowerCase();return Z2.has(r)?r==="style"?pH(t):Q_(t):"***"}function jl(e){return e.replace(/\S/g,"*")}var Q2=new Set(["img","picture","video","audio","canvas","iframe","object","embed","image"]),En="[name]",gI="[redacted]",eH=new Set(["p","api","web","v1","mcp","about","api-keys","appearance","audit-log","bench","billing","budget","byok","callback","capabilities","cases","chat","ci-evals","client-config","clients","commit","compare","compatibility","computer","conformance","create","data-management","discord","edit","embed","environments","eval-server","evals","evaluate","evaluators","events","github","github-checks","home","host-compare","hosts","integrations","iterations","learning","login","members","models","new","oauth","oauth-flow","observability","organizations","plans","playground","plugins","profile","project-settings","prompts","readiness","redeem","registry","resources","results","runs","scenarios","score","secrets","servers","sessions","settings","shared","sharing","skills","slack","suite","support","swarms","tasks","test","tools","tracing","triggers","usage","user-testing","webmcp","xaa-flow"]),tH="[host]",L_="host.scrub.invalid",rH=["mcpjam.com","caniuse.dev"],iH=new Set(["localhost","127.0.0.1","[::1]","::1"]);function nH(e){const t=e.toLowerCase();if(iH.has(t)||rH.some(i=>t===i||t.endsWith(`.${i}`)))return!0;const r=globalThis.location?.hostname;return typeof r=="string"&&r.toLowerCase()===t}var sH=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function vI(e){return/^\d+$/.test(e)||sH.test(e)||/^[0-9a-z]{25,40}$/.test(e)&&/\d/.test(e)}function oH(e){return!e||e===En||e===gI||eH.has(e)||vI(e)?e:En}var aH="[key]",cH=new Set(["code","state","token","t","_token","access_token","id_token","refresh_token","key","api_key","apikey","secret","client_secret","password","sig","signature","auth","authorization","code_verifier","code_challenge","ticket","otp","nonce","jwt"]),lH=new Set(["tab","view","page","limit","cursor","before","after","sort","order","filter","status","plan","interval","surface","flow","mode","step","project","projectId","organizationId","org","session","sessionId","chatSessionId","tabId","sel","compose","host","v","ver","version","ip","compression","_","error","error_description","redirect_uri","resource","code_challenge_method","iss","browser","wire","codec","sharp","installation_id","accessVersion","distinct_id","q","search","privacy","server","run","case","suite","target","persona","iteration","checks","compare","compareTo","insights","replay","importJob","fromCommit","fromEvalServer","cwd","dir","_t"]);function uH(e,t){return cH.has(e.toLowerCase())?`${encodeURIComponent(e)}=${gI}`:lH.has(e)?`${encodeURIComponent(e)}=${vI(t)?encodeURIComponent(t):En}`:`${aH}=${En}`}function Go(e){const t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e);if(!t&&!e.startsWith("/"))return M_(e);const r=M_(e);try{const i=new URL(t?r.replace(/^([a-z][a-z0-9+.-]*:\/\/)\[host\]/i,`$1${L_}`):r,"http://scrub.invalid"),n=i.pathname.split("/").map(o=>oH(decodeURIComponent(o))).join("/"),s=[...i.searchParams].map(([o,a])=>uH(o,a)).join("&");return`${t?`${i.protocol}//${i.hostname!==L_&&nH(i.hostname)?i.host:tH}`:""}${n}${s?`?${s}`:""}`}catch{return En}}function $_(e){return typeof e!="string"||!/^[a-z][a-z0-9+.-]*:\/\//i.test(e)&&!e.startsWith("/")?En:Go(e)}var N_=/url\(\s*("(?:[^"\\\n]|\\[\s\S])*"|'(?:[^'\\\n]|\\[\s\S])*'|(?:[^"'()\s\\]|\\[\s\S])*)\s*\)|"(?:[^"\\\n]|\\[\s\S])*"|'(?:[^'\\\n]|\\[\s\S])*'/gi,dH=/[/:.]/;function D_(e){return(e.startsWith('"')||e.startsWith("'")?e.slice(1,-1):e).replace(/\\([\s\S])/g,"$1")}function pH(e){if(!/url\(|["'\\]/i.test(e))return e;const t=e.replace(N_,(i,n)=>{if(n!==void 0){const o=$_(D_(n));return`url(${JSON.stringify(o)})`}const s=D_(i);return JSON.stringify(dH.test(s)?$_(s):jl(s))}),r=t.replace(N_,"");return/url\(|["'\\]/i.test(r)?"***":t}function oa(){return hH()}function hH(){return typeof window<"u"&&window.isElectron===!0}function Bf(e=fH()){return e?dA(typeof e=="string"?{pathname:e}:e):!1}function fH(){if(typeof window>"u"||!window.location)return;const{pathname:e,search:t,hash:r}=window.location;return{pathname:e,search:t,hash:r}}function _I(){return!oa()||_f()?"off":"desktop"}function v5(e){return e.surface!=="hosted"||e.sharedLink?"off":e.recording===void 0?"pending":e.recording==="off"?"off":e.recording==="full"?"full":"masked"}var Op="mcpjam.telemetry.replayOffActor",Gn;function yI(){if(Gn!==void 0)return Gn;try{Gn=window.localStorage.getItem(Op)}catch{Gn=null}return Gn}function _5(e,t){if(e===null)return;const r=yI(),i=t?e:r===e?null:r;if(i!==r){Gn=i;try{i===null?window.localStorage.removeItem(Op):window.localStorage.setItem(Op,i)}catch{}}}function y5(e){const t=yI();return t===null?!1:e===void 0||e===t}var bI;function Vf(){return bI??(_I()==="off"?"off":"pending")}function b5(e){bI=e}function vr(){return ZI()!=="full"}var U_="https://redacted.invalid/",mH=["entryType","initiatorType","method","status","responseStatus","isInitial","startTime","endTime","duration","timeOrigin","timestamp","fetchStart","domainLookupStart","domainLookupEnd","connectStart","secureConnectionStart","connectEnd","requestStart","responseStart","responseEnd","redirectStart","redirectEnd","workerStart","transferSize","encodedBodySize","decodedBodySize","nextHopProtocol","renderBlockingStatus","deliveryType"];function SI(e){const t=r=>e==="masked"?Go(r):Dp(r);return function(i){const n=i.entryType===void 0&&!i.isInitial;try{const s={};for(const o of mH)i[o]!==void 0&&(s[o]=i[o]);return typeof i.name=="string"&&(s.name=t(i.name)),typeof i.url=="string"&&(s.url=t(i.url)),n&&!s.name&&(s.name=U_),s}catch{return n?{name:U_}:null}}}var gH=SI("full"),vH=SI("masked"),_H="data-ph-no-capture",wI=[...Q2].map(e=>e==="image"?"svg image":e).join(", "),yH={maskAllInputs:!0,maskInputOptions:{password:!0},maskTextSelector:"*",maskTextFn:jl,blockSelector:wI,maskAttributeFn:mI,recordHeaders:!1,recordBody:!1,maskCapturedNetworkRequestFn:gH,compress_events:!1},EI={maskAllInputs:!0,maskInputOptions:{password:!0},maskTextSelector:"*",maskTextFn:jl,blockSelector:wI,maskAttributeFn:mI,recordHeaders:!1,recordBody:!1,captureCanvas:{recordCanvas:!1},captureJsonLd:!1,recordCrossOriginIframes:!1,maskCapturedNetworkRequestFn:vH,compress_events:!1};function bH(e){return e==="masked"?{session_recording:EI,disable_session_recording:!0,autocapture:!1,capture_dead_clicks:!1,rageclick:!1,capture_exceptions:!1,disable_surveys:!0,enable_heatmaps:!1,capture_performance:!1,enable_recording_console_log:!1,mask_all_text:!0,mask_all_element_attributes:!0}:{session_recording:yH,disable_session_recording:!0,autocapture:!0,capture_dead_clicks:!0,rageclick:!0,capture_exceptions:oa(),disable_surveys:!1,enable_heatmaps:!0,enable_recording_console_log:!1,mask_all_text:!1,mask_all_element_attributes:!1}}var ed=null,Ki=!1,sc=null;function S5(){return sc}var ho=!1,xp=null;function SH(e){if(ho||Vf()!=="full"||!Array.isArray(e))return null;if(xp===null)return e;const t=xp,r=e.filter(i=>{const n=i?.timestamp;return typeof n=="number"&&n>=t});return r.length>0?r:null}function w5(e,t){if(sc!==e){ho=!0;try{sc?.stopSessionRecording?.()}finally{ho=!1}ed=null,Ki=!1}sc=e;try{const r=Vf(),i=vr()||r==="masked"?"masked":"full";if(i!==ed){if(Ki){ho=i==="masked";try{e.stopSessionRecording?.()}finally{ho=!1}Ki=!1}e.set_config?.(bH(i)),ed=i}const n=_I()==="hosted"&&r==="full"&&!vr()&&!Bf(t);n&&!Ki?(xp=Date.now(),e.startSessionRecording?.(),Ki=!0):!n&&Ki&&(e.stopSessionRecording?.(),Ki=!1)}catch{}}var wH=/\[[\w:.-]+(?:="[^"]*")?\]/g,EH=/#[^\s.#[>:]+/g;function kH(e){const t=e.replace(wH,"").replace(EH,""),r=t.search(/[["]/);return r===-1?t:t.slice(0,r)}var IH=new Set(["class","role","disabled","aria-disabled","data-sentry-component"]);function AH(e){const t={...e};typeof e.message=="string"&&(t.message=kH(e.message));const r=e.data;if(r&&typeof r=="object"){const i={...r};typeof r.url=="string"&&(i.url=Go(r.url)),typeof r.route=="string"&&(i.route=Go(r.route));const n=r.node;if(n&&typeof n=="object"){const s=n.attributes&&typeof n.attributes=="object"?Object.fromEntries(Object.entries(n.attributes).map(([o,a])=>[o,IH.has(o)?a:"***"])):n.attributes;i.node={...n,attributes:s,...typeof n.textContent=="string"?{textContent:jl(n.textContent)}:{}}}t.data=i}return t}function RH(e){const t=vr(),r=t?Go:Dp,i=e?.data,n=i?.payload;if(!i||!n)return e;if(t&&i.tag==="breadcrumb"&&n.category==="console")return null;if(t&&i.tag==="breadcrumb"&&typeof n.category=="string"&&n.category.startsWith("ui."))return{...e,data:{...i,payload:AH(n)}};if(i.tag==="breadcrumb"&&n.category==="navigation"){const s=n.data??{};return(typeof s.from!="string"||r(s.from)===s.from)&&(typeof s.to!="string"||r(s.to)===s.to)?e:{...e,data:{...i,payload:{...n,data:{...s,...typeof s.from=="string"?{from:r(s.from)}:{},...typeof s.to=="string"?{to:r(s.to)}:{}}}}}}if(i.tag==="performanceSpan"&&typeof n.description=="string")return r(n.description)===n.description?e:{...e,data:{...i,payload:{...n,description:r(n.description)}}};if(i.tag==="breadcrumb"&&typeof n.message=="string"){const s=Q_(n.message);return s===n.message?e:{...e,data:{...i,payload:{...n,message:s}}}}return e}var TH=["a[href]","area[href]","iframe","frame[src]","embed[src]","source","track","input[src]","[srcset]","object[data]","table[background]","td[background]","th[background]",'[style*="url(" i]','[style*="image-set(" i]'],E5={maskAllText:!0,maskAllInputs:!0,blockAllMedia:!0,maskAttributes:["title","placeholder","aria-label","aria-description","alt","action","formaction","poster","href","src","srcset","data","value"],block:[".rr-block",`[${_H}]`,...TH,`[style*='"']`,`[style*="'"]`,...QI()],networkDetailAllowUrls:[],networkCaptureBodies:!1,beforeAddRecordingEvent:RH},ji=null,Is,ti,Mp=new Set,oc=0,Lp=!1,zl=0,q_=!1,kI=!1,II=0;function AI(){const e=Fl();return q_&&!e&&(zl+=1),q_=e,e}function Ds(){if(oc>0){Lp=!0;return}kI=AI(),II=zl;for(const e of Mp)try{e()}catch{}}function k5(){return ji}function I5(e){e!==ji&&(ji=e,Is=void 0,ti=void 0,Ds())}function A5(e,t){if(e!==ji)return;const r=e===null?void 0:t;r!==Is&&(Is=r,Ds())}function R5(){Is!==void 0&&(Is=void 0,Ds())}function CH(e){return e!==null&&e===ji?Is:void 0}function PH(e=ji){return CH(e)==="full"&&Fl()}function T5(){return zl}function C5(e){return Mp.add(e),()=>Mp.delete(e)}var dr={projectIds:[],organizationIds:[]};function OH(e){const t=jc(dr),r=!!dr.sharedLink;dr={sharedLink:e.sharedLink,projectIds:e.projectIds.filter(i=>!!i),organizationIds:e.organizationIds.filter(i=>!!i)},(t!==jc(dr)||r!==!!dr.sharedLink)&&(ti=void 0,Ds())}function xH(e,t){const r=e&&e===ji&&t?{actor:e,context:jc(dr),content:t}:void 0;r?.actor===ti?.actor&&r?.context===ti?.context&&r?.content===ti?.content||(ti=r,Ds())}function P5(e,t,r){oc+=1;try{OH(e),xH(t,r)}finally{oc-=1,oc===0&&(Lp||Fl()!==kI||zl!==II)&&(Lp=!1,Ds())}}function Fl(){return ti?.actor===ji&&ti?.content==="full"&&ti.context===jc(dr)&&typeof window<"u"&&!window.isElectron&&!dr.sharedLink&&!Bf()&&dr.projectIds.length+dr.organizationIds.length>0}function MH(){const e=Fl(),t=Vf();return{projectIds:[...dr.projectIds],organizationIds:[...dr.organizationIds],policy:e?{recording:t==="full"||t==="masked"?t:"off",identity:PH()?"full":"id_only",content:"full"}:{...J2}}}function RI(e){if(!e)return e;try{const t=MH(),r={...e.properties??{},[K2]:X2(t)};if(e.event==="$snapshot"&&"$snapshot_data"in r){const i=SH(r.$snapshot_data);if(i===null)return null;r.$snapshot_data=i}return{...e,properties:r}}catch{return null}}XI(()=>AI()?"full":"strict");var LH=/\.[cm]?[jt]sx?$/,$H=/^(?:[a-z][a-z0-9+.-]*:\/\/|\/)/i;function NH(e,t){if(typeof e!="string"||!$H.test(e))return!1;let r;try{r=new URL(e,t)}catch{return!1}return r.origin!==t?!1:!LH.test(r.pathname)}function DH(e,t){return e.length===0?!1:e.every(r=>NH(r,t))}function UH(e,t){return e.length===0?!1:e.every(r=>DH(r,t))}var TI=`${ey}_tab`,qH=`ph_${TI}`;function jH(){let e="memory";try{const t=`${qH}_probe`;window.sessionStorage.setItem(t,"1");const r=window.sessionStorage.getItem(t)==="1";window.sessionStorage.removeItem(t),r&&(e="sessionStorage")}catch{}return{persistence:e,persistence_name:TI}}var CI=new Set(["caniuse.dev","www.caniuse.dev"]),zH=new Set(["score.mcpjam.com","www.score.mcpjam.com"]),FH=new Set([...CI,...zH]),O5="https://app.mcpjam.com";function HH(e){return CI.has(e.toLowerCase())}function x5(e=typeof window>"u"?void 0:window.location.hostname,t=typeof window>"u"?"":window.location.pathname){return t.replace(/\/+$/,"")==="/redeem"?!0:!!e&&HH(e)}function Gf(){return typeof window<"u"&&window.location?.origin?.startsWith("http")?`${window.location.origin}/tlm`:"/tlm"}function Wf(e){const t=ep()?.guestId,r=e&&Object.keys(e).length>0?e:void 0;return!t&&!r?{}:{bootstrap:{...t?{distinctID:t,isIdentifiedID:!1}:{},...r?{featureFlags:r}:{}}}}var PI={...jH(),advanced_disable_feature_flags:!0,advanced_disable_feature_flags_on_first_load:!0},OI=null;function $p(e=OI){if(e)for(const t of[e.persistence,e.sessionPersistence]){const r=t?.props;if(!(!t||!r)){try{const i=nA(r);if(i===r)continue;for(const n of Object.keys(r))n in i||delete r[n];Object.assign(r,i)}catch{delete r.$initial_person_info}try{t.save?.()}catch{}}}}function xI(e){if(e?.event!=="$exception"||typeof window>"u")return e;const t=e.properties?.$exception_list;if(!Array.isArray(t))return e;const r=t.map(i=>{const n=i?.stacktrace?.frames;return Array.isArray(n)?n.map(s=>s?.filename):[]});return UH(r,window.location.origin)?null:e}var BH=FH,VH=Gf()==="/tlm"||_f(),GH={advanced_disable_flags:!0,disable_surveys:!0,disable_external_dependency_loading:!0};function MI(e=typeof window>"u"?void 0:window.location?.hostname){const t=!!e&&BH.has(e.toLowerCase());return{capture_pageview:t?"history_change":!1,capture_pageleave:t}}var j_={api_host:Gf(),ui_host:"https://us.posthog.com",...Wf(),...MI(),...PI,person_profiles:"always",disable_beacon:!0,before_send:[xI,RI,e=>($p(),e)],disable_capture_url_hashes:!0,get capture_dead_clicks(){return!vr()},get autocapture(){return!vr()},get rageclick(){return!vr()},get disable_surveys(){return vr()},get enable_heatmaps(){return!vr()},get capture_exceptions(){return oa()&&!vr()},disable_session_recording:!0,session_recording:EI,enable_recording_console_log:!1,get mask_all_text(){return vr()},get mask_all_element_attributes(){return vr()},loaded:e=>{OI=e,$p(e),e.register({environment:"production",platform:zc(),version:"3.23.1",deployment:"self_hosted",source:"client"}),e.setPersonPropertiesForFlags?.({deployment:"self_hosted",platform:zc()})}};function WH(e){const t=Wf(e);return"bootstrap"in t?Object.defineProperties({},{...Object.getOwnPropertyDescriptors(j_),bootstrap:{value:t.bootstrap,enumerable:!0,configurable:!0,writable:!0}}):j_}var M5=()=>ey,L5=e=>VH?{api_host:Gf(),ui_host:"https://us.posthog.com",...Wf(e),...MI(),...PI,person_profiles:"always",disable_beacon:!0,disable_session_recording:!0,capture_exceptions:!1,..._f()?GH:{},opt_out_capturing_by_default:!0,before_send:[xI,RI,t=>($p(),t)],disable_capture_url_hashes:!0,loaded:t=>{t.setPersonPropertiesForFlags?.({deployment:"self_hosted",platform:zc()})}}:WH(e);function zc(){if(window?.isElectron){const e=navigator.userAgent.toLowerCase();return e.includes("mac")||e.includes("darwin")?"mac":e.includes("win")?"win":"electron"}return"npm"}function JH(){return"production"}function $5(e){const t=JH();return{location:e,platform:zc(),...t!==void 0?{environment:t}:{}}}var N5=5e3,ac=null;function D5(e=Date.now()){ac=e}function KH(e=Date.now()){if(ac===null)return!1;const t=e-ac;return t<0||t>1e4?(ac=null,!1):!0}var YH=yA((e,t)=>({status:"idle",kind:null,retryNonce:0,queriesPaused:!1,authConfirmed:!1,authEpoch:0,recoveryId:null,recoveryAt:0,pauseQueries:()=>e({queriesPaused:!0}),resumeQueries:()=>{t().authConfirmed&&e({queriesPaused:!1})},notifyFailure:r=>{if(KH()){e({status:"idle",kind:null});return}if(t().kind==="signed_out"){e({status:"failed"});return}e({status:"failed",kind:r})},retry:()=>e(r=>({status:"retrying",retryNonce:r.retryNonce+1})),clear:()=>e({status:"idle",kind:null})})),XH=/\(ref ([0-9a-f]{16})\)\s*$/,ZH=/^(?:\[CONVEX [A-Z]+\([^)]*\)\]\s*)?\[Request ID: ([0-9a-f]+)\]\s*([\s\S]*)$/,QH=/\[Request ID: ([0-9a-f]+)\]/,eB=/^\[[^\]]*\]\s*/,tB="Server Error",rB="Something went wrong",Fc=400;function LI(e){if(typeof e=="string")return e;try{if(e instanceof Error)return typeof e.message=="string"?e.message:null}catch{return null}return null}function z_(e){for(const t of e.split(`
63
63
  `)){const r=t.trim();if(r!==""){if(/^at\s/.test(r)||r==="Called by client")break;return r}}return""}function iB(e){try{if(!e||typeof e!="object"||!("data"in e))return null;const t=e.data;if(typeof t=="string"&&t.trim())return t.slice(0,Fc);if(t&&typeof t=="object"&&"message"in t){const r=t.message;if(typeof r=="string"&&r.trim())return r.slice(0,Fc)}}catch{return null}return null}function $I(e){const t=LI(e);return t?QH.exec(t)?.[1]??null:null}function nB(e){return`(ref ${e})`}function U5(e){const t=XH.exec(e);return t?{text:e.slice(0,t.index).trim(),requestId:t[1]}:{text:e,requestId:null}}function sB(e,t){const r=$I(e),i=iB(e);if(i)return{message:i,requestId:r,redacted:!1,refusal:!0};const n=LI(e);if(!n||!n.trim())return{message:t,requestId:r,redacted:!1,refusal:!1};const s=ZH.exec(n);if(s){const o=s[2],a=z_(o.startsWith(tB)?o.slice(12):o);return a?{message:a.slice(0,Fc),requestId:r,redacted:!1,refusal:!1}:{message:rB,requestId:r,redacted:!0,refusal:!1}}return{message:z_(n.replace(eB,"")).slice(0,Fc)||t,requestId:r,redacted:!1,refusal:!1}}function q5(e,t){const{message:r,requestId:i,refusal:n}=sB(e,t);return!i||n?r:`${r} ${nB(i)}`}function j5(e){const t=typeof e?.message=="string"?e.message:"";return t.includes("Could not find public function")||t.includes("Could not find Convex client")}function oB(e){try{if(typeof e!="object"||e===null)return;const t=e.normalized;return yx(t)?t:void 0}catch{return}}function z5(e,t){try{if(!oa()||hf(e)||ff(e)||mf(e))return!1;const r=oB(e)??Vx(e),i=Hx(r);return i!=="mcpjam"?!1:(NI(e,{...t,extra:{...t.extra??{},slug:r.slug,origin:i}}),!0)}catch{return!1}}var aB=Hw();function cB(e){if(e instanceof Error)return e;try{return new Error(typeof e=="string"?e:JSON.stringify(e))}catch{return new Error(String(e))}}function NI(e,t){if(hf(e)||ff(e)||mf(e))return;const r=Qq(cB(e)),i=Fw(r.message);if(i&&t.queryBackend&&(i.convex_backend=t.queryBackend),i&&aB(i.convex_backend,i.request_id))return;const n=i&&typeof window<"u"?Yd(window.location.href):void 0,s=$I(e),o=s?{convex_request_id:s}:{},a=YH.getState(),c=a.recoveryId&&Date.now()-a.recoveryAt<3e5?{auth_recovery_id:a.recoveryId}:{};try{Oq(r,{level:t.level??"error",tags:{...t.tags??{},source:t.source,...o,...i,...c},...t.fingerprint?{fingerprint:t.fingerprint}:{},...i?{extra:{boundary:t.extra?.boundary,componentStack:t.extra?.componentStack,page_location:n}}:t.extra?{extra:t.extra}:{}})}catch{}try{oa()&&!Bf()&&W2.captureException(r,{source:t.source,level:t.level??"error",...o,...i?{...i,page_location:n}:t.extra??{}})}catch{}}function F5(e,t,r){NI(e,{source:r?`react_boundary:${r}`:"react_boundary",extra:{componentStack:t?.componentStack??void 0,boundary:r??"unnamed"}})}export{Ej as $,Id as $a,ZV as $i,DU as $n,N3 as $r,D4 as $t,C5 as A,rg as Aa,n0 as Ai,k4 as An,XB as Ao,cU as Ar,G4 as At,_5 as B,ul as Ba,c1 as Bi,Hd as Bn,LB as Bo,q3 as Br,V4 as Bt,k5 as C,qV as Ca,kl as Ci,ra as Cn,Qp as Co,K3 as Cr,t5 as Ct,I5 as D,$V as Da,G1 as Di,S4 as Dn,ZB as Do,V3 as Dr,X4 as Dt,R5 as E,NV as Ea,ef as Ei,E4 as En,QB as Eo,hU as Er,_f as Et,w5 as F,uL as Fa,yg as Fi,jg as Fn,IT as Fo,H3 as Fr,Qq as Ft,g5 as G,$i as Ga,t3 as Gi,d4 as Gn,mB as Go,eU as Gr,mc as Gt,v5 as H,CV as Ha,r3 as Hi,p4 as Hn,rR as Ho,D3 as Hr,H4 as Ht,Vf as I,oL as Ia,o3 as Ii,v4 as In,bT as Io,z3 as Ir,hf as It,Go as J,IV as Ja,Kb as Ji,a4 as Jn,_A as Jo,ZD as Jr,Oq as Jt,mI as K,RV as Ka,QV as Ki,u4 as Kn,gB as Ko,XD as Kr,j4 as Kt,Bf as L,PV as La,a3 as Li,_4 as Ln,cT as Lo,F3 as Lr,ff as Lt,PH as M,xV as Ma,u3 as Mi,tq as Mn,JB as Mo,hw as Mr,Hw as Mt,E5 as N,MV as Na,d3 as Ni,rq as Nn,YB as No,hn as Nr,go as Nt,P5 as O,TL as Oa,p3 as Oi,w4 as On,aP as Oo,G3 as Or,Y4 as Ot,S5 as P,OV as Pa,Zb as Pi,y4 as Pn,oP as Po,qr as Pr,Fw as Pt,h5 as Q,Xx as Qa,w$ as Qi,s4 as Qn,fA as Qo,WD as Qr,N4 as Qt,oa as R,rL as Ra,c3 as Ri,HU as Rn,lT as Ro,iU as Rr,mf as Rt,UH as S,zL as Sa,Gh as Si,C4 as Sn,eO as So,J3 as Sr,e5 as St,T5 as T,UV as Ta,Zh as Ti,xl as Tn,eV as To,Ci as Tr,J4 as Tt,b5 as U,ll as Ua,e1 as Ui,m4 as Un,id as Uo,tU as Ur,B4 as Ut,y5 as V,dl as Va,n3 as Vi,f4 as Vn,Bp as Vo,YD as Vr,Yg as Vt,J2 as W,TV as Wa,i3 as Wi,h4 as Wn,rd as Wo,lf as Wr,gc as Wt,W2 as X,AV as Xa,fg as Xi,i4 as Xn,pB as Xo,Nd as Xr,F4 as Xt,M_ as Y,pM as Ya,hg as Yi,o4 as Yn,qp as Yo,j3 as Yr,L4 as Yt,wj as Z,kV as Za,pg as Zi,n4 as Zn,gA as Zo,Rl as Zr,q4 as Zt,VH as _,sg as _a,Yh as _i,Tw as _n,Nr as _o,Tl as _r,n5 as _t,sB as a,KV as aa,Pg as ai,x4 as an,Hx as ao,Ol as ar,Ww as at,x5 as b,jL as ba,hc as bi,oq as bn,dV as bo,df as br,ij as bt,j5 as c,HV as ca,sf as ci,O4 as cn,dx as co,Q3 as cr,c5 as ct,N5 as d,Cd as da,Ur as di,Hg as dn,_V as do,Pl as dr,o5 as dt,f$ as ea,KD as ei,U4 as en,EV as eo,UU as er,ep as et,KH as f,JV as fa,$d as fi,I4 as fn,mb as fo,zd as fr,s5 as ft,L5 as g,ou as ga,v3 as gi,Cw as gn,Pm as go,Cl as gr,aj as gt,M5 as h,og as ha,P3 as hi,T4 as hn,DO as ho,gs as hr,i5 as ht,q5 as i,p$ as ia,Sr as ii,Lw as in,Wx as io,l4 as ir,p5 as it,CH as j,vL as ja,h1 as ji,QU as jn,KB as jo,B3 as jr,W4 as jt,A5 as k,mi as ka,$1 as ki,b4 as kn,Zc as ko,hi as kr,Z4 as kt,U5 as l,GV as la,cw as li,P4 as ln,yV as lo,X3 as lr,a5 as lt,zc as m,WL as ma,x3 as mi,sq as mn,hb as mo,ta as mr,Pi as mt,NI as n,d$ as na,L3 as ni,M4 as nn,Vx as no,t4 as nr,u5 as nt,nB as o,h$ as oa,Al as oi,uq as on,ah as oo,An as or,bj as ot,D5 as p,FV as pa,M3 as pi,cq as pn,vV as po,$g as pr,hj as pt,pH as q,tl as qa,Ch as qi,c4 as qn,yA as qo,QD as qr,$4 as qt,z5 as r,YV as ra,of as ri,_q as rn,yx as ro,e4 as rr,l5 as rt,$I as s,VV as sa,Qo as si,dq as sn,bV as so,Rn as sr,yj as st,F5 as t,XV as ta,$3 as ti,z4 as tn,wV as to,r4 as tr,Sj as tt,YH as u,WV as ua,Xt as ui,lq as un,ox as uo,Z3 as ur,d5 as ut,$5 as v,zV as va,f0 as vi,R4 as vn,sh as vo,Y3 as vr,r5 as vt,MH as w,jV as wa,tf as wi,fc as wn,Qy as wo,W3 as wr,K4 as wt,qH as x,DV as xa,rS as xi,A4 as xn,XP as xo,gU as xr,Q4 as xt,O5 as y,FL as ya,Qh as yi,aq as yn,Ri as yo,uf as yr,nj as yt,_I as z,VM as za,l3 as zi,g4 as zn,$B as zo,U3 as zr,Zq as zt};
64
64
 
65
- //# sourceMappingURL=error-reporting-DxIXZRUY.js.map
65
+ //# sourceMappingURL=error-reporting-CblWFSJy.js.map