Files
web-alterflixhub/assets/analytics-hbCOwHmS.js
T
Bkk1234 e6c4ebff48 chore(publish): replace source tree with static export at repo root
Publish the prerendered static export (index.html, 404.html, cinema/,
c/, about/, for-cinemas/, for-film-lovers/, assets/, images/, og/,
sitemap.xml, robots.txt) as the site root and remove the React Router
+ Nitro source tree from this branch. Source remains available in
history at 0548772.

Note: public/sw.js here reports VERSION v2.0.5 while the removed source
tree (v2.1.0) was newer, and .gitignore was not carried over.
2026-11-22 22:24:36 +07:00

3 lines
52 KiB
JavaScript

const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/session-replay--ys9kbH4.js","assets/api-path-DiLUeLL2.js","assets/preload-helper-CZgWQFsJ.js","assets/optional-peer-BHoJSOIB.js","assets/session-replay-endpoint-CkXvYk-L.js","assets/browser-Brwa_wdh.js"])))=>i.map(i=>d[i]);
import{r as e,t}from"./react-B8IZ02wI.js";import{T as n,_ as r,a as i,c as a,d as o,g as s,l as c,n as l,o as u,t as d,u as f,v as p}from"./api-path-DiLUeLL2.js";import{t as m}from"./preload-helper-CZgWQFsJ.js";import{n as h}from"./optional-peer-BHoJSOIB.js";import{a as g,c as ee,d as te,i as ne,l as re,n as ie,o as ae,r as oe,s as se,t as ce,u as le}from"./session-replay-endpoint-CkXvYk-L.js";var ue;function de(){return ue}var fe=`@agent-native/core/agent-loop`,_,pe,me=!1;async function he(){let e=de()?.tracerProvider;if(_!==void 0&&pe===e)return _;pe=e;try{let t=await h(`@opentelemetry/api`,()=>m(()=>import(`./esm-CWqsxKDN.js`),[])),n=e?e.getTracer(fe):t?.trace?.getTracer?.(fe);_=n?{tracer:n,...t?.context?.active&&t?.context?.with?{context:t.context}:{},...t?.trace?.setSpan?{trace:t.trace}:{}}:null}catch(e){me||(me=!0,console.warn(`[agent-native] OpenTelemetry tracing disabled after an optional peer load failure.`,e)),_=null}return _}function ge(e){let t={};for(let[n,r]of Object.entries(e))r!=null&&(t[n]=r);return t}var _e=new Map([[`action.response`,`action.client`],[`action_completed`,`action.server`],[`action_failed`,`action.server`],[`$ai_generation`,`llm.generation`],[`$ai_trace`,`llm.trace`],[`agent_run_terminal`,`agent.run.terminal`],[`$a2a_invocation`,`a2a.invocation`],[`$a2a_read_invoke`,`a2a.read`]]);function ve(e){let t=e.duration_ms;return typeof t==`number`&&Number.isFinite(t)&&t>=0?t:null}function ye(e){return typeof e==`string`||typeof e==`number`&&Number.isFinite(e)||typeof e==`boolean`?e:void 0}function be(e){let t={},n=(n,r)=>{let i=e[r];typeof i==`number`&&Number.isFinite(i)&&i>=0&&(t[n]=i)},r=(n,r)=>{let i=e[r];typeof i==`boolean`&&(t[n]=i)};r(`agent.success`,`success`),r(`agent.sampled`,`sampled`),n(`agent.sample_rate`,`sample_rate`);for(let e of[`duration_ms`,`ttfb_ms`,`body_ms`,`server_duration_ms`,`network_overhead_ms`,`framework_ready_wait_ms`,`db_operation_wall_ms`,`db_operation_count`,`cold_start`])n(`agent.${e}`,e);let i=e.status_code;return typeof i==`number`&&Number.isInteger(i)&&i>=100&&i<=599&&(t[`http.status_code`]=i,t[`http.status_class`]=`${Math.floor(i/100)}xx`),t}function xe(e,t,n){let r=n===`client`?{}:{"agent.event_name":e};if(n&&(r[`agent.telemetry_source`]=n),n===`client`)return{...r,...be(t)};let i=(e,n,i=t[n])=>{let a=ye(i);a!==void 0&&(r[e]=a)};return i(`agent.source`,`source`),e!==`$a2a_read_invoke`&&i(`agent.action`,`action_name`,t.action),i(`agent.action_source`,`action_source`),i(`agent.caller`,`caller`),i(`agent.outcome`,`outcome`),i(`agent.success`,`success`),i(`agent.sample_rate`,`sample_rate`),i(`agent.sampled`,`sampled`),i(`http.method`,`method`),i(`http.route`,`route_template`),i(`http.status_code`,`status_code`),i(`http.status_class`,`status_class`),i(`agent.duration_ms`,`duration_ms`),i(`agent.ttfb_ms`,`ttfb_ms`),i(`agent.body_ms`,`body_ms`),i(`agent.server_duration_ms`,`server_duration_ms`),i(`agent.network_overhead_ms`,`network_overhead_ms`),i(`agent.framework_ready_wait_ms`,`framework_ready_wait_ms`),i(`agent.db_operation_wall_ms`,`db_operation_wall_ms`),i(`agent.db_operation_count`,`db_operation_count`),i(`agent.cold_start`,`cold_start`),r}function Se(e){if(e.success===!1)return`error`;let t=e.status_code;if(typeof t==`number`&&t>=400||e.$ai_is_error===!0)return`error`;let n=e.status;if(typeof n==`string`&&/^(?:aborted|error|errored|failed|truncated)$/i.test(n))return`error`;let r=e.outcome;return typeof r==`string`&&/(?:cancel|error|fail|network|timeout)/i.test(r)?`error`:`success`}async function Ce(e,t={},n){let r=e.trim(),i=ve(t),a=_e.get(r);if(!(!a||i===null))try{let e=Date.now();Te(await we(a,xe(r,t,n),null,e-i),{status:Se(t),endTime:e})}catch{}}async function we(e,t={},n=null,r){let i=await he();if(!i)return null;try{let a;if(n&&i.context&&i.trace)try{a=i.trace.setSpan(i.context.active(),n)}catch{}return i.tracer.startSpan(e,{attributes:ge(t),...r===void 0?{}:{startTime:r}},a)}catch{return null}}function Te(e,t={}){if(e)try{t.attributes&&e.setAttributes(ge(t.attributes)),t.status===`error`?(e.setStatus({code:2,message:t.errorMessage??void 0}),t.errorMessage&&e.recordException({message:t.errorMessage})):t.status!==`unset`&&e.setStatus({code:1})}catch{}finally{try{e.end(t.endTime)}catch{}}}var v={appEntered:`app_entered`,coreActionStarted:`core_action_started`,coreActionCompleted:`core_action_completed`,outputViewed:`output_viewed`,outputShared:`output_shared`,returnUsage:`return_usage`,crossAppUsed:`cross_app_used`,coreActionFailed:`core_action_failed`,ctaClicked:`cta_clicked`},Ee=`event_alias_id`,De={"auth.login_clicked":`auth_login_clicked`,"auth.signup_clicked":`auth_signup_clicked`,"auth.signup_completed":`auth_signup_completed`,"auth.signup_viewed":`auth_signup_viewed`,"build your app":`build_your_app`,"builder branch waitlist joined":`builder_branch_waitlist_joined`,"builder connect clicked":`builder_connect_clicked`,"builder connect failed":`builder_connect_failed`,"builder connect popup blocked":`builder_connect_popup_blocked`,"builder connect started":`builder_connect_started`,"builder connect succeeded":`builder_connect_succeeded`,"builder disconnect failed":`builder_disconnect_failed`,"builder disconnect succeeded":`builder_disconnect_succeeded`,"checkout.completed":`checkout_completed`,"choose get started path":`choose_get_started_path`,"click add to agent":`click_add_to_agent`,"click build online":`click_build_online`,"click community app":`click_community_app`,"click community app action":`click_community_app_action`,"click community app demo":`click_community_app_demo`,"click community app source":`click_community_app_source`,"click customize it":`click_customize_it`,"click customize locally":`click_customize_locally`,"click customize online":`click_customize_online`,"click get started":`click_get_started`,"click template":`click_template`,"click view docs":`click_view_docs`,"copy cli command":`copy_cli_command`,"copy code block":`copy_code_block`,"copy install command":`copy_install_command`,"create form":`create_form`,"desktop download":`desktop_download`,"desktop open":`desktop_open`,"environment switched":`environment_switched`,"generate deck":`generate_deck`,"open assets":`open_assets`,"open hosted demo":`open_hosted_demo`,"session replay upload rejected":`session_replay_upload_rejected`,"session status":`session_status`,"skill read docs":`skill_read_docs`,"skills_cli cancelled":`skills_cli_cancelled`,"skills_cli clients selected":`skills_cli_clients_selected`,"skills_cli completed":`skills_cli_completed`,"skills_cli connect completed":`skills_cli_connect_completed`,"skills_cli connect failed":`skills_cli_connect_failed`,"skills_cli connect started":`skills_cli_connect_started`,"skills_cli failed":`skills_cli_failed`,"skills_cli github action added":`skills_cli_github_action_added`,"skills_cli install completed":`skills_cli_install_completed`,"skills_cli instructions updated":`skills_cli_instructions_updated`,"skills_cli mcp registered":`skills_cli_mcp_registered`,"skills_cli plan mode selected":`skills_cli_plan_mode_selected`,"skills_cli scope selected":`skills_cli_scope_selected`,"skills_cli skills listed":`skills_cli_skills_listed`,"skills_cli skills prompted":`skills_cli_skills_prompted`,"skills_cli skills selected":`skills_cli_skills_selected`,"skills_cli started":`skills_cli_started`,"start from scratch":`start_from_scratch`,"submit community app":`submit_community_app`,"try live demo":`try_live_demo`,"view clip preview":`view_clip_preview`,"view plan video preview":`view_plan_video_preview`};function Oe(e,t){let n=De[e];return n?{name:n,properties:{...t,canonical_event_name:n,legacy_event_name:e}}:null}function y(e){if(typeof e==`string`)return e.trim()||void 0}function ke(e){let t=y(e)?.toLowerCase();if(!(!t||t===`localhost`))return t.startsWith(`agent-native-`)?t.slice(13):t}function Ae(e){let t={...e},n=ke(e.app_name??e.app);n&&(t.app_name=n);let r=ke(e.template_name??e.template??e.templateId);r&&(t.template_name=r);let i=y(e.session_id??e.sessionId);return i&&(t.session_id=i),t}function je(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,`_`).replace(/^_+|_+$/g,``)}function Me(e){for(let t of[`output_id`,`resource_id`,`recording_id`,`plan_id`,`deck_id`,`document_id`,`form_id`]){let n=y(e[t]);if(n)return n}}function Ne(e){return y(e.output_type??e.resource_type)}var Pe=`user_id.user_email.app_name.template_name.session_id.action_name.action_method.action_source.caller.success.failure_type.failure_code.surface.source.referrer.workspace_id.company_domain.share_method.cta_name.link_type.run_id.llm_chat_eligible.thread_id.turn_id.chat_tab_id.chat_surface.request_mode.duration_ms.status_code.ref.via`.split(`.`);function Fe(e){let t={};for(let n of Pe){let r=e[n];(typeof r==`string`||typeof r==`number`||typeof r==`boolean`)&&(t[n]=r)}let n=Me(e);n&&(t.output_id=n);let r=Ne(e);return r&&(t.output_type=r),t}function Ie(e,t){let n=Fe(Ae(t));if(e===`share_link_copied`||e===`share_invite_sent`||e===`share_visibility_change`)return{name:v.outputShared,properties:{...n,share_method:e===`share_link_copied`?`copy_link`:e===`share_invite_sent`?`invite`:`visibility_change`}};if(e===`share_view`||e===`view clip preview`||e===`view plan video preview`)return{name:v.outputViewed,properties:{...n,...e===`view clip preview`?{output_type:`clip`}:{},...e===`view plan video preview`?{output_type:`plan`}:{}}};if(e===`app.first_action`){let e=y(t.action);if(e===`chat_submit`||e===`recording_start`)return{name:v.coreActionStarted,properties:{...n,action_name:e}};if(e===`plan_viewed`)return{name:v.outputViewed,properties:{...n,action_name:e}}}return e===`generate deck`?{name:v.ctaClicked,properties:{...n,cta_name:`generate_deck`}}:e===`share_cta_click`?{name:v.ctaClicked,properties:{...n,cta_name:y(t.cta)??`share_cta`}}:e===`auth.signup_clicked`||e===`auth.login_clicked`||e===`builder connect clicked`||e===`builder_connect_clicked`||e.startsWith(`click `)||e.startsWith(`try `)||e.startsWith(`choose `)||e===`create your own`||e===`start from scratch`?{name:v.ctaClicked,properties:{...n,cta_name:y(t.cta)??je(e)}}:null}var Le=`agent_signals`,Re=`page_load_id`;function ze(e){return e.page_hidden!==!0&&e.outcome!==`cancelled`}var Be=`client_platform`,Ve=[`web`,`electron`,`mobile`];function He(e){return typeof e==`string`&&Ve.includes(e)?e:void 0}var Ue=[`ref`,`via`,`utm_source`,`utm_medium`,`utm_campaign`,`utm_content`,`utm_term`,`gclid`,`msclkid`,`vector_source`],We=[`/p/`,`/plan/`,`/plans/`,`/recaps/`,`/share-plan/`];function Ge(e){if(e){if(e.startsWith(`/share/`))return`clip_share`;if(We.some(t=>e.includes(t)))return`plan_share`}}function Ke(e){let t=e?.trim().toLowerCase().replace(/\.$/,``)??``;return t===`agent-native.com`||t.endsWith(`.agent-native.com`)}var qe=new Set([`accounts.google.com`]),Je=new Set([`localhost`,`127.0.0.1`,`[::1]`,`0.0.0.0`]);function Ye(e){let t=e?.trim().toLowerCase().replace(/\.$/,``)??``;if(!t)return!1;let n=t.startsWith(`[`)?t.slice(0,t.indexOf(`]`)+1):t.split(`:`)[0];return!Ke(n)&&!Je.has(n)&&!qe.has(n)}function b(e){return e?Ue.some(t=>!!e[t]?.trim())||Ge(e.landing_path)?!0:[e.landing_referrer,e.site_referrer].some(Ye):!1}var Xe=`an_fts`,Ze=`/_agent-native/auth/attribution`,Qe=365*24*60*60;function $e(e){let t=Date.parse(e.landed_at??``);return Number.isFinite(t)?t:-1/0}function x(e,t){if(!e)return t??null;if(!t)return e;let n=b(e);return n===b(t)?$e(t)<$e(e)?t:e:n?e:t}function et(e,t){return!!e?.landed_at&&e.landed_at===t?.landed_at}function tt(e,t=Date.now()){let n=Date.parse(e.landed_at??``),r=(Number.isFinite(n)&&n<=t?n:t)+Qe*1e3;return r>t?new Date(r):null}function nt(e){let t=typeof e==`string`?e.trim():``;return t?t.startsWith(`ai-sdk:`)&&t.slice(7)||t:`none`}function rt(e){return e?!e.configured||!e.engine?{llm_connection:`none`,llm_connection_configured:!1,...typeof e.chatEligible==`boolean`?{llm_chat_eligible:e.chatEligible}:{}}:{llm_connection:nt(e.engine),llm_connection_configured:!0,...typeof e.chatEligible==`boolean`?{llm_chat_eligible:e.chatEligible}:{},llm_engine:e.engine,...e.model?{llm_model:e.model}:{},...e.source?{llm_connection_source:e.source}:{},...e.envVar?{llm_connection_env_var:e.envVar}:{}}:{llm_connection:`unknown`}}var it=[`test`,`invalid`,`localhost`,`example`],at=[`+autoz`,`+qa-test-bot-`],ot=[`qa-test-bot-`,`an-e2e-probe-`],st=[`example.com`,`example.net`,`example.org`].map(e=>({prefix:`e2e-`,suffix:`@${e}`}));function ct(e){return[`@${e}`,`.${e}`]}var lt=it.flatMap(ct);function ut(e){let t=[],n=[];for(let r of e){let e=r.trim().toLowerCase();e.startsWith(`@`)?n.push(...ct(e.slice(1))):e&&t.push(e)}return{addresses:t,suffixes:n}}function S(e,t=[]){if(typeof e!=`string`)return!1;let n=e.trim().toLowerCase();if(n.indexOf(`@`)<1)return!1;let r=ut(t);return at.some(e=>n.includes(e))||ot.some(e=>n.startsWith(e))||st.some(({prefix:e,suffix:t})=>n.startsWith(e)&&n.endsWith(t))||[...lt,...r.suffixes].some(e=>n.endsWith(e))||r.addresses.includes(n)}var dt=`?`,ft=50,pt=1024,mt=/\S*Error: /,ht=/\(error: (.*)\)/,gt=/^\s*at (?:async )?(?:(.+?)\s+\()?(?:(.+?):(\d+):(\d+)|([^)]+))\)?\s*$/,_t=/^\s*(.*?)@(.+?)(?::(\d+))?(?::(\d+))?\s*$/;function vt(e){return!e||!e.startsWith(`node:`)&&!e.includes(`node_modules`)&&!e.includes(`/internal/`)&&e!==`native`}function yt(e,t,n,r,i){return{platform:`custom`,lang:e,function:!t||t===`<anonymous>`?dt:t,...n?{filename:n}:{},...r!==void 0&&Number.isFinite(r)?{lineno:r}:{},...i!==void 0&&Number.isFinite(i)?{colno:i}:{},in_app:vt(n),resolved:!1}}function bt(e,t){let n=gt.exec(e);if(n){let[,e,r,i,a,o]=n,s=(r??o)?.replace(/^file:\/\//,``);return yt(t,e??dt,s,i?Number(i):void 0,a?Number(a):void 0)}let r=_t.exec(e);if(r){let[,e,n,i,a]=r;return yt(t,e||dt,n,i?Number(i):void 0,a?Number(a):void 0)}}function xt(e,t=`javascript`){if(!e)return[];let n=[];for(let r of e.split(`
`)){if(r.length>pt)continue;let e=ht.test(r)?r.replace(ht,`$1`):r;if(mt.test(e))continue;let i=bt(e,t);if(i&&n.push(i),n.length>=ft)break}return n.reverse(),n}function St(e){let t=e.lang??`javascript`,n=xt(e.stack,t);return{$exception_list:[{type:p(e.type||`Error`,200),value:p(e.value||e.type||`Error`,r),mechanism:{handled:e.handled??!0,synthetic:e.synthetic??!1,...e.mechanismType?{type:p(e.mechanismType,100)}:{}},...n.length?{stacktrace:{type:`raw`,frames:n}}:{}}],$exception_level:e.level??`error`,...e.fingerprint?{$exception_fingerprint:p(e.fingerprint,200)}:{}}}function Ct(e){if(e)return e;if(typeof window>`u`)return`web`;let t=window;return He(t.agentNativeDesktop?.analytics?.clientPlatform)??He(t.__AGENT_NATIVE_HOST_PLATFORM__)??He(t.__AGENT_NATIVE_CONFIG__?.clientPlatform)??`web`}var wt=`thread`;function Tt(e,t){return`${e.replace(/\/+$/,``)}/?${wt}=${encodeURIComponent(t)}`}function Et(e){let t={};for(let[n,r]of Object.entries(e)){if(typeof r!=`string`)continue;let e=r.trim();e&&(t[n]=e)}return t}var Dt=`agent-chat-active-run`;function Ot(e,t){return`${e}${t}`}function kt(){return{current:null,runs:{}}}function At(e){let t=e;return!!(t&&typeof t==`object`&&typeof t.threadId==`string`&&typeof t.runId==`string`)}function jt(){try{let e=sessionStorage.getItem(Dt);if(!e)return kt();let t=JSON.parse(e);if(At(t)){let e=Ot(t.threadId,t.runId);return{current:e,runs:{[e]:t}}}let n=t;return!n||typeof n!=`object`||!n.runs?kt():{current:typeof n.current==`string`?n.current:null,runs:n.runs}}catch{return kt()}}function Mt(){let e=jt();return e.current?e.runs[e.current]??null:null}function Nt(){try{let e=new URLSearchParams(window.location.search);return e.get(`thread`)?.trim()||e.get(`threadId`)?.trim()||void 0}catch{return}}function Pt(e={}){if(typeof window>`u`)return Et(e);let t=Et(e),n=Mt(),r=t.threadId??Nt()??n?.threadId;return Et({appId:window.location.host,release:`agent-native-client@${s()||`development`}`,occurredAt:new Date().toISOString(),...t,threadId:r,runId:t.runId??(n?.threadId===r?n?.runId:void 0),threadUrl:t.threadUrl??(r?Tt(new URL(l(`/`),window.location.origin).toString(),r):void 0)})}t();var Ft=250,It=500;function Lt(e){if(typeof window>`u`||typeof setTimeout!=`function`)return()=>{};let t=!1,n=[],r=()=>{if(!t){t=!0;for(let e of n.splice(0))e();e()}},i=setTimeout(r,Ft);n.push(()=>clearTimeout(i));let a=()=>{if(typeof requestIdleCallback==`function`){let e=requestIdleCallback(r,{timeout:It});n.push(()=>cancelIdleCallback(e))}else{let e=setTimeout(r,0);n.push(()=>clearTimeout(e))}};if(typeof requestAnimationFrame==`function`){let e=()=>{let e=requestAnimationFrame(()=>{t||a()});n.push(()=>cancelAnimationFrame(e))},r=requestAnimationFrame(()=>{t||e()});n.push(()=>cancelAnimationFrame(r))}else a();return()=>{t=!0;for(let e of n.splice(0))e()}}var Rt=500,zt=1e4,Bt=128,Vt=3e4,Ht=15e3,C=`/_agent-native/auth/session`,Ut=`/_agent-native/agent-engine/status`,w=new Map,T=new Map,E=new Map,Wt=new WeakSet,Gt=new WeakSet,D=new Map,Kt=new WeakMap,qt=1,Jt=!1,Yt=0,Xt=0;function Zt(e){return typeof e==`object`&&!!e&&!e.error}function O(e){try{let t=typeof window>`u`?`http://agent-native.invalid`:window.location.href;return new URL(e,t).toString()}catch{return e}}function Qt(e){let t=Kt.get(e);return t===void 0&&(t=qt++,Kt.set(e,t)),t}function $t(e){let t=[];if(Array.isArray(e))for(let[n,r]of e)t.push([n.toLowerCase(),r.trim()]);else if(typeof e.forEach==`function`)e.forEach((e,n)=>{t.push([n.toLowerCase(),e.trim()])});else for(let[n,r]of Object.entries(e))t.push([n.toLowerCase(),r.trim()]);let n=new Map;for(let[e,r]of t){let t=n.get(e)??[];t.push(r),n.set(e,t)}return[...n].sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>[e,t])}function en(e){if(e===void 0)return``;try{return JSON.stringify($t(e))}catch{return`identity:${Qt(e)}`}}function tn(e,t){let n=t?.fetch??globalThis.fetch,r=typeof n==`function`?Qt(n):null;return JSON.stringify([e,r,t?.credentials??`same-origin`,en(t?.headers)])}function nn(e){for(let[t,n]of w)n.expiresAt<=e&&w.delete(t);if(w.size<=Bt)return;let t=[...w.entries()].sort((e,t)=>e[1].expiresAt-t[1].expiresAt);for(let[e]of t){if(w.size<=Bt)break;w.delete(e)}}function rn(){Yt+=1;let e=O(d(C)),t=O(d(Ut));for(let[n,r]of w)r.url!==e&&r.url!==t&&w.delete(n)}function an(){Jt||typeof window>`u`||typeof document>`u`||(Jt=!0,typeof window.addEventListener==`function`&&(window.addEventListener(`focus`,rn),window.addEventListener(`agent-engine:configured-changed`,ln),window.addEventListener(`agent-native:tool-done`,e=>{let t=e.detail;t?.tool===`manage-agent-engine`&&t.completedSideEffect===!0&&t.isError!==!0&&window.dispatchEvent(new Event(`agent-engine:configured-changed`))})),typeof document.addEventListener==`function`&&document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`&&rn()}))}async function on(e,t){if(re())return{state:`unavailable`};an();let n=t?.url??d(e),r=O(n),i=tn(r,t);nn(Date.now());let a=w.get(i);if(!t?.fresh&&a&&a.expiresAt>Date.now())return a.result;w.delete(i);let o=T.get(i);if(o&&t?.fresh&&Gt.has(o)||o&&!t?.fresh)return o;t?.fresh&&o&&Wt.add(o);let s=e===C,c=()=>s?Xt:Yt,l=c(),u=typeof AbortController>`u`?null:new AbortController,f,p=new Promise(e=>{f=setTimeout(()=>{u?.abort(),e({state:`unavailable`})},Ht)}),m=s&&typeof window<`u`?window.__agentNativeSessionBootstrap:void 0;m&&delete window.__agentNativeSessionBootstrap;let h=m??(t?.fetch??fetch)(n,{cache:`no-store`,credentials:t?.credentials??`same-origin`,...t?.headers?{headers:t.headers}:{},...u?{signal:u.signal}:{}}).then(async e=>{if(!e.ok)return{state:`unavailable`,status:e.status};try{return{state:`available`,value:await e.json()}}catch{return{state:`unavailable`,status:e.status}}}).catch(()=>({state:`unavailable`})),g=Promise.race([h,p]).then(n=>Wt.has(g)?on(e,{...t,fresh:!1}):(c()===l&&n.state===`available`&&(w.set(i,{url:r,expiresAt:Date.now()+(s&&Zt(n.value)?Vt:e===Ut?zt:Rt),result:n}),nn(Date.now())),n)).finally(()=>{f!==void 0&&clearTimeout(f),T.get(i)===g&&(T.delete(i),E.delete(i)),D.get(i)===u&&D.delete(i)});return T.set(i,g),E.set(i,r),t?.fresh&&Gt.add(g),u&&D.set(i,u),g}function sn(e){let t=O(d(e));e===C&&typeof window<`u`&&delete window.__agentNativeSessionBootstrap;for(let[e,n]of w)n.url===t&&w.delete(e);for(let[e,n]of E){if(n!==t)continue;let r=T.get(e);r&&Wt.add(r),D.get(e)?.abort(),D.delete(e),T.delete(e),E.delete(e)}}function cn(e){let t=O(d(e));for(let[e,n]of w)n.url===t&&w.delete(e)}function ln(){Yt+=1,Xt+=1,typeof window<`u`&&delete window.__agentNativeSessionBootstrap,w.clear();for(let e of T.values())Wt.add(e);for(let e of D.values())e.abort();D.clear(),T.clear(),E.clear()}function un(e){return on(`/_agent-native/agent-engine/status`,e)}function dn(){return on(C)}var fn=200,pn=/^:[\w-]+$/,mn,hn=0,gn=[];function _n(e,t){let n=e.length;e.includes(`*`)&&(n-=2),t&&(n+=2);for(let t of e)t!==`*`&&(n+=pn.test(t)?3:t===``?1:10);return n}function vn(e){if(!e.length)return[[]];let[t,...n]=e,r=vn(n);if(!t.endsWith(`?`))return r.map(e=>[t,...e]);let i=t.slice(0,-1);return[...r.map(e=>[i,...e]),...r]}function yn(e,t){let n=[],r=new Set,i=e;for(;i&&!r.has(i.id);)r.add(i.id),i.path&&n.unshift(i.path),i=i.parentId?t[i.parentId]:void 0;return n.join(`/`).split(`/`).filter(e=>e!==``)}function bn(e){let t=Object.values(e);if(e===mn&&t.length===hn)return gn;let n=[];for(let r of t)if(!(r.path==null&&!r.index))for(let t of vn(yn(r,e)))n.push({segments:t,score:_n(t,!!r.index)});return n.sort((e,t)=>t.score-e.score),mn=e,hn=t.length,gn=n,n}function xn(e,t){for(let n=0;n<e.length;n+=1){let r=e[n];if(r===`*`)return!0;let i=t[n];if(i===void 0||!pn.test(r)&&r.toLowerCase()!==i.toLowerCase())return!1}return e.length===t.length}function Sn(e,t){let n=t.replace(/\/+$/,``);if(!n)return e;let r=e.toLowerCase(),i=n.toLowerCase();return r===i?`/`:r.startsWith(`${i}/`)?e.slice(n.length):null}function Cn(e){try{return decodeURIComponent(e)}catch{return e}}function wn(e,t,n=``){let r=Sn(e,n);if(!t||r===null)return null;let i=r.split(`/`).filter(e=>e!==``).map(Cn),a=bn(t).find(e=>xn(e.segments,i));return a?`/${a.segments.join(`/`)}`.slice(0,fn):null}function Tn(){let e=window.__reactRouterManifest?.routes,t=window.__reactRouterContext?.basename;return wn(window.location.pathname,e,t??``)}var En=1e3,Dn=5e3,On=10,kn=50;function An(e){return Math.round(e)}function jn(e){let t=null;function n(n,r){t={location:n,navigationType:r,lcpFinal:r!==`load`,cls:0,windowValue:0,windowStart:0,windowLast:0,shifted:!1,longestInteractions:[],interactionIds:new Set,interactionCountAtStart:e.interactionCount?.()}}function r(t){let n=t.longestInteractions;if(!n.length)return;let r=t.interactionCountAtStart===void 0?void 0:(e.interactionCount?.()??0)-t.interactionCountAtStart,i=Math.max(r??0,t.interactionIds.size);return An(n[Math.min(n.length-1,Math.floor(i/kn))].duration)}function i(){let n=t;if(t=null,!n||n.navigationType===`resume`&&!n.shifted&&!n.interactionIds.size)return;let i={navigationType:n.navigationType};n.location.route&&(i.route=n.location.route),n.ttfbMs!==void 0&&(i.ttfbMs=n.ttfbMs),n.lcpMs!==void 0&&(i.lcpMs=n.lcpMs);let a=r(n);a!==void 0&&(i.inpMs=a),e.measuresLayoutShift()&&(i.cls=Math.round(n.cls*1e4)/1e4),!(i.ttfbMs===void 0&&i.lcpMs===void 0&&i.inpMs===void 0&&i.cls===void 0)&&e.report(i)}return{startLoad(e,r){n(e,`load`),t&&r!==void 0&&(t.ttfbMs=An(r))},navigate(e,r){if(t&&t.location.pathname!==e.pathname){if(r===`replace`){t.location=e;return}i(),n(e,`client`)}},hidden(){i()},discard(){t=null},visible(e){t||n(e,`resume`)},largestContentfulPaint(e){!t||t.lcpFinal||(t.lcpMs=An(Math.max(0,e)))},finalizeLargestContentfulPaint(){t&&(t.lcpFinal=!0)},layoutShift(e){let n=t;!n||e.hadRecentInput||(n.windowValue>0&&e.startTime-n.windowLast<En&&e.startTime-n.windowStart<Dn?n.windowValue+=e.value:(n.windowValue=e.value,n.windowStart=e.startTime),n.windowLast=e.startTime,n.cls=Math.max(n.cls,n.windowValue),n.shifted=!0)},interaction(e){let n=t,r=e.interactionId;if(!n||!r)return;n.interactionIds.add(r);let i=n.longestInteractions,a=i.find(e=>e.id===r);if(a)a.duration=Math.max(a.duration,e.duration);else if(i.length<On||e.duration>i[i.length-1].duration)i.push({id:r,duration:e.duration});else return;i.sort((e,t)=>t.duration-e.duration),i.length=Math.min(i.length,On)}}}function Mn(){return typeof PerformanceObserver<`u`?PerformanceObserver.supportedEntryTypes??[]:[]}function Nn(){return performance.getEntriesByType(`navigation`)[0]?.activationStart??0}function Pn(){let e=performance.getEntriesByType(`navigation`)[0];if(!(!e||e.responseStart<=0)&&!(e.responseStart>performance.now()))return Math.max(0,e.responseStart-Nn())}function Fn(e,t){if(typeof window>`u`||typeof document>`u`)return null;let n=Mn();if(!n.length)return null;let r=performance,i=!1,a=jn({measuresLayoutShift:()=>i,report:t,interactionCount:()=>r.interactionCount}),o=document.prerendering,s=document.visibilityState===`hidden`&&!o?0:1/0,c=new Map,l=(e,t,r={})=>{if(!n.includes(e))return!1;try{let n=new PerformanceObserver(e=>t(e.getEntries()));return n.observe({type:e,buffered:!0,...r}),c.set(n,t),!0}catch{return!1}},u=()=>{for(let[e,t]of c){let n=e.takeRecords();n.length&&t(n)}};a.startLoad(e(),Pn()),s===0&&a.discard();let d=e=>{let t=Nn();for(let n of e)n.startTime<s&&a.largestContentfulPaint(n.startTime-t)},f=e=>{for(let t of e)a.layoutShift(t)},p=e=>{for(let t of e)a.interaction(t)};l(`largest-contentful-paint`,d),i=l(`layout-shift`,f),l(`event`,p,{durationThreshold:16}),l(`first-input`,p);let m=()=>{u(),a.finalizeLargestContentfulPaint()};for(let e of[`keydown`,`click`])window.addEventListener(e,m,{capture:!0,once:!0});let h=()=>{u(),a.finalizeLargestContentfulPaint(),a.hidden()};return document.addEventListener(`visibilitychange`,t=>{document.visibilityState===`hidden`?(s=Math.min(s,t.timeStamp),h()):a.visible(e())},{capture:!0}),window.addEventListener(`pagehide`,h,{capture:!0}),window.addEventListener(`pageshow`,t=>{t.persisted&&a.visible(e())},{capture:!0}),{navigate(t){u(),a.navigate(e(),t)}}}var k=null,In=null,A=null,Ln=null,Rn=!1,j=null,zn=null,M=[],N=null,P=null,Bn=!1,Vn=null,F=null,I=!1,L=null,Hn=!1,R=null,z=null,B=null,Un=!1,Wn=null,V=null,H=!0,U=null,W=void 0,Gn=void 0,Kn=`https://analytics.agent-native.com/track`,qn=`$exception`,Jn=Symbol.for(`agent-native.client.pageviewTracking`),G=Symbol.for(`agent-native.client.appEntryTracking`),Yn=250,Xn=`agent-native.llm_connection_status`,Zn=300*1e3,K=`an_attribution`,Qn=`an_ft`,$n=`agent-native.app_entry`,er=`agent-native.app_last_entry`,tr=10080*60*1e3,nr=2592e3,rr=120,ir=1500,ar=[`ref`,`via`,`utm_source`,`utm_medium`,`utm_campaign`,`utm_content`,`utm_term`,`gclid`,`msclkid`,`vector_source`,`site_referrer`,`site_landing_path`],or=[`gclid`,`msclkid`,`vector_source`,`utm_source`,`utm_medium`,`utm_campaign`,`ref`,`via`,`utm_content`,`utm_term`,`landing_path`,`landing_referrer`,`site_referrer`,`site_landing_path`,`landed_at`],q=`an_last_touch`,sr=`an_lt`,cr=700,lr=[`ref`,`via`,`utm_source`,`utm_medium`,`utm_campaign`,`utm_content`,`utm_term`,`gclid`,`msclkid`,`vector_source`,`landing_referrer`,`site_referrer`],ur=[`ref`,`gclid`,`msclkid`,`vector_source`,`utm_source`,`utm_medium`,`utm_campaign`,`via`,`utm_content`,`utm_term`,`landing_referrer`,`site_referrer`,`landing_path`,`touched_at`,`site_landing_path`],dr={last_ref:`ref`,last_via:`via`,last_utm_source:`utm_source`,last_utm_medium:`utm_medium`,last_utm_campaign:`utm_campaign`,last_utm_content:`utm_content`,last_utm_term:`utm_term`,last_gclid:`gclid`,last_msclkid:`msclkid`,last_vector_source:`vector_source`,last_referrer:`site_referrer`,last_landing_path:`site_landing_path`},fr=`last_at`,pr={name:Qn,maxBytes:ir,priority:or},mr={name:sr,maxBytes:cr,priority:ur},hr=!1,gr=2,_r=!1;function J(e){try{return window.localStorage.getItem(e)}catch{return null}}function vr(e,t){try{window.localStorage.setItem(e,t)}catch{}}function yr(e){try{window.localStorage.removeItem(e)}catch{}}function br(){if(typeof window>`u`)return null;let e=J(Xn);if(!e)return null;try{let t=JSON.parse(e);return typeof t.cachedAt!=`number`||Date.now()-t.cachedAt>Zn?null:{configured:t.configured,...typeof t.chatEligible==`boolean`?{chatEligible:t.chatEligible}:{},engine:t.engine,model:t.model,source:t.source,envVar:t.envVar}}catch{return null}}function xr(e){typeof window>`u`||vr(Xn,JSON.stringify({...e,cachedAt:Date.now()}))}function Sr(e){let t=e;return t?{configured:t.configured===!0,...typeof t.chatEligible==`boolean`?{chatEligible:t.chatEligible}:{},...t.configured===!0?{engine:typeof t.engine==`string`?t.engine:null,model:typeof t.model==`string`?t.model:null,source:typeof t.source==`string`?t.source:null,envVar:typeof t.envVar==`string`?t.envVar:null}:{}}:{configured:!1}}function Cr(){return typeof window>`u`||typeof fetch!=`function`?Promise.resolve():P||(P=un().then(e=>{e.state===`available`?(N=Sr(e.value),xr(N)):N||=br()}).finally(()=>{P=null}),P)}function wr(){typeof window>`u`||Bn||(Bn=!0,N=br(),Vn=new Promise(e=>{Lt(()=>{Promise.race([Cr(),new Promise(e=>window.setTimeout(e,250))]).finally(e)})}),window.addEventListener(`focus`,()=>{Cr()}),window.addEventListener(`agent-engine:configured-changed`,()=>{Cr()}))}function Y(e){return typeof e==`string`&&e.trim()?e.trim():void 0}function X(e){return!!(e&&(e.testIdentity===!0||S(e.userId)||S(e.userEmail)))}function Tr(e){return!!(e&&(e.testIdentity===!0||S(e.id)||S(e.email)))}function Er(e){if(!R?.requireSignedInUser){z=null;return}e?.userEmail&&(z=e,m(()=>import(`./session-replay--ys9kbH4.js`).then(e=>e.stopSessionReplay(`auth-cleared`)),__vite__mapDeps([0,1,2,3,4])).catch(()=>{}).finally(()=>{z===e&&(z=null)}))}function Dr(){Er(F),F=null}function Or(e){let t=e;if(!t||typeof t!=`object`||t.error){Dr();return}let n=Y(t.email),r=Y(t.authUserId),i=Y(t.userId),a=n||r||i;if(!a){Dr();return}let o=Y(t.name);F={userId:a,...r?{authUserId:r}:{},...n?{userEmail:n}:{},...o?{userName:o}:{},orgId:Y(t.orgId)??null,...t.testIdentity===!0?{testIdentity:!0}:{}}}function kr(){return typeof window>`u`?(I=!0,Promise.resolve()):typeof fetch==`function`?L||(L=dn().then(e=>{e.state===`available`&&(Or(e.value),I=!0)}).finally(()=>{L=null}),L):Promise.resolve()}function Ar(){typeof window>`u`||Hn||(Hn=!0,kr(),window.addEventListener(`focus`,()=>{kr()}))}function jr(e,t=F){let n={...e};if(delete n.auth_user_id,delete n.authUserId,!t)return n;let r=(e,t)=>{t!=null&&n[e]===void 0&&(n[e]=t)};return r(`userId`,t.userId),r(`userEmail`,t.userEmail),r(`userName`,t.userName),r(`orgId`,t.orgId),n}function Mr(){return F?.userId}function Nr(){return F?.authUserId}function Pr(){return oe()}function Fr(){return Pr()}function Ir(){return ne()}function Lr(){return Ir()}function Rr(e){if(!e)return``;let t=e.trim();return t?t.slice(0,rr):``}function zr(e){if(!e)return``;try{let t=new URL(e).host;return!t||typeof window<`u`&&t.toLowerCase()===window.location.host.toLowerCase()?``:Rr(t)}catch{return``}}function Br(e){let t={},n=null;try{n=new URLSearchParams(window.location.search)}catch{n=null}if(n)for(let e of ar){let r=Rr(n.get(e));r&&(t[e]=r)}let r=Rr(e);r&&(t.landing_path=r);let i=typeof document<`u`?zr(document.referrer):``;return i&&(t.landing_referrer=i),t.landed_at=new Date().toISOString(),t}function Vr(e){if(typeof document>`u`)return null;try{let t=document.cookie?document.cookie.split(`;`):[];for(let n of t){let t=n.indexOf(`=`);if(t!==-1&&n.slice(0,t).trim()===e)return n.slice(t+1).trim()}}catch{}return null}function Hr(e,t){return`${e}=${t}; path=/; max-age=${nr}; SameSite=Lax`}function Ur(e,t){let n=JSON.parse(e),r={},i=!1,a=e=>Hr(t.name,e).length<=t.maxBytes;for(let e of t.priority){let t=n[e];if(typeof t!=`string`||!t)continue;let o={...r,[e]:t.slice(0,rr)};a(encodeURIComponent(JSON.stringify(o)))?r[e]=o[e]:i=!0}if(i){r.capture_truncated=`1`;for(let e of[...t.priority].reverse()){let t=encodeURIComponent(JSON.stringify(r));if(a(t))return t;delete r[e]}}let o=encodeURIComponent(JSON.stringify(r));if(!a(o))throw Error(`Attribution exceeded the ${t.name} cookie budget`);return o}function Wr(e,t){if(typeof document>`u`)return;let n=Ur(e,t);try{document.cookie=Hr(t.name,n),_r=!0}catch{}}function Gr(e,t,n){let r=JSON.stringify(n);vr(e,r),Wr(r,t)}function Kr(e,t){if(Vr(t.name))return;let n=J(e);if(n)try{Wr(n,t)}catch{}}function qr(){if(yr(K),yr(q),!(typeof document>`u`))for(let e of[Qn,sr,Xe])try{document.cookie=`${e}=; path=/; max-age=0; SameSite=Lax`}catch{}}function Jr(){let e=ii(Xe);if(!e||e.v!==`1`)return null;let{v:t,...n}=e;return n}function Yr(){let e=ai(K,Qn);return e&&tt(e)?e:null}function Xr(){let e=J(q),t=ri(e);if(!e||!t)return!1;let n=ii(sr);return Date.parse(n?.touched_at??``)>=Date.parse(t.touched_at??``)?!1:(Wr(e,mr),!0)}function Zr(e){!_r&&et(Jr(),e)||re()||gr<=0||typeof fetch!=`function`||(--gr,_r=!1,fetch(d(Ze),{method:`POST`,credentials:`same-origin`,keepalive:!0,headers:{"Content-Type":`application/json`},body:JSON.stringify({firstTouch:e})}).then(async e=>{if(!e.ok)return;if((await e.json()).reason===`consent_required`||!g(`targeting`)){qr();return}let t=Xr(),n=Jr(),r=Yr();if(n){if(et(n,r)){t&&r&&Zr(r);return}x(n,r)===n?Gr(K,pr,n):r&&Zr(r)}}).catch(()=>{}))}function Qr(e={}){if(!hr&&(hr=!0,!(typeof window>`u`)))try{let t=Br(e.landingPath??window.location.pathname),n=ni(),r=ti();se(`targeting`,()=>$r(t,n,r),{optimistic:!0,revoke:qr})}catch{}}function $r(e,t,n){try{let r=Yr(),i=x(x(r,Jr()),e);i===r?Kr(K,pr):Gr(K,pr,i),ei(e,t,n),Zr(i)}catch{}}function ei(e,t,n){let r=t??(b(e)?e:null),i=si(),a=Date.parse(i?.touched_at??``);if(!r||n&&b(i)&&a>Date.parse(n)){Kr(q,mr);return}let o={};for(let e of lr){let t=r[e];t&&(o[e]=t)}e.landing_path&&(o.landing_path=e.landing_path),r.site_landing_path&&(o.site_landing_path=r.site_landing_path),o.touched_at=n??e.landed_at,Gr(q,mr,o)}function ti(){let e=new URLSearchParams(window.location.search).get(fr),t=Date.parse(e??``);if(!(!Number.isFinite(t)||t>Date.now()))return new Date(t).toISOString()}function ni(){let e=new URLSearchParams(window.location.search),t={};for(let[n,r]of Object.entries(dr)){let i=Rr(e.get(n));i&&(t[r]=i)}return b(t)?t:null}function ri(e){if(!e)return null;try{let t=JSON.parse(e);if(!t||typeof t!=`object`||Array.isArray(t))return null;let n={};for(let[e,r]of Object.entries(t))typeof r==`string`&&(n[e]=r);return n}catch{return null}}function ii(e){let t=Vr(e);if(!t)return null;try{return ri(decodeURIComponent(t))}catch{return null}}function ai(e,t){if(typeof window>`u`)return null;let n=ri(J(e));if(b(n))return n;let r=ii(t);return b(r)?r:n??r}function oi(){return typeof window>`u`?null:x(Yr(),Jr())}function si(){return ai(q,sr)}function ci(e={}){Z()||Qr(e)}function li(e){let t=(e||``).toLowerCase();return t===`localhost`||t===`127.0.0.1`||t===`::1`||t===`[::1]`||t.endsWith(`.localhost`)||t.endsWith(`.local`)}function Z(){return typeof window<`u`&&le(window.__AGENT_NATIVE_SYNTHETIC_TRAFFIC__)}function ui(){return Z(),!1}function di(){let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1};return!!(A||window.__AGENT_NATIVE_CONFIG__?.agentNativeAnalyticsPublicKey||e.VITE_AGENT_NATIVE_ANALYTICS_PUBLIC_KEY||e.VITE_AMPLITUDE_API_KEY)}function fi(e){return[...e.stacktrace?.frames??[]].reverse().map(e=>({function:e.function??void 0,filename:e.filename??e.abs_path,lineno:e.lineno}))}function pi(e){let t=typeof e.tags?.url==`string`?e.tags.url:void 0,n=e.request?.url??t??``,r=(e.breadcrumbs??[]).map(e=>{let t=e.data;return[e.category,e.message,typeof t?.url==`string`?t.url:``].join(` `)}).join(` `),i={};for(let[t,n]of Object.entries(e.tags??{}))typeof n==`string`&&(i[t]=n);let s=e.exception?.values?.at(-1);return s?o({surface:`browser`,type:s.type,value:s.value,frames:fi(s),pageUrl:n,contextText:`${n} ${r}`,tags:i,firstPartyHosts:a()}).drop:!1}function mi(e){let{t,at:n,type:r,name:i,data:a,...o}=e;return{category:`recorder.${r}`,message:[i,o.ok===void 0?void 0:o.ok?`ok`:`failed`,o.status,o.errorCode,o.ms===void 0?void 0:`${o.ms}ms`].filter(e=>e!==void 0).join(` `),level:r===`error`||r===`toast`&&i===`error`?`error`:r===`toast`||o.ok===!1?`warning`:`info`,timestamp:n/1e3,data:o}}function hi(e,t){if(!u())return;let n=i(`error`);n.events.length>0&&(e.breadcrumbs=[...e.breadcrumbs??[],...n.events.slice(-100).map(mi)].sort((e,t)=>(e.timestamp??0)-(t.timestamp??0))),t.attachments=[...t.attachments??[],{filename:`recorder.json`,data:JSON.stringify(n),contentType:`application/json`}]}function gi(...e){for(let t of e){let e=t?.trim();if(e)return e}return``}function _i(e){let t=gi(e.VITE_SENTRY_CLIENT_KEY),n=gi(e.VITE_SENTRY_PROJECT_ID),r=gi(e.VITE_SENTRY_INGEST_HOST);if(!(!t||!n||!r))return`https://${t}@${r}/${n}`}function vi(){let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1};return e.VITE_SENTRY_CLIENT_DSN||e.VITE_SENTRY_DSN||window.__AGENT_NATIVE_CONFIG__?.sentryDsn||_i(e)}function Q(){let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1};return window.__AGENT_NATIVE_CONFIG__?.deploymentEnvironment||n().deployment?.environment||e.VITE_AGENT_NATIVE_DEPLOYMENT_ENVIRONMENT||e.VITE_SENTRY_ENVIRONMENT||window.__AGENT_NATIVE_CONFIG__?.sentryEnvironment||e.MODE||`production`}function yi(){return`agent-native-client@${s()||`development`}`}function bi(e,t,n){return e.withScope(r=>{if(n.tags)for(let[e,t]of Object.entries(n.tags))typeof t==`string`&&r.setTag(e,t);if(n.extra)for(let[e,t]of Object.entries(n.extra))t!==void 0&&r.setExtra(e,t);if(n.contexts)for(let[e,t]of Object.entries(n.contexts))r.setContext(e,t);return e.captureException(t)})}function xi(e=!1){if(Z()||Rn||zn)return;let t=vi();!t&&!e||(zn=h(`@sentry/browser`,()=>m(()=>import(`./browser-Brwa_wdh.js`),__vite__mapDeps([5,3]))).then(e=>{if(j=e,!t){for(let t of M)bi(e,t.error,t.context);return M=[],e}e.init({dsn:t,environment:Q(),release:yi(),beforeSend(e,t={}){if(Z()||(e.tags={...e.tags,deployment_environment:Q()},pi(e)))return null;if(e.request?.url&&(e.request.url=f(e.request.url)),Array.isArray(e.breadcrumbs)){for(let t of e.breadcrumbs)if(t&&typeof t==`object`&&`data`in t){let e=t.data;e&&typeof e.url==`string`&&(e.url=f(e.url)),e&&typeof e.from==`string`&&(e.from=f(e.from)),e&&typeof e.to==`string`&&(e.to=f(e.to))}}return hi(e,t),e}}),e.setTag(`runtime`,`browser`),e.setTag(`deployment_environment`,Q()),Rn=!0,W!==void 0&&(e.setUser(W),W=void 0),Gn!==void 0&&(e.setTag(`orgId`,Gn),Gn=void 0);for(let t of M)bi(e,t.error,t.context);return M=[],e}).catch(e=>(console.error(`[agent-native] Browser Sentry failed to load.`,e),null)).finally(()=>{zn=null}))}function Si(e,t){let n=F,r=Tr(e),i=!1,a=null;if(e){a={id:e.id,email:e.email,username:e.username};let n=e.email||e.id;if(n){let r=Y(e.authUserId);F={userId:n,...r?{authUserId:r}:{},...e.email?{userEmail:e.email}:{},...e.username?{userName:e.username}:{},orgId:t??null,...e.testIdentity===!0?{testIdentity:!0}:{}}}else Dr();i=!!e.email&&!r}else Dr();if(r&&(M=[],Er(n)),I=!0,i&&H&&R?.requireSignedInUser&&Gi(R),Rn&&j){j.setUser(r?null:a),t!==void 0&&j.setTag(`orgId`,t??null);return}W=r?null:a,t!==void 0&&(Gn=t??null)}function Ci(){let e=globalThis;return e[Jn]||(e[Jn]={installed:!1,lastPageviewKey:null}),e[Jn]}function wi(){let e=globalThis;if(!e[G])e[G]={entryKeys:new Set};else if(!e[G].entryKeys){let t=e[G].entryKey;e[G].entryKeys=t?new Set([t]):new Set}return e[G]}function Ti(e){if(Z()){H=!1;return}e.clientPlatform&&(In=e.clientPlatform);let t=e.key||e.publicKey;t&&(A=t),e.endpoint&&(Ln=e.endpoint),e.getDefaultProps&&(k=e.getDefaultProps),U=e.contentCaptureForPath??null,H=U&&typeof window<`u`?U(window.location.pathname):e.contentCapture!==!1,typeof window<`u`&&(xi(),ui(),Qr(),e.llmConnectionStatus!==!1&&wr(),e.authSessionRefresh!==!1&&Ar(),Ui(e.sessionReplay,{endpoint:e.endpoint,publicKey:t},H),e.pageviewTracking!==!1&&(sa(),e.webVitals!==!1&&ua()),Ri(e.errorCapture))}function Ei(e){H!==e&&(H=e,e?R&&Gi(R):qi(`content-capture-disabled`))}function Di(){U&&Ei(U(window.location.pathname))}function Oi(){V||m(()=>import(`./session-replay--ys9kbH4.js`).then(e=>{V=e}),__vite__mapDeps([0,1,2,3,4])).catch(()=>{})}function ki(){return{sessionId:Ir(),anonymousId:Pr(),replayId:V?.getSessionReplayId?.()??void 0}}function Ai(e){try{let t=Pt();return t.threadId?{failureContext:t,...e.extra}:e.extra}catch{return e.extra}}function ji(e){let t=Ai(e);return{exceptionType:e.type,exceptionMessage:e.message,...e.stack?{exceptionStack:e.stack}:{},handled:e.handled,level:e.level,occurredAt:e.occurredAt,...e.url?{errorUrl:e.url}:{},...e.release?{release:e.release}:{},...e.environment?{environment:e.environment}:{},...e.sessionReplayId?{sessionReplayId:e.sessionReplayId}:{},...e.breadcrumbs?.length?{breadcrumbs:e.breadcrumbs}:{},...e.tags?{exceptionTags:e.tags}:{},...t?{exceptionExtra:t}:{}}}function Mi(e,t){if(e!==`$exception`)return t;let{exceptionTags:n,exceptionExtra:r,...i}=t;return i}function Ni(){let e=window.__AGENT_NATIVE_CONFIG__;if(e?.posthogErrorTracking===!1)return;let t={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1};if(t?.VITE_POSTHOG_ERROR_TRACKING?.trim().toLowerCase()===`false`)return;let n=e?.posthogKey||t?.VITE_POSTHOG_KEY;if(n)return{key:n,host:(e?.posthogHost||t?.VITE_POSTHOG_HOST||`https://us.i.posthog.com`).replace(/\/+$/,``)}}function Pi(e){if(Z())return;let t=Ni();if(t)try{let n=ki(),r=JSON.stringify({api_key:t.key,event:qn,properties:{distinct_id:Mr()||n.anonymousId||`anonymous`,...St({type:e.type,value:e.message,stack:e.stack,handled:e.handled,level:e.level}),$current_url:e.url,$session_id:n.sessionId,...n.replayId?{$replay_id:n.replayId}:{},...e.release?{release:e.release}:{},...e.environment?{environment:e.environment}:{},...e.tags?{exceptionTags:e.tags}:{},source:`browser`},timestamp:e.occurredAt}),i=`${t.host}/i/v0/e/`;if(navigator.sendBeacon){let e=new Blob([r],{type:`text/plain;charset=UTF-8`});if(navigator.sendBeacon(i,e))return}fetch(i,{method:`POST`,body:r,keepalive:!0,headers:{"Content-Type":`text/plain;charset=UTF-8`}}).catch(()=>{})}catch{}}function Fi(e){Z()||X(F)||($(qn,ji(e)),Pi(e))}function Ii(e){Z()||X(F)||V?.emitSessionReplayException?.({type:e.type,message:e.message,level:e.level,...e.stack?{stack:e.stack}:{},...e.url?{url:e.url}:{}})}function Li(){return!!(A||window.__AGENT_NATIVE_CONFIG__?.agentNativeAnalyticsPublicKey)||!!Ni()}function Ri(e){if(typeof window>`u`)return;if(e===!1){Wn?.(),Wn=null,Un=!1;return}if(Un&&e===void 0||!(e!==void 0||Li()))return;let t=typeof e==`object`?e:{};Oi(),Wn=c({send:Fi,getSessionContext:ki,emitReplayEvent:Ii,environment:t.environment||Q(),release:t.release||yi(),...t.captureGlobalErrors===void 0?{}:{captureGlobalErrors:t.captureGlobalErrors},...t.captureUnhandledRejections===void 0?{}:{captureUnhandledRejections:t.captureUnhandledRejections},...t.maxBreadcrumbs===void 0?{}:{maxBreadcrumbs:t.maxBreadcrumbs}}),Un=!0}function zi(){let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1},t=e.VITE_AGENT_NATIVE_SESSION_REPLAY_ENABLED||e.VITE_SESSION_REPLAY_ENABLED;return/^(1|true|yes|on)$/i.test((t??``).trim())}function Bi(){let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1},t=((e.VITE_AGENT_NATIVE_SESSION_REPLAY_REQUIRE_AUTH||e.VITE_SESSION_REPLAY_REQUIRE_AUTH)??``).trim();if(t){if(/^(1|true|yes|on)$/i.test(t))return!0;if(/^(0|false|no|off)$/i.test(t))return!1}}function Vi(e,t={}){let n={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1},r=typeof window>`u`?void 0:window.__AGENT_NATIVE_CONFIG__,i=t.publicKey||A||r?.agentNativeAnalyticsPublicKey||n.VITE_AGENT_NATIVE_ANALYTICS_PUBLIC_KEY,a=t.endpoint||Ln||r?.agentNativeAnalyticsEndpoint||n.VITE_AGENT_NATIVE_ANALYTICS_ENDPOINT||(i?Kn:void 0),o=a?ce(a,typeof document>`u`?void 0:document.baseURI)??void 0:void 0,s=e=>{let t=Hi(e.extraProperties);return{...i&&!e.publicKey?{publicKey:i}:{},...o&&!e.endpoint?{endpoint:o}:{},...e,onRecordingStarted:t=>{try{$(`session_replay_started`,{recording_attempt_id:t})}catch{}e.onRecordingStarted?.(t)},onUploadRejected:e.onUploadRejected,onUploadRejectedWithAttemptId:(t,n)=>{try{$(`session replay upload rejected`,{recording_attempt_id:n,status:t.status,restart_attempted:t.restartAttempted,restart_succeeded:t.restartSucceeded,...t.failureReason?{failure_reason:t.failureReason}:{},...t.retryAfterSeconds===void 0?{}:{retry_after_seconds:t.retryAfterSeconds},...t.restartReason?{restart_reason:t.restartReason}:{}})}finally{e.onUploadRejectedWithAttemptId?.(t,n)}},requireSignedInUser:e.requireSignedInUser??Bi()??!0,...t?{extraProperties:t}:{}}};if(e===!1)return null;if(e===!0)return s({});if(e&&typeof e==`object`)return e.enabled===!1?null:s(e);let c=!!i&&(typeof window>`u`||!li(window.location.hostname));return zi()||c?s({}):null}function Hi(e){return()=>{let t=typeof e==`function`?e():e&&typeof e==`object`?e:{},n=t&&typeof t==`object`?t:{},r=k?.(`session_replay`,n)??n,i=F??z;return jr(r,X(i)?null:i)}}function Ui(e,t,n=!0){if(typeof window>`u`)return;let r=Vi(e,t);R=r,!(!r||!n)&&Gi(r)}async function Wi(e){if(X(F))return!1;if(!e.requireSignedInUser||F?.userEmail)return!0;try{L?await L:I||await kr()}catch{}return!!F?.userEmail&&!X(F)}async function Gi(e){return Z()?{started:!1,reason:`disabled`}:B||(B=(async()=>{if(!H)return{started:!1,reason:`disabled`};if(!await Wi(e))return{started:!1,reason:`missing-user-id`};if(!H)return{started:!1,reason:`disabled`};let t=await m(()=>import(`./session-replay--ys9kbH4.js`),__vite__mapDeps([0,1,2,3,4]));return V=t,H?t.startSessionReplay({...e,shouldStart:()=>H&&!X(F)&&(e.shouldStart?.()??!0)}):{started:!1,reason:`disabled`}})().catch(()=>({started:!1,reason:`import-failed`})).finally(()=>{B=null}),B)}async function Ki(e={}){if(Z()||!H)return{started:!1,reason:`disabled`};let t=Vi(e)??e;if(!await Wi(t))return{started:!1,reason:`missing-user-id`};let n=await m(()=>import(`./session-replay--ys9kbH4.js`),__vite__mapDeps([0,1,2,3,4]));return V=n,n.startSessionReplay({...t,shouldStart:()=>H&&!X(F)&&(t.shouldStart?.()??!0)})}async function qi(e=`manual`){await(await m(()=>import(`./session-replay--ys9kbH4.js`),__vite__mapDeps([0,1,2,3,4]))).stopSessionReplay(e)}function Ji(e){let t=typeof e.app==`string`?e.app.trim():``;return!t||t===`localhost`?null:t.startsWith(`agent-native-`)?t.slice(13):t}var Yi=new Set([`web_vitals`]);function Xi(e,t){if(e===`session_replay_started`)return t?.recording_attempt_id===void 0?{}:{recording_attempt_id:t.recording_attempt_id};if(e===`session replay upload rejected`||e===`session_replay_upload_rejected`){let e=[`recording_attempt_id`,`status`,`restart_attempted`,`restart_succeeded`,`failure_reason`,`retry_after_seconds`,`restart_reason`];return Object.fromEntries(Object.entries(t??{}).filter(([t])=>e.includes(t)))}if(typeof window>`u`)return{...t};let n={url:window.location.origin+window.location.pathname,app:window.location.hostname.split(`.`)[0]||`localhost`,...t},r=k?k(e,n):n,i=r;if(i.template===void 0){let e=Ji(r);e&&(i={...r,template:e})}let a=rt(N),o={...i};o.deployment_environment=Q();for(let[e,t]of Object.entries(a))o[e]===void 0&&(o[e]=t);let s=Zi();for(let[e,t]of Object.entries(s))o[e]===void 0&&(o[e]=t);let c=di()?Ir():void 0,l=jr(Ae({...o,...c?{session_id:c}:{}})),u=F,d={...l,...Mr()?{user_id:Mr()}:{},...u?.userEmail?{user_email:u.userEmail}:{},...u?.orgId?{workspace_id:u.orgId}:{},[Be]:Ct(In??void 0)};return Yi.has(e)&&(delete d.url,delete d.path),d}function Zi(){let e=V;if(!e)return{};let t=e.getSessionReplayContext?.();if(!t?.active)return{};let n=new Date().toISOString();return{sessionReplayId:t.replayId,sessionReplayStartedAt:t.startedAt,sessionReplayAt:n,...e.getSessionReplayUrl?{sessionReplayUrl:e.getSessionReplayUrl({at:n})}:{}}}function Qi(e){let{href:t,origin:n,pathname:r,hostname:i,search:a}=window.location,o=H,s={url:o?f(t):n+r,path:r,hostname:i,navigation_type:e,[Le]:1,[Re]:ie()};return o&&a&&(s.search=f(a)),o&&typeof document<`u`&&(document.referrer&&(s.referrer=f(document.referrer)),document.title&&(s.title=document.title)),{key:t,pathname:r,hostname:i,properties:s}}function $i(){let e=J($n);if(!e)return[];try{let t=JSON.parse(e);if(Array.isArray(t))return t.filter(e=>typeof e==`string`).slice(-100)}catch{}return[e]}function ea(e){let t=wi(),n=new Set(t.entryKeys??[]);for(let e of $i())n.add(e);if(n.has(e))return t.entryKeys=new Set([...n].slice(-100)),t.entryKey=e,!1;n.add(e);let r=[...n].slice(-100);return t.entryKeys=new Set(r),t.entryKey=e,vr($n,JSON.stringify(r)),!0}function ta(e,t){let n=`${er}:${e}`,r=J(n),i=r?Number(r):NaN;return vr(n,String(t)),Number.isFinite(i)?i:null}var na=null;function ra(e){let t=L;return!t||I?!1:(na||=t.catch(()=>{}).then(()=>{na=null,ia(e)}),!0)}function ia(e){if(typeof window>`u`||!k)return;let t=e??window.location.pathname;if(ra(t))return;let n=Xi(v.appEntered,{entry_path:t}),r=ke(n.app_name??n.app),i=typeof n.session_id==`string`?n.session_id:void 0;if(!r||!ea(i?`${r}:${i}`:r))return;let a=Date.now(),o=ta(r,a),s=oi();if($(v.appEntered,{app_name:r,entry_path:t,...s?.ref?{source:s.ref}:{},...s?.landing_referrer?{referrer:s.landing_referrer}:{}}),o!==null){let e=Math.floor((a-o)/864e5);a-o>=tr&&$(v.returnUsage,{app_name:r,days_since_last:e})}}function aa(e){if(typeof window>`u`||li(e.hostname))return;let t=Ci();t.lastPageviewKey!==e.key&&(t.lastPageviewKey=e.key,$(`pageview`,e.properties),ia(e.pathname))}function oa(e){H||qi(`local-plan-privacy`);let t=Qi(e),n=()=>aa(t),r=Vn&&!N?Vn:null,i=B,a=[];if(P&&!N&&a.push(P),L&&!I&&a.push(L),r!==null){if(a.length>0||i){let e=new Promise(e=>window.setTimeout(e,Yn)),t=[...a,...i?[i.then(()=>void 0)]:[]];Promise.all([r,Promise.race([Promise.allSettled(t),e])]).finally(n);return}r.finally(n);return}if(i){let e=new Promise(e=>window.setTimeout(e,Yn));Promise.race([i.then(()=>void 0),e]).finally(n);return}if(typeof queueMicrotask==`function`){queueMicrotask(n);return}window.setTimeout(n,0)}function sa(){let e=Ci();if(e.installed)return;e.installed=!0,oa(`load`);let t=window.history.pushState.bind(window.history),n=window.history.replaceState.bind(window.history);window.history.pushState=function(...n){let r=t.apply(this,n);return Di(),e.webVitals?.navigate(`push`),oa(`pushState`),r},window.history.replaceState=function(...t){let r=n.apply(this,t);return Di(),e.webVitals?.navigate(`replace`),oa(`replaceState`),r},window.addEventListener(`popstate`,()=>{Di(),e.webVitals?.navigate(`push`),oa(`popstate`)})}function ca(){return{route:Tn(),pathname:window.location.pathname}}function la(e){V?.emitSessionReplayWebVitals?.(e),$(`web_vitals`,{...e.route?{route:e.route}:{},navigation_type:e.navigationType,ttfb_ms:e.ttfbMs,lcp_ms:e.lcpMs,inp_ms:e.inpMs,cls:e.cls})}function ua(){let e=Ci();if(!e.webVitalsInstalled&&(e.webVitalsInstalled=!0,!li(window.location.hostname)))try{e.webVitals=Fn(ca,la)}catch(e){console.warn(`[analytics] Web Vitals capture is unavailable:`,e)}}function da(e,t){if(Z()||li(window.location.hostname))return;let n=A||window.__AGENT_NATIVE_CONFIG__?.agentNativeAnalyticsPublicKey||void 0;if(!n)return;let r=te(Ln||window.__AGENT_NATIVE_CONFIG__?.agentNativeAnalyticsEndpoint||Kn,window.location.hostname),i=typeof t.userId==`string`?t.userId:void 0,a=Ir(),o=new Date().toISOString();ee(s=>{let c=s?Pr():void 0;fa(r,JSON.stringify({publicKey:n,event:e,properties:c?t:{...t,analytics_consent:s?`withheld`:`unknown`},userId:i,anonymousId:c,sessionId:a,timestamp:o}))})}function fa(e,t){try{if(navigator.sendBeacon&&navigator.sendBeacon(e,t))return;fetch(e,{method:`POST`,body:t,keepalive:!0,headers:{"Content-Type":`text/plain;charset=UTF-8`}}).catch(()=>{})}catch{}}function pa(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():void 0}function ma(){return!!(window.__AN_CONSENT_LAYERS__||window.__AGENT_NATIVE_GA_GTAG__||window.gtag)}function ha(e,t,n={}){let{agentNativeProperties:r=t,gtagProperties:i=t,sendGtag:a=!0}=n;Mi(e,t),a&&ma()&&ee(()=>{ae(`performance`)===!0&&(window.__AGENT_NATIVE_GA_GTAG__??window.gtag)?.(`event`,e.replace(/\s+/g,`_`),i)}),ui();let o=Nr();da(e,o?{...r,auth_user_id:o}:r)}var ga=new Set([`pageview`,`session status`,`session_status`,`action.response`,`web_vitals`,`agent_chat_lifecycle`,`session_replay_started`,`session replay upload rejected`,`session_replay_upload_rejected`,qn]);function _a(e,t){e===`action.response`&&typeof t.duration_ms==`number`&&t.duration_ms>=1e3&&ze(t)&&V?.emitSessionReplaySlowRequest?.(t),!ga.has(e)&&V?.emitSessionReplayAnalyticsEvent?.(e)}function $(e,t){va(e,t,!0)}function va(e,t,n){if(typeof window>`u`||Z()||X(F))return;xi();let r=Xi(e,t),i=Oe(e,r),a=i?pa():void 0,o=i!==null&&e.replace(/\s+/g,`_`)===i.name;ha(e,r,{agentNativeProperties:a?{...r,[Ee]:a}:r,gtagProperties:o?i.properties:r}),i&&ha(i.name,i.properties,{agentNativeProperties:a?{...i.properties,[Ee]:a}:i.properties,sendGtag:!o}),n&&_a(i?.name??e,r),Ce(e,r,`client`);let s=Ie(e,r);s&&va(s.name,s.properties,!1)}function ya(e){$(`session status`,{signed_in:e})}var ba=e({AGENT_NATIVE_EXCEPTION_EVENT_NAME:()=>qn,startSessionReplay:()=>Ki});export{Lr as a,ya as c,dn as d,sn as f,Oe as g,S as h,Fr as i,Vt as l,Mt as m,ci as n,Si as o,Pt as p,Ti as r,$ as s,ba as t,cn as u};