// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,t,r){var n=Scanner.fromMessage(e);n.setLocale(t);var a,i,o,p,m,s,c,g,u,d,h,x,f;if(r.reservationCancelled.test(e.subject))f="Cancelled";else{if(!r.confirmation.test(e.subject))return CONTINUE;f="Confirmed"}a=n.getSpan().innerCapture(regExpFormatted(/\1.(.*)\2/,r.underPersonNamePrefix,r.underPersonNameSuffix),1).trim(),o=n.getSpan().innerCapture(regExpFormatted(/\1(?::|\uff1a)(.*)/,r.hotelNamePrefix),1).trim(),p=n.getSpan().innerCapture(regExpFormatted(/\1\s*.\s*([\d|\-|\+]+)/,r.hotelPhonePrefix),1).trim(),s=n.getSpan().innerCapture(r.hotelAddressRegExp,1).trim(),c=n.getSpan().innerCapture(regExpFormatted(/\1.(.*)/,r.reservationIdPrefix),1).trim();var C=n.getSpan().innerCapture(r.priceRegExp,1).trim();g=n.getSpan().nextText(r.checkInDateTimePrefix).nextDate();var l=n.getSpan().innerCapture(regExpFormatted(/\1.(.*)\2/,r.stayLengthPrefix,r.stayLengthSuffix),1).trim();return d=n.getSpan().innerCapture(regExpFormatted(/\1\s*(.*)/,r.checkOutTime),1),l&&(u=modifyDate(g,int(""+l)),d&&(u=combineDateAndTime(u,d))),h=C.innerCapture(/([\d,.]+)/,1),x=C.innerCapture(/([^\d,.]+)/,1).trim(),ASSERT(a,o,g)?[{"@context":"http://schema.org","@type":"http://schema.org/LodgingReservation",underName:{"@type":"http://schema.org/Person",name:a,email:i},totalPrice:h,priceCurrency:x,checkinTime:g,checkoutTime:u,reservationStatus:"http://schema.org/Reservation"+f,reservationId:c,reservationFor:{"@type":"http://schema.org/LodgingBusiness",name:o,telephone:p,url:m,address:s}}]:CONTINUE}}).call();