PageSourceSearch

https://www.thebruery.com/cdn/shop/t/364/assets/custom-fields-widgets.js?v=139276942021613749621781825971

js thebruery.com collected 2026-09-25 14:03:46 UTC 15,982 bytes, 10 lines download raw bytes

1/**
2 * DO NOT MODIFY THIS FILE. IT WILL BE OVERWRITTEN.
3 *
4 * @version 1.02
5 *
6 * @license MIT
7 *
8 * @author Bonify, LLC
9 */
10let CustomFieldsWidget={dataAttrToOpts:function(t,i){for(var e=t.get(0).attributes,s=0;s<e.length;s++)if(0===e[s].nodeName.indexOf("data-")){var o=e[s].nodeName.replace(/data-/g,"");o=o.replace(/-/g,"_");var n=e[s].nodeValue;isNaN(n)||(n=parseInt(n)),i[o]=n}return i},jQueryExists:function(){return"undefined"!=typeof jQuery&&"undefined"!==$},initAll:function(t){$.each(t.css_classes,function(i,e){$("."+e+".cf-auto-init:not(.js-enabled)").each(function(i,e){new t($(e)).init()})})},initEvents:function(t){$(document).on("shopify:section:select",function(i){CustomFieldsWidget.initAll(t)}),$(document).ready(function(){CustomFieldsWidget.initAll(t)})}};CustomFieldsWidget.jQueryExists()||document.querySelectorAll(".cf-auto-init")&&setTimeout(function(){if(document.querySelector("#preview-bar-iframe")||document.querySelector("#admin-bar-iframe")){var t=document.createElement("div");t.innerHTML='<div id="cf-widget-warning" style="opacity: 0;transform:translateY(-100px);transition: all 2.0s;position:fixed;top:20px;right:20px;z-index:999;padding:10px;background-color:#fff1aa;border:2px solid #ff8c0c; border-radius: 5px;box-shadow: 3px 3px 10px rgba(0,0,0,.2);">Custom Fields widgets require jQuery be loaded in your theme.<br/><a href="https://custom-fields.docs.bonify.io/article/351-setting-up-jquery-for-widgets" style="text-decoration:underline;font-weight:bold;" target="_blank">Learn More</a></div>',document.querySelector("body").append(t),setTimeout(function(){document.querySelector("#cf-widget-warning").style.transform="translateY(0px)",document.querySelector("#cf-widget-warning").style.opacity=1},500)}},1e3);let CustomFieldsWidgetSlider=function(t,i){this.$el=t,this.opts=i,this.height=0,this.width=0,this.$slider=!1,this.$slides=!1,this.$pager=!1,this.cur_slide=0,this.max_index=0,this.timer=!1,this.ratio=0,this.disable_auto_scroll=!1,this.resize_timeout=!1,this.arrows={$prev:!1,$next:!1}};if(CustomFieldsWidgetSlider.prototype.init=function(){this.opts=CustomFieldsWidget.dataAttrToOpts(this.$el,this.opts);let t=this;this.$slider=this.$el.find(".cf-slider"),this.$slides=this.$slider.find(".cf-slide"),this.$slides.each(function(t,i){$(i).attr("data-original-height",$(i).height())}),this.$slides.length>1&&this.opts.randomize&&($.fn.shuffle=function(t){return(t?this.find(t):this).parent().each(function(){$(this).children(t).sort(function(){return Math.random()-.5}).detach().appendTo(this)}),this},this.$slides.shuffle(),this.$slides=this.$slider.find(".cf-slide")),this.opts.variable_height?this.height=this.$slides.eq(0).height():this.$slides.each(function(i,e){$(e).height()>t.height&&(t.height=$(e).height())}),this.width=this.$slider.outerWidth(),this.$slides.length&&(this.$slider.height(this.height),this.$slides.width(this.width),this.ratio=this.width/this.height,this.$el.find(".cf-slides-wrapper").css("flex-direction","row"),this.opts.variable_height&&this.$el.find(".cf-slides-wrapper").css("align-items","flex-start"),this.$slides.length<=1?this.$slides.eq(0).addClass("active"):(this.$slides.each(function(t,i){$(i).attr("data-index",t)}),this.max_index=this.$slides.length-1,this.opts.hide_pager||this.addPager(),this.opts.hide_arrows||(this.$slider.addClass("cf-show-arrows"),this.addArrows()),this.goto(0),this.opts.interval>0&&(this.startSlideTimer(),this.$slider.on("mouseenter",function(){t.disable_auto_scroll=!0}),this.$slider.on("mouseleave",function(){t.disable_auto_scroll=!1})),$(window).on("resize",function(){t.resize_timeout&&clearTimeout(t.resize_timeout),t.resize_timeout=setTimeout(function(){t.resize(t.$slider.outerWidth(),t.$slider.outerWidth()/t.ratio)},200)})))},CustomFieldsWidgetSlider.prototype.resize=function(t,i){if(this.width=t,this.height=i,this.$slider.height(i),this.$slides.width(t),"slide"===this.opts.effect){let t=this.cur_slide*this.$slider.outerWidth()*-1;this.$slider.find(".cf-slides-wrapper").css({transition:"transform "+this.opts.animate_speed+"ms",transform:"translateX("+t+"px)"})}},CustomFieldsWidgetSlider.prototype.startSlideTimer=function(){this.timer&&clearInterval(this.timer),this.timer=setInterval(this.nextSlideInterval.bind(this),this.opts.interval)},CustomFieldsWidgetSlider.prototype.elementInView=function(){let t=this.$el.get(0).getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)},CustomFieldsWidgetSlider.prototype.nextSlideInterval=function(){!this.disable_auto_
10scroll&&this.elementInView()&&this.next()},CustomFieldsWidgetSlider.prototype.prev=function(t){void 0!==t?t.data.i=this.cur_slide-1:t={data:{i:this.cur_slide-1,opts:this.opts}},this.gotoEvent(t)},CustomFieldsWidgetSlider.prototype.next=function(t){void 0!==t?t.data.i=this.cur_slide+1:t={data:{i:this.cur_slide+1,opts:this.opts}},this.gotoEvent(t)},CustomFieldsWidgetSlider.prototype.gotoEvent=function(t){let i=t.data.i;void 0===t.data.opts?this.goto(i,t.data):this.goto(i,t.data.opts)},CustomFieldsWidgetSlider.prototype.goto=function(t,i){let e=this;t>this.max_index&&(t=0),t<0&&(t=this.max_index),this.$pager&&(this.$pager.find(".cf-pager-button").removeClass("active"),this.$pager.find(".cf-pager-button").eq(t).addClass("active")),this.$slider.attr("data-slide",t);let s=this.$slides.eq(this.cur_slide),o=this.$slides.eq(t);if(this.$slides.removeClass("active"),t!==this.cur_slide){if(i.variable_height&&this.$slider.animate({height:o.attr("data-original-height")},i.animate_speed),"fade"===i.effect)this.$slides.css({position:"absolute",top:0,left:0}),this.$slides.each(function(i,s){i!==t&&i!==e.cur_slide&&$(s).css({opacity:0,zIndex:-1})}),s.stop(),s.css({opacity:1,zIndex:2}),o.css({opacity:1,zIndex:1}),s.animate({opacity:0}
10,i.animate_speed,null,function(){o.css({opacity:1,zIndex:2}),s.css({opacity:1,zIndex:-1})});else{let e=t*this.$slider.outerWidth()*-1;this.$slider.find(".cf-slides-wrapper").css({transition:"transform "+i.animate_speed+"ms "+i.animate_easing,transform:"translateX("+e+"px)"}),setTimeout(function(){o.addClass("active")},.5*i.animate_speed)}this.cur_slide=t}else o.addClass("active")},CustomFieldsWidgetSlider.prototype.addArrows=function(){var t=this;let i=Object.assign({},this.opts);this.arrows.$prev=$('<div class="cf-slider-arrow cf-slider-arrow__prev"><div class="arrow-triangle"></div></div>'),this.arrows.$next=$('<div class="cf-slider-arrow cf-slider-arrow__next"><div class="arrow-triangle"></div></div>'),this.arrows.$prev.on("click",i,this.prev.bind(this)),this.arrows.$next.on("click",i,this.next.bind(this)),this.arrows.$prev.on("click.stopInterval",function(){clearInterval(t.timer)}),this.arrows.$next.on("click.stopInterval",function(){clearInterval(t.timer)}),this.$slider.append(this.arrows.$prev),this.$slider.append(this.arrows.$next)},CustomFieldsWidgetSlider.prototype.addPager=function(){let t=this;this.$pager=$('<div class="cf-slider-pager"></div>'),this.$slides.each(function(i,e){const s=$('<div class="cf-pager-button" data-index="'+$(e).attr("data-index")+'"></div>');let o=Object.assign({},t.opts);o.i=parseInt($(e).attr("data-index")),s.on("click",o,t.gotoEvent.bind(t)),s.on("click.stopInterval",function(){clearInterval(t.timer)}),t.$pager.append(s)}),this.$slider.append(this.$pager)},CustomFieldsWidget.jQueryExists()){let t=function(t){this.$el=t,this.opts={open_first:0,allow_all_closed:1,allow_multiple_open:0,animate_speed:200}};t.css_classes=["cf-widget__accordion","cf-widget__accordion-v2"],t.prototype.init=function(){this.opts=CustomFieldsWidget.dataAttrToOpts(this.$el,this.opts);var t=this;this.$el.addClass("js-enabled"),this.opts.allow_all_closed||this.$el.addClass("force-one-open"),this.$el.find(".cf-widget-item").each(function(i,e){t.opts.open_first&&0===i||t.toggleItem(i,0)}),this.$el.find(".cf-accordion-title").on("mousedown",function(i){let e=$(this).closest(".cf-widget-item").attr("data-index");t.toggleItem(e,t.opts.animate_speed),t.opts.allow_multiple_open||t.closeAllExcept(e,t.opts.animate_speed)})},t.prototype.updateOpenCount=function(){this.$el.attr("data-open-count",this.$el.find(".cf-widget-item:not(.closed)").length)},t.prototype.closeAllExcept=function(t,i){let e=this.$el.find('.cf-widget-item:not(.closed):not([data-index="'+t+'"])'),s=this;e.each(function(t,e){s.closeItem($(e),i)}),this.updateOpenCount()},t.prototype.openItem=function(t,i){t.removeClass("closed"),t.find(".inner").stop().slideDown(i),this.updateOpenCount()},t.prototype.closeItem=function(t,i){t.addClass("closed"),t.find(".inner").stop().slideUp(i),this.updateOpenCount()},t.prototype.toggleItem=function(t,i){let e=this.$el.find('.cf-widget-item[data-index="'+t+'"]');e.hasClass("closed")?this.openItem(e,i):this.closeItem(e,i)},CustomFieldsWidget.initEvents(t)}else console.error("jQuery library not found. Unable to initiate Custom Fields Accordion widget.");if(CustomFieldsWidget.jQueryExists()){let t=function(t){this.$el=t,this.max_height=0,this.opts={dynamic_height:1,height_speed:0,fade_speed:0}};t.css_classes=["cf-widget__tabs","cf-widget__tabs-v2"],t.prototype.init=function(){this.opts=CustomFieldsWidget.dataAttrToOpts(this.$el,this.opts);let t=this;this.$el.addClass("js-enabled"),this.$el.find(".cf-tab--pseudo").hide(),this.$el.find(".tab-labels--hidden").removeClass("tab-labels--hidden"),this.$el.find(".cf-widget-item").each(function(i,e){$(e).outerHeight()>t.max_height&&(t.max_height=$(e).outerHeight()),$(e).data("original-height",$(e).outerHeight())}),this.$el.find(".cf-widget-item").hide(),t.opts.dynamic_height||this.$el.find(".cf-widget-item").height(t.max_height),this.setActiveTab(0,t.opts.dynamic_height,0,0),this.$el.find(".tab-labels .cf-tab").on("click",function(i){t.setActiveTab($(this).attr("data-index"),t.opts.dynamic_height,t.opts.height_speed,t.opts.fade_speed)})},t.prototype.setActiveTab=function(t,i,e,s){this.$el.find(".tab-labels .cf-tab").removeClass("active"),this.$el.find('.tab-labels .cf-tab[data-index="'+t+'"]').addClass("active");let o=this.$el.find(".cf-widget-item.active");o.removeClass("active");let n=this.$el.find('.cf-widget-item[data-index="'+t+'"]');n.addClass("active"),s>0?(n.show(),o.stop().animate({opacity:0}
10,s/2,function(){$(this).hide()}),setTimeout(function(){n.stop().animate({opacity:1},s,function(){$(this).addClass("active")})},s/4)):(o.hide().css("opacity",0),n.show().css("opacity",1)),i?e>0?this.$el.find(".tab-contents-container").stop().animate({height:n.data("original-height")},e):this.$el.find(".tab-contents-container").height(n.data("original-height")):this.$el.find(".tab-contents-container").height(this.max_height)},CustomFieldsWidget.initEvents(t)}else console.error("jQuery library not found. Unable to initiate Custom Fields Tabs widget.");if(CustomFieldsWidget.jQueryExists()){let t=function(t){this.$el=t,this.opts={hide_arrows:0,hide_pager:0,interval:0,effect:"slide",animate_speed:500,animate_easing:"ease-in-out",variable_height:0}};t.css_classes=["cf-widget__image-slider","cf-widget__image-slider-v2"],t.prototype.init=function(){this.opts=CustomFieldsWidget.dataAttrToOpts(this.$el,this.opts),this.$el.addClass("js-enabled"),new CustomFieldsWidgetSlider(this.$el,this.opts).init()},CustomFieldsWidget.initEvents(t)}else console.error("jQuery library not found. Unable to initiate Custom Fields Image Slider widget.");if(CustomFieldsWidget.jQueryExists()){let t=function(t){this.$el=t,this.opts={hide_arrows:0,hide_pager:0,interval:0,effect:"slide",animate_speed:500,animate_easing:"ease-in-out",variable_height:0}};t.css_classes=["cf-widget__testimonials","cf-widget__testimonials-v2"],t.prototype.init=function(){this.opts=CustomFieldsWidget.dataAttrToOpts(this.$el,this.opts),this.$el.addClass("js-enabled"),new CustomFieldsWidgetSlider(this.$el,this.opts).init()},CustomFieldsWidget.initEvents(t)}else console.error("jQuery library not found. Unable to initiate Custom Fields Testimonials widget.");if(CustomFieldsWidget.jQueryExists()){let t=function(t){this.$el=t,this.$lightbox=!1,this.$overlay=!1,this.cur_index=0,this.arrows={$prev:!1,$next:!1},this.opts={hide_arrows:0}};t.css_classes=["cf-widget__image-gallery","cf-widget__image-gallery-v2"],t.prototype.init=function(){this.opts=CustomFieldsWidget.dataAttrToOpts(this.$el,this.opts),this.$el.addClass("js-enabled"),this.$el.find(".cf-widget-item").on("click",this.openLightbox.bind(this))},t.prototype.openOverlay=function(t){if($(".cf-overlay").length)return;let i=$('<div class="cf-overlay" data-block-id="'+this.$el.attr("id")+'"></div>');$("body").append(i),i.animate({opacity:1},500),this.$overlay=i},t.prototype.closeOverlay=function(t){let i=this;this.$overlay.animate({opacity:0}
10,250,null,function(){i.$overlay.remove(),i.$overlay=!1})},t.prototype.closeLightbox=function(t){let i=this;$("body").removeClass("cf-lightbox-open"),$(document).off("keydown.cf_lightbox"),this.$lightbox.animate({opacity:0},250,null,function(){i.$lightbox.remove(),i.$lightbox=!1}),setTimeout(function(){i.closeOverlay(t)},100)},t.prototype.prev=function(t){let i=this,e=this.$lightbox.find(".cf-lightbox__inner");e.addClass("shift-right");let s=this.cur_index-1;s<0&&(s=this.$el.find(".cf-widget-item").length-1);let o=this.$el.find('.cf-widget-item[data-index="'+s+'"]');setTimeout(function(){i.cur_index=s,e.find(".cf-lightbox__image img").remove(),e.find(".cf-lightbox__info .inner").remove(),o.trigger("click"),e.addClass("in-from-left"),setTimeout(function(){e.removeClass("shift-right").removeClass("in-from-left")},260)},260)},t.prototype.next=function(t){let i=this,e=this.$lightbox.find(".cf-lightbox__inner");e.addClass("shift-left");let s=this.cur_index+1;s>=this.$el.find(".cf-widget-item").length&&(s=0);let o=this.$el.find('.cf-widget-item[data-index="'+s+'"]');setTimeout(function(){i.cur_index=s,e.find(".cf-lightbox__image img").remove(),e.find(".cf-lightbox__info .inner").remove(),o.trigger("click"),e.addClass("in-from-right"),setTimeout(function(){e.removeClass("shift-left").removeClass("in-from-right")},260)},260)},t.prototype.addArrows=function(){let t=Object.assign({},this.opts);this.arrows.$prev=$('<div class="cf-lightbox-arrow cf-lightbox-arrow__prev"><div class="arrow-triangle"></div></div>'),this.arrows.$next=$('<div class="cf-lightbox-arrow cf-lightbox-arrow__next"><div class="arrow-triangle"></div></div>'),this.arrows.$prev.on("click",t,this.prev.bind(this)),this.arrows.$next.on("click",t,this.next.bind(this)),this.$lightbox.find(".cf-lightbox__image").append(this.arrows.$prev),this.$lightbox.find(".cf-lightbox__image").append(this.arrows.$next)},t.prototype.openLightbox=function(t){this.openOverlay(t);let i=$(t.currentTarget),e=this;this.cur_index=parseInt(i.attr("data-index"));let s=$('<img src="'+i.find(".gallery-image img").attr("data-original-src")+'"/>'),o=i.find(".inner").clone();this.$lightbox.length||(this.$lightbox=$('<div class="cf-lightbox" data-block-id="'+this.$el.attr("id")+'"><div class="cf-lightbox__inner"><div class="cf-lightbox__close">✕</div><div class="cf-lightbox__image"></div><div class="cf-lightbox__info"></div></div></div>')),this.$lightbox.find(".cf-lightbox__image").append(s),this.$lightbox.find(".cf-lightbox__info").append(o),$(".cf-lightbox").length||($("body").append(this.$lightbox).addClass("cf-lightbox-open"),this.$lightbox.find(".cf-lightbox__close").on("click",this.closeLightbox.bind(this)),this.opts.hide_arrows||this.addArrows(),this.$lightbox.on("click",function(t){$(t.target).hasClass("cf-lightbox")&&e.closeLightbox(t)}),setTimeout(function(){e.$lightbox.animate({opacity:1},500)},200),$(document).on("keydown.cf_lightbox",function(t){"Escape"===t.key?e.closeLightbox(t):"ArrowLeft"===t.key?e.prev(t):"ArrowRight"===t.key&&e.next(t)})),o.css("max-height",$(window).height()-s.height()-100)},CustomFieldsWidget.initEvents(t)}else console.error("jQuery library not found. Unable to initiate Custom Fields Image Gallery widget.");

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.