').insertBefore($table),
tpl_master=$('#frzTbl-tpl').html(),
overflow_permit=this.get_overflow_permission();
if(! overflow_permit &&
! settings.tableWidth
){
settings.tableWidth=$table.parent().width();
}
if(settings.tableWidth){
$table.css({
width: settings.tableWidth,
height: '',
});
var table_width=$table.outerWidth(),
table_height=$table.outerHeight();
}else{
$table.css({
width: '',
height: '',
});
$temp_wrapper[0].innerHTML='
'+ $table[0].outerHTML +'
';
var $temp_table=$('>div>table', $temp_wrapper),
table_width=Math.max($temp_table.outerWidth(), $temp_wrapper.width()),
table_height=$temp_table.outerHeight();
if(table_width > $temp_wrapper.width()){
++table_width;
}
this.el.$table.css('min-width', $temp_wrapper.innerWidth());
}
var wrapper_width=this.options.wrapperWidth ? this.options.wrapperWidth:'',
wrapper_height=this.options.wrapperHeight ? this.options.wrapperHeight:table_height;
$temp_wrapper.remove();
this.tpl=tpl_master
.replace(/{{wrapper_height}}/g,'height:' + wrapper_height + 'px; ')
.replace(/{{wrapper_width}}/g, wrapper_width ? 'width:' + wrapper_width + 'px; ':'')
.replace(/{{table_height}}/g, 'height:' + table_height + 'px; ')
.replace(/{{table_width}}/g, 'width:' + table_width + 'px; ');
this.build_heading();
this.build_left();
this.build_right();
$table.addClass('frzTbl-table');
var $wrapper=this.el.$wrapper=$(this.tpl).insertBefore($table);
$wrapper.find('.frzTbl-table-placeholder').replaceWith($table);
var $window=$(window);
this.el.$firstCell=this.el.$table.find('.wcpt-cell:first');
this.el.$scrollOverlay=this.el.$wrapper.children('.frzTbl-scroll-overlay');
this.el.$scrollOverlayInner=this.el.$scrollOverlay.children('.frzTbl-scroll-overlay__inner');
this.el.$contentWrapper=this.el.$wrapper.children('.frzTbl-content-wrapper');
this.el.$frozenColumnsWrapper=this.el.$contentWrapper.children('.frzTbl-frozen-columns-wrapper');
this.el.$frozenColumnsInner=this.el.$frozenColumnsWrapper.children('.frzTbl-frozen-columns-wrapper__inner');
this.el.$frozenColumnsLeft=this.el.$frozenColumnsInner.children('.frzTbl-frozen-columns-wrapper__columns--left');
this.el.$frozenColumnsLeftSticky=this.el.$frozenColumnsLeft.children('.frzTbl-top-sticky');
this.el.$frozenColumnsRight=this.el.$frozenColumnsInner.children('.frzTbl-frozen-columns-wrapper__columns--right');
this.el.$frozenColumnsRightSticky=this.el.$frozenColumnsRight.children('.frzTbl-top-sticky');
this.el.$fixedHeadingWrapperOuter=this.el.$contentWrapper.children('.frzTbl-fixed-heading-wrapper-outer');
this.el.$fixedHeadingWrapper=this.el.$fixedHeadingWrapperOuter.children('.frzTbl-fixed-heading-wrapper');
this.el.$fixedHeadingLeftColumn=this.el.$fixedHeadingWrapperOuter.children('.frzTbl-fixed-heading-wrapper__columns--left');
this.el.$fixedHeadingRightColumn=this.el.$fixedHeadingWrapperOuter.children('.frzTbl-fixed-heading-wrapper__columns--right');
this.el.$fixedHeadingInner=this.el.$fixedHeadingWrapper.children('.frzTbl-fixed-heading-wrapper__inner');
this.el.$tableWrapper=this.el.$contentWrapper.children('.frzTbl-table-wrapper');
this.el.$tableInner=this.el.$tableWrapper.children('.frzTbl-table-wrapper__inner');
this.el.$tableWrapperSticky=this.el.$tableInner.children('.frzTbl-top-sticky');
this.sticky_heading();
this.resize_clone_cells();
this.grab_and_scroll();
this.antiscroll();
$(window).on('scroll', $.proxy(this, 'page_scroll'));
this.page_scroll({target: document});
this.el.$wrapper.on('wheel', $.proxy(this, 'wrapper_wheel'));
this.el.$wrapper.on('touchstart touchmove touchend', $.proxy(this, 'wrapper_touch'));
this.el.$scrollOverlay.on('wheel scroll', $.proxy(this, 'scrollOverlay_wheel'));
var affected=[
this.el.$scrollOverlay,
this.el.$tableWrapper,
this.el.$fixedHeadingWrapper,
this.el.$frozenColumnsWrapper,
];
$.each(affected, function(i, $elm){
$elm[0].scrollTop=0;
$elm[0].scrollLeft=0;
})
if(1 > Math.abs(this.el.$wrapper.innerWidth() - this.el.$table.outerWidth())){
this.el.$wrapper.addClass('frzTbl--scrolled-to-left-edge frzTbl--scrolled-to-right-edge');
}
$window.on('resize.ft' + this.namespace , $.proxy(this, 'resize'));
$table[0].addEventListener('load', this.load_image, true);
this.recordEnv();
};
FreezeTable.prototype.load_image=function(e){
var ft=$(this).data('freezeTable'),
cell_resize=$.proxy(ft, 'cell_resize');
if(e.target.tagName==='IMG'){
cell_resize(e.target);
}}
FreezeTable.prototype.grab_and_scroll=function(){
var _=this,
$wrapper=_.el.$wrapper,
$body=$('body');
$wrapper.off('mousedown.freeze_table.grab_and_scroll');
$body.off('mousemove.freeze_table.grab_and_scroll_' + _.namespace);
$body.off('mousemove.freeze_table.grab_and_scroll_' + _.namespace);
$('img, a', $wrapper).off('dragstart.freeze_table.grab_and_scroll_' + _.namespace);
$wrapper.removeClass('frzTbl--grab-and-scroll frzTbl--grab-and-scroll--grabbing');
if(this.get_breakpoint_options().grab_and_scroll){
_.grab_and_scroll__grabbed=false;
_.grab_and_scroll__last_clientX=false;
_.grab_and_scroll__last_pos_x=false;
_.grab_and_scroll__last_clientY=false;
_.grab_and_scroll__last_pos_y=false;
_.grab_and_scroll__$el=false;
$wrapper.addClass('frzTbl--grab-and-scroll');
$wrapper.on('mousedown.freeze_table.grab_and_scroll', function(e){
if(e.which===3){
return;
}
if(e.target.tagName=='SELECT'){
return;
}
_.grab_and_scroll__grabbed=true;
_.grab_and_scroll__first_clientX=e.clientX;
_.grab_and_scroll__first_clientY=e.clientY;
_.grab_and_scroll__last_clientX=e.clientX;
_.grab_and_scroll__last_clientY=e.clientY;
_.grab_and_scroll__$el=$(e.target).parentsUntil($wrapper);
_.grab_and_scroll__$el__ev_handler_attached=false;
$wrapper.addClass('frzTbl--grab-and-scroll--grabbing');
_.el.$table.trigger('freeze_table__grab_and_scroll__start');
$body.one('mouseup', function(){
_.grab_and_scroll__grabbed=false;
$wrapper.removeClass('frzTbl--grab-and-scroll--grabbing');
_.el.$table.trigger('freeze_table__grab_and_scroll__stop');
setTimeout(function(){
_.grab_and_scroll__$el.off('click.freeze_table.grab_and_scroll_' + _.namespace);
}, 1);
})
})
$body.on('mousemove.freeze_table.grab_and_scroll_' + _.namespace, function(e){
if(_.grab_and_scroll__grabbed){
var diff_x=e.clientX - _.grab_and_scroll__last_clientX;
_.grab_and_scroll__last_pos_x +=parseFloat(diff_x);
_.horizontal_scroll(-diff_x);
_.grab_and_scroll__last_clientX=e.clientX;
var diff_y=e.clientY - _.grab_and_scroll__last_clientY;
_.grab_and_scroll__last_pos_y +=parseFloat(diff_y);
_.vertical_scroll(-diff_y);
_.grab_and_scroll__last_clientY=e.clientY;
if((
Math.abs(_.grab_and_scroll__last_clientX - _.grab_and_scroll__first_clientX) > 2 ||
Math.abs(_.grab_and_scroll__last_clientY - _.grab_and_scroll__first_clientY) > 2
) &&
! _.grab_and_scroll__$el__ev_handler_attached
){
_.grab_and_scroll__$el.one('click.freeze_table.grab_and_scroll_' + _.namespace, function(e){
e.preventDefault();
e.stopPropagation();
})
_.grab_and_scroll__$el__ev_handler_attached=true;
}
_.el.$table.trigger('freeze_table__grab_and_scroll__dragging');
}})
$('img, a', $wrapper).on('dragstart.freeze_table.grab_and_scroll_' + _.namespace, function(e){
e.preventDefault();
});
}};
FreezeTable.prototype.build_heading=function(){
if(this.get_breakpoint_options().heading){
var $heading=this.clone_table();
$heading.find('tbody').remove();
this.tpl=this.tpl.replace(/{{heading}}/g, $heading[0].outerHTML);
}else{
this.tpl=this.tpl.replace(/{{heading}}/g, '');
}};
FreezeTable.prototype.sticky_heading=function(){
var settings=this.get_breakpoint_options(),
offset=settings.offset ? settings.offset:0,
$heading=this.el.$table.children('thead'),
heading_height=$heading[0].getBoundingClientRect().height,
gap_top=parseInt(this.el.$table.css('border-top-width')),
heading_border=parseInt(this.el.$table.find('> thead > tr').css('border-bottom-width'));
if(isNaN(offset)){
if(typeof offset==='string'){
offset=$(offset).height();
}else if(typeof offset==='object'){
offset=offset.height();
}}
if(gap_top % 2){
--gap_top;
}
gap_top *=.5;
this.el.$fixedHeadingWrapperOuter.css({
height: heading_height + gap_top + heading_border,
top: parseFloat(offset) + 'px',
});
if(! settings._sticky_outer_heading){
this.el.$fixedHeadingWrapperOuter.hide();
}else{
this.el.$fixedHeadingWrapperOuter.show();
}
$('> div > table', this.el.$frozenColumnsInner).each(function(){
var $this=$(this);
$('> thead', $this).remove();
$this.css('margin-top', (heading_height + gap_top) + 'px');
})
if(! settings.heading){
this.el.$fixedHeadingWrapperOuter.css({
position: 'relative',
top: 0
});
}
this.el.$wrapper.parents().each(function(){
var $this=$(this),
overflow=$this.css('overflow');
if(! $this.is('html') &&
! $this.is('body') &&
overflow &&
overflow!=='visible'
){
$this.addClass('frzTbl-force-parent-overlow-visible');
}});
};
FreezeTable.prototype.build_left=function(){
var settings=this.get_breakpoint_options();
if(! settings.left){
this.tpl=this.tpl.replace(/{{left-columns}}/g, '');
this.tpl=this.tpl.replace(/{{left-columns-heading}}/g, '');
this.tpl=this.tpl.replace(/{{hide-left-columns-heading}}/g, 'frzTbl-fixed-heading-wrapper__columns--empty');
this.tpl=this.tpl.replace(/{{hide-left-column}}/g, 'frzTbl-frozen-columns-wrapper__columns--empty');
return;
}
var $left=this.clone_table();
$left.find('td, th').each(function(){
var $this=$(this);
if($this.index() >=settings.left){
$this.remove();
}})
this.tpl=this.tpl.replace(/{{left-columns}}/g, ($left[0].outerHTML||''));
$left_heading=$left.clone();
$left_heading.find('tbody').remove();
this.tpl=this.tpl.replace(/{{left-columns-heading}}/g, ($left_heading[0].outerHTML||''));
this.tpl=this.tpl.replace(/{{hide-left-column}}/g, '');
if($('> thead > tr.wcpt-heading-row.wcpt-hide', this.el.$table).length){
this.tpl=this.tpl.replace(/{{hide-top-sticky}}/g, ' frzTbl-top-sticky--empty ');
}else{
this.tpl=this.tpl.replace(/{{hide-top-sticky}}/g, '');
}};
FreezeTable.prototype.build_right=function(){
var settings=this.get_breakpoint_options();
if(! settings.right){
this.tpl=this.tpl.replace(/{{right-columns}}/g, '');
this.tpl=this.tpl.replace(/{{right-columns-heading}}/g, '');
this.tpl=this.tpl.replace(/{{hide-right-columns-heading}}/g, 'frzTbl-fixed-heading-wrapper__columns--empty');
this.tpl=this.tpl.replace(/{{hide-right-column}}/g, 'frzTbl-frozen-columns-wrapper__columns--empty');
return;
}
var $right=this.clone_table();
$right.find('td, th').each(function(){
var $this=$(this);
if($this.siblings().length - $this.index() >=settings.right){
$this.remove();
}})
this.tpl=this.tpl.replace(/{{right-columns}}/g, ($right[0].outerHTML||''));
$right_heading=$right.clone();
$right_heading.find('tbody').remove();
this.tpl=this.tpl.replace(/{{right-columns-heading}}/g, ($right_heading[0].outerHTML||''));
this.tpl=this.tpl.replace(/{{hide-right-column}}/g, '');
if($('> thead > tr.wcpt-heading-row.wcpt-hide', this.el.$table).length){
this.tpl=this.tpl.replace(/{{hide-top-sticky}}/g, ' frzTbl-top-sticky--empty ');
}else{
this.tpl=this.tpl.replace(/{{hide-top-sticky}}/g, '');
}};
FreezeTable.prototype.clone_table=function(){
var $table=this.el.$table,
$cloneTable=this.el.$table.clone();
$cloneTable
.css({
'width': '',
'min-width': '',
})
.addClass('frzTbl-clone-table');
$('> tbody > tr > td, > thead > tr > th', $cloneTable).each(function(){
var $this=$(this);
$this.attr({
'data-index': $this.index(),
});
});
return $cloneTable;
};
FreezeTable.prototype.resize_clone_cells=function(){
var $table=this.el.$table,
$cloneTables=this.get_clone_tables(),
$cloneCells=$('> tbody > tr > td, > thead > tr > th', $cloneTables),
dimensions=[];
$cloneCells.each(function(){
var $this=$(this),
$row=$this.parent(),
wrapper=$row.parent().is('thead') ? 'thead':'tbody',
selector='> '+ wrapper +' > tr:nth-child('+ ($row.index() + 1) +') > *:nth-child('+ (parseInt($this.attr('data-index')) + 1) +')',
$original=$(selector, $table);
dimensions.push({
width: $original[0].getBoundingClientRect().width,
rowOuterHeight: $original.parent()[0].getBoundingClientRect().height
});
});
$cloneCells.each(function(i){
var $this=$(this);
$this.css({
width: dimensions[i].width,
minWidth: dimensions[i].width,
});
$this.parent().outerHeight(dimensions[i].rowOuterHeight);
});
var $heading=this.el.$table.children('thead'),
heading_height=$heading[0].getBoundingClientRect().height,
gap_top=parseInt(this.el.$table.css('border-top-width'));
if(gap_top % 2){
--gap_top;
}
gap_top *=.5;
$('> div > table', this.el.$frozenColumnsInner).each(function(){
var $this=$(this);
$this.css('margin-top', (heading_height + gap_top) + 'px');
})
};
FreezeTable.prototype.get_clone_tables=function(){
var $table=this.el.$table,
$cloneTables=$();
$.each(this.el, function(name, $el){
var $childTables=$el.children().filter(function(){
return $(this).is('table')&&this!==$table[0]
});
$cloneTables=$cloneTables.add($childTables);
});
return $cloneTables;
};
FreezeTable.prototype.page_scroll=function(e){
if(e.target!==document){
return;
}
var heading_rect=this.el.$fixedHeadingWrapperOuter[0].getBoundingClientRect(),
table_rect=this.el.$table[0].getBoundingClientRect();
if(heading_rect.top==table_rect.top){
this.el.$wrapper.addClass('frzTbl--scrolled-to-top');
}else{
this.el.$wrapper.removeClass('frzTbl--scrolled-to-top');
}};
FreezeTable.prototype.wrapper_wheel=function(e){
if(e.originalEvent.deltaY &&
(
! e.originalEvent.deltaX ||
Math.abs(e.originalEvent.deltaY / e.originalEvent.deltaX) > .1
) &&
! this.get_breakpoint_options().wrapperHeight
){
return true;
}
var $wrapper=this.el.$wrapper,
scrolling='frzTbl--scrolling';
$wrapper.addClass(scrolling);
clearTimeout(this.scroll_clear);
this.scroll_clear=setTimeout(
function(){
$wrapper.removeClass(scrolling);
}, 300
);
e.preventDefault();
if(! this.options.captureScroll||! this.options.wrapperHeight){
if(this.el.$scrollOverlay[0].scrollHeight==this.el.$scrollOverlay.height() ||
(
e.originalEvent.deltaY > 0 &&
this.el.$scrollOverlay[0].scrollTop + this.el.$scrollOverlay.height()==this.el.$scrollOverlayInner.height()
) ||
(
e.originalEvent.deltaY < 0 &&
! this.el.$scrollOverlay[0].scrollTop
)
){
$('html')[0].scrollTop +=e.originalEvent.deltaY;
$('body')[0].scrollTop +=e.originalEvent.deltaY;
}}
};
FreezeTable.prototype.wrapper_touch=function(e){
if(e.type=='touchstart'){
this.el.$scrollOverlay.stop(true);
}
if(e.type=='touchmove' &&
this.ev.prevClientX!==false
){
var diffX=this.ev.prevClientX - e.originalEvent.touches[0].clientX,
diffY=this.ev.prevClientY - e.originalEvent.touches[0].clientY;
var e2={
originalEvent: {
deltaX: diffX,
deltaY: diffY
}};
this.scrollOverlay_wheel(e2);
if(Math.abs(diffX) > 5){
this.ev.animScroll=20 * diffX + this.el.$scrollOverlay[0].scrollLeft;
}else{
this.ev.animScroll=false;
}}
if(e.type=='touchend'){
if(this.ev.animScroll){
this.el.$scrollOverlay.animate({scrollLeft: this.ev.animScroll}, {
specialEasing: {
scrollLeft:'FreezeTable_easeOutQuad',
}});
this.ev.animScroll=false;
}
this.ev.prevClientX=false;
this.ev.prevClientY=false;
}else{
this.ev.prevClientX=e.originalEvent.touches[0].clientX,
this.ev.prevClientY=e.originalEvent.touches[0].clientY;
}};
FreezeTable.prototype.scrollOverlay_wheel=function(e){
var deltaX=e.originalEvent.deltaX||0,
deltaY=e.originalEvent.deltaY||0;
this.horizontal_scroll(deltaX);
};
FreezeTable.prototype.horizontal_scroll=function(deltaX, deltaY){
var $scrollOverlay=this.el.$scrollOverlay,
scrollTop=this.layout_memory.scrollTop,
scrollLeft=this.layout_memory.scrollLeft,
scrollOverlayWidth=this.layout_memory.scrollOverlayWidth,
scrollOverlayInnerWidth=this.layout_memory.scrollOverlayInnerWidth,
mode='transform';
if(! deltaX){
deltaX=0;
}
if(! deltaY){
deltaY=0;
}
if(deltaX==0&&deltaY==0){
deltaX=$scrollOverlay[0].scrollLeft - this.layout_memory.scrollLeft;
}
scrollTop +=deltaY;
scrollLeft +=deltaX;
if(scrollLeft < 0){
scrollLeft=0;
}
if(scrollLeft + scrollOverlayWidth + 1 > scrollOverlayInnerWidth){
scrollLeft=scrollOverlayInnerWidth - scrollOverlayWidth;
}
this.layout_memory.scrollTop=scrollTop;
this.layout_memory.scrollLeft=scrollLeft;
$scrollOverlay[0].scrollTop=scrollTop;
$scrollOverlay[0].scrollLeft=scrollLeft;
if(mode=='scroll'){
this.el.$tableWrapper[0].scrollLeft=scrollLeft;
this.el.$fixedHeadingWrapper[0].scrollLeft=scrollLeft;
}
if(mode=='transform'){
this.el.$tableInner[0].style.transform='translate3d(-' + scrollLeft + 'px, 0, 0)';
this.el.$fixedHeadingInner[0].style.transform='translate3d(-' + scrollLeft + 'px, 0, 0)';
}
this.el.$wrapper.removeClass('frzTbl--scrolled-to-left-edge frzTbl--scrolled-to-right-edge');
if(! scrollLeft){
this.el.$wrapper.addClass('frzTbl--scrolled-to-left-edge');
}
if(scrollLeft + scrollOverlayWidth >=scrollOverlayInnerWidth){
this.el.$wrapper.addClass('frzTbl--scrolled-to-right-edge');
}}
FreezeTable.prototype.vertical_scroll=function(deltaY){
$('html')[0].scrollTop +=deltaY;
$('body')[0].scrollTop +=deltaY;
}
FreezeTable.prototype.get_breakpoint_options=function(){
var settings=this.get_options(),
current_bp=this.current_breakpoint();
if(current_bp){
var ops=$.extend(true, {}, this.default_options, settings.breakpoint[current_bp]);
return ops;
}
return settings;
};
FreezeTable.prototype.get_options=function(){
return $.extend(true, {}, this.options);
};
FreezeTable.prototype.resize=function(){
var _resize=$.proxy(this, '_resize');
clearTimeout(this.resize_clear);
this.resize_clear=setTimeout(_resize, 200);
};
FreezeTable.prototype._resize=function(){
var wrapperWidth=this.el.$wrapper.width();
if(this.env.wrapperWidth!==wrapperWidth){
if(this.crossed_breakpoint()){
this.reload(this.get_options());
return;
}
this.antiscroll();
this.recordEnv();
}};
FreezeTable.prototype.cell_resize=function(){
var _cell_resize=$.proxy(this, '_cell_resize');
clearTimeout(this.cell_resize_timeout);
this.cell_resize_timeout=setTimeout(_cell_resize, 200);
};
FreezeTable.prototype._cell_resize=function(cell){
if(! this.el.$table.hasClass('frzTbl-table')){
return;
}
if(typeof this.el.$scrollOverlay=='undefined'){
return;
}
var scrollLeft=this.el.$scrollOverlay[0].scrollLeft;
var settings=this.get_breakpoint_options(),
$table=this.el.$table;
if(! this.get_overflow_permission() &&
! settings.tableWidth
){
settings.tableWidth=this.el.$wrapper.width();
}
if(! this.get_overflow_permission()){
this.el.$tableInner.addClass('frzTbl-table-wrapper__inner--deflate');
}else{
this.el.$tableInner.removeClass('frzTbl-table-wrapper__inner--deflate');
}
if(settings.tableWidth){
$table.css({
width: settings.tableWidth,
height: '',
});
var table_width=this.el.$table.outerWidth(),
table_height=this.el.$table.outerHeight();
}else{
$table.css({
width: '',
height: '',
});
this.el.$tableInner.addClass('frzTbl-table-wrapper__inner--unrestrict-table-wrapper');
var table_width=Math.max(this.el.$table.outerWidth(), this.el.$wrapper.innerWidth());
table_height=this.el.$table.outerHeight();
if(table_width > this.el.$wrapper.width()){
++table_width;
}
this.el.$tableInner.removeClass('frzTbl-table-wrapper__inner--unrestrict-table-wrapper');
this.el.$table.css('min-width', table_width);
}
var $affected=[
this.el.$scrollOverlayInner,
this.el.$frozenColumnsInner
];
if(! this.get_breakpoint_options.wrapperHeight){
$affected.push(this.el.$wrapper);
}
$.each($affected, function(key, $elm){
$elm.css({
height: table_height,
width: table_width,
});
});
this.resize_clone_cells();
this.antiscroll();
this.el.$scrollOverlay[0].scrollLeft=scrollLeft;
this.recordEnv();
};
FreezeTable.prototype.antiscroll=function(){
var $table=this.el.$table,
$scrollOverlay=this.el.$scrollOverlay;
this.layout_memory={
scrollTop: $scrollOverlay[0].scrollTop=0,
scrollLeft: $scrollOverlay[0].scrollLeft=0,
scrollOverlayWidth: $scrollOverlay.width(),
scrollOverlayInnerWidth: this.el.$scrollOverlayInner.width(),
}
var overflow=this.el.$table.width() - this.el.$wrapper.width();
if(overflow > 5){
this.el.$wrapper.antiscroll();
}
this.el.$wrapper
.children('> .frzTbl-antiscroll-wrap').remove().end()
.children('.antiscroll-scrollbar-horizontal').wrap('
');
};
FreezeTable.prototype.crossed_breakpoint=function(){
return this.current_breakpoint()!==this.env.breakpoint
};
FreezeTable.prototype.recordEnv=function(){
var _=this;
_.env={
windowWidth: $(window).width(),
windowHeight: $(window).height(),
wrapperWidth: this.el.$wrapper.width(),
wrapperHeight: this.el.$wrapper.height(),
tableWidth: _.el.$table.width(),
tableHeight: _.el.$table.height(),
firstCellWidth: _.el.$firstCell.width(),
firstCellHeight: _.el.$firstCell.height(),
breakpoint: _.current_breakpoint(),
}};
FreezeTable.prototype.current_breakpoint=function(){
var settings=this.get_options(),
breakpoint=false,
windowWidth=$(window).width();
if(! settings.breakpoint){
return false;
}
$.each(settings.breakpoint, function(bp, bp_settings){
var bp=parseInt(bp);
if(bp < windowWidth){
return true;
}
if(! breakpoint||bp < breakpoint){
breakpoint=bp;
}})
return breakpoint;
};
FreezeTable.prototype.destroy=function(){
this.clear_handlers();
this.unwrap();
this.el.$table.removeData('freezeTable');
};
FreezeTable.prototype.clear_handlers=function(){
$(window).off('resize.ft' + this.namespace);
};
FreezeTable.prototype.unwrap=function(){
var $table=this.el.$table,
$wrapper=this.el.$wrapper;
$table
.removeClass('frzTbl-table')
.css({
'width': '',
'min-width': ''
});
if(! $wrapper||! $wrapper.length){
return;
}
$table.insertBefore($wrapper);
$wrapper.remove();
};
FreezeTable.prototype.reload=function(options){
var $table=this.el.$table;
this.destroy();
$table.data('freezeTable', new $.FreezeTable($table[0], options));
};
$.extend($.easing,
{
FreezeTable_easeOutQuad: function (x, t, b, c, d){
return -c *(t/=d)*(t-2) + b;
},
}
);
});
!function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.PhotoSwipe=t()}(this,function(){"use strict";return function(m,z,t,e){var _,N,U,p,H,Y,W,B,i,f,G,X,V,K,q,r,$,j,J,Q,ee,te,ne,o,ie,oe,ae,re,le,se,l,ce,ue,de,me,pe,fe,he,s,ye,xe,ge,ve,we,c,u,be,d,Ie,h,Ce,De,Te,Me,Se,Ae,y={features:null,bind:function(e,t,n,i){var o=(i?"remove":"add")+"EventListener";t=t.split(" ");for(var a=0;a
x.currItem.fitRatio?ze||(sn(x.currItem,!1,!0),ze=!0):ze&&(sn(x.currItem),ze=!1)),He(Ie,v.x,v.y,f))},Ye=function(e){e.container&&He(e.container.style,e.initialPosition.x,e.initialPosition.y,e.initialZoomLevel,e)},We=function(e,t){t[te]=X+e+"px, 0px"+V},Be=function(e,t){var n;!g.loop&&t&&(t=p+(b.x*Re-e)/b.x,n=Math.round(e-R.x),(t<0&&0=P()-1&&n<0)&&(e=R.x+n*g.mainScrollEndFriction)),R.x=e,We(e,H)},Ge=function(e,t){var n=vt[e]-Pe[e];return ke[e]+Oe[e]+n-t/G*n},S=function(e,t){e.x=t.x,e.y=t.y,t.id&&(e.id=t.id)},Xe=function(e){e.x=Math.round(e.x),e.y=Math.round(e.y)},Ve=null,Ke=function(){Ve&&(y.unbind(document,"mousemove",Ke),y.addClass(m,"pswp--has_mouse"),g.mouseUsed=!0,C("mouseUsed")),Ve=setTimeout(function(){Ve=null},100)},qe=function(e,t){e=on(x.currItem,w,e);return t&&(d=e),e},$e=function(e){return(e=e||x.currItem).initialZoomLevel},je=function(e){return 0<(e=e||x.currItem).w?g.maxSpreadZoom:1},Je=function(e,t,n,i){return i===x.currItem.initialZoomLevel?(n[e]=x.currItem.initialPosition[e],!0):(n[e]=Ge(e,i),n[e]>t.min[e]?(n[e]=t.min[e],!0):n[e]=P())&&(p=0),x.currItem=jt(p),(l.isOldIOSPhone||l.isOldAndroid)&&(Ze=!1),m.setAttribute("aria-hidden","false"),g.modal&&(Ze?m.style.position="fixed":(m.style.position="absolute",m.style.top=y.getScrollY()+"px")),se===undefined&&(C("initialLayout"),se=re=y.getScrollY());var n="pswp--open ";for(g.mainClass&&(n+=g.mainClass+" "),g.showHideOpacity&&(n+="pswp--animate_opacity "),n=(n=(n+=o?"pswp--touch":"pswp--notouch")+(l.animationName?" pswp--css_animation":""))+(l.svg?" pswp--svg":""),y.addClass(m,n),x.updateSize(),Y=-1,I=null,e=0;e<3;e++)We((e+Y)*b.x,r[e].el.style);le||y.bind(x.scrollWrap,B,x),a("initialZoomInEnd",function(){x.setContent(r[0],p-1),x.setContent(r[2],p+1),r[0].el.style.display=r[2].el.style.display="block",g.focus&&m.focus(),y.bind(document,"keydown",x),l.transform&&y.bind(x.scrollWrap,"click",x),g.mouseUsed||y.bind(document,"mousemove",Ke),y.bind(window,"resize scroll orientationchange",x),C("bindEvents")}),x.setContent(r[1],p),x.updateCurrItem(),C("afterInit"),Ze||(K=setInterval(function(){nt||s||u||f!==x.currItem.initialZoomLevel||x.updateSize()},1e3)),y.addClass(m,"pswp--visible")}},close:function(){_&&(N=!(_=!1),C("close"),y.unbind(window,"resize scroll orientationchange",x),y.unbind(window,"scroll",i.scroll),y.unbind(document,"keydown",x),y.unbind(document,"mousemove",Ke),l.transform&&y.unbind(x.scrollWrap,"click",x),s&&y.unbind(window,W,x),clearTimeout(ce),C("unbindEvents"),Jt(x.currItem,null,!0,x.destroy))},destroy:function(){C("destroy"),Vt&&clearTimeout(Vt),m.setAttribute("aria-hidden","true"),m.className=ae,K&&clearInterval(K),y.unbind(x.scrollWrap,B,x),y.unbind(window,"scroll",x),Ct(),at(),Ue=null},panTo:function(e,t,n){n||(e>d.min.x?e=d.min.x:ed.min.y?t=d.min.y:td.min[e]||ad.min[e]&&(c=g.panEndFriction,d.min[e],n=d.min[e]-ke[e]),(n<=0||s<0)&&1pt.x&&(o=pt.x)):d.min.x!==d.max.x&&(i=a)):(ax.currItem.fitRatio&&(v[e]+=t[e]*c)},_t=function(e){var t;"mousedown"===e.type&&0=ct&&(Ce=0x.currItem.initialZoomLevel+x.currItem.initialZoomLevel/15&&(Se=!0),t=1,n=$e(),i=je(),e=ct&&(O.x-=c[0].x-dt.x),Math.abs(O.y)>=ct&&(O.y-=c[0].y-dt.y)),k.x=E.x,k.y=E.y,0!==O.x||0!==O.y)){if("v"===Ce&&g.closeOnVerticalDrag)if(!Tt())return Oe.y+=O.y,v.y+=O.y,o=Rt(),fe=!0,C("onVerticalDrag",o),T(o),void M();kt(D(),E.x,E.y),ge=!0,d=x.currItem.bounds,zt("x",O)||(zt("y",O),Xe(v),M())}}},Ht=function(e){if(l.isOldAndroid){if(he&&"mouseup"===e.type)return;-1x.currItem.fitRatio&&Wt(me))}},Yt=function(){var t,n,i={lastFlickOffset:{},lastFlickDist:{},lastFlickSpeed:{},slowDownRatio:{},slowDownRatioReverse:{},speedDecelerationRatio:{},speedDecelerationRatioAbs:{},distanceOffset:{},backAnimDestination:{},backAnimStarted:{},calculateSwipeSpeed:function(e){n=(1d.min[t]?i.backAnimDestination[t]=d.min[t]:v[t]=P()&&(p=g.loop?0:P()-1,o=!0),o&&!g.loop||(I+=i,Re-=i,n=!0));var n,i,o,e=b.x*Re,a=Math.abs(e-R.x),r=n||e>R.x==0The image could not be loaded.
',forceProgressiveLoading:!1,preload:[1,1],getNumItemsFn:function(){return Kt.length}},tn=function(){return{center:{x:0,y:0},max:{x:0,y:0},min:{x:0,y:0}}},nn=function(e,t,n){var i=e.bounds;i.center.x=Math.round((Z.x-t)/2),i.center.y=Math.round((Z.y-n)/2)+e.vGap.top,i.max.x=t>Z.x?Math.round(Z.x-t):i.center.x,i.max.y=n>Z.y?Math.round(Z.y-n)+e.vGap.top:i.center.y,i.min.x=t>Z.x?0:i.center.x,i.min.y=n>Z.y?e.vGap.top:i.center.y},on=function(e,t,n){var i,o;return!e.src||e.loadError?(e.w=e.h=0,e.initialZoomLevel=e.fitRatio=1,e.bounds=tn(),e.initialPosition=e.bounds.center,e.bounds):((i=!n)&&(e.vGap||(e.vGap={top:0,bottom:0}),C("parseVerticalMargin",e)),Z.x=t.x,Z.y=t.y-e.vGap.top-e.vGap.bottom,i&&(t=Z.x/e.w,o=Z.y/e.h,e.fitRatio=t
=d.max.x&&n<=d.min.y&&n>=d.max.y)&&e.preventDefault(),x.panTo(t,n)},toggleDesktopZoom:function(e){e=e||{x:w.x/2+Pe.x,y:w.y/2+Pe.y};var t=g.getDoubleTapZoom(!0,x.currItem),n=f===t;x.mouseZoomedIn=!n,x.zoomTo(n?x.currItem.initialZoomLevel:t,e,333),y[(n?"remove":"add")+"Class"](m,"pswp--zoomed-in")}}}),{history:!0,galleryUID:1}),Dn=function(){return L.hash.substring(1)},Tn=function(){dn&&clearTimeout(dn),pn&&clearTimeout(pn)},Mn=function(){var e=Dn(),t={};if(!(e.length<5)){var n,i=e.split("&");for(a=0;a"+e.label+"";if(g.parseShareButtonOut)l=g.parseShareButtonOut(e,l)}m.children[0].innerHTML=l,m.children[0].onclick=D}return!1},D=function(e){var t=(e=e||window.event).target||e.srcElement;if(o.shout("shareLinkClick",e,t),t.href){if(t.hasAttribute("download"))return!0;window.open(t.href,"pswp_share","scrollbars=yes,resizable=yes,toolbar=no,location=yes,width=550,height=420,top=100,left="+(window.screen?Math.round(screen.width/2-275):100)),I||K()}return!1},L=function(e){for(var t=0;tg.fitControlsWidth?(t=g.barsSize,g.captionEl&&"auto"===t.bottom?(p||((p=s.createEl("pswp__caption pswp__caption--fake")).appendChild(s.createEl("pswp__caption__center")),u.insertBefore(p,c),s.addClass(u,"pswp__ui--fit")),g.addCaptionHTMLFn(e,p,!0)?(e=p.clientHeight,n.bottom=parseInt(e,10)||44):n.bottom=t.top):n.bottom="auto"===t.bottom?0:t.bottom,n.top=t.top):n.top=n.bottom=0},M=[{name:"caption",option:"captionEl",onInit:function(e){c=e}},{name:"share-modal",option:"shareEl",onInit:function(e){m=e},onTap:function(){K()}},{name:"button--share",option:"shareEl",onInit:function(e){d=e},onTap:function(){K()}},{name:"button--zoom",option:"zoomEl",onTap:o.toggleDesktopZoom},{name:"counter",option:"counterEl",onInit:function(e){t=e}},{name:"button--close",option:"closeEl",onTap:o.close},{name:"button--arrow--left",option:"arrowEl",onTap:o.prev},{name:"button--arrow--right",option:"arrowEl",onTap:o.next},{name:"button--fs",option:"fullscreenEl",onTap:function(){a.isFullscreen()?a.exit():a.enter()}},{name:"preloader",option:"preloaderEl",onInit:function(e){n=e}}];C.init=function(){var t,l,r,i,e,n;s.extend(o.options,E,!0),g=o.options,u=s.getChildByClass(o.scrollWrap,"pswp__ui"),(f=o.listen)("onVerticalDrag",function(e){T&&e<.95?C.hideControls():!T&&.95<=e&&C.showControls()}),f("onPinchClose",function(e){T&&e<.9?(C.hideControls(),t=!0):t&&!T&&.9 middleValue)){
input.value=ghost.value;
}});
input.addEventListener("input", update);
ghost.addEventListener("input", update);
update();
}
wcpt__multirange.init=function(){
[].slice.call(document.querySelectorAll("input.wcpt-range-slider[type=range][multiple]:not(.wcpt__multirange)")).forEach(wcpt__multirange);
}
if(typeof module==="undefined"){
self.wcpt__multirange=wcpt__multirange;
if(document.readyState=="loading"){
document.addEventListener("DOMContentLoaded", wcpt__multirange.init);
}else{
wcpt__multirange.init();
}}else{
module.exports=wcpt__multirange;
}})();
jQuery((function($){var cart_button_selector=".wcpt-button-cart_ajax, .wcpt-button-cart_redirect, .wcpt-button-cart_refresh, .wcpt-button-cart_checkout";function get_device(){var device="laptop";return $(window).width()<=wcpt_params.breakpoints.phone?device="phone":$(window).width()<=wcpt_params.breakpoints.tablet&&(device="tablet"),device}function get_device_table($wcpt){var device=get_device(),table_selector=".wcpt-table-scroll-wrapper-outer.wcpt-device-laptop:visible > .wcpt-table-scroll-wrapper > .wcpt-table, .wcpt-table-scroll-wrapper-outer.wcpt-device-laptop:visible .frzTbl-table",$table;return"phone"!=device||$wcpt.find(table_selector.replace("laptop","phone")).length||(device="tablet"),"tablet"!=device||$wcpt.find(table_selector.replace("laptop","tablet")).length||(device="laptop"),$wcpt.find(table_selector.replace("laptop",device))}function htmlentity(string){return string.replace(/[\u00A0-\u9999<>\&]/gim,(function(i){return""+i.charCodeAt(0)+";"}))}window.wcpt_cache={data:{},remove:function(url){delete window.wcpt_cache.data[url]},exist:function(url){return window.wcpt_cache.data.hasOwnProperty(url)&&null!==window.wcpt_cache.data[url]},get:function(url){return window.wcpt_cache.data[url]},set:function(url,cachedData,callback){window.wcpt_cache.remove(url),window.wcpt_cache.data[url]=cachedData,$.isFunction(callback)&&callback(cachedData)}},window.wcpt_current_device=get_device(),$(window).on("resize",(function(){window.wcpt_cache.data={},window.wcpt_previous_device=window.wcpt_current_device,window.wcpt_current_device=get_device(),window.wcpt_previous_device!==window.wcpt_current_device&&$(window).trigger("wcpt_device_change",{previous_device:window.wcpt_previous_device,current_device:window.wcpt_current_device})})),window.wcpt_product_form={},$("body").on("click",".frzTbl .wcpt-heading.wcpt-sortable",(function(){var $this=$(this),$container=$this.closest(".wcpt"),$scrollOverlay,scrollLeft=$this.closest(".frzTbl-content-wrapper").siblings(".frzTbl-scroll-overlay")[0].scrollLeft;$("body").one("after_freeze_table_build","#"+$container.attr("id")+" .frzTbl-table",(function(e,frzTbl){frzTbl.el.$scrollOverlay[0].scrollLeft=scrollLeft}))})),$("body").on("wcpt_layout",".wcpt",(function layout(e,data){var $wcpt=$(this),$wrap=$wcpt.find(".wcpt-table-scroll-wrapper:visible"),$table=$wrap.find(".wcpt-table"),id=$wcpt.attr("data-wcpt-table-id");if($(">.wcpt-device-view-loading-icon",$wrap).length){var url=window.location.href,hash=window.location.hash,query_exists=-1!==url.indexOf("?"),query="",device=get_device(),replace;if(hash&&(url=url.replace(hash,"")),query_exists)re=new RegExp("&*"+id+"_device=(laptop|phone|tablet)","gm"),url=(url.replace(re,"")+"&"+id+"_device="+device).replace("?&","?");else url=url+"?"+id+"_device="+device;return hash&&(url+=hash),-1!==$wcpt.attr("data-wcpt-sc-attrs").indexOf("_only_loop")?void(window.location=url):(query=url.substr(url.indexOf("?")+1),hash&&(query=query.replace(hash,"")),void attempt_ajax($wcpt,query,!1,"device_view"))}$wrap.find(".wcpt-heading").each((function(){var $this=$(this);$this.find(".wcpt-sorting-icons").length&&$this.addClass("wcpt-sortable")}));var sc_attrs_string=$wcpt.attr("data-wcpt-sc-attrs"),sc_attrs=sc_attrs_string&&"{}"!==sc_attrs_string?JSON.parse(sc_attrs_string):{},options={left:sc_attrs.laptop_freeze_left?parseInt(sc_attrs.laptop_freeze_left):0,right:sc_attrs.laptop_freeze_right?parseInt(sc_attrs.laptop_freeze_right):0,heading:!!sc_attrs.laptop_freeze_heading&&"false"!==sc_attrs.laptop_freeze_heading,grab_and_scroll:!!sc_attrs.grab_and_scroll,wrapperWidth:sc_attrs.laptop_freeze_wrapper_width?parseInt(sc_attrs.laptop_freeze_wrapper_width):0,wrapperHeight:sc_attrs.laptop_freeze_wrapper_height?parseInt(sc_attrs.laptop_freeze_wrapper_height):0,tableWidth:sc_attrs.laptop_freeze_table_width?parseInt(sc_attrs.laptop_freeze_table_width):0,offset:sc_attrs.laptop_scroll_offset?sc_attrs.laptop_scroll_offset:0,breakpoint:{}},$table=get_device_table($wcpt);options.breakpoint[wcpt_params.breakpoints.tablet]={left:sc_attrs.tablet_freeze_left?parseInt(sc_attrs.tablet_freeze_left):0,right:sc_attrs.tablet_freeze_right?parseInt(sc_attrs.tablet_freeze_right):0,heading:!!sc_attrs.tablet_freeze_heading&&"false"!==sc_attrs.tablet_freeze_heading,wrapperWidth:sc_attrs.tablet_freeze_wrapper_width?parseInt(sc_attrs.tablet_freeze_wrapper_width):0,wrapperHeight:sc_attrs.tablet_freeze_wrapper_height?parseInt(sc_attrs.tablet_freeze_wrapper_height):0,tableWidth:sc_attrs.tablet_freeze_table_width?parseInt(sc_attrs.tablet_freeze_table_width):0,offset:sc_attrs.tablet_scroll_offset?parseInt(sc_attrs.tablet_scroll_offset):0},options.breakpoint[wcpt_params.breakpoints.phone]={left:sc_attrs.phone_freeze_left?parseInt(sc_attrs.phone_freeze_left):0,right:sc_attrs.phone_freeze_right?parseInt(sc_attrs.phone_freeze_right):0,heading:!!sc_attrs.phone_freeze_heading&&"false"!==sc_attrs.phone_freeze_heading,wrapperWidth:sc_attrs.phone_freeze_wrapper_width?parseInt(sc_attrs.phone_freeze_wrapper_width):0,wrapperHeight:sc_attrs.phone_freeze_wrapper_height?parseInt(sc_attrs.phone_freeze_wrapper_height):0,tableWidth:sc_attrs.phone_freeze_table_width?parseInt(sc_attrs.phone_freeze_table_width):0,offset:sc_attrs.phone_scroll_offset?parseInt(sc_attrs.phone_scroll_offset):0},$table.length&&"function"==typeof jQuery.fn.freezeTable&&$table.freezeTable(options);var device=get_device(),$sidebar=$(".wcpt-left-sidebar, .wcpt-was-left-sidebar",$wcpt).not(".wcpt-nav-modal .wcpt-navigation"),ft_reload_required=!1,$table,$rows;("laptop"==device&&$sidebar.hasClass("wcpt-was-left-sidebar")?($sidebar.removeClass("wcpt-header wcpt-was-left-sidebar").addClass("wcpt-left-sidebar"),ft_reload_required=!0):"laptop"==device||$sidebar.hasClass("wcpt-was-left-sidebar")||($sidebar.removeClass("wcpt-left-sidebar").addClass("wcpt-header wcpt-was-left-sidebar"),ft_reload_required=!0),ft_reload_required&&$table.data("freezeTable")&&$table.data("freezeTable").cell_resize(),($table=wcpt_get_container_original_table($wcpt)).data("wcpt_checked_rows")&&$table.data("wcpt_checked_rows").length)&&$(".wcpt-row",$table).each((function(){var $this=$(this),state=!!$this.data("wcpt_checked");$this.trigger("_wcpt_checkbox_change",state)}))}));var resize_timer,throttle=250,window_width;function window_resize(e){clearTimeout(resize_timer);var new_window_width=window.innerWidth;new_window_width!=window_width&&(window_width=new_window_width,resize_timer=setTimeout((function(){trigger_layout("resize"),recent_orientationchange=!1}),250))}$(window).on("resize",window_resize);var recent_orientationchange=!1;function trigger_layout(source){$(".wcpt").trigger("wcpt_layout",{source:source})}function after_every_load($container){$container.find(".wcpt").length&&$container.find(".wcpt").each((function(){var $this;after_every_load($(this))})),$container.on("click.wcpt",".wcpt-heading.wcpt-sortable",window.wcpt_column_heading_sort_handler);var sc_attrs={},sc_attrs_attr=$container.attr("data-wcpt-sc-attrs"),$tables;sc_attrs_attr&&-1==$.inArray(sc_attrs_attr,["[]","{}"])&&(sc_attrs=JSON.parse(sc_attrs_attr)),$container.data("wcpt_sc_attrs",sc_attrs),$(".cart",$container).each((function(){$(this).attr("action",window.location.href)})),"undefined"!=typeof wcpt_wc_mc_init_cart&&($(".cart",$container).each(wcpt_wc_mc_init_cart),$(".wc-measurement-price-calculator-input-help",$container).tipTip({attribute:"title",defaultPosition:"left"})),"undefined"!=typeof wcpt_sfsi_init&&wcpt_sfsi_init(),prep_variation_options($container),duplicate_select_all($container),dynamic_filters_lazy_load($container),wcpt_get_container_tables($container).each((function(){var $table=$(this),$heading_row=wcpt_get_table_element(".wcpt-heading-row",$table),$cb=wcpt_get_table_element(".wcpt-cart-checkbox[data-wcpt-heading-enabled]",$table),col_index=[];$cb.each((function(){var $this,_col_index=$(this).closest(".wcpt-cell").index();-1==col_index.indexOf(_col_index)&&col_index.push(_col_index)})),$.each(col_index,(function(key,index){var $heading=$("th",$heading_row).eq(index);$heading_row.removeClass("wcpt-hide"),$(".wcpt-cart-checkbox-heading",$heading).length||$heading.prepend('')}))})),wcpt_checkbox_trigger_init();var $device_table=get_device_table($container),$add_selected=$(".wcpt-add-selected",$container);sc_attrs.checked_row_background_color&&$("style",$container).first().append("#"+$container.attr("id")+" .wcpt-row--checked, #"+$container.attr("id")+" .wcpt-row--checked + .wcpt-child-row {background: "+sc_attrs.checked_row_background_color+"! important;}"),$(".wcpt-range-slider",$container).each((function(){wcpt__multirange(this)}));var query_string,parsed=parse_query_string(($container.attr("data-wcpt-query-string")?$container.attr("data-wcpt-query-string"):"").substring(1)),table_id=$container.attr("data-wcpt-table-id"),permit_reset=!1,$reset=$(".wcpt-reset",$container);if($reset.length&&($.each(parsed,(function(key,val){-1==$.inArray(key,[table_id+"_device",table_id+"_filtered"])&&(permit_reset=!0)})),permit_reset?$reset.removeClass("wcpt-disabled"):$reset.addClass("wcpt-disabled")),"function"==typeof wooscpGetCookie&&"object"==typeof wooscpVars){var compare_items__string=wooscpGetCookie("wooscp_products_"+wooscpVars.user_id),compare_items;if(compare_items__string)compare_items__string.split(",").forEach((function(item){$(".wooscp-btn-"+item,$container).each((function(){var $this=$(this);$this.addClass("wooscp-btn-added"),$this.text(wooscpVars.button_text_added)}))}))}nav_filter_feedback($container.find(".wcpt-navigation")),sonaar_player_auto_status(),hide_empty_columns($container),$container.trigger("wcpt_after_every_load"),window.wcpt_cart_result_cache&&wcpt_cart({payload:{use_cache:!0}}),$container.trigger("wcpt_layout",{source:"after_every_load"})}function wcpt_get_container_tables($container){return wcpt_get_shell_element(".wcpt-table:not(.frzTbl-clone-table)",".wcpt",$container)}function wcpt_get_container_element(element_selector,$container){return wcpt_get_shell_element(element_selector,".wcpt",$container)}function wcpt_get_table_element(element_selector,$table){return wcpt_get_shell_element(element_selector,".wcpt-table:not(.frzTbl-clone-table)",$table)}function wcpt_get_shell_element(element_selector,shell_selector,$shell){return $(element_selector,$shell).filter((function(){var $this;return $(this).closest(shell_selector).is($shell)}))}function hide_empty_columns($container){var _sc_attrs=$container.attr("data-wcpt-sc-attrs"),sc_attrs;if((_sc_attrs&&"{}"!==_sc_attrs?JSON.parse(_sc_attrs):{}).hide_empty_columns){var $table=wcpt_get_container_original_table($container);$(".wcpt-cell",$table).removeClass("wcpt-hide"),$table.each((function(){for(var column_count=$table.find(".wcpt-row").eq(0).children().length;column_count;){var column_cells=$table.find(".wcpt-cell:nth-child("+column_count+")"),empty_column_cells=$table.find(".wcpt-cell:nth-child("+column_count+")").filter(":empty");column_cells.length==empty_column_cells.length&&column_cells.add($table.find(".wcpt-heading:nth-child("+column_count+")")).addClass("wcpt-hide"),--column_count}}))}}function lazy_load_start(){window.wcpt_lazy_loaded||($(".wcpt-lazy-load").each((function(){var $this=$(this);attempt_ajax($(this),!1,!1,"lazy_load")})),window.wcpt_lazy_loaded=!0)}function get_product_rows($elm){var $row=$elm.closest(".wcpt-row"),product_id=$row.attr("data-wcpt-product-id"),variation_id=$row.attr("data-wcpt-variation-id"),$scroll_wrapper=$elm.closest(".wcpt-table-scroll-wrapper"),row_selector;return $(row_selector=variation_id?'[data-wcpt-variation-id="'+variation_id+'"].wcpt-row.wcpt-product-type-variation':'[data-wcpt-product-id="'+product_id+'"].wcpt-row:not(.wcpt-product-type-variation)',$scroll_wrapper)}function button_click(e){var $button=$(this),link_code=$button.attr("data-wcpt-link-code"),$product_rows=get_product_rows($button),product_id=$product_rows.attr("data-wcpt-product-id"),is_variable=$product_rows.hasClass("wcpt-product-type-variable"),complete_match=$product_rows.data("wcpt_complete_match"),is_variation=$product_rows.hasClass("wcpt-product-type-variation"),is_composite=$product_rows.hasClass("wcpt-product-type-composite"),is_bundle=$product_rows.hasClass("wcpt-product-type-woosb"),has_addons=$product_rows.hasClass("wcpt-product-has-addons"),has_measurement=$product_rows.hasClass("wcpt-product-has-measurement"),has_nyp=$product_rows.hasClass("wcpt-product-has-name-your-price"),qty="",params={payload:{products:{},variations:{},attributes:{},addons:{},measurement:{},nyp:{}}};if($("body").hasClass("wcpt-photoswipe-visible"))e.preventDefault();else if(-1===$.inArray(link_code,["product_link","external_link","custom_field","custom_field_media_id","custom_field_acf","custom"])){if(e.preventDefault(),is_variable){var variation_found=$product_rows.data("wcpt_variation_found"),variation_selected=$product_rows.data("wcpt_variation_selected"),variation_available=$product_rows.data("wcpt_variation_available");if(variation_ops=$product_rows.data("wcpt_variation_ops"),variation_ops){if(!variation_selected)return void alert(wcpt_i18n.i18n_make_a_selection_text);if(!variation_found)return void alert(wcpt_i18n.i18n_no_matching_variations_text);if(!variation_available)return void alert(wcpt_i18n.i18n_unavailable_text)}}if(is_variable||!$button.hasClass("wcpt-disabled")){if(has_nyp){var $nyp=get_nyp_input_element($product_rows);if($nyp.length){var error=!1,name=$nyp.attr("data-wcpt-product-name"),min=$nyp.attr("min"),max=$nyp.attr("max");if($nyp.val()?min&&$nyp.val()parseFloat(max)&&(error=wcpt_nyp_error_message_templates.maximum_js.replace("%%MAXIMUM%%",woocommerce_nyp_format_price(max,woocommerce_nyp_params.currency_format_symbol,!0))):error=wcpt_nyp_error_message_templates.empty,error)return void alert(error)}}var $wcpt_qty=$(".wcpt-quantity input.qty, .wcpt-quantity > select.wcpt-qty-select",$product_rows),$wc_qty=$(".cart .qty",$product_rows),nyp;if($wc_qty.length&&(qty=$wc_qty.val()),$wcpt_qty.length){var val=parseFloat($wcpt_qty.val());!isNaN(val)&&parseFloat($wcpt_qty.val())||$wcpt_qty.filter("input").first().each((function(){var $this=$(this),min=$this.attr("data-wcpt-min");$this.val(min),limit_qty_controller($this.parent("wcpt-quantity")),val=$this.val()})),qty=val}if(params.payload.products[product_id]=qty,has_addons){var addons=wcpt_get_addons($product_rows);$.isEmptyObject(addons)||(params.payload.addons[product_id]=addons)}if(has_measurement){var measurement=get_measurement($product_rows);$.isEmptyObject(measurement)||(params.payload.measurement[product_id]=measurement)}if(has_nyp)(nyp=get_nyp($product_rows))&&(params.payload.nyp[product_id]=nyp);if(is_variation){var variation_id=$product_rows.attr("data-wcpt-variation-id"),variation_attributes=JSON.parse($product_rows.attr("data-wcpt-variation-attributes")),$missing_attribute_select=$(".wcpt-select-variation-attribute-term",$product_rows);$missing_attribute_select.length&&$missing_attribute_select.each((function(){var $this=$(this),attribute=$this.attr("data-wcpt-attribute"),term=$this.val();term&&(variation_attributes[attribute]=term)})),void 0===params.payload.variations[product_id]&&(params.payload.variations[product_id]={}),params.payload.variations[product_id][variation_id]=qty,params.payload.attributes[variation_id]=variation_attributes}else if($product_rows.hasClass("wcpt-product-type-variable")){var variation_id=$product_rows.data("wcpt_variation_id"),variation_attributes=$product_rows.data("wcpt_attributes");variation_id&&(void 0===params.payload.variations[product_id]&&(params.payload.variations[product_id]={}),params.payload.variations[product_id][variation_id]=qty),variation_attributes&&(params.payload.attributes[variation_id]=variation_attributes)}var ajax_data={action:"wcpt_add_to_cart","add-to-cart":$product_rows.attr("data-wcpt-product-id"),product_id:product_id,quantity:qty},nyp;if(has_addons&&($.isEmptyObject(addons)||$.extend(ajax_data,addons)),has_measurement){var measurement=get_measurement($product_rows);$.isEmptyObject(measurement)||$.extend(ajax_data,measurement)}if(has_nyp)(nyp=get_nyp($product_rows))&&(ajax_data.nyp=nyp);if((is_variable||is_variation)&&(variation_id&&(ajax_data.variation_id=variation_id),variation_attributes&&$.extend(ajax_data,variation_attributes)),ajax_data.return_notice="cart_ajax"==link_code,is_composite||is_bundle||is_variable&&!complete_match||is_variation&&is_incomplete_variation(variation_attributes)||has_addons&&!params.payload.addons[product_id]||has_measurement&&!params.payload.measurement[product_id]||has_nyp&&!params.payload.nyp[product_id])return void 0!==window.wcpt_product_form[product_id]?deploy_product_form_modal(window.wcpt_product_form[product_id],$button,ajax_data):(ajax_data.action="wcpt_get_product_form_modal",ajax_data.lang=wcpt_i18n.lang,delete ajax_data["add-to-cart"],$.ajax({url:wcpt_params.wc_ajax_url.replace("%%endpoint%%","wcpt_get_product_form_modal"),method:"POST",beforeSend:function(){window.wcpt_modal__last_requested_product_id=product_id,deploy_loading_modal()},data:ajax_data}).done((function(response){window.wcpt_product_form[product_id]=response,product_id===window.wcpt_modal__last_requested_product_id&&($(".wcpt-product-form-loading-modal").trigger("wcpt_close"),deploy_product_form_modal(response,$button,ajax_data))}))),!1;"cart_ajax"==link_code?wcpt_cart(params):submit_via_post($button.attr("href"),ajax_data)}}}function deploy_product_form_modal(markup,$button,ajax_data){var $modal=$(markup);$modal.appendTo("body"),$("body").addClass("wcpt-modal-on"),prep_product_form($modal,$button,ajax_data),$("body").trigger("wcpt_product_modal_ready")}function deploy_loading_modal(){var $loading_modal=$($("#tmpl-wcpt-product-form-loading-modal").html());$("body").append($loading_modal),$loading_modal.on("wcpt_close",(function(){$loading_modal.remove()}))}function is_incomplete_variation(variation_attributes){var is_incomplete_variation=!1;return $.each(variation_attributes,(function(key,value){if(!value)return is_incomplete_variation=!0,!1})),is_incomplete_variation}function submit_via_post(href,data){var $form=$('');$.each(data,(function(key,val){if("action"!=key){var $input=$('');$input.val(val),$form.append($input)}})),$form.append(''),$form.appendTo($("body")).submit()}function prep_product_form($modal,$button,pre_select){var link_code=$button.attr("data-wcpt-link-code"),href="cart_ajax"==link_code?"":$button.attr("href");$modal.on("wcpt_close",(function(){$modal.remove(),$("body").removeClass("wcpt-modal-on")})),$(".cart",$modal).each((function(){var $form=$(this),$rows;$form.hasClass("variations_form")?$form.wc_variation_form():$form.append(''),$.fn.init_addon_totals&&$form.init_addon_totals(),"object"==typeof wcPaoInitAddonTotals&&wcPaoInitAddonTotals.init($form),"undefined"!=typeof wcpt_wc_mc_init_cart&&$form.each(wcpt_wc_mc_init_cart),void 0!==jQuery.fn.wc_nyp_form&&$form.wc_nyp_form(),$form.attr("action",href),$(".qty",$form).attr("autocomplete","off"),pre_select&&$.each(pre_select,(function(key,val){var $control=$form.find("[name="+key+"]");if($control.is("input.qty")){val=parseFloat(val);var min=$control.attr("min")?parseFloat($control.attr("min")):0,max=!!$control.attr("max")&&parseFloat($control.attr("max"));(valmax&&(val=max)}$control.val(val)})),pre_select.quantity&&$form.one("show_variation",(function(){var $form_qty=$(".qty",$form),min=$form_qty.attr("min"),max=$form_qty.attr("max");(!min||min<=pre_select.quantity)&&(!max||max>=pre_select.quantity)&&$form_qty.val(pre_select.quantity)})),"cart_ajax"==link_code&&$form.on("submit",(function(e){e.preventDefault();var external_payload={};$.each($form.serializeArray(),(function(i,field){void 0===external_payload[field.name]?external_payload[field.name]=field.value:("object"!=typeof external_payload[field.name]&&(external_payload[field.name]=[external_payload[field.name]]),external_payload[field.name].push(field.value))})),wcpt_cart({external_payload:external_payload,payload:{variation_form:!0}}),$modal.trigger("wcpt_close")})),wcpt_get_sibling_rows($button.closest(".wcpt-row")).find(".qty[data-wcpt-return-to-initial=1]").val(0).first().trigger("change")}))}function disable_button($button,add_condition){add_condition&&$button.addClass(add_condition),$button.addClass("wcpt-disabled")}function enable_button($button,clear_condition){clear_condition&&$button.removeClass(clear_condition),$button.hasClass("wcpt-all-variations-out-of-stock")||$button.hasClass("wcpt-variation-out-of-stock")||$button.hasClass("wcpt-no-variation-selected")||$button.hasClass("wcpt-quantity-input-error")||$button.hasClass("wcpt-out-of-stock")||$button.removeClass("wcpt-disabled")}function loading_badge_on_button($button){if(disable_button($button),!$button.find(".wcpt-cart-badge-refresh").length){var svg='';$button.append(''+svg+"")}}function add_count_badge_to_button(in_cart,$button){parseFloat(in_cart)?($button.find(".wcpt-cart-badge-number").length?$button.find(".wcpt-cart-badge-number").html(in_cart):$button.append(''+in_cart+""),$button.find(".wcpt-cart-badge-refresh").length&&$button.find(".wcpt-cart-badge-refresh").remove()):$(".wcpt-cart-badge-number, .wcpt-cart-badge-refresh",$button).remove()}function search_submit(e){var $this=$(this),$search=$this.closest(".wcpt-search"),$input=$search.find(".wcpt-search-input"),table_id=$search.attr("data-wcpt-table-id"),$container=$("#wcpt-"+table_id),$nav_modal=$this.closest(".wcpt-nav-modal"),$nav=$this.closest(".wcpt-navigation"),keyword=$input.val().trim();if(query=$input.attr("name")+"="+keyword,$wrapper=$input.closest(".wcpt-search-wrapper"),append=!$wrapper.hasClass("wcpt-search--reset-others"),$(e.target).closest(".wcpt-search-submit").length&&"click"==e.type||$(e.target).is(".wcpt-search-input")&&"keydown"==e.type&&(13==e.keyCode||13==e.which)){if($nav_modal.length)return void $(".wcpt-nm-apply").click();append?$nav.trigger("change"):attempt_ajax($container,query,append,"filter"),$nav_modal.length&&$nav_modal.trigger("wcpt_close")}}$(window).on("orientationchange",(function(e){recent_orientationchange=!0})),lazy_load_start(),$("body").on("click",".wcpt-button",button_click),$("body").on("click",".wcpt-search-submit",search_submit),$("body").on("keydown",".wcpt-search-input",search_submit),$("body").on("click",".wcpt-search-clear",(function(e){var $this=$(this),$search=$this.closest(".wcpt-search"),$input=$search.find(".wcpt-search-input"),table_id=$search.attr("data-wcpt-table-id"),$container=$("#wcpt-"+table_id),$nav_modal=$this.closest(".wcpt-nav-modal"),query="&"+$input.attr("name")+"=",append=!0;$input.val(""),$nav_modal.length?$(".wcpt-nm-apply").click():(attempt_ajax($container,query,!0,"filter"),$nav_modal.length&&$nav_modal.trigger("wcpt_close"))})),"laptop"!==wcpt_params.initial_device&&$("body").on("click",".wcpt-button[download]",(function(e){e.preventDefault();var $this,url=$(this).attr("href");url&&window.open(url,"_blank",!1)})),window.wcpt_global_tooltip_trigger_mode="hover",$(window).on("touchstart",(function(){window.wcpt_global_tooltip_trigger_mode="click"})),$(window).on("resize",(function(){window.wcpt_global_tooltip_trigger_mode="hover"}));var target_selector=".wcpt-dropdown, .wcpt-tooltip",$body=$("body");function dropdown_mouse_open(e){var $this=$(this);if(!$this.hasClass("wcpt-tooltip--open-on-click")&&"click"!=wcpt_global_tooltip_trigger_mode)if($this.hasClass("wcpt-tooltip--hover-intent-enabled")){var clear_timeout=setTimeout((function(){$this.addClass("wcpt-open"),fix_tooltip_position($this)}),100);$this.data("wcpt_hover_intent_clear_timeout",clear_timeout)}else $this.addClass("wcpt-open"),fix_tooltip_position($this)}function dropdown_mouse_close(e){var $this=$(this);if(!$this.hasClass("wcpt-tooltip--open-on-click")&&"click"!=wcpt_global_tooltip_trigger_mode){if($this.hasClass("wcpt-tooltip--hover-intent-enabled")){var clear_timeout=$this.data("wcpt_hover_intent_clear_timeout");clear_timeout&&clearTimeout(clear_timeout)}$this.removeClass("wcpt-open")}}function dropdown_touch_toggle(e){var $target=$(e.target),container_selector=".wcpt-dropdown, .wcpt-tooltip",content_selector="> .wcpt-dropdown-menu, > .wcpt-tooltip-content-wrapper > .wcpt-tooltip-content",$dropdown=$target.closest(container_selector),$content=$dropdown.find(content_selector),$body=$("body");if(!$dropdown.length||"hover"!=wcpt_global_tooltip_trigger_mode||$dropdown.hasClass("wcpt-tooltip--open-on-click"))if($dropdown.length){if($dropdown.length)if($target.closest($content).length);else{var $parents=$dropdown.parents(container_selector);$body.find(container_selector).not($dropdown.add($parents)).removeClass("wcpt-open"),$dropdown.toggleClass("wcpt-open"),$dropdown.hasClass("wcpt-open")||$dropdown.find(container_selector).removeClass("wcpt-open"),$dropdown.hasClass("wcpt-tooltip--popup-enabled")&&($dropdown.hasClass("wcpt-open")?$body.addClass("wcpt-tooltip-popup-displayed"):$body.removeClass("wcpt-tooltip-popup-displayed"))}fix_tooltip_position($dropdown)}else $body.find(container_selector).removeClass("wcpt-open")}function fix_tooltip_position($tooltip){var $content=$tooltip.find(" > .wcpt-dropdown-menu, > .wcpt-tooltip-content-wrapper > .wcpt-tooltip-content"),content_width=$content.outerWidth(!1),offset_left=$content.offset().left,page_width=$(window).width();if($tooltip.hasClass("wcpt-tooltip")){var $container,margin;$content.css("max-width",""),$tooltip.hasClass("wcpt-tooltip--popup-enabled")?($container=$("body"),margin=40):($container=$tooltip.closest(".wcpt-table-scroll-wrapper-outer").length?$tooltip.closest(".wcpt-table-scroll-wrapper-outer"):$tooltip.closest(".wcpt-navigation"),margin=20);var container_rect=$.extend({},$container[0].getBoundingClientRect()),content_rect=$content[0].getBoundingClientRect(),$freezeTable=$(".frzTbl-table",$container);if($content.closest($freezeTable).length){var $left_freeze_column=$freezeTable.data("freezeTable").el.$frozenColumnsLeft,$right_freeze_column=$freezeTable.data("freezeTable").el.$frozenColumnsRight;container_rect.left+=$left_freeze_column.width(),container_rect.right-=$right_freeze_column.width(),container_rect.width=container_rect.width-$left_freeze_column.width()-$right_freeze_column.width()}container_rect.width(limit=content_wrapper_width/2-20)&&(left=limit),$content.css("left",left)}else if(content_rect.right+15>container_rect.right){var right=content_rect.right-container_rect.right+15,limit;right>(limit=content_wrapper_width/2-20)&&(right=limit),$content.css("right",right)}}else{if(content_width+30>page_width){$content.outerWidth(page_width-30);var content_width=$content.outerWidth(!1)}if($content.offset().left+content_width>page_width){var offset_required=$content.offset().left+content_width-page_width;$content.css("left","-="+(offset_required+15))}else $content.offset().left<0&&$content.css("left",Math.abs($content.offset().left-15))}if($tooltip.hasClass("wcpt-tooltip")){var $label=$tooltip.find("> .wcpt-tooltip-label"),offset_left=$label.offset().left,width=$label.outerWidth(),$arrow;$("> .wcpt-tooltip-arrow",$content).css("left",offset_left-$content.offset().left+width/2+"px")}}function apply_nav(e){var $target=$(e.target),$container,$nav=($container=$target.closest(".wcpt")).find(".wcpt-navigation");if(!$target.closest(".wcpt-search-filter-options").length){if($target.closest(".wcpt-hierarchy").length){var checked=$target.prop("checked");if($target.hasClass("wcpt-hr-parent-term")){var ct_selector="input[type=checkbox], input[type=radio]",$child_terms;$target.closest("label").siblings(".wcpt-hr-child-terms-wrapper").find(ct_selector).prop("checked",!1)}var $ancestors=$target.parents(".wcpt-hr-child-terms-wrapper");$ancestors.length&&$ancestors.each((function(){var $parent_term;$(this).siblings("label").find(".wcpt-hr-parent-term").prop("checked",!1)}))}if($target.closest(".wcpt-range-filter")){if($target.hasClass("wcpt-range-input-min")||$target.hasClass("wcpt-range-input-max")||$target.hasClass("wcpt-range-slider"))return;var min=$target.attr("data-wcpt-range-min")||"",max=$target.attr("data-wcpt-range-max")||"",$range_filter=$target.closest(".wcpt-range-filter"),$min=$range_filter.find(".wcpt-range-input-min"),$max=$range_filter.find(".wcpt-range-input-max"),$range_slider=$range_filter.find(".wcpt-range-slider.original");$min.val(min),$max.val(max),min||(min=$range_slider.attr("min")),max||(max=$range_slider.attr("max")),$range_slider.val(min+","+max)}if(!$target.closest(".wcpt-search").length&&!$target.closest(".wcpt-nav-modal").length){var $this=$(this),$nav,$container,table_id=($container=($nav=$this.add($this.siblings(".wcpt-navigation"))).closest(".wcpt")).attr("id").substring(5),$nav_clone=$nav.clone();nav_clone_operations($nav_clone);var query=$("