1import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{wt as t}from"./vendor-Bb9yCo9K.js";import{t as n}from"./env-CC6ipo_Q.js";import{a as r,i,o as a,r as o,t as s}from"./posthog-CWI0mxvI.js";import{t as c}from"./anonymousId-BXyuvoyU.js";import{t as l}from"./authStore-Dtvixuf6.js";var u=e(t(),1),d=`loa.webAnalytics.`,f=new Map,p=new Map,m={path:``,id:c()},h=new Map;function g(e){try{return window.sessionStorage.getItem(d+e)??h.get(e)??null}catch{return h.get(e)??null}}function _(e,t){t===null?h.delete(e):h.set(e,t);try{t===null?window.sessionStorage.removeItem(d+e):window.sessionStorage.setItem(d+e,t)}catch{}}function v(){return c()}function y(e){let t=f.get(e)??g(`flow.`+e);return t?(f.set(e,t),t):b(e)}function b(e){let t=c();return f.set(e,t),_(`flow.`+e,t),t}function x(e){f.delete(e),_(`flow.`+e,null)}function S(){f.clear(),h.clear();try{Object.keys(window.sessionStorage).filter(e=>e.startsWith(d)).forEach(e=>window.sessionStorage.removeItem(e))}catch{}}l.subscribe?.((e,t)=>{let n=t.session?.authenticated?t.account?.userDto?.guid:null,r=e.session?.authenticated?e.account?.userDto?.guid:null;t.session?.authenticated&&(!e.session?.authenticated||n&&r&&n!==r)&&(S(),s.reset?.(!0),window.dispatchEvent(new Event(`loa:analytics-identity-reset`)))});function C(){let e=Array.from(p.values()).at(-1);if(e)return e;let t=typeof window>`u`?``:window.location.pathname;return m.path!==t&&(m={path:t,id:c()}),{view_id:m.id}}function w(e,t={}){try{let u=i(n.appEnv);if(!u)return;let d=l.getState?.();if(!d)return;let f=d.session?.authenticated?d.account?.userDto?.guid??null:null,p=a({...C(),...t,event_id:c(),event_name:e,schema_version:o,occurred_at:Date.now(),user_id:f,anonymous_id:s.get_property?.(`$device_id`)??s.get_distinct_id?.()??null,session_id:s.get_session_id?.()??null,platform:`web`,environment:u,client_version:null,event_source:`client`});if(!r(e,p))return;s.capture(e,{...p,$insert_id:p.event_id,...f?{distinct_id:f}:{}},{transport:`sendBeacon`,send_instantly:!0})}catch{console.warn(`Web analytics capture failed`)}}function T(e,t={}){w(`ui_action`,{...t,action:e})}function E(e,t,n,r={}){w(`form_validation_error`,{...r,form_name:e,field_name:t,error_code:n})}function D(e,t={},n=!0,r=``){let i=(0,u.useRef)(null),a=(0,u.useRef)(Symbol(`analytics page`)),o=(0,u.useMemo)(()=>({page:e,visitKey:r,id:c()}),[e,r]).id,s=JSON.stringify(t);return(0,u.useEffect)(()=>{if(!n||!e)return;let t=a.current,r={...JSON.parse(s),page_name:e,view_id:o};p.set(t,r);let c=()=>{document.visibilityState!==`visible`||i.current===o||(i.current=o,w(`page_view`,r))};return c(),document.addEventListener(`visibilitychange`,c),()=>{p.delete(t),document.removeEventListener(`visibilitychange`,c)}},[n,e,s,o]),o}var O={custom:`custom_offer`,digital:`digital_product`,game:`gaming_affiliates`,video:`video_session`};function k(e,t,n){return{flow_id:y(`product`),product_type:O[e],operation:t,product_id:n}}function A(e,t){let n=new Intl.NumberFormat(`en`,{style:`currency`,currency:t}).resolvedOptions().maximumFractionDigits;if(n===void 0)throw Error(`Currency precision is unavailable`);return Math.round(e*10**n)}function j(e,t){let n=e+`:`+(t??`new`),r=g(`product.signature`);
1return r&&r!==n&&x(`product`),_(`product.signature`,n),_(`product.operation`,t?`update`:e===`game`?`add_games`:`publish`),_(`product.id`,t??null),y(`product`)}function M(e){let t=g(`product.operation`);return{flow_id:y(`product`),product_type:O[e],operation:t??void 0,product_id:g(`product.id`)??void 0}}function N(){return _(`product.signature`,null),_(`product.operation`,null),_(`product.id`,null),b(`product`)}function P(e){if(e?.productKind===`GAME`)return`gaming_affiliates`;if(e?.productKind===`DIGITAL_FILE`)return`digital_product`;if(e?.productKind===`SERVICE`&&(e.serviceType===`LIVE`||e.serviceType===`COHOST`))return`video_session`;if(e?.productKind===`SERVICE`&&e.serviceType===`TEXT`)return`custom_offer`}export{M as a,A as c,P as d,N as f,D as g,w as h,C as i,v as l,E as m,b as n,x as o,T as p,j as r,y as s,O as t,k as u};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.