PageSourceSearch

https://www.tamarindodiria.com/integration/tc-theme/public/js/chun…-tc-filter-category-16b76c3e85c48d8c1a3f.js

js tamarindodiria.com collected 2026-09-28 10:36:07 UTC 4,890 bytes, 1 lines download raw bytes

1"use strict";(self.tcthemejsonpFunction=self.tcthemejsonpFunction||[]).push([[8572],{520(e,t,i){i.d(t,{default:()=>h});var s=i(8972),l=i(4692);const{isNullOrUndefined:r}=s._0;class n{constructor({filterContainer:e,gridContainer:t}){this.filterContainer=this.getElementSelector(e),this.gridContainer=this.getElementSelector(t),this.filterTabList=this.getFilterTabsList(),this.categories=[],this.initialize()}initialize(){if(r(this.filterContainer))return!1;this.bindEvents()}resetFilters(){for(let e of this.getGirdItemsList())e.classList.remove("hidden")}setFilter({id:e,name:t}){for(let i of this.getGirdItemsList()){if("all"===t)return;i.dataset.category.replace(/,\s*$/,"").split(",").includes(e)||i.classList.add("hidden")}}setActive(e){for(let e of this.filterTabList)e.classList.remove("active");e.classList.add("active")}getElementSelector(e){if(s._0.validStr(e))return document.querySelector(e)}getGirdItemsList(){const e=this.gridContainer.querySelectorAll(".col-filters");return s._0.isValidNodeList(e)?e:[]}getFilterTabsList(){const e=this.filterContainer.querySelectorAll(".js-filters-trigger");return s._0.isValidNodeList(e)?e:[]}onFilterTabClick(e){this.resetFilters(),this.setActive(e),this.setFilter(e.dataset)}onMobileFilterChange(e){this.resetFilters(),this.setFilter(e.options[e.selectedIndex].dataset)}setMobileFilterDisplay(){l(".tab-filters-mobile").customSelect({minimumResultsForSearch:-1}).removeClass("hidden").on("change",(e=>{this.onMobileFilterChange(e.target)}).bind(this))}removeFilterDisplayWhenEmpty(){l(".tab-filters").remove(),l(".tab-filters-mobile").remove()}bindEvents(){for(let e of this.filterTabList)e.addEventListener("click",e=>this.onFilterTabClick(e.target));this.filterTabList.length>1?this.setMobileFilterDisplay():this.removeFilterDisplayWhenEmpty()}}var o=i(4692);const{isNullOrUndefined:a,isNum:c}=s._0,h={init:function(){if(this.$filters=o(".js-filter-container"),this.$filters.hasClass("tab-filters"))return this.tabInitialized=!0,void new n({filterContainer:".js-filter-container",gridContainer:".js-filtered-grid"});this.$grid=o(".js-filtered-grid"),this.clearContainerClone=o(".btn-clear-filters-clone"),this.checkedValuesCount=0,this.filter(),this.fixChevronRTL(),this.initialized=!0},fixChevronRTL:function(){"rtl"==o("html").attr("dir")&&this.$filters.find(".accordion__panel__heading .btn-link").css("display","inline")},showAllBlocksInGrid:function(){this.$grid.find(".col-filters").show()},hasFilters:function(){return this.$filters.find(".js-filter-field").length||this.$filters.find("#hotel-filter").length},getCheckedCategoryFilters:function(){return this.$filters.find(".js-filter-field").filter(function(){return o(this).is(":checked")})},getCheckedCategoryFiltersValues:function(){let e=[],t=this.getCheckedCategoryFilters();return t.length&&o.each(t,function(){e.push(parseInt(o(this).val()))}),e},getSelectedHotelFiltersValues:function(){const e=this.$filters.find("#hotel-filter");return 0===e.length?[]:e.select2("val").map(e=>parseInt(e))},filterGridBlocks:function(){let e=this;this.$grid.find(".col-filters").each(function(){const t=e.getElementCategories(o(this).data("category")),i=e.getElementCategories(o(this).data("hotel")),s=!!e.checkedCategoryValues.length&&!e.checkedCategoryValues.some(e=>t.includes(e)),l=!!e.selectedHotelValues.length&&!e.selectedHotelValues.some(e=>i.includes(e));(s||l)&&o(this).hide()})},getElementCategories:function(e){let t=[];return a(e)||(c(e)?t.push(parseInt(e)):t=e.split(",").slice(0,-1).map(e=>parseInt(e))),t},updateCounterValue:function(){this.$filters.find(".filters-counter").text("("+this.checkedValuesCount+")"),this.clearContainerClone.html(o(".btn-clear-filters-container").html())},showClearAndCounterButton:function(){o(".btn-clear-filters").css("display","inline"),this.updateCounterValue()},hideClearAndCounterButton:function(){o(".btn-clear-filters").css("display","none")},uncheckFilters:function(){this.$filters.find("#hotel-filter").val([]).trigger("change"),this.$filters.find(".js-filter-field").each(function(){o(this).prop("checked",!1)}),o(".js-filters-trigger").trigger("click"),this.updateCounterValue()},filter:function(){if(this.hasFilters()){let e=this;this.$filters.on("click",".js-filters-trigger",function(){e.showAllBlocksInGrid(),e.checkedCategoryValues=e.getCheckedCategoryFiltersValues(),e.selectedHotelValues=e.getSelectedHotelFiltersValues(),e.checkedValuesCount=e.checkedCategoryValues.length+e.selectedHotelValues.length,e.checkedValuesCount>0?(e.filterGridBlocks(),e.showClearAndCounterButton()):e.hideClearAndCounterButton()}).on("click",".btn-clear-filters, .btn-clear-filters-clone",function(){e.clearContainerClone.hide(),e.uncheckFilters(),e.hideClearAndCounterButton()}).on("click",".btn-link",function(){o(".accordion__panel.active").length?e.clearContainerClone.hide():e.checkedValuesCount&&e.clearContainerClone.show()})}}}}}]);

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.