PageSourceSearch

https://ai.backona.com/_nuxt/CWzDftVw.js

js backona.com collected 2026-10-05 07:22:27 UTC 35,031 bytes, 1 lines download raw bytes

1import{a as fe,r as Me,_ as Te}from"./Bua4uBxv.js";import{u as je,a as Le,_ as Pe,b as Fe,r as Ge,c as $}from"./DIL_zzBp.js";import{k as me,G as ne,f as be,e as xe,m as oe,o as g,c,a as t,d as le,b as l,h as n,I as W,K as ge,i as M,Y as ce,t as O,H as Qe,s as Z,r as m,q as Xe,l as pe,N as Ze,w as k,D as b,T as Q,F as ve,V as X,v as Re,p as qe,A as y,J as Y,n as K}from"./BXeVq0C2.js";import{r as He,h as Ve,u as $e,_ as Ye,a as Ke,b as _e,c as Je,d as et,e as tt,f as at,g as st}from"./DgNCqf0u.js";import"./DlAUqK2U.js";import"./BFoqbS9k.js";import"./CnZmkVXk.js";import"./DhV48wR_.js";import"./CiRgFiqe.js";import"./B-3Zvsy3.js";import"./BY7Eyptw.js";import"./BRyajKuu.js";const ye=z=>/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(z),nt={key:0,class:"py-5 sm:grid sm:grid-cols-3 sm:gap-4 items-center"},ot={class:"text-sm font-medium leading-6 text-gray-700 flex items-center"},it={class:"relative group cursor-pointer mb-3 ml-1"},rt={class:"mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0"},lt={class:"py-5 sm:grid sm:grid-cols-3 sm:gap-4 items-center"},dt={class:"text-sm font-medium leading-6 text-gray-700 flex items-center"},ut={class:"relative group cursor-pointer mb-3 ml-1"},ft={class:"mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0"},gt={class:"flex rounded-md shadow-sm ring-1 ring-inset ring-gray-300 focus-within:ring-2 focus-within:ring-inset focus-within:ring-gray-300 hover:ring-2"},ct={class:"pb-3 sm:grid sm:grid-cols-3 sm:gap-4"},pt={key:0,class:"flex items-center"},vt={class:"text-green-600 text-xs"},mt={key:1,class:"flex items-center"},bt={class:"text-red-600 text-xs"},xt={key:2,class:"flex items-center"},yt=me({__name:"UrlInput",props:Qe({integrationId:{},doNotUpdateWebsiteData:{type:Boolean},doNotShowWebsiteNameInput:{type:Boolean}},{websiteUrl:{required:!0},websiteUrlModifiers:{},websiteName:{required:!0},websiteNameModifiers:{},websiteDataConfiguredErrorMessage:{required:!0},websiteDataConfiguredErrorMessageModifiers:{},websiteDataConfigured:{type:Boolean,required:!0},websiteDataConfiguredModifiers:{}}),emits:["update:websiteUrl","update:websiteName","update:websiteDataConfiguredErrorMessage","update:websiteDataConfigured"],setup(z){const P=z,h=ne(z,"websiteUrl"),C=ne(z,"websiteName"),f=ne(z,"websiteDataConfiguredErrorMessage"),D=ne(z,"websiteDataConfigured"),{isAuthenticated:ie}=be(),{defaultMembership:_}=xe(),F=x=>x.replace(/^(https?:\/\/)/,"").replace(/\/$/,"");oe(h,x=>{P.doNotUpdateWebsiteData||(D.value=!1,f.value="",h.value=F(x),i())}),oe(C,()=>{P.doNotUpdateWebsiteData||(D.value=!1,f.value="",i())});const i=$e(async()=>{await J()},1500),J=async()=>{if(!P.doNotUpdateWebsiteData)try{const x=P.integrationId;if(!x)return;const r=(C.value||"").trim();if(r.length>100){f.value="Website name must be 100 characters or less";return}const U=F(h.value||"");if(U.length>200){f.value="Website URL must be 200 characters or less";return}if(U&&!ye(U)){f.value="Invalid website URL format";return}const T=await $fetch(`/api/settings/integrations/${x}/website`,{method:"PATCH",body:{websiteName:r,websiteUrl:U}});_.value.userOrgConfig.integrations=T.data;const A=T.data.find(N=>N._id.toString()===x);A&&(A.configActive?.length??0)>0&&!A.isCurrentConfig&&await $fetch(`/api/settings/integrations/${x}/current`,{method:"PATCH"}).then(N=>{_.value.userOrgConfig.integrations=N.data}).catch(()=>{}),D.value=!0,f.value=""}catch(x){x?.data?.statusCode===401&&(ie.value=!1,await Z("/login")),f.value=x?.data?.message}};return(x,r)=>(g(),c("div",null,[z.doNotShowWebsiteNameInput?M("",!0):(g(),c("div",nt,[t("dt",ot,[r[3]||(r[3]=le(" Website Config Name ",-1)),t("div",it,[l(n(fe),{class:"h-4 w-4 text-gray-400 hover:text-gray-500"}),r[2]||(r[2]=t("span",{class:"absolute -top-20 left-1/2 transform -translate-x-1/2 bg-white text-sky-950 text-xs px-2.5 py-1.5 rounded shadow-sm border border-cyan-600 opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none w-48 text-center"}," This setting is optional, but helps to identify which configuration was used for the chat interactions. ",-1))])]),t("dd",rt,[W(t("input",{"onUpdate:modelValue":r[0]||(r[0]=U=>C.value=U),maxlength:100,class:"block w-full rounded-md border-0 py-1.5 text-gray-700 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-300 focus:ring-2 focus:ring-inset focus:ring-gray-300 sm:text-sm sm:leading-6 hover:ring-2"},null,512),[[ge,C.value]])])])),t("div",lt,[t("dt",dt,[r[5]||(r[5]=le(" Website URL ",-1)),t("div",ut,[l(n(fe),{class:"h-4 w-4 text-gray-400 hover:text-gray-500"}),r[4]||(r[4]=t("span",{class:"absolute -top-20 left-1/2 transform -translate-x-1/2 bg-white text-sky-950 text-xs px-2.5 py-1.5 rounded shadow-sm border border-cyan-600 opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none w-48 text-center"}," Website URL that may be used by the Backona Website Analysis Tool when you enable it. ",-1))])]),t("dd",ft,[t("div",gt,[r[6]||(r[6]=t("span",{class:"flex select-none items-center pl-3 text-gray-500 sm:text-sm"},"https://",-1)),W(t("input",{"onUpdate:modelValue":r[1]||(r[1]=U=>h.value=U),maxlength:200,class:"block flex-1 border-0 bg-transparent py-1.5 pl-1 text-gray-700 placeholder:text-gray-300 focus:ring-0 sm:text-sm sm:leading-6",placeholder:"www.example.com"},null,512),[[ge,h.value]])])])]),t("div",ct,[r[8]||(r[8]=t("div",{class:"h-4 w-4"},null,-1)),D.value?(g(),c("div",pt,[W(l(n(He),{class:"h-4 w-4 text-green-500 mr-1"},null,512),[[ce,C.value||h.value]]),W(t("span",vt,"Website data saved",512),[[ce,C.value||h.value]])])):f.value?(g(),c("div",mt,[l(n(Me),{class:"h-4 w-4 text-red-500 mr-1"}),t("span",bt,O(f.value),1)])):(g(),c("div",xt,[l(n(Ve),{class:"h-3 w-3 text-gray-500 mr-1"}),r[7]||(r[7]=t("span",{class:"text-gray-500 text-xs"},"Updates in progress ...",-1))]))])]))}}),At=Object.assign(yt,{__name:"UrlInput"}),wt="data:image/webp;base64,UklGRlYKAABXRUJQVlA4WAoAAAAYAAAAgwAALwAAQUxQSGoEAAABb8KgbSNJm35z/EEfhojIBw7CuNviim39lgbHlev07lIJh2Izaz2QEn5gbdu2K7GbK3lZ0QjoJLgdDdHgDmXSidNG6iZGbM2izv3/fxCga9Duv0T0fwL4F/yrTw/rz3+cVdrz+S8PqRKr9H/9phxWs16ike7wp6JW0MjYQStTDZ6vchR9kWDyZXSXRV1NMr5WmbbmH2dSVaHtVx6Jo3XmVWcLmKj7cTSbQCTnkbBLLbBOidrAm5wc2yoytlVgbCsn9wrLNo8glActjTUDc94BZpIoXbmZl3GidFEFauFZWnvAbsc4SZUkVXh6k46jB/CsIczkxlvwFAKvehnM0n0NR+lxOoq1AtZa+PP05EKS0Ao2mgUWT6dk7K81vj9XL7DdMpaDr2foKgQGGuEoccGs1aSuV8DXOAciOcA6fQKzOdfujsMRV1Oa6rOUCy+qA1W94SgC6GqMo00VKg3nOlevAIE697dQva8mJonYH4Ctomy6K2poAXOdooEN17W1jaIoijW4v4GeXxIDUeJqARzTOPe1yFUEtJdHpXNzXU/7OLeb95kSv99S1/y0BJ410QDYng35BU3NyfXeNLyurSnFmT/K9PkWjgf1AFsH1YFQ3Uwts85M1WcQt4EnLa+rpVuTsQtUJt0USTbARkeARnpsQfsQ4EizCp1zUqOl2MVMNS6YqwPMtaxRnR+dBzDUmuxUUYbuWcdEWwdHcaKT0i4wlvZnxbWCjnR2s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ADT5ZWjQDwRcDfVar+Vg6+t2CyM3KLKDFvXDnXZCDkDlERzHoDX5fyfl8HsEPavbRmnFxJr5HccnFmFk+cHuK5ZGtUcSAfYagi6or0GLf8ymCbqitCM8hdJa9FAh9UIBtgUlpk93qos/4vqEwaAmmDlN7QUUEk7Wu3/gNDdgmXhjvD28U+YtuWqZ+II1vtDI4IRN5wt6BErfFfTeqWXijyw0ptwD1AJV68y27XvmLfeR2ULH6opTnY9bKeHX6yMNxGsPx8hGwU0uNFYN2bjgHIoAABFWElG1gAAAElJKgAIAAAABgASAQMAAQAAAAEAAAAaAQUAAQAAAFYAAAAbAQUAAQAAAF4AAAAoAQMAAQAAAAIAAAAxAQIAEAAAAGYAAABphwQAAQAAAHYAAAAAAAAAYAAAAAEAAABgAAAAAQAAAFBhaW50Lk5FVCA1LjEuMgAFAACQBwAEAAAAMDIzMAGgAwABAAAAAQAAAAKgBAABAAAAhAAAAAOgBAABAAAAMAAAAAWgBAABAAAAuAAAAAAAAAACAAEAAgAEAAAAUjk4AAIABwAEAAAAMDEwMAAAAAA=",ht={class:"pt-6 pb-40 px-4 sm:px-8 lg:px-8 2xl:col-start-2 2xl:col-span-4"},Ct=["onClick"],Ut={class:"relative group"},St={class:"relative text-sm text-gray-500 p-4 flex-1 space-y-1"},kt={key:0,class:"py-8 text-center"},Dt=["disabled"],Nt={key:0,class:"flex items-center justify-center"},Et={key:1},zt={key:"loading",class:"flex justify-center py-8"},Ot={key:"settings-content"},Wt={class:"pb-6 border-b border-gray-200"},It={key:0,class:"mt-4 max-w-2xl text-sm leading-6 text-gray-400"},Bt={class:"text-sm font-medium"},Mt={class:"absolute -top-8 left-1/2 transform -translate-x-1/2 bg-white text-sky-950 text-xs px-2.5 py-1 rounded shadow-sm border border-cyan-600 opacity-0 group-hover:opacity-100 transition-opacity duration-200 whitespace-nowrap pointer-events-none"},Tt={class:"pb-2 border-b border-gray-200"},jt={class:"flex flex-col sm:flex-row items-start sm:items-center gap-x-8 gap-y-4"},Lt={class:"flex flex-col min-w-0 gap-y-4"},Pt={class:"ms-3 text-sm font-medium text-gray-700"},Ft={key:0,class:"py-5"},Gt={class:"flex flex-col sm:flex-row items-start sm:items-center gap-x-8 gap-y-4"},Qt={class:"flex flex-col min-w-0 gap-y-4"},Xt={class:"ms-3 text-sm font-medium text-gray-700"},Zt={key:0,class:"py-5"},Rt={class:"flex flex-col sm:flex-row items-start sm:items-center gap-x-8 gap-y-4"},qt={class:"flex flex-col min-w-0 gap-y-4"},Ht={class:"ms-3 text-sm font-medium text-gray-700"},Vt={key:0,class:"py-5"},$t={class:"flex flex-col sm:flex-row items-start sm:items-center gap-x-8 gap-y-4"},Yt={class:"flex flex-col min-w-0 gap-y-4"},Kt={class:"ms-3 text-sm font-medium text-gray-700"},_t={key:0,class:"py-5"},Jt={class:"flex flex-col sm:flex-row items-start sm:items-center gap-x-8 gap-y-4"},ea={class:"flex flex-col min-w-0 gap-y-4"},ta={class:"ms-3 text-sm font-medium text-gray-700"},aa={key:0,class:"py-5"},ma=me({__name:"settings",emits:["isRightSideNavigationOpen"],setup(z,{emit:P}){const{userObject:h,isAuthenticated:C}=be(),{defaultMembership:f,organizationName:D,organizationNameBackgroundColor:ie,isOwnerOfCurrentOrg:_,isCurrentOrganizationConfigured:F}=xe(),i=m(f.value?.userOrgConfig?.integrations??[]),J=a=>!!(a.isCurrentConfig||i.value.length===1),x=Xe(),r=x.query.open,U=["fad","ads","seo","ga4","gsc"],T=x.query.id,A=m(!r),N=m({seo:null,ga4:null,gsc:null,ads:null,fad:null}),v=m(i.value.find(a=>a._id.toString()===T)?._id?.toString()??i.value.find(a=>a.isCurrentConfig)?._id?.toString()??i.value[0]?._id?.toString()),o=m(i.value.find(a=>a._id.toString()===T)?.configActive??i.value.find(a=>a.isCurrentConfig)?.configActive??i.value[0]?.configActive??[]),w=m(i.value.find(a=>a._id.toString()===T)?.websiteUrl??i.value.find(a=>a.isCurrentConfig)?.websiteUrl??i.value[0]?.websiteUrl??""),S=m(i.value.find(a=>a._id.toString()===T)?.websiteName??i.value.find(a=>a.isCurrentConfig)?.websiteName??i.value[0]?.websiteName??""),G=m(""),j=m(!0),I=m(!1),R=m(!1),u=m(r&&U.includes(r)?new Set([r]):new Set),Ae=async a=>{await X(),setTimeout(()=>{const e=N.value[a];if(e){const p=e.getBoundingClientRect().top+window.scrollY-40;window.scrollTo({top:p,behavior:"smooth"})}},350)};pe(()=>{r&&U.includes(r)&&Ae(r)});const E=a=>{u.value.has(a)?u.value.delete(a):u.value.add(a),u.value=new Set(u.value)},we=(a,e)=>{typeof window>"u"||(window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:e?"integration_enabled":"integration_disabled",integration_tool:a}))},q=(a,e)=>{const p=e?.target?.checked??!1;we(a,p)}
1,he=a=>{a&&o.value.includes("ga4")&&(o.value.splice(o.value.indexOf("ga4"),1),B())},Ce=a=>{a&&o.value.includes("gsc")&&(o.value.splice(o.value.indexOf("gsc"),1),B())},Ue=a=>{a&&o.value.includes("ads")&&(o.value.splice(o.value.indexOf("ads"),1),B())},Se=a=>{a&&o.value.includes("fad")&&(o.value.splice(o.value.indexOf("fad"),1),B())},ke=()=>{o.value.includes("fad")&&(o.value.splice(o.value.indexOf("fad"),1),B())};je(()=>{I.value=!0;const a=f.value?.userOrgConfig?.integrations?.find(e=>e.isCurrentConfig)??f.value?.userOrgConfig?.integrations?.[0];a&&(i.value=f.value?.userOrgConfig?.integrations??[],o.value=a.configActive??[],w.value=a.websiteUrl??"",S.value=a.websiteName??"",v.value=a._id?.toString(),A.value=i.value.length>1,X(()=>{I.value=!1}))}),oe(o,a=>{const e=f.value?.userOrgConfig?.integrations?.find(p=>p._id.toString()===v.value);let d=!1;a.includes("seo")&&(!w.value||!ye(w.value))&&(o.value.splice(o.value.indexOf("seo"),1),u.value.add("seo"),d=!0),a.includes("ga4")&&(!e?.google?.ga4?.ga4Settings?.propertyId||h.value?.userSettings?.integrations?.google?.hasAnalyticsGa4Scope===!1)&&(o.value.splice(o.value.indexOf("ga4"),1),u.value.add("ga4"),d=!0),a.includes("gsc")&&(!e?.google?.gsc?.gscSettings?.gscWebsiteDomainOrUrlPrefix||h.value?.userSettings?.integrations?.google?.hasSearchConsoleScope===!1)&&(o.value.splice(o.value.indexOf("gsc"),1),u.value.add("gsc"),d=!0),a.includes("ads")&&(!e?.google?.ads?.adsSettings?.id||h.value?.userSettings?.integrations?.google?.hasGoogleAdsScope===!1)&&(o.value.splice(o.value.indexOf("ads"),1),u.value.add("ads"),d=!0),a.includes("fad")&&(!e?.facebook?.fad?.fadSettings?.id||h.value?.userSettings?.integrations?.facebook?.hasFacebookAdsScope===!1)&&(o.value.splice(o.value.indexOf("fad"),1),u.value.add("fad"),d=!0),a.length>0&&!F.value&&(R.value=!0),!I.value&&!L.value&&!V.value&&!d&&B()}),oe(w,a=>{a===""&&j.value&&o.value.includes("seo")&&(o.value.splice(o.value.indexOf("seo"),1),B())}),Ze(()=>{i.value=f.value.userOrgConfig.integrations});const ee=(a,e)=>{e&&(a==="ga4"?o.value.includes("ga4")||o.value.push("ga4"):a==="gsc"?o.value.includes("gsc")||o.value.push("gsc"):a==="ads"?o.value.includes("ads")||o.value.push("ads"):a==="fad"&&(o.value.includes("fad")||o.value.push("fad")),B(),F.value||(R.value=!0))},B=async()=>{try{const a=await $fetch(`/api/settings/integrations/${v.value}/config`,{method:"PATCH",body:{configActive:o.value}});f.value.userOrgConfig.integrations=a.data,i.value=a.data;const e=a.data.find(d=>d._id.toString()===v.value)?.isCurrentConfig;o.value.length>0&&!e&&await de(v.value??"")}catch(a){a?.data?.statusCode===401&&(C.value=!1,await Z("/login")),console.error("Error saving GA4 configuration:",a)}},{isSmallerThan:H}=Le("lg");pe(()=>{H.value&&A.value&&setTimeout(()=>{A.value=!1},2e3)});const De=a=>{I.value=!0,v.value=a,o.value=i.value.find(e=>e._id.toString()===a)?.configActive??[],w.value=i.value.find(e=>e._id.toString()===a)?.websiteUrl??"",S.value=i.value.find(e=>e._id.toString()===a)?.websiteName??"",X(()=>{I.value=!1,H.value&&setTimeout(()=>{A.value=!1},300)})},V=m(!1),te=m(!1),Ne=async a=>{V.value=!0;try{const e=await $fetch(`/api/settings/integrations/${a}/config`,{method:"DELETE"});te.value=!0;const d=i.value.findIndex(p=>p._id.toString()===a);if(f.value.userOrgConfig.integrations=e.data,i.value=e.data,v.value===a){const p=i.value[d]||i.value[d-1]||i.value[0];v.value=p?._id?.toString()??"",o.value=p?.configActive??[],w.value=p?.websiteUrl??"",S.value=p?.websiteName??""}}catch(e){e?.data?.statusCode===401&&(C.value=!1,await Z("/login")),console.error("Error deleting integration:",e)}finally{X(()=>{V.value=!1,H.value&&setTimeout(()=>{A.value=!1},300)})}},ae=m(!1),se=m(!1),de=async a=>{try{if(i.value.find(p=>p._id.toString()===a)?.configActive?.length===0){se.value=!0;return}ae.value=!0;const e=await $fetch(`/api/settings/integrations/${a}/current`,{method:"PATCH"});f.value.userOrgConfig.integrations=e.data,i.value=e.data,v.value=a;const d=i.value.find(p=>p._id.toString()===a);d&&(o.value=d.configActive??[],w.value=d.websiteUrl??"",S.value=d.websiteName??"")}catch(e){e?.data?.statusCode===401&&(C.value=!1,await Z("/login")),console.error("Error updating current configuration:",e)}finally{X(()=>{ae.value=!1,H.value&&setTimeout(()=>{A.value=!1},300)})}},L=m(!1),Ee=async()=>{L.value=!0;try{const a=await $fetch("/api/settings/integrations/config",{method:"POST",body:{}});f.value.userOrgConfig.integrations=a.data,i.value=a.data,v.value=a.data[a.data.length-1]?._id?.toString()??"",o.value=a.data[a.data.length-1]?.configActive??[],w.value=a.data[a.data.length-1]?.websiteUrl??"",S.value=a.data[a.data.length-1]?.websiteName??""}catch(a){a?.data?.statusCode===401&&(C.value=!1,await Z("/login")),console.error("Error creating new configuration:",a)}finally{X(()=>{L.value=!1,H.value&&setTimeout(()=>{A.value=!1},300)})}};return(a,e)=>
1{const d=Te,p=Fe,ze=Pe,ue=At,Oe=Ke,We=Je,Ie=tt,Be=st;return g(),c(ve,null,[l(d,{show:n(te),"onUpdate:show":e[0]||(e[0]=s=>b(te)?te.value=s:null),variant:"success"},{default:k(()=>[...e[43]||(e[43]=[t("p",null,[t("b",null,"Configuration deleted!")],-1),t("br",null,null,-1),t("p",null,"You can add it again anytime.",-1)])]),_:1},8,["show"]),l(d,{show:n(se),"onUpdate:show":e[1]||(e[1]=s=>b(se)?se.value=s:null),variant:"error"},{default:k(()=>[...e[44]||(e[44]=[t("p",null,[t("b",null,"Cannot choose this configuration because no tools are enabled for it!")],-1),t("br",null,null,-1),t("p",null,"Enable at least one integration for this configuration.",-1)])]),_:1},8,["show"]),l(d,{show:n(R),"onUpdate:show":e[3]||(e[3]=s=>b(R)?R.value=s:null),variant:"success"},{default:k(()=>[e[45]||(e[45]=t("p",null,[t("b",null,"Configuration enabled!")],-1)),e[46]||(e[46]=t("p",{class:"mt-1 text-sm text-gray-500"},"Now you can use the chat.",-1)),t("button",{onClick:e[2]||(e[2]=s=>("navigateTo"in a?a.navigateTo:n(Z))("/app/chat")),class:"my-5 focus:outline-none inline-flex w-full justify-center rounded-md bg-sky-200 px-3 py-2 text-sm font-semibold text-cyan-600 shadow-sm ring-1 ring-inset ring-cyan-600 hover:ring-2 sm:col-start-2"}," Go to Chat ")]),_:1},8,["show"]),t("div",ht,[l(ze,{open:n(A),"onUpdate:open":e[4]||(e[4]=s=>b(A)?A.value=s:null),onIsRightSideNavigationOpen:e[5]||(e[5]=s=>a.$emit("isRightSideNavigationOpen",s))},{rightSideNavigationOpenButton:k(({openDrawer:s})=>[t("button",{onClick:re=>s(),class:"fixed z-10 top-16 right-4 text-gray-400 hover:text-gray-500 bg-gray-100 2xl:bg-transparent drop-shadow rounded-full p-0.5",title:"Open Saved Configurations Management"},[t("div",Ut,[l(n(Ge),{class:"h-8 w-8"}),e[47]||(e[47]=t("span",{class:"absolute top-8 right-0 bg-white text-sky-950 text-xs px-2.5 py-1 rounded shadow-sm border border-cyan-600 opacity-0 group-hover:opacity-100 transition-opacity duration-200 whitespace-nowrap pointer-events-none"}," Open Saved Configurations Management ",-1))])],8,Ct)]),default:k(()=>[e[49]||(e[49]=t("div",{class:"px-6 pt-6"},[t("p",{class:"text-base font-semibold text-gray-700"},"Saved Configurations")],-1)),t("div",St,[(g(!0),c(ve,null,Re(n(i),s=>(g(),c("div",{key:s._id.toString()},[l(p,{text:s.websiteName||"Untitled Website Config",subtitle:s.websiteUrl?`https:// ${s.websiteUrl}`:"",isSelected:s._id.toString()===n(v),showDeleteAction:n(i).length>1&&!J(s),showFavoriteAction:!0,isFavorite:J(s),onToggleFavorite:re=>de(s._id.toString()),onDelete:re=>Ne(s._id.toString()),onClick:re=>De(s._id.toString())},null,8,["text","subtitle","isSelected","showDeleteAction","isFavorite","onToggleFavorite","onDelete","onClick"])]))),128)),n(F)?(g(),c("div",kt,[t("button",{onClick:Ee,disabled:n(L),class:"text-sm text-gray-300 hover:text-gray-400 transition-colors"},[n(L)?(g(),c("span",Nt,[...e[48]||(e[48]=[t("div",{class:"animate-spin inline-block size-4 border border-current border-t-transparent text-gray-400 rounded-full mr-2",role:"status","aria-label":"loading"},null,-1),le(" Creating... ",-1)])])):(g(),c("span",Et," + Add Configuration "))],8,Dt)])):M("",!0)])]),_:1},8,["open"]),l(Q,{"enter-active-class":"transition ease-out duration-300","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition ease-in duration-200","leave-from-class":"opacity-100","leave-to-class":"opacity-0",mode:"out-in"},{default:k(()=>[n(I)?(g(),c("div",zt,[...e[50]||(e[50]=[t("div",{class:"animate-spin inline-block size-6 border border-current border-t-transparent text-gray-400 rounded-full",role:"status","aria-label":"loading"},[t("span",{class:"sr-only"},"Loading...")],-1)])])):(g(),c("div",Ot,[t("div",Wt,[e[52]||(e[52]=t("h3",{class:"text-base font-semibold leading-7 text-gray-700"},"Integration Settings",-1)),e[53]||(e[53]=t("p",{class:"mt-1 max-w-2xl text-sm leading-6 text-gray-400"},"To start using the chat, please set up and enable at least one integration.",-1)),n(_)()?M("",!0):(g(),c("div",It,[e[51]||(e[51]=t("span",null,"You are managing your settings in",-1)),t("span",{class:"inline-flex items-center justify-center size-8 rounded-full text-gray-700 mx-2 relative group cursor-pointer",style:qe({backgroundColor:n(ie)})},[t("span",Bt,O(n(D)?n(D).charAt(0).toUpperCase():"?"),1),t("span",Mt,O(n(D)||"Organization"),1)],4),t("span",null,O(n(D)?n(D):"Organization")+".",1)]))]),t("div",Tt,[l(ue,{websiteUrl:n(w),"onUpdate:websiteUrl":e[6]||(e[6]=s=>b(w)?w.value=s:null),websiteName:n(S),"onUpdate:websiteName":e[7]||
1(e[7]=s=>b(S)?S.value=s:null),websiteDataConfiguredErrorMessage:n(G),"onUpdate:websiteDataConfiguredErrorMessage":e[8]||(e[8]=s=>b(G)?G.value=s:null),websiteDataConfigured:n(j),"onUpdate:websiteDataConfigured":e[9]||(e[9]=s=>b(j)?j.value=s:null),integrationId:n(v),doNotUpdateWebsiteData:n(I)||n(L)||n(V)||n(ae)||n(u).has("seo")},null,8,["websiteUrl","websiteName","websiteDataConfiguredErrorMessage","websiteDataConfigured","integrationId","doNotUpdateWebsiteData"])]),t("div",{class:"border-b border-gray-200",ref:s=>n(N).seo=s},[t("div",{onClick:e[14]||(e[14]=s=>E("seo")),class:"flex justify-between items-end w-full py-5 font-medium rtl:text-right text-gray-500 gap-3 cursor-pointer"},[t("div",jt,[e[56]||(e[56]=t("div",{class:"size-20 flex items-center justify-center flex-none rounded-full bg-gray-100"},[t("img",{class:"p-2",src:wt,alt:"Website Analysis"})],-1)),t("div",Lt,[e[55]||(e[55]=t("div",{class:"text-left"},[t("h3",{class:"text-base font-semibold leading-7 text-gray-700"},"Backona Website Analysis Tool"),t("p",{class:"mt-1 max-w-2xl text-sm font-normal leading-6 text-gray-400"},"Our custom connector analyzes your website content for SEO and AI optimization.")],-1)),t("label",{class:"inline-flex items-center cursor-pointer w-32",onClick:e[12]||(e[12]=y(()=>{},["stop"]))},[W(t("input",{type:"checkbox","onUpdate:modelValue":e[10]||(e[10]=s=>b(o)?o.value=s:null),value:"seo",class:"sr-only peer",onChange:e[11]||(e[11]=y(s=>q("seo",s),["stop"]))},null,544),[[Y,n(o)]]),e[54]||(e[54]=t("div",{class:"relative w-11 h-6 bg-gray-100 rounded-full peer peer-focus:ring-1 peer-focus:ring-cyan-600 peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:start-[2px] after:bg-white after:border-cyan-600 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-cyan-600"},null,-1)),t("span",Pt,O(n(o).includes("seo")?"Enabled":"Disabled"),1)])])]),t("button",{onClick:e[13]||(e[13]=y(s=>E("seo"),["stop"])),class:"flex items-center justify-center size-8"},[l(n($),{class:K(["size-10 flex-none text-gray-400 hover:text-gray-500 transition-transform duration-200",{"rotate-180":n(u).has("seo")}]),"aria-hidden":"true"},null,8,["class"])])]),l(Q,{"enter-active-class":"transition-all duration-300 ease-in-out","enter-from-class":"opacity-0 max-h-0 overflow-hidden","enter-to-class":"opacity-100 max-h-96 overflow-hidden","leave-active-class":"transition-all duration-300 ease-in-out","leave-from-class":"opacity-100 max-h-96 overflow-hidden","leave-to-class":"opacity-0 max-h-0 overflow-hidden"},{default:k(()=>[n(u).has("seo")?(g(),c("div",Ft,[l(ue,{websiteUrl:n(w),"onUpdate:websiteUrl":e[15]||(e[15]=s=>b(w)?w.value=s:null),websiteName:n(S),"onUpdate:websiteName":e[16
1]||(e[16]=s=>b(S)?S.value=s:null),websiteDataConfiguredErrorMessage:n(G),"onUpdate:websiteDataConfiguredErrorMessage":e[17]||(e[17]=s=>b(G)?G.value=s:null),websiteDataConfigured:n(j),"onUpdate:websiteDataConfigured":e[18]||(e[18]=s=>b(j)?j.value=s:null),integrationId:n(v),doNotUpdateWebsiteData:n(I)||n(L)||n(V)||n(ae),doNotShowWebsiteNameInput:!0},null,8,["websiteUrl","websiteName","websiteDataConfiguredErrorMessage","websiteDataConfigured","integrationId","doNotUpdateWebsiteData"])])):M("",!0)]),_:1})],512),t("div",{class:"border-b border-gray-200",ref:s=>n(N).ga4=s},[t("div",{onClick:e[23]||(e[23]=s=>E("ga4")),class:"flex justify-between items-end w-full py-5 font-medium rtl:text-right text-gray-500 gap-3 cursor-pointer"},[t("div",Gt,[e[59]||(e[59]=t("div",{class:"size-20 flex items-center justify-center flex-none rounded-full bg-gray-100"},[t("img",{class:"p-2",src:Ye,alt:"Google Analytics 4"})],-1)),t("div",Qt,[e[58]||(e[58]=t("div",{class:"text-left"},[t("h3",{class:"text-base font-semibold leading-7 text-gray-700"},"Google Analytics 4"),t("p",{class:"mt-1 max-w-2xl text-sm font-normal leading-6 text-gray-400"},"Use your Google Analytics 4 account to integrate with the chat tool.")],-1)),t("label",{class:"inline-flex items-center cursor-pointer w-32",onClick:e[21]||(e[21]=y(()=>{},["stop"]))},[W(t("input",{type:"checkbox","onUpdate:modelValue":e[19]||(e[19]=s=>b(o)?o.value=s:null),value:"ga4",class:"sr-only peer",onChange:e[20]||(e[20]=y(s=>q("ga4",s),["stop"]))},null,544),[[Y,n(o)]]),e[57]||(e[57]=t("div",{class:"relative w-11 h-6 bg-gray-100 rounded-full peer peer-focus:ring-1 peer-focus:ring-cyan-600 peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:start-[2px] after:bg-white after:border-cyan-600 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-cyan-600"},null,-1)),t("span",Xt,O(n(o).includes("ga4")?"Enabled":"Disabled"),1)])])]),t("button",{onClick:e[22]||(e[22]=y(s=>E("ga4"),["stop"])),class:"flex items-center justify-center size-8"},[l(n($),{class:K(["size-10 flex-none text-gray-400 hover:text-gray-500 transition-transform duration-200",{"rotate-180":n(u).has("ga4")}]),"aria-hidden":"true"},null,8,["class"])])]),l(Q,{"enter-active-class":"transition-all duration-300 ease-in-out","enter-from-class":"opacity-0 max-h-0 overflow-hidden","enter-to-class":"opacity-100 max-h-96 overflow-hidden","leave-active-class":"transition-all duration-300 ease-in-out","leave-from-class":"opacity-100 max-h-96 overflow-hidden","leave-to-class":"opacity-0 max-h-0 overflow-hidden"},{default:k(()=>[n(u).has("ga4")?(g(),c("div",Zt,[l(Oe,{onHasNoGa4:he,onConfigUpdate:e[24]||(e[24]=s=>ee("ga4",s)),integrationId:n(v)},null,8,["integrationId"])])):M("",!0)]),_:1})],512),t("div",{class:"border-b border-gray-200",ref:s=>n(N).gsc=s},[t("div",{onClick:e[29]||(e[29]=s=>E("gsc")),class:"flex justify-between items-end w-full py-5 font-medium rtl:text-right text-gray-500 gap-3 cursor-pointer"},[t("div",Rt,[e[62]||(e[62]=t("div",{class:"size-20 flex items-center justify-center flex-none rounded-full bg-gray-100"},[t("img",{class:"p-2",src:_e,alt:"Google Search Console"})],-1)),t("div",qt,[e[61]||(e[61]=t("div",{class:"text-left"},[t("h3",{class:"text-base font-semibold leading-7 text-gray-700"},"Google Search Console"),t("p",{class:"mt-1 max-w-2xl text-sm font-normal leading-6 text-gray-400"},"Use your Google Search Console account to integrate with the chat tool.")],-1)),t("label",{class:"inline-flex items-center cursor-pointer w-32",onClick:e[27]||(e[27]=y(()=>{},["stop"]))},[W(t("input",{type:"checkbox","onUpdate:modelValue":e[25]||(e[25]=s=>b(o)?o.value=s:null),value:"gsc",class:"sr-only peer",onChange:e[26]||(e[26]=y(s=>q("gsc",s),["stop"]))},null,544),[[Y,n(o)]]),e[60]||(e[60]=t("div",{class:"relative w-11 h-6 bg-gray-100 rounded-full peer peer-focus:ring-1 peer-focus:ring-cyan-600 peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:start-[2px] after:bg-white after:border-cyan-600 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-cyan-600"},null,-1)),t("span",Ht,O(n(o).includes("gsc")?"Enabled":"Disabled"),1)])])]),t("button",{onClick:e[28]||(e[28]=y(s=>E("gsc"),["stop"])),class:"flex items-center justify-center size-8"},[l(n($),{class:K(["size-10 flex-none text-gray-400 hover:text-gray-500 transition-transform duration-200",{"rotate-180":n(u).has("gsc")}]),"aria-hidden":"true"},null,8,["class"])])]),l(Q,{"enter-active-class":"transition-all duration-300 ease-in-out","enter-from-class":"opacity-0 max-h-0 overflow-hidden","enter-to-class":"opacity-100 max-h-96 overflow-hidden","leave-active-class":"transition-all duration-300 ease-in-out","leave-from-class":"opacity-100 max-h-96 overflow-hidden","leave-to-class":"opacity-0 max-h-0 overflow-hidden"},{default:k(()=>[n(u).has("gsc")?(g(),c("div",Vt,[l(We,{onHasNoGsc:Ce,onConfigUpdate:e[30]||(e[30]=s=>ee("gsc",s)),integrationId:n(v)},null,8,["integrationId"])])):M("",!0)]),_:1})],512),t("div",{class:"border-b border-gray-200",ref:s=>n(N).ads=s},[t("div",{onClick:e[35]||(e[35]=s=>E("ads")),class:"flex justify-between items-end w-full py-5 font-medium rtl:text-right text-gray-500 gap-3 cursor-pointer"},[t("div",$t,[e[65]||(e[65]=t("div",{class:"size-20 flex items-center justify-center flex-none rounded-full bg-gray-100"},[t("img",{class:"p-2",src:et,alt:"Google Ads"})],-1)),t("div",Yt,[e[64]||(e[64]=t("div",{class:"text-left"},[t("h3",{class:"text-base font-semibold leading-7 text-gray-700"},"Google Ads"),t("p",{class:"mt-1 max-w-2xl text-sm font-normal leading-6 text-gray-400"},"Use your Google Ads account to integrate with the chat tool.")],-1)),t("label",{class:"inline-flex items-center cursor-pointer w-32",onClick:e[33]||(e[33]=y(()=>{},["stop"]))},[W(t("input",{type:"checkbox","onUpdate:modelValue":e[31]||(e[31]=s=>b(o)?o.value=s:null),value:"ads",class:"sr-only peer",onChange:e[32]||(e[32]=y(s=>q("ads",s),["stop"]))},null,544),[[Y,n(o)]]),e[63]||(e[63]=t("div",{class:"relative w-11 h-6 bg-gray-100 rounded-full peer peer-focus:ring-1 peer-focus:ring-cyan-600 peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:start-[2px] after:bg-white after:border-cyan-600 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-cyan-600"},null,-1)),t("span",Kt,O(n(o).includes("ads")?"Enabled":"Disabled"),1)])])]),t("button",{onClick:e[34]||(e[34]=y(s=>E("ads"),["stop"])),class:"flex items-center justify-center size-8"},[l(n($),{class:K(["size-10 flex-none text-gray-400 hover:text-gray-500 transition-transform duration-200",{"rotate-180":n(u).has("ads")}]),"aria-hidden":"true"},null,8,["class"])])]),l(Q,{"enter-active-class":"transition-all duration-300 ease-in-out","enter-from-class":"opacity-0 max-h-0 overflow-hidden","enter-to-class":"opacity-100 max-h-96 overflow-hidden","leave-active-class":"transition-all duration-300 ease-in-out","leave-from-class":"opacity-100 max-h-96 overflow-hidden","leave-to-class":"opacity-0 max-h-0 overflow-hidden"},{default:k(()=>[n(u).has("ads")?(g(),c("div",_t,[l(Ie,{onHasNoAds:Ue,onConfigUpdate:e[36]||(e[36]=s=>ee("ads",s)),integrationId:n(v)},null,8,["integrationId"])])):M("",!0)]),_:1})],512),t("div",{class:"border-b border-gray-200",ref:s=>n(N).fad=s},[t("div",{onClick:e[41]||(e[41]=s=>E("fad")),class:"flex justify-between items-end w-full py-5 font-medium rtl:text-right text-gray-500 gap-3 cursor-pointer"},[t("div",Jt,[e[68]||(e[68]=t("div",{class:"size-20 flex items-center justify-center flex-none rounded-full bg-gray-100"},[t("img",{class:"p-2",src:at,alt:"Facebook Ads"})],-1)),t("div",ea,[e[67]||(e[67]=t("div",{class:"text-left"},[t("h3",{class:"text-base font-semibold leading-7 text-gray-700"},"Facebook Ads"),t("p",{class:"mt-1 max-w-2xl text-sm font-normal leading-6 text-gray-400"}
1,"Use your Facebook Ads Advertising account to integrate with the chat tool.")],-1)),t("label",{class:"inline-flex items-center cursor-pointer w-32",onClick:e[39]||(e[39]=y(()=>{},["stop"]))},[W(t("input",{type:"checkbox","onUpdate:modelValue":e[37]||(e[37]=s=>b(o)?o.value=s:null),value:"fad",class:"sr-only peer",onChange:e[38]||(e[38]=y(s=>q("fad",s),["stop"]))},null,544),[[Y,n(o)]]),e[66]||(e[66]=t("div",{class:"relative w-11 h-6 bg-gray-100 rounded-full peer peer-focus:ring-1 peer-focus:ring-cyan-600 peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:start-[2px] after:bg-white after:border-cyan-600 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-cyan-600"},null,-1)),t("span",ta,O(n(o).includes("fad")?"Enabled":"Disabled"),1)])])]),t("button",{onClick:e[40]||(e[40]=y(s=>E("fad"),["stop"])),class:"flex items-center justify-center size-8"},[l(n($),{class:K(["size-10 flex-none text-gray-400 hover:text-gray-500 transition-transform duration-200",{"rotate-180":n(u).has("fad")}]),"aria-hidden":"true"},null,8,["class"])])]),l(Q,{"enter-active-class":"transition-all duration-300 ease-in-out","enter-from-class":"opacity-0 max-h-0 overflow-hidden","enter-to-class":"opacity-100 max-h-96 overflow-hidden","leave-active-class":"transition-all duration-300 ease-in-out","leave-from-class":"opacity-100 max-h-96 overflow-hidden","leave-to-class":"opacity-0 max-h-0 overflow-hidden"},{default:k(()=>[n(u).has("fad")?(g(),c("div",aa,[l(Be,{onHasNoFad:Se,onConfigUpdate:e[42]||(e[42]=s=>ee("fad",s)),onDisconnected:ke,integrationId:n(v)},null,8,["integrationId"])])):M("",!0)]),_:1})],512)]))]),_:1})])],64)}}});export{ma as default};

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.