// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(t,e,_){if(!t||!e||!_)return CONTINUE;var n=Scanner.fromMessage(t);n.setLocale(e);var r,a,p,g,i,o,x,S,s,c,m,h,u,d,E,T,l;return p=n.getSpan().innerCapture(regExpFormatted(/\1: (.*)/,_.total),1),a=p.innerCapture(regExpFormatted(/([\d\.,]+)/),1),i=n.getSpan().withInterval(p.getStart(),a.getStart()),c=n.getSpan().nextText(_.print).nextLink(),m=n.getSpan().innerCapture(regExpFormatted(/\1 ([\w\/-]+)\./,_.number),1),g=n.getSpan().nextText("_____________________________________________________________________________________________").nextText("\n"),""+n.getSpan().withInterval(g.getEnd(),g.nextText("\n").getStart()).trim()==""&&(g=g.nextText("\n")),/CONFIRMATION\s+ORDER/.test(t.subject)?(o=n.getSpan().innerDate(),x=(""+n.getSpan().innerCapture(regExpFormatted(/___*([\s\S]+)\1/,""+o),1)).trim(),S=n.getSpan().innerCapture(/\)ROW\s+(.*)\./,1)):(x=n.getSpan().withInterval(g.getEnd(),g.nextText("\n").getStart()).trim(),o=getFuzzyDate(g.withEnd(g.nextText(_.total).getStart())),h=n.getSpan().withInterval(x.nextText("\n").getEnd(),x.nextText("\n").nextText("\n").getStart()).trim(),S=n.getSpan().innerCapture(regExpFormatted(/\1: (.*)/,_.seat),1)),r=n.getSpan().innerCapture(regExpFormatted(/\1: (.*)/,_.orderFor),1),ASSERT(o,x)?[{"@context":"http://schema.org","@type":"http://schema.org/EventReservation",name:r,totalPrice:a,priceCurrency:i,reservedTicket:{"@type":"http://schema.org/Ticket",ticketedSeat:{"@type":"http://schema.org/Seat",seatNumber:S,seatRow:l,seatSection:s},ticketToken:c,ticketNumber:m},reservationFor:{"@type":"http://schema.org/Event",eventStatus:"http://schema.org/EventConfirmed",name:x,url:u,startDate:o,endDate:T,location:{"@type":"http://schema.org/Place",name:d,telephone:E,address:h}}}]:CONTINUE}}).call();