PageSourceSearch

https://redbarrelsgames.com/wp-content/themes/redbarrelsgames/dist…rch_index_js.43d7952d204e5829b819.bundle.js

js redbarrelsgames.com collected 2026-10-02 05:06:47 UTC 15,097 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkredbarrelsgames=self.webpackChunkredbarrelsgames||[]).push([["src_js_modules_support-search_index_js"],{
1"./src/js/modules/support-search/index.js":(t,e,n)=>{n.r(e),n.d(e,{default:()=>b});n("./node_modules/eventemitter2/lib/eventemitter2.js");var r=n("./src/js/utils/dom.js"),s=n("./src/js/core/windmill.js"),i=n("./src/js/utils/listener.js"),a=n("./src/js/utils/throttle.js"),u=n("./node_modules/meilisearch/dist/bundles/meilisearch.umd.js"),l={fr:{"no-result-found":'Resultat <span class="color-red">0</span>',"no-result-message":"Aucun résultat trouvé, essayez de rechercher avec des termes différents."},en:{"no-result-found":'Result <span class="color-red">0</span>',"no-result-message":"Nothing was found, try searching with different terms."}},o=function(){return void 0!==MILL3WP.locale?MILL3WP.locale:"fr"},c=function(t){var e=o(),n=void 0!==l[e]?l[e]:null;return n&&void 0!==n[t]?n[t]:t};var h=n("./src/js/transitions/utils.js");function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function d(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function p(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function m(t,e,n){return e&&p(t.prototype,e),n&&p(t,n),t}function y(t){return function(t){if(Array.isArray(t))return f(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return f(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var v=['language = "'.concat(o(),'"')],_=function(){function t(e,n){d(this,t),this.el=e,this.emitter=n,this.client=MILL3WP.meilisearch_host&&MILL3WP.meilisearch_public_key?new u.MeiliSearch({host:MILL3WP.meilisearch_host,apiKey:MILL3WP.meilisearch_public_key}):null,this.form=(0,r.$)("form",this.el),this.searchInput=(0,r.$)('input[type="search"]',this.el),this.resetBtn=(0,r.$)(".support-search__reset",this.el),this.resultsContainer=(0,r.$)(".support-search__results",this.el),this.resultsCountContainer=(0,r.$)(".support-search__resultsCount",this.el),this.searchFiltersContainer=(0,r.$)(".support-search__filters",this.el),this.resultTemplate=(0,r.$)("#search-preview-template",this.el).textContent,this.resultsItems=[],this.client&&(this._onSubmit=this._onSubmit.bind(this),this._onReset=this._onReset.bind(this),this._onFilter=this._onFilter.bind(this),this._onSearchInputThrottled=this._onSearchInputThrottled.bind(this),this._onSearchInput=this._onSearchInput.bind(this),this._fetching=!1,this._query=null,this._filter=y(v),this._throttle=new a.Z({delay:350,onlyAtEnd:!0,cb:this._onSearchInput}))}return m(t,[{key:"init",value:function(){this._bindEvents(),this.searchInput&&this._getInitialQuery()}},{key:"destroy",value:function(){this._unbindEvents(),this._throttle&&this._throttle.dispose(),this.el=null,this.emitter=null,this.form=null,this.searchInput=null,this.resultsContainer=null,this.resultsCountContainer=null,this.searchFiltersContainer=null,this.filters=null,this.client=null,this.resetBtn=null,this._onSubmit=null,this._onReset=null,this._onFilter=null,this._onSearchInputThrottled=null,this._onSearchInput=null,this._query=null,this._filter=null,this._fetching=null,this._throttle=null}},{key:"_getInitialQuery",value:function(){var t=this.searchInput.value,e=this.form.dataset.termId;e&&this._filter.push("terms.support_category.term_id = '".concat(e,"'")),t&&(this.searchInput.value=t,this._onSearchInput())}},{key:"_bindEvents",value:function(){(0,i.on)(this.form,"submit",this._onSubmit),(0,i.on)(this.searchInput,"search",this._onSearchInput),(0,i.on)(this.searchInput,"input",this._onSearchInputThrottled)}},{key:"_unbindEvents",value:function(){(0,i.S1)(this.form,"submit",this._onSubmit),(0,i.S1)(this.searchInput,"search",this._onSearchInput),(0,i.S1)(this.searchInput,"input",this._onSearchInputThrottled)}},{key:"_onSubmit",value:function(t){t.preventDefault()}},{key:"_onReset",value:function(t){t&&t.preventDefault(),this.resultsItems=[],this.searchInput.value="",this.query="",this._onSearchInput()}},{key:"_onFilter",value:function(t){if(t){var e=this.filters.find((function(e){return e.el===t}));if(!e.selected){var n=e.filterBy;
1this.filters.forEach((function(t){return t.selected=!1})),e.selected=!0,this.filter=y(v).concat([n]),this.query&&(this.resultsItems=[],this._onSearchInput())}}}},{key:"_onSearchInputThrottled",value:function(){this._throttle.init()}},{key:"_onSearchInput",value:function(){var t=this;if(this.query=this.searchInput.value,!this._fetching){this.updateLocation();var e=this.client.index(MILL3WP.meilisearch_index);if(this.query.length<2)return this.el.classList.remove("--has-results"),r.d1.classList.remove("--js-support-searching"),void this.emptyResults();this.el.classList.add("--has-results"),r.d1.classList.add("--js-support-searching"),this._fetching=!0,e.search(this.query,{limit:40,attributesToHighlight:["title","post_type"],filter:this.filter.join(" AND ")}).then((function(e){var n=e.hits;t._fetching=!1,t.showResults(n),t.query!=e.query&&t._onSearchInput()}))}}},{key:"showResults",value:function(t){var e=this;if(0!==t.length){var n=t.map((function(t){return t.id})),r=this.resultsItems.map((function(t){return t.id}));if(JSON.stringify(n)!==JSON.stringify(r)){this.resultsItems=[];var s=new DocumentFragment;t.forEach((function(t,n){var r=new g(t._formatted);r.id=t.id;var i=r.data.terms.support_category,a="";i.sort((function(t,e){return parseInt(t.parent)-parseInt(e.parent)})).forEach((function(t,e){a+="<span>".concat(t.name,"</span>"),e+1<i.length&&(a+="<span>&mdash;</span>")})),e.resultsItems.push(r);var u=document.createElement("li");u.classList.add("support-search__result"),u.setAttribute("data-scroll",""),u.setAttribute("data-scroll-id","search-result-".concat(r.id));var l=e.resultTemplate.replace(/{{title}}/g,r.title).replace(/{{subtitle}}/g,r.subtitle).replace(/{{permalink}}/g,r.permalink).replace(/{{categories}}/g,a);if(r.thumbnail){var o=new Image;o.src=r.thumbnail,o.classList.add("search-preview__img","img-fluid","box-content","img-cover","object-fit-contain"),l=l.replace(/{{thumbnail}}/g,o.outerHTML)}else l=l.replace(/{{thumbnail}}/g,"");r.el=u,r.index=n,u.innerHTML=l,s.appendChild(u)})),this.resultsContainer.innerHTML="",this.resultsContainer.append(s),this.setResultsCount(t.length),this.resultsItems.forEach((function(t){(0,h.UD)(t.el)||t.el.removeAttribute("data-scroll")})),this.emitter.emit("SiteScroll.update")}}else this.noResults()}},{key:"calculateTotalsByFilter",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=this;if(this.filters.filter((function(t){return 1==t.selected}))[0].total=t,!this._fetching){var n=this.client.index(MILL3WP.meilisearch_index);this.filters.filter((function(t){return 0==t.selected})).forEach((function(t){var r=t.filterBy;n.search(e.query,{limit:40,filter:y(v).concat([r]).join(" AND ")}).then((function(n){t.total=null==n?void 0:n.hits.length,e.emitter.emit("TabList.update")}))}))}}},{key:"updateLocation",value:function(){var t=new FormData(this.form),e=new URLSearchParams,n=!0,r=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(n=(a=u.next()).done);n=!0){var l=a.value;e.append(l[0],l[1])}}catch(t){r=!0,i=t}finally{try{n||null==u.return||u.return()}finally{if(r)throw i}}var o="".concat(window.location.pathname,"?").concat(e.toString());s.Z.replace(o)}},{key:"setResultsCount",value:function(t){if(0===t)return this.resultsCountContainer.innerHTML=c("no-result-found");var e=this.resultsCountContainer.dataset.template;this.resultsCountContainer.innerHTML=e.replace(/%n/g,t)}},{key:"emptyResults",value:function(){this.resultsItems=[],this.resultsContainer.innerHTML="",this.emitter.emit("SiteScroll.update")}},{key:"noResults",value:function(){this.resultsItems=[],this.resultsContainer.innerHTML="";var t=new DocumentFragment,e=document.createElement("article");e.classList.add("support-search__noResults"),e.innerHTML='<p class="fz-18 fw-400 lh-none pt-20 pt-lg-5">'.concat(c("no-result-message"),"</p>"),t.appendChild(e),this.resultsContainer.append(t),this.setResultsCount(0),this.emitter.emit("SiteScroll.update")}},{key:"query",get:function(){return this._query},set:function(t){t!==this._query&&(this._query=t)}},{key:"filter",get:function(){return this._filter},set:function(t){if("object"!=typeof t)return v;t!==this._filter&&(this._filter=t)}}]),t}(),g=function(){function t(e){d(this,t),this.data=e,this._el=null,this._id=null,this._index=null}return m(t,[{key:"title",get:function(){return this.data.title}},{key:"subtitle",get:function(){return this.data.post_type}},{key:"thumbnail",get:function(){return this.data.thumbnail}},{key:"permalink",get:function(){return this.data.permalink}},{key:"id",get:function(){return this._id},set:function(t){t!==this._id&&(this._id=t)}},{key:"el",get:function(){return this._el},set:function(t){t!==this._el&&(this._el=t)}},{key:"index",get:function(){return this._index},set:function(t){this._index=t,this._el.style.setProperty("--index",this._index)}}]),t}();const b=_},
1"./src/js/scroll/utils.js":(t,e,n)=>{n.d(e,{JV:()=>f,Pw:()=>u,U9:()=>p,bt:()=>c,os:()=>o,sj:()=>l,xC:()=>h,zP:()=>d});var r=n("./src/js/utils/dom.js"),s=n("./src/js/utils/easings.js"),i=n("./src/js/utils/mobile.js"),a=n("./src/js/utils/viewport.js"),u=function(t){if(!t.hasAttribute("data-scroll-call"))return null;var e=t.dataset.scrollCall.split(",").map((function(t){return t.trim()}));return 1===e.length?e[0]:e},l=function(t){if(!t.hasAttribute("data-scroll-delay"))return!1;var e,n=null!==(e=parseFloat(t.getAttribute("data-scroll-delay")))&&void 0!==e?e:0;return!(n<=0||n>=1)&&n},o=function(t){if(!t.hasAttribute("data-scroll-offset"))return null;var e=(i.ai&&t.hasAttribute("data-scroll-offset-native")?t.dataset.scrollOffsetNative:t.dataset.scrollOffset).split(",");return e?(e.forEach((function(t,n){"string"==typeof t&&(t.includes("%")?e[n]=parseInt(t.replace("%","")*a.Z.height/100):e[n]=parseInt(t))})),e):null},c=function(t){return t.getAttribute("data-scroll-position")},h=function(t){return t.hasAttribute("data-scroll-progress")?[parseFloat(getComputedStyle(t).getPropertyValue("--scroll-progress")||0),s.ZP[t.getAttribute("data-scroll-progress")]||null]:[!1,null]},f=function(t){if(!t.hasAttribute("data-scroll-repeat"))return null;var e=t.dataset.scrollRepeat;return"false"!=e&&(null!=e||null)},d=function(t){return!!t.hasAttribute("data-scroll-speed")&&.1*parseFloat(t.getAttribute("data-scroll-speed"))},p=function(t){if(!t.hasAttribute("data-scroll-target"))return null;var e=t.dataset.scrollTarget;if(null==e)return null;var n=(0,r.$)(e);return n||(console.error("Cannot find ".concat(t,"'s data-scroll-target=").concat(e," in DOM.")),null)}},
1"./src/js/transitions/utils.js":(t,e,n)=>{n.d(e,{UD:()=>o,lv:()=>c});var r=n("./src/js/scroll/utils.js"),s=n("./src/js/utils/dom.js"),i=n("./src/js/utils/transform.js"),a=n("./src/js/utils/viewport.js");function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function l(t){return function(t){if(Array.isArray(t))return u(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return u(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var o=function(t){if(!t)return!1;var e,n=(0,s.JA)(t),u=null!==(e=(0,r.os)(t))&&void 0!==e?e:[0,0],l=(0,i.R)(t),o=n.top-l.y+u[0],c=n.top-l.y+n.height-u[1];return o<a.Z.height&&c>0},c=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;l((0,s.$$)("[data-module-delay]")).forEach((function(n){var r=o(n);n.setAttribute("data-module-delay",r),r&&n.style.setProperty("--module-delay","".concat(e,"ms")),r&&(e+=n.hasAttribute("data-module-delay-increment")?parseInt(n.dataset.moduleDelayIncrement):t)}))}},
vendor: 1,785 bytes, line 1
1"./src/js/utils/easings.js":(t,e,n)=>{n.d(e,{ZP:()=>s,hl:()=>r});var r=function(t,e,n,r){return-n*(t/=r)*(t-2)+e};const s={easeInQuad:function(t,e,n,r){return n*(t/=r)*t+e},easeOutQuad:r,easeInOutQuad:function(t,e,n,r){return(t/=r/2)<1?n/2*t*t+e:-n/2*(--t*(t-2)-1)+e},easeInCubic:function(t,e,n,r){return n*(t/=r)*t*t+e},easeOutCubic:function(t,e,n,r){return n*((t=t/r-1)*t*t+1)+e},easeInOutCubic:function(t,e,n,r){return(t/=r/2)<1?n/2*t*t*t+e:n/2*((t-=2)*t*t+2)+e},easeInQuart:function(t,e,n,r){return n*(t/=r)*t*t*t+e},easeOutQuart:function(t,e,n,r){return-n*((t=t/r-1)*t*t*t-1)+e},easeInOutQuart:function(t,e,n,r){return(t/=r/2)<1?n/2*t*t*t*t+e:-n/2*((t-=2)*t*t*t-2)+e},easeInQuint:function(t,e,n,r){return n*(t/=r)*t*t*t*t+e},easeOutQuint:function(t,e,n,r){return n*((t=t/r-1)*t*t*t*t+1)+e},easeInOutQuint:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return(t/=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:1)/2)<1?n/2*t*t*t*t*t+e:n/2*((t-=2)*t*t*t*t+2)+e},easeInSine:function(t,e,n,r){return-n*Math.cos(t/r*(Math.PI/2))+n+e},easeOutSine:function(t,e,n,r){return n*Math.sin(t/r*(Math.PI/2))+e},easeInOutSine:function(t,e,n,r){return-n/2*(Math.cos(Math.PI*t/r)-1)+e},easeInExpo:function(t,e,n,r){return 0==t?e:n*Math.pow(2,10*(t/r-1))+e},easeOutExpo:function(t,e,n,r){return t==r?e+n:n*(1-Math.pow(2,-10*t/r))+e},easeInOutExpo:function(t,e,n,r){return 0==t?e:t==r?e+n:(t/=r/2)<1?n/2*Math.pow(2,10*(t-1))+e:n/2*(2-Math.pow(2,-10*--t))+e},easeInCirc:function(t,e,n,r){return-n*(Math.sqrt(1-(t/=r)*t)-1)+e},easeOutCirc:function(t,e,n,r){return n*Math.sqrt(1-(t=t/r-1)*t)+e},easeInOutCirc:function(t,e,n,r){return(t/=r/2)<1?-n/2*(Math.sqrt(1-t*t)-1)+e:n/2*(Math.sqrt(1-(t-=2)*t)+1)+e}}},
1"./src/js/utils/transform.js":(t,e,n)=>{function r(t){var e={};if(window.getComputedStyle){var n=getComputedStyle(t),r=n.transform||n.webkitTransform||n.mozTransform,s=r.match(/^matrix3d\((.+)\)$/);return s?(e.x=s?parseFloat(s[1].split(", ")[12]):0,e.y=s?parseFloat(s[1].split(", ")[13]):0):(s=r.match(/^matrix\((.+)\)$/),e.x=s?parseFloat(s[1].split(", ")[4]):0,e.y=s?parseFloat(s[1].split(", ")[5]):0),e}}n.d(e,{R:()=>r})}
1}]);
2//# sourceMappingURL=src_js_modules_support-search_index_js.43d7952d204e5829b819.bundle.js.map

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.