1import{l as d,a as u,i as f}from"./axios.66742775.js";import{n as p}from"./index.aaaab68c.js";import{B as h,a as g,t as c}from"./dropdown-text.334fe384.js";let l=null;const m={name:"PubSearch",data(){return{expanded:{top:!1},initialLoad:!0,loading:!1,allCategories:[],data:{keyword:"",categories:[]}}},components:{"b-dropdown":h,"b-dropdown-text":g},props:{label:{type:String,required:!0},categoriesJson:{type:String,required:!0}},computed:{selectedItems:function(){return this.data.categories.map(s=>this.getCategoryByTextKey(s))}},methods:{getCategoryByTextKey:function(s){return this.allCategories.find(e=>e.textkey===s)},setQueryInUrl:function(s){if(console.log("#log 8891 setQueryInUrl",s),!this.initialLoad){let e=Object.keys(s).map(function(t){return t+"="+s[t]}).join("&");history.replaceState({},"","#?"+e)}},removeQueryInUrl:function(s){console.log("#log 8891 removeQueryInUrl",s);let e={};s.forEach(t=>{e[t]=null}),this.setQueryInUrl(e)},setWatchers:function(){this.$watch("data",{handler:d(function(s){this.searchFormSubmit("datawatch")},1e3),deep:!0})},resetFilters:function(){console.log("#log 6220 resetf"),this.data.keyword="",this.data.color=[],this.data.material=[],this.data.usage=[]},expandPane:function(s){console.log("#log 3753",s),this.expanded[s]=!this.expanded[s]},parseQuery:function(s){if(typeof s!="string"||s.length==0)return{};for(var e=s.split("&"),t=e.length,a,r={},o,i,n=0;n<t;n++)a=e[n].split("="),o=decodeURIComponent(a[0]),o.length!=0&&(i=decodeURIComponent(a[1]),typeof r[o]>"u"?r[o]=i:r[o]instanceof Array?r[o].push(i):r[o]=[r[o],i]);return r},restoreQueryFromUrl:function(){const s=this.parseQuery(window.location.hash.replace("#?",""));console.log("#log 1646 restoreQueryFromUrl",s);for(const e in s){const t=s[e];e=="categories"&&(t=t.split(",")),this.data[e]=t}},searchFormSubmit:function(s){let e={};console.log("#searchFormSubmit "+s,this.data),c(this.data.keyword).length>2&&(e.keyword=c(this.data.keyword)),this.data.categories.length>0&&(e.categories=this.data.categories.join(",")),this.setQueryInUrl(e),this.initialLoad=!1;let t=this.prepareQueryForApi(e);t.per_page=100,console.log("#log 1068",t),this.sendQuery({...t})},sendQuery:function(s){return this.loading=!0,console.log("#log 8000 send query",s),new Promise((e,t)=>{u.post(this.$store.getters.currentUrl,s).then(a=>{console.log("items response",a),this.loading=!1;let r=a.data;l.innerHTML=r,console.log("#log 1264",l),e()}).catch(a=>{this.loading=!1,console.error("#error 5603",a),t(a.response)})})},prepareQueryForApi:function(s){return s},toggleKey:function(s,e){console.log("#log",s,e),this.hasKey(s,e)?this.$delete(s,s.indexOf(e)):s.push(e)},hasKey:function(s,e){return f(e,s)},resetCategories:function(){this.$set(this.data,"categories",[])},fetchItemsIfNeeded:function(){},getCategoriesFromProps:function(){this.allCategories=JSON.parse(this.categoriesJson)}},created:function(){l=document.getElementById("searchresult"),document.querySelector(".breadcrumb").classList.add("tinted"),this.getCategoriesFromProps(),this.restoreQueryFromUrl(),this.fetchItemsIfNeeded(),this.searchFormSubmit("initialLoad"),this.setWatchers()},mounted:function(){}};var y=function(){var e=this,t=e._self._c;return t("div",[t("div",{staticClass:"container pubsearch-form"},[t("div",{staticClass:"row"},[t("div",{staticClass:"col-sm"},[t("div",{staticClass:"mb-3 input-group input-group-uba-top-style input-group-lg"},[e._m(0),t("input",{directives:[{name:"model",rawName:"v-model",value:e.data.keyword,expression:"data.keyword"}],staticClass:"form-control",attrs:{type:"text",placeholder:e.label,"aria-label":e.label,name:"keyword","aria-describedby":"basic-addon1"},domProps:{value:e.data.keyword},on:{input:function(a){a.target.composing||e.$set(e.data,"keyword",a.target.value)}}}),e._m(1)])]),t("div",{staticClass:"col-sm filter-col"},[t("div",[t("b-dropdown",{ref:"dropdown",staticClass:"dropdown-button",attrs:{id:"dropdown-1",block:"",variant:"transparent","no-caret":"","no-flip":""},scopedSlots:e._u([{key:"button-content",fn:function(){return[e._v(" Filter "),t("span",{staticClass:"hide-when-open"},[t("i",{staticClass:"fal fa-chevron-down"})]),t("span",{staticClass:"show-when-open"},[t("i",{staticClass:"fal fa-chevron-up"})])]},proxy:!0}])},[t("b-dropdown-text",{staticStyle:{"min-width":"400px"}},[t("ul",{staticClass:"checkboxes"},e._l(e.allCategories,function(a){return t("li",{key:a.textkey,class:[e.hasKey(e.data.categories,a.textkey)?"active":"not-active"]},[t("a",{on:{click:function(r){return r.preventDefault(),e.toggleKey(e.data.categories,a.textkey)}}},[t("i",{staticClass:"fal fa-fw fa-square hide-on-active"}),t("i",{staticClass:"fal fa-fw fa-check-square show-on-active"}),e._v(" "+e._s(a.text))])])}),0)])],1)],1)])])]),t("MountingPortal",{attrs:{mountTo:"#searchtags"}},[e.selectedItems.length?t("div",{staticClass:"pubsearch-form selected-items"},[t("ul",[e._l(e.selectedItems,function(a,r){return t("li",{key:r},[t("a",{attrs:{href:"#"},on:{click:function(o){return o.preventDefault(),e.toggleKey(e.data.categories,a.textkey)}}},[t("span",[e._v(e._s(a.text))]),t("i",{staticClass:"fal fa-times"})])])}),t("li",{staticClass:"delete-all"},[t("a",{attrs:{href:"#"},on:{click:function(a){return a.preventDefault(),e.resetCategories()}}}
1,[e._v("alle Filter l\xF6schen")])])],2)]):e._e(),t("div",{directives:[{name:"visible",rawName:"v-visible",value:e.loading,expression:"loading"}],staticClass:"text-center loading-indicator"},[t("i",{staticClass:"fal fa-spinner fa-spin"})])])],1)},v=[function(){var s=this,e=s._self._c;return e("div",{staticClass:"input-group-prepend"},[e("span",{staticClass:"input-group-text",attrs:{id:"basic-addon1"}},[e("i",{staticClass:"fas fa-search"})])])},function(){var s=this,e=s._self._c;return e("div",{staticClass:"input-group-append"},[e("span",{staticClass:"input-group-text text-green"},[e("i",{staticClass:"fal fa-long-arrow-right fa-lg"})])])}],_=p(m,y,v,!1,null,null,null,null);const x=_.exports;export{x as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.