(function(n){n(["jquery"],function(n){return function(){function v(n,t,r){return u({type:f.error,iconClass:i().iconClasses.error,message:n,optionsOverride:r,title:t})}function r(r,u){return(r||(r=i()),t=n("#"+r.containerId),t.length)?t:(u&&(t=nt(r)),t)}function y(n,t,r){return u({type:f.info,iconClass:i().iconClasses.info,message:n,optionsOverride:r,title:t})}function p(n){o=n}function w(n,t,r){return u({type:f.success,iconClass:i().iconClasses.success,message:n,optionsOverride:r,title:t})}function b(n,t,r){return u({type:f.warning,iconClass:i().iconClasses.warning,message:n,optionsOverride:r,title:t})}function k(n){var u=i();t||r(u);s(n,u)||g(u)}function d(u){var f=i();if(t||r(f),u&&n(":focus",u).length===0){e(u);return}t.children().length&&t.remove()}function g(i){for(var u=t.children(),r=u.length-1;r>=0;r--)s(n(u[r]),i)}function s(t,i){return t&&n(":focus",t).length===0?(t[i.hideMethod]({duration:i.hideDuration,easing:i.hideEasing,complete:function(){e(t)}}),!0):!1}function nt(i){return t=n("<div/>").attr("id",i.containerId).addClass(i.positionClass).attr("aria-live","polite").attr("role","alert"),t.appendTo(n(i.target)),t}function tt(){return{tapToDismiss:!0,toastClass:"toast",containerId:"toast-container",debug:!1,showMethod:"fadeIn",showDuration:300,showEasing:"swing",onShown:undefined,hideMethod:"fadeOut",hideDuration:1e3,hideEasing:"swing",onHidden:undefined,extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},iconClass:"toast-info",positionClass:"toast-top-right",timeOut:5e3,titleClass:"toast-title",messageClass:"toast-message",target:"body",closeHtml:"<button>&times;<\/button>",newestOnTop:!0,preventDuplicates:!1,progressBar:!1}}function h(n){o&&o(n)}function u(u){function v(t){if(!n(":focus",o).length||t)return clearTimeout(s.intervalId),o[f.hideMethod]({duration:f.hideDuration,easing:f.hideEasing,complete:function(){e(o);f.onHidden&&l.state!=="hidden"&&f.onHidden();l.state="hidden";l.endTime=new Date;h(l)}})}function g(){(f.timeOut>0||f.extendedTimeOut>0)&&(w=setTimeout(v,f.extendedTimeOut),s.maxHideTime=parseFloat(f.extendedTimeOut),s.hideEta=(new Date).getTime()+s.maxHideTime)}function nt(){clearTimeout(w);s.hideEta=0;o.stop(!0,!0)[f.showMethod]({duration:f.showDuration,easing:f.showEasing})}function tt(){var n=(s.hideEta-(new Date).getTime())/s.maxHideTime*100;b.width(n+"%")}var f=i(),p=u.iconClass||f.iconClass;if(f.preventDuplicates){if(u.message===a)return;a=u.message}typeof u.optionsOverride!="undefined"&&(f=n.extend(f,u.optionsOverride),p=u.optionsOverride.iconClass||p);c++;t=r(f,!0);var w=null,o=n("<div/>"),k=n("<div/>"),d=n("<div/>"),b=n("<div/>"),y=n(f.closeHtml),s={intervalId:null,hideEta:null,maxHideTime:null},l={toastId:c,state:"visible",startTime:new Date,options:f,map:u};return u.iconClass&&o.addClass(f.toastClass).addClass(p),u.title&&(k.append(u.title).addClass(f.titleClass),o.append(k)),u.message&&(d.append(u.message).addClass(f.messageClass),o.append(d)),f.closeButton&&(y.addClass("toast-close-button").attr("role","button"),o.prepend(y)),f.progressBar&&(b.addClass("toast-progress"),o.prepend(b)),o.hide(),f.newestOnTop?t.prepend(o):t.append(o),o[f.showMethod]({duration:f.showDuration,easing:f.showEasing,complete:f.onShown}),f.timeOut>0&&(w=setTimeout(v,f.timeOut),s.maxHideTime=parseFloat(f.timeOut),s.hideEta=(new Date).getTime()+s.maxHideTime,f.progressBar&&(s.intervalId=setInterval(tt,10))),o.hover(nt,g),!f.onclick&&f.tapToDismiss&&o.click(v),f.closeButton&&y&&y.click(function(n){n.stopPropagation?n.stopPropagation():n.cancelBubble!==undefined&&n.cancelBubble!==!0&&(n.cancelBubble=!0);v(!0)}),f.onclick&&o.click(function(){f.onclick();v()}),h(l),f.debug&&console&&console.log(l),o}function i(){return n.extend({},tt(),l.options)}function e(n){(t||(t=r()),n.is(":visible"))||(n.remove(),n=null,t.children().length===0&&t.remove())}var t,o,c=0,f={error:"error",info:"info",success:"success",warning:"warning"},l={clear:k,remove:d,error:v,getContainer:r,info:y,options:{},subscribe:p,success:w,version:"2.1.0",warning:b},a;return l}()})})(typeof define=="function"&&define.amd?define:function(n,t){typeof module!="undefined"&&module.exports?module.exports=t(require("jquery")):window.toastr=t(window.jQuery)});toastr.options={closeButton:!0,debug:!1,newestOnTop:!1,progressBar:!0,positionClass:"toast-top-full-width",preventDuplicates:!1,onclick:null,showDuration:"300",hideDuration:"1000",timeOut:"10000",extendedTimeOut:"1000",showEasing:"swing",hideEasing:"linear",showMethod:"fadeIn",hideMethod:"fadeOut"},function(n){function g(n,t,i){switch(arguments.length){case 2:return null!=n?n:t;case 3:return null!=n?n:null!=t?t:i;default:throw new Error("Implement me");}}function p(n,t){return gu.call(n,t)}function st(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function ni(n){t.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+n)}function f(n,t){var i=!0;return w(function(){return i&&(ni(n),i=!1),t.apply(this,arguments)},t)}function br(n,t){pr[n]||(ni(t),pr[n]=!0)}function ti(n,t){return function(i){return r(n.call(this,i),t)}}function kr(n,t){return function(i){return this.localeData().ordinal(n.call(this,i),t)}}function ii(){}function rt(n,t){t!==!1&&ai(n);ri(this,n);this._d=new Date(+n._d)}function ht(n){var i=si(n),r=i.year||0,u=i.quarter||0,f=i.month||0,e=i.week||0,o=i.day||0,s=i.hour||0,h=i.minute||0,c=i.second||0,l=i.millisecond||0;this._milliseconds=+l+1e3*c+6e4*h+36e5*s;this._days=+o+7*e;this._months=+f+3*u+12*r;this._data={};this._locale=t.localeData();this._bubble()}function w(n,t){for(var i in t)p(t,i)&&(n[i]=t[i]);return p(t,"toString")&&(n.toString=t.toString),p(t,"valueOf")&&(n.valueOf=t.valueOf),n}function ri(n,t){var u,i,r;if("undefined"!=typeof t._isAMomentObject&&(n._isAMomentObject=t._isAMomentObject),"undefined"!=typeof t._i&&(n._i=t._i),"undefined"!=typeof t._f&&(n._f=t._f),"undefined"!=typeof t._l&&(n._l=t._l),"undefined"!=typeof t._strict&&(n._strict=t._strict),"undefined"!=typeof t._tzm&&(n._tzm=t._tzm),"undefined"!=typeof t._isUTC&&(n._isUTC=t._isUTC),"undefined"!=typeof t._offset&&(n._offset=t._offset),"undefined"!=typeof t._pf&&(n._pf=t._pf),"undefined"!=typeof t._locale&&(n._locale=t._locale),et.length>0)for(u in et)i=et[u],r=t[i],"undefined"!=typeof r&&(n[i]=r);return n}function e(n){return 0>n?Math.ceil(n):Math.floor(n)}function r(n,t,i){for(var r=""+Math.abs(n),u=n>=0;r.length<t;)r="0"+r;return(u?i?"+":"":"-")+r}function ui(n,t){var i={milliseconds:0,months:0};return i.months=t.month()-n.month()+12*(t.year()-n.year()),n.clone().add(i.months,"M").isAfter(t)&&--i.months,i.milliseconds=+t-+n.clone().add(i.months,"M"),i}function dr(n,t){var i;return t=ft(t,n),n.isBefore(t)?i=ui(n,t):(i=ui(t,n),i.milliseconds=-i.milliseconds,i.months=-i.months),i}function fi(n,i){return function(r,u){var f,e;return null===u||isNaN(+u)||(br(i,"moment()."+i+"(period, number) is deprecated. Please use moment()."+i+"(number, period)."),e=r,r=u,u=e),r="string"==typeof r?+r:r,f=t.duration(r,u),ei(this,f,n),this}}function ei(n,i,r,u){var o=i._milliseconds,f=i._days,e=i._months;u=null==u?!0:u;o&&n._d.setTime(+n._d+o*r);f&&tr(n,"Date",pt(n,"Date")+f*r);e&&nr(n,pt(n,"Month")+e*r);u&&t.updateOffset(n,f||e)}function ut(n){return"[object Array]"===Object.prototype.toString.call(n)}function gr(n){return"[object Date]"===Object.prototype.toString.call(n)||n instanceof Date}function oi(n,t,r){for(var e=Math.min(n.length,t.length),o=Math.abs(n.length-t.length),f=0,u=0;e>u;u++)(r&&n[u]!==t[u]||!r&&i(n[u])!==i(t[u]))&&f++;return f+o}function s(n){if(n){var t=n.toLowerCase().replace(/(.)s$/,"$1");n=bf[n]||kf[t]||t}return n}function si(n){var i,t,r={};for(t in n)p(n,t)&&(i=s(t),i&&(r[i]=n[t]));return r}function nu(i){var r,u;if(0===i.indexOf("week"))r=7,u="day";else{if(0!==i.indexOf("month"))return;r=12;u="month"}t[i]=function(f,e){var o,s,c=t._locale[i],h=[];if("number"==typeof f&&(e=f,f=n),s=function(n){var i=t().utc().set(u,n);return c.call(t._locale,i,f||"")},null!=e)return s(e);for(o=0;r>o;o++)h.push(s(o));return h}}function i(n){var t=+n,i=0;return 0!==t&&isFinite(t)&&(i=t>=0?Math.floor(t):Math.ceil(t)),i}function ct(n,t){return new Date(Date.UTC(n,t+1,0)).getUTCDate()}function hi(n,i,r){return b(t([n,11,31+i-r]),i,r).week}function ci(n){return li(n)?366:365}function li(n){return n%4==0&&n%100!=0||n%400==0}function ai(n){var t;n._a&&-2===n._pf.overflow&&(t=n._a[l]<0||n._a[l]>11?l:n._a[o]<1||n._a[o]>ct(n._a[c],n._a[l])?o:n._a[a]<0||n._a[a]>23?a:n._a[nt]<0||n._a[nt]>59?nt:n._a[tt]<0||n._a[tt]>59?tt:n._a[it]<0||n._a[it]>999?it:-1,n._pf._overflowDayOfYear&&(c>t||t>o)&&(t=o),n._pf.overflow=t)}function vi(n){return null==n._isValid&&(n._isValid=!isNaN(n._d.getTime())&&n._pf.overflow<0&&!n._pf.empty&&!n._pf.invalidMonth&&!n._pf.nullInput&&!n._pf.invalidFormat&&!n._pf.userInvalidated,n._strict&&(n._isValid=n._isValid&&0===n._pf.charsLeftOver&&0===n._pf.unusedTokens.length)),n._isValid}function yi(n){return n?n.toLowerCase().replace("_","-"):n}function tu(n){for(var i,t,f,r,u=0;u<n.length;){for(r=yi(n[u]).split("-"),i=r.length,t=yi(n[u+1]),t=t?t.split("-"):null;i>0;){if(f=pi(r.slice(0,i).join("-")))return f;if(t&&t.length>=i&&oi(r,t,!0)>=i-1)break;i--}u++}return null}function pi(n){var i=null;if(!d[n]&&er)try{i=t.locale();require("./locale/"+n);t.locale(i)}catch(r){}return d[n]}function ft(n,i){return i._isUTC?t(n).zone(i._offset||0):t(n).local()}function iu(n){return n.match(/\[[\s\S]/)?n.replace(/^\[|\]$/g,""):n.replace(/\\/g,"")}function ru(n){for(var i=n.match(or),t=0,r=i.length;r>t;t++)i[t]=v[i[t]]?v[i[t]]:iu(i[t]);return function(u){var f="";for(t=0;r>t;t++)f+=i[t]instanceof Function?i[t].call(u,n):i[t];return f}}function lt(n,t){return n.isValid()?(t=wi(t,n.localeData()),gt[t]||(gt[t]=ru(t)),gt[t](n)):n.localeData().invalidDate()}function wi(n,t){function r(n){return t.longDateFormat(n)||n}var i=5;for(ot.lastIndex=0;i>=0&&ot.test(n);)n=n.replace(ot,r),ot.lastIndex=0,i-=1;return n}function uu(n,t){var i=t._strict;switch(n){case"Q":return hr;case"DDDD":return lr;case"YYYY":case"GGGG":case"gggg":return i?af:ff;case"Y":case"G":case"g":return yf;case"YYYYYY":case"YYYYY":case"GGGGG":case"ggggg":return i?vf:ef;case"S":if(i)return hr;case"SS":if(i)return cr;case"SSS":if(i)return lr;case"DDD":return uf;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":return sf;case"a":case"A":return t._locale._meridiemParse;case"X":return cf;case"Z":case"ZZ":return bt;case"T":return hf;case"SSSS":return of;case"MM":case"DD":case"YY":case"GG":case"gg":case"HH":case"hh":case"mm":case"ss":case"ww":case"WW":return i?cr:sr;case"M":case"D":case"d":case"H":case"h":case"m":case"s":case"w":case"W":case"e":case"E":return sr;case"Do":return lf;default:return new RegExp(cu(hu(n.replace("\\","")),"i"))}}function bi(n){n=n||"";var r=n.match(bt)||[],f=r[r.length-1]||[],t=(f+"").match(wf)||["-",0,0],u=+(60*t[1])+i(t[2]);return"+"===t[0]?-u:u}function fu(n,r,u){var e,f=u._a;switch(n){case"Q":null!=r&&(f[l]=3*(i(r)-1));break;case"M":case"MM":null!=r&&(f[l]=i(r)-1);break;case"MMM":case"MMMM":e=u._locale.monthsParse(r);null!=e?f[l]=e:u._pf.invalidMonth=r;break;case"D":case"DD":null!=r&&(f[o]=i(r));break;case"Do":null!=r&&(f[o]=i(parseInt(r,10)));break;case"DDD":case"DDDD":null!=r&&(u._dayOfYear=i(r));break;case"YY":f[c]=t.parseTwoDigitYear(r);break;case"YYYY":case"YYYYY":case"YYYYYY":f[c]=i(r);break;case"a":case"A":u._isPm=u._locale.isPM(r);break;case"H":case"HH":case"h":case"hh":f[a]=i(r);break;case"m":case"mm":f[nt]=i(r);break;case"s":case"ss":f[tt]=i(r);break;case"S":case"SS":case"SSS":case"SSSS":f[it]=i(1e3*("0."+r));break;case"X":u._d=new Date(1e3*parseFloat(r));break;case"Z":case"ZZ":u._useUTC=!0;u._tzm=bi(r);break;case"dd":case"ddd":case"dddd":e=u._locale.weekdaysParse(r);null!=e?(u._w=u._w||{},u._w.d=e):u._pf.invalidWeekday=r;break;case"w":case"ww":case"W":case"WW":case"d":case"e":case"E":n=n.substr(0,1);case"gggg":case"GGGG":case"GGGGG":n=n.substr(0,2);r&&(u._w=u._w||{},u._w[n]=i(r));break;case"gg":case"GG":u._w=u._w||{};u._w[n]=t.parseTwoDigitYear(r)}}function eu(n){var i,o,f,u,r,e,s;i=n._w;null!=i.GG||null!=i.W||null!=i.E?(r=1,e=4,o=g(i.GG,n._a[c],b(t(),1,4).year),f=g(i.W,1),u=g(i.E,1)):(r=n._locale._week.dow,e=n._locale._week.doy,o=g(i.gg,n._a[c],b(t(),r,e).year),f=g(i.w,1),null!=i.d?(u=i.d,r>u&&++f):u=null!=i.e?i.e+r:r);s=ku(o,f,u,e,r);n._a[c]=s.year;n._dayOfYear=s.dayOfYear}function at(n){var t,i,r,u,f=[];if(!n._d){for(r=su(n),n._w&&null==n._a[o]&&null==n._a[l]&&eu(n),n._dayOfYear&&(u=g(n._a[c],r[c]),n._dayOfYear>ci(u)&&(n._pf._overflowDayOfYear=!0),i=yt(u,0,n._dayOfYear),n._a[l]=i.getUTCMonth(),n._a[o]=i.getUTCDate()),t=0;3>t&&null==n._a[t];++t)n._a[t]=f[t]=r[t];for(;7>t;t++)n._a[t]=f[t]=null==n._a[t]?2===t?1:0:n._a[t];n._d=(n._useUTC?yt:yu).apply(null,f);null!=n._tzm&&n._d.setUTCMinutes(n._d.getUTCMinutes()+n._tzm)}}function ou(n){var t;n._d||(t=si(n._i),n._a=[t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond],at(n))}function su(n){var t=new Date;return n._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function vt(n){if(n._f===t.ISO_8601)return void ki(n);n._a=[];n._pf.empty=!0;for(var i,u,o,r=""+n._i,h=r.length,s=0,e=wi(n._f,n._locale).match(or)||[],f=0;f<e.length;f++)u=e[f],i=(r.match(uu(u,n))||[])[0],i&&(o=r.substr(0,r.indexOf(i)),o.length>0&&n._pf.unusedInput.push(o),r=r.slice(r.indexOf(i)+i.length),s+=i.length),v[u]?(i?n._pf.empty=!1:n._pf.unusedTokens.push(u),fu(u,i,n)):n._strict&&!i&&n._pf.unusedTokens.push(u);n._pf.charsLeftOver=h-s;r.length>0&&n._pf.unusedInput.push(r);n._isPm&&n._a[a]<12&&(n._a[a]+=12);n._isPm===!1&&12===n._a[a]&&(n._a[a]=0);at(n);ai(n)}function hu(n){return n.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(n,t,i,r,u){return t||i||r||u})}function cu(n){return n.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function lu(n){var t,f,u,r,i;if(0===n._f.length)return n._pf.invalidFormat=!0,void(n._d=new Date(NaN));for(r=0;r<n._f.length;r++)i=0,t=ri({},n),t._pf=st(),t._f=n._f[r],vt(t),vi(t)&&(i+=t._pf.charsLeftOver,i+=10*t._pf.unusedTokens.length,t._pf.score=i,(null==u||u>i)&&(u=i,f=t));w(n,f||t)}function ki(n){var t,i,r=n._i,u=pf.exec(r);if(u){for(n._pf.iso=!0,t=0,i=kt.length;i>t;t++)if(kt[t][1].exec(r)){n._f=kt[t][0]+(u[6]||" ");break}for(t=0,i=dt.length;i>t;t++)if(dt[t][1].exec(r)){n._f+=dt[t][0];break}r.match(bt)&&(n._f+="Z");vt(n)}else n._isValid=!1}function au(n){ki(n);n._isValid===!1&&(delete n._isValid,t.createFromInputFallback(n))}function vu(i){var u,r=i._i;r===n?i._d=new Date:gr(r)?i._d=new Date(+r):null!==(u=nf.exec(r))?i._d=new Date(+u[1]):"string"==typeof r?au(i):ut(r)?(i._a=r.slice(0),at(i)):"object"==typeof r?ou(i):"number"==typeof r?i._d=new Date(r):t.createFromInputFallback(i)}function yu(n,t,i,r,u,f,e){var o=new Date(n,t,i,r,u,f,e);return 1970>n&&o.setFullYear(n),o}function yt(n){var t=new Date(Date.UTC.apply(null,arguments));return 1970>n&&t.setUTCFullYear(n),t}function pu(n,t){if("string"==typeof n)if(isNaN(n)){if(n=t.weekdaysParse(n),"number"!=typeof n)return null}else n=parseInt(n,10);return n}function wu(n,t,i,r,u){return u.relativeTime(t||1,!!i,n,r)}function bu(n,i,r){var u=t.duration(n).abs(),c=k(u.as("s")),e=k(u.as("m")),o=k(u.as("h")),s=k(u.as("d")),h=k(u.as("M")),l=k(u.as("y")),f=c<y.s&&["s",c]||1===e&&["m"]||e<y.m&&["mm",e]||1===o&&["h"]||o<y.h&&["hh",o]||1===s&&["d"]||s<y.d&&["dd",s]||1===h&&["M"]||h<y.M&&["MM",h]||1===l&&["y"]||["yy",l];return f[2]=i,f[3]=+n>0,f[4]=r,wu.apply({},f)}function b(n,i,r){var f,e=r-i,u=r-n.day();return u>e&&(u-=7),e-7>u&&(u+=7),f=t(n).add(u,"d"),{week:Math.ceil(f.dayOfYear()/7),year:f.year()}}function ku(n,t,i,r,u){var o,e,f=yt(n,0,1).getUTCDay();return f=0===f?7:f,i=null!=i?i:u,o=u-f+(f>r?7:0)-(u>f?7:0),e=7*(t-1)+(i-u)+o+1,{year:e>0?n:n-1,dayOfYear:e>0?e:ci(n-1)+e}}function di(i){var r=i._i,u=i._f;return i._locale=i._locale||t.localeData(i._l),null===r||u===n&&""===r?t.invalid({nullInput:!0}):("string"==typeof r&&(i._i=r=i._locale.preparse(r)),t.isMoment(r)?new rt(r,!0):(u?ut(u)?lu(i):vt(i):vu(i),new rt(i)))}function gi(n,i){var u,r;if(1===i.length&&ut(i[0])&&(i=i[0]),!i.length)return t();for(u=i[0],r=1;r<i.length;++r)i[r][n](u)&&(u=i[r]);return u}function nr(n,t){var i;return"string"==typeof t&&(t=n.localeData().monthsParse(t),"number"!=typeof t)?n:(i=Math.min(n.date(),ct(n.year(),t)),n._d["set"+(n._isUTC?"UTC":"")+"Month"](t,i),n)}function pt(n,t){return n._d["get"+(n._isUTC?"UTC":"")+t]()}function tr(n,t,i){return"Month"===t?nr(n,i):n._d["set"+(n._isUTC?"UTC":"")+t](i)}function h(n,i){return function(r){return null!=r?(tr(this,n,r),t.updateOffset(this,i),this):pt(this,n)}}function ir(n){return 400*n/146097}function rr(n){return 146097*n/400}function du(n){t.duration.fn[n]=function(){return this._data[n]}}function ur(n){"undefined"==typeof ender&&(fr=wt.moment,wt.moment=n?f("Accessing Moment through the global scope is deprecated, and will be removed in an upcoming release.",t):t)}for(var t,fr,u,wt="undefined"!=typeof global?global:this,k=Math.round,gu=Object.prototype.hasOwnProperty,c=0,l=1,o=2,a=3,nt=4,tt=5,it=6,d={},et=[],er="undefined"!=typeof module&&module.exports,nf=/^\/?Date\((\-?\d+)/i,tf=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,rf=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/,or=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|X|zz?|ZZ?|.)/g,ot=/(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,sr=/\d\d?/,uf=/\d{1,3}/,ff=/\d{1,4}/,ef=/[+\-]?\d{1,6}/,of=/\d+/,sf=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,bt=/Z|[\+\-]\d\d:?\d\d/gi,hf=/T/i,cf=/[\+\-]?\d+(\.\d{1,3})?/,lf=/\d{1,2}/,hr=/\d/,cr=/\d\d/,lr=/\d{3}/,af=/\d{4}/,vf=/[+-]?\d{6}/,yf=/[+-]?\d+/,pf=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,kt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],dt=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],wf=/([\+\-]|\d\d)/gi,ar=("Date|Hours|Minutes|Seconds|Milliseconds".split("|"),{Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6}),bf={ms:"millisecond",s:"second",m:"minute",h:"hour",d:"day",D:"date",w:"week",W:"isoWeek",M:"month",Q:"quarter",y:"year",DDD:"dayOfYear",e:"weekday",E:"isoWeekday",gg:"weekYear",GG:"isoWeekYear"},kf={dayofyear:"dayOfYear",isoweekday:"isoWeekday",isoweek:"isoWeek",weekyear:"weekYear",isoweekyear:"isoWeekYear"},gt={},y={s:45,m:45,h:22,d:26,M:11},vr="DDD w W M D d".split(" "),yr="M D H h m s w W".split(" "),v={M:function(){return this.month()+1},MMM:function(n){return this.localeData().monthsShort(this,n)},MMMM:function(n){return this.localeData().months(this,n)},D:function(){return this.date()},DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(n){return this.localeData().weekdaysMin(this,n)},ddd:function(n){return this.localeData().weekdaysShort(this,n)},dddd:function(n){return this.localeData().weekdays(this,n)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return r(this.year()%100,2)},YYYY:function(){return r(this.year(),4)},YYYYY:function(){return r(this.year(),5)},YYYYYY:function(){var n=this.year(),t=n>=0?"+":"-";return t+r(Math.abs(n),6)},gg:function(){return r(this.weekYear()%100,2)},gggg:function(){return r(this.weekYear(),4)},ggggg:function(){return r(this.weekYear(),5)},GG:function(){return r(this.isoWeekYear()%100,2)},GGGG:function(){return r(this.isoWeekYear(),4)},GGGGG:function(){return r(this.isoWeekYear(),5)},e:function(){return this.weekday()},E:function(){return this.isoWeekday()},a:function(){return this.localeData().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.localeData().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return i(this.milliseconds()/100)},SS:function(){return r(i(this.milliseconds()/10),2)},SSS:function(){return r(this.milliseconds(),3)},SSSS:function(){return r(this.milliseconds(),3)},Z:function(){var n=-this.zone(),t="+";return 0>n&&(n=-n,t="-"),t+r(i(n/60),2)+":"+r(i(n)%60,2)},ZZ:function(){var n=-this.zone(),t="+";return 0>n&&(n=-n,t="-"),t+r(i(n/60),2)+r(i(n)%60,2)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},X:function(){return this.unix()},Q:function(){return this.quarter()}},pr={},wr=["months","monthsShort","weekdays","weekdaysShort","weekdaysMin"];vr.length;)u=vr.pop(),v[u+"o"]=kr(v[u],u);for(;yr.length;)u=yr.pop(),v[u+u]=ti(v[u],2);for(v.DDDD=ti(v.DDD,3),w(ii.prototype,{set:function(n){var t,i;for(i in n)t=n[i],"function"==typeof t?this[i]=t:this["_"+i]=t},_months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),months:function(n){return this._months[n.month()]},_monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),monthsShort:function(n){return this._monthsShort[n.month()]},monthsParse:function(n){var i,r,u;for(this._monthsParse||(this._monthsParse=[]),i=0;12>i;i++)if(this._monthsParse[i]||(r=t.utc([2e3,i]),u="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[i]=new RegExp(u.replace(".",""),"i")),this._monthsParse[i].test(n))return i},_weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdays:function(n){return this._weekdays[n.day()]},_weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysShort:function(n){return this._weekdaysShort[n.day()]},_weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),weekdaysMin:function(n){return this._weekdaysMin[n.day()]},weekdaysParse:function(n){var i,r,u;for(this._weekdaysParse||(this._weekdaysParse=[]),i=0;7>i;i++)if(this._weekdaysParse[i]||(r=t([2e3,1]).day(i),u="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[i]=new RegExp(u.replace(".",""),"i")),this._weekdaysParse[i].test(n))return i},_longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY LT",LLLL:"dddd, MMMM D, YYYY LT"},longDateFormat:function(n){var t=this._longDateFormat[n];return!t&&this._longDateFormat[n.toUpperCase()]&&(t=this._longDateFormat[n.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(n){return n.slice(1)}),this._longDateFormat[n]=t),t},isPM:function(n){return"p"===(n+"").toLowerCase().charAt(0)},_meridiemParse:/[ap]\.?m?\.?/i,meridiem:function(n,t,i){return n>11?i?"pm":"PM":i?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},calendar:function(n,t){var i=this._calendar[n];return"function"==typeof i?i.apply(t):i},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},relativeTime:function(n,t,i,r){var u=this._relativeTime[i];return"function"==typeof u?u(n,t,i,r):u.replace(/%d/i,n)},pastFuture:function(n,t){var i=this._relativeTime[n>0?"future":"past"];return"function"==typeof i?i(t):i.replace(/%s/i,t)},ordinal:function(n){return this._ordinal.replace("%d",n)},_ordinal:"%d",preparse:function(n){return n},postformat:function(n){return n},week:function(n){return b(n,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6},_invalidDate:"Invalid date",invalidDate:function(){return this._invalidDate}}),t=function(t,i,r,u){var f;return"boolean"==typeof r&&(u=r,r=n),f={},f._isAMomentObject=!0,f._i=t,f._f=i,f._l=r,f._strict=u,f._isUTC=!1,f._pf=st(),di(f)},t.suppressDeprecationWarnings=!1,t.createFromInputFallback=f("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(n){n._d=new Date(n._i)}),t.min=function(){var n=[].slice.call(arguments,0);return gi("isBefore",n)},t.max=function(){var n=[].slice.call(arguments,0);return gi("isAfter",n)},t.utc=function(t,i,r,u){var f;return"boolean"==typeof r&&(u=r,r=n),f={},f._isAMomentObject=!0,f._useUTC=!0,f._isUTC=!0,f._l=r,f._i=t,f._f=i,f._strict=u,f._pf=st(),di(f).utc()},t.unix=function(n){return t(1e3*n)},t.duration=function(n,r){var e,h,s,c,f=n,u=null;return t.isDuration(n)?f={ms:n._milliseconds,d:n._days,M:n._months}:"number"==typeof n?(f={},r?f[r]=n:f.milliseconds=n):(u=tf.exec(n))?(e="-"===u[1]?-1:1,f={y:0,d:i(u[o])*e,h:i(u[a])*e,m:i(u[nt])*e,s:i(u[tt])*e,ms:i(u[it])*e}):(u=rf.exec(n))?(e="-"===u[1]?-1:1,s=function(n){var t=n&&parseFloat(n.replace(",","."));return(isNaN(t)?0:t)*e},f={y:s(u[2]),M:s(u[3]),d:s(u[4]),h:s(u[5]),m:s(u[6]),s:s(u[7]),w:s(u[8])}):"object"==typeof f&&("from"in f||"to"in f)&&(c=dr(t(f.from),t(f.to)),f={},f.ms=c.milliseconds,f.M=c.months),h=new ht(f),t.isDuration(n)&&p(n,"_locale")&&(h._locale=n._locale),h},t.version="2.8.2",t.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",t.ISO_8601=function(){},t.momentProperties=et,t.updateOffset=function(){},t.relativeTimeThreshold=function(t,i){return y[t]===n?!1:i===n?y[t]:(y[t]=i,!0)},t.lang=f("moment.lang is deprecated. Use moment.locale instead.",function(n,i){return t.locale(n,i)}),t.locale=function(n,i){var r;return n&&(r="undefined"!=typeof i?t.defineLocale(n,i):t.localeData(n),r&&(t.duration._locale=t._locale=r)),t._locale._abbr},t.defineLocale=function(n,i){return null!==i?(i.abbr=n,d[n]||(d[n]=new ii),d[n].set(i),t.locale(n),d[n]):(delete d[n],null)},t.langData=f("moment.langData is deprecated. Use moment.localeData instead.",function(n){return t.localeData(n)}),t.localeData=function(n){var i;if(n&&n._locale&&n._locale._abbr&&(n=n._locale._abbr),!n)return t._locale;if(!ut(n)){if(i=pi(n))return i;n=[n]}return tu(n)},t.isMoment=function(n){return n instanceof rt||null!=n&&p(n,"_isAMomentObject")},t.isDuration=function(n){return n instanceof ht},u=wr.length-1;u>=0;--u)nu(wr[u]);t.normalizeUnits=function(n){return s(n)};t.invalid=function(n){var i=t.utc(NaN);return null!=n?w(i._pf,n):i._pf.userInvalidated=!0,i};t.parseZone=function(){return t.apply(null,arguments).parseZone()};t.parseTwoDigitYear=function(n){return i(n)+(i(n)>68?1900:2e3)};w(t.fn=rt.prototype,{clone:function(){return t(this)},valueOf:function(){return+this._d+6e4*(this._offset||0)},unix:function(){return Math.floor(+this/1e3)},toString:function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){var n=t(this).utc();return 0<n.year()&&n.year()<=9999?lt(n,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):lt(n,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},toArray:function(){var n=this;return[n.year(),n.month(),n.date(),n.hours(),n.minutes(),n.seconds(),n.milliseconds()]},isValid:function(){return vi(this)},isDSTShifted:function(){return this._a?this.isValid()&&oi(this._a,(this._isUTC?t.utc(this._a):t(this._a)).toArray())>0:!1},parsingFlags:function(){return w({},this._pf)},invalidAt:function(){return this._pf.overflow},utc:function(n){return this.zone(0,n)},local:function(n){return this._isUTC&&(this.zone(0,n),this._isUTC=!1,n&&this.add(this._d.getTimezoneOffset(),"m")),this},format:function(n){var i=lt(this,n||t.defaultFormat);return this.localeData().postformat(i)},add:fi(1,"add"),subtract:fi(-1,"subtract"),diff:function(n,i,r){var u,o,f=ft(n,this),h=6e4*(this.zone()-f.zone());return i=s(i),"year"===i||"month"===i?(u=432e5*(this.daysInMonth()+f.daysInMonth()),o=12*(this.year()-f.year())+(this.month()-f.month()),o+=(this-t(this).startOf("month")-(f-t(f).startOf("month")))/u,o-=6e4*(this.zone()-t(this).startOf("month").zone()-(f.zone()-t(f).startOf("month").zone()))/u,"year"===i&&(o/=12)):(u=this-f,o="second"===i?u/1e3:"minute"===i?u/6e4:"hour"===i?u/36e5:"day"===i?(u-h)/864e5:"week"===i?(u-h)/6048e5:u),r?o:e(o)},from:function(n,i){return t.duration({to:this,from:n}).locale(this.locale()).humanize(!i)},fromNow:function(n){return this.from(t(),n)},calendar:function(n){var r=n||t(),u=ft(r,this).startOf("day"),i=this.diff(u,"days",!0),f=-6>i?"sameElse":-1>i?"lastWeek":0>i?"lastDay":1>i?"sameDay":2>i?"nextDay":7>i?"nextWeek":"sameElse";return this.format(this.localeData().calendar(f,this))},isLeapYear:function(){return li(this.year())},isDST:function(){return this.zone()<this.clone().month(0).zone()||this.zone()<this.clone().month(5).zone()},day:function(n){var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=n?(n=pu(n,this.localeData()),this.add(n-t,"d")):t},month:h("Month",!0),startOf:function(n){switch(n=s(n)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===n?this.weekday(0):"isoWeek"===n&&this.isoWeekday(1),"quarter"===n&&this.month(3*Math.floor(this.month()/3)),this},endOf:function(n){return n=s(n),this.startOf(n).add(1,"isoWeek"===n?"week":n).subtract(1,"ms")},isAfter:function(n,i){return i="undefined"!=typeof i?i:"millisecond",+this.clone().startOf(i)>+t(n).startOf(i)},isBefore:function(n,i){return i="undefined"!=typeof i?i:"millisecond",+this.clone().startOf(i)<+t(n).startOf(i)},isSame:function(n,t){return t=t||"ms",+this.clone().startOf(t)==+ft(n,this).startOf(t)},min:f("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(n){return n=t.apply(null,arguments),this>n?this:n}),max:f("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(n){return n=t.apply(null,arguments),n>this?this:n}),zone:function(n,i){var r,u=this._offset||0;return null==n?this._isUTC?u:this._d.getTimezoneOffset():("string"==typeof n&&(n=bi(n)),Math.abs(n)<16&&(n=60*n),!this._isUTC&&i&&(r=this._d.getTimezoneOffset()),this._offset=n,this._isUTC=!0,null!=r&&this.subtract(r,"m"),u!==n&&(!i||this._changeInProgress?ei(this,t.duration(u-n,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,t.updateOffset(this,!0),this._changeInProgress=null)),this)},zoneAbbr:function(){return this._isUTC?"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},parseZone:function(){return this._tzm?this.zone(this._tzm):"string"==typeof this._i&&this.zone(this._i),this},hasAlignedHourOffset:function(n){return n=n?t(n).zone():0,(this.zone()-n)%60==0},daysInMonth:function(){return ct(this.year(),this.month())},dayOfYear:function(n){var i=k((t(this).startOf("day")-t(this).startOf("year"))/864e5)+1;return null==n?i:this.add(n-i,"d")},quarter:function(n){return null==n?Math.ceil((this.month()+1)/3):this.month(3*(n-1)+this.month()%3)},weekYear:function(n){var t=b(this,this.localeData()._week.dow,this.localeData()._week.doy).year;return null==n?t:this.add(n-t,"y")},isoWeekYear:function(n){var t=b(this,1,4).year;return null==n?t:this.add(n-t,"y")},week:function(n){var t=this.localeData().week(this);return null==n?t:this.add(7*(n-t),"d")},isoWeek:function(n){var t=b(this,1,4).week;return null==n?t:this.add(7*(n-t),"d")},weekday:function(n){var t=(this.day()+7-this.localeData()._week.dow)%7;return null==n?t:this.add(n-t,"d")},isoWeekday:function(n){return null==n?this.day()||7:this.day(this.day()%7?n:n-7)},isoWeeksInYear:function(){return hi(this.year(),1,4)},weeksInYear:function(){var n=this.localeData()._week;return hi(this.year(),n.dow,n.doy)},get:function(n){return n=s(n),this[n]()},set:function(n,t){return n=s(n),"function"==typeof this[n]&&this[n](t),this},locale:function(i){return i===n?this._locale._abbr:(this._locale=t.localeData(i),this)},lang:f("moment().lang() is deprecated. Use moment().localeData() instead.",function(i){return i===n?this.localeData():(this._locale=t.localeData(i),this)}),localeData:function(){return this._locale}});t.fn.millisecond=t.fn.milliseconds=h("Milliseconds",!1);t.fn.second=t.fn.seconds=h("Seconds",!1);t.fn.minute=t.fn.minutes=h("Minutes",!1);t.fn.hour=t.fn.hours=h("Hours",!0);t.fn.date=h("Date",!0);t.fn.dates=f("dates accessor is deprecated. Use date instead.",h("Date",!0));t.fn.year=h("FullYear",!0);t.fn.years=f("years accessor is deprecated. Use year instead.",h("FullYear",!0));t.fn.days=t.fn.day;t.fn.months=t.fn.month;t.fn.weeks=t.fn.week;t.fn.isoWeeks=t.fn.isoWeek;t.fn.quarters=t.fn.quarter;t.fn.toJSON=t.fn.toISOString;w(t.duration.fn=ht.prototype,{_bubble:function(){var u,f,o,s=this._milliseconds,t=this._days,i=this._months,n=this._data,r=0;n.milliseconds=s%1e3;u=e(s/1e3);n.seconds=u%60;f=e(u/60);n.minutes=f%60;o=e(f/60);n.hours=o%24;t+=e(o/24);r=e(ir(t));t-=e(rr(r));i+=e(t/30);t%=30;r+=e(i/12);i%=12;n.days=t;n.months=i;n.years=r},abs:function(){return this._milliseconds=Math.abs(this._milliseconds),this._days=Math.abs(this._days),this._months=Math.abs(this._months),this._data.milliseconds=Math.abs(this._data.milliseconds),this._data.seconds=Math.abs(this._data.seconds),this._data.minutes=Math.abs(this._data.minutes),this._data.hours=Math.abs(this._data.hours),this._data.months=Math.abs(this._data.months),this._data.years=Math.abs(this._data.years),this},weeks:function(){return e(this.days()/7)},valueOf:function(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*i(this._months/12)},humanize:function(n){var t=bu(this,!n,this.localeData());return n&&(t=this.localeData().pastFuture(+this,t)),this.localeData().postformat(t)},add:function(n,i){var r=t.duration(n,i);return this._milliseconds+=r._milliseconds,this._days+=r._days,this._months+=r._months,this._bubble(),this},subtract:function(n,i){var r=t.duration(n,i);return this._milliseconds-=r._milliseconds,this._days-=r._days,this._months-=r._months,this._bubble(),this},get:function(n){return n=s(n),this[n.toLowerCase()+"s"]()},as:function(n){var t,i;if(n=s(n),t=this._days+this._milliseconds/864e5,"month"===n||"year"===n)return i=this._months+12*ir(t),"month"===n?i:i/12;switch(t+=rr(this._months/12),n){case"week":return t/7;case"day":return t;case"hour":return 24*t;case"minute":return 1440*t;case"second":return 86400*t;case"millisecond":return 864e5*t;default:throw new Error("Unknown unit "+n);}},lang:t.fn.lang,locale:t.fn.locale,toIsoString:f("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",function(){return this.toISOString()}),toISOString:function(){var r=Math.abs(this.years()),u=Math.abs(this.months()),f=Math.abs(this.days()),n=Math.abs(this.hours()),t=Math.abs(this.minutes()),i=Math.abs(this.seconds()+this.milliseconds()/1e3);return this.asSeconds()?(this.asSeconds()<0?"-":"")+"P"+(r?r+"Y":"")+(u?u+"M":"")+(f?f+"D":"")+(n||t||i?"T":"")+(n?n+"H":"")+(t?t+"M":"")+(i?i+"S":""):"P0D"},localeData:function(){return this._locale}});t.duration.fn.toString=t.duration.fn.toISOString;for(u in ar)p(ar,u)&&du(u.toLowerCase());t.duration.fn.asMilliseconds=function(){return this.as("ms")};t.duration.fn.asSeconds=function(){return this.as("s")};t.duration.fn.asMinutes=function(){return this.as("m")};t.duration.fn.asHours=function(){return this.as("h")};t.duration.fn.asDays=function(){return this.as("d")};t.duration.fn.asWeeks=function(){return this.as("weeks")};t.duration.fn.asMonths=function(){return this.as("M")};t.duration.fn.asYears=function(){return this.as("y")};t.locale("en",{ordinal:function(n){var t=n%10,r=1===i(n%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return n+r}});er?module.exports=t:"function"==typeof define&&define.amd?(define("moment",function(n,i,r){return r.config&&r.config()&&r.config().noGlobal===!0&&(wt.moment=fr),t}),ur(!0)):ur()}.call(this);var civicaCommonMvc={};typeof kendo!="undefined"&&kendo.culture("en-GB");civicaCommonMvc.dialogResults={yes:"yes",no:"no",cancel:"cancel"};civicaCommonMvc.controls=new function(){function h(){var t=$("button[data-waitbutton]"),n;$.each(t,function(n,t){var r=$(t).attr("data-waitbutton"),u=$(t).attr("data-showspinner"),f,i,e;if(r&&r.length>0){f=$("<span/>").text(r);i=null;u&&u=="true"&&(i=$("<span/>",{"class":"spinner"}),e=$("<i/>",{"class":"icon-spin icon-repeat"}),i.append(e));$(t).on("click",function(){return $(t).html(""),i&&$(t).append(i),$(t).append(f),$(t).toggleClass("spinner-active"),!0})}});n=!1;$("form").bind("submit",function(){return n?!1:(n=!0,!0)})}function c(){var i=$("button[data-type=confirmDeleteLink]"),n,t;$.each(i,function(n,t){v(t)});n=$("button[data-type=confirmInformation]");$.each(n,function(n,t){a(t)});t=$("button[data-type=confirmReasonLink]");$.each(t,function(n,t){y(t)})}function l(t,i){$(t).off("click");$(t).on("click",function(r){function e(n){n&&n==civicaCommonMvc.dialogResults.yes&&location&&i(t)}r.preventDefault();var u=$(this).attr("data-confirm-title"),f=$(this).attr("data-confirm-message"),o=$(this).attr("data-confirm-callback");n(u,f,civicaCommonMvc.resources.Delete,civicaCommonMvc.resources.Cancel,null,e)})}function a(t){$(t).off("click");$(t).on("click",function(i){i.preventDefault();var r=$(t).attr("data-confirm-title"),u=$(t).attr("data-confirm-message"),f=$(t).attr("data-confirm-buttontext");n(r,u,f,null,null,null,null)})}function v(t){$(t).off("click");$(t).on("click",function(i){function s(n){n&&n==civicaCommonMvc.dialogResults.yes&&location&&window.location.replace(r)}var u;i.preventDefault();var f=$(t).attr("data-confirm-title"),e=$(t).attr("data-confirm-message"),r=$(t).attr("data-location"),o=$(t).attr("data-appendPageNumber");o=="true"&&(u=$("#CurrentPageNumber").val(),r=r.indexOf("?")>-1?r+("&pageNumber="+u):r+("?pageNumber="+u));n(f,e,"Delete","Cancel",null,s)})}function y(t){$(t).on("click",function(i){function h(n,t){n&&n==civicaCommonMvc.dialogResults.yes&&location&&(t&&t.length>0&&(r=r.indexOf("?")>-1?r+("&reasonText="+encodeURI(t)):r+("?reasonText="+encodeURI(t))),window.location.replace(r))}var u;i.preventDefault();var f=$(t).attr("data-confirm-title"),e=$(t).attr("data-confirm-message"),r=$(t).attr("data-location"),o=$(t).attr("data-reasonlabel"),s=$(t).attr("data-appendPageNumber");s=="true"&&(u=$("#CurrentPageNumber").val(),r=r.indexOf("?")>-1?r+("&pageNumber="+u):r+("?pageNumber="+u));n(f,e,civicaCommonMvc.resources.Confirm,civicaCommonMvc.resources.Cancel,null,h,o)})}function p(n){var t=parseInt(n),i=$("table[data-pagedgrid=true]");$.each(i,function(n,i){var e=parseInt(w(i));t<1&&(t=1);t>e&&(t=e);r(i,t);b(e,t);k(i,e);u(e,t);f(t,e)})}function w(n){var t=1,i=$(n).find("tr[data-rowpage]");return $.each(i,function(n,i){var r=parseInt($(i).attr("data-rowPage"));r>t&&(t=r)}),t}function r(n,t){var u=$(n).find("tr[data-rowpage]"),r;for(i=0;i<u.length;i++)$(u[i]).addClass("hidden");for(r=$(n).find("tr[data-rowpage="+t+"]"),i=0;i<r.length;i++)$(r[i]).removeClass("hidden")}function b(n,t){var u=$("#gridPageContainer"),f,r,e;if(n>1&&u&&u.length>0){for(f=$("<ul>",{"class":"pagination"}),i=1;i<=n;i++)r=$("<li>",{"data-pg":i}),i==t&&(r=$("<li>",{"class":"active","data-pg":i})),e=$("<a>",{href:"#","class":"gridPageSelector"}),$(e).text(i),$(r).append(e),$(f).append(r);$(u).append(f)}}function k(n,t){var i=$(".gridPageSelector");$.each(i,function(i,e){$(e).on("click",function(i){i.preventDefault();var o=$(this).text();$("#CurrentPageNumber").val(o);r(n,o);d(e);u(t,o);f(o,t)})})}function d(n){$(n).parent().siblings("li").removeClass("active");$(n).parent().addClass("active")}function u(n,t){var r,i,u,f;n>1&&(r=1,i=10,t>5&&(r=t-4,i=r+9),i>=n&&(i=n,r=i-9),u=$("#gridPageContainer > ul"),f=$(u).find("li"),$.each(f,function(n,t){$(t).hide();var u=$(t).attr("data-pg");u>=r&&u<=i&&$(t).show()}))}function f(n,t){var i=$("#gridPageContainer > p");i&&t>1?($(i).show(),$(i).text("Showing page "+n+" of "+t)):$(i).hide()}function g(){var n=$("select[data-combo=true]");$.each(n,function(n,t){$(t).kendoComboBox()})}function nt(){var n=$("select[data-multi=true]");$.each(n,function(n,t){$(t).kendoMultiSelect()})}function tt(){var r=$("[data-maxLengthString=true]"),n,u,e;if(r.length>0)for(i=0;i<r.length;i++){var t=$(r[i]),f=t.attr("data-length"),o=t.attr("data-tooltip");f&&(n=t.text().trim(),n&&n.length>0&&(u=parseInt(f),e=n.substring(0,u),n.length<=u?t.text(n):t.text(e+"..."),o!="false"&&t.kendoTooltip({content:n})))}}function it(){var n=$("button[data-type=pageLink]");$.each(n,function(n,t){var i=$(t).attr("data-location"),r=$(t).attr("data-pagelinkparameters");if(r==undefined&&(r=""),i&&i.length>0)$(t).on("click",function(){var t=r.split("|"),n="";$.each(t,function(t,i){var r=null,u=$("#"+i);u.length!=1&&(u=$("[name="+i+"]"));$.each(u,function(n,t){var i=null,o=$(t).is(":checkbox"),s=$(t).attr("data-datetime"),u,f,e;o?(u=$(t).attr("data-checkvalue"),u?$(t).is(":checked")&&(i=u):i=$(t).is(":checked")):s?(f=$(t).val(),e=moment(f,"DD/MM/YYYY hh:mm"),i=e.format()):i=$(t).val();i&&(r=r&&r.length>0?r+"|"+i:i)});r&&(n&&n.length>0&&(n+="&"),n+=i+"="+encodeURIComponent(r))});n&&n.length>0&&(i.indexOf("?")<0&&(i=i+"?"),i=i+n);window.location.assign(i)})})}function rt(){var n=$("select[data-type=pageLink]");$.each(n,function(n,t){var i=$(t).attr("data-location"),r=$(t).attr("data-pagelinkparameters");if(r==undefined&&(r=""),i&&i.length>0)$(t).on("change",function(){var t=r.split("|"),n="";$.each(t,function(t,i){var r=null,e=$("#"+i).is(":checkbox"),o=$("#"+i).attr("data-datetime"),u,f;e?r=$("#"+i).is(":checked"):o?(u=$("#"+i).val(),f=moment(u,"DD/MM/YYYY hh:mm"),r=f.format()):r=$("#"+i).val();r&&(n&&n.length>0&&(n+="&"),n+=i+"="+encodeURIComponent(r))});n&&n.length>0&&(i=i+"?"+n);window.location.assign(i)})})}function ut(n){var t=$(n);t.length>0&&$.each(t,function(n,t){var i=$(t).attr("data-tooltip");i&&i.length>0&&$(t).kendoTooltip({content:i})})}function ft(n,t){$.ajax({url:n,success:function(n){var i=n.split(","),r=$(t);i&&r.length>0&&i.length>0&&$(t).kendoAutoComplete({dataSource:i,filter:"contains"})}})}function et(n,t,i){var r=$("#"+n),t=$("#"+t);if(r&&t){$(r).on("click",function(){u()});function u(){$(r).is(":checked")?i?$(t).show():$(t).hide():i?$(t).hide():$(t).show()}u()}}function ot(){var u=$("input[data-datetime=true]"),t,i,e,o;for($.each(u,function(n,t){var i=moment(),r=$(t),f=r.attr("data-dateallowfuture"),e;f&&f=="true"&&(e=2,i.add(e,"y"));u.toArray().some(function(n){var t,r;$(n).attr("data-dateboundpickerid")==$(this).attr("id")&&$(n).val()&&(t=$(n).attr("data-dateboundpickermaxyears"),t&&!isNaN(parseInt(t))&&(r=moment($(n).val(),"DD/MM/YYYY"),i=r.add(parseInt(t),"y")))},r);i=i.toDate();r.kendoDateTimePicker({max:i,format:"dd/MM/yyyy HH:mm",change:function(){var n=this.element.attr("data-dateboundpickerid"),i,r;if(n){var u=$("#"+n).getKendoDateTimePicker(),f=this.element.getKendoDateTimePicker(),t=parseInt(this.element.attr("data-dateboundpickermaxyears"));t&&(i=moment(f.value()),r=i.add(t,"y").toDate(),u.max(r))}}})}),t=$("input[data-date=true]"),i=0;i<t.length;i++){var n=moment(),r=$(t[i]),f=r.attr("data-dateallowfuture");f&&f=="true"&&(e=2,n.add(e,"y"));t.toArray().some(function(t){var i,r;$(t).attr("data-dateboundpickerid")==$(this).attr("id")&&$(t).val()&&(i=$(t).attr("data-dateboundpickermaxyears"),i&&!isNaN(parseInt(i))&&(r=moment($(t).val(),"DD/MM/YYYY"),n=r.add(parseInt(i),"y")))},r);n=n.toDate();r.kendoDatePicker({max:n,format:"dd/MM/yyyy",change:function(){var n=this.element.attr("data-dateboundpickerid"),i,r;if(n){var u=$("#"+n).getKendoDatePicker(),f=this.element.getKendoDatePicker(),t=parseInt(this.element.attr("data-dateboundpickermaxyears"));t&&(i=moment(f.value()),r=i.add(t,"y").toDate(),u.max(r))}}})}o=$("input[data-time=true]");$.each(o,function(n,t){$(t).kendoTimePicker({interval:15,format:"HH:mm"})})}function st(n,t,i){$(n).kendoSortable({handler:t,change:function(){if(i){var t=$(n).find(i);$.each(t,function(n,t){$(t).val(n)})}},ignore:".ignoreDrag"})}function ht(n,t,i,r,u,f,e,o,s,h){function l(n){if(r){var t=$(r);t.length>0&&(n?($(t).text(n+"%"),$(t).attr("aria-valuenow",n),$(t).css("width",n+"%")):($(t).text("0%"),$(t).attr("aria-valuenow",0),$(t).css("width","0%")))}}function a(){c=null;$(t).val("");l(0);s&&$.each(s,function(n,t){var i=$(t),r;i.length>0&&($(i).is("input")==!0&&$(i).is("input[type=hidden]")==!1&&$(i).val(""),$(i).is("select")==!0&&(r=$(i).data("kendoMultiSelect"),r?r.value([]):$(i).val([])))});h!=null&&h()}var c;$(n).fileupload({dataType:"json",autoUpload:!1,add:function(n,r){var u=[],f=e;r.originalFiles[0].name.length&&f!=""&&!f.test(r.originalFiles[0].name)?u.push("File is not an accepted file type"):String(r.originalFiles[0].size).length&&r.originalFiles[0].size>o&&u.push("File size is too big");u.length>0?toastr.error(u.join("\r\n"),"Error uploading document"):($(t).val(r.files[0].name),$(i).removeAttr("disabled"),c=r)},submit:function(n,t){var i=f.toString();return s&&$.each(s,function(n,t){var u=$(t).val(),r;u&&(i.indexOf("?")<0&&(i=i+"?"),r=$(t).attr("name"),r||(r=t),i=i+r+"="+encodeURI(u)+"&")}),(i.endsWith("&")||i.endsWith("?"))&&(i=i.substring(0,i.length-1)),t.url=i,!0},progressall:function(n,t){var i=parseInt(t.loaded/t.total*100,10);l(i)},done:function(n,t){var i,r;u&&(i=$(u).find("ul"),i.length>0&&(r=$("<li>").text(t.files[0].name),i.append(r),$(u).show()));a()}});$(i).on("click",function(){if(c){var n=c.files[0].name;$(i).attr("disabled","disabled");c.submit().success(function(){toastr.success("File Uploaded")}).error(function(n,t,i){toastr.error("File Upload Failed",i);a()})}})}function ct(n,t,i,r,u,f,e,o){function h(){setTimeout(c,5e3)}function c(){var n=$(".k-upload-status.k-upload-status-total");n.hide("slow",function(){n.remove()})}function l(n){var t;if(e&&(t=e(),t.length>0))return toastr.error(t,civicaCommonMvc.resources.UploadFailed),n.preventDefault(),!1;u&&$.each(u,function(t,i){var r;r=$(i).is(":checkbox")?$(i).is(":checked")?"true":"false":$(i).val();r&&$.each(n.files,function(){var t=$(i).attr("name"),n={};n[t]=r;$.extend(this,n)})})}function a(n){var f=t.toString(),h=!1,e="";if(n.files[0].name.match(/^(?=[^ .])(?=.{0,255}$)[.A-Z _+()0-9-]+[.](?:avi|bmp|doc|docx|gif|gml|jpeg|jpg|mp4|mov|mpg|mpeg|pdf|plt|png|rtf|tif|txt|wmv|xls|xlsx)$/i)||(e=civicaCommonMvc.resources.FilesNotAllowedDueToFilenameFormat,h=!0),i==""||i.test(n.files[0].extension)||(e=civicaCommonMvc.resources.FilesNotAllowedDueToExtention,h=!0),n.files[0].size&&n.files[0].size>r&&(h?e=civicaCommonMvc.resources.FilesNotAllowedDueToExtensionAndSize:(e=civicaCommonMvc.resources.FilesNotAllowedDueToSize,h=!0)),h)return e+="<br/>"+n.files[0].name,n.clientSideErrorMessage=e,s(n),n.preventDefault(),!1;u&&$.each(u,function(t,i){var r=$(i).attr("name"),u=n.files[0][r];u&&(f.indexOf("?")<0&&(f=f+"?"),f=f+r+"="+encodeURIComponent(u)+"&")});(f.endsWith("&")||f.endsWith("?"))&&(f=f.substring(0,f.length-1));o&&o();n.sender.options.async.saveUrl=f}function v(n){$.each(n.files,function(n,t){if(t.uid){var i=$("li[data-uid="+t.uid+"]");i.length>0&&$(i).delay(5e3).animate({height:"0px",opacity:0},1500).hide(0)}});f&&f()}function s(n){var t,i;if(n.clientSideErrorMessage!=null){toastr.error(n.clientSideErrorMessage,civicaCommonMvc.resources.UploadFailed);var u=$("#uploadDocument"),f=u.parent().parent().parent(),r=$(f).find("ul"),e=$(r).find("li[data-uid='"+n+"']"),o=n.clientSideErrorMessage.replace(/'/g,"&#39;");return e!=null&&$(r).append("<li class='k-file k-file-error' data-uid='"+n.files[0].uid+"'><span class='k-progress' style='width: 100%;'><\/span><span class='k-icon k-i-txt'>failed<\/span><span class='k-filename' title='"+n.files[0].name+"'>"+n.files[0].name+"<\/span><strong class='k-upload-status'><span class='k-icon k-warning'><\/span><button type='button' class='k-button k-button-bare' onclick='toastr.error(\""+o+'","'+civicaCommonMvc.resources.UploadFailed+"\");'><span class='k-icon k-i-refresh k-retry' title='Retry'><\/span><\/button><\/strong><\/li>"),n.preventDefault(),!1}if(n.XMLHttpRequest!=null&&n.XMLHttpRequest.responseText!=null)try{t=$.parseJSON(n.XMLHttpRequest.responseText);t!=null&&t.message!=null&&t.message!=""&&(i=t.message,i+="<br/>"+n.files[0].name,toastr.error(i,t.title))}catch(n){toastr.error(civicaCommonMvc.resources.UploadExceptionOrTimeOut,civicaCommonMvc.resources.UploadFailed)}}$("#uploadDocument").kendoUpload({async:{saveUrl:"save",autoUpload:!0},select:l,upload:a,success:v,error:s,localization:{select:civicaCommonMvc.resources.SelectFiles+"...",headerStatusUploading:civicaCommonMvc.resources.HeaderStatusUploading+"...",headerStatusUploaded:civicaCommonMvc.resources.HeaderStatusUploaded,cancel:civicaCommonMvc.resources.Cancel,retry:civicaCommonMvc.resources.Retry,remove:civicaCommonMvc.resources.Remove},complete:h})}function lt(n,t){if(n){if($("#"+n).kendoTabStrip({animation:{open:{effects:"fadeIn"}}}),$("#"+n+" > ul").removeClass("hidden"),t){var i=$("#tab_"+t);i.length>0&&$("#"+n).kendoTabStrip().data("kendoTabStrip").select("#tab_"+t)}else $("#"+n).kendoTabStrip().data("kendoTabStrip").select(0);$("#"+n).removeClass("hidden")}}function at(n,t,i,r,u,f,e){var h=$("#"+n),o,s;if(h.length>0){o=$("<button>",{"class":u});s=$("<button>",{"class":u});$(o).text("ON");$(s).text("OFF");$(o).addClass("btn");$(s).addClass("btn");$(h).append(o);$(h).append(s);t=="on"?($(h).attr("data-toggle","on"),$(o).addClass(i),$(o).addClass("active"),$(s).addClass(r),f&&f()):($(h).attr("data-toggle","off"),$(s).addClass(i),$(s).addClass("active"),$(o).addClass(r),e&&e());$(h).on("click",function(){$(this).find(".btn").toggleClass("active");$(this).find("."+i).size()>0&&$(this).find(".btn").toggleClass(i);$(this).find(".btn").toggleClass(r);var n=$(this).attr("data-toggle");n=="on"?$(this).attr("data-toggle","off"):$(this).attr("data-toggle","on");$(this).attr("data-toggle")=="on"?f&&f():e&&e()})}}function vt(){var n=$("input[data-autocomplete=true]");$.each(n,function(n,t){var i=$(t).attr("data-autocompletevalues"),r=$(t).attr("data-autocompletefilter"),u;r||(r="startswith");i&&i.length>0&&(u=JSON.parse(i),$(t).kendoAutoComplete({highlightFirst:!1,dataSource:u,filter:r}))})}function yt(n,t){var r,i;n&&t&&(r=typeof t=="string"?JSON.parse(t):t,i=$(n).data("kendoAutoComplete"),i&&i.setDataSource(r))}function pt(n,t){var i=$("#"+n);if(i.length>0)$(i).on("click",function(n){n.preventDefault();$.ajax({url:randomPassUrl,success:function(n){$("#"+t).val(n)}})})}function wt(n,t){var i=$(n);$.each(i,function(n,i){var r=$(i),u;r.length>0&&($(r).hide(),t&&(u=$(r).find(t),u.length>0&&$(u).val(!0)))})}function n(n,i,r,u,f,e,o){var c,h,l,a,v,y,s;dialogResult=civicaCommonMvc.dialogResults.cancel;c=i.split("|");$("#unityConfirmationDialog").attr("title",n);$("#unityConfirmationDialogText").empty();$.each(c,function(n,t){var i=$("<p>");i.text(t);$("#unityConfirmationDialogText").append(i)});o&&o.length>0&&(h=$("<div>",{"class":"form-group"}),l=$("<textarea>",{"class":"form-control input-min-width-400",id:"unityConfirmationReasonText",placeholder:o}),$(h).append(l),$("#unityConfirmationDialogText").append(h));$("#unityConfirmationDialogActions").empty();r&&(a=$("<button/>",{text:r,"class":"btn btn-default button button--action",click:function(){t(this,civicaCommonMvc.dialogResults.yes,e)}}),$("#unityConfirmationDialogActions").append(a));u&&(v=$("<button/>",{text:u,"class":"btn btn-default button",click:function(){t(this,civicaCommonMvc.dialogResults.no,e)}}),$("#unityConfirmationDialogActions").append(v));f&&(y=$("<button/>",{text:f,"class":"btn btn-default button",click:function(){t(this,civicaCommonMvc.dialogResults.cancel,e)}}),$("#unityConfirmationDialogActions").append(y));$("#unityConfirmationDialog").data("kendoWindow")||$("#unityConfirmationDialog").kendoWindow({modal:!0,visible:!1,resizable:!1,draggable:!0,actions:[]});s=$("#unityConfirmationDialog").data("kendoWindow");s.wrapper.addClass("dialog-wrapper");s.title(n);s.center();s.open()}function t(n,t,i){var u=$("#unityConfirmationDialog").data("kendoWindow"),r;u&&u.close();i&&(r=$("#unityConfirmationReasonText"),r&&r.length==1?i(t,$(r).val()):i(t))}function bt(){function i(n){setTimeout(function(){$(n).attr("disabled","disabled")},0,null);setTimeout(function(){$(n).removeAttr("disabled")},15e3,null)}var n,t;$(document).on("invalid-form.validate","form",function(){var n=$(this).find('input[type="submit"]');setTimeout(function(){n.removeAttr("disabled")},100)});n=$('button[type="submit"]');$.each(n,function(n,t){$(t).on("click",function(){i(t)})});t=$('input[type="submit"]');$.each(t,function(n,t){$(t).on("click",function(){i(t)})})}function kt(){var n=$("input[data-addresssuffix-helper]");$.each(n,function(n,t){e(t)})}function e(n){var t=$(n).attr("data-addresssuffix-helper"),i;t=t.replace("|","\\|");i=$("#"+t);$(i).on("keydown keyup change mouseup paste",function(n){var t=String.fromCharCode(n.keyCode);return t.match(/^[A-Z\s]*$/)||n.keyCode==32||n.keyCode==46||n.keyCode==8?!0:!1})}function dt(){var n=$("input[data-numeric]");$.each(n,function(n,t){var r=$(t).attr("data-numeric-min"),u=$(t).attr("data-numeric-max"),f=$(t).attr("data-showspinner"),e=$(t).attr("data-numeric"),i=!1;(f=="true"||f=="True")&&(i=!0);switch(e){default:case"default":$(t).kendoNumericTextBox({min:r,max:u,spinners:i,format:"#",decimals:0});break;case"decimal1":$(t).kendoNumericTextBox({min:r,max:u,spinners:i,format:"n1",decimals:1});break;case"decimal2":$(t).kendoNumericTextBox({min:r,max:u,spinners:i,format:"n2",decimals:2});break;case"decimal3":$(t).kendoNumericTextBox({min:r,max:u,spinners:i,format:"n3",decimals:3});break;case"decimal4":$(t).kendoNumericTextBox({min:r,max:u,spinners:i,format:"n4",decimals:4})}});$(".data-number-label").on("click",function(){var n="#"+this.attributes["for"].value.replace("|","\\|");$(n).siblings("input:visible").focus()})}function gt(){var n=$("input[data-textarea-helper]");$.each(n,function(n,t){o(t)})}function o(n){var r=$(n).attr("data-textarea-helper"),t,i;if(r=r.replace("|","\\|"),t=$("#"+r),t.length==1&&(i=$(t).attr("maxlength"),i)){$(t).on("focus",function(){$(n).show()});$(t).on("paste",function(){var r=$(this).val(),n=window.clipboardData.getData("Text");return n=n.replace(/(\\n|\r\n|\r|\n)/gm," "),n.length>i?(n=n.substring(0,i),$(this).val(n)):$(this).val(n),$(t).trigger("change"),!1});$(t).on("keyup change mouseup",function(){var n=$(this).val();n.length>i&&(n=n.substring(0,i),$(this).val(n))})}}function ni(){var n=$("span[data-textarea-helper]");$.each(n,function(n,t){s(t)})}function s(n){var r,u,t,i;if($(n).hide(),r=$(n).attr("data-textarea-helper"),r=r.replace("|","\\|"),u=$(n).attr("data-textarea-helper-suffix"),t=$("#"+r),t.length==1&&(i=$(t).attr("maxlength"),i)){$(t).on("focus",function(){$(n).show()});$(t).on("keyup paste change mouseup",function(){var t=$(this).val();t.length>i&&(t=t.substring(0,i),$(this).val(t));$(n).text((i-t.length).toString()+" "+u)})}}function ti(n){var t=$(n);t&&$.each(t,function(n,t){var u=$(t).attr("data-content"),f=$(t).attr("data-title"),i=$('<div class="form-tooltip"/>'),r;f.length>0&&(r=$("<span/>",{"class":"form-tooltip--title"}),$(r).append(f),$(i).append(r));u&&($(i).append(u),$(t).kendoTooltip({content:i,autoHide:!1,showOn:"click"}))})}function ii(n,t,i,r,u,f,e,o){var s=$("button[data-address-search]");$.each(s,function(s,h){var c=$(h).attr("data-address-search"),v=$(h).attr("data-address-isinternational"),a=$(n),l;if(a.length==1){l=$(a).kendoWindow({actions:["close"],modal:!0,title:t}).data("kendoWindow");$(u).on("click",function(){$.ajax({url:addressLookupUrl,data:{postCode:$(i).val(),addressSearch1:$(r).val(),addressSearch2:"",addressSearch3:"",callingScreen:1},success:function(n){$(e).empty();for(var t=0;t<n.addresses.length;t++)$(e).append('<option value="'+n.addresses[t].Moniker+'">'+n.addresses[t].Address+"<\/option>");n.addresses.length==0?$(f).hide():n.addresses.length==1?($(e).prepend("<option value='' >"+civicaCommonMvc.resources.PleaseSelect+"...<\/option>"),$(e)[0].options[1].selected=!0,$(f).show()):($(e).prepend("<option value='' selected='selected'>"+civicaCommonMvc.resources.PleaseSelect+"...<\/option>"),$(e)[0].options[0].selected=!0,$(f).show());n.error==!0?toastr.error(n.returnMessage):n.returnMessage.length>0&&toastr.info(n.returnMessage)}})});$(o).on("click",function(){var t=$(e).val();t.length>0&&$.ajax({url:getFulladdressUrl,data:{addressIdentifier:t},success:function(t){var i,r,f,e;if(t&&t.error==!1&&t.fullAddress){v=="true"?(i="",r="",t.fullAddress.HouseName.length>0&&(i=i.concat(t.fullAddress.HouseName," ")),t.fullAddress.Number.length>0?i.length==0?(i=i.concat(t.fullAddress.Number),i=t.fullAddress.HouseNumberSuffix.length>0?i.concat(t.fullAddress.HouseNumberSuffix," "):i.concat(" "),r=t.fullAddress.AddressLine1):(r=r.concat(t.fullAddress.Number),r=t.fullAddress.HouseNumberSuffix.length>0?r.concat(t.fullAddress.HouseNumberSuffix," ",t.fullAddress.AddressLine1):r.concat(" ",t.fullAddress.AddressLine1)):i.length>0&&(r=t.fullAddress.AddressLine1),i.length>0?($("#"+c+"\\|street1").val(i),$("#"+c+"\\|street2").val(r),$("#"+c+"\\|street3").val(t.fullAddress.AddressLine2),$("#"+c+"\\|towncity").val(t.fullAddress.TownCityName),$("#"+c+"\\|country").val(""),$("#"+c+"\\|postcode").val(t.fullAddress.Postcode),$("#"+c+"\\|uprn").val(t.fullAddress.UPRN)):($("#"+c+"\\|street1").val(t.fullAddress.AddressLine1),$("#"+c+"\\|street2").val(t.fullAddress.AddressLine2),$("#"+c+"\\|street3").val(t.fullAddress.AddressLine3),$("#"+c+"\\|towncity").val(t.fullAddress.TownCityName),$("#"+c+"\\|country").val(""),$("#"+c+"\\|postcode").val(t.fullAddress.Postcode),$("#"+c+"\\|uprn").val(t.fullAddress.UPRN))):($("#"+c+"\\|hnumber").val(t.fullAddress.Number),f=$("#"+c+"\\|hnumber").data("kendoNumericTextBox"),f&&f.value(t.fullAddress.Number),$("#"+c+"\\|hnumbersuffix").val(t.fullAddress.HouseNumberSuffix),$("#"+c+"\\|hname").val(t.fullAddress.HouseName),$("#"+c+"\\|street1").val(t.fullAddress.AddressLine1),$("#"+c+"\\|street2").val(t.fullAddress.AddressLine2),$("#"+c+"\\|street3").val(t.fullAddress.AddressLine3),$("#"+c+"\\|towncity").val(t.fullAddress.TownCityName),$("#"+c+"\\|country").val(""),$("#"+c+"\\|postcode").val(t.fullAddress.Postcode),$("#"+c+"\\|uprn").val(t.fullAddress.UPRN));function u(n){var t=$(n),i,r,u;t.length==1&&(i=$(t).attr("maxlength"),i&&i.length>0&&(r=parseInt(i),r>0&&(u=$(t).val(),u.length>r&&$(t).val(u.substring(0,r)))))}u("#"+c+"\\|hnumbersuffix");u("#"+c+"\\|hname");u("#"+c+"\\|street1");u("#"+c+"\\|street2");u("#"+c+"\\|street3");u("#"+c+"\\|towncity");u("#"+c+"\\|country");u("#"+c+"\\|postcode");u("#"+c+"\\|uprn");e=$(n).data("kendoWindow");e.close()}}})});$(this).on("click",function(){l.center();l.open()})}})}function ri(n,t,i,r,u,f,e){function s(){var u=$(n).val();u.length>7?$.ajax({type:"POST",url:t,data:{password:u},success:function(n){n.ok==!0?($(i).addClass("hidden"),$(r).removeClass("hidden")):($(r).addClass("hidden"),$(i).removeClass("hidden"))}}):($(i).addClass("hidden"),$(r).addClass("hidden"))}var o,h=500,c,l,a,v,y;$(n).on("paste",function(){clearTimeout(o);o=setTimeout(s,h)});$(n).on("keyup",function(){clearTimeout(o);o=setTimeout(s,h)});c=$(i);l=$(r);c.length<=0&&u&&e&&(a=$("<span/>",{"class":"pword-failed position-left margin-top hidden",id:i.replace("#","")}).text(u),$(e).append(a));l.length<=0&&f&&e&&(v=$("<span/>",{"class":"pword-valid position-left margin-top hidden",id:r.replace("#","")}).text(f),$(e).append(v));y=$(n).val();y.length>7&&s()}return{initialiseWaitButtons:h,initialisePagedGrids:p,initialiseConfirmationButtons:c,initialiseComboBoxes:g,initialiseMultiSelect:nt,initialiseMaxLengthStrings:tt,initialisePageLinkButtons:it,initialisePageLinkDropDownLists:rt,initialiseTooltips:ut,initialiseAutoComplete:ft,initialiseCheckboxVisibilityControl:et,initialiseDateTimePickers:ot,initialiseSortableList:st,initialiseDocumentUpload:ht,initialiseKendoDocumentUpload:ct,initialiseTabControl:lt,initialiseToggleControl:at,initialiseAutoCompleteControl:vt,refreshAutoCompleteControlData:yt,generatePassword:pt,deleteListItem:wt,initialiseConfirmDeleteCallback:l,initialiseDisableSubmitButtons:bt,initialiseNumericInputs:dt,initialiseTextAreaHelpers:ni,initialiseTextAreaHelperControl:s,showConfirmationDialog:n,closeConfirmationDialog:t,initialisePopOvers:ti,initialiseAddressLookup:ii,initialiseTextBoxHelpers:gt,initialiseTextboxHelperControl:o,initialiseAlphabeticInputHelpers:kt,initialiseAlphabeticInputHelperControl:e,initialisePasswordValidator:ri}};typeof String.prototype.trim!="function"&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")});typeof String.prototype.endsWith!="function"&&(String.prototype.endsWith=function(n){return this.indexOf(n,this.length-n.length)!==-1});civicaCommonMvc.validation=new function(){function n(){}function t(n,t){var u=$(".validation-summary-errors"),i,r,f;u&&u.length>0&&(i="",r="Validation Error",n&&(i=n),t&&(r=t),toastr.error(i,r));f=$("input[class~='input-validation-error']");$.each(f,function(n,t){var i="Please check input";$.each(t.attributes,function(n,t){if(t.name=="data-val-regex"||t.name=="data-val-required"||t.name=="data-val-requiredvalue"||t.name=="data-val-notequalto"||t.name=="data-val-equalto"||t.name=="data-val-stringrange"||t.name=="data-val-iscommonpassword"){var u=$(".validation-summary-errors"),r;return u&&u.length>0&&(r=u.find("li")),r&&r.length>0&&$.each(r,function(n,r){if(r.textContent==t.value)return i=t.value,!1}),!0}});$(t).kendoTooltip({content:i})})}function i(){var n=$("*[data-form-error]"),t=n.length;return $.each(n,function(n,t){var i=$(t).attr("data-form-error");i&&i.length>0&&($(t).addClass("input-validation-error"),$(t).kendoTooltip({content:i}))}),t}return{clearValidation:n,checkPageValidation:t,checkFormsValidation:i}};civicaCommonMvc.forms=new function(){function r(n,t){var i=civicaCommonMvc.validation.checkFormsValidation();n&&t&&i>0&&toastr.error(t,n)}function u(n,t,i){var r=$(t);r.length>0&&(n=="show"&&i?$(r).addClass("show"):n!="show"||i?n=="hide"&&i?$(r).addClass("hidden"):n!="hide"||i||$(r).addClass("show"):$(r).addClass("hidden"))}function f(n,t,i){var r=$(t);r.length>0&&(n=="show"&&i?$(r).addClass("show"):n!="show"||i?n=="hide"&&i?$(r).addClass("hidden"):n!="hide"||i||$(r).addClass("show"):$(r).addClass("hidden"))}function e(n,i,r,u,f){var e=JSON.parse(r);e.length>0&&($.each(e,function(r,o){if(o.SourceType!="FormData"){var s=$(o.Source),h=!1;if(s.length==0&&(s=$("#"+o.Source)),s.length==0&&(s=$("input[name="+o.Source+"]"),h=!0),s.length==1)$(s).on("change",function(){t(n,i,e,u,f)});else if(s.length>1&&h)$("input[name="+o.Source+"]").on("change",function(){t(n,i,e,u,f)})}}),t(n,i,e,u,f))}function t(outcome,target,conditions,expression,reverseOutcomeIfConditionNotMet){var evaluatedConditions=[],metCondition,parsedExpression;$.each(conditions,function(t,i){var u=!1,r,f,e,o;i.SourceType=="FormData"?u=n(i.SourceValue,i.Comparison,i.ComparisonValue):(r=$(i.Source),f=!1,r.length==0&&(r=$("#"+i.Source)),r.length==0&&(r=$("input[name="+i.Source+"]"),f=!0),r.length==1?(e=$("#question_"+i.Source).hasClass("hidden")||$("#question_"+i.Source).parent().hasClass("hidden")?"":$(r).val(),u=$(r).is(":checkbox")?$(r).is(":checked")?n(e,i.Comparison,i.ComparisonValue):n("",i.Comparison,i.ComparisonValue):n(e,i.Comparison,i.ComparisonValue)):r.length>1&&f&&(o=$("#question_"+i.Source).hasClass("hidden")||$("#question_"+i.Source).parent().hasClass("hidden")?"":$("input[name="+i.Source+"]:checked").val(),u=n(o,i.Comparison,i.ComparisonValue)));evaluatedConditions.push({Id:i.Id,Condition:u})});evaluatedConditions.length==1?(metCondition=evaluatedConditions[0].Condition,i(outcome,target,metCondition,reverseOutcomeIfConditionNotMet)):evaluatedConditions.length>1&&(metCondition=!1,expression=="&"?$.each(evaluatedConditions,function(n,t){if(t.Condition==!0)metCondition=!0;else return metCondition=!1,!1}):expression=="|"?$.each(evaluatedConditions,function(n,t){if(t.Condition==!0)return metCondition=!0,!1}):expression.length>1&&(parsedExpression=expression,$.each(evaluatedConditions.reverse(),function(n,t){parsedExpression=parsedExpression.replace(new RegExp("[{]"+t.Id.toString()+"[}]","g"),t.Condition.toString())}),metCondition=eval(parsedExpression)),i(outcome,target,metCondition,reverseOutcomeIfConditionNotMet))}function o(n){if(n){var t=$(n),i=!1;t.length==0&&(t=$("#"+n));t.length==0&&(t=$("input[name="+n+"]"),i=!0);n.substring(1,9)=="fragment_"?($("#"+n+" input").trigger("change"),$("#"+n+" textarea").trigger("change")):t.length==1?$(t).trigger("change"):t.length>1&&i&&$("input[name="+n+"]").trigger("change")}}function n(n,t,i){var r=!1;if(n&&t&&i)switch(t){case"Equals":n.toLowerCase()==i.toLowerCase()&&(r=!0);break;case"NotEqualTo":n.toLowerCase()!=i.toLowerCase()&&(r=!0);break;case"GreaterThan":parseFloat(n)>parseFloat(i)&&(r=!0);break;case"LessThan":parseFloat(n)<parseFloat(i)&&(r=!0);break;case"Contains":var u=n.toLowerCase(),f=i.toLowerCase(),e=u.indexOf(f);e>-1&&(r=!0)}return r}function i(n,t,i,r){var u=$(t);u.length>0&&(n=="Show"&&i?($(u).removeClass("hidden"),$(u).addClass("show")):n=="Show"&&!i&&r?($(u).removeClass("show"),$(u).addClass("hidden")):n=="Hide"&&i?($(u).removeClass("show"),$(u).addClass("hidden")):n=="Hide"&&!i&&r&&($(u).removeClass("hidden"),$(u).addClass("show")),o(t.replace(/^#/,"").replace(/^question_/,"")))}function s(){var n=$("script[data-datalist]");$.each(n,function(n,t){var i=$(t).attr("data-datalist");i&&window[i]()})}function h(){function n(n,t){var i=Function('"use strict"; return ('+t+")")();$(n).val(i);$(n).trigger("change")}var t=$("input[data-evaluatorexpression]");$.each(t,function(t,i){var f=$(i).attr("data-evaluatorsources"),r=$(i).attr("data-evaluatorexpression"),u=f.split("|");$.each(u,function(n,t){$("#"+t).length>0&&(r=r.replace(new RegExp(t,"g"),"(parseInt($('#"+t+"').val())||0)"))});r="(("+r+")||0)";$.each(u,function(t,u){var f=$("#"+u);if(f.length>0)f.on("change",function(){n(i,r)})});n(i,r)})}function c(){function n(n,t,i){var r=0;$.each(t,function(n,t){var e=$("#"+t).val(),f,u;if(e&&e.length>0)for(f=JSON.parse(e),u=0;u<f.length;u++)f[u][i]==undefined||isNaN(f[u][i])||(r+=parseFloat(f[u][i]))});$(n).val(r);$(n).trigger("change")}var t=$("input[data-datalistcounter]");$.each(t,function(t,i){var f=$(i).attr("data-datalistcounter"),u=$(i).attr("data-datalistcounterprop"),r=f.split("|");$.each(r,function(t,f){var e=$("#"+f);if(e.length>0)$("#"+f).on("change",function(){n(i,r,u)})});n(i,r,u)})}function l(n,t,i,r,u){function f(i){var e=$(t).data("kendoWindow"),o,s;e.content(i);e.center();civicaCommonMvc.controls.initialiseDateTimePickers();civicaCommonMvc.controls.initialiseNumericInputs();civicaCommonMvc.controls.initialiseTextAreaHelpers();o=e.wrapper.find("#"+r);o&&o.length>0&&(s=$(o).val(),u(s),e.close());e.wrapper.find('button[data-ajax="true"]').on("click",function(){var i=e.wrapper.find("form"),t=i.serialize(),r=$(this).attr("name");t&&(t=t+("&"+r+"=true"));$.ajax({type:"Post",data:t,url:n,success:function(n){f(n)}})})}$(t).kendoWindow({modal:!0,visible:!1,title:i,minWidth:600,maxWidth:750,minHeight:200,maxHeight:650,open:function(){$.ajax({type:"Get",url:n,success:function(n){f(n)}})}});var e=$(t).data("kendoWindow");e.center();e.open()}function a(n,t){if(n&&t)switch(t.toLowerCase()){case"upper":return n.toUpperCase();case"lower":return n.toLowerCase()}else return""}function v(n){return n?n:""}function y(n){return n&&!isNaN(n)?n.toString().replace(/\B(?=(\d{3})+(?!\d))/g,","):n==0?0:""}function p(n){return n&&!isNaN(n)?n:n==0?0:""}function w(n,t){return t||(t=2),n&&!isNaN(n)?n.toFixed(t):n==0?0:""}function b(n,t){return n?t:""}function k(n,t,i,r){if(n!=null&&t&&t.toString().length>0&&r&&r.toString().length>0){var u=n+t.toString();return i&&(u=u+i),u}return""}function d(n,t,i){var e=!1,u=$("#"+t+":visible").val(),o=$("#"+n).attr("SelectedKey"),r,f;if(u)u=u.toLowerCase();else return!1;r=JSON.parse($("#"+n).val());for(f in r)r[f].KEY!=o&&typeof r[f][i]!="undefined"&&r[f][i].toLowerCase()==u&&(e=!0);return e}function g(n,t){t?($("#"+n).kendoButton({enable:!0}),$("#"+n).removeClass("k-state-disabled").removeAttr("disabled")):$("#"+n).kendoButton({enable:!1});$("#"+n).removeClass("k-button")}return{renderFormValidationItems:r,showHideUIFragmentCondition:u,showHideUIQuestionCondition:f,attachFormValueChangedEventHandler:e,initialiseDataLists:s,initialiseDataListCounters:c,initialiseEvaluators:h,getCleanString:v,getCleanNumber:p,getCleanDecimal:w,getCleanBoolean:b,getStringInCase:a,getFormattedNumber:y,getConditionalFormattedValue:k,startModalFormDialog:l,datalistValueAlreadyInUse:d,enableDisableButton:g}}