import{a as I}from"./asyncComputed.72d91ef9.js";import"./authorManager.176ccd94.js";import{d as j,r as P,eL as T,G as g,b as m,c as B,w as a,u as e,f as t,aq as r,e as i,eD as d,bH as F,ev as y,ex as k,cC as H,eB as E}from"./outputWidgets.470cd725.js";import"./index.d44cde0e.js";import{P as A}from"./project.f4c30a7f.js";import{_ as U}from"./SaveButton.vue_vue_type_script_setup_true_lang.e186afef.js";import{a as f,A as h}from"./Title.edbac04b.js";import{A as s}from"./Text.fbb768c7.js";import{a as p}from"./router.bb51d819.js";import{A as N}from"./FormItem.bd89e955.js";import{F as V}from"./Form.bf13abb6.js";import"./index.cf4c23b9.js";import"./record.19f593f6.js";import"./pubsub.bb7b27fb.js";import"./gateway.6d700df7.js";import"./index.672f7932.js";import"./hasIn.6bd3aa8a.js";(function(){try{var u=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(u._sentryDebugIds=u._sentryDebugIds||{},u._sentryDebugIds[n]="8902734b-5365-412b-8d71-b5e081461063",u._sentryDebugIdIdentifier="sentry-dbid-8902734b-5365-412b-8d71-b5e081461063")}catch{}})();const R={key:0},$=j({__name:"SubdomainEditor",props:{project:{}},setup(u){const n=u,o=P(void 0),c=T.exports.debounce(async()=>{try{const{available:l}=await n.project.checkSubdomain();o.value=l?"available":"unavailable"}catch{o.value=void 0}},500);function b(){n.project.subdomain?(o.value="loading",c()):o.value="invalid"}const v=g(()=>{switch(o.value){case"invalid":return"error";case"loading":return"validating";case"available":return"success";case"unavailable":return"error";default:return}}),w=g(()=>{switch(o.value){case"loading":return"Checking availability...";case"available":return"Available";case"unavailable":return"Unavailable";case"invalid":return"Invalid subdomain";default:return}}),S=()=>{n.project.subdomain=A.formatSubdomain(n.project.subdomain),b()};function C(){n.project.resetChanges(),o.value=void 0}return(l,_)=>(m(),B(e(H),{direction:"vertical"},{default:a(()=>[t(e(f),{level:2},{default:a(()=>[r("Subdomain")]),_:1}),t(e(h),null,{default:a(()=>[r(" Every project in Abstra Cloud comes with a default subdomain, which will appear on all shared project links. ")]),_:1}),t(e(p),null,{default:a(()=>[t(e(s),null,{default:a(()=>[r("Forms available at:")]),_:1}),t(e(s),{code:""},{default:a(()=>[i("span",null,d(l.project.getUrl("[PATH]")),1)]),_:1})]),_:1}),t(e(p),null,{default:a(()=>[t(e(s),null,{default:a(()=>[r("Hooks available at:")]),_:1}),t(e(s),{code:""},{default:a(()=>[i("span",null,d(l.project.getUrl("_hooks/[PATH]")),1)]),_:1})]),_:1}),t(e(V),null,{default:a(()=>[t(e(N),{"validate-status":v.value,help:w.value,"has-feedback":""},{default:a(()=>[t(e(F),{value:l.project.subdomain,"onUpdate:value":_[0]||(_[0]=D=>l.project.subdomain=D),type:"text",loading:o.value==="loading",onBlur:S},{addonBefore:a(()=>[r("https://")]),addonAfter:a(()=>[r(".abstra.app")]),_:1},8,["value","loading"])]),_:1},8,["validate-status","help"]),t(U,{model:l.project,disabled:o.value!=="available",onError:C},null,8,["model","disabled"])]),_:1}),l.project.customDomain?(m(),y("div",R,[t(e(f),{level:2},{default:a(()=>[r("Custom Domain")]),_:1}),t(e(h),null,{default:a(()=>[r(" Your project also has a custom domain: "),t(e(s),{code:""},{default:a(()=>[i("span",null,d(l.project.customDomain),1)]),_:1})]),_:1}),t(e(p),null,{default:a(()=>[t(e(s),null,{default:a(()=>[r("Forms available at:")]),_:1}),t(e(s),{code:""},{default:a(()=>[i("span",null,d(l.project.getCustomDomainUrl("[PATH]")),1)]),_:1})]),_:1}),t(e(p),null,{default:a(()=>[t(e(s),null,{default:a(()=>[r("Hooks available at:")]),_:1}),t(e(s),{code:""},{default:a(()=>[i("span",null,d(l.project.getCustomDomainUrl("_hooks/[PATH]")),1)]),_:1})]),_:1})])):k("",!0)]),_:1}))}}),q={key:0,class:"project-settings"},le=j({__name:"ProjectSettings",setup(u){const o=E().params.projectId,{result:c}=I(()=>A.get(o));return(b,v)=>e(c)?(m(),y("div",q,[t(e(f),null,{default:a(()=>[r("Project Settings")]),_:1}),t($,{project:e(c)},null,8,["project"])])):k("",!0)}});export{le as default};
//# sourceMappingURL=ProjectSettings.f82e16db.js.map
