// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,r,t){if(!t.emailSubject.test(e.subject))return CONTINUE;var n=Scanner.fromMessage(e);n.setLocale(r);var a,p,s,i,d,o,f,g,x,c,m,S,u,h,A,C,P,l,v;return a=t.reservationStatus,v=t.provider,p=n.getSpan().innerCapture(t.reservationId,1),s=n.getSpan().innerCapture(t.underPersonName,1).trim(),f=n.getSpan().innerCapture(t.carBrand,1).trim(),t.changeReservationUrlPrefix&&(P=l=n.getSpan().nextRegExp(t.changeReservationUrlPrefix).nextLink()),d=n.getSpan().nextRegExp(t.pickUpDateTimePrefix).nextDate(),o=n.getSpan().nextRegExp(t.dropOffDateTimePrefix).nextDate(),A=t.pickUpAddressPrefix&&t.pickUpAddressSuffix?n.getSpan().innerCapture(regExpFormatted(/\1[\n\s]+(.+)\n+([\s\S]+)[\n\s]+\2/,t.pickUpAddressPrefix,t.pickUpAddressSuffix)):t.pickUpAddressPrefix?n.getSpan().nextText(t.pickUpAddressPrefix).parentAnyTag("td").tagContents().innerCapture(regExpFormatted(/\1[\n\s]+(.+)\n+([\s\S]+)/,t.pickUpAddressPrefix)):d.parentAnyTag("td").tagContents().innerCapture(regExpFormatted(/\1[\n\s]+(.+)\n+([\s\S]+)/,""+d)),A&&3===A.length&&([,m,S]=A),C=t.dropOffAddressPrefix&&t.dropOffAddressSuffix?n.getSpan().innerCapture(regExpFormatted(/\1[\n\s]+(.+)\n+([\s\S]+)[\n\s]+\2/,t.dropOffAddressPrefix,t.dropOffAddressSuffix)):t.dropOffAddressPrefix?n.getSpan().nextText(t.dropOffAddressPrefix).parentAnyTag("td").tagContents().innerCapture(regExpFormatted(/\1[\n\s]+(.+)\n+([\s\S]+)/,t.dropOffAddressPrefix)):o.parentAnyTag("td").tagContents().innerCapture(regExpFormatted(/\1[\n\s]+(.+)\n+([\s\S]+)/,""+o)),C&&3===C.length&&([,u,h]=C),c=n.getSpan().nextRegExp(t.totalPricePrefix).nextAnyTag("td").tagContents().innerCapture(/([^0-9\.\,\s]+)\s*([0-9\.\,]+)/),c&&3===c.length&&([,x,g]=c),"Confirmed"===a&&ASSERT(p,S,d)||"Cancelled"===a&&ASSERT(p)?[{"@context":"http://schema.org","@type":"http://schema.org/RentalCarReservation",totalPrice:g,priceCurrency:x,reservationStatus:"http://schema.org/Reservation"+a,reservationId:p,modifyReservationUrl:P,cancelReservationUrl:l,underName:{"@type":"http://schema.org/Person",name:s,email:i},provider:{"@type":"http://schema.org/Organization",name:v},reservationFor:{"@type":"http://schema.org/Car",brand:{"@type":"http://schema.org/Organization",name:f}},pickupTime:d,pickupLocation:{"@type":"http://schema.org/Place",name:m,address:S},dropoffTime:o,dropoffLocation:{"@type":"http://schema.org/Place",name:u,address:h}}]:void 0}}).call();