/* * # Fomantic UI - 2.8.8 * https://github.com/fomantic/Fomantic-UI * http://fomantic-ui.com/ * * Copyright 2021 Contributors * Released under the MIT license * http://opensource.org/licenses/MIT * */ !function(q,k,D,E){"use strict";q.isFunction=q.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},k=void 0!==k&&k.Math==Math?k:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),q.fn.search=function(u){var x,C=q(this),w=C.selector||"",S=(new Date).getTime(),T=[],F=u,j="string"==typeof F,A=[].slice.call(arguments,1);return q(this).each(function(){var f,l=q.isPlainObject(u)?q.extend(!0,{},q.fn.search.settings,u):q.extend({},q.fn.search.settings),g=l.className,d=l.metadata,n=l.regExp,i=l.fields,h=l.selector,p=l.error,e=l.namespace,r="."+e,t=e+"-module",m=q(this),v=m.find(h.prompt),s=m.find(h.searchButton),a=m.find(h.results),o=m.find(h.result),y=(m.find(h.category),this),c=m.data(t),b=!1,R=!1;f={initialize:function(){f.verbose("Initializing module"),f.get.settings(),f.determine.searchFields(),f.bind.events(),f.set.type(),f.create.results(),f.instantiate()},instantiate:function(){f.verbose("Storing instance of module",f),c=f,m.data(t,f)},destroy:function(){f.verbose("Destroying instance"),m.off(r).removeData(t)},refresh:function(){f.debug("Refreshing selector cache"),v=m.find(h.prompt),s=m.find(h.searchButton),m.find(h.category),a=m.find(h.results),o=m.find(h.result)},refreshResults:function(){a=m.find(h.results),o=m.find(h.result)},bind:{events:function(){f.verbose("Binding events to search"),l.automatic&&(m.on(f.get.inputEvent()+r,h.prompt,f.event.input),v.attr("autocomplete",f.is.chrome()?"fomantic-search":"off")),m.on("focus"+r,h.prompt,f.event.focus).on("blur"+r,h.prompt,f.event.blur).on("keydown"+r,h.prompt,f.handleKeyboard).on("click"+r,h.searchButton,f.query).on("mousedown"+r,h.results,f.event.result.mousedown).on("mouseup"+r,h.results,f.event.result.mouseup).on("click"+r,h.result,f.event.result.click)}},determine:{searchFields:function(){u&&u.searchFields!==E&&(l.searchFields=u.searchFields)}},event:{input:function(){l.searchDelay?(clearTimeout(f.timer),f.timer=setTimeout(function(){f.is.focused()&&f.query()},l.searchDelay)):f.query()},focus:function(){f.set.focus(),l.searchOnFocus&&f.has.minimumCharacters()&&f.query(function(){f.can.show()&&f.showResults()})},blur:function(e){function t(){f.cancel.query(),f.remove.focus(),f.timer=setTimeout(f.hideResults,l.hideDelay)}var s=D.activeElement===this;s||(R=!1,f.resultsClicked?(f.debug("Determining if user action caused search to close"),m.one("click.close"+r,h.results,function(e){f.is.inMessage(e)||b?v.focus():(b=!1,f.is.animating()||f.is.hidden()||t())})):(f.debug("Input blurred without user action, closing results"),t()))},result:{mousedown:function(){f.resultsClicked=!0},mouseup:function(){f.resultsClicked=!1},click:function(e){f.debug("Search result selected");var t=q(this),s=t.find(h.title).eq(0),n=t.is("a[href]")?t:t.find("a[href]").eq(0),r=n.attr("href")||!1,i=n.attr("target")||!1,a=0=l.minCharacters},results:function(){return 0!==a.length&&""!=a.html()}},clear:{cache:function(e){var t=m.data(d.cache);e?e&&t&&t[e]&&(f.debug("Removing value from cache",e),delete t[e],m.data(d.cache,t)):(f.debug("Clearing cache",e),m.removeData(d.cache))}},read:{cache:function(e){var t=m.data(d.cache);return!!l.cache&&(f.verbose("Checking cache for generated html for query",e),"object"==typeof t&&t[e]!==E&&t[e])}},create:{categoryResults:function(e){var s={};return q.each(e,function(e,t){t.category&&(s[t.category]===E?(f.verbose("Creating new category of results",t.category),s[t.category]={name:t.category,results:[t]}):s[t.category].results.push(t))}),s},id:function(e,t){var s,n=e+1;return t!==E?(s=String.fromCharCode(97+t)+n,f.verbose("Creating category result id",s)):(s=n,f.verbose("Creating result id",s)),s},results:function(){0===a.length&&(a=q("
").addClass(g.results).appendTo(m))}},inject:{result:function(e,t,s){f.verbose("Injecting result into results");var n=s!==E?a.children().eq(s).children(h.results).first().children(h.result).eq(t):a.children(h.result).eq(t);f.verbose("Injecting results metadata",n),n.data(d.result,e)},id:function(e){f.debug("Injecting unique ids into results");var s=0,n=0;return"category"===l.type?q.each(e,function(e,t){0 as a polyfill.'},metadata:{cache:"cache",results:"results",result:"result"},regExp:{escape:/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,beginsWith:"(?:s|^)"},fields:{categories:"results",categoryName:"name",categoryResults:"results",description:"description",image:"image",price:"price",results:"results",title:"title",url:"url",action:"action",actionText:"text",actionURL:"url"},selector:{prompt:".prompt",searchButton:".search.button",results:".results",message:".results > .message",category:".category",result:".result",title:".title, .name"},templates:{escape:function(e,t){if(t)return e;var s={"<":"<",">":">",'"':""","'":"'","`":"`"};return/[&<>"'`]/.test(e)?(e=e.replace(/&(?![a-z0-9#]{1,6};)/,"&")).replace(/[<>"'`]/g,function(e){return s[e]}):e},message:function(e,t,s){var n="";return e!==E&&t!==E&&(n+='
',s&&(n+='
'+s+"
"),n+='
'+e+"
",n+="
"),n},category:function(e,s,n){var r="",i=q.fn.search.settings.templates.escape;return e[s.categoryResults]!==E&&(q.each(e[s.categoryResults],function(e,t){t[s.results]!==E&&0',t[s.categoryName]!==E&&(r+='
'+i(t[s.categoryName],n)+"
"),r+='",r+="
")}),e[s.action]&&(!1===s.actionURL?r+='
'+i(e[s.action][s.actionText],n)+"
":r+=''+i(e[s.action][s.actionText],n)+""),r)},standard:function(e,s,n){var r="",i=q.fn.search.settings.templates.escape;return e[s.results]!==E&&(q.each(e[s.results],function(e,t){t[s.url]?r+='':r+='',t[s.image]!==E&&(r+='
'),r+='
',t[s.price]!==E&&(r+='
'+i(t[s.price],n)+"
"),t[s.title]!==E&&(r+='
'+i(t[s.title],n)+"
"),t[s.description]!==E&&(r+='
'+i(t[s.description],n)+"
"),r+="
",r+="
"}),e[s.action]&&(!1===s.actionURL?r+='
'+i(e[s.action][s.actionText],n)+"
":r+=''+i(e[s.action][s.actionText],n)+""),r)}}}}(jQuery,window,document);