// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,t,r){var a=Scanner.fromMessage(e);a.setLocale(t);var i,n,p,o,g,d=a.getSpan(),s=[],u=[];i=d.innerCapture(regExpFormatted(/\1 (.*),/,r.underPersonName_prefix),1),n=d.innerCapture(regExpFormatted(/\1 ([A-Z0-9]+)/,r.reservationId_prefix),1),g=d.nextText(r.checkinUrl_prefix).nextLink();for(var l=d.nextText(r.reservationForBlock_prefix).nextTag("table2");l!=a.getNullSpan()&&(""+l).indexOf("table4")>-1;)s.push(l),l=l.nextTag("table2");var c=function(e,t){e.forEach(function(e){var i,n,p,o,g,d,s,u,l,c,m,x,T,h,v,C=e.nextTag("td3").tagContents();[,n,p,i]=/^([a-zA-Z]+) ([a-zA-Z0-9]+) (.*)/.exec(C),o=e.innerCapture(regExpFormatted(/\1 ([a-zA-Z0-9]+)./,r.ticketNumber_prefix),1),g=e.nextTag("td4").nextTag("td4").tagContents().innerCapture(regExpFormatted(/\1\n(.*)/,r.seatType_prefix),1);var f=e.nextTag("td2").tagContents().split("-")[0].trim();[,l,c]=/(.*) \((.*)\)/.exec(f);var A=e.nextTag("td2").tagContents().split("-")[1].trim();[,h,v]=/(.*) \((.*)\)/.exec(A),d=(""+e.nextTag("td3").nextTag("td3").tagContents()).split("\n")[2].substring(3).replace(/ /g,"-"),s=e.nextTag("td3").nextTag("td3").tagContents().split("\n")[3],u=getFuzzyDate(a.getDetachedSpan(d+", "+s).firstDate()),m=(""+e.nextTag("td3").nextTag("td3").nextTag("td3").tagContents()).split("\n")[2].substring(3).replace(/ /g,"-"),x=e.nextTag("td3").nextTag("td3").nextTag("td3").tagContents().split("\n")[3],T=getFuzzyDate(a.getDetachedSpan(m+", "+x).firstDate()),t({airlineName:i,airlineCode:n,flightNumber:p,departureDateTime:u,departureAirport:l,departureAirportCode:c,arrivalDateTime:T,arrivalAirport:h,arrivalAirportCode:v,ticketNumber:o,seatType:g})})};return c(s,function(e){ASSERT(e.flightNumber,e.departureAirport,e.arrivalAirport)&&u.push({"@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.departureAirportCode,departureTime:e.departureDateTime,arrivalAirportFuzzy:e.arrivalAirport,arrivalAirportCode:e.arrivalAirportCode,arrivalTime:e.arrivalDateTime},underName:{"@type":"http://schema.org/Person",name:i},checkinUrl:g,reservationId:n,reservationStatus:"http://schema.org/ReservationConfirmed",totalPrice:p,priceCurrency:o,reservedTicket:{"@type":"http://schema.org/Ticket",ticketNumber:e.ticketNumber,ticketedSeat:{"@type":"http://schema.org/Seat",seatNumber:e.seatNumber,seatingType:e.seatType}}})}),u.length>=1?u:CONTINUE}}).call();