(function(){return function(e,t,r){var a=Scanner.fromMessage(e);a.setLocale(t);var n,i,s,o,l,g,p,m,u,d,c,T,x,h,v,C,b=[],f=[],N=[];n=a.getSpan().innerCapture(regExpFormatted(/\1(\w+)/,r.reservationId),1),g=a.getSpan().next(r.checkIn).nextLink();for(var A=a.getSpan().nextText("Your ticket(s) is/are:").parentTag("td2").tagContents().getString(),k=[],y=0;null!==(k=r.nameInfoRegex.exec(A));)b[k[1]]={name:k[1],ticketNumber:k[2],seats:{}},y++;var S=a.getSpan().nextText("Your Booking Reference is").nextTag("table3").allInnerTagsFiltered("table4");for(h=0;h<S.length;h++){var D=S[h].innerCapture(/($<airlineName>.+) Flight Number ($<airlineCode>[A-Z0-9]{2}) ($<flightNumber>\d+)/);u=S[h].innerDate(),p=D.$airlineName,m=D.$airlineCode,T=D.$flightNumber;var F=S[h].allInnerTags("table5");[,i]=F[0].nextText("Departure:").nextTag("td5").tagContents().innerCapture(/(.+)\n/),s=F[0].nextText("Departure:").nextTag("td5").innerDate(),F[0].nextText("Arrival:").nextTag("td5").tagContents(),[,l]=F[0].nextText("Arrival:").nextTag("td5").tagContents().innerCapture(/(.+)\n/),o=F[0].nextText("Arrival:").nextTag("td5").innerDate(),s=combineDateAndTime(u,s),o=combineDateAndTime(u,o);var I=S[h].allInnerTags("table6")[0].nextTag("td6").nextTag("td6").tagContents();x=Object.keys(b);var z,$;for(x=Object.keys(b),z=F[2]?F[2].allInnerTags("table6"):F[1].allInnerTags("table6"),v=0;v<z.length;v++){var R=z[v].nextText("Seat(s):").previousTag("td6").tagContents();$=(""+z[v].nextText("Seat(s):").nextTag("td6").tagContents()).match(/(.+)\//),$=$?$[1].trim():"N/A";for(var j=0;j<y;j++)if(0===(""+x[j]).localeCompare(""+R)){b[x[j]].seats[""+T]=$,b[x[j]].seats.class=I;break}}Date.parse(s)>Date.parse(o)&&(o=modifyDate(o,1)),ASSERT(T,s,o)&&f.push({airlineName:p,airlineCode:m,flightNumber:T,departureTime:s,departureCode:d,departureAirport:i.trim(),arrivalTime:o,arrivalCode:c,arrivalAirport:l.trim(),passengers:b})}for(h=0;h<f.length;h++){var C=f[h],O=Object.keys(C.passengers);for(v=0;v<O.length;v++){x=C.passengers[O[v]];N.push({"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",airlineName:C.airlineName,airlineCode:C.airlineCode,flightNumber:C.flightNumber,departureAirportFuzzy:C.departureAirport,departureAirportCode:C.departureCode,departureTime:C.departureTime,arrivalAirportFuzzy:C.arrivalAirport,arrivalAirportCode:C.arrivalCode,arrivalTime:C.arrivalTime},underName:{"@type":"http://schema.org/Person",name:x.name},checkinUrl:g,reservationId:n,reservationStatus:"http://schema.org/ReservationConfirmed",totalPrice:x.totalPrice,priceCurrency:x.priceCurrency,reservedTicket:{"@type":"http://schema.org/Ticket",ticketNumber:x.ticketNumber,ticketedSeat:{"@type":"http://schema.org/Seat",seatNumber:x.seats[""+C.flightNumber],seatingType:x.seats.class}}})}}if(N.length)return N}}).call();