Files
CHIEFSOFT\ameye b114fdf4fa first commit
2023-12-28 16:20:07 -05:00

1 line
6.0 KiB
JavaScript

window.nb_={},function(e,t){if(window.nb_={isArray:function(e){return Array.isArray(e)||"[object Array]"===toString.call(e)},inArray:function(e,t){return!(!nb_.isArray(e)||nb_.isUndefined(t))&&-1<e.indexOf(t)},isUndefined:function(e){return void 0===e},isObject:function(e){var t=typeof e;return"function"===t||"object"===t&&!!e},errorLog:function(){nb_.isUndefined(console)||"function"!=typeof window.console.log||console.log.apply(console,arguments)},hasPreloadSupport:function(e){var t=document.createElement("link").relList;return!(!t||!t.supports)&&t.supports("preload")},listenTo:function(t,n){nb_.eventsListenedTo.push(t);var o={"nb-jquery-loaded":function(){return"undefined"!=typeof jQuery},"nb-app-ready":function(){return void 0!==window.nb_&&nb_.wasListenedTo("nb-jquery-loaded")},"nb-swipebox-parsed":function(){return"undefined"!=typeof jQuery&&void 0!==jQuery.fn.swipebox},"nb-main-swiper-parsed":function(){return void 0!==window.Swiper}},e=function(e){nb_.isUndefined(o[t])||!1!==o[t]()?n():nb_.errorLog("Nimble error => an event callback could not be fired because conditions not met => ",t,nb_.eventsListenedTo,n)};"function"==typeof n?nb_.wasEmitted(t)?e():document.addEventListener(t,e):nb_.errorLog("Nimble error => listenTo func param is not a function for event => ",t)},eventsEmitted:[],eventsListenedTo:[],emit:function(e,t){if(!(nb_.isUndefined(t)||t.fire_once)||!nb_.wasEmitted(e)){var n=document.createEvent("Event");n.initEvent(e,!0,!0),document.dispatchEvent(n),nb_.eventsEmitted.push(e)}},wasListenedTo:function(e){return"string"==typeof e&&nb_.inArray(nb_.eventsListenedTo,e)},wasEmitted:function(e){return"string"==typeof e&&nb_.inArray(nb_.eventsEmitted,e)},isInScreen:function(e){if(!nb_.isObject(e))return!1;var t=e.getBoundingClientRect(),n=Math.max(document.documentElement.clientHeight,window.innerHeight);return!(t.bottom<0||0<=t.top-n)},isCustomizing:function(){return!1},isLazyLoadEnabled:function(){return!nb_.isCustomizing()&&!1},preloadOrDeferAsset:function(n){if(n=n||{},nb_.preloadedAssets=nb_.preloadedAssets||[],!nb_.inArray(nb_.preloadedAssets,n.id)){var e,o=document.getElementsByTagName("head")[0],t=function(){var e=this;if("style"===n.as)e.setAttribute("rel","stylesheet"),e.setAttribute("type","text/css"),e.setAttribute("media","all");else{var t=document.createElement("script");t.setAttribute("src",n.href),t.setAttribute("id",n.id),"script"===n.as&&t.setAttribute("defer","defer"),o.appendChild(t),i.call(e)}n.eventOnLoad&&nb_.emit(n.eventOnLoad)},i=function(){var e=this;if(e&&e.parentNode&&e.parentNode.contains(e))try{e.parentNode.removeChild(e)}catch(e){nb_.errorLog("NB error when removing a script el",el)}};("font"!==n.as||nb_.hasPreloadSupport())&&(e=document.createElement("link"),"script"===n.as?n.onEvent?nb_.listenTo(n.onEvent,function(){t.call(e)}):t.call(e):(e.setAttribute("href",n.href),"style"===n.as?e.setAttribute("rel",nb_.hasPreloadSupport()?"preload":"stylesheet"):"font"===n.as&&nb_.hasPreloadSupport()&&e.setAttribute("rel","preload"),e.setAttribute("id",n.id),e.setAttribute("as",n.as),"font"===n.as&&(e.setAttribute("type",n.type),e.setAttribute("crossorigin","anonymous")),e.onload=function(){this.onload=null,"font"!==n.as?n.onEvent?nb_.listenTo(n.onEvent,function(){t.call(e)}):t.call(e):n.eventOnLoad&&nb_.emit(n.eventOnLoad)},e.onerror=function(e){nb_.errorLog("Nimble preloadOrDeferAsset error",e,n)}),o.appendChild(e),nb_.preloadedAssets.push(n.id),i.call(n.scriptEl))}},mayBeRevealBG:function(){this.getAttribute("data-sek-src")&&(this.setAttribute("style",'background-image:url("'+this.getAttribute("data-sek-src")+'")'),this.className+=" sek-lazy-loaded",this.querySelectorAll(".sek-css-loader").forEach(function(e){nb_.isObject(e)&&e.parentNode.removeChild(e)}))}},window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=function(e,t){t=t||window;for(var n=0;n<this.length;n++)e.call(t,this[n],n,this)}),nb_.listenTo("nb-docready",function(){var e=document.querySelectorAll("div.sek-has-bg");!nb_.isObject(e)||e.length<1||e.forEach(function(e){nb_.isObject(e)&&(window.sekFrontLocalized&&window.sekFrontLocalized.lazyload_enabled?nb_.isInScreen(e)&&nb_.mayBeRevealBG.call(e):nb_.mayBeRevealBG.call(e))})}),"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll)nb_.emit("nb-docready");else{var n=function(){nb_.wasEmitted("nb-docready")||nb_.emit("nb-docready")};document.addEventListener("DOMContentLoaded",n),window.addEventListener("load",n)}}(window,document),function(){var t=function(){var e="nb-jquery-loaded";nb_.wasEmitted(e)||nb_.emit(e)},n=function(e){e=e||0,void 0!==window.jQuery?t():e<30?setTimeout(function(){n(++e)},200):window.console&&window.console.log&&console.log("Nimble Builder problem : jQuery.js was not detected on your website")},e=document.getElementById("nb-jquery");e&&e.addEventListener("load",function(){t()}),n()}(),window,document,nb_.listenTo("nb-jquery-loaded",function(){sekFrontLocalized.load_front_assets_on_dynamically&&(nb_.scriptsLoadingStatus={},nb_.ajaxLoadScript=function(t){jQuery(function(e){t=e.extend({path:"",complete:"",loadcheck:!1},t),nb_.scriptsLoadingStatus[t.path]&&"pending"===nb_.scriptsLoadingStatus[t.path].state()||(nb_.scriptsLoadingStatus[t.path]=nb_.scriptsLoadingStatus[t.path]||e.Deferred(),jQuery.ajax({url:sekFrontLocalized.frontAssetsPath+t.path+"?"+sekFrontLocalized.assetVersion,cache:!0,dataType:"script"}).done(function(){"function"!=typeof t.loadcheck||t.loadcheck()?"function"==typeof t.complete&&t.complete():nb_.errorLog("ajaxLoadScript success but loadcheck failed for => "+t.path)}).fail(function(){nb_.errorLog("ajaxLoadScript failed for => "+t.path)}))})})}),nb_.listenTo("nb-jquery-loaded",function(){jQuery(function(e){sekFrontLocalized.load_front_assets_on_dynamically&&(nb_.ajaxLoadScript({path:sekFrontLocalized.isDevMode?"js/ccat-nimble-front.js":"js/ccat-nimble-front.min.js"}),e.each(sekFrontLocalized.partialFrontScripts,function(e,t){nb_.listenTo(t,function(){nb_.ajaxLoadScript({path:sekFrontLocalized.isDevMode?"js/partials/"+e+".js":"js/partials/"+e+".min.js"})})}))})});