!function(){var e=this,t={};"undefined"!=typeof exports?module.exports=t:e.fuzzy=t,t.simpleFilter=function(e,r){return r.filter(function(r){return t.test(e,r)})},t.test=function(e,r){return null!==t.match(e,r)},t.match=function(e,t,r){r=r||{};var n,o=0,i=[],u=t.length,c=0,s=0,l=r.pre||"",a=r.post||"",f=r.caseSensitive&&t||t.toLowerCase();e=r.caseSensitive&&e||e.toLowerCase();for(var d=0;d<u;d++)n=t[d],f[d]===e[o]?(n=l+n+a,o+=1,s+=1+s):s=0,c+=s,i[i.length]=n;return o===e.length?(c=f===e?1/0:c,{rendered:i.join(""),score:c}):null},t.filter=function(e,r,n){return r&&0!==r.length?"string"!=typeof e?r:(n=n||{},r.reduce(function(r,o,i,u){var c=o;n.extract&&(c=n.extract(o));var s=t.match(e,c,n);return null!=s&&(r[r.length]={string:s.rendered,score:s.score,index:i,original:o}),r},[]).sort(function(e,t){var r=t.score-e.score;return r?r:e.index-t.index})):[]}}();