import{a as S}from"./asyncComputed.059a4705.js";import{a as m}from"./router.a730a2c1.js";import{d as _,r as I,eL as B,H as f,b as g,c as C,w as a,u as e,f as t,ar as s,e as b,eD as v,bO as F,cF as P,eB as T,ev as D,ex as E}from"./outputWidgets.0a8e4948.js";import"./index.fea4a6f4.js";import{P as h}from"./project.aaf35bd5.js";import{_ as x}from"./SaveButton.vue_vue_type_script_setup_true_lang.92a87832.js";import{A as j}from"./Title.ca8d43a3.js";import{A as H}from"./Paragraph.b4aaf7da.js";import{A as u}from"./Text.ec9c769b.js";import{A as N,F as U}from"./Form.c559c050.js";import"./index.cf4c23b9.js";import"./record.68d70ea4.js";import"./pubsub.dcb12b9f.js";import"./Base.dda5d58b.js";import"./Typography.fd999a5c.js";import"./hasIn.8bcc6abb.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]="5815b5b0-9e3f-452b-87fa-24bef298e8b1",n._sentryDebugIdIdentifier="sentry-dbid-5815b5b0-9e3f-452b-87fa-24bef298e8b1")}catch{}})();const V=_({__name:"SubdomainEditor",props:{project:{}},setup(n){const r=n,o=I(void 0),i=B.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",i()):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 A(){r.project.resetChanges(),o.value=void 0}return(l,p)=>(g(),C(e(P),{direction:"vertical"},{default:a(()=>[t(e(j),{level:2},{default:a(()=>[s("Subdomain")]),_:1}),t(e(H),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(m),null,{default:a(()=>[t(e(u),null,{default:a(()=>[s("Forms available at:")]),_:1}),t(e(u),{code:""},{default:a(()=>[b("span",null,v(l.project.getUrl("[PATH]")),1)]),_:1})]),_:1}),t(e(m),null,{default:a(()=>[t(e(u),null,{default:a(()=>[s("Hooks available at:")]),_:1}),t(e(u),{code:""},{default:a(()=>[b("span",null,v(l.project.getUrl("_hooks/[PATH]")),1)]),_:1})]),_:1}),t(e(U),null,{default:a(()=>[t(e(N),{"validate-status":c.value,help:y.value,"has-feedback":""},{default:a(()=>[t(e(F),{value:l.project.subdomain,"onUpdate:value":p[0]||(p[0]=w=>l.project.subdomain=w),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(x,{model:l.project,disabled:o.value!=="available",onError:A},null,8,["model","disabled"])]),_:1})]),_:1}))}}),R={key:0,class:"project-settings"},te=_({__name:"ProjectSettings",setup(n){const o=T().params.projectId,{result:i}=S(()=>h.get(o));return(d,c)=>e(i)?(g(),D("div",R,[t(e(j),null,{default:a(()=>[s("Project Settings")]),_:1}),t(V,{project:e(i)},null,8,["project"])])):E("",!0)}});export{te as default};
//# sourceMappingURL=ProjectSettings.3802edf8.js.map
