// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,t,a){var r=Scanner.fromMessage(e);r.setLocale(t);var n,i,o,g,p,d,m=r.getSpan().next(a.reservationIdPrefix).nextTag("td4").tagContents(),x=r.getSpan().next(a.departureHeader),s=x.next(a.departurePrefix).nextTag("td1").tagContents().innerCapture(regExpFormatted(/\1(.+)\./,a.departurePrefix),1),u=x.nextTag("table2").nextTag("td2").tagContents(),l=x.nextTag("table2").nextTag("td2").nextTag("td2").tagContents().innerCapture(/($<airportName>.+)\(($<airportCode>.+)\)/),C=l.$airportName.trim(),T=l.$airportCode,c=x.next(a.arrivalPrefix).parentTag("td1").tagContents().innerCapture(regExpFormatted(/\1(.+)\./,a.arrivalPrefix),1);u=getFuzzyDate(r.getDetachedSpan(""+u)),s=getFuzzyDate(r.getDetachedSpan(""+s)),s=combineDateAndTime(u,s),c=getFuzzyDate(r.getDetachedSpan(""+c)),c=combineDateAndTime(u,c);var h=x.nextTag("table2").nextTag("table2").nextTag("td2").nextTag("td2").tagContents().innerCapture(/($<airportName>.+)\(($<airportCode>.+)\)/),v=h.$airportName.trim(),f=h.$airportCode,S=x.nextTag("table3").nextTag("td3").nextTag("td3").tagContents().innerCapture(/($<airlineName>\D+).*\s(\D+)($<flightNumber>\d+)\n/);g=S.$airlineName.trim(),o=S.$flightNumber.trim(),d=r.getSpan().nextText(a.passengerPrefix).nextTag("td2").tagContents();var y=r.getSpan().nextText(a.totalCostPrefix).nextTag("td2").tagContents();if(n=y.innerCapture(/([\d,.-]+)/,1),i=y.innerCapture(/([^\d,.-]+)/,1).trim(),ASSERT(s,T,c,f))return[{"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",airlineName:g,airlineCode:p,flightNumber:o,departureAirportFuzzy:C,departureAirportCode:T,departureTime:s,arrivalAirportFuzzy:v,arrivalAirportCode:f,arrivalTime:c},underName:{"@type":"http://schema.org/Person",name:d,email:""},reservationId:m,reservationStatus:"http://schema.org/ReservationConfirmed",totalPrice:n,priceCurrency:i,reservedTicket:{"@type":"http://schema.org/Ticket",ticketedSeat:{"@type":"http://schema.org/Seat"}}}]}}).call();