// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,r,t){var a=Scanner.fromMessage(e);a.setLocale(r);var i,p,n,o,u,s,m,l=a.getSpan(),d=[],c=[],g=[],h=1,v="Confirmed",z="All Nippon Airways";n=l.innerCapture(regExpFormatted(/\1.*\n\s(.*)\n/,t.reservationId_prefix),1),i=l.innerCapture(regExpFormatted(/\1\s+([\s\S]*?)\s{2}\u25a0/,t.name_prefix),1),c=i.split(/\n/);for(var y=l.innerCapture(regExpFormatted(/\1(.*)\n(.*)\n(.*)\n(.*)\n/,"["+h+"]"));y;){var F,f,p={};F=f=getFuzzyDate(a.getDetachedSpan(""+y[1]).firstDate()),p.flightNumber=/[N|L][H|X](.*)/.exec(y[1])[1],p.airlineCode=y[1].innerCapture(/(\D{2})\d{2,}/,1);var D=/\s(.*)\s-\s(.*)/.exec(y[2]);p.departureAirportFuzzy=D[1],p.arrivalAirportFuzzy=D[2];var A=/\s(.*)\u767a(.*)\u7740/.exec(y[3]),C=A[1],T=A[2];p.departureDateTime=getFuzzyDate(a.getDetachedSpan(""+F+(""+C)).firstDate()),p.arrivalDateTime=getFuzzyDate(a.getDetachedSpan(""+f+(""+T)).firstDate()),m=/\s(.*)\//.exec(y[4]),m&&(p.seatingType=m[1]),ASSERT(p.flightNumber,p.departureDateTime,p.arrivalDateTime,p.departureAirportFuzzy,p.arrivalAirportFuzzy)&&d.push(p),h++,y=l.innerCapture(regExpFormatted(/\1(.*)\n(.*)\n(.*)\n(.*)\n/,"["+h+"]"))}for(var N=0;N<c.length;N++)for(var x=0;x<d.length;x++){var S=d[x],b={"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",airlineName:z,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:c[N].trim()},checkinUrl:s,reservationId:n,reservationStatus:"http://schema.org/Reservation"+v,totalPrice:o,priceCurrency:u,reservedTicket:{"@type":"http://schema.org/Ticket",ticketNumber:S.ticketNumber,ticketedSeat:{"@type":"http://schema.org/Seat",seatNumber:S.seatNumber,seatingType:S.seatingType}}};g.push(b)}if(g.length)return g}}).call();