import{Fb as g,Pb as T,yb as d,zb as h}from"./chunk-U45OJP77.js";import{s as y}from"./chunk-QYQ7WNYU.js";import{La as l,Qa as u,t as c}from"./chunk-HC2G7LSI.js";var w=(()=>{let o=class o{constructor(s){this.store=s,this.AddressRelationType=d,this.showAddressToggleSource=new c(!0),this.showAddressToggle$=this.showAddressToggleSource.asObservable()}setShowAddressToggle(s){this.showAddressToggleSource.next(s)}getShowAddressToggle(){return this.showAddressToggle$}createValidAddress(s){let{county:t,locality:r,street:e,building:n,apartment:i,staircase:a,zipCode:m}=s;return{apartment:i||"",building:n||"",county:{name:t.name?t.name:"",type:t.type,siruta:t.id,mnemonic:t.mnemonic?t.mnemonic:""},locality:{name:r.name,type:r.type,siruta:r.id,uatSiruta:r.id,uniqueNameOnCounty:r.uniqueNameOnCounty?r.uniqueNameOnCounty:""},street:{name:e?.name?e.name:"",streetId:e?.id?e.id:"",type:e?.type?e.type:"",zipCode:e?.zipCode?e.zipCode:"",selectableType:e?.streetType?.selectable?e.streetType?.selectable:""},streetNo:e?.number?e.number:"",staircase:a||"",zipCode:m||""}}setPortInDeliveryAddress(s,t,r,e){this.store.dispatch(T({addressType:d.DELIVERY,showSkeletons:!0})),this.store.dispatch(g({addressToSave:{address:s,type:d.DELIVERY,party:{type:h.Person,phone:t,name:r,email:e}}}))}checkIfAddressExistInList(s,t,r,e,n){let i=s.find(a=>a.address.street?.streetId===t);return i&&i.party?.name===r&&i.party.email===e&&i.party.phone===n}};o.\u0275fac=function(t){return new(t||o)(u(y))},o.\u0275prov=l({token:o,factory:o.\u0275fac,providedIn:"root"});let p=o;return p})();export{w as a};