// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,r,t,a){if(int(e.epoch)<=1443052800)return CONTINUE;var n=Scanner.fromMessage(e);n.setLocale(r);var i,o,p,s,m,g,l=n.getSpan(),u=[],c=[];i=(""+l.innerCapture(regExpFormatted(/\1 (.*)/,t.reservationId_prefix),1)).trim(),p=l.next(t.price_prefix).nextAnyTag("td").tagContents(),o=l.next(t.price_prefix).nextAnyTag("td").nextAnyTag("td").tagContents(),s=l.next(t.checkinUrl_prefix).nextLink();var d=l.allInnerTags("tr4").filter(function(e){var r=""+e.tagContents();return 0!==r.length&&(r.indexOf("Depart ")>-1||r.indexOf("Arrive in")>-1)});return d.forEach(function(e){var r,a,i,o,p,s,c,d,h,v,f,C,N="Southwest Airlines",T="WN";e=e.allInnerTags("td4"),""+e[0].tagContents()!=""&&(m=g=e[0].tagContents()),r=e[1].tagContents();var x;x=e[e.length-1],a=/(?:Depart|Change planes.*in)\s(.*)\s\((.*)\).*at\s(.*)/.exec(""+x),p=a[1],s=a[2],i=a[3],c=/Arrive in\s(.*)\s\((.*)\)\s.*at\s(.*)\s\s\n/.exec(""+x),v=c[1],f=c[2],d=c[3],o=getFuzzyDate(n.getDetachedSpan(m+" "+i).firstDate()),h=getFuzzyDate(n.getDetachedSpan(g+" "+d).firstDate()),C=l.next(t.passengers_prefix).parentTag("table3").allInnerTags("tr4").filter(function(e){var r=e.allInnerTags("td4");return!(5!==r.length||!/^[0-9]*$/.exec((""+r[2].tagContents()).trim()))}),C.forEach(function(e){var t,a,n,i="Rapid Rewards";e=e.allInnerTags("td4"),t=e[0].tagContents(),a=e[2].tagContents(),n=(""+e[1].tagContents()).trim(),/^[0-9]*$/.exec(n)||(n=null),u.push({airlineName:N,airlineCode:T,flightNumber:r,departureDateTime:o,departureAirport:p,departureAirportCode:s,arrivalDateTime:h,arrivalAirport:v,arrivalAirportCode:f,ticketNumber:a,underPersonName:t,programName:i,membershipNumber:n})})}),u.forEach(function(e){ASSERT(e.departureDateTime,e.arrivalDateTime,e.departureAirportCode,e.arrivalAirportCode),c.push({"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",airlineName:e.airlineName,airlineCode:e.airlineCode,flightNumber:e.flightNumber,departureAirportFuzzy:e.departureAirport,departureAirportCode:e.departureAirportCode,departureTime:e.departureDateTime,arrivalAirportFuzzy:e.arrivalAirport,arrivalAirportCode:e.arrivalAirportCode,arrivalTime:e.arrivalDateTime},underName:{"@type":"http://schema.org/Person",name:e.underPersonName},checkinUrl:s,reservationId:i,reservationStatus:"http://schema.org/Reservation"+a,totalPrice:o,priceCurrency:p,reservedTicket:{"@type":"http://schema.org/Ticket",ticketNumber:e.ticketNumber,ticketedSeat:{"@type":"http://schema.org/Seat",seatNumber:e.seatNumber,seatingType:e.seatType}},programMembershipUsed:{"@type":"http://schema.org/ProgramMembership",membershipNumber:e.membershipNumber,programName:e.programName}})}),c.length>=1?c:CONTINUE}}).call();