PageSourceSearch

https://www.metaixmio.gr/assets/edit.BvSe2-0Z.js

js metaixmio.gr collected 2026-09-24 19:47:14 UTC 3,497 bytes, 1 lines download raw bytes

1import{t as C,a8 as g,bc as x,ag as u,b7 as m,bd as A,be as j,B as v,J as E,r as d,j as i,n,h as l}from"./index-CHRcH5og.js";import{P as q}from"./PageHeaderMeta.DmGxthvs.js";import{A as N}from"./AddressForm.BGKnbXoR.js";import{P}from"./index.Bx0Gc69S.js";import{v as S,g as B}from"./helper.CAOjaNAH.js";import"./utils.Ba_cVios.js";import"./memoize-one.esm.B7n7JzPm.js";import"./extends.CF3RwP-h.js";import"./useRegionsByCountry.DJoy0LVE.js";import"./Breadcrumb.B59o6JfF.js";import"./home-breadcrumb-icon.aoDjGNuc.js";import"./ProfileNavigation.CYd1Cu18.js";import"./useProfile.BMSXi8UY.js";import"./truck-icon.u9JQiWNb.js";const D=r=>C({queryKey:["address",r],queryFn:()=>x(r).then(a=>a).catch(()=>{}),placeholderData:{},enabled:g.isAuthenticated()&&!!r}),F=()=>{const r=u();return m({mutationFn:s=>A(s),onSuccess:()=>{r.invalidateQueries({queryKey:["addresses"]})}})},k=()=>{const r=u();return m({mutationFn:s=>j(s),onSuccess:()=>{r.invalidateQueries({queryKey:["address"]}),r.invalidateQueries({queryKey:["addresses"]})}})},G=()=>{const{id:r}=v(),a=E(),{data:s}=D(r),p=k(),f=F(),[y,b]=d.useState({}),[e,c]=d.useState({});d.useEffect(()=>{s.id&&c({id:s.id,cid:s.cid,cnid:s.cnid,crid:s.cnid===1?s.crid:null,tl:s.tl,adl:s.adl,ct:s.ct,ar:s.ar??"",pc:s.pc,mob:s.mob,tel:s.tel??"",bel:s.bel??"",ncm:s.ncm??""})},[s]);const h=()=>{const t={};if(e.tl||(t.title="Παρακαλούμε δώστε έναν Τίτλο"),e.cnid||(t.country="Παρακαλούμε συμπληρώστε τη χώρα"),e.cnid===1&&!e.crid&&(t.regionId="Παρακαλούμε συμπληρώστε Νομό"),(!e.ct||e.ct.trim()==="")&&(t.city="Παρακαλούμε συμπληρώστε την πόλη"),(!e.adl||e.adl.trim()==="")&&(t.address="Παρακαλούμε συμπληρώστε τη διεύθυνσή σας"),e.cnid){const o=S(e.pc,e.cnid);o.isValid||(t.postalCode=o.error)}else(!e.pc||e.pc.trim().length===0)&&(t.postalCode="Παρακαλούμε συμπληρώστε τον Τ.Κ.");if(e.tel&&e.tel.trim().length!==0&&e.tel.trim().length!==10&&(t.telephone="Ο αριθμός (σταθερό) δεν είναι έγκυρος"),e.cnid){const o=B(e.mob,e.cnid);o.isValid||(t.mobile=o.error)}else(!e.mob||e.mob.trim().length===0)&&(t.mobile="Παρακαλούμε συμπληρώστε τον αριθμό κινητού");if(Object.keys(t).length!==0){b(t),n("Παρακαλώ ελέγξτε τα πεδία της φόρμας");return}p.mutate(e,{onSuccess:()=>{l("Η διεύθυνση αποθηκεύτηκε",{autoClose:2e3}),a("/profile/addresses")},onError:()=>n("Έχετε ήδη μία διεύθυση με αυτόν τον τίτλο",{autoClose:2e3})})};return i.jsxs(i.Fragment,{children:[i.jsx(q,{page_title:"Addresses"}),i.jsx(P,{code:"addresses",children:i.jsxs("div",{id:"address-create",children:[i.jsx("h3",{className:"subtitle",children:"Επεξεργασία Διεύθυνσης"}),i.jsx(N,{addressData:e,setAddressData:c,inputErrors:y}),i.jsxs("div",{className:"actions",children:[i.jsx("button",{className:"back",onClick:()=>a("/profile/addresses"),children:"Ακύρωση"}),i.jsx("button",{className:"delete",onClick:()=>f.mutate(r,{onSuccess:()=>{l("Η διεύθυνση διαγράφθηκε",{autoClose:2e3}),a("/profile/addresses")},onError:()=>n("Προέκυψε κάποιο πρόβλημα",{autoClose:2e3})}),children:"Διαγραφή"}),i.jsx("button",{className:"create",onClick:h,children:"Αποθήκευση"})]})]})})]})};export{G as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.