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