aves-sdk 1.2.0 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- var Qt=Object.create;var F=Object.defineProperty;var $t=Object.getOwnPropertyDescriptor;var zt=Object.getOwnPropertyNames;var Zt=Object.getPrototypeOf,Jt=Object.prototype.hasOwnProperty;var eo=(e,t,n)=>t in e?F(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var a=(e,t)=>F(e,"name",{value:t,configurable:!0});var to=(e,t)=>{for(var n in t)F(e,n,{get:t[n],enumerable:!0})},ct=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of zt(t))!Jt.call(e,i)&&i!==n&&F(e,i,{get:()=>t[i],enumerable:!(r=$t(t,i))||r.enumerable});return e};var oo=(e,t,n)=>(n=e!=null?Qt(Zt(e)):{},ct(t||!e||!e.__esModule?F(n,"default",{value:e,enumerable:!0}):n,e)),no=e=>ct(F({},"__esModule",{value:!0}),e);var p=(e,t,n)=>eo(e,typeof t!="symbol"?t+"":t,n);var ho={};to(ho,{AVES_CONFIG_NAMESPACE:()=>Xt,AVES_SDK_CONFIG:()=>D,AddressValidation:()=>jt,AvesEndpoints:()=>I,AvesErrorCodes:()=>m,AvesErrorHandler:()=>Y,AvesException:()=>d,AvesModule:()=>K,AvesService:()=>y,AvesSeverity:()=>E,AvesStatus:()=>So,AvesValidator:()=>Me,BookFileRQValidation:()=>Eo,BookingStatusType:()=>l,CancelFileRQValidation:()=>Ro,CancelReasonType:()=>X,ContactInfoValidation:()=>Gt,CustomerStatusType:()=>f,CustomerType:()=>T,DeliveryMethodType:()=>$,DeliveryStatusType:()=>Z,DocumentFormatType:()=>Q,DocumentType:()=>S,GenderType:()=>h,InsertCriteria:()=>To,LanguageCodeValidation:()=>wt,PassengerType:()=>C,PassengerValidation:()=>qt,PaymentStatusType:()=>W,PaymentType:()=>V,PaymentValidation:()=>po,PricingItemType:()=>w,PrintBookingDocumentRQValidation:()=>go,RefundMethodType:()=>z,RootElementNames:()=>g,SearchMasterRecordRQValidation:()=>lo,ServiceStatusType:()=>P,ServiceType:()=>O,ServiceValidation:()=>Ht,XML_HTTP_CLIENT:()=>x,XmlHttpClient:()=>L,addPaymentRequestSchema:()=>ft,addressTypeSchema:()=>Pe,apiSchemas:()=>ro,avesConfig:()=>xe,bookingPassengerSchema:()=>G,bookingPaymentSchema:()=>ee,bookingResponseSchema:()=>Nt,bookingServiceSchema:()=>q,bookingStatusTypeSchema:()=>ne,bookingTypeSchema:()=>lt,cancelBookingRequestSchema:()=>St,cancelReasonTypeSchema:()=>Ge,communicationMethodTypeSchema:()=>$e,configValidationSchema:()=>rt,contactTypeSchema:()=>J,createAvesValidator:()=>fo,createBookingRequestSchema:()=>It,createDateString:()=>A,createDateTimeString:()=>ie,createTimeString:()=>so,customerAddressSchema:()=>re,customerContactSchema:()=>se,customerSchema:()=>j,customerSearchResultSchema:()=>Dt,customerStatusTypeSchema:()=>Qe,customerTypeSchema:()=>je,deliveryMethodTypeSchema:()=>Ye,deliveryStatusTypeSchema:()=>Rt,documentFormatTypeSchema:()=>Ke,documentPrintResultSchema:()=>Ot,documentTypeSchema:()=>He,emailTypeSchema:()=>ve,genderTypeSchema:()=>oe,mapAddPaymentToXml:()=>ge,mapBookingFromXml:()=>Ze,mapBookingResponseFromXml:()=>b,mapBookingStatusToXml:()=>me,mapCancelBookingToXml:()=>Ee,mapCancelResponseFromXml:()=>Oe,mapCreateBookingToXml:()=>de,mapCreateCustomerToXml:()=>Ie,mapCustomerResponseFromXml:()=>B,mapCustomerStatusToXml:()=>ce,mapCustomerToXml:()=>v,mapCustomerTypeToXml:()=>ae,mapDocumentResponseFromXml:()=>De,mapDocumentTypeToXml:()=>ue,mapGenderToXml:()=>pe,mapPaymentResponseFromXml:()=>Ae,mapPrintDocumentToXml:()=>Re,mapSearchCustomerToXml:()=>le,mapSearchResponseFromXml:()=>Ne,mapSetBookingServiceStatusToXml:()=>ye,mapSetBookingStatusToXml:()=>he,mapUpdateBookingHeaderToXml:()=>fe,mapUpdateBookingServicesToXml:()=>Ce,mapUpdateCustomerToXml:()=>Se,mapUpsertCustomerToXml:()=>Te,operationResponseSchema:()=>At,passengerTypeSchema:()=>Be,paymentStatusTypeSchema:()=>we,paymentTypeSchema:()=>Xe,pricingItemTypeSchema:()=>We,printDocumentRequestSchema:()=>Tt,printedDocumentSchema:()=>te,priorityTypeSchema:()=>dt,refundMethodTypeSchema:()=>qe,searchCustomerRequestSchema:()=>gt,searchOperatorTypeSchema:()=>pt,serviceStatusTypeSchema:()=>Ve,serviceTypeSchema:()=>ke,setBookingStatusSchema:()=>yt,specialRequestTypeSchema:()=>Et,titleTypeSchema:()=>Ue,updateBookingHeaderSchema:()=>Ct,updateBookingServicesSchema:()=>ht});module.exports=no(ho);var o=require("zod"),C={ADULT:"adult",CHILD:"child",INFANT:"infant",SENIOR:"senior"},h={MALE:"male",FEMALE:"female"},O={FLIGHT:"flight",HOTEL:"hotel",CAR:"car",TRANSFER:"transfer",INSURANCE:"insurance"},P={CONFIRMED:"confirmed",PENDING:"pending",CANCELLED:"cancelled"},V={CREDIT_CARD:"credit_card",DEBIT_CARD:"debit_card",BANK_TRANSFER:"bank_transfer",CASH:"cash"},W={PENDING:"pending",CONFIRMED:"confirmed",FAILED:"failed"},T={CUSTOMER:"customer",SUPPLIER:"supplier",VOUCHER:"voucher",SUPPLIER_VOUCHER:"supplier_voucher"},f={ENABLED:"enabled",WARNING:"warning",BLACKLISTED:"blacklisted",DISABLED:"disabled"},l={QUOTATION:"quotation",WORK_IN_PROGRESS:"work_in_progress",CONFIRMED:"confirmed",OPTIONED:"optioned",NULLIFIED:"nullified",CANCELED:"canceled"},S={VISA_REQUEST:"visa_request",TRAVEL_INFORMATION:"travel_information",VOUCHER:"voucher",BOOKING_CONTRACT:"booking_contract",BOOKING_CONFIRMATION:"booking_confirmation",SUPPLIER_SERVICE_LIST:"supplier_service_list",INVOICE:"invoice",PROFORMA_INVOICE:"proforma_invoice",ADEGUAMENTO:"adeguamento",RESERVATION_FORM:"reservation_form",OPEN_XML:"open_xml",SALES_INVOICE:"sales_invoice",TICKETING_TMASTER:"ticketing_tmaster",SUMMARY_FORM:"summary_form"},Q={PDF:"pdf",HTML:"html",XML:"xml"},$={EMAIL:"email",SMS:"sms",DOWNLOAD:"download"},X={CUSTOMER_REQUEST:"customer_request",NO_SHOW:"no_show",OPERATIONAL:"operational",OTHER:"other"},z={ORIGINAL_PAYMENT:"original_payment",CREDIT:"credit",CASH:"cash"},w={SERVICE:"service",TAX:"tax",FEE:"fee",DISCOUNT:"discount"},Z={SENT:"sent",PENDING:"pending",FAILED:"failed"},Pe=o.z.enum(["home","work","billing","delivery"]),J=o.z.enum(["home","work","mobile","fax"]),ve=o.z.enum(["home","work"]),Be=o.z.enum([C.ADULT,C.CHILD,C.INFANT,C.SENIOR]),Ue=o.z.enum(["mr","mrs","ms","dr","prof"]),oe=o.z.enum([h.MALE,h.FEMALE]),ke=o.z.enum([O.FLIGHT,O.HOTEL,O.CAR,O.TRANSFER,O.INSURANCE]),Ve=o.z.enum([P.CONFIRMED,P.PENDING,P.CANCELLED]),Xe=o.z.enum([V.CREDIT_CARD,V.DEBIT_CARD,V.BANK_TRANSFER,V.CASH]),we=o.z.enum([W.PENDING,W.CONFIRMED,W.FAILED]),je=o.z.enum([T.CUSTOMER,T.SUPPLIER,T.VOUCHER,T.SUPPLIER_VOUCHER]),pt=o.z.enum(["equals","contains","starts_with","ends_with"]),lt=o.z.enum(["individual","group","corporate"]),dt=o.z.enum(["low","normal","high","urgent"]),Et=o.z.enum(["meal","seat","wheelchair","other"]),Ge=o.z.enum([X.CUSTOMER_REQUEST,X.NO_SHOW,X.OPERATIONAL,X.OTHER]),qe=o.z.enum([z.ORIGINAL_PAYMENT,z.CREDIT,z.CASH]),He=o.z.enum([S.VISA_REQUEST,S.TRAVEL_INFORMATION,S.VOUCHER,S.BOOKING_CONTRACT,S.BOOKING_CONFIRMATION,S.SUPPLIER_SERVICE_LIST,S.INVOICE,S.PROFORMA_INVOICE,S.ADEGUAMENTO,S.RESERVATION_FORM,S.OPEN_XML,S.SALES_INVOICE,S.TICKETING_TMASTER,S.SUMMARY_FORM]),Ke=o.z.enum([Q.PDF,Q.HTML,Q.XML]),Ye=o.z.enum([$.EMAIL,$.SMS,$.DOWNLOAD]),ne=o.z.enum([l.QUOTATION,l.WORK_IN_PROGRESS,l.CONFIRMED,l.OPTIONED,l.NULLIFIED,l.CANCELED]),We=o.z.enum([w.SERVICE,w.TAX,w.FEE,w.DISCOUNT]),Rt=o.z.enum([Z.SENT,Z.PENDING,Z.FAILED]),Qe=o.z.enum([f.ENABLED,f.WARNING,f.BLACKLISTED,f.DISABLED]),$e=o.z.enum(["email","sms","phone"]),_=o.z.string().regex(/^\d{4}-\d{2}-\d{2}$/,"Date must be in YYYY-MM-DD format"),mt=o.z.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?Z?$/,"DateTime must be in ISO 8601 format"),re=o.z.object({type:Pe.optional(),street:o.z.string().max(100,"Street must be 100 characters or less").optional(),city:o.z.string().max(50,"City must be 50 characters or less").optional(),state:o.z.string().max(50,"State must be 50 characters or less").optional(),postalCode:o.z.string().max(20,"Postal code must be 20 characters or less").optional(),country:o.z.string().max(50,"Country must be 50 characters or less").optional()}),se=o.z.object({phone:o.z.object({type:J.optional(),number:o.z.string().min(1,"Phone number is required").max(30,"Phone number must be 30 characters or less")}).optional(),email:o.z.object({type:ve.optional(),address:o.z.string().email("Valid email address is required").max(100,"Email must be 100 characters or less")}).optional(),mobile:o.z.object({type:J.optional(),number:o.z.string().min(1,"Mobile number is required").max(30,"Mobile number must be 30 characters or less")}).optional()}),j=o.z.object({id:o.z.string().max(6,"Customer ID must be 6 characters or less"),type:je,status:Qe,personalInfo:o.z.object({title:o.z.string().max(10,"Title must be 10 characters or less").optional(),firstName:o.z.string().min(1,"First name is required").max(50,"First name must be 50 characters or less"),lastName:o.z.string().min(1,"Last name is required").max(50,"Last name must be 50 characters or less"),dateOfBirth:_.optional(),gender:oe.optional(),nationality:o.z.string().max(3,"Nationality code must be 3 characters or less").optional()}).optional(),contact:se.optional(),address:re.optional(),businessInfo:o.z.object({companyName:o.z.string().max(100,"Company name must be 100 characters or less").optional(),taxId:o.z.string().max(30,"Tax ID must be 30 characters or less").optional(),vatCode:o.z.string().max(30,"VAT code must be 30 characters or less").optional(),fiscalCode:o.z.string().max(30,"Fiscal code must be 30 characters or less").optional(),licenseNumber:o.z.string().max(50,"License number must be 50 characters or less").optional()}).optional(),preferences:o.z.object({language:o.z.string().length(2,"Language code must be exactly 2 characters").optional(),currency:o.z.string().length(3,"Currency code must be exactly 3 characters").optional(),communicationMethod:$e.optional()}).optional()}),G=o.z.object({id:o.z.string().regex(/^\d{3}$/,"Passenger ID must be 3 digits (001, 002, etc.)"),type:Be,title:Ue.optional(),firstName:o.z.string().min(1,"First name is required").max(50,"First name must be 50 characters or less"),lastName:o.z.string().min(1,"Last name is required").max(50,"Last name must be 50 characters or less"),dateOfBirth:_.optional(),gender:oe.optional(),nationality:o.z.string().max(3,"Nationality code must be 3 characters or less").optional(),passport:o.z.object({number:o.z.string().min(1,"Passport number is required").max(20,"Passport number must be 20 characters or less"),expiryDate:_,issuingCountry:o.z.string().min(1,"Issuing country is required").max(3,"Country code must be 3 characters or less")}).optional(),address:re.optional(),contact:se.optional()}),q=o.z.object({id:o.z.string().min(1,"Service ID is required"),type:ke,status:Ve,code:o.z.string().max(50,"Service code must be 50 characters or less").optional(),name:o.z.string().max(200,"Service name must be 200 characters or less").optional(),description:o.z.string().max(500,"Description must be 500 characters or less").optional(),startDate:_.optional(),endDate:_.optional(),price:o.z.object({currency:o.z.string().length(3,"Currency code must be exactly 3 characters"),amount:o.z.number().nonnegative("Amount must be non-negative")}).optional()}),ee=o.z.object({id:o.z.string().min(1,"Payment ID is required"),type:Xe,status:we,amount:o.z.object({currency:o.z.string().length(3,"Currency code must be exactly 3 characters"),amount:o.z.number().positive("Amount must be positive")}),details:o.z.object({cardNumber:o.z.string().max(20,"Card number must be 20 characters or less").optional(),expiryDate:o.z.string().regex(/^\d{2}\/\d{2}$/,"Expiry date must be in MM/YY format").optional(),cardHolderName:o.z.string().max(100,"Cardholder name must be 100 characters or less").optional()}).optional()}),N=o.z.object({pages:o.z.number().int().positive("Pages must be positive").max(100,"Pages cannot exceed 100"),page:o.z.number().int().min(1,"Page must be at least 1")}).optional(),gt=o.z.discriminatedUnion("type",[o.z.object({type:o.z.literal("code"),code:o.z.string().min(1,"Code is required").max(6,"Code must be 6 characters or less"),pagination:N}),o.z.object({type:o.z.literal("name"),name:o.z.string().min(1,"Name is required"),city:o.z.string().max(50,"City must be 50 characters or less").optional(),pagination:N}),o.z.object({type:o.z.literal("vat_code"),vatCode:o.z.string().min(1,"VAT code is required"),phoneNumber:o.z.string().max(30,"Phone number must be 30 characters or less").optional(),pagination:N}),o.z.object({type:o.z.literal("zone"),zipCode:o.z.string().min(1,"Zip code is required"),city:o.z.string().max(50,"City must be 50 characters or less").optional(),countyCode:o.z.string().max(10,"County code must be 10 characters or less").optional(),pagination:N}),o.z.object({type:o.z.literal("category"),categoryCode:o.z.string().min(1,"Category code is required"),pagination:N}),o.z.object({type:o.z.literal("email"),email:o.z.email("Valid email is required"),pagination:N}),o.z.object({type:o.z.literal("last_mod_date"),from:o.z.string().regex(/^\d{4}-\d{2}-\d{2}$/,"Date must be in YYYY-MM-DD format"),to:o.z.string().regex(/^\d{4}-\d{2}-\d{2}$/,"Date must be in YYYY-MM-DD format"),pagination:N}),o.z.object({type:o.z.literal("search_field"),searchField:o.z.string().min(1,"Search field is required"),pagination:N}),o.z.object({type:o.z.literal("external_ref_code"),externalRefCode:o.z.string().min(1,"External ref code is required"),pagination:N})]),ut=o.z.object({description:o.z.string().max(200,"Description must be 200 characters or less").optional(),startDate:o.z.string().min(1,"Start date is required"),endDate:o.z.string().min(1,"End date is required"),currency:o.z.string().max(3,"Currency code must be 3 characters or less").optional(),passengers:o.z.array(G).min(1,"At least one passenger is required").max(99,"Maximum 99 passengers allowed"),services:o.z.array(q).min(1,"At least one service is required").max(50,"Maximum 50 services allowed"),statisticCodes:o.z.object({code1:o.z.string().max(4,"Statistic code must be 4 characters or less").optional(),code2:o.z.string().max(4,"Statistic code must be 4 characters or less").optional(),code3:o.z.string().max(4,"Statistic code must be 4 characters or less").optional(),code4:o.z.string().max(4,"Statistic code must be 4 characters or less").optional(),code5:o.z.string().max(4,"Statistic code must be 4 characters or less").optional(),code6:o.z.string().max(4,"Statistic code must be 4 characters or less").optional()}).optional(),destination:o.z.object({code:o.z.string().optional(),iataCode:o.z.string().optional(),nationCode:o.z.string().optional()}).optional(),deadlines:o.z.array(o.z.object({code:o.z.string().min(1,"Deadline code is required"),description:o.z.string().optional(),expireDate:o.z.string().optional()})).optional(),printDocument:o.z.boolean().optional(),sendDocumentViaEmail:o.z.boolean().optional()}),It=o.z.union([ut.extend({customerId:o.z.string().max(6,"Customer ID must be 6 characters or less").min(1,"Customer ID is required"),customerDetails:o.z.never().optional()}),ut.extend({customerId:o.z.never().optional(),customerDetails:j})]),St=o.z.object({bookingId:o.z.string().min(1,"Booking ID is required").max(20,"Booking ID must be 20 characters or less"),customerId:o.z.string().max(6,"Customer ID must be 6 characters or less").optional(),reason:Ge,description:o.z.string().max(500,"Description must be 500 characters or less").optional(),refundRequest:o.z.object({amount:o.z.number().positive("Refund amount must be positive"),currency:o.z.string().length(3,"Currency code must be exactly 3 characters"),method:qe}).optional()}),Tt=o.z.object({bookingId:o.z.string().min(1,"Booking ID is required").max(20,"Booking ID must be 20 characters or less"),customerId:o.z.string().max(6,"Customer ID must be 6 characters or less").optional(),documentType:He,format:Ke.optional(),language:o.z.string().length(2,"Language code must be exactly 2 characters").optional(),deliveryMethod:o.z.object({type:Ye,address:o.z.string().max(100,"Delivery address must be 100 characters or less").optional()}).optional()}),ft=o.z.union([o.z.object({bookingId:o.z.string().min(1,"Booking ID is required").max(20,"Booking ID must be 20 characters or less"),bookingRefCode:o.z.never().optional(),payments:o.z.array(ee).min(1,"At least one payment is required").max(20,"Maximum 20 payments allowed"),enableMultiple:o.z.boolean().optional(),operationType:o.z.enum(["absolute","final","final_no_controls"]).optional()}),o.z.object({bookingId:o.z.never().optional(),bookingRefCode:o.z.string().min(1,"Booking reference code is required").max(20,"Booking reference code must be 20 characters or less"),payments:o.z.array(ee).min(1,"At least one payment is required").max(20,"Maximum 20 payments allowed"),enableMultiple:o.z.boolean().optional(),operationType:o.z.enum(["absolute","final","final_no_controls"]).optional()})]),Ct=o.z.object({bookingId:o.z.string().min(1,"Booking ID is required").max(20,"Booking ID must be 20 characters or less"),customerId:o.z.string().max(6,"Customer ID must be 6 characters or less"),startDate:_,passengers:o.z.array(G).optional(),notes:o.z.string().max(999,"Notes must be 999 characters or less").optional(),statisticCodes:o.z.object({code1:o.z.string().max(4,"Statistic code must be 4 characters or less").optional(),code2:o.z.string().max(4,"Statistic code must be 4 characters or less").optional(),code3:o.z.string().max(4,"Statistic code must be 4 characters or less").optional(),code4:o.z.string().max(4,"Statistic code must be 4 characters or less").optional(),code5:o.z.string().max(4,"Statistic code must be 4 characters or less").optional(),code6:o.z.string().max(4,"Statistic code must be 4 characters or less").optional()}).optional()}),ht=o.z.object({bookingId:o.z.string().min(1,"Booking ID is required").max(20,"Booking ID must be 20 characters or less"),customerId:o.z.string().max(6,"Customer ID must be 6 characters or less"),services:o.z.array(q).min(1,"At least one service is required").max(50,"Maximum 50 services allowed")}),yt=o.z.object({bookingId:o.z.string().min(1,"Booking ID is required").max(20,"Booking ID must be 20 characters or less"),customerId:o.z.string().max(6,"Customer ID must be 6 characters or less"),status:ne,expireDate:_.optional()}),Nt=o.z.object({id:o.z.string().min(1,"Booking ID is required"),status:ne,createdAt:mt,updatedAt:mt,customer:j,passengers:o.z.array(G),services:o.z.array(q),pricing:o.z.object({totalAmount:o.z.object({currency:o.z.string().length(3,"Currency code must be exactly 3 characters"),amount:o.z.number().nonnegative("Amount must be non-negative")}),breakdowns:o.z.array(o.z.object({type:We,description:o.z.string().min(1,"Description is required"),amount:o.z.number()})).optional()})}),Dt=o.z.object({customers:o.z.array(j),pagination:o.z.object({page:o.z.number().int().min(1,"Page must be at least 1"),pages:o.z.number().int().min(1,"Pages must be at least 1"),totalItems:o.z.number().int().min(0,"Total items must be non-negative"),hasMore:o.z.boolean()})}),te=o.z.object({fileName:o.z.string().min(1,"File name is required"),content:o.z.string().optional(),contentSize:o.z.number().int().min(0,"Content size must be non-negative")}),Ot=o.z.object({emailRecipient:o.z.email("Valid email address is required").optional(),documents:o.z.array(te).min(0,"Documents array is required"),additionalDocuments:o.z.array(o.z.object({emailRecipient:o.z.string().email("Valid email address is required"),documents:o.z.array(te)})).optional()}),At=o.z.object({success:o.z.boolean(),message:o.z.string().optional(),data:o.z.any().optional()}),ro={addressType:Pe,contactType:J,emailType:ve,passengerType:Be,titleType:Ue,genderType:oe,serviceType:ke,serviceStatusType:Ve,paymentType:Xe,paymentStatusType:we,customerType:je,searchOperatorType:pt,bookingType:lt,priorityType:dt,specialRequestType:Et,cancelReasonType:Ge,refundMethodType:qe,documentType:He,documentFormatType:Ke,deliveryMethodType:Ye,bookingStatusType:ne,pricingItemType:We,deliveryStatusType:Rt,customerStatusType:Qe,communicationMethodType:$e,customerAddress:re,customerContact:se,customer:j,bookingPassenger:G,bookingService:q,bookingPayment:ee,searchCustomerRequest:gt,createBookingRequest:It,cancelBookingRequest:St,printDocumentRequest:Tt,addPaymentRequest:ft,updateBookingHeader:Ct,updateBookingServices:ht,setBookingStatus:yt,bookingResponse:Nt,customerSearchResult:Dt,printedDocument:te,documentPrintResult:Ot,operationResponse:At};var A=a(e=>{let t;if(typeof e=="string"){if(!/^\d{4}-\d{2}-\d{2}$/.test(e))throw new Error(`Invalid date format. Expected YYYY-MM-DD, got: ${e}`);try{t=new Date(e+"T00:00:00.000Z")}catch{throw new Error(`Invalid date string: ${e}`)}}else t=e;if(isNaN(t.getTime()))throw new Error(`Invalid date value: ${e}`);let n=t.getUTCFullYear(),r=String(t.getUTCMonth()+1).padStart(2,"0"),i=String(t.getUTCDate()).padStart(2,"0");return`${n}-${r}-${i}`},"createDateString"),ie=a(e=>{let t;if(typeof e=="string"){if(!/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?Z?$/.test(e))throw new Error(`Invalid datetime format. Expected ISO 8601, got: ${e}`);try{t=new Date(e)}catch{throw new Error(`Invalid datetime string: ${e}`)}}else t=e;if(isNaN(t.getTime()))throw new Error(`Invalid datetime value: ${e}`);return t.toISOString()},"createDateTimeString"),so=a(e=>{if(!/^\d{2}:\d{2}:\d{2}$/.test(e))throw new Error(`Invalid time format. Expected HH:MM:SS, got: ${e}`);let[t,n,r]=e.split(":").map(Number);if(t<0||t>23||n<0||n>59||r<0||r>59)throw new Error(`Invalid time value: ${e}`);return e},"createTimeString");function ae(e){return{[T.CUSTOMER]:"CUSTOMER",[T.SUPPLIER]:"SUPPLIER",[T.VOUCHER]:"VOUCHER",[T.SUPPLIER_VOUCHER]:"SUPPLIER_VOUCHER"}[e]||"CUSTOMER"}a(ae,"mapCustomerTypeToXml");function _t(e){return{CUSTOMER:T.CUSTOMER,SUPPLIER:T.SUPPLIER,VOUCHER:T.VOUCHER,SUPPLIER_VOUCHER:T.SUPPLIER_VOUCHER}[e]||T.CUSTOMER}a(_t,"mapCustomerTypeFromXml");function ce(e){return{[f.ENABLED]:"ENABLED",[f.WARNING]:"WARNING",[f.BLACKLISTED]:"BLACKLISTED",[f.DISABLED]:"DISABLED"}[e]||"ENABLED"}a(ce,"mapCustomerStatusToXml");function bt(e){return{ENABLED:f.ENABLED,WARNING:f.WARNING,BLACKLISTED:f.BLACKLISTED,DISABLED:f.DISABLED}[e]||f.ENABLED}a(bt,"mapCustomerStatusFromXml");function me(e){return{[l.QUOTATION]:"QUOTATION",[l.WORK_IN_PROGRESS]:"WORK_IN_PROGRESS",[l.CONFIRMED]:"CONFIRMED",[l.OPTIONED]:"OPTIONED",[l.NULLIFIED]:"NULLIFIED",[l.CANCELED]:"CANCELED"}[e]||"QUOTATION"}a(me,"mapBookingStatusToXml");function xt(e){return{QUOTATION:l.QUOTATION,WORK_IN_PROGRESS:l.WORK_IN_PROGRESS,CONFIRMED:l.CONFIRMED,OPTIONED:l.OPTIONED,NULLIFIED:l.NULLIFIED,CANCELED:l.CANCELED}[e]||l.QUOTATION}a(xt,"mapBookingStatusFromXml");function ue(e){return{visa_request:"VISA_REQUEST",travel_information:"TRAVEL_INFORMATION",voucher:"VOUCHER",booking_contract:"BOOKING_CONTRACT",booking_confirmation:"BOOKING_CONFIRMATION",supplier_service_list:"SUPPLIER_SERVICE_LIST",invoice:"INVOICE",proforma_invoice:"PROFORMA_INVOICE",adeguamento:"ADEGUAMENTO",reservation_form:"RESERVATION_FORM",open_xml:"OPEN_XML",sales_invoice:"SALES_INVOICE",ticketing_tmaster:"TICKETING_TMASTER",summary_form:"SUMMARY_FORM"}[e]||"VOUCHER"}a(ue,"mapDocumentTypeToXml");function pe(e){return{male:"M",female:"F"}[e]||"M"}a(pe,"mapGenderToXml");function Lt(e){let t=(e.Name||"").split(" "),n=t.pop()||"",r=t.join(" ")||e.Name,i={AD:C.ADULT,CH:C.CHILD,IN:C.INFANT,OV:C.SENIOR};return{id:e["@RPH"],type:i[e.CategoryCode]||C.ADULT,title:void 0,firstName:r,lastName:n,dateOfBirth:e.BirthDate?A(e.BirthDate):void 0,gender:e.Sex==="M"?h.MALE:e.Sex==="F"?h.FEMALE:void 0,nationality:e.NationCode||e.CitizenshipCode,passport:e.IDDocInfo?{number:e.IDDocInfo["@IDCode"]||"",expiryDate:A(e.IDDocInfo["@IDExpireDate"]||""),issuingCountry:""}:void 0,address:void 0,contact:e.eMail||e.PhoneNumber?{email:e.eMail?{address:e.eMail}:void 0,phone:e.PhoneNumber?{number:e.PhoneNumber}:void 0}:void 0}}a(Lt,"mapPassengerFromXml");function Mt(e){return{id:e["@ServiceCode"],type:O.HOTEL,status:P.PENDING,code:e["@ServiceCode"],name:e.FirstDescription,description:e.SecondDescription,startDate:e.StartDate?A(e.StartDate):void 0,endDate:e.EndDate?A(e.EndDate):void 0,price:e.ServiceTotalAmountDetail?.ServiceTotalPrice?{currency:"EUR",amount:parseFloat(e.ServiceTotalAmountDetail.ServiceTotalPrice)}:void 0}}a(Mt,"mapServiceFromXml");var io=a((e,t)=>{switch(e.type){case"code":t.RecordCode=e.code;break;case"name":t.Name=e.name,e.city&&(t.City=e.city);break;case"vat_code":t.VatCode=e.vatCode,e.phoneNumber&&(t.PhoneNumber=e.phoneNumber);break;case"zone":t.ZipCode=e.zipCode,e.city&&(t.City=e.city),e.countyCode&&(t.CountyCode=e.countyCode);break;case"category":t.CategoryCode=e.categoryCode;break;case"email":t.Email=e.email;break;case"last_mod_date":t.LastModificationDate={"@MinDate":e.from,"@MaxDate":e.to};break;case"search_field":t.SearchFieldValue=e.searchField;break;case"external_ref_code":t.SearchFieldValue=e.externalRefCode;break}return t},"buildSearchMasterRecordRQ");function le(e){let t={SearchType:e.type.toUpperCase()};return io(e,t)}a(le,"mapSearchCustomerToXml");function v(e){let t=e.personalInfo?`${e.personalInfo.firstName} ${e.personalInfo.lastName}`.trim():e.id;return{"@RecordCode":e.id,RecordType:ae(e.type),Name:t,LanguageCode:e.preferences?.language||"01",Moniker:e.personalInfo?.title,Gender:e.personalInfo?.gender?pe(e.personalInfo?.gender):void 0,BirthDate:e.personalInfo?.dateOfBirth,CitizenshipCode:e.personalInfo?.nationality,Email:e.contact?.email?.address,FirstPhoneNumber:e.contact?.phone?.number,MobilePhone:e.contact?.phone?.number,Address:e.address?.street,CityName:e.address?.city,StateCode:e.address?.country,ZipCode:e.address?.postalCode,FiscalCode:e.businessInfo?.taxId,VatCode:e.businessInfo?.taxId,RecordStatus:ce(e.status),FinancialDetail:e.preferences?.currency?{"@CurrencyCode":e.preferences.currency}:void 0}}a(v,"mapCustomerToXml");function de(e){return{CustomerDetail:e.customerDetails?v(e.customerDetails):{"@RecordCode":e.customerId||"",RecordType:"CUSTOMER",Name:"Customer",LanguageCode:"01"},CurrencyCode:e.currency,BookingFileStatus:{"@Value":"QUOTATION"},StatisticCodes:e.statisticCodes?{"@sCode1":e.statisticCodes.code1,"@sCode2":e.statisticCodes.code2,"@sCode3":e.statisticCodes.code3,"@sCode4":e.statisticCodes.code4,"@sCode5":e.statisticCodes.code5,"@sCode6":e.statisticCodes.code6}:void 0,Destination:e.destination?{"@Code":e.destination.code,"@IataCode":e.destination.iataCode,"@NationCode":e.destination.nationCode}:void 0,BookingFileDescription:e.description,StartDate:e.startDate,EndDate:e.endDate,BookingFileDocument:e.printDocument!==void 0||e.sendDocumentViaEmail!==void 0?{"@PrintDoc":e.printDocument||!1,"@SendDocViaEmail":e.sendDocumentViaEmail||!1}:void 0,DeadlineList:e.deadlines?{DeadlineDetail:e.deadlines.map(n=>({"@DeadlineCode":n.code,"@Description":n.description,"@ExpireDate":n.expireDate}))}:void 0,PassengerList:{PassengerDetail:e.passengers.map((n,r)=>Ft(n,r+1))},SelectedServiceList:{SelectedServiceDetail:e.services.map((n,r)=>Pt(n,r+1))}}}a(de,"mapCreateBookingToXml");function Ft(e,t){return{"@RPH":String(t).padStart(3,"0"),Name:`${e.firstName} ${e.lastName}`,CategoryCode:e.type===C.ADULT?"AD":e.type===C.CHILD?"CH":e.type===C.INFANT?"IN":"OV",Sex:e.gender===h.MALE?"M":"F",BirthDate:e.dateOfBirth,eMail:e.contact?.email?.address,PhoneNumber:e.contact?.phone?.number}}a(Ft,"mapPassengerToAvesXml");function Pt(e,t){return{"@sCode":e.id,AvesServiceType:"TOP",StartDate:e.startDate||new Date().toISOString(),EndDate:e.endDate||new Date().toISOString(),Qty:1,Pax:1,AvesSession:t}}a(Pt,"mapServiceToAvesXml");function Ee(e){return{BookingFileCode:e.bookingId,CustomerRecordCode:e.customerId||""}}a(Ee,"mapCancelBookingToXml");function Re(e){return{RefMasterRecordCode:e.customerId||"",LanguageCode:e.language||"01",BookingFileCode:e.bookingId,InfoDocumentsToPrint:{InfoDocumentToPrint:[{DocumentType:ue(e.documentType)}]},GetDocumentContent:e.deliveryMethod?.type==="download",SendDocumentViaEmail:e.deliveryMethod?.type==="email"}}a(Re,"mapPrintDocumentToXml");function ge(e){let t="AbsoluteAmountsInsertion";return e.operationType==="final"?t="FinalAmountToAchieve":e.operationType==="final_no_controls"&&(t="FinalAmountToAchieveWithoutControls"),{BookingFileCode:e.bookingId,BookingFileRefCode:e.bookingRefCode,EnableMultiplePayments:e.enableMultiple??e.payments.length>1,OperationType:t,FilePaymentList:{FilePaymentDetail:e.payments.map(n=>({"@PaymentDate":new Date().toISOString(),"@Amount":String(n.amount?.amount||0),"@PaymentType":ao(n.type)}))}}}a(ge,"mapAddPaymentToXml");function ao(e){return{cash:"C",bank:"B",bank2:"D",bank3:"T",atm:"P",creditCard:"R",credit_card:"R",rebate:"A"}[e]||"C"}a(ao,"mapPaymentTypeToAvesXml");function Ie(e){let t=v(e);return t["@InsertCriteria"]="S",{MasterRecordDetail:t}}a(Ie,"mapCreateCustomerToXml");function Se(e){let t=v(e);return t["@InsertCriteria"]="T",{MasterRecordDetail:t}}a(Se,"mapUpdateCustomerToXml");function Te(e){let t=v(e);return t["@InsertCriteria"]="M",{MasterRecordDetail:t}}a(Te,"mapUpsertCustomerToXml");function fe(e,t,n,r){return{BookingFileCode:t,BookingFileStartDate:n,CustomerRecordCode:e,NewCustomerRecordCode:r?.newCustomerRecordCode,BookingNote:r?.notes,PassengerList:r?.passengers?{PassengerDetail:r.passengers.map((i,c)=>Ft(i,c+1))}:void 0}}a(fe,"mapUpdateBookingHeaderToXml");function Ce(e,t,n){return{CustomerRecordCode:e,BookingFileCode:t,SelectedServiceList:{SelectedServiceDetail:n.map((r,i)=>Pt(r,i+1))}}}a(Ce,"mapUpdateBookingServicesToXml");function he(e,t,n,r){return{CustomerRecordCode:e,BookingFileCode:t,FileStatus:{"@Value":me(n),...r?.expiredDate&&{"@ExpiredDate":r.expiredDate},...r?.optionedFileExpireDatePolicy&&{"@OptionedFileExpireDatePolicy":r.optionedFileExpireDatePolicy}},...r?.backOfficeRequest!==void 0&&{BackOfficeRequest:r.backOfficeRequest},...r?.printDoc!==void 0||r?.sendDocViaEmail!==void 0?{BookingFileDocument:{"@PrintDoc":r.printDoc||!1,"@SendDocViaEmail":r.sendDocViaEmail||!1}}:{},...r?.applyPenalty!==void 0&&{Penalty:{"@Apply":r.applyPenalty,...r.penaltyCode&&{"@SpecificCode":r.penaltyCode}}},...r?.simulateCancelAndGetPenalty!==void 0&&{SimulateCancelAndGetPenaltyAmount:r.simulateCancelAndGetPenalty}}}a(he,"mapSetBookingStatusToXml");function ye(e,t,n,r){return{CustomerRecordCode:e,BookingFileCode:t,BookingServiceRef:n,BookingFileServiceStatus:"NULLIFIED",...r&&{BookingFileServiceStatusDate:r}}}a(ye,"mapSetBookingServiceStatusToXml");function ze(e){let t=(e.Name??"").split(" "),n=t.pop()??"",r=t.join(" ")??e.Name;return{id:e["@RecordCode"],type:_t(e.RecordType),status:bt(e.RecordStatus??""),personalInfo:{title:e.Moniker,firstName:r,lastName:n,dateOfBirth:e.BirthDate?A(e.BirthDate):void 0,gender:e.Gender==="M"?h.MALE:e.Gender==="F"?h.FEMALE:void 0,nationality:e.CitizenshipCode},contact:{email:e.Email?{address:e.Email}:void 0,phone:e.FirstPhoneNumber?{number:e.FirstPhoneNumber}:void 0,mobile:e.MobilePhone?{number:e.MobilePhone}:void 0},address:e.Address?{street:e.Address,city:e.CityName,state:e.CountyCode,postalCode:e.ZipCode,country:e.StateCode}:void 0,businessInfo:e.VatCode||e.FiscalCode?{companyName:void 0,taxId:e.VatCode||e.FiscalCode,licenseNumber:void 0}:void 0,preferences:{language:e.LanguageCode,currency:e.FinancialDetail?.["@CurrencyCode"],communicationMethod:void 0}}}a(ze,"mapCustomerFromXml");function B(e){return e?e.MasterRecordDetail?{success:!0,message:"Operation successful",data:ze(e.MasterRecordDetail)}:{success:!1,message:"No master record in response",data:void 0}:{success:!1,message:"Invalid XML response",data:void 0}}a(B,"mapCustomerResponseFromXml");function Ze(e){return{id:e.BookingFileCode,status:xt(e.BookingFileStatus["@Value"]),createdAt:ie(e.CreationDate),updatedAt:ie(e.CreationDate),customer:ze({"@RecordCode":e.CustomerRecordCode,RecordType:"CUSTOMER",Name:e.CustomerName,LanguageCode:"01",Email:e.CustomerEmail}),passengers:e.PassengerList.PassengerDetail.map(Lt),services:e.BookedServiceList?.BookedServiceDetail.map(Mt)||[],pricing:{totalAmount:{currency:e.TotalAmountDetail?.CurrencyCode||"EUR",amount:parseFloat(e.TotalAmountDetail?.TotalAmountAfterDiscount||"0")},breakdowns:void 0}}}a(Ze,"mapBookingFromXml");function b(e){if(!e)return{success:!1,message:"Invalid XML response",data:void 0};let t=e.OperationResult["@Status"]==="SUCCESS";if(!t||!e.BookingFile)return{success:t,message:e?.OperationResult["@Message"],data:void 0};let n=Ze(e.BookingFile);return{success:t,message:e.OperationResult["@Message"],data:n}}a(b,"mapBookingResponseFromXml");function Ne(e,t){let i=t?.pages||50,c=t?.page||1;if(!e||!e.MasterRecordList)return{customers:[],pagination:{page:c,pages:1,totalItems:0,hasMore:!1}};let u=e.MasterRecordList.MasterRecordDetail.map(ze),R=u.length,at=R===i,Wt=at?c+1:c;return{customers:u,pagination:{page:c,pages:Wt,totalItems:R,hasMore:at}}}a(Ne,"mapSearchResponseFromXml");function De(e){if(!e)return{success:!1,message:"Invalid XML response",data:void 0};let t=e.BaseDocumentAndAttachments?.SingleBaseDocumentOrAttachment.map(i=>({fileName:i.DocFileName,content:i.Base64DocContent,contentSize:i.Base64DocContent?.length||0}))||[],n=e.AdditionalDocuments?.AdditionalDocument.map(i=>({emailRecipient:i.EmailRecipient,documents:i.BaseDocumentAndAttachments?.SingleBaseDocumentOrAttachment.map(c=>({fileName:c.DocFileName,content:c.Base64DocContent,contentSize:c.Base64DocContent?.length||0}))||[]}));return{success:!0,message:"Documents generated successfully",data:{emailRecipient:e.EmailRecipient,documents:t,additionalDocuments:n}}}a(De,"mapDocumentResponseFromXml");function Oe(e){if(!e)return{success:!1,message:"Invalid XML response",data:void 0};let t=e.OperationResult["@Status"]==="SUCCESS";return t?{success:t,message:e.OperationResult["@Message"],data:{refundInfo:e.OperationResult.RefundInfo?{refundAmount:e.OperationResult.RefundInfo["@RefundAmount"],currency:e.OperationResult.RefundInfo["@Currency"],refundMethod:e.OperationResult.RefundInfo["@RefundMethod"],processingTime:e.OperationResult.RefundInfo["@ProcessingTime"]}:void 0}}:{success:t,message:e?.OperationResult["@Message"],data:void 0}}a(Oe,"mapCancelResponseFromXml");function Ae(e){return e?{success:!0,message:"Payment registered successfully",data:{booking:void 0,paymentSummary:{totalPaid:{currency:"EUR",amount:0},outstandingAmount:{currency:"EUR",amount:0},paymentHistory:[]}}}:{success:!1,message:"Invalid XML response",data:void 0}}a(Ae,"mapPaymentResponseFromXml");var Le=require("@nestjs/common"),st=require("@nestjs/config");var H=require("@nestjs/common");var D=Symbol("AVES_SDK_CONFIG"),x=Symbol("XML_HTTP_CLIENT");var g={SEARCH_MASTER_RECORD:"SearchMasterRecordRQ",MANAGE_MASTER_RECORD:"ManageMasterRecordRQ",BOOK_FILE:"BookFileRQ",MODI_FILE_HEADER:"ModiFileHeaderRQ",MOD_FILE_SERVICES:"ModFileServicesRQ",SET_STATUS:"SetStatusRQ",SET_STATUS_SERVICE:"SetStatusServiceRQ",CANCEL_FILE:"CancelFileRQ",FILE_PAYMENT_LIST:"FilePaymentListRQ",PRINT_BOOKING_DOCUMENT:"PrintBookingDocumentRQ"};var I={SEARCH_MASTER_RECORDS:"/interop/masterRecords/v2/rest/Search",INSERT_OR_UPDATE_MASTER_RECORD:"/interop/masterRecords/v2/rest/InsertOrUpdate",CREATE_BOOKING_FILE:"/interop/booking/v2/rest/CreateBookingFile",MOD_BOOKING_FILE_HEADER:"/interop/booking/v2/rest/ModBookingFileHeader",MOD_BOOKING_FILE_SERVICES:"/interop/booking/v2/rest/ModBookingFileServices",SET_BOOKING_FILE_STATUS:"/interop/booking/v2/rest/SetBookingFileStatus",SET_BOOKING_FILE_SERVICE_STATUS:"/interop/booking/v2/rest/SetBookingFileServiceStatus",CANCEL_BOOKING_FILE:"/interop/booking/v2/rest/CancelBookingFile",INSERT_FILE_PAYMENT_LIST:"/interop/booking/v2/rest/InsertFilePaymentList",PRINT_BOOKING_DOCUMENT:"/interop/document/v2/rest/PrintBookingDocument"};var et=class et{constructor(t){p(this,"RqHeader");p(this,"Body");Object.assign(this,t)}};a(et,"RequestPayload");var Je=et,tt=class tt{constructor(t){p(this,"Request");this.Request=new Je(t)}};a(tt,"WrapRequestDto");var _e=tt;function co(e,t,n,r){var i=arguments.length,c=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(e,t,n,r);else for(var R=e.length-1;R>=0;R--)(u=e[R])&&(c=(i<3?u(c):i>3?u(t,n,c):u(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c}a(co,"_ts_decorate");function vt(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}a(vt,"_ts_metadata");function Bt(e,t){return function(n,r){t(n,r,e)}}a(Bt,"_ts_param");var ot=class ot{constructor(t,n){p(this,"config");p(this,"http");this.config=t,this.http=n}buildHeader(){let{hostId:t,xtoken:n,languageCode:r}=this.config;return{"@HostID":t,"@Xtoken":n,"@Interface":"WEB","@UserName":"WEB","@LanguageCode":r}}wrapRequest(t){return new _e({RqHeader:this.buildHeader(),Body:t})}async searchCustomers(t){let n=le(t),r=await this.http.postXml(I.SEARCH_MASTER_RECORDS,g.SEARCH_MASTER_RECORD,this.wrapRequest(n));return Ne(r.Response.Body,t.pagination)}async createCustomer(t){let n=Ie(t),r=await this.http.postXml(I.INSERT_OR_UPDATE_MASTER_RECORD,g.MANAGE_MASTER_RECORD,this.wrapRequest(n));return B(r.Response.Body)}async updateCustomer(t){let n=Se(t),r=await this.http.postXml(I.INSERT_OR_UPDATE_MASTER_RECORD,g.MANAGE_MASTER_RECORD,this.wrapRequest(n));return B(r.Response.Body)}async upsertCustomer(t){let n=Te(t),r=await this.http.postXml(I.INSERT_OR_UPDATE_MASTER_RECORD,g.MANAGE_MASTER_RECORD,this.wrapRequest(n));return B(r.Response.Body)}async createBooking(t){let n=de(t),r=await this.http.postXml(I.CREATE_BOOKING_FILE,g.BOOK_FILE,this.wrapRequest(n));return b(r.Response.Body)}async updateBookingHeader(t,n,r,i){let c=fe(t,n,r,i),u=await this.http.postXml(I.MOD_BOOKING_FILE_HEADER,g.MODI_FILE_HEADER,this.wrapRequest(c));return{success:u.Response.RsStatus["@Status"]==="OK",message:u.Response.RsStatus.ErrorDescription}}async updateBookingServices(t,n,r){let i=Ce(t,n,r),c=await this.http.postXml(I.MOD_BOOKING_FILE_SERVICES,g.MOD_FILE_SERVICES,this.wrapRequest(i));return b(c.Response.Body)}async setBookingStatus(t,n,r,i){let c=he(t,n,r,i),u=await this.http.postXml(I.SET_BOOKING_FILE_STATUS,g.SET_STATUS,this.wrapRequest(c));return b(u.Response.Body)}async setBookingServiceStatus(t,n,r,i){let c=ye(t,n,r,i),u=await this.http.postXml(I.SET_BOOKING_FILE_SERVICE_STATUS,g.SET_STATUS_SERVICE,this.wrapRequest(c));return b(u.Response.Body)}async cancelBooking(t){let n=Ee(t),r=await this.http.postXml(I.CANCEL_BOOKING_FILE,g.CANCEL_FILE,this.wrapRequest(n));return Oe(r.Response.Body)}async addPayment(t){let n=ge(t),r=await this.http.postXml(I.INSERT_FILE_PAYMENT_LIST,g.FILE_PAYMENT_LIST,this.wrapRequest(n));return Ae(r.Response.Body)}async printDocument(t){let n=Re(t),r=await this.http.postXml(I.PRINT_BOOKING_DOCUMENT,g.PRINT_BOOKING_DOCUMENT,this.wrapRequest(n));return De(r.Response.Body)}async searchMasterRecord(t){return this.http.postXml(I.SEARCH_MASTER_RECORDS,g.SEARCH_MASTER_RECORD,this.wrapRequest(t))}async insertOrUpdateMasterRecord(t){return this.http.postXml(I.INSERT_OR_UPDATE_MASTER_RECORD,g.MANAGE_MASTER_RECORD,this.wrapRequest(t))}async createBookingFile(t){return this.http.postXml(I.CREATE_BOOKING_FILE,g.BOOK_FILE,this.wrapRequest(t))}async cancelBookingFile(t){return this.http.postXml(I.CANCEL_BOOKING_FILE,g.CANCEL_FILE,this.wrapRequest(t))}async printBookingDocument(t){return this.http.postXml(I.PRINT_BOOKING_DOCUMENT,g.PRINT_BOOKING_DOCUMENT,this.wrapRequest(t))}};a(ot,"AvesService");var y=ot;y=co([(0,H.Injectable)(),Bt(0,(0,H.Inject)(D)),Bt(1,(0,H.Inject)(x)),vt("design:type",Function),vt("design:paramtypes",[typeof AvesSdkConfig>"u"?Object:AvesSdkConfig,typeof IXmlHttpClient>"u"?Object:IXmlHttpClient])],y);var kt=oo(require("axios"),1),be=require("fast-xml-parser"),U=require("@nestjs/common");function mo(e,t,n,r){var i=arguments.length,c=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(e,t,n,r);else for(var R=e.length-1;R>=0;R--)(u=e[R])&&(c=(i<3?u(c):i>3?u(t,n,c):u(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c}a(mo,"_ts_decorate");function Ut(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}a(Ut,"_ts_metadata");function uo(e,t){return function(n,r){t(n,r,e)}}a(uo,"_ts_param");var nt=class nt{constructor(t){p(this,"config");p(this,"httpClient");p(this,"xmlBuilder");p(this,"xmlParser");this.config=t,this.httpClient=kt.default.create({baseURL:t.baseUrl,timeout:typeof t.timeout=="number"?t.timeout:3e4,headers:{"Content-Type":"application/xml",Accept:"application/xml, text/xml, */*;q=0.1"},transitional:{clarifyTimeoutError:!0},validateStatus:a(n=>n>=200&&n<300,"validateStatus")}),this.xmlBuilder=new be.XMLBuilder({attributeNamePrefix:"@",ignoreAttributes:!1,suppressEmptyNode:!0,format:process.env.NODE_ENV?.toLowerCase()==="development"}),this.xmlParser=new be.XMLParser({attributeNamePrefix:"@",ignoreAttributes:!1,parseAttributeValue:!1,trimValues:!0,isArray:a(n=>["Field","Item","Service","Passenger","Payment","MasterRecord","Request","Notes","ServiceID"].includes(n),"isArray")})}async postXml(t,n,r,i){let c=this.xmlBuilder.build({[n]:r}),u=await this.httpClient.post(t,c,i);return this.xmlParser.parse(u.data)}};a(nt,"XmlHttpClient");var L=nt;L=mo([(0,U.Injectable)({scope:U.Scope.DEFAULT}),uo(0,(0,U.Inject)(D)),Ut("design:type",Function),Ut("design:paramtypes",[typeof AvesSdkConfig>"u"?Object:AvesSdkConfig])],L);var Vt=require("@nestjs/config"),Xt="aves",xe=(0,Vt.registerAs)(Xt,()=>({baseUrl:process.env.AVES_BASE_URL??"",hostId:process.env.AVES_HOST_ID??"",xtoken:process.env.AVES_XTOKEN??"",languageCode:process.env.AVES_LANGUAGE_CODE,timeout:process.env.AVES_TIMEOUT?Number(process.env.AVES_TIMEOUT):void 0}));var s=require("zod"),wt=s.z.enum(["01","02"]),rt=s.z.object({baseUrl:s.z.url(),hostId:s.z.string().length(6),xtoken:s.z.string(),languageCode:wt.optional(),timeout:s.z.number().optional()}),jt=s.z.object({"@Type":s.z.enum(["HOME","WORK","BILLING","DELIVERY"]).optional(),Street:s.z.string().max(100).optional(),City:s.z.string().max(50).optional(),State:s.z.string().max(50).optional(),PostalCode:s.z.string().max(20).optional(),Country:s.z.string().max(50).optional()}),Gt=s.z.object({Phone:s.z.object({"@Type":s.z.enum(["HOME","WORK","MOBILE","FAX"]).optional(),"@Number":s.z.string()}).optional(),Email:s.z.object({"@Type":s.z.enum(["HOME","WORK"]).optional(),"@Address":s.z.string()}).optional()}),qt=s.z.object({"@PassengerID":s.z.string().min(1),"@Type":s.z.enum(["ADT","CHD","INF"]),"@Title":s.z.enum(["MR","MRS","MS","DR","PROF"]).optional(),FirstName:s.z.string().min(1).max(50),LastName:s.z.string().min(1).max(50),DateOfBirth:s.z.date().optional(),Gender:s.z.enum(["M","F"]).optional(),Nationality:s.z.string().max(3).optional(),Address:jt.optional(),ContactInfo:Gt.optional()}),Ht=s.z.object({"@ServiceID":s.z.string().min(1),"@Type":s.z.enum(["FLIGHT","HOTEL","CAR","TRANSFER","INSURANCE"]),"@Status":s.z.enum(["CONFIRMED","PENDING","CANCELLED"]),ServiceDetails:s.z.object({Code:s.z.string().optional(),Name:s.z.string().optional(),Description:s.z.string().optional(),StartDate:s.z.string().optional(),EndDate:s.z.string().optional(),Price:s.z.object({"@Currency":s.z.string(),"@Amount":s.z.number()}).optional()})}),po=s.z.object({"@PaymentID":s.z.string().min(1),"@Type":s.z.enum(["CREDIT_CARD","DEBIT_CARD","BANK_TRANSFER","CASH"]),"@Status":s.z.enum(["PENDING","CONFIRMED","FAILED"]),Amount:s.z.object({"@Currency":s.z.string(),"@Amount":s.z.number()}),PaymentDetails:s.z.object({CardNumber:s.z.string().optional(),ExpiryDate:s.z.string().optional(),CardHolderName:s.z.string().optional()}).optional()}),lo=s.z.object({SearchCriteria:s.z.object({MasterRecordType:s.z.enum(["CUSTOMER","AGENT","SUPPLIER"]),SearchFields:s.z.object({Field:s.z.array(s.z.object({"@Name":s.z.string(),"@Value":s.z.string(),"@Operator":s.z.enum(["EQUALS","CONTAINS","STARTS_WITH","ENDS_WITH"]).optional()}))}),Pagination:s.z.object({"@PageSize":s.z.number(),"@PageNumber":s.z.number()}).optional()})}),Eo=s.z.object({BookingDetails:s.z.object({"@BookingType":s.z.enum(["INDIVIDUAL","GROUP","CORPORATE"]),"@Priority":s.z.enum(["LOW","NORMAL","HIGH","URGENT"]),CustomerInfo:s.z.object({"@CustomerID":s.z.string().optional(),CustomerDetails:s.z.any().optional()}),PassengerList:s.z.object({Passenger:s.z.array(qt)}),SelectedServiceList:s.z.object({Service:s.z.array(Ht)}),SpecialRequests:s.z.object({Request:s.z.array(s.z.object({"@Type":s.z.enum(["MEAL","SEAT","WHEELCHAIR","OTHER"]),"@Description":s.z.string()}))}).optional()})}),Ro=s.z.object({"@BookingFileID":s.z.string().min(1),CancellationDetails:s.z.object({"@Reason":s.z.enum(["CUSTOMER_REQUEST","NO_SHOW","OPERATIONAL","OTHER"]),"@Description":s.z.string().optional(),RefundRequest:s.z.object({"@Amount":s.z.number(),"@Currency":s.z.string(),"@Method":s.z.enum(["ORIGINAL_PAYMENT","CREDIT","CASH"])}).optional()})}),go=s.z.object({"@BookingFileID":s.z.string().min(1),DocumentRequest:s.z.object({"@DocumentType":s.z.enum(["CONFIRMATION","INVOICE","VOUCHER","TICKET","ALL"]),"@Format":s.z.enum(["PDF","HTML","XML"]),"@Language":s.z.string().optional(),DeliveryMethod:s.z.object({"@Type":s.z.enum(["EMAIL","SMS","DOWNLOAD"]),"@Address":s.z.string().optional()}).optional()})});function Io(e,t,n,r){var i=arguments.length,c=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(e,t,n,r);else for(var R=e.length-1;R>=0;R--)(u=e[R])&&(c=(i<3?u(c):i>3?u(t,n,c):u(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c}a(Io,"_ts_decorate");var M=class M{static forRoot(t){let n=this.validateConfig(t);return{module:M,imports:[st.ConfigModule.forFeature(xe)],providers:[{provide:D,useValue:n},this.createXmlHttpClientProvider(),y],exports:[y,x]}}static forRootAsync(t){let n=this.createAsyncProviders(t);return{module:M,imports:[...t.imports??[],st.ConfigModule.forFeature(xe)],providers:[...n,this.createXmlHttpClientProvider(),y],exports:[y,x]}}static createXmlHttpClientProvider(){return{provide:x,useClass:L}}static createAsyncProviders(t){if(t.useFactory)return[{provide:D,useFactory:a(async(...i)=>{try{let c=await t.useFactory(...i);return this.validateConfig(c)}catch(c){throw new Error(`Failed to create Aves configuration: ${c.message}`)}},"useFactory"),inject:t.inject??[]}];let n=t.useClass||t.useExisting;if(!n)throw new Error("Invalid AvesModule async options: provide useFactory, useClass, or useExisting");let r=[{provide:D,useFactory:a(async i=>{try{let c=await i.createAvesOptions();return this.validateConfig(c)}catch(c){throw new Error(`Failed to create Aves configuration: ${c.message}`)}},"useFactory"),inject:[n]}];return t.useClass&&r.push({provide:t.useClass,useClass:t.useClass}),r}static validateConfig(t){let n=rt.safeParse(t);if(!n.success)throw new Error(`Invalid AVES SDK configuration: ${n.error.issues.map(r=>r.message).join(", ")}`);return n.data}};a(M,"AvesModule"),p(M,"MODULE_NAME","AvesModule"),p(M,"VERSION","1.0.0");var K=M;K=Io([(0,Le.Global)(),(0,Le.Module)({})],K);var So=(function(e){return e.OK="OK",e.ERROR="ERROR",e.WARNING="WARNING",e.TIMEOUT="TIMEOUT",e})({}),E=(function(e){return e.ERROR="ERROR",e.WARNING="WARNING",e.INFO="INFO",e})({}),m=(function(e){return e.INVALID_TOKEN="AVES_001",e.TOKEN_EXPIRED="AVES_002",e.INSUFFICIENT_PERMISSIONS="AVES_003",e.INVALID_REQUEST_FORMAT="AVES_100",e.MISSING_REQUIRED_FIELD="AVES_101",e.INVALID_FIELD_VALUE="AVES_102",e.INVALID_DATE_FORMAT="AVES_103",e.BOOKING_NOT_FOUND="AVES_200",e.BOOKING_ALREADY_CANCELLED="AVES_201",e.INVALID_BOOKING_STATUS="AVES_202",e.PAYMENT_FAILED="AVES_203",e.INSUFFICIENT_INVENTORY="AVES_204",e.INTERNAL_SERVER_ERROR="AVES_500",e.SERVICE_UNAVAILABLE="AVES_501",e.TIMEOUT="AVES_502",e.RATE_LIMIT_EXCEEDED="AVES_503",e})({}),To=(function(e){return e.INSERT="INSERT",e.UPDATE="UPDATE",e.UPSERT="UPSERT",e})({});var Kt=require("zod");var Fe=class Fe{constructor(t){p(this,"schema");this.schema=t}validate(t){if(!this.schema)throw new Error("No schema provided. Either pass schema to constructor or as method parameter.");return this.schema.parse(t)}async asyncValidate(t){if(!this.schema)throw new Error("No schema provided. Either pass schema to constructor or as method parameter.");return this.schema.parseAsync(t)}safeValidateAndParse(t){return this.schema?this.schema.safeParse(t):this.createError({message:"No schema provided. Either pass schema to constructor or as method parameter.",path:[]})}async safeAsyncValidateAndParse(t){return this.schema?this.schema.safeParseAsync(t):this.createError({message:"No schema provided. Either pass schema to constructor or as method parameter.",path:[]})}getErrorMessage(t,n="; "){return t.issues.map(r=>`${r.path.length>0?`${r.path.join(".")}: `:""}${r.message}`).join(n)}createError({message:t,path:n}){return{success:!1,error:new Kt.ZodError([{code:"custom",message:t,path:n}])}}static withSchema(t){return new Fe(t)}};a(Fe,"AvesValidator");var Me=Fe;function fo(e){return new Me(e)}a(fo,"createAvesValidator");var Yt=require("@nestjs/common");var k=class k extends Error{constructor(n,r,i={}){super(r);p(this,"code");p(this,"severity");p(this,"timestamp");p(this,"requestId");p(this,"context");this.name="AvesException",this.code=n,this.severity=i.severity||E.ERROR,this.timestamp=new Date().toISOString(),this.context=i.context,this.requestId=i.requestId||this.generateRequestId(),Object.setPrototypeOf(this,k.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,k)}static fromAvesError(n){return new k(n.code,n.message,{severity:n.severity,context:n.context,requestId:n.requestId})}isRetryable(){return[m.TIMEOUT,m.SERVICE_UNAVAILABLE,m.INTERNAL_SERVER_ERROR,m.RATE_LIMIT_EXCEEDED].includes(this.code)}getUserFriendlyMessage(){return{[m.INVALID_TOKEN]:"Your session has expired. Please log in again.",[m.TOKEN_EXPIRED]:"Your session has expired. Please log in again.",[m.INSUFFICIENT_PERMISSIONS]:"You do not have permission to perform this action.",[m.BOOKING_NOT_FOUND]:"The requested booking could not be found.",[m.BOOKING_ALREADY_CANCELLED]:"This booking has already been cancelled.",[m.PAYMENT_FAILED]:"Payment processing failed. Please try again.",[m.INSUFFICIENT_INVENTORY]:"The requested service is no longer available.",[m.SERVICE_UNAVAILABLE]:"The service is temporarily unavailable. Please try again later.",[m.TIMEOUT]:"The request timed out. Please try again.",[m.RATE_LIMIT_EXCEEDED]:"Too many requests. Please wait a moment and try again."}[this.code]||this.message}toJSON(){return{name:this.name,code:this.code,message:this.message,severity:this.severity,timestamp:this.timestamp,requestId:this.requestId,context:this.context,stack:this.stack,isRetryable:this.isRetryable(),userFriendlyMessage:this.getUserFriendlyMessage()}}toAvesError(){return{code:this.code,message:this.message,severity:this.severity,timestamp:this.timestamp,requestId:this.requestId,context:this.context}}getHttpStatusCode(){switch(this.code){case m.INVALID_TOKEN:case m.TOKEN_EXPIRED:return 401;case m.INSUFFICIENT_PERMISSIONS:return 403;case m.BOOKING_NOT_FOUND:return 404;case m.INVALID_REQUEST_FORMAT:case m.MISSING_REQUIRED_FIELD:case m.INVALID_FIELD_VALUE:return 400;case m.RATE_LIMIT_EXCEEDED:return 429;case m.SERVICE_UNAVAILABLE:return 503;case m.TIMEOUT:return 408;default:return 500}}getCategory(){return this.code.startsWith("AVES_1")?"Authentication":this.code.startsWith("AVES_2")?"Business Logic":this.code.startsWith("AVES_5")?"System":"Unknown"}generateRequestId(){return`aves_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}};a(k,"AvesException");var d=k;function Co(e,t,n,r){var i=arguments.length,c=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(e,t,n,r);else for(var R=e.length-1;R>=0;R--)(u=e[R])&&(c=(i<3?u(c):i>3?u(t,n,c):u(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c}a(Co,"_ts_decorate");var it=class it{parseError(t){return t instanceof d?t:this.isHttpError(t)?this.parseHttpError(t):this.isAvesXmlResponse(t)?this.parseAvesXmlError(t):t instanceof Error?new d(m.INTERNAL_SERVER_ERROR,t.message,{severity:E.ERROR,context:this.buildContext({type:"javascript_error",errorName:t.name,stack:t.stack||"No stack trace available"})}):new d(m.INTERNAL_SERVER_ERROR,"Unknown error occurred",{severity:E.ERROR,context:this.buildContext({type:"unknown_error",errorName:typeof t,errorValue:String(t)})})}parseHttpError(t){if(t.response){let n=t.response.status,r=t.response.statusText;switch(n){case 400:return new d(m.INVALID_REQUEST_FORMAT,`Bad Request: ${r}`,{severity:E.ERROR,context:this.buildContext({type:"http_error",errorName:n,statusText:r,url:t.config?.url,method:t.config?.method,timeout:t.config?.timeout})});case 401:return new d(m.INVALID_TOKEN,"Authentication failed",{severity:E.ERROR,context:this.buildContext({type:"http_error",status:n,url:t.config?.url,method:t.config?.method,timeout:t.config?.timeout})});case 403:return new d(m.INSUFFICIENT_PERMISSIONS,"Access forbidden",{severity:E.ERROR,context:this.buildContext({type:"http_error",status:n,url:t.config?.url,method:t.config?.method,timeout:t.config?.timeout})});case 404:return new d(m.BOOKING_NOT_FOUND,"Resource not found",{severity:E.ERROR,context:this.buildContext({type:"http_error",status:n,url:t.config?.url,method:t.config?.method,timeout:t.config?.timeout})});case 429:return new d(m.RATE_LIMIT_EXCEEDED,"Rate limit exceeded",{severity:E.ERROR,context:this.buildContext({type:"http_error",status:n,retryAfter:t.response.headers?.["retry-after"]})});case 500:return new d(m.INTERNAL_SERVER_ERROR,"Internal server error",{severity:E.ERROR,context:this.buildContext({type:"http_error",status:n,url:t.config?.url,method:t.config?.method,timeout:t.config?.timeout})});case 503:return new d(m.SERVICE_UNAVAILABLE,"Service unavailable",{severity:E.ERROR,context:this.buildContext({type:"http_error",status:n,url:t.config?.url,method:t.config?.method,timeout:t.config?.timeout})});default:return new d(m.INTERNAL_SERVER_ERROR,`HTTP ${n}: ${r}`,{severity:E.ERROR,context:this.buildContext({type:"http_error",status:n,statusText:r,url:t.config?.url,method:t.config?.method,timeout:t.config?.timeout})})}}else return t.request?new d(m.TIMEOUT,"Request timeout - no response from AVES API",{severity:E.ERROR,context:this.buildContext({type:"http_error",timeout:!0,url:t.config?.url,method:t.config?.method,configuredTimeout:t.config?.timeout})}):new d(m.INTERNAL_SERVER_ERROR,`Request setup error: ${t.message}`,{severity:E.ERROR,context:this.buildContext({type:"http_error",setupError:!0})})}parseAvesXmlError(t){if(!t?.Response?.RsStatus)return new d(m.INVALID_REQUEST_FORMAT,"Invalid response format from AVES API",{severity:E.ERROR,context:this.buildContext({type:"aves_xml_error",missingRsStatus:!0})});let n=t.Response.RsStatus;if(n["@Status"]==="ERROR")return new d(n.ErrorCode||m.INTERNAL_SERVER_ERROR,n.ErrorDescription||"Unknown error from AVES API",{severity:E.ERROR,context:this.buildContext({type:"aves_xml_error",originalResponse:n})});if(n.Warnings?.Warning){let r=Array.isArray(n.Warnings.Warning)?n.Warnings.Warning:[n.Warnings.Warning];return new d(m.INVALID_FIELD_VALUE,r.join("; "),{severity:E.WARNING,context:this.buildContext({type:"aves_xml_warning",warnings:r})})}return new d(m.INTERNAL_SERVER_ERROR,"Unexpected response from AVES API",{severity:E.ERROR,context:this.buildContext({type:"aves_xml_error",unexpectedResponse:!0,status:n["@Status"]})})}isRetryable(t){return[m.TIMEOUT,m.SERVICE_UNAVAILABLE,m.INTERNAL_SERVER_ERROR,m.RATE_LIMIT_EXCEEDED].includes(t.code)}getUserFriendlyMessage(t){return{[m.INVALID_TOKEN]:"Your session has expired. Please log in again.",[m.TOKEN_EXPIRED]:"Your session has expired. Please log in again.",[m.INSUFFICIENT_PERMISSIONS]:"You do not have permission to perform this action.",[m.BOOKING_NOT_FOUND]:"The requested booking could not be found.",[m.BOOKING_ALREADY_CANCELLED]:"This booking has already been cancelled.",[m.PAYMENT_FAILED]:"Payment processing failed. Please try again.",[m.INSUFFICIENT_INVENTORY]:"The requested service is no longer available.",[m.SERVICE_UNAVAILABLE]:"The service is temporarily unavailable. Please try again later.",[m.TIMEOUT]:"The request timed out. Please try again.",[m.RATE_LIMIT_EXCEEDED]:"Too many requests. Please wait a moment and try again."}[t.code]||t.message}buildContext(t){let n={};return typeof t=="object"&&t!==null?Object.keys(t).forEach(r=>{let i=t[r];if(this.isSensitiveKey(r)){n[r]="********";return}this.isSerializableValue(i)?n[r]=i:typeof i=="function"?n[r]="[Function]":i instanceof Error?n[r]={name:i.name,message:i.message,stack:i.stack?.split(`
1
+ var ut=Object.create;var P=Object.defineProperty;var pt=Object.getOwnPropertyDescriptor;var lt=Object.getOwnPropertyNames;var dt=Object.getPrototypeOf,Et=Object.prototype.hasOwnProperty;var Rt=(e,t,n)=>t in e?P(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var a=(e,t)=>P(e,"name",{value:t,configurable:!0});var gt=(e,t)=>{for(var n in t)P(e,n,{get:t[n],enumerable:!0})},Se=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of lt(t))!Et.call(e,i)&&i!==n&&P(e,i,{get:()=>t[i],enumerable:!(r=pt(t,i))||r.enumerable});return e};var St=(e,t,n)=>(n=e!=null?ut(dt(e)):{},Se(t||!e||!e.__esModule?P(n,"default",{value:e,enumerable:!0}):n,e)),It=e=>Se(P({},"__esModule",{value:!0}),e);var l=(e,t,n)=>Rt(e,typeof t!="symbol"?t+"":t,n);var eo={};gt(eo,{AvesErrorHandler:()=>Y,AvesException:()=>d,AvesModule:()=>W,AvesService:()=>h,BookingStatusType:()=>p,CancelReasonType:()=>v,CustomerStatusType:()=>T,CustomerType:()=>C,DeliveryMethodType:()=>X,DeliveryStatusType:()=>q,DocumentFormatType:()=>j,DocumentType:()=>I,GenderType:()=>y,PassengerType:()=>f,PaymentStatusType:()=>w,PaymentType:()=>M,PricingItemType:()=>B,RefundMethodType:()=>G,ServiceStatusType:()=>b,ServiceType:()=>N});module.exports=It(eo);var ee=require("@nestjs/common"),Ee=require("@nestjs/config");var K=require("@nestjs/common");var O=Symbol("AVES_SDK_CONFIG"),x=Symbol("XML_HTTP_CLIENT");var g={SEARCH_MASTER_RECORD:"SearchMasterRecordRQ",MANAGE_MASTER_RECORD:"ManageMasterRecordRQ",BOOK_FILE:"BookFileRQ",MODI_FILE_HEADER:"ModiFileHeaderRQ",MOD_FILE_SERVICES:"ModFileServicesRQ",SET_STATUS:"SetStatusRQ",SET_STATUS_SERVICE:"SetStatusServiceRQ",CANCEL_FILE:"CancelFileRQ",FILE_PAYMENT_LIST:"FilePaymentListRQ",PRINT_BOOKING_DOCUMENT:"PrintBookingDocumentRQ"};var S={SEARCH_MASTER_RECORDS:"/interop/masterRecords/v2/rest/Search",INSERT_OR_UPDATE_MASTER_RECORD:"/interop/masterRecords/v2/rest/InsertOrUpdate",CREATE_BOOKING_FILE:"/interop/booking/v2/rest/CreateBookingFile",MOD_BOOKING_FILE_HEADER:"/interop/booking/v2/rest/ModBookingFileHeader",MOD_BOOKING_FILE_SERVICES:"/interop/booking/v2/rest/ModBookingFileServices",SET_BOOKING_FILE_STATUS:"/interop/booking/v2/rest/SetBookingFileStatus",SET_BOOKING_FILE_SERVICE_STATUS:"/interop/booking/v2/rest/SetBookingFileServiceStatus",CANCEL_BOOKING_FILE:"/interop/booking/v2/rest/CancelBookingFile",INSERT_FILE_PAYMENT_LIST:"/interop/booking/v2/rest/InsertFilePaymentList",PRINT_BOOKING_DOCUMENT:"/interop/document/v2/rest/PrintBookingDocument"};var o=require("zod"),f={ADULT:"adult",CHILD:"child",INFANT:"infant",SENIOR:"senior"},y={MALE:"male",FEMALE:"female"},N={FLIGHT:"flight",HOTEL:"hotel",CAR:"car",TRANSFER:"transfer",INSURANCE:"insurance"},b={CONFIRMED:"confirmed",PENDING:"pending",CANCELLED:"cancelled"},M={CREDIT_CARD:"credit_card",DEBIT_CARD:"debit_card",BANK_TRANSFER:"bank_transfer",CASH:"cash"},w={PENDING:"pending",CONFIRMED:"confirmed",FAILED:"failed"},C={CUSTOMER:"customer",SUPPLIER:"supplier",VOUCHER:"voucher",SUPPLIER_VOUCHER:"supplier_voucher"},T={ENABLED:"enabled",WARNING:"warning",BLACKLISTED:"blacklisted",DISABLED:"disabled"},p={QUOTATION:"quotation",WORK_IN_PROGRESS:"work_in_progress",CONFIRMED:"confirmed",OPTIONED:"optioned",NULLIFIED:"nullified",CANCELED:"canceled"},I={VISA_REQUEST:"visa_request",TRAVEL_INFORMATION:"travel_information",VOUCHER:"voucher",BOOKING_CONTRACT:"booking_contract",BOOKING_CONFIRMATION:"booking_confirmation",SUPPLIER_SERVICE_LIST:"supplier_service_list",INVOICE:"invoice",PROFORMA_INVOICE:"proforma_invoice",ADEGUAMENTO:"adeguamento",RESERVATION_FORM:"reservation_form",OPEN_XML:"open_xml",SALES_INVOICE:"sales_invoice",TICKETING_TMASTER:"ticketing_tmaster",SUMMARY_FORM:"summary_form"},j={PDF:"pdf",HTML:"html",XML:"xml"},X={EMAIL:"email",SMS:"sms",DOWNLOAD:"download"},v={CUSTOMER_REQUEST:"customer_request",NO_SHOW:"no_show",OPERATIONAL:"operational",OTHER:"other"},G={ORIGINAL_PAYMENT:"original_payment",CREDIT:"credit",CASH:"cash"},B={SERVICE:"service",TAX:"tax",FEE:"fee",DISCOUNT:"discount"},q={SENT:"sent",PENDING:"pending",FAILED:"failed"},Ct=o.z.enum(["home","work","billing","delivery"]),te=o.z.enum(["home","work","mobile","fax"]),Tt=o.z.enum(["home","work"]),ft=o.z.enum([f.ADULT,f.CHILD,f.INFANT,f.SENIOR]),yt=o.z.enum(["mr","mrs","ms","dr","prof"]),fe=o.z.enum([y.MALE,y.FEMALE]),ht=o.z.enum([N.FLIGHT,N.HOTEL,N.CAR,N.TRANSFER,N.INSURANCE]),Dt=o.z.enum([b.CONFIRMED,b.PENDING,b.CANCELLED]),Nt=o.z.enum([M.CREDIT_CARD,M.DEBIT_CARD,M.BANK_TRANSFER,M.CASH]),At=o.z.enum([w.PENDING,w.CONFIRMED,w.FAILED]),Ot=o.z.enum([C.CUSTOMER,C.SUPPLIER,C.VOUCHER,C.SUPPLIER_VOUCHER]),so=o.z.enum(["equals","contains","starts_with","ends_with"]),io=o.z.enum(["individual","group","corporate"]),ao=o.z.enum(["low","normal","high","urgent"]),co=o.z.enum(["meal","seat","wheelchair","other"]),bt=o.z.enum([v.CUSTOMER_REQUEST,v.NO_SHOW,v.OPERATIONAL,v.OTHER]),_t=o.z.enum([G.ORIGINAL_PAYMENT,G.CREDIT,G.CASH]),Lt=o.z.enum([I.VISA_REQUEST,I.TRAVEL_INFORMATION,I.VOUCHER,I.BOOKING_CONTRACT,I.BOOKING_CONFIRMATION,I.SUPPLIER_SERVICE_LIST,I.INVOICE,I.PROFORMA_INVOICE,I.ADEGUAMENTO,I.RESERVATION_FORM,I.OPEN_XML,I.SALES_INVOICE,I.TICKETING_TMASTER,I.SUMMARY_FORM]),Ft=o.z.enum([j.PDF,j.HTML,j.XML]),Pt=o.z.enum([X.EMAIL,X.SMS,X.DOWNLOAD]),ne=o.z.enum([p.QUOTATION,p.WORK_IN_PROGRESS,p.CONFIRMED,p.OPTIONED,p.NULLIFIED,p.CANCELED]),xt=o.z.enum([B.SERVICE,B.TAX,B.FEE,B.DISCOUNT]),mo=o.z.enum([q.SENT,q.PENDING,q.FAILED]),Mt=o.z.enum([T.ENABLED,T.WARNING,T.BLACKLISTED,T.DISABLED]),vt=o.z.enum(["email","sms","phone"]),A=o.z.string().regex(/^\d{4}-\d{2}-\d{2}$/,"Date must be in YYYY-MM-DD format"),oe=o.z.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?Z?$/,"DateTime must be in ISO 8601 format"),ye=o.z.object({type:Ct.optional(),street:o.z.string().max(100,"Street must be 100 characters or less").optional(),city:o.z.string().max(50,"City must be 50 characters or less").optional(),state:o.z.string().max(50,"State must be 50 characters or less").optional(),postalCode:o.z.string().max(20,"Postal code must be 20 characters or less").optional(),country:o.z.string().max(50,"Country must be 50 characters or less").optional()}),he=o.z.object({phone:o.z.object({type:te.optional(),number:o.z.string().min(1,"Phone number is required").max(30,"Phone number must be 30 characters or less")}).optional(),email:o.z.object({type:Tt.optional(),address:o.z.string().email("Valid email address is required").max(100,"Email must be 100 characters or less")}).optional(),mobile:o.z.object({type:te.optional(),number:o.z.string().min(1,"Mobile number is required").max(30,"Mobile number must be 30 characters or less")}).optional(),fax:o.z.object({type:te.optional(),number:o.z.string().min(1,"Fax number is required").max(30,"Fax number must be 30 characters or less")}).optional(),webUrl:o.z.string().url("Valid URL is required").max(200,"Web URL must be 200 characters or less").optional()}),_=o.z.object({id:o.z.string().max(6,"Customer ID must be 6 characters or less"),type:Ot,status:Mt,personalInfo:o.z.object({title:o.z.string().max(10,"Title must be 10 characters or less").optional(),firstName:o.z.string().min(1,"First name is required").max(50,"First name must be 50 characters or less"),lastName:o.z.string().min(1,"Last name is required").max(50,"Last name must be 50 characters or less"),dateOfBirth:A.optional(),gender:fe.optional(),nationality:o.z.string().max(3,"Nationality code must be 3 characters or less").optional(),birthCity:o.z.string().max(50,"Birth city must be 50 characters or less").optional(),birthCounty:o.z.string().max(10,"Birth county code must be 10 characters or less").optional()}).optional(),contact:he.optional(),address:ye.optional(),businessInfo:o.z.object({companyName:o.z.string().max(100,"Company name must be 100 characters or less").optional(),taxId:o.z.string().max(30,"Tax ID must be 30 characters or less").optional(),vatCode:o.z.string().max(30,"VAT code must be 30 characters or less").optional(),fiscalCode:o.z.string().max(30,"Fiscal code must be 30 characters or less").optional(),licenseNumber:o.z.string().max(50,"License number must be 50 characters or less").optional(),priceListCode:o.z.string().max(30,"Price list code must be 30 characters or less").optional()}).optional(),preferences:o.z.object({language:o.z.string().length(2,"Language code must be exactly 2 characters").optional(),currency:o.z.string().length(3,"Currency code must be exactly 3 characters").optional(),communicationMethod:vt.optional()}).optional(),meta:o.z.object({createdDate:o.z.string().optional(),modifiedDate:o.z.string().optional(),loginType:o.z.enum(["WEB_BOOKING","BUSINESS_TRAVEL","GROUP_TRAVEL","SUPPLIER","ADMINISTRATOR"]).optional(),thirdPartRecordCode:o.z.string().max(50,"Third part record code must be 50 characters or less").optional(),searchField:o.z.string().max(100,"Search field must be 100 characters or less").optional(),extraInfo:o.z.string().max(500,"Extra info must be 500 characters or less").optional()}).optional(),codes:o.z.object({zoneCode:o.z.string().max(10,"Zone code must be 10 characters or less").optional(),areaCode:o.z.string().max(10,"Area code must be 10 characters or less").optional(),branchOfficeCode:o.z.string().max(10,"Branch office code must be 10 characters or less").optional(),categoryCode:o.z.string().max(10,"Category code must be 10 characters or less").optional(),activityCode:o.z.string().max(10,"Activity code must be 10 characters or less").optional(),promoterCode:o.z.string().max(10,"Promoter code must be 10 characters or less").optional(),networkCode:o.z.string().max(10,"Network code must be 10 characters or less").optional()}).optional()}),re=o.z.object({id:o.z.string().regex(/^\d{3}$/,"Passenger ID must be 3 digits (001, 002, etc.)"),type:ft,title:yt.optional(),firstName:o.z.string().min(1,"First name is required").max(50,"First name must be 50 characters or less"),lastName:o.z.string().min(1,"Last name is required").max(50,"Last name must be 50 characters or less"),dateOfBirth:A.optional(),gender:fe.optional(),nationality:o.z.string().max(3,"Nationality code must be 3 characters or less").optional(),passport:o.z.object({number:o.z.string().min(1,"Passport number is required").max(20,"Passport number must be 20 characters or less"),expiryDate:A,issuingCountry:o.z.string().min(1,"Issuing country is required").max(3,"Country code must be 3 characters or less")}).optional(),address:ye.optional(),contact:he.optional()}),se=o.z.object({id:o.z.string().min(1,"Service ID is required"),type:ht,status:Dt,code:o.z.string().max(50,"Service code must be 50 characters or less").optional(),name:o.z.string().max(200,"Service name must be 200 characters or less").optional(),description:o.z.string().max(500,"Description must be 500 characters or less").optional(),startDate:A.optional(),endDate:A.optional(),price:o.z.object({currency:o.z.string().length(3,"Currency code must be exactly 3 characters"),amount:o.z.number().nonnegative("Amount must be non-negative")}).optional()}),Ie=o.z.object({id:o.z.string().min(1,"Payment ID is required"),type:Nt,status:At,amount:o.z.object({currency:o.z.string().length(3,"Currency code must be exactly 3 characters"),amount:o.z.number().positive("Amount must be positive")}),details:o.z.object({cardNumber:o.z.string().max(20,"Card number must be 20 characters or less").optional(),expiryDate:o.z.string().regex(/^\d{2}\/\d{2}$/,"Expiry date must be in MM/YY format").optional(),cardHolderName:o.z.string().max(100,"Cardholder name must be 100 characters or less").optional()}).optional()}),D=o.z.object({pages:o.z.number().int().positive("Pages must be positive").max(100,"Pages cannot exceed 100"),page:o.z.number().int().min(1,"Page must be at least 1")}).optional(),De=o.z.discriminatedUnion("type",[o.z.object({type:o.z.literal("code"),code:o.z.string().min(1,"Code is required").max(6,"Code must be 6 characters or less"),pagination:D}),o.z.object({type:o.z.literal("name"),name:o.z.string().min(1,"Name is required"),city:o.z.string().max(50,"City must be 50 characters or less").optional(),pagination:D}),o.z.object({type:o.z.literal("vat_code"),vatCode:o.z.string().min(1,"VAT code is required"),phoneNumber:o.z.string().max(30,"Phone number must be 30 characters or less").optional(),pagination:D}),o.z.object({type:o.z.literal("zone"),zipCode:o.z.string().min(1,"Zip code is required"),city:o.z.string().max(50,"City must be 50 characters or less").optional(),countyCode:o.z.string().max(10,"County code must be 10 characters or less").optional(),pagination:D}),o.z.object({type:o.z.literal("category"),categoryCode:o.z.string().min(1,"Category code is required"),pagination:D}),o.z.object({type:o.z.literal("email"),email:o.z.email("Valid email is required"),pagination:D}),o.z.object({type:o.z.literal("last_mod_date"),from:o.z.string().regex(/^\d{4}-\d{2}-\d{2}$/,"Date must be in YYYY-MM-DD format"),to:o.z.string().regex(/^\d{4}-\d{2}-\d{2}$/,"Date must be in YYYY-MM-DD format"),pagination:D}),o.z.object({type:o.z.literal("search_field"),searchField:o.z.string().min(1,"Search field is required"),pagination:D}),o.z.object({type:o.z.literal("external_ref_code"),externalRefCode:o.z.string().min(1,"External ref code is required"),pagination:D})]),Ce=o.z.object({createDate:o.z.string().optional(),bookingFileRefCode:o.z.string().max(50).optional(),travelAgentCode:o.z.string().max(30).optional(),clerkName:o.z.string().max(60).optional(),description:o.z.string().max(200,"Description must be 200 characters or less").optional(),startDate:o.z.string().min(1,"Start date is required"),endDate:o.z.string().min(1,"End date is required"),currency:o.z.string().max(3,"Currency code must be 3 characters or less").optional(),markupCode:o.z.string().max(20).optional(),bookingFileStatus:o.z.object({value:ne,expiredDate:A.optional()}).optional(),passengers:o.z.array(re).min(1,"At least one passenger is required").max(99,"Maximum 99 passengers allowed"),services:o.z.array(se).min(1,"At least one service is required").max(50,"Maximum 50 services allowed"),statisticCodes:o.z.object({code1:o.z.string().max(4,"Statistic code must be 4 characters or less").optional(),code2:o.z.string().max(4,"Statistic code must be 4 characters or less").optional(),code3:o.z.string().max(4,"Statistic code must be 4 characters or less").optional(),code4:o.z.string().max(4,"Statistic code must be 4 characters or less").optional(),code5:o.z.string().max(4,"Statistic code must be 4 characters or less").optional(),code6:o.z.string().max(4,"Statistic code must be 4 characters or less").optional()}).optional(),destination:o.z.object({code:o.z.string().optional(),iataCode:o.z.string().optional(),nationCode:o.z.string().optional()}).optional(),earlyBookingDate:A.optional(),cupCode:o.z.string().max(30).optional(),cigCode:o.z.string().max(30).optional(),customerPromoterCode:o.z.string().max(20).optional(),billingReferenceCode:o.z.string().max(20).optional(),paymentReferenceCode:o.z.string().max(20).optional(),deadlines:o.z.array(o.z.object({code:o.z.string().min(1,"Deadline code is required"),description:o.z.string().optional(),expireDate:o.z.string().optional()})).optional(),printDocument:o.z.boolean().optional(),sendDocumentViaEmail:o.z.boolean().optional(),bookingFinancialInfo:o.z.object({customerPaymentType:o.z.enum(["CASH","BANK","RID","RIBA","SPECIFIC_CODE","NOT_SET"]).optional(),customerSpecPaymentTypeCode:o.z.string().max(20).optional()}).optional(),groupingPaxPolicy:o.z.enum(["GROUPED_PAX","NOT_GROUPED_PAX","ONE_PAX_ONLY"]).optional(),groupBookingFile:o.z.boolean().optional(),typeDownloadFile:o.z.enum(["AVES2AVES","AVES2AVESVIA","AVES2AVESITA"]).optional(),setBookingFileCodeFromStartDate:o.z.boolean().optional()}),Ne=o.z.union([Ce.extend({customerId:o.z.string().max(6,"Customer ID must be 6 characters or less").min(1,"Customer ID is required"),customerDetails:o.z.never().optional()}),Ce.extend({customerId:o.z.never().optional(),customerDetails:_})]),Ae=o.z.object({bookingId:o.z.string().min(1,"Booking ID is required").max(20,"Booking ID must be 20 characters or less"),customerId:o.z.string().max(6,"Customer ID must be 6 characters or less").optional(),reason:bt,description:o.z.string().max(500,"Description must be 500 characters or less").optional(),refundRequest:o.z.object({amount:o.z.number().positive("Refund amount must be positive"),currency:o.z.string().length(3,"Currency code must be exactly 3 characters"),method:_t}).optional()}),Oe=o.z.object({bookingId:o.z.string().min(1,"Booking ID is required").max(20,"Booking ID must be 20 characters or less"),customerId:o.z.string().max(6,"Customer ID must be 6 characters or less").optional(),documentType:Lt,format:Ft.optional(),language:o.z.string().length(2,"Language code must be exactly 2 characters").optional(),deliveryMethod:o.z.object({type:Pt,address:o.z.string().max(100,"Delivery address must be 100 characters or less").optional()}).optional()}),be=o.z.union([o.z.object({bookingId:o.z.string().min(1,"Booking ID is required").max(20,"Booking ID must be 20 characters or less"),bookingRefCode:o.z.never().optional(),payments:o.z.array(Ie).min(1,"At least one payment is required").max(20,"Maximum 20 payments allowed"),enableMultiple:o.z.boolean().optional(),operationType:o.z.enum(["absolute","final","final_no_controls"]).optional()}),o.z.object({bookingId:o.z.never().optional(),bookingRefCode:o.z.string().min(1,"Booking reference code is required").max(20,"Booking reference code must be 20 characters or less"),payments:o.z.array(Ie).min(1,"At least one payment is required").max(20,"Maximum 20 payments allowed"),enableMultiple:o.z.boolean().optional(),operationType:o.z.enum(["absolute","final","final_no_controls"]).optional()})]),uo=o.z.object({bookingId:o.z.string().min(1,"Booking ID is required").max(20,"Booking ID must be 20 characters or less"),customerId:o.z.string().max(6,"Customer ID must be 6 characters or less"),startDate:A,passengers:o.z.array(re).optional(),notes:o.z.string().max(999,"Notes must be 999 characters or less").optional(),statisticCodes:o.z.object({code1:o.z.string().max(4,"Statistic code must be 4 characters or less").optional(),code2:o.z.string().max(4,"Statistic code must be 4 characters or less").optional(),code3:o.z.string().max(4,"Statistic code must be 4 characters or less").optional(),code4:o.z.string().max(4,"Statistic code must be 4 characters or less").optional(),code5:o.z.string().max(4,"Statistic code must be 4 characters or less").optional(),code6:o.z.string().max(4,"Statistic code must be 4 characters or less").optional()}).optional()}),po=o.z.object({bookingId:o.z.string().min(1,"Booking ID is required").max(20,"Booking ID must be 20 characters or less"),customerId:o.z.string().max(6,"Customer ID must be 6 characters or less"),services:o.z.array(se).min(1,"At least one service is required").max(50,"Maximum 50 services allowed")}),lo=o.z.object({bookingId:o.z.string().min(1,"Booking ID is required").max(20,"Booking ID must be 20 characters or less"),customerId:o.z.string().max(6,"Customer ID must be 6 characters or less"),status:ne,expireDate:A.optional()}),Eo=o.z.object({id:o.z.string().min(1,"Booking ID is required"),status:ne,createdAt:oe,updatedAt:oe,description:o.z.string().optional(),nation:o.z.string().optional(),destination:o.z.string().optional(),firstConfirmationDate:oe.optional(),paxNumber:o.z.number().int().nonnegative().optional(),reference:o.z.string().optional(),clerkName:o.z.string().optional(),customer:_,passengers:o.z.array(re),services:o.z.array(se),pricing:o.z.object({totalAmount:o.z.object({currency:o.z.string().length(3,"Currency code must be exactly 3 characters"),amount:o.z.number().nonnegative("Amount must be non-negative")}),breakdowns:o.z.array(o.z.object({type:xt,description:o.z.string().min(1,"Description is required"),amount:o.z.number()})).optional(),totals:o.z.object({beforeDiscount:o.z.number().optional(),afterDiscount:o.z.number().optional(),discount:o.z.number().optional(),withoutVat:o.z.number().optional(),dueAmount:o.z.number().optional(),paidAmount:o.z.number().optional(),balance:o.z.number().optional()}).optional()})}),Ro=o.z.object({customers:o.z.array(_),pagination:o.z.object({page:o.z.number().int().min(1,"Page must be at least 1"),pages:o.z.number().int().min(1,"Pages must be at least 1"),totalItems:o.z.number().int().min(0,"Total items must be non-negative"),hasMore:o.z.boolean()})}),Te=o.z.object({fileName:o.z.string().min(1,"File name is required"),content:o.z.string().optional(),contentSize:o.z.number().int().min(0,"Content size must be non-negative")}),go=o.z.object({emailRecipient:o.z.email("Valid email address is required").optional(),documents:o.z.array(Te).min(0,"Documents array is required"),additionalDocuments:o.z.array(o.z.object({emailRecipient:o.z.string().email("Valid email address is required"),documents:o.z.array(Te)})).optional()}),So=o.z.object({success:o.z.boolean(),message:o.z.string().optional(),data:o.z.any().optional()});var ae=class ae{constructor(t){l(this,"RqHeader");l(this,"Body");Object.assign(this,t)}};a(ae,"RequestPayload");var ie=ae,ce=class ce{constructor(t){l(this,"Request");this.Request=new ie(t)}};a(ce,"WrapRequestDto");var Q=ce;var L=a(e=>{let t;if(typeof e=="string"){if(!/^\d{4}-\d{2}-\d{2}$/.test(e))throw new Error(`Invalid date format. Expected YYYY-MM-DD, got: ${e}`);try{t=new Date(e+"T00:00:00.000Z")}catch{throw new Error(`Invalid date string: ${e}`)}}else t=e;if(isNaN(t.getTime()))throw new Error(`Invalid date value: ${e}`);let n=t.getUTCFullYear(),r=String(t.getUTCMonth()+1).padStart(2,"0"),i=String(t.getUTCDate()).padStart(2,"0");return`${n}-${r}-${i}`},"createDateString"),$=a(e=>{let t;if(typeof e=="string"){if(!/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?Z?$/.test(e))throw new Error(`Invalid datetime format. Expected ISO 8601, got: ${e}`);try{t=new Date(e)}catch{throw new Error(`Invalid datetime string: ${e}`)}}else t=e;if(isNaN(t.getTime()))throw new Error(`Invalid datetime value: ${e}`);return t.toISOString()},"createDateTimeString");function _e(e){return{[C.CUSTOMER]:"CUSTOMER",[C.SUPPLIER]:"SUPPLIER",[C.VOUCHER]:"VOUCHER",[C.SUPPLIER_VOUCHER]:"SUPPLIER_VOUCHER"}[e]||"CUSTOMER"}a(_e,"mapCustomerTypeToXml");function Le(e){return{CUSTOMER:C.CUSTOMER,SUPPLIER:C.SUPPLIER,VOUCHER:C.VOUCHER,SUPPLIER_VOUCHER:C.SUPPLIER_VOUCHER}[e]||C.CUSTOMER}a(Le,"mapCustomerTypeFromXml");function Fe(e){return{[T.ENABLED]:"ENABLED",[T.WARNING]:"WARNING",[T.BLACKLISTED]:"BLACKLISTED",[T.DISABLED]:"DISABLED"}[e]||"ENABLED"}a(Fe,"mapCustomerStatusToXml");function Pe(e){return{ENABLED:T.ENABLED,WARNING:T.WARNING,BLACKLISTED:T.BLACKLISTED,DISABLED:T.DISABLED}[e]||T.ENABLED}a(Pe,"mapCustomerStatusFromXml");function me(e){return{[p.QUOTATION]:"QUOTATION",[p.WORK_IN_PROGRESS]:"WORK_IN_PROGRESS",[p.CONFIRMED]:"CONFIRMED",[p.OPTIONED]:"OPTIONED",[p.NULLIFIED]:"NULLIFIED",[p.CANCELED]:"CANCELED"}[e]??"QUOTATION"}a(me,"mapBookingStatusToXml");function xe(e){return{QUOTATION:p.QUOTATION,WORK_IN_PROGRESS:p.WORK_IN_PROGRESS,CONFIRMED:p.CONFIRMED,OPTIONED:p.OPTIONED,NULLIFIED:p.NULLIFIED,CANCELED:p.CANCELED}[e]??p.QUOTATION}a(xe,"mapBookingStatusFromXml");function Me(e){return{visa_request:"VISA_REQUEST",travel_information:"TRAVEL_INFORMATION",voucher:"VOUCHER",booking_contract:"BOOKING_CONTRACT",booking_confirmation:"BOOKING_CONFIRMATION",supplier_service_list:"SUPPLIER_SERVICE_LIST",invoice:"INVOICE",proforma_invoice:"PROFORMA_INVOICE",adeguamento:"ADEGUAMENTO",reservation_form:"RESERVATION_FORM",open_xml:"OPEN_XML",sales_invoice:"SALES_INVOICE",ticketing_tmaster:"TICKETING_TMASTER",summary_form:"SUMMARY_FORM"}[e]||"VOUCHER"}a(Me,"mapDocumentTypeToXml");function ve(e){return{male:"M",female:"F"}[e]||"M"}a(ve,"mapGenderToXml");var Bt=new Set(["QUOTATION","WORK_IN_PROGRESS","CONFIRMED","OPTIONED","CANCELED"]),kt={CONFIRM:"CONFIRMED",OPTION:"OPTIONED",REQUEST:"WORK_IN_PROGRESS",NULLIFIED:"CANCELED"};function Ut(e){let t=e.toUpperCase(),n=kt[t];return n||(Bt.has(t)?t:"QUOTATION")}a(Ut,"normalizeBookingStatus");function Vt(e){let t=typeof e=="string"?e:me(e);return Ut(t)}a(Vt,"mapBookingFileStatusForRQ");function Be(e){let t=(e.Name||"").split(" "),n=t.pop()||"",r=t.join(" ")||e.Name,i={AD:f.ADULT,CH:f.CHILD,IN:f.INFANT,OV:f.SENIOR};return{id:e["@RPH"],type:i[e.CategoryCode]||f.ADULT,title:void 0,firstName:r,lastName:n,dateOfBirth:e.BirthDate?L(e.BirthDate):void 0,gender:e.Sex==="M"?y.MALE:e.Sex==="F"?y.FEMALE:void 0,nationality:e.NationCode||e.CitizenshipCode,passport:e.IDDocInfo?{number:e.IDDocInfo["@IDCode"]||"",expiryDate:L(e.IDDocInfo["@IDExpireDate"]||""),issuingCountry:""}:void 0,address:void 0,contact:e.eMail||e.PhoneNumber?{email:e.eMail?{address:e.eMail}:void 0,phone:e.PhoneNumber?{number:e.PhoneNumber}:void 0}:void 0}}a(Be,"mapPassengerFromXml");function ke(e){return{id:e["@ServiceCode"],type:N.HOTEL,status:b.PENDING,code:e["@ServiceCode"],name:e.FirstDescription,description:e.SecondDescription,startDate:e.StartDate?L(e.StartDate):void 0,endDate:e.EndDate?L(e.EndDate):void 0,price:e.ServiceTotalAmountDetail?.ServiceTotalPrice?{currency:"EUR",amount:parseFloat(e.ServiceTotalAmountDetail.ServiceTotalPrice)}:void 0}}a(ke,"mapServiceFromXml");var wt=a((e,t)=>{switch(e.type){case"code":t.RecordCode=e.code;break;case"name":t.Name=e.name,e.city&&(t.City=e.city);break;case"vat_code":t.VatCode=e.vatCode,e.phoneNumber&&(t.PhoneNumber=e.phoneNumber);break;case"zone":t.ZipCode=e.zipCode,e.city&&(t.City=e.city),e.countyCode&&(t.CountyCode=e.countyCode);break;case"category":t.CategoryCode=e.categoryCode;break;case"email":t.Email=e.email;break;case"last_mod_date":t.LastModificationDate={"@MinDate":e.from,"@MaxDate":e.to};break;case"search_field":t.SearchFieldValue=e.searchField;break;case"external_ref_code":t.SearchFieldValue=e.externalRefCode;break}return t},"buildSearchMasterRecordRQ");function Ue(e){let t={SearchType:e.type.toUpperCase()};return wt(e,t)}a(Ue,"mapSearchCustomerToXml");function z(e){let t=e.personalInfo?`${e.personalInfo.firstName} ${e.personalInfo.lastName}`.trim():e.id;return{"@RecordCode":e.id,RecordType:_e(e.type),Name:t,LanguageCode:e.preferences?.language||"01",Moniker:e.personalInfo?.title,Gender:e.personalInfo?.gender?ve(e.personalInfo?.gender):void 0,BirthDate:e.personalInfo?.dateOfBirth,CitizenshipCode:e.personalInfo?.nationality,Email:e.contact?.email?.address,FirstPhoneNumber:e.contact?.phone?.number,MobilePhone:e.contact?.phone?.number,Address:e.address?.street,CityName:e.address?.city,StateCode:e.address?.country,ZipCode:e.address?.postalCode,FiscalCode:e.businessInfo?.taxId,VatCode:e.businessInfo?.taxId,RecordStatus:Fe(e.status),FinancialDetail:e.preferences?.currency?{"@CurrencyCode":e.preferences.currency}:void 0}}a(z,"mapCustomerToXml");function Ve(e){let t=e.customerDetails?z(e.customerDetails):{"@RecordCode":e.customerId||"",RecordType:"CUSTOMER",Name:"Customer",LanguageCode:"01"};return{CreateDate:e.createDate,BookingFileRefCode:e.bookingFileRefCode,TravelAgentCode:e.travelAgentCode,ClerkName:e.clerkName,CustomerDetail:t,CurrencyCode:e.currency,MarkupCode:e.markupCode,BookingFileStatus:e.bookingFileStatus?{"@Value":Vt(e.bookingFileStatus.value),...e.bookingFileStatus.expiredDate&&{"@ExpiredDate":e.bookingFileStatus.expiredDate}}:{"@Value":"QUOTATION"},StatisticCodes:e.statisticCodes?{"@sCode1":e.statisticCodes.code1,"@sCode2":e.statisticCodes.code2,"@sCode3":e.statisticCodes.code3,"@sCode4":e.statisticCodes.code4,"@sCode5":e.statisticCodes.code5,"@sCode6":e.statisticCodes.code6}:void 0,Destination:e.destination?{"@Code":e.destination.code,"@IataCode":e.destination.iataCode,"@NationCode":e.destination.nationCode}:void 0,BookingFileDescription:e.description,StartDate:e.startDate,EndDate:e.endDate,EarlyBookingDate:e.earlyBookingDate,CupCode:e.cupCode,CigCode:e.cigCode,CustomerPromoterCode:e.customerPromoterCode,BillingReferenceCode:e.billingReferenceCode,PaymentReferenceCode:e.paymentReferenceCode,BookingFileDocument:e.printDocument!==void 0||e.sendDocumentViaEmail!==void 0?{"@PrintDoc":e.printDocument||!1,"@SendDocViaEmail":e.sendDocumentViaEmail||!1}:void 0,DeadlineList:e.deadlines?{DeadlineDetail:e.deadlines.map(n=>({"@DeadlineCode":n.code,"@Description":n.description,"@ExpireDate":n.expireDate}))}:void 0,BookingFinancialInfo:e.bookingFinancialInfo?{"@Customer_PaymentType":e.bookingFinancialInfo.customerPaymentType||"NOT_SET","@Customer_SpecPaymentTypeCode":e.bookingFinancialInfo.customerSpecPaymentTypeCode}:void 0,GroupingPaxPolicy:e.groupingPaxPolicy,GroupBookingFile:e.groupBookingFile,TypeDownloadFile:e.typeDownloadFile,SetBookingFileCodeFromStartDate:e.setBookingFileCodeFromStartDate,PassengerList:{PassengerDetail:e.passengers.map((n,r)=>we(n,r+1))},SelectedServiceList:{SelectedServiceDetail:e.services.map((n,r)=>je(n,r+1))}}}a(Ve,"mapCreateBookingToXml");function we(e,t){return{"@RPH":String(t).padStart(3,"0"),Name:`${e.firstName} ${e.lastName}`,CategoryCode:e.type===f.ADULT?"AD":e.type===f.CHILD?"CH":e.type===f.INFANT?"IN":"OV",Sex:e.gender===y.MALE?"M":"F",BirthDate:e.dateOfBirth,eMail:e.contact?.email?.address,PhoneNumber:e.contact?.phone?.number}}a(we,"mapPassengerToAvesXml");function je(e,t){return{"@sCode":e.id,AvesServiceType:"TOP",StartDate:e.startDate||new Date().toISOString(),EndDate:e.endDate||new Date().toISOString(),Qty:1,Pax:1,AvesSession:t}}a(je,"mapServiceToAvesXml");function Xe(e){return{BookingFileCode:e.bookingId,CustomerRecordCode:e.customerId||""}}a(Xe,"mapCancelBookingToXml");function Ge(e){return{RefMasterRecordCode:e.customerId||"",LanguageCode:e.language||"01",BookingFileCode:e.bookingId,InfoDocumentsToPrint:{InfoDocumentToPrint:[{DocumentType:Me(e.documentType)}]},GetDocumentContent:e.deliveryMethod?.type==="download",SendDocumentViaEmail:e.deliveryMethod?.type==="email"}}a(Ge,"mapPrintDocumentToXml");function qe(e){let t="AbsoluteAmountsInsertion";return e.operationType==="final"?t="FinalAmountToAchieve":e.operationType==="final_no_controls"&&(t="FinalAmountToAchieveWithoutControls"),{BookingFileCode:e.bookingId,BookingFileRefCode:e.bookingRefCode,EnableMultiplePayments:e.enableMultiple??e.payments.length>1,OperationType:t,FilePaymentList:{FilePaymentDetail:e.payments.map(n=>({"@PaymentDate":new Date().toISOString(),"@Amount":String(n.amount?.amount||0),"@PaymentType":jt(n.type)}))}}}a(qe,"mapAddPaymentToXml");function jt(e){return{cash:"C",bank:"B",bank2:"D",bank3:"T",atm:"P",creditCard:"R",credit_card:"R",rebate:"A"}[e]||"C"}a(jt,"mapPaymentTypeToAvesXml");function He(e){let t=z(e);return t["@InsertCriteria"]="S",{MasterRecordDetail:t}}a(He,"mapCreateCustomerToXml");function Ke(e){let t=z(e);return t["@InsertCriteria"]="T",{MasterRecordDetail:t}}a(Ke,"mapUpdateCustomerToXml");function We(e){let t=z(e);return t["@InsertCriteria"]="M",{MasterRecordDetail:t}}a(We,"mapUpsertCustomerToXml");function Ye(e,t,n,r){return{BookingFileCode:t,BookingFileStartDate:n,CustomerRecordCode:e,NewCustomerRecordCode:r?.newCustomerRecordCode,BookingNote:r?.notes,PassengerList:r?.passengers?{PassengerDetail:r.passengers.map((i,c)=>we(i,c+1))}:void 0}}a(Ye,"mapUpdateBookingHeaderToXml");function Qe(e,t,n){return{CustomerRecordCode:e,BookingFileCode:t,SelectedServiceList:{SelectedServiceDetail:n.map((r,i)=>je(r,i+1))}}}a(Qe,"mapUpdateBookingServicesToXml");function $e(e,t,n,r){return{CustomerRecordCode:e,BookingFileCode:t,FileStatus:{"@Value":me(n),...r?.expiredDate&&{"@ExpiredDate":r.expiredDate},...r?.optionedFileExpireDatePolicy&&{"@OptionedFileExpireDatePolicy":r.optionedFileExpireDatePolicy}},...r?.backOfficeRequest!==void 0&&{BackOfficeRequest:r.backOfficeRequest},...r?.printDoc!==void 0||r?.sendDocViaEmail!==void 0?{BookingFileDocument:{"@PrintDoc":r.printDoc||!1,"@SendDocViaEmail":r.sendDocViaEmail||!1}}:{},...r?.applyPenalty!==void 0&&{Penalty:{"@Apply":r.applyPenalty,...r.penaltyCode&&{"@SpecificCode":r.penaltyCode}}},...r?.simulateCancelAndGetPenalty!==void 0&&{SimulateCancelAndGetPenaltyAmount:r.simulateCancelAndGetPenalty}}}a($e,"mapSetBookingStatusToXml");function ze(e,t,n,r){return{CustomerRecordCode:e,BookingFileCode:t,BookingServiceRef:n,BookingFileServiceStatus:"NULLIFIED",...r&&{BookingFileServiceStatusDate:r}}}a(ze,"mapSetBookingServiceStatusToXml");function ue(e){let t=(e.Name??"").split(" "),n=t.pop()??"",r=t.join(" ")??e.Name;return{id:e["@RecordCode"],type:Le(e.RecordType),status:Pe(e.RecordStatus??""),personalInfo:{title:e.Moniker,firstName:r,lastName:n,dateOfBirth:e.BirthDate?L(e.BirthDate):void 0,gender:e.Gender==="M"?y.MALE:e.Gender==="F"?y.FEMALE:void 0,nationality:e.CitizenshipCode,birthCity:e.BirthCity,birthCounty:e.BirthCounty},contact:{email:e.Email?{address:e.Email}:void 0,phone:e.FirstPhoneNumber?{number:e.FirstPhoneNumber}:void 0,mobile:e.MobilePhone?{number:e.MobilePhone}:void 0,fax:e.FaxNumber?{number:e.FaxNumber}:void 0,webUrl:e.WebUrl},address:e.Address?{street:e.Address,city:e.CityName,state:e.CountyCode,postalCode:e.ZipCode,country:e.StateCode}:void 0,businessInfo:e.VatCode||e.FiscalCode?{companyName:void 0,taxId:e.VatCode||e.FiscalCode,licenseNumber:void 0,vatCode:e.VatCode,fiscalCode:e.FiscalCode,priceListCode:e.PriceListCode}:void 0,preferences:{language:e.LanguageCode,currency:e.FinancialDetail?.["@CurrencyCode"],communicationMethod:void 0},meta:{createdDate:e.CreatedDate,modifiedDate:e.ModifiedDate,loginType:e.LoginType,thirdPartRecordCode:e.ThirdPartRecordCode,searchField:e.SearchField,extraInfo:e.ExtraInfo},codes:{zoneCode:e.ZoneCode,areaCode:e.AreaCode,branchOfficeCode:e.BranchOfficeCode,categoryCode:e.CategoryCode,activityCode:e.ActivityCode,promoterCode:e.PromoterCode,networkCode:e.NetworkCode}}}a(ue,"mapCustomerFromXml");function Z(e){return e?e.MasterRecordDetail?{success:!0,message:"Operation successful",data:ue(e.MasterRecordDetail)}:{success:!1,message:"No master record in response",data:void 0}:{success:!1,message:"Invalid XML response",data:void 0}}a(Z,"mapCustomerResponseFromXml");function Xt(e){return{id:e.BookingFileCode,status:xe(e.BookingFileStatus["@Value"]),createdAt:$(e.CreationDate),updatedAt:$(e.CreationDate),description:e.Description,nation:e.Nation,destination:e.Destination,firstConfirmationDate:e.FirstConfirmationDate?$(e.FirstConfirmationDate):void 0,paxNumber:e.PaxNumber,reference:e.Reference,clerkName:e.ClerkName,customer:ue({"@RecordCode":e.CustomerRecordCode,RecordType:"CUSTOMER",Name:e.CustomerName,LanguageCode:"01",Email:e.CustomerEmail}),passengers:e.PassengerList.PassengerDetail.map(Be),services:e.BookedServiceList?.BookedServiceDetail.map(ke)||[],pricing:{totalAmount:{currency:e.TotalAmountDetail?.CurrencyCode||"EUR",amount:parseFloat(e.TotalAmountDetail?.TotalAmountAfterDiscount||"0")},breakdowns:void 0,totals:e.TotalAmountDetail?{beforeDiscount:parseFloat(e.TotalAmountDetail.TotalAmountBeforeDiscount||"0"),afterDiscount:parseFloat(e.TotalAmountDetail.TotalAmountAfterDiscount||"0"),discount:parseFloat(e.TotalAmountDetail.TotalDiscount||"0"),withoutVat:parseFloat(e.TotalAmountDetail.TotalAmountWithoutVat||"0"),dueAmount:parseFloat(e.TotalAmountDetail.DueAmount||"0"),paidAmount:parseFloat(e.TotalAmountDetail.PaiedAmount||"0"),balance:parseFloat(e.TotalAmountDetail.Balance||"0")}:void 0}}}a(Xt,"mapBookingFromXml");function H(e){if(!e)return{success:!1,message:"Invalid XML response",data:void 0};let t=e.OperationResult["@Status"]==="SUCCESS";if(!t||!e.BookingFile)return{success:t,message:e?.OperationResult["@Message"],data:void 0};let n=Xt(e.BookingFile);return{success:t,message:e.OperationResult["@Message"],data:n}}a(H,"mapBookingResponseFromXml");function Ze(e,t){let i=t?.pages||50,c=t?.page||1;if(!e||!e.MasterRecordList)return{customers:[],pagination:{page:c,pages:1,totalItems:0,hasMore:!1}};let u=e.MasterRecordList.MasterRecordDetail.map(ue),E=u.length,ge=E===i,mt=ge?c+1:c;return{customers:u,pagination:{page:c,pages:mt,totalItems:E,hasMore:ge}}}a(Ze,"mapSearchResponseFromXml");function Je(e){if(!e)return{success:!1,message:"Invalid XML response",data:void 0};let t=e.BaseDocumentAndAttachments?.SingleBaseDocumentOrAttachment.map(i=>({fileName:i.DocFileName,content:i.Base64DocContent,contentSize:i.Base64DocContent?.length||0}))||[],n=e.AdditionalDocuments?.AdditionalDocument.map(i=>({emailRecipient:i.EmailRecipient,documents:i.BaseDocumentAndAttachments?.SingleBaseDocumentOrAttachment.map(c=>({fileName:c.DocFileName,content:c.Base64DocContent,contentSize:c.Base64DocContent?.length||0}))||[]}));return{success:!0,message:"Documents generated successfully",data:{emailRecipient:e.EmailRecipient,documents:t,additionalDocuments:n}}}a(Je,"mapDocumentResponseFromXml");function et(e){if(!e)return{success:!1,message:"Invalid XML response",data:void 0};let t=e.OperationResult["@Status"]==="SUCCESS";return t?{success:t,message:e.OperationResult["@Message"],data:{refundInfo:e.OperationResult.RefundInfo?{refundAmount:e.OperationResult.RefundInfo["@RefundAmount"],currency:e.OperationResult.RefundInfo["@Currency"],refundMethod:e.OperationResult.RefundInfo["@RefundMethod"],processingTime:e.OperationResult.RefundInfo["@ProcessingTime"]}:void 0}}:{success:t,message:e?.OperationResult["@Message"],data:void 0}}a(et,"mapCancelResponseFromXml");function tt(e){return e?{success:!0,message:"Payment registered successfully",data:{booking:void 0,paymentSummary:{totalPaid:{currency:"EUR",amount:0},outstandingAmount:{currency:"EUR",amount:0},paymentHistory:[]}}}:{success:!1,message:"Invalid XML response",data:void 0}}a(tt,"mapPaymentResponseFromXml");function Gt(e,t,n,r){var i=arguments.length,c=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(e,t,n,r);else for(var E=e.length-1;E>=0;E--)(u=e[E])&&(c=(i<3?u(c):i>3?u(t,n,c):u(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c}a(Gt,"_ts_decorate");function ot(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}a(ot,"_ts_metadata");function nt(e,t){return function(n,r){t(n,r,e)}}a(nt,"_ts_param");var pe=class pe{constructor(t,n){l(this,"config");l(this,"http");this.config=t,this.http=n}buildHeader(){let{hostId:t,xtoken:n,languageCode:r}=this.config;return{"@HostID":t,"@Xtoken":n,"@Interface":"WEB","@UserName":"WEB","@LanguageCode":r}}wrapRequest(t){return new Q({RqHeader:this.buildHeader(),Body:t})}async searchCustomers(t){let n=De.parse(t),r=Ue(n),i=await this.http.postXml(S.SEARCH_MASTER_RECORDS,g.SEARCH_MASTER_RECORD,this.wrapRequest(r));return Ze(i.Response.Body,n.pagination)}async createCustomer(t){let n=_.parse(t),r=He(n),i=await this.http.postXml(S.INSERT_OR_UPDATE_MASTER_RECORD,g.MANAGE_MASTER_RECORD,this.wrapRequest(r));return Z(i.Response.Body)}async updateCustomer(t){let n=_.parse(t),r=Ke(n),i=await this.http.postXml(S.INSERT_OR_UPDATE_MASTER_RECORD,g.MANAGE_MASTER_RECORD,this.wrapRequest(r));return Z(i.Response.Body)}async upsertCustomer(t){let n=_.parse(t),r=We(n),i=await this.http.postXml(S.INSERT_OR_UPDATE_MASTER_RECORD,g.MANAGE_MASTER_RECORD,this.wrapRequest(r));return Z(i.Response.Body)}async createBooking(t){let n=Ne.parse(t),r=Ve(n),i=await this.http.postXml(S.CREATE_BOOKING_FILE,g.BOOK_FILE,this.wrapRequest(r));return H(i.Response.Body)}async updateBookingHeader(t,n,r,i){let c=Ye(t,n,r,i),u=await this.http.postXml(S.MOD_BOOKING_FILE_HEADER,g.MODI_FILE_HEADER,this.wrapRequest(c));return{success:u.Response.RsStatus["@Status"]==="OK",message:u.Response.RsStatus.ErrorDescription}}async updateBookingServices(t,n,r){let i=Qe(t,n,r),c=await this.http.postXml(S.MOD_BOOKING_FILE_SERVICES,g.MOD_FILE_SERVICES,this.wrapRequest(i));return H(c.Response.Body)}async setBookingStatus(t,n,r,i){let c=$e(t,n,r,i),u=await this.http.postXml(S.SET_BOOKING_FILE_STATUS,g.SET_STATUS,this.wrapRequest(c));return H(u.Response.Body)}async setBookingServiceStatus(t,n,r,i){let c=ze(t,n,r,i),u=await this.http.postXml(S.SET_BOOKING_FILE_SERVICE_STATUS,g.SET_STATUS_SERVICE,this.wrapRequest(c));return H(u.Response.Body)}async cancelBooking(t){let n=Ae.parse(t),r=Xe(n),i=await this.http.postXml(S.CANCEL_BOOKING_FILE,g.CANCEL_FILE,this.wrapRequest(r));return et(i.Response.Body)}async addPayment(t){let n=be.parse(t),r=qe(n),i=await this.http.postXml(S.INSERT_FILE_PAYMENT_LIST,g.FILE_PAYMENT_LIST,this.wrapRequest(r));return tt(i.Response.Body)}async printDocument(t){let n=Oe.parse(t),r=Ge(n),i=await this.http.postXml(S.PRINT_BOOKING_DOCUMENT,g.PRINT_BOOKING_DOCUMENT,this.wrapRequest(r));return Je(i.Response.Body)}async searchMasterRecord(t){return this.http.postXml(S.SEARCH_MASTER_RECORDS,g.SEARCH_MASTER_RECORD,this.wrapRequest(t))}async insertOrUpdateMasterRecord(t){return this.http.postXml(S.INSERT_OR_UPDATE_MASTER_RECORD,g.MANAGE_MASTER_RECORD,this.wrapRequest(t))}async createBookingFile(t){return this.http.postXml(S.CREATE_BOOKING_FILE,g.BOOK_FILE,this.wrapRequest(t))}async cancelBookingFile(t){return this.http.postXml(S.CANCEL_BOOKING_FILE,g.CANCEL_FILE,this.wrapRequest(t))}async printBookingDocument(t){return this.http.postXml(S.PRINT_BOOKING_DOCUMENT,g.PRINT_BOOKING_DOCUMENT,this.wrapRequest(t))}};a(pe,"AvesService");var h=pe;h=Gt([(0,K.Injectable)(),nt(0,(0,K.Inject)(O)),nt(1,(0,K.Inject)(x)),ot("design:type",Function),ot("design:paramtypes",[typeof AvesSdkConfig>"u"?Object:AvesSdkConfig,typeof IXmlHttpClient>"u"?Object:IXmlHttpClient])],h);var st=St(require("axios"),1),J=require("fast-xml-parser"),U=require("@nestjs/common");function qt(e,t,n,r){var i=arguments.length,c=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(e,t,n,r);else for(var E=e.length-1;E>=0;E--)(u=e[E])&&(c=(i<3?u(c):i>3?u(t,n,c):u(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c}a(qt,"_ts_decorate");function rt(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}a(rt,"_ts_metadata");function Ht(e,t){return function(n,r){t(n,r,e)}}a(Ht,"_ts_param");var le=class le{constructor(t){l(this,"config");l(this,"httpClient");l(this,"xmlBuilder");l(this,"xmlParser");this.config=t,this.httpClient=st.default.create({baseURL:t.baseUrl,timeout:typeof t.timeout=="number"?t.timeout:3e4,headers:{"Content-Type":"application/xml",Accept:"application/xml, text/xml, */*;q=0.1"},transitional:{clarifyTimeoutError:!0},validateStatus:a(n=>n>=200&&n<300,"validateStatus")}),this.xmlBuilder=new J.XMLBuilder({attributeNamePrefix:"@",ignoreAttributes:!1,suppressEmptyNode:!0,format:process.env.NODE_ENV?.toLowerCase()==="development"}),this.xmlParser=new J.XMLParser({attributeNamePrefix:"@",ignoreAttributes:!1,parseAttributeValue:!1,trimValues:!0,isArray:a(n=>["Field","Item","Service","Passenger","Payment","MasterRecord","Request","Notes","ServiceID"].includes(n),"isArray")})}async postXml(t,n,r,i){let c=this.xmlBuilder.build({[n]:r}),u=await this.httpClient.post(t,c,i);return this.xmlParser.parse(u.data)}};a(le,"XmlHttpClient");var k=le;k=qt([(0,U.Injectable)({scope:U.Scope.DEFAULT}),Ht(0,(0,U.Inject)(O)),rt("design:type",Function),rt("design:paramtypes",[typeof AvesSdkConfig>"u"?Object:AvesSdkConfig])],k);var it=require("@nestjs/config"),Kt="aves",de=(0,it.registerAs)(Kt,()=>({baseUrl:process.env.AVES_BASE_URL??"",hostId:process.env.AVES_HOST_ID??"",xtoken:process.env.AVES_XTOKEN??"",languageCode:process.env.AVES_LANGUAGE_CODE,timeout:process.env.AVES_TIMEOUT?Number(process.env.AVES_TIMEOUT):void 0}));var s=require("zod"),Wt=s.z.enum(["01","02"]),at=s.z.object({baseUrl:s.z.url(),hostId:s.z.string().length(6),xtoken:s.z.string(),languageCode:Wt.optional(),timeout:s.z.number().optional()}),Yt=s.z.object({"@Type":s.z.enum(["HOME","WORK","BILLING","DELIVERY"]).optional(),Street:s.z.string().max(100).optional(),City:s.z.string().max(50).optional(),State:s.z.string().max(50).optional(),PostalCode:s.z.string().max(20).optional(),Country:s.z.string().max(50).optional()}),Qt=s.z.object({Phone:s.z.object({"@Type":s.z.enum(["HOME","WORK","MOBILE","FAX"]).optional(),"@Number":s.z.string()}).optional(),Email:s.z.object({"@Type":s.z.enum(["HOME","WORK"]).optional(),"@Address":s.z.string()}).optional()}),$t=s.z.object({"@PassengerID":s.z.string().min(1),"@Type":s.z.enum(["ADT","CHD","INF"]),"@Title":s.z.enum(["MR","MRS","MS","DR","PROF"]).optional(),FirstName:s.z.string().min(1).max(50),LastName:s.z.string().min(1).max(50),DateOfBirth:s.z.date().optional(),Gender:s.z.enum(["M","F"]).optional(),Nationality:s.z.string().max(3).optional(),Address:Yt.optional(),ContactInfo:Qt.optional()}),zt=s.z.object({"@ServiceID":s.z.string().min(1),"@Type":s.z.enum(["FLIGHT","HOTEL","CAR","TRANSFER","INSURANCE"]),"@Status":s.z.enum(["CONFIRMED","PENDING","CANCELLED"]),ServiceDetails:s.z.object({Code:s.z.string().optional(),Name:s.z.string().optional(),Description:s.z.string().optional(),StartDate:s.z.string().optional(),EndDate:s.z.string().optional(),Price:s.z.object({"@Currency":s.z.string(),"@Amount":s.z.number()}).optional()})}),zo=s.z.object({"@PaymentID":s.z.string().min(1),"@Type":s.z.enum(["CREDIT_CARD","DEBIT_CARD","BANK_TRANSFER","CASH"]),"@Status":s.z.enum(["PENDING","CONFIRMED","FAILED"]),Amount:s.z.object({"@Currency":s.z.string(),"@Amount":s.z.number()}),PaymentDetails:s.z.object({CardNumber:s.z.string().optional(),ExpiryDate:s.z.string().optional(),CardHolderName:s.z.string().optional()}).optional()}),Zo=s.z.object({SearchCriteria:s.z.object({MasterRecordType:s.z.enum(["CUSTOMER","AGENT","SUPPLIER"]),SearchFields:s.z.object({Field:s.z.array(s.z.object({"@Name":s.z.string(),"@Value":s.z.string(),"@Operator":s.z.enum(["EQUALS","CONTAINS","STARTS_WITH","ENDS_WITH"]).optional()}))}),Pagination:s.z.object({"@PageSize":s.z.number(),"@PageNumber":s.z.number()}).optional()})}),Jo=s.z.object({BookingDetails:s.z.object({"@BookingType":s.z.enum(["INDIVIDUAL","GROUP","CORPORATE"]),"@Priority":s.z.enum(["LOW","NORMAL","HIGH","URGENT"]),CustomerInfo:s.z.object({"@CustomerID":s.z.string().optional(),CustomerDetails:s.z.any().optional()}),PassengerList:s.z.object({Passenger:s.z.array($t)}),SelectedServiceList:s.z.object({Service:s.z.array(zt)}),SpecialRequests:s.z.object({Request:s.z.array(s.z.object({"@Type":s.z.enum(["MEAL","SEAT","WHEELCHAIR","OTHER"]),"@Description":s.z.string()}))}).optional()})}),en=s.z.object({"@BookingFileID":s.z.string().min(1),CancellationDetails:s.z.object({"@Reason":s.z.enum(["CUSTOMER_REQUEST","NO_SHOW","OPERATIONAL","OTHER"]),"@Description":s.z.string().optional(),RefundRequest:s.z.object({"@Amount":s.z.number(),"@Currency":s.z.string(),"@Method":s.z.enum(["ORIGINAL_PAYMENT","CREDIT","CASH"])}).optional()})}),tn=s.z.object({"@BookingFileID":s.z.string().min(1),DocumentRequest:s.z.object({"@DocumentType":s.z.enum(["CONFIRMATION","INVOICE","VOUCHER","TICKET","ALL"]),"@Format":s.z.enum(["PDF","HTML","XML"]),"@Language":s.z.string().optional(),DeliveryMethod:s.z.object({"@Type":s.z.enum(["EMAIL","SMS","DOWNLOAD"]),"@Address":s.z.string().optional()}).optional()})});function Zt(e,t,n,r){var i=arguments.length,c=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(e,t,n,r);else for(var E=e.length-1;E>=0;E--)(u=e[E])&&(c=(i<3?u(c):i>3?u(t,n,c):u(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c}a(Zt,"_ts_decorate");var F=class F{static forRoot(t){let n=this.validateConfig(t);return{module:F,imports:[Ee.ConfigModule.forFeature(de)],providers:[{provide:O,useValue:n},this.createXmlHttpClientProvider(),h],exports:[h,x]}}static forRootAsync(t){let n=this.createAsyncProviders(t);return{module:F,imports:[...t.imports??[],Ee.ConfigModule.forFeature(de)],providers:[...n,this.createXmlHttpClientProvider(),h],exports:[h,x]}}static createXmlHttpClientProvider(){return{provide:x,useClass:k}}static createAsyncProviders(t){if(t.useFactory)return[{provide:O,useFactory:a(async(...i)=>{try{let c=await t.useFactory(...i);return this.validateConfig(c)}catch(c){throw new Error(`Failed to create Aves configuration: ${c.message}`)}},"useFactory"),inject:t.inject??[]}];let n=t.useClass||t.useExisting;if(!n)throw new Error("Invalid AvesModule async options: provide useFactory, useClass, or useExisting");let r=[{provide:O,useFactory:a(async i=>{try{let c=await i.createAvesOptions();return this.validateConfig(c)}catch(c){throw new Error(`Failed to create Aves configuration: ${c.message}`)}},"useFactory"),inject:[n]}];return t.useClass&&r.push({provide:t.useClass,useClass:t.useClass}),r}static validateConfig(t){let n=at.safeParse(t);if(!n.success)throw new Error(`Invalid AVES SDK configuration: ${n.error.issues.map(r=>r.message).join(", ")}`);return n.data}};a(F,"AvesModule"),l(F,"MODULE_NAME","AvesModule"),l(F,"VERSION","1.0.0");var W=F;W=Zt([(0,ee.Global)(),(0,ee.Module)({})],W);var ct=require("@nestjs/common");var R=(function(e){return e.ERROR="ERROR",e.WARNING="WARNING",e.INFO="INFO",e})({}),m=(function(e){return e.INVALID_TOKEN="AVES_001",e.TOKEN_EXPIRED="AVES_002",e.INSUFFICIENT_PERMISSIONS="AVES_003",e.INVALID_REQUEST_FORMAT="AVES_100",e.MISSING_REQUIRED_FIELD="AVES_101",e.INVALID_FIELD_VALUE="AVES_102",e.INVALID_DATE_FORMAT="AVES_103",e.BOOKING_NOT_FOUND="AVES_200",e.BOOKING_ALREADY_CANCELLED="AVES_201",e.INVALID_BOOKING_STATUS="AVES_202",e.PAYMENT_FAILED="AVES_203",e.INSUFFICIENT_INVENTORY="AVES_204",e.INTERNAL_SERVER_ERROR="AVES_500",e.SERVICE_UNAVAILABLE="AVES_501",e.TIMEOUT="AVES_502",e.RATE_LIMIT_EXCEEDED="AVES_503",e})({});var V=class V extends Error{constructor(n,r,i={}){super(r);l(this,"code");l(this,"severity");l(this,"timestamp");l(this,"requestId");l(this,"context");this.name="AvesException",this.code=n,this.severity=i.severity||R.ERROR,this.timestamp=new Date().toISOString(),this.context=i.context,this.requestId=i.requestId||this.generateRequestId(),Object.setPrototypeOf(this,V.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,V)}static fromAvesError(n){return new V(n.code,n.message,{severity:n.severity,context:n.context,requestId:n.requestId})}isRetryable(){return[m.TIMEOUT,m.SERVICE_UNAVAILABLE,m.INTERNAL_SERVER_ERROR,m.RATE_LIMIT_EXCEEDED].includes(this.code)}getUserFriendlyMessage(){return{[m.INVALID_TOKEN]:"Your session has expired. Please log in again.",[m.TOKEN_EXPIRED]:"Your session has expired. Please log in again.",[m.INSUFFICIENT_PERMISSIONS]:"You do not have permission to perform this action.",[m.BOOKING_NOT_FOUND]:"The requested booking could not be found.",[m.BOOKING_ALREADY_CANCELLED]:"This booking has already been cancelled.",[m.PAYMENT_FAILED]:"Payment processing failed. Please try again.",[m.INSUFFICIENT_INVENTORY]:"The requested service is no longer available.",[m.SERVICE_UNAVAILABLE]:"The service is temporarily unavailable. Please try again later.",[m.TIMEOUT]:"The request timed out. Please try again.",[m.RATE_LIMIT_EXCEEDED]:"Too many requests. Please wait a moment and try again."}[this.code]||this.message}toJSON(){return{name:this.name,code:this.code,message:this.message,severity:this.severity,timestamp:this.timestamp,requestId:this.requestId,context:this.context,stack:this.stack,isRetryable:this.isRetryable(),userFriendlyMessage:this.getUserFriendlyMessage()}}toAvesError(){return{code:this.code,message:this.message,severity:this.severity,timestamp:this.timestamp,requestId:this.requestId,context:this.context}}getHttpStatusCode(){switch(this.code){case m.INVALID_TOKEN:case m.TOKEN_EXPIRED:return 401;case m.INSUFFICIENT_PERMISSIONS:return 403;case m.BOOKING_NOT_FOUND:return 404;case m.INVALID_REQUEST_FORMAT:case m.MISSING_REQUIRED_FIELD:case m.INVALID_FIELD_VALUE:return 400;case m.RATE_LIMIT_EXCEEDED:return 429;case m.SERVICE_UNAVAILABLE:return 503;case m.TIMEOUT:return 408;default:return 500}}getCategory(){return this.code.startsWith("AVES_1")?"Authentication":this.code.startsWith("AVES_2")?"Business Logic":this.code.startsWith("AVES_5")?"System":"Unknown"}generateRequestId(){return`aves_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}};a(V,"AvesException");var d=V;function Jt(e,t,n,r){var i=arguments.length,c=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(e,t,n,r);else for(var E=e.length-1;E>=0;E--)(u=e[E])&&(c=(i<3?u(c):i>3?u(t,n,c):u(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c}a(Jt,"_ts_decorate");var Re=class Re{parseError(t){return t instanceof d?t:this.isHttpError(t)?this.parseHttpError(t):this.isAvesXmlResponse(t)?this.parseAvesXmlError(t):t instanceof Error?new d(m.INTERNAL_SERVER_ERROR,t.message,{severity:R.ERROR,context:this.buildContext({type:"javascript_error",errorName:t.name,stack:t.stack||"No stack trace available"})}):new d(m.INTERNAL_SERVER_ERROR,"Unknown error occurred",{severity:R.ERROR,context:this.buildContext({type:"unknown_error",errorName:typeof t,errorValue:String(t)})})}parseHttpError(t){if(t.response){let n=t.response.status,r=t.response.statusText;switch(n){case 400:return new d(m.INVALID_REQUEST_FORMAT,`Bad Request: ${r}`,{severity:R.ERROR,context:this.buildContext({type:"http_error",errorName:n,statusText:r,url:t.config?.url,method:t.config?.method,timeout:t.config?.timeout})});case 401:return new d(m.INVALID_TOKEN,"Authentication failed",{severity:R.ERROR,context:this.buildContext({type:"http_error",status:n,url:t.config?.url,method:t.config?.method,timeout:t.config?.timeout})});case 403:return new d(m.INSUFFICIENT_PERMISSIONS,"Access forbidden",{severity:R.ERROR,context:this.buildContext({type:"http_error",status:n,url:t.config?.url,method:t.config?.method,timeout:t.config?.timeout})});case 404:return new d(m.BOOKING_NOT_FOUND,"Resource not found",{severity:R.ERROR,context:this.buildContext({type:"http_error",status:n,url:t.config?.url,method:t.config?.method,timeout:t.config?.timeout})});case 429:return new d(m.RATE_LIMIT_EXCEEDED,"Rate limit exceeded",{severity:R.ERROR,context:this.buildContext({type:"http_error",status:n,retryAfter:t.response.headers?.["retry-after"]})});case 500:return new d(m.INTERNAL_SERVER_ERROR,"Internal server error",{severity:R.ERROR,context:this.buildContext({type:"http_error",status:n,url:t.config?.url,method:t.config?.method,timeout:t.config?.timeout})});case 503:return new d(m.SERVICE_UNAVAILABLE,"Service unavailable",{severity:R.ERROR,context:this.buildContext({type:"http_error",status:n,url:t.config?.url,method:t.config?.method,timeout:t.config?.timeout})});default:return new d(m.INTERNAL_SERVER_ERROR,`HTTP ${n}: ${r}`,{severity:R.ERROR,context:this.buildContext({type:"http_error",status:n,statusText:r,url:t.config?.url,method:t.config?.method,timeout:t.config?.timeout})})}}else return t.request?new d(m.TIMEOUT,"Request timeout - no response from AVES API",{severity:R.ERROR,context:this.buildContext({type:"http_error",timeout:!0,url:t.config?.url,method:t.config?.method,configuredTimeout:t.config?.timeout})}):new d(m.INTERNAL_SERVER_ERROR,`Request setup error: ${t.message}`,{severity:R.ERROR,context:this.buildContext({type:"http_error",setupError:!0})})}parseAvesXmlError(t){if(!t?.Response?.RsStatus)return new d(m.INVALID_REQUEST_FORMAT,"Invalid response format from AVES API",{severity:R.ERROR,context:this.buildContext({type:"aves_xml_error",missingRsStatus:!0})});let n=t.Response.RsStatus;if(n["@Status"]==="ERROR")return new d(n.ErrorCode||m.INTERNAL_SERVER_ERROR,n.ErrorDescription||"Unknown error from AVES API",{severity:R.ERROR,context:this.buildContext({type:"aves_xml_error",originalResponse:n})});if(n.Warnings?.Warning){let r=Array.isArray(n.Warnings.Warning)?n.Warnings.Warning:[n.Warnings.Warning];return new d(m.INVALID_FIELD_VALUE,r.join("; "),{severity:R.WARNING,context:this.buildContext({type:"aves_xml_warning",warnings:r})})}return new d(m.INTERNAL_SERVER_ERROR,"Unexpected response from AVES API",{severity:R.ERROR,context:this.buildContext({type:"aves_xml_error",unexpectedResponse:!0,status:n["@Status"]})})}isRetryable(t){return[m.TIMEOUT,m.SERVICE_UNAVAILABLE,m.INTERNAL_SERVER_ERROR,m.RATE_LIMIT_EXCEEDED].includes(t.code)}getUserFriendlyMessage(t){return{[m.INVALID_TOKEN]:"Your session has expired. Please log in again.",[m.TOKEN_EXPIRED]:"Your session has expired. Please log in again.",[m.INSUFFICIENT_PERMISSIONS]:"You do not have permission to perform this action.",[m.BOOKING_NOT_FOUND]:"The requested booking could not be found.",[m.BOOKING_ALREADY_CANCELLED]:"This booking has already been cancelled.",[m.PAYMENT_FAILED]:"Payment processing failed. Please try again.",[m.INSUFFICIENT_INVENTORY]:"The requested service is no longer available.",[m.SERVICE_UNAVAILABLE]:"The service is temporarily unavailable. Please try again later.",[m.TIMEOUT]:"The request timed out. Please try again.",[m.RATE_LIMIT_EXCEEDED]:"Too many requests. Please wait a moment and try again."}[t.code]||t.message}buildContext(t){let n={};return typeof t=="object"&&t!==null?Object.keys(t).forEach(r=>{let i=t[r];if(this.isSensitiveKey(r)){n[r]="********";return}this.isSerializableValue(i)?n[r]=i:typeof i=="function"?n[r]="[Function]":i instanceof Error?n[r]={name:i.name,message:i.message,stack:i.stack?.split(`
2
2
  `).slice(0,3).join(`
3
- `)}:n[r]=String(i)}):typeof t=="string"?n.message=t:typeof t=="number"||typeof t=="boolean"?n.value=t:n.input=String(t),n.timestamp=new Date().toISOString(),n.contextType=typeof t,n}isSensitiveKey(t){let n=["password","token","secret","key","auth","credential","xtoken","authorization","cookie","session","private"],r=t.toLowerCase();return n.some(i=>r.includes(i))}isSerializableValue(t){return t==null||typeof t=="string"||typeof t=="number"||typeof t=="boolean"?!0:Array.isArray(t)?t.length<=10:typeof t=="object"&&t.constructor===Object?Object.keys(t).length<=20:!1}isHttpError(t){return t&&(t.response||t.request||t.config)}isAvesXmlResponse(t){return t&&t.Response&&t.Response.RsStatus}};a(it,"AvesErrorHandler");var Y=it;Y=Co([(0,Yt.Injectable)()],Y);0&&(module.exports={AVES_CONFIG_NAMESPACE,AVES_SDK_CONFIG,AddressValidation,AvesEndpoints,AvesErrorCodes,AvesErrorHandler,AvesException,AvesModule,AvesService,AvesSeverity,AvesStatus,AvesValidator,BookFileRQValidation,BookingStatusType,CancelFileRQValidation,CancelReasonType,ContactInfoValidation,CustomerStatusType,CustomerType,DeliveryMethodType,DeliveryStatusType,DocumentFormatType,DocumentType,GenderType,InsertCriteria,LanguageCodeValidation,PassengerType,PassengerValidation,PaymentStatusType,PaymentType,PaymentValidation,PricingItemType,PrintBookingDocumentRQValidation,RefundMethodType,RootElementNames,SearchMasterRecordRQValidation,ServiceStatusType,ServiceType,ServiceValidation,XML_HTTP_CLIENT,XmlHttpClient,addPaymentRequestSchema,addressTypeSchema,apiSchemas,avesConfig,bookingPassengerSchema,bookingPaymentSchema,bookingResponseSchema,bookingServiceSchema,bookingStatusTypeSchema,bookingTypeSchema,cancelBookingRequestSchema,cancelReasonTypeSchema,communicationMethodTypeSchema,configValidationSchema,contactTypeSchema,createAvesValidator,createBookingRequestSchema,createDateString,createDateTimeString,createTimeString,customerAddressSchema,customerContactSchema,customerSchema,customerSearchResultSchema,customerStatusTypeSchema,customerTypeSchema,deliveryMethodTypeSchema,deliveryStatusTypeSchema,documentFormatTypeSchema,documentPrintResultSchema,documentTypeSchema,emailTypeSchema,genderTypeSchema,mapAddPaymentToXml,mapBookingFromXml,mapBookingResponseFromXml,mapBookingStatusToXml,mapCancelBookingToXml,mapCancelResponseFromXml,mapCreateBookingToXml,mapCreateCustomerToXml,mapCustomerResponseFromXml,mapCustomerStatusToXml,mapCustomerToXml,mapCustomerTypeToXml,mapDocumentResponseFromXml,mapDocumentTypeToXml,mapGenderToXml,mapPaymentResponseFromXml,mapPrintDocumentToXml,mapSearchCustomerToXml,mapSearchResponseFromXml,mapSetBookingServiceStatusToXml,mapSetBookingStatusToXml,mapUpdateBookingHeaderToXml,mapUpdateBookingServicesToXml,mapUpdateCustomerToXml,mapUpsertCustomerToXml,operationResponseSchema,passengerTypeSchema,paymentStatusTypeSchema,paymentTypeSchema,pricingItemTypeSchema,printDocumentRequestSchema,printedDocumentSchema,priorityTypeSchema,refundMethodTypeSchema,searchCustomerRequestSchema,searchOperatorTypeSchema,serviceStatusTypeSchema,serviceTypeSchema,setBookingStatusSchema,specialRequestTypeSchema,titleTypeSchema,updateBookingHeaderSchema,updateBookingServicesSchema});
3
+ `)}:n[r]=String(i)}):typeof t=="string"?n.message=t:typeof t=="number"||typeof t=="boolean"?n.value=t:n.input=String(t),n.timestamp=new Date().toISOString(),n.contextType=typeof t,n}isSensitiveKey(t){let n=["password","token","secret","key","auth","credential","xtoken","authorization","cookie","session","private"],r=t.toLowerCase();return n.some(i=>r.includes(i))}isSerializableValue(t){return t==null||typeof t=="string"||typeof t=="number"||typeof t=="boolean"?!0:Array.isArray(t)?t.length<=10:typeof t=="object"&&t.constructor===Object?Object.keys(t).length<=20:!1}isHttpError(t){return t&&(t.response||t.request||t.config)}isAvesXmlResponse(t){return t&&t.Response&&t.Response.RsStatus}};a(Re,"AvesErrorHandler");var Y=Re;Y=Jt([(0,ct.Injectable)()],Y);0&&(module.exports={AvesErrorHandler,AvesException,AvesModule,AvesService,BookingStatusType,CancelReasonType,CustomerStatusType,CustomerType,DeliveryMethodType,DeliveryStatusType,DocumentFormatType,DocumentType,GenderType,PassengerType,PaymentStatusType,PaymentType,PricingItemType,RefundMethodType,ServiceStatusType,ServiceType});
4
4
  //# sourceMappingURL=index.cjs.map