new ReverseTemplateList([new ReverseTemplate("canadiannorth-flight-confirmation-en",function(e){return/^Canadian North Electronic Ticket Receipt/.test(e.subject)},function(e){if(/^Canadian North Electronic Ticket Receipt/.test(e.subject)){var t=Scanner.fromMessage(e);t.setLocale("en_CA");var r,a,n,i,s,o,p,l,c,g,u,d,m,h,T,C,v,x,f,b,k=t.getSpan(),y=[],A={};for(a=k.nextText("Booking reference/Record locator").nextTag("td4").tagContents().trim(),s=k.nextText("Your ticket(s) number(s) is/are:").parentTag("td3").tagContents().innerCapture(regExpFormatted(/\1([\w\s\W]+)/,"Your ticket(s) number(s) is/are:"),1).split(/\n/),s.shift(),f=0;f<s.length;f++)[,i,r]=s[f].innerCapture(/(.+):\s(\d+)\s<https/),A[""+i]={name:i.trim(),ticketNumber:r.trim(),seats:{}};for(l=k.withInterval(k.nextText("Booking reference/Record locator").getEnd(),k.nextText("Your ticket(s) number(s) is/are:").getStart()).allInnerTagsFiltered("table5"),f=0;f<l.length;f++){[,g,u,c]=l[f].innerCapture(/(.+)\sFlight Number\s([A-Z0-9]+)\s(\d+)\s/);var N=l[f].allInnerTagsFiltered("table6");[,h,m]=N[0].innerText("Departure:").nextTag("td6").tagContents().innerCapture(/(.+?)\s(.+)\n/),d=N[0].innerText("Departure:").nextTag("td6").tagContents().innerDate(),[,v,C]=N[0].innerText("Arrival:").nextTag("td6").tagContents().innerCapture(/(.+?)\s(.+)\n/),T=N[0].innerText("Arrival:").nextTag("td6").tagContents().innerDate(),p=N[2].split("/td6"),o="";for(b=0;b<p.length;b++){var S=p[b];i=S.innerText("Seat(s):").previousTag("td7").tagContents(),/Check-In Required/.test(S)||([,o]=S.innerText("Seat(s):").nextTag("td7").tagContents().innerCapture(/(.+)\s\//));for(var F=Object.keys(A),R=0;R<F.length;R++){if(0===(""+A[F[R]].name).localeCompare(""+i)){A[F[R]].seats[""+d]=o;break}}}ASSERT(c,d,T)&&y.push({airlineCode:u,flightNumber:c,departureTime:d,departureCode:h,departureAirport:m.trim(),arrivalTime:T,arrivalCode:v,arrivalAirport:C.trim(),passengers:A})}var z=[];for(f=0;f<y.length;f++){var E=y[f],I=Object.keys(E.passengers);for(b=0;b<I.length;b++){x=E.passengers[I[b]];z.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.departureCode,departureTime:E.departureTime,arrivalAirportFuzzy:E.arrivalAirport,arrivalAirportCode:E.arrivalCode,arrivalTime:E.arrivalTime},underName:{"@type":"http://schema.org/Person",name:x.name},checkinUrl:n,reservationId:a,reservationStatus:"http://schema.org/ReservationConfirmed",totalPrice:x.totalPrice,priceCurrency:x.priceCurrency,reservedTicket:{"@type":"http://schema.org/Ticket",ticketNumber:x.ticketNumber,ticketedSeat:{"@type":"http://schema.org/Seat",seatNumber:x.seats[""+E.departureTime],seatingType:""}}})}}if(z.length)return z}},"0/1/2/3/4/5/6/152/624/625","SGb337ee47")]);