// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,t,n){function a(e){return e=e.replace(/[^\d\sa-zA-z:\u6642]+/g," ").replace(/\s+/g," ").replace(/^(\d+)\s(\d+)\s/,"$1/$2/"),e=getFuzzyDate(r.getDetachedSpan(e))}var r=Scanner.fromMessage(e);r.setLocale(t);var p,o,c,s,i,g,d,u,l,C,f,h,m,x,S,R,v,E,k,y,T="Nissan";if(n.confirmSubject.test(e.subject)){p=r.getSpan().tagContents().innerCapture(/(.+)/,1),c=r.getSpan().nextRegExp(n.reservationId).tagContents().innerCapture(n.reservationId,1);var A=""+r.getSpan().nextRegExp(n.pickupStore).tagContents().innerCapture(n.pickupStore,1),N=""+r.getSpan().nextRegExp(n.pickupAddress).tagContents().innerCapture(n.pickupAddress,1);E=A+"\n"+N,k=""+r.getSpan().nextRegExp(n.pickupTelephone).tagContents().innerCapture(n.pickupTelephone,1);var A=""+r.getSpan().nextRegExp(n.dropoffStore).tagContents().innerCapture(n.dropoffStore,1),N=""+r.getSpan().nextRegExp(n.dropoffAddress).nextRegExp(n.dropoffAddress).tagContents().innerCapture(n.dropoffAddress,1);x=A+"\n"+N,S=""+r.getSpan().nextRegExp(n.dropoffTelephone).nextRegExp(n.dropoffTelephone).tagContents().innerCapture(n.dropoffTelephone,1),y=""+r.getSpan().nextRegExp(n.pickupDate).tagContents().innerCapture(n.pickupDate,1),y=a(y),R=""+r.getSpan().nextRegExp(n.dropoffDate).tagContents().innerCapture(n.dropoffDate,1),R=a(R),C=r.getSpan().nextRegExp(n.car).tagContents().innerCapture(n.car,1);var I=r.getSpan().nextRegExp(n.price).tagContents().innerCapture(n.price,1);if(u=I.innerCapture(/([\d,.]+)/,1),l=I.innerCapture(/([^\d,.]+)/,1).trim(),!ASSERT(p,c,y,R,E,x))return CONTINUE}if(n.cancellationSubject.test(e.subject)){if(p=r.getSpan().nextRegExp(n.cancelGuestName).tagContents().innerCapture(n.cancelGuestName,1),c=r.getSpan().nextRegExp(n.reservationId).tagContents().innerCapture(n.reservationId,1),y=""+r.getSpan().nextRegExp(n.cancelpickupdate).tagContents().innerCapture(n.cancelpickupdate,1),y=a(y),R=""+r.getSpan().nextRegExp(n.canceldropoffdate).tagContents().innerCapture(n.canceldropoffdate,1),R=a(R),E=""+r.getSpan().nextRegExp(n.cancelpickupAddress).tagContents().innerCapture(n.cancelpickupAddress,1),x=""+r.getSpan().nextRegExp(n.canceldropoffAddress).tagContents().innerCapture(n.canceldropoffAddress,1),C=r.getSpan().nextRegExp(n.cancelCar).tagContents().innerCapture(n.cancelCar,1),!ASSERT(p,c,y,R,E,x))return CONTINUE;s="Cancelled"}return 0===(""+C).length||null===C?[{"@context":"http://schema.org","@type":"http://schema.org/RentalCarReservation",totalPrice:u,priceCurrency:l,reservationId:c,reservationStatus:"http://schema.org/Reservation"+(s||"Confirmed"),checkinUrl:i,modifyReservationUrl:g,cancelReservationUrl:d,underName:{"@type":"http://schema.org/Person",name:p,email:o},provider:{"@type":"http://schema.org/Organization",name:T},pickupTime:y,pickupLocation:{"@type":"http://schema.org/Place",name:v,telephone:k,address:E},dropoffTime:R,dropoffLocation:{"@type":"http://schema.org/Place",name:m,telephone:S,address:x}}]:[{"@context":"http://schema.org","@type":"http://schema.org/RentalCarReservation",totalPrice:u,priceCurrency:l,reservationId:c,reservationStatus:"http://schema.org/Reservation"+(s||"Confirmed"),checkinUrl:i,modifyReservationUrl:g,cancelReservationUrl:d,underName:{"@type":"http://schema.org/Person",name:p,email:o},provider:{"@type":"http://schema.org/Organization",name:T},reservationFor:{"@type":"http://schema.org/Car",brand:{"@type":"http://schema.org/Organization",name:C},license:f,color:h},pickupTime:y,pickupLocation:{"@type":"http://schema.org/Place",name:v,telephone:k,address:E},dropoffTime:R,dropoffLocation:{"@type":"http://schema.org/Place",name:m,telephone:S,address:x}}]}}).call();