var pJS=function(tag_id, params){
var canvas_el=document.querySelector('#'+tag_id+' > .particles-js-canvas-el');
this.pJS={
canvas: {
el: canvas_el,
w: canvas_el.offsetWidth,
h: canvas_el.offsetHeight
},
particles: {
number: {
value: 400,
density: {
enable: true,
value_area: 800
}},
color: {
value: '#fff'
},
shape: {
type: 'circle',
stroke: {
width: 0,
color: '#ff0000'
},
polygon: {
nb_sides: 5
},
image: {
src: '',
width: 100,
height: 100
}},
opacity: {
value: 1,
random: false,
anim: {
enable: false,
speed: 2,
opacity_min: 0,
sync: false
}},
size: {
value: 20,
random: false,
anim: {
enable: false,
speed: 20,
size_min: 0,
sync: false
}},
line_linked: {
enable: true,
distance: 100,
color: '#fff',
opacity: 1,
width: 1
},
move: {
enable: true,
speed: 2,
direction: 'none',
random: false,
straight: false,
out_mode: 'out',
bounce: false,
attract: {
enable: false,
rotateX: 3000,
rotateY: 3000
}},
array: []
},
interactivity: {
detect_on: 'canvas',
events: {
onhover: {
enable: true,
mode: 'grab'
},
onclick: {
enable: true,
mode: 'push'
},
resize: true
},
modes: {
grab:{
distance: 100,
line_linked:{
opacity: 1
}},
bubble:{
distance: 200,
size: 80,
duration: 0.4
},
repulse:{
distance: 200,
duration: 0.4
},
push:{
particles_nb: 4
},
remove:{
particles_nb: 2
}},
mouse:{}},
retina_detect: false,
fn: {
interact: {},
modes: {},
vendors:{}},
tmp: {}};
var pJS=this.pJS;
if(params){
Object.deepExtend(pJS, params);
}
pJS.tmp.obj={
size_value: pJS.particles.size.value,
size_anim_speed: pJS.particles.size.anim.speed,
move_speed: pJS.particles.move.speed,
line_linked_distance: pJS.particles.line_linked.distance,
line_linked_width: pJS.particles.line_linked.width,
mode_grab_distance: pJS.interactivity.modes.grab.distance,
mode_bubble_distance: pJS.interactivity.modes.bubble.distance,
mode_bubble_size: pJS.interactivity.modes.bubble.size,
mode_repulse_distance: pJS.interactivity.modes.repulse.distance
};
pJS.fn.retinaInit=function(){
if(pJS.retina_detect&&window.devicePixelRatio > 1){
pJS.canvas.pxratio=window.devicePixelRatio;
pJS.tmp.retina=true;
}else{
pJS.canvas.pxratio=1;
pJS.tmp.retina=false;
}
pJS.canvas.w=pJS.canvas.el.offsetWidth * pJS.canvas.pxratio;
pJS.canvas.h=pJS.canvas.el.offsetHeight * pJS.canvas.pxratio;
pJS.particles.size.value=pJS.tmp.obj.size_value * pJS.canvas.pxratio;
pJS.particles.size.anim.speed=pJS.tmp.obj.size_anim_speed * pJS.canvas.pxratio;
pJS.particles.move.speed=pJS.tmp.obj.move_speed * pJS.canvas.pxratio;
pJS.particles.line_linked.distance=pJS.tmp.obj.line_linked_distance * pJS.canvas.pxratio;
pJS.interactivity.modes.grab.distance=pJS.tmp.obj.mode_grab_distance * pJS.canvas.pxratio;
pJS.interactivity.modes.bubble.distance=pJS.tmp.obj.mode_bubble_distance * pJS.canvas.pxratio;
pJS.particles.line_linked.width=pJS.tmp.obj.line_linked_width * pJS.canvas.pxratio;
pJS.interactivity.modes.bubble.size=pJS.tmp.obj.mode_bubble_size * pJS.canvas.pxratio;
pJS.interactivity.modes.repulse.distance=pJS.tmp.obj.mode_repulse_distance * pJS.canvas.pxratio;
};
pJS.fn.canvasInit=function(){
pJS.canvas.ctx=pJS.canvas.el.getContext('2d');
};
pJS.fn.canvasSize=function(){
pJS.canvas.el.width=pJS.canvas.w;
pJS.canvas.el.height=pJS.canvas.h;
if(pJS&&pJS.interactivity.events.resize){
window.addEventListener('resize', function(){
pJS.canvas.w=pJS.canvas.el.offsetWidth;
pJS.canvas.h=pJS.canvas.el.offsetHeight;
if(pJS.tmp.retina){
pJS.canvas.w *=pJS.canvas.pxratio;
pJS.canvas.h *=pJS.canvas.pxratio;
}
pJS.canvas.el.width=pJS.canvas.w;
pJS.canvas.el.height=pJS.canvas.h;
if(!pJS.particles.move.enable){
pJS.fn.particlesEmpty();
pJS.fn.particlesCreate();
pJS.fn.particlesDraw();
pJS.fn.vendors.densityAutoParticles();
}
pJS.fn.vendors.densityAutoParticles();
});
}};
pJS.fn.canvasPaint=function(){
pJS.canvas.ctx.fillRect(0, 0, pJS.canvas.w, pJS.canvas.h);
};
pJS.fn.canvasClear=function(){
pJS.canvas.ctx.clearRect(0, 0, pJS.canvas.w, pJS.canvas.h);
};
pJS.fn.particle=function(color, opacity, position){
this.radius=(pJS.particles.size.random ? Math.random():1) * pJS.particles.size.value;
if(pJS.particles.size.anim.enable){
this.size_status=false;
this.vs=pJS.particles.size.anim.speed / 100;
if(!pJS.particles.size.anim.sync){
this.vs=this.vs * Math.random();
}}
this.x=position ? position.x:Math.random() * pJS.canvas.w;
this.y=position ? position.y:Math.random() * pJS.canvas.h;
if(this.x > pJS.canvas.w - this.radius*2) this.x=this.x - this.radius;
else if(this.x < this.radius*2) this.x=this.x + this.radius;
if(this.y > pJS.canvas.h - this.radius*2) this.y=this.y - this.radius;
else if(this.y < this.radius*2) this.y=this.y + this.radius;
if(pJS.particles.move.bounce){
pJS.fn.vendors.checkOverlap(this, position);
}
this.color={};
if(typeof(color.value)=='object'){
if(color.value instanceof Array){
var color_selected=color.value[Math.floor(Math.random() * pJS.particles.color.value.length)];
this.color.rgb=hexToRgb(color_selected);
}else{
if(color.value.r!=undefined&&color.value.g!=undefined&&color.value.b!=undefined){
this.color.rgb={
r: color.value.r,
g: color.value.g,
b: color.value.b
}}
if(color.value.h!=undefined&&color.value.s!=undefined&&color.value.l!=undefined){
this.color.hsl={
h: color.value.h,
s: color.value.s,
l: color.value.l
}}
}}
else if(color.value=='random'){
this.color.rgb={
r: (Math.floor(Math.random() * (255 - 0 + 1)) + 0),
g: (Math.floor(Math.random() * (255 - 0 + 1)) + 0),
b: (Math.floor(Math.random() * (255 - 0 + 1)) + 0)
}}
else if(typeof(color.value)=='string'){
this.color=color;
this.color.rgb=hexToRgb(this.color.value);
}
this.opacity=(pJS.particles.opacity.random ? Math.random():1) * pJS.particles.opacity.value;
if(pJS.particles.opacity.anim.enable){
this.opacity_status=false;
this.vo=pJS.particles.opacity.anim.speed / 100;
if(!pJS.particles.opacity.anim.sync){
this.vo=this.vo * Math.random();
}}
var velbase={}
switch(pJS.particles.move.direction){
case 'top':
velbase={ x:0, y:-1 };
break;
case 'top-right':
velbase={ x:0.5, y:-0.5 };
break;
case 'right':
velbase={ x:1, y:-0 };
break;
case 'bottom-right':
velbase={ x:0.5, y:0.5 };
break;
case 'bottom':
velbase={ x:0, y:1 };
break;
case 'bottom-left':
velbase={ x:-0.5, y:1 };
break;
case 'left':
velbase={ x:-1, y:0 };
break;
case 'top-left':
velbase={ x:-0.5, y:-0.5 };
break;
default:
velbase={ x:0, y:0 };
break;
}
if(pJS.particles.move.straight){
this.vx=velbase.x;
this.vy=velbase.y;
if(pJS.particles.move.random){
this.vx=this.vx * (Math.random());
this.vy=this.vy * (Math.random());
}}else{
this.vx=velbase.x + Math.random()-0.5;
this.vy=velbase.y + Math.random()-0.5;
}
this.vx_i=this.vx;
this.vy_i=this.vy;
var shape_type=pJS.particles.shape.type;
if(typeof(shape_type)=='object'){
if(shape_type instanceof Array){
var shape_selected=shape_type[Math.floor(Math.random() * shape_type.length)];
this.shape=shape_selected;
}}else{
this.shape=shape_type;
}
if(this.shape=='image'){
var sh=pJS.particles.shape;
this.img={
src: sh.image.src,
ratio: sh.image.width / sh.image.height
}
if(!this.img.ratio) this.img.ratio=1;
if(pJS.tmp.img_type=='svg'&&pJS.tmp.source_svg!=undefined){
pJS.fn.vendors.createSvgImg(this);
if(pJS.tmp.pushing){
this.img.loaded=false;
}}
}};
pJS.fn.particle.prototype.draw=function(){
var p=this;
if(p.radius_bubble!=undefined){
var radius=p.radius_bubble;
}else{
var radius=p.radius;
}
if(p.opacity_bubble!=undefined){
var opacity=p.opacity_bubble;
}else{
var opacity=p.opacity;
}
if(p.color.rgb){
var color_value='rgba('+p.color.rgb.r+','+p.color.rgb.g+','+p.color.rgb.b+','+opacity+')';
}else{
var color_value='hsla('+p.color.hsl.h+','+p.color.hsl.s+'%,'+p.color.hsl.l+'%,'+opacity+')';
}
pJS.canvas.ctx.fillStyle=color_value;
pJS.canvas.ctx.beginPath();
switch(p.shape){
case 'circle':
pJS.canvas.ctx.arc(p.x, p.y, radius, 0, Math.PI * 2, false);
break;
case 'edge':
pJS.canvas.ctx.rect(p.x-radius, p.y-radius, radius*2, radius*2);
break;
case 'triangle':
pJS.fn.vendors.drawShape(pJS.canvas.ctx, p.x-radius, p.y+radius / 1.66, radius*2, 3, 2);
break;
case 'polygon':
pJS.fn.vendors.drawShape(pJS.canvas.ctx,
p.x - radius / (pJS.particles.shape.polygon.nb_sides/3.5),
p.y - radius / (2.66/3.5),
radius*2.66 / (pJS.particles.shape.polygon.nb_sides/3),
pJS.particles.shape.polygon.nb_sides,
1 
);
break;
case 'star':
pJS.fn.vendors.drawShape(pJS.canvas.ctx,
p.x - radius*2 / (pJS.particles.shape.polygon.nb_sides/4),
p.y - radius / (2*2.66/3.5),
radius*2*2.66 / (pJS.particles.shape.polygon.nb_sides/3),
pJS.particles.shape.polygon.nb_sides,
2 
);
break;
case 'image':
function draw(){
pJS.canvas.ctx.drawImage(img_obj,
p.x-radius,
p.y-radius,
radius*2,
radius*2 / p.img.ratio
);
}
if(pJS.tmp.img_type=='svg'){
var img_obj=p.img.obj;
}else{
var img_obj=pJS.tmp.img_obj;
}
if(img_obj){
draw();
}
break;
}
pJS.canvas.ctx.closePath();
if(pJS.particles.shape.stroke.width > 0){
pJS.canvas.ctx.strokeStyle=pJS.particles.shape.stroke.color;
pJS.canvas.ctx.lineWidth=pJS.particles.shape.stroke.width;
pJS.canvas.ctx.stroke();
}
pJS.canvas.ctx.fill();
};
pJS.fn.particlesCreate=function(){
for(var i=0; i < pJS.particles.number.value; i++){
pJS.particles.array.push(new pJS.fn.particle(pJS.particles.color, pJS.particles.opacity.value));
}};
pJS.fn.particlesUpdate=function(){
for(var i=0; i < pJS.particles.array.length; i++){
var p=pJS.particles.array[i];
if(pJS.particles.move.enable){
var ms=pJS.particles.move.speed/2;
p.x +=p.vx * ms;
p.y +=p.vy * ms;
}
if(pJS.particles.opacity.anim.enable){
if(p.opacity_status==true){
if(p.opacity >=pJS.particles.opacity.value) p.opacity_status=false;
p.opacity +=p.vo;
}else{
if(p.opacity <=pJS.particles.opacity.anim.opacity_min) p.opacity_status=true;
p.opacity -=p.vo;
}
if(p.opacity < 0) p.opacity=0;
}
if(pJS.particles.size.anim.enable){
if(p.size_status==true){
if(p.radius >=pJS.particles.size.value) p.size_status=false;
p.radius +=p.vs;
}else{
if(p.radius <=pJS.particles.size.anim.size_min) p.size_status=true;
p.radius -=p.vs;
}
if(p.radius < 0) p.radius=0;
}
if(pJS.particles.move.out_mode=='bounce'){
var new_pos={
x_left: p.radius,
x_right:  pJS.canvas.w,
y_top: p.radius,
y_bottom: pJS.canvas.h
}}else{
var new_pos={
x_left: -p.radius,
x_right: pJS.canvas.w + p.radius,
y_top: -p.radius,
y_bottom: pJS.canvas.h + p.radius
}}
if(p.x - p.radius > pJS.canvas.w){
p.x=new_pos.x_left;
p.y=Math.random() * pJS.canvas.h;
}
else if(p.x + p.radius < 0){
p.x=new_pos.x_right;
p.y=Math.random() * pJS.canvas.h;
}
if(p.y - p.radius > pJS.canvas.h){
p.y=new_pos.y_top;
p.x=Math.random() * pJS.canvas.w;
}
else if(p.y + p.radius < 0){
p.y=new_pos.y_bottom;
p.x=Math.random() * pJS.canvas.w;
}
switch(pJS.particles.move.out_mode){
case 'bounce':
if(p.x + p.radius > pJS.canvas.w) p.vx=-p.vx;
else if(p.x - p.radius < 0) p.vx=-p.vx;
if(p.y + p.radius > pJS.canvas.h) p.vy=-p.vy;
else if(p.y - p.radius < 0) p.vy=-p.vy;
break;
}
if(isInArray('grab', pJS.interactivity.events.onhover.mode)){
pJS.fn.modes.grabParticle(p);
}
if(isInArray('bubble', pJS.interactivity.events.onhover.mode)||isInArray('bubble', pJS.interactivity.events.onclick.mode)){
pJS.fn.modes.bubbleParticle(p);
}
if(isInArray('repulse', pJS.interactivity.events.onhover.mode)||isInArray('repulse', pJS.interactivity.events.onclick.mode)){
pJS.fn.modes.repulseParticle(p);
}
if(pJS.particles.line_linked.enable||pJS.particles.move.attract.enable){
for(var j=i + 1; j < pJS.particles.array.length; j++){
var p2=pJS.particles.array[j];
if(pJS.particles.line_linked.enable){
pJS.fn.interact.linkParticles(p,p2);
}
if(pJS.particles.move.attract.enable){
pJS.fn.interact.attractParticles(p,p2);
}
if(pJS.particles.move.bounce){
pJS.fn.interact.bounceParticles(p,p2);
}}
}}
};
pJS.fn.particlesDraw=function(){
pJS.canvas.ctx.clearRect(0, 0, pJS.canvas.w, pJS.canvas.h);
pJS.fn.particlesUpdate();
for(var i=0; i < pJS.particles.array.length; i++){
var p=pJS.particles.array[i];
p.draw();
}};
pJS.fn.particlesEmpty=function(){
pJS.particles.array=[];
};
pJS.fn.particlesRefresh=function(){
cancelRequestAnimFrame(pJS.fn.checkAnimFrame);
cancelRequestAnimFrame(pJS.fn.drawAnimFrame);
pJS.tmp.source_svg=undefined;
pJS.tmp.img_obj=undefined;
pJS.tmp.count_svg=0;
pJS.fn.particlesEmpty();
pJS.fn.canvasClear();
pJS.fn.vendors.start();
};
pJS.fn.interact.linkParticles=function(p1, p2){
var dx=p1.x - p2.x,
dy=p1.y - p2.y,
dist=Math.sqrt(dx*dx + dy*dy);
if(dist <=pJS.particles.line_linked.distance){
var opacity_line=pJS.particles.line_linked.opacity - (dist / (1/pJS.particles.line_linked.opacity)) / pJS.particles.line_linked.distance;
if(opacity_line > 0){
var color_line=pJS.particles.line_linked.color_rgb_line;
pJS.canvas.ctx.strokeStyle='rgba('+color_line.r+','+color_line.g+','+color_line.b+','+opacity_line+')';
pJS.canvas.ctx.lineWidth=pJS.particles.line_linked.width;
pJS.canvas.ctx.beginPath();
pJS.canvas.ctx.moveTo(p1.x, p1.y);
pJS.canvas.ctx.lineTo(p2.x, p2.y);
pJS.canvas.ctx.stroke();
pJS.canvas.ctx.closePath();
}}
};
pJS.fn.interact.attractParticles=function(p1, p2){
var dx=p1.x - p2.x,
dy=p1.y - p2.y,
dist=Math.sqrt(dx*dx + dy*dy);
if(dist <=pJS.particles.line_linked.distance){
var ax=dx/(pJS.particles.move.attract.rotateX*1000),
ay=dy/(pJS.particles.move.attract.rotateY*1000);
p1.vx -=ax;
p1.vy -=ay;
p2.vx +=ax;
p2.vy +=ay;
}}
pJS.fn.interact.bounceParticles=function(p1, p2){
var dx=p1.x - p2.x,
dy=p1.y - p2.y,
dist=Math.sqrt(dx*dx + dy*dy),
dist_p=p1.radius+p2.radius;
if(dist <=dist_p){
p1.vx=-p1.vx;
p1.vy=-p1.vy;
p2.vx=-p2.vx;
p2.vy=-p2.vy;
}}
pJS.fn.modes.pushParticles=function(nb, pos){
pJS.tmp.pushing=true;
for(var i=0; i < nb; i++){
pJS.particles.array.push(new pJS.fn.particle(pJS.particles.color,
pJS.particles.opacity.value,
{
'x': pos ? pos.pos_x:Math.random() * pJS.canvas.w,
'y': pos ? pos.pos_y:Math.random() * pJS.canvas.h
}
)
)
if(i==nb-1){
if(!pJS.particles.move.enable){
pJS.fn.particlesDraw();
}
pJS.tmp.pushing=false;
}}
};
pJS.fn.modes.removeParticles=function(nb){
pJS.particles.array.splice(0, nb);
if(!pJS.particles.move.enable){
pJS.fn.particlesDraw();
}};
pJS.fn.modes.bubbleParticle=function(p){
if(pJS.interactivity.events.onhover.enable&&isInArray('bubble', pJS.interactivity.events.onhover.mode)){
var dx_mouse=p.x - pJS.interactivity.mouse.pos_x,
dy_mouse=p.y - pJS.interactivity.mouse.pos_y,
dist_mouse=Math.sqrt(dx_mouse*dx_mouse + dy_mouse*dy_mouse),
ratio=1 - dist_mouse / pJS.interactivity.modes.bubble.distance;
function init(){
p.opacity_bubble=p.opacity;
p.radius_bubble=p.radius;
}
if(dist_mouse <=pJS.interactivity.modes.bubble.distance){
if(ratio >=0&&pJS.interactivity.status=='mousemove'){
if(pJS.interactivity.modes.bubble.size!=pJS.particles.size.value){
if(pJS.interactivity.modes.bubble.size > pJS.particles.size.value){
var size=p.radius + (pJS.interactivity.modes.bubble.size*ratio);
if(size >=0){
p.radius_bubble=size;
}}else{
var dif=p.radius - pJS.interactivity.modes.bubble.size,
size=p.radius - (dif*ratio);
if(size > 0){
p.radius_bubble=size;
}else{
p.radius_bubble=0;
}}
}
if(pJS.interactivity.modes.bubble.opacity!=pJS.particles.opacity.value){
if(pJS.interactivity.modes.bubble.opacity > pJS.particles.opacity.value){
var opacity=pJS.interactivity.modes.bubble.opacity*ratio;
if(opacity > p.opacity&&opacity <=pJS.interactivity.modes.bubble.opacity){
p.opacity_bubble=opacity;
}}else{
var opacity=p.opacity - (pJS.particles.opacity.value-pJS.interactivity.modes.bubble.opacity)*ratio;
if(opacity < p.opacity&&opacity >=pJS.interactivity.modes.bubble.opacity){
p.opacity_bubble=opacity;
}}
}}
}else{
init();
}
if(pJS.interactivity.status=='mouseleave'){
init();
}}
else if(pJS.interactivity.events.onclick.enable&&isInArray('bubble', pJS.interactivity.events.onclick.mode)){
if(pJS.tmp.bubble_clicking){
var dx_mouse=p.x - pJS.interactivity.mouse.click_pos_x,
dy_mouse=p.y - pJS.interactivity.mouse.click_pos_y,
dist_mouse=Math.sqrt(dx_mouse*dx_mouse + dy_mouse*dy_mouse),
time_spent=(new Date().getTime() - pJS.interactivity.mouse.click_time)/1000;
if(time_spent > pJS.interactivity.modes.bubble.duration){
pJS.tmp.bubble_duration_end=true;
}
if(time_spent > pJS.interactivity.modes.bubble.duration*2){
pJS.tmp.bubble_clicking=false;
pJS.tmp.bubble_duration_end=false;
}}
function process(bubble_param, particles_param, p_obj_bubble, p_obj, id){
if(bubble_param!=particles_param){
if(!pJS.tmp.bubble_duration_end){
if(dist_mouse <=pJS.interactivity.modes.bubble.distance){
if(p_obj_bubble!=undefined) var obj=p_obj_bubble;
else var obj=p_obj;
if(obj!=bubble_param){
var value=p_obj - (time_spent * (p_obj - bubble_param) / pJS.interactivity.modes.bubble.duration);
if(id=='size') p.radius_bubble=value;
if(id=='opacity') p.opacity_bubble=value;
}}else{
if(id=='size') p.radius_bubble=undefined;
if(id=='opacity') p.opacity_bubble=undefined;
}}else{
if(p_obj_bubble!=undefined){
var value_tmp=p_obj - (time_spent * (p_obj - bubble_param) / pJS.interactivity.modes.bubble.duration),
dif=bubble_param - value_tmp;
value=bubble_param + dif;
if(id=='size') p.radius_bubble=value;
if(id=='opacity') p.opacity_bubble=value;
}}
}}
if(pJS.tmp.bubble_clicking){
process(pJS.interactivity.modes.bubble.size, pJS.particles.size.value, p.radius_bubble, p.radius, 'size');
process(pJS.interactivity.modes.bubble.opacity, pJS.particles.opacity.value, p.opacity_bubble, p.opacity, 'opacity');
}}
};
pJS.fn.modes.repulseParticle=function(p){
if(pJS.interactivity.events.onhover.enable&&isInArray('repulse', pJS.interactivity.events.onhover.mode)&&pJS.interactivity.status=='mousemove'){
var dx_mouse=p.x - pJS.interactivity.mouse.pos_x,
dy_mouse=p.y - pJS.interactivity.mouse.pos_y,
dist_mouse=Math.sqrt(dx_mouse*dx_mouse + dy_mouse*dy_mouse);
var normVec={x: dx_mouse/dist_mouse, y: dy_mouse/dist_mouse},
repulseRadius=pJS.interactivity.modes.repulse.distance,
velocity=100,
repulseFactor=clamp((1/repulseRadius)*(-1*Math.pow(dist_mouse/repulseRadius,2)+1)*repulseRadius*velocity, 0, 50);
var pos={
x: p.x + normVec.x * repulseFactor,
y: p.y + normVec.y * repulseFactor
}
if(pJS.particles.move.out_mode=='bounce'){
if(pos.x - p.radius > 0&&pos.x + p.radius < pJS.canvas.w) p.x=pos.x;
if(pos.y - p.radius > 0&&pos.y + p.radius < pJS.canvas.h) p.y=pos.y;
}else{
p.x=pos.x;
p.y=pos.y;
}}
else if(pJS.interactivity.events.onclick.enable&&isInArray('repulse', pJS.interactivity.events.onclick.mode)){
if(!pJS.tmp.repulse_finish){
pJS.tmp.repulse_count++;
if(pJS.tmp.repulse_count==pJS.particles.array.length){
pJS.tmp.repulse_finish=true;
}}
if(pJS.tmp.repulse_clicking){
var repulseRadius=Math.pow(pJS.interactivity.modes.repulse.distance/6, 3);
var dx=pJS.interactivity.mouse.click_pos_x - p.x,
dy=pJS.interactivity.mouse.click_pos_y - p.y,
d=dx*dx + dy*dy;
var force=-repulseRadius / d * 1;
function process(){
var f=Math.atan2(dy,dx);
p.vx=force * Math.cos(f);
p.vy=force * Math.sin(f);
if(pJS.particles.move.out_mode=='bounce'){
var pos={
x: p.x + p.vx,
y: p.y + p.vy
}
if(pos.x + p.radius > pJS.canvas.w) p.vx=-p.vx;
else if(pos.x - p.radius < 0) p.vx=-p.vx;
if(pos.y + p.radius > pJS.canvas.h) p.vy=-p.vy;
else if(pos.y - p.radius < 0) p.vy=-p.vy;
}}
if(d <=repulseRadius){
process();
}}else{
if(pJS.tmp.repulse_clicking==false){
p.vx=p.vx_i;
p.vy=p.vy_i;
}}
}}
pJS.fn.modes.grabParticle=function(p){
if(pJS.interactivity.events.onhover.enable&&pJS.interactivity.status=='mousemove'){
var dx_mouse=p.x - pJS.interactivity.mouse.pos_x,
dy_mouse=p.y - pJS.interactivity.mouse.pos_y,
dist_mouse=Math.sqrt(dx_mouse*dx_mouse + dy_mouse*dy_mouse);
if(dist_mouse <=pJS.interactivity.modes.grab.distance){
var opacity_line=pJS.interactivity.modes.grab.line_linked.opacity - (dist_mouse / (1/pJS.interactivity.modes.grab.line_linked.opacity)) / pJS.interactivity.modes.grab.distance;
if(opacity_line > 0){
var color_line=pJS.particles.line_linked.color_rgb_line;
pJS.canvas.ctx.strokeStyle='rgba('+color_line.r+','+color_line.g+','+color_line.b+','+opacity_line+')';
pJS.canvas.ctx.lineWidth=pJS.particles.line_linked.width;
pJS.canvas.ctx.beginPath();
pJS.canvas.ctx.moveTo(p.x, p.y);
pJS.canvas.ctx.lineTo(pJS.interactivity.mouse.pos_x, pJS.interactivity.mouse.pos_y);
pJS.canvas.ctx.stroke();
pJS.canvas.ctx.closePath();
}}
}};
pJS.fn.vendors.eventsListeners=function(){
if(pJS.interactivity.detect_on=='window'){
pJS.interactivity.el=window;
}else{
pJS.interactivity.el=pJS.canvas.el;
}
if(pJS.interactivity.events.onhover.enable||pJS.interactivity.events.onclick.enable){
pJS.interactivity.el.addEventListener('mousemove', function(e){
if(pJS.interactivity.el==window){
var pos_x=e.clientX,
pos_y=e.clientY;
}else{
var pos_x=e.offsetX||e.clientX,
pos_y=e.offsetY||e.clientY;
}
pJS.interactivity.mouse.pos_x=pos_x;
pJS.interactivity.mouse.pos_y=pos_y;
if(pJS.tmp.retina){
pJS.interactivity.mouse.pos_x *=pJS.canvas.pxratio;
pJS.interactivity.mouse.pos_y *=pJS.canvas.pxratio;
}
pJS.interactivity.status='mousemove';
});
pJS.interactivity.el.addEventListener('mouseleave', function(e){
pJS.interactivity.mouse.pos_x=null;
pJS.interactivity.mouse.pos_y=null;
pJS.interactivity.status='mouseleave';
});
}
if(pJS.interactivity.events.onclick.enable){
pJS.interactivity.el.addEventListener('click', function(){
pJS.interactivity.mouse.click_pos_x=pJS.interactivity.mouse.pos_x;
pJS.interactivity.mouse.click_pos_y=pJS.interactivity.mouse.pos_y;
pJS.interactivity.mouse.click_time=new Date().getTime();
if(pJS.interactivity.events.onclick.enable){
switch(pJS.interactivity.events.onclick.mode){
case 'push':
if(pJS.particles.move.enable){
pJS.fn.modes.pushParticles(pJS.interactivity.modes.push.particles_nb, pJS.interactivity.mouse);
}else{
if(pJS.interactivity.modes.push.particles_nb==1){
pJS.fn.modes.pushParticles(pJS.interactivity.modes.push.particles_nb, pJS.interactivity.mouse);
}
else if(pJS.interactivity.modes.push.particles_nb > 1){
pJS.fn.modes.pushParticles(pJS.interactivity.modes.push.particles_nb);
}}
break;
case 'remove':
pJS.fn.modes.removeParticles(pJS.interactivity.modes.remove.particles_nb);
break;
case 'bubble':
pJS.tmp.bubble_clicking=true;
break;
case 'repulse':
pJS.tmp.repulse_clicking=true;
pJS.tmp.repulse_count=0;
pJS.tmp.repulse_finish=false;
setTimeout(function(){
pJS.tmp.repulse_clicking=false;
}, pJS.interactivity.modes.repulse.duration*1000)
break;
}}
});
}};
pJS.fn.vendors.densityAutoParticles=function(){
if(pJS.particles.number.density.enable){
var area=pJS.canvas.el.width * pJS.canvas.el.height / 1000;
if(pJS.tmp.retina){
area=area/(pJS.canvas.pxratio*2);
}
var nb_particles=area * pJS.particles.number.value / pJS.particles.number.density.value_area;
var missing_particles=pJS.particles.array.length - nb_particles;
if(missing_particles < 0) pJS.fn.modes.pushParticles(Math.abs(missing_particles));
else pJS.fn.modes.removeParticles(missing_particles);
}};
pJS.fn.vendors.checkOverlap=function(p1, position){
for(var i=0; i < pJS.particles.array.length; i++){
var p2=pJS.particles.array[i];
var dx=p1.x - p2.x,
dy=p1.y - p2.y,
dist=Math.sqrt(dx*dx + dy*dy);
if(dist <=p1.radius + p2.radius){
p1.x=position ? position.x:Math.random() * pJS.canvas.w;
p1.y=position ? position.y:Math.random() * pJS.canvas.h;
pJS.fn.vendors.checkOverlap(p1);
}}
};
pJS.fn.vendors.createSvgImg=function(p){
var svgXml=pJS.tmp.source_svg,
rgbHex=/#([0-9A-F]{3,6})/gi,
coloredSvgXml=svgXml.replace(rgbHex, function (m, r, g, b){
if(p.color.rgb){
var color_value='rgba('+p.color.rgb.r+','+p.color.rgb.g+','+p.color.rgb.b+','+p.opacity+')';
}else{
var color_value='hsla('+p.color.hsl.h+','+p.color.hsl.s+'%,'+p.color.hsl.l+'%,'+p.opacity+')';
}
return color_value;
});
var svg=new Blob([coloredSvgXml], {type: 'image/svg+xml;charset=utf-8'}),
DOMURL=window.URL||window.webkitURL||window,
url=DOMURL.createObjectURL(svg);
var img=new Image();
img.addEventListener('load', function(){
p.img.obj=img;
p.img.loaded=true;
DOMURL.revokeObjectURL(url);
pJS.tmp.count_svg++;
});
img.src=url;
};
pJS.fn.vendors.destroypJS=function(){
cancelAnimationFrame(pJS.fn.drawAnimFrame);
canvas_el.remove();
pJSDom=null;
};
pJS.fn.vendors.drawShape=function(c, startX, startY, sideLength, sideCountNumerator, sideCountDenominator){
var sideCount=sideCountNumerator * sideCountDenominator;
var decimalSides=sideCountNumerator / sideCountDenominator;
var interiorAngleDegrees=(180 * (decimalSides - 2)) / decimalSides;
var interiorAngle=Math.PI - Math.PI * interiorAngleDegrees / 180;
c.save();
c.beginPath();
c.translate(startX, startY);
c.moveTo(0,0);
for (var i=0; i < sideCount; i++){
c.lineTo(sideLength,0);
c.translate(sideLength,0);
c.rotate(interiorAngle);
}
c.fill();
c.restore();
};
pJS.fn.vendors.exportImg=function(){
window.open(pJS.canvas.el.toDataURL('image/png'), '_blank');
};
pJS.fn.vendors.loadImg=function(type){
pJS.tmp.img_error=undefined;
if(pJS.particles.shape.image.src!=''){
if(type=='svg'){
var xhr=new XMLHttpRequest();
xhr.open('GET', pJS.particles.shape.image.src);
xhr.onreadystatechange=function (data){
if(xhr.readyState==4){
if(xhr.status==200){
pJS.tmp.source_svg=data.currentTarget.response;
pJS.fn.vendors.checkBeforeDraw();
}else{
console.log('Error pJS - Image not found');
pJS.tmp.img_error=true;
}}
}
xhr.send();
}else{
var img=new Image();
img.addEventListener('load', function(){
pJS.tmp.img_obj=img;
pJS.fn.vendors.checkBeforeDraw();
});
img.src=pJS.particles.shape.image.src;
}}else{
console.log('Error pJS - No image.src');
pJS.tmp.img_error=true;
}};
pJS.fn.vendors.draw=function(){
if(pJS.particles.shape.type=='image'){
if(pJS.tmp.img_type=='svg'){
if(pJS.tmp.count_svg >=pJS.particles.number.value){
pJS.fn.particlesDraw();
if(!pJS.particles.move.enable) cancelRequestAnimFrame(pJS.fn.drawAnimFrame);
else pJS.fn.drawAnimFrame=requestAnimFrame(pJS.fn.vendors.draw);
}else{
if(!pJS.tmp.img_error) pJS.fn.drawAnimFrame=requestAnimFrame(pJS.fn.vendors.draw);
}}else{
if(pJS.tmp.img_obj!=undefined){
pJS.fn.particlesDraw();
if(!pJS.particles.move.enable) cancelRequestAnimFrame(pJS.fn.drawAnimFrame);
else pJS.fn.drawAnimFrame=requestAnimFrame(pJS.fn.vendors.draw);
}else{
if(!pJS.tmp.img_error) pJS.fn.drawAnimFrame=requestAnimFrame(pJS.fn.vendors.draw);
}}
}else{
pJS.fn.particlesDraw();
if(!pJS.particles.move.enable) cancelRequestAnimFrame(pJS.fn.drawAnimFrame);
else pJS.fn.drawAnimFrame=requestAnimFrame(pJS.fn.vendors.draw);
}};
pJS.fn.vendors.checkBeforeDraw=function(){
if(pJS.particles.shape.type=='image'){
if(pJS.tmp.img_type=='svg'&&pJS.tmp.source_svg==undefined){
pJS.tmp.checkAnimFrame=requestAnimFrame(check);
}else{
cancelRequestAnimFrame(pJS.tmp.checkAnimFrame);
if(!pJS.tmp.img_error){
pJS.fn.vendors.init();
pJS.fn.vendors.draw();
}}
}else{
pJS.fn.vendors.init();
pJS.fn.vendors.draw();
}};
pJS.fn.vendors.init=function(){
pJS.fn.retinaInit();
pJS.fn.canvasInit();
pJS.fn.canvasSize();
pJS.fn.canvasPaint();
pJS.fn.particlesCreate();
pJS.fn.vendors.densityAutoParticles();
pJS.particles.line_linked.color_rgb_line=hexToRgb(pJS.particles.line_linked.color);
};
pJS.fn.vendors.start=function(){
if(isInArray('image', pJS.particles.shape.type)){
pJS.tmp.img_type=pJS.particles.shape.image.src.substr(pJS.particles.shape.image.src.length - 3);
pJS.fn.vendors.loadImg(pJS.tmp.img_type);
}else{
pJS.fn.vendors.checkBeforeDraw();
}};
pJS.fn.vendors.eventsListeners();
pJS.fn.vendors.start();
};
Object.deepExtend=function(destination, source){
for (var property in source){
if(source[property]&&source[property].constructor &&
source[property].constructor===Object){
destination[property]=destination[property]||{};
arguments.callee(destination[property], source[property]);
}else{
destination[property]=source[property];
}}
return destination;
};
window.requestAnimFrame=(function(){
return  window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame    ||
window.oRequestAnimationFrame      ||
window.msRequestAnimationFrame     ||
function(callback){
window.setTimeout(callback, 1000 / 60);
};})();
window.cancelRequestAnimFrame=(function(){
return window.cancelAnimationFrame         ||
window.webkitCancelRequestAnimationFrame ||
window.mozCancelRequestAnimationFrame    ||
window.oCancelRequestAnimationFrame      ||
window.msCancelRequestAnimationFrame     ||
clearTimeout
})();
function hexToRgb(hex){
var shorthandRegex=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;
hex=hex.replace(shorthandRegex, function(m, r, g, b){
return r + r + g + g + b + b;
});
var result=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
return result ? {
r: parseInt(result[1], 16),
g: parseInt(result[2], 16),
b: parseInt(result[3], 16)
}:null;
};
function clamp(number, min, max){
return Math.min(Math.max(number, min), max);
};
function isInArray(value, array){
return array.indexOf(value) > -1;
}
window.pJSDom=[];
window.particlesJS=function(tag_id, params){
if(typeof(tag_id)!='string'){
params=tag_id;
tag_id='particles-js';
}
if(!tag_id){
tag_id='particles-js';
}
var pJS_tag=document.getElementById(tag_id),
pJS_canvas_class='particles-js-canvas-el',
exist_canvas=pJS_tag.getElementsByClassName(pJS_canvas_class);
if(exist_canvas.length){
while(exist_canvas.length > 0){
pJS_tag.removeChild(exist_canvas[0]);
}}
var canvas_el=document.createElement('canvas');
canvas_el.className=pJS_canvas_class;
canvas_el.style.width="100%";
canvas_el.style.height="100%";
var canvas=document.getElementById(tag_id).appendChild(canvas_el);
if(canvas!=null){
pJSDom.push(new pJS(tag_id, params));
}};
window.particlesJS.load=function(tag_id, path_config_json, callback){
var xhr=new XMLHttpRequest();
xhr.open('GET', path_config_json);
xhr.onreadystatechange=function (data){
if(xhr.readyState==4){
if(xhr.status==200){
var params=JSON.parse(data.currentTarget.response);
window.particlesJS(tag_id, params);
if(callback) callback();
}else{
console.log('Error pJS - XMLHttpRequest status: '+xhr.status);
console.log('Error pJS - File config not found');
}}
};
xhr.send();
};
!function(n){var o={};function i(e){if(o[e])return o[e].exports;var t=o[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.m=n,i.c=o,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=10)}([,,function(e,t){e.exports=function(e){"complete"===document.readyState||"interactive"===document.readyState?e.call():document.attachEvent?document.attachEvent("onreadystatechange",function(){"interactive"===document.readyState&&e.call()}):document.addEventListener&&document.addEventListener("DOMContentLoaded",e)}},function(t,e,n){!function(e){e="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{};t.exports=e}.call(this,n(4))},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o=function(){return this}();try{o=o||new Function("return this")()}catch(e){"object"===("undefined"==typeof window?"undefined":n(window))&&(o=window)}e.exports=o},,,,,,function(e,t,n){e.exports=n(11)},function(e,t,n){"use strict";n.r(t);var t=n(2),t=n.n(t),i=n(3),a=n(12);function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o,l=i.window.jarallax;i.window.jarallax=a.default,i.window.jarallax.noConflict=function(){return i.window.jarallax=l,this},void 0!==i.jQuery&&((n=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];Array.prototype.unshift.call(t,this);var o=a.default.apply(i.window,t);return"object"!==r(o)?o:this}).constructor=a.default.constructor,o=i.jQuery.fn.jarallax,i.jQuery.fn.jarallax=n,i.jQuery.fn.jarallax.noConflict=function(){return i.jQuery.fn.jarallax=o,this}),t()(function(){Object(a.default)(document.querySelectorAll("[data-jarallax]"))})},function(e,t,n){"use strict";n.r(t);var o=n(2),o=n.n(o),f=n(3);function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=n){var o,i,a=[],r=!0,l=!1;try{for(n=n.call(e);!(r=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);r=!0);}catch(e){l=!0,i=e}finally{try{r||null==n.return||n.return()}finally{if(l)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(n="Object"===n&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}var r,g,u=f.window.navigator,p=-1<u.userAgent.indexOf("MSIE ")||-1<u.userAgent.indexOf("Trident/")||-1<u.userAgent.indexOf("Edge/"),l=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(u.userAgent),d=function(){for(var e="transform WebkitTransform MozTransform".split(" "),t=document.createElement("div"),n=0;n<e.length;n+=1)if(t&&void 0!==t.style[e[n]])return e[n];return!1}();function m(){g=l?(!r&&document.body&&((r=document.createElement("div")).style.cssText="position: fixed; top: -9999px; left: 0; height: 100vh; width: 0;",document.body.appendChild(r)),(r?r.clientHeight:0)||f.window.innerHeight||document.documentElement.clientHeight):f.window.innerHeight||document.documentElement.clientHeight}m(),f.window.addEventListener("resize",m),f.window.addEventListener("orientationchange",m),f.window.addEventListener("load",m),o()(function(){m()});var y=[];function b(){y.length&&(y.forEach(function(e,t){var n=e.instance,o=e.oldData,i=n.$item.getBoundingClientRect(),e={width:i.width,height:i.height,top:i.top,bottom:i.bottom,wndW:f.window.innerWidth,wndH:g},i=!o||o.wndW!==e.wndW||o.wndH!==e.wndH||o.width!==e.width||o.height!==e.height,o=i||!o||o.top!==e.top||o.bottom!==e.bottom;y[t].oldData=e,i&&n.onResize(),o&&n.onScroll()}),f.window.requestAnimationFrame(b))}var h=0,v=function(){function l(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l);var n=this;n.instanceID=h,h+=1,n.$item=e,n.defaults={type:"scroll",speed:.5,imgSrc:null,imgElement:".jarallax-img",imgSize:"cover",imgPosition:"50% 50%",imgRepeat:"no-repeat",keepImg:!1,elementInViewport:null,zIndex:-100,disableParallax:!1,disableVideo:!1,videoSrc:null,videoStartTime:0,videoEndTime:0,videoVolume:0,videoLoop:!0,videoPlayOnlyVisible:!0,videoLazyLoading:!0,onScroll:null,onInit:null,onDestroy:null,onCoverImage:null};var o,i,a=n.$item.dataset||{},r={};Object.keys(a).forEach(function(e){var t=e.substr(0,1).toLowerCase()+e.substr(1);t&&void 0!==n.defaults[t]&&(r[t]=a[e])}),n.options=n.extend({},n.defaults,r,t),n.pureOptions=n.extend({},n.options),Object.keys(n.options).forEach(function(e){"true"===n.options[e]?n.options[e]=!0:"false"===n.options[e]&&(n.options[e]=!1)}),n.options.speed=Math.min(2,Math.max(-1,parseFloat(n.options.speed))),"string"==typeof n.options.disableParallax&&(n.options.disableParallax=new RegExp(n.options.disableParallax)),n.options.disableParallax instanceof RegExp&&(o=n.options.disableParallax,n.options.disableParallax=function(){return o.test(u.userAgent)}),"function"!=typeof n.options.disableParallax&&(n.options.disableParallax=function(){return!1}),"string"==typeof n.options.disableVideo&&(n.options.disableVideo=new RegExp(n.options.disableVideo)),n.options.disableVideo instanceof RegExp&&(i=n.options.disableVideo,n.options.disableVideo=function(){return i.test(u.userAgent)}),"function"!=typeof n.options.disableVideo&&(n.options.disableVideo=function(){return!1});t=n.options.elementInViewport;(t=t&&"object"===c(t)&&void 0!==t.length?s(t,1)[0]:t)instanceof Element||(t=null),n.options.elementInViewport=t,n.image={src:n.options.imgSrc||null,$container:null,useImgTag:!1,position:/iPad|iPhone|iPod|Android/.test(u.userAgent)?"absolute":"fixed"},n.initImg()&&n.canInitParallax()&&n.init()}var e,t,n;return e=l,(t=[{key:"css",value:function(t,n){return"string"==typeof n?f.window.getComputedStyle(t).getPropertyValue(n):(n.transform&&d&&(n[d]=n.transform),Object.keys(n).forEach(function(e){t.style[e]=n[e]}),t)}},{key:"extend",value:function(n){for(var e=arguments.length,o=new Array(1<e?e-1:0),t=1;t<e;t++)o[t-1]=arguments[t];return n=n||{},Object.keys(o).forEach(function(t){o[t]&&Object.keys(o[t]).forEach(function(e){n[e]=o[t][e]})}),n}},{key:"getWindowData",value:function(){return{width:f.window.innerWidth||document.documentElement.clientWidth,height:g,y:document.documentElement.scrollTop}}},{key:"initImg",value:function(){var e=this,t=e.options.imgElement;return(t=t&&"string"==typeof t?e.$item.querySelector(t):t)instanceof Element||(e.options.imgSrc?(t=new Image).src=e.options.imgSrc:t=null),t&&(e.options.keepImg?e.image.$item=t.cloneNode(!0):(e.image.$item=t,e.image.$itemParent=t.parentNode),e.image.useImgTag=!0),!!e.image.$item||(null===e.image.src&&(e.image.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",e.image.bgImage=e.css(e.$item,"background-image")),!(!e.image.bgImage||"none"===e.image.bgImage))}},{key:"canInitParallax",value:function(){return d&&!this.options.disableParallax()}},{key:"init",value:function(){var e,t=this,n={position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"hidden"},o={pointerEvents:"none",transformStyle:"preserve-3d",backfaceVisibility:"hidden",willChange:"transform,opacity"};t.options.keepImg||((e=t.$item.getAttribute("style"))&&t.$item.setAttribute("data-jarallax-original-styles",e),!t.image.useImgTag||(e=t.image.$item.getAttribute("style"))&&t.image.$item.setAttribute("data-jarallax-original-styles",e)),"static"===t.css(t.$item,"position")&&t.css(t.$item,{position:"relative"}),"auto"===t.css(t.$item,"z-index")&&t.css(t.$item,{zIndex:0}),t.image.$container=document.createElement("div"),t.css(t.image.$container,n),t.css(t.image.$container,{"z-index":t.options.zIndex}),p&&t.css(t.image.$container,{opacity:.9999}),t.image.$container.setAttribute("id","jarallax-container-".concat(t.instanceID)),t.$item.appendChild(t.image.$container),t.image.useImgTag?o=t.extend({"object-fit":t.options.imgSize,"object-position":t.options.imgPosition,"font-family":"object-fit: ".concat(t.options.imgSize,"; object-position: ").concat(t.options.imgPosition,";"),"max-width":"none"},n,o):(t.image.$item=document.createElement("div"),t.image.src&&(o=t.extend({"background-position":t.options.imgPosition,"background-size":t.options.imgSize,"background-repeat":t.options.imgRepeat,"background-image":t.image.bgImage||'url("'.concat(t.image.src,'")')},n,o))),"opacity"!==t.options.type&&"scale"!==t.options.type&&"scale-opacity"!==t.options.type&&1!==t.options.speed||(t.image.position="absolute"),"fixed"===t.image.position&&(n=function(e){for(var t=[];null!==e.parentElement;)1===(e=e.parentElement).nodeType&&t.push(e);return t}(t.$item).filter(function(e){var t=f.window.getComputedStyle(e),e=t["-webkit-transform"]||t["-moz-transform"]||t.transform;return e&&"none"!==e||/(auto|scroll)/.test(t.overflow+t["overflow-y"]+t["overflow-x"])}),t.image.position=n.length?"absolute":"fixed"),o.position=t.image.position,t.css(t.image.$item,o),t.image.$container.appendChild(t.image.$item),t.onResize(),t.onScroll(!0),t.options.onInit&&t.options.onInit.call(t),"none"!==t.css(t.$item,"background-image")&&t.css(t.$item,{"background-image":"none"}),t.addToParallaxList()}},{key:"addToParallaxList",value:function(){y.push({instance:this}),1===y.length&&f.window.requestAnimationFrame(b)}},{key:"removeFromParallaxList",value:function(){var n=this;y.forEach(function(e,t){e.instance.instanceID===n.instanceID&&y.splice(t,1)})}},{key:"destroy",value:function(){var e=this;e.removeFromParallaxList();var t,n=e.$item.getAttribute("data-jarallax-original-styles");e.$item.removeAttribute("data-jarallax-original-styles"),n?e.$item.setAttribute("style",n):e.$item.removeAttribute("style"),e.image.useImgTag&&(t=e.image.$item.getAttribute("data-jarallax-original-styles"),e.image.$item.removeAttribute("data-jarallax-original-styles"),t?e.image.$item.setAttribute("style",n):e.image.$item.removeAttribute("style"),e.image.$itemParent&&e.image.$itemParent.appendChild(e.image.$item)),e.$clipStyles&&e.$clipStyles.parentNode.removeChild(e.$clipStyles),e.image.$container&&e.image.$container.parentNode.removeChild(e.image.$container),e.options.onDestroy&&e.options.onDestroy.call(e),delete e.$item.jarallax}},{key:"clipContainer",value:function(){var e,t,n;"fixed"===this.image.position&&(t=(n=(e=this).image.$container.getBoundingClientRect()).width,n=n.height,e.$clipStyles||(e.$clipStyles=document.createElement("style"),e.$clipStyles.setAttribute("type","text/css"),e.$clipStyles.setAttribute("id","jarallax-clip-".concat(e.instanceID)),(document.head||document.getElementsByTagName("head")[0]).appendChild(e.$clipStyles)),n="#jarallax-container-".concat(e.instanceID," {\n            clip: rect(0 ").concat(t,"px ").concat(n,"px 0);\n            clip: rect(0, ").concat(t,"px, ").concat(n,"px, 0);\n            -webkit-clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);\n            clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);\n        }"),e.$clipStyles.styleSheet?e.$clipStyles.styleSheet.cssText=n:e.$clipStyles.innerHTML=n)}},{key:"coverImage",value:function(){var e=this,t=e.image.$container.getBoundingClientRect(),n=t.height,o=e.options.speed,i="scroll"===e.options.type||"scroll-opacity"===e.options.type,a=0,r=n,l=0;return i&&(o<0?(a=o*Math.max(n,g),g<n&&(a-=o*(n-g))):a=o*(n+g),1<o?r=Math.abs(a-g):o<0?r=a/o+Math.abs(a):r+=(g-n)*(1-o),a/=2),e.parallaxScrollDistance=a,l=i?(g-r)/2:(n-r)/2,e.css(e.image.$item,{height:"".concat(r,"px"),marginTop:"".concat(l,"px"),left:"fixed"===e.image.position?"".concat(t.left,"px"):"0",width:"".concat(t.width,"px")}),e.options.onCoverImage&&e.options.onCoverImage.call(e),{image:{height:r,marginTop:l},container:t}}},{key:"isVisible",value:function(){return this.isElementInViewport||!1}},{key:"onScroll",value:function(e){var t,n,o,i,a,r,l,s=this,c=s.$item.getBoundingClientRect(),u=c.top,p=c.height,d={},m=c;s.options.elementInViewport&&(m=s.options.elementInViewport.getBoundingClientRect()),s.isElementInViewport=0<=m.bottom&&0<=m.right&&m.top<=g&&m.left<=f.window.innerWidth,(e||s.isElementInViewport)&&(t=Math.max(0,u),n=Math.max(0,p+u),o=Math.max(0,-u),i=Math.max(0,u+p-g),a=Math.max(0,p-(u+p-g)),r=Math.max(0,-u+g-p),m=1-(g-u)/(g+p)*2,e=1,p<g?e=1-(o||i)/p:n<=g?e=n/g:a<=g&&(e=a/g),"opacity"!==s.options.type&&"scale-opacity"!==s.options.type&&"scroll-opacity"!==s.options.type||(d.transform="translate3d(0,0,0)",d.opacity=e),"scale"!==s.options.type&&"scale-opacity"!==s.options.type||(l=1,s.options.speed<0?l-=s.options.speed*e:l+=s.options.speed*(1-e),d.transform="scale(".concat(l,") translate3d(0,0,0)")),"scroll"!==s.options.type&&"scroll-opacity"!==s.options.type||(l=s.parallaxScrollDistance*m,"absolute"===s.image.position&&(l-=u),d.transform="translate3d(0,".concat(l,"px,0)")),s.css(s.image.$item,d),s.options.onScroll&&s.options.onScroll.call(s,{section:c,beforeTop:t,beforeTopEnd:n,afterTop:o,beforeBottom:i,beforeBottomEnd:a,afterBottom:r,visiblePercent:e,fromViewportCenter:m}))}},{key:"onResize",value:function(){this.coverImage(),this.clipContainer()}}])&&a(e.prototype,t),n&&a(e,n),l}(),o=function(e,t){for(var n,o=(e=("object"===("undefined"==typeof HTMLElement?"undefined":c(HTMLElement))?e instanceof HTMLElement:e&&"object"===c(e)&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName)?[e]:e).length,i=0,a=arguments.length,r=new Array(2<a?a-2:0),l=2;l<a;l++)r[l-2]=arguments[l];for(;i<o;i+=1)if("object"===c(t)||void 0===t?e[i].jarallax||(e[i].jarallax=new v(e[i],t)):e[i].jarallax&&(n=e[i].jarallax[t].apply(e[i].jarallax,r)),void 0!==n)return n;return e};o.constructor=v,t.default=o}]);
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Parallax=t()}}(function(){return function t(e,i,n){function o(r,a){if(!i[r]){if(!e[r]){var l="function"==typeof require&&require;if(!a&&l)return l(r,!0);if(s)return s(r,!0);var h=new Error("Cannot find module '"+r+"'");throw h.code="MODULE_NOT_FOUND",h}var u=i[r]={exports:{}};e[r][0].call(u.exports,function(t){var i=e[r][1][t];return o(i||t)},u,u.exports,t,e,i,n)}return i[r].exports}for(var s="function"==typeof require&&require,r=0;r<n.length;r++)o(n[r]);return o}({1:[function(t,e,i){"use strict";function n(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}var o=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},i=0;i<10;i++)e["_"+String.fromCharCode(i)]=i;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(t){n[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var i,a,l=n(t),h=1;h<arguments.length;h++){i=Object(arguments[h]);for(var u in i)s.call(i,u)&&(l[u]=i[u]);if(o){a=o(i);for(var c=0;c<a.length;c++)r.call(i,a[c])&&(l[a[c]]=i[a[c]])}}return l}},{}],2:[function(t,e,i){(function(t){(function(){var i,n,o,s,r,a;"undefined"!=typeof performance&&null!==performance&&performance.now?e.exports=function(){return performance.now()}:void 0!==t&&null!==t&&t.hrtime?(e.exports=function(){return(i()-r)/1e6},n=t.hrtime,s=(i=function(){var t;return 1e9*(t=n())[0]+t[1]})(),a=1e9*t.uptime(),r=s-a):Date.now?(e.exports=function(){return Date.now()-o},o=Date.now()):(e.exports=function(){return(new Date).getTime()-o},o=(new Date).getTime())}).call(this)}).call(this,t("_process"))},{_process:3}],3:[function(t,e,i){function n(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(t){if(c===setTimeout)return setTimeout(t,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(t,0);try{return c(t,0)}catch(e){try{return c.call(null,t,0)}catch(e){return c.call(this,t,0)}}}function r(t){if(d===clearTimeout)return clearTimeout(t);if((d===o||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(t);try{return d(t)}catch(e){try{return d.call(null,t)}catch(e){return d.call(this,t)}}}function a(){v&&p&&(v=!1,p.length?f=p.concat(f):y=-1,f.length&&l())}function l(){if(!v){var t=s(a);v=!0;for(var e=f.length;e;){for(p=f,f=[];++y<e;)p&&p[y].run();y=-1,e=f.length}p=null,v=!1,r(t)}}function h(t,e){this.fun=t,this.array=e}function u(){}var c,d,m=e.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:n}catch(t){c=n}try{d="function"==typeof clearTimeout?clearTimeout:o}catch(t){d=o}}();var p,f=[],v=!1,y=-1;m.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];f.push(new h(t,e)),1!==f.length||v||s(l)},h.prototype.run=function(){this.fun.apply(null,this.array)},m.title="browser",m.browser=!0,m.env={},m.argv=[],m.version="",m.versions={},m.on=u,m.addListener=u,m.once=u,m.off=u,m.removeListener=u,m.removeAllListeners=u,m.emit=u,m.prependListener=u,m.prependOnceListener=u,m.listeners=function(t){return[]},m.binding=function(t){throw new Error("process.binding is not supported")},m.cwd=function(){return"/"},m.chdir=function(t){throw new Error("process.chdir is not supported")},m.umask=function(){return 0}},{}],4:[function(t,e,i){(function(i){for(var n=t("performance-now"),o="undefined"==typeof window?i:window,s=["moz","webkit"],r="AnimationFrame",a=o["request"+r],l=o["cancel"+r]||o["cancelRequest"+r],h=0;!a&&h<s.length;h++)a=o[s[h]+"Request"+r],l=o[s[h]+"Cancel"+r]||o[s[h]+"CancelRequest"+r];if(!a||!l){var u=0,c=0,d=[];a=function(t){if(0===d.length){var e=n(),i=Math.max(0,1e3/60-(e-u));u=i+e,setTimeout(function(){var t=d.slice(0);d.length=0;for(var e=0;e<t.length;e++)if(!t[e].cancelled)try{t[e].callback(u)}catch(t){setTimeout(function(){throw t},0)}},Math.round(i))}return d.push({handle:++c,callback:t,cancelled:!1}),c},l=function(t){for(var e=0;e<d.length;e++)d[e].handle===t&&(d[e].cancelled=!0)}}e.exports=function(t){return a.call(o,t)},e.exports.cancel=function(){l.apply(o,arguments)},e.exports.polyfill=function(){o.requestAnimationFrame=a,o.cancelAnimationFrame=l}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"performance-now":2}],5:[function(t,e,i){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=t("raf"),r=t("object-assign"),a={propertyCache:{},vendors:[null,["-webkit-","webkit"],["-moz-","Moz"],["-o-","O"],["-ms-","ms"]],clamp:function(t,e,i){return e<i?t<e?e:t>i?i:t:t<i?i:t>e?e:t},data:function(t,e){return a.deserialize(t.getAttribute("data-"+e))},deserialize:function(t){return"true"===t||"false"!==t&&("null"===t?null:!isNaN(parseFloat(t))&&isFinite(t)?parseFloat(t):t)},camelCase:function(t){return t.replace(/-+(.)?/g,function(t,e){return e?e.toUpperCase():""})},accelerate:function(t){a.css(t,"transform","translate3d(0,0,0) rotate(0.0001deg)"),a.css(t,"transform-style","preserve-3d"),a.css(t,"backface-visibility","hidden")},transformSupport:function(t){for(var e=document.createElement("div"),i=!1,n=null,o=!1,s=null,r=null,l=0,h=a.vendors.length;l<h;l++)if(null!==a.vendors[l]?(s=a.vendors[l][0]+"transform",r=a.vendors[l][1]+"Transform"):(s="transform",r="transform"),void 0!==e.style[r]){i=!0;break}switch(t){case"2D":o=i;break;case"3D":if(i){var u=document.body||document.createElement("body"),c=document.documentElement,d=c.style.overflow,m=!1;document.body||(m=!0,c.style.overflow="hidden",c.appendChild(u),u.style.overflow="hidden",u.style.background=""),u.appendChild(e),e.style[r]="translate3d(1px,1px,1px)",o=void 0!==(n=window.getComputedStyle(e).getPropertyValue(s))&&n.length>0&&"none"!==n,c.style.overflow=d,u.removeChild(e),m&&(u.removeAttribute("style"),u.parentNode.removeChild(u))}}return o},css:function(t,e,i){var n=a.propertyCache[e];if(!n)for(var o=0,s=a.vendors.length;o<s;o++)if(n=null!==a.vendors[o]?a.camelCase(a.vendors[o][1]+"-"+e):e,void 0!==t.style[n]){a.propertyCache[e]=n;break}t.style[n]=i}},l={relativeInput:!1,clipRelativeInput:!1,inputElement:null,hoverOnly:!1,calibrationThreshold:100,calibrationDelay:500,supportDelay:500,calibrateX:!1,calibrateY:!0,invertX:!0,invertY:!0,limitX:!1,limitY:!1,scalarX:10,scalarY:10,frictionX:.1,frictionY:.1,originX:.5,originY:.5,pointerEvents:!1,precision:1,onReady:null,selector:null},h=function(){function t(e,i){n(this,t),this.element=e;var o={calibrateX:a.data(this.element,"calibrate-x"),calibrateY:a.data(this.element,"calibrate-y"),invertX:a.data(this.element,"invert-x"),invertY:a.data(this.element,"invert-y"),limitX:a.data(this.element,"limit-x"),limitY:a.data(this.element,"limit-y"),scalarX:a.data(this.element,"scalar-x"),scalarY:a.data(this.element,"scalar-y"),frictionX:a.data(this.element,"friction-x"),frictionY:a.data(this.element,"friction-y"),originX:a.data(this.element,"origin-x"),originY:a.data(this.element,"origin-y"),pointerEvents:a.data(this.element,"pointer-events"),precision:a.data(this.element,"precision"),relativeInput:a.data(this.element,"relative-input"),clipRelativeInput:a.data(this.element,"clip-relative-input"),hoverOnly:a.data(this.element,"hover-only"),inputElement:document.querySelector(a.data(this.element,"input-element")),selector:a.data(this.element,"selector")};for(var s in o)null===o[s]&&delete o[s];r(this,l,o,i),this.inputElement||(this.inputElement=this.element),this.calibrationTimer=null,this.calibrationFlag=!0,this.enabled=!1,this.depthsX=[],this.depthsY=[],this.raf=null,this.bounds=null,this.elementPositionX=0,this.elementPositionY=0,this.elementWidth=0,this.elementHeight=0,this.elementCenterX=0,this.elementCenterY=0,this.elementRangeX=0,this.elementRangeY=0,this.calibrationX=0,this.calibrationY=0,this.inputX=0,this.inputY=0,this.motionX=0,this.motionY=0,this.velocityX=0,this.velocityY=0,this.onMouseMove=this.onMouseMove.bind(this),this.onDeviceOrientation=this.onDeviceOrientation.bind(this),this.onDeviceMotion=this.onDeviceMotion.bind(this),this.onOrientationTimer=this.onOrientationTimer.bind(this),this.onMotionTimer=this.onMotionTimer.bind(this),this.onCalibrationTimer=this.onCalibrationTimer.bind(this),this.onAnimationFrame=this.onAnimationFrame.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.windowWidth=null,this.windowHeight=null,this.windowCenterX=null,this.windowCenterY=null,this.windowRadiusX=null,this.windowRadiusY=null,this.portrait=!1,this.desktop=!navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry|BB10|mobi|tablet|opera mini|nexus 7)/i),this.motionSupport=!!window.DeviceMotionEvent&&!this.desktop,this.orientationSupport=!!window.DeviceOrientationEvent&&!this.desktop,this.orientationStatus=0,this.motionStatus=0,this.initialise()}return o(t,[{key:"initialise",value:function(){void 0===this.transform2DSupport&&(this.transform2DSupport=a.transformSupport("2D"),this.transform3DSupport=a.transformSupport("3D")),this.transform3DSupport&&a.accelerate(this.element),"static"===window.getComputedStyle(this.element).getPropertyValue("position")&&(this.element.style.position="relative"),this.pointerEvents||(this.element.style.pointerEvents="none"),this.updateLayers(),this.updateDimensions(),this.enable(),this.queueCalibration(this.calibrationDelay)}},{key:"doReadyCallback",value:function(){this.onReady&&this.onReady()}},{key:"updateLayers",value:function(){this.selector?this.layers=this.element.querySelectorAll(this.selector):this.layers=this.element.children,this.layers.length||console.warn("ParallaxJS: Your scene does not have any layers."),this.depthsX=[],this.depthsY=[];for(var t=0;t<this.layers.length;t++){var e=this.layers[t];this.transform3DSupport&&a.accelerate(e),e.style.position=t?"absolute":"relative",e.style.display="block",e.style.left=0,e.style.top=0;var i=a.data(e,"depth")||0;this.depthsX.push(a.data(e,"depth-x")||i),this.depthsY.push(a.data(e,"depth-y")||i)}}},{key:"updateDimensions",value:function(){this.windowWidth=window.innerWidth,this.windowHeight=window.innerHeight,this.windowCenterX=this.windowWidth*this.originX,this.windowCenterY=this.windowHeight*this.originY,this.windowRadiusX=Math.max(this.windowCenterX,this.windowWidth-this.windowCenterX),this.windowRadiusY=Math.max(this.windowCenterY,this.windowHeight-this.windowCenterY)}},{key:"updateBounds",value:function(){this.bounds=this.inputElement.getBoundingClientRect(),this.elementPositionX=this.bounds.left,this.elementPositionY=this.bounds.top,this.elementWidth=this.bounds.width,this.elementHeight=this.bounds.height,this.elementCenterX=this.elementWidth*this.originX,this.elementCenterY=this.elementHeight*this.originY,this.elementRangeX=Math.max(this.elementCenterX,this.elementWidth-this.elementCenterX),this.elementRangeY=Math.max(this.elementCenterY,this.elementHeight-this.elementCenterY)}},{key:"queueCalibration",value:function(t){clearTimeout(this.calibrationTimer),this.calibrationTimer=setTimeout(this.onCalibrationTimer,t)}},{key:"enable",value:function(){this.enabled||(this.enabled=!0,this.orientationSupport?(this.portrait=!1,window.addEventListener("deviceorientation",this.onDeviceOrientation),this.detectionTimer=setTimeout(this.onOrientationTimer,this.supportDelay)):this.motionSupport?(this.portrait=!1,window.addEventListener("devicemotion",this.onDeviceMotion),this.detectionTimer=setTimeout(this.onMotionTimer,this.supportDelay)):(this.calibrationX=0,this.calibrationY=0,this.portrait=!1,window.addEventListener("mousemove",this.onMouseMove),this.doReadyCallback()),window.addEventListener("resize",this.onWindowResize),this.raf=s(this.onAnimationFrame))}},{key:"disable",value:function(){this.enabled&&(this.enabled=!1,this.orientationSupport?window.removeEventListener("deviceorientation",this.onDeviceOrientation):this.motionSupport?window.removeEventListener("devicemotion",this.onDeviceMotion):window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("resize",this.onWindowResize),s.cancel(this.raf))}},{key:"calibrate",value:function(t,e){this.calibrateX=void 0===t?this.calibrateX:t,this.calibrateY=void 0===e?this.calibrateY:e}},{key:"invert",value:function(t,e){this.invertX=void 0===t?this.invertX:t,this.invertY=void 0===e?this.invertY:e}},{key:"friction",value:function(t,e){this.frictionX=void 0===t?this.frictionX:t,this.frictionY=void 0===e?this.frictionY:e}},{key:"scalar",value:function(t,e){this.scalarX=void 0===t?this.scalarX:t,this.scalarY=void 0===e?this.scalarY:e}},{key:"limit",value:function(t,e){this.limitX=void 0===t?this.limitX:t,this.limitY=void 0===e?this.limitY:e}},{key:"origin",value:function(t,e){this.originX=void 0===t?this.originX:t,this.originY=void 0===e?this.originY:e}},{key:"setInputElement",value:function(t){this.inputElement=t,this.updateDimensions()}},{key:"setPosition",value:function(t,e,i){e=e.toFixed(this.precision)+"px",i=i.toFixed(this.precision)+"px",this.transform3DSupport?a.css(t,"transform","translate3d("+e+","+i+",0)"):this.transform2DSupport?a.css(t,"transform","translate("+e+","+i+")"):(t.style.left=e,t.style.top=i)}},{key:"onOrientationTimer",value:function(){this.orientationSupport&&0===this.orientationStatus?(this.disable(),this.orientationSupport=!1,this.enable()):this.doReadyCallback()}},{key:"onMotionTimer",value:function(){this.motionSupport&&0===this.motionStatus?(this.disable(),this.motionSupport=!1,this.enable()):this.doReadyCallback()}},{key:"onCalibrationTimer",value:function(){this.calibrationFlag=!0}},{key:"onWindowResize",value:function(){this.updateDimensions()}},{key:"onAnimationFrame",value:function(){this.updateBounds();var t=this.inputX-this.calibrationX,e=this.inputY-this.calibrationY;(Math.abs(t)>this.calibrationThreshold||Math.abs(e)>this.calibrationThreshold)&&this.queueCalibration(0),this.portrait?(this.motionX=this.calibrateX?e:this.inputY,this.motionY=this.calibrateY?t:this.inputX):(this.motionX=this.calibrateX?t:this.inputX,this.motionY=this.calibrateY?e:this.inputY),this.motionX*=this.elementWidth*(this.scalarX/100),this.motionY*=this.elementHeight*(this.scalarY/100),isNaN(parseFloat(this.limitX))||(this.motionX=a.clamp(this.motionX,-this.limitX,this.limitX)),isNaN(parseFloat(this.limitY))||(this.motionY=a.clamp(this.motionY,-this.limitY,this.limitY)),this.velocityX+=(this.motionX-this.velocityX)*this.frictionX,this.velocityY+=(this.motionY-this.velocityY)*this.frictionY;for(var i=0;i<this.layers.length;i++){var n=this.layers[i],o=this.depthsX[i],r=this.depthsY[i],l=this.velocityX*(o*(this.invertX?-1:1)),h=this.velocityY*(r*(this.invertY?-1:1));this.setPosition(n,l,h)}this.raf=s(this.onAnimationFrame)}},{key:"rotate",value:function(t,e){var i=(t||0)/30,n=(e||0)/30,o=this.windowHeight>this.windowWidth;this.portrait!==o&&(this.portrait=o,this.calibrationFlag=!0),this.calibrationFlag&&(this.calibrationFlag=!1,this.calibrationX=i,this.calibrationY=n),this.inputX=i,this.inputY=n}},{key:"onDeviceOrientation",value:function(t){var e=t.beta,i=t.gamma;null!==e&&null!==i&&(this.orientationStatus=1,this.rotate(e,i))}},{key:"onDeviceMotion",value:function(t){var e=t.rotationRate.beta,i=t.rotationRate.gamma;null!==e&&null!==i&&(this.motionStatus=1,this.rotate(e,i))}},{key:"onMouseMove",value:function(t){var e=t.clientX,i=t.clientY;if(this.hoverOnly&&(e<this.elementPositionX||e>this.elementPositionX+this.elementWidth||i<this.elementPositionY||i>this.elementPositionY+this.elementHeight))return this.inputX=0,void(this.inputY=0);this.relativeInput?(this.clipRelativeInput&&(e=Math.max(e,this.elementPositionX),e=Math.min(e,this.elementPositionX+this.elementWidth),i=Math.max(i,this.elementPositionY),i=Math.min(i,this.elementPositionY+this.elementHeight)),this.elementRangeX&&this.elementRangeY&&(this.inputX=(e-this.elementPositionX-this.elementCenterX)/this.elementRangeX,this.inputY=(i-this.elementPositionY-this.elementCenterY)/this.elementRangeY)):this.windowRadiusX&&this.windowRadiusY&&(this.inputX=(e-this.windowCenterX)/this.windowRadiusX,this.inputY=(i-this.windowCenterY)/this.windowRadiusY)}},{key:"destroy",value:function(){this.disable(),clearTimeout(this.calibrationTimer),clearTimeout(this.detectionTimer),this.element.removeAttribute("style");for(var t=0;t<this.layers.length;t++)this.layers[t].removeAttribute("style");delete this.element,delete this.layers}},{key:"version",value:function(){return"3.1.0"}}]),t}();e.exports=h},{"object-assign":1,raf:4}]},{},[5])(5)});
(function(){"use strict";window.kadence={initOutlineToggle:function(){document.body.addEventListener("keydown",function(){document.body.classList.remove("hide-focus-outline")}),document.body.addEventListener("mousedown",function(){document.body.classList.add("hide-focus-outline")})},getOffset:function(a){if(a instanceof HTMLElement){var b=a.getBoundingClientRect();return{top:b.top+window.pageYOffset,left:b.left+window.pageXOffset}}return{top:null,left:null}},findParents:function(a,b){function c(a){var e=a.parentNode;e instanceof HTMLElement&&(e.matches(b)&&d.push(e),c(e))}var d=[];return c(a),d},toggleAttribute:function(a,b,c,d){c===void 0&&(c=!0),d===void 0&&(d=!1),a.getAttribute(b)===c?a.setAttribute(b,d):a.setAttribute(b,c)},initNavToggleSubmenus:function(){var a=document.querySelectorAll(".nav--toggle-sub");if(a.length)for(let b=0;b<a.length;b++)window.kadence.initEachNavToggleSubmenu(a[b]),window.kadence.initEachNavToggleSubmenuInside(a[b])},initEachNavToggleSubmenu:function(a){var b=a.querySelectorAll(".menu ul");if(b.length)for(let f=0;f<b.length;f++){var c=b[f].parentNode;let g=c.querySelector(".dropdown-nav-toggle");if(g){var d=c.querySelector(".nav-drop-title-wrap").firstChild.textContent.trim(),e=document.createElement("BUTTON");e.setAttribute("aria-label",d?kadenceConfig.screenReader.expandOf+" "+d:kadenceConfig.screenReader.expand),e.setAttribute("aria-haspopup","menu"),e.setAttribute("aria-expanded","false"),e.setAttribute("aria-label",d?kadenceConfig.screenReader.expandOf+" "+d:kadenceConfig.screenReader.expand),e.classList.add("dropdown-nav-special-toggle"),c.insertBefore(e,c.childNodes[1]),e.addEventListener("click",function(a){a.preventDefault(),window.kadence.toggleSubMenu(a.target.closest("li"))}),a.classList.contains("click-to-open")||c.addEventListener("mouseleave",function(a){var b=a.relatedTarget;b&&c.contains(b)||window.kadence.toggleSubMenu(c,!1)}),c.querySelector("a").addEventListener("focus",function(a){var b=a.target.parentNode.parentNode.querySelectorAll("li.menu-item--toggled-on");for(let d=0;d<b.length;d++)c!==b[d]&&window.kadence.toggleSubMenu(b[d],!1)}),b[f].addEventListener("keydown",function(a){var c="ul.toggle-show > li > a, ul.toggle-show > li > .dropdown-nav-special-toggle";if(9===a.keyCode){var c="ul.toggle-show > li > a, ul.toggle-show > li > .dropdown-nav-special-toggle";b[f].parentNode.classList.contains("kadence-menu-mega-enabled")&&(c="a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex=\"0\"], [contenteditable]"),a.shiftKey?window.kadence.isfirstFocusableElement(b[f],document.activeElement,c)&&window.kadence.toggleSubMenu(b[f].parentNode,!1):window.kadence.islastFocusableElement(b[f],document.activeElement,c)&&window.kadence.toggleSubMenu(b[f].parentNode,!1)}27===a.keyCode&&(window.kadence.toggleSubMenu(b[f].parentNode,!1),b[f].parentNode.querySelector(".dropdown-nav-special-toggle").focus())}),b[f].parentNode.classList.add("menu-item--has-toggle")}}},initEachNavToggleSubmenuInside:function(a){var b=a.querySelectorAll(".menu-item-has-children");if(b.length)for(let a=0;a<b.length;a++)b[a].addEventListener("mouseenter",function(){if(b[a].querySelector("ul.sub-menu")){var c=b[a].querySelector("ul.sub-menu"),d=window.kadence.getOffset(c),e=d.left,f=c.offsetWidth,g=window.innerWidth;e+f<=g||c.classList.add("sub-menu-edge")}})},toggleSubMenu:function(a,b){if(!a||"LI"!==a.tagName||!a.querySelector("ul"))return;var c=a.querySelector(".dropdown-nav-special-toggle"),d=a.querySelector("ul"),e=a.querySelector(".nav-drop-title-wrap").firstChild.textContent.trim();let f=a.classList.contains("menu-item--toggled-on")||d&&d.classList.contains("opened");void 0!==b&&"boolean"==typeof b&&(f=!b);var g=(!f).toString();if(c&&c.setAttribute("aria-expanded",g),f){setTimeout(function(){a.classList.remove("menu-item--toggled-on"),d&&(d.classList.remove("toggle-show"),d.classList.remove("opened")),c&&c.setAttribute("aria-label",e?kadenceConfig.screenReader.expandOf+" "+e:kadenceConfig.screenReader.expand)},5);var h=a.querySelectorAll(".menu-item--toggled-on");for(let a=0;a<h.length;a++)window.kadence.toggleSubMenu(h[a],!1)}else{var j=a.parentNode.querySelectorAll("li");for(let b=0;b<j.length;b++)if(j[b]!==a){var k=j[b].querySelector("ul");k&&(j[b].classList.contains("menu-item--toggled-on")||k.classList.contains("opened"))&&window.kadence.toggleSubMenu(j[b],!1)}a.classList.add("menu-item--toggled-on"),d&&(d.classList.add("toggle-show"),d.classList.add("opened")),c&&c.setAttribute("aria-label",e?kadenceConfig.screenReader.collapseOf+" "+e:kadenceConfig.screenReader.collapse)}},isfirstFocusableElement:function(a,b,c){var d=a.querySelectorAll(c);return!!(0<d.length)&&b===d[0]},islastFocusableElement:function(a,b,c){var d=a.querySelectorAll(c);return!!(0<d.length)&&b===d[d.length-1]},toggleDrawer:function(a,b){b="undefined"==typeof b||b;var c=a,d=document.querySelector(c.dataset.toggleTarget);if(d){var e=window.innerWidth-document.documentElement.clientWidth,f=c.dataset.toggleDuration?c.dataset.toggleDuration:250;if(c.hasAttribute("aria-expanded")&&window.kadence.toggleAttribute(c,"aria-expanded","true","false"),d.classList.contains("show-drawer"))c.dataset.toggleBodyClass&&document.body.classList.remove(c.dataset.toggleBodyClass),d.classList.remove("active"),d.classList.remove("pop-animated"),document.body.classList.remove("kadence-scrollbar-fixer"),setTimeout(function(){d.classList.remove("show-drawer");var a=new Event("kadence-drawer-closed");if(window.dispatchEvent(a),c.dataset.setFocus&&b){var e=document.querySelector(c.dataset.setFocus);e&&(e.focus(),e.hasAttribute("aria-expanded")&&window.kadence.toggleAttribute(e,"aria-expanded","true","false"))}},f);else if(d.classList.add("show-drawer"),c.dataset.toggleBodyClass&&(document.body.classList.toggle(c.dataset.toggleBodyClass),c.dataset.toggleBodyClass.includes("showing-popup-drawer-")&&(document.body.style.setProperty("--scrollbar-offset",e+"px"),document.body.classList.add("kadence-scrollbar-fixer"))),setTimeout(function(){d.classList.add("active");var a=new Event("kadence-drawer-opened");if(window.dispatchEvent(a),c.dataset.setFocus&&b){var e=document.querySelector(c.dataset.setFocus);if(e){e.hasAttribute("aria-expanded")&&window.kadence.toggleAttribute(e,"aria-expanded","true","false");var f=e.value;e.value="",e.focus(),e.value=f}}},10),setTimeout(function(){d.classList.add("pop-animated")},f),d.classList.contains("popup-drawer")){var g=d.querySelectorAll("button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])"),h=g[0],i=g[g.length-1];document.addEventListener("keydown",function(a){let b="Tab"===a.key||9===a.keyCode;b&&(a.shiftKey?document.activeElement===h&&(i.focus(),a.preventDefault()):document.activeElement===i&&(h.focus(),a.preventDefault()))})}}},initToggleDrawer:function(){var a=document.querySelectorAll(".drawer-toggle");if(a.length){for(let b=0;b<a.length;b++)a[b].addEventListener("click",function(c){c.preventDefault(),window.kadence.toggleDrawer(a[b])});document.addEventListener("keyup",function(a){27===a.keyCode&&document.querySelectorAll(".popup-drawer.show-drawer.active")&&(a.preventDefault(),document.querySelectorAll(".popup-drawer.show-drawer.active").forEach(function(a){a.querySelector(".drawer-toggle")?window.kadence.toggleDrawer(a.querySelector(".drawer-toggle")):window.kadence.toggleDrawer(document.querySelector("*[data-toggle-target=\""+a.dataset.drawerTargetString+"\"]"))}))}),document.addEventListener("click",function(a){var b=a.target,c=document.querySelector(".show-drawer.active .drawer-overlay");b===c&&window.kadence.toggleDrawer(document.querySelector("*[data-toggle-target=\""+c.dataset.drawerTargetString+"\"]"));var d=document.querySelector("#search-drawer.show-drawer.active .drawer-content"),c=document.querySelector("#search-drawer.show-drawer.active .drawer-overlay");b===d&&window.kadence.toggleDrawer(document.querySelector("*[data-toggle-target=\""+c.dataset.drawerTargetString+"\"]"))})}},initMobileToggleSub:function(){var a=document.querySelectorAll(".has-collapse-sub-nav");a.forEach(function(a){var b=a.querySelector(".current-menu-item");b&&window.kadence.findParents(b,"li").forEach(function(a){var b=a.querySelector(".drawer-sub-toggle");b&&window.kadence.toggleDrawer(b,!0)})});var b=document.querySelectorAll(".drawer-sub-toggle");if(b.length)for(let a=0;a<b.length;a++)b[a].addEventListener("click",function(c){c.preventDefault(),window.kadence.toggleDrawer(b[a])})},initMobileToggleAnchor:function(){var a=document.getElementById("mobile-drawer");if(a){var b=a.querySelectorAll("a:not(.kt-tab-title)");if(b.length)for(let c=0;c<b.length;c++)b[c].addEventListener("click",function(){window.kadence.toggleDrawer(a.querySelector(".menu-toggle-close"),!1)})}},initTransHeaderPadding:function(){if(!document.body.classList.contains("no-header")&&document.body.classList.contains("transparent-header")&&document.body.classList.contains("mobile-transparent-header")){var a=document.querySelector(".entry-hero-container-inner"),b=document.querySelector("#masthead"),c=function(){b,a.style.paddingTop=kadenceConfig.breakPoints.desktop<=window.innerWidth?document.body.classList.contains("transparent-header")?b.offsetHeight+"px":0:document.body.classList.contains("mobile-transparent-header")?b.offsetHeight+"px":0};a&&(window.addEventListener("resize",c,!1),window.addEventListener("scroll",c,!1),window.addEventListener("load",c,!1),c())}},initStickyHeader:function(){var a=document.querySelector("#main-header .kadence-sticky-header"),b=document.querySelector("#mobile-header .kadence-sticky-header"),c=document.getElementById("wrapper"),d=document.querySelectorAll(".kadence-pro-fixed-above"),f=document.querySelectorAll(".kadence-before-wrapper-item"),g="mobile",h=0,i=0;parseInt(kadenceConfig.breakPoints.desktop)<window.innerWidth?(g="desktop",a&&(a.style.position="static",i=window.kadence.getOffset(a).top,a.style.position=null)):b&&(b.style.position="static",i=window.kadence.getOffset(b).top,b.style.position=null);var j=function(j){var e,k=window.kadence.getOffset(c).top;if(document.body.classList.toString().includes("boom_bar-static-top")){var l=document.querySelector(".boom_bar");k=window.kadence.getOffset(c).top-l.offsetHeight}if(f.length){var m=0;for(let a=0;a<f.length;a++)m+=f[a].offsetHeight;k=window.kadence.getOffset(c).top-m}if(d.length){var n=0;for(let a=0;a<d.length;a++)n+=d[a].offsetHeight;k=window.kadence.getOffset(c).top+n}if(document.body.classList.contains("woocommerce-demo-store")&&document.body.classList.contains("kadence-store-notice-placement-above")){var o=document.querySelector(".woocommerce-store-notice");o&&0<o.offsetHeight&&(k-=o.offsetHeight)}if(e=kadenceConfig.breakPoints.desktop<=window.innerWidth?a:b,!!e){kadenceConfig.breakPoints.desktop<=window.innerWidth?"mobile"===g?(i=window.kadence.getOffset(e).top,g="desktop"):j&&"updateActive"===j&&(e.style.top="auto",i=window.kadence.getOffset(e).top,g="desktop"):"desktop"===g?(i=window.kadence.getOffset(e).top,g="mobile"):j&&"updateActive"===j&&(e.style.top="auto",i=window.kadence.getOffset(e).top,g="mobile");var p=e.parentNode,q=e.getAttribute("data-shrink"),r=e.getAttribute("data-reveal-scroll-up"),s=parseInt(e.getAttribute("data-start-height"));if((!s||j&&void 0!==j.type&&"orientationchange"===j.type)&&(e.setAttribute("data-start-height",e.offsetHeight),s=e.offsetHeight,p.classList.contains("site-header-upper-inner-wrap")?(p.style.height=null,j&&void 0!==j.type&&"orientationchange"===j.type?e.classList.contains("item-is-fixed")?setTimeout(function(){p.style.height=Math.floor(p.offsetHeight+e.offsetHeight)+"px"},21):setTimeout(function(){p.style.height=p.offsetHeight+"px"},21):p.style.height=p.offsetHeight+"px"):p.classList.contains("site-header-inner-wrap")?(p.style.height=null,p.style.height=p.offsetHeight+"px"):p.style.height=e.offsetHeight+"px"),"true"===q){var t=e.getAttribute("data-shrink-height");if(t){if("true"!==r)var u=Math.floor(i-k);else if(window.scrollY>h)var u=Math.floor(Math.floor(i)-Math.floor(k)+Math.floor(s));else var u=Math.floor(i-k);var v=e.querySelectorAll(".custom-logo"),w=e.querySelector(".site-main-header-inner-wrap"),x=parseInt(w.getAttribute("data-start-height"));if(x||(w.setAttribute("data-start-height",w.offsetHeight),x=w.offsetHeight),window.scrollY<=u){if(w.style.height=x+"px",w.style.minHeight=x+"px",w.style.maxHeight=x+"px",v)for(let a,b=0;b<v.length;b++)a=v[b],a.style.maxHeight="100%";}else if(window.scrollY>u){var y=Math.max(t,x-(window.scrollY-(i-k)));if(w.style.height=y+"px",w.style.minHeight=y+"px",w.style.maxHeight=y+"px",v)for(let a,b=0;b<v.length;b++)a=v[b],a.style.maxHeight=y+"px"}}}if("true"===r){var z=Math.floor(i-k),A=window.scrollY,B=e.offsetHeight,C=h-A,D=window.getComputedStyle(e).getPropertyValue("transform").match(/(-?[0-9\.]+)/g);if(D&&void 0!==D[5]&&D[5])var E=parseInt(D[5])+C;else var E=0;var F=A>h;if(A<=z)e.style.transform="translateY(0px)";else if(F)e.classList.add("item-hidden-above"),e.style.transform="translateY("+(Math.abs(E)>B?-B:E)+"px)";else{var z=Math.floor(i-k);e.style.transform="translateY("+(0<E?0:E)+"px)",e.classList.remove("item-hidden-above")}h=A}else var z=Math.floor(i-k);window.scrollY==z?(e.style.top=k+"px",e.classList.add("item-is-fixed"),e.classList.add("item-at-start"),e.classList.remove("item-is-stuck"),p.classList.add("child-is-fixed"),document.body.classList.add("header-is-fixed")):window.scrollY>z?"true"===r?window.scrollY<B+60&&e.classList.contains("item-at-start")?(e.style.height=null,e.style.top=k+"px",e.classList.add("item-is-fixed"),e.classList.add("item-is-stuck"),p.classList.add("child-is-fixed"),document.body.classList.add("header-is-fixed")):(e.style.top=k+"px",e.classList.add("item-is-fixed"),e.classList.add("item-is-stuck"),e.classList.remove("item-at-start"),p.classList.add("child-is-fixed"),document.body.classList.add("header-is-fixed")):(e.style.top=k+"px",e.classList.add("item-is-fixed"),e.classList.remove("item-at-start"),e.classList.add("item-is-stuck"),p.classList.add("child-is-fixed"),document.body.classList.add("header-is-fixed")):e.classList.contains("item-is-fixed")&&(e.classList.remove("item-is-fixed"),e.classList.remove("item-at-start"),e.classList.remove("item-is-stuck"),e.style.height=null,e.style.top=null,p.classList.remove("child-is-fixed"),document.body.classList.remove("header-is-fixed"))}};if((a||b)&&(window.addEventListener("resize",j,!1),window.addEventListener("scroll",j,!1),window.addEventListener("load",j,!1),window.addEventListener("orientationchange",j),"complete"===document.readyState&&j("updateActive"),document.body.classList.contains("woocommerce-demo-store")&&document.body.classList.contains("kadence-store-notice-placement-above"))){var k=function(a,b){var c={root:document.documentElement},d=new IntersectionObserver(a=>{a.forEach(a=>{b(0<a.intersectionRatio)})},c);d.observe(a)};k(document.querySelector(".woocommerce-store-notice"),()=>{j("updateActive")})}},getTopOffset:function(a="scroll"){if("load"===a)var b=document.querySelector("#main-header .kadence-sticky-header"),c=document.querySelector("#mobile-header .kadence-sticky-header");else var b=document.querySelector("#main-header .kadence-sticky-header:not([data-reveal-scroll-up=\"true\"])"),c=document.querySelector("#mobile-header .kadence-sticky-header:not([data-reveal-scroll-up=\"true\"])");var d=0,e=0;if(kadenceConfig.breakPoints.desktop<=window.innerWidth){if(b){var f=b.getAttribute("data-shrink");d="true"!==f||b.classList.contains("site-header-inner-wrap")?Math.floor(b.offsetHeight):Math.floor(b.getAttribute("data-shrink-height"))}else d=0;document.body.classList.contains("admin-bar")&&(e=32)}else{if(c){var f=c.getAttribute("data-shrink");d="true"===f?Math.floor(c.getAttribute("data-shrink-height")):Math.floor(c.offsetHeight)}else d=0;document.body.classList.contains("admin-bar")&&(e=46)}let g=0,h=!1;const i=document.querySelector(".wp-block-kadence-header");i&&(h=kadenceConfig.breakPoints.desktop<=window.innerWidth?i.classList.contains("header-desktop-sticky"):i.classList.contains("header-mobile-sticky"),h&&(g=i.offsetHeight));const j=i&&h?g:d;return Math.floor(j+e+Math.floor(kadenceConfig.scrollOffset))},scrollToElement:function(a,b,c="scroll"){b=!("undefined"!=typeof b)||b;var d=window.kadence.getTopOffset(c),e=Math.floor(a.getBoundingClientRect().top)-d;window.scrollBy({top:e,left:0,behavior:"smooth"}),a.tabIndex="-1",a.focus({preventScroll:!0}),a.classList.contains("kt-title-item")&&a.firstElementChild.click(),b&&window.history.pushState("","","#"+a.id)},anchorScrollToCheck:function(a,b){if(b="undefined"==typeof b?null:b,a.target.getAttribute("href"))var c=a.target;else{var c=a.target.closest("a");if(!c)return;if(!c.getAttribute("href"))return}if(!(c.parentNode&&c.parentNode.hasAttribute("role")&&"tab"===c.parentNode.getAttribute("role"))&&!c.closest(".woocommerce-tabs ul.tabs")&&!(c.classList.contains("comment-reply-link")||"#respond"===c.getAttribute("href")||c.getAttribute("href").includes("#respond"))){var d=b?b.getAttribute("href").substring(b.getAttribute("href").indexOf("#")):c.getAttribute("href").substring(c.getAttribute("href").indexOf("#"));var e=document.getElementById(d.replace("#",""));e&&(e?.classList?.contains("kt-accordion-pane")||(a.preventDefault(),window.kadence.scrollToElement(e),window.kadence.updateActiveAnchors()))}},initStickySidebarWidget:function(){if(document.body.classList.contains("has-sticky-sidebar-widget")){var a=window.kadence.getTopOffset(),b=document.querySelector("#secondary .sidebar-inner-wrap .widget:last-child");b&&(b.style.top=Math.floor(a+20)+"px",b.style.maxHeight="calc(100vh - "+Math.floor(a+20)+"px)")}},initStickySidebar:function(){if(document.body.classList.contains("has-sticky-sidebar")){var a=window.kadence.getTopOffset(),b=document.querySelector("#secondary .sidebar-inner-wrap");b&&(b.style.top=Math.floor(a+20)+"px",b.style.maxHeight="calc(100vh - "+Math.floor(a+20)+"px)")}},initActiveAnchors:function(){""!=window.location.hash&&window.kadence.updateActiveAnchors(),window.onhashchange=function(){window.kadence.updateActiveAnchors()}},updateActiveAnchors:function(){const a=document.querySelectorAll(".menu-item");a.forEach(function(a){const b=a.querySelector("a");b?.href&&b.href.includes("#")&&(window.location.href==b.href?a.classList.add("current-menu-item"):a.classList.remove("current-menu-item"))})},initAnchorScrollTo:function(){if(!document.body.classList.contains("no-anchor-scroll")){if(window.onhashchange=function(){""===window.location.hash&&(window.scrollTo({top:0,behavior:"smooth"}),document.activeElement.blur())},""!=window.location.hash){var a,b=location.hash.substring(1);if(!/^[A-z0-9_-]+$/.test(b))return;a=document.getElementById(b),a&&window.setTimeout(function(){window.kadence.scrollToElement(a,!1,"load")},100)}var c=document.querySelectorAll("a[href*=\\#]:not([href=\\#]):not(.scroll-ignore):not([data-tab]):not([data-toggle]):not(.woocommerce-tabs a):not(.tabs a)");c.length&&c.forEach(function(a){try{var b=new URL(a.href);b.pathname===window.location.pathname&&a.addEventListener("click",function(a){window.kadence.anchorScrollToCheck(a)})}catch(b){console.log("ClassList: "+a.classList,"Invalid URL")}})}},initScrollToTop:function(){var a=document.getElementById("kt-scroll-up");if(a){var b=function(){100<window.scrollY?(a.classList.add("scroll-visible"),a.setAttribute("aria-hidden",!1)):(a.classList.remove("scroll-visible"),a.setAttribute("aria-hidden",!0))};window.addEventListener("scroll",b),b(),a.addEventListener("click",function(a){a.preventDefault(),window.scrollTo({top:0,behavior:"smooth"}),document.querySelector(".skip-link").focus({preventScroll:!0}),document.activeElement.blur()})}var c=document.getElementById("kt-scroll-up-reader");c&&c.addEventListener("click",function(a){a.preventDefault(),window.scrollTo({top:0,behavior:"smooth"}),document.querySelector(".skip-link").focus()})},initHoverSubmenuAria:function(){var a=document.querySelectorAll(".header-navigation.nav--toggle-sub:not(.click-to-open)");a.forEach(function(a){var b=a.querySelectorAll(".menu-item-has-children");b.forEach(function(a){var b=a.querySelector(".dropdown-nav-special-toggle");b&&(a.addEventListener("mouseenter",function(){b.setAttribute("aria-expanded","true")}),a.addEventListener("mouseleave",function(c){var d=c.relatedTarget;d&&a.contains(d)||b.setAttribute("aria-expanded","false")}))})})},initClickToOpen:function(){const a=document.querySelectorAll(".header-navigation.click-to-open li.menu-item--has-toggle");a.forEach(function(a){const b=a.querySelector("a"),c=a.querySelector("button[class=\"dropdown-nav*\"]");[b,c].forEach(function(b){b&&b.addEventListener("click",function(b){b.preventDefault();const c=a.querySelector("ul.sub-menu");if(c){const b=c.classList.contains("opened");c.classList.toggle("opened",!b),a.classList.toggle("menu-item--toggled-on",!b),c.classList.toggle("toggle-show",!b);var d=a.querySelector(".dropdown-nav-special-toggle");d&&d.setAttribute("aria-expanded",(!b).toString());const e=Array.from(a.parentNode.children).filter(b=>b!==a);if(e.forEach(function(a){const b=a.querySelector(":scope > ul.sub-menu");if(b){b.classList.remove("opened"),a.classList.remove("menu-item--toggled-on"),b.classList.remove("toggle-show");var c=a.querySelector(".dropdown-nav-special-toggle");c&&c.setAttribute("aria-expanded","false")}}),!b){const b=d=>{if(!a.contains(d.target)){c.classList.remove("opened"),a.classList.remove("menu-item--toggled-on"),c.classList.remove("toggle-show");var e=a.querySelector(".dropdown-nav-special-toggle");e&&e.setAttribute("aria-expanded","false"),document.removeEventListener("click",b)}};document.addEventListener("click",b)}}})})})},init:function(){window.kadence.initNavToggleSubmenus(),window.kadence.initToggleDrawer(),window.kadence.initMobileToggleAnchor(),window.kadence.initMobileToggleSub(),window.kadence.initOutlineToggle(),window.kadence.initStickyHeader(),window.kadence.initStickySidebar(),window.kadence.initStickySidebarWidget(),window.kadence.initTransHeaderPadding(),window.kadence.initAnchorScrollTo(),window.kadence.initScrollToTop(),window.kadence.initActiveAnchors(),window.kadence.initHoverSubmenuAria(),window.kadence.initClickToOpen()}},"loading"===document.readyState?document.addEventListener("DOMContentLoaded",window.kadence.init):window.kadence.init()})();
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).DOMPurify=t()}(this,(function(){"use strict";const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:o,getOwnPropertyDescriptor:r}=Object;let{freeze:i,seal:a,create:l}=Object,{apply:c,construct:s}="undefined"!=typeof Reflect&&Reflect;i||(i=function(e){return e}),a||(a=function(e){return e}),c||(c=function(e,t,n){return e.apply(t,n)}),s||(s=function(e,t){return new e(...t)});const u=R(Array.prototype.forEach),m=R(Array.prototype.lastIndexOf),p=R(Array.prototype.pop),f=R(Array.prototype.push),d=R(Array.prototype.splice),h=R(String.prototype.toLowerCase),g=R(String.prototype.toString),T=R(String.prototype.match),y=R(String.prototype.replace),E=R(String.prototype.indexOf),A=R(String.prototype.trim),_=R(Object.prototype.hasOwnProperty),S=R(RegExp.prototype.test),b=(N=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s(N,t)});var N;function R(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return c(e,t,o)}}function w(e,o){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h;t&&t(e,null);let i=o.length;for(;i--;){let t=o[i];if("string"==typeof t){const e=r(t);e!==t&&(n(o)||(o[i]=e),t=e)}e[t]=!0}return e}function O(e){for(let t=0;t<e.length;t++){_(e,t)||(e[t]=null)}return e}function D(t){const n=l(null);for(const[o,r]of e(t)){_(t,o)&&(Array.isArray(r)?n[o]=O(r):r&&"object"==typeof r&&r.constructor===Object?n[o]=D(r):n[o]=r)}return n}function v(e,t){for(;null!==e;){const n=r(e,t);if(n){if(n.get)return R(n.get);if("function"==typeof n.value)return R(n.value)}e=o(e)}return function(){return null}}const L=i(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),C=i(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),x=i(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),I=i(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),M=i(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),k=i(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),U=i(["#text"]),z=i(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),P=i(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),H=i(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),F=i(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),B=a(/\{\{[\w\W]*|[\w\W]*\}\}/gm),W=a(/<%[\w\W]*|[\w\W]*%>/gm),G=a(/\$\{[\w\W]*/gm),Y=a(/^data-[\-\w.\u00B7-\uFFFF]+$/),j=a(/^aria-[\-\w]+$/),X=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),q=a(/^(?:\w+script|data):/i),$=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),K=a(/^html$/i),V=a(/^[a-z][.\w]*(-[.\w]+)+$/i);var Z=Object.freeze({__proto__:null,ARIA_ATTR:j,ATTR_WHITESPACE:$,CUSTOM_ELEMENT:V,DATA_ATTR:Y,DOCTYPE_NAME:K,ERB_EXPR:W,IS_ALLOWED_URI:X,IS_SCRIPT_OR_DATA:q,MUSTACHE_EXPR:B,TMPLIT_EXPR:G});const J=1,Q=3,ee=7,te=8,ne=9,oe=function(){return"undefined"==typeof window?null:window};var re=function t(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:oe();const o=e=>t(e);if(o.version="3.2.6",o.removed=[],!n||!n.document||n.document.nodeType!==ne||!n.Element)return o.isSupported=!1,o;let{document:r}=n;const a=r,c=a.currentScript,{DocumentFragment:s,HTMLTemplateElement:N,Node:R,Element:O,NodeFilter:B,NamedNodeMap:W=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:G,DOMParser:Y,trustedTypes:j}=n,q=O.prototype,$=v(q,"cloneNode"),V=v(q,"remove"),re=v(q,"nextSibling"),ie=v(q,"childNodes"),ae=v(q,"parentNode");if("function"==typeof N){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let le,ce="";const{implementation:se,createNodeIterator:ue,createDocumentFragment:me,getElementsByTagName:pe}=r,{importNode:fe}=a;let de={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};o.isSupported="function"==typeof e&&"function"==typeof ae&&se&&void 0!==se.createHTMLDocument;const{MUSTACHE_EXPR:he,ERB_EXPR:ge,TMPLIT_EXPR:Te,DATA_ATTR:ye,ARIA_ATTR:Ee,IS_SCRIPT_OR_DATA:Ae,ATTR_WHITESPACE:_e,CUSTOM_ELEMENT:Se}=Z;let{IS_ALLOWED_URI:be}=Z,Ne=null;const Re=w({},[...L,...C,...x,...M,...U]);let we=null;const Oe=w({},[...z,...P,...H,...F]);let De=Object.seal(l(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ve=null,Le=null,Ce=!0,xe=!0,Ie=!1,Me=!0,ke=!1,Ue=!0,ze=!1,Pe=!1,He=!1,Fe=!1,Be=!1,We=!1,Ge=!0,Ye=!1,je=!0,Xe=!1,qe={},$e=null;const Ke=w({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ve=null;const Ze=w({},["audio","video","img","source","image","track"]);let Je=null;const Qe=w({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),et="http://www.w3.org/1998/Math/MathML",tt="http://www.w3.org/2000/svg",nt="http://www.w3.org/1999/xhtml";let ot=nt,rt=!1,it=null;const at=w({},[et,tt,nt],g);let lt=w({},["mi","mo","mn","ms","mtext"]),ct=w({},["annotation-xml"]);const st=w({},["title","style","font","a","script"]);let ut=null;const mt=["application/xhtml+xml","text/html"];let pt=null,ft=null;const dt=r.createElement("form"),ht=function(e){return e instanceof RegExp||e instanceof Function},gt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ft||ft!==e){if(e&&"object"==typeof e||(e={}),e=D(e),ut=-1===mt.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,pt="application/xhtml+xml"===ut?g:h,Ne=_(e,"ALLOWED_TAGS")?w({},e.ALLOWED_TAGS,pt):Re,we=_(e,"ALLOWED_ATTR")?w({},e.ALLOWED_ATTR,pt):Oe,it=_(e,"ALLOWED_NAMESPACES")?w({},e.ALLOWED_NAMESPACES,g):at,Je=_(e,"ADD_URI_SAFE_ATTR")?w(D(Qe),e.ADD_URI_SAFE_ATTR,pt):Qe,Ve=_(e,"ADD_DATA_URI_TAGS")?w(D(Ze),e.ADD_DATA_URI_TAGS,pt):Ze,$e=_(e,"FORBID_CONTENTS")?w({},e.FORBID_CONTENTS,pt):Ke,ve=_(e,"FORBID_TAGS")?w({},e.FORBID_TAGS,pt):D({}),Le=_(e,"FORBID_ATTR")?w({},e.FORBID_ATTR,pt):D({}),qe=!!_(e,"USE_PROFILES")&&e.USE_PROFILES,Ce=!1!==e.ALLOW_ARIA_ATTR,xe=!1!==e.ALLOW_DATA_ATTR,Ie=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Me=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,ke=e.SAFE_FOR_TEMPLATES||!1,Ue=!1!==e.SAFE_FOR_XML,ze=e.WHOLE_DOCUMENT||!1,Fe=e.RETURN_DOM||!1,Be=e.RETURN_DOM_FRAGMENT||!1,We=e.RETURN_TRUSTED_TYPE||!1,He=e.FORCE_BODY||!1,Ge=!1!==e.SANITIZE_DOM,Ye=e.SANITIZE_NAMED_PROPS||!1,je=!1!==e.KEEP_CONTENT,Xe=e.IN_PLACE||!1,be=e.ALLOWED_URI_REGEXP||X,ot=e.NAMESPACE||nt,lt=e.MATHML_TEXT_INTEGRATION_POINTS||lt,ct=e.HTML_INTEGRATION_POINTS||ct,De=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ht(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(De.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ht(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(De.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(De.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ke&&(xe=!1),Be&&(Fe=!0),qe&&(Ne=w({},U),we=[],!0===qe.html&&(w(Ne,L),w(we,z)),!0===qe.svg&&(w(Ne,C),w(we,P),w(we,F)),!0===qe.svgFilters&&(w(Ne,x),w(we,P),w(we,F)),!0===qe.mathMl&&(w(Ne,M),w(we,H),w(we,F))),e.ADD_TAGS&&(Ne===Re&&(Ne=D(Ne)),w(Ne,e.ADD_TAGS,pt)),e.ADD_ATTR&&(we===Oe&&(we=D(we)),w(we,e.ADD_ATTR,pt)),e.ADD_URI_SAFE_ATTR&&w(Je,e.ADD_URI_SAFE_ATTR,pt),e.FORBID_CONTENTS&&($e===Ke&&($e=D($e)),w($e,e.FORBID_CONTENTS,pt)),je&&(Ne["#text"]=!0),ze&&w(Ne,["html","head","body"]),Ne.table&&(w(Ne,["tbody"]),delete ve.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw b('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw b('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');le=e.TRUSTED_TYPES_POLICY,ce=le.createHTML("")}else void 0===le&&(le=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(n=t.getAttribute(o));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(j,c)),null!==le&&"string"==typeof ce&&(ce=le.createHTML(""));i&&i(e),ft=e}},Tt=w({},[...C,...x,...I]),yt=w({},[...M,...k]),Et=function(e){f(o.removed,{element:e});try{ae(e).removeChild(e)}catch(t){V(e)}},At=function(e,t){try{f(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){f(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(Fe||Be)try{Et(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},_t=function(e){let t=null,n=null;if(He)e="<remove></remove>"+e;else{const t=T(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===ut&&ot===nt&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=le?le.createHTML(e):e;if(ot===nt)try{t=(new Y).parseFromString(o,ut)}catch(e){}if(!t||!t.documentElement){t=se.createDocument(ot,"template",null);try{t.documentElement.innerHTML=rt?ce:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),ot===nt?pe.call(t,ze?"html":"body")[0]:ze?t.documentElement:i},St=function(e){return ue.call(e.ownerDocument||e,e,B.SHOW_ELEMENT|B.SHOW_COMMENT|B.SHOW_TEXT|B.SHOW_PROCESSING_INSTRUCTION|B.SHOW_CDATA_SECTION,null)},bt=function(e){return e instanceof G&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof W)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Nt=function(e){return"function"==typeof R&&e instanceof R};function Rt(e,t,n){u(e,(e=>{e.call(o,t,n,ft)}))}const wt=function(e){let t=null;if(Rt(de.beforeSanitizeElements,e,null),bt(e))return Et(e),!0;const n=pt(e.nodeName);if(Rt(de.uponSanitizeElement,e,{tagName:n,allowedTags:Ne}),Ue&&e.hasChildNodes()&&!Nt(e.firstElementChild)&&S(/<[/\w!]/g,e.innerHTML)&&S(/<[/\w!]/g,e.textContent))return Et(e),!0;if(e.nodeType===ee)return Et(e),!0;if(Ue&&e.nodeType===te&&S(/<[/\w]/g,e.data))return Et(e),!0;if(!Ne[n]||ve[n]){if(!ve[n]&&Dt(n)){if(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,n))return!1;if(De.tagNameCheck instanceof Function&&De.tagNameCheck(n))return!1}if(je&&!$e[n]){const t=ae(e)||e.parentNode,n=ie(e)||e.childNodes;if(n&&t){for(let o=n.length-1;o>=0;--o){const r=$(n[o],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,re(e))}}}return Et(e),!0}return e instanceof O&&!function(e){let t=ae(e);t&&t.tagName||(t={namespaceURI:ot,tagName:"template"});const n=h(e.tagName),o=h(t.tagName);return!!it[e.namespaceURI]&&(e.namespaceURI===tt?t.namespaceURI===nt?"svg"===n:t.namespaceURI===et?"svg"===n&&("annotation-xml"===o||lt[o]):Boolean(Tt[n]):e.namespaceURI===et?t.namespaceURI===nt?"math"===n:t.namespaceURI===tt?"math"===n&&ct[o]:Boolean(yt[n]):e.namespaceURI===nt?!(t.namespaceURI===tt&&!ct[o])&&!(t.namespaceURI===et&&!lt[o])&&!yt[n]&&(st[n]||!Tt[n]):!("application/xhtml+xml"!==ut||!it[e.namespaceURI]))}(e)?(Et(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!S(/<\/no(script|embed|frames)/i,e.innerHTML)?(ke&&e.nodeType===Q&&(t=e.textContent,u([he,ge,Te],(e=>{t=y(t,e," ")})),e.textContent!==t&&(f(o.removed,{element:e.cloneNode()}),e.textContent=t)),Rt(de.afterSanitizeElements,e,null),!1):(Et(e),!0)},Ot=function(e,t,n){if(Ge&&("id"===t||"name"===t)&&(n in r||n in dt))return!1;if(xe&&!Le[t]&&S(ye,t));else if(Ce&&S(Ee,t));else if(!we[t]||Le[t]){if(!(Dt(e)&&(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,e)||De.tagNameCheck instanceof Function&&De.tagNameCheck(e))&&(De.attributeNameCheck instanceof RegExp&&S(De.attributeNameCheck,t)||De.attributeNameCheck instanceof Function&&De.attributeNameCheck(t))||"is"===t&&De.allowCustomizedBuiltInElements&&(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,n)||De.tagNameCheck instanceof Function&&De.tagNameCheck(n))))return!1}else if(Je[t]);else if(S(be,y(n,_e,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==E(n,"data:")||!Ve[e]){if(Ie&&!S(Ae,y(n,_e,"")));else if(n)return!1}else;return!0},Dt=function(e){return"annotation-xml"!==e&&T(e,Se)},vt=function(e){Rt(de.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||bt(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:we,forceKeepAttr:void 0};let r=t.length;for(;r--;){const i=t[r],{name:a,namespaceURI:l,value:c}=i,s=pt(a),m=c;let f="value"===a?m:A(m);if(n.attrName=s,n.attrValue=f,n.keepAttr=!0,n.forceKeepAttr=void 0,Rt(de.uponSanitizeAttribute,e,n),f=n.attrValue,!Ye||"id"!==s&&"name"!==s||(At(a,e),f="user-content-"+f),Ue&&S(/((--!?|])>)|<\/(style|title)/i,f)){At(a,e);continue}if(n.forceKeepAttr)continue;if(!n.keepAttr){At(a,e);continue}if(!Me&&S(/\/>/i,f)){At(a,e);continue}ke&&u([he,ge,Te],(e=>{f=y(f,e," ")}));const d=pt(e.nodeName);if(Ot(d,s,f)){if(le&&"object"==typeof j&&"function"==typeof j.getAttributeType)if(l);else switch(j.getAttributeType(d,s)){case"TrustedHTML":f=le.createHTML(f);break;case"TrustedScriptURL":f=le.createScriptURL(f)}if(f!==m)try{l?e.setAttributeNS(l,a,f):e.setAttribute(a,f),bt(e)?Et(e):p(o.removed)}catch(t){At(a,e)}}else At(a,e)}Rt(de.afterSanitizeAttributes,e,null)},Lt=function e(t){let n=null;const o=St(t);for(Rt(de.beforeSanitizeShadowDOM,t,null);n=o.nextNode();)Rt(de.uponSanitizeShadowNode,n,null),wt(n),vt(n),n.content instanceof s&&e(n.content);Rt(de.afterSanitizeShadowDOM,t,null)};return o.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,r=null,i=null,l=null;if(rt=!e,rt&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Nt(e)){if("function"!=typeof e.toString)throw b("toString is not a function");if("string"!=typeof(e=e.toString()))throw b("dirty is not a string, aborting")}if(!o.isSupported)return e;if(Pe||gt(t),o.removed=[],"string"==typeof e&&(Xe=!1),Xe){if(e.nodeName){const t=pt(e.nodeName);if(!Ne[t]||ve[t])throw b("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof R)n=_t("\x3c!----\x3e"),r=n.ownerDocument.importNode(e,!0),r.nodeType===J&&"BODY"===r.nodeName||"HTML"===r.nodeName?n=r:n.appendChild(r);else{if(!Fe&&!ke&&!ze&&-1===e.indexOf("<"))return le&&We?le.createHTML(e):e;if(n=_t(e),!n)return Fe?null:We?ce:""}n&&He&&Et(n.firstChild);const c=St(Xe?e:n);for(;i=c.nextNode();)wt(i),vt(i),i.content instanceof s&&Lt(i.content);if(Xe)return e;if(Fe){if(Be)for(l=me.call(n.ownerDocument);n.firstChild;)l.appendChild(n.firstChild);else l=n;return(we.shadowroot||we.shadowrootmode)&&(l=fe.call(a,l,!0)),l}let m=ze?n.outerHTML:n.innerHTML;return ze&&Ne["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&S(K,n.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+m),ke&&u([he,ge,Te],(e=>{m=y(m,e," ")})),le&&We?le.createHTML(m):m},o.setConfig=function(){gt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Pe=!0},o.clearConfig=function(){ft=null,Pe=!1},o.isValidAttribute=function(e,t,n){ft||gt({});const o=pt(e),r=pt(t);return Ot(o,r,n)},o.addHook=function(e,t){"function"==typeof t&&f(de[e],t)},o.removeHook=function(e,t){if(void 0!==t){const n=m(de[e],t);return-1===n?void 0:d(de[e],n,1)[0]}return p(de[e])},o.removeHooks=function(e){de[e]=[]},o.removeAllHooks=function(){de={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},o}();return re}));
(function($, elementor){
"use strict";
var WprPopups={
init: function(){
$(document).ready(function(){
if(! $('.wpr-template-popup').length||WprPopups.editorCheck()){
return;
}
WprPopups.openPopupInit();
WprPopups.closePopupInit();
});
},
openPopupInit: function(){
$('.wpr-template-popup').each(function(){
var popup=$(this),
popupID=WprPopups.getID(popup);
if(! WprPopups.checkAvailability(popupID)){
return;
}
if(! WprPopups.checkStopShowingAfterDate(popup)){
return;
}
WprPopups.setLocalStorage(popup, 'show');
var getLocalStorage=JSON.parse(localStorage.getItem('WprPopupSettings')),
settings=getLocalStorage[ popupID ];
if(! WprPopups.checkAvailableDevice(popup, settings)){
return false;
}
WprPopups.popupTriggerInit(popup);
if('load'===settings.popup_trigger){
var loadDelay=settings.popup_load_delay * 1000;
$(window).on('load', function(){
setTimeout(function(){
WprPopups.openPopup(popup, settings);
}, loadDelay);
});
}else if('scroll'===settings.popup_trigger){
$(window).on('scroll', function(){
var scrollPercent=$(window).scrollTop() / ($(document).height() - $(window).height()),
scrollPercent=Math.round(scrollPercent * 100);
if(scrollPercent >=settings.popup_scroll_progress&&! popup.hasClass('wpr-popup-open')){
WprPopups.openPopup(popup, settings);
}});
}else if('element-scroll'===settings.popup_trigger){
$(window).on('scroll', function(){
var element=$(settings.popup_element_scroll),
ScrollBottom=$(window).scrollTop() + $(window).height();
if(! element.length){
return;
}
if(element.offset().top < ScrollBottom&&! popup.hasClass('wpr-popup-open')){
WprPopups.openPopup(popup, settings);
}});
}else if('date'===settings.popup_trigger){
var nowDate=Date.now(),
startDate=Date.parse(settings.popup_specific_date);
if(startDate < nowDate){
setTimeout(function(){
WprPopups.openPopup(popup, settings);
}, 1000);
}}else if('inactivity'===settings.popup_trigger){
var idleTimer=null,
inactivityTime=settings.popup_inactivity_time * 1000;
$('*').bind('mousemove click keyup scroll resize', function (){
if(popup.hasClass('wpr-popup-open')){
return;
}
clearTimeout(idleTimer);
idleTimer=setTimeout(function(){
WprPopups.openPopup(popup, settings);
}, inactivityTime);
});
$('body').trigger('mousemove');
}else if('exit'===settings.popup_trigger){
$(document).on('mouseleave', 'body', function(event){
if(! popup.hasClass('wpr-popup-open')){
WprPopups.openPopup(popup, settings);
}});
}else if('custom'===settings.popup_trigger){
$(settings.popup_custom_trigger).on('click', function(){
WprPopups.openPopup(popup, settings);
});
$(settings.popup_custom_trigger).css('cursor', 'pointer');
}
if('0px'!==popup.find('.wpr-popup-container-inner').css('height')){
const ps=new PerfectScrollbar(popup.find('.wpr-popup-container-inner')[0], {
suppressScrollX: true
});
}});
},
openPopup: function(popup, settings){
if('notification'===settings.popup_display_as){
popup.addClass('wpr-popup-notification');
setTimeout(function(){
$('body').animate({
'padding-top':popup.find('.wpr-popup-container').outerHeight() +'px'
}, settings.popup_animation_duration * 1000, 'linear');
}, 10);
}
if(settings.popup_disable_page_scroll&&'modal'===settings.popup_display_as){
$('body').css('overflow', 'hidden');
}
popup.addClass('wpr-popup-open').show();
popup.find('.wpr-popup-container').addClass('animated '+ settings.popup_animation);
$(window).trigger('resize');
$('.wpr-popup-overlay').hide().fadeIn();
popup.find('.wpr-popup-close-btn').css('opacity', '0');
setTimeout(function(){
popup.find('.wpr-popup-close-btn').animate({
'opacity':'1'
}, 500);
}, settings.popup_close_button_display_delay * 1000);
if(false!==settings.popup_automatic_close_switch){
setTimeout(function(){
WprPopups.closePopup(popup);
}, settings.popup_automatic_close_delay * 1000);
}},
closePopupInit: function(){
$('.wpr-popup-close-btn').on('click', function(){
WprPopups.closePopup($(this).closest('.wpr-template-popup'));
});
$('.wpr-popup-overlay').on('click', function(){
var popup=$(this).closest('.wpr-template-popup'),
popupID=WprPopups.getID(popup),
settings=WprPopups.getLocalStorage(popupID);
if(false==settings.popup_overlay_disable_close){
WprPopups.closePopup(popup);
}});
$(document).on('keyup', function(event){
var popup=$('.wpr-popup-open');
if(popup.length){
var	popupID=WprPopups.getID(popup),
settings=WprPopups.getLocalStorage(popupID);
if(27==event.keyCode&&false==settings.popup_disable_esc_key){
WprPopups.closePopup(popup);
}}
});
},
closePopup: function(popup,){
var popupID=WprPopups.getID(popup),
settings=WprPopups.getLocalStorage(popupID);
if('notification'===settings.popup_display_as){
$('body').css('padding-top', 0);
}
WprPopups.setLocalStorage(popup, 'hide');
if('modal'===settings.popup_display_as){
popup.fadeOut();
}else{
popup.hide();
}
$('body').css('overflow', 'visible');
$(window).trigger('resize');
},
popupTriggerInit: function(popup){
var popupTrigger=popup.find('.wpr-popup-trigger-button');
if(! popupTrigger.length){
return;
}
popupTrigger.on('click', function(){
var settings=JSON.parse(localStorage.getItem('WprPopupSettings'))||{};
var popupTriggerType=$(this).attr('data-trigger'),
popupShowDelay=$(this).attr('data-show-delay'),
popupRedirect=$(this).attr('data-redirect'),
popupRedirectURL=$(this).attr('data-redirect-url'),
popupID=WprPopups.getID(popup);
if('close'===popupTriggerType){
settings[popupID].popup_show_again_delay=parseInt(popupShowDelay, 10);
settings[popupID].popup_close_time=Date.now();
}else if('close-permanently'===popupTriggerType){
settings[popupID].popup_show_again_delay=parseInt(popupShowDelay, 10);
settings[popupID].popup_close_time=Date.now();
}else if('back'===popupTriggerType){
window.history.back();
}
WprPopups.closePopup(popup);
localStorage.setItem('WprPopupSettings', JSON.stringify(settings));
if('back'!==popupTriggerType&&'yes'===popupRedirect){
setTimeout(function(){
window.location.href=popupRedirectURL;
}, 100);
}});
},
getLocalStorage: function(id){
var getLocalStorage=JSON.parse(localStorage.getItem('WprPopupSettings'));
if(null==getLocalStorage){
return false;
}
var settings=getLocalStorage[ id ];
if(null==settings){
return false;
}
return settings;
},
setLocalStorage: function(popup, display){
var popupID=WprPopups.getID(popup);
var dataSettings=JSON.parse(popup.attr('data-settings')),
settings=JSON.parse(localStorage.getItem('WprPopupSettings'))||{};
settings[popupID]=dataSettings;
if('hide'===display){
settings[popupID].popup_close_time=Date.now();
}else{
settings[popupID].popup_close_time=false;
}
localStorage.setItem('WprPopupSettings', JSON.stringify(settings));
},
checkStopShowingAfterDate: function(popup){
var settings=JSON.parse(popup.attr('data-settings'));
var currentDate=Date.now();
if('yes'===settings.popup_stop_after_date){
if(currentDate >=Date.parse(settings.popup_stop_after_date_select)){
return false;
}}
return true;
},
checkAvailability: function(id){
var popup=$('#wpr-popup-id-'+ id),
dataSettings=JSON.parse(popup.attr('data-settings')),
currentURL=window.location.href;
if('yes'===dataSettings.popup_show_via_referral&&-1===currentURL.indexOf('wpr_templates=user-popup')){
if(currentURL.indexOf(dataSettings.popup_referral_keyword)==-1){
return;
}}
if(false===WprPopups.getLocalStorage(id)){
return true;
}
var trigger=popup.find('.wpr-popup-trigger-button'),
triggerShowDelay=trigger.attr('data-show-delay');
var currentDate=Date.now();
var settings=WprPopups.getLocalStorage(id);
if(triggerShowDelay){
var permanent=true;
trigger.each(function(){
var delay=$(this).attr('data-show-delay');
if(settings.popup_show_again_delay==parseInt(delay, 10)){
permanent=false;
}});
if(true===permanent){
return true;
}}else{
if(settings.popup_show_again_delay!=dataSettings.popup_show_again_delay){
return true;
}}
var closeDate=settings.popup_close_time||0,
showDelay=parseInt(settings.popup_show_again_delay, 10);
if(closeDate + showDelay >=currentDate){
return false;
}else{
return true;
}},
checkAvailableDevice: function(popup, settings){
var viewport=$('body').prop('clientWidth');
if(viewport > 1024){
return Boolean(settings.popup_show_on_device);
}else if(viewport > 768){
return Boolean(settings.popup_show_on_device_tablet);
}else{
return Boolean(settings.popup_show_on_device_mobile);
}},
getID: function(popup){
var id=popup.attr('id');
return id.replace('wpr-popup-id-', '');
},
editorCheck: function(){
return $('body').hasClass('elementor-editor-active') ? true:false;
}}
WprPopups.init();
}(jQuery, window.elementorFrontend));