import{a as g,e as v}from"./chunk-6ZMPLOPC.js";import{e as T}from"./chunk-ZQOBSZOC.js";import{a as w}from"./chunk-EYBBLB4O.js";import{a,b as o,g as b,i as u,na as l,sa as d,z as f}from"./chunk-24LF3ZOB.js";var i=b(w());var c=class extends i.Taxable{get basePrice(){return this.price}get baseNumberOfPersons(){return 1}constructor(t){super(t),this._id="",this.businessId="",this.name="",this.description="",this.images=[],this.numberOfSeats=0,this.numberOfCars=0,this.direction="arrival",this.createdAt=new Date,this.updatedAt=new Date,this.location={code:"",name:"",type:i.TransferLocationType.CUSTOM},this.price=0,this.priceType=i.TransferPriceType.PER_PERSON,Object.assign(this,o(a({},t),{images:t.images?.map(x=>new i.Image(x))??[]}))}};var s=b(w());var A=(()=>{let t=class t{constructor(n,r){this.http=n,this.businessService=r,this.endpoint=g.apiUrl+"/transfer/external"}fetch(){return u(this,null,function*(){let n=yield this.businessService.fetch(),r=yield this.businessService.getTaxes(s.TaxTarget.TRANSFER);return(yield f(this.http.get(`${this.endpoint}?businessId=${n._id}`))).reduce((h,e)=>{for(let m of e.pricePerLocation)h.push(new c(o(a(a({},e),m),{name:s.Translate.getTranslation(e.name),description:s.Translate.getTranslation(e.description),taxes:r,businessVat:n.vatValue})));return h},[])})}fetchOne(n){return u(this,null,function*(){let r=yield this.businessService.fetch(),h=yield this.businessService.getTaxes(s.TaxTarget.TRANSFER),e=yield f(this.http.get(`${this.endpoint}/${n}`)),m=[];for(let S of e.pricePerLocation)m.push(new c(o(a(a({},e),S),{name:s.Translate.getTranslation(e.name),description:s.Translate.getTranslation(e.description),taxes:h,businessVat:r.vatValue})));return m})}};t.\u0275fac=function(r){return new(r||t)(d(T),d(v))},t.\u0275prov=l({token:t,factory:t.\u0275fac,providedIn:"root"});let p=t;return p})();export{c as a,A as b};
/**i18n:a686f987dfa78864a2df2ebdb7dff24fe4108ddbbb7678c7d08d745f2d744c56*/
