// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(t,e,n){var r,a=e.getNullSpan();if(r=n.filter(function(t){return isDateDuration(t)&&!hasTime(t)}),1===r.length)return e.getDetachedSpan(e.getDateDD(r[0]).iso8601).innerDate();if(r=[],void 0!==t.date){for(var i,o,s=0;s<t.date.length;s++)for(i=e.getSpan().next(t.date[s]);i.exists();){if(o=i.nextDate(),o.exists()&&/[\d\uff10-\uff19]{1,2}/.test(""+o)&&!/^[\d\uff10-\uff19]{1,2}:[\d\uff10-\uff19]{2}/.test(""+o)){var c=o.getStart()-i.getEnd();c<144&&r.push({match:o,score:c})}i=i.next(t.date[s])}r.length>0?(r.sort(function(t,e){return t.score>e.score?1:t.score<e.score?-1:0}),a=r[0].match):(r=n.filter(function(t){return isDateDuration(t)}),r.length&&(a=e.getDetachedSpan(e.getDateDD(r[0]).iso8601).innerDate()))}return a}}).call();