import{u as f,_ as b,C as k,O as _}from"./index-_-ijfL1Q.js";import{m as y,j as h,k as T,h as m,o as u,w as g,a as r,n as M,l as x,f as S,T as d,B as E,u as p}from"./index-DRopsKkO.js";import{a as $,_ as A}from"./BasePage-C3DiNX0e.js";import{_ as C}from"./UCard.vue_vue_type_script_setup_true_lang-a0COP_81.js";import{_ as w}from"./UCheckbox.vue_vue_type_script_setup_true_lang-DU8e2C49.js";import"./UDivider.vue_vue_type_script_setup_true_lang-CGxguuHo.js";import"./ULabel.vue_vue_type_script_setup_true_lang-B9XE8rwf.js";const V={__name:"AnalyticsCheckbox",props:y({label:{type:String,default:""},description:{type:String,default:""}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(s){const e=h(s,"modelValue"),n=T(()=>({"border-gray-300 bg-white":!e.value,"border-brand-600 bg-brand-50":e.value}));return(c,a)=>{const i=w,t=$,l=C;return u(),m(l,{padding:"sm",class:M(n.value)},{default:g(()=>[r(i,{modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=o=>e.value=o),label:s.label},null,8,["modelValue","label"]),r(t,{size:"sm",class:"mt-2 text-gray-400",html:s.description},null,8,["html"])]),_:1},8,["class"])}}},D={__name:"Page",setup(s){const e=f(),n=x({isMixpanelTrackingEnabled:!1});S(async()=>{var t;Object.keys(e.analytics).length||await e.getAnalytics(),n.isMixpanelTrackingEnabled=(t=e.analytics)==null?void 0:t.isMixpanelTrackingEnabled,d.toggleTracking(n.isMixpanelTrackingEnabled);const i=E.getAuthAdmin();if(i&&!n.isMixpanelTrackingEnabled){const l=window.location.pathname.split("/")[1]||"";let o=`trackingOptInDismissed_${i.id}=true; path=/${l}; SameSite=Lax`;window.location.protocol==="https:"&&(o+="; Secure"),document.cookie=o}});async function c(a){var t;n.isMixpanelTrackingEnabled!==((t=e.analytics)==null?void 0:t.isMixpanelTrackingEnabled)&&(await e.updateAnalytics(n),e.analytics.isMixpanelTrackingEnabled=n.isMixpanelTrackingEnabled,d.toggleTracking(n.isMixpanelTrackingEnabled)),a()}return(a,i)=>{const t=b;return u(),m(A,{group:a.$t("group.analytics"),"group-step":p(_)*2,title:a.$t("title.analytics"),description:a.$t("description.analytics"),prev:{name:"GettingStarted/Languages/Step1"},next:{name:"GettingStarted/Company/Step1"},onContinue:c},{default:g(()=>[r(V,{modelValue:n.isMixpanelTrackingEnabled,"onUpdate:modelValue":i[0]||(i[0]=l=>n.isMixpanelTrackingEnabled=l),label:a.$t("label.allowTracking"),description:a.$t("description.tracking")},null,8,["modelValue","label","description"]),r(t,{label:a.$t("label.learnMore"),href:p(k).mixpanelLearnMore,underlined:"",target:"_blank"},null,8,["label","href"])]),_:1},8,["group","group-step","title","description"])}}};export{D as default};
