import{a as S}from"./asyncComputed.21831dee.js";import{a as m}from"./router.979769f7.js";import{d as _,r as I,eN as B,H as b,b as g,c as C,w as a,u as e,f as t,ar as s,e as f,eD as v,bO as F,cF as P,eB as T,ev as D,ex as E}from"./outputWidgets.6bfc0239.js";import"./index.76d87691.js";import{P as h}from"./project.3b3557c3.js";import{_ as N}from"./SaveButton.vue_vue_type_script_setup_true_lang.4b0e6f74.js";import{A as j}from"./Title.84d6428e.js";import{A as x}from"./Paragraph.100fbd75.js";import{A as u}from"./Text.3be64ce1.js";import{A as H,F as U}from"./Form.7d1a8597.js";import"./index.cf4c23b9.js";import"./record.dbb754fe.js";import"./pubsub.56f48661.js";import"./Base.3f4f4c87.js";import"./Typography.7fe49268.js";import"./hasIn.42df2c7d.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]="5b37a0bd-1928-41a4-927b-725dc164a678",n._sentryDebugIdIdentifier="sentry-dbid-5b37a0bd-1928-41a4-927b-725dc164a678")}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=b(()=>{switch(o.value){case"invalid":return"error";case"loading":return"validating";case"available":return"success";case"unavailable":return"error";default:return}}),y=b(()=>{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(x),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(()=>[f("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(()=>[f("span",null,v(l.project.getUrl("_hooks/[PATH]")),1)]),_:1})]),_:1}),t(e(U),null,{default:a(()=>[t(e(H),{"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(N,{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.e21e01bd.js.map
