import{n as e,r as t}from"./chunk-DR8-3Aex.js";import{E as n,O as r,U as i,l as a,p as o,z as s}from"./debug-otxXY3j-.js";import{n as c,r as l}from"./analytics-DqMQntaB.js";var u=t({setCseShimGate:()=>d,toCompatSessionId:()=>f,toInfraSessionId:()=>p});function d(e){m=e}function f(e){return!e.startsWith(`cse_`)||m&&!m()?e:`session_`+e.slice(4)}function p(e){return e.startsWith(`session_`)?`cse_`+e.slice(8):e}var m,h=e((()=>{}));function g(e){return e.replace(w,(e,t,n)=>n.length<T?`"${t}":"[REDACTED]"`:`"${t}":"${`${n.slice(0,8)}...${n.slice(-4)}`}"`)}function _(e){let t=e.replace(/\n/g,`\\n`);return t.length<=C?t:t.slice(0,C)+`... (${t.length} chars)`}function v(e){let t=g(typeof e==`string`?e:r(e));return t.length<=C?t:t.slice(0,C)+`... (${t.length} chars)`}function y(e){let t=s(e);if(e&&typeof e==`object`&&`response`in e){let n=e.response;if(n?.data&&typeof n.data==`object`){let e=n.data,r=typeof e.message==`string`?e.message:typeof e.error==`object`&&e.error&&`message`in e.error&&typeof e.error.message==`string`?e.error.message:void 0;if(r)return`${t}: ${r}`}}return t}function b(e){if(e&&typeof e==`object`&&`response`in e&&e.response&&typeof e.response.status==`number`)return e.response.status}function x(e){if(!(!e||typeof e!=`object`)){if(`message`in e&&typeof e.message==`string`)return e.message;if(`error`in e&&e.error!==null&&typeof e.error==`object`&&`message`in e.error&&typeof e.error.message==`string`)return e.error.message}}function S(e,t,n){t&&o(t),l(`tengu_bridge_repl_skipped`,{reason:e,...n!==void 0&&{v2:n}})}var C,w,T,E=e((()=>{c(),a(),i(),n(),C=2e3,w=RegExp(`"(${[`session_ingress_token`,`environment_secret`,`access_token`,`secret`,`token`].join(`|`)})"\\s*:\\s*"([^"]*)"`,`g`),T=16}));export{b as a,h as c,f as d,p as f,x as i,u as l,_ as n,E as o,y as r,S as s,v as t,d as u};