import{a as y}from"./asyncComputed.0adffaf6.js";import{P as j}from"./project.f812bab6.js";import"./gateway.99ed1590.js";import{d as v,v as w,b as n,c,x as t,e as l,z as r,S as o,N as p,D as _,t as S,a as C,O as x,Q as E,q as I,J as N}from"./registerWidgets.bb4c7eff.js";import{a as B}from"./index.82e1a6b3.js";import{L as D}from"./CircularLoading.8dab92fc.js";import{N as P,e as A,O}from"./icons.e3de8035.js";import"./activeRecord.57c6bf02.js";import"./passwordlessManager.a806df6a.js";const i=s=>(x("data-v-43424e5e"),s=s(),E(),s),T={class:"subdomain-editor"},V={class:"title"},H=i(()=>t("div",{class:"subtitle"}," Every workspace in Abstra Cloud comes with a default subdomain, which will appear on all shared project links. Only the workspace\u2019s owner can edit the subdomain. ",-1)),z={key:0,class:"subdomain-presenter"},L={class:"link-item"},$=i(()=>t("div",{class:"link-title"},"Forms and Dashes available at:",-1)),q={class:"link"},F={class:"custom-subdomain"},J={class:"link-item"},M=i(()=>t("div",{class:"link-title"},"Hooks available at:",-1)),Q={class:"link"},R={class:"custom-subdomain"},G={key:1,class:"subdomain-value-editor"},K={class:"subdomain-change-warning"},U={class:"section-title"},W=i(()=>t("div",{class:"section-body"}," Changing the workspace subdomain affects any links you've previously shared. The user wont be able to access old links. ",-1)),X={class:"input-section"},Y={class:"subdomain-value-input"},Z=i(()=>t("span",null,"https://",-1)),tt=["value"],et=i(()=>t("span",null,".abstra.app",-1)),st={key:0,class:"error"},ot={class:"option-buttons"},at=v({__name:"SubdomainEditor",props:{project:null},setup(s){const a=s,e=w({name:a.project.subdomain,error:"",editing:!1,loading:!1}),d=()=>e.editing=!0,m=()=>{f(),e.editing=!1,e.error=""},h=async()=>{e.error="",e.loading=!0,await g(),e.error||(e.editing=!1),e.loading=!1},g=async()=>{if(!(!a.project||a.project.subdomain===e.name)){if(!e.name){e.error="Subdomain cannot be empty";return}a.project.subdomain=e.name,await a.project.save()}},f=()=>e.name=a.project.subdomain,k=b=>{e.name=B(b.target.value,{replacement:"-",lower:!0,strict:!0})};return(b,ct)=>{const u=C("icon");return n(),c("div",T,[t("h2",V,[l(u,{width:"22",height:"22",path:r(P),fill:"#414A58"},null,8,["path"]),o("Subdomain ")]),H,e.editing?(n(),c("div",G,[t("div",K,[t("div",U,[l(u,{path:r(A),width:"12",height:"12",fill:"#D35249"},null,8,["path"]),o(" Be careful ")]),W]),t("div",X,[t("div",Y,[Z,t("input",{value:e.name,type:"text",onInput:k},null,40,tt),et]),e.error?(n(),c("div",st,[l(u,{path:r(O),fill:"#D35249",width:"12",height:"12"},null,8,["path"]),o(" "+p(e.error),1)])):_("",!0),t("div",ot,[t("button",{class:"cancel-button",onClick:m},"Cancel"),t("button",{class:"save-button",onClick:h},[o(" Save Changes "),e.loading?(n(),S(D,{key:0,size:"16"})):_("",!0)])])])])):(n(),c("div",z,[t("div",L,[$,t("div",q,[o(" https://"),t("span",F,p(s.project.subdomain),1),o(".abstra.app/[PATH] ")])]),t("div",J,[M,t("div",Q,[o(" https://"),t("span",R,p(s.project.subdomain),1),o(".abstra.app/_hooks/[PATH] ")])]),t("button",{onClick:d},"Edit Subdomain")]))])}}});const nt=I(at,[["__scopeId","data-v-43424e5e"]]),it={key:0,class:"project-settings"},vt=v({__name:"ProjectSettings",setup(s){const e=N().params.projectId,{result:d}=y(()=>j.get(e));return(m,h)=>r(d)?(n(),c("div",it,[l(nt,{project:r(d)},null,8,["project"])])):_("",!0)}});export{vt as default};
//# sourceMappingURL=ProjectSettings.91bdf58c.js.map
