(function(){return function(e,r,t){if(int(e.epoch)<1356998400)return STOP;var a=Scanner.fromMessage(e);a.setLocale(r);var n,i,p,l,s,o,m,g,u,d,c,h,v,T,f,b,y,C,N,x,A,S,F,k=[],$={};i=a.getSpan().innerCapture(regExpFormatted(/\1\s+(.*)\s/,t.bookingReference),1),t.checkinUrl&&(p=a.getSpan().nextText(t.checkinUrl).nextLink());var D=a.getSpan().next(t.totalNewFare).nextAnyTag("td"),z=/(\w+)\s*((?:\d+,{0,})+\.?\d{0,})/;"fr_FR"===r&&(z=/(\D+)\s((?:\d+,{0,}\s?,?)+\.?\d{0,})/),D.isNullSpan_?(h=a.getSpan().next(t.payment).next(t.fare).nextAnyTag("td").tagContents(),S=h.replace(z,"$2"),F=h.replace(z,"$1")):(D=D.tagContents(),F=D.replace(z,"$1"),S=D.replace(z,"$2"),h="null"),/Votre r\xe9servation/.test(e.subject)&&(h=a.getSpan().next(t.payment).parentAnyTag("td").next(t.fare).parentAnyTag("td").tagContents(),t.fare.test(/Total/)&&(z=/Total\s*(\D+)(\d+\s*\d+\s*(?:\d+,?)+)/),F=h.replace(z,"$1"),S=h.replace(z,"$2")),s=a.getSpan().nextText(t.passengers).nextTag("table4").allInnerTags("tr4").map(function(e){return e.allInnerTagsFiltered("td4")}).filter(function(e){return e.length>=3});for(var P=0;P<s.length;P++){T=s[P],l=T[0],$[""+l]={name:l,seats:{},seatingType:{},programName:"Frequent Flyer",membershipNumber:""+T[1]!==t.NA&&T[1]||null,totalPrice:S,priceCurrency:F},A=T.length>3?3:2,m=T[A].split("\n");for(var I,R=0;R<m.length;R++)I=m[R].split("/ "),o=I[1]&&I[1].innerCapture(/(\d+[A-Z])/,1),valid(o)&&($[""+l].seats[""+I[0]]=o)}d=a.getSpan().nextText(t.itineraryDetails).nextTag("table4").allInnerTags("tr4");for(var U=1;U<d.length;U++){u=d[U];var j=u.allInnerTagsFiltered("td4");g=j[0],f=j[1].innerCapture(/($<code>\D+)($<flightNumber>\d+)/),b=f?f.$code:null,c=f?f.$flightNumber:null,C=j[3].innerCapture(/([A-Z]{3}) </,1),y=combineDateAndTime(g,j[3].innerDate()),x=j[4].innerCapture(/([A-Z]{3}) </,1),v=j[4].innerCapture(/(\+1)$/,1).exists(),v&&(g=modifyDate(g,1)),N=combineDateAndTime(g,j[4].innerDate());var M=j[j.length-1];if(valid(c,M)){s=Object.keys($);for(var P=0;P<s.length;P++)$[""+s[P]].seatingType[""+c]=M}ASSERT(b,c,y,C,N,x)&&k.push({airlineCode:b,flightNumber:c,departureTime:y,departureCode:C,arrivalTime:N,arrivalCode:x,passengers:$})}for(var O=[],Z=0;Z<k.length;Z++)for(var w=k[Z],E=Object.keys(w.passengers),L=0;L<E.length;L++){var _=w.passengers[E[L]],q={"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",airlineName:w.airlineName,airlineCode:w.airlineCode,flightNumber:w.flightNumber,departureAirportFuzzy:w.departureAirport,departureAirportCode:w.departureCode,departureTime:w.departureTime,arrivalAirportFuzzy:w.arrivalAirport,arrivalAirportCode:w.arrivalCode,arrivalTime:w.arrivalTime},underName:{"@type":"http://schema.org/Person",name:_.name},checkinUrl:p,reservationId:i,reservationStatus:"http://schema.org/ReservationConfirmed",totalPrice:_.totalPrice,priceCurrency:_.priceCurrency,reservedTicket:{"@type":"http://schema.org/Ticket",ticketNumber:n,ticketedSeat:{"@type":"http://schema.org/Seat",seatNumber:_.seats[w.airlineCode+""+w.flightNumber],seatingType:_.seatingType[w.flightNumber]}}};valid(_.membershipNumber,_.programName)&&(q.programMembershipUsed={"@type":"http://schema.org/ProgramMembership",membershipNumber:_.membershipNumber,programName:_.programName}),O.push(q)}return O.length?O:void 0}}).call();