(function(){return function(e,t,r){function a(e){return!/\d{1,2}:\d{1,2}\s+-\s+\d{1,2}:\d{1,2}/i.test(e)}function i(e){for(var t=F,i=t.next(r.flightPrefix).nextDate();i.exists()&&a(i.getString())&&!(i.getStart()>e.getStart());)t=i,i=i.next(r.flightPrefix).nextDate();return t}var n=Scanner.fromMessage(e);n.setLocale(t);var p=n.getSpan().getString().match(/\w+\s\(\w+\)/g),o={};p&&p.forEach(function(e){var t=e.split("(");t[1]=t[1].replace(/\)/g,""),o[t[0].trim()]=t[1]});var s,g,u,l,d,m,c,h,x=[],C=[],v=[];g=n.getSpan().innerCapture(regExpFormatted(/\1\s*: (.*)/,r.reference),1).trim(),m=n.getSpan().nextText(r.number).parentTag("td1").tagContents().innerCapture(regExpFormatted(/\1(.*)/,r.number),1).trim(),(u=n.getSpan().nextText(r.total).nextAnyTag("td").tagContents().innerCapture(regExpFormatted(/($<totalPrice>[\d\.,]+)\s+($<priceCurrency>\w{3})/)))&&(l=u.$totalPrice,d=u.$priceCurrency);for(var f=m.split(","),y=n.getSpan().nextText(r.passenger).next(regExpFormatted(/\[td1\]\s*([\w\xe9\xe0\' ]+)\s+\1/i,r.adult)),z=0;y.exists();){C.push({name:y.innerCapture(regExpFormatted(/\]\s*(.*?)\s+\1/i,r.adult),1).trim(),ticketNumber:f[z].trim()}),z<f.length-1&&z++,y=y.next(regExpFormatted(/\[td1\]\s*([\w\xe9\xe0\' ]+)\s+\1/i,r.adult))}s=n.getSpan().firstTag("table1").allInnerTagsFiltered("tr1");for(var F=n.getSpan().next(r.flightPrefix).nextDate(),S=4;S<s.length;S+=4){h={};var T,A,b=s[S];if(A=b.innerDate(),A.exists()&&/^\d+/.test(b)){A=A.split("-"),c=s[S+1].withEnd(s[S+1].nextClosingTag("td1").getStart()).innerCapture(/($<airlineCode>\D+)($<flightNumber>\d+)/),h.flightNumber=c.$flightNumber,h.airlineCode=c.$airlineCode,T=i(A[0],b),h.departureTime=getFuzzyDate(n.getDetachedSpan(T+" "+A[0])),h.arrivalTime=getFuzzyDate(n.getDetachedSpan(T+" "+A[1]));var N=s[S+1].next(r.seat).parentAnyTag("td").innerCapture(regExpFormatted(/\1\s:?(.*?)\|/i,r.seat),1);h.seats=N.exists()?N.split(","):Array(10).fill(""),h.bookingClass=s[S+1].next(r.bookingClass).parentAnyTag("td").innerCapture(regExpFormatted(/\1\s*:?(.*?)\|/i,r.bookingClass),1).trim(),h.departureAirportFuzzy=b.innerCapture(/\[td1\](.*)\-/,1).trim(),h.arrivalAirportFuzzy=b.innerCapture(/\[td1\].*\-(.*)/,1).trim();var E=h.departureAirportFuzzy.getString().split(",")[0],k=h.arrivalAirportFuzzy.getString().split(",")[0];h.departureAirportCode=E in o?o[E]:"",h.arrivalAirportCode=k in o?o[k]:"",h.airlineName=s[S+1].innerCapture(regExpFormatted(/\1\s*:(.*)\|/,r.operate),1).trim(),ASSERT(h.flightNumber,h.departureTime,h.arrivalTime,h.departureAirportFuzzy,h.arrivalAirportFuzzy)&&x.push(h)}}for(var D=0;D<x.length;D++){h=x[D];for(var $=0;$<C.length;$++){var P=C[$];v.push({"@context":"http://schema.org","@type":"http://schema.org/FlightReservation",reservationFor:{"@type":"http://apple.com/FuzzyFlight",airlineName:h.airlineName,airlineCode:h.airlineCode,flightNumber:h.flightNumber,departureAirportFuzzy:h.departureAirportFuzzy,departureAirportCode:h.departureAirportCode,departureTime:h.departureTime,arrivalAirportFuzzy:h.arrivalAirportFuzzy,arrivalAirportCode:h.arrivalAirportCode,arrivalTime:h.arrivalTime},underName:{"@type":"http://schema.org/Person",name:P.name},checkinUrl:"",reservationId:g,reservationStatus:"http://schema.org/ReservationConfirmed",totalPrice:l,priceCurrency:d,reservedTicket:{"@type":"http://schema.org/Ticket",ticketNumber:P.ticketNumber,ticketedSeat:{"@type":"http://schema.org/Seat",seatNumber:h.seats[$].trim(),seatingType:h.bookingClass}}})}}if(v.length)return v}}).call();