// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,r,t){var a=Scanner.fromMessage(e);a.setLocale(r);var i,n,p,o,l,d,u,m,s,g,h=[],c=a.getSpan();n=c.nextText(t.reservationHeader).nextTag("table4").nextTag("td4").nextTag("td4").tagContents();for(var T,v,C,A,f=c.nextText(t.reservationHeader).nextTag("table5").allInnerTagsFiltered("table6"),b=0;b<f.length;b++){var x={};T=f[b].innerCapture(/(.+?)\[\/td6\]/,1),l=(""+f[b].allInnerTagsFiltered("td6")[1]).match(/(.+)\s(.+)/)[1],o=f[b].allInnerTagsFiltered("td6")[1].innerCapture(/(?:)\s(.+)/,1),v=f[b].allInnerTagsFiltered("td6")[2],[,u,C,m]=T.innerCapture(/(.+)\s\((.+),.*?\)(.+)/),[,d,o]=o.innerCapture(/\[([0-9A-Z]{2})\s(\d+).*\]/),[,s,A,g]=v.innerCapture(/(.+)\s\((.+),.*?\)(.+)/),u=combineDateAndTime(C,u),x.departureTime=u,s=getFuzzyDate(a.getDetachedSpan(""+s)),s=combineDateAndTime(A,s),x.arrivalTime=s,x.departureAirport=m.trim(),x.arrivalAirport=g.trim(),x.flightNumber=o,x.airlineName=l.trim(),x.airlineCode=d,ASSERT(x.airlineCode,x.flightNumber,x.departureTime,x.departureAirport)&&h.push(x)}var y=c.next(t.extraChargePrefix).parentTag("td4").tagContents().innerCapture(/(.+)\(/,1),F=y.innerCapture(/([\d,.]+)/,1),N=y.innerCapture(/([^\d,.]+)/,1).trim(),S=[];for(b=0;b<h.length;b++){var z=h[b];if(ASSERT(z.airlineCode,z.flightNumber,z.departureTime,z.departureAirport)){var I={"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",airlineName:z.airlineName,airlineCode:z.airlineCode,flightNumber:z.flightNumber,departureAirportFuzzy:z.departureAirport,departureAirportCode:z.departureCode,departureTime:z.departureTime,arrivalAirportFuzzy:z.arrivalAirport,arrivalAirportCode:z.arrivalCode,arrivalTime:z.arrivalTime},underName:{"@type":"http://schema.org/Person",name:""},checkinUrl:p,reservationId:z.reservationId,reservationStatus:"http://schema.org/ReservationConfirmed",totalPrice:F,priceCurrency:N,reservedTicket:{"@type":"http://schema.org/Ticket",ticketNumber:i,ticketedSeat:{"@type":"http://schema.org/Seat",seatNumber:"",seatingType:""}}};S.push(I)}}if(S.length)return S}}).call();