// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,t,n){var r=Scanner.fromMessage(e);r.setLocale(t);var a,i,o,p,s,c,g,m,u,h,l,d,C,f;if(!n.emailTitelConfirmation.test(e.subject))return CONTINUE;s=r.getSpan().innerCapture(n.reservationId,1),a=r.getSpan().innerCapture(n.guestName,1),g=r.getSpan().nextRegExp(n.checkInDate).nextDate(),m=r.getSpan().nextRegExp(n.checkOutDate).nextDate();var x=r.getSpan().nextRegExp(n.price).nextRegExp(n.price).innerCapture(n.price,1);if(o=x.innerCapture(/([\d,.]+)/,1),p=x.innerCapture(/([^\d,.]+)/,1).trim(),h=r.getSpan().innerCapture(regExpFormatted(/\1.+\n.*\n(.+)/,n.hotelInfo),1),l=r.getSpan().innerPhoneNumber(),d=r.getSpan().innerCapture(regExpFormatted(/\1.+\n.*\n.+\n([\s\S]*)\2/,n.hotelInfo,n.hotelAddress),1),n.emailTitelConfirmation.test(e.subject)){if(!ASSERT(a,s,g,m,d))return CONTINUE;c="Confirmed"}return[{"@context":"http://schema.org","@type":"http://schema.org/LodgingReservation",underName:{"@type":"http://schema.org/Person",name:a,email:i},totalPrice:o,priceCurrency:p,checkinTime:g,checkoutTime:m,modifyReservationUrl:C,cancelReservationUrl:f,reservationStatus:"http://schema.org/Reservation"+(c||"Confirmed"),reservationId:s,reservationFor:{"@type":"http://schema.org/LodgingBusiness",name:h,url:u,telephone:l,address:d}}]}}).call();