// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,t,r){var a=Scanner.fromMessage(e);a.setLocale(t);var n,o,i,p,c,s,m,h,l,u,d,g,f,v,C,y,R,T,x,k,S,U=a.getSpan(),N="Rentalcars.com";if(!U.nextRegExp(r.pickupTime).exists())return CONTINUE;if(i=e.subject.match(r.reservationId)[1],n=U.innerCapture(r.guestName,1),u=U.innerCapture(r.brand,1),r.price&&(S=U.innerCapture(r.price,1),h=S.innerCapture(/([\d,.]+)/,1),l=S.innerCapture(/([^\d,.]+)/,1)),s=m=U.next(r.modifyUrl).nextLink(),r.supplier&&(R=f=U.innerCapture(r.supplier,1)),k=U.next(r.pickupTime).nextDate(),y=U.next(r.dropoffTime).nextDate(),T=U.innerCapture(r.pickupAddress,2),v=U.innerCapture(r.dropoffAddress,2),r.cancellationSubject&&r.cancellationSubject.test(e.subject)){if(p="Cancelled",!ASSERT(i,n))return CONTINUE}else if(p="Confirmed",!ASSERT(n,k,y,T,v))return CONTINUE;return 0===(""+u).length?[{"@context":"http://schema.org","@type":"http://schema.org/RentalCarReservation",totalPrice:h,priceCurrency:l,reservationId:i,reservationStatus:"http://schema.org/Reservation"+p,checkinUrl:c,modifyReservationUrl:s,cancelReservationUrl:m,underName:{"@type":"http://schema.org/Person",name:n,email:o},provider:{"@type":"http://schema.org/Organization",name:N},pickupTime:k,pickupLocation:{"@type":"http://schema.org/Place",name:R,telephone:x,address:T},dropoffTime:y,dropoffLocation:{"@type":"http://schema.org/Place",name:f,telephone:C,address:v}}]:[{"@context":"http://schema.org","@type":"http://schema.org/RentalCarReservation",totalPrice:h,priceCurrency:l,reservationId:i,reservationStatus:"http://schema.org/Reservation"+p,checkinUrl:c,modifyReservationUrl:s,cancelReservationUrl:m,underName:{"@type":"http://schema.org/Person",name:n,email:o},provider:{"@type":"http://schema.org/Organization",name:N},reservationFor:{"@type":"http://schema.org/Car",brand:{"@type":"http://schema.org/Organization",name:u},license:d,color:g},pickupTime:k,pickupLocation:{"@type":"http://schema.org/Place",name:R,telephone:x,address:T},dropoffTime:y,dropoffLocation:{"@type":"http://schema.org/Place",name:f,telephone:C,address:v}}]}}).call();