(function(){return function(e,r,t){var a=Scanner.fromMessage(e);a.setLocale(r);var i,n,p,o,m,s,u,g,d,l,h,c,v,C,N,b,f,S,y,$=[],T=[];if(i=a.getSpan().innerCapture(t.name,1).trim(),h=a.getSpan().innerCapture(regExpFormatted(/\1\s+?(.+)/,t.ticketNumber),1),N=a.getSpan().innerCapture(regExpFormatted(/\1\s+?([A-Z\d]{4,})/,t.reservationId),1),not(i))return CONTINUE;T[""+i]={name:i,seats:{},seatingType:{},ticketNumber:h,totalPrice:c,priceCurrency:v};var A=a.getSpan().next(t.contentRegex);b=a.getSpan().allInnerCapture(t.arrival,1);for(var x=0;x<b.length;x++)1===b.length&&(y=/(\w{3})\s(\w{3})$/.exec(e.subject),u=y[1],l=y[2]),S=b[x].withStart(A.getEnd()).withEnd(b[x].previous(/.*/).next(t.flightSectionEnd).getEnd()),f=S.innerCapture(t.flightInfo),m=a.getDetachedSpan(f.$departureDate+" "+f.$departureHour+":"+f.$departureMinute).innerDate(),f.$arrivalDate.exists()||(f.$arrivalDate=f.$departureDate),g=a.getDetachedSpan(f.$arrivalDate+" "+f.$arrivalHour+":"+f.$arrivalMinute).innerDate(),o=f.$airlineCode,n=f.$flightNumber,s=f.$departureAirport.trim(),d=f.$arrivalAirport.trim(),p=a.getSpan().innerCapture(regExpFormatted(/\1\s+?(.+)/,t.price),1),c=p.innerCapture(/([\d,.]+)/,1),v=p.innerCapture(/([^\d,.]+)/,1).trim(),A=S,ASSERT(o,n,s,m,d,g)&&$.push({reservationId:N,airlineCode:o,flightNumber:n,departureAirport:s,departureCode:u,departureTime:m,arrivalAirport:d,arrivalCode:l,arrivalTime:g,passengers:T});var D=[];for(x=0;x<$.length;x++)for(var E=$[x],F=Object.keys(E.passengers),k=0;k<F.length;k++){var I=E.passengers[F[k]],z={"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",airlineName:E.airlineName,airlineCode:E.airlineCode,flightNumber:E.flightNumber,departureAirportFuzzy:E.departureAirport,departureAirportCode:E.departureCode,departureTime:E.departureTime,arrivalAirportFuzzy:E.arrivalAirport,arrivalAirportCode:E.arrivalCode,arrivalTime:E.arrivalTime},underName:{"@type":"http://schema.org/Person",name:I.name},checkinUrl:C,reservationId:E.reservationId,reservationStatus:"http://schema.org/ReservationConfirmed",totalPrice:c,priceCurrency:v,reservedTicket:{"@type":"http://schema.org/Ticket",ticketNumber:h,ticketedSeat:{"@type":"http://schema.org/Seat",seatNumber:I.seats[E.flightNumber],seatingType:I.seatingType[E.flightNumber]}}};valid(I.membershipNumber,I.programName)&&(z.programMembershipUsed={"@type":"http://schema.org/ProgramMembership",membershipNumber:I.membershipNumber,programName:I.programName}),D.push(z)}return D.length?D:void 0}}).call();