Vue.component("document-search",{props:{searchQuery:String,defaultKeywords:String,itemLimit:{type:Number,"default":5},showPaging:{type:Boolean,"default":!1},searchFields:String,facetFields:{type:Array,"default":function(){return[]}},orderBy:String,hideFileSize:{type:Boolean,"default":!1},showProductInfo:{type:Boolean,"default":!1},noResultsMessage:{type:String,"default":"Sorry, we couldn't find any document matches."}},computed:{documents: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}},watch:{totalResults:function(n){this.$emit("has-results",n>0)}},methods:{changePage:function(n){this.$store.dispatch("skipResults",n)}},beforeCreate:function(){var n,t=!1;((n=this.$store)===null||n===void 0?void 0:n.state)&&this.$store.state.storeType==="search"&&(t=!0);t||(this.$store=makeSearchComponentStore())},created:function(){this.$store.dispatch("init",{context:{url:"/api/documents/search"},query:{userKeywords:this.searchQuery,defaultKeywords:this.defaultKeywords,searchFields:this.seachFields,orderBy:[this.orderBy],itemLimit:this.itemLimit,facetFields:this.facetFields}})},template:'\n<div>\n    <p v-if="!loading && !$store.state.error && totalResults === 0">{{ noResultsMessage }}<\/p>\n    <p v-if="!loading && $store.state.error">Sorry, there was a problem getting results.<\/p>\n    <div v-if="!loading && !$store.state.error && totalResults > 0">\n        <document v-for="doc in documents"\n                    :key="doc.path"\n                    :doc="doc"\n                    :hideFileSize="hideFileSize"\n                    :showInfo="showProductInfo"><\/document>\n        <search-paging v-if="showPaging" class="my-5"\n                        :total-rows="totalResults"\n                        :start-row="skipResults"\n                        :row-limit="itemLimit"\n                        :page-limit="5"\n                        @change-page="changePage($event)"><\/search-paging>\n    <\/div>\n<\/div>'});Vue.component("document",{props:{doc:Object,hideFileSize:Boolean,showInfo:Boolean},computed:{iconClass:function(){var i,t="file",n=(i=this.doc.path)===null||i===void 0?void 0:i.split(".").pop();return n=="msi"||n=="msp"?t="download":n=="js"||n=="jse"?t="file-code":n=="log"?t="file-alt":n=="eml"||n=="msg"?t="envelope":n=="odc"||n=="xls"||n=="xlsb"||n=="xlsm"||n=="xlsx"||n=="xlt"||n=="xltb"||n=="xltm"||n=="xltx"?t="file-excel":n=="pot"||n=="potm"||n=="potx"||n=="pps"||n=="ppsm"||n=="ppsx"||n=="ppt"||n=="pptm"||n=="pptx"?t="file-powerpoint":n=="doc"||n=="docm"||n=="docx"||n=="dot"||n=="dotm"||n=="dotx"||n=="mht"||n=="mhtml"?t="file-word":n=="wm"||n=="wma"||n=="wmd"||n=="wmp"||n=="wms"||n=="wmv"||n=="wmx"||n=="wmz"?t="file-audio":n=="txt"?t="file-alt":n=="aspx"||n=="asp"||n=="html"||n=="htm"||n=="php"?t="file-alt":n=="xml"?t="file-code":n=="zip"?t="file-archive":n=="pdf"?t="file-pdf":(n=="jpg"||n=="jpeg"||n=="png"||n=="gif"||n=="bmp"||n=="svg")&&(t="file-image"),"far fa-"+t}},template:'\n<div class="result-document d-flex mb-2">\n    <i class="result-document-icon" :class="iconClass"><\/i>\n    <div class="flex-grow-1 text-left">\n      <a :href="doc.path">{{ doc.title }}<\/a>\n      <span v-if="!hideFileSize && doc.sizeWithLabel" class="result-document-caption">({{ doc.sizeWithLabel }})<\/span>\n      <div v-if="showInfo && doc.hasDetails" class="resultdocument-detail">\n        <span v-if="doc.products" class="result-document-detail-item"><strong>Products:<\/strong> {{ doc.products }}<\/span>\n        <span v-if="doc.color" class="result-document-detail-item"><strong>Color:<\/strong> {{ doc.color }}<\/span>\n        <span v-if="doc.spacing" class="result-document-detail-item"><strong>Spacing:<\/strong> {{ doc.spacing }}<\/span>\n        <span v-if="doc.environment" class="result-document-detail-item"><strong>Environment:<\/strong> {{ doc.environment }}<\/span>\n        <span v-if="doc.sides" class="result-document-detail-item"><strong>Sides:<\/strong> {{ doc.sides }}<\/span>\n        <hr class="my-2 mb-3" />\n      <\/div>\n    <\/div>\n<\/div>'});Daktronics.Components.RegisterVues(".document-search");$("#document-search").length&&new Vue({el:"#document-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(){$("#document-search input[type=text]").get(0).blur()})},restartSearch:function(){this.$store.dispatch("reset")}},created:function(){this.$store.commit("setRouter",this.$router)}})