import{I as g,x as y,i as S,S as m,R as c,dB as E,T as P}from"./B2UyoCas.js";import{c as u}from"./NkNhW2e0.js";const C=()=>{const{t,te:p}=g(),f=r=>{if(!r.suggestion)return r.name;const{suggestion:{identifier:o},name:e}=r;if(!o)return e;const a=`admin.components.names.${o}`;return p(a)?t(a):e},i=y(),n=S(()=>{var o,e;if(!((o=i.currentProject)!=null&&o.system.domain))return{protocol:"https",domain:"domain.com"};const r=(e=i.currentProject)==null?void 0:e.system.domain.split("://");return{protocol:r[0]||"https",domain:r[1]||"domain.com"}}),d=m().optional().refine(r=>r?r.startsWith("http://")||r.startsWith("https://"):!0,{message:t("formErrors.invalidProtocol")}).refine(r=>r?u(r,n.value.domain):!0,{message:t("formErrors.mustContainDomain",{domain:n.value.domain})}),s=m().refine(r=>r.startsWith("http://")||r.startsWith("https://"),{message:t("formErrors.invalidProtocol")}).refine(r=>u(r,n.value.domain),{message:t("formErrors.mustContainDomain",{domain:n.value.domain})}),h=c({name:m().min(3,t("formErrors.min",{min:3})).transform(r=>P(r)),url:s,type:E().min(1,t("formErrors.empty",{name:"Type"}))}),l=c({url:s});return{pageComponentName:f,longSchema:h,shortSchema:l,baseDomain:n,zUrlSchema:s,zBaseUrlSchema:d}};export{C as u};
