Vue.component("service-knowledge",{props:{searchQuery:String,defaultKeywords:String,itemLimit:{type:Number,"default":5},showPaging:{type:Boolean,"default":!1},activity:String,featured:{type:Boolean,"default":!1},products:Array,orderBy:String,noResultsMessage:{type:String,"default":"Sorry, we couldn't find any knowledge base matches."}},computed:{articles:function(){return this.$store.state.results.search},totalResults:function(){return this.$store.state.results.totalCount},skipResults:function(){return this.$store.state.query.skip},loading:function(){return this.$store.state.loading}},methods:{changePage:function(n){this.$store.dispatch("skipResults",n)}},created:function(){var n=this;this.$store.dispatch("init",{context:{url:"/api/support/knowledge/search"},query:{userKeywords:this.searchQuery,defaultKeywords:this.defaultKeywords,itemLimit:this.itemLimit,orderBy:[this.orderBy],otherSearchOptions:{activity:this.activity,featured:this.featured,products:this.products}}}).then(function(){n.$emit("has-results",n.$store.state.results.totalCount>0)})},template:'\n<div>\n\t<p v-if="!loading && totalResults === 0">{{ noResultsMessage }}<\/p>\n\t<knowledge-article v-for="article in articles" :key="article.urlName"\n\t\t\t\t\t\t:article="article"><\/knowledge-article>\n\t<search-paging v-if="showPaging" class="my-5"\n\t\t\t\t:total-rows="totalResults"\n\t\t\t\t:start-row="skipResults"\n\t\t\t\t:row-limit="itemLimit"\n\t\t\t\t:page-limit="5"\n\t\t\t\t@change-page="changePage($event)"><\/search-paging>\n<\/div>'});Vue.component("knowledge-article",{props:{article:Object},computed:{iconClass:function(){var n="question-circle";switch(this.article.recordType){case"Issue Resolution":n="exclamation-triangle";break;case"Troubleshooting Hub":n="info-circle"}return"far fa-"+n}},template:'\n<div class="result-document d-flex align-items-center mb-2">\n\t<i class="result-document-icon" :class="iconClass" style="width: 22px;font-size:1.2em"><\/i>\n    <div class="flex-grow-1 text-left">\n      <a :href="article.url">{{ article.title }}<\/a>\n    <\/div>\n<\/div>'});Daktronics.Components.RegisterVues(".service-knowledge",makeSearchComponentStore);$("#service-knowledge-search").length&&new Vue({el:"#service-knowledge-search",router:Daktronics.Components.GetVueRouter(),store:makeSearchComponentStore(),computed:{searchQuery:function(){return this.$store.state.query.userKeywords}},methods:{updateUserSearchQuery:function(n){this.$store.dispatch("newKeywordQuery",n).then(function(){$("#service-knowledge-search [type=text]").get(0).blur()})},restartSearch:function(){this.$store.dispatch("reset")}},created:function(){this.$store.commit("setRouter",this.$router)}})