(function(){return function(e,t,r){var a=Scanner.fromMessage(e);a.setLocale(t);var n,i,l,s,o,p,u,d,m,g,c,f,h,v=a.getSpan(),A=[],x=[];v.next(r.itNum).parentAnyTag("td").tagContents().innerCapture(regExpFormatted(/\1\s*[\n]+(.*)/,r.itNum),1);i=r.cancelled.test(e.plain)?"cancelled":"confirmed";var T=a.getSpan().next(r.departure).parentAnyTag("td").nextAnyTag("td").tagContents().innerCapture(/[a-zA-Z ]+($<flightNumber>\d+)\s(?:\1.*)?/),C=a.getSpan(),b=v.next(r.departure).nextTag("table7"),N=v.next(r.departure).nextTag("table7").allInnerTagsFiltered("td8");N=N.filter(function(e){return!/Terminal: [\dA-Z]/.test(e.getString())});for(var y=v;!b.isNullSpan_&&0!==N.length;){var $=[];if(N.length<2)b=b.next(r.return).nextTag("table7"),N=b.allInnerTagsFiltered("td8"),N=N.filter(function(e){return!/Terminal: [\dA-Z]/.test(e.getString())});else{if(y.next(r.confirmation).exists()){var D=y.next(r.confirmation).parentAnyTag("td").tagContents().innerCapture(regExpFormatted(/\1\s*[\n]+($<confirm>.*)\s*\(.*\)/,r.confirmation));n=D?D.$confirm:null}else n=h;if(y.next(r.ticket).exists())for(var S=(""+y.next(r.ticket).parentAnyTag("td").tagContents()).split("\n").filter(function(e){return e.length>0}).map(function(e){return e.replace(/(\d+)\s*\((.*)\)/,"$1")}),F=(""+y.next(r.ticket).parentAnyTag("td").tagContents()).split("\n").filter(function(e){return e.length>0}).map(function(e){return e.replace(/(\d+)\s*\((.*)\)/,"$2")}),k=1;k<S.length;k++)$.push({name:F[k].trim(),ticketNumber:S[k].trim()});else $=x;var z,Z=b.previous(r.dateCheck).nextAbsoluteDate();Z===f&&z>unSpanDate_(Z)&&(Z=z),T=N[0].innerCapture(/($<airlineName>[a-zA-Z\s]+)\s\(($<airlineCode>[\d\w]+)\)/),p=T?T.$airlineName:null,u=T?T.$airlineCode:null,o=N[1].innerDate();var I=b.previousAnyTag("td").tagContents().innerCapture(regExpFormatted(/($<airline>[a-zA-Z ]+)($<flightNumber>\d+)\s?(?:\1.*)?/,r.op));s=I?I.$flightNumber:null,l=I?I.$airline:null,o=combineDateAndTime(Z,o),Date.parse(o)<Date.parse(d)&&(o=modifyDate(o,1),z=o.split(" ")[0],Z=z),T=N[2].innerCapture(/($<airlineName>[a-zA-Z\s]+)\s\(($<airlineCode>[\d\w]+)\)/),T=T?T:N[3].innerCapture(/($<airlineName>[a-zA-Z\s]+)\s\(($<airlineCode>[\d\w]+)\)/),m=T?T.$airlineName:null,g=T?T.$airlineCode:null,d=N[3].innerDate();var w;C.exists()&&(C=C.next(regExpFormatted(/\1\s*:\s*(\w+)/i,r.cabin)),w=C.exists()?C.getString().split(":")[1].trim():""),/\d?\d:\d{2}(?:AM|PM)?/i.test(d)||(d=N[4]),/\+\d day/.test(N[3])&&(Z=N[3].nextAbsoluteDate(),z=unSpanDate_(Z)),d=combineDateAndTime(Z,d),Date.parse(o)>Date.parse(d)&&(d=modifyDate(d,1),z=d.split(" ")[0]),d&&A.push({departureAirport:p,departureCode:u,departureTime:o,arrivalTime:d,arrivalAirport:m,flightNumber:s,arrivalCode:g,airlineName:l,cabin:w,passengers:$,reservationId:n}),f=b.previous(r.dateCheck).nextAbsoluteDate(),b=b.nextTag("table7"),N=b.allInnerTagsFiltered("td8"),N=N.filter(function(e){return!/Terminal: [\dA-Z]/.test(e.getString())}),y=m,x=$,h=n}}for(var E=[],c=0;c<A.length;c++)for(var M=A[c],$=M.passengers,_=0;_<$.length;_++){var P={"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",airlineName:M.airlineName.trim(),flightNumber:M.flightNumber,departureAirportFuzzy:M.departureAirport,departureAirportCode:M.departureCode,departureTime:M.departureTime,arrivalAirportFuzzy:M.arrivalAirport,arrivalAirportCode:M.arrivalCode,arrivalTime:M.arrivalTime},underName:{"@type":"http://schema.org/Person",name:$[_].name},reservedTicket:{"@type":"http://schema.org/Ticket",ticketNumber:$[_].ticketNumber,ticketedSeat:{"@type":"http://schema.org/Seat",seatingType:M.cabin}},reservationId:M.reservationId.trim(),reservationStatus:"http://schema.org/Reservation"+i};E.push(P)}return E}}).call();