// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,t,n){var a=Scanner.fromMessage(e);a.setLocale(t);var r,i,g,o,s,p,c,x,u,m,l,d,C,h,S,T,E,R;if(!n.emailTitelConfirmation.test(e.subject)&&!n.emailTitelCancellation.test(e.subject))return CONTINUE;s=a.getSpan().nextRegExp(n.reservationId).tagContents().innerCapture(n.reservationId,1);var f=a.getSpan().nextRegExp(n.guestFirstName).nextAnyTag("td").tagContents(),v=a.getSpan().nextRegExp(n.guestLastName).nextAnyTag("td").tagContents();r=f+" "+v,x=a.getSpan().nextRegExp(n.checkInDate).nextDate(),l=a.getSpan().nextRegExp(n.checkOutDate).nextDate(),c=a.getSpan().nextRegExp(n.checkInTime).nextDate(),m=a.getSpan().nextRegExp(n.checkOutTime).nextDate(),u=getFuzzyDate(a.getDetachedSpan(x+" "+c).innerDate()),d=getFuzzyDate(a.getDetachedSpan(l+" "+m).innerDate());var y=a.getSpan().nextRegExp(n.price).nextAnyTag("td").tagContents();g=y.innerCapture(/([\d,.]+)/,1),o=y.innerCapture(/([^\d,.]+)/,1).trim();var D=a.getSpan().nextRegExp(n.hotelInfo).previousAnyTag("table").tagContents();if(h=D.innerCapture(regExpFormatted(/(.+)</),1),T=D.nextAnyTag("td").tagContents().innerCapture(/([\s\S]*)\n.+/,1),C=D.nextLink(),S=D.innerPhoneNumber(),E=R=a.getSpan().nextRegExp(n.modifyUrl).nextLink(),n.emailTitelConfirmation.test(e.subject)){if(!ASSERT(r,s,u,d,T))return CONTINUE;p="Confirmed"}if(n.emailTitelCancellation.test(e.subject)){if(!ASSERT(r,s,u,d,T))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:g,priceCurrency:o,checkinTime:u,checkoutTime:d,modifyReservationUrl:E,cancelReservationUrl:R,reservationStatus:"http://schema.org/Reservation"+(p||"Confirmed"),reservationId:s,reservationFor:{"@type":"http://schema.org/LodgingBusiness",name:h,url:C,telephone:S,address:T}}]}}).call();