-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path4725.95cdfbd5f6e97cdc.js
1 lines (1 loc) · 31 KB
/
4725.95cdfbd5f6e97cdc.js
1
"use strict";(self.webpackChunkcheapflightclient=self.webpackChunkcheapflightclient||[]).push([[4725],{42678:(A,D,a)=>{a.d(D,{zz:()=>U,Cs:()=>s,yL:()=>re,u1:()=>ve,I5:()=>C,FH:()=>ce});var t=a(80529),e=a(88001),p=a(54004),C=(()=>{return(c=C||(C={})).JOURNEY="JOURNEY",c.PASSENGER="PASSENGER",c.CONFIGURATION="CONFIGURATION",C;var c})(),n=a(97582),T=a(97380),o=a(87067),h=a(43429);class s{}(0,n.gn)([(0,o.C)()],s.prototype,"status",void 0),(0,n.gn)([(0,h.D)(()=>f),(0,o.C)()],s.prototype,"data",void 0),(0,n.gn)([(0,o.C)()],s.prototype,"objectError",void 0),(0,n.gn)([(0,o.C)()],s.prototype,"success",void 0);class f extends T.VP{}class d{}(0,n.gn)([(0,o.C)()],d.prototype,"airline",void 0),(0,n.gn)([(0,o.C)()],d.prototype,"flightType",void 0),(0,n.gn)([(0,h.D)(()=>y),(0,o.C)()],d.prototype,"journeys",void 0),(0,n.gn)([(0,h.D)(()=>b),(0,o.C)()],d.prototype,"passengers",void 0),(0,n.gn)([(0,h.D)(()=>v),(0,o.C)()],d.prototype,"priceMonitors",void 0);class v{}(0,n.gn)([(0,o.C)()],v.prototype,"airline",void 0),(0,n.gn)([(0,o.C)()],v.prototype,"airlineLogo",void 0),(0,n.gn)([(0,o.C)()],v.prototype,"targetPrice",void 0);class y{}(0,n.gn)([(0,o.C)()],y.prototype,"leg",void 0),(0,n.gn)([(0,o.C)()],y.prototype,"startPoint",void 0),(0,n.gn)([(0,o.C)()],y.prototype,"endPoint",void 0),(0,n.gn)([(0,o.C)()],y.prototype,"departTime",void 0),(0,n.gn)([(0,o.C)()],y.prototype,"arrivalTime",void 0),(0,n.gn)([(0,o.C)()],y.prototype,"duration",void 0),(0,n.gn)([(0,o.C)()],y.prototype,"segments",void 0),(0,n.gn)([(0,o.C)()],y.prototype,"rangeTime",void 0),(0,n.gn)([(0,o.C)()],y.prototype,"rangeDateTime",void 0);class I{}(0,n.gn)([(0,o.C)()],I.prototype,"fromDate",void 0),(0,n.gn)([(0,o.C)()],I.prototype,"toDate",void 0);class b{}(0,n.gn)([(0,o.C)()],b.prototype,"birthday",void 0),(0,n.gn)([(0,o.C)()],b.prototype,"firstName",void 0),(0,n.gn)([(0,o.C)()],b.prototype,"lastName",void 0),(0,n.gn)([(0,o.C)()],b.prototype,"type",void 0),(0,n.gn)([(0,o.C)()],b.prototype,"key",void 0),(0,n.gn)([(0,o.C)()],b.prototype,"parentKey",void 0),(0,n.gn)([(0,o.C)()],b.prototype,"namePrefix",void 0),(0,n.gn)([(0,o.C)()],b.prototype,"gender",void 0),(0,n.gn)([(0,o.C)()],b.prototype,"index",void 0),(0,n.gn)([(0,o.C)()],b.prototype,"parentIndex",void 0);class r{}(0,n.gn)([(0,o.C)()],r.prototype,"timeCreate",void 0),(0,n.gn)([(0,o.C)()],r.prototype,"timeExpire",void 0),(0,n.gn)([(0,o.C)()],r.prototype,"timeUpdate",void 0),(0,n.gn)([(0,o.C)()],r.prototype,"timeFinished",void 0),(0,n.gn)([(0,h.D)(()=>E),(0,o.C)()],r.prototype,"fareMonitors",void 0),(0,n.gn)([(0,o.C)()],r.prototype,"notifyBeforeExpired",void 0),(0,n.gn)([(0,o.C)()],r.prototype,"targetPrice",void 0);class E{}(0,n.gn)([(0,o.C)()],E.prototype,"onlyCareLowerFare",void 0),(0,n.gn)([(0,o.C)()],E.prototype,"expectLowerFareClass",void 0),(0,n.gn)([(0,o.C)()],E.prototype,"specifyFareClass",void 0),(0,n.gn)([(0,o.C)()],E.prototype,"currentFareClass",void 0),(0,n.gn)([(0,o.C)()],E.prototype,"specifyFareClassInfo",void 0);class L{}(0,n.gn)([(0,o.C)()],L.prototype,"airline",void 0),(0,n.gn)([(0,o.C)()],L.prototype,"originalPnr",void 0),(0,n.gn)([(0,o.C)()],L.prototype,"detectedPnr",void 0),(0,n.gn)([(0,o.C)()],L.prototype,"originalFare",void 0),(0,n.gn)([(0,o.C)()],L.prototype,"detectedFare",void 0),(0,n.gn)([(0,o.C)()],L.prototype,"originalFareClass",void 0),(0,n.gn)([(0,o.C)()],L.prototype,"detectedFareClass",void 0),(0,n.gn)([(0,o.C)()],L.prototype,"higherFare",void 0),(0,n.gn)([(0,o.C)()],L.prototype,"lastTimeUpdate",void 0);class U{}(0,n.gn)([(0,o.C)()],U.prototype,"status",void 0),(0,n.gn)([(0,h.D)(()=>N),(0,o.C)()],U.prototype,"data",void 0),(0,n.gn)([(0,o.C)()],U.prototype,"objectError",void 0),(0,n.gn)([(0,o.C)()],U.prototype,"success",void 0);class N{}(0,n.gn)([(0,o.C)()],N.prototype,"orderId",void 0),(0,n.gn)([(0,o.C)()],N.prototype,"canUpdate",void 0),(0,n.gn)([(0,o.C)()],N.prototype,"code",void 0),(0,n.gn)([(0,o.C)()],N.prototype,"huntFareConditions",void 0),(0,n.gn)([(0,o.C)()],N.prototype,"conditions",void 0),(0,n.gn)([(0,o.C)()],N.prototype,"advanceSetting",void 0),(0,n.gn)([(0,o.C)()],N.prototype,"ticketInfo",void 0),(0,n.gn)([(0,h.D)(()=>T.v_),(0,o.C)()],N.prototype,"availableSlotInfo",void 0),(0,n.gn)([(0,o.C)()],N.prototype,"distributionChannel",void 0);var w=a(50494),k=a(94650);const H={headers:new t.WM({"Content-Type":"application/json"})};let re=(()=>{class c{constructor(i,m){this.http=i,this.appConfig=m}getLstAirlineFareoptions(){return this.http.post(this.appConfig.apiUrlTPS+"ticket-low-fare/get-list-airline-fare-class",JSON.stringify({airline:"vn,qh,vj"}),H)}registerHuntBooking(i){return this.http.post(this.appConfig.apiUrlTPS+"hunt_for_ticket/register-order",JSON.stringify(i),H)}getPnrOrderDetail(i){return this.http.get(this.appConfig.apiUrlTPS+"hunt_for_ticket/pnr-order_detail/"+i,H).pipe((0,p.U)(m=>(0,w.yE)(s,m,{excludeExtraneousValues:!0})))}getCurrentConfigOrder(i){return this.http.post(this.appConfig.apiUrlTPS+"hunt_for_ticket/current-config-order",JSON.stringify({orderId:i}),H).pipe((0,p.U)(m=>(0,w.yE)(U,m,{excludeExtraneousValues:!0})))}updateConfigOrder(i){return this.http.post(this.appConfig.apiUrlTPS+"hunt_for_ticket/update_order_config",JSON.stringify(i),H).pipe((0,p.U)(m=>(0,w.yE)(s,m,{excludeExtraneousValues:!0})))}}return c.\u0275fac=function(i){return new(i||c)(k.LFG(t.eN),k.LFG(e.qB))},c.\u0275prov=k.Yz7({token:c,factory:c.\u0275fac,providedIn:"root"}),c})();var u=a(24006),j=a(57085),ne=a(35650),Z=a(43201),x=a(15439),ue=a(77579);const oe=c=>{const R=c.get("targetVNPrice"),i=c.get("targetVJPrice"),m=c.get("targetQHPrice"),P=c.get("fareOptions"),F=c.get("enableTimeStart"),O=c.get("enableFareOption"),M=c.get("enablePriceOption"),S=c.get("startTimeRange");let _={};return null!=F&&F.value&&(null!=S&&S.value&&(null==S?void 0:S.value.length)>0||(_.invalidTimeRanges=!0)),null!=O&&O.value&&(null!=P&&P.value&&(null==P?void 0:P.value.length)>0||(_.invalidFares=!0)),null!=M&&M.value&&(null!=R&&R.value||null!=i&&i.value||null!=m&&m.value?((null==R?void 0:R.value)<0||(null==i?void 0:i.value)<0||(null==m?void 0:m.value)<0)&&(_.negativePrice=!0):_.invalidPrice=!0),!F&&!M&&(_.invalidPriceFareOption=!0),Object.values(_),Object.values(_).length>0?_:null};var ie=a(82761),pe=a(40899),ge=a(9497);let ce=(()=>{class c{constructor(i,m,P,F,O,M){this.route=i,this._route=m,this.fb=P,this._permissionService=F,this._systemService=O,this._bookingHunterService=M,this.optionsAdultPassenger=[],this.numberOfPassenger={adult:1,child:0,infant:0},this.phoneAreaDefault=e.$T,this.hasVJAirline=!1,this.showPriceOption=!1,this.showTimeStartOption=!1,this.showFareOption=!0,this.numberOfPassengerChange$=new ue.x,this.isBooker=!this._permissionService.isVNAccount(),this.optionDepartureTime=[{name:"S\xe1ng s\u1edbm",code:"early_morning",start:"00:00",end:"05:59",isActive:!1,disable:!1,startTime:0,endTime:360,totalAvailable:0},{name:"Bu\u1ed5i s\xe1ng",code:"morning",start:"06:00",end:"11:59",isActive:!1,disable:!1,startTime:360,endTime:720,totalAvailable:0},{name:"Bu\u1ed5i chi\u1ec1u",code:"afternoon",start:"12:00",end:"17:59",isActive:!1,disable:!1,startTime:720,endTime:1080,totalAvailable:0},{name:"Bu\u1ed5i t\u1ed1i",code:"evening",start:"18:00",end:"23:59",isActive:!1,disable:!1,startTime:1080,endTime:1439,totalAvailable:0},{name:"T\xf9y ch\u1ecdn",code:"custom",start:"00:00",end:"23:59",isActive:!1,disable:!1,startTime:0,endTime:1439,totalAvailable:0}],this.customRangeItem={rangeValues:[0,1439],startTimeStr:"00:00",endTimeStr:"23:59"},this.checkPhoneRequired=this._systemService.isFeatureEnabled(e.Ke.Web_Features_RulePhoneNumber_RulePhoneNumberVJ_Enable),this.CF_IDENTIFY_TYPE=e.FV,this.departureTime=x().toDate().getTime(),this.earliestDoBChild=(0,Z.Z)(this.departureTime,-2),this.earliestDoBChild=(0,ne.Z)(this.earliestDoBChild,-1),this.earliestDoBInfant=x().toDate(),this.lastestDoBChild=(0,Z.Z)(this.departureTime,-11),this.lastestDoBInfant=(0,Z.Z)(this.departureTime,-2),this.lastestDoBInfant=(0,ne.Z)(this.lastestDoBInfant,1)}initForm(){this.resetDataService(),this.initJourneyForm(),this.initConfigurationForm(),this.initPassengerForm()}preloadForm(i){var m,P,F,O,M,S,_,Y,K,$,z,W,q,Q,X,ee;const V=i.ticketInfo.journeys[0],J="PRICE"===i.huntFareConditions.type;this.showPriceOption=J,this.showFareOption=!J;const me=(null===(P=null===(m=i.huntFareConditions.specifyPriceList)||void 0===m?void 0:m.find(l=>"VN"===l.airline.toUpperCase()))||void 0===P?void 0:P.targetPrice)||0,he=(null===(O=null===(F=i.huntFareConditions.specifyPriceList)||void 0===F?void 0:F.find(l=>"QH"===l.airline.toUpperCase()))||void 0===O?void 0:O.targetPrice)||0,fe=(null===(S=null===(M=i.huntFareConditions.specifyPriceList)||void 0===M?void 0:M.find(l=>"VJ"===l.airline.toUpperCase()))||void 0===S?void 0:S.targetPrice)||0;let ae=!0;if(V.rangeTime.forEach(l=>{this.optionDepartureTime.forEach(g=>{g.start===l.fromDate&&g.end===l.toDate&&(g.isActive=!0,ae=!1)})}),ae&&V.rangeTime[0]){const l=V.rangeTime[0],g=this.convertTimeRangeStrToMin(l.fromDate),de=this.convertTimeRangeStrToMin(l.toDate);this.customRangeItem={rangeValues:[g,de],startTimeStr:l.fromDate,endTimeStr:l.toDate},this.optionDepartureTime[4].isActive=!0,this.optionDepartureTime[4].start=l.fromDate,this.optionDepartureTime[4].end=l.toDate,this.optionDepartureTime[4].startTime=g,this.optionDepartureTime[4].endTime=de}const te=this.optionDepartureTime.filter(l=>l.isActive),se=te&&te.length>0;this.showTimeStartOption=se;const Ce=(null!==(_=x(V.departTime))&&void 0!==_&&_.isBefore(x())?null:x(V.departTime).toDate())||null;this.journeyFormGroup=this.fb.group({startPoint:[V.startPoint,[u.kI.required]],endPoint:[V.endPoint,[u.kI.required]],departDate:[Ce,[u.kI.required]],startTimeRange:[te],enablePriceOption:[J],targetVNPrice:[me],targetVJPrice:[he],targetQHPrice:[fe],enableFareOption:[!J],enableTimeStart:[se],fareOptions:[i.huntFareConditions.specifyFareClassList]},{validators:oe});const le=x(i.advanceSetting.timeExecute).isAfter(x().toDate()),B=le?x(i.advanceSetting.timeExecute).toDate():null,ye=le&&B?`${null==B?void 0:B.getHours().toString().padStart(2,"0")}:${null==B?void 0:B.getMinutes().toString().padStart(2,"0")}`:null;this.configurationFormGroup=this.fb.group({dateExpires:[B,[u.kI.required]],timeExpires:[ye,[u.kI.required]],sendNotify:[i.advanceSetting.notifBeforExpire,[u.kI.required]],agentDisplayName:[null],agentAvatar:[null],agentName:[null],agentPhone:[null,[u.kI.required,u.kI.minLength(7),u.kI.maxLength(11)]],agentPhoneArea:[this.phoneAreaDefault,u.kI.required],agentEmail:[null],agentId:[null,[u.kI.required]]}),this.numberOfPassenger={adult:(null===(K=null===(Y=i.ticketInfo.passengers)||void 0===Y?void 0:Y.filter(l=>{var g;return"ADT"===(null===(g=l.type)||void 0===g?void 0:g.toUpperCase())}))||void 0===K?void 0:K.length)||0,child:(null===(z=null===($=i.ticketInfo.passengers)||void 0===$?void 0:$.filter(l=>{var g;return"CHD"===(null===(g=l.type)||void 0===g?void 0:g.toUpperCase())}))||void 0===z?void 0:z.length)||0,infant:(null===(q=null===(W=i.ticketInfo.passengers)||void 0===W?void 0:W.filter(l=>{var g;return"INF"===(null===(g=l.type)||void 0===g?void 0:g.toUpperCase())}))||void 0===q?void 0:q.length)||0},this.passengerFormGroup=this.fb.group({adultPassenger:this.fb.array([]),childPassenger:this.fb.array([]),infantPassenger:this.fb.array([])},{validator:(0,j.aV)()});const Pe=(null===(Q=i.ticketInfo.passengers)||void 0===Q?void 0:Q.filter(l=>{var g;return"ADT"===(null===(g=l.type)||void 0===g?void 0:g.toUpperCase())}).map(l=>{var g;return{firstName:l.firstName,lastName:l.lastName,gender:(null===(g=l.gender)||void 0===g?void 0:g.toLowerCase())||"male"}}))||[],De=(null===(X=i.ticketInfo.passengers)||void 0===X?void 0:X.filter(l=>{var g;return"CHD"===(null===(g=l.type)||void 0===g?void 0:g.toUpperCase())}).map(l=>{var g;return{firstName:l.firstName,lastName:l.lastName,gender:(null===(g=l.gender)||void 0===g?void 0:g.toLowerCase())||"male",birthday:x(l.birthday).toDate()}}))||[],be=(null===(ee=i.ticketInfo.passengers)||void 0===ee?void 0:ee.filter(l=>{var g;return"INF"===(null===(g=l.type)||void 0===g?void 0:g.toUpperCase())}).map(l=>{var g;return{firstName:l.firstName,lastName:l.lastName,gender:(null===(g=l.gender)||void 0===g?void 0:g.toLowerCase())||"male",birthday:x(l.birthday).toDate(),parentIndex:l.parentIndex+""}}))||[];this.initPassengerForm(),this.initAdultFormGroup(),this.initChildFormGroup(),this.initInfantFormGroup(),this.passengerFormGroup.patchValue({adultPassenger:Pe,childPassenger:De,infantPassenger:be}),this.preInitialFormOrderId=void 0}reloadPassengerForm(){const i=this.passengerFormGroup.value;this.initPassengerForm(),this.initAdultFormGroup(),this.initChildFormGroup(),this.initInfantFormGroup(),this.passengerFormGroup.patchValue(Object.assign({},i))}initJourneyForm(){this.journeyFormGroup=this.fb.group({startPoint:["",[u.kI.required]],endPoint:["",[u.kI.required]],departDate:[null,[u.kI.required]],startTimeRange:[null],enablePriceOption:[!1],targetVNPrice:[0],targetVJPrice:[0],targetQHPrice:[0],enableFareOption:[!0],enableTimeStart:[!1],fareOptions:[null]},{validators:oe})}initConfigurationForm(){this.configurationFormGroup=this.fb.group({dateExpires:[null,[u.kI.required]],timeExpires:[null,[u.kI.required]],sendNotify:[!1,[u.kI.required]],agentDisplayName:[null],agentAvatar:[null],agentName:[null],agentPhone:[null,[u.kI.required,u.kI.minLength(7),u.kI.maxLength(11)]],agentPhoneArea:[this.phoneAreaDefault,u.kI.required],agentEmail:[null],agentId:[null,[u.kI.required]]})}initPassengerForm(){this.passengerFormGroup=this.fb.group({secretRemark:[null],publicRemark:[null],adultPassenger:this.fb.array([]),childPassenger:this.fb.array([]),infantPassenger:this.fb.array([])},{validator:(0,j.aV)()})}initAdultFormGroup(){for(let i=0;i<this.numberOfPassenger.adult;i++){const m=this.fb.group({firstName:[null,[u.kI.required]],lastName:[null,[u.kI.required]],gender:["male",[u.kI.required]],birthday:[null],membershipQH:[null],membershipVN:[null],issuanceDate:[null],expiryDate:[null],issuanceCountry:[null],nationality:[null],number:[null],cccdNumber:[null],documentType:[e.FV.CCCD],type:"ADT"},{validator:(0,j.fJ)("birthday",this.departureTime)});this.getFormArray("adultPassenger").push(m)}}initChildFormGroup(){for(let i=0;i<this.numberOfPassenger.child;i++){const m=this.fb.group({birthday:[null,[u.kI.required]],firstName:[null,[u.kI.required]],lastName:[null,[u.kI.required]],gender:["male",[u.kI.required]],membershipQH:[null],membershipVN:[null],issuanceDate:[null],expiryDate:[null],issuanceCountry:[null],nationality:[null],number:[null],cccdNumber:[null],documentType:[e.FV.CCCD],type:"CHD"},{validator:(0,j.$K)("birthday",this.departureTime)});this.getFormArray("childPassenger").push(m)}}initInfantFormGroup(){for(let i=0;i<this.numberOfPassenger.infant;i++){const m=this.fb.group({birthday:[null,[u.kI.required]],firstName:[null,[u.kI.required]],lastName:[null,[u.kI.required]],gender:["male",[u.kI.required]],parentIndex:[i+"",[u.kI.required]],membershipQH:[null],membershipVN:[null],issuanceDate:[null],expiryDate:[null],issuanceCountry:[null],nationality:[null],number:[null],cccdNumber:[null],documentType:[e.FV.CCCD],type:"INF"},{validator:(0,j.DW)("birthday",this.departureTime)});this.getFormArray("infantPassenger").push(m)}}getNumberOfPassenger(){this.initAdultPassengerOptions()}getFormArray(i){return this.passengerFormGroup.controls[i]}getFormControlInArray(i,m){return i.controls[m]}initAdultPassengerOptions(){for(let i=0;i<this.numberOfPassenger.adult;i++)this.optionsAdultPassenger.push({code:i+"",name:`Ng\u01b0\u1eddi l\u1edbn ${i+1}`})}changeNumberOfPassenger(i){this.numberOfPassenger=i,this.numberOfPassengerChange$.next(i)}numOfPax(){return this.numberOfPassenger}formJourneyData(){return this.journeyFormGroup.value}formPassengerData(){return this.passengerFormGroup.value}formConfigurationData(){return this.configurationFormGroup.value}resetDataService(){this.customRangeItem={rangeValues:[0,1439],startTimeStr:"00:00",endTimeStr:"23:59"},this.showPriceOption=!1,this.showTimeStartOption=!1,this.showFareOption=!0,this.selectedFaresTree=[],this.optionDepartureTime=[{name:"S\xe1ng s\u1edbm",code:"early_morning",start:"00:00",end:"05:59",isActive:!1,disable:!1,startTime:0,endTime:360,totalAvailable:0},{name:"Bu\u1ed5i s\xe1ng",code:"morning",start:"06:00",end:"11:59",isActive:!1,disable:!1,startTime:360,endTime:720,totalAvailable:0},{name:"Bu\u1ed5i chi\u1ec1u",code:"afternoon",start:"12:00",end:"17:59",isActive:!1,disable:!1,startTime:720,endTime:1080,totalAvailable:0},{name:"Bu\u1ed5i t\u1ed1i",code:"evening",start:"18:00",end:"23:59",isActive:!1,disable:!1,startTime:1080,endTime:1439,totalAvailable:0},{name:"T\xf9y ch\u1ecdn",code:"custom",start:"00:00",end:"23:59",isActive:!1,disable:!1,startTime:0,endTime:1439,totalAvailable:0}]}isAgent2Show(){const i=this._permissionService.getCurrentAuthor();return"AGENT2"===(null==i?void 0:i.titleCode.toUpperCase())}getSourceEvent(){switch(this.sourceEvent){case"SEARCH_INPUT":return 0;case"SEARCH_RESULT":return 1;case"HEADER_MANAGE":return 2;case"EMPTY_STATE":return 3;case"REGENERATE":return 4;default:return-1}}convertTimeRangeStrToMin(i){return x.duration(i).asMinutes()}minuteToString(i){const m=Math.floor(i/60),P=i%60;let F=`${m}`,O=`${P}`;return m<10&&(F=`0${m}`),P<10&&(O=`0${P}`),`${F}:${O}`}checkVJAirline(){var i;const m=null===(i=this.selectedFaresTree)||void 0===i?void 0:i.filter(P=>P.isActive).map(P=>P.code.toUpperCase());if(this.journeyFormGroup.value.enableFareOption&&m.includes("VJ")){if(this.hasVJAirline=!0,!this.checkPhoneRequired){const P=this._permissionService.getCurrentUser();this.configurationFormGroup.controls.agentPhone.setValue(P.phone)}this.configurationFormGroup.controls.agentPhone.setValidators([u.kI.required,u.kI.minLength(7),u.kI.maxLength(11)]),this.configurationFormGroup.controls.agentPhoneArea.setValidators([u.kI.required])}else if(this.journeyFormGroup.value.enablePriceOption&&this.journeyFormGroup.value.targetVJPrice){if(this.hasVJAirline=!0,!this.checkPhoneRequired){const P=this._permissionService.getCurrentUser();this.configurationFormGroup.controls.agentPhone.setValue(P.phone)}this.configurationFormGroup.controls.agentPhone.setValidators([u.kI.required,u.kI.minLength(7),u.kI.maxLength(11)]),this.configurationFormGroup.controls.agentPhoneArea.setValidators([u.kI.required])}else this.hasVJAirline=!1,this.configurationFormGroup.controls.agentPhone.setValidators(null),this.configurationFormGroup.controls.agentPhoneArea.setValidators(null)}}return c.\u0275fac=function(i){return new(i||c)(k.LFG(ie.gz),k.LFG(ie.F0),k.LFG(u.qu),k.LFG(pe.$A),k.LFG(ge.o),k.LFG(re))},c.\u0275prov=k.Yz7({token:c,factory:c.\u0275fac,providedIn:"root"}),c})();var G=a(53820);const ve={[G.b.CREATE]:{name:"\u0110ang s\u0103n v\xe9",description:"S\u0103n v\xe9 t\u1ef1 \u0111\u1ed9ng \u0111ang ho\u1ea1t \u0111\u1ed9ng",icon:"search",backgroundColor:"bg-[#FFEAB9]",textColor:"text-secondary-7-5"},[G.b.IN_PROCESS]:{name:"\u0110ang canh v\xe9",description:"Canh v\xe9 r\u1ebb t\u1ef1 \u0111\u1ed9ng \u0111ang ho\u1ea1t \u0111\u1ed9ng",icon:"search",backgroundColor:"bg-[#FFEAB9]",textColor:"text-secondary-7-5"},[G.b.COMPLETED]:{name:"\u0110\xe3 s\u0103n th\xe0nh c\xf4ng",description:"\u0110\xe3 s\u0103n \u0111\u01b0\u1ee3c v\xe9",icon:"check",backgroundColor:"bg-[#07A35D]",textColor:"text-neutral-white"},[G.b.IN_PROCESS_PRICE_UP]:{name:"\u0110ang s\u0103n gi\xe1 t\u0103ng",description:"Gi\xe1 v\xe9 \u0111\xe3 t\u0103ng, vui l\xf2ng c\xe2n nh\u1eafc xu\u1ea5t v\xe9",icon:"arrow_right_up",backgroundColor:"bg-[#ffd1bc]",textColor:"text-primary-1-4"},[G.b.CANCEL]:{name:"\u0110\xe3 h\u1ee7y",description:"\u0110\xe3 h\u1ee7y y\xeau c\u1ea7u s\u0103n v\xe9",icon:"coupon_slash",backgroundColor:"bg-[#999999]",textColor:"text-neutral-white"},[G.b.EXPIRED]:{name:"\u0110\xe3 h\u1ebft s\u0103n",description:"H\u1ebft h\u1ea1n s\u0103n v\xe9",icon:"clock",backgroundColor:"bg-[#CCCCCC]",textColor:"text-neutral-gray-6"}}},57085:(A,D,a)=>{a.d(D,{bz:()=>t,fJ:()=>n,$K:()=>p,DW:()=>C,Ab:()=>T,i4:()=>h,aV:()=>o});const t=(s,f)=>s.get(f);var e=a(15439);const p=(s,f)=>d=>{const v=d.controls[s];if(!v.value)return;const y=e(f).startOf("day").add(0,"hours").toDate().getTime(),I=e(v.value).toDate();I.setFullYear(I.getFullYear()+2);const b=I.getTime(),r=e(v.value).toDate();r.setFullYear(r.getFullYear()+12);const E=r.getTime();y<=E&&y>b?v.setErrors(null):y<=E?v.setErrors({DoBChildUnder:!0}):y>b&&v.setErrors({DoBChildUpper:!0})},C=(s,f)=>d=>{const v=d.controls[s];if(!v.value)return;const y=e(f).startOf("day").add(0,"hours").toDate().getTime(),I=e(v.value).toDate().getTime(),b=e(v.value).toDate();b.setFullYear(b.getFullYear()+2);const r=b.getTime();v.setErrors(y<=r&&y>I?null:{DoBInfant:!0})},n=(s,f)=>d=>{const v=d.controls[s];if(!v.value)return;const y=e(f).startOf("day").add(0,"hours").toDate().getTime(),I=e(v.value).toDate().getTime();v.setErrors(y-I>=378683424e3?null:{DoBAdult:!0})},T=s=>f=>{const d=f.controls[s];d.value&&d.setErrors(""!=d.value?null:{required:!0})},o=()=>s=>{let f=[];for(let d=0;d<s.controls.infantPassenger.controls.length;d++){const v=s.controls.infantPassenger.at(d).controls.parentIndex.value;f.push({index:d,parentIndex:v})}for(let d=0;d<s.controls.infantPassenger.controls.length;d++){const v=s.controls.infantPassenger.at(d).controls.parentIndex.value;f.filter(I=>I.parentIndex===v).length>1?s.controls.infantPassenger.at(d).controls.parentIndex.setErrors({ParentInfantDupplicate:!0}):s.controls.infantPassenger.at(d).controls.parentIndex.setErrors(null)}},h=(s,f)=>d=>{const v=d.controls[s],y=d.controls[f];if(!v.value||!y.value)return;const I=e(v.value).startOf("day").add(0,"hours").toDate().getTime();e(y.value).startOf("day").add(0,"hours").toDate().getTime()<=I?v.setErrors({issuanceDateInvalid:!0}):v.setErrors(null)}},49195:(A,D,a)=>{a.d(D,{t:()=>e});var t=a(53820);const e={[t.b.CREATE]:{name:"\u0110ang canh v\xe9",description:"Canh v\xe9 r\u1ebb \u0111ang ho\u1ea1t \u0111\u1ed9ng t\u1ef1 \u0111\u1ed9ng",icon:"search",backgroundColor:"bg-[#FFEAB9]",textColor:"text-secondary-7-5"},[t.b.IN_PROCESS]:{name:"\u0110ang canh v\xe9",description:"Canh v\xe9 r\u1ebb \u0111ang ho\u1ea1t \u0111\u1ed9ng t\u1ef1 \u0111\u1ed9ng",icon:"search",backgroundColor:"bg-[#FFEAB9]",textColor:"text-secondary-7-5"},[t.b.COMPLETED]:{name:"\u0110\xe3 canh th\xe0nh c\xf4ng",description:"\u0110\xe3 canh \u0111\u01b0\u1ee3c gi\xe1 v\xe9 r\u1ebb",icon:"check",backgroundColor:"bg-[#07A35D]",textColor:"text-neutral-white"},[t.b.IN_PROCESS_PRICE_UP]:{name:"\u0110ang canh gi\xe1 t\u0103ng",description:"Gi\xe1 v\xe9 \u0111\xe3 t\u0103ng, vui l\xf2ng c\xe2n nh\u1eafc xu\u1ea5t v\xe9",icon:"arrow_right_up",backgroundColor:"bg-[#ffd1bc]",textColor:"text-primary-1-4"},[t.b.CANCEL]:{name:"\u0110\xe3 h\u1ee7y",description:"\u0110\xe3 h\u1ee7y y\xeau c\u1ea7u canh v\xe9",icon:"delete",backgroundColor:"bg-[#999999]",textColor:"text-neutral-white"},[t.b.EXPIRED]:{name:"\u0110\xe3 h\u1ebft h\u1ea1n",description:"H\u1ebft h\u1ea1n canh v\xe9",icon:"clock",backgroundColor:"bg-[#CCCCCC]",textColor:"text-neutral-gray-6"}}},53820:(A,D,a)=>{a.d(D,{b:()=>t});var t=(()=>{return(e=t||(t={})).CREATE="CREATE",e.IN_PROCESS="IN_PROCESS",e.IN_PROCESS_PRICE_UP="IN_PROCESS_PRICE_UP",e.COMPLETED="COMPLETED",e.EXPIRED="EXPIRED",e.CANCEL="CANCEL",t;var e})()},97380:(A,D,a)=>{a.d(D,{D5:()=>d,VP:()=>s,_r:()=>f,v_:()=>b,xj:()=>T,yI:()=>I});var t=a(97582),e=a(87067),p=a(43429),C=a(49195),n=a(53820);let T=(()=>{class r{}return(0,t.gn)([(0,e.C)()],r.prototype,"status",void 0),(0,t.gn)([(0,p.D)(()=>o),(0,e.C)()],r.prototype,"data",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"objectError",void 0),r})(),o=(()=>{class r{}return(0,t.gn)([(0,p.D)(()=>s),(0,e.C)()],r.prototype,"listOrder",void 0),(0,t.gn)([(0,p.D)(()=>h),(0,e.C)()],r.prototype,"orderTaskStatus",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"pageOffset",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"pageSize",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"total",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"empty",void 0),r})(),h=(()=>{class r{}return(0,t.gn)([(0,e.C)()],r.prototype,"canCreateOrder",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"completeTask",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"inProcessTask",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"maxTask",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"numMaxFree",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"numOrderFree",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"ownerId",void 0),r})(),s=(()=>{class r{get stateDisplay(){switch(this.state){case n.b.CREATE:return C.t[n.b.CREATE].name;case n.b.IN_PROCESS:return C.t[n.b.IN_PROCESS].name;case n.b.COMPLETED:return C.t[n.b.COMPLETED].name;case n.b.CANCEL:return C.t[n.b.CANCEL].name;case n.b.EXPIRED:return C.t[n.b.EXPIRED].name;case n.b.IN_PROCESS_PRICE_UP:return C.t[n.b.IN_PROCESS_PRICE_UP].name;default:return""}}}return(0,t.gn)([(0,e.C)()],r.prototype,"orderId",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"canUpdate",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"code",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"state",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"monitorType",void 0),(0,t.gn)([(0,p.D)(()=>f),(0,e.C)()],r.prototype,"ticketInfo",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"distributionChannel",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"orderInfo",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"fareInfo",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"ownerInfo",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"userActionInfo",void 0),(0,t.gn)([(0,p.D)(()=>b),(0,e.C)()],r.prototype,"availableSlotInfo",void 0),r})(),f=(()=>{class r{}return(0,t.gn)([(0,e.C)()],r.prototype,"leg",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"airline",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"flightType",void 0),(0,t.gn)([(0,p.D)(()=>d),(0,e.C)()],r.prototype,"journeys",void 0),(0,t.gn)([(0,p.D)(()=>I),(0,e.C)()],r.prototype,"passengers",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"totalFare",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"originalPrice",void 0),r})(),d=(()=>{class r{}return(0,t.gn)([(0,e.C)()],r.prototype,"leg",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"startPoint",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"endPoint",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"departTime",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"arrivalTime",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"duration",void 0),(0,t.gn)([(0,p.D)(()=>y),(0,e.C)()],r.prototype,"segments",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"rangeTime",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"rangeDateTime",void 0),r})(),y=(()=>{class r{}return(0,t.gn)([(0,e.C)()],r.prototype,"startPoint",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"endPoint",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"flightNumber",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"fareBasic",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"fareClass",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"departTime",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"departZone",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"arriveTime",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"arriveZone",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"index",void 0),r})(),I=(()=>{class r{}return(0,t.gn)([(0,e.C)()],r.prototype,"birthday",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"firstName",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"lastName",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"type",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"index",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"parentIndex",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"key",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"parentKey",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"namePrefix",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"gender",void 0),r})(),b=(()=>{class r{}return(0,t.gn)([(0,e.C)()],r.prototype,"amountPerPax",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"currency",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"free",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"percent",void 0),(0,t.gn)([(0,e.C)()],r.prototype,"type",void 0),r})()},40833:(A,D,a)=>{function t(e,p){if(p.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+p.length+" present")}a.d(D,{Z:()=>t})},91998:(A,D,a)=>{function t(e){if(null===e||!0===e||!1===e)return NaN;var p=Number(e);return isNaN(p)?p:p<0?Math.ceil(p):Math.floor(p)}a.d(D,{Z:()=>t})},35650:(A,D,a)=>{a.d(D,{Z:()=>C});var t=a(91998),e=a(80953),p=a(40833);function C(n,T){(0,p.Z)(2,arguments);var o=(0,e.Z)(n),h=(0,t.Z)(T);return isNaN(h)?new Date(NaN):(h&&o.setDate(o.getDate()+h),o)}},43201:(A,D,a)=>{a.d(D,{Z:()=>n});var t=a(91998),e=a(80953),p=a(40833);function n(T,o){return(0,p.Z)(2,arguments),function C(T,o){(0,p.Z)(2,arguments);var h=(0,e.Z)(T),s=(0,t.Z)(o);if(isNaN(s))return new Date(NaN);if(!s)return h;var f=h.getDate(),d=new Date(h.getTime());return d.setMonth(h.getMonth()+s+1,0),f>=d.getDate()?d:(h.setFullYear(d.getFullYear(),d.getMonth(),f),h)}(T,12*(0,t.Z)(o))}},80953:(A,D,a)=>{a.d(D,{Z:()=>p});var t=a(86),e=a(40833);function p(C){(0,e.Z)(1,arguments);var n=Object.prototype.toString.call(C);return C instanceof Date||"object"===(0,t.Z)(C)&&"[object Date]"===n?new Date(C.getTime()):"number"==typeof C||"[object Number]"===n?new Date(C):(("string"==typeof C||"[object String]"===n)&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}},4688:(A,D,a)=>{a.d(D,{b:()=>T});var t=a(36895),e=a(94650),p=a(72506);function C(o,h){if(1&o){const s=e.EpF();e.TgZ(0,"cf-icon",3),e.NdJ("click",function(d){e.CHM(s);const v=e.oxw();return e.KtG(v.close(d))}),e.qZA()}}const n=["*"];let T=(()=>{class o{constructor(s,f,d){this.renderer=s,this.elementRef=f,this.mode="default",this.type="solid",this.size="medium",this.color="red",this.onClose=new e.vpe,d.registerIcons([p.UNF])}ngOnChanges(s){this.loadClasses()}ngOnInit(){this.loadClasses()}loadClasses(){this.classes="rounded inline-flex justify-center items-center gap-x-1 "+this.getSizeClass()+" "+this.getModeClass()}getSizeClass(){return"small"===this.size?"py-1 px-2 text-express-sm":"xsmall"===this.size?"py-[2px] px-1 text-express-sm":"py-1.5 px-3 text-express-md"}getModeClass(){return"outline"===this.type?`bg-white bordertext-${this.color}-4 border-${this.color}-4`:"inverted"===this.type?`bg-${this.color}-1 text-${this.color}-4`:"gray-2"===this.color?"text-neutral-gray-6 bg-neutral-gray-2":`text-neutral-white bg-${this.color}-4`}close(s){this.onClose.emit(s),s.defaultPrevented||this.renderer.removeChild(this.renderer.parentNode(this.elementRef.nativeElement),this.elementRef.nativeElement)}}return o.\u0275fac=function(s){return new(s||o)(e.Y36(e.Qsj),e.Y36(e.SBq),e.Y36(p.KNP))},o.\u0275cmp=e.Xpm({type:o,selectors:[["cf-label"]],hostVars:2,hostBindings:function(s,f){2&s&&e.Tol(f.classes)},inputs:{mode:"mode",type:"type",size:"size",color:"color"},outputs:{onClose:"onClose"},standalone:!0,features:[e.TTD,e.jDz],ngContentSelectors:n,decls:4,vars:1,consts:[[1,"flex","justify-between","items-center","gap-x-2"],[1,"text-ellipsis","overflow-hidden","whitespace-normal","flex","items-center"],["icon","close","size","small","class","cursor-pointer",3,"click",4,"ngIf"],["icon","close","size","small",1,"cursor-pointer",3,"click"]],template:function(s,f){1&s&&(e.F$t(),e.TgZ(0,"div",0)(1,"div",1),e.Hsn(2),e.qZA(),e.YNc(3,C,1,0,"cf-icon",2),e.qZA()),2&s&&(e.xp6(3),e.Q6J("ngIf","closeable"===f.mode))},dependencies:[t.ez,t.O5,p.AxE,p.Sm8],encapsulation:2,changeDetection:0}),o})()},86:(A,D,a)=>{function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(p){return typeof p}:function(p){return p&&"function"==typeof Symbol&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p})(e)}a.d(D,{Z:()=>t})}}]);