PageSourceSearch

https://redbarrelsgames.com/wp-content/themes/redbarrelsgames/dist…btn_index_js.047e78a0f145cd477e42.bundle.js

js redbarrelsgames.com collected 2026-10-02 05:06:39 UTC 4,299 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkredbarrelsgames=self.webpackChunkredbarrelsgames||[]).push([["src_js_modules_prefers-color-scheme-btn_index_js"],{
1"./src/js/modules/prefers-color-scheme-btn/index.js":(e,t,n)=>{n.r(t),n.d(t,{default:()=>y});var r=n("./src/js/utils/listener.js"),o=n("./node_modules/eventemitter2/lib/eventemitter2.js"),i=n.n(o),s=n("./src/js/utils/dom.js");function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e){return a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},a(e)}function u(e,t){return!t||"object"!=((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)&&"function"!=typeof t?l(e):t;var n}function h(e,t){return h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},h(e,t)}function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=a(e);if(t){var o=a(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return u(this,n)}}var m="--js-prefers-color-scheme--",v="dark",_="light",d="PREFERS_COLOR_SCHEME";const p=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(i,e);var t,n,r,o=f(i);function i(){var e;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(e=o.call(this))._value=window.matchMedia&&window.matchMedia("(prefers-color-scheme: ".concat(v,")")).matches?v:_,window.matchMedia){e._onPrefersColorSchemeChange=e._onPrefersColorSchemeChange.bind(l(e));try{e._mq=window.matchMedia("(prefers-color-scheme: ".concat(v,")")),e._mq.addEventListener("colorschemechange",e._onPrefersColorSchemeChange)}catch(e){console.error("PrefersColorScheme Error :",e)}}var t=localStorage.getItem(d);return t&&t!==e._value&&e.toggle(),e}return t=i,(n=[{key:"toggle",value:function(){s.dy.classList.remove(m+this._value),this._value=this._value===v?_:v,s.dy.classList.add(m+this._value),localStorage.setItem(d,this._value),this.emit("change",this._value)}},{key:"_onPrefersColorSchemeChange",value:function(e){s.dy.classList.remove(m+v,m+_),this._value=e.matches?v:_,localStorage.setItem(d,this._value),this.emit("change",this._value)}},{key:"value",get:function(){return this._value}}])&&c(t.prototype,n),r&&c(t,r),i}(i()));function b(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}const y=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.el=t,this.labels=JSON.parse(this.el.dataset.prefersColorSchemeBtn),this._onClick=this._onClick.bind(this),this._onPrefersColorSchemeChange=this._onPrefersColorSchemeChange.bind(this)}var t,n,o;return t=e,(n=[{key:"init",value:function(){this._bindEvents(),this._onPrefersColorSchemeChange(p.value)}},{key:"destroy",value:function(){this.el=null,this.labels=null,this._onClick=null,this._onPrefersColorSchemeChange=null}},{key:"stop",value:function(){this._unbindEvents()}},{key:"_bindEvents",value:function(){this.el&&(0,r.on)(this.el,"click",this._onClick),p.on("change",this._onPrefersColorSchemeChange)}},{key:"_unbindEvents",value:function(){this.el&&(0,r.S1)(this.el,"click",this._onClick),p.off("change",this._onPrefersColorSchemeChange)}},{key:"_onClick",value:function(e){e&&(e.preventDefault(),e.stopImmediatePropagation()),p.toggle()}},{key:"_onPrefersColorSchemeChange",value:function(e){this.el&&this.el.setAttribute("aria-label",this.labels[e])}}])&&b(t.prototype,n),o&&b(t,o),e}()}
1}]);
2//# sourceMappingURL=src_js_modules_prefers-color-scheme-btn_index_js.047e78a0f145cd477e42.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.