(function(){function e(t,n,r){var a="Confirmed",i=Scanner.fromMessage(t);i.setLocale(n);var s=i.getSpan();if(!s.next(r.idPrefix).nextTag("table6").allInnerTagsFiltered("td6").some(function(e){return r.secondIdentifier.test(e.getString())})&&!s.next(r.thirdIdentifier).exists())return null;var o,g,c,d,x,m,p,h=t.subject.match(r.reservationID);x=null==h?"":h[1],""==x&&(x=t.subject.match(r.altReservationID)[1]),o=s.next(r.namePrefix).nextAnyTag("td").nextAnyTag("td").tagContents().innerCapture(/(.*)/,1).trim();var l=s.next(r.hotelInfoPrefix).nextTag("table5");g=l.nextTag("td5").tagContents(),m=l.nextTag("td5").nextTag("td5").nextDate(),d=l.next(r.hotelAddressPrefix).nextTag("table8").nextTag("td8").nextTag("td8").nextTag("td8").tagContents().innerCapture(/<[\s\S]*?>([^<]+)<[\s\S]+?>/,1).replace(/\n/g,""),c=l.next(r.hotelAddressPrefix).nextPhoneNumber();var u=parseInt(m.innerCapture(/(\d{1,2})/,1).getString()),f=parseInt(m.innerCapture(/.*?-\s*(\d{1,2})/,1).getString());return p=modifyDate(m,f-u),g&&d&&m?[{"@context":"http://schema.org","@type":"http://schema.org/LodgingReservation",underName:{"@type":"http://schema.org/Person",name:o},checkinTime:m,checkoutTime:p,reservationStatus:"http://schema.org/Reservation"+a,reservationId:x,reservationFor:{"@type":"http://schema.org/LodgingBusiness",name:g,telephone:c,address:d}}]:0!=r.altHotelInfoPrefix?(r.hotelInfoPrefix=r.altHotelInfoPrefix,r.altHotelInfoPrefix=!1,e(t,n,r)):null}function t(e,t,n){var r="Confirmed";n.identifier.test(e.subject)&&(r="Cancelled");var a=Scanner.fromMessage(e);a.setLocale(t);var i,s,o,g,c,d,x=a.getSpan();g=x.next(n.reservationID).parentTag("td7").innerCapture(n.reservationID,1),i=x.next(n.cancelNamePrefix).nextAnyTag("td").nextAnyTag("td").tagContents().innerCapture(/(.*)/,1).trim();var m=x.next(n.cancelTitle).nextTag("table9"),p=x.next(n.cancelTitle).nextTag("table6"),h=m.split("\n");s=h[2],o=h[4],c=p.nextDate();var l=parseInt(c.innerCapture(/(\d{1,2})/,1).getString()),u=parseInt(c.innerCapture(/.*?-\s*(\d{1,2})/,1).getString());return d=modifyDate(c,u-l),ASSERT(s,o,c)?[{"@context":"http://schema.org","@type":"http://schema.org/LodgingReservation",underName:{"@type":"http://schema.org/Person",name:i},checkinTime:c,checkoutTime:d,reservationStatus:"http://schema.org/Reservation"+r,reservationId:g,reservationFor:{"@type":"http://schema.org/LodgingBusiness",name:s,address:o}}]:next(e,t,n)}return function(n,r,a){if(a.cancel.identifier.test(n.subject))return t(n,r,a.cancel);if(a.typeTwo.identifier.test(n.subject))try{return e(n,r,a.typeTwo)}catch(e){}a=a.typeOne;var i=Scanner.fromMessage(n);i.setLocale(r);var s,o,g,c,d,x,m=i.getSpan();c=n.subject.match(a.reservationID)[1],s=m.next(a.name).innerCapture(a.name,1).trim();var p=m.next(a.hotelName_prefix).nextAnyTag("table").nextAnyTag("table").nextAnyTag("table");o=p.nextTag("td9").tagContents(),g=p.nextAnyTag("td").nextAnyTag("td").tagContents(),d=m.next(a.datePrefix).nextAnyTag("td").nextDate();var h=parseInt(d.innerCapture(/(\d{1,2})/,1).getString()),l=parseInt(d.innerCapture(/.*?-\s*(\d{1,2})/,1).getString());return x=modifyDate(d,l-h),ASSERT(o,g,d)?[{"@context":"http://schema.org","@type":"http://schema.org/LodgingReservation",underName:{"@type":"http://schema.org/Person",name:s},checkinTime:d,checkoutTime:x,reservationStatus:"http://schema.org/ReservationConfirmed",reservationId:c,reservationFor:{"@type":"http://schema.org/LodgingBusiness",name:o,address:g}}]:void 0}}).call();