import{a as A}from"./asyncComputed.c6a51599.js";import"./gateway.e3e12758.js";import{d as _,r as I,R as C,K as f,b as g,c as P,w as a,u as e,f as t,ar as s,cR as j,cP as B,cQ as i,e as m,eG as b,cj as E,bx as D,ci as F,eC as R,eu as T,ew as x}from"./vue-router.67809441.js";import"./index.faf1d629.js";import{P as h}from"./project.ba35830e.js";import{S as N}from"./SaveButton.9b9a790f.js";import{a as v}from"./router.f4c6c59f.js";import{A as U}from"./index.31900902.js";import"./popupNotifcation.c8631a6a.js";import"./record.79dce665.js";import"./string.d96a9f97.js";import"./ExclamationCircleOutlined.03b62ec5.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},r=new Error().stack;r&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[r]="7b19d38b-85ac-4aa6-a188-72fcf2fb9e45",n._sentryDebugIdIdentifier="sentry-dbid-7b19d38b-85ac-4aa6-a188-72fcf2fb9e45")}catch{}})();const V=_({__name:"SubdomainEditor",props:{project:{}},setup(n){const r=n,o=I(void 0),u=C.exports.debounce(async()=>{try{const{available:l}=await r.project.checkSubdomain();o.value=l?"available":"unavailable"}catch{o.value=void 0}},500);function d(){r.project.subdomain?(o.value="loading",u()):o.value="invalid"}const c=f(()=>{switch(o.value){case"invalid":return"error";case"loading":return"validating";case"available":return"success";case"unavailable":return"error";default:return}}),y=f(()=>{switch(o.value){case"loading":return"Checking availability...";case"available":return"Available";case"unavailable":return"Unavailable";case"invalid":return"Invalid subdomain";default:return}}),k=()=>{r.project.subdomain=h.formatSubdomain(r.project.subdomain),d()};function w(){r.project.resetChanges(),o.value=void 0}return(l,p)=>(g(),P(e(U),{direction:"vertical"},{default:a(()=>[t(e(j),{level:2},{default:a(()=>[s("Subdomain")]),_:1}),t(e(B),null,{default:a(()=>[s(" Every project in Abstra Cloud comes with a default subdomain, which will appear on all shared project links. ")]),_:1}),t(e(v),null,{default:a(()=>[t(e(i),null,{default:a(()=>[s("Forms available at:")]),_:1}),t(e(i),{code:""},{default:a(()=>[m("span",null,b(l.project.getUrl("[PATH]")),1)]),_:1})]),_:1}),t(e(v),null,{default:a(()=>[t(e(i),null,{default:a(()=>[s("Hooks available at:")]),_:1}),t(e(i),{code:""},{default:a(()=>[m("span",null,b(l.project.getUrl("_hooks/[PATH]")),1)]),_:1})]),_:1}),t(e(F),null,{default:a(()=>[t(e(E),{"validate-status":c.value,help:y.value,"has-feedback":""},{default:a(()=>[t(e(D),{value:l.project.subdomain,"onUpdate:value":p[0]||(p[0]=S=>l.project.subdomain=S),type:"text",loading:o.value==="loading",onBlur:k},{addonBefore:a(()=>[s("https://")]),addonAfter:a(()=>[s(".abstra.app")]),_:1},8,["value","loading"])]),_:1},8,["validate-status","help"]),t(N,{model:l.project,disabled:o.value!=="available",onError:w},null,8,["model","disabled"])]),_:1})]),_:1}))}}),H={key:0,class:"project-settings"},Y=_({__name:"ProjectSettings",setup(n){const o=R().params.projectId,{result:u}=A(()=>h.get(o));return(d,c)=>e(u)?(g(),T("div",H,[t(e(j),null,{default:a(()=>[s("Project Settings")]),_:1}),t(V,{project:e(u)},null,8,["project"])])):x("",!0)}});export{Y as default};
//# sourceMappingURL=ProjectSettings.493a26b4.js.map
