// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,t,r,n){if(!(e&&t&&r&&n))return CONTINUE;var a=Scanner.fromMessage(e);a.setLocale(t);var i,s,o,x,p,g,d,m,u,S;return i=a.getSpan().innerCapture(regExpFormatted(/\1.\s+?(\d+)\s+?\2\n/,r.partySizePrefix,r.partySizeSuffix),1),s=a.getSpan().innerCapture(regExpFormatted(/\1.\s+?(\d+)\s+?\n/,r.reservationIdPrefix),1),o=a.getSpan().innerCapture(regExpFormatted(/\1.\s+?(.*)\n/,r.restaurantNamePrefix),1),x=a.getSpan().nextText(r.restaurantUrlPrefix).nextLink(),p=a.getSpan().nextText(r.restaurantPhonePrefix).nextPhoneNumber(),g=(""+a.getSpan().nextText(r.restaurantAddressPrefix).nextAddress()).trim().replace(/\n/g," "),g===a.getNullSpan()&&(g=(""+a.getSpan().nextText(r.restaurantAddressPrefix).nextText(" ").withEnd(p.previousText("\n").getStart())).trim().replace(/\n/g," ")),d=(""+a.getSpan().nextText(r.reservationStartTimePrefix).nextText(" ").withEnd(i.previousText("\n").getStart())).trim().replace(/\(.*\)\s/g,""),d=getFuzzyDate(a.getDetachedSpan(d)),m=a.getSpan().innerCapture(regExpFormatted(/\"?(.*)\1/,r.underPersonNameSuffix),1),S=a.getSpan().nextText(r.reservationModifyOrCancelUrlPrefix).nextLink(),S===a.getNullSpan()?(S=a.getSpan().nextText(r.reservationModifyUrlPrefix).nextLink(),u=a.getSpan().nextText(r.reservationCancelUrlPrefix).nextLink()):u=S,ASSERT(i,o,d,m)?[{"@context":"http://schema.org","@type":"http://schema.org/FoodEstablishmentReservation",partySize:i,reservationId:s,reservationStatus:"http://schema.org/ReservationConfirmed",reservationFor:{"@type":"http://schema.org/FoodEstablishment",name:o,url:x,telephone:p,address:g},startTime:d,bookingAgent:{"@type":"http://schema.org/Organization",name:"OpenTable",url:"http://www."+n+"/"},underName:{"@type":"http://schema.org/Person",name:m},modifyReservationUrl:u,cancelReservationUrl:S}]:CONTINUE}}).call();