// 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,g,s,o,u,m,d,l,T,h,x,C,c,v,y,b,f,N,A,z=[],S={};for(d="T'way Air",m=a.getSpan(),i=m.innerCapture(regExpFormatted(/\1 - (\w*)/,r.reservationId_prefix),1),g=m.next(r.name).nextTag("table2").nextTag("tr2").nextTag("tr2").nextTag("td2").innerCapture(/\s*1.\s(.*)\sM/,1),o=m.next(r.flightExit).nextTag("table2").nextTag("tr2").nextTag("tr2"),N=0;N<10&&null===o.nextTag("td2").tagContents().innerCapture(r.totalPrice_prefix);)o=o.nextTag("tr2"),N+=1;o=o.nextTag("td2").nextTag("td2").nextTag("td2").innerCapture(/([\d,]+\s+[A-z]+)\s*/,1),y=o.innerCapture(/([\d,]+)\s/,1),b=o.innerCapture(/([\d,]+)\s([A-z]+)\s*/,2),f=m.next(r.seatType).innerCapture(r.seatType,1),ASSERT(g)&&(S[""+g]={name:g,seats:{},seatingType:f,ticketNumber:null,totalPrice:y,priceCurrency:b});var F=m.next(r.flightSummary).nextTag("table2");o=F.nextTag("tr2").nextTag("tr2");do s=o.nextTag("td2").tagContents().innerCapture(/(.*)\n/,1),h=o.nextTag("td2").nextTag("td2").tagContents(),x=h.innerCapture(/(.{3})/,1),h=h.innerCapture(/(.*)\n(.*)/,2),c=o.nextTag("td2").nextTag("td2").nextTag("td2").tagContents(),v=c.innerCapture(/(.{3})/,1),c=c.innerCapture(/(.*)\n(.*)/,2),A=o.nextTag("td2").nextTag("td2").nextTag("td2").nextTag("td2").tagContents(),T=s+" "+A.innerCapture(/(.*)\n/,1),T=getFuzzyDate(a.getDetachedSpan(T).firstDate()),C=s+" "+A.innerCapture(/(.*)\n(.*)/,2),C=getFuzzyDate(a.getDetachedSpan(C).firstDate()),A=A.nextTag("td2").tagContents(),l=A.innerCapture(/(.{2})/,1),u=A.innerCapture(/(.*)\n(.*)/,2),ASSERT(l,u,h,T,c,C)&&z.push({reservationId:i,airlineName:d,airlineCode:l,flightNumber:u,departureAirport:h,departureCode:x,departureTime:T,arrivalAirport:c,arrivalCode:v,arrivalTime:C,passengers:S}),o=o.nextTag("tr2");while(null===o.nextTag("td2").tagContents().innerCapture(r.flightExit));for(var k=[],D=0;D<z.length;D++)for(var P=z[D],E=Object.keys(P.passengers),I=0;I<E.length;I++){var M=P.passengers[E[I]],R={"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",airlineName:P.airlineName,airlineCode:P.airlineCode,flightNumber:P.flightNumber,departureAirportFuzzy:P.departureAirport,departureAirportCode:P.departureCode,departureTime:P.departureTime,arrivalAirportFuzzy:P.arrivalAirport,arrivalAirportCode:P.arrivalCode,arrivalTime:P.arrivalTime},underName:{"@type":"http://schema.org/Person",name:M.name},checkinUrl:p,reservationId:P.reservationId,reservationStatus:"http://schema.org/ReservationConfirmed",totalPrice:M.totalPrice,priceCurrency:M.priceCurrency,reservedTicket:{"@type":"http://schema.org/Ticket",ticketNumber:n,ticketedSeat:{"@type":"http://schema.org/Seat",seatNumber:M.seats[P.flightNumber],seatingType:M.seatingType}}};valid(M.membershipNumber,M.programName)&&(R.programMembershipUsed={"@type":"http://schema.org/ProgramMembership",membershipNumber:M.membershipNumber,programName:M.programName}),k.push(R)}if(k.length)return k}}).call();