示例#1
0
文件: index.js 项目: airportyh/dialog
Dialog.prototype.overlay = function(){
  var self = this;
  var o = overlay({ closable: true });
  o.on('hide', function(){
    self._overlay = null;
    self.hide();
  });
  this._overlay = o;
  return this;
};
(function(t,e){if("object"==typeof exports){var a=require("jquery");module.exports=e(a)}else"function"==typeof define&&define.amd&&define(["jquery"],e)})(this,function(){(function(t,e){"use strict";var a=e,n={},r=t.MT=t.MT||{};r.ChartAPI=n;n.Data={};n.Data.getData=function(t,e,n,r){var i,o,s,h;t&&t.done(function(t){i||(i="string"==typeof t?""+t:a.isArray(t)?a.map(t,function(t){return a.extend({},t)}):a.extend({},t));n(i)}).fail(function(t){o={404:"Data is not found",403:"Data is forbidden to access"};s="Some error occured in the data fetching process";h=t.status?"error-"+t.status:"error-unknown";r&&(r.$errormsg=a('<div class="error '+h+'">'+(o[t.status]||s)+"</div>").appendTo(e))}).always(function(){r&&r.$progress&&r.$progress.parent().length>0&&r.$progress.remove()}).progress(function(){!r||r.$progress&&0!==r.$progress.parent().length||(r.$progress=a('<div class="progress">fetching data...</div>').appendTo(e))})};n.Data.filterData=function(t,e,r,i,o,s){var h,l={};o=o||1;a.each(t,function(t,c){var p,u;p=n.Date.parse(c.x);if(p&&p>=r&&e>=p)if(s){u=n.Date.createId(p,"daily");l[u]=c}else{"weekly"===i&&(p=n.Date.getWeekStartday(p));u=n.Date.createId(p,i);if(l[u])for(t=0;o>t;t++){h=t?"y"+t:"y";l[u][h]=parseInt(l[u][h],10)+parseInt(c[h],10)}else l[u]=a.extend({},c)}});return l};n.Date={};n.Date.getWeekStartday=function(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate()-t.getDay())};n.Date.zeroPadArray=function(t,e){var n;({yearly:function(){n=[t.getFullYear()]},monthly:function(){n=[t.getFullYear(),t.getMonth()+1]},quarter:function(){n=[t.getFullYear(),t.getMonth()+1]},weekly:function(){n=[t.getFullYear(),t.getMonth()+1,t.getDate()-t.getDay()]},daily:function(){n=[t.getFullYear(),t.getMonth()+1,t.getDate()]},hourly:function(){n=[t.getFullYear(),t.getMonth()+1,t.getDate(),t.getHours()]}})[e]();return a.map(n,function(t){t=""+t;return 1===t.length?"0"+t:t})};n.Date.createId=function(t,e){return n.Date.zeroPadArray(t,e).join("")};n.Date.createXLabel=function(t,e){var a,r,i=n.Date.zeroPadArray(t,e);if("hourly"===e){a=i.pop();r=i.join("-")+" "+a+":00"}else r=i.join("-");return r};n.Date.parse=function(t){var e;e=!t||t instanceof Date?t||null:"number"==typeof t?new Date(t):new Date(Date.parse(""+t));if(e&&/NaN|Invalid Date/.test(""+e)){e=t.replace(/-/g,"/").split("+")[0];if(1===e.split("/").length){e=t.match(/([0-9]{4})([0-9]{1,2})([0-9]{1,2})/);e=[e[1],e[2],e[3]].join("/")}2===e.split("/").length&&(e+="/01");e=a.each(e.split("/"),function(t,e){return 1===e.length?"0"+e:e}).join("/");e=new Date(Date.parse(e))}return e};n.Date.calcDate=function(t,e,a,n){var r,i,o,s;r=t.getFullYear();i=t.getMonth();o=t.getDate();s=0;e-=1;n=n?-1:1;({yearly:function(){r+=n*e},monthly:function(){i+=n*e},quarter:function(){i+=4*n*e},weekly:function(){o=o+7*n*e-t.getDay()},daily:function(){o+=n*e},hourly:function(){s=t.getHours()+n*e}})[a]();return new Date(r,i,o,s)};n.Range={};n.Range.factory=function(t){var e;t=t||{};t.maxLength=t.maxLength||90;t.dataType=t.dataType||"timeline";t.isTimeline=n.Range.isTimeline(t.dataType);e=t.isTimeline?n.Range.calcDate:n.Range.calcNum;return e(t.start,t.end,t.length,t.maxLength,t.unit,t.dataType,t.autoSized)};n.Range.generate=n.Range.factory;n.Range.isTimeline=function(t){return!t||"timeline"===t};n.Range.calcDate=function(t,e,r,i,o,s,h){o=o||"monthly";r=r||("hourly"===o?24:10);if(h){var l=a(window).width();i=Math.min(Math.ceil(.021875*l),i);r=i}t=n.Date.parse(t);e=n.Date.parse(e);t||e||(e=n.Range.getEndDate(new Date,o));t||(t=n.Range.getStartDate(n.Date.calcDate(e,r,o,!0),o));e||(e=n.Range.getEndDate(n.Date.calcDate(t,r,o,!1),o));e>new Date&&(e=new Date);t>e&&(t=e);r=n.Range.getLength(t,e,o);if(r>i){r=i;t=n.Date.calcDate(e,r,o,!0)}return{start:t,end:e,length:r,maxLength:i,unit:o,dataType:s,max:n.Range.getEndDate(e,o),min:n.Range.getStartDate(t,o),isTimeline:!0}};n.Range.calcNum=function(t,e,n,r,i,o,s){n=n||10;if(s){var h=a(window).width();r=Math.min(Math.ceil(.021875*h),r);n=Math.min(n,r)}if(!t&&!e){t=0;e=n-1}t=parseInt(t,10)||(0===t?0:null);e=parseInt(e,10)||(0===e?0:null);if(null===t){t=e-n;0>t&&(t=0)}null===e&&(e=t+n);t>e&&(t=e);n=e-t+1;if(n>r){n=r;t=e-r}return{start:t,end:e,length:n,maxLength:r,dataType:o,unit:null,max:e,min:t,isTimeline:!1}};n.Range.getStartDate=function(t,e){var a,n=t.getFullYear(),r=t.getMonth(),i=t.getDate();({yearly:function(){a=new Date(n,0,1,0,0,0)},monthly:function(){a=new Date(n,r,1,0,0,0)},quarter:function(){a=new Date(n,r,1,0,0,0)},weekly:function(){a=new Date(n,r,i-t.getDay(),0,0,0)},daily:function(){a=new Date(n,r,i,0,0,0)},hourly:function(){a=new Date(n,r,i,t.getHours(),0,0)}})[e]();return a};n.Range.getEndDate=function(t,e){var a,n=t.getFullYear(),r=t.getMonth(),i=t.getDate();({yearly:function(){a=new Date(n,11,31,23,59,59)},monthly:function(){a=new Date(new Date(n,r+1,1,0,0,0).valueOf()-1)},quarter:function(){a=new Date(new Date(n,r+1,1,0,0,0).valueOf()-1)},weekly:function(){a=new Date(n,r,i-t.getDay()+6,23,59,59)},daily:function(){a=new Date(n,r,i,23,59,59)},hourly:function(){a=new Date(n,r,i,t.getHours(),0,0)}})[e]();return new Date>a?a:new Date};n.Range.getNextDate=function(t,e,a,n){var r,i=t.getFullYear(),o=t.getMonth(),s=t.getDate();({yearly:function(t){r=new Date(i+t,0,1)},monthly:function(t){r=new Date(i,o+t,1)},quarter:function(t){r=new Date(i,o+4*t,1)},weekly:function(e){r=new Date(i,o,s+7*e-t.getDay())},daily:function(t){r=new Date(i,o,s+t)},hourly:function(e){r=new Date(i,o,s,t.getHours()+e)}})[n](a);return e>r?r:null};n.Range.getDataRange=function(t,e){var r,i,o;if(e){r=a.map(t,function(t){return n.Date.parse(t.x).valueOf()});i=Math.max.apply(null,r);o=Math.min.apply(null,r)}else{o=0;i=t.length-1}return{max:i,min:o}};n.Range.getLength=function(t,e,a){var r;({yearly:function(){r=Math.ceil(e.getFullYear()-t.getFullYear())},monthly:function(){r=Math.ceil(12*e.getFullYear()+e.getMonth()-(12*t.getFullYear()+t.getMonth()))},quarter:function(){r=Math.ceil((12*e.getFullYear()+e.getMonth()-(12*t.getFullYear()+t.getMonth()))/4)},weekly:function(){r=Math.ceil((n.Date.getWeekStartday(e)-n.Date.getWeekStartday(t))/6048e5)},daily:function(){r=Math.ceil((e-t)/864e5)},hourly:function(){r=Math.ceil((e-t)/36e5)}})[a]();return r>0?r+1:1};n.Graph=function(t,a){this.config=e.extend({type:"morris.bar",staticPath:"",data:"graph.json"},t);this.config.id="graph-"+(new Date).valueOf()+Math.floor(100*Math.random());this.config.yLength=parseInt(this.config.yLength,10)||1;this.range=n.Range.generate(a);if("string"==typeof this.config.data)this.origData_=e.getJSON(this.config.staticPath+this.config.data);else{this.origData_=e.Deferred();this.origData_.resolve(this.config.data)}this.graphData={};this.graphData[this.range.unit]=e.Deferred();this.getData(e.proxy(function(t){this.graphData[this.range.unit].resolve(this.generateGraphData(t))},this));this.$graphContainer=e('<div id="'+this.config.id+'-container" class="graph-container">');this.$graphContainer.on("UPDATE",e.proxy(function(t,a,n){this.update_(a,n);return e(this.$graphContainer)},this));this.$graphContainer.on("REMOVE",e.proxy(function(){this.remove_()},this));var r=e(window).width();this.updateFunc=e.proxy(function(){if(r&&r!==e(window).width()){r=e(window).width();this.update_()}},this);t.autoResize&&e(window).on("orientationchange debouncedresize",this.updateFunc);this.$graphContainer.on("GET_DATA_RANGE",e.proxy(function(t,a){e.proxy(this.getData(e.proxy(function(t){a(n.Range.getDataRange(t,this.range.isTimeline))},this),this));return e(this.$graphContainer)},this));this.$graphContainer.on("GET_LABEL",e.proxy(function(t,a,n){e.proxy(this.getData(e.proxy(function(t){n(this.getDataLabelByIndex(a,t))},this),this));return e(this.$graphContainer)},this));this.$graphContainer.on("APPEND_TO",e.proxy(function(t,a){this.$graphContainer.appendTo(a);this.graphData[this.range.unit].done(e.proxy(function(t){var a;a=this.range.isTimeline?e.grep(t,e.proxy(function(t){return this.range.start<=t.timestamp&&t.timestamp<=this.range.end},this)):t.slice(this.range.min,this.range.max+1);this.draw_(a)},this));return e(this.$graphContainer)},this));return this.$graphContainer};n.Graph.prototype.getData=function(t){n.Data.getData(this.origData_,this.$graphContainer,t,this)};n.Graph.prototype.getDataLabelByIndex=function(t,a){var n=this.config.dataLabel||"x";return e.map(t,function(t){return a[t][n]})};n.Graph.prototype.getTotalCount_=function(t,a){var n=0,r="y"+(a||"");e.each(t,function(t,e){n+=parseInt(e[r]||e.value||0,10)});return n};n.Graph.prototype.getDelta_=function(t,e){var a,n,r,i,o=t.length;i="y"+(e||"");a=t[o-1];n=t[o-2];r=n&&a&&n[i]?a[i]-n[i]:a[i];return void 0===r?"":r};n.Graph.presetColors=function(){return["#6AAC2B","#FFBE00","#CF6DD3","#8F2CFF","#2D85FF","#5584D4","#5ED2B8","#9CCF41","#F87085","#2C8087","#8EEC6A","#FFE700","#FF5E19","#FF4040","#976BD6","#503D99","#395595"]};n.Graph.getChartColors=function(t,e){var a={reverse:function(t){return t.reverse()},shuffle:function(t){var e,a,n,r;n=t.length;for(e=0;n>e;e++){a=Math.floor(Math.random()*n);r=t[e];t[e]=t[a];t[a]=r}return t},def:function(t){return t}};return a[e||"def"](t||n.Graph.presetColors())};n.Graph.cachedChartColors={};n.Graph.getCachedChartColors=function(t,e,a){return n.Graph.cachedChartColors[t]=n.Graph.cachedChartColors[t]||n.Graph.getChartColors(e,a)};n.Graph.prototype.draw_=function(t){var a=this.config.type.split("."),r=a[0],i=a[1],o=this.config;if(o.label)if(this.labelTemplate)this.generateLabel(this.labelTemplate);else if(o.label.template){var s=o.label.template;if(window.require&&"function"==typeof require){var h=o.label.type;require([h+"!"+o.staticPath+s],e.proxy(function(t){this.labelTemplate=t;this.generateLabel(t)},this))}else{var l=e.get(o.staticPath+s,"text");n.Data.getData(l,this.$graphContainer,e.proxy(function(t){this.labelTemplate=t;this.generateLabel(t)},this))}}else{this.labelTemplate='<span class="graph-label-label"></span>';this.generateLabel(this.labelTemplate)}if(o.fallback&&o.fallback.test&&!n.Graph.test[o.fallback.test]()){a=o.fallback.type.split(".");r=a[0];i=a[1];o=e.extend(o,o.fallback)}o.chartColors&&"string"==typeof o.chartColors&&(o.chartColors=o.chartColors.split(","));this.graphObject=n.Graph[r][i](t,o,this.range,this.$graphContainer)};n.Graph.test={};n.Graph.test.canvas=function(){var t=document.createElement("canvas");return t.getContext&&t.getContext("2d")};n.Graph.test.svg=function(){var t={svg:"http://www.w3.org/2000/svg"};return!!document.createElementNS&&!!document.createElementNS(t.svg,"svg").createSVGRect};n.Graph.test.vml=function(){var t,e=n.Graph.test.svg();if(!e){var a=document.body.appendChild(document.createElement("div"));a.innerHTML='<v:shape id="vml_flag1" adj="1" />';var r=a.firstChild;r.style.behavior="url(#default#VML)";t=r?"object"==typeof r.adj:!0;a.parentNode.removeChild(a)}return e||t};n.Graph.prototype.generateLabel=function(t){var a,r=this.config.label.template&&this.config.label.data?this.config.label.data:{},i=this.config.label.yLength||this.config.yLength,o=e.proxy(function(){this.labels=new n.Graph.Labels(this.$graphContainer,i,t);this.getData(e.proxy(function(t){for(var e=0;i>e;e++){this.config.label.hideTotalCount||this.labels.getTotalObject(e).createTotalCount(this.getTotalCount_(t,e));!this.config.label.hideDeltaCount&&this.range.isTimeline&&this.labels.getTotalObject(e).createDeltaCount(this.getDelta_(t,e))}},this))},this);if(r&&"string"==typeof r)a=e.getJSON(this.config.staticPath+r);else{a=e.Deferred();a.resolve(r)}a.done(function(e){if(t&&"function"==typeof t){t=t(e);o()}else if(window._){t=_.template(t,e);o()}else{t=t;o()}})};n.Graph.prototype.update_=function(t,a){var r=this;t=t||[];this.graphObject&&this.graphObject.remove&&this.graphObject.remove();this.labels&&this.labels.remove();this.range=n.Range.generate({start:t[0]||this.range.start,end:t[1]||this.range.end,length:null,maxLength:this.range.maxLength,unit:a||this.range.unit,dataType:this.range.dataType,autoSized:this.range.autoSized});this.graphData[this.range.unit].done(e.proxy(function(t){var a;a=r.range.isTimeline?e.grep(t,e.proxy(function(t){return this.range.min<=t.timestamp&&t.timestamp<=this.range.max},this)):t.slice(this.range.min,this.range.max+1);this.draw_(a)},this))};n.Graph.prototype.remove_=function(){this.config.autoResize&&e(window).off("orientationchange debouncedresize",this.updateFunc);this.graphObject&&this.graphObject.remove&&this.graphObject.remove();this.labels&&this.labels.remove();this.$graphContainer.remove()};n.Graph.prototype.generateGraphData=function(t){var a,r,i,o,s,h,l,c=this.range,p=c.start,u=c.end,g=c.unit,d=c.length,f=[],y=this.config.yLength||1;if(this.range.isTimeline){var v=n.Range.getDataRange(t,this.range.isTimeline);p=new Date(Math.min(this.range.min,v.min));u=new Date(Math.max(this.range.max,v.max));d=n.Range.getLength(p,u,g);s=n.Data.filterData(t,v.max,v.min,g,y);for(a=0;d>a;a++){i=n.Range.getNextDate(p,u,a,g);if(!i)break;o=n.Date.createId(i,g);h={timestamp:i.valueOf(),x:n.Date.createXLabel(i,g)};for(r=0;y>r;r++){l="y"+(r||"");h[l]=s[o]?s[o][l]||0:0}f.push(h)}}else f=t;"morris.donut"===this.config.type&&e.each(f,function(t,a){e.extend(a,{label:a.xLabel||a.x,value:a.y})});return f};n.Graph.Labels=function(t,a,r){var i,o;this.$labelContainer=e('<div class = "graph-labels"></div>');r&&e('<div class="graph-label"></div>').html(r).prependTo(this.$labelContainer);this.totals={};for(i=0;a>i;i++){o="y"+(i||"");this.totals[o]=new n.Graph.Labels.Total(this.$labelContainer,i)}this.$labelContainer.appendTo(t)};n.Graph.Labels.prototype.remove=function(){this.$labelContainer.remove()};n.Graph.Labels.prototype.getTotalObject=function(t){return this.totals["y"+(t||"")]};n.Graph.Labels.Total=function(t,e){this.index=e;this.$totalContainer=a('<div class = "graph-total"></div>').appendTo(t)};n.Graph.Labels.Total.prototype.createTotalCount=function(t){a('<span class="graph-total-count graph-total-count-y"'+(this.index||"")+">"+t+"</span> ").appendTo(this.$totalContainer)};n.Graph.Labels.Total.prototype.createDeltaCount=function(t){var e=t?0>t?"minus ":"plus ":"zero ";a('<span class="graph-delta graph-delta-y"'+(this.index||"")+'><span class="'+e+'">('+t+")</span></span>").appendTo(this.$totalContainer)};n.Graph.css={};n.Graph.css.Base=function(t,a){this.len=t.length;this.$graphEl=e('<div id="'+a.id+'" class="css-graph">')};n.Graph.css.Base.prototype.remove=function(){this.$graphEl.remove()};n.Graph.css.Base.prototype.horizontalBar=function(t,a,r,i){a.width&&this.$graphEl.css({width:a.width,"max-width":"100%",margin:"0 auto"});for(var o,s,h,l,c,p,u=a.barColor||n.Graph.getCachedChartColors(a.id,null,a.chartColorsMethod)[1],g=a.barBackgroundColor||"#f0f0f0",d=a.dateColor||"#999999",f=a.dateColorSaturday||d,y=a.dateColorSunday||d,v=a.labelColor||"#999999",m=parseInt(a.barWidth,10)||30,D=parseInt(a.barMarginLeft,10)||30,C=parseInt(a.barInterval,10)||5,b=parseInt(a.labelSize,10)||.45*m,x=parseInt(a.dateLabelSize,10)||b,w=function(){return e('<div class="css-graph-container"><div class="css-graph-date"></div><div class="css-graph-bar-container" style="height:'+m+"px; margin-bottom:"+C+'px"><div class="css-graph-bar"></div><div class="css-graph-bar-background"><div class="css-graph-bar-count"></div></div></div>')},T=e.map(t,function(t){return parseInt(t.y,10)}),L=e.map(t,function(t){return{value:""+parseInt(t.x.substr(t.x.lastIndexOf("-")+1),10),weekday:n.Date.parse(t.x)?n.Date.parse(t.x).getDay():null}}),$=Math.max.apply(null,T)||1,G=a.yLabel||T,M=this.len;M>0;){M-=1;o=Math.floor(100*(T[M]/$))-15;s=w();h=s.find(".css-graph-bar-background");h.css({"background-color":g});if(a.showDate){p=s.find(".css-graph-date");p.text(L[M].value).css({color:d,"font-size":x+"px","line-height":m+"px"});6===L[M].weekday?p.addClass("saturday").css({color:f}):0===L[M].weekday&&p.addClass("sunday").css({color:y});s.find(".css-graph-bar-container").css({"margin-left":D+"px"})}l=s.find(".css-graph-bar");l.css({width:o+"%","background-color":u});c=s.find(".css-graph-bar-count");c.text(G[M]).css({color:v,"font-size":b+"px","line-height":m+"px"});s.appendTo(this.$graphEl)}this.$graphEl.appendTo(i)};n.Graph.css.Base.prototype.ratioHorizontalBar=function(t,a,r,i){var o,s,h,l,c,p,u,g,d,f,y,v,m=a.yLength,D=parseInt(a.barWidth,10)||30,C=parseInt(a.barMarginLeft,10)||30,b=parseInt(a.barInterval,10)||5,x=parseInt(a.labelSize,10)||.45*D,w=a.dateColor||"#999999",T=a.barColors||n.Graph.getCachedChartColors(a.id,null,a.chartColorsMethod),L=a.labelColors,$=a.labelClasses;for(o=0;this.len>o;o++){h=t[o];l=[];c=0;v=0;for(s=0;m>s;s++){l.push(h["y"+(s||"")]);c+=parseInt(h["y"+(s||"")],10)}p=e('<div class="css-graph-container"></div>').appendTo(this.$graphEl);if(a.showDate&&h.x){d=""+parseInt(h.x.substr(h.x.lastIndexOf("-")+1),10);f=e('<div class="css-graph-date" style="color:'+w+";font-size: "+x+"px; line-height:"+D+'px">'+d+"</div>").appendTo(p)}u=e('<div class="css-graph-bar-container" style="height:'+D+"px; margin-bottom:"+b+'px"></div>').appendTo(p);a.showDate&&u.css({"margin-left":C+"px"});for(s=0;m>s;s++){y=Math.floor(1e3*(l[s]/c))/10;if(y){m===s&&(y=100-v);v+=y;g=e('<div class="css-graph-y css-graph-y'+(s||"")+'" data-count="'+l[s]+'" style="line-height:'+D+"px; font-size:"+x+'px"></div>');g.css({width:y+"%","background-color":T[s]});a.showCount&&g.text(l[s]);$&&$[s]&&g.addClass($[s]);L&&L[s]&&g.css({color:L[s]});g.appendTo(u)}}u.appendTo(p)}this.$graphEl.appendTo(i)};n.Graph.css.horizontalBar=n.Graph.css.ratioHorizontalBar=function(t,e,a,r){var i=new n.Graph.css.Base(t,e,a,r),o=e.type.slice(e.type.lastIndexOf(".")+1);i[o](t,e,a,r);return i};n.Graph.easel={};n.Graph.easel.Base=function(t,a,n,r){this.data=t;this.config=a;this.range=n;this.$container=r;if(window.createjs||"function"!=typeof window.require){var i=parseInt(a.width||r.width(),10);i?this.buildCanvas(createjs):setTimeout(e.proxy(function(){this.buildCanvas(createjs)},this),100)}else require(["easeljs"],e.proxy(function(){this.buildCanvas(createjs)},this))};n.Graph.easel.Base.prototype.buildCanvas=function(t){this.width=parseInt(this.config.width||this.$container.width(),10)||300;this.height=parseInt(this.config.height||this.$container.height(),10)||300;this.$canvas=e('<canvas id="'+this.config.id+'" class="graph-canvas" width="'+this.width+'" height="'+this.height+'">').appendTo(this.$container);this.canvas=this.$canvas.get(0);this.canvas.getContext("2d");this.stage=this.graph=new t.Stage(this.canvas);this.stage.update();var a=this.config.type.split(".")[1];this[a](this.data,this.config)};n.Graph.easel.Base.prototype.remove=function(){this.$canvas.remove()};n.Graph.easel.Base.prototype.bar=function(t,a){for(var r,i,o,s,h,l=t.length,c=a.chartColorsAlpha?a.chartColorsAlpha[0]:1,p=a.chartColors||n.Graph.getCachedChartColors(a.id,null,a.chartColorsMethod),u=this.convertColor(p[0],c),g=parseInt(a.barMargin,10)||10,d=Math.floor(this.width/l),f=d-g,y=Math.floor((this.width-d*l)/2)+g/2,v=e.map(t,function(t){return parseInt(t.y,10)}),m=Math.max.apply(null,v)||1,D=0;l>D;D++){r=new createjs.Shape;i=r.graphics;o=D*d+y;h=Math.floor(v[D]/m*this.height);s=this.height-h;i.beginFill(u).drawRect(o,s,f,h);this.stage.addChild(r)}this.stage.update()};n.Graph.easel.Base.prototype.motionLine=function(t,a){var r,i,o=t.length,s=parseInt(a.lineWidth,10)||8,h=a.yLength||1,l=a.lineColors||a.chartColors||n.Graph.getCachedChartColors(a.id,null,a.chartColorsMethod),c=a.chartColorsAlpha||[null],p=a.pointerColors||a.chartColors||n.Graph.getCachedChartColors(a.id,null,a.chartColorsMethod),u=a.pointerColorsAlpha||[null],g=a.pointerRadius||10,d=s/2,f=s/2,y=2*(o-1),v=Math.floor(this.width/o)/2,m=(this.width-v*y)/2,D=this.height,C=[],b=function(t){return parseInt(t["y"+(x||"")],10)};a.drawPointer&&(f+=g);r=this.height-(d+f);for(var x=0;h>x;x++){i=e.map(t,b);C.push(i)}var w=[];e.each(C,function(t,e){w=w.concat(e)});var T=Math.max.apply(null,w)||1,L=[],$=function(t){var a=[];e.each(t,function(e,n){if(e>0){var i=t[e-1],o=i+Math.floor((n-i)/2);o=Math.floor(o/T*r)+f;n=Math.floor(n/T*r)+f;a=a.concat([o,n])}else{n=Math.floor(n/T*r)+f;a.push(n)}});return a};e.each(C,function(t,e){L.push($(e))});var G,M,_,E=[],S=[],A=m,I=[];for(x=0;h>x;x++){G=this.convertColor(l[x],c[x]);E[x]=new createjs.Shape;S[x]=E[x].graphics;M=D-L[x][0];S[x].setStrokeStyle(s).beginStroke(G).moveTo(A,M);this.stage.addChild(E[x]);if(a.drawPointer){_=this.convertColor(p[x],u[x]);I[x]=new createjs.Shape;I[x].graphics.beginFill(_).drawCircle(0,0,g);this.stage.addChild(I[x])}}var R=this.stage,B=function(t){y-=1;0===y&&createjs.Ticker.removeEventListener("tick",B);A+=v;for(var e,n=0;h>n;n++){e=L[n];M=D-e[e.length-y-1];S[n].lineTo(A,M);if(a.drawPointer){I[n].x=A;I[n].y=Math.max(M,g)}}R.update(t)};createjs.Ticker.useRAF=!0;createjs.Ticker.setFPS(30);createjs.Ticker.addEventListener("tick",B)};n.Graph.easel.Base.prototype.convertColor=function(t,e){if(-1!==t.indexOf("#")){var a=parseInt(t.substr(1,2),16),n=parseInt(t.substr(3,2),16),r=parseInt(t.substr(5,2),16);t=e?"rgba("+[a,n,r,e].join(",")+")":"rgb("+[a,n,r].join(",")+")"}else-1!==t.indexOf("rgb")&&(t=4>t.split(",").length?"rgb("+t+")":"rgba("+t+")");return t};n.Graph.easel.Base.prototype.mix=function(t,a){var r=0,i=function(t,a){t=t||1;var n=e.map(a,function(e){for(var a,n,i={x:e.x},o=0;t>o;o++){a="y"+(o||"");n="y"+(r+o||"");i[a]=e[n]}return i});r+=t;return n},o=a.chartColors||n.Graph.getCachedChartColors(a.id,null,a.chartColorsMethod);e.each(a.mix,e.proxy(function(n,s){var h={chartColors:o.slice(r,r+s.yLength)},l=i(s.yLength,t);s=e.extend({},a,h,s);this[s.type](l,s)},this))};n.Graph.easel.bar=n.Graph.easel.motionLine=n.Graph.easel.mix=function(t,e,a,r){if(n.Graph.test.canvas()){var i=new n.Graph.easel.Base(t,e,a,r);return i}console.warn("EaselJS graph requires for HTML5 Canvas capability");r.trigger("REMOVE")};n.Graph.morris={};n.Graph.morris.Base=function(t,a,n,r){if(window.Morris||"function"!=typeof window.require){var i=a.width||r.width();i?this.build_(Morris,t,a,n,r):setTimeout(e.proxy(function(){this.build_(Morris,t,a,n,r)},this),100)}else require(["raphael","morris"],e.proxy(function(){this.build_(Morris,t,a,n,r)},this))};n.Graph.morris.Base.prototype.build_=function(t,a,r,i,o){var s,h,l,c=r.type.split(".")[1],p=r.yLength,u=r.width||o.width()||300,g=r.height||o.height()||300;this.$graphEl=e('<div id="'+r.id+'" class="graph-element"></div>').css({height:g+"px",width:u+"px"}).prependTo(o);r=e.extend({},r,{element:r.id,data:a,xkey:"x",labels:this.getYLabels_(p,r.labels),ykeys:this.getYKeys_(p),ymax:this.getYMax_(a,c,p),ymin:r.ymin||0,lineWidth:parseInt(r.lineWidth,10)||6,pointSize:parseInt(r.pointSize,10)||6,smooth:r.smooth||!1});r.barColors=r.barColors||this.getChartColors(r);r.colors=r.colors||this.getChartColors(r);r.lineColors=r.lineColors||this.getChartColors(r);r.numLines=parseInt(r.numLines,10)||this.getNumLines_(r.ymax,g);r.pointStrokeColors=r.pointStrokeColors?r.pointStrokeColors.split(/,/):[];if(!r.pointStrokeColors.length)for(s=0;p>s;s++)r.pointStrokeColors.push("none");h={element:null,data:null,xkey:"x",labels:[],ykeys:[],dateFormat:null,axes:!0,grid:!0,gridLineColor:"#aaa",gridStrokeWidth:.5,gridTextColor:"#888",gridTextSize:12,hideHover:!1,hoverCallback:null,yLabelFormat:null,numLines:5,padding:25,parseTime:!0,postUnits:"",preUnits:"",ymax:"auto",ymin:"auto 0",goals:[],goalStrokeWidth:1,goalLineColors:["#666633","#999966","#cc6666","#663333"],events:[],eventStrokeWidth:1,eventLineColors:["#005a04","#ccffbb","#3a5f0b","#005502"],lineWidth:3,pointSize:4,lineColors:["#0b62a4","#7A92A3","#4da74d","#afd8f8","#edc240","#cb4b4b","#9440ed"],pointWidths:[1],pointStrokeColors:["#ffffff"],pointFillColors:[],smooth:!0,xLabels:"auto",xLabelFormat:null,xLabelMargin:50,continuousLine:!0,barSizeRatio:.75,barGap:3,barColors:["#0b62a4","#7a92a3","#4da74d","#afd8f8","#edc240","#cb4b4b","#9440ed"],colors:["#0B62A4","#3980B5","#679DC6","#95BBD7","#B0CCE1","#095791","#095085","#083E67","#052C48","#042135"],backgroundColor:"#FFFFFF",labelColor:"#000000",formatter:t.commas};l={};e.each(r,function(t,e){void 0!==h[t]&&(l[t]=e)});n.Graph.test.svg||(l.smooth=!0);if("donut"===c){var d=this.getTotalCount_(a,s);l.formatter=function(t){return t+"("+Math.ceil(1e4*(t/d))/100+"%)"}}var f={bar:t.Bar,line:t.Line,donut:t.Donut,area:t.Area}[c];this.graph=new f(l)};n.Graph.morris.Base.prototype.getYMax_=function(t,a,n){var r,i,o,s,h;if("area"!==a){o=[];e.each(t,function(t,e){for(r=0;n>r;r++){h="y"+(r||"");o.push(parseInt(e[h],10))}});i=Math.max.apply(null,o)}else i=Math.max.apply(null,e.map(t,function(t){s=0;for(r=0;n>r;r++){h="y"+(r||"");s+=parseInt(t[h],10)}return s}));i||(i=1);0!==i%2&&(i+=1);return i};n.Graph.morris.Base.prototype.getChartColors=function(t){this.chartColors||(this.chartColors=t.chartColors||n.Graph.getCachedChartColors(t.id,null,t.chartColorsMethod));return this.chartColors};n.Graph.morris.Base.prototype.getYKeys_=function(t){var e,a=[];for(e=0;t>e;e++)a.push("y"+(e||""));return a};n.Graph.morris.Base.prototype.getYLabels_=function(t,e){var a,n=[];e=e?e.split(/,/):[];for(a=0;t>a;a++)n.push(e[a]||"Count");return n};n.Graph.morris.Base.prototype.getNumLines_=function(t,e){var a;a=t>=18?9:2===t?3:t/2+1;a=Math.min(a||1,Math.floor(e/56));return a};n.Graph.morris.Base.prototype.getTotalCount_=function(t,a){var n=0,r="y"+(a||"");e.each(t,function(t,e){n+=e[r]||e.value||0});return n};n.Graph.morris.Base.prototype.remove=function(){this.$graphEl.remove()};n.Graph.morris.bar=n.Graph.morris.line=n.Graph.morris.donut=n.Graph.morris.area=function(t,e,a,r){if(n.Graph.test.vml()){var i=new n.Graph.morris.Base(t,e,a,r);return i}console.warn("Morris graph requires for SVG/VML capability");r.trigger("REMOVE")};n.Slider=function(t,a,r,i,o){if(!e.ui||!e.ui.slider)throw"ChartAPI.Slider requied jQuery UI Slider";var s=this;this.id="slider-"+(new Date).valueOf()+Math.floor(100*Math.random());this.config=t;this.range=n.Range.generate(a);this.$dataRangeTarget=r;this.$sliderContainer=e('<div id="'+this.id+'-container" class="slider-container"></div>');this.eventTargetList={update:this.initEventTarget(),amount:this.initEventTarget()};e.each(i,function(t,e){s.eventTargetList.update.add(e)});e.each(o,function(t,e){s.eventTargetList.amount.add(e)});this.$sliderContainer.on("APPEND_TO",function(t,a){s.$container=a;s.draw_(a);return e(this)});this.$sliderContainer.on("BUILD_SLIDER",function(){s.$dataRangeTarget.trigger("GET_DATA_RANGE",function(t){s.buildSlider(t.min,t.max)});return e(this)});this.$sliderContainer.on("SET_DATA_RANGE",function(t,a){s.$dataRangeTarget=a;return e(this)});this.$sliderContainer.on("ADD_EVENT_LIST",function(t,a,n){n=e.isArray(n)?n:[n];e.each(n,function(t,e){s.eventTargetList[a].add(e)});return e(this)});this.$sliderContainer.on("REMOVE_EVENT_LIST",function(t,a,n){n=e.isArray(n)?n:[n];e.each(n,function(t,e){s.eventTargetList[a].remove(e)});return e(this)});this.$sliderContainer.on("ERASE",function(){s.erase_();return e(this)});this.$sliderContainer.on("REDRAW",function(){var t=e(this);t.trigger("BUILD_SLIDER").trigger("APPEND_TO",[s.$container]);return e(this)});this.$sliderContainer.on("UPDATE",function(t,a){s.$slider("values",a);s.updateSliderAmount(a);return e(this)});return this.$sliderContainer};n.Slider.prototype.initEventTarget=function(){var t=[];return{add:function(e){t.push(e)},remove:function(a){t=e.grep(t,function(t){return t!==a})},get:function(){return t}}};n.Slider.prototype.buildSlider=function(t,a,n){var r=this;n=n||[this.range.min,this.range.max];if(this.$slider){this.$slider.destroy();this.$slider.remove()}this.$slider=e('<div class="slider"></div>').slider({range:!0,min:t,max:a,values:n,slide:function(t,e){r.updateSliderAmount(e.values,e)},stop:function(t,e){r.updateGraphAndList(e.values)}}).appendTo(r.$sliderContainer);if(!this.config.hideSliderAmount){this.$amount=e('<div class="amount"></div>');this.config.appendSliderAmountBottom?this.$amount.appendTo(this.$sliderContainer):this.$amount.prependTo(this.$sliderContainer);this.updateSliderAmount(n)}};n.Slider.prototype.draw_=function(t){this.$sliderContainer.appendTo(t)};n.Slider.prototype.erase_=function(){this.$slider&&this.$slider.destroy();this.$sliderContainer.html("")};n.Slider.prototype.updateSliderAmount=function(t,a){var r,i,o,s,h=this.range.maxLength,l=this.$amount;if(this.range.isTimeline){r=n.Date.parse(t[0]);i=n.Date.parse(t[1]);o=this.range.unit;s=n.Range.getLength(r,i,o);if(a&&s>h)if(a.value===a.values[0]){i=n.Date.calcDate(r,h,o,!1);this.$slider.slider("values",1,i.valueOf())}else{r=n.Date.calcDate(i,h,o,!0);this.$slider.slider("values",0,r.valueOf())}l&&l.text([n.Date.createXLabel(r,o),n.Date.createXLabel(i,o)].join(" - "))}else{r=t[0];i=t[1];if(i-r>h)if(a.value===a.values[0]){i=h-r;this.$slider.slider("values",1,i)}else{r=i-h;this.$slider.slider("values",0,r)}l&&e.each(this.eventTargetList.amount.get(),function(t,e){e.trigger("GET_LABEL",[[r,i],function(t){l.text([t[0],t[1]].join(" - "))}])})}};n.Slider.prototype.updateGraphAndList=function(t,a){e.each(this.eventTargetList.update.get(),function(e,n){n.trigger("UPDATE",[t,a])})};n.Slider.prototype.update_=function(t,e){this.$slider.slider("values",t,e)};n.List=function(t,a){this.id="list-"+(new Date).valueOf()+Math.floor(100*Math.random());this.config=t;this.config.staticPath=this.config.staticPath||"";if(this.config.data&&"string"==typeof this.config.data)this.origData_=e.getJSON(this.config.staticPath+this.config.data);else{this.origData_=e.Deferred();this.origData_.resolve(this.config.data)}if(this.config.template){if(window.require&&"function"==typeof require){var r=this.config.type||"text";this.template_=e.Deferred();require([r+"!"+this.config.staticPath+this.config.template],e.proxy(function(t){this.template_.resolve(t)},this))}else this.template_=e.get(this.config.staticPath+this.config.template,"text");this.range=n.Range.generate(a);this.$listContainer=e('<div id="'+this.id+'-container" class="list-container"></div>');this.$listContainer.on("UPDATE",e.proxy(function(t,e){this.update_(e)},this));this.$listContainer.on("GET_DATA_RANGE",e.proxy(function(t,a){this.getData(e.proxy(function(t){a(n.Range.getDataRange(t,this.range.isTimeline))},this));return this.$listContainer},this));this.$listContainer.on("GET_LABEL",e.proxy(function(t,a,n){this.getData(e.proxy(function(t){n(this.getDataLabelByIndex(a,t))},this));return this.$listContainer},this));this.$listContainer.on("APPEND_TO",e.proxy(function(t,a){this.$listContainer.appendTo(a);this.getData(e.proxy(function(t){this.draw_(t)},this));return this.$listContainer},this));return this.$listContainer}};n.List.prototype.getData=function(t){this.config.data?n.Data.getData(this.origData_,this.$listContainer,t,this):t()};n.List.prototype.getTemplate=function(t){n.Data.getData(this.template_,this.$listContainer,t,this)};n.List.prototype.draw_=function(t){var e=this;this.getTemplate(function(a){t=e.createListData(t);e.$listContainer.html(_.template(a,t))})};n.List.prototype.getDataLabelByIndex=function(t,a){var n=this.config.dataLabel||"x";return e.map(t,function(t){return a[t][n]})};n.List.prototype.createListData=function(t){var e="";t&&(e=this.range.isTimeline?n.Data.filterData(t,this.range.max,this.range.min,this.range.unit,1,!0):t.slice(this.range.min,this.range.max+1));return{data:e}};n.List.prototype.update_=function(t,e){var a=this;t=t||[];e=e||this.range.unit;this.range=n.Range.generate({start:t[0]||this.range.start,end:t[1]||this.range.end,length:null,maxLength:this.range.maxLength,unit:e,dataType:this.range.dataType});this.getData(function(t){a.draw_(t)})};n.Build=function(t){var a;if("string"==typeof t&&/\.json$/.test(t)){a=e('<div class="mtchart-container">');n.Data.getData(e.getJSON(t),null,function(t){t.$container=a;n.Build_(t).trigger("APPEND")})}else a=n.Build_(t).trigger("APPEND");return a};n.Build_=function(t){var a,r,i,o,s,h,l;a=t.$container||e('<div class="mtchart-container">');h=[];if(t.graph){r=new n.Graph(t.graph,t.range);h.push(r)}if(t.list){o=new n.List(t.list,t.range);t.list.data&&h.push(o)}if(t.graph&&"donut"!==t.graph.type){s=r;l=[r]}else{s=o;l=[o]}var c=function(){var t=window.navigator?window.navigator.userAgent:"";
return/android|iphone|ipod|ipad/i.test(t)};!t.slider||!t.slider.force&&c()||(i=new n.Slider(t.slider,t.range,s,h,l));a.on("APPEND",function(){r&&r.trigger("APPEND_TO",[a]);i&&i.trigger("BUILD_SLIDER").trigger("APPEND_TO",[a]);o&&o.trigger("APPEND_TO",[a])});a.on("GET_CONTAINER",function(t,e,a){a({graph:r,slider:i,list:o}[e])});return a};return n})(this,jQuery);return MT.ChartAPI});
示例#3
0
var PUM,PUM_Accessibility,PUM_Analytics,pm_cookie,pm_cookie_json,pm_remove_cookie;!function(s){"use strict";void 0===s.fn.on&&(s.fn.on=function(e,o,t){return this.delegate(o,e,t)}),void 0===s.fn.off&&(s.fn.off=function(e,o,t){return this.undelegate(o,e,t)}),void 0===s.fn.bindFirst&&(s.fn.bindFirst=function(e,o){var t,n,i=s(this);i.unbind(e,o),i.bind(e,o),(n=(t=s._data(i[0]).events)[e]).unshift(n.pop()),t[e]=n}),void 0===s.fn.outerHtml&&(s.fn.outerHtml=function(){var e=s(this).clone();return s("<div/>").append(e).html()}),void 0===Date.now&&(Date.now=function(){return(new Date).getTime()})}(jQuery),function(p,s,r){"use strict";window.pum_vars=window.pum_vars||{default_theme:"0",home_url:"/",version:1.7,ajaxurl:"",restapi:!1,rest_nonce:null,debug_mode:!1,disable_tracking:!0,message_position:"top",core_sub_forms_enabled:!0,popups:{}},window.pum_popups=window.pum_popups||{},window.pum_vars.popups=window.pum_popups,PUM={get:new function(){var i={},e=function(e,o,t){"boolean"==typeof o&&(t=o,o=!1);var n=o?o.selector+" "+e:e;return(r===i[n]||t)&&(i[n]=o?o.find(e):jQuery(e)),i[n]};return e.elementCache=i,e},getPopup:function(e){var o,t;return t=e,(o=isNaN(t)||parseInt(Number(t))!==parseInt(t)||isNaN(parseInt(t,10))?"current"===e?PUM.get(".pum-overlay.pum-active:eq(0)",!0):"open"===e?PUM.get(".pum-overlay.pum-active",!0):"closed"===e?PUM.get(".pum-overlay:not(.pum-active)",!0):e instanceof jQuery?e:p(e):PUM.get("#pum-"+e)).hasClass("pum-overlay")?o:o.hasClass("popmake")?o.parents(".pum-overlay"):o.parents(".pum-overlay").length?o.parents(".pum-overlay"):p()},open:function(e,o){PUM.getPopup(e).popmake("open",o)},close:function(e,o){PUM.getPopup(e).popmake("close",o)},preventOpen:function(e){PUM.getPopup(e).addClass("preventOpen")},getSettings:function(e){return PUM.getPopup(e).popmake("getSettings")},getSetting:function(e,o,t){var n=function(e,o){function t(e,o,t){return o?e[o.slice(0,t?-1:o.length)]:e}return o.split(".").reduce(function(e,o){return o?o.split("[").reduce(t,e):e},e)}(PUM.getSettings(e),o);return void 0!==n?n:t!==r?t:null},checkConditions:function(e){return PUM.getPopup(e).popmake("checkConditions")},getCookie:function(e){return p.pm_cookie(e)},getJSONCookie:function(e){return p.pm_cookie_json(e)},setCookie:function(e,o){PUM.getPopup(e).popmake("setCookie",jQuery.extend({name:"pum-"+PUM.getSetting(e,"id"),expires:"+30 days"},o))},clearCookie:function(e,o){p.pm_remove_cookie(e),"function"==typeof o&&o()},clearCookies:function(e,o){var t,n=PUM.getPopup(e).popmake("getSettings").cookies;if(n!==r&&n.length)for(t=0;n.length>t;t+=1)p.pm_remove_cookie(n[t].settings.name);"function"==typeof o&&o()},getClickTriggerSelector:function(e,o){var t=PUM.getPopup(e),n=PUM.getSettings(e),i=[".popmake-"+n.id,".popmake-"+decodeURIComponent(n.slug),'a[href$="#popmake-'+n.id+'"]'];return o.extra_selectors&&""!==o.extra_selectors&&i.push(o.extra_selectors),(i=pum.hooks.applyFilters("pum.trigger.click_open.selectors",i,o,t)).join(", ")},disableClickTriggers:function(e,o){if(e!==r)if(o!==r){var t=PUM.getClickTriggerSelector(e,o);p(t).removeClass("pum-trigger"),p(s).off("click.pumTrigger click.popmakeOpen",t)}else{var n=PUM.getSetting(e,"triggers",[]);if(n.length)for(var i=0;n.length>i;i++)if(-1!==pum.hooks.applyFilters("pum.disableClickTriggers.clickTriggerTypes",["click_open"]).indexOf(n[i].type)){t=PUM.getClickTriggerSelector(e,n[i].settings);p(t).removeClass("pum-trigger"),p(s).off("click.pumTrigger click.popmakeOpen",t)}}}},p.fn.popmake=function(e){return p.fn.popmake.methods[e]?(p(s).trigger("pumMethodCall",arguments),p.fn.popmake.methods[e].apply(this,Array.prototype.slice.call(arguments,1))):"object"!=typeof e&&e?void(window.console&&console.warn("Method "+e+" does not exist on $.fn.popmake")):p.fn.popmake.methods.init.apply(this,arguments)},p.fn.popmake.methods={init:function(){return this.each(function(){var e=PUM.getPopup(this),o=e.popmake("getSettings");return o.theme_id<=0&&(o.theme_id=pum_vars.default_theme),o.disable_reposition!==r&&o.disable_reposition||p(window).on("resize",function(){(e.hasClass("pum-active")||e.find(".popmake.active").length)&&p.fn.popmake.utilities.throttle(setTimeout(function(){e.popmake("reposition")},25),500,!1)}),e.find(".pum-container").data("popmake",o),e.data("popmake",o).trigger("pumInit"),this})},getOverlay:function(){return PUM.getPopup(this)},getContainer:function(){return PUM.getPopup(this).find(".pum-container")},getTitle:function(){return PUM.getPopup(this).find(".pum-title")||null},getContent:function(){return PUM.getPopup(this).find(".pum-content")||null},getClose:function(){return PUM.getPopup(this).find(".pum-content + .pum-close")||null},getSettings:function(){var e=PUM.getPopup(this);return p.extend(!0,{},p.fn.popmake.defaults,e.data("popmake")||{},"object"==typeof pum_popups&&void 0!==pum_popups[e.attr("id")]?pum_popups[e.attr("id")]:{})},state:function(e){var o=PUM.getPopup(this);if(r!==e)switch(e){case"isOpen":return o.hasClass("pum-open")||o.popmake("getContainer").hasClass("active");case"isClosed":return!o.hasClass("pum-open")&&!o.popmake("getContainer").hasClass("active")}},open:function(e){var o=PUM.getPopup(this),t=o.popmake("getContainer"),n=o.popmake("getClose"),i=o.popmake("getSettings"),s=p("html");return o.trigger("pumBeforeOpen"),o.hasClass("preventOpen")||t.hasClass("preventOpen")?(console.log("prevented"),o.removeClass("preventOpen").removeClass("pum-active").trigger("pumOpenPrevented")):(i.stackable||o.popmake("close_all"),o.addClass("pum-active"),0<i.close_button_delay&&n.fadeOut(0),s.addClass("pum-open"),i.overlay_disabled?s.addClass("pum-open-overlay-disabled"):s.addClass("pum-open-overlay"),i.position_fixed?s.addClass("pum-open-fixed"):s.addClass("pum-open-scrollable"),o.popmake("setup_close").popmake("reposition").popmake("animate",i.animation_type,function(){0<i.close_button_delay&&setTimeout(function(){n.fadeIn()},i.close_button_delay),o.trigger("pumAfterOpen"),p.fn.popmake.last_open_popup=o,e!==r&&e()})),this},setup_close:function(){var t=PUM.getPopup(this),e=t.popmake("getClose"),o=t.popmake("getSettings");return(e=e.add(p(".popmake-close, .pum-close",t).not(e))).off("click.pum").on("click.pum",function(e){var o=p(this);o.hasClass("pum-do-default")||o.data("do-default")!==r&&o.data("do-default")||e.preventDefault(),p.fn.popmake.last_close_trigger="Close Button",t.popmake("close")}),(o.close_on_esc_press||o.close_on_f4_press)&&p(window).off("keyup.popmake").on("keyup.popmake",function(e){27===e.keyCode&&o.close_on_esc_press&&(p.fn.popmake.last_close_trigger="ESC Key",t.popmake("close")),115===e.keyCode&&o.close_on_f4_press&&(p.fn.popmake.last_close_trigger="F4 Key",t.popmake("close"))}),o.close_on_overlay_click&&(t.on("pumAfterOpen",function(){p(s).on("click.pumCloseOverlay",function(e){p(e.target).closest(".pum-container").length||(p.fn.popmake.last_close_trigger="Overlay Click",t.popmake("close"))})}),t.on("pumAfterClose",function(){p(s).off("click.pumCloseOverlay")})),t.trigger("pumSetupClose"),this},close:function(n){return this.each(function(){var e=PUM.getPopup(this),o=e.popmake("getContainer"),t=e.popmake("getClose");return t=t.add(p(".popmake-close, .pum-close",e).not(t)),e.trigger("pumBeforeClose"),e.hasClass("preventClose")||o.hasClass("preventClose")?e.removeClass("preventClose").trigger("pumClosePrevented"):o.fadeOut("fast",function(){e.is(":visible")&&e.fadeOut("fast"),p(window).off("keyup.popmake"),e.off("click.popmake"),t.off("click.popmake"),1===p(".pum-active").length&&p("html").removeClass("pum-open").removeClass("pum-open-scrollable").removeClass("pum-open-overlay").removeClass("pum-open-overlay-disabled").removeClass("pum-open-fixed"),e.removeClass("pum-active").trigger("pumAfterClose"),o.find("iframe").filter('[src*="youtube"],[src*="vimeo"]').each(function(){var e=p(this),o=e.attr("src"),t=o.replace("autoplay=1","1=1");t!==o&&(o=t),e.prop("src",o)}),o.find("video").each(function(){this.pause()}),n!==r&&n()}),this})},close_all:function(){return p(".pum-active").popmake("close"),this},reposition:function(e){var o=PUM.getPopup(this).trigger("pumBeforeReposition"),t=o.popmake("getContainer"),n=o.popmake("getSettings"),i=n.location,s={my:"",at:"",of:window,collision:"none",using:"function"==typeof e?e:p.fn.popmake.callbacks.reposition_using},r={overlay:null,container:null},a=null;try{a=p(p.fn.popmake.last_open_trigger)}catch(e){a=p()}return n.position_from_trigger&&a.length?(s.of=a,0<=i.indexOf("left")&&(s.my+=" right",s.at+=" left"+(0!==n.position_left?"-"+n.position_left:"")),0<=i.indexOf("right")&&(s.my+=" left",s.at+=" right"+(0!==n.position_right?"+"+n.position_right:"")),0<=i.indexOf("center")&&(s.my="center"===i?"center":s.my+" center",s.at="center"===i?"center":s.at+" center"),0<=i.indexOf("top")&&(s.my+=" bottom",s.at+=" top"+(0!==n.position_top?"-"+n.position_top:"")),0<=i.indexOf("bottom")&&(s.my+=" top",s.at+=" bottom"+(0!==n.position_bottom?"+"+n.position_bottom:""))):(0<=i.indexOf("left")&&(s.my+=" left"+(0!==n.position_left?"+"+n.position_left:""),s.at+=" left"),0<=i.indexOf("right")&&(s.my+=" right"+(0!==n.position_right?"-"+n.position_right:""),s.at+=" right"),0<=i.indexOf("center")&&(s.my="center"===i?"center":s.my+" center",s.at="center"===i?"center":s.at+" center"),0<=i.indexOf("top")&&(s.my+=" top"+(0!==n.position_top?"+"+(p("body").hasClass("admin-bar")?parseInt(n.position_top,10)+32:n.position_top):""),s.at+=" top"),0<=i.indexOf("bottom")&&(s.my+=" bottom"+(0!==n.position_bottom?"-"+n.position_bottom:""),s.at+=" bottom")),s.my=p.trim(s.my),s.at=p.trim(s.at),o.is(":hidden")&&(r.overlay=o.css("opacity"),o.css({opacity:0}).show(0)),t.is(":hidden")&&(r.container=t.css("opacity"),t.css({opacity:0}).show(0)),n.position_fixed&&t.addClass("fixed"),"custom"===n.size?t.css({width:n.custom_width,height:n.custom_height_auto?"auto":n.custom_height}):"auto"!==n.size&&t.addClass("responsive").css({minWidth:""!==n.responsive_min_width?n.responsive_min_width:"auto",maxWidth:""!==n.responsive_max_width?n.responsive_max_width:"auto"}),o.trigger("pumAfterReposition"),t.addClass("custom-position").position(s).trigger("popmakeAfterReposition"),r.overlay&&o.css({opacity:r.overlay}).hide(0),r.container&&t.css({opacity:r.container}).hide(0),this},animation_origin:function(e){var o=PUM.getPopup(this).popmake("getContainer"),t={my:"",at:""};switch(e){case"top":t={my:"left+"+o.offset().left+" bottom-100",at:"left top"};break;case"bottom":t={my:"left+"+o.offset().left+" top+100",at:"left bottom"};break;case"left":t={my:"right top+"+o.offset().top,at:"left top"};break;case"right":t={my:"left top+"+o.offset().top,at:"right top"};break;default:0<=e.indexOf("left")&&(t={my:t.my+" right",at:t.at+" left"}),0<=e.indexOf("right")&&(t={my:t.my+" left",at:t.at+" right"}),0<=e.indexOf("center")&&(t={my:t.my+" center",at:t.at+" center"}),0<=e.indexOf("top")&&(t={my:t.my+" bottom-100",at:t.at+" top"}),0<=e.indexOf("bottom")&&(t={my:t.my+" top+100",at:t.at+" bottom"}),t.my=p.trim(t.my),t.at=p.trim(t.at)}return t.of=window,t.collision="none",t}}}(jQuery,document),function(s,t,e){"use strict";var n,i,r,a="a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]",o=".pum:not(.pum-accessibility-disabled)";PUM_Accessibility={forceFocus:function(e){r&&r.length&&!r[0].contains(e.target)&&(e.stopPropagation(),PUM_Accessibility.setFocusToFirstItem())},trapTabKey:function(e){if(9===e.keyCode){var o=r.find(".pum-container *").filter(a).filter(":visible"),t=s(":focus"),n=o.length,i=o.index(t);e.shiftKey?0===i&&(o.get(n-1).focus(),e.preventDefault()):i===n-1&&(o.get(0).focus(),e.preventDefault())}},setFocusToFirstItem:function(){r.find(".pum-container *").filter(a).filter(":visible").filter(":not(.pum-close)").first().focus()}},s(t).on("pumInit",o,function(){PUM.getPopup(this).find("[tabindex]").each(function(){var e=s(this);e.data("tabindex",e.attr("tabindex")).prop("tabindex","0")})}).on("pumBeforeOpen",o,function(){var e=PUM.getPopup(this),o=s(":focus");e.has(o).length||(i=o),r=e.on("keydown.pum_accessibility",PUM_Accessibility.trapTabKey).attr("aria-hidden","false"),(n=s("body > *").filter(":visible").not(r)).attr("aria-hidden","true"),s(t).one("focusin.pum_accessibility",PUM_Accessibility.forceFocus),PUM_Accessibility.setFocusToFirstItem()}).on("pumAfterOpen",o,function(){}).on("pumBeforeClose",o,function(){}).on("pumAfterClose",o,function(){PUM.getPopup(this).off("keydown.pum_accessibility").attr("aria-hidden","true"),n&&(n.attr("aria-hidden","false"),n=null),void 0!==i&&i.length&&i.focus(),r=null,s(t).off("focusin.pum_accessibility")}).on("pumSetupClose",o,function(){}).on("pumOpenPrevented",o,function(){}).on("pumClosePrevented",o,function(){}).on("pumBeforeReposition",o,function(){})}(jQuery,document),function(s){"use strict";s.fn.popmake.last_open_trigger=null,s.fn.popmake.last_close_trigger=null,s.fn.popmake.conversion_trigger=null;var r=!(void 0===pum_vars.restapi||!pum_vars.restapi);PUM_Analytics={beacon:function(e,o){var t=new Image,n=r?pum_vars.restapi:pum_vars.ajaxurl,i={route:"/analytics/",data:s.extend({event:"open",pid:null,_cache:+new Date},e),callback:"function"==typeof o?o:function(){}};r?n+=i.route:i.data.action="pum_analytics",n&&(s(t).on("error success load done",i.callback),t.src=n+"?"+s.param(i.data))}},void 0!==pum_vars.disable_tracking&&pum_vars.disable_tracking||s(document).on("pumAfterOpen.core_analytics",".pum",function(){var e=PUM.getPopup(this),o={pid:parseInt(e.popmake("getSettings").id,10)||null};0<o.pid&&!s("body").hasClass("single-popup")&&PUM_Analytics.beacon(o)})}(jQuery),function(n,e,r){"use strict";n.fn.popmake.methods.animate_overlay=function(e,o,t){return PUM.getPopup(this).popmake("getSettings").overlay_disabled?n.fn.popmake.overlay_animations.none.apply(this,[o,t]):n.fn.popmake.overlay_animations[e]?n.fn.popmake.overlay_animations[e].apply(this,[o,t]):(window.console&&console.warn("Animation style "+e+" does not exist."),this)},n.fn.popmake.methods.animate=function(e){return n.fn.popmake.animations[e]?n.fn.popmake.animations[e].apply(this,Array.prototype.slice.call(arguments,1)):(window.console&&console.warn("Animation style "+e+" does not exist."),this)},n.fn.popmake.animations={none:function(e){var o=PUM.getPopup(this);return o.popmake("getContainer").css({opacity:1,display:"block"}),o.popmake("animate_overlay","none",0,function(){e!==r&&e()}),this},slide:function(o){var e=PUM.getPopup(this),t=e.popmake("getContainer"),n=e.popmake("getSettings"),i=n.animation_speed/2,s=e.popmake("animation_origin",n.animation_origin);return e.css({display:"block"}),t.css({display:"block"}).position(s).css({opacity:1}),e.popmake("animate_overlay","fade",i,function(){t.popmake("reposition",function(e){t.animate(e,i,"swing",function(){o!==r&&o()})})}),this},fade:function(e){var o=PUM.getPopup(this),t=o.popmake("getContainer").css({opacity:0,display:"block"}),n=o.popmake("getSettings").animation_speed/2;return o.popmake("animate_overlay","fade",n,function(){t.animate({opacity:1},n,"swing",function(){e!==r&&e()})}),this},fadeAndSlide:function(o){var e=PUM.getPopup(this),t=e.popmake("getContainer"),n=e.popmake("getSettings"),i=n.animation_speed/2,s=e.popmake("animation_origin",n.animation_origin);return e.css({display:"block"}),t.css({display:"block"}).position(s),e.popmake("animate_overlay","fade",i,function(){t.popmake("reposition",function(e){t.css({opacity:0}),e.opacity=1,t.animate(e,i,"swing",function(){o!==r&&o()})})}),this},grow:function(e){return n.fn.popmake.animations.fade.apply(this,arguments)},growAndSlide:function(e){return n.fn.popmake.animations.fadeAndSlide.apply(this,arguments)}},n.fn.popmake.overlay_animations={none:function(e,o){PUM.getPopup(this).css({opacity:1,display:"block"}),"function"==typeof o&&o()},fade:function(e,o){PUM.getPopup(this).css({opacity:0,display:"block"}).animate({opacity:1},e,"swing",o)},slide:function(e,o){PUM.getPopup(this).slideDown(e,o)}}}(jQuery,document),function(e,o,t){"use strict";e(o).on("pumInit",".pum",function(){e(this).popmake("getContainer").trigger("popmakeInit")}).on("pumBeforeOpen",".pum",function(){e(this).popmake("getContainer").addClass("active").trigger("popmakeBeforeOpen")}).on("pumAfterOpen",".pum",function(){e(this).popmake("getContainer").trigger("popmakeAfterOpen")}).on("pumBeforeClose",".pum",function(){e(this).popmake("getContainer").trigger("popmakeBeforeClose")}).on("pumAfterClose",".pum",function(){e(this).popmake("getContainer").removeClass("active").trigger("popmakeAfterClose")}).on("pumSetupClose",".pum",function(){e(this).popmake("getContainer").trigger("popmakeSetupClose")}).on("pumOpenPrevented",".pum",function(){e(this).popmake("getContainer").removeClass("preventOpen").removeClass("active")}).on("pumClosePrevented",".pum",function(){e(this).popmake("getContainer").removeClass("preventClose")}).on("pumBeforeReposition",".pum",function(){e(this).popmake("getContainer").trigger("popmakeBeforeReposition")})}(jQuery,document),function(o,e,t){"use strict";o.fn.popmake.callbacks={reposition_using:function(e){o(this).css(e)}}}(jQuery,document),function(p,e,o){"use strict";var t,u=function(){return void 0===t&&(t="undefined"!=typeof MobileDetect?new MobileDetect(window.navigator.userAgent):{phone:function(){return!1},tablet:function(){return!1}}),t};p.extend(p.fn.popmake.methods,{checkConditions:function(){var e,o,t,n,i,s=PUM.getPopup(this),r=s.popmake("getSettings"),a=!0;if(r.disable_on_mobile&&u().phone())return!1;if(r.disable_on_tablet&&u().tablet())return!1;if(r.conditions.length)for(o=0;r.conditions.length>o;o++){for(n=r.conditions[o],e=!1,t=0;n.length>t&&(!(i=p.extend({},{not_operand:!1},n[t])).not_operand&&s.popmake("checkCondition",i)?e=!0:i.not_operand&&!s.popmake("checkCondition",i)&&(e=!0),p(this).trigger("pumCheckingCondition",[e,i]),!e);t++);e||(a=!1)}return a},checkCondition:function(e){var o=e.target||null;e.settings;return o?p.fn.popmake.conditions[o]?p.fn.popmake.conditions[o].apply(this,[e]):window.console?(console.warn("Condition "+o+" does not exist."),!0):void 0:(console.warn("Condition type not set."),!1)}}),p.fn.popmake.conditions={}}(jQuery,document),function(d){"use strict";d.extend(d.fn.popmake,{cookie:function(c){function m(e,o,t){var n,i=new Date;if("undefined"!=typeof document){if(1<arguments.length){switch(typeof(t=d.extend({path:pum_vars.home_url},m.defaults,t)).expires){case"number":i.setMilliseconds(i.getMilliseconds()+864e5*t.expires),t.expires=i;break;case"string":i.setTime(1e3*d.fn.popmake.utilities.strtotime("+"+t.expires)),t.expires=i}try{n=JSON.stringify(o),/^[\{\[]/.test(n)&&(o=n)}catch(e){}return o=c.write?c.write(o,e):encodeURIComponent(String(o)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=(e=(e=encodeURIComponent(String(e))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape),document.cookie=[e,"=",o,t.expires?"; expires="+t.expires.toUTCString():"",t.path?"; path="+t.path:"",t.domain?"; domain="+t.domain:"",t.secure?"; secure":""].join("")}e||(n={});for(var s=document.cookie?document.cookie.split("; "):[],r=/(%[0-9A-Z]{2})+/g,a=0;a<s.length;a++){var p=s[a].split("="),u=p.slice(1).join("=");'"'===u.charAt(0)&&(u=u.slice(1,-1));try{var l=p[0].replace(r,decodeURIComponent);if(u=c.read?c.read(u,l):c(u,l)||u.replace(r,decodeURIComponent),this.json)try{u=JSON.parse(u)}catch(e){}if(e===l){n=u;break}e||(n[l]=u)}catch(e){}}return n}}return void 0===c&&(c=function(){}),(m.set=m).get=function(e){return m.call(m,e)},m.getJSON=function(){return m.apply({json:!0},[].slice.call(arguments))},m.defaults={},m.remove=function(e,o){m(e,"",d.extend({},o,{expires:-1,path:""})),m(e,"",d.extend({},o,{expires:-1}))},m.process=function(e,o,t,n){return 3<arguments.length&&"object"!=typeof t&&void 0!==o?m.apply(m,[e,o,{expires:t,path:n}]):m.apply(m,[].slice.call(arguments,[0,2]))},m.withConverter=d.fn.popmake.cookie,m}()}),pm_cookie=d.pm_cookie=d.fn.popmake.cookie.process,pm_cookie_json=d.pm_cookie_json=d.fn.popmake.cookie.getJSON,pm_remove_cookie=d.pm_remove_cookie=d.fn.popmake.cookie.remove}(jQuery),function(n,e,i){"use strict";n.extend(n.fn.popmake.methods,{addCookie:function(e){return pum.hooks.doAction("popmake.addCookie",arguments),n.fn.popmake.cookies[e]?n.fn.popmake.cookies[e].apply(this,Array.prototype.slice.call(arguments,1)):(window.console&&console.warn("Cookie type "+e+" does not exist."),this)},setCookie:function(e){n.pm_cookie(e.name,!0,e.session?null:e.time,e.path?pum_vars.home_url||"/":null),pum.hooks.doAction("popmake.setCookie",e)},checkCookies:function(e){var o,t=!1;if(e.cookie_name===i||null===e.cookie_name||""===e.cookie_name)return!1;switch(typeof e.cookie_name){case"object":case"array":for(o=0;e.cookie_name.length>o;o+=1)n.pm_cookie(e.cookie_name[o])!==i&&(t=!0);break;case"string":n.pm_cookie(e.cookie_name)!==i&&(t=!0)}return pum.hooks.doAction("popmake.checkCookies",e,t),t}}),n.fn.popmake.cookies=n.fn.popmake.cookies||{},n.extend(n.fn.popmake.cookies,{on_popup_open:function(e){var o=PUM.getPopup(this);o.on("pumAfterOpen",function(){o.popmake("setCookie",e)})},on_popup_close:function(e){var o=PUM.getPopup(this);o.on("pumBeforeClose",function(){o.popmake("setCookie",e)})},manual:function(e){var o=PUM.getPopup(this);o.on("pumSetCookie",function(){o.popmake("setCookie",e)})},form_success:function(e){var o=PUM.getPopup(this);o.on("pumFormSuccess",function(){o.popmake("setCookie",e)})},pum_sub_form_success:function(e){var o=PUM.getPopup(this);o.find("form.pum-sub-form").on("success",function(){o.popmake("setCookie",e)})},pum_sub_form_already_subscribed:function(e){var o=PUM.getPopup(this);o.find("form.pum-sub-form").on("success",function(){o.popmake("setCookie",e)})},ninja_form_success:function(e){return n.fn.popmake.cookies.form_success.apply(this,arguments)},cf7_form_success:function(e){return n.fn.popmake.cookies.form_success.apply(this,arguments)},gforms_form_success:function(e){return n.fn.popmake.cookies.form_success.apply(this,arguments)}}),n(e).on("pumInit",".pum",function(){var e,o=PUM.getPopup(this),t=o.popmake("getSettings").cookies||[],n=null;if(t.length)for(e=0;t.length>e;e+=1)n=t[e],o.popmake("addCookie",n.event,n.settings)})}(jQuery,document);var pum_debug,pum_debug_mode=!1;!function(r,e){if(e=window.pum_vars||{debug_mode:!1},(pum_debug_mode=void 0!==e.debug_mode&&e.debug_mode)||-1===window.location.href.indexOf("pum_debug")||(pum_debug_mode=!0),pum_debug_mode){var a=!1,t=!1,p=window.pum_debug_vars||{debug_mode_enabled:"Popup Maker: Debug Mode Enabled",debug_started_at:"Debug started at:",debug_more_info:"For more information on how to use this information visit https://docs.wppopupmaker.com/?utm_medium=js-debug-info&utm_campaign=ContextualHelp&utm_source=browser-console&utm_content=more-info",global_info:"Global Information",localized_vars:"Localized variables",popups_initializing:"Popups Initializing",popups_initialized:"Popups Initialized",single_popup_label:"Popup: #",theme_id:"Theme ID: ",label_method_call:"Method Call:",label_method_args:"Method Arguments:",label_popup_settings:"Settings",label_triggers:"Triggers",label_cookies:"Cookies",label_delay:"Delay:",label_conditions:"Conditions",label_cookie:"Cookie:",label_settings:"Settings:",label_selector:"Selector:",label_mobile_disabled:"Mobile Disabled:",label_tablet_disabled:"Tablet Disabled:",label_event:"Event: %s",triggers:[],cookies:[]};pum_debug={odump:function(e){return r.extend({},e)},logo:function(){console.log(" -------------------------------------------------------------\n|  ____                           __  __       _              |\n| |  _ \\ ___  _ __  _   _ _ __   |  \\/  | __ _| | _____ _ __  |\n| | |_) / _ \\| '_ \\| | | | '_ \\  | |\\/| |/ _` | |/ / _ \\ '__| |\n| |  __/ (_) | |_) | |_| | |_) | | |  | | (_| |   <  __/ |    |\n| |_|   \\___/| .__/ \\__,_| .__/  |_|  |_|\\__,_|_|\\_\\___|_|    |\n|            |_|         |_|                                  |\n -------------------------------------------------------------")},initialize:function(){a=!0,pum_debug.logo(),console.debug(p.debug_mode_enabled),console.log(p.debug_started_at,new Date),console.info(p.debug_more_info),pum_debug.divider(p.global_info),console.groupCollapsed(p.localized_vars),console.log("pum_vars:",pum_debug.odump(e)),r(document).trigger("pum_debug_initialize_localized_vars"),console.groupEnd(),r(document).trigger("pum_debug_initialize")},popup_event_header:function(e){var o=e.popmake("getSettings");t!==o.id&&(t=o.id,pum_debug.divider(p.single_popup_label+o.id+" - "+o.slug))},divider:function(e){var o=62,t=0,n=" "+new Array(63).join("-")+" ";"string"==typeof e?(o=62-e.length,(t={left:Math.floor(o/2),right:Math.floor(o/2)}).left+t.right===o-1&&t.right++,t.left=new Array(t.left+1).join(" "),t.right=new Array(t.right+1).join(" "),console.log(n+"\n|"+t.left+e+t.right+"|\n"+n)):console.log(n)},click_trigger:function(e,o){var t,n=e.popmake("getSettings"),i=[".popmake-"+n.id,".popmake-"+decodeURIComponent(n.slug),'a[href$="#popmake-'+n.id+'"]'];o.extra_selectors&&""!==o.extra_selectors&&i.push(o.extra_selectors),t=(i=pum.hooks.applyFilters("pum.trigger.click_open.selectors",i,o,e)).join(", "),console.log(p.label_selector,t)},trigger:function(e,o){if("string"==typeof p.triggers[o.type]){switch(console.groupCollapsed(p.triggers[o.type]),o.type){case"auto_open":console.log(p.label_delay,o.settings.delay),console.log(p.label_cookie,o.settings.cookie_name);break;case"click_open":pum_debug.click_trigger(e,o.settings),console.log(p.label_cookie,o.settings.cookie_name)}r(document).trigger("pum_debug_render_trigger",e,o),console.groupEnd()}},cookie:function(e,o){if("string"==typeof p.cookies[o.event]){switch(console.groupCollapsed(p.cookies[o.event]),o.event){case"on_popup_open":case"on_popup_close":case"manual":case"ninja_form_success":console.log(p.label_cookie,pum_debug.odump(o.settings))}r(document).trigger("pum_debug_render_trigger",e,o),console.groupEnd()}}},r(document).on("pumInit",".pum",function(){var e=PUM.getPopup(r(this)),o=e.popmake("getSettings"),t=o.triggers||[],n=o.cookies||[],i=o.conditions||[],s=0;if(a||(pum_debug.initialize(),pum_debug.divider(p.popups_initializing)),console.groupCollapsed(p.single_popup_label+o.id+" - "+o.slug),console.log(p.theme_id,o.theme_id),t.length){for(console.groupCollapsed(p.label_triggers),s=0;t.length>s;s++)pum_debug.trigger(e,t[s]);console.groupEnd()}if(n.length){for(console.groupCollapsed(p.label_cookies),s=0;n.length>s;s+=1)pum_debug.cookie(e,n[s]);console.groupEnd()}i.length&&(console.groupCollapsed(p.label_conditions),console.log(i),console.groupEnd()),console.groupCollapsed(p.label_popup_settings),console.log(p.label_mobile_disabled,!1!==o.disable_on_mobile),console.log(p.label_tablet_disabled,!1!==o.disable_on_tablet),console.log(p.label_display_settings,pum_debug.odump(o)),e.trigger("pum_debug_popup_settings"),console.groupEnd(),console.groupEnd()}).on("pumBeforeOpen",".pum",function(){var e=PUM.getPopup(r(this)),o=r.fn.popmake.last_open_trigger;pum_debug.popup_event_header(e),console.groupCollapsed(p.label_event.replace("%s","pumBeforeOpen"));try{o=(o=r(r.fn.popmake.last_open_trigger)).length?o:r.fn.popmake.last_open_trigger.toString()}catch(e){o=""}finally{console.log(p.label_triggers,[o])}console.groupEnd()}).on("pumOpenPrevented",".pum",function(){var e=PUM.getPopup(r(this));pum_debug.popup_event_header(e),console.groupCollapsed(p.label_event.replace("%s","pumOpenPrevented")),console.groupEnd()}).on("pumAfterOpen",".pum",function(){var e=PUM.getPopup(r(this));pum_debug.popup_event_header(e),console.groupCollapsed(p.label_event.replace("%s","pumAfterOpen")),console.groupEnd()}).on("pumSetupClose",".pum",function(){var e=PUM.getPopup(r(this));pum_debug.popup_event_header(e),console.groupCollapsed(p.label_event.replace("%s","pumSetupClose")),console.groupEnd()}).on("pumClosePrevented",".pum",function(){var e=PUM.getPopup(r(this));pum_debug.popup_event_header(e),console.groupCollapsed(p.label_event.replace("%s","pumClosePrevented")),console.groupEnd()}).on("pumBeforeClose",".pum",function(){var e=PUM.getPopup(r(this));pum_debug.popup_event_header(e),console.groupCollapsed(p.label_event.replace("%s","pumBeforeClose")),console.groupEnd()}).on("pumAfterClose",".pum",function(){var e=PUM.getPopup(r(this));pum_debug.popup_event_header(e),console.groupCollapsed(p.label_event.replace("%s","pumAfterClose")),console.groupEnd()}).on("pumBeforeReposition",".pum",function(){var e=PUM.getPopup(r(this));pum_debug.popup_event_header(e),console.groupCollapsed(p.label_event.replace("%s","pumBeforeReposition")),console.groupEnd()}).on("pumAfterReposition",".pum",function(){var e=PUM.getPopup(r(this));pum_debug.popup_event_header(e),console.groupCollapsed(p.label_event.replace("%s","pumAfterReposition")),console.groupEnd()}).on("pumCheckingCondition",".pum",function(e,o,t){var n=PUM.getPopup(r(this));pum_debug.popup_event_header(n),console.groupCollapsed(p.label_event.replace("%s","pumCheckingCondition")),console.log((t.not_operand?"(!) ":"")+t.target+": "+o,t),console.groupEnd()})}}(jQuery),function(e,o,t){"use strict";e.fn.popmake.defaults={id:null,slug:"",theme_id:null,cookies:[],triggers:[],conditions:[],mobile_disabled:null,tablet_disabled:null,custom_height_auto:!1,scrollable_content:!1,position_from_trigger:!1,position_fixed:!1,overlay_disabled:!1,stackable:!1,disable_reposition:!1,close_on_overlay_click:!1,close_on_esc_press:!1,close_on_f4_press:!1,disable_on_mobile:!1,disable_on_tablet:!1,size:"medium",responsive_min_width:"0%",responsive_max_width:"100%",custom_width:"640px",custom_height:"380px",animation_type:"fade",animation_speed:"350",animation_origin:"center top",location:"center top",position_top:"100",position_bottom:"0",position_left:"0",position_right:"0",zindex:"1999999999",close_button_delay:"0",meta:{display:{stackable:!1,overlay_disabled:!1,size:"medium",responsive_max_width:"100",responsive_max_width_unit:"%",responsive_min_width:"0",responsive_min_width_unit:"%",custom_width:"640",custom_width_unit:"px",custom_height:"380",custom_height_unit:"px",custom_height_auto:!1,location:"center top",position_top:100,position_left:0,position_bottom:0,position_right:0,position_fixed:!1,animation_type:"fade",animation_speed:350,animation_origin:"center top",scrollable_content:!1,disable_reposition:!1,position_from_trigger:!1,overlay_zindex:!1,zindex:"1999999999"},close:{overlay_click:!1,esc_press:!1,f4_press:!1,text:"",button_delay:0},click_open:[]},container:{active_class:"active",attr:{class:"popmake"}},title:{attr:{class:"popmake-title"}},content:{attr:{class:"popmake-content"}},close:{close_speed:0,attr:{class:"popmake-close"}},overlay:{attr:{id:"popmake-overlay",class:"popmake-overlay"}}}}(jQuery,document),function(s){"use strict";var r={openpopup:!1,openpopup_id:0,closepopup:!1,closedelay:0,redirect_enabled:!1,redirect:"",cookie:!1};window.PUM=window.PUM||{},window.PUM.forms=window.PUM.forms||{},s.extend(window.PUM.forms,{form:{validation:{errors:[]},responseHandler:function(e,o){var t=o.data;o.success?window.PUM.forms.form.success(e,t):window.PUM.forms.form.errors(e,t)},display_errors:function(e,o){window.PUM.forms.messages.add(e,o||this.validation.errors,"error")},beforeAjax:function(e){var o=e.find('[type="submit"]'),t=o.find(".pum-form__loader");window.PUM.forms.messages.clear_all(e),t.length||(t=s('<span class="pum-form__loader"></span>'),""!==o.attr("value")?t.insertAfter(o):o.append(t)),o.prop("disabled",!0),t.show(),e.addClass("pum-form--loading").removeClass("pum-form--errors")},afterAjax:function(e){var o=e.find('[type="submit"]'),t=o.find(".pum-form__loader");o.prop("disabled",!1),t.hide(),e.removeClass("pum-form--loading")},success:function(e,o){void 0!==o.message&&""!==o.message&&window.PUM.forms.messages.add(e,[{message:o.message}]),e.trigger("success",[o]),!e.data("noredirect")&&void 0!==e.data("redirect_enabled")&&o.redirect&&(""!==o.redirect?window.location=o.redirect:window.location.reload(!0))},errors:function(e,o){void 0!==o.errors&&o.errors.length&&(console.log(o.errors),window.PUM.forms.form.display_errors(e,o.errors),window.PUM.forms.messages.scroll_to_first(e),e.addClass("pum-form--errors").trigger("errors",[o]))},submit:function(e){var o=s(this),t=o.pumSerializeObject();e.preventDefault(),e.stopPropagation(),window.PUM.forms.form.beforeAjax(o),s.ajax({type:"POST",dataType:"json",url:pum_vars.ajaxurl,data:{action:"pum_form",values:t}}).always(function(){window.PUM.forms.form.afterAjax(o)}).done(function(e){window.PUM.forms.form.responseHandler(o,e)}).error(function(e,o,t){console.log("Error: type of "+o+" with message of "+t)})}},messages:{add:function(e,o,t){var n=e.find(".pum-form__messages"),i=0;if(t=t||"success",o=o||[],!n.length)switch(n=s('<div class="pum-form__messages">').hide(),pum_vars.message_position){case"bottom":e.append(n.addClass("pum-form__messages--bottom"));break;case"top":e.prepend(n.addClass("pum-form__messages--top"))}if(0<=["bottom","top"].indexOf(pum_vars.message_position))for(;o.length>i;i++)this.add_message(n,o[i].message,t);else for(;o.length>i;i++)void 0!==o[i].field?this.add_field_error(e,o[i]):this.add_message(n,o[i].message,t);n.is(":hidden")&&s(".pum-form__message",n).length&&n.slideDown()},add_message:function(e,o,t){var n=s('<p class="pum-form__message">').html(o);t=t||"success",n.addClass("pum-form__message--"+t),e.append(n),e.is(":visible")&&n.hide().slideDown()},add_field_error:function(e,o){var t=s('[name="'+o.field+'"]',e).parents(".pum-form__field").addClass("pum-form__field--error");this.add_message(t,o.message,"error")},clear_all:function(e,o){var t=e.find(".pum-form__messages"),n=t.find(".pum-form__message"),i=e.find(".pum-form__field.pum-form__field--error");o=o||!1,t.length&&n.slideUp("fast",function(){s(this).remove(),o&&t.hide()}),i.length&&i.removeClass("pum-form__field--error").find("p.pum-form__message").remove()},scroll_to_first:function(e){window.PUM.utilities.scrollTo(s(".pum-form__field.pum-form__field--error",e).eq(0))}},success:function(e,o){if(o=s.extend({},r,o)){var t=PUM.getPopup(e),n={},i=function(){o.openpopup&&PUM.getPopup(o.openpopup_id).length?PUM.open(o.openpopup_id):o.redirect_enabled&&(""!==o.redirect?window.location=o.redirect:window.location.reload(!0))};t.length&&(t.trigger("pumFormSuccess"),o.cookie&&(n=s.extend({name:"pum-"+PUM.getSetting(t,"id"),expires:"+1 year"},"object"==typeof o.cookie?o.cookie:{}),PUM.setCookie(t,n))),t.length&&o.closepopup?setTimeout(function(){t.popmake("close",i)},1e3*parseInt(o.closedelay)):i()}}})}(jQuery),function(e,o){"use strict";e.pum=e.pum||{},e.pum.hooks=e.pum.hooks||new function(){var t=Array.prototype.slice,i={removeFilter:function(e,o){return"string"==typeof e&&n("filters",e,o),i},applyFilters:function(){var e=t.call(arguments),o=e.shift();return"string"!=typeof o?i:r("filters",o,e)},addFilter:function(e,o,t,n){return"string"==typeof e&&"function"==typeof o&&(t=parseInt(t||10,10),s("filters",e,o,t,n)),i},removeAction:function(e,o){return"string"==typeof e&&n("actions",e,o),i},doAction:function(){var e=t.call(arguments),o=e.shift();return"string"==typeof o&&r("actions",o,e),i},addAction:function(e,o,t,n){return"string"==typeof e&&"function"==typeof o&&(t=parseInt(t||10,10),s("actions",e,o,t,n)),i}},a={actions:{},filters:{}};function n(e,o,t,n){var i,s,r;if(a[e][o])if(t)if(i=a[e][o],n)for(r=i.length;r--;)(s=i[r]).callback===t&&s.context===n&&i.splice(r,1);else for(r=i.length;r--;)i[r].callback===t&&i.splice(r,1);else a[e][o]=[]}function s(e,o,t,n,i){var s={callback:t,priority:n,context:i},r=a[e][o];r=r?(r.push(s),function(e){for(var o,t,n,i=1,s=e.length;i<s;i++){for(o=e[i],t=i;(n=e[t-1])&&n.priority>o.priority;)e[t]=e[t-1],--t;e[t]=o}return e}(r)):[s],a[e][o]=r}function r(e,o,t){var n,i,s=a[e][o];if(!s)return"filters"===e&&t[0];if(i=s.length,"filters"===e)for(n=0;n<i;n++)t[0]=s[n].callback.apply(s[n].context,t);else for(n=0;n<i;n++)s[n].callback.apply(s[n].context,t);return"filters"!==e||t[0]}return i}}(window),function(r){"use strict";var i={},e=!1;r(document).ready(function(){!1===e&&"undefined"!=typeof Marionette&&"undefined"!=typeof nfRadio&&(e=Marionette.Object.extend({initialize:function(){this.listenTo(nfRadio.channel("forms"),"submit:response",this.popupMaker)},popupMaker:function(e,o,t,n){var i=r("#nf-form-"+n+"-cont"),s={};e.errors.length||(void 0!==e.data.actions&&(s.openpopup=void 0!==e.data.actions.openpopup,s.openpopup_id=s.openpopup?parseInt(e.data.actions.openpopup):0,s.closepopup=void 0!==e.data.actions.closepopup,s.closedelay=s.closepopup?parseInt(e.data.actions.closepopup):0,s.closepopup&&e.data.actions.closedelay&&(s.closedelay=parseInt(e.data.actions.closedelay))),window.PUM.forms.success(i,s))}})),!1!==e&&new e,r(".gform_wrapper > form").each(function(){var e=r(this),o=e.attr("id").replace("gform_",""),t=e.find("input.gforms-pum"),n=!!t.length&&JSON.parse(t.val());n&&"object"==typeof n&&("object"==typeof n&&void 0!==n.closedelay&&3<=n.closedelay.toString().length&&(n.closedelay=n.closedelay/1e3),i[o]=n)})}).on("gform_confirmation_loaded",function(e,o){var t=r("#gform_confirmation_wrapper_"+o+",#gforms_confirmation_message_"+o),n=i[o]||!1;window.PUM.forms.success(t,n)}).on("wpcf7:mailsent",".wpcf7",function(e){var o=r(e.target),t=o.find("input.wpcf7-pum"),n=!!t.length&&JSON.parse(t.val());"object"==typeof n&&void 0!==n.closedelay&&3<=n.closedelay.toString().length&&(n.closedelay=n.closedelay/1e3),window.PUM.forms.success(o,n)})}(jQuery),function(i){"use strict";pum_vars&&void 0!==pum_vars.core_sub_forms_enabled&&!pum_vars.core_sub_forms_enabled||(window.PUM=window.PUM||{},window.PUM.newsletter=window.PUM.newsletter||{},i.extend(window.PUM.newsletter,{form:i.extend({},window.PUM.forms.form,{submit:function(e){var o=i(this),t=o.pumSerializeObject();e.preventDefault(),e.stopPropagation(),window.PUM.newsletter.form.beforeAjax(o),i.ajax({type:"POST",dataType:"json",url:pum_vars.ajaxurl,data:{action:"pum_sub_form",values:t}}).always(function(){window.PUM.newsletter.form.afterAjax(o)}).done(function(e){window.PUM.newsletter.form.responseHandler(o,e)}).error(function(e,o,t){console.log("Error: type of "+o+" with message of "+t)})}})}),i(document).on("submit","form.pum-sub-form",window.PUM.newsletter.form.submit).on("success","form.pum-sub-form",function(e,o){var t=i(e.target),n=t.data("settings")||{};t.trigger("pumNewsletterSuccess",[o]).addClass("pum-newsletter-success"),t[0].reset(),window.pum.hooks.doAction("pum-sub-form.success",o,t),"string"==typeof n.redirect&&""!==n.redirect&&(n.redirect=atob(n.redirect)),window.PUM.forms.success(t,n)}).on("error","form.pum-sub-form",function(e,o){var t=i(e.target);t.trigger("pumNewsletterError",[o]),window.pum.hooks.doAction("pum-sub-form.errors",o,t)}))}(jQuery),function(s,r,e){"use strict";s.extend(s.fn.popmake.methods,{addTrigger:function(e){return s.fn.popmake.triggers[e]?s.fn.popmake.triggers[e].apply(this,Array.prototype.slice.call(arguments,1)):(window.console&&console.warn("Trigger type "+e+" does not exist."),this)}}),s.fn.popmake.triggers={auto_open:function(e){var o=PUM.getPopup(this);setTimeout(function(){o.popmake("state","isOpen")||!o.popmake("checkCookies",e)&&o.popmake("checkConditions")&&(s.fn.popmake.last_open_trigger="Auto Open - Delay: "+e.delay,o.popmake("open"))},e.delay)},click_open:function(n){var e,i=PUM.getPopup(this),o=i.popmake("getSettings"),t=[".popmake-"+o.id,".popmake-"+decodeURIComponent(o.slug),'a[href$="#popmake-'+o.id+'"]'];n.extra_selectors&&""!==n.extra_selectors&&t.push(n.extra_selectors),e=(t=pum.hooks.applyFilters("pum.trigger.click_open.selectors",t,n,i)).join(", "),s(e).addClass("pum-trigger").css({cursor:"pointer"}),s(r).on("click.pumTrigger",e,function(e){var o=s(this),t=n.do_default||!1;0<i.has(o).length||i.popmake("state","isOpen")||!i.popmake("checkCookies",n)&&i.popmake("checkConditions")&&(o.data("do-default")?t=o.data("do-default"):(o.hasClass("do-default")||o.hasClass("popmake-do-default")||o.hasClass("pum-do-default"))&&(t=!0),e.ctrlKey||pum.hooks.applyFilters("pum.trigger.click_open.do_default",t,i,o)||(e.preventDefault(),e.stopPropagation()),s.fn.popmake.last_open_trigger=o,i.popmake("open"))})},admin_debug:function(){PUM.getPopup(this).popmake("open")}},s(r).on("pumInit",".pum",function(){var e,o=PUM.getPopup(this),t=o.popmake("getSettings").triggers||[],n=null;if(t.length)for(e=0;t.length>e;e+=1)n=t[e],o.popmake("addTrigger",n.type,n.settings)})}(jQuery,document),function(p,e,o){"use strict";var n="color,date,datetime,datetime-local,email,hidden,month,number,password,range,search,tel,text,time,url,week".split(","),i="select,textarea".split(","),s=/\[([^\]]*)\]/g;Array.prototype.indexOf||(Array.prototype.indexOf=function(e){if(null==this)throw new TypeError;var o=Object(this),t=o.length>>>0;if(0===t)return-1;var n=0;if(0<arguments.length&&((n=Number(arguments[1]))!=n?n=0:0!==n&&n!==1/0&&n!==-1/0&&(n=(0<n||-1)*Math.floor(Math.abs(n)))),t<=n)return-1;for(var i=0<=n?n:Math.max(t-Math.abs(n),0);i<t;i++)if(i in o&&o[i]===e)return i;return-1}),p.fn.popmake.utilities={scrollTo:function(e,o){var t=p(e)||p();t.length&&p("html, body").animate({scrollTop:t.offset().top-100},1e3,"swing",function(){var e=t.find(':input:not([type="button"]):not([type="hidden"]):not(button)').eq(0);e.hasClass("wp-editor-area")?tinyMCE.execCommand("mceFocus",!1,e.attr("id")):e.focus(),"function"==typeof o&&o()})},inArray:function(e,o){return!!~o.indexOf(e)},convert_hex:function(e,o){return e=e.replace("#",""),"rgba("+parseInt(e.substring(0,2),16)+","+parseInt(e.substring(2,4),16)+","+parseInt(e.substring(4,6),16)+","+o/100+")"},debounce:function(t,n){var i;return function(){var e=this,o=arguments;window.clearTimeout(i),i=window.setTimeout(function(){t.apply(e,o)},n)}},throttle:function(e,o){var t=!1,n=function(){t=!1};return function(){t||(e.apply(this,arguments),window.setTimeout(n,o),t=!0)}},getXPath:function(e){var t,n,i,s,r,a=[];return p.each(p(e).parents(),function(e,o){if(t=p(o),n=t.attr("id")||"",i=t.attr("class")||"",s=t.get(0).tagName.toLowerCase(),r=t.parent().children(s).index(t),"body"===s)return!1;0<i.length&&(i=(i=i.split(" "))[0]),a.push(s+(0<n.length?"#"+n:0<i.length?"."+i.split(" ").join("."):":eq("+r+")"))}),a.reverse().join(" > ")},strtotime:function(e,o){var t,n,i,s,l,c,m,r,a,p;if(!e)return!1;if((n=(e=e.replace(/^\s+|\s+$/g,"").replace(/\s{2,}/g," ").replace(/[\t\r\n]/g,"").toLowerCase()).match(/^(\d{1,4})([\-\.\/\:])(\d{1,2})([\-\.\/\:])(\d{1,4})(?:\s(\d{1,2}):(\d{2})?:?(\d{2})?)?(?:\s([A-Z]+)?)?$/))&&n[2]===n[4])if(1901<n[1])switch(n[2]){case"-":return!(12<n[3]||31<n[5])&&new Date(n[1],parseInt(n[3],10)-1,n[5],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3;case".":return!1;case"/":return!(12<n[3]||31<n[5])&&new Date(n[1],parseInt(n[3],10)-1,n[5],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3}else if(1901<n[5])switch(n[2]){case"-":case".":return!(12<n[3]||31<n[1])&&new Date(n[5],parseInt(n[3],10)-1,n[1],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3;case"/":return!(12<n[1]||31<n[3])&&new Date(n[5],parseInt(n[1],10)-1,n[3],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3}else switch(n[2]){case"-":return!(12<n[3]||31<n[5]||n[1]<70&&38<n[1])&&(s=0<=n[1]&&n[1]<=38?+n[1]+2e3:n[1],new Date(s,parseInt(n[3],10)-1,n[5],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3);case".":return 70<=n[5]?!(12<n[3]||31<n[1])&&new Date(n[5],parseInt(n[3],10)-1,n[1],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3:n[5]<60&&!n[6]&&(!(23<n[1]||59<n[3])&&(i=new Date,new Date(i.getFullYear(),i.getMonth(),i.getDate(),n[1]||0,n[3]||0,n[5]||0,n[9]||0)/1e3));case"/":return!(12<n[1]||31<n[3]||n[5]<70&&38<n[5])&&(s=0<=n[5]&&n[5]<=38?+n[5]+2e3:n[5],new Date(s,parseInt(n[1],10)-1,n[3],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3);case":":return!(23<n[1]||59<n[3]||59<n[5])&&(i=new Date,new Date(i.getFullYear(),i.getMonth(),i.getDate(),n[1]||0,n[3]||0,n[5]||0)/1e3)}if("now"===e)return null===o||isNaN(o)?(new Date).getTime()/1e3||0:o||0;if(t=Date.parse(e),!isNaN(t))return t/1e3||0;function u(e){var o,t,n,i,s=e.split(" "),r=s[0],a=s[1].substring(0,3),p=/\d+/.test(r),u=("last"===r?-1:1)*("ago"===s[2]?-1:1);if(p&&(u*=parseInt(r,10)),m.hasOwnProperty(a)&&!s[1].match(/^mon(day|\.)?$/i))return l["set"+m[a]](l["get"+m[a]]()+u);if("wee"===a)return l.setDate(l.getDate()+7*u);if("next"===r||"last"===r)o=r,t=u,void 0!==(i=c[a])&&(0==(n=i-l.getDay())?n=7*t:0<n&&"last"===o?n-=7:n<0&&"next"===o&&(n+=7),l.setDate(l.getDate()+n));else if(!p)return!1;return!0}if(l=o?new Date(1e3*o):new Date,c={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6},m={yea:"FullYear",mon:"Month",day:"Date",hou:"Hours",min:"Minutes",sec:"Seconds"},"([+-]?\\d+\\s"+(a="(years?|months?|weeks?|days?|hours?|minutes?|min|seconds?|sec|sunday|sun\\.?|monday|mon\\.?|tuesday|tue\\.?|wednesday|wed\\.?|thursday|thu\\.?|friday|fri\\.?|saturday|sat\\.?)")+"|(last|next)\\s"+a+")(\\sago)?",!(n=e.match(new RegExp("([+-]?\\d+\\s(years?|months?|weeks?|days?|hours?|minutes?|min|seconds?|sec|sunday|sun\\.?|monday|mon\\.?|tuesday|tue\\.?|wednesday|wed\\.?|thursday|thu\\.?|friday|fri\\.?|saturday|sat\\.?)|(last|next)\\s(years?|months?|weeks?|days?|hours?|minutes?|min|seconds?|sec|sunday|sun\\.?|monday|mon\\.?|tuesday|tue\\.?|wednesday|wed\\.?|thursday|thu\\.?|friday|fri\\.?|saturday|sat\\.?))(\\sago)?","gi"))))return!1;for(p=0,r=n.length;p<r;p+=1)if(!u(n[p]))return!1;return l.getTime()/1e3},serializeObject:function(e){p.extend({},e);var o={},t=p.extend(!0,{include:[],exclude:[],includeByClass:""},e);return this.find(":input").each(function(){var e;!this.name||this.disabled||window.PUM.utilities.inArray(this.name,t.exclude)||t.include.length&&!window.PUM.utilities.inArray(this.name,t.include)||-1===this.className.indexOf(t.includeByClass)||(e=this.name.replace(s,"[$1").split("["))[0]&&(this.checked||window.PUM.utilities.inArray(this.type,n)||window.PUM.utilities.inArray(this.nodeName.toLowerCase(),i))&&("checkbox"===this.type&&e.push(""),function e(o,t,n){var i=t[0];1<t.length?(o[i]||(o[i]=t[1]?{}:[]),e(o[i],t.slice(1),n)):(i||(i=o.length),o[i]=n)}(o,e,p(this).val()))}),o}},p.fn.popmake.utilies=p.fn.popmake.utilities,window.PUM=window.PUM||{},window.PUM.utilities=window.PUM.utilities||{},window.PUM.utilities=p.extend(window.PUM.utilities,p.fn.popmake.utilities)}(jQuery,document),function(e,t){if("function"==typeof define&&define.amd)define(["exports","jquery"],function(e,o){return t(e,o)});else if("undefined"!=typeof exports){var o=require("jquery");t(exports,o)}else t(e,e.jQuery||e.Zepto||e.ender||e.$)}(this,function(e,a){var p={validate:/^[a-z_][a-z0-9_]*(?:\[(?:\d*|[a-z0-9_]+)\])*$/i,key:/[a-z0-9_]+|(?=\[\])/gi,push:/^$/,fixed:/^\d+$/,named:/^[a-z0-9_]+$/i};function o(n,t){var i={},s={};function r(e,o,t){return e[o]=t,e}function e(){return i}this.addPair=function(e){if(!p.validate.test(e.name))return this;var o=function(e,o){var t,n,i=e.match(p.key);try{o=JSON.parse(o)}catch(e){}for(;void 0!==(t=i.pop());)p.push.test(t)?o=r([],(n=e.replace(/\[\]$/,""),void 0===s[n]&&(s[n]=0),s[n]++),o):p.fixed.test(t)?o=r([],t,o):p.named.test(t)&&(o=r({},t,o));return o}(e.name,function(e){switch(a('[name="'+e.name+'"]',t).attr("type")){case"checkbox":return"1"===e.value||e.value;default:return e.value}}(e));return i=n.extend(!0,i,o),this},this.addPairs=function(e){if(!n.isArray(e))throw new Error("formSerializer.addPairs expects an Array");for(var o=0,t=e.length;o<t;o++)this.addPair(e[o]);return this},this.serialize=e,this.serializeJSON=function(){return JSON.stringify(e())}}return o.patterns=p,o.serializeObject=function(){var e;return e=this.is("form")?this.serializeArray():this.find(":input").serializeArray(),new o(a,this).addPairs(e).serialize()},o.serializeJSON=function(){var e;return e=this.is("form")?this.serializeArray():this.find(":input").serializeArray(),new o(a,this).addPairs(e).serializeJSON()},void 0!==a.fn&&(a.fn.pumSerializeObject=o.serializeObject,a.fn.pumSerializeJSON=o.serializeJSON),e.FormSerializer=o}),function(e,o,t){"use strict";e.fn.popmake.version=1.7,e.fn.popmake.last_open_popup=null,e(void 0).ready(function(){e(".pum").popmake(),e(void 0).trigger("pumInitialized"),"object"==typeof pum_vars.form_success&&(pum_vars.form_success=e.extend({popup_id:null,settings:{}}),PUM.forms.success(pum_vars.form_success.popup_id,pum_vars.form_success.settings))}),e(".pum").on("pumInit",function(){var e=PUM.getPopup(this),o=PUM.getSetting(e,"id"),t=e.find("form");t.length&&t.prepend('<input type="hidden" name="pum_form_popup_id" value="'+o+'" />')})}(jQuery);