// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,t,n){var r=Scanner.fromMessage(e);r.setLocale(t);var a,p,o,i,s,c,g,d,m,h,x,l,u,f,S,v,C,R,y,E;o=r.getSpan().innerCapture(n.reservationId,1),a=r.getSpan().innerCapture(n.guestName,1),E=r.getSpan().nextRegExp(n.pickUpDate).nextDate(),v=r.getSpan().nextRegExp(n.dropOffDate).nextDate(),h=r.getSpan().nextRegExp(n.brand).tagContents().innerCapture(n.brand,1).trim();var k=r.getSpan().next(n.price).nextAnyTag("td").tagContents();if(d=k.innerCapture(/([\d,.]+)/,1),m=(""+k.innerCapture(/([^\d,.]+)/,1).trim()).replace("\xc2",""),R=r.getSpan().innerCapture(n.pickUpAddress,1).trim(),f=r.getSpan().innerCapture(n.dropOffAddress,1).trim(),y=r.getSpan().nextRegExp(n.pickUpAddress).nextRegExp(n.phone).nextPhoneNumber(),S=r.getSpan().nextRegExp(n.dropOffAddress).nextRegExp(n.phone).nextPhoneNumber(),c=r.getSpan().nextRegExp(n.modifyUrl).nextLink(),g=c,n.cancellationHeader.test(e.subject)&&(i="Cancelled"),ASSERT(o,a,R,E)){var A={"@context":"http://schema.org","@type":"http://schema.org/RentalCarReservation",totalPrice:d,priceCurrency:m,reservationId:o,reservationStatus:"http://schema.org/Reservation"+(i||"Confirmed"),checkinUrl:s,modifyReservationUrl:c,cancelReservationUrl:g,underName:{"@type":"http://schema.org/Person",name:a,email:p},provider:{"@type":"http://schema.org/Organization",name:"Avis"},pickupTime:E,pickupLocation:{"@type":"http://schema.org/Place",name:C,telephone:y,address:R},dropoffTime:v,dropoffLocation:{"@type":"http://schema.org/Place",name:u,telephone:S,address:f}};return h&&(A.reservationFor={"@type":"http://schema.org/Car",brand:{"@type":"http://schema.org/Organization",name:h},license:x,color:l}),[A]}}}).call();