!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("jQuery")):"function"==typeof define&&define.amd?define(["jQuery"],t):"object"==typeof exports?exports.Give=t(require("jQuery")):e.Give=t(e.jQuery)}("undefined"!=typeof self?self:this,function(e){return function(e){function t(n){if(i[n])return i[n].exports;var o=i[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var i={};return t.m=e,t.c=i,t.d=function(e,i,n){t.o(e,i)||Object.defineProperty(e,i,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=25)}([function(t,i){t.exports=e},function(e,t){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(i=window)}e.exports=i},function(e,t,i){(function(t){e.exports=t.accounting=i(3)}).call(t,i(1))},function(e,t,i){/*!
 * accounting.js v0.4.1
 * Copyright 2014 Open Exchange Rates
 *
 * Freely distributable under the MIT license.
 * Portions of accounting.js are inspired or borrowed from underscore.js
 *
 * Full details and documentation:
 * http://openexchangerates.github.io/accounting.js/
 */
!function(i,n){function o(e){return!!(""===e||e&&e.charCodeAt&&e.substr)}function a(e){return f?f(e):"[object Array]"===p.call(e)}function r(e){return e&&"[object Object]"===p.call(e)}function s(e,t){var i;e=e||{},t=t||{};for(i in t)t.hasOwnProperty(i)&&null==e[i]&&(e[i]=t[i]);return e}function l(e,t,i){var n,o,a=[];if(!e)return a;if(h&&e.map===h)return e.map(t,i);for(n=0,o=e.length;n<o;n++)a[n]=t.call(i,e[n],n,e);return a}function c(e,t){return e=Math.round(Math.abs(e)),isNaN(e)?t:e}function d(e){var t=u.settings.currency.format;return"function"==typeof e&&(e=e()),o(e)&&e.match("%v")?{pos:e,neg:e.replace("-","").replace("%v","-%v"),zero:e}:e&&e.pos&&e.pos.match("%v")?e:o(t)?u.settings.currency.format={pos:t,neg:t.replace("%v","-%v"),zero:t}:t}var u={};u.version="0.4.1",u.settings={currency:{symbol:"$",format:"%s%v",decimal:".",thousand:",",precision:2,grouping:3},number:{precision:0,grouping:3,thousand:",",decimal:"."}};var h=Array.prototype.map,f=Array.isArray,p=Object.prototype.toString,g=u.unformat=u.parse=function(e,t){if(a(e))return l(e,function(e){return g(e,t)});if("number"==typeof(e=e||0))return e;t=t||u.settings.number.decimal;var i=new RegExp("[^0-9-"+t+"]",["g"]),n=parseFloat((""+e).replace(/\((.*)\)/,"-$1").replace(i,"").replace(t,"."));return isNaN(n)?0:n},m=u.toFixed=function(e,t){t=c(t,u.settings.number.precision);var i=Math.pow(10,t);return(Math.round(u.unformat(e)*i)/i).toFixed(t)},_=u.formatNumber=u.format=function(e,t,i,n){if(a(e))return l(e,function(e){return _(e,t,i,n)});e=g(e);var o=s(r(t)?t:{precision:t,thousand:i,decimal:n},u.settings.number),d=c(o.precision),h=e<0?"-":"",f=parseInt(m(Math.abs(e||0),d),10)+"",p=f.length>3?f.length%3:0;return h+(p?f.substr(0,p)+o.thousand:"")+f.substr(p).replace(/(\d{3})(?=\d)/g,"$1"+o.thousand)+(d?o.decimal+m(Math.abs(e),d).split(".")[1]:"")},v=u.formatMoney=function(e,t,i,n,o,h){if(a(e))return l(e,function(e){return v(e,t,i,n,o,h)});e=g(e);var f=s(r(t)?t:{symbol:t,precision:i,thousand:n,decimal:o,format:h},u.settings.currency),p=d(f.format);return(e>0?p.pos:e<0?p.neg:p.zero).replace("%s",f.symbol).replace("%v",_(Math.abs(e),c(f.precision),f.thousand,f.decimal))};u.formatColumn=function(e,t,i,n,h,f){if(!e)return[];var p=s(r(t)?t:{symbol:t,precision:i,thousand:n,decimal:h,format:f},u.settings.currency),m=d(p.format),v=m.pos.indexOf("%s")<m.pos.indexOf("%v"),b=0;return l(l(e,function(e,t){if(a(e))return u.formatColumn(e,p);e=g(e);var i=e>0?m.pos:e<0?m.neg:m.zero,n=i.replace("%s",p.symbol).replace("%v",_(Math.abs(e),c(p.precision),p.thousand,p.decimal));return n.length>b&&(b=n.length),n}),function(e,t){return o(e)&&e.length<b?v?e.replace(p.symbol,p.symbol+new Array(b-e.length+1).join(" ")):new Array(b-e.length+1).join(" ")+e:e})},void 0!==e&&e.exports&&(t=e.exports=u),t.accounting=u}()},function(e,t,i){var n,o,a;!function(r){o=[i(0)],n=r,void 0!==(a="function"==typeof n?n.apply(t,o):n)&&(e.exports=a)}(function(e){var t,i,n,o,a,r,s=function(){},l=!!window.jQuery,c=e(window),d=function(e,i){t.ev.on("mfp"+e+".mfp",i)},u=function(t,i,n,o){var a=document.createElement("div");return a.className="mfp-"+t,n&&(a.innerHTML=n),o?i&&i.appendChild(a):(a=e(a),i&&a.appendTo(i)),a},h=function(i,n){t.ev.triggerHandler("mfp"+i,n),t.st.callbacks&&(i=i.charAt(0).toLowerCase()+i.slice(1),t.st.callbacks[i]&&t.st.callbacks[i].apply(t,e.isArray(n)?n:[n]))},f=function(i){return i===r&&t.currTemplate.closeBtn||(t.currTemplate.closeBtn=e(t.st.closeMarkup.replace("%title%",t.st.tClose)),r=i),t.currTemplate.closeBtn},p=function(){e.magnificPopup.instance||(t=new s,t.init(),e.magnificPopup.instance=t)},g=function(){var e=document.createElement("p").style,t=["ms","O","Moz","Webkit"];if(void 0!==e.transition)return!0;for(;t.length;)if(t.pop()+"Transition"in e)return!0;return!1};s.prototype={constructor:s,init:function(){var i=navigator.appVersion;t.isLowIE=t.isIE8=document.all&&!document.addEventListener,t.isAndroid=/android/gi.test(i),t.isIOS=/iphone|ipad|ipod/gi.test(i),t.supportsTransition=g(),t.probablyMobile=t.isAndroid||t.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),n=e(document),t.popupsCache={}},open:function(i){var o;if(!1===i.isObj){t.items=i.items.toArray(),t.index=0;var r,s=i.items;for(o=0;o<s.length;o++)if(r=s[o],r.parsed&&(r=r.el[0]),r===i.el[0]){t.index=o;break}}else t.items=e.isArray(i.items)?i.items:[i.items],t.index=i.index||0;if(t.isOpen)return void t.updateItemHTML();t.types=[],a="",i.mainEl&&i.mainEl.length?t.ev=i.mainEl.eq(0):t.ev=n,i.key?(t.popupsCache[i.key]||(t.popupsCache[i.key]={}),t.currTemplate=t.popupsCache[i.key]):t.currTemplate={},t.st=e.extend(!0,{},e.magnificPopup.defaults,i),t.fixedContentPos="auto"===t.st.fixedContentPos?!t.probablyMobile:t.st.fixedContentPos,t.st.modal&&(t.st.closeOnContentClick=!1,t.st.closeOnBgClick=!1,t.st.showCloseBtn=!1,t.st.enableEscapeKey=!1),t.bgOverlay||(t.bgOverlay=u("bg").on("click.mfp",function(){t.close()}),t.wrap=u("wrap").attr("tabindex",-1).on("click.mfp",function(e){t._checkIfClose(e.target)&&t.close()}),t.container=u("container",t.wrap)),t.contentContainer=u("content"),t.st.preloader&&(t.preloader=u("preloader",t.container,t.st.tLoading));var l=e.magnificPopup.modules;for(o=0;o<l.length;o++){var p=l[o];p=p.charAt(0).toUpperCase()+p.slice(1),t["init"+p].call(t)}h("BeforeOpen"),t.st.showCloseBtn&&(t.st.closeBtnInside?(d("MarkupParse",function(e,t,i,n){i.close_replaceWith=f(n.type)}),a+=" mfp-close-btn-in"):t.wrap.append(f())),t.st.alignTop&&(a+=" mfp-align-top"),t.fixedContentPos?t.wrap.css({overflow:t.st.overflowY,overflowX:"hidden",overflowY:t.st.overflowY}):t.wrap.css({top:c.scrollTop(),position:"absolute"}),(!1===t.st.fixedBgPos||"auto"===t.st.fixedBgPos&&!t.fixedContentPos)&&t.bgOverlay.css({height:n.height(),position:"absolute"}),t.st.enableEscapeKey&&n.on("keyup.mfp",function(e){27===e.keyCode&&t.close()}),c.on("resize.mfp",function(){t.updateSize()}),t.st.closeOnContentClick||(a+=" mfp-auto-cursor"),a&&t.wrap.addClass(a);var g=t.wH=c.height(),m={};if(t.fixedContentPos&&t._hasScrollBar(g)){var _=t._getScrollbarSize();_&&(m.marginRight=_)}t.fixedContentPos&&(t.isIE7?e("body, html").css("overflow","hidden"):m.overflow="hidden");var v=t.st.mainClass;return t.isIE7&&(v+=" mfp-ie7"),v&&t._addClassToMFP(v),t.updateItemHTML(),h("BuildControls"),e("html").css(m),t.bgOverlay.add(t.wrap).prependTo(t.st.prependTo||e(document.body)),t._lastFocusedEl=document.activeElement,setTimeout(function(){t.content?(t._addClassToMFP("mfp-ready"),t._setFocus()):t.bgOverlay.addClass("mfp-ready"),n.on("focusin.mfp",t._onFocusIn)},16),t.isOpen=!0,t.updateSize(g),h("Open"),i},close:function(){t.isOpen&&(h("BeforeClose"),t.isOpen=!1,t.st.removalDelay&&!t.isLowIE&&t.supportsTransition?(t._addClassToMFP("mfp-removing"),setTimeout(function(){t._close()},t.st.removalDelay)):t._close())},_close:function(){h("Close");var i="mfp-removing mfp-ready ";if(t.bgOverlay.detach(),t.wrap.detach(),t.container.empty(),t.st.mainClass&&(i+=t.st.mainClass+" "),t._removeClassFromMFP(i),t.fixedContentPos){var o={marginRight:""};t.isIE7?e("body, html").css("overflow",""):o.overflow="",e("html").css(o)}n.off("keyup.mfp focusin.mfp"),t.ev.off(".mfp"),t.wrap.attr("class","mfp-wrap").removeAttr("style"),t.bgOverlay.attr("class","mfp-bg"),t.container.attr("class","mfp-container"),!t.st.showCloseBtn||t.st.closeBtnInside&&!0!==t.currTemplate[t.currItem.type]||t.currTemplate.closeBtn&&t.currTemplate.closeBtn.detach(),t.st.autoFocusLast&&t._lastFocusedEl&&e(t._lastFocusedEl).focus(),t.currItem=null,t.content=null,t.currTemplate=null,t.prevHeight=0,h("AfterClose")},updateSize:function(e){if(t.isIOS){var i=document.documentElement.clientWidth/window.innerWidth,n=window.innerHeight*i;t.wrap.css("height",n),t.wH=n}else t.wH=e||c.height();t.fixedContentPos||t.wrap.css("height",t.wH),h("Resize")},updateItemHTML:function(){var i=t.items[t.index];t.contentContainer.detach(),t.content&&t.content.detach(),i.parsed||(i=t.parseEl(t.index));var n=i.type;if(h("BeforeChange",[t.currItem?t.currItem.type:"",n]),t.currItem=i,!t.currTemplate[n]){var a=!!t.st[n]&&t.st[n].markup;h("FirstMarkupParse",a),t.currTemplate[n]=!a||e(a)}o&&o!==i.type&&t.container.removeClass("mfp-"+o+"-holder");var r=t["get"+n.charAt(0).toUpperCase()+n.slice(1)](i,t.currTemplate[n]);t.appendContent(r,n),i.preloaded=!0,h("Change",i),o=i.type,t.container.prepend(t.contentContainer),h("AfterChange")},appendContent:function(e,i){t.content=e,e?t.st.showCloseBtn&&t.st.closeBtnInside&&!0===t.currTemplate[i]?t.content.find(".mfp-close").length||t.content.append(f()):t.content=e:t.content="",h("BeforeAppend"),t.container.addClass("mfp-"+i+"-holder"),t.contentContainer.append(t.content)},parseEl:function(i){var n,o=t.items[i];if(o.tagName?o={el:e(o)}:(n=o.type,o={data:o,src:o.src}),o.el){for(var a=t.types,r=0;r<a.length;r++)if(o.el.hasClass("mfp-"+a[r])){n=a[r];break}o.src=o.el.attr("data-mfp-src"),o.src||(o.src=o.el.attr("href"))}return o.type=n||t.st.type||"inline",o.index=i,o.parsed=!0,t.items[i]=o,h("ElementParse",o),t.items[i]},addGroup:function(e,i){var n=function(n){n.mfpEl=this,t._openClick(n,e,i)};i||(i={});var o="click.magnificPopup";i.mainEl=e,i.items?(i.isObj=!0,e.off(o).on(o,n)):(i.isObj=!1,i.delegate?e.off(o).on(o,i.delegate,n):(i.items=e,e.off(o).on(o,n)))},_openClick:function(i,n,o){if((void 0!==o.midClick?o.midClick:e.magnificPopup.defaults.midClick)||!(2===i.which||i.ctrlKey||i.metaKey||i.altKey||i.shiftKey)){var a=void 0!==o.disableOn?o.disableOn:e.magnificPopup.defaults.disableOn;if(a)if(e.isFunction(a)){if(!a.call(t))return!0}else if(c.width()<a)return!0;i.type&&(i.preventDefault(),t.isOpen&&i.stopPropagation()),o.el=e(i.mfpEl),o.delegate&&(o.items=n.find(o.delegate)),t.open(o)}},updateStatus:function(e,n){if(t.preloader){i!==e&&t.container.removeClass("mfp-s-"+i),n||"loading"!==e||(n=t.st.tLoading);var o={status:e,text:n};h("UpdateStatus",o),e=o.status,n=o.text,t.preloader.html(n),t.preloader.find("a").on("click",function(e){e.stopImmediatePropagation()}),t.container.addClass("mfp-s-"+e),i=e}},_checkIfClose:function(i){if(!e(i).hasClass("mfp-prevent-close")){var n=t.st.closeOnContentClick,o=t.st.closeOnBgClick;if(n&&o)return!0;if(!t.content||e(i).hasClass("mfp-close")||t.preloader&&i===t.preloader[0])return!0;if(i===t.content[0]||e.contains(t.content[0],i)){if(n)return!0}else if(o&&e.contains(document,i))return!0;return!1}},_addClassToMFP:function(e){t.bgOverlay.addClass(e),t.wrap.addClass(e)},_removeClassFromMFP:function(e){this.bgOverlay.removeClass(e),t.wrap.removeClass(e)},_hasScrollBar:function(e){return(t.isIE7?n.height():document.body.scrollHeight)>(e||c.height())},_setFocus:function(){(t.st.focus?t.content.find(t.st.focus).eq(0):t.wrap).focus()},_onFocusIn:function(i){if(i.target!==t.wrap[0]&&!e.contains(t.wrap[0],i.target))return t._setFocus(),!1},_parseMarkup:function(t,i,n){var o;n.data&&(i=e.extend(n.data,i)),h("MarkupParse",[t,i,n]),e.each(i,function(i,n){if(void 0===n||!1===n)return!0;if(o=i.split("_"),o.length>1){var a=t.find(".mfp-"+o[0]);if(a.length>0){var r=o[1];"replaceWith"===r?a[0]!==n[0]&&a.replaceWith(n):"img"===r?a.is("img")?a.attr("src",n):a.replaceWith(e("<img>").attr("src",n).attr("class",a.attr("class"))):a.attr(o[1],n)}}else t.find(".mfp-"+i).html(n)})},_getScrollbarSize:function(){if(void 0===t.scrollbarSize){var e=document.createElement("div");e.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(e),t.scrollbarSize=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return t.scrollbarSize}},e.magnificPopup={instance:null,proto:s.prototype,modules:[],open:function(t,i){return p(),t=t?e.extend(!0,{},t):{},t.isObj=!0,t.index=i||0,this.instance.open(t)},close:function(){return e.magnificPopup.instance&&e.magnificPopup.instance.close()},registerModule:function(t,i){i.options&&(e.magnificPopup.defaults[t]=i.options),e.extend(this.proto,i.proto),this.modules.push(t)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button title="%title%" type="button" class="mfp-close">&#215;</button>',tClose:"Close (Esc)",tLoading:"Loading...",autoFocusLast:!0}},e.fn.magnificPopup=function(i){p();var n=e(this);if("string"==typeof i)if("open"===i){var o,a=l?n.data("magnificPopup"):n[0].magnificPopup,r=parseInt(arguments[1],10)||0;a.items?o=a.items[r]:(o=n,a.delegate&&(o=o.find(a.delegate)),o=o.eq(r)),t._openClick({mfpEl:o},n,a)}else t.isOpen&&t[i].apply(t,Array.prototype.slice.call(arguments,1));else i=e.extend(!0,{},i),l?n.data("magnificPopup",i):n[0].magnificPopup=i,t.addGroup(n,i);return n};var m,_,v,b=function(){v&&(_.after(v.addClass(m)).detach(),v=null)};e.magnificPopup.registerModule("inline",{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){t.types.push("inline"),d("Close.inline",function(){b()})},getInline:function(i,n){if(b(),i.src){var o=t.st.inline,a=e(i.src);if(a.length){var r=a[0].parentNode;r&&r.tagName&&(_||(m=o.hiddenClass,_=u(m),m="mfp-"+m),v=a.after(_).detach().removeClass(m)),t.updateStatus("ready")}else t.updateStatus("error",o.tNotFound),a=e("<div>");return i.inlineElement=a,a}return t.updateStatus("ready"),t._parseMarkup(n,{},i),n}}});var y,x=function(){y&&e(document.body).removeClass(y)},w=function(){x(),t.req&&t.req.abort()};e.magnificPopup.registerModule("ajax",{options:{settings:null,cursor:"mfp-ajax-cur",tError:'<a href="%url%">The content</a> could not be loaded.'},proto:{initAjax:function(){t.types.push("ajax"),y=t.st.ajax.cursor,d("Close.ajax",w),d("BeforeChange.ajax",w)},getAjax:function(i){y&&e(document.body).addClass(y),t.updateStatus("loading");var n=e.extend({url:i.src,success:function(n,o,a){var r={data:n,xhr:a};h("ParseAjax",r),t.appendContent(e(r.data),"ajax"),i.finished=!0,x(),t._setFocus(),setTimeout(function(){t.wrap.addClass("mfp-ready")},16),t.updateStatus("ready"),h("AjaxContentAdded")},error:function(){x(),i.finished=i.loadError=!0,t.updateStatus("error",t.st.ajax.tError.replace("%url%",i.src))}},t.st.ajax.settings);return t.req=e.ajax(n),""}}});var k,C=function(i){if(i.data&&void 0!==i.data.title)return i.data.title;var n=t.st.image.titleSrc;if(n){if(e.isFunction(n))return n.call(t,i);if(i.el)return i.el.attr(n)||""}return""};e.magnificPopup.registerModule("image",{options:{markup:'<div class="mfp-figure"><div class="mfp-close"></div><figure><div class="mfp-img"></div><figcaption><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></figcaption></figure></div>',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'<a href="%url%">The image</a> could not be loaded.'},proto:{initImage:function(){var i=t.st.image,n=".image";t.types.push("image"),d("Open"+n,function(){"image"===t.currItem.type&&i.cursor&&e(document.body).addClass(i.cursor)}),d("Close"+n,function(){i.cursor&&e(document.body).removeClass(i.cursor),c.off("resize.mfp")}),d("Resize"+n,t.resizeImage),t.isLowIE&&d("AfterChange",t.resizeImage)},resizeImage:function(){var e=t.currItem;if(e&&e.img&&t.st.image.verticalFit){var i=0;t.isLowIE&&(i=parseInt(e.img.css("padding-top"),10)+parseInt(e.img.css("padding-bottom"),10)),e.img.css("max-height",t.wH-i)}},_onImageHasSize:function(e){e.img&&(e.hasSize=!0,k&&clearInterval(k),e.isCheckingImgSize=!1,h("ImageHasSize",e),e.imgHidden&&(t.content&&t.content.removeClass("mfp-loading"),e.imgHidden=!1))},findImageSize:function(e){var i=0,n=e.img[0],o=function(a){k&&clearInterval(k),k=setInterval(function(){if(n.naturalWidth>0)return void t._onImageHasSize(e);i>200&&clearInterval(k),i++,3===i?o(10):40===i?o(50):100===i&&o(500)},a)};o(1)},getImage:function(i,n){var o=0,a=function(){i&&(i.img[0].complete?(i.img.off(".mfploader"),i===t.currItem&&(t._onImageHasSize(i),t.updateStatus("ready")),i.hasSize=!0,i.loaded=!0,h("ImageLoadComplete")):(o++,o<200?setTimeout(a,100):r()))},r=function(){i&&(i.img.off(".mfploader"),i===t.currItem&&(t._onImageHasSize(i),t.updateStatus("error",s.tError.replace("%url%",i.src))),i.hasSize=!0,i.loaded=!0,i.loadError=!0)},s=t.st.image,l=n.find(".mfp-img");if(l.length){var c=document.createElement("img");c.className="mfp-img",i.el&&i.el.find("img").length&&(c.alt=i.el.find("img").attr("alt")),i.img=e(c).on("load.mfploader",a).on("error.mfploader",r),c.src=i.src,l.is("img")&&(i.img=i.img.clone()),c=i.img[0],c.naturalWidth>0?i.hasSize=!0:c.width||(i.hasSize=!1)}return t._parseMarkup(n,{title:C(i),img_replaceWith:i.img},i),t.resizeImage(),i.hasSize?(k&&clearInterval(k),i.loadError?(n.addClass("mfp-loading"),t.updateStatus("error",s.tError.replace("%url%",i.src))):(n.removeClass("mfp-loading"),t.updateStatus("ready")),n):(t.updateStatus("loading"),i.loading=!0,i.hasSize||(i.imgHidden=!0,n.addClass("mfp-loading"),t.findImageSize(i)),n)}}});var j,G=function(){return void 0===j&&(j=void 0!==document.createElement("p").style.MozTransform),j};e.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(e){return e.is("img")?e:e.find("img")}},proto:{initZoom:function(){var e,i=t.st.zoom,n=".zoom";if(i.enabled&&t.supportsTransition){var o,a,r=i.duration,s=function(e){var t=e.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),n="all "+i.duration/1e3+"s "+i.easing,o={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},a="transition";return o["-webkit-"+a]=o["-moz-"+a]=o["-o-"+a]=o[a]=n,t.css(o),t},l=function(){t.content.css("visibility","visible")};d("BuildControls"+n,function(){if(t._allowZoom()){if(clearTimeout(o),t.content.css("visibility","hidden"),!(e=t._getItemToZoom()))return void l();a=s(e),a.css(t._getOffset()),t.wrap.append(a),o=setTimeout(function(){a.css(t._getOffset(!0)),o=setTimeout(function(){l(),setTimeout(function(){a.remove(),e=a=null,h("ZoomAnimationEnded")},16)},r)},16)}}),d("BeforeClose"+n,function(){if(t._allowZoom()){if(clearTimeout(o),t.st.removalDelay=r,!e){if(!(e=t._getItemToZoom()))return;a=s(e)}a.css(t._getOffset(!0)),t.wrap.append(a),t.content.css("visibility","hidden"),setTimeout(function(){a.css(t._getOffset())},16)}}),d("Close"+n,function(){t._allowZoom()&&(l(),a&&a.remove(),e=null)})}},_allowZoom:function(){return"image"===t.currItem.type},_getItemToZoom:function(){return!!t.currItem.hasSize&&t.currItem.img},_getOffset:function(i){var n;n=i?t.currItem.img:t.st.zoom.opener(t.currItem.el||t.currItem);var o=n.offset(),a=parseInt(n.css("padding-top"),10),r=parseInt(n.css("padding-bottom"),10);o.top-=e(window).scrollTop()-a;var s={width:n.width(),height:(l?n.innerHeight():n[0].offsetHeight)-r-a};return G()?s["-moz-transform"]=s.transform="translate("+o.left+"px,"+o.top+"px)":(s.left=o.left,s.top=o.top),s}}});var T=function(e){if(t.currTemplate.iframe){var i=t.currTemplate.iframe.find("iframe");i.length&&(e||(i[0].src="//about:blank"),t.isIE8&&i.css("display",e?"block":"none"))}};e.magnificPopup.registerModule("iframe",{options:{markup:'<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){t.types.push("iframe"),d("BeforeChange",function(e,t,i){t!==i&&("iframe"===t?T():"iframe"===i&&T(!0))}),d("Close.iframe",function(){T()})},getIframe:function(i,n){var o=i.src,a=t.st.iframe;e.each(a.patterns,function(){if(o.indexOf(this.index)>-1)return this.id&&(o="string"==typeof this.id?o.substr(o.lastIndexOf(this.id)+this.id.length,o.length):this.id.call(this,o)),o=this.src.replace("%id%",o),!1});var r={};return a.srcAction&&(r[a.srcAction]=o),t._parseMarkup(n,r,i),t.updateStatus("ready"),n}}});var S=function(e){var i=t.items.length;return e>i-1?e-i:e<0?i+e:e},M=function(e,t,i){return e.replace(/%curr%/gi,t+1).replace(/%total%/gi,i)};e.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var i=t.st.gallery,o=".mfp-gallery";if(t.direction=!0,!i||!i.enabled)return!1;a+=" mfp-gallery",d("Open"+o,function(){i.navigateByImgClick&&t.wrap.on("click"+o,".mfp-img",function(){if(t.items.length>1)return t.next(),!1}),n.on("keydown"+o,function(e){37===e.keyCode?t.prev():39===e.keyCode&&t.next()})}),d("UpdateStatus"+o,function(e,i){i.text&&(i.text=M(i.text,t.currItem.index,t.items.length))}),d("MarkupParse"+o,function(e,n,o,a){var r=t.items.length;o.counter=r>1?M(i.tCounter,a.index,r):""}),d("BuildControls"+o,function(){if(t.items.length>1&&i.arrows&&!t.arrowLeft){var n=i.arrowMarkup,o=t.arrowLeft=e(n.replace(/%title%/gi,i.tPrev).replace(/%dir%/gi,"left")).addClass("mfp-prevent-close"),a=t.arrowRight=e(n.replace(/%title%/gi,i.tNext).replace(/%dir%/gi,"right")).addClass("mfp-prevent-close");o.click(function(){t.prev()}),a.click(function(){t.next()}),t.container.append(o.add(a))}}),d("Change"+o,function(){t._preloadTimeout&&clearTimeout(t._preloadTimeout),t._preloadTimeout=setTimeout(function(){t.preloadNearbyImages(),t._preloadTimeout=null},16)}),d("Close"+o,function(){n.off(o),t.wrap.off("click"+o),t.arrowRight=t.arrowLeft=null})},next:function(){t.direction=!0,t.index=S(t.index+1),t.updateItemHTML()},prev:function(){t.direction=!1,t.index=S(t.index-1),t.updateItemHTML()},goTo:function(e){t.direction=e>=t.index,t.index=e,t.updateItemHTML()},preloadNearbyImages:function(){var e,i=t.st.gallery.preload,n=Math.min(i[0],t.items.length),o=Math.min(i[1],t.items.length);for(e=1;e<=(t.direction?o:n);e++)t._preloadItem(t.index+e);for(e=1;e<=(t.direction?n:o);e++)t._preloadItem(t.index-e)},_preloadItem:function(i){if(i=S(i),!t.items[i].preloaded){var n=t.items[i];n.parsed||(n=t.parseEl(i)),h("LazyLoad",n),"image"===n.type&&(n.img=e('<img class="mfp-img" />').on("load.mfploader",function(){n.hasSize=!0}).on("error.mfploader",function(){n.hasSize=!0,n.loadError=!0,h("LazyLoadError",n)}).attr("src",n.src)),n.preloaded=!0}}}});e.magnificPopup.registerModule("retina",{options:{replaceSrc:function(e){return e.src.replace(/\.\w+$/,function(e){return"@2x"+e})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var e=t.st.retina,i=e.ratio;i=isNaN(i)?i():i,i>1&&(d("ImageHasSize.retina",function(e,t){t.img.css({"max-width":t.img[0].naturalWidth/i,width:"100%"})}),d("ElementParse.retina",function(t,n){n.src=e.replaceSrc(n,i)}))}}}}),p()})},function(e,t){jQuery.fn.giveHintCss=function(e,t){return this.each(function(){var i=jQuery(this);t=jQuery.extend({label:""},t);var n=i.next("span.give-hint-tooltip-js");if(!n.length){var o=t.label.length?t.label:i.data("hint-aria-label");if(!o.length)return;i.after('<span class="give-hint-tooltip-js hint--top hint--medium" aria-label="'+o+'"></span>'),n=i.next(),n.css({top:-i.outerHeight(),left:-i.outerWidth()/2})}"show"===e?n.addClass("hint--always"):"hide"===e&&n.removeClass("hint--always")})},jQuery(document).ready(function(e){function t(t){if(!t.is('[class*="hint"]')){var i=t.attr("class"),n=[],o=t.data("tooltip").split(" ").length;i&&(i=i.split(" "),n=e.grep(i,function(e){return-1!==e.indexOf("give-icon")}),n.length&&(n=n.join(" "),t.removeClass(n),t.append('<i class="'+n+'"></i>'))),t.addClass("hint--top"),15<o?t.addClass("hint--large"):7<o&&t.addClass("hint--medium"),t.attr("aria-label",t.data("tooltip"))}}var i=e("[data-tooltip]");i.length&&i.each(function(i,n){n=n instanceof jQuery?n:e(n),t(n)}),e("body").on("hover","[data-tooltip]",function(){t(e(this))})})},function(e,t,i){"use strict";var n=i(7),o=i(8),a={init:function(){var e=["form"],t=0;for(jQuery(document).trigger("give:preInit");t<e.length;)a[e[t]].init&&a[e[t]].init(),t++;jQuery(document).trigger("give:postInit")},fn:{formatCurrency:function(e,t,i){var n={symbol:"",decimal:this.getGlobalVar("decimal_separator"),thousand:this.getGlobalVar("thousands_separator"),precision:parseInt(this.getGlobalVar("number_decimals")),currency:this.getGlobalVar("currency")};if(e=e.toString().trim(),i=void 0===i?{}:i,i.length&&(n={symbol:"",decimal:a.form.fn.getInfo("decimal_separator",i),thousand:a.form.fn.getInfo("thousands_separator",i),precision:a.form.fn.getInfo("number_decimals",i),currency:a.form.fn.getInfo("currency_code",i)}),t=jQuery.extend(n,t),t.precision=parseInt(t.precision),"INR"===t.currency){var o=accounting.unformat(e,".").toString(),r="",s=void 0,l=void 0,c=o.indexOf(".");for(-1!==c&&(t.precision&&(r=Number(o.substr(parseInt(c))).toFixed(t.precision).toString().substr(1),r=r.length?r:".0000000000".substr(0,parseInt(c)+1),t.precision+1>r.length&&(r=(r+"000000000").substr(0,t.precision+1))),o=o.substr(0,parseInt(c))),s=o.substr(-3),l=o.substr(0,parseInt(o.length)-3);l.length>0;)s=l.substr(-2)+t.thousand+s,l=l.substr(0,parseInt(l.length)-2);r.length&&(s+=r),e=s,void 0!==t.symbol&&t.symbol.length&&("after"===t.position?e+=t.symbol:e=t.symbol+e)}else"after"===t.position&&(t.format="%v%s"),e=accounting.formatMoney(e,t);return e},unFormatCurrency:function(e,t){if("string"==typeof e){var i=","===t.trim()?/[^0-9\,-]+/g:/[^0-9\.-]+/g;e=e.replace(i,""),0===e.indexOf(t)?e=e.substr(1):e.length-1===e.indexOf(t)&&(e=e.slice(0,-1))}return Math.abs(parseFloat(accounting.unformat(e,t)))},getParameterByName:function(e,t){t||(t=window.location.href),e=e.replace(/[\[\]]/g,"\\$&");var i=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)"),n=i.exec(t);return n?n[2]?decodeURIComponent(n[2].replace(/\+/g," ")):"":null},getGlobalVar:function(e){var t=this.getGlobal();return void 0===t[e]?"":t[e]},getGlobal:function(){return"undefined"==typeof give_global_vars?give_vars:give_global_vars},setCache:function(e,t,i){i.length?a.cache["form_"+a.form.fn.getInfo("form-id",i)][e]=t:a.cache[e]=t},getCache:function(e,t){var i=void 0,n=a.cache["form_"+a.form.fn.getInfo("form-id",t)];return i=t.length?void 0!==n?n[e]:"":a.cache[e],i=void 0===i?"":i},__getCookie:function(e){var t="; "+document.cookie,i=t.split("; "+e+"="),n="";return 2===i.length&&(n=i.pop().split(";").shift()),n}},cache:{}};a.notice=n.a,a.form=o.a,t.a=a},function(e,t,i){"use strict";t.a={fn:{renderNotice:function(e,t){var i=void 0;switch(t=void 0!==t?t:{},e){case"bad_minimum":i=jQuery('<div class="give_error give-invalid-minimum give-hidden">'+this.getNotice(e,t)+"</div>");break;case"bad_maximum":i=jQuery('<div class="give_error give-invalid-maximum give-hidden">'+this.getNotice(e,t)+"</div>")}if(!t.length)return"";i.insertBefore(t.find(".give-total-wrap")).show()},getNotice:function(e,t){if(!e.length)return null;var i,n,o;if(i=n=o="",t.length)switch(e){case"bad_minimum":n=Give.fn.getGlobalVar(e),o=Give.form.fn.getMinimumAmount(t);break;case"bad_maximum":n=Give.fn.getGlobalVar(e),o=Give.form.fn.getMaximumAmount(t)}return t.length&&""!==n&&(i=n+" "+Give.fn.formatCurrency(o,{symbol:Give.form.fn.getInfo("currency_symbol",t),position:Give.form.fn.getInfo("currency_position",t)},t)),i}}}},function(e,t,i){"use strict";t.a={init:function(){this.fn.field.formatCreditCard(jQuery("form.give-form")),this.fn.__initialize_cache(),window.onload=function(){Give.form.fn.__sendBackToForm()}},fn:{isFormExist:function(){return!!document.getElementsByName("give-form-hash").length},disable:function(e,t){if(!e.length)return!1;e.find(".give-submit").prop("disabled",t)},formatAmount:function(e,t,i){return t.length?Give.fn.formatCurrency(e,i,t):e},getInfo:function(e,t){var i="";if(t=void 0!==t?t:{},!e.length||!t.length)return i;switch(e){case"gateways":i=[],jQuery.each(t.find('input[name="payment-mode"]'),function(e,t){t=t instanceof jQuery?t:jQuery(t),i.push(t.val().trim())});break;case"form-type":t.hasClass("give-form-type-set")?i="set":t.hasClass("give-form-type-multi")&&(i="multi");break;case"form-id":i=t.find('input[name="give-form-id"]').val();break;default:i=t.get(0).hasAttribute("data-"+e)?t.attr("data-"+e):t.attr(e),void 0!==i&&i.trim()}return i},setInfo:function(e,t,i,n){if(!i.length)return!1;switch(e=void 0===e?"data":e){case"nonce":i.find('input[name="give-form-hash"]').val(t)}if(void 0!==n&&!n.length)return!1;switch(e){case"attr":i.attr(n,t);break;default:i.data(n,t)}return!0},getGateway:function(e){var t="";return e.length?(t=e.find('input[name="payment-mode"]:checked').val().trim(),void 0!==t?t:""):t},getVariablePrices:function(e){var t,i=[];return e.length&&e.hasClass("give-form-type-multi")&&(t=e.find(".give-donation-levels-wrap [data-price-id] "))?(jQuery.each(t,function(t,n){n=n instanceof jQuery?n:jQuery(n);var o=Give.form.fn.getInfo("decimal_separator",e);i.push({price_id:n.data("price-id"),amount:Give.fn.unFormatCurrency(n.val(),o)})}),i):i},getPriceID:function(e,t){var i=this.getVariablePrices(e),n=Give.fn.unFormatCurrency(e.find('input[name="give-amount"]').val(),this.getInfo("decimal_separator",e)),o=Give.fn.getCache("amount_"+n,e)?Give.fn.getCache("amount_"+n,e):-1;return t=void 0===t||t,i.length&&-1===o&&(t?(jQuery.each(i,function(e,t){if(t.amount===n)return o=t.price_id,!1}),-1===o&&this.getMinimumAmount(e)<=n&&this.getMaximumAmount(e)>=n&&this.getMinimumAmount(e)<=n&&(o="custom")):o=jQuery('input[name="give-price-id"]',e).val()),o},getMinimumAmount:function(e){return e.find('input[name="give-form-minimum"]').val()},getMaximumAmount:function(e){return e.find('input[name="give-form-maximum"]').val()},getAmount:function(e){if(!e.length)return null;var t=e.find('input[name="give-amount"]').val();return void 0!==t&&t||(t=0),Give.fn.unFormatCurrency(t,this.getInfo("decimal_separator",e))},getNonce:function(e){if(!e.length)return"";var t=e.find('input[name="give-form-hash"]').val();return void 0!==t&&t||(t=""),t},resetNonce:function(e){if(!e.length||!jQuery('input[name="give-form-hash"]',e).length)return!1;Give.form.fn.disable(e,!0),jQuery.post(Give.fn.getGlobalVar("ajaxurl"),{action:"give_donation_form_nonce",give_form_id:Give.form.fn.getInfo("form-id",e)},function(t){Give.form.fn.setInfo("nonce",t.data,e,""),Give.form.fn.disable(e,!1)})},resetAllNonce:function(e){if(!e.length)return!1;Give.form.fn.disable(e,!0),jQuery.post(Give.fn.getGlobalVar("ajaxurl"),{action:"give_donation_form_reset_all_nonce",give_form_id:Give.form.fn.getInfo("form-id",e)},function(t){if(t.success){var i=e.find('input[name="give-form-user-register-hash"]');Give.form.fn.setInfo("nonce",t.data.give_form_hash,e,""),i.length&&i.val(t.data.give_form_user_register_hash),Give.form.fn.disable(e,!1),jQuery(document).trigger("give_reset_all_nonce",[t.data])}}).done(function(){Give.form.fn.disable(e,!1)})},autoSelectDonationLevel:function(e,t){if(!e.length||"multi"!==this.getInfo("form-type",e))return!1;switch(t=void 0===t?this.getPriceID(e,!1):t,!0){case!!e.find(".give-radio-input").length:e.find(".give-radio-input").prop("checked",!1),e.find('.give-radio-input[data-price-id="'+t+'"]').prop("checked",!0).addClass("give-default-level");break;case!!e.find("button.give-donation-level-btn").length:e.find("button.give-donation-level-btn").blur(),e.find('button.give-donation-level-btn[data-price-id="'+t+'"]').focus().addClass("give-default-level");break;case!!e.find("select.give-select-level").length:e.find("select.give-select-level option").prop("selected",!1),e.find('select.give-select-level option[data-price-id="'+t+'"]').prop("selected",!0).addClass("give-default-level")}},autoSetMultiLevel:function(e){var t=e.parents("form"),i=e.val(),n=e.data("price-id");if(void 0===n&&(n=e.find("option:selected").data("price-id")),"custom"===n)return t.find(".give-amount-top").val("").focus(),!1;t.find(".give-amount-top").val(i),t.find("span.give-amount-top").text(i);var o=Give.form.fn.getInfo("decimal_separator",t);jQuery(".give-donation-amount .give-text-input",t).attr("data-amount",Give.fn.unFormatCurrency(t.find(".give-final-total-amount").attr("data-total"),o)),t.find(".give-donation-amount .give-text-input").trigger("blur",[t,i,n])},__sendBackToForm:function(){var e=Give.fn.getParameterByName("form-id"),t=Give.fn.getParameterByName("payment-mode");if(!e||!t)return!1;var i=jQuery("body").find("#give-form-"+e+"-wrap"),n=i.find("form.give-form"),o=i.hasClass("give-display-modal"),a=i.hasClass("give-display-button"),r=i.hasClass("give-display-reveal");n.find("#give-gateway-radio-list label").removeClass("give-gateway-option-selected"),n.find("input[name=payment-mode][value="+t+"]").prop("checked",!0).parent().addClass("give-gateway-option-selected");var s=Give.fn.getParameterByName("level-id"),l=n.find('*[data-price-id="'+s+'"]');if(l.length>0&&this.autoSetMultiLevel(l),jQuery(".give-form-wrap").hasClass("give-form-grid-wrap")&&1===jQuery("#give-modal-form-"+e).length)return void jQuery.magnificPopup.open({items:{type:"inline",src:"#give-modal-form-"+e},fixedContentPos:!0,fixedBgPos:!0,closeBtnInside:!0,midClick:!0,removalDelay:300,mainClass:"modal-fade-slide"});o||a?give_open_form_modal(i,n):r&&(n.find(".give-btn-reveal").hide(),n.find("#give-payment-mode-select, #give_purchase_form_wrap").slideDown())},isValidDonationAmount:function(e){if(e.find('input[name="give-form-minimum"]').length<=0)return!0;var t=this.getMinimumAmount(e),i=this.getMaximumAmount(e),n=this.getAmount(e),o=this.getPriceID(e,!0);return 0!==n&&(-1<n&&n>=t&&n<=i||-1!==o)},__initialize_cache:function(){jQuery.each(jQuery(".give-form"),function(e,t){t=t instanceof jQuery?t:jQuery(t),Give.cache["form_"+Give.form.fn.getInfo("form-id",t)]=[]})},field:{formatCreditCard:function(e){e.each(function(e,t){t=jQuery(t);var i=t.find(".card-number"),n=t.find(".card-cvc"),o=t.find(".card-expiry");i.length&&(i.payment("formatCardNumber"),n.payment("formatCardCVC"),o.payment("formatCardExpiry"))})}}}}},function(e,t){!function(e){"use strict";function t(e,t){return function(i){i.target&&i.target.matches(e)&&t.apply(this,arguments)}}Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),i=t.length;--i>=0&&t.item(i)!==this;);return i>-1}),e.addDynamicEventListener=function(e,i,n,o,a){e.addEventListener(i,t(n,o),a)}}(window)},function(e,t,i){"use strict";function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"GiveModal",function(){return c}),i.d(t,"GiveErrorAlert",function(){return d}),i.d(t,"GiveWarningAlert",function(){return u}),i.d(t,"GiveNoticeAlert",function(){return h}),i.d(t,"GiveSuccessAlert",function(){return f}),i.d(t,"GiveConfirmModal",function(){return p}),i.d(t,"GiveFormModal",function(){return g});var r=i(4),s=(i.n(r),i(9)),l=(i.n(s),function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}()),c=function(){function e(t){if(a(this,e),e===this.constructor)throw new Error("Abstract classes can't be instantiated.");this.config=Object.assign({type:"",triggerSelector:"",externalPlugin:"magnificPopup",classes:{modalWrapper:""},modalContent:{}},t),this.config.mainClass=((this.config.mainClass?this.config.mainClass:"")+" modal-fade-slide").trim()}return l(e,[{key:"init",value:function(){this.setupTemplate(),this.popupConfig(),this.__setupClickEvent()}},{key:"getTemplate",value:function(){var e='<div class="give-hidden"></div>';return this.config.type.length&&(e='<div class="give-modal give-modal--zoom '+(this.config.classes.modalWrapper?(""+this.config.classes.modalWrapper).trim():"")+'">\n\n\t\t\t\t<div class="give-modal__body">\n\t\t\t\t\t'+(this.config.modalContent.title?'<h2 class="give-modal__title">'+this.config.modalContent.title+"</h2>":"")+"\n\t\t\t\t\t"+(this.config.modalContent.desc?'<p class="give-modal__description">'+this.config.modalContent.desc+"</p>":"")+'\n\t\t\t\t</div>\n\t\n\t\t\t\t<div class="give-modal__controls">\n\n\t\t\t\t\t'+("form"===this.config.type?'<div class="spinner"></div>':"")+"\n\t\t\t\t\t"+("form"===this.config.type?'<a class="give-modal--additional-link" href="'+this.config.modalContent.link+'">'+this.config.modalContent.link_text+"</a>":"")+'\n\n\t\t\t\t\t<button class="give-button give-button--secondary give-popup-close-button">\n\t\t\t\t\t\t'+(this.config.modalContent.cancelBtnTitle?this.config.modalContent.cancelBtnTitle:"confirm"===this.config.type?Give.fn.getGlobalVar("cancel"):Give.fn.getGlobalVar("close"))+"\n\t\t\t\t\t</button>\n\n\t\t\t\t\t"+("confirm"!==this.config.type&&"form"!==this.config.type?"":'<button class="give-button give-button--primary give-popup-'+this.config.type+'-button">\n\n\t\t\t\t\t\t'+(this.config.modalContent.confirmBtnTitle?this.config.modalContent.confirmBtnTitle:Give.fn.getGlobalVar("confirm"))+"\n\t\t\t\t\t</button>")+"\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t</div>"),e}},{key:"setupTemplate",value:function(){this.config.template=this.getTemplate()}},{key:"__setupClickEvent",value:function(){this.config.triggerSelector.length&&jQuery(this.config.triggerSelector).magnificPopup(this.config)}},{key:"popupConfig",value:function(){"magnificPopup"===this.config.externalPlugin&&(this.config.items=this.config.items||{src:this.config.template,type:"inline"},this.config.removalDelay=300,this.config.fixedContentPos=!0,this.config.fixedBgPos=!0,this.config.alignTop=!0,this.config.showCloseBtn=!1,this.config.closeOnBgClick=!1,this.config.enableEscapeKey=!0,this.config.focus=".give-popup-close-button")}},{key:"render",value:function(){switch(this.config.externalPlugin){case"magnificPopup":this.config.triggerSelector||jQuery.magnificPopup.open(this.config)}return this}}],[{key:"__closePopup",value:function(e){e.preventDefault(),jQuery.magnificPopup.instance.close()}}]),e}(),d=function(e){function t(e){a(this,t),e.type="alert";var i=n(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return i.config.classes.modalWrapper="give-modal--error",i.init(),i}return o(t,e),t}(c),u=function(e){function t(e){a(this,t),e.type="alert";var i=n(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return i.config.classes.modalWrapper="give-modal--warning",i.init(),i}return o(t,e),t}(c),h=function(e){function t(e){a(this,t),e.type="alert";var i=n(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return i.config.classes.modalWrapper="give-modal--notice",i.init(),i}return o(t,e),t}(c),f=function(e){function t(e){a(this,t),e.type="alert";var i=n(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return i.config.classes.modalWrapper="give-modal--success",i.init(),i}return o(t,e),t}(c),p=function(e){function t(e){a(this,t),e.type="confirm";var i=n(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return void 0!==e.modalWrapper&&""!==e.modalWrapper&&(i.config.classes.modalWrapper=e.modalWrapper),i.init(),i}return o(t,e),l(t,null,[{key:"__confirmPopup",value:function(){"function"==typeof jQuery.magnificPopup.instance.st.successConfirm&&(jQuery.magnificPopup.instance.st.successConfirm({el:jQuery.magnificPopup.instance.st.el}),jQuery.magnificPopup.close())}}]),t}(c),g=function(e){function t(e){a(this,t),e.type="form";var i=n(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return void 0!==e.modalWrapper&&""!==e.modalWrapper&&(i.config.classes.modalWrapper=e.modalWrapper),i.init(),i}return o(t,e),l(t,null,[{key:"__submitPopup",value:function(){"function"==typeof jQuery.magnificPopup.instance.st.successConfirm&&jQuery.magnificPopup.instance.st.successConfirm({el:jQuery.magnificPopup.instance.st.el})}}]),t}(c);window.addDynamicEventListener(document,"click",".give-popup-close-button",c.__closePopup,{}),window.addDynamicEventListener(document,"click",".give-popup-confirm-button",p.__confirmPopup,{}),window.addDynamicEventListener(document,"click",".give-popup-form-button",g.__submitPopup,{})},,,,,,,,,,,,,,,function(e,t,i){i(26),e.exports=i(27)},function(e,t){},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"init",function(){return v}),i.d(t,"fn",function(){return b}),i.d(t,"cache",function(){return y}),i.d(t,"modal",function(){return x});var n=i(28),o=(i.n(n),i(2)),a=(i.n(o),i(29)),r=(i.n(a),i(30)),s=(i.n(r),i(31)),l=(i.n(s),i(32)),c=(i.n(l),i(33)),d=(i.n(c),i(34)),u=(i.n(d),i(5)),h=(i.n(u),i(6)),f=i(10),p=i(35),g=(i.n(p),i(36)),m=(i.n(g),i(37)),_=(i.n(m),i(38));i.n(_),i(39),i(40);h.a.modal=f;var v=h.a.init,b=h.a.fn,y=h.a.cache,x=h.a.modal},function(e,t){(function(){var e,t,i,n,o=function(e,t){return function(){return e.apply(t,arguments)}},a=function(e,t){function i(){this.constructor=e}for(var n in t)r.call(t,n)&&(e[n]=t[n]);return i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype,e},r={}.hasOwnProperty;n=function(){function e(){this.options_index=0,this.parsed=[]}return e.prototype.add_node=function(e){return"OPTGROUP"===e.nodeName.toUpperCase()?this.add_group(e):this.add_option(e)},e.prototype.add_group=function(e){var t,i,n,o,a,r;for(t=this.parsed.length,this.parsed.push({array_index:t,group:!0,label:e.label,title:e.title?e.title:void 0,children:0,disabled:e.disabled,classes:e.className}),a=e.childNodes,r=[],i=0,n=a.length;i<n;i++)o=a[i],r.push(this.add_option(o,t,e.disabled));return r},e.prototype.add_option=function(e,t,i){if("OPTION"===e.nodeName.toUpperCase())return""!==e.text?(null!=t&&(this.parsed[t].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:e.value,text:e.text,html:e.innerHTML,title:e.title?e.title:void 0,selected:e.selected,disabled:!0===i?i:e.disabled,group_array_index:t,group_label:null!=t?this.parsed[t].label:null,classes:e.className,style:e.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1},e}(),n.select_to_array=function(e){var t,i,o,a,r;for(a=new n,r=e.childNodes,i=0,o=r.length;i<o;i++)t=r[i],a.add_node(t);return a.parsed},t=function(){function e(t,i){this.form_field=t,this.options=null!=i?i:{},this.label_click_handler=o(this.label_click_handler,this),e.browser_is_supported()&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers(),this.on_ready())}return e.prototype.set_default_values=function(){return this.click_test_action=function(e){return function(t){return e.test_active_click(t)}}(this),this.activate_action=function(e){return function(t){return e.activate_field(t)}}(this),this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.is_rtl=this.options.rtl||/\bchosen-rtl\b/.test(this.form_field.className),this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text&&this.options.allow_single_deselect,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null==this.options.enable_split_word_search||this.options.enable_split_word_search,this.group_search=null==this.options.group_search||this.options.group_search,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=null==this.options.single_backstroke_delete||this.options.single_backstroke_delete,this.max_selected_options=this.options.max_selected_options||1/0,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.display_selected_options=null==this.options.display_selected_options||this.options.display_selected_options,this.display_disabled_options=null==this.options.display_disabled_options||this.options.display_disabled_options,this.include_group_label_in_selected=this.options.include_group_label_in_selected||!1,this.max_shown_results=this.options.max_shown_results||Number.POSITIVE_INFINITY,this.case_sensitive_search=this.options.case_sensitive_search||!1,this.hide_results_on_select=null==this.options.hide_results_on_select||this.options.hide_results_on_select},e.prototype.set_default_text=function(){return this.form_field.getAttribute("data-placeholder")?this.default_text=this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||e.default_multiple_text:this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||e.default_single_text,this.default_text=this.escape_html(this.default_text),this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||e.default_no_result_text},e.prototype.choice_label=function(e){return this.include_group_label_in_selected&&null!=e.group_label?"<b class='group-name'>"+this.escape_html(e.group_label)+"</b>"+e.html:e.html},e.prototype.mouse_enter=function(){return this.mouse_on_container=!0},e.prototype.mouse_leave=function(){return this.mouse_on_container=!1},e.prototype.input_focus=function(e){if(this.is_multiple){if(!this.active_field)return setTimeout(function(e){return function(){return e.container_mousedown()}}(this),50)}else if(!this.active_field)return this.activate_field()},e.prototype.input_blur=function(e){if(!this.mouse_on_container)return this.active_field=!1,setTimeout(function(e){return function(){return e.blur_test()}}(this),100)},e.prototype.label_click_handler=function(e){return this.is_multiple?this.container_mousedown(e):this.activate_field()},e.prototype.results_option_build=function(e){var t,i,n,o,a,r,s;for(t="",s=0,r=this.results_data,o=0,a=r.length;o<a&&(i=r[o],n="",n=i.group?this.result_add_group(i):this.result_add_option(i),""!==n&&(s++,t+=n),(null!=e?e.first:void 0)&&(i.selected&&this.is_multiple?this.choice_build(i):i.selected&&!this.is_multiple&&this.single_set_selected_text(this.choice_label(i))),!(s>=this.max_shown_results));o++);return t},e.prototype.result_add_option=function(e){var t,i;return e.search_match&&this.include_option_in_results(e)?(t=[],e.disabled||e.selected&&this.is_multiple||t.push("active-result"),!e.disabled||e.selected&&this.is_multiple||t.push("disabled-result"),e.selected&&t.push("result-selected"),null!=e.group_array_index&&t.push("group-option"),""!==e.classes&&t.push(e.classes),i=document.createElement("li"),i.className=t.join(" "),e.style&&(i.style.cssText=e.style),i.setAttribute("data-option-array-index",e.array_index),i.innerHTML=e.highlighted_html||e.html,e.title&&(i.title=e.title),this.outerHTML(i)):""},e.prototype.result_add_group=function(e){var t,i;return(e.search_match||e.group_match)&&e.active_options>0?(t=[],t.push("group-result"),e.classes&&t.push(e.classes),i=document.createElement("li"),i.className=t.join(" "),i.innerHTML=e.highlighted_html||this.escape_html(e.label),e.title&&(i.title=e.title),this.outerHTML(i)):""},e.prototype.results_update_field=function(){if(this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing)return this.winnow_results()},e.prototype.reset_single_select_options=function(){var e,t,i,n,o;for(i=this.results_data,o=[],e=0,t=i.length;e<t;e++)n=i[e],n.selected?o.push(n.selected=!1):o.push(void 0);return o},e.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},e.prototype.results_search=function(e){return this.results_showing?this.winnow_results():this.results_show()},e.prototype.winnow_results=function(e){var t,i,n,o,a,r,s,l,c,d,u,h,f,p,g;for(this.no_results_clear(),d=0,s=this.get_search_text(),t=s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),c=this.get_search_regex(t),l=this.results_data,n=0,o=l.length;n<o;n++)a=l[n],a.search_match=!1,u=null,h=null,a.highlighted_html="",this.include_option_in_results(a)&&(a.group&&(a.group_match=!1,a.active_options=0),null!=a.group_array_index&&this.results_data[a.group_array_index]&&(u=this.results_data[a.group_array_index],0===u.active_options&&u.search_match&&(d+=1),u.active_options+=1),g=a.group?a.label:a.text,a.group&&!this.group_search||(h=this.search_string_match(g,c),a.search_match=null!=h,a.search_match&&!a.group&&(d+=1),a.search_match?(s.length&&(f=h.index,r=g.slice(0,f),i=g.slice(f,f+s.length),p=g.slice(f+s.length),a.highlighted_html=this.escape_html(r)+"<em>"+this.escape_html(i)+"</em>"+this.escape_html(p)),null!=u&&(u.group_match=!0)):null!=a.group_array_index&&this.results_data[a.group_array_index].search_match&&(a.search_match=!0)));return this.result_clear_highlight(),d<1&&s.length?(this.update_results_content(""),this.no_results(s)):(this.update_results_content(this.results_option_build()),(null!=e?e.skip_highlight:void 0)?void 0:this.winnow_results_set_highlight())},e.prototype.get_search_regex=function(e){var t,i;return i=this.search_contains?e:"(^|\\s|\\b)"+e+"[^\\s]*",this.enable_split_word_search||this.search_contains||(i="^"+i),t=this.case_sensitive_search?"":"i",new RegExp(i,t)},e.prototype.search_string_match=function(e,t){var i;return i=t.exec(e),!this.search_contains&&(null!=i?i[1]:void 0)&&(i.index+=1),i},e.prototype.choices_count=function(){var e,t,i,n;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,n=this.form_field.options,e=0,t=n.length;e<t;e++)i=n[e],i.selected&&(this.selected_option_count+=1);return this.selected_option_count},e.prototype.choices_click=function(e){if(e.preventDefault(),this.activate_field(),!this.results_showing&&!this.is_disabled)return this.results_show()},e.prototype.keydown_checker=function(e){var t,i;switch(i=null!=(t=e.which)?t:e.keyCode,this.search_field_scale(),8!==i&&this.pending_backstroke&&this.clear_backstroke(),i){case 8:this.backstroke_length=this.get_search_field_value().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(e),this.mouse_on_container=!1;break;case 13:case 27:this.results_showing&&e.preventDefault();break;case 32:this.disable_search&&e.preventDefault();break;case 38:e.preventDefault(),this.keyup_arrow();break;case 40:e.preventDefault(),this.keydown_arrow()}},e.prototype.keyup_checker=function(e){var t,i;switch(i=null!=(t=e.which)?t:e.keyCode,this.search_field_scale(),i){case 8:this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0?this.keydown_backstroke():this.pending_backstroke||(this.result_clear_highlight(),this.results_search());break;case 13:e.preventDefault(),this.results_showing&&this.result_select(e);break;case 27:this.results_showing&&this.results_hide();break;case 9:case 16:case 17:case 18:case 38:case 40:case 91:break;default:this.results_search()}},e.prototype.clipboard_event_checker=function(e){if(!this.is_disabled)return setTimeout(function(e){return function(){return e.results_search()}}(this),50)},e.prototype.container_width=function(){return null!=this.options.width?this.options.width:this.form_field.offsetWidth+"px"},e.prototype.include_option_in_results=function(e){return!(this.is_multiple&&!this.display_selected_options&&e.selected)&&(!(!this.display_disabled_options&&e.disabled)&&!e.empty)},e.prototype.search_results_touchstart=function(e){return this.touch_started=!0,this.search_results_mouseover(e)},e.prototype.search_results_touchmove=function(e){return this.touch_started=!1,this.search_results_mouseout(e)},e.prototype.search_results_touchend=function(e){if(this.touch_started)return this.search_results_mouseup(e)},e.prototype.outerHTML=function(e){var t;return e.outerHTML?e.outerHTML:(t=document.createElement("div"),t.appendChild(e),t.innerHTML)},e.prototype.get_single_html=function(){return'<a class="chosen-single chosen-default">\n  <span>'+this.default_text+'</span>\n  <div><b></b></div>\n</a>\n<div class="chosen-drop">\n  <div class="chosen-search">\n    <input class="chosen-search-input" type="text" autocomplete="off" />\n  </div>\n  <ul class="chosen-results"></ul>\n</div>'},e.prototype.get_multi_html=function(){return'<ul class="chosen-choices">\n  <li class="search-field">\n    <input class="chosen-search-input" type="text" autocomplete="off" value="'+this.default_text+'" />\n  </li>\n</ul>\n<div class="chosen-drop">\n  <ul class="chosen-results"></ul>\n</div>'},e.prototype.get_no_results_html=function(e){return'<li class="no-results">\n  '+this.results_none_found+" <span>"+this.escape_html(e)+"</span>\n</li>"},e.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:!(/iP(od|hone)/i.test(window.navigator.userAgent)||/IEMobile/i.test(window.navigator.userAgent)||/Windows Phone/i.test(window.navigator.userAgent)||/BlackBerry/i.test(window.navigator.userAgent)||/BB10/i.test(window.navigator.userAgent)||/Android.*Mobile/i.test(window.navigator.userAgent))},e.default_multiple_text="Select Some Options",e.default_single_text="Select an Option",e.default_no_result_text="No results match",e}(),e=jQuery,e.fn.extend({chosen:function(n){return t.browser_is_supported()?this.each(function(t){var o,a;if(o=e(this),a=o.data("chosen"),"destroy"===n)return void(a instanceof i&&a.destroy());a instanceof i||o.data("chosen",new i(this,n))}):this}}),i=function(t){function i(){return i.__super__.constructor.apply(this,arguments)}return a(i,t),i.prototype.setup=function(){return this.form_field_jq=e(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex},i.prototype.set_up_html=function(){var t,i;return t=["chosen-container"],t.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&t.push(this.form_field.className),this.is_rtl&&t.push("chosen-rtl"),i={class:t.join(" "),title:this.form_field.title},this.form_field.id.length&&(i.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=e("<div />",i),this.container.width(this.container_width()),this.is_multiple?this.container.html(this.get_multi_html()):this.container.html(this.get_single_html()),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior()},i.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this})},i.prototype.register_observers=function(){return this.container.on("touchstart.chosen",function(e){return function(t){e.container_mousedown(t)}}(this)),this.container.on("touchend.chosen",function(e){return function(t){e.container_mouseup(t)}}(this)),this.container.on("mousedown.chosen",function(e){return function(t){e.container_mousedown(t)}}(this)),this.container.on("mouseup.chosen",function(e){return function(t){e.container_mouseup(t)}}(this)),this.container.on("mouseenter.chosen",function(e){return function(t){e.mouse_enter(t)}}(this)),this.container.on("mouseleave.chosen",function(e){return function(t){e.mouse_leave(t)}}(this)),this.search_results.on("mouseup.chosen",function(e){return function(t){e.search_results_mouseup(t)}}(this)),this.search_results.on("mouseover.chosen",function(e){return function(t){e.search_results_mouseover(t)}}(this)),this.search_results.on("mouseout.chosen",function(e){return function(t){e.search_results_mouseout(t)}}(this)),this.search_results.on("mousewheel.chosen DOMMouseScroll.chosen",function(e){return function(t){e.search_results_mousewheel(t)}}(this)),this.search_results.on("touchstart.chosen",function(e){return function(t){e.search_results_touchstart(t)}}(this)),this.search_results.on("touchmove.chosen",function(e){return function(t){e.search_results_touchmove(t)}}(this)),this.search_results.on("touchend.chosen",function(e){return function(t){e.search_results_touchend(t)}}(this)),this.form_field_jq.on("chosen:updated.chosen",function(e){return function(t){e.results_update_field(t)}}(this)),this.form_field_jq.on("chosen:activate.chosen",function(e){return function(t){e.activate_field(t)}}(this)),this.form_field_jq.on("chosen:open.chosen",function(e){return function(t){e.container_mousedown(t)}}(this)),this.form_field_jq.on("chosen:close.chosen",function(e){return function(t){e.close_field(t)}}(this)),this.search_field.on("blur.chosen",function(e){return function(t){e.input_blur(t)}}(this)),this.search_field.on("keyup.chosen",function(e){return function(t){e.keyup_checker(t)}}(this)),this.search_field.on("keydown.chosen",function(e){return function(t){e.keydown_checker(t)}}(this)),this.search_field.on("focus.chosen",function(e){return function(t){e.input_focus(t)}}(this)),this.search_field.on("cut.chosen",function(e){return function(t){e.clipboard_event_checker(t)}}(this)),this.search_field.on("paste.chosen",function(e){return function(t){e.clipboard_event_checker(t)}}(this)),this.is_multiple?this.search_choices.on("click.chosen",function(e){return function(t){e.choices_click(t)}}(this)):this.container.on("click.chosen",function(e){e.preventDefault()})},i.prototype.destroy=function(){return e(this.container[0].ownerDocument).off("click.chosen",this.click_test_action),this.form_field_label.length>0&&this.form_field_label.off("click.chosen"),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},i.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field.disabled||this.form_field_jq.parents("fieldset").is(":disabled"),this.container.toggleClass("chosen-disabled",this.is_disabled),this.search_field[0].disabled=this.is_disabled,this.is_multiple||this.selected_item.off("focus.chosen",this.activate_field),this.is_disabled?this.close_field():this.is_multiple?void 0:this.selected_item.on("focus.chosen",this.activate_field)},i.prototype.container_mousedown=function(t){var i;if(!this.is_disabled)return!t||"mousedown"!==(i=t.type)&&"touchstart"!==i||this.results_showing||t.preventDefault(),null!=t&&e(t.target).hasClass("search-choice-close")?void 0:(this.active_field?this.is_multiple||!t||e(t.target)[0]!==this.selected_item[0]&&!e(t.target).parents("a.chosen-single").length||(t.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),e(this.container[0].ownerDocument).on("click.chosen",this.click_test_action),this.results_show()),this.activate_field())},i.prototype.container_mouseup=function(e){if("ABBR"===e.target.nodeName&&!this.is_disabled)return this.results_reset(e)},i.prototype.search_results_mousewheel=function(e){var t;if(e.originalEvent&&(t=e.originalEvent.deltaY||-e.originalEvent.wheelDelta||e.originalEvent.detail),null!=t)return e.preventDefault(),"DOMMouseScroll"===e.type&&(t*=40),this.search_results.scrollTop(t+this.search_results.scrollTop())},i.prototype.blur_test=function(e){if(!this.active_field&&this.container.hasClass("chosen-container-active"))return this.close_field()},i.prototype.close_field=function(){return e(this.container[0].ownerDocument).off("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale(),this.search_field.blur()},i.prototype.activate_field=function(){if(!this.is_disabled)return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},i.prototype.test_active_click=function(t){var i;return i=e(t.target).closest(".chosen-container"),i.length&&this.container[0]===i[0]?this.active_field=!0:this.close_field()},i.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=n.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},i.prototype.result_do_highlight=function(e){var t,i,n,o,a;if(e.length){if(this.result_clear_highlight(),this.result_highlight=e,this.result_highlight.addClass("highlighted"),n=parseInt(this.search_results.css("maxHeight"),10),a=this.search_results.scrollTop(),o=n+a,i=this.result_highlight.position().top+this.search_results.scrollTop(),(t=i+this.result_highlight.outerHeight())>=o)return this.search_results.scrollTop(t-n>0?t-n:0);if(i<a)return this.search_results.scrollTop(i)}},i.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},i.prototype.results_show=function(){return this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.container.addClass("chosen-with-drop"),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.get_search_field_value()),this.winnow_results(),this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this}))},i.prototype.update_results_content=function(e){return this.search_results.html(e)},i.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClass("chosen-with-drop"),this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},i.prototype.set_tab_index=function(e){var t;if(this.form_field.tabIndex)return t=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=t},i.prototype.set_label_behavior=function(){if(this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=e("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0)return this.form_field_label.on("click.chosen",this.label_click_handler)},i.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},i.prototype.search_results_mouseup=function(t){var i;if(i=e(t.target).hasClass("active-result")?e(t.target):e(t.target).parents(".active-result").first(),i.length)return this.result_highlight=i,this.result_select(t),this.search_field.focus()},i.prototype.search_results_mouseover=function(t){var i;if(i=e(t.target).hasClass("active-result")?e(t.target):e(t.target).parents(".active-result").first())return this.result_do_highlight(i)},i.prototype.search_results_mouseout=function(t){if(e(t.target).hasClass("active-result")||e(t.target).parents(".active-result").first())return this.result_clear_highlight()},i.prototype.choice_build=function(t){var i,n;return i=e("<li />",{class:"search-choice"}).html("<span>"+this.choice_label(t)+"</span>"),t.disabled?i.addClass("search-choice-disabled"):(n=e("<a />",{class:"search-choice-close","data-option-array-index":t.array_index}),n.on("click.chosen",function(e){return function(t){return e.choice_destroy_link_click(t)}}(this)),i.append(n)),this.search_container.before(i)},i.prototype.choice_destroy_link_click=function(t){if(t.preventDefault(),t.stopPropagation(),!this.is_disabled)return this.choice_destroy(e(t.target))},i.prototype.choice_destroy=function(e){if(this.result_deselect(e[0].getAttribute("data-option-array-index")))return this.active_field?this.search_field.focus():this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.get_search_field_value().length<1&&this.results_hide(),e.parents("li").first().remove(),this.search_field_scale()},i.prototype.results_reset=function(){if(this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.trigger_form_field_change(),this.active_field)return this.results_hide()},i.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},i.prototype.result_select=function(e){var t,i;if(this.result_highlight)return t=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?t.removeClass("active-result"):this.reset_single_select_options(),t.addClass("result-selected"),i=this.results_data[t[0].getAttribute("data-option-array-index")],i.selected=!0,this.form_field.options[i.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(i):this.single_set_selected_text(this.choice_label(i)),this.is_multiple&&(!this.hide_results_on_select||e.metaKey||e.ctrlKey)?e.metaKey||e.ctrlKey?this.winnow_results({skip_highlight:!0}):(this.search_field.val(""),this.winnow_results()):(this.results_hide(),this.show_search_field_default()),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.trigger_form_field_change({selected:this.form_field.options[i.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,e.preventDefault(),this.search_field_scale())},i.prototype.single_set_selected_text=function(e){return null==e&&(e=this.default_text),e===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").html(e)},i.prototype.result_deselect=function(e){var t;return t=this.results_data[e],!this.form_field.options[t.options_index].disabled&&(t.selected=!1,this.form_field.options[t.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.trigger_form_field_change({deselected:this.form_field.options[t.options_index].value}),this.search_field_scale(),!0)},i.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect)return this.selected_item.find("abbr").length||this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>'),this.selected_item.addClass("chosen-single-with-deselect")},i.prototype.get_search_field_value=function(){return this.search_field.val()},i.prototype.get_search_text=function(){return e.trim(this.get_search_field_value())},i.prototype.escape_html=function(t){return e("<div/>").text(t).html()},i.prototype.winnow_results_set_highlight=function(){var e,t;if(t=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),null!=(e=t.length?t.first():this.search_results.find(".active-result").first()))return this.result_do_highlight(e)},i.prototype.no_results=function(e){var t;return t=this.get_no_results_html(e),this.search_results.append(t),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},i.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},i.prototype.keydown_arrow=function(){var e;return this.results_showing&&this.result_highlight?(e=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(e):void 0:this.results_show()},i.prototype.keyup_arrow=function(){var e;return this.results_showing||this.is_multiple?this.result_highlight?(e=this.result_highlight.prevAll("li.active-result"),e.length?this.result_do_highlight(e.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},i.prototype.keydown_backstroke=function(){var e;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(e=this.search_container.siblings("li.search-choice").last(),e.length&&!e.hasClass("search-choice-disabled")?(this.pending_backstroke=e,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},i.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},i.prototype.search_field_scale=function(){var t,i,n,o,a,r,s;if(this.is_multiple){for(a={position:"absolute",left:"-1000px",top:"-1000px",display:"none",whiteSpace:"pre"},r=["fontSize","fontStyle","fontWeight","fontFamily","lineHeight","textTransform","letterSpacing"],i=0,n=r.length;i<n;i++)o=r[i],a[o]=this.search_field.css(o);return t=e("<div />").css(a),t.text(this.get_search_field_value()),e("body").append(t),s=t.width()+25,t.remove(),this.container.is(":visible")&&(s=Math.min(this.container.outerWidth()-10,s)),this.search_field.width(s)}},i.prototype.trigger_form_field_change=function(e){return this.form_field_jq.trigger("input",e),this.form_field_jq.trigger("change",e)},i}(t)}).call(this)},function(e,t){!function(e){e.color={},e.color.make=function(t,i,n,o){var a={};return a.r=t||0,a.g=i||0,a.b=n||0,a.a=null!=o?o:1,a.add=function(e,t){for(var i=0;i<e.length;++i)a[e.charAt(i)]+=t;return a.normalize()},a.scale=function(e,t){for(var i=0;i<e.length;++i)a[e.charAt(i)]*=t;return a.normalize()},a.toString=function(){return a.a>=1?"rgb("+[a.r,a.g,a.b].join(",")+")":"rgba("+[a.r,a.g,a.b,a.a].join(",")+")"},a.normalize=function(){function e(e,t,i){return t<e?e:t>i?i:t}return a.r=e(0,parseInt(a.r),255),a.g=e(0,parseInt(a.g),255),a.b=e(0,parseInt(a.b),255),a.a=e(0,a.a,1),a},a.clone=function(){return e.color.make(a.r,a.b,a.g,a.a)},a.normalize()},e.color.extract=function(t,i){var n;do{if(""!=(n=t.css(i).toLowerCase())&&"transparent"!=n)break;t=t.parent()}while(!e.nodeName(t.get(0),"body"));return"rgba(0, 0, 0, 0)"==n&&(n="transparent"),e.color.parse(n)},e.color.parse=function(i){var n,o=e.color.make;if(n=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(i))return o(parseInt(n[1],10),parseInt(n[2],10),parseInt(n[3],10));if(n=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(i))return o(parseInt(n[1],10),parseInt(n[2],10),parseInt(n[3],10),parseFloat(n[4]));if(n=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(i))return o(2.55*parseFloat(n[1]),2.55*parseFloat(n[2]),2.55*parseFloat(n[3]));if(n=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(i))return o(2.55*parseFloat(n[1]),2.55*parseFloat(n[2]),2.55*parseFloat(n[3]),parseFloat(n[4]));if(n=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(i))return o(parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16));if(n=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(i))return o(parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16));var a=e.trim(i).toLowerCase();return"transparent"==a?o(255,255,255,0):(n=t[a]||[0,0,0],o(n[0],n[1],n[2]))};var t={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}}(jQuery),function(e){function t(t,n,o,a){function r(e,t){t=[_e].concat(t);for(var i=0;i<e.length;++i)e[i].apply(this,t)}function s(e){ie=l(e),p(),g()}function l(t){for(var i=[],n=0;n<t.length;++n){var o=e.extend(!0,{},ne.series);null!=t[n].data?(o.data=t[n].data,delete t[n].data,e.extend(!0,o,t[n]),t[n].data=o.data):o.data=t[n],i.push(o)}return i}function c(e,t){var i=e[t+"axis"];return"object"==typeof i&&(i=i.n),"number"!=typeof i&&(i=1),i}function d(){return e.grep(ce.concat(de),function(e){return e})}function u(e){var t,i,n={};for(t=0;t<ce.length;++t)(i=ce[t])&&i.used&&(n["x"+i.n]=i.c2p(e.left));for(t=0;t<de.length;++t)(i=de[t])&&i.used&&(n["y"+i.n]=i.c2p(e.top));return void 0!==n.x1&&(n.x=n.x1),void 0!==n.y1&&(n.y=n.y1),n}function h(e){var t,i,n,o={};for(t=0;t<ce.length;++t)if((i=ce[t])&&i.used&&(n="x"+i.n,null==e[n]&&1==i.n&&(n="x"),null!=e[n])){o.left=i.p2c(e[n]);break}for(t=0;t<de.length;++t)if((i=de[t])&&i.used&&(n="y"+i.n,null==e[n]&&1==i.n&&(n="y"),null!=e[n])){o.top=i.p2c(e[n]);break}return o}function f(t,i){return t[i-1]||(t[i-1]={n:i,direction:t==ce?"x":"y",options:e.extend(!0,{},t==ce?ne.xaxis:ne.yaxis)}),t[i-1]}function p(){var t,i=ie.length,n=-1;for(t=0;t<ie.length;++t){var o=ie[t].color;null!=o&&(i--,"number"==typeof o&&o>n&&(n=o))}i<=n&&(i=n+1);var a,r=[],s=ne.colors,l=s.length,d=0;for(t=0;t<i;t++)a=e.color.parse(s[t%l]||"#666"),t%l==0&&t&&(d=d>=0?d<.5?-d-.2:0:-d),r[t]=a.scale("rgb",1+d);var u,h=0;for(t=0;t<ie.length;++t){if(u=ie[t],null==u.color?(u.color=r[h].toString(),++h):"number"==typeof u.color&&(u.color=r[u.color].toString()),null==u.lines.show){var p,g=!0;for(p in u)if(u[p]&&u[p].show){g=!1;break}g&&(u.lines.show=!0)}null==u.lines.zero&&(u.lines.zero=!!u.lines.fill),u.xaxis=f(ce,c(u,"x")),u.yaxis=f(de,c(u,"y"))}}function g(){function t(e,t,i){t<e.datamin&&t!=-v&&(e.datamin=t),i>e.datamax&&i!=v&&(e.datamax=i)}var i,n,o,a,s,l,c,u,h,f,p,g,m=Number.POSITIVE_INFINITY,_=Number.NEGATIVE_INFINITY,v=Number.MAX_VALUE;for(e.each(d(),function(e,t){t.datamin=m,t.datamax=_,t.used=!1}),i=0;i<ie.length;++i)s=ie[i],s.datapoints={points:[]},r(me.processRawData,[s,s.data,s.datapoints]);for(i=0;i<ie.length;++i){if(s=ie[i],p=s.data,!(g=s.datapoints.format)){if(g=[],g.push({x:!0,number:!0,required:!0}),g.push({y:!0,number:!0,required:!0}),s.bars.show||s.lines.show&&s.lines.fill){var b=!!(s.bars.show&&s.bars.zero||s.lines.show&&s.lines.zero);g.push({y:!0,number:!0,required:!1,defaultValue:0,autoscale:b}),s.bars.horizontal&&(delete g[g.length-1].y,g[g.length-1].x=!0)}s.datapoints.format=g}if(null==s.datapoints.pointsize){s.datapoints.pointsize=g.length,c=s.datapoints.pointsize,l=s.datapoints.points;var y=s.lines.show&&s.lines.steps;for(s.xaxis.used=s.yaxis.used=!0,n=o=0;n<p.length;++n,o+=c){f=p[n];var x=null==f;if(!x)for(a=0;a<c;++a)u=f[a],h=g[a],h&&(h.number&&null!=u&&(u=+u,isNaN(u)?u=null:u==1/0?u=v:u==-1/0&&(u=-v)),null==u&&(h.required&&(x=!0),null!=h.defaultValue&&(u=h.defaultValue))),l[o+a]=u;if(x)for(a=0;a<c;++a)u=l[o+a],null!=u&&(h=g[a],h.x&&t(s.xaxis,u,u),h.y&&t(s.yaxis,u,u)),l[o+a]=null;else if(y&&o>0&&null!=l[o-c]&&l[o-c]!=l[o]&&l[o-c+1]!=l[o+1]){for(a=0;a<c;++a)l[o+c+a]=l[o+a];l[o+1]=l[o-c+1],o+=c}}}}for(i=0;i<ie.length;++i)s=ie[i],r(me.processDatapoints,[s,s.datapoints]);for(i=0;i<ie.length;++i){s=ie[i],l=s.datapoints.points,c=s.datapoints.pointsize,g=s.datapoints.format;var w=m,k=m,C=_,j=_;for(n=0;n<l.length;n+=c)if(null!=l[n])for(a=0;a<c;++a)u=l[n+a],(h=g[a])&&!1!==h.autoscale&&u!=v&&u!=-v&&(h.x&&(u<w&&(w=u),u>C&&(C=u)),h.y&&(u<k&&(k=u),u>j&&(j=u)));if(s.bars.show){var G;switch(s.bars.align){case"left":G=0;break;case"right":G=-s.bars.barWidth;break;case"center":G=-s.bars.barWidth/2;break;default:throw new Error("Invalid bar alignment: "+s.bars.align)}s.bars.horizontal?(k+=G,j+=G+s.bars.barWidth):(w+=G,C+=G+s.bars.barWidth)}t(s.xaxis,w,C),t(s.yaxis,k,j)}e.each(d(),function(e,t){t.datamin==m&&(t.datamin=null),t.datamax==_&&(t.datamax=null)})}function m(e){return(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)}function _(i){var n=document.createElement("canvas");if(n.className=i,e(n).css({direction:"ltr",position:"absolute",left:0,top:0}).appendTo(t),!n.getContext){if(!window.G_vmlCanvasManager)throw new Error("Canvas is not available. If you're using IE with a fall-back such as Excanvas, then there's either a mistake in your conditional include, or the page has no DOCTYPE and is rendering in Quirks Mode.");n=window.G_vmlCanvasManager.initElement(n)}var o=n.getContext("2d"),a=m(o);return n.width=he*a,n.height=fe*a,n.style.width=he+"px",n.style.height=fe+"px",o.save(),o.scale(a,a),n}function v(){if(he=t.width(),fe=t.height(),he<=0||fe<=0)throw new Error("Invalid dimensions for plot, width = "+he+", height = "+fe)}function b(e){var t=e.getContext("2d"),i=m(t);e.style.width!=he&&(e.width=he*i,e.style.width=he+"px"),e.style.height!=fe&&(e.height=fe*i,e.style.height=fe+"px"),t.restore(),t.save(),t.scale(i,i)}function y(){be&&clearTimeout(be),re.unbind("mousemove",L),re.unbind("mouseleave",H),re.unbind("click",R),r(me.shutdown,[re])}function x(e){function t(e){return e}var i,n,o=e.options.transform||t,a=e.options.inverseTransform;"x"==e.direction?(i=e.scale=pe/Math.abs(o(e.max)-o(e.min)),n=Math.min(o(e.max),o(e.min))):(i=e.scale=ge/Math.abs(o(e.max)-o(e.min)),i=-i,n=Math.max(o(e.max),o(e.min))),e.p2c=o==t?function(e){return(e-n)*i}:function(e){return(o(e)-n)*i},e.c2p=a?function(e){return a(n+e/i)}:function(e){return n+e/i}}function w(e){var t=e.options,i=e.ticks||[],n=t.labelWidth||0,o=t.labelHeight||0,a=e.font;se.save(),se.font=a.style+" "+a.variant+" "+a.weight+" "+a.size+"px '"+a.family+"'";for(var r=0;r<i.length;++r){var s=i[r];if(s.lines=[],s.width=s.height=0,s.label){for(var l=(s.label+"").replace(/<br ?\/?>|\r\n|\r/g,"\n").split("\n"),c=0;c<l.length;++c){var d={text:l[c]},u=se.measureText(d.text);d.width=u.width,d.height=null!=u.height?u.height:a.size,d.height+=Math.round(.15*a.size),s.width=Math.max(d.width,s.width),s.height+=d.height,s.lines.push(d)}null==t.labelWidth&&(n=Math.max(n,s.width)),null==t.labelHeight&&(o=Math.max(o,s.height))}}se.restore(),e.labelWidth=Math.ceil(n),e.labelHeight=Math.ceil(o)}function k(t){var i,n=t.labelWidth,o=t.labelHeight,a=t.options.position,r=t.options.tickLength,s=ne.grid.axisMargin,l=ne.grid.labelMargin,c="x"==t.direction?ce:de,d=e.grep(c,function(e){return e&&e.options.position==a&&e.reserveSpace});if(e.inArray(t,d)==d.length-1&&(s=0),null==r){var u=e.grep(c,function(e){return e&&e.reserveSpace});i=0==e.inArray(t,u),r=i?"full":5}isNaN(+r)||(l+=+r),"x"==t.direction?(o+=l,"bottom"==a?(ue.bottom+=o+s,t.box={top:fe-ue.bottom,height:o}):(t.box={top:ue.top+s,height:o},ue.top+=o+s)):(n+=l,"left"==a?(t.box={left:ue.left+s,width:n},ue.left+=n+s):(ue.right+=n+s,t.box={left:he-ue.right,width:n})),t.position=a,t.tickLength=r,t.box.padding=l,t.innermost=i}function C(e){"x"==e.direction?(e.box.left=ue.left-e.labelWidth/2,e.box.width=he-ue.left-ue.right+e.labelWidth):(e.box.top=ue.top-e.labelHeight/2,e.box.height=fe-ue.bottom-ue.top+e.labelHeight)}function j(){var t,i=ne.grid.minBorderMargin,n={x:0,y:0};if(null==i)for(i=0,t=0;t<ie.length;++t)i=Math.max(i,2*(ie[t].points.radius+ie[t].points.lineWidth/2));n.x=n.y=Math.ceil(i),e.each(d(),function(e,t){var i=t.direction;t.reserveSpace&&(n[i]=Math.ceil(Math.max(n[i],("x"==i?t.labelWidth:t.labelHeight)/2)))}),ue.left=Math.max(n.x,ue.left),ue.right=Math.max(n.x,ue.right),ue.top=Math.max(n.y,ue.top),ue.bottom=Math.max(n.y,ue.bottom)}function G(){var i,n=d(),o=ne.grid.show;for(var a in ue){var s=ne.grid.margin||0;ue[a]="number"==typeof s?s:s[a]||0}r(me.processOffset,[ue]);for(var a in ue)"object"==typeof ne.grid.borderWidth?ue[a]+=o?ne.grid.borderWidth[a]:0:ue[a]+=o?ne.grid.borderWidth:0;if(e.each(n,function(e,t){t.show=t.options.show,null==t.show&&(t.show=t.used),t.reserveSpace=t.show||t.options.reserveSpace,T(t)}),o){var l={style:t.css("font-style"),size:Math.round(.8*(+t.css("font-size").replace("px","")||13)),variant:t.css("font-variant"),weight:t.css("font-weight"),family:t.css("font-family")},c=e.grep(n,function(e){return e.reserveSpace});for(e.each(c,function(t,i){S(i),M(i),I(i,i.ticks),i.font=e.extend({},l,i.options.font),w(i)}),i=c.length-1;i>=0;--i)k(c[i]);j(),e.each(c,function(e,t){C(t)})}pe=he-ue.left-ue.right,ge=fe-ue.bottom-ue.top,e.each(n,function(e,t){x(t)}),V()}function T(e){var t=e.options,i=+(null!=t.min?t.min:e.datamin),n=+(null!=t.max?t.max:e.datamax),o=n-i;if(0==o){var a=0==n?1:.01;null==t.min&&(i-=a),null!=t.max&&null==t.min||(n+=a)}else{var r=t.autoscaleMargin;null!=r&&(null==t.min&&(i-=o*r)<0&&null!=e.datamin&&e.datamin>=0&&(i=0),null==t.max&&(n+=o*r)>0&&null!=e.datamax&&e.datamax<=0&&(n=0))}e.min=i,e.max=n}function S(t){var n,o=t.options;if(n="number"==typeof o.ticks&&o.ticks>0?o.ticks:.3*Math.sqrt("x"==t.direction?he:fe),t.delta=(t.max-t.min)/n,"time"==o.mode&&!t.tickGenerator)throw new Error("Time mode requires the flot.time plugin.");if(t.tickGenerator||(t.tickGenerator=function(e){var t=o.tickDecimals,n=-Math.floor(Math.log(e.delta)/Math.LN10);null!=t&&n>t&&(n=t);var a,r,s,l=Math.pow(10,-n),c=e.delta/l,d=[],u=0,h=Number.NaN;c<1.5?a=1:c<3?(a=2,c>2.25&&(null==t||n+1<=t)&&(a=2.5,++n)):a=c<7.5?5:10,a*=l,null!=o.minTickSize&&a<o.minTickSize&&(a=o.minTickSize),e.tickDecimals=Math.max(0,null!=t?t:n),e.tickSize=o.tickSize||a,r=i(e.min,e.tickSize);do{s=h,h=r+u*e.tickSize,d.push(h),++u}while(h<e.max&&h!=s);return d},t.tickFormatter=function(e,t){var i=t.tickDecimals?Math.pow(10,t.tickDecimals):1,n=""+Math.round(e*i)/i;if(null!=t.tickDecimals){var o=n.indexOf("."),a=-1==o?0:n.length-o-1;if(a<t.tickDecimals)return(a?n:n+".")+(""+i).substr(1,t.tickDecimals-a)}return n}),e.isFunction(o.tickFormatter)&&(t.tickFormatter=function(e,t){return""+o.tickFormatter(e,t)}),null!=o.alignTicksWithAxis){var a=("x"==t.direction?ce:de)[o.alignTicksWithAxis-1];if(a&&a.used&&a!=t){var r=t.tickGenerator(t);if(r.length>0&&(null==o.min&&(t.min=Math.min(t.min,r[0])),null==o.max&&r.length>1&&(t.max=Math.max(t.max,r[r.length-1]))),t.tickGenerator=function(e){var t,i,n=[];for(i=0;i<a.ticks.length;++i)t=(a.ticks[i].v-a.min)/(a.max-a.min),t=e.min+t*(e.max-e.min),n.push(t);return n},!t.mode&&null==o.tickDecimals){var s=Math.max(0,1-Math.floor(Math.log(t.delta)/Math.LN10)),l=t.tickGenerator(t);l.length>1&&/\..*0$/.test((l[1]-l[0]).toFixed(s))||(t.tickDecimals=s)}}}}function M(t){var i=t.options.ticks,n=[];null==i||"number"==typeof i&&i>0?n=t.tickGenerator(t):i&&(n=e.isFunction(i)?i(t):i);var o,a;for(t.ticks=[],o=0;o<n.length;++o){var r=null,s=n[o];"object"==typeof s?(a=+s[0],s.length>1&&(r=s[1])):a=+s,null==r&&(r=t.tickFormatter(a,t)),isNaN(a)||t.ticks.push({v:a,label:r})}}function I(e,t){e.options.autoscaleMargin&&t.length>0&&(null==e.options.min&&(e.min=Math.min(e.min,t[0].v)),null==e.options.max&&t.length>1&&(e.max=Math.max(e.max,t[t.length-1].v)))}function P(){se.clearRect(0,0,he,fe),r(me.drawBackground,[se]);var e=ne.grid;e.show&&e.backgroundColor&&A(),e.show&&!e.aboveData&&(O(),Q());for(var t=0;t<ie.length;++t)r(me.drawSeries,[se,ie[t]]),E(ie[t]);r(me.draw,[se]),e.show&&e.aboveData&&(O(),Q())}function z(e,t){for(var i,n,o,a,r=d(),s=0;s<r.length;++s)if(i=r[s],i.direction==t&&(a=t+i.n+"axis",e[a]||1!=i.n||(a=t+"axis"),e[a])){n=e[a].from,o=e[a].to;break}if(e[a]||(i="x"==t?ce[0]:de[0],n=e[t+"1"],o=e[t+"2"]),null!=n&&null!=o&&n>o){var l=n;n=o,o=l}return{from:n,to:o,axis:i}}function A(){se.save(),se.translate(ue.left,ue.top),se.fillStyle=te(ne.grid.backgroundColor,ge,0,"rgba(255, 255, 255, 0)"),se.fillRect(0,0,pe,ge),se.restore()}function O(){var t,i,n,o;se.save(),se.translate(ue.left,ue.top);var a=ne.grid.markings;if(a)for(e.isFunction(a)&&(i=_e.getAxes(),i.xmin=i.xaxis.min,i.xmax=i.xaxis.max,i.ymin=i.yaxis.min,i.ymax=i.yaxis.max,a=a(i)),t=0;t<a.length;++t){var r=a[t],s=z(r,"x"),l=z(r,"y");null==s.from&&(s.from=s.axis.min),null==s.to&&(s.to=s.axis.max),null==l.from&&(l.from=l.axis.min),null==l.to&&(l.to=l.axis.max),s.to<s.axis.min||s.from>s.axis.max||l.to<l.axis.min||l.from>l.axis.max||(s.from=Math.max(s.from,s.axis.min),s.to=Math.min(s.to,s.axis.max),l.from=Math.max(l.from,l.axis.min),l.to=Math.min(l.to,l.axis.max),s.from==s.to&&l.from==l.to||(s.from=s.axis.p2c(s.from),s.to=s.axis.p2c(s.to),l.from=l.axis.p2c(l.from),l.to=l.axis.p2c(l.to),s.from==s.to||l.from==l.to?(se.beginPath(),se.strokeStyle=r.color||ne.grid.markingsColor,se.lineWidth=r.lineWidth||ne.grid.markingsLineWidth,se.moveTo(s.from,l.from),se.lineTo(s.to,l.to),se.stroke()):(se.fillStyle=r.color||ne.grid.markingsColor,se.fillRect(s.from,l.to,s.to-s.from,l.from-l.to))))}i=d(),n=ne.grid.borderWidth;for(var c=0;c<i.length;++c){var u,h,f,p,g=i[c],m=g.box,_=g.tickLength;if(g.show&&0!=g.ticks.length){for(se.strokeStyle=g.options.tickColor||e.color.parse(g.options.color).scale("a",.22).toString(),se.lineWidth=1,"x"==g.direction?(u=0,h="full"==_?"top"==g.position?0:ge:m.top-ue.top+("top"==g.position?m.height:0)):(h=0,u="full"==_?"left"==g.position?0:pe:m.left-ue.left+("left"==g.position?m.width:0)),g.innermost||(se.beginPath(),f=p=0,"x"==g.direction?f=pe:p=ge,1==se.lineWidth&&(u=Math.floor(u)+.5,h=Math.floor(h)+.5),se.moveTo(u,h),se.lineTo(u+f,h+p),se.stroke()),se.beginPath(),t=0;t<g.ticks.length;++t){var v=g.ticks[t].v;f=p=0,isNaN(v)||v<g.min||v>g.max||"full"==_&&("object"==typeof n&&n[g.position]>0||n>0)&&(v==g.min||v==g.max)||("x"==g.direction?(u=g.p2c(v),p="full"==_?-ge:_,"top"==g.position&&(p=-p)):(h=g.p2c(v),f="full"==_?-pe:_,"left"==g.position&&(f=-f)),1==se.lineWidth&&("x"==g.direction?u=Math.floor(u)+.5:h=Math.floor(h)+.5),se.moveTo(u,h),se.lineTo(u+f,h+p))}se.stroke()}}n&&(o=ne.grid.borderColor,"object"==typeof n||"object"==typeof o?("object"!=typeof n&&(n={top:n,right:n,bottom:n,left:n}),"object"!=typeof o&&(o={top:o,right:o,bottom:o,left:o}),n.top>0&&(se.strokeStyle=o.top,se.lineWidth=n.top,se.beginPath(),se.moveTo(0-n.left,0-n.top/2),se.lineTo(pe,0-n.top/2),se.stroke()),n.right>0&&(se.strokeStyle=o.right,se.lineWidth=n.right,se.beginPath(),se.moveTo(pe+n.right/2,0-n.top),se.lineTo(pe+n.right/2,ge),se.stroke()),n.bottom>0&&(se.strokeStyle=o.bottom,se.lineWidth=n.bottom,se.beginPath(),se.moveTo(pe+n.right,ge+n.bottom/2),se.lineTo(0,ge+n.bottom/2),se.stroke()),n.left>0&&(se.strokeStyle=o.left,se.lineWidth=n.left,se.beginPath(),se.moveTo(0-n.left/2,ge+n.bottom),se.lineTo(0-n.left/2,0),se.stroke())):(se.lineWidth=n,se.strokeStyle=ne.grid.borderColor,se.strokeRect(-n/2,-n/2,pe+n,ge+n))),se.restore()}function Q(){se.save(),e.each(d(),function(e,t){if(t.show&&0!=t.ticks.length){var i=t.box,n=t.font;se.fillStyle=t.options.color,se.font=n.style+" "+n.variant+" "+n.weight+" "+n.size+"px "+n.family,se.textAlign="start",se.textBaseline="middle";for(var o=0;o<t.ticks.length;++o){var a=t.ticks[o];if(!(!a.label||a.v<t.min||a.v>t.max))for(var r,s,l,c=0,d=0;d<a.lines.length;++d)l=a.lines[d],"x"==t.direction?(r=ue.left+t.p2c(a.v)-l.width/2,s="bottom"==t.position?i.top+i.padding:i.top+i.height-i.padding-a.height):(s=ue.top+t.p2c(a.v)-a.height/2,r="left"==t.position?i.left+i.width-i.padding-l.width:i.left+i.padding),s+=l.height/2+c,c+=l.height,window.opera&&window.opera.version().split(".")[0]<12&&(r=Math.floor(r),s=Math.ceil(s-2)),se.fillText(l.text,r,s)}}}),se.restore()}function E(e){e.lines.show&&D(e),e.bars.show&&F(e),e.points.show&&W(e)}function D(e){function t(e,t,i,n,o){var a=e.points,r=e.pointsize,s=null,l=null;se.beginPath();for(var c=r;c<a.length;c+=r){var d=a[c-r],u=a[c-r+1],h=a[c],f=a[c+1];if(null!=d&&null!=h){if(u<=f&&u<o.min){if(f<o.min)continue;d=(o.min-u)/(f-u)*(h-d)+d,u=o.min}else if(f<=u&&f<o.min){if(u<o.min)continue;h=(o.min-u)/(f-u)*(h-d)+d,f=o.min}if(u>=f&&u>o.max){if(f>o.max)continue;d=(o.max-u)/(f-u)*(h-d)+d,u=o.max}else if(f>=u&&f>o.max){if(u>o.max)continue;h=(o.max-u)/(f-u)*(h-d)+d,f=o.max}if(d<=h&&d<n.min){if(h<n.min)continue;u=(n.min-d)/(h-d)*(f-u)+u,d=n.min}else if(h<=d&&h<n.min){if(d<n.min)continue;f=(n.min-d)/(h-d)*(f-u)+u,h=n.min}if(d>=h&&d>n.max){if(h>n.max)continue;u=(n.max-d)/(h-d)*(f-u)+u,d=n.max}else if(h>=d&&h>n.max){if(d>n.max)continue;f=(n.max-d)/(h-d)*(f-u)+u,h=n.max}d==s&&u==l||se.moveTo(n.p2c(d)+t,o.p2c(u)+i),s=h,l=f,se.lineTo(n.p2c(h)+t,o.p2c(f)+i)}}se.stroke()}se.save(),se.translate(ue.left,ue.top),se.lineJoin="round";var i=e.lines.lineWidth,n=e.shadowSize;if(i>0&&n>0){se.lineWidth=n,se.strokeStyle="rgba(0,0,0,0.1)";var o=Math.PI/18;t(e.datapoints,Math.sin(o)*(i/2+n/2),Math.cos(o)*(i/2+n/2),e.xaxis,e.yaxis),se.lineWidth=n/2,t(e.datapoints,Math.sin(o)*(i/2+n/4),Math.cos(o)*(i/2+n/4),e.xaxis,e.yaxis)}se.lineWidth=i,se.strokeStyle=e.color;var a=N(e.lines,e.color,0,ge);a&&(se.fillStyle=a,function(e,t,i){for(var n=e.points,o=e.pointsize,a=Math.min(Math.max(0,i.min),i.max),r=0,s=!1,l=1,c=0,d=0;!(o>0&&r>n.length+o);){r+=o;var u=n[r-o],h=n[r-o+l],f=n[r],p=n[r+l];if(s){if(o>0&&null!=u&&null==f){d=r,o=-o,l=2;continue}if(o<0&&r==c+o){se.fill(),s=!1,o=-o,l=1,r=c=d+o;continue}}if(null!=u&&null!=f){if(u<=f&&u<t.min){if(f<t.min)continue;h=(t.min-u)/(f-u)*(p-h)+h,u=t.min}else if(f<=u&&f<t.min){if(u<t.min)continue;p=(t.min-u)/(f-u)*(p-h)+h,f=t.min}if(u>=f&&u>t.max){if(f>t.max)continue;h=(t.max-u)/(f-u)*(p-h)+h,u=t.max}else if(f>=u&&f>t.max){if(u>t.max)continue;p=(t.max-u)/(f-u)*(p-h)+h,f=t.max}if(s||(se.beginPath(),se.moveTo(t.p2c(u),i.p2c(a)),s=!0),h>=i.max&&p>=i.max)se.lineTo(t.p2c(u),i.p2c(i.max)),se.lineTo(t.p2c(f),i.p2c(i.max));else if(h<=i.min&&p<=i.min)se.lineTo(t.p2c(u),i.p2c(i.min)),se.lineTo(t.p2c(f),i.p2c(i.min));else{var g=u,m=f;h<=p&&h<i.min&&p>=i.min?(u=(i.min-h)/(p-h)*(f-u)+u,h=i.min):p<=h&&p<i.min&&h>=i.min&&(f=(i.min-h)/(p-h)*(f-u)+u,p=i.min),h>=p&&h>i.max&&p<=i.max?(u=(i.max-h)/(p-h)*(f-u)+u,h=i.max):p>=h&&p>i.max&&h<=i.max&&(f=(i.max-h)/(p-h)*(f-u)+u,p=i.max),u!=g&&se.lineTo(t.p2c(g),i.p2c(h)),se.lineTo(t.p2c(u),i.p2c(h)),se.lineTo(t.p2c(f),i.p2c(p)),f!=m&&(se.lineTo(t.p2c(f),i.p2c(p)),se.lineTo(t.p2c(m),i.p2c(p)))}}}}(e.datapoints,e.xaxis,e.yaxis)),i>0&&t(e.datapoints,0,0,e.xaxis,e.yaxis),se.restore()}function W(e){function t(e,t,i,n,o,a,r,s){for(var l=e.points,c=e.pointsize,d=0;d<l.length;d+=c){var u=l[d],h=l[d+1];null==u||u<a.min||u>a.max||h<r.min||h>r.max||(se.beginPath(),u=a.p2c(u),h=r.p2c(h)+n,"circle"==s?se.arc(u,h,t,0,o?Math.PI:2*Math.PI,!1):s(se,u,h,t,o),se.closePath(),i&&(se.fillStyle=i,se.fill()),se.stroke())}}se.save(),se.translate(ue.left,ue.top);var i=e.points.lineWidth,n=e.shadowSize,o=e.points.radius,a=e.points.symbol;if(0==i&&(i=1e-4),i>0&&n>0){var r=n/2;se.lineWidth=r,se.strokeStyle="rgba(0,0,0,0.1)",t(e.datapoints,o,null,r+r/2,!0,e.xaxis,e.yaxis,a),se.strokeStyle="rgba(0,0,0,0.2)",t(e.datapoints,o,null,r/2,!0,e.xaxis,e.yaxis,a)}se.lineWidth=i,se.strokeStyle=e.color,t(e.datapoints,o,N(e.points,e.color),0,!1,e.xaxis,e.yaxis,a),se.restore()}function q(e,t,i,n,o,a,r,s,l,c,d,u){var h,f,p,g,m,_,v,b,y;d?(b=_=v=!0,m=!1,h=i,f=e,g=t+n,p=t+o,f<h&&(y=f,f=h,h=y,m=!0,_=!1)):(m=_=v=!0,b=!1,h=e+n,f=e+o,p=i,(g=t)<p&&(y=g,g=p,p=y,b=!0,v=!1)),f<s.min||h>s.max||g<l.min||p>l.max||(h<s.min&&(h=s.min,m=!1),f>s.max&&(f=s.max,_=!1),p<l.min&&(p=l.min,b=!1),g>l.max&&(g=l.max,v=!1),h=s.p2c(h),p=l.p2c(p),f=s.p2c(f),g=l.p2c(g),r&&(c.beginPath(),c.moveTo(h,p),c.lineTo(h,g),c.lineTo(f,g),c.lineTo(f,p),c.fillStyle=r(p,g),c.fill()),u>0&&(m||_||v||b)&&(c.beginPath(),c.moveTo(h,p+a),m?c.lineTo(h,g+a):c.moveTo(h,g+a),v?c.lineTo(f,g+a):c.moveTo(f,g+a),_?c.lineTo(f,p+a):c.moveTo(f,p+a),b?c.lineTo(h,p+a):c.moveTo(h,p+a),c.stroke()))}function F(e){se.save(),se.translate(ue.left,ue.top),se.lineWidth=e.bars.lineWidth,se.strokeStyle=e.color;var t;switch(e.bars.align){case"left":t=0;break;case"right":t=-e.bars.barWidth;break;case"center":t=-e.bars.barWidth/2;break;default:throw new Error("Invalid bar alignment: "+e.bars.align)}var i=e.bars.fill?function(t,i){return N(e.bars,e.color,t,i)}:null;!function(t,i,n,o,a,r,s){for(var l=t.points,c=t.pointsize,d=0;d<l.length;d+=c)null!=l[d]&&q(l[d],l[d+1],l[d+2],i,n,o,a,r,s,se,e.bars.horizontal,e.bars.lineWidth)}(e.datapoints,t,t+e.bars.barWidth,0,i,e.xaxis,e.yaxis),se.restore()}function N(t,i,n,o){var a=t.fill;if(!a)return null;if(t.fillColor)return te(t.fillColor,n,o,i);var r=e.color.parse(i);return r.a="number"==typeof a?a:.4,r.normalize(),r.toString()}function V(){if(t.find(".legend").remove(),ne.legend.show){for(var i,n,o=[],a=[],r=!1,s=ne.legend.labelFormatter,l=0;l<ie.length;++l)i=ie[l],i.label&&(n=s?s(i.label,i):i.label)&&a.push({label:n,color:i.color});if(ne.legend.sorted)if(e.isFunction(ne.legend.sorted))a.sort(ne.legend.sorted);else if("reverse"==ne.legend.sorted)a.reverse();else{var c="descending"!=ne.legend.sorted;a.sort(function(e,t){return e.label==t.label?0:e.label<t.label!=c?1:-1})}for(var l=0;l<a.length;++l){var d=a[l];l%ne.legend.noColumns==0&&(r&&o.push("</tr>"),o.push("<tr>"),r=!0),o.push('<td class="legendColorBox"><div style="border:1px solid '+ne.legend.labelBoxBorderColor+';padding:1px"><div style="width:4px;height:0;border:5px solid '+d.color+';overflow:hidden"></div></div></td><td class="legendLabel">'+d.label+"</td>")}if(r&&o.push("</tr>"),0!=o.length){var u='<table style="font-size:smaller;color:'+ne.grid.color+'">'+o.join("")+"</table>";if(null!=ne.legend.container)e(ne.legend.container).html(u);else{var h="",f=ne.legend.position,p=ne.legend.margin;null==p[0]&&(p=[p,p]),"n"==f.charAt(0)?h+="top:"+(p[1]+ue.top)+"px;":"s"==f.charAt(0)&&(h+="bottom:"+(p[1]+ue.bottom)+"px;"),"e"==f.charAt(1)?h+="right:"+(p[0]+ue.right)+"px;":"w"==f.charAt(1)&&(h+="left:"+(p[0]+ue.left)+"px;");var g=e('<div class="legend">'+u.replace('style="','style="position:absolute;'+h+";")+"</div>").appendTo(t);if(0!=ne.legend.backgroundOpacity){var m=ne.legend.backgroundColor;null==m&&(m=ne.grid.backgroundColor,m=m&&"string"==typeof m?e.color.parse(m):e.color.extract(g,"background-color"),m.a=1,m=m.toString());var _=g.children();e('<div style="position:absolute;width:'+_.width()+"px;height:"+_.height()+"px;"+h+"background-color:"+m+';"> </div>').prependTo(g).css("opacity",ne.legend.backgroundOpacity)}}}}}function B(e,t,i){var n,o,a,r=ne.grid.mouseActiveRadius,s=r*r+1,l=null;for(n=ie.length-1;n>=0;--n)if(i(ie[n])){var c=ie[n],d=c.xaxis,u=c.yaxis,h=c.datapoints.points,f=d.c2p(e),p=u.c2p(t),g=r/d.scale,m=r/u.scale;if(a=c.datapoints.pointsize,d.options.inverseTransform&&(g=Number.MAX_VALUE),u.options.inverseTransform&&(m=Number.MAX_VALUE),c.lines.show||c.points.show)for(o=0;o<h.length;o+=a){var _=h[o],v=h[o+1];if(null!=_&&!(_-f>g||_-f<-g||v-p>m||v-p<-m)){var b=Math.abs(d.p2c(_)-e),y=Math.abs(u.p2c(v)-t),x=b*b+y*y;x<s&&(s=x,l=[n,o/a])}}if(c.bars.show&&!l){var w="left"==c.bars.align?0:-c.bars.barWidth/2,k=w+c.bars.barWidth;for(o=0;o<h.length;o+=a){var _=h[o],v=h[o+1],C=h[o+2];null!=_&&((ie[n].bars.horizontal?f<=Math.max(C,_)&&f>=Math.min(C,_)&&p>=v+w&&p<=v+k:f>=_+w&&f<=_+k&&p>=Math.min(C,v)&&p<=Math.max(C,v))&&(l=[n,o/a]))}}}return l?(n=l[0],o=l[1],a=ie[n].datapoints.pointsize,{datapoint:ie[n].datapoints.points.slice(o*a,(o+1)*a),dataIndex:o,series:ie[n],seriesIndex:n}):null}function L(e){ne.grid.hoverable&&U("plothover",e,function(e){return 0!=e.hoverable})}function H(e){ne.grid.hoverable&&U("plothover",e,function(e){return!1})}function R(e){U("plotclick",e,function(e){return 0!=e.clickable})}function U(e,i,n){var o=re.offset(),a=i.pageX-o.left-ue.left,r=i.pageY-o.top-ue.top,s=u({left:a,top:r});s.pageX=i.pageX,s.pageY=i.pageY;var l=B(a,r,n);if(l&&(l.pageX=parseInt(l.series.xaxis.p2c(l.datapoint[0])+o.left+ue.left,10),l.pageY=parseInt(l.series.yaxis.p2c(l.datapoint[1])+o.top+ue.top,10)),ne.grid.autoHighlight){for(var c=0;c<ve.length;++c){var d=ve[c];d.auto!=e||l&&d.series==l.series&&d.point[0]==l.datapoint[0]&&d.point[1]==l.datapoint[1]||$(d.series,d.point)}l&&X(l.series,l.datapoint,e)}t.trigger(e,[s,l])}function Y(){var e=ne.interaction.redrawOverlayInterval;if(-1==e)return void K();be||(be=setTimeout(K,e))}function K(){be=null,le.save(),le.clearRect(0,0,he,fe),le.translate(ue.left,ue.top);var e,t;for(e=0;e<ve.length;++e)t=ve[e],t.series.bars.show?ee(t.series,t.point):J(t.series,t.point);le.restore(),r(me.drawOverlay,[le])}function X(e,t,i){if("number"==typeof e&&(e=ie[e]),"number"==typeof t){var n=e.datapoints.pointsize;t=e.datapoints.points.slice(n*t,n*(t+1))}var o=Z(e,t);-1==o?(ve.push({series:e,point:t,auto:i}),Y()):i||(ve[o].auto=!1)}function $(e,t){null==e&&null==t&&(ve=[],Y()),"number"==typeof e&&(e=ie[e]),"number"==typeof t&&(t=e.data[t]);var i=Z(e,t);-1!=i&&(ve.splice(i,1),Y())}function Z(e,t){for(var i=0;i<ve.length;++i){var n=ve[i];if(n.series==e&&n.point[0]==t[0]&&n.point[1]==t[1])return i}return-1}function J(t,i){var n=i[0],o=i[1],a=t.xaxis,r=t.yaxis,s="string"==typeof t.highlightColor?t.highlightColor:e.color.parse(t.color).scale("a",.5).toString();if(!(n<a.min||n>a.max||o<r.min||o>r.max)){var l=t.points.radius+t.points.lineWidth/2;le.lineWidth=l,le.strokeStyle=s;var c=1.5*l;n=a.p2c(n),o=r.p2c(o),le.beginPath(),"circle"==t.points.symbol?le.arc(n,o,c,0,2*Math.PI,!1):t.points.symbol(le,n,o,c,!1),le.closePath(),le.stroke()}}function ee(t,i){var n="string"==typeof t.highlightColor?t.highlightColor:e.color.parse(t.color).scale("a",.5).toString(),o=n,a="left"==t.bars.align?0:-t.bars.barWidth/2;le.lineWidth=t.bars.lineWidth,le.strokeStyle=n,q(i[0],i[1],i[2]||0,a,a+t.bars.barWidth,0,function(){return o},t.xaxis,t.yaxis,le,t.bars.horizontal,t.bars.lineWidth)}function te(t,i,n,o){if("string"==typeof t)return t;for(var a=se.createLinearGradient(0,n,0,i),r=0,s=t.colors.length;r<s;++r){var l=t.colors[r];if("string"!=typeof l){var c=e.color.parse(o);null!=l.brightness&&(c=c.scale("rgb",l.brightness)),null!=l.opacity&&(c.a*=l.opacity),l=c.toString()}a.addColorStop(r/(s-1),l)}return a}var ie=[],ne={colors:["#edc240","#afd8f8","#cb4b4b","#4da74d","#9440ed"],legend:{show:!0,noColumns:1,labelFormatter:null,labelBoxBorderColor:"#ccc",container:null,position:"ne",margin:5,backgroundColor:null,backgroundOpacity:.85,sorted:null},xaxis:{show:null,position:"bottom",mode:null,timezone:null,font:null,color:null,tickColor:null,transform:null,inverseTransform:null,min:null,max:null,autoscaleMargin:null,ticks:null,tickFormatter:null,labelWidth:null,labelHeight:null,reserveSpace:null,tickLength:null,alignTicksWithAxis:null,tickDecimals:null,tickSize:null,minTickSize:null,monthNames:null,timeformat:null,twelveHourClock:!1},yaxis:{autoscaleMargin:.02,position:"left"},xaxes:[],yaxes:[],series:{points:{show:!1,radius:3,lineWidth:2,fill:!0,fillColor:"#ffffff",symbol:"circle"},lines:{lineWidth:2,fill:!1,fillColor:null,steps:!1},bars:{show:!1,lineWidth:2,barWidth:1,fill:!0,fillColor:null,align:"left",horizontal:!1,zero:!0},shadowSize:3,highlightColor:null},grid:{show:!0,aboveData:!1,color:"#545454",backgroundColor:null,borderColor:null,tickColor:null,margin:0,labelMargin:5,axisMargin:8,borderWidth:2,minBorderMargin:null,markings:null,markingsColor:"#f4f4f4",markingsLineWidth:2,clickable:!1,hoverable:!1,autoHighlight:!0,mouseActiveRadius:10},interaction:{redrawOverlayInterval:1e3/60},hooks:{}},oe=null,ae=null,re=null,se=null,le=null,ce=[],de=[],ue={left:0,right:0,top:0,bottom:0},he=0,fe=0,pe=0,ge=0,me={processOptions:[],processRawData:[],processDatapoints:[],processOffset:[],drawBackground:[],drawSeries:[],draw:[],bindEvents:[],drawOverlay:[],shutdown:[]},_e=this;_e.setData=s,_e.setupGrid=G,_e.draw=P,_e.getPlaceholder=function(){return t},_e.getCanvas=function(){return oe},_e.getPlotOffset=function(){return ue},_e.width=function(){return pe},_e.height=function(){return ge},_e.offset=function(){var e=re.offset();return e.left+=ue.left,e.top+=ue.top,e},_e.getData=function(){return ie},_e.getAxes=function(){var t={};return e.each(ce.concat(de),function(e,i){i&&(t[i.direction+(1!=i.n?i.n:"")+"axis"]=i)}),t},_e.getXAxes=function(){return ce},_e.getYAxes=function(){return de},_e.c2p=u,_e.p2c=h,_e.getOptions=function(){return ne},_e.highlight=X,_e.unhighlight=$,_e.triggerRedrawOverlay=Y,_e.pointOffset=function(e){return{left:parseInt(ce[c(e,"x")-1].p2c(+e.x)+ue.left,10),top:parseInt(de[c(e,"y")-1].p2c(+e.y)+ue.top,10)}},_e.shutdown=y,_e.resize=function(){v(),b(oe),b(ae)},_e.hooks=me,function(){for(var t=0;t<a.length;++t){var i=a[t];i.init(_e),i.options&&e.extend(!0,ne,i.options)}}(),function(t){var i;for(e.extend(!0,ne,t),null==ne.xaxis.color&&(ne.xaxis.color=ne.grid.color),null==ne.yaxis.color&&(ne.yaxis.color=ne.grid.color),null==ne.xaxis.tickColor&&(ne.xaxis.tickColor=ne.grid.tickColor),null==ne.yaxis.tickColor&&(ne.yaxis.tickColor=ne.grid.tickColor),null==ne.grid.borderColor&&(ne.grid.borderColor=ne.grid.color),null==ne.grid.tickColor&&(ne.grid.tickColor=e.color.parse(ne.grid.color).scale("a",.22).toString()),i=0;i<Math.max(1,ne.xaxes.length);++i)ne.xaxes[i]=e.extend(!0,{},ne.xaxis,ne.xaxes[i]);for(i=0;i<Math.max(1,ne.yaxes.length);++i)ne.yaxes[i]=e.extend(!0,{},ne.yaxis,ne.yaxes[i]);for(ne.xaxis.noTicks&&null==ne.xaxis.ticks&&(ne.xaxis.ticks=ne.xaxis.noTicks),ne.yaxis.noTicks&&null==ne.yaxis.ticks&&(ne.yaxis.ticks=ne.yaxis.noTicks),ne.x2axis&&(ne.xaxes[1]=e.extend(!0,{},ne.xaxis,ne.x2axis),ne.xaxes[1].position="top"),ne.y2axis&&(ne.yaxes[1]=e.extend(!0,{},ne.yaxis,ne.y2axis),ne.yaxes[1].position="right"),ne.grid.coloredAreas&&(ne.grid.markings=ne.grid.coloredAreas),ne.grid.coloredAreasColor&&(ne.grid.markingsColor=ne.grid.coloredAreasColor),ne.lines&&e.extend(!0,ne.series.lines,ne.lines),ne.points&&e.extend(!0,ne.series.points,ne.points),ne.bars&&e.extend(!0,ne.series.bars,ne.bars),null!=ne.shadowSize&&(ne.series.shadowSize=ne.shadowSize),null!=ne.highlightColor&&(ne.series.highlightColor=ne.highlightColor),i=0;i<ne.xaxes.length;++i)f(ce,i+1).options=ne.xaxes[i];for(i=0;i<ne.yaxes.length;++i)f(de,i+1).options=ne.yaxes[i];for(var n in me)ne.hooks[n]&&ne.hooks[n].length&&(me[n]=me[n].concat(ne.hooks[n]));r(me.processOptions,[ne])}(o),function(){var i,n=t.children("canvas.flot-base"),o=t.children("canvas.flot-overlay");0==n.length||0==o?(t.html(""),t.css({padding:0}),"static"==t.css("position")&&t.css("position","relative"),v(),oe=_("flot-base"),ae=_("flot-overlay"),i=!1):(oe=n.get(0),ae=o.get(0),i=!0),se=oe.getContext("2d"),le=ae.getContext("2d"),re=e(ae),i&&(t.data("plot").shutdown(),_e.resize(),le.clearRect(0,0,he,fe),re.unbind(),t.children().not([oe,ae]).remove()),t.data("plot",_e)}(),s(n),G(),P(),function(){ne.grid.hoverable&&(re.mousemove(L),re.bind("mouseleave",H)),ne.grid.clickable&&re.click(R),r(me.bindEvents,[re])}();var ve=[],be=null}function i(e,t){return t*Math.floor(e/t)}e.plot=function(i,n,o){return new t(e(i),n,o,e.plot.plugins)},e.plot.version="0.8-alpha",e.plot.plugins=[],e.fn.plot=function(t,i){return this.each(function(){e.plot(this,t,i)})}}(jQuery)},function(e,t){!function(e){function t(e){function t(e,t,o){var r=null;if(i(t)&&(c(t),n(e),a(e),l(t),m>=2)){var s=d(t),_=0,b=u();void 0===x[t.bars.order]&&(h(s)?x[t.bars.order]=-1*f(g,s-1,Math.floor(m/2)-1)-b:x[t.bars.order]=f(g,Math.ceil(m/2),s-2)+b+2*v),_=x[t.bars.order],r=p(o,t,_),o.points=r}return r}function i(e){return null!=e.bars&&e.bars.show&&null!=e.bars.order}function n(e){var t=y?e.getPlaceholder().innerHeight():e.getPlaceholder().innerWidth(),i=y?o(e.getData(),1):o(e.getData(),0),n=i[1]-i[0];b=n/t}function o(e,t){for(var i=new Array,n=0;n<e.length;n++)i[0]=e[n].data[0]?e[n].data[0][t]:null,i[1]=e[n].data[e[n].data.length-1]?e[n].data[e[n].data.length-1][t]:null;return i}function a(e){g=r(e.getData()),m=g.length}function r(e){for(var t=new Array,i=[],n=0;n<e.length;n++)null!=e[n].bars.order&&e[n].bars.show&&i.indexOf(e[n].bars.order)<0&&(i.push(e[n].bars.order),t.push(e[n]));return t.sort(s)}function s(e,t){var i=e.bars.order,n=t.bars.order;return i<n?-1:i>n?1:0}function l(e){_=void 0!==e.bars.lineWidth?e.bars.lineWidth:2,v=_*b}function c(e){e.bars.horizontal&&(y=!0)}function d(e){for(var t=0,i=0;i<g.length;++i)if(e==g[i]){t=i;break}return t+1}function u(){var e=0;return m%2!=0&&(e=g[Math.ceil(m/2)].bars.barWidth/2),e}function h(e){return e<=Math.ceil(m/2)}function f(e,t,i){for(var n=0,o=t;o<=i;o++)n+=e[o].bars.barWidth+2*v;return n}function p(e,t,i){for(var n=e.pointsize,o=e.points,a=0,r=y?1:0;r<o.length;r+=n)o[r]+=i,t.data[a][3]=o[r],a++;return o}var g,m,_,v,b=1,y=!1,x={};e.hooks.processDatapoints.push(t)}var i={series:{bars:{order:null}}};e.plot.plugins.push({init:t,options:i,name:"orderBars",version:"0.2"})}(jQuery)},function(e,t){!function(e){function t(e,t){return t*Math.floor(e/t)}function i(e,t,i,n){if("function"==typeof e.strftime)return e.strftime(t);var o=function(e,t){return e=""+e,t=""+(null==t?"0":t),1==e.length?t+e:e},a=[],r=!1,s=e.getHours(),l=s<12;null==i&&(i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),null==n&&(n=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]);var c;c=s>12?s-12:0==s?12:s;for(var d=0;d<t.length;++d){var u=t.charAt(d);if(r){switch(u){case"a":u=""+n[e.getDay()];break;case"b":u=""+i[e.getMonth()];break;case"d":u=o(e.getDate());break;case"e":u=o(e.getDate()," ");break;case"H":u=o(s);break;case"I":u=o(c);break;case"l":u=o(c," ");break;case"m":u=o(e.getMonth()+1);break;case"M":u=o(e.getMinutes());break;case"q":u=""+(Math.floor(e.getMonth()/3)+1);break;case"S":u=o(e.getSeconds());break;case"y":u=o(e.getFullYear()%100);break;case"Y":u=""+e.getFullYear();break;case"p":u=l?"am":"pm";break;case"P":u=l?"AM":"PM";break;case"w":u=""+e.getDay()}a.push(u),r=!1}else"%"==u?r=!0:a.push(u)}return a.join("")}function n(e){function t(e,t,i,n){e[t]=function(){return i[n].apply(i,arguments)}}var i={date:e};void 0!=e.strftime&&t(i,"strftime",e,"strftime"),t(i,"getTime",e,"getTime"),t(i,"setTime",e,"setTime");for(var n=["Date","Day","FullYear","Hours","Milliseconds","Minutes","Month","Seconds"],o=0;o<n.length;o++)t(i,"get"+n[o],e,"getUTC"+n[o]),t(i,"set"+n[o],e,"setUTC"+n[o]);return i}function o(e,t){if("browser"==t.timezone)return new Date(e);if(t.timezone&&"utc"!=t.timezone){if("undefined"!=typeof timezoneJS&&void 0!==timezoneJS.Date){var i=new timezoneJS.Date;return i.setTimezone(t.timezone),i.setTime(e),i}return n(new Date(e))}return n(new Date(e))}function a(n){n.hooks.processDatapoints.push(function(n,a,r){e.each(n.getAxes(),function(e,n){var a=n.options;"time"==a.mode&&(n.tickGenerator=function(e){var i=[],n=o(e.min,a),r=0,l=a.tickSize&&"quarter"===a.tickSize[1]||a.minTickSize&&"quarter"===a.minTickSize[1]?d:c;null!=a.minTickSize&&(r="number"==typeof a.tickSize?a.tickSize:a.minTickSize[0]*s[a.minTickSize[1]]);for(var u=0;u<l.length-1&&!(e.delta<(l[u][0]*s[l[u][1]]+l[u+1][0]*s[l[u+1][1]])/2&&l[u][0]*s[l[u][1]]>=r);++u);var h=l[u][0],f=l[u][1];if("year"==f){if(null!=a.minTickSize&&"year"==a.minTickSize[1])h=Math.floor(a.minTickSize[0]);else{var p=Math.pow(10,Math.floor(Math.log(e.delta/s.year)/Math.LN10)),g=e.delta/s.year/p;h=g<1.5?1:g<3?2:g<7.5?5:10,h*=p}h<1&&(h=1)}e.tickSize=a.tickSize||[h,f];var m=e.tickSize[0];f=e.tickSize[1];var _=m*s[f];"second"==f?n.setSeconds(t(n.getSeconds(),m)):"minute"==f?n.setMinutes(t(n.getMinutes(),m)):"hour"==f?n.setHours(t(n.getHours(),m)):"month"==f?n.setMonth(t(n.getMonth(),m)):"quarter"==f?n.setMonth(3*t(n.getMonth()/3,m)):"year"==f&&n.setFullYear(t(n.getFullYear(),m)),n.setMilliseconds(0),_>=s.minute?n.setSeconds(0):_>=s.hour?n.setMinutes(0):_>=s.day?n.setHours(0):_>=4*s.day?n.setDate(1):_>=2*s.month?n.setMonth(t(n.getMonth(),3)):_>=2*s.quarter?n.setMonth(t(n.getMonth(),6)):_>=s.year&&n.setMonth(0);var v,b=0,y=Number.NaN;do{if(v=y,y=n.getTime(),i.push(y),"month"==f||"quarter"==f)if(m<1){n.setDate(1);var x=n.getTime();n.setMonth(n.getMonth()+("quarter"==f?3:1));var w=n.getTime();n.setTime(y+b*s.hour+(w-x)*m),b=n.getHours(),n.setHours(0)}else n.setMonth(n.getMonth()+m*("quarter"==f?3:1));else"year"==f?n.setFullYear(n.getFullYear()+m):n.setTime(y+_)}while(y<e.max&&y!=v);return i},n.tickFormatter=function(e,t){var n=o(e,t.options);if(null!=a.timeformat)return i(n,a.timeformat,a.monthNames,a.dayNames);var r,l=t.options.tickSize&&"quarter"==t.options.tickSize[1]||t.options.minTickSize&&"quarter"==t.options.minTickSize[1],c=t.tickSize[0]*s[t.tickSize[1]],d=t.max-t.min,u=a.twelveHourClock?" %p":"",h=a.twelveHourClock?"%I":"%H";return r=c<s.minute?h+":%M:%S"+u:c<s.day?d<2*s.day?h+":%M"+u:"%b %d "+h+":%M"+u:c<s.month?"%b %d":l&&c<s.quarter||!l&&c<s.year?d<s.year?"%b":"%b %Y":l&&c<s.year?d<s.year?"Q%q":"Q%q %Y":"%Y",i(n,r,a.monthNames,a.dayNames)})})})}var r={},s={second:1e3,minute:6e4,hour:36e5,day:864e5,month:2592e6,quarter:7776e6,year:525949.2*60*1e3},l=[[1,"second"],[2,"second"],[5,"second"],[10,"second"],[30,"second"],[1,"minute"],[2,"minute"],[5,"minute"],[10,"minute"],[30,"minute"],[1,"hour"],[2,"hour"],[4,"hour"],[8,"hour"],[12,"hour"],[1,"day"],[2,"day"],[3,"day"],[.25,"month"],[.5,"month"],[1,"month"],[2,"month"]],c=l.concat([[3,"month"],[6,"month"],[1,"year"]]),d=l.concat([[1,"quarter"],[2,"quarter"],[1,"year"]]);e.plot.plugins.push({init:a,options:r,name:"time",version:"1.0"}),e.plot.formatDate=i}(jQuery)},function(e,t){var i="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};!function(e){"use strict";e.extend({giveAjaxifyFields:function(t){var n,o,a={type:"",parentWrapper:"form",countryFieldName:"country",stateFieldName:"state",stateFieldWrapper:".give-field-wrap",chosenState:!0},r=e.extend({},a,t||{});switch(r.type){case"country_state":if(n=e('select[name="'+r.countryFieldName+'"]'),o=n.closest(r.parentWrapper),!n.length||"Country_state"===n.data("give-ajaxify-field"))return;n.data("give-ajaxify-field","country_state"),n.change(function(){var t=e(this),n=t.closest(r.parentWrapper).find('[name="'+r.stateFieldName+'"]'),a=n.closest(r.stateFieldWrapper),s=e("label",a);r.stateFieldWrapper||(s=e('label[for="'+r.stateFieldName+'"]',o),a=n.parent());var l={action:"give_get_states",country:t.val(),field_name:r.stateFieldName};e.post(ajaxurl,l,function(t){if(!t.show_field)return void(r.stateFieldWrapper?a.addClass("give-hidden"):n.addClass("give-hidden"));s.length&&s.text(t.states_label),r.chosenState&&n.chosen("destroy"),r.stateFieldWrapper?a.removeClass("give-hidden"):n.removeClass("give-hidden"),void 0!==i(t.states_found)&&!0===t.states_found?(n.replaceWith(t.data),n=e('[name="'+r.stateFieldName+'"]',a),r.chosenState&&n.chosen()):(n.replaceWith('<input type="text" name="'+r.stateFieldName+'" value="'+t.default_state+'" class="medium-text"/>'),n=e('[name="'+r.stateFieldName+'"]',a))})})}return this}})}(jQuery)},function(e,t){var i={collection:{},get:function(e,t,i){return jQuery?(t=void 0!==t?t:void 0,i=!0===i,(void 0===this.collection[e]||i)&&(this.collection[e]=void 0!==t?jQuery(e,t):jQuery(e)),this.collection[e]):-1}};window.Give_Selector_Cache=i},function(e,t){!function(e){e.fn.repeatable_fields=function(t){function i(t){e(a.wrapper,t).each(function(t,o){var r=this,s=e(r).children(a.container);e(s).children(a.template).hide().find(":input").each(function(){e(this).prop("disabled",!0)});var l=e(s).children(a.row).filter(function(){return!e(this).hasClass(a.template.replace(".",""))}).length;if(e(s).attr("data-rf-row-count",l),e(r).on("click",a.add,function(t){t.stopImmediatePropagation();var o=e(e(s).children(a.template).clone().removeClass(a.template.replace(".",""))[0].outerHTML);e(o).find(":input").each(function(){e(this).prop("disabled",!1)}),"function"==typeof a.before_add&&a.before_add(s);var r=e(o).show().appendTo(s);"function"==typeof a.after_add&&a.after_add(s,r,n),i(r)}),e(r).on("click",a.remove,function(t){if(t.stopImmediatePropagation(),a.confirm_before_remove_row&&a.confirm_before_remove_row_text&&!confirm(a.confirm_before_remove_row_text))return!1;var i=e(this).parents(a.row).first();"function"==typeof a.before_remove&&a.before_remove(s,i),i.remove(),"function"==typeof a.after_remove&&a.after_remove(s)}),!0===a.is_sortable&&void 0!==e.ui&&void 0!==e.ui.sortable){var c=null!==a.sortable_options?a.sortable_options:{};c.handle=a.move,e(r).find(a.container).sortable(c)}})}function n(t,i){var n=e(t).attr("data-rf-row-count");n++,e("*",i).each(function(){e.each(this.attributes,function(e,t){this.value=this.value.replace(a.row_count_placeholder,n-1)})}),e(t).attr("data-rf-row-count",n)}var o={wrapper:".wrapper",container:".container",row:".row",add:".add",remove:".remove",confirm_before_remove_row:!1,confirm_before_remove_row_text:"",move:".move",template:".template",is_sortable:!0,before_add:null,after_add:n,before_remove:null,after_remove:null,sortable_options:null,row_count_placeholder:"{{row-count-placeholder}}"},a=e.extend({},o,t);i(this)}}(jQuery)},function(e,t){/*!
 * Give Admin Forms JS
 *
 * @description: The Give Admin Forms scripts. Only enqueued on the give_forms CPT; used to validate fields, show/hide, and other functions
 * @package:     Give
 * @subpackage:  Assets/JS
 * @copyright:   Copyright (c) 2016, WordImpress
 * @license:     http://opensource.org/licenses/gpl-2.0.php GNU Public License
 */
!function(e){function t(){e(".cmb2-text-money").each(function(t,i){parseInt(e(i).val())||e(i).removeAttr("value")})}var i=function(){e("body").on("change",".give-give_default_radio_inline",function(){e(".give-give_default_radio_inline").prop("checked",!1),e(this).prop("checked",!0)})},n=function(){e("._give_price_option_field input:radio").on("change",function(){"set"===e("._give_price_option_field input:radio:checked").val()?(e("._give_set_price_field").show(),e("#_give_donation_levels_field").hide(),e("._give_display_style_field").hide()):(e("._give_set_price_field").hide(),e("#_give_donation_levels_field").show(),e("._give_display_style_field").show())}).change(),e("._give_display_content_field input:radio").on("change",function(){"enabled"===e("._give_display_content_field input:radio:checked").val()?(e("._give_content_placement_field").show(),e("._give_form_content_field").show()):(e("._give_content_placement_field").hide(),e("._give_form_content_field").hide())}).change(),e("._give_terms_option_field input:radio").on("change",function(){"enabled"===e("._give_terms_option_field input:radio:checked").val()?(e("._give_agree_label_field").show(),e("._give_agree_text_field").show()):(e("._give_agree_label_field").hide(),e("._give_agree_text_field").hide())}).change(),e("._give_payment_display_field input:radio").on("change",function(){"onpage"===e("._give_payment_display_field input:radio:checked").val()?e("._give_reveal_label_field").hide():e("._give_reveal_label_field").show()}).change(),e("._give_custom_amount_field input:radio").on("change",function(){"disabled"===e("._give_custom_amount_field input:radio:checked").val()?(e("._give_custom_amount_range_field ").hide(),e("._give_custom_amount_text_field").hide()):(e("._give_custom_amount_range_field ").show(),e("._give_custom_amount_text_field").show())}).change();var t=e("._give_goal_option_field"),i=e("._give_goal_format_field input:radio");e("._give_close_form_when_goal_achieved_field input:radio").on("change",function(){"disabled"===e("._give_close_form_when_goal_achieved_field input:radio:checked").val()?e("._give_form_goal_achieved_message_field").hide():e("._give_form_goal_achieved_message_field").show()}).change(),t.on("change",function(){"disabled"===e("._give_goal_option_field input:radio:checked").val()?(e("._give_set_goal_field").hide(),e("._give_goal_format_field").hide(),e("._give_goal_color_field").hide(),e("._give_close_form_when_goal_achieved_field").hide(),e("._give_form_goal_achieved_message_field").hide(),e("._give_number_of_donation_goal_field").hide(),e("._give_number_of_donor_goal_field").hide()):(e("._give_set_goal_field").show(),e("._give_goal_format_field").show(),e("._give_goal_color_field").show(),e("._give_close_form_when_goal_achieved_field").show(),"enabled"===e("._give_close_form_when_goal_achieved_field input:radio:checked").val()&&e("._give_form_goal_achieved_message_field").show(),i.change())}).change(),i.on("change",function(){var t=e("._give_goal_format_field input:radio:checked").val(),i=e("._give_goal_option_field input:radio:checked").val();"donation"===t?(e("._give_set_goal_field, ._give_number_of_donor_goal_field,._give_number_of_donation_goal_field").hide(),"disabled"!==i&&e("._give_number_of_donation_goal_field").show()):"donors"===t?(e("._give_set_goal_field, ._give_number_of_donation_goal_field, ._give_number_of_donor_goal_field").hide(),"disabled"!==i&&e("._give_number_of_donor_goal_field").show()):("disabled"===i?e("._give_set_goal_field").hide():e("._give_set_goal_field").show(),e("._give_number_of_donation_goal_field, ._give_number_of_donor_goal_field").hide())}).change(),e("._give_customize_offline_donations_field input:radio").on("change",function(){"enabled"===e("._give_customize_offline_donations_field input:radio:checked").val()?(e("._give_offline_checkout_notes_field").show(),e("._give_offline_donation_enable_billing_fields_single_field").show(),e("._give_offline_donation_subject_field").show(),e("._give_offline_donation_email_field").show()):(e("._give_offline_checkout_notes_field").hide(),e("._give_offline_donation_enable_billing_fields_single_field").hide(),e("._give_offline_donation_subject_field").hide(),e("._give_offline_donation_email_field").hide())}).change(),e("._give_email_options_field input:radio").on("change",function(){"enabled"===e("._give_email_options_field input:radio:checked").val()?e("#email_notification_options .give-field-wrap:not(._give_email_options_field)").show():e("#email_notification_options .give-field-wrap:not(._give_email_options_field)").hide()}).change();var n=e('input[name="_give_name_title_prefix"]:checked').val();"required"!==n&&"optional"!==n||e(".give-title-prefixes-wrap").show(),e('input[name="_give_name_title_prefix"]').on("change",function(){var t=e('input[name="_give_name_title_prefix"]:checked').val();"required"===t||"optional"===t?e(".give-title-prefixes-wrap").show():e(".give-title-prefixes-wrap").hide()})},o=function(){function t(t){var n=i();e(t).find("input.give-level-id-input").val(n),e(t).find(".give-level-id").text(n)}function i(){var t=0,i=0,n=0;return e("#_give_donation_levels_repeat > .cmb-repeatable-grouping").each(function(o,a){n=e(this).find("input.give-level-id-input").val(),n>i&&(i=n),t++}),void 0!==i&&i>=t?parseInt(i)+1:t}if(""===e(".give-level-id").text()){e(".cmb-repeatable-grouping").each(function(t,i){var n=e(i).data("iterator")+1;e(i).find(".give-level-id").text(n),e(i).find(".give-level-id-input").val(n)})}e("body").on("cmb2_add_row",function(e,i){t(i)}),e("body").on("cmb2_shift_rows_complete",function(t,i){e(".cmb-repeatable-grouping").each(function(t,i){var n=e(i).find("input.give-level-id-input").val();e(i).find(".give-level-id").text(n)})})};e(function(){i(),n(),o(),t()})}(jQuery)},function(e,t){/*!
 * Give Admin Forms JS
 *
 * @description: The Give Admin Settings scripts. Only enqueued on the give-settings page; used for tabs and other show/hide functionality
 * @package:     Give
 * @since:       1.5
 * @subpackage:  Assets/JS
 * @copyright:   Copyright (c) 2016, WordImpress
 * @license:     http://opensource.org/licenses/gpl-2.0.php GNU Public License
 */
jQuery(document).ready(function(e){var t=jQuery("ul.give-payment-gatways-list");t.length&&t.sortable();e("body").on("change","#give-mainform #currency",function(){var t=e("#give-mainform #currency option:selected").text(),i=t.split("(").pop().split(")").shift();""===i&&(i=Give.fn.getGlobalVar("currency_sign"));var n=e("#give-mainform #currency_position").data("before-template");n=n.replace("{currency_pos}",i),e('#give-mainform #currency_position option[value="before"]').text(n);var o=e("#give-mainform #currency_position").data("after-template");o=o.replace("{currency_pos}",i),e('#give-mainform #currency_position option[value="after"]').text(o)}),"disabled"!==e('input[name="name_title_prefix"]:checked').val()&&e(".give-title-prefixes-settings-wrap").show(),e('input[name="name_title_prefix"]').on("change",function(){"disabled"!==e(this).val()?e(".give-title-prefixes-settings-wrap").show():e(".give-title-prefixes-settings-wrap").hide()}),e("a.give-repeat-setting-field").on("click",function(t){t.preventDefault();var i=e(this).parents("td"),n=e("p:first-child",i),o=n.clone(),a=e("p",i).not(".give-field-description").length,r=e(this).data("id")+"_"+ ++a,s=e(this).prev();return e("input",s).val()&&(e(this).before(o),s=e(this).prev(),e("input",s).attr("id",r),e("input",s).val("")),!1}),e(".give-settings-page").on("click","span.give-remove-setting-field",function(t){e(this).parents("p").remove()}),e(".give-email-notification-status","table.giveemailnotifications").on("click",function(){var t=e(this),i=e("i",t),n=e(this).next(),o=e(this).hasClass("give-email-notification-enabled")?"disabled":"enabled",a=e(this).data("id");if(!parseInt(t.data("edit")))return e("div.give-email-notification-status-notice").remove(),e("hr.wp-header-end").after('<div class="updated error give-email-notification-status-notice"><p>'+e(this).closest(".give-email-notification-status").data("notice")+"</p></div>"),e("html, body").animate({scrollTop:e("div.give-email-notification-status-notice").position().top},"slow"),!1;e.ajax({url:ajaxurl,method:"POST",data:{action:"give_set_notification_status",status:o,notification_id:a},beforeSend:function(){t.hide(),n.addClass("is-active")},success:function(e){e.success&&(t.removeClass("give-email-notification-"+t.data("status")),t.addClass("give-email-notification-"+o),t.data("status",o),"enabled"===o?(i.removeClass("dashicons-no-alt"),i.addClass("dashicons-yes")):(i.removeClass("dashicons-yes"),i.addClass("dashicons-no-alt")),n.removeClass("is-active"),t.show())}})}),e("#give-clear-cache").on("click",function(){e.ajax({url:ajaxurl,type:"GET",data:{action:"give_cache_flush"}}).done(function(e){e.success?new Give.modal.GiveSuccessAlert({modalContent:{title:Give.fn.getGlobalVar("flush_success"),desc:e.data.message,cancelBtnTitle:Give.fn.getGlobalVar("ok")}}).render():new Give.modal.GiveErrorAlert({modalContent:{title:Give.fn.getGlobalVar("flush_error"),desc:e.data.message,cancelBtnTitle:Give.fn.getGlobalVar("ok")}}).render()})})})},function(e,t){/*!
 * Give Admin Export JS
 *
 * @description: The Give Admin Settings scripts. Only enqueued on the give-settings and give-tools page; used for exporting CSV
 * @package:     Give
 * @since:       2.1
 * @subpackage:  Assets/JS
 * @copyright:   Copyright (c) 2016, WordImpress
 * @license:     http://opensource.org/licenses/gpl-2.0.php GNU Public License
 */
jQuery(document).ready(function(e){function t(){var t=e("form#give-export_donations-form"),n=e(t).find("tr.give-export-donation-form .give-select-chosen"),o=n.prev();n.find('input[type="text"]'),n.hasClass("variations");e(".give-export-donations-hide").addClass("give-hidden"),e("li.give-export-donation-checkbox-remove").remove(),e.ajax({type:"POST",url:ajaxurl,data:{action:"give_form_search",s:"",fields:e(t).serialize()},beforeSend:function(){o.closest("ul.chosen-results").empty()},success:function(a){e("option",o).remove();var r=[];a.length?(t.find(".give-export-donation-button").prop("disabled",!1),e.each(a,function(e,t){o.prepend('<option value="'+t.id+'">'+t.name+"</option>"),r.push(t.id)}),o.prepend('<option value="0" selected>'+o.data("placeholder")+"</option>")):(o.prepend('<option value="0">'+o.data("no-form")+"</option>"),t.find(".give-export-donation-button").prop("disabled",!0)),t.find(".form_ids").val(r.join()),n.prev("select.give-select-chosen").trigger("chosen:updated"),i("")}})}function i(t){var i=void 0!==t.standard_fields&&null!==t.standard_fields?t.standard_fields:"",n=e(".give-export-donations-standard-fields ul");i.length>0&&(n.closest("tr").removeClass("give-hidden"),e(i).each(function(e,t){n.append('<li class="give-export-donation-checkbox-remove"><label for="give-give-donations-standard-field-'+t+'"><input type="checkbox" name="give_give_donations_export_option['+t+']" id="give-give-donations-standard-field-'+t+'">'+t+"</label> </li>")}));var o=void 0!==t.hidden_fields&&null!==t.hidden_fields?t.hidden_fields:"",a=e(".give-export-donations-hidden-fields ul");o&&(a.closest("tr").removeClass("give-hidden"),e(o).each(function(e,t){a.append('<li class="give-export-donation-checkbox-remove"><label for="give-give-donations-hidden-field-'+t+'"><input type="checkbox" name="give_give_donations_export_option['+t+']" id="give-give-donations-hidden-field-'+t+'">'+t+"</label> </li>")}))}e(".give-export_donations #give-export_donations-form .give_forms_categories , .give-export_donations #give-export_donations-form .give_forms_tags").change(function(){t()}),e(".give-export_donations #give-export_donations-form #give_payment_form_select").change(function(){e(".give-export-donations-hide").addClass("give-hidden"),e("li.give-export-donation-checkbox-remove").remove(),jQuery(document).trigger("give_export_donations_form_change");var t;if(!(t=e(this).val()))return!1;e.ajax({type:"POST",url:ajaxurl,data:{form_id:t,action:"give_export_donations_get_custom_fields"},success:function(e){e?i(e):alert(Give.fn.getGlobalVar("error_message")),jQuery(document).trigger("give_export_donations_form_response",e)}})})})},function(e,t){/*!
 * Give Admin Widgets JS
 *
 * @description: The Give Admin Widget scripts. Only enqueued on the admin widgets screen; used to validate fields, show/hide, and other functions
 * @package:     Give
 * @subpackage:  Assets/JS
 * @copyright:   Copyright (c) 2016, WordImpress
 * @license:     http://opensource.org/licenses/gpl-2.0.php GNU Public License
 */
!function(e){var t=function(){e(".widget-liquid-right").on("change",".give_forms_display_style_setting_row input",function(){var t=e(this).parents("p"),i=t.next();"onpage"===e("input:checked",t).val()?i.hide():i.show()})};e(function(){t(),e(".give_forms_display_style_setting_row input",".widget-liquid-right").trigger("change")}),e(document).ajaxSuccess(function(i,n,o){t(),e(".give_forms_display_style_setting_row input",".widget-liquid-right").trigger("change")})}(jQuery)},function(e,t,i){"use strict";function n(){var e=jQuery(".give-settings-page"),t=jQuery("h2.give-nav-tab-wrapper"),i=e.width(),n=jQuery(".give-sub-nav-tab-wrapper"),a=jQuery("nav",n),r=jQuery("div.give-nav-tab-wrapper > a:not(give-not-tab)"),s=[],l=[],c=0;if(600<jQuery(window).outerWidth()&&(c=200),!e.length)return!1;t.css({height:"auto",overflow:"visible"}),r.removeClass("give-hidden"),new Promise(function(e,t){jQuery.each(r,function(e,t){t=jQuery(t),c+=parseInt(t.outerWidth()),c<i?s.push(t):l.push(t)}),e(!0)}).then(function(e){if(l.length&&-1!==window.location.search.indexOf("&tab=")){var i={},r=o();l=l.filter(function(e){var t=-1!==parseInt(e.attr("href").indexOf("&tab="+r.tab));return t&&(i=e),!t}),i.length&&(l.unshift(s.pop()),s.push(i))}new Promise(function(e,t){s.length&&jQuery.each(s,function(e,t){t=jQuery(t),t.hasClass("give-hidden")&&t.removeClass("give-hidden")}),e(!0)}).then(function(e){l.length?(a.html(""),jQuery.each(l,function(e,t){t=jQuery(t),t.hasClass("nav-tab-active")||t.addClass("give-hidden"),t.clone().removeClass().appendTo(a)}),jQuery(".give-sub-nav-tab-wrapper",t).length||t.append(n),n.show()):n.hide()})})}function o(){for(var e,t=[],i=window.location.href.slice(window.location.href.indexOf("?")+1).split("&"),n=0;n<i.length;n++)e=i[n].split("="),t[e[0]]=e[1];return t}var a=i(10),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},s=!1;!function(e){function t(e,t){return e=accounting.unformat(e,Give.fn.getGlobalVar("decimal_separator")).toString(),t="undefined"!==t&&t,e=!1!==t?parseFloat(e).toFixed(t):parseFloat(e).toFixed(Give.fn.getGlobalVar("currency_decimals"))}var i=function(t,i){i=jQuery.extend({wrapper:!0,show:!1},i);var n=i.wrapper?e(".give-spinner-wrapper",t):{},o=e(".give-spinner",t);if(i.show)return n.length&&n.addClass("is-active"),void o.addClass("is-active");n.length&&n.removeClass("is-active"),o.removeClass("is-active")},o=function(){e("body").on("click","button.notice-dismiss",function(){"give-invalid-license"!==jQuery(this).closest("div.give-notice").data("notice-id")&&l(jQuery(this).closest("div.give-notice").attr("id"))})},l=function(e){var t=document.location.href,i=t.split("?"),e=void 0===e?"":e.replace("give-","");if(i.length>=2){for(var n=i.shift(),o=i.join("?"),a=encodeURIComponent("give-message")+"=",r=o.split(/[&;]/g),s=r.length;s-- >0;)(-1!==r[s].lastIndexOf(a,0)||""!==e&&-1!==r[s].lastIndexOf("give-messages",0)&&r[s].match(e+"$"))&&r.splice(s,1);t=n+"?"+r.join("&"),window.history.pushState("",document.title,t)}return t},c=function(){var t=e(".give_datepicker");t.length>0&&t.datepicker({dateFormat:Give.fn.getGlobalVar("date_format")})},d=function(){var t=e(".give-select-chosen");t.hasClass("give-chosen-settings")?t.chosen({no_results_text:Give.fn.getGlobalVar("chosen_add_title_prefix")+" ",width:"30%"}).on("chosen:no_results",function(t,i){e(i.chosen.container).on("keydown",function(n){var o=i.chosen.get_search_text();13!==n.keyCode||jQuery(i.chosen.form_field).find('option[value="'+o+'"]').length||(e(i.chosen.form_field).append('<option value="'+o+'" selected>'+o+"</option>").trigger("chosen:updated"),i.chosen.result_highlight=i.chosen.search_results.find("li.active-result").lasteturn,i.chosen.result_select(t))})}):(t.on("chosen:ready",function(){e(this).next(".chosen-container").find("input.chosen-search-input").after('<span class="spinner"></span>')}),t.chosen({inherit_select_classes:!0,placeholder_text_single:Give.fn.getGlobalVar("one_option"),placeholder_text_multiple:Give.fn.getGlobalVar("one_or_more_option")}),t.on("chosen:no_results",function(){var t=e(this).next(".chosen-container"),i=t.find("li.no-results"),n="";n=t.hasClass("give-select-chosen-ajax")&&i.length?Give.fn.getGlobal.chosen.ajax_search_msg.replace("{search_term}",'"'+e("input",t).val()+'"'):Give.fn.getGlobal.chosen.no_results_msg.replace("{search_term}",'"'+e("input",t).val()+'"'),i.html(n);var o;e(document.body).on("keyup",".give-select.chosen-container .chosen-search input, .give-select.chosen-container .search-field input",function(t){var i=e(this).val(),n=e(this).closest(".give-select-chosen"),a=n.prev(),r=n.find('input[type="text"]'),s=(n.hasClass("variations"),t.which),l="give_form_search",c=this;if(n.prev().data("search-type")){if("no_ajax"===a.data("search-type"))return;l="give_"+a.data("search-type")+"_search"}i.length>0&&i.length<=3||!l.length||9===s||13===s||16===s||17===s||18===s||19===s||20===s||27===s||33===s||34===s||35===s||36===s||37===s||38===s||39===s||40===s||44===s||45===s||144===s||145===s||91===s||93===s||224===s||112<=s&&123>=s||(clearTimeout(o),n.addClass("give-select-chosen-ajax"),o=setTimeout(function(){e.ajax({type:"POST",url:ajaxurl,data:{action:l,s:i,fields:e(c).closest("form").serialize()},dataType:"json",beforeSend:function(){a.closest("ul.chosen-results").empty(),r.prop("disabled",!0)},success:function(t){n.removeClass("give-select-chosen-ajax"),e("option:not(:selected)",a).remove(),t.length?(e.each(t,function(t,n){e('option[value="'+n.id+'"]',a).length||(0===i.length?a.append('<option value="'+n.id+'">'+n.name+"</option>"):a.prepend('<option value="'+n.id+'">'+n.name+"</option>"))}),n.prev("select.give-select-chosen").trigger("chosen:updated")):n.prev("select.give-select-chosen").trigger("chosen:no_results"),r.prop("disabled",!1),r.val(i).focus()}}).fail(function(e){window.console&&window.console.log&&console.log(e)}).done(function(e){r.prop("disabled",!1)})},342))}),e(".give-select-chosen .chosen-search input").each(function(){var t=e(this).parent().parent().parent().prev("select.give-select-chosen").data("search-type"),i="";"form"===t?i=Give.fn.getGlobalVar("search_placeholder"):(t="search_placeholder_"+t,Give.fn.getGlobalVar(t)&&(i=Give.fn.getGlobalVar(t))),e(this).attr("placeholder",i)})})),e(".chosen-container").each(function(){0===e(this).width()&&e(this).css("width","100%")}),e("#post").on("click",".give-thickbox",function(){e(".give-select-chosen","#choose-give-form").css("width","100%")})},u={init:function(){this.deleteSingleDonation(),this.resendSingleDonationReceipt()},deleteSingleDonation:function(){new a.GiveConfirmModal({triggerSelector:".delete-single-donation",modalWrapper:"give-modal--warning",modalContent:{title:Give.fn.getGlobalVar("confirm_delete_donation"),desc:Give.fn.getGlobalVar("delete_payment")},successConfirm:function(e){window.location.assign(e.el.attr("href"))}})},resendSingleDonationReceipt:function(){new a.GiveConfirmModal({triggerSelector:".resend-single-donation-receipt",modalContent:{title:Give.fn.getGlobalVar("confirm_resend"),desc:Give.fn.getGlobalVar("resend_receipt")},successConfirm:function(e){window.location.assign(e.el.attr("href"))}})}},h={init:function(){this.edit_address(),this.add_note(),this.remove_note(),this.new_donor(),this.resend_receipt(),this.variable_price_list()},edit_address:function(){e('select[name="give-payment-address[0][country]"]').change(function(){var t=e(this);return data={action:"give_get_states",country:t.val(),field_name:"give-payment-address[0][state]"},e.post(ajaxurl,data,function(i){t.closest(".column-container").find("#give-order-address-state-wrap").removeClass("give-hidden"),t.closest(".column-container").find(".give-column").removeClass("column-full"),t.closest(".column-container").find(".give-column").addClass("column");var n=e("#give-order-address-state-wrap");n.find("*").not(".order-data-address-line").remove(),void 0!==r(i.states_found)&&!0===i.states_found?(n.append(i.data),n.find("select").chosen()):(n.append('<input type="text" name="give-payment-address[0][state]" value="'+i.default_state+'" class="give-edit-toggles medium-text"/>'),void 0!==r(i.show_field)&&!1===i.show_field&&(t.closest(".column-container").find("#give-order-address-state-wrap").addClass("give-hidden"),t.closest(".column-container").find(".give-column").addClass("column-full"),t.closest(".column-container").find(".give-column").removeClass("column")))}),!1})},add_note:function(){e("#give-add-payment-note").on("click",function(t){t.preventDefault();var i={action:"give_insert_payment_note",payment_id:e(this).data("payment-id"),note:e("#give-payment-note").val()};if(i.note)e.ajax({type:"POST",data:i,url:ajaxurl,success:function(t){e("#give-payment-notes-inner").append(t),e(".give-no-payment-notes").hide(),e("#give-payment-note").val("")}}).fail(function(e){window.console&&window.console.log&&console.log(e)});else{var n=e("#give-payment-note").css("border-color");e("#give-payment-note").css("border-color","red"),setTimeout(function(){e("#give-payment-note").css("border-color",n)},500)}})},remove_note:function(){e("body").on("click",".give-delete-payment-note",function(t){t.preventDefault();var i=this;new a.GiveConfirmModal({modalContent:{title:Give.fn.getGlobalVar("confirm_deletion"),desc:Give.fn.getGlobalVar("delete_payment_note")},successConfirm:function(t){var n={action:"give_delete_payment_note",payment_id:e(i).data("payment-id"),note_id:e(i).data("note-id")};e.ajax({type:"POST",data:n,url:ajaxurl,success:function(t){return e("#give-payment-note-"+n.note_id).remove(),e(".give-payment-note").length||e(".give-no-payment-notes").show(),!1}}).fail(function(e){window.console&&window.console.log&&console.log(e)})}}).render()})},new_donor:function(){e("#give-donor-details").on("click",".give-payment-new-donor, .give-payment-new-donor-cancel",function(t){t.preventDefault(),e(".donor-info").toggle(),e(".new-donor").toggle(),e(".new-donor").is(":visible")?e("#give-new-donor").val(1):e("#give-new-donor").val(0)})},resend_receipt:function(){e("body").on("click","#give-resend-receipt",function(t){var i=this;t.preventDefault(),new a.GiveConfirmModal({modalContent:{title:Give.fn.getGlobalVar("confirm_action"),desc:Give.fn.getGlobalVar("resend_receipt")},successConfirm:function(){window.location.assign(e(i).attr("href"))}}).render()})},variable_price_list:function(){e("#give_payment_form_select").chosen().change(function(){var t,i=e(".give-donation-level");return!!(t=e(this).val())&&(!!i.length&&void e.ajax({type:"POST",url:ajaxurl,data:{form_id:t,payment_id:e('input[name="give_payment_id"]').val(),action:"give_check_for_form_price_variations_html"},success:function(t){t=t.trim(),t?(i.html(t),e('select[name="give-variable-price"]').chosen().change()):i.html("")}}))}),e("#give-donation-overview").on("change",'select[name="give-variable-price"]',function(){var t=jQuery(this).data("prices"),i=e("#give-payment-total");""!==t&&e(this).val()in t&&(i.val(t[e(this).val()]).css("background-color","yellow"),window.setTimeout(function(){i.css("background-color","white")},1e3))})}},f={init:function(){this.toggle_gateways(),this.setting_change_country(),this.toggle_options(),this.main_setting_update_notice(),this.verify_settings(),this.saveButtonTriggered(),this.changeAlert(),this.detectSettingsChange(),this.sequentialDonationIDPreview()},toggle_gateways:function(){e(".gateways-checkbox").on("click",function(){var t=e(this).prev(".gateways-radio"),i=(this.checked,e(".gateways-checkbox:checked"));1===i.length?(i.prev(".gateways-radio").attr("checked","checked"),this.checked?t.removeAttr("disabled"):t.attr("disabled","disabled")):this.checked?(t.removeAttr("disabled"),t.removeAttr("checked")):t.attr("disabled","disabled")})},setting_change_country:function(){e('select[name="base_country"]').change(function(){var t=e(this),i={action:"give_get_states",country:t.val(),field_name:"base_state"};return e.post(ajaxurl,i,function(n){t.closest("tr").next().show(),e("#base_state_chosen").remove(),void 0!=r(n.states_found)&&1==n.states_found?(e(':input[name="base_state"]').replaceWith(n.data).addClass("give-select-chosen"),e(':input[name="base_state"]').chosen()):(void 0!=r(n.show_field)&&0==n.show_field&&t.closest("tr").next().hide(),e(':input[name="base_state"]').replaceWith('<input type="text" name="'+i.field_name+'" value="'+n.default_state+'" class="give-edit-toggles medium-text"/>'))}),!1})},toggle_options:function(){e('input[name="email_access"]',".give-setting-tab-body-general").on("change",function(){var t=e('input[name="email_access"]:checked',".give-setting-tab-body-general").val(),i=e('input[name="enable_recaptcha"]:checked',".give-setting-tab-body-general").val();"enabled"===t?(e('input[name="enable_recaptcha"]').parents("tr").show(),"enabled"===i?(e("#recaptcha_key").parents("tr").show(),e("#recaptcha_secret").parents("tr").show()):(e("#recaptcha_key").parents("tr").hide(),e("#recaptcha_secret").parents("tr").hide())):(e("#recaptcha_key").parents("tr").hide(),e("#recaptcha_secret").parents("tr").hide(),e('input[name="enable_recaptcha"]').parents("tr").hide())}).change(),e('input[name="enable_recaptcha"]',".give-setting-tab-body-general").on("change",function(){var t=e('input[name="email_access"]:checked',".give-setting-tab-body-general").val(),i=e('input[name="enable_recaptcha"]:checked',".give-setting-tab-body-general").val();"enabled"===t&&"enabled"===i?(e("#recaptcha_key").parents("tr").show(),e("#recaptcha_secret").parents("tr").show()):(e("#recaptcha_key").parents("tr").hide(),e("#recaptcha_secret").parents("tr").hide())}).change(),e('input[name="form_featured_img"]',".give-setting-tab-body-display").on("change",function(){"enabled"===e('input[name="form_featured_img"]:checked',".give-setting-tab-body-display").val()?e("#featured_image_size").parents("tr").show():e("#featured_image_size").parents("tr").hide()}).change(),e('input[name="terms"]',".give-setting-tab-body-display").on("change",function(){"enabled"===e('input[name="terms"]:checked',".give-setting-tab-body-display").val()?(e("#agree_to_terms_label").parents("tr").show(),e("#wp-agreement_text-wrap").parents("tr").show()):(e("#agree_to_terms_label").parents("tr").hide(),e("#wp-agreement_text-wrap").parents("tr").hide())}).change(),e('input[name="admin_notices"]',".give-setting-tab-body-emails").on("change",function(){"enabled"===e('input[name="admin_notices"]:checked',".give-setting-tab-body-emails").val()?(e("#donation_notification_subject").parents("tr").show(),e("#wp-donation_notification-wrap").parents("tr").show(),e("#admin_notice_emails").parents("tr").show()):(e("#donation_notification_subject").parents("tr").hide(),e("#wp-donation_notification-wrap").parents("tr").hide(),e("#admin_notice_emails").parents("tr").hide())}).change(),e('input[name="sequential-ordering_status"]',".give-setting-tab-body-general").on("change",function(){var t=e('input[name="sequential-ordering_status"]:checked',".give-setting-tab-body-general").val(),i=e(this).closest("table");"enabled"===t?e("input",i).not('input[name="sequential-ordering_status"]').parents("tr").show():e("input",i).not('input[name="sequential-ordering_status"]').parents("tr").hide()}).change()},main_setting_update_notice:function(){var t=e("#setting-error-give-setting-updated");t.length&&window.setTimeout(function(){t.slideUp()},5e3)},verify_settings:function(){var t=e("#success_page"),i=e("#failure_page");t.add(i).change(function(){if(t.val()===i.val()){var n='<div id="setting-error-give-matched-success-failure-page" class="updated settings-error notice is-dismissible"> <p><strong>'+Give.fn.getGlobalVar("matched_success_failure_page")+'</strong></p> <button type="button" class="notice-dismiss"><span class="screen-reader-text">'+Give.fn.getGlobalVar("dismiss_notice_text")+"</span></button> </div>",o=e("#setting-error-give-matched-success-failure-page");if(e(this).val(""),o.length)return!1;e("h1","#give-mainform").after(n),o=e("#setting-error-give-matched-success-failure-page"),e(".notice-dismiss",o).click(function(){o.remove()})}}).change()},saveButtonTriggered:function(){e(".give-settings-setting-page").on("click",".give-save-button",function(){e(window).unbind("beforeunload")})},changeAlert:function(){e(window).bind("beforeunload",function(e){var t=Give.fn.getGlobalVar("setting_not_save_message");if(s)return(e||window.event).returnValue=t,t})},detectSettingsChange:function(){var t=e(".give-settings-setting-page");if(t.length>0){var i=e("#give-mainform").serialize();t.on("change keyup blur","form",function(){var t=e("#give-mainform").serialize();s=i!==t})}},sequentialDonationIDPreview:function(){var t=jQuery("#sequential-ordering_preview");t.length&&(jQuery("#sequential-ordering_number_prefix, #sequential-ordering_number, #sequential-ordering_number_padding, #sequential-ordering_number_suffix").on("keyup change",function(){var e=jQuery("#sequential-ordering_number_prefix").val(),i=jQuery("#sequential-ordering_number").val().trim()||"1",n=jQuery("#sequential-ordering_number_padding").val().trim(),o=jQuery("#sequential-ordering_number_suffix").val(),a=""+e+i.padStart(n,"0")+o;t.val(a)}),jQuery("#sequential-ordering_number_prefix").trigger("keyup"),jQuery("#sequential-ordering_number_prefix, #sequential-ordering_number_suffix").on("blur",function(){e(this).val(e(this).val().replace(new RegExp(" ","g"),"-"))}))}},p={init:function(){this.date_options(),this.donors_export(),this.recount_stats()},date_options:function(){e("#give-graphs-date-options").change(function(){"other"===e(this).val()?e("#give-date-range-options").show():e("#give-date-range-options").hide()})},donors_export:function(){e("#give_donor_export_form").change(function(){var t=e(this),i=e("option:selected",t).val(),n=e("#give_customer_export_option");"0"===t.val()?n.show():n.hide();var o=e(".give_price_options_select");if(0!=parseInt(i)){var a={action:"give_check_for_form_price_variations",form_id:i,all_prices:!0};e.post(ajaxurl,a,function(t){o.remove(),e("#give_donor_export_form_chosen").after(t)})}else o.remove()})},recount_stats:function(){e("body").on("change","#recount-stats-type",function(){var t=e("#give-tools-recount-form"),i=e("option:selected",this).data("type"),n=e("#recount-stats-submit"),o=e(".tools-form-dropdown");if(t.find(".notice-wrap").remove(),n.removeClass("button-disabled").attr("disabled",!1),o.hide(),e(".give-recount-stats-descriptions span").hide(),"reset-stats"===i){t.append('<div class="notice-wrap"></div>');var a=t.find(".notice-wrap");a.html('<div class="notice notice-warning"><p><input type="checkbox" id="confirm-reset" name="confirm_reset_store" value="1" /> <label for="confirm-reset">'+Give.fn.getGlobalVar("reset_stats_warn")+"</label></p></div>"),n.addClass("button-disabled").attr("disabled","disabled")}else if("delete-test-donors"===i){t.append('<div class="notice-wrap"></div>');var a=t.find(".notice-wrap");a.html('<div class="notice notice-warning"><p><input type="checkbox" id="confirm-reset" name="confirm_reset_store" value="1" /> <label for="confirm-reset">'+Give.fn.getGlobalVar("delete_test_donor")+"</label></p></div>"),n.addClass("button-disabled").attr("disabled","disabled")}else if("delete-import-donors"===i){t.append('<div class="notice-wrap"></div>');var a=t.find(".notice-wrap");a.html('<div class="notice notice-warning"><p><input type="checkbox" id="confirm-reset" name="confirm_reset_store" value="1" /> <label for="confirm-reset">'+Give.fn.getGlobalVar("delete_import_donor")+"</label></p></div>"),n.addClass("button-disabled").attr("disabled","disabled")}else o.hide(),o.val(0);var r=e(".tools-form-dropdown-"+i);r.show(),r.find(".give-select-chosen").css({width:"auto","min-width":"250px"}),e("#"+i).show()}),e("body").on("change","#confirm-reset",function(){e(this).is(":checked")?e("#recount-stats-submit").removeClass("button-disabled").removeAttr("disabled"):e("#recount-stats-submit").addClass("button-disabled").attr("disabled","disabled")}),e("#give-tools-recount-form").submit(function(t){var i=e("#recount-stats-type").val(),n=e(this),o=e("option:selected",this).data("type");if("reset-stats"===o){if(e("#confirm-reset").is(":checked"))return!0;r=!0}n.find(".notice-wrap").remove(),n.append('<div class="notice-wrap"></div>');var a=n.find(".notice-wrap"),r=!1;if(null!==i&&0!==i||(a.html('<div class="updated error"><p>'+Give.fn.getGlobalVar("batch_export_no_class")+"</p></div>"),r=!0),"recount-form"===o){0==e('select[name="form_id"]').val()&&(a.html('<div class="updated error"><p>'+Give.fn.getGlobalVar("batch_export_no_reqs")+"</p></div>"),r=!0)}if(r)return n.find(".button-disabled").removeClass("button-disabled"),!1})}},g={init:function(){this.submit(),this.dismiss_message()},submit:function(){var t=this;e(document.body).on("submit",".give-export-form",function(i){i.preventDefault();var n=e(this).find('input[type="submit"]');if(!n.hasClass("button-disabled")){var o=e(this).serialize();n.addClass("button-disabled"),e("form.give-export-form select").attr("disabled",!0).trigger("chosen:updated");var a=e(this);e(this).find(".add-notices").length>0&&(a=e(this).find(".add-notices")),a.find(".notice-wrap").remove(),a.append('<div class="notice-wrap give-clearfix"><span class="spinner is-active"></span><div class="give-progress"><div></div></div></div>'),t.process_step(1,o,t,this)}})},process_step:function(t,i,n,o){s=!0;var a=!1;e.ajax({type:"POST",url:ajaxurl,data:{form:i,action:"give_do_ajax_export",step:t},dataType:"json",success:function(t){if("done"==t.step||t.error||t.success){s=!1,a=!0;var r=e(o).parent().find(".notice-wrap");r.find(".give-progress");if(e(o).find(".button-disabled").removeClass("button-disabled"),e(o).find("select").attr("disabled",!1).trigger("chosen:updated"),t.error){var l=t.message;r.html('<div class="updated error"><p>'+l+"</p></div>")}else if(t.success){var c=t.message;r.html('<div id="give-batch-success" class="updated notice is-dismissible"><p>'+c+'<span class="notice-dismiss"></span></p></div>')}else r.remove(),window.location=t.url}else e(".give-progress div").animate({width:t.percentage+"%"},50,function(){}),n.process_step(parseInt(t.step),i,n,o);!0===a&&e("#give-tools-recount-form").length>0&&(e("#give-tools-recount-form")[0].reset(),e("#give-tools-recount-form .tools-form-dropdown").hide(),e("#give-tools-recount-form .tools-form-dropdown-recount-form-select").val("0").trigger("chosen:updated"))}}).fail(function(t){s=!1,window.console&&window.console.log&&console.log(t),e(".notice-wrap").append(t.responseText)})},dismiss_message:function(){e("body").on("click","#give-batch-success .notice-dismiss",function(){e("#give-batch-success").parent().slideUp("fast")})}},m={el:{},init:function(){this.submit(),this.dismiss_message()},submit:function(){var t=this;t.el.main_container=Give_Selector_Cache.get("#give-db-updates"),t.el.update_link=Give_Selector_Cache.get(".give-update-now",t.el.main_container),t.el.run_upload_container=Give_Selector_Cache.get(".give-run-database-update",t.el.progress_main_container),t.el.progress_main_container=Give_Selector_Cache.get(".progress-container",t.el.main_container),t.el.heading=Give_Selector_Cache.get(".update-message",t.el.progress_main_container),t.el.progress_container=Give_Selector_Cache.get(".progress-content",t.el.progress_main_container),t.el.update_progress_counter=Give_Selector_Cache.get(e(".give-update-progress-count")),t.el.main_container.data("resume-update")&&(t.el.update_link.addClass("active").hide().removeClass("give-hidden"),e("#give-restart-upgrades").length||(Give.fn.getGlobalVar("ajax").length||window.setTimeout(m.start_db_update,1e3),window.setTimeout(m.get_db_updates_info,1e3,t))),t.el.update_link.hasClass("active")||(t.el.update_link.on("click","",function(e){e.preventDefault(),t.el.run_upload_container.find(".notice").remove(),t.el.run_upload_container.append('<div class="notice notice-error non-dismissible give-run-update-containt"><p> <a href="#" class="give-run-update-button button">'+Give.fn.getGlobalVar("db_update_confirmation_msg_button")+"</a> "+Give.fn.getGlobalVar("db_update_confirmation_msg")+"</p></div>")}),e("#give-db-updates").on("click","a.give-run-update-button",function(i){return i.preventDefault(),!e(this).hasClass("active")&&(e(this).addClass("active").fadeOut(),t.el.update_link.addClass("active").fadeOut(),e("#give-db-updates .give-run-update-containt").slideUp(),t.el.progress_container.find(".notice-wrap").remove(),t.el.progress_container.append('<div class="notice-wrap give-clearfix"><span class="spinner is-active"></span><div class="give-progress"><div></div></div></div>'),t.el.progress_main_container.removeClass("give-hidden"),m.start_db_update(),window.setTimeout(m.get_db_updates_info,500,t),!1)}))},start_db_update:function(){e.ajax({type:"POST",url:ajaxurl,data:{action:"give_run_db_updates",run_db_update:1,nonce:Give.fn.getGlobalVar("db_update_nonce")},dataType:"json",success:function(e){}}).always(function(){Give.fn.getGlobalVar("ajax").length||window.setTimeout(m.start_db_update,1e3)})},get_db_updates_info:function(t){e.ajax({type:"POST",url:ajaxurl,data:{action:"give_db_updates_info"},dataType:"json",success:function(i){var n=Give_Selector_Cache.get(".notice-wrap",t.el.progress_container,!0);-1!==e.inArray("success",Object.keys(i))?i.success?(t.el.update_progress_counter.length&&t.el.update_progress_counter.text("100%"),-1!==e.inArray("heading",Object.keys(i.data))&&t.el.heading.html("<strong>"+i.data.heading+"</strong>"),t.el.update_link.closest("p").remove(),n.html('<div class="notice notice-success is-dismissible"><p>'+i.data.message+'</p><button type="button" class="notice-dismiss"></button></div>')):(-1!==e.inArray("heading",Object.keys(i.data))&&t.el.heading.html("<strong>"+i.data.heading+"</strong>"),i.data.message?(t.el.update_link.closest("p").remove(),n.html('<div class="notice notice-error is-dismissible"><p>'+i.data.message+'</p><button type="button" class="notice-dismiss"></button></div>')):setTimeout(function(){t.el.update_link.removeClass("active").show(),t.el.progress_main_container.addClass("give-hidden")},1e3)):i&&-1!==e.inArray("percentage",Object.keys(i.data))?(t.el.update_progress_counter.length&&t.el.update_progress_counter.text(i.data.total_percentage+"%"),-1!==e.inArray("heading",Object.keys(i.data))&&t.el.heading.html("<strong>"+i.data.heading+"</strong>"),e(".give-progress div","#give-db-updates").animate({width:i.data.percentage+"%"},50,function(){}),window.setTimeout(m.get_db_updates_info,1e3,t)):(n.html('<div class="notice notice-error"><p>'+Give.fn.getGlobal().updates.ajax_error+"</p></div>"),setTimeout(function(){t.el.update_link.removeClass("active").show(),t.el.progress_main_container.addClass("give-hidden")},1e3))}})},process_step:function(t,i,n){s=!0,e.ajax({type:"POST",url:ajaxurl,data:{action:"give_do_ajax_updates",step:parseInt(t),update:parseInt(i)},dataType:"json",success:function(t){s=!1;var i=Give_Selector_Cache.get(".notice-wrap",n.el.progress_container,!0);-1!==e.inArray("success",Object.keys(t))?t.success?(-1!==e.inArray("heading",Object.keys(t.data))&&n.el.heading.html("<strong>"+t.data.heading+"</strong>"),n.el.update_link.closest("p").remove(),i.html('<div class="notice notice-success is-dismissible"><p>'+t.data.message+'</p><button type="button" class="notice-dismiss"></button></div>')):(-1!==e.inArray("heading",Object.keys(t.data))&&n.el.heading.html("<strong>"+t.data.heading+"</strong>"),i.html('<div class="notice notice-error"><p>'+t.data.message+"</p></div>"),setTimeout(function(){n.el.update_link.removeClass("active").show(),n.el.progress_main_container.addClass("give-hidden")},5e3)):t&&-1!==e.inArray("percentage",Object.keys(t.data))?(e(".give-progress div","#give-db-updates").animate({width:t.data.percentage+"%"},50,function(){}),-1!==e.inArray("heading",Object.keys(t.data))&&n.el.heading.html("<strong>"+t.data.heading.replace("{update_count}",n.el.heading.data("update-count"))+"</strong>"),n.process_step(parseInt(t.data.step),t.data.update,n)):(i.html('<div class="notice notice-error"><p>'+Give.fn.getGlobal().updates.ajax_error+"</p></div>"),setTimeout(function(){n.el.update_link.removeClass("active").show(),n.el.progress_main_container.addClass("give-hidden")},5e3))}}).fail(function(e){s=!1,window.console&&window.console.log&&console.log(e),Give_Selector_Cache.get(".notice-wrap",self.el.progress_container).append(e.responseText)}).always(function(){})},dismiss_message:function(){e("body").on("click","#poststuff .notice-dismiss",function(){e(this).parent().slideUp("fast")})}},_={init:function(){this.restartUpgrade(),this.stopUpgrade(),this.restartUpdater()},restartUpgrade:function(){jQuery("#give-restart-upgrades").click("click",function(e){var t=this;e.preventDefault(),jQuery(".give-doing-update-text-p").show(),jQuery(".give-update-paused-text-p").hide(),new a.GiveConfirmModal({modalContent:{title:Give.fn.getGlobalVar("confirm_action"),desc:Give.fn.getGlobalVar("restart_upgrade")},successConfirm:function(){window.location.assign(jQuery(t).data("redirect-url"))}}).render()})},stopUpgrade:function(){jQuery("#give-pause-upgrades").click("click",function(e){var t=this;e.preventDefault(),jQuery(".give-doing-update-text-p").hide(),jQuery(".give-update-paused-text-p").show(),new a.GiveConfirmModal({modalContent:{title:Give.fn.getGlobalVar("confirm_action"),desc:Give.fn.getGlobalVar("stop_upgrade")},successConfirm:function(){window.location.assign(jQuery(t).data("redirect-url"))}}).render()})},restartUpdater:function(){jQuery(".give-restart-updater-btn,.give-run-update-now").click("click",function(e){var t=this;e.preventDefault(),new a.GiveConfirmModal({modalContent:{title:Give.fn.getGlobalVar("confirm_action"),desc:Give.fn.getGlobalVar("restart_update")},successConfirm:function(){window.location.assign(jQuery(t).attr("href"))}}).render()})}},v=function(){e('select[name="give-payment-status"]').on("change",function(){var t=e(this).val();e(".give-donation-status").removeClass(function(e,t){return(t.match(/\bstatus-\S+/g)||[]).join(" ")}).addClass("status-"+t)})},b={onLoadPageNumber:"",init:function(){this.unlockDonorFields(),this.editDonor(),this.add_email(),this.removeUser(),this.cancelEdit(),this.add_note(),this.delete_checked(),this.addressesAction(),this.bulkDeleteDonor(),b.onLoadPageNumber=e("#current-page-selector").val(),e("body").on("click",'#give-donors-filter .bulkactions input[type="submit"]',this.handleBulkActions)},unlockDonorFields:function(t){e("body").on("click",".give-lock-block",function(e){new a.GiveErrorAlert({modalContent:{title:Give.fn.getGlobalVar("unlock_donor_fields_title"),desc:Give.fn.getGlobalVar("unlock_donor_fields_message"),cancelBtnTitle:Give.fn.getGlobalVar("ok")}}).render(),e.preventDefault()})},editDonor:function(){e("body").on("click","#edit-donor",function(t){t.preventDefault(),e("#give-donor-card-wrapper .editable").hide(),e("#give-donor-card-wrapper .edit-item").fadeIn().css("display","block")})},removeUser:function(){e("body").on("click","#disconnect-donor",function(t){if(t.preventDefault(),!confirm(Give.fn.getGlobalVar("disconnect_user")))return!1;var i=e('input[name="donor_info[id]"]').val(),n={give_action:"disconnect-userid",customer_id:i,_wpnonce:e("#edit-donor-info #_wpnonce").val()};e.post(ajaxurl,n,function(e){window.location.href=e.redirect},"json")})},cancelEdit:function(){e("body").on("click","#give-edit-donor-cancel",function(t){t.preventDefault(),e("#give-donor-card-wrapper .edit-item").hide(),e("#give-donor-card-wrapper .editable").show(),e(".give_user_search_results").html("")})},add_note:function(){e("body").on("click","#add-donor-note",function(t){t.preventDefault();var i={give_action:"add-donor-note",customer_id:e("#donor-id").val(),donor_note:e("#donor-note").val(),add_donor_note_nonce:e("#add_donor_note_nonce").val()};if(i.donor_note)e.ajax({type:"POST",data:i,url:ajaxurl,success:function(t){e("#give-donor-notes").prepend(t),e(".give-no-donor-notes").hide(),e("#donor-note").val("")}}).fail(function(e){window.console&&window.console.log&&console.log(e)});else{var n=e("#donor-note").css("border-color");e("#donor-note").css("border-color","red"),setTimeout(function(){e("#donor-note").css("border-color",n)},500)}})},delete_checked:function(){e("#give-donor-delete-confirm").change(function(){var t=e("#give-donor-delete-records"),i=e("#give-delete-donor");e(this).prop("checked")?(t.attr("disabled",!1),i.attr("disabled",!1)):(t.attr("disabled",!0),t.prop("checked",!1),i.attr("disabled",!0))})},add_email:function(){e("#add-donor-email").length&&e(document.body).on("click","#add-donor-email",function(t){t.preventDefault();var i=e(this),n=i.parent();n.parent().find(".notice-wrap").remove(),n.find(".spinner").css("visibility","visible"),i.attr("disabled",!0);var o=n.find('input[name="donor-id"]').val(),a=n.find('input[name="additional-email"]').val(),r=n.find('input[name="make-additional-primary"]').is(":checked"),s=n.find('input[name="add_email_nonce"]').val(),l={give_action:"add_donor_email",customer_id:o,email:a,primary:r,_wpnonce:s};e.post(ajaxurl,l,function(e){!0===e.success?window.location.href=e.redirect:(i.attr("disabled",!1),n.after('<div class="notice-wrap"><div class="notice notice-error inline"><p>'+e.message+"</p></div></div>"),n.find(".spinner").css("visibility","hidden"))},"json")})},addressesAction:function(){var t=this,n=e("#donor-address-wrapper"),o=e(".all-address",n),a=e(".give-no-address-message",n),r=e(o).parent(),s=e(".address-form",n),l=e(".js-cancel",s),c=e('select[name="country"]',s),d=e(".add-new-address",n),u=parseInt(e('input[name="donor-id"]').val());c.on("change",function(){e(this).trigger("chosen:updated")}),o.on("click",".js-edit",function(i){var n=e(this).closest(".address");i.preventDefault(),e(".notice",r).remove(),t.__set_address_form_val(n),t.__set_address_form_action("update",n.data("address-id")),d.hide(),o.addClass("give-hidden"),s.removeClass("add-new-address-form-hidden"),s.data("process","update")}),o.on("click",".js-remove",function(i){i.preventDefault();var n=e(this).closest(".address");e(".notice",r).remove(),s.data("changed",!0),t.__set_address_form_val(n),t.__set_address_form_action("remove",n.data("address-id")),s.trigger("submit")}),d.on("click",function(i){i.preventDefault(),e(".notice",r).remove(),e(this).hide(),o.addClass("give-hidden"),s.removeClass("add-new-address-form-hidden"),t.__set_address_form_action("add"),t.__set_address_form_action()}),l.on("click",function(e){e.preventDefault(),s.find('input[type="text"]').val(""),d.show(),o.removeClass("give-hidden"),s.addClass("add-new-address-form-hidden")}),s.on("change",function(){e(this).data("changed",!0)}).on("submit",function(t){t.preventDefault();var l=e(this);return e(".notice",r).remove(),e(this).data("changed")?(e.ajax({type:"POST",url:ajaxurl,data:{action:"donor_manage_addresses",donorID:u,form:e("form",s).serialize()},beforeSend:function(){i(n,{show:!0})},success:function(t){if(i(n),t.success){var s;switch(t.data.action){case"add":e(".give-grid-row",o).append(t.data.address_html),!a.hasClass("give-hidden")&&e("div.give-grid-col-4",o).length&&a.addClass("give-hidden");break;case"remove":s=o.find('div[data-address-id*="'+t.data.id+'"]').parent(),s.length&&s.animate({"margin-left":"-999"},1e3,function(){s.remove(),a.hasClass("give-hidden")&&!e("div.give-grid-col-4",o).length&&a.removeClass("give-hidden")});break;case"update":s=o.find('div[data-address-id*="'+t.data.id+'"]').parent();var l=s.prev(),c={},d=!1;parseInt(e(".give-grid-row>div",o).length)<2?e(".give-grid-row",o).append(t.data.address_html):(l.length&&(l.after(t.data.address_html),d=!0),d||(c=s.next(),c.length&&c.before(t.data.address_html))),s.remove()}r.prepend(t.data.success_msg)}else r.prepend(t.data.error_msg)},dataType:"json"}).always(function(){l.data("changed",!1),s.find('input[type="text"]').val(""),d.show(),o.removeClass("give-hidden"),s.addClass("add-new-address-form-hidden")}),!1):(d.show(),o.removeClass("give-hidden"),s.addClass("add-new-address-form-hidden"),!1)})},__set_address_form_action:function(t,i){var n=e("#donor-address-wrapper"),o=e(".address-form",n),a=e('input[name="address-action"]',o),r=e('input[name="address-id"]',o);t=t||"add",i=i||"billing",a.val(t),r.val(i)},__set_address_form_val:function(t){var i=e("#donor-address-wrapper"),n=e(".address-form",i),o=e('[data-address-type="state"]',t).text().substr(2).trim();e('select[name="country"]',n).val().trim()!==e('[data-address-type="country"]',t).text().trim()?(e('select[name="country"]',n).val(e('[data-address-type="country"]',t).text().trim()).trigger("chosen:updated").change(),window.setTimeout(function(){e('[name="state"]',n).val(o).trigger("chosen:updated")},500)):e('[name="state"]',n).val(o).trigger("chosen:updated"),e('input[name="line1"]',n).val(e('[data-address-type="line1"]',t).text().trim()),e('input[name="line2"]',n).val(e('[data-address-type="line2"]',t).text().trim()),e('input[name="city"]',n).val(e('[data-address-type="city"]',t).text().trim()),e('input[name="zip"]',n).val(e('[data-address-type="zip"]',t).text().trim())},bulkDeleteDonor:function(){var t=e("body");t.on("click","#give-bulk-delete-cancel",function(t){e(this).closest("tr").hide(),e(".give-skip-donor").trigger("click"),t.preventDefault()}),t.on("click","#cb-select-all-1, #cb-select-all-2",function(){var t=e(this);e.each(e(".donor-selector"),function(){var i=e(this).val(),n=e(this).data("name"),o='<div id="give-donor-'+i+'" data-id="'+i+'"><a class="give-skip-donor" title="'+Give.fn.getGlobalVar("remove_from_bulk_delete")+'">X</a>'+n+"</div>";t.is(":checked")&&!e(this).is(":checked")?e("#give-bulk-donors").append(o):t.is(":checked")||e("#give-bulk-donors").find("#give-donor-"+i).remove()})}),t.on("click",".donor-selector",function(){var t=e(this).val(),i=e(this).data("name"),n='<div id="give-donor-'+t+'" data-id="'+t+'"><a class="give-skip-donor" title="'+Give.fn.getGlobalVar("remove_from_bulk_delete")+'">X</a>'+i+"</div>";e(this).is(":checked")?e("#give-bulk-donors").prepend(n):e("#give-bulk-donors").find("#give-donor-"+t).remove()}),t.on("click","#give-bulk-delete .give-donor-delete-confirm",function(){e(this).is(":checked")?e("#give-bulk-delete-button").removeAttr("disabled"):(e("#give-bulk-delete-button").attr("disabled",!0),e("#give-bulk-delete .give-donor-delete-records").removeAttr("checked"))}),t.on("click","#give-bulk-delete .give-donor-delete-records",function(){e(this).is(":checked")&&(e("#give-bulk-delete .give-donor-delete-confirm").attr("checked","checked"),e("#give-bulk-delete-button").removeAttr("disabled"))}),t.on("click",".give-skip-donor",function(){var t=e(this).closest("div").data("id");e("#give-donor-"+t).remove(),e("#donor-"+t).find('input[type="checkbox"]').removeAttr("checked")}),t.on("click",".give-single-donor-delete",function(t){var i=e(this).data("id"),n=e("tr#donor-"+i).find(".donor-selector"),o=e('[id^="cb-select-all-"]'),a=e("#give-bulk-donors"),r=n.data("name"),s='<div id="give-donor-'+i+'" data-id="'+i+'"><a class="give-skip-donor" title="'+Give.fn.getGlobalVar("remove_from_bulk_delete")+'">X</a>'+r+"</div>";a.html(""),o.is(":checked")&&o.removeAttr("checked"),e(".donor-selector").removeAttr("checked"),n.attr("checked","checked"),0===e("#give-donor-"+i).length&&(a.prepend(s),e("#give-bulk-delete").slideDown()),t.preventDefault()})},handleBulkActions:function(t){var i=e(this).closest(".tablenav").find("select").val(),n=[],o=e("#current-page-selector").val(),r=b.onLoadPageNumber!==o,s=Give.fn.getGlobalVar("donors_bulk_action.no_action_selected"),l=Give.fn.getGlobalVar("donors_bulk_action.no_donor_selected");return!!r||(e.each(e(".donor-selector:checked"),function(){n.push(e(this).val())}),"-1"===i?(new a.GiveWarningAlert({modalContent:{title:s.title,desc:s.desc,cancelBtnTitle:Give.fn.getGlobalVar("ok")}}).render(),!1):parseInt(n)?("delete"===i&&e("#give-bulk-delete").slideDown(),void t.preventDefault()):(new a.GiveWarningAlert({modalContent:{title:l.title,desc:l.desc,cancelBtnTitle:Give.fn.getGlobalVar("ok")}}).render(),!1))}},y={init:function(){this.revoke_api_key(),this.regenerate_api_key()},revoke_api_key:function(){e("body").on("click",".give-revoke-api-key",function(e){return confirm(Give.fn.getGlobalVar("revoke_api_key"))})},regenerate_api_key:function(){e("body").on("click",".give-regenerate-api-key",function(e){return confirm(Give.fn.getGlobalVar("regenerate_api_key"))})}},x={init:function(){var t=e.query.get("give_tab").length?e.query.get("give_tab"):"form_field_options";this.handle_metabox_tab_click(),this.setup_colorpicker_fields(),this.setup_media_fields(),this.setup_repeatable_fields(),this.handle_repeater_group_events(),this.handle_multi_levels_repeater_group_events(),this.activate_tab(e('a[href="#'+t+'"]'))},handle_metabox_tab_click:function(){var t=this;e(".give-metabox-tabs a").on("click",function(i){i.preventDefault();var n=e(this);t.activate_tab(n),t.update_query(n)})},activate_tab:function(t){var i=t.data("tab-id"),n=t.parent(),o=e("ul.give-metabox-sub-tabs",n),a=o.length,r=e(".give-metabox-tabs a"),s=r.parents("li"),l=e("ul.give-metabox-sub-tabs"),c=t.parents("ul.give-metabox-sub-tabs").length;if(e("#give_form_active_tab").val(i),a){n.toggleClass("active"),o.removeClass("give-hidden");var d=e("li.active","ul.give-metabox-sub-tabs");l.not(o).addClass("give-hidden"),s.not(n).removeClass("active"),d.addClass("active")}else c?c&&(e("ul.give-metabox-sub-tabs").addClass("give-hidden"),s.removeClass("active"),t.parents("ul.give-metabox-sub-tabs").removeClass("give-hidden").children("li").removeClass("active"),t.parents("li.has-sub-fields").addClass("active")):s.each(function(t,i){i=e(i),i.removeClass("active"),i.hasClass("has-sub-fields")&&e("ul.give-metabox-sub-tabs",i).addClass("give-hidden")});t.parent().addClass("active"),e(".give_options_panel").removeClass("active"),e(t.attr("href")).addClass("active")},update_query:function(t){var i=t.data("tab-id"),n=e.query.set("give_tab",i).remove("message").toString();history.replaceState&&history.replaceState(null,null,n)},setup_colorpicker_fields:function(){e(document).ready(function(){var t=e(".give-colorpicker");t.length&&t.each(function(t,i){var n=e(i);n.parents(".give-template").length||n.wpColorPicker()})})},setup_media_fields:function(){var t,i,n=e("body");n.on("click",".give-upload-button",function(o){o.preventDefault();var a={};switch(i=e(this),e(this).data("field-type")){case"media":a={title:Give.fn.getGlobal().metabox_fields.media.button_title,button:{text:Give.fn.getGlobal().metabox_fields.media.button_title},multiple:!1,library:{type:"image"}};break;default:a={title:Give.fn.getGlobal().metabox_fields.file.button_title,button:{text:Give.fn.getGlobal().metabox_fields.file.button_title},multiple:!1}}void 0!==jQuery(this).closest(".give-field-wrap").find(".give-input-field").attr("editing")&&(wp.media.controller.Library.prototype.defaults.contentUserSetting=!1);var r=jQuery(this).closest(".give-field-wrap").find(".give-input-field").attr("library");void 0!==r&&""!==r&&(a.library={type:r}),t=wp.media(a),t.on("select",function(){var e=t.state().get("selection").first().toJSON(),o=i.prev(),a="id"===i.data("fvalue")?e.id:e.url;if(n.trigger("give_media_inserted",[e,o]),o.val(a),"id"!==i.data("fvalue")){var r='input[name="'+o.attr("name")+'_id"]';o.closest("tr").next("tr").find(r).length&&o.closest("tr").next("tr").find(r).val(e.id)}}),t.open()}),n.on("give_media_inserted",function(t,n){var o=i.parents(".give-field-wrap"),a=e(".give-image-thumb",o);return!!a.length&&("image"!==n.type?(a.addClass("give-hidden"),e("img",a).attr("src",""),!1):(a.find("img").attr("src",n.url),void a.removeClass("give-hidden")))}),e("span.give-delete-image-thumb",".give-image-thumb").on("click",function(t){t.preventDefault();var i=e(this).parents(".give-field-wrap"),n=e(this).parent(),o=e('input[type="text"]',i);n.addClass("give-hidden"),o.val(""),e("img",n).attr("src","")})},setup_repeatable_fields:function(){jQuery(function(){jQuery(".give-repeatable-field-section").each(function(){var t=e(this),i={wrapper:".give-repeatable-fields-section-wrapper",container:".container",row:".give-row",add:".give-add-repeater-field-section-row",remove:".give-remove",move:".give-move",template:".give-template",confirm_before_remove_row:!0,confirm_before_remove_row_text:Give.fn.getGlobalVar("confirm_before_remove_row_text"),is_sortable:!0,before_add:null,after_add:w,before_remove:null,after_remove:k,sortable_options:{placeholder:"give-ui-placeholder-state-highlight",start:function(i,n){n.item.next().hasClass("give-template")&&n.item.next().after(n.item);var o=e(".give-row",t).not(".give-template");o.length&&o.each(function(t,i){var n=e('input[type="radio"].give-field',e(i));n.length&&n.each(function(){e(this).attr("data-give-checked",e(this).is(":checked"))})}),e("body").trigger("repeater_field_sorting_start",[n.item])},stop:function(t,i){i.item.next().hasClass("give-template")&&i.item.next().after(i.item),e("body").trigger("repeater_field_sorting_stop",[i.item])},update:function(i,n){n.item.next().hasClass("give-template")&&n.item.next().after(n.item);var o=e(".give-row",t).not(".give-template"),a=e(this).closest(".give-repeatable-fields-section-wrapper");if(o.length){var r=1;o.each(function(t,i){var n=e(".give-field, label",e(i));n.length&&n.each(function(){var t=e(this).parents(".give-field-wrap"),i=e(this);e.each(this.attributes,function(e,n){var o=this.value.replace(/\[/g,"_").replace(/]/g,""),a=o+"_field",s="",l="";this.value&&(this.value=this.value.replace(/\[\d+\]/g,"["+(r-1)+"]"),l=this.value.replace(/\[/g,"_").replace(/]/g,""),t.hasClass(a)&&(s=l+"_field",t.removeClass(a).addClass(s)),o==i.attr("id")&&i.attr("id",l))})}),r++}),window.setTimeout(function(){e("input[data-give-checked]",a).each(function(t,i){i=e(i),i.prop("checked","true"===i.attr("data-give-checked"))})},100),t.trigger("repeater_field_row_reordered",[n.item])}}}};jQuery(this).repeatable_fields(i)})})},handle_repeater_group_events:function(){var t=e(".give-repeatable-field-section"),i=e("body");i.on("click",".give-row-head button",function(){var t=e(this).closest("tr");t.toggleClass("closed"),e(".give-row-body",t).toggle()}),t.on("repeater_field_new_row_added repeater_field_row_deleted repeater_field_row_reordered",function(){C(e(this))}),i.on("repeater_field_sorting_start",function(t,i){var n=e(".wp-editor-area",i);n.length&&n.each(function(t,i){window.setTimeout(function(){tinyMCE.execCommand("mceRemoveEditor",!0,e(i).attr("id"))},300)})}),i.on("repeater_field_sorting_stop",function(t,i){var n=e(".wp-editor-area",i);n.length&&n.each(function(t,i){window.setTimeout(function(){var t=e(i).attr("id");tinyMCE.execCommand("mceAddEditor",!0,t),window.setTimeout(function(){switchEditors.go(t,"html"),e("#"+t+"-tmce").trigger("click")},100)},300)})}),t.each(function(t,i){var n=e(i);C(n),parseInt(n.data("close-tabs"))&&(e(".give-row-head button",n).trigger("click"),e(".give-template",n).removeClass("closed"),e(".give-template .give-row-body",n).show())}),t.on("repeater_field_new_row_added",function(t,i,n){e(".give-colorpicker",e(this)).each(function(t,i){var n=e(i);n.parents(".wp-picker-container").length||n.parents(".give-template").length||n.wpColorPicker()});var o=e("div[data-wp-editor]",n);o.length&&o.each(function(t,i){var n=e(i),o=e(".wp-editor-wrap",n),a=e("textarea",n),r="give_wysiwyg_unique_"+Math.random().toString().replace(".","_"),s=o.prev();a.attr("id",r),e.post(ajaxurl,{action:"give_load_wp_editor",wp_editor:n.data("wp-editor"),wp_editor_id:r,textarea_name:e("textarea",n).attr("name")},function(t){o.remove(),s.after(t),tinyMCEPreInit.qtInit[a.attr("id")]=e.extend(!0,tinyMCEPreInit.qtInit._give_agree_text,{id:r}),tinyMCEPreInit.mceInit[r]=e.extend(!0,tinyMCEPreInit.mceInit._give_agree_text,{body_class:r+" post-type-give_forms post-status-publish locale-"+tinyMCEPreInit.mceInit._give_agree_text.wp_lang_attr.toLowerCase(),selector:"#"+r}),tinymce.init(tinyMCEPreInit.mceInit[r]),quicktags(tinyMCEPreInit.qtInit[r]),QTags._buttonsInit(),window.setTimeout(function(){switchEditors.go(r,"html"),e("#"+r+"-tmce").trigger("click")},100),window.wpActiveEditor||(window.wpActiveEditor=r)})})})},handle_multi_levels_repeater_group_events:function(){var t=e("#_give_donation_levels_field");e("body").on("keyup",".give-multilevel-text-field",function(){var t=e(this).closest("tr"),i=e(".give-row-head h2 span",t),n=i.data("header-title");if(e(this).val()&&e(this).val()===i.html())return!1;e(this).val()?i.html(n+": "+e(this).val()):i.html(n)}),e(".give-multilevel-text-field").each(function(t,i){if(t){var n=e(i),o=n.closest("tr"),a=e(".give-row-head h2 span",o),r=a.data("header-title");if(n.val()&&n.val()===a.html())return!1;n.val()?a.html(r+": "+n.val()):a.html(r)}}),t.on("repeater_field_row_deleted",function(){var t=e(this);window.setTimeout(function(){var i=t,n=e(".give-row",i).not(".give-template"),o=e(".give-give_default_radio_inline",n);1===n.length&&o.prop("checked",!0)},200)}),t.on("repeater_field_new_row_added",function(t,i,n){var o=e(this),a=0;window.setTimeout(function(){!1===e(".give-give_default_radio_inline",o).is(":checked")&&e(".give-row",o).not(".give-template").first().find(".give-give_default_radio_inline").prop("checked",!0)},200),e('input[type="hidden"].give-levels_id',o).each(function(t,i){var n=e(i),o=parseInt(n.val());a<o&&(a=o)}),e('input[type="hidden"].give-levels_id',n).val(++a)})}},w=function(t,i){var n=e(t).attr("data-rf-row-count"),o=e(t),a=o.parents(".give-repeatable-field-section");n++,e("*",i).each(function(){e.each(this.attributes,function(e,t){this.value=this.value.replace("{{row-count-placeholder}}",n-1)})}),e(t).attr("data-rf-row-count",n),a.trigger("repeater_field_new_row_added",[t,i])},k=function(t){var i=e(t),n=i.parents(".give-repeatable-field-section"),o=e(t).attr("data-rf-row-count");i.attr("data-rf-row-count",--o),n.trigger("repeater_field_row_deleted")},C=function(t){if(parseInt(t.data("group-numbering"))){var i=e(".give-row-head h2 span",t),n=i.data("header-title");i.each(function(t,i){var o=e(i);o.parents(".give-template").length||o.html(n+": "+t)})}},j={onLoadPageNumber:"",init:function(){j.onLoadPageNumber=e("#current-page-selector").val(),e("body").on("click",'#give-payments-filter input[type="submit"]',this.handleBulkActions)},handleBulkActions:function(t){var i=e(this).closest(".tablenav").find("select").val(),n=e(this).closest(".tablenav").find('option[value="'+i+'"]').text(),o=e('input[name="payment[]"]:checked').length,r=-1!==i.indexOf("set-status-"),s="",l="",c=e("#current-page-selector").val();if(j.onLoadPageNumber!==c)return!0;if("-1"===(i=r?"set-to-status":i))return new a.GiveWarningAlert({modalContent:{title:Give.fn.getGlobal().donors_bulk_action.no_action_selected.title,desc:Give.fn.getGlobal().donors_bulk_action.no_action_selected.desc,cancelBtnTitle:Give.fn.getGlobalVar("ok")}}).render(),!1;if(Object.keys(Give.fn.getGlobalVar("donations_bulk_action")).length)for(l in Give.fn.getGlobalVar("donations_bulk_action"))if(l===i){if(s=r?Give.fn.getGlobal().donations_bulk_action[i].zero.replace("{status}",n.replace("Set To ","")):Give.fn.getGlobal().donations_bulk_action[i].zero,!parseInt(o))return new a.GiveWarningAlert({modalContent:{title:Give.fn.getGlobal().donations_bulk_action.titles.zero,desc:s,cancelBtnTitle:Give.fn.getGlobalVar("ok")}}).render(),!1;s=1<o?Give.fn.getGlobal().donations_bulk_action[i].multiple:Give.fn.getGlobal().donations_bulk_action[i].single,t.preventDefault(),new a.GiveConfirmModal({modalContent:{title:Give.fn.getGlobalVar("confirm_bulk_action"),desc:s.replace("{payment_count}",o).replace("{status}",n.replace("Set To ",""))},successConfirm:function(t){e("#give-payments-filter").submit()}}).render()}return!0}};e(function(){o(),c(),v(),d(),e.giveAjaxifyFields({type:"country_state",debug:!0}),u.init(),h.init(),f.init(),p.init(),b.init(),y.init(),g.init(),m.init(),_.init(),x.init(),j.init(),e("a.give-rating-link").click(function(){jQuery(this).parent().text(jQuery(this).data("rated"))}),e(".give-ajax-user-search").on("keyup",function(){var t=e(this).val(),i="";e(this).data("exclude")&&(i=e(this).data("exclude")),e(".give-ajax").show(),data={action:"give_search_users",user_name:t,exclude:i},document.body.style.cursor="wait",e.ajax({type:"POST",data:data,dataType:"json",url:ajaxurl,success:function(t){e(".give-ajax").hide(),e(".give_user_search_results").removeClass("hidden"),e(".give_user_search_results span").html(""),e(t.results).appendTo(".give_user_search_results span"),document.body.style.cursor="default"}})}),e("body").on("click.giveSelectUser",".give_user_search_results span a",function(t){t.preventDefault();var i=e(this).data("login");e(".give-ajax-user-search").val(i),e(".give_user_search_results").addClass("hidden"),e(".give_user_search_results span").html("")}),e("body").on("click.giveCancelUserSearch",".give_user_search_results a.give-ajax-user-cancel",function(t){t.preventDefault(),e(".give-ajax-user-search").val(""),e(".give_user_search_results").addClass("hidden"),e(".give_user_search_results span").html("")});var i=e("#poststuff"),a=Give.fn.getGlobalVar("thousands_separator"),r=Give.fn.getGlobalVar("decimal_separator"),s="",l="",w="",k=r===a?1:0;i.on("keyup","input.give-money-field, input.give-price-field",function(){var t={label:Give.fn.getGlobalVar("price_format_guide").trim()};s=(e(this).val().match(new RegExp(a,"g"))||[]).length,l=(e(this).val().match(new RegExp("[a-z]","g"))||[]).length,-1!==e(this).val().indexOf(a)&&k<s?e(this).giveHintCss("show",t):l?e(this).giveHintCss("show",t):e(this).giveHintCss("hide",t),s=l=""}),i.on("focusout","input.give-money-field, input.give-price-field",function(){if(w=t(e(this).val(),!1),e(this).giveHintCss("hide",{label:Give.fn.getGlobalVar("price_format_guide").trim()}),t("0",!1)===t(e(this).val(),!1)){var i=e(this).attr("placeholder");return i=i||"0",e(this).val(i),!1}w=w.replace(".",r),-1!==w.indexOf("-")&&(w=w.replace("-","")),e(this).val(w)}),i.on("focusout","#_give_number_of_donation_goal",function(){1>e(this).val()&&e(this).val(1)}),e(".give-settings-page").on("click","#give-show-sub-nav",function(t){t.preventDefault();var i=e(this).next();return i.is(":hover")||i.toggleClass("give-hidden"),!1}).on("blur","#give-show-sub-nav",function(){var t=e(this).next();t.is(":hover")||t.addClass("give-hidden")}),e(".give_email_api_notification_status_setting input").change(function(){var t=e(this).val(),i="enabled"===t,n={};return e(this).closest(".give_options_panel").length?n=e(this).closest(".give_options_panel").children(".give-field-wrap:not(.give_email_api_notification_status_setting), .give-repeatable-field-section"):e(this).closest("table").length&&(n=e(this).closest("table").find("tr:not(.give_email_api_notification_status_setting)")),-1!==jQuery.inArray(t,["enabled","disabled","global"])&&(!!n.length&&void(i?n.show():n.hide()))}),e(".give_email_api_notification_status_setting input:checked").change(),n()})}(jQuery),jQuery(window).resize(function(){n()})},function(e,t,i){"use strict";function n(){if(jQuery("body.give_forms_page_give-tools .give-tools-import-tab #give-import-core-settings-form table.step-2").length>0){var e=jQuery("form.tools-setting-page-import"),t=e.find(".give-progress");f=!0,jQuery.ajax({type:"POST",url:ajaxurl,data:{action:Give.fn.getGlobalVar("core_settings_import"),fields:e.serialize()},dataType:"json",success:function(e){if(f=!1,!0!==e.success)return void new h.GiveErrorAlert({modalContent:{title:Give.fn.getGlobalVar("import_failed"),desc:Give.fn.getGlobalVar("error_message"),cancelBtnTitle:Give.fn.getGlobalVar("ok")}}).render();jQuery(t).find("div").width(e.percentage+"%"),window.location=e.url},error:function(){f=!1,new h.GiveErrorAlert({modalContent:{title:Give.fn.getGlobalVar("import_failed"),desc:Give.fn.getGlobalVar("error_message"),cancelBtnTitle:Give.fn.getGlobalVar("ok")}}).render()}})}}function o(){var e="body.give_forms_page_give-tools .give-tools-import-tab #give-import-core-settings-form table.step-1 .is_json_valid";jQuery(e).length>0&&(window.location=jQuery(e).val())}function a(){jQuery("body.give_forms_page_give-tools .give-tools-import-tab #give-import-donations-form table.step-3").length>0&&l()}function r(){var e="body.give_forms_page_give-tools .give-tools-import-tab #give-import-donations-form table.step-2 .csv_not_valid";jQuery(e).length>0&&(window.location=jQuery(e).val())}function s(){var e="body.give_forms_page_give-tools .give-tools-import-tab #give-import-donations-form table.step-1 .is_csv_valid";jQuery(e).length>0&&(window.location=jQuery(e).val())}function l(){var e=jQuery("form.tools-setting-page-import");f=!0;var t=e.find(".give-progress"),i=jQuery(t).data("total_ajax"),n=jQuery(t).data("current"),o=jQuery(t).data("start"),a=jQuery(t).data("end"),r=jQuery(t).data("next"),s=jQuery(t).data("total"),c=jQuery(t).data("per_page");jQuery.ajax({type:"POST",url:ajaxurl,data:{action:Give.fn.getGlobalVar("give_donation_import"),total_ajax:i,current:n,start:o,end:a,next:r,total:s,per_page:c,fields:e.serialize()},dataType:"json",success:function(e){jQuery(t).data("current",e.current),jQuery(t).find("div").width(e.percentage+"%"),1==e.next?(jQuery(t).data("start",e.start),jQuery(t).data("end",e.end),1==e.last&&jQuery(t).data("next",!1),l()):(f=!1,window.location=e.url)},error:function(){f=!1,new h.GiveErrorAlert({modalContent:{title:Give.fn.getGlobalVar("import_failed"),desc:Give.fn.getGlobalVar("error_message"),cancelBtnTitle:Give.fn.getGlobalVar("ok")}}).render()}})}function c(){window.onload=function(){u(),d(),a(),s(),r(),n(),o()}}function d(){var e=document.querySelector(".give-tools-setting-page-import table.step-2 tbody select");"undefined"!==e&&null!==e&&jQuery(".give-tools-setting-page-import table.step-2 tbody").on("change","select",function(){u()})}function u(){var e=document.querySelector(".give-tools-setting-page-import table.step-2 .give-import-donation-required-fields");if("undefined"!==e&&null!==e){var t=!0,i=!1,n=!1,o=!1,a=!1;document.querySelectorAll(".give-import-donation-required-fields li").forEach(function(e){e.querySelector(".dashicons").classList.remove("dashicons-yes"),e.querySelector(".dashicons").classList.add("dashicons-no-alt")});var r=Array.from(document.querySelectorAll("table.step-2 tbody select")).map(function(e){return e.value});r.includes("email")&&(i=!0,document.querySelector(".give-import-donation-required-email .dashicons").classList.remove("dashicons-no-alt"),document.querySelector(".give-import-donation-required-email .dashicons").classList.add("dashicons-yes")),r.includes("first_name")&&(n=!0,document.querySelector(".give-import-donation-required-first .dashicons").classList.remove("dashicons-no-alt"),document.querySelector(".give-import-donation-required-first .dashicons").classList.add("dashicons-yes")),r.includes("amount")&&(o=!0,document.querySelector(".give-import-donation-required-amount .dashicons").classList.remove("dashicons-no-alt"),document.querySelector(".give-import-donation-required-amount .dashicons").classList.add("dashicons-yes")),(r.includes("form_id")||r.includes("form_title"))&&(a=!0,document.querySelector(".give-import-donation-required-form .dashicons").classList.remove("dashicons-no-alt"),document.querySelector(".give-import-donation-required-form .dashicons").classList.add("dashicons-yes")),i&&n&&o&&a&&(t=!1),document.getElementById("recount-stats-submit").disabled=t}}var h=i(10),f=!0;!function(e){e(function(){c()})}(jQuery)}])});
//# sourceMappingURL=admin.js.map