var ComponentsNoUiSliders=function(){var demo1=function(){$('#slider_0').noUiSlider({direction:(Metronic.isRTL()?"rtl":"ltr"),start:40,connect:"lower",range:{'min':0,'max':100}});}
var demo2=function(){$("#slider_1").noUiSlider({direction:(Metronic.isRTL()?"rtl":"ltr"),start:[20,80],range:{min:0,max:100},connect:true,handles:2});}
var demo3=function(){$("#nonlinear").noUiSlider({connect:true,behaviour:'tap',start:[500,4000],range:{'min':[0],'10%':[500,500],'50%':[4000,1000],'max':[10000]}});function leftValue(value,handle,slider){$(this).text(handle.parent()[0].style.left);}
$("#nonlinear").Link('lower').to($('#lower-value'));$("#nonlinear").Link('lower').to($('#lower-offset'),leftValue);$("#nonlinear").Link('upper').to($('#upper-value'));$("#nonlinear").Link('upper').to($('#upper-offset'),leftValue);}
var demo4=function(){var lockedState=false,values=[60,80],slider1=$("#slider1"),slider2=$("#slider2");$("#slider2-btn").click(function(){lockedState=!lockedState;$(this).text(lockedState?'unlock':'lock');});function crossUpdate(value,handle,slider){if(!lockedState)return;var lValue=slider1.is(slider)?1:0,hValue=lValue?0:1;value-=(values[hValue]-values[lValue]);$(this).val(value);}
slider1.noUiSlider({start:60,animate:false,range:{min:50,max:100}});slider2.noUiSlider({start:80,animate:false,range:{min:50,max:100}});$(".slider").on('set',function(){values=[Number(slider1.val()),Number(slider2.val())];});slider1.Link('lower').to(slider2,crossUpdate);slider1.Link('lower').to($("#slider1-span"));slider2.Link('lower').to(slider1,crossUpdate);slider2.Link('lower').to($("#slider2-span"));}
var demo5=function(){function timestamp(str){return new Date(str).getTime();}
var
weekdays=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],months=["January","February","March","April","May","June","July","August","September","October","November","December"];function nth(d){if(d>3&&d<21)return 'th';switch(d%10){case 1:return "st";case 2:return "nd";case 3:return "rd";default:return "th";}}
function formatDate(date){return weekdays[date.getDay()]+", "+
date.getDate()+nth(date.getDate())+" "+
months[date.getMonth()]+" "+
date.getFullYear();}
function setDate(value){$(this).html(formatDate(new Date(+value)));}
$("#slider-date").noUiSlider({range:{min:timestamp('2010'),max:timestamp('2016')},step:7*24*60*60*1000,start:[timestamp('2011'),timestamp('2015')],//
format:wNumb({decimals:0})});$("#slider-date").Link('lower').to($("#event-start"),setDate);$("#slider-date").Link('upper').to($("#event-end"),setDate);}
var demo6=function(){$('#soft').noUiSlider({start:50,range:{min:0,max:100}});$('#soft').noUiSlider_pips({mode:'values',values:[20,80],density:4});$('#soft').on('set',function(event,value){if(value<20){$(this).val(20);}else if(value>80){$(this).val(80);}});}
return{init:function(){demo1();demo2();demo3();demo4();demo5();demo6();}};}();