// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,t,n){var a=Scanner.fromMessage(e);a.setLocale(t);var r,o,p,c,i,s,g,d,m,h,l,y,u,x,T,C,v,f,A,R;p=a.getSpan().nextRegExp(n.reservationId).tagContents().innerCapture(n.reservationId,1),r=a.getSpan().nextRegExp(n.guestName).tagContents().innerCapture(n.guestName,1),h=a.getSpan().nextRegExp(n.car).tagContents().innerCapture(n.car,1);var S=a.getSpan().nextText(n.pickup);R=getFuzzyDate(S.nextAnyTag("td")),f=S.nextAnyTag("td").nextAnyTag("td").tagContents(),A=S.nextAnyTag("td").nextAnyTag("td").nextAnyTag("td").nextAnyTag("td").tagContents();var N=a.getSpan().nextText(n.dropoff);C=getFuzzyDate(N.nextAnyTag("td")),x=N.nextAnyTag("td").nextAnyTag("td").tagContents(),T=N.nextAnyTag("td").nextAnyTag("td").nextAnyTag("td").nextAnyTag("td").tagContents();var P=a.getSpan().nextText(n.price).nextAnyTag("td").tagContents();if(d=P.innerCapture(/([\d,.]+)/,1),m=P.innerCapture(/([^\d,.]+)/,1),n.confirmSubject.test(e.subject)&&!ASSERT(r,p,R,C,f,x))return CONTINUE;if(n.cancellationSubject.test(e.subject)){if(!ASSERT(r,p,R,C,f,x))return CONTINUE;c="Cancelled"}return 0===(""+h).length?[{"@context":"http://schema.org","@type":"http://schema.org/RentalCarReservation",totalPrice:d,priceCurrency:m,reservationId:p,reservationStatus:"http://schema.org/Reservation"+(c||"Confirmed"),checkinUrl:i,modifyReservationUrl:s,cancelReservationUrl:g,underName:{"@type":"http://schema.org/Person",name:r,email:o},provider:{"@type":"http://schema.org/Organization",name:"Apollocamper"},pickupTime:R,pickupLocation:{"@type":"http://schema.org/Place",name:v,telephone:A,address:f},dropoffTime:C,dropoffLocation:{"@type":"http://schema.org/Place",name:u,telephone:T,address:x}}]:[{"@context":"http://schema.org","@type":"http://schema.org/RentalCarReservation",totalPrice:d,priceCurrency:m,reservationId:p,reservationStatus:"http://schema.org/Reservation"+(c||"Confirmed"),checkinUrl:i,modifyReservationUrl:s,cancelReservationUrl:g,underName:{"@type":"http://schema.org/Person",name:r,email:o},provider:{"@type":"http://schema.org/Organization",name:"Apollocamper"},reservationFor:{"@type":"http://schema.org/Car",brand:{"@type":"http://schema.org/Organization",name:h},license:l,color:y},pickupTime:R,pickupLocation:{"@type":"http://schema.org/Place",name:v,telephone:A,address:f},dropoffTime:C,dropoffLocation:{"@type":"http://schema.org/Place",name:u,telephone:T,address:x}}]}}).call();