// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,t,r){var a=Scanner.fromMessage(e);a.setLocale(t);var n,i,p,o,g,d,s,u=[],l=[];o=a.getSpan().next(r.reservationId).parentAnyTag("td").tagContents().innerCapture(regExpFormatted(/\1\s(.*)/,r.reservationId),1);var m="avianca",T="AV",v=a.getSpan().allInnerCapture(r.leg,1);for(d=0;d<v.length;d++){var A={},h=v[d].nextDate();s=v[d].next(r.departure),A.departureTime=combineDateAndTime(h,s.nextAnyTag("td").innerDate()),A.departureAirport=s.nextAnyTag("td").nextAnyTag("td").tagContents(),s=v[d].next(r.arrival),A.arrivalTime=combineDateAndTime(h,s.nextAnyTag("td").innerDate()),A.arrivalAirport=s.nextAnyTag("td").nextAnyTag("td").tagContents(),A.flightNumber=s.next(r.airline).nextAnyTag("td").tagContents().innerCapture(/\w(\d+)/,1),A.seatingType=s.next(r.seatingType).nextAnyTag("td").tagContents().innerCapture(/([^<\s]+)/,1),ASSERT(A.departureTime,A.arrivalTime,A.flightNumber,A.departureAirport,A.arrivalAirport)&&l.push(A)}for(d=0;d<l.length;d++){n=l[d];var c={"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",airlineName:m,airlineCode:T,flightNumber:n.flightNumber,departureAirportFuzzy:n.departureAirport,departureAirportCode:n.departureAirportCode,departureTime:n.departureTime,arrivalAirportFuzzy:n.arrivalAirport,arrivalAirportCode:n.arrivalAirportCode,arrivalTime:n.arrivalTime},underName:{"@type":"http://schema.org/Person",name:e.to},reservationId:o,reservationStatus:"http://schema.org/ReservationConfirmed",totalPrice:i,priceCurrency:p,reservedTicket:{"@type":"http://schema.org/Ticket",ticketNumber:g,ticketedSeat:{"@type":"http://schema.org/Seat",seatingType:n.seatingType}}};u.push(c)}if(u.length)return u}}).call();