// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,t,n){var a=Scanner.fromMessage(e),r=a.getSpan();a.setLocale(t);var i,g,o,s,x,c,d,T,h,p,u,m,l,C,f,S;x=r.nextText(n.reservationIdPrefix).nextTag("td4").tagContents(),i=a.getSpan().nextText(n.guestNamePrefix).nextTag("td4").tagContents(),d=r.nextText(n.checkInDateTimePrefix).nextTag("td4").tagContents();var v=/until/;p=r.nextText(n.checkOutDateTimePrefix).nextTag("td4").tagContents(),v.test(p)?(p=p.innerCapture(/($<checkOutDate>.+) until ($<checkOutTime>.+)/),h=p.$checkOutDate,T=p.$checkOutTime,p=getFuzzyDate(a.getDetachedSpan(h+" "+T))):p=getFuzzyDate(a.getDetachedSpan(""+p)),d=getFuzzyDate(a.getDetachedSpan(""+d));var P=a.getSpan().nextText(n.pricePrefix).nextTag("td4").tagContents();return o=P.innerCapture(/([\d,.]+)/,1),s=P.innerCapture(/([^\d,.]+)/,1).trim(),C=a.getSpan().nextText(n.hotelAddressPrefix).nextTag("td5").tagContents(),l=a.getSpan().nextText(n.hotelPhonePrefix).nextTag("td5").tagContents(),m=a.getSpan().nextText(n.hotelAddressPrefix).parentTag("table3").nextTag("td3").tagContents().innerCapture(/(.+)</,1).trim(),u=a.getSpan().nextText(n.hotelAddressPrefix).parentTag("table3").nextTag("td3").tagContents().innerLink(),ASSERT(i,x,d,p,C)?(c="Confirmed",[{"@context":"http://schema.org","@type":"http://schema.org/LodgingReservation",underName:{"@type":"http://schema.org/Person",name:i,email:g},totalPrice:o,priceCurrency:s,checkinTime:d,checkoutTime:p,modifyReservationUrl:f,cancelReservationUrl:S,reservationStatus:"http://schema.org/Reservation"+(c||"Confirmed"),reservationId:x,reservationFor:{"@type":"http://schema.org/LodgingBusiness",name:m,url:u,telephone:l,address:C}}]):CONTINUE}}).call();