// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,r,t){var a=Scanner.fromMessage(e);a.setLocale(r);var i,p,o,n,l,u,m,h,d,s,g,c,v,A,z=[],f=[],y=[],C=[],T=a.getSpan();for(c=T.innerCapture(t.passengersRegExp),c&&3===c.length&&(z=c[1].split(","),f=c[2].split(",")),c=T.allInnerCapture(t.flightRegExp),v=0;v<c.length;v++)c[v]&&10===c[v].length&&([,o,n,l,u,m,h,d,s,g]=c[v],i=combineDateAndTime(l.trim(),s),p=combineDateAndTime(l.trim(),g),Date.parse(""+p)<Date.parse(""+i)&&(p=modifyDate(p,1)),ASSERT(o,n,i)&&y.push({airlineCode:o,flightNumber:n,departureAirportCode:u,departureAirportFuzzy:m,arrivalAirportCode:h,arrivalAirportFuzzy:d,departureDateTime:i,arrivalDateTime:p}));for(v=0;v<z.length;v++){var F=z[v],D=f[v];for(A=0;A<y.length;A++){var S=y[A],b={"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",airlineCode:S.airlineCode,flightNumber:S.flightNumber,departureAirportFuzzy:S.departureAirportFuzzy,departureAirportCode:S.departureAirportCode,departureTime:S.departureDateTime,arrivalAirportFuzzy:S.arrivalAirportFuzzy,arrivalAirportCode:S.arrivalAirportCode,arrivalTime:S.arrivalDateTime},underName:{"@type":"http://schema.org/Person",name:F},reservedTicket:{"@type":"http://schema.org/Ticket",ticketNumber:D,ticketedSeat:{"@type":"http://schema.org/Seat"}},reservationStatus:"http://schema.org/ReservationConfirmed"};C.push(b)}}if(C.length)return C}}).call();