(function(n,t){t([],n)})(function(){return function(){(function(n,t,i){function ft(){}function gi(n,t){if(t)return"'"+n.split("'").join("\\'").split('\\"').join('\\\\\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")+"'";var i=n.charAt(0),r=n.substring(1);return i==="="?"+("+r+")+":i===":"?"+$kendoHtmlEncode("+r+")+":";"+n+";$kendoOutput+="}function f(n,t,i){return(n=n+"",t=t||2,i=t-n.length,i)?er[t].substring(0,i)+n:n}function ti(n){var u=n.css(r.support.transitions.css+"box-shadow")||n.css("box-shadow"),t=u?u.match(wi)||[0,0,0,0,0]:[0,0,0,0,0],i=a.max(+t[3],+(t[4]||0));return{left:-t[1]+i,right:+t[1]+i,bottom:+t[2]+i}}function or(t,i){var h=u.browser,e,y=t.css("direction")=="rtl",f,c;if(t.parent().hasClass("k-animation-container"))f=t.parent(".k-animation-container"),c=f[0].style,f.is(":hidden")&&f.show(),e=it.test(c.width)||it.test(c.height),e||f.css({width:t.outerWidth(),height:t.outerHeight(),boxSizing:"content-box",mozBoxSizing:"content-box",webkitBoxSizing:"content-box"});else{var r=ti(t),o=t[0].style.width,s=t[0].style.height,l=it.test(o),v=it.test(s);h.opera&&(r.left=r.right=r.bottom=5);e=l||v;!l&&(!i||i&&o)&&(o=t.outerWidth());!v&&(!i||i&&s)&&(s=t.outerHeight());t.wrap(n("<div/>").addClass("k-animation-container").css({width:o,height:s,marginLeft:r.left*(y?1:-1),paddingLeft:r.left,paddingRight:r.right,paddingBottom:r.bottom}));e&&t.css({width:"100%",height:"100%",boxSizing:"border-box",mozBoxSizing:"border-box",webkitBoxSizing:"border-box"})}return h.msie&&a.floor(h.version)<=7&&(t.css({zoom:1}),t.children(".k-menu").width(t.width())),t.parent()}function lt(n){for(var t=1,i=arguments.length,t=1;t<i;t++)ii(n,arguments[t]);return n}function ii(n,t){var s=r.data.ObservableArray,h=r.data.LazyObservableArray,c=r.data.DataSource,l=r.data.HierarchicalDataSource,u,i,e,f,o;for(u in t)i=t[u],e=typeof i,f=e===w&&i!==null?i.constructor:null,f&&f!==Array&&f!==s&&f!==h&&f!==c&&f!==l?i instanceof Date?n[u]=new Date(i.getTime()):et(i.clone)?n[u]=i.clone():(o=n[u],n[u]=typeof o===w?o||{}:{},ii(n[u],i)):e!==ut&&(n[u]=i);return n}function at(n,t,r){for(var u in t)if(t.hasOwnProperty(u)&&t[u].test(n))return u;return r!==i?r:n}function sr(n){return n.replace(/([a-z][A-Z])/g,function(n){return n.charAt(0)+"-"+n.charAt(1).toLowerCase()})}function ri(n){return n.replace(/\-(\w)/g,function(n,t){return t.toUpperCase()})}function ui(t,i){var u={},f;return document.defaultView&&document.defaultView.getComputedStyle?(f=document.defaultView.getComputedStyle(t,""),i&&n.each(i,function(n,t){u[t]=f.getPropertyValue(t)})):(f=t.currentStyle,i&&n.each(i,function(n,t){u[t]=f[ri(t)]})),r.size(u)||(u=f),u}function hr(n){if(n&&n.className&&typeof n.className=="string"&&n.className.indexOf("k-auto-scrollable")>-1)return!0;var t=ui(n,["overflow"]).overflow;return t=="auto"||t=="scroll"}function cr(t,r){var f=t instanceof n?t[0]:t,e=u.isRtl(t),o=u.browser.webkit,s=u.browser.mozilla;if(r!==i)f.scrollLeft=e&&o?f.scrollWidth-f.clientWidth-r:e&&s?-r:r;else return e&&o?f.scrollWidth-f.clientWidth-f.scrollLeft:Math.abs(f.scrollLeft)}function lr(n){var t=0;for(var i in n)n.hasOwnProperty(i)&&i!="toJSON"&&t++;return t}function ar(n,i,r){i||(i="offset");var f=n[i]();return u.browser.msie&&(u.pointers||u.msPointers)&&!r&&(f.top-=t.pageYOffset-document.documentElement.scrollTop,f.left-=t.pageXOffset-document.documentElement.scrollLeft),f}function vr(n){var t={};return g(typeof n=="string"?n.split(" "):n,function(n){t[n]=this}),t}function yr(n){return new r.effects.Element(n)}function pr(n,t,i,r){return typeof n===e&&(et(t)&&(r=t,t=400,i=!1),et(i)&&(r=i,i=!1),typeof t===dt&&(i=t,t=400),n={effects:n,duration:t,reverse:i,complete:r}),h({effects:{},duration:400,reverse:!1,init:nt,teardown:nt,hide:!1},n,{completeCallback:n.complete,complete:nt})}function ei(t,i,r,u,f){for(var e=0,s=t.length,o;e<s;e++)o=n(t[e]),o.queue(function(){b.promise(o,pr(i,r,u,f))});return t}function wr(n,t,i,r){return t&&(t=t.split(" "),g(t,function(t,i){n.toggleClass(i,r)})),n}function tu(n){return(""+n).replace(br,"&amp;").replace(kr,"&lt;").replace(nu,"&gt;").replace(dr,"&quot;").replace(gr,"&#39;")}function pt(n,t){var u;return t.indexOf("data")===0&&(t=t.substring(4),t=t.charAt(0).toLowerCase()+t.substring(1)),t=t.replace(fu,"-$1"),u=n.getAttribute("data-"+r.ns+t),u===null?u=i:u==="null"?u=null:u==="true"?u=!0:u==="false"?u=!1:bi.test(u)?u=parseFloat(u):ru.test(u)&&!uu.test(u)&&(u=new Function("return ("+u+")")()),u}function hi(t,u){var o={},e,f;for(e in u)f=pt(t,e),f!==i&&(iu.test(e)&&(f=r.template(n("#"+f).html())),o[e]=f);return o}function eu(t,i){return n.contains(t,i)?-1:1}function ou(){var t=n(this);return n.inArray(t.attr("data-"+r.ns+"role"),["slider","rangeslider"])>-1||t.is(":visible")}function su(n,t){var i=n.nodeName.toLowerCase();return(/input|select|textarea|button|object/.test(i)?!n.disabled:"a"===i?n.href||t:t)&&hu(n)}function hu(t){return n.expr.filters.visible(t)&&!n(t).parents().addBack().filter(function(){return n.css(this,"visibility")==="hidden"}).length}function s(n,t){return new s.fn.init(n,t)}var r=t.kendo=t.kendo||{cultures:{}},h=n.extend,g=n.each,yi=n.isArray,st=n.proxy,nt=n.noop,a=Math,p,tt=t.JSON||{},u={},it=/%/,pi=/\{(\d+)(:[^\}]+)?\}/g,wi=/(\d+(?:\.?)\d*)px\s*(\d+(?:\.?)\d*)px\s*(\d+(?:\.?)\d*)px\s*(\d+)?/i,bi=/^(\+|-?)\d+(\.?)\d*$/,c="function",e="string",v="number",w="object",rt="null",dt="boolean",ut="undefined",gt={},ni={},ht=[].slice,l=t.Globalize,fi,b,vt,oi,si,k,yt,wt,bt,li,kt,ot,ai,vi,y;r.version="2015.3.1111".replace(/^\s+|\s+$/g,"");ft.extend=function(n){var r=function(){},t,u=this,i=n&&n.init?n.init:function(){u.apply(this,arguments)},f;r.prototype=u.prototype;f=i.fn=i.prototype=new r;for(t in n)f[t]=n[t]!=null&&n[t].constructor===Object?h(!0,{},r.prototype[t],n[t]):n[t];return f.constructor=i,i.extend=u.extend,i};ft.prototype._initOptions=function(n){this.options=lt({},this.options,n)};var et=r.isFunction=function(n){return typeof n=="function"},ki=function(){this._defaultPrevented=!0},di=function(){return this._defaultPrevented===!0},ct=ft.extend({init:function(){this._events={}},bind:function(n,t,r){var u=this,f,h=typeof n===e?[n]:n,l,s,o,v=typeof t===c,a;if(t===i){for(f in n)u.bind(f,n[f]);return u}for(f=0,l=h.length;f<l;f++)n=h[f],o=v?t:t[n],o&&(r&&(s=o,o=function(){u.unbind(n,o);s.apply(u,arguments)},o.original=s),a=u._events[n]=u._events[n]||[],a.push(o));return u},one:function(n,t){return this.bind(n,t,!0)},first:function(n,t){for(var r=this,f=typeof n===e?[n]:n,u,h=typeof t===c,s,i=0,o=f.length;i<o;i++)n=f[i],u=h?t:t[n],u&&(s=r._events[n]=r._events[n]||[],s.unshift(u));return r},trigger:function(n,t){var u=this,i=u._events[n],r,f;if(i){for(t=t||{},t.sender=u,t._defaultPrevented=!1,t.preventDefault=ki,t.isDefaultPrevented=di,i=i.slice(),r=0,f=i.length;r<f;r++)i[r].call(u,t);return t._defaultPrevented===!0}return!1},unbind:function(n,t){var f=this,u=f._events[n],r;if(n===i)f._events={};else if(u)if(t)for(r=u.length-1;r>=0;r--)(u[r]===t||u[r].original===t)&&u.splice(r,1);else f._events[n]=[];return f}});var nr=/^\w+/,tr=/\$\{([^}]*)\}/g,ir=/\\\}/g,rr=/__CURLY__/g,ur=/\\#/g,fr=/__SHARP__/g,er=["","0","00","000","0000"];p={paramName:"data",useWithBlock:!0,render:function(n,t){for(var u="",i=0,r=t.length;i<r;i++)u+=n(t[i]);return u},compile:function(n,t){var o=h({},this,t),s=o.paramName,l=s.match(nr)[0],c=o.useWithBlock,i="var $kendoOutput, $kendoHtmlEncode = kendo.htmlEncode;",e,f,u;if(et(n))return n;for(i+=c?"with("+s+"){":"",i+="$kendoOutput=",f=n.replace(ir,"__CURLY__").replace(tr,"#=$kendoHtmlEncode($1)#").replace(rr,"}").replace(ur,"__SHARP__").split("#"),u=0;u<f.length;u++)i+=gi(f[u],u%2==0);i+=c?";}":";";i+="return $kendoOutput;";i=i.replace(fr,"#");try{return e=new Function(l,i),e._slotCount=Math.floor(f.length/2),e}catch(a){throw new Error(r.format("Invalid template:'{0}' Generated code:'{1}'",n,i));}}},function(){function o(n){return u.lastIndex=0,u.test(n)?'"'+n.replace(u,function(n){var t=s[n];return typeof t===e?t:"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+n+'"'}function r(u,f){var l,p,a,k,d=n,y,s=f[u],b;if(s&&typeof s===w&&typeof s.toJSON===c&&(s=s.toJSON(u)),typeof t===c&&(s=t.call(f,u,s)),b=typeof s,b===e)return o(s);if(b===v)return isFinite(s)?String(s):rt;if(b===dt||b===rt)return String(s);if(b===w){if(!s)return rt;if(n+=i,y=[],h.apply(s)==="[object Array]"){for(k=s.length,l=0;l<k;l++)y[l]=r(l,s)||rt;return a=y.length===0?"[]":n?"[\n"+n+y.join(",\n"+n)+"\n"+d+"]":"["+y.join(",")+"]",n=d,a}if(t&&typeof t===w)for(k=t.length,l=0;l<k;l++)typeof t[l]===e&&(p=t[l],a=r(p,s),a&&y.push(o(p)+(n?": ":":")+a));else for(p in s)Object.hasOwnProperty.call(s,p)&&(a=r(p,s),a&&y.push(o(p)+(n?": ":":")+a));return a=y.length===0?"{}":n?"{\n"+n+y.join(",\n"+n)+"\n"+d+"}":"{"+y.join(",")+"}",n=d,a}}var u=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n,i,s={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},t,h={}.toString;typeof Date.prototype.toJSON!==c&&(Date.prototype.toJSON=function(){var n=this;return isFinite(n.valueOf())?f(n.getUTCFullYear(),4)+"-"+f(n.getUTCMonth()+1)+"-"+f(n.getUTCDate())+"T"+f(n.getUTCHours())+":"+f(n.getUTCMinutes())+":"+f(n.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});typeof tt.stringify!==c&&(tt.stringify=function(u,f,o){var s;if(n="",i="",typeof o===v)for(s=0;s<o;s+=1)i+=" ";else typeof o===e&&(i=o);if(t=f,f&&typeof f!==c&&(typeof f!==w||typeof f.length!==v))throw new Error("JSON.stringify");return r("",{"":u})})}(),function(){function w(n){if(n){if(n.numberFormat)return n;if(typeof n===e){var t=r.cultures;return t[n]||t[n.split("-")[0]]||null}return null}return null}function b(n){return n&&(n=w(n)),n||r.cultures.current}function rt(n){n.groupSizes=n.groupSize;n.percent.groupSizes=n.percent.groupSize;n.currency.groupSizes=n.currency.groupSize}function ut(n,t,r){r=b(r);var u=r.calendars.standard,e=u.days,o=u.months;return t=u.patterns[t]||t,t.replace(d,function(t){var s,r,h;return t==="d"?r=n.getDate():t==="dd"?r=f(n.getDate()):t==="ddd"?r=e.namesAbbr[n.getDay()]:t==="dddd"?r=e.names[n.getDay()]:t==="M"?r=n.getMonth()+1:t==="MM"?r=f(n.getMonth()+1):t==="MMM"?r=o.namesAbbr[n.getMonth()]:t==="MMMM"?r=o.names[n.getMonth()]:t==="yy"?r=f(n.getFullYear()%100):t==="yyyy"?r=f(n.getFullYear(),4):t==="h"?r=n.getHours()%12||12:t==="hh"?r=f(n.getHours()%12||12):t==="H"?r=n.getHours():t==="HH"?r=f(n.getHours()):t==="m"?r=n.getMinutes():t==="mm"?r=f(n.getMinutes()):t==="s"?r=n.getSeconds():t==="ss"?r=f(n.getSeconds()):t==="f"?r=a.floor(n.getMilliseconds()/100):t==="ff"?(r=n.getMilliseconds(),r>99&&(r=a.floor(r/10)),r=f(r)):t==="fff"?r=f(n.getMilliseconds(),3):t==="tt"?r=n.getHours()<12?u.AM[0]:u.PM[0]:t==="zzz"?(s=n.getTimezoneOffset(),h=s<0,r=a.abs(s/60).toString().split(".")[0],s=a.abs(s)-r*60,r=(h?"+":"-")+f(r)+(":"+f(s))):(t==="zz"||t==="z")&&(r=n.getTimezoneOffset()/60,h=r<0,r=a.abs(r).toString().split(".")[0],r=(h?"+":"-")+(t==="zz"?f(r):r)),r!==i?r:t.slice(1,t.length-1)})}function ft(n,r,f){f=b(f);var l=f.numberFormat,ot=l.groupSize[0],lt=l[c],vt=l[u],at=l.decimals,kt=l.pattern[0],dt=[],yt,ft,st,pt,wt,et=n<0,w,p,rt,ei,gt=t,y=t,e,ut,d,ni,ri,it,v,a,bt,ti,ui,ii,fi,ht=-1,ct;if(n===i)return t;if(!isFinite(n))return n;if(!r)return f.name.length?n.toLocaleString():n.toString();if(wt=g.exec(r),wt){if(r=wt[1].toLowerCase(),ft=r==="c",st=r==="p",(ft||st)&&(l=ft?l.currency:l.percent,ot=l.groupSize[0],lt=l[c],vt=l[u],at=l.decimals,yt=l.symbol,kt=l.pattern[et?0:1]),pt=wt[2],pt&&(at=+pt),r==="e")return pt?n.toExponential(at):n.toExponential();if(st&&(n*=100),n=o(n,at),et=n<0,n=n.split(u),w=n[0],p=n[1],et&&(w=w.substring(1)),y=w,rt=w.length,rt>=ot)for(y=t,e=0;e<rt;e++)e>0&&(rt-e)%ot==0&&(y+=lt),y+=w.charAt(e);if(p&&(y+=vt+p),r==="n"&&!et)return y;for(n=t,e=0,ut=kt.length;e<ut;e++)d=kt.charAt(e),n+=d==="n"?y:d==="$"||d==="%"?yt:d;return n}if(et&&(n=-n),(r.indexOf("'")>-1||r.indexOf('"')>-1||r.indexOf("\\")>-1)&&(r=r.replace(nt,function(n){var t=n.charAt(0).replace("\\",""),i=n.slice(1).replace(t,"");return dt.push(i),k})),r=r.split(";"),et&&r[1])r=r[1],ri=!0;else if(n===0){if(r=r[2]||r[0],r.indexOf(s)==-1&&r.indexOf(h)==-1)return r}else r=r[0];if(ui=r.indexOf("%"),ii=r.indexOf("$"),st=ui!=-1,ft=ii!=-1,st&&(n*=100),ft&&r[ii-1]==="\\"&&(r=r.split("\\").join(""),ft=!1),(ft||st)&&(l=ft?l.currency:l.percent,ot=l.groupSize[0],lt=l[c],vt=l[u],at=l.decimals,yt=l.symbol),ni=r.indexOf(c)>-1,ni&&(r=r.replace(tt,t)),it=r.indexOf(u),ut=r.length,it!=-1?(p=n.toString().split("e"),p=p[1]?o(n,Math.abs(p[1])):p[0],p=p.split(u)[1]||t,a=r.lastIndexOf(h)-it,v=r.lastIndexOf(s)-it,bt=a>-1,ti=v>-1,e=p.length,bt||ti||(r=r.substring(0,it)+r.substring(it+1),ut=r.length,it=-1,e=0),bt&&a>v?e=a:v>a&&(ti&&e>v?e=v:bt&&e<a&&(e=a)),e>-1&&(n=o(n,e))):n=o(n),v=r.indexOf(s),fi=a=r.indexOf(h),ht=v==-1&&a!=-1?a:v!=-1&&a==-1?v:v>a?a:v,v=r.lastIndexOf(s),a=r.lastIndexOf(h),ct=v==-1&&a!=-1?a:v!=-1&&a==-1?v:v>a?v:a,ht==ut&&(ct=ht),ht!=-1){if(y=n.toString().split(u),w=y[0],p=y[1]||t,rt=w.length,ei=p.length,et&&n*-1>=0&&(et=!1),ni)if(rt===ot&&rt<it-fi)w=lt+w;else if(rt>ot){for(y=t,e=0;e<rt;e++)e>0&&(rt-e)%ot==0&&(y+=lt),y+=w.charAt(e);w=y}for(n=r.substring(0,ht),et&&!ri&&(n+="-"),e=ht;e<ut;e++){if(d=r.charAt(e),it==-1){if(ct-e<rt){n+=w;break}}else if(a!=-1&&a<e&&(gt=t),it-e<=rt&&it-e>-1&&(n+=w,e=it),it===e){n+=(p?vt:t)+p;e+=ct-it+1;continue}d===h?(n+=d,gt=d):d===s&&(n+=gt)}if(ct>=ht&&(n+=r.substring(ct+1)),ft||st){for(y=t,e=0,ut=n.length;e<ut;e++)d=n.charAt(e),y+=d==="$"||d==="%"?yt:d;n=y}if(ut=dt.length,ut)for(e=0;e<ut;e++)n=n.replace(k,dt[e])}return n}var d=/dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|HH|H|hh|h|mm|m|fff|ff|f|tt|ss|s|zzz|zz|z|"[^"]*"|'[^']*'/g,g=/^(n|c|p|e)(\d*)$/i,nt=/(\\.)|(['][^']*[']?)|(["][^"]*["]?)/g,tt=/\,/g,t="",u=".",c=",",s="#",h="0",k="??",p="en-US",it={}.toString,o,y;r.cultures["en-US"]={name:p,numberFormat:{pattern:["-n"],decimals:2,",":",",".":".",groupSize:[3],percent:{pattern:["-n %","n %"],decimals:2,",":",",".":".",groupSize:[3],symbol:"%"},currency:{name:"US Dollar",abbr:"USD",pattern:["($n)","$n"],decimals:2,",":",",".":".",groupSize:[3],symbol:"$"}},calendars:{standard:{days:{names:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],namesAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],namesShort:["Su","Mo","Tu","We","Th","Fr","Sa"]},months:{names:["January","February","March","April","May","June","July","August","September","October","November","December"],namesAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},AM:["AM","am","AM"],PM:["PM","pm","PM"],patterns:{d:"M/d/yyyy",D:"dddd, MMMM dd, yyyy",F:"dddd, MMMM dd, yyyy h:mm:ss tt",g:"M/d/yyyy h:mm tt",G:"M/d/yyyy h:mm:ss tt",m:"MMMM dd",M:"MMMM dd",s:"yyyy'-'MM'-'ddTHH':'mm':'ss",t:"h:mm tt",T:"h:mm:ss tt",u:"yyyy'-'MM'-'dd HH':'mm':'ss'Z'",y:"MMMM, yyyy",Y:"MMMM, yyyy"},"/":"/",":":":",firstDay:0,twoDigitYearMax:2029}}};r.culture=function(n){var u=r.cultures,t;if(n!==i)t=w(n)||u[p],t.calendar=t.calendars.standard,u.current=t,l&&!l.load&&rt(t.numberFormat);else return u.current};r.findCulture=w;r.getCulture=b;r.culture(p);o=function(n,t){return t=t||0,n=n.toString().split("e"),n=Math.round(+(n[0]+"e"+(n[1]?+n[1]+t:t))),n=n.toString().split("e"),n=+(n[0]+"e"+(n[1]?+n[1]-t:-t)),n.toFixed(t)};y=function(n,t,r){if(t){if(it.call(n)==="[object Date]")return ut(n,t,r);if(typeof n===v)return ft(n,t,r)}return n!==i?n:""};l&&!l.load&&(y=function(t,i,r){return n.isPlainObject(r)&&(r=r.name),l.format(t,i,r)});r.format=function(n){var t=arguments;return n.replace(pi,function(n,i,r){var u=t[parseInt(i,10)+1];return y(u,r?r.substring(1):"")})};r._extractFormat=function(n){return n.slice(0,3)==="{0:"&&(n=n.slice(3,n.length-1)),n};r._activeElement=function(){try{return document.activeElement}catch(n){return document.documentElement.activeElement}};r._round=o;r.toString=y}(),function(){function t(n,t,i){return!(n>=t&&n<=i)}function b(n){return n.charAt(0)}function s(t){return n.map(t,b)}function k(n,t){t||n.getHours()!==23||n.setHours(n.getHours()+2)}function d(n){for(var t=0,r=n.length,i=[];t<r;t++)i[t]=(n[t]+"").toLowerCase();return i}function h(n){var t={};for(var i in n)t[i]=d(n[i]);return t}function g(n,r,u){if(!n)return null;var d=function(n){for(var t=0;r[ut]===n;)t++,ut++;return t>0&&(ut-=1),t},tt=function(t){var r=e[t]||new RegExp("^\\d{1,"+t+"}"),i=n.substr(p,t).match(r);return i?(i=i[0],p+=i.length,parseInt(i,10)):null},ht=function(t,i){for(var r=0,h=t.length,o,u,f=0,s=0,e;r<h;r++)o=t[r],u=o.length,e=n.substr(p,u),i&&(e=e.toLowerCase()),e==o&&u>f&&(f=u,s=r);return f?(p+=f,s+1):null},ct=function(){var t=!1;return n.charAt(p)===r[ut]&&(p++,t=!0),t},v=u.calendars.standard,c=null,it=null,w=null,o=null,rt=null,ft=null,g=null,ut=0,p=0,yt=!1,pt=new Date,lt=v.twoDigitYearMax||2029,ot=pt.getFullYear(),l,f,dt,wt,bt,kt,et,at,vt,b,nt,gt,st;for(r||(r="d"),wt=v.patterns[r],wt&&(r=wt),r=r.split(""),dt=r.length;ut<dt;ut++)if(l=r[ut],yt)l==="'"?yt=!1:ct();else if(l==="d"){if(f=d("d"),v._lowerDays||(v._lowerDays=h(v.days)),w!==null&&f>2)continue;if(w=f<3?tt(2):ht(v._lowerDays[f==3?"namesAbbr":"names"],!0),w===null||t(w,1,31))return null}else if(l==="M"){if(f=d("M"),v._lowerMonths||(v._lowerMonths=h(v.months)),it=f<3?tt(2):ht(v._lowerMonths[f==3?"namesAbbr":"names"],!0),it===null||t(it,1,12))return null;it-=1}else if(l==="y"){if(f=d("y"),c=tt(f),c===null)return null;f==2&&(typeof lt=="string"&&(lt=ot+parseInt(lt,10)),c=ot-ot%100+c,c>lt&&(c-=100))}else if(l==="h"){if(d("h"),o=tt(2),o==12&&(o=0),o===null||t(o,0,11))return null}else if(l==="H"){if(d("H"),o=tt(2),o===null||t(o,0,23))return null}else if(l==="m"){if(d("m"),rt=tt(2),rt===null||t(rt,0,59))return null}else if(l==="s"){if(d("s"),ft=tt(2),ft===null||t(ft,0,59))return null}else if(l==="f"){if(f=d("f"),st=n.substr(p,f).match(e[3]),g=tt(f),g!==null&&(st=st[0].length,st<3&&(g*=Math.pow(10,3-st)),f>3&&(g=parseInt(g.toString().substring(0,3),10))),g===null||t(g,0,999))return null}else if(l==="t"){if(f=d("t"),at=v.AM,vt=v.PM,f===1&&(at=s(at),vt=s(vt)),bt=ht(vt),!bt&&!ht(at))return null}else if(l==="z"){if(kt=!0,f=d("z"),n.substr(p,1)==="Z"){ct();continue}if((et=n.substr(p,6).match(f>2?y:a),!et)||(et=et[0].split(":"),b=et[0],nt=et[1],!nt&&b.length>3&&(p=b.length-2,nt=b.substring(p),b=b.substring(0,p)),b=parseInt(b,10),t(b,-12,13))||f>2&&(nt=parseInt(nt,10),isNaN(nt)||t(nt,0,59)))return null}else if(l==="'")yt=!0,ct();else if(!ct())return null;return(gt=o!==null||rt!==null||ft||null,c===null&&it===null&&w===null&&gt?(c=ot,it=pt.getMonth(),w=pt.getDate()):(c===null&&(c=ot),w===null&&(w=1)),bt&&o<12&&(o+=12),kt?(b&&(o+=-b),nt&&(rt+=-nt),n=new Date(Date.UTC(c,it,w,o,rt,ft,g))):(n=new Date(c,it,w,o,rt,ft,g),k(n,o)),c<100&&n.setFullYear(c),n.getDate()!==w&&kt===i)?null:n}function nt(n){var t=n.substr(0,1)==="-"?-1:1;return n=n.substring(1),n=parseInt(n.substr(0,2),10)*60+parseInt(n.substring(2),10),t*n}var u=/\u00A0/g,c=/[eE][\-+]?[0-9]+/,a=/[+|\-]\d{1,2}/,y=/[+|\-]\d{1,2}:?\d{2}/,p=/^\/Date\((.*?)\)\/$/,w=/[+-]\d*/,f=["G","g","d","F","D","y","m","T","t"],e={2:/^\d{1,2}/,3:/^\d{1,3}/,4:/^\d{4}/},o={}.toString;r.parseDate=function(n,t,i){if(o.call(n)==="[object Date]")return n;var e=0,u=null,h,c,s;if(n&&n.indexOf("/D")===0&&(u=p.exec(n),u))return u=u[1],s=w.exec(u.substring(1)),u=new Date(parseInt(u,10)),s&&(s=nt(s[0]),u=r.timezone.apply(u,0),u=r.timezone.convert(u,0,-1*s)),u;if(i=r.getCulture(i),!t){for(t=[],c=i.calendar.patterns,h=f.length;e<h;e++)t[e]=c[f[e]];e=0;t=["yyyy/MM/dd HH:mm:ss","yyyy/MM/dd HH:mm","yyyy/MM/dd","ddd MMM dd yyyy HH:mm:ss","yyyy-MM-ddTHH:mm:ss.fffffffzzz","yyyy-MM-ddTHH:mm:ss.fffzzz","yyyy-MM-ddTHH:mm:sszzz","yyyy-MM-ddTHH:mm:ss.fffffff","yyyy-MM-ddTHH:mm:ss.fff","yyyy-MM-ddTHH:mmzzz","yyyy-MM-ddTHH:mmzz","yyyy-MM-ddTHH:mm:ss","yyyy-MM-ddTHH:mm","yyyy-MM-dd HH:mm:ss","yyyy-MM-dd HH:mm","yyyy-MM-dd","HH:mm:ss","HH:mm"].concat(t)}for(t=yi(t)?t:[t],h=t.length;e<h;e++)if(u=g(n,t[e],i),u)return u;return u};r.parseInt=function(n,t){var i=r.parseFloat(n,t);return i&&(i=i|0),i};r.parseFloat=function(n,t,i){if(!n&&n!==0)return null;if(typeof n===v)return n;n=n.toString();t=r.getCulture(t);var f=t.numberFormat,h=f.percent,l=f.currency,s=l.symbol,a=h.symbol,e=n.indexOf("-"),o,y;return c.test(n)?(n=parseFloat(n.replace(f["."],".")),isNaN(n)&&(n=null),n):e>0?null:(e=e>-1,n.indexOf(s)>-1||i&&i.toLowerCase().indexOf("c")>-1?(f=l,o=f.pattern[0].replace("$",s).split("n"),n.indexOf(o[0])>-1&&n.indexOf(o[1])>-1&&(n=n.replace(o[0],"").replace(o[1],""),e=!0)):n.indexOf(a)>-1&&(y=!0,f=h,s=a),n=n.replace("-","").replace(s,"").replace(u," ").split(f[","].replace(u," ")).join("").replace(f["."],"."),n=parseFloat(n),isNaN(n)?n=null:e&&(n*=-1),n&&y&&(n/=100),n)};l&&!l.load&&(r.parseDate=function(n,t,i){return o.call(n)==="[object Date]"?n:l.parseDate(n,t,i)},r.parseFloat=function(t,r){return typeof t===v?t:t===i||t===null?null:(n.isPlainObject(r)&&(r=r.name),t=l.parseFloat(t,r),isNaN(t)?null:t)})}(),function(){var s,f,r,l;u._scrollbar=i;u.scrollbar=function(n){if(isNaN(u._scrollbar)||n){var t=document.createElement("div"),i;return t.style.cssText="overflow:scroll;overflow-x:hidden;zoom:1;clear:both;display:block",t.innerHTML="&nbsp;",document.body.appendChild(t),u._scrollbar=i=t.offsetWidth-t.scrollWidth,document.body.removeChild(t),i}return u._scrollbar};u.isRtl=function(t){return n(t).closest(".k-rtl").length>0};s=document.createElement("table");try{s.innerHTML="<tr><td><\/td><\/tr>";u.tbodyInnerHtml=!0}catch(a){u.tbodyInnerHtml=!1}u.touch="ontouchstart"in t;u.msPointers=t.MSPointerEvent;u.pointers=t.PointerEvent;var h=u.transitions=!1,c=u.transforms=!1,o="HTMLElement"in t?HTMLElement.prototype:[];u.hasHW3D="WebKitCSSMatrix"in t&&"m11"in new t.WebKitCSSMatrix||"MozPerspective"in document.documentElement.style||"msPerspective"in document.documentElement.style;g(["Moz","webkit","O","ms"],function(){var t=this.toString(),i=typeof s.style[t+"Transition"]===e,n;if(i||typeof s.style[t+"Transform"]===e)return n=t.toLowerCase(),c={css:n!="ms"?"-"+n+"-":"",prefix:t,event:n==="o"||n==="webkit"?n:""},i&&(h=c,h.event=h.event?h.event+"TransitionEnd":"transitionend"),!1});s=null;u.transforms=c;u.transitions=h;u.devicePixelRatio=t.devicePixelRatio===i?1:t.devicePixelRatio;try{u.screenWidth=t.outerWidth||t.screen?t.screen.availWidth:t.innerWidth;u.screenHeight=t.outerHeight||t.screen?t.screen.availHeight:t.innerHeight}catch(a){u.screenWidth=t.screen.availWidth;u.screenHeight=t.screen.availHeight}u.detectOS=function(n){var i=!1,f,e=[],s=!/mobile safari/i.test(n),o={wp:/(Windows Phone(?: OS)?)\s(\d+)\.(\d+(\.\d+)?)/,fire:/(Silk)\/(\d+)\.(\d+(\.\d+)?)/,android:/(Android|Android.*(?:Opera|Firefox).*?\/)\s*(\d+)\.(\d+(\.\d+)?)/,iphone:/(iPhone|iPod).*OS\s+(\d+)[\._]([\d\._]+)/,ipad:/(iPad).*OS\s+(\d+)[\._]([\d_]+)/,meego:/(MeeGo).+NokiaBrowser\/(\d+)\.([\d\._]+)/,webos:/(webOS)\/(\d+)\.(\d+(\.\d+)?)/,blackberry:/(BlackBerry|BB10).*?Version\/(\d+)\.(\d+(\.\d+)?)/,playbook:/(PlayBook).*?Tablet\s*OS\s*(\d+)\.(\d+(\.\d+)?)/,windows:/(MSIE)\s+(\d+)\.(\d+(\.\d+)?)/,tizen:/(tizen).*?Version\/(\d+)\.(\d+(\.\d+)?)/i,sailfish:/(sailfish).*rv:(\d+)\.(\d+(\.\d+)?).*firefox/i,ffos:/(Mobile).*rv:(\d+)\.(\d+(\.\d+)?).*Firefox/},h={ios:/^i(phone|pad|pod)$/i,android:/^android|fire$/i,blackberry:/^blackberry|playbook/i,windows:/windows/,wp:/wp/,flat:/sailfish|ffos|tizen/i,meego:/meego/},c={tablet:/playbook|ipad|fire/i},l={omini:/Opera\sMini/i,omobile:/Opera\sMobi/i,firefox:/Firefox|Fennec/i,mobilesafari:/version\/.*safari/i,ie:/MSIE|Windows\sPhone/i,chrome:/chrome|crios/i,webkit:/webkit/i};for(var r in o)if(o.hasOwnProperty(r)&&(e=n.match(o[r]),e)){if(r=="windows"&&"plugins"in navigator)return!1;i={};i.device=r;i.tablet=at(r,c,!1);i.browser=at(n,l,"default");i.name=at(r,h);i[i.name]=!0;i.majorVersion=e[2];i.minorVersion=e[3].replace("_",".");f=i.minorVersion.replace(".","").substr(0,2);i.flatVersion=i.majorVersion+f+new Array(3-(f.length<3?f.length:2)).join("0");i.cordova=typeof t.PhoneGap!==ut||typeof t.cordova!==ut;i.appMode=t.navigator.standalone||/file|local|wmapp/.test(t.location.protocol)||i.cordova;i.android&&(u.devicePixelRatio<1.5&&i.flatVersion<400||s)&&(u.screenWidth>800||u.screenHeight>800)&&(i.tablet=r);break}return i};f=u.mobileOS=u.detectOS(navigator.userAgent);u.wpDevicePixelRatio=f.wp?screen.width/320:0;u.kineticScrollNeeded=f&&(u.touch||u.msPointers||u.pointers);u.hasNativeScrolling=!1;(f.ios||f.android&&f.majorVersion>2||f.wp)&&(u.hasNativeScrolling=f);u.mouseAndTouchPresent=u.touch&&!(u.mobileOS.ios||u.mobileOS.android);u.detectBrowser=function(n){var t=!1,i=[],r={edge:/(edge)[ \/]([\w.]+)/i,webkit:/(chrome)[ \/]([\w.]+)/i,safari:/(webkit)[ \/]([\w.]+)/i,opera:/(opera)(?:.*version|)[ \/]([\w.]+)/i,msie:/(msie\s|trident.*? rv:)([\w.]+)/i,mozilla:/(mozilla)(?:.*? rv:([\w.]+)|)/i};for(var u in r)if(r.hasOwnProperty(u)&&(i=n.match(r[u]),i)){t={};t[u]=!0;t[i[1].toLowerCase().split(" ")[0].split("/")[0]]=!0;t.version=parseInt(document.documentMode||i[2],10);break}return t};u.browser=u.detectBrowser(navigator.userAgent);u.detectClipboardAccess=function(){var n={copy:document.queryCommandSupported?document.queryCommandSupported("copy"):!1,cut:document.queryCommandSupported?document.queryCommandSupported("cut"):!1,paste:document.queryCommandSupported?document.queryCommandSupported("paste"):!1};return u.browser.chrome&&u.browser.version>=43&&(n.copy=!0,n.cut=!0),n};u.clipboard=u.detectClipboardAccess();u.zoomLevel=function(){try{var n=u.browser,r=0,i=document.documentElement;return n.msie&&n.version==11&&i.scrollHeight>i.clientHeight&&!u.touch&&(r=u.scrollbar()),u.touch?i.clientWidth/t.innerWidth:n.msie&&n.version>=10?((top||t).document.documentElement.offsetWidth+r)/(top||t).innerWidth:1}catch(f){return 1}};u.cssBorderSpacing=typeof document.documentElement.style.borderSpacing!="undefined"&&!(u.browser.msie&&u.browser.version<8),function(t){var i="",r=n(document.documentElement),f=parseInt(t.version,10);t.msie?i="ie":t.mozilla?i="ff":t.safari?i="safari":t.webkit?i="webkit":t.opera?i="opera":t.edge&&(i="edge");i&&(i="k-"+i+" k-"+i+f);u.mobileOS&&(i+=" k-mobile");r.addClass(i)}(u.browser);u.eventCapture=document.documentElement.addEventListener;r=document.createElement("input");u.placeholder="placeholder"in r;u.propertyChangeEvent="onpropertychange"in r;u.input=function(){for(var i=["number","date","time","month","week","datetime","datetime-local"],e=i.length,u="test",f={},n=0,t;n<e;n++)t=i[n],r.setAttribute("type",t),r.value=u,f[t.replace("-","")]=r.type!=="text"&&r.value!==u;return f}();r.style.cssText="float:left;";u.cssFloat=!!r.style.cssFloat;r=null;u.stableSort=function(){for(var n=[{index:0,field:"b"}],t=1;t<513;t++)n.push({index:t,field:"a"});return n.sort(function(n,t){return n.field>t.field?1:n.field<t.field?-1:0}),n[0].index===1}();u.matchesSelector=o.webkitMatchesSelector||o.mozMatchesSelector||o.msMatchesSelector||o.oMatchesSelector||o.matchesSelector||o.matches||function(t){for(var i=document.querySelectorAll?(this.parentNode||document).querySelectorAll(t)||[]:n(t),r=i.length;r--;)if(i[r]==this)return!0;return!1};u.pushState=t.history&&t.history.pushState;l=document.documentMode;u.hashChange="onhashchange"in t&&!(u.browser.msie&&(!l||l<=8));u.customElements="registerElement"in t.document}();fi={left:{reverse:"right"},right:{reverse:"left"},down:{reverse:"up"},up:{reverse:"down"},top:{reverse:"bottom"},bottom:{reverse:"top"},"in":{reverse:"out"},out:{reverse:"in"}};b={};n.extend(b,{enabled:!0,Element:function(t){this.element=n(t)},promise:function(n,t){n.is(":visible")||n.css({display:n.data("olddisplay")||"block"}).css("display");t.hide&&n.data("olddisplay",n.css("display")).hide();t.init&&t.init();t.completeCallback&&t.completeCallback(n);n.dequeue()},disable:function(){this.enabled=!1;this.promise=this.promiseShim},enable:function(){this.enabled=!0;this.promise=this.animatedPromise}});b.promiseShim=b.promise;"kendoAnimate"in n.fn||h(n.fn,{kendoStop:function(n,t){return this.stop(n,t)},kendoAnimate:function(n,t,i,r){return ei(this,n,t,i,r)},kendoAddClass:function(n,t){return r.toggleClass(this,n,t,!0)},kendoRemoveClass:function(n,t){return r.toggleClass(this,n,t,!1)},kendoToggleClass:function(n,t,i){return r.toggleClass(this,n,t,i)}});var br=/&/g,kr=/</g,dr=/"/g,gr=/'/g,nu=/>/g;vt=function(n){return n.target};u.touch&&(vt=function(n){var t="originalEvent"in n?n.originalEvent.changedTouches:"changedTouches"in n?n.changedTouches:null;return t?document.elementFromPoint(t[0].clientX,t[0].clientY):n.target},g(["swipe","swipeLeft","swipeRight","swipeUp","swipeDown","doubleTap","tap"],function(t,i){n.fn[i]=function(n){return this.bind(i,n)}}));u.touch?u.mobileOS?(u.mousedown="touchstart",u.mouseup="touchend",u.mousemove="touchmove",u.mousecancel="touchcancel",u.click="touchend",u.resize="orientationchange"):(u.mousedown="mousedown touchstart",u.mouseup="mouseup touchend",u.mousemove="mousemove touchmove",u.mousecancel="mouseleave touchcancel",u.click="click",u.resize="resize"):u.pointers?(u.mousemove="pointermove",u.mousedown="pointerdown",u.mouseup="pointerup",u.mousecancel="pointercancel",u.click="pointerup",u.resize="orientationchange resize"):u.msPointers?(u.mousemove="MSPointerMove",u.mousedown="MSPointerDown",u.mouseup="MSPointerUp",u.mousecancel="MSPointerCancel",u.click="MSPointerUp",u.resize="orientationchange resize"):(u.mousemove="mousemove",u.mousedown="mousedown",u.mouseup="mouseup",u.mousecancel="mouseleave",u.click="click",u.resize="resize");oi=function(n,t){for(var o=t||"d",r,i,e=1,u=0,f=n.length;u<f;u++)i=n[u],i!==""&&(r=i.indexOf("["),r!==0&&(r==-1?i="."+i:(e++,i="."+i.substring(0,r)+" || {})"+i.substring(r))),e++,o+=i+(u<f-1?" || {})":")"));return new Array(e).join("(")+o};si=/^([a-z]+:)?\/\//i;h(r,{widgets:[],_widgetRegisteredCallbacks:[],ui:r.ui||{},fx:r.fx||yr,effects:r.effects||b,mobile:r.mobile||{},data:r.data||{},dataviz:r.dataviz||{},drawing:r.drawing||{},spreadsheet:{messages:{}},keys:{INSERT:45,DELETE:46,BACKSPACE:8,TAB:9,ENTER:13,ESC:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,END:35,HOME:36,SPACEBAR:32,PAGEUP:33,PAGEDOWN:34,F2:113,F10:121,F12:123,NUMPAD_PLUS:107,NUMPAD_MINUS:109,NUMPAD_DOT:110},support:r.support||u,animate:r.animate||ei,ns:"",attr:function(n){return"data-"+r.ns+n},getShadows:ti,wrap:or,deepExtend:lt,getComputedStyles:ui,webComponents:r.webComponents||[],isScrollable:hr,scrollLeft:cr,size:lr,toCamelCase:ri,toHyphens:sr,getOffset:r.getOffset||ar,parseEffects:r.parseEffects||vr,toggleClass:r.toggleClass||wr,directions:r.directions||fi,Observable:ct,Class:ft,Template:p,template:st(p.compile,p),render:st(p.render,p),stringify:st(tt.stringify,tt),eventTarget:vt,htmlEncode:tu,isLocalUrl:function(n){return n&&!si.test(n)},expr:function(n,t,i){return n=n||"",typeof t==e&&(i=t,t=!1),i=i||"d",n&&n.charAt(0)!=="["&&(n="."+n),t?(n=n.replace(/"([^.]*)\.([^"]*)"/g,'"$1_$DOT$_$2"'),n=n.replace(/'([^.]*)\.([^']*)'/g,"'$1_$DOT$_$2'"),n=oi(n.split("."),i),n=n.replace(/_\$DOT\$_/g,".")):n=i+n,n},getter:function(n,t){var i=n+t;return gt[i]=gt[i]||new Function("d","return "+r.expr(n,t))},setter:function(n){return ni[n]=ni[n]||new Function("d,value",r.expr(n)+"=value")},accessor:function(n){return{get:r.getter(n),set:r.setter(n)}},guid:function(){for(var t="",i,n=0;n<32;n++)i=a.random()*16|0,(n==8||n==12||n==16||n==20)&&(t+="-"),t+=(n==12?4:n==16?i&3|8:i).toString(16);return t},roleSelector:function(n){return n.replace(/(\S+)/g,"["+r.attr("role")+"=$1],").slice(0,-1)},directiveSelector:function(n){var t=n.split(" "),i;if(t)for(i=0;i<t.length;i++)t[i]!="view"&&(t[i]=t[i].replace(/(\w*)(view|bar|strip|over)$/,"$1-$2"));return t.join(" ").replace(/(\S+)/g,"kendo-mobile-$1,").slice(0,-1)},triggeredByInput:function(n){return/^(label|input|textarea|select)$/i.test(n.target.tagName)},onWidgetRegistered:function(n){for(var t=0,i=r.widgets.length;t<i;t++)n(r.widgets[t]);r._widgetRegisteredCallbacks.push(n)},logToConsole:function(n){var i=t.console;!r.suppressLog&&typeof i!="undefined"&&i.log&&i.log(n)}});k=ct.extend({init:function(n,t){var i=this,u;i.element=r.jQuery(n).handler(i);i.angular("init",t);ct.fn.init.call(i);u=t?t.dataSource:null;u&&(t=h({},t,{dataSource:{}}));t=i.options=h(!0,{},i.options,t);u&&(t.dataSource=u);i.element.attr(r.attr("role"))||i.element.attr(r.attr("role"),(t.name||"").toLowerCase());i.element.data("kendo"+t.prefix+t.name,i);i.bind(i.events,t)},events:[],options:{prefix:""},_hasBindingTarget:function(){return!!this.element[0].kendoBindingTarget},_tabindex:function(n){n=n||this.wrapper;var i=this.element,t="tabindex",r=n.attr(t)||i.attr(t);i.removeAttr(t);n.attr(t,isNaN(r)?0:r)},setOptions:function(t){this._setEvents(t);n.extend(this.options,t)},_setEvents:function(n){for(var t=this,r=0,u=t.events.length,i;r<u;r++)i=t.events[r],t.options[i]&&n[i]&&t.unbind(i,t.options[i]);t.bind(t.events,n)},resize:function(n){var t=this.getSize(),i=this._size;(n||(t.width>0||t.height>0)&&(!i||t.width!==i.width||t.height!==i.height))&&(this._size=t,this._resize(t,n),this.trigger("resize",t))},getSize:function(){return r.dimensions(this.element)},size:function(n){if(n)this.setSize(n);else return this.getSize()},setSize:n.noop,_resize:n.noop,destroy:function(){var n=this;n.element.removeData("kendo"+n.options.prefix+n.options.name);n.element.removeData("handler");n.unbind()},_destroy:function(){this.destroy()},angular:function(){},_muteAngularRebind:function(n){this._muteRebind=!0;n.call(this);this._muteRebind=!1}});yt=k.extend({dataItems:function(){return this.dataSource.flatView()},_angularItems:function(t){var i=this;i.angular(t,function(){return{elements:i.items(),data:n.map(i.dataItems(),function(n){return{dataItem:n}})}})}});r.dimensions=function(n,t){var i=n[0];return t&&n.css(t),{width:i.offsetWidth,height:i.offsetHeight}};r.notify=nt;var iu=/template$/i,ru=/^\s*(?:\{(?:.|\r\n|\n)*\}|\[(?:.|\r\n|\n)*\])\s*$/,uu=/^\{(\d+)(:[^\}]+)?\}|^\[[A-Za-z_]*\]$/,fu=/([A-Z])/g;r.initWidget=function(u,f,o){var c,p,s,v,d,h,w,l,b,g,y,k,a;if(o?o.roles&&(o=o.roles):o=r.ui.roles,u=u.nodeType?u:u[0],h=u.getAttribute("data-"+r.ns+"role"),h){b=h.indexOf(".")===-1;s=b?o[h]:r.getter(h)(t);y=n(u).data();k=s?"kendo"+s.fn.options.prefix+s.fn.options.name:"";g=b?new RegExp("^kendo.*"+h+"$","i"):new RegExp("^"+k+"$","i");for(a in y)if(a.match(g))if(a===k)c=y[a];else return y[a];if(s){for(l=pt(u,"dataSource"),f=n.extend({},hi(u,s.fn.options),f),l&&(f.dataSource=typeof l===e?r.getter(l)(t):l),v=0,d=s.fn.events.length;v<d;v++)p=s.fn.events[v],w=pt(u,p),w!==i&&(f[p]=r.getter(w)(t));return c?n.isEmptyObject(f)||c.setOptions(f):c=new s(u,f),c}}};r.rolesFromNamespaces=function(n){var i=[],t,u;for(n[0]||(n=[r.ui,r.dataviz.ui]),t=0,u=n.length;t<u;t++)i[t]=n[t].roles;return h.apply(null,[{}].concat(i.reverse()))};r.init=function(t){var i=r.rolesFromNamespaces(ht.call(arguments,1));n(t).find("[data-"+r.ns+"role]").addBack().each(function(){r.initWidget(this,{},i)})};r.destroy=function(t){n(t).find("[data-"+r.ns+"role]").addBack().each(function(){var t=n(this).data();for(var i in t)i.indexOf("kendo")===0&&typeof t[i].destroy===c&&t[i].destroy()})};r.resize=function(t,i){var f=n(t).find("[data-"+r.ns+"role]").addBack().filter(ou),u;f.length&&(u=n.makeArray(f),u.sort(eu),n.each(u,function(){var t=r.widgetInstance(n(this));t&&t.resize(i)}))};r.parseOptions=hi;h(r.ui,{Widget:k,DataBoundWidget:yt,roles:{},progress:function(t,i){var u=t.find(".k-loading-mask"),o=r.support,c=o.browser,f,s,h,e;i?u.length||(f=o.isRtl(t),s=f?"right":"left",e=t.scrollLeft(),h=c.webkit?f?t[0].scrollWidth-t.width()-2*e:0:0,u=n("<div class='k-loading-mask'><span class='k-loading-text'>Loading...<\/span><div class='k-loading-image'/><div class='k-loading-color'/><\/div>").width("100%").height("100%").css("top",t.scrollTop()).css(s,Math.abs(e)+h).prependTo(t)):u&&u.remove()},plugin:function(t,u,f){var o=t.fn.options.name,l,h,s,a;for(u=u||r.ui,f=f||"",u[o]=t,u.roles[o.toLowerCase()]=t,l="getKendo"+f+o,o="kendo"+f+o,h={name:o,widget:t,prefix:f||""},r.widgets.push(h),s=0,a=r._widgetRegisteredCallbacks.length;s<a;s++)r._widgetRegisteredCallbacks[s](h);n.fn[o]=function(u){var f=this,s;return typeof u===e?(s=ht.call(arguments,1),this.each(function(){var t=n.data(this,o),e,h;if(!t)throw new Error(r.format("Cannot call method '{0}' of {1} before it is initialized",u,o));if(e=t[u],typeof e!==c)throw new Error(r.format("Cannot find method '{0}' of {1}",u,o));return h=e.apply(t,s),h!==i?(f=h,!1):void 0})):this.each(function(){return new t(this,u)}),f};n.fn[o].widget=t;n.fn[l]=function(){return this.data(o)}}});wt={bind:function(){return this},nullObject:!0,options:{}};bt=k.extend({init:function(n,t){k.fn.init.call(this,n,t);this.element.autoApplyNS();this.wrapper=this.element;this.element.addClass("km-widget")},destroy:function(){k.fn.destroy.call(this);this.element.kendoDestroy()},options:{prefix:"Mobile"},events:[],view:function(){var n=this.element.closest(r.roleSelector("view splitview modalview drawer"));return r.widgetInstance(n,r.mobile.ui)||wt},viewHasNativeScrolling:function(){var n=this.view();return n&&n.options.useNativeScrolling},container:function(){var n=this.element.closest(r.roleSelector("view layout modalview drawer splitview"));return r.widgetInstance(n.eq(0),r.mobile.ui)||wt}});h(r.mobile,{init:function(n){r.init(n,r.mobile.ui,r.ui,r.dataviz.ui)},appLevelNativeScrolling:function(){return r.mobile.application&&r.mobile.application.options&&r.mobile.application.options.useNativeScrolling},roles:{},ui:{Widget:bt,DataBoundWidget:yt.extend(bt.prototype),roles:{},plugin:function(n){r.ui.plugin(n,r.mobile.ui,"Mobile")}}});lt(r.dataviz,{init:function(n){r.init(n,r.dataviz.ui)},ui:{roles:{},themes:{},views:[],plugin:function(n){r.ui.plugin(n,r.dataviz.ui)}},roles:{}});r.touchScroller=function(t,i){return i||(i={}),i.useNative=!0,n(t).map(function(t,f){return f=n(f),u.kineticScrollNeeded&&r.mobile.ui.Scroller&&!f.data("kendoMobileScroller")?(f.kendoMobileScroller(i),f.data("kendoMobileScroller")):!1})[0]};r.preventDefault=function(n){n.preventDefault()};r.widgetInstance=function(n,i){var u=n.data(r.ns+"role"),e=[],f,o,s,h;if(u){if(u==="content"&&(u="scroller"),i)if(i[0])for(f=0,o=i.length;f<o;f++)e.push(i[f].roles[u]);else e.push(i.roles[u]);else e=[r.ui.roles[u],r.dataviz.ui.roles[u],r.mobile.ui.roles[u]];for(u.indexOf(".")>=0&&(e=[r.getter(u)(t)]),f=0,o=e.length;f<o;f++)if(s=e[f],s&&(h=n.data("kendo"+s.fn.options.prefix+s.fn.options.name),h))return h}};r.onResize=function(i){var r=i;u.mobileOS.android&&(r=function(){setTimeout(i,600)});n(t).on(u.resize,r);return r};r.unbindResize=function(i){n(t).off(u.resize,i)};r.attrValue=function(n,t){return n.data(r.ns+t)};r.days={Sunday:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6};n.extend(n.expr[":"],{kendoFocusable:function(t){var i=n.attr(t,"tabindex");return su(t,!isNaN(i)&&i>-1)}});var ci=["mousedown","mousemove","mouseenter","mouseleave","mouseover","mouseout","mouseup","click"],cu="label, input, [data-rel=external]",o={setupMouseMute:function(){var t=0,r=ci.length,f=document.documentElement,i;if(!o.mouseTrap&&u.eventCapture)for(o.mouseTrap=!0,o.bustClick=!1,o.captureMouse=!1,i=function(t){o.captureMouse&&(t.type==="click"?o.bustClick&&!n(t.target).is(cu)&&(t.preventDefault(),t.stopPropagation()):t.stopPropagation())};t<r;t++)f.addEventListener(ci[t],i,!0)},muteMouse:function(n){o.captureMouse=!0;n.data.bustClick&&(o.bustClick=!0);clearTimeout(o.mouseTrapTimeoutID)},unMuteMouse:function(){clearTimeout(o.mouseTrapTimeoutID);o.mouseTrapTimeoutID=setTimeout(function(){o.captureMouse=!1;o.bustClick=!1},400)}},d={down:"touchstart mousedown",move:"mousemove touchmove",up:"mouseup touchend touchcancel",cancel:"mouseleave touchcancel"};u.touch&&(u.mobileOS.ios||u.mobileOS.android)?d={down:"touchstart",move:"touchmove",up:"touchend touchcancel",cancel:"touchcancel"}:u.pointers?d={down:"pointerdown",move:"pointermove",up:"pointerup",cancel:"pointercancel pointerleave"}:u.msPointers&&(d={down:"MSPointerDown",move:"MSPointerMove",up:"MSPointerUp",cancel:"MSPointerCancel MSPointerLeave"});!u.msPointers||"onmspointerenter"in t||n.each({MSPointerEnter:"MSPointerOver",MSPointerLeave:"MSPointerOut"},function(t,i){n.event.special[t]={delegateType:i,bindType:i,handle:function(t){var u,f=this,r=t.relatedTarget,e=t.handleObj;return r&&(r===f||n.contains(f,r))||(t.type=e.origType,u=e.handler.apply(this,arguments),t.type=i),u}}});li=function(n){return d[n]||n};kt=/([^ ]+)/g;r.applyEventMap=function(n,t){return n=n.replace(kt,li),t&&(n=n.replace(kt,"$1."+t)),n};ot=n.fn.on;h(!0,s,n);s.fn=s.prototype=new n;s.fn.constructor=s;s.fn.init=function(t,i){return i&&i instanceof n&&!(i instanceof s)&&(i=s(i)),n.fn.init.call(this,t,i,ai)};s.fn.init.prototype=s.fn;ai=s(document);h(s.fn,{handler:function(n){return this.data("handler",n),this},autoApplyNS:function(n){return this.data("kendoNS",n||r.guid()),this},on:function(){var t=this,l=t.data("kendoNS"),s,n,i,f,h,c;return arguments.length===1?ot.call(t,arguments[0]):(s=t,n=ht.call(arguments),typeof n[n.length-1]===ut&&n.pop(),i=n[n.length-1],f=r.applyEventMap(n[0],l),u.mouseAndTouchPresent&&f.search(/mouse|click/)>-1&&this[0]!==document.documentElement&&(o.setupMouseMute(),h=n.length===2?null:n[1],c=f.indexOf("click")>-1&&f.indexOf("touchend")>-1,ot.call(this,{touchstart:o.muteMouse,touchend:o.unMuteMouse},h,{bustClick:c})),typeof i===e&&(s=t.data("handler"),i=s[i],n[n.length-1]=function(n){i.call(s,n)}),n[0]=f,ot.apply(t,n),t)},kendoDestroy:function(n){return n=n||this.data("kendoNS"),n&&this.off("."+n),this}});r.jQuery=s;r.eventMap=d;r.timezone=function(){function i(i,r){var u,o,s,c=r[3],e=r[4],f=r[5],h=r[8];return(h||(r[8]=h={}),h[i])?h[i]:(isNaN(e)?e.indexOf("last")===0?(u=new Date(Date.UTC(i,n[c]+1,1,f[0]-24,f[1],f[2],0)),o=t[e.substr(4,3)],s=u.getUTCDay(),u.setUTCDate(u.getUTCDate()+o-s-(o>s?7:0))):e.indexOf(">=")>=0&&(u=new Date(Date.UTC(i,n[c],e.substr(5),f[0],f[1],f[2],0)),o=t[e.substr(0,3)],s=u.getUTCDay(),u.setUTCDate(u.getUTCDate()+o-s+(o<s?7:0))):u=new Date(Date.UTC(i,n[c],e,f[0],f[1],f[2],0)),h[i]=u)}function f(n,t,r){var f,e,u,o;return(t=t[r],!t)?(f=r.split(":"),e=0,f.length>1&&(e=f[0]*60+Number(f[1])),[-1e6,"max","-","Jan",1,[0,0,0],e,"-"]):(u=new Date(n).getUTCFullYear(),t=jQuery.grep(t,function(n){var i=n[0],t=n[1];return i<=u&&(t>=u||i==u&&t=="only"||t=="max")}),t.push(n),t.sort(function(n,t){return typeof n!="number"&&(n=Number(i(u,n))),typeof t!="number"&&(t=Number(i(u,t))),n-t}),o=t[jQuery.inArray(n,t)-1]||t[t.length-1],isNaN(o)?o:null)}function o(n,t,i){var r=t[i],u,f,e;if(typeof r=="string"&&(r=t[r]),!r)throw new Error('Timezone "'+i+'" is either incorrect, or kendo.timezones.min.js is not included.');for(u=r.length-1;u>=0;u--)if(f=r[u][3],f&&n>f)break;if(e=r[u+1],!e)throw new Error('Timezone "'+i+'" not found on '+n+".");return e}function u(n,t,i,r){typeof n!=v&&(n=Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));var u=o(n,t,r);return{zone:u,rule:f(n,i,u[1])}}function s(n,t){if(t=="Etc/UTC"||t=="Etc/GMT")return 0;var i=u(n,this.zones,this.rules,t),f=i.zone,e=i.rule;return r.parseFloat(e?f[0]-e[6]:f[0])}function h(n,t){var f=u(n,this.zones,this.rules,t),e=f.zone,i=f.rule,r=e[2];return r.indexOf("/")>=0?r.split("/")[i&&+i[6]?1:0]:r.indexOf("%s")>=0?r.replace("%s",!i||i[7]=="-"?"":i[7]):r}function c(n,t,i){var r,u;return typeof t==e&&(t=this.offset(n,t)),typeof i==e&&(i=this.offset(n,i)),r=n.getTimezoneOffset(),n=new Date(n.getTime()+(t-i)*6e4),u=n.getTimezoneOffset(),new Date(n.getTime()+(u-r)*6e4)}function l(n,t){return this.convert(n,n.getTimezoneOffset(),t)}function a(n,t){return this.convert(n,t,n.getTimezoneOffset())}function y(n){return this.apply(new Date(n),"Etc/UTC")}var n={Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11},t={Sun:0,Mon:1,Tue:2,Wed:3,Thu:4,Fri:5,Sat:6};return{zones:{},rules:{},offset:s,convert:c,apply:l,remove:a,abbr:h,toLocalDate:y}}();r.date=function(){function t(n,t){return t===0&&n.getHours()===23?(n.setHours(n.getHours()+2),!0):!1}function e(n,i,r){var u=n.getHours();r=r||1;i=(i-n.getDay()+7*r)%7;n.setDate(n.getDate()+i);t(n,u)}function c(n,t,i){return n=new Date(n),e(n,t,i),n}function o(n){return new Date(n.getFullYear(),n.getMonth(),1)}function l(n){var t=new Date(n.getFullYear(),n.getMonth()+1,0),i=o(n),r=Math.abs(t.getTimezoneOffset()-i.getTimezoneOffset());return r&&t.setHours(i.getHours()+r/60),t}function i(n){return n=new Date(n.getFullYear(),n.getMonth(),n.getDate(),0,0,0),t(n,0),n}function a(n){return Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function r(n){return n.getTime()-i(n)}function v(t,i,u){var e=r(i),o=r(u),f;return!t||e==o?!0:(i>=u&&(u+=n),f=r(t),e>f&&(f+=n),o<e&&(o+=n),f>=e&&f<=o)}function y(t,i,r){var e=i.getTime(),u=r.getTime(),f;return e>=u&&(u+=n),f=t.getTime(),f>=e&&f<=u}function f(i,r){var u=i.getHours();return i=new Date(i),s(i,r*n),t(i,u),i}function s(n,t,i){var f=n.getTimezoneOffset(),r;n.setTime(n.getTime()+t);i||(r=n.getTimezoneOffset()-f,n.setTime(n.getTime()+r*u))}function h(){return i(new Date)}function p(n){return i(n).getTime()==h().getTime()}function w(n){var t=new Date(1980,1,1,0,0,0);return n&&t.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),t}var u=6e4,n=864e5;return{adjustDST:t,dayOfWeek:c,setDayOfWeek:e,getDate:i,isInDateRange:y,isInTimeRange:v,isToday:p,nextDay:function(n){return f(n,1)},previousDay:function(n){return f(n,-1)},toUtcTime:a,MS_PER_DAY:n,MS_PER_HOUR:60*u,MS_PER_MINUTE:u,setTime:s,addDays:f,today:h,toInvariantTime:w,firstDayOfMonth:o,lastDayOfMonth:l,getMilliseconds:r}}();r.stripWhitespace=function(n){var t,u,i;if(document.createNodeIterator)for(t=document.createNodeIterator(n,NodeFilter.SHOW_TEXT,function(t){return t.parentNode==n?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT},!1);t.nextNode();)t.referenceNode&&!t.referenceNode.textContent.trim()&&t.referenceNode.parentNode.removeChild(t.referenceNode);else for(u=0;u<n.childNodes.length;u++)i=n.childNodes[u],i.nodeType!=3||/\S/.test(i.nodeValue)||(n.removeChild(i),u--),i.nodeType==1&&r.stripWhitespace(i)};vi=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame||function(n){setTimeout(n,1e3/60)};r.animationFrame=function(n){vi.call(t,n)};y=[];r.queueAnimation=function(n){y[y.length]=n;y.length===1&&r.runNextAnimation()};r.runNextAnimation=function(){r.animationFrame(function(){y[0]&&(y.shift()(),y[0]&&r.runNextAnimation())})};r.parseQueryStringParams=function(n){for(var u=n.split("?")[1]||"",r={},i=u.split(/&|=/),f=i.length,t=0;t<f;t+=2)i[t]!==""&&(r[decodeURIComponent(i[t])]=decodeURIComponent(i[t+1]));return r};r.elementUnderCursor=function(n){if(typeof n.x.client!="undefined")return document.elementFromPoint(n.x.client,n.y.client)};r.wheelDeltaY=function(n){var t=n.originalEvent,u=t.wheelDeltaY,r;return t.wheelDelta?(u===i||u)&&(r=t.wheelDelta):t.detail&&t.axis===t.VERTICAL_AXIS&&(r=-t.detail*10),r};r.throttle=function(n,t){var i,r=0,u;return!t||t<=0?n:(u=function(){function u(){n.apply(e,o);r=+new Date}var e=this,f=+new Date-r,o=arguments;if(!r)return u();i&&clearTimeout(i);f>t?u():i=setTimeout(u,t-f)},u.cancel=function(){clearTimeout(i)},u)};r.caret=function(t,r,u){var f,e=r!==i,o,s,h;if(u===i&&(u=r),t[0]&&(t=t[0]),!e||!t.disabled){try{t.selectionStart!==i?e?(t.focus(),t.setSelectionRange(r,u)):r=[t.selectionStart,t.selectionEnd]:document.selection&&(n(t).is(":visible")&&t.focus(),f=t.createTextRange(),e?(f.collapse(!0),f.moveStart("character",r),f.moveEnd("character",u-r),f.select()):(o=f.duplicate(),f.moveToBookmark(document.selection.createRange().getBookmark()),o.setEndPoint("EndToStart",f),s=o.text.length,h=s+f.text.length,r=[s,h]))}catch(c){r=[]}return r}};r.compileMobileDirective=function(n,i){var u=t.angular;return n.attr("data-"+r.ns+"role",n[0].tagName.toLowerCase().replace("kendo-mobile-","").replace("-","")),u.element(n).injector().invoke(["$compile",function(t){t(n)(i);/^\$(digest|apply)$/.test(i.$$phase)||i.$digest()}]),r.widgetInstance(n,r.mobile.ui)};r.antiForgeryTokens=function(){var t={},r=n("meta[name=csrf-token],meta[name=_csrf]").attr("content"),u=n("meta[name=csrf-param],meta[name=_csrf_header]").attr("content");return n("input[name^='__RequestVerificationToken']").each(function(){t[this.name]=this.value}),u!==i&&r!==i&&(t[u]=r),t};r.cycleForm=function(n){function u(n){var t=r.widgetInstance(n);t&&t.focus?t.focus():n.focus()}var t=n.find("input, .k-widget").first(),i=n.find("button, .k-button").last();i.on("keydown",function(n){n.keyCode!=r.keys.TAB||n.shiftKey||(n.preventDefault(),u(t))});t.on("keydown",function(n){n.keyCode==r.keys.TAB&&n.shiftKey&&(n.preventDefault(),u(i))})},function(){function u(t,i,u,f){var h=n("<form>").attr({action:u,method:"POST",target:f}),e=r.antiForgeryTokens(),s,o;e.fileName=i;s=t.split(";base64,");e.contentType=s[0].replace("data:","");e.base64=s[1];for(o in e)e.hasOwnProperty(o)&&n("<input>").attr({value:e[o],name:o,type:"hidden"}).appendTo(h);h.appendTo("body").submit().remove()}function e(n,t){var u=n,i;if(typeof n=="string"){var f=n.split(";base64,"),o=f[0],r=atob(f[1]),e=new Uint8Array(r.length);for(i=0;i<r.length;i++)e[i]=r.charCodeAt(i);u=new Blob([e.buffer],{type:o})}navigator.msSaveBlob(u,t)}function o(n,r){t.Blob&&n instanceof Blob&&(n=URL.createObjectURL(n));i.download=r;i.href=n;var u=document.createEvent("MouseEvents");u.initMouseEvent("click",!0,!1,t,0,0,0,0,0,!1,!1,!1,!1,0,null);i.dispatchEvent(u)}var i=document.createElement("a"),f="download"in i;r.saveAs=function(n){var t=u;n.forceProxy||(f?t=o:navigator.msSaveBlob&&(t=e));t(n.dataURI,n.fileName,n.proxyURL,n.proxyTarget)}}()})(jQuery,window)}(),function(){(function(n){function f(n,t){if(!t)return n;n+"/"===t&&(n=t);var r=new RegExp("^"+t,"i");return r.test(n)||(n=t+"/"+n),i.protocol+"//"+(i.host+"/"+n).replace(/\/\/+/g,"/")}function a(n){return n?"#!":"#"}function v(n){var t=i.href;return n==="#!"&&t.indexOf("#")>-1&&t.indexOf("#!")<0?null:t.split(n)[1]||""}function o(n,t){return t.indexOf(n)===0?t.substr(n.length).replace(/\/\//g,"/"):t}function g(n){return n.replace(/^(#)?/,"#")}function nt(n){return n.replace(/^(#(!)?)?/,"#!")}var t=window.kendo,u="change",b="back",h="same",c=t.support,i=window.location,r=window.history,k=50,l=t.support.browser.msie,d=/^#*/,e=window.document,s=t.Class.extend({back:function(){l?setTimeout(function(){r.back()}):r.back()},forward:function(){l?setTimeout(function(){r.forward()}):r.forward()},length:function(){return r.length},replaceLocation:function(n){i.replace(n)}}),y=s.extend({init:function(n){this.root=n},navigate:function(n){r.pushState({},e.title,f(n,this.root))},replace:function(n){r.replaceState({},e.title,f(n,this.root))},normalize:function(n){return o(this.root,n)},current:function(){var n=i.pathname;return i.search&&(n+=i.search),o(this.root,n)},change:function(t){n(window).bind("popstate.kendo",t)},stop:function(){n(window).unbind("popstate.kendo")},normalizeCurrent:function(n){var t,u=n.root,o=i.pathname,s=v(a(n.hashBang));u===o+"/"&&(t=u);u===o&&s&&(t=f(s.replace(d,""),u));t&&r.pushState({},e.title,t)}}),p=s.extend({init:function(n){this._id=t.guid();this.prefix=a(n);this.fix=n?nt:g},navigate:function(n){i.hash=this.fix(n)},replace:function(n){this.replaceLocation(this.fix(n))},normalize:function(n){return n.indexOf(this.prefix)<0?n:n.split(this.prefix)[1]},change:function(t){if(c.hashChange)n(window).on("hashchange."+this._id,t);else this._interval=setInterval(t,k)},stop:function(){n(window).off("hashchange."+this._id);clearInterval(this._interval)},current:function(){return v(this.prefix)},normalizeCurrent:function(n){var r=i.pathname,t=n.root;return n.pushState&&t!==r?(this.replaceLocation(t+this.prefix+o(t,r)),!0):!1}}),w=t.Observable.extend({start:function(t){if(t=t||{},this.bind([u,b,h],t),!this._started){this._started=!0;t.root=t.root||"/";var i=this.createAdapter(t),r;i.normalizeCurrent(t)||(r=i.current(),n.extend(this,{adapter:i,root:t.root,historyLength:i.length(),current:r,locations:[r]}),i.change(n.proxy(this,"_checkUrl")))}},createAdapter:function(n){return c.pushState&&n.pushState?new y(n.root):new p(n.hashBang)},stop:function(){this._started&&(this.adapter.stop(),this.unbind(u),this._started=!1)},change:function(n){this.bind(u,n)},replace:function(n,t){this._navigate(n,t,function(t){t.replace(n);this.locations[this.locations.length-1]=this.current})},navigate:function(n,t){if(n==="#:back"){this.backCalled=!0;this.adapter.back();return}this._navigate(n,t,function(t){t.navigate(n);this.locations.push(this.current)})},_navigate:function(n,t,i){var r=this.adapter;if(n=r.normalize(n),this.current===n||this.current===decodeURIComponent(n)){this.trigger(h);return}(t||!this.trigger(u,{url:n}))&&(this.current=n,i.call(this,r),this.historyLength=r.length())},_checkUrl:function(){var t=this.adapter,n=t.current(),f=t.length(),e=this.historyLength===f,i=n===this.locations[this.locations.length-2]&&e,o=this.backCalled,r=this.current;if(n===null||this.current===n||this.current===decodeURIComponent(n))return!0;if(this.historyLength=f,this.backCalled=!1,this.current=n,i&&this.trigger("back",{url:r,to:n})){t.forward();this.current=r;return}if(this.trigger(u,{url:n,backButtonPressed:!o})){i?t.forward():(t.back(),this.historyLength--);this.current=r;return}i?this.locations.pop():this.locations.push(n)}});t.History=w;t.History.HistoryAdapter=s;t.History.HashAdapter=p;t.History.PushStateAdapter=y;t.absoluteURL=f;t.history=new w})(window.kendo.jQuery),function(){function v(n,t){return t?n:"([^/]+)"}function y(n,t){return new RegExp("^"+n.replace(a,"\\$&").replace(h,"(?:$1)?").replace(c,v).replace(l,"(.*?)")+"$",t?"i":"")}function s(n){return n.replace(/(\?.*)|(#.*)/g,"")}var n=window.kendo,t=n.history,u=n.Observable,f="init",e="routeMissing",i="change",o="back",r="same",h=/\((.*?)\)/g,c=/(\(\?)?:\w+/g,l=/\*\w+/g,a=/[\-{}\[\]+?.,\\\^$|#\s]/g,p=n.Class.extend({init:function(n,t,i){n instanceof RegExp||(n=y(n,i));this.route=n;this._callback=t},callback:function(t,i){var r,u=0,f,e=n.parseQueryStringParams(t);for(e._back=i,t=s(t),r=this.route.exec(t).slice(1),f=r.length;u<f;u++)typeof r[u]!="undefined"&&(r[u]=decodeURIComponent(r[u]));r.push(e);this._callback.apply(null,r)},worksWith:function(n,t){return this.route.test(s(n))?(this.callback(n,t),!0):!1}}),w=u.extend({init:function(n){n||(n={});u.fn.init.call(this);this.routes=[];this.pushState=n.pushState;this.hashBang=n.hashBang;this.root=n.root;this.ignoreCase=n.ignoreCase!==!1;this.bind([f,e,i,r],n)},destroy:function(){t.unbind(i,this._urlChangedProxy);t.unbind(r,this._sameProxy);t.unbind(o,this._backProxy);this.unbind()},start:function(){var n=this,e=function(){n._same()},r=function(t){n._back(t)},u=function(t){n._urlChanged(t)},i;t.start({same:e,change:u,back:r,pushState:n.pushState,hashBang:n.hashBang,root:n.root});i={url:t.current||"/",preventDefault:$.noop};n.trigger(f,i)||n._urlChanged(i);this._urlChangedProxy=u;this._backProxy=r},route:function(n,t){this.routes.push(new p(n,t,this.ignoreCase))},navigate:function(t,i){n.history.navigate(t,i)},replace:function(t,i){n.history.replace(t,i)},_back:function(n){this.trigger(o,{url:n.url,to:n.to})&&n.preventDefault()},_same:function(){this.trigger(r)},_urlChanged:function(t){var r=t.url,u=t.backButtonPressed;if(r||(r="/"),this.trigger(i,{url:t.url,params:n.parseQueryStringParams(t.url),backButtonPressed:u})){t.preventDefault();return}for(var f=0,o=this.routes,s,h=o.length;f<h;f++)if(s=o[f],s.worksWith(r,u))return;this.trigger(e,{url:r,params:n.parseQueryStringParams(r),backButtonPressed:u})&&t.preventDefault()}});n.Router=w}()}(),function(){(function(n,t){function e(r,f){for(var v=[],k=r.logic||"and",h,y,s,a,c,w,b=r.filters,l=0,p=b.length;l<p;l++)r=b[l],h=r.field,c=r.value,a=r.operator,r.filters?r=e(r,f):(w=r.ignoreCase,h=h.replace(/\./g,"/"),r=u[a],f&&(r=o[a]),r&&c!==t&&(y=n.type(c),y==="string"?(s="'{1}'",c=c.replace(/'/g,"''"),w===!0&&(h="tolower("+h+")")):s=y==="date"?f?"{1:yyyy-MM-ddTHH:mm:ss+00:00}":"datetime'{1:yyyy-MM-ddTHH:mm:ss}'":"{1}",r.length>3?r!=="substringof"?s="{0}({2},"+s+")":(s="{0}("+s+",{2})",a==="doesnotcontain"&&(f?(s="{0}({2},'{1}') eq -1",r="indexof"):s+=" eq false")):s="{2} {0} "+s,r=i.format(s,r,c,h))),v.push(r);return r=v.join(" "+k+" "),v.length>1&&(r="("+r+")"),r}function h(n){for(var t in n)t.indexOf("@odata")===0&&delete n[t]}var i=window.kendo,r=n.extend,u={eq:"eq",neq:"ne",gt:"gt",gte:"ge",lt:"lt",lte:"le",contains:"substringof",doesnotcontain:"substringof",endswith:"endswith",startswith:"startswith"},o=r({},u,{contains:"contains"}),f={pageSize:n.noop,page:n.noop,filter:function(n,t,i){t&&(t=e(t,i),t&&(n.$filter=t))},sort:function(t,i){var r=n.map(i,function(n){var t=n.field.replace(/\./g,"/");return n.dir==="desc"&&(t+=" desc"),t}).join(",");r&&(t.$orderby=r)},skip:function(n,t){t&&(n.$skip=t)},take:function(n,t){t&&(n.$top=t)}},s={read:{dataType:"jsonp"}};r(!0,i.data,{schemas:{odata:{type:"json",data:function(n){return n.d.results||[n.d]},total:"d.__count"}},transports:{odata:{read:{cache:!0,dataType:"jsonp",jsonp:"$callback"},update:{cache:!0,dataType:"json",contentType:"application/json",type:"PUT"},create:{cache:!0,dataType:"json",contentType:"application/json",type:"POST"},destroy:{cache:!0,dataType:"json",type:"DELETE"},parameterMap:function(n,t,r){var e,h,u,o;if(n=n||{},t=t||"read",o=(this.options||s)[t],o=o?o.dataType:"json",t==="read"){e={$inlinecount:"allpages"};o!="json"&&(e.$format="json");for(u in n)f[u]?f[u](e,n[u],r):e[u]=n[u]}else{if(o!=="json")throw new Error("Only json dataType can be used for "+t+" operation.");if(t!=="destroy"){for(u in n)h=n[u],typeof h=="number"&&(n[u]=h+"");e=i.stringify(n)}}return e}}}});r(!0,i.data,{schemas:{"odata-v4":{type:"json",data:function(t){return(t=n.extend({},t),h(t),t.value)?t.value:[t]},total:function(n){return n["@odata.count"]}}},transports:{"odata-v4":{read:{cache:!0,dataType:"json"},update:{cache:!0,dataType:"json",contentType:"application/json;IEEE754Compatible=true",type:"PUT"},create:{cache:!0,dataType:"json",contentType:"application/json;IEEE754Compatible=true",type:"POST"},destroy:{cache:!0,dataType:"json",type:"DELETE"},parameterMap:function(n,t){var r=i.data.transports.odata.parameterMap(n,t,!0);return t=="read"&&(r.$count=!0,delete r.$inlinecount),r}}}})})(window.kendo.jQuery)}(),function(){(function(n,t){var i=window.kendo,r=n.isArray,u=n.isPlainObject,o=n.map,s=n.each,f=n.extend,h=i.getter,c=i.Class,e=c.extend({init:function(t){var e=this,c=t.total,h=t.model,p=t.parse,l=t.errors,w=t.serialize,a=t.data,b,v,y,k;h&&(u(h)&&(b=t.modelBase||i.data.Model,h.fields&&s(h.fields,function(t,i){u(i)&&i.field?n.isFunction(i.field)||(i=f(i,{field:e.getter(i.field)})):i={field:e.getter(i)};h.fields[t]=i}),v=h.id,v&&(y={},y[e.xpathToMember(v,!0)]={field:e.getter(v)},h.fields=f(y,h.fields),h.id=e.xpathToMember(v)),h=b.define(h)),e.model=h);c&&(typeof c=="string"?(c=e.getter(c),e.total=function(n){return parseInt(c(n),10)}):typeof c=="function"&&(e.total=c));l&&(typeof l=="string"?(l=e.getter(l),e.errors=function(n){return l(n)||null}):typeof l=="function"&&(e.errors=l));a&&(typeof a=="string"?(a=e.xpathToMember(a),e.data=function(n){var t=e.evaluate(n,a),i;return(t=r(t)?t:[t],e.model&&h.fields)?(i=new e.model,o(t,function(n){if(n){var r={};for(var t in h.fields)r[t]=i._parse(t,h.fields[t].field(n));return r}})):t}):typeof a=="function"&&(e.data=a));typeof p=="function"&&(k=e.parse,e.parse=function(n){var t=p.call(e,n);return k.call(e,t)});typeof w=="function"&&(e.serialize=w)},total:function(n){return this.data(n).length},errors:function(n){return n?n.errors:null},serialize:function(n){return n},parseDOM:function(n){for(var f={},e,i,o,h,u,c,l=n.attributes,a=l.length,s=0;s<a;s++)c=l[s],f["@"+c.nodeName]=c.nodeValue;for(i=n.firstChild;i;i=i.nextSibling)o=i.nodeType,o===3||o===4?f["#text"]=i.nodeValue:o===1&&(e=this.parseDOM(i),h=i.nodeName,u=f[h],r(u)?u.push(e):u=u!==t?[u,e]:e,f[h]=u);return f},evaluate:function(n,t){for(var e=t.split("."),o,u,s,i,f;o=e.shift();)if(n=n[o],r(n)){for(u=[],t=e.join("."),f=0,s=n.length;f<s;f++)i=this.evaluate(n[f],t),i=r(i)?i:[i],u.push.apply(u,i);return u}return n},parse:function(t){var i,r,u={};return i=t.documentElement||n.parseXML(t).documentElement,r=this.parseDOM(i),u[i.nodeName]=r,u},xpathToMember:function(n,t){return n?(n=n.replace(/^\//,"").replace(/\//g,"."),n.indexOf("@")>=0)?n.replace(/\.?(@.*)/,t?"$1":'["$1"]'):n.indexOf("text()")>=0?n.replace(/(\.?text\(\))/,t?"#text":'["#text"]'):n:""},getter:function(n){return h(this.xpathToMember(n),!0)}});n.extend(!0,i.data,{XmlDataReader:e,readers:{xml:e}})})(window.kendo.jQuery)}(),function(){(function(n,t){function ri(n,t,i,u){return function(f){var e={};for(var o in f)e[o]=f[o];e.field=u?i+"."+f.field:i;t==r&&n._notifyChange&&n._notifyChange(e);n.trigger(t,e)}}function bi(t,i){if(t===i)return!0;var r=n.type(t),f=n.type(i),u;if(r!==f)return!1;if(r==="date")return t.getTime()===i.getTime();if(r!=="object"&&r!=="array")return!1;for(u in t)if(!bi(t[u],i[u]))return!1;return!0}function lu(n,t){var i;for(var r in n)if((i=n[r],w(i)&&i.field&&i.field===t)||i===t)return i;return null}function u(n){this.data=n||[]}function ft(n,i){if(n){var r=typeof n===s?{field:n,dir:i}:n,u=h(r)?r:r!==t?[r]:[];return dr(u,function(n){return!!n.dir})}}function nr(n){var i,f,r,t,u=n.filters;if(u)for(i=0,f=u.length;i<f;i++)r=u[i],t=r.operator,t&&typeof t===s&&(r.operator=gi[t.toLowerCase()]||t),nr(r)}function pt(n){if(n&&!b(n))return(h(n)||!n.filters)&&(n={logic:"and",filters:h(n)?n:[n]}),nr(n),n}function au(n){return h(n)?n:[n]}function et(n,i){var r=typeof n===s?{field:n,dir:i}:n,u=h(r)?r:r!==t?[r]:[];return gt(u,function(n){return{field:n.field,dir:n.dir||"asc",aggregates:n.aggregates}})}function vu(n,t){return n&&n.getTime&&t&&t.getTime?n.getTime()===t.getTime():n===t}function yu(n,t,r,u,f,e){var h,c,s,l,o;for(t=t||[],l=t.length,h=0;h<l;h++)c=t[h],s=c.aggregate,o=c.field,n[o]=n[o]||{},e[o]=e[o]||{},e[o][s]=e[o][s]||{},n[o][s]=tr[s.toLowerCase()](n[o][s],r,i.accessor(o),u,f,e[o][s])}function a(n){return typeof n=="number"&&!isNaN(n)}function wt(n){return n&&n.getTime}function bt(n){for(var i=n.length,r=new Array(i),t=0;t<i;t++)r[t]=n[t].toJSON();return r}function pu(n,t,r,u,f){for(var s,o,e,c={},h=0,l=n.length;h<l;h++){s=n[h];for(o in t)e=f[o],e&&e!==o&&(c[e]||(c[e]=i.setter(e)),c[e](s,t[o](s)),delete s[o])}}function ur(n,t,i,r,u){for(var e,f,o,s=0,h=n.length;s<h;s++){e=n[s];for(f in t)e[f]=i._parse(f,t[f](e)),o=u[f],o&&o!==f&&delete e[o]}}function fr(n,t,i,r,u){for(var f,o,e=0,s=n.length;e<s;e++)f=n[e],o=r[f.field],o&&o!=f.field&&(f.field=o),f.value=i._parse(f.field,f.value),f.hasSubgroups?fr(f.items,t,i,r,u):ur(f.items,t,i,r,u)}function fi(n,t,i,r,u,f){return function(e){return e=n(e),e&&!b(r)&&(at.call(e)==="[object Array]"||e instanceof y||(e=[e]),i(e,r,new t,u,f)),e||[]}}function oi(n,t,i,r){for(var f,e=0,u,o;t.length&&r;)if(f=t[e],u=f.items,o=u.length,n&&n.field===f.field&&n.value===f.value?(n.hasSubgroups&&n.items.length?oi(n.items[n.items.length-1],f.items,i,r):(u=u.slice(i,i+r),n.items=n.items.concat(u)),t.splice(e--,1)):f.hasSubgroups&&u.length?(oi(f,u,i,r),f.items.length||t.splice(e--,1)):(u=u.slice(i,i+r),f.items=u,f.items.length||t.splice(e--,1)),u.length===0?i-=o:(i=0,r-=u.length),++e>=t.length)break;e<t.length&&t.splice(e,t.length-e)}function si(n){for(var i=[],f,r,u,t=0,e=n.length;t<e;t++)if(u=n.at(t),u.hasSubgroups)i=i.concat(si(u.items));else for(f=u.items,r=0;r<f.length;r++)i.push(f.at(r));return i}function er(n,t){var r,u,i;if(t)for(r=0,u=n.length;r<u;r++)i=n.at(r),i.hasSubgroups?er(i.items,t):i.items=new vt(i.items,t)}function or(n,t){for(var i=0,r=n.length;i<r;i++)if(n[i].hasSubgroups){if(or(n[i].items,t))return!0}else if(t(n[i].items,n[i]))return!0}function wu(n,t,i,r){for(var u=0;u<n.length;u++){if(n[u].data===t)break;if(sr(n[u].data,i,r))break}}function sr(n,t,i){for(var r=0,u=n.length;r<u;r++){if(n[r]&&n[r].hasSubgroups)return sr(n[r].items,t,i);if(n[r]===t||n[r]===i)return n[r]=i,!0}}function hr(n,i,r,u,f){for(var e,s,o=0,h=n.length;o<h;o++)if(e=n[o],e&&!(e instanceof u))if(e.hasSubgroups===t||f){for(s=0;s<i.length;s++)if(i[s]===e){n[o]=i.at(s);wu(r,i,e,n[o]);break}}else hr(e.items,i,r,u,f)}function cr(n,t){for(var r,i=0,u=n.length;i<u;i++)if(r=n.at(i),r.uid==t.uid)return n.splice(i,1),r}function lr(n,t){return t?vr(n,function(n){return n.uid&&n.uid==t.uid||n[t.idField]===t.id&&t.id!==t._defaultId}):-1}function ar(n,t){return t?vr(n,function(n){return n.uid==t.uid}):-1}function vr(n,t){for(var i=0,r=n.length;i<r;i++)if(t(n[i]))return i;return-1}function yr(n,t){if(n&&!b(n)){var i=n[t],r;return(r=w(i)?i.from||i.field||t:n[t]||t,l(r))?t:r}return t}function pr(n,t){var r,f,i={};for(var u in n)u!=="filters"&&(i[u]=n[u]);if(n.filters)for(i.filters=[],r=0,f=n.filters.length;r<f;r++)i.filters[r]=pr(n.filters[r],t);else i.field=yr(t.fields,i.field);return i}function kt(n,t){for(var o=[],i,u,f,r=0,e=n.length;r<e;r++){i={};u=n[r];for(f in u)i[f]=u[f];i.field=yr(t.fields,i.field);i.aggregates&&h(i.aggregates)&&(i.aggregates=kt(i.aggregates,t));o.push(i)}return o}function bu(t,i){t=n(t)[0];for(var s=t.options,l=i[0],a=i[1],h=[],r,u,f,e,o=0,c=s.length;o<c;o++)(f={},u=s[o],r=u.parentNode,r===t&&(r=null),u.disabled||r&&r.disabled)||(r&&(f.optgroup=r.label),f[l.field]=u.text,e=u.attributes.value,e=e&&e.specified?u.value:u.text,f[a.field]=e,h.push(f));return h}function ku(t,i){for(var s=n(t)[0].tBodies[0],h=s?s.rows:[],r,v=i.length,l=[],a,f,e,o,u=0,c=h.length;u<c;u++){for(f={},o=!0,a=h[u].cells,r=0;r<v;r++)e=a[r],e.nodeName.toLowerCase()!=="th"&&(o=!1,f[i[r].field]=e.innerHTML);o||l.push(f)}return l}function wr(n){return function(){var t=this._data,i=c.fn[n].apply(this,ut.call(arguments));return this._data!=t&&this._attachBubbleHandlers(),i}}function br(t,i){function c(n,t){return n.filter(t).add(n.find(t))}for(var l=n(t).children(),v=[],r,b=i[0].field,y=i[1]&&i[1].field,p=i[2]&&i[2].field,w=i[3]&&i[3].field,f,s,o,h,u,e=0,a=l.length;e<a;e++)r={_loaded:!0},f=l.eq(e),o=f[0].firstChild,u=f.children(),t=u.filter("ul"),u=u.filter(":not(ul)"),s=f.attr("data-id"),s&&(r.id=s),o&&(r[b]=o.nodeType==3?o.nodeValue:u.text()),y&&(r[y]=c(u,"a").attr("href")),w&&(r[w]=c(u,"img").attr("src")),p&&(h=c(u,".k-sprite").prop("className"),r[p]=h&&n.trim(h.replace("k-sprite",""))),t.length&&(r.items=br(t.eq(0),i)),f.attr("data-hasChildren")=="true"&&(r.hasChildren=!0),v.push(r);return v}var e=n.extend,v=n.proxy,w=n.isPlainObject,b=n.isEmptyObject,h=n.isArray,dr=n.grep,dt=n.ajax,gt,ni=n.each,k=n.noop,i=window.kendo,l=i.isFunction,d=i.Observable,st=i.Class,s="string",ti="function",ai="create",vi="read",yi="update",pi="destroy",r="change",wi="sync",ht="get",nt="error",tt="requestStart",ii="progress",it="requestEnd",gr=[ai,vi,yi,pi],rt=function(n){return n},ct=i.getter,lt=i.stringify,f=Math,nu=[].push,tu=[].join,iu=[].pop,ru=[].splice,uu=[].shift,ut=[].slice,fu=[].unshift,at={}.toString,eu=i.support.stableSort,ou=/^\/Date\((.*?)\)\/$/,su=/(\r+|\n+)/g,hu=/(?=['\\])/g,y=d.extend({init:function(n,t){var i=this;i.type=t||o;d.fn.init.call(i);i.length=n.length;i.wrapAll(n,i)},at:function(n){return this[n]},toJSON:function(){for(var i=this.length,t,r=new Array(i),n=0;n<i;n++)t=this[n],t instanceof o&&(t=t.toJSON()),r[n]=t;return r},parent:k,wrapAll:function(n,t){var r=this,i,u,f=function(){return r};for(t=t||[],i=0,u=n.length;i<u;i++)t[i]=r.wrap(n[i],f);return t},wrap:function(n,t){var i=this,u;return n!==null&&at.call(n)==="[object Object]"&&(u=n instanceof i.type||n instanceof p,u||(n=n instanceof o?n.toJSON():n,n=new i.type(n)),n.parent=t,n.bind(r,function(n){i.trigger(r,{field:n.field,node:n.node,index:n.index,items:n.items||[this],action:n.node?n.action||"itemloaded":"itemchange"})})),n},push:function(){var i=this.length,n=this.wrapAll(arguments),t;return t=nu.apply(this,n),this.trigger(r,{action:"add",index:i,items:n}),t},slice:ut,sort:[].sort,join:tu,pop:function(){var n=this.length,t=iu.apply(this);return n&&this.trigger(r,{action:"remove",index:n-1,items:[t]}),t},splice:function(n,t,i){var e=this.wrapAll(ut.call(arguments,2)),u,f,o;if(u=ru.apply(this,[n,t].concat(e)),u.length)for(this.trigger(r,{action:"remove",index:n,items:u}),f=0,o=u.length;f<o;f++)u[f]&&u[f].children&&u[f].unbind(r);return i&&this.trigger(r,{action:"add",index:n,items:e}),u},shift:function(){var t=this.length,n=uu.apply(this);return t&&this.trigger(r,{action:"remove",index:0,items:[n]}),n},unshift:function(){var n=this.wrapAll(arguments),t;return t=fu.apply(this,n),this.trigger(r,{action:"add",index:0,items:n}),t},indexOf:function(n){for(var i=this,t=0,r=i.length;t<r;t++)if(i[t]===n)return t;return-1},forEach:function(n){for(var t=0,i=this.length;t<i;t++)n(this[t],t,this)},map:function(n){for(var t=0,i=[],r=this.length;t<r;t++)i[t]=n(this[t],t,this);return i},reduce:function(n){var t=0,i,r=this.length;for(arguments.length==2?i=arguments[1]:t<r&&(i=this[t++]);t<r;t++)i=n(i,this[t],t,this);return i},reduceRight:function(n){var t=this.length-1,i;for(arguments.length==2?i=arguments[1]:t>0&&(i=this[t--]);t>=0;t--)i=n(i,this[t],t,this);return i},filter:function(n){for(var t=0,i=[],r,u=this.length;t<u;t++)r=this[t],n(r,t,this)&&(i[i.length]=r);return i},find:function(n){for(var t=0,i,r=this.length;t<r;t++)if(i=this[t],n(i,t,this))return i},every:function(n){for(var t=0,i,r=this.length;t<r;t++)if(i=this[t],!n(i,t,this))return!1;return!0},some:function(n){for(var t=0,i,r=this.length;t<r;t++)if(i=this[t],n(i,t,this))return!0;return!1},remove:function(n){var t=this.indexOf(n);t!==-1&&this.splice(t,1)},empty:function(){this.splice(0,this.length)}}),vt=y.extend({init:function(n,t){d.fn.init.call(this);this.type=t||o;for(var i=0;i<n.length;i++)this[i]=n[i];this.length=i;this._parent=v(function(){return this},this)},at:function(n){var t=this[n];return t instanceof this.type?t.parent=this._parent:t=this[n]=this.wrap(t,this._parent),t}}),o=d.extend({init:function(n){var u=this,t,r,f=function(){return u};d.fn.init.call(this);this._handlers={};for(r in n)t=n[r],typeof t=="object"&&t&&!t.getTime&&r.charAt(0)!="_"&&(t=u.wrap(t,r,f)),u[r]=t;u.uid=i.guid()},shouldSerialize:function(n){return this.hasOwnProperty(n)&&n!=="_handlers"&&n!=="_events"&&typeof this[n]!==ti&&n!=="uid"},forEach:function(n){for(var t in this)this.shouldSerialize(t)&&n(this[t],t)},toJSON:function(){var i={},n;for(var t in this)this.shouldSerialize(t)&&(n=this[t],(n instanceof o||n instanceof y)&&(n=n.toJSON()),i[t]=n);return i},get:function(n){var t=this;return t.trigger(ht,{field:n}),n==="this"?t:i.getter(n,!0)(t)},_set:function(n,t){var s=this,f=n.indexOf(".")>=0,r,u,e;if(f)for(r=n.split("."),u="";r.length>1;){if(u+=r.shift(),e=i.getter(u,!0)(s),e instanceof o)return e.set(r.join("."),t),f;u+="."}return i.setter(n)(s,t),f},set:function(n,t){var u=this,e=n.indexOf(".")>=0,f=i.getter(n,!0)(u);f!==t&&(f instanceof d&&this._handlers[n]&&(this._handlers[n].get&&f.unbind(ht,this._handlers[n].get),f.unbind(r,this._handlers[n].change)),u.trigger("set",{field:n,value:t})||(e||(t=u.wrap(t,n,function(){return u})),(!u._set(n,t)||n.indexOf("(")>=0||n.indexOf("[")>=0)&&u.trigger(r,{field:n})))},parent:k,wrap:function(n,t,i){var f=this,l,u,e=at.call(n),s,h;return n!=null&&(e==="[object Object]"||e==="[object Array]")&&(s=n instanceof y,h=n instanceof c,e!=="[object Object]"||h||s?(e==="[object Array]"||s||h)&&(s||h||(n=new y(n)),u=ri(f,r,t,!1),n.bind(r,u),f._handlers[t]={change:u}):(n instanceof o||(n=new o(n)),l=ri(f,ht,t,!0),n.bind(ht,l),u=ri(f,r,t,!0),n.bind(r,u),f._handlers[t]={get:l,change:u}),n.parent=i),n}}),ki={number:function(n){return i.parseFloat(n)},date:function(n){return i.parseDate(n)},boolean:function(n){return typeof n===s?n.toLowerCase()==="true":n!=null?!!n:n},string:function(n){return n!=null?n+"":n},"default":function(n){return n}},cu={string:"",number:0,date:new Date,boolean:!1,"default":""},p=o.extend({init:function(i){var r=this,u,f;if((!i||n.isEmptyObject(i))&&(i=n.extend({},r.defaults,i),r._initializers))for(u=0;u<r._initializers.length;u++)f=r._initializers[u],i[f]=r.defaults[f]();o.fn.init.call(r,i);r.dirty=!1;r.idField&&(r.id=r.get(r.idField),r.id===t&&(r.id=r._defaultId))},shouldSerialize:function(n){return o.fn.shouldSerialize.call(this,n)&&n!=="uid"&&!(this.idField!=="id"&&n==="id")&&n!=="dirty"&&n!=="_accessors"},_parse:function(n,t){var u=this,f=n,r=u.fields||{},i;return n=r[n],n||(n=lu(r,f)),n&&(i=n.parse,!i&&n.type&&(i=ki[n.type.toLowerCase()])),i?i(t):t},_notifyChange:function(n){var t=n.action;(t=="add"||t=="remove")&&(this.dirty=!0)},editable:function(n){return n=(this.fields||{})[n],n?n.editable!==!1:!0},set:function(n,t,i){var r=this;r.editable(n)&&(t=r._parse(n,t),bi(t,r.get(n))||(r.dirty=!0,o.fn.set.call(r,n,t,i)))},accept:function(n){var t=this,u=function(){return t},i,r;for(i in n)r=n[i],i.charAt(0)!="_"&&(r=t.wrap(n[i],i,u)),t._set(i,r);t.idField&&(t.id=t.get(t.idField));t.dirty=!1},isNew:function(){return this.id===this._defaultId}}),yt,di,ui,gi,tr,ei,c,hi,ci,g,li,kr;p.define=function(n,i){i===t&&(i=n,n=p);var o,r=e({defaults:{}},i),f,u,v,h,l,b,y={},c,a=r.id,w=[];if(a&&(r.idField=a),r.id&&delete r.id,a&&(r.defaults[a]=r._defaultId=""),at.call(r.fields)==="[object Array]"){for(l=0,b=r.fields.length;l<b;l++)u=r.fields[l],typeof u===s?y[u]={}:u.field&&(y[u.field]=u);r.fields=y}for(f in r.fields)u=r.fields[f],v=u.type||"default",h=null,c=f,f=typeof u.field===s?u.field:f,u.nullable||(h=r.defaults[c!==f?c:f]=u.defaultValue!==t?u.defaultValue:cu[v.toLowerCase()],typeof h=="function"&&w.push(f)),i.id===f&&(r._defaultId=h),r.defaults[c!==f?c:f]=h,u.parse=u.parse||ki[v];return w.length>0&&(r._initializers=w),o=n.extend(r),o.define=function(n){return p.define(o,n)},r.fields&&(o.fields=r.fields,o.idField=r.idField),o};yt={selector:function(n){return l(n)?n:ct(n)},compare:function(n){var t=this.selector(n);return function(n,i){return(n=t(n),i=t(i),n==null&&i==null)?0:n==null?-1:i==null?1:n.localeCompare?n.localeCompare(i):n>i?1:n<i?-1:0}},create:function(n){var t=n.compare||this.compare(n.field);return n.dir=="desc"?function(n,i){return t(i,n,!0)}:t},combine:function(n){return function(t,i){for(var u=n[0](t,i),r=1,f=n.length;r<f;r++)u=u||n[r](t,i);return u}}};di=e({},yt,{asc:function(n){var t=this.selector(n);return function(n,i){var r=t(n),u=t(i);return(r&&r.getTime&&u&&u.getTime&&(r=r.getTime(),u=u.getTime()),r===u)?n.__position-i.__position:r==null?-1:u==null?1:r.localeCompare?r.localeCompare(u):r>u?1:-1}},desc:function(n){var t=this.selector(n);return function(n,i){var u=t(n),r=t(i);return(u&&u.getTime&&r&&r.getTime&&(u=u.getTime(),r=r.getTime()),u===r)?n.__position-i.__position:u==null?1:r==null?-1:r.localeCompare?r.localeCompare(u):u<r?1:-1}},create:function(n){return this[n.dir](n.field)}});gt=function(n,t){for(var r=n.length,u=new Array(r),i=0;i<r;i++)u[i]=t(n[i],i,n);return u};ui=function(){function n(n){return n.replace(hu,"\\").replace(su,"")}function t(t,i,r,u){var f;return r!=null&&(typeof r===s&&(r=n(r),f=ou.exec(r),f?r=new Date(+f[1]):u?(r="'"+r.toLowerCase()+"'",i="("+i+" || '').toLowerCase()"):r="'"+r+"'"),r.getTime&&(i="("+i+"?"+i+".getTime():"+i+")",r=r.getTime())),i+" "+t+" "+r}return{quote:function(t){return t&&t.getTime?"new Date("+t.getTime()+")":typeof t=="string"?"'"+n(t)+"'":""+t},eq:function(n,i,r){return t("==",n,i,r)},neq:function(n,i,r){return t("!=",n,i,r)},gt:function(n,i,r){return t(">",n,i,r)},gte:function(n,i,r){return t(">=",n,i,r)},lt:function(n,i,r){return t("<",n,i,r)},lte:function(n,i,r){return t("<=",n,i,r)},startswith:function(t,i,r){return r&&(t="("+t+" || '').toLowerCase()",i&&(i=i.toLowerCase())),i&&(i=n(i)),t+".lastIndexOf('"+i+"', 0) == 0"},doesnotstartwith:function(t,i,r){return r&&(t="("+t+" || '').toLowerCase()",i&&(i=i.toLowerCase())),i&&(i=n(i)),t+".lastIndexOf('"+i+"', 0) == -1"},endswith:function(t,i,r){return r&&(t="("+t+" || '').toLowerCase()",i&&(i=i.toLowerCase())),i&&(i=n(i)),t+".indexOf('"+i+"', "+t+".length - "+(i||"").length+") >= 0"},doesnotendwith:function(t,i,r){return r&&(t="("+t+" || '').toLowerCase()",i&&(i=i.toLowerCase())),i&&(i=n(i)),t+".indexOf('"+i+"', "+t+".length - "+(i||"").length+") < 0"},contains:function(t,i,r){return r&&(t="("+t+" || '').toLowerCase()",i&&(i=i.toLowerCase())),i&&(i=n(i)),t+".indexOf('"+i+"') >= 0"},doesnotcontain:function(t,i,r){return r&&(t="("+t+" || '').toLowerCase()",i&&(i=i.toLowerCase())),i&&(i=n(i)),t+".indexOf('"+i+"') == -1"}}}();u.filterExpr=function(n){for(var l=[],r,f,e=[],o=[],h,c,v=n.filters,s=0,a=v.length;s<a;s++)r=v[s],h=r.field,c=r.operator,r.filters?(f=u.filterExpr(r),r=f.expression.replace(/__o\[(\d+)\]/g,function(n,t){return t=+t,"__o["+(o.length+t)+"]"}).replace(/__f\[(\d+)\]/g,function(n,t){return t=+t,"__f["+(e.length+t)+"]"}),o.push.apply(o,f.operators),e.push.apply(e,f.fields)):(typeof h===ti?(f="__f["+e.length+"](d)",e.push(h)):f=i.expr(h),typeof c===ti?(r="__o["+o.length+"]("+f+", "+ui.quote(r.value)+")",o.push(c)):r=ui[(c||"eq").toLowerCase()](f,r.value,r.ignoreCase!==t?r.ignoreCase:!0)),l.push(r);return{expression:"("+l.join({and:" && ",or:" || "}[n.logic])+")",fields:e,operators:o}};gi={"==":"eq",equals:"eq",isequalto:"eq",equalto:"eq",equal:"eq","!=":"neq",ne:"neq",notequals:"neq",isnotequalto:"neq",notequalto:"neq",notequal:"neq","<":"lt",islessthan:"lt",lessthan:"lt",less:"lt","<=":"lte",le:"lte",islessthanorequalto:"lte",lessthanequal:"lte",">":"gt",isgreaterthan:"gt",greaterthan:"gt",greater:"gt",">=":"gte",isgreaterthanorequalto:"gte",greaterthanequal:"gte",ge:"gte",notsubstringof:"doesnotcontain"};u.normalizeFilter=pt;u.prototype={toArray:function(){return this.data},range:function(n,t){return new u(this.data.slice(n,n+t))},skip:function(n){return new u(this.data.slice(n))},take:function(n){return new u(this.data.slice(0,n))},select:function(n){return new u(gt(this.data,n))},order:function(n,t){var i={dir:t};return n&&(n.compare?i.compare=n.compare:i.field=n),new u(this.data.slice(0).sort(yt.create(i)))},orderBy:function(n){return this.order(n,"asc")},orderByDescending:function(n){return this.order(n,"desc")},sort:function(n,t,i){var r,f,u=ft(n,t),e=[];if(i=i||yt,u.length){for(r=0,f=u.length;r<f;r++)e.push(i.create(u[r]));return this.orderBy({compare:i.combine(e)})}return this},filter:function(n){var t,r,s,i,h,c=this.data,f,e,l=[],o;if(n=pt(n),!n||n.filters.length===0)return this;for(i=u.filterExpr(n),f=i.fields,e=i.operators,h=o=new Function("d, __f, __o","return "+i.expression),(f.length||e.length)&&(o=function(n){return h(n,f,e)}),t=0,s=c.length;t<s;t++)r=c[t],o(r)&&l.push(r);return new u(l)},group:function(n,t){n=et(n||[]);t=t||this.data;var f=this,i=new u(f.data),r;return n.length>0&&(r=n[0],i=i.groupBy(r).select(function(i){var f=new u(t).filter([{field:i.field,operator:"eq",value:i.value,ignoreCase:!1}]);return{field:i.field,value:i.value,items:n.length>1?new u(i.items).group(n.slice(1),f.toArray()).toArray():i.items,hasSubgroups:n.length>1,aggregates:f.aggregate(r.aggregates)}})),i},groupBy:function(n){if(b(n)||!this.data.length)return new u([]);for(var t=n.field,o=this._sortForGrouping(t,n.dir||"asc"),c=i.accessor(t),s,r=c.get(o[0],t),f={field:t,value:r,items:[]},h,a=[f],e=0,l=o.length;e<l;e++)s=o[e],h=c.get(s,t),vu(r,h)||(r=h,f={field:t,value:r,items:[]},a.push(f)),f.items.push(s);return new u(a)},_sortForGrouping:function(n,t){var i,f,r=this.data;if(!eu){for(i=0,f=r.length;i<f;i++)r[i].__position=i;for(r=new u(r).sort(n,t,di).toArray(),i=0,f=r.length;i<f;i++)delete r[i].__position;return r}return this.sort(n,t).toArray()},aggregate:function(n){var t,i,r={},u={};if(n&&n.length)for(t=0,i=this.data.length;t<i;t++)yu(r,n,this.data[t],t,i,u);return r}};tr={sum:function(n,t,i){var r=i.get(t);return a(n)?a(r)&&(n+=r):n=r,n},count:function(n){return(n||0)+1},average:function(n,i,r,u,f,e){var o=r.get(i);return e.count===t&&(e.count=0),a(n)?a(o)&&(n+=o):n=o,a(o)&&e.count++,u==f-1&&a(n)&&(n=n/e.count),n},max:function(n,t,i){var r=i.get(t);return a(n)||wt(n)||(n=r),n<r&&(a(r)||wt(r))&&(n=r),n},min:function(n,t,i){var r=i.get(t);return a(n)||wt(n)||(n=r),n>r&&(a(r)||wt(r))&&(n=r),n}};u.process=function(n,i){i=i||{};var r=new u(n),f=i.group,e=et(f||[]).concat(ft(i.sort||[])),o,s=i.filterCallback,h=i.filter,c=i.skip,l=i.take;return h&&(r=r.filter(h),s&&(r=s(r)),o=r.toArray().length),e&&(r=r.sort(e),f&&(n=r.toArray())),c!==t&&l!==t&&(r=r.range(c,l)),f&&(r=r.group(f,n)),{total:o,data:r.toArray()}};var ir=st.extend({init:function(n){this.data=n.data},read:function(n){n.success(this.data)},update:function(n){n.success(n.data)},create:function(n){n.success(n.data)},destroy:function(n){n.success(n.data)}}),rr=st.extend({init:function(n){var t=this,i;n=t.options=e({},t.options,n);ni(gr,function(t,i){typeof n[i]===s&&(n[i]={url:n[i]})});t.cache=n.cache?ot.create(n.cache):{find:k,add:k};i=n.parameterMap;l(n.push)&&(t.push=n.push);t.push||(t.push=rt);t.parameterMap=l(i)?i:function(n){var t={};return ni(n,function(n,r){n in i&&(n=i[n],w(n)&&(r=n.value(r),n=n.key));t[n]=r}),t}},options:{parameterMap:rt},create:function(n){return dt(this.setup(n,ai))},read:function(i){var f=this,r,o,u,e=f.cache;i=f.setup(i,vi);r=i.success||k;o=i.error||k;u=e.find(i.data);u!==t?r(u):(i.success=function(n){e.add(i.data,n);r(n)},n.ajax(i))},update:function(n){return dt(this.setup(n,yi))},destroy:function(n){return dt(this.setup(n,pi))},setup:function(n,t){n=n||{};var u=this,r,i=u.options[t],f=l(i.data)?i.data(n.data):i.data;return n=e(!0,{},i,n),r=e(!0,{},f,n.data),n.data=u.parameterMap(r,t),l(n.url)&&(n.url=n.url(r)),n}}),ot=st.extend({init:function(){this._store={}},add:function(n,i){n!==t&&(this._store[lt(n)]=i)},find:function(n){return this._store[lt(n)]},clear:function(){this._store={}},remove:function(n){delete this._store[lt(n)]}});ot.create=function(n){var t={inmemory:function(){return new ot}};return w(n)&&l(n.find)?n:n===!0?new ot:t[n]()};ei=st.extend({init:function(n){var t=this,h,u,i,a,f;n=n||{};for(h in n)u=n[h],t[h]=typeof u===s?ct(u):u;if(a=n.modelBase||p,w(t.model)&&(t.model=i=a.define(t.model)),f=v(t.data,t),t._dataAccessFunction=f,t.model){var b=v(t.groups,t),k=v(t.serialize,t),e={},c={},y={},o={},l=!1,r;i=t.model;i.fields&&(ni(i.fields,function(n,t){var i;r=n;w(t)&&t.field?r=t.field:typeof t===s&&(r=t);w(t)&&t.from&&(i=t.from);l=l||i&&i!==n||r!==n;c[n]=ct(i||r);y[n]=ct(n);e[i||r]=n;o[n]=i||r}),!n.serialize&&l&&(t.serialize=fi(k,i,pu,y,e,o)));t._dataAccessFunction=f;t.data=fi(f,i,ur,c,e,o);t.groups=fi(b,i,fr,c,e,o)}},errors:function(n){return n?n.errors:null},parse:rt,data:rt,total:function(n){return n.length},groups:rt,aggregates:function(){return{}},serialize:function(n){return n}});c=d.extend({init:function(n){var u=this,s,o,f;n&&(o=n.data);n=u.options=e({},u.options,n);u._map={};u._prefetch={};u._data=[];u._pristineData=[];u._ranges=[];u._view=[];u._pristineTotal=0;u._destroyed=[];u._pageSize=n.pageSize;u._page=n.page||(n.pageSize?1:t);u._sort=ft(n.sort);u._filter=pt(n.filter);u._group=et(n.group);u._aggregate=n.aggregate;u._total=n.total;u._shouldDetachObservableParents=!0;d.fn.init.call(u);u.transport=hi.create(n,o,u);l(u.transport.push)&&u.transport.push({pushCreate:v(u._pushCreate,u),pushUpdate:v(u._pushUpdate,u),pushDestroy:v(u._pushDestroy,u)});n.offlineStorage!=null&&(typeof n.offlineStorage=="string"?(f=n.offlineStorage,u._storage={getItem:function(){return JSON.parse(localStorage.getItem(f))},setItem:function(n){localStorage.setItem(f,lt(u.reader.serialize(n)))}}):u._storage=n.offlineStorage);u.reader=new i.data.readers[n.schema.type||"json"](n.schema);s=u.reader.model||{};u._detachObservableParents();u._data=u._observe(u._data);u._online=!0;u.bind(["push",nt,r,tt,wi,it,ii],n)},options:{data:null,schema:{modelBase:p},offlineStorage:null,serverSorting:!1,serverPaging:!1,serverFiltering:!1,serverGrouping:!1,serverAggregates:!1,batch:!1},clone:function(){return this},online:function(i){return i!==t?this._online!=i&&(this._online=i,i)?this.sync():n.Deferred().resolve().promise():this._online},offlineData:function(n){return this.options.offlineStorage==null?null:n!==t?this._storage.setItem(n):this._storage.getItem()||[]},_isServerGrouped:function(){var n=this.group()||[];return this.options.serverGrouping&&n.length},_pushCreate:function(n){this._push(n,"pushCreate")},_pushUpdate:function(n){this._push(n,"pushUpdate")},_pushDestroy:function(n){this._push(n,"pushDestroy")},_push:function(n,t){var i=this._readData(n);i||(i=n);this[t](i)},_flatData:function(n,t){if(n){if(this._isServerGrouped())return si(n);if(!t)for(var i=0;i<n.length;i++)n.at(i)}return n},parent:k,get:function(n){for(var i=this._flatData(this._data),t=0,r=i.length;t<r;t++)if(i[t].id==n)return i[t]},getByUid:function(n){var t,r,i=this._flatData(this._data);if(i)for(t=0,r=i.length;t<r;t++)if(i[t].uid==n)return i[t]},indexOf:function(n){return ar(this._data,n)},at:function(n){return this._data.at(n)},data:function(n){var i=this,r;if(n!==t)i._detachObservableParents(),i._data=this._observe(n),i._pristineData=n.slice(0),i._storeData(),i._ranges=[],i.trigger("reset"),i._addRange(i._data),i._total=i._data.length,i._pristineTotal=i._total,i._process(i._data);else{if(i._data)for(r=0;r<i._data.length;r++)i._data.at(r);return i._data}},view:function(n){if(n===t)return this._view;this._view=this._observeView(n)},_observeView:function(n){var t=this,i;return hr(n,t._data,t._ranges,t.reader.model||o,t._isServerGrouped()),i=new vt(n,t.reader.model),i.parent=function(){return t.parent()},i},flatView:function(){var n=this.group()||[];return n.length?si(this._view):this._view},add:function(n){return this.insert(this._data.length,n)},_createNewModel:function(n){return this.reader.model?new this.reader.model(n):n instanceof o?n:new o(n)},insert:function(n,t){return t||(t=n,n=0),t instanceof p||(t=this._createNewModel(t)),this._isServerGrouped()?this._data.splice(n,0,this._wrapInEmptyGroup(t)):this._data.splice(n,0,t),t},pushCreate:function(n){var t,f,i,e,u,r;h(n)||(n=[n]);t=[];f=this.options.autoSync;this.options.autoSync=!1;try{for(i=0;i<n.length;i++)e=n[i],u=this.add(e),t.push(u),r=u.toJSON(),this._isServerGrouped()&&(r=this._wrapInEmptyGroup(r)),this._pristineData.push(r)}finally{this.options.autoSync=f}t.length&&this.trigger("push",{type:"create",items:t})},pushUpdate:function(n){var i,u;for(h(n)||(n=[n]),i=[],u=0;u<n.length;u++){var f=n[u],e=this._createNewModel(f),t=this.get(e.id);t?(i.push(t),t.accept(f),t.trigger(r),this._updatePristineForModel(t,f)):this.pushCreate(f)}i.length&&this.trigger("push",{type:"update",items:i})},pushDestroy:function(n){var t=this._removeItems(n);t.length&&this.trigger("push",{type:"destroy",items:t})},_removeItems:function(n){var i,r,t;h(n)||(n=[n]);i=[];r=this.options.autoSync;this.options.autoSync=!1;try{for(t=0;t<n.length;t++){var e=n[t],u=this._createNewModel(e),f=!1;this._eachItem(this._data,function(n){for(var r,t=0;t<n.length;t++)if(r=n.at(t),r.id===u.id){i.push(r);n.splice(t,1);f=!0;break}});f&&(this._removePristineForModel(u),this._destroyed.pop())}}finally{this.options.autoSync=r}return i},remove:function(n){var t,i=this,r=i._isServerGrouped();return this._eachItem(i._data,function(u){return t=cr(u,n),t&&r?(t.isNew&&t.isNew()||i._destroyed.push(t),!0):void 0}),this._removeModelFromRanges(n),this._updateRangesLength(),n},destroyed:function(){return this._destroyed},created:function(){for(var r=[],t=this._flatData(this._data),n=0,i=t.length;n<i;n++)t[n].isNew&&t[n].isNew()&&r.push(t[n]);return r},updated:function(){for(var r=[],t=this._flatData(this._data),n=0,i=t.length;n<i;n++)t[n].isNew&&!t[n].isNew()&&t[n].dirty&&r.push(t[n]);return r},sync:function(){var t=this,r=[],u=[],e=t._destroyed,f=n.Deferred().resolve().promise(),i;if(t.online()){if(!t.reader.model)return f;r=t.created();u=t.updated();i=[];t.options.batch&&t.transport.submit?i=t._sendSubmit(r,u,e):(i.push.apply(i,t._send("create",r)),i.push.apply(i,t._send("update",u)),i.push.apply(i,t._send("destroy",e)));f=n.when.apply(null,i).then(function(){for(var n=0,i=arguments.length;n<i;n++)t._accept(arguments[n]);t._storeData(!0);t._change({action:"sync"});t.trigger(wi)})}else t._storeData(!0),t._change({action:"sync"});return f},cancelChanges:function(n){var t=this;n instanceof i.data.Model?t._cancelModel(n):(t._destroyed=[],t._detachObservableParents(),t._data=t._observe(t._pristineData),t.options.serverPaging&&(t._total=t._pristineTotal),t._ranges=[],t._addRange(t._data),t._change())},hasChanges:function(){var n,i,t=this._flatData(this._data);if(this._destroyed.length)return!0;for(n=0,i=t.length;n<i;n++)if(t[n].isNew&&t[n].isNew()||t[n].dirty)return!0;return!1},_accept:function(t){var r=this,f=t.models,i=t.response,u=0,s=r._isServerGrouped(),c=r._pristineData,e=t.type,o;if(r.trigger(it,{response:i,type:e}),i&&!b(i)){if(i=r.reader.parse(i),r._handleCustomErrors(i))return;i=r.reader.data(i);h(i)||(i=[i])}else i=n.map(f,function(n){return n.toJSON()});for(e==="destroy"&&(r._destroyed=[]),u=0,o=f.length;u<o;u++)e!=="destroy"?(f[u].accept(i[u]),e==="create"?c.push(s?r._wrapInEmptyGroup(f[u]):i[u]):e==="update"&&r._updatePristineForModel(f[u],i[u])):r._removePristineForModel(f[u])},_updatePristineForModel:function(n,t){this._executeOnPristineForModel(n,function(n,r){i.deepExtend(r[n],t)})},_executeOnPristineForModel:function(n,t){this._eachPristineItem(function(i){var r=lr(i,n);if(r>-1)return t(r,i),!0})},_removePristineForModel:function(n){this._executeOnPristineForModel(n,function(n,t){t.splice(n,1)})},_readData:function(n){var t=this._isServerGrouped()?this.reader.groups:this.reader.data;return t.call(this.reader,n)},_eachPristineItem:function(n){this._eachItem(this._pristineData,n)},_eachItem:function(n,t){n&&n.length&&(this._isServerGrouped()?or(n,t):t(n))},_pristineForModel:function(n){var i,t,r=function(r){return t=lr(r,n),t>-1?(i=r[t],!0):void 0};return this._eachPristineItem(r),i},_cancelModel:function(n){var t=this._pristineForModel(n);this._eachItem(this._data,function(i){var r=ar(i,n);r>=0&&(t&&(!n.isNew()||t.__state__)?i[r].accept(t):i.splice(r,1))})},_submit:function(t,i){var r=this;r.trigger(tt,{type:"submit"});r.transport.submit(e({success:function(i,r){var u=n.grep(t,function(n){return n.type==r})[0];u&&u.resolve({response:i,models:u.models,type:r})},error:function(n,i,u){for(var f=0;f<t.length;f++)t[f].reject(n);r.error(n,i,u)}},i))},_sendSubmit:function(t,i,r){var u=this,f=[];return u.options.batch&&(t.length&&f.push(n.Deferred(function(n){n.type="create";n.models=t})),i.length&&f.push(n.Deferred(function(n){n.type="update";n.models=i})),r.length&&f.push(n.Deferred(function(n){n.type="destroy";n.models=r})),u._submit(f,{data:{created:u.reader.serialize(bt(t)),updated:u.reader.serialize(bt(i)),destroyed:u.reader.serialize(bt(r))}})),f},_promise:function(t,i,r){var u=this;return n.Deferred(function(n){u.trigger(tt,{type:r});u.transport[r].call(u.transport,e({success:function(t){n.resolve({response:t,models:i,type:r})},error:function(t,i,r){n.reject(t);u.error(t,i,r)}},t))}).promise()},_send:function(n,t){var r=this,i,f,u=[],e=r.reader.serialize(bt(t));if(r.options.batch)t.length&&u.push(r._promise({data:{models:e}},t,n));else for(i=0,f=t.length;i<f;i++)u.push(r._promise({data:e[i]},[t[i]],n));return u},read:function(t){var i=this,u=i._params(t),r=n.Deferred();return i._queueRequest(u,function(){var n=i.trigger(tt,{type:"read"});n?(i._dequeueRequest(),r.resolve(n)):(i.trigger(ii),i._ranges=[],i.trigger("reset"),i.online()?i.transport.read({data:u,success:function(n){i.success(n,u);r.resolve()},error:function(){var n=ut.call(arguments);i.error.apply(i,n);r.reject.apply(r,n)}}):i.options.offlineStorage!=null&&(i.success(i.offlineData(),u),r.resolve()))}),r.promise()},_readAggregates:function(n){return this.reader.aggregates(n)},success:function(n){var t=this,c=t.options,u,r,h;if(t.trigger(it,{response:n,type:"read"}),t.online()){if(n=t.reader.parse(n),t._handleCustomErrors(n)){t._dequeueRequest();return}t._total=t.reader.total(n);t._aggregate&&c.serverAggregates&&(t._aggregateResult=t._readAggregates(n));n=t._readData(n)}else{n=t._readData(n);for(var f=[],e={},o=t.reader.model,s=o?o.idField:"id",i=0;i<this._destroyed.length;i++)u=this._destroyed[i][s],e[u]=u;for(i=0;i<n.length;i++)r=n[i],h=r.__state__,h=="destroy"?e[r[s]]||this._destroyed.push(this._createNewModel(r)):f.push(r);n=f;t._total=n.length}t._pristineTotal=t._total;t._pristineData=n.slice(0);t._detachObservableParents();t._data=t._observe(n);t.options.offlineStorage!=null&&t._eachItem(t._data,function(n){for(var i,t=0;t<n.length;t++)i=n.at(t),i.__state__=="update"&&(i.dirty=!0)});t._storeData();t._addRange(t._data);t._process(t._data);t._dequeueRequest()},_detachObservableParents:function(){if(this._data&&this._shouldDetachObservableParents)for(var n=0;n<this._data.length;n++)this._data[n].parent&&(this._data[n].parent=k)},_storeData:function(n){function f(n){for(var t,i,u=[],r=0;r<n.length;r++)t=n.at(r),i=t.toJSON(),e&&t.items?i.items=f(t.items):(i.uid=t.uid,o&&(t.isNew()?i.__state__="create":t.dirty&&(i.__state__="update"))),u.push(i);return u}var e=this._isServerGrouped(),o=this.reader.model,i,r,t,u;if(this.options.offlineStorage!=null){for(i=f(this._data),r=[],t=0;t<this._destroyed.length;t++)u=this._destroyed[t].toJSON(),u.__state__="destroy",r.push(u);this.offlineData(i.concat(r));n&&(this._pristineData=i)}},_addRange:function(n){var t=this,i=t._skip||0,r=i+t._flatData(n,!0).length;t._ranges.push({start:i,end:r,data:n,timestamp:(new Date).getTime()});t._ranges.sort(function(n,t){return n.start-t.start})},error:function(n,t,i){this._dequeueRequest();this.trigger(it,{});this.trigger(nt,{xhr:n,status:t,errorThrown:i})},_params:function(n){var t=this,i=e({take:t.take(),skip:t.skip(),page:t.page(),pageSize:t.pageSize(),sort:t._sort,filter:t._filter,group:t._group,aggregate:t._aggregate},n);return t.options.serverPaging||(delete i.take,delete i.skip,delete i.page,delete i.pageSize),t.options.serverGrouping?t.reader.model&&i.group&&(i.group=kt(i.group,t.reader.model)):delete i.group,t.options.serverFiltering?t.reader.model&&i.filter&&(i.filter=pr(i.filter,t.reader.model)):delete i.filter,t.options.serverSorting?t.reader.model&&i.sort&&(i.sort=kt(i.sort,t.reader.model)):delete i.sort,t.options.serverAggregates?t.reader.model&&i.aggregate&&(i.aggregate=kt(i.aggregate,t.reader.model)):delete i.aggregate,i},_queueRequest:function(n,i){var r=this;r._requestInProgress?r._pending={callback:v(i,r),options:n}:(r._requestInProgress=!0,r._pending=t,i())},_dequeueRequest:function(){var n=this;n._requestInProgress=!1;n._pending&&n._queueRequest(n._pending.options,n._pending.callback)},_handleCustomErrors:function(n){if(this.reader.errors){var t=this.reader.errors(n);if(t)return this.trigger(nt,{xhr:null,status:"customerror",errorThrown:"custom error",errors:t}),!0}return!1},_shouldWrap:function(n){var t=this.reader.model;return t&&n.length?!(n[0]instanceof t):!1},_observe:function(n){var t=this,u=t.reader.model,i;return t._shouldDetachObservableParents=!0,n instanceof y?(t._shouldDetachObservableParents=!1,t._shouldWrap(n)&&(n.type=t.reader.model,n.wrapAll(n,n))):(i=t.pageSize()&&!t.options.serverPaging?vt:y,n=new i(n,t.reader.model),n.parent=function(){return t.parent()}),t._isServerGrouped()&&er(n,u),t._changeHandler&&t._data&&t._data instanceof y?t._data.unbind(r,t._changeHandler):t._changeHandler=v(t._change,t),n.bind(r,t._changeHandler)},_updateTotalForAction:function(n,t){var i=this,r=parseInt(i._total,10);a(i._total)||(r=parseInt(i._pristineTotal,10));n==="add"?r+=t.length:n==="remove"?r-=t.length:n==="itemchange"||n==="sync"||i.options.serverPaging?n==="sync"&&(r=i._pristineTotal=parseInt(i._total,10)):r=i._pristineTotal;i._total=r},_change:function(n){var t=this,i,f,r=n?n.action:"",u;if(r==="remove")for(i=0,f=n.items.length;i<f;i++)n.items[i].isNew&&n.items[i].isNew()||t._destroyed.push(n.items[i]);t.options.autoSync&&(r==="add"||r==="remove"||r==="itemchange")?(u=function(i){i.action==="sync"&&(t.unbind("change",u),t._updateTotalForAction(r,n.items))},t.first("change",u),t.sync()):(t._updateTotalForAction(r,n?n.items:[]),t._process(t._data,n))},_calculateAggregates:function(n,t){t=t||{};var i=new u(n),f=t.aggregate,r=t.filter;return r&&(i=i.filter(r)),i.aggregate(f)},_process:function(n,i){var u=this,f={},e;u.options.serverPaging!==!0&&(f.skip=u._skip,f.take=u._take||u._pageSize,f.skip===t&&u._page!==t&&u._pageSize!==t&&(f.skip=(u._page-1)*u._pageSize));u.options.serverSorting!==!0&&(f.sort=u._sort);u.options.serverFiltering!==!0&&(f.filter=u._filter);u.options.serverGrouping!==!0&&(f.group=u._group);u.options.serverAggregates!==!0&&(f.aggregate=u._aggregate,u._aggregateResult=u._calculateAggregates(n,f));e=u._queryProcess(n,f);u.view(e.data);e.total===t||u.options.serverFiltering||(u._total=e.total);i=i||{};i.items=i.items||u._view;u.trigger(r,i)},_queryProcess:function(n,t){return u.process(n,t)},_mergeState:function(n){var i=this;return n!==t&&(i._pageSize=n.pageSize,i._page=n.page,i._sort=n.sort,i._filter=n.filter,i._group=n.group,i._aggregate=n.aggregate,i._skip=n.skip,i._take=n.take,i._skip===t&&(i._skip=i.skip(),n.skip=i.skip()),i._take===t&&i._pageSize!==t&&(i._take=i._pageSize,n.take=i._take),n.sort&&(i._sort=n.sort=ft(n.sort)),n.filter&&(i._filter=n.filter=pt(n.filter)),n.group&&(i._group=n.group=et(n.group)),n.aggregate&&(i._aggregate=n.aggregate=au(n.aggregate))),n},query:function(i){var u,e=this.options.serverSorting||this.options.serverPaging||this.options.serverFiltering||this.options.serverGrouping||this.options.serverAggregates,f;return e||(this._data===t||this._data.length===0)&&!this._destroyed.length?this.read(this._mergeState(i)):(f=this.trigger(tt,{type:"read"}),f||(this.trigger(ii),u=this._queryProcess(this._data,this._mergeState(i)),this.options.serverFiltering||(this._total=u.total!==t?u.total:this._data.length),this._aggregateResult=this._calculateAggregates(this._data,i),this.view(u.data),this.trigger(it,{type:"read"}),this.trigger(r,{items:u.data})),n.Deferred().resolve(f).promise())},fetch:function(n){var t=this,i=function(i){i!==!0&&l(n)&&n.call(t)};return this._query().then(i)},_query:function(n){var t=this;return t.query(e({},{page:t.page(),pageSize:t.pageSize(),sort:t.sort(),filter:t.filter(),group:t.group(),aggregate:t.aggregate()},n))},next:function(n){var t=this,i=t.page(),r=t.total();if(n=n||{},i&&(!r||!(i+1>t.totalPages())))return t._skip=i*t.take(),i+=1,n.page=i,t._query(n),i},prev:function(n){var t=this,i=t.page();if(n=n||{},i&&i!==1)return t._skip=t._skip-t.take(),i-=1,n.page=i,t._query(n),i},page:function(n){var i=this,r;if(n!==t){n=f.max(f.min(f.max(n,1),i.totalPages()),1);i._query({page:n});return}return r=i.skip(),r!==t?f.round((r||0)/(i.take()||1))+1:t},pageSize:function(n){var i=this;if(n!==t){i._query({pageSize:n,page:1});return}return i.take()},sort:function(n){var i=this;if(n!==t){i._query({sort:n});return}return i._sort},filter:function(n){var i=this;if(n===t)return i._filter;i.trigger("reset");i._query({filter:n,page:1})},group:function(n){var i=this;if(n!==t){i._query({group:n});return}return i._group},total:function(){return parseInt(this._total||0,10)},aggregate:function(n){var i=this;if(n!==t){i._query({aggregate:n});return}return i._aggregate},aggregates:function(){var n=this._aggregateResult;return b(n)&&(n=this._emptyAggregates(this.aggregate())),n},_emptyAggregates:function(n){var r={},i,t;if(!b(n))for(i={},h(n)||(n=[n]),t=0;t<n.length;t++)i[n[t].aggregate]=0,r[n[t].field]=i;return r},_wrapInEmptyGroup:function(n){for(var u=this.group(),t,i,r=u.length-1,f=0;r>=f;r--)i=u[r],t={value:n.get(i.field),field:i.field,items:t?[t]:[n],hasSubgroups:!!t,aggregates:this._emptyAggregates(i.aggregates)};return t},totalPages:function(){var n=this,t=n.pageSize()||n.total();return f.ceil((n.total()||0)/t)},inRange:function(n,t){var i=this,r=f.min(n+t,i.total());return!i.options.serverPaging&&i._data.length>0?!0:i._findRange(n,r).length>0},lastRange:function(){var n=this._ranges;return n[n.length-1]||{start:0,end:0,data:[]}},firstItemUid:function(){var n=this._ranges;return n.length&&n[0].data.length&&n[0].data[0].uid},enableRequestsInProgress:function(){this._skipRequestsInProgress=!1},_timeStamp:function(){return(new Date).getTime()},range:function(n,i){this._currentRequestTimeStamp=this._timeStamp();this._skipRequestsInProgress=!0;n=f.min(n||0,this.total());var r=this,e=f.max(f.floor(n/i),0)*i,u=f.min(e+i,r.total()),o;if(o=r._findRange(n,f.min(n+i,r.total())),o.length){r._pending=t;r._skip=n>r.skip()?f.min(u,(r.totalPages()-1)*r.take()):e;r._take=i;var s=r.options.serverPaging,h=r.options.serverSorting,c=r.options.serverFiltering,l=r.options.serverAggregates;try{r.options.serverPaging=!0;r._isServerGrouped()||r.group()&&r.group().length||(r.options.serverSorting=!0);r.options.serverFiltering=!0;r.options.serverPaging=!0;r.options.serverAggregates=!0;s&&(r._detachObservableParents(),r._data=o=r._observe(o));r._process(o)}finally{r.options.serverPaging=s;r.options.serverSorting=h;r.options.serverFiltering=c;r.options.serverAggregates=l}return}i!==t&&(r._rangeExists(e,u)?e<n&&r.prefetch(u,i,function(){r.range(n,i)}):r.prefetch(e,i,function(){n>e&&u<r.total()&&!r._rangeExists(u,f.min(u+i,r.total()))?r.prefetch(u,i,function(){r.range(n,i)}):r.range(n,i)}))},_findRange:function(n,i){for(var u=this,y=u._ranges,r,p=[],h,c,o,w,l,a,s=u.options,d=s.serverSorting||s.serverPaging||s.serverFiltering||s.serverGrouping||s.serverAggregates,v,f,k,e=0,b=y.length;e<b;e++)if(r=y[e],n>=r.start&&n<=r.end){for(f=0,h=e;h<b;h++)if(r=y[h],v=u._flatData(r.data,!0),v.length&&n+f>=r.start&&(w=r.data,l=r.end,d||(k=et(u.group()||[]).concat(ft(u.sort()||[])),a=u._queryProcess(r.data,{sort:k,filter:u.filter()}),v=w=a.data,a.total!==t&&(l=a.total)),c=0,n+f>r.start&&(c=n+f-r.start),o=v.length,l>i&&(o=o-(l-i)),f+=o-c,p=u._mergeGroups(p,w,c,o),i<=r.end&&f==i-n))return p;break}return[]},_mergeGroups:function(n,t,i,r){if(this._isServerGrouped()){var u=t.toJSON(),f;return n.length&&(f=n[n.length-1]),oi(f,u,i,r),n.concat(u)}return n.concat(t.slice(i,r))},skip:function(){var n=this;return n._skip===t?n._page!==t?(n._page-1)*(n.take()||1):t:n._skip},take:function(){return this._take||this._pageSize},_prefetchSuccessHandler:function(n,t,i,u){var f=this,e=f._timeStamp();return function(o){var l=!1,s={start:n,end:t,data:[],timestamp:f._timeStamp()},h,a,c;if(f._dequeueRequest(),f.trigger(it,{response:o,type:"read"}),o=f.reader.parse(o),c=f._readData(o),c.length){for(h=0,a=f._ranges.length;h<a;h++)if(f._ranges[h].start===n){l=!0;s=f._ranges[h];break}l||f._ranges.push(s)}s.data=f._observe(c);s.end=s.start+f._flatData(s.data,!0).length;f._ranges.sort(function(n,t){return n.start-t.start});f._total=f.reader.total(o);(u||e>=f._currentRequestTimeStamp||!f._skipRequestsInProgress)&&(i&&c.length?i():f.trigger(r,{}))}},prefetch:function(n,t,i){var r=this,u=f.min(n+t,r.total()),e={take:t,skip:n,page:n/t+1,pageSize:t,sort:r._sort,filter:r._filter,group:r._group,aggregate:r._aggregate};r._rangeExists(n,u)?i&&i():(clearTimeout(r._timeout),r._timeout=setTimeout(function(){r._queueRequest(e,function(){r.trigger(tt,{type:"read"})?r._dequeueRequest():r.transport.read({data:r._params(e),success:r._prefetchSuccessHandler(n,u,i),error:function(){var n=ut.call(arguments);r.error.apply(r,n)}})})},100))},_multiplePrefetch:function(n,t,i){var r=this,u=f.min(n+t,r.total()),e={take:t,skip:n,page:n/t+1,pageSize:t,sort:r._sort,filter:r._filter,group:r._group,aggregate:r._aggregate};r._rangeExists(n,u)?i&&i():r.trigger(tt,{type:"read"})||r.transport.read({data:r._params(e),success:r._prefetchSuccessHandler(n,u,i,!0)})},_rangeExists:function(n,t){for(var f=this,r=f._ranges,i=0,u=r.length;i<u;i++)if(r[i].start<=n&&r[i].end>=t)return!0;return!1},_removeModelFromRanges:function(n){for(var i,r,u,t=0,f=this._ranges.length;t<f;t++)if(u=this._ranges[t],this._eachItem(u.data,function(t){i=cr(t,n);i&&(r=!0)}),r)break},_updateRangesLength:function(){for(var r=0,n,t,i=0,u=this._ranges.length;i<u;i++)n=this._ranges[i],n.start=n.start-r,t=this._flatData(n.data,!0).length,r=n.end-t,n.end=n.start+t}});hi={};hi.create=function(t,r,u){var o,f=t.transport?n.extend({},t.transport):null;return f?(f.read=typeof f.read===s?{url:f.read}:f.read,t.type==="jsdo"&&(f.dataSource=u),t.type&&(i.data.transports=i.data.transports||{},i.data.schemas=i.data.schemas||{},i.data.transports[t.type]&&!w(i.data.transports[t.type])?o=new i.data.transports[t.type](e(f,{data:r})):f=e(!0,{},i.data.transports[t.type],f),t.schema=e(!0,{},i.data.schemas[t.type],t.schema)),o||(o=l(f.read)?f:new rr(f))):o=new ir({data:t.data||[]}),o};c.create=function(n){(h(n)||n instanceof y)&&(n={data:n});var r=n||{},u=r.data,f=r.fields,l=r.table,a=r.select,o,p,v={},s;if(u||!f||r.transport||(l?u=ku(l,f):a&&(u=bu(a,f),r.group===t&&u[0]&&u[0].optgroup!==t&&(r.group="optgroup"))),i.data.Model&&f&&(!r.schema||!r.schema.model)){for(o=0,p=f.length;o<p;o++)s=f[o],s.type&&(v[s.field]=s);b(v)||(r.schema=e(!0,r.schema,{model:{fields:v}}))}return r.data=u,a=null,r.select=null,l=null,r.table=null,r instanceof c?r:new c(r)};ci=p.define({idField:"id",init:function(n){var t=this,r=t.hasChildren||n&&n.hasChildren,f="items",u={};i.data.Model.fn.init.call(t,n);typeof t.children===s&&(f=t.children);u={schema:{data:f,model:{hasChildren:r,id:t.idField,fields:t.fields}}};typeof t.children!==s&&e(u,t.children);u.data=n;r||(r=u.schema.data);typeof r===s&&(r=i.getter(r));l(r)&&(t.hasChildren=!!r.call(t,t));t._childrenOptions=u;t.hasChildren&&t._initChildren();t._loaded=!!(n&&n._loaded)},_initChildren:function(){var n=this,t,i,u;n.children instanceof g||(t=n.children=new g(n._childrenOptions),i=t.transport,u=i.parameterMap,i.parameterMap=function(t,i){return t[n.idField||"id"]=n.id,u&&(t=u(t,i)),t},t.parent=function(){return n},t.bind(r,function(t){t.node=t.node||n;n.trigger(r,t)}),t.bind(nt,function(t){var i=n.parent();i&&(t.node=t.node||n,i.trigger(nt,t))}),n._updateChildrenField())},append:function(n){this._initChildren();this.loaded(!0);this.children.add(n)},hasChildren:!1,level:function(){for(var n=this.parentNode(),t=0;n&&n.parentNode;)t++,n=n.parentNode?n.parentNode():null;return t},_updateChildrenField:function(){var n=this._childrenOptions.schema.data;this[n||"items"]=this.children.data()},_childrenLoaded:function(){this._loaded=!0;this._updateChildrenField()},load:function(){var u={},f="_query",i,e;if(this.hasChildren){this._initChildren();i=this.children;u[this.idField||"id"]=this.id;this._loaded||(i._data=t,f="read");i.one(r,v(this._childrenLoaded,this));e=i[f](u)}else this.loaded(!0);return e||n.Deferred().resolve().promise()},parentNode:function(){var n=this.parent();return n.parent()},loaded:function(n){if(n!==t)this._loaded=n;else return this._loaded},shouldSerialize:function(n){return p.fn.shouldSerialize.call(this,n)&&n!=="children"&&n!=="_loaded"&&n!=="hasChildren"&&n!=="_childrenOptions"}});g=c.extend({init:function(n){var t=ci.define({children:n});c.fn.init.call(this,e(!0,{},{schema:{modelBase:t,model:t}},n));this._attachBubbleHandlers()},_attachBubbleHandlers:function(){var n=this;n._data.bind(nt,function(t){n.trigger(nt,t)})},remove:function(n){var t=n.parentNode(),i=this,r;return t&&t._initChildren&&(i=t.children),r=c.fn.remove.call(i,n),t&&!i.data().length&&(t.hasChildren=!1),r},success:wr("success"),data:wr("data"),insert:function(n,t){var i=this.parent();return i&&i._initChildren&&(i.hasChildren=!0,i._initChildren()),c.fn.insert.call(this,n,t)},_find:function(n,t){var r,e,i,f,u=this._data;if(u){if(i=c.fn[n].call(this,t),i)return i;for(u=this._flatData(this._data),r=0,e=u.length;r<e;r++)if((f=u[r].children,f instanceof g)&&(i=f[n](t),i))return i}},get:function(n){return this._find("get",n)},getByUid:function(n){return this._find("getByUid",n)}});g.create=function(n){n=n&&n.push?{data:n}:n;var t=n||{},i=t.data,r=t.fields,u=t.list;return i&&i._dataSource?i._dataSource:(i||!r||t.transport||u&&(i=br(u,r)),t.data=i,t instanceof g?t:new g(t))};li=i.Observable.extend({init:function(n,t,r){i.Observable.fn.init.call(this);this._prefetching=!1;this.dataSource=n;this.prefetch=!r;var u=this;n.bind("change",function(){u._change()});n.bind("reset",function(){u._reset()});this._syncWithDataSource();this.setViewSize(t)},setViewSize:function(n){this.viewSize=n;this._recalculate()},at:function(n){var t=this.pageSize,i=!0;return n>=this.total()?(this.trigger("endreached",{index:n}),null):this.useRanges?this.useRanges?((n<this.dataOffset||n>=this.skip+t)&&(i=this.range(Math.floor(n/t)*t)),n===this.prefetchThreshold&&this._prefetch(),n===this.midPageThreshold?this.range(this.nextMidRange,!0):n===this.nextPageThreshold?this.range(this.nextFullRange):n===this.pullBackThreshold&&(this.offset===this.skip?this.range(this.previousMidRange):this.range(this.previousFullRange)),i?this.dataSource.at(n-this.dataOffset):(this.trigger("endreached",{index:n}),null)):void 0:this.dataSource.view()[n]},indexOf:function(n){return this.dataSource.data().indexOf(n)+this.dataOffset},total:function(){return parseInt(this.dataSource.total(),10)},next:function(){var n=this,t=n.pageSize,i=n.skip-n.viewSize+t,r=f.max(f.floor(i/t),0)*t;this.offset=i;this.dataSource.prefetch(r,t,function(){n._goToRange(i,!0)})},range:function(n,t){if(this.offset===n)return!0;var r=this,i=this.pageSize,u=f.max(f.floor(n/i),0)*i,e=this.dataSource;return(t&&(u+=i),e.inRange(n,i))?(this.offset=n,this._recalculate(),this._goToRange(n),!0):this.prefetch?(e.prefetch(u,i,function(){r.offset=n;r._recalculate();r._goToRange(n,!0)}),!1):!0},syncDataSource:function(){var n=this.offset;this.offset=null;this.range(n)},destroy:function(){this.unbind()},_prefetch:function(){var i=this,n=this.pageSize,t=this.skip+n,r=this.dataSource;r.inRange(t,n)||this._prefetching||!this.prefetch||(this._prefetching=!0,this.trigger("prefetching",{skip:t,take:n}),r.prefetch(t,n,function(){i._prefetching=!1;i.trigger("prefetched",{skip:t,take:n})}))},_goToRange:function(n,t){this.offset===n&&(this.dataOffset=n,this._expanding=t,this.dataSource.range(n,this.pageSize),this.dataSource.enableRequestsInProgress())},_reset:function(){this._syncPending=!0},_change:function(){var n=this.dataSource;this.length=this.useRanges?n.lastRange().end:n.view().length;this._syncPending&&(this._syncWithDataSource(),this._recalculate(),this._syncPending=!1,this.trigger("reset",{offset:this.offset}));this.trigger("resize");this._expanding&&this.trigger("expand");delete this._expanding},_syncWithDataSource:function(){var n=this.dataSource;this._firstItemUid=n.firstItemUid();this.dataOffset=this.offset=n.skip()||0;this.pageSize=n.pageSize();this.useRanges=n.options.serverPaging},_recalculate:function(){var t=this.pageSize,r=this.offset,i=this.viewSize,n=Math.ceil(r/t)*t;this.skip=n;this.midPageThreshold=n+t-1;this.nextPageThreshold=n+i-1;this.prefetchThreshold=n+Math.floor(t/3*2);this.pullBackThreshold=this.offset-1;this.nextMidRange=n+t-i;this.nextFullRange=n;this.previousMidRange=r-i;this.previousFullRange=n-t}});kr=i.Observable.extend({init:function(n,t){var r=this;i.Observable.fn.init.call(r);this.dataSource=n;this.batchSize=t;this._total=0;this.buffer=new li(n,t*3);this.buffer.bind({endreached:function(n){r.trigger("endreached",{index:n.index})},prefetching:function(n){r.trigger("prefetching",{skip:n.skip,take:n.take})},prefetched:function(n){r.trigger("prefetched",{skip:n.skip,take:n.take})},reset:function(){r._total=0;r.trigger("reset")},resize:function(){r._total=Math.ceil(this.length/r.batchSize);r.trigger("resize",{total:r.total(),offset:this.offset})}})},syncDataSource:function(){this.buffer.syncDataSource()},at:function(n){var t=this.buffer,u=n*this.batchSize,e=this.batchSize,f=[],r,i;for(t.offset>u&&t.at(t.offset-1),i=0;i<e;i++){if(r=t.at(u+i),r===null)break;f.push(r)}return f},total:function(){return this._total},destroy:function(){this.buffer.destroy();this.unbind()}});e(!0,i.data,{readers:{json:ei},Query:u,DataSource:c,HierarchicalDataSource:g,Node:ci,ObservableObject:o,ObservableArray:y,LazyObservableArray:vt,LocalTransport:ir,RemoteTransport:rr,Cache:ot,DataReader:ei,Model:p,Buffer:li,BatchBuffer:kr})})(window.kendo.jQuery)}(),function(){(function(n,t){function b(t,u,f){return r.extend({init:function(n,t,i){var u=this;r.fn.init.call(u,n.element[0],t,i);u.widget=n;u._dataBinding=c(u.dataBinding,u);u._dataBound=c(u.dataBound,u);u._itemChange=c(u.itemChange,u)},itemChange:function(n){a(n.item[0],n.data,this._ns(n.ns),[n.data].concat(this.bindings[t]._parents()))},dataBinding:function(n){for(var u=this.widget,r=n.removedItems||u.items(),t=0,i=r.length;t<i;t++)p(r[t],!1)},_ns:function(t){t=t||i.ui;var r=[i.ui,i.dataviz.ui,i.mobile.ui];return r.splice(n.inArray(t,r),1),r.unshift(t),i.rolesFromNamespaces(r)},dataBound:function(n){var r,e,o=this.widget,s=n.addedItems||o.items(),h=o[u],f,c,l=i.data.HierarchicalDataSource;if((!l||!(h instanceof l))&&s.length)for(f=n.addedDataItems||h.flatView(),c=this.bindings[t]._parents(),r=0,e=f.length;r<e;r++)a(s[r],f[r],this._ns(n.ns),[f[r]].concat(c))},refresh:function(n){var e=this,o,r=e.widget,s,h;n=n||{};n.action||(e.destroy(),r.bind("dataBinding",e._dataBinding),r.bind("dataBound",e._dataBound),r.bind("itemChange",e._itemChange),o=e.bindings[t].get(),r[u]instanceof i.data.DataSource&&r[u]!=o&&(o instanceof i.data.DataSource?r[f](o):o&&o._dataSource?r[f](o._dataSource):(r[u].data(o),s=i.ui.Select&&r instanceof i.ui.Select,h=i.ui.MultiSelect&&r instanceof i.ui.MultiSelect,e.bindings.value&&(s||h)&&r.value(at(e.bindings.value.get(),r.options.dataValueField)))))},destroy:function(){var n=this.widget;n.unbind("dataBinding",this._dataBinding);n.unbind("dataBound",this._dataBound);n.unbind("itemChange",this._itemChange)}})}function wt(n,t){var r=i.initWidget(n,{},t);if(r)return new ft(r)}function st(n){var e={},i,o,r,u,s,t,f;for(f=n.match(et),i=0,o=f.length;i<o;i++)r=f[i],u=r.indexOf(":"),s=r.substring(0,u),t=r.substring(u+1),t.charAt(0)=="{"&&(t=st(t)),e[s]=t;return e}function y(n,t,i){var r,u={};for(r in n)u[r]=new i(t,n[r]);return u}function a(n,t,r,u){var w=n.getAttribute("data-"+i.ns+"role"),s,e=n.getAttribute("data-"+i.ns+"bind"),v=n.children,p=[],b=!0,o,l={},c;if(u=u||[t],(w||e)&&ct(n,!1),w&&(c=wt(n,r)),e&&(e=st(e.replace(ot,"")),c||(l=i.parseOptions(n,{textField:"",valueField:"",template:"",valueUpdate:f,valuePrimitive:!1,autoBind:!0}),l.roles=r,c=new ut(n,l)),c.source=t,o=y(e,u,h),l.template&&(o.template=new pt(u,"",l.template)),o.click&&(e.events=e.events||{},e.events.click=e.click,o.click.destroy(),delete o.click),o.source&&(b=!1),e.attr&&(o.attr=y(e.attr,u,h)),e.style&&(o.style=y(e.style,u,h)),e.events&&(o.events=y(e.events,u,yt)),e.css&&(o.css=y(e.css,u,h)),c.bind(o)),c&&(n.kendoBindingTarget=c),b&&v){for(s=0;s<v.length;s++)p[s]=v[s];for(s=0;s<p.length;s++)a(p[s],t,r,u)}}function ht(t,r){var u,e,f,o=i.rolesFromNamespaces([].slice.call(arguments,2));for(r=i.observable(r),t=n(t),u=0,e=t.length;u<e;u++)f=t[u],f.nodeType===1&&a(f,r,o)}function ct(t,r){var f=t.kendoBindingTarget,u;f&&(f.destroy(),it?delete t.kendoBindingTarget:t.removeAttribute?t.removeAttribute("kendoBindingTarget"):t.kendoBindingTarget=null);r&&(u=i.widgetInstance(n(t)),u&&typeof u.destroy===vt&&u.destroy())}function p(n,t){ct(n,t);lt(n,t)}function lt(n,t){var r=n.children,i,u;if(r)for(i=0,u=r.length;i<u;i++)p(r[i],t)}function bt(t){var i,r;for(t=n(t),i=0,r=t.length;i<r;i++)p(t[i],!1)}function kt(n,t){var i=n.element,r=i[0].kendoBindingTarget;r&&ht(i,r.source,t)}function at(n,t){var u=[],i=0,f,r;if(!t)return n;if(n instanceof e){for(f=n.length;i<f;i++)r=n[i],u[i]=r.get?r.get(t):r[t];n=u}else n instanceof o&&(n=n.get(t));return n}var i=window.kendo,w=i.Observable,o=i.data.ObservableObject,e=i.data.ObservableArray,k={}.toString,u={},d=i.Class,c=n.proxy,s="value",g="source",nt="events",l="checked",tt="css",it=!0,vt="function",f="change",et,ot;(function(){var n=document.createElement("a");try{delete n.test}catch(t){it=!1}})();var h=w.extend({init:function(n,t){var i=this;w.fn.init.call(i);i.source=n[0];i.parents=n;i.path=t;i.dependencies={};i.dependencies[t]=!0;i.observable=i.source instanceof w;i._access=function(n){i.dependencies[n.field]=!0};i.observable&&(i._change=function(n){i.change(n)},i.source.bind(f,i._change))},_parents:function(){var t=this.parents,i=this.get(),r;return i&&typeof i.parent=="function"&&(r=i.parent(),n.inArray(r,t)<0&&(t=[r].concat(t))),t},change:function(n){var r,t,u=n.field,i=this;if(i.path==="this")i.trigger(f,n);else for(r in i.dependencies)if(r.indexOf(u)===0&&(t=r.charAt(u.length),!t||t==="."||t==="[")){i.trigger(f,n);break}},start:function(n){n.bind("get",this._access)},stop:function(n){n.unbind("get",this._access)},get:function(){var i=this,n=i.source,e=0,u=i.path,r=n;if(!i.observable)return r;for(i.start(i.source),r=n.get(u);r===t&&n;)n=i.parents[++e],n instanceof o&&(r=n.get(u));if(r===t)for(n=i.source;r===t&&n;)n=n.parent(),n instanceof o&&(r=n.get(u));return typeof r=="function"&&(e=u.lastIndexOf("."),e>0&&(n=n.get(u.substring(0,e))),i.start(n),r=n!==i.source?r.call(n,i.source):r.call(n),i.stop(n)),n&&n!==i.source&&(i.currentSource=n,n.unbind(f,i._change).bind(f,i._change)),i.stop(i.source),r},set:function(n){var t=this.currentSource||this.source,r=i.getter(this.path)(t);typeof r=="function"?t!==this.source?r.call(t,this.source,n):r.call(t,n):t.set(this.path,n)},destroy:function(){this.observable&&(this.source.unbind(f,this._change),this.currentSource&&this.currentSource.unbind(f,this._change));this.unbind()}}),yt=h.extend({get:function(){for(var n=this.source,i=this.path,r=0,t=n.get(i);!t&&n;)n=this.parents[++r],n instanceof o&&(t=n.get(i));return c(t,n)}}),pt=h.extend({init:function(n,t,i){var r=this;h.fn.init.call(r,n,t);r.template=i},render:function(n){var t;return this.start(this.source),t=i.render(this.template,n),this.stop(this.source),t}}),r=d.extend({init:function(n,t,i){this.element=n;this.bindings=t;this.options=i},bind:function(n,t){var i=this;n=t?n[t]:n;n.bind(f,function(n){i.refresh(t||n)});i.refresh(t)},destroy:function(){}}),v=r.extend({dataType:function(){var n=this.element.getAttribute("data-type")||this.element.type||"text";return n.toLowerCase()},parsedValue:function(){return this._parseValue(this.element.value,this.dataType())},_parseValue:function(n,t){return t=="date"?n=i.parseDate(n,"yyyy-MM-dd"):t=="datetime-local"?n=i.parseDate(n,["yyyy-MM-ddTHH:mm:ss","yyyy-MM-ddTHH:mm"]):t=="number"?n=i.parseFloat(n):t=="boolean"&&(n=n.toLowerCase(),n=i.parseFloat(n)!==null?Boolean(i.parseFloat(n)):n.toLowerCase()==="true"),n}});u.attr=r.extend({refresh:function(n){this.element.setAttribute(n,this.bindings.attr[n].get())}});u.css=r.extend({init:function(n,t,i){r.fn.init.call(this,n,t,i);this.classes={}},refresh:function(t){var i=n(this.element),r=this.bindings.css[t],u=this.classes[t]=r.get();u?i.addClass(t):i.removeClass(t)}});u.style=r.extend({refresh:function(n){this.element.style[n]=this.bindings.style[n].get()||""}});u.enabled=r.extend({refresh:function(){this.bindings.enabled.get()?this.element.removeAttribute("disabled"):this.element.setAttribute("disabled","disabled")}});u.readonly=r.extend({refresh:function(){this.bindings.readonly.get()?this.element.setAttribute("readonly","readonly"):this.element.removeAttribute("readonly")}});u.disabled=r.extend({refresh:function(){this.bindings.disabled.get()?this.element.setAttribute("disabled","disabled"):this.element.removeAttribute("disabled")}});u.events=r.extend({init:function(n,t,i){r.fn.init.call(this,n,t,i);this.handlers={}},refresh:function(t){var r=n(this.element),u=this.bindings.events[t],i=this.handlers[t];i&&r.off(t,i);i=this.handlers[t]=u.get();r.on(t,u.source,i)},destroy:function(){var i=n(this.element);for(var t in this.handlers)i.off(t,this.handlers[t])}});u.text=r.extend({refresh:function(){var t=this.bindings.text.get(),r=this.element.getAttribute("data-format")||"";t==null&&(t="");n(this.element).text(i.toString(t,r))}});u.visible=r.extend({refresh:function(){this.element.style.display=this.bindings.visible.get()?"":"none"}});u.invisible=r.extend({refresh:function(){this.element.style.display=this.bindings.invisible.get()?"none":""}});u.html=r.extend({refresh:function(){this.element.innerHTML=this.bindings.html.get()}});u.value=v.extend({init:function(t,i,r){v.fn.init.call(this,t,i,r);this._change=c(this.change,this);this.eventName=r.valueUpdate||f;n(this.element).on(this.eventName,this._change);this._initChange=!1},change:function(){this._initChange=this.eventName!=f;this.bindings[s].set(this.parsedValue());this._initChange=!1},refresh:function(){var n,t;this._initChange||(n=this.bindings[s].get(),n==null&&(n=""),t=this.dataType(),t=="date"?n=i.toString(n,"yyyy-MM-dd"):t=="datetime-local"&&(n=i.toString(n,"yyyy-MM-ddTHH:mm:ss")),this.element.value=n);this._initChange=!1},destroy:function(){n(this.element).off(this.eventName,this._change)}});u.source=r.extend({init:function(n,t,u){r.fn.init.call(this,n,t,u);var f=this.bindings.source.get();f instanceof i.data.DataSource&&u.autoBind!==!1&&f.fetch()},refresh:function(n){var t=this,r=t.bindings.source.get();r instanceof e||r instanceof i.data.DataSource?(n=n||{},n.action=="add"?t.add(n.index,n.items):n.action=="remove"?t.remove(n.index,n.items):n.action!="itemchange"&&t.render()):t.render()},container:function(){var n=this.element;return n.nodeName.toLowerCase()=="table"&&(n.tBodies[0]||n.appendChild(document.createElement("tbody")),n=n.tBodies[0]),n},template:function(){var n=this.options,t=n.template,r=this.container().nodeName.toLowerCase();return t||(t=r=="select"?n.valueField||n.textField?i.format('<option value="#:{0}#">#:{1}#<\/option>',n.valueField||n.textField,n.textField||n.valueField):"<option>#:data#<\/option>":r=="tbody"?"<tr><td>#:data#<\/td><\/tr>":r=="ul"||r=="ol"?"<li>#:data#<\/li>":"#:data#",t=i.template(t)),t},add:function(t,r){var f=this.container(),s,u,h,e,o=f.cloneNode(!1),c=f.children[t];if(n(o).html(i.render(this.template(),r)),o.children.length)for(s=this.bindings.source._parents(),u=0,h=r.length;u<h;u++)e=o.children[0],f.insertBefore(e,c||null),a(e,r[u],this.options.roles,[r[u]].concat(s))},remove:function(n,t){for(var u=this.container(),r,i=0;i<t.length;i++)r=u.children[n],p(r,!0),u.removeChild(r)},render:function(){var t=this.bindings.source.get(),f,r,o,u=this.container(),s=this.template();if(t instanceof i.data.DataSource&&(t=t.view()),t instanceof e||k.call(t)==="[object Array]"||(t=[t]),this.bindings.template){if(lt(u,!0),n(u).html(this.bindings.template.render(t)),u.children.length)for(f=this.bindings.source._parents(),r=0,o=t.length;r<o;r++)a(u.children[r],t[r],this.options.roles,[t[r]].concat(f))}else n(u).html(i.render(s,t))}});u.input={checked:v.extend({init:function(t,i,r){v.fn.init.call(this,t,i,r);this._change=c(this.change,this);n(this.element).change(this._change)},change:function(){var u=this.element,n=this.value(),t,r,i;if(u.type=="radio")n=this.parsedValue(),this.bindings[l].set(n);else if(u.type=="checkbox")if(t=this.bindings[l].get(),t instanceof e){if(n=this.parsedValue(),n instanceof Date){for(i=0;i<t.length;i++)if(t[i]instanceof Date&&+t[i]==+n){r=i;break}}else r=t.indexOf(n);r>-1?t.splice(r,1):t.push(n)}else this.bindings[l].set(n)},refresh:function(){var n=this.bindings[l].get(),t=n,o=this.dataType(),r=this.element,f,u;if(r.type=="checkbox")if(t instanceof e){if(f=-1,n=this.parsedValue(),n instanceof Date){for(u=0;u<t.length;u++)if(t[u]instanceof Date&&+t[u]==+n){f=u;break}}else f=t.indexOf(n);r.checked=f>=0}else r.checked=t;else r.type=="radio"&&n!=null&&(o=="date"?n=i.toString(n,"yyyy-MM-dd"):o=="datetime-local"&&(n=i.toString(n,"yyyy-MM-ddTHH:mm:ss")),r.checked=r.value===n.toString()?!0:!1)},value:function(){var n=this.element,t=n.value;return n.type=="checkbox"&&(t=n.checked),t},destroy:function(){n(this.element).off(f,this._change)}})};u.select={source:u.source.extend({refresh:function(r){var u=this,o=u.bindings.source.get(),f;o instanceof e||o instanceof i.data.DataSource?(r=r||{},r.action=="add"?u.add(r.index,r.items):r.action=="remove"?u.remove(r.index,r.items):(r.action=="itemchange"||r.action===t)&&(u.render(),u.bindings.value&&u.bindings.value&&(f=at(u.bindings.value.get(),n(u.element).data("valueField")),f===null?u.element.selectedIndex=-1:u.element.value=f))):u.render()}}),value:v.extend({init:function(t,i,r){v.fn.init.call(this,t,i,r);this._change=c(this.change,this);n(this.element).change(this._change)},parsedValue:function(){for(var f=this.dataType(),r=[],n,t,i=0,u=this.element.options.length;i<u;i++)t=this.element.options[i],t.selected&&(n=t.attributes.value,n=n&&n.specified?t.value:t.text,r.push(this._parseValue(n,f)));return r},change:function(){for(var u=[],v=this.element,f,l=this.options.valueField||this.options.textField,w=this.options.valuePrimitive,h,c,n,y,p,r=0,a=v.options.length;r<a;r++)h=v.options[r],h.selected&&(n=h.attributes.value,n=n&&n.specified?h.value:h.text,u.push(this._parseValue(n,this.dataType())));if(l)for(f=this.bindings.source.get(),f instanceof i.data.DataSource&&(f=f.view()),c=0;c<u.length;c++)for(r=0,a=f.length;r<a;r++)if(y=this._parseValue(f[r].get(l),this.dataType()),p=String(y)===u[c],p){u[c]=f[r];break}n=this.bindings[s].get();n instanceof e?n.splice.apply(n,[0,n.length].concat(u)):!w&&(n instanceof o||n===null||n===t||!l)?this.bindings[s].set(u[0]):this.bindings[s].set(u[0].get(l))},refresh:function(){var t,c=this.element,f=c.options,n=this.bindings[s].get(),r=n,l=this.options.valueField||this.options.textField,v=!1,a=this.dataType(),h,u;for(r instanceof e||(r=new e([n])),c.selectedIndex=-1,u=0;u<r.length;u++)for(n=r[u],l&&n instanceof o&&(n=n.get(l)),a=="date"?n=i.toString(r[u],"yyyy-MM-dd"):a=="datetime-local"&&(n=i.toString(r[u],"yyyy-MM-ddTHH:mm:ss")),t=0;t<f.length;t++)h=f[t].value,h===""&&n!==""&&(h=f[t].text),n!=null&&h==n.toString()&&(f[t].selected=!0,v=!0)},destroy:function(){n(this.element).off(f,this._change)}})};u.widget={events:r.extend({init:function(n,t,i){r.fn.init.call(this,n.element[0],t,i);this.widget=n;this.handlers={}},refresh:function(n){var i=this.bindings.events[n],t=this.handlers[n];t&&this.widget.unbind(n,t);t=i.get();this.handlers[n]=function(n){n.data=i.source;t(n);n.data===i.source&&delete n.data};this.widget.bind(n,this.handlers[n])},destroy:function(){for(var n in this.handlers)this.widget.unbind(n,this.handlers[n])}}),checked:r.extend({init:function(n,t,i){r.fn.init.call(this,n.element[0],t,i);this.widget=n;this._change=c(this.change,this);this.widget.bind(f,this._change)},change:function(){this.bindings[l].set(this.value())},refresh:function(){this.widget.check(this.bindings[l].get()===!0)},value:function(){var t=this.element,n=t.value;return(n=="on"||n=="off")&&(n=t.checked),n},destroy:function(){this.widget.unbind(f,this._change)}}),visible:r.extend({init:function(n,t,i){r.fn.init.call(this,n.element[0],t,i);this.widget=n},refresh:function(){var n=this.bindings.visible.get();this.widget.wrapper[0].style.display=n?"":"none"}}),invisible:r.extend({init:function(n,t,i){r.fn.init.call(this,n.element[0],t,i);this.widget=n},refresh:function(){var n=this.bindings.invisible.get();this.widget.wrapper[0].style.display=n?"none":""}}),enabled:r.extend({init:function(n,t,i){r.fn.init.call(this,n.element[0],t,i);this.widget=n},refresh:function(){this.widget.enable&&this.widget.enable(this.bindings.enabled.get())}}),disabled:r.extend({init:function(n,t,i){r.fn.init.call(this,n.element[0],t,i);this.widget=n},refresh:function(){this.widget.enable&&this.widget.enable(!this.bindings.disabled.get())}}),source:b("source","dataSource","setDataSource"),value:r.extend({init:function(t,i,u){r.fn.init.call(this,t.element[0],i,u);this.widget=t;this._change=n.proxy(this.change,this);this.widget.first(f,this._change);var s=this.bindings.value.get();this._valueIsObservableObject=!u.valuePrimitive&&(s==null||s instanceof o);this._valueIsObservableArray=s instanceof e;this._initChange=!1},change:function(){var n=this.widget.value(),f=this.options.dataValueField||this.options.dataTextField,c=k.call(n)==="[object Array]",h=this._valueIsObservableObject,u,l,t=[],e,o,s,a,r;if(this._initChange=!0,f)if(this.bindings.source&&(r=this.bindings.source.get()),n===""&&(h||this.options.valuePrimitive))n=null;else{for((!r||r instanceof i.data.DataSource)&&(r=this.widget.dataSource.flatView()),c&&(l=n.length,t=n.slice(0)),s=0,a=r.length;s<a;s++)if(e=r[s],o=e.get(f),c){for(u=0;u<l;u++)if(o==t[u]){t[u]=e;break}}else if(o==n){n=h?e:o;break}t[0]&&(n=this._valueIsObservableArray?t:h||!f?t[0]:t[0].get(f))}this.bindings.value.set(n);this._initChange=!1},refresh:function(){if(!this._initChange){var i=this.widget,r=i.options,h=r.dataTextField,f=r.dataValueField||h,n=this.bindings.value.get(),u=r.text||"",s=0,c,l=[];if(n===t&&(n=null),f)if(n instanceof e){for(c=n.length;s<c;s++)l[s]=n[s].get(f);n=l}else n instanceof o&&(u=n.get(h),n=n.get(f));r.autoBind!==!1||r.cascadeFrom||!i.listView||i.listView.isBound()?i.value(n):(h!==f||u||(u=n),!u&&(n||n===0)&&r.valuePrimitive?i.value(n):i._preselect(n,u))}this._initChange=!1},destroy:function(){this.widget.unbind(f,this._change)}}),gantt:{dependencies:b("dependencies","dependencies","setDependenciesDataSource")},multiselect:{value:r.extend({init:function(t,i,u){r.fn.init.call(this,t.element[0],i,u);this.widget=t;this._change=n.proxy(this.change,this);this.widget.first(f,this._change);this._initChange=!1},change:function(){var r=this,i=r.bindings[s].get(),v=r.options.valuePrimitive,n=v?r.widget.value():r.widget.dataItems(),y=this.options.dataValueField||this.options.dataTextField;if(n=n.slice(0),r._initChange=!0,i instanceof e){for(var c=[],p=n.length,h=0,f=0,u=i[h],l=!1,w,o,a;u!==t;){for(a=!1,f=0;f<p;f++)if(v?l=n[f]==u:(o=n[f],o=o.get?o.get(y):o,l=o==(u.get?u.get(y):u)),l){n.splice(f,1);p-=1;a=!0;break}a?h+=1:(c.push(u),rt(i,h,1),w=h);u=i[h]}rt(i,i.length,0,n);c.length&&i.trigger("change",{action:"remove",items:c,index:w});n.length&&i.trigger("change",{action:"add",items:n,index:i.length-1})}else r.bindings[s].set(n);r._initChange=!1},refresh:function(){if(!this._initChange){var i=this.options,f=this.widget,s=i.dataValueField||i.dataTextField,n=this.bindings.value.get(),l=n,r=0,h,c=[],u;if(n===t&&(n=null),s)if(n instanceof e){for(h=n.length;r<h;r++)u=n[r],c[r]=u.get?u.get(s):u;n=c}else n instanceof o&&(n=n.get(s));i.autoBind!==!1||i.valuePrimitive===!0||f.listView.isBound()?f.value(n):f._preselect(l,n)}},destroy:function(){this.widget.unbind(f,this._change)}})},scheduler:{source:b("source","dataSource","setDataSource").extend({dataBound:function(n){var t,r,u=this.widget,f=n.addedItems||u.items(),i,e;if(f.length)for(i=n.addedDataItems||u.dataItems(),e=this.bindings.source._parents(),t=0,r=i.length;t<r;t++)a(f[t],i[t],this._ns(n.ns),[i[t]].concat(e))}})}};var rt=function(n,t,i,r){r=r||[];i=i||0;var f=r.length,s=n.length,o=[].slice.call(n,t+i),e=o.length,u;if(f){for(f=t+f,u=0;t<f;t++)n[t]=r[u],u++;n.length=f}else if(i)for(n.length=t,i+=t;t<i;)delete n[--i];if(e){for(e=t+e,u=0;t<e;t++)n[t]=o[u],u++;n.length=e}for(t=n.length;t<s;)delete n[t],t++},ut=d.extend({init:function(n,t){this.target=n;this.options=t;this.toDestroy=[]},bind:function(n){var t,u,f,e,o,h,r=this instanceof ft,i=this.binders();for(t in n)t==s?u=!0:t==g?f=!0:t!=nt||r?t==l?o=!0:t==tt?h=!0:this.applyBinding(t,n,i):e=!0;f&&this.applyBinding(g,n,i);u&&this.applyBinding(s,n,i);o&&this.applyBinding(l,n,i);e&&!r&&this.applyBinding(nt,n,i);h&&!r&&this.applyBinding(tt,n,i)},binders:function(){return u[this.target.nodeName.toLowerCase()]||{}},applyBinding:function(n,t,i){var r=i[n]||u[n],e=this.toDestroy,o,f=t[n];if(r)if(r=new r(this.target,t,this.options),e.push(r),f instanceof h)r.bind(f),e.push(f);else for(o in f)r.bind(f,o),e.push(f[o]);else if(n!=="template")throw new Error("The "+n+" binding is not supported by the "+this.target.nodeName.toLowerCase()+" element");},destroy:function(){for(var i=this.toDestroy,n=0,t=i.length;n<t;n++)i[n].destroy()}}),ft=ut.extend({binders:function(){return u.widget[this.target.options.name.toLowerCase()]||{}},applyBinding:function(n,t,i){var r=i[n]||u.widget[n],e=this.toDestroy,o,f=t[n];if(r)if(r=new r(this.target,t,this.target.options),e.push(r),f instanceof h)r.bind(f),e.push(f);else for(o in f)r.bind(f,o),e.push(f[o]);else throw new Error("The "+n+" binding is not supported by the "+this.target.options.name+" widget");}});et=/[A-Za-z0-9_\-]+:(\{([^}]*)\}|[^,}]+)/g;ot=/\s/g;i.unbind=bt;i.bind=ht;i.data.binders=u;i.data.Binder=r;i.notify=kt;i.observable=function(n){return n instanceof o||(n=new o(n)),n};i.observableHierarchy=function(n){function r(n){for(var i,t=0;t<n.length;t++)n[t]._initChildren(),i=n[t].children,i.fetch(),n[t].items=i.data(),r(n[t].items)}var t=i.data.HierarchicalDataSource.create(n);return t.fetch(),r(t.data()),t._data._dataSource=t,t._data}})(window.kendo.jQuery)}(),function(){(function(n,t){function ii(n){return parseInt(n,10)}function y(n,t){return ii(n.css(t))}function rr(n){var t=[];for(var i in n)t.push(i);return t}function st(n){for(var t in n)rt.indexOf(t)!=-1&&k.indexOf(t)==-1&&delete n[t];return n}function ht(n,t){var r=[],u={},e,i,o,h;for(i in t)e=i.toLowerCase(),h=f&&rt.indexOf(e)!=-1,!p.hasHW3D&&h&&k.indexOf(e)==-1?delete t[i]:(o=t[i],h?r.push(i+"("+o+")"):u[i]=o);return r.length&&(u[s]=r.join(" ")),u}function ri(n,t){var u,i,r;return f?(u=n.css(s),u==tr)?t=="scale"?1:0:(i=u.match(new RegExp(t+"\\s*\\(([\\d\\w\\.]+)")),r=0,i?r=ii(i[1]):(i=u.match(pi)||[0,0,0,0,0],t=t.toLowerCase(),wi.test(t)?r=parseFloat(i[3]/i[2]):t=="translatey"?r=parseFloat(i[4]/i[2]):t=="scale"?r=parseFloat(i[2]):t=="rotate"&&(r=parseFloat(Math.atan2(i[2],i[1])))),r):parseFloat(n.css(t))}function lt(n){return n.charAt(0).toUpperCase()+n.substring(1)}function e(n,t){var i=h.extend(t),u=i.prototype.directions;r[lt(n)]=i;r.Element.prototype[n]=function(n,t,r,u){return new i(this.element,n,t,r,u)};l(u,function(t,u){r.Element.prototype[n+lt(u)]=function(n,t,r){return new i(this.element,u,n,t,r)}})}function fi(n,t,i,r){e(n,{directions:ui,startValue:function(n){return this._startValue=n,this},endValue:function(n){return this._endValue=n,this},shouldHide:function(){return this._shouldHide},prepare:function(n,u){var s=this,f,e,h=this._direction==="out",o=s.element.data(t),c=!(isNaN(o)||o==i);f=c?o:typeof this._startValue!="undefined"?this._startValue:h?i:r;e=typeof this._endValue!="undefined"?this._endValue:h?r:i;this._reverse?(n[t]=e,u[t]=f):(n[t]=f,u[t]=e);s._shouldHide=u[t]===r}})}function hi(n,t){var r=i.directions[t].vertical,u=n[r?g:ft]()/2+"px";return oi[t].replace("$size",u)}var i=window.kendo,r=i.effects,l=n.each,u=n.extend,li=n.proxy,p=i.support,ai=p.browser,f=p.transforms,o=p.transitions,vi={scale:0,scalex:0,scaley:0,scale3d:0},yi={translate:0,translatex:0,translatey:0,translate3d:0},yt=typeof document.documentElement.style.zoom!="undefined"&&!f,pi=/matrix3?d?\s*\(.*,\s*([\d\.\-]+)\w*?,\s*([\d\.\-]+)\w*?,\s*([\d\.\-]+)\w*?,\s*([\d\.\-]+)\w*?/i,pt=/^(-?[\d\.\-]+)?[\w\s]*,?\s*(-?[\d\.\-]+)?[\w\s]*/i,wi=/translatex?$/i,bi=/(zoom|fade|expand)(\w+)/,wt=/(zoom|fade|expand)/,ki=/[xy]$/i,rt=["perspective","rotate","rotatex","rotatey","rotatez","rotate3d","scale","scalex","scaley","scalez","scale3d","skew","skewx","skewy","translate","translatex","translatey","translatez","translate3d","matrix","matrix3d"],k=["rotate","scale","scalex","scaley","skew","skewx","skewy","translate","translatex","translatey","matrix"],di={rotate:"deg",scale:"",skew:"px",translate:"px"},d=f.css,gi=Math.round,nr="",w="px",tr="none",ut="auto",ft="width",g="height",bt="hidden",et="origin",kt="abortId",nt="overflow",a="translate",tt="position",dt="completeCallback",v=d+"transition",s=d+"transform",ir=d+"backface-visibility",gt=d+"perspective",ot="1500px",ni="perspective("+ot+")",c={left:{reverse:"right",property:"left",transition:"translatex",vertical:!1,modifier:-1},right:{reverse:"left",property:"left",transition:"translatex",vertical:!1,modifier:1},down:{reverse:"up",property:"top",transition:"translatey",vertical:!0,modifier:1},up:{reverse:"down",property:"top",transition:"translatey",vertical:!0,modifier:-1},top:{reverse:"bottom"},bottom:{reverse:"top"},"in":{reverse:"out",modifier:-1},out:{reverse:"in",modifier:1},vertical:{reverse:"vertical"},horizontal:{reverse:"horizontal"}},ti,ct,h,b,ui,ei,oi,si,at,ci,it,vt;i.directions=c;u(n.fn,{kendoStop:function(n,t){return o?r.stopQueue(this,n||!1,t||!1):this.stop(n,t)}});f&&!o&&(l(k,function(t,i){n.fn[i]=function(t){if(typeof t=="undefined")return ri(this,i);var r=n(this)[0],u=i+"("+t+di[i.replace(ki,"")]+")";return r.style.cssText.indexOf(s)==-1?n(this).css(s,u):r.style.cssText=r.style.cssText.replace(new RegExp(i+"\\(.*?\\)","i"),u),this};n.fx.step[i]=function(t){n(t.elem)[i](t.now)}}),ti=n.fx.prototype.cur,n.fx.prototype.cur=function(){return k.indexOf(this.prop)!=-1?parseFloat(n(this.elem)[this.prop]()):ti.apply(this,arguments)});i.toggleClass=function(n,t,i,r){return t&&(t=t.split(" "),o&&(i=u({exclusive:"all",duration:400,ease:"ease-out"},i),n.css(v,i.exclusive+" "+i.duration+"ms "+i.ease),setTimeout(function(){n.css(v,"").css(g)},i.duration)),l(t,function(t,i){n.toggleClass(i,r)})),n};i.parseEffects=function(n,t){var i={};return typeof n=="string"?l(n.split(" "),function(n,r){var o=!wt.test(r),s=r.replace(bi,function(n,t,i){return t+":"+i.toLowerCase()}),u=s.split(":"),f=u[1],e={};u.length>1&&(e.direction=t&&o?c[f].reverse:f);i[u[0]]=e}):l(n,function(n){var r=this.direction;r&&t&&!wt.test(n)&&(this.direction=c[r].reverse);i[n]=this}),i};o&&u(r,{transition:function(t,i,r){var h,l=0,a=t.data("keys")||[],f,c,e;if(r=u({duration:200,ease:"ease-out",complete:null,exclusive:"all"},r),c=!1,e=function(){c||(c=!0,f&&(clearTimeout(f),f=null),t.removeData(kt).dequeue().css(v,"").css(v),r.complete.call(t))},r.duration=n.fx?n.fx.speeds[r.duration]||r.duration:r.duration,h=ht(t,i),n.merge(a,rr(h)),t.data("keys",n.unique(a)).height(),t.css(v,r.exclusive+" "+r.duration+"ms "+r.ease).css(v),t.css(h).css(s),o.event){t.one(o.event,e);r.duration!==0&&(l=500)}f=setTimeout(e,r.duration+l);t.data(kt,f);t.data(dt,e)},stopQueue:function(n,t,r){var u,f=n.data("keys"),e=!r&&f,o=n.data(dt);return e&&(u=i.getComputedStyles(n[0],f)),o&&o(),e&&n.css(u),n.removeData("keys").stop(t)}});ct=i.Class.extend({init:function(n,t){var i=this;i.element=n;i.effects=[];i.options=t;i.restore=[]},run:function(t){var a=this,l,h,v,k=t.length,c=a.element,i=a.options,p=n.Deferred(),e={},y={},w,b,d,g;for(a.effects=t,p.then(n.proxy(a,"complete")),c.data("animating",!0),h=0;h<k;h++)for(l=t[h],l.setReverse(i.reverse),l.setOptions(i),a.addRestoreProperties(l.restore),l.prepare(e,y),b=l.children(),v=0,d=b.length;v<d;v++)b[v].duration(i.duration).run();for(g in i.effects)u(y,i.effects[g].properties);for(c.is(":visible")||u(e,{display:c.data("olddisplay")||"block"}),f&&!i.reset&&(w=c.data("targetTransform"),w&&(e=u(w,e))),e=ht(c,e),f&&!o&&(e=st(e)),c.css(e).css(s),h=0;h<k;h++)t[h].setup();return i.init&&i.init(),c.data("targetTransform",y),r.animate(c,y,u({},i,{complete:p.resolve})),p.promise()},stop:function(){n(this.element).kendoStop(!0,!0)},addRestoreProperties:function(n){for(var i=this.element,t,r=0,u=n.length;r<u;r++)t=n[r],this.restore.push(t),i.data(t)||i.data(t,i.css(t))},restoreCallback:function(){for(var t,i=this.element,n=0,r=this.restore.length;n<r;n++)t=this.restore[n],i.css(t,i.data(t))},complete:function(){var i=this,r=0,t=i.element,u=i.options,e=i.effects,o=e.length;for(t.removeData("animating").dequeue(),u.hide&&t.data("olddisplay",t.css("display")).hide(),this.restoreCallback(),yt&&!f&&setTimeout(n.proxy(this,"restoreCallback"),0);r<o;r++)e[r].teardown();u.completeCallback&&u.completeCallback(t)}});r.promise=function(n,t){var u=[],f,s=new ct(n,t),e=i.parseEffects(t.effects),h,o;t.effects=e;for(o in e)f=r[lt(o)],f&&(h=new f(n,e[o].direction),u.push(h));u[0]?s.run(u):(n.is(":visible")||n.css({display:n.data("olddisplay")||"block"}).css("display"),t.init&&t.init(),n.dequeue(),s.complete())};u(r,{animate:function(i,e,s){var h=s.transition!==!1;delete s.transition;o&&"transition"in r&&h?r.transition(i,e,s):f?i.animate(st(e),{queue:!1,show:!1,hide:!1,duration:s.duration,complete:s.complete}):i.each(function(){var i=n(this),r={};l(rt,function(n,o){var c,p=e?e[o]+" ":null,s,w,b,h,l,v;p&&(s=e,o in vi&&e[o]!==t?(c=p.match(pt),f&&u(s,{scale:+c[0]})):o in yi&&e[o]!==t&&(w=i.css(tt),b=w=="absolute"||w=="fixed",i.data(a)||(b?i.data(a,{top:y(i,"top")||0,left:y(i,"left")||0,bottom:y(i,"bottom"),right:y(i,"right")}):i.data(a,{top:y(i,"marginTop")||0,left:y(i,"marginLeft")||0})),h=i.data(a),c=p.match(pt),c&&(l=o==a+"y"?0:+c[1],v=o==a+"y"?+c[1]:+c[2],b?(isNaN(h.right)?isNaN(l)||u(s,{left:h.left+l}):isNaN(l)||u(s,{right:h.right-l}),isNaN(h.bottom)?isNaN(v)||u(s,{top:h.top+v}):isNaN(v)||u(s,{bottom:h.bottom-v})):(isNaN(l)||u(s,{marginLeft:h.left+l}),isNaN(v)||u(s,{marginTop:h.top+v})))),!f&&o!="scale"&&o in s&&delete s[o],s&&u(r,s))});ai.msie&&delete r.scale;i.animate(r,{queue:!1,show:!1,hide:!1,duration:s.duration,complete:s.complete})})}});r.animatedPromise=r.promise;h=i.Class.extend({init:function(n,t){var i=this;i.element=n;i._direction=t;i.options={};i._additionalEffects=[];i.restore||(i.restore=[])},reverse:function(){return this._reverse=!0,this.run()},play:function(){return this._reverse=!1,this.run()},add:function(n){return this._additionalEffects.push(n),this},direction:function(n){return this._direction=n,this},duration:function(n){return this._duration=n,this},compositeRun:function(){var n=this,t=new ct(n.element,{reverse:n._reverse,duration:n._duration}),i=n._additionalEffects.concat([n]);return t.run(i)},run:function(){if(this._additionalEffects&&this._additionalEffects[0])return this.compositeRun();var e=this,t=e.element,h=0,y=e.restore,w=y.length,c,l=n.Deferred(),i={},a={},v,p=e.children(),b=p.length;for(l.then(n.proxy(e,"_complete")),t.data("animating",!0),h=0;h<w;h++)c=y[h],t.data(c)||t.data(c,t.css(c));for(h=0;h<b;h++)p[h].duration(e._duration).run();return e.prepare(i,a),t.is(":visible")||u(i,{display:t.data("olddisplay")||"block"}),f&&(v=t.data("targetTransform"),v&&(i=u(v,i))),i=ht(t,i),f&&!o&&(i=st(i)),t.css(i).css(s),e.setup(),t.data("targetTransform",a),r.animate(t,a,{duration:e._duration,complete:l.resolve}),l.promise()},stop:function(){for(var t=0,i=this.children(),r=i.length,t=0;t<r;t++)i[t].stop();return n(this.element).kendoStop(!0,!0),this},restoreCallback:function(){for(var t,i=this.element,n=0,r=this.restore.length;n<r;n++)t=this.restore[n],i.css(t,i.data(t))},_complete:function(){var t=this,i=t.element;i.removeData("animating").dequeue();t.restoreCallback();t.shouldHide()&&i.data("olddisplay",i.css("display")).hide();yt&&!f&&setTimeout(n.proxy(t,"restoreCallback"),0);t.teardown()},setOptions:function(n){u(!0,this.options,n)},children:function(){return[]},shouldHide:n.noop,setup:n.noop,prepare:n.noop,teardown:n.noop,directions:[],setReverse:function(n){return this._reverse=n,this}});b=["left","right","up","down"];ui=["in","out"];e("slideIn",{directions:b,divisor:function(n){return this.options.divisor=n,this},prepare:function(n,t){var r=this,u,e=r.element,i=c[r._direction],h=-i.modifier*(i.vertical?e.outerHeight():e.outerWidth()),o=h/(r.options&&r.options.divisor||1)+w,s="0px";r._reverse&&(u=n,n=t,t=u);f?(n[i.transition]=o,t[i.transition]=s):(n[i.property]=o,t[i.property]=s)}});e("tile",{directions:b,init:function(n,t,i){h.prototype.init.call(this,n,t);this.options={previous:i}},previousDivisor:function(n){return this.options.previousDivisor=n,this},children:function(){var n=this,t=n._reverse,r=n.options.previous,e=n.options.previousDivisor||1,u=n._direction,f=[i.fx(n.element).slideIn(u).setReverse(t)];return r&&f.push(i.fx(r).slideIn(c[u].reverse).divisor(e).setReverse(!t)),f}});fi("fade","opacity",1,0);fi("zoom","scale",1,.01);e("slideMargin",{prepare:function(n,t){var r=this,i=r.element,u=r.options,o=i.data(et),s=u.offset,f,e=r._reverse;e||o!==null||i.data(et,parseFloat(i.css("margin-"+u.axis)));f=i.data(et)||0;t["margin-"+u.axis]=e?f:f+s}});e("slideTo",{prepare:function(n,t){var u=this,e=u.element,o=u.options,i=o.offset.split(","),r=u._reverse;f?(t.translatex=r?0:i[0],t.translatey=r?0:i[1]):(t.left=r?0:i[0],t.top=r?0:i[1]);e.css("left")}});e("expand",{directions:["horizontal","vertical"],restore:[nt],prepare:function(n,i){var f=this,e=f.element,o=f.options,s=f._reverse,r=f._direction==="vertical"?g:ft,h=e[0].style[r],c=e.data(r),u=parseFloat(c||h),l=gi(e.css(r,ut)[r]());n.overflow=bt;u=o&&o.reset?l||u:u||l;i[r]=(s?0:u)+w;n[r]=(s?u:0)+w;c===t&&e.data(r,h)},shouldHide:function(){return this._reverse},teardown:function(){var t=this,i=t.element,n=t._direction==="vertical"?g:ft,r=i.data(n);(r==ut||r===nr)&&setTimeout(function(){i.css(n,ut).css(n)},0)}});ei={position:"absolute",marginLeft:0,marginTop:0,scale:1};e("transfer",{init:function(n,t){this.element=n;this.options={target:t};this.restore=[]},setup:function(){this.element.appendTo(document.body)},prepare:function(n,t){var e=this,i=e.element,f=r.box(i),o=r.box(e.options.target),l=ri(i,"scale"),h=r.fillScale(o,f),c=r.transformOrigin(o,f);u(n,ei);t.scale=1;i.css(s,"scale(1)").css(s);i.css(s,"scale("+l+")");n.top=f.top;n.left=f.left;n.transformOrigin=c.x+w+" "+c.y+w;e._reverse?n.scale=h:t.scale=h}});oi={top:"rect(auto auto $size auto)",bottom:"rect($size auto auto auto)",left:"rect(auto $size auto auto)",right:"rect(auto auto auto $size)"};si={top:{start:"rotatex(0deg)",end:"rotatex(180deg)"},bottom:{start:"rotatex(-180deg)",end:"rotatex(0deg)"},left:{start:"rotatey(0deg)",end:"rotatey(-180deg)"},right:{start:"rotatey(180deg)",end:"rotatey(0deg)"}};e("turningPage",{directions:b,init:function(n,t,i){h.prototype.init.call(this,n,t);this._container=i},prepare:function(n,t){var r=this,f=r._reverse,e=f?c[r._direction].reverse:r._direction,u=si[e];n.zIndex=1;r._clipInHalf&&(n.clip=hi(r._container,i.directions[e].reverse));n[ir]=bt;t[s]=ni+(f?u.start:u.end);n[s]=ni+(f?u.end:u.start)},setup:function(){this._container.append(this.element)},face:function(n){return this._face=n,this},shouldHide:function(){var n=this,t=n._reverse,i=n._face;return t&&!i||!t&&i},clipInHalf:function(n){return this._clipInHalf=n,this},temporary:function(){return this.element.addClass("temp-page"),this}});e("staticPage",{directions:b,init:function(n,t,i){h.prototype.init.call(this,n,t);this._container=i},restore:["clip"],prepare:function(n,t){var i=this,r=i._reverse?c[i._direction].reverse:i._direction;n.clip=hi(i._container,r);n.opacity=.999;t.opacity=1},shouldHide:function(){var n=this,t=n._reverse,i=n._face;return t&&!i||!t&&i},face:function(n){return this._face=n,this}});e("pageturn",{directions:["horizontal","vertical"],init:function(n,t,i,r){h.prototype.init.call(this,n,t);this.options={};this.options.face=i;this.options.back=r},children:function(){var r=this,u=r.options,n=r._direction==="horizontal"?"left":"top",f=i.directions[n].reverse,t=r._reverse,o,s=u.face.clone(!0).removeAttr("id"),h=u.back.clone(!0).removeAttr("id"),e=r.element;return t&&(o=n,n=f,f=o),[i.fx(u.face).staticPage(n,e).face(!0).setReverse(t),i.fx(u.back).staticPage(f,e).setReverse(t),i.fx(s).turningPage(n,e).face(!0).clipInHalf(!0).temporary().setReverse(t),i.fx(h).turningPage(f,e).clipInHalf(!0).temporary().setReverse(t)]},prepare:function(n,t){n[gt]=ot;n.transformStyle="preserve-3d";n.opacity=.999;t.opacity=1},teardown:function(){this.element.find(".temp-page").remove()}});e("flip",{directions:["horizontal","vertical"],init:function(n,t,i,r){h.prototype.init.call(this,n,t);this.options={};this.options.face=i;this.options.back=r},children:function(){var n=this,f=n.options,t=n._direction==="horizontal"?"left":"top",r=i.directions[t].reverse,u=n._reverse,e,o=n.element;return u&&(e=t,t=r,r=e),[i.fx(f.face).turningPage(t,o).face(!0).setReverse(u),i.fx(f.back).turningPage(r,o).setReverse(u)]},prepare:function(n){n[gt]=ot;n.transformStyle="preserve-3d"}});at=!p.mobileOS.android;ci=".km-touch-scrollbar, .km-actionsheet-wrapper";e("replace",{_before:n.noop,_after:n.noop,init:function(t,i,r){h.prototype.init.call(this,t);this._previous=n(i);this._transitionClass=r},duration:function(){throw new Error("The replace effect does not support duration setting; the effect duration may be customized through the transition class rule");},beforeTransition:function(n){return this._before=n,this},afterTransition:function(n){return this._after=n,this},_both:function(){return n().add(this._element).add(this._previous)},_containerClass:function(){var t=this._direction,n="k-fx k-fx-start k-fx-"+this._transitionClass;return t&&(n+=" k-fx-"+t),this._reverse&&(n+=" k-fx-reverse"),n},complete:function(t){if(this.deferred&&(!t||!n(t.target).is(ci))){var i=this.container;i.removeClass("k-fx-end").removeClass(this._containerClass()).off(o.event,this.completeProxy);this._previous.hide().removeClass("k-fx-current");this.element.removeClass("k-fx-next");at&&i.css(nt,"");this.isAbsolute||this._both().css(tt,"");this.deferred.resolve();delete this.deferred}},run:function(){if(this._additionalEffects&&this._additionalEffects[0])return this.compositeRun();var u=this,r=u.element,f=u._previous,t=r.parents().filter(f.parents()).first(),s=u._both(),e=n.Deferred(),h=r.css(tt),c;if(t.length||(t=r.parent()),this.container=t,this.deferred=e,this.isAbsolute=h=="absolute",this.isAbsolute||s.css(tt,"absolute"),at&&(c=t.css(nt),t.css(nt,"hidden")),o){r.addClass("k-fx-hidden");t.addClass(this._containerClass());this.completeProxy=n.proxy(this,"complete");t.on(o.event,this.completeProxy);i.animationFrame(function(){r.removeClass("k-fx-hidden").addClass("k-fx-next");f.css("display","").addClass("k-fx-current");u._before(f,r);i.animationFrame(function(){t.removeClass("k-fx-start").addClass("k-fx-end");u._after(f,r)})})}else this.complete();return e.promise()},stop:function(){this.complete()}});it=i.Class.extend({init:function(){var n=this;n._tickProxy=li(n._tick,n);n._started=!1},tick:n.noop,done:n.noop,onEnd:n.noop,onCancel:n.noop,start:function(){this.enabled()&&(this.done()?this.onEnd():(this._started=!0,i.animationFrame(this._tickProxy)))},enabled:function(){return!0},cancel:function(){this._started=!1;this.onCancel()},_tick:function(){var n=this;n._started&&(n.tick(),n.done()?(n._started=!1,n.onEnd()):i.animationFrame(n._tickProxy))}});vt=it.extend({init:function(n){var t=this;u(t,n);it.fn.init.call(t)},done:function(){return this.timePassed()>=this.duration},timePassed:function(){return Math.min(this.duration,new Date-this.startDate)},moveTo:function(n){var t=this,i=t.movable;t.initial=i[t.axis];t.delta=n.location-t.initial;t.duration=typeof n.duration=="number"?n.duration:300;t.tick=t._easeProxy(n.ease);t.startDate=new Date;t.start()},_easeProxy:function(n){var t=this;return function(){t.movable.moveAxis(t.axis,n(t.timePassed(),t.initial,t.delta,t.duration))}}});u(vt,{easeOutExpo:function(n,t,i,r){return n==r?t+i:i*(-Math.pow(2,-10*n/r)+1)+t},easeOutBack:function(n,t,i,r,u){return u=1.70158,i*((n=n/r-1)*n*((u+1)*n+u)+1)+t}});r.Animation=it;r.Transition=vt;r.createEffect=e;r.box=function(t){t=n(t);var i=t.offset();return i.width=t.outerWidth(),i.height=t.outerHeight(),i};r.transformOrigin=function(n,t){var i=(n.left-t.left)*t.width/(t.width-n.width),r=(n.top-t.top)*t.height/(t.height-n.height);return{x:isNaN(i)?0:i,y:isNaN(r)?0:r}};r.fillScale=function(n,t){return Math.min(n.width/t.width,n.height/t.height)};r.fitScale=function(n,t){return Math.max(n.width/t.width,n.height/t.height)}})(window.kendo.jQuery)}(),function(){(function(n){function k(n){if(!n)return{};var t=n.match(b)||[];return{type:t[1],direction:t[3],reverse:t[5]==="reverse"}}var t=window.kendo,i=t.Observable,l="SCRIPT",u="init",f="show",e="hide",o="transitionStart",s="transitionEnd",a="attach",v="detach",y=/unrecognized expression/,r=i.extend({init:function(n,r){var h=this;r=r||{};i.fn.init.call(h);h.content=n;h.id=t.guid();h.tagName=r.tagName||"div";h.model=r.model;h._wrap=r.wrap!==!1;this._evalTemplate=r.evalTemplate||!1;h._fragments={};h.bind([u,f,e,o,s],r)},render:function(i){var r=this,e=!r.element;return e&&(r.element=r._createElement()),i&&n(i).append(r.element),e&&(t.bind(r.element,r.model),r.trigger(u)),i&&(r._eachFragment(a),r.trigger(f)),r.element},clone:function(){return new h(this)},triggerBeforeShow:function(){return!0},triggerBeforeHide:function(){return!0},showStart:function(){this.element.css("display","")},showEnd:function(){},hideEnd:function(){this.hide()},beforeTransition:function(n){this.trigger(o,{type:n})},afterTransition:function(n){this.trigger(s,{type:n})},hide:function(){this._eachFragment(v);this.element.detach();this.trigger(e)},destroy:function(){var n=this.element;n&&(t.unbind(n),t.destroy(n),n.remove())},fragments:function(t){n.extend(this._fragments,t)},_eachFragment:function(n){for(var t in this._fragments)this._fragments[t][n](this,t)},_createElement:function(){var u=this,e="<"+u.tagName+" />",r,i,f;try{i=n(document.getElementById(u.content)||u.content);i[0].tagName===l&&(i=i.html())}catch(o){y.test(o.message)&&(i=u.content)}return typeof i=="string"?(i=i.replace(/^\s+|\s+$/g,""),u._evalTemplate&&(i=t.template(i)(u.model||{})),r=n(e).append(i),u._wrap||(r=r.contents())):(r=i,u._evalTemplate&&(f=n(t.template(n("<div />").append(r.clone(!0)).html())(u.model||{})),n.contains(document,r[0])&&r.replaceWith(f),r=f),u._wrap&&(r=r.wrapAll(e).parent())),r}}),h=t.Class.extend({init:function(t){n.extend(this,{element:t.element.clone(!0),transition:t.transition,id:t.id});t.element.parent().append(this.element)},hideEnd:function(){this.element.remove()},beforeTransition:n.noop,afterTransition:n.noop}),p=r.extend({init:function(n,t){r.fn.init.call(this,n,t);this.containers={}},container:function(n){var t=this.containers[n];return t||(t=this._createContainer(n),this.containers[n]=t),t},showIn:function(n,t,i){this.container(n).show(t,i)},_createContainer:function(n){var t=this.render(),i=t.find(n),r;if(!i.length&&t.is(n))if(t.is(n))i=t;else throw new Error("can't find a container with the specified "+n+" selector");return r=new c(i),r.bind("accepted",function(n){n.view.render(i)}),r}}),w=r.extend({attach:function(n,t){n.element.find(t).replaceWith(this.render())},detach:function(){}}),b=/^(\w+)(:(\w+))?( (\w+))?$/,c=i.extend({init:function(n){i.fn.init.call(this);this.container=n;this.history=[];this.view=null;this.running=!1},after:function(){this.running=!1;this.trigger("complete",{view:this.view});this.trigger("after")},end:function(){this.view.showEnd();this.previous.hideEnd();this.after()},show:function(n,i,r){if(!n.triggerBeforeShow()||this.view&&!this.view.triggerBeforeHide())return this.trigger("after"),!1;r=r||n.id;var u=this,e=n===u.view?n.clone():u.view,f=u.history,c=f[f.length-2]||{},h=c.id===r,o=i||(h?f[f.length-1].transition:n.transition),s=k(o);return(u.running&&u.effect.stop(),o==="none"&&(o=null),u.trigger("accepted",{view:n}),u.view=n,u.previous=e,u.running=!0,h?f.pop():f.push({id:r,transition:o}),!e)?(n.showStart(),n.showEnd(),u.after(),!0):(o&&t.effects.enabled?(n.element.addClass("k-fx-hidden"),n.showStart(),h&&!i&&(s.reverse=!s.reverse),u.effect=t.fx(n.element).replace(e.element,s.type).beforeTransition(function(){n.beforeTransition("show");e.beforeTransition("hide")}).afterTransition(function(){n.afterTransition("show");e.afterTransition("hide")}).direction(s.direction).setReverse(s.reverse),u.effect.run().then(function(){u.end()})):(n.showStart(),u.end()),!0)}});t.ViewContainer=c;t.Fragment=w;t.Layout=p;t.View=r;t.ViewClone=h})(window.kendo.jQuery)}(),function(){(function(n){function u(){this.node=null}function e(){}function t(n,t,i){this.nodeName=n;this.attr=t||{};this.children=i||[]}function r(n){this.nodeValue=n}function o(n){this.html=n}function a(n,t){for(f.innerHTML=t;f.firstChild;)n.appendChild(f.firstChild)}function s(n){return new o(n)}function h(n,i,r){return new t(n,i,r)}function c(n){return new r(n)}function l(n){this.root=n;this.children=[]}var i,f;u.prototype={remove:function(){this.node.parentNode.removeChild(this.node);this.attr={}},attr:{},text:function(){return""}};e.prototype={nodeName:"#null",attr:{style:{}},children:[],remove:function(){}};i=new e;t.prototype=new u;t.prototype.appendTo=function(n){for(var t=document.createElement(this.nodeName),u=this.children,r=0;r<u.length;r++)u[r].render(t,i);return n.appendChild(t),t};t.prototype.render=function(n,t){var u;if(t.nodeName!==this.nodeName)t.remove(),u=this.appendTo(n);else{u=t.node;var r,o=this.children,f=o.length,e=t.children,s=e.length;if(Math.abs(s-f)>2){this.render({appendChild:function(i){n.replaceChild(i,t.node)}},i);return}for(r=0;r<f;r++)o[r].render(u,e[r]||i);for(r=f;r<s;r++)e[r].remove()}this.node=u;this.syncAttributes(t.attr);this.removeAttributes(t.attr)};t.prototype.syncAttributes=function(n){var u=this.attr,t,i,r;for(t in u)i=u[t],r=n[t],t==="style"?this.setStyle(i,r):i!==r&&this.setAttribute(t,i,r)};t.prototype.setStyle=function(n,t){var r=this.node,i;if(t)for(i in n)n[i]!==t[i]&&(r.style[i]=n[i]);else for(i in n)r.style[i]=n[i]};t.prototype.removeStyle=function(n){var i=this.attr.style||{},r=this.node;for(var t in n)i[t]===undefined&&(r.style[t]="")};t.prototype.removeAttributes=function(n){var i=this.attr;for(var t in n)t==="style"?this.removeStyle(n.style):i[t]===undefined&&this.removeAttribute(t)};t.prototype.removeAttribute=function(n){var t=this.node;n==="style"?t.style.cssText="":n==="className"?t.className="":t.removeAttribute(n)};t.prototype.setAttribute=function(n,t){var i=this.node;i[n]!==undefined?i[n]=t:i.setAttribute(n,t)};t.prototype.text=function(){for(var t="",n=0;n<this.children.length;++n)t+=this.children[n].text();return t};r.prototype=new u;r.prototype.nodeName="#text";r.prototype.render=function(n,t){var i;t.nodeName!==this.nodeName?(t.remove(),i=document.createTextNode(this.nodeValue),n.appendChild(i)):(i=t.node,this.nodeValue!==t.nodeValue&&(i.nodeValue=this.nodeValue));this.node=i};r.prototype.text=function(){return this.nodeValue};o.prototype={nodeName:"#html",attr:{},remove:function(){for(var n=0;n<this.nodes.length;n++)this.nodes[n].parentNode.removeChild(this.nodes[n])},render:function(n,t){var r,i;if(t.nodeName!==this.nodeName||t.html!==this.html)for(t.remove(),r=n.lastChild,a(n,this.html),this.nodes=[],i=r?r.nextSibling:n.firstChild;i;i=i.nextSibling)this.nodes.push(i);else this.nodes=t.nodes.slice(0)}};f=document.createElement("div");l.prototype={html:s,element:h,text:c,render:function(n){for(var r=this.children,t=0,u=n.length;t<u;t++)n[t].render(this.root,r[t]||i);for(t=u;t<r.length;t++)r[t].remove();this.children=n}};n.dom={html:s,text:c,element:h,Tree:l,Node:u}})(window.kendo)}(),function(){(function(n,t){function u(n){var t=Math.floor(n/26)-1;return(t>=0?u(t):"")+String.fromCharCode(65+n%26)}function i(n,t){return u(t)+(n+1)}function e(n,t){return u(t)+"$"+(n+1)}function r(n){var t=n.frozenRows||(n.freezePane||{}).rowSplit||1;return t-1}function k(n){return(n/7*100+.5)/100}function d(n){return n*.75}function s(n){return n.length<6&&(n=n.replace(/(\w)/g,function(n,t){return t+t})),n=n.substring(1).toUpperCase(),n.length<8&&(n="FF"+n),n}var h='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/><\/Relationships>',c=t.template('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><dc:creator>${creator}<\/dc:creator><cp:lastModifiedBy>${lastModifiedBy}<\/cp:lastModifiedBy><dcterms:created xsi:type="dcterms:W3CDTF">${created}<\/dcterms:created><dcterms:modified xsi:type="dcterms:W3CDTF">${modified}<\/dcterms:modified><\/cp:coreProperties>'),l=t.template('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"><Application>Microsoft Excel<\/Application><DocSecurity>0<\/DocSecurity><ScaleCrop>false<\/ScaleCrop><HeadingPairs><vt:vector size="2" baseType="variant"><vt:variant><vt:lpstr>Worksheets<\/vt:lpstr><\/vt:variant><vt:variant><vt:i4>${sheets.length}<\/vt:i4><\/vt:variant><\/vt:vector><\/HeadingPairs><TitlesOfParts><vt:vector size="${sheets.length}" baseType="lpstr"># for (var idx = 0; idx < sheets.length; idx++) { ## if (sheets[idx].options.title) { #<vt:lpstr>${sheets[idx].options.title}<\/vt:lpstr># } else { #<vt:lpstr>Sheet${idx+1}<\/vt:lpstr># } ## } #<\/vt:vector><\/TitlesOfParts><LinksUpToDate>false<\/LinksUpToDate><SharedDoc>false<\/SharedDoc><HyperlinksChanged>false<\/HyperlinksChanged><AppVersion>14.0300<\/AppVersion><\/Properties>'),a=t.template('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" /><Default Extension="xml" ContentType="application/xml" /><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" /><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/><Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"/># for (var idx = 1; idx <= count; idx++) { #<Override PartName="/xl/worksheets/sheet${idx}.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" /># } #<Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml" /><Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml" /><\/Types>'),v=t.template('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><fileVersion appName="xl" lastEdited="5" lowestEdited="5" rupBuild="9303" /><workbookPr defaultThemeVersion="124226" /><bookViews><workbookView xWindow="240" yWindow="45" windowWidth="18195" windowHeight="7995" /><\/bookViews><sheets># for (var idx = 0; idx < sheets.length; idx++) { ## var options = sheets[idx].options; ## var name = options.name || options.title ## if (name) { #<sheet name="${name}" sheetId="${idx+1}" r:id="rId${idx+1}" /># } else { #<sheet name="Sheet${idx+1}" sheetId="${idx+1}" r:id="rId${idx+1}" /># } ## } #<\/sheets># if (definedNames.length) { #<definedNames> # for (var di = 0; di < definedNames.length; di++) { #<definedName name="_xlnm._FilterDatabase" hidden="1" localSheetId="${definedNames[di].localSheetId}">${definedNames[di].name}!$${definedNames[di].from}:$${definedNames[di].to}<\/definedName> # } #<\/definedNames># } #<calcPr calcId="145621" /><\/workbook>'),y=t.template('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" mc:Ignorable="x14ac"><dimension ref="A1" /><sheetViews><sheetView #if(index==0) {# tabSelected="1" #}# workbookViewId="0"># if (frozenRows || frozenColumns) { #<pane state="frozen"# if (frozenColumns) { # xSplit="${frozenColumns}"# } ## if (frozenRows) { # ySplit="${frozenRows}"# } # topLeftCell="${String.fromCharCode(65 + (frozenColumns || 0))}${(frozenRows || 0)+1}"/># } #<\/sheetView><\/sheetViews><sheetFormatPr x14ac:dyDescent="0.25" defaultRowHeight="#= defaults.rowHeight ? defaults.rowHeight * 0.75 : 15 #" # if (defaults.columnWidth) { # defaultColWidth="#= kendo.ooxml.toWidth(defaults.columnWidth) #" # } # /># if (columns && columns.length > 0) { #<cols># for (var ci = 0; ci < columns.length; ci++) { ## var column = columns[ci]; ## var columnIndex = typeof column.index === "number" ? column.index + 1 : (ci + 1); ## if (column.width) { #<col min="${columnIndex}" max="${columnIndex}" customWidth="1"# if (column.autoWidth) { # width="${((column.width*7+5)/7*256)/256}" bestFit="1"# } else { # width="#= kendo.ooxml.toWidth(column.width) #" # } #/># } ## } #<\/cols># } #<sheetData># for (var ri = 0; ri < data.length; ri++) { ## var row = data[ri]; ## var rowIndex = typeof row.index === "number" ? row.index + 1 : (ri + 1); #<row r="${rowIndex}" x14ac:dyDescent="0.25" # if (row.height) { # ht="#= kendo.ooxml.toHeight(row.height) #" customHeight="1" # } # ># for (var ci = 0; ci < row.data.length; ci++) { ## var cell = row.data[ci];#<c r="#=cell.ref#"# if (cell.style) { # s="#=cell.style#" # } ## if (cell.type) { # t="#=cell.type#"# } #># if (cell.formula != null) { #<f>${cell.formula}<\/f># } ## if (cell.value != null) { #<v>${cell.value}<\/v># } #<\/c># } #<\/row># } #<\/sheetData># if (filter) { #<autoFilter ref="${filter.from}:${filter.to}"/># } ## if (mergeCells.length) { #<mergeCells count="${mergeCells.length}"># for (var ci = 0; ci < mergeCells.length; ci++) { #<mergeCell ref="${mergeCells[ci]}"/># } #<\/mergeCells># } #<pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3" /><\/worksheet>'),p=t.template('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"># for (var idx = 1; idx <= count; idx++) { #<Relationship Id="rId${idx}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet${idx}.xml" /># } #<Relationship Id="rId${count+1}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml" /><Relationship Id="rId${count+2}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Target="sharedStrings.xml" /><\/Relationships>'),w=t.template('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="${count}" uniqueCount="${uniqueCount}"># for (var index in indexes) { #<si><t>${index.substring(1)}<\/t><\/si># } #<\/sst>'),b=t.template('<?xml version="1.0" encoding="UTF-8"?><styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"><numFmts count="${formats.length}"># for (var fi = 0; fi < formats.length; fi++) { ## var format = formats[fi]; #<numFmt formatCode="${format.format}" numFmtId="${165+fi}" /># } #<\/numFmts><fonts count="${fonts.length+1}" x14ac:knownFonts="1"><font><sz val="11" /><color theme="1" /><name val="Calibri" /><family val="2" /><scheme val="minor" /><\/font># for (var fi = 0; fi < fonts.length; fi++) { ## var font = fonts[fi]; #<font># if (font.fontSize) { #<sz val="${font.fontSize}" /># } else { #<sz val="11" /># } ## if (font.bold) { #<b/># } ## if (font.italic) { #<i/># } ## if (font.underline) { #<u/># } ## if (font.color) { #<color rgb="${font.color}" /># } else { #<color theme="1" /># } ## if (font.fontFamily) { #<name val="${font.fontFamily}" /><family val="2" /># } else { #<name val="Calibri" /><family val="2" /><scheme val="minor" /># } #<\/font># } #<\/fonts><fills count="${fills.length+1}"><fill><patternFill patternType="none"/><\/fill><fill><patternFill patternType="gray125"/><\/fill># for (var fi = 0; fi < fills.length; fi++) { ## var fill = fills[fi]; ## if (fill.background) { #<fill><patternFill patternType="solid"><fgColor rgb="${fill.background}"/><\/patternFill><\/fill># } ## } #<\/fills><borders count="1"><border><left/><right/><top/><bottom/><diagonal/><\/border><\/borders><cellStyleXfs count="1"><xf borderId="0" fillId="0" fontId="0" /><\/cellStyleXfs><cellXfs count="${styles.length+1}"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/># for (var si = 0; si < styles.length; si++) { ## var style = styles[si]; #<xf xfId="0"# if (style.fontId) { # fontId="${style.fontId}" applyFont="1"# } ## if (style.fillId) { # fillId="${style.fillId}" applyFill="1"# } ## if (style.numFmtId) { # numFmtId="${style.numFmtId}" applyNumberFormat="1"# } ## if (style.textAlign || style.verticalAlign || style.wrap) { # applyAlignment="1"# } #># if (style.textAlign || style.verticalAlign || style.wrap) { #<alignment# if (style.textAlign) { # horizontal="${style.textAlign}"# } ## if (style.verticalAlign) { # vertical="${style.verticalAlign}"# } ## if (style.wrap) { # wrapText="1"# } #/># } #<\/xf># } #<\/cellXfs><dxfs count="0" /><tableStyles count="0" defaultTableStyle="TableStyleMedium2" defaultPivotStyle="PivotStyleMedium9" /><\/styleSheet>'),g=t.timezone.remove(new Date(1900,0,0),"Etc/UTC"),o=t.Class.extend({init:function(n,t,i){this.options=n;this._strings=t;this._styles=i},toXML:function(n){var u,t,e,o,f,s;for(this._mergeCells=this.options.mergedCells||[],this._rowsByIndex=[],u=this.options.rows||[],t=0;t<u.length;t++)e=u[t].index,typeof e!="number"&&(e=t),u[t].index=e,this._rowsByIndex[e]=u[t];for(o=[],t=0;t<u.length;t++)o.push(this._row(u[t],t));return o.sort(function(n,t){return n.index-t.index}),f=this.options.filter,f&&(f={from:i(r(this.options),f.from),to:i(r(this.options),f.to)}),s=this.options.freezePane||{},y({frozenColumns:this.options.frozenColumns||s.colSplit,frozenRows:this.options.frozenRows||s.rowSplit,columns:this.options.columns,defaults:this.options.defaults||{},data:o,index:n,mergeCells:this._mergeCells,filter:f})},_row:function(t){var r=[],i=0,f=this,u={};return n.each(t.cells,function(e,o){var s,h;o&&(typeof o.index=="number"?(s=o.index,i=s-e):s=e+i,o.colSpan&&(i+=o.colSpan-1),h=f._cell(o,t.index,s),n.each(h,function(n,t){u[t.ref]||(u[t.ref]=!0,r.push(t))}))}),{data:r,height:t.height,index:t.index}},_lookupString:function(n){var t="$"+n,i=this._strings.indexes[t];return i!==undefined?n=i:(n=this._strings.indexes[t]=this._strings.uniqueCount,this._strings.uniqueCount++),this._strings.count++,n},_lookupStyle:function(i){var u=t.stringify(i),r;return u=="{}"?0:(r=n.inArray(u,this._styles),r<0&&(r=this._styles.push(u)-1),r+1)},_cell:function(n,r,u){var e,a,y,c,v,o,s;if(!n)return[];var f=n.value,h={bold:n.bold,color:n.color,background:n.background,italic:n.italic,underline:n.underline,fontFamily:n.fontFamily||n.fontName,fontSize:n.fontSize,format:n.format,textAlign:n.textAlign||n.hAlign,verticalAlign:n.verticalAlign||n.vAlign,wrap:n.wrap},p=this.options.columns||[],l=p[u];if(l&&l.autoWidth&&(l.width=Math.max(l.width||0,(""+f).length)),e=typeof f,e==="string"?(f=this._lookupString(f),e="s"):e==="number"?e="n":e==="boolean"?(e="b",f=+f):f&&f.getTime?(e=null,f=(t.timezone.remove(f,"Etc/UTC")-g)/t.date.MS_PER_DAY+1,h.format||(h.format="mm-dd-yy")):(e=null,f=null),h=this._lookupStyle(h),a=[],y=i(r,u),a.push({value:f,formula:n.formula,type:e,style:h,ref:y}),c=n.colSpan||1,v=n.rowSpan||1,c>1||v>1){for(this._mergeCells.push(y+":"+i(r+v-1,u+c-1)),s=r+1;s<r+v;s++)for(this._rowsByIndex[s]||(this._rowsByIndex[s]={index:s,cells:[]}),o=u;o<u+c;o++)this._rowsByIndex[s].cells.splice(o,0,{});for(o=u+1;o<u+c;o++)a.push({ref:i(r,o)})}return a}}),f={General:0,"0":1,"0.00":2,"#,##0":3,"#,##0.00":4,"0%":9,"0.00%":10,"0.00E+00":11,"# ?/?":12,"# ??/??":13,"mm-dd-yy":14,"d-mmm-yy":15,"d-mmm":16,"mmm-yy":17,"h:mm AM/PM":18,"h:mm:ss AM/PM":19,"h:mm":20,"h:mm:ss":21,"m/d/yy h:mm":22,"#,##0 ;(#,##0)":37,"#,##0 ;[Red](#,##0)":38,"#,##0.00;(#,##0.00)":39,"#,##0.00;[Red](#,##0.00)":40,"mm:ss":45,"[h]:mm:ss":46,"mmss.0":47,"##0.0E+0":48,"@":49,"[$-404]e/m/d":27,"m/d/yy":30,t0:59,"t0.00":60,"t#,##0":61,"t#,##0.00":62,"t0%":67,"t0.00%":68,"t# ?/?":69,"t# ??/??":70},nt=t.Class.extend({init:function(t){this.options=t||{};this._strings={indexes:{},count:0,uniqueCount:0};this._styles=[];this._sheets=n.map(this.options.sheets||[],n.proxy(function(n){return n.defaults=this.options,new o(n,this._strings,this._styles)},this))},toDataURL:function(){var i,d,y,g,u,nt,tt,o;if(typeof JSZip=="undefined")throw new Error("JSZip not found. Check http://docs.telerik.com/kendo-ui/framework/excel/introduction#requirements for more details.");for(i=new JSZip,d=i.folder("docProps"),d.file("core.xml",c({creator:this.options.creator||"Kendo UI",lastModifiedBy:this.options.creator||"Kendo UI",created:this.options.date||(new Date).toJSON(),modified:this.options.date||(new Date).toJSON()})),y=this._sheets.length,d.file("app.xml",l({sheets:this._sheets})),g=i.folder("_rels"),g.file(".rels",h),u=i.folder("xl"),nt=u.folder("_rels"),nt.file("workbook.xml.rels",p({count:y})),u.file("workbook.xml",v({sheets:this._sheets,definedNames:n.map(this._sheets,function(n,t){var i=n.options,u=i.filter;if(u&&typeof u.from!="undefined"&&typeof u.to!="undefined")return{localSheetId:t,name:i.name||i.title||"Sheet"+(t+1),from:e(r(i),u.from),to:e(r(i),u.to)}})})),tt=u.folder("worksheets"),o=0;o<y;o++)tt.file(t.format("sheet{0}.xml",o+1),this._sheets[o].toXML(o));var k=n.map(this._styles,n.parseJSON),it=function(n){return n.underline||n.bold||n.italic||n.color||n.fontFamily||n.fontSize},rt=n.map(k,function(n){return n.color&&(n.color=s(n.color)),it(n)?n:void 0}),ut=n.map(k,function(n){if(n.format&&f[n.format]===undefined)return n}),ft=n.map(k,function(n){if(n.background)return n.background=s(n.background),n});return u.file("styles.xml",b({fonts:rt,fills:ft,formats:ut,styles:n.map(k,function(t){var i={};return it(t)&&(i.fontId=n.inArray(t,rt)+1),t.background&&(i.fillId=n.inArray(t,ft)+2),i.textAlign=t.textAlign,i.verticalAlign=t.verticalAlign,i.wrap=t.wrap,t.format&&(i.numFmtId=f[t.format]!==undefined?f[t.format]:165+n.inArray(t,ut)),i})})),u.file("sharedStrings.xml",w(this._strings)),i.file("[Content_Types].xml",a({count:y})),"data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,"+i.generate({compression:"DEFLATE"})}});t.ooxml={Workbook:nt,Worksheet:o,toWidth:k,toHeight:d}})(kendo.jQuery,kendo)}(),function(){(function(n,t){t.ExcelExporter=t.Class.extend({init:function(i){var r,u,f;i.columns=this._trimColumns(i.columns||[]);this.allColumns=n.map(this._leafColumns(i.columns||[]),this._prepareColumn);this.columns=n.grep(this.allColumns,function(n){return!n.hidden});this.options=i;r=i.dataSource;r instanceof t.data.DataSource?(this.dataSource=new r.constructor(n.extend({},r.options,{page:i.allPages?0:r.page(),filter:r.filter(),pageSize:i.allPages?r.total():r.pageSize(),sort:r.sort(),group:r.group(),aggregate:r.aggregate()})),u=r.data(),u.length>0&&(this.dataSource._data=u,f=this.dataSource.transport,r._isServerGrouped()&&f.options.data&&(f.options.data=null))):this.dataSource=t.data.DataSource.create(r)},_trimColumns:function(t){var i=this;return n.grep(t,function(n){var t=!!n.field;return!t&&n.columns&&(t=i._trimColumns(n.columns).length>0),t})},_leafColumns:function(n){for(var i=[],t=0;t<n.length;t++){if(!n[t].columns){i.push(n[t]);continue}i=i.concat(this._leafColumns(n[t].columns))}return i},workbook:function(){return n.Deferred(n.proxy(function(t){this.dataSource.fetch().then(n.proxy(function(){var n={sheets:[{columns:this._columns(),rows:this._rows(),freezePane:this._freezePane(),filter:this._filter()}]};t.resolve(n,this.dataSource.view())},this))},this)).promise()},_prepareColumn:function(i){if(i.field){var u=function(n){return n.get(i.field)},r=null;return i.values&&(r={},n.each(i.values,function(){r[this.value]=this.text}),u=function(n){return r[n.get(i.field)]}),n.extend({},i,{value:u,values:r,groupHeaderTemplate:t.template(i.groupHeaderTemplate||"#= title #: #= value #"),groupFooterTemplate:i.groupFooterTemplate?t.template(i.groupFooterTemplate):null,footerTemplate:i.footerTemplate?t.template(i.footerTemplate):null})}},_filter:function(){if(!this.options.filterable)return null;var n=this._depth();return{from:n,to:n+this.columns.length-1}},_dataRow:function(t,i,r){var f,o,h,s,e;for(this._hierarchical()&&(i=this.dataSource.level(t)+1),f=[],o=0;o<i;o++)f[o]={background:"#dfdfdf",color:"#333"};if(r&&t.items){var u=n.grep(this.allColumns,function(n){return n.field==t.field})[0],c=u&&u.title?u.title:t.field,l=u?u.groupHeaderTemplate:null,a=c+": "+t.value,v=n.extend({title:c,field:t.field,value:u&&u.values?u.values[t.value]:t.value,aggregates:t.aggregates},t.aggregates[t.field]);return l&&(a=l(v)),f.push({value:a,background:"#dfdfdf",color:"#333",colSpan:this.columns.length+r-i}),h=this._dataRows(t.items,i+1),h.unshift({type:"group-header",cells:f}),h.concat(this._footer(t))}for(s=[],e=0;e<this.columns.length;e++)s[e]=this._cell(t,this.columns[e]);return this._hierarchical()&&(s[0].colSpan=r-i+1),[{type:"data",cells:f.concat(s)}]},_dataRows:function(n,t){for(var u=this._depth(),i=[],r=0;r<n.length;r++)i.push.apply(i,this._dataRow(n[r],t,u));return i},_footer:function(t){var i=[],r=!1,u=n.map(this.columns,n.proxy(function(i){return i.groupFooterTemplate?(r=!0,{background:"#dfdfdf",color:"#333",value:i.groupFooterTemplate(n.extend({},this.dataSource.aggregates(),t.aggregates,t.aggregates[i.field]))}):{background:"#dfdfdf",color:"#333"}},this));return r&&i.push({type:"group-footer",cells:n.map(new Array(this.dataSource.group().length),function(){return{background:"#dfdfdf",color:"#333"}}).concat(u)}),i},_isColumnVisible:function(n){return this._visibleColumns([n]).length>0&&(n.field||n.columns)},_visibleColumns:function(t){var i=this;return n.grep(t,function(n){var t=!n.hidden;return t&&n.columns&&(t=i._visibleColumns(n.columns).length>0),t})},_headerRow:function(t,i){var r=n.map(t.cells,function(n){return{background:"#7a7a7a",color:"#fff",value:n.title,colSpan:n.colSpan>1?n.colSpan:1,rowSpan:t.rowSpan>1&&!n.colSpan?t.rowSpan:1}});return this._hierarchical()&&(r[0].colSpan=this._depth()+1),{type:"header",cells:n.map(new Array(i.length),function(){return{background:"#7a7a7a",color:"#fff"}}).concat(r)}},_prependHeaderRows:function(n){var r=this.dataSource.group(),i=[{rowSpan:1,cells:[],index:0}],t;for(this._prepareHeaderRows(i,this.options.columns),t=i.length-1;t>=0;t--)n.unshift(this._headerRow(i[t],r))},_prepareHeaderRows:function(n,t,i,r){for(var e=r||n[n.length-1],o=n[e.index+1],h=0,u,f,s=0;s<t.length;s++)u=t[s],this._isColumnVisible(u)&&(f={title:u.title||u.field,colSpan:0},e.cells.push(f),u.columns&&u.columns.length&&(o||(o={rowSpan:0,cells:[],index:n.length},n.push(o)),f.colSpan=this._trimColumns(this._visibleColumns(u.columns)).length,this._prepareHeaderRows(n,u.columns,f,o),h+=f.colSpan-1,e.rowSpan=n.length-e.index));i&&(i.colSpan+=h)},_rows:function(){var u=this.dataSource.group(),t=this._dataRows(this.dataSource.view(),0),i,r;return this.columns.length&&(this._prependHeaderRows(t),i=!1,r=n.map(this.columns,n.proxy(function(t){if(t.footerTemplate){i=!0;var r=this.dataSource.aggregates();return{background:"#dfdfdf",color:"#333",value:t.footerTemplate(n.extend({},r,r[t.field]))}}return{background:"#dfdfdf",color:"#333"}},this)),i&&t.push({type:"footer",cells:n.map(new Array(u.length),function(){return{background:"#dfdfdf",color:"#333"}}).concat(r)})),t},_headerDepth:function(n){for(var r,i=0,t=0;t<n.length;t++)n[t].columns&&(r=this._headerDepth(n[t].columns),r>i&&(i=r));return 1+i},_freezePane:function(){var t=this._visibleColumns(this.options.columns||[]),i=this._visibleColumns(this._trimColumns(this._leafColumns(n.grep(t,function(n){return n.locked})))).length;return{rowSplit:this._headerDepth(t),colSplit:i?i+this.dataSource.group().length:0}},_cell:function(n,t){return{value:t.value(n)}},_hierarchical:function(){return this.options.hierarchy&&this.dataSource.level},_depth:function(){var i=this.dataSource,n=0,r,t,u;if(this._hierarchical()){for(r=i.view(),t=0;t<r.length;t++)u=i.level(r[t]),u>n&&(n=u);n++}else n=i.group().length;return n},_columns:function(){var t=this._depth(),i=n.map(new Array(t),function(){return{width:20}});return i.concat(n.map(this.columns,function(n){return{width:parseInt(n.width,10),autoWidth:n.width?!1:!0}}))}});t.ExcelMixin={extend:function(t){t.events.push("excelExport");t.options.excel=n.extend(t.options.excel,this.options);t.saveAsExcel=this.saveAsExcel},options:{proxyURL:"",allPages:!1,filterable:!1,fileName:"Export.xlsx"},saveAsExcel:function(){var i=this.options.excel||{},r=new t.ExcelExporter({columns:this.columns,dataSource:this.dataSource,allPages:i.allPages,filterable:i.filterable,hierarchy:i.hierarchy});r.workbook().then(n.proxy(function(n,r){if(!this.trigger("excelExport",{workbook:n,data:r})){var u=new t.ooxml.Workbook(n);t.saveAs({dataURI:u.toDataURL(),fileName:n.fileName||i.fileName,proxyURL:i.proxyURL,forceProxy:i.forceProxy})}},this))}}})(kendo.jQuery,kendo)}(),function(){(function(n){var t=kendo.data.RemoteTransport.extend({init:function(n){var r=n&&n.signalr?n.signalr:{},i=r.promise,t;if(!i)throw new Error('The "promise" option must be set.');if(typeof i.done!="function"||typeof i.fail!="function")throw new Error('The "promise" option must be a Promise.');if(this.promise=i,t=r.hub,!t)throw new Error('The "hub" option must be set.');if(typeof t.on!="function"||typeof t.invoke!="function")throw new Error('The "hub" option is not a valid SignalR hub proxy.');this.hub=t;kendo.data.RemoteTransport.fn.init.call(this,n)},push:function(n){var t=this.options.signalr.client||{};if(t.create)this.hub.on(t.create,n.pushCreate);if(t.update)this.hub.on(t.update,n.pushUpdate);if(t.destroy)this.hub.on(t.destroy,n.pushDestroy)},_crud:function(t,i){var e=this.hub,r=this.options.signalr.server,u,f;if(!r||!r[i])throw new Error(kendo.format('The "server.{0}" option must be set.',i));u=[r[i]];f=this.parameterMap(t.data,i);n.isEmptyObject(f)||u.push(f);this.promise.done(function(){e.invoke.apply(e,u).done(t.success).fail(t.error)})},read:function(n){this._crud(n,"read")},create:function(n){this._crud(n,"create")},update:function(n){this._crud(n,"update")},destroy:function(n){this._crud(n,"destroy")}});n.extend(!0,kendo.data,{transports:{signalr:t}})})(window.kendo.jQuery)}(),function(){(function(n,t,i){function s(n,o){var h,l;if(n==null||n=="none")return null;if(n instanceof c)return n;if(n=n.toLowerCase(),h=e.exec(n))return n=h[1]=="transparent"?new u(1,1,1,0):s(r.namedColors[h[1]],o),n.match=[h[1]],n;if((h=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})\b/i.exec(n))?l=new f(i(h[1],16),i(h[2],16),i(h[3],16),1):(h=/^#?([0-9a-f])([0-9a-f])([0-9a-f])\b/i.exec(n))?l=new f(i(h[1]+h[1],16),i(h[2]+h[2],16),i(h[3]+h[3],16),1):(h=/^rgb\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/.exec(n))?l=new f(i(h[1],10),i(h[2],10),i(h[3],10),1):(h=/^rgba\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9.]+)\s*\)/.exec(n))?l=new f(i(h[1],10),i(h[2],10),i(h[3],10),t(h[4])):(h=/^rgb\(\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*\)/.exec(n))?l=new u(t(h[1])/100,t(h[2])/100,t(h[3])/100,1):(h=/^rgba\(\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9.]+)\s*\)/.exec(n))&&(l=new u(t(h[1])/100,t(h[2])/100,t(h[3])/100,t(h[4]))),l)l.match=h;else if(!o)throw new Error("Cannot parse color: "+n);return l}function h(n,t,i){for(i||(i="0"),n=n.toString(16);t>n.length;)n="0"+n;return n}var r=function(n){var t=this,f=r.formats,o,s,e,i,u;if(arguments.length===1)for(n=t.resolveColor(n),i=0;i<f.length;i++)o=f[i].re,s=f[i].process,e=o.exec(n),e&&(u=s(e),t.r=u[0],t.g=u[1],t.b=u[2]);else t.r=arguments[0],t.g=arguments[1],t.b=arguments[2];t.r=t.normalizeByte(t.r);t.g=t.normalizeByte(t.g);t.b=t.normalizeByte(t.b)},e,o;r.prototype={toHex:function(){var n=this,t=n.padDigit,i=n.r.toString(16),r=n.g.toString(16),u=n.b.toString(16);return"#"+t(i)+t(r)+t(u)},resolveColor:function(n){return n=n||"black",n.charAt(0)=="#"&&(n=n.substr(1,6)),n=n.replace(/ /g,""),n=n.toLowerCase(),r.namedColors[n]||n},normalizeByte:function(n){return n<0||isNaN(n)?0:n>255?255:n},padDigit:function(n){return n.length===1?"0"+n:n},brightness:function(n){var t=this,i=Math.round;return t.r=i(t.normalizeByte(t.r*n)),t.g=i(t.normalizeByte(t.g*n)),t.b=i(t.normalizeByte(t.b*n)),t},percBrightness:function(){var n=this;return Math.sqrt(.241*n.r*n.r+.691*n.g*n.g+.068*n.b*n.b)}};r.formats=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,process:function(n){return[i(n[1],10),i(n[2],10),i(n[3],10)]}},{re:/^(\w{2})(\w{2})(\w{2})$/,process:function(n){return[i(n[1],16),i(n[2],16),i(n[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,process:function(n){return[i(n[1]+n[1],16),i(n[2]+n[2],16),i(n[3]+n[3],16)]}}];r.namedColors={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgrey:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",grey:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"778899",lightslategrey:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};e=["transparent"];for(o in r.namedColors)r.namedColors.hasOwnProperty(o)&&e.push(o);e=new RegExp("^("+e.join("|")+")(\\W|$)","i");var c=kendo.Class.extend({toHSV:function(){return this},toRGB:function(){return this},toHex:function(){return this.toBytes().toHex()},toBytes:function(){return this},toCss:function(){return"#"+this.toHex()},toCssRgba:function(){var n=this.toBytes();return"rgba("+n.r+", "+n.g+", "+n.b+", "+t((+this.a).toFixed(3))+")"},toDisplay:function(){return kendo.support.browser.msie&&kendo.support.browser.version<9?this.toCss():this.toCssRgba()},equals:function(n){return n===this||n!==null&&this.toCssRgba()==s(n).toCssRgba()},diff:function(n){if(n==null)return NaN;var t=this.toBytes();return n=n.toBytes(),Math.sqrt(Math.pow((t.r-n.r)*.3,2)+Math.pow((t.g-n.g)*.59,2)+Math.pow((t.b-n.b)*.11,2))},clone:function(){var n=this.toBytes();return n===this&&(n=new f(n.r,n.g,n.b,n.a)),n}}),u=c.extend({init:function(n,t,i,r){this.r=n;this.g=t;this.b=i;this.a=r},toHSV:function(){var s,n,t,i,e,o,r=this.r,u=this.g,f=this.b;return(s=Math.min(r,u,f),n=Math.max(r,u,f),o=n,t=n-s,t===0)?new l(0,0,o,this.a):(n!==0?(e=t/n,i=r==n?(u-f)/t:u==n?2+(f-r)/t:4+(r-u)/t,i*=60,i<0&&(i+=360)):(e=0,i=-1),new l(i,e,o,this.a))},toBytes:function(){return new f(this.r*255,this.g*255,this.b*255,this.a)}}),f=u.extend({init:function(n,t,i,r){this.r=Math.round(n);this.g=Math.round(t);this.b=Math.round(i);this.a=r},toRGB:function(){return new u(this.r/255,this.g/255,this.b/255,this.a)},toHSV:function(){return this.toRGB().toHSV()},toHex:function(){return h(this.r,2)+h(this.g,2)+h(this.b,2)},toBytes:function(){return this}}),l=c.extend({init:function(n,t,i,r){this.h=n;this.s=t;this.v=i;this.a=r},toRGB:function(){var h=this.h,e=this.s,n=this.v,c,t,i,r,l,f,o,s;if(e===0)t=i=r=n;else{h/=60;c=Math.floor(h);l=h-c;f=n*(1-e);o=n*(1-e*l);s=n*(1-e*(1-l));switch(c){case 0:t=n;i=s;r=f;break;case 1:t=o;i=n;r=f;break;case 2:t=f;i=n;r=s;break;case 3:t=f;i=o;r=n;break;case 4:t=s;i=f;r=n;break;default:t=n;i=f;r=o}}return new u(t,i,r,this.a)},toBytes:function(){return this.toRGB().toBytes()}});r.fromBytes=function(n,t,i,r){return new f(n,t,i,r!=null?r:1)};r.fromRGB=function(n,t,i,r){return new u(n,t,i,r!=null?r:1)};r.fromHSV=function(n,t,i,r){return new l(n,t,i,r!=null?r:1)};kendo.Color=r;kendo.parseColor=s})(window.kendo.jQuery,parseFloat,parseInt)}(),function(){(function(){function i(n){return typeof n!==v}function y(t,i){var r=p(i);return n.round(t*r)/r}function p(t){return t?n.pow(10,t):1}function w(t,i,r){return n.max(n.min(t,r),i)}function b(n){return n*s}function k(n){return n/s}function d(n){return typeof n=="number"&&!isNaN(n)}function g(n,t){return i(n)?n:t}function nt(n){return n*n}function h(n){var t=[];for(var i in n)t.push(i+n[i]);return t.sort().join("")}function c(n){for(var t=2166136261,i=0;i<n.length;++i)t+=(t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24),t^=n.charCodeAt(i);return t>>>0}function tt(n){return c(h(n))}function e(t){for(var o=t.length,f=r,e=u,i=0;i<o;i++)e=n.max(e,t[i]),f=n.min(f,t[i]);return{min:f,max:e}}function it(n){return e(n).min}function rt(n){return e(n).max}function ut(n){return o(n).min}function ft(n){return o(n).max}function o(t){for(var i,f=r,e=u,o=0,s=t.length;o<s;o++)i=t[o],i!==null&&isFinite(i)&&(f=n.min(f,i),e=n.max(e,i));return{min:f===r?undefined:f,max:e===u?undefined:e}}function et(n){if(n)return n[n.length-1]}function ot(n,t){return n.push.apply(n,t),n}function st(n){return t.template(n,{useWithBlock:!1,paramName:"d"})}function l(n,t){return i(t)&&t!==null?" "+n+"='"+t+"' ":""}function ht(n){for(var i="",t=0;t<n.length;t++)i+=l(n[t][0],n[t][1]);return i}function ct(n){for(var u,r="",t=0;t<n.length;t++)u=n[t][1],i(u)&&(r+=n[t][0]+":"+u+";");if(r!=="")return r}function lt(n){return typeof n!="string"&&(n+="px"),n}function at(n){var u=[],r,i;if(n)for(r=t.toHyphens(n).split("-"),i=0;i<r.length;i++)u.push("k-pos-"+r[i]);return u.join(" ")}function vt(n){return n===""||n===null||n==="none"||n==="transparent"||!i(n)}function yt(n){for(var r={1:"i",10:"x",100:"c",2:"ii",20:"xx",200:"cc",3:"iii",30:"xxx",300:"ccc",4:"iv",40:"xl",400:"cd",5:"v",50:"l",500:"d",6:"vi",60:"lx",600:"dc",7:"vii",70:"lxx",700:"dcc",8:"viii",80:"lxxx",800:"dccc",9:"ix",90:"xc",900:"cm",1e3:"m"},t=[1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],i="";n>0;)n<t[0]?t.shift():(i+=r[t[0]],n-=t[0]);return i}function pt(n){var i,t;n=n.toLowerCase();var f={i:1,v:5,x:10,l:50,c:100,d:500,m:1e3},r=0,u=0;for(i=0;i<n.length;++i){if(t=f[n.charAt(i)],!t)return null;r+=t;t>u&&(r-=2*u);u=t}return r}function wt(n){var t=Object.create(null);return function(){for(var i="",r=arguments.length;--r>=0;)i+=":"+arguments[r];return i in t?t[i]:n.apply(this,arguments)}}var n=Math,t=window.kendo,a=t.deepExtend,s=n.PI/180,r=Number.MAX_VALUE,u=-Number.MAX_VALUE,v="undefined",f=Date.now;f||(f=function(){return(new Date).getTime()});a(t,{util:{MAX_NUM:r,MIN_NUM:u,append:ot,arrayLimits:e,arrayMin:it,arrayMax:rt,defined:i,deg:k,hashKey:c,hashObject:tt,isNumber:d,isTransparent:vt,last:et,limitValue:w,now:f,objectKey:h,round:y,rad:b,renderAttr:l,renderAllAttr:ht,renderPos:at,renderSize:lt,renderStyle:ct,renderTemplate:st,sparseArrayLimits:o,sparseArrayMin:ut,sparseArrayMax:ft,sqr:nt,valueOrDefault:g,romanToArabic:pt,arabicToRoman:yt,memoize:wt}});t.drawing.util=t.util;t.dataviz.util=t.util})()}(),function(){(function(n){function h(n,t,r){return i.current.measure(n,t,r)}var e=document,t=window.kendo,u=t.Class,r=t.util,o=r.defined,f=u.extend({init:function(n){this._size=n;this._length=0;this._map={}},put:function(n,t){var i=this,u=i._map,r={key:n,value:t};u[n]=r;i._head?(i._tail.newer=r,r.older=i._tail,i._tail=r):i._head=i._tail=r;i._length>=i._size?(u[i._head.key]=null,i._head=i._head.newer,i._head.older=null):i._length++},get:function(n){var i=this,t=i._map[n];if(t)return t===i._head&&t!==i._tail&&(i._head=t.newer,i._head.older=null),t!==i._tail&&(t.older&&(t.older.newer=t.newer,t.newer.older=t.older),t.older=i._tail,t.newer=null,i._tail.newer=t,i._tail=t),t.value}}),s=n("<div style='position: absolute !important; top: -4000px !important; width: auto !important; height: auto !important;padding: 0 !important; margin: 0 !important; border: 0 !important;line-height: normal !important; visibility: hidden !important; white-space: nowrap!important;' />")[0],i=u.extend({init:function(n){this._cache=new f(1e3);this._initOptions(n)},options:{baselineMarkerSize:1},measure:function(t,i,u){var p=r.objectKey(i),a=r.hashKey(t+p),v=this._cache.get(a),c,l;if(v)return v;var h={width:0,height:0,baseline:0},f=u?u:s,y=this._baselineMarker().cloneNode(!1);for(c in i)l=i[c],o(l)&&(f.style[c]=l);return n(f).text(t),f.appendChild(y),e.body.appendChild(f),(t+"").length&&(h.width=f.offsetWidth-this.options.baselineMarkerSize,h.height=f.offsetHeight,h.baseline=y.offsetTop+this.options.baselineMarkerSize),h.width>0&&h.height>0&&this._cache.put(a,h),f.parentNode.removeChild(f),h},_baselineMarker:function(){return n("<div class='k-baseline-marker' style='display: inline-block; vertical-align: baseline;width: "+this.options.baselineMarkerSize+"px; height: "+this.options.baselineMarkerSize+"px;overflow: hidden;' />")[0]}});i.current=new i;t.util.TextMetrics=i;t.util.LRUCache=f;t.util.measureText=h})(window.kendo.jQuery)}(),function(){(function(){function f(n){var o="",s,i,u,c,l,h,f,e=0;for(n=r(n);e<n.length;)s=n.charCodeAt(e++),i=n.charCodeAt(e++),u=n.charCodeAt(e++),c=s>>2,l=(s&3)<<4|i>>4,h=(i&15)<<2|u>>6,f=u&63,isNaN(i)?h=f=64:isNaN(u)&&(f=64),o=o+t.charAt(c)+t.charAt(l)+t.charAt(h)+t.charAt(f);return o}function r(t){for(var i,r="",u=0;u<t.length;u++)i=t.charCodeAt(u),i<128?r+=n(i):i<2048?(r+=n(192|i>>>6),r+=n(128|i&63)):i<65536&&(r+=n(224|i>>>12),r+=n(128|i>>>6&63),r+=n(128|i&63));return r}var i=window.kendo,u=i.deepExtend,n=String.fromCharCode,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";u(i.util,{encodeBase64:f,encodeUTF8:r})})()}(),function(){(function(n){var i=Math,t=window.kendo,r=t.deepExtend,u=n.inArray,f={observers:function(){return this._observers=this._observers||[],this._observers},addObserver:function(n){return this._observers?this._observers.push(n):this._observers=[n],this},removeObserver:function(n){var t=this.observers(),i=u(n,t);return i!=-1&&t.splice(i,1),this},trigger:function(n,t){var r=this._observers,u,i;if(r&&!this._suspended)for(i=0;i<r.length;i++)u=r[i],u[n]&&u[n](t);return this},optionsChange:function(n){this.trigger("optionsChange",n)},geometryChange:function(n){this.trigger("geometryChange",n)},suspend:function(){return this._suspended=(this._suspended||0)+1,this},resume:function(){return this._suspended=i.max((this._suspended||0)-1,0),this},_observerField:function(n,t){this[n]&&this[n].removeObserver(this);this[n]=t;t.addObserver(this)}};r(t,{mixins:{ObserversMixin:f}})})(window.kendo.jQuery)}(),function(){(function(n){function ut(n){return n===null?null:n instanceof w?n:new w(n)}function nt(n){return n&&h.isFunction(n.matrix)?n.matrix():n}function ft(n,t,r,u){var f=0,e=0;return u&&(f=i.atan2(u.c*r,u.a*t),u.b!==0&&(e=i.atan2(u.d*r,u.b*t))),{x:f,y:e}}function et(n,t){while(n<t)n+=90;return n}function k(n,t){for(var i,u,r=0;r<t.length;r++)i=t[r],u=i.charAt(0).toUpperCase()+i.substring(1,i.length),n["set"+u]=ot(i),n["get"+u]=st(i)}function ot(n){return function(t){return this[n]!==t&&(this[n]=t,this.geometryChange()),this}}function st(n){return function(){return this[n]}}function ht(n,t,r){n>t&&(t+=360);var u=i.abs(t-n);return r||(u=360-u),u}function d(n,t,r,f,e,o){var s=u((e-n)/r,3),h=u((o-t)/f,3);return u(g(i.atan2(h,s)))}function ct(n,r,u,f,e,s,h,c){var l,a,b,tt,k,v,g,y;if(r!==f){var et=u-n,it=f-r,p=o(e,2),w=o(s,2),rt=(w*et*(n+u)+p*it*(r+f))/(2*p*it),ot=rt-f,nt=-(et*w)/(p*it);k=1/p+o(nt,2)/w;v=2*(nt*ot/w-u/p);g=o(u,2)/p+o(ot,2)/w-1;y=i.sqrt(o(v,2)-4*k*g);l=(-v-y)/(2*k);a=rt+nt*l;b=(-v+y)/(2*k);tt=rt+nt*b}else if(n!==u)v=-2*f,g=o((u-n)*s/(2*e),2)+o(f,2)-o(s,2),y=i.sqrt(o(v,2)-4*g),l=b=(n+u)/2,a=(-v-y)/2,tt=(-v+y)/2;else return!1;var ut=d(l,a,e,s,n,r),ft=d(l,a,e,s,u,f),st=ht(ut,ft,c);return(h&&st<=180||!h&&st>180)&&(l=b,a=tt,ut=d(l,a,e,s,n,r),ft=d(l,a,e,s,u,f)),{center:new t(l,a),startAngle:ut,endAngle:ft}}var i=Math,o=i.pow,lt=n.inArray,h=window.kendo,l=h.Class,a=h.deepExtend,p=h.mixins.ObserversMixin,s=h.util,c=s.defined,v=s.rad,g=s.deg,u=s.round,tt=i.PI/2,it=s.MIN_NUM,rt=s.MAX_NUM,t=l.extend({init:function(n,t){this.x=n||0;this.y=t||0},equals:function(n){return n&&n.x===this.x&&n.y===this.y},clone:function(){return new t(this.x,this.y)},rotate:function(n,t){return this.transform(ut().rotate(n,t))},translate:function(n,t){return this.x+=n,this.y+=t,this.geometryChange(),this},translateWith:function(n){return this.translate(n.x,n.y)},move:function(n,t){return this.x=this.y=0,this.translate(n,t)},scale:function(n,t){return c(t)||(t=n),this.x*=n,this.y*=t,this.geometryChange(),this},scaleCopy:function(n,t){return this.clone().scale(n,t)},transform:function(n){var t=nt(n),i=this.x,r=this.y;return this.x=t.a*i+t.c*r+t.e,this.y=t.b*i+t.d*r+t.f,this.geometryChange(),this},transformCopy:function(n){var t=this.clone();return n&&t.transform(n),t},distanceTo:function(n){var t=this.x-n.x,r=this.y-n.y;return i.sqrt(t*t+r*r)},round:function(n){return this.x=u(this.x,n),this.y=u(this.y,n),this.geometryChange(),this},toArray:function(n){var t=c(n),i=t?u(this.x,n):this.x,r=t?u(this.y,n):this.y;return[i,r]}}),f,e,b,y,r,w;k(t.fn,["x","y"]);a(t.fn,p);t.fn.toString=function(n,t){var i=this.x,r=this.y;return c(n)&&(i=u(i,n),r=u(r,n)),t=t||" ",i+t+r};t.create=function(n,i){if(c(n))return n instanceof t?n:arguments.length===1&&n.length===2?new t(n[0],n[1]):new t(n,i)};t.min=function(){for(var f,n=s.MAX_NUM,r=s.MAX_NUM,u=0;u<arguments.length;u++)f=arguments[u],n=i.min(f.x,n),r=i.min(f.y,r);return new t(n,r)};t.max=function(){for(var f,n=s.MIN_NUM,r=s.MIN_NUM,u=0;u<arguments.length;u++)f=arguments[u],n=i.max(f.x,n),r=i.max(f.y,r);return new t(n,r)};t.minPoint=function(){return new t(it,it)};t.maxPoint=function(){return new t(rt,rt)};t.ZERO=new t(0,0);f=l.extend({init:function(n,t){this.width=n||0;this.height=t||0},equals:function(n){return n&&n.width===this.width&&n.height===this.height},clone:function(){return new f(this.width,this.height)},toArray:function(n){var t=c(n),i=t?u(this.width,n):this.width,r=t?u(this.height,n):this.height;return[i,r]}});k(f.fn,["width","height"]);a(f.fn,p);f.create=function(n,t){if(c(n))return n instanceof f?n:arguments.length===1&&n.length===2?new f(n[0],n[1]):new f(n,t)};f.ZERO=new f(0,0);e=l.extend({init:function(n,i){this.setOrigin(n||new t);this.setSize(i||new f)},clone:function(){return new e(this.origin.clone(),this.size.clone())},equals:function(n){return n&&n.origin.equals(this.origin)&&n.size.equals(this.size)},setOrigin:function(n){return this._observerField("origin",t.create(n)),this.geometryChange(),this},getOrigin:function(){return this.origin},setSize:function(n){return this._observerField("size",f.create(n)),this.geometryChange(),this},getSize:function(){return this.size},width:function(){return this.size.width},height:function(){return this.size.height},topLeft:function(){return this.origin.clone()},bottomRight:function(){return this.origin.clone().translate(this.width(),this.height())},topRight:function(){return this.origin.clone().translate(this.width(),0)},bottomLeft:function(){return this.origin.clone().translate(0,this.height())},center:function(){return this.origin.clone().translate(this.width()/2,this.height()/2)},bbox:function(n){var t=this.topLeft().transformCopy(n),i=this.topRight().transformCopy(n),r=this.bottomRight().transformCopy(n),u=this.bottomLeft().transformCopy(n);return e.fromPoints(t,i,r,u)},transformCopy:function(n){return e.fromPoints(this.topLeft().transform(n),this.bottomRight().transform(n))}});a(e.fn,p);e.fromPoints=function(){var n=t.min.apply(this,arguments),i=t.max.apply(this,arguments),r=new f(i.x-n.x,i.y-n.y);return new e(n,r)};e.union=function(n,i){return e.fromPoints(t.min(n.topLeft(),i.topLeft()),t.max(n.bottomRight(),i.bottomRight()))};e.intersect=function(n,r){return n={left:n.topLeft().x,top:n.topLeft().y,right:n.bottomRight().x,bottom:n.bottomRight().y},r={left:r.topLeft().x,top:r.topLeft().y,right:r.bottomRight().x,bottom:r.bottomRight().y},n.left<=r.right&&r.left<=n.right&&n.top<=r.bottom&&r.top<=n.bottom?e.fromPoints(new t(i.max(n.left,r.left),i.max(n.top,r.top)),new t(i.min(n.right,r.right),i.min(n.bottom,r.bottom))):void 0};b=l.extend({init:function(n,i){this.setCenter(n||new t);this.setRadius(i||0)},setCenter:function(n){return this._observerField("center",t.create(n)),this.geometryChange(),this},getCenter:function(){return this.center},equals:function(n){return n&&n.center.equals(this.center)&&n.radius===this.radius},clone:function(){return new b(this.center.clone(),this.radius)},pointAt:function(n){return this._pointAt(v(n))},bbox:function(n){for(var r=t.maxPoint(),u=t.minPoint(),f=ft(this.center,this.radius,this.radius,n),i=0;i<4;i++){var s=this._pointAt(f.x+i*tt).transformCopy(n),h=this._pointAt(f.y+i*tt).transformCopy(n),o=new t(s.x,h.y);r=t.min(r,o);u=t.max(u,o)}return e.fromPoints(r,u)},_pointAt:function(n){var r=this.center,u=this.radius;return new t(r.x-u*i.cos(n),r.y-u*i.sin(n))}});k(b.fn,["radius"]);a(b.fn,p);y=l.extend({init:function(n,i){this.setCenter(n||new t);i=i||{};this.radiusX=i.radiusX;this.radiusY=i.radiusY||i.radiusX;this.startAngle=i.startAngle;this.endAngle=i.endAngle;this.anticlockwise=i.anticlockwise||!1},clone:function(){return new y(this.center,{radiusX:this.radiusX,radiusY:this.radiusY,startAngle:this.startAngle,endAngle:this.endAngle,anticlockwise:this.anticlockwise})},setCenter:function(n){return this._observerField("center",t.create(n)),this.geometryChange(),this},getCenter:function(){return this.center},MAX_INTERVAL:45,pointAt:function(n){var r=this.center,u=v(n);return new t(r.x+this.radiusX*i.cos(u),r.y+this.radiusY*i.sin(u))},curvePoints:function(){for(var r,n,u=this.startAngle,a=this.endAngle,c=this.anticlockwise?-1:1,f=[this.pointAt(u)],t=u,e=this._arcInterval(),o=e.endAngle-e.startAngle,s=i.ceil(o/this.MAX_INTERVAL),l=o/s,h=1;h<=s;h++)r=t+c*l,n=this._intervalCurvePoints(t,r),f.push(n.cp1,n.cp2,n.p2),t=r;return f},bbox:function(n){for(var i=this,l=i._arcInterval(),s=l.startAngle,r=l.endAngle,a=ft(this.center,this.radiusX,this.radiusY,n),w=g(a.x),b=g(a.y),u=i.pointAt(s).transformCopy(n),v=i.pointAt(r).transformCopy(n),h=t.min(u,v),c=t.max(u,v),f=et(w,s),o=et(b,s),y,p;f<r||o<r;)f<r&&(y=i.pointAt(f).transformCopy(n),f+=90),o<r&&(p=i.pointAt(o).transformCopy(n),o+=90),u=new t(y.x,p.y),h=t.min(h,u),c=t.max(c,u);return e.fromPoints(h,c)},_arcInterval:function(){var t=this.startAngle,n=this.endAngle,i=this.anticlockwise,r;return i&&(r=t,t=n,n=r),(t>n||i&&t===n)&&(n+=360),{startAngle:t,endAngle:n}},_intervalCurvePoints:function(n,i){var r=this,f=r.pointAt(n),e=r.pointAt(i),o=r._derivativeAt(n),s=r._derivativeAt(i),u=(v(i)-v(n))/3,h=new t(f.x+u*o.x,f.y+u*o.y),c=new t(e.x-u*s.x,e.y-u*s.y);return{p1:f,cp1:h,cp2:c,p2:e}},_derivativeAt:function(n){var r=this,u=v(n);return new t(-r.radiusX*i.sin(u),r.radiusY*i.cos(u))}});k(y.fn,["radiusX","radiusY","startAngle","endAngle","anticlockwise"]);a(y.fn,p);y.fromPoints=function(n,t,i,r,u,f){var e=ct(n.x,n.y,t.x,t.y,i,r,u,f);return new y(e.center,{startAngle:e.startAngle,endAngle:e.endAngle,radiusX:i,radiusY:r,anticlockwise:f===0})};r=l.extend({init:function(n,t,i,r,u,f){this.a=n||0;this.b=t||0;this.c=i||0;this.d=r||0;this.e=u||0;this.f=f||0},multiplyCopy:function(n){return new r(this.a*n.a+this.c*n.b,this.b*n.a+this.d*n.b,this.a*n.c+this.c*n.d,this.b*n.c+this.d*n.d,this.a*n.e+this.c*n.f+this.e,this.b*n.e+this.d*n.f+this.f)},invert:function(){var t=this.a,i=this.b,u=this.c,f=this.d,e=this.e,o=this.f,n=t*f-i*u;return n===0?null:new r(f/n,-i/n,-u/n,t/n,(u*o-f*e)/n,(i*e-t*o)/n)},clone:function(){return new r(this.a,this.b,this.c,this.d,this.e,this.f)},equals:function(n){return n?this.a===n.a&&this.b===n.b&&this.c===n.c&&this.d===n.d&&this.e===n.e&&this.f===n.f:!1},round:function(n){return this.a=u(this.a,n),this.b=u(this.b,n),this.c=u(this.c,n),this.d=u(this.d,n),this.e=u(this.e,n),this.f=u(this.f,n),this},toArray:function(n){var i=[this.a,this.b,this.c,this.d,this.e,this.f],t;if(c(n))for(t=0;t<i.length;t++)i[t]=u(i[t],n);return i}});r.fn.toString=function(n,t){return this.toArray(n).join(t||",")};r.translate=function(n,t){return new r(1,0,0,1,n,t)};r.unit=function(){return new r(1,0,0,1,0,0)};r.rotate=function(n,t,u){var f=new r;return f.a=i.cos(v(n)),f.b=i.sin(v(n)),f.c=-f.b,f.d=f.a,f.e=t-t*f.a+u*f.b||0,f.f=u-u*f.a-t*f.b||0,f};r.scale=function(n,t){return new r(n,0,0,t,0,0)};r.IDENTITY=r.unit();w=l.extend({init:function(n){this._matrix=n||r.unit()},clone:function(){return new w(this._matrix.clone())},equals:function(n){return n&&n._matrix.equals(this._matrix)},_optionsChange:function(){this.optionsChange({field:"transform",value:this})},translate:function(n,t){return this._matrix=this._matrix.multiplyCopy(r.translate(n,t)),this._optionsChange(),this},scale:function(n,i,u){return c(i)||(i=n),u&&(u=t.create(u),this._matrix=this._matrix.multiplyCopy(r.translate(u.x,u.y))),this._matrix=this._matrix.multiplyCopy(r.scale(n,i)),u&&(this._matrix=this._matrix.multiplyCopy(r.translate(-u.x,-u.y))),this._optionsChange(),this},rotate:function(n,i){return i=t.create(i)||t.ZERO,this._matrix=this._matrix.multiplyCopy(r.rotate(n,i.x,i.y)),this._optionsChange(),this},multiply:function(n){var t=nt(n);return this._matrix=this._matrix.multiplyCopy(t),this._optionsChange(),this},matrix:function(){return this._matrix}});a(w.fn,p);a(h,{geometry:{Arc:y,Circle:b,Matrix:r,Point:t,Rect:e,Size:f,Transformation:w,transform:ut,toMatrix:nt}});h.dataviz.geometry=h.geometry})(window.kendo.jQuery)}(),function(){(function(n){var s=n.noop,c=Object.prototype.toString,t=window.kendo,u=t.Class,f=t.ui.Widget,e=t.deepExtend,l=t.util,a=l.defined,o=f.extend({init:function(n,i){this.options=e({},this.options,i);f.fn.init.call(this,n,this.options);this._click=this._handler("click");this._mouseenter=this._handler("mouseenter");this._mouseleave=this._handler("mouseleave");this._visual=new t.drawing.Group;this.options.width&&this.element.css("width",this.options.width);this.options.height&&this.element.css("height",this.options.height)},options:{name:"Surface"},events:["click","mouseenter","mouseleave","resize"],draw:function(n){this._visual.children.push(n)},clear:function(){this._visual.children=[]},destroy:function(){this._visual=null;f.fn.destroy.call(this)},exportVisual:function(){return this._visual},getSize:function(){return{width:this.element.width(),height:this.element.height()}},setSize:function(n){this.element.css({width:n.width,height:n.height});this._size=n;this._resize()},eventTarget:function(t){for(var i=n(t.touch?t.touch.initialTouch:t.target),r;!r&&i.length>0;){if(r=i[0]._kendoNode,i.is(this.element)||i.length===0)break;i=i.parent()}if(r)return r.srcElement},_resize:s,_handler:function(n){var t=this;return function(i){var r=t.eventTarget(i);r&&t.trigger(n,{element:r,originalEvent:i})}}}),h,i,r;t.ui.plugin(o);o.create=function(n,t){return r.current.create(n,t)};h=u.extend({init:function(n){this.childNodes=[];this.parent=null;n&&(this.srcElement=n,this.observe())},destroy:function(){var t,n;for(this.srcElement&&this.srcElement.removeObserver(this),t=this.childNodes,n=0;n<t.length;n++)this.childNodes[n].destroy();this.parent=null},load:s,observe:function(){this.srcElement&&this.srcElement.addObserver(this)},append:function(n){this.childNodes.push(n);n.parent=this},insertAt:function(n,t){this.childNodes.splice(t,0,n);n.parent=this},remove:function(n,t){for(var r=n+t,i=n;i<r;i++)this.childNodes[i].removeSelf();this.childNodes.splice(n,t)},removeSelf:function(){this.clear();this.destroy()},clear:function(){this.remove(0,this.childNodes.length)},invalidate:function(){this.parent&&this.parent.invalidate()},geometryChange:function(){this.invalidate()},optionsChange:function(){this.invalidate()},childrenChange:function(n){n.action==="add"?this.load(n.items,n.index):n.action==="remove"&&this.remove(n.index,n.items.length);this.invalidate()}});i=u.extend({init:function(n,t){var i,r;this.prefix=t||"";for(i in n)r=n[i],r=this._wrap(r,i),this[i]=r},get:function(n){return t.getter(n,!0)(this)},set:function(n,i){var u=t.getter(n,!0)(this),r;u!==i&&(r=this._set(n,this._wrap(i,n)),r||this.optionsChange({field:this.prefix+n,value:i}))},_set:function(n,r){var o=n.indexOf(".")>=0,e,f,u;if(o)for(e=n.split("."),f="";e.length>1;){if(f+=e.shift(),u=t.getter(f,!0)(this),u||(u=new i({},f+"."),u.addObserver(this),this[f]=u),u instanceof i)return u.set(e.join("."),r),o;f+="."}return this._clear(n),t.setter(n)(this,r),o},_clear:function(n){var i=t.getter(n,!0)(this);i&&i.removeObserver&&i.removeObserver(this)},_wrap:function(n,t){var r=c.call(n);return n!==null&&a(n)&&r==="[object Object]"&&(n instanceof i||n instanceof u||(n=new i(n,this.prefix+t+".")),n.addObserver(this)),n}});e(i.fn,t.mixins.ObserversMixin);r=function(){this._items=[]};r.prototype={register:function(n,t,i){var r=this._items,u=r[0],f={name:n,type:t,order:i};!u||i<u.order?r.unshift(f):r.push(f)},create:function(n,i){var u=this._items,f=u[0],e,r;if(i&&i.type)for(e=i.type.toLowerCase(),r=0;r<u.length;r++)if(u[r].name===e){f=u[r];break}if(f)return new f.type(n,i);t.logToConsole("Warning: Unable to create Kendo UI Drawing Surface. Possible causes:\n- The browser does not support SVG, VML and Canvas. User agent: "+navigator.userAgent+"\n- The Kendo UI scripts are not fully loaded")}};r.current=new r;e(t,{drawing:{DASH_ARRAYS:{dot:[1.5,3.5],dash:[4,3.5],longdash:[8,3.5],dashdot:[3.5,3.5,1.5,3.5],longdashdot:[8,3.5,1.5,3.5],longdashdotdot:[8,3.5,1.5,3.5,1.5,3.5]},Color:t.Color,BaseNode:h,OptionsStore:i,Surface:o,SurfaceFactory:r}});t.dataviz.drawing=t.drawing})(window.kendo.jQuery)}(),function(){(function(){var t=window.kendo,i=t.deepExtend,n=t.util.defined,r="gradient",u={extend:function(n){n.fill=this.fill;n.stroke=this.stroke},fill:function(t,i){var u=this.options,f;return n(t)?(t&&t.nodeType!=r?(f={color:t},n(i)&&(f.opacity=i),u.set("fill",f)):u.set("fill",t),this):u.get("fill")},stroke:function(t,i,r){return n(t)?(this.options.set("stroke.color",t),n(i)&&this.options.set("stroke.width",i),n(r)&&this.options.set("stroke.opacity",r),this):this.options.get("stroke")}},f={extend:function(n,t){n.traverse=function(n){for(var i,u=this[t],r=0;r<u.length;r++)i=u[r],i.traverse?i.traverse(n):n(i);return this}}};i(t.drawing,{mixins:{Paintable:u,Traversable:f}})})()}(),function(){(function(n){function et(n,i,r){for(var f,e,u,o=0;o<n.length;o++)f=n[o],f.visible()&&(e=i?f.bbox(r):f.rawBBox(),e&&(u=u?t.Rect.union(u,e):e));return u}function ri(n,i){for(var e,u,r,f=0;f<n.length;f++)e=n[f],e.visible()&&(u=e.clippedBBox(i),u&&(r=r?t.Rect.union(r,u):u));return r}function ot(n,t){n.origin.x-=t;n.origin.y-=t;n.size.width+=t*2;n.size.height+=t*2}function st(n,t){for(var i=0;i<t.length;i++)n[t[i]]=di(t[i])}function di(n){var t="_"+n;return function(n){return i(n)?(this._observerField(t,n),this.geometryChange(),this):this[t]}}function ht(n,t){for(var i=0;i<t.length;i++)n[t[i]]=gi(t[i])}function gi(n){var t="_"+n;return function(n){return i(n)?(this._observerField(t,u.create(n)),this.geometryChange(),this):this[t]}}function nr(n,t){for(var i=0;i<t.length;i++)n[t[i]]=tr(t[i])}function tr(n){return function(t){return i(t)?(this.options.set(n,t),this):this.options.get(n)}}function wt(){return"kdef"+bi++}function ir(n,t,i){ei(n,t,i,"x","width")}function rr(n,t,i){ei(n,t,i,"y","height")}function ur(n){bt(fi(n),"x","y","width")}function fr(n){bt(fi(n),"y","x","height")}function er(n,t){return ui(n,t,"x","y","width")}function or(n,t){return ui(n,t,"y","x","height")}function ui(n,t,i,r,u){for(var h=[],l=hr(n,t,u),c=t.origin.clone(),f,s,e,o=0;o<l.length;o++)for(e=l[o],f=e[0],c[r]=f.bbox.origin[r],ct(c,f.bbox,f.element),f.bbox.origin[i]=c[i],bt(e,i,r,u),h.push([]),s=0;s<e.length;s++)h[o].push(e[s].element);return h}function sr(n,i){var o=n.clippedBBox(),r=o.size,u=i.size,f,e;(u.width<r.width||u.height<r.height)&&(f=s.min(u.width/r.width,u.height/r.height),e=n.transform()||t.transform(),e.scale(f,f),n.transform(e))}function hr(n,t,i){for(var l=t.size[i],u=0,f=[],r=[],s,e,o,h=function(){r.push({element:s,bbox:o})},c=0;c<n.length;c++)s=n[c],o=s.clippedBBox(),o&&(e=o.size[i],u+e>l?r.length?(f.push(r),r=[],h(),u=e):(h(),f.push(r),r=[],u=0):(h(),u+=e));return r.length&&f.push(r),f}function fi(n){for(var u=[],t,i,r=0;r<n.length;r++)t=n[r],i=t.clippedBBox(),i&&u.push({element:t,bbox:i});return u}function bt(n,t,i,r){var s,f,h,e,o;if(n.length>1)for(s=n[0].bbox,f=new u,o=1;o<n.length;o++)h=n[o].element,e=n[o].bbox,f[t]=s.origin[t]+s.size[r],f[i]=e.origin[i],ct(f,e,h),e.origin[t]=f[t],s=e}function ei(n,t,i,r,u){var f,o,e;for(i=i||"start",e=0;e<n.length;e++)f=n[e].clippedBBox(),f&&(o=f.origin.clone(),o[r]=g(f.size[u],t,i,r,u),ct(o,f,n[e]))}function g(n,t,i,r,u){return i==tt?t.origin[r]:i==ki?t.origin[r]+t.size[u]-n:t.origin[r]+(t.size[u]-n)/2}function cr(n,i,r){var u=r.transform()||t.transform(),f=u.matrix();f.e+=n;f.f+=i;r.transform(u)}function ct(n,t,i){cr(n.x-t.origin.x,n.y-t.origin.y,i)}var l=window.kendo,w=l.Class,y=l.deepExtend,t=l.geometry,u=t.Point,oi=t.Size,si=t.Matrix,h=t.toMatrix,o=l.drawing,kt=o.OptionsStore,s=Math,nt=s.pow,a=l.util,hi=a.append,dt=a.arrayLimits,i=a.defined,c=a.last,ci=a.valueOrDefault,b=l.mixins.ObserversMixin,li=n.inArray,ai=[].push,vi=[].pop,yi=[].splice,pi=[].shift,gt=[].slice,wi=[].unshift,bi=1,tt="start",ki="end",ni="horizontal",r=w.extend({nodeType:"Element",init:function(n){this._initOptions(n)},_initOptions:function(n){n=n||{};var r=n.transform,i=n.clip;r&&(n.transform=t.transform(r));i&&!i.id&&(i.id=wt());this.options=new kt(n);this.options.addObserver(this)},transform:function(n){if(i(n))this.options.set("transform",t.transform(n));else return this.options.get("transform")},parentTransform:function(){for(var n=this,r,i;n.parent;)n=n.parent,r=n.transform(),r&&(i=r.matrix().multiplyCopy(i||si.unit()));if(i)return t.transform(i)},currentTransform:function(n){var e=this.transform(),u=h(e),r,f;return i(n)||(n=this.parentTransform()),r=h(n),f=u&&r?r.multiplyCopy(u):u||r,f?t.transform(f):void 0},visible:function(n){return i(n)?(this.options.set("visible",n),this):this.options.get("visible")!==!1},clip:function(n){var t=this.options;return i(n)?(n&&!n.id&&(n.id=wt()),t.set("clip",n),this):t.get("clip")},opacity:function(n){return i(n)?(this.options.set("opacity",n),this):ci(this.options.get("opacity"),1)},clippedBBox:function(n){var i=this._clippedBBox(n),r;if(i)return r=this.clip(),r?t.Rect.intersect(i,r.bbox(n)):i},_clippedBBox:function(n){return this.bbox(n)}}),k,d,it,rt,ut,lt,p,f,at,vt,e,ti,v,yt,pt,ft,ii;y(r.fn,b);k=w.extend({init:function(n){n=n||[];this.length=0;this._splice(0,n.length,n)},elements:function(n){return n?(this._splice(0,this.length,n),this._change(),this):this.slice(0)},push:function(){var n=arguments,t=ai.apply(this,n);return this._add(n),t},slice:gt,pop:function(){var t=this.length,n=vi.apply(this);return t&&this._remove([n]),n},splice:function(n,t){var i=gt.call(arguments,2),r=this._splice(n,t,i);return this._change(),r},shift:function(){var t=this.length,n=pi.apply(this);return t&&this._remove([n]),n},unshift:function(){var n=arguments,t=wi.apply(this,n);return this._add(n),t},indexOf:function(n){for(var i=this,t=0,r=i.length;t<r;t++)if(i[t]===n)return t;return-1},_splice:function(n,t,i){var r=yi.apply(this,[n,t].concat(i));return this._clearObserver(r),this._setObserver(i),r},_add:function(n){this._setObserver(n);this._change()},_remove:function(n){this._clearObserver(n);this._change()},_setObserver:function(n){for(var t=0;t<n.length;t++)n[t].addObserver(this)},_clearObserver:function(n){for(var t=0;t<n.length;t++)n[t].removeObserver(this)},_change:function(){}});y(k.fn,b);d=r.extend({nodeType:"Group",init:function(n){r.fn.init.call(this,n);this.children=[]},childrenChange:function(n,t,i){this.trigger("childrenChange",{action:n,items:t,index:i})},append:function(){return hi(this.children,arguments),this._reparent(arguments,this),this.childrenChange("add",arguments),this},insert:function(n,t){return this.children.splice(n,0,t),t.parent=this,this.childrenChange("add",[t],n),this},insertAt:function(n,t){return this.insert(t,n)},remove:function(n){var t=li(n,this.children);return t>=0&&(this.children.splice(t,1),n.parent=null,this.childrenChange("remove",[n],t)),this},removeAt:function(n){if(0<=n&&n<this.children.length){var t=this.children[n];this.children.splice(n,1);t.parent=null;this.childrenChange("remove",[t],n)}return this},clear:function(){var n=this.children;return this.children=[],this._reparent(n,null),this.childrenChange("remove",n,0),this},bbox:function(n){return et(this.children,!0,this.currentTransform(n))},rawBBox:function(){return et(this.children,!1)},_clippedBBox:function(n){return ri(this.children,this.currentTransform(n))},currentTransform:function(n){return r.fn.currentTransform.call(this,n)||null},_reparent:function(n,t){for(var u,i,r=0;r<n.length;r++)u=n[r],i=u.parent,i&&i!=this&&i.remove&&i.remove(u),u.parent=t}});o.mixins.Traversable.extend(d.fn,"children");it=r.extend({nodeType:"Text",init:function(n,u,f){r.fn.init.call(this,f);this.content(n);this.position(u||new t.Point);this.options.font||(this.options.font="12px sans-serif");i(this.options.fill)||this.fill("#000")},content:function(n){return i(n)?(this.options.set("content",n),this):this.options.get("content")},measure:function(){return a.measureText(this.content(),{font:this.options.get("font")})},rect:function(){var n=this.measure(),i=this.position().clone();return new t.Rect(i,[n.width,n.height])},bbox:function(n){var t=h(this.currentTransform(n));return this.rect().bbox(t)},rawBBox:function(){return this.rect().bbox()}});o.mixins.Paintable.extend(it.fn);ht(it.fn,["position"]);rt=r.extend({nodeType:"Circle",init:function(n,u){r.fn.init.call(this,u);this.geometry(n||new t.Circle);i(this.options.stroke)||this.stroke("#000")},bbox:function(n){var r=h(this.currentTransform(n)),t=this._geometry.bbox(r),i=this.options.get("stroke.width");return i&&ot(t,i/2),t},rawBBox:function(){return this._geometry.bbox()}});o.mixins.Paintable.extend(rt.fn);st(rt.fn,["geometry"]);ut=r.extend({nodeType:"Arc",init:function(n,u){r.fn.init.call(this,u);this.geometry(n||new t.Arc);i(this.options.stroke)||this.stroke("#000")},bbox:function(n){var r=h(this.currentTransform(n)),t=this.geometry().bbox(r),i=this.options.get("stroke.width");return i&&ot(t,i/2),t},rawBBox:function(){return this.geometry().bbox()},toPath:function(){var i=new f,n=this.geometry().curvePoints(),t;if(n.length>0)for(i.moveTo(n[0].x,n[0].y),t=1;t<n.length;t+=3)i.curveTo(n[t],n[t+1],n[t+2]);return i}});o.mixins.Paintable.extend(ut.fn);st(ut.fn,["geometry"]);lt=k.extend({_change:function(){this.geometryChange()}});p=w.extend({init:function(n,t,i){this.anchor(n||new u);this.controlIn(t);this.controlOut(i)},bboxTo:function(n,t){var i=this.anchor().transformCopy(t),r=n.anchor().transformCopy(t);return this.controlOut()&&n.controlIn()?this._curveBoundingBox(i,this.controlOut().transformCopy(t),n.controlIn().transformCopy(t),r):this._lineBoundingBox(i,r)},_lineBoundingBox:function(n,i){return t.Rect.fromPoints(n,i)},_curveBoundingBox:function(n,i,r,f){var e=[n,i,r,f],o=this._curveExtremesFor(e,"x"),s=this._curveExtremesFor(e,"y"),h=dt([o.min,o.max,n.x,f.x]),c=dt([s.min,s.max,n.y,f.y]);return t.Rect.fromPoints(new u(h.min,c.min),new u(h.max,c.max))},_curveExtremesFor:function(n,t){var i=this._curveExtremes(n[0][t],n[1][t],n[2][t],n[3][t]);return{min:this._calculateCurveAt(i.min,t,n),max:this._calculateCurveAt(i.max,t,n)}},_calculateCurveAt:function(n,t,i){var r=1-n;return nt(r,3)*i[0][t]+3*nt(r,2)*n*i[1][t]+3*nt(n,2)*r*i[2][t]+nt(n,3)*i[3][t]},_curveExtremes:function(n,t,i,r){var o=n-3*t+3*i-r,u=-2*(n-2*t+i),a=n-t,l=s.sqrt(u*u-4*o*a),h=0,c=1,f,e;return o===0?u!==0&&(h=c=-a/u):isNaN(l)||(h=(-u+l)/(2*o),c=(-u-l)/(2*o)),f=s.max(s.min(h,c),0),(f<0||f>1)&&(f=0),e=s.min(s.max(h,c),1),(e>1||e<0)&&(e=1),{min:f,max:e}}});ht(p.fn,["anchor","controlIn","controlOut"]);y(p.fn,b);f=r.extend({nodeType:"Path",init:function(n){r.fn.init.call(this,n);this.segments=new lt;this.segments.addObserver(this);i(this.options.stroke)||(this.stroke("#000"),i(this.options.stroke.lineJoin)||this.options.set("stroke.lineJoin","miter"))},moveTo:function(n,t){return this.suspend(),this.segments.elements([]),this.resume(),this.lineTo(n,t),this},lineTo:function(n,t){var r=i(t)?new u(n,t):n,f=new p(r);return this.segments.push(f),this},curveTo:function(n,t,i){if(this.segments.length>0){var r=c(this.segments),u=new p(i,t);this.suspend();r.controlOut(n);this.resume();this.segments.push(u)}return this},arc:function(n,i,r,f,e){if(this.segments.length>0){var l=c(this.segments),o=l.anchor(),h=a.rad(n),v=new u(o.x-r*s.cos(h),o.y-f*s.sin(h)),y=new t.Arc(v,{startAngle:n,endAngle:i,radiusX:r,radiusY:f,anticlockwise:e});this._addArcSegments(y)}return this},arcTo:function(n,i,r,u,f){if(this.segments.length>0){var e=c(this.segments),o=e.anchor(),s=t.Arc.fromPoints(o,n,i,r,u,f);this._addArcSegments(s)}return this},_addArcSegments:function(n){var i,t;for(this.suspend(),i=n.curvePoints(),t=1;t<i.length;t+=3)this.curveTo(i[t],i[t+1],i[t+2]);this.resume();this.geometryChange()},close:function(){return this.options.closed=!0,this.geometryChange(),this},bbox:function(n){var r=h(this.currentTransform(n)),t=this._bbox(r),i=this.options.get("stroke.width");return i&&ot(t,i/2),t},rawBBox:function(){return this._bbox()},_bbox:function(n){var u=this.segments,f=u.length,i,o,r,e;if(f===1)o=u[0].anchor().transformCopy(n),i=new t.Rect(o,oi.ZERO);else if(f>0)for(r=1;r<f;r++)e=u[r-1].bboxTo(u[r],n),i=i?t.Rect.union(i,e):e;return i}});o.mixins.Paintable.extend(f.fn);f.fromRect=function(n,t){return new f(t).moveTo(n.topLeft()).lineTo(n.topRight()).lineTo(n.bottomRight()).lineTo(n.bottomLeft()).close()};f.fromPoints=function(n,t){var r,i,e;if(n){for(r=new f(t),i=0;i<n.length;i++)e=u.create(n[i]),e&&(i===0?r.moveTo(e):r.lineTo(e));return r}};f.fromArc=function(n,t){var i=new f(t),r=n.startAngle,u=n.pointAt(r);return i.moveTo(u.x,u.y),i.arc(r,n.endAngle,n.radiusX,n.radiusY,n.anticlockwise),i};at=r.extend({nodeType:"MultiPath",init:function(n){r.fn.init.call(this,n);this.paths=new lt;this.paths.addObserver(this);i(this.options.stroke)||this.stroke("#000")},moveTo:function(n,t){var i=new f;return i.moveTo(n,t),this.paths.push(i),this},lineTo:function(n,t){return this.paths.length>0&&c(this.paths).lineTo(n,t),this},curveTo:function(n,t,i){return this.paths.length>0&&c(this.paths).curveTo(n,t,i),this},arc:function(n,t,i,r,u){return this.paths.length>0&&c(this.paths).arc(n,t,i,r,u),this},arcTo:function(n,t,i,r,u){return this.paths.length>0&&c(this.paths).arcTo(n,t,i,r,u),this},close:function(){return this.paths.length>0&&c(this.paths).close(),this},bbox:function(n){return et(this.paths,!0,this.currentTransform(n))},rawBBox:function(){return et(this.paths,!1)},_clippedBBox:function(n){return ri(this.paths,this.currentTransform(n))}});o.mixins.Paintable.extend(at.fn);vt=r.extend({nodeType:"Image",init:function(n,i,u){r.fn.init.call(this,u);this.src(n);this.rect(i||new t.Rect)},src:function(n){return i(n)?(this.options.set("src",n),this):this.options.get("src")},bbox:function(n){var t=h(this.currentTransform(n));return this._rect.bbox(t)},rawBBox:function(){return this._rect.bbox()}});st(vt.fn,["rect"]);e=w.extend({init:function(n,t,r){this.options=new kt({offset:n,color:t,opacity:i(r)?r:1});this.options.addObserver(this)}});nr(e.fn,["offset","color","opacity"]);y(e.fn,b);e.create=function(n){if(i(n))return n instanceof e?n:n.length>1?new e(n[0],n[1],n[2]):new e(n.offset,n.color,n.opacity)};ti=k.extend({_change:function(){this.optionsChange({field:"stops"})}});v=w.extend({nodeType:"gradient",init:function(n){this.stops=new ti(this._createStops(n.stops));this.stops.addObserver(this);this._userSpace=n.userSpace;this.id=wt()},userSpace:function(n){return i(n)?(this._userSpace=n,this.optionsChange(),this):this._userSpace},_createStops:function(n){var i=[],t;for(n=n||[],t=0;t<n.length;t++)i.push(e.create(n[t]));return i},addStop:function(n,t,i){this.stops.push(new e(n,t,i))},removeStop:function(n){var t=this.stops.indexOf(n);t>=0&&this.stops.splice(t,1)}});y(v.fn,b,{optionsChange:function(n){this.trigger("optionsChange",{field:"gradient"+(n?"."+n.field:""),value:this})},geometryChange:function(){this.optionsChange()}});yt=v.extend({init:function(n){n=n||{};v.fn.init.call(this,n);this.start(n.start||new u);this.end(n.end||new u(1,0))}});ht(yt.fn,["start","end"]);pt=v.extend({init:function(n){n=n||{};v.fn.init.call(this,n);this.center(n.center||new u);this._radius=i(n.radius)?n.radius:1;this._fallbackFill=n.fallbackFill},radius:function(n){return i(n)?(this._radius=n,this.geometryChange(),this):this._radius},fallbackFill:function(n){return i(n)?(this._fallbackFill=n,this.optionsChange(),this):this._fallbackFill}});ht(pt.fn,["center"]);ft=r.extend({nodeType:"Rect",init:function(n,u){r.fn.init.call(this,u);this.geometry(n||new t.Rect);i(this.options.stroke)||this.stroke("#000")},bbox:function(n){var r=h(this.currentTransform(n)),t=this._geometry.bbox(r),i=this.options.get("stroke.width");return i&&ot(t,i/2),t},rawBBox:function(){return this._geometry.bbox()}});o.mixins.Paintable.extend(ft.fn);st(ft.fn,["geometry"]);ii=d.extend({init:function(n,t){d.fn.init.call(this,l.deepExtend({},this._defaults,t));this._rect=n;this._fieldMap={}},_defaults:{alignContent:tt,justifyContent:tt,alignItems:tt,spacing:0,orientation:ni,lineSpacing:0,wrap:!0},rect:function(n){return n?(this._rect=n,this):this._rect},_initMap:function(){var t=this.options,n=this._fieldMap;t.orientation==ni?(n.sizeField="width",n.groupsSizeField="height",n.groupAxis="x",n.groupsAxis="y"):(n.sizeField="height",n.groupsSizeField="width",n.groupAxis="y",n.groupsAxis="x")},reflow:function(){var y,h;if(this._rect&&this.children.length!==0){this._initMap();this.options.transform&&this.transform(null);var i=this.options,l=this._fieldMap,r=this._rect,tt=this._initGroups(),it=tt.groups,et=tt.groupsSize,f=l.sizeField,e=l.groupsSizeField,a=l.groupAxis,o=l.groupsAxis,rt=g(et,r,i.alignContent,o,e),b=new u,k=new u,d=new t.Size,nt,v,ut,n,s;for(y=0;y<it.length;y++){for(n=it[y],b[a]=nt=g(n.size,r,i.justifyContent,a,f),b[o]=rt,d[f]=n.size,d[e]=n.lineSize,s=new t.Rect(b,d),h=0;h<n.bboxes.length;h++)ut=n.elements[h],v=n.bboxes[h],k[a]=nt,k[o]=g(v.size[e],s,i.alignItems,o,e),ct(k,v,ut),nt+=v.size[f]+i.spacing;rt+=n.lineSize+i.lineSpacing}if(!i.wrap&&n.size>r.size[f]){var c=r.size[f]/s.size[f],p=s.topLeft().scale(c,c),ot=s.size[e]*c,ft=g(ot,r,i.alignContent,o,e),w=t.transform();a==="x"?w.translate(r.origin.x-p.x,ft-p.y):w.translate(ft-p.x,r.origin.y-p.y);w.scale(c,c);this.transform(w)}}},_initGroups:function(){for(var u=this.options,f=this.children,o=u.lineSpacing,s=this._fieldMap.sizeField,h=-o,c=[],n=this._newGroup(),e=function(){c.push(n);h+=n.lineSize+o},t,i,r=0;r<f.length;r++)i=f[r],t=f[r].clippedBBox(),i.visible()&&t&&(u.wrap&&n.size+t.size[s]+u.spacing>this._rect.size[s]?n.bboxes.length===0?(this._addToGroup(n,t,i),e(),n=this._newGroup()):(e(),n=this._newGroup(),this._addToGroup(n,t,i)):this._addToGroup(n,t,i));return n.bboxes.length&&e(),{groups:c,groupsSize:h}},_addToGroup:function(n,t,i){n.size+=t.size[this._fieldMap.sizeField]+this.options.spacing;n.lineSize=Math.max(t.size[this._fieldMap.groupsSizeField],n.lineSize);n.bboxes.push(t);n.elements.push(i)},_newGroup:function(){return{lineSize:0,size:-this.options.spacing,bboxes:[],elements:[]}}});y(o,{align:ir,Arc:ut,Circle:rt,Element:r,ElementsArray:k,fit:sr,Gradient:v,GradientStop:e,Group:d,Image:vt,Layout:ii,LinearGradient:yt,MultiPath:at,Path:f,RadialGradient:pt,Rect:ft,Segment:p,stack:ur,Text:it,vAlign:rr,vStack:fr,vWrap:or,wrap:er})})(window.kendo.jQuery)}(),function(){(function(n){function d(n){var t=[];return n.replace(b,function(n,i){t.push(parseFloat(i))}),t}function s(n,t,i){for(var u=t?0:1,r=0;r<n.length;r+=2)n.splice(r+u,0,i)}function h(n,t){if(n&&t)return t.scaleCopy(2).translate(-n.x,-n.y)}function c(n,t,i){var r=1/3;return t=t.clone().scale(2/3),{controlOut:t.clone().translateWith(n.scaleCopy(r)),controlIn:t.translateWith(i.scaleCopy(r))}}var i=window.kendo,f=i.drawing,l=i.geometry,a=i.Class,t=l.Point,v=i.deepExtend,y=n.trim,p=i.util,r=p.last,w=/([a-df-z]{1})([^a-df-z]*)(z)?/gi,b=/[,\s]?([+\-]?(?:\d*\.\d+|\d+)(?:[eE][+\-]?\d+)?)/g,e="m",k="z",u=a.extend({parse:function(n,i){var u=new f.MultiPath(i),r=new t,s;return n.replace(w,function(n,t,i,f){var h=t.toLowerCase(),l=h===t,c=d(y(i));if(h===e&&(l?(r.x+=c[0],r.y+=c[1]):(r.x=c[0],r.y=c[1]),u.moveTo(r.x,r.y),c.length>2&&(h="l",c.splice(0,2))),o[h])o[h](u,{parameters:c,position:r,isRelative:l,previousCommand:s}),f&&f.toLowerCase()===k&&u.close();else if(h!==e)throw new Error("Error while parsing SVG path. Unsupported command: "+h);s=h}),u}}),o={l:function(n,i){for(var r,f=i.parameters,e=i.position,u=0;u<f.length;u+=2)r=new t(f[u],f[u+1]),i.isRelative&&r.translateWith(e),n.lineTo(r.x,r.y),e.x=r.x,e.y=r.y},c:function(n,i){for(var u=i.parameters,f=i.position,o,s,e,r=0;r<u.length;r+=6)o=new t(u[r],u[r+1]),s=new t(u[r+2],u[r+3]),e=new t(u[r+4],u[r+5]),i.isRelative&&(s.translateWith(f),o.translateWith(f),e.translateWith(f)),n.curveTo(o,s,e),f.x=e.x,f.y=e.y},v:function(n,t){var i=t.isRelative?0:t.position.x;s(t.parameters,!0,i);this.l(n,t)},h:function(n,t){var i=t.isRelative?0:t.position.y;s(t.parameters,!1,i);this.l(n,t)},a:function(n,i){for(var u=i.parameters,e=i.position,r=0;r<u.length;r+=7){var o=u[r],s=u[r+1],h=u[r+3],c=u[r+4],f=new t(u[r+5],u[r+6]);i.isRelative&&f.translateWith(e);n.arcTo(f,o,s,h,c);e.x=f.x;e.y=f.y}},s:function(n,i){var e=i.parameters,f=i.position,l=i.previousCommand,a,o,s,c,u;for((l=="s"||l=="c")&&(c=r(r(n.paths).segments).controlIn()),u=0;u<e.length;u+=4)s=new t(e[u],e[u+1]),o=new t(e[u+2],e[u+3]),i.isRelative&&(s.translateWith(f),o.translateWith(f)),a=c?h(c,f):f.clone(),c=s,n.curveTo(a,s,o),f.x=o.x,f.y=o.y},q:function(n,i){for(var f=i.parameters,e=i.position,o,r,s,u=0;u<f.length;u+=4)s=new t(f[u],f[u+1]),r=new t(f[u+2],f[u+3]),i.isRelative&&(s.translateWith(e),r.translateWith(e)),o=c(e,s,r),n.curveTo(o.controlOut,o.controlIn,r),e.x=r.x,e.y=r.y},t:function(n,i){var s=i.parameters,u=i.position,a=i.previousCommand,l,e,f,v,o;for((a=="q"||a=="t")&&(v=r(r(n.paths).segments),e=v.controlIn().clone().translateWith(u.scaleCopy(-1/3)).scale(3/2)),o=0;o<s.length;o+=2)f=new t(s[o],s[o+1]),i.isRelative&&f.translateWith(u),e=e?h(e,u):u.clone(),l=c(u,e,f),n.curveTo(l.controlOut,l.controlIn,f),u.x=f.x,u.y=f.y}};u.current=new u;f.Path.parse=function(n,t){return u.current.parse(n,t)};v(f,{PathParser:u})})(window.kendo.jQuery)}(),function(){(function(n){function ei(n){var t;try{t=n.getScreenCTM?n.getScreenCTM():null}catch(f){}if(t){var i=-t.e%1,r=-t.f%1,u=n.style;(i!==0||r!==0)&&(u.left=i+"px",u.top=r+"px")}}function oi(){var r=document.getElementsByTagName("base")[0],t="",n=document.location.href,i=n.indexOf("#");return r&&!f.support.browser.msie&&(i!==-1&&(n=n.substring(0,i)),t=n),t}function kt(n){return"url("+oi()+"#"+n+")"}function dt(n){var i=new d,f=n.clippedBBox(),u,t,e;return f&&(u=f.getOrigin(),t=new r.Group,t.transform(tt.transform().translate(-u.x,-u.y)),t.children.push(n),n=t),i.load([n]),e="<?xml version='1.0' ?><svg xmlns='"+c+"' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1'>"+i.render()+"<\/svg>",i.destroy(),e}function si(t,i){var r=dt(t);return i&&i.raw||(r="data:image/svg+xml;base64,"+e.encodeBase64(r)),n.Deferred().resolve(r).promise()}function gt(n,t){return n=="clip"||n=="fill"&&(!t||t.nodeType==b)}function nt(n){if(!n||!n.indexOf||n.indexOf("&")<0)return n;var t=nt._element;return t.innerHTML=n,t.textContent||t.innerText}var a=document,f=window.kendo,ni=f.deepExtend,tt=f.geometry,r=f.drawing,o=r.BaseNode,e=f.util,h=e.defined,it=e.isTransparent,w=e.renderAttr,s=e.renderAllAttr,t=e.renderTemplate,ti=n.inArray,ii="butt",ri=r.DASH_ARRAYS,b="gradient",v="none",y=".kendo",rt="solid",k=" ",c="http://www.w3.org/2000/svg",p="transform",ui="undefined",ut=r.Surface.extend({init:function(n,t){r.Surface.fn.init.call(this,n,t);this._root=new d(this.options);g(this.element[0],this._template(this));this._rootElement=this.element[0].firstElementChild;ei(this._rootElement);this._root.attachTo(this._rootElement);this.element.on("click"+y,this._click);this.element.on("mouseover"+y,this._mouseenter);this.element.on("mouseout"+y,this._mouseleave);this.resize()},type:"svg",destroy:function(){this._root&&(this._root.destroy(),this._root=null,this._rootElement=null,this.element.off(y));r.Surface.fn.destroy.call(this)},translate:function(n){var t=f.format("{0} {1} {2} {3}",Math.round(n.x),Math.round(n.y),this._size.width,this._size.height);this._offset=n;this._rootElement.setAttribute("viewBox",t)},draw:function(n){r.Surface.fn.draw.call(this,n);this._root.load([n])},clear:function(){r.Surface.fn.clear.call(this);this._root.clear()},svg:function(){return"<?xml version='1.0' ?>"+this._template(this)},exportVisual:function(){var t=this._visual,i=this._offset,n;return i&&(n=new r.Group,n.children.push(t),n.transform(tt.transform().translate(-i.x,-i.y)),t=n),t},_resize:function(){this._offset&&this.translate(this._offset)},_template:t("<svg style='width: 100%; height: 100%; overflow: hidden;' xmlns='"+c+"' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1'>#= d._root.render() #<\/svg>")}),i=o.extend({init:function(n){o.fn.init.call(this,n);this.definitions={}},destroy:function(){this.element&&(this.element._kendoNode=null,this.element=null);this.clearDefinitions();o.fn.destroy.call(this)},load:function(n,t){for(var e=this,o=e.element,i,r,u,f=0;f<n.length;f++)r=n[f],u=r.children,i=new fi[r.nodeType](r),h(t)?e.insertAt(i,t):e.append(i),i.createDefinitions(),u&&u.length>0&&i.load(u),o&&i.attachTo(o,t)},root:function(){for(var n=this;n.parent;)n=n.parent;return n},attachTo:function(n,t){var r=a.createElement("div"),i;g(r,"<svg xmlns='"+c+"' version='1.1'>"+this.render()+"<\/svg>");i=r.firstChild.firstChild;i&&(h(t)?n.insertBefore(i,n.childNodes[t]||null):n.appendChild(i),this.setElement(i))},setElement:function(n){var i=this.childNodes,r,t;for(this.element&&(this.element._kendoNode=null),this.element=n,this.element._kendoNode=this,t=0;t<i.length;t++)r=n.childNodes[t],i[t].setElement(r)},clear:function(){var t,n;for(this.clearDefinitions(),this.element&&(this.element.innerHTML=""),t=this.childNodes,n=0;n<t.length;n++)t[n].destroy();this.childNodes=[]},removeSelf:function(){if(this.element){var n=this.element.parentNode;n&&n.removeChild(this.element);this.element=null}o.fn.removeSelf.call(this)},template:t("#= d.renderChildren() #"),render:function(){return this.template(this)},renderChildren:function(){for(var t=this.childNodes,i="",n=0;n<t.length;n++)i+=t[n].render();return i},optionsChange:function(n){var t=n.field,i=n.value;t==="visible"?this.css("display",i?"":v):l[t]&&gt(t,i)?this.updateDefinition(t,i):t==="opacity"&&this.attr("opacity",i);o.fn.optionsChange.call(this,n)},attr:function(n,t){this.element&&this.element.setAttribute(n,t)},allAttr:function(n){for(var t=0;t<n.length;t++)this.attr(n[t][0],n[t][1])},css:function(n,t){this.element&&(this.element.style[n]=t)},allCss:function(n){for(var t=0;t<n.length;t++)this.css(n[t][0],n[t][1])},removeAttr:function(n){this.element&&this.element.removeAttribute(n)},mapTransform:function(n){var t=[];return n&&t.push([p,"matrix("+n.matrix().toString(6)+")"]),t},renderTransform:function(){return s(this.mapTransform(this.srcElement.transform()))},transformChange:function(n){n?this.allAttr(this.mapTransform(n)):this.removeAttr(p)},mapStyle:function(){var n=this.srcElement.options,t=[["cursor",n.cursor]];return n.visible===!1&&t.push(["display",v]),t},renderStyle:function(){return w("style",e.renderStyle(this.mapStyle(!0)))},renderOpacity:function(){return w("opacity",this.srcElement.options.opacity)},createDefinitions:function(){var i=this.srcElement,r=this.definitions,n,t,u,f;if(i){u=i.options;for(t in l)n=u.get(t),n&&gt(t,n)&&(r[t]=n,f=!0);f&&this.definitionChange({action:"add",definitions:r})}},definitionChange:function(n){this.parent&&this.parent.definitionChange(n)},updateDefinition:function(n,t){var r=this.definitions,u=r[n],f=l[n],i={};u&&(i[n]=u,this.definitionChange({action:"remove",definitions:i}),delete r[n]);t?(i[n]=t,this.definitionChange({action:"add",definitions:i}),r[n]=t,this.attr(f,kt(t.id))):u&&this.removeAttr(f)},clearDefinitions:function(){var n=this.definitions;for(var t in n){this.definitionChange({action:"remove",definitions:n});this.definitions={};break}},renderDefinitions:function(){return s(this.mapDefinitions())},mapDefinitions:function(){var n=this.definitions,t=[];for(var i in n)t.push([l[i],kt(n[i].id)]);return t}}),d=i.extend({init:function(n){i.fn.init.call(this);this.options=n;this.defs=new ft},attachTo:function(n){this.element=n;this.defs.attachTo(n.firstElementChild)},clear:function(){o.fn.clear.call(this)},template:t("#=d.defs.render()##= d.renderChildren() #"),definitionChange:function(n){this.defs.definitionChange(n)}}),ft=i.extend({init:function(){i.fn.init.call(this);this.definitionMap={}},attachTo:function(n){this.element=n},template:t("<defs>#= d.renderChildren()#<\/defs>"),definitionChange:function(n){var t=n.definitions,i=n.action;i=="add"?this.addDefinitions(t):i=="remove"&&this.removeDefinitions(t)},createDefinition:function(n,t){var i;return n=="clip"?i=et:n=="fill"&&(t instanceof r.LinearGradient?i=pt:t instanceof r.RadialGradient&&(i=wt)),new i(t)},addDefinitions:function(n){for(var t in n)this.addDefinition(t,n[t])},addDefinition:function(n,t){var u=this.definitionMap,f=t.id,e=this.element,i,r;r=u[f];r?r.count++:(i=this.createDefinition(n,t),u[f]={element:i,count:1},this.append(i),e&&i.attachTo(this.element))},removeDefinitions:function(n){for(var t in n)this.removeDefinition(n[t])},removeDefinition:function(n){var i=this.definitionMap,r=n.id,t;t=i[r];t&&(t.count--,t.count===0&&(this.remove(ti(t.element,this.childNodes),1),delete i[r]))}}),et=i.extend({init:function(n){i.fn.init.call(this);this.srcElement=n;this.id=n.id;this.load([n])},template:t("<clipPath id='#=d.id#'>#= d.renderChildren()#<\/clipPath>")}),ot=i.extend({template:t("<g#= d.renderTransform() + d.renderStyle() + d.renderOpacity() + d.renderDefinitions()#>#= d.renderChildren() #<\/g>"),optionsChange:function(n){n.field==p&&this.transformChange(n.value);i.fn.optionsChange.call(this,n)}}),u=i.extend({geometryChange:function(){this.attr("d",this.renderData());this.invalidate()},optionsChange:function(n){switch(n.field){case"fill":n.value?this.allAttr(this.mapFill(n.value)):this.removeAttr("fill");break;case"fill.color":this.allAttr(this.mapFill({color:n.value}));break;case"stroke":n.value?this.allAttr(this.mapStroke(n.value)):this.removeAttr("stroke");break;case p:this.transformChange(n.value);break;default:var t=this.attributeMap[n.field];t&&this.attr(t,n.value)}i.fn.optionsChange.call(this,n)},attributeMap:{"fill.opacity":"fill-opacity","stroke.color":"stroke","stroke.width":"stroke-width","stroke.opacity":"stroke-opacity"},content:function(){this.element&&(this.element.textContent=this.srcElement.content())},renderData:function(){return this.printPath(this.srcElement)},printPath:function(n){var i=n.segments,e=i.length,r,f,u,o,t;if(e>0){for(r=[],t=1;t<e;t++)u=this.segmentType(i[t-1],i[t]),u!==o&&(o=u,r.push(u)),u==="L"?r.push(this.printPoints(i[t].anchor())):r.push(this.printPoints(i[t-1].controlOut(),i[t].controlIn(),i[t].anchor()));return f="M"+this.printPoints(i[0].anchor())+k+r.join(k),n.options.closed&&(f+="Z"),f}},printPoints:function(){for(var t=arguments,r=t.length,i=[],n=0;n<r;n++)i.push(t[n].toString(3));return i.join(k)},segmentType:function(n,t){return n.controlOut()&&t.controlIn()?"C":"L"},mapStroke:function(n){var t=[];return n&&!it(n.color)?(t.push(["stroke",n.color]),t.push(["stroke-width",n.width]),t.push(["stroke-linecap",this.renderLinecap(n)]),t.push(["stroke-linejoin",n.lineJoin]),h(n.opacity)&&t.push(["stroke-opacity",n.opacity]),h(n.dashType)&&t.push(["stroke-dasharray",this.renderDashType(n)])):t.push(["stroke",v]),t},renderStroke:function(){return s(this.mapStroke(this.srcElement.options.stroke))},renderDashType:function(n){var f=n.width||1,i=n.dashType,r,u,t;if(i&&i!=rt){for(r=ri[i.toLowerCase()],u=[],t=0;t<r.length;t++)u.push(r[t]*f);return u.join(" ")}},renderLinecap:function(n){var t=n.dashType,i=n.lineCap;return t&&t!=rt?ii:i},mapFill:function(n){var t=[];return n&&n.nodeType==b||(n&&!it(n.color)?(t.push(["fill",n.color]),h(n.opacity)&&t.push(["fill-opacity",n.opacity])):t.push(["fill",v])),t},renderFill:function(){return s(this.mapFill(this.srcElement.options.fill))},template:t("<path #= d.renderStyle() # #= d.renderOpacity() # #= kendo.util.renderAttr('d', d.renderData()) # #= d.renderStroke() # #= d.renderFill() # #= d.renderDefinitions() # #= d.renderTransform() #><\/path>")}),st=u.extend({renderData:function(){return this.printPath(this.srcElement.toPath())}}),ht=u.extend({renderData:function(){var t=this.srcElement.paths,i,n;if(t.length>0){for(i=[],n=0;n<t.length;n++)i.push(this.printPath(t[n]));return i.join(" ")}}}),ct=u.extend({geometryChange:function(){var n=this.center();this.attr("cx",n.x);this.attr("cy",n.y);this.attr("r",this.radius());this.invalidate()},center:function(){return this.srcElement.geometry().center},radius:function(){return this.srcElement.geometry().radius},template:t("<circle #= d.renderStyle() # #= d.renderOpacity() # cx='#= d.center().x #' cy='#= d.center().y #' r='#= d.radius() #' #= d.renderStroke() # #= d.renderFill() # #= d.renderDefinitions() # #= d.renderTransform() # ><\/circle>")}),lt=u.extend({geometryChange:function(){var n=this.pos();this.attr("x",n.x);this.attr("y",n.y);this.invalidate()},optionsChange:function(n){n.field==="font"?(this.attr("style",e.renderStyle(this.mapStyle())),this.geometryChange()):n.field==="content"&&u.fn.content.call(this,this.srcElement.content());u.fn.optionsChange.call(this,n)},mapStyle:function(n){var i=u.fn.mapStyle.call(this,n),t=this.srcElement.options.font;return n&&(t=f.htmlEncode(t)),i.push(["font",t]),i},pos:function(){var n=this.srcElement.position(),t=this.srcElement.measure();return n.clone().setY(n.y+t.baseline)},renderContent:function(){var n=this.srcElement.content();return n=nt(n),f.htmlEncode(n)},template:t("<text #= d.renderStyle() # #= d.renderOpacity() # x='#= this.pos().x #' y='#= this.pos().y #' #= d.renderStroke() # #= d.renderTransform() # #= d.renderDefinitions() # #= d.renderFill() #>#= d.renderContent() #<\/text>")}),at=u.extend({geometryChange:function(){this.allAttr(this.mapPosition());this.invalidate()},optionsChange:function(n){n.field==="src"&&this.allAttr(this.mapSource());u.fn.optionsChange.call(this,n)},mapPosition:function(){var n=this.srcElement.rect(),t=n.topLeft();return[["x",t.x],["y",t.y],["width",n.width()+"px"],["height",n.height()+"px"]]},renderPosition:function(){return s(this.mapPosition())},mapSource:function(n){var t=this.srcElement.src();return n&&(t=f.htmlEncode(t)),[["xlink:href",t]]},renderSource:function(){return s(this.mapSource(!0))},template:t("<image preserveAspectRatio='none' #= d.renderStyle() # #= d.renderTransform()# #= d.renderOpacity() # #= d.renderPosition() # #= d.renderSource() # #= d.renderDefinitions()#><\/image>")}),vt=i.extend({template:t("<stop #=d.renderOffset()# #=d.renderStyle()# />"),renderOffset:function(){return w("offset",this.srcElement.offset())},mapStyle:function(){var n=this.srcElement;return[["stop-color",n.color()],["stop-opacity",n.opacity()]]},optionsChange:function(n){n.field=="offset"?this.attr(n.field,n.value):(n.field=="color"||n.field=="opacity")&&this.css("stop-"+n.field,n.value)}}),yt=i.extend({init:function(n){i.fn.init.call(this,n);this.id=n.id;this.loadStops()},loadStops:function(){for(var u=this.srcElement,i=u.stops,r=this.element,t,n=0;n<i.length;n++)t=new vt(i[n]),this.append(t),r&&t.attachTo(r)},optionsChange:function(n){n.field=="gradient.stops"?(o.fn.clear.call(this),this.loadStops()):n.field==b&&this.allAttr(this.mapCoordinates())},renderCoordinates:function(){return s(this.mapCoordinates())},mapSpace:function(){return["gradientUnits",this.srcElement.userSpace()?"userSpaceOnUse":"objectBoundingBox"]}}),pt=yt.extend({template:t("<linearGradient id='#=d.id#' #=d.renderCoordinates()#>#= d.renderChildren()#<\/linearGradient>"),mapCoordinates:function(){var n=this.srcElement,t=n.start(),i=n.end();return[["x1",t.x],["y1",t.y],["x2",i.x],["y2",i.y],this.mapSpace()]}}),wt=yt.extend({template:t("<radialGradient id='#=d.id#' #=d.renderCoordinates()#>#= d.renderChildren()#<\/radialGradient>"),mapCoordinates:function(){var n=this.srcElement,t=n.center(),i=n.radius();return[["cx",t.x],["cy",t.y],["r",i],this.mapSpace()]}}),bt=u.extend({geometryChange:function(){var n=this.srcElement.geometry();this.attr("x",n.origin.x);this.attr("y",n.origin.y);this.attr("width",n.size.width);this.attr("height",n.size.height);this.invalidate()},size:function(){return this.srcElement.geometry().size},origin:function(){return this.srcElement.geometry().origin},template:t("<rect #= d.renderStyle() # #= d.renderOpacity() # x='#= d.origin().x #' y='#= d.origin().y #' width='#= d.size().width #' height='#= d.size().height #'#= d.renderStroke() # #= d.renderFill() # #= d.renderDefinitions() # #= d.renderTransform() # />")}),fi={Group:ot,Text:lt,Path:u,MultiPath:ht,Circle:ct,Arc:st,Image:at,Rect:bt},g=function(n,t){n.innerHTML=t},l;(function(){var t="<svg xmlns='"+c+"'><\/svg>",n=a.createElement("div"),i=typeof DOMParser!=ui;n.innerHTML=t;i&&n.firstChild.namespaceURI!=c&&(g=function(n,t){var i=new DOMParser,r=i.parseFromString(t,"text/xml"),u=a.adoptNode(r.documentElement);n.innerHTML="";n.appendChild(u)})})();nt._element=document.createElement("span");l={clip:"clip-path",fill:"fill"};f.support.svg=function(){return a.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")}();f.support.svg&&r.SurfaceFactory.current.register("svg",ut,10);ni(r,{exportSVG:si,svg:{ArcNode:st,CircleNode:ct,ClipNode:et,DefinitionNode:ft,GradientStopNode:vt,GroupNode:ot,ImageNode:at,LinearGradientNode:pt,MultiPathNode:ht,Node:i,PathNode:u,RadialGradientNode:wt,RectNode:bt,RootNode:d,Surface:ut,TextNode:lt,_exportGroup:dt}})})(window.kendo.jQuery)}(),function(){(function(n){function ot(i,r){var e={width:"800px",height:"600px",cors:"Anonymous"},o=i.clippedBBox(),h,u,l,a,f,v;return o&&(h=o.getOrigin(),u=new t.Group,u.transform(rt.transform().translate(-h.x,-h.y)),u.children.push(i),i=u,l=o.getSize(),e.width=l.width+"px",e.height=l.height+"px"),r=c(e,r),a=n("<div />").css({display:"none",width:r.width,height:r.height}).appendTo(document.body),f=new s(a,r),f.draw(i),v=f.image(),v.always(function(){f.destroy();a.remove()}),v}function st(n,t){for(var f,i,u=0;u<t.length;u++)i=t[u],f=r.parseColor(i.color()),f.a*=i.opacity(),n.addColorStop(i.offset(),f.toCssRgba())}var nt=document,r=window.kendo,c=r.deepExtend,f=r.util,l=f.defined,a=f.isTransparent,tt=f.renderTemplate,it=f.valueOrDefault,rt=r.geometry,t=r.drawing,e=t.BaseNode,ut="butt",ft=t.DASH_ARRAYS,et=1e3/60,v="solid",s=t.Surface.extend({init:function(i,r){t.Surface.fn.init.call(this,i,r);this.element[0].innerHTML=this._template(this);var u=this.element[0].firstElementChild;u.width=n(i).width();u.height=n(i).height();this._rootElement=u;this._root=new o(u)},destroy:function(){t.Surface.fn.destroy.call(this);this._root&&(this._root.destroy(),this._root=null)},type:"canvas",draw:function(n){t.Surface.fn.draw.call(this,n);this._root.load([n],undefined,this.options.cors)},clear:function(){t.Surface.fn.clear.call(this);this._root.clear()},image:function(){var i=this._root,u=this._rootElement,r=[],t;return i.traverse(function(n){n.loading&&r.push(n.loading)}),t=n.Deferred(),n.when.apply(n,r).done(function(){i._invalidate();try{var n=u.toDataURL();t.resolve(n)}catch(r){t.reject(r)}}).fail(function(n){t.reject(n)}),t.promise()},_resize:function(){this._rootElement.width=this._size.width;this._rootElement.height=this._size.height;this._root.invalidate()},_template:tt("<canvas style='width: 100%; height: 100%;'><\/canvas>")}),h=e.extend({init:function(n){e.fn.init.call(this,n);n&&this.initClip()},initClip:function(){var n=this.srcElement.clip();n&&(this.clip=n,n.addObserver(this))},clear:function(){this.srcElement&&this.srcElement.removeObserver(this);this.clearClip();e.fn.clear.call(this)},clearClip:function(){this.clip&&(this.clip.removeObserver(this),delete this.clip)},setClip:function(n){this.clip&&(n.beginPath(),i.fn.renderPoints(n,this.clip),n.clip())},optionsChange:function(n){n.field=="clip"&&(this.clearClip(),this.initClip());e.fn.optionsChange.call(this,n)},setTransform:function(n){if(this.srcElement){var t=this.srcElement.transform();t&&n.transform.apply(n,t.matrix().toArray(6))}},loadElements:function(n,t,i){for(var o=this,r,u,f,e=0;e<n.length;e++)u=n[e],f=u.children,r=new g[u.nodeType](u,i),f&&f.length>0&&r.load(f,t,i),l(t)?o.insertAt(r,t):o.append(r)},load:function(n,t,i){this.loadElements(n,t,i);this.invalidate()},setOpacity:function(n){if(this.srcElement){var t=this.srcElement.opacity();l(t)&&this.globalAlpha(n,t)}},globalAlpha:function(n,t){t&&n.globalAlpha&&(t*=n.globalAlpha);n.globalAlpha=t},visible:function(){var n=this.srcElement;return!n||n&&n.options.visible!==!1}}),u=h.extend({renderTo:function(n){var i,t,r;if(this.visible()){for(n.save(),this.setTransform(n),this.setClip(n),this.setOpacity(n),i=this.childNodes,t=0;t<i.length;t++)r=i[t],r.visible()&&r.renderTo(n);n.restore()}}}),o,g;t.mixins.Traversable.extend(u.fn,"childNodes");o=u.extend({init:function(t){u.fn.init.call(this);this.canvas=t;this.ctx=t.getContext("2d");var i=n.proxy(this._invalidate,this);this.invalidate=r.throttle(function(){r.animationFrame(i)},et)},destroy:function(){u.fn.destroy.call(this);this.canvas=null;this.ctx=null},load:function(n,t,i){this.loadElements(n,t,i);this._invalidate()},_invalidate:function(){this.ctx&&(this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.renderTo(this.ctx))}});t.mixins.Traversable.extend(o.fn,"childNodes");var i=h.extend({renderTo:function(n){n.save();this.setTransform(n);this.setClip(n);this.setOpacity(n);n.beginPath();this.renderPoints(n,this.srcElement);this.setLineDash(n);this.setLineCap(n);this.setLineJoin(n);this.setFill(n);this.setStroke(n);n.restore()},setFill:function(n){var t=this.srcElement.options.fill,i=!1;return t&&(t.nodeType=="gradient"?(this.setGradientFill(n,t),i=!0):a(t.color)||(n.fillStyle=t.color,n.save(),this.globalAlpha(n,t.opacity),n.fill(),n.restore(),i=!0)),i},setGradientFill:function(n,i){var u=this.srcElement.rawBBox(),f,e,o,r;i instanceof t.LinearGradient?(e=i.start(),o=i.end(),f=n.createLinearGradient(e.x,e.y,o.x,o.y)):i instanceof t.RadialGradient&&(r=i.center(),f=n.createRadialGradient(r.x,r.y,0,r.x,r.y,i.radius()));st(f,i.stops);n.save();i.userSpace()||n.transform(u.width(),0,0,u.height(),u.origin.x,u.origin.y);n.fillStyle=f;n.fill();n.restore()},setStroke:function(n){var t=this.srcElement.options.stroke;if(t&&!a(t.color)&&t.width>0)return n.strokeStyle=t.color,n.lineWidth=it(t.width,1),n.save(),this.globalAlpha(n,t.opacity),n.stroke(),n.restore(),!0},dashType:function(){var n=this.srcElement.options.stroke;if(n&&n.dashType)return n.dashType.toLowerCase()},setLineDash:function(n){var i=this.dashType(),t;i&&i!=v&&(t=ft[i],n.setLineDash?n.setLineDash(t):(n.mozDash=t,n.webkitLineDash=t))},setLineCap:function(n){var i=this.dashType(),t=this.srcElement.options.stroke;i&&i!==v?n.lineCap=ut:t&&t.lineCap&&(n.lineCap=t.lineCap)},setLineJoin:function(n){var t=this.srcElement.options.stroke;t&&t.lineJoin&&(n.lineJoin=t.lineJoin)},renderPoints:function(n,t){var r=t.segments,u,i,f;if(r.length!==0){for(u=r[0],i=u.anchor(),n.moveTo(i.x,i.y),f=1;f<r.length;f++){u=r[f];i=u.anchor();var s=r[f-1],e=s.controlOut(),o=u.controlIn();e&&o?n.bezierCurveTo(e.x,e.y,o.x,o.y,i.x,i.y):n.lineTo(i.x,i.y)}t.options.closed&&n.closePath()}}}),y=i.extend({renderPoints:function(n){for(var r=this.srcElement.paths,t=0;t<r.length;t++)i.fn.renderPoints(n,r[t])}}),p=i.extend({renderPoints:function(n){var t=this.srcElement.geometry(),i=t.center,r=t.radius;n.arc(i.x,i.y,r,0,Math.PI*2)}}),w=i.extend({renderPoints:function(n){var t=this.srcElement.toPath();i.fn.renderPoints.call(this,n,t)}}),b=i.extend({renderTo:function(n){var t=this.srcElement,i=t.position(),r=t.measure();n.save();this.setTransform(n);this.setClip(n);this.setOpacity(n);n.beginPath();n.font=t.options.font;this.setFill(n)&&n.fillText(t.content(),i.x,i.y+r.baseline);this.setStroke(n)&&(this.setLineDash(n),n.strokeText(t.content(),i.x,i.y+r.baseline));n.restore()}}),k=i.extend({init:function(t,r){i.fn.init.call(this,t);this.onLoad=n.proxy(this.onLoad,this);this.onError=n.proxy(this.onError,this);this.loading=n.Deferred();var u=this.img=new Image;r&&!/^data:/i.test(t.src())&&(u.crossOrigin=r);u.src=t.src();u.complete?this.onLoad():(u.onload=this.onLoad,u.onerror=this.onError)},renderTo:function(n){this.loading.state()==="resolved"&&(n.save(),this.setTransform(n),this.setClip(n),this.drawImage(n),n.restore())},optionsChange:function(t){t.field==="src"?(this.loading=n.Deferred(),this.img.src=this.srcElement.src()):i.fn.optionsChange.call(this,t)},onLoad:function(){this.loading.resolve();this.invalidate()},onError:function(){this.loading.reject(new Error("Unable to load image '"+this.img.src+"'. Check for connectivity and verify CORS headers."))},drawImage:function(n){var t=this.srcElement.rect(),i=t.topLeft();n.drawImage(this.img,i.x,i.y,t.width(),t.height())}}),d=i.extend({renderPoints:function(n){var t=this.srcElement.geometry(),i=t.origin,r=t.size;n.rect(i.x,i.y,r.width,r.height)}});g={Group:u,Text:b,Path:i,MultiPath:y,Circle:p,Arc:w,Image:k,Rect:d};r.support.canvas=function(){return!!nt.createElement("canvas").getContext}();r.support.canvas&&t.SurfaceFactory.current.register("canvas",s,20);c(r.drawing,{exportImage:ot,canvas:{ArcNode:w,CircleNode:p,GroupNode:u,ImageNode:k,MultiPathNode:y,Node:h,PathNode:i,RectNode:d,RootNode:o,Surface:s,TextNode:b}})})(window.kendo.jQuery)}(),function(){(function(n){function di(){if(o.namespaces&&!o.namespaces.kvml){o.namespaces.add("kvml","urn:schemas-microsoft-com:vml");var n=o.styleSheets.length>30?o.styleSheets[0]:o.createStyleSheet();n.addRule(".kvml","behavior:url(#default#VML)")}}function h(n){var t=o.createElement("kvml:"+n);return t.className="kvml",t}function a(n){for(var r=n.length,i=[],t=0;t<r;t++)i.push(n[t].scaleCopy(y).toString(0,","));return i.join(" ")}function tt(n,t){var r=n.segments,o=r.length,u,e,f,s,i;if(o>0){for(u=[],i=1;i<o;i++)f=gi(r[i-1],r[i]),f!==s&&(s=f,u.push(f)),f==="l"?u.push(a([r[i].anchor()])):u.push(a([r[i-1].controlOut(),r[i].controlIn(),r[i].anchor()]));return e="m "+a([r[0].anchor()])+" "+u.join(" "),n.options.closed&&(e+=" x"),t!==!0&&(e+=" e"),e}}function gi(n,t){return n.controlOut()&&t.controlIn()?"c":"l"}function yi(n){return n.indexOf("fill")===0||n.indexOf(et)===0}function ot(n,t,i){var r=i*f(t.opacity(),1);return n?pi(n,t.color(),r):pi(t.color(),"#fff",1-r)}function pi(n,t,i){var r=new ut(n),u=new ut(t),f=st(r.r,u.r,i),e=st(r.g,u.g,i),o=st(r.b,u.b,i);return new ut(f,e,o).toHex()}function st(n,t,i){return b.round(i*t+(1-i)*n)}var o=document,b=Math,it=b.atan2,c=b.ceil,ct=b.sqrt,r=window.kendo,wi=r.deepExtend,lt=n.noop,u=r.drawing,k=u.BaseNode,rt=r.geometry,at=rt.toMatrix,ut=r.Color,v=r.util,vt=v.isTransparent,d=v.defined,yt=v.deg,g=v.round,f=v.valueOrDefault,ft="none",nt=".kendo",y=100,pt=y*y,et="gradient",p=4,wt=u.Surface.extend({init:function(n,t){u.Surface.fn.init.call(this,n,t);di();this.element.empty();this._root=new bt;this._root.attachTo(this.element[0]);this.element.on("click"+nt,this._click);this.element.on("mouseover"+nt,this._mouseenter);this.element.on("mouseout"+nt,this._mouseleave)},type:"vml",destroy:function(){this._root&&(this._root.destroy(),this._root=null,this.element.off(nt));u.Surface.fn.destroy.call(this)},draw:function(n){u.Surface.fn.draw.call(this,n);this._root.load([n],undefined,null)},clear:function(){u.Surface.fn.clear.call(this);this._root.clear()}}),t=k.extend({init:function(n){k.fn.init.call(this,n);this.createElement();this.attachReference()},observe:lt,destroy:function(){this.element&&(this.element._kendoNode=null,this.element=null);k.fn.destroy.call(this)},clear:function(){var t,n;for(this.element&&(this.element.innerHTML=""),t=this.childNodes,n=0;n<t.length;n++)t[n].destroy();this.childNodes=[]},removeSelf:function(){this.element&&(this.element.parentNode.removeChild(this.element),this.element=null);k.fn.removeSelf.call(this)},createElement:function(){this.element=o.createElement("div")},attachReference:function(){this.element._kendoNode=this},load:function(n,t,i,r){var e;for(r=f(r,1),this.srcElement&&(r*=f(this.srcElement.options.opacity,1)),e=0;e<n.length;e++){var u=n[e],s=u.children,h=u.currentTransform(i),c=r*f(u.options.opacity,1),o=new ki[u.nodeType](u,h,c);s&&s.length>0&&o.load(s,t,h,r);d(t)?this.insertAt(o,t):this.append(o);o.attachTo(this.element,t)}},attachTo:function(n,t){d(t)?n.insertBefore(this.element,n.children[t]||null):n.appendChild(this.element)},optionsChange:function(n){n.field=="visible"&&this.css("display",n.value!==!1?"":ft)},setStyle:function(){this.allCss(this.mapStyle())},mapStyle:function(){var n=[];return this.srcElement&&this.srcElement.options.visible===!1&&n.push(["display",ft]),n},mapOpacityTo:function(n,t){var i=f(this.opacity,1);i*=f(t,1);n.push(["opacity",i])},attr:function(n,t){this.element&&(this.element[n]=t)},allAttr:function(n){for(var t=0;t<n.length;t++)this.attr(n[t][0],n[t][1])},css:function(n,t){this.element&&(this.element.style[n]=t)},allCss:function(n){for(var t=0;t<n.length;t++)this.css(n[t][0],n[t][1])}}),bt=t.extend({createElement:function(){t.fn.createElement.call(this);this.allCss([["width","100%"],["height","100%"],["position","relative"],["visibility","visible"]])},attachReference:lt}),bi=r.Class.extend({init:function(n,t){this.srcElement=n;this.observer=t;n.addObserver(this)},geometryChange:function(){this.observer.optionsChange({field:"clip",value:this.srcElement})},clear:function(){this.srcElement.removeObserver(this)}}),e=t.extend({init:function(n){t.fn.init.call(this,n);n&&this.initClip()},observe:function(){k.fn.observe.call(this)},mapStyle:function(){var n=t.fn.mapStyle.call(this);return this.srcElement&&this.srcElement.clip()&&n.push(["clip",this.clipRect()]),n},optionsChange:function(n){n.field=="clip"&&(this.clearClip(),this.initClip(),this.setClip());t.fn.optionsChange.call(this,n)},clear:function(){this.clearClip();t.fn.clear.call(this)},initClip:function(){this.srcElement.clip()&&(this.clip=new bi(this.srcElement.clip(),this),this.clip.observer=this)},clearClip:function(){this.clip&&(this.clip.clear(),this.clip=null,this.css("clip",this.clipRect()))},setClip:function(){this.clip&&this.css("clip",this.clipRect())},clipRect:function(){var n=ht,t=this.srcElement.clip();if(t){var i=this.clipBBox(t),u=i.topLeft(),f=i.bottomRight();n=r.format("rect({0}px {1}px {2}px {3}px)",u.y,f.x,f.y,u.x)}return n},clipBBox:function(n){var t=this.srcElement.rawBBox().topLeft(),i=n.rawBBox();return i.origin.translate(-t.x,-t.y),i}}),kt=e.extend({createElement:function(){t.fn.createElement.call(this);this.setStyle()},attachTo:function(n,i){this.css("display",ft);t.fn.attachTo.call(this,n,i);this.srcElement.options.visible!==!1&&this.css("display","")},_attachTo:function(n){var t=document.createDocumentFragment();t.appendChild(this.element);n.appendChild(t)},mapStyle:function(){var n=e.fn.mapStyle.call(this);return n.push(["position","absolute"]),n.push(["white-space","nowrap"]),n},optionsChange:function(n){n.field==="transform"&&this.refreshTransform();n.field==="opacity"&&this.refreshOpacity();e.fn.optionsChange.call(this,n)},refreshTransform:function(n){var r=this.srcElement.currentTransform(n),i=this.childNodes,u=i.length,t;for(this.setClip(),t=0;t<u;t++)i[t].refreshTransform(r)},currentOpacity:function(){var n=f(this.srcElement.options.opacity,1);return this.parent&&this.parent.currentOpacity&&(n*=this.parent.currentOpacity()),n},refreshOpacity:function(){for(var t=this.childNodes,i=t.length,r=this.currentOpacity(),n=0;n<i;n++)t[n].refreshOpacity(r)},initClip:function(){if(e.fn.initClip.call(this),this.clip){var n=this.clip.srcElement.bbox(this.srcElement.currentTransform());n&&(this.css("width",n.width()+n.origin.x),this.css("height",n.height()+n.origin.y))}},clipBBox:function(n){return n.bbox(this.srcElement.currentTransform())},clearClip:function(){e.fn.clearClip.call(this)}}),dt=t.extend({init:function(n,i){this.opacity=i;t.fn.init.call(this,n)},createElement:function(){this.element=h("stroke");this.setOpacity()},optionsChange:function(n){n.field.indexOf("stroke")===0&&this.setStroke()},refreshOpacity:function(n){this.opacity=n;this.setStroke()},setStroke:function(){this.allAttr(this.mapStroke())},setOpacity:function(){this.setStroke()},mapStroke:function(){var n=this.srcElement.options.stroke,t=[],i;return n&&!vt(n.color)&&n.width!==0?(t.push(["on","true"]),t.push(["color",n.color]),t.push(["weight",(n.width||1)+"px"]),this.mapOpacityTo(t,n.opacity),d(n.dashType)&&t.push(["dashstyle",n.dashType]),d(n.lineJoin)&&t.push(["joinstyle",n.lineJoin]),d(n.lineCap)&&(i=n.lineCap.toLowerCase(),i==="butt"&&(i=i==="butt"?"flat":i),t.push(["endcap",i]))):t.push(["on","false"]),t}}),gt=t.extend({init:function(n,i,r){this.opacity=r;t.fn.init.call(this,n)},createElement:function(){this.element=h("fill");this.setFill()},optionsChange:function(n){yi(n.field)&&this.setFill()},refreshOpacity:function(n){this.opacity=n;this.setOpacity()},setFill:function(){this.allAttr(this.mapFill())},setOpacity:function(){this.setFill()},attr:function(n,t){var i=this.element,r;if(i){for(r=n.split(".");r.length>1;)i=i[r.shift()];i[r[0]]=t}},mapFill:function(){var n=this.srcElement.fill(),t=[["on","false"]];return n&&(n.nodeType==et?t=this.mapGradient(n):vt(n.color)||(t=this.mapFillColor(n))),t},mapFillColor:function(n){var t=[["on","true"],["color",n.color]];return this.mapOpacityTo(t,n.opacity),t},mapGradient:function(n){var i=this.srcElement.options,t=i.fallbackFill||n.fallbackFill&&n.fallbackFill();return n instanceof u.LinearGradient?this.mapLinearGradient(n):n instanceof u.RadialGradient&&n.supportVML?this.mapRadialGradient(n):t?this.mapFillColor(t):[["on","false"]]},mapLinearGradient:function(n){var t=n.start(),i=n.end(),u=v.deg(it(i.y-t.y,i.x-t.x)),r=[["on","true"],["type",et],["focus",0],["method","none"],["angle",270-u]];return this.addColors(r),r},mapRadialGradient:function(n){var t=this.srcElement.rawBBox(),i=n.center(),u=(i.x-t.origin.x)/t.width(),f=(i.y-t.origin.y)/t.height(),r=[["on","true"],["type","gradienttitle"],["focus","100%"],["focusposition",u+" "+f],["method","none"]];return this.addColors(r),r},addColors:function(n){for(var o=this.srcElement.options,i=f(this.opacity,1),s=[],t=o.fill.stops,r=o.baseColor,h=this.element.colors?"colors.value":"colors",c=ot(r,t[0],i),l=ot(r,t[t.length-1],i),u,e=0;e<t.length;e++)u=t[e],s.push(b.round(u.offset()*100)+"% "+ot(r,u,i));n.push([h,s.join(",")],["color",c],["color2",l])}}),w=t.extend({init:function(n,i){this.transform=i;t.fn.init.call(this,n)},createElement:function(){this.element=h("skew");this.setTransform()},optionsChange:function(n){n.field==="transform"&&this.refresh(this.srcElement.currentTransform())},refresh:function(n){this.transform=n;this.setTransform()},transformOrigin:function(){return"-0.5,-0.5"},setTransform:function(){this.allAttr(this.mapTransform())},mapTransform:function(){var i=this.transform,t=[],n=at(i);return n?(n.round(p),t.push(["on","true"],["matrix",[n.a,n.c,n.b,n.d,0,0].join(",")],["offset",n.e+"px,"+n.f+"px"],["origin",this.transformOrigin()])):t.push(["on","false"]),t}}),l=e.extend({init:function(n,t,i){this.fill=this.createFillNode(n,t,i);this.stroke=new dt(n,i);this.transform=this.createTransformNode(n,t);e.fn.init.call(this,n)},attachTo:function(n,i){this.fill.attachTo(this.element);this.stroke.attachTo(this.element);this.transform.attachTo(this.element);t.fn.attachTo.call(this,n,i)},createFillNode:function(n,t,i){return new gt(n,t,i)},createTransformNode:function(n,t){return new w(n,t)},createElement:function(){this.element=h("shape");this.setCoordsize();this.setStyle()},optionsChange:function(n){yi(n.field)?this.fill.optionsChange(n):n.field.indexOf("stroke")===0?this.stroke.optionsChange(n):n.field==="transform"?this.transform.optionsChange(n):n.field==="opacity"&&(this.fill.setOpacity(),this.stroke.setOpacity());e.fn.optionsChange.call(this,n)},refreshTransform:function(n){this.transform.refresh(this.srcElement.currentTransform(n))},refreshOpacity:function(n){n*=f(this.srcElement.options.opacity,1);this.fill.refreshOpacity(n);this.stroke.refreshOpacity(n)},mapStyle:function(n,t){var i=e.fn.mapStyle.call(this),r;return n&&t||(n=t=y),i.push(["position","absolute"],["width",n+"px"],["height",t+"px"]),r=this.srcElement.options.cursor,r&&i.push(["cursor",r]),i},setCoordsize:function(){this.allAttr([["coordorigin","0 0"],["coordsize",pt+" "+pt]])}}),s=t.extend({createElement:function(){this.element=h("path");this.setPathData()},geometryChange:function(){this.setPathData()},setPathData:function(){this.attr("v",this.renderData())},renderData:function(){return tt(this.srcElement)}}),i=l.extend({init:function(n,t,i){this.pathData=this.createDataNode(n);l.fn.init.call(this,n,t,i)},attachTo:function(n,t){this.pathData.attachTo(this.element);l.fn.attachTo.call(this,n,t)},createDataNode:function(n){return new s(n)},geometryChange:function(){this.pathData.geometryChange();l.fn.geometryChange.call(this)}}),ni=s.extend({renderData:function(){var t=this.srcElement.paths,i,n,r;if(t.length>0){for(i=[],n=0;n<t.length;n++)r=n<t.length-1,i.push(tt(t[n],r));return i.join(" ")}}}),ti=i.extend({createDataNode:function(n){return new ni(n)}}),ii=w.extend({transformOrigin:function(){var n=this.srcElement.geometry().bbox(),t=n.center(),i=-c(t.x)/c(n.width()),r=-c(t.y)/c(n.height());return i+","+r}}),ri=l.extend({createElement:function(){this.element=h("oval");this.setStyle()},createTransformNode:function(n,t){return new ii(n,t)},geometryChange:function(){l.fn.geometryChange.call(this);this.setStyle();this.refreshTransform()},mapStyle:function(){var t=this.srcElement.geometry(),n=t.radius,i=t.center,r=c(n*2),u=l.fn.mapStyle.call(this,r,r);return u.push(["left",c(i.x-n)+"px"],["top",c(i.y-n)+"px"]),u}}),ui=s.extend({renderData:function(){return tt(this.srcElement.toPath())}}),fi=i.extend({createDataNode:function(n){return new ui(n)}}),ei=s.extend({createElement:function(){s.fn.createElement.call(this);this.attr("textpathok",!0)},renderData:function(){var n=this.srcElement.rect(),t=n.center();return"m "+a([new rt.Point(n.topLeft().x,t.y)])+" l "+a([new rt.Point(n.bottomRight().x,t.y)])}}),oi=t.extend({createElement:function(){this.element=h("textpath");this.attr("on",!0);this.attr("fitpath",!1);this.setStyle();this.setString()},optionsChange:function(n){n.field==="content"?this.setString():this.setStyle();t.fn.optionsChange.call(this,n)},mapStyle:function(){return[["font",this.srcElement.options.font]]},setString:function(){this.attr("string",this.srcElement.content())}}),si=i.extend({init:function(n,t,r){this.path=new oi(n);i.fn.init.call(this,n,t,r)},createDataNode:function(n){return new ei(n)},attachTo:function(n,t){this.path.attachTo(this.element);i.fn.attachTo.call(this,n,t)},optionsChange:function(n){(n.field==="font"||n.field==="content")&&(this.path.optionsChange(n),this.pathData.geometryChange(n));i.fn.optionsChange.call(this,n)}}),hi=s.extend({renderData:function(){var n=this.srcElement.rect(),t=(new u.Path).moveTo(n.topLeft()).lineTo(n.topRight()).lineTo(n.bottomRight()).lineTo(n.bottomLeft()).close();return tt(t)}}),ci=w.extend({init:function(n,t,i){this.opacity=i;w.fn.init.call(this,n,t)},createElement:function(){this.element=h("fill");this.attr("type","frame");this.attr("rotate",!0);this.setOpacity();this.setSrc();this.setTransform()},optionsChange:function(n){n.field==="src"&&this.setSrc();w.fn.optionsChange.call(this,n)},geometryChange:function(){this.refresh()},refreshOpacity:function(n){this.opacity=n;this.setOpacity()},setOpacity:function(){var n=[];this.mapOpacityTo(n,this.srcElement.options.opacity);this.allAttr(n)},setSrc:function(){this.attr("src",this.srcElement.src())},mapTransform:function(){var l=this.srcElement,h=l.rawBBox(),e=h.center(),i=y/2,t=y,r,u,o=h.width()/t,s=h.height()/t,f=0,a=this.transform,b,k,c;if(a){var n=at(a),v=ct(n.a*n.a+n.b*n.b),w=ct(n.c*n.c+n.d*n.d);o*=v;s*=w;b=yt(it(n.b,n.d));k=yt(it(-n.c,n.a));f=(b+k)/2;f!==0?(c=l.bbox().center(),r=(c.x-i)/t,u=(c.y-i)/t):(r=(e.x*v+n.e-i)/t,u=(e.y*w+n.f-i)/t)}else r=(e.x-i)/t,u=(e.y-i)/t;return o=g(o,p),s=g(s,p),r=g(r,p),u=g(u,p),f=g(f,p),[["size",o+","+s],["position",r+","+u],["angle",f]]}}),li=i.extend({createFillNode:function(n,t,i){return new ci(n,t,i)},createDataNode:function(n){return new hi(n)},optionsChange:function(n){(n.field==="src"||n.field==="transform")&&this.fill.optionsChange(n);i.fn.optionsChange.call(this,n)},geometryChange:function(){this.fill.geometryChange();i.fn.geometryChange.call(this)},refreshTransform:function(n){i.fn.refreshTransform.call(this,n);this.fill.refresh(this.srcElement.currentTransform(n))}}),ai=s.extend({renderData:function(){var n=this.srcElement.geometry(),t=["m",a([n.topLeft()]),"l",a([n.topRight(),n.bottomRight(),n.bottomLeft()]),"x e"];return t.join(" ")}}),vi=i.extend({createDataNode:function(n){return new ai(n)}}),ki={Group:kt,Text:si,Path:i,MultiPath:ti,Circle:ri,Arc:fi,Image:li,Rect:vi},ht;r.support.vml=function(){var n=r.support.browser;return n.msie&&n.version<9}();ht="inherit";r.support.browser.msie&&r.support.browser.version<8&&(ht="rect(auto auto auto auto)");r.support.vml&&u.SurfaceFactory.current.register("vml",wt,30);wi(u,{vml:{ArcDataNode:ui,ArcNode:fi,CircleTransformNode:ii,CircleNode:ri,FillNode:gt,GroupNode:kt,ImageNode:li,ImageFillNode:ci,ImagePathDataNode:hi,MultiPathDataNode:ni,MultiPathNode:ti,Node:t,PathDataNode:s,PathNode:i,RectDataNode:ai,RectNode:vi,RootNode:bt,StrokeNode:dt,Surface:wt,TextNode:si,TextPathNode:oi,TextPathDataNode:ei,TransformNode:w}})})(window.kendo.jQuery)}(),function(){(function(n,t,i){"use strict";function st(i,o){function c(t){var i=new f.Group,r=t.getBoundingClientRect();return d(i,[1,0,0,1,-r.left,-r.top]),u._clipbox=!1,u._matrix=h.Matrix.unit(),u._stackingContext={element:t,group:i},u._avoidLinks=o.avoidLinks===!0?"a":o.avoidLinks,n(t).addClass("k-pdf-export"),y(t,i),n(t).removeClass("k-pdf-export"),i}function a(t){if(t!=null)return(typeof t=="string"&&(t=kendo.template(t.replace(/^\s+|\s+$/g,""))),typeof t=="function")?function(i){var r=t(i);if(r)return n(r)[0]}:function(){return n(t).clone()[0]}}function l(t){var r=t.cloneNode(!1);if(t.nodeType==1){var f=n(t),e=n(r),i,u=f.data();for(i in u)e.data(i,u[i]);if(/^canvas$/i.test(t.tagName))r.getContext("2d").drawImage(t,0,0);else for(i=t.firstChild;i;i=i.nextSibling)r.appendChild(l(i))}return r}function v(i,u,f,o,s,h,c){function it(){function r(){setTimeout(function(){i({pages:w,container:p})},10)}var n,t;(f!="-"||s)&&d(v);n=g();v.parentNode.insertBefore(n,v);n.appendChild(v);tt?(t=w.length,w.forEach(function(n,i){var u=tt({element:n,pageNum:i+1,totalPages:w.length});u&&(n.appendChild(u),yt(u,function(){--t==0&&r()}))})):r()}function d(i){var l=e(i),a=t(r(l,"padding-bottom")),v=t(r(l,"border-bottom-width")),p=k,o,u,h,c;for(k+=a+v,o=!0,u=i.firstChild;u;u=u.nextSibling)if(u.nodeType==1){if(o=!1,h=n(u),h.is(f)){y(u);continue}if(!s){d(u);continue}if(!/^(?:static|relative)$/.test(r(e(u),"position")))continue;c=nt(u);c==1?y(u):c?h.data("kendoChart")||/^(?:img|tr|iframe|svg|object|canvas|input|textarea|select|video|h[1-6])/i.test(u.tagName)?y(u):d(u):d(u)}else u.nodeType==3&&s&&(rt(u,o),o=!1);k=p}function ut(n){var i=n.parentNode,t=i.firstChild;if(n===t)return!0;if(n===i.children[0]){if(t.nodeType==7||t.nodeType==8)return!0;if(t.nodeType==3)return!/\S/.test(t.data)}return!1}function y(t){if(t.nodeType==1&&t!==v&&ut(t))return y(t.parentNode);var r=n(t).closest("table").find("colgroup"),u=g(),i=b.createRange();i.setStartBefore(v);i.setEndBefore(t);u.appendChild(i.extractContents());v.parentNode.insertBefore(u,v);r[0]&&r.clone().prependTo(n(t).closest("table"))}function g(){var t=b.createElement("KENDO-PDF-PAGE");return n(t).css({display:"block",boxSizing:"content-box",width:o||"auto",padding:h.top+"px "+h.right+"px "+h.bottom+"px "+h.left+"px",position:"relative",height:s||"auto",overflow:s||o?"hidden":"visible",clear:"both"}),c&&c.pageClassName&&(t.className=c.pageClassName),w.push(t),t}function nt(n){var t=n.getBoundingClientRect(),r,i;return t.width===0||t.height===0?0:(r=v.getBoundingClientRect().top,i=s-k,t.height>i?3:t.top-r>i?1:t.bottom-r>i?2:0)}function rt(n,t){var r,i,u,f,e;/\S/.test(n.data)&&(r=n.data.length,i=b.createRange(),i.selectNodeContents(n),u=nt(i),u)&&(f=n,u==1?t?y(n.parentNode):y(n):(function o(t,r,u){return(i.setEnd(n,r),t==r||r==u)?r:nt(i)?o(t,t+r>>1,r):o(r,r+u>>1,u)}(0,r>>1,r),!/\S/.test(i.toString())&&t?y(n.parentNode):(f=n.splitText(i.endOffset),e=g(),i.setStartBefore(v),e.appendChild(i.extractContents()),v.parentNode.insertBefore(e,v))),rt(f))}var tt=a(c.template),b=u.ownerDocument,w=[],v=l(u),p=b.createElement("KENDO-PDF-DOCUMENT"),k=0;n(v).find("tfoot").each(function(){this.parentNode.appendChild(this)});n(v).find("ol").each(function(){n(this).children().each(function(n){this.setAttribute("kendo-split-index",n)})});n(p).css({display:"block",position:"absolute",boxSizing:"content-box",left:"-10000px",top:"-10000px"});o&&(n(p).css({width:o,paddingLeft:h.left,paddingRight:h.right}),n(v).css({overflow:"hidden"}));p.appendChild(v);u.parentNode.insertBefore(p,u);c.beforePageBreak?setTimeout(function(){c.beforePageBreak(p,it)},15):setTimeout(it,15)}o||(o={});var s=n.Deferred();if(i=n(i)[0],!i)return s.reject("No element to export");if(typeof window.getComputedStyle!="function")throw new Error("window.getComputedStyle is missing.  You are using an unsupported browser, or running in IE8 compatibility mode.  Drawing HTML is supported in Chrome, Firefox, Safari and IE9+.");return kendo.pdf&&kendo.pdf.defineFont(lt(i.ownerDocument)),yt(i,function(){var h=o&&o.forcePageBreak,r=o&&o.paperSize&&o.paperSize!="auto",u=r&&kendo.pdf.getPaperOptions(function(n,t){return n in o?o[n]:t}),l=r&&u.paperSize[0],e=r&&u.paperSize[1],n=o.margin&&u.margin,t;h||e?(n||(n={left:0,top:0,right:0,bottom:0}),t=new f.Group({pdf:{multiPage:!0,paperSize:r?u.paperSize:"auto"}}),v(function(n){if(o.progress){var r=!1,i=0;(function u(){i<n.pages.length?(t.append(c(n.pages[i])),o.progress({pageNum:++i,totalPages:n.pages.length,cancel:function(){r=!0}}),r?n.container.parentNode.removeChild(n.container):setTimeout(u)):(n.container.parentNode.removeChild(n.container),s.resolve(t))})()}else n.pages.forEach(function(n){t.append(c(n))}),n.container.parentNode.removeChild(n.container),s.resolve(t)},i,h,l?l-n.left-n.right:null,e?e-n.top-n.bottom:null,n,o)):s.resolve(c(i))}),s.promise()}function lt(n){function u(n){if(n){var t=null;try{t=n.cssRules}catch(i){}t&&e(n,t)}}function f(n){var i=r(n.style,"src"),t;return i?s(i).reduce(function(n,t){var i=ct(t);return i&&n.push(i),n},[]):(t=ct(n.cssText),t?[t]:[])}function e(n,t){for(var i,e=0;e<t.length;++e){i=t[e];switch(i.type){case 3:u(i.styleSheet);break;case 5:var h=i.style,l=s(r(h,"font-family")),a=/^(400|bold)$/i.test(r(h,"font-weight")),v="italic"==r(h,"font-style"),c=f(i);c.length>0&&o(n,l,a,v,c[0])}}}function o(n,t,r,u,f){/^data:/i.test(f)||/^[^\/:]+:\/\//.test(f)||/^\//.test(f)||(f=String(n.href).replace(/[^\/]*$/,"")+f);t.forEach(function(n){n=n.replace(/^(['"]?)(.*?)\1$/,"$2");r&&(n+="|bold");u&&(n+="|italic");i[n]=f})}var i,t;for(n==null&&(n=document),i={},t=0;t<n.styleSheets.length;++t)u(n.styleSheets[t]);return i}function b(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function fi(n){return n="_counter_"+n,u[n]}function ei(n){var i=[],t=u;for(n="_counter_"+n;t;)b(t,n)&&i.push(t[n]),t=Object.getPrototypeOf(t);return i.reverse()}function oi(n,t){var i=u;for(n="_counter_"+n;i&&!b(i,n);)i=Object.getPrototypeOf(i);i||(i=u._root);i[n]=(i[n]||0)+(t==null?1:t)}function si(n,t){n="_counter_"+n;u[n]=t==null?0:t}function at(n,i,r){for(var f,e,u=0;u<n.length;)f=n[u++],e=t(n[u]),isNaN(e)?i(f,r):(i(f,e),++u)}function vt(n,t){var i=kendo.parseColor(n);return i&&(i=i.toRGB(),t?i=i.toCssRgba():i.a===0&&(i=null)),i}function yt(n,t){function o(n){w[n]||(w[n]=!0,u.push(n))}function i(){--f<=0&&t()}var u=[],f;(function s(n){/^img$/i.test(n.tagName)&&o(n.src);ht(r(e(n),"background-image")).forEach(function(n){n.type=="url"&&o(n.url)});n.children&&et.call(n.children).forEach(s)})(n);f=u.length;f===0&&i();u.forEach(function(n){var t=w[n]=new Image;/^data:/i.test(n)||(t.crossOrigin="Anonymous");t.src=n;t.complete?i():(t.onload=i,t.onerror=function(){w[n]=null;i()})})}function tt(n){var t="",r;do r=n%26,t=String.fromCharCode(97+r)+t,n=i.floor(n/26);while(n>0);return t}function hi(n,t,i){var f,e;u=Object.create(u);u[n.tagName.toLowerCase()]={element:n,style:t};f=r(t,"text-decoration");f&&f!="none"&&(e=r(t,"color"),f.split(/\s+/g).forEach(function(n){u[n]||(u[n]=e)}));ai(t)&&(u._stackingContext={element:n,group:i})}function ci(){u=Object.getPrototypeOf(u)}function pt(n){if(u._clipbox!=null){var t=n.bbox(u._matrix);u._clipbox=u._clipbox?h.Rect.intersect(u._clipbox,t):t}}function li(){var n=u._clipbox;return n==null?!0:n?n.width()===0||n.height()===0:void 0}function ai(n){function t(t){return r(n,t)}if(t("transform")!="none"||t("position")!="static"&&t("z-index")!="auto"||t("opacity")<1)return!0}function e(n,t){return window.getComputedStyle(n,t||null)}function r(n,t){return n.getPropertyValue(t)||o.webkit&&n.getPropertyValue("-webkit-"+t)||o.mozilla&&n.getPropertyValue("-moz-"+t)||o.opera&&n.getPropertyValue("-o-"+t)||o.msie&&n.getPropertyValue("-ms-"+t)}function it(n,t,i,r){n.setProperty(t,i,r);o.webkit?n.setProperty("-webkit-"+t,i,r):o.mozilla?n.setProperty("-moz-"+t,i,r):o.opera?n.setProperty("-o-"+t,i,r):o.msie&&(n.setProperty("-ms-"+t,i,r),t="ms"+t.replace(/(^|-)([a-z])/g,function(n,t,i){return t+i.toUpperCase()}),n[t]=i)}function vi(n){if(o.msie||o.chrome){var t=n.getClientRects();if(t.length==2&&t[1].width<=1)return t[0];if(t.length==3&&t[0].width<=1&&t[2].width<=1)return t[1]}return n.getBoundingClientRect()}function c(n,i){return i="border-"+i,{width:t(r(n,i+"-width")),style:r(n,i+"-style"),color:vt(r(n,i+"-color"),!0)}}function wt(n,t){var i=n.style.cssText,r=t();return n.style.cssText=i,r}function l(n,i){var u=r(n,"border-"+i+"-radius").split(/\s+/g).map(t);return u.length==1&&u.push(u[0]),rt({x:u[0],y:u[1]})}function yi(n){var t=n.getBoundingClientRect();return t=a(t,"border-*-width",n),a(t,"padding-*",n)}function a(n,i,u){var f,o,s,h,c;return typeof i=="string"?(f=e(u),o=t(r(f,i.replace("*","top"))),s=t(r(f,i.replace("*","right"))),h=t(r(f,i.replace("*","bottom"))),c=t(r(f,i.replace("*","left")))):typeof i=="number"&&(o=s=h=c=i),{top:n.top+o,right:n.right-s,bottom:n.bottom-h,left:n.left+c,width:n.right-n.left-s-c,height:n.bottom-n.top-h-o}}function pi(n){var f=r(n,"transform"),i,u;return f=="none"?null:(i=/^\s*matrix\(\s*(.*?)\s*\)\s*$/.exec(f),i?(u=r(n,"transform-origin"),i=i[1].split(/\s*,\s*/g).map(t),u=u.split(/\s+/g).map(t),{matrix:i,origin:u}):void 0)}function bt(n){return 180*n/i.PI%360}function wi(n){var r=t(n);return/grad$/.test(n)?i.PI*r/200:/rad$/.test(n)?r:/turn$/.test(n)?i.PI*r*2:/deg$/.test(n)?i.PI*r/180:void 0}function d(n,t){return t=new h.Matrix(t[0],t[1],t[2],t[3],t[4],t[5]),n.transform(t),t}function k(n,t){n.clip(t)}function v(n,t,i,r){for(var u=new h.Arc([t,i],r).curvePoints(),f=1;f<u.length;)n.curveTo(u[f++],u[f++],u[f++])}function rt(n){return(n.x<=0||n.y<=0)&&(n.x=n.y=0),n}function kt(n,t,r,u,f){var o=i.max(0,t.x),s=i.max(0,t.y),h=i.max(0,r.x),c=i.max(0,r.y),l=i.max(0,u.x),a=i.max(0,u.y),v=i.max(0,f.x),y=i.max(0,f.y),e=i.min(n.width/(o+h),n.height/(c+a),n.width/(l+v),n.height/(y+s));return e<1&&(o*=e,s*=e,h*=e,c*=e,l*=e,a*=e,v*=e,y*=e),{tl:{x:o,y:s},tr:{x:h,y:c},br:{x:l,y:a},bl:{x:v,y:y}}}function ut(n,i,u){var f=e(n),o=l(f,"top-left"),s=l(f,"top-right"),h=l(f,"bottom-left"),a=l(f,"bottom-right");if(u=="padding"||u=="content"){var v=c(f,"top"),y=c(f,"right"),p=c(f,"bottom"),w=c(f,"left");if(o.x-=w.width,o.y-=v.width,s.x-=y.width,s.y-=v.width,a.x-=y.width,a.y-=p.width,h.x-=w.width,h.y-=p.width,u=="content"){var b=t(r(f,"padding-top")),k=t(r(f,"padding-right")),d=t(r(f,"padding-bottom")),g=t(r(f,"padding-left"));o.x-=g;o.y-=b;s.x-=k;s.y-=b;a.x-=k;a.y-=d;h.x-=g;h.y-=d}}return typeof u=="number"&&(o.x-=u,o.y-=u,s.x-=u,s.y-=u,a.x-=u,a.y-=u,h.x-=u,h.y-=u),dt(i,o,s,a,h)}function dt(n,t,i,r,u){var l=kt(n,t,i,r,u),o=l.tl,s=l.tr,h=l.br,c=l.bl,e=new f.Path({fill:null,stroke:null});return e.moveTo(n.left,n.top+o.y),o.x&&v(e,n.left+o.x,n.top+o.y,{startAngle:-180,endAngle:-90,radiusX:o.x,radiusY:o.y}),e.lineTo(n.right-s.x,n.top),s.x&&v(e,n.right-s.x,n.top+s.y,{startAngle:-90,endAngle:0,radiusX:s.x,radiusY:s.y}),e.lineTo(n.right,n.bottom-h.y),h.x&&v(e,n.right-h.x,n.bottom-h.y,{startAngle:0,endAngle:90,radiusX:h.x,radiusY:h.y}),e.lineTo(n.left+c.x,n.bottom),c.x&&v(e,n.left+c.x,n.bottom-c.y,{startAngle:90,endAngle:180,radiusX:c.x,radiusY:c.y}),e.close()}function gt(n,i){var r=t(n)+"";switch(i){case"decimal-leading-zero":return r.length<2&&(r="0"+r),r;case"lower-roman":return nt(n).toLowerCase();case"upper-roman":return nt(n).toUpperCase();case"lower-latin":case"lower-alpha":return tt(n-1);case"upper-latin":case"upper-alpha":return tt(n-1).toUpperCase();default:return r}}function bi(n,t){function u(n,t,i){return i?(i=i.replace(/^\s*(["'])(.*)\1\s*$/,"$2"),ei(n).map(function(n){return gt(n,t)}).join(i)):gt(fi(n)||0,t)}var f=s(t,/^\s+/),r=[],i;return f.forEach(function(t){var f;(i=/^\s*(["'])(.*)\1\s*$/.exec(t))?r.push(i[2].replace(/\\([0-9a-f]{4})/gi,function(n,t){return String.fromCharCode(parseInt(t,16))})):(i=/^\s*counter\((.*?)\)\s*$/.exec(t))?(f=s(i[1]),r.push(u(f[0],f[1]))):(i=/^\s*counters\((.*?)\)\s*$/.exec(t))?(f=s(i[1]),r.push(u(f[0],f[2],f[1]))):(i=/^\s*attr\((.*?)\)\s*$/.exec(t))?r.push(n.getAttribute(i[1])||""):r.push(t)}),r.join("")}function ft(n){var i,t;if(n.cssText)return n.cssText;for(i=[],t=0;t<n.length;++t)i.push(n[t]+": "+r(n,n[t]));return i.join(";\n")}function ni(n,i){function f(i,f){var s=e(n,i),o;s.content&&s.content!="normal"&&s.content!="none"&&s.width!="0px"&&(o=n.ownerDocument.createElement(p),o.style.cssText=ft(s),o.textContent=bi(n,s.content),n.insertBefore(o,f),i!=":before"||/absolute|fixed/.test(r(o.style,"position"))||(o.style.marginLeft=t(r(o.style,"margin-left"))-o.offsetWidth+"px"),u.push(o))}if(n.tagName==p){ti(n,i);return}var u=[];f(":before",n.firstChild);f(":after",null);ti(n,i);u.forEach(function(t){n.removeChild(t)})}function ti(b,g){function yi(n){var t,i,f;if(/^td$/i.test(b.tagName)&&(t=u.table,t&&r(t.style,"border-collapse")=="collapse")){if(i=c(t.style,"left").width,f=c(t.style,"top").width,i===0&&f===0)return n;var e=t.element.getBoundingClientRect(),s=t.element.rows[0].cells[0],o=s.getBoundingClientRect();if(o.top==e.top||o.left==e.left)return et.call(n).map(function(n){return{left:n.left+i,top:n.top+f,right:n.right+i,bottom:n.bottom+f,height:n.height,width:n.width}})}return n}function ti(n,t,r,u,e,o,s,h){function a(t,u,e){var h=i.PI/2*t/(t+r),o={x:u.x-t,y:u.y-r},s=new f.Path({fill:{color:n},stroke:null}).moveTo(0,0);d(s,e);v(s,0,u.y,{startAngle:-90,endAngle:-bt(h),radiusX:u.x,radiusY:u.y});o.x>0&&o.y>0?(s.lineTo(o.x*i.cos(h),u.y-o.y*i.sin(h)),v(s,0,u.y,{startAngle:-bt(h),endAngle:-90,radiusX:o.x,radiusY:o.y,anticlockwise:!0})):o.x>0?s.lineTo(o.x,r).lineTo(0,r):s.lineTo(o.x,r).lineTo(o.x,0);c.append(s.close())}if(!(r<=0)){var l,c=new f.Group;d(c,h);g.append(c);rt(o);rt(s);l=new f.Path({fill:{color:n},stroke:null});c.append(l);l.moveTo(o.x?i.max(o.x,u):0,0).lineTo(t-(s.x?i.max(s.x,e):0),0).lineTo(t-i.max(s.x,e),r).lineTo(i.max(o.x,u),r).close();o.x&&a(u,o,[-1,0,0,1,o.x,0]);s.x&&a(e,s,[1,0,0,1,t-s.x,0])}}function pi(t){var r=new f.Group,e,i;for(k(r,dt(t,ii,ui,ei,fi)),g.append(r),b.tagName=="A"&&b.href&&!/^#?$/.test(n(b).attr("href"))&&(u._avoidLinks&&n(b).is(u._avoidLinks)||(r._pdfLink={url:b.href,top:t.top,right:t.right,bottom:t.bottom,left:t.left})),ni&&(e=new f.Path({fill:{color:ni.toCssRgba()},stroke:null}),e.moveTo(t.left,t.top).lineTo(t.right,t.top).lineTo(t.right,t.bottom).lineTo(t.left,t.bottom).close(),r.append(e)),i=ci.length;--i>=0;)wi(r,t,ci[i],li[i%li.length],oi[i%oi.length],ai[i%ai.length],vi[i%vi.length])}function wi(n,i,r,u,e,o,s){function l(n,i,r,f,c){function w(){while(l.origin.x>i.left)l.origin.x-=r}function k(){while(l.origin.y>i.top)l.origin.y-=f}function d(){while(l.origin.x<i.right)c(n,l.clone()),l.origin.x+=r}var nt=r/f,y=i,p,v,l,g;if(o=="content-box"?(y=a(y,"border-*-width",b),y=a(y,"padding-*",b)):o=="padding-box"&&(y=a(y,"border-*-width",b)),/^\s*auto(\s+auto)?\s*$/.test(s)||(p=s.split(/\s+/g),r=/%$/.test(p[0])?y.width*t(p[0])/100:t(p[0]),f=p.length==1||p[1]=="auto"?r/nt:/%$/.test(p[1])?y.height*t(p[1])/100:t(p[1])),v=(e+"").split(/\s+/),v.length==1&&(v[1]="50%"),v[0]=/%$/.test(v[0])?t(v[0])/100*(y.width-r):t(v[0]),v[1]=/%$/.test(v[1])?t(v[1])/100*(y.height-f):t(v[1]),l=new h.Rect([y.left+v[0],y.top+v[1]],[r,f]),u=="no-repeat")c(n,l);else if(u=="repeat-x")w(),d();else if(u=="repeat-y")for(k();l.origin.y<i.bottom;)c(n,l.clone()),l.origin.y+=f;else if(u=="repeat")for(w(),k(),g=l.origin.clone();l.origin.y<i.bottom;)l.origin.x=g.x,d(),l.origin.y+=f}if(r&&r!="none")if(r.type=="url"){if(/^url\(\"data:image\/svg/i.test(r.url))return;var c=w[r.url];c&&c.width>0&&c.height>0&&l(n,i,c.width,c.height,function(n,t){n.append(new f.Image(r.url,t))})}else if(r.type=="linear")l(n,i,i.width,i.height,ki(r));else return}function bi(){function t(n){wt(b,function(){b.style.position="relative";var t=b.ownerDocument.createElement(p);t.style.position="absolute";t.style.boxSizing="border-box";u=="outside"?(t.style.width="6em",t.style.left="-6.8em",t.style.textAlign="right"):t.style.left="0px";n(t);b.insertBefore(t,b.firstChild);y(t,g);b.removeChild(t)})}function i(n){var i=b.parentNode.children,r=b.getAttribute("kendo-split-index"),t;if(r!=null)return n(r|0,i.length);for(t=0;t<i.length;++t)if(i[t]===b)return n(t,i.length)}var n=r(it,"list-style-type"),u;if(n!="none"){u=r(it,"list-style-position");switch(n){case"circle":case"disc":case"square":t(function(t){t.style.fontSize="60%";t.style.lineHeight="200%";t.style.paddingRight="0.5em";t.style.fontFamily="DejaVu Serif";t.innerHTML={disc:"●",circle:"◯",square:"■"}[n]});break;case"decimal":case"decimal-leading-zero":t(function(t){i(function(i){++i;n=="decimal-leading-zero"&&(i+"").length<2&&(i="0"+i);t.innerHTML=i+"."})});break;case"lower-roman":case"upper-roman":t(function(t){i(function(i){i=nt(i+1);n=="upper-roman"&&(i=i.toUpperCase());t.innerHTML=i+"."})});break;case"lower-latin":case"lower-alpha":case"upper-latin":case"upper-alpha":t(function(t){i(function(i){i=tt(i);/^upper/i.test(n)&&(i=i.toUpperCase());t.innerHTML=i+"."})})}}}function nr(n,t,i){function u(n){return{x:n.y,y:n.x}}var e,o,s;if(n.width!==0&&n.height!==0&&(pi(n),e=ct.width>0&&(t&&gt=="ltr"||i&&gt=="rtl"),o=ot.width>0&&(i&&gt=="ltr"||t&&gt=="rtl"),ft.width!==0||ct.width!==0||ot.width!==0||st.width!==0)){if(1){if(ft.color==ot.color&&ft.color==st.color&&ft.color==ct.color&&ft.width==ot.width&&ft.width==st.width&&ft.width==ct.width&&e&&o){n=a(n,ft.width/2);s=ut(b,n,ft.width/2);s.options.stroke={color:ft.color,width:ft.width};g.append(s);return}if(ii.x===0&&ui.x===0&&ei.x===0&&fi.x===0&&ft.width<2&&ct.width<2&&ot.width<2&&st.width<2){ft.width>0&&g.append(new f.Path({stroke:{width:ft.width,color:ft.color}}).moveTo(n.left,n.top+ft.width/2).lineTo(n.right,n.top+ft.width/2));st.width>0&&g.append(new f.Path({stroke:{width:st.width,color:st.color}}).moveTo(n.left,n.bottom-st.width/2).lineTo(n.right,n.bottom-st.width/2));e&&g.append(new f.Path({stroke:{width:ct.width,color:ct.color}}).moveTo(n.left+ct.width/2,n.top).lineTo(n.left+ct.width/2,n.bottom));o&&g.append(new f.Path({stroke:{width:ot.width,color:ot.color}}).moveTo(n.right-ot.width/2,n.top).lineTo(n.right-ot.width/2,n.bottom));return}}var r=kt(n,ii,ui,ei,fi),h=r.tl,c=r.tr,l=r.br,v=r.bl;ti(ft.color,n.width,ft.width,ct.width,ot.width,h,c,[1,0,0,1,n.left,n.top]);ti(st.color,n.width,st.width,ot.width,ct.width,l,v,[-1,0,0,-1,n.right,n.bottom]);ti(ct.color,n.height,ct.width,st.width,ft.width,u(v),u(h),[0,-1,1,0,n.left,n.bottom]);ti(ot.color,n.height,ot.width,ft.width,st.width,u(c),u(l),[0,1,-1,0,n.right,n.top])}}var it=e(b),ft=c(it,"top"),ot=c(it,"right"),st=c(it,"bottom"),ct=c(it,"left"),ii=l(it,"top-left"),ui=l(it,"top-right"),fi=l(it,"bottom-left"),ei=l(it,"bottom-right"),gt=r(it,"direction"),ni=r(it,"background-color"),at,lt,yt,si,hi;ni=vt(ni);var ci=ht(r(it,"background-image")),li=s(r(it,"background-repeat")),oi=s(r(it,"background-position")),ai=s(r(it,"background-origin")),vi=s(r(it,"background-size"));if(o.msie&&o.version<10&&(oi=s(b.currentStyle.backgroundPosition)),at=a(b.getBoundingClientRect(),"border-*-width",b),function(){var l=r(it,"clip"),u=/^\s*rect\((.*)\)\s*$/.exec(l);if(u){var n=u[1].split(/[ ,]+/g),e=n[0]=="auto"?at.top:t(n[0])+at.top,o=n[1]=="auto"?at.right:t(n[1])+at.left,s=n[2]=="auto"?at.bottom:t(n[2])+at.top,h=n[3]=="auto"?at.left:t(n[3])+at.left,i=new f.Group,c=(new f.Path).moveTo(h,e).lineTo(o,e).lineTo(o,s).lineTo(h,s).close();k(i,c);g.append(i);g=i;pt(c)}}(),hi=r(it,"display"),hi=="table-row")for(lt=[],yt=0,si=b.children;yt<si.length;++yt)lt.push(si[yt].getBoundingClientRect());else lt=b.getClientRects(),lt.length==1&&(lt=[b.getBoundingClientRect()]);for(lt=yi(lt),yt=0;yt<lt.length;++yt)nr(lt[yt],yt===0,yt==lt.length-1);return lt.length>0&&hi=="list-item"&&bi(lt[0]),function(){function n(){var t=ut(b,at,"padding"),n=new f.Group;k(n,t);g.append(n);g=n;pt(t)}gi(b)?n():/^(hidden|auto|scroll)/.test(r(it,"overflow"))?n():/^(hidden|auto|scroll)/.test(r(it,"overflow-x"))?n():/^(hidden|auto|scroll)/.test(r(it,"overflow-y"))&&n()}(),di(b,g)||ri(b,g),g}function ki(n){return function(r,u){var o=u.width(),s=u.height(),e;switch(n.type){case"linear":e=n.angle!=null?n.angle:i.PI;switch(n.to){case"top":e=0;break;case"left":e=-i.PI/2;break;case"bottom":e=i.PI;break;case"right":e=i.PI/2;break;case"top left":case"left top":e=-i.atan2(s,o);break;case"top right":case"right top":e=i.atan2(s,o);break;case"bottom left":case"left bottom":e=i.PI+i.atan2(s,o);break;case"bottom right":case"right bottom":e=i.PI-i.atan2(s,o)}n.reverse&&(e-=i.PI);e%=2*i.PI;e<0&&(e+=2*i.PI);var b=i.abs(o*i.sin(e))+i.abs(s*i.cos(e)),v=i.atan(o*i.tan(e)/s),y=i.sin(v),p=i.cos(v),w=i.abs(y)+i.abs(p),h=w/2*y,c=w/2*p;e>i.PI/2&&e<=3*i.PI/2&&(h=-h,c=-c);var l=[],a=0,k=n.stops.map(function(i,r){var u=i.percent,f;return u?u=t(u)/100:i.length?u=t(i.length)/b:r===0?u=0:r==n.stops.length-1&&(u=1),f={color:i.color.toCssRgba(),offset:u},u!=null?(a=u,l.forEach(function(n,t){var i=n.stop;i.offset=n.left+(a-n.left)*(t+1)/(l.length+1)}),l=[]):l.push({left:a,stop:f}),f}),d=[.5-h,.5+c],g=[.5+h,.5-c];r.append(f.Path.fromRect(u).stroke(null).fill(new f.LinearGradient({start:d,end:g,stops:k,userSpace:!1})));break;case"radial":window.console&&window.console.log&&window.console.log("Radial gradients are not yet supported in HTML renderer")}}}function di(t,i){var r,e,u,o;if(t.getAttribute(kendo.attr("role"))&&(r=kendo.widgetInstance(n(t)),r&&(r.exportDOMVisual||r.exportVisual)))return(e=r.exportDOMVisual?r.exportDOMVisual():r.exportVisual(),!e)?!1:(u=new f.Group,u.children.push(e),o=t.getBoundingClientRect(),u.transform(h.transform().translate(o.left,o.top)),i.append(u),!0)}function ii(n,t,i){var r=yi(n),e=new h.Rect([r.left,r.top],[r.width,r.height]),u=new f.Image(t,e);k(u,ut(n,r,"content"));i.append(u)}function g(n,i){var o=e(n),s=e(i),u=t(r(o,"z-index")),f=t(r(s,"z-index")),h=r(o,"position"),c=r(s,"position");return isNaN(u)&&isNaN(f)?/static|absolute/.test(h)&&/static|absolute/.test(c)?0:h=="static"?-1:c=="static"?1:0:isNaN(u)?f===0?0:f>0?-1:1:isNaN(f)?u===0?0:u>0?1:-1:t(u)-t(f)}function gi(n){return/^(?:textarea|select|input)$/i.test(n.tagName)}function nr(n){return n.selectedOptions&&n.selectedOptions.length>0?n.selectedOptions[0]:n.options[n.selectedIndex]}function tr(n,t){var s=e(n),o=r(s,"color"),u=n.getBoundingClientRect();n.type=="checkbox"?(t.append(f.Path.fromRect(new h.Rect([u.left+1,u.top+1],[u.width-2,u.height-2])).stroke(o,1)),n.checked&&t.append((new f.Path).stroke(o,1.2).moveTo(u.left+.22*u.width,u.top+.55*u.height).lineTo(u.left+.45*u.width,u.top+.75*u.height).lineTo(u.left+.78*u.width,u.top+.22*u.width))):(t.append(new f.Circle(new h.Circle([(u.left+u.right)/2,(u.top+u.bottom)/2],i.min(u.width-2,u.height-2)/2)).stroke(o,1)),n.checked&&t.append(new f.Circle(new h.Circle([(u.left+u.right)/2,(u.top+u.bottom)/2],i.min(u.width-8,u.height-8)/2)).fill(o).stroke(null)))}function ir(n,t){var u=n.tagName.toLowerCase(),f;if(u=="input"&&(n.type=="checkbox"||n.type=="radio"))return tr(n,t);var o=n.parentNode,s=n.ownerDocument,i=s.createElement(p),r;if(i.style.cssText=ft(e(n)),i.style.display="inline-block",u=="input"&&(i.style.whiteSpace="pre"),(u=="select"||u=="textarea")&&(i.style.overflow="auto"),u=="select")if(n.multiple)for(f=0;f<n.options.length;++f)r=s.createElement(p),r.style.cssText=ft(e(n.options[f])),r.style.display="block",r.textContent=n.options[f].textContent,i.appendChild(r);else r=nr(n),r&&(i.textContent=r.textContent);else i.textContent=n.value;o.insertBefore(i,n);i.scrollLeft=n.scrollLeft;i.scrollTop=n.scrollTop;ri(i,t);o.removeChild(i)}function ri(n,t){var i;u._stackingContext.element===n&&(u._stackingContext.group=t);switch(n.tagName.toLowerCase()){case"img":ii(n,n.src,t);break;case"canvas":try{ii(n,n.toDataURL("image/png"),t)}catch(p){}break;case"textarea":case"input":case"select":ir(n,t);break;default:var o=[],s=[],h=[],c=[];for(i=n.firstChild;i;i=i.nextSibling)switch(i.nodeType){case 3:/\S/.test(i.data)&&rr(n,i,t);break;case 1:var f=e(i),l=r(f,"display"),a=r(f,"float"),v=r(f,"position");v!="static"?c.push(i):l!="inline"?a!="none"?s.push(i):o.push(i):h.push(i)}o.sort(g).forEach(function(n){y(n,t)});s.sort(g).forEach(function(n){y(n,t)});h.sort(g).forEach(function(n){y(n,t)});c.sort(g).forEach(function(n){y(n,t)})}}function rr(n,s,c){function rt(){var y=a,t,n=p.substr(a).search(/\S/),e,h,r,u,f,v;if(a+=n,n<0||a>=w)return!0;if(l.setStart(s,a),l.setEnd(s,a+1),t=l.getBoundingClientRect(),e=!1,tt&&(n=p.substr(a).search(/\s/),n>=0&&(l.setEnd(s,a+n),h=l.getBoundingClientRect(),h.bottom==t.bottom&&(t=h,e=!0,a+=n))),!e){if(n=function c(n,i,r){l.setEnd(s,i);var u=vi(l);return u.bottom!=t.bottom&&n<i?c(n,n+i>>1,i):u.right!=t.right?(t=u,i<r?c(i,i+r>>1,r):i):i}(a,i.min(w,a+k),w),n==a)return!0;if(a=n,n=l.toString().search(/\s+$/),n===0)return;n>0&&(l.setEnd(s,l.startOffset+n),t=l.getBoundingClientRect())}if(o.msie&&(t=l.getClientRects()[0]),r=l.toString(),/^(?:pre|pre-wrap)$/i.test(it)){if(/\t/.test(r)){for(u=0,n=y;n<l.startOffset;++n)f=p.charCodeAt(n),f==9?u+=8-u%8:f==10||f==13?u=0:u++;while((n=r.search("\t"))>=0)v="        ".substr(0,8-(u+n)%8),r=r.substr(0,n)+v+r.substr(n+1)}}else r=r.replace(/\s+/g," ");ut(r,t)}function ut(n,t){var i,r,u;o.msie&&!isNaN(b)&&(i=kendo.util.measureText(n,{font:d}),r=(t.top+t.bottom-i.height)/2,t={top:r,right:t.right,bottom:r+i.height,left:t.left,height:i.height,width:t.right-t.left});u=new ot(n,new h.Rect([t.left,t.top],[t.width,t.height]),{font:d,fill:{color:g}});c.append(u);ft(t)}function ft(n){function t(t,i){if(t){var r=y/12,u=new f.Path({stroke:{width:r,color:t}});i-=r;u.moveTo(n.left,i).lineTo(n.right,i);c.append(u)}}t(u.underline,n.bottom);t(u["line-through"],n.bottom-n.height/2.7);t(u.overline,n.top)}var v;if(!li()&&(v=e(n),!(t(r(v,"text-indent"))<-500))){var p=s.data,a=0,w=p.search(/\S\s*$/)+1;if(w){var y=r(v,"font-size"),b=r(v,"line-height"),d=[r(v,"font-style"),r(v,"font-variant"),r(v,"font-weight"),y,r(v,"font-family")].join(" ");if(y=t(y),b=t(b),y!==0){var g=r(v,"color"),l=n.ownerDocument.createRange(),nt=r(v,"text-align"),tt=nt=="justify",it=r(v,"white-space"),k=n.getBoundingClientRect().width/y*5;for(k===0&&(k=500);!rt(););return}}}}function ur(n,i,r){var o,h,e,s,c,l;for(r!="auto"?(o=u._stackingContext.group,r=t(r)):(o=i,r=0),h=o.children,e=0;e<h.length;++e)if(h[e]._dom_zIndex!=null&&h[e]._dom_zIndex>r)break;return s=new f.Group,o.insertAt(s,e),s._dom_zIndex=r,o!==i&&u._clipbox&&(c=u._matrix.invert(),l=u._clipbox.transformCopy(c),k(s,f.Path.fromRect(l))),s}function y(n,i){var f=e(n),v=r(f,"counter-reset"),a,h,o,l;if((v&&at(s(v,/^\s+/),si,0),a=r(f,"counter-increment"),a&&at(s(a,/^\s+/),oi,1),!/^(style|script|link|meta|iframe|svg|col|colgroup)$/i.test(n.tagName))&&u._clipbox!=null){var c=t(r(f,"opacity")),y=r(f,"visibility"),p=r(f,"display");c!==0&&y!="hidden"&&p!="none"&&(h=pi(f),l=r(f,"z-index"),(h||c<1)&&l=="auto"&&(l=0),o=ur(n,i,l),c<1&&o.opacity(c*o.opacity()),hi(n,f,o),h?wt(n,function(){it(n.style,"transform","none","important");it(n.style,"transition","none","important");r(f,"position")=="static"&&it(n.style,"position","relative","important");var i=n.getBoundingClientRect(),e=i.left+h.origin[0],s=i.top+h.origin[1],t=[1,0,0,1,-e,-s];t=ui(t,h.matrix);t=ui(t,[1,0,0,1,e,s]);t=d(o,t);u._matrix=u._matrix.multiplyCopy(t);ni(n,o)}):ni(n,o),ci())}}function ui(n,t){var e=n[0],o=n[1],s=n[2],h=n[3],c=n[4],l=n[5],i=t[0],r=t[1],u=t[2],f=t[3],a=t[4],v=t[5];return[e*i+o*u,e*r+o*f,s*i+h*u,s*r+h*f,c*i+l*u+a,c*r+l*f+v]}var f=kendo.drawing,h=kendo.geometry,et=Array.prototype.slice,o=kendo.support.browser,nt=kendo.util.arabicToRoman,p="KENDO-PSEUDO-ELEMENT",w={},u={},ot;u._root=u;ot=f.Text.extend({nodeType:"Text",init:function(n,t,i){f.Text.fn.init.call(this,n,t.getOrigin(),i);this._pdfRect=t},rect:function(){return this._pdfRect},rawBBox:function(){return this._pdfRect}});f.drawDOM=st;st.getFontFaces=lt;var ht=function(){function y(u){function w(){var n=l.exec(u);n&&(u=u.substr(n[1].length))}function s(n){w();var t=n.exec(u);if(t)return u=u.substr(t[1].length),t[1]}function k(){var n=kendo.parseColor(u,!0),i,r;if(n)return u=u.substr(n.match[0].length),n=n.toRGB(),(i=s(h))||(r=s(t)),{color:n,length:i,percent:r}}function d(r){var l,o,h,w=[],a=!1,v,y,p;if(s(f)){for(l=s(c),l?(l=wi(l),s(n)):(o=s(i),o=="to"?o=s(i):o&&/^-/.test(r)&&(a=!0),h=s(i),s(n)),/-moz-/.test(r)&&l==null&&o==null&&(v=s(t),y=s(t),a=!0,v=="0%"?o="left":v=="100%"&&(o="right"),y=="0%"?h="top":y=="100%"&&(h="bottom"),s(n));u&&!s(e);){if(p=k(),!p)break;w.push(p);s(n)}return{type:"linear",angle:l,to:o&&h?o+" "+h:o?o:h?h:null,stops:w,reverse:a}}}function g(){if(s(f)){var n=s(v);return n=n.replace(/^['"]+|["']+$/g,""),s(e),{type:"url",url:n}}}var p=u,y;return b(r,p)?r[p]:((y=s(o))?y=d(y):(y=s(a))&&(y=g()),r[p]=y||{type:"none"})}var o=/^((-webkit-|-moz-|-o-|-ms-)?linear-gradient\s*)\(/,t=/^([-0-9.]+%)/,h=/^([-0-9.]+px)/,i=/^(left|right|top|bottom|to|center)\W/,c=/^([-0-9.]+(deg|grad|rad|turn))/,l=/^(\s+)/,f=/^(\()/,e=/^(\))/,n=/^(,)/,a=/^(url)\(/,v=/^(.*?)\)/,r={},u={};return function(n){return b(u,n)?u[n]:u[n]=s(n).map(y)}}(),s=function(){var n={};return function(t,i){function f(n){return s=n.exec(t.substr(r))}function l(n){return n.replace(/^\s+|\s+$/g,"")}var o;if(i||(i=/^\s*,\s*/),o=t+i,b(n,o))return n[o];for(var h=[],e=0,r=0,c=0,u=!1,s;r<t.length;)!u&&f(/^[\(\[\{]/)?(c++,r++):!u&&f(/^[\)\]\}]/)?(c--,r++):!u&&f(/^[\"\']/)?(u=s[0],r++):u=="'"&&f(/^\\\'/)?r+=2:u=='"'&&f(/^\\\"/)?r+=2:u=="'"&&f(/^\'/)?(u=!1,r++):u=='"'&&f(/^\"/)?(u=!1,r++):f(i)?(!u&&!c&&r>e&&(h.push(l(t.substring(e,r))),e=r+s[0].length),r+=s[0].length):r++;return e<r&&h.push(l(t.substring(e,r))),n[o]=h}}(),ct=function(){var n={};return function(t){var i=n[t],r;return i||((r=/url\((['"]?)([^'")]*?)\1\)\s+format\((['"]?)truetype\3\)/.exec(t))?i=n[t]=r[2]:(r=/url\((['"]?)([^'")]*?\.ttf)\1\)/.exec(t))&&(i=n[t]=r[2])),i}}()})(window.kendo.jQuery,parseFloat,Math)}(),function(){(function(n){var u=n.noop,t=window.kendo,o=t.Class,r=t.util,s=t.animationFrame,f=t.deepExtend,e=o.extend({init:function(n,t){var i=this;i.options=f({},i.options,t);i.element=n},options:{duration:500,easing:"swing"},setup:u,step:u,play:function(){var t=this,u=t.options,o=n.easing[u.easing],i=u.duration,f=u.delay||0,e=r.now()+f,h=e+i;i===0?(t.step(1),t.abort()):setTimeout(function(){var n=function(){if(!t._stopped){var u=r.now(),f=r.limitValue(u-e,0,i),c=f/i,l=o(c,f,0,1,i);t.step(l);u<h?s(n):t.abort()}};n()},f)},abort:function(){this._stopped=!0},destroy:function(){this.abort()}}),i=function(){this._items=[]};i.prototype={register:function(n,t){this._items.push({name:n,type:t})},create:function(n,t){var r=this._items,u,f,i;if(t&&t.type)for(f=t.type.toLowerCase(),i=0;i<r.length;i++)if(r[i].name.toLowerCase()===f){u=r[i];break}if(u)return new u.type(n,t)}};i.current=new i;e.create=function(n,t,r){return i.current.create(n,t,r)};f(t.drawing,{Animation:e,AnimationFactory:i})})(window.kendo.jQuery)}(),function(){}(),function(){(function(n){function tt(i){var r=t.ui.validator.ruleResolvers||{},u={};for(var f in r)n.extend(!0,u,r[f].resolve(i));return u}function it(n){return n.replace(/&amp/g,"&amp;").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&lt;/g,"<").replace(/&gt;/g,">")}function rt(n){return(n=(n+"").split("."),n.length>1)?n[1].length:0}function ut(t){return n.parseHTML?n(n.parseHTML(t)):n(t)}function ft(i,r){for(var f=n(),u,o,e=0,s=i.length;e<s;e++)u=i[e],p.test(u.className)&&(o=u.getAttribute(t.attr("for")),o===r&&(f=f.add(u)));return f}var t=window.kendo,f=t.ui.Widget,i=".kendoValidator",r="k-invalid-msg",p=new RegExp(r,"i"),w="k-invalid",b="k-valid",k=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i,d=/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,u=":input:not(:button,[type=submit],[type=reset],[disabled],[readonly])",o=":checkbox:not([disabled],[readonly])",e="[type=number],[type=range]",s="blur",h="name",c="form",l="novalidate",g=n.proxy,a=function(n,t){return typeof t=="string"&&(t=new RegExp("^(?:"+t+")$")),t.test(n)},v=function(n,t,i){var r=n.val();return n.filter(t).length&&r!==""?a(r,i):!0},nt=function(n,t){return n.length?n[0].attributes[t]!=null:!1},y;t.ui.validator||(t.ui.validator={rules:{},messages:{}});y=f.extend({init:function(i,r){var e=this,s=tt(i),h="["+t.attr("validate")+"!=false]";r=r||{};r.rules=n.extend({},t.ui.validator.rules,s.rules,r.rules);r.messages=n.extend({},t.ui.validator.messages,s.messages,r.messages);f.fn.init.call(e,i,r);e._errorTemplate=t.template(e.options.errorTemplate);e.element.is(c)&&e.element.attr(l,l);e._inputSelector=u+h;e._checkboxSelector=o+h;e._errors={};e._attachEvents();e._isValidated=!1},events:["validate","change"],options:{name:"Validator",errorTemplate:'<span class="k-widget k-tooltip k-tooltip-validation"><span class="k-icon k-warning"> <\/span> #=message#<\/span>',messages:{required:"{0} is required",pattern:"{0} is not valid",min:"{0} should be greater than or equal to {1}",max:"{0} should be smaller than or equal to {1}",step:"{0} is not valid",email:"{0} is not valid email",url:"{0} is not valid URL",date:"{0} is not valid date",dateCompare:"End date should be greater than or equal to the start date"},rules:{required:function(n){var i=n.filter("[type=checkbox]").length&&!n.is(":checked"),t=n.val();return!(nt(n,"required")&&(t===""||!t||i))},pattern:function(n){return n.filter("[type=text],[type=email],[type=url],[type=tel],[type=search],[type=password]").filter("[pattern]").length&&n.val()!==""?a(n.val(),n.attr("pattern")):!0},min:function(n){if(n.filter(e+",["+t.attr("type")+"=number]").filter("[min]").length&&n.val()!==""){var i=parseFloat(n.attr("min"))||0,r=t.parseFloat(n.val());return i<=r}return!0},max:function(n){if(n.filter(e+",["+t.attr("type")+"=number]").filter("[max]").length&&n.val()!==""){var i=parseFloat(n.attr("max"))||0,r=t.parseFloat(n.val());return i>=r}return!0},step:function(n){if(n.filter(e+",["+t.attr("type")+"=number]").filter("[step]").length&&n.val()!==""){var f=parseFloat(n.attr("min"))||0,i=parseFloat(n.attr("step"))||1,o=parseFloat(n.val()),r=rt(i),u;return r?(u=Math.pow(10,r),Math.floor((o-f)*u)%(i*u)/Math.pow(100,r)==0):(o-f)%i==0}return!0},email:function(n){return v(n,"[type=email],["+t.attr("type")+"=email]",k)},url:function(n){return v(n,"[type=url],["+t.attr("type")+"=url]",d)},date:function(n){return n.filter("[type^=date],["+t.attr("type")+"=date]").length&&n.val()!==""?t.parseDate(n.val(),n.attr(t.attr("format")))!==null:!0}},validateOnBlur:!0},destroy:function(){f.fn.destroy.call(this);this.element.off(i)},value:function(){return this._isValidated?this.errors().length===0:!1},_submit:function(n){return this.validate()?!0:(n.stopPropagation(),n.stopImmediatePropagation(),n.preventDefault(),!1)},_checkElement:function(n){var t=this.value();this.validateInput(n);this.value()!==t&&this.trigger("change")},_attachEvents:function(){var t=this;if(t.element.is(c))t.element.on("submit"+i,g(t._submit,t));if(t.options.validateOnBlur)if(t.element.is(u)){t.element.on(s+i,function(){t._checkElement(t.element)});if(t.element.is(o))t.element.on("click"+i,function(){t._checkElement(t.element)})}else{t.element.on(s+i,t._inputSelector,function(){t._checkElement(n(this))});t.element.on("click"+i,t._checkboxSelector,function(){t._checkElement(n(this))})}},validate:function(){var i,t,n=!1,f,e=this.value(),r;if(this._errors={},this.element.is(u))n=this.validateInput(this.element);else{for(r=!1,i=this.element.find(this._inputSelector),t=0,f=i.length;t<f;t++)this.validateInput(i.eq(t))||(r=!0);n=!r}return this.trigger("validate",{valid:n}),e!==n&&this.trigger("change"),n},validateInput:function(i){var f,c;i=n(i);this._isValidated=!0;var u=this,v=u._errorTemplate,l=u._checkValidity(i),o=l.valid,y="."+r,e=i.attr(h)||"",a=u._findMessageContainer(e).add(i.next(y).filter(function(){var i=n(this);return i.filter("["+t.attr("for")+"]").length?i.attr(t.attr("for"))===e:!0})).hide(),s;return i.removeAttr("aria-invalid"),o?delete u._errors[e]:(s=u._extractMessage(i,l.key),u._errors[e]=s,f=ut(v({message:it(s)})),c=a.attr("id"),u._decorateMessageContainer(f,e),c&&f.attr("id",c),a.replaceWith(f).length||f.insertAfter(i),f.show(),i.attr("aria-invalid",!0)),i.toggleClass(w,!o),i.toggleClass(b,o),o},hideMessages:function(){var i=this,t="."+r,n=i.element;n.is(u)?n.next(t).hide():n.find(t).hide()},_findMessageContainer:function(i){for(var f=t.ui.validator.messageLocators,e,r=n(),u=0,o=this.element.length;u<o;u++)r=r.add(ft(this.element[u].getElementsByTagName("*"),i));for(e in f)r=r.add(f[e].locate(this.element,i));return r},_decorateMessageContainer:function(n,i){var u=t.ui.validator.messageLocators,f;n.addClass(r).attr(t.attr("for"),i||"");for(f in u)u[f].decorate(n,i);n.attr("role","alert")},_extractMessage:function(n,i){var u=this,r=u.options.messages[i],f=n.attr(h);return r=t.isFunction(r)?r(n):r,t.format(n.attr(t.attr(i+"-msg"))||n.attr("validationMessage")||n.attr("title")||r||"",f,n.attr(i))},_checkValidity:function(n){var t=this.options.rules;for(var i in t)if(!t[i].call(this,n))return{valid:!1,key:i};return{valid:!0}},errors:function(){var n=[],t=this._errors;for(var i in t)n.push(t[i]);return n}});t.ui.plugin(y)})(window.kendo.jQuery)}(),function(){(function(n){function rt(n,t){var i=n.x.location,r=n.y.location,u=t.x.location,f=t.y.location,e=i-u,o=r-f;return{center:{x:(i+u)/2,y:(r+f)/2},distance:Math.sqrt(e*e+o*o)}}function h(n){var t=[],r=n.originalEvent,f=n.currentTarget,e=0,s,o,u;if(n.api)t.push({id:2,event:n,target:n.target,currentTarget:n.target,location:n,type:"api"});else if(n.type.match(/touch/))for(o=r?r.changedTouches:[],s=o.length;e<s;e++)u=o[e],t.push({location:u,event:n,target:u.target,currentTarget:f,id:u.identifier,type:"touch"});else i.pointers||i.msPointers?t.push({location:r,event:n,target:n.target,currentTarget:f,id:r.pointerId,type:"pointer"}):t.push({id:1,event:n,target:n.target,currentTarget:f,location:n,type:"mouse"});return t}function ft(n){for(var r=t.eventMap.up.split(" "),i=0,u=r.length;i<u;i++)n(r[i])}var t=window.kendo,i=t.support,et=window.document,c=t.Class,l=t.Observable,u=n.now,f=n.extend,a=i.mobileOS,ot=a&&a.android,v=800,y=i.browser.msie?5:0,p="press",w="hold",b="select",k="start",e="move",o="end",d="cancel",s="tap",g="release",st="gesturestart",nt="gesturechange",tt="gestureend",it="gesturetap",ht={api:0,touch:0,mouse:9,pointer:9},ct=!i.touch||i.mouseAndTouchPresent,ut=c.extend({init:function(n,t){var i=this;i.axis=n;i._updateLocationData(t);i.startLocation=i.location;i.velocity=i.delta=0;i.timeStamp=u()},move:function(n){var t=this,i=n["page"+t.axis],r=u(),f=r-t.timeStamp||1;(i||!ot)&&(t.delta=i-t.location,t._updateLocationData(n),t.initialDelta=i-t.startLocation,t.velocity=t.delta/f,t.timeStamp=r)},_updateLocationData:function(n){var t=this,i=t.axis;t.location=n["page"+i];t.client=n["client"+i];t.screen=n["screen"+i]}}),lt=c.extend({init:function(n,t,i){f(this,{x:new ut("X",i.location),y:new ut("Y",i.location),type:i.type,threshold:n.threshold||ht[i.type],userEvents:n,target:t,currentTarget:i.currentTarget,initialTouch:i.target,id:i.id,pressEvent:i,_moved:!1,_finished:!1})},press:function(){this._holdTimeout=setTimeout(n.proxy(this,"_hold"),this.userEvents.minHold);this._trigger(p,this.pressEvent)},_hold:function(){this._trigger(w,this.pressEvent)},move:function(n){var t=this;if(!t._finished){if(t.x.move(n.location),t.y.move(n.location),!t._moved){if(t._withinIgnoreThreshold())return;if(r.current&&r.current!==t.userEvents)return t.dispose();t._start(n)}t._finished||t._trigger(e,n)}},end:function(n){var t=this;(t.endTime=u(),t._finished)||(t._finished=!0,t._trigger(g,n),t._moved?t._trigger(o,n):t._trigger(s,n),clearTimeout(t._holdTimeout),t.dispose())},dispose:function(){var i=this.userEvents,t=i.touches;this._finished=!0;this.pressEvent=null;clearTimeout(this._holdTimeout);t.splice(n.inArray(this,t),1)},skip:function(){this.dispose()},cancel:function(){this.dispose()},isMoved:function(){return this._moved},_start:function(n){clearTimeout(this._holdTimeout);this.startTime=u();this._moved=!0;this._trigger(k,n)},_trigger:function(n,t){var i=this,r=t.event,u={touch:i,x:i.x,y:i.y,target:i.target,event:r};i.userEvents.notify(n,u)&&r.preventDefault()},_withinIgnoreThreshold:function(){var n=this.x.initialDelta,t=this.y.initialDelta;return Math.sqrt(n*n+t*t)<=this.threshold}}),r=l.extend({init:function(r,u){var h=this,a,c=t.guid(),rt,ut;u=u||{};a=h.filter=u.filter;h.threshold=u.threshold||y;h.minHold=u.minHold||v;h.touches=[];h._maxTouches=u.multiTouch?2:1;h.allowSelection=u.allowSelection;h.captureUpIfMoved=u.captureUpIfMoved;h.eventNS=c;r=n(r).handler(h);l.fn.init.call(h);f(h,{element:r,surface:u.global&&ct?n(et.documentElement):n(u.surface||r),stopPropagation:u.stopPropagation,pressed:!1});h.surface.handler(h).on(t.applyEventMap("move",c),"_move").on(t.applyEventMap("up cancel",c),"_end");r.on(t.applyEventMap("down",c),a,"_start");if((i.pointers||i.msPointers)&&(i.browser.version<11?r.css("-ms-touch-action","pinch-zoom double-tap-zoom"):r.css("touch-action","none")),u.preventDragEvent)r.on(t.applyEventMap("dragstart",c),t.preventDefault);r.on(t.applyEventMap("mousedown",c),a,{root:r},"_select");h.captureUpIfMoved&&i.eventCapture&&(rt=h.surface[0],ut=n.proxy(h.preventIfMoving,h),ft(function(n){rt.addEventListener(n,ut,!0)}));h.bind([p,w,s,k,e,o,g,d,st,nt,tt,it,b],u)},preventIfMoving:function(n){this._isMoved()&&n.preventDefault()},destroy:function(){var n=this,t;n._destroyed||(n._destroyed=!0,n.captureUpIfMoved&&i.eventCapture&&(t=n.surface[0],ft(function(i){t.removeEventListener(i,n.preventIfMoving)})),n.element.kendoDestroy(n.eventNS),n.surface.kendoDestroy(n.eventNS),n.element.removeData("handler"),n.surface.removeData("handler"),n._disposeAll(),n.unbind(),delete n.surface,delete n.element,delete n.currentTarget)},capture:function(){r.current=this},cancel:function(){this._disposeAll();this.trigger(d)},notify:function(n,t){var r=this,i=r.touches;if(this._isMultiTouch()){switch(n){case e:n=nt;break;case o:n=tt;break;case s:n=it}f(t,{touches:i},rt(i[0],i[1]))}return this.trigger(n,f(t,{type:n}))},press:function(n,t,i){this._apiCall("_start",n,t,i)},move:function(n,t){this._apiCall("_move",n,t)},end:function(n,t){this._apiCall("_end",n,t)},_isMultiTouch:function(){return this.touches.length>1},_maxTouchesReached:function(){return this.touches.length>=this._maxTouches},_disposeAll:function(){for(var n=this.touches;n.length>0;)n.pop().dispose()},_isMoved:function(){return n.grep(this.touches,function(n){return n.isMoved()}).length},_select:function(n){(!this.allowSelection||this.trigger(b,{event:n}))&&n.preventDefault()},_start:function(t){var i=this,f=0,c=i.filter,e,o=h(t),l=o.length,u,s=t.which;if((!s||!(s>1))&&!i._maxTouchesReached())for(r.current=null,i.currentTarget=t.currentTarget,i.stopPropagation&&t.stopPropagation();f<l;f++){if(i._maxTouchesReached())break;(u=o[f],e=c?n(u.currentTarget):i.element,e.length)&&(u=new lt(i,e,u),i.touches.push(u),u.press(),i._isMultiTouch()&&i.notify("gesturestart",{}))}},_move:function(n){this._eachTouch("move",n)},_end:function(n){this._eachTouch("end",n)},_eachTouch:function(n,t){for(var c=this,e={},o=h(t),s=c.touches,r,u,f,i=0;i<s.length;i++)r=s[i],e[r.id]=r;for(i=0;i<o.length;i++)u=o[i],f=e[u.id],f&&f[n](u)},_apiCall:function(t,i,r,u){this[t]({api:!0,pageX:i,pageY:r,clientX:i,clientY:r,target:n(u||this.element)[0],stopPropagation:n.noop,preventDefault:n.noop})}});r.defaultThreshold=function(n){y=n};r.minHold=function(n){v=n};t.getTouches=h;t.touchDelta=rt;t.UserEvents=r})(window.kendo.jQuery)}(),function(){(function(n,t){function ii(t,i){try{return n.contains(t,i)||t==i}catch(r){return!1}}function w(n,t){return parseInt(n.css(t),10)||0}function ct(n,t){return Math.min(Math.max(n,t.min),t.max)}function lt(n,t){var i=k(n),r=i.left+w(n,"borderLeftWidth")+w(n,"paddingLeft"),u=i.top+w(n,"borderTopWidth")+w(n,"paddingTop"),f=r+n.width()-t.outerWidth(!0),e=u+n.height()-t.outerHeight(!0);return{x:{min:r,max:f},y:{min:u,max:e}}}function ri(i,r,u){for(var o,e,f=0,s=r&&r.length,h=u&&u.length;i&&i.parentNode;){for(f=0;f<s;f++)if(o=r[f],o.element[0]===i)return{target:o,targetElement:i};for(f=0;f<h;f++)if(e=u[f],n.contains(e.element[0],i)&&b.matchesSelector.call(i,e.options.filter))return{target:e,targetElement:i};i=i.parentNode}return t}function pt(n,t){var u=t.options.group,i=n[u],r;if(s.fn.destroy.call(t),i.length>1){for(r=0;r<i.length;r++)if(i[r]==t){i.splice(r,1);break}}else i.length=0,delete n[u]}function kt(n){var i=tt()[0],t,r,u;return n[0]===i?(r=i.scrollTop,u=i.scrollLeft,{top:r,left:u,bottom:r+v.height(),right:u+v.width()}):(t=n.offset(),t.bottom=t.top+n.height(),t.right=t.left+n.width(),t)}function tt(){return n(i.support.browser.chrome?f.body:f.documentElement)}function dt(t){var u=tt(),r;if(!t||t===f.body||t===f.documentElement)return u;for(r=n(t)[0];!i.isScrollable(r)&&r!==f.body;)r=r.parentNode;return r===f.body?u:n(r)}function gt(n,t,i){var u={x:0,y:0},r=50;return n-i.left<r?u.x=-(r-(n-i.left)):i.right-n<r&&(u.x=r-(i.right-n)),t-i.top<r?u.y=-(r-(t-i.top)):i.bottom-t<r&&(u.y=r-(i.bottom-t)),u}var i=window.kendo,b=i.support,f=window.document,v=n(window),ni=i.Class,s=i.ui.Widget,o=i.Observable,ti=i.UserEvents,u=n.proxy,r=n.extend,k=i.getOffset,y={},h={},c={},e,d=i.elementUnderCursor,it="keyup",l="change",rt="dragstart",ut="hold",ft="drag",et="dragend",ot="dragcancel",st="hintDestroyed",g="dragenter",p="dragleave",ht="drop",ui=o.extend({init:function(t,r){var f=this,e=t[0];f.capture=!1;e.addEventListener?(n.each(i.eventMap.down.split(" "),function(){e.addEventListener(this,u(f._press,f),!0)}),n.each(i.eventMap.up.split(" "),function(){e.addEventListener(this,u(f._release,f),!0)})):(n.each(i.eventMap.down.split(" "),function(){e.attachEvent(this,u(f._press,f))}),n.each(i.eventMap.up.split(" "),function(){e.attachEvent(this,u(f._release,f))}));o.fn.init.call(f);f.bind(["press","release"],r||{})},captureNext:function(){this.capture=!0},cancelCapture:function(){this.capture=!1},_press:function(n){var t=this;t.trigger("press");t.capture&&n.preventDefault()},_release:function(n){var t=this;t.trigger("release");t.capture&&(n.preventDefault(),t.cancelCapture())}}),at=o.extend({init:function(t){var i=this;o.fn.init.call(i);i.forcedEnabled=!1;n.extend(i,t);i.scale=1;i.horizontal?(i.measure="offsetWidth",i.scrollSize="scrollWidth",i.axis="x"):(i.measure="offsetHeight",i.scrollSize="scrollHeight",i.axis="y")},makeVirtual:function(){n.extend(this,{virtual:!0,forcedEnabled:!0,_virtualMin:0,_virtualMax:0})},virtualSize:function(n,t){(this._virtualMin!==n||this._virtualMax!==t)&&(this._virtualMin=n,this._virtualMax=t,this.update())},outOfBounds:function(n){return n>this.max||n<this.min},forceEnabled:function(){this.forcedEnabled=!0},getSize:function(){return this.container[0][this.measure]},getTotal:function(){return this.element[0][this.scrollSize]},rescale:function(n){this.scale=n},update:function(n){var t=this,u=t.virtual?t._virtualMax:t.getTotal(),r=u*t.scale,i=t.getSize();(u!==0||t.forcedEnabled)&&(t.max=t.virtual?-t._virtualMin:0,t.size=i,t.total=r,t.min=Math.min(t.max,i-r),t.minScale=i/u,t.centerOffset=(r-i)/2,t.enabled=t.forcedEnabled||r>i,n||t.trigger(l,t))}}),fi=o.extend({init:function(n){var t=this;o.fn.init.call(t);t.x=new at(r({horizontal:!0},n));t.y=new at(r({horizontal:!1},n));t.container=n.container;t.forcedMinScale=n.minScale;t.maxScale=n.maxScale||100;t.bind(l,n)},rescale:function(n){this.x.rescale(n);this.y.rescale(n);this.refresh()},centerCoordinates:function(){return{x:Math.min(0,-this.x.centerOffset),y:Math.min(0,-this.y.centerOffset)}},refresh:function(){var n=this;n.x.update();n.y.update();n.enabled=n.x.enabled||n.y.enabled;n.minScale=n.forcedMinScale||Math.min(n.x.minScale,n.y.minScale);n.fitScale=Math.max(n.x.minScale,n.y.minScale);n.trigger(l)}}),vt=o.extend({init:function(n){var t=this;r(t,n);o.fn.init.call(t)},outOfBounds:function(){return this.dimension.outOfBounds(this.movable[this.axis])},dragMove:function(n){var t=this,i=t.dimension,r=t.axis,u=t.movable,f=u[r]+n;i.enabled&&((f<i.min&&n<0||f>i.max&&n>0)&&(n*=t.resistance),u.translateAxis(r,n),t.trigger(l,t))}}),ei=ni.extend({init:function(t){var i=this,f,e,o,u;r(i,{elastic:!0},t);o=i.elastic?.5:0;u=i.movable;i.x=f=new vt({axis:"x",dimension:i.dimensions.x,resistance:o,movable:u});i.y=e=new vt({axis:"y",dimension:i.dimensions.y,resistance:o,movable:u});i.userEvents.bind(["press","move","end","gesturestart","gesturechange"],{gesturestart:function(n){i.gesture=n;i.offset=i.dimensions.container.offset()},press:function(t){n(t.event.target).closest("a").is("[data-navigate-on-press=true]")&&t.sender.cancel()},gesturechange:function(n){var h=i.gesture,c=h.center,l=n.center,t=n.distance/h.distance,v=i.dimensions.minScale,a=i.dimensions.maxScale,r,o,s;u.scale<=v&&t<1&&(t+=(1-t)*.8);u.scale*t>=a&&(t=a/u.scale);o=u.x+i.offset.left;s=u.y+i.offset.top;r={x:(o-c.x)*t+l.x-o,y:(s-c.y)*t+l.y-s};u.scaleWith(t);f.dragMove(r.x);e.dragMove(r.y);i.dimensions.rescale(u.scale);i.gesture=n;n.preventDefault()},move:function(n){n.event.target.tagName.match(/textarea|input/i)||(f.dimension.enabled||e.dimension.enabled?(f.dragMove(n.x.delta),e.dragMove(n.y.delta),n.preventDefault()):n.touch.skip())},end:function(n){n.preventDefault()}})}}),oi=b.transitions.prefix+"Transform",nt,yt,a,wt,bt;nt=b.hasHW3D?function(n,t,i){return"translate3d("+n+"px,"+t+"px,0) scale("+i+")"}:function(n,t,i){return"translate("+n+"px,"+t+"px) scale("+i+")"};yt=o.extend({init:function(t){var i=this;o.fn.init.call(i);i.element=n(t);i.element[0].style.webkitTransformOrigin="left top";i.x=0;i.y=0;i.scale=1;i._saveCoordinates(nt(i.x,i.y,i.scale))},translateAxis:function(n,t){this[n]+=t;this.refresh()},scaleTo:function(n){this.scale=n;this.refresh()},scaleWith:function(n){this.scale*=n;this.refresh()},translate:function(n){this.x+=n.x;this.y+=n.y;this.refresh()},moveAxis:function(n,t){this[n]=t;this.refresh()},moveTo:function(n){r(this,n);this.refresh()},refresh:function(){var n=this,r=n.x,u=n.y,t;n.round&&(r=Math.round(r),u=Math.round(u));t=nt(r,u,n.scale);t!=n.coordinates&&(i.support.browser.msie&&i.support.browser.version<10?(n.element[0].style.position="absolute",n.element[0].style.left=n.x+"px",n.element[0].style.top=n.y+"px"):n.element[0].style[oi]=t,n._saveCoordinates(t),n.trigger(l))},_saveCoordinates:function(n){this.coordinates=n}});a=s.extend({init:function(n,t){var i=this,r;s.fn.init.call(i,n,t);r=i.options.group;r in h?h[r].push(i):h[r]=[i]},events:[g,p,ht],options:{name:"DropTarget",group:"default"},destroy:function(){pt(h,this)},_trigger:function(n,t){var i=this,u=y[i.options.group];if(u)return i.trigger(n,r({},t.event,{draggable:u,dropTarget:t.dropTarget}))},_over:function(n){this._trigger(g,n)},_out:function(n){this._trigger(p,n)},_drop:function(n){var t=this,i=y[t.options.group];i&&(i.dropped=!t._trigger(ht,n))}});a.destroyGroup=function(n){var t=h[n]||c[n],i;if(t){for(i=0;i<t.length;i++)s.fn.destroy.call(t[i]);t.length=0;delete h[n];delete c[n]}};a._cache=h;wt=a.extend({init:function(n,t){var i=this,r;s.fn.init.call(i,n,t);r=i.options.group;r in c?c[r].push(i):c[r]=[i]},destroy:function(){pt(c,this)},options:{name:"DropTargetArea",group:"default",filter:null}});bt=s.extend({init:function(n,t){var i=this;s.fn.init.call(i,n,t);i._activated=!1;i.userEvents=new ti(i.element,{global:!0,allowSelection:!0,filter:i.options.filter,threshold:i.options.distance,start:u(i._start,i),hold:u(i._hold,i),move:u(i._drag,i),end:u(i._end,i),cancel:u(i._cancel,i),select:u(i._select,i)});i._afterEndHandler=u(i._afterEnd,i);i._captureEscape=u(i._captureEscape,i)},events:[ut,rt,ft,et,ot,st],options:{name:"Draggable",distance:i.support.touch?0:5,group:"default",cursorOffset:null,axis:null,container:null,filter:null,ignore:null,holdToDrag:!1,autoScroll:!1,dropped:!1},cancelHold:function(){this._activated=!1},_captureEscape:function(n){var t=this;n.keyCode===i.keys.ESC&&(t._trigger(ot,{event:n}),t.userEvents.cancel())},_updateHint:function(t){var r=this,i,o=r.options,u=r.boundaries,e=o.axis,f=r.options.cursorOffset;f?i={left:t.x.location+f.left,top:t.y.location+f.top}:(r.hintOffset.left+=t.x.delta,r.hintOffset.top+=t.y.delta,i=n.extend({},r.hintOffset));u&&(i.top=ct(i.top,u.y),i.left=ct(i.left,u.x));e==="x"?delete i.top:e==="y"&&delete i.left;r.hint.css(i)},_shouldIgnoreTarget:function(t){var i=this.options.ignore;return i&&n(t).is(i)},_select:function(n){this._shouldIgnoreTarget(n.event.target)||n.preventDefault()},_start:function(t){var r=this,u=r.options,s=u.container,e=u.hint,o;if(this._shouldIgnoreTarget(t.touch.initialTouch)||u.holdToDrag&&!r._activated){r.userEvents.cancel();return}r.currentTarget=t.target;r.currentTargetOffset=k(r.currentTarget);e&&(r.hint&&r.hint.stop(!0,!0).remove(),r.hint=i.isFunction(e)?n(e.call(r,r.currentTarget)):e,o=k(r.currentTarget),r.hintOffset=o,r.hint.css({position:"absolute",zIndex:2e4,left:o.left,top:o.top}).appendTo(f.body),r.angular("compile",function(){r.hint.removeAttr("ng-repeat");for(var i=n(t.target);!i.data("$$kendoScope")&&i.length;)i=i.parent();return{elements:r.hint.get(),scopeFrom:i.data("$$kendoScope")}}));y[u.group]=r;r.dropped=!1;s&&(r.boundaries=lt(s,r.hint));n(f).on(it,r._captureEscape);r._trigger(rt,t)&&(r.userEvents.cancel(),r._afterEnd());r.userEvents.capture()},_hold:function(n){this.currentTarget=n.target;this._trigger(ut,n)?this.userEvents.cancel():this._activated=!0},_drag:function(t){var u=this,i,f;t.preventDefault();i=this._elementUnderCursor(t);u._withDropTarget(i,function(i,u){if(!i){e&&(e._trigger(p,r(t,{dropTarget:n(e.targetElement)})),e=null);return}if(e){if(u===e.targetElement)return;e._trigger(p,r(t,{dropTarget:n(e.targetElement)}))}i._trigger(g,r(t,{dropTarget:n(u)}));e=r(i,{targetElement:u})});u._trigger(ft,r(t,{dropTarget:e,elementUnderCursor:i}));this.options.autoScroll&&(this._cursorElement!==i&&(this._scrollableParent=dt(i),this._cursorElement=i),this._scrollableParent[0]&&(f=gt(t.x.location,t.y.location,kt(this._scrollableParent)),this._scrollCompenstation=n.extend({},this.hintOffset),this._scrollVelocity=f,f.y===0&&f.x===0?(clearInterval(this._scrollInterval),this._scrollInterval=null):this._scrollInterval||(this._scrollInterval=setInterval(n.proxy(this,"_autoScroll"),50))));u.hint&&u._updateHint(t)},_autoScroll:function(){var n=this._scrollableParent[0],t=this._scrollVelocity,i=this._scrollCompenstation,r,u,e;if(n){e=n===tt()[0];e?(r=f.body.scrollHeight>v.height(),u=f.body.scrollWidth>v.width()):(r=n.offsetHeight<=n.scrollHeight,u=n.offsetWidth<=n.scrollWidth);var h=n.scrollTop+t.y,o=r&&h>0&&h<n.scrollHeight,c=n.scrollLeft+t.x,s=u&&c>0&&c<n.scrollWidth;o&&(n.scrollTop+=t.y);s&&(n.scrollLeft+=t.x);e&&(s||o)&&(o&&(i.top+=t.y),s&&(i.left+=t.x),this.hint.css(i))}},_end:function(t){this._withDropTarget(this._elementUnderCursor(t),function(i,u){i&&(i._drop(r({},t,{dropTarget:n(u)})),e=null)});this._cancel(this._trigger(et,t))},_cancel:function(n){var t=this;t._scrollableParent=null;this._cursorElement=null;clearInterval(this._scrollInterval);t._activated=!1;t.hint&&!t.dropped?setTimeout(function(){t.hint.stop(!0,!0);n?t._afterEndHandler():t.hint.animate(t.currentTargetOffset,"fast",t._afterEndHandler)},0):t._afterEnd()},_trigger:function(n,t){var i=this;return i.trigger(n,r({},t.event,{x:t.x,y:t.y,currentTarget:i.currentTarget,initialTarget:t.touch?t.touch.initialTouch:null,dropTarget:t.dropTarget,elementUnderCursor:t.elementUnderCursor}))},_elementUnderCursor:function(n){var t=d(n),i=this.hint;return i&&ii(i[0],t)&&(i.hide(),t=d(n),t||(t=d(n)),i.show()),t},_withDropTarget:function(n,t){var i,f=this.options.group,r=h[f],u=c[f];(r&&r.length||u&&u.length)&&(i=ri(n,r,u),i?t(i.target,i.targetElement):t())},destroy:function(){var n=this;s.fn.destroy.call(n);n._afterEnd();n.userEvents.destroy();this._scrollableParent=null;this._cursorElement=null;clearInterval(this._scrollInterval);n.currentTarget=null},_afterEnd:function(){var t=this;t.hint&&t.hint.remove();delete y[t.options.group];t.trigger("destroy");t.trigger(st);n(f).off(it,t._captureEscape)}});i.ui.plugin(a);i.ui.plugin(wt);i.ui.plugin(bt);i.TapCapture=ui;i.containerBoundaries=lt;r(i.ui,{Pane:ei,PaneDimensions:fi,Movable:yt});i.ui.Draggable.utils={autoScrollVelocity:gt,scrollableViewPort:kt,findScrollableParent:dt}})(window.kendo.jQuery)}(),function(){(function(n,t){var i=window.kendo,d=i.mobile,l=i.effects,a=d.ui,r=n.proxy,f=n.extend,o=a.Widget,g=i.Class,v=i.ui.Movable,nt=i.ui.Pane,tt=i.ui.PaneDimensions,y=l.Transition,e=l.Animation,u=Math.abs,it=500,rt=.7,ut=.96,ft=10,p=55,w=.5,b=5,h="km-scroller-release",c="km-scroller-refresh",s="change",k="scroll",et=2,ot=e.extend({init:function(n){var t=this;e.fn.init.call(t);f(t,n);t.userEvents.bind("gestureend",r(t.start,t));t.tapCapture.bind("press",r(t.cancel,t))},enabled:function(){return this.movable.scale<this.dimensions.minScale},done:function(){return this.dimensions.minScale-this.movable.scale<.01},tick:function(){var n=this.movable;n.scaleWith(1.1);this.dimensions.rescale(n.scale)},onEnd:function(){var n=this.movable;n.scaleTo(this.dimensions.minScale);this.dimensions.rescale(n.scale)}}),st=e.extend({init:function(n){var t=this;e.fn.init.call(t);f(t,n,{transition:new y({axis:n.axis,movable:n.movable,onEnd:function(){t._end()}})});t.tapCapture.bind("press",function(){t.cancel()});t.userEvents.bind("end",r(t.start,t));t.userEvents.bind("gestureend",r(t.start,t));t.userEvents.bind("tap",r(t.onEnd,t))},onCancel:function(){this.transition.cancel()},freeze:function(n){var t=this;t.cancel();t._moveTo(n)},onEnd:function(){var n=this;n.paneAxis.outOfBounds()?n._snapBack():n._end()},done:function(){return u(this.velocity)<1},start:function(n){var t=this,i;t.dimension.enabled&&(t.paneAxis.outOfBounds()?t._snapBack():(i=n.touch.id===et?0:n.touch[t.axis].velocity,t.velocity=Math.max(Math.min(i*t.velocityMultiplier,p),-p),t.tapCapture.captureNext(),e.fn.start.call(t)))},tick:function(){var n=this,i=n.dimension,r=n.paneAxis.outOfBounds()?w:n.friction,u=n.velocity*=r,t=n.movable[n.axis]+u;!n.elastic&&i.outOfBounds(t)&&(t=Math.max(Math.min(t,i.max),i.min),n.velocity=0);n.movable.moveAxis(n.axis,t)},_end:function(){this.tapCapture.cancelCapture();this.end()},_snapBack:function(){var n=this,t=n.dimension,i=n.movable[n.axis]>t.max?t.max:t.min;n._moveTo(i)},_moveTo:function(n){this.transition.moveTo({location:n,duration:it,ease:y.easeOutExpo})}}),ht=e.extend({init:function(n){var t=this;i.effects.Animation.fn.init.call(this);f(t,n,{origin:{},destination:{},offset:{}})},tick:function(){this._updateCoordinates();this.moveTo(this.origin)},done:function(){return u(this.offset.y)<b&&u(this.offset.x)<b},onEnd:function(){this.moveTo(this.destination);this.callback&&this.callback.call()},setCoordinates:function(n,t){this.offset={};this.origin=n;this.destination=t},setCallback:function(n){n&&i.isFunction(n)?this.callback=n:n=t},_updateCoordinates:function(){this.offset={x:(this.destination.x-this.origin.x)/4,y:(this.destination.y-this.origin.y)/4};this.origin={y:this.origin.y+this.offset.y,x:this.origin.x+this.offset.x}}}),ct=g.extend({init:function(t){var i=this,e=t.axis==="x",u=n('<div class="km-touch-scrollbar km-'+(e?"horizontal":"vertical")+'-scrollbar" />');f(i,t,{element:u,elementSize:0,movable:new v(u),scrollMovable:t.movable,alwaysVisible:t.alwaysVisible,size:e?"width":"height"});i.scrollMovable.bind(s,r(i.refresh,i));i.container.append(u);t.alwaysVisible&&i.show()},refresh:function(){var n=this,f=n.axis,e=n.dimension,r=e.size,o=n.scrollMovable,u=r/e.total,t=Math.round(-o[f]*u),i=Math.round(r*u);u>=1?this.element.css("display","none"):this.element.css("display","");t+i>r?i=r-t:t<0&&(i+=t,t=0);n.elementSize!=i&&(n.element.css(n.size,i+"px"),n.elementSize=i);n.movable.moveAxis(f,t)},show:function(){this.element.css({opacity:rt,visibility:"visible"})},hide:function(){this.alwaysVisible||this.element.css({opacity:0})}}),lt=o.extend({init:function(t,e){var h=this;if(o.fn.init.call(h,t,e),t=h.element,h._native=h.options.useNative&&i.support.hasNativeScrolling,h._native){t.addClass("km-native-scroller").prepend('<div class="km-scroll-header"/>');f(h,{scrollElement:t,fixedContainer:t.children().first()});return}t.css("overflow","hidden").addClass("km-scroll-wrapper").wrapInner('<div class="km-scroll-container"/>').prepend('<div class="km-scroll-header"/>');var y=t.children().eq(1),p=new i.TapCapture(t),l=new v(y),c=new tt({element:y,container:t,forcedEnabled:h.options.zoom}),w=this.options.avoidScrolling,a=new i.UserEvents(t,{allowSelection:!0,preventDragEvent:!0,captureUpIfMoved:!0,multiTouch:h.options.zoom,start:function(t){c.refresh();var i=u(t.x.velocity),r=u(t.y.velocity),f=i*2>=r,e=n.contains(h.fixedContainer[0],t.event.target),o=r*2>=i;!e&&!w(t)&&h.enabled&&(c.x.enabled&&f||c.y.enabled&&o)?a.capture():a.cancel()}}),b=new nt({movable:l,dimensions:c,userEvents:a,elastic:h.options.elastic}),d=new ot({movable:l,dimensions:c,userEvents:a,tapCapture:p}),g=new ht({moveTo:function(n){h.scrollTo(n.x,n.y)}});if(l.bind(s,function(){h.scrollTop=-l.y;h.scrollLeft=-l.x;h.trigger(k,{scrollTop:h.scrollTop,scrollLeft:h.scrollLeft})}),h.options.mousewheelScrolling)t.on("DOMMouseScroll mousewheel",r(this,"_wheelScroll"));f(h,{movable:l,dimensions:c,zoomSnapBack:d,animatedScroller:g,userEvents:a,pane:b,tapCapture:p,pulled:!1,enabled:!0,scrollElement:y,scrollTop:0,scrollLeft:0,fixedContainer:t.children().first()});h._initAxis("x");h._initAxis("y");h._wheelEnd=function(){h._wheel=!1;h.userEvents.end(0,h._wheelY)};c.refresh();h.options.pullToRefresh&&h._initPullToRefresh()},_wheelScroll:function(n){this._wheel||(this._wheel=!0,this._wheelY=0,this.userEvents.press(0,this._wheelY));clearTimeout(this._wheelTimeout);this._wheelTimeout=setTimeout(this._wheelEnd,50);var t=i.wheelDeltaY(n);t&&(this._wheelY+=t,this.userEvents.move(0,this._wheelY));n.preventDefault()},makeVirtual:function(){this.dimensions.y.makeVirtual()},virtualSize:function(n,t){this.dimensions.y.virtualSize(n,t)},height:function(){return this.dimensions.y.size},scrollHeight:function(){return this.scrollElement[0].scrollHeight},scrollWidth:function(){return this.scrollElement[0].scrollWidth},options:{name:"Scroller",zoom:!1,pullOffset:140,visibleScrollHints:!1,elastic:!0,useNative:!1,mousewheelScrolling:!0,avoidScrolling:function(){return!1},pullToRefresh:!1,messages:{pullTemplate:"Pull to refresh",releaseTemplate:"Release to refresh",refreshTemplate:"Refreshing"}},events:["pull",k,"resize"],_resize:function(){this._native||this.contentResized()},setOptions:function(n){var t=this;o.fn.setOptions.call(t,n);n.pullToRefresh&&t._initPullToRefresh()},reset:function(){this._native?this.scrollElement.scrollTop(0):(this.movable.moveTo({x:0,y:0}),this._scale(1))},contentResized:function(){this.dimensions.refresh();this.pane.x.outOfBounds()&&this.movable.moveAxis("x",this.dimensions.x.min);this.pane.y.outOfBounds()&&this.movable.moveAxis("y",this.dimensions.y.min)},zoomOut:function(){var n=this.dimensions;n.refresh();this._scale(n.fitScale);this.movable.moveTo(n.centerCoordinates())},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},scrollTo:function(n,t){this._native?(this.scrollElement.scrollLeft(u(n)),this.scrollElement.scrollTop(u(t))):(this.dimensions.refresh(),this.movable.moveTo({x:n,y:t}))},animatedScrollTo:function(n,t,i){var r,u;this._native?this.scrollTo(n,t):(r={x:this.movable.x,y:this.movable.y},u={x:n,y:t},this.animatedScroller.setCoordinates(r,u),this.animatedScroller.setCallback(i),this.animatedScroller.start())},pullHandled:function(){var n=this;n.refreshHint.removeClass(c);n.hintContainer.html(n.pullTemplate({}));n.yinertia.onEnd();n.xinertia.onEnd();n.userEvents.cancel()},destroy:function(){o.fn.destroy.call(this);this.userEvents&&this.userEvents.destroy()},_scale:function(n){this.dimensions.rescale(n);this.movable.scaleTo(n)},_initPullToRefresh:function(){var n=this;n.dimensions.y.forceEnabled();n.pullTemplate=i.template(n.options.messages.pullTemplate);n.releaseTemplate=i.template(n.options.messages.releaseTemplate);n.refreshTemplate=i.template(n.options.messages.refreshTemplate);n.scrollElement.prepend('<span class="km-scroller-pull"><span class="km-icon"><\/span><span class="km-loading-left"><\/span><span class="km-loading-right"><\/span><span class="km-template">'+n.pullTemplate({})+"<\/span><\/span>");n.refreshHint=n.scrollElement.children().first();n.hintContainer=n.refreshHint.children(".km-template");n.pane.y.bind("change",r(n._paneChange,n));n.userEvents.bind("end",r(n._dragEnd,n))},_dragEnd:function(){var n=this;n.pulled&&(n.pulled=!1,n.refreshHint.removeClass(h).addClass(c),n.hintContainer.html(n.refreshTemplate({})),n.yinertia.freeze(n.options.pullOffset/2),n.trigger("pull"))},_paneChange:function(){var n=this;n.movable.y/w>n.options.pullOffset?n.pulled||(n.pulled=!0,n.refreshHint.removeClass(c).addClass(h),n.hintContainer.html(n.releaseTemplate({}))):n.pulled&&(n.pulled=!1,n.refreshHint.removeClass(h),n.hintContainer.html(n.pullTemplate({})))},_initAxis:function(n){var t=this,u=t.movable,i=t.dimensions[n],e=t.tapCapture,f=t.pane[n],r=new ct({axis:n,movable:u,dimension:i,container:t.element,alwaysVisible:t.options.visibleScrollHints});i.bind(s,function(){r.refresh()});f.bind(s,function(){r.show()});t[n+"inertia"]=new st({axis:n,paneAxis:f,movable:u,tapCapture:e,userEvents:t.userEvents,dimension:i,elastic:t.options.elastic,friction:t.options.friction||ut,velocityMultiplier:t.options.velocityMultiplier||ft,end:function(){r.hide();t.trigger("scrollEnd",{axis:n,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft})}})}});a.plugin(lt)})(window.kendo.jQuery)}(),function(){(function(n){function s(n){return n.position().top+3}var t=window.kendo,f=t.ui.Widget,u=n.proxy,i=!1,e=".kendoGroupable",h="change",c=t.template('<div class="k-group-indicator" data-#=data.ns#field="${data.field}" data-#=data.ns#title="${data.title || ""}" data-#=data.ns#dir="${data.dir || "asc"}"><a href="\\#" class="k-link"><span class="k-icon k-si-arrow-${(data.dir || "asc") == "asc" ? "n" : "s"}">(sorted ${(data.dir || "asc") == "asc" ? "ascending": "descending"})<\/span>${data.title ? data.title: data.field}<\/a><a class="k-button k-button-icon k-button-bare"><span class="k-icon k-group-delete"><\/span><\/a><\/div>',{useWithBlock:!1}),o=function(i){return n('<div class="k-header k-drag-clue" />').css({width:i.width(),paddingLeft:i.css("paddingLeft"),paddingRight:i.css("paddingRight"),lineHeight:i.height()+"px",paddingTop:i.css("paddingTop"),paddingBottom:i.css("paddingBottom")}).html(i.attr(t.attr("title"))||i.attr(t.attr("field"))).prepend('<span class="k-icon k-drag-status k-denied" />')},r=n('<div class="k-grouping-dropclue"/>'),l=f.extend({init:function(c,l){var a=this,b=t.guid(),p=u(a._intializePositions,a),v,w,y=a._dropCuePositions=[];f.fn.init.call(a,c,l);i=t.support.isRtl(c);w=i?"right":"left";a.draggable=v=a.options.draggable||new t.ui.Draggable(a.element,{filter:a.options.draggableElements,hint:o,group:b});a.groupContainer=n(a.options.groupContainer,a.element).kendoDropTarget({group:v.options.group,dragenter:function(n){a._canDrag(n.draggable.currentTarget)&&(n.draggable.hint.find(".k-drag-status").removeClass("k-denied").addClass("k-add"),r.css("top",s(a.groupContainer)).css(w,0).appendTo(a.groupContainer))},dragleave:function(n){n.draggable.hint.find(".k-drag-status").removeClass("k-add").addClass("k-denied");r.remove()},drop:function(u){var e=u.draggable.currentTarget,o=e.attr(t.attr("field")),s=e.attr(t.attr("title")),h=a.indicator(o),l=a._dropCuePositions,c=l[l.length-1],f;(e.hasClass("k-group-indicator")||a._canDrag(e))&&(c?(f=a._dropCuePosition(t.getOffset(r).left+parseInt(c.element.css("marginLeft"),10)*(i?-1:1)+parseInt(c.element.css("marginRight"),10)),f&&a._canDrop(n(h),f.element,f.left)&&(f.before?f.element.before(h||a.buildIndicator(o,s)):f.element.after(h||a.buildIndicator(o,s)),a._change())):(a.groupContainer.append(a.buildIndicator(o,s)),a._change()))}}).kendoDraggable({filter:"div.k-group-indicator",hint:o,group:v.options.group,dragcancel:u(a._dragCancel,a),dragstart:function(n){var t=n.currentTarget,f=parseInt(t.css("marginLeft"),10),u=t.position(),e=i?u.left-f:u.left+t.outerWidth();p();r.css({top:s(a.groupContainer),left:e}).appendTo(a.groupContainer);this.hint.find(".k-drag-status").removeClass("k-denied").addClass("k-add")},dragend:function(){a._dragEnd(this)},drag:u(a._drag,a)}).on("click"+e,".k-button",function(t){t.preventDefault();a._removeIndicator(n(this).parent())}).on("click"+e,".k-link",function(i){var r=n(this).parent(),u=a.buildIndicator(r.attr(t.attr("field")),r.attr(t.attr("title")),r.attr(t.attr("dir"))=="asc"?"desc":"asc");r.before(u).remove();a._change();i.preventDefault()});v.bind(["dragend","dragcancel","dragstart","drag"],{dragend:function(){a._dragEnd(this)},dragcancel:u(a._dragCancel,a),dragstart:function(n){var t,i,r;if(!a.options.allowDrag&&!a._canDrag(n.currentTarget)){n.preventDefault();return}p();y.length?(t=y[y.length-1].element,i=parseInt(t.css("marginRight"),10),r=t.position().left+t.outerWidth()+i):r=0},drag:u(a._drag,a)});a.dataSource=a.options.dataSource;a.dataSource&&a._refreshHandler?a.dataSource.unbind(h,a._refreshHandler):a._refreshHandler=u(a.refresh,a);a.dataSource&&(a.dataSource.bind("change",a._refreshHandler),a.refresh())},refresh:function(){var i=this,r=i.dataSource;i.groupContainer&&i.groupContainer.empty().append(n.map(r.group()||[],function(r){var u=r.field,f=t.attr("field"),e=i.element.find(i.options.filter).filter(function(){return n(this).attr(f)===u});return i.buildIndicator(r.field,e.attr(t.attr("title")),r.dir)}).join(""));i._invalidateGroupContainer()},destroy:function(){var n=this;f.fn.destroy.call(n);n.groupContainer.off(e);n.groupContainer.data("kendoDropTarget")&&n.groupContainer.data("kendoDropTarget").destroy();n.groupContainer.data("kendoDraggable")&&n.groupContainer.data("kendoDraggable").destroy();n.options.draggable||n.draggable.destroy();n.dataSource&&n._refreshHandler&&(n.dataSource.unbind("change",n._refreshHandler),n._refreshHandler=null);n.groupContainer=n.element=n.draggable=null},options:{name:"Groupable",filter:"th",draggableElements:"th",messages:{empty:"Drag a column header and drop it here to group by that column"}},indicator:function(i){var r=n(".k-group-indicator",this.groupContainer);return n.grep(r,function(r){return n(r).attr(t.attr("field"))===i})[0]},buildIndicator:function(n,i,r){return c({field:n.replace(/"/g,"'"),dir:r,title:i,ns:t.ns})},descriptors:function(){var r=this,s=n(".k-group-indicator",r.groupContainer),f,u,e,i,o;return f=r.element.find(r.options.filter).map(function(){var f=n(this),r=f.attr(t.attr("aggregates")),e=f.attr(t.attr("field"));if(r&&r!=="")for(u=r.split(","),r=[],i=0,o=u.length;i<o;i++)r.push({field:e,aggregate:u[i]});return r}).toArray(),n.map(s,function(i){return i=n(i),e=i.attr(t.attr("field")),{field:e,dir:i.attr(t.attr("dir")),aggregates:f||[]}})},_removeIndicator:function(n){var t=this;n.remove();t._invalidateGroupContainer();t._change()},_change:function(){var n=this;n.dataSource&&n.dataSource.group(n.descriptors())},_dropCuePosition:function(t){var f=this._dropCuePositions;if(r.is(":visible")&&f.length!==0){t=Math.ceil(t);var u=f[f.length-1],s=u.left,h=u.right,e=parseInt(u.element.css("marginLeft"),10),o=parseInt(u.element.css("marginRight"),10);return t>=h&&!i||t<s&&i?t={left:u.element.position().left+(i?-e:u.element.outerWidth()+o),element:u.element,before:!1}:(t=n.grep(f,function(n){return n.left<=t&&t<=n.right||i&&t>n.right})[0],t&&(t={left:i?t.element.position().left+t.element.outerWidth()+o:t.element.position().left-e,element:t.element,before:!0})),t}},_drag:function(n){var t=this._dropCuePosition(n.x.location);t&&r.css({left:t.left,right:"auto"})},_canDrag:function(n){var i=n.attr(t.attr("field"));return n.attr(t.attr("groupable"))!="false"&&i&&(n.hasClass("k-group-indicator")||!this.indicator(i))},_canDrop:function(n,t,r){var u=n.next();return n[0]!==t[0]&&(!u[0]||t[0]!==u[0]||!i&&r>u.position().left||i&&r<u.position().left)},_dragEnd:function(i){var r=this,f=i.currentTarget.attr(t.attr("field")),u=r.indicator(f);i!==r.options.draggable&&!i.dropped&&u&&r._removeIndicator(n(u));r._dragCancel()},_dragCancel:function(){r.remove();this._dropCuePositions=[]},_intializePositions:function(){var r=this,u=n(".k-group-indicator",r.groupContainer),i;r._dropCuePositions=n.map(u,function(r){return r=n(r),i=t.getOffset(r).left,{left:parseInt(i,10),right:parseInt(i+r.outerWidth(),10),element:r}})},_invalidateGroupContainer:function(){var n=this.groupContainer;n&&n.is(":empty")&&n.html(this.options.messages.empty)}});t.ui.plugin(l)})(window.kendo.jQuery)}(),function(){(function(n){function f(t,i){t=n(t);i?t.find(".k-drag-status").removeClass("k-add").addClass("k-denied"):t.find(".k-drag-status").removeClass("k-denied").addClass("k-add")}var t=window.kendo,i=t.getOffset,r=t.ui.Widget,u="change",e="k-reorderable",o=r.extend({init:function(o,s){var h=this,c,l=t.guid()+"-reorderable";r.fn.init.call(h,o,s);o=h.element.addClass(e);s=h.options;h.draggable=c=s.draggable||new t.ui.Draggable(o,{group:l,autoScroll:!0,filter:s.filter,hint:s.hint});h.reorderDropCue=n('<div class="k-reorder-cue"><div class="k-icon k-i-arrow-s"><\/div><div class="k-icon k-i-arrow-n"><\/div><\/div>');o.find(c.options.filter).kendoDropTarget({group:c.options.group,dragenter:function(n){var t,r,u,e;h._draggable&&(t=this.element,u=!h._dropTargetAllowed(t)||h._isLastDraggable(),f(n.draggable.hint,u),u||(r=i(t),e=r.left,s.inSameContainer&&!s.inSameContainer({source:t,target:h._draggable,sourceIndex:h._index(t),targetIndex:h._index(h._draggable)})?h._dropTarget=t:h._index(t)>h._index(h._draggable)&&(e+=t.outerWidth()),h.reorderDropCue.css({height:t.outerHeight(),top:r.top,left:e}).appendTo(document.body)))},dragleave:function(n){f(n.draggable.hint,!0);h.reorderDropCue.remove();h._dropTarget=null},drop:function(){if(h._dropTarget=null,h._draggable){var n=this.element,t=h._draggable;h._dropTargetAllowed(n)&&!h._isLastDraggable()&&h.trigger(u,{element:h._draggable,target:n,oldIndex:h._index(t),newIndex:h._index(n),position:i(h.reorderDropCue).left>i(n).left?"after":"before"})}}});c.bind(["dragcancel","dragend","dragstart","drag"],{dragcancel:function(){h.reorderDropCue.remove();h._draggable=null;h._elements=null},dragend:function(){h.reorderDropCue.remove();h._draggable=null;h._elements=null},dragstart:function(n){h._draggable=n.currentTarget;h._elements=h.element.find(h.draggable.options.filter)},drag:function(n){if(h._dropTarget&&!this.hint.find(".k-drag-status").hasClass("k-denied")){var t=i(h._dropTarget).left,r=h._dropTarget.outerWidth();n.pageX>t+r/2?h.reorderDropCue.css({left:t+r}):h.reorderDropCue.css({left:t})}}})},options:{name:"Reorderable",filter:"*"},events:[u],_isLastDraggable:function(){var r=this.options.inSameContainer,t=this._draggable[0],u=this._elements.get(),i=!1,n;if(!r)return!1;while(!i&&u.length>0)n=u.pop(),i=t!==n&&r({source:t,target:n,sourceIndex:this._index(t),targetIndex:this._index(n)});return!i},_dropTargetAllowed:function(n){var i=this.options.inSameContainer,r=this.options.dragOverContainers,t=this._draggable;return t[0]===n[0]?!1:!i||!r?!0:i({source:t,target:n,sourceIndex:this._index(t),targetIndex:this._index(n)})?!0:r(this._index(t),this._index(n))},_index:function(n){return this._elements.index(n)},destroy:function(){var t=this;r.fn.destroy.call(t);t.element.find(t.draggable.options.filter).each(function(){var t=n(this);t.data("kendoDropTarget")&&t.data("kendoDropTarget").destroy()});t.draggable&&(t.draggable.destroy(),t.draggable.element=t.draggable=null);t.elements=t.reorderDropCue=t._elements=t._draggable=null}});t.ui.plugin(o)})(window.kendo.jQuery)}(),function(){(function(n,t){var u=window.kendo,o=u.ui,f=o.Widget,r=n.proxy,e=u.isFunction,s=n.extend,i="horizontal",h="vertical",c="start",l="resize",a="resizeend",v=f.extend({init:function(n,t){var u=this;f.fn.init.call(u,n,t);u.orientation=u.options.orientation.toLowerCase()!=h?i:h;u._positionMouse=u.orientation==i?"x":"y";u._position=u.orientation==i?"left":"top";u._sizingDom=u.orientation==i?"outerWidth":"outerHeight";u.draggable=new o.Draggable(n,{distance:1,filter:t.handle,drag:r(u._resize,u),dragcancel:r(u._cancel,u),dragstart:r(u._start,u),dragend:r(u._stop,u)});u.userEvents=u.draggable.userEvents},events:[l,a,c],options:{name:"Resizable",orientation:i},resize:function(){},_max:function(n){var i=this,u=i.hint?i.hint[i._sizingDom]():0,r=i.options.max;return e(r)?r(n):r!==t?i._initialElementPosition+r-u:r},_min:function(n){var r=this,i=r.options.min;return e(i)?i(n):i!==t?r._initialElementPosition+i:i},_start:function(t){var i=this,r=i.options.hint,u=n(t.currentTarget);i._initialElementPosition=u.position()[i._position];i._initialMousePosition=t[i._positionMouse].startLocation;r&&(i.hint=e(r)?n(r(u)):r,i.hint.css({position:"absolute"}).css(i._position,i._initialElementPosition).appendTo(i.element));i.trigger(c,t);i._maxPosition=i._max(t);i._minPosition=i._min(t);n(document.body).css("cursor",u.css("cursor"))},_resize:function(n){var i=this,u=i._maxPosition,f=i._minPosition,e=i._initialElementPosition+(n[i._positionMouse].location-i._initialMousePosition),r;r=f!==t?Math.max(f,e):e;i.position=r=u!==t?Math.min(u,r):r;i.hint&&i.hint.toggleClass(i.options.invalidClass||"",r==u||r==f).css(i._position,r);i.resizing=!0;i.trigger(l,s(n,{position:r}))},_stop:function(t){var i=this;i.hint&&i.hint.remove();i.resizing=!1;i.trigger(a,s(t,{position:i.position}));n(document.body).css("cursor","")},_cancel:function(n){var i=this;i.hint&&(i.position=t,i.hint.css(i._position,i._initialElementPosition),i._stop(n))},destroy:function(){var n=this;f.fn.destroy.call(n);n.draggable&&n.draggable.destroy()},press:function(n){if(n){var t=n.position(),i=this;i.userEvents.press(t.left,t.top,n[0]);i.targetPosition=t;i.target=n}},move:function(n){var i=this,f=i._position,r=i.targetPosition,u=i.position;u===t&&(u=r[f]);r[f]=u+n;i.userEvents.move(r.left,r.top)},end:function(){this.userEvents.end();this.target=this.position=t}});u.ui.plugin(v)})(window.kendo.jQuery)}(),function(){(function(n){function v(t,i){try{return n.contains(t,i)||t==i}catch(r){return!1}}function y(n){return n.clone()}function p(n){return n.clone().removeAttr("id").css("visibility","hidden")}var t=window.kendo,r=t.ui.Widget,e="start",o="beforeMove",s="move",i="end",u="change",h="cancel",c="sort",l="remove",a="receive",f=-1,w=r.extend({init:function(n,t){var i=this;r.fn.init.call(i,n,t);i.options.placeholder||(i.options.placeholder=p);i.options.hint||(i.options.hint=y);i.draggable=i._createDraggable()},events:[e,o,s,i,u,h],options:{name:"Sortable",hint:null,placeholder:null,filter:">*",holdToDrag:!1,disabled:null,container:null,connectWith:null,handler:null,cursorOffset:null,axis:null,ignore:null,autoScroll:!1,cursor:"auto",moveOnDragEnter:!1},destroy:function(){this.draggable.destroy();r.fn.destroy.call(this)},_createDraggable:function(){var r=this,u=r.element,i=r.options;return new t.ui.Draggable(u,{filter:i.filter,hint:t.isFunction(i.hint)?i.hint:n(i.hint),holdToDrag:i.holdToDrag,container:i.container?n(i.container):null,cursorOffset:i.cursorOffset,axis:i.axis,ignore:i.ignore,autoScroll:i.autoScroll,dragstart:n.proxy(r._dragstart,r),dragcancel:n.proxy(r._dragcancel,r),drag:n.proxy(r._drag,r),dragend:n.proxy(r._dragend,r)})},_dragstart:function(i){var r=this.draggedElement=i.currentTarget,f=this.options.disabled,o=this.options.handler,u=this.options.placeholder,s=this.placeholder=t.isFunction(u)?n(u.call(this,r)):n(u);f&&r.is(f)?i.preventDefault():o&&!n(i.initialTarget).is(o)?i.preventDefault():this.trigger(e,{item:r,draggableEvent:i})?i.preventDefault():(r.css("display","none"),r.before(s),this._setCursor())},_dragcancel:function(){this._cancel();this.trigger(h,{item:this.draggedElement});this._resetCursor()},_drag:function(t){var v=this.draggedElement,i=this._findTarget(t),c,l={left:t.x.location,top:t.y.location},f,e={x:t.x.delta,y:t.y.delta},r,u,a,s=this.options.axis,h=this.options.moveOnDragEnter,o={item:v,list:this,draggableEvent:t};if(s==="x"||s==="y"){this._movementByAxis(s,l,e[s],o);return}if(i){if(c=this._getElementCenter(i.element),f={left:Math.round(l.left-c.left),top:Math.round(l.top-c.top)},n.extend(o,{target:i.element}),i.appendToBottom){this._movePlaceholder(i,null,o);return}if(i.appendAfterHidden&&this._movePlaceholder(i,"next",o),this._isFloating(i.element)?e.x<0&&(h||f.left<0)?r="prev":e.x>0&&(h||f.left>0)&&(r="next"):e.y<0&&(h||f.top<0)?r="prev":e.y>0&&(h||f.top>0)&&(r="next"),r){for(a=r==="prev"?jQuery.fn.prev:jQuery.fn.next,u=a.call(i.element);u.length&&!u.is(":visible");)u=a.call(u);u[0]!=this.placeholder[0]&&this._movePlaceholder(i,r,o)}}},_dragend:function(t){var s=this.placeholder,r=this.draggedElement,v=this.indexOf(r),y=this.indexOf(s),w=this.options.connectWith,o,p,e,h;if(this._resetCursor(),e={action:c,item:r,oldIndex:v,newIndex:y,draggableEvent:t},y>=0?p=this.trigger(i,e):(o=s.parents(w).getKendoSortable(),e.action=l,h=n.extend({},e,{action:a,oldIndex:f,newIndex:o.indexOf(s)}),p=!(!this.trigger(i,e)&&!o.trigger(i,h))),p||y===v){this._cancel();return}s.replaceWith(r);r.show();this.draggable.dropped=!0;e={action:this.indexOf(r)!=f?c:l,item:r,oldIndex:v,newIndex:this.indexOf(r),draggableEvent:t};this.trigger(u,e);o&&(h=n.extend({},e,{action:a,oldIndex:f,newIndex:o.indexOf(r)}),o.trigger(u,h))},_findTarget:function(t){var i=this._findElementUnderCursor(t),u,f=this.options.connectWith,r;return n.contains(this.element[0],i)?(u=this.items(),r=u.filter(i)[0]||u.has(i)[0],r?{element:n(r),sortable:this}:null):this.element[0]==i&&this._isEmpty()?{element:this.element,sortable:this,appendToBottom:!0}:this.element[0]==i&&this._isLastHidden()?(r=this.items().eq(0),{element:r,sortable:this,appendAfterHidden:!0}):f?this._searchConnectedTargets(i,t):void 0},_findElementUnderCursor:function(n){var i=t.elementUnderCursor(n),r=n.sender;return v(r.hint[0],i)&&(r.hint.hide(),i=t.elementUnderCursor(n),i||(i=t.elementUnderCursor(n)),r.hint.show()),i},_searchConnectedTargets:function(t,i){for(var f=n(this.options.connectWith),r,o,e,u=0;u<f.length;u++)if(r=f.eq(u).getKendoSortable(),n.contains(f[u],t)){if(r)return o=r.items(),e=o.filter(t)[0]||o.has(t)[0],e?(r.placeholder=this.placeholder,{element:n(e),sortable:r}):null}else if(f[u]==t){if(r&&r._isEmpty())return{element:f.eq(u),sortable:r,appendToBottom:!0};if(this._isCursorAfterLast(r,i))return e=r.items().last(),{element:e,sortable:r}}},_isCursorAfterLast:function(n,i){var u=n.items().last(),f={left:i.x.location,top:i.y.location},r,e;return r=t.getOffset(u),r.top+=u.outerHeight(),r.left+=u.outerWidth(),e=this._isFloating(u)?r.left-f.left:r.top-f.top,e<0?!0:!1},_movementByAxis:function(t,i,r,u){var o=t==="x"?i.left:i.top,f=r<0?this.placeholder.prev():this.placeholder.next(),e;f.length&&!f.is(":visible")&&(f=r<0?f.prev():f.next());n.extend(u,{target:f});e=this._getElementCenter(f);e&&(e=t==="x"?e.left:e.top);f.length&&r<0&&o-e<0?this._movePlaceholder({element:f,sortable:this},"prev",u):f.length&&r>0&&o-e>0&&this._movePlaceholder({element:f,sortable:this},"next",u)},_movePlaceholder:function(n,t,i){var r=this.placeholder;n.sortable.trigger(o,i)||(t?t==="prev"?n.element.before(r):t==="next"&&n.element.after(r):n.element.append(r),n.sortable.trigger(s,i))},_setCursor:function(){var t=this.options.cursor,i;t&&t!=="auto"&&(i=n(document.body),this._originalCursorType=i.css("cursor"),i.css({cursor:t}),this._cursorStylesheet||(this._cursorStylesheet=n("<style>* { cursor: "+t+" !important; }<\/style>")),this._cursorStylesheet.appendTo(i))},_resetCursor:function(){this._originalCursorType&&(n(document.body).css("cursor",this._originalCursorType),this._originalCursorType=null,this._cursorStylesheet.remove())},_getElementCenter:function(n){var i=n.length?t.getOffset(n):null;return i&&(i.top+=n.outerHeight()/2,i.left+=n.outerWidth()/2),i},_isFloating:function(n){return/left|right/.test(n.css("float"))||/inline|table-cell/.test(n.css("display"))},_cancel:function(){this.draggedElement.show();this.placeholder.remove()},_items:function(){var n=this.options.filter;return n?this.element.find(n):this.element.children()},indexOf:function(n){var i=this._items(),t=this.placeholder,r=this.draggedElement;return t&&n[0]==t[0]?i.not(r).index(n):i.not(t).index(n)},items:function(){var t=this.placeholder,n=this._items();return t&&(n=n.not(t)),n},_isEmpty:function(){return!this.items().length},_isLastHidden:function(){return this.items().length===1&&this.items().is(":hidden")}});t.ui.plugin(w)})(window.kendo.jQuery)}(),function(){(function(n){function w(n,t){if(!n.is(":visible"))return!1;var i=r.getOffset(n),u=t.left+t.width,f=t.top+t.height;return i.right=i.left+n.outerWidth(),i.bottom=i.top+n.outerHeight(),!(i.left>u||i.right<t.left||i.top>f||i.bottom<t.top)}var r=window.kendo,s=r.ui.Widget,u=n.proxy,c=Math.abs,l="aria-selected",t="k-state-selected",f="k-state-selecting",e="k-selectable",o="change",p=".kendoSelectable",i="k-state-unselecting",a="input,a,textarea,.k-multiselect-wrap,select,button,a.k-button>.k-icon,button.k-button>.k-icon,span.k-icon.k-i-expand,span.k-icon.k-i-collapse",v=r.support.browser.msie,y=!1,h;(function(n){(function(){n('<div class="parent"><span /><\/div>').on("click",">*",function(){y=!0}).find("span").click().end().off()})()})(n);h=s.extend({init:function(t,i){var f=this,o;s.fn.init.call(f,t,i);f._marquee=n("<div class='k-marquee'><div class='k-marquee-color'><\/div><\/div>");f._lastActive=null;f.element.addClass(e);f.relatedTarget=f.options.relatedTarget;o=f.options.multiple;this.options.aria&&o&&f.element.attr("aria-multiselectable",!0);f.userEvents=new r.UserEvents(f.element,{global:!0,allowSelection:!0,filter:(y?"":"."+e+" ")+f.options.filter,tap:u(f._tap,f)});o&&f.userEvents.bind("start",u(f._start,f)).bind("move",u(f._move,f)).bind("end",u(f._end,f)).bind("select",u(f._select,f))},events:[o],options:{name:"Selectable",filter:">*",multiple:!1,relatedTarget:n.noop},_isElement:function(n){var i=this.element,t,u=i.length,r=!1;for(n=n[0],t=0;t<u;t++)if(i[t]===n){r=!0;break}return r},_tap:function(i){var u=n(i.target),r=this,f=i.event.ctrlKey||i.event.metaKey,s=r.options.multiple,a=s&&i.event.shiftKey,h,c=i.event.which,l=i.event.button;!r._isElement(u.closest("."+e))||c&&c==3||l&&l==2||this._allowSelection(i.event.target)&&(h=u.hasClass(t),s&&f||r.clear(),u=u.add(r.relatedTarget(u)),a?r.selectRange(r._firstSelectee(),u):(h&&f?(r._unselect(u),r._notify(o)):r.value(u),r._lastActive=r._downTarget=u))},_start:function(r){var u=this,f=n(r.target),h=f.hasClass(t),o,s=r.event.ctrlKey||r.event.metaKey;if(this._allowSelection(r.event.target)){if(u._downTarget=f,!u._isElement(f.closest("."+e))){u.userEvents.cancel();return}u.options.useAllItems?u._items=u.element.find(u.options.filter):(o=f.closest(u.element),u._items=o.find(u.options.filter));r.sender.capture();u._marquee.appendTo(document.body).css({left:r.x.client+1,top:r.y.client+1,width:0,height:0});s||u.clear();f=f.add(u.relatedTarget(f));h&&(u._selectElement(f,!0),s&&f.addClass(i))}},_move:function(n){var t=this,i={left:n.x.startLocation>n.x.location?n.x.location:n.x.startLocation,top:n.y.startLocation>n.y.location?n.y.location:n.y.startLocation,width:c(n.x.initialDelta),height:c(n.y.initialDelta)};t._marquee.css(i);t._invalidateSelectables(i,n.event.ctrlKey||n.event.metaKey);n.preventDefault()},_end:function(){var n=this,t;n._marquee.remove();n._unselect(n.element.find(n.options.filter+"."+i)).removeClass(i);t=n.element.find(n.options.filter+"."+f);t=t.add(n.relatedTarget(t));n.value(t);n._lastActive=n._downTarget;n._items=null},_invalidateSelectables:function(n,r){for(var c=this._downTarget[0],h=this._items,e,u,o=0,s=h.length;o<s;o++)u=h.eq(o),e=u.add(this.relatedTarget(u)),w(u,n)?u.hasClass(t)?r&&c!==u[0]&&e.removeClass(t).addClass(i):u.hasClass(f)||u.hasClass(i)||e.addClass(f):u.hasClass(f)?e.removeClass(f):r&&u.hasClass(i)&&e.removeClass(i).addClass(t)},value:function(n){var i=this,r=u(i._selectElement,i);if(n){n.each(function(){r(this)});i._notify(o);return}return i.element.find(i.options.filter+"."+t)},_firstSelectee:function(){var n=this,t;return n._lastActive!==null?n._lastActive:(t=n.value(),t.length>0?t[0]:n.element.find(n.options.filter)[0])},_selectElement:function(i,r){var u=n(i),e=!r&&this._notify("select",{element:i});u.removeClass(f);e||(u.addClass(t),this.options.aria&&u.attr(l,!0))},_notify:function(n,t){return t=t||{},this.trigger(n,t)},_unselect:function(n){return n.removeClass(t),this.options.aria&&n.attr(l,!1),n},_select:function(t){this._allowSelection(t.event.target)&&(v&&(!v||n(r._activeElement()).is(a))||t.preventDefault())},_allowSelection:function(t){return n(t).is(a)?(this.userEvents.cancel(),this._downTarget=null,!1):!0},resetTouchEvents:function(){this.userEvents.cancel()},clear:function(){var n=this.element.find(this.options.filter+"."+t);this._unselect(n)},selectRange:function(t,i){var r=this,f,e,u;for(r.clear(),r.element.length>1&&(u=r.options.continuousItems()),u&&u.length||(u=r.element.find(r.options.filter)),t=n.inArray(n(t)[0],u),i=n.inArray(n(i)[0],u),t>i&&(e=t,t=i,i=e),r.options.useAllItems||(i+=r.element.length-1),f=t;f<=i;f++)r._selectElement(u[f]);r._notify(o)},destroy:function(){var n=this;s.fn.destroy.call(n);n.element.off(p);n.userEvents.destroy();n._marquee=n._lastActive=n.element=n.userEvents=null}});h.parseOptions=function(n){var t=typeof n=="string"&&n.toLowerCase();return{multiple:t&&t.indexOf("multiple")>-1,cell:t&&t.indexOf("cell")>-1}};r.ui.plugin(h)})(window.kendo.jQuery)}(),function(){(function(n,t){var u=window.kendo,f=u.ui.Widget,r=n.proxy,e=u.keys,o="click",l="k-button",a="k-button-icon",v="k-button-icontext",i=".kendoButton",s="disabled",y="k-state-disabled",h="k-state-focused",c="k-state-selected",p=f.extend({init:function(n,t){var e=this;f.fn.init.call(e,n,t);n=e.wrapper=e.element;t=e.options;n.addClass(l).attr("role","button");t.enable=t.enable&&!n.attr(s);e.enable(t.enable);e._tabindex();e._graphics();n.on(o+i,r(e._click,e)).on("focus"+i,r(e._focus,e)).on("blur"+i,r(e._blur,e)).on("keydown"+i,r(e._keydown,e)).on("keyup"+i,r(e._keyup,e));u.notify(e)},destroy:function(){var n=this;n.wrapper.off(i);f.fn.destroy.call(n)},events:[o],options:{name:"Button",icon:"",spriteCssClass:"",imageUrl:"",enable:!0},_isNativeButton:function(){return this.element.prop("tagName").toLowerCase()=="button"},_click:function(n){this.options.enable&&this.trigger(o,{event:n})&&n.preventDefault()},_focus:function(){this.options.enable&&this.element.addClass(h)},_blur:function(){this.element.removeClass(h)},_keydown:function(n){var t=this;t._isNativeButton()||(n.keyCode==e.ENTER||n.keyCode==e.SPACEBAR)&&(n.keyCode==e.SPACEBAR&&(n.preventDefault(),t.options.enable&&t.element.addClass(c)),t._click(n))},_keyup:function(){this.element.removeClass(c)},_graphics:function(){var h=this,t=h.element,u=h.options,f=u.icon,e=u.spriteCssClass,o=u.imageUrl,i,r,s;(e||o||f)&&(s=!0,t.contents().not("span.k-sprite").not("span.k-icon").not("img.k-image").each(function(t,i){(i.nodeType==1||i.nodeType==3&&n.trim(i.nodeValue).length>0)&&(s=!1)}),s?t.addClass(a):t.addClass(v));f?(i=t.children("span.k-icon").first(),i[0]||(i=n('<span class="k-icon"><\/span>').prependTo(t)),i.addClass("k-i-"+f)):e?(i=t.children("span.k-sprite").first(),i[0]||(i=n('<span class="k-sprite"><\/span>').prependTo(t)),i.addClass(e)):o&&(r=t.children("img.k-image").first(),r[0]||(r=n('<img alt="icon" class="k-image" />').prependTo(t)),r.attr("src",o))},enable:function(n){var i=this,r=i.element;n===t&&(n=!0);n=!!n;i.options.enable=n;r.toggleClass(y,!n).attr("aria-disabled",!n).attr(s,!n);try{r.blur()}catch(u){}}});u.ui.plugin(p)})(window.kendo.jQuery)}(),function(){(function(n,t){function y(n,t,r,u,f){return n({idx:t,text:r,ns:i.ns,numeric:u,title:f||""})}function e(n,t,i){return tt({className:n.substring(1),text:t,wrapClassName:i||""})}function o(n,t,r,u){n.find(t).parent().attr(i.attr("page"),r).attr("tabindex",-1).toggleClass("k-state-disabled",u)}function w(n,t){o(n,h,1,t<=1)}function b(n,t){o(n,l,Math.max(1,t-1),t<=1)}function k(n,t,i){o(n,a,Math.min(i,t+1),t>=i)}function d(n,t,i){o(n,c,i,t>=i)}var i=window.kendo,p=i.ui,s=p.Widget,u=n.proxy,h=".k-i-seek-w",c=".k-i-seek-e",l=".k-i-arrow-w",a=".k-i-arrow-e",r="change",f=".kendoPager",v="click",g="keydown",nt="disabled",tt=i.template('<a href="\\#" title="#=text#" class="k-link k-pager-nav #= wrapClassName #"><span class="k-icon #= className #">#=text#<\/span><\/a>'),it=s.extend({init:function(t,o){var y=this,nt,p,tt,it;if(s.fn.init.call(y,t,o),o=y.options,y.dataSource=i.data.DataSource.create(o.dataSource),y.linkTemplate=i.template(y.options.linkTemplate),y.selectTemplate=i.template(y.options.selectTemplate),y.currentPageTemplate=i.template(y.options.currentPageTemplate),nt=y.page(),p=y.totalPages(),y._refreshHandler=u(y.refresh,y),y.dataSource.bind(r,y._refreshHandler),o.previousNext&&(y.element.find(h).length||(y.element.append(e(h,o.messages.first,"k-pager-first")),w(y.element,nt,p)),y.element.find(l).length||(y.element.append(e(l,o.messages.previous)),b(y.element,nt,p))),o.numeric&&(y.list=y.element.find(".k-pager-numbers"),y.list.length||(y.list=n('<ul class="k-pager-numbers k-reset" />').appendTo(y.element))),o.input){y.element.find(".k-pager-input").length||y.element.append('<span class="k-pager-input k-label">'+o.messages.page+'<input class="k-textbox">'+i.format(o.messages.of,p)+"<\/span>");y.element.on(g+f,".k-pager-input input",u(y._keydown,y))}if(o.previousNext&&(y.element.find(a).length||(y.element.append(e(a,o.messages.next)),k(y.element,nt,p)),y.element.find(c).length||(y.element.append(e(c,o.messages.last,"k-pager-last")),d(y.element,nt,p))),o.pageSizes){y.element.find(".k-pager-sizes").length||(tt=o.pageSizes.length?o.pageSizes:["all",5,10,20],it=n.map(tt,function(n){return n.toLowerCase&&n.toLowerCase()==="all"?"<option value='all'>"+o.messages.allPages+"<\/option>":"<option>"+n+"<\/option>"}),n('<span class="k-pager-sizes k-label"><select/>'+o.messages.itemsPerPage+"<\/span>").appendTo(y.element).find("select").html(it.join("")).end().appendTo(y.element));y.element.find(".k-pager-sizes select").val(y.pageSize());i.ui.DropDownList&&y.element.find(".k-pager-sizes select").show().kendoDropDownList();y.element.on(r+f,".k-pager-sizes select",u(y._change,y))}if(o.refresh){y.element.find(".k-pager-refresh").length||y.element.append('<a href="#" class="k-pager-refresh k-link" title="'+o.messages.refresh+'"><span class="k-icon k-i-refresh">'+o.messages.refresh+"<\/span><\/a>");y.element.on(v+f,".k-pager-refresh",u(y._refreshClick,y))}o.info&&(y.element.find(".k-pager-info").length||y.element.append('<span class="k-pager-info k-label" />'));y.element.on(v+f,"a",u(y._click,y)).addClass("k-pager-wrap k-widget k-floatwrap");y.element.on(v+f,".k-current-page",u(y._toggleActive,y));o.autoBind&&y.refresh();i.notify(y)},destroy:function(){var n=this;s.fn.destroy.call(n);n.element.off(f);n.dataSource.unbind(r,n._refreshHandler);n._refreshHandler=null;i.destroy(n.element);n.element=n.list=null},events:[r],options:{name:"Pager",selectTemplate:'<li><span class="k-state-selected">#=text#<\/span><\/li>',currentPageTemplate:'<li class="k-current-page"><span class="k-link k-pager-nav">#=text#<\/span><\/li>',linkTemplate:'<li><a tabindex="-1" href="\\#" class="k-link" data-#=ns#page="#=idx#" #if (title !== "") {# title="#=title#" #}#>#=text#<\/a><\/li>',buttonCount:10,autoBind:!0,numeric:!0,info:!0,input:!1,previousNext:!0,pageSizes:!1,refresh:!1,messages:{allPages:"All",display:"{0} - {1} of {2} items",empty:"No items to display",page:"Page",of:"of {0}",itemsPerPage:"items per page",first:"Go to the first page",previous:"Go to the previous page",next:"Go to the next page",last:"Go to the last page",refresh:"Refresh",morePages:"More pages"}},setDataSource:function(n){var t=this;t.dataSource.unbind(r,t._refreshHandler);t.dataSource=t.options.dataSource=n;n.bind(r,t._refreshHandler);t.options.autoBind&&n.fetch()},refresh:function(n){var t=this,e,a,h=1,v,r=t.page(),f="",u=t.options,o=t.pageSize(),c=t.dataSource.total(),s=t.totalPages(),p=t.linkTemplate,l=u.buttonCount;if(!n||n.action!="itemchange"){if(u.numeric){for(r>l&&(v=r%l,h=v===0?r-l+1:r-v+1),a=Math.min(h+l-1,s),h>1&&(f+=y(p,h-1,"...",!1,u.messages.morePages)),e=h;e<=a;e++)f+=y(e==r?t.selectTemplate:p,e,e,!0);a<s&&(f+=y(p,e,"...",!1,u.messages.morePages));f===""&&(f=t.selectTemplate({text:0}));f=this.currentPageTemplate({text:r})+f;t.list.removeClass("k-state-expanded").html(f)}if(u.info&&(f=c>0?i.format(u.messages.display,(r-1)*o+1,Math.min(r*o,c),c):u.messages.empty,t.element.find(".k-pager-info").html(f)),u.input&&t.element.find(".k-pager-input").html(t.options.messages.page+'<input class="k-textbox">'+i.format(u.messages.of,s)).find("input").val(r).attr(nt,c<1).toggleClass("k-state-disabled",c<1),u.previousNext&&(w(t.element,r,s),b(t.element,r,s),k(t.element,r,s),d(t.element,r,s)),u.pageSizes){var tt=t.element.find(".k-pager-sizes option[value='all']").length>0,it=tt&&o===this.dataSource.total(),g=o;it&&(o="all",g=u.messages.allPages);t.element.find(".k-pager-sizes select").val(o).filter("["+i.attr("role")+"=dropdownlist]").kendoDropDownList("value",o).kendoDropDownList("text",g)}}},_keydown:function(n){if(n.keyCode===i.keys.ENTER){var r=this.element.find(".k-pager-input").find("input"),t=parseInt(r.val(),10);(isNaN(t)||t<1||t>this.totalPages())&&(t=this.page());r.val(t);this.page(t)}},_refreshClick:function(n){n.preventDefault();this.dataSource.read()},_change:function(n){var i=n.currentTarget.value,r=parseInt(i,10),t=this.dataSource;isNaN(r)?(i+"").toLowerCase()=="all"&&t.pageSize(t.total()):t.pageSize(r)},_toggleActive:function(){this.list.toggleClass("k-state-expanded")},_click:function(t){var r=n(t.currentTarget);t.preventDefault();r.is(".k-state-disabled")||this.page(r.attr(i.attr("page")))},totalPages:function(){return Math.ceil((this.dataSource.total()||0)/(this.pageSize()||1))},pageSize:function(){return this.dataSource.pageSize()||this.dataSource.total()},page:function(n){if(n!==t)this.dataSource.page(n),this.trigger(r,{index:n});else return this.dataSource.total()>0?this.dataSource.page():0}});p.plugin(it)})(window.kendo.jQuery)}(),function(){(function(n){function g(t,i){return t===i||n.contains(t,i)}var t=window.kendo,nt=t.ui,a=nt.Widget,f=t.support,r=t.getOffset,v="open",y="close",tt="deactivate",it="activate",u="center",rt="left",o="right",p="top",s="bottom",w="absolute",ut="hidden",h="body",b="location",c="position",ft="visible",et="effects",ot="k-state-active",l="k-state-border",ht=/k-state-border-(\w+)/,st=".k-picker-wrap, .k-dropdown-wrap, .k-link",ct="down",k=n(document.documentElement),lt=n(window),at="scroll",vt="resize scroll",yt=f.transitions.css,pt=yt+"transform",i=n.extend,e=".kendoPopup",d=["font-size","font-family","font-stretch","font-style","font-weight","line-height"],wt=a.extend({init:function(r,u){var f=this,c;u=u||{};u.isRtl&&(u.origin=u.origin||s+" "+o,u.position=u.position||p+" "+o);a.fn.init.call(f,r,u);r=f.element;u=f.options;f.collisions=u.collision?u.collision.split(" "):[];f.downEvent=t.applyEventMap(ct,t.guid());f.collisions.length===1&&f.collisions.push(f.collisions[0]);c=n(f.options.anchor).closest(".k-popup,.k-group").filter(":not([class^=km-])");u.appendTo=n(n(u.appendTo)[0]||c[0]||h);f.element.hide().addClass("k-popup k-group k-reset").toggleClass("k-rtl",!!u.isRtl).css({position:w}).appendTo(u.appendTo).on("mouseenter"+e,function(){f._hovered=!0}).on("mouseleave"+e,function(){f._hovered=!1});if(f.wrapper=n(),u.animation===!1&&(u.animation={open:{effects:{}},close:{hide:!0,effects:{}}}),i(u.animation.open,{complete:function(){f.wrapper.css({overflow:ft});f._activated=!0;f._trigger(it)}}),i(u.animation.close,{complete:function(){f._animationClose()}}),f._mousedownProxy=function(n){f._mousedown(n)},f._resizeProxy=function(n){f._resize(n)},u.toggleTarget)n(u.toggleTarget).on(u.toggleEvent+e,n.proxy(f.toggle,f))},events:[v,it,y,tt],options:{name:"Popup",toggleEvent:"click",origin:s+" "+rt,position:p+" "+rt,anchor:h,appendTo:null,collision:"flip fit",viewport:window,copyAnchorStyles:!0,autosize:!1,modal:!1,adjustSize:{width:0,height:0},animation:{open:{effects:"slideIn:down",transition:!0,duration:200},close:{duration:100,hide:!0}}},_animationClose:function(){var i=this,o=i.options,r,u,f,e;i.wrapper.hide();r=i.wrapper.data(b);u=n(o.anchor);r&&i.wrapper.css(r);o.anchor!=h&&(f=((u.attr("class")||"").match(ht)||["","down"])[1],e=l+"-"+f,u.removeClass(e).children(st).removeClass(ot).removeClass(e),i.element.removeClass(l+"-"+t.directions[f].reverse));i._closing=!1;i._trigger(tt)},destroy:function(){var i=this,r=i.options,u=i.element.off(e),f;a.fn.destroy.call(i);r.toggleTarget&&n(r.toggleTarget).off(e);r.modal||(k.unbind(i.downEvent,i._mousedownProxy),i._toggleResize(!1));t.destroy(i.element.children());u.removeData();r.appendTo[0]===document.body&&(f=u.parent(".k-animation-container"),f[0]?f.remove():u.remove())},open:function(r,u){var e=this,tt={isFixed:!isNaN(parseInt(u,10)),x:r,y:u},o=e.element,s=e.options,y="down",a,b,nt=n(s.anchor),it=o[0]&&o.hasClass("km-widget"),g;if(!e.visible()){if(s.copyAnchorStyles&&(it&&d[0]=="font-size"&&d.shift(),o.css(t.getComputedStyles(nt[0],d))),o.data("animating")||e._trigger(v))return;e._activated=!1;s.modal||(k.unbind(e.downEvent,e._mousedownProxy).bind(e.downEvent,e._mousedownProxy),f.mobileOS.ios||f.mobileOS.android||(e._toggleResize(!1),e._toggleResize(!0)));e.wrapper=b=t.wrap(o,s.autosize).css({overflow:ut,display:"block",position:w});f.mobileOS.android&&b.css(pt,"translatez(0)");b.css(c);n(s.appendTo)[0]==document.body&&b.css(p,"-10000px");a=i(!0,{},s.animation.open);e.flipped=e._position(tt);a.effects=t.parseEffects(a.effects,e.flipped);y=a.effects.slideIn?a.effects.slideIn.direction:y;s.anchor!=h&&(g=l+"-"+y,o.addClass(l+"-"+t.directions[y].reverse),nt.addClass(g).children(st).addClass(ot).addClass(g));o.data(et,a.effects).kendoStop(!0).kendoAnimate(a)}},position:function(){this.visible()&&this._position()},toggle:function(){var n=this;n[n.visible()?y:v]()},visible:function(){return this.element.is(":"+ft)},close:function(r){var u=this,h=u.options,s,f,e,o;if(u.visible()){if(s=u.wrapper[0]?u.wrapper:t.wrap(u.element).hide(),u._toggleResize(!1),u._closing||u._trigger(y)){u._toggleResize(!0);return}u.element.find(".k-popup").each(function(){var i=n(this),t=i.data("kendoPopup");t&&t.close(r)});k.unbind(u.downEvent,u._mousedownProxy);r?f={hide:!0,effects:{}}:(f=i(!0,{},h.animation.close),e=u.element.data(et),o=f.effects,!o&&!t.size(o)&&e&&t.size(e)&&(f.effects=e,f.reverse=!0),u._closing=!0);u.element.kendoStop(!0);s.css({overflow:ut});u.element.kendoAnimate(f)}},_trigger:function(n){return this.trigger(n,{type:n})},_resize:function(n){var t=this;n.type==="resize"?(clearTimeout(t._resizeTimeout),t._resizeTimeout=setTimeout(function(){t._position();t._resizeTimeout=null},50)):(!t._hovered||t._activated&&t.element.hasClass("k-list-container"))&&t.close()},_toggleResize:function(n){var t=n?"on":"off";this._scrollableParents()[t](at,this._resizeProxy);lt[t](vt,this._resizeProxy)},_mousedown:function(i){var u=this,s=u.element[0],e=u.options,h=n(e.anchor)[0],o=e.toggleTarget,f=t.eventTarget(i),r=n(f).closest(".k-popup"),c=r.parent().parent(".km-shim").length;(r=r[0],c||!r||r===u.element[0])&&n(i.target).closest("a").data("rel")!=="popover"&&(g(s,f)||g(h,f)||o&&g(n(o)[0],f)||u.close())},_fit:function(n,t,i){var r=0;return n+t>i&&(r=i-(n+t)),n<0&&(r=-n),r},_flip:function(n,t,i,r,f,e,o){var s=0;return o=o||t,e!==f&&e!==u&&f!==u&&(n+o>r&&(s+=-(i+t)),n+s<0&&(s+=i+t)),s},_scrollableParents:function(){return n(this.options.anchor).parentsUntil("body").filter(function(n,i){return t.isScrollable(i)})},_position:function(u){var o=this,it=o.element,e=o.wrapper,v=o.options,y=n(v.viewport),lt=y.offset(),l=n(v.anchor),rt=v.origin.toLowerCase().split(" "),ut=v.position.toLowerCase().split(" "),k=o.collisions,p=f.zoomLevel(),d,ft,h,g=10002,et=!!(y[0]==window&&window.innerWidth&&p<=1.02),ot=0,at=document.documentElement,vt,nt,st,ct;if(nt=et?window.innerWidth:y.width(),st=et?window.innerHeight:y.height(),et&&at.scrollHeight-at.clientHeight>0&&(nt-=t.support.scrollbar()),d=l.parents().filter(e.siblings()),d[0])if(h=Math.max(Number(d.css("zIndex")),0),h)g=h+10;else for(ft=l.parentsUntil(d),vt=ft.length;ot<vt;ot++)h=Number(n(ft[ot]).css("zIndex")),h&&g<h&&(g=h+10);e.css("zIndex",g);u&&u.isFixed?e.css({left:u.x,top:u.y}):e.css(o._align(rt,ut));var ht=r(e,c,l[0]===e.offsetParent()[0]),a=r(e),pt=l.offsetParent().parent(".k-animation-container,.k-popup,.k-group");pt.length&&(ht=r(e,c,!0),a=r(e));y[0]===window?(a.top-=window.pageYOffset||document.documentElement.scrollTop||0,a.left-=window.pageXOffset||document.documentElement.scrollLeft||0):(a.top-=lt.top,a.left-=lt.left);o.wrapper.data(b)||e.data(b,i({},ht));var tt=i({},a),s=i({},ht),yt=v.adjustSize;return k[0]==="fit"&&(s.top+=o._fit(tt.top,e.outerHeight()+yt.height,st/p)),k[1]==="fit"&&(s.left+=o._fit(tt.left,e.outerWidth()+yt.width,nt/p)),ct=i({},s),k[0]==="flip"&&(s.top+=o._flip(tt.top,it.outerHeight(),l.outerHeight(),st/p,rt[0],ut[0],e.outerHeight())),k[1]==="flip"&&(s.left+=o._flip(tt.left,it.outerWidth(),l.outerWidth(),nt/p,rt[1],ut[1],e.outerWidth())),it.css(c,w),e.css(s),s.left!=ct.left||s.top!=ct.top},_align:function(t,i){var c=this,v=c.wrapper,l=n(c.options.anchor),y=t[0],p=t[1],w=i[0],b=i[1],k=r(l),d=n(c.options.appendTo),a,g=v.outerWidth(),nt=v.outerHeight(),tt=l.outerWidth(),it=l.outerHeight(),f=k.top,e=k.left,h=Math.round;return d[0]!=document.body&&(a=r(d),f-=a.top,e-=a.left),y===s&&(f+=it),y===u&&(f+=h(it/2)),w===s&&(f-=nt),w===u&&(f-=h(nt/2)),p===o&&(e+=tt),p===u&&(e+=h(tt/2)),b===o&&(e-=g),b===u&&(e-=h(g/2)),{top:f,left:e}}});nt.plugin(wt)})(window.kendo.jQuery)}(),function(){(function(n,t){var i=window.kendo,h=i.ui.Widget,k=n.proxy,c=n.extend,f=window.setTimeout,v="click",y="show",p="hide",a="k-notification",e=".k-notification-wrap .k-i-close",w="info",d="success",g="warning",nt="error",r="top",o="left",l="bottom",s="right",b="up",u=".kendoNotification",tt='<div class="k-widget k-notification"><\/div>',it='<div class="k-notification-wrap"><span class="k-icon k-i-note">#=typeIcon#<\/span>#=content#<span class="k-icon k-i-close">Hide<\/span><\/div>',rt=h.extend({init:function(t,r){var u=this;h.fn.init.call(u,t,r);r=u.options;r.appendTo&&n(r.appendTo).is(t)||u.element.hide();u._compileTemplates(r.templates);u._guid="_"+i.guid();u._isRtl=i.support.isRtl(t);u._compileStacking(r.stacking,r.position.top,r.position.left);i.notify(u)},events:[y,p],options:{name:"Notification",position:{pinned:!0,top:null,left:null,bottom:20,right:20},stacking:"default",hideOnClick:!0,button:!1,allowHideAfter:0,autoHideAfter:5e3,appendTo:null,width:null,height:null,templates:[],animation:{open:{effects:"fade:in",duration:300},close:{effects:"fade:out",duration:600,hide:!0}}},_compileTemplates:function(t){var r=this,u=i.template;r._compiled={};n.each(t,function(t,i){r._compiled[i.type]=u(i.template||n("#"+i.templateId).html())});r._defaultCompiled=u(it)},_getCompiled:function(n){var t=this,i=t._defaultCompiled;return n?t._compiled[n]||i:i},_compileStacking:function(n,t,i){var c=this,f={paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0},u=i!==null?o:s,e,h;switch(n){case"down":e=l+" "+u;h=r+" "+u;delete f.paddingBottom;break;case s:e=r+" "+s;h=r+" "+o;delete f.paddingRight;break;case o:e=r+" "+o;h=r+" "+s;delete f.paddingLeft;break;case b:e=r+" "+u;h=l+" "+u;delete f.paddingTop;break;default:t!==null?(e=l+" "+u,h=r+" "+u,delete f.paddingBottom):(e=r+" "+u,h=l+" "+u,delete f.paddingTop)}c._popupOrigin=e;c._popupPosition=h;c._popupPaddings=f},_attachPopupEvents:function(n,t){function o(n){n.on(v+u,function(){l._hidePopup(t)})}var l=this,r=n.allowHideAfter,c=!isNaN(r)&&r>0,h;t.options.anchor!==document.body&&t.options.origin.indexOf(s)>0&&t.bind("open",function(){var n=i.getShadows(t.element);f(function(){t.wrapper.css("left",parseFloat(t.wrapper.css("left"))+n.left+n.right)})});n.hideOnClick?t.bind("activate",function(){c?f(function(){o(t.element)},r):o(t.element)}):n.button&&(h=t.element.find(e),c?f(function(){o(h)},r):o(h))},_showPopup:function(t,r){var o=this,v=r.autoHideAfter,l=r.position.left,a=r.position.top,s,h;h=n("."+o._guid+":not(.k-hiding)").last();s=new i.ui.Popup(t,{anchor:h[0]?h:document.body,origin:o._popupOrigin,position:o._popupPosition,animation:r.animation,modal:!0,collision:"",isRtl:o._isRtl,close:function(){o._triggerHide(this.element)},deactivate:function(n){n.sender.element.off(u);n.sender.element.find(e).off(u);n.sender.destroy()}});o._attachPopupEvents(r,s);h[0]?s.open():(l===null&&(l=n(window).width()-t.width()-r.position.right),a===null&&(a=n(window).height()-t.height()-r.position.bottom),s.open(l,a));s.wrapper.addClass(o._guid).css(c({margin:0},o._popupPaddings));r.position.pinned?(s.wrapper.css("position","fixed"),h[0]&&o._togglePin(s.wrapper,!0)):h[0]||o._togglePin(s.wrapper,!1);v>0&&f(function(){o._hidePopup(s)},v)},_hidePopup:function(n){n.wrapper.addClass("k-hiding");n.close()},_togglePin:function(t,i){var u=n(window),f=i?-1:1;t.css({top:parseInt(t.css(r),10)+f*u.scrollTop(),left:parseInt(t.css(o),10)+f*u.scrollLeft()})},_attachStaticEvents:function(n,t){function r(n){n.on(v+u,k(o._hideStatic,o,t))}var o=this,i=n.allowHideAfter,s=!isNaN(i)&&i>0;n.hideOnClick?s?f(function(){r(t)},i):r(t):n.button&&(s?f(function(){r(t.find(e))},i):r(t.find(e)))},_showStatic:function(n,t){var i=this,r=t.autoHideAfter,u=t.animation,e=t.stacking==b||t.stacking==o?"prependTo":"appendTo";n.addClass(i._guid)[e](t.appendTo).hide().kendoAnimate(u.open||!1);i._attachStaticEvents(t,n);r>0&&f(function(){i._hideStatic(n)},r)},_hideStatic:function(n){n.kendoAnimate(c(this.options.animation.close||!1,{complete:function(){n.off(u).find(e).off(u);n.remove()}}));this._triggerHide(n)},_triggerHide:function(n){this.trigger(p,{element:n});this.angular("cleanup",function(){return{elements:n}})},show:function(r,u){var f=this,e=f.options,o=n(tt),s,h;return u||(u=w),r!==null&&r!==t&&r!==""&&(i.isFunction(r)&&(r=r()),h={typeIcon:u,content:""},s=n.isPlainObject(r)?c(h,r):c(h,{content:r}),o.addClass(a+"-"+u).toggleClass(a+"-button",e.button).attr("data-role","alert").css({width:e.width,height:e.height}).append(f._getCompiled(u)(s)),f.angular("compile",function(){return{elements:o,data:[{dataItem:s}]}}),n(e.appendTo)[0]?f._showStatic(o,e):f._showPopup(o,e),f.trigger(y,{element:o})),f},info:function(n){return this.show(n,w)},success:function(n){return this.show(n,d)},warning:function(n){return this.show(n,g)},error:function(n){return this.show(n,nt)},hide:function(){var t=this,i=t.getNotifications();return t.options.appendTo?i.each(function(i,r){t._hideStatic(n(r))}):i.each(function(i,r){var u=n(r).data("kendoPopup");u&&t._hidePopup(u)}),t},getNotifications:function(){var t=this,i=n("."+t._guid);return t.options.appendTo?i:i.children("."+a)},setOptions:function(n){var r=this,i;h.fn.setOptions.call(r,n);i=r.options;n.templates!==t&&r._compileTemplates(i.templates);(n.stacking!==t||n.position!==t)&&r._compileStacking(i.stacking,i.position.top,i.position.left)},destroy:function(){h.fn.destroy.call(this);this.getNotifications().off(u).find(e).off(u)}});i.ui.plugin(rt)})(window.kendo.jQuery)}(),function(){(function(n){function w(n){while(n.length)ot(n),n=n.parent()}function ot(n){var i=n.data(t.ns+"title");i&&(n.attr("title",i),n.removeData(t.ns+"title"))}function st(n){var i=n.attr("title");i&&(n.data(t.ns+"title",i),n.attr("title",""))}function b(n){while(n.length&&!n.is("body"))st(n),n=n.parent()}var t=window.kendo,u=t.ui.Widget,k=t.ui.Popup,d=t.isFunction,g=n.isPlainObject,s=n.extend,r=n.proxy,f=n(document),nt=t.isLocalUrl,h="_tt_active",c="aria-describedby",l="show",a="hide",v="error",e="contentLoad",y="requestStart",o="k-content-frame",tt='<div role="tooltip" class="k-widget k-tooltip#if (!autoHide) {# k-tooltip-closable#}#">#if (!autoHide) {# <div class="k-tooltip-button"><a href="\\#" class="k-icon k-i-close">close<\/a><\/div> #}#<div class="k-tooltip-content"><\/div>#if (callout){ #<div class="k-callout k-callout-#=dir#"><\/div>#}#<\/div>',it=t.template("<iframe frameborder='0' class='"+o+"' src='#= content.url #'>This page requires frames in order to show content<\/iframe>"),i=".kendoTooltip",rt={bottom:{origin:"bottom center",position:"top center"},top:{origin:"top center",position:"bottom center"},left:{origin:"center left",position:"center right",collision:"fit flip"},right:{origin:"center right",position:"center left",collision:"fit flip"},center:{position:"center center",origin:"center center"}},ut={top:"bottom",bottom:"top",left:"right",right:"left",center:"center"},p={bottom:"n",top:"s",left:"e",right:"w",center:"n"},ft={horizontal:{offset:"top",size:"outerHeight"},vertical:{offset:"left",size:"outerWidth"}},et=function(n){return n.target.data(t.ns+"title")},ht=u.extend({init:function(n,t){var f=this,e;u.fn.init.call(f,n,t);e=f.options.position.match(/left|right/)?"horizontal":"vertical";f.dimensions=ft[e];f._documentKeyDownHandler=r(f._documentKeyDown,f);f.element.on(f.options.showOn+i,f.options.filter,r(f._showOn,f)).on("mouseenter"+i,f.options.filter,r(f._mouseenter,f));if(this.options.autoHide)f.element.on("mouseleave"+i,f.options.filter,r(f._mouseleave,f))},options:{name:"Tooltip",filter:"",content:et,showAfter:100,callout:!0,position:"bottom",showOn:"mouseenter",autoHide:!0,width:null,height:null,animation:{open:{effects:"fade:in",duration:0},close:{effects:"fade:out",duration:40,hide:!0}}},events:[l,a,e,v,y],_mouseenter:function(t){b(n(t.currentTarget))},_showOn:function(t){var i=this,r=n(t.currentTarget);i.options.showOn&&i.options.showOn.match(/click|focus/)?i._show(r):(clearTimeout(i.timeout),i.timeout=setTimeout(function(){i._show(r)},i.options.showAfter))},_appendContent:function(n){var f=this,r=f.options.content,u=f.content,h=f.options.iframe,s;if(g(r)&&r.url)if("iframe"in f.options||(h=!nt(r.url)),f.trigger(y,{options:r,target:n}),h){u.hide();s=u.find("."+o)[0];s?s.src=r.url||s.src:u.html(it({content:r}));u.find("."+o).off("load"+i).on("load"+i,function(){f.trigger(e);u.show()})}else u.empty(),t.ui.progress(u,!0),f._ajaxRequest(r);else r&&d(r)?(r=r({sender:this,target:n}),u.html(r||"")):u.html(r);f.angular("compile",function(){return{elements:u}})},_ajaxRequest:function(n){var i=this;jQuery.ajax(s({type:"GET",dataType:"html",cache:!1,error:function(n,r){t.ui.progress(i.content,!1);i.trigger(v,{status:r,xhr:n})},success:r(function(n){t.ui.progress(i.content,!1);i.content.html(n);i.trigger(e)},i)},n))},_documentKeyDown:function(n){n.keyCode===t.keys.ESC&&this.hide()},refresh:function(){var t=this,n=t.popup;n&&n.options.anchor&&t._appendContent(n.options.anchor)},hide:function(){this.popup&&this.popup.close()},show:function(n){n=n||this.element;b(n);this._show(n)},_show:function(n){var t=this,r=t.target();t.popup||t._initPopup();r&&r[0]!=n[0]&&(t.popup.close(),t.popup.element.kendoStop(!0,!0));r&&r[0]==n[0]||(t._appendContent(n),t.popup.options.anchor=n);t.popup.one("deactivate",function(){w(n);n.removeAttr(c);this.element.removeAttr("id").attr("aria-hidden",!0);f.off("keydown"+i,t._documentKeyDownHandler)});t.popup.open()},_initPopup:function(){var u=this,e=u.options,o=n(t.template(tt)({callout:e.callout&&e.position!=="center",dir:p[e.position],autoHide:e.autoHide}));if(u.popup=new k(o,s({activate:function(){var t=this.options.anchor,n=t[0].id||u.element[0].id;n&&(t.attr(c,n+h),this.element.attr("id",n+h));e.callout&&u._positionCallout();this.element.removeAttr("aria-hidden");f.on("keydown"+i,u._documentKeyDownHandler);u.trigger(l)},close:function(){u.trigger(a)},copyAnchorStyles:!1,animation:e.animation},rt[e.position])),o.css({width:e.width,height:e.height}),u.content=o.find(".k-tooltip-content"),u.arrow=o.find(".k-callout"),e.autoHide)o.on("mouseleave"+i,r(u._mouseleave,u));else o.on("click"+i,".k-tooltip-button",r(u._closeButtonClick,u))},_closeButtonClick:function(n){n.preventDefault();this.hide()},_mouseleave:function(t){if(this.popup){var r=n(t.currentTarget),i=r.offset(),u=t.pageX,f=t.pageY;if(i.right=i.left+r.outerWidth(),i.bottom=i.top+r.outerHeight(),u>i.left&&u<i.right&&f>i.top&&f<i.bottom)return;this.popup.close()}else w(n(t.currentTarget));clearTimeout(this.timeout)},_positionCallout:function(){var t=this,u=t.options.position,f=t.dimensions,i=f.offset,r=t.popup,e=r.options.anchor,o=n(e).offset(),s=parseInt(t.arrow.css("border-top-width"),10),h=n(r.element).offset(),c=p[r.flipped?ut[u]:u],l=o[i]-h[i]+n(e)[f.size]()/2-s;t.arrow.removeClass("k-callout-n k-callout-s k-callout-w k-callout-e").addClass("k-callout-"+c).css(i,l)},target:function(){return this.popup?this.popup.options.anchor:null},destroy:function(){var n=this.popup;n&&(n.element.off(i),n.destroy());clearTimeout(this.timeout);this.element.off(i);f.off("keydown"+i,this._documentKeyDownHandler);u.fn.destroy.call(this)}});t.ui.plugin(ht)})(window.kendo.jQuery)}(),function(){(function(n,t){function at(n,t){for(var e=t.length,f=[],u,r,i=0;i<n.length;i++)for(u=n[i],r=0;r<e;r++)u===t[r]&&f.push({index:i,item:u});return f}function k(t,i){var u,r=!1;return t.filters&&(u=n.grep(t.filters,function(n){return r=k(n,i),n.filters?n.filters.length:n.field!=i}),r||t.filters.length===u.length||(r=!0),t.filters=u),r}var i=window.kendo,c=i.ui,u=c.Widget,f=i.keys,e=i.support,et=i.htmlEncode,d=i._activeElement,ot=i.data.ObservableArray,l="id",o="change",g="k-state-focused",v="k-state-hover",nt="k-loading",y="open",tt="close",p="select",s="selected",it="requestStart",rt="requestEnd",ut="width",w=n.extend,r=n.proxy,st=n.isArray,b=e.browser,ht=b.msie&&b.version<9,ct=/"/g,lt={ComboBox:"DropDownList",DropDownList:"ComboBox"},a=i.ui.DataBoundWidget.extend({init:function(t,i){var f=this,o=f.ns,e;u.fn.init.call(f,t,i);t=f.element;i=f.options;f._isSelect=t.is(p);f._isSelect&&f.element[0].length&&(i.dataSource||(i.dataTextField=i.dataTextField||"text",i.dataValueField=i.dataValueField||"value"));f.ul=n('<ul unselectable="on" class="k-list k-reset"/>').attr({tabIndex:-1,"aria-hidden":!0});f.list=n("<div class='k-list-container'/>").append(f.ul).on("mousedown"+o,r(f._listMousedown,f));e=t.attr(l);e&&(f.list.attr(l,e+"-list"),f.ul.attr(l,e+"_listbox"));f._header();f._accessors();f._initValue()},options:{valuePrimitive:!1,headerTemplate:""},setOptions:function(n){u.fn.setOptions.call(this,n);n&&n.enable!==t&&(n.enabled=n.enable)},focus:function(){this._focused.focus()},readonly:function(n){this._editable({readonly:n===t?!0:n,disable:!1})},enable:function(n){this._editable({readonly:!1,disable:!(n=n===t?!0:n)})},_listOptions:function(n){var t=this.options;return n=n||{},n={height:n.height||t.height,dataValueField:n.dataValueField||t.dataValueField,dataTextField:n.dataTextField||t.dataTextField,groupTemplate:n.groupTemplate||t.groupTemplate,fixedGroupTemplate:n.fixedGroupTemplate||t.fixedGroupTemplate,template:n.template||t.template},n.template||(n.template="#:"+i.expr(n.dataTextField,"data")+"#"),n},_initList:function(){var u=this,o=u.options,s=o.virtual,c=!!s,f=o.value,h=r(u._listBound,u),e={autoBind:!1,selectable:!0,dataSource:u.dataSource,click:r(u._click,u),change:r(u._listChange,u),activate:r(u._activateItem,u),deactivate:r(u._deactivateItem,u),dataBinding:function(){u.trigger("dataBinding");u._angularItems("cleanup")},dataBound:h,listBound:h,selectedItemChange:r(u._listChange,u)};e=n.extend(u._listOptions(),e,typeof s=="object"?s:{});u.listView=c?new i.ui.VirtualList(u.ul,e):new i.ui.StaticList(u.ul,e);f!==t&&u.listView.value(f).done(function(){var n=o.text;!u.listView.filter()&&u.input&&(u.selectedIndex===-1?((n===t||n===null)&&(n=f),u._accessor(f),u.input.val(n),u._placeholder()):u._oldIndex===-1&&(u._oldIndex=u.selectedIndex))})},_listMousedown:function(n){this.filterInput&&this.filterInput[0]===n.target||n.preventDefault()},_filterSource:function(n,t){var r=this,f=r.options,u=r.dataSource,i=w({},u.filter()||{}),e=k(i,f.dataTextField);(n||e)&&r.trigger("filtering",{filter:n})||(i={filters:i.filters||[],logic:"and"},n&&i.filters.push(n),t?u.read({filter:i}):u.filter(i))},_header:function(){var t=this,i=t.options.headerTemplate,r;n.isFunction(i)&&(i=i({}));i&&(t.list.prepend(i),r=t.ul.prev(),t.header=r[0]?r:null,t.header&&t.angular("compile",function(){return{elements:t.header}}))},_initValue:function(){var n=this,t=n.options.value;t!==null?n.element.val(t):(t=n._accessor(),n.options.value=t);n._old=t},_ignoreCase:function(){var t=this,i=t.dataSource.reader.model,n;i&&i.fields&&(n=i.fields[t.options.dataTextField],n&&n.type&&n.type!=="string"&&(t.options.ignoreCase=!1))},_focus:function(n){return this.listView.focus(n)},current:function(n){return this._focus(n)},items:function(){return this.ul[0].children},destroy:function(){var n=this,t=n.ns;u.fn.destroy.call(n);n._unbindDataSource();n.listView.destroy();n.list.off(t);n.popup.destroy();n._form&&n._form.off("reset",n._resetHandler)},dataItem:function(i){var r=this;if(i===t)return r.listView.selectedDataItems()[0];if(typeof i!="number"){if(r.options.virtual)return r.dataSource.getByUid(n(i).data("uid"));i=n(r.items()).index(i)}return r.dataSource.flatView()[i]},_activateItem:function(){var n=this.listView.focus();n&&this._focused.add(this.filterInput).attr("aria-activedescendant",n.attr("id"))},_deactivateItem:function(){this._focused.add(this.filterInput).removeAttr("aria-activedescendant")},_accessors:function(){var t=this,r=t.element,n=t.options,u=i.getter,f=r.attr(i.attr("text-field")),e=r.attr(i.attr("value-field"));!n.dataTextField&&f&&(n.dataTextField=f);!n.dataValueField&&e&&(n.dataValueField=e);t._text=u(n.dataTextField);t._value=u(n.dataValueField)},_aria:function(n){var i=this,r=i.options,u=i._focused.add(i.filterInput);r.suggest!==t&&u.attr("aria-autocomplete",r.suggest?"both":"list");n=n?n+" "+i.ul[0].id:i.ul[0].id;u.attr("aria-owns",n);i.ul.attr("aria-live",!r.filter||r.filter==="none"?"off":"polite")},_blur:function(){var n=this;n._change();n.close()},_change:function(){var n=this,i=n.selectedIndex,f=n.options.value,r=n.value(),u;n._isSelect&&!n.listView.isBound()&&f&&(r=f);r!==n._old?u=!0:i!==t&&i!==n._oldIndex&&(u=!0);u&&(n._old=r,n._oldIndex=i,n._typing||n.element.trigger(o),n.trigger(o));n.typing=!1},_data:function(){return this.dataSource.view()},_enable:function(){var n=this,i=n.options,r=n.element.is("[disabled]");i.enable!==t&&(i.enabled=i.enable);!i.enabled||r?n.enable(!1):n.readonly(n.element.is("[readonly]"))},_dataValue:function(n){var i=this._value(n);return i===t&&(i=this._text(n)),i},_offsetHeight:function(){var t=0,i=this.listView.content.prevAll(":visible");return i.each(function(){var i=n(this);t+=i.hasClass("k-list-filter")?i.children().outerHeight():i.outerHeight()}),t},_height:function(n){var i=this,f=i.list,t=i.options.height,e=i.popup.visible(),r,u;return n&&(u=f.add(f.parent(".k-animation-container")).show(),t=i.listView.content[0].scrollHeight>t?t:"auto",u.height(t),t!=="auto"&&(r=i._offsetHeight(),r&&(t-=r)),i.listView.content.height(t),e||u.hide()),t},_adjustListWidth:function(){var t=this.list,i=t[0].style.width,u=this.wrapper,n,r;if(t.data(ut)||!i)return n=window.getComputedStyle?window.getComputedStyle(u[0],null):0,r=n?parseFloat(n.width):u.outerWidth(),n&&b.msie&&(r+=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight)+parseFloat(n.borderLeftWidth)+parseFloat(n.borderRightWidth)),i=t.css("box-sizing")!=="border-box"?r-(t.outerWidth()-t.width()):r,t.css({fontFamily:u.css("font-family"),width:i}).data(ut,i),!0},_openHandler:function(n){this._adjustListWidth();this.trigger(y)?n.preventDefault():(this._focused.attr("aria-expanded",!0),this.ul.attr("aria-hidden",!1))},_closeHandler:function(n){this.trigger(tt)?n.preventDefault():(this._focused.attr("aria-expanded",!1),this.ul.attr("aria-hidden",!0))},_focusItem:function(){var i=this.listView,r=i.focus(),n=i.select();n=n[n.length-1];n===t&&this.options.highlightFirst&&!r&&(n=0);n!==t?i.focus(n):i.scrollToIndex(0)},_calculateGroupPadding:function(n){var u=this.ul.children(".k-first:first"),t=this.listView.content.prev(".k-group-header"),r=0;t[0]&&t[0].style.display!=="none"&&(n!=="auto"&&(r=i.support.scrollbar()),r+=parseFloat(u.css("border-right-width"),10)+parseFloat(u.children(".k-group").css("padding-right"),10),t.css("padding-right",r))},_firstOpen:function(){var n=this._height(this.dataSource.flatView().length);this._calculateGroupPadding(n)},_popup:function(){var n=this;if(n.popup=new c.Popup(n.list,w({},n.options.popup,{anchor:n.wrapper,open:r(n._openHandler,n),close:r(n._closeHandler,n),animation:n.options.animation,isRtl:e.isRtl(n.wrapper)})),!n.options.virtual)n.popup.one(y,r(n._firstOpen,n))},_makeUnselectable:function(){ht&&this.list.find("*").not(".k-textbox").attr("unselectable","on")},_toggleHover:function(t){n(t.currentTarget).toggleClass(v,t.type==="mouseenter")},_toggle:function(n,i){var r=this,u=e.mobileOS&&(e.touch||e.MSPointers||e.pointers);n=n!==t?n:!r.popup.visible();i||u||r._focused[0]===d()||(r._prevent=!0,r._focused.focus(),r._prevent=!1);r[n?y:tt]()},_triggerCascade:function(){var n=this;n._cascadeTriggered&&n._old===n.value()&&n._oldIndex===n.selectedIndex||(n._cascadeTriggered=!0,n.trigger("cascade",{userTriggered:n._userTriggered}))},_unbindDataSource:function(){var n=this;n.dataSource.unbind(it,n._requestStartHandler).unbind(rt,n._requestEndHandler).unbind("error",n._errorHandler)}}),h,ft;w(a,{inArray:function(n,t){var i,r,u=t.children;if(!n||n.parentNode!==t)return-1;for(i=0,r=u.length;i<r;i++)if(n===u[i])return i;return-1}});i.ui.List=a;c.Select=a.extend({init:function(n,t){a.fn.init.call(this,n,t);this._initial=this.element.val()},setDataSource:function(n){var t=this,i;t.options.dataSource=n;t._dataSource();t.listView.setDataSource(t.dataSource);t.options.autoBind&&t.dataSource.fetch();i=t._parentWidget();i&&t._cascadeSelect(i)},close:function(){this.popup.close()},select:function(n){var i=this;if(n===t)return i.selectedIndex;i._select(n);i._old=i._accessor();i._oldIndex=i.selectedIndex},search:function(n){n=typeof n=="string"?n:this.text();var t=this,r=n.length,i=t.options,u=i.ignoreCase,f=i.filter,e=i.dataTextField;clearTimeout(t._typingTimeout);(!r||r>=i.minLength)&&(t._state="filter",t.listView.filter(!0),f==="none"?t._filter(n):(t._open=!0,t._filterSource({value:u?n.toLowerCase():n,field:e,operator:f,ignoreCase:u})))},_accessor:function(n,t){return this[this._isSelect?"_accessorSelect":"_accessorInput"](n,t)},_accessorInput:function(n){var i=this.element[0];if(n===t)return i.value;n===null&&(n="");i.value=n},_accessorSelect:function(n,i){var r=this.element[0],f=r.selectedIndex,u;if(n===t)return f>-1&&(u=r.options[f]),u&&(n=u.value),n||"";f>-1&&r.options[f].removeAttribute(s);i===t&&(i=-1);n!==null&&n!==""&&i==-1?this._custom(n):(n?r.value=n:r.selectedIndex=i,r.selectedIndex>-1&&(u=r.options[r.selectedIndex]),u&&u.setAttribute(s,s))},_custom:function(t){var r=this,u=r.element,i=r._customOption;i||(i=n("<option/>"),r._customOption=i,u.append(i));i.text(t);i[0].setAttribute(s,s);i[0].selected=!0},_hideBusy:function(){var n=this;clearTimeout(n._busy);n._arrow.removeClass(nt);n._focused.attr("aria-busy",!1);n._busy=null},_showBusy:function(){var n=this;(n._request=!0,n._busy)||(n._busy=setTimeout(function(){n._arrow&&(n._focused.attr("aria-busy",!0),n._arrow.addClass(nt))},100))},_requestEnd:function(){this._request=!1;this._hideBusy()},_dataSource:function(){var t=this,o=t.element,f=t.options,u=f.dataSource||{},e;u=n.isArray(u)?{data:u}:u;t._isSelect&&(e=o[0].selectedIndex,e>-1&&(f.index=e),u.select=o,u.fields=[{field:f.dataTextField},{field:f.dataValueField}]);t.dataSource?t._unbindDataSource():(t._requestStartHandler=r(t._showBusy,t),t._requestEndHandler=r(t._requestEnd,t),t._errorHandler=r(t._hideBusy,t));t.dataSource=i.data.DataSource.create(u).bind(it,t._requestStartHandler).bind(rt,t._requestEndHandler).bind("error",t._errorHandler)},_firstItem:function(){this.listView.focusFirst()},_lastItem:function(){this.listView.focusLast()},_nextItem:function(){this.listView.focusNext()},_prevItem:function(){this.listView.focusPrev()},_move:function(n){var t=this,r=n.keyCode,e=r===f.DOWN,s,u,i,h;if(r===f.UP||e){if(n.altKey)t.toggle(e);else{if(!t.listView.isBound()){if(!t._fetch){t.dataSource.one(o,function(){t._fetch=!1;t._move(n)});t._fetch=!0;t._filterSource()}return n.preventDefault(),!0}if(i=t._focus(),t._fetch||i&&!i.hasClass("k-state-selected")||(e?(t._nextItem(),t._focus()||t._lastItem()):(t._prevItem(),t._focus()||t._firstItem())),t.trigger(p,{item:t.listView.focus()})){t._focus(i);return}t._select(t._focus(),!0);t.popup.visible()||t._blur()}n.preventDefault();u=!0}else if(r===f.ENTER||r===f.TAB){if(t.popup.visible()&&n.preventDefault(),i=t._focus(),s=t.dataItem(),t.popup.visible()||s&&t.text()===t._text(s)||(i=null),h=t.filterInput&&t.filterInput[0]===d(),i){if(t.trigger(p,{item:i}))return;t._select(i)}else t.input&&(t._accessor(t.input.val()),t.listView.value(t.input.val()));t._focusElement&&t._focusElement(t.wrapper);h&&r===f.TAB?t.wrapper.focusout():t._blur();t.close();u=!0}else r===f.ESC&&(t.popup.visible()&&n.preventDefault(),t.close(),u=!0);return u},_fetchData:function(){var n=this,t=!!n.dataSource.view().length;n._request||n.options.cascadeFrom||n.listView.isBound()||n._fetch||t||(n._fetch=!0,n.dataSource.fetch().done(function(){n._fetch=!1}))},_options:function(n,i,r){var o=this,e=o.element,a=n.length,s="",f,h,c,u,l=0;for(i&&(s=i);l<a;l++)f="<option",h=n[l],c=o._text(h),u=o._value(h),u!==t&&(u+="",u.indexOf('"')!==-1&&(u=u.replace(ct,"&quot;")),f+=' value="'+u+'"'),f+=">",c!==t&&(f+=et(c)),f+="<\/option>",s+=f;e.html(s);r!==t&&(e[0].value=r,e[0].value&&!r&&(e[0].selectedIndex=-1))},_reset:function(){var t=this,i=t.element,r=i.attr("form"),u=r?n("#"+r):i.closest("form");u[0]&&(t._resetHandler=function(){setTimeout(function(){t.value(t._initial)})},t._form=u.on("reset",t._resetHandler))},_parentWidget:function(){var i=this.options.name,r=n("#"+this.options.cascadeFrom),t=r.data("kendo"+i);return t||(t=r.data("kendo"+lt[i])),t},_cascade:function(){var n=this,i=n.options,r=i.cascadeFrom,t;if(r){if(t=n._parentWidget(),!t)return;i.autoBind=!1;t.first("cascade",function(i){n._userTriggered=i.userTriggered;n.listView.isBound()&&n._clearSelection(t,!0);n._cascadeSelect(t)});t.listView.isBound()?n._cascadeSelect(t):t.value()||n.enable(!1)}},_cascadeChange:function(n){var t=this,i=t._accessor();t._userTriggered?t._clearSelection(n,!0):i?(i!==t.listView.value()[0]&&t.value(i),t.dataSource.view()[0]&&t.selectedIndex!==-1||t._clearSelection(n,!0)):t.dataSource.flatView().length&&t.select(t.options.index);t.enable();t._triggerCascade();t._userTriggered=!1},_cascadeSelect:function(n){var t=this,e=n.dataItem(),i=e?n._value(e):null,o=t.options.cascadeFromField||n.options.dataValueField,r,u,f;i||i===0?(r=t.dataSource.filter()||{},k(r,o),u=r.filters||[],u.push({field:o,operator:"eq",value:i}),f=function(){t.unbind("dataBound",f);t._cascadeChange(n)},t.first("dataBound",f),t.dataSource.filter(u)):(t.enable(!1),t._clearSelection(n),t._triggerCascade(),t._userTriggered=!1)}});h=".StaticList";ft=i.ui.DataBoundWidget.extend({init:function(t,f){u.fn.init.call(this,t,f);this.element.attr("role","listbox").on("click"+h,"li",r(this._click,this)).on("mouseenter"+h,"li",function(){n(this).addClass(v)}).on("mouseleave"+h,"li",function(){n(this).removeClass(v)});this.content=this.element.wrap("<div unselectable='on'><\/div>").parent().css({overflow:"auto",position:"relative"});this.header=this.content.before('<div class="k-group-header" style="display:none"><\/div>').prev();this._bound=!1;this._optionID=i.guid();this._selectedIndices=[];this._view=[];this._dataItems=[];this._values=[];var e=this.options.value;e&&(this._values=n.isArray(e)?e.slice(0):[e]);this._getter();this._templates();this.setDataSource(this.options.dataSource);this._onScroll=r(function(){var n=this;clearTimeout(n._scrollId);n._scrollId=setTimeout(function(){n._renderHeader()},50)},this)},options:{name:"StaticList",dataValueField:null,valuePrimitive:!1,selectable:!0,template:null,groupTemplate:null,fixedGroupTemplate:null},events:["click","change","activate","deactivate","dataBinding","dataBound","selectedItemChange"],setDataSource:function(t){var u=this,f=t||{},e;f=n.isArray(f)?{data:f}:f;f=i.data.DataSource.create(f);u.dataSource?(u.dataSource.unbind(o,u._refreshHandler),e=u.value(),u.value([]),u._bound=!1,u.value(e)):u._refreshHandler=r(u.refresh,u);u.dataSource=f.bind(o,u._refreshHandler);u._fixedHeader()},setOptions:function(n){u.fn.setOptions.call(this,n);this._getter();this._templates();this._render()},destroy:function(){this.element.off(h);this._refreshHandler&&this.dataSource.unbind(o,this._refreshHandler);clearTimeout(this._scrollId);u.fn.destroy.call(this)},scrollToIndex:function(n){var t=this.element[0].children[n];t&&this.scroll(t)},scroll:function(n){if(n){n[0]&&(n=n[0]);var i=this.content[0],r=n.offsetTop,e=n.offsetHeight,t=i.scrollTop,u=i.clientHeight,f=r+e;t>r?t=r:f>t+u&&(t=f-u);i.scrollTop=t}},selectedDataItems:function(i){var r=this._valueGetter;if(i===t)return this._dataItems.slice();this._dataItems=i;this._values=n.map(i,function(n){return r(n)})},focusNext:function(){var n=this.focus();n=n?n.next():0;this.focus(n)},focusPrev:function(){var n=this.focus();n=n?n.prev():this.element[0].children.length-1;this.focus(n)},focusFirst:function(){this.focus(this.element[0].children[0])},focusLast:function(){this.focus(this.element[0].children[this.element[0].children.length-1])},focus:function(i){var r=this,f=r._optionID,u;if(i===t)return r._current;i=r._get(i);i=i[i.length-1];i=n(this.element[0].children[i]);r._current&&(r._current.removeClass(g).removeAttr("aria-selected").removeAttr(l),r.trigger("deactivate"));u=!!i[0];u&&(i.addClass(g),r.scroll(i),i.attr("id",f));r._current=u?i:null;r.trigger("activate")},focusIndex:function(){return this.focus()?this.focus().index():t},filter:function(n){if(n===t)return this._filtered;this._filtered=n},skipUpdate:function(n){this._skipUpdate=n},select:function(i){var r=this,h=r.options.selectable,u=h!=="multiple"&&h!==!1,f=r._selectedIndices,e=[],o=[],s;if(i===t)return f.slice();if(i=r._get(i),i.length===1&&i[0]===-1&&(i=[]),!r._filtered||u||!r._deselectFiltered(i)){if(u&&!r._filtered&&n.inArray(i[i.length-1],f)!==-1){r._dataItems.length&&r._view.length&&(r._dataItems=[r._view[f[0]].item]);return}s=r._deselect(i);o=s.removed;i=s.indices;i.length&&(u&&(i=[i[i.length-1]]),e=r._select(i));(e.length||o.length)&&(r._valueComparer=null,r.trigger("change",{added:e,removed:o}))}},removeAt:function(n){return this._selectedIndices.splice(n,1),this._values.splice(n,1),this._valueComparer=null,{position:n,dataItem:this._dataItems.splice(n,1)[0]}},setValue:function(t){t=n.isArray(t)||t instanceof ot?t.slice(0):[t];this._values=t;this._valueComparer=null},value:function(i){var r=this,u=r._valueDeferred,f;return i===t?r._values.slice():(r.setValue(i),u&&u.state()!=="resolved"||(r._valueDeferred=u=n.Deferred()),r.isBound()&&(f=r._valueIndices(r._values),r.options.selectable==="multiple"&&r.select(-1),r.select(f),u.resolve()),r._skipUpdate=!1,u)},items:function(){return this.element.children(".k-item")},_click:function(t){t.isDefaultPrevented()||this.trigger("click",{item:n(t.currentTarget)})||this.select(t.currentTarget)},_valueExpr:function(n,i){var u=this,r,f=0,o,s,e=[];if(!u._valueComparer||u._valueType!==n){for(u._valueType=n;f<i.length;f++)r=i[f],r!==t&&r!==""&&r!==null&&(n==="boolean"?r=Boolean(r):n==="number"?r=Number(r):n==="string"&&(r=r.toString())),e.push(r);o="for (var idx = 0; idx < "+e.length+"; idx++) { if (current === values[idx]) {   return idx; }} return -1;";s=new Function(["current","values"],o);u._valueComparer=function(n){return s(n,e)}}return u._valueComparer},_dataItemPosition:function(n,t){var i=this._valueGetter(n),r=this._valueExpr(typeof i,t);return r(i)},_getter:function(){this._valueGetter=i.getter(this.options.dataValueField)},_deselect:function(t){var u=this,e=u.element[0].children,c=u.options.selectable,f=u._selectedIndices,l=u._dataItems,v=u._values,o=[],i=0,r,s,h,a=0;if(t=t.slice(),c!==!0&&t.length){if(c==="multiple")for(;i<t.length;i++)if(s=t[i],n(e[s]).hasClass("k-state-selected"))for(r=0;r<f.length;r++)if(h=f[r],h===s){n(e[h]).removeClass("k-state-selected");o.push({position:r+a,dataItem:l.splice(r,1)[0]});f.splice(r,1);t.splice(i,1);v.splice(r,1);a+=1;i-=1;r-=1;break}}else{for(;i<f.length;i++)n(e[f[i]]).removeClass("k-state-selected"),o.push({position:i,dataItem:l[i]});u._values=[];u._dataItems=[];u._selectedIndices=[]}return{indices:t,removed:o}},_deselectFiltered:function(t){for(var o=this.element[0].children,e,i,r,u=[],f=0;f<t.length;f++)i=t[f],e=this._view[i].item,r=this._dataItemPosition(e,this._values),r>-1&&(u.push(this.removeAt(r)),n(o[i]).removeClass("k-state-selected"));return u.length?(this.trigger("change",{added:[],removed:u}),!0):!1},_select:function(t){var i=this,o=i.element[0].children,s=i._view,r,u,e=[],f=0;for(t[t.length-1]!==-1&&i.focus(t);f<t.length;f++)(u=t[f],r=s[u],u!==-1&&r)&&(r=r.item,i._selectedIndices.push(u),i._dataItems.push(r),i._values.push(i._valueGetter(r)),n(o[u]).addClass("k-state-selected").attr("aria-selected",!0),e.push({dataItem:r}));return e},_get:function(i){return typeof i=="number"?i=[i]:st(i)||(i=n(i).data("offset-index"),i===t&&(i=-1),i=[i]),i},_template:function(){var r=this,t=r.options,n=t.template;return n?(n=i.template(n),n=function(t){return'<li tabindex="-1" role="option" unselectable="on" class="k-item">'+n(t)+"<\/li>"}):n=i.template('<li tabindex="-1" role="option" unselectable="on" class="k-item">${'+i.expr(t.dataTextField,"data")+"}<\/li>",{useWithBlock:!1}),n},_templates:function(){var n,t={template:this.options.template,groupTemplate:this.options.groupTemplate,fixedGroupTemplate:this.options.fixedGroupTemplate};for(var r in t)n=t[r],n&&typeof n!="function"&&(t[r]=i.template(n));this.templates=t},_normalizeIndices:function(n){for(var r=[],i=0;i<n.length;i++)n[i]!==t&&r.push(n[i]);return r},_valueIndices:function(n,t){var u=this._view,i=0,r;if(t=t?t.slice():[],!n.length)return[];for(;i<u.length;i++)r=this._dataItemPosition(u[i].item,n),r!==-1&&(t[r]=i);return this._normalizeIndices(t)},_firstVisibleItem:function(){for(var r=this.element[0],f=this.content[0],i=f.scrollTop,u=n(r.children[0]).height(),e=Math.floor(i/u)||0,t=r.children[e]||r.lastChild,o=t.offsetTop<i;t;)if(o){if(t.offsetTop+u>i||!t.nextSibling)break;t=t.nextSibling}else{if(t.offsetTop<=i||!t.previousSibling)break;t=t.previousSibling}return this._view[n(t).data("offset-index")]},_fixedHeader:function(){this.isGrouped()&&this.templates.fixedGroupTemplate?(this.header.show(),this.content.scroll(this._onScroll)):(this.header.hide(),this.content.off("scroll",this._onScroll))},_renderHeader:function(){var t=this.templates.fixedGroupTemplate,n;t&&(n=this._firstVisibleItem(),n&&this.header.html(t(n.group)))},_renderItem:function(n){var t='<li tabindex="-1" role="option" unselectable="on" class="k-item',u=n.item,i=n.index!==0,r=n.selected;return i&&n.newGroup&&(t+=" k-first"),r&&(t+=" k-state-selected"),t+='"'+(r?' aria-selected="true"':"")+' data-offset-index="'+n.index+'">',t+=this.templates.template(u),i&&n.newGroup&&(t+='<div class="k-group">'+this.templates.groupTemplate(n.group)+"<\/div>"),t+"<\/li>"},_render:function(){var e="",n=0,o=0,t,f=[],i=this.dataSource.view(),h=this.value(),r,s,u,c=this.isGrouped();if(c)for(n=0;n<i.length;n++)for(r=i[n],s=!0,u=0;u<r.items.length;u++)t={selected:this._selected(r.items[u],h),item:r.items[u],group:r.value,newGroup:s,index:o},f[o]=t,o+=1,e+=this._renderItem(t),s=!1;else for(n=0;n<i.length;n++)t={selected:this._selected(i[n],h),item:i[n],index:n},f[n]=t,e+=this._renderItem(t);this._view=f;this.element[0].innerHTML=e;c&&f.length&&this._renderHeader()},_selected:function(n,t){var i=!this._filtered||this.options.selectable==="multiple";return i&&this._dataItemPosition(n,t)!==-1},refresh:function(n){var t=this,i,r=n&&n.action;t.trigger("dataBinding");t._fixedHeader();t._render();t._bound=!0;r==="itemchange"?(i=at(t._dataItems,n.items),i.length&&t.trigger("selectedItemChange",{items:i})):t._filtered||t._skipUpdate?(t.focus(0),t._skipUpdate&&(t._skipUpdate=!1,t._selectedIndices=t._valueIndices(t._values,t._selectedIndices))):t.options.skipUpdateOnBind||r&&r!=="add"||t.value(t._values);t._valueDeferred&&t._valueDeferred.resolve();t.trigger("dataBound")},isBound:function(){return this._bound},isGrouped:function(){return(this.dataSource.group()||[]).length}});c.plugin(ft)})(window.kendo.jQuery)}(),function(){(function(n,t){function li(n,t,i,r){var u=n.getFullYear(),e=t.getFullYear(),o=i.getFullYear(),f;return u=u-u%r,f=u+(r-1),u<e&&(u=e),f>o&&(f=o),u+"-"+f}function d(n){for(var r=0,u,e=n.min,o=n.max,t=n.start,s=n.setter,h=n.build,c=n.cells||12,a=n.perRow||4,v=n.content||bi,y=n.empty||ki,f=n.html||'<table tabindex="0" role="grid" class="k-content k-meta-view" cellspacing="0"><tbody><tr role="row">';r<c;r++)r>0&&r%a==0&&(f+='<\/tr><tr role="row">'),t=new i(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0),l(t,0),u=h(t,r),f+=nt(t,e,o)?v(u):y(u),s(t,1);return f+"<\/tr><\/tbody><\/table>"}function st(n,t,i){var f=n.getFullYear(),r=t.getFullYear(),e=r,u=0;return i&&(r=r-r%i,e=r-r%i+i-1),f>e?u=1:f<r&&(u=-1),u}function g(){var n=new i;return new i(n.getFullYear(),n.getMonth(),n.getDate())}function y(n,t,r){var u=g();return n&&(u=new i(+n)),t>u?u=new i(+t):r<u&&(u=new i(+r)),u}function nt(n,t,i){return+n>=+t&&+n<=+i}function ai(n,t){return n.slice(t).concat(n.slice(0,t))}function vi(n,t,r){t=t instanceof i?t.getFullYear():n.getFullYear()+r*t;n.setFullYear(t)}function yi(t){n(this).toggleClass(nr,tr.indexOf(t.type)>-1||t.type==ri)}function ur(n){n.preventDefault()}function ht(n){return at(n).calendars.standard}function ct(n){var i=o[n.start],r=o[n.depth],u=at(n.culture);n.format=wi(n.format||u.calendars.standard.patterns.d);isNaN(i)&&(i=0,n.start=v);(r===t||r>i)&&(n.depth=v);n.dates||(n.dates=[])}function pi(n){di&&n.find("*").attr("unselectable","on")}function fr(n,t){for(var i=0,r=t.length;i<r;i++)if(n===+t[i])return!0;return!1}function er(n,t){return n?n.getFullYear()===t.getFullYear()&&n.getMonth()===t.getMonth()&&n.getDate()===t.getDate():!1}function or(n,t){return n?n.getFullYear()===t.getFullYear()&&n.getMonth()===t.getMonth():!1}var r=window.kendo,tt=r.support,lt=r.ui,p=lt.Widget,f=r.keys,it=r.parseDate,l=r.date.adjustDST,wi=r._extractFormat,a=r.template,at=r.getCulture,vt=r.support.transitions,yt=vt?vt.css+"transform-origin":"",bi=a('<td#=data.cssClass# role="gridcell"><a tabindex="-1" class="k-link" href="\\#" data-#=data.ns#value="#=data.dateString#">#=data.value#<\/a><\/td>',{useWithBlock:!1}),ki=a('<td role="gridcell">&nbsp;<\/td>',{useWithBlock:!1}),pt=r.support.browser,di=pt.msie&&pt.version<9,u=".kendoCalendar",s="click"+u,gi="keydown"+u,rt="id",wt="min",bt="left",ut="slideIn",v="month",kt="century",ft="change",dt="navigate",et="value",nr="k-state-hover",h="k-state-disabled",c="k-state-focused",w="k-other-month",gt=' class="'+w+'"',ni="k-nav-today",ti="td:has(.k-link)",ii="blur"+u,ri="focus",ui=ri+u,tr=tt.touch?"touchstart":"mouseenter",fi=tt.touch?"touchstart"+u:"mouseenter"+u,ei=tt.touch?"touchend"+u+" touchmove"+u:"mouseleave"+u,ir=6e4,oi=864e5,b="_prevArrow",k="_nextArrow",ot="aria-disabled",si="aria-selected",hi=n.proxy,ci=n.extend,i=Date,o={month:0,year:1,decade:2,century:3},rr=p.extend({init:function(t,f){var e=this,h,l;p.fn.init.call(e,t,f);t=e.wrapper=e.element;f=e.options;f.url=window.unescape(f.url);e._templates();e._header();e._footer(e.footer);l=t.addClass("k-widget k-calendar").on(fi+" "+ei,ti,yi).on(gi,"table.k-content",hi(e._move,e)).on(s,ti,function(t){var i=t.currentTarget.firstChild;i.href.indexOf("#")!=-1&&t.preventDefault();e._click(n(i))}).on("mouseup"+u,"table.k-content, .k-footer",function(){e._focusView(e.options.focusOnNav!==!1)}).attr(rt);l&&(e._cellID=l+"_cell_selected");ct(f);h=it(f.value,f.format,f.culture);e._index=o[f.start];e._current=new i(+y(h,f.min,f.max));e._addClassProxy=function(){e._active=!0;e._cell.addClass(c)};e._removeClassProxy=function(){e._active=!1;e._cell.removeClass(c)};e.value(h);r.notify(e)},options:{name:"Calendar",value:null,min:new i(1900,0,1),max:new i(2099,11,31),dates:[],url:"",culture:"",footer:"",format:"",month:{},start:v,depth:v,animation:{horizontal:{effects:ut,reverse:!0,duration:500,divisor:2},vertical:{effects:"zoomIn",duration:400}}},events:[ft,dt],setOptions:function(n){var t=this;ct(n);n.dates[0]||(n.dates=t.options.dates);p.fn.setOptions.call(t,n);t._templates();t._footer(t.footer);t._index=o[t.options.start];t.navigate()},destroy:function(){var n=this,t=n._today;n.element.off(u);n._title.off(u);n[b].off(u);n[k].off(u);r.destroy(n._table);t&&r.destroy(t.off(u));p.fn.destroy.call(n)},current:function(){return this._current},view:function(){return this._view},focus:function(n){n=n||this._table;this._bindTable(n);n.focus()},min:function(n){return this._option(wt,n)},max:function(n){return this._option("max",n)},navigateToPast:function(){this._navigate(b,-1)},navigateToFuture:function(){this._navigate(k,1)},navigateUp:function(){var n=this,t=n._index;n._title.hasClass(h)||n.navigate(n._current,++t)},navigateDown:function(n){var t=this,i=t._index,r=t.options.depth;if(n){if(i===o[r]){+t._value!=+n&&(t.value(n),t.trigger(ft));return}t.navigate(n,--i)}},navigate:function(r,u){u=isNaN(u)?o[u]:u;var f=this,l=f.options,tt=l.culture,p=l.min,w=l.max,it=f._title,v=f._table,d=f._oldTable,rt=f._value,ut=f._current,ft=r&&+r>+ut,et=u!==t&&u!==f._index,g,a,nt,s;r||(r=ut);f._current=r=new i(+y(r,p,w));u===t?u=f._index:f._index=u;f._view=a=e.views[u];nt=a.compare;s=u===o[kt];it.toggleClass(h,s).attr(ot,s);s=nt(r,p)<1;f[b].toggleClass(h,s).attr(ot,s);s=nt(r,w)>-1;f[k].toggleClass(h,s).attr(ot,s);v&&d&&d.data("animating")&&(d.kendoStop(!0,!0),v.kendoStop(!0,!0));f._oldTable=v;(!v||f._changeView)&&(it.html(a.title(r,p,w,tt)),f._table=g=n(a.content(ci({min:p,max:w,date:r,url:l.url,dates:l.dates,format:l.format,culture:tt},f[a.name]))),pi(g),f._animate({from:v,to:g,vertical:et,future:ft}),f._focus(r),f.trigger(dt));u===o[l.depth]&&rt&&f._class("k-state-selected",a.toDateString(rt));f._class(c,a.toDateString(r));!v&&f._cell&&f._cell.removeClass(c);f._changeView=!0},value:function(n){var r=this,f=r._view,u=r.options,e=r._view,o=u.min,s=u.max;if(n===t)return r._value;n=it(n,u.format,u.culture);n!==null&&(n=new i(+n),nt(n,o,s)||(n=null));r._value=n;e&&n===null&&r._cell?r._cell.removeClass("k-state-selected"):(r._changeView=!n||f&&f.compare(n,r._current)!==0,r.navigate(n))},_move:function(t){var u=this,v=u.options,e=t.keyCode,p=u._view,w=u._index,s=new i(+u._current),h=r.support.isRtl(u.wrapper),c,o,l,a;return t.target===u._table[0]&&(u._active=!0),t.ctrlKey?e==f.RIGHT&&!h||e==f.LEFT&&h?(u.navigateToFuture(),o=!0):e==f.LEFT&&!h||e==f.RIGHT&&h?(u.navigateToPast(),o=!0):e==f.UP?(u.navigateUp(),o=!0):e==f.DOWN&&(u._click(n(u._cell[0].firstChild)),o=!0):(e==f.RIGHT&&!h||e==f.LEFT&&h?(c=1,o=!0):e==f.LEFT&&!h||e==f.RIGHT&&h?(c=-1,o=!0):e==f.UP?(c=w===0?-7:-4,o=!0):e==f.DOWN?(c=w===0?7:4,o=!0):e==f.ENTER?(u._click(n(u._cell[0].firstChild)),o=!0):e==f.HOME||e==f.END?(l=e==f.HOME?"first":"last",a=p[l](s),s=new i(a.getFullYear(),a.getMonth(),a.getDate(),s.getHours(),s.getMinutes(),s.getSeconds(),s.getMilliseconds()),o=!0):e==f.PAGEUP?(o=!0,u.navigateToPast()):e==f.PAGEDOWN&&(o=!0,u.navigateToFuture()),(c||l)&&(l||p.setDate(s,c),u._focus(y(s,v.min,v.max)))),o&&t.preventDefault(),u._current},_animate:function(n){var i=this,t=n.from,r=n.to,f=i._active;t?t.parent().data("animating")?(t.off(u),t.parent().kendoStop(!0,!0).remove(),t.remove(),r.insertAfter(i.element[0].firstChild),i._focusView(f)):t.is(":visible")&&i.options.animation!==!1?i[n.vertical?"_vertical":"_horizontal"](t,r,n.future):(r.insertAfter(t),t.off(u).remove(),i._focusView(f)):(r.insertAfter(i.element[0].firstChild),i._bindTable(r))},_horizontal:function(n,t,i){var r=this,o=r._active,f=r.options.animation.horizontal,s=f.effects,e=n.outerWidth();s&&s.indexOf(ut)!=-1&&(n.add(t).css({width:e}),n.wrap("<div/>"),r._focusView(o,n),n.parent().css({position:"relative",width:e*2,float:bt,"margin-left":i?0:-e}),t[i?"insertAfter":"insertBefore"](n),ci(f,{effects:ut+":"+(i?"right":bt),complete:function(){n.off(u).remove();r._oldTable=null;t.unwrap();r._focusView(o)}}),n.parent().kendoStop(!0,!0).kendoAnimate(f))},_vertical:function(n,t){var i=this,e=i.options.animation.vertical,o=e.effects,s=i._active,f,r;o&&o.indexOf("zoom")!=-1&&(t.css({position:"absolute",top:n.prev().outerHeight(),left:0}).insertBefore(n),yt&&(f=i._cellByDate(i._view.toDateString(i._current)),r=f.position(),r=r.left+parseInt(f.width()/2,10)+"px "+(r.top+parseInt(f.height()/2,10)+"px"),t.css(yt,r)),n.kendoStop(!0,!0).kendoAnimate({effects:"fadeOut",duration:600,complete:function(){n.off(u).remove();i._oldTable=null;t.css({position:"static",top:0,left:0});i._focusView(s)}}),t.kendoStop(!0,!0).kendoAnimate(e))},_cellByDate:function(t){return this._table.find("td:not(."+w+")").filter(function(){return n(this.firstChild).attr(r.attr(et))===t})},_class:function(t,i){var u=this,e=u._cellID,f=u._cell;f&&f.removeAttr(si).removeAttr("aria-label").removeAttr(rt);f=u._table.find("td:not(."+w+")").removeClass(t).filter(function(){return n(this.firstChild).attr(r.attr(et))===i}).attr(si,!0);t!==c||u._active||u.options.focusOnNav===!1||(t="");f.addClass(t);f[0]&&(u._cell=f);e&&(f.attr(rt,e),u._table.removeAttr("aria-activedescendant").attr("aria-activedescendant",e))},_bindTable:function(n){n.on(ui,this._addClassProxy).on(ii,this._removeClassProxy)},_click:function(n){var u=this,f=u.options,e=new Date(+u._current),t=n.attr(r.attr(et)).split("/");t=new i(t[0],t[1],t[2]);l(t,0);u._view.setDate(e,t);u.navigateDown(y(e,f.min,f.max))},_focus:function(n){var t=this,i=t._view;i.compare(n,t._current)!==0?t.navigate(n):(t._current=n,t._class(c,i.toDateString(n)))},_focusView:function(n,t){n&&this.focus(t)},_footer:function(t){var i=this,f=g(),e=i.element,u=e.find(".k-footer");if(!t){i._toggle(!1);u.hide();return}u[0]||(u=n('<div class="k-footer"><a href="#" class="k-link k-nav-today"><\/a><\/div>').appendTo(e));i._today=u.show().find(".k-link").html(t(f)).attr("title",r.toString(f,"D",i.options.culture));i._toggle()},_header:function(){var n=this,i=n.element,t;i.find(".k-header")[0]||i.html('<div class="k-header"><a href="#" role="button" class="k-link k-nav-prev"><span class="k-icon k-i-arrow-w"><\/span><\/a><a href="#" role="button" aria-live="assertive" aria-atomic="true" class="k-link k-nav-fast"><\/a><a href="#" role="button" class="k-link k-nav-next"><span class="k-icon k-i-arrow-e"><\/span><\/a><\/div>');t=i.find(".k-link").on(fi+" "+ei+" "+ui+" "+ii,yi).click(!1);n._title=t.eq(1).on(s,function(){n._active=n.options.focusOnNav!==!1;n.navigateUp()});n[b]=t.eq(0).on(s,function(){n._active=n.options.focusOnNav!==!1;n.navigateToPast()});n[k]=t.eq(2).on(s,function(){n._active=n.options.focusOnNav!==!1;n.navigateToFuture()})},_navigate:function(n,t){var r=this,f=r._index+1,u=new i(+r._current);n=r[n];n.hasClass(h)||(f>3?u.setFullYear(u.getFullYear()+100*t):e.views[f].setDate(u,t),r.navigate(u))},_option:function(n,r){var u=this,f=u.options,e=u._value||u._current,o;if(r===t)return f[n];(r=it(r,f.format,f.culture),r)&&(f[n]=new i(+r),o=n===wt?r>e:e>r,(o||or(e,r))&&(o&&(u._value=null),u._changeView=!0),u._changeView||(u._changeView=!!(f.month.content||f.month.empty)),u.navigate(u._value),u._toggle())},_toggle:function(n){var i=this,u=i.options,r=i._today;if(n===t&&(n=nt(g(),u.min,u.max)),r)if(r.off(s),n)r.addClass(ni).removeClass(h).on(s,hi(i._todayClick,i));else r.removeClass(ni).addClass(h).on(s,ur)},_todayClick:function(n){var t=this,r=o[t.options.depth],i=g();n.preventDefault();t._view.compare(t._current,i)===0&&t._index==r&&(t._changeView=!1);t._value=i;t.navigate(i,r);t.trigger(ft)},_templates:function(){var n=this,t=n.options,i=t.footer,u=t.month,f=u.content,e=u.empty;n.month={content:a('<td#=data.cssClass# role="gridcell"><a tabindex="-1" class="k-link#=data.linkClass#" href="#=data.url#" '+r.attr("value")+'="#=data.dateString#" title="#=data.title#">'+(f||"#=data.value#")+"<\/a><\/td>",{useWithBlock:!!f}),empty:a('<td role="gridcell">'+(e||"&nbsp;")+"<\/td>",{useWithBlock:!!e})};n.footer=i!==!1?a(i||'#= kendo.toString(data,"D","'+t.culture+'") #',{useWithBlock:!1}):null}}),e;lt.plugin(rr);e={firstDayOfMonth:function(n){return new i(n.getFullYear(),n.getMonth(),1)},firstVisibleDay:function(n,t){t=t||r.culture().calendar;for(var f=t.firstDay,u=new i(n.getFullYear(),n.getMonth(),0,n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds());u.getDay()!=f;)e.setTime(u,-1*oi);return u},setTime:function(n,t){var u=n.getTimezoneOffset(),r=new i(n.getTime()+t),f=r.getTimezoneOffset()-u;n.setTime(r.getTime()+f*ir)},views:[{name:v,title:function(n,t,i,r){return ht(r).months.names[n.getMonth()]+" "+n.getFullYear()},content:function(n){for(var u=this,f=0,o=n.min,s=n.max,h=n.date,c=n.dates,g=n.format,a=n.culture,y=n.url,nt=y&&c[0],v=ht(a),p=v.firstDay,b=v.days,tt=ai(b.names,p),it=ai(b.namesShort,p),rt=e.firstVisibleDay(h,v),ut=u.first(h),ft=u.last(h),et=u.toDateString,t=new i,k='<table tabindex="0" role="grid" class="k-content" cellspacing="0"><thead><tr role="row">';f<7;f++)k+='<th scope="col" title="'+tt[f]+'">'+it[f]+"<\/th>";return t=new i(t.getFullYear(),t.getMonth(),t.getDate()),l(t,0),t=+t,d({cells:42,perRow:7,html:k+='<\/tr><\/thead><tbody><tr role="row">',start:rt,min:new i(o.getFullYear(),o.getMonth(),o.getDate()),max:new i(s.getFullYear(),s.getMonth(),s.getDate()),content:n.content,empty:n.empty,setter:u.setDate,build:function(n){var i=[],u=n.getDay(),f="",e="#";return(n<ut||n>ft)&&i.push(w),+n===t&&i.push("k-today"),(u===0||u===6)&&i.push("k-weekend"),nt&&fr(+n,c)&&(e=y.replace("{0}",r.toString(n,g,a)),f=" k-action-link"),{date:n,dates:c,ns:r.ns,title:r.toString(n,"D",a),value:n.getDate(),dateString:et(n),cssClass:i[0]?' class="'+i.join(" ")+'"':"",linkClass:f,url:e}}})},first:function(n){return e.firstDayOfMonth(n)},last:function(n){var t=new i(n.getFullYear(),n.getMonth()+1,0),r=e.firstDayOfMonth(n),u=Math.abs(t.getTimezoneOffset()-r.getTimezoneOffset());return u&&t.setHours(r.getHours()+u/60),t},compare:function(n,t){var i=n.getMonth(),r=n.getFullYear(),u=t.getMonth(),f=t.getFullYear();return r>f?1:r<f?-1:i==u?0:i>u?1:-1},setDate:function(n,t){var r=n.getHours();t instanceof i?n.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()):e.setTime(n,t*oi);l(n,r)},toDateString:function(n){return n.getFullYear()+"/"+n.getMonth()+"/"+n.getDate()}},{name:"year",title:function(n){return n.getFullYear()},content:function(n){var f=ht(n.culture).months.namesAbbr,e=this.toDateString,t=n.min,u=n.max;return d({min:new i(t.getFullYear(),t.getMonth(),1),max:new i(u.getFullYear(),u.getMonth(),1),start:new i(n.date.getFullYear(),0,1),setter:this.setDate,build:function(n){return{value:f[n.getMonth()],ns:r.ns,dateString:e(n),cssClass:""}}})},first:function(n){return new i(n.getFullYear(),0,n.getDate())},last:function(n){return new i(n.getFullYear(),11,n.getDate())},compare:function(n,t){return st(n,t)},setDate:function(n,t){var r,u=n.getHours();t instanceof i?(r=t.getMonth(),n.setFullYear(t.getFullYear(),r,n.getDate()),r!==n.getMonth()&&n.setDate(0)):(r=n.getMonth()+t,n.setMonth(r),r>11&&(r-=12),r>0&&n.getMonth()!=r&&n.setDate(0));l(n,u)},toDateString:function(n){return n.getFullYear()+"/"+n.getMonth()+"/1"}},{name:"decade",title:function(n,t,i){return li(n,t,i,10)},content:function(n){var t=n.date.getFullYear(),u=this.toDateString;return d({start:new i(t-t%10-1,0,1),min:new i(n.min.getFullYear(),0,1),max:new i(n.max.getFullYear(),0,1),setter:this.setDate,build:function(n,t){return{value:n.getFullYear(),ns:r.ns,dateString:u(n),cssClass:t===0||t==11?gt:""}}})},first:function(n){var t=n.getFullYear();return new i(t-t%10,n.getMonth(),n.getDate())},last:function(n){var t=n.getFullYear();return new i(t-t%10+9,n.getMonth(),n.getDate())},compare:function(n,t){return st(n,t,10)},setDate:function(n,t){vi(n,t,1)},toDateString:function(n){return n.getFullYear()+"/0/1"}},{name:kt,title:function(n,t,i){return li(n,t,i,100)},content:function(n){var o=n.date.getFullYear(),f=n.min.getFullYear(),e=n.max.getFullYear(),s=this.toDateString,t=f,u=e;return t=t-t%10,u=u-u%10,u-t<10&&(u=t+9),d({start:new i(o-o%100-10,0,1),min:new i(t,0,1),max:new i(u,0,1),setter:this.setDate,build:function(n,t){var i=n.getFullYear(),u=i+9;return i<f&&(i=f),u>e&&(u=e),{ns:r.ns,value:i+" - "+u,dateString:s(n),cssClass:t===0||t==11?gt:""}}})},first:function(n){var t=n.getFullYear();return new i(t-t%100,n.getMonth(),n.getDate())},last:function(n){var t=n.getFullYear();return new i(t-t%100+99,n.getMonth(),n.getDate())},compare:function(n,t){return st(n,t,100)},setDate:function(n,t){vi(n,t,10)},toDateString:function(n){var t=n.getFullYear();return t-t%10+"/0/1"}}]};e.isEqualDatePart=er;e.makeUnselectable=pi;e.restrictValue=y;e.isInRange=nt;e.normalize=ct;e.viewsEnum=o;r.calendar=e})(window.kendo.jQuery)}(),function(){(function(n,t){function d(t){var i=t.parseFormats,r=t.format;s.normalize(t);i=n.isArray(i)?i:[i];i.length||i.push("yyyy-MM-dd");n.inArray(r,i)===-1&&i.splice(0,0,t.format);t.parseFormats=i}function pt(n){n.preventDefault()}var i=window.kendo,e=i.ui,o=e.Widget,u=i.parseDate,f=i.keys,bt=i.template,kt=i._activeElement,g="<div />",nt="<span />",r=".kendoDatePicker",tt="click"+r,a="open",v="close",y="change",it="disabled",rt="readonly",p="k-state-default",ut="k-state-focused",ft="k-state-selected",w="k-state-disabled",dt="k-state-hover",gt="mouseenter"+r+" mouseleave"+r,et="mousedown"+r,b="id",ot="min",st="max",ht="month",ct="aria-disabled",lt="aria-expanded",k="aria-hidden",at="aria-readonly",s=i.calendar,ni=s.isInRange,vt=s.restrictValue,ti=s.isEqualDatePart,h=n.extend,c=n.proxy,yt=Date,l=function(t){var r=this,u,o=document.body,f=n(g).attr(k,"true").addClass("k-calendar-container").appendTo(o);r.options=t=t||{};u=t.id;u&&(u+="_dateview",f.attr(b,u),r._dateViewID=u);r.popup=new e.Popup(f,h(t.popup,t,{name:"Popup",isRtl:i.support.isRtl(t.anchor)}));r.div=f;r.value(t.value)},wt;l.prototype={_calendar:function(){var t=this,r=t.calendar,u=t.options,f;r||(f=n(g).attr(b,i.guid()).appendTo(t.popup.element).on(et,pt).on(tt,"td:has(.k-link)",c(t._click,t)),t.calendar=r=new e.Calendar(f),t._setOptions(u),i.calendar.makeUnselectable(r.element),r.navigate(t._value||t._current,u.start),t.value(t._value))},_setOptions:function(n){this.calendar.setOptions({focusOnNav:!1,change:n.change,culture:n.culture,dates:n.dates,depth:n.depth,footer:n.footer,format:n.format,max:n.max,min:n.min,month:n.month,start:n.start})},setOptions:function(n){var t=this.options;this.options=h(t,n,{change:t.change,close:t.close,open:t.open});this.calendar&&this._setOptions(this.options)},destroy:function(){this.popup.destroy()},open:function(){var n=this;n._calendar();n.popup.open()},close:function(){this.popup.close()},min:function(n){this._option(ot,n)},max:function(n){this._option(st,n)},toggle:function(){var n=this;n[n.popup.visible()?v:a]()},move:function(n){var t=this,i=n.keyCode,u=t.calendar,e=n.ctrlKey&&i==f.DOWN||i==f.ENTER,r=!1;if(n.altKey)i==f.DOWN?(t.open(),n.preventDefault(),r=!0):i==f.UP&&(t.close(),n.preventDefault(),r=!0);else if(t.popup.visible()){if(i==f.ESC||e&&u._cell.hasClass(ft))return t.close(),n.preventDefault(),!0;t._current=u._move(n);r=!0}return r},current:function(n){this._current=n;this.calendar._focus(n)},value:function(n){var t=this,i=t.calendar,r=t.options;t._value=n;t._current=new yt(+vt(n,r.min,r.max));i&&i.value(n)},_click:function(n){n.currentTarget.className.indexOf(ft)!==-1&&this.close()},_option:function(n,t){var i=this,r=i.calendar;i.options[n]=t;r&&r[n](t)}};l.normalize=d;i.DateView=l;wt=o.extend({init:function(t,r){var f=this,s,e;o.fn.init.call(f,t,r);t=f.element;r=f.options;r.min=u(t.attr("min"))||u(r.min);r.max=u(t.attr("max"))||u(r.max);d(r);f._initialOptions=h({},r);f._wrapper();f.dateView=new l(h({},r,{id:t.attr(b),anchor:f.wrapper,change:function(){f._change(this.value());f.close()},close:function(n){f.trigger(v)?n.preventDefault():(t.attr(lt,!1),e.attr(k,!0))},open:function(n){var r=f.options,i;f.trigger(a)?n.preventDefault():(f.element.val()!==f._oldText&&(i=u(t.val(),r.parseFormats,r.culture),f.dateView[i?"current":"value"](i)),t.attr(lt,!0),e.attr(k,!1),f._updateARIA(i))}}));e=f.dateView.div;f._icon();try{t[0].setAttribute("type","text")}catch(c){t[0].type="text"}t.addClass("k-input").attr({role:"combobox","aria-expanded":!1,"aria-owns":f.dateView._dateViewID});f._reset();f._template();s=t.is("[disabled]")||n(f.element).parents("fieldset").is(":disabled");s?f.enable(!1):f.readonly(t.is("[readonly]"));f._old=f._update(r.value||f.element.val());f._oldText=t.val();i.notify(f)},events:[a,v,y],options:{name:"DatePicker",value:null,footer:"",format:"",culture:"",parseFormats:[],min:new Date(1900,0,1),max:new Date(2099,11,31),start:ht,depth:ht,animation:{},month:{},dates:[],ARIATemplate:'Current focused date is #=kendo.toString(data.current, "D")#'},setOptions:function(n){var t=this,r=t._value;o.fn.setOptions.call(t,n);n=t.options;n.min=u(n.min);n.max=u(n.max);d(n);t.dateView.setOptions(n);r&&(t.element.val(i.toString(r,n.format,n.culture)),t._updateARIA(r))},_editable:function(n){var t=this,o=t._dateIcon.off(r),f=t.element.off(r),e=t._inputWrapper.off(r),u=n.readonly,i=n.disable;if(u||i)e.addClass(i?w:p).removeClass(i?p:w),f.attr(it,i).attr(rt,u).attr(ct,i).attr(at,u);else{e.addClass(p).removeClass(w).on(gt,t._toggleHover);f.removeAttr(it).removeAttr(rt).attr(ct,!1).attr(at,!1).on("keydown"+r,c(t._keydown,t)).on("focusout"+r,c(t._blur,t)).on("focus"+r,function(){t._inputWrapper.addClass(ut)});o.on(tt,c(t._click,t)).on(et,pt)}},readonly:function(n){this._editable({readonly:n===t?!0:n,disable:!1})},enable:function(n){this._editable({readonly:!1,disable:!(n=n===t?!0:n)})},destroy:function(){var n=this;o.fn.destroy.call(n);n.dateView.destroy();n.element.off(r);n._dateIcon.off(r);n._inputWrapper.off(r);n._form&&n._form.off("reset",n._resetHandler)},open:function(){this.dateView.open()},close:function(){this.dateView.close()},min:function(n){return this._option(ot,n)},max:function(n){return this._option(st,n)},value:function(n){var i=this;if(n===t)return i._value;i._old=i._update(n);i._old===null&&i.element.val("");i._oldText=i.element.val()},_toggleHover:function(t){n(t.currentTarget).toggleClass(dt,t.type==="mouseenter")},_blur:function(){var n=this,t=n.element.val();n.close();t!==n._oldText&&n._change(t);n._inputWrapper.removeClass(ut)},_click:function(){var n=this,t=n.element;n.dateView.toggle();i.support.touch||t[0]===kt()||t.focus()},_change:function(n){var t=this;n=t._update(n);+t._old!=+n&&(t._old=n,t._oldText=t.element.val(),t._typing||t.element.trigger(y),t.trigger(y));t._typing=!1},_keydown:function(n){var t=this,i=t.dateView,r=t.element.val(),u=!1;i.popup.visible()||n.keyCode!=f.ENTER||r===t._oldText?(u=i.move(n),t._updateARIA(i._current),u||(t._typing=!0)):t._change(r)},_icon:function(){var i=this,r=i.element,t;t=r.next("span.k-select");t[0]||(t=n('<span unselectable="on" class="k-select"><span unselectable="on" class="k-icon k-i-calendar">select<\/span><\/span>').insertAfter(r));i._dateIcon=t.attr({role:"button","aria-controls":i.dateView._dateViewID})},_option:function(n,i){var f=this,r=f.options;if(i===t)return r[n];(i=u(i,r.parseFormats,r.culture),i)&&(r[n]=new yt(+i),f.dateView[n](i))},_update:function(n){var f=this,r=f.options,e=r.min,h=r.max,o=f._value,t=u(n,r.parseFormats,r.culture),c=t===null&&o===null||t instanceof Date&&o instanceof Date,s;return+t==+o&&c?(s=i.toString(t,r.format,r.culture),s!==n&&f.element.val(t===null?n:s),t):(t!==null&&ti(t,e)?t=vt(t,e,h):ni(t,e,h)||(t=null),f._value=t,f.dateView.value(t),f.element.val(t?i.toString(t,r.format,r.culture):n),f._updateARIA(t),t)},_wrapper:function(){var r=this,i=r.element,t;t=i.parents(".k-datepicker");t[0]||(t=i.wrap(nt).parent().addClass("k-picker-wrap k-state-default"),t=t.wrap(nt).parent());t[0].style.cssText=i[0].style.cssText;i.css({width:"100%",height:i[0].style.height});r.wrapper=t.addClass("k-widget k-datepicker k-header").addClass(i[0].className);r._inputWrapper=n(t[0].firstChild)},_reset:function(){var t=this,i=t.element,r=i.attr("form"),u=r?n("#"+r):i.closest("form");u[0]&&(t._resetHandler=function(){t.value(i[0].defaultValue);t.max(t._initialOptions.max);t.min(t._initialOptions.min)},t._form=u.on("reset",t._resetHandler))},_template:function(){this._ariaTemplate=bt(this.options.ARIATemplate)},_updateARIA:function(n){var i,t=this,r=t.dateView.calendar;t.element.removeAttr("aria-activedescendant");r&&(i=r._cell,i.attr("aria-label",t._ariaTemplate({current:n||r.current()})),t.element.attr("aria-activedescendant",i.attr("id")))}});e.plugin(wt)})(window.kendo.jQuery)}(),function(){(function(n,t){function c(n,t,i){return i?t.substring(0,n).split(i).length-1:0}function rt(n,t,i){return t.split(i)[c(n,t,i)]}function ut(n,t,i,r){var u=t.split(r);return u.splice(c(n,t,r),1,i),r&&u[u.length-1]!==""&&u.push(""),u.join(r)}var r=window.kendo,d=r.support,f=r.caret,l=r._activeElement,a=d.placeholder,v=r.ui,o=v.List,u=r.keys,g=r.data.DataSource,y="aria-disabled",p="aria-readonly",s="k-state-default",w="disabled",b="readonly",k="k-state-focused",nt="k-state-selected",h="k-state-disabled",tt="k-state-hover",i=".kendoAutoComplete",it="mouseenter"+i+" mouseleave"+i,e=n.proxy,ft=o.extend({init:function(t,u){var f=this,s,h;f.ns=i;u=n.isArray(u)?{dataSource:u}:u;o.fn.init.call(f,t,u);t=f.element;u=f.options;u.placeholder=u.placeholder||t.attr("placeholder");a&&t.attr("placeholder",u.placeholder);f._wrapper();f._loader();f._dataSource();f._ignoreCase();t[0].type="text";s=f.wrapper;f._popup();t.addClass("k-input").on("keydown"+i,e(f._keydown,f)).on("paste"+i,e(f._search,f)).on("focus"+i,function(){f._active=!0;f._prev=f._accessor();f._placeholder(!1);s.addClass(k)}).on("focusout"+i,function(){f._change();f._placeholder();f._active=!1;s.removeClass(k)}).attr({autocomplete:"off",role:"textbox","aria-haspopup":!0});f._enable();f._old=f._accessor();t[0].id&&t.attr("aria-owns",f.ul[0].id);f._aria();f._placeholder();f._initList();h=n(f.element).parents("fieldset").is(":disabled");h&&f.enable(!1);f.listView.bind("click",function(n){n.preventDefault()});f._resetFocusItemHandler=n.proxy(f._resetFocusItem,f);r.notify(f)},options:{name:"AutoComplete",enabled:!0,suggest:!1,template:"",groupTemplate:"#:data#",fixedGroupTemplate:"#:data#",dataTextField:"",minLength:1,delay:200,height:200,filter:"startswith",ignoreCase:!0,highlightFirst:!1,separator:null,placeholder:"",animation:{},virtual:!1,value:null},_dataSource:function(){var n=this;n.dataSource&&n._refreshHandler?n._unbindDataSource():n._progressHandler=e(n._showBusy,n);n.dataSource=g.create(n.options.dataSource).bind("progress",n._progressHandler)},setDataSource:function(n){this.options.dataSource=n;this._dataSource();this.listView.setDataSource(this.dataSource)},events:["open","close","change","select","filtering","dataBinding","dataBound"],setOptions:function(n){var t=this._listOptions(n);o.fn.setOptions.call(this,n);t.dataValueField=t.dataTextField;this.listView.setOptions(t);this._accessors();this._aria()},_editable:function(n){var r=this,f=r.element,e=r.wrapper.off(i),u=n.readonly,t=n.disable;if(u||t)e.addClass(t?h:s).removeClass(t?s:h),f.attr(w,t).attr(b,u).attr(y,t).attr(p,u);else{e.addClass(s).removeClass(h).on(it,r._toggleHover);f.removeAttr(w).removeAttr(b).attr(y,!1).attr(p,!1)}},close:function(){var n=this,t=n.listView.focus();t&&t.removeClass(nt);n.popup.close()},destroy:function(){var n=this;n.element.off(i);n.wrapper.off(i);o.fn.destroy.call(n)},refresh:function(){this.listView.refresh()},select:function(n){this._select(n)},search:function(n){var t=this,i=t.options,u=i.ignoreCase,e=i.separator,r;n=n||t._accessor();clearTimeout(t._typingTimeout);e&&(n=rt(f(t.element)[0],n,e));r=n.length;(!r||r>=i.minLength)&&(t._open=!0,t.listView.filter(!0),t.listView.value([]),t._filterSource({value:u?n.toLowerCase():n,operator:i.filter,field:i.dataTextField,ignoreCase:u}))},suggest:function(n){var i=this,y=i._last,r=i._accessor(),v=i.element[0],e=f(v)[0],h=i.options.separator,a=r.split(h),p=c(e,r,h),w=e,s;if(y==u.BACKSPACE||y==u.DELETE){i._last=t;return}n=n||"";typeof n!="string"&&(n[0]&&(n=i.dataSource.view()[o.inArray(n[0],i.ul[0])]),n=n?i._text(n):"");e<=0&&(e=r.toLowerCase().indexOf(n.toLowerCase())+1);s=r.substring(0,e).lastIndexOf(h);s=s>-1?e-(s+h.length):e;r=a[p].substring(0,s);n&&(n=n.toString(),s=n.toLowerCase().indexOf(r.toLowerCase()),s>-1&&(n=n.substring(s+r.length),w=e+n.length,r+=n),h&&a[a.length-1]!==""&&a.push(""));a[p]=r;i._accessor(a.join(h||""));v===l()&&f(v,e,w)},value:function(n){if(n!==t)this.listView.value(n),this._accessor(n),this._old=this._accessor();else return this._accessor()},_click:function(n){var t=n.item,i=this.element;if(this._active=!0,this.trigger("select",{item:t})){this.close();return}this._select(t);this._blur();f(i,i.val().length)},_initList:function(){var t=this,u=t.options.virtual,o=!!u,f=e(t._listBound,t),i={autoBind:!1,selectable:!0,dataSource:t.dataSource,click:n.proxy(t._click,this),change:n.proxy(t._listChange,this),activate:e(t._activateItem,t),deactivate:e(t._deactivateItem,t),dataBinding:function(){t.trigger("dataBinding");t._angularItems("cleanup")},dataBound:f,listBound:f,skipUpdateOnBind:!0};i=n.extend(t._listOptions(),i,typeof u=="object"?u:{});i.dataValueField=i.dataTextField;t.listView=o?new r.ui.VirtualList(t.ul,i):new r.ui.StaticList(t.ul,i);t.listView.value(t.options.value)},_resetFocusItem:function(){var n=this.options.highlightFirst?0:-1;this.options.virtual&&this.listView.scrollTo(0);this.listView.focus(n)},_listBound:function(){var n=this,u=n.popup,f=n.options,e=n.dataSource.flatView(),i=e.length,o=n.element[0]===l(),r;if(n._angularItems("compile"),n._calculateGroupPadding(n._height(i)),u.position(),i&&f.suggest&&o&&n.suggest(e[0]),n._open){if(n._open=!1,r=i?"open":"close",n._typingTimeout&&!o&&(r="close"),i)if(f.virtual)n.popup.unbind("activate",n._resetFocusItemHandler).one("activate",n._resetFocusItemHandler);else n._resetFocusItem();u[r]();n._typingTimeout=t}n.listView.filter(!1);n._touchScroller&&n._touchScroller.reset();n._hideBusy();n._makeUnselectable();n.trigger("dataBound")},_listChange:function(){!this.listView.filter()&&this._active&&this._selectValue(this.listView.selectedDataItems()[0])},_selectValue:function(n){var i=this.options.separator,t="";n&&(t=this._text(n));t===null&&(t="");i&&(t=ut(f(this.element)[0],this._accessor(),t,i));this._prev=t;this._accessor(t);this._placeholder()},_accessor:function(n){var i=this,r=i.element[0];if(n!==t)r.value=n===null?"":n,i._placeholder();else return(n=r.value,r.className.indexOf("k-readonly")>-1)?n===i.options.placeholder?"":n:n},_keydown:function(n){var i=this,t=n.keyCode,r=i.popup.visible(),f=this.listView.focus();if(i._last=t,t===u.DOWN)r&&this._move(f?"focusNext":"focusFirst"),n.preventDefault();else if(t===u.UP)r&&this._move(f?"focusPrev":"focusLast"),n.preventDefault();else if(t===u.ENTER||t===u.TAB){if(t===u.ENTER&&r&&n.preventDefault(),r&&f){if(i.trigger("select",{item:f}))return;this._select(f)}this._blur()}else t===u.ESC?(r&&n.preventDefault(),i.close()):(i._search(),i._typing=!0)},_move:function(n){this.listView[n]();this.options.suggest&&this.suggest(this.listView.focus())},_hideBusy:function(){var n=this;clearTimeout(n._busy);n._loading.hide();n.element.attr("aria-busy",!1);n._busy=null},_showBusy:function(){var n=this;n._busy||(n._busy=setTimeout(function(){n.element.attr("aria-busy",!0);n._loading.show()},100))},_placeholder:function(n){if(!a){var e=this,u=e.element,i=e.options.placeholder,r;if(i){if(r=u.val(),n===t&&(n=!r),n||(i=r!==i?r:""),r===e._old&&!n)return;u.toggleClass("k-readonly",n).val(i);i||u[0]!==document.activeElement||f(u[0],0,0)}}},_search:function(){var n=this;clearTimeout(n._typingTimeout);n._typingTimeout=setTimeout(function(){n._prev!==n._accessor()&&(n._prev=n._accessor(),n.search())},n.options.delay)},_select:function(n){this.listView.select(n)},_loader:function(){this._loading=n('<span class="k-icon k-loading" style="display:none"><\/span>').insertAfter(this.element)},_toggleHover:function(t){n(t.currentTarget).toggleClass(tt,t.type==="mouseenter")},_wrapper:function(){var t=this,i=t.element,r=i[0],n;n=i.parent();n.is("span.k-widget")||(n=i.wrap("<span />").parent());n.attr("tabindex",-1);n.attr("role","presentation");n[0].style.cssText=r.style.cssText;i.css({width:"100%",height:r.style.height});t._focused=t.element;t.wrapper=n.addClass("k-widget k-autocomplete k-header").addClass(r.className)}});v.plugin(ft)})(window.kendo.jQuery)}(),function(){(function(n,t){function it(n,t,i){for(var u=0,f=t.length-1,r;u<f;++u)r=t[u],r in n||(n[r]={}),n=n[r];n[t[f]]=i}var r=window.kendo,p=r.ui,o=p.Select,e=r.support,w=r._activeElement,h=r.data.ObservableObject,f=r.keys,i=".kendoDropDownList",b="disabled",k="readonly",c="change",d="k-state-focused",l="k-state-default",a="k-state-disabled",g="aria-disabled",nt="aria-readonly",v="mouseenter"+i+" mouseleave"+i,s="tabindex",y="filter",tt="accept",u=n.proxy,rt=o.extend({init:function(f,e){var h=this,a=e&&e.index,l,c,v;h.ns=i;e=n.isArray(e)?{dataSource:e}:e;o.fn.init.call(h,f,e);e=h.options;f=h.element.on("focus"+i,u(h._focusHandler,h));h._focusInputHandler=n.proxy(h._focusInput,h);h._inputTemplate();h._reset();h._prev="";h._word="";h.optionLabel=n();h._wrapper();h._tabindex();h.wrapper.data(s,h.wrapper.attr(s));h._span();h._popup();h._mobile();h._dataSource();h._ignoreCase();h._filterHeader();h._aria();h._enable();h._oldIndex=h.selectedIndex=-1;a!==t&&(e.index=a);h._initialIndex=e.index;h._optionLabel();h._initList();h._cascade();e.autoBind?h.dataSource.fetch():h.selectedIndex===-1&&(c=e.text||"",c||(l=e.optionLabel,l&&e.index===0?c=l:h._isSelect&&(c=f.children(":selected").text())),h._textAccessor(c));v=n(h.element).parents("fieldset").is(":disabled");v&&h.enable(!1);h.listView.bind("click",function(n){n.preventDefault()});r.notify(h)},options:{name:"DropDownList",enabled:!0,autoBind:!0,index:0,text:null,value:null,delay:500,height:200,dataTextField:"",dataValueField:"",optionLabel:"",cascadeFrom:"",cascadeFromField:"",ignoreCase:!0,animation:{},filter:"none",minLength:1,virtual:!1,template:null,valueTemplate:null,optionLabelTemplate:null,groupTemplate:"#:data#",fixedGroupTemplate:"#:data#"},events:["open","close",c,"select","filtering","dataBinding","dataBound","cascade"],setOptions:function(n){o.fn.setOptions.call(this,n);this.listView.setOptions(this._listOptions(n));this._optionLabel();this._inputTemplate();this._accessors();this._filterHeader();this._enable();this._aria();!this.value()&&this.optionLabel[0]&&this.select(0)},destroy:function(){var n=this;n.wrapper.off(i);n.element.off(i);n._inputWrapper.off(i);n._arrow.off();n._arrow=null;n.optionLabel.off();o.fn.destroy.call(n)},open:function(){var n=this;if(!n.popup.visible())if(n.listView.isBound()&&n._state!==tt){if(n._allowOpening()){n.popup.one("activate",n._focusInputHandler);n.popup.open();n._focusItem()}}else n._open=!0,n._state="rebind",n.filterInput&&(n.filterInput.val(""),n._prev=""),n._filterSource()},_focusInput:function(){this._focusElement(this.filterInput)},_allowOpening:function(){return this.optionLabel[0]||this.filterInput||this.dataSource.view().length},toggle:function(n){this._toggle(n,!0)},current:function(n){var i;if(n===t)return(i=this.listView.focus(),!i&&this.selectedIndex===0&&this.optionLabel[0])?this.optionLabel:i;this._focus(n)},dataItem:function(i){var r=this,u=null,f=!!r.optionLabel[0],e=r.options.optionLabel;if(i===t)u=r.listView.selectedDataItems()[0];else{if(typeof i!="number"){if(r.options.virtual)return r.dataSource.getByUid(n(i).data("uid"));i=i.hasClass("k-list-optionlabel")?-1:n(r.items()).index(i)}else f&&(i-=1);u=r.dataSource.flatView()[i]}return!u&&f&&(u=n.isPlainObject(e)?new h(e):r._assignInstance(r._optionLabelText(),"")),u},refresh:function(){this.listView.refresh()},text:function(n){var i=this,r,u,f=i.options.ignoreCase;if(n=n===null?"":n,n!==t)typeof n=="string"&&(u=f?n.toLowerCase():n,i._select(function(n){return n=i._text(n),f&&(n=(n+"").toLowerCase()),n===u}),r=i.dataItem(),r&&(n=r)),i._textAccessor(n);else return i._textAccessor()},value:function(n){var i=this,r=i.dataSource;if(n===t)return n=i._accessor()||i.listView.value()[0],n===t||n===null?"":n;if(n&&(i._initialIndex=null),i._request&&i.options.cascadeFrom&&i.listView.isBound()){i._valueSetter&&r.unbind(c,i._valueSetter);i._valueSetter=u(function(){i.value(n)},i);r.one(c,i._valueSetter);return}i.listView.value(n).done(function(){i.selectedIndex===-1&&i.text()&&(i.text(""),i._accessor("",-1));i._old=i._accessor();i._oldIndex=i.selectedIndex});i._fetchData()},_optionLabel:function(){var t=this,f=t.options,e=f.optionLabel,i=f.optionLabelTemplate;if(!e){t.optionLabel.off().remove();t.optionLabel=n();return}i||(i="#:",i+=typeof e=="string"?"data":r.expr(f.dataTextField,"data"),i+="#");typeof i!="function"&&(i=r.template(i));t.optionLabelTemplate=i;t.optionLabel[0]||(t.optionLabel=n('<div class="k-list-optionlabel"><\/div>').prependTo(t.list));t.optionLabel.html(i(e)).off().click(u(t._click,t)).on(v,t._toggleHover);t.angular("compile",function(){return{elements:t.optionLabel}})},_optionLabelText:function(){var n=this.options.optionLabel;return typeof n=="string"?n:this._text(n)},_listBound:function(){var n=this,f=n._initialIndex,t=n.options.optionLabel,e=n._state===y,o=n.dataSource.flatView(),i=o.length,r,s,u;n._angularItems("compile");n._presetValue=!1;n.options.virtual||(s=n._height(e?i||1:i),n._calculateGroupPadding(s));n.popup.position();n._isSelect&&(u=n.value(),i?t&&(t=n._option("",n._optionLabelText())):u&&(t=n._option(u,n.text())),n._options(o,t,u));n._makeUnselectable();e||(n._open&&n.toggle(n._allowOpening()),n._open=!1,n._fetch||(i?(!n.listView.value().length&&f>-1&&f!==null&&n.select(f),n._initialIndex=null,r=n.listView.selectedDataItems()[0],r&&n.text()!==n._text(r)&&n._selectValue(r)):n._textAccessor()!==n._optionLabelText()&&(n.listView.value(""),n._selectValue(null),n._oldIndex=n.selectedIndex)));n._hideBusy();n.trigger("dataBound")},_listChange:function(){this._selectValue(this.listView.selectedDataItems()[0]);(this._presetValue||this._old&&this._oldIndex===-1)&&(this._oldIndex=this.selectedIndex)},_focusHandler:function(){this.wrapper.focus()},_focusinHandler:function(){this._inputWrapper.addClass(d);this._prevent=!1},_focusoutHandler:function(){var n=this,i=n._state===y,r=window.self!==window.top,t=n._focus();n._prevent||(clearTimeout(n._typingTimeout),i&&t&&!n.trigger("select",{item:t})&&n._select(t,!n.dataSource.view().length),e.mobileOS.ios&&r?n._change():n._blur(),n._inputWrapper.removeClass(d),n._prevent=!0,n._open=!1,n.element.blur())},_wrapperMousedown:function(){this._prevent=!!this.filterInput},_wrapperClick:function(n){n.preventDefault();this.popup.unbind("activate",this._focusInputHandler);this._focused=this.wrapper;this._toggle()},_editable:function(n){var t=this,h=t.element,f=n.disable,e=n.readonly,r=t.wrapper.add(t.filterInput).off(i),o=t._inputWrapper.off(v);if(e||f)if(f)r.removeAttr(s),o.addClass(a).removeClass(l);else{o.addClass(l).removeClass(a);r.on("focusin"+i,u(t._focusinHandler,t)).on("focusout"+i,u(t._focusoutHandler,t))}else{h.removeAttr(b).removeAttr(k);o.addClass(l).removeClass(a).on(v,t._toggleHover);r.attr(s,r.data(s)).attr(g,!1).attr(nt,!1).on("keydown"+i,u(t._keydown,t)).on("focusin"+i,u(t._focusinHandler,t)).on("focusout"+i,u(t._focusoutHandler,t)).on("mousedown"+i,u(t._wrapperMousedown,t));t.wrapper.on("click"+i,u(t._wrapperClick,t));if(!t.filterInput)r.on("keypress"+i,u(t._keypress,t))}h.attr(b,f).attr(k,e);r.attr(g,f).attr(nt,e)},_option:function(n,t){return'<option value="'+n+'">'+t+"<\/option>"},_keydown:function(n){var t=this,i=n.keyCode,u=n.altKey,e,r,o=t.popup.visible();if(t.filterInput&&(e=t.filterInput[0]===w()),i===f.LEFT?(i=f.UP,r=!0):i===f.RIGHT&&(i=f.DOWN,r=!0),!r||!e){if(n.keyCode=i,u&&i===f.UP&&t._focusElement(t.wrapper),i===f.ENTER&&t._typingTimeout&&t.filterInput&&o){n.preventDefault();return}(r=t._move(n),r)||(o&&t.filterInput||(i===f.HOME?(r=!0,t._firstItem()):i===f.END&&(r=!0,t._lastItem()),r&&(t._select(t._focus()),n.preventDefault())),u||r||!t.filterInput||t._search())}},_matchText:function(n,t){var i=this,u=i.options.ignoreCase,r=!1;return n=n+"",u&&(n=n.toLowerCase()),n.indexOf(i._word)===0&&(i.optionLabel[0]&&(t+=1),i._select(t),i.popup.visible()||i._change(),r=!0),r},_selectNext:function(n){for(var t=this,r=n,u=t.dataSource.flatView(),f=u.length,i;n<f;n++)if(i=t._text(u[n]),i&&t._matchText(i,n)&&!(t._word.length===1&&r===t.selectedIndex))return!0;if(r>0&&r<f)for(n=0;n<=r;n++)if(i=t._text(u[n]),i&&t._matchText(i,n))return!0;return!1},_keypress:function(n){var t=this;if(n.which!==0&&n.keyCode!==r.keys.ENTER){var i=String.fromCharCode(n.charCode||n.keyCode),f=t.selectedIndex,u=t._word.length;(t.options.ignoreCase&&(i=i.toLowerCase()),i===" "&&n.preventDefault(),u||(t._word=i),t._last===i&&u<=1&&f>-1&&t._selectNext(f))||(u&&(t._word+=i),t._last=i,t._search())}},_popupOpen:function(){var n=this.popup;n.wrapper=r.wrap(n.element);n.element.closest(".km-root")[0]&&(n.wrapper.addClass("km-popup km-widget"),this.wrapper.addClass("km-widget"))},_popup:function(){o.fn._popup.call(this);this.popup.one("open",u(this._popupOpen,this))},_click:function(t){var i=t.item||n(t.currentTarget);if(this.trigger("select",{item:i})){this.close();return}this._userTriggered=!0;this._select(i);this._focusElement(this.wrapper);this._blur()},_focusElement:function(n){var i=w(),r=this.wrapper,t=this.filterInput,u=n===t?r:t,f=e.mobileOS&&(e.touch||e.MSPointers||e.pointers);t&&t[0]===n[0]&&f||t&&u[0]===i&&(this._prevent=!0,this._focused=n.focus())},_filter:function(n){if(n){var i=this,r=i.options.ignoreCase;r&&(n=n.toLowerCase());i._select(function(u){var f=i._text(u);if(f!==t)return f=f+"",r&&(f=f.toLowerCase()),f.indexOf(n)===0})}},_search:function(){var n=this,i=n.dataSource,t=n.selectedIndex;if(clearTimeout(n._typingTimeout),n.options.filter!=="none")n._typingTimeout=setTimeout(function(){var t=n.filterInput.val();n._prev!==t&&(n._prev=t,n.search(t));n._typingTimeout=null},n.options.delay);else{if(n._typingTimeout=setTimeout(function(){n._word=""},n.options.delay),t===-1&&(t=0),!n.ul[0].firstChild){i.fetch().done(function(){i.data()[0]&&t>-1&&n._selectNext(t)});return}n._selectNext(t)}},_get:function(t){var r,u,i,f=typeof t=="function",e=f?n():n(t);if(this.optionLabel[0]&&(typeof t=="number"?t>-1&&(t-=1):e.hasClass("k-list-optionlabel")&&(t=-1)),f){for(r=this.dataSource.flatView(),i=0;i<r.length;i++)if(t(r[i])){t=i;u=!0;break}u||(t=-1)}return t},_firstItem:function(){this.optionLabel[0]?this._focus(this.optionLabel):this.listView.focusFirst()},_lastItem:function(){this.optionLabel.removeClass("k-state-focused");this.listView.focusLast()},_nextItem:function(){this.optionLabel.hasClass("k-state-focused")?(this.optionLabel.removeClass("k-state-focused"),this.listView.focusFirst()):this.listView.focusNext()},_prevItem:function(){this.optionLabel.hasClass("k-state-focused")||(this.listView.focusPrev(),this.listView.focus()||this.optionLabel.addClass("k-state-focused"))},_focusItem:function(){var i=this.listView,r=i.focus(),n=i.select();n=n[n.length-1];n===t&&this.options.highlightFirst&&!r&&(n=0);n!==t?i.focus(n):this.options.optionLabel?(this._focus(this.optionLabel),this._select(this.optionLabel)):i.scrollToIndex(0)},_focus:function(n){var r=this.listView,i=this.optionLabel;if(n===t)return n=r.focus(),!n&&i.hasClass("k-state-focused")&&(n=i),n;i.removeClass("k-state-focused");n=this._get(n);r.focus(n);n===-1&&i.addClass("k-state-focused")},_select:function(n,t){var i=this;n=i._get(n);i.listView.select(n);t||i._state!==y||(i.listView.filter(!1),i._state=tt);n===-1&&i._selectValue(null)},_selectValue:function(n){var i=this,f=i.options.optionLabel,o=i.optionLabel,r=i.listView.select(),u="",e="";r=r[r.length-1];r===t&&(r=-1);o.removeClass("k-state-focused k-state-selected");n?(e=n,u=i._dataValue(n),f&&(r+=1)):f&&(i._focus(o.addClass("k-state-selected")),e=i._optionLabelText(),u=typeof f=="string"?"":i._value(f),r=0);i.selectedIndex=r;u===null&&(u="");i._textAccessor(e);i._accessor(u,r);i._triggerCascade()},_mobile:function(){var i=this,t=i.popup,n=e.mobileOS,r=t.element.parents(".km-root").eq(0);r.length&&n&&(t.options.animation.open.effects=n.android||n.meego?"fadeIn":n.ios||n.wp?"slideIn:up":t.options.animation.open.effects)},_filterHeader:function(){var t,r=this.options,u=r.filter!=="none";this.filterInput&&(this.filterInput.off(i).parent().remove(),this.filterInput=null);u&&(t='<span unselectable="on" class="k-icon k-i-search">select<\/span>',this.filterInput=n('<input class="k-textbox"/>').attr({role:"listbox","aria-haspopup":!0,"aria-expanded":!1}),this.list.prepend(n('<span class="k-list-filter" />').append(this.filterInput.add(t))))},_span:function(){var t=this,i=t.wrapper,u="span.k-input",r;r=i.find(u);r[0]||(i.append('<span unselectable="on" class="k-dropdown-wrap k-state-default"><span unselectable="on" class="k-input">&nbsp;<\/span><span unselectable="on" class="k-select"><span unselectable="on" class="k-icon k-i-arrow-s">select<\/span><\/span><\/span>').append(t.element),r=i.find(u));t.span=r;t._inputWrapper=n(i[0].firstChild);t._arrow=i.find(".k-icon")},_wrapper:function(){var i=this,t=i.element,r=t[0],n;n=t.parent();n.is("span.k-widget")||(n=t.wrap("<span />").parent(),n[0].style.cssText=r.style.cssText,n[0].title=r.title);t.hide();i._focused=i.wrapper=n.addClass("k-widget k-dropdown k-header").addClass(r.className).css("display","").attr({unselectable:"on",role:"listbox","aria-haspopup":!0,"aria-expanded":!1})},_clearSelection:function(n){this.select(n.value()?0:-1)},_inputTemplate:function(){var i=this,t=i.options.valueTemplate;t=t?r.template(t):n.proxy(r.template("#:this._text(data)#",{useWithBlock:!1}),i);i.valueTemplate=t},_textAccessor:function(i){var r=null,e=this.valueTemplate,s=this.options,o=s.optionLabel,u=this.span,f;if(i!==t)n.isPlainObject(i)||i instanceof h?r=i:o&&this._optionLabelText()===i&&(r=o,e=this.optionLabelTemplate),r||(r=this._assignInstance(i,this._accessor())),f=function(){return{elements:u.get(),data:[{dataItem:r}]}},this.angular("cleanup",f),u.html(e(r)),this.angular("compile",f);else return u.text()},_preselect:function(n,t){n||t||(t=this._optionLabelText());this._accessor(n);this._textAccessor(t);this._old=this._accessor();this._oldIndex=this.selectedIndex;this.listView.setValue(n);this._initialIndex=null;this._presetValue=!0},_assignInstance:function(n,t){var r=this.options.dataTextField,i={};return r?(it(i,r.split("."),n),it(i,this.options.dataValueField.split("."),t),i=new h(i)):i=n,i}});p.plugin(rt)})(window.kendo.jQuery)}(),function(){(function(n,t){var r=window.kendo,o=r.ui,rt=o.List,f=o.Select,s=r.caret,ut=r.support,w=ut.placeholder,h=r._activeElement,c=r.keys,i=".kendoComboBox",l="click"+i,a="mousedown"+i,b="disabled",k="readonly",d="change",v="k-state-default",g="k-state-focused",y="k-state-disabled",nt="aria-disabled",tt="aria-readonly",e="filter",p="accept",it="rebind",ft="mouseenter"+i+" mouseleave"+i,u=n.proxy,et=f.extend({init:function(t,e){var o=this,s,h;o.ns=i;e=n.isArray(e)?{dataSource:e}:e;f.fn.init.call(o,t,e);e=o.options;t=o.element.on("focus"+i,u(o._focusHandler,o));e.placeholder=e.placeholder||t.attr("placeholder");o._reset();o._wrapper();o._input();o._tabindex(o.input);o._popup();o._dataSource();o._ignoreCase();o._enable();o._oldIndex=o.selectedIndex=-1;o._aria();o._initialIndex=e.index;o._initList();o._cascade();e.autoBind?o._filterSource():(s=e.text,!s&&o._isSelect&&(s=t.children(":selected").text()),s&&(o.input.val(s),o._prev=s));s||o._placeholder();h=n(o.element).parents("fieldset").is(":disabled");h&&o.enable(!1);r.notify(o)},options:{name:"ComboBox",enabled:!0,index:-1,text:null,value:null,autoBind:!0,delay:200,dataTextField:"",dataValueField:"",minLength:0,height:200,highlightFirst:!0,filter:"none",placeholder:"",suggest:!1,cascadeFrom:"",cascadeFromField:"",ignoreCase:!0,animation:{},virtual:!1,template:null,groupTemplate:"#:data#",fixedGroupTemplate:"#:data#"},events:["open","close",d,"select","filtering","dataBinding","dataBound","cascade"],setOptions:function(n){f.fn.setOptions.call(this,n);this.listView.setOptions(n);this._accessors();this._aria()},destroy:function(){var n=this;n.input.off(i);n.element.off(i);n._inputWrapper.off(i);n._arrow.parent().off(l+" "+a);f.fn.destroy.call(n)},_focusHandler:function(){this.input.focus()},_arrowClick:function(){this._toggle()},_inputFocus:function(){this._inputWrapper.addClass(g);this._placeholder(!1)},_inputFocusout:function(){var n=this;n._inputWrapper.removeClass(g);clearTimeout(n._typingTimeout);n._typingTimeout=null;n.options.text!==n.input.val()&&n.text(n.text());n._placeholder();n._blur();n.element.blur()},_editable:function(n){var t=this,r=n.disable,f=n.readonly,e=t._inputWrapper.off(i),o=t.element.add(t.input.off(i)),s=t._arrow.parent().off(l+" "+a);if(f||r)e.addClass(r?y:v).removeClass(r?v:y),o.attr(b,r).attr(k,f).attr(nt,r).attr(tt,f);else{e.addClass(v).removeClass(y).on(ft,t._toggleHover);o.removeAttr(b).removeAttr(k).attr(nt,!1).attr(tt,!1);s.on(l,u(t._arrowClick,t)).on(a,function(n){n.preventDefault()});t.input.on("keydown"+i,u(t._keydown,t)).on("focus"+i,u(t._inputFocus,t)).on("focusout"+i,u(t._inputFocusout,t))}},open:function(){var n=this,t=n._state;n.popup.visible()||((n.listView.isBound()||t===e)&&t!==p?(n.popup.open(),n._focusItem()):(n._open=!0,n._state=it,n.listView.filter(!1),n._filterSource()))},_listBound:function(){var n=this,o=n.options,s=n._initialIndex,v=n._state===e,y=n.input[0]===h(),i=n.listView,r=i.focus(),c=this.dataSource.flatView(),p=this.dataSource.page(),l=c.length,u,w,a,f;n._angularItems("compile");n._presetValue=!1;o.virtual||n._calculateGroupPadding(n._height(l));n.popup.position();n._isSelect&&(w=n.element[0].children[0],n._state===it&&(n._state=""),a=!0,f=n._customOption,n._customOption=t,n._options(c,"",n.value()),f&&f[0].selected?n._custom(f.val(),a):w||n._custom("",a));n._makeUnselectable();v||n._fetch?v&&r&&r.removeClass("k-state-selected"):(i.value().length||(s!==null&&s>-1?(n.select(s),r=i.focus()):n._accessor()&&i.value(n._accessor())),n._initialIndex=null,u=n.listView.selectedDataItems()[0],u&&n.text()&&n.text()!==n._text(u)&&n._selectValue(u));l&&(p===t||p===1)&&(o.highlightFirst?r||i.focusIndex()||i.focus(0):i.focus(-1),o.suggest&&y&&n.input.val()&&n.suggest(c[0]));n._open&&(n._open=!1,n._typingTimeout&&!y?n.popup.close():n.toggle(!!l),n._typingTimeout=null);n._touchScroller&&n._touchScroller.reset();n._hideBusy();n.trigger("dataBound")},_listChange:function(){this._selectValue(this.listView.selectedDataItems()[0]);this._presetValue&&(this._oldIndex=this.selectedIndex)},_get:function(n){var i,r,t;if(typeof n=="function"){for(i=this.dataSource.flatView(),t=0;t<i.length;t++)if(n(i[t])){n=t;r=!0;break}r||(n=-1)}return n},_select:function(n,t){n=this._get(n);n===-1&&(this.input[0].value="",this._accessor(""));this.listView.select(n);t||this._state!==e||(this.listView.filter(!1),this._state=p)},_selectValue:function(n){var i=this.listView.select(),r="",u="";i=i[i.length-1];i===t&&(i=-1);this.selectedIndex=i;i===-1?(r=u=this.input[0].value,this.listView.focus(-1)):(n&&(r=this._dataValue(n),u=this._text(n)),r===null&&(r=""));this._prev=this.input[0].value=u;this._accessor(r!==t?r:u,i);this._placeholder();this._triggerCascade()},refresh:function(){this.listView.refresh()},suggest:function(n){var r=this,f=r.input[0],i=r.text(),u=s(f)[0],o=r._last,e;if(o==c.BACKSPACE||o==c.DELETE){r._last=t;return}n=n||"";typeof n!="string"&&(n[0]&&(n=r.dataSource.view()[rt.inArray(n[0],r.ul[0])]),n=n?r._text(n):"");u<=0&&(u=i.toLowerCase().indexOf(n.toLowerCase())+1);n?(n=n.toString(),e=n.toLowerCase().indexOf(i.toLowerCase()),e>-1&&(i+=n.substring(e+i.length))):i=i.substring(0,u);i.length===u&&n||(f.value=i,f===h()&&s(f,u,i.length))},text:function(n){n=n===null?"":n;var i=this,f=i.input[0],o=i.options.ignoreCase,e=n,u,r;if(n===t)return f.value;if(u=i.dataItem(),i.options.autoBind!==!1||i.listView.isBound()){if(u&&i._text(u)===n&&(r=i._value(u),r===null?r="":r+="",r===i._old)){i._triggerCascade();return}o&&(e=e.toLowerCase());i._select(function(n){return n=i._text(n),o&&(n=(n+"").toLowerCase()),n===e});i.selectedIndex<0&&(i._accessor(n),f.value=n,i._triggerCascade());i._prev=f.value}},toggle:function(n){this._toggle(n,!0)},value:function(n){var i=this,r=i.options;if(n===t)return n=i._accessor()||i.listView.value()[0],n===t||n===null?"":n;(n!==r.value||i.input.val()!==r.text)&&(i._accessor(n),i.listView.value(n).done(function(){i._selectValue(i.listView.selectedDataItems()[0]);i.selectedIndex===-1&&(i._accessor(n),i.input.val(n),i._placeholder(!0));i._old=i._accessor();i._oldIndex=i.selectedIndex;i._prev=i.input.val();i._state===e&&(i._state=p)}),i._fetchData())},_click:function(n){var t=n.item;if(this.trigger("select",{item:t})){this.close();return}this._userTriggered=!0;this._select(t);this._blur()},_filter:function(n){var i=this,u=i.options,f=i.dataSource,e=u.ignoreCase,o=function(r){var u=i._text(r);if(u!==t)return(u=u+"",u!==""&&n==="")?!1:(e&&(u=u.toLowerCase()),u.indexOf(n)===0)},r;if(e&&(n=n.toLowerCase()),!i.ul[0].firstChild){f.one(d,function(){f.view()[0]&&i.search(n)}).fetch();return}this.listView.focus(this._get(o));r=this.listView.focus();r&&(u.suggest&&i.suggest(r),this.open());this.options.highlightFirst&&!n&&this.listView.focusFirst()},_input:function(){var i=this,t=i.element.removeClass("k-input")[0],e=t.accessKey,u=i.wrapper,o="input.k-input",f=t.name||"",r;f&&(f='name="'+f+'_input" ');r=u.find(o);r[0]||(u.append('<span tabindex="-1" unselectable="on" class="k-dropdown-wrap k-state-default"><input '+f+'class="k-input" type="text" autocomplete="off"/><span tabindex="-1" unselectable="on" class="k-select"><span unselectable="on" class="k-icon k-i-arrow-s">select<\/span><\/span><\/span>').append(i.element),r=u.find(o));r[0].style.cssText=t.style.cssText;r[0].title=t.title;t.maxLength>-1&&(r[0].maxLength=t.maxLength);r.addClass(t.className).val(this.options.text||t.value).css({width:"100%",height:t.style.height}).attr({role:"combobox","aria-expanded":!1}).show();w&&r.attr("placeholder",i.options.placeholder);e&&(t.accessKey="",r[0].accessKey=e);i._focused=i.input=r;i._inputWrapper=n(u[0].firstChild);i._arrow=u.find(".k-icon").attr({role:"button",tabIndex:-1});t.id&&i._arrow.attr("aria-controls",i.ul[0].id)},_keydown:function(n){var t=this,i=n.keyCode;t._last=i;clearTimeout(t._typingTimeout);t._typingTimeout=null;i==c.TAB||t._move(n)||t._search()},_placeholder:function(n){if(!w){var u=this,i=u.input,r=u.options.placeholder,f;if(r){if(f=u.value(),n===t&&(n=!f),i.toggleClass("k-readonly",n),!n){if(f)return;r=""}i.val(r);r||i[0]!==h()||s(i[0],0,0)}}},_search:function(){var n=this;n._typingTimeout=setTimeout(function(){var t=n.text();n._prev!==t&&(n._prev=t,n.search(t));n._typingTimeout=null},n.options.delay)},_wrapper:function(){var i=this,n=i.element,t=n.parent();t.is("span.k-widget")||(t=n.hide().wrap("<span />").parent(),t[0].style.cssText=n[0].style.cssText);i.wrapper=t.addClass("k-widget k-combobox k-header").addClass(n[0].className).css("display","")},_clearSelection:function(n,t){var i=this,r=n.value(),u=r&&n.selectedIndex===-1;(t||!r||u)&&(i.options.value="",i.value(""))},_preselect:function(n,t){this.input.val(t);this._accessor(n);this._old=this._accessor();this._oldIndex=this.selectedIndex;this.listView.setValue(n);this._placeholder();this._initialIndex=null;this._presetValue=!0}});o.plugin(et)})(window.kendo.jQuery)}(),function(){(function(n,t){function wt(n,t){var i;if(n===null&&t!==null||n!==null&&t===null||(i=n.length,i!==t.length))return!1;while(i--)if(n[i]!==t[i])return!1;return!0}var i=window.kendo,k=i.ui,e=k.List,u=i.keys,d=i._activeElement,st=i.data.ObservableArray,r=n.proxy,o="id",l="li",s="accept",h="filter",a="rebind",g="open",nt="close",v="change",ht="progress",y="select",tt="aria-disabled",it="aria-readonly",c="k-state-focused",p="k-loading-hidden",rt="k-state-hover",w="k-state-disabled",ut="disabled",ft="readonly",f=".kendoMultiSelect",ct="click"+f,lt="keydown"+f,et="mouseenter"+f,ot="mouseleave"+f,at=et+" "+ot,vt=/"/g,b=n.isArray,yt=["font-family","font-size","font-stretch","font-style","font-weight","letter-spacing","text-transform","line-height"],pt=e.extend({init:function(t,r){var u=this,s,h;u.ns=f;e.fn.init.call(u,t,r);u._optionsMap={};u._customOptions={};u._wrapper();u._tagList();u._input();u._textContainer();u._loader();u._tabindex(u.input);t=u.element.attr("multiple","multiple").hide();r=u.options;r.placeholder||(r.placeholder=t.data("placeholder"));s=t.attr(o);s&&(u._tagID=s+"_tag_active",s=s+"_taglist",u.tagList.attr(o,s));u._aria(s);u._dataSource();u._ignoreCase();u._popup();u._tagTemplate();u._initList();u._reset();u._enable();u._placeholder();r.autoBind?u.dataSource.fetch():r.value&&u._preselect(r.value);h=n(u.element).parents("fieldset").is(":disabled");h&&u.enable(!1);i.notify(u)},_preselect:function(t,r){var u=this;b(t)||t instanceof i.data.ObservableArray||(t=[t]);(n.isPlainObject(t[0])||t[0]instanceof i.data.ObservableObject||!u.options.dataValueField)&&(u.dataSource.data(t),u.value(r||u._initialValues),u._retrieveData=!0)},options:{name:"MultiSelect",tagMode:"multiple",enabled:!0,autoBind:!0,autoClose:!0,highlightFirst:!0,dataTextField:"",dataValueField:"",filter:"startswith",ignoreCase:!0,minLength:0,delay:100,value:null,maxSelectedItems:null,placeholder:"",height:200,animation:{},virtual:!1,itemTemplate:"",tagTemplate:"",groupTemplate:"#:data#",fixedGroupTemplate:"#:data#"},events:[g,nt,v,y,"filtering","dataBinding","dataBound"],setDataSource:function(n){this.options.dataSource=n;this._dataSource();this.listView.setDataSource(this.dataSource);this.options.autoBind&&this.dataSource.fetch()},setOptions:function(n){var t=this._listOptions(n);e.fn.setOptions.call(this,n);this._normalizeOptions(t);this.listView.setOptions(t);this._accessors();this._aria(this.tagList.attr(o));this._tagTemplate()},currentTag:function(n){var i=this;if(n!==t)i._currentTag&&(i._currentTag.removeClass(c).removeAttr(o),i.input.removeAttr("aria-activedescendant")),n&&(n.addClass(c).attr(o,i._tagID),i.input.attr("aria-activedescendant",i._tagID)),i._currentTag=n;else return i._currentTag},dataItems:function(){return this.listView.selectedDataItems()},destroy:function(){var n=this,t=n.ns;clearTimeout(n._busy);clearTimeout(n._typingTimeout);n.wrapper.off(t);n.tagList.off(t);n.input.off(t);e.fn.destroy.call(n)},_activateItem:function(){e.fn._activateItem.call(this);this.currentTag(null)},_normalizeOptions:function(n){var r=this.options.itemTemplate||this.options.template,t=n.itemTemplate||r||n.template;t||(t="#:"+i.expr(n.dataTextField,"data")+"#");n.template=t},_initList:function(){var t=this,f=t.options.virtual,o=!!f,e=r(t._listBound,t),u={autoBind:!1,selectable:"multiple",dataSource:t.dataSource,click:r(t._click,t),change:r(t._listChange,t),activate:r(t._activateItem,t),deactivate:r(t._deactivateItem,t),dataBinding:function(){t.trigger("dataBinding");t._angularItems("cleanup")},dataBound:e,listBound:e,selectedItemChange:r(t._selectedItemChange,t)};u=n.extend(t._listOptions(),u,typeof f=="object"?f:{});t._normalizeOptions(u);t.listView=o?new i.ui.VirtualList(t.ul,u):new i.ui.StaticList(t.ul,u);t.listView.bind("click",function(n){n.preventDefault()});t.listView.value(t._initialValues||t.options.value)},_listChange:function(n){this._state===a&&(this._state="",n.added=[]);this._selectValue(n.added,n.removed)},_selectedItemChange:function(n){for(var r=n.items,i,t=0;t<r.length;t++)i=r[t],this.tagList.children().eq(i.index).children("span:first").html(this.tagTextTemplate(i.item))},_wrapperMousedown:function(t){var r=this,e=t.target.nodeName.toLowerCase()!=="input",f=n(t.target),u=f.hasClass("k-select")||f.hasClass("k-icon");u&&(u=!f.closest(".k-select").children(".k-i-arrow-s").length);!e||u&&i.support.mobileOS||t.preventDefault();u||(r.input[0]!==d()&&e&&r.input.focus(),r.options.minLength===0&&r.open())},_inputFocus:function(){this._placeholder(!1);this.wrapper.addClass(c)},_inputFocusout:function(){var n=this;clearTimeout(n._typingTimeout);n.wrapper.removeClass(c);n._placeholder(!n.listView.selectedDataItems()[0],!0);n.close();n._state===h&&(n._state=s,n.listView.filter(!1),n.listView.skipUpdate(!0));n.element.blur()},_removeTag:function(n){var i=this,o=i._state,f=n.index(),r=i.listView,c=r.value()[f],u=i._customOptions[c],e;u===t&&(o===s||o===h)&&(u=i._optionsMap[c]);u!==t?(e=i.element[0].children[u],e.removeAttribute("selected"),e.selected=!1,r.removeAt(f),n.remove()):r.select(r.select()[f]);i.currentTag(null);i._change();i._close()},_tagListClick:function(t){var i=n(t.currentTarget);i.children(".k-i-arrow-s").length||this._removeTag(i.closest(l))},_editable:function(t){var i=this,u=t.disable,e=t.readonly,o=i.wrapper.off(f),h=i.tagList.off(f),s=i.element.add(i.input.off(f));if(e||u)u?o.addClass(w):o.removeClass(w),s.attr(ut,u).attr(ft,e).attr(tt,u).attr(it,e);else{o.removeClass(w).on(at,i._toggleHover).on("mousedown"+f+" touchend"+f,r(i._wrapperMousedown,i));i.input.on(lt,r(i._keydown,i)).on("paste"+f,r(i._search,i)).on("focus"+f,r(i._inputFocus,i)).on("focusout"+f,r(i._inputFocusout,i));s.removeAttr(ut).removeAttr(ft).attr(tt,!1).attr(it,!1);h.on(et,l,function(){n(this).addClass(rt)}).on(ot,l,function(){n(this).removeClass(rt)}).on(ct,"li.k-button .k-select",r(i._tagListClick,i))}},_close:function(){var n=this;n.options.autoClose?n.close():n.popup.position()},_filterSource:function(n,t){t||(t=this._retrieveData);this._retrieveData=!1;e.fn._filterSource.call(this,n,t)},close:function(){this.popup.close()},open:function(){var n=this;n._request&&(n._retrieveData=!1);n._retrieveData||!n.listView.isBound()||n._state===s?(n._open=!0,n._state=a,n.listView.filter(!1),n.listView.skipUpdate(!0),n._filterSource()):n._allowSelection()&&(n.popup.open(),n._focusItem())},toggle:function(n){n=n!==t?n:!this.popup.visible();this[n?g:nt]()},refresh:function(){this.listView.refresh()},_listBound:function(){var n=this,i=n.dataSource.flatView(),r=n.dataSource.page(),u=i.length;n._angularItems("compile");n._render(i);n._calculateGroupPadding(n._height(u));n._open&&(n._open=!1,n.toggle(u));n.popup.position();n.options.highlightFirst&&(r===t||r===1)&&n.listView.focusFirst();n._touchScroller&&n._touchScroller.reset();n._hideBusy();n._makeUnselectable();n.trigger("dataBound")},search:function(n){var t=this,i=t.options,f=i.ignoreCase,o=i.filter,s=i.dataTextField,r=t.input.val(),e,u;i.placeholder===r&&(r="");clearTimeout(t._typingTimeout);n=typeof n=="string"?n:r;u=n.length;(!u||u>=i.minLength)&&(t.listView.filter(!0),t._state=h,t._open=!0,e={value:f?n.toLowerCase():n,field:s,operator:o,ignoreCase:f},t._filterSource(e))},value:function(n){var i=this,u=i.listView.value().slice(),r=i.options.maxSelectedItems;if(n===t)return u;n=i._normalizeValues(n);r!==null&&n.length>r&&(n=n.slice(0,r));i.listView.value(n);i._old=n;i._fetchData()},_setOption:function(n,t){var i=this.element[0].children[this._optionsMap[n]];i&&(t?i.setAttribute("selected","selected"):i.removeAttribute("selected"),i.selected=t)},_fetchData:function(){var n=this,t=!!n.dataSource.view().length,i=n.listView.value().length===0;i||n._request||!n._retrieveData&&(n._fetch||t)||(n._fetch=!0,n._retrieveData=!1,n.dataSource.read().done(function(){n._fetch=!1}))},_dataSource:function(){var n=this,f=n.element,u=n.options,t=u.dataSource||{};t=b(t)?{data:t}:t;t.select=f;t.fields=[{field:u.dataTextField},{field:u.dataValueField}];n.dataSource&&n._refreshHandler?n._unbindDataSource():n._progressHandler=r(n._showBusy,n);n.dataSource=i.data.DataSource.create(t).bind(ht,n._progressHandler)},_reset:function(){var t=this,i=t.element,r=i.attr("form"),u=r?n("#"+r):i.closest("form");u[0]&&(t._resetHandler=function(){setTimeout(function(){t.value(t._initialValues);t._placeholder()})},t._form=u.on("reset",t._resetHandler))},_initValue:function(){var n=this.options.value||this.element.val();this._old=this._initialValues=this._normalizeValues(n)},_normalizeValues:function(t){var i=this;return t===null?t=[]:t&&n.isPlainObject(t)?t=[i._value(t)]:t&&n.isPlainObject(t[0])?t=n.map(t,function(n){return i._value(n)}):b(t)||t instanceof st||(t=[t]),t},_change:function(){var n=this,t=n.value();wt(t,n._old)||(n._old=t.slice(),n.trigger(v),n.element.trigger(v))},_click:function(n){var t=n.item;if(this.trigger(y,{item:t})){this._close();return}this._select(t);this._change();this._close()},_keydown:function(t){var r=this,e=t.keyCode,f=r._currentTag,o=r.listView.focus(),h=r.input.val(),c=i.support.isRtl(r.wrapper),s=r.popup.visible();if(e===u.DOWN){if(t.preventDefault(),!s){r.open();o||this.listView.focusFirst();return}o?(this.listView.focusNext(),this.listView.focus()||this.listView.focusLast()):this.listView.focusFirst()}else if(e===u.UP)s&&(o&&this.listView.focusPrev(),this.listView.focus()||r.close()),t.preventDefault();else if(e===u.LEFT&&!c||e===u.RIGHT&&c)h||(f=f?f.prev():n(r.tagList[0].lastChild),f[0]&&r.currentTag(f));else if(e===u.RIGHT&&!c||e===u.LEFT&&c)!h&&f&&(f=f.next(),r.currentTag(f[0]?f:null));else if(e===u.ENTER&&s){if(o){if(r.trigger(y,{item:o})){r._close();return}r._select(o)}r._change();r._close();t.preventDefault()}else e===u.ESC?(s?t.preventDefault():r.currentTag(null),r.close()):e===u.HOME?s?this.listView.focusFirst():h||(f=r.tagList[0].firstChild,f&&r.currentTag(n(f))):e===u.END?s?this.listView.focusLast():h||(f=r.tagList[0].lastChild,f&&r.currentTag(n(f))):e!==u.DELETE&&e!==u.BACKSPACE||h?(clearTimeout(r._typingTimeout),setTimeout(function(){r._scale()}),r._search()):(e!==u.BACKSPACE||f||(f=n(r.tagList[0].lastChild)),f&&f[0]&&r._removeTag(f))},_hideBusy:function(){var n=this;clearTimeout(n._busy);n.input.attr("aria-busy",!1);n._loading.addClass(p);n._request=!1;n._busy=null},_showBusyHandler:function(){this.input.attr("aria-busy",!0);this._loading.removeClass(p)},_showBusy:function(){var n=this;(n._request=!0,n._busy)||(n._busy=setTimeout(r(n._showBusyHandler,n),100))},_placeholder:function(n,r){var u=this,f=u.input,e=d();n===t&&(n=!1,f[0]!==e&&(n=!u.listView.selectedDataItems()[0]));u._prev="";f.toggleClass("k-readonly",n).val(n?u.options.placeholder:"");f[0]!==e||r||i.caret(f[0],0,0);u._scale()},_scale:function(){var n=this,r=n.wrapper,u=r.width(),t=n._span.text(n.input.val()),i;r.is(":visible")?i=t.width()+25:(t.appendTo(document.documentElement),u=i=t.width()+25,t.appendTo(r));n.input.width(i>u?u:i)},_option:function(n,r,u){var f="<option";return n!==t&&(n+="",n.indexOf('"')!==-1&&(n=n.replace(vt,"&quot;")),f+=' value="'+n+'"'),u&&(f+=" selected"),f+=">",r!==t&&(f+=i.htmlEncode(r)),f+"<\/option>"},_render:function(n){var r=this.listView.selectedDataItems(),c=this.listView.value(),f=n.length,e,s="",u,i,t,h,o;for(c.length!==r.length&&(r=this._buildSelectedItems(c)),h={},o={},t=0;t<f;t++)u=n[t],i=this._value(u),e=this._selectedItemIndex(i,r),e!==-1&&r.splice(e,1),o[i]=t,s+=this._option(i,this._text(u),e!==-1);if(r.length)for(t=0;t<r.length;t++)u=r[t],i=this._value(u),h[i]=f,o[i]=f,f+=1,s+=this._option(i,this._text(u),!0);this._customOptions=h;this._optionsMap=o;this.element.html(s)},_buildSelectedItems:function(n){for(var u=this.options.dataValueField,f=this.options.dataTextField,r=[],t,i=0;i<n.length;i++)t={},t[u]=n[i],t[f]=n[i],r.push(t);return r},_selectedItemIndex:function(n,t){for(var r=this._value,i=0;i<t.length;i++)if(n===r(t[i]))return i;return-1},_search:function(){var n=this;n._typingTimeout=setTimeout(function(){var t=n.input.val();n._prev!==t&&(n._prev=t,n.search(t))},n.options.delay)},_allowSelection:function(){var n=this.options.maxSelectedItems;return n===null||n>this.listView.value().length},_angularTagItems:function(t){var i=this;i.angular(t,function(){return{elements:i.tagList[0].children,data:n.map(i.dataItems(),function(n){return{dataItem:n}})}})},_selectValue:function(n,t){var i=this,h=i.value(),e=i.dataSource.total(),u=i.tagList,f=i._value,o,s,r;if(i._angularTagItems("cleanup"),i.options.tagMode==="multiple"){for(r=t.length-1;r>-1;r--)o=t[r],u[0].removeChild(u[0].children[o.position]),i._setOption(f(o.dataItem),!1);for(r=0;r<n.length;r++)s=n[r],u.append(i.tagTemplate(s.dataItem)),i._setOption(f(s.dataItem),!0)}else{for((!i._maxTotal||i._maxTotal<e)&&(i._maxTotal=e),u.html(""),h.length&&u.append(i.tagTemplate({values:h,dataItems:i.dataItems(),maxTotal:i._maxTotal,currentTotal:e})),r=t.length-1;r>-1;r--)i._setOption(f(t[r].dataItem),!1);for(r=0;r<n.length;r++)i._setOption(f(n[r].dataItem),!0)}i._angularTagItems("compile");i._placeholder()},_select:function(n){var t=this;(t._state===a&&(t._state=""),t._allowSelection())&&(this.listView.select(n),t._placeholder(),t._state===h&&(t._state=s,t.listView.filter(!1),t.listView.skipUpdate(!0)))},_input:function(){var t=this,r=t.element[0].accessKey,i=t._innerWrapper.children("input.k-input");i[0]||(i=n('<input class="k-input" style="width: 25px" />').appendTo(t._innerWrapper));t.element.removeAttr("accesskey");t._focused=t.input=i.attr({accesskey:r,autocomplete:"off",role:"listbox","aria-expanded":!1})},_tagList:function(){var t=this,i=t._innerWrapper.children("ul");i[0]||(i=n('<ul role="listbox" unselectable="on" class="k-reset"/>').appendTo(t._innerWrapper));t.tagList=i},_tagTemplate:function(){var t=this,n=t.options,r=n.tagTemplate,e=n.dataSource,u=n.tagMode==="multiple",f;t.element[0].length&&!e&&(n.dataTextField=n.dataTextField||"text",n.dataValueField=n.dataValueField||"value");f=u?i.template("#:"+i.expr(n.dataTextField,"data")+"#",{useWithBlock:!1}):i.template("#:values.length# item(s) selected");t.tagTextTemplate=r=r?i.template(r):f;t.tagTemplate=function(n){return'<li class="k-button" unselectable="on"><span unselectable="on">'+r(n)+'<\/span><span unselectable="on" class="k-select"><span unselectable="on" class="k-icon '+(u?"k-i-close":"k-i-arrow-s")+'">'+(u?"delete":"open")+"<\/span><\/span><\/li>"}},_loader:function(){this._loading=n('<span class="k-icon k-loading '+p+'"><\/span>').insertAfter(this.input)},_textContainer:function(){var t=i.getComputedStyles(this.input[0],yt);t.position="absolute";t.visibility="hidden";t.top=-3333;t.left=-3333;this._span=n("<span/>").css(t).appendTo(this.wrapper)},_wrapper:function(){var r=this,t=r.element,i=t.parent("span.k-multiselect");i[0]||(i=t.wrap('<div class="k-widget k-multiselect k-header" unselectable="on" />').parent(),i[0].style.cssText=t[0].style.cssText,i[0].title=t[0].title,n('<div class="k-multiselect-wrap k-floatwrap" unselectable="on" />').insertBefore(t));r.wrapper=i.addClass(t[0].className).css("display","");r._innerWrapper=n(i[0].firstChild)}});k.plugin(pt)})(window.kendo.jQuery)}(),function(){(function(n,t){function oi(n,t,i){var f=i?" k-slider-horizontal":" k-slider-vertical",r=n.style?n.style:t.attr("style"),e=t.attr("class")?" "+t.attr("class"):"",u="";return n.tickPlacement=="bottomRight"?u=" k-slider-bottomright":n.tickPlacement=="topLeft"&&(u=" k-slider-topleft"),r=r?" style='"+r+"'":"","<div class='k-widget k-slider"+f+e+"'"+r+"><div class='k-slider-wrap"+(n.showButtons?" k-slider-buttons":"")+u+"'><\/div><\/div>"}function ii(n,t,i){var r="";return r=t=="increase"?i?"k-i-arrow-e":"k-i-arrow-n":i?"k-i-arrow-w":"k-i-arrow-s","<a class='k-button k-button-"+t+"'><span class='k-icon "+r+"' title='"+n[t+"ButtonTitle"]+"'>"+n[t+"ButtonTitle"]+"<\/span><\/a>"}function si(n,t){for(var u="<ul class='k-reset k-slider-items'>",f=i.floor(o(t/n.smallStep))+1,r=0;r<f;r++)u+="<li class='k-tick' role='presentation'>&nbsp;<\/li>";return u+"<\/ul>"}function hi(n,t){var i=t.is("input")?1:2,r=i==2?n.leftDragHandleTitle:n.dragHandleTitle;return"<div class='k-slider-track'><div class='k-slider-selection'><!-- --><\/div><a href='#' class='k-draghandle' title='"+r+"' role='slider' aria-valuemin='"+n.min+"' aria-valuemax='"+n.max+"' aria-valuenow='"+(i>1?n.selectionStart||n.min:n.value||n.min)+"'>Drag<\/a>"+(i>1?"<a href='#' class='k-draghandle' title='"+n.rightDragHandleTitle+"'role='slider' aria-valuemin='"+n.min+"' aria-valuemax='"+n.max+"' aria-valuenow='"+(n.selectionEnd||n.max)+"'>Drag<\/a>":"")+"<\/div>"}function g(n){return function(t){return t+n}}function ri(n){return function(){return n}}function l(n){return(n+"").replace(".",r.cultures.current.numberFormat["."])}function ci(n){var t=n.toString(),i=0;return t=t.split("."),t[1]&&(i=t[1].length),i>10?10:i}function o(n){var r,t;return n=parseFloat(n,10),r=ci(n),t=i.pow(10,r||0),i.round(n*t)/t}function s(n,i){var r=fi(n.getAttribute(i));return r===null&&(r=t),r}function kt(n){return typeof n!==ei}function rt(n){return n*1e4}var r=window.kendo,pt=r.ui.Widget,ui=r.ui.Draggable,dt=n.extend,ut=r.format,fi=r.parseFloat,f=n.proxy,wt=n.isArray,i=Math,bt=r.support,gt=bt.pointers,ni=bt.msPointers,nt="change",ft="slide",u=".slider",tt="touchstart"+u+" mousedown"+u,b=gt?"pointerdown"+u:ni?"MSPointerDown"+u:tt,a="touchend"+u+" mouseup"+u,et=gt?"pointerup":ni?"MSPointerUp"+u:a,ot="moveSelection",y="keydown"+u,st="click"+u,it="mouseover"+u,ht="focus"+u,ct="blur"+u,e=".k-draghandle",p=".k-slider-track",h=".k-tick",w="k-state-selected",c="k-state-focused",lt="k-state-default",at="k-state-disabled",k="disabled",ei="undefined",vt="tabindex",ti=r.getTouches,d=pt.extend({init:function(n,t){var i=this,u;if(pt.fn.init.call(i,n,t),t=i.options,i._distance=o(t.max-t.min),i._isHorizontal=t.orientation=="horizontal",i._isRtl=i._isHorizontal&&r.support.isRtl(n),i._position=i._isHorizontal?"left":"bottom",i._sizeFn=i._isHorizontal?"width":"height",i._outerSize=i._isHorizontal?"outerWidth":"outerHeight",t.tooltip.format=t.tooltip.enabled?t.tooltip.format||"{0}":"{0}",t.smallStep<=0)throw new Error("Kendo UI Slider smallStep must be a positive number.");i._createHtml();i.wrapper=i.element.closest(".k-slider");i._trackDiv=i.wrapper.find(p);i._setTrackDivWidth();i._maxSelection=i._trackDiv[i._sizeFn]();i._sliderItemsInit();i._reset();i._tabindex(i.wrapper.find(e));i[t.enabled?"enable":"disable"]();u=r.support.isRtl(i.wrapper)?-1:1;i._keyMap={37:g(-1*u*t.smallStep),40:g(-t.smallStep),39:g(1*u*t.smallStep),38:g(+t.smallStep),35:ri(t.max),36:ri(t.min),33:g(+t.largeStep),34:g(-t.largeStep)};r.notify(i)},events:[nt,ft],options:{enabled:!0,min:0,max:10,smallStep:1,largeStep:5,orientation:"horizontal",tickPlacement:"both",tooltip:{enabled:!0,format:"{0}"}},_resize:function(){this._setTrackDivWidth();this.wrapper.find(".k-slider-items").remove();this._maxSelection=this._trackDiv[this._sizeFn]();this._sliderItemsInit();this._refresh();this.options.enabled&&this.enable(!0)},_sliderItemsInit:function(){var n=this,t=n.options,r=n._maxSelection/((t.max-t.min)/t.smallStep),u=n._calculateItemsWidth(i.floor(n._distance/t.smallStep));t.tickPlacement!="none"&&r>=2&&(n._trackDiv.before(si(t,n._distance)),n._setItemsWidth(u),n._setItemsTitle());n._calculateSteps(u);t.tickPlacement!="none"&&r>=2&&t.largeStep>=t.smallStep&&n._setItemsLargeTick()},getSize:function(){return r.dimensions(this.wrapper)},_setTrackDivWidth:function(){var n=this,t=parseFloat(n._trackDiv.css(n._isRtl?"right":n._position),10)*2;n._trackDiv[n._sizeFn](n.wrapper[n._sizeFn]()-2-t)},_setItemsWidth:function(t){for(var i=this,c=i.options,o=0,u=t.length-1,f=i.wrapper.find(h),e=0,l=f.length,s=0,r=0;r<l-2;r++)n(f[r+1])[i._sizeFn](t[r]);if(i._isHorizontal?(n(f[o]).addClass("k-first")[i._sizeFn](t[u-1]),n(f[u]).addClass("k-last")[i._sizeFn](t[u])):(n(f[u]).addClass("k-first")[i._sizeFn](t[u]),n(f[o]).addClass("k-last")[i._sizeFn](t[u-1])),i._distance%c.smallStep!=0&&!i._isHorizontal){for(r=0;r<t.length;r++)s+=t[r];e=i._maxSelection-s;e+=parseFloat(i._trackDiv.css(i._position),10)+2;i.wrapper.find(".k-slider-items").css("padding-top",e)}},_setItemsTitle:function(){for(var t=this,i=t.options,u=t.wrapper.find(h),f=i.min,e=u.length,r=t._isHorizontal&&!t._isRtl?0:e-1,s=t._isHorizontal&&!t._isRtl?e:-1,c=t._isHorizontal&&!t._isRtl?1:-1;r-s!=0;r+=c)n(u[r]).attr("title",ut(i.tooltip.format,o(f))),f+=i.smallStep},_setItemsLargeTick:function(){var t=this,r=t.options,u=t.wrapper.find(h),i=0,f,s,e;if(rt(r.largeStep)%rt(r.smallStep)==0||t._distance/r.largeStep>=3)for(t._isHorizontal||t._isRtl||(u=n.makeArray(u).reverse()),i=0;i<u.length;i++)f=n(u[i]),s=t._values[i],e=o(rt(s-this.options.min)),e%rt(r.smallStep)==0&&e%rt(r.largeStep)==0&&(f.addClass("k-tick-large").html("<span class='k-label'>"+f.attr("title")+"<\/span>"),i!==0&&i!==u.length-1&&f.css("line-height",f[t._sizeFn]()+"px"))},_calculateItemsWidth:function(n){var t=this,f=t.options,e=parseFloat(t._trackDiv.css(t._sizeFn))+1,s=e/t._distance,o,r,u;for(t._distance/f.smallStep-i.floor(t._distance/f.smallStep)>0&&(e-=t._distance%f.smallStep*s),o=e/n,r=[],u=0;u<n-1;u++)r[u]=o;return r[n-1]=r[n]=o/2,t._roundWidths(r)},_roundWidths:function(n){for(var r=0,u=n.length,t=0;t<u;t++)r+=n[t]-i.floor(n[t]),n[t]=i.floor(n[t]);return r=i.round(r),this._addAdditionalSize(r,n)},_addAdditionalSize:function(n,t){if(n===0)return t;for(var u=parseFloat(t.length-1)/parseFloat(n==1?n:n-1),r=0;r<n;r++)t[parseInt(i.round(u*r),10)]+=1;return t},_calculateSteps:function(n){var t=this,u=t.options,e=u.min,s=0,r=i.ceil(t._distance/u.smallStep),f=1,h;if(r+=t._distance/u.smallStep%1==0?1:0,n.splice(0,0,n[r-2]*2),n.splice(r-1,1,n.pop()*2),t._pixelSteps=[s],t._values=[e],r!==0){while(f<r)s+=(n[f-1]+n[f])/2,t._pixelSteps[f]=s,e+=u.smallStep,t._values[f]=o(e),f++;h=t._distance%u.smallStep==0?r-1:r;t._pixelSteps[h]=t._maxSelection;t._values[h]=u.max;t._isRtl&&(t._pixelSteps.reverse(),t._values.reverse())}},_getValueFromPosition:function(n,t){var r=this,e=r.options,s=i.max(e.smallStep*(r._maxSelection/r._distance),0),u=0,h=s/2,f;if(r._isHorizontal?(u=n-t.startPoint,r._isRtl&&(u=r._maxSelection-u)):u=t.startPoint-n,r._maxSelection-(parseInt(r._maxSelection%s,10)-3)/2<u)return e.max;for(f=0;f<r._pixelSteps.length;f++)if(i.abs(r._pixelSteps[f]-u)-1<=h)return o(r._values[f])},_getFormattedValue:function(n,t){var s=this,o="",e=s.options.tooltip,i,u,f;return wt(n)?(u=n[0],f=n[1]):t&&t.type&&(u=t.selectionStart,f=t.selectionEnd),t&&(i=t.tooltipTemplate),!i&&e.template&&(i=r.template(e.template)),wt(n)||t&&t.type?i?o=i({selectionStart:u,selectionEnd:f}):(u=ut(e.format,u),f=ut(e.format,f),o=u+" - "+f):(t&&(t.val=n),o=i?i({value:n}):ut(e.format,n)),o},_getDraggableArea:function(){var n=this,t=r.getOffset(n._trackDiv);return{startPoint:n._isHorizontal?t.left:t.top+n._maxSelection,endPoint:n._isHorizontal?t.left+n._maxSelection:t.top}},_createHtml:function(){var i=this,t=i.element,n=i.options,r=t.find("input");r.length==2?(r.eq(0).prop("value",l(n.selectionStart)),r.eq(1).prop("value",l(n.selectionEnd))):t.prop("value",l(n.value));t.wrap(oi(n,t,i._isHorizontal)).hide();n.showButtons&&t.before(ii(n,"increase",i._isHorizontal)).before(ii(n,"decrease",i._isHorizontal));t.before(hi(n,t))},_focus:function(t){var i=this,f=t.target,u=i.value(),r=i._drag;r||(f==i.wrapper.find(e).eq(0)[0]?(r=i._firstHandleDrag,i._activeHandle=0):(r=i._lastHandleDrag,i._activeHandle=1),u=u[i._activeHandle]);n(f).addClass(c+" "+w);r&&(i._activeHandleDrag=r,r.selectionStart=i.options.selectionStart,r.selectionEnd=i.options.selectionEnd,r._updateTooltip(u))},_focusWithMouse:function(t){t=n(t);var i=this,r=t.is(e)?t.index():0;window.setTimeout(function(){i.wrapper.find(e)[r==2?1:0].focus()},1);i._setTooltipTimeout()},_blur:function(t){var i=this,r=i._activeHandleDrag;n(t.target).removeClass(c+" "+w);r&&(r._removeTooltip(),delete i._activeHandleDrag,delete i._activeHandle)},_setTooltipTimeout:function(){var n=this;n._tooltipTimeout=window.setTimeout(function(){var t=n._drag||n._activeHandleDrag;t&&t._removeTooltip()},300)},_clearTooltipTimeout:function(){var t=this,n;window.clearTimeout(this._tooltipTimeout);n=t._drag||t._activeHandleDrag;n&&n.tooltipDiv&&n.tooltipDiv.stop(!0,!1).css("opacity",1)},_reset:function(){var t=this,i=t.element,r=i.attr("form"),u=r?n("#"+r):i.closest("form");u[0]&&(t._form=u.on("reset",f(t._formResetHandler,t)))},destroy:function(){this._form&&this._form.off("reset",this._formResetHandler);pt.fn.destroy.call(this)}}),v=d.extend({init:function(r,u){var f=this,o;r.type="text";u=dt({},{value:s(r,"value"),min:s(r,"min"),max:s(r,"max"),smallStep:s(r,"step")},u);r=n(r);u&&u.enabled===t&&(u.enabled=!r.is("[disabled]"));d.fn.init.call(f,r,u);u=f.options;kt(u.value)&&u.value!==null||(u.value=u.min,r.prop("value",l(u.min)));u.value=i.max(i.min(u.value,u.max),u.min);o=f.wrapper.find(e);this._selection=new v.Selection(o,f,u);f._drag=new v.Drag(o,"",f,u)},options:{name:"Slider",showButtons:!0,increaseButtonTitle:"Increase",decreaseButtonTitle:"Decrease",dragHandleTitle:"drag",tooltip:{format:"{0:#,#.##}"},value:null},enable:function(t){var i=this,l=i.options,v,o,s;if(i.disable(),t!==!1){i.wrapper.removeClass(at).addClass(lt);i.wrapper.find("input").removeAttr(k);v=function(t){var r=ti(t)[0];if(r){var f=i._isHorizontal?r.location.pageX:r.location.pageY,e=i._getDraggableArea(),u=n(t.target);if(u.hasClass("k-draghandle")){u.addClass(c+" "+w);return}i._update(i._getValueFromPosition(f,e));i._focusWithMouse(t.target);i._drag.dragstart(t);t.preventDefault()}};i.wrapper.find(h+", "+p).on(b,v).end().on(b,function(){n(document.documentElement).one("selectstart",r.preventDefault)}).on(et,function(){i._drag._end()});i.wrapper.find(e).attr(vt,0).on(a,function(){i._drag.draggable.userEvents.cancel();i._setTooltipTimeout()}).on(st,function(n){i._focusWithMouse(n.target);n.preventDefault()}).on(ht,f(i._focus,i)).on(ct,f(i._blur,i));o=f(function(n){var t=i._nextValueByIndex(i._valueIndex+n*1);i._setValueInRange(t);i._drag._updateTooltip(t)},i);l.showButtons&&(s=f(function(n,t){this._clearTooltipTimeout();(n.which===1||bt.touch&&n.which===0)&&(o(t),this.timeout=setTimeout(f(function(){this.timer=setInterval(function(){o(t)},60)},this),200))},i),i.wrapper.find(".k-button").on(a,f(function(n){this._clearTimer();i._focusWithMouse(n.target)},i)).on(it,function(t){n(t.currentTarget).addClass("k-state-hover")}).on("mouseout"+u,f(function(t){n(t.currentTarget).removeClass("k-state-hover");this._clearTimer()},i)).eq(0).on(tt,f(function(n){s(n,1)},i)).click(!1).end().eq(1).on(tt,f(function(n){s(n,-1)},i)).click(r.preventDefault));i.wrapper.find(e).off(y,!1).on(y,f(this._keydown,i));l.enabled=!0}},disable:function(){var t=this;t.wrapper.removeClass(lt).addClass(at);n(t.element).prop(k,k);t.wrapper.find(".k-button").off(tt).on(tt,r.preventDefault).off(a).on(a,r.preventDefault).off("mouseleave"+u).on("mouseleave"+u,r.preventDefault).off(it).on(it,r.preventDefault);t.wrapper.find(h+", "+p).off(b).off(et);t.wrapper.find(e).attr(vt,-1).off(a).off(y).off(st).off(ht).off(ct);t.options.enabled=!1},_update:function(n){var t=this,i=t.value()!=n;t.value(n);i&&t.trigger(nt,{value:t.options.value})},value:function(n){var i=this,t=i.options;if(n=o(n),isNaN(n))return t.value;n>=t.min&&n<=t.max&&t.value!=n&&(i.element.prop("value",l(n)),t.value=n,i._refreshAriaAttr(n),i._refresh())},_refresh:function(){this.trigger(ot,{value:this.options.value})},_refreshAriaAttr:function(n){var i=this,t=i._drag,r;r=t&&t._tooltipDiv?t._tooltipDiv.text():i._getFormattedValue(n,null);this.wrapper.find(e).attr("aria-valuenow",n).attr("aria-valuetext",r)},_clearTimer:function(){clearTimeout(this.timeout);clearInterval(this.timer)},_keydown:function(n){var t=this;n.keyCode in t._keyMap&&(t._clearTooltipTimeout(),t._setValueInRange(t._keyMap[n.keyCode](t.options.value)),t._drag._updateTooltip(t.value()),n.preventDefault())},_setValueInRange:function(n){var t=this,r=t.options;if(n=o(n),isNaN(n)){t._update(r.min);return}n=i.max(i.min(n,r.max),r.min);t._update(n)},_nextValueByIndex:function(n){var t=this._values.length;return this._isRtl&&(n=t-1-n),this._values[i.max(0,i.min(n,t-1))]},_formResetHandler:function(){var n=this,t=n.options.min;setTimeout(function(){var i=n.element[0].value;n.value(i===""||isNaN(i)?t:i)})},destroy:function(){var n=this;d.fn.destroy.call(n);n.wrapper.off(u).find(".k-button").off(u).end().find(e).off(u).end().find(h+", "+p).off(u).end();n._drag.draggable.destroy();n._drag._removeTooltip(!0)}}),yt;v.Selection=function(n,t,r){function u(u){var e=u-r.min,s=t._valueIndex=i.ceil(o(e/r.smallStep)),f=parseInt(t._pixelSteps[s],10),h=t._trackDiv.find(".k-slider-selection"),c=parseInt(n[t._outerSize]()/2,10),l=t._isRtl?2:0;h[t._sizeFn](t._isRtl?t._maxSelection-f:f);n.css(t._position,f-c-l)}u(r.value);t.bind([nt,ft,ot],function(n){u(parseFloat(n.value,10))})};v.Drag=function(n,t,i,r){var u=this;u.owner=i;u.options=r;u.element=n;u.type=t;u.draggable=new ui(n,{distance:0,dragstart:f(u._dragstart,u),drag:f(u.drag,u),dragend:f(u.dragend,u),dragcancel:f(u.dragcancel,u)});n.click(!1)};v.Drag.prototype={dragstart:function(n){this.owner._activeDragHandle=this;this.draggable.userEvents.cancel();this.draggable.userEvents._start(n)},_dragstart:function(t){var r=this,u=r.owner,f=r.options;if(!f.enabled){t.preventDefault();return}this.owner._activeDragHandle=this;u.element.off(it);u.wrapper.find("."+c).removeClass(c+" "+w);r.element.addClass(c+" "+w);n(document.documentElement).css("cursor","pointer");r.dragableArea=u._getDraggableArea();r.step=i.max(f.smallStep*(u._maxSelection/u._distance),0);r.type?(r.selectionStart=f.selectionStart,r.selectionEnd=f.selectionEnd,u._setZIndex(r.type)):r.oldVal=r.val=f.value;r._removeTooltip(!0);r._createTooltip()},_createTooltip:function(){var t=this,i=t.owner,u=t.options.tooltip,f="",e=n(window),s,o;u.enabled&&(u.template&&(s=t.tooltipTemplate=r.template(u.template)),n(".k-slider-tooltip").remove(),t.tooltipDiv=n("<div class='k-widget k-tooltip k-slider-tooltip'><!-- --><\/div>").appendTo(document.body),f=i._getFormattedValue(t.val||i.value(),t),t.type||(o="k-callout-"+(i._isHorizontal?"s":"e"),t.tooltipInnerDiv="<div class='k-callout "+o+"'><!-- --><\/div>",f+=t.tooltipInnerDiv),t.tooltipDiv.html(f),t._scrollOffset={top:e.scrollTop(),left:e.scrollLeft()},t.moveTooltip())},drag:function(n){var t=this,u=t.owner,r=n.x.location,o=n.y.location,f=t.dragableArea.startPoint,i=t.dragableArea.endPoint,e;n.preventDefault();t.val=u._isHorizontal?u._isRtl?t.constrainValue(r,f,i,r<i):t.constrainValue(r,f,i,r>=i):t.constrainValue(o,i,f,o<=i);t.oldVal!=t.val&&(t.oldVal=t.val,t.type?(t.type=="firstHandle"?t.selectionStart=t.val<t.selectionEnd?t.val:t.selectionEnd=t.val:t.val>t.selectionStart?t.selectionEnd=t.val:t.selectionStart=t.selectionEnd=t.val,e={values:[t.selectionStart,t.selectionEnd],value:[t.selectionStart,t.selectionEnd]}):e={value:t.val},u.trigger(ft,e));t._updateTooltip(t.val)},_updateTooltip:function(n){var t=this,r=t.options,u=r.tooltip,i="";(t.val&&(n=t.val),u.enabled)&&(t.tooltipDiv||t._createTooltip(),i=t.owner._getFormattedValue(o(n),t),t.type||(i+=t.tooltipInnerDiv),t.tooltipDiv.html(i),t.moveTooltip())},dragcancel:function(){return this.owner._refresh(),n(document.documentElement).css("cursor",""),this._end()},dragend:function(){var t=this,i=t.owner;return n(document.documentElement).css("cursor",""),t.type?i._update(t.selectionStart,t.selectionEnd):(i._update(t.val),t.draggable.userEvents._disposeAll()),t._end()},_end:function(){var n=this,t=n.owner;t._focusWithMouse(n.element);t.element.on(it);return!1},_removeTooltip:function(t){var i=this,r=i.owner;i.tooltipDiv&&r.options.tooltip.enabled&&r.options.enabled&&(t?(i.tooltipDiv.remove(),i.tooltipDiv=null):i.tooltipDiv.fadeOut("slow",function(){n(this).remove();i.tooltipDiv=null}))},moveTooltip:function(){var t=this,f=t.owner,i=0,u=0,l=t.element,o=r.getOffset(l),a=8,v=n(window),s=t.tooltipDiv.find(".k-callout"),y=t.tooltipDiv.outerWidth(),p=t.tooltipDiv.outerHeight(),w,h,c,b;t.type?(w=f.wrapper.find(e),o=r.getOffset(w.eq(0)),h=r.getOffset(w.eq(1)),f._isHorizontal?(i=h.top,u=o.left+(h.left-o.left)/2):(i=o.top+(h.top-o.top)/2,u=h.left),b=w.eq(0).outerWidth()+2*a):(i=o.top,u=o.left,b=l.outerWidth()+2*a);f._isHorizontal?(u-=parseInt((y-l[f._outerSize]())/2,10),i-=p+s.height()+a):(i-=parseInt((p-l[f._outerSize]())/2,10),u-=y+s.width()+a);f._isHorizontal?(c=t._flip(i,p,b,v.outerHeight()+t._scrollOffset.top),i+=c,u+=t._fit(u,y,v.outerWidth()+t._scrollOffset.left)):(c=t._flip(u,y,b,v.outerWidth()+t._scrollOffset.left),i+=t._fit(i,p,v.outerHeight()+t._scrollOffset.top),u+=c);c>0&&s&&(s.removeClass(),s.addClass("k-callout k-callout-"+(f._isHorizontal?"n":"w")));t.tooltipDiv.css({top:i,left:u})},_fit:function(n,t,i){var r=0;return n+t>i&&(r=i-(n+t)),n<0&&(r=-n),r},_flip:function(n,t,i,r){var u=0;return n+t>r&&(u+=-(i+t)),n+u<0&&(u+=i+t),u},constrainValue:function(n,t,i,r){var u=this;return t<n&&n<i?u.owner._getValueFromPosition(n,u.dragableArea):r?u.options.max:u.options.min}};r.ui.plugin(v);yt=d.extend({init:function(i,r){var u=this,f=n(i).find("input"),o=f.eq(0)[0],h=f.eq(1)[0],c;o.type="text";h.type="text";r&&r.showButtons&&(window.console&&window.console.warn("showbuttons option is not supported for the range slider, ignoring"),r.showButtons=!1);r=dt({},{selectionStart:s(o,"value"),min:s(o,"min"),max:s(o,"max"),smallStep:s(o,"step")},{selectionEnd:s(h,"value"),min:s(h,"min"),max:s(h,"max"),smallStep:s(h,"step")},r);r&&r.enabled===t&&(r.enabled=!f.is("[disabled]"));d.fn.init.call(u,i,r);r=u.options;kt(r.selectionStart)&&r.selectionStart!==null||(r.selectionStart=r.min,f.eq(0).prop("value",l(r.min)));kt(r.selectionEnd)&&r.selectionEnd!==null||(r.selectionEnd=r.max,f.eq(1).prop("value",l(r.max)));c=u.wrapper.find(e);this._selection=new yt.Selection(c,u,r);u._firstHandleDrag=new v.Drag(c.eq(0),"firstHandle",u,r);u._lastHandleDrag=new v.Drag(c.eq(1),"lastHandle",u,r)},options:{name:"RangeSlider",leftDragHandleTitle:"drag",rightDragHandleTitle:"drag",tooltip:{format:"{0:#,#.##}"},selectionStart:null,selectionEnd:null},enable:function(t){var i=this,u=i.options,o;if(i.disable(),t!==!1){i.wrapper.removeClass(at).addClass(lt);i.wrapper.find("input").removeAttr(k);o=function(t){var s=ti(t)[0];if(s){var l=i._isHorizontal?s.location.pageX:s.location.pageY,a=i._getDraggableArea(),r=i._getValueFromPosition(l,a),h=n(t.target),e,o,f;if(h.hasClass("k-draghandle")){i.wrapper.find("."+c).removeClass(c+" "+w);h.addClass(c+" "+w);return}r<u.selectionStart?(e=r,o=u.selectionEnd,f=i._firstHandleDrag):r>i.selectionEnd?(e=u.selectionStart,o=r,f=i._lastHandleDrag):r-u.selectionStart<=u.selectionEnd-r?(e=r,o=u.selectionEnd,f=i._firstHandleDrag):(e=u.selectionStart,o=r,f=i._lastHandleDrag);f.dragstart(t);i._setValueInRange(e,o);i._focusWithMouse(f.element)}};i.wrapper.find(h+", "+p).on(b,o).end().on(b,function(){n(document.documentElement).one("selectstart",r.preventDefault)}).on(et,function(){i._activeDragHandle&&i._activeDragHandle._end()});i.wrapper.find(e).attr(vt,0).on(a,function(){i._setTooltipTimeout();i._drag.draggable.userEvents.cancel()}).on(st,function(n){i._focusWithMouse(n.target);n.preventDefault()}).on(ht,f(i._focus,i)).on(ct,f(i._blur,i));i.wrapper.find(e).off(y,r.preventDefault).eq(0).on(y,f(function(n){this._keydown(n,"firstHandle")},i)).end().eq(1).on(y,f(function(n){this._keydown(n,"lastHandle")},i));i.options.enabled=!0}},disable:function(){var n=this;n.wrapper.removeClass(lt).addClass(at);n.wrapper.find("input").prop(k,k);n.wrapper.find(h+", "+p).off(b).off(et);n.wrapper.find(e).attr(vt,-1).off(a).off(y).off(st).off(ht).off(ct);n.options.enabled=!1},_keydown:function(n,t){var i=this,r=i.options.selectionStart,u=i.options.selectionEnd,e,s,f;n.keyCode in i._keyMap&&(i._clearTooltipTimeout(),t=="firstHandle"?(f=i._activeHandleDrag=i._firstHandleDrag,r=i._keyMap[n.keyCode](r),r>u&&(u=r)):(f=i._activeHandleDrag=i._lastHandleDrag,u=i._keyMap[n.keyCode](u),r>u&&(r=u)),i._setValueInRange(o(r),o(u)),e=Math.max(r,i.options.selectionStart),s=Math.min(u,i.options.selectionEnd),f.selectionEnd=Math.max(s,i.options.selectionStart),f.selectionStart=Math.min(e,i.options.selectionEnd),f._updateTooltip(i.value()[i._activeHandle]),n.preventDefault())},_update:function(n,t){var i=this,r=i.value(),u=r[0]!=n||r[1]!=t;i.value([n,t]);u&&i.trigger(nt,{values:[n,t],value:[n,t]})},value:function(n){return n&&n.length?this._value(n[0],n[1]):this._value()},_value:function(n,t){var r=this,i=r.options,u=i.selectionStart,f=i.selectionEnd;if(isNaN(n)&&isNaN(t))return[u,f];n=o(n);t=o(t);n>=i.min&&n<=i.max&&t>=i.min&&t<=i.max&&n<=t&&(u!=n||f!=t)&&(r.element.find("input").eq(0).prop("value",l(n)).end().eq(1).prop("value",l(t)),i.selectionStart=n,i.selectionEnd=t,r._refresh(),r._refreshAriaAttr(n,t))},values:function(n,t){return wt(n)?this._value(n[0],n[1]):this._value(n,t)},_refresh:function(){var t=this,n=t.options;t.trigger(ot,{values:[n.selectionStart,n.selectionEnd],value:[n.selectionStart,n.selectionEnd]});n.selectionStart==n.max&&n.selectionEnd==n.max&&t._setZIndex("firstHandle")},_refreshAriaAttr:function(n,t){var i=this,r=i.wrapper.find(e),f=i._activeHandleDrag,u;u=i._getFormattedValue([n,t],f);r.eq(0).attr("aria-valuenow",n);r.eq(1).attr("aria-valuenow",t);r.attr("aria-valuetext",u)},_setValueInRange:function(n,t){var r=this.options;n=i.max(i.min(n,r.max),r.min);t=i.max(i.min(t,r.max),r.min);n==r.max&&t==r.max&&this._setZIndex("firstHandle");this._update(i.min(n,t),i.max(n,t))},_setZIndex:function(t){this.wrapper.find(e).each(function(i){n(this).css("z-index",t=="firstHandle"?1-i:i)})},_formResetHandler:function(){var n=this,t=n.options;setTimeout(function(){var u=n.element.find("input"),i=u[0].value,r=u[1].value;n.values(i===""||isNaN(i)?t.min:i,r===""||isNaN(r)?t.max:r)})},destroy:function(){var n=this;d.fn.destroy.call(n);n.wrapper.off(u).find(h+", "+p).off(u).end().find(e).off(u);n._firstHandleDrag.draggable.destroy();n._lastHandleDrag.draggable.destroy()}});yt.Selection=function(n,t,r){function u(u){u=u||[];var l=u[0]-r.min,a=u[1]-r.min,v=i.ceil(o(l/r.smallStep)),y=i.ceil(o(a/r.smallStep)),e=t._pixelSteps[v],s=t._pixelSteps[y],h=parseInt(n.eq(0)[t._outerSize]()/2,10),c=t._isRtl?2:0;n.eq(0).css(t._position,e-h-c).end().eq(1).css(t._position,s-h-c);f(e,s)}function f(n,r){var e,u,f=t._trackDiv.find(".k-slider-selection");e=i.abs(n-r);f[t._sizeFn](e);t._isRtl?(u=i.max(n,r),f.css("right",t._maxSelection-u-1)):(u=i.min(n,r),f.css(t._position,u-1))}u(t.value());t.bind([nt,ft,ot],function(n){u(n.values)})};r.ui.plugin(yt)})(window.kendo.jQuery)}(),function(){(function(n,t,i){function g(n,t,i){i=e(i);i&&!i.equals(n.color())&&(t=="change"&&(n._value=i),i=i.a!=1?i.toCssRgba():i.toCss(),n.trigger(t,{value:i}))}function p(n,t,i){n=Array.prototype.slice.call(n);var u=n.length,r=n.indexOf(t);return r<0?i<0?n[u-1]:n[0]:(r+=i,r<0?r+=u:r%=u,n[r])}function h(n){n.preventDefault()}function w(n,t){return function(){return n.apply(t,arguments)}}var f=window.kendo,v=f.ui,c=v.Widget,e=f.parseColor,b=f.Color,r=f.keys,s="background-color",l="k-state-selected",it="000000,7f7f7f,880015,ed1c24,ff7f27,fff200,22b14c,00a2e8,3f48cc,a349a4,ffffff,c3c3c3,b97a57,ffaec9,ffc90e,efe4b0,b5e61d,99d9ea,7092be,c8bfe7",rt="FFFFFF,FFCCFF,FF99FF,FF66FF,FF33FF,FF00FF,CCFFFF,CCCCFF,CC99FF,CC66FF,CC33FF,CC00FF,99FFFF,99CCFF,9999FF,9966FF,9933FF,9900FF,FFFFCC,FFCCCC,FF99CC,FF66CC,FF33CC,FF00CC,CCFFCC,CCCCCC,CC99CC,CC66CC,CC33CC,CC00CC,99FFCC,99CCCC,9999CC,9966CC,9933CC,9900CC,FFFF99,FFCC99,FF9999,FF6699,FF3399,FF0099,CCFF99,CCCC99,CC9999,CC6699,CC3399,CC0099,99FF99,99CC99,999999,996699,993399,990099,FFFF66,FFCC66,FF9966,FF6666,FF3366,FF0066,CCFF66,CCCC66,CC9966,CC6666,CC3366,CC0066,99FF66,99CC66,999966,996666,993366,990066,FFFF33,FFCC33,FF9933,FF6633,FF3333,FF0033,CCFF33,CCCC33,CC9933,CC6633,CC3333,CC0033,99FF33,99CC33,999933,996633,993333,990033,FFFF00,FFCC00,FF9900,FF6600,FF3300,FF0000,CCFF00,CCCC00,CC9900,CC6600,CC3300,CC0000,99FF00,99CC00,999900,996600,993300,990000,66FFFF,66CCFF,6699FF,6666FF,6633FF,6600FF,33FFFF,33CCFF,3399FF,3366FF,3333FF,3300FF,00FFFF,00CCFF,0099FF,0066FF,0033FF,0000FF,66FFCC,66CCCC,6699CC,6666CC,6633CC,6600CC,33FFCC,33CCCC,3399CC,3366CC,3333CC,3300CC,00FFCC,00CCCC,0099CC,0066CC,0033CC,0000CC,66FF99,66CC99,669999,666699,663399,660099,33FF99,33CC99,339999,336699,333399,330099,00FF99,00CC99,009999,006699,003399,000099,66FF66,66CC66,669966,666666,663366,660066,33FF66,33CC66,339966,336666,333366,330066,00FF66,00CC66,009966,006666,003366,000066,66FF33,66CC33,669933,666633,663333,660033,33FF33,33CC33,339933,336633,333333,330033,00FF33,00CC33,009933,006633,003333,000033,66FF00,66CC00,669900,666600,663300,660000,33FF00,33CC00,339900,336600,333300,330000,00FF00,00CC00,009900,006600,003300,000000",k={apply:"Apply",cancel:"Cancel"},u=".kendoColorTools",a="click"+u,y="keydown"+u,d=f.support.browser,ut=d.msie&&d.version<9,o=c.extend({init:function(n,t){var i=this,r;c.fn.init.call(i,n,t);n=i.element;t=i.options;i._value=t.value=e(t.value);i._tabIndex=n.attr("tabIndex")||0;r=i._ariaId=t.ariaId;r&&n.attr("aria-labelledby",r);t._standalone&&(i._triggerSelect=i._triggerChange)},options:{name:"ColorSelector",value:null,_standalone:!0},events:["change","select","cancel"],color:function(n){return n!==i&&(this._value=e(n),this._updateUI(this._value)),this._value},value:function(n){return n=this.color(n),n&&(n=this.options.opacity?n.toCssRgba():n.toCss()),n||null},enable:function(t){arguments.length===0&&(t=!0);n(".k-disabled-overlay",this.wrapper).remove();t||this.wrapper.append("<div class='k-disabled-overlay'><\/div>");this._onEnable(t)},_select:function(n,t){var i=this._value;n=this.color(n);t||(this.element.trigger("change"),n.equals(i)?this._standalone||this.trigger("cancel"):this.trigger("change",{value:this.value()}))},_triggerSelect:function(n){g(this,"select",n)},_triggerChange:function(n){g(this,"change",n)},destroy:function(){this.element&&this.element.off(u);this.wrapper&&this.wrapper.off(u).find("*").off(u);this.wrapper=null;c.fn.destroy.call(this)},_updateUI:n.noop,_selectOnHide:function(){return null},_cancel:function(){this.trigger("cancel")}}),nt=o.extend({init:function(t,i){var u=this,r,h,c,l;o.fn.init.call(u,t,i);t=u.wrapper=u.element;i=u.options;r=i.palette;r=="websafe"?(r=rt,i.columns=18):r=="basic"&&(r=it);typeof r=="string"&&(r=r.split(","));n.isArray(r)&&(r=n.map(r,function(n){return e(n)}));u._selectedID=(i.ariaId||f.guid())+"_selected";t.addClass("k-widget k-colorpalette").attr("role","grid").attr("aria-readonly","true").append(n(u._template({colors:r,columns:i.columns,tileSize:i.tileSize,value:u._value,id:i.ariaId}))).on(a,".k-item",function(t){u._select(n(t.currentTarget).css(s))}).attr("tabIndex",u._tabIndex).on(y,w(u._keydown,u));if(h=i.tileSize,h){if(/number|string/.test(typeof h))c=l=parseFloat(h);else if(typeof h=="object")c=parseFloat(h.width),l=parseFloat(h.height);else throw new Error("Unsupported value for the 'tileSize' argument");t.find(".k-item").css({width:c,height:l})}},focus:function(){this.wrapper.focus()},options:{name:"ColorPalette",columns:10,tileSize:null,palette:"basic"},_onEnable:function(n){n?this.wrapper.attr("tabIndex",this._tabIndex):this.wrapper.removeAttr("tabIndex")},_keydown:function(t){var i,a=this.wrapper,o=a.find(".k-item"),u=o.filter("."+l).get(0),f=t.keyCode,c;if(f==r.LEFT?i=p(o,u,-1):f==r.RIGHT?i=p(o,u,1):f==r.DOWN?i=p(o,u,this.options.columns):f==r.UP?i=p(o,u,-this.options.columns):f==r.ENTER?(h(t),u&&this._select(n(u).css(s))):f==r.ESC&&this._cancel(),i){h(t);this._current(i);try{c=e(i.css(s));this._triggerSelect(c)}catch(v){}}},_current:function(t){this.wrapper.find("."+l).removeClass(l).attr("aria-selected",!1).removeAttr("id");n(t).addClass(l).attr("aria-selected",!0).attr("id",this._selectedID);this.element.removeAttr("aria-activedescendant").attr("aria-activedescendant",this._selectedID)},_updateUI:function(t){var i=null;this.wrapper.find(".k-item").each(function(){var r=e(n(this).css(s));if(r&&r.equals(t))return i=this,!1});this._current(i)},_template:f.template('<table class="k-palette k-reset" role="presentation"><tr role="row"># for (var i = 0; i < colors.length; ++i) { ## var selected = colors[i].equals(value); ## if (i && i % columns == 0) { # <\/tr><tr role="row"> # } #<td role="gridcell" unselectable="on" style="background-color:#= colors[i].toCss() #"#= selected ? " aria-selected=true" : "" # #=(id && i === 0) ? "id=\\""+id+"\\" " : "" # class="k-item#= selected ? " '+l+'" : "" #" aria-label="#= colors[i].toCss() #"><\/td># } #<\/tr><\/table>')}),tt=o.extend({init:function(t,i){var u=this;o.fn.init.call(u,t,i);i=u.options;t=u.element;u.wrapper=t.addClass("k-widget k-flatcolorpicker").append(u._template(i));u._hueElements=n(".k-hsv-rectangle, .k-transparency-slider .k-slider-track",t);u._selectedColor=n(".k-selected-color-display",t);u._colorAsText=n("input.k-color-value",t);u._sliders();u._hsvArea();u._updateUI(u._value||e("#f00"));t.find("input.k-color-value").on(y,function(t){var i=this,f,o;if(t.keyCode==r.ENTER)try{f=e(i.value);o=u.color();u._select(f,f.equals(o))}catch(s){n(i).addClass("k-state-error")}else u.options.autoupdate&&setTimeout(function(){var n=e(i.value,!0);n&&u._updateUI(n,!0)},10)}).end().on(a,".k-controls button.apply",function(){u._select(u._getHSV())}).on(a,".k-controls button.cancel",function(){u._updateUI(u.color());u._cancel()});ut&&u._applyIEFilter()},destroy:function(){this._hueSlider.destroy();this._opacitySlider&&this._opacitySlider.destroy();this._hueSlider=this._opacitySlider=this._hsvRect=this._hsvHandle=this._hueElements=this._selectedColor=this._colorAsText=null;o.fn.destroy.call(this)},options:{name:"FlatColorPicker",opacity:!1,buttons:!1,input:!0,preview:!0,autoupdate:!0,messages:k},_applyIEFilter:function(){var t=this.element.find(".k-hue-slider .k-slider-track")[0],n=t.currentStyle.backgroundImage;n=n.replace(/^url\([\'\"]?|[\'\"]?\)$/g,"");t.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+n+"', sizingMethod='scale')"},_sliders:function(){function i(t){n._updateUI(n._getHSV(t.value,null,null,null))}function r(t){n._updateUI(n._getHSV(null,null,null,t.value/100))}var n=this,t=n.element;n._hueSlider=t.find(".k-hue-slider").kendoSlider({min:0,max:359,tickPlacement:"none",showButtons:!1,slide:i,change:i}).data("kendoSlider");n._opacitySlider=t.find(".k-transparency-slider").kendoSlider({min:0,max:100,tickPlacement:"none",showButtons:!1,slide:r,change:r}).data("kendoSlider")},_hsvArea:function(){function r(n,i){var o=this.offset,r=n-o.left,u=i-o.top,f=this.width,e=this.height;r=r<0?0:r>f?f:r;u=u<0?0:u>e?e:u;t._svChange(r/f,1-u/e)}var t=this,u=t.element,n=u.find(".k-hsv-rectangle"),i=n.find(".k-draghandle").attr("tabIndex",0).on(y,w(t._keydown,t));t._hsvEvents=new f.UserEvents(n,{global:!0,press:function(t){this.offset=f.getOffset(n);this.width=n.width();this.height=n.height();i.focus();r.call(this,t.x.location,t.y.location)},start:function(){n.addClass("k-dragging");i.focus()},move:function(n){n.preventDefault();r.call(this,n.x.location,n.y.location)},end:function(){n.removeClass("k-dragging")}});t._hsvRect=n;t._hsvHandle=i},_onEnable:function(n){this._hueSlider.enable(n);this._opacitySlider&&this._opacitySlider.enable(n);this.wrapper.find("input").attr("disabled",!n);var t=this._hsvRect.find(".k-draghandle");n?t.attr("tabIndex",this._tabIndex):t.removeAttr("tabIndex")},_keydown:function(n){function i(i,r){var u=t._getHSV();u[i]+=r*(n.shiftKey?.01:.05);u[i]<0&&(u[i]=0);u[i]>1&&(u[i]=1);t._updateUI(u);h(n)}function u(i){var r=t._getHSV();r.h+=i*(n.shiftKey?1:5);r.h<0&&(r.h=0);r.h>359&&(r.h=359);t._updateUI(r);h(n)}var t=this;switch(n.keyCode){case r.LEFT:n.ctrlKey?u(-1):i("s",-1);break;case r.RIGHT:n.ctrlKey?u(1):i("s",1);break;case r.UP:i(n.ctrlKey&&t._opacitySlider?"a":"v",1);break;case r.DOWN:i(n.ctrlKey&&t._opacitySlider?"a":"v",-1);break;case r.ENTER:t._select(t._getHSV());break;case r.F2:t.wrapper.find("input.k-color-value").focus().select();break;case r.ESC:t._cancel()}},focus:function(){this._hsvHandle.focus()},_getHSV:function(n,t,i,r){var u=this._hsvRect,e=u.width(),o=u.height(),f=this._hsvHandle.position();return n==null&&(n=this._hueSlider.value()),t==null&&(t=f.left/e),i==null&&(i=1-f.top/o),r==null&&(r=this._opacitySlider?this._opacitySlider.value()/100:1),b.fromHSV(n,t,i,r)},_svChange:function(n,t){var i=this._getHSV(null,n,t,null);this._updateUI(i)},_updateUI:function(n,t){var i=this,r=i._hsvRect;n&&(this._colorAsText.removeClass("k-state-error"),i._selectedColor.css(s,n.toDisplay()),t||i._colorAsText.val(i._opacitySlider?n.toCssRgba():n.toCss()),i._triggerSelect(n),n=n.toHSV(),i._hsvHandle.css({left:n.s*r.width()+"px",top:(1-n.v)*r.height()+"px"}),i._hueElements.css(s,b.fromHSV(n.h,1,1,1).toCss()),i._hueSlider.value(n.h),i._opacitySlider&&i._opacitySlider.value(100*n.a))},_selectOnHide:function(){return this.options.buttons?null:this._getHSV()},_template:f.template('# if (preview) { #<div class="k-selected-color"><div class="k-selected-color-display"><input class="k-color-value" #= !data.input ? \'style="visibility: hidden;"\' : "" #><\/div><\/div># } #<div class="k-hsv-rectangle"><div class="k-hsv-gradient"><\/div><div class="k-draghandle"><\/div><\/div><input class="k-hue-slider" /># if (opacity) { #<input class="k-transparency-slider" /># } ## if (buttons) { #<div unselectable="on" class="k-controls"><button class="k-button k-primary apply">#: messages.apply #<\/button> <button class="k-button cancel">#: messages.cancel #<\/button><\/div># } #')}),ft=c.extend({init:function(t,i){var r=this,u,f,o,s,h;c.fn.init.call(r,t,i);i=r.options;t=r.element;u=t.attr("value")||t.val();u=u?e(u,!0):e(i.value,!0);r._value=i.value=u;f=r.wrapper=n(r._template(i));t.hide().after(f);t.is("input")&&(t.appendTo(f),o=t.closest("label"),s=t.attr("id"),s&&(o=o.add('label[for="'+s+'"]')),o.click(function(n){r.open();n.preventDefault()}));r._tabIndex=t.attr("tabIndex")||0;r.enable(!t.attr("disabled"));h=t.attr("accesskey");h&&(t.attr("accesskey",null),f.attr("accesskey",h));r.bind("activate",function(n){n.isDefaultPrevented()||r.toggle()});r._updateUI(u)},destroy:function(){this.wrapper.off(u).find("*").off(u);this._popup&&(this._selector.destroy(),this._popup.destroy());this._selector=this._popup=this.wrapper=null;c.fn.destroy.call(this)},enable:function(n){var t=this,i=t.wrapper,r=i.children(".k-picker-wrap"),f=r.find(".k-select");arguments.length===0&&(n=!0);t.element.attr("disabled",!n);i.attr("aria-disabled",!n);f.off(u).on("mousedown"+u,h);if(i.addClass("k-state-disabled").removeAttr("tabIndex").add("*",i).off(u),n)i.removeClass("k-state-disabled").attr("tabIndex",t._tabIndex).on("mouseenter"+u,function(){r.addClass("k-state-hover")}).on("mouseleave"+u,function(){r.removeClass("k-state-hover")}).on("focus"+u,function(){r.addClass("k-state-focused")}).on("blur"+u,function(){r.removeClass("k-state-focused")}).on(y,w(t._keydown,t)).on(a,".k-select",w(t.toggle,t)).on(a,t.options.toolIcon?".k-tool-icon":".k-selected-color",function(){t.trigger("activate")})},_template:f.template('<span role="textbox" aria-haspopup="true" class="k-widget k-colorpicker k-header"><span class="k-picker-wrap k-state-default"># if (toolIcon) { #<span class="k-tool-icon #= toolIcon #"><span class="k-selected-color"><\/span><\/span># } else { #<span class="k-selected-color"><\/span># } #<span class="k-select" unselectable="on"><span class="k-icon k-i-arrow-s" unselectable="on"><\/span><\/span><\/span><\/span>'),options:{name:"ColorPicker",palette:null,columns:10,toolIcon:null,value:null,messages:k,opacity:!1,buttons:!0,preview:!0,ARIATemplate:'Current selected color is #=data || ""#'},events:["activate","change","select","open","close"],open:function(){this._getPopup().open()},close:function(){this._getPopup().close()},toggle:function(){this._getPopup().toggle()},color:o.fn.color,value:o.fn.value,_select:o.fn._select,_triggerSelect:o.fn._triggerSelect,_isInputTypeColor:function(){var n=this.element[0];return/^input$/i.test(n.tagName)&&/^color$/i.test(n.type)},_updateUI:function(n){var t="";n&&(t=this._isInputTypeColor()||n.a==1?n.toCss():n.toCssRgba(),this.element.val(t));this._ariaTemplate||(this._ariaTemplate=f.template(this.options.ARIATemplate));this.wrapper.attr("aria-label",this._ariaTemplate(t));this._triggerSelect(n);this.wrapper.find(".k-selected-color").css(s,n?n.toDisplay():"transparent")},_keydown:function(n){var t=n.keyCode;this._getPopup().visible()?(t==r.ESC?this._selector._cancel():this._selector._keydown(n),h(n)):(t==r.ENTER||t==r.DOWN)&&(this.open(),h(n))},_getPopup:function(){var t=this,u=t._popup,i,s,o,r;return u||(i=t.options,s=i.palette?nt:tt,i._standalone=!1,delete i.select,delete i.change,delete i.cancel,o=f.guid(),r=t._selector=new s(n('<div id="'+o+'"/>').appendTo(document.body),i),t.wrapper.attr("aria-owns",o),t._popup=u=r.wrapper.kendoPopup({anchor:t.wrapper,adjustSize:{width:5,height:0}}).data("kendoPopup"),r.bind({select:function(n){t._updateUI(e(n.value))},change:function(){t._select(r.color());t.close()},cancel:function(){t.close()}}),u.bind({close:function(n){if(t.trigger("close")){n.preventDefault();return}t.wrapper.children(".k-picker-wrap").removeClass("k-state-focused");var i=r._selectOnHide();i?t._select(i):(t.wrapper.focus(),t._updateUI(t.color()))},open:function(n){t.trigger("open")?n.preventDefault():t.wrapper.children(".k-picker-wrap").addClass("k-state-focused")},activate:function(){r._select(t.color(),!0);r.focus();t.wrapper.children(".k-picker-wrap").addClass("k-state-focused")}})),u}});v.plugin(nt);v.plugin(tt);v.plugin(ft)})(jQuery,parseInt)}(),function(){(function(n,t){function ut(n,t){return'<span unselectable="on" class="k-link"><span unselectable="on" class="k-icon k-i-arrow-'+n+'" title="'+t+'">'+t+"<\/span><\/span>"}var r=window.kendo,s=r.caret,e=r.keys,y=r.ui,h=y.Widget,ft=r._activeElement,et=r._extractFormat,ot=r.parseFloat,st=r.support.placeholder,ht=r.getCulture,p=r._round,c="change",w="disabled",b="readonly",ct="k-input",k="spin",u=".kendoNumericTextBox",lt="touchend",at="mouseleave"+u,d="mouseenter"+u+" "+at,l="k-state-default",g="k-state-focused",nt="k-state-hover",tt="focus",f=".",a="k-state-selected",v="k-state-disabled",it="aria-disabled",rt="aria-readonly",vt=/^(-)?(\d*)$/,i=null,o=n.proxy,yt=n.extend,pt=h.extend({init:function(f,e){var s=this,p=e&&e.step!==t,c,l,a,v,y;if(h.fn.init.call(s,f,e),e=s.options,f=s.element.on("focusout"+u,o(s._focusout,s)).attr("role","spinbutton"),e.placeholder=e.placeholder||f.attr("placeholder"),s._initialOptions=yt({},e),s._reset(),s._wrapper(),s._arrows(),s._input(),r.support.mobileOS)s._text.on(lt+u+" "+tt+u,function(){s._toggleText(!1);f.focus()});else s._text.on(tt+u,o(s._click,s));c=s.min(f.attr("min"));l=s.max(f.attr("max"));a=s._parse(f.attr("step"));e.min===i&&c!==i&&(e.min=c);e.max===i&&l!==i&&(e.max=l);p||a===i||(e.step=a);f.attr("aria-valuemin",e.min).attr("aria-valuemax",e.max);e.format=et(e.format);v=e.value;s.value(v!==i?v:f.val());y=f.is("[disabled]")||n(s.element).parents("fieldset").is(":disabled");y?s.enable(!1):s.readonly(f.is("[readonly]"));r.notify(s)},options:{name:"NumericTextBox",decimals:i,min:i,max:i,value:i,step:1,culture:"",format:"n",spinners:!0,placeholder:"",upArrowText:"Increase value",downArrowText:"Decrease value"},events:[c,k],_editable:function(n){var t=this,f=t.element,i=n.disable,r=n.readonly,e=t._text.add(f),s=t._inputWrapper.off(d);if(t._toggleText(!0),t._upArrowEventHandler.unbind("press"),t._downArrowEventHandler.unbind("press"),f.off("keydown"+u).off("keypress"+u).off("paste"+u),r||i)s.addClass(i?v:l).removeClass(i?l:v),e.attr(w,i).attr(b,r).attr(it,i).attr(rt,r);else{s.addClass(l).removeClass(v).on(d,t._toggleHover);e.removeAttr(w).removeAttr(b).attr(it,!1).attr(rt,!1);t._upArrowEventHandler.bind("press",function(n){n.preventDefault();t._spin(1);t._upArrow.addClass(a)});t._downArrowEventHandler.bind("press",function(n){n.preventDefault();t._spin(-1);t._downArrow.addClass(a)});t.element.on("keydown"+u,o(t._keydown,t)).on("keypress"+u,o(t._keypress,t)).on("paste"+u,o(t._paste,t))}},readonly:function(n){this._editable({readonly:n===t?!0:n,disable:!1})},enable:function(n){this._editable({readonly:!1,disable:!(n=n===t?!0:n)})},destroy:function(){var n=this;n.element.add(n._text).add(n._upArrow).add(n._downArrow).add(n._inputWrapper).off(u);n._upArrowEventHandler.destroy();n._downArrowEventHandler.destroy();n._form&&n._form.off("reset",n._resetHandler);h.fn.destroy.call(n)},min:function(n){return this._option("min",n)},max:function(n){return this._option("max",n)},step:function(n){return this._option("step",n)},value:function(n){var i=this,r;if(n===t)return i._value;(n=i._parse(n),r=i._adjust(n),n===r)&&(i._update(n),i._old=i._value)},focus:function(){this._focusin()},_adjust:function(n){var f=this,u=f.options,t=u.min,r=u.max;return n===i?n:(t!==i&&n<t?n=t:r!==i&&n>r&&(n=r),n)},_arrows:function(){var t=this,i,f=function(){clearTimeout(t._spinning);i.removeClass(a)},u=t.options,e=u.spinners,o=t.element;i=o.siblings(".k-icon");i[0]||(i=n(ut("n",u.upArrowText)+ut("s",u.downArrowText)).insertAfter(o),i.wrapAll('<span class="k-select"/>'));e||(i.parent().toggle(e),t._inputWrapper.addClass("k-expand-padding"));t._upArrow=i.eq(0);t._upArrowEventHandler=new r.UserEvents(t._upArrow,{release:f});t._downArrow=i.eq(1);t._downArrowEventHandler=new r.UserEvents(t._downArrow,{release:f})},_blur:function(){var n=this;n._toggleText(!0);n._change(n.element.val())},_click:function(n){var t=this;clearTimeout(t._focusing);t._focusing=setTimeout(function(){var o=n.target,a=s(o)[0],h=o.value.substring(0,a),c=t._format(t.options.format),i=c[","],r,l,u,e=0;i&&(l=new RegExp("\\"+i,"g"),u=new RegExp("([\\d\\"+i+"]+)(\\"+c[f]+")?(\\d+)?"));u&&(r=u.exec(h));r&&(e=r[0].replace(l,"").length,h.indexOf("(")!=-1&&t._value<0&&e++);t._focusin();s(t.element[0],e)})},_change:function(n){var t=this;t._update(n);n=t._value;t._old!=n&&(t._old=n,t._typing||t.element.trigger(c),t.trigger(c));t._typing=!1},_culture:function(n){return n||ht(this.options.culture)},_focusin:function(){var n=this;n._inputWrapper.addClass(g);n._toggleText(!1);n.element[0].focus()},_focusout:function(){var n=this;clearTimeout(n._focusing);n._inputWrapper.removeClass(g).removeClass(nt);n._blur()},_format:function(n,t){var i=this._culture(t).numberFormat;return n=n.toLowerCase(),n.indexOf("c")>-1?i=i.currency:n.indexOf("p")>-1&&(i=i.percent),i},_input:function(){var r=this,u="k-formatted-value",t=r.element.addClass(ct).show()[0],e=t.accessKey,o=r.wrapper,i;i=o.find(f+u);i[0]||(i=n('<input type="text"/>').insertBefore(t).addClass(u));try{t.setAttribute("type","text")}catch(s){t.type="text"}i[0].tabIndex=t.tabIndex;i[0].style.cssText=t.style.cssText;i[0].title=t.title;i.prop("placeholder",r.options.placeholder);e&&(i.attr("accesskey",e),t.accessKey="");r._text=i.addClass(t.className)},_keydown:function(n){var t=this,i=n.keyCode;t._key=i;i==e.DOWN?t._step(-1):i==e.UP?t._step(1):i==e.ENTER?t._change(t.element.val()):t._typing=!0},_keypress:function(n){if(n.which!==0&&!n.metaKey&&!n.ctrlKey&&n.keyCode!==e.BACKSPACE&&n.keyCode!==e.ENTER){var t=this,h=t.options.min,r=t.element,c=s(r),l=c[0],y=c[1],u=String.fromCharCode(n.which),a=t._format(t.options.format),v=t._key===e.NUMPAD_DOT,i=r.val(),o;v&&(u=a[f]);i=i.substring(0,l)+u+i.substring(y);o=t._numericRegex(a).test(i);o&&v?(r.val(i),s(r,l+u.length),n.preventDefault()):(h!==null&&h>=0&&i.charAt(0)==="-"||!o)&&n.preventDefault();t._key=0}},_numericRegex:function(n){var r=this,t=n[f],u=r.options.decimals;return(t===f&&(t="\\"+t),u===i&&(u=n.decimals),u===0)?vt:(r._separator!==t&&(r._separator=t,r._floatRegExp=new RegExp("^(-)?(((\\d+("+t+"\\d*)?)|("+t+"\\d*)))?$")),r._floatRegExp)},_paste:function(n){var t=this,r=n.target,u=r.value;setTimeout(function(){t._parse(r.value)===i&&t._update(u)})},_option:function(n,i){var r=this,u=r.options;if(i===t)return u[n];(i=r._parse(i),i||n!=="step")&&(u[n]=i,r.element.attr("aria-value"+n,i).attr(n,i))},_spin:function(n,t){var i=this;t=t||500;clearTimeout(i._spinning);i._spinning=setTimeout(function(){i._spin(n,50)},t);i._step(n)},_step:function(n){var t=this,i=t.element,r=t._parse(i.val())||0;ft()!=i[0]&&t._focusin();r+=t.options.step*n;t._update(t._adjust(r));t._typing=!1;t.trigger(k)},_toggleHover:function(t){n(t.currentTarget).toggleClass(nt,t.type==="mouseenter")},_toggleText:function(n){var t=this;t._text.toggle(n);t.element.toggle(!n)},_parse:function(n,t){return ot(n,this._culture(t),this.options.format)},_update:function(n){var t=this,s=t.options,h=s.format,u=s.decimals,e=t._culture(),c=t._format(h,e),o;u===i&&(u=c.decimals);n=t._parse(n,e);o=n!==i;o&&(n=parseFloat(p(n,u)));t._value=n=t._adjust(n);t._placeholder(r.toString(n,h,e));o?(n=n.toString(),n.indexOf("e")!==-1&&(n=p(+n,u)),n=n.replace(f,c[f])):n="";t.element.val(n).attr("aria-valuenow",n)},_placeholder:function(n){this._text.val(n);st||n||this._text.val(this.options.placeholder)},_wrapper:function(){var i=this,r=i.element,u=r[0],t;t=r.parents(".k-numerictextbox");t.is("span.k-numerictextbox")||(t=r.hide().wrap('<span class="k-numeric-wrap k-state-default" />').parent(),t=t.wrap("<span/>").parent());t[0].style.cssText=u.style.cssText;u.style.width="";i.wrapper=t.addClass("k-widget k-numerictextbox").addClass(u.className).css("display","");i._inputWrapper=n(t[0].firstChild)},_reset:function(){var t=this,i=t.element,r=i.attr("form"),u=r?n("#"+r):i.closest("form");u[0]&&(t._resetHandler=function(){setTimeout(function(){t.value(i[0].value);t.max(t._initialOptions.max);t.min(t._initialOptions.min)})},t._form=u.on("reset",t._resetHandler))}});y.plugin(pt)})(window.kendo.jQuery)}(),function(){(function(n,t){function b(t,i){t.filters&&(t.filters=n.grep(t.filters,function(n){return b(n,i),n.filters?n.filters.length:n.field!=i}))}function k(n){var i,u,t,f,e,r;if(n&&n.length)for(r=[],i=0,u=n.length;i<u;i++)t=n[i],e=t.text||t.value||t,f=t.value==null?t.text||t:t.value,r[i]={text:e,value:f};return r}function st(t,i){return n.grep(t,function(t){return t.filters?(t.filters=n.grep(t.filters,function(n){return n.field!=i}),t.filters.length):t.field!=i})}function d(t,i){t.filters&&(t.filters=n.grep(t.filters,function(n){return d(n,i),n.filters?n.filters.length:n.field==i&&n.operator=="eq"}))}function g(i){return i.logic=="and"&&i.filters.length>1?[]:i.filters?n.map(i.filters,function(n){return g(n)}):i.value!==null&&i.value!==t?[i.value]:[]}function p(n,r){for(var h=i.getter(r,!0),e=[],o=0,s={},f,u;o<n.length;)f=n[o++],u=h(f),u===t||u===null||s.hasOwnProperty(u)||(e.push(f),s[u]=!0);return e}function ht(n,t){return function(i){var r=n(i);return p(r,t)}}var i=window.kendo,c=i.ui,r=n.proxy,s="kendoPopup",l="init",w="refresh",u="change",f=".kendoFilterMenu",a="Is equal to",v="Is not equal to",tt={number:"numerictextbox",date:"datepicker"},it={string:"text",number:"number",date:"date"},rt=i.isFunction,h=c.Widget,ut='<div><div class="k-filter-help-text">#=messages.info#<\/div><label><input type="radio" data-#=ns#bind="checked: filters[0].value" value="true" name="filters[0].value"/>#=messages.isTrue#<\/label><label><input type="radio" data-#=ns#bind="checked: filters[0].value" value="false" name="filters[0].value"/>#=messages.isFalse#<\/label><div><button type="submit" class="k-button k-primary">#=messages.filter#<\/button><button type="reset" class="k-button">#=messages.clear#<\/button><\/div><\/div>',ft='<div><div class="k-filter-help-text">#=messages.info#<\/div><select data-#=ns#bind="value: filters[0].operator" data-#=ns#role="dropdownlist">#for(var op in operators){#<option value="#=op#">#=operators[op]#<\/option>#}#<\/select>#if(values){#<select data-#=ns#bind="value:filters[0].value" data-#=ns#text-field="text" data-#=ns#value-field="value" data-#=ns#source=\'#=kendo.stringify(values).replace(/\'/g,"&\\#39;")#\' data-#=ns#role="dropdownlist" data-#=ns#option-label="#=messages.selectValue#" data-#=ns#value-primitive="true"><\/select>#}else{#<input data-#=ns#bind="value:filters[0].value" class="k-textbox" type="text" #=role ? "data-" + ns + "role=\'" + role + "\'" : ""# />#}##if(extra){#<select class="k-filter-and" data-#=ns#bind="value: logic" data-#=ns#role="dropdownlist"><option value="and">#=messages.and#<\/option><option value="or">#=messages.or#<\/option><\/select><select data-#=ns#bind="value: filters[1].operator" data-#=ns#role="dropdownlist">#for(var op in operators){#<option value="#=op#">#=operators[op]#<\/option>#}#<\/select>#if(values){#<select data-#=ns#bind="value:filters[1].value" data-#=ns#text-field="text" data-#=ns#value-field="value" data-#=ns#source=\'#=kendo.stringify(values).replace(/\'/g,"&\\#39;")#\' data-#=ns#role="dropdownlist" data-#=ns#option-label="#=messages.selectValue#" data-#=ns#value-primitive="true"><\/select>#}else{#<input data-#=ns#bind="value: filters[1].value" class="k-textbox" type="text" #=role ? "data-" + ns + "role=\'" + role + "\'" : ""#/>#}##}#<div><button type="submit" class="k-button k-primary">#=messages.filter#<\/button><button type="reset" class="k-button">#=messages.clear#<\/button><\/div><\/div>',et='<div data-#=ns#role="view" data-#=ns#init-widgets="false" class="k-grid-filter-menu"><div data-#=ns#role="header" class="k-header"><button class="k-button k-cancel">#=messages.cancel#<\/button>#=title#<button type="submit" class="k-button k-submit">#=messages.filter#<\/button><\/div><form class="k-filter-menu k-mobile-list"><ul class="k-filter-help-text"><li><span class="k-link">#=messages.info#<\/span><ul><li class="k-item"><label class="k-label">#=messages.operator#<select data-#=ns#bind="value: filters[0].operator">#for(var op in operators){#<option value="#=op#">#=operators[op]#<\/option>#}#<\/select><\/label><\/li><li class="k-item"><label class="k-label">#=messages.value##if(values){#<select data-#=ns#bind="value:filters[0].value"><option value="">#=messages.selectValue#<\/option>#for(var val in values){#<option value="#=values[val].value#">#=values[val].text#<\/option>#}#<\/select>#}else{#<input data-#=ns#bind="value:filters[0].value" class="k-textbox" type="#=inputType#" #=useRole ? "data-" + ns + "role=\'" + role + "\'" : ""# />#}#<\/label><\/li>#if(extra){#<\/ul><ul class="k-filter-help-text"><li><span class="k-link"><\/span><li class="k-item"><label class="k-label"><input type="radio" name="logic" class="k-check" data-#=ns#bind="checked: logic" value="and" />#=messages.and#<\/label><\/li><li class="k-item"><label class="k-label"><input type="radio" name="logic" class="k-check" data-#=ns#bind="checked: logic" value="or" />#=messages.or#<\/label><\/li><\/ul><ul class="k-filter-help-text"><li><span class="k-link"><\/span><li class="k-item"><label class="k-label">#=messages.operator#<select data-#=ns#bind="value: filters[1].operator">#for(var op in operators){#<option value="#=op#">#=operators[op]#<\/option>#}#<\/select><\/label><\/li><li class="k-item"><label class="k-label">#=messages.value##if(values){#<select data-#=ns#bind="value:filters[1].value"><option value="">#=messages.selectValue#<\/option>#for(var val in values){#<option value="#=values[val].value#">#=values[val].text#<\/option>#}#<\/select>#}else{#<input data-#=ns#bind="value:filters[1].value" class="k-textbox" type="#=inputType#" #=useRole ? "data-" + ns + "role=\'" + role + "\'" : ""# />#}#<\/label><\/li>#}#<\/ul><\/li><li class="k-button-container"><button type="reset" class="k-button">#=messages.clear#<\/button><\/li><\/ul><\/div><\/form><\/div>',ot='<div data-#=ns#role="view" data-#=ns#init-widgets="false" class="k-grid-filter-menu"><div data-#=ns#role="header" class="k-header"><button class="k-button k-cancel">#=messages.cancel#<\/button>#=title#<button type="submit" class="k-button k-submit">#=messages.filter#<\/button><\/div><form class="k-filter-menu k-mobile-list"><ul class="k-filter-help-text"><li><span class="k-link">#=messages.info#<\/span><ul><li class="k-item"><label class="k-label"><input class="k-check" type="radio" data-#=ns#bind="checked: filters[0].value" value="true" name="filters[0].value"/>#=messages.isTrue#<\/label><\/li><li class="k-item"><label class="k-label"><input class="k-check" type="radio" data-#=ns#bind="checked: filters[0].value" value="false" name="filters[0].value"/>#=messages.isFalse#<\/label><\/li><\/ul><\/li><li class="k-button-container"><button type="reset" class="k-button">#=messages.clear#<\/button><\/li><\/ul><\/form><\/div>',o=h.extend({init:function(t,e){var o=this,c="string",a,v,l,s;if(h.fn.init.call(o,t,e),a=o.operators=e.operators||{},t=o.element,e=o.options,!e.appendToElement){l=t.addClass("k-with-icon k-filterable").find(".k-grid-filter");l[0]||(l=t.prepend('<a class="k-grid-filter" href="#"><span class="k-icon k-filter"/><\/a>').find(".k-grid-filter"));l.attr("tabindex",-1).on("click"+f,r(o._click,o))}o.link=l||n();o.dataSource=y.create(e.dataSource);o.field=e.field||t.attr(i.attr("field"));o.model=o.dataSource.reader.model;o._parse=function(n){return n+""};o.model&&o.model.fields&&(s=o.model.fields[o.field],s&&(c=s.type||"string",s.parse&&(o._parse=r(s.parse,s))));e.values&&(c="enums");o.type=c;a=a[c]||e.operators[c];for(v in a)break;o._defaultFilter=function(){return{field:o.field,operator:v||"eq",value:""}};o._refreshHandler=r(o.refresh,o);o.dataSource.bind(u,o._refreshHandler);e.appendToElement?o._init():o.refresh()},_init:function(){var t=this,u=t.options.ui,o=rt(u),e;t.pane=t.options.pane;t.pane&&(t._isMobile=!0);o||(e=u||tt[t.type]);t._isMobile?t._createMobileForm(e):t._createForm(e);t.form.on("submit"+f,r(t._submit,t)).on("reset"+f,r(t._reset,t));o&&t.form.find(".k-textbox").removeClass("k-textbox").each(function(){u(n(this))});t.form.find("["+i.attr("role")+"=numerictextbox]").removeClass("k-textbox").end().find("["+i.attr("role")+"=datetimepicker]").removeClass("k-textbox").end().find("["+i.attr("role")+"=timepicker]").removeClass("k-textbox").end().find("["+i.attr("role")+"=datepicker]").removeClass("k-textbox");t.refresh();t.trigger(l,{field:t.field,container:t.form});i.cycleForm(t.form)},_createForm:function(t){var u=this,e=u.options,h=u.operators||{},o=u.type;h=h[o]||e.operators[o];u.form=n('<form class="k-filter-menu"/>').html(i.template(o==="boolean"?ut:ft)({field:u.field,format:e.format,ns:i.ns,messages:e.messages,extra:e.extra,operators:h,type:o,role:t,values:k(e.values)}));e.appendToElement?(u.element.append(u.form),u.popup=u.element.closest(".k-popup").data(s)):u.popup=u.form[s]({anchor:u.link,open:r(u._open,u),activate:r(u._activate,u),close:function(){u.options.closeCallback&&u.options.closeCallback(u.element)}}).data(s);u.form.on("keydown"+f,r(u._keydown,u))},_createMobileForm:function(t){var r=this,f=r.options,e=r.operators||{},u=r.type;e=e[u]||f.operators[u];r.form=n("<div />").html(i.template(u==="boolean"?ot:et)({field:r.field,title:f.title||r.field,format:f.format,ns:i.ns,messages:f.messages,extra:f.extra,operators:e,type:u,role:t,useRole:!i.support.input.date&&u==="date"||u==="number",inputType:it[u],values:k(f.values)}));r.view=r.pane.append(r.form.html());r.form=r.view.element.find("form");r.view.element.on("click",".k-submit",function(n){r.form.submit();n.preventDefault()}).on("click",".k-cancel",function(n){r._closeForm();n.preventDefault()})},refresh:function(){var n=this,t=n.dataSource.filter()||{filters:[],logic:"and"};n.filterModel=i.observable({logic:"and",filters:[n._defaultFilter(),n._defaultFilter()]});n.form&&i.bind(n.form.children().first(),n.filterModel);n._bind(t)?n.link.addClass("k-state-active"):n.link.removeClass("k-state-active")},destroy:function(){var n=this;h.fn.destroy.call(n);n.form&&(i.unbind(n.form),i.destroy(n.form),n.form.unbind(f),n.popup&&(n.popup.destroy(),n.popup=null),n.form=null);n.view&&(n.view.purge(),n.view=null);n.link.unbind(f);n._refreshHandler&&(n.dataSource.unbind(u,n._refreshHandler),n.dataSource=null);n.element=n.link=n._refreshHandler=n.filterModel=null},_bind:function(n){for(var i=this,s=n.filters,f=!1,o=0,e=i.filterModel,r,t,u=0,h=s.length;u<h;u++)t=s[u],t.field==i.field?(e.set("logic",n.logic),r=e.filters[o],r||(e.filters.push({field:i.field}),r=e.filters[o]),r.set("value",i._parse(t.value)),r.set("operator",t.operator),o++,f=!0):t.filters&&(f=f||i._bind(t));return f},_stripFilters:function(t){return n.grep(t,function(n){return n.value!==""&&n.value!=null})},_merge:function(n){var u=this,o=n.logic||"and",i=this._stripFilters(n.filters),f,t=u.dataSource.filter()||{filters:[],logic:"and"},r,e;for(b(t,u.field),r=0,e=i.length;r<e;r++)f=i[r],f.value=u._parse(f.value);return i.length&&(t.filters.length?(n.filters=i,t.logic!=="and"&&(t.filters=[{logic:t.logic,filters:t.filters}],t.logic="and"),i.length>1?t.filters.push(n):t.filters.push(i[0])):(t.filters=i,t.logic=o)),t},filter:function(n){n=this._merge(n);n.filters.length&&this.dataSource.filter(n)},clear:function(){var i=this,t=i.dataSource.filter()||{filters:[]};t.filters=n.grep(t.filters,function(n){return n.filters?(n.filters=st(n.filters,i.field),n.filters.length):n.field!=i.field});t.filters.length||(t=null);i.dataSource.filter(t)},_submit:function(n){n.preventDefault();n.stopPropagation();this.filter(this.filterModel.toJSON());this._closeForm()},_reset:function(){this.clear();this._closeForm()},_closeForm:function(){this._isMobile?this.pane.navigate("",this.options.animations.right):this.popup.close()},_click:function(n){n.preventDefault();n.stopPropagation();this.popup||this.pane||this._init();this._isMobile?this.pane.navigate(this.view,this.options.animations.left):this.popup.toggle()},_open:function(){var t;n(".k-filter-menu").not(this.form).each(function(){t=n(this).data(s);t&&t.close()})},_activate:function(){this.form.find(":kendoFocusable:first").focus()},_keydown:function(n){n.keyCode==i.keys.ESC&&this.popup.close()},events:[l],options:{name:"FilterMenu",extra:!0,appendToElement:!1,type:"string",operators:{string:{eq:a,neq:v,startswith:"Starts with",contains:"Contains",doesnotcontain:"Does not contain",endswith:"Ends with"},number:{eq:a,neq:v,gte:"Is greater than or equal to",gt:"Is greater than",lte:"Is less than or equal to",lt:"Is less than"},date:{eq:a,neq:v,gte:"Is after or equal to",gt:"Is after",lte:"Is before or equal to",lt:"Is before"},enums:{eq:a,neq:v}},messages:{info:"Show items with value that:",isTrue:"is true",isFalse:"is false",filter:"Filter",clear:"Clear",and:"And",or:"Or",selectValue:"-Select value-",operator:"Operator",value:"Value",cancel:"Cancel"},animations:{left:"slide",right:"slide:right"}}}),e=".kendoFilterMultiCheck",y=i.data.DataSource,nt=h.extend({init:function(t,f){h.fn.init.call(this,t,f);f=this.options;this.element=n(t);var e=this.field=this.options.field||this.element.attr(i.attr("field")),o=f.checkSource;this._foreignKeyValues()?(this.checkSource=y.create(f.values),this.checkSource.fetch()):f.forceUnique?(o=f.dataSource.options,delete o.pageSize,this.checkSource=y.create(o),this.checkSource.reader.data=ht(this.checkSource.reader.data,this.field)):this.checkSource=y.create(o);this.dataSource=f.dataSource;this.model=this.dataSource.reader.model;this._parse=function(n){return n+""};this.model&&this.model.fields&&(e=this.model.fields[this.field],e&&(e.parse&&(this._parse=r(e.parse,e)),this.type=e.type||"string"));f.appendToElement?this._init():this._createLink();this._refreshHandler=r(this.refresh,this);this.dataSource.bind(u,this._refreshHandler)},_createLink:function(){var t=this.element,n=t.addClass("k-with-icon k-filterable").find(".k-grid-filter");n[0]||(n=t.prepend('<a class="k-grid-filter" href="#"><span class="k-icon k-filter"/><\/a>').find(".k-grid-filter"));this._link=n.attr("tabindex",-1).on("click"+f,r(this._click,this))},_init:function(){var n=this,t=this.options.forceUnique,i=this.options;this.pane=i.pane;this.pane&&(this._isMobile=!0);this._createForm();this._foreignKeyValues()?this.refresh():t&&!this.checkSource.options.serverPaging&&this.dataSource.data().length?(this.checkSource.data(p(this.dataSource.data(),this.field)),this.refresh()):(this._attachProgress(),this.checkSource.fetch(function(){n.refresh.call(n)}));this.options.forceUnique||(this.checkChangeHandler=function(){n.container.empty();n.refresh()},this.checkSource.bind(u,this.checkChangeHandler));this.form.on("keydown"+e,r(this._keydown,this)).on("submit"+e,r(this._filter,this)).on("reset"+e,r(this._reset,this));this.trigger(l,{field:this.field,container:this.form})},_attachProgress:function(){var n=this;this._progressHandler=function(){c.progress(n.container,!0)};this._progressHideHandler=function(){c.progress(n.container,!1)};this.checkSource.bind("progress",this._progressHandler).bind("change",this._progressHideHandler)},_createForm:function(){var i=this.options,u="<ul class='k-reset k-multicheck-wrap'><\/ul><button type='submit' class='k-button k-primary'>"+i.messages.filter+"<\/button>",t,r;if(u+="<button type='reset' class='k-button'>"+i.messages.clear+"<\/button>",this.form=n('<form class="k-filter-menu"/>').html(u),this.container=this.form.find(".k-multicheck-wrap"),this._isMobile){this.view=this.pane.append(this.form.addClass("k-mobile-list").wrap("<div/>").parent().html());t=this.view.element;this.form=t.find("form");this.container=t.find(".k-multicheck-wrap");r=this;t.on("click",".k-primary",function(n){r.form.submit();n.preventDefault()}).on("click","[type=reset]",function(n){r._reset();n.preventDefault()})}else i.appendToElement?(this.popup=this.element.closest(".k-popup").data(s),this.element.append(this.form)):this.popup=this.form.kendoPopup({anchor:this._link}).data(s)},createCheckAllItem:function(){var t=this.options,o=i.template(t.itemTemplate({field:"all",mobile:this._isMobile})),f=n(o({all:t.messages.checkAll}));this.container.prepend(f);this.checkBoxAll=f.find(":checkbox").eq(0).addClass("k-check-all");this.checkAllHandler=r(this.checkAll,this);this.checkBoxAll.on(u+e,this.checkAllHandler)},updateCheckAllState:function(){if(this.checkBoxAll){var n=this.container.find(":checkbox:not(.k-check-all)").length==this.container.find(":checked:not(.k-check-all)").length;this.checkBoxAll.prop("checked",n)}},refresh:function(n){var r=this.options.forceUnique,t=this.dataSource,i=this.getFilterArray();this._link&&this._link.toggleClass("k-state-active",i.length!==0);this.form&&(n&&r&&n.sender===t&&!t.options.serverPaging&&(n.action=="itemchange"||n.action=="add"||n.action=="remove"||t.options.autoSync&&n.action==="sync")&&!this._foreignKeyValues()&&(this.checkSource.data(p(this.dataSource.data(),this.field)),this.container.empty()),this.container.is(":empty")&&this.createCheckBoxes(),this.checkValues(i),this.trigger(w))},getFilterArray:function(){var t=n.extend(!0,{},{filters:[],logic:"and"},this.dataSource.filter());return d(t,this.field),g(t)},createCheckBoxes:function(){var t=this.options,n,f={field:this.field,format:t.format,mobile:this._isMobile,type:this.type},o,s;if(this.options.forceUnique?this._foreignKeyValues()?(n=this.checkSource.data(),f.valueField="value",f.field="text"):n=this.checkSource.data():n=this.checkSource.view(),o=i.template(t.itemTemplate(f)),s=i.render(o,n),t.checkAll){this.createCheckAllItem();this.container.on(u+e,":checkbox",r(this.updateCheckAllState,this))}this.container.append(s)},checkAll:function(){var n=this.checkBoxAll.is(":checked");this.container.find(":checkbox").prop("checked",n)},checkValues:function(t){var i=this;n(n.grep(this.container.find(":checkbox").prop("checked",!1),function(r){var f=!1,e,u;if(!n(r).is(".k-check-all"))for(e=i._parse(n(r).val()),u=0;u<t.length;u++)if(f=i.type=="date"?t[u].getTime()==e.getTime():t[u]==e,f)return f})).prop("checked",!0);this.updateCheckAllState()},_filter:function(t){t.preventDefault();t.stopPropagation();var i={logic:"or"},r=this;i.filters=n.map(this.form.find(":checkbox:checked:not(.k-check-all)"),function(t){return{value:n(t).val(),operator:"eq",field:r.field}});i=this._merge(i);i.filters.length&&this.dataSource.filter(i);this._closeForm()},_stripFilters:function(t){return n.grep(t,function(n){return n.value!=null})},_foreignKeyValues:function(){var n=this.options;return n.values&&!n.checkSource},destroy:function(){var n=this;h.fn.destroy.call(n);n.form&&(i.unbind(n.form),i.destroy(n.form),n.form.unbind(e),n.popup&&(n.popup.destroy(),n.popup=null),n.form=null,n.container&&(n.container.unbind(e),n.container=null),n.checkBoxAll&&n.checkBoxAll.unbind(e));n.view&&(n.view.purge(),n.view=null);n._link&&n._link.unbind(f);n._refreshHandler&&(n.dataSource.unbind(u,n._refreshHandler),n.dataSource=null);n.checkChangeHandler&&n.checkSource.unbind(u,n.checkChangeHandler);n._progressHandler&&n.checkSource.unbind("progress",n._progressHandler);n._progressHideHandler&&n.checkSource.unbind("change",n._progressHideHandler);n.element=n.checkSource=n.container=n.checkBoxAll=n._link=n._refreshHandler=n.checkAllHandler=null},options:{name:"FilterMultiCheck",itemTemplate:function(n){var r=n.field,u=n.format,i=n.valueField,e=n.mobile,f="";return i===t&&(i=r),n.type=="date"&&(f=":yyyy-MM-ddTHH:mm:sszzz"),"<li class='k-item'><label class='k-label'><input type='checkbox' class='"+(e?"k-check":"")+"'  value='#:kendo.format('{0"+f+"}',"+i+")#'/>#:kendo.format('"+(u?u:"{0}")+"', "+r+")#<\/label><\/li>"},checkAll:!0,appendToElement:!1,messages:{checkAll:"Select All",clear:"Clear",filter:"Filter"},forceUnique:!0,animations:{left:"slide",right:"slide:right"}},events:[l,w]});n.extend(nt.fn,{_click:o.fn._click,_keydown:o.fn._keydown,_reset:o.fn._reset,_closeForm:o.fn._closeForm,clear:o.fn.clear,_merge:o.fn._merge});c.plugin(o);c.plugin(nt)})(window.kendo.jQuery)}(),function(){(function(n,t){function gi(n,t){return n=n.split(" ")[!t+0]||n,n.replace("top","up").replace("bottom","down")}function nr(n,t,r){n=n.split(" ")[!t+0]||n;var u={origin:["bottom",r?"right":"left"],position:["top",r?"right":"left"]},f=/left|right/.test(n);return f?(u.origin=["top",n],u.position[1]=i.directions[n].reverse):(u.origin[0]=n,u.position[0]=i.directions[n].reverse),u.origin=u.origin.join(" "),u.position=u.position.join(" "),u}function o(t,i){try{return n.contains(t,i)}catch(r){return!1}}function li(t){t=n(t);t.addClass("k-item").children(gt).addClass(ii);t.children("a").addClass(rt).children(gt).addClass(ii);t.filter(":not([disabled])").addClass(fi);t.filter(".k-separator:empty").append("&nbsp;");t.filter("li[disabled]").addClass(g).removeAttr("disabled").attr("aria-disabled",!0);t.filter("[role]").length||t.attr("role","menuitem");t.children("."+rt).length||t.contents().filter(function(){return!this.nodeName.match(yi)&&!(this.nodeType==3&&!n.trim(this.nodeValue))}).wrapAll("<span class='"+rt+"'/>");tt(t);y(t)}function tt(t){t=n(t);t.find("> .k-link > [class*=k-i-arrow]:not(.k-sprite)").remove();t.filter(":has(.k-menu-group)").children(".k-link:not(:has([class*=k-i-arrow]:not(.k-sprite)))").each(function(){var t=n(this),i=t.parent().parent();t.append("<span class='k-icon "+(i.hasClass(v+"-horizontal")?"k-i-arrow-s":"k-i-arrow-e")+"'/>")})}function y(t){t=n(t);t.filter(".k-first:not(:first-child)").removeClass(ti);t.filter(".k-last:not(:last-child)").removeClass(ni);t.filter(":first-child").addClass(ti);t.filter(":last-child").addClass(ni)}var i=window.kendo,ct=i.ui,vi=i._activeElement,ft=i.support.touch&&i.support.mobileOS,lt="mousedown",at="click",e=n.extend,u=n.proxy,vt=n.each,h=i.template,s=i.keys,et=ct.Widget,yi=/^(ul|a|div)$/i,r=".kendoMenu",gt="img",it="open",v="k-menu",rt="k-link",ni="k-last",p="close",ot="timer",ti="k-first",ii="k-image",w="select",b="zIndex",yt="activate",pt="deactivate",ri="touchstart"+r+" MSPointerDown"+r+" pointerdown"+r,k=i.support.pointers,d=i.support.msPointers,pi=d||k,wt=k?"pointerover":d?"MSPointerOver":"mouseenter",ui=k?"pointerout":d?"MSPointerOut":"mouseleave",wi=ft||pi,st=n(document.documentElement),ht="kendoPopup",fi="k-state-default",bt="k-state-hover",c="k-state-focused",g="k-state-disabled",ei=".k-menu",kt=".k-menu-group",oi=kt+",.k-animation-container",l=":not(.k-list) > .k-item",bi=".k-item.k-state-disabled",ut=".k-item:not(.k-state-disabled)",ki=".k-item:not(.k-state-disabled) > .k-link",si=":not(.k-item.k-separator)",nt=si+":eq(0)",hi=si+":last",di="> div:not(.k-animation-container,.k-list-container)",ci={"2":1,touch:1},a={content:h("<div class='k-content #= groupCssClass() #' tabindex='-1'>#= content(item) #<\/div>"),group:h("<ul class='#= groupCssClass(group) #'#= groupAttributes(group) # role='menu' aria-hidden='true'>#= renderItems(data) #<\/ul>"),itemWrapper:h("<#= tag(item) # class='#= textClass(item) #'#= textAttributes(item) #>#= image(item) ##= sprite(item) ##= text(item) ##= arrow(data) #<\/#= tag(item) #>"),item:h("<li class='#= wrapperCssClass(group, item) #' role='menuitem' #=item.items ? \"aria-haspopup='true'\": \"\"##=item.enabled === false ? \"aria-disabled='true'\" : ''#>#= itemWrapper(data) ## if (item.items) { ##= subGroup({ items: item.items, menu: menu, group: { expanded: item.expanded } }) ## } else if (item.content || item.contentUrl) { ##= renderContent(data) ## } #<\/li>"),image:h("<img class='k-image' alt='' src='#= imageUrl #' />"),arrow:h("<span class='#= arrowClass(item, group) #'><\/span>"),sprite:h("<span class='k-sprite #= spriteCssClass #'><\/span>"),empty:h("")},dt={wrapperCssClass:function(n,t){var i="k-item",r=t.index;return i+=t.enabled===!1?" k-state-disabled":" k-state-default",n.firstLevel&&r===0&&(i+=" k-first"),r==n.length-1&&(i+=" k-last"),t.cssClass&&(i+=" "+t.cssClass),i},textClass:function(){return rt},textAttributes:function(n){return n.url?" href='"+n.url+"'":""},arrowClass:function(n,t){return"k-icon"+(t.horizontal?" k-i-arrow-s":" k-i-arrow-e")},text:function(n){return n.encoded===!1?n.text:i.htmlEncode(n.text)},tag:function(n){return n.url?"a":"span"},groupAttributes:function(n){return n.expanded!==!0?" style='display:none'":""},groupCssClass:function(){return"k-group k-menu-group"},content:function(n){return n.content?n.content:"&nbsp;"}},f=et.extend({init:function(t,f){var e=this;et.fn.init.call(e,t,f);t=e.wrapper=e.element;f=e.options;e._initData(f);e._updateClasses();e._animations(f);e.nextItemZIndex=100;e._tabindex();e._focusProxy=u(e._focusHandler,e);t.on(ri,ut,e._focusProxy).on(at+r,bi,!1).on(at+r,ut,u(e._click,e)).on("keydown"+r,u(e._keydown,e)).on("focus"+r,u(e._focus,e)).on("focus"+r,".k-content",u(e._focus,e)).on(ri+" "+lt+r,".k-content",u(e._preventClose,e)).on("blur"+r,u(e._removeHoverItem,e)).on("blur"+r,"[tabindex]",u(e._checkActiveElement,e)).on(wt+r,ut,u(e._mouseenter,e)).on(ui+r,ut,u(e._mouseleave,e)).on(wt+r+" "+ui+r+" "+lt+r+" "+at+r,ki,u(e._toggleHover,e));f.openOnClick&&(e.clicked=!1,e._documentClickHandler=u(e._documentClick,e),n(document).click(e._documentClickHandler));t.attr("role","menubar");t[0].id&&(e._ariaId=i.format("{0}_mn_active",t[0].id));i.notify(e)},events:[it,p,yt,pt,w],options:{name:"Menu",animation:{open:{duration:200},close:{duration:100}},orientation:"horizontal",direction:"default",openOnClick:!1,closeOnClick:!0,hoverDelay:100,popupCollision:t},_initData:function(n){var t=this;n.dataSource&&(t.angular("cleanup",function(){return{elements:t.element.children()}}),t.element.empty(),t.append(n.dataSource,t.element),t.angular("compile",function(){return{elements:t.element.children()}}))},setOptions:function(n){var t=this.options.animation;this._animations(n);n.animation=e(!0,t,n.animation);"dataSource"in n&&this._initData(n);this._updateClasses();et.fn.setOptions.call(this,n)},destroy:function(){var t=this;et.fn.destroy.call(t);t.element.off(r);t._documentClickHandler&&n(document).unbind("click",t._documentClickHandler);i.destroy(t.element)},enable:function(n,t){return this._toggleDisabled(n,t!==!1),this},disable:function(n){return this._toggleDisabled(n,!1),this},append:function(n,t){t=this.element.find(t);var i=this._insert(n,t,t.length?t.find("> .k-menu-group, > .k-animation-container > .k-menu-group"):null);return vt(i.items,function(){i.group.append(this);tt(this)}),tt(t),y(i.group.find(".k-first, .k-last").add(i.items)),this},insertBefore:function(n,t){t=this.element.find(t);var i=this._insert(n,t,t.parent());return vt(i.items,function(){t.before(this);tt(this);y(this)}),y(t),this},insertAfter:function(n,t){t=this.element.find(t);var i=this._insert(n,t,t.parent());return vt(i.items,function(){t.after(this);tt(this);y(this)}),y(t),this},_insert:function(t,i,r){var h=this,u,c,o,s;return i&&i.length||(r=h.element),o=n.isPlainObject(t),s={firstLevel:r.hasClass(v),horizontal:r.hasClass(v+"-horizontal"),expanded:!0,length:r.children().length},i&&!r.length&&(r=n(f.renderGroup({group:s})).appendTo(i)),o||n.isArray(t)?u=n(n.map(o?[t]:t,function(t,i){return typeof t=="string"?n(t).get():n(f.renderItem({group:s,item:e(t,{index:i})})).get()})):(u=typeof t=="string"&&t.charAt(0)!="<"?h.element.find(t):n(t),c=u.find("> ul").addClass("k-menu-group").attr("role","menu"),u=u.filter("li"),u.add(c.find("> li")).each(function(){li(this)})),{items:u,group:r}},remove:function(n){var r;n=this.element.find(n);var u=this,t=n.parentsUntil(u.element,l),i=n.parent("ul:not(.k-menu)");return n.remove(),i&&!i.children(l).length&&(r=i.parent(".k-animation-container"),r.length?r.remove():i.remove()),t.length&&(t=t.eq(0),tt(t),y(t)),u},open:function(r){var u=this,f=u.options,s=f.orientation=="horizontal",o=f.direction,h=i.support.isRtl(u.wrapper);return r=u.element.find(r),/^(top|bottom|default)$/.test(o)&&(o=h?s?(o+" left").replace("default","bottom"):"left":s?(o+" right").replace("default","bottom"):"right"),r.siblings().find(">.k-popup:visible,>.k-animation-container>.k-popup:visible").each(function(){var t=n(this).data("kendoPopup");t&&t.close()}),r.each(function(){var r=n(this);clearTimeout(r.data(ot));r.data(ot,setTimeout(function(){var c=r.find(".k-menu-group:first:hidden"),l,k,y;if(c[0]&&u._triggerEvent({item:r[0],type:it})===!1){!c.find(".k-menu-group")[0]&&c.children(".k-item").length>1?(k=n(window).height(),y=function(){c.css({maxHeight:k-(c.outerHeight()-c.height())-i.getShadows(c).bottom,overflow:"auto"})},i.support.browser.msie&&i.support.browser.version<=7?setTimeout(y,0):y()):c.css({maxHeight:"",overflow:""});r.data(b,r.css(b));r.css(b,u.nextItemZIndex++);l=c.data(ht);var w=r.parent().hasClass(v),nt=w&&s,a=nr(o,w,h),d=f.animation.open.effects,g=d!==t?d:"slideIn:"+gi(o,w);l?(l=c.data(ht),l.options.origin=a.origin,l.options.position=a.position,l.options.animation.open.effects=g):l=c.kendoPopup({activate:function(){u._triggerEvent({item:this.wrapper.parent(),type:yt})},deactivate:function(n){n.sender.element.removeData("targetTransform").css({opacity:""});u._triggerEvent({item:this.wrapper.parent(),type:pt})},origin:a.origin,position:a.position,collision:f.popupCollision!==t?f.popupCollision:nt?"fit":"fit flip",anchor:r,appendTo:r,animation:{open:e(!0,{effects:g},f.animation.open),close:f.animation.close},close:function(n){var t=n.sender.wrapper.parent();u._triggerEvent({item:t[0],type:p})?n.preventDefault():(t.css(b,t.data(b)),t.removeData(b),ft&&(t.removeClass(bt),u._removeHoverItem()))}}).data(ht);c.removeAttr("aria-hidden");l.open()}},u.options.hoverDelay))}),u},close:function(t,i){var r=this,u=r.element;return t=u.find(t),t.length||(t=u.find(">.k-item")),t.each(function(){var t=n(this);!i&&r._isRootItem(t)&&(r.clicked=!1);clearTimeout(t.data(ot));t.data(ot,setTimeout(function(){var n=t.find(".k-menu-group:not(.k-list-container):not(.k-calendar-container):first:visible").data(ht);n&&(n.close(),n.element.attr("aria-hidden",!0))},r.options.hoverDelay))}),r},_toggleDisabled:function(t,i){this.element.find(t).each(function(){n(this).toggleClass(fi,i).toggleClass(g,!i).attr("aria-disabled",!i)})},_toggleHover:function(t){var r=n(i.eventTarget(t)||t.target).closest(l),u=t.type==wt||lt.indexOf(t.type)!==-1;r.parents("li."+g).length||r.toggleClass(bt,u||t.type=="mousedown"||t.type=="click");this._removeHoverItem()},_preventClose:function(){this.options.closeOnClick||(this._closurePrevented=!0)},_checkActiveElement:function(t){var u=this,f=n(t?t.currentTarget:this._hoverItem()),r=u._findRootParent(f)[0];this._closurePrevented||setTimeout(function(){document.hasFocus()&&(o(r,i._activeElement())||!t||o(r,t.currentTarget))||u.close(r)},0);this._closurePrevented=!1},_removeHoverItem:function(){var n=this._hoverItem();n&&n.hasClass(c)&&(n.removeClass(c),this._oldHoverItem=null)},_updateClasses:function(){var n=this.element,r=".k-menu-init div ul",t;n.removeClass("k-menu-horizontal k-menu-vertical");n.addClass("k-widget k-reset k-header k-menu-init "+v).addClass(v+"-"+this.options.orientation);n.find("li > ul").filter(function(){return!i.support.matchesSelector.call(this,r)}).addClass("k-group k-menu-group").attr("role","menu").attr("aria-hidden",n.is(":visible")).end().find("li > div").addClass("k-content").attr("tabindex","-1");t=n.find("> li,.k-menu-group > li");n.removeClass("k-menu-init");t.each(function(){li(this)})},_mouseenter:function(t){var i=this,r=n(t.currentTarget),f=r.children(".k-animation-container").length||r.children(kt).length;t.delegateTarget==r.parents(ei)[0]&&(i.options.openOnClick&&!i.clicked||ft||(k||d)&&t.originalEvent.pointerType in ci&&i._isRootItem(r.closest(l))||!o(t.currentTarget,t.relatedTarget)&&f&&i.open(r),(i.options.openOnClick&&i.clicked||wi)&&r.siblings().each(u(function(n,t){i.close(t,!0)},i)))},_mouseleave:function(t){var u=this,r=n(t.currentTarget),f=r.children(".k-animation-container").length||r.children(kt).length;if(r.parentsUntil(".k-animation-container",".k-list-container,.k-calendar-container")[0]){t.stopImmediatePropagation();return}u.options.openOnClick||ft||(k||d)&&t.originalEvent.pointerType in ci||o(t.currentTarget,t.relatedTarget||t.target)||!f||o(t.currentTarget,i._activeElement())||u.close(r)},_click:function(t){var r=this,c,e=r.options,f=n(i.eventTarget(t)),o=f[0]?f[0].nodeName.toUpperCase():"",y=o=="INPUT"||o=="SELECT"||o=="BUTTON"||o=="LABEL",a=f.closest("."+rt),u=f.closest(l),v=a.attr("href"),s,b,nt=f.attr("href"),tt=n("<a href='#' />").attr("href"),h=!!v&&v!==tt,ut=h&&!!v.match(/^#/),ft=!!nt&&nt!==tt,et=e.openOnClick&&b&&r._isRootItem(u);if(!f.closest(di,u[0]).length){if(u.hasClass(g)){t.preventDefault();return}if(t.handled||!r._triggerEvent({item:u[0],type:w})||y||t.preventDefault(),t.handled=!0,s=u.children(oi),b=s.is(":visible"),e.closeOnClick&&(!h||ut)&&(!s.length||et)){u.removeClass(bt).css("height");r._oldHoverItem=r._findRootParent(u);r.close(a.parentsUntil(r.element,l));r.clicked=!1;"MSPointerUp".indexOf(t.type)!=-1&&t.preventDefault();return}(h&&t.enterKey&&a[0].click(),r._isRootItem(u)&&e.openOnClick||i.support.touch||(k||d)&&r._isRootItem(u.closest(l)))&&(h||y||ft||t.preventDefault(),r.clicked=!0,c=s.is(":visible")?p:it,e.closeOnClick||c!=p)&&r[c](u)}},_documentClick:function(n){o(this.element[0],n.target)||(this.clicked=!1)},_focus:function(t){var i=this,r=t.target,u=i._hoverItem(),f=vi();if(r!=i.wrapper[0]&&!n(r).is(":kendoFocusable")){t.stopPropagation();n(r).closest(".k-content").closest(".k-menu-group").closest(".k-item").addClass(c);i.wrapper.focus();return}f===t.currentTarget&&(u.length?i._moveHover([],u):i._oldHoverItem||i._moveHover([],i.wrapper.children().first()))},_keydown:function(n){var t=this,f=n.keyCode,r=t._oldHoverItem,u,e,o,h=i.support.isRtl(t.wrapper);if(n.target==n.currentTarget||f==s.ESC){if(r||(r=t._oldHoverItem=t._hoverItem()),e=t._itemBelongsToVertival(r),o=t._itemHasChildren(r),f==s.RIGHT)u=t[h?"_itemLeft":"_itemRight"](r,e,o);else if(f==s.LEFT)u=t[h?"_itemRight":"_itemLeft"](r,e,o);else if(f==s.DOWN)u=t._itemDown(r,e,o);else if(f==s.UP)u=t._itemUp(r,e,o);else if(f==s.ESC)u=t._itemEsc(r,e);else if(f==s.ENTER||f==s.SPACEBAR)u=r.children(".k-link"),u.length>0&&(t._click({target:u[0],preventDefault:function(){},enterKey:!0}),t._moveHover(r,t._findRootParent(r)));else if(f==s.TAB){u=t._findRootParent(r);t._moveHover(r,u);t._checkActiveElement();return}u&&u[0]&&(n.preventDefault(),n.stopPropagation())}},_hoverItem:function(){return this.wrapper.find(".k-item.k-state-hover,.k-item.k-state-focused").filter(":visible")},_itemBelongsToVertival:function(n){var t=this.wrapper.hasClass("k-menu-vertical");return n.length?n.parent().hasClass("k-menu-group")||t:t},_itemHasChildren:function(n){return n.length?n.children("ul.k-menu-group, div.k-animation-container").length>0:!1},_moveHover:function(t,i){var u=this,r=u._ariaId;t.length&&i.length&&t.removeClass(c);i.length&&(i[0].id&&(r=i[0].id),i.addClass(c),u._oldHoverItem=i,r&&(u.element.removeAttr("aria-activedescendant"),n("#"+r).removeAttr("id"),i.attr("id",r),u.element.attr("aria-activedescendant",r)))},_findRootParent:function(n){return this._isRootItem(n)?n:n.parentsUntil(ei,"li.k-item").last()},_isRootItem:function(n){return n.parent().hasClass(v)},_itemRight:function(n,t,i){var u=this,r,f;if(!n.hasClass(g))return t?i?(u.open(n),r=n.find(".k-menu-group").children().first()):u.options.orientation=="horizontal"&&(f=u._findRootParent(n),u.close(f),r=f.nextAll(nt)):(r=n.nextAll(nt),r.length||(r=n.prevAll(hi))),r&&!r.length?r=u.wrapper.children(".k-item").first():r||(r=[]),u._moveHover(n,r),r},_itemLeft:function(n,t){var r=this,i;return t?(i=n.parent().closest(".k-item"),r.close(i),r._isRootItem(i)&&r.options.orientation=="horizontal"&&(i=i.prevAll(nt))):(i=n.prevAll(nt),i.length||(i=n.nextAll(hi))),i.length||(i=r.wrapper.children(".k-item").last()),r._moveHover(n,i),i},_itemDown:function(n,t,i){var u=this,r;if(t)r=n.nextAll(nt);else{if(!i||n.hasClass(g))return;u.open(n);r=n.find(".k-menu-group").children().first()}return!r.length&&n.length?r=n.parent().children().first():n.length||(r=u.wrapper.children(".k-item").first()),u._moveHover(n,r),r},_itemUp:function(n,t){var r=this,i;if(t)i=n.prevAll(nt);else return;return!i.length&&n.length?i=n.parent().children().last():n.length||(i=r.wrapper.children(".k-item").last()),r._moveHover(n,i),i},_itemEsc:function(n,t){var r=this,i;if(t)i=n.parent().closest(".k-item"),r.close(i),r._moveHover(n,i);else return n;return i},_triggerEvent:function(n){var t=this;return t.trigger(n.type,{type:n.type,item:n.item})},_focusHandler:function(t){var u=this,r=n(i.eventTarget(t)).closest(l);setTimeout(function(){u._moveHover([],r);r.children(".k-content")[0]&&r.parent().closest(".k-item").removeClass(c)},200)},_animations:function(n){n&&"animation"in n&&!n.animation&&(n.animation={open:{effects:{}},close:{hide:!0,effects:{}}})}}),ai;e(f,{renderItem:function(n){n=e({menu:{},group:{}},n);var i=a.empty,t=n.item;return a.item(e(n,{image:t.imageUrl?a.image:i,sprite:t.spriteCssClass?a.sprite:i,itemWrapper:a.itemWrapper,renderContent:f.renderContent,arrow:t.items||t.content?a.arrow:i,subGroup:f.renderGroup},dt))},renderGroup:function(n){return a.group(e({renderItems:function(n){for(var r="",t=0,i=n.items,u=i?i.length:0,o=e({length:u},n.group);t<u;t++)r+=f.renderItem(e(n,{group:o,item:e({index:t},i[t])}));return r}},n,dt))},renderContent:function(n){return a.content(e(n,dt))}});ai=f.extend({init:function(t,i){var r=this;f.fn.init.call(r,t,i);r.target=n(r.options.target);r._popup();r._wire()},options:{name:"ContextMenu",filter:null,showOn:"contextmenu",orientation:"vertical",alignToAnchor:!1,target:"body"},events:[it,p,yt,pt,w],setOptions:function(t){var i=this;f.fn.setOptions.call(i,t);i.target.off(i.showOn+r,i._showProxy);i.userEvents&&i.userEvents.destroy();i.target=n(i.options.target);t.orientation&&i.popup.wrapper[0]&&i.popup.element.unwrap();i._wire();f.fn.setOptions.call(this,t)},destroy:function(){var n=this;n.target.off(n.options.showOn+r);st.off(i.support.mousedown+r,n._closeProxy);n.userEvents&&n.userEvents.destroy();f.fn.destroy.call(n)},open:function(u,e){var s=this;if(u=n(u)[0],o(s.element[0],n(u)[0]))f.fn.open.call(s,u);else if(s._triggerEvent({item:s.element,type:it})===!1){s.popup.visible()&&s.options.filter&&(s.popup.close(!0),s.popup.element.kendoStop(!0));e!==t?(s.popup.wrapper.hide(),s.popup.open(u,e)):(s.popup.options.anchor=(u?u:s.popup.anchor)||s.target,s.popup.element.kendoStop(!0),s.popup.open());st.off(s.popup.downEvent,s.popup._mousedownProxy);st.on(i.support.mousedown+r,s._closeProxy)}return s},close:function(){var t=this;o(t.element[0],n(arguments[0])[0])?f.fn.close.call(t,arguments[0]):t.popup.visible()&&t._triggerEvent({item:t.element,type:p})===!1&&(t.popup.close(),st.off(i.support.mousedown+r,t._closeProxy),t.unbind(w,t._closeTimeoutProxy))},_showHandler:function(n){var t=n,f,r=this,u=r.options;(n.event&&(t=n.event,t.pageX=n.x.location,t.pageY=n.y.location),o(r.element[0],n.relatedTarget||n.target))||(r._eventOrigin=t,t.preventDefault(),t.stopImmediatePropagation(),r.element.find("."+c).removeClass(c),(u.filter&&i.support.matchesSelector.call(t.currentTarget,u.filter)||!u.filter)&&(u.alignToAnchor?(r.popup.options.anchor=t.currentTarget,r.open(t.currentTarget)):(r.popup.options.anchor=t.currentTarget,r._targetChild?(f=r.target.offset(),r.open(t.pageX-f.left,t.pageY-f.top)):r.open(t.pageX,t.pageY))))},_closeHandler:function(t){var i=this,r=n(t.relatedTarget||t.target),f=r.closest(i.target.selector)[0]==i.target[0],s=r.closest(ut).children(oi),u=o(i.element[0],r[0]),e;i._eventOrigin=t;e=t.which!==3;i.popup.visible()&&(e&&f||!f)&&(i.options.closeOnClick&&!s[0]&&u||!u)&&(u?(this.unbind(w,this._closeTimeoutProxy),i.bind(w,i._closeTimeoutProxy)):i.close())},_wire:function(){var n=this,t=n.options,f=n.target;if(n._showProxy=u(n._showHandler,n),n._closeProxy=u(n._closeHandler,n),n._closeTimeoutProxy=u(n.close,n),f[0])if(i.support.mobileOS&&t.showOn=="contextmenu"){n.userEvents=new i.UserEvents(f,{filter:t.filter,allowSelection:!1});f.on(t.showOn+r,!1);n.userEvents.bind("hold",n._showProxy)}else if(t.filter)f.on(t.showOn+r,t.filter,n._showProxy);else f.on(t.showOn+r,n._showProxy)},_triggerEvent:function(i){var r=this,f=n(r.popup.options.anchor)[0],u=r._eventOrigin;return r._eventOrigin=t,r.trigger(i.type,e({type:i.type,item:i.item||this.element[0],target:f},u?{event:u}:{}))},_popup:function(){var n=this;n._triggerProxy=u(n._triggerEvent,n);n.popup=n.element.addClass("k-context-menu").kendoPopup({anchor:n.target||"body",copyAnchorStyles:n.options.copyAnchorStyles,collision:n.options.popupCollision||"fit",animation:n.options.animation,activate:n._triggerProxy,deactivate:n._triggerProxy}).data("kendoPopup");n._targetChild=o(n.target[0],n.popup.element[0])}});ct.plugin(f);ct.plugin(ai)})(window.kendo.jQuery)}(),function(){(function(n,t){function nt(t){return n.trim(t).replace(/&nbsp;/gi,"")}function tt(n,t){for(var u={},r,i=0,f=n.length;i<f;i++)r=n[i],u[r[t]]=r;return u}function a(n){for(var i=[],t=0;t<n.length;t++){if(!n[t].columns){i.push(n[t]);continue}i=i.concat(a(n[t].columns))}return i}var i=window.kendo,v=i.ui,f=n.proxy,d=n.extend,r=n.grep,h=n.map,y=n.inArray,e="k-state-selected",c="asc",p="desc",w="change",b="init",o="select",l="kendoPopup",g="kendoFilterMenu",k="kendoMenu",u=".kendoColumnMenu",s=v.Widget,it=s.extend({init:function(t,r){var e=this,o;s.fn.init.call(e,t,r);t=e.element;r=e.options;e.owner=r.owner;e.dataSource=r.dataSource;e.field=t.attr(i.attr("field"));e.title=t.attr(i.attr("title"));o=t.find(".k-header-column-menu");o[0]||(o=t.addClass("k-with-icon").prepend('<a class="k-header-column-menu" href="#"><span class="k-icon k-i-arrowhead-s"/><\/a>').find(".k-header-column-menu"));e.link=o.attr("tabindex",-1).on("click"+u,f(e._click,e));e.wrapper=n('<div class="k-column-menu"/>');e._refreshHandler=f(e.refresh,e);e.dataSource.bind(w,e._refreshHandler)},_init:function(){var n=this;n.pane=n.options.pane;n.pane&&(n._isMobile=!0);n._isMobile?n._createMobileMenu():n._createMenu();n._angularItems("compile");n._sort();n._columns();n._filter();n._lockColumns();n.trigger(b,{field:n.field,container:n.wrapper})},events:[b],options:{name:"ColumnMenu",messages:{sortAscending:"Sort Ascending",sortDescending:"Sort Descending",filter:"Filter",columns:"Columns",done:"Done",settings:"Column Settings",lock:"Lock",unlock:"Unlock"},filter:"",columns:!0,sortable:!0,filterable:!0,animations:{left:"slide"}},_createMenu:function(){var n=this,t=n.options;n.wrapper.html(i.template(rt)({ns:i.ns,messages:t.messages,sortable:t.sortable,filterable:t.filterable,columns:n._ownerColumns(),showColumns:t.columns,lockedColumns:t.lockedColumns}));n.popup=n.wrapper[l]({anchor:n.link,open:f(n._open,n),activate:f(n._activate,n),close:function(){n.options.closeCallback&&n.options.closeCallback(n.element)}}).data(l);n.menu=n.wrapper.children()[k]({orientation:"vertical",closeOnClick:!1}).data(k)},_createMobileMenu:function(){var n=this,t=n.options,r=i.template(ut)({ns:i.ns,field:n.field,title:n.title||n.field,messages:t.messages,sortable:t.sortable,filterable:t.filterable,columns:n._ownerColumns(),showColumns:t.columns,lockedColumns:t.lockedColumns});n.view=n.pane.append(r);n.wrapper=n.view.element.find(".k-column-menu");n.menu=new ft(n.wrapper.children(),{pane:n.pane});n.view.element.on("click",".k-done",function(t){n.close();t.preventDefault()});n.options.lockedColumns&&n.view.bind("show",function(){n._updateLockedColumns()})},_angularItems:function(t){var r=this;r.angular(t,function(){var t=r.wrapper.find(".k-columns-item input["+i.attr("field")+"]").map(function(){return n(this).closest("li")}),u=h(r._ownerColumns(),function(n){return{column:n._originalObject}});return{elements:t,data:u}})},destroy:function(){var n=this;n._angularItems("cleanup");s.fn.destroy.call(n);n.filterMenu&&n.filterMenu.destroy();n._refreshHandler&&n.dataSource.unbind(w,n._refreshHandler);n.options.columns&&n.owner&&(n._updateColumnsMenuHandler&&(n.owner.unbind("columnShow",n._updateColumnsMenuHandler),n.owner.unbind("columnHide",n._updateColumnsMenuHandler)),n._updateColumnsLockedStateHandler&&(n.owner.unbind("columnLock",n._updateColumnsLockedStateHandler),n.owner.unbind("columnUnlock",n._updateColumnsLockedStateHandler)));n.menu&&(n.menu.element.off(u),n.menu.destroy());n.wrapper.off(u);n.popup&&n.popup.destroy();n.view&&n.view.purge();n.link.off(u);n.owner=null;n.wrapper=null;n.element=null},close:function(){this.menu.close();this.popup&&(this.popup.close(),this.popup.element.off("keydown"+u))},_click:function(n){n.preventDefault();n.stopPropagation();var t=this.options;t.filter&&this.element.is(!t.filter)||(this.popup||this.pane||this._init(),this._isMobile?this.pane.navigate(this.view,this.options.animations.left):this.popup.toggle())},_open:function(){var t=this;n(".k-column-menu").not(t.wrapper).each(function(){n(this).data(l).close()});t.popup.element.on("keydown"+u,function(n){n.keyCode==i.keys.ESC&&t.close()});t.options.lockedColumns&&t._updateLockedColumns()},_activate:function(){this.menu.element.focus()},_ownerColumns:function(){var n=a(this.owner.columns),t=r(n,function(n){var t=!0,i=nt(n.title||"");return n.menu!==!1&&(n.field||i.length)||(t=!1),t});return h(t,function(t){return{originalField:t.field,field:t.field||t.title,title:t.title||t.field,hidden:t.hidden,index:y(t,n),locked:!!t.locked,_originalObject:t}})},_sort:function(){var t=this;t.options.sortable&&(t.refresh(),t.menu.bind(o,function(i){var u=n(i.item),r;(u.hasClass("k-sort-asc")?r=c:u.hasClass("k-sort-desc")&&(r=p),r)&&(u.parent().find(".k-sort-"+(r==c?p:c)).removeClass(e),t._sortDataSource(u,r),t.close())}))},_sortDataSource:function(n,i){var u=this,f=u.options.sortable,s=f.compare===null?t:f.compare,h=u.dataSource,o,c,r=h.sort()||[];if(n.hasClass(e)&&f&&f.allowUnsort!==!1?(n.removeClass(e),i=t):n.addClass(e),f.mode==="multiple"){for(o=0,c=r.length;o<c;o++)if(r[o].field===u.field){r.splice(o,1);break}r.push({field:u.field,dir:i,compare:s})}else r=[{field:u.field,dir:i,compare:s}];h.sort(r)},_columns:function(){var t=this;t.options.columns&&(t._updateColumnsMenu(),t._updateColumnsMenuHandler=f(t._updateColumnsMenu,t),t.owner.bind(["columnHide","columnShow"],t._updateColumnsMenuHandler),t._updateColumnsLockedStateHandler=f(t._updateColumnsLockedState,t),t.owner.bind(["columnUnlock","columnLock"],t._updateColumnsLockedStateHandler),t.menu.bind(o,function(u){var s=n(u.item),e,f,h=a(t.owner.columns),o;(t._isMobile&&u.preventDefault(),s.parent().closest("li.k-columns-item")[0])&&((e=s.find(":checkbox"),e.attr("disabled"))||(o=e.attr(i.attr("field")),f=r(h,function(n){return n.field==o||n.title==o})[0],f.hidden===!0?t.owner.showColumn(f):t.owner.hideColumn(f)))}))},_updateColumnsMenu:function(){var t,s,n,u,e,c=i.attr("field"),a=i.attr("locked"),f=r(this._ownerColumns(),function(n){return!n.hidden}),l=r(f,function(n){return n.originalField}),v=r(l,function(n){return n.locked===!0}).length,p=r(l,function(n){return n.locked!==!0}).length,o;for(f=h(f,function(n){return n.field}),o=this.wrapper.find(".k-columns-item input["+c+"]").prop("disabled",!1).prop("checked",!1),t=0,s=o.length;t<s;t++)n=o.eq(t),e=n.attr(a)==="true",u=!1,y(n.attr(c),f)>-1&&(u=!0,n.prop("checked",u)),u&&(v==1&&e&&n.prop("disabled",!0),p!=1||e||n.prop("disabled",!0))},_updateColumnsLockedState:function(){for(var t,r,e=i.attr("field"),o=i.attr("locked"),s=tt(this._ownerColumns(),"field"),f=this.wrapper.find(".k-columns-item input[type=checkbox]"),n=0,u=f.length;n<u;n++)t=f.eq(n),r=s[t.attr(e)],r&&t.attr(o,r.locked);this._updateColumnsMenu()},_filter:function(){var t=this,r=g,i=t.options;i.filterable!==!1&&(i.filterable.multi&&(r="kendoFilterMultiCheck",i.filterable.dataSource&&(i.filterable.checkSource=i.filterable.dataSource,delete i.filterable.dataSource)),t.filterMenu=t.wrapper.find(".k-filterable")[r](d(!0,{},{appendToElement:!0,dataSource:i.dataSource,values:i.values,field:t.field,title:t.title},i.filterable)).data(r),t._isMobile&&t.menu.bind(o,function(i){var r=n(i.item);r.hasClass("k-filter-item")&&t.pane.navigate(t.filterMenu.view,t.options.animations.left)}))},_lockColumns:function(){var t=this;t.menu.bind(o,function(i){var r=n(i.item);r.hasClass("k-lock")?(t.owner.lockColumn(t.field),t.close()):r.hasClass("k-unlock")&&(t.owner.unlockColumn(t.field),t.close())})},_updateLockedColumns:function(){var t=this.field,i=this.owner.columns,u=r(i,function(n){return n.field==t||n.title==t})[0];if(u){var n=u.locked===!0,f=r(i,function(t){return!t.hidden&&(t.locked&&n||!t.locked&&!n)}).length,e=this.wrapper.find(".k-lock").removeClass("k-state-disabled"),o=this.wrapper.find(".k-unlock").removeClass("k-state-disabled");(n||f==1)&&e.addClass("k-state-disabled");n&&f!=1||o.addClass("k-state-disabled");this._updateColumnsLockedState()}},refresh:function(){var n=this,r=n.options.dataSource.sort()||[],i,f=n.field,t,u;for(n.wrapper.find(".k-sort-asc, .k-sort-desc").removeClass(e),t=0,u=r.length;t<u;t++)i=r[t],f==i.field&&n.wrapper.find(".k-sort-"+i.dir).addClass(e);n.link[n._filterExist(n.dataSource.filter())?"addClass":"removeClass"]("k-state-active")},_filterExist:function(n){var t=!1,i,r,u;if(n){for(n=n.filters,r=0,u=n.length;r<u;r++)i=n[r],i.field==this.field?t=!0:i.filters&&(t=t||this._filterExist(i));return t}}}),rt='<ul>#if(sortable){#<li class="k-item k-sort-asc"><span class="k-link"><span class="k-sprite k-i-sort-asc"><\/span>${messages.sortAscending}<\/span><\/li><li class="k-item k-sort-desc"><span class="k-link"><span class="k-sprite k-i-sort-desc"><\/span>${messages.sortDescending}<\/span><\/li>#if(showColumns || filterable){#<li class="k-separator"><\/li>#}##}##if(showColumns){#<li class="k-item k-columns-item"><span class="k-link"><span class="k-sprite k-i-columns"><\/span>${messages.columns}<\/span><ul>#for (var idx = 0; idx < columns.length; idx++) {#<li><input type="checkbox" data-#=ns#field="#=columns[idx].field.replace(/"/g,"&\\#34;")#" data-#=ns#index="#=columns[idx].index#" data-#=ns#locked="#=columns[idx].locked#"/>#=columns[idx].title#<\/li>#}#<\/ul><\/li>#if(filterable || lockedColumns){#<li class="k-separator"><\/li>#}##}##if(filterable){#<li class="k-item k-filter-item"><span class="k-link"><span class="k-sprite k-filter"><\/span>${messages.filter}<\/span><ul><li><div class="k-filterable"><\/div><\/li><\/ul><\/li>#if(lockedColumns){#<li class="k-separator"><\/li>#}##}##if(lockedColumns){#<li class="k-item k-lock"><span class="k-link"><span class="k-sprite k-i-lock"><\/span>${messages.lock}<\/span><\/li><li class="k-item k-unlock"><span class="k-link"><span class="k-sprite k-i-unlock"><\/span>${messages.unlock}<\/span><\/li>#}#<\/ul>',ut='<div data-#=ns#role="view" data-#=ns#init-widgets="false" class="k-grid-column-menu"><div data-#=ns#role="header" class="k-header">${messages.settings}<button class="k-button k-done">#=messages.done#<\/button><\/div><div class="k-column-menu k-mobile-list"><ul><li><span class="k-link">${title}<\/span><ul>#if(sortable){#<li class="k-item k-sort-asc"><span class="k-link"><span class="k-sprite k-i-sort-asc"><\/span>${messages.sortAscending}<\/span><\/li><li class="k-item k-sort-desc"><span class="k-link"><span class="k-sprite k-i-sort-desc"><\/span>${messages.sortDescending}<\/span><\/li>#}##if(lockedColumns){#<li class="k-item k-lock"><span class="k-link"><span class="k-sprite k-i-lock"><\/span>${messages.lock}<\/span><\/li><li class="k-item k-unlock"><span class="k-link"><span class="k-sprite k-i-unlock"><\/span>${messages.unlock}<\/span><\/li>#}##if(filterable){#<li class="k-item k-filter-item"><span class="k-link k-filterable"><span class="k-sprite k-filter"><\/span>${messages.filter}<\/span><\/li>#}#<\/ul><\/li>#if(showColumns){#<li class="k-columns-item"><span class="k-link">${messages.columns}<\/span><ul>#for (var idx = 0; idx < columns.length; idx++) {#<li class="k-item"><label class="k-label"><input type="checkbox" class="k-check" data-#=ns#field="#=columns[idx].field.replace(/"/g,"&\\#34;")#" data-#=ns#index="#=columns[idx].index#" data-#=ns#locked="#=columns[idx].locked#"/>#=columns[idx].title#<\/label><\/li>#}#<\/ul><\/li>#}#<\/ul><\/div><\/div>',ft=s.extend({init:function(n,t){s.fn.init.call(this,n,t);this.element.on("click"+u,"li.k-item:not(.k-separator):not(.k-state-disabled)","_click")},events:[o],_click:function(t){n(t.target).is("[type=checkbox]")||t.preventDefault();this.trigger(o,{item:t.currentTarget})},close:function(){this.options.pane.navigate("")},destroy:function(){s.fn.destroy.call(this);this.element.off(u)}});v.plugin(it)})(window.kendo.jQuery)}(),function(){(function(n,t){var i=window.kendo,s=i.ui,u=s.Widget,r="dir",f="asc",h="single",c="field",e="desc",l=".kendoColumnSorter",a=".k-link",o="aria-sort",v=n.proxy,y=u.extend({init:function(n,t){var i=this,r;u.fn.init.call(i,n,t);i._refreshHandler=v(i.refresh,i);i.dataSource=i.options.dataSource.bind("change",i._refreshHandler);r=i.element.find(a);r[0]||(r=i.element.wrapInner('<a class="k-link" href="#"/>').find(a));i.link=r;i.element.on("click"+l,v(i._click,i))},options:{name:"ColumnSorter",mode:h,allowUnsort:!0,compare:null,filter:""},destroy:function(){var n=this;u.fn.destroy.call(n);n.element.off(l);n.dataSource.unbind("change",n._refreshHandler);n._refreshHandler=n.element=n.link=n.dataSource=null},refresh:function(){var u=this,a=u.dataSource.sort()||[],s,v,h,l,t=u.element,y=t.attr(i.attr(c));for(t.removeAttr(i.attr(r)),t.removeAttr(o),s=0,v=a.length;s<v;s++)h=a[s],y==h.field&&t.attr(i.attr(r),h.dir);l=t.attr(i.attr(r));t.find(".k-i-arrow-n,.k-i-arrow-s").remove();l===f?(n('<span class="k-icon k-i-arrow-n" />').appendTo(u.link),t.attr(o,"ascending")):l===e&&(n('<span class="k-icon k-i-arrow-s" />').appendTo(u.link),t.attr(o,"descending"))},_click:function(n){var o=this,v=o.element,y=v.attr(i.attr(c)),s=v.attr(i.attr(r)),l=o.options,p=o.options.compare===null?t:o.options.compare,u=o.dataSource.sort()||[],a,w;if(n.preventDefault(),!l.filter||v.is(l.filter)){if(s=s===f?e:s===e&&l.allowUnsort?t:f,l.mode===h)u=[{field:y,dir:s,compare:p}];else if(l.mode==="multiple"){for(a=0,w=u.length;a<w;a++)if(u[a].field===y){u.splice(a,1);break}u.push({field:y,dir:s,compare:p})}this.dataSource.sort(u)}}});s.plugin(y)})(window.kendo.jQuery)}(),function(){(function(n,t){function a(t){return t=t!=null?t:"",t.type||n.type(t)||"string"}function w(t){t.find(":input:not(:button, ["+i.attr("role")+"=upload], ["+i.attr("skip")+"], [type=file]), select").each(function(){var r=i.attr("bind"),t=this.getAttribute(r)||"",u=this.type==="checkbox"||this.type==="radio"?"checked:":"value:",f=this.name;t.indexOf(u)===-1&&f&&(t+=(t.length?",":"")+u+f,n(this).attr(r,t))})}function r(n){var e=(n.model.fields||n.model)[n.field],h=a(e),c=e?e.validation:{},t,v=i.attr("type"),y=i.attr("bind"),r,f={name:n.field};for(t in c)r=c[t],s(t,l)>=0?f[v]=t:o(r)||(f[t]=u(r)?r.value||t:r),f[i.attr(t+"-msg")]=r.message;return s(h,l)>=0&&(f[v]=h),f[y]=(h==="boolean"?"checked:":"value:")+n.field,f}function b(n){var i,u,t,f,e,r;if(n&&n.length)for(r=[],i=0,u=n.length;i<u;i++)t=n[i],e=t.text||t.value||t,f=t.value==null?t.text||t:t.value,r[i]={text:e,value:f};return r}function v(n,t){var f=n?n.validation||{}:{},r,i;for(r in f)i=f[r],u(i)&&i.value&&(i=i.value),o(i)&&(t[r]=i)}var i=window.kendo,e=i.ui,f=e.Widget,y=n.extend,p=i.support.browser.msie&&i.support.browser.version<9,o=i.isFunction,u=n.isPlainObject,s=n.inArray,h=/("|\%|'|\[|\]|\$|\.|\,|\:|\;|\+|\*|\&|\!|\#|\(|\)|<|>|\=|\?|\@|\^|\{|\}|\~|\/|\||`)/g,c="change",l=["url","email","number","date","boolean"],k={number:function(t,u){var f=r(u);n('<input type="text"/>').attr(f).appendTo(t).kendoNumericTextBox({format:u.format});n("<span "+i.attr("for")+'="'+u.field+'" class="k-invalid-msg"/>').hide().appendTo(t)},date:function(t,u){var e=r(u),f=u.format;f&&(f=i._extractFormat(f));e[i.attr("format")]=f;n('<input type="text"/>').attr(e).appendTo(t).kendoDatePicker({format:u.format});n("<span "+i.attr("for")+'="'+u.field+'" class="k-invalid-msg"/>').hide().appendTo(t)},string:function(t,i){var u=r(i);n('<input type="text" class="k-input k-textbox"/>').attr(u).appendTo(t)},boolean:function(t,i){var u=r(i);n('<input type="checkbox" />').attr(u).appendTo(t)},values:function(t,u){var e=r(u),f=i.stringify(b(u.values));n("<select "+i.attr("text-field")+'="text"'+i.attr("value-field")+'="value"'+i.attr("source")+"='"+(f?f.replace(/\'/g,"&apos;"):f)+"'"+i.attr("role")+'="dropdownlist"/>').attr(e).appendTo(t);n("<span "+i.attr("for")+'="'+u.field+'" class="k-invalid-msg"/>').hide().appendTo(t)}},d=f.extend({init:function(t,i){var r=this;i.target&&(i.$angular=i.target.options.$angular);f.fn.init.call(r,t,i);r._validateProxy=n.proxy(r._validate,r);r.refresh()},events:[c],options:{name:"Editable",editors:k,clearContainer:!0,errorTemplate:'<div class="k-widget k-tooltip k-tooltip-validation" style="margin:0.5em"><span class="k-icon k-warning"> <\/span>#=message#<div class="k-callout k-callout-n"><\/div><\/div>'},editor:function(n,t){var f=this,s=f.options.editors,e=u(n),c=e?n.field:n,v=f.options.model||{},p=e&&n.values,w=p?"values":a(t),l=e&&n.editor,r=l?n.editor:s[w],o=f.element.find("["+i.attr("container-for")+"="+c.replace(h,"\\$1")+"]");r=r?r:s.string;l&&typeof n.editor=="string"&&(r=function(t){t.append(n.editor)});o=o.length?o:f.element;r(o,y(!0,{},e?n:{field:c},{model:v}))},_validate:function(t){var r=this,u,s=t.value,l=r._validationEventInProgress,f={},e=i.attr("bind"),o=t.field.replace(h,"\\$1"),a=new RegExp("(value|checked)\\s*:\\s*"+o+"\\s*(,|$)");f[t.field]=t.value;u=n(":input["+e+'*="'+o+'"]',r.element).filter("["+i.attr("validate")+"!='false']").filter(function(){return a.test(n(this).attr(e))});u.length>1&&(u=u.filter(function(){var t=n(this);return!t.is(":radio")||t.val()==s}));try{r._validationEventInProgress=!0;r.validatable.validateInput(u)&&(l||!r.trigger(c,{values:f}))||t.preventDefault()}finally{r._validationEventInProgress=!1}},end:function(){return this.validatable.validate()},destroy:function(){var n=this;n.angular("cleanup",function(){return{elements:n.element}});f.fn.destroy.call(n);n.options.model.unbind("set",n._validateProxy);i.unbind(n.element);n.validatable&&n.validatable.destroy();i.destroy(n.element);n.element.removeData("kendoValidator");n.element.is("["+i.attr("role")+"=editable]")&&n.element.removeAttr(i.attr("role"))},refresh:function(){var r=this,h,l,e=r.options.fields||[],f=r.options.clearContainer?r.element.empty():r.element,o=r.options.model||{},a={},s,k,c,y,b,d;for(n.isArray(e)||(e=[e]),h=0,l=e.length;h<l;h++)s=e[h],k=u(s),c=k?s.field:s,y=(o.fields||o)[c],v(y,a),r.editor(s,y);if(r.options.target&&r.angular("compile",function(){return{elements:f,data:f.map(function(){return{dataItem:o}})}}),!l){b=o.fields||o;for(c in b)v(b[c],a)}w(f);r.validatable&&r.validatable.destroy();i.bind(f,r.options.model);r.options.model.unbind("set",r._validateProxy);r.options.model.bind("set",r._validateProxy);r.validatable=new i.ui.Validator(f,{validateOnBlur:!1,errorTemplate:r.options.errorTemplate||t,rules:a});d=f.find(":kendoFocusable").eq(0).focus();p&&d.focus()}});e.plugin(d)})(window.kendo.jQuery)}(),function(){(function(n,t){function rt(n){return typeof n!="undefined"}function o(n,t,i){return Math.max(Math.min(parseInt(n,10),i===Infinity?i:parseInt(i,10)),parseInt(t,10))}function ri(n,t){return function(){var i=this,r=i.wrapper,u=r[0].style,o=i.options;return o.isMaximized||o.isMinimized?i:(i.restoreOptions={width:u.width,height:u.height},r.children(c).hide().end().children(f).find(gt).parent().hide().eq(0).before(e.action({name:"Restore"})),t.call(i),n=="maximize"?i.wrapper.children(f).find(ot).parent().hide():i.wrapper.children(f).find(ot).parent().show(),i)}}function ci(){return!this.type||this.type.toLowerCase().indexOf("script")>=0}function fi(n){var t=this;t.owner=n;t._draggable=new st(n.wrapper,{filter:">"+c,group:n.wrapper.id+"-resizing",dragstart:r(t.dragstart,t),drag:r(t.drag,t),dragend:r(t.dragend,t)});t._draggable.userEvents.bind("press",r(t.addOverlay,t));t._draggable.userEvents.bind("release",r(t.removeOverlay,t))}function ei(n,t){var i=this;i.owner=n;i._draggable=new st(n.wrapper,{filter:t,group:n.wrapper.id+"-moving",dragstart:r(i.dragstart,i),drag:r(i.drag,i),dragend:r(i.dragend,i),dragcancel:r(i.dragcancel,i)});i._draggable.userEvents.stopPropagation=!1}var i=window.kendo,k=i.ui.Widget,st=i.ui.Draggable,ht=n.isPlainObject,oi=i._activeElement,r=n.proxy,d=n.extend,si=n.each,s=i.template,g="body",e,u=".kendoWindow",a=".k-window",ut=".k-window-title",f=ut+"bar",h=".k-window-content",c=".k-resize-handle",nt=".k-overlay",p="k-content-frame",ct="k-loading",lt="k-state-hover",at="k-state-focused",vt="k-window-maximized",v=":visible",tt="hidden",y="cursor",ft="open",et="activate",yt="deactivate",pt="close",it="refresh",wt="resizeEnd",bt="dragstart",kt="dragend",dt="error",l="overflow",w="zIndex",gt=".k-window-actions .k-i-minimize,.k-window-actions .k-i-maximize",ni=".k-i-pin",ti=".k-i-unpin",ot=ni+","+ti,b=".k-window-titlebar .k-window-action",ii=".k-window-titlebar .k-i-refresh",hi=i.isLocalUrl,ui=k.extend({init:function(e,o){var s=this,c,w={},g,nt,l,it=!1,y,d,ot=o&&o.actions&&!o.actions.length,p;k.fn.init.call(s,e,o);o=s.options;l=o.position;e=s.element;y=o.content;ot&&(o.actions=[]);s.appendTo=n(o.appendTo);y&&!ht(y)&&(y=o.content={url:y});e.find("script").filter(ci).remove();e.parent().is(s.appendTo)||l.top!==t&&l.left!==t||(e.is(v)?(w=e.offset(),it=!0):(g=e.css("visibility"),nt=e.css("display"),e.css({visibility:tt,display:""}),w=e.offset(),e.css({visibility:g,display:nt})),l.top===t&&(l.top=w.top),l.left===t&&(l.left=w.left));rt(o.visible)&&o.visible!==null||(o.visible=e.is(v));c=s.wrapper=e.closest(a);e.is(".k-content")&&c[0]||(e.addClass("k-window-content k-content"),s._createWindow(e,o),c=s.wrapper=e.closest(a),s._dimensions());s._position();o.pinned&&s.pin(!0);y&&s.refresh(y);o.visible&&s.toFront();d=c.children(h);s._tabindex(d);o.visible&&o.modal&&s._overlay(c.is(v)).css({opacity:.5});c.on("mouseenter"+u,b,r(s._buttonEnter,s)).on("mouseleave"+u,b,r(s._buttonLeave,s)).on("click"+u,"> "+b,r(s._windowActionHandler,s));d.on("keydown"+u,r(s._keydown,s)).on("focus"+u,r(s._focus,s)).on("blur"+u,r(s._blur,s));this._resizable();this._draggable();p=e.attr("id");p&&(p=p+"_wnd_title",c.children(f).children(ut).attr("id",p),d.attr({role:"dialog","aria-labelledby":p}));c.add(c.children(".k-resize-handle,"+f)).on("mousedown"+u,r(s.toFront,s));s.touchScroller=i.touchScroller(e);s._resizeHandler=r(s._onDocumentResize,s);s._marker=i.guid().substring(0,8);n(window).on("resize"+u+s._marker,s._resizeHandler);o.visible&&(s.trigger(ft),s.trigger(et));i.notify(s)},_buttonEnter:function(t){n(t.currentTarget).addClass(lt)},_buttonLeave:function(t){n(t.currentTarget).removeClass(lt)},_focus:function(){this.wrapper.addClass(at)},_blur:function(){this.wrapper.removeClass(at)},_dimensions:function(){var t=this.wrapper,n=this.options,r=n.width,u=n.height,e=n.maxHeight,s=["minWidth","minHeight","maxWidth","maxHeight"],i,f;for(this.title(n.title),i=0;i<s.length;i++)f=n[s[i]],f&&f!=Infinity&&t.css(s[i],f);e&&e!=Infinity&&this.element.css("maxHeight",e);r&&(r.toString().indexOf("%")>0?t.width(r):t.width(o(r,n.minWidth,n.maxWidth)));u&&(u.toString().indexOf("%")>0?t.height(u):t.height(o(u,n.minHeight,n.maxHeight)));n.visible||t.hide()},_position:function(){var t=this.wrapper,n=this.options.position;n.top===0&&(n.top=n.top.toString());n.left===0&&(n.left=n.left.toString());t.css({top:n.top||"",left:n.left||""})},_animationOptions:function(n){var t=this.options.animation;return t&&t[n]||{open:{effects:{}},close:{hide:!0,effects:{}}}[n]},_resize:function(){i.resize(this.element.children())},_resizable:function(){var i=this.options.resizable,t=this.wrapper;if(this.resizing&&(t.off("dblclick"+u).children(c).remove(),this.resizing.destroy(),this.resizing=null),i){t.on("dblclick"+u,f,r(function(t){n(t.target).closest(".k-window-action").length||this.toggleMaximization()},this));si("n e s w se sw ne nw".split(" "),function(n,i){t.append(e.resizeHandle(i))});this.resizing=new fi(this)}t=null},_draggable:function(){var n=this.options.draggable;this.dragging&&(this.dragging.destroy(),this.dragging=null);n&&(this.dragging=new ei(this,n.dragHandle||f))},_actions:function(){var t=this.options.actions,r=this.wrapper.children(f),u=r.find(".k-window-actions");t=n.map(t,function(n){return{name:n}});u.html(i.render(e.action,t))},setOptions:function(n){var t,i;k.fn.setOptions.call(this,n);t=this.options.scrollable!==!1;this.restore();this._dimensions();this._position();this._resizable();this._draggable();this._actions();typeof n.modal!="undefined"&&(i=this.options.visible!==!1,this._overlay(n.modal&&i));this.element.css(l,t?"":"hidden")},events:[ft,et,yt,pt,it,"resize",wt,bt,kt,dt],options:{name:"Window",animation:{open:{effects:{zoom:{direction:"in"},fade:{direction:"in"}},duration:350},close:{effects:{zoom:{direction:"out",properties:{scale:.7}},fade:{direction:"out"}},duration:350,hide:!0}},title:"",actions:["Close"],autoFocus:!0,modal:!1,resizable:!0,draggable:!0,minWidth:90,minHeight:50,maxWidth:Infinity,maxHeight:Infinity,pinned:!1,scrollable:!0,position:{},content:null,visible:null,height:null,width:null,appendTo:"body"},_closable:function(){return n.inArray("close",n.map(this.options.actions,function(n){return n.toLowerCase()}))>-1},_keydown:function(n){var u=this,h=u.options,f=i.keys,e=n.keyCode,t=u.wrapper,c,r,s=10,p=u.options.isMaximized,v,y,l,a;n.target!=n.currentTarget||u._closing||(e==f.ESC&&u._closable()&&u._close(!1),!h.draggable||n.ctrlKey||p||(c=i.getOffset(t),e==f.UP?r=t.css("top",c.top-s):e==f.DOWN?r=t.css("top",c.top+s):e==f.LEFT?r=t.css("left",c.left-s):e==f.RIGHT&&(r=t.css("left",c.left+s))),h.resizable&&n.ctrlKey&&!p&&(e==f.UP?(r=!0,y=t.height()-s):e==f.DOWN&&(r=!0,y=t.height()+s),e==f.LEFT?(r=!0,v=t.width()-s):e==f.RIGHT&&(r=!0,v=t.width()+s),r&&(l=o(v,h.minWidth,h.maxWidth),a=o(y,h.minHeight,h.maxHeight),isNaN(l)||(t.width(l),u.options.width=l+"px"),isNaN(a)||(t.height(a),u.options.height=a+"px"),u.resize())),r&&n.preventDefault())},_overlay:function(t){var i=this.appendTo.children(nt),r=this.wrapper;return i.length||(i=n("<div class='k-overlay' />")),i.insertBefore(r[0]).toggle(t).css(w,parseInt(r.css(w),10)-1),i},_actionForIcon:function(n){var t=/\bk-i-\w+\b/.exec(n[0].className)[0];return{"k-i-close":"_close","k-i-maximize":"maximize","k-i-minimize":"minimize","k-i-restore":"restore","k-i-refresh":"refresh","k-i-pin":"pin","k-i-unpin":"unpin"}[t]},_windowActionHandler:function(t){if(!this._closing){var r=n(t.target).closest(".k-window-action").find(".k-icon"),i=this._actionForIcon(r);if(i)return t.preventDefault(),this[i](),!1}},_modals:function(){var t=this,i=n(a).filter(function(){var r=n(this),u=t._object(r),i=u&&u.options;return i&&i.modal&&i.visible&&i.appendTo===t.options.appendTo&&r.is(v)}).sort(function(t,i){return+n(t).css("zIndex")-+n(i).css("zIndex")});return t=null,i},_object:function(n){var u=n.children(h),r=i.widgetInstance(u);return r instanceof ui?r:t},center:function(){var t=this,e=t.options.position,i=t.wrapper,r=n(window),o=0,s=0,u,f;return t.options.isMaximized?t:(t.options.pinned||(o=r.scrollTop(),s=r.scrollLeft()),f=s+Math.max(0,(r.width()-i.width())/2),u=o+Math.max(0,(r.height()-i.height()-parseInt(i.css("paddingTop"),10))/2),i.css({left:f,top:u}),e.top=u,e.left=f,t)},title:function(n){var i=this,r=i.wrapper,s=i.options,t=r.children(f),o=t.children(ut),u;return arguments.length?(n===!1?(r.addClass("k-window-titleless"),t.remove()):(t.length?o.html(n):(r.prepend(e.titlebar(s)),i._actions(),t=r.children(f)),u=t.outerHeight(),r.css("padding-top",u),t.css("margin-top",-u)),i.options.title=n,i):o.text()},content:function(n,t){var r=this.wrapper.children(h),u=r.children(".km-scroll-container");return(r=u[0]?u:r,!rt(n))?r.html():(this.angular("cleanup",function(){return{elements:r.children()}}),i.destroy(this.element.children()),r.empty().html(n),this.angular("compile",function(){for(var n=[],i=r.length;--i>=0;)n.push({dataItem:t});return{elements:r.children(),data:n}}),this)},open:function(){var t=this,f=t.wrapper,e=t.options,o=this._animationOptions("open"),a=f.children(h),u,c=n(document),s;return t.trigger(ft)||(t._closing&&f.kendoStop(!0,!0),t._closing=!1,t.toFront(),e.autoFocus&&t.element.focus(),e.visible=!0,e.modal&&(u=t._overlay(!1),u.kendoStop(!0,!0),o.duration&&i.effects.Fade?(s=i.fx(u).fadeIn(),s.duration(o.duration||0),s.endValue(.5),s.play()):u.css("opacity",.5),u.show()),f.is(v)||(a.css(l,tt),f.show().kendoStop().kendoAnimate({effects:o.effects,duration:o.duration,complete:r(this._activate,this)}))),e.isMaximized&&(t._documentScrollTop=c.scrollTop(),t._documentScrollLeft=c.scrollLeft(),n("html, body").css(l,tt)),t},_activate:function(){var n=this.options.scrollable!==!1;this.options.autoFocus&&this.element.focus();this.element.css(l,n?"":"hidden");this.trigger(et)},_removeOverlay:function(r){var f=this._modals(),e=this.options,s=e.modal&&!f.length,h=e.modal?this._overlay(!0):n(t),o=this._animationOptions("close"),u;s?!r&&o.duration&&i.effects.Fade?(u=i.fx(h).fadeOut(),u.duration(o.duration||0),u.startValue(.5),u.play()):this._overlay(!1).remove():f.length&&this._object(f.last())._overlay(!0)},_close:function(t){var i=this,u=i.wrapper,o=i.options,s=this._animationOptions("open"),f=this._animationOptions("close"),e=n(document);if(u.is(v)&&!i.trigger(pt,{userTriggered:!t})){if(i._closing)return;i._closing=!0;o.visible=!1;n(a).each(function(t,i){var r=n(i).children(h);i!=u&&r.find("> ."+p).length>0&&r.children(nt).remove()});this._removeOverlay();u.kendoStop().kendoAnimate({effects:f.effects||s.effects,reverse:f.reverse===!0,duration:f.duration,complete:r(this._deactivate,this)})}i.options.isMaximized&&(n("html, body").css(l,""),i._documentScrollTop&&i._documentScrollTop>0&&e.scrollTop(i._documentScrollTop),i._documentScrollLeft&&i._documentScrollLeft>0&&e.scrollLeft(i._documentScrollLeft))},_deactivate:function(){var n=this,t;n.wrapper.hide().css("opacity","");n.trigger(yt);n.options.modal&&(t=n._object(n._modals().last()),t&&t.toFront())},close:function(){return this._close(!0),this},_actionable:function(t){return n(t).is(b+","+b+" .k-icon,:input,a")},_shouldFocus:function(t){var r=oi(),i=this.element;return this.options.autoFocus&&!n(r).is(i)&&!this._actionable(t)&&(!i.find(r).length||!i.find(t).length)},toFront:function(t){var r=this,i=r.wrapper,s=i[0],u=+i.css(w),c=u,l=t&&t.target||null,f,o;return n(a).each(function(t,i){var r=n(i),f=r.css(w),o=r.children(h);isNaN(f)||(u=Math.max(+f,u));i!=s&&o.find("> ."+p).length>0&&o.append(e.overlay)}),(!i[0].style.zIndex||c<u)&&i.css(w,u+2),r.element.find("> .k-overlay").remove(),r._shouldFocus(l)&&(r.element.focus(),f=n(window).scrollTop(),o=parseInt(i.position().top,10),o>0&&o<f&&(f>0?n(window).scrollTop(o):i.css("top",f))),i=null,r},toggleMaximization:function(){return this._closing?this:this[this.options.isMaximized?"restore":"maximize"]()},restore:function(){var t=this,i=t.options,u=i.minHeight,r=t.restoreOptions,f=n(document);return!i.isMaximized&&!i.isMinimized?t:(u&&u!=Infinity&&t.wrapper.css("min-height",u),t.wrapper.css({position:i.pinned?"fixed":"absolute",left:r.left,top:r.top,width:r.width,height:r.height}).removeClass(vt).find(".k-window-content,.k-resize-handle").show().end().find(".k-window-titlebar .k-i-restore").parent().remove().end().end().find(gt).parent().show().end().end().find(ot).parent().show(),t.options.width=r.width,t.options.height=r.height,n("html, body").css(l,""),this._documentScrollTop&&this._documentScrollTop>0&&f.scrollTop(this._documentScrollTop),this._documentScrollLeft&&this._documentScrollLeft>0&&f.scrollLeft(this._documentScrollLeft),i.isMaximized=i.isMinimized=!1,t.resize(),t)},maximize:ri("maximize",function(){var t=this,i=t.wrapper,r=i.position(),u=n(document);d(t.restoreOptions,{left:r.left,top:r.top});i.css({left:0,top:0,position:"fixed"}).addClass(vt);this._documentScrollTop=u.scrollTop();this._documentScrollLeft=u.scrollLeft();n("html, body").css(l,tt);t.options.isMaximized=!0;t._onDocumentResize()}),minimize:ri("minimize",function(){var n=this;n.wrapper.css({height:"",minHeight:""});n.element.hide();n.options.isMinimized=!0}),pin:function(t){var i=this,u=n(window),r=i.wrapper,e=parseInt(r.css("top"),10),o=parseInt(r.css("left"),10);!t&&(i.options.pinned||i.options.isMaximized)||(r.css({position:"fixed",top:e-u.scrollTop(),left:o-u.scrollLeft()}),r.children(f).find(ni).addClass("k-i-unpin").removeClass("k-i-pin"),i.options.pinned=!0)},unpin:function(){var t=this,r=n(window),i=t.wrapper,u=parseInt(i.css("top"),10),e=parseInt(i.css("left"),10);t.options.pinned&&!t.options.isMaximized&&(i.css({position:"",top:u+r.scrollTop(),left:e+r.scrollLeft()}),i.children(f).find(ti).addClass("k-i-pin").removeClass("k-i-unpin"),t.options.pinned=!1)},_onDocumentResize:function(){var t=this,f=t.wrapper,e=n(window),o=i.support.zoomLevel(),r,u;t.options.isMaximized&&(r=e.width()/o,u=e.height()/o-parseInt(f.css("padding-top"),10),f.css({width:r,height:u}),t.options.width=r,t.options.height=u,t.resize())},refresh:function(t){var i=this,o=i.options,h=n(i.element),c,f,l;if(ht(t)||(t={url:t}),t=d({},o.content,t),f=rt(o.iframe)?o.iframe:t.iframe,l=t.url,l)if(rt(f)||(f=!hi(l)),f){c=h.find("."+p)[0];c?c.src=l||c.src:h.html(e.contentFrame(d({},o,{content:t})));h.find("."+p).unbind("load"+u).on("load"+u,r(this._triggerRefresh,this))}else i._ajaxRequest(t);else t.template&&i.content(s(t.template)({})),i.trigger(it);return h.toggleClass("k-window-iframecontent",!!f),i},_triggerRefresh:function(){this.trigger(it)},_ajaxComplete:function(){clearTimeout(this._loadingIconTimeout);this.wrapper.find(ii).removeClass(ct)},_ajaxError:function(n,t){this.trigger(dt,{status:t,xhr:n})},_ajaxSuccess:function(n){return function(t){var i=t;n&&(i=s(n)(t||{}));this.content(i,t);this.element.prop("scrollTop",0);this.trigger(it)}},_showLoading:function(){this.wrapper.find(ii).addClass(ct)},_ajaxRequest:function(t){this._loadingIconTimeout=setTimeout(r(this._showLoading,this),100);n.ajax(d({type:"GET",dataType:"html",cache:!1,error:r(this._ajaxError,this),complete:r(this._ajaxComplete,this),success:r(this._ajaxSuccess(t.template),this)},t))},_destroy:function(){this.resizing&&this.resizing.destroy();this.dragging&&this.dragging.destroy();this.wrapper.off(u).children(h).off(u).end().find(".k-resize-handle,.k-window-titlebar").off(u);n(window).off("resize"+u+this._marker);clearTimeout(this._loadingIconTimeout);k.fn.destroy.call(this);this.unbind(t);i.destroy(this.wrapper);this._removeOverlay(!0)},destroy:function(){this._destroy();this.wrapper.empty().remove();this.wrapper=this.appendTo=this.element=n()},_createWindow:function(){var t=this.element,u=this.options,f,r,o=i.support.isRtl(t);u.scrollable===!1&&t.attr("style","overflow:hidden;");r=n(e.wrapper(u));f=t.find("iframe:not(.k-content)").map(function(){var n=this.getAttribute("src");return this.src="",n});r.toggleClass("k-rtl",o).appendTo(this.appendTo).append(t).find("iframe:not(.k-content)").each(function(n){this.src=f[n]});r.find(".k-window-title").css(o?"left":"right",r.find(".k-window-actions").outerWidth()+10);t.css("visibility","").show();t.find("[data-role=editor]").each(function(){var t=n(this).data("kendoEditor");t&&t.refresh()});r=t=null}});e={wrapper:s("<div class='k-widget k-window' />"),action:s("<a role='button' href='\\#' class='k-window-action k-link'><span role='presentation' class='k-icon k-i-#= name.toLowerCase() #'>#= name #<\/span><\/a>"),titlebar:s("<div class='k-window-titlebar k-header'>&nbsp;<span class='k-window-title'>#= title #<\/span><div class='k-window-actions' /><\/div>"),overlay:"<div class='k-overlay' />",contentFrame:s("<iframe frameborder='0' title='#= title #' class='"+p+"' src='#= content.url #'>This page requires frames in order to show content<\/iframe>"),resizeHandle:s("<div class='k-resize-handle k-resize-#= data #'><\/div>")};fi.prototype={addOverlay:function(){this.owner.wrapper.append(e.overlay)},removeOverlay:function(){this.owner.wrapper.find(nt).remove()},dragstart:function(t){var r=this,f=r.owner,u=f.wrapper;r.elementPadding=parseInt(u.css("padding-top"),10);r.initialPosition=i.getOffset(u,"position");r.resizeDirection=t.currentTarget.prop("className").replace("k-resize-handle k-resize-","");r.initialSize={width:u.width(),height:u.height()};r.containerOffset=i.getOffset(f.appendTo,"position");u.children(c).not(t.currentTarget).hide();n(g).css(y,t.currentTarget.css(y))},drag:function(n){var u=this,f=u.owner,e=f.wrapper,t=f.options,s=u.resizeDirection,h=u.containerOffset,c=u.initialPosition,v=u.initialSize,i,r,l,a,y=Math.max(n.x.location,h.left),p=Math.max(n.y.location,h.top);s.indexOf("e")>=0?(i=y-c.left,e.width(o(i,t.minWidth,t.maxWidth))):s.indexOf("w")>=0&&(a=c.left+v.width,i=o(a-y,t.minWidth,t.maxWidth),e.css({left:a-i-h.left,width:i}));s.indexOf("s")>=0?(r=p-c.top-u.elementPadding,e.height(o(r,t.minHeight,t.maxHeight))):s.indexOf("n")>=0&&(l=c.top+v.height,r=o(l-p,t.minHeight,t.maxHeight),e.css({top:l-r-h.top,height:r}));i&&(f.options.width=i+"px");r&&(f.options.height=r+"px");f.resize()},dragend:function(t){var r=this,i=r.owner,u=i.wrapper;return u.children(c).not(t.currentTarget).show(),n(g).css(y,""),i.touchScroller&&i.touchScroller.reset(),t.keyCode==27&&u.css(r.initialPosition).css(r.initialSize),i.trigger(wt),!1},destroy:function(){this._draggable&&this._draggable.destroy();this._draggable=this.owner=null}};ei.prototype={dragstart:function(t){var r=this.owner,u=r.element,f=u.find(".k-window-actions"),o=i.getOffset(r.appendTo);r.trigger(bt);r.initialWindowPosition=i.getOffset(r.wrapper,"position");r.startPosition={left:t.x.client-r.initialWindowPosition.left,top:t.y.client-r.initialWindowPosition.top};r.minLeftPosition=f.length>0?f.outerWidth()+parseInt(f.css("right"),10)-u.outerWidth():20-u.outerWidth();r.minLeftPosition-=o.left;r.minTopPosition=-o.top;r.wrapper.append(e.overlay).children(c).hide();n(g).css(y,t.currentTarget.css(y))},drag:function(t){var i=this.owner,r=i.options.position,u=Math.max(t.y.client-i.startPosition.top,i.minTopPosition),f=Math.max(t.x.client-i.startPosition.left,i.minLeftPosition),e={left:f,top:u};n(i.wrapper).css(e);r.top=u;r.left=f},_finishDrag:function(){var t=this.owner;t.wrapper.children(c).toggle(!t.options.isMinimized).end().find(nt).remove();n(g).css(y,"")},dragcancel:function(n){this._finishDrag();n.currentTarget.closest(a).css(this.owner.initialWindowPosition)},dragend:function(){return this._finishDrag(),this.owner.trigger(kt),!1},destroy:function(){this._draggable&&this._draggable.destroy();this._draggable=this.owner=null}};i.ui.plugin(ui)})(window.kendo.jQuery)}(),function(){(function(n){function g(n){for(var f=n.find(i("popover")),o=r.roles,u=0,e=f.length;u<e;u++)t.initWidget(f[u],{},o)}function nt(n){t.triggeredByInput(n)||n.preventDefault()}function tt(i){i.each(function(){t.initWidget(n(this),{},r.roles)})}var t=window.kendo,u=t.mobile,r=u.ui,h=t.attr,f=r.Widget,ht=t.ViewClone,e="init",ct='<div style="height: 100%; width: 100%; position: absolute; top: 0; left: 0; z-index: 20000; display: none" />',a="beforeShow",o="show",v="afterShow",y="beforeHide",p="transitionEnd",w="transitionStart",s="hide",b="destroy",k=t.attrValue,i=t.roleSelector,d=t.directiveSelector,c=t.compileMobileDirective,lt=f.extend({init:function(t,i){f.fn.init.call(this,t,i);this.params={};n.extend(this,i);this.transition=this.transition||this.defaultTransition;this._id();this.options.$angular?this._overlay():(this._layout(),this._overlay(),this._scroller(),this._model())},events:[e,a,o,v,y,s,b,w,p],options:{name:"View",title:"",layout:null,getLayout:n.noop,reload:!1,transition:"",defaultTransition:"",useNativeScrolling:!1,stretch:!1,zoom:!1,model:null,modelScope:window,scroller:{},initWidgets:!0},enable:function(n){typeof n=="undefined"&&(n=!0);n?this.overlay.hide():this.overlay.show()},destroy:function(){this.layout&&this.layout.detach(this);this.trigger(b);f.fn.destroy.call(this);this.scroller&&this.scroller.destroy();this.options.$angular&&this.element.scope().$destroy();t.destroy(this.element)},purge:function(){this.destroy();this.element.remove()},triggerBeforeShow:function(){return this.trigger(a,{view:this})?!1:!0},triggerBeforeHide:function(){return this.trigger(y,{view:this})?!1:!0},showStart:function(){var n=this.element;n.css("display","");this.inited?this._invokeNgController():(this.inited=!0,this.trigger(e,{view:this}));this.layout&&this.layout.attach(this);this._padIfNativeScrolling();this.trigger(o,{view:this});t.resize(n)},showEnd:function(){this.trigger(v,{view:this});this._padIfNativeScrolling()},hideEnd:function(){var n=this;n.element.hide();n.trigger(s,{view:n});n.layout&&n.layout.trigger(s,{view:n,layout:n.layout})},beforeTransition:function(n){this.trigger(w,{type:n})},afterTransition:function(n){this.trigger(p,{type:n})},_padIfNativeScrolling:function(){if(u.appLevelNativeScrolling()){var i=t.support.mobileOS&&t.support.mobileOS.android,n=u.application.skin()||"",r=u.application.os.android||n.indexOf("android")>-1,f=n==="flat"||n.indexOf("material")>-1,e=(i||r)&&!f?"footer":"header",o=(i||r)&&!f?"header":"footer";this.content.css({paddingTop:this[e].height(),paddingBottom:this[o].height()})}},contentElement:function(){var n=this;return n.options.stretch?n.content:n.scrollerContent},clone:function(){return new ht(this)},_scroller:function(){var i=this;if(!u.appLevelNativeScrolling()&&(i.options.stretch?i.content.addClass("km-stretched-view"):(i.content.kendoMobileScroller(n.extend(i.options.scroller,{zoom:i.options.zoom,useNative:i.options.useNativeScrolling})),i.scroller=i.content.data("kendoMobileScroller"),i.scrollerContent=i.scroller.scrollElement),t.support.kineticScrollNeeded)){n(i.element).on("touchmove",".km-header",nt);if(!i.options.useNativeScrolling&&!i.options.stretch)n(i.element).on("touchmove",".km-content",nt)}},_model:function(){var n=this,f=n.element,i=n.options.model;typeof i=="string"&&(i=t.getter(i)(n.options.modelScope));n.model=i;g(f);n.element.css("display","");n.options.initWidgets&&(i?t.bind(f,i,r,t.ui,t.dataviz.ui):u.init(f.children()));n.element.css("display","none")},_id:function(){var n=this.element,i=n.attr("id")||"";this.id=k(n,"url")||"#"+i;this.id=="#"&&(this.id=t.guid(),n.attr("id",this.id))},_layout:function(){var t=i("content"),n=this.element;n.addClass("km-view");this.header=n.children(i("header")).addClass("km-header");this.footer=n.children(i("footer")).addClass("km-footer");n.children(t)[0]||n.wrapInner("<div "+h("role")+'="content"><\/div>');this.content=n.children(i("content")).addClass("km-content");this.element.prepend(this.header).append(this.footer);this.layout=this.options.getLayout(this.layout);this.layout&&this.layout.setup(this)},_overlay:function(){this.overlay=n(ct).appendTo(this.element)},_invokeNgController:function(){var i,t,r;this.options.$angular&&(i=this.element.controller(),t=this.options.$angular[0],i&&(r=n.proxy(this,"_callController",i,t),/^\$(digest|apply)$/.test(t.$$phase)?r():t.$apply(r)))},_callController:function(n,t){this.element.injector().invoke(n.constructor,n,{$scope:t})}}),at=f.extend({init:function(n,i){f.fn.init.call(this,n,i);n=this.element;this.header=n.children(this._locate("header")).addClass("km-header");this.footer=n.children(this._locate("footer")).addClass("km-footer");this.elements=this.header.add(this.footer);g(n);this.options.$angular||t.mobile.init(this.element.children());this.element.detach();this.trigger(e,{layout:this})},_locate:function(n){return this.options.$angular?d(n):i(n)},options:{name:"Layout",id:null,platform:null},events:[e,o,s],setup:function(n){n.header[0]||(n.header=this.header);n.footer[0]||(n.footer=this.footer)},detach:function(n){var t=this;n.header===t.header&&t.header[0]&&n.element.prepend(t.header.detach()[0].cloneNode(!0));n.footer===t.footer&&t.footer.length&&n.element.append(t.footer.detach()[0].cloneNode(!0))},attach:function(n){var t=this,r=t.currentView;r&&t.detach(r);n.header===t.header&&(t.header.detach(),n.element.children(i("header")).remove(),n.element.prepend(t.header));n.footer===t.footer&&(t.footer.detach(),n.element.children(i("footer")).remove(),n.element.append(t.footer));t.trigger(o,{layout:t,view:n});t.currentView=n}}),it=t.Observable,vt=/<body[^>]*>(([\u000a\u000d\u2028\u2029]|.)*)<\/body>/i,rt="loadStart",ut="loadComplete",ft="showStart",et="sameViewRequested",ot="viewShow",st="viewTypeDetermined",l="after",yt=it.extend({init:function(i){var r=this,e,o,u,f;if(it.fn.init.call(r),n.extend(r,i),r.sandbox=n("<div />"),u=r.container,e=r._hideViews(u),r.rootView=e.first(),!r.rootView[0]&&i.rootNeeded){o=u[0]==t.mobile.application.element[0]?'Your kendo mobile application element does not contain any direct child elements with data-role="view" attribute set. Make sure that you instantiate the mobile application using the correct container.':'Your pane element does not contain any direct child elements with data-role="view" attribute set.';throw new Error(o);}r.layouts={};r.viewContainer=new t.ViewContainer(r.container);r.viewContainer.bind("accepted",function(n){n.view.params=r.params});r.viewContainer.bind("complete",function(n){r.trigger(ot,{view:n.view})});r.viewContainer.bind(l,function(){r.trigger(l)});this.getLayoutProxy=n.proxy(this,"_getLayout");r._setupLayouts(u);f=u.children(r._locate("modalview drawer"));r.$angular?(r.$angular[0].viewOptions={defaultTransition:r.transition,loader:r.loader,container:r.container,getLayout:r.getLayoutProxy},f.each(function(t,r){c(n(r),i.$angular[0])})):tt(f);this.bind(this.events,i)},events:[ft,l,ot,rt,ut,et,st],destroy:function(){t.destroy(this.container);for(var n in this.layouts)this.layouts[n].destroy()},view:function(){return this.viewContainer.view},showView:function(n,i,r){if(n=n.replace(new RegExp("^"+this.remoteViewURLPrefix),""),n===""&&this.remoteViewURLPrefix&&(n="/"),n.replace(/^#/,"")===this.url)return this.trigger(et),!1;this.trigger(ft);var u=this,o=function(t){return u.viewContainer.show(t,i,n)},e=u._findViewElement(n),f=t.widgetInstance(e);return u.url=n.replace(/^#/,""),u.params=r,f&&f.reload&&(f.purge(),e=[]),this.trigger(st,{remote:e.length===0,url:n}),e[0]?(f||(f=u._createView(e)),o(f)):(this.serverNavigation?location.href=n:u._loadView(n,o),!0)},append:function(n,t){var i=this.sandbox,f=(t||"").split("?")[0],e=this.container,u,o,r;return vt.test(n)&&(n=RegExp.$1),i[0].innerHTML=n,e.append(i.children("script, style")),u=this._hideViews(i),r=u.first(),r.length||(u=r=i.wrapInner("<div data-role=view />").children()),f&&r.hide().attr(h("url"),f),this._setupLayouts(i),o=i.children(this._locate("modalview drawer")),e.append(i.children(this._locate("layout modalview drawer")).add(u)),tt(o),this._createView(r)},_locate:function(n){return this.$angular?d(n):i(n)},_findViewElement:function(n){var i,t=n.split("?")[0];return t?(i=this.container.children("["+h("url")+"='"+t+"']"),i[0]||t.indexOf("/")!==-1||(i=this.container.children(t.charAt(0)==="#"?t:"#"+t)),i):this.rootView},_createView:function(n){return this.$angular?c(n,this.$angular[0]):t.initWidget(n,{defaultTransition:this.transition,loader:this.loader,container:this.container,getLayout:this.getLayoutProxy,modelScope:this.modelScope,reload:k(n,"reload")},r.roles)},_getLayout:function(n){return n===""?null:n?this.layouts[n]:this.layouts[this.layout]},_loadView:function(i,r){this._xhr&&this._xhr.abort();this.trigger(rt);this._xhr=n.get(t.absoluteURL(i,this.remoteViewURLPrefix),"html").always(n.proxy(this,"_xhrComplete",r,i))},_xhrComplete:function(n,t,i){var r=!0;if(typeof i=="object"&&i.status===0)if(i.responseText&&i.responseText.length>0)r=!0,i=i.responseText;else return;this.trigger(ut);r&&n(this.append(i,t))},_hideViews:function(n){return n.children(this._locate("view splitview")).hide()},_setupLayouts:function(i){var e=this,f;i.children(e._locate("layout")).each(function(){f=e.$angular?c(n(this),e.$angular[0]):t.initWidget(n(this),{},r.roles);var i=f.options.platform;i&&i!==u.application.os.name?f.destroy():e.layouts[f.options.id]=f})}});t.mobile.ViewEngine=yt;r.plugin(lt);r.plugin(at)})(window.kendo.jQuery)}(),function(){(function(n){var t=window.kendo,i=t.mobile.ui,r=i.Widget,u=n.map(t.eventMap,function(n){return n}).join(" ").split(" "),f=r.extend({init:function(t,i){var u=this,f=n('<div class="km-loader"><span class="km-loading km-spin"><\/span><span class="km-loading-left"><\/span><span class="km-loading-right"><\/span><\/div>');r.fn.init.call(u,f,i);u.container=t;u.captureEvents=!1;u._attachCapture();f.append(u.options.loading).hide().appendTo(t)},options:{name:"Loader",loading:"<h1>Loading...<\/h1>",timeout:100},show:function(){var n=this;(clearTimeout(n._loading),n.options.loading!==!1)&&(n.captureEvents=!0,n._loading=setTimeout(function(){n.element.show()},n.options.timeout))},hide:function(){this.captureEvents=!1;clearTimeout(this._loading);this.element.hide()},changeMessage:function(n){this.options.loading=n;this.element.find(">h1").html(n)},transition:function(){this.captureEvents=!0;this.container.css("pointer-events","none")},transitionDone:function(){this.captureEvents=!1;this.container.css("pointer-events","")},_attachCapture:function(){function i(n){t.captureEvents&&n.preventDefault()}var t=this,n;for(t.captureEvents=!1,n=0;n<u.length;n++)t.container[0].addEventListener(u[n],i,!0)}});i.plugin(f)})(window.kendo.jQuery)}(),function(){(function(n){var t=window.kendo,u=t.mobile,i=t.roleSelector,r=u.ui,e=r.Widget,b=u.ViewEngine,l=r.View,k=u.ui.Loader,a="external",o="href",v="#!",y="navigate",p="viewShow",s="sameViewRequested",h=t.support.mobileOS,w=h.ios&&!h.appMode&&h.flatVersion>=700,d=/popover|actionsheet|modalview|drawer/,g="#:back",f=t.attrValue,c=e.extend({init:function(n,i){var r=this;e.fn.init.call(r,n,i);i=r.options;n=r.element;n.addClass("km-pane");r.options.collapsible&&n.addClass("km-collapsible-pane");this.history=[];this.historyCallback=function(n,t,i){var u=r.transition;return r.transition=null,w&&i&&(u="none"),r.viewEngine.showView(n,u,t)};this._historyNavigate=function(n){if(n===g){if(r.history.length===1)return;r.history.pop();n=r.history[r.history.length-1]}else r.history.push(n);r.historyCallback(n,t.parseQueryStringParams(n))};this._historyReplace=function(n){var i=t.parseQueryStringParams(n);r.history[r.history.length-1]=n;r.historyCallback(n,i)};r.loader=new k(n,{loading:r.options.loading});r.viewEngine=new b({container:n,transition:i.transition,modelScope:i.modelScope,rootNeeded:!i.initial,serverNavigation:i.serverNavigation,remoteViewURLPrefix:i.root||"",layout:i.layout,$angular:i.$angular,loader:r.loader,showStart:function(){r.loader.transition();r.closeActiveDialogs()},after:function(){r.loader.transitionDone()},viewShow:function(n){r.trigger(p,n)},loadStart:function(){r.loader.show()},loadComplete:function(){r.loader.hide()},sameViewRequested:function(){r.trigger(s)},viewTypeDetermined:function(n){n.remote&&r.options.serverNavigation||r.trigger(y,{url:n.url})}});this._setPortraitWidth();t.onResize(function(){r._setPortraitWidth()});r._setupAppLinks()},closeActiveDialogs:function(){var u=this.element.find(i("actionsheet popover modalview")).filter(":visible");u.each(function(){t.widgetInstance(n(this),r).close()})},navigateToInitial:function(){var n=this.options.initial;return n&&this.navigate(n),n},options:{name:"Pane",portraitWidth:"",transition:"",layout:"",collapsible:!1,initial:null,modelScope:window,loading:"<h1>Loading...<\/h1>"},events:[y,p,s],append:function(n){return this.viewEngine.append(n)},destroy:function(){e.fn.destroy.call(this);this.viewEngine.destroy();this.userEvents.destroy()},navigate:function(n,t){n instanceof l&&(n=n.id);this.transition=t;this._historyNavigate(n)},replace:function(n,t){n instanceof l&&(n=n.id);this.transition=t;this._historyReplace(n)},bindToRouter:function(n){var i=this,r=this.history,u=this.viewEngine;n.bind("init",function(i){var e=i.url,o=n.pushState?e:"/",f;u.rootView.attr(t.attr("url"),o);f=r.length;e==="/"&&f&&(n.navigate(r[f-1],!0),i.preventDefault())});n.bind("routeMissing",function(n){i.historyCallback(n.url,n.params,n.backButtonPressed)||n.preventDefault()});n.bind("same",function(){i.trigger(s)});i._historyNavigate=function(t){n.navigate(t)};i._historyReplace=function(t){n.replace(t)}},hideLoading:function(){this.loader.hide()},showLoading:function(){this.loader.show()},changeLoadingMessage:function(n){this.loader.changeMessage(n)},view:function(){return this.viewEngine.view()},_setPortraitWidth:function(){var n,i=this.options.portraitWidth;i&&(n=t.mobile.application.element.is(".km-vertical")?i:"auto",this.element.css("width",n))},_setupAppLinks:function(){var e=this,u="tab",r="[data-"+t.ns+"navigate-on-press]",f=n.map(["button","backbutton","detailbutton","listview-link"],function(n){return i(n)+":not("+r+")"}).join(",");this.element.handler(this).on("down",i(u)+","+r,"_mouseup").on("click",i(u)+","+f+","+r,"_appLinkClick");this.userEvents=new t.UserEvents(this.element,{filter:f,tap:function(n){n.event.currentTarget=n.touch.currentTarget;e._mouseup(n.event)}});this.element.css("-ms-touch-action","")},_appLinkClick:function(t){var i=n(t.currentTarget).attr("href"),r=i&&i[0]!=="#"&&this.options.serverNavigation;r||f(n(t.currentTarget),"rel")==a||t.preventDefault()},_mouseup:function(i){if(!(i.which>1)&&!i.isDefaultPrevented()){var c=this,e=n(i.currentTarget),y=f(e,"transition"),h=f(e,"rel")||"",l=f(e,"target"),s=e.attr(o),p=w&&e[0].offsetHeight===0,b=s&&s[0]!=="#"&&this.options.serverNavigation;p||b||h===a||typeof s=="undefined"||s===v||(e.attr(o,v),setTimeout(function(){e.attr(o,s)}),h.match(d)?(t.widgetInstance(n(s),r).openFor(e),(h==="actionsheet"||h==="drawer")&&i.stopPropagation()):(l==="_top"?c=u.application.pane:l&&(c=n("#"+l).data("kendoMobilePane")),c.navigate(s,y)),i.preventDefault())}}});c.wrap=function(n){n.is(i("view"))||(n=n.wrap("<div data-"+t.ns+'role="view" data-stretch="true"><\/div>').parent());var u=n.wrap('<div class="km-pane-wrapper"><div><\/div><\/div>').parent(),r=new c(u);return r.navigate(""),r};r.plugin(c)})(window.kendo.jQuery)}(),function(){(function(n){var r=window.kendo,s=r.mobile,i=s.ui,u="hide",f="open",e="close",h='<div class="km-popup-wrapper" />',c='<div class="km-popup-arrow" />',l='<div class="km-popup-overlay" />',a="km-up km-down km-left km-right",t=i.Widget,v={down:{origin:"bottom center",position:"top center"},up:{origin:"top center",position:"bottom center"},left:{origin:"center left",position:"center right",collision:"fit flip"},right:{origin:"center right",position:"center left",collision:"fit flip"}},y={animation:{open:{effects:"fade:in",duration:0},close:{effects:"fade:out",duration:400}}},p={horizontal:{offset:"top",size:"height"},vertical:{offset:"left",size:"width"}},w={up:"down",down:"up",left:"right",right:"left"},o=t.extend({init:function(i,f){var e=this,w=i.closest(".km-modalview-wrapper"),o=i.closest(".km-root").children(".km-pane").first(),s=w[0]?w:o,a,b;f.viewport?o=f.viewport:o[0]||(o=window);f.container?s=f.container:s[0]||(s=document.body);a={viewport:o,copyAnchorStyles:!1,autosize:!0,open:function(){e.overlay.show()},activate:n.proxy(e._activate,e),deactivate:function(){e.overlay.hide();e._apiCall||e.trigger(u);e._apiCall=!1}};t.fn.init.call(e,i,f);i=e.element;f=e.options;i.wrap(h).addClass("km-popup").show();b=e.options.direction.match(/left|right/)?"horizontal":"vertical";e.dimensions=p[b];e.wrapper=i.parent().css({width:f.width,height:f.height}).addClass("km-popup-wrapper km-"+f.direction).hide();e.arrow=n(c).prependTo(e.wrapper).hide();e.overlay=n(l).appendTo(s).hide();a.appendTo=e.overlay;f.className&&e.overlay.addClass(f.className);e.popup=new r.ui.Popup(e.wrapper,n.extend(!0,a,y,v[f.direction]))},options:{name:"Popup",width:240,height:"",direction:"down",container:null,viewport:null},events:[u],show:function(t){this.popup.options.anchor=n(t);this.popup.open()},hide:function(){this._apiCall=!0;this.popup.close()},destroy:function(){t.fn.destroy.call(this);this.popup.destroy();this.overlay.remove()},target:function(){return this.popup.options.anchor},_activate:function(){var t=this,e=t.options.direction,i=t.dimensions,u=i.offset,f=t.popup,o=f.options.anchor,c=n(o).offset(),l=n(f.element).offset(),v=f.flipped?w[e]:e,s=t.arrow[i.size]()*2,h=t.element[i.size]()-t.arrow[i.size](),y=n(o)[i.size](),r=c[u]-l[u]+y/2;r<s&&(r=s);r>h&&(r=h);t.wrapper.removeClass(a).addClass("km-"+v);t.arrow.css(u,r).show()}}),b=t.extend({init:function(u,f){var s=this,h;s.initialOpen=!1;t.fn.init.call(s,u,f);h=n.extend({className:"km-popover-root",hide:function(){s.trigger(e)}},this.options.popup);s.popup=new o(s.element,h);s.popup.overlay.on("move",function(n){n.target==s.popup.overlay[0]&&n.preventDefault()});s.pane=new i.Pane(s.element,n.extend(this.options.pane,{$angular:this.options.$angular}));r.notify(s,i)},options:{name:"PopOver",popup:{},pane:{}},events:[f,e],open:function(n){this.popup.show(n);this.initialOpen?this.pane.view()._invokeNgController():(this.pane.navigateToInitial()||this.pane.navigate(""),this.popup.popup._position(),this.initialOpen=!0)},openFor:function(n){this.open(n);this.trigger(f,{target:this.popup.target()})},close:function(){this.popup.hide()},destroy:function(){t.fn.destroy.call(this);this.pane.destroy();this.popup.destroy();r.destroy(this.element)}});i.plugin(o);i.plugin(b)})(window.kendo.jQuery)}(),function(){(function(n,t){var i=window.kendo,u=i.mobile.ui,e=i.ui.Popup,o='<div class="km-shim"/>',f="hide",r=u.Widget,s=r.extend({init:function(t,u){var s=this,h=i.mobile.application,y=i.support.mobileOS,l=h?h.os.name:y?y.name:"ios",a=l==="ios"||l==="wp"||(h?h.os.skin:!1),v=l==="blackberry",p=u.align||(a?"bottom center":v?"center right":"center center"),w=u.position||(a?"bottom center":v?"center right":"center center"),b=u.effect||(a?"slideIn:up":v?"slideIn:left":"fade:in"),c=n(o).handler(s).hide();if(r.fn.init.call(s,t,u),s.shim=c,t=s.element,u=s.options,u.className&&s.shim.addClass(u.className),!u.modal)s.shim.on("down","_hide");(h?h.element:n(document.body)).append(c);s.popup=new e(s.element,{anchor:c,modal:!0,appendTo:c,origin:p,position:w,animation:{open:{effects:b,duration:u.duration},close:{duration:u.duration}},close:function(n){var t=!1;s._apiCall||(t=s.trigger(f));t&&n.preventDefault();s._apiCall=!1},deactivate:function(){c.hide()},open:function(){c.show()}});i.notify(s)},events:[f],options:{name:"Shim",modal:!1,align:t,position:t,effect:t,duration:200},show:function(){this.popup.open()},hide:function(){this._apiCall=!0;this.popup.close()},destroy:function(){r.fn.destroy.call(this);this.shim.kendoDestroy();this.popup.destroy();this.shim.remove()},_hide:function(t){t&&n.contains(this.shim.children().children(".k-popup")[0],t.target)||this.popup.close()}});u.plugin(s)})(window.kendo.jQuery)}(),function(){(function(n){var t=window.kendo,h=t.support,i=t.mobile.ui,c=i.Shim,l=i.Popup,r=i.Widget,f="open",u="close",e="command",o="li>a",a="actionsheetContext",v='<div class="km-actionsheet-wrapper" />',s=t.template('<li class="km-actionsheet-cancel"><a href="\\#">#:cancel#<\/a><\/li>'),y=r.extend({init:function(u,f){var e=this,w,p,a,y=h.mobileOS;r.fn.init.call(e,u,f);f=e.options;a=f.type;u=e.element;p=a==="auto"?y&&y.tablet:a==="tablet";w=p?l:c;f.cancelTemplate&&(s=t.template(f.cancelTemplate));u.addClass("km-actionsheet").append(s({cancel:e.options.cancel})).wrap(v).on("up",o,"_click").on("click",o,t.preventDefault);if(e.view().bind("destroy",function(){e.destroy()}),e.wrapper=u.parent().addClass(a?" km-actionsheet-"+a:""),e.shim=new w(e.wrapper,n.extend({modal:y.ios&&y.majorVersion<7,className:"km-actionsheet-root"},e.options.popup)),e._closeProxy=n.proxy(e,"_close"),e._shimHideProxy=n.proxy(e,"_shimHide"),e.shim.bind("hide",e._shimHideProxy),p)t.onResize(e._closeProxy);t.notify(e,i)},events:[f,u,e],options:{name:"ActionSheet",cancel:"Cancel",type:"auto",popup:{height:"auto"}},open:function(t,i){var r=this;r.target=n(t);r.context=i;r.shim.show(t)},close:function(){this.context=this.target=null;this.shim.hide()},openFor:function(n){var t=this,i=n.data(a);t.open(n,i);t.trigger(f,{target:n,context:i})},destroy:function(){r.fn.destroy.call(this);t.unbindResize(this._closeProxy);this.shim.destroy()},_click:function(i){var u,r,f,o;i.isDefaultPrevented()||(u=n(i.currentTarget),r=u.data("action"),r&&(f={target:this.target,context:this.context},o=this.options.$angular,o?this.element.injector().get("$parse")(r)(o[0])(f):t.getter(r)(window)(f)),this.trigger(e,{target:this.target,context:this.context,currentTarget:u}),i.preventDefault(),this._close())},_shimHide:function(n){this.trigger(u)?n.preventDefault():this.context=this.target=null},_close:function(n){this.trigger(u)?n.preventDefault():this.close()}});i.plugin(y)})(window.kendo.jQuery)}(),function(){(function(n,t){var o=window.kendo,nt=o.ui,f=nt.Widget,u="horizontal",l="vertical",a="k-progressbar",tt="k-progressbar-reverse",s="k-progressbar-indeterminate",v="k-complete",y="k-state-selected",p="k-progress-status",h="k-state-selected",w="k-state-default",b="k-state-disabled",i={VALUE:"value",PERCENT:"percent",CHUNK:"chunk"},k="change",d="complete",it="boolean",r=Math,rt=n.extend,e=n.proxy,c=100,ut=400,ft=3,g={progressStatus:"<span class='k-progress-status-wrap'><span class='k-progress-status'><\/span><\/span>"},et=f.extend({init:function(n,t){var i=this;f.fn.init.call(this,n,t);t=i.options;i._progressProperty=t.orientation===u?"width":"height";i._fields();t.value=i._validateValue(t.value);i._validateType(t.type);i._wrapper();i._progressAnimation();t.value!==t.min&&t.value!==!1&&i._updateProgress()},setOptions:function(n){var t=this;f.fn.setOptions.call(t,n);n.hasOwnProperty("reverse")&&t.wrapper.toggleClass("k-progressbar-reverse",n.reverse);n.hasOwnProperty("enable")&&t.enable(n.enable);t._progressAnimation();t._validateValue();t._updateProgress()},events:[k,d],options:{name:"ProgressBar",orientation:u,reverse:!1,min:0,max:100,value:0,enable:!0,type:i.VALUE,chunkCount:5,showStatus:!0,animation:{}},_fields:function(){var t=this;t._isStarted=!1;t.progressWrapper=t.progressStatus=n()},_validateType:function(t){var r=!1;if(n.each(i,function(n,i){if(i===t)return r=!0,!1}),!r)throw new Error(o.format("Invalid ProgressBar type '{0}'",t));},_wrapper:function(){var t=this,r=t.wrapper=t.element,n=t.options,e=n.orientation,f;r.addClass("k-widget "+a);r.addClass(a+"-"+(e===u?u:l));n.enable===!1&&r.addClass(b);n.reverse&&r.addClass(tt);n.value===!1&&r.addClass(s);n.type===i.CHUNK?t._addChunkProgressWrapper():n.showStatus&&(t.progressStatus=t.wrapper.prepend(g.progressStatus).find("."+p),f=n.value!==!1?n.value:n.min,n.type===i.VALUE?t.progressStatus.text(f):t.progressStatus.text(t._calculatePercentage(f).toFixed()+"%"))},value:function(n){return this._value(n)},_value:function(n){var i=this,r=i.options,u;if(n===t)return r.value;typeof n!==it?(n=i._roundValue(n),isNaN(n)||(u=i._validateValue(n),u!==r.value&&(i.wrapper.removeClass(s),r.value=u,i._isStarted=!0,i._updateProgress()))):n||(i.wrapper.addClass(s),r.value=!1)},_roundValue:function(n){n=parseFloat(n);var t=r.pow(10,ft);return r.floor(n*t)/t},_validateValue:function(n){var i=this,t=i.options;if(n!==!1){if(n<=t.min||n===!0)return t.min;if(n>=t.max)return t.max}else if(n===!1)return!1;return isNaN(i._roundValue(n))?t.min:n},_updateProgress:function(){var n=this,t=n.options,r=n._calculatePercentage();t.type===i.CHUNK?(n._updateChunks(r),n._onProgressUpdateAlways(t.value)):n._updateProgressWrapper(r)},_updateChunks:function(n){var i=this,t=i.options,o=t.chunkCount,s=parseInt(c/o*100,10)/100,a=parseInt(n*100,10)/100,f=r.floor(a/s),e;e=t.orientation===u&&!t.reverse||t.orientation===l&&t.reverse?i.wrapper.find("li.k-item:lt("+f+")"):i.wrapper.find("li.k-item:gt(-"+(f+1)+")");i.wrapper.find("."+h).removeClass(h).addClass(w);e.removeClass(w).addClass(h)},_updateProgressWrapper:function(n){var t=this,i=t.options,u=t.wrapper.find("."+y),f=t._isStarted?t._animation.duration:0,r={};u.length===0&&t._addRegularProgressWrapper();r[t._progressProperty]=n+"%";t.progressWrapper.animate(r,{duration:f,start:e(t._onProgressAnimateStart,t),progress:e(t._onProgressAnimate,t),complete:e(t._onProgressAnimateComplete,t,i.value),always:e(t._onProgressUpdateAlways,t,i.value)})},_onProgressAnimateStart:function(){this.progressWrapper.show()},_onProgressAnimate:function(n){var t=this,r=t.options,f=parseFloat(n.elem.style[t._progressProperty],10),u;r.showStatus&&(u=1e4/parseFloat(t.progressWrapper[0].style[t._progressProperty]),t.progressWrapper.find(".k-progress-status-wrap").css(t._progressProperty,u+"%"));r.type!==i.CHUNK&&f<=98&&t.progressWrapper.removeClass(v)},_onProgressAnimateComplete:function(n){var t=this,u=t.options,e=parseFloat(t.progressWrapper[0].style[t._progressProperty]),f;u.type!==i.CHUNK&&e>98&&t.progressWrapper.addClass(v);u.showStatus&&(f=u.type===i.VALUE?n:u.type==i.PERCENT?t._calculatePercentage(n).toFixed()+"%":r.floor(t._calculatePercentage(n))+"%",t.progressStatus.text(f));n===u.min&&t.progressWrapper.hide()},_onProgressUpdateAlways:function(n){var t=this,i=t.options;t._isStarted&&t.trigger(k,{value:n});n===i.max&&t._isStarted&&t.trigger(d,{value:i.max})},enable:function(n){var t=this,i=t.options;i.enable=typeof n=="undefined"?!0:n;t.wrapper.toggleClass(b,!i.enable)},destroy:function(){var n=this;f.fn.destroy.call(n)},_addChunkProgressWrapper:function(){var n=this,t=n.options,u=n.wrapper,f=c/t.chunkCount,i="",r;for(t.chunkCount<=1&&(t.chunkCount=1),i+="<ul class='k-reset'>",r=t.chunkCount-1;r>=0;r--)i+="<li class='k-item k-state-default'><\/li>";i+="<\/ul>";u.append(i).find(".k-item").css(n._progressProperty,f+"%").first().addClass("k-first").end().last().addClass("k-last");n._normalizeChunkSize()},_normalizeChunkSize:function(){var n=this,u=n.options,t=n.wrapper.find(".k-item:last"),i=parseFloat(t[0].style[n._progressProperty]),r=c-u.chunkCount*i;r>0&&t.css(n._progressProperty,i+r+"%")},_addRegularProgressWrapper:function(){var t=this;t.progressWrapper=n("<div class='"+y+"'><\/div>").appendTo(t.wrapper);t.options.showStatus&&(t.progressWrapper.append(g.progressStatus),t.progressStatus=t.wrapper.find("."+p))},_calculateChunkSize:function(){var n=this,t=n.options.chunkCount,i=n.wrapper.find("ul.k-reset");return(parseInt(i.css(n._progressProperty),10)-(t-1))/t},_calculatePercentage:function(n){var i=this,u=i.options,e=n!==t?n:u.value,f=u.min,o=u.max;return i._onePercent=r.abs((o-f)/100),r.abs((e-f)/i._onePercent)},_progressAnimation:function(){var n=this,t=n.options,i=t.animation;n._animation=i===!1?{duration:0}:rt({duration:ut},t.animation)}});o.ui.plugin(et)})(window.kendo.jQuery)}(),function(){(function(n,t,i){"use strict";function g(){function n(){for(var r,u,e=0;e<arguments.length;++e)if(r=arguments[e],r===i)throw new Error("Cannot output undefined to PDF");else if(r instanceof it)r.beforeRender(n),r.render(n);else if(tt(r))ii(r,n);else if(ti(r))ri(r,n);else if(typeof r=="number"){if(isNaN(r))throw new Error("Cannot output NaN to PDF");u=r.toFixed(7);u.indexOf(".")>=0&&(u=u.replace(/\.?0+$/,""));u=="-0"&&(u="0");t.writeString(u)}else/string|boolean/.test(typeof r)?t.writeString(r+""):typeof r.get=="function"?t.write(r.get()):typeof r=="object"&&(r?n(new f(r)):t.writeString("null"))}var u=0,t=l();return n.writeData=function(n){t.write(n)},n.withIndent=function(t){++u;t(n);--u},n.indent=function(){n(r,at("",u*2,"  "));n.apply(null,arguments)},n.offset=function(){return t.offset()},n.toString=function(){throw new Error("FIX CALLER");},n.get=function(){return t.get()},n.stream=function(){return t},n}function kt(n,t){var i=n.beforeRender,r=n.render;n.beforeRender=function(){};n.render=function(n){n(t," 0 R")};n.renderFull=function(u){n._offset=u.offset();u(t," 0 obj ");i.call(n,u);r.call(n,u);u(" endobj")}}function ot(n){var i=n("paperSize",et.a4),t;if(!i)return{};if(typeof i=="string"&&(i=et[i.toLowerCase()],i==null))throw new Error("Unknown paper size");return i[0]=p(i[0]),i[1]=p(i[1]),n("landscape",!1)&&(i=[Math.max(i[0],i[1]),Math.min(i[0],i[1])]),t=n("margin"),t&&(typeof t=="string"||typeof t=="number"?(t=p(t,0),t={left:t,top:t,right:t,bottom:t}):t={left:p(t.left,0),top:p(t.top,0),right:p(t.right,0),bottom:p(t.bottom,0)},n("addMargin")&&(i[0]+=t.left+t.right,i[1]+=t.top+t.bottom)),{paperSize:i,margin:t}}function st(n){function e(t,i){return n&&n[t]!=null?n[t]:i}var t=this,i=g(),a=0,u=[],l,s;t.getOption=e;t.attach=function(n){return u.indexOf(n)<0&&(kt(n,++a),u.push(n)),n};t.pages=[];t.FONTS={};t.IMAGES={};t.GRAD_COL_FUNCTIONS={};t.GRAD_OPC_FUNCTIONS={};t.GRAD_COL={};t.GRAD_OPC={};l=t.attach(new oi);s=t.attach(new si);l.setPages(s);t.addPage=function(n){var f=ot(function(t,i){return n&&n[t]!=null?n[t]:i}),u=f.paperSize,i=f.margin,e=u[0],o=u[1];i&&(e-=i.left+i.right,o-=i.top+i.bottom);var h=new c(g(),null,!0),l={Contents:t.attach(h),Parent:s,MediaBox:[0,0,u[0],u[1]]},r=new wt(t,l);return r._content=h,s.addPage(t.attach(r)),r.transform(1,0,0,-1,0,u[1]),i&&(r.translate(i.left,i.top),r.rect(0,0,e,o),r.clip()),t.pages.push(r),r};t.render=function(){var n,t;for(i("%PDF-1.4",r,"%ÂÁÚÏÎ",r,r),n=0;n<u.length;++n)u[n].renderFull(i),i(r,r);for(t=i.offset(),i("xref",r,0," ",u.length+1,r),i("0000000000 65535 f ",r),n=0;n<u.length;++n)i(o(u[n]._offset,10)," 00000 n ",r);return i(r),i("trailer",r),i(new f({Size:u.length+1,Root:l,Info:new f({Producer:new h(e("producer","Kendo UI PDF Generator")),Title:new h(e("title","")),Author:new h(e("author","")),Subject:new h(e("subject","")),Keywords:new h(e("keywords","")),Creator:new h(e("creator","Kendo UI PDF Generator")),CreationDate:e("date",new Date)})}),r,r),i("startxref",r,t,r),i("%%EOF",r),i.stream().offset(0)}}function dt(t,i){function u(){n.console&&(n.console.error?n.console.error("Cannot load URL: %s",t):n.console.log("Cannot load URL: %s",t));i(null)}var r=new XMLHttpRequest;r.open("GET",t,!0);v&&(r.responseType="arraybuffer");r.onload=function(){r.status==200||r.status==304?v?i(new Uint8Array(r.response)):i(new VBArray(r.responseBody).toArray()):u()};r.onerror=u;r.send(null)}function gt(n,t){var i=nt[n];i?t(i):dt(n,function(i){if(i==null)throw new Error("Cannot load font from "+n);else{var r=new d.pdf.TTFFont(i);nt[n]=r;t(r)}})}function ni(n,t){function o(n){i.src=n;i.complete&&!d.support.browser.msie?s():(i.onload=s,i.onerror=e)}function e(){t(w[n]="TAINTED")}function s(){var v,r,y,b,p,h,a;if(f&&/^image\/jpe?g$/i.test(f.type)){v=new FileReader;v.onload=function(){i=new pt(i.width,i.height,l(new Uint8Array(this.result)));URL.revokeObjectURL(u);t(w[n]=i)};v.readAsArrayBuffer(f);return}r=document.createElement("canvas");r.width=i.width;r.height=i.height;y=r.getContext("2d");y.drawImage(i,0,0);try{b=y.getImageData(0,0,i.width,i.height)}catch(g){return e()}finally{u&&URL.revokeObjectURL(u)}for(var k=!1,c=l(),d=l(),o=b.data,s=0;s<o.length;)c.writeByte(o[s++]),c.writeByte(o[s++]),c.writeByte(o[s++]),p=o[s++],p<255&&(k=!0),d.writeByte(p);k?i=new hi(i.width,i.height,c,d):(h=r.toDataURL("image/jpeg"),h=h.substr(h.indexOf(";base64,")+8),a=l(),a.writeBase64(h),a.offset(0),i=new pt(i.width,i.height,a));t(w[n]=i)}var i=w[n],u,f,r;i?t(i):(i=new Image,/^data:/i.test(n)||(i.crossOrigin="Anonymous"),v&&!/^data:/i.test(n)?(r=new XMLHttpRequest,r.onload=function(){f=r.response;u=URL.createObjectURL(f);o(u)},r.onerror=e,r.open("GET",n,!0),r.responseType="blob",r.send()):o(n))}function ht(n){return function(t,i){var r=t.length,u=r;if(r===0)return i();while(u-->0)n(t[u],function(){--r==0&&i()})}}function at(n,t,i){while(n.length<t)n=i+n;return n}function o(n,t){return at(n+"",t,"0")}function k(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function ti(n){return n instanceof Date}function ii(n,t){t("[");n.length>0&&t.withIndent(function(){for(var i=0;i<n.length;++i)i>0&&i%8==0?t.indent(n[i]):t(" ",n[i])});t(" ]")}function ri(n,t){t("(D:",o(n.getUTCFullYear(),4),o(n.getUTCMonth()+1,2),o(n.getUTCDate(),2),o(n.getUTCHours(),2),o(n.getUTCMinutes(),2),o(n.getUTCSeconds(),2),"Z)")}function vt(n){return n*(72/25.4)}function ui(n){return vt(n*10)}function fi(n){return n*72}function p(n,i){var r,u;if(typeof n=="number")return n;if(typeof n=="string"&&(r=/^\s*([0-9.]+)\s*(mm|cm|in|pt)\s*$/.exec(n),r&&(u=t(r[1]),!isNaN(u))))return r[2]=="pt"?u:{mm:vt,cm:ui,"in":fi}[r[2]](u);if(i!=null)return i;throw new Error("Can't parse unit: "+n);}function it(){}function s(n,t,i){i||(i=it);n.prototype=new i;for(var r in t)k(t,r)&&(n.prototype[r]=t[r]);return n}function u(n){return k(rt,n)?rt[n]:rt[n]=new yt(n)}function pt(n,t,i){this.asStream=function(){var r=new c(i,{Type:u("XObject"),Subtype:u("Image"),Width:n,Height:t,BitsPerComponent:8,ColorSpace:u("DeviceRGB"),Filter:u("DCTDecode")});return r._resourceName=u("I"+ ++y),r}}function hi(n,t,i,r){this.asStream=function(f){var o=new c(r,{Type:u("XObject"),Subtype:u("Image"),Width:n,Height:t,BitsPerComponent:8,ColorSpace:u("DeviceGray")},!0),e=new c(i,{Type:u("XObject"),Subtype:u("Image"),Width:n,Height:t,BitsPerComponent:8,ColorSpace:u("DeviceRGB"),SMask:f.attach(o)},!0);return e._resourceName=u("I"+ ++y),e}}function b(n){return n.map(function(n){return tt(n)?b(n):typeof n=="number"?(Math.round(n*1e3)/1e3).toFixed(3):n}).join(" ")}function ai(n,t,i,r,u,e,o){var h=b([t,i,r,u,e,o]),s=n.GRAD_COL_FUNCTIONS[h];return s||(s=n.GRAD_COL_FUNCTIONS[h]=n.attach(new f({FunctionType:2,Domain:[0,1],Range:[0,1,0,1,0,1],N:1,C0:[t,i,r],C1:[u,e,o]}))),s}function vi(n,t,i){var u=b([t,i]),r=n.GRAD_OPC_FUNCTIONS[u];return r||(r=n.GRAD_OPC_FUNCTIONS[u]=n.attach(new f({FunctionType:2,Domain:[0,1],Range:[0,1],N:1,C0:[t],C1:[i]}))),r}function yi(n,t){function a(n){return n.length==1?n[0]:{FunctionType:3,Functions:n,Domain:[0,1],Bounds:s,Encode:l}}for(var e=!1,h=[],c=[],s=[],l=[],o,f,r,u,i=1;i<t.length;++i)o=t[i-1],f=t[i],r=o.color,u=f.color,c.push(ai(n,r.r,r.g,r.b,u.r,u.g,u.b)),(r.a<1||u.a<1)&&(e=!0),s.push(f.offset),l.push(0,1);if(e)for(i=1;i<t.length;++i)o=t[i-1],f=t[i],r=o.color,u=f.color,h.push(vi(n,r.a,u.a));return s.pop(),{hasAlpha:e,colors:a(c),opacities:e?a(h):null}}function pi(n,t,i,r,e,o){var s,h,c;return o||(c=[t].concat(r),i.forEach(function(n){c.push(n.offset,n.color.r,n.color.g,n.color.b)}),h=b(c),s=n.GRAD_COL[h]),s||(s=new f({Type:u("Shading"),ShadingType:t?3:2,ColorSpace:u("DeviceRGB"),Coords:r,Domain:[0,1],Function:e,Extend:[!0,!0]}),n.attach(s),s._resourceName="S"+ ++y,h&&(n.GRAD_COL[h]=s)),s}function wi(n,t,i,r,e,o){var s,h,l;return o||(l=[t].concat(r),i.forEach(function(n){l.push(n.offset,n.color.a)}),h=b(l),s=n.GRAD_OPC[h]),s||(s=new f({Type:u("ExtGState"),AIS:!1,CA:1,ca:1,SMask:{Type:u("Mask"),S:u("Luminosity"),G:n.attach(new c("/a0 gs /s0 sh",{Type:u("XObject"),Subtype:u("Form"),FormType:1,BBox:o?[o.left,o.top+o.height,o.left+o.width,o.top]:[0,1,1,0],Group:{Type:u("Group"),S:u("Transparency"),CS:u("DeviceGray"),I:!0},Resources:{ExtGState:{a0:{CA:1,ca:1}},Shading:{s0:{ColorSpace:u("DeviceGray"),Coords:r,Domain:[0,1],ShadingType:t?3:2,Function:e,Extend:[!0,!0]}}}}))}}),n.attach(s),s._resourceName="O"+ ++y,h&&(n.GRAD_OPC[h]=s)),s}function bi(n,t,i){var u=t.type=="radial",r=yi(n,t.stops),f=u?[t.start.x,t.start.y,t.start.r,t.end.x,t.end.y,t.end.r]:[t.start.x,t.start.y,t.end.x,t.end.y],e=pi(n,u,t.stops,f,r.colors,t.userSpace&&i),o=r.hasAlpha?wi(n,u,t.stops,f,r.opacities,t.userSpace&&i):null;return{hasAlpha:r.hasAlpha,shading:e,opacity:o}}function l(t){function nt(){return i>=r}function f(){return i<r?t[i++]:0}function u(n){l(i);t[i++]=n&255;i>r&&(r=i)}function e(){return f()<<8|f()}function o(n){u(n>>8);u(n)}function tt(){var n=e();return n>=32768?n-65536:n}function it(n){o(n<0?n+65536:n)}function h(){return e()*65536+e()}function c(n){o(n>>>16&65535);o(n&65535)}function p(){var n=h();return n>=2147483648?n-4294967296:n}function w(n){c(n<0?n+4294967296:n)}function rt(){return h()/65536}function ut(n){c(Math.round(n*65536))}function et(){return p()/65536}function ot(n){w(Math.round(n*65536))}function b(n){return k(n,f)}function st(n){return String.fromCharCode.apply(String,b(n))}function s(n){for(var t=0;t<n.length;++t)u(n.charCodeAt(t))}function k(n,t){for(var r=new Array(n),i=0;i<n;++i)r[i]=t();return r}var i=0,r=0,d;t==null?t=v?new Uint8Array(256):[]:r=t.length;var l=v?function(n){if(n>=t.length){var i=new Uint8Array(Math.max(n+256,t.length*2));i.set(t,0);t=i}}:function(){},a=v?function(){return new Uint8Array(t.buffer,0,r)}:function(){return t},y=v?function(n){if(typeof n=="string")return s(n);var u=n.length;l(i+u);t.set(n,i);i+=u;i>r&&(r=i)}:function(n){if(typeof n=="string")return s(n);for(var t=0;t<n.length;++t)u(n[t])},g=v?function(n,i){if(t.buffer.slice)return new Uint8Array(t.buffer.slice(n,n+i));var r=new Uint8Array(i);return r.set(new Uint8Array(t.buffer,n,i)),r}:function(n,i){return t.slice(n,n+i)};return d={eof:nt,readByte:f,writeByte:u,readShort:e,writeShort:o,readLong:h,writeLong:c,readFixed:rt,writeFixed:ut,readShort_:tt,writeShort_:it,readLong_:p,writeLong_:w,readFixed_:et,writeFixed_:ot,read:b,write:y,readString:st,writeString:s,times:k,get:a,slice:g,offset:function(n){return n!=null?(i=n,d):i},skip:function(n){i+=n},toString:function(){throw new Error("FIX CALLER.  BinaryStream is no longer convertible to string!");},length:function(){return r},saveExcursion:function(n){var t=i;try{return n()}finally{i=t}},writeBase64:function(t){n.atob?s(n.atob(t)):y(ft.decode(t))},base64:function(){return ft.encode(a())}}}function ki(n){return n.replace(/^\s*(['"])(.*)\1\s*$/,"$2")}function di(n){var t=/^\s*((normal|italic)\s+)?((normal|small-caps)\s+)?((normal|bold|\d+)\s+)?(([0-9.]+)(px|pt))(\/(([0-9.]+)(px|pt)|normal))?\s+(.*?)\s*$/i.exec(n),i;return t?(i=t[8]?parseInt(t[8],10):12,{italic:t[2]&&t[2].toLowerCase()=="italic",variant:t[4],bold:t[6]&&/bold|700/i.test(t[6]),fontSize:i,lineHeight:t[12]?t[12]=="normal"?i:parseInt(t[12],10):null,fontFamily:t[14].split(/\s*,\s*/g).map(ki)}):{fontSize:12,fontFamily:"sans-serif"}}function gi(n){function f(t){return n.bold&&(t+="|bold"),n.italic&&(t+="|italic"),t.toLowerCase()}var i=n.fontFamily,u,t,r;if(i instanceof Array){for(r=0;r<i.length;++r)if(u=f(i[r]),t=e[u],t)break}else t=e[i.toLowerCase()];while(typeof t=="function")t=t();return t||(t="Times-Roman"),t}function a(n,t){n=n.toLowerCase();e[n]=function(){return e[t]};e[n+"|bold"]=function(){return e[t+"|bold"]};e[n+"|italic"]=function(){return e[t+"|italic"]};e[n+"|bold|italic"]=function(){return e[t+"|bold|italic"]}}function bt(n,t){if(arguments.length==1)for(var i in n)k(n,i)&&bt(i,n[i]);else{n=n.toLowerCase();e[n]=t;switch(n){case"dejavu sans":e["sans-serif"]=t;break;case"dejavu sans|bold":e["sans-serif|bold"]=t;break;case"dejavu sans|italic":e["sans-serif|italic"]=t;break;case"dejavu sans|bold|italic":e["sans-serif|bold|italic"]=t;break;case"dejavu serif":e.serif=t;break;case"dejavu serif|bold":e["serif|bold"]=t;break;case"dejavu serif|italic":e["serif|italic"]=t;break;case"dejavu serif|bold|italic":e["serif|bold|italic"]=t;break;case"dejavu mono":e.monospace=t;break;case"dejavu mono|bold":e["monospace|bold"]=t;break;case"dejavu mono|italic":e["monospace|italic"]=t;break;case"dejavu mono|bold|italic":e["monospace|bold|italic"]=t}}}function nr(n,t){var e=n[0],o=n[1],s=n[2],h=n[3],c=n[4],l=n[5],i=t[0],r=t[1],u=t[2],f=t[3],a=t[4],v=t[5];return[e*i+o*u,e*r+o*f,s*i+h*u,s*r+h*f,c*i+l*u+a,c*r+l*f+v]}function tr(n){return n[0]===1&&n[1]===0&&n[2]===0&&n[3]===1&&n[4]===0&&n[5]===0}var d=n.kendo,v=!!n.Uint8Array,r="\n",y=0,ft=function(){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return{decode:function(t){for(var i=t.replace(/[^A-Za-z0-9\+\/\=]/g,""),r=0,s=i.length,u=[];r<s;){var h=n.indexOf(i.charAt(r++)),e=n.indexOf(i.charAt(r++)),f=n.indexOf(i.charAt(r++)),o=n.indexOf(i.charAt(r++)),c=h<<2|e>>>4,l=(e&15)<<4|f>>>2,a=(f&3)<<6|o;u.push(c);f!=64&&u.push(l);o!=64&&u.push(a)}return u},encode:function(t){for(var i=0,r=t.length,f="";i<r;){var e=t[i++],o=t[i++],s=t[i++],c=e>>>2,l=(e&3)<<4|o>>>4,h=(o&15)<<2|s>>>6,u=s&63;i-r==2?h=u=64:i-r==1&&(u=64);f+=n.charAt(c)+n.charAt(l)+n.charAt(h)+n.charAt(u)}return f}}}(),et={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],executive:[521.86,756],folio:[612,936],legal:[612,1008],letter:[612,792],tabloid:[792,1224]},nt={"Times-Roman":!0,"Times-Bold":!0,"Times-Italic":!0,"Times-BoldItalic":!0,Helvetica:!0,"Helvetica-Bold":!0,"Helvetica-Oblique":!0,"Helvetica-BoldOblique":!0,Courier:!0,"Courier-Bold":!0,"Courier-Oblique":!0,"Courier-BoldOblique":!0,Symbol:!0,ZapfDingbats:!0},w={},ct=ht(gt),lt=ht(ni),tt,wt,e;st.prototype={loadFonts:ct,loadImages:lt,getFont:function(n){var t=this.FONTS[n];if(!t){if(t=nt[n],!t)throw new Error("Font "+n+" has not been loaded");t=t===!0?this.attach(new ci(n)):this.attach(new ut(this,t));this.FONTS[n]=t}return t},getImage:function(n){var t=this.IMAGES[n];if(!t){if(t=w[n],!t)throw new Error("Image "+n+" has not been loaded");if(t==="TAINTED")return null;t=this.IMAGES[n]=this.attach(t.asStream(this))}return t},getOpacityGS:function(n,i){var e=t(n).toFixed(3),s,r,o;return n=t(e),e+=i?"S":"F",s=this._opacityGSCache||(this._opacityGSCache={}),r=s[e],r||(o={Type:u("ExtGState")},i?o.CA=n:o.ca=n,r=this.attach(new f(o)),r._resourceName=u("GS"+ ++y),s[e]=r),r},dict:function(n){return new f(n)},name:function(n){return u(n)},stream:function(n,t){return new c(t,n)}};tt=Array.isArray||function(n){return n instanceof Array};it.prototype.beforeRender=function(){};var h=s(function(n){this.value=n},{render:function(n){for(var i="",r=this.escape(),t=0;t<r.length;++t)i+=String.fromCharCode(r.charCodeAt(t)&255);n("(",i,")")},escape:function(){return this.value.replace(/([\(\)\\])/g,"\\$1")},toString:function(){return this.value}}),ei=s(function(n){this.value=n},{render:function(n){n("<");for(var t=0;t<this.value.length;++t)n(o(this.value.charCodeAt(t).toString(16),4));n(">")}},h),yt=s(function(n){this.name=n},{render:function(n){n("/"+this.escape())},escape:function(){return this.name.replace(/[^\x21-\x7E]/g,function(n){return"#"+o(n.charCodeAt(0).toString(16),2)})},toString:function(){return this.name}}),rt={};yt.get=u;var f=s(function(n){this.props=n},{render:function(n){var t=this.props,i=!0;n("<<");n.withIndent(function(){for(var r in t)k(t,r)&&!/^_/.test(r)&&(i=!1,n.indent(u(r)," ",t[r]))});i||n.indent();n(">>")}}),c=s(function(n,t,i){if(typeof n=="string"){var r=l();r.write(n);n=r}this.data=n;this.props=t||{};this.compress=i},{render:function(t){var e=this.data.get(),i=this.props;this.compress&&n.pako&&typeof n.pako.deflate=="function"&&(i.Filter?i.Filter instanceof Array||(i.Filter=[i.Filter]):i.Filter=[],i.Filter.unshift(u("FlateDecode")),e=n.pako.deflate(e));i.Length=e.length;t(new f(i)," stream",r);t.writeData(e);t(r,"endstream")}}),oi=s(function(n){n=this.props=n||{};n.Type=u("Catalog")},{setPages:function(n){this.props.Pages=n}},f),si=s(function(){this.props={Type:u("Pages"),Kids:[],Count:0}},{addPage:function(n){this.props.Kids.push(n);this.props.Count++}},f);var ci=s(function(n){this.props={Type:u("Font"),Subtype:u("Type1"),BaseFont:u(n)};this._resourceName=u("F"+ ++y)},{encodeText:function(n){return new h(n+"")}},f),ut=s(function(n,t,i){var f,r;i=this.props=i||{};i.Type=u("Font");i.Subtype=u("Type0");i.Encoding=u("Identity-H");this._pdf=n;this._font=t;this._sub=t.makeSubset();this._resourceName=u("F"+ ++y);f=t.head;this.name=t.psName;r=this.scale=t.scale;this.bbox=[f.xMin*r,f.yMin*r,f.xMax*r,f.yMax*r];this.italicAngle=t.post.italicAngle;this.ascent=t.ascent*r;this.descent=t.descent*r;this.lineGap=t.lineGap*r;this.capHeight=t.os2.capHeight||this.ascent;this.xHeight=t.os2.xHeight||0;this.stemV=0;this.familyClass=(t.os2.familyClass||0)>>8;this.isSerif=this.familyClass>=1&&this.familyClass<=7;this.isScript=this.familyClass==10;this.flags=(t.post.isFixedPitch?1:0)|(this.isSerif?2:0)|(this.isScript?8:0)|(this.italicAngle!==0?64:0)|32},{encodeText:function(n){return new ei(this._sub.encodeText(n+""))},getTextWidth:function(n,t){for(var u,r=0,f=this._font.cmap.getUnicodeEntry().codeMap,i=0;i<t.length;++i)u=f[t.charCodeAt(i)],r+=this._font.widthOfGlyph(u||0);return r*n/1e3},beforeRender:function(){var n=this,t=n._sub,s=t.render(),w=new c(l(s),{Length1:s.length},!0),b=n._pdf.attach(new f({Type:u("FontDescriptor"),FontName:u(n._sub.psName),FontBBox:n.bbox,Flags:n.flags,StemV:n.stemV,ItalicAngle:n.italicAngle,Ascent:n.ascent,Descent:n.descent,CapHeight:n.capHeight,XHeight:n.xHeight,FontFile2:n._pdf.attach(w)})),k=t.ncid2ogid,r=t.firstChar,e=t.lastChar,a=[],y,i,p,o;(function v(t,i){if(t<=e){var r=k[t];r==null?v(t+1):(i||a.push(t,i=[]),i.push(n._font.widthOfGlyph(r)),v(t+1,i))}})(r);y=new f({Type:u("Font"),Subtype:u("CIDFontType2"),BaseFont:u(n._sub.psName),CIDSystemInfo:new f({Registry:new h("Adobe"),Ordering:new h("Identity"),Supplement:0}),FontDescriptor:b,FirstChar:r,LastChar:e,DW:Math.round(n._font.widthOfGlyph(0)),W:a,CIDToGIDMap:n._pdf.attach(n._makeCidToGidMap())});i=n.props;i.BaseFont=u(n._sub.psName);i.DescendantFonts=[n._pdf.attach(y)];p=new li(r,e,t.subset);o=new c(g(),null,!0);o.data(p);i.ToUnicode=n._pdf.attach(o)},_makeCidToGidMap:function(){return new c(l(this._sub.cidToGidMap()),null,!0)}},f),li=s(function(n,t,i){this.firstChar=n;this.lastChar=t;this.map=i},{render:function(n){n.indent("/CIDInit /ProcSet findresource begin");n.indent("12 dict begin");n.indent("begincmap");n.indent("/CIDSystemInfo <<");n.indent("  /Registry (Adobe)");n.indent("  /Ordering (UCS)");n.indent("  /Supplement 0");n.indent(">> def");n.indent("/CMapName /Adobe-Identity-UCS def");n.indent("/CMapType 2 def");n.indent("1 begincodespacerange");n.indent("  <0000><ffff>");n.indent("endcodespacerange");var t=this;n.indent(t.lastChar-t.firstChar+1," beginbfchar");n.withIndent(function(){for(var r,i=t.firstChar;i<=t.lastChar;++i)r=t.map[i],n.indent("<",o(i.toString(16),4),">","<",o(r.toString(16),4),">")});n.indent("endbfchar");n.indent("endcmap");n.indent("CMapName currentdict /CMap defineresource pop");n.indent("end");n.indent("end")}});wt=s(function(n,t){this._pdf=n;this._rcount=0;this._textMode=!1;this._fontResources={};this._gsResources={};this._xResources={};this._patResources={};this._shResources={};this._opacity=1;this._matrix=[1,0,0,1,0,0];this._annotations=[];this._font=null;this._fontSize=null;this._contextStack=[];t=this.props=t||{};t.Type=u("Page");t.ProcSet=[u("PDF"),u("Text"),u("ImageB"),u("ImageC"),u("ImageI")];t.Resources=new f({Font:new f(this._fontResources),ExtGState:new f(this._gsResources),XObject:new f(this._xResources),Pattern:new f(this._patResources),Shading:new f(this._shResources)});t.Annots=this._annotations},{_out:function(){this._content.data.apply(null,arguments)},transform:function(n,t,i,u,f,e){tr(arguments)||(this._matrix=nr(arguments,this._matrix),this._out(n," ",t," ",i," ",u," ",f," ",e," cm"),this._out(r))},translate:function(n,t){this.transform(1,0,0,1,n,t)},scale:function(n,t){this.transform(n,0,0,t,0,0)},rotate:function(n){var t=Math.cos(n),i=Math.sin(n);this.transform(t,i,-i,t,0,0)},beginText:function(){this._textMode=!0;this._out("BT",r)},endText:function(){this._textMode=!1;this._out("ET",r)},_requireTextMode:function(){if(!this._textMode)throw new Error("Text mode required; call page.beginText() first");},_requireFont:function(){if(!this._font)throw new Error("No font selected; call page.setFont() first");},setFont:function(n,t){this._requireTextMode();n==null?n=this._font:n instanceof ut||(n=this._pdf.getFont(n));t==null&&(t=this._fontSize);this._fontResources[n._resourceName]=n;this._font=n;this._fontSize=t;this._out(n._resourceName," ",t," Tf",r)},setTextLeading:function(n){this._requireTextMode();this._out(n," TL",r)},setTextRenderingMode:function(n){this._requireTextMode();this._out(n," Tr",r)},showText:function(n,t){if(this._requireFont(),n.length>1&&t&&this._font instanceof ut){var i=this._font.getTextWidth(this._fontSize,n),u=t/i*100;this._out(u," Tz ")}this._out(this._font.encodeText(n)," Tj",r)},showTextNL:function(n){this._requireFont();this._out(this._font.encodeText(n)," '",r)},addLink:function(n,t){var i=this._toPage({x:t.left,y:t.bottom}),r=this._toPage({x:t.right,y:t.top});this._annotations.push(new f({Type:u("Annot"),Subtype:u("Link"),Rect:[i.x,i.y,r.x,r.y],Border:[0,0,0],A:new f({Type:u("Action"),S:u("URI"),URI:new h(n)})}))},setStrokeColor:function(n,t,i){this._out(n," ",t," ",i," RG",r)},setOpacity:function(n){this.setFillOpacity(n);this.setStrokeOpacity(n);this._opacity*=n},setStrokeOpacity:function(n){if(n<1){var t=this._pdf.getOpacityGS(this._opacity*n,!0);this._gsResources[t._resourceName]=t;this._out(t._resourceName," gs",r)}},setFillColor:function(n,t,i){this._out(n," ",t," ",i," rg",r)},setFillOpacity:function(n){if(n<1){var t=this._pdf.getOpacityGS(this._opacity*n,!1);this._gsResources[t._resourceName]=t;this._out(t._resourceName," gs",r)}},gradient:function(n,t){this.save();this.rect(t.left,t.top,t.width,t.height);this.clip();n.userSpace||this.transform(t.width,0,0,t.height,t.left,t.top);var i=bi(this._pdf,n,t),f=i.shading._resourceName,u;this._shResources[f]=i.shading;i.hasAlpha&&(u=i.opacity._resourceName,this._gsResources[u]=i.opacity,this._out("/"+u+" gs "));this._out("/"+f+" sh",r);this.restore()},setDashPattern:function(n,t){this._out(n," ",t," d",r)},setLineWidth:function(n){this._out(n," w",r)},setLineCap:function(n){this._out(n," J",r)},setLineJoin:function(n){this._out(n," j",r)},setMitterLimit:function(n){this._out(n," M",r)},save:function(){this._contextStack.push(this._context());this._out("q",r)},restore:function(){this._out("Q",r);this._context(this._contextStack.pop())},moveTo:function(n,t){this._out(n," ",t," m",r)},lineTo:function(n,t){this._out(n," ",t," l",r)},bezier:function(n,t,i,u,f,e){this._out(n," ",t," ",i," ",u," ",f," ",e," c",r)},bezier1:function(n,t,i,u){this._out(n," ",t," ",i," ",u," y",r)},bezier2:function(n,t,i,u){this._out(n," ",t," ",i," ",u," v",r)},close:function(){this._out("h",r)},rect:function(n,t,i,u){this._out(n," ",t," ",i," ",u," re",r)},ellipse:function(n,t,i,r){function u(t){return n+t}function f(n){return t+n}var e=.55228474983079356;this.moveTo(u(0),f(r));this.bezier(u(i*e),f(r),u(i),f(r*e),u(i),f(0));this.bezier(u(i),f(-r*e),u(i*e),f(-r),u(0),f(-r));this.bezier(u(-i*e),f(-r),u(-i),f(-r*e),u(-i),f(0));this.bezier(u(-i),f(r*e),u(-i*e),f(r),u(0),f(r))},circle:function(n,t,i){this.ellipse(n,t,i,i)},stroke:function(){this._out("S",r)},nop:function(){this._out("n",r)},clip:function(){this._out("W n",r)},clipStroke:function(){this._out("W S",r)},closeStroke:function(){this._out("s",r)},fill:function(){this._out("f",r)},fillStroke:function(){this._out("B",r)},drawImage:function(n){var t=this._pdf.getImage(n);t&&(this._xResources[t._resourceName]=t,this._out(t._resourceName," Do",r))},comment:function(n){var t=this;n.split(/\r?\n/g).forEach(function(n){t._out("% ",n,r)})},_context:function(n){if(n!=null)this._opacity=n.opacity,this._matrix=n.matrix;else return{opacity:this._opacity,matrix:this._matrix}},_toPage:function(n){var t=this._matrix,i=t[0],r=t[1],u=t[2],f=t[3],e=t[4],o=t[5];return{x:i*n.x+u*n.y+e,y:r*n.x+f*n.y+o}}},f);e={serif:"Times-Roman","serif|bold":"Times-Bold","serif|italic":"Times-Italic","serif|bold|italic":"Times-BoldItalic","sans-serif":"Helvetica","sans-serif|bold":"Helvetica-Bold","sans-serif|italic":"Helvetica-Oblique","sans-serif|bold|italic":"Helvetica-BoldOblique",monospace:"Courier","monospace|bold":"Courier-Bold","monospace|italic":"Courier-Oblique","monospace|bold|italic":"Courier-BoldOblique",zapfdingbats:"ZapfDingbats","zapfdingbats|bold":"ZapfDingbats","zapfdingbats|italic":"ZapfDingbats","zapfdingbats|bold|italic":"ZapfDingbats"};a("Times New Roman","serif");a("Courier New","monospace");a("Arial","sans-serif");a("Helvetica","sans-serif");a("Verdana","sans-serif");a("Tahoma","sans-serif");a("Georgia","sans-serif");a("Monaco","monospace");a("Andale Mono","monospace");d.pdf={Document:st,BinaryStream:l,defineFont:bt,parseFontDef:di,getFontURL:gi,loadFonts:ct,loadImages:lt,getPaperOptions:ot,TEXT_RENDERING_MODE:{fill:0,stroke:1,fillAndStroke:2,invisible:3,fillAndClip:4,strokeAndClip:5,fillStrokeClip:6,clip:7}}})(window,parseFloat)}(),function(){(function(n){"use strict";function r(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function u(n){return Object.keys(n).sort(function(n,t){return n-t}).map(parseFloat)}function e(n){var r,t,i;for(this.raw=n,this.scalerType=n.readLong(),this.tableCount=n.readShort(),this.searchRange=n.readShort(),this.entrySelector=n.readShort(),this.rangeShift=n.readShort(),r=this.tables={},t=0;t<this.tableCount;++t)i={tag:n.readString(4),checksum:n.readLong(),offset:n.readLong(),length:n.readLong()},r[i.tag]=i}function i(n){function t(n,t){this.definition=t;this.length=t.length;this.offset=t.offset;this.file=n;this.rawData=n.raw;this.parse(n.raw)}t.prototype.raw=function(){return this.rawData.slice(this.offset,this.length)};for(var i in n)r(n,i)&&(t[i]=t.prototype[i]=n[i]);return t}function g(){for(var t="",i=s+"",n=0;n<i.length;++n)t+=String.fromCharCode(i.charCodeAt(n)- -17);return++s,t}function h(n){this.font=n;this.subset={};this.unicodes={};this.ogid2ngid={0:0};this.ngid2ogid={0:0};this.ncid2ogid={};this.next=this.firstChar=1;this.nextGid=1;this.psName=g()+"+"+this.font.psName}function c(n,i){var u=this,r=u.contents=t(n),e,f,o;if(r.readString(4)=="ttcf"){if(!i)throw new Error("Must specify a name for TTC files");for(r.readLong(),e=r.readLong(),f=0;f<e;++f)if(o=r.readLong(),r.saveExcursion(function(){r.offset(o);u.parse()}),u.psName==i)return;throw new Error("Font "+i+" not found in collection");}else r.offset(0),u.parse()}var f=n.kendo.pdf,t=f.BinaryStream;e.prototype={readTable:function(n,t){var i=this.tables[n];if(!i)throw new Error("Table "+n+" not found in directory");return this[n]=i.table=new t(this,i)},render:function(n){var o=Object.keys(n).length,h=Math.pow(2,Math.floor(Math.log(o)/Math.LN2)),c=h*16,y=Math.floor(Math.log(h)/Math.LN2),p=o*16-c,i=t(),f,e,a,v;i.writeLong(this.scalerType);i.writeShort(o);i.writeShort(c);i.writeShort(y);i.writeShort(p);var w=o*16,u=i.offset()+w,l=null,s=t();for(f in n)if(r(n,f))for(e=n[f],i.writeString(f),i.writeLong(this.checksum(e)),i.writeLong(u),i.writeLong(e.length),s.write(e),f=="head"&&(l=u),u+=e.length;u%4;)s.writeByte(0),u++;return i.write(s.get()),a=this.checksum(i.get()),v=2981146554-a,i.offset(l+8),i.writeLong(v),i.get()},checksum:function(n){n=t(n);for(var i=0;!n.eof();)i+=n.readLong();return i&4294967295}};var l=i({parse:function(n){n.offset(this.offset);this.version=n.readLong();this.revision=n.readLong();this.checkSumAdjustment=n.readLong();this.magicNumber=n.readLong();this.flags=n.readShort();this.unitsPerEm=n.readShort();this.created=n.read(8);this.modified=n.read(8);this.xMin=n.readShort_();this.yMin=n.readShort_();this.xMax=n.readShort_();this.yMax=n.readShort_();this.macStyle=n.readShort();this.lowestRecPPEM=n.readShort();this.fontDirectionHint=n.readShort_();this.indexToLocFormat=n.readShort_();this.glyphDataFormat=n.readShort_()},render:function(n){var i=t();return i.writeLong(this.version),i.writeLong(this.revision),i.writeLong(0),i.writeLong(this.magicNumber),i.writeShort(this.flags),i.writeShort(this.unitsPerEm),i.write(this.created),i.write(this.modified),i.writeShort_(this.xMin),i.writeShort_(this.yMin),i.writeShort_(this.xMax),i.writeShort_(this.yMax),i.writeShort(this.macStyle),i.writeShort(this.lowestRecPPEM),i.writeShort_(this.fontDirectionHint),i.writeShort_(n),i.writeShort_(this.glyphDataFormat),i.get()}}),a=i({parse:function(n){n.offset(this.offset);var t=this.file.head.indexToLocFormat;this.offsets=t===0?n.times(this.length/2,function(){return 2*n.readShort()}):n.times(this.length/4,n.readLong)},offsetOf:function(n){return this.offsets[n]},lengthOf:function(n){return this.offsets[n+1]-this.offsets[n]},render:function(n){for(var r=t(),u=n[n.length-1]>65535,i=0;i<n.length;++i)u?r.writeLong(n[i]):r.writeShort(n[i]/2);return{format:u?1:0,table:r.get()}}}),v=i({parse:function(n){n.offset(this.offset);this.version=n.readLong();this.ascent=n.readShort_();this.descent=n.readShort_();this.lineGap=n.readShort_();this.advanceWidthMax=n.readShort();this.minLeftSideBearing=n.readShort_();this.minRightSideBearing=n.readShort_();this.xMaxExtent=n.readShort_();this.caretSlopeRise=n.readShort_();this.caretSlopeRun=n.readShort_();this.caretOffset=n.readShort_();n.skip(8);this.metricDataFormat=n.readShort_();this.numOfLongHorMetrics=n.readShort()},render:function(n){var i=t();return i.writeLong(this.version),i.writeShort_(this.ascent),i.writeShort_(this.descent),i.writeShort_(this.lineGap),i.writeShort(this.advanceWidthMax),i.writeShort_(this.minLeftSideBearing),i.writeShort_(this.minRightSideBearing),i.writeShort_(this.xMaxExtent),i.writeShort_(this.caretSlopeRise),i.writeShort_(this.caretSlopeRun),i.writeShort_(this.caretOffset),i.write([0,0,0,0,0,0,0,0]),i.writeShort_(this.metricDataFormat),i.writeShort(n.length),i.get()}}),y=i({parse:function(n){n.offset(this.offset);this.version=n.readLong();this.numGlyphs=n.readShort();this.maxPoints=n.readShort();this.maxContours=n.readShort();this.maxComponentPoints=n.readShort();this.maxComponentContours=n.readShort();this.maxZones=n.readShort();this.maxTwilightPoints=n.readShort();this.maxStorage=n.readShort();this.maxFunctionDefs=n.readShort();this.maxInstructionDefs=n.readShort();this.maxStackElements=n.readShort();this.maxSizeOfInstructions=n.readShort();this.maxComponentElements=n.readShort();this.maxComponentDepth=n.readShort()},render:function(n){var i=t();return i.writeLong(this.version),i.writeShort(n.length),i.writeShort(this.maxPoints),i.writeShort(this.maxContours),i.writeShort(this.maxComponentPoints),i.writeShort(this.maxComponentContours),i.writeShort(this.maxZones),i.writeShort(this.maxTwilightPoints),i.writeShort(this.maxStorage),i.writeShort(this.maxFunctionDefs),i.writeShort(this.maxInstructionDefs),i.writeShort(this.maxStackElements),i.writeShort(this.maxSizeOfInstructions),i.writeShort(this.maxComponentElements),i.writeShort(this.maxComponentDepth),i.get()}}),p=i({parse:function(n){var t,i,r;n.offset(this.offset);t=this.file;i=t.hhea;this.metrics=n.times(i.numOfLongHorMetrics,function(){return{advance:n.readShort(),lsb:n.readShort_()}});r=t.maxp.numGlyphs-t.hhea.numOfLongHorMetrics;this.leftSideBearings=n.times(r,n.readShort_)},forGlyph:function(n){var t=this.metrics,i=t.length;return n<i?t[n]:{advance:t[i-1].advance,lsb:this.leftSideBearings[n-i]}},render:function(n){for(var u,i=t(),r=0;r<n.length;++r)u=this.forGlyph(n[r]),i.writeShort(u.advance),i.writeShort_(u.lsb);return i.get()}}),w=function(){function n(n){this.raw=n}function u(n){var i,r,t;for(this.raw=n,i=this.glyphIds=[],r=this.idOffsets=[];;){if(t=n.readShort(),r.push(n.offset()),i.push(n.readShort()),!(t&o))break;n.skip(t&f?4:2);t&h?n.skip(8):t&s?n.skip(4):t&e&&n.skip(2)}}n.prototype={compound:!1,render:function(){return this.raw.get()}};var f=1,e=8,o=32,s=64,h=128;return u.prototype={compound:!0,render:function(n){for(var u,r=t(this.raw.get()),i=0;i<this.glyphIds.length;++i)u=this.glyphIds[i],r.offset(this.idOffsets[i]),r.writeShort(n[u]);return r.get()}},i({parse:function(){this.cache={}},glyphFor:function(i){var o=this.cache,s,h;if(r(o,i))return o[i];if(s=this.file.loca,h=s.lengthOf(i),h===0)return o[i]=null;var l=this.rawData,a=this.offset+s.offsetOf(i),f=t(l.slice(a,h)),c=f.readShort_(),v=f.readShort_(),y=f.readShort_(),p=f.readShort_(),w=f.readShort_(),e=o[i]=c==-1?new u(f):new n(f);return e.numberOfContours=c,e.xMin=v,e.yMin=y,e.xMax=p,e.yMax=w,e},render:function(n,i,r){for(var s,o,u=t(),f=[],e=0;e<i.length;++e)s=i[e],o=n[s],f.push(u.offset()),o&&u.write(o.render(r));return f.push(u.offset()),{table:u.get(),offsets:f}}})}(),b=function(){function n(n,t){this.text=n;this.length=n.length;this.platformID=t.platformID;this.platformSpecificID=t.platformSpecificID;this.languageID=t.languageID;this.nameID=t.nameID}return i({parse:function(t){var u,i,e;t.offset(this.offset);t.readShort();var o=t.readShort(),s=this.offset+t.readShort(),f=t.times(o,function(){return{platformID:t.readShort(),platformSpecificID:t.readShort(),languageID:t.readShort(),nameID:t.readShort(),length:t.readShort(),offset:t.readShort()+s}}),r=this.strings={};for(u=0;u<f.length;++u)i=f[u],t.offset(i.offset),e=t.readString(i.length),r[i.nameID]||(r[i.nameID]=[]),r[i.nameID].push(new n(e,i));this.postscriptEntry=r[6][0];this.postscriptName=this.postscriptEntry.text.replace(/[^\x20-\x7F]/g,"")},render:function(i){var o=this.strings,c=0,f,u,s,l,h,e;for(f in o)r(o,f)&&(c+=o[f].length);u=t();s=t();u.writeShort(0);u.writeShort(c);u.writeShort(6+12*c);for(f in o)if(r(o,f))for(l=f==6?[new n(i,this.postscriptEntry)]:o[f],h=0;h<l.length;++h)e=l[h],u.writeShort(e.platformID),u.writeShort(e.platformSpecificID),u.writeShort(e.languageID),u.writeShort(e.nameID),u.writeShort(e.length),u.writeShort(s.offset()),s.writeString(e.text);return u.write(s.get()),u.get()}})}(),k=function(){var n=".notdef .null nonmarkingreturn space exclam quotedbl numbersign dollar percent ampersand quotesingle parenleft parenright asterisk plus comma hyphen period slash zero one two three four five six seven eight nine colon semicolon less equal greater question at A B C D E F G H I J K L M N O P Q R S T U V W X Y Z bracketleft backslash bracketright asciicircum underscore grave a b c d e f g h i j k l m n o p q r s t u v w x y z braceleft bar braceright asciitilde Adieresis Aring Ccedilla Eacute Ntilde Odieresis Udieresis aacute agrave acircumflex adieresis atilde aring ccedilla eacute egrave ecircumflex edieresis iacute igrave icircumflex idieresis ntilde oacute ograve ocircumflex odieresis otilde uacute ugrave ucircumflex udieresis dagger degree cent sterling section bullet paragraph germandbls registered copyright trademark acute dieresis notequal AE Oslash infinity plusminus lessequal greaterequal yen mu partialdiff summation product pi integral ordfeminine ordmasculine Omega ae oslash questiondown exclamdown logicalnot radical florin approxequal Delta guillemotleft guillemotright ellipsis nonbreakingspace Agrave Atilde Otilde OE oe endash emdash quotedblleft quotedblright quoteleft quoteright divide lozenge ydieresis Ydieresis fraction currency guilsinglleft guilsinglright fi fl daggerdbl periodcentered quotesinglbase quotedblbase perthousand Acircumflex Ecircumflex Aacute Edieresis Egrave Iacute Icircumflex Idieresis Igrave Oacute Ocircumflex apple Ograve Uacute Ucircumflex Ugrave dotlessi circumflex tilde macron breve dotaccent ring cedilla hungarumlaut ogonek caron Lslash lslash Scaron scaron Zcaron zcaron brokenbar Eth eth Yacute yacute Thorn thorn minus multiply onesuperior twosuperior threesuperior onehalf onequarter threequarters franc Gbreve gbreve Idotaccent Scedilla scedilla Cacute cacute Ccaron ccaron dcroat".split(/\s+/g);return i({parse:function(n){var t,i;n.offset(this.offset);this.format=n.readLong();this.italicAngle=n.readFixed_();this.underlinePosition=n.readShort_();this.underlineThickness=n.readShort_();this.isFixedPitch=n.readLong();this.minMemType42=n.readLong();this.maxMemType42=n.readLong();this.minMemType1=n.readLong();this.maxMemType1=n.readLong();switch(this.format){case 131072:for(t=n.readShort(),this.glyphNameIndex=n.times(t,n.readShort),this.names=[],i=this.offset+this.length;n.offset()<i;)this.names.push(n.readString(n.readByte()));break;case 151552:t=n.readShort();this.offsets=n.read(t);break;case 262144:this.map=n.times(this.file.maxp.numGlyphs,n.readShort)}},glyphFor:function(t){switch(this.format){case 65536:return n[t]||".notdef";case 131072:var i=this.glyphNameIndex[t];return i<n.length?n[i]:this.names[i-n.length]||".notdef";case 151552:case 196608:return".notdef";case 262144:return this.map[t]||65535}},render:function(i){var u,e,f,r;if(this.format==196608)return this.raw();for(u=t(this.rawData.slice(this.offset,32)),u.writeLong(131072),u.offset(32),e=[],f=[],r=0;r<i.length;++r){var h=i[r],o=this.glyphFor(h),s=n.indexOf(o);s>=0?e.push(s):(e.push(n.length+f.length),f.push(o))}for(u.writeShort(i.length),r=0;r<e.length;++r)u.writeShort(e[r]);for(r=0;r<f.length;++r)u.writeByte(f[r].length),u.writeString(f[r]);return u.get()}})}(),o=function(){function n(n,t){var i=this;i.platformID=n.readShort();i.platformSpecificID=n.readShort();i.offset=t+n.readLong();n.saveExcursion(function(){var t,r,o,e,c,u,f,l;n.offset(i.offset);i.format=n.readShort();i.length=n.readShort();i.language=n.readShort();i.isUnicode=i.platformID==3&&i.platformSpecificID==1&&i.format==4||i.platformID===0&&i.format==4;i.codeMap={};switch(i.format){case 0:for(t=0;t<256;++t)i.codeMap[t]=n.readByte();break;case 4:r=n.readShort()/2;n.skip(6);o=n.times(r,n.readShort);n.skip(2);var a=n.times(r,n.readShort),s=n.times(r,n.readShort_),h=n.times(r,n.readShort),v=(i.length+i.offset-n.offset())/2,y=n.times(v,n.readShort);for(t=0;t<r;++t)for(e=a[t],c=o[t],u=e;u<=c;++u)h[t]===0?f=u+s[t]:(l=h[t]/2-(r-t)+(u-e),f=y[l]||0,f!==0&&(f+=s[t])),i.codeMap[u]=f&65535}})}function r(n,i){function w(t){return i[n[t]]}for(var o,it,k,p,r,d=u(n),s=[],h=[],e=null,g=null,f=0;f<d.length;++f){var l=d[f],rt=w(l),nt=rt-l;(e==null||nt!==g)&&(e&&h.push(e),s.push(l),g=nt);e=l}e&&h.push(e);h.push(65535);s.push(65535);var c=s.length,tt=c*2,b=2*Math.pow(2,Math.floor(Math.log(c)/Math.LN2)),ut=Math.log(b/2)/Math.LN2,ft=tt-b,a=[],v=[],y=[];for(f=0;f<c;++f){if(o=s[f],it=h[f],o==65535){a.push(0);v.push(0);break}if(k=w(o),o-k>=32768)for(a.push(0),v.push(2*(y.length+c-f)),p=o;p<=it;++p)y.push(w(p));else a.push(k-o),v.push(0)}return r=t(),r.writeShort(3),r.writeShort(1),r.writeLong(12),r.writeShort(4),r.writeShort(16+c*8+y.length*2),r.writeShort(0),r.writeShort(tt),r.writeShort(b),r.writeShort(ut),r.writeShort(ft),h.forEach(r.writeShort),r.writeShort(0),s.forEach(r.writeShort),a.forEach(r.writeShort_),v.forEach(r.writeShort),y.forEach(r.writeShort),r.get()}return i({parse:function(t){var i=this,r=i.offset,u;t.offset(r);i.version=t.readShort();u=t.readShort();i.unicodeEntry=null;i.tables=t.times(u,function(){var u=new n(t,r);return u.isUnicode&&(i.unicodeEntry=u),u})},render:function(n,i){var u=t();return u.writeShort(0),u.writeShort(1),u.write(r(n,i)),u.get()},getUnicodeEntry:function(){if(!this.unicodeEntry)throw new Error("Font doesn't have an Unicode encoding");return this.unicodeEntry}})}(),d=i({parse:function(n){n.offset(this.offset);this.version=n.readShort();this.averageCharWidth=n.readShort_();this.weightClass=n.readShort();this.widthClass=n.readShort();this.type=n.readShort();this.ySubscriptXSize=n.readShort_();this.ySubscriptYSize=n.readShort_();this.ySubscriptXOffset=n.readShort_();this.ySubscriptYOffset=n.readShort_();this.ySuperscriptXSize=n.readShort_();this.ySuperscriptYSize=n.readShort_();this.ySuperscriptXOffset=n.readShort_();this.ySuperscriptYOffset=n.readShort_();this.yStrikeoutSize=n.readShort_();this.yStrikeoutPosition=n.readShort_();this.familyClass=n.readShort_();this.panose=n.times(10,n.readByte);this.charRange=n.times(4,n.readLong);this.vendorID=n.readString(4);this.selection=n.readShort();this.firstCharIndex=n.readShort();this.lastCharIndex=n.readShort();this.version>0&&(this.ascent=n.readShort_(),this.descent=n.readShort_(),this.lineGap=n.readShort_(),this.winAscent=n.readShort(),this.winDescent=n.readShort(),this.codePageRange=n.times(2,n.readLong),this.version>1&&(this.xHeight=n.readShort(),this.capHeight=n.readShort(),this.defaultChar=n.readShort(),this.breakChar=n.readShort(),this.maxContext=n.readShort()))},render:function(){return this.raw()}}),s=1e5;h.prototype={use:function(n){var t,u,r,i,f;if(typeof n=="string"){for(u="",r=0;r<n.length;++r)t=this.use(n.charCodeAt(r)),u+=String.fromCharCode(t);return u}return t=this.unicodes[n],t||(t=this.next++,this.subset[t]=n,this.unicodes[n]=t,i=this.font.cmap.getUnicodeEntry().codeMap[n],i&&(this.ncid2ogid[t]=i,this.ogid2ngid[i]==null&&(f=this.nextGid++,this.ogid2ngid[i]=f,this.ngid2ogid[f]=i))),t},encodeText:function(n){return this.use(n)},glyphIds:function(){return u(this.ogid2ngid)},glyphsFor:function(n,t){var i,r,u;for(t||(t={}),i=0;i<n.length;++i)r=n[i],t[r]||(u=t[r]=this.font.glyf.glyphFor(r),u&&u.compound&&this.glyphsFor(u.glyphIds,t));return t},render:function(){var f=this.glyphsFor(this.glyphIds()),t,e,c;for(t in f)r(f,t)&&(t=parseInt(t,10),this.ogid2ngid[t]==null&&(e=this.nextGid++,this.ogid2ngid[t]=e,this.ngid2ogid[e]=t));var l=u(this.ngid2ogid),i=l.map(function(n){return this.ngid2ogid[n]},this),n=this.font,s=n.glyf.render(f,i,this.ogid2ngid),h=n.loca.render(s.offsets);return this.lastChar=this.next-1,c={cmap:o.render(this.ncid2ogid,this.ogid2ngid),glyf:s.table,loca:h.table,hmtx:n.hmtx.render(i),hhea:n.hhea.render(i),maxp:n.maxp.render(i),post:n.post.render(i),name:n.name.render(this.psName),head:n.head.render(h.format),"OS/2":n.os2.render()},this.font.directory.render(c)},cidToGidMap:function(){for(var u,f,n=t(),r=0,i=this.firstChar;i<this.next;++i){while(r<i)n.writeShort(0),r++;u=this.ncid2ogid[i];u?(f=this.ogid2ngid[u],n.writeShort(f)):n.writeShort(0);r++}return n.get()}};c.prototype={parse:function(){var n=this.directory=new e(this.contents);this.head=n.readTable("head",l);this.loca=n.readTable("loca",a);this.hhea=n.readTable("hhea",v);this.maxp=n.readTable("maxp",y);this.hmtx=n.readTable("hmtx",p);this.glyf=n.readTable("glyf",w);this.name=n.readTable("name",b);this.post=n.readTable("post",k);this.cmap=n.readTable("cmap",o);this.os2=n.readTable("OS/2",d);this.psName=this.name.postscriptName;this.ascent=this.os2.ascent||this.hhea.ascent;this.descent=this.os2.descent||this.hhea.descent;this.lineGap=this.os2.lineGap||this.hhea.lineGap;this.scale=1e3/this.head.unitsPerEm},widthOfGlyph:function(n){return this.hmtx.forGlyph(n).advance*this.scale},makeSubset:function(){return new h(this)}};f.TTFFont=c})(window)}(),function(){(function(n,t){"use strict";function o(t,r){function f(n,t,i){return(i||(i=l),i.pdf&&i.pdf[n]!=null)?i.pdf[n]:t}function h(){function o(n){var o=n.options,t=lt(n),s=t.bbox,r,h,c,l,a;n=t.root;r=f("paperSize",f("paperSize","auto"),o);h=!1;r=="auto"&&(s?(c=s.getSize(),r=[c.width,c.height],h=!0,l=s.getOrigin(),t=new i.Group,t.transform(new u.Matrix(1,0,0,1,-l.x,-l.y)),t.append(n),n=t):r="A4");a=e.addPage({paperSize:r,margin:f("margin",f("margin"),o),addMargin:h,landscape:f("landscape",f("landscape",!1),o)});v(n,a,e)}if(!(--c>0)){var e=new n.pdf.Document({producer:f("producer"),title:f("title"),author:f("author"),subject:f("subject"),keywords:f("keywords"),creator:f("creator"),date:f("date")});a?t.children.forEach(o):o(t);r(e.render(),e)}}var e=[],o=[],l=t.options,a=f("multiPage"),c;t.traverse(function(t){s({Image:function(n){o.indexOf(n.src())<0&&o.push(n.src())},Text:function(t){var r=n.pdf.parseFontDef(t.options.font),i=n.pdf.getFontURL(r);e.indexOf(i)<0&&e.push(i)}},t)});c=2;n.pdf.loadFonts(e,h);n.pdf.loadImages(o,h)}function l(n,t){o(n,function(n){t("data:application/pdf;base64,"+n.base64())})}function a(n,t){o(n,function(n){t(new Blob([n.get()],{type:"application/pdf"}))})}function k(t,i,r,u){window.Blob&&!n.support.browser.safari?a(t,function(t){n.saveAs({dataURI:t,fileName:i});u&&u(t)}):l(t,function(t){n.saveAs({dataURI:t,fileName:i,proxyURL:r});u&&u(t)})}function s(n,t){var i=n[t.nodeType];return i?i.call.apply(i,arguments):t}function v(n,t,i){var f,u,r;n.options._pdfDebug&&t.comment("BEGIN: "+n.options._pdfDebug);f=n.transform();u=n.opacity();t.save();u!=null&&u<1&&t.setOpacity(u);d(n,t,i);g(n,t,i);f&&(r=f.matrix(),t.transform(r.a,r.b,r.c,r.d,r.e,r.f));nt(n,t,i);s({Path:it,MultiPath:rt,Circle:ut,Arc:ft,Text:et,Image:st,Group:ot,Rect:ht},n,t,i);t.restore();n.options._pdfDebug&&t.comment("END: "+n.options._pdfDebug)}function d(n,t){var r=n.stroke&&n.stroke(),i,u,f,e,o,s;if(r){if(i=r.color,i){if(i=c(i),i==null)return;t.setStrokeColor(i.r,i.g,i.b);i.a!=1&&t.setStrokeOpacity(i.a)}if(u=r.width,u!=null){if(u===0)return;t.setLineWidth(u)}f=r.dashType;f&&t.setDashPattern(p[f],0);e=r.lineCap;e&&t.setLineCap(w[e]);o=r.lineJoin;o&&t.setLineJoin(b[o]);s=r.opacity;s!=null&&t.setStrokeOpacity(s)}}function g(n,t){var u=n.fill&&n.fill(),r,f;if(u&&!(u instanceof i.Gradient)){if(r=u.color,r){if(r=c(r),r==null)return;t.setFillColor(r.r,r.g,r.b);r.a!=1&&t.setFillOpacity(r.a)}f=u.opacity;f!=null&&t.setFillOpacity(f)}}function nt(n,t,i){var r=n.clip();r&&(h(r,t,i),t.clip())}function r(n){return n&&(n instanceof i.Gradient||n.color&&!/^(none|transparent)$/i.test(n.color)&&(n.width==null||n.width>0)&&(n.opacity==null||n.opacity>0))}function y(n,t,r,u){var f=n.fill(),o,s,h;if(f instanceof i.Gradient){u?t.clipStroke():t.clip();o=f instanceof i.RadialGradient;o?(s={x:f.center().x,y:f.center().y,r:0},h={x:f.center().x,y:f.center().y,r:f.radius()}):(s={x:f.start().x,y:f.start().y},h={x:f.end().x,y:f.end().y});var v={type:o?"radial":"linear",start:s,end:h,userSpace:f.userSpace(),stops:f.stops.elements().map(function(n){var t=n.offset(),i;return t=/%$/.test(t)?parseFloat(t)/100:parseFloat(t),i=c(n.color()),i.a*=n.opacity(),{offset:t,color:i}})},e=n.rawBBox(),l=e.topLeft(),a=e.getSize();return e={left:l.x,top:l.y,width:a.width,height:a.height},t.gradient(v,e),!0}}function f(n,t,i){r(n.fill())&&r(n.stroke())?y(n,t,i,!0)||t.fillStroke():r(n.fill())?y(n,t,i,!1)||t.fill():r(n.stroke())?t.stroke():t.nop()}function tt(n,t){var u=n.segments,i,r,f;if(u.length==4&&n.options.closed){for(i=[],r=0;r<u.length;++r){if(u[r].controlIn())return!1;i[r]=u[r].anchor()}if(f=i[0].y==i[1].y&&i[1].x==i[2].x&&i[2].y==i[3].y&&i[3].x==i[0].x||i[0].x==i[1].x&&i[1].y==i[2].y&&i[2].x==i[3].x&&i[3].y==i[0].y,f)return t.rect(i[0].x,i[0].y,i[2].x-i[0].x,i[2].y-i[0].y),!0}}function h(n,t,i){var s=n.segments,h,u,f,r,e,o;if(s.length!==0&&!tt(n,t,i)){for(u=0;u<s.length;++u)f=s[u],r=f.anchor(),h?(e=h.controlOut(),o=f.controlIn(),e&&o?t.bezier(e.x,e.y,o.x,o.y,r.x,r.y):t.lineTo(r.x,r.y)):t.moveTo(r.x,r.y),h=f;n.options.closed&&t.close()}}function it(n,t,i){h(n,t,i);f(n,t,i)}function rt(n,t,i){for(var u=n.paths,r=0;r<u.length;++r)h(u[r],t,i);f(n,t,i)}function ut(n,t,i){var r=n.geometry();t.circle(r.center.x,r.center.y,r.radius);f(n,t,i)}function ft(n,t,i){var r=n.geometry().curvePoints(),u;for(t.moveTo(r[0].x,r[0].y),u=1;u<r.length;)t.bezier(r[u].x,r[u++].y,r[u].x,r[u++].y,r[u].x,r[u++].y);f(n,t,i)}function et(t,i){var u=n.pdf.parseFontDef(t.options.font),f=t._position,r;t.fill()&&t.stroke()?r=e.fillAndStroke:t.fill()?r=e.fill:t.stroke()&&(r=e.stroke);i.transform(1,0,0,-1,f.x,f.y+u.fontSize);i.beginText();i.setFont(n.pdf.getFontURL(u),u.fontSize);i.setTextRenderingMode(r);i.showText(t.content(),t._pdfRect?t._pdfRect.width():null);i.endText()}function ot(n,t,i){var u,r;for(n._pdfLink&&t.addLink(n._pdfLink.url,n._pdfLink),u=n.children,r=0;r<u.length;++r)v(u[r],t,i)}function st(n,t){var r=n.src();if(r){var u=n.rect(),f=u.getOrigin(),i=u.getSize();t.transform(i.width,0,0,-i.height,f.x,f.y+i.height);t.drawImage(r)}}function ht(n,t,i){var r=n.geometry();t.rect(r.origin.x,r.origin.y,r.size.width,r.size.height);f(n,t,i)}function ct(n,r){var u=t.Deferred();for(var f in r)n.options.set("pdf."+f,r[f]);return i.pdf.toDataURL(n,u.resolve),u.promise()}function c(t){var i=n.parseColor(t,!0);return i?i.toRGB():null}function lt(n){function t(n){return c=!0,n}function o(n){return n.visible()&&n.opacity()>0&&(r(n.fill())||r(n.stroke()))}function l(n){for(var i,r=[],t=0;t<n.length;++t)i=a(n[t]),i!=null&&r.push(i);return r}function v(n,t){var r=f,o=e,i;n.transform()&&(e=e.multiplyCopy(n.transform().matrix()));i=n.clip();i&&(i=i.bbox(),i&&(i=i.bbox(e),f=f?u.Rect.intersect(f,i):i));try{return t()}finally{f=r;e=o}}function y(n){if(f==null)return!1;var t=n.rawBBox().bbox(e);return f&&t&&(t=u.Rect.intersect(t,f)),t}function a(r){return v(r,function(){if(!(r instanceof i.Group||r instanceof i.MultiPath)){var f=y(r);if(!f)return t(null);h=h?u.Rect.union(h,f):f}return s({Path:function(n){return n.segments.length===0||!o(n)?t(null):n},MultiPath:function(n){if(!o(n))return t(null);var r=new i.MultiPath(n.options);return(r.paths=l(n.paths),r.paths.length===0)?t(null):r},Circle:function(n){return o(n)?n:t(null)},Arc:function(n){return o(n)?n:t(null)},Text:function(n){return!/\S/.test(n.content())||!o(n)?t(null):n},Image:function(n){return(n.visible()&&n.opacity()>0)?n:t(null)},Group:function(r){var u=new i.Group(r.options);return(u.children=l(r.children),u._pdfLink=r._pdfLink,r!==n&&u.children.length===0&&!r._pdfLink)?t(null):u},Rect:function(n){return o(n)?n:t(null)}},r)})}var f=!1,e=u.Matrix.unit(),h=null,c;do c=!1,n=a(n);while(n&&c);return{root:n,bbox:h}}var i=n.drawing,u=n.geometry,e=n.pdf.TEXT_RENDERING_MODE,p={dash:[4],dashDot:[4,2,1,2],dot:[1,2],longDash:[8,2],longDashDot:[8,2,1,2],longDashDotDot:[8,2,1,2,1,2],solid:[]},w={butt:0,round:1,square:2},b={miter:0,round:1,bevel:2};n.deepExtend(i,{exportPDF:ct,pdf:{toDataURL:l,toBlob:a,saveAs:k,toStream:o}})})(window.kendo,window.kendo.jQuery)}(),function(){(function(n,t){n.PDFMixin={extend:function(n){n.events.push("pdfExport");n.options.pdf=this.options;n.saveAsPDF=this.saveAsPDF;n._drawPDF=this._drawPDF;n._drawPDFShadow=this._drawPDFShadow},options:{fileName:"Export.pdf",proxyURL:"",paperSize:"auto",allPages:!1,landscape:!1,margin:null,title:null,author:null,subject:null,keywords:null,creator:"Kendo UI PDF Generator",date:null},saveAsPDF:function(){var r=new t.Deferred,u=r.promise(),f={promise:u},i;if(!this.trigger("pdfExport",f))return i=this.options.pdf,i.multiPage=i.allPages,this._drawPDF(r).then(function(t){return n.drawing.exportPDF(t,i)}).done(function(t){n.saveAs({dataURI:t,fileName:i.fileName,proxyURL:i.proxyURL,forceProxy:i.forceProxy,proxyTarget:i.proxyTarget});r.resolve()}).fail(function(n){r.reject(n)}),u},_drawPDF:function(i){var r=new t.Deferred;return n.drawing.drawDOM(this.wrapper).done(function(n){var t={page:n,pageNumber:1,progress:1,totalPages:1};i.notify(t);r.resolve(t.page)}).fail(function(n){r.reject(n)}),r},_drawPDFShadow:function(i,r){var e,f,u;return i=i||{},e=this.wrapper,f=t("<div class='k-pdf-export-shadow'>"),i.width&&f.css({width:i.width,overflow:"visible"}),e.before(f),f.append(i.content||e.clone(!0,!0)),u=t.Deferred(),setTimeout(function(){var t=n.drawing.drawDOM(f,r);t.always(function(){f.remove()}).then(function(){u.resolve.apply(u,arguments)}).fail(function(){u.reject.apply(u,arguments)}).progress(function(){u.progress.apply(u,arguments)})},15),u.promise()}}})(kendo,window.kendo.jQuery)}(),function(){(function(n,t){function li(n){return new Array(n+1).join('<td class="k-group-cell">&nbsp;<\/td>')}function ii(n){var t,i=" ";if(n){if(typeof n===p)return n;for(t in n)i+=t+'="'+n[t]+'"'}return i}function rr(t,i){n("th, th .k-grid-filter, th .k-link",t).add(document.body).css("cursor",i)}function lt(t,i,r,u,f){var o=i,e;for(i=n(),f=f||1,e=0;e<f;e++)i=i.add(t.eq(o+e));typeof r=="number"?i[u?"insertBefore":"insertAfter"](t.eq(r)):i.appendTo(r)}function tt(t,i,r){return n(t).add(i).find(r)}function yf(n,t,i){var f,s,u,o;for(i=at(i)?i:[i],f=0,s=i.length;f<s;f++)if(u=i[f],c(u)&&u.click){o=u.name||u.text;t.on(l+r,"a.k-grid-"+(o||"").replace(/\s/g,""),{commandName:o},e(u.click,n))}}function hu(n,t,r){return dt(n,function(n){var u,e;return n=typeof n===p?{field:n}:n,(!ut(n)||r)&&(n.attributes=vi(n.attributes),n.footerAttributes=vi(n.footerAttributes),n.headerAttributes=vi(n.headerAttributes),u=!0),n.columns&&(n.columns=hu(n.columns,t,u)),e=i.guid(),n.headerAttributes=f({id:e},n.headerAttributes),f({encoded:t,hidden:u},n)})}function ur(n,t){var i=[];return fr(n,t,i),i[i.length-1]}function fr(n,t,i){var r,u;for(i=i||[],r=0;r<t.length;r++){if(n===t[r])return!0;if(t[r].columns){if(u=i.length,i.push(t[r]),fr(n,t[r].columns,i))return!0;i.splice(u,i.length-u)}}return!1}function ri(n,t){var i=t?gf:vi;n.hidden=!t;n.attributes=i(n.attributes);n.footerAttributes=i(n.footerAttributes);n.headerAttributes=i(n.headerAttributes)}function er(){return this.style.display!=="none"}function ut(n){return k([n]).length>0}function k(n){return a(n,function(n){var t=!n.hidden;return t&&n.columns&&(t=k(n.columns).length>0),t})}function pf(t){return n(t).map(function(){return this.toArray()})}function wf(n,t,i){var r=ui(s(t)),u=ui(ot(t)),f=n.rowSpan;n.rowSpan=i?r>u?f-(r-u)||1:f+(u-r):r>u?f+(r-u):f-(u-r)||1}function cu(t,i,r,u,f,e,o){var s=ui(t),h=ui([i]),c,l;s>h&&(c=new Array(o+1).join('<th class="k-group-cell k-header">&nbsp;<\/th>'),l=e.children(":not(.k-filter-row)"),n(new Array(s-h+1).join("<tr>"+c+"<\/tr>")).insertAfter(l.last()));df(e,s-h);au(r,u,f,e)}function lu(t,r,f){var e,h,c,o,l;f=f||0;c=r;r=u(r);var s={},a=t.find(">tr:not(.k-filter-row)"),v=function(){var t=n(this);return!t.hasClass("k-group-cell")&&!t.hasClass("k-hierarchy-cell")};for(o=0,l=r.length;o<l;o++)e=pt(r[o],c),s[e.row]||(s[e.row]=a.eq(e.row).find(".k-header").filter(v)),h=s[e.row].eq(e.cell),h.attr(i.attr("index"),f+o);return r.length}function ui(n){for(var r,i=0,t=0;t<n.length;t++)n[t].columns&&(r=ui(n[t].columns),r>i&&(i=r));return 1+i}function au(t,i,r,u){for(var o=or(t[0],i),h=r.find(">tr:not(.k-filter-row):eq("+o.row+")>th.k-header"),s=n(),c=o.cell,e,f=0;f<t.length;f++)s=s.add(h.eq(c+f));for(u.find(">tr:not(.k-filter-row)").eq(o.row).append(s),e=[],f=0;f<t.length;f++)t[f].columns&&(e=e.concat(t[f].columns));e.length&&au(e,i,r,u)}function pt(n,t,i,r){var f,u;for(i=i||0,r=r||{},r[i]=r[i]||0,u=0;u<t.length;u++){if(t[u]==n){f={cell:r[i],row:i};break}else if(t[u].columns&&(f=pt(n,t[u].columns,i+1,r),f))break;r[i]++}return f}function bf(n,t,i,r){var u,f=i.locked;do u=n[t],t+=r?1:-1;while(u&&t>-1&&t<n.length&&u!=i&&!u.columns&&u.locked==f);return u}function vu(n,t,i,r){var e,f,u,o;return t.columns?(t=t.columns,t[r?0:t.length-1]):(e=ur(t,n),f=e?e.columns:n,u=h(t,f),u===0&&r?u++:u!=f.length-1||r?(u>0||u===0&&!r)&&(u+=r?-1:1):u--,o=h(i,f),t=bf(f,u,i,o>u),t&&t!=i&&t.columns)?vu(n,t,i,r):null}function or(n,t,i,r){var f,u;for(i=i||0,r=r||{},r[i]=r[i]||0,u=0;u<t.length;u++){if(t[u]==n){f={cell:r[i],row:i};break}else if(t[u].columns&&(f=or(n,t[u].columns,i+1,r),f))break;t[u].hidden||r[i]++}return f}function sr(n){var t=ft(s(n));return t.concat(ft(ot(n)))}function ft(n){for(var i=[],r=[],t=0;t<n.length;t++)i.push(n[t]),n[t].columns&&(r=r.concat(n[t].columns));return r.length&&(i=i.concat(ft(r))),i}function wt(n){for(var i=0,t,r=0;r<n.length;r++)t=n[r],t.columns?i+=wt(t.columns):t.hidden&&i++;return i}function yu(n){for(var t,r=0,i=0,u=n.length;i<u;i++)t=n[i].style.width,t&&t.indexOf("%")==-1&&(r+=parseInt(t,10));return r}function kf(n,t){for(var r=n.find("tr:not(.k-filter-row) th:not(.k-group-cell,.k-hierarchy-cell)"),u,i=0;i<r.length;i++)u=r[i].rowSpan,u>1&&(r[i].rowSpan=u-t||1)}function df(n,t){for(var r=n.find("tr:not(.k-filter-row) th:not(.k-group-cell,.k-hierarchy-cell)"),i=0;i<r.length;i++)r[i].rowSpan+=t}function hr(t){for(var r=t.find("tr:not(.k-filter-row)"),f=r.filter(function(){return!n(this).children().length}).remove().length,u=r.find("th:not(.k-group-cell,.k-hierarchy-cell)"),i=0;i<u.length;i++)u[i].rowSpan>1&&(u[i].rowSpan-=f);return r.length-f}function ai(n,t,i,r,u){for(var o,e=[],f=0,s=n.length;f<s;f++)o=i[r]||[],o.push(t.eq(u+f)),i[r]=o,n[f].columns&&(e=e.concat(n[f].columns));e.length&&ai(e,t,i,r+1,u+n.length)}function s(n){return a(n,function(n){return n.locked})}function ot(n){return a(n,function(n){return!n.locked})}function pu(n){return a(n,function(n){return!n.locked&&ut(n)})}function cr(n){return a(n,function(n){return n.locked&&ut(n)})}function it(n){for(var i=[],t=0;t<n.length;t++)n[t].hidden||(n[t].columns?i=i.concat(it(n[t].columns)):i.push(n[t]));return i}function u(n){for(var i=[],t=0;t<n.length;t++){if(!n[t].columns){i.push(n[t]);continue}i=i.concat(u(n[t].columns))}return i}function d(r){var f=r.find(">tr:not(.k-filter-row)"),o=function(){var t=n(this);return!t.hasClass("k-group-cell")&&!t.hasClass("k-hierarchy-cell")},u=n(),e;return f.length>1&&(u=f.find("th").filter(o).filter(function(){return this.rowSpan>1})),u=u.add(f.last().find("th").filter(o)),e=i.attr("index"),u.sort(function(i,r){i=n(i);r=n(r);var u=i.attr(e),f=r.attr(e);return u===t&&(u=n(i).index()),f===t&&(f=n(r).index()),u=parseInt(u,10),f=parseInt(f,10),u>f?1:u<f?-1:0}),u}function wu(t){var a=t.closest("table"),f=n().add(t),o=t.closest("tr"),s=a.find("tr:not(.k-filter-row)"),h=s.index(o),i,u;if(h>0){var v=s.eq(h-1),c=v.find("th:not(.k-group-cell,.k-hierarchy-cell)").filter(function(){return!n(this).attr("rowspan")}),r=0,e=o.find("th:not(.k-group-cell,.k-hierarchy-cell)").index(t),l=t.prevAll(":not(.k-group-cell,.k-hierarchy-cell)").filter(function(){return this.colSpan>1});for(i=0;i<l.length;i++)r+=l[i].colSpan||1;for(e+=Math.max(r-1,0),r=0,i=0;i<c.length;i++)if(u=c.eq(i),r+=u.attr("colSpan")?u[0].colSpan:1,e>=i&&e<r){f=wu(u).add(f);break}}return f}function fi(t){var y=t.closest("thead"),e=n().add(t),l=t.closest("tr"),a=y.find("tr:not(.k-filter-row)"),p=a.index(l)+t[0].rowSpan,o=i.attr("colspan"),u,f,r,s,v,h,c;if(p<=a.length-1){for(u=l.next(),f=t.prevAll(":not(.k-group-cell,.k-hierarchy-cell)"),f=f.filter(function(){return!this.rowSpan||this.rowSpan===1}),s=0,r=0;r<f.length;r++)s+=parseInt(f.eq(r).attr(o),10)||1;for(v=u.find("th:not(.k-group-cell,.k-hierarchy-cell)"),h=parseInt(t.attr(o),10)||1,r=0;r<h;)u=v.eq(r+s),e=e.add(fi(u)),c=parseInt(u.attr(o),10),c>1&&(h-=c-1),r++}return e}function bu(t,i,r,u){var f,e=t;return u&&t.empty(),of?t[0].innerHTML=r:(f=document.createElement("div"),f.innerHTML="<table><tbody>"+r+"<\/tbody><\/table>",t=f.firstChild.firstChild,i[0].replaceChild(t,e[0]),t=n(t)),t}function vi(n){n=n||{};var t=n.style;return t?(t=t.replace(/((.*)?display)(.*)?:([^;]*)/i,"$1:none"),t===n.style&&(t=t.replace(/(.*)?/i,"display:none;$1"))):t="display:none",f({},n,{style:t})}function gf(n){n=n||{};var t=n.style;return t&&(n.style=t.replace(/(display\s*:\s*none\s*;?)*/ig,"")),n}function bt(t,r,u,f){var e=t.find(">colgroup"),s,h=dt(r,function(n){return(s=n.width,s&&parseInt(s,10)!==0)?i.format('<col style="width:{0}"/>',typeof s===p?s:s+"px"):"<col />"});(u||e.find(".k-hierarchy-col").length)&&h.splice(0,0,'<col class="k-hierarchy-col" />');e.length&&e.remove();e=n(new Array(f+1).join('<col class="k-group-col">')+h.join(""));e.is("colgroup")||(e=n("<colgroup/>").append(e));t.prepend(e);o.msie&&o.version==8&&(t.css("display","inline-table"),window.setTimeout(function(){t.css("display","")},1))}function ne(n,t){for(var u=0,r=n.find("th:not(.k-group-cell)"),i=0,f=t.length;i<f;i++)t[i].locked&&(r.eq(i).insertBefore(r.eq(u)),r=n.find("th:not(.k-group-cell)"),u++)}function ku(n){for(var r={},i,t=0,u=n.length;t<u;t++)i=n[t],r[i.value]=i.text;return r}function te(n,t,r,u){var e=r&&r.length&&c(r[0])&&"value"in r[0],f=e?ku(r)[n]:n;return f=f!=null?f:"",t?i.format(t,f):u===!1?f:i.htmlEncode(f)}function st(n,t,i){for(var u=0,f,r=n[u];r;){if(f=i?!0:r.style.display!=="none",f&&!lf.test(r.className)&&--t<0){r.style.display=i?"":"none";break}r=n[++u]}}function du(t,i){for(var f=0,e=t.length,r,u;f<e;f+=1)u=t.eq(f),u.is(".k-grouping-row,.k-detail-row")?(r=u.children(":not(.k-group-cell):first,.k-detail-cell").last(),r.attr("colspan",parseInt(r.attr("colspan"),10)-1)):(u.hasClass("k-grid-edit-row")&&(r=u.children(".k-edit-container")[0])&&(r=n(r),r.attr("colspan",parseInt(r.attr("colspan"),10)-1),r.find("col").eq(i).remove(),u=r.find("tr:first")),st(u[0].cells,i,!1))}function gu(n){for(var i=[],t,r=0;r<n.length;r++){if(t=n[r],!("field"in t&&"value"in t&&"items"in t))break;i.push(t);t.hasSubgroups&&(i=i.concat(gu(t.items)))}return i}function nf(n){for(var i=[],t,r=0;r<n.length;r++){if(t=n[r],!("field"in t&&"value"in t&&"items"in t))break;t.hasSubgroups&&(i=i.concat(nf(t.items)));i.push(t.aggregates)}return i}function tf(t,i){for(var f=0,e=t.length,r,u,o;f<e;f+=1)u=t.eq(f),u.is(".k-grouping-row,.k-detail-row")?(r=u.children(":not(.k-group-cell):first,.k-detail-cell").last(),r.attr("colspan",parseInt(r.attr("colspan"),10)+1)):(u.hasClass("k-grid-edit-row")&&(r=u.children(".k-edit-container")[0])&&(r=n(r),r.attr("colspan",parseInt(r.attr("colspan"),10)+1),bt(r.find(">form>table"),k(o),!1,0),u=r.find("tr:first")),st(u[0].cells,i,!0))}function rf(n,t,i){i=i||1;for(var r,u=0,f=n.length;u<f;u++)r=n.eq(u).children().last(),r.attr("colspan",parseInt(r.attr("colspan"),10)+i),r=t.eq(u).children().last(),r.attr("colspan",parseInt(r.attr("colspan"),10)-i)}function uf(n){for(var r=0,u=n.find(">colgroup>col"),t=0,i=u.length;t<i;t+=1)r+=parseInt(u[t].style.width,10);return r}function ie(n,t){if(n=n[0],t=t[0],n.rows.length!==t.rows.length){var r=n.offsetHeight,u=t.offsetHeight,i,f;r>u?(i=t.rows[t.rows.length-1],ou.test(i.className)&&(i=t.rows[t.rows.length-2]),f=r-u):(i=n.rows[n.rows.length-1],ou.test(i.className)&&(i=n.rows[n.rows.length-2]),f=u-r);i.style.height=i.offsetHeight+f+"px"}}function oi(n,t){var i,r=n.offsetHeight,u=t.offsetHeight;r>u?i=r+"px":r<u&&(i=u+"px");i&&(n.style.height=t.style.height=i)}function lr(n,t){var r,u,i;if(typeof n===p&&n===t||c(n)&&n.name===t)return n;if(at(n))for(r=0,u=n.length;r<u;r++)if(i=n[r],typeof i===p&&i===t||i.name===t)return i;return null}function w(t,i){var u=o.msie,r,f,e;if(i===!0){if(t=n(t),r=!0||u&&t.parent().is(".k-grid-content,.k-grid-header-wrap"),r&&(f=t.parent().scrollTop(),e=t.parent().scrollLeft()),u)try{t[0].setActive()}catch(s){t[0].focus()}else t[0].focus();r&&(t.parent().scrollTop(f),t.parent().scrollLeft(e))}else n(t).one("focusin",function(n){n.preventDefault()}).focus()}function ff(t){var r=n(t.currentTarget),f=r.is("th"),e=this.table.add(this.lockedTable),o=this.thead.parent().add(n(">table",this.lockedHeader)),s=n(t.target).is(":button,a,:input,a>.k-icon,textarea,span.k-select,span.k-icon,span.k-link,.k-input,.k-multiselect-wrap,.k-tool-icon"),u=r.closest("table")[0];if(!i.support.touch){if(s&&r.find(i.roleSelector("filtercell")).length){this._setCurrent(r);return}(u===e[0]||u===e[1]||u===o[0]||u===o[1])&&(n(t.target).is("a.k-i-collapse, a.k-i-expand")||(this.options.navigatable&&this._setCurrent(r),(f||!s)&&setTimeout(function(){vf&&n(i._activeElement()).hasClass("k-widget")||w(u,!0)}),f&&t.preventDefault()))}}function re(n){return n&&(n.hasClass("k-edit-cell")||n.parent().hasClass("k-grid-edit-row"))}function ef(n,t,i){return'<tr role="row" class="k-grouping-row">'+li(t)+'<td colspan="'+n+'" aria-expanded="true"><p class="k-reset"><a class="k-icon k-i-collapse" href="#" tabindex="-1"><\/a>'+i+"<\/p><\/td><\/tr>"}function ue(n){return'<tr role="row" class="k-grouping-row"><td colspan="'+n+'" aria-expanded="true"><p class="k-reset">&nbsp;<\/p><\/td><\/tr>'}var i=window.kendo,ht=i.ui,ar=i.data.DataSource,of=i.support.tbodyInnerHtml,ct=i._activeElement,kt=ht.Widget,v=i.keys,c=n.isPlainObject,f=n.extend,dt=n.map,a=n.grep,at=n.isArray,h=n.inArray,vr=Array.prototype.push,e=n.proxy,sf=i.isFunction,yr=n.isEmptyObject,et=Math,yi="progress",pi="error",y=":not(.k-group-cell):not(.k-hierarchy-cell):visible",hf="tbody>tr:not(.k-grouping-row):not(.k-detail-row):not(.k-group-footer) > td:not(.k-group-cell):not(.k-hierarchy-cell)",rt="tr:not(.k-footer-template):visible",vt=":not(.k-group-cell):not(.k-hierarchy-cell):visible",pr=rt+":first>"+vt+":first",wi="th.k-header:not(.k-group-cell):not(.k-hierarchy-cell)",r=".kendoGrid",si="edit",bi="save",wr="remove",ki="detailInit",br="filterMenuInit",kr="columnMenuInit",g="change",di="columnHide",gi="columnShow",dr="saveChanges",nr="dataBound",gr="detailExpand",nu="detailCollapse",gt="k-state-focused",tu="k-state-selected",iu="k-grid-norecords",tr="columnResize",ru="columnReorder",uu="columnLock",fu="columnUnlock",eu="navigate",l="click",ir="height",ni="tabIndex",yt="function",p="string",cf=/(\}|\#)/ig,hi=/#/ig,ci="[\\x20\\t\\r\\n\\f]",lf=new RegExp("(^|"+ci+")(k-group-cell|k-hierarchy-cell)("+ci+"|$)"),ou=new RegExp("(^|"+ci+")(k-filter-row)("+ci+"|$)"),af='<a class="k-button k-button-icontext #=className#" #=attr# href="\\#"><span class="#=iconClass# #=imageClass#"><\/span>#=text#<\/a>',nt=!1,o=i.support.browser,ti=o.msie&&o.version==7,vf=o.msie&&o.version==8,su=kt.extend({init:function(n,t){var i=this;kt.fn.init.call(i,n,t);i._refreshHandler=e(i.refresh,i);i.setDataSource(t.dataSource);i.wrap()},setDataSource:function(n){var t=this;t.dataSource&&t.dataSource.unbind(g,t._refreshHandler);t.dataSource=n;t.dataSource.bind(g,t._refreshHandler)},options:{name:"VirtualScrollable",itemHeight:n.noop,prefetch:!0},destroy:function(){var n=this;kt.fn.destroy.call(n);n.dataSource.unbind(g,n._refreshHandler);n.wrapper.add(n.verticalScrollbar).off(r);n.drag&&(n.drag.destroy(),n.drag=null);n.wrapper=n.element=n.verticalScrollbar=null;n._refreshHandler=null},wrap:function(){var t=this,o=i.support.scrollbar()+1,u=t.element,f;u.css({width:"auto",overflow:"hidden"}).css(nt?"padding-left":"padding-right",o);t.content=u.children().first();f=t.wrapper=t.content.wrap('<div class="k-virtual-scrollable-wrap"/>').parent().bind("DOMMouseScroll"+r+" mousewheel"+r,e(t._wheelScroll,t));i.support.kineticScrollNeeded&&(t.drag=new i.UserEvents(t.wrapper,{global:!0,start:function(n){n.sender.capture()},move:function(n){t.verticalScrollbar.scrollTop(t.verticalScrollbar.scrollTop()-n.y.delta);f.scrollLeft(f.scrollLeft()-n.x.delta);n.preventDefault()}}));t.verticalScrollbar=n('<div class="k-scrollbar k-scrollbar-vertical" />').css({width:o}).appendTo(u).bind("scroll"+r,e(t._scroll,t))},_wheelScroll:function(t){if(!t.ctrlKey){var f=this.verticalScrollbar,e=f.scrollTop(),u=i.wheelDeltaY(t);if(u&&!(u>0&&e===0)&&!(u<0&&e+f[0].clientHeight==f[0].scrollHeight)){t.preventDefault();n(t.currentTarget).one("wheel"+r,!1);this.verticalScrollbar.scrollTop(e+-u)}}},_scroll:function(n){var t=this,u=!t.options.prefetch,i=n.currentTarget.scrollTop,e=t.dataSource,r=t.itemHeight,o=e.skip()||0,s=t._rangeStart||o,h=t.element.innerHeight(),c=!!(t._scrollbarTop&&t._scrollbarTop>i),f=et.max(et.floor(i/r),0),l=et.max(f+et.floor(h/r),0);t._scrollTop=i-s*r;t._scrollbarTop=i;t._scrolling=u;t._fetch(f,l,c)||(t.wrapper[0].scrollTop=t._scrollTop);u&&(t._scrollingTimeout&&clearTimeout(t._scrollingTimeout),t._scrollingTimeout=setTimeout(function(){t._scrolling=!1;t._page(t._rangeStart,t.dataSource.take())},100))},itemIndex:function(n){var t=this._rangeStart||this.dataSource.skip()||0;return t+n},position:function(n){var t=this._rangeStart||this.dataSource.skip()||0,r=this.dataSource.pageSize(),i;return i=n>t?n-t+1:t-n-1,i>r?r:i},scrollIntoView:function(n){var i=this.wrapper[0],t=i.clientHeight,r=this._scrollTop||i.scrollTop,u=n[0].offsetTop,f=n[0].offsetHeight;r>u?this.verticalScrollbar[0].scrollTop-=t/2:u+f>=r+t&&(this.verticalScrollbar[0].scrollTop+=t/2)},_fetch:function(t,i,r){var f=this,o=f.dataSource,c=f.itemHeight,u=o.take(),e=f._rangeStart||o.skip()||0,s=et.floor(t/u)*u,h=!1,l=.33;return t<e?(h=!0,e=et.max(0,i-u),f._scrollTop=(t-e)*c,f._page(e,u)):i>=e+u&&!r?(h=!0,e=t,f._scrollTop=c,f._page(e,u)):!f._fetching&&f.options.prefetch&&(t<s+u-u*l&&t>u&&o.prefetch(s-u,u,n.noop),i>s+u*l&&o.prefetch(s+u,u,n.noop)),h},fetching:function(){return this._fetching},_page:function(n,t){var r=this,f=!r.options.prefetch,u=r.dataSource;clearTimeout(r._timeout);r._fetching=!0;r._rangeStart=n;u.inRange(n,t)?u.range(n,t):(f||i.ui.progress(r.wrapper.parent(),!0),r._timeout=setTimeout(function(){r._scrolling||(f&&i.ui.progress(r.wrapper.parent(),!0),u.range(n,t))},100))},repaintScrollbar:function(){var n=this,u="",t=25e4,h=n.dataSource,c=i.support.kineticScrollNeeded?0:i.support.scrollbar(),f=n.wrapper[0],r,e,o,s;for(o=n.itemHeight=n.options.itemHeight()||0,s=f.scrollWidth>f.offsetWidth?c:0,r=h.total()*o+s,e=0;e<et.floor(r/t);e++)u+='<div style="width:1px;height:'+t+'px"><\/div>';r%t&&(u+='<div style="width:1px;height:'+r%t+'px"><\/div>');n.verticalScrollbar.html(u);f.scrollTop=n._scrollTop},refresh:function(){var n=this,t=n.dataSource,r=n._rangeStart;i.ui.progress(n.wrapper.parent(),!1);clearTimeout(n._timeout);n.repaintScrollbar();n.drag&&n.drag.cancel();r&&!n._fetching&&(n._rangeStart=t.skip(),t.page()===1&&(n.verticalScrollbar[0].scrollTop=0));n._fetching=!1}}),b={create:{text:"Add new record",imageClass:"k-add",className:"k-grid-add",iconClass:"k-icon"},cancel:{text:"Cancel changes",imageClass:"k-cancel",className:"k-grid-cancel-changes",iconClass:"k-icon"},save:{text:"Save changes",imageClass:"k-update",className:"k-grid-save-changes",iconClass:"k-icon"},destroy:{text:"Delete",imageClass:"k-delete",className:"k-grid-delete",iconClass:"k-icon"},edit:{text:"Edit",imageClass:"k-edit",className:"k-grid-edit",iconClass:"k-icon"},update:{text:"Update",imageClass:"k-update",className:"k-primary k-grid-update",iconClass:"k-icon"},canceledit:{text:"Cancel",imageClass:"k-cancel",className:"k-grid-cancel",iconClass:"k-icon"},excel:{text:"Export to Excel",imageClass:"k-i-excel",className:"k-grid-excel",iconClass:"k-icon"},pdf:{text:"Export to PDF",imageClass:"k-i-pdf",className:"k-grid-pdf",iconClass:"k-icon"}},ei=i.ui.DataBoundWidget.extend({init:function(t,u,f){var e=this;if(u=at(u)?{dataSource:u}:u,kt.fn.init.call(e,t,u),f&&(e._events=f),nt=i.support.isRtl(t),e._element(),e._aria(),e._columns(e.options.columns),e._dataSource(),e._tbody(),e._pageable(),e._thead(),e._groupable(),e._toolbar(),e._setContentHeight(),e._templates(),e._navigatable(),e._selectable(),e._clipboard(),e._details(),e._editable(),e._attachCustomCommandsEvent(),e._minScreenSupport(),e.options.autoBind?e.dataSource.fetch():(e._group=e._groups()>0,e._footer()),e.lockedContent){e.wrapper.addClass("k-grid-lockedcolumns");e._resizeHandler=function(){e.resize()};n(window).on("resize"+r,e._resizeHandler)}i.notify(e)},events:[g,"dataBinding","cancel",nr,gr,nu,ki,br,kr,si,bi,wr,dr,tr,ru,gi,di,uu,fu,eu],setDataSource:function(n){var t=this,i=t.options.scrollable;t.options.dataSource=n;t._dataSource();t._pageable();t._thead();i&&(i.virtual?t.content.find(">.k-virtual-scrollable-wrap").scrollLeft(0):t.content.scrollLeft(0));t.options.groupable&&t._groupable();t.virtualScrollable&&t.virtualScrollable.setDataSource(t.options.dataSource);t.options.navigatable&&t._navigatable();t.options.selectable&&t._selectable();t.options.autoBind&&n.fetch()},options:{name:"Grid",columns:[],toolbar:null,autoBind:!0,filterable:!1,scrollable:!0,sortable:!1,selectable:!1,allowCopy:!1,navigatable:!1,pageable:!1,editable:!1,groupable:!1,rowTemplate:"",altRowTemplate:"",noRecords:!1,dataSource:{},height:null,resizable:!1,reorderable:!1,columnMenu:!1,detailTemplate:null,columnResizeHandleWidth:3,mobile:"",messages:{editable:{cancelDelete:"Cancel",confirmation:"Are you sure you want to delete this record?",confirmDelete:"Delete"},commands:{create:b.create.text,cancel:b.cancel.text,save:b.save.text,destroy:b.destroy.text,edit:b.edit.text,update:b.update.text,canceledit:b.canceledit.text,excel:b.excel.text,pdf:b.pdf.text},noRecords:"No records available."}},destroy:function(){var t=this,u;t._angularItems("cleanup");t._destroyColumnAttachments();kt.fn.destroy.call(t);this._navigatableTables=null;t._resizeHandler&&n(window).off("resize"+r,t._resizeHandler);t.pager&&t.pager.element&&t.pager.destroy();t.pager=null;t.groupable&&t.groupable.element&&t.groupable.element.kendoGroupable("destroy");t.groupable=null;t.options.reorderable&&t.wrapper.data("kendoReorderable").destroy();t.selectable&&t.selectable.element&&(t.selectable.destroy(),t.clearArea(),t.copyHandler&&(t.wrapper.off("keydown",t.copyHandler),t.unbind(t.copyHandler)),t.updateClipBoardState&&(t.unbind(t.updateClipBoardState),t.updateClipBoardState=null),t.clearAreaHandler&&t.wrapper.off("keyup",t.clearAreaHandler));t.selectable=null;t.resizable&&(t.resizable.destroy(),t._resizeUserEvents&&(t._resizeHandleDocumentClickHandler&&n(document).off("click",t._resizeHandleDocumentClickHandler),t._resizeUserEvents.destroy(),t._resizeUserEvents=null),t.resizable=null);t.virtualScrollable&&t.virtualScrollable.element&&t.virtualScrollable.destroy();t.virtualScrollable=null;t._destroyEditable();t.dataSource&&(t.dataSource.unbind(g,t._refreshHandler).unbind(yi,t._progressHandler).unbind(pi,t._errorHandler),t._refreshHandler=t._progressHandler=t._errorHandler=null);u=t.element.add(t.wrapper).add(t.table).add(t.thead).add(t.wrapper.find(">.k-grid-toolbar"));t.content&&(u=u.add(t.content).add(t.content.find(">.k-virtual-scrollable-wrap")));t.lockedHeader&&t._removeLockedContainers();t.pane&&t.pane.destroy();t.minScreenResizeHandler&&n(window).off("resize",t.minScreenResizeHandler);t._draggableInstance&&t._draggableInstance.element&&t._draggableInstance.destroy();t._draggableInstance=null;u.off(r);i.destroy(t.wrapper);t.rowTemplate=t.altRowTemplate=t.lockedRowTemplate=t.lockedAltRowTemplate=t.detailTemplate=t.footerTemplate=t.groupFooterTemplate=t.lockedGroupFooterTemplate=t.noRecordsTemplate=null;t.scrollables=t.thead=t.tbody=t.element=t.table=t.content=t.footer=t.wrapper=t._groupableClickHandler=t._setContentWidthHandler=null},getOptions:function(){var o=this.options,r,u,e;return o.dataSource=null,r=f(!0,{},this.options),r.columns=i.deepExtend([],this.columns),u=this.dataSource,e=u.options.data&&u._data,u.options.data=null,r.dataSource=n.extend(!0,{},u.options),u.options.data=e,r.dataSource.data=e,r.dataSource.page=u.page(),r.dataSource.filter=u.filter(),r.dataSource.pageSize=u.pageSize(),r.dataSource.sort=u.sort(),r.dataSource.group=u.group(),r.dataSource.aggregate=u.aggregate(),r.dataSource.transport&&(r.dataSource.transport.dataSource=null),r.pageable&&r.pageable.pageSize&&(r.pageable.pageSize=u.pageSize()),r.$angular=t,r},setOptions:function(n){var r=this.getOptions(),f;i.deepExtend(r,n);n.dataSource||(r.dataSource=this.dataSource);var t=this.wrapper,e=this._events,u=this.element;this.destroy();this.options=null;this._isMobile&&(f=t.closest(i.roleSelector("pane")).parent(),f.after(t),f.remove(),t.removeClass("k-grid-mobile"));t[0]!==u[0]&&(t.before(u),t.remove());u.empty();this.init(u,r,e);this._setEvents(r)},items:function(){return this.lockedContent?this._items(this.tbody).add(this._items(this.lockedTable.children("tbody"))):this._items(this.tbody)},_items:function(t){return t.children().filter(function(){var t=n(this);return!t.hasClass("k-grouping-row")&&!t.hasClass("k-detail-row")&&!t.hasClass("k-group-footer")})},dataItems:function(){var t=i.ui.DataBoundWidget.fn.dataItems.call(this),r,u,n;if(this.lockedContent){for(r=t.length,u=new Array(2*r),n=r;--n>=0;)u[n]=u[n+r]=t[n];t=u}return t},_destroyColumnAttachments:function(){var t=this;(t.resizeHandle=null,t.thead)&&(this.angular("cleanup",function(){return{elements:t.thead.get()}}),t.thead.add(t.lockedHeader).find("th").each(function(){var t=n(this),i=t.data("kendoFilterMenu"),r=t.data("kendoColumnSorter"),u=t.data("kendoColumnMenu");i&&i.destroy();r&&r.destroy();u&&u.destroy()}))},_attachCustomCommandsEvent:function(){for(var t=this,r=u(t.columns||[]),i,n=0,f=r.length;n<f;n++)i=r[n].command,i&&yf(t,t.wrapper,i)},_aria:function(){var n=this.element.attr("id")||"aria";n&&(this._cellId=n+"_active_cell")},_element:function(){var t=this,i=t.element;i.is("table")||(i=t.options.scrollable?t.element.find("> .k-grid-content > table"):t.element.children("table"),i.length||(i=n("<table />").appendTo(t.element)));ti&&i.attr("cellspacing",0);t.table=i.attr("role",t._hasDetails()?"treegrid":"grid");t._wrapper()},_createResizeHandle:function(t,i){var e=this,l=e.options.columnResizeHandleWidth,v=e.options.scrollable,u=e.resizeHandle,a=this._groups(),s,c,h;if(u&&e.lockedContent&&u.data("th")[0]!==i[0]&&(u.off(r).remove(),u=null),u||(u=e.resizeHandle=n('<div class="k-resize-handle"><div class="k-resize-handle-inner"><\/div><\/div>'),t.append(u)),nt){if(s=i.position().left,v){var f=i.closest(".k-grid-header-wrap, .k-grid-header-locked"),y=o.msie?f.scrollLeft():0,p=o.webkit?f[0].scrollWidth-f[0].offsetWidth-f.scrollLeft():0,w=o.mozilla?f[0].scrollWidth-f[0].offsetWidth-(f[0].scrollWidth-f[0].offsetWidth-f.scrollLeft()):0;s-=p-w+y}}else{for(s=i[0].offsetWidth,c=d(i.closest("thead")).filter(":visible"),h=0;h<c.length;h++){if(c[h]==i[0])break;s+=c[h].offsetWidth}a>0&&(s+=t.find(".k-group-cell:first").outerWidth()*a);e._hasDetails()&&(s+=t.find(".k-hierarchy-cell:first").outerWidth())}u.css({top:i.position().top,left:s-l,height:i.outerHeight(),width:l*3}).data("th",i).show();u.off("dblclick"+r).on("dblclick"+r,function(){e._autoFitLeafColumn(i.data("index"))})},_positionColumnResizeHandle:function(){var t=this,i=t.options.columnResizeHandleWidth,u=t.lockedHeader?t.lockedHeader.find("thead:first"):n();t.thead.add(u).on("mousemove"+r,"th",function(r){var u=n(this);if(!u.hasClass("k-group-cell")&&!u.hasClass("k-hierarchy-cell")){var f=r.clientX,e=n(window).scrollLeft(),o=u.offset().left+(nt?0:this.offsetWidth);f+e>o-i&&f+e<o+i?t._createResizeHandle(u.closest("div"),u):t.resizeHandle?t.resizeHandle.hide():rr(t.wrapper,"")}})},_resizeHandleDocumentClick:function(t){n(t.target).closest(".k-column-active").length||(n(document).off(t),this._hideResizeHandle())},_hideResizeHandle:function(){this.resizeHandle&&(this.resizeHandle.data("th").removeClass("k-column-active"),this.lockedContent&&!this._isMobile?(this.resizeHandle.off(r).remove(),this.resizeHandle=null):this.resizeHandle.hide())},_positionColumnResizeHandleTouch:function(){var t=this,r=t.lockedHeader?t.lockedHeader.find("thead:first"):n();t._resizeUserEvents=new i.UserEvents(r.add(t.thead),{filter:"th:not(.k-group-cell):not(.k-hierarchy-cell)",threshold:10,hold:function(i){var r=n(i.target);i.preventDefault();r.addClass("k-column-active");t._createResizeHandle(r.closest("div"),r);t._resizeHandleDocumentClickHandler||(t._resizeHandleDocumentClickHandler=e(t._resizeHandleDocumentClick,t));n(document).on("click",t._resizeHandleDocumentClickHandler)}})},_resizable:function(){var t=this,s=t.options,c,a,e,h,y=this._isMobile,v=i.support.mobileOS?0:i.support.scrollbar(),f,l,r;s.resizable&&(c=s.scrollable?t.wrapper.find(".k-grid-header-wrap:first"):t.wrapper,y?t._positionColumnResizeHandleTouch(c):t._positionColumnResizeHandle(c),t.resizable&&t.resizable.destroy(),t.resizable=new ht.Resizable(c.add(t.lockedHeader),{handle:(!s.scrollable?">":"")+".k-resize-handle",hint:function(i){return n('<div class="k-grid-resize-indicator" />').css({height:i.data("th").outerHeight()+t.tbody.attr("clientHeight")})},start:function(i){var v,u,c,p;r=n(i.currentTarget).data("th");y&&t._hideResizeHandle();v=r.closest("table");u=n.inArray(r[0],d(r.closest("thead")).filter(":visible"));f=v.parent().hasClass("k-grid-header-locked");c=f?t.lockedTable:t.table;p=t.footer||n();t.footer&&t.lockedContent&&(p=f?t.footer.children(".k-grid-footer-locked"):t.footer.children(".k-grid-footer-wrap"));rr(t.wrapper,"col-resize");l=s.scrollable?v.find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+u+")").add(c.children("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+u+")")).add(p.find("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+u+")")):c.children("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+u+")");a=i.x.location;e=r.outerWidth();h=f?c.children("tbody").outerWidth():t.tbody.outerWidth();o.webkit&&t.wrapper.addClass("k-grid-column-resizing")},resize:function(i){var c=nt?-1:1,y=e+i.x.location*c-a*c,o;if(s.scrollable){f&&t.lockedFooter?o=t.lockedFooter.children("table"):t.footer&&(o=t.footer.find(">.k-grid-footer-wrap>table"));o&&o[0]||(o=n());var b=r.closest("table"),k=f?t.lockedTable:t.table,w=!1,p=t.wrapper.width()-v,u=y;f&&h-e+u>p&&(u=e+(p-h-v*2),u<0&&(u=y),w=!0);u>10&&(l.css("width",u),h&&(u=w?p-v*2:h+i.x.location*c-a*c,k.add(b).add(o).css("width",u),f||(t._footerWidth=u)))}else y>10&&l.css("width",y)},resizeend:function(){var f=r.outerWidth(),s,h,n;rr(t.wrapper,"");o.webkit&&t.wrapper.removeClass("k-grid-column-resizing");e!=f&&(h=t.lockedHeader?t.lockedHeader.find("thead:first tr:first").add(t.thead.find("tr:first")):r.parent(),n=r.attr(i.attr("index")),n||(n=h.find("th:not(.k-group-cell):not(.k-hierarchy-cell)").index(r)),s=u(t.columns)[n],s.width=f,t.trigger(tr,{column:s,oldWidth:e,newWidth:f}),t._applyLockedContainersWidth(),t._syncLockedContentHeight(),t._syncLockedHeaderHeight());t._hideResizeHandle();r=null}}))},_draggable:function(){var t=this;t.options.reorderable&&(t._draggableInstance&&t._draggableInstance.destroy(),t._draggableInstance=t.wrapper.kendoDraggable({group:i.guid(),autoScroll:!0,filter:t.content?".k-grid-header:first "+wi:"table:first>.k-grid-header "+wi,drag:function(){t._hideResizeHandle()},hint:function(t){return n('<div class="k-header k-drag-clue" />').css({width:t.width(),paddingLeft:t.css("paddingLeft"),paddingRight:t.css("paddingRight"),lineHeight:t.height()+"px",paddingTop:t.css("paddingTop"),paddingBottom:t.css("paddingBottom")}).html(t.attr(i.attr("title"))||t.attr(i.attr("field"))||t.text()).prepend('<span class="k-icon k-drag-status k-denied" />')}}).data("kendoDraggable"))},_reorderable:function(){var t=this,i;t.options.reorderable&&(t.wrapper.data("kendoReorderable")&&t.wrapper.data("kendoReorderable").destroy(),i=function(n,i,r){var f=n[i],e=n[r],u=ur(f,t.columns);return n=u?u.columns:t.columns,h(e,n)},t.wrapper.kendoReorderable({draggable:t._draggableInstance,dragOverContainers:function(n,r){var u=sr(t.columns);return u[n].lockable!==!1&&i(u,n,r)>-1},inSameContainer:function(r){return n(r.source).parent()[0]===n(r.target).parent()[0]&&i(sr(t.columns),r.sourceIndex,r.targetIndex)>-1},change:function(n){var r=sr(t.columns),u=r[n.oldIndex],f=i(r,n.oldIndex,n.newIndex);t.trigger(ru,{newIndex:f,oldIndex:h(u,r),column:u});t.reorderColumn(f,u,n.position==="before")}}))},_reorderHeader:function(n,t,i){for(var r=this,f=pt(n[0],r.columns),h=pt(t,r.columns),u=[],e=0;e<n.length;e++)n[e].columns&&(u=u.concat(n[e].columns));var l=tt(r.lockedHeader,r.thead,"tr:eq("+f.row+")>th.k-header:not(.k-group-cell,.k-hierarchy-cell)"),o=s(n).length,c=s([t]).length;u.length?(o>0&&c===0?cu(n,t,u,r.columns,r.lockedHeader.find("thead"),r.thead,this._groups()):o===0&&c>0&&cu(n,t,u,r.columns,r.thead,r.lockedHeader.find("thead"),this._groups()),(t.columns||f.cell-h.cell>1||h.cell-f.cell>1)&&(t=vu(r.columns,t,n[0],i),t&&r._reorderHeader(u,t,i))):o!==c&&wf(l[f.cell],r.columns,o);lt(l,f.cell,h.cell,i,n.length)},_reorderContent:function(t,i,r){var f=this,g=n(),nt=t[0],p=k(t),e=h(nt,u(f.columns)),l=h(i,u(f.columns)),w=h(nt,it(f.columns)),a=h(i,it(f.columns)),b=s(f.columns).length,ut=!!i.locked,o=f.footer||f.wrapper.find(".k-grid-footer"),v,y,d,c,rt;for(v=y=a,i.hidden&&(ut?(a=f.lockedTable.find("colgroup"),v=f.lockedHeader.find("colgroup"),y=n(f.lockedFooter).find(">table>colgroup")):(a=f.tbody.prev(),v=f.thead.prev(),y=o.find(".k-grid-footer-wrap").find(">table>colgroup"))),f._hasFilterRow()&&lt(f.wrapper.find(".k-filter-row th:not(.k-group-cell,.k-hierarchy-cell)"),e,l,r,t.length),lt(tt(f.lockedHeader,f.thead.prev(),"col:not(.k-group-col,.k-hierarchy-col)"),w,v,r,p.length),f.options.scrollable&&lt(tt(f.lockedTable,f.tbody.prev(),"col:not(.k-group-col,.k-hierarchy-col)"),w,a,r,p.length),o&&o.length&&(lt(tt(f.lockedFooter,o.find(".k-grid-footer-wrap"),">table>colgroup>col:not(.k-group-col,.k-hierarchy-col)"),w,y,r,p.length),lt(o.find(".k-footer-template>td:not(.k-group-cell,.k-hierarchy-cell)"),e,l,r,t.length)),d=f.tbody.children(":not(.k-grouping-row,.k-detail-row)"),f.lockedTable&&(b>l?b<=e&&rf(f.lockedTable.find(">tbody>tr.k-grouping-row"),f.table.find(">tbody>tr.k-grouping-row"),t.length):b>e&&rf(f.table.find(">tbody>tr.k-grouping-row"),f.lockedTable.find(">tbody>tr.k-grouping-row"),t.length),g=f.lockedTable.find(">tbody>tr:not(.k-grouping-row,.k-detail-row)")),c=0,rt=d.length;c<rt;c+=1)lt(tt(g[c],d[c],">td:not(.k-group-cell,.k-hierarchy-cell)"),e,l,r,t.length)},_autoFitLeafColumn:function(n){this.autoFitColumn(u(this.columns)[n])},autoFitColumn:function(t){var i=this,ot=i.options,e=i.columns,r,it,s,l,lt=i.lockedHeader?d(i.lockedHeader.find(">table>thead")).filter(er).length:0,w,b="col:not(.k-group-col):not(.k-hierarchy-col)",st="td:visible:not(.k-group-cell):not(.k-hierarchy-cell)",v,rt,k,y,f,ht,g,et,nt,p,tt,ct;if(t=typeof t=="number"?e[t]:c(t)?a(ft(e),function(n){return n===t})[0]:a(ft(e),function(n){return n.field===t})[0],t&&ut(t)){for(r=h(t,u(e)),l=t.locked,s=l?i.lockedHeader.children("table"):i.thead.parent(),it=s.find("[data-index='"+r+"']"),v=l?i.lockedTable:i.table,rt=i.footer||n(),i.footer&&i.lockedContent&&(rt=l?i.footer.children(".k-grid-footer-locked"):i.footer.children(".k-grid-footer-wrap")),k=rt.find("table").first(),i.lockedHeader&&!l&&(r-=lt),y=0;y<e.length;y++)if(e[y]===t)break;else e[y].hidden&&r--;if(w=ot.scrollable?s.find(b).eq(r).add(v.children("colgroup").find(b).eq(r)).add(k.find("colgroup").find(b).eq(r)):v.children("colgroup").find(b).eq(r),f=s.add(v).add(k),ht=it.outerWidth(),w.width(""),f.css("table-layout","fixed"),w.width("auto"),f.addClass("k-autofitting"),f.css("table-layout",""),g=Math.ceil(Math.max(it.outerWidth(),v.find("tr:not(.k-grouping-row)").eq(0).children(st).eq(r).outerWidth(),k.find("tr").eq(0).children(st).eq(r).outerWidth()))+1,w.width(g),t.width=g,ot.scrollable){for(et=s.find("col"),p=0,tt=0,ct=et.length;tt<ct;tt+=1)if(nt=et[tt].style.width,nt&&nt.indexOf("%")==-1)p+=parseInt(nt,10);else{p=0;break}p&&f.each(function(){this.style.width=p+"px"})}o.msie&&o.version==8&&(f.css("display","inline-table"),setTimeout(function(){f.css("display","table")},1));f.removeClass("k-autofitting");i.trigger(tr,{column:t,oldWidth:ht,newWidth:g});i._applyLockedContainersWidth();i._syncLockedContentHeight();i._syncLockedHeaderHeight()}},reorderColumn:function(n,i,r){var f=this,y=ur(i,f.columns),l=y?y.columns:f.columns,o=h(i,l),e=l[n],a,c=!!e.locked,p=s(f.columns).length,v;o!==n&&(i.locked||!c||ot(f.columns).length!=1)&&(!i.locked||c||p!=1)&&(f._hideResizeHandle(),r===t&&(r=n<o),v=[i],f._reorderHeader(v,e,r),f.lockedHeader&&(hr(f.thead),hr(f.lockedHeader)),e.columns&&(e=u(e.columns),e=e[r?0:e.length-1]),i.columns&&(v=u(i.columns)),f._reorderContent(v,e,r),a=!!i.locked,a=a!=c,i.locked=c,l.splice(r?n:n+1,0,i),l.splice(o<n?o:o+1,1),f._templates(),f._updateColumnCellIndex(),f._updateTablesWidth(),f._applyLockedContainersWidth(),f._syncLockedHeaderHeight(),f._syncLockedContentHeight(),f._updateFirstColumnClass(),a)&&(c?f.trigger(uu,{column:i}):f.trigger(fu,{column:i}))},_updateColumnCellIndex:function(){var n,t=0;this.lockedHeader&&(n=this.lockedHeader.find("thead"),t=lu(n,s(this.columns)));lu(this.thead,ot(this.columns),t)},lockColumn:function(n){var t=this.columns,i;(n=typeof n=="number"?t[n]:a(t,function(t){return t.field===n})[0],!n||n.locked||n.hidden)||(i=s(t).length-1,this.reorderColumn(i,n,!1))},unlockColumn:function(n){var t=this.columns,i;(n=typeof n=="number"?t[n]:a(t,function(t){return t.field===n})[0],n&&n.locked&&!n.hidden)&&(i=s(t).length,this.reorderColumn(i,n,!0))},cellIndex:function(t){var i=0;return this.lockedTable&&!n.contains(this.lockedTable[0],t[0])&&(i=u(s(this.columns)).length),n(t).parent().children("td:not(.k-group-cell,.k-hierarchy-cell)").index(t)+i},_modelForContainer:function(t){t=n(t);t.is("tr")||this._editMode()==="popup"||(t=t.closest("tr"));var r=t.attr(i.attr("uid"));return this.dataSource.getByUid(r)},_editable:function(){var t=this,f=t.selectable&&t.selectable.options.multiple,i=t.options.editable,e=function(){var i=ct(),r=t._editContainer;!r||n.contains(r[0],i)||r[0]===i||n(i).closest(".k-animation-container").length||t.editable.end()&&t.closeCell()},u;if(i){if(u=t._editMode(),u==="incell"){if(i.update!==!1)t.wrapper.on(l+r,"tr:not(.k-grouping-row) > td",function(i){var r=n(this),u=t.lockedTable&&r.closest("table")[0]===t.lockedTable[0];r.hasClass("k-hierarchy-cell")||r.hasClass("k-detail-cell")||r.hasClass("k-group-cell")||r.hasClass("k-edit-cell")||r.has("a.k-grid-delete").length||r.has("button.k-grid-delete").length||r.closest("tbody")[0]!==t.tbody[0]&&!u||n(i.target).is(":input")||(t.editable?t.editable.end()&&(f&&n(ct()).blur(),t.closeCell(),t.editCell(r)):t.editCell(r))}).on("focusin"+r,function(){n.contains(this,ct())||(clearTimeout(t.timer),t.timer=null)}).on("focusout"+r,function(){t.timer=setTimeout(e,1)})}else if(i.update!==!1)t.wrapper.on(l+r,"tbody>tr:not(.k-detail-row,.k-grouping-row):visible a.k-grid-edit",function(i){i.preventDefault();t.editRow(n(this).closest("tr"))});if(i.destroy!==!1)t.wrapper.on(l+r,"tbody>tr:not(.k-detail-row,.k-grouping-row):visible .k-grid-delete",function(i){i.preventDefault();i.stopPropagation();t.removeRow(n(this).closest("tr"))});else t.wrapper.on(l+r,"tbody>tr:not(.k-detail-row,.k-grouping-row):visible button.k-grid-delete",function(n){n.stopPropagation();t._confirmation()||n.preventDefault()})}},editCell:function(t){var e;t=n(t);var i=this,r=u(i.columns)[i.cellIndex(t)],f=i._modelForContainer(t);i.closeCell();f&&(!f.editable||f.editable(r.field))&&!r.command&&r.field&&(i._attachModelChange(f),i._editContainer=t,i.editable=t.addClass("k-edit-cell").kendoEditable({fields:{field:r.field,format:r.format,editor:r.editor,values:r.values},model:f,target:i,change:function(n){i.trigger(bi,{values:n.values,container:t,model:f})&&n.preventDefault()}}).data("kendoEditable"),e=t.parent().addClass("k-grid-edit-row"),i.lockedContent&&oi(e[0],i._relatedRow(e).addClass("k-grid-edit-row")[0]),i.trigger(si,{container:t,model:f}))},_adjustLockedHorizontalScrollBar:function(){var n=this.table,t=n.parent(),r=n[0].offsetWidth>t[0].clientWidth?i.support.scrollbar():0;this.lockedContent.height(t.height()-r)},_syncLockedContentHeight:function(){this.lockedTable&&(this.touchScroller||this._adjustLockedHorizontalScrollBar(),this._adjustRowsHeight(this.table,this.lockedTable))},_syncLockedHeaderHeight:function(){if(this.lockedHeader){var n=this.lockedHeader.children("table"),t=this.thead.parent();this._adjustRowsHeight(n,t);ie(n,t)}},_syncLockedFooterHeight:function(){this.lockedFooter&&this.footer&&this.footer.length&&this._adjustRowsHeight(this.lockedFooter.children("table"),this.footer.find(".k-grid-footer-wrap > table"))},_destroyEditable:function(){var n=this,t=function(){if(n.editable){var t=n.editView?n.editView.element:n._editContainer;t&&(t.off(l+r,"a.k-grid-cancel",n._editCancelClickHandler),t.off(l+r,"a.k-grid-update",n._editUpdateClickHandler));n._detachModelChange();n.editable.destroy();n.editable=null;n._editContainer=null;n._destroyEditView()}};n.editable&&(n._editMode()!=="popup"||n._isMobile?t():n._editContainer.data("kendoWindow").bind("deactivate",t).close());n._actionSheet&&(n._actionSheet.destroy(),n._actionSheet=null)},_destroyEditView:function(){this.editView&&(this.editView.purge(),this.editView=null,this.pane.navigate(""))},_attachModelChange:function(n){var t=this;t._modelChangeHandler=function(n){t._modelChange({field:n.field,model:this})};n.bind("change",t._modelChangeHandler)},_detachModelChange:function(){var n=this,i=n._editContainer,t=n._modelForContainer(i);t&&t.unbind(g,n._modelChangeHandler)},closeCell:function(t){var r=this,f=r._editContainer,s,h,e,o;f&&((s=f.closest("tr").attr(i.attr("uid")),o=r.dataSource.getByUid(s),t&&r.trigger("cancel",{container:f,model:o}))||(f.removeClass("k-edit-cell"),h=u(r.columns)[r.cellIndex(f)],e=f.parent().removeClass("k-grid-edit-row"),r._destroyEditable(),r._displayCell(f,h,o),f.hasClass("k-dirty-cell")&&n('<span class="k-dirty"/>').prependTo(f),r.trigger("itemChange",{item:e,data:o,ns:ht}),r.lockedContent&&oi(e.css("height","")[0],r._relatedRow(e).css("height","")[0])))},_displayCell:function(n,t,r){var u=this,o={storage:{},count:0},h=f({},i.Template,u.options.templateSettings),s=i.template(u._cellTmpl(t,o),h);o.count>0&&(s=e(s,o.storage));n.empty().html(s(r));u.angular("compile",function(){return{elements:n,data:[{dataItem:r}]}})},removeRow:function(n){this._confirmation(n)&&this._removeRow(n)},_removeRow:function(t){var i=this,r,u=i._editMode();u!=="incell"&&i.cancelRow();t=n(t);i.lockedContent&&(t=t.add(i._relatedRow(t)));t=t.hide();r=i._modelForContainer(t);r&&!i.trigger(wr,{row:t,model:r})?(i.dataSource.remove(r),(u==="inline"||u==="popup")&&i.dataSource.sync()):u==="incell"&&i._destroyEditable()},_editMode:function(){var t="incell",n=this.options.editable;return n!==!0&&(t=typeof n=="string"?n:n.mode||t),t},editRow:function(t){var o,f=this,s,h;if(t instanceof i.data.ObservableObject?o=t:(t=n(t),o=f._modelForContainer(t)),s=f._editMode(),f.cancelRow(),o&&(t=f.tbody.children("["+i.attr("uid")+"="+o.uid+"]"),f._attachModelChange(o),s==="popup"?f._createPopupEditor(o):s==="inline"?f._createInlineEditor(t,o):s==="incell"&&n(t).children(y).each(function(){var t=n(this),i=u(f.columns)[t.index()];return o=f._modelForContainer(t),o&&(!o.editable||o.editable(i.field))&&i.field?(f.editCell(t),!1):void 0}),h=f.editView?f.editView.element:f._editContainer,h)){this._editCancelClickHandler||(this._editCancelClickHandler=e(this._editCancelClick,this));h.on(l+r,"a.k-grid-cancel",this._editCancelClickHandler);this._editUpdateClickHandler||(this._editUpdateClickHandler=e(this._editUpdateClick,this));h.on(l+r,"a.k-grid-update",this._editUpdateClickHandler)}},_editUpdateClick:function(n){n.preventDefault();n.stopPropagation();this.saveRow()},_editCancelClick:function(t){var i=this,u=i.options.navigatable,f=i.editable.options.model,e=i.editView?i.editView.element:i._editContainer,r;(t.preventDefault(),t.stopPropagation(),i.trigger("cancel",{container:e,model:f}))||(r=i.items().index(n(i.current()).parent()),i.cancelRow(),u&&(i._setCurrent(i.items().eq(r).children().filter(vt).first()),w(i.table,!0)))},_createPopupEditor:function(t){var r=this,s="<div "+i.attr("uid")+'="'+t.uid+'" class="k-popup-edit-form'+(r._isMobile?" k-mobile-list":"")+'"><div class="k-edit-form-container">',o,h,ft=[],l,k,d,it,rt,a,g=u(r.columns),v,ut=r.options.editable,y=ut.template,nt=c(ut)?ut.window:{},et=f({},i.Template,r.options.templateSettings),tt,b;if(nt=nt||{},y)for(typeof y===p&&(y=window.unescape(y)),s+=i.template(y,et)(t),l=0,k=g.length;l<k;l++)o=g[l],o.command&&(a=lr(o.command,"edit"),a&&(h=a));else for(l=0,k=g.length;l<k;l++)o=g[l],o.command?o.command&&(a=lr(o.command,"edit"),a&&(h=a)):(s+='<div class="k-edit-label"><label for="'+o.field+'">'+(o.title||o.field||"")+"<\/label><\/div>",(!t.editable||t.editable(o.field))&&o.field?(ft.push({field:o.field,format:o.format,editor:o.editor,values:o.values}),s+="<div "+i.attr("container-for")+'="'+o.field+'" class="k-edit-field"><\/div>'):(tt={storage:{},count:0},d=i.template(r._cellTmpl(o,tt),et),tt.count>0&&(d=e(d,tt.storage)),s+='<div class="k-edit-field">'+d(t)+"<\/div>"));h&&c(h)&&(h.text&&c(h.text)&&(it=h.text.update,rt=h.text.cancel),h.attr&&(v=h.attr));r._isMobile?(s+="<\/div><\/div>",r.editView=r.pane.append("<div data-"+i.ns+'role="view" data-'+i.ns+'use-native-scrolling="true" data-'+i.ns+'init-widgets="false" class="k-grid-edit-form"><div data-'+i.ns+'role="header" class="k-header">'+r._createButton({name:"update",text:it,attr:v})+(nt.title||"Edit")+r._createButton({name:"canceledit",text:rt,attr:v})+"<\/div>"+s+"<\/div>"),b=r._editContainer=r.editView.element.find(".k-popup-edit-form")):(s+='<div class="k-edit-buttons k-state-default">',s+=r._createButton({name:"update",text:it,attr:v})+r._createButton({name:"canceledit",text:rt,attr:v}),s+="<\/div><\/div><\/div>",b=r._editContainer=n(s).appendTo(r.wrapper).eq(0).kendoWindow(f({modal:!0,resizable:!1,draggable:!0,title:"Edit",visible:!1,close:function(i){if(i.userTriggered){if(i.sender.element.focus(),r.trigger("cancel",{container:b,model:t})){i.preventDefault();return}var u=r.items().index(n(r.current()).parent());r.cancelRow();r.options.navigatable&&(r._setCurrent(r.items().eq(u).children().filter(vt).first()),w(r.table,!0))}}},nt)));r.editable=r._editContainer.kendoEditable({fields:ft,model:t,clearContainer:!1,target:r}).data("kendoEditable");r._isMobile&&b.find("input[type=checkbox],input[type=radio]").parent(".k-edit-field").addClass("k-check").prev(".k-edit-label").addClass("k-check").click(function(){n(this).next().children("input").click()});r._openPopUpEditor();r.trigger(si,{container:b,model:t})},_openPopUpEditor:function(){this._isMobile?this.pane.navigate(this.editView,this._editAnimation):this._editContainer.data("kendoWindow").center().open()},_createInlineEditor:function(t,r){var f=this,e,s,o,h=[];f.lockedContent&&(t=t.add(f._relatedRow(t)));t.children(":not(.k-group-cell,.k-hierarchy-cell)").each(function(){if(s=n(this),e=u(f.columns)[f.cellIndex(s)],!e.command&&e.field&&(!r.editable||r.editable(e.field)))h.push({field:e.field,format:e.format,editor:e.editor,values:e.values}),s.attr(i.attr("container-for"),e.field),s.empty();else if(e.command&&(o=lr(e.command,"edit"),o)){s.empty();var l,a,t;c(o)&&(o.text&&c(o.text)&&(l=o.text.update,a=o.text.cancel),o.attr&&(t=o.attr));n(f._createButton({name:"update",text:l,attr:t})+f._createButton({name:"canceledit",text:a,attr:t})).appendTo(s)}});f._editContainer=t;f.editable=new i.ui.Editable(t.addClass("k-grid-edit-row"),{target:f,fields:h,model:r,clearContainer:!1});t.length>1&&(oi(t[0],t[1]),f._applyLockedContainersWidth());f.trigger(si,{container:t,model:r})},cancelRow:function(n){var t=this,r=t._editContainer,u;if(r){if(u=t._modelForContainer(r),n&&t.trigger("cancel",{container:r,model:u}))return;t._destroyEditable();t.dataSource.cancelChanges(u);t._editMode()!=="popup"?t._displayRow(r):t._displayRow(t.tbody.find("["+i.attr("uid")+"="+u.uid+"]"))}},saveRow:function(){var n=this,t=n._editContainer,r=n._modelForContainer(t),i=n.editable;t&&i&&i.end()&&!n.trigger(bi,{container:t,model:r})&&n.dataSource.sync()},_displayRow:function(t){var i=this,f=i._modelForContainer(t),r,u,e,c=t.hasClass("k-state-selected"),h=t.hasClass("k-alt"),o,s;f&&(i.lockedContent&&(r=n((h?i.lockedAltRowTemplate:i.lockedRowTemplate)(f)),i._relatedRow(t.last()).replaceWith(r)),i.angular("cleanup",function(){return{elements:t.get()}}),u=n((h?i.altRowTemplate:i.rowTemplate)(f)),t.replaceWith(u),o=u,s=[{dataItem:f}],r&&r.length&&(o=u.add(r),s.push({dataItem:f})),i.angular("compile",function(){return{elements:o.get(),data:s}}),c&&i.options.selectable&&i.select(u.add(r)),r&&oi(u[0],r[0]),e=u.next(),e.hasClass("k-detail-row")&&e.is(":visible")&&u.find(".k-hierarchy-cell .k-icon").removeClass("k-plus").addClass("k-minus"))},_showMessage:function(t,r){var u=this;if(!u._isMobile)return window.confirm(t.title);var f=i.template('<ul><li class="km-actionsheet-title">#:title#<\/li><li><a href="\\#" class="k-button k-grid-delete">#:confirmDelete#<\/a><\/li><\/ul>'),e=n(f(t)).appendTo(u.view.element),o=u._actionSheet=new i.mobile.ui.ActionSheet(e,{cancel:t.cancelDelete,cancelTemplate:'<li class="km-actionsheet-cancel"><a class="k-button" href="\\#">#:cancel#<\/a><\/li>',close:function(){this.destroy()},command:function(t){var i=n(t.currentTarget).parent();i.hasClass("km-actionsheet-cancel")||u._removeRow(r)},popup:u._actionSheetPopupOptions});return o.open(r),!1},_confirmation:function(n){var t=this,r=t.options.editable,i=r===!0||typeof r===p?t.options.messages.editable.confirmation:r.confirmation;return i!==!1&&i!=null?(typeof i===yt&&(i=i(t._modelForContainer(n))),t._showMessage({confirmDelete:r.confirmDelete||t.options.messages.editable.confirmDelete,cancelDelete:r.cancelDelete||t.options.messages.editable.cancelDelete,title:i===!0?t.options.messages.editable.confirmation:i},n)):!0},cancelChanges:function(){this.dataSource.cancelChanges()},saveChanges:function(){var n=this;(n.editable&&n.editable.end()||!n.editable)&&!n.trigger(dr)&&n.dataSource.sync()},addRow:function(){var n=this,r,t=n.dataSource,f=n._editMode(),s=n.options.editable.createAt||"",e=t.pageSize(),o=t.view()||[];if(n.editable&&n.editable.end()||!n.editable){f!="incell"&&n.cancelRow();r=t.indexOf(o[0]);s.toLowerCase()=="bottom"&&(r+=o.length,e&&!t.options.serverPaging&&e<=o.length&&(r-=1));r<0&&(r=t.page()>t.totalPages()?(t.page()-1)*e:0);var h=t.insert(r,{}),l=h.uid,a=n.lockedContent?n.lockedTable:n.table,u=a.find("tr["+i.attr("uid")+"="+l+"]"),c=u.children("td:not(.k-group-cell,.k-hierarchy-cell)").eq(n._firstEditableColumnIndex(u));f==="inline"&&u.length?n.editRow(u):f==="popup"?n.editRow(h):c.length&&n.editCell(c);s.toLowerCase()=="bottom"&&n.lockedContent&&(n.lockedContent[0].scrollTop=n.content[0].scrollTop=n.content[0].offsetHeight)}},_firstEditableColumnIndex:function(n){for(var f=this,t,e=u(f.columns),r=f._modelForContainer(n),i=0,o=e.length;i<o;i++)if(t=e[i],r&&(!r.editable||r.editable(t.field))&&!t.command&&t.field&&t.hidden!==!0)return i;return-1},_toolbar:function(){var t=this,s=t.wrapper,u=t.options.toolbar,o=t.options.editable,f;if(u){if(f=t.wrapper.find(".k-grid-toolbar"),f.length||(sf(u)||(u=typeof u===p?u:t._toolbarTmpl(u).replace(hi,"\\#"),u=e(i.template(u),t)),f=n('<div class="k-header k-grid-toolbar" />').html(u({})).prependTo(s),t.angular("compile",function(){return{elements:f.get()}})),o&&o.create!==!1)f.on(l+r,".k-grid-add",function(n){n.preventDefault();t.addRow()}).on(l+r,".k-grid-cancel-changes",function(n){n.preventDefault();t.cancelChanges()}).on(l+r,".k-grid-save-changes",function(n){n.preventDefault();t.saveChanges()});f.on(l+r,".k-grid-excel",function(n){n.preventDefault();t.saveAsExcel()});f.on(l+r,".k-grid-pdf",function(n){n.preventDefault();t.saveAsPDF()})}},_toolbarTmpl:function(n){var u=this,t,i,r="";if(at(n))for(t=0,i=n.length;t<i;t++)r+=u._createButton(n[t]);return r},_createButton:function(n){var s=n.template||af,r=typeof n===p?n:n.name||n.text,l=b[r]?b[r].className:"k-grid-"+(r||"").replace(/\s/g,""),u={className:l,text:r,imageClass:"",attr:"",iconClass:""},o=this.options.messages.commands,e;if(!r&&!(c(n)&&n.template))throw new Error("Custom commands should have name specified");return c(n)?(n=f(!0,{},n),n.className&&h(u.className,n.className.split(" "))<0?n.className+=" "+u.className:n.className===t&&(n.className=u.className),r==="edit"&&c(n.text)&&(n=f(!0,{},n),n.text=n.text.edit),n.attr&&(c(n.attr)&&(n.attr=ii(n.attr)),typeof n.attr===p&&(e=n.attr.match(/class="(.+?)"/),e&&h(e[1],n.className.split(" "))<0&&(n.className+=" "+e[1]))),u=f(!0,u,b[r],{text:o[r]},n)):u=f(!0,u,b[r],{text:o[r]}),i.template(s)(u)},_hasFooters:function(){return!!this.footerTemplate||!!this.groupFooterTemplate||this.footer&&this.footer.length>0||this.wrapper.find(".k-grid-footer").length>0},_groupable:function(){var t=this;if(t._groupableClickHandler?t.table.add(t.lockedTable).off(l+r,t._groupableClickHandler):t._groupableClickHandler=function(i){var r=n(this),u=r.closest("tr");r.hasClass("k-i-collapse")?t.collapseGroup(u):t.expandGroup(u);i.preventDefault();i.stopPropagation()},t._isLocked())t.lockedTable.on(l+r,".k-grouping-row .k-i-collapse, .k-grouping-row .k-i-expand",t._groupableClickHandler);else t.table.on(l+r,".k-grouping-row .k-i-collapse, .k-grouping-row .k-i-expand",t._groupableClickHandler);t._attachGroupable()},_attachGroupable:function(){var t=this,r=t.wrapper,u=t.options.groupable,e=wi+"["+i.attr("field")+"]",o=t.content?".k-grid-header:first "+e:"table:first>.k-grid-header "+e;u&&u.enabled!==!1&&(r.has("div.k-grouping-header")[0]||n("<div>&nbsp;<\/div>").addClass("k-grouping-header").prependTo(r),t.groupable&&t.groupable.destroy(),t.groupable=new ht.Groupable(r,f({},u,{draggable:t._draggableInstance,groupContainer:">div.k-grouping-header",dataSource:t.dataSource,draggableElements:o,filter:o,allowDrag:t.options.reorderable})))},_continuousItems:function(t,i){var r;if(this.lockedContent){var u=this,o=u.table.add(u.lockedTable),h=n(t,o[0]),c=n(t,o[1]),f=i?s(u.columns).length:1,l=i?u.columns.length-f:1,e=[];for(r=0;r<h.length;r+=f)vr.apply(e,h.slice(r,r+f)),vr.apply(e,c.splice(0,l));return e}},_selectable:function(){var t=this,s,f,u=[],c=t._isLocked(),o=t.options.selectable,e,l;if(o&&(t.selectable&&t.selectable.destroy(),o=i.ui.Selectable.parseOptions(o),s=o.multiple,f=o.cell,t._hasDetails()&&(u[u.length]=".k-detail-row"),(t.options.groupable||t._hasFooters())&&(u[u.length]=".k-grouping-row,.k-group-footer"),u=u.join(","),u!==""&&(u=":not("+u+")"),e=t.table,c&&(e=e.add(t.lockedTable)),l=">"+(f?hf:"tbody>tr"+u),t.selectable=new i.ui.Selectable(e,{filter:l,aria:!0,multiple:s,change:function(){t.trigger(g)},useAllItems:c&&s&&f,relatedTarget:function(i){var e,r,u,o;if(!f&&c){for(r=n(),u=0,o=i.length;u<o;u++)e=t._relatedRow(i[u]),h(e[0],i)<0&&(r=r.add(e));return r}},continuousItems:function(){return t._continuousItems(l,f)}}),t.options.navigatable))e.on("keydown"+r,function(i){var r=t.current(),u=i.target;if(i.keyCode===v.SPACEBAR&&n.inArray(u,e)>-1&&!r.is(".k-edit-cell,.k-header")&&r.parent().is(":not(.k-grouping-row,.k-detail-row,.k-group-footer)")){if(i.preventDefault(),i.stopPropagation(),r=f?r:r.parent(),c&&!f&&(r=r.add(t._relatedRow(r))),s)if(i.ctrlKey){if(r.hasClass(tu)){r.removeClass(tu);t.trigger(g);return}}else t.selectable.clear();else t.selectable.clear();t.selectable.value(r)}})},_clipboard:function(){var t=this.options,i=t.selectable,n;if(i&&t.allowCopy){if(n=this,!t.navigatable)n.table.add(n.lockedTable).attr("tabindex",0).on("mousedown"+r+" keydown"+r,".k-detail-cell",function(n){n.target!==n.currentTarget&&n.stopImmediatePropagation()}).on("mousedown"+r,rt+">"+vt,e(ff,n));n.copyHandler=e(n.copySelection,n);n.updateClipBoardState=function(){n.areaClipBoard&&n.areaClipBoard.val(n.getTSV()).focus().select()};n.bind("change",n.updateClipBoardState);n.wrapper.on("keydown",n.copyHandler);n.clearAreaHandler=e(n.clearArea,n);n.wrapper.on("keyup",n.clearAreaHandler)}},copySelection:function(t){t instanceof jQuery.Event&&!t.ctrlKey&&!t.metaKey||n(t.target).is("input:visible,textarea:visible")||window.getSelection&&window.getSelection().toString()||document.selection&&document.selection.createRange().text||(this.areaClipBoard||(this.areaClipBoard=n("<textarea />").css({position:"fixed",top:"50%",left:"50%",opacity:0,width:0,height:0}).appendTo(this.wrapper)),this.areaClipBoard.val(this.getTSV()).focus().select())},getTSV:function(){var i=this,r=i.select(),c="\t",o=i.options.allowCopy,l=!0,u,e;if(n.isPlainObject(o)&&o.delimeter&&(c=o.delimeter),u="",r.length){r.eq(0).is("tr")&&(r=r.find("td:not(.k-group-cell)"));l&&r.filter(":visible");var t=[],h=this.columns.length,a=i._isLocked()&&s(i.columns).length,f=!0;n.each(r,function(r,u){var s;u=n(u);var c=u.closest("tr"),o=c.index(),e=u.index();l&&(e-=u.prevAll(":hidden").length);a&&f&&(f=n.contains(i.lockedTable[0],u[0]));i._groups()&&f&&(e-=i._groups());e=f?e:e+a;h>e&&(h=e);s=u.text();t[o]||(t[o]=[]);t[o][e]=s});e=t.length;t=n.each(t,function(n,i){i&&(t[n]=i.slice(h),e>n&&(e=n))});n.each(t.slice(e),function(n,t){u+=t?t.join(c)+"\r\n":"\r\n"})}return u},clearArea:function(t){this.areaClipBoard&&t&&t.target===this.areaClipBoard[0]&&(this.options.navigatable?n(this.current()).closest("table").focus():this.table.focus());this.areaClipBoard&&(this.areaClipBoard.remove(),this.areaClipBoard=null)},_minScreenSupport:function(){var t=this.hideMinScreenCols();if(t){this.minScreenResizeHandler=e(this.hideMinScreenCols,this);n(window).on("resize",this.minScreenResizeHandler)}},hideMinScreenCols:function(){for(var n,i,u=this.columns,f=!1,e=window.innerWidth>0?window.innerWidth:screen.width,r=0;r<u.length;r++)n=u[r],i=n.minScreenWidth,i!==t&&i!==null&&(f=!0,i>e?this.hideColumn(n):this.showColumn(n));return f},_relatedRow:function(t){var r=this.lockedTable,i,u;return(t=n(t),!r)?t:(i=t.closest(this.table.add(this.lockedTable)),u=i.find(">tbody>tr").index(t),i=i[0]===this.table[0]?r:this.table,i.find(">tbody>tr").eq(u))},clearSelection:function(){var n=this;n.selectable.clear();n.trigger(g)},select:function(t){var r=this,i=r.selectable;if(t=n(t),t.length){i.options.multiple||(i.clear(),t=t.first());r._isLocked()&&(t=t.add(t.map(function(){return r._relatedRow(this)})));i.value(t);return}return i.value()},_updateCurrentAttr:function(t,i){var r=n(t).data("headerId"),u;n(t).removeClass(gt).removeAttr("aria-describedby").closest("table").removeAttr("aria-activedescendant");r?(r=r.replace(this._cellId,""),n(t).attr("id",r)):n(t).removeAttr("id");i.data("headerId",i.attr("id")).attr("id",this._cellId).addClass(gt).closest("table").attr("aria-activedescendant",this._cellId);i.closest("tr").hasClass("k-grouping-row")||i.hasClass("k-header")?i.attr("aria-describedby",this._cellId):(u=this.columns[this.cellIndex(i)],u&&(r=u.headerAttributes.id),i.attr("aria-describedby",r+" "+this._cellId));this._current=i},_scrollCurrent:function(){var i=this._current,u=this.options.scrollable,e;if(i&&u){var t=i.parent(),f=t.closest("table").parent(),o=f.is(".k-grid-content-locked,.k-grid-header-locked"),s=f.is(".k-grid-content-locked,.k-grid-content,.k-virtual-scrollable-wrap"),r=n(this.content).find(">.k-virtual-scrollable-wrap").andSelf().last()[0];s&&(u.virtual?(e=Math.max(h(t[0],this._items(t.parent())),0),this._rowVirtualIndex=this.virtualScrollable.itemIndex(e),this.virtualScrollable.scrollIntoView(t)):this._scrollTo(this._relatedRow(t)[0],r));this.lockedContent&&(this.lockedContent[0].scrollTop=r.scrollTop);o||this._scrollTo(i[0],r)}},current:function(n){return this._setCurrent(n,!0)},_setCurrent:function(t,i){var r=this._current;return t=n(t),t.length&&(r&&r[0]===t[0]||(this._updateCurrentAttr(r,t),this._scrollCurrent(),i||this.trigger(eu,{element:t}))),this._current},_removeCurrent:function(){this._current&&(this._current.removeClass(gt),this._current=null)},_scrollTo:function(t,r){var v=t.tagName.toLowerCase(),u=v==="td"||v==="th",e=t[u?"offsetLeft":"offsetTop"],y=t[u?"offsetWidth":"offsetHeight"],f=r[u?"scrollLeft":"scrollTop"],h=r[u?"clientWidth":"clientHeight"],p=e+y,s=0,c=0,l=0,a;nt&&u&&(a=n(t).closest("table")[0],o.msie?c=a.offsetLeft:o.mozilla&&(l=a.offsetLeft-i.support.scrollbar()));f=Math.abs(f+c-l);s=f>e?e:p>f+h?y<=h?p-h:e:f;s=Math.abs(s+c)+l;r[u?"scrollLeft":"scrollTop"]=s},_navigatable:function(){var t=this;if(t.options.navigatable){var f=t.table.add(t.lockedTable),o=t.thead.parent().add(n(">table",t.lockedHeader)),u=f;t.options.scrollable&&(u=u.add(o),o.attr(ni,-1));this._navigatableTables=u;u.off("mousedown"+r+" focus"+r+" focusout"+r+" keydown"+r);o.on("keydown"+r,e(t._openHeaderMenu,t)).find("a.k-link").attr("tabIndex",-1);f.attr(ni,et.max(f.attr(ni)||0,0)).on("mousedown"+r+" keydown"+r,".k-detail-cell",function(n){n.target!==n.currentTarget&&n.stopImmediatePropagation()});u.on(i.support.touch?"touchstart"+r:"mousedown"+r,rt+">"+vt,e(ff,t)).on("focus"+r,e(t._tableFocus,t)).on("focusout"+r,e(t._tableBlur,t)).on("keydown"+r,e(t._tableKeyDown,t))}},_openHeaderMenu:function(n){n.altKey&&n.keyCode==v.DOWN&&(this.current().find(".k-grid-filter, .k-header-column-menu").click(),n.stopImmediatePropagation())},_setTabIndex:function(n){this._navigatableTables.attr(ni,-1);n.attr(ni,0)},_tableFocus:function(t){if(!i.support.touch){var r=this.current(),u=n(t.currentTarget);r&&r.is(":visible")?r.addClass(gt):this._setCurrent(u.find(pr));this._setTabIndex(u)}},_tableBlur:function(){var n=this.current();n&&n.removeClass(gt)},_tableKeyDown:function(t){var i=this.current(),e=this.virtualScrollable&&this.virtualScrollable.fetching(),f=n(t.target),u=!t.isDefaultPrevented()&&!f.is(":button,a,:input,a>.k-icon"),r;if(e){t.preventDefault();return}(i=i?i:n(this.lockedTable).add(this.table).find(pr),i.length)&&(r=!1,u&&t.keyCode==v.UP&&(r=this._moveUp(i)),u&&t.keyCode==v.DOWN&&(r=this._moveDown(i)),u&&t.keyCode==(nt?v.LEFT:v.RIGHT)&&(r=this._moveRight(i,t.altKey)),u&&t.keyCode==(nt?v.RIGHT:v.LEFT)&&(r=this._moveLeft(i,t.altKey)),u&&t.keyCode==v.PAGEDOWN&&(r=this._handlePageDown()),u&&t.keyCode==v.PAGEUP&&(r=this._handlePageUp()),(t.keyCode==v.ENTER||t.keyCode==v.F2)&&(r=this._handleEnterKey(i,t.currentTarget,f)),t.keyCode==v.ESC&&(r=this._handleEscKey(i,t.currentTarget)),t.keyCode==v.TAB&&(r=this._handleTabKey(i,t.currentTarget,t.shiftKey)),r&&(t.preventDefault(),t.stopPropagation()))},_moveLeft:function(n,t){var r,u,f=n.parent(),i=f.parent();return t?this.collapseRow(f):(u=i.find(rt).index(f),r=this._prevHorizontalCell(i,n,u),r[0]||(i=this._horizontalContainer(i),r=this._prevHorizontalCell(i,n,u),r[0]!==n[0]&&w(i.parent(),!0)),this._setCurrent(r)),!0},_moveRight:function(n,t){var r,u,f=n.parent(),i=f.parent();return t?this.expandRow(f):(u=i.find(rt).index(f),r=this._nextHorizontalCell(i,n,u),r[0]||(i=this._horizontalContainer(i,!0),r=this._nextHorizontalCell(i,n,u),r[0]!==n[0]&&w(i.parent(),!0)),this._setCurrent(r)),!0},_moveUp:function(n){var t=n.parent().parent(),i=this._prevVerticalCell(t,n);return i[0]||(t=this._verticalContainer(t,!0),i=this._prevVerticalCell(t,n),i[0]&&w(t.parent(),!0)),this._setCurrent(i),!0},_moveDown:function(n){var t=n.parent().parent(),i=this._nextVerticalCell(t,n);return i[0]||(t=this._verticalContainer(t),i=this._nextVerticalCell(t,n),i[0]&&w(t.parent(),!0)),this._setCurrent(i),!0},_handlePageDown:function(){return this.options.pageable?(this.dataSource.page(this.dataSource.page()+1),!0):!1},_handlePageUp:function(){return this.options.pageable?(this.dataSource.page(this.dataSource.page()-1),!0):!1},_handleTabKey:function(t,i,r){var f=this.options.editable&&this._editMode()=="incell",u;return!f||t.is("th")?!1:(u=n(ct()).closest(".k-edit-cell"),u[0]&&u[0]!==t[0]&&(t=u),u=this._tabNext(t,i,r),u.length)?(this._handleEditing(t,u,u.closest("table")),!0):!1},_handleEscKey:function(t,i){var r=ct(),f=this._editMode()=="incell",u;return re(t)?(f?this.closeCell(!0):(u=n(t).parent().index(),r&&r.blur(),this.cancelRow(!0),u>=0&&this._setCurrent(this.items().eq(u).children(vt).first())),o.msie&&o.version<9&&document.body.focus(),w(i,!0),!0):t.has(r).length?(w(i,!0),!0):!1},_toggleCurrent:function(n,t){var i=n.parent();return i.is(".k-grouping-row")?(i.find(".k-icon:first").click(),!0):!t&&i.is(".k-master-row")?(i.find(".k-icon:first").click(),!0):!1},_handleEnterKey:function(t,i,r){var e=this.options.editable,u=r.closest("[role=gridcell]"),f;return(r.is("table")||n.contains(t[0],r[0])||(t=u),t.is("th"))?(t.find(".k-link").click(),!0):this._toggleCurrent(t,e)?!0:(f=t.find(":kendoFocusable:first"),f[0]&&!t.hasClass("k-edit-cell")&&t.hasClass("k-state-focused"))?(f.focus(),!0):e&&!r.is(":button,.k-button,textarea")?(u[0]||(u=t),this._handleEditing(u,!1,i),!0):!1},_nextHorizontalCell:function(n,t,i){var f=t.nextAll(y),r,e,u;return!f.length&&(r=n.find(rt),e=r.index(t.parent()),e==-1)?t.hasClass("k-header")?(u=[],ai([s(this.columns)[0]],fi(r.eq(0).children().first()),u,0,0),u[i])?u[i][0]:t:t.parent().hasClass("k-filter-row")?r.last().children(y).first():r.eq(i).children(y).first():f.first()},_prevHorizontalCell:function(n,t,i){var e=t.prevAll(y),r,o,u,f;return!e.length&&(r=n.find(rt),o=r.index(t.parent()),o==-1)?t.hasClass("k-header")?(u=[],f=s(this.columns),ai([f[f.length-1]],fi(r.eq(0).children().last()),u,0,0),u[i])?u[i][0]:t:t.parent().hasClass("k-filter-row")?r.last().children(y).last():r.eq(i).children(y).last():e.first()},_currentDataIndex:function(n,i){var r=i.attr("data-index"),u;return r?(u=s(this.columns).length,u&&!n.closest("div").hasClass("k-grid-content-locked")[0])?r-u:r:t},_prevVerticalCell:function(t,i){var r,u=i.parent(),o=t.children(rt),e=o.index(u),f=this._currentDataIndex(t,i);if(f||i.hasClass("k-header"))return r=wu(i),r.eq(r.length-2);if(f=u.children(y).index(i),u.hasClass("k-filter-row"))return d(t).eq(f);if(e==-1){if(u=t.find(".k-filter-row"),!u[0])return d(t).eq(f)}else u=e===0?n():o.eq(e-1);return(r=u.children(y),r.length>f)?r.eq(f):r.eq(0)},_nextVerticalCell:function(n,i){var u,f=i.parent(),e=n.children(rt),o=e.index(f),r=this._currentDataIndex(n,i);return o!=-1&&r===t&&i.hasClass("k-header")?fi(i).eq(1):(r=r?parseInt(r,10):f.children(y).index(i),f=o==-1?e.eq(0):e.eq(o+i[0].rowSpan),u=f.children(y),u.length>r)?u.eq(r):u.eq(0)},_verticalContainer:function(n,t){var r=n.parent(),u=this._navigatableTables.length,f=Math.floor(u/2),i=h(r[0],this._navigatableTables);return t&&(f*=-1),i+=f,(i>=0||i<u)&&(r=this._navigatableTables.eq(i)),r.find(t?"thead":"tbody")},_horizontalContainer:function(n,t){var r=this._navigatableTables.length,u,i;return r<=2?n:(u=n.parent(),i=h(u[0],this._navigatableTables),i+=t?1:-1,t&&(i==2||i==r))?n:!t&&(i==1||i<0)?n:this._navigatableTables.eq(i).find("thead, tbody")},_tabNext:function(n,t,i){var u=!0,r=i?n.prevAll(y+":first"):n.nextAll(":visible:first");return r.length||(r=n.parent(),this.lockedTable&&(u=i&&t==this.lockedTable[0]||!i&&t==this.table[0],r=this._relatedRow(r)),u&&(r=r[i?"prevAll":"nextAll"]("tr:not(.k-grouping-row):not(.k-detail-row):visible:first")),r=r.children(y+(i?":last":":first"))),r},_handleEditing:function(t,i,r){var u=this,f=n(ct()),e=u._editMode(),l=o.msie,a=l&&o.version<9,s=u._editContainer,h,c;if(r=n(r),c=e=="incell"?t.hasClass("k-edit-cell"):t.parent().hasClass("k-grid-edit-row"),u.editable){if(n.contains(s[0],f[0])&&(o.opera||a?f.blur().change().triggerHandler("blur"):(f.blur(),l&&f.blur())),!u.editable){w(r);return}if(u.editable.end())e=="incell"?u.closeCell():(u.saveRow(),c=!0);else{e=="incell"?u._setCurrent(s):u._setCurrent(s.children().filter(y).first());h=s.find(":kendoFocusable:first")[0];h&&h.focus();return}}i&&u._setCurrent(i);a&&document.body.focus();w(r,!0);(c||i)&&!i||(e=="incell"?u.editCell(u.current()):u.editRow(u.current().parent()))},_wrapper:function(){var n=this,r=n.table,i=n.options.height,t=n.element;t.is("div")||(t=t.wrap("<div/>").parent());n.wrapper=t.addClass("k-grid k-widget");i&&(n.wrapper.css(ir,i),r.css(ir,"auto"));n._initMobile()},_initMobile:function(){var r=this.options,t=this,u;this._isMobile=r.mobile===!0&&i.support.mobileOS||r.mobile==="phone"||r.mobile==="tablet";this._isMobile&&(u=this.wrapper.addClass("k-grid-mobile").wrap("<div data-"+i.ns+'stretch="true" data-'+i.ns+'role="view" data-'+i.ns+'init-widgets="false"><\/div>').parent(),this.pane=i.mobile.ui.Pane.wrap(u),this.view=this.pane.view(),this._actionSheetPopupOptions=n(document.documentElement).hasClass("km-root")?{modal:!1}:{align:"bottom center",position:"bottom center",effect:"slideIn:up"},r.height&&this.pane.element.parent().css(ir,r.height),this._editAnimation="slide",this.view.bind("show",function(){t._isLocked()&&(t._updateTablesWidth(),t._applyLockedContainersWidth(),t._syncLockedContentHeight(),t._syncLockedHeaderHeight(),t._syncLockedFooterHeight())}))},_tbody:function(){var i=this,r=i.table,t;t=r.find(">tbody");t.length||(t=n("<tbody/>").appendTo(r));i.tbody=t.attr("role","rowgroup")},_scrollable:function(){var t=this,f,e,l=t.options,o=l.scrollable,h=o!==!0&&o.virtual&&!t.virtualScrollable,c=!i.support.kineticScrollNeeded||h?i.support.scrollbar():0,s,u;if(o)if(f=t.wrapper.children(".k-grid-header"),f[0]||(f=n('<div class="k-grid-header" />').insertBefore(t.table)),f.css(nt?"padding-left":"padding-right",o.virtual?c+1:c),e=n('<table role="grid" />'),ti&&e.attr("cellspacing",0),e.width(t.table[0].style.width),e.append(t.thead),f.empty().append(n('<div class="k-grid-header-wrap k-auto-scrollable" />').append(e)),t.content=t.table.parent(),t.content.is(".k-virtual-scrollable-wrap, .km-scroll-container")&&(t.content=t.content.parent()),t.content.is(".k-grid-content, .k-virtual-scrollable-wrap")||(t.content=t.table.wrap('<div class="k-grid-content k-auto-scrollable" />').parent()),h&&(t.virtualScrollable=new su(t.content,{dataSource:t.dataSource,itemHeight:function(){return t._averageRowHeight()}})),t.scrollables=f.children(".k-grid-header-wrap").add(t.content),s=t.wrapper.find(".k-grid-footer"),s.length&&(t.scrollables=t.scrollables.add(s.children(".k-grid-footer-wrap"))),o.virtual)t.content.find(">.k-virtual-scrollable-wrap").unbind("scroll"+r).bind("scroll"+r,function(){t.scrollables.scrollLeft(this.scrollLeft);t.lockedContent&&(t.lockedContent[0].scrollTop=this.scrollTop)});else if(t.scrollables.unbind("scroll"+r).bind("scroll"+r,function(n){t.scrollables.not(n.currentTarget).scrollLeft(this.scrollLeft);t.lockedContent&&n.currentTarget==t.content[0]&&(t.lockedContent[0].scrollTop=this.scrollTop)}),u=t.content.data("kendoTouchScroller"),u&&u.destroy(),u=i.touchScroller(t.content),u&&u.movable){t.touchScroller=u;u.movable.bind("change",function(n){t.scrollables.scrollLeft(-n.sender.x);t.lockedContent&&t.lockedContent.scrollTop(-n.sender.y)});t.one(nr,function(n){n.sender.wrapper.addClass("k-grid-backface")})}},_renderNoRecordsContent:function(){var t=this,i;t.options.noRecords&&(i=t.table.parent().children("."+iu),i.length&&i.remove(),t.dataSource&&t.dataSource.view().length||n(t.noRecordsTemplate({})).insertAfter(t.table))},_setContentWidth:function(t){var i=this,f="k-grid-content-expander",o='<div class="'+f+'"><\/div>',u=i.resizable,r;i.options.scrollable&&i.wrapper.is(":visible")&&(r=i.table.parent().children("."+f),i._setContentWidthHandler=e(i._setContentWidth,i),i.dataSource&&i.dataSource.view().length?r[0]&&(r.remove(),u&&u.unbind("resize",i._setContentWidthHandler)):(r[0]||(r=n(o).appendTo(i.table.parent()),u&&u.bind("resize",i._setContentWidthHandler)),i.thead&&(r.width(i.thead.width()),t&&i.content.scrollLeft(t))),i._applyLockedContainersWidth())},_applyLockedContainersWidth:function(){if(this.options.scrollable&&this.lockedHeader){var r=this.thead.parent(),u=r.parent(),t=this.wrapper[0].clientWidth,e=this._groups(),o=i.support.scrollbar(),h=this.lockedHeader.find(">table>colgroup>col:not(.k-group-col, .k-hierarchy-col)"),c=r.find(">colgroup>col:not(.k-group-col, .k-hierarchy-col)"),n=yu(h),s=yu(c),f;e>0&&(n+=this.lockedHeader.find(".k-group-cell:first").outerWidth()*e);n>=t&&(n=t-3*o);this.lockedHeader.add(this.lockedContent).width(n);u[0].style.width=u.parent().width()-n-2+"px";r.add(this.table).width(s);this.virtualScrollable&&(t-=o);this.content[0].style.width=t-n-2+"px";this.lockedFooter&&this.lockedFooter.length&&(this.lockedFooter.width(n),f=this.footer.find(".k-grid-footer-wrap"),f[0].style.width=u[0].clientWidth+"px",f.children().first().width(s))}},_setContentHeight:function(){var n=this,u=n.options,t=n.wrapper.innerHeight(),e=n.wrapper.children(".k-grid-header"),r=i.support.scrollbar(),f;u.scrollable&&n.wrapper.is(":visible")&&(t-=e.outerHeight(),n.pager&&(t-=n.pager.element.outerHeight()),u.groupable&&(t-=n.wrapper.children(".k-grouping-header").outerHeight()),u.toolbar&&(t-=n.wrapper.children(".k-grid-toolbar").outerHeight()),n.footerTemplate&&(t-=n.wrapper.children(".k-grid-footer").outerHeight()),f=function(n){var t,i;return n[0].style.height?!0:(t=n.height(),n.height("auto"),i=n.height(),t!=i)?(n.height(""),!0):(n.height(""),!1)},f(n.wrapper)&&(t>r*2?(n.lockedContent&&(r=n.table[0].offsetWidth>n.table.parent()[0].clientWidth?r:0,n.lockedContent.height(t-r)),n.content.height(t)):n.content.height(r*2+1)))},_averageRowHeight:function(){var n=this,i=n._items(n.tbody).length,t=n._rowHeight,r;return i===0?t:(n._rowHeight||(n._rowHeight=t=n.table.outerHeight()/i,n._sum=t,n._measures=1),r=n.table.outerHeight()/i,t!==r&&(n._measures++,n._sum+=r,n._rowHeight=n._sum/n._measures),t)},_dataSource:function(){var n=this,u=n.options,r,i=u.dataSource;i=at(i)?{data:i}:i;c(i)&&(f(i,{table:n.table,fields:n.columns}),r=u.pageable,c(r)&&r.pageSize!==t&&(i.pageSize=r.pageSize));n.dataSource&&n._refreshHandler?n.dataSource.unbind(g,n._refreshHandler).unbind(yi,n._progressHandler).unbind(pi,n._errorHandler):(n._refreshHandler=e(n.refresh,n),n._progressHandler=e(n._requestStart,n),n._errorHandler=e(n._error,n));n.dataSource=ar.create(i).bind(g,n._refreshHandler).bind(yi,n._progressHandler).bind(pi,n._errorHandler)},_error:function(){this._progress(!1)},_requestStart:function(){this._progress(!0)},_modelChange:function(t){var r=this,w=r.tbody,h=t.model,e=r.tbody.find("tr["+i.attr("uid")+"="+h.uid+"]"),o,s,l,b=e.hasClass("k-alt"),f,c=r._items(w).index(e),v=r.lockedContent,y,a,k,d,g,p;if(v&&(o=r._relatedRow(e)),e.add(o).children(".k-edit-cell").length&&!r.options.rowTemplate)e.add(o).children(":not(.k-group-cell,.k-hierarchy-cell)").each(function(){s=n(this);l=u(r.columns)[r.cellIndex(s)];l.field===t.field&&(s.hasClass("k-edit-cell")?s.addClass("k-dirty-cell"):(r._displayCell(s,l,h),n('<span class="k-dirty"/>').prependTo(s)))});else if(!e.hasClass("k-grid-edit-row")){for(a=n().add(e),v&&(f=(b?r.lockedAltRowTemplate:r.lockedRowTemplate)(h),a=a.add(o),o.replaceWith(f)),r.angular("cleanup",function(){return{elements:a.get()}}),f=(b?r.altRowTemplate:r.rowTemplate)(h),e.replaceWith(f),f=r._items(w).eq(c),p=[{dataItem:h}],v&&(e=e.add(o),o=r._relatedRow(f)[0],oi(f[0],o),f=f.add(o),p.push({dataItem:h})),r.angular("compile",function(){return{elements:f.get(),data:p}}),y=r.options.selectable,y&&e.hasClass("k-state-selected")&&r.select(f),d=a.children(":not(.k-group-cell,.k-hierarchy-cell)"),k=f.children(":not(.k-group-cell,.k-hierarchy-cell)"),c=0,g=r.columns.length;c<g;c++)l=r.columns[c],s=k.eq(c),y&&d.eq(c).hasClass("k-state-selected")&&s.addClass("k-state-selected"),l.field===t.field&&n('<span class="k-dirty"/>').prependTo(s);r.trigger("itemChange",{item:f,data:h,ns:ht})}},_pageable:function(){var t=this,u,r=t.options.pageable;r&&(u=t.wrapper.children("div.k-grid-pager"),u.length||(u=n('<div class="k-pager-wrap k-grid-pager"/>').appendTo(t.wrapper)),t.pager&&t.pager.destroy(),t.pager=typeof r=="object"&&r instanceof i.ui.Pager?r:new i.ui.Pager(u,f({},r,{dataSource:t.dataSource})))},_footer:function(){var t=this,s=t.dataSource.aggregates(),r="",h=t.footerTemplate,u=t.options,f,i=t.footer||t.wrapper.find(".k-grid-footer"),e,o,c;h?(r=n(t._wrapFooter(h(s))),i.length?(e=r,t.angular("cleanup",function(){return{elements:i.get()}}),i.replaceWith(e),i=t.footer=e):i=u.scrollable?t.footer=u.pageable?r.insertBefore(t.wrapper.children("div.k-grid-pager")):r.appendTo(t.wrapper):t.footer=r.insertBefore(t.tbody),t.angular("compile",function(){return{elements:i.find("td:not(.k-group-cell, .k-hierarchy-cell)").get(),data:dt(t.columns,function(n){return{column:n,aggregate:s[n.field]}})}})):i&&!t.footer&&(t.footer=i);i.length&&(u.scrollable&&(f=i.attr("tabindex",-1).children(".k-grid-footer-wrap"),t.scrollables=t.scrollables.filter(function(){return!n(this).is(".k-grid-footer-wrap")}).add(f)),t._footerWidth&&i.find("table").css("width",t._footerWidth),f&&(o=t.content.scrollLeft(),c=u.scrollable!==!0&&u.scrollable.virtual&&!t.virtualScrollable,c&&(o=t.wrapper.find(".k-virtual-scrollable-wrap").scrollLeft()),f.scrollLeft(o)));t.lockedContent&&(t._appendLockedColumnFooter(),t._applyLockedContainersWidth(),t._syncLockedFooterHeight())},_wrapFooter:function(t){var u=this,r="",f=i.support.mobileOS?0:i.support.scrollbar();return u.options.scrollable?(r=n('<div class="k-grid-footer"><div class="k-grid-footer-wrap"><table'+(ti?' cellspacing="0"':"")+"><tbody>"+t+"<\/tbody><\/table><\/div><\/div>"),u._appendCols(r.find("table")),r.css(nt?"padding-left":"padding-right",f),r):'<tfoot class="k-grid-footer">'+t+"<\/tfoot>"},_columnMenu:function(){var r=this,v,b=u(r.columns),n,o=r.options,e=o.columnMenu,y,k,h,p,tt=a(r.columns,function(n){return n.columns!==t}).length>0,it=this._isMobile,rt=function(n){r.trigger(kr,{field:n.field,container:n.container})},ut=function(n){w(n.closest("table"),!0)},g=o.$angular,c,nt,l;if(e)for(typeof e=="boolean"&&(e={}),p=d(r.thead),c=0,nt=p.length;c<nt;c++)n=b[c],l=p.eq(c),!n.command&&(n.field||l.attr("data-"+i.ns+"field"))&&(v=l.data("kendoColumnMenu"),v&&v.destroy(),k=n.sortable!==!1&&e.sortable!==!1&&o.sortable!==!1?f({},o.sortable,{compare:(n.sortable||{}).compare}):!1,h=o.filterable&&n.filterable!==!1&&e.filterable!==!1?f({pane:r.pane},o.filterable,n.filterable):!1,n.filterable&&n.filterable.dataSource&&(h.forceUnique=!1,h.checkSource=n.filterable.dataSource),h&&(h.format=n.format),y={dataSource:r.dataSource,values:n.values,columns:e.columns,sortable:k,filterable:h,messages:e.messages,owner:r,closeCallback:ut,init:rt,pane:r.pane,filter:it?":not(.k-column-active)":"",lockedColumns:!tt&&n.lockable!==!1&&s(b).length>0},g&&(y.$angular=g),l.kendoColumnMenu(y))},_headerCells:function(){return this.thead.find("th").filter(function(){var t=n(this);return!t.hasClass("k-group-cell")&&!t.hasClass("k-hierarchy-cell")})},_filterable:function(){var e=this,r=u(e.columns),s,l,h,v=function(n){e.trigger(br,{field:n.field,container:n.container})},y=function(n){w(n.closest("table"),!0)},o=e.options.filterable,n,a,t,c;if(o&&typeof o.mode==p&&o.mode.indexOf("menu")==-1&&(o=!1),o&&!e.options.columnMenu)for(l=d(e.thead),n=0,a=l.length;n<a;n++)h=l.eq(n),r[n].filterable!==!1&&!r[n].command&&(r[n].field||h.attr("data-"+i.ns+"field"))&&(s=h.data("kendoFilterMenu"),s&&s.destroy(),s=h.data("kendoFilterMultiCheck"),s&&s.destroy(),t=r[n].filterable,c=f({},o,t,{dataSource:e.dataSource,values:r[n].values,format:r[n].format,closeCallback:y,title:r[n].title||r[n].field,init:v,pane:e.pane}),t&&t.messages&&(c.messages=f(!0,{},o.messages,t.messages)),t&&t.dataSource&&(c.forceUnique=!1,c.checkSource=t.dataSource),t&&t.multi?h.kendoFilterMultiCheck(c):h.kendoFilterMenu(c))},_filterRow:function(){var e=this,h,r,a;if(e._hasFilterRow()){var c,v=e.options.$angular,y=u(e.columns),b=e.options.filterable,k=e.thead.find(".k-filter-row");for(this._updateHeader(this.dataSource.group().length),h=0;h<y.length;h++){var o,t=y[h],p=e.options.filterable.operators,w=!1,s=n("<th/>"),l=t.field;if(t.hidden&&s.hide(),k.append(s),l&&t.filterable!==!1){if(r=t.filterable&&t.filterable.cell||{},o=e.options.dataSource,o instanceof ar&&(o=e.options.dataSource.options),a=f(!0,{},b.messages),t.filterable&&f(!0,a,t.filterable.messages),r.enabled===!1){s.html("&nbsp;");continue}r.dataSource&&(o=r.dataSource,w=!0);t.filterable&&t.filterable.operators&&(p=t.filterable.operators);c={column:t,dataSource:e.dataSource,suggestDataSource:o,customDataSource:w,field:l,messages:a,values:t.values,template:r.template,delay:r.delay,inputWidth:r.inputWidth,suggestionOperator:r.suggestionOperator,minLength:r.minLength,dataTextField:r.dataTextField,operator:r.operator,operators:p,showOperators:r.showOperators};v&&(c.$angular=v);n("<span/>").attr(i.attr("field"),l).appendTo(s).kendoFilterCell(c)}else s.html("&nbsp;")}}},_sortable:function(){var r=this,l=u(r.columns),n,o,s,h=r.options.sortable,e,t,c;if(h){for(e=d(r.thead),t=0,c=e.length;t<c;t++)n=l[t],n.sortable!==!1&&!n.command&&n.field&&(s=e.eq(t),o=s.data("kendoColumnSorter"),o&&o.destroy(),s.attr("data-"+i.ns+"field",n.field).kendoColumnSorter(f({},h,n.sortable,{dataSource:r.dataSource,aria:!0,filter:":not(.k-column-active)"})));e=null}},_columns:function(t){var r=this,f=r.table,e,c=f.find("col"),u,o=r.options.dataSource,h;if(t=t.length?t:dt(f.find("th"),function(t,r){t=n(t);var f=t.attr(i.attr("sortable")),e=t.attr(i.attr("filterable")),o=t.attr(i.attr("type")),s=t.attr(i.attr("groupable")),u=t.attr(i.attr("field")),h=t.attr(i.attr("title")),l=t.attr(i.attr("menu"));return u||(u=t.text().replace(/\s|[^A-z0-9]/g,"")),{field:u,type:o,title:h,sortable:f!=="false",filterable:e!=="false",groupable:s!=="false",menu:l,template:t.attr(i.attr("template")),width:c.eq(r).css("width")}}),e=!(r.table.find("tbody tr").length>0&&(!o||!o.transport)),r.options.scrollable){if(h=t,u=s(t),t=ot(t),u.length>0&&t.length===0)throw new Error("There should be at least one non locked column");ne(r.element.find("tr:has(th):first"),h);t=u.concat(t)}r.columns=hu(t,e)},_groups:function(){var n=this.dataSource.group();return n?n.length:0},_tmpl:function(n,t,r,u){var o=this,a=f({},i.Template,o.options.templateSettings),s,v=t.length,y,l={storage:{},count:0},h,b,p=o._hasDetails(),c=[],w=o._groups();if(!n){for(n="<tr",r&&c.push("k-alt"),p&&c.push("k-master-row"),c.length&&(n+=' class="'+c.join(" ")+'"'),v&&(n+=" "+i.attr("uid")+'="#='+i.expr("uid",a.paramName)+'#"'),n+=" role='row'>",w>0&&!u&&(n+=li(w)),p&&(n+='<td class="k-hierarchy-cell"><a class="k-icon k-plus" href="\\#" tabindex="-1"><\/a><\/td>'),s=0;s<v;s++)h=t[s],y=h.template,b=typeof y,n+="<td"+ii(h.attributes)+" role='gridcell'>",n+=o._cellTmpl(h,l),n+="<\/td>";n+="<\/tr>"}return(n=i.template(n,a),l.count>0)?e(n,l.storage):n},_headerCellText:function(n){var e=this,o=f({},i.Template,e.options.templateSettings),t=n.headerTemplate,u=typeof t,r=n.title||n.field||"";return u===yt?r=i.template(t,o)({}):u===p&&(r=t),r},_cellTmpl:function(n,t){var s=this,v=f({},i.Template,s.options.templateSettings),h=n.template,l=v.paramName,u=n.field,r="",o,y,a=n.format,w=typeof h,e=n.values;if(n.command){if(at(n.command)){for(o=0,y=n.command.length;o<y;o++)r+=s._createButton(n.command[o]);return r.replace(hi,"\\#")}return s._createButton(n.command).replace(hi,"\\#")}return w===yt?(t.storage["tmpl"+t.count]=h,r+="#=this.tmpl"+t.count+"("+l+")#",t.count++):w===p?r+=h:e&&e.length&&c(e[0])&&"value"in e[0]&&u?(r+="#var v ="+i.stringify(ku(e)).replace(hi,"\\#")+"#",r+="#var f = v[",v.useWithBlock||(r+=l+"."),r+=u+"]#",r+="${f != null ? f : ''}"):(r+=n.encoded?"#:":"#=",a&&(r+='kendo.format("'+a.replace(cf,"\\$1")+'",'),u?(u=i.expr(u,l),r+=u+"==null?'':"+u):r+="''",a&&(r+=")"),r+="#"),r},_templates:function(){var t=this,i=t.options,h=t.dataSource,c=h.group(),l=t.footer||t.wrapper.find(".k-grid-footer"),r=h.aggregate(),o=u(t.columns),f=u(s(t.columns)),e=i.scrollable?u(ot(t.columns)):o;if(i.scrollable&&f.length){if(i.rowTemplate||i.altRowTemplate)throw new Error("Having both row template and locked columns is not supported");t.rowTemplate=t._tmpl(i.rowTemplate,e,!1,!0);t.altRowTemplate=t._tmpl(i.altRowTemplate||i.rowTemplate,e,!0,!0);t.lockedRowTemplate=t._tmpl(i.rowTemplate,f);t.lockedAltRowTemplate=t._tmpl(i.altRowTemplate||i.rowTemplate,f,!0)}else t.rowTemplate=t._tmpl(i.rowTemplate,e),t.altRowTemplate=t._tmpl(i.altRowTemplate||i.rowTemplate,e,!0);t._hasDetails()&&(t.detailTemplate=t._detailTmpl(i.detailTemplate||""));(!t._group||yr(r))&&(yr(r)||l.length)&&!a(o,function(n){return n.footerTemplate}).length||(t.footerTemplate=t._footerTmpl(o,r,"footerTemplate","k-footer-template"));c&&a(o,function(n){return n.groupFooterTemplate}).length&&(r=n.map(c,function(n){return n.aggregates}),t.groupFooterTemplate=t._footerTmpl(e,r,"groupFooterTemplate","k-group-footer",f.length),i.scrollable&&f.length&&(t.lockedGroupFooterTemplate=t._footerTmpl(f,r,"groupFooterTemplate","k-group-footer")));t.options.noRecords&&(t.noRecordsTemplate=t._noRecordsTmpl())},_noRecordsTmpl:function(){var s=this.options.scrollable&&!this.wrapper[0].style.height?' style="margin:0 auto;position:static;"':"",t={storage:{},count:0},o=n.extend({},i.Template,this.options.templateSettings),h=o.paramName,r,f="",e,u;return r=this.options.noRecords.template?this.options.noRecords.template:i.format('<div class="k-grid-norecords-template"{1}>{0}<\/div>',this.options.messages.noRecords,s),e=typeof r,e==="function"?(t.storage["tmpl"+t.count]=r,f+="#=this.tmpl"+t.count+"("+h+")#",t.count++):e==="string"&&(f+=r),u=i.template(i.format('<div class="{0}">{1}<\/div>',iu,f),o),t.count>0&&(u=n.proxy(u,t.storage)),u},_footerTmpl:function(n,t,r,u,o){var l=this,y=f({},i.Template,l.options.templateSettings),p=y.paramName,s="",a,w,h,b,k={},v=0,d={},g=l._groups(),nt=l.dataSource._emptyAggregates(t),c;for(s+='<tr class="'+u+'">',g>0&&!o&&(s+=li(g)),l._hasDetails()&&(s+='<td class="k-hierarchy-cell">&nbsp;<\/td>'),a=0,w=n.length;a<w;a++)c=n[a],h=c[r],b=typeof h,s+="<td"+ii(c.footerAttributes)+">",h?(b!==yt&&(d=nt[c.field]?f({},y,{paramName:p+"['"+c.field+"']"}):{},h=i.template(h,d)),k["tmpl"+v]=h,s+="#=this.tmpl"+v+"("+p+")#",v++):s+="&nbsp;",s+="<\/td>";return(s+="<\/tr>",s=i.template(s,y),v>0)?e(s,k):s},_detailTmpl:function(n){var o=this,t="",s=f({},i.Template,o.options.templateSettings),a=s.paramName,h={},r=0,c=o._groups(),l=k(u(o.columns)).length,v=typeof n;return(t+='<tr class="k-detail-row">',c>0&&(t+=li(c)),t+='<td class="k-hierarchy-cell"><\/td><td class="k-detail-cell"'+(l?' colspan="'+l+'"':"")+">",v===yt?(h["tmpl"+r]=n,t+="#=this.tmpl"+r+"("+a+")#",r++):t+=n,t+="<\/td><\/tr>",t=i.template(t,s),r>0)?e(t,h):t},_hasDetails:function(){var n=this;return n.options.detailTemplate!==null||(n._events[ki]||[]).length},_hasFilterRow:function(){var t=this.options.filterable,r=t&&typeof t.mode==p&&t.mode.indexOf("row")!=-1,i=this.columns,u=n.grep(i,function(n){return n.filterable===!1});return i.length&&u.length==i.length&&(r=!1),r},_details:function(){var t=this;if(t.options.scrollable&&t._hasDetails()&&s(t.columns).length)throw new Error("Having both detail template and locked columns is not supported");t.table.on(l+r,".k-hierarchy-cell .k-plus, .k-hierarchy-cell .k-minus",function(i){var o=n(this),f=o.hasClass("k-plus"),u=o.closest("tr.k-master-row"),r,s=t.detailTemplate,e,h=t._hasDetails();return o.toggleClass("k-plus",!f).toggleClass("k-minus",f),r=u.next(),h&&!r.hasClass("k-detail-row")&&(e=t.dataItem(u),r=n(s(e)).addClass(u.hasClass("k-alt")?"k-alt":"").insertAfter(u),t.angular("compile",function(){return{elements:r.get(),data:[{dataItem:e}]}}),t.trigger(ki,{masterRow:u,detailRow:r,data:e,detailCell:r.find(".k-detail-cell")})),t.trigger(f?gr:nu,{masterRow:u,detailRow:r}),r.toggle(f),t._current&&t._current.attr("aria-expanded",f),i.preventDefault(),!1})},dataItem:function(t){if(t=n(t)[0],!t)return null;for(var f=this.tbody.children(),u=t.sectionRowIndex,r=u,i=0;i<u;i++)/k-grouping-row|k-detail-row|k-group-footer/.test(f[i].className)&&r--;return this._data[r]},expandRow:function(t){n(t).find("> td .k-plus, > td .k-i-expand").click()},collapseRow:function(t){n(t).find("> td .k-minus, > td .k-i-collapse").click()},_createHeaderCells:function(n,r){for(var a=this,f,c,e="",y=u(a.columns),l,s,o=0,v=n.length;o<v;o++)f=n[o].column||n[o],c=a._headerCellText(f),l="",s=h(f,y),f.command?(e+="<th"+ii(f.headerAttributes),r&&!n[o].colSpan&&(e+=" rowspan='"+r+"'"),s>-1&&(e+=i.attr("index")+"='"+s+"'"),e+=">"+c+"<\/th>"):(f.field&&(l=i.attr("field")+"='"+f.field+"' "),e+="<th role='columnheader' "+l,r&&!n[o].colSpan&&(e+=" rowspan='"+r+"'"),n[o].colSpan>1&&(e+='colspan="'+(n[o].colSpan-wt(f.columns))+'" ',e+=i.attr("colspan")+"='"+n[o].colSpan+"'"),f.title&&(e+=i.attr("title")+'="'+f.title.replace('"',"&quot;").replace(/'/g,"'")+'" '),f.groupable!==t&&(e+=i.attr("groupable")+"='"+f.groupable+"' "),f.aggregates&&f.aggregates.length&&(e+=i.attr("aggregates")+"='"+f.aggregates+"'"),s>-1&&(e+=i.attr("index")+"='"+s+"'"),e+=ii(f.headerAttributes),e+=">"+c+"<\/th>");return e},_appendLockedColumnContent:function(){for(var i=this.columns,o=this.table.find("colgroup"),a=o.find("col:not(.k-group-col,.k-hierarchy-col)"),s=n(),c=0,f,r,e,l=0,t=0,h=i.length;t<h;t++)if(i[t].locked)if(ut(i[t])){for(r=1,i[t].columns&&(r=u(i[t].columns).length-wt(i[t].columns)),r=r||1,e=0;e<r;e++)s=s.add(a.eq(t+l+e-c));l+=r-1}else c++;f=n('<div class="k-grid-content-locked"><table'+(ti?' cellspacing="0"':"")+"><colgroup/><tbody><\/tbody><\/table><\/div>");o.detach();f.find("colgroup").append(s);o.insertBefore(this.table.find("tbody"));this.lockedContent=f.insertBefore(this.content);this.lockedTable=f.children("table")},_appendLockedColumnFooter:function(){var i=this,o=i.footer,c=o.find(".k-footer-template>td"),l=o.find(".k-grid-footer-wrap>table>colgroup>col"),h=n('<div class="k-grid-footer-locked"><table><colgroup /><tbody><tr class="k-footer-template"><\/tr><\/tbody><\/table><\/div>'),t,e,a=i._groups(),r=n(),f=n();for(r=r.add(c.filter(".k-group-cell")),t=0,e=u(s(i.columns)).length;t<e;t++)r=r.add(c.eq(t+a));for(f=f.add(l.filter(".k-group-col")),t=0,e=k(u(cr(i.columns))).length;t<e;t++)f=f.add(l.eq(t+a));r.appendTo(h.find("tr"));f.appendTo(h.find("colgroup"));i.lockedFooter=h.prependTo(o)},_appendLockedColumnHeader:function(t){var f=this,r=this.columns,i,c,l,a,g,nt,o,tt,it,e=[],p=0,w=n(),ot=f._hasFilterRow(),rt=0,b=n(),ft,s=0,et=n(),k,h,v,y,d;for(a=f.thead.prev().find("col:not(.k-group-col,.k-hierarchy-col)"),tt=f.thead.find("tr:first .k-header:not(.k-group-cell,.k-hierarchy-cell)"),it=f.thead.find(".k-filter-row").find("th:not(.k-group-cell,.k-hierarchy-cell)"),k=0,i=0,l=r.length;i<l;i++){if(r[i].locked){if(ft=tt.eq(i),s=u(r[i].columns||[]).length,ut(r[i])){for(r[i].columns&&(h=s-wt(r[i].columns)),h=h||1,v=0;v<h;v++)w=w.add(a.eq(i+k+v-p));k+=h-1}for(ai([r[i]],fi(ft),e,0,0),s=s||1,y=0;y<s;y++)b=b.add(it.eq(rt+y));rt+=s}r[i].columns&&(p+=wt(r[i].columns));ut(r[i])||p++}if(e.length){for(c='<div class="k-grid-header-locked" style="width:1px"><table'+(ti?' cellspacing="0"':"")+"><colgroup/><thead>",c+=new Array(e.length+1).join("<tr><\/tr>"),c+=(ot?'<tr class="k-filter-row" />':"")+"<\/thead><\/table><\/div>",o=n(c),a=o.find("colgroup"),a.append(f.thead.prev().find("col.k-group-col").add(w)),g=o.find("thead tr:not(.k-filter-row)"),i=0,l=e.length;i<l;i++)et=pf(e[i]),g.eq(i).append(f.thead.find("tr:eq("+i+") .k-group-cell").add(et));d=hr(this.thead);e.length<d&&kf(o,d-e.length);nt=o.find(".k-filter-row");nt.append(f.thead.find(".k-filter-row .k-group-cell").add(b));this.lockedHeader=o.prependTo(t);this.thead.find(".k-group-cell").remove();this._syncLockedHeaderHeight()}},_removeLockedContainers:function(){var n=this.lockedHeader.add(this.lockedContent).add(this.lockedFooter);i.destroy(n);n.off(r).remove();this.lockedHeader=this.lockedContent=this.lockedFooter=null;this.selectable=null},_thead:function(){var t=this,l=t.columns,a=t._hasDetails()&&l.length,p=t._hasFilterRow(),h,o="",f=t.table.find(">thead"),w=t.element.find("thead:first").length>0,u,c,v,y;if(f.length||(f=n("<thead/>").insertBefore(t.tbody)),t.lockedHeader&&t.thead?(u=t.thead.find("tr:has(th):not(.k-filter-row)").html(""),u.remove(),u=n(),t._removeLockedContainers()):u=w?t.element.find("thead:first tr:has(th):not(.k-filter-row)"):t.element.find("tr:has(th):first"),!u.length&&(u=f.children().first(),!u.length)){for(c=[{rowSpan:1,cells:[],index:0}],t._prepareColumns(c,l),h=0;h<c.length;h++)o+="<tr>",a&&(o+='<th class="k-hierarchy-cell">&nbsp;<\/th>'),o+=t._createHeaderCells(c[h].cells,c[h].rowSpan),o+="<\/tr>";u=n(o)}p&&(v=n("<tr/>"),v.addClass("k-filter-row"),(a||u.find(".k-hierarchy-cell").length)&&v.prepend('<th class="k-hierarchy-cell">&nbsp;<\/th>'),y=(t.thead||f).find(".k-filter-row"),y.length&&(i.destroy(y),y.remove()),f.append(v));u.children().length?a&&!u.find(".k-hierarchy-cell")[0]&&u.prepend('<th class="k-hierarchy-cell">&nbsp;<\/th>'):(o="",a&&(o+='<th class="k-hierarchy-cell">&nbsp;<\/th>'),o+=t._createHeaderCells(l),u.html(o));u.attr("role","row").find("th").addClass("k-header");t.options.scrollable||f.addClass("k-grid-header");u.find("script").remove().end().prependTo(f);t.thead&&t._destroyColumnAttachments();this.angular("cleanup",function(){return{elements:f.find("th").get()}});this.angular("compile",function(){return{elements:f.find("th").get(),data:dt(l,function(n){return{column:n}})}});t.thead=f.attr("role","rowgroup");t._sortable();t._filterable();t._filterRow();t._scrollable();t._updateCols();t._columnMenu();this.options.scrollable&&s(this.columns).length&&(t._appendLockedColumnHeader(t.thead.closest(".k-grid-header")),t._appendLockedColumnContent(),t.lockedContent.bind("DOMMouseScroll"+r+" mousewheel"+r,e(t._wheelScroll,t)),t._applyLockedContainersWidth());t._updateColumnCellIndex();t._updateFirstColumnClass();t._resizable();t._draggable();t._reorderable();t._updateHeader(t._groups());t.groupable&&t._attachGroupable()},_updateFirstColumnClass:function(){var i=this,t=i.columns||[],f=i._hasDetails()&&t.length,r,u;f||i._groups()||(r=n(),u=i.thead.find(">tr:not(.k-filter-row):not(:first)"),t=ot(t),u.length&&t[0]&&!t[0].columns&&(r=r.add(u)),i._isLocked()&&(u=i.lockedHeader.find("thead>tr:not(.k-filter-row):not(:first)"),t=s(i.columns),u.length&&t[0]&&!t[0].columns&&(r=r.add(u))),r.each(function(){var t=n(this).find("th");t.removeClass("k-first");t.eq(0).addClass("k-first")}))},_prepareColumns:function(n,t,i,r){for(var f,e=r||n[n.length-1],o=n[e.index+1],s=0,u=0;u<t.length;u++)f={column:t[u],colSpan:0},e.cells.push(f),t[u].columns&&t[u].columns.length&&(o||(o={rowSpan:0,cells:[],index:n.length},n.push(o)),f.colSpan=t[u].columns.length,this._prepareColumns(n,t[u].columns,f,o),s+=f.colSpan-1,e.rowSpan=n.length-e.index);i&&(i.colSpan+=s)},_wheelScroll:function(t){var u,e,f;if(!t.ctrlKey&&(u=this.content,this.options.scrollable.virtual&&(u=this.virtualScrollable.verticalScrollbar),e=u.scrollTop(),f=i.wheelDeltaY(t),f)){t.preventDefault();n(t.currentTarget).one("wheel"+r,!1);u.scrollTop(e+-f)}},_isLocked:function(){return this.lockedHeader!=null},_updateHeaderCols:function(){var n=this.thead.parent().add(this.table);this._isLocked()?bt(n,it(pu(this.columns)),this._hasDetails(),0):bt(n,it(k(this.columns)),this._hasDetails(),0)},_updateCols:function(n){n=n||this.thead.parent().add(this.table);this._appendCols(n,this._isLocked())},_updateLockedCols:function(n){this._isLocked()&&(n=n||this.lockedHeader.find("table").add(this.lockedTable),bt(n,it(cr(this.columns)),this._hasDetails(),this._groups()))},_appendCols:function(n,t){t?bt(n,it(pu(this.columns)),this._hasDetails(),0):bt(n,it(k(this.columns)),this._hasDetails(),this._groups())},_autoColumns:function(n){if(n&&n.toJSON){var t=this,r,u;n=n.toJSON();u=!(t.table.find("tbody tr").length>0&&(!t.dataSource||!t.dataSource.transport));for(r in n)t.columns.push({field:r,encoded:u,headerAttributes:{id:i.guid()}});t._thead();t._templates()}},_rowsHtml:function(n,t){for(var f=this,r="",e=t.rowTemplate,o=t.altRowTemplate,i=0,u=n.length;i<u;i++)r+=i%2?o(n[i]):e(n[i]),f._data.push(n[i]);return r},_groupRowHtml:function(n,t,r,e,o,s){var l=this,h="",v,w,b=n.field,c=a(u(l.columns),function(n){return n.field==b})[0]||{},y=c.groupHeaderTemplate,k=(c.title||b)+": "+te(n.value,c.format,c.values,c.encoded),tt=l._groupAggregatesDefaultObject||{},d=f({},tt,n.aggregates),g=f({},{field:n.field,value:n.value,aggregates:d},n.aggregates[n.field]),nt=o.groupFooterTemplate,p=n.items;if(y&&(k=typeof y===yt?y(g):i.template(y)(g)),h+=e(t,r,k),n.hasSubgroups)for(v=0,w=p.length;v<w;v++)h+=l._groupRowHtml(p[v],s?t:t-1,r+1,e,o,s);else h+=l._rowsHtml(p,o);return nt&&(h+=nt(d)),h},collapseGroup:function(t){t=n(t);var e,h=this.options.groupable,c=h.showFooter,u=c?0:1,o,f=n(),r,s,i;for(this._isLocked()&&(t.closest("div").hasClass("k-grid-content-locked")?f=this.tbody.children("tr:eq("+t.index()+")").nextAll("tr"):(f=t.nextAll("tr"),t=this.lockedTable.find(">tbody>tr:eq("+t.index()+")"))),e=t.find(".k-group-cell").length,t.find(".k-icon").addClass("k-i-expand").removeClass("k-i-collapse"),t.find("td[aria-expanded='true']:first").attr("aria-expanded",!1),t=t.nextAll("tr"),r=0,s=t.length;r<s;r++){if(i=t.eq(r),o=i.find(".k-group-cell").length,i.hasClass("k-grouping-row")?u++:i.hasClass("k-group-footer")&&u--,o<=e||i.hasClass("k-group-footer")&&u<0)break;i.hide();f.eq(r).hide()}},expandGroup:function(t){t=n(t);var s=this,h=s.options.groupable.showFooter,f,i,e,u=n(),r,c,l=[],o=1;for(this._isLocked()&&(t.closest("div").hasClass("k-grid-content-locked")?u=this.tbody.children("tr:eq("+t.index()+")").nextAll("tr"):(u=t.nextAll("tr"),t=this.lockedTable.find(">tbody>tr:eq("+t.index()+")"))),f=t.find(".k-group-cell").length,t.find(".k-icon").addClass("k-i-collapse").removeClass("k-i-expand"),t.find("td[aria-expanded='false']:first").attr("aria-expanded",!0),t=t.nextAll("tr"),r=0,c=t.length;r<c;r++){if(i=t.eq(r),e=i.find(".k-group-cell").length,e<=f)break;e!=f+1||i.hasClass("k-detail-row")||(i.show(),u.eq(r).show(),i.hasClass("k-grouping-row")&&i.find(".k-icon").hasClass("k-i-collapse")&&s.expandGroup(i),i.hasClass("k-master-row")&&i.find(".k-icon").hasClass("k-minus")&&(i.next().show(),u.eq(r+1).show()));i.hasClass("k-grouping-row")&&(h&&l.push(i.is(":visible")),o++);i.hasClass("k-group-footer")&&(h&&i.toggle(l.pop()),o==1?(i.show(),u.eq(r).show()):o--)}},_updateHeader:function(t){var r=this,i=r._isLocked()?r.lockedHeader.find("thead"):r.thead,f=i.find("tr.k-filter-row").find("th.k-group-cell").length,u=i.find("tr:first").find("th.k-group-cell").length,e=i.children("tr:not(:first)").filter(function(){return!n(this).children(":visible").length});t>u?(n(new Array(t-u+1).join('<th class="k-group-cell k-header">&nbsp;<\/th>')).prependTo(i.children("tr:not(.k-filter-row)")),r.element.is(":visible")&&e.find("th.k-group-cell").hide()):t<u&&i.find("tr").each(function(){n(this).find("th.k-group-cell").filter(":eq("+t+"),:gt("+t+")").remove()});t>f&&n(new Array(t-f+1).join('<th class="k-group-cell k-header">&nbsp;<\/th>')).prependTo(i.find(".k-filter-row"))},_firstDataItem:function(n,t){return n&&t&&(n=n.hasSubgroups?this._firstDataItem(n.items[0],t):n.items[0]),n},_updateTablesWidth:function(){var t=this,i;t._isLocked()&&(i=n(">.k-grid-footer>.k-grid-footer-wrap>table",t.wrapper).add(t.thead.parent()).add(t.table),t._footerWidth=uf(i.eq(0)),i.width(t._footerWidth),i=n(">.k-grid-footer>.k-grid-footer-locked>table",t.wrapper).add(t.lockedHeader.find(">table")).add(t.lockedTable),i.width(uf(i.eq(0))))},hideColumn:function(t){var i=this,it,l,r,w,v,b,e=0,g,rt,y=i.footer||i.wrapper.find(".k-grid-footer"),s=i.columns,p=i.lockedHeader?d(i.lockedHeader.find(">table>thead")).filter(er).length:0,f,nt;if(t=typeof t=="number"?s[t]:c(t)?a(ft(s),function(n){return n===t})[0]:a(ft(s),function(n){return n.field===t})[0],t&&ut(t)){if(t.columns&&t.columns.length){for(b=or(t,s),ri(t,!1),st(tt(n(">table>thead",i.lockedHeader),i.thead,">tr:eq("+b.row+")>th"),b.cell,!1),r=0;r<t.columns.length;r++)this.hideColumn(t.columns[r]);i.trigger(di,{column:t});return}if(f=h(t,k(u(s))),ri(t,!1),i._setParentsVisibility(t,!1),i._templates(),i._updateCols(),i._updateLockedCols(),nt=i.thead,g=f,i.lockedHeader&&p>f?nt=i.lockedHeader.find(">table>thead"):g-=p,it=d(nt).filter(er).eq(g),it[0].style.display="none",st(tt(n(">table>thead",i.lockedHeader),i.thead,">tr.k-filter-row>th"),f,!1),y[0]&&(i._updateCols(y.find(">.k-grid-footer-wrap>table")),i._updateLockedCols(y.find(">.k-grid-footer-locked>table")),st(y.find(".k-footer-template>td"),f,!1)),i.lockedTable&&p>f?du(i.lockedTable.find(">tbody>tr"),f):du(i.tbody.children(),f-p),i.lockedTable)i._updateTablesWidth(),i._applyLockedContainersWidth(),i._syncLockedContentHeight(),i._syncLockedHeaderHeight(),i._syncLockedFooterHeight();else{for(w=i.thead.prev().find("col"),r=0,rt=w.length;r<rt;r+=1)if(v=w[r].style.width,v&&v.indexOf("%")==-1)e+=parseInt(v,10);else{e=0;break}l=n(">.k-grid-header table:first,>.k-grid-footer table:first",i.wrapper).add(i.table);i._footerWidth=null;e&&(l.each(function(){this.style.width=e+"px"}),i._footerWidth=e);o.msie&&o.version==8&&(l.css("display","inline-table"),setTimeout(function(){l.css("display","table")},1))}i._updateFirstColumnClass();i.trigger(di,{column:t})}},_setParentsVisibility:function(t,r){var h=this.columns,e,o=[],u,s,f,c,l=r?function(n){return k(n.columns).length&&n.hidden}:function(n){return!k(n.columns).length&&!n.hidden};if(fr(t,h,o)&&o.length)for(e=o.length-1;e>=0;e--)u=o[e],s=pt(u,h),f=tt(n(">table>thead",this.lockedHeader),this.thead,">tr:eq("+s.row+")>th:not(.k-group-cell):not(.k-hierarchy-cell)").eq(s.cell),l(u)&&(ri(u,r),f[0].style.display=r?"":"none"),f.filter("["+i.attr("colspan")+"]").length&&(c=parseInt(f.attr(i.attr("colspan")),10),f[0].colSpan=c-wt(u.columns)||1)},showColumn:function(t){var i=this,r,g,nt,v,e,y,p,w,b,o=i.columns,s=i.footer||i.wrapper.find(".k-grid-footer"),l=i.lockedHeader?d(i.lockedHeader.find(">table>thead")).length:0,f,k;if(t=typeof t=="number"?o[t]:c(t)?a(ft(o),function(n){return n===t})[0]:a(ft(o),function(n){return n.field===t})[0],t&&!ut(t)){if(t.columns&&t.columns.length){for(p=pt(t,o),ri(t,!0),st(tt(n(">table>thead",i.lockedHeader),i.thead,">tr:eq("+p.row+")>th"),p.cell,!0),r=0;r<t.columns.length;r++)this.showColumn(t.columns[r]);i.trigger(gi,{column:t});return}if(f=h(t,u(o)),ri(t,!0),i._setParentsVisibility(t,!0),i._templates(),i._updateCols(),i._updateLockedCols(),k=i.thead,y=f,i.lockedHeader&&l>f?k=i.lockedHeader.find(">table>thead"):y-=l,nt=d(k).eq(y),nt[0].style.display="",st(tt(n(">table>thead",i.lockedHeader),i.thead,">tr.k-filter-row>th"),f,!0),s[0]&&(i._updateCols(s.find(">.k-grid-footer-wrap>table")),i._updateLockedCols(s.find(">.k-grid-footer-locked>table")),st(s.find(".k-footer-template>td"),f,!0)),i.lockedTable&&l>f?tf(i.lockedTable.find(">tbody>tr"),f):tf(i.tbody.children(),f-l),i.lockedTable)i._updateTablesWidth(),i._applyLockedContainersWidth(),i._syncLockedContentHeight(),i._syncLockedHeaderHeight();else if(v=n(">.k-grid-header table:first,>.k-grid-footer table:first",i.wrapper).add(i.table),t.width){for(e=0,b=i.thead.prev().find("col"),r=0,g=b.length;r<g;r+=1){if(w=b[r].style.width,w.indexOf("%")>-1){e=0;break}e+=parseInt(w,10)}i._footerWidth=null;e&&(v.each(function(){this.style.width=e+"px"}),i._footerWidth=e)}else v.width("");i._updateFirstColumnClass();i.trigger(gi,{column:t})}},_progress:function(n){var t=this.element;this.lockedContent?t=this.wrapper:this.element.is("table")?t=this.element.parent():this.content&&this.content.length&&(t=this.content);i.ui.progress(t,n)},_resize:function(n,t){this.content&&(this._setContentWidth(),this._setContentHeight());this.virtualScrollable&&(t||this._rowHeight)&&(t&&(this._rowHeight=null),this.virtualScrollable.repaintScrollbar())},_isActiveInTable:function(){var t=ct();return this.table[0]===t||n.contains(this.table[0],t)||this._isLocked()&&(this.lockedTable[0]===t||n.contains(this.lockedTable[0],t))},refresh:function(t){var i=this,u=i.dataSource.view(),h=i.options.navigatable,e,o=n(i.current()),s=!1,r=(i.dataSource.group()||[]).length,c=i.content&&i.content.scrollLeft(),f=r+it(k(i.columns)).length;if((!t||t.action!=="itemchange"||!i.editable)&&(t=t||{},!i.trigger("dataBinding",{action:t.action||"rebind",index:t.index,items:t.items}))){if(i._angularItems("cleanup"),h&&(i._isActiveInTable()||i._editContainer&&i._editContainer.data("kendoWindow"))&&(s=o.is("th"),e=Math.max(i.cellIndex(o),0)),i._destroyEditable(),i._progress(!1),i._hideResizeHandle(),i._data=[],i.columns.length||(i._autoColumns(i._firstDataItem(u[0],r)),f=r+i.columns.length),i._group=r>0||i._group,i._group&&(i._templates(),i._updateCols(),i._updateLockedCols(),i._updateHeader(r),i._group=r>0),i._renderContent(u,f,r),i._renderLockedContent(u,f,r),i._footer(),i._renderNoRecordsContent(),i._setContentHeight(),i._setContentWidth(c),i.lockedTable)if(i.options.scrollable.virtual)i.content.find(">.k-virtual-scrollable-wrap").trigger("scroll");else if(i.touchScroller)i.touchScroller.movable.trigger("change");else{i.wrapper.one("scroll",function(n){n.stopPropagation()});i.content.trigger("scroll")}i._restoreCurrent(e,s);i.touchScroller&&i.touchScroller.contentResized();i.selectable&&i.selectable.resetTouchEvents();i._muteAngularRebind(function(){i._angularItems("compile")});i.trigger(nr)}},_restoreCurrent:function(i,r){var f,u,e;i===t||i<0||(this._removeCurrent(),r?this._setCurrent(this.thead.find("th:not(.k-group-cell)").eq(i)):(f=0,this._rowVirtualIndex?f=this.virtualScrollable.position(this._rowVirtualIndex):i=0,u=n(),this.lockedTable&&(u=this.lockedTable.find(">tbody>tr").eq(f)),u=u.add(this.tbody.children().eq(f)),e=u.find(">td:not(.k-group-cell):not(.k-hierarchy-cell)").eq(i),this._setCurrent(e)),this._current&&w(this._current.closest("table")[0],!0))},_angularItems:function(n){i.ui.DataBoundWidget.fn._angularItems.call(this,n);n==="cleanup"&&this._cleanupDetailItems();this._angularGroupItems(n);this._angularGroupFooterItems(n)},_cleanupDetailItems:function(){var n=this;n._hasDetails()&&(n.angular("cleanup",function(){return{elements:n.tbody.children(".k-detail-row")}}),n.tbody.find(".k-detail-cell").empty())},_angularGroupItems:function(t){var i=this,r=i.tbody;i.lockedContent&&(r=i.lockedTable.find("tbody"));i._group&&i.angular(t,function(){return{elements:r.children(".k-grouping-row"),data:n.map(gu(i.dataSource.view()),function(n){return{dataItem:n}})}})},_angularGroupFooterItems:function(t){var i=this,r=i.tbody;i.lockedContent&&(r=i.element);i._group&&i.groupFooterTemplate&&i.angular(t,function(){return{elements:r.find(".k-group-footer"),data:n.map(nf(i.dataSource.view()),function(n){return{dataItem:n}})}})},_renderContent:function(n,t,i){var r=this,u,o,e="",f=r.lockedContent!=null,s={rowTemplate:r.rowTemplate,altRowTemplate:r.altRowTemplate,groupFooterTemplate:r.groupFooterTemplate};if(t=f?t-it(cr(r.columns)).length:t,i>0)for(t=f?t-i:t,r.detailTemplate&&t++,r.groupFooterTemplate&&(r._groupAggregatesDefaultObject=r.dataSource.aggregates()),u=0,o=n.length;u<o;u++)e+=r._groupRowHtml(n[u],t,0,f?ue:ef,s,f);else e+=r._rowsHtml(n,s);r.tbody=bu(r.tbody,r.table,e,this.options.$angular)},_renderLockedContent:function(n,t,i){var f="",r,o,s={rowTemplate:this.lockedRowTemplate,altRowTemplate:this.lockedAltRowTemplate,groupFooterTemplate:this.lockedGroupFooterTemplate},e;if(this.lockedContent){if(e=this.lockedTable,i>0)for(t=t-k(u(ot(this.columns))).length,r=0,o=n.length;r<o;r++)f+=this._groupRowHtml(n[r],t,0,ef,s);else f=this._rowsHtml(n,s);bu(e.children("tbody"),e,f,this.options.$angular);this._syncLockedContentHeight()}},_adjustRowsHeight:function(n,t){for(var r=n[0].rows,c=r.length,u=t[0].rows,f=n.add(t),l=f.length,e=[],i=0;i<c;i++){if(!u[i])break;r[i].style.height&&(r[i].style.height=u[i].style.height="");var o=r[i].offsetHeight,s=u[i].offsetHeight,h=0;o>s?h=o:o<s&&(h=s);e.push(h)}for(i=0;i<l;i++)f[i].style.display="none";for(i=0;i<c;i++)e[i]&&(r[i].style.height=u[i].style.height=e[i]+1+"px");for(i=0;i<l;i++)f[i].style.display=""}});i.ExcelMixin&&i.ExcelMixin.extend(ei.prototype);i.PDFMixin&&(i.PDFMixin.extend(ei.prototype),ei.prototype._drawPDF=function(r){function l(){if(s&&h!==t){u.unbind("change",c);u.one("change",function(){e.resolve(o)});u.page(h)}else e.resolve(o)}function c(){f._drawPDFShadow({width:f.wrapper.width()},{avoidLinks:f.options.pdf.avoidLinks}).done(function(n){var t=u.page(),i=s?u.totalPages():1,f={page:n,pageNumber:t,progress:t/i,totalPages:i};r.notify(f);o.append(f.page);t<i?u.page(t+1):l()}).fail(function(n){e.reject(n)})}var e=new n.Deferred,f=this,u=f.dataSource,s=f.options.pdf.allPages,o,h;return this._initPDFProgress(r),o=new i.drawing.Group,h=u.page(),s?(u.bind("change",c),u.page(1)):c(),e.promise()},ei.prototype._initPDFProgress=function(t){var r=n("<div class='k-loading-pdf-mask'><div class='k-loading-color'/><\/div>"),u;r.prepend(this.wrapper.clone().css({position:"absolute",top:0,left:0}));this.wrapper.append(r);u=n("<div class='k-loading-pdf-progress'>").appendTo(r).kendoProgressBar({type:"chunk",chunkCount:10,min:0,max:1,value:0}).data("kendoProgressBar");t.progress(function(n){u.value(n.progress)}).always(function(){i.destroy(r);r.remove()})});ht.plugin(ei);ht.plugin(su)})(window.kendo.jQuery)}(),function(){(function(n,t){var i=window.kendo,f="change",c="cancel",l="dataBound",a="dataBinding",o=i.ui.Widget,r=i.keys,v=">*",y="progress",p="error",s="k-state-focused",w="k-state-selected",h="k-edit-item",b="edit",k="remove",d="save",tt="click",u=".kendoListView",e=n.proxy,g=i._activeElement,nt=i.ui.progress,it=i.data.DataSource,rt=i.ui.DataBoundWidget.extend({init:function(t,r){var u=this;r=n.isArray(r)?{dataSource:r}:r;o.fn.init.call(u,t,r);r=u.options;u.wrapper=t=u.element;t[0].id&&(u._itemId=t[0].id+"_lv_active");u._element();u._dataSource();u._templates();u._navigatable();u._selectable();u._pageable();u._crudHandlers();u.options.autoBind&&u.dataSource.fetch();i.notify(u)},events:[f,c,a,l,b,k,d],options:{name:"ListView",autoBind:!0,selectable:!1,navigatable:!1,template:"",altTemplate:"",editTemplate:""},setOptions:function(n){o.fn.setOptions.call(this,n);this._templates();this.selectable&&(this.selectable.destroy(),this.selectable=null);this._selectable()},_templates:function(){var n=this.options;this.template=i.template(n.template||"");this.altTemplate=i.template(n.altTemplate||n.template);this.editTemplate=i.template(n.editTemplate||"")},_item:function(n){return this.element.children()[n]()},items:function(){return this.element.children()},dataItem:function(t){var r=i.attr("uid"),u=n(t).closest("["+r+"]").attr(r);return this.dataSource.getByUid(u)},setDataSource:function(n){this.options.dataSource=n;this._dataSource();this.options.autoBind&&n.fetch()},_unbindDataSource:function(){var n=this;n.dataSource.unbind(f,n._refreshHandler).unbind(y,n._progressHandler).unbind(p,n._errorHandler)},_dataSource:function(){var n=this;n.dataSource&&n._refreshHandler?n._unbindDataSource():(n._refreshHandler=e(n.refresh,n),n._progressHandler=e(n._progress,n),n._errorHandler=e(n._error,n));n.dataSource=it.create(n.options.dataSource).bind(f,n._refreshHandler).bind(y,n._progressHandler).bind(p,n._errorHandler)},_progress:function(){nt(this.element,!0)},_error:function(){nt(this.element,!1)},_element:function(){this.element.addClass("k-widget k-listview").attr("role","listbox")},refresh:function(n){var t=this,e=t.dataSource.view(),f,s,u,h="",r,o,c=t.template,v=t.altTemplate,y=g();if(n=n||{},n.action==="itemchange"){t._hasBindingTarget()||t.editable||(f=n.items[0],u=t.items().filter("["+i.attr("uid")+"="+f.uid+"]"),u.length>0&&(r=u.index(),t.angular("cleanup",function(){return{elements:[u]}}),u.replaceWith(c(f)),u=t.items().eq(r),u.attr(i.attr("uid"),f.uid),t.angular("compile",function(){return{elements:[u],data:[{dataItem:f}]}}),t.trigger("itemChange",{item:u,data:f})));return}if(!t.trigger(a,{action:n.action||"rebind",items:n.items,index:n.index})){for(t._angularItems("cleanup"),t._destroyEditable(),r=0,o=e.length;r<o;r++)h+=r%2?v(e[r]):c(e[r]);for(t.element.html(h),s=t.items(),r=0,o=e.length;r<o;r++)s.eq(r).attr(i.attr("uid"),e[r].uid).attr("role","option").attr("aria-selected","false");t.element[0]===y&&t.options.navigatable&&t.current(s.eq(0));t._angularItems("compile");t.trigger(l)}},_pageable:function(){var t=this,r=t.options.pageable,u,f;n.isPlainObject(r)&&(f=r.pagerId,u=n.extend({},r,{dataSource:t.dataSource,pagerId:null}),t.pager=new i.ui.Pager(n("#"+f),u))},_selectable:function(){var n=this,e,t,o=n.options.selectable,s=n.options.navigatable;if(o&&(e=i.ui.Selectable.parseOptions(o).multiple,n.selectable=new i.ui.Selectable(n.element,{aria:!0,multiple:e,filter:v,change:function(){n.trigger(f)}}),s))n.element.on("keydown"+u,function(i){if(i.keyCode===r.SPACEBAR){if(t=n.current(),i.target==i.currentTarget&&i.preventDefault(),e)if(i.ctrlKey){if(t&&t.hasClass(w)){t.removeClass(w);return}}else n.selectable.clear();else n.selectable.clear();n.selectable.value(t)}})},current:function(n){var r=this,f=r.element,i=r._current,u=r._itemId;if(n===t)return i;i&&i[0]&&(i[0].id===u&&i.removeAttr("id"),i.removeClass(s),f.removeAttr("aria-activedescendant"));n&&n[0]&&(u=n[0].id||u,r._scrollTo(n[0]),f.attr("aria-activedescendant",u),n.addClass(s).attr("id",u));r._current=n},_scrollTo:function(t){var u=this,i,e=!1,r="scroll",f;u.wrapper.css("overflow")=="auto"||u.wrapper.css("overflow")==r?i=u.wrapper[0]:(i=window,e=!0);f=function(u,f){var o=e?n(t).offset()[u.toLowerCase()]:t["offset"+u],s=t["client"+f],h=n(i)[r+u](),c=n(i)[f.toLowerCase()]();o+s>h+c?n(i)[r+u](o+s-c):o<h&&n(i)[r+u](o)};f("Top","Height");f("Left","Width")},_navigatable:function(){var t=this,o=t.options.navigatable,f=t.element,c=function(i){t.current(n(i.currentTarget));n(i.target).is(":button,a,:input,a>.k-icon,textarea")||f.focus()};if(o){t._tabindex();f.on("focus"+u,function(){var n=t._current;n&&n.is(":visible")||(n=t._item("first"));t.current(n)}).on("focusout"+u,function(){t._current&&t._current.removeClass(s)}).on("keydown"+u,function(u){var e=u.keyCode,o=t.current(),v=n(u.target),y=!v.is(":button,textarea,a,a>.t-icon,input"),a=v.is(":text"),s=i.preventDefault,c=f.find("."+h),p=g(),l,w;if((y||a||r.ESC==e)&&(!a||r.ESC==e||r.ENTER==e))if(r.UP===e||r.LEFT===e)o&&(o=o.prev()),t.current(!o||!o[0]?t._item("last"):o),s(u);else if(r.DOWN===e||r.RIGHT===e)o&&(o=o.next()),t.current(!o||!o[0]?t._item("first"):o),s(u);else if(r.PAGEUP===e)t.current(null),t.dataSource.page(t.dataSource.page()-1),s(u);else if(r.PAGEDOWN===e)t.current(null),t.dataSource.page(t.dataSource.page()+1),s(u);else if(r.HOME===e)t.current(t._item("first")),s(u);else if(r.END===e)t.current(t._item("last")),s(u);else if(r.ENTER===e)if(c.length!==0&&(y||a)){l=t.items().index(c);p&&p.blur();t.save();w=function(){t.element.trigger("focus");t.current(t.items().eq(l))};t.one("dataBound",w)}else t.options.editTemplate!==""&&t.edit(o);else if(r.ESC===e){if(c=f.find("."+h),c.length===0)return;l=t.items().index(c);t.cancel();t.element.trigger("focus");t.current(t.items().eq(l))}});f.on("mousedown"+u+" touchstart"+u,v,e(c,t))}},clearSelection:function(){var n=this;n.selectable.clear();n.trigger(f)},select:function(t){var r=this,i=r.selectable;if(t=n(t),t.length){i.options.multiple||(i.clear(),t=t.first());i.value(t);return}return i.value()},_destroyEditable:function(){var n=this;n.editable&&(n.editable.destroy(),delete n.editable)},_modelFromElement:function(n){var t=n.attr(i.attr("uid"));return this.dataSource.getByUid(t)},_closeEditable:function(){var n=this,t=n.editable,r,u,f,e=n.template;return t&&(t.element.index()%2&&(e=n.altTemplate),n.angular("cleanup",function(){return{elements:[t.element]}}),r=n._modelFromElement(t.element),n._destroyEditable(),f=t.element.index(),t.element.replaceWith(e(r)),u=n.items().eq(f),u.attr(i.attr("uid"),r.uid),n._hasBindingTarget()&&i.bind(u,r),n.angular("compile",function(){return{elements:[u],data:[{dataItem:r}]}})),!0},edit:function(n){var t=this,r=t._modelFromElement(n),u,e=r.uid,f;t.cancel();n=t.items().filter("["+i.attr("uid")+"="+e+"]");f=n.index();n.replaceWith(t.editTemplate(r));u=t.items().eq(f).addClass(h).attr(i.attr("uid"),r.uid);t.editable=u.kendoEditable({model:r,clearContainer:!1,errorTemplate:!1,target:t}).data("kendoEditable");t.trigger(b,{model:r,item:u})},save:function(){var n=this,t=n.editable,r,i;t&&(i=t.element,r=n._modelFromElement(i),t.end()&&!n.trigger(d,{model:r,item:i})&&(n._closeEditable(),n.dataSource.sync()))},remove:function(n){var t=this,i=t.dataSource,r=t._modelFromElement(n);t.editable&&(i.cancelChanges(t._modelFromElement(t.editable.element)),t._closeEditable());t.trigger(k,{model:r,item:n})||(n.hide(),i.remove(r),i.sync())},add:function(){var n=this,r,t=n.dataSource,i=t.indexOf((t.view()||[])[0]);i<0&&(i=0);n.cancel();r=t.insert(i,{});n.edit(n.element.find("[data-uid='"+r.uid+"']"))},cancel:function(){var n=this,r=n.dataSource,t,i;n.editable&&(t=n.editable.element,i=n._modelFromElement(t),n.trigger(c,{model:i,container:t})||(r.cancelChanges(i),n._closeEditable()))},_crudHandlers:function(){var t=this,r=tt+u;t.element.on(r,".k-edit-button",function(r){var u=n(this).closest("["+i.attr("uid")+"]");t.edit(u);r.preventDefault()});t.element.on(r,".k-delete-button",function(r){var u=n(this).closest("["+i.attr("uid")+"]");t.remove(u);r.preventDefault()});t.element.on(r,".k-update-button",function(n){t.save();n.preventDefault()});t.element.on(r,".k-cancel-button",function(n){t.cancel();n.preventDefault()})},destroy:function(){var n=this;o.fn.destroy.call(n);n._unbindDataSource();n._destroyEditable();n.element.off(u);n.pager&&n.pager.destroy();i.destroy(n.element)}});i.ui.plugin(rt)})(window.kendo.jQuery)}(),function(){(function(n){function g(t){return n.map(nt(t),function(n){return n.name}).join(", ")}function nt(n){var t=n[0];return t.files?tt(t.files):[{name:at(t.value),extension:it(t.value),size:null}]}function tt(t){return n.map(t,function(n){return lt(n)})}function lt(n){var i=n.name||n.fileName;return{name:t.htmlEncode(i),extension:it(i),size:n.size||n.fileSize,rawFile:n}}function it(n){var t=n.match(ct);return t?t[0]:""}function at(n){var t=n.lastIndexOf("\\");return t!=-1?n.substr(t+1):n}function p(i,r){var u=t.guid();return n.map(i,function(n){return n.uid=r?t.guid():u,n})}function rt(t){return!t.multiple&&n(".k-file",t.wrapper).length>1}function ut(t,i,r){if(!i._supportsRemove()){rt(i)&&i._removeFileEntry(t);return}var u=t.data("fileNames"),f=n.map(u,function(n){return n.name});i._submitRemove(f,r,function(n,r,f){i._removeFileEntry(t);i.trigger(l,{operation:"remove",files:u,response:n,XMLHttpRequest:f})},function(n){rt(i)&&i._removeFileEntry(t);i.trigger(e,{operation:"remove",files:u,XMLHttpRequest:n});w("Server response: "+n.responseText)})}function ft(t,i,r){var u=!1,f="";try{f=n.parseJSON(et(t));u=!0}catch(e){r()}u&&i(f)}function et(n){return(typeof n=="undefined"||n==="")&&(n="{}"),n}function ot(n){n.stopPropagation();n.preventDefault()}function st(n,t,i,r){var u,f;n.on("dragenter"+t,function(){i();f=new Date;u||(u=setInterval(function(){var n=new Date-f;n>100&&(r(),clearInterval(u),u=null)},100))}).on("dragover"+t,function(){f=new Date})}function ht(n){return n.is(".k-file-progress, .k-file-success, .k-file-error")}function i(t){return n(t.target).closest(".k-file")}var t=window.kendo,f=t.ui.Widget,s=t.antiForgeryTokens,w=t.logToConsole,ct=/\.([^\.]+)$/,r=".kendoUpload",h="select",c="upload",l="success",e="error",b="complete",o="cancel",k="progress",u="remove",a=f.extend({init:function(i,u){var e=this,o,s,h;f.fn.init.call(e,i,u);e.name=i.name;e.multiple=e.options.multiple;e.localization=e.options.localization;o=e.element;e.wrapper=o.closest(".k-upload");e.wrapper.length===0&&(e.wrapper=e._wrapInput(o));e._activeInput(o);e.toggle(e.options.enabled);s=e._ns=r+"-"+t.guid();o.closest("form").on("submit"+s,n.proxy(e._onParentFormSubmit,e)).on("reset"+s,n.proxy(e._onParentFormReset,e));e.options.async.saveUrl?(e._module=e._supportsFormData()?new y(e):new v(e),e._async=!0,h=e.options.files,h.length>0&&e._renderInitialFiles(h)):e._module=new d(e);e._supportsDrop()&&e._setupDropZone();e.wrapper.on("click",".k-upload-action",n.proxy(e._onFileAction,e)).on("click",".k-upload-selected",n.proxy(e._onUploadSelected,e));e.element.val()&&e._onInputChange({target:e.element})},events:[h,c,l,e,b,o,k,u],options:{name:"Upload",enabled:!0,multiple:!0,showFileList:!0,template:"",files:[],async:{removeVerb:"POST",autoUpload:!0,withCredentials:!0},localization:{select:"Select files...",cancel:"Cancel",retry:"Retry",remove:"Remove",uploadSelectedFiles:"Upload files",dropFilesHere:"drop files here to upload",statusUploading:"uploading",statusUploaded:"uploaded",statusWarning:"warning",statusFailed:"failed",headerStatusUploading:"Uploading...",headerStatusUploaded:"Done"}},setOptions:function(n){var t=this,i=t.element;f.fn.setOptions.call(t,n);t.multiple=t.options.multiple;i.attr("multiple",t._supportsMultiple()?t.multiple:!1);t.toggle(t.options.enabled)},enable:function(n){n=typeof n=="undefined"?!0:n;this.toggle(n)},disable:function(){this.toggle(!1)},toggle:function(n){n=typeof n=="undefined"?n:!n;this.wrapper.toggleClass("k-state-disabled",n);this.element.prop("disabled",n)},destroy:function(){var t=this;n(document).add(n(".k-dropzone",t.wrapper)).add(t.wrapper.closest("form")).off(t._ns);n(t.element).off(r);f.fn.destroy.call(t)},_addInput:function(t){if(t[0].nodeType){var i=this,u=t.clone().val("");u.insertAfter(i.element).data("kendoUpload",i);n(i.element).hide().attr("tabindex","-1").removeAttr("id").off(r);i._activeInput(u);i.element.focus()}},_activeInput:function(t){var i=this,u=i.wrapper;i.element=t;t.attr("multiple",i._supportsMultiple()?i.multiple:!1).attr("autocomplete","off").on("click"+r,function(n){u.hasClass("k-state-disabled")&&n.preventDefault()}).on("focus"+r,function(){n(this).parent().addClass("k-state-focused")}).on("blur"+r,function(){n(this).parent().removeClass("k-state-focused")}).on("change"+r,n.proxy(i._onInputChange,i)).on("keydown"+r,n.proxy(i._onInputKeyDown,i))},_onInputKeyDown:function(n){var r=this,i=r.wrapper.find(".k-upload-action:first");n.keyCode===t.keys.TAB&&i.length>0&&(n.preventDefault(),i.focus())},_onInputChange:function(t){var i=this,r=n(t.target),u=p(i._inputFiles(r),i._isAsyncNonBatch()),f=i.trigger(h,{files:u});if(f)i._addInput(r),r.remove();else i._module.onSelect({target:r},u)},_onDrop:function(t){var e=t.originalEvent.dataTransfer,i=this,u=e.files,r=p(tt(u),i._isAsyncNonBatch()),f;if(ot(t),u.length>0&&!i.wrapper.hasClass("k-state-disabled")&&(!i.multiple&&r.length>1&&r.splice(1,r.length-1),f=i.trigger(h,{files:r}),!f))i._module.onSelect({target:n(".k-dropzone",i.wrapper)},r)},_isAsyncNonBatch:function(){return this._async&&!this.options.async.batch||!1},_renderInitialFiles:function(t){var f=this,i=0,e,r;for(t=p(t,!0),i=0;i<t.length;i++)e=t[i],r=f._enqueueFile(e.name,{fileNames:[e]}),r.addClass("k-file-success").data("files",[t[i]]),n(".k-progress",r).width("100%"),f.options.template||n(".k-upload-status",r).prepend("<span class='k-upload-pct'>100%<\/span>"),f._supportsRemove()&&f._fileAction(r,u)},_prepareTemplateData:function(n,t){for(var u=t.fileNames,i={},f=0,r=0,r=0;r<u.length;r++)f+=u[r].size;return i.name=n,i.size=f,i.files=t.fileNames,i},_prepareDefaultFileEntryTemplate:function(t,i){var r="",u=n("<li class='k-file'><span class='k-progress'><\/span><span class='k-icon'><\/span><span class='k-filename' title='"+t+"'>"+t+"<\/span><strong class='k-upload-status'><\/strong><\/li>");return i.fileNames.length!=1||!i.fileNames[0].extension||(r=i.fileNames[0].extension.substring(1),n(".k-icon",u).addClass("k-i-"+r)),u},_enqueueFile:function(i,r){var f=this,s,e,a=r.fileNames[0].uid,o=n(".k-upload-files",f.wrapper),v=f.options,h=v.template,c,l;if(o.length===0&&(o=n("<ul class='k-upload-files k-reset'><\/ul>").appendTo(f.wrapper),f.options.showFileList||o.hide(),f.wrapper.removeClass("k-upload-empty")),s=n(".k-file",o),h?(c=f._prepareTemplateData(i,r),h=t.template(h),e=n("<li class='k-file'>"+h(c)+"<\/li>"),e.find(".k-upload-action").addClass("k-button k-button-bare"),f.angular("compile",function(){return{elements:e,data:[c]}})):e=f._prepareDefaultFileEntryTemplate(i,r),e.attr(t.attr("uid"),a).appendTo(o).data(r),f._async||n(".k-progress",e).width("100%"),!f.multiple&&s.length>0&&(l={files:s.data("fileNames")},!f.trigger(u,l)))f._module.onRemove({target:n(s,f.wrapper)},l.data);return e},_removeFileEntry:function(t){var u=this,i=t.closest(".k-upload-files"),r,f;t.remove();r=n(".k-file",i);f=n(".k-file-success, .k-file-error",i);f.length===r.length&&this._hideUploadButton();r.length===0&&(i.remove(),u.wrapper.addClass("k-upload-empty"),u._hideHeaderUploadstatus())},_fileAction:function(n,t){var i={remove:"k-delete",cancel:"k-cancel",retry:"k-retry"},r={remove:"k-i-close",cancel:"k-i-close",retry:"k-i-refresh"};i.hasOwnProperty(t)&&(this._clearFileAction(n),this.options.template?n.find(".k-upload-action").addClass("k-button k-button-bare").append("<span class='k-icon "+r[t]+" "+i[t]+"' title='"+this.localization[t]+"'><\/span>").show():(n.find(".k-upload-status .k-upload-action").remove(),n.find(".k-upload-status").append(this._renderAction(i[t],this.localization[t],r[t]))))},_fileState:function(t,i){var r=this.localization,f={uploading:{text:r.statusUploading},uploaded:{text:r.statusUploaded},failed:{text:r.statusFailed}},u=f[i];u&&n(".k-icon:not(.k-delete, .k-cancel, .k-retry)",t).text(u.text)},_renderAction:function(t,i,r){return t!==""?n("<button type='button' class='k-button k-button-bare k-upload-action'><span class='k-icon "+r+" "+t+"' title='"+i+"'><\/span><\/button>"):n("<button type='button' class='k-button'>"+i+"<\/button>")},_clearFileAction:function(t){n(".k-upload-action",t).empty().hide()},_onFileAction:function(t){var i=this;if(!i.wrapper.hasClass("k-state-disabled")){var s=n(t.target).closest(".k-upload-action"),f=s.find(".k-icon"),r=s.closest(".k-file"),e={files:r.data("fileNames")};if(f.hasClass("k-delete")){if(!i.trigger(u,e))i._module.onRemove({target:n(r,i.wrapper)},e.data)}else if(f.hasClass("k-cancel")){i.trigger(o,e);i._module.onCancel({target:n(r,i.wrapper)});this._checkAllComplete();i._updateHeaderUploadStatus()}else if(f.hasClass("k-retry")){n(".k-warning",r).remove();i._module.onRetry({target:n(r,i.wrapper)})}}return!1},_onUploadSelected:function(){var n=this,t=n.wrapper;return t.hasClass("k-state-disabled")||this._module.onSaveSelected(),!1},_onFileProgress:function(t,r){var u;r>100&&(r=100);this.options.template?n(".k-progress",t.target).width(r+"%"):(u=n(".k-upload-pct",t.target),u.length===0&&n(".k-upload-status",t.target).prepend("<span class='k-upload-pct'><\/span>"),n(".k-upload-pct",t.target).text(r+"%"),n(".k-progress",t.target).width(r+"%"));this.trigger(k,{files:i(t).data("fileNames"),percentComplete:r})},_onUploadSuccess:function(n,t,r){var f=i(n);this._fileState(f,"uploaded");f.removeClass("k-file-progress").addClass("k-file-success");this._updateHeaderUploadStatus();this.trigger(l,{files:f.data("fileNames"),response:t,operation:"upload",XMLHttpRequest:r});this._supportsRemove()?this._fileAction(f,u):this._clearFileAction(f);this._checkAllComplete()},_onUploadError:function(t,r){var u=i(t),f=n(".k-upload-pct",u);this._fileState(u,"failed");u.removeClass("k-file-progress").addClass("k-file-error");n(".k-progress",u).width("100%");f.length>0?f.empty().removeClass("k-upload-pct").addClass("k-icon k-warning"):n(".k-upload-status",u).prepend("<span class='k-icon k-warning'><\/span>");this._updateHeaderUploadStatus();this._fileAction(u,"retry");this.trigger(e,{operation:"upload",files:u.data("fileNames"),XMLHttpRequest:r});w("Server response: "+r.responseText);this._checkAllComplete()},_showUploadButton:function(){var t=n(".k-upload-selected",this.wrapper);t.length===0&&(t=this._renderAction("",this.localization.uploadSelectedFiles).addClass("k-upload-selected"));this.wrapper.append(t)},_hideUploadButton:function(){n(".k-upload-selected",this.wrapper).remove()},_showHeaderUploadStatus:function(){var i=this.localization,r=n(".k-dropzone",this.wrapper),t=n(".k-upload-status-total",this.wrapper);t.length!==0&&t.remove();t='<strong class="k-upload-status k-upload-status-total">'+i.headerStatusUploading+'<span class="k-icon k-loading">'+i.statusUploading+"<\/span><\/strong>";r.length>0?r.append(t):n(".k-upload-button",this.wrapper).after(t)},_updateHeaderUploadStatus:function(){var t=this,u=t.localization,e=n(".k-file",t.wrapper).not(".k-file-success, .k-file-error"),i,r,f;e.length===0&&(i=n(".k-file.k-file-error",t.wrapper),r=n(".k-upload-status-total",t.wrapper),f=n(".k-icon",r).removeClass("k-loading").addClass(i.length!==0?"k-warning":"k-i-tick").text(i.length!==0?u.statusWarning:u.statusUploaded),r.text(t.localization.headerStatusUploaded).append(f))},_hideHeaderUploadstatus:function(){n(".k-upload-status-total",this.wrapper).remove()},_onParentFormSubmit:function(){var r=this,i=r.element,t;typeof this._module.onAbort!="undefined"&&this._module.onAbort();i.value||(t=n(i),t.attr("disabled","disabled"),window.setTimeout(function(){t.removeAttr("disabled")},0))},_onParentFormReset:function(){n(".k-upload-files",this.wrapper).remove()},_supportsFormData:function(){return typeof FormData!="undefined"},_supportsMultiple:function(){var n=this._userAgent().indexOf("Windows")>-1;return!t.support.browser.opera&&!(t.support.browser.safari&&n)},_supportsDrop:function(){var n=this._userAgent().toLowerCase(),t=/chrome/.test(n),i=!t&&/safari/.test(n),r=i&&/windows/.test(n);return!r&&this._supportsFormData()&&this.options.async.saveUrl},_userAgent:function(){return navigator.userAgent},_setupDropZone:function(){var r=this,i,t;n(".k-upload-button",this.wrapper).wrap("<div class='k-dropzone'><\/div>");i=r._ns;t=n(".k-dropzone",r.wrapper).append(n("<em>"+r.localization.dropFilesHere+"<\/em>")).on("dragenter"+i,ot).on("dragover"+i,function(n){n.preventDefault()}).on("drop"+i,n.proxy(this._onDrop,this));st(t,i,function(){t.closest(".k-upload").hasClass("k-state-disabled")||t.addClass("k-dropzone-hovered")},function(){t.removeClass("k-dropzone-hovered")});st(n(document),i,function(){t.closest(".k-upload").hasClass("k-state-disabled")||(t.addClass("k-dropzone-active"),t.closest(".k-upload").removeClass("k-upload-empty"))},function(){t.removeClass("k-dropzone-active");n("li.k-file",t.closest(".k-upload")).length===0&&t.closest(".k-upload").addClass("k-upload-empty")})},_supportsRemove:function(){return!!this.options.async.removeUrl},_submitRemove:function(t,i,r,u){var e=this,o=e.options.async.removeField||"fileNames",f=n.extend(i,s());f[o]=t;jQuery.ajax({type:this.options.async.removeVerb,dataType:"json",dataFilter:et,url:this.options.async.removeUrl,traditional:!0,data:f,success:r,error:u,xhrFields:{withCredentials:this.options.async.withCredentials}})},_wrapInput:function(n){var t=this,i=t.options;return n.wrap("<div class='k-widget k-upload k-header'><div class='k-button k-upload-button'><\/div><\/div>"),i.async.saveUrl||n.closest(".k-upload").addClass("k-upload-sync"),n.closest(".k-upload").addClass("k-upload-empty"),n.closest(".k-button").append("<span>"+this.localization.select+"<\/span>"),n.closest(".k-upload")},_checkAllComplete:function(){n(".k-file.k-file-progress",this.wrapper).length===0&&this.trigger(b)},_inputFiles:function(n){return nt(n)}}),d=function(n){this.name="syncUploadModule";this.element=n.wrapper;this.upload=n;this.element.closest("form").attr("enctype","multipart/form-data").attr("encoding","multipart/form-data")},v,y;d.prototype={onSelect:function(t,i){var r=this.upload,f=n(t.target),e;r._addInput(f);e=r._enqueueFile(g(f),{relatedInput:f,fileNames:i});r._fileAction(e,u)},onRemove:function(n){var t=i(n);t.data("relatedInput").remove();this.upload._removeFileEntry(t)}};v=function(n){this.name="iframeUploadModule";this.element=n.wrapper;this.upload=n;this.iframes=[]};a._frameId=0;v.prototype={onSelect:function(t,i){var r=this.upload,e=n(t.target),f=this.prepareUpload(e,i);r.options.async.autoUpload?this.performUpload(f):(r._supportsRemove()&&this.upload._fileAction(f,u),r._showUploadButton())},prepareUpload:function(t,i){var r=this.upload,e=n(r.element),s=r.options.async.saveField||t.attr("name"),u,o,f;return r._addInput(t),t.attr("name",s),u=this.createFrame(r.name+"_"+a._frameId++),this.registerFrame(u),o=this.createForm(r.options.async.saveUrl,u.attr("name")).append(e),f=r._enqueueFile(g(t),{frame:u,relatedInput:e,fileNames:i}),u.data({form:o,file:f}),f},performUpload:function(t){var u={files:t.data("fileNames")},r=t.data("frame"),i=this.upload,f,e,h;if(i.trigger(c,u))i._removeFileEntry(r.data("file")),this.cleanupFrame(r),this.unregisterFrame(r);else{i._hideUploadButton();i._showHeaderUploadStatus();r.appendTo(document.body);f=r.data("form").attr("action",i.options.async.saveUrl).appendTo(document.body);u.data=n.extend({},u.data,s());for(e in u.data)h=f.find("input[name='"+e+"']"),h.length===0&&(h=n("<input>",{type:"hidden",name:e}).prependTo(f)),h.val(u.data[e]);i._fileAction(t,o);i._fileState(t,"uploading");n(t).removeClass("k-file-error").addClass("k-file-progress");r.one("load",n.proxy(this.onIframeLoad,this));f[0].submit()}},onSaveSelected:function(){var t=this;n(".k-file",this.element).each(function(){var i=n(this),r=ht(i);r||t.performUpload(i)})},onIframeLoad:function(t){var r=n(t.target),i;try{i=r.contents().text()}catch(u){i="Error trying to get server response: "+u}this.processResponse(r,i)},processResponse:function(t,i){var f=t.data("file"),r=this,u={responseText:i};ft(i,function(i){n.extend(u,{statusText:"OK",status:"200"});r.upload._onFileProgress({target:n(f,r.upload.wrapper)},100);r.upload._onUploadSuccess({target:n(f,r.upload.wrapper)},i,u);r.cleanupFrame(t);r.unregisterFrame(t)},function(){n.extend(u,{statusText:"error",status:"500"});r.upload._onUploadError({target:n(f,r.upload.wrapper)},u)})},onCancel:function(t){var i=n(t.target).data("frame");this.stopFrameSubmit(i);this.cleanupFrame(i);this.unregisterFrame(i);this.upload._removeFileEntry(i.data("file"))},onRetry:function(n){var t=i(n);this.performUpload(t)},onRemove:function(n,t){var r=i(n),u=r.data("frame");u?(this.unregisterFrame(u),this.upload._removeFileEntry(r),this.cleanupFrame(u)):ut(r,this.upload,t)},onAbort:function(){var t=this.element,i=this;n.each(this.iframes,function(){n("input",this.data("form")).appendTo(t);i.stopFrameSubmit(this[0]);this.data("form").remove();this.remove()});this.iframes=[]},createFrame:function(t){return n("<iframe name='"+t+"' id='"+t+"' style='display:none;' />")},createForm:function(t,i){return n("<form enctype='multipart/form-data' method='POST' action='"+t+"' target='"+i+"'/>")},stopFrameSubmit:function(n){typeof n.stop!="undefined"?n.stop():n.document&&n.document.execCommand("Stop")},registerFrame:function(n){this.iframes.push(n)},unregisterFrame:function(t){this.iframes=n.grep(this.iframes,function(n){return n.attr("name")!=t.attr("name")})},cleanupFrame:function(n){var t=n.data("form");n.data("file").data("frame",null);setTimeout(function(){t.remove();n.remove()},1)}};y=function(n){this.name="formDataUploadModule";this.element=n.wrapper;this.upload=n};y.prototype={onSelect:function(t,i){var r=this.upload,f=this,e=n(t.target),o=this.prepareUpload(e,i);n.each(o,function(){r.options.async.autoUpload?f.performUpload(this):(r._supportsRemove()&&r._fileAction(this,u),r._showUploadButton())})},prepareUpload:function(t,i){var r=this.enqueueFiles(i);return t.is("input")&&(n.each(r,function(){n(this).data("relatedInput",t)}),t.data("relatedFileEntries",r),this.upload._addInput(t)),r},enqueueFiles:function(t){var e=this.upload,r,u,s=t.length,f,i,o=[];if(e.options.async.batch===!0)r=n.map(t,function(n){return n.name}).join(", "),i=e._enqueueFile(r,{fileNames:t}),i.data("files",t),o.push(i);else for(u=0;u<s;u++)f=t[u],r=f.name,i=e._enqueueFile(r,{fileNames:[f]}),i.data("files",[f]),o.push(i);return o},performUpload:function(t){var r=this.upload,u=this.createFormData(),e=this.createXHR(),i={files:t.data("fileNames"),XMLHttpRequest:e},f;if(r.trigger(c,i))this.removeFileEntry(t);else{if(r._fileAction(t,o),r._hideUploadButton(),r._showHeaderUploadStatus(),i.formData)u=i.formData;else{i.data=n.extend({},i.data,s());for(f in i.data)u.append(f,i.data[f]);this.populateFormData(u,t.data("files"))}r._fileState(t,"uploading");n(t).removeClass("k-file-error").addClass("k-file-progress");this.postFormData(r.options.async.saveUrl,u,t,e)}},onSaveSelected:function(){var t=this;n(".k-file",this.element).each(function(){var i=n(this),r=ht(i);r||t.performUpload(i)})},onCancel:function(n){var t=i(n);this.stopUploadRequest(t);this.removeFileEntry(t)},onRetry:function(n){var t=i(n);this.performUpload(t)},onRemove:function(n,t){var r=i(n);r.hasClass("k-file-success")?ut(r,this.upload,t):this.removeFileEntry(r)},createXHR:function(){return new XMLHttpRequest},postFormData:function(n,t,i,r){var u=this;i.data("request",r);r.addEventListener("load",function(n){u.onRequestSuccess.call(u,n,i)},!1);r.addEventListener(e,function(n){u.onRequestError.call(u,n,i)},!1);r.upload.addEventListener("progress",function(n){u.onRequestProgress.call(u,n,i)},!1);r.open("POST",n,!0);r.withCredentials=this.upload.options.async.withCredentials;r.send(t)},createFormData:function(){return new FormData},populateFormData:function(n,t){for(var r=this.upload,u=t.length,i=0;i<u;i++)n.append(r.options.async.saveField||r.name,t[i].rawFile);return n},onRequestSuccess:function(t,i){function f(){r.upload._onUploadError({target:n(i,r.upload.wrapper)},u)}var u=t.target,r=this;u.status>=200&&u.status<=299?ft(u.responseText,function(t){r.upload._onFileProgress({target:n(i,r.upload.wrapper)},100);r.upload._onUploadSuccess({target:n(i,r.upload.wrapper)},t,u);r.cleanupFileEntry(i)},f):f()},onRequestError:function(t,i){var r=t.target;this.upload._onUploadError({target:n(i,this.upload.wrapper)},r)},cleanupFileEntry:function(t){var i=t.data("relatedInput"),r=!0;i&&(n.each(i.data("relatedFileEntries")||[],function(){this.parent().length>0&&this[0]!=t[0]&&(r=r&&this.hasClass("k-file-success"))}),r&&i.remove())},removeFileEntry:function(n){this.cleanupFileEntry(n);this.upload._removeFileEntry(n)},onRequestProgress:function(t,i){var r=Math.round(t.loaded*100/t.total);this.upload._onFileProgress({target:n(i,this.upload.wrapper)},r)},stopUploadRequest:function(n){n.data("request").abort()}};t.ui.plugin(a)})(window.kendo.jQuery)}(),function(){(function(n,t){function ft(n,t,i){var r,u;n.on("dragenter"+e,function(){t();u=new Date;r||(r=setInterval(function(){var n=new Date-u;n>100&&(i(),clearInterval(r),r=null)},100))}).on("dragover"+e,function(){u=new Date})}function nt(n,i){return n!==t&&n.match(/\/$/)||(n=(n||"")+"/"),n+i}function tt(n){if(!n)return"";var t=" bytes";return n>=1073741824?(t=" GB",n/=1073741824):n>=1048576?(t=" MB",n/=1048576):n>=1024&&(t=" KB",n/=1024),Math.round(n*100)/100+t}function ot(n,t){var i=n[t];return v(i)?i.from||i.field||t:i}var i=window.kendo,o=i.ui.Widget,v=n.isPlainObject,r=n.proxy,p=n.extend,y=i.support.placeholder,k=i.support.browser,d=i.isFunction,w=/(^\/|\/$)/g,s="change",g="apply",l="error",a="click",e=".kendoFileBrowser",h=".kendoBreadcrumbs",c=".kendoSearchBox",f="name",b="size",u="type",it={field:u,dir:"asc"},rt=i.template('<li class="k-tile-empty"><strong>${text}<\/strong><\/li>'),ut='<div class="k-widget k-filebrowser-toolbar k-header k-floatwrap"><div class="k-toolbar-wrap"># if (showUpload) { # <div class="k-widget k-upload"><div class="k-button k-button-icontext k-upload-button"><span class="k-icon k-add"><\/span>#=messages.uploadFile#<input type="file" name="file" /><\/div><\/div># } ## if (showCreate) { #<button type="button" class="k-button k-button-icon"><span class="k-icon k-addfolder" /><\/button># } ## if (showDelete) { #<button type="button" class="k-button k-button-icon k-state-disabled"><span class="k-icon k-delete" /><\/button>&nbsp;# } #<\/div><div class="k-tiles-arrange"><label>#=messages.orderBy#: <select /><\/label><\/a><\/div><\/div>',et;p(!0,i.data,{schemas:{filebrowser:{data:function(n){return n.items||n||[]},model:{id:"name",fields:{name:"name",size:"size",type:"type"}}}}});p(!0,i.data,{transports:{filebrowser:i.data.RemoteTransport.extend({init:function(t){i.data.RemoteTransport.fn.init.call(this,n.extend(!0,{},this.options,t))},_call:function(t,r){r.data=n.extend({},r.data,{path:this.options.path()});d(this.options[t])?this.options[t].call(this,r):i.data.RemoteTransport.fn[t].call(this,r)},read:function(n){this._call("read",n)},create:function(n){this._call("create",n)},destroy:function(n){this._call("destroy",n)},update:function(){},options:{read:{type:"POST"},update:{type:"POST"},create:{type:"POST"},destroy:{type:"POST"}}})}});et=k.msie&&k.version<8?function(n){return n.offsetTop}:function(t){return t.offsetTop-n(t).height()};var st=o.extend({init:function(n,t){var i=this;t=t||{};o.fn.init.call(i,n,t);i.element.addClass("k-filebrowser");i.element.on(a+e,".k-filebrowser-toolbar button:not(.k-state-disabled):has(.k-delete)",r(i._deleteClick,i)).on(a+e,".k-filebrowser-toolbar button:not(.k-state-disabled):has(.k-addfolder)",r(i._addClick,i)).on("keydown"+e,"li.k-state-selected input",r(i._directoryKeyDown,i)).on("blur"+e,"li.k-state-selected input",r(i._directoryBlur,i));i._dataSource();i.refresh();i.path(i.options.path)},options:{name:"FileBrowser",messages:{uploadFile:"Upload",orderBy:"Arrange by",orderByName:"Name",orderBySize:"Size",directoryNotFound:"A directory with this name was not found.",emptyFolder:"Empty Folder",deleteFile:'Are you sure you want to delete "{0}"?',invalidFileType:'The selected file "{0}" is not valid. Supported file types are {1}.',overwriteFile:'A file with name "{0}" already exists in the current directory. Do you want to overwrite it?',dropFilesHere:"drop file here to upload",search:"Search"},transport:{},path:"/",fileTypes:"*.*"},events:[l,s,g],destroy:function(){var n=this;o.fn.destroy.call(n);n.dataSource.unbind(l,n._errorHandler);n.element.add(n.list).add(n.toolbar).off(e);i.destroy(n.element)},value:function(){var r=this,e=r._selectedItem(),n,t=r.options.transport.fileUrl;if(e&&e.get(u)==="f")return n=nt(r.path(),e.get(f)).replace(w,""),t&&(n=d(t)?t(n):i.format(t,encodeURIComponent(n))),n},_selectedItem:function(){var t=this.listView,n=t.select();if(n.length)return this.dataSource.getByUid(n.attr(i.attr("uid")))},_toolbar:function(){var t=this,f=i.template(ut),u=t.options.messages,e=[{text:u.orderByName,value:"name"},{text:u.orderBySize,value:"size"}];t.toolbar=n(f({messages:u,showUpload:t.options.transport.uploadUrl,showCreate:t.options.transport.create,showDelete:t.options.transport.destroy})).appendTo(t.element).find(".k-upload input").kendoUpload({multiple:!1,localization:{dropFilesHere:u.dropFilesHere},async:{saveUrl:t.options.transport.uploadUrl,autoUpload:!0},upload:r(t._fileUpload,t),error:function(n){t._error({xhr:n.XMLHttpRequest,status:"error"})}}).end();t.upload=t.toolbar.find(".k-upload input").data("kendoUpload");t.arrangeBy=t.toolbar.find(".k-tiles-arrange select").kendoDropDownList({dataSource:e,dataTextField:"text",dataValueField:"value",change:function(){t.orderBy(this.value())}}).data("kendoDropDownList");t._attachDropzoneEvents()},_attachDropzoneEvents:function(){var t=this;t.options.transport.uploadUrl&&(ft(n(document.documentElement),n.proxy(t._dropEnter,t),n.proxy(t._dropLeave,t)),t._scrollHandler=r(t._positionDropzone,t))},_dropEnter:function(){this._positionDropzone();n(document).on("scroll"+e,this._scrollHandler)},_dropLeave:function(){this._removeDropzone();n(document).off("scroll"+e,this._scrollHandler)},_positionDropzone:function(){var t=this,n=t.element,i=n.offset();t.toolbar.find(".k-dropzone").addClass("k-filebrowser-dropzone").offset(i).css({width:n[0].clientWidth,height:n[0].clientHeight,lineHeight:n[0].clientHeight+"px"})},_removeDropzone:function(){this.toolbar.find(".k-dropzone").removeClass("k-filebrowser-dropzone").css({width:"",height:"",lineHeight:"",top:"",left:""})},_deleteClick:function(){var n=this,t=n.listView.select(),r=i.format(n.options.messages.deleteFile,t.find("strong").text());t.length&&n._showMessage(r,"confirm")&&n.listView.remove(t)},_addClick:function(){this.createDirectory()},_getFieldName:function(n){return ot(this.dataSource.reader.model.fields,n)},_fileUpload:function(n){var t=this,e=t.options,o=e.fileTypes,c=new RegExp(("("+o.split(",").join(")|(")+")").replace(/\*\./g,".*."),"i"),u=n.files[0].name,s=f,h=b,r;if(c.test(u))if(n.data={path:t.path()},r=t._createFile(u),r)t.upload.one("success",function(n){r.set(s,n.response[t._getFieldName(s)]);r.set(h,n.response[t._getFieldName(h)]);t._tiles=t.listView.items().filter("["+i.attr("type")+"=f]")});else n.preventDefault();else n.preventDefault(),t._showMessage(i.format(e.messages.invalidFileType,u,o))},_findFile:function(n){var i=this.dataSource.data(),t,r,o=u,s=f,e;for(n=n.toLowerCase(),t=0,e=i.length;t<e;t++)if(i[t].get(o)==="f"&&i[t].get(s).toLowerCase()===n){r=i[t];break}return r},_createFile:function(n){var t=this,r,s,h=0,e={},c=u,l=t.dataSource.view(),o=t._findFile(n);if(o&&!t._showMessage(i.format(t.options.messages.overwriteFile,n),"confirm"))return null;if(o)return o;for(r=0,s=l.length;r<s;r++)if(l[r].get(c)==="f"){h=r;break}return e[c]="f",e[f]=n,e[b]=0,t.dataSource.insert(++h,e)},createDirectory:function(){for(var n=this,s=0,h=u,e=f,c=n.dataSource.data(),l=n._nameDirectory(),r=new n.dataSource.reader.model,t=0,o=c.length;t<o;t++)c[t].get(h)==="d"&&(s=t);r.set(h,"d");r.set(e,l);n.listView.one("dataBound",function(){var t=n.listView.items().filter("["+i.attr("uid")+"="+r.uid+"]"),u=t.find("input");t.length&&this.edit(t);this.element.scrollTop(t.attr("offsetTop")-this.element[0].offsetHeight);setTimeout(function(){u.select()})}).one("save",function(t){var i=t.model.get(e);i?t.model.set(e,n._nameExists(i,r.uid)?n._nameDirectory():i):t.model.set(e,l)});n.dataSource.insert(++s,r)},_directoryKeyDown:function(n){n.keyCode==13&&n.currentTarget.blur()},_directoryBlur:function(){this.listView.save()},_nameExists:function(n,t){for(var r=this.dataSource.data(),o=u,s=f,i=0,e=r.length;i<e;i++)if(r[i].get(o)==="d"&&r[i].get(s).toLowerCase()===n.toLowerCase()&&r[i].uid!==t)return!0;return!1},_nameDirectory:function(){for(var i="New folder",r=this.dataSource.data(),e=[],c=u,s=f,o,t=0,h=r.length;t<h;t++)r[t].get(c)==="d"&&r[t].get(s).toLowerCase().indexOf(i.toLowerCase())>-1&&e.push(r[t].get(s));if(n.inArray(i,e)>-1){t=2;do o=i+" ("+t+")",t++;while(n.inArray(o,e)>-1);i=o}return i},orderBy:function(n){this.dataSource.sort([{field:u,dir:"asc"},{field:n,dir:"asc"}])},search:function(n){this.dataSource.filter({field:f,operator:"contains",value:n})},_content:function(){var t=this;t.list=n('<ul class="k-reset k-floats k-tiles" />').appendTo(t.element).on("dblclick"+e,"li",r(t._dblClick,t));t.listView=new i.ui.ListView(t.list,{dataSource:t.dataSource,template:t._itemTmpl(),editTemplate:t._editTmpl(),selectable:!0,autoBind:!1,dataBinding:function(n){t.toolbar.find(".k-delete").parent().addClass("k-state-disabled");(n.action==="remove"||n.action==="sync")&&n.preventDefault()},dataBound:function(){t.dataSource.view().length?t._tiles=this.items().filter("["+i.attr("type")+"=f]"):this.wrapper.append(rt({text:t.options.messages.emptyFolder}))},change:r(t._listViewChange,t)})},_dblClick:function(t){var r=this,u=n(t.currentTarget),e;u.hasClass("k-edit-item")&&r._directoryBlur();u.filter("["+i.attr("type")+"=d]").length?(e=r.dataSource.getByUid(u.attr(i.attr("uid"))),e&&(r.path(nt(r.path(),e.get(f))),r.breadcrumbs.value(r.path()))):u.filter("["+i.attr("type")+"=f]").length&&r.trigger(g)},_listViewChange:function(){var n=this._selectedItem();n&&(this.toolbar.find(".k-delete").parent().removeClass("k-state-disabled"),n.get(u)==="f"&&this.trigger(s))},_dataSource:function(){var n=this,u=n.options,t=u.transport,o=p({},it),s={field:f,dir:"asc"},h,e={type:t.type||"filebrowser",sort:[o,s]};v(t)&&(t.path=r(n.path,n),e.transport=t);v(u.schema)?e.schema=u.schema:t.type&&v(i.data.schemas[t.type])&&(h=i.data.schemas[t.type]);n.dataSource&&n._errorHandler?n.dataSource.unbind(l,n._errorHandler):n._errorHandler=r(n._error,n);n.dataSource=i.data.DataSource.create(e).bind(l,n._errorHandler)},_navigation:function(){var t=this,i=n('<div class="k-floatwrap"><input/><input/><\/div>').appendTo(this.element);t.breadcrumbs=i.find("input:first").kendoBreadcrumbs({value:t.options.path,change:function(){t.path(this.value())}}).data("kendoBreadcrumbs");t.searchBox=i.parent().find("input:last").kendoSearchBox({label:t.options.messages.search,change:function(){t.search(this.value())}}).data("kendoSearchBox")},_error:function(n){var t=this,i;t.trigger(l,n)||(i=n.xhr.status,n.status=="error"?i=="404"?t._showMessage(t.options.messages.directoryNotFound):i!="0"&&t._showMessage("Error! The requested URL returned "+i+" - "+n.xhr.statusText):i=="timeout"&&t._showMessage("Error! Server timeout."))},_showMessage:function(n,t){return window[t||"alert"](n)},refresh:function(){var n=this;n._navigation();n._toolbar();n._content()},_editTmpl:function(){var n='<li class="k-tile k-state-selected" '+i.attr("uid")+'="#=uid#" ';return n+=i.attr("type")+'="${'+u+'}">',n+="#if("+u+' == "d") { #',n+='<div class="k-thumb"><span class="k-icon k-folder"><\/span><\/div>',n+="#}else{#",n+='<div class="k-thumb"><span class="k-icon k-loading"><\/span><\/div>',n+="#}#",n+="#if("+u+' == "d") { #',n+='<input class="k-input" '+i.attr("bind")+'="value:'+f+'"/>',n+="#}#",n+="<\/li>",r(i.template(n),{sizeFormatter:tt})},_itemTmpl:function(){var n='<li class="k-tile" '+i.attr("uid")+'="#=uid#" ';return n+=i.attr("type")+'="${'+u+'}">',n+="#if("+u+' == "d") { #',n+='<div class="k-thumb"><span class="k-icon k-folder"><\/span><\/div>',n+="#}else{#",n+='<div class="k-thumb"><span class="k-icon k-file"><\/span><\/div>',n+="#}#",n+="<strong>${"+f+"}<\/strong>",n+="#if("+u+' == "f") { # <span class="k-filesize">${this.sizeFormatter('+b+")}<\/span> #}#",n+="<\/li>",r(i.template(n),{sizeFormatter:tt})},path:function(n){var r=this,i=r._path||"";if(n!==t){r._path=n.replace(w,"")+"/";r.dataSource.read({path:r._path});return}return i&&(i=i.replace(w,"")),i==="/"||i===""?"":i+"/"}}),ht=o.extend({init:function(n,t){var i=this;t=t||{};o.fn.init.call(i,n,t);y&&i.element.attr("placeholder",i.options.label);i._wrapper();i.element.on("keydown"+c,r(i._keydown,i)).on("change"+c,r(i._updateValue,i));i.wrapper.on(a+c,"a",r(i._click,i));if(!y)i.element.on("focus"+c,r(i._focus,i)).on("blur"+c,r(i._blur,i))},options:{name:"SearchBox",label:"Search",value:""},events:[s],destroy:function(){var n=this;n.wrapper.add(n.element).add(n.label).off(c);o.fn.destroy.call(n)},_keydown:function(n){n.keyCode===13&&this._updateValue()},_click:function(n){n.preventDefault();this._updateValue()},_updateValue:function(){var n=this,t=n.element.val();t!==n.value()&&(n.value(t),n.trigger(s))},_blur:function(){this._updateValue();this._toggleLabel()},_toggleLabel:function(){y||this.label.toggle(!this.element.val())},_focus:function(){this.label.hide()},_wrapper:function(){var t=this.element,i=t.parents(".k-search-wrap");t[0].style.width="";t.addClass("k-input");i.length||(i=t.wrap(n('<div class="k-widget k-search-wrap k-textbox"/>')).parent(),y||n('<label style="display:block">'+this.options.label+"<\/label>").insertBefore(t),n('<a href="#" class="k-icon k-i-search k-search"/>').appendTo(i));this.wrapper=i;this.label=i.find(">label")},value:function(n){var i=this;if(n!==t){i.options.value=n;i.element.val(n);i._toggleLabel();return}return i.options.value}}),ct=o.extend({init:function(n,t){var i=this;t=t||{};o.fn.init.call(i,n,t);i._wrapper();i.wrapper.on("focus"+h,"input",r(i._focus,i)).on("blur"+h,"input",r(i._blur,i)).on("keydown"+h,"input",r(i._keydown,i)).on(a+h,"a.k-i-arrow-n:first",r(i._rootClick,i)).on(a+h,"a:not(.k-i-arrow-n)",r(i._click,i));i.value(i.options.value)},options:{name:"Breadcrumbs",gap:50},events:[s],destroy:function(){var n=this;o.fn.destroy.call(n);n.wrapper.add(n.wrapper.find("input")).add(n.wrapper.find("a")).off(h)},_update:function(n){n=(n||"").charAt(0)==="/"?n:"/"+(n||"");n!==this.value()&&(this.value(n),this.trigger(s))},_click:function(t){t.preventDefault();this._update(this._path(n(t.target).prevAll("a:not(.k-i-arrow-n)").addBack()))},_rootClick:function(n){n.preventDefault();this._update("")},_focus:function(){var n=this,t=n.element;n.overlay.hide();n.element.val(n.value());setTimeout(function(){t.select()})},_blur:function(){if(!this.overlay.is(":visible")){var n=this,t=n.element,i=t.val().replace(/\/{2,}/g,"/");n.overlay.show();t.val("");n._update(i)}},_keydown:function(n){var t=this;n.keyCode===13&&(t._blur(),setTimeout(function(){t.overlay.find("a:first").focus()}))},_wrapper:function(){var i=this.element,t=i.parents(".k-breadcrumbs"),r;i[0].style.width="";i.addClass("k-input");t.length||(t=i.wrap(n('<div class="k-widget k-breadcrumbs k-textbox"/>')).parent());r=t.find(".k-breadcrumbs-wrap");r.length||(r=n('<div class="k-breadcrumbs-wrap"/>').appendTo(t));this.wrapper=t;this.overlay=r},refresh:function(){var i="",r=this.value(),f,e,u,o;for(r!==t&&r.match(/^\//)||(r="/"+(r||"")),f=r.split("/"),u=0,o=f.length;u<o;u++)e=f[u],e&&(i||(i+='<a href="#" class="k-icon k-i-arrow-n">root<\/a>'),i+='<a class="k-link" href="#">'+f[u]+"<\/a>",i+='<span class="k-icon k-i-arrow-e">&gt;<\/span>');this.overlay.empty().append(n(i));this._adjustSectionWidth()},_adjustSectionWidth:function(){var i=this,f=i.wrapper,r=f.width()-i.options.gap,u=i.overlay.find("a"),t;u.each(function(i){t=n(this);t.parent().width()>r&&(i==u.length-1?t.width(r):t.prev().addBack().hide())})},value:function(n){if(n!==t){this._value=n.replace(/\/{2,}/g,"/");this.refresh();return}return this._value},_path:function(t){return"/"+n.map(t,function(t){return n(t).text()}).join("/")}});i.ui.plugin(st);i.ui.plugin(ct);i.ui.plugin(ht)})(window.kendo.jQuery)}(),function(){(function(n,t){function d(n,i){return n!==t&&n.match(/\/$/)||(n=(n||"")+"/"),n+i}function g(n){if(!n)return"";var t=" bytes";return n>=1073741824?(t=" GB",n/=1073741824):n>=1048576?(t=" MB",n/=1048576):n>=1024&&(t=" KB",n/=1024),Math.round(n*100)/100+t}var i=window.kendo,c=i.ui.FileBrowser,e=n.isPlainObject,r=n.proxy,o=n.extend,l=i.support.browser,s=i.isFunction,w=/(^\/|\/$)/g,a="error",h=".kendoImageBrowser",u="name",v="size",f="type",b={field:f,dir:"asc"},k=i.template('<li class="k-tile-empty"><strong>${text}<\/strong><\/li>'),y,p;o(!0,i.data,{schemas:{imagebrowser:{data:function(n){return n.items||n||[]},model:{id:"name",fields:{name:"name",size:"size",type:"type"}}}}});o(!0,i.data,{transports:{imagebrowser:i.data.RemoteTransport.extend({init:function(t){i.data.RemoteTransport.fn.init.call(this,n.extend(!0,{},this.options,t))},_call:function(t,r){r.data=n.extend({},r.data,{path:this.options.path()});s(this.options[t])?this.options[t].call(this,r):i.data.RemoteTransport.fn[t].call(this,r)},read:function(n){this._call("read",n)},create:function(n){this._call("create",n)},destroy:function(n){this._call("destroy",n)},update:function(){},options:{read:{type:"POST"},update:{type:"POST"},create:{type:"POST"},destroy:{type:"POST"}}})}});y=l.msie&&l.version<8?function(n){return n.offsetTop}:function(t){return t.offsetTop-n(t).height()};p=c.extend({init:function(n,t){var i=this;t=t||{};c.fn.init.call(i,n,t);i.element.addClass("k-imagebrowser")},options:{name:"ImageBrowser",fileTypes:"*.png,*.gif,*.jpg,*.jpeg"},value:function(){var r=this,e=r._selectedItem(),n,t=r.options.transport.imageUrl;if(e&&e.get(f)==="f")return n=d(r.path(),e.get(u)).replace(w,""),t&&(n=s(t)?t(n):i.format(t,encodeURIComponent(n))),n},_fileUpload:function(n){var t=this,e=t.options,o=e.fileTypes,c=new RegExp(("("+o.split(",").join(")|(")+")").replace(/\*\./g,".*."),"i"),f=n.files[0].name,s=u,h=v,r;if(c.test(f))if(n.data={path:t.path()},r=t._createFile(f),r){r._uploading=!0;t.upload.one("success",function(n){delete r._uploading;r.set(s,n.response[t._getFieldName(s)]);r.set(h,n.response[t._getFieldName(h)]);t._tiles=t.listView.items().filter("["+i.attr("type")+"=f]");t._scroll()})}else n.preventDefault();else n.preventDefault(),t._showMessage(i.format(e.messages.invalidFileType,f,o))},_content:function(){var t=this;t.list=n('<ul class="k-reset k-floats k-tiles" />').appendTo(t.element).on("scroll"+h,r(t._scroll,t)).on("dblclick"+h,"li",r(t._dblClick,t));t.listView=new i.ui.ListView(t.list,{dataSource:t.dataSource,template:t._itemTmpl(),editTemplate:t._editTmpl(),selectable:!0,autoBind:!1,dataBinding:function(n){t.toolbar.find(".k-delete").parent().addClass("k-state-disabled");(n.action==="remove"||n.action==="sync")&&n.preventDefault()},dataBound:function(){t.dataSource.view().length?(t._tiles=this.items().filter("["+i.attr("type")+"=f]"),t._scroll()):this.wrapper.append(k({text:t.options.messages.emptyFolder}))},change:r(t._listViewChange,t)})},_dataSource:function(){var n=this,f=n.options,t=f.transport,h=o({},b),c={field:u,dir:"asc"},l,s={type:t.type||"imagebrowser",sort:[h,c]};e(t)&&(t.path=r(n.path,n),s.transport=t);e(f.schema)?s.schema=f.schema:t.type&&e(i.data.schemas[t.type])&&(l=i.data.schemas[t.type]);n.dataSource&&n._errorHandler?n.dataSource.unbind(a,n._errorHandler):n._errorHandler=r(n._error,n);n.dataSource=i.data.DataSource.create(s).bind(a,n._errorHandler)},_loadImage:function(t){var f=this,c=n(t),l=f.dataSource.getByUid(c.attr(i.attr("uid"))),e=l.get(u),r=f.options.transport.thumbnailUrl,o=n("<img />",{alt:e}),a="?";if(!l._uploading){o.hide().on("load"+h,function(){n(this).prev().remove().end().addClass("k-image").fadeIn()});c.find(".k-loading").after(o);s(r)?r=r(f.path(),encodeURIComponent(e)):(r.indexOf("?")>=0&&(a="&"),r=r+a+"path="+f.path()+encodeURIComponent(e));o.attr("src",r);t.loaded=!0}},_scroll:function(){var n=this;n.options.transport&&n.options.transport.thumbnailUrl&&(clearTimeout(n._timeout),n._timeout=setTimeout(function(){var r=n.list.outerHeight(),t=n.list.scrollTop(),i=t+r;n._tiles.each(function(){var r=y(this),u=r+this.offsetHeight;return(r>=t&&r<i||u>=t&&u<i)&&n._loadImage(this),r>i?!1:void 0});n._tiles=n._tiles.filter(function(){return!this.loaded})},250))},_itemTmpl:function(){var t=this,n='<li class="k-tile" '+i.attr("uid")+'="#=uid#" ';return n+=i.attr("type")+'="${'+f+'}">',n+="#if("+f+' == "d") { #',n+='<div class="k-thumb"><span class="k-icon k-folder"><\/span><\/div>',n+="#}else{#",n+=t.options.transport&&t.options.transport.thumbnailUrl?'<div class="k-thumb"><span class="k-icon k-loading"><\/span><\/div>':'<div class="k-thumb"><span class="k-icon k-file"><\/span><\/div>',n+="#}#",n+="<strong>${"+u+"}<\/strong>",n+="#if("+f+' == "f") { # <span class="k-filesize">${this.sizeFormatter('+v+")}<\/span> #}#",n+="<\/li>",r(i.template(n),{sizeFormatter:g})}});i.ui.plugin(p)})(window.kendo.jQuery)}(),function(){(function(n){var t=n.Observable.extend({init:function(t){n.Observable.fn.init.call(this,t);this.clear()},events:["undo","redo"],push:function(n){this.stack=this.stack.slice(0,this.currentCommandIndex+1);this.currentCommandIndex=this.stack.push(n)-1},undo:function(){if(this.canUndo()){var n=this.stack[this.currentCommandIndex--];n.undo();this.trigger("undo",{command:n})}},redo:function(){if(this.canRedo()){var n=this.stack[++this.currentCommandIndex];n.redo();this.trigger("redo",{command:n})}},clear:function(){this.stack=[];this.currentCommandIndex=-1},canUndo:function(){return this.currentCommandIndex>=0},canRedo:function(){return this.currentCommandIndex!=this.stack.length-1}});n.deepExtend(n,{util:{UndoRedoStack:t}})})(kendo)}(),function(){(function(n,t){var i=window.kendo,p=i.Class,y=i.ui.Widget,l=i.support.mobileOS,e=i.support.browser,c=n.extend,f=n.proxy,d=i.deepExtend,r=".kendoEditor",o=i.keys,w=p.extend({init:function(n){this.options=n},getHtml:function(){var n=this.options;return i.template(n.template,{useWithBlock:!1})(n)}}),a={editorWrapperTemplate:'<table cellspacing="4" cellpadding="0" class="k-widget k-editor k-header" role="presentation"><tbody><tr role="presentation"><td class="k-editor-toolbar-wrap" role="presentation"><ul class="k-editor-toolbar" role="toolbar" /><\/td><\/tr><tr><td class="k-editable-area" /><\/tr><\/tbody><\/table>',buttonTemplate:'<a href="" role="button" class="k-tool"#= data.popup ? " data-popup" : "" # unselectable="on" title="#= data.title #"><span unselectable="on" class="k-tool-icon #= data.cssClass #"><\/span><span class="k-tool-text">#= data.title #<\/span><\/a>',colorPickerTemplate:'<div class="k-colorpicker #= data.cssClass #" />',comboBoxTemplate:'<select title="#= data.title #" class="#= data.cssClass #" />',dropDownListTemplate:'<span class="k-editor-dropdown"><select title="#= data.title #" class="#= data.cssClass #" /><\/span>',separatorTemplate:'<span class="k-separator" />',overflowAnchorTemplate:'<a href="" role="button" class="k-tool k-overflow-anchor" data-popup unselectable="on"><span unselectable="on" class="k-icon k-i-more"><\/span><\/a>',formatByName:function(t,i){for(var r=0;r<i.length;r++)if(n.inArray(t,i[r].tags)>=0)return i[r]},registerTool:function(n,t){var i=t.options;i&&i.template&&(i.template.options.cssClass="k-"+n);t.name||(t.options.name=n,t.name=n.toLowerCase());u.defaultTools[n]=t},registerFormat:function(n,t){u.fn.options.formats[n]=t}},g=!l||l.ios&&l.flatVersion>=500||!l.ios&&typeof document.documentElement.contentEditable!="undefined",s={basic:["bold","italic","underline"],alignment:["justifyLeft","justifyCenter","justifyRight"],lists:["insertUnorderedList","insertOrderedList"],indenting:["indent","outdent"],links:["createLink","unlink"],tables:["createTable","addColumnLeft","addColumnRight","addRowAbove","addRowBelow","deleteRow","deleteColumn"]},u=y.extend({init:function(t,u){var e=this,s,h=i.ui.editor,l,a,v,o,p=h.Dom;if(g){y.fn.init.call(e,t,u);e.options=d({},e.options,u);e.options.tools=e.options.tools.slice();t=e.element;o=t[0];v=p.name(o);t.closest("form").on("submit"+r,function(){e.update()});a=c({},e.options);a.editor=e;v=="textarea"?(e._wrapTextarea(),l=e.wrapper.find(".k-editor-toolbar"),o.id&&l.attr("aria-controls",o.id)):(e.element.attr("contenteditable",!0).addClass("k-widget k-editor k-editor-inline"),a.popup=!0,l=n('<ul class="k-editor-toolbar" role="toolbar" />').insertBefore(t));e.toolbar=new h.Toolbar(l[0],a);e.toolbar.bindTo(e);v=="textarea"&&setTimeout(function(){var t=e.wrapper[0].style.height,n=parseInt(t,10),i=e.wrapper.height();t.indexOf("px")>0&&!isNaN(n)&&i>n&&e.wrapper.height(n-(i-n))});e._resizable();e._initializeContentElement(e);e.keyboard=new h.Keyboard([new h.BackspaceHandler(e),new h.TypingHandler(e),new h.SystemHandler(e)]);e.clipboard=new h.Clipboard(this);e.undoRedoStack=new i.util.UndoRedoStack;u&&u.value?s=u.value:e.textarea?(s=o.value,e.options.encoded&&n.trim(o.defaultValue).length&&(s=o.defaultValue),s=s.replace(/[\r\n\v\f\t ]+/ig," ")):s=o.innerHTML;e.value(s);n(document).on("mousedown",f(e._endTyping,e)).on("mouseup",f(e._mouseup,e));e.toolbar.resize();i.notify(e)}},_endTyping:function(){var n=this.keyboard;try{n.isTypingInProgress()&&(n.endTyping(!0),this.saveSelection())}catch(t){}},_selectionChange:function(){e.msie||i.ui.editor.Dom.ensureTrailingBreaks(this.body);this._selectionStarted=!1;this.saveSelection();this.trigger("select",{})},_resizable:function(){var i=this.options.resizable,r=n.isPlainObject(i)?i.content===t||i.content===!0:i;r&&this.textarea&&(n("<div class='k-resize-handle'><span class='k-icon k-resize-se' /><\/div>").insertAfter(this.textarea),this.wrapper.kendoResizable(c({},this.options.resizable,{start:function(t){var i=this.editor=n(t.currentTarget).closest(".k-editor");this.initialSize=i.height();i.find("td:last").append("<div class='k-overlay' />")},resize:function(n){var i=n.y.initialDelta,t=this.initialSize+i,r=this.options.min||0,u=this.options.max||Infinity;t=Math.min(u,Math.max(r,t));this.editor.height(t)},resizeend:function(){this.editor.find(".k-overlay").remove();this.editor=null}})))},_wrapTextarea:function(){var i=this,t=i.element,u=t[0].style.width,f=t[0].style.height,e=a.editorWrapperTemplate,r=n(e).insertBefore(t).width(u).height(f),o=r.find(".k-editable-area");t.attr("autocomplete","off").appendTo(o).addClass("k-content k-raw-content").css("display","none");i.textarea=t;i.wrapper=r},_createContentElement:function(t){var f=this,r,e,u,o=f.textarea,h=f.options.domain,c=h||document.domain,s="",l='javascript:""';(h||c!=location.hostname)&&(s='<script>document.domain="'+c+'"<\/script>',l="javascript:document.write('"+s+"')");o.hide();r=n("<iframe />",{title:f.options.messages.editAreaTitle,frameBorder:"0"})[0];n(r).css("display","").addClass("k-content").insertBefore(o);r.src=l;e=r.contentWindow||r;u=e.document||r.contentDocument;n(r).one("load",function(){f.toolbar.decorateFrom(u.body)});return u.open(),u.write("<!DOCTYPE html><html><head><meta charset='utf-8' /><style>html,body{padding:0;margin:0;height:100%;min-height:100%;}body{font-size:12px;font-family:Verdana,Geneva,sans-serif;margin-top:-1px;padding:1px .2em 0;word-wrap: break-word;-webkit-nbsp-mode: space;-webkit-line-break: after-white-space;"+(i.support.isRtl(o)?"direction:rtl;":"")+"}h1{font-size:2em;margin:.67em 0}h2{font-size:1.5em}h3{font-size:1.16em}h4{font-size:1em}h5{font-size:.83em}h6{font-size:.7em}p{margin:0 0 1em;}.k-marker{display:none;}.k-paste-container,.Apple-style-span{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}ul,ol{padding-left:2.5em}span{-ms-high-contrast-adjust:none;}a{color:#00a}code{font-size:1.23em}telerik\\3Ascript{display: none;}.k-table{table-layout:fixed;width:100%;border-spacing:0;margin: 0 0 1em;}.k-table td{min-width:1px;padding:.2em .3em;}.k-table,.k-table td{outline:0;border: 1px dotted #ccc;}.k-table p{margin:0;padding:0;}k\\:script{display:none;}<\/style>"+s+"<script>(function(d,c){d[c]('header'),d[c]('article'),d[c]('nav'),d[c]('section'),d[c]('footer');})(document, 'createElement');<\/script>"+n.map(t,function(n){return"<link rel='stylesheet' href='"+n+"'>"}).join("")+"<\/head><body autocorrect='off' contenteditable='true'><\/body><\/html>"),u.close(),e},_blur:function(){var n=this.textarea,t=n?n.val():this._oldValue,i=this.options.encoded?this.encodedValue():this.value();this.update();n&&n.trigger("blur");i!=t&&this.trigger("change")},_spellCorrect:function(t){var u,f=!1;n(t.body).on("contextmenu"+r,function(){t.one("select",function(){u=null});t._spellCorrectTimeout=setTimeout(function(){u=new i.ui.editor.RestorePoint(t.getRange());f=!1},10)}).on("input"+r,function(){if(u){if(i.support.browser.mozilla&&!f){f=!0;return}i.ui.editor._finishUpdate(t,u)}})},_initializeContentElement:function(){var t=this,u,s;if(t.textarea){t.window=t._createContentElement(t.options.stylesheets);u=t.document=t.window.contentDocument||t.window.document;t.body=u.body;s=t.window;n(u).on("mouseup"+r,f(t._mouseup,t))}else t.window=window,u=t.document=document,t.body=t.element[0],s=t.body,t.toolbar.decorateFrom(t.body);n(s).on("blur"+r,f(this._blur,this));try{u.execCommand("enableInlineTableEditing",null,!1)}catch(h){}if(i.support.touch)n(u).on("selectionchange"+r,f(this._selectionChange,this)).on("keydown"+r,function(){i._activeElement()!=u.body&&t.window.focus()});this._spellCorrect(t);n(t.body).on("dragstart"+r,!1).on("keydown"+r,function(n){var i,e;if((n.keyCode===o.BACKSPACE||n.keyCode===o.DELETE)&&t.body.getAttribute("contenteditable")!=="true")return!1;if(n.keyCode===o.F10){setTimeout(f(t.toolbar.focus,t.toolbar),100);n.preventDefault();return}if(n.keyCode==o.LEFT||n.keyCode==o.RIGHT){i=t.getRange();var r=n.keyCode==o.LEFT,s=i[r?"startContainer":"endContainer"],u=i[r?"startOffset":"endOffset"],h=r?-1:1;r&&(u-=1);u+h>0&&s.nodeType==3&&s.nodeValue[u]=="﻿"&&(i.setStart(s,u+h),i.collapse(!0),t.selectRange(i))}if(e=t.keyboard.toolFromShortcut(t.toolbar.tools,n),e)return n.preventDefault(),/^(undo|redo)$/.test(e)||t.keyboard.endTyping(!0),t.trigger("keydown",n),t.exec(e),!1;t.keyboard.clearTimeout();t.keyboard.keydown(n)}).on("keyup"+r,function(i){(n.inArray(i.keyCode,[8,9,33,34,35,36,37,38,39,40,40,45,46])>-1||i.keyCode==65&&i.ctrlKey&&!i.altKey&&!i.shiftKey)&&t._selectionChange();t.keyboard.keyup(i)}).on("mousedown"+r,function(i){if(t._selectionStarted=!0,!e.gecko){var r=n(i.target);(i.which==2||i.which==1&&i.ctrlKey)&&r.is("a[href]")&&window.open(r.attr("href"),"_new")}}).on("click"+r,function(n){var u=i.ui.editor.Dom,r;u.name(n.target)==="img"&&(r=t.createRange(),r.selectNode(n.target),t.selectRange(r))}).on("cut"+r+" paste"+r,function(n){t.clipboard["on"+n.type](n)}).on("focusin"+r,function(){n(this).addClass("k-state-active");t.toolbar.show()}).on("focusout"+r,function(){setTimeout(function(){var r=i._activeElement(),u=t.body,f=t.toolbar;r==u||n.contains(u,r)||n(r).is(".k-editortoolbar-dragHandle")||f.focused()||(n(u).removeClass("k-state-active"),f.hide())},10)})},_mouseup:function(){var n=this;n._selectionStarted&&setTimeout(function(){n._selectionChange()},1)},refresh:function(){var n=this;n.textarea&&(n.textarea.val(n.value()),n.wrapper.find("iframe").remove(),n._initializeContentElement(n),n.value(n.textarea.val()))},events:["select","change","execute","error","paste","keydown","keyup"],options:{name:"Editor",messages:{bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",superscript:"Superscript",subscript:"Subscript",justifyCenter:"Center text",justifyLeft:"Align text left",justifyRight:"Align text right",justifyFull:"Justify",insertUnorderedList:"Insert unordered list",insertOrderedList:"Insert ordered list",indent:"Indent",outdent:"Outdent",createLink:"Insert hyperlink",unlink:"Remove hyperlink",insertImage:"Insert image",insertFile:"Insert file",insertHtml:"Insert HTML",viewHtml:"View HTML",fontName:"Select font family",fontNameInherit:"(inherited font)",fontSize:"Select font size",fontSizeInherit:"(inherited size)",formatBlock:"Format",formatting:"Format",foreColor:"Color",backColor:"Background color",style:"Styles",emptyFolder:"Empty Folder",editAreaTitle:"Editable area. Press F10 for toolbar.",uploadFile:"Upload",orderBy:"Arrange by:",orderBySize:"Size",orderByName:"Name",invalidFileType:'The selected file "{0}" is not valid. Supported file types are {1}.',deleteFile:'Are you sure you want to delete "{0}"?',overwriteFile:'A file with name "{0}" already exists in the current directory. Do you want to overwrite it?',directoryNotFound:"A directory with this name was not found.",imageWebAddress:"Web address",imageAltText:"Alternate text",imageWidth:"Width (px)",imageHeight:"Height (px)",fileWebAddress:"Web address",fileTitle:"Title",linkWebAddress:"Web address",linkText:"Text",linkToolTip:"ToolTip",linkOpenInNewWindow:"Open link in new window",dialogUpdate:"Update",dialogInsert:"Insert",dialogCancel:"Cancel",createTable:"Create table",createTableHint:"Create a {0} x {1} table",addColumnLeft:"Add column on the left",addColumnRight:"Add column on the right",addRowAbove:"Add row above",addRowBelow:"Add row below",deleteRow:"Delete row",deleteColumn:"Delete column"},formats:{},encoded:!0,domain:null,resizable:!1,serialization:{entities:!0,semantic:!0,scripts:!1},stylesheets:[],dialogOptions:{modal:!0,resizable:!1,draggable:!0,animation:!1},imageBrowser:null,fileBrowser:null,fontName:[{text:"Arial",value:"Arial,Helvetica,sans-serif"},{text:"Courier New",value:"'Courier New',Courier,monospace"},{text:"Georgia",value:"Georgia,serif"},{text:"Impact",value:"Impact,Charcoal,sans-serif"},{text:"Lucida Console",value:"'Lucida Console',Monaco,monospace"},{text:"Tahoma",value:"Tahoma,Geneva,sans-serif"},{text:"Times New Roman",value:"'Times New Roman',Times,serif"},{text:"Trebuchet MS",value:"'Trebuchet MS',Helvetica,sans-serif"},{text:"Verdana",value:"Verdana,Geneva,sans-serif"}],fontSize:[{text:"1 (8pt)",value:"xx-small"},{text:"2 (10pt)",value:"x-small"},{text:"3 (12pt)",value:"small"},{text:"4 (14pt)",value:"medium"},{text:"5 (18pt)",value:"large"},{text:"6 (24pt)",value:"x-large"},{text:"7 (36pt)",value:"xx-large"}],formatBlock:[{text:"Paragraph",value:"p"},{text:"Quotation",value:"blockquote"},{text:"Heading 1",value:"h1"},{text:"Heading 2",value:"h2"},{text:"Heading 3",value:"h3"},{text:"Heading 4",value:"h4"},{text:"Heading 5",value:"h5"},{text:"Heading 6",value:"h6"}],tools:[].concat.call(["formatting"],s.basic,s.alignment,s.lists,s.indenting,s.links,["insertImage"],s.tables)},destroy:function(){var t=this;y.fn.destroy.call(t);n(t.window).add(t.document).add(t.body).add(t.wrapper).add(t.element.closest("form")).off(r);n(document).off("mousedown",f(t._endTyping,t)).off("mouseup",f(t._mouseup,t));clearTimeout(this._spellCorrectTimeout);t._focusOutside();t.toolbar.destroy();i.destroy(t.wrapper)},_focusOutside:function(){if(i.support.browser.msie&&this.textarea){var t=n("<input style='position:absolute;left:-10px;top:-10px;width:1px;height:1px;font-size:0;border:0;' />").appendTo(document.body).focus();t.blur().remove()}},state:function(n){var e=u.defaultTools[n],r=e&&(e.options.finder||e.finder),o=i.ui.editor.RangeUtils,f,t;return r?(f=this.getRange(),t=o.textNodes(f),!t.length&&f.collapsed&&(t=[f.startContainer]),r.getFormat?r.getFormat(t):r.isFormatted(t)):!1},value:function(n){var r=this.body,u=i.ui.editor,f=u.Serializer.domToXhtml(r,this.options.serialization);if(n===t)return f;n!=f&&(u.Serializer.htmlToDom(n,r),e.msie||i.ui.editor.Dom.ensureTrailingBreaks(this.body),this.selectionRestorePoint=null,this.update(),this.toolbar.refreshTools())},saveSelection:function(t){t=t||this.getRange();var r=t.commonAncestorContainer,u=this.body;(r==u||n.contains(u,r))&&(this.selectionRestorePoint=new i.ui.editor.RestorePoint(t))},_focusBody:function(){var n=this.body,f=this.wrapper&&this.wrapper.find("iframe")[0],t=this.document.documentElement,r=i._activeElement(),u;r!=n&&r!=f&&(u=t.scrollTop,n.focus(),t.scrollTop=u)},restoreSelection:function(){this._focusBody();this.selectionRestorePoint&&this.selectRange(this.selectionRestorePoint.toRange())},focus:function(){this.restoreSelection()},update:function(n){n=n||this.options.encoded?this.encodedValue():this.value();this.textarea?this.textarea.val(n):this._oldValue=n},encodedValue:function(){return i.ui.editor.Dom.encode(this.value())},createRange:function(n){return i.ui.editor.RangeUtils.createRange(n||this.document)},getSelection:function(){return i.ui.editor.SelectionUtils.selectionFromDocument(this.document)},selectRange:function(n){this._focusBody();var t=this.getSelection();t.removeAllRanges();t.addRange(n);this.saveSelection(n)},getRange:function(){var t=this.getSelection(),n=t&&t.rangeCount>0?t.getRangeAt(0):this.createRange(),i=this.document;return n.startContainer!=i||n.endContainer!=i||n.startOffset||n.endOffset||(n.setStart(this.body,0),n.collapse(!0)),n},selectedHtml:function(){return i.ui.editor.Serializer.domToXhtml(this.getRange().cloneContents())},paste:function(t,r){var u=new i.ui.editor.InsertHtmlCommand(n.extend({range:this.getRange(),html:t},r));u.editor=this;u.exec()},exec:function(n,t){var i=this,r=null,s,e,h,o;if(!n)throw new Error("kendoEditor.exec(): `name` parameter cannot be empty");if(i.body.getAttribute("contenteditable")!=="true")return!1;if(n=n.toLowerCase(),i.keyboard.isTypingInProgress()||i.restoreSelection(),e=i.toolbar.toolById(n),!e)for(o in u.defaultTools)if(o.toLowerCase()==n){e=u.defaultTools[o];break}if(e){if(s=i.getRange(),e.command&&(r=e.command(c({range:s},t))),h=i.trigger("execute",{name:n,command:r}),h)return;if(/^(undo|redo)$/i.test(n))i.undoRedoStack[n]();else if(r&&(r.managesUndoRedo||i.undoRedoStack.push(r),r.editor=i,r.exec(),r.async)){r.change=f(i._selectionChange,i);return}i._selectionChange()}}}),h,b,k,v;u.defaultTools={undo:{options:{key:"Z",ctrl:!0}},redo:{options:{key:"Y",ctrl:!0}}};i.ui.plugin(u);h=p.extend({init:function(n){this.options=n},initialize:function(n,t){n.attr({unselectable:"on",title:t.title});n.children(".k-tool-text").html(t.title)},command:function(n){return new this.options.command(n)},update:n.noop});h.exec=function(n,t,i){n.exec(t,{value:i})};b=h.extend({init:function(n){h.fn.init.call(this,n)},command:function(n){var t=this;return new i.ui.editor.FormatCommand(c(n,{formatter:t.options.formatter}))},update:function(n,t){var i=this.options.finder.isFormatted(t);n.toggleClass("k-state-selected",i);n.attr("aria-pressed",i)}});a.registerTool("separator",new h({template:new w({template:a.separatorTemplate})}));k=e.msie&&e.version<9?"﻿":"";v='<br class="k-br" />';e.msie&&(e.version<10?v="﻿":e.version<11&&(v=" "));c(i.ui,{editor:{ToolTemplate:w,EditorUtils:a,Tool:h,FormatTool:b,_bomFill:k,emptyElementContent:v}});i.PDFMixin&&(i.PDFMixin.extend(u.prototype),u.prototype._drawPDF=function(){return i.drawing.drawDOM(this.body,this.options.pdf)},u.prototype.saveAsPDF=function(){var r=new n.Deferred,u=r.promise(),e={promise:u},t,f;if(!this.trigger("pdfExport",e))return t=this.options.pdf,f=t.paperSize,this._drawPDF(r).then(function(n){return t.paperSize="auto",i.drawing.exportPDF(n,t)}).done(function(n){i.saveAs({dataURI:n,fileName:t.fileName,proxyURL:t.proxyURL,forceProxy:t.forceProxy});t.paperSize=f;r.resolve()}).fail(function(n){r.reject(n)}),u})})(window.jQuery)}(),function(){(function(n){function r(n){for(var i={},t=0,r=n.length;t<r;t++)i[n[t]]=!0;return i}var i=window.kendo,u=n.map,h=n.extend,f=i.support.browser,e="style",c="float",l="cssFloat",a="styleFloat",v="class",y="k-marker",o=r("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed".split(",")),p="div,p,h1,h2,h3,h4,h5,h6,address,applet,blockquote,button,center,dd,dir,dl,dt,fieldset,form,frameset,hr,iframe,isindex,map,menu,noframes,noscript,object,pre,script,table,tbody,td,tfoot,th,thead,tr,header,article,nav,footer,section,aside,main,figure,figcaption".split(","),s=p.concat(["ul","ol","li"]),w=r(s),b="span,em,a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,strike,strong,sub,sup,textarea,tt,u,var,data,time,mark,ruby".split(","),k=r(b),nt=r("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected".split(",")),d=function(n){n.nodeType==1&&n.normalize()};f.msie&&f.version>=8&&(d=function(n){if(n.nodeType==1&&n.firstChild)for(var r=n.firstChild,i=r;;){if(i=i.nextSibling,!i)break;i.nodeType==3&&r.nodeType==3&&(i.nodeValue=r.nodeValue+i.nodeValue,t.remove(r));r=i}});var tt=/^\s+$/,it=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,rt=/\ufeff/g,ut=/^(\s+|\ufeff)$/,g,ft="color,padding-left,padding-right,padding-top,padding-bottom,background-color,background-attachment,background-image,background-position,background-repeat,border-top-style,border-top-width,border-top-color,border-bottom-style,border-bottom-width,border-bottom-color,border-left-style,border-left-width,border-left-color,border-right-style,border-right-width,border-right-color,font-family,font-size,font-style,font-variant,font-weight,line-height".split(","),et=/[<>\&]/g,ot=/[\u00A0-\u2666<>\&]/g,st={34:"quot",38:"amp",39:"apos",60:"lt",62:"gt",160:"nbsp",161:"iexcl",162:"cent",163:"pound",164:"curren",165:"yen",166:"brvbar",167:"sect",168:"uml",169:"copy",170:"ordf",171:"laquo",172:"not",173:"shy",174:"reg",175:"macr",176:"deg",177:"plusmn",178:"sup2",179:"sup3",180:"acute",181:"micro",182:"para",183:"middot",184:"cedil",185:"sup1",186:"ordm",187:"raquo",188:"frac14",189:"frac12",190:"frac34",191:"iquest",192:"Agrave",193:"Aacute",194:"Acirc",195:"Atilde",196:"Auml",197:"Aring",198:"AElig",199:"Ccedil",200:"Egrave",201:"Eacute",202:"Ecirc",203:"Euml",204:"Igrave",205:"Iacute",206:"Icirc",207:"Iuml",208:"ETH",209:"Ntilde",210:"Ograve",211:"Oacute",212:"Ocirc",213:"Otilde",214:"Ouml",215:"times",216:"Oslash",217:"Ugrave",218:"Uacute",219:"Ucirc",220:"Uuml",221:"Yacute",222:"THORN",223:"szlig",224:"agrave",225:"aacute",226:"acirc",227:"atilde",228:"auml",229:"aring",230:"aelig",231:"ccedil",232:"egrave",233:"eacute",234:"ecirc",235:"euml",236:"igrave",237:"iacute",238:"icirc",239:"iuml",240:"eth",241:"ntilde",242:"ograve",243:"oacute",244:"ocirc",245:"otilde",246:"ouml",247:"divide",248:"oslash",249:"ugrave",250:"uacute",251:"ucirc",252:"uuml",253:"yacute",254:"thorn",255:"yuml",402:"fnof",913:"Alpha",914:"Beta",915:"Gamma",916:"Delta",917:"Epsilon",918:"Zeta",919:"Eta",920:"Theta",921:"Iota",922:"Kappa",923:"Lambda",924:"Mu",925:"Nu",926:"Xi",927:"Omicron",928:"Pi",929:"Rho",931:"Sigma",932:"Tau",933:"Upsilon",934:"Phi",935:"Chi",936:"Psi",937:"Omega",945:"alpha",946:"beta",947:"gamma",948:"delta",949:"epsilon",950:"zeta",951:"eta",952:"theta",953:"iota",954:"kappa",955:"lambda",956:"mu",957:"nu",958:"xi",959:"omicron",960:"pi",961:"rho",962:"sigmaf",963:"sigma",964:"tau",965:"upsilon",966:"phi",967:"chi",968:"psi",969:"omega",977:"thetasym",978:"upsih",982:"piv",8226:"bull",8230:"hellip",8242:"prime",8243:"Prime",8254:"oline",8260:"frasl",8472:"weierp",8465:"image",8476:"real",8482:"trade",8501:"alefsym",8592:"larr",8593:"uarr",8594:"rarr",8595:"darr",8596:"harr",8629:"crarr",8656:"lArr",8657:"uArr",8658:"rArr",8659:"dArr",8660:"hArr",8704:"forall",8706:"part",8707:"exist",8709:"empty",8711:"nabla",8712:"isin",8713:"notin",8715:"ni",8719:"prod",8721:"sum",8722:"minus",8727:"lowast",8730:"radic",8733:"prop",8734:"infin",8736:"ang",8743:"and",8744:"or",8745:"cap",8746:"cup",8747:"int",8756:"there4",8764:"sim",8773:"cong",8776:"asymp",8800:"ne",8801:"equiv",8804:"le",8805:"ge",8834:"sub",8835:"sup",8836:"nsub",8838:"sube",8839:"supe",8853:"oplus",8855:"otimes",8869:"perp",8901:"sdot",8968:"lceil",8969:"rceil",8970:"lfloor",8971:"rfloor",9001:"lang",9002:"rang",9674:"loz",9824:"spades",9827:"clubs",9829:"hearts",9830:"diams",338:"OElig",339:"oelig",352:"Scaron",353:"scaron",376:"Yuml",710:"circ",732:"tilde",8194:"ensp",8195:"emsp",8201:"thinsp",8204:"zwnj",8205:"zwj",8206:"lrm",8207:"rlm",8211:"ndash",8212:"mdash",8216:"lsquo",8217:"rsquo",8218:"sbquo",8220:"ldquo",8221:"rdquo",8222:"bdquo",8224:"dagger",8225:"Dagger",8240:"permil",8249:"lsaquo",8250:"rsaquo",8364:"euro"},t={block:w,inline:k,findNodeIndex:function(n,t){var i=0;if(!n)return-1;for(;;){if(n=n.previousSibling,!n)break;t&&n.nodeType==3||i++}return i},isDataNode:function(n){return n&&n.nodeValue!==null&&n.data!==null},isAncestorOf:function(i,r){try{return!t.isDataNode(i)&&(n.contains(i,t.isDataNode(r)?r.parentNode:r)||r.parentNode==i)}catch(u){return!1}},isAncestorOrSelf:function(n,i){return t.isAncestorOf(n,i)||n==i},findClosestAncestor:function(n,i){if(t.isAncestorOf(n,i))while(i&&i.parentNode!=n)i=i.parentNode;return i},getNodeLength:function(n){return t.isDataNode(n)?n.length:n.childNodes.length},splitDataNode:function(n,i){for(var u=n.cloneNode(!1),f="",r=n.nextSibling,e;r&&r.nodeType==3&&r.nodeValue;)f+=r.nodeValue,e=r,r=r.nextSibling,t.remove(e);n.deleteData(i,n.length);u.deleteData(0,i);u.nodeValue+=f;t.insertAfter(u,n)},attrEquals:function(n,r){var u,f;for(u in r)if(f=n[u],u==c&&(f=n[i.support.cssFloat?l:a]),typeof f=="object"){if(!t.attrEquals(f,r[u]))return!1}else if(f!=r[u])return!1;return!0},blockParentOrBody:function(n){return t.parentOfType(n,s)||n.ownerDocument.body},blockParents:function(i){for(var f=[],u,r=0,e=i.length;r<e;r++)u=t.parentOfType(i[r],t.blockElements),u&&n.inArray(u,f)<0&&f.push(u);return f},windowFromDocument:function(n){return n.defaultView||n.parentWindow},normalize:d,blockElements:s,nonListBlockElements:p,inlineElements:b,empty:o,fillAttrs:nt,toHex:function(n){var t=it.exec(n);return t?"#"+u(t.slice(1),function(n){return n=parseInt(n,10).toString(16),n.length>1?n:"0"+n}).join(""):n},encode:function(n,t){var i=!t||t.entities?ot:et;return n.replace(i,function(n){var i=n.charCodeAt(0),t=st[i];return t?"&"+t+";":n})},stripBom:function(n){return(n||"").replace(rt,"")},insignificant:function(n){var i=n.attributes;return n.className=="k-marker"||t.is(n,"br")&&(n.className=="k-br"||i._moz_dirty||i._moz_editor_bogus_node)},significantNodes:function(i){return n.grep(i,function(n){var i=t.name(n);return i=="br"?!1:t.insignificant(n)||n.nodeType==3&&ut.test(n.nodeValue)||n.nodeType==1&&!o[i]&&t.emptyNode(n)?!1:!0})},emptyNode:function(n){return n.nodeType==1&&!t.significantNodes(n.childNodes).length},name:function(n){return n.nodeName.toLowerCase()},significantChildNodes:function(i){return n.grep(i.childNodes,function(n){return n.nodeType!=3||!t.isWhitespace(n)})},lastTextNode:function(n){var r=null,i;if(n.nodeType==3)return n;for(i=n.lastChild;i;i=i.previousSibling)if(r=t.lastTextNode(i),r)return r;return r},is:function(n,i){return t.name(n)==i},isMarker:function(n){return n.className==y},isWhitespace:function(n){return tt.test(n.nodeValue)},isBlock:function(n){return w[t.name(n)]},isEmpty:function(n){return o[t.name(n)]},isInline:function(n){return k[t.name(n)]},scrollContainer:function(n){var r=t.windowFromDocument(n),u=(r.contentWindow||r).document||r.ownerDocument||r;return i.support.browser.webkit||u.compatMode=="BackCompat"?u.body:u.documentElement},scrollTo:function(i){var u=n(t.isDataNode(i)?i.parentNode:i),s=t.windowFromDocument(i.ownerDocument),e=s.innerHeight,f,r,o=t.scrollContainer(i.ownerDocument);f=u.offset().top;r=u[0].offsetHeight;r||(r=parseInt(u.css("line-height"),10)||Math.ceil(1.2*parseInt(u.css("font-size"),10))||15);r+f>o.scrollTop+e&&(o.scrollTop=r+f-e)},persistScrollTop:function(n){g=t.scrollContainer(n).scrollTop},restoreScrollTop:function(n){t.scrollContainer(n).scrollTop=g},insertAt:function(n,t,i){n.insertBefore(t,n.childNodes[i]||null)},insertBefore:function(n,t){return t.parentNode?t.parentNode.insertBefore(n,t):t},insertAfter:function(n,t){return t.parentNode.insertBefore(n,t.nextSibling)},remove:function(n){n.parentNode.removeChild(n)},removeTextSiblings:function(n){for(var t=n.parentNode;n.nextSibling&&n.nextSibling.nodeType==3;)t.removeChild(n.nextSibling);while(n.previousSibling&&n.previousSibling.nodeType==3)t.removeChild(n.previousSibling)},trim:function(n){for(var i,r=n.childNodes.length-1;r>=0;r--)i=n.childNodes[r],t.isDataNode(i)?(t.stripBom(i.nodeValue).length||t.remove(i),t.isWhitespace(i)&&t.insertBefore(i,n)):i.className!=y&&(t.trim(i),i.childNodes.length||t.isEmpty(i)||t.remove(i));return n},closest:function(n,i){while(n&&t.name(n)!=i)n=n.parentNode;return n},sibling:function(n,t){do n=n[t];while(n&&n.nodeType!=1);return n},next:function(n){return t.sibling(n,"nextSibling")},prev:function(n){return t.sibling(n,"previousSibling")},parentOfType:function(n,i){do n=n.parentNode;while(n&&!t.ofType(n,i));return n},ofType:function(i,r){return n.inArray(t.name(i),r)>=0},changeTag:function(n,i,r){var u=t.create(n.ownerDocument,i),c=n.attributes,f,l,o,h,s;if(!r)for(f=0,l=c.length;f<l;f++)s=c[f],s.specified&&(o=s.nodeName,h=s.nodeValue,o==v?u.className=h:o==e?u.style.cssText=n.style.cssText:u.setAttribute(o,h));while(n.firstChild)u.appendChild(n.firstChild);return t.insertBefore(u,n),t.remove(n),u},editableParent:function(n){while(n&&(n.nodeType==3||n.contentEditable!=="true"))n=n.parentNode;return n},wrap:function(n,i){return t.insertBefore(i,n),i.appendChild(n),i},unwrap:function(n){for(var t=n.parentNode;n.firstChild;)t.insertBefore(n.firstChild,n);t.removeChild(n)},create:function(n,i,r){return t.attr(n.createElement(i),r)},attr:function(n,i){i=h({},i);i&&e in i&&(t.style(n,i.style),delete i.style);for(var r in i)i[r]===null?(n.removeAttribute(r),delete i[r]):r=="className"&&(n[r]=i[r]);return h(n,i)},style:function(t,i){n(t).css(i||{})},unstyle:function(n,t){for(var r in t)r==c&&(r=i.support.cssFloat?l:a),n.style[r]="";n.style.cssText===""&&n.removeAttribute(e)},inlineStyle:function(i,r,e){var o=n(t.create(i.ownerDocument,r,e)),s;return i.appendChild(o[0]),s=u(ft,function(n){return f.msie&&n=="line-height"&&o.css(n)=="1px"?"line-height:1.5":n+":"+o.css(n)}).join(";"),o.remove(),s},getEffectiveBackground:function(n){var i=n.css("background-color");return i.indexOf("rgba(0, 0, 0, 0")<0&&i!=="transparent"?i:n[0].tagName.toLowerCase()==="html"?"Window":t.getEffectiveBackground(n.parent())},removeClass:function(t,i){for(var r=" "+t.className+" ",f=i.split(" "),u=0,e=f.length;u<e;u++)r=r.replace(" "+f[u]+" "," ");r=n.trim(r);r.length?t.className=r:t.removeAttribute(v)},commonAncestor:function(){var t=arguments.length,r=[],e=Infinity,o=null,n,u,i,s,f;if(!t)return null;if(t==1)return arguments[0];for(n=0;n<t;n++){for(u=[],i=arguments[n];i;)u.push(i),i=i.parentNode;r.push(u.reverse());e=Math.min(e,u.length)}if(t==1)return r[0][0];for(n=0;n<e;n++){for(s=r[0][n],f=1;f<t;f++)if(s!=r[f][n])return o;o=s}return o},closestSplittableParent:function(i){var r,e,f;return r=i.length==1?t.parentOfType(i[0],["ul","ol"]):t.commonAncestor.apply(null,i),r||(r=t.parentOfType(i[0],["p","td"])||i[0].ownerDocument.body),t.isInline(r)&&(r=t.blockParentOrBody(r)),e=u(i,t.editableParent),f=t.commonAncestor(e)[0],n.contains(r,f)&&(r=f),r},closestEditable:function(i,r){var u,f=t.editableParent(i);return u=t.ofType(i,r)?i:t.parentOfType(i,r),u&&f&&n.contains(u,f)?u=f:!u&&f&&(u=f),u},closestEditableOfType:function(n,i){var r=t.closestEditable(n,i);if(r&&t.ofType(r,i))return r},filter:function(n,i,r){for(var u=0,o=i.length,e=[],f;u<o;u++)f=t.name(i[u]),(!r&&f==n||r&&f!=n)&&e.push(i[u]);return e},ensureTrailingBreaks:function(i){var u=n(i).find("p,td,th"),f=u.length,r=0;if(f)for(;r<f;r++)t.ensureTrailingBreak(u[r]);else t.ensureTrailingBreak(i)},removeTrailingBreak:function(t){n(t).find("br[type=_moz],.k-br").remove()},ensureTrailingBreak:function(n){t.removeTrailingBreak(n);var r=n.lastChild,i=r&&t.name(r),u;i&&(i=="br"||i=="img")&&(i!="br"||r.className=="k-br")||(u=n.ownerDocument.createElement("br"),u.className="k-br",n.appendChild(u))}};i.ui.editor.Dom=t})(window.kendo.jQuery)}(),function(){(function(n,t){var u=window.kendo,e=u.ui.editor,i=e.Dom,a=n.extend,o="xx-small,x-small,small,medium,large,x-large,xx-large".split(","),s=/"/g,v=/<br[^>]*>/i,h=/^\d+(\.\d*)?(px)?$/i,y=/<p><\/p>/i,p=/([\w|\-]+)\s*:\s*([^;]+);?/i,w=/^sizzle-\d+/i,c=/^k-script-/i,b=/\s*onerror\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/i,f=document.createElement("div"),l,r;f.innerHTML=" <hr>";l=f.firstChild.nodeType===3;f=null;r={toEditableHtml:function(n){var t='<br class="k-br">';return n=n||"",n.replace(/<!\[CDATA\[(.*)?\]\]>/g,"<!--[CDATA[$1]]-->").replace(/<script([^>]*)>(.*)?<\/script>/ig,"<k:script$1>$2<\/k:script>").replace(/<img([^>]*)>/ig,function(n){return n.replace(b,"")}).replace(/(<\/?img[^>]*>)[\r\n\v\f\t ]+/ig,"$1").replace(/^<(table|blockquote)/i,t+"<$1").replace(/^[\s]*(&nbsp;|\u00a0)/i,"$1").replace(/<\/(table|blockquote)>$/i,"<\/$1>"+t)},_fillEmptyElements:function(t){n(t).find("p").each(function(){var r=n(this),t;if(/^\s*$/g.test(r.text())&&!r.find("img,input").length){for(t=this;t.firstChild&&t.firstChild.nodeType!=3;)t=t.firstChild;t.nodeType!=1||i.empty[i.name(t)]||(t.innerHTML=u.ui.editor.emptyElementContent)}})},_removeSystemElements:function(t){n(".k-paste-container",t).remove()},_resetOrderedLists:function(n){for(var u=n.getElementsByTagName("ol"),t,r,i=0;i<u.length;i++)t=u[i],r=t.getAttribute("start"),t.setAttribute("start",1),r?t.setAttribute("start",r):t.removeAttribute(r)},_preventScriptExecution:function(t){n(t).find("*").each(function(){for(var r=this.attributes,n,i,t=0,u=r.length;t<u;t++)n=r[t],i=n.nodeName,n.specified&&/^on/i.test(i)&&(this.setAttribute("k-script-"+i,n.value),this.removeAttribute(i))})},htmlToDom:function(t,f){var s=u.support.browser,h=s.msie,c=h&&s.version<9,e,o;return t=r.toEditableHtml(t),c&&(t="<br/>"+t,e="originalsrc",o="originalhref",t=t.replace(/href\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/,o+'="$1"'),t=t.replace(/src\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/,e+'="$1"')),f.innerHTML=t,c?(i.remove(f.firstChild),n(f).find("k\\:script,script,link,img,a").each(function(){var n=this;n[o]&&(n.setAttribute("href",n[o]),n.removeAttribute(o));n[e]&&(n.setAttribute("src",n[e]),n.removeAttribute(e))})):h&&(i.normalize(f),r._resetOrderedLists(f)),r._preventScriptExecution(f),r._fillEmptyElements(f),r._removeSystemElements(f),n("table",f).addClass("k-table"),f},domToXhtml:function(r,f){function nt(t){return n.grep(t,function(n){return n.name!="style"})}function tt(t){for(var o=n.trim,h=o(t).split(";"),e,u,r,c=[],f=0,l=h.length;f<l;f++)h[f].length&&(e=p.exec(h[f]),e)&&(u=o(e[1].toLowerCase()),r=o(e[2]),u!="font-size-adjust"&&u!="font-stretch")&&(u.indexOf("color")>=0?r=i.toHex(r):u.indexOf("font")>=0?r=r.replace(s,"'"):/\burl\(/g.test(r)&&(r=r.replace(s,"")),c.push({property:u,value:r}));return c}function it(n){for(var i=tt(n),t=0;t<i.length;t++)e.push(i[t].property),e.push(":"),e.push(i[t].value),e.push(";")}function k(n){for(var s=[],h=n.attributes,u,r,o,t,e=0,l=h.length;e<l;e++)u=h[e],r=u.nodeName,o=u.value,t=u.specified,r=="value"&&"value"in n&&n.value?t=!0:r=="type"&&o=="text"?t=!0:r!="class"||o?w.test(r)?t=!1:r=="complete"?t=!1:r=="altHtml"?t=!1:r=="start"&&i.is(n,"ul")?t=!1:r=="start"&&i.is(n,"ol")&&o=="1"?t=!1:r.indexOf("_moz")>=0?t=!1:c.test(r)&&(t=!!f.scripts):t=!1,t&&s.push(u);return s}function a(r,f){var s,p,a,o,l;if(f=f||k(r),i.is(r,"img")){var v=r.style.width,y=r.style.height,w=n(r);v&&h.test(v)&&(w.attr("width",parseInt(v,10)),i.unstyle(r,{width:t}));y&&h.test(y)&&(w.attr("height",parseInt(y,10)),i.unstyle(r,{height:t}))}if(f.length)for(f.sort(function(n,t){return n.nodeName>t.nodeName?1:n.nodeName<t.nodeName?-1:0}),s=0,p=f.length;s<p;s++)(a=f[s],o=a.nodeName,l=a.value,o!="class"||l!="k-table")&&(o=o.replace(c,""),e.push(" "),e.push(o),e.push('="'),o=="style"?it(l||r.style.cssText):o=="src"||o=="href"?e.push(u.htmlEncode(r.getAttribute(o,2))):e.push(i.fillAttrs[o]?o:l),e.push('"'))}function d(n,t,i){for(var r=n.firstChild;r;r=r.nextSibling)rt(r,t,i)}function g(n){return n.nodeValue.replace(/\ufeff/g,"")}function rt(n,t,r){var c=n.nodeType,u,o,v,s,h;if(c==1){if(u=i.name(n),!u||i.insignificant(n))return;if(i.isInline(n)&&n.childNodes.length==1&&n.firstChild.nodeType==3&&!g(n.firstChild))return;if(!f.scripts&&(u=="script"||u=="k:script"))return;if(o=b[u],o&&(typeof o.semantic=="undefined"||f.semantic^o.semantic)){o.start(n);d(n,!1,o.skipEncoding);o.end(n);return}e.push("<");e.push(u);a(n);i.empty[u]?e.push(" />"):(e.push(">"),d(n,t||i.is(n,"pre")),e.push("<\/"),e.push(u),e.push(">"))}else c==3?(s=g(n),!t&&l&&(v=n.parentNode,h=n.previousSibling,h||(h=(i.isInline(v)?v:n).previousSibling),(!h||h.innerHTML===""||i.isBlock(h))&&(s=s.replace(/^[\r\n\v\f\t ]+/,"")),s=s.replace(/ +/," ")),e.push(r?s:i.encode(s,f))):c==4?(e.push("<![CDATA["),e.push(n.data),e.push("]\]>")):c==8&&(n.data.indexOf("[CDATA[")<0?(e.push("<!--"),e.push(n.data),e.push("-->")):(e.push("<!"),e.push(n.data),e.push(">")))}function ut(n){var t=n.childNodes.length,r=t&&n.firstChild.nodeType==3;return r&&(t==1||t==2&&i.insignificant(n.lastChild))}var e=[],b={iframe:{start:function(n){e.push("<iframe");a(n);e.push(">")},end:function(){e.push("<\/iframe>")}},"k:script":{start:function(n){e.push("<script");a(n);e.push(">")},end:function(){e.push("<\/script>")},skipEncoding:!0},span:{semantic:!0,start:function(t){var r=t.style,h=k(t),f=nt(h),u,s;f.length&&(e.push("<span"),a(t,f),e.push(">"));r.textDecoration=="underline"&&e.push("<u>");u=[];r.color&&u.push('color="'+i.toHex(r.color)+'"');r.fontFamily&&u.push('face="'+r.fontFamily+'"');r.fontSize&&(s=n.inArray(r.fontSize,o),u.push('size="'+s+'"'));u.length&&e.push("<font "+u.join(" ")+">")},end:function(n){var t=n.style;(t.color||t.fontFamily||t.fontSize)&&e.push("<\/font>");t.textDecoration=="underline"&&e.push("<\/u>");nt(k(n)).length&&e.push("<\/span>")}},strong:{semantic:!0,start:function(){e.push("<b>")},end:function(){e.push("<\/b>")}},em:{semantic:!0,start:function(){e.push("<i>")},end:function(){e.push("<\/i>")}},b:{semantic:!1,start:function(){e.push("<strong>")},end:function(){e.push("<\/strong>")}},i:{semantic:!1,start:function(){e.push("<em>")},end:function(){e.push("<\/em>")}},u:{semantic:!1,start:function(){e.push('<span style="text-decoration:underline;">')},end:function(){e.push("<\/span>")}},font:{semantic:!1,start:function(n){e.push('<span style="');var t=n.getAttribute("color"),r=o[n.getAttribute("size")],u=n.getAttribute("face");t&&(e.push("color:"),e.push(i.toHex(t)),e.push(";"));u&&(e.push("font-family:"),e.push(u),e.push(";"));r&&(e.push("font-size:"),e.push(r),e.push(";"));e.push('">')},end:function(){e.push("<\/span>")}}};return(b.script=b["k:script"],f=f||{},typeof f.semantic=="undefined"&&(f.semantic=!0),ut(r))?i.encode(g(r.firstChild).replace(/[\r\n\v\f\t ]+/," "),f):(d(r),e=e.join(""),e.replace(v,"").replace(y,"")==="")?"":e}};a(e,{Serializer:r})})(window.kendo.jQuery)}(),function(){(function(n){function it(n,i,r,f){var e,h,o,s;if(n==i)return f-r;for(e=i;e&&e.parentNode!=n;)e=e.parentNode;if(e)return u(e)-r;for(e=n;e&&e.parentNode!=i;)e=e.parentNode;if(e)return f-u(e)-1;for(h=t.commonAncestor(n,i),o=n;o&&o.parentNode!=h;)o=o.parentNode;for(o||(o=h),s=i;s&&s.parentNode!=h;)s=s.parentNode;return(s||(s=h),o==s)?0:u(s)-u(o)}function w(n,t){function i(n){try{return it(n.startContainer,n.endContainer,n.startOffset,n.endOffset)<0}catch(t){return!0}}i(n)&&(t?(n.commonAncestorContainer=n.endContainer=n.startContainer,n.endOffset=n.startOffset):(n.commonAncestorContainer=n.startContainer=n.endContainer,n.startOffset=n.endOffset),n.collapsed=!0)}function b(n){n.collapsed=n.startContainer==n.endContainer&&n.startOffset==n.endOffset;for(var i=n.startContainer;i&&i!=n.endContainer&&!t.isAncestorOf(i,n.endContainer);)i=i.parentNode;n.commonAncestorContainer=i}function rt(n){var i=n.duplicate(),r=n.duplicate();return i.collapse(!0),r.collapse(!1),t.commonAncestor(n.parentElement(),i.parentElement(),r.parentElement())}function d(n,r,u){var f=r[u?"startContainer":"endContainer"],c=r[u?"startOffset":"endOffset"],l=0,a=i(f),v=a?f:f.childNodes[c]||null,o=a?f.parentNode:f,s=r.ownerDocument,e=s.body.createTextRange(),h;(f.nodeType==3||f.nodeType==4)&&(l=c);o||(o=s.body);o.nodeName.toLowerCase()=="img"?(e.moveToElementText(o),e.collapse(!1),n.setEndPoint(u?"StartToStart":"EndToStart",e)):(h=o.insertBefore(t.create(s,"a"),v),e.moveToElementText(h),t.remove(h),e[u?"moveStart":"moveEnd"]("character",l),e.collapse(!1),n.setEndPoint(u?"StartToStart":"EndToStart",e))}function g(n,r,f,e){var o=t.create(r.ownerDocument,"a"),h=n.duplicate(),b=e?"StartToStart":"StartToEnd",p,s,a,l,v,c,y,w=!1;o.innerHTML="﻿";h.collapse(e);s=h.parentElement();t.isAncestorOrSelf(f,s)||(s=f);do w?s.insertBefore(o,o.previousSibling):(s.appendChild(o),w=!0),h.moveToElementText(o);while((p=h.compareEndPoints(b,n))>0&&o.previousSibling);a=o.nextSibling;p==-1&&i(a)?(h.setEndPoint(e?"EndToStart":"EndToEnd",n),t.remove(o),c=[a,h.text.length]):(l=!e&&o.previousSibling,v=e&&o.nextSibling,i(v)?c=[v,0]:i(l)?c=[l,l.length]:(y=u(o),c=s.nextSibling&&y==s.childNodes.length-1?[s.nextSibling,0]:[s,y]),t.remove(o));r[e?"setStart":"setEnd"].apply(r,c)}var s=window.kendo,e=s.Class,tt=n.extend,p=s.ui.editor,v=s.support.browser,t=p.Dom,u=t.findNodeIndex,i=t.isDataNode,h=t.findClosestAncestor,y=t.getNodeLength,o=t.normalize,c={selectionFromWindow:function(n){return("getSelection"in n)?n.getSelection():new k(n.document)},selectionFromRange:function(n){var t=r.documentFromRange(n);return c.selectionFromDocument(t)},selectionFromDocument:function(n){return c.selectionFromWindow(t.windowFromDocument(n))}},l=e.extend({init:function(t){n.extend(this,{ownerDocument:t,startContainer:t,endContainer:t,commonAncestorContainer:t,startOffset:0,endOffset:0,collapsed:!0})},setStart:function(n,t){this.startContainer=n;this.startOffset=t;b(this);w(this,!0)},setEnd:function(n,t){this.endContainer=n;this.endOffset=t;b(this);w(this,!1)},setStartBefore:function(n){this.setStart(n.parentNode,u(n))},setStartAfter:function(n){this.setStart(n.parentNode,u(n)+1)},setEndBefore:function(n){this.setEnd(n.parentNode,u(n))},setEndAfter:function(n){this.setEnd(n.parentNode,u(n)+1)},selectNode:function(n){this.setStartBefore(n);this.setEndAfter(n)},selectNodeContents:function(n){this.setStart(n,0);this.setEnd(n,n[n.nodeType===1?"childNodes":"nodeValue"].length)},collapse:function(n){var t=this;n?t.setEnd(t.startContainer,t.startOffset):t.setStart(t.endContainer,t.endOffset)},deleteContents:function(){var n=this,t=n.cloneRange();n.startContainer!=n.commonAncestorContainer&&n.setStartAfter(h(n.commonAncestorContainer,n.startContainer));n.collapse(!0),function i(n){while(n.next())n.hasPartialSubtree()?i(n.getSubtreeIterator()):n.remove()}(new f(t))},cloneContents:function(){var n=r.documentFromRange(this);return function t(i){for(var r,u=n.createDocumentFragment();r=i.next();)r=r.cloneNode(!i.hasPartialSubtree()),i.hasPartialSubtree()&&r.appendChild(t(i.getSubtreeIterator())),u.appendChild(r);return u}(new f(this))},extractContents:function(){var n=this,i=n.cloneRange(),t;return n.startContainer!=n.commonAncestorContainer&&n.setStartAfter(h(n.commonAncestorContainer,n.startContainer)),n.collapse(!0),t=r.documentFromRange(n),function u(i){for(var r,f=t.createDocumentFragment();r=i.next();)i.hasPartialSubtree()?(r=r.cloneNode(!1),r.appendChild(u(i.getSubtreeIterator()))):i.remove(n.originalRange),f.appendChild(r);return f}(new f(i))},insertNode:function(n){var r=this;i(r.startContainer)?(r.startOffset!=r.startContainer.nodeValue.length&&t.splitDataNode(r.startContainer,r.startOffset),t.insertAfter(n,r.startContainer)):t.insertAt(r.startContainer,n,r.startOffset);r.setStart(r.startContainer,r.startOffset)},cloneRange:function(){return n.extend(new l(this.ownerDocument),{startContainer:this.startContainer,endContainer:this.endContainer,commonAncestorContainer:this.commonAncestorContainer,startOffset:this.startOffset,endOffset:this.endOffset,collapsed:this.collapsed,originalRange:this})},toString:function(){var n=this.startContainer.nodeName,t=this.endContainer.nodeName;return[n=="#text"?this.startContainer.nodeValue:n,"(",this.startOffset,") : ",t=="#text"?this.endContainer.nodeValue:t,"(",this.endOffset,")"].join("")}}),f=e.extend({init:function(t){if(n.extend(this,{range:t,_current:null,_next:null,_end:null}),!t.collapsed){var r=t.commonAncestorContainer;this._next=t.startContainer==r&&!i(t.startContainer)?t.startContainer.childNodes[t.startOffset]:h(r,t.startContainer);this._end=t.endContainer==r&&!i(t.endContainer)?t.endContainer.childNodes[t.endOffset]:h(r,t.endContainer).nextSibling}},hasNext:function(){return!!this._next},next:function(){var n=this,t=n._current=n._next;return n._next=n._current&&n._current.nextSibling!=n._end?n._current.nextSibling:null,i(n._current)&&(n.range.endContainer==n._current&&(t=t.cloneNode(!0),t.deleteData(n.range.endOffset,t.length-n.range.endOffset)),n.range.startContainer==n._current&&(t=t.cloneNode(!0),t.deleteData(0,n.range.startOffset))),t},traverse:function(n){function r(){return t._current=t._next,t._next=t._current&&t._current.nextSibling!=t._end?t._current.nextSibling:null,t._current}for(var t=this,i;i=r();)t.hasPartialSubtree()?t.getSubtreeIterator().traverse(n):n(i);return i},remove:function(n){var r=this,s=r.range.startContainer==r._current,h=r.range.endContainer==r._current,e,c,o,f,l;i(r._current)&&(s||h)?(e=s?r.range.startOffset:0,c=h?r.range.endOffset:r._current.length,o=c-e,n&&(s||h)&&(r._current==n.startContainer&&e<=n.startOffset&&(n.startOffset-=o),r._current==n.endContainer&&c<=n.endOffset&&(n.endOffset-=o)),r._current.deleteData(e,o)):(f=r._current.parentNode,n&&(r.range.startContainer==f||r.range.endContainer==f)&&(l=u(r._current),f==n.startContainer&&l<=n.startOffset&&(n.startOffset-=1),f==n.endContainer&&l<n.endOffset&&(n.endOffset-=1)),t.remove(r._current))},hasPartialSubtree:function(){return!i(this._current)&&(t.isAncestorOrSelf(this._current,this.range.startContainer)||t.isAncestorOrSelf(this._current,this.range.endContainer))},getSubtreeIterator:function(){var n=this,i=n.range.cloneRange();return i.selectNodeContents(n._current),t.isAncestorOrSelf(n._current,n.range.startContainer)&&i.setStart(n.range.startContainer,n.range.startOffset),t.isAncestorOrSelf(n._current,n.range.endContainer)&&i.setEnd(n.range.endContainer,n.range.endOffset),new f(i)}}),k=e.extend({init:function(n){this.ownerDocument=n;this.rangeCount=1},addRange:function(n){var t=this.ownerDocument.body.createTextRange();d(t,n,!1);d(t,n,!0);t.select()},removeAllRanges:function(){var n=this.ownerDocument.selection;n.type!="None"&&n.empty()},getRangeAt:function(){var r,n=new l(this.ownerDocument),c=this.ownerDocument.selection,a,o,s,h;try{if(r=c.createRange(),a=r.item?r.item(0):r.parentElement(),a.ownerDocument!=this.ownerDocument)return n}catch(v){return n}if(c.type=="Control")n.selectNode(r.item(0));else{o=rt(r);g(r,n,o,!0);g(r,n,o,!1);n.startContainer.nodeType==9&&n.setStart(n.endContainer,n.startOffset);n.endContainer.nodeType==9&&n.setEnd(n.startContainer,n.endOffset);r.compareEndPoints("StartToEnd",r)===0&&n.collapse(!1);var t=n.startContainer,f=n.endContainer,e=this.ownerDocument.body;if(!n.collapsed&&n.startOffset===0&&n.endOffset==y(n.endContainer)&&!(t==f&&i(t)&&t.parentNode==e)){for(s=!1,h=!1;u(t)===0&&t==t.parentNode.firstChild&&t!=e;)t=t.parentNode,s=!0;while(u(f)==y(f.parentNode)-1&&f==f.parentNode.lastChild&&f!=e)f=f.parentNode,h=!0;t==e&&f==e&&s&&h&&(n.setStart(t,0),n.setEnd(f,y(e)))}}return n}}),nt=e.extend({init:function(n){this.enumerate=function(){function r(n){if(t.is(n,"img")||n.nodeType==3&&(!t.isWhitespace(n)||n.nodeValue=="﻿"))i.push(n);else for(n=n.firstChild;n;)r(n),n=n.nextSibling}var i=[];return new f(n).traverse(r),i}}}),ut=e.extend({init:function(n,i){var u=this;u.range=n;u.rootNode=r.documentFromRange(n);u.body=i||u.getEditable(n);t.name(u.body)!="body"&&(u.rootNode=u.body);u.html=u.body.innerHTML;u.startContainer=u.nodeToPath(n.startContainer);u.endContainer=u.nodeToPath(n.endContainer);u.startOffset=u.offset(n.startContainer,n.startOffset);u.endOffset=u.offset(n.endContainer,n.endOffset)},index:function(n){for(var i=0,r=n.nodeType,t;n=n.previousSibling;)t=n.nodeType,(t!=3||r!=t)&&i++,r=t;return i},getEditable:function(n){for(var t=n.commonAncestorContainer;t&&(t.nodeType==3||t.attributes&&!t.attributes.contentEditable);)t=t.parentNode;return t},restoreHtml:function(){this.body.innerHTML=this.html},offset:function(n,t){if(n.nodeType==3)while((n=n.previousSibling)&&n.nodeType==3)t+=n.nodeValue.length;return t},nodeToPath:function(n){for(var t=[];n!=this.rootNode;)t.push(this.index(n)),n=n.parentNode;return t},toRangePoint:function(n,t,i,r){for(var u=this.rootNode,e=i.length,f=r;e--;)u=u.childNodes[i[e]];while(u&&u.nodeType==3&&u.nodeValue.length<f)f-=u.nodeValue.length,u=u.nextSibling;u&&f>=0&&n[t?"setStart":"setEnd"](u,f)},toRange:function(){var n=this,t=n.range.cloneRange();return n.toRangePoint(t,!0,n.startContainer,n.startOffset),n.toRangePoint(t,!1,n.endContainer,n.endOffset),t}}),ft=e.extend({init:function(){this.caret=null},addCaret:function(n){var i=this;return i.caret=t.create(r.documentFromRange(n),"span",{className:"k-marker"}),n.insertNode(i.caret),n.selectNode(i.caret),i.caret},removeCaret:function(n){var h=this,r=h.caret.previousSibling,c=0,f,l,e,s;r&&(c=i(r)?r.nodeValue.length:u(r));f=h.caret.parentNode;l=r?u(r):0;t.remove(h.caret);o(f);e=f.childNodes[l];i(e)?n.setStart(e,c):e?(s=t.lastTextNode(e),s?n.setStart(s,s.nodeValue.length):n[r?"setStartAfter":"setStartBefore"](e)):(v.msie||f.innerHTML||(f.innerHTML='<br _moz_dirty="" />'),n.selectNodeContents(f));n.collapse(!0)},add:function(n,i){var u=this,h=n.collapsed&&!r.isExpandable(n),s=r.documentFromRange(n),f,e;return i&&n.collapsed&&(u.addCaret(n),n=r.expand(n)),f=n.cloneRange(),f.collapse(!1),u.end=t.create(s,"span",{className:"k-marker"}),f.insertNode(u.end),f=n.cloneRange(),f.collapse(!0),u.start=u.end.cloneNode(!0),f.insertNode(u.start),u._removeDeadMarkers(u.start,u.end),h&&(e=s.createTextNode("﻿"),t.insertAfter(e.cloneNode(),u.start),t.insertBefore(e,u.end)),o(n.commonAncestorContainer),n.setStartBefore(u.start),n.setEndAfter(u.end),n},_removeDeadMarkers:function(n,i){n.previousSibling&&n.previousSibling.nodeValue=="﻿"&&t.remove(n.previousSibling);i.nextSibling&&i.nextSibling.nodeValue=="﻿"&&t.remove(i.nextSibling)},_normalizedIndex:function(n){for(var i=u(n),t=n;t.previousSibling;)t.nodeType==3&&t.previousSibling.nodeType==3&&i--,t=t.previousSibling;return i},remove:function(n){var f=this,r=f.start,u=f.end,l,a,p,e,h,s,c;for(o(n.commonAncestorContainer);!r.nextSibling&&r.parentNode;)r=r.parentNode;while(!u.previousSibling&&u.parentNode)u=u.parentNode;if(l=r.previousSibling&&r.previousSibling.nodeType==3&&r.nextSibling&&r.nextSibling.nodeType==3,a=u.previousSibling&&u.previousSibling.nodeType==3&&u.nextSibling&&u.nextSibling.nodeType==3,p=l&&a,r=r.nextSibling,u=u.previousSibling,e=!1,h=!1,r==f.end&&(h=!!f.start.previousSibling,r=u=f.start.previousSibling||f.end.nextSibling,e=!0),t.remove(f.start),t.remove(f.end),!r||!u){n.selectNodeContents(n.commonAncestorContainer);n.collapse(!0);return}if(s=e?i(r)?r.nodeValue.length:r.childNodes.length:0,c=i(u)?u.nodeValue.length:u.childNodes.length,r.nodeType==3)while(r.previousSibling&&r.previousSibling.nodeType==3)r=r.previousSibling,s+=r.nodeValue.length;if(u.nodeType==3)while(u.previousSibling&&u.previousSibling.nodeType==3)u=u.previousSibling,c+=u.nodeValue.length;var v=r.parentNode,y=u.parentNode,w=this._normalizedIndex(r),b=this._normalizedIndex(u);o(v);r.nodeType==3&&(r=v.childNodes[w]);o(y);u.nodeType==3&&(u=y.childNodes[b]);e?(r.nodeType==3?n.setStart(r,s):n[h?"setStartAfter":"setStartBefore"](r),n.collapse(!0)):(r.nodeType==3?n.setStart(r,s):n.setStartBefore(r),u.nodeType==3?n.setEnd(u,c):n.setEndAfter(u));f.caret&&f.removeCaret(n)}}),a=/[\u0009-\u000d]|\u0020|\u00a0|\ufeff|\.|,|;|:|!|\(|\)|\?/,r={nodes:function(n){var i=r.textNodes(n);return i.length||(n.selectNodeContents(n.commonAncestorContainer),i=r.textNodes(n),i.length||(i=t.significantChildNodes(n.commonAncestorContainer))),i},textNodes:function(n){return new nt(n).enumerate()},documentFromRange:function(n){var t=n.startContainer;return t.nodeType==9?t:t.ownerDocument},createRange:function(n){return v.msie&&v.version<9?new l(n):n.createRange()},selectRange:function(n){var t=r.image(n),i;t&&(n.setStartAfter(t),n.setEndAfter(t));i=c.selectionFromRange(n);i.removeAllRanges();i.addRange(n)},stringify:function(n){return s.format("{0}:{1} - {2}:{3}",t.name(n.startContainer),n.startOffset,t.name(n.endContainer),n.endOffset)},split:function(n,i,r){function u(u){var e=n.cloneRange(),f;e.collapse(u);e[u?"setStartBefore":"setEndAfter"](i);f=e.extractContents();r&&(f=t.trim(f));t[u?"insertBefore":"insertAfter"](f,i)}u(!0);u(!1)},mapAll:function(t,i){var r=[];return new f(t).traverse(function(t){var u=i(t);u&&n.inArray(u,r)<0&&r.push(u)}),r},getAll:function(n,i){var u=i;return typeof i=="string"&&(i=function(n){return t.is(n,u)}),r.mapAll(n,function(n){if(i(n))return n})},getMarkers:function(n){return r.getAll(n,function(n){return n.className=="k-marker"})},image:function(n){var t=r.getAll(n,"img");if(t.length==1)return t[0]},isStartOf:function(n,i){for(n=n.cloneRange();n.startOffset===0&&n.startContainer!=i;){for(var r=t.findNodeIndex(n.startContainer),u=n.startContainer.parentNode;r>0&&t.insignificant(u[r-1]);)r--;n.setStart(u,r)}return n.startOffset===0&&n.startContainer==i},isEndOf:function(n,i){function e(n){t.insignificant(n)||u.push(n)}var r,u;return n=n.cloneRange(),n.collapse(!1),r=n.startContainer,t.isDataNode(r)&&n.startOffset==t.getNodeLength(r)&&(n.setStart(r.parentNode,t.findNodeIndex(r)+1),n.collapse(!0)),n.setEnd(i,t.getNodeLength(i)),u=[],new f(n).traverse(e),!u.length},wrapSelectedElements:function(n){function u(n,i){var u=t.getNodeLength(i),r;if(n==u)return!0;for(r=n;r<u;r++)if(!t.insignificant(i.childNodes[r]))return!1;return!0}for(var i=t.editableParent(n.startContainer),r=t.editableParent(n.endContainer);n.startOffset===0&&n.startContainer!=i;)n.setStart(n.startContainer.parentNode,t.findNodeIndex(n.startContainer));while(u(n.endOffset,n.endContainer)&&n.endContainer!=r)n.setEnd(n.endContainer.parentNode,t.findNodeIndex(n.endContainer)+1);return n},expand:function(n){var t=n.cloneRange(),o=t.startContainer.childNodes[t.startOffset===0?0:t.startOffset-1],s=t.endContainer.childNodes[t.endOffset],f,e,r,u;return!i(o)||!i(s)?t:(f=o.nodeValue,e=s.nodeValue,!f||!e)?t:(r=f.split("").reverse().join("").search(a),u=e.search(a),!r||!u)?t:(u=u==-1?e.length:u,r=r==-1?0:f.length-r,t.setStart(o,r),t.setEnd(s,u),t)},isExpandable:function(n){var i=n.startContainer,f=r.documentFromRange(n),u,t;if(i==f||i==f.body||(u=n.cloneRange(),t=i.nodeValue,!t))return!1;var e=t.substring(0,u.startOffset),o=t.substring(u.startOffset),s=0,h=0;return e&&(s=e.split("").reverse().join("").search(a)),o&&(h=o.search(a)),s&&h}};tt(p,{SelectionUtils:c,W3CRange:l,RangeIterator:f,W3CSelection:k,RangeEnumerator:nt,RestorePoint:ut,Marker:ft,RangeUtils:r})})(window.kendo.jQuery)}(),function(){(function(n){function s(n,t){var i=n.selectionRestorePoint=new u(n.getRange()),r=new p(t,i);return r.editor=n,n.undoRedoStack.push(r),i}var f=window.kendo,r=f.Class,i=f.ui.editor,h=i.EditorUtils,a=h.registerTool,t=i.Dom,c=i.Tool,v=i.ToolTemplate,u=i.RestorePoint,y=i.Marker,l=n.extend,e=r.extend({init:function(n){this.options=n;this.restorePoint=new u(n.range);this.marker=new y;this.formatter=n.formatter},getRange:function(){return this.restorePoint.toRange()},lockRange:function(n){return this.marker.add(this.getRange(),n)},releaseRange:function(n){this.marker.remove(n);this.editor.selectRange(n)},undo:function(){var n=this.restorePoint;n.restoreHtml();this.editor.selectRange(n.toRange())},redo:function(){this.exec()},createDialog:function(t,i){var r=this.editor;return n(t).appendTo(document.body).kendoWindow(l({},r.options.dialogOptions,i)).closest(".k-window").toggleClass("k-rtl",f.support.isRtl(r.wrapper)).end()},exec:function(){var n=this.lockRange(!0);this.formatter.editor=this.editor;this.formatter.toggle(n);this.releaseRange(n)}}),p=r.extend({init:function(n,t){this.body=n.body;this.startRestorePoint=n;this.endRestorePoint=t},redo:function(){this.body.innerHTML=this.endRestorePoint.html;this.editor.selectRange(this.endRestorePoint.toRange())},undo:function(){this.body.innerHTML=this.startRestorePoint.html;this.editor.selectRange(this.startRestorePoint.toRange())}}),w=e.extend({init:function(n){e.fn.init.call(this,n);this.managesUndoRedo=!0},exec:function(){var n=this.editor,t=this.options,r=t.range,f=n.body,e=new u(r,f),o=t.html||t.value||"",i;n.selectRange(r);n.clipboard.paste(o,t);t.postProcess&&t.postProcess(n,n.getRange());i=new p(e,new u(n.getRange(),f));i.editor=n;n.undoRedoStack.push(i);n.focus()}}),b=c.extend({initialize:function(n,t){var r=t.editor,u=this.options,f=u.items?u.items:r.options.insertHtml;this._selectBox=new i.SelectBox(n,{dataSource:f,dataTextField:"text",dataValueField:"value",change:function(){c.exec(r,"insertHtml",this.value())},title:r.options.messages.insertHtml,highlightFirst:!1})},command:function(n){return new w(n)},update:function(n){var t=n.data("kendoSelectBox")||n.find("select").data("kendoSelectBox");t.close();t.value(t.options.title)}}),it=r.extend({init:function(n){this.editor=n},keydown:function(t){var i=this,r=i.editor,f=r.keyboard,h=f.isTypingKey(t),e=l(n.Event(),t),o;return(i.editor.trigger("keydown",e),e.isDefaultPrevented())?(t.preventDefault(),!0):!e.isDefaultPrevented()&&h&&!f.isTypingInProgress()?(o=r.getRange(),i.startRestorePoint=new u(o),f.startTyping(function(){i.endRestorePoint=s(r,i.startRestorePoint)}),!0):!1},keyup:function(n){var t=this.editor.keyboard;return(this.editor.trigger("keyup",n),t.isTypingInProgress())?(t.endTyping(),!0):!1}}),rt=r.extend({init:function(n){this.editor=n},_addCaret:function(n){var i=t.create(this.editor.document,"a");return t.insertAt(n,i,0),i},_restoreCaret:function(n){var i=this.editor.createRange();i.setStartAfter(n);i.collapse(!0);this.editor.selectRange(i);t.remove(n)},_handleDelete:function(n){var e=n.endContainer,u=t.closestEditableOfType(e,t.blockElements),r,f;return u&&i.RangeUtils.isEndOf(n,u)?(r=t.next(u),!r||t.name(r)!="p")?!1:(f=this._addCaret(r),this._merge(u,r),this._restoreCaret(f),!0):!1},_handleBackspace:function(n){var r=n.startContainer,f=n.startOffset,e=t.closestEditableOfType(r,["li"]),u=t.closestEditableOfType(r,"p,h1,h2,h3,h4,h5,h6".split(",")),s,h,o,c;if(t.isDataNode(r)){while(f>=0&&r.nodeValue[f-1]=="﻿")r.deleteData(f-1,1),f--;n.setStart(r,Math.max(0,f));n.collapse(!0);this.editor.selectRange(n)}return u&&u.previousSibling&&i.RangeUtils.isStartOf(n,u)?(s=u.previousSibling,h=this._addCaret(u),this._merge(s,u),this._restoreCaret(h),!0):e&&i.RangeUtils.isStartOf(n,e)?(o=new i.GreedyBlockFormatter([{tags:["p"]}]),c=e.firstChild,o.editor=this.editor,o.apply(e.childNodes),n.setStart(c,0),this.editor.selectRange(n),!0):!1},_handleSelection:function(r){var f=r.commonAncestorContainer,o=t.closest(f,"table"),h=i.emptyElementContent,e,u,s;return/t(able|body)/i.test(t.name(f))&&r.selectNode(o),e=new y,e.add(r,!1),r.setStartAfter(e.start),r.setEndBefore(e.end),u=r.startContainer,s=r.endContainer,r.deleteContents(),o&&n(o).text()===""&&(r.selectNode(o),r.deleteContents()),f=r.commonAncestorContainer,t.name(f)==="p"&&f.innerHTML===""&&(f.innerHTML=h,r.setStart(f,0)),this._join(u,s),t.insertAfter(this.editor.document.createTextNode("﻿"),e.start),e.remove(r),u=r.startContainer,t.name(u)=="tr"&&(u=u.childNodes[Math.max(0,r.startOffset-1)],r.setStart(u,t.getNodeLength(u))),r.collapse(!0),this.editor.selectRange(r),!0},_root:function(n){while(n&&n.parentNode&&t.name(n.parentNode)!="body")n=n.parentNode;return n},_join:function(n,i){n=this._root(n);i=this._root(i);n!=i&&t.is(i,"p")&&this._merge(n,i)},_merge:function(n,i){for(t.removeTrailingBreak(n);i.firstChild;)n.nodeType==1?n.appendChild(i.firstChild):n.parentNode.appendChild(i.firstChild);t.remove(i)},keydown:function(n){var t,r,i=this.editor.getRange(),e=n.keyCode,o=f.keys,h=e===o.BACKSPACE,c=e==o.DELETE;((h||c)&&!i.collapsed?t="_handleSelection":h?t="_handleBackspace":c&&(t="_handleDelete"),t)&&(r=new u(i),this[t](i)&&(n.preventDefault(),s(this.editor,r)))},keyup:n.noop}),ut=r.extend({init:function(n){this.editor=n;this.systemCommandIsInProgress=!1},createUndoCommand:function(){this.startRestorePoint=this.endRestorePoint=s(this.editor,this.startRestorePoint)},changed:function(){return this.startRestorePoint?this.startRestorePoint.html!=this.editor.body.innerHTML:!1},keydown:function(n){var t=this,r=t.editor,i=r.keyboard;return i.isModifierKey(n)?(i.isTypingInProgress()&&i.endTyping(!0),t.startRestorePoint=new u(r.getRange()),!0):i.isSystem(n)?(t.systemCommandIsInProgress=!0,t.changed()&&(t.systemCommandIsInProgress=!1,t.createUndoCommand()),!0):!1},keyup:function(){var n=this;return n.systemCommandIsInProgress&&n.changed()?(n.systemCommandIsInProgress=!1,n.createUndoCommand(),!0):!1}}),ft=r.extend({init:function(n){this.handlers=n;this.typingInProgress=!1},isCharacter:function(n){return n>=48&&n<=90||n>=96&&n<=111||n>=186&&n<=192||n>=219&&n<=222||n==229},toolFromShortcut:function(t,i){var f=String.fromCharCode(i.keyCode),u,r;for(u in t)if(r=n.extend({ctrl:!1,alt:!1,shift:!1},t[u].options),(r.key==f||r.key==i.keyCode)&&r.ctrl==i.ctrlKey&&r.alt==i.altKey&&r.shift==i.shiftKey)return u},isTypingKey:function(n){var t=n.keyCode;return this.isCharacter(t)&&!n.ctrlKey&&!n.altKey||t==32||t==13||t==8||t==46&&!n.shiftKey&&!n.ctrlKey&&!n.altKey},isModifierKey:function(n){var t=n.keyCode;return t==17&&!n.shiftKey&&!n.altKey||t==16&&!n.ctrlKey&&!n.altKey||t==18&&!n.ctrlKey&&!n.shiftKey},isSystem:function(n){return n.keyCode==46&&n.ctrlKey&&!n.altKey&&!n.shiftKey},startTyping:function(n){this.onEndTyping=n;this.typingInProgress=!0},stopTyping:function(){this.typingInProgress&&this.onEndTyping&&this.onEndTyping();this.typingInProgress=!1},endTyping:function(t){var i=this;i.clearTimeout();t?i.stopTyping():i.timeout=window.setTimeout(n.proxy(i.stopTyping,i),1e3)},isTypingInProgress:function(){return this.typingInProgress},clearTimeout:function(){window.clearTimeout(this.timeout)},notify:function(n,t){for(var r=this.handlers,i=0;i<r.length;i++)if(r[i][t](n))break},keydown:function(n){this.notify(n,"keydown")},keyup:function(n){this.notify(n,"keyup")}}),et=r.extend({init:function(n){this.editor=n;this.cleaners=[new ot,new k,new d,new g]},htmlToFragment:function(n){var f=this.editor,r=f.document,i=t.create(r,"div"),u=r.createDocumentFragment();for(i.innerHTML=n;i.firstChild;)u.appendChild(i.firstChild);return u},isBlock:function(n){return/<(div|p|ul|ol|table|h[1-6])/i.test(n)},_startModification:function(){var n,i,r=this.editor;if(!this._inProgress)return this._inProgress=!0,n=r.getRange(),i=new u(n),t.persistScrollTop(r.document),{range:n,restorePoint:i}},_endModification:function(n){s(this.editor,n.restorePoint);this.editor._selectionChange();this._inProgress=!1},_contentModification:function(n,t){var i=this,u=i.editor,r=i._startModification();r&&(n.call(i,u,r.range),setTimeout(function(){t.call(i,u,r.range);i._endModification(r)}))},oncut:function(){this._contentModification(n.noop,n.noop)},_fileToDataURL:function(t){var i=n.Deferred(),r=new FileReader;return t instanceof window.File||!t.getAsFile||(t=t.getAsFile()),r.onload=n.proxy(i.resolve,i),r.readAsDataURL(t),i.promise()},_triggerPaste:function(n,t){var i={html:n||""};i.html=i.html.replace(/\ufeff/g,"");this.editor.trigger("paste",i);this.paste(i.html,t||{})},_handleImagePaste:function(t){var u;if("FileReader"in window){var i=t.clipboardData||t.originalEvent.clipboardData||window.clipboardData,f=i&&(i.items||i.files),r=f&&n.grep(f,function(n){return/^image\//i.test(n.type)});if(r&&r.length)return(u=this._startModification(),!u)?void 0:(n.when.apply(n,n.map(r,this._fileToDataURL)).done(n.proxy(function(){var t=Array.prototype.slice.call(arguments),i=n.map(t,function(n){return'<img src="'+n.target.result+'" />'}).join("");this._triggerPaste(i);this._endModification(u)},this)),!0)}},onpaste:function(i){if(this._handleImagePaste(i)){i.preventDefault();return}this._contentModification(function(r,u){var e=t.create(r.document,"div",{className:"k-paste-container",innerHTML:"﻿"}),c=f.support.browser,o,s,h;r.body.appendChild(e);c.msie&&c.version<11?(i.preventDefault(),o=r.createRange(),o.selectNodeContents(e),r.selectRange(o),s=r.document.body.createTextRange(),s.moveToElementText(e),n(r.body).unbind("paste"),s.execCommand("Paste"),n(r.body).bind("paste",n.proxy(this.onpaste,this))):(h=r.createRange(),h.selectNodeContents(e),r.selectRange(h));u.deleteContents()},function(i,r){var f="",u;i.selectRange(r);u=n(i.body).children(".k-paste-container");u.each(function(){var n=this.lastChild;n&&t.is(n,"br")&&t.remove(n);f+=this.innerHTML});u.remove();this._triggerPaste(f,{clean:!0})})},splittableParent:function(n,i){var r,u;if(n)return t.closestEditableOfType(i,["p","ul","ol"])||i.parentNode;if(r=i.parentNode,u=i.ownerDocument.body,t.isInline(r))while(r.parentNode!=u&&!t.isBlock(r.parentNode))r=r.parentNode;return r},paste:function(r,u){var h=this.editor,e,a,v,f,s,p,w;for(u=l({clean:!1,split:!0},u),e=0,a=this.cleaners.length;e<a;e++)this.cleaners[e].applicable(r)&&(r=this.cleaners[e].clean(r));u.clean&&(r=r.replace(/(<br>(\s|&nbsp;)*)+(<\/?(div|p|li|col|t))/ig,"$3"),r=r.replace(/<(a|span)[^>]*><\/\1>/ig,""));r=r.replace(/^<li/i,"<ul><li").replace(/li>$/g,"li><\/ul>");v=this.isBlock(r);h.focus();f=h.getRange();f.deleteContents();f.startContainer==h.document&&f.selectNodeContents(h.body);var b=new y,o=b.addCaret(f),c=this.splittableParent(v,o),k=!1,d=c!=h.body&&!t.is(c,"td");if(u.split&&d&&(v||t.isInline(c))&&(f.selectNode(o),i.RangeUtils.split(f,c,!0),k=!0),s=this.htmlToFragment(r),s.firstChild&&s.firstChild.className==="k-paste-container"){for(p=[],e=0,a=s.childNodes.length;e<a;e++)p.push(s.childNodes[e].innerHTML);s=this.htmlToFragment(p.join("<br />"))}if(n(s.childNodes).filter("table").addClass("k-table").end().find("table").addClass("k-table"),f.insertNode(s),c=this.splittableParent(v,o),k){while(o.parentNode!=c)t.unwrap(o.parentNode);t.unwrap(o.parentNode)}t.normalize(f.commonAncestorContainer);o.style.display="inline";t.restoreScrollTop(h.document);t.scrollTo(o);b.removeCaret(f);w=f.commonAncestorContainer.parentNode;f.collapsed&&t.name(w)=="tbody"&&(f.setStartAfter(n(w).closest("table")[0]),f.collapse(!0));h.selectRange(f)}}),o=r.extend({clean:function(n){for(var u=this,i=u.replacements,t=0,r=i.length;t<r;t+=2)n=n.replace(i[t],i[t+1]);return n}}),ot=o.extend({init:function(){this.replacements=[/<(\/?)script([^>]*)>/i,"<$1telerik:script$2>"]},applicable:function(n){return/<script[^>]*>/i.test(n)}}),k=o.extend({init:function(){var n=" ";this.replacements=[/<span\s+class="Apple-tab-span"[^>]*>\s*<\/span>/gi,n,/\t/gi,n,/&nbsp;&nbsp; &nbsp;/gi,n]},applicable:function(n){return/&nbsp;&nbsp; &nbsp;|class="?Apple-tab-span/i.test(n)}}),d=o.extend({init:function(){this.replacements=[/<\?xml[^>]*>/gi,"",/<!--(.|\n)*?-->/g,"",/&quot;/g,"'",/(?:<br>&nbsp;[\s\r\n]+|<br>)*(<\/?(h[1-6]|hr|p|div|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|address|pre|form|blockquote|dl|dt|dd|dir|fieldset)[^>]*>)(?:<br>&nbsp;[\s\r\n]+|<br>)*/g,"$1",/<br><br>/g,"<BR><BR>",/<br>(?!\n)/g," ",/<table([^>]*)>(\s|&nbsp;)+<t/gi,"<table$1><t",/<tr[^>]*>(\s|&nbsp;)*<\/tr>/gi,"",/<tbody[^>]*>(\s|&nbsp;)*<\/tbody>/gi,"",/<table[^>]*>(\s|&nbsp;)*<\/table>/gi,"",/<BR><BR>/g,"<br>",/^\s*(&nbsp;)+/gi,"",/(&nbsp;|<br[^>]*>)+\s*$/gi,"",/mso-[^;"]*;?/ig,"",/<(\/?)b(\s[^>]*)?>/ig,"<$1strong$2>",/<(\/?)font(\s[^>]*)?>/ig,this.convertFontMatch,/<(\/?)i(\s[^>]*)?>/ig,"<$1em$2>",/<o:p>&nbsp;<\/o:p>/ig,"&nbsp;",/<\/?(meta|link|style|o:|v:|x:)[^>]*>((?:.|\n)*?<\/(meta|link|style|o:|v:|x:)[^>]*>)?/ig,"",/<\/o>/g,"",/style=(["|'])\s*\1/g,"",/(<br[^>]*>)?\n/g,function(n,t){return t?n:" "}]},convertFontMatch:function(n,t,i){var r=/face=['"]([^'"]+)['"]/i.exec(i),u=i&&r&&r[1];return t?"<\/span>":u?'<span style="font-family:'+u+'">':"<span>"},applicable:function(n){return/class="?Mso/i.test(n)||/style="[^"]*mso-/i.test(n)||/urn:schemas-microsoft-com:office/.test(n)},stripEmptyAnchors:function(n){return n.replace(/<a([^>]*)>\s*<\/a>/ig,function(n,t){return!t||t.indexOf("href")<0?"":n})},listType:function(n){var t;return(/^(<span [^>]*texhtml[^>]*>)?<span [^>]*(Symbol|Wingdings)[^>]*>/i.test(n)&&(t=!0),n=n.replace(/<\/?\w+[^>]*>/g,"").replace(/&nbsp;/g," "),!t&&/^[\u2022\u00b7\u00a7\u00d8o]\u00a0+/.test(n)||t&&/^.\u00a0+/.test(n))?"ul":/^\s*\w+[\.\)]\u00a0{2,}/.test(n)?"ol":void 0},_convertToLi:function(n){var i;return n.childNodes.length==1?i=n.firstChild.innerHTML.replace(/^\w+[\.\)](&nbsp;)+ /,""):(t.remove(n.firstChild),n.firstChild.nodeType==3&&/^[ivx]+\.$/i.test(n.firstChild.nodeValue)&&t.remove(n.firstChild),/^(&nbsp;|\s)+$/i.test(n.firstChild.innerHTML)&&t.remove(n.firstChild),i=n.innerHTML),t.remove(n),t.create(document,"li",{innerHTML:i})},lists:function(i){for(var y=n(t.blockElements.join(","),i),l=-1,p,a,f={ul:{},ol:{}},o=i,r,e,s,u,c,v,h=0;h<y.length;h++)if(r=y[h],e=this.listType(r.innerHTML),a=t.name(r),a!="td"){if(!e||a!="p"){r.innerHTML?(f={ul:{},ol:{}},o=i,l=-1):t.remove(r);continue}if(s=parseFloat(r.style.marginLeft||0),u=f[e][s],(s>l||!u)&&(u=t.create(document,e),o==i?t.insertBefore(u,r):o.appendChild(u),f[e][s]=u),p!=e)for(c in f)for(v in f[c])n.contains(u,f[c][v])&&delete f[c][v];o=this._convertToLi(r);u.appendChild(o);l=s;p=e}},removeAttributes:function(n){for(var i=n.attributes,r=i.length;r--;)t.name(i[r])!="colspan"&&n.removeAttributeNode(i[r])},createColGroup:function(t){var r=t.cells,u=n(t).closest("table"),i=u.children("colgroup");r.length<2||(i.length&&(r=i.children(),i[0].parentNode.removeChild(i[0])),i=n(n.map(r,function(n){var t=n.width;return t&&parseInt(t,10)!==0?f.format('<col style="width:{0}px;"/>',t):"<col />"}).join("")),i.is("colgroup")||(i=n("<colgroup/>").append(i)),i.prependTo(u))},convertHeaders:function(i){var u=i.cells,r,f=n.map(u,function(i){var r=n(i).children("p").children("strong")[0];if(r&&t.name(r)=="strong")return r});if(f.length==u.length){for(r=0;r<f.length;r++)t.unwrap(f[r]);for(n(i).closest("table").find("colgroup").after("<thead><\/thead>").end().find("thead").append(i),r=0;r<u.length;r++)t.changeTag(u[r],"th")}},removeParagraphs:function(i){for(var r,e,o,f,u=0;u<i.length;u++)for(this.removeAttributes(i[u]),o=n(i[u]),f=o.children("p"),r=0,e=f.length;r<e;r++)r<e-1&&t.insertAfter(t.create(document,"br"),f[r]),t.unwrap(f[r])},removeDefaultColors:function(n){for(var i=0;i<n.length;i++)/^\s*color:\s*[^;]*;?$/i.test(n[i].style.cssText)&&t.unwrap(n[i])},tables:function(t){for(var r=n(t).find("table"),u=this,f,s,o,e,i=0;i<r.length;i++){for(f=r[i].rows,o=s=f[0],e=1;e<f.length;e++)f[e].cells.length>o.cells.length&&(o=f[e]);u.createColGroup(o);u.convertHeaders(s);u.removeAttributes(r[i]);u.removeParagraphs(r.eq(i).find("td,th"));u.removeDefaultColors(r.eq(i).find("span"))}},headers:function(i){for(var u=n(i).find("p.MsoTitle"),r=0;r<u.length;r++)t.changeTag(u[r],"h1")},clean:function(n){var i=this,r;return n=o.fn.clean.call(i,n),n=i.stripEmptyAnchors(n),r=t.create(document,"div",{innerHTML:n}),i.headers(r),i.lists(r),i.tables(r),r.innerHTML.replace(/(<[^>]*)\s+class="?[^"\s>]*"?/ig,"$1")}}),g=o.extend({init:function(){this.replacements=[/\s+class="Apple-style-span[^"]*"/gi,"",/<(div|p|h[1-6])\s+style="[^"]*"/gi,"<$1",/^<div>(.*)<\/div>$/,"$1"]},applicable:function(n){return/class="?Apple-style-span|style="[^"]*-webkit-nbsp-mode/i.test(n)}}),nt=e.extend({init:function(n){e.fn.init.call(this,n);this.managesUndoRedo=!0},exec:function(){var n=this.editor;f.support.browser.msie?n.document.execCommand("print",!1,null):n.window.print&&n.window.print()}}),tt=e.extend({init:function(n){this.async=!0;e.fn.init.call(this,n)},exec:function(){var n=this,t=this.lockRange(!0);this.editor.saveAsPDF().then(function(){n.releaseRange(t)})}});l(i,{_finishUpdate:s,Command:e,GenericCommand:p,InsertHtmlCommand:w,InsertHtmlTool:b,TypingHandler:it,SystemHandler:ut,BackspaceHandler:rt,Keyboard:ft,Clipboard:et,Cleaner:o,TabCleaner:k,MSWordFormatCleaner:d,WebkitFormatCleaner:g,PrintCommand:nt,ExportPdfCommand:tt});a("insertHtml",new b({template:new v({template:h.dropDownListTemplate,title:"Insert HTML",initialValue:"Insert HTML"})}));a("print",new c({command:nt,template:new v({template:h.buttonTemplate,title:"Print"})}));a("pdf",new c({command:tt,template:new v({template:h.buttonTemplate,title:"Export PDF"})}))})(window.kendo.jQuery)}(),function(){(function(n){var e=window.kendo,g=e.Class,i=e.ui.editor,s=e.ui.Editor.fn.options.formats,r=i.EditorUtils,h=i.Tool,u=i.ToolTemplate,nt=i.FormatTool,t=i.Dom,b=i.RangeUtils,c=n.extend,f=i.EditorUtils.registerTool,l=i.EditorUtils.registerFormat,v="k-marker",a=g.extend({init:function(n){this.format=n},numberOfSiblings:function(n){for(var r=0,u=0,f=0,i=n.parentNode,t=i.firstChild;t;t=t.nextSibling)t!=n&&(t.className==v?f++:t.nodeType==3?r++:u++);return f>1&&i.firstChild.className==v&&i.lastChild.className==v?0:u+r},findSuitable:function(n,i){if(!i&&this.numberOfSiblings(n)>0)return null;for(var r=n.parentNode,u=this.format[0].tags;!t.ofType(r,u);){if(this.numberOfSiblings(r)>0)return null;r=r.parentNode}return r},findFormat:function(n){for(var u=this.format,o=t.attrEquals,i,f,e,r=0,s=u.length;r<s;r++){if(i=n,f=u[r].tags,e=u[r].attr,i&&t.ofType(i,f)&&o(i,e))return i;while(i)if(i=t.parentOfType(i,f),i&&o(i,e))return i}return null},isFormatted:function(n){for(var t=0,i=n.length;t<i;t++)if(this.findFormat(n[t]))return!0;return!1}}),y=g.extend({init:function(n,t){this.finder=new a(n);this.attributes=c({},n[0].attr,t);this.tag=n[0].tags[0]},wrap:function(n){return t.wrap(n,t.create(n.ownerDocument,this.tag,this.attributes))},activate:function(n,t){this.finder.isFormatted(t)?(this.split(n),this.remove(t)):this.apply(t)},toggle:function(n){var t=b.textNodes(n);t.length>0&&this.activate(n,t)},apply:function(n){for(var f=[],i,r,u=0,e=n.length;u<e;u++){if(i=n[u],r=this.finder.findSuitable(i),r)t.attr(r,this.attributes);else{while(!t.isBlock(i.parentNode)&&i.parentNode.childNodes.length==1)i=i.parentNode;r=this.wrap(i)}f.push(r)}this.consolidate(f)},remove:function(n){for(var i,r=0,u=n.length;r<u;r++)i=this.finder.findFormat(n[r]),i&&(this.attributes&&this.attributes.style?(t.unstyle(i,this.attributes.style),i.style.cssText||i.attributes["class"]||t.unwrap(i)):t.unwrap(i))},split:function(n){var r=b.textNodes(n),u=r.length,t,i;if(u>0)for(t=0;t<u;t++)i=this.finder.findFormat(r[t]),i&&b.split(n,i,!0)},consolidate:function(n){for(var i,r;n.length>1;)if(i=n.pop(),r=n[n.length-1],i.previousSibling&&i.previousSibling.className==v&&r.appendChild(i.previousSibling),i.tagName==r.tagName&&i.previousSibling==r&&i.style.cssText==r.style.cssText){while(i.firstChild)r.appendChild(i.firstChild);t.remove(i)}}}),p=a.extend({init:function(n,t){this.format=n;this.greedyProperty=t;a.fn.init.call(this,n)},getInlineCssValue:function(i){var e=i.attributes,o=n.trim,r,v,u,y,p,s,h,f,w,c,l,a;if(e)for(r=0,v=e.length;r<v;r++)if(u=e[r],y=u.nodeName,p=u.nodeValue,u.specified&&y=="style")for(s=o(p||i.style.cssText).split(";"),f=0,w=s.length;f<w;f++)if(h=s[f],h.length){if(c=h.split(":"),l=o(c[0].toLowerCase()),a=o(c[1]),l!=this.greedyProperty)continue;return l.indexOf("color")>=0?t.toHex(a):a}},getFormatInner:function(i){for(var o=n(t.isDataNode(i)?i.parentNode:i),u=o.parentsUntil("[contentEditable]").addBack().toArray().reverse(),f,r=0,e=u.length;r<e;r++)if(f=this.greedyProperty=="className"?u[r].className:this.getInlineCssValue(u[r]),f)return f;return"inherit"},getFormat:function(n){for(var i=this.getFormatInner(n[0]),t=1,r=n.length;t<r;t++)if(i!=this.getFormatInner(n[t]))return"";return i},isFormatted:function(n){return this.getFormat(n)!==""}}),k=y.extend({init:function(n,t,i){y.fn.init.call(this,n,t);this.values=t;this.finder=new p(n,i);i&&(this.greedyProperty=e.toCamelCase(i))},activate:function(n,t){var i=this.greedyProperty,r="apply";this.split(n);i&&this.values.style[i]=="inherit"&&(r="remove");this[r](t)}}),o=nt.extend({init:function(n){nt.fn.init.call(this,c(n,{finder:new a(n.format),formatter:function(){return new y(n.format)}}))}}),tt=h.extend({update:function(n,t){var i=n.data(this.type);i.close();i.value(this.finder.getFormat(t))}}),d=tt.extend({init:function(n){h.fn.init.call(this,n);this.type=e.support.browser.msie||e.support.touch?"kendoDropDownList":"kendoComboBox";this.format=[{tags:["span"]}];this.finder=new p(this.format,n.cssAttr)},command:function(n){var t=this.options,u=this.format,r={};return new i.FormatCommand(c(n,{formatter:function(){return r[t.domAttr]=n.value,new k(u,{style:r},t.cssAttr)}}))},initialize:function(n,t){var r=t.editor,i=this.options,u=i.name,f,e=[];i.defaultValue&&(e=[{text:r.options.messages[i.defaultValue[0].text],value:i.defaultValue[0].value}]);f=e.concat(i.items?i.items:r.options[u]||[]);n[this.type]({dataTextField:"text",dataValueField:"value",dataSource:f,change:function(){h.exec(r,u,this.value())},highlightFirst:!1});n.closest(".k-widget").removeClass("k-"+u).find("*").addBack().attr("unselectable","on");n.data(this.type).value("inherit")}}),w=h.extend({init:function(n){h.fn.init.call(this,n);this.format=[{tags:["span"]}];this.finder=new p(this.format,n.cssAttr)},options:{palette:"websafe"},update:function(){this._widget.close()},command:function(n){var t=this.options,u=this.format,r={};return new i.FormatCommand(c(n,{formatter:function(){return r[t.domAttr]=n.value,new k(u,{style:r},t.cssAttr)}}))},initialize:function(n,t){var i=t.editor,u=this.name,r=c({},w.fn.options,this.options),f=r.palette;n=this._widget=new e.ui.ColorPicker(n,{toolIcon:"k-"+r.name,palette:f,change:function(){var t=n.value();t&&h.exec(i,u,t);i.focus()},activate:function(t){t.preventDefault();n.trigger("change")}});n.wrapper.attr({title:t.title,unselectable:"on"}).find("*").attr("unselectable","on")}});c(i,{InlineFormatFinder:a,InlineFormatter:y,DelayedExecutionTool:tt,GreedyInlineFormatFinder:p,GreedyInlineFormatter:k,InlineFormatTool:o,FontTool:d,ColorTool:w});l("bold",[{tags:["strong","b"]},{tags:["span"],attr:{style:{fontWeight:"bold"}}}]);f("bold",new o({key:"B",ctrl:!0,format:s.bold,template:new u({template:r.buttonTemplate,title:"Bold"})}));l("italic",[{tags:["em","i"]},{tags:["span"],attr:{style:{fontStyle:"italic"}}}]);f("italic",new o({key:"I",ctrl:!0,format:s.italic,template:new u({template:r.buttonTemplate,title:"Italic"})}));l("underline",[{tags:["span"],attr:{style:{textDecoration:"underline"}}},{tags:["u"]}]);f("underline",new o({key:"U",ctrl:!0,format:s.underline,template:new u({template:r.buttonTemplate,title:"Underline"})}));l("strikethrough",[{tags:["del","strike"]},{tags:["span"],attr:{style:{textDecoration:"line-through"}}}]);f("strikethrough",new o({format:s.strikethrough,template:new u({template:r.buttonTemplate,title:"Strikethrough"})}));l("superscript",[{tags:["sup"]}]);f("superscript",new o({format:s.superscript,template:new u({template:r.buttonTemplate,title:"Superscript"})}));l("subscript",[{tags:["sub"]}]);f("subscript",new o({format:s.subscript,template:new u({template:r.buttonTemplate,title:"Subscript"})}));f("foreColor",new w({cssAttr:"color",domAttr:"color",name:"foreColor",template:new u({template:r.colorPickerTemplate,title:"Color"})}));f("backColor",new w({cssAttr:"background-color",domAttr:"backgroundColor",name:"backColor",template:new u({template:r.colorPickerTemplate,title:"Background Color"})}));f("fontName",new d({cssAttr:"font-family",domAttr:"fontFamily",name:"fontName",defaultValue:[{text:"fontNameInherit",value:"inherit"}],template:new u({template:r.comboBoxTemplate,title:"Font Name"})}));f("fontSize",new d({cssAttr:"font-size",domAttr:"fontSize",name:"fontSize",defaultValue:[{text:"fontSizeInherit",value:"inherit"}],template:new u({template:r.comboBoxTemplate,title:"Font Size"})}))})(window.kendo.jQuery)}(),function(){(function(n){var a=window.kendo,v=a.Class,y=n.extend,r=a.ui.editor,e=a.ui.Editor.fn.options.formats,t=r.Dom,w=r.Command,o=r.ToolTemplate,b=r.FormatTool,i=r.EditorUtils,s=i.registerTool,h=i.registerFormat,p=r.RangeUtils,c=v.extend({init:function(n){this.format=n},contains:function(n,i){for(var u,r=0,f=i.length;r<f;r++)if(u=i[r],!u||!t.isAncestorOrSelf(n,u))return!1;return!0},findSuitable:function(i){for(var s=this.format,u=[],f,e,r=0,o=i.length;r<o;r++){for(e=s.length-1;e>=0;e--)if(f=t.ofType(i[r],s[e].tags)?i[r]:t.parentOfType(i[r],s[e].tags),f)break;if(!f||f.contentEditable==="true")return[];n.inArray(f,u)<0&&u.push(f)}for(r=0,o=u.length;r<o;r++)if(this.contains(u[r],u))return[u[r]];return u},findFormat:function(n){for(var u=this.format,i,e,o,s=t.editableParent(n),r=0,f=u.length;r<f;r++)for(i=n,e=u[r].tags,o=u[r].attr;i&&t.isAncestorOf(s,i);){if(t.ofType(i,e)&&t.attrEquals(i,o))return i;i=i.parentNode}return null},getFormat:function(n){var e=this,u=function(n){return e.findFormat(t.isDataNode(n)?n.parentNode:n)},r=u(n[0]),i,f;if(!r)return"";for(i=1,f=n.length;i<f;i++)if(r!=u(n[i]))return"";return r.nodeName.toLowerCase()},isFormatted:function(n){for(var t=0,i=n.length;t<i;t++)if(!this.findFormat(n[t]))return!1;return!0}}),l=v.extend({init:function(n,t){this.format=n;this.values=t;this.finder=new c(n)},wrap:function(n,i,r){var f=r.length==1?t.blockParentOrBody(r[0]):t.commonAncestor.apply(null,r);t.isInline(f)&&(f=t.blockParentOrBody(f));for(var s=t.significantChildNodes(f),h=t.findNodeIndex(s[0]),u=t.create(f.ownerDocument,n,i),e,o=0;o<s.length;o++){if(e=s[o],t.isBlock(e)){t.attr(e,i);u.childNodes.length&&(t.insertBefore(u,e),u=u.cloneNode(!1));h=t.findNodeIndex(e)+1;continue}u.appendChild(e)}u.firstChild&&t.insertAt(f,u,h)},apply:function(r){function o(n){return y({},n&&n.attr,l)}var u,l=this.values,h=t.filter("img",r),a=i.formatByName("img",this.format),v=o(a),s,f,e,c;if(n.each(h,function(){t.attr(this,v)}),h.length!=r.length)if(s=t.filter("img",r,!0),f=this.finder.findSuitable(s),f.length)for(e=0,c=f.length;e<c;e++)u=i.formatByName(t.name(f[e]),this.format),t.attr(f[e],o(u));else u=this.format[0],this.wrap(u.tags[0],o(u),s)},remove:function(n){for(var r,u,e,f=0,o=n.length;f<o;f++)r=this.finder.findFormat(n[f]),r&&(e=t.name(r),e!="div"||r.getAttribute("class")?(u=i.formatByName(e,this.format),u.attr.style&&t.unstyle(r,u.attr.style),u.attr.className&&t.removeClass(r,u.attr.className)):t.unwrap(r))},toggle:function(n){var t=this,i=p.nodes(n);t.finder.isFormatted(i)?t.remove(i):t.apply(i)}}),k=v.extend({init:function(n,t){var i=this;i.format=n;i.values=t;i.finder=new c(n)},apply:function(n){var f=this.format,u=t.blockParents(n),e=f[0].tags[0],i,h,c,a,o,v,s;if(u.length)for(i=0,h=u.length;i<h;i++)s=t.name(u[i]),s=="li"?(c=u[i].parentNode,a=new r.ListFormatter(c.nodeName.toLowerCase(),e),o=this.editor.createRange(),o.selectNode(u[i]),a.toggle(o)):e&&(s=="td"||u[i].attributes.contentEditable)?new l(f,this.values).apply(u[i].childNodes):(v=t.changeTag(u[i],e),t.attr(v,f[0].attr));else new l(f,this.values).apply(n)},toggle:function(n){var i=p.textNodes(n);i.length||(n.selectNodeContents(n.commonAncestorContainer),i=p.textNodes(n),i.length||(i=t.significantChildNodes(n.commonAncestorContainer)));this.apply(i)}}),d=w.extend({init:function(n){n.formatter=n.formatter();w.fn.init.call(this,n)}}),u=b.extend({init:function(n){b.fn.init.call(this,y(n,{finder:new c(n.format),formatter:function(){return new l(n.format)}}))}}),f;y(r,{BlockFormatFinder:c,BlockFormatter:l,GreedyBlockFormatter:k,FormatCommand:d,BlockFormatTool:u});f=["ul","ol","li"];h("justifyLeft",[{tags:t.nonListBlockElements,attr:{style:{textAlign:"left"}}},{tags:["img"],attr:{style:{float:"left",display:"",marginLeft:"",marginRight:""}}},{tags:f,attr:{style:{textAlign:"left",listStylePosition:""}}}]);s("justifyLeft",new u({format:e.justifyLeft,template:new o({template:i.buttonTemplate,title:"Justify Left"})}));h("justifyCenter",[{tags:t.nonListBlockElements,attr:{style:{textAlign:"center"}}},{tags:["img"],attr:{style:{display:"block",marginLeft:"auto",marginRight:"auto",float:""}}},{tags:f,attr:{style:{textAlign:"center",listStylePosition:"inside"}}}]);s("justifyCenter",new u({format:e.justifyCenter,template:new o({template:i.buttonTemplate,title:"Justify Center"})}));h("justifyRight",[{tags:t.nonListBlockElements,attr:{style:{textAlign:"right"}}},{tags:["img"],attr:{style:{float:"right",display:"",marginLeft:"",marginRight:""}}},{tags:f,attr:{style:{textAlign:"right",listStylePosition:"inside"}}}]);s("justifyRight",new u({format:e.justifyRight,template:new o({template:i.buttonTemplate,title:"Justify Right"})}));h("justifyFull",[{tags:t.nonListBlockElements,attr:{style:{textAlign:"justify"}}},{tags:["img"],attr:{style:{display:"block",marginLeft:"auto",marginRight:"auto",float:""}}},{tags:f,attr:{style:{textAlign:"justify",listStylePosition:""}}}]);s("justifyFull",new u({format:e.justifyFull,template:new o({template:i.buttonTemplate,title:"Justify Full"})}))})(window.kendo.jQuery)}(),function(){(function(n){var e=window.kendo,l=n.extend,i=e.ui.editor,t=i.Dom,u=i.Command,o=i.Tool,a=i.BlockFormatter,f=t.normalize,r=i.RangeUtils,s=i.EditorUtils.registerTool,h=u.extend({init:function(n){this.options=n;u.fn.init.call(this,n)},_insertMarker:function(n,i){var r=t.create(n,"a"),u;return r.className="k-marker",i.insertNode(r),r.parentNode||(u=i.commonAncestorContainer,u.innerHTML="",u.appendChild(r)),f(r.parentNode),r},_moveFocus:function(n,i){if(t.isEmpty(i))n.setStartBefore(i);else{n.selectNodeContents(i);var u=r.textNodes(n)[0];if(!u){while(i.childNodes.length&&!t.is(i.firstChild,"br"))i=i.firstChild;u=i}t.isEmpty(u)?n.setStartBefore(u):(t.emptyNode(u)&&(u.innerHTML="﻿"),n.setStartBefore(u.firstChild||u))}},shouldTrim:function(n){var i="p,h1,h2,h3,h4,h5,h6".split(","),r=t.parentOfType(n.startContainer,i),u=t.parentOfType(n.endContainer,i);return r&&!u||!r&&u},_blankAfter:function(n){while(n&&(t.isMarker(n)||t.stripBom(n.nodeValue)===""))n=n.nextSibling;return!n},exec:function(){var e=this.getRange(),v=r.documentFromRange(e),l,o,n,p=i.emptyElementContent,s,h,u,c,y,w=this.shouldTrim(e);e.deleteContents();h=this._insertMarker(v,e);u=t.closestEditableOfType(h,["li"]);c=t.closestEditableOfType(h,"h1,h2,h3,h4,h5,h6".split(","));u?t.emptyNode(u)&&(s=t.create(v,"p"),u.nextSibling&&(y=e.cloneRange(),y.selectNode(u),r.split(y,u.parentNode)),t.insertAfter(s,u.parentNode),t.remove(u.parentNode.childNodes.length==1?u.parentNode:u),s.innerHTML=p,n=s):c&&this._blankAfter(h)&&(s=t.create(v,"p"),t.insertAfter(s,c),s.innerHTML=p,t.remove(h),n=s);n||(u||c||new a([{tags:["p"]}]).apply([h]),e.selectNode(h),l=t.parentOfType(h,[u?"li":c?t.name(c):"p"]),r.split(e,l,w),o=l.previousSibling,t.is(o,"li")&&o.firstChild&&!t.is(o.firstChild,"br")&&(o=o.firstChild),n=l.nextSibling,this.clean(o),this.clean(n,{links:!0}),t.is(n,"li")&&n.firstChild&&!t.is(n.firstChild,"br")&&(n=n.firstChild),t.remove(l),f(o));f(n);this._moveFocus(e,n);e.collapse(!0);t.scrollTo(n);r.selectRange(e)},clean:function(r,u){var e=r,f;if(r.firstChild&&t.is(r.firstChild,"br")&&t.remove(r.firstChild),t.isDataNode(r)&&!r.nodeValue&&(r=r.parentNode),r){for(f=!1;r.firstChild&&r.firstChild.nodeType==1;)f=f||t.significantNodes(r.childNodes).length>1,r=r.firstChild;if(t.isEmpty(r)||!/^\s*$/.test(r.innerHTML)||f||(n(e).find(".k-br").remove(),r.innerHTML=i.emptyElementContent),u&&u.links)while(r!=e){if(t.is(r,"a")&&t.emptyNode(r)){t.unwrap(r);break}r=r.parentNode}}}}),c=u.extend({init:function(n){this.options=n;u.fn.init.call(this,n)},exec:function(){var i=this.getRange(),n=t.create(r.documentFromRange(i),"br"),u,o=e.support.browser,s=o.msie&&o.version<11;i.deleteContents();i.insertNode(n);f(n.parentNode);s||n.nextSibling&&!t.isWhitespace(n.nextSibling)||(u=n.cloneNode(!0),u.className="k-br",t.insertAfter(u,n));i.setStartAfter(n);i.collapse(!0);t.scrollTo(n.nextSibling||n);r.selectRange(i)}});l(i,{ParagraphCommand:h,NewLineCommand:c});s("insertLineBreak",new o({key:13,shift:!0,command:c}));s("insertParagraph",new o({key:13,command:h}))})(window.kendo.jQuery)}(),function(){(function(n){var s=window.kendo,b=s.Class,u=n.extend,i=s.ui.editor,t=i.Dom,f=i.RangeUtils,h=i.EditorUtils,c=i.Command,l=i.ToolTemplate,a=i.FormatTool,v=i.BlockFormatFinder,e=f.textNodes,y=i.EditorUtils.registerTool,r=v.extend({init:function(n){this.tag=n;var t=this.tags=[n=="ul"?"ol":"ul",n];v.fn.init.call(this,[{tags:t}])},isFormatted:function(n){for(var r=[],u,i=0;i<n.length;i++)u=this.findFormat(n[i]),u&&t.name(u)==this.tag&&r.push(u);if(r.length<1||r.length!=n.length)return!1;for(i=0;i<r.length;i++){if(r[i].parentNode!=u.parentNode)break;if(r[i]!=u)return!1}return!0},findSuitable:function(n){var i=this.findFormat(n[0]);return i&&t.name(i)==this.tag?i:null}}),p=b.extend({init:function(n,t){var i=this;i.finder=new r(n);i.tag=n;i.unwrapTag=t},isList:function(n){var i=t.name(n);return i=="ul"||i=="ol"||i=="dl"},wrap:function(n,i){for(var u=t.create(n.ownerDocument,"li"),r,f=0;f<i.length;f++){if(r=i[f],t.is(r,"li")){n.appendChild(r);continue}if(this.isList(r)){while(r.firstChild)n.appendChild(r.firstChild);continue}if(t.is(r,"td")){while(r.firstChild)u.appendChild(r.firstChild);n.appendChild(u);r.appendChild(n);n=n.cloneNode(!1);u=u.cloneNode(!1);continue}u.appendChild(r);t.isBlock(r)&&(n.appendChild(u),t.unwrap(r),u=u.cloneNode(!1))}u.firstChild&&n.appendChild(u)},containsAny:function(n,i){for(var r=0;r<i.length;r++)if(t.isAncestorOrSelf(n,i[r]))return!0;return!1},suitable:function(n,i){if(n.className=="k-marker"){var r=n.nextSibling;if(r&&t.isBlock(r)||(r=n.previousSibling,r&&t.isBlock(r)))return!1}return this.containsAny(n,i)||t.isInline(n)||n.nodeType==3},_parentLists:function(i){var r=t.closestEditable(i);return n(i).parentsUntil(r,"ul,ol")},split:function(n){var i=e(n),s,h,o,r,c,u;if(i.length)for(s=t.parentOfType(i[0],["li"]),h=t.parentOfType(i[i.length-1],["li"]),n.setStartBefore(s),n.setEndAfter(h),r=0,c=i.length;r<c;r++)u=this.finder.findFormat(i[r]),u&&(o=this._parentLists(u),o.length?f.split(n,o.last()[0],!0):f.split(n,u,!0))},merge:function(n,i){for(var u=i.previousSibling,r;u&&(u.className=="k-marker"||u.nodeType==3&&t.isWhitespace(u));)u=u.previousSibling;if(u&&t.name(u)==n){while(i.firstChild)u.appendChild(i.firstChild);t.remove(i);i=u}for(r=i.nextSibling;r&&(r.className=="k-marker"||r.nodeType==3&&t.isWhitespace(r));)r=r.nextSibling;if(r&&t.name(r)==n){while(i.lastChild)r.insertBefore(i.lastChild,r.firstChild);t.remove(i)}},breakable:function(n){return n!=n.ownerDocument.body&&!/table|tbody|tr|td/.test(t.name(n))&&!n.attributes.contentEditable},applyOnSection:function(i,u){function v(){s.push(this)}var h=this.tag,c=t.closestSplittableParent(u),s=[],f=this.finder.findSuitable(u),e,l,o,a;for(f||(f=new r(h=="ul"?"ol":"ul").findSuitable(u)),/table|tbody/.test(t.name(c))?e=n.map(u,function(n){return t.parentOfType(n,["td"])}):(e=t.significantChildNodes(c),n.grep(e,t.isBlock).length&&(e=n.grep(e,n.proxy(function(n){return this.containsAny(n,u)},this))),e.length||(e=u)),l=0;l<e.length;l++)(o=e[l],a=(!f||!t.isAncestorOrSelf(f,o))&&this.suitable(o,u),a)&&(f&&this.isList(o)?(n.each(o.childNodes,v),t.remove(o)):s.push(o));s.length==e.length&&this.breakable(c)&&(s=[c]);f||(f=t.create(c.ownerDocument,h),t.insertBefore(f,s[0]));this.wrap(f,s);t.is(f,h)||t.changeTag(f,h);this.merge(h,f)},apply:function(n){var i=0,u=[],r,f,e;do e=t.closestEditable(n[i],["td","body"]),r&&e==r?f.push(n[i]):(r&&u.push({section:r,nodes:f}),f=[n[i]],r=e),i++;while(i<n.length);for(u.push({section:r,nodes:f}),i=0;i<u.length;i++)this.applyOnSection(u[i].section,u[i].nodes)},unwrap:function(n){for(var u=n.ownerDocument.createDocumentFragment(),o=this.unwrapTag,f,i,e,r=n.firstChild;r;r=r.nextSibling){for(i=t.create(n.ownerDocument,o||"p");r.firstChild;)e=r.firstChild,t.isBlock(e)?(i.firstChild&&(u.appendChild(i),i=t.create(n.ownerDocument,o||"p")),u.appendChild(e)):i.appendChild(e);i.firstChild&&u.appendChild(i)}f=this._parentLists(n);f[0]?(t.insertAfter(u,f.last()[0]),f.last().remove()):t.insertAfter(u,n);t.remove(n)},remove:function(n){for(var t,i=0,r=n.length;i<r;i++)t=this.finder.findFormat(n[i]),t&&this.unwrap(t)},toggle:function(n){var i=this,t=e(n),u=n.commonAncestorContainer,r;t.length||(n.selectNodeContents(u),t=e(n),t.length||(r=u.ownerDocument.createTextNode(""),n.startContainer.appendChild(r),t=[r],n.selectNode(r.parentNode)));i.finder.isFormatted(t)?(i.split(n),i.remove(t)):i.apply(t)}}),w=c.extend({init:function(n){n.formatter=new p(n.tag);c.fn.init.call(this,n)}}),o=a.extend({init:function(n){this.options=n;a.fn.init.call(this,u(n,{finder:new r(n.tag)}))},command:function(n){return new w(u(n,{tag:this.options.tag}))}});u(i,{ListFormatFinder:r,ListFormatter:p,ListCommand:w,ListTool:o});y("insertUnorderedList",new o({tag:"ul",template:new l({template:h.buttonTemplate,title:"Insert unordered list"})}));y("insertOrderedList",new o({tag:"ol",template:new l({template:h.buttonTemplate,title:"Insert ordered list"})}))})(window.kendo.jQuery)}(),function(){(function(n){var r=window.kendo,h=r.Class,d=n.extend,u=n.proxy,i=r.ui.editor,t=i.Dom,f=i.RangeUtils,c=i.EditorUtils,e=i.Command,o=i.Tool,l=i.ToolTemplate,a=i.InlineFormatter,g=i.InlineFormatFinder,s=f.textNodes,v=i.EditorUtils.registerTool,y=h.extend({findSuitable:function(n){return t.parentOfType(n,["a"])}}),p=h.extend({init:function(){this.finder=new y},apply:function(n,i){var v=s(n),r,h,c,u,e,l,o;if(i.innerHTML){for(h=f.documentFromRange(n),r=f.getMarkers(n),n.deleteContents(),u=t.create(h,"a",i),n.insertNode(u),e=u.parentNode,t.name(e)=="a"&&t.insertAfter(u,e),t.emptyNode(e)&&t.remove(e),l=u,o=0;o<r.length;o++)t.insertAfter(r[o],l),l=r[o];r.length&&(t.insertBefore(h.createTextNode("﻿"),r[1]),t.insertAfter(h.createTextNode("﻿"),r[1]),n.setStartBefore(r[0]),n.setEndAfter(r[r.length-1]))}else c=new a([{tags:["a"]}],i),c.finder=this.finder,c.apply(v)}}),w=e.extend({init:function(n){n.formatter={toggle:function(n){new a([{tags:["a"]}]).remove(s(n))}};this.options=n;e.fn.init.call(this,n)}}),b=e.extend({init:function(n){this.options=n;e.fn.init.call(this,n);this.formatter=new p;n.url?this.exec=function(){this.formatter.apply(n.range,{href:n.url,innerHTML:n.text||n.url,target:n.target})}:(this.attributes=null,this.async=!0)},_dialogTemplate:function(){return r.template("<div class=\"k-editor-dialog k-popup-edit-form k-edit-form-container\"><div class='k-edit-label'><label for='k-editor-link-url'>#: messages.linkWebAddress #<\/label><\/div><div class='k-edit-field'><input type='text' class='k-input k-textbox' id='k-editor-link-url'><\/div><div class='k-edit-label k-editor-link-text-row'><label for='k-editor-link-text'>#: messages.linkText #<\/label><\/div><div class='k-edit-field k-editor-link-text-row'><input type='text' class='k-input k-textbox' id='k-editor-link-text'><\/div><div class='k-edit-label'><label for='k-editor-link-title'>#: messages.linkToolTip #<\/label><\/div><div class='k-edit-field'><input type='text' class='k-input k-textbox' id='k-editor-link-title'><\/div><div class='k-edit-label'><\/div><div class='k-edit-field'><input type='checkbox' class='k-checkbox' id='k-editor-link-target'><label for='k-editor-link-target' class='k-checkbox-label'>#: messages.linkOpenInNewWindow #<\/label><\/div><div class='k-edit-buttons k-state-default'><button class=\"k-dialog-insert k-button k-primary\">#: messages.dialogInsert #<\/button><button class=\"k-dialog-close k-button\">#: messages.dialogCancel #<\/button><\/div><\/div>")({messages:this.editor.options.messages})},exec:function(){var e=this.editor.options.messages;this._initialText="";this._range=this.lockRange(!0);var r=s(this._range),i=r.length?this.formatter.finder.findSuitable(r[0]):null,o=r.length&&t.name(r[0])=="img",f=this.createDialog(this._dialogTemplate(),{title:e.createLink,close:u(this._close,this),visible:!1});i&&(this._range.selectNodeContents(i),r=s(this._range));this._initialText=this.linkText(r);f.find(".k-dialog-insert").click(u(this._apply,this)).end().find(".k-dialog-close").click(u(this._close,this)).end().find(".k-edit-field input").keydown(u(this._keydown,this)).end().find("#k-editor-link-url").val(this.linkUrl(i)).end().find("#k-editor-link-text").val(this._initialText).end().find("#k-editor-link-title").val(i?i.title:"").end().find("#k-editor-link-target").attr("checked",i?i.target=="_blank":!1).end().find(".k-editor-link-text-row").toggle(!o);this._dialog=f.data("kendoWindow").center().open();n("#k-editor-link-url",f).focus().select()},_keydown:function(n){var t=r.keys;n.keyCode==t.ENTER?this._apply(n):n.keyCode==t.ESC&&this._close(n)},_apply:function(i){var f=this._dialog.element,r=n("#k-editor-link-url",f).val(),e,u,o,s=n("#k-editor-link-text",f);r&&r!="http://"&&(r.indexOf("@")>0&&!/^(\w+:)|(\/\/)/i.test(r)&&(r="mailto:"+r),this.attributes={href:r},e=n("#k-editor-link-title",f).val(),e&&(this.attributes.title=e),s.is(":visible")&&(u=s.val(),u||this._initialText?u&&u!==this._initialText&&(this.attributes.innerHTML=t.stripBom(u)):this.attributes.innerHTML=r),o=n("#k-editor-link-target",f).is(":checked"),this.attributes.target=o?"_blank":null,this.formatter.apply(this._range,this.attributes));this._close(i);this.change&&this.change()},_close:function(n){n.preventDefault();this._dialog.destroy();t.windowFromDocument(f.documentFromRange(this._range)).focus();this.releaseRange(this._range)},linkUrl:function(n){return n?n.getAttribute("href",2):"http://"},linkText:function(n){for(var r="",i=0;i<n.length;i++)r+=n[i].nodeValue;return t.stripBom(r||"")},redo:function(){var n=this.lockRange(!0);this.formatter.apply(n,this.attributes);this.releaseRange(n)}}),k=o.extend({init:function(t){this.options=t;this.finder=new g([{tags:["a"]}]);o.fn.init.call(this,n.extend(t,{command:w}))},initialize:function(n,t){o.fn.initialize.call(this,n,t);n.addClass("k-state-disabled")},update:function(n,t){n.toggleClass("k-state-disabled",!this.finder.isFormatted(t)).removeClass("k-state-hover")}});d(r.ui.editor,{LinkFormatFinder:y,LinkFormatter:p,UnlinkCommand:w,LinkCommand:b,UnlinkTool:k});v("createLink",new o({key:"K",ctrl:!0,command:b,template:new l({template:c.buttonTemplate,title:"Create Link"})}));v("unlink",new k({key:"K",ctrl:!0,shift:!0,template:new l({template:c.buttonTemplate,title:"Remove Link"})}))})(window.kendo.jQuery)}(),function(){(function(n,t){var r=window.kendo,a=n.extend,i=r.ui.editor,o=i.EditorUtils,u=i.Dom,v=o.registerTool,y=i.ToolTemplate,f=i.RangeUtils,s=i.Command,p=i.LinkFormatter,w=f.textNodes,h=r.keys,e="#k-editor-file-url",c="#k-editor-file-title",l=s.extend({init:function(n){var t=this;s.fn.init.call(t,n);t.formatter=new p;t.async=!0;t.attributes={}},insertFile:function(n,t){var i=this.attributes,r=f.documentFromRange(t);if(i.href&&i.href!="http://")if(n)u.attr(n,i);else return n=u.create(r,"a",{href:i.href}),n.innerHTML=i.innerHTML,t.deleteContents(),t.insertNode(n),n.nextSibling||u.insertAfter(r.createTextNode("﻿"),n),t.setStartAfter(n),t.setEndAfter(n),f.selectRange(t),!0;return!1},_dialogTemplate:function(n){return r.template('<div class="k-editor-dialog k-popup-edit-form k-edit-form-container"># if (showBrowser) { #<div class="k-filebrowser"><\/div># } #<div class=\'k-edit-label\'><label for="k-editor-file-url">#: messages.fileWebAddress #<\/label><\/div><div class=\'k-edit-field\'><input type="text" class="k-input k-textbox" id="k-editor-file-url"><\/div><div class=\'k-edit-label\'><label for="k-editor-file-title">#: messages.fileTitle #<\/label><\/div><div class=\'k-edit-field\'><input type="text" class="k-input k-textbox" id="k-editor-file-title"><\/div><div class="k-edit-buttons k-state-default"><button class="k-dialog-insert k-button k-primary">#: messages.dialogInsert #<\/button><button class="k-dialog-close k-button">#: messages.dialogCancel #<\/button><\/div><\/div>')({messages:this.editor.options.messages,showBrowser:n})},redo:function(){var n=this,t=n.lockRange();this.formatter.apply(t,this.attributes);n.releaseRange(t)},exec:function(){function b(t){var r=i.element,u=r.find(e).val().replace(/ /g,"%20"),f=r.find(c).val();n.attributes={href:u,innerHTML:f!==""?f:u};d=n.insertFile(o,l);y(t);n.change&&n.change()}function y(t){t.preventDefault();i.destroy();u.windowFromDocument(f.documentFromRange(l)).focus();d||n.releaseRange(l)}function tt(n){n.keyCode==h.ENTER?b(n):n.keyCode==h.ESC&&y(n)}var n=this,l=n.lockRange(),k=w(l),d=!1,o=k.length?this.formatter.finder.findSuitable(k[0]):null,i,g=n.editor.options,nt=g.messages,v=g.fileBrowser,s=!!(r.ui.FileBrowser&&v&&v.transport&&v.transport.read!==t),p={title:nt.insertFile,visible:!1,resizable:s};p.close=y;s&&(p.width=750);i=this.createDialog(n._dialogTemplate(s),p).toggleClass("k-filebrowser-dialog",s).find(".k-dialog-insert").click(b).end().find(".k-dialog-close").click(y).end().find(".k-edit-field input").keydown(tt).end().find(e).val(o?o.getAttribute("href",2):"http://").end().find(c).val(o?o.title:"").end().data("kendoWindow");s&&(n._fileBrowser=new r.ui.FileBrowser(i.element.find(".k-filebrowser"),a({},v,{change:function(){i.element.find(e).val(this.value())},apply:b})));i.center().open();i.element.find(e).focus().select()}});r.ui.editor.FileCommand=l;v("insertFile",new i.Tool({command:l,template:new y({template:o.buttonTemplate,title:"Insert File"})}))})(window.kendo.jQuery)}(),function(){(function(n,t){var i=window.kendo,y=n.extend,r=i.ui.editor,o=r.EditorUtils,f=r.Dom,p=o.registerTool,w=r.ToolTemplate,u=r.RangeUtils,s=r.Command,h=i.keys,e="#k-editor-image-url",c="#k-editor-image-title",l="#k-editor-image-width",a="#k-editor-image-height",v=s.extend({init:function(n){var t=this;s.fn.init.call(t,n);t.async=!0;t.attributes={}},insertImage:function(n,t){var i=this.attributes,e=u.documentFromRange(t),r;if(i.src&&i.src!="http://")if(r=function(){setTimeout(function(){i.width||n.removeAttribute("width");i.height||n.removeAttribute("height");n.removeAttribute("complete")})},n)n.onload=n.onerror=r,f.attr(n,i),r();else return n=f.create(e,"img",i),n.onload=n.onerror=r,t.deleteContents(),t.insertNode(n),n.nextSibling||f.insertAfter(e.createTextNode("﻿"),n),r(),t.setStartAfter(n),t.setEndAfter(n),u.selectRange(t),!0;return!1},_dialogTemplate:function(n){return i.template('<div class="k-editor-dialog k-popup-edit-form k-edit-form-container"># if (showBrowser) { #<div class="k-filebrowser k-imagebrowser"><\/div># } #<div class=\'k-edit-label\'><label for="k-editor-image-url">#: messages.imageWebAddress #<\/label><\/div><div class=\'k-edit-field\'><input type="text" class="k-input k-textbox" id="k-editor-image-url"><\/div><div class=\'k-edit-label\'><label for="k-editor-image-title">#: messages.imageAltText #<\/label><\/div><div class=\'k-edit-field\'><input type="text" class="k-input k-textbox" id="k-editor-image-title"><\/div><div class=\'k-edit-label\'><label for="k-editor-image-width">#: messages.imageWidth #<\/label><\/div><div class=\'k-edit-field\'><input type="text" class="k-input k-textbox" id="k-editor-image-width"><\/div><div class=\'k-edit-label\'><label for="k-editor-image-height">#: messages.imageHeight #<\/label><\/div><div class=\'k-edit-field\'><input type="text" class="k-input k-textbox" id="k-editor-image-height"><\/div><div class="k-edit-buttons k-state-default"><button class="k-dialog-insert k-button k-primary">#: messages.dialogInsert #<\/button><button class="k-dialog-close k-button">#: messages.dialogCancel #<\/button><\/div><\/div>')({messages:this.editor.options.messages,showBrowser:n})},redo:function(){var n=this,t=n.lockRange();n.insertImage(u.image(t),t)||n.releaseRange(t)},exec:function(){function k(t){var i=o.element,u=parseInt(i.find(l).val(),10),f=parseInt(i.find(a).val(),10);n.attributes={src:i.find(e).val().replace(/ /g,"%20"),alt:i.find(c).val()};n.attributes.width=null;n.attributes.height=null;!isNaN(u)&&u>0&&(n.attributes.width=u);!isNaN(f)&&f>0&&(n.attributes.height=f);d=n.insertImage(r,v);w(t);n.change&&n.change()}function w(t){t.preventDefault();o.destroy();f.windowFromDocument(u.documentFromRange(v)).focus();d||n.releaseRange(v)}function rt(n){n.keyCode==h.ENTER?k(n):n.keyCode==h.ESC&&w(n)}var n=this,v=n.lockRange(),d=!1,r=u.image(v),nt=r&&r.getAttribute("width")||"",tt=r&&r.getAttribute("height")||"",o,g=n.editor.options,it=g.messages,p=g.imageBrowser,s=!!(i.ui.ImageBrowser&&p&&p.transport&&p.transport.read!==t),b={title:it.insertImage,visible:!1,resizable:s};b.close=w;s&&(b.width=750);o=this.createDialog(n._dialogTemplate(s),b).toggleClass("k-filebrowser-dialog",s).find(".k-dialog-insert").click(k).end().find(".k-dialog-close").click(w).end().find(".k-edit-field input").keydown(rt).end().find(e).val(r?r.getAttribute("src",2):"http://").end().find(c).val(r?r.alt:"").end().find(l).val(nt).end().find(a).val(tt).end().data("kendoWindow");s&&(this._imageBrowser=new i.ui.ImageBrowser(o.element.find(".k-imagebrowser"),y({},p,{change:function(){o.element.find(e).val(this.value())},apply:k})));o.center().open();o.element.find(e).focus().select()}});i.ui.editor.ImageCommand=v;p("insertImage",new r.Tool({command:v,template:new w({template:o.buttonTemplate,title:"Insert Image"})}))})(window.kendo.jQuery)}(),function(){(function(n,t){var i=window.kendo,r=i.ui.DropDownList,u=i.ui.editor.Dom,f=r.extend({init:function(t,u){var f=this;r.fn.init.call(f,t,u);i.support.mobileOS.ios&&(this._initSelectOverlay(),this.bind("dataBound",n.proxy(this._initSelectOverlay,this)));f.text(f.options.title);f.bind("open",function(){if(f.options.autoSize){var t=f.list,n;t.css({whiteSpace:"nowrap",width:"auto"});n=t.width();n?n+=20:n=f._listWidth;t.css("width",n+i.support.scrollbar());f._listWidth=n}})},options:{name:"SelectBox",index:-1},_initSelectOverlay:function(){for(var e,o,u=this,c=u.value(),s=this.dataSource.view(),t,r="",h=i.htmlEncode,f=0;f<s.length;f++)t=s[f],r+="<option value='"+h(t.value)+"'",t.value==c&&(r+=" selected"),r+=">"+h(t.text)+"<\/option>";e=n("<select class='k-select-overlay'>"+r+"<\/select>");o=n(this.element).closest(".k-widget");o.next(".k-select-overlay").remove();e.insertAfter(o);e.on("change",function(){u.value(this.value);u.trigger("change")})},value:function(n){var i=this,u=r.fn.value.call(i,n);if(n===t)return u;r.fn.value.call(i)||i.text(i.options.title)},decorate:function(t){var e=this,o=e.dataSource,r=o.data(),i,s,h,f;for(t&&e.list.css("background-color",u.getEffectiveBackground(n(t))),i=0;i<r.length;i++)s=r[i].tag||"span",h=r[i].className,f=u.inlineStyle(t,s,{className:h}),f=f.replace(/"/g,"'"),r[i].style=f+";display:inline-block";o.trigger("change")}});i.ui.plugin(f);i.ui.editor.SelectBox=f})(window.kendo.jQuery)}(),function(){(function(n,t){function u(r,u){var o=n(r).css("direction")=="rtl",e=o?"Right":"Left",f=i.name(r)!="td"?"margin"+e:"padding"+e;if(u===t)return r.style[f]||0;u>0?r.style[f]=u+"px":(r.style[f]="",r.style.cssText||r.removeAttribute("style"))}var h=window.kendo,b=h.Class,k=n.extend,r=h.ui.editor,i=r.Dom,o=r.EditorUtils,c=o.registerTool,f=r.Command,e=r.Tool,l=r.ToolTemplate,a=r.RangeUtils,d=i.blockElements,v=r.BlockFormatFinder,g=r.BlockFormatter,s=b.extend({init:function(){this.finder=new v([{tags:i.blockElements}])},apply:function(t){var s=this.finder.findSuitable(t),e=[],o,v,r,a,h,l,f,y,c,p;if(s.length){for(o=0,v=s.length;o<v;o++)i.is(s[o],"li")?n(s[o]).index()?n.inArray(s[o].parentNode,e)<0&&e.push(s[o]):e.push(s[o].parentNode):e.push(s[o]);while(e.length)if(r=e.shift(),i.is(r,"li"))if(a=r.parentNode,h=n(r).prev("li"),l=h.find("ul,ol").last(),f=n(r).children("ul,ol")[0],f&&h[0])l[0]?(l.append(r),l.append(n(f).children()),i.remove(f)):(h.append(f),f.insertBefore(r,f.firstChild));else for(f=h.children("ul,ol")[0],f||(f=i.create(r.ownerDocument,i.name(a)),h.append(f));r&&r.parentNode==a;)f.appendChild(r),r=e.shift();else for(y=parseInt(u(r),10)+30,u(r,y),c=0;c<e.length;c++)n.contains(r,e[c])&&e.splice(c,1)}else p=new g([{tags:["p"]}],{style:{marginLeft:30}}),p.apply(t)},remove:function(t){for(var s=this.finder.findSuitable(t),r,i,e,h,f,l,o=0,c=s.length;o<c;o++){if(f=n(s[o]),f.is("li"))if(i=f.parent(),e=i.parent(),e.is("li,ul,ol")&&!u(i[0])){if(r&&n.contains(r,e[0]))continue;h=f.nextAll("li");h.length&&n(i[0].cloneNode(!1)).appendTo(f).append(h);e.is("li")?f.insertAfter(e):f.appendTo(e);i.children("li").length||i.remove();continue}else{if(r==i[0])continue;r=i[0]}else r=s[o];l=parseInt(u(r),10)-30;u(r,l)}}}),y=f.extend({init:function(n){n.formatter={toggle:function(n){(new s).apply(a.nodes(n))}};f.fn.init.call(this,n)}}),p=f.extend({init:function(n){n.formatter={toggle:function(n){(new s).remove(a.nodes(n))}};f.fn.init.call(this,n)}}),w=e.extend({init:function(n){e.fn.init.call(this,n);this.finder=new v([{tags:d}])},initialize:function(n,t){e.fn.initialize.call(this,n,t);n.addClass("k-state-disabled")},update:function(t,r){for(var e=this.finder.findSuitable(r),o,s,f=0,h=e.length;f<h;f++)if(o=u(e[f]),o||(s=n(e[f]).parents("ul,ol").length,o=i.is(e[f],"li")&&(s>1||u(e[f].parentNode))||i.ofType(e[f],["ul","ol"])&&s>0),o){t.removeClass("k-state-disabled");return}t.addClass("k-state-disabled").removeClass("k-state-hover")}});k(r,{IndentFormatter:s,IndentCommand:y,OutdentCommand:p,OutdentTool:w});c("indent",new e({command:y,template:new l({template:o.buttonTemplate,title:"Indent"})}));c("outdent",new w({command:p,template:new l({template:o.buttonTemplate,title:"Outdent"})}))})(window.kendo.jQuery)}(),function(){(function(n){var r=window.kendo,f=n.extend,t=r.ui.editor,e=t.EditorUtils,u=t.Command,o=t.Tool,s=t.ToolTemplate,i=u.extend({init:function(n){var t=this;t.options=n;u.fn.init.call(t,n);t.attributes=null;t.async=!0},exec:function(){function c(n){t.value(u.find(e).val());o(n);f.change&&f.change();t.trigger("change")}function o(n){n.preventDefault();u.data("kendoWindow").destroy();t.focus()}var f=this,t=f.editor,s=t.options.messages,u=n(r.template(i.template)(s)).appendTo(document.body),h=i.indent(t.value()),e=".k-editor-textarea";this.createDialog(u,{title:s.viewHtml,close:o,visible:!1}).find(e).val(h).end().find(".k-dialog-update").click(c).end().find(".k-dialog-close").click(o).end().data("kendoWindow").center().open();u.find(e).focus()}});f(i,{template:"<div class='k-editor-dialog k-popup-edit-form k-edit-form-container k-viewhtml-dialog'><textarea class='k-editor-textarea k-input'><\/textarea><div class='k-edit-buttons k-state-default'><button class='k-dialog-update k-button k-primary'>#: dialogUpdate #<\/button><button class='k-dialog-close k-button'>#: dialogCancel #<\/button><\/div><\/div>",indent:function(n){return n.replace(/<\/(p|li|ul|ol|h[1-6]|table|tr|td|th)>/ig,"<\/$1>\n").replace(/<(ul|ol)([^>]*)><li/ig,"<$1$2>\n<li").replace(/<br \/>/ig,"<br />\n").replace(/\n$/,"")}});r.ui.editor.ViewHtmlCommand=i;t.EditorUtils.registerTool("viewHtml",new o({command:i,template:new s({template:e.buttonTemplate,title:"View HTML"})}))})(window.kendo.jQuery)}(),function(){(function(n){var r=window.kendo,t=r.ui.editor,u=t.Tool,e=t.ToolTemplate,o=t.DelayedExecutionTool,l=t.Command,i=t.Dom,f=t.EditorUtils,a=t.RangeUtils,s=f.registerTool,h=o.extend({init:function(n){var t=this;u.fn.init.call(t,r.deepExtend({},t.options,n));t.type="kendoSelectBox";t.finder={getFormat:function(){return""}}},options:{items:[{text:"Paragraph",value:"p"},{text:"Quotation",value:"blockquote"},{text:"Heading 1",value:"h1"},{text:"Heading 2",value:"h2"},{text:"Heading 3",value:"h3"},{text:"Heading 4",value:"h4"},{text:"Heading 5",value:"h5"},{text:"Heading 6",value:"h6"}],width:110},toFormattingItem:function(n){var t=n.value,i;return t?n.tag||n.className?n:(i=t.indexOf("."),i===0?n.className=t.substring(1):i==-1?n.tag=t:(n.tag=t.substring(0,i),n.className=t.substring(i+1)),n):n},command:function(r){var u=r.value;return u=this.toFormattingItem(u),new t.FormatCommand({range:r.range,formatter:function(){var r=(u.tag||u.context||"span").split(","),f=[{tags:r,attr:{className:u.className||""}}];return n.inArray(r[0],i.inlineElements)>=0?new t.GreedyInlineFormatter(f):new t.GreedyBlockFormatter(f)}})},initialize:function(n,t){var f=t.editor,e=this.options,i=e.name,o=this;n.width(e.width);n.kendoSelectBox({dataTextField:"text",dataValueField:"value",dataSource:e.items||f.options[i],title:f.options.messages[i],autoSize:!0,change:function(){var n=this.dataItem();n&&u.exec(f,i,n.toJSON())},dataBound:function(){for(var t=this.dataSource.data(),n=0;n<t.length;n++)t[n]=o.toFormattingItem(t[n])},highlightFirst:!1,template:r.template('<span unselectable="on" style="display:block;#=(data.style||"")#">#:data.text#<\/span>')});n.addClass("k-decorated").closest(".k-widget").removeClass("k-"+i).find("*").addBack().attr("unselectable","on")},getFormattingValue:function(t,i){for(var u,f=0;f<t.length;f++){var r=t[f],o=r.tag||r.context||"",s=r.className?"."+r.className:"",e=o+s,h=n(i[0]).closest(e)[0];if(h){if(i.length==1)return r.value;for(u=1;u<i.length;u++)if(n(i[u]).closest(e)[0]){if(u==i.length-1)return r.value}else break}}return""},update:function(t,r){var e=n(t).data(this.type);if(e){var s=e.dataSource,h=s.data(),u,c,f=i.commonAncestor.apply(null,r);if(f==i.closestEditable(f)||this._ancestor!=f){for(this._ancestor=f,u=0;u<h.length;u++)c=h[u].context,h[u].visible=!c||!!n(f).closest(c).length;s.filter([{field:"visible",operator:"eq",value:!0}]);o.fn.update.call(this,t,r);e.value(this.getFormattingValue(s.view(),r));e.wrapper.toggleClass("k-state-disabled",!s.view().length)}}},destroy:function(){this._ancestor=null}}),c=l.extend({exec:function(){var e=new t.ListFormatter("ul"),r=this.lockRange(!0),o=this.options.remove||"strong,em,span,sup,sub,del,b,i,u,font".split(","),u;a.wrapSelectedElements(r);u=new t.RangeIterator(r);u.traverse(function f(t){var u,r,h,s;if(t&&!i.isMarker(t)){if(u=i.name(t),u=="ul"||u=="ol")for(r=t.previousSibling,h=t.nextSibling,e.unwrap(t);r&&r!=h;r=r.nextSibling)f(r);else if(u=="blockquote")i.changeTag(t,"p");else if(t.nodeType==1&&!i.insignificant(t)){for(s=t.childNodes.length-1;s>=0;s--)f(t.childNodes[s]);t.removeAttribute("style");t.removeAttribute("class")}n.inArray(u,o)>-1&&i.unwrap(t)}});this.releaseRange(r)}});n.extend(t,{FormattingTool:h,CleanFormatCommand:c});s("formatting",new h({template:new e({template:f.dropDownListTemplate,title:"Format"})}));s("cleanFormatting",new u({command:c,template:new e({template:f.buttonTemplate,title:"Clean formatting"})}))})(window.kendo.jQuery)}(),function(){(function(n){var t=window.kendo,h=t.ui,c=h.editor,s=h.Widget,f=n.extend,e=n.proxy,i=t.keys,r=".kendoEditor",l=t.ui.editor.EditorUtils,v=t.ui.editor.ToolTemplate,y=t.ui.editor.Tool,u="overflowAnchor",o=".k-tool-group:visible a.k-tool:not(.k-state-disabled),.k-tool.k-overflow-anchor,.k-tool-group:visible .k-widget.k-colorpicker,.k-tool-group:visible .k-selectbox,.k-tool-group:visible .k-dropdown,.k-tool-group:visible .k-combobox .k-input",p=y.extend({initialize:function(t,i){t.attr({unselectable:"on"});var r=i.editor.toolbar;t.on("click",n.proxy(function(){this.overflowPopup.toggle()},r))},options:{name:u},command:n.noop,update:n.noop,destroy:n.noop}),a;l.registerTool(u,new p({key:"",ctrl:!0,template:new v({template:l.overflowAnchorTemplate})}));a=s.extend({init:function(n,i){var r=this;i=f({},i,{name:"EditorToolbar"});s.fn.init.call(r,n,i);i.popup&&r._initPopup();i.resizable&&i.resizable.toolbar&&(r._resizeHandler=t.onResize(function(){r.resize()}),r.element.addClass("k-toolbar-resizable"))},events:["execute"],groups:{basic:["bold","italic","underline","strikethrough"],scripts:["subscript","superscript"],alignment:["justifyLeft","justifyCenter","justifyRight","justifyFull"],links:["insertImage","insertFile","createLink","unlink"],lists:["insertUnorderedList","insertOrderedList","indent","outdent"],tables:["createTable","addColumnLeft","addColumnRight","addRowAbove","addRowBelow","deleteRow","deleteColumn"],advanced:["viewHtml","cleanFormatting","print","pdf"],fonts:["fontName","fontSize"],colors:["foreColor","backColor"]},overflowFlaseTools:["formatting","fontName","fontSize","foreColor","backColor","insertHtml"],_initPopup:function(){this.window=n(this.element).wrap("<div class='editorToolbarWindow k-header' />").parent().prepend("<button class='k-button k-button-bare k-editortoolbar-dragHandle'><span class='k-icon k-i-move' /><\/button>").kendoWindow({title:!1,resizable:!1,draggable:{dragHandle:".k-editortoolbar-dragHandle"},animation:{open:{effects:"fade:in"},close:{effects:"fade:out"}},minHeight:42,visible:!1,autoFocus:!1,actions:[],dragend:function(){this._moved=!0}}).on("mousedown",function(t){n(t.target).is(".k-icon")||t.preventDefault()}).data("kendoWindow")},_toggleOverflowStyles:function(n,t){n.find("li").toggleClass("k-item k-state-default",t).find(".k-tool:not(.k-state-disabled),.k-overflow-button").toggleClass("k-overflow-button k-button",t)},_initOverflowPopup:function(t){var i=this;i.overflowPopup=n("<ul class='k-editor-overflow-popup k-overflow-container k-list-container'><\/ul>").appendTo("body").kendoPopup({anchor:t,origin:"bottom right",position:"top right",copyAnchorStyles:!1,open:function(n){this.element.is(":empty")&&n.preventDefault();i._toggleOverflowStyles(this.element,!0)},activate:e(i.focusOverflowPopup,i)}).data("kendoPopup")},items:function(){var i=this.options.resizable&&this.options.resizable.toolbar,t,n;return n=this.element.children().find("> *, select"),i&&(t=this.overflowPopup,n=n.add(t.element.children().find("> *"))),n},focused:function(){return this.element.find(".k-state-focused").length>0},toolById:function(n){var t,i=this.tools;for(t in i)if(t.toLowerCase()==n)return i[t]},toolGroupFor:function(t){var i,r=this.groups;if(this.isCustomTool(t))return"custom";for(i in r)if(n.inArray(t,r[i])>=0)return i},bindTo:function(t){var r=this,f=r.window;r._editor&&r._editor.unbind("select",e(r.resize,r));r._editor=t;r.options.resizable&&r.options.resizable.toolbar&&t.options.tools.push(u);r.tools=r.expandTools(t.options.tools);r.render();r.element.find(".k-combobox .k-input").keydown(function(t){var r=n(this).closest(".k-combobox").data("kendoComboBox"),u=t.keyCode;u==i.RIGHT||u==i.LEFT?r.close():u==i.DOWN&&(r.dropDown.isOpened()||(t.stopImmediatePropagation(),r.open()))});r._attachEvents();r.items().each(function(){var i=r._toolName(this),u=i!=="more"?r.tools[i]:r.tools.overflowAnchor,o=u&&u.options,s=t.options.messages,h=o&&o.tooltip||s[i],f=n(this),e;u&&u.initialize&&((i=="fontSize"||i=="fontName")&&(e=s[i+"Inherit"],f.find("input").val(e).end().find("span.k-input").text(e).end()),u.initialize(f,{title:r._appendShortcutSequence(h,u),editor:r._editor}),f.closest(".k-widget",r.element).addClass("k-editor-widget"),f.closest(".k-colorpicker",r.element).next(".k-colorpicker").addClass("k-editor-widget"))});t.bind("select",e(r.resize,r));r.update();f&&f.wrapper.css({top:"",left:"",width:""})},show:function(){var t=this,i=t.window,f=t.options.editor,n,r,u;i&&(n=i.wrapper,r=f.element,n.is(":visible")&&t.window.options.visible||(n[0].style.width||n.width(r.outerWidth()-parseInt(n.css("border-left-width"),10)-parseInt(n.css("border-right-width"),10)),i._moved||(u=r.offset(),n.css({top:Math.max(0,parseInt(u.top,10)-n.outerHeight()-parseInt(t.window.element.css("padding-bottom"),10)),left:Math.max(0,parseInt(u.left,10))})),i.open()))},hide:function(){this.window&&this.window.close()},focus:function(){var n="tabIndex",i=this.element,t=this._editor.element.attr(n);i.attr(n,t||0).focus().find(o).first().focus();t||t===0||i.removeAttr(n)},focusOverflowPopup:function(){var n="tabIndex",t=this.overflowPopup.element,i=this._editor.element.attr(n);t.closest(".k-animation-container").addClass("k-overflow-wrapper");t.attr(n,i||0).find(o).first().focus();i||i===0||t.removeAttr(n)},_appendShortcutSequence:function(n,t){if(!t.key)return n;var i=n+" (";return t.ctrl&&(i+="Ctrl + "),t.shift&&(i+="Shift + "),t.alt&&(i+="Alt + "),i+(t.key+")")},_nativeTools:["insertLineBreak","insertParagraph","redo","undo"],tools:{},isCustomTool:function(n){return!(n in t.ui.Editor.defaultTools)},expandTools:function(i){for(var e,l=this._nativeTools,r,h=t.deepExtend({},t.ui.Editor.defaultTools),o={},s,u=0;u<i.length;u++)e=i[u],s=e.name,n.isPlainObject(e)?s&&h[s]?(o[s]=f({},h[s]),f(o[s].options,e)):(r=f({cssClass:"k-i-custom",type:"button",title:""},e),r.name||(r.name="custom"),r.cssClass="k-"+(r.name=="custom"?"i-custom":r.name),r.template||r.type!="button"||(r.template=c.EditorUtils.buttonTemplate,r.title=r.title||r.tooltip),o[s]={options:r}):h[e]&&(o[e]=h[e]);for(u=0;u<l.length;u++)o[l[u]]||(o[l[u]]=h[l[u]]);return o},render:function(){function it(i){var r;return i.getHtml?r=i.getHtml():(n.isFunction(i)||(i=t.template(i)),r=i(f)),n.trim(r)}function v(){o.children().length&&(nt&&(o.data("position",g),g++),o.appendTo(b))}function y(t){t!==u?(o=n("<li class='k-tool-group' role='presentation' />"),o.data("overflow",n.inArray(t,l)===-1?!0:!1)):o=n("<li class='k-overflow-tools' />")}var i=this,w=i.tools,f,h,p,r,tt=i._editor.element,b=i.element.empty(),k,a,s=i._editor.options.tools,d=t.support.browser,o,c,g=0,nt=i.options.resizable&&i.options.resizable.toolbar,l=this.overflowFlaseTools;for(b.empty(),s.length&&(r=s[0].name||s[0]),y(r,l),c=0;c<s.length;c++)(r=s[c].name||s[c],f=w[r]&&w[r].options,!f&&n.isPlainObject(r)&&(f=r),h=f&&f.template,r=="break"&&(v(),n("<li class='k-row-break' />").appendTo(i.element),y(r,l)),h)&&(a=i.toolGroupFor(r),(k!=a||r==u)&&(v(),y(r,l),k=a),h=it(h),p=n(h).appendTo(o),a=="custom"&&(v(),y(r,l)),f.exec&&p.hasClass("k-tool")&&p.click(e(f.exec,tt[0])));v();n(i.element).children(":has(> .k-tool)").addClass("k-button-group");i.options.popup&&d.msie&&d.version<9&&i.window.wrapper.find("*").attr("unselectable","on");i.updateGroups();nt&&i._initOverflowPopup(i.element.find(".k-overflow-anchor"));i.angular("compile",function(){return{elements:i.element}})},updateGroups:function(){n(this.element).children().each(function(){n(this).children().filter(function(){return!n(this).hasClass("k-state-disabled")}).removeClass("k-group-end").first().addClass("k-group-start").end().last().addClass("k-group-end").end()})},decorateFrom:function(t){this.items().filter(".k-decorated").each(function(){var i=n(this).data("kendoSelectBox");i&&i.decorate(t)})},destroy:function(){s.fn.destroy.call(this);var n,i=this.tools;for(n in i)i[n].destroy&&i[n].destroy();this.window&&this.window.destroy();this._resizeHandler&&t.unbindResize(this._resizeHandler);this.overflowPopup&&this.overflowPopup.destroy()},_attachEvents:function(){var t=this,u="[role=button].k-tool",f=u+":not(.k-state-disabled)",e=u+".k-state-disabled",s=t.overflowPopup?t.overflowPopup.element:n([]);t.element.add(s).off(r).on("mouseenter"+r,f,function(){n(this).addClass("k-state-hover")}).on("mouseleave"+r,f,function(){n(this).removeClass("k-state-hover")}).on("mousedown"+r,u,function(n){n.preventDefault()}).on("keydown"+r,o,function(r){function e(n,t,i){var r=t.find(o),u=r.index(s)+n;return i&&(u=Math.max(0,Math.min(r.length-1,u))),r[u]}var s=this,c=t.options.resizable&&t.options.resizable.toolbar,u,h,f=r.keyCode;f==i.RIGHT||f==i.LEFT?n(s).hasClass(".k-dropdown")||(u=e(f==i.RIGHT?1:-1,t.element,!0)):c&&(f==i.UP||f==i.DOWN)?u=e(f==i.DOWN?1:-1,t.overflowPopup.element,!0):f==i.ESC?(t.overflowPopup.visible()&&t.overflowPopup.close(),u=t._editor):f!=i.TAB||r.ctrlKey||r.altKey||(h=c?n(s.parentElement).hasClass("k-overflow-tool-group")?t.overflowPopup.element:t.element:t.element,r.shiftKey?u=e(-1,h):(u=e(1,h),u||(u=t._editor)));u&&(r.preventDefault(),u.focus())}).on("click"+r,f,function(i){var r=n(this);i.preventDefault();i.stopPropagation();r.removeClass("k-state-hover");r.is("[data-popup]")||t._editor.exec(t._toolName(this))}).on("click"+r,e,function(n){n.preventDefault()})},_toolName:function(t){var i,r;if(t)return i=t.className,/k-tool\b/i.test(i)&&(i=t.firstChild.className),r=n.grep(i.split(" "),function(n){return!/^k-(widget|tool|tool-icon|icon|state-hover|header|combobox|dropdown|selectbox|colorpicker)$/i.test(n)}),r[0]?r[0].substring(r[0].lastIndexOf("-")+1):"custom"},refreshTools:function(){var i=this,f=i._editor,u=f.getRange(),r=t.ui.editor.RangeUtils.textNodes(u);r.length||(r=[u.startContainer]);i.items().each(function(){var t=i.tools[i._toolName(this)];t&&t.update&&t.update(n(this),r)});this.update()},update:function(){this.updateGroups()},_resize:function(n){var i=n.width,r=this.options.resizable&&this.options.resizable.toolbar,t=this.overflowPopup;(this.refreshTools(),r)&&(t.visible()&&t.close(!0),this._refreshWidths(),this._shrink(i),this._stretch(i),this._toggleOverflowStyles(this.element,!1),this._toggleOverflowStyles(this.overflowPopup.element,!0),this.element.children("li.k-overflow-tools").css("visibility",t.element.is(":empty")?"hidden":"visible"))},_refreshWidths:function(){this.element.children("li").each(function(t,i){var r=n(i);r.data("outerWidth",r.outerWidth(!0))})},_shrink:function(n){var r,i,t;if(n<this._groupsWidth())for(i=this._visibleGroups().filter(":not(.k-overflow-tools)"),t=i.length-1;t>=0;t--)if(r=i.eq(t),n>this._groupsWidth())break;else this._hideGroup(r)},_stretch:function(n){var r,i,t;if(n>this._groupsWidth())for(i=this._hiddenGroups(),t=0;t<i.length;t++)if(r=i.eq(t),n<this._groupsWidth()||!this._showGroup(r,n))break},_hiddenGroups:function(){var i=this.overflowPopup,t=this.element.children("li.k-tool-group").filter(":hidden");return t=t.add(i.element.children("li")),t.sort(function(t,i){return n(t).data("position")>n(i).data("position")?1:-1}),t},_visibleGroups:function(){return this.element.children("li.k-tool-group, li.k-overflow-tools").filter(":visible")},_groupsWidth:function(){var t=0;return this._visibleGroups().each(function(){t+=n(this).data("outerWidth")}),Math.ceil(t)},_hideGroup:function(n){if(n.data("overflow")){var t=this.overflowPopup;n.detach().prependTo(t.element).addClass("k-overflow-tool-group")}else n.hide()},_showGroup:function(t,i){var r,u;return t.length&&i>this._groupsWidth()+t.data("outerWidth")?(t.hasClass("k-overflow-tool-group")?(r=t.data("position"),r===0?t.detach().prependTo(this.element):(u=this.element.children().filter(function(t,i){return n(i).data("position")===r-1}),t.detach().insertAfter(u)),t.removeClass("k-overflow-tool-group")):t.show(),!0):!1}});n.extend(c,{Toolbar:a})})(window.jQuery)}(),function(){(function(n){var r=window.kendo,y=n.extend,h=n.proxy,i=r.ui.editor,t=i.Dom,u=i.EditorUtils,rt=i.RangeUtils,c=i.Command,l=".kendoEditor",p="k-state-active",v="k-state-selected",a=i.Tool,f=i.ToolTemplate,w=i.InsertHtmlCommand,ut=i.BlockFormatFinder,e=i.EditorUtils.registerTool,ft="<td>"+i.emptyElementContent+"<\/td>",b=new ut([{tags:["table"]}]),k=w.extend({_tableHtml:function(n,t){return n=n||1,t=t||1,"<table class='k-table' data-last>"+new Array(n+1).join("<tr>"+new Array(t+1).join(ft)+"<\/tr>")+"<\/table>"},postProcess:function(t,i){var r=n("table[data-last]",t.document).removeAttr("data-last");i.setStart(r.find("td")[0],0);i.collapse(!0);t.selectRange(i)},exec:function(){var n=this.options;n.html=this._tableHtml(n.rows,n.columns);n.postProcess=this.postProcess;w.fn.exec.call(this)}}),o=a.extend({initialize:function(t,i){a.fn.initialize.call(this,t,i);var r=n(this.options.popupTemplate).appendTo("body").kendoPopup({anchor:t,copyAnchorStyles:!1,open:h(this._open,this),activate:h(this._activate,this),close:h(this._close,this)}).data("kendoPopup");t.click(h(this._toggle,this)).keydown(h(this._keydown,this));this._editor=i.editor;this._popup=r},popup:function(){return this._popup},_activate:n.noop,_open:function(){this._popup.options.anchor.addClass(p)},_close:function(){this._popup.options.anchor.removeClass(p)},_keydown:function(n){var t=r.keys,i=n.keyCode;i==t.DOWN&&n.altKey?this._popup.open():i==t.ESC&&this._popup.close()},_toggle:function(t){var i=n(t.target).closest(".k-tool");i.hasClass("k-state-disabled")||this.popup().toggle()},update:function(n){var t=this.popup();t.wrapper&&t.wrapper.css("display")=="block"&&t.close();n.removeClass("k-state-hover")},destroy:function(){this._popup.destroy()}}),d=o.extend({init:function(t){this.cols=8;this.rows=6;o.fn.init.call(this,n.extend(t,{command:k,popupTemplate:"<div class='k-ct-popup'>"+new Array(this.cols*this.rows+1).join("<span class='k-ct-cell k-state-disabled' />")+"<div class='k-status'><\/div><\/div>"}))},_activate:function(){function c(t){var r=n(window);return{row:Math.floor((t.clientY+r.scrollTop()-i.top)/h)+1,col:Math.floor((t.clientX+r.scrollLeft()-i.left)/s)+1}}var t=this,f=t._popup.element,e=f.find(".k-ct-cell"),a=e.eq(0),o=e.eq(e.length-1),i=r.getOffset(a),u=r.getOffset(o),v=t.cols,y=t.rows,s,h;f.find("*").addBack().attr("unselectable","on");u.left+=o[0].offsetWidth;u.top+=o[0].offsetHeight;s=(u.left-i.left)/v;h=(u.top-i.top)/y;f.on("mousemove"+l,function(n){t._setTableSize(c(n))}).on("mouseleave"+l,function(){t._setTableSize()}).on("mouseup"+l,function(n){t._exec(c(n))})},_valid:function(n){return n&&n.row>0&&n.col>0&&n.row<=this.rows&&n.col<=this.cols},_exec:function(n){this._valid(n)&&(this._editor.exec("createTable",{rows:n.row,columns:n.col}),this._popup.close())},_setTableSize:function(t){var i=this._popup.element,u=i.find(".k-status"),f=i.find(".k-ct-cell"),e=this.cols,o=this._editor.options.messages;this._valid(t)?(u.text(r.format(o.createTableHint,t.row,t.col)),f.each(function(i){n(this).toggleClass(v,i%e<t.col&&i/e<t.row)})):(u.text(o.dialogCancel),f.removeClass(v))},_keydown:function(n){var s;if(o.fn._keydown.call(this,n),this._popup.visible()){var t=r.keys,i=n.keyCode,c=this._popup.element.find(".k-ct-cell"),h=Math.max(c.filter(".k-state-selected").last().index(),0),f=Math.floor(h/this.cols),e=h%this.cols,u=!1;i!=t.DOWN||n.altKey?i==t.UP?(u=!0,f--):i==t.RIGHT?(u=!0,e++):i==t.LEFT&&(u=!0,e--):(u=!0,f++);s={row:Math.max(1,Math.min(this.rows,f+1)),col:Math.max(1,Math.min(this.cols,e+1))};i==t.ENTER?this._exec(s):this._setTableSize(s);u&&(n.preventDefault(),n.stopImmediatePropagation())}},_open:function(){var n=this._editor.options.messages;o.fn._open.call(this);this.popup().element.find(".k-status").text(n.dialogCancel).end().find(".k-ct-cell").removeClass(v)},_close:function(){o.fn._close.call(this);this.popup().element.off(l)},update:function(n,t){var i;o.fn.update.call(this,n);i=b.isFormatted(t);n.toggleClass("k-state-disabled",i)}}),g=c.extend({exec:function(){for(var e=this.lockRange(!0),r=e.endContainer,o,n,u,f;t.name(r)!="td";)r=r.parentNode;for(n=r.parentNode,o=n.children.length,u=n.cloneNode(!0),f=0;f<n.cells.length;f++)u.cells[f].innerHTML=i.emptyElementContent;this.options.position=="before"?t.insertBefore(u,n):t.insertAfter(u,n);this.releaseRange(e)}}),nt=c.extend({exec:function(){for(var f=this.lockRange(!0),e=t.closest(f.endContainer,"td"),h=t.closest(e,"table"),s=h.rows,r,u,c=this.options.position,o=t.findNodeIndex(e,!0),n=0;n<s.length;n++)r=s[n].cells[o],u=r.cloneNode(),u.innerHTML=i.emptyElementContent,c=="before"?t.insertBefore(u,r):t.insertAfter(u,r);this.releaseRange(f)}}),tt=c.extend({exec:function(){var u=this.lockRange(),f=rt.mapAll(u,function(t){return n(t).closest("tr")[0]}),e=t.closest(f[0],"table"),i,o,r;if(e.rows.length<=f.length)i=t.next(e),(!i||t.insignificant(i))&&(i=t.prev(e)),t.remove(e);else for(o=0;o<f.length;o++)r=f[o],t.removeTextSiblings(r),i=t.next(r)||t.prev(r),i=i.cells[0],t.remove(r);i&&(u.setStart(i,0),u.collapse(!0),this.editor.selectRange(u))}}),it=c.extend({exec:function(){var r=this.lockRange(),i=t.closest(r.endContainer,"td"),u=t.closest(i,"table"),e=u.rows,o=t.findNodeIndex(i,!0),s=e[0].cells.length,n,f;if(s==1)n=t.next(u),(!n||t.insignificant(n))&&(n=t.prev(u)),t.remove(u);else for(t.removeTextSiblings(i),n=t.next(i)||t.prev(i),f=0;f<e.length;f++)t.remove(e[f].cells[o]);n&&(r.setStart(n,0),r.collapse(!0),this.editor.selectRange(r))}}),s=a.extend({command:function(n){return n=y(n,this.options),n.action=="delete"?n.type=="row"?new tt(n):new it(n):n.type=="row"?new g(n):new nt(n)},initialize:function(n,t){a.fn.initialize.call(this,n,t);n.addClass("k-state-disabled")},update:function(n,t){var i=!b.isFormatted(t);n.toggleClass("k-state-disabled",i)}});y(r.ui.editor,{PopupTool:o,TableCommand:k,InsertTableTool:d,TableModificationTool:s,InsertRowCommand:g,InsertColumnCommand:nt,DeleteRowCommand:tt,DeleteColumnCommand:it});e("createTable",new d({template:new f({template:u.buttonTemplate,popup:!0,title:"Create table"})}));e("addColumnLeft",new s({type:"column",position:"before",template:new f({template:u.buttonTemplate,title:"Add column on the left"})}));e("addColumnRight",new s({type:"column",template:new f({template:u.buttonTemplate,title:"Add column on the right"})}));e("addRowAbove",new s({type:"row",position:"before",template:new f({template:u.buttonTemplate,title:"Add row above"})}));e("addRowBelow",new s({type:"row",template:new f({template:u.buttonTemplate,title:"Add row below"})}));e("deleteRow",new s({type:"row",action:"delete",template:new f({template:u.buttonTemplate,title:"Delete row"})}));e("deleteColumn",new s({type:"column",action:"delete",template:new f({template:u.buttonTemplate,title:"Delete column"})}))})(window.kendo.jQuery)}(),function(){}(),function(){(function(n,t){var u=window.kendo,i=u.caret,f=u.keys,h=u.ui,e=h.Widget,r=".kendoMaskedTextBox",o=n.proxy,c=(u.support.propertyChangeEvent?"propertychange":"input")+r,l="k-state-disabled",a="disabled",v="readonly",s="change",y=e.extend({init:function(t,f){var o=this,s,h;e.fn.init.call(o,t,f);o._rules=n.extend({},o.rules,o.options.rules);t=o.element;s=t[0];o.wrapper=t;o._tokenize();o._form();o.element.addClass("k-textbox").attr("autocomplete","off").on("focus"+r,function(){var n=s.value;n?o._togglePrompt(!0):s.value=o._old=o._emptyMask;o._oldValue=n;o._timeoutId=setTimeout(function(){i(t,0,n?o._maskLength:0)})}).on("focusout"+r,function(){var n=t.val();clearTimeout(o._timeoutId);s.value=o._old="";n!==o._emptyMask&&(s.value=o._old=n);o._change();o._togglePrompt()});h=t.is("[disabled]")||n(o.element).parents("fieldset").is(":disabled");h?o.enable(!1):o.readonly(t.is("[readonly]"));o.value(o.options.value||t.val());u.notify(o)},options:{name:"MaskedTextBox",clearPromptChar:!1,unmaskOnPost:!1,promptChar:"_",culture:"",rules:{},value:"",mask:""},events:[s],rules:{"0":/\d/,"9":/\d|\s/,"#":/\d|\s|\+|\-/,L:/[a-zA-Z]/,"?":/[a-zA-Z]|\s/,"&":/\S/,C:/./,A:/[a-zA-Z0-9]/,a:/[a-zA-Z0-9]|\s/},setOptions:function(t){var i=this;e.fn.setOptions.call(i,t);i._rules=n.extend({},i.rules,i.options.rules);i._tokenize();this._unbindInput();this._bindInput();i.value(i.element.val())},destroy:function(){var n=this;n.element.off(r);n._formElement&&(n._formElement.off("reset",n._resetHandler),n._formElement.off("submit",n._submitHandler));e.fn.destroy.call(n)},raw:function(){var n=this._unmask(this.element.val(),0);return n.replace(new RegExp(this.options.promptChar,"g"),"")},value:function(n){var i=this.element,r=this._emptyMask;if(n===t)return this.element.val();if(n===null&&(n=""),!r){i.val(n);return}n=this._unmask(n+"");i.val(n?r:"");this._mask(0,this._maskLength,n);n=i.val();this._oldValue=n;u._activeElement()!==i&&(n===r?i.val(""):this._togglePrompt())},_togglePrompt:function(n){var i=this.element[0],t=i.value;this.options.clearPromptChar&&(t=n?this._oldValue:t.replace(new RegExp(this.options.promptChar,"g")," "),i.value=this._old=t)},readonly:function(n){this._editable({readonly:n===t?!0:n,disable:!1})},enable:function(n){this._editable({readonly:!1,disable:!(n=n===t?!0:n)})},_bindInput:function(){var n=this;if(n._maskLength)n.element.on("keydown"+r,o(n._keydown,n)).on("keypress"+r,o(n._keypress,n)).on("paste"+r,o(n._paste,n)).on(c,o(n._propertyChange,n))},_unbindInput:function(){this.element.off("keydown"+r).off("keypress"+r).off("paste"+r).off(c)},_editable:function(n){var t=this,r=t.element,i=n.disable,u=n.readonly;t._unbindInput();u||i?r.attr(a,i).attr(v,u).toggleClass(l,i):(r.removeAttr(a).removeAttr(v).removeClass(l),t._bindInput())},_change:function(){var n=this,t=n.value();t!==n._oldValue&&(n._oldValue=t,n.trigger(s),n.element.trigger(s))},_propertyChange:function(){var t=this,r=t.element[0],f=r.value,e,n;u._activeElement()===r&&(f===t._old||t._pasting||(n=i(r)[0],e=t._unmask(f.substring(n),n),r.value=t._old=f.substring(0,n)+t._emptyMask.substring(n),t._mask(n,n,e),i(r,n)))},_paste:function(n){var r=this,u=n.target,f=i(u),t=f[0],e=f[1],o=r._unmask(u.value.substring(e),e);r._pasting=!0;setTimeout(function(){var n=u.value,f=n.substring(t,i(u)[0]);u.value=r._old=n.substring(0,t)+r._emptyMask.substring(t);r._mask(t,t,f);t=i(u)[0];r._mask(t,t,o);i(u,t);r._pasting=!1})},_form:function(){var t=this,i=t.element,u=i.attr("form"),r=u?n("#"+u):i.closest("form");if(r[0]){if(t._resetHandler=function(){setTimeout(function(){t.value(i[0].value)})},t._submitHandler=function(){t.element[0].value=t._old=t.raw()},t.options.unmaskOnPost)r.on("submit",t._submitHandler);t._formElement=r.on("reset",t._resetHandler)}},_keydown:function(n){var o=n.keyCode,h=this.element[0],c=i(h),r=c[0],s=c[1],u,e=o===f.BACKSPACE;e||o===f.DELETE?(r===s&&(e?r-=1:s+=1,u=this._find(r,e)),u!==t&&u!==r?(e&&(u+=1),i(h,u)):r>-1&&this._mask(r,s,"",e),n.preventDefault()):o===f.ENTER&&this._change()},_keypress:function(n){if(n.which!==0&&!n.metaKey&&!n.ctrlKey&&n.keyCode!==f.ENTER){var t=String.fromCharCode(n.which),r=i(this.element);this._mask(r[0],r[1],t);(n.keyCode===f.BACKSPACE||t)&&n.preventDefault()}},_find:function(n,t){var r=this.element.val()||this._emptyMask,i=1;for(t===!0&&(i=-1);n>-1||n<=this._maskLength;){if(r.charAt(n)!==this.tokens[n])return n;n+=i}return-1},_mask:function(n,r,f,e){var h=this.element[0],o=h.value||this._emptyMask,y=this.options.promptChar,l,a=0,c,v,s;for(n=this._find(n,e),n>r&&(r=n),c=this._unmask(o.substring(r),r),f=this._unmask(f,n),l=f.length,f&&(c=c.replace(new RegExp("^_{0,"+l+"}"),"")),f+=c,o=o.split(""),v=f.charAt(a);n<this._maskLength;)o[n]=v||y,v=f.charAt(++a),s===t&&a>l&&(s=n),n=this._find(n+1);h.value=this._old=o.join("");u._activeElement()===h&&(s===t&&(s=this._maskLength),i(h,s))},_unmask:function(t,i){if(!t)return"";t=(t+"").split("");for(var r,u,e=0,f=i||0,o=this.options.promptChar,h=t.length,c=this.tokens.length,s="";f<c;)if(r=t[e],u=this.tokens[f],r===u||r===o?(s+=r===o?o:"",e+=1,f+=1):typeof u!="string"?((u.test&&u.test(r)||n.isFunction(u)&&u(r))&&(s+=r,f+=1),e+=1):f+=1,e>=h)break;return s},_tokenize:function(){for(var e=[],r=0,l=this.options.mask||"",o=l.split(""),a=o.length,t=0,n,s,f="",v=this.options.promptChar,h=u.getCulture(this.options.culture).numberFormat,y=this._rules,i,c;t<a;t++)if(n=o[t],s=y[n],s)e[r]=s,f+=v,r+=1;else for(n==="."||n===","?n=h[n]:n==="$"?n=h.currency.symbol:n==="\\"&&(t+=1,n=o[t]),n=n.split(""),i=0,c=n.length;i<c;i++)e[r]=n[i],f+=n[i],r+=1;this.tokens=e;this._emptyMask=f;this._maskLength=f.length}});h.plugin(y)})(window.kendo.jQuery)}(),function(){(function(n,t){function vt(n){var i=typeof n=="string"?[{name:n}]:n,r=s.call(i)==="[object Array]"?i:i!==t?[i]:[];return wt(r,function(n){return typeof n=="string"?{name:n}:{name:n.name,type:n.type}})}function o(n){var i=typeof n=="string"?[{name:[n],expand:!1}]:n,r=s.call(i)==="[object Array]"?i:i!==t?[i]:[];return wt(r,function(n){return typeof n=="string"?{name:[n],expand:!1}:{name:s.call(n.name)==="[object Array]"?n.name.slice():[n.name],expand:n.expand}})}function ui(n){return n.indexOf(" ")!==-1&&(n='["'+n+'"]'),n}function yt(n,t,r,u){var o,f,s,e;if(r||(r=t),u||(u=0),e=r.members[u],e&&!e.measure){if(s=e.children,f=s.length,r===t?n[i.stringify([e.name])]=!!f:f&&(n[i.stringify(rt(r,u))]=!0),f)for(o=0;o<f;o++)yt(n,t,s[o],u);yt(n,t,r,u+1)}}function vr(t){var i={},r,u;t.length&&yt(i,t[0]);r=[];for(u in i)r.push({name:n.parseJSON(u),expand:i[u]});return r}function yr(n,t){var o=t.tuples||[],f=o[0],r,i,e,u;if(f&&n.length<f.members.length)for(r=f.members,i=0;i<r.length;i++)if(!r[i].measure){for(e=!1,u=0;u<n.length;u++)if(h(n[u]).indexOf(r[i].hierarchy)===0){e=!0;break}e||n.push({name:[r[i].name],expand:!1})}}function pr(n){for(var r=[],i=n.members,t=0;t<i.length;t++)i[t].measure||r.push({name:[i[t].name],expand:i[t].children.length>0});return r}function wr(n,t,i){var u,r;return n=n||{},yr(t,n),i.length>1&&t.push({name:y,measure:!0,children:o(i)}),u={members:t},n.tuples&&(r=tt(n.tuples,u),r.tuple&&(t=pr(r.tuple))),t}function br(n){var t=i.getter(n.field,!0);return function(i,r){return n.aggregate(t(i.dataItem),r,i)}}function f(n){return typeof n=="number"&&!isNaN(n)}function et(n){return n&&n.getTime}function ei(n,t,i){if(n.tuples.length<v(t.tuples,i))return t}function gr(n,t,i,r,u){for(var f,o,s=n.length,c=v(t,r),h=r.length||1,e=0;e<i;e++)for(f=0;f<s;f++)o=oi(n[f],t)*h,o+=f%h,u[e*s+f].ordinal=e*c+o}function nu(n,t,i,r,u){for(var e,o,h=n.length,s=r.length||1,f=0;f<h;f++)for(o=oi(n[f],t),o*=s,o+=f%s,e=0;e<i;e++)u[f*i+e].ordinal=o*i+e}function oi(n,t){return tt(t,n).index}function v(n,t){if(!n.length)return 0;for(var r=n.slice(),i=r.shift(),u=1;i;)i.members?[].push.apply(r,i.members):i.children&&(i.measure||(u+=i.children.length),[].push.apply(r,i.children)),i=r.shift();return t.length&&(u=u*t.length),u}function ot(n){return n||(n={tuples:[]}),n.tuples||(n.tuples=[]),n}function si(n,t,i){if(!n)return 0;var u=Math.max(i.length,1),f=n.members.slice(0,t),e=u,r=f.shift();for(u>1&&(u+=1);r;)r.name===y?e+=u:r.children?[].push.apply(f,r.children):(e++,[].push.apply(f,r.members)),r=f.shift();return e}function hi(n,t,i){var u,r,s;if(!t[0])return{parsedRoot:null,tuples:n,memberIndex:0,index:0};if(u=tt(n,t[0]),!u.tuple)return{parsedRoot:null,tuples:t,memberIndex:0,index:0};var f=u.tuple.members,e=t[0].members,o=-1;if(f.length!==e.length)return{parsedRoot:null,tuples:t,memberIndex:0,index:0};for(r=0,s=f.length;r<s;r++)!f[r].measure&&e[r].children[0]&&(o==-1&&e[r].children.length&&(o=r),f[r].children=e[r].children);return i=Math.max(i.length,1),{parsedRoot:u.tuple,index:u.index*i,memberIndex:o,tuples:n}}function tu(n,t){var r=!0,i,u;for(n=n.members,t=t.members,i=0,u=n.length;i<u;i++)n[i].measure||t[i].measure||(r=r&&h(n[i])===h(t[i]));return r}function tt(n,t){for(var i,f,r=0,e,h,o,u=0,s=n.length;u<s;u++){if(i=n[u],tu(i,t))return{tuple:i,index:r};for(r++,e=0,h=i.members.length;e<h;e++)if((o=i.members[e],!o.measure)&&(f=tt(o.children,t),r+=f.index,f.tuple))return{tuple:f.tuple,index:r}}return{index:r}}function iu(n,t){for(var r,u="",i=0,f=n.length;i<f;i++)r=n[i],u+=r.name,t[u]||(t[u]=r)}function ru(n,t){for(var o=n.members,i,u="",e="",r,f=0,s=o.length;f<s;f++){if(i=o[f],r)if(t[u+i.name]){u+=i.name;r=t[u];continue}else return t[u+i.parentName]?t[u+i.parentName]:t[e+i.parentName]?t[e+i.parentName]:t[e];if(u+=i.name,r=t[i.parentName],!r&&(r=t[u],!r))return null;r&&(e+=r.name)}return r}function uu(n,t){var u,r,i,f;if(t.length===0)return-1;for(u=t[0],r=n.members,i=0,f=r.length;i<f;i++)if(r[i].name==u.name)return i}function fu(i,r){if(!(r<0)){var u={name:y,measure:!0,children:[n.extend({members:[],dataIndex:i.dataIndex},i.members[r])]};i.members.splice(r,1,u);i.dataIndex=t}}function ci(n,t){var r,i,u;if(n.length<1)return[];var e=[],o={},f=uu(n[0],t);for(r=0;r<n.length;r++)i=n[r],i.dataIndex=r,fu(i,f),u=ru(i,o),u?f<0||!u.measure?u.children.push(i):u.children.push(i.members[f].children[0]):e.push(i),iu(i.members,o);return e}function eu(n,t){if(!n||!n.length)return t;for(var e=[],o=li(n),s=o.length,u=Math.max(t.length/s,1),r,h,c,f,i=0;i<s;i++)for(h=u*i,c=u*o[i],r=0;r<u;r++)f=parseInt(c+r,10),e[parseInt(h+r,10)]=t[f]||{value:"",fmtValue:"",ordinal:f};return e}function ou(n,t){if(!n||!n.length)return t;for(var o=[],s=li(n),u=s.length,h=Math.max(t.length/u,1),i,f,e,r=0;r<h;r++)for(f=u*r,i=0;i<u;i++)e=s[i]+f,o[f+i]=t[e]||{value:"",fmtValue:"",ordinal:e};return o}function li(n){n=n.slice();for(var o=[],i=n.shift(),r,s,f,u,e;i;){for(i.dataIndex!==t&&o.push(i.dataIndex),f=0,r=0,s=i.members.length;r<s;r++)e=i.members[r],u=e.children,e.measure?[].splice.apply(n,[0,0].concat(u)):[].splice.apply(n,[f,0].concat(u)),f+=u.length;i=n.shift()}return o}function ai(n){var t=n.split(".");return t.length>2?t[0]+"."+t[1]:n}function vi(n,t){var u=n.length-1,i=n[u],r;return r=su(t,i),r&&r.dir?i="ORDER("+i+".Children,"+r.field+".CurrentMember.MEMBER_CAPTION,"+r.dir+")":i+=".Children",n[u]=i,n}function su(n,t){for(var i=0,r=n.length;i<r;i++)if(t.indexOf(n[i].field)===0)return n[i];return null}function yi(n){var t="CROSSJOIN({",i;return n.length>2?(i=n.pop(),t+=yi(n)):(t+=n.shift(),i=n.pop()),t+="},{",t+=i,t+"})"}function pi(n,t){var i=n.slice(0);return t.length>1&&i.push("{"+st(t).join(",")+"}"),yi(i)}function st(n){for(var r=0,f=n.length,u=[],i;r<f;r++)i=n[r],u.push(i.name!==t?i.name:i);return u}function h(n){return n=n.name||n,s.call(n)==="[object Array]"&&(n=n[n.length-1]),n}function wi(n){for(var r=n.length,i=[],t=0;t<r;t++)i.push(n[t].name[0]);return i}function bi(n,t){var r,f,i,u=0,e=n.length,o=t.length;for(t=t.slice(0);u<e;u++)for(r=n[u],i=0;i<o;i++)if(f=ai(t[i]),r.indexOf(f)!==-1){t[i]=r;break}return{names:t,expandedIdx:i,uniquePath:t.slice(0,i+1).join("")}}function ki(n){for(var r=[],h=[],u=[],t,f,c,e=0,a=n.length,i,l,o;e<a;e++)if(t=n[e],i=t.name,o=!1,s.call(i)!=="[object Array]"&&(t.name=i=[i]),i.length>1)h.push(t);else{for(l=ai(i[0]),f=0,c=u.length;f<c;f++)if(u[f].name[0].indexOf(l)===0){o=!0;break}o||u.push(t);t.expand&&r.push(t)}return r=r.concat(h),{root:u,expanded:r}}function di(n,t,i){var s="";n=n||[];var r=ki(n),l=r.root,f=wi(l),h=[];r=r.expanded;var c=r.length,u=0,e,o=[];if(f.length>1||t.length>1){for(h.push(pi(f,t));u<c;u++)e=vi(r[u].name,i),o=bi(e,f).names,h.push(pi(o,t));s+=h.join(",")}else{for(;u<c;u++)e=vi(r[u].name,i),o.push(e[0]);s+=f.concat(o).join(",")}return s}function hu(n){var t="",r=n.value,u=n.field,f=n.operator;return f=="in"?(t+="{",t+=r,t+="}"):(t+="Filter(",t+=u+".MEMBERS",t+=i.format(gi[f],u,r),t+=")"),t}function cu(n,t){for(var u="",i,f=n.filters,e=f.length,r=e-1;r>=0;r--)i="SELECT (",i+=hu(f[r]),i+=") ON 0",r==e-1?(i+=" FROM ["+t+"]",u=i):u=i+" FROM ( "+u+" )";return u}function nr(n,t,i){var u="",f,r;if(t){u+="<"+n+">";for(r in t)f=t[r],i&&(r=r.replace(/([A-Z]+(?=$|[A-Z][a-z])|[A-Z]?[a-z]+)/g,"$1_").toUpperCase().replace(/_$/,"")),u+="<"+r+">"+f+"<\/"+r+">";u+="<\/"+n+">"}else u+="<"+n+"/>";return u}function it(n){if(n==null)return[];var t=s.call(n);return t!=="[object Array]"?[n]:n}function ir(n){for(var f,r,t,e={tuples:[]},o=it(i.getter("Tuples.Tuple",!0)(n)),s=i.getter("Caption['#text']"),h=i.getter("UName['#text']"),c=i.getter("LName['#text']"),l=i.getter("LNum['#text']"),a=i.getter("CHILDREN_CARDINALITY['#text']",!0),v=i.getter("['@Hierarchy']"),y=i.getter("PARENT_UNIQUE_NAME['#text']",!0),u=0;u<o.length;u++){for(f=[],r=it(o[u].Member),t=0;t<r.length;t++)f.push({children:[],caption:s(r[t]),name:h(r[t]),levelName:c(r[t]),levelNum:l(r[t]),hasChildren:parseInt(a(r[t]),10)>0,parentName:y(r[t]),hierarchy:v(r[t])});e.tuples.push({members:f})}return e}var i=window.kendo,ct=i.ui,b=i.Class,l=ct.Widget,k=i.data.DataSource,s={}.toString,e=function(n){return n},wt=n.map,u=n.extend,bt=i.isFunction,a="change",kt="error",y="Measures",dt="progress",lt="stateReset",d="auto",ut="<div/>",g=".kendoPivotGrid",p="__row_total__",gt="dataBinding",ni="dataBound",ti="expandMember",ii="collapseMember",ft="k-i-arrow-s",at="k-i-arrow-e",ri="<span>#: data.member.caption || data.member.name #<\/span>",hr='<span class="k-icon k-i-kpi-#=data.dataItem.value > 0 ? "open" : data.dataItem.value < 0 ? "denied" : "hold"#">#:data.dataItem.value#<\/span>',cr='<span class="k-icon k-i-kpi-#=data.dataItem.value > 0 ? "increase" : data.dataItem.value < 0 ? "decrease" : "equal"#">#:data.dataItem.value#<\/span>',lr='#= data.dataItem ? kendo.htmlEncode(data.dataItem.fmtValue || data.dataItem.value) || "&nbsp;" : "&nbsp;" #',ar='<table class="k-pivot-layout"><tr><td><div class="k-pivot-rowheaders"><\/div><\/td><td><div class="k-pivot-table k-state-default"><\/div><\/td><\/tr><\/table>',kr={sum:function(n,t){var i=t.accumulator;return f(i)?f(n)&&(i+=n):i=n,i},count:function(n,t){return(t.accumulator||0)+1},average:{aggregate:function(n,i){var r=i.accumulator;return i.count===t&&(i.count=0),f(r)?f(n)&&(r+=n):r=n,f(n)&&i.count++,r},result:function(n){var t=n.accumulator;return f(t)&&(t=t/n.count),t}},max:function(n,t){var i=t.accumulator;return f(i)||et(i)||(i=n),i<n&&(f(n)||et(n))&&(i=n),i},min:function(n,t){var i=t.accumulator;return f(i)||et(i)||(i=n),i>n&&(f(n)||et(n))&&(i=n),i}},fi=b.extend({init:function(n){this.options=u({},this.options,n);this.dimensions=this._normalizeDescriptors("field",this.options.dimensions);this.measures=this._normalizeDescriptors("name",this.options.measures)},_normalizeDescriptors:function(n,t){var r,i,u,f;if(t=t||{},r={},s.call(t)==="[object Array]"){for(u=0,f=t.length;u<f;u++)i=t[u],typeof i=="string"?r[i]={}:i[n]&&(r[i[n]]=i);t=r}return t},_rootTuples:function(n,i){var h=i.length||1,a=this.dimensions||[],r,u,o,f=0,e,c=n.length,s=[],l=[];if(c||i.length){for(f=0;f<h;f++){for(r={members:[]},e=0;e<c;e++)u=n[e],o=u.split("&"),r.members[r.members.length]={children:[],caption:(a[u]||{}).caption||"All",name:u,levelName:u,levelNum:"0",hasChildren:!0,parentName:o.length>1?o[0]:t,hierarchy:u};h>1&&(r.members[r.members.length]={children:[],caption:i[f].caption,name:i[f].descriptor.name,levelName:"MEASURES",levelNum:"0",hasChildren:!1,parentName:t,hierarchy:"MEASURES"});s[s.length]=r}l.push(p)}return{keys:l,tuples:s}},_expandedTuples:function(n,i,r){var w=r.length||1,k=this.dimensions||[],o,u,b,f,c,l,a=[],v=[],e,y,p,s,h;for(b in n){for(f=n[b],e=this._findExpandedMember(i,f.uniquePath),c=a[e.index]||[],l=v[e.index]||[],y=e.member.names,o=0;o<w;o++){for(u={members:[]},h=0;h<y.length;h++)h===e.member.expandedIdx?(u.members[u.members.length]={children:[],caption:f.value,name:f.name,hasChildren:!1,levelNum:1,levelName:f.parentName+f.name,parentName:f.parentName,hierarchy:f.parentName+f.name},o===0&&l.push(rt(u,h).join(""))):(s=y[h],p=s.split("&"),u.members[u.members.length]={children:[],caption:(k[s]||{}).caption||"All",name:s,levelName:s,levelNum:"0",hasChildren:!0,parentName:p.length>1?p[0]:t,hierarchy:s});w>1&&(u.members[u.members.length]={children:[],caption:r[o].caption,name:r[o].descriptor.name,levelName:"MEASURES",levelNum:"0",hasChildren:!0,parentName:t,hierarchy:"MEASURES"});c[c.length]=u}a[e.index]=c;v[e.index]=l}return{keys:v,tuples:a}},_findExpandedMember:function(n,t){for(var i=0;i<n.length;i++)if(n[i].uniquePath===t)return{member:n[i],index:i}},_asTuples:function(n,t,i){i=i||[];var r=this._rootTuples(t.root,i),u=this._expandedTuples(n,t.expanded,i);return{keys:[].concat.apply(r.keys,u.keys),tuples:[].concat.apply(r.tuples,u.tuples)}},_measuresInfo:function(n,t){for(var u=0,s=n&&n.length,f=[],e={},o={},h=this.measures||{},i,r;u<s;u++)r=n[u].descriptor.name,i=h[r]||{},f.push(r),i.result&&(e[r]=i.result),i.format&&(o[r]=i.format);return{names:f,formats:o,resultFuncs:e,rowAxis:t}},_toDataArray:function(n,t,i,r){var y=[],w,u,f,e,o,s,c,l,a,b=1,v=[],h,k=i.length||1,d=r.length||1;for(t.rowAxis?(v=t.names,b=v.length):h=t.names,f=0;f<k;f++)for(c=n[i[f]||p],s=0;s<b;s++)for(t.rowAxis&&(h=[v[s]]),e=0;e<d;e++)for(a=r[e]||p,l=c.items[a],w=a===p?c.aggregates:l?l.aggregates:{},o=0;o<h.length;o++)u=h[o],this._addData(y,w[u],t.formats[u],t.resultFuncs[u]);return y},_addData:function(n,t,r,u){var e="",f;t&&(t=u?u(t):t.accumulator,e=r?i.format(r,t):t);f=n.length;n[f]={ordinal:f,value:t||"",fmtValue:e}},_matchDescriptors:function(n,i,r){for(var f,e,o,h=i.names,s=i.expandedIdx,u;s>0;)if(f=h[--s].split("&"),f.length>1&&(e=f[0],o=f[1],u=r[e](n),u=u!==t&&u!==null?u.toString():u,u!=o))return!1;return!0},_calculateAggregate:function(n,t,i){for(var e={},r,f,u=0;u<n.length;u++)f=n[u].descriptor.name,r=i.aggregates[f]||{},r.accumulator=n[u].aggregator(t,r),e[f]=r;return e},_processColumns:function(n,i,r,u,f,e,o,s){for(var h,l,v,b,a,c,y,p,k=f.dataItem,w=0;w<i.length;w++)(l=i[w],this._matchDescriptors(k,l,r))&&(p=l.names.slice(0,l.expandedIdx).join(""),c=l.names[l.expandedIdx],h=r[c](k),h=h!==t&&h!==null?h.toString():h,y=c,c=c+"&"+h,a=p+c,v=u[a]||{index:o.columnIndex,parentName:y,name:c,uniquePath:p+y,value:h},b=e.items[a]||{aggregates:{}},e.items[a]={index:v.index,aggregates:this._calculateAggregate(n,f,b)},s&&(u[a]||o.columnIndex++,u[a]=v))},_measureAggregators:function(n){var u=n.measures||[],h=this.measures||{},f=[],e,t,r,s,i,o;if(u.length){for(r=0,s=u.length;r<s;r++)if(e=u[r],t=h[e.name],i=null,t){if(o=t.aggregate,typeof o=="string"){if(i=kr[o.toLowerCase()],!i)throw new Error("There is no such aggregate function");t.aggregate=i.aggregate||i;t.result=i.result}f.push({descriptor:e,caption:t.caption,result:t.result,aggregator:br(t)})}}else f.push({descriptor:{name:"default"},caption:"default",aggregator:function(){return 1}});return f},_buildGetters:function(n){for(var u={},t,r,f=0;f<n.length;f++)r=n[f],t=r.split("&"),t.length>1?u[t[0]]=i.getter(t[0],!0):u[r]=i.getter(ui(r),!0);return u},_parseDescriptors:function(n){for(var i=ki(n),r=wi(i.root),u=i.expanded,f=[],t=0;t<u.length;t++)f.push(bi(u[t].name,r));return{root:r,expanded:f}},_filter:function(n,t){if(!t)return n;for(var u,r=0,f=t.filters;r<f.length;r++)u=f[r],u.operator==="in"&&(f[r]=this._normalizeFilter(u));return new i.data.Query(n).filter(t).data},_normalizeFilter:function(n){var t=n.value.split(","),r=[],i;if(!t.length)return t;for(i=0;i<t.length;i++)r.push({field:n.field,operator:"eq",value:t[i]});return{logic:"or",filters:r}},process:function(n,i){n=n||[];i=i||{};n=this._filter(n,i.filter);var tt=i.measures||[],l=i.measuresAxis==="rows",r=i.columns||[],u=i.rows||[];!r.length&&u.length&&(!tt.length||tt.length&&l)&&(r=u,u=[],l=!1);r.length||u.length||(l=!1);!r.length&&tt.length&&(r=o(i.measures));r=this._parseDescriptors(r);u=this._parseDescriptors(u);var e={},s={},y={},h,it={columnIndex:0},f=this._measureAggregators(i),rt=this._buildGetters(r.root),ct=this._buildGetters(u.root),lt=!1,ut=r.expanded,ft=u.expanded,d,a,vt=ft.length!==0,g,v,c,w,nt,et,ot,b,st,ht,at=n.length,k=0;if(r.root.length||u.root.length)for(lt=!0,k=0;k<at;k++)for(d=n[k],a={dataItem:d,index:k},w=e[p]||{items:{},aggregates:{}},this._processColumns(f,ut,rt,s,a,w,it,!vt),w.aggregates=this._calculateAggregate(f,a,w),e[p]=w,g=0;g<ft.length;g++){if(v=ft[g],!this._matchDescriptors(d,v,ct)){this._processColumns(f,ut,rt,s,a,{items:{},aggregates:{}},it,!0);continue}et=v.names.slice(0,v.expandedIdx).join("");c=v.names[v.expandedIdx];ot=c;h=ct[c](d);h=h!==t?h.toString():h;c=c+"&"+h;nt=et+c;y[nt]={uniquePath:et+ot,parentName:ot,name:c,value:h};b=e[nt]||{items:{},aggregates:{}};this._processColumns(f,ut,rt,s,a,b,it,!0);b.aggregates=this._calculateAggregate(f,a,b);e[nt]=b}return lt&&at?(f.length>1&&(!i.columns||!i.columns.length)&&(r={root:[],expanded:[]}),st=this._asTuples(s,r,l?[]:f),ht=this._asTuples(y,u,l?f:[]),s=st.tuples,y=ht.tuples,e=this._toDataArray(e,this._measuresInfo(f,l),ht.keys,st.keys)):e=s=y=[],{axes:{columns:{tuples:s},rows:{tuples:y}},data:e}}}),dr=b.extend({init:function(n,t){this.transport=t;this.options=t.options||{};this.transport.discover||bt(n.discover)&&(this.discover=n.discover)},read:function(n){return this.transport.read(n)},update:function(n){return this.transport.update(n)},create:function(n){return this.transport.create(n)},destroy:function(n){return this.transport.destroy(n)},discover:function(n){if(this.transport.discover)return this.transport.discover(n);n.success({})},catalog:function(i){var u=this.options||{},r;if(i===t)return(u.connection||{}).catalog;r=u.connection||{};r.catalog=i;this.options.connection=r;n.extend(this.transport.options,{connection:r})},cube:function(n){var r=this.options||{},i;if(n===t)return(r.connection||{}).cube;i=r.connection||{};i.cube=n;this.options.connection=i;u(!0,this.transport.options,{connection:i})}}),nt=k.extend({init:function(t){var r=((t||{}).schema||{}).cube,h="columns",i,f={axes:e,cubes:e,catalogs:e,measures:e,dimensions:e,hierarchies:e,levels:e,members:e};r&&(f=n.extend(f,this._cubeSchema(r)),this.cubeBuilder=new fi(r));k.fn.init.call(this,u(!0,{},{schema:f},t));this.transport=new dr(this.options.transport||{},this.transport);this._columns=o(this.options.columns);this._rows=o(this.options.rows);i=this.options.measures||[];s.call(i)==="[object Object]"&&(h=i.axis||"columns",i=i.values||[]);this._measures=vt(i);this._measuresAxis=h;this._skipNormalize=0;this._axes={}},_cubeSchema:function(t){return{dimensions:function(){var i=[],r=t.dimensions;for(var n in r)i.push({name:n,caption:r[n].caption||n,uniqueName:n,defaultHierarchy:n,type:1});return t.measures&&i.push({name:y,caption:y,uniqueName:y,type:2}),i},hierarchies:function(){return[]},measures:function(){var i=[],r=t.measures;for(var n in r)i.push({name:n,caption:n,uniqueName:n,aggregator:n});return i},members:n.proxy(function(n,r){var u=r.levelUniqueName||r.memberUniqueName,s=this.options.data||this._rawData||[],e=[],h,f,o=0,c={};if(u&&(u=u.split(".")[0]),!r.treeOp)return e.push({caption:t.dimensions[u].caption||u,childrenCardinality:"1",dimensionUniqueName:u,hierarchyUniqueName:u,levelUniqueName:u,name:u,uniqueName:u}),e;for(h=i.getter(ui(u),!0);o<s.length;o++)f=h(s[o]),(f||f===0)&&!c[f]&&(c[f]=!0,e.push({caption:f,childrenCardinality:"0",dimensionUniqueName:u,hierarchyUniqueName:u,levelUniqueName:u,name:f,uniqueName:f}));return e},this)}},options:{serverSorting:!0,serverPaging:!0,serverFiltering:!0,serverGrouping:!0,serverAggregates:!0},catalog:function(n){if(n===t)return this.transport.catalog();this.transport.catalog(n);this._mergeState({});this._axes={};this.data([])},cube:function(n){if(n===t)return this.transport.cube();this.transport.cube(n);this._axes={};this._mergeState({});this.data([])},axes:function(){return this._axes},columns:function(n){if(n===t)return this._columns;this._skipNormalize+=1;this._clearAxesData=!0;this._columns=o(n);this.query({columns:n,rows:this.rowsAxisDescriptors(),measures:this.measures()})},rows:function(n){if(n===t)return this._rows;this._skipNormalize+=1;this._clearAxesData=!0;this._rows=o(n);this.query({columns:this.columnsAxisDescriptors(),rows:n,measures:this.measures()})},measures:function(n){if(n===t)return this._measures;this._skipNormalize+=1;this._clearAxesData=!0;this.query({columns:this.columnsAxisDescriptors(),rows:this.rowsAxisDescriptors(),measures:vt(n)})},measuresAxis:function(){return this._measuresAxis||"columns"},_expandPath:function(n,t){var f=t==="columns"?"columns":"rows",e=t==="columns"?"rows":"columns",i=o(n),c=h(i[i.length-1]),r,s,u;for(this._lastExpanded=f,i=wr(this.axes()[f],i,this.measures()),r=0;r<i.length;r++)if(s=h(i[r]),s===c){if(i[r].expand)return;i[r].expand=!0}else i[r].expand=!1;u={};u[f]=i;u[e]=this._descriptorsForAxis(e);this._query(u)},_descriptorsForAxis:function(n){var t=this.axes(),i=this[n]()||[];return t&&t[n]&&t[n].tuples&&t[n].tuples[0]&&(i=vr(t[n].tuples||[])),i},columnsAxisDescriptors:function(){return this._descriptorsForAxis("columns")},rowsAxisDescriptors:function(){return this._descriptorsForAxis("rows")},_process:function(n,t){this._view=n;t=t||{};t.items=t.items||this._view;this.trigger(a,t)},_query:function(n){var t=this;return n||(this._skipNormalize+=1,this._clearAxesData=!0),t.query(u({},{page:t.page(),pageSize:t.pageSize(),sort:t.sort(),filter:t.filter(),group:t.group(),aggregate:t.aggregate(),columns:this.columnsAxisDescriptors(),rows:this.rowsAxisDescriptors(),measures:this.measures()},n))},query:function(t){var i=this._mergeState(t);return this._data.length&&this.cubeBuilder?(this._params(i),this._updateLocalData(this._pristineData),n.Deferred().resolve().promise()):this.read(i)},_mergeState:function(n){return n=k.fn._mergeState.call(this,n),n!==t&&(this._measures=vt(n.measures),n.columns?n.columns=o(n.columns):n.columns||(this._columns=[]),n.rows?n.rows=o(n.rows):n.rows||(this._rows=[])),n},filter:function(n){if(n===t)return this._filter;this._skipNormalize+=1;this._clearAxesData=!0;this._query({filter:n,page:1})},expandColumn:function(n){this._expandPath(n,"columns")},expandRow:function(n){this._expandPath(n,"rows")},success:function(n){var t;this.cubeBuilder&&(t=(this.reader.data(n)||[]).slice(0));k.fn.success.call(this,n);t&&(this._pristineData=t)},_processResult:function(n,t){var f,h;this.cubeBuilder&&(f=this.cubeBuilder.process(n,this._requestData),n=f.data,t=f.axes);var c,l,u,i,r,e,o=this.columns(),s=this.rows(),a=t.columns&&t.columns.tuples;return!o.length&&s.length&&a&&(this._rowMeasures().length||!this.measures().length)&&(t={columns:{},rows:t.columns}),o.length||s.length||this.measuresAxis()!=="rows"||!a||(t={columns:{},rows:t.columns}),this._axes={columns:ot(this._axes.columns),rows:ot(this._axes.rows)},t={columns:ot(t.columns),rows:ot(t.rows)},c=this._normalizeTuples(t.columns.tuples,this._axes.columns.tuples,o,this._columnMeasures()),l=this._normalizeTuples(t.rows.tuples,this._axes.rows.tuples,s,this._rowMeasures()),this._skipNormalize-=1,this.cubeBuilder||(n=this._normalizeData({columnsLength:t.columns.tuples.length,rowsLength:t.rows.tuples.length,columnIndexes:c,rowIndexes:l,data:n})),this._lastExpanded=="rows"?(u=t.columns.tuples,r=this._columnMeasures(),i=ei(t.columns,this._axes.columns,r),i&&(e="columns",t.columns=i,gr(u,i.tuples,t.rows.tuples.length,r,n),this.cubeBuilder||(n=this._normalizeData({columnsLength:v(t.columns.tuples,r),rowsLength:t.rows.tuples.length,data:n})))):this._lastExpanded=="columns"&&(u=t.rows.tuples,r=this._rowMeasures(),i=ei(t.rows,this._axes.rows,r),i&&(e="rows",t.rows=i,nu(u,i.tuples,t.columns.tuples.length,r,n),this.cubeBuilder||(n=this._normalizeData({columnsLength:v(t.rows.tuples,r),rowsLength:t.columns.tuples.length,data:n})))),this._lastExpanded=null,h=this._mergeAxes(t,n,e),this._axes=h.axes,h.data},_readData:function(n){var i=this.reader.axes(n),t=this.reader.data(n);return this.cubeBuilder&&(this._rawData=t),this._processResult(t,i)},_createTuple:function(n,t,i){var v=n.members,y=v.length,o={members:[]},s,u,f,e,h,c,l,r,a=0;for(t&&(y-=1);a<y;a++)r=v[a],u=Number(r.levelNum),f=r.name,e=r.parentName,l=r.caption||f,h=r.hasChildren,c=r.hierarchy,s=r.levelName,i&&(l="All",u===0?e=r.name:u-=1,h=!0,f=c=s=e),o.members.push({name:f,children:[],caption:l,levelName:s,levelNum:u.toString(),hasChildren:h,hierarchy:c,parentName:i?"":e});return t&&o.members.push({name:t.name,children:[]}),o},_hasRoot:function(n,t,i){var u,f,e,o,s,r,c;if(t.length)return tt(t,n).tuple;for(u=n.members,o=!0,r=0,c=u.length;r<c;r++)if(f=u[r],s=Number(f.levelNum)||0,e=i[r],!(s===0||e&&f.name===h(e))){o=!1;break}return o},_mergeAxes:function(n,t,i){var f=this._columnMeasures(),s=this._rowMeasures(),u=this.axes(),h,r,l=n.rows.tuples.length,a=v(u.columns.tuples,f),c=n.columns.tuples.length,e,o,y;return i=="columns"?(c=a,r=n.columns.tuples):(r=ci(n.columns.tuples,f),t=ou(r,t)),e=hi(u.columns.tuples,r,f),i=="rows"?(l=v(n.rows.tuples,s),r=n.rows.tuples):(r=ci(n.rows.tuples,s),t=eu(r,t)),o=hi(u.rows.tuples,r,s),u.columns.tuples=e.tuples,u.rows.tuples=o.tuples,a!==v(u.columns.tuples,f)?(h=e.index+si(e.parsedRoot,e.memberIndex,f),y=a+c,t=this._mergeColumnData(t,h,l,c,y)):(h=o.index+si(o.parsedRoot,o.memberIndex,s),t=this._mergeRowData(t,h,l,c)),{axes:u,data:t}},_mergeColumnData:function(n,t,i,r,u){var e=this.data().toJSON(),f,s,h=0,o,c=Math.max(this._columnMeasures().length,1);for(i=Math.max(i,1),e.length>0&&(h=c,u-=c),f=0;f<i;f++)s=t+f*u,o=n.splice(0,r),o.splice(0,h),[].splice.apply(e,[s,0].concat(o));return e},_mergeRowData:function(n,t,i,r){var f=this.data().toJSON(),u,e,o,s=Math.max(this._rowMeasures().length,1);for(r=Math.max(r,1),f.length>0&&(i-=s,n.splice(0,r*s)),u=0;u<i;u++)o=n.splice(0,r),e=t*r+u*r,[].splice.apply(f,[e,0].concat(o));return f},_columnMeasures:function(){var n=this.measures(),t=[];return this.measuresAxis()==="columns"&&(this.columns().length===0?t=n:n.length>1&&(t=n)),t},_rowMeasures:function(){var n=this.measures(),t=[];return this.measuresAxis()==="rows"&&(this.rows().length===0?t=n:n.length>1&&(t=n)),t},_updateLocalData:function(n,t){this.cubeBuilder&&(t&&(this._requestData=t),n=this._processResult(n));this._data=this._observe(n);this._ranges=[];this._addRange(this._data);this._total=this._data.length;this._pristineTotal=this._total;this._process(this._data)},data:function(n){var i=this;if(n!==t)this._pristineData=n.slice(0),this._updateLocalData(n,{columns:this.columns(),rows:this.rows(),measures:this.measures()});else return i._data},_normalizeTuples:function(n,t,i,r){var o=r.length||1,u=0,l=[],s={},e=0,f,h,c;if(n.length){if(this._skipNormalize<=0&&!this._hasRoot(n[0],t,i)){for(this._skipNormalize=0;u<o;u++)l.push(this._createTuple(n[0],r[u],!0)),s[u]=u;n.splice.apply(n,[0,n.length].concat(l).concat(n));u=o}if(r.length)for(c=f=n[u],h=f.members.length-1;f;){if(e>=o&&(e=0),f.members[h].name!==r[e].name&&(n.splice(u,0,this._createTuple(f,r[e])),s[u]=u),u+=1,e+=1,f=n[u],o>e&&(!f||sr(c,h-1)!==sr(f,h-1))){for(;e<o;e++)n.splice(u,0,this._createTuple(c,r[e])),s[u]=u,u+=1;f=n[u]}c=f}return s}},_normalizeData:function(n){var o=n.data,l=n.columnIndexes||{},a=n.rowIndexes||{},e=n.columnsLength||1,s=e*(n.rowsLength||1),i=0,c=0,f=0,r,h,u=new Array(s);if(o.length===s)return o;for(;i<s;i++){while(a[parseInt(i/e,10)]!==t)for(h=0;h<e;h++)u[i]={value:"",fmtValue:"",ordinal:i},i+=1;while(l[i%e]!==t)u[i]={value:"",fmtValue:"",ordinal:i},i+=1;if(r=o[c],r){if(r.ordinal-f>1)for(f+=1;f<r.ordinal;f++)u[i]={value:"",fmtValue:"",ordinal:i},i+=1;f=r.ordinal;r.ordinal=i;u[i]=r;c+=1}else u[i]={value:"",fmtValue:"",ordinal:i}}return u},discover:function(t,i){var r=this,f=r.transport;return n.Deferred(function(n){f.discover(u({success:function(t){(t=r.reader.parse(t),r._handleCustomErrors(t))||(i&&(t=i(t)),n.resolve(t))},error:function(t,i,u){n.reject(t);r.error(t,i,u)}},t))}).promise().done(function(){r.trigger("schemaChange")})},schemaMeasures:function(){var n=this;return n.discover({data:{command:"schemaMeasures",restrictions:{catalogName:n.transport.catalog(),cubeName:n.transport.cube()}}},function(t){return n.reader.measures(t)})},schemaKPIs:function(){var n=this;return n.discover({data:{command:"schemaKPIs",restrictions:{catalogName:n.transport.catalog(),cubeName:n.transport.cube()}}},function(t){return n.reader.kpis(t)})},schemaDimensions:function(){var n=this;return n.discover({data:{command:"schemaDimensions",restrictions:{catalogName:n.transport.catalog(),cubeName:n.transport.cube()}}},function(t){return n.reader.dimensions(t)})},schemaHierarchies:function(n){var t=this;return t.discover({data:{command:"schemaHierarchies",restrictions:{catalogName:t.transport.catalog(),cubeName:t.transport.cube(),dimensionUniqueName:n}}},function(n){return t.reader.hierarchies(n)})},schemaLevels:function(n){var t=this;return t.discover({data:{command:"schemaLevels",restrictions:{catalogName:t.transport.catalog(),cubeName:t.transport.cube(),hierarchyUniqueName:n}}},function(n){return t.reader.levels(n)})},schemaCubes:function(){var n=this;return n.discover({data:{command:"schemaCubes",restrictions:{catalogName:n.transport.catalog()}}},function(t){return n.reader.cubes(t)})},schemaCatalogs:function(){var n=this;return n.discover({data:{command:"schemaCatalogs"}},function(t){return n.reader.catalogs(t)})},schemaMembers:function(n){var t=this,i=function(n){return function(i){return t.reader.members(i,n)}}(n);return t.discover({data:{command:"schemaMembers",restrictions:u({catalogName:t.transport.catalog(),cubeName:t.transport.cube()},n)}},i)},_params:function(n){this._clearAxesData&&(this._axes={},this._data=this._observe([]),this._clearAxesData=!1,this.trigger(lt));var t=k.fn._params.call(this,n);return t=u({measures:this.measures(),measuresAxis:this.measuresAxis(),columns:this.columns(),rows:this.rows()},t),this.cubeBuilder&&(this._requestData=t),t}}),gi,fr,er,pt;nt.create=function(n){n=n&&n.push?{data:n}:n;var t=n||{},r=t.data;if(t.data=r,!(t instanceof nt)&&t instanceof i.data.DataSource)throw new Error("Incorrect DataSource type. Only PivotDataSource instances are supported");return t instanceof nt?t:new nt(t)};gi={contains:', InStr({0}.CurrentMember.MEMBER_CAPTION,"{1}") > 0',doesnotcontain:', InStr({0}.CurrentMember.MEMBER_CAPTION,"{1}") = 0',startswith:', Left({0}.CurrentMember.MEMBER_CAPTION,Len("{1}"))="{1}"',endswith:', Right({0}.CurrentMember.MEMBER_CAPTION,Len("{1}"))="{1}"',eq:', {0}.CurrentMember.MEMBER_CAPTION = "{1}"',neq:', NOT {0}.CurrentMember.MEMBER_CAPTION = "{1}"'};var lu={schemaCubes:"MDSCHEMA_CUBES",schemaCatalogs:"DBSCHEMA_CATALOGS",schemaMeasures:"MDSCHEMA_MEASURES",schemaDimensions:"MDSCHEMA_DIMENSIONS",schemaHierarchies:"MDSCHEMA_HIERARCHIES",schemaLevels:"MDSCHEMA_LEVELS",schemaMembers:"MDSCHEMA_MEMBERS",schemaKPIs:"MDSCHEMA_KPIS"},au={read:function(n){var t='<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"><Header/><Body><Execute xmlns="urn:schemas-microsoft-com:xml-analysis"><Command><Statement>SELECT NON EMPTY {';var f=n.columns||[],r=n.rows||[],i=n.measures||[],u=n.measuresAxis==="rows",e=n.sort||[];return!f.length&&r.length&&(!i.length||i.length&&u)&&(f=r,r=[],u=!1),f.length||r.length||(u=!1),f.length?t+=di(f,u?[]:i,e):i.length&&!u&&(t+=st(i).join(",")),t+="} DIMENSION PROPERTIES CHILDREN_CARDINALITY, PARENT_UNIQUE_NAME ON COLUMNS",(r.length||u&&i.length>1)&&(t+=", NON EMPTY {",t+=r.length?di(r,u?i:[],e):st(i).join(","),t+="} DIMENSION PROPERTIES CHILDREN_CARDINALITY, PARENT_UNIQUE_NAME ON ROWS"),n.filter?(t+=" FROM ",t+="(",t+=cu(n.filter,n.connection.cube),t+=")"):t+=" FROM ["+n.connection.cube+"]",i.length==1&&f.length&&(t+=" WHERE ("+st(i).join(",")+")"),t+="<\/Statement><\/Command><Properties><PropertyList><Catalog>"+n.connection.catalog+"<\/Catalog><Format>Multidimensional<\/Format><\/PropertyList><\/Properties><\/Execute><\/Body><\/Envelope>",t.replace(/\&/g,"&amp;")},discover:function(t){t=t||{};var i='<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"><Header/><Body><Discover xmlns="urn:schemas-microsoft-com:xml-analysis">';return i+="<RequestType>"+(lu[t.command]||t.command)+"<\/RequestType>",i+="<Restrictions>"+nr("RestrictionList",t.restrictions,!0)+"<\/Restrictions>",t.connection&&t.connection.catalog&&(t.properties=n.extend({},{Catalog:t.connection.catalog},t.properties)),i+="<Properties>"+nr("PropertyList",t.properties)+"<\/Properties>",i+"<\/Discover><\/Body><\/Envelope>"}},tr=i.data.RemoteTransport.extend({init:function(n){var t=n;n=this.options=u(!0,{},this.options,n);i.data.RemoteTransport.call(this,n);bt(t.discover)?this.discover=t.discover:typeof t.discover=="string"?this.options.discover={url:t.discover}:t.discover||(this.options.discover=this.options.read)},setup:function(t,r){return t.data=t.data||{},n.extend(!0,t.data,{connection:this.options.connection}),i.data.RemoteTransport.fn.setup.call(this,t,r)},options:{read:{dataType:"text",contentType:"text/xml",type:"POST"},discover:{dataType:"text",contentType:"text/xml",type:"POST"},parameterMap:function(n,t){return au[t](n,t)}},discover:function(t){return n.ajax(this.setup(t,"discover"))}});var c={cubes:{name:i.getter("CUBE_NAME['#text']",!0),caption:i.getter("CUBE_CAPTION['#text']",!0),description:i.getter("DESCRIPTION['#text']",!0),type:i.getter("CUBE_TYPE['#text']",!0)},catalogs:{name:i.getter("CATALOG_NAME['#text']",!0),description:i.getter("DESCRIPTION['#text']",!0)},measures:{name:i.getter("MEASURE_NAME['#text']",!0),caption:i.getter("MEASURE_CAPTION['#text']",!0),uniqueName:i.getter("MEASURE_UNIQUE_NAME['#text']",!0),description:i.getter("DESCRIPTION['#text']",!0),aggregator:i.getter("MEASURE_AGGREGATOR['#text']",!0),groupName:i.getter("MEASUREGROUP_NAME['#text']",!0),displayFolder:i.getter("MEASURE_DISPLAY_FOLDER['#text']",!0),defaultFormat:i.getter("DEFAULT_FORMAT_STRING['#text']",!0)},kpis:{name:i.getter("KPI_NAME['#text']",!0),caption:i.getter("KPI_CAPTION['#text']",!0),value:i.getter("KPI_VALUE['#text']",!0),goal:i.getter("KPI_GOAL['#text']",!0),status:i.getter("KPI_STATUS['#text']",!0),trend:i.getter("KPI_TREND['#text']",!0),statusGraphic:i.getter("KPI_STATUS_GRAPHIC['#text']",!0),trendGraphic:i.getter("KPI_TREND_GRAPHIC['#text']",!0),description:i.getter("KPI_DESCRIPTION['#text']",!0),groupName:i.getter("MEASUREGROUP_NAME['#text']",!0)},dimensions:{name:i.getter("DIMENSION_NAME['#text']",!0),caption:i.getter("DIMENSION_CAPTION['#text']",!0),description:i.getter("DESCRIPTION['#text']",!0),uniqueName:i.getter("DIMENSION_UNIQUE_NAME['#text']",!0),defaultHierarchy:i.getter("DEFAULT_HIERARCHY['#text']",!0),type:i.getter("DIMENSION_TYPE['#text']",!0)},hierarchies:{name:i.getter("HIERARCHY_NAME['#text']",!0),caption:i.getter("HIERARCHY_CAPTION['#text']",!0),description:i.getter("DESCRIPTION['#text']",!0),uniqueName:i.getter("HIERARCHY_UNIQUE_NAME['#text']",!0),dimensionUniqueName:i.getter("DIMENSION_UNIQUE_NAME['#text']",!0),displayFolder:i.getter("HIERARCHY_DISPLAY_FOLDER['#text']",!0),origin:i.getter("HIERARCHY_ORIGIN['#text']",!0),defaultMember:i.getter("DEFAULT_MEMBER['#text']",!0)},levels:{name:i.getter("LEVEL_NAME['#text']",!0),caption:i.getter("LEVEL_CAPTION['#text']",!0),description:i.getter("DESCRIPTION['#text']",!0),uniqueName:i.getter("LEVEL_UNIQUE_NAME['#text']",!0),dimensionUniqueName:i.getter("DIMENSION_UNIQUE_NAME['#text']",!0),displayFolder:i.getter("LEVEL_DISPLAY_FOLDER['#text']",!0),orderingProperty:i.getter("LEVEL_ORDERING_PROPERTY['#text']",!0),origin:i.getter("LEVEL_ORIGIN['#text']",!0),hierarchyUniqueName:i.getter("HIERARCHY_UNIQUE_NAME['#text']",!0)},members:{name:i.getter("MEMBER_NAME['#text']",!0),caption:i.getter("MEMBER_CAPTION['#text']",!0),uniqueName:i.getter("MEMBER_UNIQUE_NAME['#text']",!0),dimensionUniqueName:i.getter("DIMENSION_UNIQUE_NAME['#text']",!0),hierarchyUniqueName:i.getter("HIERARCHY_UNIQUE_NAME['#text']",!0),levelUniqueName:i.getter("LEVEL_UNIQUE_NAME['#text']",!0),childrenCardinality:i.getter("CHILDREN_CARDINALITY['#text']",!0)}},rr=["axes","catalogs","cubes","dimensions","hierarchies","levels","measures"],ur=i.data.XmlDataReader.extend({init:function(n){i.data.XmlDataReader.call(this,n);this._extend(n)},_extend:function(n){for(var i=0,u=rr.length,r,t;i<u;i++)r=rr[i],t=n[r],t&&t!==e&&(this[r]=t)},parse:function(n){var t=i.data.XmlDataReader.fn.parse(n.replace(/<(\/?)(\w|-)+:/g,"<$1"));return i.getter("['Envelope']['Body']",!0)(t)},errors:function(n){var t=i.getter("['Fault']",!0)(n);return t?[{faultstring:i.getter("faultstring['#text']",!0)(t),faultcode:i.getter("faultcode['#text']",!0)(t)}]:null},axes:function(n){var f,r,t,u;for(n=i.getter('ExecuteResponse["return"].root',!0)(n),f=it(i.getter("Axes.Axis",!0)(n)),t={columns:{},rows:{}},u=0;u<f.length;u++)r=f[u],r["@name"].toLowerCase()!=="sliceraxis"&&(t.columns.tuples?t.rows=ir(r):t.columns=ir(r));return t},data:function(n){var t;n=i.getter('ExecuteResponse["return"].root',!0)(n);var r=it(i.getter("CellData.Cell",!0)(n)),u=[],f=i.getter("['@CellOrdinal']"),e=i.getter("Value['#text']"),o=i.getter("FmtValue['#text']");for(t=0;t<r.length;t++)u.push({value:e(r[t]),fmtValue:o(r[t]),ordinal:parseInt(f(r[t]),10)});return u},_mapSchema:function(n,t){var u,f,r,e,o;for(n=i.getter('DiscoverResponse["return"].root',!0)(n),u=it(i.getter("row",!0)(n)),f=[],r=0;r<u.length;r++){e={};for(o in t)e[o]=t[o](u[r]);f.push(e)}return f},measures:function(n){return this._mapSchema(n,c.measures)},kpis:function(n){return this._mapSchema(n,c.kpis)},hierarchies:function(n){return this._mapSchema(n,c.hierarchies)},levels:function(n){return this._mapSchema(n,c.levels)},dimensions:function(n){return this._mapSchema(n,c.dimensions)},cubes:function(n){return this._mapSchema(n,c.cubes)},catalogs:function(n){return this._mapSchema(n,c.catalogs)},members:function(n){return this._mapSchema(n,c.members)}});u(!0,i.data,{PivotDataSource:nt,XmlaTransport:tr,XmlaDataReader:ur,PivotCubeBuilder:fi,transports:{xmla:tr},readers:{xmla:ur}});fr=function(n,t){if(!n)return null;for(var i=0,r=n.length;i<r;i++)if(n[i].field===t)return n[i];return null};er=function(n,t){for(var r=[],i=0,u=n.length;i<u;i++)n[i].field!==t&&r.push(n[i]);return r};i.ui.PivotSettingTarget=l.extend({init:function(t,r){var u=this;l.fn.init.call(u,t,r);u.element.addClass("k-pivot-setting");u.dataSource=i.data.PivotDataSource.create(r.dataSource);u._refreshHandler=n.proxy(u.refresh,u);u.dataSource.first(a,u._refreshHandler);r.template||(u.options.template="<div data-"+i.ns+'name="${data.name || data}">${data.name || data}'+(u.options.enabled?'<a class="k-button k-button-icon k-button-bare"><span class="k-icon k-setting-delete"><\/span><\/a>':"")+"<\/div>");u.template=i.template(u.options.template);u.emptyTemplate=i.template(u.options.emptyTemplate);u._sortable();u.element.on("click"+g,".k-button,.k-item",function(t){var r=n(t.target),f=r.closest("["+i.attr("name")+"]").attr(i.attr("name"));f&&(r.hasClass("k-setting-delete")?u.remove(f):u.options.sortable&&r[0]===t.currentTarget&&u.sort({field:f,dir:r.find(".k-i-sort-asc")[0]?"desc":"asc"}))});(r.filterable||r.sortable)&&(u.fieldMenu=new ct.PivotFieldMenu(u.element,{messages:u.options.messages.fieldMenu,filter:".k-setting-fieldmenu",filterable:r.filterable,sortable:r.sortable,dataSource:u.dataSource}));u.refresh()},options:{name:"PivotSettingTarget",template:null,filterable:!1,sortable:!1,emptyTemplate:"<div class='k-empty'>${data}<\/div>",setting:"columns",enabled:!0,messages:{empty:"Drop Fields Here"}},setDataSource:function(n){this.dataSource.unbind(a,this._refreshHandler);this.dataSource=this.options.dataSource=n;this.fieldMenu&&this.fieldMenu.setDataSource(n);n.first(a,this._refreshHandler);this.refresh()},_sortable:function(){var n=this;n.options.enabled&&(this.sortable=this.element.kendoSortable({connectWith:this.options.connectWith,filter:">:not(.k-empty)",hint:n.options.hint,cursor:"move",start:function(n){n.item.focus().blur()},change:function(t){var r=t.item.attr(i.attr("name"));t.action=="receive"?n.add(r):t.action=="remove"?n.remove(r):t.action=="sort"&&n.move(r,t.newIndex)}}).data("kendoSortable"))},_indexOf:function(n,t){for(var u=-1,i=0,r=t.length;i<r;i++)if(h(t[i])===n){u=i;break}return u},_isKPI:function(n){return n.type==="kpi"||n.measure},validate:function(n){var r=n.type==2||"aggregator"in n||this._isKPI(n),t,i;return r?this.options.setting==="measures":this.options.setting==="measures"?r:(t=this.dataSource[this.options.setting](),i=n.defaultHierarchy||n.uniqueName,this._indexOf(i,t)>-1)?!1:(t=this.dataSource[this.options.setting==="columns"?"rows":"columns"](),this._indexOf(i,t)>-1)?!1:!0},add:function(t){var r=this.dataSource[this.options.setting](),i,u;for(t=n.isArray(t)?t.slice(0):[t],i=0,u=t.length;i<u;i++)this._indexOf(t[i],r)!==-1&&(t.splice(i,1),i-=1,u-=1);t.length&&(r=r.concat(t),this.dataSource[this.options.setting](r))},move:function(n,t){var i=this.dataSource[this.options.setting](),r=this._indexOf(n,i);r>-1&&(n=i.splice(r,1)[0],i.splice(t,0,n),this.dataSource[this.options.setting](i))},remove:function(n){var t=this.dataSource[this.options.setting](),i=this._indexOf(n,t);i>-1&&(t.splice(i,1),this.dataSource[this.options.setting](t))},sort:function(n){var i=this.options.sortable,u=i===!0||i.allowUnsort,f=u&&n.dir==="asc",r=this.dataSource.sort()||[],t=er(r,n.field);f&&r.length!==t.length&&(n=null);n&&t.push(n);this.dataSource.sort(t)},refresh:function(){var i="",f=this.dataSource[this.options.setting](),e=f.length,r=0,n;if(e)for(;r<e;r++)n=f[r],n=n.name===t?{name:n}:n,i+=this.template(u({sortIcon:this._sortIcon(n.name)},n));else i=this.emptyTemplate(this.options.messages.empty);this.element.html(i)},destroy:function(){l.fn.destroy.call(this);this.dataSource.unbind(a,this._refreshHandler);this.element.off(g);this.sortable&&this.sortable.destroy();this.fieldMenu&&this.fieldMenu.destroy();this.element=null;this._refreshHandler=null},_sortIcon:function(n){var r=this.dataSource.sort(),t=fr(r,h(n)),i="";return t&&(i="k-i-sort-"+t.dir),i}});var ht=l.extend({init:function(r,u){var f=this,e,o;l.fn.init.call(f,r,u);f._dataSource();f._bindConfigurator();f._wrapper();f._createLayout();f._columnBuilder=e=new vu;f._rowBuilder=o=new yu;f._contentBuilder=new pu;f._templates();f.columnsHeader.add(f.rowsHeader).on("click","span.k-icon",function(){var u=n(this),h=e,a="expandColumn",v,c=u.attr(i.attr("path")),s={axis:"columns",path:n.parseJSON(c)};u.parent().is("td")&&(h=o,a="expandRow",s.axis="rows");var r=u.hasClass(ft),l=h.metadata[c],y=l.expanded===t;(v=r?ii:ti,s.childrenLoaded=l.maxChildren>l.children,f.trigger(v,s))||(h.metadata[c].expanded=!r,u.toggleClass(ft,!r).toggleClass(at,r),!r&&y?f.dataSource[a](s.path):f.refresh())});f._scrollable();f.options.autoBind&&f.dataSource.fetch();i.notify(f)},events:[gt,ni,ti,ii],options:{name:"PivotGrid",autoBind:!0,reorderable:!0,filterable:!1,sortable:!1,height:null,columnWidth:100,configurator:"",columnHeaderTemplate:null,rowHeaderTemplate:null,dataCellTemplate:null,kpiStatusTemplate:null,kpiTrendTemplate:null,messages:{measureFields:"Drop Data Fields Here",columnFields:"Drop Column Fields Here",rowFields:"Drop Rows Fields Here"}},_templates:function(){var n=this.options.columnHeaderTemplate,t=this.options.rowHeaderTemplate,r=this.options.dataCellTemplate,u=this.options.kpiStatusTemplate,f=this.options.kpiTrendTemplate;this._columnBuilder.template=i.template(n||ri,{useWithBlock:!!n});this._contentBuilder.dataTemplate=i.template(r||lr,{useWithBlock:!!r});this._contentBuilder.kpiStatusTemplate=i.template(u||hr,{useWithBlock:!!u});this._contentBuilder.kpiTrendTemplate=i.template(f||cr,{useWithBlock:!!f});this._rowBuilder.template=i.template(t||ri,{useWithBlock:!!t})},_bindConfigurator:function(){var t=this.options.configurator;t&&n(t).kendoPivotConfigurator("setDataSource",this.dataSource)},cellInfoByElement:function(t){return t=n(t),this.cellInfo(t.index(),t.parent("tr").index())},cellInfo:function(n,t){var u=this._contentBuilder,i=u.columnIndexes[n||0],r=u.rowIndexes[t||0],f;return!i||!r?null:(f=r.index*u.rowLength+i.index,{columnTuple:i.tuple,rowTuple:r.tuple,measure:i.measure||r.measure,dataItem:this.dataSource.view()[f]})},setDataSource:function(n){this.options.dataSource=n;this._dataSource();this.measuresTarget&&this.measuresTarget.setDataSource(n);this.rowsTarget&&this.rowsTarget.setDataSource(n);this.columnsTarget&&this.columnsTarget.setDataSource(n);this._bindConfigurator();this.options.autoBind&&n.fetch()},setOptions:function(n){l.fn.setOptions.call(this,n);this._templates()},destroy:function(){l.fn.destroy.call(this);clearTimeout(this._headerReflowTimeout)},_dataSource:function(){var t=this,r=t.options.dataSource;r=n.isArray(r)?{data:r}:r;t.dataSource&&this._refreshHandler?t.dataSource.unbind(a,t._refreshHandler).unbind(lt,t._stateResetHandler).unbind(dt,t._progressHandler).unbind(kt,t._errorHandler):(t._refreshHandler=n.proxy(t.refresh,t),t._progressHandler=n.proxy(t._requestStart,t),t._stateResetHandler=n.proxy(t._stateReset,t),t._errorHandler=n.proxy(t._error,t));t.dataSource=i.data.PivotDataSource.create(r).bind(a,t._refreshHandler).bind(dt,t._progressHandler).bind(lt,t._stateResetHandler).bind(kt,t._errorHandler)},_error:function(){this._progress(!1)},_requestStart:function(){this._progress(!0)},_stateReset:function(){this._columnBuilder.reset();this._rowBuilder.reset()},_wrapper:function(){var n=this.options.height;this.wrapper=this.element.addClass("k-widget k-pivot");n&&this.wrapper.css("height",n)},_measureFields:function(){this.measureFields=n(ut).addClass("k-pivot-toolbar k-header k-settings-measures");this.measuresTarget=this._createSettingTarget(this.measureFields,{setting:"measures",messages:{empty:this.options.messages.measureFields}})},_createSettingTarget:function(t,r){var f='<span tabindex="0" class="k-button" data-'+i.ns+'name="${data.name}">${data.name}',e=r.sortable,u="";return e&&(u+="#if (data.sortIcon) {#",u+='<span class="k-icon ${data.sortIcon} k-setting-sort"><\/span>',u+="#}#"),(r.filterable||e)&&(u+='<span class="k-icon k-i-arrowhead-s k-setting-fieldmenu"><\/span>'),this.options.reorderable&&(u+='<span class="k-icon k-si-close k-setting-delete"><\/span>'),u&&(f+='<span class="k-field-actions">'+u+"<\/span>"),f+="<\/span>",new i.ui.PivotSettingTarget(t,n.extend({template:f,emptyTemplate:'<span class="k-empty">${data}<\/span>',enabled:this.options.reorderable,dataSource:this.dataSource},r))},_initSettingTargets:function(){this.columnsTarget=this._createSettingTarget(this.columnFields,{connectWith:this.rowFields,setting:"columns",filterable:this.options.filterable,sortable:this.options.sortable,messages:{empty:this.options.messages.columnFields,fieldMenu:this.options.messages.fieldMenu}});this.rowsTarget=this._createSettingTarget(this.rowFields,{connectWith:this.columnFields,setting:"rows",filterable:this.options.filterable,sortable:this.options.sortable,messages:{empty:this.options.messages.rowFields,fieldMenu:this.options.messages.fieldMenu}})},_createLayout:function(){var t=this,r=n(ar),u=r.find(".k-pivot-rowheaders"),e=r.find(".k-pivot-table"),f=n(ut).addClass("k-grid k-widget");t._measureFields();t.columnFields=n(ut).addClass("k-pivot-toolbar k-header k-settings-columns");t.rowFields=n(ut).addClass("k-pivot-toolbar k-header k-settings-rows");t.columnsHeader=n('<div class="k-grid-header-wrap" />').wrap('<div class="k-grid-header" />');t.columnsHeader.parent().css("padding-right",i.support.scrollbar());t.rowsHeader=n('<div class="k-grid k-widget k-alt"/>');t.content=n('<div class="k-grid-content" />');u.append(t.measureFields);u.append(t.rowFields);u.append(t.rowsHeader);f.append(t.columnsHeader.parent());f.append(t.content);e.append(t.columnFields);e.append(f);t.wrapper.append(r);t.columnsHeaderTree=new i.dom.Tree(t.columnsHeader[0]);t.rowsHeaderTree=new i.dom.Tree(t.rowsHeader[0]);t.contentTree=new i.dom.Tree(t.content[0]);t._initSettingTargets()},_progress:function(n){i.ui.progress(this.wrapper,n)},_resize:function(){this.content[0].firstChild&&(this._setSectionsWidth(),this._setSectionsHeight(),this._setContentWidth(),this._setContentHeight(),this._columnHeaderReflow())},_columnHeaderReflow:function(){var n=this.columnsHeader.children("table");i.support.browser.mozilla&&(clearTimeout(this._headerReflowTimeout),n.css("table-layout","auto"),this._headerReflowTimeout=setTimeout(function(){n.css("table-layout","")}))},_setSectionsWidth:function(){var t=this.rowsHeader,i=t.parent(".k-pivot-rowheaders").width(d),n;n=Math.max(this.measureFields.outerWidth(),this.rowFields.outerWidth());n=Math.max(t.children("table").width(),n);i.width(n)},_setSectionsHeight:function(){var t=this.measureFields.height(d).height(),i=this.columnFields.height(d).height(),n=this.rowFields.height(d).innerHeight(),r=this.columnsHeader.height(d).innerHeight(),e=n-this.rowFields.height(),u=i>t?i:t,f=r>n?r:n;this.measureFields.height(u);this.columnFields.height(u);this.rowFields.height(f-e);this.columnsHeader.height(f)},_setContentWidth:function(){var t=this.content.find("table"),i=this.columnsHeader.children("table"),r=t.children("colgroup").children().length,u=r*this.options.columnWidth,n=Math.ceil(u/this.content.width()*100);n<100&&(n=100);t.add(i).css("width",n+"%");this._resetColspan(i)},_setContentHeight:function(){var t=this,u=t.content,e=t.rowsHeader,n=t.wrapper.innerHeight(),r=i.support.scrollbar(),f=u[0].offsetHeight===u[0].clientHeight,o=t.options.height;if(t.wrapper.is(":visible")){if(!n||!o){f&&(r=0);u.height("auto");e.height(u.height()-r);return}n-=t.columnFields.outerHeight();n-=t.columnsHeader.outerHeight();n<=r*2&&(n=r*2+1,f||(n+=r));u.height(n);f&&(r=0);e.height(n-r)}},_resetColspan:function(n){var i=this,r=n.children("tbody").children(":first").children(":first");i._colspan===t&&(i._colspan=r.attr("colspan"));r.attr("colspan",1);clearTimeout(i._layoutTimeout);i._layoutTimeout=setTimeout(function(){r.attr("colspan",i._colspan);i._colspan=t})},_axisMeasures:function(n){var r=[],i=this.dataSource,t=i.measures(),u=t.length>1||t[0]&&t[0].type;return i.measuresAxis()===n&&(i[n]().length===0||u)&&(r=t),r},items:function(){return[]},refresh:function(){var n=this,f=n.dataSource,e=f.axes(),h=(e.columns||{}).tuples||[],c=(e.rows||{}).tuples||[],t=n._columnBuilder,u=n._rowBuilder,o={},s={},r;n.trigger(gt,{action:"rebind"})||(t.measures=n._axisMeasures("columns"),n.columnsHeaderTree.render(t.build(h)),n.rowsHeaderTree.render(u.build(c)),o={indexes:t._indexes,measures:t.measures,metadata:t.metadata},s={indexes:u._indexes,measures:this._axisMeasures("rows"),metadata:u.metadata},n.contentTree.render(n._contentBuilder.build(f.view(),o,s)),n._resize(),n.touchScroller?n.touchScroller.contentResized():(r=i.touchScroller(n.content),r&&r.movable&&(n.touchScroller=r,r.movable.bind("change",function(t){n.columnsHeader.scrollLeft(-t.sender.x);n.rowsHeader.scrollTop(-t.sender.y)}))),n._progress(!1),n.trigger(ni))},_scrollable:function(){var t=this,r=t.columnsHeader,i=t.rowsHeader;t.content.scroll(function(){r.scrollLeft(this.scrollLeft);i.scrollTop(this.scrollTop)});i.bind("DOMMouseScroll"+g+" mousewheel"+g,n.proxy(t._wheelScroll,t))},_wheelScroll:function(t){if(!t.ctrlKey){var r=i.wheelDeltaY(t),u=this.content.scrollTop();if(r){t.preventDefault();n(t.currentTarget).one("wheel"+g,!1);this.rowsHeader.scrollTop(u+-r);this.content.scrollTop(u+-r)}}}}),r=i.dom.element,w=i.dom.html,or=function(n,t){return{maxChildren:0,children:0,maxMembers:0,members:0,measures:1,levelNum:n,parentMember:t!==0}},rt=function(n,t){for(var r=[],i=0;i<=t;i++)r.push(n.members[i].name);return r},sr=function(n,t){for(var r="",i=0;i<=t;i++)r+=n.members[i].name;return r},vu=b.extend({init:function(){this.measures=1;this.metadata={}},build:function(n){var t=this._tbody(n),i=this._colGroup();return[r("table",null,[i,t])]},reset:function(){this.metadata={}},_colGroup:function(){for(var i=this._rowLength(),n=[],t=0;t<i;t++)n.push(r("col",null));return r("colgroup",null,n)},_tbody:function(n){var t=n[0];return this.map={},this.rows=[],this.rootTuple=t,this._indexes=[],t?(this._buildRows(t,0),this._normalize()):this.rows.push(r("tr",null,[r("th",null,[w("&nbsp;")])])),r("tbody",null,this.rows)},_normalize:function(){for(var f=this.rows,o=f.length,i=0,n,e,t,r,u;i<o;i++)if(n=f[i],n.rowSpan!==1)for(r=n.children,t=0,e=r.length;t<e;t++)u=r[t],u.tupleAll&&(u.attr.rowSpan=n.rowSpan)},_rowIndex:function(n){for(var i=this.rows,r=i.length,t=0;t<r;t++)if(i[t]===n)break;return t},_rowLength:function(){var i=this.rows[0]?this.rows[0].children:[],r=i.length,n=0,t=0;if(r)for(;t<r;t++)n+=i[t].attr.colSpan||1;return n||(n=this.measures),n},_row:function(n,t,i){var s=this.rootTuple.members[t].name,h=n.members[t].levelNum,c=s+h,e=this.map,f,o,u=e[c];return u?(u.notFirst=!1,u.parentMember&&u.parentMember===i||(u.parentMember=i,u.collapsed=0,u.colSpan=0)):(u=r("tr",null,[]),u.parentMember=i,u.collapsed=0,u.colSpan=0,u.rowSpan=1,e[c]=u,f=e[s+(Number(h)-1)],f&&(o=f.children,u.notFirst=o[1]&&o[1].attr.className.indexOf("k-alt")===-1?!0:f.notFirst),this.rows.splice(this._rowIndex(f)+1,0,u)),u},_measures:function(n,t,i){var s=this.map,u=s.measureRow,e,f,o;for(u||(u=r("tr",null,[]),s.measureRow=u,this.rows.push(u)),f=0,o=n.length;f<o;f++)e=n[f],u.children.push(this._cell(i||"",[this._content(e,t)],e));return o},_content:function(n,t){return w(this.template({member:n,tuple:t}))},_cell:function(n,t,i){var u=r("th",{className:"k-header"+n},t);return u.value=i.caption||i.name,u},_buildRows:function(n,t,u){var nt=n.members,h=nt[t],c=nt[t+1],o,s,l,a,v,w,k,d=[],y,g=0,f,e,p=0,b=0;if(h.measure){this._measures(h.children,n);return}if(y=i.stringify(rt(n,t)),o=this._row(n,t,u),l=h.children,a=l.length,f=this.metadata[y],f||(this.metadata[y]=f=or(Number(h.levelNum),t),f.rootLevelNum=Number(this.rootTuple.members[t].levelNum)),this._indexes.push({path:y,tuple:n}),h.hasChildren&&(f.expanded===!1&&(p=f.maxChildren,o.collapsed+=p,f.children=0,a=0),k={className:"k-icon "+(a?ft:at)},k[i.attr("path")]=y,d.push(r("span",k))),d.push(this._content(h,n)),v=this._cell(o.notFirst?" k-first":"",d,h),o.children.push(v),o.colSpan+=1,a){for(w=this._cell(" k-alt",[this._content(h,n)],h),o.children.push(w);g<a;g++)s=this._buildRows(l[g],t,h);e=s.colSpan;p=s.collapsed;v.attr.colSpan=e;f.children=e;f.members=1;o.colSpan+=e;o.collapsed+=p;o.rowSpan=s.rowSpan+1;c&&(c.measure?e=this._measures(c.children,n," k-alt"):(s=this._buildRows(n,t+1),e=s.colSpan,o.collapsed+=s.collapsed,b=s.collapsed),w.attr.colSpan=e,e-=1,f.members+=e,o.colSpan+=e)}else c&&(c.measure?e=this._measures(c.children,n):(s=this._buildRows(n,t+1),e=s.colSpan,o.collapsed+=s.collapsed,b=s.collapsed),f.members=e,e>1&&(v.attr.colSpan=e,o.colSpan+=e-1));return f.maxMembers<f.members+b&&(f.maxMembers=f.members+b),l=f.children+p,f.maxChildren<l&&(f.maxChildren=l),(w||v).tupleAll=!0,o}}),yu=b.extend({init:function(){this.metadata={}},build:function(n){var t=this._tbody(n),i=this._colGroup();return[r("table",null,[i,t])]},reset:function(){this.metadata={}},_rowLength:function(){for(var t=this.rows[0].children,i=0,r=0,n=t[r];n;)i+=n.attr.colSpan||1,n=t[++r];return i},_colGroup:function(){for(var i=this._rowLength(),n=[],t=0;t<i;t++)n.push(r("col",null));return r("colgroup",null,n)},_tbody:function(n){var t=n[0];return this.rootTuple=t,this.rows=[],this.map={},this._indexes=[],t?(this._buildRows(t,0),this._normalize()):this.rows.push(r("tr",null,[r("td",null,[w("&nbsp;")])])),r("tbody",null,this.rows)},_normalize:function(){for(var o=this.rows,c=o.length,r=0,u=this.rootTuple.members,s=u[0].name,l=u.length,n=0,t,i,f,h=this.map,e;r<c;r++)for(t=o[r],n=0;n<l;n++)f=this[u[n].name],i=t.colSpan["dim"+n],i&&i.colSpan<f&&(i.attr.colSpan=f-i.colSpan+1);t=h[s];e=h[s+"all"];t&&(t.children[0].attr.className="k-first");e&&(e.children[0].attr.className+=" k-first")},_row:function(n){var t=r("tr",null,n);return t.rowSpan=1,t.colSpan={},this.rows.push(t),t},_content:function(n,t){return w(this.template({member:n,tuple:t}))},_cell:function(n,t,i){var u=r("td",{className:n},t);return u.value=i.caption||i.name,u},_buildRows:function(n,t){var w=this.map,v,it=n.members,e=it[t],ut=it[t+1],h=e.children,s=h.length,k=Number(e.levelNum),d=this.rootTuple.members[t].name,g=rt(n,t-1).join(""),et=Number(this.rootTuple.members[t].levelNum),ot=g+(et===k?"":e.parentName||""),u=w[ot+"all"]||w[ot],b=k+1,c,l,y,a,f,p,nt=[],tt,o;if(!u||u.hasChild?u=this._row():u.hasChild=!0,e.measure){for(p=u.allCell?"k-grid-footer":"",u.children.push(this._cell(p,[this._content(h[0],n)],h[0])),u.rowSpan=s,o=1;o<s;o++)this._row([this._cell(p,[this._content(h[o],n)],h[o])]);return u}if(w[g+e.name]=u,v=i.stringify(rt(n,t)),f=this.metadata[v],f||(this.metadata[v]=f=or(k,t),f.rootLevelNum=et),this._indexes.push({path:v,tuple:n}),e.hasChildren&&(f.expanded===!1&&(s=0,f.children=0),tt={className:"k-icon "+(s?ft:at)},tt[i.attr("path")]=v,nt.push(r("span",tt))),nt.push(this._content(e,n)),p=u.allCell&&!s?"k-grid-footer":"",c=this._cell(p,nt,e),c.colSpan=b,u.children.push(c),u.colSpan["dim"+t]=c,(!this[d]||this[d]<b)&&(this[d]=b),s){for(u.allCell=!1,u.hasChild=!1,o=0;o<s;o++)y=this._buildRows(h[o],t),u!==y&&(u.rowSpan+=y.rowSpan);u.rowSpan>1&&(c.attr.rowSpan=u.rowSpan);f.children=u.rowSpan;l=this._cell("k-grid-footer",[this._content(e,n)],e);l.colSpan=b;a=this._row([l]);a.colSpan["dim"+t]=l;a.allCell=!0;w[g+e.name+"all"]=a;ut&&(y=this._buildRows(n,t+1),l.attr.rowSpan=y.rowSpan);u.rowSpan+=a.rowSpan;f.members=a.rowSpan}else ut&&(u.hasChild=!1,this._buildRows(n,t+1),(l||c).attr.rowSpan=u.rowSpan,f.members=u.rowSpan);return f.maxChildren<f.children&&(f.maxChildren=f.children),f.maxMembers<f.members&&(f.maxMembers=f.members),u}}),pu=b.extend({init:function(){this.columnAxis={};this.rowAxis={}},build:function(n,i,u){var e=i.indexes[0],f=i.metadata[e?e.path:t],o,s;return this.columnAxis=i,this.rowAxis=u,this.data=n,this.rowLength=f?f.maxChildren+f.maxMembers:i.measures.length||1,this.rowLength||(this.rowLength=1),o=this._tbody(),s=this._colGroup(),[r("table",null,[s,o])]},_colGroup:function(){var n=this.columnAxis.measures.length||1,t=[],i=0;for(this.rows[0]&&(n=this.rows[0].children.length);i<n;i++)t.push(r("col",null));return r("colgroup",null,t)},_tbody:function(){return this.rows=[],this.data[0]?(this.columnIndexes=this._indexes(this.columnAxis,this.rowLength),this.rowIndexes=this._indexes(this.rowAxis,Math.ceil(this.data.length/this.rowLength)),this._buildRows()):this.rows.push(r("tr",null,[r("td",null,[w("&nbsp;")])])),r("tbody",null,this.rows)},_indexes:function(n,i){var e=[],s,y=n.indexes,b=n.metadata,h=n.measures,c=h.length||1,u,l=0,o=0,a=0,p=y.length,r,w,f,v;if(!p){for(r=0;r<c;r++)e[r]={index:r,measure:h[r],tuple:null};return e}for(;a<p;a++){if(s=y[a],u=b[s.path],f=u.children+u.members,v=0,f&&(f-=c),u.expanded===!1&&u.children!==u.maxChildren&&(v=u.maxChildren),u.parentMember&&u.levelNum===u.rootLevelNum&&(f=-1),f>-1){for(r=0;r<c;r++)w=f+r,u.children||(w+=o),e[f+o+r]={children:f,index:l,measure:h[r],tuple:s.tuple},l+=1;while(e[o]!==t)o+=1}if(o===i)break;l+=v}return e},_buildRows:function(){for(var t=this.rowIndexes,i=t.length,n=0;n<i;n++)this.rows.push(this._buildRow(t[n]))},_buildRow:function(n){for(var a=n.index*this.rowLength,c=this.columnIndexes,v=c.length,f,l=[],s=0,e,h,t,i,o,u;s<v;s++)f=c[s],i={},f.children&&(i.className="k-alt"),t="",o=this.data[a+f.index],u=f.measure||n.measure,e={columnTuple:f.tuple,rowTuple:n.tuple,measure:u,dataItem:o},o.value!==""&&u&&u.type&&(u.type==="status"?t=this.kpiStatusTemplate(e):u.type==="trend"&&(t=this.kpiTrendTemplate(e))),t||(t=this.dataTemplate(e)),h=r("td",i,[w(t)]),h.value=o.value,l.push(h);return i={},n.children&&(i.className="k-grid-footer"),r("tr",i,l)}});ct.plugin(ht);i.PivotExcelExporter=i.Class.extend({init:function(n){this.options=n;this.widget=n.widget;this.dataSource=this.widget.dataSource},_columns:function(){var r=this.widget.columnsHeaderTree.children[0],u=this.widget.rowsHeaderTree.children[0],f=r.children[0].children.length,i=u.children[0].children.length,e=this.widget.options.columnWidth,t=[],n;if(i&&this.dataSource.data()[0])for(n=0;n<i;n++)t.push({autoWidth:!0});for(n=0;n<f;n++)t.push({autoWidth:!1,width:e});return t},_cells:function(n,t,i){for(var s=[],r=0,c=n.length,h,u,o,f,e;r<c;r++){for(u=[],o=n[r].children,h=o.length,f=0;f<h;f++)e=o[f],u.push({background:"#7a7a7a",color:"#fff",value:e.value,colSpan:e.attr.colSpan||1,rowSpan:e.attr.rowSpan||1});i&&i(u,r);s.push({cells:u,type:t})}return s},_rows:function(){var n=this.widget.columnsHeaderTree.children[0],t=this.widget.rowsHeaderTree.children[0],o=n.children[0].children.length,i=t.children[0].children.length,r=n.children[1].children,s=t.children[1].children,h=this.widget.contentTree.children[0].children[1].children,u=this._cells(r,"header"),f,e;return i&&u[0].cells.splice(0,0,{background:"#7a7a7a",color:"#fff",value:"",colSpan:i,rowSpan:r.length}),f=function(n,t){for(var r=0,u,i,f=h[t].children;r<o;r++)u=f[r],i=Number(u.value),isNaN(i)&&(i=""),n.push({background:"#dfdfdf",color:"#333",value:i,colSpan:1,rowSpan:1})},e=this._cells(s,"data",f),u.concat(e)},_freezePane:function(){var n=this.widget.columnsHeaderTree.children[0],t=this.widget.rowsHeaderTree.children[0],i=t.children[0].children.length,r=n.children[1].children;return{colSplit:i,rowSplit:r.length}},workbook:function(){var t;return this.dataSource.view()[0]?(t=n.Deferred(),t.resolve()):t=this.dataSource.fetch(),t.then(n.proxy(function(){return{sheets:[{columns:this._columns(),rows:this._rows(),freezePane:this._freezePane(),filter:null}]}},this))}});pt={extend:function(t){t.events.push("excelExport");t.options.excel=n.extend(t.options.excel,this.options);t.saveAsExcel=this.saveAsExcel},options:{proxyURL:"",filterable:!1,fileName:"Export.xlsx"},saveAsExcel:function(){var t=this.options.excel||{},r=new i.PivotExcelExporter({widget:this});r.workbook().then(n.proxy(function(n){if(!this.trigger("excelExport",{workbook:n})){var r=new i.ooxml.Workbook(n);i.saveAs({dataURI:r.toDataURL(),fileName:n.fileName||t.fileName,proxyURL:t.proxyURL,forceProxy:t.forceProxy})}},this))}};i.PivotExcelMixin=pt;i.ooxml&&i.ooxml.Workbook&&pt.extend(ht.prototype);i.PDFMixin&&(i.PDFMixin.extend(ht.prototype),ht.fn._drawPDF=function(){return this._drawPDFShadow({width:this.wrapper.width()},{avoidLinks:this.options.pdf.avoidLinks})})})(window.kendo.jQuery)}(),function(){(function(n){var t=window.kendo,f=t.ui,r=n.proxy,e=n.extend,u="visibility",i="k-state-hover",o="input,a,textarea,.k-multiselect-wrap,select,button,a.k-button>.k-icon,button.k-button>.k-icon,span.k-icon.k-i-expand,span.k-icon.k-i-collapse";f.HierarchicalDragAndDrop=t.Class.extend({init:function(i,u){this.element=i;this.hovered=i;this.options=e({dragstart:n.noop,drag:n.noop,drop:n.noop,dragend:n.noop},u);this._draggable=new f.Draggable(i,{ignore:o,filter:u.filter,autoScroll:u.autoScroll,cursorOffset:{left:10,top:t.support.mobileOS?-40/t.support.zoomLevel():10},hint:r(this._hint,this),dragstart:r(this.dragstart,this),dragcancel:r(this.dragcancel,this),drag:r(this.drag,this),dragend:r(this.dragend,this),$angular:u.$angular})},_hint:function(n){return"<div class='k-header k-drag-clue'><span class='k-icon k-drag-status' />"+this.options.hintText(n)+"<\/div>"},_removeTouchHover:function(){t.support.touch&&this.hovered&&(this.hovered.find("."+i).removeClass(i),this.hovered=!1)},_hintStatus:function(t){var i=this._draggable.hint.find(".k-drag-status")[0];if(t)i.className="k-icon k-drag-status "+t;else return n.trim(i.className.replace(/k-(icon|drag-status)/g,""))},dragstart:function(t){this.source=t.currentTarget.closest(this.options.itemSelector);this.options.dragstart(this.source)&&t.preventDefault();this.dropHint=this.options.reorderable?n("<div class='k-drop-hint' />").css(u,"hidden").appendTo(this.element):n()},drag:function(r){var c=this.options,p=this.source,e=this.dropTarget=n(t.eventTarget(r)),w=e.closest(c.allowedContainers),o,v,b,l,k,s,y,h,a,d,f;w.length?p[0]==e[0]||c.contains(p[0],e[0])?f="k-denied":(f="k-insert-middle",a=c.itemFromTarget(e),o=a.item,o.length?(this._removeTouchHover(),v=o.outerHeight(),l=a.content,c.reorderable?(k=v/(l.length>0?4:2),b=t.getOffset(o).top,s=r.y.location<b+k,y=b+v-k<r.y.location,h=l.length&&!s&&!y):(h=!0,s=!1,y=!1),this.hovered=h?w:!1,this.dropHint.css(u,h?"hidden":"visible"),this._lastHover&&this._lastHover[0]!=l[0]&&this._lastHover.removeClass(i),this._lastHover=l.toggleClass(i,h),h?f="k-add":(d=o.position(),d.top+=s?0:v,this.dropHint.css(d)[s?"prependTo":"appendTo"](c.dropHintContainer(o)),s&&a.first&&(f="k-insert-top"),y&&a.last&&(f="k-insert-bottom"))):e[0]!=this.dropHint[0]&&(this._lastHover&&this._lastHover.removeClass(i),f=n.contains(this.element[0],w[0])?"k-denied":"k-add")):(f="k-denied",this._removeTouchHover());this.options.drag({originalEvent:r.originalEvent,source:p,target:e,pageY:r.y.location,pageX:r.x.location,status:f.substring(2),setStatus:function(n){f=n}});f=="k-denied"&&this._lastHover&&this._lastHover.removeClass(i);f.indexOf("k-insert")!==0&&this.dropHint.css(u,"hidden");this._hintStatus(f)},dragcancel:function(){this.dropHint.remove()},dragend:function(n){var o="over",s=this.source,t,r=this.dropHint,f=this.dropTarget,e,h;if(r.css(u)=="visible"?(o=this.options.dropPositionFrom(r),t=r.closest(this.options.itemSelector)):f&&(t=f.closest(this.options.itemSelector),t.length||(t=f.closest(this.options.allowedContainers))),e={originalEvent:n.originalEvent,source:s[0],destination:t[0],valid:this._hintStatus()!="k-denied",setValid:function(n){this.valid=n},dropTarget:f[0],position:o},h=this.options.drop(e),r.remove(),this._removeTouchHover(),this._lastHover&&this._lastHover.removeClass(i),!e.valid||h){this._draggable.dropped=e.valid;return}this._draggable.dropped=!0;this.options.dragend({originalEvent:n.originalEvent,source:s,destination:t,position:o})},destroy:function(){this._lastHover=this.hovered=null;this._draggable.destroy()}})})(window.kendo.jQuery)}(),function(){(function(n,t){function ni(n){return function(t){var i=t.children(".k-animation-container");return i.length||(i=t),i.children(n)}}function c(n){return i.template(n,{useWithBlock:!1})}function rt(n){return n.find("> div .k-checkbox [type=checkbox]")}function ti(n){return function(t,i){i=i.closest(e);var r=i.parent(),u;return r.parent().is("li")&&(u=r.parent()),this._dataSourceMove(t,r,u,function(t,r){return this._insert(t.data(),r,i.index()+n)})}}function ui(t,i){for(var r;t&&t.nodeName.toLowerCase()!="ul";)r=t,t=t.nextSibling,r.nodeType==3&&(r.nodeValue=n.trim(r.nodeValue)),dt.test(r.className)?i.insertBefore(r,i.firstChild):i.appendChild(r)}function nt(t){var i=t.children("div"),u=t.children("ul"),f=i.children(".k-icon"),e=t.children(":checkbox"),r=i.children(".k-in");t.hasClass("k-treeview")||(i.length||(i=n("<div />").prependTo(t)),!f.length&&u.length?f=n("<span class='k-icon' />").prependTo(i):u.length&&u.children().length||(f.remove(),u.remove()),e.length&&n("<span class='k-checkbox' />").appendTo(i).append(e),r.length||(r=t.children("a").eq(0).addClass("k-in"),r.length||(r=n("<span class='k-in' />")),r.appendTo(i),i.length&&ui(i[0].nextSibling,r[0])))}var i=window.kendo,a=i.ui,ii=i.data,v=n.extend,ut=i.template,y=n.isArray,tt=a.Widget,ft=ii.HierarchicalDataSource,u=n.proxy,s=i.keys,r=".kendoTreeView",it="select",et="check",ot="navigate",k="change",st="error",f="checked",h="indeterminate",ht="dragstart",ct="drag",lt="drop",at="dragend",vt="dataBound",yt="click",l="undefined",pt="k-state-hover",p="k-treeview",ri=":visible",e=".k-item",d="string",wt="aria-selected",bt="aria-disabled",kt,o,w,g,dt,b={text:"dataTextField",url:"dataUrlField",spriteCssClass:"dataSpriteCssClassField",imageUrl:"dataImageUrlField"},gt=function(n){return typeof HTMLElement=="object"?n instanceof HTMLElement:n&&typeof n=="object"&&n.nodeType===1&&typeof n.nodeName===d};o=ni(".k-group");w=ni(".k-group,.k-content");g=function(n){return n.children("div").children(".k-icon")};dt=/k-sprite/;kt=i.ui.DataBoundWidget.extend({init:function(n,t){var r=this,e,u=!1,o=t&&!!t.dataSource,f;y(t)&&(e=!0,t={dataSource:t});t&&typeof t.loadOnDemand==l&&y(t.dataSource)&&(t.loadOnDemand=!1);tt.prototype.init.call(r,n,t);n=r.element;t=r.options;f=n.is("ul")&&n||n.hasClass(p)&&n.children("ul");u=!o&&f.length;u&&(t.dataSource.list=f);r._animation();r._accessors();r._templates();n.hasClass(p)?(r.wrapper=n,r.root=n.children("ul").eq(0)):(r._wrapper(),f&&(r.root=n,r._group(r.wrapper)));r._tabindex();r.root.attr("role","tree");r._dataSource(u);r._attachEvents();r._dragging();u?r._syncHtmlAndDataSource():t.autoBind&&(r._progress(!0),r.dataSource.fetch());t.checkboxes&&t.checkboxes.checkChildren&&r.updateIndeterminate();r.element[0].id&&(r._ariaId=i.format("{0}_tv_active",r.element[0].id));i.notify(r)},_attachEvents:function(){var t=this,i=".k-in:not(.k-state-selected,.k-state-disabled)",f="mouseenter";t.wrapper.on(f+r,".k-in.k-state-selected",function(n){n.preventDefault()}).on(f+r,i,function(){n(this).addClass(pt)}).on("mouseleave"+r,i,function(){n(this).removeClass(pt)}).on(yt+r,i,u(t._click,t)).on("dblclick"+r,".k-in:not(.k-state-disabled)",u(t._toggleButtonClick,t)).on(yt+r,".k-plus,.k-minus",u(t._toggleButtonClick,t)).on("keydown"+r,u(t._keydown,t)).on("focus"+r,u(t._focus,t)).on("blur"+r,u(t._blur,t)).on("mousedown"+r,".k-in,.k-checkbox :checkbox,.k-plus,.k-minus",u(t._mousedown,t)).on("change"+r,".k-checkbox :checkbox",u(t._checkboxChange,t)).on("click"+r,".k-checkbox :checkbox",u(t._checkboxClick,t)).on("click"+r,".k-request-retry",u(t._retryRequest,t)).on("click"+r,function(i){n(i.target).is(":kendoFocusable")||t.focus()})},_checkboxClick:function(t){var i=n(t.target);i.data(h)&&(i.data(h,!1).prop(h,!1).prop(f,!0),this._checkboxChange(t))},_syncHtmlAndDataSource:function(n,t){n=n||this.root;t=t||this.dataSource;for(var s=t.view(),h=i.attr("uid"),c=i.attr("expanded"),l=this.options.checkboxes,o=n.children("li"),u,e,r=0;r<o.length;r++)e=s[r],u=o.eq(r),u.attr("role","treeitem").attr(h,e.uid),e.expanded=u.attr(c)==="true",l&&(e.checked=rt(u).prop(f)),this._syncHtmlAndDataSource(u.children("ul"),e.children)},_animation:function(){var t=this.options,n=t.animation;n===!1?n={expand:{effects:{}},collapse:{hide:!0,effects:{}}}:n.collapse&&"effects"in n.collapse||(n.collapse=v({reverse:!0},n.expand));v(n.collapse,{hide:!0});t.animation=n},_dragging:function(){var r=this.options.dragAndDrop,i=this.dragging,t;r&&!i?(t=this,this.dragging=new a.HierarchicalDragAndDrop(this.element,{reorderable:!0,$angular:this.options.$angular,autoScroll:this.options.autoScroll,filter:"div:not(.k-state-disabled) .k-in",allowedContainers:".k-treeview",itemSelector:".k-treeview .k-item",hintText:u(this._hintText,this),contains:function(t,i){return n.contains(t,i)},dropHintContainer:function(n){return n},itemFromTarget:function(n){var t=n.closest(".k-top,.k-mid,.k-bot");return{item:t,content:n.closest(".k-in"),first:t.hasClass("k-top"),last:t.hasClass("k-bot")}},dropPositionFrom:function(n){return n.prevAll(".k-in").length>0?"after":"before"},dragstart:function(n){return t.trigger(ht,{sourceNode:n[0]})},drag:function(n){t.trigger(ct,{originalEvent:n.originalEvent,sourceNode:n.source[0],dropTarget:n.target[0],pageY:n.pageY,pageX:n.pageX,statusClass:n.status,setStatusClass:n.setStatus})},drop:function(n){return t.trigger(lt,{originalEvent:n.originalEvent,sourceNode:n.source,destinationNode:n.destination,valid:n.valid,setValid:function(t){this.valid=t;n.setValid(t)},dropTarget:n.dropTarget,dropPosition:n.position})},dragend:function(n){function f(i){t.updateIndeterminate();t.trigger(at,{originalEvent:n.originalEvent,sourceNode:i&&i[0],destinationNode:r[0],dropPosition:u})}var i=n.source,r=n.destination,u=n.position;u=="over"?t.append(i,r,f):(u=="before"?i=t.insertBefore(i,r):u=="after"&&(i=t.insertAfter(i,r)),f(i))}})):!r&&i&&(i.destroy(),this.dragging=null)},_hintText:function(n){return this.templates.dragClue({item:this.dataItem(n),treeview:this.options})},_templates:function(){var t=this,n=t.options,r=u(t._fieldAccessor,t);n.template&&typeof n.template==d?n.template=ut(n.template):n.template||(n.template=c("# var text = "+r("text")+"(data.item); ## if (typeof data.item.encoded != 'undefined' && data.item.encoded === false) {##= text ## } else { ##: text ## } #"));t._checkboxes();t.templates={wrapperCssClass:function(n,t){var i="k-item",r=t.index;return n.firstLevel&&r===0&&(i+=" k-first"),r==n.length-1&&(i+=" k-last"),i},cssClass:function(n,t){var r="",i=t.index,u=n.length-1;return n.firstLevel&&i===0&&(r+="k-top "),r+(i===0&&i!=u?"k-top":i==u?"k-bot":"k-mid")},textClass:function(n){var t="k-in";return n.enabled===!1&&(t+=" k-state-disabled"),n.selected===!0&&(t+=" k-state-selected"),t},toggleButtonClass:function(n){var t="k-icon";return t+=n.expanded!==!0?" k-plus":" k-minus",n.enabled===!1&&(t+="-disabled"),t},groupAttributes:function(n){var t="";return n.firstLevel||(t="role='group'"),t+(n.expanded!==!0?" style='display:none'":"")},groupCssClass:function(n){var t="k-group";return n.firstLevel&&(t+=" k-treeview-lines"),t},dragClue:c("#= data.treeview.template(data) #"),group:c("<ul class='#= data.r.groupCssClass(data.group) #'#= data.r.groupAttributes(data.group) #>#= data.renderItems(data) #<\/ul>"),itemContent:c("# var imageUrl = "+r("imageUrl")+"(data.item); ## var spriteCssClass = "+r("spriteCssClass")+"(data.item); ## if (imageUrl) { #<img class='k-image' alt='' src='#= imageUrl #'># } ## if (spriteCssClass) { #<span class='k-sprite #= spriteCssClass #' /># } ##= data.treeview.template(data) #"),itemElement:c("# var item = data.item, r = data.r; ## var url = "+r("url")+"(item); #<div class='#= r.cssClass(data.group, item) #'># if (item.hasChildren) { #<span class='#= r.toggleButtonClass(item) #' role='presentation' /># } ## if (data.treeview.checkboxes) { #<span class='k-checkbox' role='presentation'>#= data.treeview.checkboxes.template(data) #<\/span># } ## var tag = url ? 'a' : 'span'; ## var textAttr = url ? ' href=\\'' + url + '\\'' : ''; #<#=tag#  class='#= r.textClass(item) #'#= textAttr #>#= r.itemContent(data) #<\/#=tag#><\/div>"),item:c("# var item = data.item, r = data.r; #<li role='treeitem' class='#= r.wrapperCssClass(data.group, item) #' "+i.attr("uid")+"='#= item.uid #' aria-selected='#= item.selected ? \"true\" : \"false \" #' #=item.enabled === false ? \"aria-disabled='true'\" : ''## if (item.expanded) { #data-expanded='true' aria-expanded='true'# } #>#= r.itemElement(data) #<\/li>"),loading:c("<div class='k-icon k-loading' /> #: data.messages.loading #"),retry:c("#: data.messages.requestFailed # <button class='k-button k-request-retry'>#: data.messages.retry #<\/button>")}},items:function(){return this.element.find(".k-item > div:first-child")},setDataSource:function(t){var i=this.options;if(i.dataSource=t,this._dataSource(),i.checkboxes&&i.checkboxes.checkChildren)this.dataSource.one("change",n.proxy(this.updateIndeterminate,this,null));this.dataSource.fetch()},_bindDataSource:function(){this._refreshHandler=u(this.refresh,this);this._errorHandler=u(this._error,this);this.dataSource.bind(k,this._refreshHandler);this.dataSource.bind(st,this._errorHandler)},_unbindDataSource:function(){var n=this.dataSource;n&&(n.unbind(k,this._refreshHandler),n.unbind(st,this._errorHandler))},_dataSource:function(n){function r(n){for(var t=0;t<n.length;t++)n[t]._initChildren(),n[t].children.fetch(),r(n[t].children.view())}var i=this,u=i.options,t=u.dataSource;t=y(t)?{data:t}:t;i._unbindDataSource();t.fields||(t.fields=[{field:"text"},{field:"url"},{field:"spriteCssClass"},{field:"imageUrl"}]);i.dataSource=t=ft.create(t);n&&(t.fetch(),r(t.view()));i._bindDataSource()},events:[ht,ct,lt,at,vt,"expand","collapse",it,k,ot,et],options:{name:"TreeView",dataSource:{},animation:{expand:{effects:"expand:vertical",duration:200},collapse:{duration:100}},messages:{loading:"Loading...",requestFailed:"Request failed.",retry:"Retry"},dragAndDrop:!1,checkboxes:!1,autoBind:!0,autoScroll:!1,loadOnDemand:!0,template:"",dataTextField:null},_accessors:function(){var u=this,f=u.options,t,n,r,e=u.element;for(t in b)n=f[b[t]],r=e.attr(i.attr(t+"-field")),!n&&r&&(n=r),n||(n=t),y(n)||(n=[n]),f[b[t]]=n},_fieldAccessor:function(t){var u=this.options[b[t]],f=u.length,r="(function(item) {";return f===0?r+="return item['"+t+"'];":(r+="var levels = ["+n.map(u,function(n){return"function(d){ return "+i.expr(n)+"}"}).join(",")+"];",r+="return levels[Math.min(item.level(), "+f+"-1)](item)"),r+"})"},setOptions:function(n){tt.fn.setOptions.call(this,n);this._animation();this._dragging();this._templates()},_trigger:function(n,t){return this.trigger(n,{node:t.closest(e)[0]})},_setChecked:function(t,i){if(t&&n.isFunction(t.view))for(var r=0,u=t.view();r<u.length;r++)u[r][f]=i,u[r].children&&this._setChecked(u[r].children,i)},_setIndeterminate:function(n){var e=o(n),t,u,r=!0,i;if(e.length){if(t=rt(e.children()),u=t.length,u)if(u>1){for(i=1;i<u;i++)if(t[i].checked!=t[i-1].checked||t[i].indeterminate||t[i-1].indeterminate){r=!1;break}}else r=!t[0].indeterminate;else return;return rt(n).data(h,!r).prop(h,!r).prop(f,r&&t[0].checked)}},updateIndeterminate:function(n){n=n||this.wrapper;var i=o(n).children(),t,r;if(i.length){for(t=0;t<i.length;t++)this.updateIndeterminate(i.eq(t));r=this._setIndeterminate(n);r&&r.prop(f)&&(this.dataItem(n).checked=!0)}},_bubbleIndeterminate:function(n){if(n.length){var t=this.parent(n),i;t.length&&(this._setIndeterminate(t),i=t.children("div").find(".k-checkbox :checkbox"),i.prop(h)===!1?this.dataItem(t).set(f,i.prop(f)):delete this.dataItem(t).checked,this._bubbleIndeterminate(t))}},_checkboxChange:function(t){var i=n(t.target),r=i.prop(f),u=i.closest(e),o=this.dataItem(u);o.checked!=r&&(o.set(f,r),this._trigger(et,u))},_toggleButtonClick:function(t){this.toggle(n(t.target).closest(e))},_mousedown:function(t){var i=n(t.currentTarget).closest(e);this._clickTarget=i;this.current(i)},_focusable:function(n){return n&&n.length&&n.is(":visible")&&!n.find(".k-in:first").hasClass("k-state-disabled")},_focus:function(){var t=this.select(),r=this._clickTarget;i.support.touch||(r&&r.length&&(t=r),this._focusable(t)||(t=this.current()),this._focusable(t)||(t=this._nextVisible(n())),this.current(t))},focus:function(){var r=this.wrapper,n=r[0],i=[],u=[],f=document.documentElement,t;do n=n.parentNode,n.scrollHeight>n.clientHeight&&(i.push(n),u.push(n.scrollTop));while(n!=f);for(r.focus(),t=0;t<i.length;t++)i[t].scrollTop=u[t]},_blur:function(){this.current().find(".k-in:first").removeClass("k-state-focused")},_enabled:function(n){return!n.children("div").children(".k-in").hasClass("k-state-disabled")},parent:function(t){var u=/\bk-item\b/,i,r;typeof t==d&&(t=this.element.find(t));gt(t)||(t=t[0]);r=u.test(t.className);do t=t.parentNode,u.test(t.className)&&(r?i=t:r=!0);while(!/\bk-treeview\b/.test(t.className)&&!i);return n(i)},_nextVisible:function(n){function r(n){while(n.length&&!n.next().length)n=i.parent(n);return n.next().length?n.next():n}var i=this,u=i._expanded(n),t;return n.length&&n.is(":visible")?u?(t=o(n).children().first(),t.length||(t=r(n))):t=r(n):t=i.root.children().eq(0),i._enabled(t)||(t=i._nextVisible(t)),t},_previousVisible:function(n){var i=this,r,t;if(!n.length||n.prev().length)for(t=n.length?n.prev():i.root.children().last();i._expanded(t);){if(r=o(t).children().last(),!r.length)break;t=r}else t=i.parent(n)||n;return i._enabled(t)||(t=i._previousVisible(t)),t},_keydown:function(r){var u=this,c=r.keyCode,e,o=u.current(),v=u._expanded(o),l=o.find(".k-checkbox:first :checkbox"),a=i.support.isRtl(u.element);r.target==r.currentTarget&&(!a&&c==s.RIGHT||a&&c==s.LEFT?v?e=u._nextVisible(o):u.expand(o):!a&&c==s.LEFT||a&&c==s.RIGHT?v?u.collapse(o):(e=u.parent(o),u._enabled(e)||(e=t)):c==s.DOWN?e=u._nextVisible(o):c==s.UP?e=u._previousVisible(o):c==s.HOME?e=u._nextVisible(n()):c==s.END?e=u._previousVisible(n()):c==s.ENTER?o.find(".k-in:first").hasClass("k-state-selected")||u._trigger(it,o)||u.select(o):c==s.SPACEBAR&&l.length&&(l.prop(f,!l.prop(f)).data(h,!1).prop(h,!1),u._checkboxChange({target:l}),e=o),e&&(r.preventDefault(),o[0]!=e[0]&&(u._trigger(ot,e),u.current(e))))},_click:function(t){var u=this,i=n(t.currentTarget),f=w(i.closest(e)),r=i.attr("href"),o;o=r?r=="#"||r.indexOf("#"+this.element.id+"-")>=0:f.length&&!f.children().length;o&&t.preventDefault();i.hasClass(".k-state-selected")||u._trigger(it,i)||u.select(i)},_wrapper:function(){var i=this,n=i.element,t,r;n.is("ul")?(t=n.wrap("<div />").parent(),r=n):(t=n,r=t.children("ul").eq(0));i.wrapper=t.addClass("k-widget k-treeview");i.root=r},_group:function(n){var t=this,r=n.hasClass(p),i={firstLevel:r,expanded:r||t._expanded(n)},u=n.children("ul");u.addClass(t.templates.groupCssClass(i)).css("display",i.expanded?"":"none");t._nodes(u,i)},_nodes:function(t,i){var r=this,u=t.children("li"),f;i=v({length:u.length},i);u.each(function(t,u){u=n(u);f={index:t,expanded:r._expanded(u)};nt(u);r._updateNodeClasses(u,i,f);r._group(u)})},_checkboxes:function(){var i=this.options,n=i.checkboxes,t;n&&(t="<input type='checkbox' #= (item.enabled === false) ? 'disabled' : '' # #= item.checked ? 'checked' : '' #",n.name&&(t+=" name='"+n.name+"'"),t+=" />",n=v({template:t},i.checkboxes),typeof n.template==d&&(n.template=ut(n.template)),i.checkboxes=n)},_updateNodeClasses:function(n,t,i){var r=n.children("div"),f=n.children("ul"),u=this.templates;n.hasClass("k-treeview")||(i=i||{},i.expanded=typeof i.expanded!=l?i.expanded:this._expanded(n),i.index=typeof i.index!=l?i.index:n.index(),i.enabled=typeof i.enabled!=l?i.enabled:!r.children(".k-in").hasClass("k-state-disabled"),t=t||{},t.firstLevel=typeof t.firstLevel!=l?t.firstLevel:n.parent().parent().hasClass(p),t.length=typeof t.length!=l?t.length:n.parent().children().length,n.removeClass("k-first k-last").addClass(u.wrapperCssClass(t,i)),r.removeClass("k-top k-mid k-bot").addClass(u.cssClass(t,i)),r.children(".k-in").removeClass("k-in k-state-default k-state-disabled").addClass(u.textClass(i)),(f.length||n.attr("data-hasChildren")=="true")&&(r.children(".k-icon").removeClass("k-plus k-minus k-plus-disabled k-minus-disabled").addClass(u.toggleButtonClass(i)),f.addClass("k-group")))},_processNodes:function(t,i){var r=this;r.element.find(t).each(function(t,u){i.call(r,t,n(u).closest(e))})},dataItem:function(t){var u=n(t).closest(e).attr(i.attr("uid")),r=this.dataSource;return r&&r.getByUid(u)},_insertNode:function(t,i,r,u,f){for(var h=this,l=o(r),w=l.children().length+1,a,v={firstLevel:r.hasClass(p),expanded:!f,length:w},s,c,y="",b=function(n,t){n.appendTo(t)},e=0;e<t.length;e++)c=t[e],c.index=i+e,y+=h._renderItem({group:v,item:c});if(s=n(y),s.length){for(h.angular("compile",function(){return{elements:s.get(),data:t.map(function(n){return{dataItem:n}})}}),l.length||(l=n(h._renderGroup({group:v})).appendTo(r)),u(s,l),r.hasClass("k-item")&&(nt(r),h._updateNodeClasses(r)),h._updateNodeClasses(s.prev().first()),h._updateNodeClasses(s.next().last()),e=0;e<t.length;e++)c=t[e],c.hasChildren&&(a=c.children.data(),a.length&&h._insertNode(a,c.index,s.eq(e),b,!h._expanded(s.eq(e))));return s}},_updateNodes:function(t,i){function b(n,t){n.find(".k-checkbox :checkbox").prop(f,t).data(h,!1).prop(h,!1)}var u=this,s,e,o,r,c,v,p={treeview:u.options,item:r},y=i!="expanded"&&i!="checked",l;if(i=="selected")r=t[0],e=u.findByUid(r.uid).find(".k-in:first").removeClass("k-state-hover").toggleClass("k-state-selected",r[i]).end(),r[i]&&u.current(e),e.attr(wt,!!r[i]);else{for(l=n.map(t,function(n){return u.findByUid(n.uid).children("div")}),y&&u.angular("cleanup",function(){return{elements:l}}),s=0;s<t.length;s++)p.item=r=t[s],o=l[s],e=o.parent(),y&&o.children(".k-in").html(u.templates.itemContent(p)),i==f?(c=r[i],b(o,c),u.options.checkboxes.checkChildren&&(b(e.children(".k-group"),c),u._setChecked(r.children,c),u._bubbleIndeterminate(e))):i=="expanded"?u._toggle(e,r,r[i]):i=="enabled"&&(e.find(".k-checkbox :checkbox").prop("disabled",!r[i]),v=!w(e).is(ri),e.removeAttr(bt),r[i]||(r.selected&&r.set("selected",!1),r.expanded&&r.set("expanded",!1),v=!0,e.attr(wt,!1).attr(bt,!0)),u._updateNodeClasses(e,{},{enabled:r[i],expanded:!v})),o.length&&this.trigger("itemChange",{item:o,data:r,ns:a});y&&u.angular("compile",function(){return{elements:l,data:n.map(t,function(n){return[{dataItem:n}]})}})}},_appendItems:function(n,t,i){var u=o(i),r=u.children(),f=!this._expanded(i);typeof n==l&&(n=r.length);this._insertNode(t,n,i,function(t,i){n>=r.length?t.appendTo(i):t.insertBefore(r.eq(n))},f);this._expanded(i)&&(this._updateNodeClasses(i),o(i).css("display","block"))},_refreshChildren:function(n,t,i){var r,u,f,e=this.options,s=e.loadOnDemand,h=e.checkboxes&&e.checkboxes.checkChildren;if(o(n).empty(),t.length)for(this._appendItems(i,t,n),u=o(n).children(),s&&h&&this._bubbleIndeterminate(u.last()),r=0;r<u.length;r++)f=u.eq(r),this.trigger("itemChange",{item:f.children("div"),data:this.dataItem(f),ns:a});else nt(n)},_refreshRoot:function(t){var u=this._renderGroup({items:t,group:{firstLevel:!0,expanded:!0}}),r,i,f;for(this.root.length?(this._angularItems("cleanup"),r=n(u),this.root.attr("class",r.attr("class")).html(r.html())):this.root=this.wrapper.html(u).children("ul"),this.root.attr("role","tree"),i=0;i<t.length;i++)f=this.root.children(".k-item"),this.trigger("itemChange",{item:f.eq(i),data:t[i],ns:a});this._angularItems("compile")},refresh:function(n){var f=n.node,u=n.action,i=n.items,e=this.wrapper,o=this.options,h=o.loadOnDemand,c=o.checkboxes&&o.checkboxes.checkChildren,r,s;if(n.field)return!i[0]||!i[0].level?void 0:this._updateNodes(i,n.field);if(f&&(e=this.findByUid(f.uid),this._progress(e,!1)),c&&u!="remove"){for(s=!1,r=0;r<i.length;r++)if("checked"in i[r]){s=!0;break}if(!s&&f&&f.checked)for(r=0;r<i.length;r++)i[r].checked=!0}if(u=="add"?this._appendItems(n.index,i,e):u=="remove"?this._remove(this.findByUid(i[0].uid),!1):u=="itemchange"?this._updateNodes(i):u=="itemloaded"?this._refreshChildren(e,i,n.index):this._refreshRoot(i),u!="remove")for(r=0;r<i.length;r++)(!h||i[r].expanded)&&i[r].load();this.trigger(vt,{node:f?e:t})},_error:function(n){var t=n.node&&this.findByUid(n.node.uid),i=this.templates.retry({messages:this.options.messages});t?(this._progress(t,!1),this._expanded(t,!1),g(t).addClass("k-i-refresh"),n.node.loaded(!1)):(this._progress(!1),this.element.html(i))},_retryRequest:function(n){n.preventDefault();this.dataSource.fetch()},expand:function(n){this._processNodes(n,function(n,t){this.toggle(t,!0)})},collapse:function(n){this._processNodes(n,function(n,t){this.toggle(t,!1)})},enable:function(n,t){t=arguments.length==2?!!t:!0;this._processNodes(n,function(n,i){this.dataItem(i).set("enabled",t)})},current:function(t){var r=this,i=r._current,f=r.element,u=r._ariaId;if(arguments.length>0&&t&&t.length){i&&(i[0].id===u&&i.removeAttr("id"),i.find(".k-in:first").removeClass("k-state-focused"));i=r._current=n(t,f).closest(e);i.find(".k-in:first").addClass("k-state-focused");u=i[0].id||u;u&&(r.wrapper.removeAttr("aria-activedescendant"),i.attr("id",u),r.wrapper.attr("aria-activedescendant",u));return}return i||(i=r._nextVisible(n())),i},select:function(t){var i=this,r=i.element;if(!arguments.length)return r.find(".k-state-selected").closest(e);t=n(t,r).closest(e);r.find(".k-state-selected").each(function(){var t=i.dataItem(this);t?(t.set("selected",!1),delete t.selected):n(this).removeClass("k-state-selected")});t.length&&i.dataItem(t).set("selected",!0);i.trigger(k)},_toggle:function(n,t,i){var u=this.options,r=w(n),f=i?"expand":"collapse",e;r.data("animating")||this._trigger(f,n)||(this._expanded(n,i),e=t&&t.loaded(),i&&!e?(u.loadOnDemand&&this._progress(n,!0),r.remove(),t.load()):(this._updateNodeClasses(n,{},{expanded:i}),i||r.css("height",r.height()).css("height"),r.kendoStop(!0,!0).kendoAnimate(v({reset:!0},u.animation[f],{complete:function(){i&&r.css("height","")}}))))},toggle:function(t,i){(t=n(t),g(t).is(".k-minus,.k-plus,.k-minus-disabled,.k-plus-disabled"))&&(arguments.length==1&&(i=!this._expanded(t)),this._expanded(t,i))},destroy:function(){var n=this;tt.fn.destroy.call(n);n.wrapper.off(r);n._unbindDataSource();n.dragging&&n.dragging.destroy();i.destroy(n.element);n.root=n.wrapper=n.element=null},_expanded:function(n,t){var u=i.attr("expanded"),r=this.dataItem(n);if(arguments.length==1)return n.attr(u)==="true"||r&&r.expanded;w(n).data("animating")||(r&&(r.set("expanded",t),t=r.expanded),t?(n.attr(u,"true"),n.attr("aria-expanded","true")):(n.removeAttr(u),n.attr("aria-expanded","false")))},_progress:function(n,t){var i=this.element,r=this.templates.loading({messages:this.options.messages});arguments.length==1?(t=n,t?i.html(r):i.empty()):g(n).toggleClass("k-loading",t).removeClass("k-i-refresh")},text:function(n,t){var i=this.dataItem(n),r=this.options[b.text],f=i.level(),e=r.length,u=r[Math.min(f,e-1)];if(t)i.set(u,t);else return i[u]},_objectOrSelf:function(t){return n(t).closest("[data-role=treeview]").data("kendoTreeView")||this},_dataSourceMove:function(t,i,r,u){var f,o=this._objectOrSelf(r||i),e=o.dataSource,s=n.Deferred().resolve().promise();return r&&r[0]!=o.element[0]&&(f=o.dataItem(r),f.loaded()||(o._progress(r,!0),s=f.load()),r!=this.root&&(e=f.children,e&&e instanceof ft||(f._initChildren(),f.loaded(!0),e=f.children))),t=this._toObservableData(t),u.call(this,e,t,s)},_toObservableData:function(t){var r=t,u,f;return(t instanceof window.jQuery||gt(t))&&(u=this._objectOrSelf(t).dataSource,f=n(t).attr(i.attr("uid")),r=u.getByUid(f),r&&(r=u.remove(r))),r},_insert:function(n,t,r){t instanceof i.data.ObservableArray?t=t.toJSON():y(t)||(t=[t]);var u=n.parent();return u&&u._initChildren&&(u.hasChildren=!0,u._initChildren()),n.splice.apply(n,[r,0].concat(t)),this.findByUid(n[r].uid)},insertAfter:ti(1),insertBefore:ti(0),append:function(t,i,r){var u=this,f=u.root;return i&&(f=o(i)),u._dataSourceMove(t,f,i,function(t,f,e){function s(){i&&u._expanded(i,!0);var n=t.data(),r=Math.max(n.length,0);return u._insert(n,f,r)}var o;return e.then(function(){o=s();r=r||n.noop;r(o)}),o||null})},_remove:function(t,i){var r=this,u,f,e;return t=n(t,r.element),this.angular("cleanup",function(){return{elements:t.get()}}),u=t.parent().parent(),f=t.prev(),e=t.next(),t[i?"detach":"remove"](),u.hasClass("k-item")&&(nt(u),r._updateNodeClasses(u)),r._updateNodeClasses(f),r._updateNodeClasses(e),t},remove:function(n){var t=this.dataItem(n);t&&this.dataSource.remove(t)},detach:function(n){return this._remove(n,!0)},findByText:function(t){return n(this.element).find(".k-in").filter(function(i,r){return n(r).text()==t}).closest(e)},findByUid:function(t){for(var u=this.element.find(".k-item"),e=i.attr("uid"),f,r=0;r<u.length;r++)if(u[r].getAttribute(e)==t){f=u[r];break}return n(f)},expandPath:function(t,i){function e(n,t,i){n&&!n.loaded()?n.set("expanded",!0):t.call(i)}t=t.slice(0);var u=this,f=this.dataSource,r=f.get(t[0]);for(i=i||n.noop;t.length>0&&r&&(r.expanded||r.loaded());)r.set("expanded",!0),t.shift(),r=f.get(t[0]);if(!t.length)return i.call(u);f.bind("change",function(n){var r=n.node&&n.node.id,o;r&&r===t[0]&&(t.shift(),t.length?(o=f.get(t[0]),e(o,i,u)):i.call(u))});e(r,i,u)},_parentIds:function(n){for(var t=n&&n.parentNode(),i=[];t&&t.parentNode;)i.unshift(t.id),t=t.parentNode();return i},expandTo:function(n){n instanceof i.data.Node||(n=this.dataSource.get(n));var t=this._parentIds(n);this.expandPath(t)},_renderItem:function(n){return n.group||(n.group={}),n.treeview=this.options,n.r=this.templates,this.templates.item(n)},_renderGroup:function(n){var t=this;return n.renderItems=function(n){var u="",i=0,r=n.items,f=r?r.length:0,e=n.group;for(e.length=f;i<f;i++)n.group=e,n.item=r[i],n.item.index=i,u+=t._renderItem(n);return u},n.r=t.templates,t.templates.group(n)}});a.plugin(kt)})(window.kendo.jQuery)}(),function(){(function(n){function c(n,t){for(var r=[],i=0,u=n.length;i<u;i++)n[i].field!==t&&r.push(n[i]);return r}function f(n,t,i){if(!n)return[];n=n.filters;for(var r=0,f=[],e=n.length,u;r<e;r++)u=n[r].operator,(i||u==="in")&&u!==i||n[r].field!==t||f.push(n[r]);return f}function l(t,i,r){var e,u=0,o=r.length;if(t=f(t,i,"in")[0],t)for(e=t.value.split(",");u<o;u++)r[u].checked=n.inArray(r[u].uniqueName,e)>=0;else for(;u<o;u++)r[u].checked=!0}function s(n,t){for(var r=n.length,i=0;i<r;i++)n[i].checked&&n[i].level()!==0&&t.push(n[i].uniqueName),n[i].hasChildren&&s(n[i].children.view(),t)}var t=window.kendo,r=t.ui,o="kendoContextMenu",i=n.proxy,u=".kendoPivotFieldMenu",e=r.Widget,h=e.extend({init:function(n,i){e.fn.init.call(this,n,i);this._dataSource();this._layout();t.notify(this)},events:[],options:{name:"PivotFieldMenu",filter:null,filterable:!0,sortable:!0,messages:{info:"Show items with value that:",sortAscending:"Sort Ascending",sortDescending:"Sort Descending",filterFields:"Fields Filter",filter:"Filter",include:"Include Fields...",title:"Fields to include",clear:"Clear",ok:"OK",cancel:"Cancel",operators:{contains:"Contains",doesnotcontain:"Does not contain",startswith:"Starts with",endswith:"Ends with",eq:"Is equal to",neq:"Is not equal to"}}},_layout:function(){var r=this.options;this.wrapper=n(t.template(a)({ns:t.ns,filterable:r.filterable,sortable:r.sortable,messages:r.messages}));this.menu=this.wrapper[o]({filter:r.filter,target:this.element,orientation:"vertical",showOn:"click",closeOnClick:!1,open:i(this._menuOpen,this),select:i(this._select,this),copyAnchorStyles:!1}).data(o);this._createWindow();r.filterable&&this._initFilterForm()},_initFilterForm:function(){var n=this.menu.element.find(".k-filter-item"),r=i(this._filter,this);this._filterOperator=new t.ui.DropDownList(n.find("select"));this._filterValue=n.find(".k-textbox");n.on("submit"+u,r).on("click"+u,".k-button-filter",r).on("click"+u,".k-button-clear",i(this._reset,this))},_setFilterForm:function(n){var t=this._filterOperator,i="",r="";n&&(i=n.operator,r=n.value);t.value(i);t.value()||t.select(0);this._filterValue.val(r)},_clearFilters:function(n){var t=this.dataSource.filter()||{},i,r=0,u;for(t.filters=t.filters||[],i=f(t,n),u=i.length;r<u;r++)t.filters.splice(t.filters.indexOf(i[r]),1);return t},_convert:function(t){var r=this.dataSource.options.schema,i=((r.model||{}).fields||{})[this.currentMember];return i&&(i.type==="number"?t=parseFloat(t):i.type==="boolean"&&(t=Boolean(n.parseJSON(t)))),t},_filter:function(n){var t=this,r=t._convert(t._filterValue.val()),u,i;if(n.preventDefault(),r===""){t.menu.close();return}u={field:t.currentMember,operator:t._filterOperator.value(),value:r};i=t._clearFilters(t.currentMember);i.filters.push(u);t.dataSource.filter(i);t.menu.close()},_reset:function(n){var t=this,i=t._clearFilters(t.currentMember);n.preventDefault();i.filters[0]||(i={});t.dataSource.filter(i);t._setFilterForm(null);t.menu.close()},_sort:function(n){var i=this.currentMember,t=this.dataSource.sort()||[];t=c(t,i);t.push({field:i,dir:n});this.dataSource.sort(t);this.menu.close()},setDataSource:function(n){this.options.dataSource=n;this._dataSource()},_dataSource:function(){this.dataSource=t.data.PivotDataSource.create(this.options.dataSource)},_createWindow:function(){var f=this.options.messages;this.includeWindow=n(t.template(v)({messages:f})).on("click"+u,".k-button-ok",i(this._applyIncludes,this)).on("click"+u,".k-button-cancel",i(this._closeWindow,this));this.includeWindow=new r.Window(this.includeWindow,{title:f.title,visible:!1,resizable:!1,open:i(this._windowOpen,this)})},_applyIncludes:function(n){var r=[],i,e=this.treeView.dataSource.view(),o=e[0].checked,t=this.dataSource.filter(),u=f(t,this.currentMember,"in")[0];s(e,r);u&&(o?(t.filters.splice(t.filters.indexOf(u),1),t.filters.length||(t={})):u.value=r.join(","),i=t);r.length&&(i||o||(i={field:this.currentMember,operator:"in",value:r.join(",")},t&&(t.filters.push(i),i=t)));i&&this.dataSource.filter(i);this._closeWindow(n)},_closeWindow:function(n){n.preventDefault();this.includeWindow.close()},_treeViewDataSource:function(){var n=this;return t.data.HierarchicalDataSource.create({schema:{model:{id:"uniqueName",hasChildren:function(n){return parseInt(n.childrenCardinality,10)>0}}},transport:{read:function(t){var i={},r=n.treeView.dataSource.get(t.data.uniqueName),u=t.data.uniqueName;u?(i.memberUniqueName=r.uniqueName.replace(/\&/g,"&amp;"),i.treeOp=1):i.levelUniqueName=n.currentMember+".[(ALL)]";n.dataSource.schemaMembers(i).done(function(i){l(n.dataSource.filter(),n.currentMember,i);t.success(i)}).fail(t.error)}}})},_createTreeView:function(n){var t=this;t.treeView=new r.TreeView(n,{autoBind:!1,dataSource:t._treeViewDataSource(),dataTextField:"caption",template:"#: data.item.caption || data.item.name #",checkboxes:{checkChildren:!0},dataBound:function(){r.progress(t.includeWindow.element,!1)}})},_menuOpen:function(i){if(i.event){var r=t.attr("name");this.currentMember=n(i.event.target).closest("["+r+"]").attr(r);this.options.filterable&&this._setFilterForm(f(this.dataSource.filter(),this.currentMember)[0])}},_select:function(t){var i=n(t.item);n(".k-pivot-filter-window").not(this.includeWindow.element).kendoWindow("close");i.hasClass("k-include-item")?this.includeWindow.center().open():i.hasClass("k-sort-asc")?this._sort("asc"):i.hasClass("k-sort-desc")&&this._sort("desc")},_windowOpen:function(){this.treeView||this._createTreeView(this.includeWindow.element.find(".k-treeview"));r.progress(this.includeWindow.element,!0);this.treeView.dataSource.read()},destroy:function(){e.fn.destroy.call(this);this.menu&&(this.menu.destroy(),this.menu=null);this.treeView&&(this.treeView.destroy(),this.treeView=null);this.includeWindow&&(this.includeWindow.destroy(),this.includeWindow=null);this.wrapper=null;this.element=null}}),a='<ul class="k-pivot-fieldmenu"># if (sortable) {#<li class="k-item k-sort-asc"><span class="k-link"><span class="k-icon k-i-sort-asc"><\/span>${messages.sortAscending}<\/span><\/li><li class="k-item k-sort-desc"><span class="k-link"><span class="k-icon k-i-sort-desc"><\/span>${messages.sortDescending}<\/span><\/li># if (filterable) {#<li class="k-separator"><\/li># } ## } ## if (filterable) {#<li class="k-item k-include-item"><span class="k-link"><span class="k-icon k-filter"><\/span>${messages.include}<\/span><\/li><li class="k-separator"><\/li><li class="k-item k-filter-item"><span class="k-link"><span class="k-icon k-filter"><\/span>${messages.filterFields}<\/span><ul><li><div class="k-filterable k-content" tabindex="-1" data-role="fieldmenu"><form class="k-filter-menu"><div><div class="k-filter-help-text">#=messages.info#<\/div><select>#for(var op in messages.operators){#<option value="#=op#">#=messages.operators[op]#<\/option>#}#<\/select><input class="k-textbox" type="text" /><div><a class="k-button k-primary k-button-filter" href="\\#">#=messages.filter#<\/a><a class="k-button k-button-clear" href="\\#">#=messages.clear#<\/a><\/div><\/div><\/form><\/div><\/li><\/ul><\/li># } #<\/ul>',v='<div class="k-popup-edit-form k-pivot-filter-window"><div class="k-edit-form-container"><div class="k-treeview"><\/div><div class="k-edit-buttons k-state-default"><a class="k-button k-primary k-button-ok" href="\\#">${messages.ok}<\/a><a class="k-button k-button-cancel" href="\\#">${messages.cancel}<\/a><\/div><\/div>';r.plugin(h)})(window.kendo.jQuery)}(),function(){(function(n,t){function v(t,i){var r=[],u,f;if(n.isPlainObject(t))if(t.hasOwnProperty("filters"))r=t.filters;else if(t.field==i)return t;for(n.isArray(t)&&(r=t),u=0;u<r.length;u++)if(f=v(r[u],i),f)return f}function y(t,i){t.filters&&(t.filters=n.grep(t.filters,function(n){return y(n,i),n.filters?n.filters.length:n.field!=i}))}function p(n,t){var r=i.getter(t,!0);return function(t){for(var f=n(t),e=[],o=0,s={},i,u;o<f.length;)i=f[o++],u=r(i),s.hasOwnProperty(u)||(e.push(i),s[u]=!0);return e}}var i=window.kendo,a=i.ui,s=i.data.DataSource,h=a.Widget,r="change",c="boolean",l="enums",u="string",f="Is equal to",e="Is not equal to",o=n.proxy,w=h.extend({init:function(f,e){var g,p,v;f=n(f).addClass("k-filtercell");var k=this.wrapper=n("<span/>").appendTo(f),s=this,w,b,nt=e,d,a,y=s.operators=e.operators||{},tt=s.input=n("<input/>").attr(i.attr("bind"),"value: value").appendTo(k);if(h.fn.init.call(s,f[0],e),e=s.options,w=s.dataSource=e.dataSource,s.model=w.reader.model,a=e.type=u,g=i.getter("reader.model.fields",!0)(w)||{},p=g[e.field],p&&p.type&&(a=e.type=p.type),e.values&&(e.type=a=l),y=y[a]||e.operators[a],!nt.operator)for(d in y){e.operator=d;break}s._parse=function(n){return n+""};s.model&&s.model.fields&&(v=s.model.fields[e.field],v&&v.parse&&(s._parse=o(v.parse,v)));s.viewModel=b=i.observable({operator:e.operator,value:null,operatorVisible:function(){var n=this.get("value");return n!==null&&n!==t&&n!="undefined"}});b.bind(r,o(s.updateDsFilter,s));a==u&&s.initSuggestDataSource(e);e.inputWidth!==null&&tt.width(e.inputWidth);s._setInputType(e,a);a!=c&&e.showOperators!==!1?s._createOperatorDropDown(y):k.addClass("k-operator-hidden");s._createClearIcon();i.bind(this.wrapper,b);a==u&&(e.template||s.setAutoCompleteSource());a==l&&s.setComboBoxSource(s.options.values);s._refreshUI();s._refreshHandler=o(s._refreshUI,s);s.dataSource.bind(r,s._refreshHandler)},_setInputType:function(t,r){var f=this,e=f.input,s;if(typeof t.template=="function")t.template.call(f.viewModel,{element:f.input,dataSource:f.suggestDataSource}),f._angularItems("compile");else if(r==u)e.attr(i.attr("role"),"autocomplete").attr(i.attr("text-field"),t.dataTextField||t.field).attr(i.attr("filter"),t.suggestionOperator).attr(i.attr("delay"),t.delay).attr(i.attr("min-length"),t.minLength).attr(i.attr("value-primitive"),!0);else if(r=="date")e.attr(i.attr("role"),"datepicker");else if(r==c){e.remove();var o=n("<input type='radio'/>"),a=f.wrapper,v=i.guid(),h=n("<label/>").text(t.messages.isTrue).append(o);o.attr(i.attr("bind"),"checked:value").attr("name",v).val("true");s=h.clone().text(t.messages.isFalse);o.clone().val("false").appendTo(s);a.append([h,s])}else r=="number"?e.attr(i.attr("role"),"numerictextbox"):r==l&&e.attr(i.attr("role"),"combobox").attr(i.attr("text-field"),"text").attr(i.attr("suggest"),!0).attr(i.attr("filter"),"contains").attr(i.attr("value-field"),"value").attr(i.attr("value-primitive"),!0)},_createOperatorDropDown:function(t){var u=[],r,f;for(r in t)u.push({text:t[r],value:r});f=n('<input class="k-dropdown-operator" '+i.attr("bind")+'="value: operator"/>').appendTo(this.wrapper);this.operatorDropDown=f.kendoDropDownList({dataSource:u,dataTextField:"text",dataValueField:"value",open:function(){this.popup.element.width(150)},valuePrimitive:!0}).data("kendoDropDownList");this.operatorDropDown.wrapper.find(".k-i-arrow-s").removeClass("k-i-arrow-s").addClass("k-filter")},initSuggestDataSource:function(n){var i=n.suggestDataSource;i instanceof s||(!n.customDataSource&&i&&(i.group=t),i=this.suggestDataSource=s.create(i));n.customDataSource||(i._pageSize=t,i.reader.data=p(i.reader.data,this.options.field));this.suggestDataSource=i},setAutoCompleteSource:function(){var n=this.input.data("kendoAutoComplete");n&&n.setDataSource(this.suggestDataSource)},setComboBoxSource:function(n){var i=s.create({data:n}),t=this.input.data("kendoComboBox");t&&t.setDataSource(i)},_refreshUI:function(){var t=this,i=v(t.dataSource.filter(),this.options.field)||{},r=t.viewModel;t.manuallyUpdatingVM=!0;i=n.extend(!0,{},i);t.options.type==c&&r.value!==i.value&&t.wrapper.find(":radio").prop("checked",!1);i.operator&&r.set("operator",i.operator);r.set("value",i.value);t.manuallyUpdatingVM=!1},updateDsFilter:function(i){var r=this,o=r.viewModel,u,f,e;r.manuallyUpdatingVM||i.field=="operator"&&o.value===t||(u=n.extend({},r.viewModel.toJSON(),{field:r.options.field}),f={logic:"and",filters:[]},u.value!==t&&u.value!==null&&f.filters.push(u),e=r._merge(f),e.filters.length?r.dataSource.filter(e):r.dataSource.filter({}))},_merge:function(t){var f=this,s=t.logic||"and",r=t.filters,e,i=f.dataSource.filter()||{filters:[],logic:"and"},u,o;for(y(i,f.options.field),u=0,o=r.length;u<o;u++)e=r[u],e.value=f._parse(e.value);return r=n.grep(r,function(n){return n.value!==""&&n.value!==null}),r.length&&(i.filters.length?(t.filters=r,i.logic!=="and"&&(i.filters=[{logic:i.logic,filters:i.filters}],i.logic="and"),r.length>1?i.filters.push(t):i.filters.push(r[0])):(i.filters=r,i.logic=s)),i},_createClearIcon:function(){var t=this;n("<button type='button' class='k-button k-button-icon' title = "+t.options.messages.clear+"/>").attr(i.attr("bind"),"visible:operatorVisible").html("<span class='k-icon k-i-close'/>").click(o(t.clearFilter,t)).appendTo(t.wrapper)},clearFilter:function(){this.viewModel.set("value",null)},_angularItems:function(n){var t=this.wrapper.closest("th").get(),i=this.options.column;this.angular(n,function(){return{elements:t,data:[{column:i}]}})},destroy:function(){var n=this;n.filterModel=null;n.operatorDropDown=null;n._angularItems("cleanup");n._refreshHandler&&(n.dataSource.bind(r,n._refreshHandler),n._refreshHandler=null);i.unbind(n.element);h.fn.destroy.call(n);i.destroy(n.element)},events:[r],options:{name:"FilterCell",delay:200,minLength:1,inputWidth:null,values:t,customDataSource:!1,field:"",dataTextField:"",type:"string",suggestDataSource:null,suggestionOperator:"startswith",operator:"eq",showOperators:!0,template:null,messages:{isTrue:"is true",isFalse:"is false",filter:"Filter",clear:"Clear",operator:"Operator"},operators:{string:{eq:f,neq:e,startswith:"Starts with",contains:"Contains",doesnotcontain:"Does not contain",endswith:"Ends with"},number:{eq:f,neq:e,gte:"Is greater than or equal to",gt:"Is greater than",lte:"Is less than or equal to",lt:"Is less than"},date:{eq:f,neq:e,gte:"Is after or equal to",gt:"Is after",lte:"Is before or equal to",lt:"Is before"},enums:{eq:f,neq:e}}}});a.plugin(w)})(window.kendo.jQuery)}(),function(){(function(n,t){function wt(t){t=n(t);t.children(r).children(".k-icon").remove();t.filter(":has(.k-panel),:has(.k-content)").children(".k-link:not(:has([class*=k-i-arrow]))").each(function(){var t=n(this),i=t.parent();t.append("<span class='k-icon "+(i.hasClass(w)?"k-i-arrow-n k-panelbar-collapse":"k-i-arrow-s k-panelbar-expand")+"'/>")})}function a(t){t=n(t);t.filter(".k-first:not(:first-child)").removeClass(ct);t.filter(".k-last:not(:last-child)").removeClass(ht);t.filter(":first-child").addClass(ct);t.filter(":last-child").addClass(ht)}var f=window.kendo,ei=f.ui,o=f.keys,i=n.extend,ot=n.each,s=f.template,tt=ei.Widget,oi=/^(ul|a|div)$/i,h=".kendoPanelBar",bt="img",st="href",ht="k-last",it="k-link",r="."+it,kt="error",u=".k-item",b=".k-group:visible",dt="k-image",ct="k-first",lt="expand",at="select",rt="k-content",gt="activate",ut="collapse",ni="mouseenter",si="mouseleave",ti="contentLoad",w="k-state-active",v="> .k-panel",k="> .k-content",ii="k-state-focused",e="k-state-disabled",d="k-state-selected",ft="."+d,c="k-state-highlight",g=u+":not(.k-state-disabled)",ri="> "+g+" > "+r+", .k-panel > "+g+" > "+r,hi=u+".k-state-disabled > .k-link",ui="> li > "+ft+", .k-panel > li > "+ft,ci="k-state-default",vt="aria-disabled",nt="aria-expanded",yt="aria-hidden",et="aria-selected",y=":visible",li=":empty",fi="single",l={content:s("<div role='region' class='k-content'#= contentAttributes(data) #>#= content(item) #<\/div>"),group:s("<ul role='group' aria-hidden='true' class='#= groupCssClass(group) #'#= groupAttributes(group) #>#= renderItems(data) #<\/ul>"),itemWrapper:s("<#= tag(item) # class='#= textClass(item, group) #' #= contentUrl(item) ##= textAttributes(item) #>#= image(item) ##= sprite(item) ##= text(item) ##= arrow(data) #<\/#= tag(item) #>"),item:s("<li role='menuitem' #=aria(item)#class='#= wrapperCssClass(group, item) #'>#= itemWrapper(data) ## if (item.items) { ##= subGroup({ items: item.items, panelBar: panelBar, group: { expanded: item.expanded } }) ## } else if (item.content || item.contentUrl) { ##= renderContent(data) ## } #<\/li>"),image:s("<img class='k-image' alt='' src='#= imageUrl #' />"),arrow:s("<span class='#= arrowClass(item) #'><\/span>"),sprite:s("<span class='k-sprite #= spriteCssClass #'><\/span>"),empty:s("")},pt={aria:function(n){var t="";return(n.items||n.content||n.contentUrl)&&(t+=nt+"='"+(n.expanded?"true":"false")+"' "),n.enabled===!1&&(t+=vt+"='true'"),t},wrapperCssClass:function(n,t){var i="k-item",r=t.index;return i+=t.enabled===!1?" "+e:t.expanded===!0?" "+w:" k-state-default",r===0&&(i+=" k-first"),r==n.length-1&&(i+=" k-last"),t.cssClass&&(i+=" "+t.cssClass),i},textClass:function(n,t){var i=it;return t.firstLevel&&(i+=" k-header"),i},textAttributes:function(n){return n.url?" href='"+n.url+"'":""},arrowClass:function(n){return"k-icon"+(n.expanded?" k-i-arrow-n k-panelbar-collapse":" k-i-arrow-s k-panelbar-expand")},text:function(n){return n.encoded===!1?n.text:f.htmlEncode(n.text)},tag:function(n){return n.url||n.contentUrl?"a":"span"},groupAttributes:function(n){return n.expanded!==!0?" style='display:none'":""},groupCssClass:function(){return"k-group k-panel"},contentAttributes:function(n){return n.item.expanded!==!0?" style='display:none'":""},content:function(n){return n.content?n.content:n.contentUrl?"":"&nbsp;"},contentUrl:function(n){return n.contentUrl?'href="'+n.contentUrl+'"':""}},p=tt.extend({init:function(t,i){var r=this,u;tt.fn.init.call(r,t,i);t=r.wrapper=r.element.addClass("k-widget k-reset k-header k-panelbar");i=r.options;t[0].id&&(r._itemId=t[0].id+"_pb_active");r._tabindex();r._initData(i);r._updateClasses();r._animations(i);t.on("click"+h,ri,function(t){r._click(n(t.currentTarget))&&t.preventDefault()}).on(ni+h+" "+si+h,ri,r._toggleHover).on("click"+h,hi,!1).on("keydown"+h,n.proxy(r._keydown,r)).on("focus"+h,function(){var n=r.select();r._current(n[0]?n:r._first())}).on("blur"+h,function(){r._current(null)}).attr("role","menu");u=t.find("li."+w+" > ."+rt);u[0]&&r.expand(u.parent(),!1);r._angularCompile();f.notify(r)},events:[lt,ut,at,gt,kt,ti],options:{name:"PanelBar",animation:{expand:{effects:"expand:vertical",duration:200},collapse:{duration:200}},expandMode:"multiple"},_angularCompile:function(){var n=this;n.angular("compile",function(){return{elements:n.element.children("li"),data:[{dataItem:n.options.$angular}]}})},_angularCleanup:function(){var n=this;n.angular("cleanup",function(){return{elements:n.element.children("li")}})},destroy:function(){tt.fn.destroy.call(this);this.element.off(h);this._angularCleanup();f.destroy(this.element)},_initData:function(n){var t=this;n.dataSource&&(t.element.empty(),t.append(n.dataSource,t.element))},setOptions:function(n){var t=this.options.animation;this._animations(n);n.animation=i(!0,t,n.animation);"dataSource"in n&&this._initData(n);tt.fn.setOptions.call(this,n)},expand:function(t,i){var r=this,u={};if(r._animating&&t.find("ul").is(":visible")){r.one("complete",function(){setTimeout(function(){r.expand(t)})});return}return r._animating=!0,i=i!==!1,t=this.element.find(t),t.each(function(f,o){o=n(o);var s=o.find(v).add(o.find(k));if(!o.hasClass(e)&&s.length>0){if(r.options.expandMode==fi&&r._collapseAllExpanded(o))return r;t.find("."+c).removeClass(c);o.addClass(c);i||(u=r.options.animation,r.options.animation={expand:{effects:{}},collapse:{hide:!0,effects:{}}});r._triggerEvent(lt,o)||r._toggleItem(o,!1);i||(r.options.animation=u)}}),r},collapse:function(t,i){var r=this,u={};return r._animating=!0,i=i!==!1,t=r.element.find(t),t.each(function(t,f){f=n(f);var o=f.find(v).add(f.find(k));!f.hasClass(e)&&o.is(y)&&(f.removeClass(c),i||(u=r.options.animation,r.options.animation={expand:{effects:{}},collapse:{hide:!0,effects:{}}}),r._triggerEvent(ut,f)||r._toggleItem(f,!0),i||(r.options.animation=u))}),r},_toggleDisabled:function(n,t){n=this.element.find(n);n.toggleClass(ci,t).toggleClass(e,!t).attr(vt,!t)},select:function(i){var u=this;return i===t?u.element.find(ui).parent():(i=u.element.find(i),i.length?i.each(function(){var t=n(this),i=t.children(r);if(t.hasClass(e))return u;u._triggerEvent(at,t)||u._updateSelected(i)}):this._updateSelected(i),u)},clearSelection:function(){this.select(n())},enable:function(n,t){return this._toggleDisabled(n,t!==!1),this},disable:function(n){return this._toggleDisabled(n,!1),this},append:function(n,t){t=this.element.find(t);var i=this._insert(n,t,t.length?t.find(v):null);return ot(i.items,function(){i.group.append(this);a(this)}),wt(t),a(i.group.find(".k-first, .k-last")),i.group.height("auto"),this},insertBefore:function(n,t){t=this.element.find(t);var i=this._insert(n,t,t.parent());return ot(i.items,function(){t.before(this);a(this)}),a(t),i.group.height("auto"),this},insertAfter:function(n,t){t=this.element.find(t);var i=this._insert(n,t,t.parent());return ot(i.items,function(){t.after(this);a(this)}),a(t),i.group.height("auto"),this},remove:function(n){n=this.element.find(n);var r=this,t=n.parentsUntil(r.element,u),i=n.parent("ul");return n.remove(),!i||i.hasClass("k-panelbar")||i.children(u).length||i.remove(),t.length&&(t=t.eq(0),wt(t),a(t)),r},reload:function(t){var i=this;t=i.element.find(t);t.each(function(){var t=n(this);i._ajaxRequest(t,t.children("."+rt),!t.is(y))})},_first:function(){return this.element.children(g).first()},_last:function(){var n=this.element.children(g).last(),t=n.children(b);return t[0]?t.children(g).last():n},_current:function(i){var f=this,u=f._focused,e=f._itemId;if(i===t)return u;f.element.removeAttr("aria-activedescendant");u&&u.length&&(u[0].id===e&&u.removeAttr("id"),u.children(r).removeClass(ii));n(i).length&&(e=i[0].id||e,i.attr("id",e).children(r).addClass(ii),f.element.attr("aria-activedescendant",e));f._focused=i},_keydown:function(n){var t=this,i=n.keyCode,u=t._current();n.target==n.currentTarget&&(i==o.DOWN||i==o.RIGHT?(t._current(t._nextItem(u)),n.preventDefault()):i==o.UP||i==o.LEFT?(t._current(t._prevItem(u)),n.preventDefault()):i==o.ENTER||i==o.SPACEBAR?(t._click(u.children(r)),n.preventDefault()):i==o.HOME?(t._current(t._first()),n.preventDefault()):i==o.END&&(t._current(t._last()),n.preventDefault()))},_nextItem:function(n){if(!n)return this._first();var i=n.children(b),t=n.nextAll(":visible").first();return i[0]&&(t=i.children("."+ct)),t[0]||(t=n.parent(b).parent(u).next()),t[0]||(t=this._first()),t.hasClass(e)&&(t=this._nextItem(t)),t},_prevItem:function(n){if(!n)return this._last();var t=n.prevAll(":visible").first(),i;if(t[0])for(i=t;i[0];)i=i.children(b).children("."+ht),i[0]&&(t=i);else t=n.parent(b).parent(u),t[0]||(t=this._last());return t.hasClass(e)&&(t=this._prevItem(t)),t},_insert:function(t,r,u){var o=this,e,c=n.isPlainObject(t),s=r&&r[0],h;return s||(u=o.element),h={firstLevel:u.hasClass("k-panelbar"),expanded:u.parent().hasClass(w),length:u.children().length},s&&!u.length&&(u=n(p.renderGroup({group:h})).appendTo(r)),t instanceof f.Observable&&(t=t.toJSON()),c||n.isArray(t)?(e=n.map(c?[t]:t,function(t,r){return typeof t=="string"?n(t):n(p.renderItem({group:h,item:i(t,{index:r})}))}),s&&r.attr(nt,!1)):(e=typeof t=="string"&&t.charAt(0)!="<"?o.element.find(t):n(t),o._updateItemsClasses(e)),{items:e,group:u}},_toggleHover:function(t){var i=n(t.currentTarget);i.parents("li."+e).length||i.toggleClass("k-state-hover",t.type==ni)},_updateClasses:function(){var i=this,r,t;r=i.element.find("li > ul").not(function(){return n(this).parentsUntil(".k-panelbar","div").length}).addClass("k-group k-panel").attr("role","group");r.parent().attr(nt,!1).not("."+w).children("ul").attr(yt,!0).hide();t=i.element.add(r).children();i._updateItemsClasses(t);wt(t);a(t)},_updateItemsClasses:function(n){for(var i=n.length,t=0;t<i;t++)this._updateItemClasses(n[t],t)},_updateItemClasses:function(t,i){var s=this._selected,e=this.options.contentUrls,h=e&&e[i],c=this.element[0],o,u;t=n(t).addClass("k-item").attr("role","menuitem");f.support.browser.msie&&t.css("list-style-position","inside").css("list-style-position","");t.children(bt).addClass(dt);u=t.children("a").addClass(it);u[0]&&(u.attr("href",h),u.children(bt).addClass(dt));t.filter(":not([disabled]):not([class*=k-state])").addClass("k-state-default");t.filter("li[disabled]").addClass("k-state-disabled").attr(vt,!0).removeAttr("disabled");t.children("div").addClass(rt).attr("role","region").attr(yt,!0).hide().parent().attr(nt,!1);u=t.children(ft);u[0]&&(s&&s.removeAttr(et).children(ft).removeClass(d),u.addClass(d),this._selected=t.attr(et,!0));t.children(r)[0]||(o="<span class='"+it+"'/>",e&&e[i]&&t[0].parentNode==c&&(o='<a class="k-link k-header" href="'+e[i]+'"/>'),t.contents().filter(function(){return!this.nodeName.match(oi)&&!(this.nodeType==3&&!n.trim(this.nodeValue))}).wrapAll(o));t.parent(".k-panelbar")[0]&&t.children(r).addClass("k-header")},_click:function(n){var t=this,a=t.element,i,o,s,l,h,f,c;if(!n.parents("li."+e).length)return n.closest(".k-widget")[0]!=a[0]?void 0:(h=n.closest(r),f=h.closest(u),t._updateSelected(h),o=f.find(v).add(f.find(k)),s=h.attr(st),l=s&&(s.charAt(s.length-1)=="#"||s.indexOf("#"+t.element[0].id+"-")!=-1),i=!!(l||o.length),o.data("animating"))?i:(t._triggerEvent(at,f)&&(i=!0),i===!1)?void 0:t.options.expandMode==fi&&t._collapseAllExpanded(f)?i:(o.length&&(c=o.is(y),t._triggerEvent(c?ut:lt,f)||(i=t._toggleItem(f,c))),i)},_toggleItem:function(n,i){var e=this,o=n.find(v),s=n.find(r),h=s.attr(st),f,u;return o.length?(this._toggleGroup(o,i),f=!0):(u=n.children("."+rt),u.length&&(f=!0,u.is(li)&&h!==t?e._ajaxRequest(n,u,i):e._toggleGroup(u,i))),f},_toggleGroup:function(n,t){var f=this,o=f.options.animation,r=o.expand,e=i({},o.collapse),s=e&&"effects"in e;if(n.is(y)!=t){f._animating=!1;return}n.parent().attr(nt,!t).attr(yt,t).toggleClass(w,!t).find("> .k-link > .k-icon").toggleClass("k-i-arrow-n",!t).toggleClass("k-panelbar-collapse",!t).toggleClass("k-i-arrow-s",t).toggleClass("k-panelbar-expand",t);t?(r=i(s?e:i({reverse:!0},r),{hide:!0}),r.complete=function(){f._animationCallback()}):r=i({complete:function(n){f._triggerEvent(gt,n.closest(u));f._animationCallback()}},r);n.kendoStop(!0,!0).kendoAnimate(r)},_animationCallback:function(){var n=this;n.trigger("complete");n._animating=!1},_collapseAllExpanded:function(t){var e=this,r,i=!1,f=t.find(v).add(t.find(k));return f.is(y)&&(i=!0),f.is(y)||f.length===0||(r=t.siblings(),r.find(v).add(r.find(k)).filter(function(){return n(this).is(y)}).each(function(t,r){r=n(r);i=e._triggerEvent(ut,r.closest(u));i||e._toggleGroup(r,!0)})),i},_ajaxRequest:function(t,i,u){var f=this,e=t.find(".k-panelbar-collapse, .k-panelbar-expand"),s=t.find(r),h=setTimeout(function(){e.addClass("k-loading")},100),o=s.attr(st);n.ajax({type:"GET",cache:!1,url:o,dataType:"html",data:{},error:function(n,t){e.removeClass("k-loading");f.trigger(kt,{xhr:n,status:t})&&this.complete()},complete:function(){clearTimeout(h);e.removeClass("k-loading")},success:function(n){function e(){return{elements:i.get()}}try{f.angular("cleanup",e);i.html(n);f.angular("compile",e)}catch(s){var r=window.console;r&&r.error&&r.error(s.name+": "+s.message+" in "+o);this.error(this.xhr,"error")}f._toggleGroup(i,u);f.trigger(ti,{item:t[0],contentElement:i[0]})}})},_triggerEvent:function(n,t){var i=this;return i.trigger(n,{item:t[0]})},_updateSelected:function(n){var t=this,i=t.element,r=n.parent(u),f=t._selected;f&&f.removeAttr(et);t._selected=r.attr(et,!0);i.find(ui).removeClass(d);i.find("> ."+c+", .k-panel > ."+c).removeClass(c);n.addClass(d);n.parentsUntil(i,u).filter(":has(.k-header)").addClass(c);t._current(r[0]?r:null)},_animations:function(n){n&&"animation"in n&&!n.animation&&(n.animation={expand:{effects:{}},collapse:{hide:!0,effects:{}}})}});i(p,{renderItem:function(n){n=i({panelBar:{},group:{}},n);var r=l.empty,t=n.item;return l.item(i(n,{image:t.imageUrl?l.image:r,sprite:t.spriteCssClass?l.sprite:r,itemWrapper:l.itemWrapper,renderContent:p.renderContent,arrow:t.items||t.content||t.contentUrl?l.arrow:r,subGroup:p.renderGroup},pt))},renderGroup:function(n){return l.group(i({renderItems:function(n){for(var u="",t=0,r=n.items,f=r?r.length:0,e=i({length:f},n.group);t<f;t++)u+=p.renderItem(i(n,{group:e,item:i({index:t},r[t])}));return u}},n,pt))},renderContent:function(n){return l.content(i(n,pt))}});f.ui.plugin(p)})(window.kendo.jQuery)}(),function(){(function(n){var r=n.proxy,t=".kendoResponsivePanel",f="open",e="close",i="click"+t+" touchstart"+t,u=kendo.ui.Widget,o=u.extend({init:function(f,e){u.fn.init.call(this,f,e);this._guid="_"+kendo.guid();this._toggleHandler=r(this._toggleButtonClick,this);this._closeHandler=r(this._close,this);n(document.documentElement).on(i,this.options.toggleButton,this._toggleHandler);this._registerBreakpoint();this.element.addClass("k-rpanel k-rpanel-"+this.options.orientation+" "+this._guid);this._resizeHandler=r(this.resize,this,!1);n(window).on("resize"+t,this._resizeHandler)},_mediaQuery:"@media (max-width: #= breakpoint-1 #px) {.#= guid #.k-rpanel-animate.k-rpanel-left,.#= guid #.k-rpanel-animate.k-rpanel-right {-webkit-transition: -webkit-transform .2s ease-out;-ms-transition: -ms-transform .2s ease-out;transition: transform .2s ease-out;} .#= guid #.k-rpanel-top {overflow: hidden;}.#= guid #.k-rpanel-animate.k-rpanel-top {-webkit-transition: max-height .2s linear;-ms-transition: max-height .2s linear;transition: max-height .2s linear;}} @media (min-width: #= breakpoint #px) {#= toggleButton # { display: none; } .#= guid #.k-rpanel-left { float: left; } .#= guid #.k-rpanel-right { float: right; } .#= guid #.k-rpanel-left, .#= guid #.k-rpanel-right {position: relative;-webkit-transform: translateX(0);-ms-transform: translateX(0);transform: translateX(0);-webkit-transform: translateX(0) translateZ(0);-ms-transform: translateX(0) translateZ(0);transform: translateX(0) translateZ(0);} .#= guid #.k-rpanel-top { max-height: none; }}",_registerBreakpoint:function(){var n=this.options;this._registerStyle(kendo.template(this._mediaQuery)({breakpoint:n.breakpoint,toggleButton:n.toggleButton,guid:this._guid}))},_registerStyle:function(t){var r=n("head,body")[0],i=document.createElement("style");r.appendChild(i);i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))},options:{name:"ResponsivePanel",orientation:"left",toggleButton:".k-rpanel-toggle",breakpoint:640,autoClose:!0},events:[f,e],_resize:function(){this.element.removeClass("k-rpanel-animate")},_toggleButtonClick:function(n){n.preventDefault();this.element.hasClass("k-rpanel-expanded")?this.close():this.open()},open:function(){if(!this.trigger(f)&&(this.element.addClass("k-rpanel-animate k-rpanel-expanded"),this.options.autoClose))n(document.documentElement).on(i,this._closeHandler)},close:function(){this.trigger(e)||(this.element.addClass("k-rpanel-animate").removeClass("k-rpanel-expanded"),n(document.documentElement).off(i,this._closeHandler))},_close:function(t){var i=t.isDefaultPrevented(),r=n(t.target).closest(this.options.toggleButton+",.k-rpanel");r.length||i||this.close()},destroy:function(){u.fn.destroy.call(this);n(window).off("resize"+t,this._resizeHandler);n(document.documentElement).off(i,this._closeHandler)}});kendo.ui.plugin(o)})(window.kendo.jQuery)}(),function(){(function(n,t){function wt(t){t.children(ut).addClass(ht);t.children("a").addClass(o).children(ut).addClass(ht);t.filter(":not([disabled]):not([class*=k-state-disabled])").addClass(c);t.filter("li[disabled]").addClass(v).removeAttr("disabled");t.filter(":not([class*=k-state])").children("a").filter(":focus").parent().addClass(r+" "+s);t.attr("role","tab");t.filter("."+r).attr("aria-selected",!0);t.each(function(){var t=n(this);t.children("."+o).length||t.contents().filter(function(){return!this.nodeName.match(dt)&&!(this.nodeType==3&&!rt(this.nodeValue))}).wrapAll("<span class='"+o+"'/>")})}function p(n){var t=n.children(".k-item");t.filter(".k-first:not(:first-child)").removeClass(ct);t.filter(".k-last:not(:last-child)").removeClass(ot);t.filter(":first-child").addClass(ct);t.filter(":last-child").addClass(ot)}function bt(n,t){return"<span class='k-button k-button-icon k-button-bare k-tabstrip-"+n+"' unselectable='on'><span class='k-icon "+t+"'><\/span><\/span>"}var i=window.kendo,kt=i.ui,e=i.keys,it=n.map,b=n.each,rt=n.trim,u=n.extend,h=i.template,y=kt.Widget,dt=/^(a|div)$/i,f=".kendoTabStrip",ut="img",ft="href",k="prev",et="show",o="k-link",ot="k-last",st="click",gt=":empty",ht="k-image",ct="k-first",d="select",lt="activate",g="k-content",a="contentUrl",at="mouseenter",ni="mouseleave",vt="contentLoad",v="k-state-disabled",c="k-state-default",r="k-state-active",yt="k-state-focused",nt="k-state-hover",s="k-tab-on-top",tt=".k-item:not(."+v+")",ti=".k-tabstrip-items > "+tt+":not(."+r+")",l={content:h("<div class='k-content'#= contentAttributes(data) # role='tabpanel'>#= content(item) #<\/div>"),itemWrapper:h("<#= tag(item) # class='k-link'#= contentUrl(item) ##= textAttributes(item) #>#= image(item) ##= sprite(item) ##= text(item) #<\/#= tag(item) #>"),item:h("<li class='#= wrapperCssClass(group, item) #' role='tab' #=item.active ? \"aria-selected='true'\" : ''#>#= itemWrapper(data) #<\/li>"),image:h("<img class='k-image' alt='' src='#= imageUrl #' />"),sprite:h("<span class='k-sprite #= spriteCssClass #'><\/span>"),empty:h("")},pt={wrapperCssClass:function(n,t){var i="k-item",r=t.index;return i+=t.enabled===!1?" k-state-disabled":" k-state-default",r===0&&(i+=" k-first"),r==n.length-1&&(i+=" k-last"),i},textAttributes:function(n){return n.url?" href='"+n.url+"'":""},text:function(n){return n.encoded===!1?n.text:i.htmlEncode(n.text)},tag:function(n){return n.url?"a":"span"},contentAttributes:function(n){return n.active!==!0?" style='display:none' aria-hidden='true' aria-expanded='false'":""},content:function(n){return n.content?n.content:n.contentUrl?"":"&nbsp;"},contentUrl:function(n){return n.contentUrl?i.attr("content-url")+'="'+n.contentUrl+'"':""}},w=y.extend({init:function(t,u){var e=this,c,s,h;y.fn.init.call(e,t,u);e._animations(e.options);u=e.options;e._wrapper();e._isRtl=i.support.isRtl(e.wrapper);e._tabindex();e._updateClasses();e._dataSource();u.dataSource&&e.dataSource.fetch();e._tabPosition();e._scrollable();e.options.contentUrls&&e.wrapper.find(".k-tabstrip-items > .k-item").each(function(t,i){n(i).find(">."+o).data(a,e.options.contentUrls[t])});e.wrapper.on(at+f+" "+ni+f,ti,e._toggleHover).on("focus"+f,n.proxy(e._active,e)).on("blur"+f,function(){e._current(null)});if(e._keyDownProxy=n.proxy(e._keydown,e),u.navigatable)e.wrapper.on("keydown"+f,e._keyDownProxy);e.options.value&&(c=e.options.value);e.wrapper.children(".k-tabstrip-items").on(st+f,".k-state-disabled .k-link",!1).on(st+f," > "+tt,function(t){var r=e.wrapper[0],u;if(r!==document.activeElement)if(u=i.support.browser.msie,u)try{r.setActive()}catch(f){r.focus()}else r.focus();e._click(n(t.currentTarget))&&t.preventDefault()});s=e.tabGroup.children("li."+r);h=e.contentHolder(s.index());s[0]&&h.length>0&&h[0].childNodes.length===0&&e.activateTab(s.eq(0));e.element.attr("role","tablist");e.element[0].id&&(e._ariaId=e.element[0].id+"_ts_active");e.value(c);i.notify(e)},_active:function(){var n=this.tabGroup.children().filter("."+r);n=n[0]?n:this._endItem("first");n[0]&&this._current(n)},_endItem:function(n){return this.tabGroup.children(tt)[n]()},_item:function(n,t){var i;return(i=t===k?"last":"first",!n)?this._endItem(i):(n=n[t](),n[0]||(n=this._endItem(i)),n.hasClass(v)&&(n=this._item(n,t)),n)},_current:function(n){var u=this,f=u._focused,i=u._ariaId;if(n===t)return f;f&&(f[0].id===i&&f.removeAttr("id"),f.removeClass(yt));n&&(n.hasClass(r)||n.addClass(yt),u.element.removeAttr("aria-activedescendant"),i=n[0].id||i,i&&(n.attr("id",i),u.element.attr("aria-activedescendant",i)));u._focused=n},_keydown:function(n){var t=this,i=n.keyCode,u=t._current(),f=t._isRtl,r;if(n.target==n.currentTarget){if(i==e.DOWN||i==e.RIGHT)r=f?k:"next";else if(i==e.UP||i==e.LEFT)r=f?"next":k;else if(i==e.ENTER||i==e.SPACEBAR)t._click(u),n.preventDefault();else{if(i==e.HOME){t._click(t._endItem("first"));n.preventDefault();return}if(i==e.END){t._click(t._endItem("last"));n.preventDefault();return}}r&&(t._click(t._item(u,r)),n.preventDefault())}},_dataSource:function(){var t=this;t.dataSource&&t._refreshHandler?t.dataSource.unbind("change",t._refreshHandler):t._refreshHandler=n.proxy(t.refresh,t);t.dataSource=i.data.DataSource.create(t.options.dataSource).bind("change",t._refreshHandler)},setDataSource:function(n){var t=this;t.options.dataSource=n;t._dataSource();t.dataSource.fetch()},_animations:function(n){n&&"animation"in n&&!n.animation&&(n.animation={open:{effects:{}},close:{effects:{}}})},refresh:function(n){var r=this,u=r.options,c=i.getter(u.dataTextField),l=i.getter(u.dataContentField),a=i.getter(u.dataContentUrlField),v=i.getter(u.dataImageUrlField),y=i.getter(u.dataUrlField),p=i.getter(u.dataSpriteCssClass),t,o=[],e,s,f=r.dataSource.view(),h;for(n=n||{},s=n.action,s&&(f=n.items),t=0,h=f.length;t<h;t++)e={text:c(f[t])},u.dataContentField&&(e.content=l(f[t])),u.dataContentUrlField&&(e.contentUrl=a(f[t])),u.dataUrlField&&(e.url=y(f[t])),u.dataImageUrlField&&(e.imageUrl=v(f[t])),u.dataSpriteCssClass&&(e.spriteCssClass=p(f[t])),o[t]=e;if(n.action=="add")n.index<r.tabGroup.children().length?r.insertBefore(o,r.tabGroup.children().eq(n.index)):r.append(o);else if(n.action=="remove")for(t=0;t<f.length;t++)r.remove(n.index);else n.action=="itemchange"?(t=r.dataSource.view().indexOf(f[0]),n.field===u.dataTextField&&r.tabGroup.children().eq(t).find(".k-link").text(f[0].get(n.field))):(r.trigger("dataBinding"),r.remove("li"),r.append(o),r.trigger("dataBound"))},value:function(i){var r=this;if(i!==t)i!=r.value()&&r.tabGroup.children().each(function(){n.trim(n(this).text())==i&&r.select(this)});else return r.select().text()},items:function(){return this.tabGroup[0].children},setOptions:function(n){var t=this,i=t.options.animation;if(t._animations(n),n.animation=u(!0,i,n.animation),n.navigatable)t.wrapper.on("keydown"+f,t._keyDownProxy);else t.wrapper.off("keydown"+f,t._keyDownProxy);y.fn.setOptions.call(t,n)},events:[d,lt,et,"error",vt,"change","dataBinding","dataBound"],options:{name:"TabStrip",dataTextField:"",dataContentField:"",dataImageUrlField:"",dataUrlField:"",dataSpriteCssClass:"",dataContentUrlField:"",tabPosition:"top",animation:{open:{effects:"expand:vertical fadeIn",duration:200},close:{duration:200}},collapsible:!1,navigatable:!0,contentUrls:!1,scrollable:{distance:200}},destroy:function(){var n=this;y.fn.destroy.call(n);n._refreshHandler&&n.dataSource.unbind("change",n._refreshHandler);n.wrapper.off(f);n.wrapper.children(".k-tabstrip-items").off(f);n._scrollableModeActive&&(n._scrollPrevButton.off().remove(),n._scrollNextButton.off().remove());n.scrollWrap.children(".k-tabstrip").unwrap();i.destroy(n.wrapper)},select:function(t){var i=this;return arguments.length===0?i.tabGroup.children("li."+r):(isNaN(t)||(t=i.tabGroup.children().get(t)),t=i.tabGroup.find(t),n(t).each(function(t,u){u=n(u);u.hasClass(r)||i.trigger(d,{item:u[0],contentElement:i.contentHolder(u.index())[0]})||i.activateTab(u)}),i)},enable:function(n,t){return this._toggleDisabled(n,t!==!1),this},disable:function(n){return this._toggleDisabled(n,!1),this},reload:function(t){t=this.tabGroup.find(t);var i=this;return t.each(function(){var t=n(this),r=t.find("."+o).data(a),u=i.contentHolder(t.index());r&&i.ajaxRequest(t,u,null,r)}),i},append:function(n){var t=this,i=t._create(n);return b(i.tabs,function(n){var r=i.contents[n];t.tabGroup.append(this);t.options.tabPosition=="bottom"?t.tabGroup.before(r):t._scrollableModeActive?t._scrollPrevButton.before(r):t.wrapper.append(r);t.angular("compile",function(){return{elements:[r]}})}),p(t.tabGroup),t._updateContentElements(),t.resize(!0),t},insertBefore:function(t,i){i=this.tabGroup.find(i);var r=this,u=r._create(t),f=n(r.contentElement(i.index()));return b(u.tabs,function(n){var t=u.contents[n];i.before(this);f.before(t);r.angular("compile",function(){return{elements:[t]}})}),p(r.tabGroup),r._updateContentElements(),r.resize(!0),r},insertAfter:function(t,i){i=this.tabGroup.find(i);var r=this,u=r._create(t),f=n(r.contentElement(i.index()));return b(u.tabs,function(n){var t=u.contents[n];i.after(this);f.after(t);r.angular("compile",function(){return{elements:[t]}})}),p(r.tabGroup),r._updateContentElements(),r.resize(!0),r},remove:function(t){var r=this,u=typeof t,f;return u==="string"?t=r.tabGroup.find(t):u==="number"&&(t=r.tabGroup.children().eq(t)),f=t.map(function(){var t=r.contentElement(n(this).index());return i.destroy(t),t}),t.remove(),f.remove(),r._updateContentElements(),r.resize(!0),r},_create:function(t){var o=n.isPlainObject(t),f=this,i,r,e;return o||n.isArray(t)?(t=n.isArray(t)?t:[t],i=it(t,function(t,i){return n(w.renderItem({group:f.tabGroup,item:u(t,{index:i})}))}),r=it(t,function(t,i){if(typeof t.content=="string"||t.contentUrl)return n(w.renderContent({item:u(t,{index:i})}))})):(i=typeof t=="string"&&t[0]!="<"?f.element.find(t):n(t),r=n(),i.each(function(){if(e=n("<div class='"+g+"'/>"),/k-tabstrip-items/.test(this.parentNode.className)){var t=parseInt(this.getAttribute("aria-controls").replace(/^.*-/,""),10)-1;e=n(f.contentElement(t))}r=r.add(e)}),wt(i)),{tabs:i,contents:r}},_toggleDisabled:function(t,i){t=this.tabGroup.find(t);t.each(function(){n(this).toggleClass(c,i).toggleClass(v,!i)})},_updateClasses:function(){var i=this,u,f,e;i.wrapper.addClass("k-widget k-header k-tabstrip");i.tabGroup=i.wrapper.children("ul").addClass("k-tabstrip-items k-reset");i.tabGroup[0]||(i.tabGroup=n("<ul class='k-tabstrip-items k-reset'/>").appendTo(i.wrapper));u=i.tabGroup.find("li").addClass("k-item");u.length&&(f=u.filter("."+r).index(),e=f>=0?f:t,i.tabGroup.contents().filter(function(){return this.nodeType==3&&!rt(this.nodeValue)}).remove());f>=0&&u.eq(f).addClass(s);i.contentElements=i.wrapper.children("div");i.contentElements.addClass(g).eq(e).addClass(r).css({display:"block"});u.length&&(wt(u),p(i.tabGroup),i._updateContentElements())},_updateContentElements:function(){var t=this,o=t.options.contentUrls||[],u=t.tabGroup.find(".k-item"),f=(t.element.attr("id")||i.guid())+"-",e=t.wrapper.children("div");e.length&&u.length>e.length?(e.each(function(n){var i=parseInt(this.id.replace(f,""),10),r=u.filter("[aria-controls="+f+i+"]"),t=f+(n+1);r.data("aria",t);this.setAttribute("id",t)}),u.each(function(){var t=n(this);this.setAttribute("aria-controls",t.data("aria"));t.removeData("aria")})):u.each(function(i){var u=e.eq(i),s=f+(i+1);this.setAttribute("aria-controls",s);!u.length&&o[i]?n("<div class='"+g+"'/>").appendTo(t.wrapper).attr("id",s):(u.attr("id",s),n(this).children(".k-loading")[0]||o[i]||n("<span class='k-loading k-complete'/>").prependTo(this));u.attr("role","tabpanel");u.filter(":not(."+r+")").attr("aria-hidden",!0).attr("aria-expanded",!1);u.filter("."+r).attr("aria-expanded",!0)});t.contentElements=t.contentAnimators=t.wrapper.children("div");t.tabsHeight=t.tabGroup.outerHeight()+parseInt(t.wrapper.css("border-top-width"),10)+parseInt(t.wrapper.css("border-bottom-width"),10);i.kineticScrollNeeded&&i.mobile.ui.Scroller&&(i.touchScroller(t.contentElements),t.contentElements=t.contentElements.children(".km-scroll-container"))},_wrapper:function(){var n=this;n.wrapper=n.element.is("ul")?n.element.wrapAll("<div />").parent():n.element;n.scrollWrap=n.wrapper.parent(".k-tabstrip-wrapper");n.scrollWrap[0]||(n.scrollWrap=n.wrapper.wrapAll("<div class='k-tabstrip-wrapper' />").parent())},_tabPosition:function(){var n=this,t=n.options.tabPosition;n.wrapper.addClass("k-floatwrap k-tabstrip-"+t);t=="bottom"&&n.tabGroup.appendTo(n.wrapper);n.resize(!0)},_setContentElementsDimensions:function(){var t=this,i=t.options.tabPosition;if(i=="left"||i=="right"){var r=t.wrapper.children(".k-content"),n=r.filter(":visible"),f="margin-"+i,u=t.tabGroup,e=u.outerWidth(),o=Math.ceil(u.height())-parseInt(n.css("padding-top"),10)-parseInt(n.css("padding-bottom"),10)-parseInt(n.css("border-top-width"),10)-parseInt(n.css("border-bottom-width"),10);setTimeout(function(){r.css(f,e).css("min-height",o)})}},_resize:function(){this._setContentElementsDimensions();this._scrollable()},_sizeScrollWrap:function(n){if(n.is(":visible")){var t=this.options.tabPosition,i=Math.floor(n.outerHeight(!0))+(t==="left"||t==="right"?2:this.tabsHeight);this.scrollWrap.css("height",i).css("height")}},_toggleHover:function(t){n(t.currentTarget).toggleClass(nt,t.type==at)},_click:function(n){var t=this,f=n.find("."+o),i=f.attr(ft),e=t.options.collapsible,h=t.contentHolder(n.index()),u,s;if(n.closest(".k-widget")[0]==t.wrapper[0])return n.is("."+v+(e?"":",."+r))?!0:(s=f.data(a)||i&&(i.charAt(i.length-1)=="#"||i.indexOf("#"+t.element[0].id+"-")!=-1),u=!i||s,t.tabGroup.children("[data-animating]").length)?u:t.trigger(d,{item:n[0],contentElement:h[0]})?!0:u===!1?void 0:e&&n.is("."+r)?(t.deactivateTab(n),!0):(t.activateTab(n)&&(u=!0),u)},_scrollable:function(){var n=this,o=n.options,u,e,t,r;if(n._scrollableAllowed())if(n.wrapper.addClass("k-tabstrip-scrollable"),u=n.wrapper[0].offsetWidth,e=n.tabGroup[0].scrollWidth,e>u&&!n._scrollableModeActive){n._nowScrollingTabs=!1;n._isRtl=i.support.isRtl(n.element);n.wrapper.append(bt("prev","k-i-arrow-w")+bt("next","k-i-arrow-e"));t=n._scrollPrevButton=n.wrapper.children(".k-tabstrip-prev");r=n._scrollNextButton=n.wrapper.children(".k-tabstrip-next");n.tabGroup.css({marginLeft:t.outerWidth()+9,marginRight:r.outerWidth()+12});t.on("mousedown"+f,function(){n._nowScrollingTabs=!0;n._scrollTabsByDelta(o.scrollable.distance*(n._isRtl?1:-1))});r.on("mousedown"+f,function(){n._nowScrollingTabs=!0;n._scrollTabsByDelta(o.scrollable.distance*(n._isRtl?-1:1))});t.add(r).on("mouseup"+f,function(){n._nowScrollingTabs=!1});n._scrollableModeActive=!0;n._toggleScrollButtons()}else n._scrollableModeActive&&e<=u?(n._scrollableModeActive=!1,n.wrapper.removeClass("k-tabstrip-scrollable"),n._scrollPrevButton.off().remove(),n._scrollNextButton.off().remove(),n.tabGroup.css({marginLeft:"",marginRight:""})):n._scrollableModeActive?n._toggleScrollButtons():n.wrapper.removeClass("k-tabstrip-scrollable")},_scrollableAllowed:function(){var n=this.options;return n.scrollable&&!isNaN(n.scrollable.distance)&&(n.tabPosition=="top"||n.tabPosition=="bottom")},_scrollTabsToItem:function(n){var f=this,i=f.tabGroup,r=i.scrollLeft(),e=n.outerWidth(),t=f._isRtl?n.position().left:n.position().left-i.children().first().position().left,o=i[0].offsetWidth,s=Math.ceil(parseFloat(i.css("padding-left"))),u;f._isRtl?t<0?u=r+t-(o-r)-s:t+e>o&&(u=r+t-e+s*2):r+o<t+e?u=t+e-o+s*2:r>t&&(u=t-s);i.finish().animate({scrollLeft:u},"fast","linear",function(){f._toggleScrollButtons()})},_scrollTabsByDelta:function(n){var t=this,i=t.tabGroup,r=i.scrollLeft();i.finish().animate({scrollLeft:r+n},"fast","linear",function(){t._nowScrollingTabs?t._scrollTabsByDelta(n):t._toggleScrollButtons()})},_toggleScrollButtons:function(){var n=this,t=n.tabGroup,i=t.scrollLeft();n._scrollPrevButton.toggle(n._isRtl?i<t[0].scrollWidth-t[0].offsetWidth-1:i!==0);n._scrollNextButton.toggle(n._isRtl?i!==0:i<t[0].scrollWidth-t[0].offsetWidth-1)},deactivateTab:function(n){var e=this,o=e.options.animation,f=o.open,t=u({},o.close),s=t&&"effects"in t;n=e.tabGroup.find(n);t=u(s?t:u({reverse:!0},f),{hide:!0});i.size(f.effects)?(n.kendoAddClass(c,{duration:f.duration}),n.kendoRemoveClass(r,{duration:f.duration})):(n.addClass(c),n.removeClass(r));n.removeAttr("aria-selected");e.contentAnimators.filter("."+r).kendoStop(!0,!0).kendoAnimate(t).removeClass(r).attr("aria-hidden",!0)},activateTab:function(n){var y;if(!this.tabGroup.children("[data-animating]").length){n=this.tabGroup.find(n);var t=this,p=t.options.animation,l=p.open,f=u({},p.close),g=f&&"effects"in f,w=n.parent().children(),v=w.filter("."+r),tt=w.index(n);if(f=u(g?f:u({reverse:!0},l),{hide:!0}),i.size(l.effects)?(v.kendoRemoveClass(r,{duration:f.duration}),n.kendoRemoveClass(nt,{duration:f.duration})):(v.removeClass(r),n.removeClass(nt)),y=t.contentAnimators,t.inRequest&&(t.xhr.abort(),t.inRequest=!1),y.length===0)return t.tabGroup.find("."+s).removeClass(s),n.addClass(s).css("z-index"),n.addClass(r),t._current(n),t.trigger("change"),t._scrollableModeActive&&t._scrollTabsToItem(n),!1;var h=y.filter("."+r),e=t.contentHolder(tt),b=e.closest(".k-content");if(t.tabsHeight=t.tabGroup.outerHeight()+parseInt(t.wrapper.css("border-top-width"),10)+parseInt(t.wrapper.css("border-bottom-width"),10),t._sizeScrollWrap(h),e.length===0)return h.removeClass(r).attr("aria-hidden",!0).kendoStop(!0,!0).kendoAnimate(f),!1;n.attr("data-animating",!0);var it=(n.children("."+o).data(a)||!1)&&e.is(gt),k=function(){t.tabGroup.find("."+s).removeClass(s);n.addClass(s).css("z-index");i.size(l.effects)?(v.kendoAddClass(c,{duration:l.duration}),n.kendoAddClass(r,{duration:l.duration})):(v.addClass(c),n.addClass(r));v.removeAttr("aria-selected");n.attr("aria-selected",!0);t._current(n);t._sizeScrollWrap(b);b.addClass(r).removeAttr("aria-hidden").kendoStop(!0,!0).attr("aria-expanded",!0).kendoAnimate(u({init:function(){t.trigger(et,{item:n[0],contentElement:e[0]});i.resize(e)}},l,{complete:function(){n.removeAttr("data-animating");t.trigger(lt,{item:n[0],contentElement:e[0]});i.resize(e);t.scrollWrap.css("height","").css("height")}}))},d=function(){it?(n.removeAttr("data-animating"),t.ajaxRequest(n,e,function(){n.attr("data-animating",!0);k();t.trigger("change")})):(k(),t.trigger("change"));t._scrollableModeActive&&t._scrollTabsToItem(n)};return h.removeClass(r),h.attr("aria-hidden",!0),h.attr("aria-expanded",!1),h.length?h.kendoStop(!0,!0).kendoAnimate(u({complete:d},f)):d(),!0}},contentElement:function(n){var r,f,u,e;if(isNaN(+n))return t;if(r=this.contentElements&&this.contentElements[0]&&!i.kineticScrollNeeded?this.contentElements:this.contentAnimators,n=r&&n<0?r.length+n:n,f=new RegExp("-"+(n+1)+"$"),r)for(u=0,e=r.length;u<e;u++)if(f.test(r.eq(u).closest(".k-content")[0].id))return r[u];return t},contentHolder:function(t){var r=n(this.contentElement(t)),u=r.children(".km-scroll-container");return i.support.touch&&u[0]?u:r},ajaxRequest:function(t,r,u,f){var y,h;t=this.tabGroup.find(t);var s=this,p=n.ajaxSettings.xhr,c=t.find("."+o),l=t.width()/2,v=!1,e=t.find(".k-loading").removeClass("k-complete");e[0]||(e=n("<span class='k-loading'/>").prependTo(t));y=l*2-e.width();h=function(){e.animate({marginLeft:(parseInt(e.css("marginLeft"),10)||0)<l?y:0},500,h)};i.support.browser.msie&&i.support.browser.version<10&&setTimeout(h,40);f=f||c.data(a)||c.attr(ft);s.inRequest=!0;s.xhr=n.ajax({type:"GET",cache:!1,url:f,dataType:"html",data:{},xhr:function(){var t=this,i=p(),r=t.progressUpload?"progressUpload":t.progress?"progress":!1;return i&&n.each([i,i.upload],function(){this.addEventListener&&this.addEventListener("progress",function(n){r&&t[r](n)},!1)}),t.noProgress=!(window.XMLHttpRequest&&"upload"in new XMLHttpRequest),i},progress:function(n){if(n.lengthComputable){var t=parseInt(n.loaded/n.total*100,10)+"%";e.stop(!0).addClass("k-progress").css({width:t,marginLeft:0})}},error:function(n,t){s.trigger("error",{xhr:n,status:t})&&this.complete()},stopProgress:function(){clearInterval(v);e.stop(!0).addClass("k-progress")[0].style.cssText=""},complete:function(n){s.inRequest=!1;this.noProgress?setTimeout(this.stopProgress,500):this.stopProgress();n.statusText=="abort"&&e.remove()},success:function(n){var c,o,h;e.addClass("k-complete");try{c=this;o=10;c.noProgress&&(e.width(o+"%"),v=setInterval(function(){c.progress({lengthComputable:!0,loaded:Math.min(o,100),total:100});o+=10},40));s.angular("cleanup",function(){return{elements:r.get()}});i.destroy(r);r.html(n)}catch(l){h=window.console;h&&h.error&&h.error(l.name+": "+l.message+" in "+f);this.error(this.xhr,"error")}u&&u.call(s,r);s.angular("compile",function(){return{elements:r.get()}});s.trigger(vt,{item:t[0],contentElement:r[0]})}})}});u(w,{renderItem:function(n){n=u({tabStrip:{},group:{}},n);var t=l.empty,i=n.item;return l.item(u(n,{image:i.imageUrl?l.image:t,sprite:i.spriteCssClass?l.sprite:t,itemWrapper:l.itemWrapper},pt))},renderContent:function(n){return l.content(u(n,pt))}});i.ui.plugin(w)})(window.kendo.jQuery)}(),function(){(function(n,t){function fi(n,t,i){var u=n.getTimezoneOffset(),r;n.setTime(n.getTime()+t);i||(r=n.getTimezoneOffset()-u,n.setTime(n.getTime()+r*c))}function ei(){var n=new u,t=new u(n.getFullYear(),n.getMonth(),n.getDate(),0,0,0),i=new u(n.getFullYear(),n.getMonth(),n.getDate(),12,0,0);return-1*(t.getTimezoneOffset()-i.getTimezoneOffset())}function f(n){return n.getHours()*60*c+n.getMinutes()*c+n.getSeconds()*1e3+n.getMilliseconds()}function dt(n,t,i){var u=f(t),e=f(i),r;return!n||u==e?!0:(r=f(n),u>r&&(r+=h),e<u&&(e+=h),r>=u&&r<=e)}function ni(n){var t=n.parseFormats;n.format=ri(n.format||r.getCulture(n.culture).calendars.standard.patterns.t);t=kt(t)?t:[t];t.splice(0,0,n.format);n.parseFormats=t}function ti(n){n.preventDefault()}var r=window.kendo,s=r.keys,e=r.parseDate,ii=r._activeElement,ri=r._extractFormat,v=r.support,rt=v.browser,k=r.ui,y=k.Widget,p="open",ut="close",d="change",i=".kendoTimePicker",ft="click"+i,g="k-state-default",et="disabled",ot="readonly",nt="li",st="<span/>",ht="k-state-focused",tt="k-state-hover",ui="mouseenter"+i+" mouseleave"+i,ct="mousedown"+i,c=6e4,h=864e5,lt="k-state-selected",it="k-state-disabled",at="aria-selected",vt="aria-expanded",yt="aria-hidden",pt="aria-disabled",wt="aria-readonly",bt="aria-activedescendant",w="id",kt=n.isArray,b=n.extend,l=n.proxy,u=Date,o=new u,a,gt;o=new u(o.getFullYear(),o.getMonth(),o.getDate(),0,0,0);a=function(t){var u=this,f=t.id;u.options=t;u._dates=[];u.ul=n('<ul tabindex="-1" role="listbox" aria-hidden="true" unselectable="on" class="k-list k-reset"/>').css({overflow:v.kineticScrollNeeded?"":"auto"}).on(ft,nt,l(u._click,u)).on("mouseenter"+i,nt,function(){n(this).addClass(tt)}).on("mouseleave"+i,nt,function(){n(this).removeClass(tt)});u.list=n("<div class='k-list-container'/>").append(u.ul).on(ct,ti);f&&(u._timeViewID=f+"_timeview",u._optionID=f+"_option_selected",u.ul.attr(w,u._timeViewID));u._popup();u._heightHandler=l(u._height,u);u.template=r.template('<li tabindex="-1" role="option" class="k-item" unselectable="on">#=data#<\/li>',{useWithBlock:!1})};a.prototype={current:function(i){var r=this,u=r.options.active;if(i!==t)r._current&&r._current.removeClass(lt).removeAttr(at).removeAttr(w),i&&(i=n(i).addClass(lt).attr(w,r._optionID).attr(at,!0),r.scroll(i[0])),r._current=i,u&&u(i);else return r._current},close:function(){this.popup.close()},destroy:function(){var n=this;n.ul.off(i);n.list.off(i);n._touchScroller&&n._touchScroller.destroy();n.popup.destroy()},open:function(){var n=this;n.ul[0].firstChild||n.bind();n.popup.open();n._current&&n.scroll(n._current[0])},dataBind:function(n){for(var i=this,t=i.options,o=t.format,s=r.toString,h=i.template,c=n.length,u=0,f,e="";u<c;u++)f=n[u],dt(f,t.min,t.max)&&(e+=h(s(f,o,t.culture)));i._html(e)},refresh:function(){var e=this,i=e.options,g=i.format,y=ei(),p=y<0,w=i.min,b=i.max,a=f(w),t=f(b),o=i.interval*c,nt=r.toString,tt=e.template,n=new u(+w),it=n.getDate(),v,k,s=0,l,d="";for(l=p?(h+y*c)/o:h/o,a!=t&&(a>t&&(t+=h),l=(t-a)/o+1),k=parseInt(l,10);s<l;s++)s&&fi(n,o,p),t&&k==s&&(v=f(n),it<n.getDate()&&(v+=h),v>t&&(n=new u(+b))),e._dates.push(f(n)),d+=tt(nt(n,g,i.culture));e._html(d)},bind:function(){var n=this,t=n.options.dates;t&&t[0]?n.dataBind(t):n.refresh()},_html:function(n){var t=this;t.ul[0].innerHTML=n;t.popup.unbind(p,t._heightHandler);t.popup.one(p,t._heightHandler);t.current(null);t.select(t._value)},scroll:function(n){if(n){var i=this.ul[0],t=n.offsetTop,f=n.offsetHeight,r=i.scrollTop,e=i.clientHeight,o=t+f,s=this._touchScroller,u;s?(u=this.list.height(),t>u&&(t=t-u+f),s.scrollTo(0,-t)):i.scrollTop=r>t?t:o>r+e?o-e:r}},select:function(t){var i=this,f=i.options,u=i._current,e;t instanceof Date&&(t=r.toString(t,f.format,f.culture));typeof t=="string"&&(u&&u.text()===t?t=u:(t=n.grep(i.ul[0].childNodes,function(n){return(n.textContent||n.innerText)==t}),t=t[0]?t:null));e=i._distinctSelection(t);i.current(e)},_distinctSelection:function(t){var i=this,r,u;return t&&t.length>1&&(r=f(i._value),u=n.inArray(r,i._dates),t=i.ul.children()[u]),t},setOptions:function(n){var t=this.options;n.min=e(n.min);n.max=e(n.max);this.options=b(t,n,{active:t.active,change:t.change,close:t.close,open:t.open});this.bind()},toggle:function(){var n=this;n.popup.visible()?n.close():n.open()},value:function(n){var t=this;t._value=n;t.ul[0].firstChild&&t.select(n)},_click:function(t){var i=this,r=n(t.currentTarget),f=r.text(),u=i.options.dates;u&&u.length>0&&(f=u[r.index()]);t.isDefaultPrevented()||(i.select(r),i.options.change(f,!0),i.close())},_height:function(){var n=this,t=n.list,r=t.parent(".k-animation-container"),i=n.options.height;n.ul[0].children.length&&t.add(r).show().height(n.ul[0].scrollHeight>i?i:"auto").hide()},_parse:function(n){var i=this,r=i.options,t=i._value||o;return n instanceof u?n:(n=e(n,r.parseFormats,r.culture),n&&(n=new u(t.getFullYear(),t.getMonth(),t.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())),n)},_adjustListWidth:function(){var t=this.list,i=t[0].style.width,r=this.options.anchor,n,u;(t.data("width")||!i)&&(n=window.getComputedStyle?window.getComputedStyle(r[0],null):0,u=n?parseFloat(n.width):r.outerWidth(),n&&(rt.mozilla||rt.msie)&&(u+=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight)+parseFloat(n.borderLeftWidth)+parseFloat(n.borderRightWidth)),i=u-(t.outerWidth()-t.width()),t.css({fontFamily:r.css("font-family"),width:i}).data("width",i))},_popup:function(){var t=this,i=t.list,n=t.options,u=n.anchor;t.popup=new k.Popup(i,b(n.popup,{anchor:u,open:n.open,close:n.close,animation:n.animation,isRtl:v.isRtl(n.anchor)}));t._touchScroller=r.touchScroller(t.popup.element)},move:function(n){var i=this,r=n.keyCode,f=i.ul[0],t=i._current,u=r===s.DOWN;if(r===s.UP||u){if(n.altKey){i.toggle(u);return}t=u?t?t[0].nextSibling:f.firstChild:t?t[0].previousSibling:f.lastChild;t&&i.select(t);i.options.change(i._current.text());n.preventDefault()}else(r===s.ENTER||r===s.TAB||r===s.ESC)&&(n.preventDefault(),t&&i.options.change(t.text(),!0),i.close())}};a.getMilliseconds=f;r.TimeView=a;gt=y.extend({init:function(t,i){var u=this,o,f,s;y.fn.init.call(u,t,i);t=u.element;i=u.options;i.min=e(t.attr("min"))||e(i.min);i.max=e(t.attr("max"))||e(i.max);ni(i);u._initialOptions=b({},i);u._wrapper();u.timeView=f=new a(b({},i,{id:t.attr(w),anchor:u.wrapper,format:i.format,change:function(n,i){i?u._change(n):t.val(n)},open:function(n){u.timeView._adjustListWidth();u.trigger(p)?n.preventDefault():(t.attr(vt,!0),o.attr(yt,!1))},close:function(n){u.trigger(ut)?n.preventDefault():(t.attr(vt,!1),o.attr(yt,!0))},active:function(n){t.removeAttr(bt);n&&t.attr(bt,f._optionID)}}));o=f.ul;u._icon();u._reset();try{t[0].setAttribute("type","text")}catch(h){t[0].type="text"}t.addClass("k-input").attr({role:"combobox","aria-expanded":!1,"aria-owns":f._timeViewID});s=t.is("[disabled]")||n(u.element).parents("fieldset").is(":disabled");s?u.enable(!1):u.readonly(t.is("[readonly]"));u._old=u._update(i.value||u.element.val());u._oldText=t.val();r.notify(u)},options:{name:"TimePicker",min:o,max:o,format:"",dates:[],parseFormats:[],value:null,interval:30,height:200,animation:{}},events:[p,ut,d],setOptions:function(n){var t=this,i=t._value;y.fn.setOptions.call(t,n);n=t.options;ni(n);t.timeView.setOptions(n);i&&t.element.val(r.toString(i,n.format,n.culture))},dataBind:function(n){kt(n)&&this.timeView.dataBind(n)},_editable:function(n){var t=this,r=n.disable,u=n.readonly,o=t._arrow.off(i),f=t.element.off(i),e=t._inputWrapper.off(i);if(u||r)e.addClass(r?it:g).removeClass(r?g:it),f.attr(et,r).attr(ot,u).attr(pt,r).attr(wt,u);else{e.addClass(g).removeClass(it).on(ui,t._toggleHover);f.removeAttr(et).removeAttr(ot).attr(pt,!1).attr(wt,!1).on("keydown"+i,l(t._keydown,t)).on("focusout"+i,l(t._blur,t)).on("focus"+i,function(){t._inputWrapper.addClass(ht)});o.on(ft,l(t._click,t)).on(ct,ti)}},readonly:function(n){this._editable({readonly:n===t?!0:n,disable:!1})},enable:function(n){this._editable({readonly:!1,disable:!(n=n===t?!0:n)})},destroy:function(){var n=this;y.fn.destroy.call(n);n.timeView.destroy();n.element.off(i);n._arrow.off(i);n._inputWrapper.off(i);n._form&&n._form.off("reset",n._resetHandler)},close:function(){this.timeView.close()},open:function(){this.timeView.open()},min:function(n){return this._option("min",n)},max:function(n){return this._option("max",n)},value:function(n){var i=this;if(n===t)return i._value;i._old=i._update(n);i._old===null&&i.element.val("");i._oldText=i.element.val()},_blur:function(){var n=this,t=n.element.val();n.close();t!==n._oldText&&n._change(t);n._inputWrapper.removeClass(ht)},_click:function(){var n=this,t=n.element;n.timeView.toggle();v.touch||t[0]===ii()||t.focus()},_change:function(n){var t=this;n=t._update(n);+t._old!=+n&&(t._old=n,t._oldText=t.element.val(),t._typing||t.element.trigger(d),t.trigger(d));t._typing=!1},_icon:function(){var i=this,r=i.element,t;t=r.next("span.k-select");t[0]||(t=n('<span unselectable="on" class="k-select"><span unselectable="on" class="k-icon k-i-clock">select<\/span><\/span>').insertAfter(r));i._arrow=t.attr({role:"button","aria-controls":i.timeView._timeViewID})},_keydown:function(n){var t=this,u=n.keyCode,i=t.timeView,r=t.element.val();i.popup.visible()||n.altKey?i.move(n):u===s.ENTER&&r!==t._oldText?t._change(r):t._typing=!0},_option:function(n,i){var r=this,f=r.options;if(i===t)return f[n];(i=r.timeView._parse(i),i)&&(i=new u(+i),f[n]=i,r.timeView.options[n]=i,r.timeView.bind())},_toggleHover:function(t){n(t.currentTarget).toggleClass(tt,t.type==="mouseenter")},_update:function(n){var i=this,u=i.options,f=i.timeView,t=f._parse(n);return dt(t,u.min,u.max)||(t=null),i._value=t,i.element.val(t?r.toString(t,u.format,u.culture):n),f.value(t),t},_wrapper:function(){var r=this,i=r.element,t;t=i.parents(".k-timepicker");t[0]||(t=i.wrap(st).parent().addClass("k-picker-wrap k-state-default"),t=t.wrap(st).parent());t[0].style.cssText=i[0].style.cssText;r.wrapper=t.addClass("k-widget k-timepicker k-header").addClass(i[0].className);i.css({width:"100%",height:i[0].style.height});r._inputWrapper=n(t[0].firstChild)},_reset:function(){var t=this,i=t.element,r=i.attr("form"),u=r?n("#"+r):i.closest("form");u[0]&&(t._resetHandler=function(){t.value(i[0].defaultValue);t.max(t._initialOptions.max);t.min(t._initialOptions.min)},t._form=u.on("reset",t._resetHandler))}});k.plugin(gt)})(window.kendo.jQuery)}(),function(){(function(n,t){function tr(){var n=this.options.anchor,t=n.outerWidth(),r;i.wrap(this.element).addClass("k-split-wrapper");r=this.element.css("box-sizing")!=="border-box"?t-(this.element.outerWidth()-this.element.width()):t;this.element.css({fontFamily:n.css("font-family"),"min-width":r})}function oi(n){n.target.is(".k-toggle-button")||n.target.toggleClass(a,n.type=="press")}function si(t){return t=n(t),t.hasClass("km-actionsheet")?t.closest(".km-popup-wrapper"):t.addClass("km-widget km-actionsheet").wrap('<div class="km-actionsheet-wrapper km-actionsheet-tablet km-widget km-popup"><\/div>').parent().wrap('<div class="km-popup-wrapper k-popup"><\/div>').parent()}function lt(n){n.preventDefault()}function k(t,i){var u=i==="next"?n.fn.next:n.fn.prev,f=i==="next"?n.fn.first:n.fn.last,r=u.call(t);return r.is(":kendoFocusable")||!r.length?r:r.find(":kendoFocusable").length?f.call(r.find(":kendoFocusable")):k(r,i)}var i=window.kendo,li=i.Class,it=i.ui.Widget,rt=n.proxy,c=i.isFunction,r=i.keys,ai="k-toolbar",f="k-button",g="k-overflow-button",at="k-toggle-button",l="k-button-group",o="k-split-button",vt="k-separator",vi="k-popup",yi="k-toolbar-resizable",a="k-state-active",yt="k-state-disabled",v="k-state-hidden",pi="k-group-start",wi="k-group-end",bi="k-primary",nt="k-icon",pt="k-i-",ki="k-button-icon",di="k-button-icontext",gi="k-list-container k-split-container",wt="k-split-button-arrow",y="k-overflow-anchor",nr="k-overflow-container",bt="k-toolbar-first-visible",kt="k-toolbar-last-visible",s="click",dt="toggle",gt="open",ni="close",ti="overflowOpen",ii="overflowClose",ri="never",ut="auto",ui="always",h="k-overflow-hidden",e=i.attr("uid"),d,u,p,w,b,tt,ft,et,ot,st,fi,ei,ht,ct,hi,ci;i.toolbar={};d={overflowAnchor:'<div tabindex="0" class="k-overflow-anchor"><\/div>',overflowContainer:'<ul class="k-overflow-container k-list-container"><\/ul>'};i.toolbar.registerComponent=function(n,t,i){d[n]={toolbar:t,overflow:i}};u=i.Class.extend({addOverflowAttr:function(){this.element.attr(i.attr("overflow"),this.options.overflow||ut)},addUidAttr:function(){this.element.attr(e,this.options.uid)},addIdAttr:function(){this.options.id&&this.element.attr("id",this.options.id)},addOverflowIdAttr:function(){this.options.id&&this.element.attr("id",this.options.id+"_overflow")},attributes:function(){this.options.attributes&&this.element.attr(this.options.attributes)},show:function(){this.element.removeClass(v).show();this.options.hidden=!1},hide:function(){this.element.addClass(v).hide();this.options.hidden=!0},remove:function(){this.element.remove()},enable:function(n){n===t&&(n=!0);this.element.toggleClass(yt,!n);this.options.enable=n},twin:function(){var n=this.element.attr(e);return this.overflow?this.toolbar.element.find("["+e+"='"+n+"']").data(this.options.type):this.toolbar.options.resizable?this.toolbar.popup.element.find("["+e+"='"+n+"']").data(this.options.type):void 0}});i.toolbar.Item=u;p=u.extend({init:function(r,u){var f=r.useButtonTag?n('<button tabindex="0"><\/button>'):n('<a href tabindex="0"><\/a>');this.element=f;this.options=r;this.toolbar=u;this.attributes();r.primary&&f.addClass(bi);r.togglable&&(f.addClass(at),this.toggle(r.selected));r.url===t||r.useButtonTag||(f.attr("href",r.url),r.mobile&&f.attr(i.attr("role"),"button"));r.group&&(f.attr(i.attr("group"),r.group),(this.overflow&&this.options.overflow===ui||!this.overflow)&&(this.group=this.toolbar.addToGroup(this,r.group)));!r.togglable&&r.click&&c(r.click)&&(this.clickHandler=r.click);r.togglable&&r.toggle&&c(r.toggle)&&(this.toggleHandler=r.toggle)},toggle:function(n,t){n=!!n;this.group&&n?this.group.select(this):this.group||this.select(n);t&&this.twin()&&this.twin().toggle(n)},getParentGroup:function(){if(this.options.isChild)return this.element.closest("."+l).data("buttonGroup")},_addGraphics:function(){var t=this.element,u=this.options.icon,f=this.options.spriteCssClass,e=this.options.imageUrl,o,i,r;(f||e||u)&&(o=!0,t.contents().not("span.k-sprite,span."+nt+",img.k-image").each(function(t,i){(i.nodeType==1||i.nodeType==3&&n.trim(i.nodeValue).length>0)&&(o=!1)}),o?t.addClass(ki):t.addClass(di));u?(i=t.children("span."+nt).first(),i[0]||(i=n('<span class="'+nt+'"><\/span>').prependTo(t)),i.addClass(pt+u)):f?(i=t.children("span.k-sprite").first(),i[0]||(i=n('<span class="k-sprite"><\/span>').prependTo(t)),i.addClass(f)):e&&(r=t.children("img.k-image").first(),r[0]||(r=n('<img alt="icon" class="k-image" />').prependTo(t)),r.attr("src",e))}});i.toolbar.Button=p;w=p.extend({init:function(n,t){p.fn.init.call(this,n,t);var i=this.element;i.addClass(f);this.addIdAttr();n.align&&i.addClass("k-align-"+n.align);n.showText!="overflow"&&n.text&&(n.mobile?i.html('<span class="km-text">'+n.text+"<\/span>"):i.html(n.text));n.hasIcon=n.showIcon!="overflow"&&(n.icon||n.spriteCssClass||n.imageUrl);n.hasIcon&&this._addGraphics();this.addUidAttr();this.addOverflowAttr();this.enable(n.enable);n.hidden&&this.hide();this.element.data({type:"button",button:this})},select:function(n){n===t&&(n=!1);this.element.toggleClass(a,n);this.options.selected=n}});i.toolbar.ToolBarButton=w;b=p.extend({init:function(n,t){this.overflow=!0;p.fn.init.call(this,n,t);var i=this.element;n.showText!="toolbar"&&n.text&&(n.mobile?i.html('<span class="km-text">'+n.text+"<\/span>"):i.html('<span class="k-text">'+n.text+"<\/span>"));n.hasIcon=n.showIcon!="toolbar"&&(n.icon||n.spriteCssClass||n.imageUrl);n.hasIcon&&this._addGraphics();n.isChild||this._wrap();this.addOverflowIdAttr();this.attributes();this.addUidAttr();this.addOverflowAttr();this.enable(n.enable);i.addClass(g+" "+f);n.hidden&&this.hide();this.element.data({type:"button",button:this})},_wrap:function(){this.element=this.element.wrap("<li><\/li>").parent()},overflowHidden:function(){this.element.addClass(h)},select:function(n){n===t&&(n=!1);this.options.isChild?this.element.toggleClass(a,n):this.element.find(".k-button").toggleClass(a,n);this.options.selected=n}});i.toolbar.OverflowButton=b;i.toolbar.registerComponent("button",w,b);tt=u.extend({createButtons:function(t){for(var f=this.options,u=f.buttons||[],e,r=0;r<u.length;r++)u[r].uid||(u[r].uid=i.guid()),e=new t(n.extend({mobile:f.mobile,isChild:!0,type:"button"},u[r]),this.toolbar),e.element.appendTo(this.element)},refresh:function(){this.element.children().filter(":not('."+v+"'):first").addClass(pi);this.element.children().filter(":not('."+v+"'):last").addClass(wi)}});i.toolbar.ButtonGroup=tt;ft=tt.extend({init:function(t,i){var r=this.element=n("<div><\/div>");this.options=t;this.toolbar=i;this.addIdAttr();t.align&&r.addClass("k-align-"+t.align);this.createButtons(w);this.attributes();this.addUidAttr();this.addOverflowAttr();this.refresh();r.addClass(l);this.element.data({type:"buttonGroup",buttonGroup:this})}});i.toolbar.ToolBarButtonGroup=ft;et=tt.extend({init:function(t,i){var r=this.element=n("<li><\/li>");this.options=t;this.toolbar=i;this.overflow=!0;this.addOverflowIdAttr();this.createButtons(b);this.attributes();this.addUidAttr();this.addOverflowAttr();this.refresh();r.addClass((t.mobile?"":l)+" k-overflow-group");this.element.data({type:"buttonGroup",buttonGroup:this})},overflowHidden:function(){this.element.addClass(h)}});i.toolbar.OverflowButtonGroup=et;i.toolbar.registerComponent("buttonGroup",ft,et);ot=u.extend({init:function(t,i){var r=this.element=n('<div class="'+o+'" tabindex="0"><\/div>');this.options=t;this.toolbar=i;this.mainButton=new w(t,i);this.arrowButton=n('<a class="'+f+" "+wt+'"><span class="'+(t.mobile?"km-icon km-arrowdown":"k-icon k-i-arrow-s")+'"><\/span><\/a>');this.popupElement=n('<ul class="'+gi+'"><\/ul>');this.mainButton.element.removeAttr("href tabindex").appendTo(r);this.arrowButton.appendTo(r);this.popupElement.appendTo(r);t.align&&r.addClass("k-align-"+t.align);t.id||(t.id=t.uid);r.attr("id",t.id+"_wrapper");this.addOverflowAttr();this.addUidAttr();this.createMenuButtons();this.createPopup();this._navigatable();this.mainButton.main=!0;r.data({type:"splitButton",splitButton:this,kendoPopup:this.popup})},_navigatable:function(){var t=this;t.popupElement.on("keydown","."+f,function(i){var u=n(i.target).parent();i.preventDefault();i.keyCode===r.ESC||i.keyCode===r.TAB||i.altKey&&i.keyCode===r.UP?(t.toggle(),t.focus()):i.keyCode===r.DOWN?k(u,"next").focus():i.keyCode===r.UP?k(u,"prev").focus():(i.keyCode===r.SPACEBAR||i.keyCode===r.ENTER)&&t.toolbar.userEvents.trigger("tap",{target:n(i.target)})})},createMenuButtons:function(){for(var t=this.options,r=t.menuButtons,u,i=0;i<r.length;i++)u=new w(n.extend({mobile:t.mobile,type:"button",click:t.click},r[i]),this.toolbar),u.element.wrap("<li><\/li>").parent().appendTo(this.popupElement)},createPopup:function(){var t=this.options,i=this.element;this.popupElement.attr("id",t.id+"_optionlist").attr(e,t.rootUid);t.mobile&&(this.popupElement=si(this.popupElement));this.popup=this.popupElement.kendoPopup({appendTo:t.mobile?n(t.mobile).children(".km-pane"):null,anchor:i,isRtl:this.toolbar._isRtl,copyAnchorStyles:!1,animation:t.animation,open:tr,activate:function(){this.element.find(":kendoFocusable").first().focus()},close:function(){i.focus()}}).data("kendoPopup");this.popup.element.on(s,"a.k-button",lt)},remove:function(){this.popup.element.off(s,"a.k-button");this.popup.destroy();this.element.remove()},toggle:function(){this.popup.toggle()},enable:function(n){n===t&&(n=!0);this.mainButton.enable(n);this.options.enable=n},focus:function(){this.element.focus()}});i.toolbar.ToolBarSplitButton=ot;st=u.extend({init:function(t,i){var u=this.element=n('<li class="'+o+'"><\/li>'),f=t.menuButtons,e,r;for(this.options=t,this.toolbar=i,this.overflow=!0,this.mainButton=new b(n.extend({isChild:!0},t)),this.mainButton.element.appendTo(u),r=0;r<f.length;r++)e=new b(n.extend({mobile:t.mobile,isChild:!0},f[r]),this.toolbar),e.element.appendTo(u);this.addUidAttr();this.addOverflowAttr();this.mainButton.main=!0;u.data({type:"splitButton",splitButton:this})},overflowHidden:function(){this.element.addClass(h)}});i.toolbar.OverflowSplitButton=st;i.toolbar.registerComponent("splitButton",ot,st);fi=u.extend({init:function(t,i){var r=this.element=n("<div>&nbsp;<\/div>");this.element=r;this.options=t;this.toolbar=i;this.attributes();this.addIdAttr();this.addUidAttr();this.addOverflowAttr();r.addClass(vt);r.data({type:"separator",separator:this})}});ei=u.extend({init:function(t,i){var r=this.element=n("<li>&nbsp;<\/li>");this.element=r;this.options=t;this.toolbar=i;this.overflow=!0;this.attributes();this.addUidAttr();this.addOverflowIdAttr();r.addClass(vt);r.data({type:"separator",separator:this})},overflowHidden:function(){this.element.addClass(h)}});i.toolbar.registerComponent("separator",fi,ei);ht=u.extend({init:function(t,i,r){var u=c(t)?t(i):t;u=u instanceof jQuery?u.wrap("<div><\/div>").parent():n("<div><\/div>").html(u);this.element=u;this.options=i;this.options.type="template";this.toolbar=r;this.attributes();this.addUidAttr();this.addIdAttr();this.addOverflowAttr();u.data({type:"template",template:this})}});i.toolbar.TemplateItem=ht;ct=u.extend({init:function(t,i,r){var u=c(t)?n(t(i)):n(t);u=u instanceof jQuery?u.wrap("<li><\/li>").parent():n("<li><\/li>").html(u);this.element=u;this.options=i;this.options.type="template";this.toolbar=r;this.overflow=!0;this.attributes();this.addUidAttr();this.addOverflowIdAttr();this.addOverflowAttr();u.data({type:"template",template:this})},overflowHidden:function(){this.element.addClass(h)}});i.toolbar.OverflowTemplateItem=ct;hi=li.extend({init:function(n){this.name=n;this.buttons=[]},add:function(n){this.buttons[this.buttons.length]=n},remove:function(t){var i=n.inArray(t,this.buttons);this.buttons.splice(i,1)},select:function(n){for(var t,i=0;i<this.buttons.length;i++)t=this.buttons[i],t.select(!1),t.twin()&&t.twin().select(!1);n.select(!0)}});ci=it.extend({init:function(t,r){var u=this,o;if(it.fn.init.call(u,t,r),r=u.options,t=u.wrapper=u.element,t.addClass(ai+" k-widget"),this.uid=i.guid(),this._isRtl=i.support.isRtl(t),this._groups={},t.attr(e,this.uid),u.isMobile=typeof r.mobile=="boolean"?r.mobile:u.element.closest(".km-root")[0],u.animation=u.isMobile?{open:{effects:"fade"}}:{},u.isMobile&&(t.addClass("km-widget"),nt="km-icon",pt="km-",f="km-button",l="km-buttongroup km-widget",a="km-state-active",yt="km-state-disabled"),r.resizable?(u._renderOverflow(),t.addClass(yi),u.overflowUserEvents=new i.UserEvents(u.element,{threshold:5,allowSelection:!0,filter:"."+y,tap:rt(u._toggleOverflow,u)}),u._resizeHandler=i.onResize(function(){u.resize()})):u.popup={element:n([])},r.items&&r.items.length)for(o=0;o<r.items.length;o++)u.add(r.items[o]);u.userEvents=new i.UserEvents(document,{threshold:5,allowSelection:!0,filter:"["+e+"="+this.uid+"] ."+f+", ["+e+"="+this.uid+"] ."+g,tap:rt(u._buttonClick,u),press:oi,release:oi});u.element.on(s,"a.k-button",lt);if(u._navigatable(),r.resizable)u.popup.element.on(s,+ "a.k-button",lt);r.resizable&&this._toggleOverflowAnchor();i.notify(u)},events:[s,dt,gt,ni,ti,ii],options:{name:"ToolBar",items:[],resizable:!0,mobile:null},addToGroup:function(n,t){var i;return i=this._groups[t]?this._groups[t]:this._groups[t]=new hi,i.add(n),i},destroy:function(){var t=this;t.element.find("."+o).each(function(t,i){n(i).data("kendoPopup").destroy()});t.element.off(s,"a.k-button");t.userEvents.destroy();t.options.resizable&&(i.unbindResize(t._resizeHandler),t.overflowUserEvents.destroy(),t.popup.element.off(s,"a.k-button"),t.popup.destroy());it.fn.destroy.call(t)},add:function(t){var e=d[t.type],o=t.template,u,r=this,h=r.isMobile?"":"k-item k-state-default",s=t.overflowTemplate,f;n.extend(t,{uid:i.guid(),animation:r.animation,mobile:r.isMobile,rootUid:r.uid});o&&!s?t.overflow=ri:t.overflow||(t.overflow=ut);t.overflow!==ri&&r.options.resizable&&(s?f=new ct(s,t,r):e&&(f=new e.overflow(t,r),f.element.addClass(h)),f&&(t.overflow===ut&&f.overflowHidden(),f.element.appendTo(r.popup.container),r.angular("compile",function(){return{elements:f.element.get()}})));t.overflow!==ui&&(o?u=new ht(o,t,r):e&&(u=new e.toolbar(t,r)),u&&(r.options.resizable?(u.element.appendTo(r.element).css("visibility","hidden"),r._shrink(r.element.innerWidth()),u.element.css("visibility","visible")):u.element.appendTo(r.element),r.angular("compile",function(){return{elements:u.element.get()}})))},_getItem:function(n){var t,r,u,f=this.options.resizable,i;return t=this.element.find(n),i=t.length?t.data("type"):"",r=t.data(i),r&&r.main&&(t=t.parent("."+o),i="splitButton",r=t.data(i)),!t.length&&f&&(t=this.popup.element.find(n),i=t.data("type"),u=t.data(i)),u&&u.main&&(t=t.parent("."+o),i="splitButton",u=t.data(i)),r&&f&&(u=r.twin()),{type:i,toolbar:r,overflow:u}},remove:function(n){var t=this._getItem(n);t.toolbar&&t.toolbar.remove();t.overflow&&t.overflow.remove();this.resize(!0)},hide:function(n){var t=this._getItem(n);t.toolbar&&(t.toolbar.hide(),t.toolbar.options.type==="button"&&t.toolbar.options.isChild&&t.toolbar.getParentGroup().refresh());t.overflow&&(t.overflow.hide(),t.overflow.options.type==="button"&&t.overflow.options.isChild&&t.overflow.getParentGroup().refresh());this.resize(!0)},show:function(n){var t=this._getItem(n);t.toolbar&&(t.toolbar.show(),t.toolbar.options.type==="button"&&t.toolbar.options.isChild&&t.toolbar.getParentGroup().refresh());t.overflow&&(t.overflow.show(),t.overflow.options.type==="button"&&t.overflow.options.isChild&&t.overflow.getParentGroup().refresh());this.resize(!0)},enable:function(n,t){var i=this._getItem(n);typeof t=="undefined"&&(t=!0);i.toolbar&&i.toolbar.enable(t);i.overflow&&i.overflow.enable(t)},getSelectedFromGroup:function(n){return this.element.find("."+at+"[data-group='"+n+"']").filter("."+a)},toggle:function(i,r){var f=n(i),u=f.data("button");u.options.togglable&&(r===t&&(r=!0),u.toggle(r,!0))},_renderOverflow:function(){var t=this,u=d.overflowContainer,s=t._isRtl,h=s?"left":"right";t.overflowAnchor=n(d.overflowAnchor).addClass(f);t.element.append(t.overflowAnchor);t.isMobile?(t.overflowAnchor.append('<span class="km-icon km-more"><\/span>'),u=si(u)):t.overflowAnchor.append('<span class="k-icon k-i-arrow-s"><\/span>');t.popup=new i.ui.Popup(u,{origin:"bottom "+h,position:"top "+h,anchor:t.overflowAnchor,isRtl:s,animation:t.animation,appendTo:t.isMobile?n(t.isMobile).children(".km-pane"):null,copyAnchorStyles:!1,open:function(r){var u=i.wrap(t.popup.element).addClass("k-overflow-wrapper");t.isMobile?t.popup.container.css("max-height",parseFloat(n(".km-content:visible").innerHeight())-15+"px"):u.css("margin-left",(s?-1:1)*((u.outerWidth()-u.width())/2+1));t.trigger(ti)&&r.preventDefault()},activate:function(){this.element.find(":kendoFocusable").first().focus()},close:function(n){t.trigger(ii)&&n.preventDefault();this.element.focus()}});t.popup.element.on("keydown","."+f,function(i){var u=n(i.target),f=u.parent(),e=f.is("."+l)||f.is("."+o),s;i.preventDefault();i.keyCode===r.ESC||i.keyCode===r.TAB||i.altKey&&i.keyCode===r.UP?(t._toggleOverflow(),t.overflowAnchor.focus()):i.keyCode===r.DOWN?(s=!e||e&&u.is(":last-child")?f:u,k(s,"next").focus()):i.keyCode===r.UP?(s=!e||e&&u.is(":first-child")?f:u,k(s,"prev").focus()):(i.keyCode===r.SPACEBAR||i.keyCode===r.ENTER)&&t.userEvents.trigger("tap",{target:n(i.target)})});t.popup.container=t.isMobile?t.popup.element.find("."+nr):t.popup.element;t.popup.container.attr(e,this.uid)},_toggleOverflowAnchor:function(){this.popup.element.children(":not(."+h+", ."+vi+")").length>0?this.overflowAnchor.css({visibility:"visible",width:""}):this.overflowAnchor.css({visibility:"hidden",width:"1px"})},_buttonClick:function(t){var r=this,l,u,i,h,a=t.target.closest("."+wt).length,e,o;if(t.preventDefault(),a){r._toggle(t);return}(u=n(t.target).closest("."+f,r.element),u.hasClass(y))||(i=u.data("button"),!i&&r.popup&&(u=n(t.target).closest("."+g,r.popup.container),i=u.parent("li").data("button")),i&&i.options.enable)&&(i.options.togglable?(e=c(i.toggleHandler)?i.toggleHandler:null,i.toggle(!i.options.selected,!0),o={target:u,group:i.options.group,checked:i.options.selected,id:i.options.id},e&&e.call(r,o),r.trigger(dt,o)):(e=c(i.clickHandler)?i.clickHandler:null,o={sender:r,target:u,id:i.options.id},e&&e.call(r,o),r.trigger(s,o)),i.options.url&&(window.location.href=i.options.url),u.hasClass(g)&&r.popup.close(),h=u.closest(".k-split-container"),h[0]&&(l=h.data("kendoPopup"),(l?l:h.parents(".km-popup-wrapper").data("kendoPopup")).close()))},_navigatable:function(){var t=this;t.element.attr("tabindex",0).focus(function(){var t=n(this).find(":kendoFocusable:first");t.is("."+y)&&(t=k(t,"next"));t[0].focus()}).on("keydown",rt(t._keydown,t))},_keydown:function(t){var i=n(t.target),e=t.keyCode,f=this.element.children(":not(.k-separator):visible"),u,s,h,c;if(e===r.TAB&&(u=i.parentsUntil(this.element).last(),s=!1,u.length||(u=i),u.is("."+y)&&(t.shiftKey&&t.preventDefault(),f.last().is(":kendoFocusable")?f.last().focus():f.last().find(":kendoFocusable").last().focus()),t.shiftKey||f.index(u)!==f.length-1||(s=u.is("."+l)?i.is(":last-child"):!0),s&&(t.preventDefault(),this.overflowAnchor.focus())),t.altKey&&e===r.DOWN){h=n(document.activeElement).data("splitButton");c=n(document.activeElement).is("."+y);h?h.toggle():c&&this._toggleOverflow();return}if(e===r.SPACEBAR||e===r.ENTER){t.preventDefault();i.is("."+o)&&(i=i.children().first());this.userEvents.trigger("tap",{target:i});return}},_toggle:function(t){var i=n(t.target).closest("."+o).data("splitButton"),r;(t.preventDefault(),i.options.enable)&&(r=i.popup.element.is(":visible")?this.trigger(ni,{target:i.element}):this.trigger(gt,{target:i.element}),r||i.toggle())},_toggleOverflow:function(){this.popup.toggle()},_resize:function(n){var t=n.width;this.options.resizable&&(this.popup.close(),this._shrink(t),this._stretch(t),this._markVisibles(),this._toggleOverflowAnchor())},_childrenWidth:function(){var t=0;return this.element.children(":visible:not('."+v+"')").each(function(){t+=n(this).outerWidth(!0)}),Math.ceil(t)},_shrink:function(n){var r,i,t;if(n<this._childrenWidth())for(i=this.element.children(":visible:not([data-overflow='never'], ."+y+")"),t=i.length-1;t>=0;t--)if(r=i.eq(t),n>this._childrenWidth())break;else this._hideItem(r)},_stretch:function(n){var r,i,t;if(n>this._childrenWidth())for(i=this.element.children(":hidden:not('."+v+"')"),t=0;t<i.length;t++)if(r=i.eq(t),n<this._childrenWidth()||!this._showItem(r,n))break},_hideItem:function(n){n.hide();this.popup&&this.popup.container.find(">li[data-uid='"+n.data("uid")+"']").removeClass(h)},_showItem:function(n,t){return n.length&&t>this._childrenWidth()+n.outerWidth(!0)?(n.show(),this.popup&&this.popup.container.find(">li[data-uid='"+n.data("uid")+"']").addClass(h),!0):!1},_markVisibles:function(){var n=this.popup.container.children(),t=this.element.children(":not(.k-overflow-anchor)"),i=n.filter(":not(.k-overflow-hidden)"),r=t.filter(":visible");n.add(t).removeClass(bt+" "+kt);i.first().add(r.first()).addClass(bt);i.last().add(r.last()).addClass(kt)}});i.ui.plugin(ci)})(window.kendo.jQuery)}(),function(){(function(n,t){function bt(n){var t=new Date(2100,0,1);return t.setMinutes(-n),t}function kt(n){n.preventDefault()}function dt(t){var u=i.getCulture(t.culture).calendars.standard.patterns,f=!t.parseFormats.length,r;t.format=it(t.format||u.g);t.timeFormat=r=it(t.timeFormat||u.t);i.DateView.normalize(t);f&&t.parseFormats.unshift("yyyy-MM-ddTHH:mm:ss");n.inArray(r,t.parseFormats)===-1&&t.parseFormats.splice(1,0,r)}var i=window.kendo,nt=i.TimeView,f=i.parseDate,tt=i._activeElement,it=i._extractFormat,p=i.calendar,rt=p.isInRange,gt=p.restrictValue,e=p.isEqualDatePart,ut=nt.getMilliseconds,ft=i.ui,h=ft.Widget,w="open",b="close",c="change",r=".kendoDateTimePicker",et="click"+r,ot="disabled",st="readonly",k="k-state-default",ht="k-state-focused",ni="k-state-hover",d="k-state-disabled",ti="mouseenter"+r+" mouseleave"+r,ct="mousedown"+r,lt="month",at="<span/>",l="aria-activedescendant",a="aria-expanded",v="aria-hidden",y="aria-owns",vt="aria-disabled",yt="aria-readonly",u=Date,o=new u(1800,0,1),s=new u(2099,11,31),pt={view:"date"},wt={view:"time"},g=n.extend,ii=h.extend({init:function(t,r){var u=this,e;h.fn.init.call(u,t,r);t=u.element;r=u.options;r.min=f(t.attr("min"))||f(r.min);r.max=f(t.attr("max"))||f(r.max);dt(r);u._initialOptions=g({},r);u._wrapper();u._views();u._icons();u._reset();u._template();try{t[0].setAttribute("type","text")}catch(o){t[0].type="text"}t.addClass("k-input").attr({role:"combobox","aria-expanded":!1});u._midnight=u._calculateMidnight(r.min,r.max);e=t.is("[disabled]")||n(u.element).parents("fieldset").is(":disabled");e?u.enable(!1):u.readonly(t.is("[readonly]"));u._old=u._update(r.value||u.element.val());u._oldText=t.val();i.notify(u)},options:{name:"DateTimePicker",value:null,format:"",timeFormat:"",culture:"",parseFormats:[],dates:[],min:new u(o),max:new u(s),interval:30,height:200,footer:"",start:lt,depth:lt,animation:{},month:{},ARIATemplate:'Current focused date is #=kendo.toString(data.current, "d")#'},events:[w,b,c],setOptions:function(n){var t=this,l=t._value,r,c,a;h.fn.setOptions.call(t,n);n=t.options;n.min=r=f(n.min);n.max=c=f(n.max);dt(n);t._midnight=t._calculateMidnight(n.min,n.max);a=n.value||t._value||t.dateView._current;r&&!e(r,a)&&(r=new u(o));c&&!e(c,a)&&(c=new u(s));t.dateView.setOptions(n);t.timeView.setOptions(g({},n,{format:n.timeFormat,min:r,max:c}));l&&(t.element.val(i.toString(l,n.format,n.culture)),t._updateARIA(l))},_editable:function(t){var u=this,f=u.element.off(r),h=u._dateIcon.off(r),c=u._timeIcon.off(r),s=u._inputWrapper.off(r),o=t.readonly,e=t.disable;if(o||e)s.addClass(e?d:k).removeClass(e?k:d),f.attr(ot,e).attr(st,o).attr(vt,e).attr(yt,o);else{s.addClass(k).removeClass(d).on(ti,u._toggleHover);f.removeAttr(ot).removeAttr(st).attr(vt,!1).attr(yt,!1).on("keydown"+r,n.proxy(u._keydown,u)).on("focus"+r,function(){u._inputWrapper.addClass(ht)}).on("focusout"+r,function(){u._inputWrapper.removeClass(ht);f.val()!==u._oldText&&u._change(f.val());u.close("date");u.close("time")});h.on(ct,kt).on(et,function(){u.toggle("date");i.support.touch||f[0]===tt()||f.focus()});c.on(ct,kt).on(et,function(){u.toggle("time");i.support.touch||f[0]===tt()||f.focus()})}},readonly:function(n){this._editable({readonly:n===t?!0:n,disable:!1})},enable:function(n){this._editable({readonly:!1,disable:!(n=n===t?!0:n)})},destroy:function(){var n=this;h.fn.destroy.call(n);n.dateView.destroy();n.timeView.destroy();n.element.off(r);n._dateIcon.off(r);n._timeIcon.off(r);n._inputWrapper.off(r);n._form&&n._form.off("reset",n._resetHandler)},close:function(n){n!=="time"&&(n="date");this[n+"View"].close()},open:function(n){n!=="time"&&(n="date");this[n+"View"].open()},min:function(n){return this._option("min",n)},max:function(n){return this._option("max",n)},toggle:function(n){var t="timeView";n!=="time"?n="date":t="dateView";this[n+"View"].toggle();this[t].close()},value:function(n){var i=this;if(n===t)return i._value;i._old=i._update(n);i._old===null&&i.element.val("");i._oldText=i.element.val()},_change:function(n){var t=this;n=t._update(n);+t._old!=+n&&(t._old=n,t._oldText=t.element.val(),t.trigger(c),t._typing||t.element.trigger(c))},_option:function(n,i){var h=this,r=h.options,v=h.timeView,c=v.options,y=h._value||h._old,l,a;if(i===t)return r[n];if(i=f(i,r.parseFormats,r.culture),i){if(r.min.getTime()===r.max.getTime()&&(c.dates=[]),r[n]=new u(i.getTime()),h.dateView[n](i),h._midnight=h._calculateMidnight(r.min,r.max),y&&(l=e(r.min,y),a=e(r.max,y)),l||a){if(c[n]=i,l&&!a&&(c.max=bt(r.interval)),a){if(h._midnight){v.dataBind([s]);return}l||(c.min=o)}}else c.max=s,c.min=o;v.bind()}},_toggleHover:function(t){n(t.currentTarget).toggleClass(ni,t.type==="mouseenter")},_update:function(t){var u=this,h=u.options,a=h.min,w=h.max,v=h.dates,y=u.timeView,d=u._value,r=f(t,h.parseFormats,h.culture),nt=r===null&&d===null||r instanceof Date&&d instanceof Date,p,l,b,k,g;return+r==+d&&nt?(g=i.toString(r,h.format,h.culture),g!==t&&(u.element.val(r===null?t:g),u.element.trigger(c)),r):(r!==null&&e(r,a)?r=gt(r,a,w):rt(r,a,w)||(r=null),u._value=r,y.value(r),u.dateView.value(r),r&&(b=u._old,l=y.options,v[0]&&(v=n.grep(v,function(n){return e(r,n)}),v[0]&&(y.dataBind(v),k=!0)),k||(e(r,a)&&(l.min=a,l.max=bt(h.interval),p=!0),e(r,w)&&(u._midnight?(y.dataBind([s]),k=!0):(l.max=w,p||(l.min=o),p=!0))),k||(b||!p)&&(!b||e(b,r))||(p||(l.max=s,l.min=o),y.bind())),u.element.val(r?i.toString(r,h.format,h.culture):t),u._updateARIA(r),r)},_keydown:function(n){var t=this,r=t.dateView,u=t.timeView,f=t.element.val(),e=r.popup.visible();n.altKey&&n.keyCode===i.keys.DOWN?t.toggle(e?"time":"date"):e?(r.move(n),t._updateARIA(r._current)):u.popup.visible()?u.move(n):n.keyCode===i.keys.ENTER&&f!==t._oldText?t._change(f):t._typing=!0},_views:function(){var t=this,r=t.element,n=t.options,tt=r.attr("id"),h,e,p,k,d,c;t.dateView=h=new i.DateView(g({},n,{id:tt,anchor:t.wrapper,change:function(){var i=h.calendar.value(),f=+i,e=+n.min,o=+n.max,r;(f===e||f===o)&&(r=new u(+t._value),r.setFullYear(i.getFullYear(),i.getMonth(),i.getDate()),rt(r,e,o)&&(i=r));t._change(i);t.close("date")},close:function(n){t.trigger(b,pt)?n.preventDefault():(r.attr(a,!1),p.attr(v,!0),e.popup.visible()||r.removeAttr(y))},open:function(i){t.trigger(w,pt)?i.preventDefault():(r.val()!==t._oldText&&(c=f(r.val(),n.parseFormats,n.culture),t.dateView[c?"current":"value"](c)),p.attr(v,!1),r.attr(a,!0).attr(y,h._dateViewID),t._updateARIA(c))}}));p=h.div;d=n.min.getTime();t.timeView=e=new nt({id:tt,value:n.value,anchor:t.wrapper,animation:n.animation,format:n.timeFormat,culture:n.culture,height:n.height,interval:n.interval,min:new u(o),max:new u(s),dates:d===n.max.getTime()?[new Date(d)]:[],parseFormats:n.parseFormats,change:function(f,o){f=e._parse(f);f<n.min?(f=new u(+n.min),e.options.min=f):f>n.max&&(f=new u(+n.max),e.options.max=f);o?(t._timeSelected=!0,t._change(f)):(r.val(i.toString(f,n.format,n.culture)),h.value(f),t._updateARIA(f))},close:function(n){t.trigger(b,wt)?n.preventDefault():(k.attr(v,!0),r.attr(a,!1),h.popup.visible()||r.removeAttr(y))},open:function(i){e._adjustListWidth();t.trigger(w,wt)?i.preventDefault():(r.val()!==t._oldText&&(c=f(r.val(),n.parseFormats,n.culture),t.timeView.value(c)),k.attr(v,!1),r.attr(a,!0).attr(y,e._timeViewID),e.options.active(e.current()))},active:function(n){r.removeAttr(l);n&&r.attr(l,e._optionID)}});k=e.ul},_icons:function(){var i=this,r=i.element,t;t=r.next("span.k-select");t[0]||(t=n('<span unselectable="on" class="k-select"><span unselectable="on" class="k-icon k-i-calendar">select<\/span><span unselectable="on" class="k-icon k-i-clock">select<\/span><\/span>').insertAfter(r));t=t.children();i._dateIcon=t.eq(0).attr({role:"button","aria-controls":i.dateView._dateViewID});i._timeIcon=t.eq(1).attr({role:"button","aria-controls":i.timeView._timeViewID})},_wrapper:function(){var r=this,i=r.element,t;t=i.parents(".k-datetimepicker");t[0]||(t=i.wrap(at).parent().addClass("k-picker-wrap k-state-default"),t=t.wrap(at).parent());t[0].style.cssText=i[0].style.cssText;i.css({width:"100%",height:i[0].style.height});r.wrapper=t.addClass("k-widget k-datetimepicker k-header").addClass(i[0].className);r._inputWrapper=n(t[0].firstChild)},_reset:function(){var t=this,i=t.element,r=i.attr("form"),u=r?n("#"+r):i.closest("form");u[0]&&(t._resetHandler=function(){t.value(i[0].defaultValue);t.max(t._initialOptions.max);t.min(t._initialOptions.min)},t._form=u.on("reset",t._resetHandler))},_template:function(){this._ariaTemplate=i.template(this.options.ARIATemplate)},_calculateMidnight:function(n,t){return ut(n)+ut(t)===0},_updateARIA:function(n){var i,t=this,r=t.dateView.calendar;t.element.removeAttr(l);r&&(i=r._cell,i.attr("aria-label",t._ariaTemplate({current:n||r.current()})),t.element.attr(l,i.attr("id")))}});ft.plugin(ii)})(window.kendo.jQuery)}(),function(){(function(n,t){function tt(n){return ht.test(n)}function it(n){return st.test(n)||/^\d+$/.test(n)}function c(n){return!tt(n)&&!it(n)}function rt(n,t){var i=parseInt(n,10);return tt(n)&&(i=Math.floor(i*t/100)),i}function v(n,t){return function(i,u){var f=this.element.find(i).data(r),e;if(arguments.length==1)return f[n];f[n]=u;t&&(e=this.element.data("kendo"+this.options.name),e.resize(!0))}}function et(n){var t=this,i=n.orientation;t.owner=n;t._element=n.element;t.orientation=i;ot(t,i===l?ft:ut);t._resizable=new f.ui.Resizable(n.element,{orientation:i,handle:".k-splitbar-draggable-"+i+"[data-marker="+n._marker+"]",hint:u(t._createHint,t),start:u(t._start,t),max:u(t._max,t),min:u(t._min,t),invalidClass:"k-restricted-size-"+i,resizeend:u(t._stop,t)})}var f=window.kendo,y=f.ui,e=f.keys,ot=n.extend,u=n.proxy,a=y.Widget,st=/^\d+(\.\d+)?px$/i,ht=/^\d+(\.\d+)?%$/i,i=".kendoSplitter",o="expand",s="collapse",p="contentLoad",w="error",b="layoutChange",l="horizontal",k="vertical",ct="mouseenter",d="click",r="pane",lt="mouseleave",g="k-state-focused",nt="k-"+r,h="."+nt,at=a.extend({init:function(n,t){var r=this,u;a.fn.init.call(r,n,t);r.wrapper=r.element;u=r.options.orientation.toLowerCase()!=k;r.orientation=u?l:k;r._dimension=u?"width":"height";r._keys={decrease:u?e.LEFT:e.UP,increase:u?e.RIGHT:e.DOWN};r._resizeStep=10;r._marker=f.guid().substring(0,8);r._initPanes();r.resizing=new et(r);r.element.triggerHandler("init"+i)},events:[o,s,p,w,"resize",b],_addOverlays:function(){this._panes().append("<div class='k-splitter-overlay k-overlay' />")},_removeOverlays:function(){this._panes().children(".k-splitter-overlay").remove()},_attachEvents:function(){var t=this,r=t.options.orientation;t.element.children(".k-splitbar-draggable-"+r).on("keydown"+i,u(t._keydown,t)).on("mousedown"+i,function(n){n.currentTarget.focus()}).on("focus"+i,function(t){n(t.currentTarget).addClass(g)}).on("blur"+i,function(i){n(i.currentTarget).removeClass(g);t.resizing&&t.resizing.end()}).on(ct+i,function(){n(this).addClass("k-splitbar-"+t.orientation+"-hover")}).on(lt+i,function(){n(this).removeClass("k-splitbar-"+t.orientation+"-hover")}).on("mousedown"+i,u(t._addOverlays,t)).end().children(".k-splitbar").on("dblclick"+i,u(t._togglePane,t)).children(".k-collapse-next, .k-collapse-prev").on(d+i,t._arrowClick(s)).end().children(".k-expand-next, .k-expand-prev").on(d+i,t._arrowClick(o)).end().end();n(window).on("resize"+i+t._marker,u(t.resize,t,!1));n(document).on("mouseup"+i+t._marker,u(t._removeOverlays,t))},_detachEvents:function(){var t=this;t.element.children(".k-splitbar-draggable-"+t.orientation).off(i).end().children(".k-splitbar").off("dblclick"+i).children(".k-collapse-next, .k-collapse-prev, .k-expand-next, .k-expand-prev").off(i);n(window).off(i+t._marker);n(document).off(i+t._marker)},options:{name:"Splitter",orientation:l,panes:[]},destroy:function(){a.fn.destroy.call(this);this._detachEvents();this.resizing&&this.resizing.destroy();f.destroy(this.element);this.wrapper=this.element=null},_keydown:function(t){var r=this,f=t.keyCode,i=r.resizing,h=n(t.currentTarget),l=r._keys,a=f===l.increase,u=f===l.decrease,c;a||u?(t.ctrlKey?(c=h[u?"next":"prev"](),i&&i.isResizing()&&i.end(),c[r._dimension]()?r._triggerAction(s,h[u?"prev":"next"]()):r._triggerAction(o,c)):i&&i.move((u?-1:1)*r._resizeStep,h),t.preventDefault()):f===e.ENTER&&i&&(i.end(),t.preventDefault())},_initPanes:function(){var n=this.options.panes||[],t=this;this.element.addClass("k-widget").addClass("k-splitter").children().each(function(i,r){r.nodeName.toLowerCase()!="script"&&t._initPane(r,n[i])});this.resize()},_initPane:function(t,i){t=n(t).attr("role","group").addClass(nt);t.data(r,i?i:{}).toggleClass("k-scrollable",i?i.scrollable!==!1:!0);this.ajaxRequest(t)},ajaxRequest:function(n,t,i){var u=this,e;n=u.element.find(n);e=n.data(r);t=t||e.contentUrl;t&&(n.append("<span class='k-icon k-loading k-pane-loading' />"),f.isLocalUrl(t)?jQuery.ajax({url:t,data:i||{},type:"GET",dataType:"html",success:function(t){u.angular("cleanup",function(){return{elements:n.get()}});n.html(t);u.angular("compile",function(){return{elements:n.get()}});u.trigger(p,{pane:n[0]})},error:function(t,i){u.trigger(w,{pane:n[0],status:i,xhr:t})}}):n.removeClass("k-scrollable").html("<iframe src='"+t+"' frameborder='0' class='k-content-frame'>This page requires frames in order to show content<\/iframe>"))},_triggerAction:function(n,t){this.trigger(n,{pane:t[0]})||this[n](t[0])},_togglePane:function(t){var u=this,i=n(t.target),r;i.closest(".k-splitter")[0]==u.element[0]&&(r=i.children(".k-icon:not(.k-resize-handle)"),r.length===1)&&(r.is(".k-collapse-prev")?u._triggerAction(s,i.prev()):r.is(".k-collapse-next")?u._triggerAction(s,i.next()):r.is(".k-expand-prev")?u._triggerAction(o,i.prev()):r.is(".k-expand-next")&&u._triggerAction(o,i.next()))},_arrowClick:function(t){var i=this;return function(r){var u=n(r.target),f;u.closest(".k-splitter")[0]==i.element[0]&&(f=u.is(".k-"+t+"-prev")?u.parent().prev():u.parent().next(),i._triggerAction(t,f))}},_updateSplitBar:function(n,t,i){var f=function(n,t){return t?"<div class='k-icon "+n+"' />":""},e=this.orientation,o=t.resizable!==!1&&i.resizable!==!1,s=t.collapsible,r=t.collapsed,h=i.collapsible,u=i.collapsed;n.addClass("k-splitbar k-state-default k-splitbar-"+e).attr("role","separator").attr("aria-expanded",!(r||u)).removeClass("k-splitbar-"+e+"-hover").toggleClass("k-splitbar-draggable-"+e,o&&!r&&!u).toggleClass("k-splitbar-static-"+e,!o&&!s&&!h).html(f("k-collapse-prev",s&&!r&&!u)+f("k-expand-prev",s&&r&&!u)+f("k-resize-handle",o)+f("k-collapse-next",h&&!u&&!r)+f("k-expand-next",h&&u&&!r));o||s||h||n.removeAttr("tabindex")},_updateSplitBars:function(){var t=this;this.element.children(".k-splitbar").each(function(){var i=n(this),f=i.prevAll(h).first().data(r),u=i.nextAll(h).first().data(r);u&&t._updateSplitBar(i,f,u)})},_removeSplitBars:function(){this.element.children(".k-splitbar").remove()},_panes:function(){return this.element?this.element.children(h):n()},_resize:function(){var t=this,u=t.element,o=u.children(h),s=t.orientation==l,y=u.children(".k-splitbar"),p=y.length,a=s?"width":"height",i=u[a](),e,w,k;t.wrapper.addClass("k-splitter-resizing");p===0?(p=o.length-1,o.slice(0,p).after("<div tabindex='0' class='k-splitbar' data-marker='"+t._marker+"' />"),t._updateSplitBars(),y=u.children(".k-splitbar")):t._updateSplitBars();y.each(function(){i-=this[s?"offsetWidth":"offsetHeight"]});var d=0,it=0,v=n();o.css({position:"absolute",top:0})[a](function(){var f=n(this),t=f.data(r)||{},u;if(f.removeClass("k-state-collapsed"),t.collapsed)u=t.collapsedSize?rt(t.collapsedSize,i):0,f.css("overflow","hidden").addClass("k-state-collapsed");else{if(c(t.size)){v=v.add(this);return}u=rt(t.size,i)}return it++,d+=u,u});i-=d;e=v.length;w=Math.floor(i/e);v.slice(0,e-1).css(a,w).end().eq(e-1).css(a,i-(e-1)*w);var g=0,nt=s?"height":"width",ut=s?"left":"top",tt=s?"offsetWidth":"offsetHeight";e===0&&(k=o.filter(function(){return!(n(this).data(r)||{}).collapsed}).last(),k[a](i+k[0][tt]));u.children().css(nt,u[nt]()).each(function(n,t){t.tagName.toLowerCase()!="script"&&(t.style[ut]=Math.floor(g)+"px",g+=t[tt])});t._detachEvents();t._attachEvents();t.wrapper.removeClass("k-splitter-resizing");f.resize(o);t.trigger(b)},toggle:function(n,i){var f=this,u;(n=f.element.find(n),u=n.data(r),i||u.collapsible)&&(arguments.length==1&&(i=u.collapsed===t?!1:u.collapsed),u.collapsed=!i,u.collapsed?n.css("overflow","hidden"):n.css("overflow",""),f.resize(!0))},collapse:function(n){this.toggle(n,!1)},expand:function(n){this.toggle(n,!0)},_addPane:function(n,t,i){var r=this;return i.length&&(r.options.panes.splice(t,0,n),r._initPane(i,n),r._removeSplitBars(),r.resize(!0)),i},append:function(t){t=t||{};var i=this,r=n("<div />").appendTo(i.element);return i._addPane(t,i.options.panes.length,r)},insertBefore:function(t,i){i=n(i);t=t||{};var r=this,u=r.wrapper.children(".k-pane").index(i),f=n("<div />").insertBefore(n(i));return r._addPane(t,u,f)},insertAfter:function(t,i){i=n(i);t=t||{};var r=this,u=r.wrapper.children(".k-pane").index(i),f=n("<div />").insertAfter(n(i));return r._addPane(t,u+1,f)},remove:function(t){t=n(t);var i=this;return t.length&&(f.destroy(t),t.each(function(t,r){i.options.panes.splice(i.wrapper.children(".k-pane").index(r),1);n(r).remove()}),i._removeSplitBars(),i.options.panes.length&&i.resize(!0)),i},size:v("size",!0),min:v("min"),max:v("max")}),ut,ft;y.plugin(at);ut={sizingProperty:"height",sizingDomProperty:"offsetHeight",alternateSizingProperty:"width",positioningProperty:"top",mousePositioningProperty:"pageY"};ft={sizingProperty:"width",sizingDomProperty:"offsetWidth",alternateSizingProperty:"height",positioningProperty:"left",mousePositioningProperty:"pageX"};et.prototype={press:function(n){this._resizable.press(n)},move:function(n,t){this.pressed||(this.press(t),this.pressed=!0);this._resizable.target||this._resizable.press(t);this._resizable.move(n)},end:function(){this._resizable.end();this.pressed=!1},destroy:function(){this._resizable.destroy();this._resizable=this._element=this.owner=null},isResizing:function(){return this._resizable.resizing},_createHint:function(t){var i=this;return n("<div class='k-ghost-splitbar k-ghost-splitbar-"+i.orientation+" k-state-default' />").css(i.alternateSizingProperty,t[i.alternateSizingProperty]())},_start:function(t){var i=this,s=n(t.currentTarget),h=s.prev(),u=s.next(),c=h.data(r),l=u.data(r),f=parseInt(h[0].style[i.positioningProperty],10),e=parseInt(u[0].style[i.positioningProperty],10)+u[0][i.sizingDomProperty]-s[0][i.sizingDomProperty],a=parseInt(i._element.css(i.sizingProperty),10),o=function(n){var t=parseInt(n,10);return(it(n)?t:a*t/100)||0},v=o(c.min),y=o(c.max)||e-f,p=o(l.min),w=o(l.max)||e-f;i.previousPane=h;i.nextPane=u;i._maxPosition=Math.min(e-p,f+y);i._minPosition=Math.max(f+v,e-w)},_max:function(){return this._maxPosition},_min:function(){return this._minPosition},_stop:function(t){var i=this,u=n(t.currentTarget),l=i.owner;if(l._panes().children(".k-splitter-overlay").remove(),t.keyCode!==f.keys.ESC){var a=t.position,v=u.prev(),e=u.next(),o=v.data(r),y=e.data(r),p=a-parseInt(v[0].style[i.positioningProperty],10),w=parseInt(e[0].style[i.positioningProperty],10)+e[0][i.sizingDomProperty]-a-u[0][i.sizingDomProperty],s=i._element.children(h).filter(function(){return c(n(this).data(r).size)}).length;(!c(o.size)||s>1)&&(c(o.size)&&s--,o.size=p+"px");(!c(y.size)||s>1)&&(y.size=w+"px");l.resize(!0)}return!1}}})(window.kendo.jQuery)}(),function(){(function(n,t){function h(n){return n[n.length-1]}function c(n){return n instanceof Array?n:[n]}function v(n){return typeof n=="string"||typeof n=="number"||typeof n=="boolean"}function ct(n,t,i){return Math.ceil(n*t/i)}function d(n,t,i){var r=document.createElement(i||"div");return t&&(r.className=t),n.appendChild(r),r}function lt(){var t=n('<div class="k-popup"><ul class="k-list"><li class="k-item"><li><\/ul><\/div>'),r;return t.css({position:"absolute",left:"-200000px",visibility:"hidden"}),t.appendTo(document.body),r=parseFloat(i.getComputedStyles(t.find(".k-item")[0],["line-height"])["line-height"]),t.remove(),r}function at(n,t,i){return{down:n*i,up:n*(t-1-i)}}function vt(n,t){var i=(n.listScreens-1-n.threshold)*t,r=n.threshold*t;return function(n,t,u){return t>u?t-n.top<i:n.top===0||t-n.top>r}}function yt(n,t){return function(i){return t(n.scrollTop,i)}}function pt(n){return function(t,i){return n(t.items,t.index,i),t}}function wt(n,t){i.support.browser.msie&&i.support.browser.version<10?n.style.top=t+"px":(n.style.webkitTransform="translateY("+t+"px)",n.style.transform="translateY("+t+"px)")}function bt(t,r){return function(u,f){for(var e=0,o=u.length;e<o;e++)t(u[e],f[e],r),f[e].item&&(this.trigger(w,{item:n(u[e]),data:f[e].item,ns:i.ui}),f[e].index===this._selectedIndex&&this.select(this._selectedIndex))}}function kt(n,t){var i;return t>0?(i=n.splice(0,t),n.push.apply(n,i)):(i=n.splice(t,-t),n.unshift.apply(n,i)),i}function dt(i,u,e){var o=e.template;i=n(i);u.item||(o=e.placeholderTemplate);this.angular("cleanup",function(){return{elements:[i]}});i.attr("data-uid",u.item?u.item.uid:"").attr("data-offset-index",u.index).html(o(u.item||{}));i.toggleClass(r,u.current);i.toggleClass(f,u.selected);i.toggleClass("k-first",u.newGroup);i.toggleClass("k-loading-item",!u.item);u.index!==0&&u.newGroup&&n("<div class="+ht+"><\/div>").appendTo(i).html(e.groupTemplate(u.group));u.top!==t&&wt(i[0],u.top);this.angular("compile",function(){return{elements:[i],data:[{dataItem:u.item,group:u.group,newGroup:u.newGroup}]}})}function gt(n,t){for(var e=t.length,f=[],u,r,i=0;i<n.length;i++)for(u=n[i],r=0;r<e;r++)u===t[r]&&f.push({index:i,item:u});return f}var i=window.kendo,y=i.ui,l=y.Widget,nt=y.DataBoundWidget,tt=n.proxy,it="k-virtual-wrap",rt="k-virtual-list",ut="k-virtual-content",ft="k-list",et="k-group-header",a="k-virtual-item",ot="k-item",st="k-height-container",ht="k-group",f="k-state-selected",r="k-state-focused",p="k-state-hover",u="change",o="click",s="listBound",w="itemChange",b="activate",k="deactivate",e=".VirtualList",g=nt.extend({init:function(t,r){var u=this;u._listCreated=!1;u._fetching=!1;u._filter=!1;l.fn.init.call(u,t,r);u.options.itemHeight||(u.options.itemHeight=lt());r=u.options;u.element.addClass(ft+" "+rt).attr("role","listbox");u.content=u.element.wrap("<div unselectable='on' class='"+ut+"'><\/div>").parent();u.wrapper=u.content.wrap("<div class='"+it+"'><\/div>").parent();u.header=u.content.before("<div class='"+et+"'><\/div>").prev();u.element.on("mouseenter"+e,"li:not(.k-loading-item)",function(){n(this).addClass(p)}).on("mouseleave"+e,"li",function(){n(this).removeClass(p)});u._values=c(u.options.value);u._selectedDataItems=[];u._selectedIndexes=[];u._rangesList={};u._activeDeferred=null;u._promisesList=[];u._optionID=i.guid();u.setDataSource(r.dataSource);u.content.on("scroll"+e,i.throttle(function(){u._renderItems()},r.delay));u._selectable()},options:{name:"VirtualList",autoBind:!0,delay:100,height:null,listScreens:4,threshold:.5,itemHeight:null,oppositeBuffer:1,type:"flat",selectable:!1,value:[],dataValueField:null,template:"#:data#",placeholderTemplate:"loading...",groupTemplate:"#:data#",fixedGroupTemplate:"fixed header template",valueMapper:null},events:[u,o,s,w,b,k],setOptions:function(n){l.fn.setOptions.call(this,n);this._selectProxy&&this.options.selectable===!1?this.element.off(o,"."+a,this._selectProxy):!this._selectProxy&&this.options.selectable&&this._selectable();this.refresh()},items:function(){return n(this._items)},destroy:function(){this.wrapper.off(e);this.dataSource.unbind(u,this._refreshHandler);l.fn.destroy.call(this)},setDataSource:function(t){var r=this,f=t||{},e;f=n.isArray(f)?{data:f}:f;f=i.data.DataSource.create(f);r.dataSource?(r.dataSource.unbind(u,r._refreshHandler),r.dataSource.unbind(u,r._rangeChangeHandler),e=r.value(),r.value([]),r.mute(function(){r.value(e)})):(r._refreshHandler=n.proxy(r.refresh,r),r._rangeChangeHandler=n.proxy(r.rangeChange,r));r.dataSource=f.bind(u,r._refreshHandler).bind(u,r._rangeChangeHandler);r.dataSource.view().length!==0?r.refresh():r.options.autoBind&&r.dataSource.fetch()},rangeChange:function(){var n=this,t=n.dataSource.page();n.isBound()&&n._rangeChange===!0&&n._lastPage!==t&&(n._lastPage=t,n.trigger(s))},refresh:function(n){var t=this,r=n&&n.action,i;t._mute||(t._fetching?t._renderItems&&t._renderItems(!0):(t._filter&&t.focus(0),t._createList(),r||!t._values.length||t._filter||t.options.skipUpdateOnBind?(t._lastPage=t.dataSource.page(),t._listCreated=!0,t.trigger(s)):t.value(t._values,!0).done(function(){t._lastPage=t.dataSource.page();t._listCreated=!0;t.trigger(s)})),r==="itemchange"&&(i=gt(t._selectedDataItems,n.items),i.length&&t.trigger("selectedItemChange",{items:i})),t._fetching=!1)},removeAt:function(n){return this._selectedIndexes.splice(n,1),this._values.splice(n,1),{position:n,dataItem:this._selectedDataItems.splice(n,1)[0]}},setValue:function(n){this._values=c(n)},value:function(i,r){var u=this;return i===t?u._values.slice():(i===null&&(i=[]),i=c(i),u.options.selectable==="multiple"&&u.select().length&&i.length&&u.select(-1),u._valueDeferred&&u._valueDeferred.state()!=="resolved"||(u._valueDeferred=n.Deferred()),i.length||u.select(-1),u._values=i,(u.isBound()&&!u._mute||r)&&u._prefetchByValue(i),u._valueDeferred)},_prefetchByValue:function(n){for(var r,t=this,e=t._dataView,s=t._valueGetter,i,o=!1,f=[],u=0;u<n.length;u++)for(r=0;r<e.length;r++)i=e[r].item,i&&(o=v(i)?n[u]===i:n[u]===s(i),o&&f.push(r));if(f.length===n.length){t._values=[];t.select(f);return}if(typeof t.options.valueMapper=="function")t.options.valueMapper({value:this.options.selectable==="multiple"?n:n[0],success:function(n){t._values=[];t._selectedIndexes=[];t._selectedDataItems=[];n=c(n);n.length||(n=[-1]);t.select(n)}});else throw new Error("valueMapper is not provided");},deferredRange:function(t){var s=this.dataSource,i=this.itemCount,u=this._rangesList,f=n.Deferred(),e=[],o=Math.floor(t/i)*i,r=Math.ceil(t/i)*i,h=r===o?[r]:[o,r];return n.each(h,function(t,r){var h=r+i,o=u[r],f;o&&o.end===h?f=o.deferred:(f=n.Deferred(),u[r]={end:h,deferred:f},s._multiplePrefetch(r,i,function(){f.resolve()}));e.push(f)}),n.when.apply(n,e).then(function(){f.resolve()}),f},prefetch:function(t){var i=this,r=this.itemCount,u=!i._promisesList.length;return i._activeDeferred||(i._activeDeferred=n.Deferred(),i._promisesList=[]),n.each(t,function(n,t){var u=Math.floor(t/r)*r;i._promisesList.push(i.deferredRange(u))}),u&&n.when.apply(n,i._promisesList).done(function(){i._activeDeferred.resolve();i._activeDeferred=null;i._promisesList=[]}),i._activeDeferred},_findDataItem:function(n){var r=this.dataSource.view(),t,i;if(this.options.type==="group")for(i=0;i<r.length;i++)if(t=r[i].items,t.length<=n)n=n-t.length;else return t[n];return r[n]},selectedDataItems:function(){return this._selectedDataItems.slice()},scrollTo:function(n){this.content.scrollTop(n)},scrollToIndex:function(n){this.scrollTo(n*this.options.itemHeight)},focus:function(i){var f,u,l,e,s=this.options.itemHeight,v=this._optionID,a=!0,o,c;if(i===t)return e=this.element.find("."+r),e.length?e:null;if(typeof i=="function")for(l=this.dataSource.flatView(),o=0;o<l.length;o++)if(i(l[o])){i=o;break}if(i instanceof Array&&(i=h(i)),isNaN(i)?(f=n(i),u=parseInt(n(f).attr("data-offset-index"),10)):(u=i,f=this._getElementByIndex(u)),u===-1){this.element.find("."+r).removeClass(r);this._focusedIndex=t;return}f.length?(f.hasClass(r)&&(a=!1),this._focusedIndex!==t&&(e=this._getElementByIndex(this._focusedIndex),e.removeClass(r).removeAttr("id"),a&&this.trigger(k)),this._focusedIndex=u,f.addClass(r).attr("id",v),c=this._getElementLocation(u),c==="top"?this.scrollTo(u*s):c==="bottom"?this.scrollTo(u*s+s-this.screenHeight):c==="outScreen"&&this.scrollTo(u*s),a&&this.trigger(b)):(this._focusedIndex=u,this.items().removeClass(r),this.scrollToIndex(u))},focusIndex:function(){return this._focusedIndex},focusFirst:function(){this.scrollTo(0);this.focus(0)},focusLast:function(){var n=this.dataSource.total();this.scrollTo(this.heightContainer.offsetHeight);this.focus(n)},focusPrev:function(){var n=this._focusedIndex,t;return!isNaN(n)&&n>0?(n-=1,this.focus(n),t=this.focus(),t&&t.hasClass("k-loading-item")&&(n+=1,this.focus(n)),n):(n=this.dataSource.total()-1,this.focus(n),n)},focusNext:function(){var n=this._focusedIndex,i=this.dataSource.total()-1,t;return!isNaN(n)&&n<i?(n+=1,this.focus(n),t=this.focus(),t&&t.hasClass("k-loading-item")&&(n-=1,this.focus(n)),n):(n=0,this.focus(n),n)},select:function(n){var i=this,r,f=i.options.selectable!=="multiple",c=!!i._activeDeferred,e,o=[],s;if(n===t)return i._selectedIndexes.slice();(r=i._getIndecies(n),i._filter&&!f&&i._deselectFiltered(r))||r.length&&(!f||i._filter||h(r)!==h(this._selectedIndexes))&&(o=i._deselect(r),f&&(i._activeDeferred=null,c=!1,r.length&&(r=[h(r)])),s=function(){var n=i._select(r);i.focus(r);(n.length||o.length)&&i.trigger(u,{added:n,removed:o});i._valueDeferred&&i._valueDeferred.resolve()},e=i.prefetch(r),c||(e?e.done(s):s()))},isBound:function(){return this._listCreated},mute:function(n){this._mute=!0;tt(n(),this);this._mute=!1},filter:function(n){if(n===t)return this._filter;this._filter=n;this._rangeChange=!0},skipUpdate:n.noop,_getElementByIndex:function(t){return this.items().filter(function(i,r){return t===parseInt(n(r).attr("data-offset-index"),10)})},_clean:function(){this.result=t;this._lastScrollTop=t;this._lastPage=t;n(this.heightContainer).remove();this.heightContainer=t;this.element.empty()},_height:function(){var r=!!this.dataSource.view().length,n=this.options.height,t=this.options.itemHeight,i=this.dataSource.total();return r?n/t>i&&(n=i*t):n=0,n},_screenHeight:function(){var n=this._height(),t=this.content;t.height(n);this.screenHeight=n},_getElementLocation:function(n){var i=this.content.scrollTop(),f=this.screenHeight,r=this.options.itemHeight,t=n*r,e=t+r,u=i+f;return t===i-r||e>i&&t<i?"top":t===u||t<u&&u<e?"bottom":t>=i&&t<=i+(f-r)?"inScreen":"outScreen"},_templates:function(){var n={template:this.options.template,placeholderTemplate:this.options.placeholderTemplate,groupTemplate:this.options.groupTemplate,fixedGroupTemplate:this.options.fixedGroupTemplate};for(var t in n)typeof n[t]!="function"&&(n[t]=i.template(n[t]));this.templates=n},_generateItems:function(n,t){for(var r=[],i,u=this.options.itemHeight+"px";t-->0;)i=document.createElement("li"),i.tabIndex=-1,i.className=a+" "+ot,i.setAttribute("role","option"),i.style.height=u,i.style.minHeight=u,n.appendChild(i),r.push(i);return r},_saveInitialRanges:function(){var i=this.dataSource._ranges,r=n.Deferred(),t;for(r.resolve(),this._rangesList={},t=0;t<i.length;t++)this._rangesList[i[t].start]={end:i[t].end,deferred:r}},_createList:function(){var t=this,u=t.content.get(0),r=t.options,i=t.dataSource;t._listCreated&&t._clean();t._saveInitialRanges();t._screenHeight();t._buildValueGetter();t.itemCount=ct(t.screenHeight,r.listScreens,r.itemHeight);t.itemCount>i.total()&&(t.itemCount=i.total());t._templates();t._items=t._generateItems(t.element[0],t.itemCount);t._setHeight(r.itemHeight*i.total());t.options.type=(i.group()||[]).length?"group":"flat";t.options.type==="flat"?t.header.hide():t.header.show();t.getter=t._getter(function(){t._renderItems(!0)});t._onScroll=function(n,i){var r=t._listItems(t.getter);return t._fixedHeader(n,r(n,i))};t._renderItems=t._whenChanged(yt(u,t._onScroll),pt(t._reorderList(t._items,n.proxy(dt,t))));t._renderItems();t._calculateGroupPadding(t.screenHeight)},_setHeight:function(n){var r,t=this.heightContainer,i;if(t?r=t.offsetHeight:t=this.heightContainer=d(this.content[0],st),n!==r)for(t.innerHTML="";n>0;)i=Math.min(n,25e4),d(t).style.height=i+"px",n-=i},_getter:function(){var u=null,n=this.dataSource,i=n.skip(),f=this.options.type,t=this.itemCount,r={};return n.pageSize()<t&&n.pageSize(t),function(e,o){var s=this,a,y,v,h,p,c,l,w;if(n.inRange(o,t)){if(i!==o&&(s._mute=!0,s._fetching=!0,s._rangeChange=!0,n.range(o,t),i=o,s._rangeChange=!1,s._fetching=!1,s._mute=!1),f==="group"){if(!r[o])for(y=r[o]=[],v=n.view(),h=0,p=v.length;h<p;h++)for(c=v[h],l=0,w=c.items.length;l<w;l++)y.push({item:c.items[l],group:c.value});a=r[o][e-o]}else a=n.view()[e-o];return a}return u!==o&&(u=o,i=o,s._fetching=!0,s._getterDeferred&&s._getterDeferred.reject(),s._getterDeferred=s.deferredRange(o),s._getterDeferred.then(function(){var i=s._indexConstraint(s.content[0].scrollTop);s._getterDeferred=null;o<=i&&i<=o+t&&(s._fetching=!0,s._rangeChange=!0,n.range(o,t),s._rangeChange=!1)})),null}},_fixedHeader:function(n,t){var u=this.currentVisibleGroup,f=this.options.itemHeight,e=Math.floor((n-t.top)/f),r=t.items[e],i;return r&&r.item&&(i=r.group,i!==u&&(this.header[0].innerHTML=i||"",this.currentVisibleGroup=i)),t},_itemMapper:function(n,t,i){var h=this.options.type,c=this.options.itemHeight,l=this._focusedIndex,u=!1,f=!1,e=!1,o=null,s=!1,a=this._valueGetter,r;if(h==="group"&&(n&&(e=t===0||this._currentGroup&&this._currentGroup!==n.group,this._currentGroup=n.group),o=n?n.group:null,n=n?n.item:null),i.length&&n)for(r=0;r<i.length;r++)if(s=v(n)?i[r]===n:i[r]===a(n),s){i.splice(r,1);u=!0;break}return l===t&&(f=!0),{item:n?n:null,group:o,newGroup:e,selected:u,current:f,index:t,top:t*c}},_range:function(n){var f=this.itemCount,e=this._values.slice(),r=[],i,t,u;for(this._view={},this._currentGroup=null,t=n,u=n+f;t<u;t++)i=this._itemMapper(this.getter(t,n),t,e),r.push(i),this._view[i.index]=i;return this._dataView=r,r},_getDataItemsCollection:function(n,t){var i=this._range(this._listIndex(n,t));return{index:i.length?i[0].index:0,top:i.length?i[0].top:0,items:i}},_listItems:function(){var t=this.screenHeight,i=this.options,r=vt(i,t);return n.proxy(function(n,t){var i=this.result,u=this._lastScrollTop;return!t&&i&&r(i,n,u)||(i=this._getDataItemsCollection(n,u)),this._lastScrollTop=n,this.result=i,i},this)},_whenChanged:function(n,t){var i;return function(r){var u=n(r);u!==i&&(i=u,t(u,r))}},_reorderList:function(t,i){var u=this,f=t.length,r=-Infinity;return i=n.proxy(bt(i,this.templates),this),function(n,e,o){var s=e-r,h,c;o||Math.abs(s)>=f?(h=t,c=n):(h=kt(t,s),c=s>0?n.slice(-s):n.slice(0,-s));i(h,c,u._listCreated);r=e}},_bufferSizes:function(){var n=this.options;return at(this.screenHeight,n.listScreens,n.oppositeBuffer)},_indexConstraint:function(n){var t=this.itemCount,i=this.options.itemHeight,r=this.dataSource.total();return Math.min(Math.max(r-t,0),Math.max(0,Math.floor(n/i)))},_listIndex:function(n,t){var i=this._bufferSizes(),r;return r=n-(n>t?i.down:i.up),this._indexConstraint(r)},_selectable:function(){if(this.options.selectable){this._selectProxy=n.proxy(this,"_clickHandler");this.element.on(o+e,"."+a,this._selectProxy)}},_getIndecies:function(n){var t=[],r,i;if(typeof n=="function")for(r=this.dataSource.flatView(),i=0;i<r.length;i++)if(n(r[i])){t.push(i);break}return typeof n=="number"&&t.push(n),n instanceof jQuery&&(n=parseInt(n.attr("data-offset-index"),10),isNaN(n)||t.push(n)),n instanceof Array&&(t=n),t},_deselect:function(i){var s=[],l,r,a,h=this._selectedIndexes,u=0,v=this.options.selectable,y=0,c,e,o;if(i[u]===-1){for(e=0;e<h.length;e++)r=h[e],this._getElementByIndex(r).removeClass(f),s.push({index:r,position:e,dataItem:this._selectedDataItems[e]});return this._values=[],this._selectedDataItems=[],this._selectedIndexes=[],i.splice(0,i.length),s}if(v===!0)l=i[u],r=h[u],r!==t&&l!==r&&(this._getElementByIndex(r).removeClass(f),s.push({index:r,position:u,dataItem:this._selectedDataItems[u]}),this._values=[],this._selectedDataItems=[],this._selectedIndexes=[]);else if(v==="multiple")for(o=0;o<i.length;o++)if(u=n.inArray(i[o],h),r=h[u],r!==t){if(c=this._getElementByIndex(r),!c.hasClass("k-state-selected"))continue;c.removeClass(f);this._values.splice(u,1);this._selectedIndexes.splice(u,1);a=this._selectedDataItems.splice(u,1)[0];i.splice(o,1);s.push({index:r,position:u+y,dataItem:a});y++;o--}return s},_deselectFiltered:function(t){for(var h=this.element[0].children,o,u,r,s=this._values,f=[],e=0,i;e<t.length;e++){for(r=-1,u=t[e],o=this._valueGetter(this._view[u].item),i=0;i<s.length;i++)if(o==s[i]){r=i;break}r>-1&&(f.push(this.removeAt(r)),n(h[u]).removeClass("k-state-selected"))}return f.length?(this.trigger("change",{added:[],removed:f}),!0):!1},_select:function(t){var i=this,h=this.options.selectable!=="multiple",e=this.dataSource,r,o,u=this.itemCount,c=this._valueGetter,s=[];return h&&(i._selectedIndexes=[],i._selectedDataItems=[],i._values=[]),o=e.skip(),n.each(t,function(n,t){var l=t<u?1:Math.floor(t/u)+1,h=(l-1)*u;i.mute(function(){e.range(h,u);r=i._findDataItem([t-h]);i._selectedIndexes.push(t);i._selectedDataItems.push(r);i._values.push(v(r)?r:c(r));s.push({index:t,dataItem:r});i._getElementByIndex(t).addClass(f);e.range(o,u)})}),s},_clickHandler:function(t){var i=n(t.currentTarget);!t.isDefaultPrevented()&&i.attr("data-uid")&&this.trigger(o,{item:i})},_buildValueGetter:function(){this._valueGetter=i.getter(this.options.dataValueField)},_calculateGroupPadding:function(n){var u=this.items().first(),t=this.header,r=0;t[0]&&t[0].style.display!=="none"&&(n!=="auto"&&(r=i.support.scrollbar()),r+=parseFloat(u.css("border-right-width"),10)+parseFloat(u.children(".k-group").css("right"),10),t.css("padding-right",r))}});i.ui.VirtualList=g;i.ui.plugin(g)})(window.kendo.jQuery)}(),function(){(function(n){function a(n,t){function r(n,u){var e,f;if(u=u[t],u)for(e=i[n]=i[n]||[],f=0;f<u.length;f++)e.push(u[f]),r(n+1,u[f])}var i=[];return r(0,n),i}function h(){return t.support.cssBorderSpacing?"":'cellspacing="0"'}function u(t,i){return t.length?"<table "+h()+' class="'+n.trim("k-scheduler-table "+(i||""))+'"><tr>'+t.join("<\/tr><tr>")+"<\/tr><\/table>":""}function k(n,t){return n.length?"<div style='position:relative'>"+u(n,t)+"<\/div>":""}function d(t,i,r){var f=[],e;if(r>0)for(e=0;e<t;e++)f.push("<th>&nbsp;<\/th>");return(i&&f.push('<th class="k-scheduler-times-all-day">'+i.text+"<\/th>"),r<1)?n():n('<div class="k-scheduler-times">'+u(f)+"<\/div>")}function g(t,i,r){for(var e,h,c=[],f,o=0;o<t.length;o++){var s=t[o],l=[],p=i/s.length;for(f=0;f<s.length;f++)e=s[f],l.push('<th colspan="'+(e.colspan||p)+'" class="'+(e.className||"")+'">'+e.text+"<\/th>");c.push(l.join(""))}if(h=[],r){var a=t[t.length-1],v=[],y=r.cellContent;for(f=0;f<a.length;f++)v.push('<td class="'+(a[f].className||"")+'">'+(y?y(f):"&nbsp;")+"<\/th>");h.push(v.join(""))}return n('<div class="k-scheduler-header k-state-default"><div class="k-scheduler-header-wrap">'+u(c)+k(h,"k-scheduler-header-all-day")+"<\/div><\/div>")}function nt(t,i){for(var f,o,s,h=new Array(i).join().split(","),c=[],r,e=0;e<t.length;e++)for(f=t[e],o=i/f.length,r=0;r<f.length;r++)s=f[r].className||"",f[r].allDay&&(s="k-scheduler-times-all-day"),h[o*r]+='<th class="'+s+'" rowspan="'+o+'">'+f[r].text+"<\/th>";for(r=0;r<i;r++)c.push(h[r]);return i<1?n():n('<div class="k-scheduler-times">'+u(c)+"<\/div>")}function tt(){return n('<div class="k-scheduler-content"><table '+h()+' class="k-scheduler-table"/><\/div>')}function ht(){return e=e?e:t.support.scrollbar()}function ct(n,t,i){for(var e,r,s,u,f=n.length-1;f>=0;f--)e=o(n[f]),r=e.start,u=e.end,s=r<=t&&u>=t,(s||r>=t&&u<=i||t<=r&&i>=r)&&(r<t&&(t=r),u>i&&(i=u));return lt(n,t,i)}function o(n){return{start:n.start,end:n.end}}function lt(n,t,i){for(var r,f=[],u=0;u<n.length;u++)r=o(n[u]),(r.start<t&&r.end>t||r.start>=t&&r.end<=i)&&f.push(n[u]);return f}function at(n){return y(n)}function vt(n){return y(n)}function y(n){for(var u,s,h,i=[],f=0;f<n.length;f++){var e=n[f],r=o(e),t=null;for(u=0,s=i.length;u<s;u++)if(h=r.start>i[u].end,r.start<i[u].start||h){t=i[u];t.end<r.end&&(t.end=r.end);break}t||(t={start:r.start,end:r.end,events:[]},i.push(t));t.events.push(e)}return i}function c(n,i,r,u){var f=i[0],s,o,e,h;if(f){for(s=[],o=f.dataSource.view(),e=0;e<o.length;e++)h={text:u({text:t.htmlEncode(t.getter(f.dataTextField)(o[e])),color:t.getter(f.dataColorField)(o[e]),field:f.field,title:f.title,name:f.name,value:t.getter(f.dataValueField)(o[e])}),className:"k-slot-cell"},h[n]=c(n,i.slice(1),r,u),s.push(h);return s}return r}function yt(i){return function(r){if(n.isArray(r)||r instanceof t.data.ObservableArray){for(var u=0;u<r.length;u++)if(r[u]==i)return!0;return!1}return r==i}}function pt(n){n.className=n.className.replace(p,"")+" k-state-selected"}var t=window.kendo,l=t.ui,s=l.Widget,r=t.keys,w=".kendoSchedulerView",b=Math,it='<div class="k-marquee k-scheduler-marquee"><div class="k-marquee-color"><\/div><div class="k-marquee-text"><div class="k-label-top"><\/div><div class="k-label-bottom"><\/div><\/div><\/div>',i,p;t.ui.scheduler={};var rt=t.Class.extend({init:function(n,t){this._index=n;this._timeSlotCollections=[];this._daySlotCollections=[];this._isRtl=t},addTimeSlotCollection:function(n,t){return this._addCollection(n,t,this._timeSlotCollections)},addDaySlotCollection:function(n,t){return this._addCollection(n,t,this._daySlotCollections)},_addCollection:function(n,t,i){var r=new et(n,t,this._index,i.length);return i.push(r),r},timeSlotCollectionCount:function(){return this._timeSlotCollections.length},daySlotCollectionCount:function(){return this._daySlotCollections.length},daySlotByPosition:function(n,t){return this._slotByPosition(n,t,this._daySlotCollections)},timeSlotByPosition:function(n,t){return this._slotByPosition(n,t,this._timeSlotCollections)},_slotByPosition:function(n,t,i){for(var o,u,e=0;e<i.length;e++)for(o=i[e],u=0;u<o.count();u++){var r=o.at(u),c=r.offsetWidth,l=r.offsetHeight,s=r.offsetLeft+c,h=r.offsetTop+l,f=o.at(u+1);if(f&&(f.offsetLeft!=r.offsetLeft?s=this._isRtl?r.offsetLeft+(r.offsetLeft-f.offsetLeft):f.offsetLeft:h=f.offsetTop),n>=r.offsetLeft&&n<s&&t>=r.offsetTop&&t<h)return r}},refresh:function(){for(var n=0;n<this._daySlotCollections.length;n++)this._daySlotCollections[n].refresh();for(n=0;n<this._timeSlotCollections.length;n++)this._timeSlotCollections[n].refresh()},timeSlotRanges:function(n,t){var u=this._timeSlotCollections,r=this._startSlot(n,u),i;return(!r.inRange&&n>=r.slot.end&&(r=null),i=r,n<t&&(i=this._endSlot(t,u)),i&&!i.inRange&&t<=i.slot.start&&(i=null),r===null&&i===null)?[]:(r===null&&(r={inRange:!0,slot:u[i.slot.collectionIndex].first()}),i===null&&(i={inRange:!0,slot:u[r.slot.collectionIndex].last()}),this._continuousRange(ut,u,r,i))},daySlotRanges:function(n,i,r){var e=this._daySlotCollections,f=this._startSlot(n,e,r),u;if(!f.inRange&&n>=f.slot.end&&(f=null),u=f,n<i&&(u=this._endSlot(i,e,r)),u&&!u.inRange&&i<=u.slot.start&&(u=null),f===null&&u===null)return[];if(f===null)do n+=t.date.MS_PER_DAY,f=this._startSlot(n,e,r);while(!f.inRange&&n>=f.slot.end);if(u===null)do i-=t.date.MS_PER_DAY,u=this._endSlot(i,e,r);while(!u.inRange&&i<=u.slot.start);return this._continuousRange(ft,e,f,u)},_continuousRange:function(n,t,i,r){for(var h=i.slot,c=r.slot,f=h.collectionIndex,e=c.collectionIndex,y=[],u=f;u<=e;u++){var l=t[u],a=l.first(),v=l.last(),o=!1,s=!1;u==f&&(s=!i.inRange);u==e&&(o=!r.inRange);a.start<h.start&&(a=h);v.start>c.start&&(v=c);f<e&&(u==f?o=!0:u==e?s=!0:o=s=!0);y.push(new n({start:a,end:v,collection:l,head:o,tail:s}))}return y},slotRanges:function(n,i){var r=n._startTime||t.date.toUtcTime(n.start),u=n._endTime||t.date.toUtcTime(n.end);return(i===undefined&&(i=n.isMultiDay()),i)?this.daySlotRanges(r,u,n.isAllDay):this.timeSlotRanges(r,u)},ranges:function(n,i,r,u){return(typeof n!="number"&&(n=t.date.toUtcTime(n)),typeof i!="number"&&(i=t.date.toUtcTime(i)),r)?this.daySlotRanges(n,i,u):this.timeSlotRanges(n,i)},_startCollection:function(n,t){for(var r,i=0;i<t.length;i++)if(r=t[i],r.startInRange(n))return r;return null},_endCollection:function(n,t,i){for(var u,r=0;r<t.length;r++)if(u=t[r],u.endInRange(n,i))return u;return null},_getCollections:function(n){return n?this._daySlotCollections:this._timeSlotCollections},continuousSlot:function(n,t){var r=t?-1:1,u=this._getCollections(n.isDaySlot),i=u[n.collectionIndex+r];return i?i[t?"last":"first"]():undefined},firstSlot:function(){var n=this._getCollections(this.daySlotCollectionCount());return n[0].first()},lastSlot:function(){var n=this._getCollections(this.daySlotCollectionCount());return n[n.length-1].last()},upSlot:function(n,t){var i=this,r=function(n,r,u){var f=u===0;if(!t&&!n&&f&&i.daySlotCollectionCount())return i._daySlotCollections[0].at(r)};return this.timeSlotCollectionCount()||(t=!0),this._verticalSlot(n,-1,r)},downSlot:function(n,t){var i=this,r=function(n,r,u){if(!t&&n&&i.timeSlotCollectionCount())return i._timeSlotCollections[u].at(0)};return this.timeSlotCollectionCount()||(t=!0),this._verticalSlot(n,1,r)},leftSlot:function(n){return this._horizontalSlot(n,-1)},rightSlot:function(n){return this._horizontalSlot(n,1)},_horizontalSlot:function(n,t){var r=n.index,u=n.isDaySlot,f=n.collectionIndex,e=this._getCollections(u),i;return u?r+=t:f+=t,i=e[f],i?i.at(r):undefined},_verticalSlot:function(n,t,i){var r=n.index,u=n.isDaySlot,f=n.collectionIndex,o=this._getCollections(u),e;return(n=i(u,f,r),n)?n:(u?f+=t:r+=t,e=o[f],e?e.at(r):undefined)},_collection:function(n,t){var i=t?this._daySlotCollections:this._timeSlotCollections;return i[n]},_startSlot:function(n,t,i){var r=this._startCollection(n,t),f=!0,u;return r||(r=t[0],f=!1),u=r.slotByStartDate(n,i),u||(u=r.first(),f=!1),{slot:u,inRange:f}},_endSlot:function(n,t,i){var r=this._endCollection(n,t,i),f=!0,u;return r||(r=t[t.length-1],f=!1),u=r.slotByEndDate(n,i),u||(u=r.last(),f=!1),{slot:u,inRange:f}},getSlotCollection:function(n,t){return this[t?"getDaySlotCollection":"getTimeSlotCollection"](n)},getTimeSlotCollection:function(n){return this._timeSlotCollections[n]},getDaySlotCollection:function(n){return this._daySlotCollections[n]}}),v=t.Class.extend({init:function(t){n.extend(this,t)},innerHeight:function(){for(var i=this.collection,r=this.start.index,u=this.end.index,t=0,n=r;n<=u;n++)t+=i.at(n).offsetHeight;return t},events:function(){return this.collection.events()},addEvent:function(n){this.events().push(n)},startSlot:function(){return this.start.offsetLeft>this.end.offsetLeft?this.end:this.start},endSlot:function(){return this.start.offsetLeft>this.end.offsetLeft?this.start:this.end}}),ut=v.extend({innerHeight:function(){for(var i=this.collection,r=this.start.index,u=this.end.index,t=0,n=r;n<=u;n++)t+=i.at(n).offsetHeight;return t},outerRect:function(n,t,i){return this._rect("offset",n,t,i)},_rect:function(n,i,r,u){var v,y,o,c,e=this.start,f=this.end,p=t.support.isRtl(e.element),s,l,h,a;return typeof i!="number"&&(i=t.date.toUtcTime(i)),typeof r!="number"&&(r=t.date.toUtcTime(r)),u?(v=e.offsetTop,y=f.offsetTop+f[n+"Height"],p?(o=f.offsetLeft,c=e.offsetLeft+e[n+"Width"]):(o=e.offsetLeft,c=f.offsetLeft+f[n+"Width"])):(s=i-e.start,s<0&&(s=0),l=e.end-e.start,v=e.offsetTop+e[n+"Height"]*s/l,h=f.end-r,h<0&&(h=0),a=f.end-f.start,y=f.offsetTop+f[n+"Height"]-f[n+"Height"]*h/a,p?(o=Math.round(f.offsetLeft+f[n+"Width"]*h/a),c=Math.round(e.offsetLeft+e[n+"Width"]-e[n+"Width"]*s/l)):(o=Math.round(e.offsetLeft+e[n+"Width"]*s/l),c=Math.round(f.offsetLeft+f[n+"Width"]-f[n+"Width"]*h/a))),{top:v,bottom:y,left:o===0?o:o+1,right:c}},innerRect:function(n,t,i){return this._rect("client",n,t,i)}}),ft=v.extend({innerWidth:function(){for(var u=this.collection,t=this.start.index,i=this.end.index,r=0,f=t!==i?"offsetWidth":"clientWidth",n=t;n<=i;n++)r+=u.at(n)[f];return r}}),et=t.Class.extend({init:function(n,i,r,u){this._slots=[];this._events=[];this._start=t.date.toUtcTime(n);this._end=t.date.toUtcTime(i);this._groupIndex=r;this._collectionIndex=u},refresh:function(){for(var n=0;n<this._slots.length;n++)this._slots[n].refresh()},startInRange:function(n){return this._start<=n&&n<this._end},endInRange:function(n,t){var i=t?n<this._end:n<=this._end;return this._start<=n&&i},slotByStartDate:function(n){var r=n,i,u;for(typeof r!="number"&&(r=t.date.toUtcTime(n)),i=0;i<this._slots.length;i++)if(u=this._slots[i],u.startInRange(r))return u;return null},slotByEndDate:function(n,i){var u=n,r,f;if(typeof u!="number"&&(u=t.date.toUtcTime(n)),i)return this.slotByStartDate(n,!1);for(r=0;r<this._slots.length;r++)if(f=this._slots[r],f.endInRange(u))return f;return null},count:function(){return this._slots.length},events:function(){return this._events},addTimeSlot:function(n,t,i,r){var u=new ot(n,t,i,this._groupIndex,this._collectionIndex,this._slots.length,r);this._slots.push(u)},addDaySlot:function(n,t,i,r){var u=new st(n,t,i,this._groupIndex,this._collectionIndex,this._slots.length,r);this._slots.push(u)},first:function(){return this._slots[0]},last:function(){return this._slots[this._slots.length-1]},at:function(n){return this._slots[n]}}),f=t.Class.extend({init:function(n,t,i,r,u,f){this.element=n;this.clientWidth=n.clientWidth;this.clientHeight=n.clientHeight;this.offsetWidth=n.offsetWidth;this.offsetHeight=n.offsetHeight;this.offsetTop=n.offsetTop;this.offsetLeft=n.offsetLeft;this.start=t;this.end=i;this.element=n;this.groupIndex=r;this.collectionIndex=u;this.index=f;this.isDaySlot=!1},startDate:function(){return t.timezone.toLocalDate(this.start)},endDate:function(){return t.timezone.toLocalDate(this.end)},startInRange:function(n){return this.start<=n&&n<this.end},endInRange:function(n){return this.start<n&&n<=this.end},startOffset:function(){return this.start},endOffset:function(){return this.end}}),ot=f.extend({init:function(n,t,i,r,u,e,o){f.fn.init.apply(this,arguments);this.isHorizontal=o?!0:!1},refresh:function(){var n=this.element;this.clientWidth=n.clientWidth;this.clientHeight=n.clientHeight;this.offsetWidth=n.offsetWidth;this.offsetHeight=n.offsetHeight;this.offsetTop=n.offsetTop;this.offsetLeft=n.offsetLeft},offsetX:function(n,t){return n?this.offsetLeft+t:this.offsetLeft+t},startInRange:function(n){return this.start<=n&&n<this.end},endInRange:function(n){return this.start<n&&n<=this.end},startOffset:function(i,r,u){var s,f,e,o,h;if(u)return this.start;if(s=n(this.element).offset(),f=this.end-this.start,this.isHorizontal){if(h=t.support.isRtl(this.element),e=i-s.left,o=Math.floor(f*(e/this.offsetWidth)),h)return this.start+f-o}else e=r-s.top,o=Math.floor(f*(e/this.offsetHeight));return this.start+o},endOffset:function(i,r,u){var s,f,e,o,h;if(u)return this.end;if(s=n(this.element).offset(),f=this.end-this.start,this.isHorizontal){if(h=t.support.isRtl(this.element),e=i-s.left,o=Math.floor(f*(e/this.offsetWidth)),h)return this.start+f-o}else e=r-s.top,o=Math.floor(f*(e/this.offsetHeight));return this.start+o}}),st=f.extend({init:function(n,t,i,r,u,e,o){f.fn.init.apply(this,arguments);this.eventCount=o;this.isDaySlot=!0;this.element.children.length?(this.firstChildHeight=this.element.children[0].offsetHeight+3,this.firstChildTop=this.element.children[0].offsetTop):(this.firstChildHeight=3,this.firstChildTop=0)},refresh:function(){this.clientHeight=this.element.clientHeight;this.offsetTop=this.element.offsetTop},startDate:function(){var n=new Date(this.start);return t.timezone.apply(n,"Etc/UTC")},endDate:function(){var n=new Date(this.end);return t.timezone.apply(n,"Etc/UTC")},startInRange:function(n){return this.start<=n&&n<this.end},endInRange:function(n){return this.start<n&&n<=this.end}}),e;t.ui.SchedulerView=s.extend({init:function(i,r){s.fn.init.call(this,i,r);this._scrollbar=ht();this._isRtl=t.support.isRtl(i);this._resizeHint=n();this._moveHint=n();this._cellId=t.guid();this._resourcesForGroups();this._selectedSlots=[]},_isMobile:function(){var n=this.options;return n.mobile===!0&&t.support.mobileOS||n.mobile==="phone"||n.mobile==="tablet"},_isMobilePhoneView:function(){var n=this.options;return n.mobile===!0&&t.support.mobileOS&&!t.support.mobileOS.tablet||n.mobile==="phone"},_addResourceView:function(){var n=new rt(this.groups.length,this._isRtl);return this.groups.push(n),n},dateForTitle:function(){return t.format(this.options.selectedDateFormat,this.startDate(),this.endDate())},shortDateForTitle:function(){return t.format(this.options.selectedShortDateFormat,this.startDate(),this.endDate())},_changeGroup:function(n,t){var r=t?"prevGroupSlot":"nextGroupSlot",i=this[r](n.start,n.groupIndex,n.isAllDay);return i&&(n.groupIndex+=t?-1:1),i},_changeGroupContinuously:function(){return null},_changeViewPeriod:function(){return!1},_horizontalSlots:function(n,t,i,r){var s=r?"leftSlot":"rightSlot",u=t[0].start,f=t[t.length-1].end,h=this.groups[n.groupIndex],o,e;return i||(o=this._normalizeHorizontalSelection(n,t,r),o&&(u=f=o)),u=h[s](u),f=h[s](f),i||this._isVerticallyGrouped()||u&&f||(u=f=this._changeGroup(n,r)),u&&f||(e=this._continuousSlot(n,t,r),e=this._changeGroupContinuously(n,e,i,r),e&&(u=f=e)),{startSlot:u,endSlot:f}},_verticalSlots:function(n,t,i,r){var u=t[0].start,f=t[t.length-1].end,s=this.groups[n.groupIndex],e,o;return i||(e=this._normalizeVerticalSelection(n,t,r),e&&(u=f=e)),o=r?"upSlot":"downSlot",u=s[o](u,i),f=s[o](f,i),i||!this._isVerticallyGrouped()||u&&f||(u=f=this._changeGroup(n,r)),{startSlot:u,endSlot:f}},_normalizeHorizontalSelection:function(){return null},_normalizeVerticalSelection:function(n,t,i){return i?t[0].start:t[t.length-1].end},_continuousSlot:function(){return null},constrainSelection:function(n){var i=this.groups[0],t;this.inRange(n)?i.daySlotCollectionCount()||(n.isAllDay=!1):(t=i.firstSlot(),n.isAllDay=t.isDaySlot,n.start=t.startDate(),n.end=t.endDate());this.groups[n.groupIndex]||(n.groupIndex=0)},move:function(n,t,i){var f=!1,l=this.groups[n.groupIndex],s,e,h,u,o,c;if(l.timeSlotCollectionCount()||(n.isAllDay=!0),s=l.ranges(n.start,n.end,n.isAllDay,!1),t===r.DOWN||t===r.UP){if(f=!0,u=t===r.UP,this._updateDirection(n,s,i,u,!0),o=this._verticalSlots(n,s,i,u),!o.startSlot&&!i&&this._changeViewPeriod(n,u,!0))return f}else if((t===r.LEFT||t===r.RIGHT)&&(f=!0,u=t===r.LEFT,this._updateDirection(n,s,i,u,!1),o=this._horizontalSlots(n,s,i,u),!o.startSlot&&!i&&this._changeViewPeriod(n,u,!1)))return f;return f&&(e=o.startSlot,h=o.endSlot,i?(c=n.backward,c&&e?n.start=e.startDate():!c&&h&&(n.end=h.endDate())):e&&h&&(n.isAllDay=e.isDaySlot,n.start=e.startDate(),n.end=h.endDate()),n.events=[]),f},moveToEventInGroup:function(t,i,r,u){for(var o=t._continuousEvents||[],c,f,s=u?-1:1,h=o.length,e=u?h-1:0;e<h&&e>-1;){if(f=o[e],(!u&&f.start.startDate()>=i.startDate()||u&&f.start.startDate()<=i.startDate())&&(r.length&&(f=o[e+s]),f&&n.inArray(f.uid,r)===-1)){c=!!f;break}e+=s}return f},moveToEvent:function(n,t){for(var u=n.groupIndex,r=this.groups[u],f=r.ranges(n.start,n.end,n.isAllDay,!1)[0].start,o=this.groups.length,s=t?-1:1,e=n.events,i;u<o&&u>-1;){if(i=this.moveToEventInGroup(r,f,e,t),u+=s,r=this.groups[u],!r||i)break;e=[];f=t?r.lastSlot():r.firstSlot(!0)}return i&&(n.events=[i.uid],n.start=i.start.startDate(),n.end=i.end.endDate(),n.isAllDay=i.start.isDaySlot,n.groupIndex=i.start.groupIndex),!!i},current:function(n){if(n!==undefined)this._current=n,this.content.has(n)&&this._scrollTo(n,this.content[0]);else return this._current},select:function(n){this.clearSelection();this._selectEvents(n)||this._selectSlots(n)},_selectSlots:function(n){var o=n.isAllDay,s=this.groups[n.groupIndex],i,t,r,u,f,h,e;for(s.timeSlotCollectionCount()||(o=!0),this._selectedSlots=[],i=s.ranges(n.start,n.end,o,!1),u=0;u<i.length;u++)for(f=i[u],h=f.collection,e=f.start.index;e<=f.end.index;e++)r=h.at(e),t=r.element,t.setAttribute("aria-selected",!0),pt(t),this._selectedSlots.push({start:r.startDate(),end:r.endDate(),element:t});n.backward&&(t=i[0].start.element);this.current(t)},_selectEvents:function(t){var f=!1,e=t.events,u=this.groups[t.groupIndex]._continuousEvents||[],i,o=u.length,r;if(!e[0]||!u[0])return f;for(r=n(),t.events=[],i=0;i<o;i++)n.inArray(u[i].uid,e)>-1&&(r=r.add(u[i].element),t.events.push(u[i].uid));return r[0]&&(r.addClass("k-state-selected").attr("aria-selected",!0),this.current(r.last()[0]),this._selectedSlots=[],f=!0),f},inRange:function(n){var i=this.startDate(),r=t.date.addDays(this.endDate(),1),u=n.start,f=n.end;return i<=u&&u<r&&i<f&&f<=r},_resourceValue:function(n,i){return n.valuePrimitive&&(i=t.getter(n.dataValueField)(i)),i},_resourceBySlot:function(n){var e=this.groupedResources,o={},r,u,i,f,s;if(e.length)for(r=n.groupIndex,u=e.length-1;u>=0;u--)i=e[u],f=this._resourceValue(i,i.dataSource.view()[r%i.dataSource.total()]),i.multiple&&(f=[f]),s=t.setter(i.field),s(o,f),r=Math.floor(r/i.dataSource.total());return o},_createResizeHint:function(t,i,r,u){return n(it).css({left:t,top:i,width:r,height:u})},_removeResizeHint:function(){this._resizeHint.remove();this._resizeHint=n()},_removeMoveHint:function(){this._moveHint.remove();this._moveHint=n()},_scrollTo:function(n,t){var i=n.offsetTop,f=n.offsetHeight,r=t.scrollTop,u=t.clientHeight,e=i+f,o=0;o=r>i?i:e>r+u?f<=u?e-u:i:r;t.scrollTop=o},_shouldInverseResourceColor:function(n){var t=new i(n.color).isDark(),r=this.element.css("color"),u=new i(r).isDark();return t==u},_eventTmpl:function(i,r){var h=this.options,o=n.extend({},t.Template,h.templateSettings),c=o.paramName,e="",s=typeof i,u={storage:{},count:0},f;return s==="function"?(u.storage["tmpl"+u.count]=i,e+="#=this.tmpl"+u.count+"("+c+")#",u.count++):s==="string"&&(e+=i),f=t.template(t.format(r,e),o),u.count>0&&(f=n.proxy(f,u.storage)),f},eventResources:function(n){var c=[],l=this.options,o,s,h,u,f,e,a;if(!l.resources)return c;for(o=0;o<l.resources.length;o++){var i=l.resources[o],v=i.field,r=t.getter(v)(n);if(r!=null)for(i.multiple||(r=[r]),s=i.dataSource.view(),h=0;h<r.length;h++){for(u=null,f=r[h],i.valuePrimitive||(f=t.getter(i.dataValueField)(f)),e=0;e<s.length;e++)if(s[e].get(i.dataValueField)==f){u=s[e];break}u!==null&&(a=t.getter(i.dataColorField)(u),c.push({field:i.field,title:i.title,name:i.name,text:t.getter(i.dataTextField)(u),value:f,color:a}))}}return c},createLayout:function(t){var r=-1,i,o,f,u,e;for(t.rows||(t.rows=[]),i=0;i<t.rows.length;i++)if(t.rows[i].allDay){r=i;break}o=t.rows[r];r>=0&&t.rows.splice(r,1);f=this.columnLevels=a(t,"columns");u=this.rowLevels=a(t,"rows");this.table=n("<table "+h()+' class="k-scheduler-layout k-scheduler-'+this.name+'view"/>');e=u[u.length-1].length;this.table.append(this._topSection(f,o,e));this.table.append(this._bottomSection(f,u,e));this.element.append(this.table);this._scroller()},refreshLayout:function(){for(var l,h,i=this,c=i.element.find(">.k-scheduler-toolbar"),u=i.element.innerHeight(),e=this._scrollbar,f=0,o=this._isRtl?"left":"right",s=0;s<c.length;s++)u-=c.eq(s).outerHeight();i.datesHeader&&(f=i.datesHeader.outerHeight());i.timesHeader&&i.timesHeader.outerHeight()>f&&(f=i.timesHeader.outerHeight());i.datesHeader&&i.timesHeader&&(l=i.datesHeader.find("table:first tr"),i.timesHeader.find("tr").height(function(t){n(this).height(l.eq(t).height())}));f&&(u-=f);i.footer&&(u-=i.footer.outerHeight());var a=function(n){var t,i;return n[0].style.height?!0:(t=n.height(),n.height("auto"),i=n.height(),t!=i)?(n.height(""),!0):(n.height(""),!1)},r=i.content[0],v=t.support.kineticScrollNeeded?0:e;a(i.element)&&(u>e*2?i.content.height(u):i.content.height(e*2+1),i.times.height(r.clientHeight),h=i.times.find("table"),h.length&&h.height(i.content.find("table")[0].clientHeight));r.offsetWidth-r.clientWidth>0?(i.table.addClass("k-scrollbar-v"),i.datesHeader.css("padding-"+o,v-parseInt(i.datesHeader.children().css("border-"+o+"-width"),10))):i.datesHeader.css("padding-"+o,"");r.offsetHeight-r.clientHeight>0||r.clientHeight>i.content.children(".k-scheduler-table").height()?i.table.addClass("k-scrollbar-h"):i.table.removeClass("k-scrollbar-h")},_topSection:function(t,i,r){this.timesHeader=d(t.length,i,r);var u=t[t.length-1].length;return this.datesHeader=g(t,u,i),n("<tr>").append(this.timesHeader.add(this.datesHeader).wrap("<td>").parent())},_bottomSection:function(t,i,r){return this.times=nt(i,r),this.content=tt(t[t.length-1],i[i.length-1]),n("<tr>").append(this.times.add(this.content).wrap("<td>").parent())},_scroller:function(){var r=this,i;this.content.bind("scroll"+w,function(){r.datesHeader.find(">.k-scheduler-header-wrap").scrollLeft(this.scrollLeft);r.times.scrollTop(this.scrollTop)});i=t.touchScroller(this.content,{avoidScrolling:function(t){return n(t.event.target).closest(".k-event.k-event-active").length>0}});i&&i.movable&&(this._touchScroller=i,this.content=i.scrollElement,i.movable.bind("change",function(n){r.datesHeader.find(">.k-scheduler-header-wrap").scrollLeft(-n.sender.x);r.times.scrollTop(-n.sender.y)}))},_resourcesForGroups:function(){var u=[],n=this.options.group,i=this.options.resources,t,f,r,e;if(n=n&&n.resources?n.resources:[],i&&n.length)for(t=0,f=i.length;t<f;t++)for(r=0,e=n.length;r<e;r++)i[t].name===n[r]&&u.push(i[t]);this.groupedResources=u},_createColumnsLayout:function(n,t,i){return c("columns",n,t,i)},_groupOrientation:function(){var n=this.options.group;return n&&n.resources?n.orientation:"horizontal"},_isVerticallyGrouped:function(){return this.groupedResources.length&&this._groupOrientation()==="vertical"},_createRowsLayout:function(n,t,i){return c("rows",n,t,i)},selectionByElement:function(){return null},clearSelection:function(){this.content.find(".k-state-selected").removeAttr("id").attr("aria-selected",!1).removeClass("k-state-selected")},destroy:function(){var n=this;s.fn.destroy.call(this);n.table&&(t.destroy(n.table),n.table.remove());n.groups=null;n.table=null;n.content=null;n.times=null;n.datesHeader=null;n.timesHeader=null;n.footer=null;n._resizeHint=null;n._moveHint=null},calendarInfo:function(){return t.getCulture().calendars.standard},prevGroupSlot:function(n,t,i){var r,u=this.groups[t],f=u.ranges(n,n,i,!1)[0].start;if(!(t<=0))return this._isVerticallyGrouped()?u.timeSlotCollectionCount()?(r=u._collection(i?f.index:f.collectionIndex,!1),r.last()):(r=u._collection(u.daySlotCollectionCount()-1,!0),r.at(f.index)):u.timeSlotCollectionCount()?(r=u._collection(i?0:u.timeSlotCollectionCount()-1,i),i?r.last():r.at(f.index)):(r=u._collection(f.collectionIndex,!0),r.last())},nextGroupSlot:function(n,t,i){var r,u=this.groups[t],f=u.ranges(n,n,i,!1)[0].start,e;if(!(t>=this.groups.length-1))return this._isVerticallyGrouped()?u.timeSlotCollectionCount()?(e=u.daySlotCollectionCount(),r=u._collection(e?0:f.collectionIndex,e),i?r.first():r.at(f.collectionIndex)):(r=u._collection(0,!0),r.at(f.index)):u.timeSlotCollectionCount()?(r=u._collection(0,i),i?r.first():r.at(f.index)):(r=u._collection(f.collectionIndex,!0),r.first())},_eventOptionsForMove:function(){return{}},_updateEventForResize:function(){return},_updateEventForSelection:function(n){return n}});i=function(n){var t=this,f=i.formats,o,s,e,r,u;if(arguments.length===1)for(n=t.resolveColor(n),r=0;r<f.length;r++)o=f[r].re,s=f[r].process,e=o.exec(n),e&&(u=s(e),t.r=u[0],t.g=u[1],t.b=u[2]);else t.r=arguments[0],t.g=arguments[1],t.b=arguments[2];t.r=t.normalizeByte(t.r);t.g=t.normalizeByte(t.g);t.b=t.normalizeByte(t.b)};i.prototype={resolveColor:function(n){return n=n||"#000",n.charAt(0)=="#"&&(n=n.substr(1,6)),n=n.replace(/ /g,""),n=n.toLowerCase(),i.namedColors[n]||n},normalizeByte:function(n){return n<0||isNaN(n)?0:n>255?255:n},percBrightness:function(){var n=this;return b.sqrt(.241*n.r*n.r+.691*n.g*n.g+.068*n.b*n.b)},isDark:function(){var n=this,t=n.percBrightness();return t<180}};i.formats=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,process:function(n){return[parseInt(n[1],10),parseInt(n[2],10),parseInt(n[3],10)]}},{re:/^(\w{2})(\w{2})(\w{2})$/,process:function(n){return[parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,process:function(n){return[parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16)]}}];i.namedColors={aqua:"00ffff",azure:"f0ffff",beige:"f5f5dc",black:"000000",blue:"0000ff",brown:"a52a2a",coral:"ff7f50",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgray:"a9a9a9",darkgreen:"006400",darkorange:"ff8c00",darkred:"8b0000",dimgray:"696969",fuchsia:"ff00ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lightblue:"add8e6",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumblue:"0000cd",navy:"000080",olive:"808000",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",pink:"ffc0cb",plum:"dda0dd",purple:"800080",red:"ff0000",royalblue:"4169e1",salmon:"fa8072",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",steelblue:"4682b4",tan:"d2b48c",teal:"008080",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};p=/\s*k-state-selected/;n.extend(l.SchedulerView,{createColumns:at,createRows:vt,rangeIndex:o,collidingEvents:ct,groupEqFilter:yt})})(window.kendo.jQuery)}(),function(){(function(n,t){function p(n){var t=new Date(1980,1,1,0,0,0);return c(t,r(n)),t}function o(n,t,i){return n>=t&&n<=i}function l(n,t,i,r){return r=r?n<=i:n<i,n>t&&r}function w(n,t,r,u){var f=n._continuousEvents,s=f[f.length-1],h=e(t.start.startDate()).getTime(),o;if(u&&s&&e(s.start.startDate()).getTime()==h){for(o=f.length-1;o>-1;o--)if(f[o].isAllDay||e(f[o].start.startDate()).getTime()<h)break;f.splice(o+1,0,{element:r,isAllDay:!0,uid:r.attr(i.attr("uid")),start:t.start,end:t.end})}else f.push({element:r,isAllDay:u,uid:r.attr(i.attr("uid")),start:t.start,end:t.end})}function it(n){var i=[],t=n.workWeekStart;for(i.push(t);n.workWeekEnd!=t;)t>6?t-=7:t++,i.push(t);return i}var i=window.kendo,y=i.ui,c=i.date.setTime,f=y.SchedulerView,h=n.extend,b=n.proxy,e=i.date.getDate,v=i.date.MS_PER_MINUTE,u=i.date.MS_PER_DAY,r=i.date.getMilliseconds,s=".kendoMultiDayView",k=i.template('<div title="(#=kendo.format("{0:t} - {1:t}", start, end)#): #=title.replace(/"/g,"&\\#34;")#"><div class="k-event-template k-event-time">#:kendo.format("{0:t} - {1:t}", start, end)#<\/div><div class="k-event-template">${title}<\/div><\/div>'),d=i.template('<div title="(#=kendo.format("{0:t}", start)#): #=title.replace(/"/g,"&\\#34;")#"><div class="k-event-template">${title}<\/div><\/div>'),g=i.template("<span class='k-link k-nav-day'>#=kendo.toString(date, 'ddd M/dd')#<\/span>"),nt='<div role="gridcell" aria-selected="false" data-#=ns#uid="#=uid#"#if (resources[0]) { #style="background-color:#=resources[0].color#; border-color: #=resources[0].color#"class="k-event#=inverseColor ? " k-event-inverse" : ""#" #} else {#class="k-event"#}#><span class="k-event-actions"># if(data.tail || data.middle) {#<span class="k-icon k-i-arrow-w"><\/span>#}## if(data.isException()) {#<span class="k-icon k-i-exception"><\/span># } else if(data.isRecurring()) {#<span class="k-icon k-i-refresh"><\/span># } #<\/span>{0}<span class="k-event-actions">#if (showDelete) {#<a href="\\#" class="k-link k-event-delete"><span class="k-icon k-si-close"><\/span><\/a>#}## if(data.head || data.middle) {#<span class="k-icon k-i-arrow-e"><\/span>#}#<\/span>#if(resizable && !singleDay && !data.tail && !data.middle){#<span class="k-resize-handle k-resize-w"><\/span>#}##if(resizable && !singleDay && !data.head && !data.middle){#<span class="k-resize-handle k-resize-e"><\/span>#}#<\/div>',tt='<div role="gridcell" aria-selected="false" data-#=ns#uid="#=uid#" #if (resources[0]) { #style="background-color:#=resources[0].color #; border-color: #=resources[0].color#"class="k-event#=inverseColor ? " k-event-inverse" : ""#"#} else {#class="k-event"#}#><span class="k-event-actions"># if(data.isException()) {#<span class="k-icon k-i-exception"><\/span># } else if(data.isRecurring()) {#<span class="k-icon k-i-refresh"><\/span># } #<\/span>{0}<span class="k-event-actions">#if (showDelete) {#<a href="\\#" class="k-link k-event-delete"><span class="k-icon k-si-close"><\/span><\/a>#}#<\/span><span class="k-event-top-actions"># if(data.tail || data.middle) {#<span class="k-icon k-i-arrow-n"><\/span># } #<\/span><span class="k-event-bottom-actions"># if(data.head || data.middle) {#<span class="k-icon k-i-arrow-s"><\/span># } #<\/span># if(resizable && !data.tail && !data.middle) {#<span class="k-resize-handle k-resize-n"><\/span># } ## if(resizable && !data.head && !data.middle) {#<span class="k-resize-handle k-resize-s"><\/span># } #<\/div>',a=f.extend({init:function(n,t){var i=this;f.fn.init.call(i,n,t);i.title=i.options.title||i.options.name;i._workDays=it(i.options);i._templates();i._editable();i.calculateDateRange();i._groups();i._currentTime()},_currentTimeMarkerUpdater:function(){var t=new Date,r=this.options,f,o,s,u,c,l,a;for(r.currentTimeMarker.useLocalTimezone===!1&&(f=r.dataSource.options.schema.timezone,r.dataSource&&f&&(o=i.timezone.offset(t,f),t=i.timezone.convert(t,t.getTimezoneOffset(),o))),this.times.find(".k-current-time").remove(),s=!r.group||r.group.orientation=="horizontal"?1:this.groups.length,u=0;u<s;u++){var v=this.groups[u],h=i.date.toUtcTime(t),e=v.timeSlotRanges(h,h+1);if(e.length===0)return;c=e[0].collection;l=c.slotByStartDate(t);l&&(a=n("<div class='k-current-time'><\/div>"),a.appendTo(this.times).css({top:Math.round(e[0].innerRect(t,new Date(t.getTime()+1),!1).top),height:"1px",right:"1px",left:0}))}},_currentTime:function(){var n=this,i=n.options.currentTimeMarker,r;i!==!1&&i.updateInterval!==t&&(r=i.updateInterval,n._currentTimeMarkerUpdater(),n._currentTimeUpdateTimer=setInterval(b(this._currentTimeMarkerUpdater,n),r))},_updateResizeHint:function(n,t,r,u){var l=n.isMultiDay(),k=this.groups[t],v=k.ranges(r,u,l,n.isAllDay),o,h,b,c,e;for(this._removeResizeHint(),o=0;o<v.length;o++){var a=v[o],s=a.startSlot(),y=s.offsetWidth,p=s.clientHeight,w=s.offsetTop;l?y=a.innerWidth():(h=a.outerRect(r,u,this.options.snap),w=h.top,p=h.bottom-h.top);b=f.fn._createResizeHint.call(this,s.offsetLeft,w,y,p);this._resizeHint=this._resizeHint.add(b)}c="t";e=this.content;l&&(c="M/dd",e=this.element.find(".k-scheduler-header-wrap:has(.k-scheduler-header-all-day) > div"),e.length||(e=this.content));this._resizeHint.appendTo(e);this._resizeHint.find(".k-label-top,.k-label-bottom").text("");this._resizeHint.first().addClass("k-first").find(".k-label-top").text(i.toString(i.timezone.toLocalDate(r),c));this._resizeHint.last().addClass("k-last").find(".k-label-bottom").text(i.toString(i.timezone.toLocalDate(u),c))},_updateMoveHint:function(n,t,u){var s=n.isMultiDay(),w=this.groups[t],o=i.date.toUtcTime(n.start)+u,f=o+n.duration(),l=w.ranges(o,f,s,n.isAllDay),a,e,v,c;for(o=i.timezone.toLocalDate(o),f=i.timezone.toLocalDate(f),this._removeMoveHint(),!s&&(r(f)===0||r(f)<r(this.startTime()))&&l.length>1&&l.pop(),a=0;a<l.length;a++){var y=l[a],h=y.start,p=this._createEventElement(n.clone({start:o,end:f}),!s);p.addClass("k-event-drag-hint");e={left:h.offsetLeft+2,top:h.offsetTop};this._isRtl&&(e.left=h.clientWidth*.1+h.offsetLeft+2);s?e.width=y.innerWidth()-4:(v=y.outerRect(o,f,this.options.snap),e.top=v.top,e.height=v.bottom-v.top,e.width=h.clientWidth*.9-4);p.css(e);this._moveHint=this._moveHint.add(p)}c=this.content;s&&(c=this.element.find(".k-scheduler-header-wrap:has(.k-scheduler-header-all-day) > div"),c.length||(c=this.content));this._moveHint.appendTo(c)},_slotByPosition:function(n,t){var u,i,f,r;for(this._isVerticallyGrouped()?(i=this.content.offset(),t+=this.content[0].scrollTop,n+=this.content[0].scrollLeft):i=this.element.find(".k-scheduler-header-wrap:has(.k-scheduler-header-all-day)").find(">div").offset(),i&&(n-=i.left,t-=i.top),n=Math.ceil(n),t=Math.ceil(t),r=0;r<this.groups.length;r++)if(f=this.groups[r],u=f.daySlotByPosition(n,t),u)return u;for(i&&(n+=i.left,t+=i.top),i=this.content.offset(),n-=i.left,t-=i.top,this._isVerticallyGrouped()||(t+=this.content[0].scrollTop,n+=this.content[0].scrollLeft),n=Math.ceil(n),t=Math.ceil(t),r=0;r<this.groups.length;r++)if(f=this.groups[r],u=f.timeSlotByPosition(n,t),u)return u;return null},_groupCount:function(){var n=this.groupedResources;return n.length?this._groupOrientation()==="vertical"?this._rowCountForLevel(n.length-1):this._columnCountForLevel(n.length)/this._columnOffsetForResource(n.length):1},_columnCountInResourceView:function(){var n=this.groupedResources;return!n.length||this._isVerticallyGrouped()?this._columnCountForLevel(0):this._columnOffsetForResource(n.length)},_timeSlotGroups:function(n,t){var v=this._timeSlotInterval(),h=this.content.find("tr:not(.k-scheduler-header-all-day)"),i,u,o,f,c,s,y,p,e;for(h.attr("role","row"),i=h.length,this._isVerticallyGrouped()&&(i=Math.floor(i/n)),u=0;u<n;u++)for(o=0,this._isVerticallyGrouped()&&(o=u),f=o*i,s=0,this._isVerticallyGrouped()||(s=u);f<(o+1)*i;){for(y=h[f].children,p=this.groups[u],f%i==0&&(c=r(new Date(+this.startTime()))),e=s*t;e<(s+1)*t;e++){var l=y[e],w=e%t,k=p.getTimeSlotCollection(w),a=this._dates[w],d=Date.UTC(a.getFullYear(),a.getMonth(),a.getDate()),b=d+c,g=b+v;l.setAttribute("role","gridcell");l.setAttribute("aria-selected",!1);k.addTimeSlot(l,b,g)}c+=v;f++}},_daySlotGroups:function(n,t){var s,r,h,f,u,e,o,l;for(s=this._isVerticallyGrouped()?this.element.find(".k-scheduler-header-all-day"):this.element.find(".k-scheduler-header-all-day tr"),s.attr("role","row"),r=0;r<n;r++){h=0;this._isVerticallyGrouped()&&(h=r);var a=this.groups[r],v=a.getDaySlotCollection(0),y=s[h].children,c=0;for(this._isVerticallyGrouped()||(c=r),f=0,u=c*t;u<(c+1)*t;u++)e=y[u],u%t==0&&(f=0),o=this._dates[f],l=Date.UTC(o.getFullYear(),o.getMonth(),o.getDate()),f++,e.setAttribute("role","gridcell"),e.setAttribute("aria-selected",!1),v.addDaySlot(e,l,l+i.date.MS_PER_DAY)}},_groups:function(){var r=this._groupCount(),u=this._columnCountInResourceView(),t,f,n;for(this.groups=[],t=0;t<r;t++){for(f=this._addResourceView(t),n=0;n<u;n++)f.addTimeSlotCollection(this._dates[n],i.date.addDays(this._dates[n],1));this.options.allDaySlot&&f.addDaySlotCollection(this._dates[0],i.date.addDays(this._dates[this._dates.length-1],1))}this._timeSlotGroups(r,u);this.options.allDaySlot&&this._daySlotGroups(r,u)},options:{name:"MultiDayView",selectedDateFormat:"{0:D}",selectedShortDateFormat:"{0:d}",allDaySlot:!0,showWorkHours:!1,title:"",startTime:i.date.today(),endTime:i.date.today(),minorTickCount:2,majorTick:60,majorTimeHeaderTemplate:"#=kendo.toString(date, 't')#",minorTimeHeaderTemplate:"&nbsp;",groupHeaderTemplate:"#=text#",slotTemplate:"&nbsp;",allDaySlotTemplate:"&nbsp;",eventTemplate:k,allDayEventTemplate:d,dateHeaderTemplate:g,editable:!0,workDayStart:new Date(1980,1,1,8,0,0),workDayEnd:new Date(1980,1,1,17,0,0),workWeekStart:1,workWeekEnd:5,footer:{command:"workDay"},messages:{allDay:"all day",showFullDay:"Show full day",showWorkDay:"Show business hours"},currentTimeMarker:{updateInterval:1e4,useLocalTimezone:!0}},events:["remove","add","edit"],_templates:function(){var n=this.options,t=h({},i.Template,n.templateSettings);this.eventTemplate=this._eventTmpl(n.eventTemplate,tt);this.allDayEventTemplate=this._eventTmpl(n.allDayEventTemplate,nt);this.majorTimeHeaderTemplate=i.template(n.majorTimeHeaderTemplate,t);this.minorTimeHeaderTemplate=i.template(n.minorTimeHeaderTemplate,t);this.dateHeaderTemplate=i.template(n.dateHeaderTemplate,t);this.slotTemplate=i.template(n.slotTemplate,t);this.allDaySlotTemplate=i.template(n.allDaySlotTemplate,t);this.groupHeaderTemplate=i.template(n.groupHeaderTemplate,t)},_editable:function(){this.options.editable&&(this._isMobile()?this._touchEditable():this._mouseEditable())},_mouseEditable:function(){var t=this;t.element.on("click"+s,".k-event a:has(.k-si-close)",function(r){t.trigger("remove",{uid:n(this).closest(".k-event").attr(i.attr("uid"))});r.preventDefault()});if(t.options.editable.create!==!1)t.element.on("dblclick"+s,".k-scheduler-content td",function(i){var r,u;n(this).parent().hasClass("k-scheduler-header-all-day")||(r=t._slotByPosition(i.pageX,i.pageY),r&&(u=t._resourceBySlot(r),t.trigger("add",{eventInfo:h({start:r.startDate(),end:r.endDate()},u)})),i.preventDefault())}).on("dblclick"+s,".k-scheduler-header-all-day td",function(n){var r=t._slotByPosition(n.pageX,n.pageY),u;r&&(u=t._resourceBySlot(r),t.trigger("add",{eventInfo:h({},{isAllDay:!0,start:i.date.getDate(r.startDate()),end:i.date.getDate(r.startDate())},u)}));n.preventDefault()});if(t.options.editable.update!==!1)t.element.on("dblclick"+s,".k-event",function(r){t.trigger("edit",{uid:n(this).closest(".k-event").attr(i.attr("uid"))});r.preventDefault()})},_touchEditable:function(){var t=this,r=0;i.support.mobileOS.android&&(r=5);t.options.editable.create!==!1&&(t._addUserEvents=new i.UserEvents(t.element,{threshold:r,filter:".k-scheduler-content td",tap:function(i){var r,u;n(i.target).parent().hasClass("k-scheduler-header-all-day")||(r=t._slotByPosition(i.x.location,i.y.location),r&&(u=t._resourceBySlot(r),t.trigger("add",{eventInfo:h({start:r.startDate(),end:r.endDate()},u)})),i.preventDefault())}}),t._allDayUserEvents=new i.UserEvents(t.element,{threshold:r,filter:".k-scheduler-header-all-day td",tap:function(n){var r=t._slotByPosition(n.x.location,n.y.location),u;r&&(u=t._resourceBySlot(r),t.trigger("add",{eventInfo:h({},{isAllDay:!0,start:i.date.getDate(r.startDate()),end:i.date.getDate(r.startDate())},u)}));n.preventDefault()}}));t.options.editable.update!==!1&&(t._editUserEvents=new i.UserEvents(t.element,{threshold:r,filter:".k-event",tap:function(r){var u=n(r.target).closest(".k-event");u.hasClass("k-event-active")||t.trigger("edit",{uid:u.attr(i.attr("uid"))});r.preventDefault()}}))},_layout:function(n){for(var o,u,f=[],r=[],s=this.options,t=this,e=0;e<n.length;e++)o={},o.text=t.dateHeaderTemplate({date:n[e]}),i.date.isToday(n[e])&&(o.className="k-today"),f.push(o);return u=this.groupedResources,s.allDaySlot&&r.push({text:s.messages.allDay,allDay:!0,cellContent:function(i){var r=i;return i=u.length&&t._groupOrientation()!=="vertical"?i%n.length:i,t.allDaySlotTemplate({date:n[i],resources:function(){return t._resourceBySlot({groupIndex:r})}})}}),this._forTimeRange(this.startTime(),this.endTime(),function(n,i,u,f){var e=i?t.majorTimeHeaderTemplate:t.minorTimeHeaderTemplate,o={text:e({date:n}),className:f?"k-slot-cell":""};r.push(o)}),u.length&&(this._groupOrientation()==="vertical"?r=this._createRowsLayout(u,r,this.groupHeaderTemplate):f=this._createColumnsLayout(u,f,this.groupHeaderTemplate)),{columns:f,rows:r}},_footer:function(){var i=this.options,t,u,r;if(i.footer!==!1){t='<div class="k-header k-scheduler-footer">';u=i.footer.command;u&&u==="workDay"?(t+='<ul class="k-reset k-header">',t+='<li class="k-state-default k-scheduler-fullday"><a href="#" class="k-link"><span class="k-icon k-i-clock"><\/span>',t+=(i.showWorkHours?i.messages.showFullDay:i.messages.showWorkDay)+"<\/a><\/li>",t+="<\/ul>"):t+="&nbsp;";t+="<\/div>";this.footer=n(t).appendTo(this.element);r=this;this.footer.on("click"+s,".k-scheduler-fullday",function(n){n.preventDefault();r.trigger("navigate",{view:r.name||i.name,date:r.startDate(),isWorkDay:!i.showWorkHours})})}},_forTimeRange:function(n,t,i,f){n=p(n);t=p(t);var d=this,l=r(n),o=r(t),a=d.options.minorTickCount,g=d.options.majorTick*v,h=g/a||1,e=new Date(+n),nt=e.getDate(),y,w=0,s,b="";for(s=u/h,l!=o&&(l>o&&(o+=u),s=(o-l)/h),s=Math.round(s);w<s;w++){var k=w%(g/h),tt=k===0,it=k<a-1,rt=k===a-1;b+=i(e,tt,it,rt);c(e,h,!1)}return o&&(y=r(e),nt<e.getDate()&&(y+=u),y>o&&(e=new Date(+t))),f&&(b+=f(e)),b},_content:function(n){var t=this,c=t.options,l=t.startTime(),a=this.endTime(),o=1,s=1,v=n.length,r="",y=this.groupedResources,p=this.slotTemplate,w=this.allDaySlotTemplate,f=!1,e,h,u;for(y.length&&(f=t._groupOrientation()==="vertical",f?(s=this._rowCountForLevel(this.rowLevels.length-2),c.allDaySlot&&(e=function(i){for(var u='<tr class="k-scheduler-header-all-day">',f=function(){return t._resourceBySlot({groupIndex:i})},r=0,e=n.length;r<e;r++)u+="<td>"+w({date:n[r],resources:f})+"<\/td>";return u+"<\/tr>"})):o=this._columnCountForLevel(this.columnLevels.length-2)),r+="<tbody>",h=function(r,e){for(var h="",s,y,c="",l,a=0,h="<tr"+(e?' class="k-middle-row"':"")+">",w=function(n){return function(){return t._resourceBySlot({groupIndex:n})}};a<o;a++)for(s=0,y=v;s<y;s++)c="",i.date.isToday(n[s])&&(c+="k-today"),(i.date.getMilliseconds(r)<i.date.getMilliseconds(t.options.workDayStart)||i.date.getMilliseconds(r)>=i.date.getMilliseconds(t.options.workDayEnd)||!t._isWorkDay(n[s]))&&(c+=" k-nonwork-hour"),h+="<td"+(c!==""?' class="'+c+'"':"")+">",l=i.date.getDate(n[s]),i.date.setTime(l,i.date.getMilliseconds(r)),h+=p({date:l,resources:w(f?u:a)}),h+="<\/td>";return h+"<\/tr>"},u=0;u<s;u++)r+=e?e(u):"",r+=this._forTimeRange(l,a,h);r+="<\/tbody>";this.content.find("table").append(r)},_isWorkDay:function(n){for(var r=n.getDay(),i=this._workDays,t=0;t<i.length;t++)if(i[t]===r)return!0;return!1},_render:function(t){var i=this,r;t=t||[];this._dates=t;this._startDate=t[0];this._endDate=t[t.length-1||0];this.createLayout(this._layout(t));this._content(t);this._footer();this.refreshLayout();r=this.element.find(".k-scheduler-header-all-day td");r.length&&(this._allDayHeaderHeight=r.first()[0].clientHeight);i.datesHeader.on("click"+s,".k-nav-day",function(t){var r=n(t.currentTarget).closest("th"),u=r.offset(),f=i._slotByPosition(u.left,u.top+r.outerHeight());i.trigger("navigate",{view:"day",date:f.startDate()})})},startTime:function(){var n=this.options;return n.showWorkHours?n.workDayStart:n.startTime},endTime:function(){var n=this.options;return n.showWorkHours?n.workDayEnd:n.endTime},startDate:function(){return this._startDate},endDate:function(){return this._endDate},_end:function(n){var t=r(this.endTime())||u;return n&&(t=0),new Date(this._endDate.getTime()+t)},nextDate:function(){return i.date.nextDay(this.endDate())},previousDate:function(){return i.date.previousDay(this.startDate())},calculateDateRange:function(){this._render([this.options.date])},destroy:function(){var n=this;n._currentTimeUpdateTimer&&clearInterval(n._currentTimeUpdateTimer);n.datesHeader&&n.datesHeader.off(s);n.element&&n.element.off(s);n.footer&&n.footer.remove();f.fn.destroy.call(this);this._isMobile()&&n.options.editable&&(n.options.editable.create!==!1&&(n._addUserEvents.destroy(),n._allDayUserEvents.destroy()),n.options.editable.update!==!1&&n._editUserEvents.destroy())},inRange:function(n){var t=f.fn.inRange.call(this,n),u=r(this.startTime()),e=r(this.endTime())||i.date.MS_PER_DAY,o=r(n.start),s=r(n.end)||i.date.MS_PER_DAY;return t&&u<=o&&s<=e},selectionByElement:function(n){var t=n.offset();return this._slotByPosition(t.left,t.top)},_timeSlotInterval:function(){var n=this.options;return n.majorTick/n.minorTickCount*v},_timeSlotIndex:function(n){var t=this.options,i=r(n),u=r(this.startTime()),f=t.majorTick/t.minorTickCount*v;return(i-u)/f},_slotIndex:function(n,t){return t?this._dateSlotIndex(n):this._timeSlotIndex(n)},_dateSlotIndex:function(n,t){for(var f=this._dates||[],s,h,r=0,e=f.length;r<e;r++)if(s=i.date.getDate(f[r]),h=new Date(i.date.getDate(f[r]).getTime()+u-(t?0:1)),o(n,s,h))return r*1;return-1},_positionAllDayEvent:function(t,i){var y=i.innerWidth(),r=i.start.index,o=i.end.index,c=f.collidingEvents(i.events(),r,o),p=this._headerColumnCount||0,w=r!==o?5:4,b=this._allDayHeaderHeight,k=i.startSlot(),u,l,e,a,h,s,v;for(t.css({left:k.offsetLeft+2,width:y-w}),i.addEvent({slotIndex:r,start:r,end:o,element:t}),c.push({slotIndex:r,start:r,end:o,element:t}),u=f.createRows(c),u.length&&u.length>p&&(this._headerColumnCount=u.length),l=i.start.offsetTop,e=0,a=u.length;e<a;e++)for(h=u[e].events,s=0,v=h.length;s<v;s++)n(h[s].element).css({top:l+e*b})},_arrangeColumns:function(n,t,i,r){var h=r.start,c,u,y,e,p;n={element:n,slotIndex:h.index,start:t,end:t+i};var o,l=h.clientWidth,a=l*.1,s,w=r.events(),v=f.collidingEvents(w,n.start,n.end);for(r.addEvent(n),v.push(n),o=f.createColumns(v),c=(l-a)/o.length,u=0,y=o.length;u<y;u++)for(s=o[u].events,e=0,p=s.length;e<p;e++)s[e].element[0].style.width=c-4+"px",s[e].element[0].style.left=(this._isRtl?a:0)+h.offsetLeft+u*c+2+"px"},_positionEvent:function(n,t,i){var f=n._startTime||n.start,e=n._endTime||n.end,r=i.innerRect(f,e,!1),u=r.bottom-r.top-2;u<0&&(u=0);t.css({top:r.top,height:u});this._arrangeColumns(t,r.top,t[0].clientHeight,i)},_createEventElement:function(t,f,s,c){var rt=f?this.eventTemplate:this.allDayEventTemplate,ut=this.options,p=ut.editable,ft=this._isMobile(),et=p&&p.destroy!==!1&&!ft,ot=p&&p.resize!==!1,d=e(this.startDate()),v=e(this.endDate()),g=r(this.startTime()),w=r(this.endTime()),b=t._time("start"),k=t._time("end"),it,a,l,y,nt,tt;return g>=w&&(w=r(new Date(this.endTime().getTime()+u-1))),f||t.isAllDay||(v=new Date(v.getTime()+u)),a=t.start,l=t.end,t.isAllDay&&(l=e(t.end)),!o(e(a),d,v)&&!o(l,d,v)||f&&b<g&&k>w?it=!0:e(a)<d||f&&b<g?c=!0:(l>v&&!f||f&&k>w)&&(s=!0),y=this.eventResources(t),t._startTime&&b!==i.date.getMilliseconds(t.start)&&(a=new Date(b),a=i.timezone.apply(a,"Etc/UTC")),t._endTime&&k!==i.date.getMilliseconds(t.end)&&(l=new Date(k),l=i.timezone.apply(l,"Etc/UTC")),nt=h({},{ns:i.ns,resizable:ot,showDelete:et,middle:it,head:s,tail:c,singleDay:this._dates.length==1,resources:y,inverseColor:y&&y[0]?this._shouldInverseResourceColor(y[0]):!1},t,{start:a,end:l}),tt=n(rt(nt)),this.angular("compile",function(){return{elements:tt,data:[{dataItem:nt}]}}),tt},_isInTimeSlot:function(n){var o=this.startTime(),t=this.endTime(),f=n._startTime||n.start,e=n._endTime||n.end,s;return(r(t)===r(i.date.getDate(t))&&(t=i.date.getDate(t),c(t,u-1)),n._date("end")>n._date("start")&&(e=+n._date("end")+(u-1)),e=e-n._date("end"),f=f-n._date("start"),t=r(t),o=r(o),o===f&&f===e)?!0:(s=f!==t,l(f,o,t,s)||l(e,o,t,s)||l(o,f,e)||l(t,f,e))},_isInDateSlot:function(n){var e=this.groups[0],t=e.firstSlot().start,f=e.lastSlot().end-1,r=i.date.toUtcTime(n.start),u=i.date.toUtcTime(n.end);return(o(r,t,f)||o(u,t,f)||o(t,r,u)||o(f,r,u))&&(!o(u,t,t)||o(u,r,r)||n.isAllDay)},_updateAllDayHeaderHeight:function(n){var i,t;if(this._height!==n&&(this._height=n,i=this.element.find(".k-scheduler-header-all-day td"),i.length))for(i.parent().add(this.element.find(".k-scheduler-times-all-day").parent()).height(n),t=0;t<this.groups.length;t++)this.groups[t].refresh()},_renderEvents:function(n,t){for(var d=this.datesHeader.find(".k-scheduler-header-wrap > div"),i,h,a,f,o,r,l,s,p,k,c=0,b=n.length;c<b;c++)if(i=n[c],this._isInDateSlot(i))if(h=i.isAllDay||i.end.getTime()-i.start.getTime()>=u,a=h&&!this._isVerticallyGrouped()?d:this.content,h)this.options.allDaySlot&&(r=this.groups[t],r._continuousEvents||(r._continuousEvents=[]),o=r.slotRanges(i),o.length&&(f=this._createEventElement(i,!h),this._positionAllDayEvent(f,o[0]),w(r,o[0],f,!0),f.appendTo(a)));else if(this._isInTimeSlot(i))for(r=this.groups[t],r._continuousEvents||(r._continuousEvents=[]),o=r.slotRanges(i),l=o.length,s=0;s<l;s++){var e=o[s],v=i.start,y=i.end;l>1&&(s===0?y=e.end.endDate():s==l-1?v=e.start.startDate():(v=e.start.startDate(),y=e.end.endDate()));p=i.clone({start:v,end:y,_startTime:i._startTime,_endTime:i.endTime});this._isInTimeSlot(p)&&(k=e.head,f=this._createEventElement(i,!h,k,e.tail),f.appendTo(a),this._positionEvent(p,f,e),w(r,e,f,!1))}},render:function(t){var r,f,s,u;for(this._headerColumnCount=0,this._groups(),this.element.find(".k-event").remove(),t=new i.data.Query(t).sort([{field:"start",dir:"asc"},{field:"end",dir:"desc"}]).toArray(),r=[],this._eventsByResource(t,this.groupedResources,r),f=n.map(this._dates,function(t){return Math.max.apply(null,n.map(r,function(i){return n.grep(i,function(n){return n.isMultiDay()&&o(t,e(n.start),e(n.end))}).length}))}),s=Math.max.apply(null,f),this._updateAllDayHeaderHeight((s+1)*this._allDayHeaderHeight),u=0;u<r.length;u++)this._renderEvents(r[u],u);this.refreshLayout();this.trigger("activate")},_eventsByResource:function(n,t,r){var u=t[0],o,e,h,s;if(u)for(o=u.dataSource.view(),e=0;e<o.length;e++)h=this._resourceValue(u,o[e]),s=new i.data.Query(n).filter({field:u.field,operator:f.groupEqFilter(h)}).toArray(),t.length>1?this._eventsByResource(s,t.slice(1),r):r.push(s);else r.push(n)},_columnOffsetForResource:function(n){return this._columnCountForLevel(n)/this._columnCountForLevel(n-1)},_columnCountForLevel:function(n){var t=this.columnLevels[n];return t?t.length:0},_rowCountForLevel:function(n){var t=this.rowLevels[n];return t?t.length:0},clearSelection:function(){this.content.add(this.datesHeader).find(".k-state-selected").removeAttr("id").attr("aria-selected",!1).removeClass("k-state-selected")},_updateDirection:function(n,t,i,r,u){var o=n.isAllDay,f=t[0].start,e=t[t.length-1].end;i&&(u?o||f.index!==e.index||f.collectionIndex!==e.collectionIndex||(n.backward=r):(o&&f.index===e.index||!o&&f.collectionIndex===e.collectionIndex)&&(n.backward=r))},_changeViewPeriod:function(n,t,i){var e;if(!i){var f=t?this.previousDate():this.nextDate(),o=n.start,s=n.end;return n.start=new Date(f),n.end=new Date(f),e=n.isAllDay?u:r(s),c(n.start,r(o)),c(n.end,e),this._isVerticallyGrouped()||(n.groupIndex=t?this.groups.length-1:0),n.events=[],!0}}});h(!0,y,{MultiDayView:a,DayView:a.extend({options:{name:"DayView",title:"Day"},name:"day"}),WeekView:a.extend({options:{name:"WeekView",title:"Week",selectedDateFormat:"{0:D} - {1:D}",selectedShortDateFormat:"{0:d} - {1:d}"},name:"week",calculateDateRange:function(){for(var f=this.options.date,n=i.date.dayOfWeek(f,this.calendarInfo().firstDay,-1),u=[],t=0,r=7;t<r;t++)u.push(n),n=i.date.nextDay(n);this._render(u)}}),WorkWeekView:a.extend({options:{name:"WorkWeekView",title:"Work Week",selectedDateFormat:"{0:D} - {1:D}",selectedShortDateFormat:"{0:d} - {1:d}"},name:"workWeek",nextDate:function(){return i.date.dayOfWeek(i.date.nextDay(this.startDate()),this.calendarInfo().firstDay,1)},previousDate:function(){var n=i.date.dayOfWeek(this.startDate(),this.calendarInfo().firstDay,-1);return i.date.previousDay(n)},calculateDateRange:function(){for(var u=this.options.date,t=i.date.dayOfWeek,f=t(u,this.calendarInfo().firstDay,-1),n=t(f,this.options.workWeekStart,1),e=t(n,this.options.workWeekEnd,1),r=[];n<=e;)r.push(n),n=i.date.nextDay(n);this._render(r)}})})})(window.kendo.jQuery)}(),function(){(function(n){function e(n){for(var i=0,t=0,r=n.length;t<r;t++)i+=n[t].items.length;return i}function o(n,i){return n.valuePrimitive&&(i=t.getter(n.dataValueField)(i)),i}function s(n){for(var r=0,f=n.length,t,i=[];r<f;r++)t=n[r],t.groups?(t=u(t.groups),i=i.concat(t)):i=i.concat(u(t.items));return i}function u(n){for(var i=[].concat(n),t=i.shift(),u=[],r=[].push;t;)t.groups?r.apply(i,t.groups):t.items?r.apply(i,t.items):r.call(u,t),t=i.shift();return u}var t=window.kendo,i=t.ui,r=".kendoAgendaView",f='<div class="k-task" title="#:title.replace(/"/g,"\'")#" data-#=kendo.ns#uid="#=uid#"># if (resources[0]) {#<span class="k-scheduler-mark" style="background-color:#=resources[0].color#"><\/span># } ## if (data.isException()) { #<span class="k-icon k-i-exception"><\/span># } else if (data.isRecurring()) {#<span class="k-icon k-i-refresh"><\/span># } #{0}#if (showDelete) {#<a href="\\#" class="k-link k-event-delete"><span class="k-icon k-si-close"><\/span><\/a>#}#<\/div>';i.AgendaView=i.SchedulerView.extend({init:function(u,e){i.SchedulerView.fn.init.call(this,u,e);e=this.options;e.editable&&(e.editable=n.extend({"delete":!0},e.editable,{create:!1,update:!1}));this.title=e.title;this.name="agenda";this._eventTemplate=this._eventTmpl(e.eventTemplate,f);this._dateTemplate=t.template(e.eventDateTemplate);this._groupTemplate=t.template(e.eventGroupTemplate);this._timeTemplate=t.template(e.eventTimeTemplate);this.element.on("mouseenter"+r,".k-scheduler-agenda .k-scheduler-content tr","_mouseenter").on("mouseleave"+r,".k-scheduler-agenda .k-scheduler-content tr","_mouseleave").on("click"+r,".k-scheduler-agenda .k-scheduler-content .k-link:has(.k-si-close)","_remove");this._renderLayout(e.date)},_mouseenter:function(t){n(t.currentTarget).addClass("k-state-hover")},_mouseleave:function(t){n(t.currentTarget).removeClass("k-state-hover")},_remove:function(i){i.preventDefault();this.trigger("remove",{uid:n(i.currentTarget).closest(".k-task").attr(t.attr("uid"))})},nextDate:function(){return t.date.nextDay(this.startDate())},startDate:function(){return this._startDate},endDate:function(){return this._endDate},previousDate:function(){return t.date.previousDay(this.startDate())},_renderLayout:function(n){this._startDate=n;this._endDate=t.date.addDays(n,7);this.createLayout(this._layout());this.table.addClass("k-scheduler-agenda")},_layout:function(){var n=[{text:this.options.messages.time,className:"k-scheduler-timecolumn"},{text:this.options.messages.event}],t,i,r;if(this._isMobilePhoneView()||n.splice(0,0,{text:this.options.messages.date,className:"k-scheduler-datecolumn"}),t=this.groupedResources,t.length){for(i=[],r=0;r<t.length;r++)i.push({text:"",className:"k-scheduler-groupcolumn"});n=i.concat(n)}return{columns:n}},_tasks:function(n){for(var e,o=[],s=0;s<n.length;s++){var f=n[s],r=f.start,u=f.end,h=(t.date.getDate(u)-t.date.getDate(r))/t.date.MS_PER_DAY+1,i=f.clone();if(i.startDate=t.date.getDate(r),i.startDate>=this.startDate()&&o.push(i),h>1)for(i.end=t.date.nextDay(r),i.head=!0,e=1;e<h;e++)r=i.end,i=f.clone(),i.start=r,i.startDate=t.date.getDate(r),i.end=t.date.nextDay(r),e==h-1?(i.end=new Date(i.start.getFullYear(),i.start.getMonth(),i.start.getDate(),u.getHours(),u.getMinutes(),u.getSeconds(),u.getMilliseconds()),i.tail=!0):(i.isAllDay=!0,i.middle=!0),(t.date.getDate(i.end)<=this.endDate()&&i.start>=this.startDate()||t.date.getDate(i.start).getTime()==this.endDate().getTime())&&o.push(i)}return new t.data.Query(o).sort([{field:"start",dir:"asc"},{field:"end",dir:"asc"}]).groupBy({field:"startDate"}).toArray()},_renderTaskGroups:function(n,i){for(var f,e,s=[],a=this.options.editable,p=a&&a.destroy!==!1&&!this._isMobile(),v=this._isMobilePhoneView(),u=0;u<n.length;u++){var h=n[u].value,c=n[u].items,y=t.date.isToday(h);for(f=0;f<c.length;f++){var r=c[f],o=[],l=v?[]:o;if(u===0&&f===0&&i.length)for(e=0;e<i.length;e++)l.push(t.format('<td class="k-scheduler-groupcolumn{2}" rowspan="{0}">{1}<\/td>',i[e].rowSpan,this._groupTemplate({value:i[e].text}),i[e].className));f===0&&(v?(l.push(t.format('<td class="k-scheduler-datecolumn" colspan="2">{0}<\/td>',this._dateTemplate({date:h}))),s.push('<tr role="row" aria-selected="false"'+(y?' class="k-today">':">")+l.join("")+"<\/tr>")):o.push(t.format('<td class="k-scheduler-datecolumn{3}{2}" rowspan="{0}">{1}<\/td>',c.length,this._dateTemplate({date:h}),u==n.length-1&&!i.length?" k-last":"",i.length?"":" k-first")));r.format=r.head?"{0:t}":r.tail?"{1:t}":"{0:t}-{1:t}";r.resources=this.eventResources(r);o.push(t.format('<td class="k-scheduler-timecolumn"><div>{0}{1}{2}<\/div><\/td><td>{3}<\/td>',r.tail||r.middle?'<span class="k-icon k-i-arrow-w"><\/span>':"",this._timeTemplate(r.clone({start:r._startTime||r.start,end:r.endTime||r.end})),r.head||r.middle?'<span class="k-icon k-i-arrow-e"><\/span>':"",this._eventTemplate(r.clone({showDelete:p}))));s.push('<tr role="row" aria-selected="false"'+(y?' class="k-today">':">")+o.join("")+"<\/tr>")}}return s.join("")},render:function(n){var i=this.content.find("table").empty(),t=[],r,u;n.length>0&&(r=this.groupedResources,r.length?(t=this._createGroupConfiguration(n,r,null),this._renderGroups(t,i,[])):(t=this._tasks(n),i.append(this._renderTaskGroups(t,[]))));u=this._eventsList=s(t);this._angularItems(i,u);this.refreshLayout();this.trigger("activate")},_angularItems:function(n,i){this.angular("compile",function(){var r=[],u=i.map(function(i){return r.push({dataItem:i}),n.find(".k-task["+t.attr("uid")+"="+i.uid+"]")});return{elements:u,data:r}})},_renderGroups:function(n,t,i){for(var u,r=0,f=n.length;r<f;r++)u=i.splice(0),u.push(n[r]),n[r].groups?this._renderGroups(n[r].groups,t,u):t.append(this._renderTaskGroups(n[r].items,u))},_createGroupConfiguration:function(n,r,u){for(var v,l,w,y,f,a,h=r[0],p=[],c=h.dataSource.view(),b=this._isMobilePhoneView(),s=0;s<c.length;s++)v=o(h,c[s]),l=new t.data.Query(n).filter({field:h.field,operator:i.SchedulerView.groupEqFilter(v)}).toArray(),l.length&&(w=this._tasks(l),y=u?"":" k-first",s===c.length-1&&(!u||u.className.indexOf("k-last")>-1)&&(y+=" k-last"),f={text:t.getter(h.dataTextField)(c[s]),value:v,rowSpan:0,className:y},r.length>1?(f.groups=this._createGroupConfiguration(l,r.slice(1),f),u&&(u.rowSpan+=f.rowSpan)):(f.items=w,a=e(f.items),b&&(a+=f.items.length),f.rowSpan=a,u&&(u.rowSpan+=a)),p.push(f));return p},selectionByElement:function(t){var r,i,u;if(t=n(t),!t.hasClass("k-scheduler-datecolumn")&&this._eventsList.length)return t.is(".k-task")&&(t=t.closest("td")),this._isMobile()?(u=t.parent(),r=u.parent().children().filter(function(){return n(this).children(":not(.k-scheduler-datecolumn)").length}).index(u)):r=t.parent().index(),i=this._eventsList[r],{index:r,start:i.start,end:i.end,isAllDay:i.isAllDay,uid:i.uid}},select:function(n){this.clearSelection();var t=this.table.find(".k-task").eq(n.index).closest("tr").addClass("k-state-selected").attr("aria-selected",!0)[0];this.current(t)},move:function(n,i){var u=!1,f=n.index,r;return i==t.keys.UP?(f--,u=!0):i==t.keys.DOWN&&(f++,u=!0),u&&(r=this._eventsList[f],r&&(n.start=r.start,n.end=r.end,n.isAllDay=r.isAllDay,n.events=[r.uid],n.index=f)),u},moveToEvent:function(){return!1},constrainSelection:function(n){var t=this._eventsList[0];t&&(n.start=t.start,n.end=t.end,n.isAllDay=t.isAllDay,n.events=[t.uid],n.index=0)},isInRange:function(){return!0},destroy:function(){this.element&&this.element.off(r);i.SchedulerView.fn.destroy.call(this)},options:{title:"Agenda",name:"agenda",editable:!0,selectedDateFormat:"{0:D}-{1:D}",selectedShortDateFormat:"{0:d} - {1:d}",eventTemplate:"#:title#",eventTimeTemplate:"#if(data.isAllDay) {##=this.options.messages.allDay##} else { ##=kendo.format(format, start, end)## } #",eventDateTemplate:'<strong class="k-scheduler-agendaday">#=kendo.toString(date, "dd")#<\/strong><em class="k-scheduler-agendaweek">#=kendo.toString(date,"dddd")#<\/em><span class="k-scheduler-agendadate">#=kendo.toString(date, "y")#<\/span>',eventGroupTemplate:'<strong class="k-scheduler-adgendagroup">#=value#<\/strong>',messages:{event:"Event",date:"Date",time:"Time",allDay:"all day"}}})})(window.kendo.jQuery)}(),function(){(function(n){function p(n,t){return n.slice(t).concat(n.slice(0,t))}function w(n,i){for(var u=i.firstDay,r=new Date(n.getFullYear(),n.getMonth(),0,n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds());r.getDay()!=u;)t.date.setTime(r,-1*c);return r}function u(n,t,i){var u=t,f=i,r;return r=n,r>=u&&r<=f}var t=window.kendo,o=t.ui,i=o.SchedulerView,r=".kendoMonthView",f=n.extend,s=t.date.getDate,c=t.date.MS_PER_DAY,h=6,e=7,l=t.template('<span class="k-link k-nav-day">#:kendo.toString(date, "dd")#<\/span>'),a='<div role="gridcell" aria-selected="false" data-#=ns#uid="#=uid#"#if (resources[0]) { #style="background-color:#=resources[0].color #; border-color: #=resources[0].color#"class="k-event#=inverseColor ? " k-event-inverse" : ""#"#} else {#class="k-event"#}#><span class="k-event-actions"># if(data.tail || data.middle) {#<span class="k-icon k-i-arrow-w"><\/span>#}## if(data.isException()) {#<span class="k-icon k-i-exception"><\/span># } else if(data.isRecurring()) {#<span class="k-icon k-i-refresh"><\/span>#}#<\/span>{0}<span class="k-event-actions">#if (showDelete) {#<a href="\\#" class="k-link k-event-delete"><span class="k-icon k-si-close"><\/span><\/a>#}## if(data.head || data.middle) {#<span class="k-icon k-i-arrow-e"><\/span>#}#<\/span># if(resizable && !data.tail && !data.middle) {#<span class="k-resize-handle k-resize-w"><\/span>#}## if(resizable && !data.head && !data.middle) {#<span class="k-resize-handle k-resize-e"><\/span>#}#<\/div>',v=t.template('<div title="#=title.replace(/"/g,"&\\#34;")#"><div class="k-event-template">#:title#<\/div><\/div>'),y=t.template('<div style="width:#=width#px;left:#=left#px;top:#=top#px" class="k-more-events k-button"><span>...<\/span><\/div>');o.MonthView=i.extend({init:function(n,t){var r=this;i.fn.init.call(r,n,t);r.title=r.options.title;r.name="month";r._templates();r._editable();r._renderLayout(r.options.date);r._groups()},_updateDirection:function(n,t,i,r,u){if(i){var e=t[0].start,o=t[t.length-1].end,s=e.index===o.index,f=e.collectionIndex===o.collectionIndex,h;h=u?s&&f||f:s&&f;h&&(n.backward=r)}},_changeViewPeriod:function(n,i,r){var u=r?7:1;return i&&(u*=-1),n.start=t.date.addDays(n.start,u),n.end=t.date.addDays(n.end,u),(!r||r&&this._isVerticallyGrouped())&&(n.groupIndex=i?this.groups.length-1:0),n.events=[],!0},_continuousSlot:function(n,t,i){var r=n.backward?0:t.length-1,u=this.groups[n.groupIndex];return u.continuousSlot(t[r].start,i)},_changeGroupContinuously:function(n,t,i,r){if(!i){var u=n.groupIndex,f=this.groups.length-1,e=this._isVerticallyGrouped(),o=this.groups[u];!t&&e?(t=o[r?"lastSlot":"firstSlot"](),u+=r?-1:1):t&&!e&&(u=r?f:0);(u<0||u>f)&&(u=r?f:0,t=null);n.groupIndex=u}return t},_normalizeHorizontalSelection:function(n,t,i){return i?t[0].start:t[t.length-1].end},_normalizeVerticalSelection:function(n,t){return n.backward?t[0].start:t[t.length-1].end},_templates:function(){var n=this.options,i=f({},t.Template,n.templateSettings);this.eventTemplate=this._eventTmpl(n.eventTemplate,a);this.dayTemplate=t.template(n.dayTemplate,i);this.groupHeaderTemplate=t.template(n.groupHeaderTemplate,i)},dateForTitle:function(){return t.format(this.options.selectedDateFormat,this._firstDayOfMonth,this._lastDayOfMonth)},shortDateForTitle:function(){return t.format(this.options.selectedShortDateFormat,this._firstDayOfMonth,this._lastDayOfMonth)},nextDate:function(){return t.date.nextDay(this._lastDayOfMonth)},previousDate:function(){return t.date.previousDay(this._firstDayOfMonth)},startDate:function(){return this._startDate},endDate:function(){return this._endDate},_renderLayout:function(i){var u=this;this._firstDayOfMonth=t.date.firstDayOfMonth(i);this._lastDayOfMonth=t.date.lastDayOfMonth(i);this._startDate=w(i,this.calendarInfo());this.createLayout(this._layout());this._content();this.refreshLayout();this.content.on("click"+r,".k-nav-day,.k-more-events",function(t){var i=n(t.currentTarget).offset(),r=u._slotByPosition(i.left,i.top);t.preventDefault();u.trigger("navigate",{view:"day",date:r.startDate()})})},_editable:function(){this.options.editable&&!this._isMobilePhoneView()&&(this._isMobile()?this._touchEditable():this._mouseEditable())},_mouseEditable:function(){var i=this;i.element.on("click"+r,".k-scheduler-monthview .k-event a:has(.k-si-close)",function(r){i.trigger("remove",{uid:n(this).closest(".k-event").attr(t.attr("uid"))});r.preventDefault()});if(i.options.editable.create!==!1)i.element.on("dblclick"+r,".k-scheduler-monthview .k-scheduler-content td",function(t){var u=n(t.currentTarget).offset(),r=i._slotByPosition(u.left,u.top),e;r&&(e=i._resourceBySlot(r),i.trigger("add",{eventInfo:f({isAllDay:!0,start:r.startDate(),end:r.startDate()},e)}));t.preventDefault()});if(i.options.editable.update!==!1)i.element.on("dblclick"+r,".k-scheduler-monthview .k-event",function(r){i.trigger("edit",{uid:n(this).closest(".k-event").attr(t.attr("uid"))});r.preventDefault()})},_touchEditable:function(){var i=this,r=0;t.support.mobileOS.android&&(r=5);i.options.editable.create!==!1&&(i._addUserEvents=new t.UserEvents(i.element,{threshold:r,filter:".k-scheduler-monthview .k-scheduler-content td",tap:function(t){var u=n(t.target).offset(),r=i._slotByPosition(u.left,u.top),e;r&&(e=i._resourceBySlot(r),i.trigger("add",{eventInfo:f({isAllDay:!0,start:r.startDate(),end:r.startDate()},e)}));t.preventDefault()}}));i.options.editable.update!==!1&&(i._editUserEvents=new t.UserEvents(i.element,{threshold:r,filter:".k-scheduler-monthview .k-event",tap:function(r){n(r.event.target).closest("a:has(.k-si-close)").length===0&&(i.trigger("edit",{uid:n(r.target).closest(".k-event").attr(t.attr("uid"))}),r.preventDefault())}}))},selectionByElement:function(t){var i=n(t).offset();return this._slotByPosition(i.left,i.top)},_columnCountForLevel:function(n){var t=this.columnLevels[n];return t?t.length:0},_rowCountForLevel:function(n){var t=this.rowLevels[n];return t?t.length:0},_content:function(){var t="<tbody>",i=1,r=this.groupedResources,n;for(r.length&&this._isVerticallyGrouped()&&(i=this._rowCountForLevel(r.length-1)),n=0;n<i;n++)t+=this._createCalendar(n);t+="<\/tbody>";this.content.find("table").html(t)},_createCalendar:function(n){var i=this.startDate(),p=e*h,r=e,s=[i],u="",c=1,l=this._isVerticallyGrouped(),a=this.groupedResources,f,v,y,o;for(a.length&&(l||(c=this._columnCountForLevel(a.length-1))),this._slotIndices={},f=0,v=p/r;f<v;f++){for(u+="<tr>",s.push(i),y=f*r,o=0;o<c;o++)u+=this._createRow(i,y,r,l?n:o);i=t.date.addDays(i,r);u+="<\/tr>"}return this._weekStartDates=s,this._endDate=t.date.previousDay(i),u},_createRow:function(n,i,r,u){for(var e=this,c=e._firstDayOfMonth,l=e._lastDayOfMonth,a=e.dayTemplate,o="",f="",v=function(){return e._resourceBySlot({groupIndex:u})},h=0;h<r;h++)o="",t.date.isToday(n)&&(o+="k-today"),t.date.isInDateRange(n,c,l)||(o+=" k-other-month"),f+="<td ",o!==""&&(f+='class="'+o+'"'),f+=">",f+=a({date:n,resources:v}),f+="<\/td>",e._slotIndices[s(n).getTime()]=i+h,n=t.date.nextDay(n);return f},_layout:function(){var t=this.calendarInfo(),o=this._isMobile()?t.days.namesShort:t.days.names,s=p(o,t.firstDay),i=n.map(s,function(n){return{text:n}}),r=this.groupedResources,e,u,f;if(r.length)if(this._isVerticallyGrouped()){for(u=[],f=0;f<6;f++)u.push({text:"<div>&nbsp;<\/div>",className:"k-hidden k-slot-cell"});e=this._createRowsLayout(r,u,this.groupHeaderTemplate)}else i=this._createColumnsLayout(r,i,this.groupHeaderTemplate);return{columns:i,rows:e}},_createEventElement:function(i){var e=this.options,r=e.editable,f=this._isMobile(),u;return i.showDelete=r&&r.destroy!==!1&&!f,i.resizable=r&&r.resize!==!1&&!f,i.ns=t.ns,i.resources=this.eventResources(i),i.inverseColor=i.resources&&i.resources[0]?this._shouldInverseResourceColor(i.resources[0]):!1,u=n(this.eventTemplate(i)),this.angular("compile",function(){return{elements:u,data:[{dataItem:i}]}}),u},_isInDateSlot:function(n){var o=this.groups[0],i=o.firstSlot().start,e=o.lastSlot().end-1,r=t.date.toUtcTime(n.start),f=t.date.toUtcTime(n.end);return(u(r,i,e)||u(f,i,e)||u(i,r,f)||u(e,r,f))&&(!u(f,i,i)||u(f,r,r)||n.isAllDay)},_slotIndex:function(n){return this._slotIndices[s(n).getTime()]},_positionMobileEvent:function(r,u,f){var e=r.start;r.start.offsetLeft>r.end.offsetLeft&&(e=r.end);var o=r.start.index,h=o,c=i.collidingEvents(r.events(),o,h);c.push({element:u,start:o,end:h});var a=i.createRows(c),l=r.collection.at(o),s=l.container;s||(s=n(t.format('<div class="k-events-container" style="top:{0};left:{1};width:{2}"/>',e.offsetTop+e.firstChildTop+e.firstChildHeight-3+"px",e.offsetLeft+"px",e.offsetWidth+"px")),l.container=s,this.content[0].appendChild(s[0]));a.length<=3&&(r.addEvent({element:u,start:o,end:h,groupIndex:e.groupIndex}),f._continuousEvents.push({element:u,uid:u.attr(t.attr("uid")),start:r.start,end:r.end}),s[0].appendChild(u[0]))},_positionEvent:function(r,u,f){var w=this.options.eventHeight,o=r.start,v,s,d,b,g,p,nt,h,tt,e;r.start.offsetLeft>r.end.offsetLeft&&(o=r.end);var c=r.start.index,l=r.end.index,a=o.eventCount,k=i.collidingEvents(r.events(),c,l),it=c!==l?5:4;for(k.push({element:u,start:c,end:l}),v=i.createRows(k),s=0,d=Math.min(v.length,a);s<d;s++)for(b=v[s].events,g=o.offsetTop+o.firstChildHeight+s*w+3*s+"px",p=0,nt=b.length;p<nt;p++)b[p].element[0].style.top=g;if(v.length>a)for(h=c;h<=l;h++){if(tt=r.collection,e=tt.at(h),e.more)return;e.more=n(y({ns:t.ns,start:h,end:h,width:e.clientWidth-2,left:e.offsetLeft+2,top:e.offsetTop+e.firstChildHeight+a*w+3*a}));this.content[0].appendChild(e.more[0])}else r.addEvent({element:u,start:c,end:l,groupIndex:o.groupIndex}),u[0].style.width=r.innerWidth()-it+"px",u[0].style.left=o.offsetLeft+2+"px",u[0].style.height=w+"px",f._continuousEvents.push({element:u,uid:u.attr(t.attr("uid")),start:r.start,end:r.end}),u.appendTo(this.content)},_slotByPosition:function(n,t){var u=this.content.offset(),i,r;for(n-=u.left,t-=u.top,t+=this.content[0].scrollTop,n+=this.content[0].scrollLeft,n=Math.ceil(n),t=Math.ceil(t),i=0;i<this.groups.length;i++)if(r=this.groups[i].daySlotByPosition(n,t),r)return r;return null},_createResizeHint:function(n){var r=n.startSlot().offsetLeft,u=n.start.offsetTop,f=n.innerWidth(),e=n.start.clientHeight-2,t=i.fn._createResizeHint.call(this,r,u,f,e);t.appendTo(this.content);this._resizeHint=this._resizeHint.add(t)},_updateResizeHint:function(n,i,r,u){var o,e,f;for(this._removeResizeHint(),o=this.groups[i],e=o.ranges(r,u,!0,n.isAllDay),f=0;f<e.length;f++)this._createResizeHint(e[f]);this._resizeHint.find(".k-label-top,.k-label-bottom").text("");this._resizeHint.first().addClass("k-first").find(".k-label-top").text(t.toString(t.timezone.toLocalDate(r),"M/dd"));this._resizeHint.last().addClass("k-last").find(".k-label-bottom").text(t.toString(t.timezone.toLocalDate(u),"M/dd"))},_updateMoveHint:function(n,i,r){var s=t.date.toUtcTime(n.start)+r,c=s+n.duration(),l=this.groups[i],h=l.ranges(s,c,!0,n.isAllDay),f;for(this._removeMoveHint(),f=0;f<h.length;f++){var u=h[f],e=u.startSlot(),a=u.endSlot(),o=this._createEventElement(n.clone({head:u.head,tail:u.tail}));o.css({left:e.offsetLeft+2,top:e.offsetTop+e.firstChildHeight,height:this.options.eventHeight,width:u.innerWidth()-(e.index!==a.index?5:4)});o.addClass("k-event-drag-hint");o.appendTo(this.content);this._moveHint=this._moveHint.add(o)}},_groups:function(){var p=this._groupCount(),a=e,w=h,o,b,u,n,f,s,c,l,d;for(this.groups=[],o=0;o<p;o++)this._addResourceView(o);for(b=this.content[0].getElementsByTagName("tr"),u=this.startDate(),n=0;n<p;n++)for(f=0,s=0,this._isVerticallyGrouped()&&(s=n),c=s*w;c<(s+1)*w;c++){var g=this.groups[n],nt=g.addDaySlotCollection(t.date.addDays(u,f),t.date.addDays(this.startDate(),f+a)),k=b[c],tt=k.children,v=0;for(k.setAttribute("role","row"),this._isVerticallyGrouped()||(v=n),l=v*a;l<(v+1)*a;l++){var i=tt[l],it=i.clientHeight,rt=i.children.length?i.children[0].offsetHeight+3:0,r=t.date.addDays(u,f),y=t.date.MS_PER_DAY;u.getHours()!==r.getHours()&&(y+=(u.getHours()-r.getHours())*t.date.MS_PER_HOUR);r=t.date.toUtcTime(r);y+=r;f++;d=Math.floor((it-rt-this.options.moreButtonHeight)/(this.options.eventHeight+3));i.setAttribute("role","gridcell");i.setAttribute("aria-selected",!1);nt.addDaySlot(i,r,y,d)}}},render:function(n){this.content.children(".k-event,.k-more-events,.k-events-container").remove();this._groups();n=new t.data.Query(n).sort([{field:"start",dir:"asc"},{field:"end",dir:"desc"}]).toArray();var i=this.groupedResources;i.length?this._renderGroups(n,i,0,1):this._renderEvents(n,0);this.refreshLayout();this.trigger("activate")},_renderEvents:function(n,t){for(var r,v=this._isMobilePhoneView(),u,s,o,f,l,e=0,a=n.length;e<a;e++)if(r=n[e],this._isInDateSlot(r))for(u=this.groups[t],u._continuousEvents||(u._continuousEvents=[]),s=u.slotRanges(r,!0),o=s.length,f=0;f<o;f++){var i=s[f],h=r.start,c=r.end;o>1&&(f===0?c=i.end.endDate():f==o-1?h=i.start.startDate():(h=i.start.startDate(),c=i.end.endDate()));l=r.clone({start:h,end:c,head:i.head,tail:i.tail});v?this._positionMobileEvent(i,this._createEventElement(l),u):this._positionEvent(i,this._createEventElement(l),u)}},_renderGroups:function(n,r,u,f){var e=r[0],s,o,c,h;if(e)for(s=e.dataSource.view(),o=0;o<s.length;o++)c=this._resourceValue(e,s[o]),h=new t.data.Query(n).filter({field:e.field,operator:i.groupEqFilter(c)}).toArray(),r.length>1?u=this._renderGroups(h,r.slice(1),u++,f+1):this._renderEvents(h,u++);return u},_groupCount:function(){var n=this.groupedResources;return n.length?this._isVerticallyGrouped()?this._rowCountForLevel(n.length-1):this._columnCountForLevel(n.length)/this._columnOffsetForResource(n.length):1},_columnOffsetForResource:function(n){return this._columnCountForLevel(n)/this._columnCountForLevel(n-1)},destroy:function(){this.table&&this.table.removeClass("k-scheduler-monthview");this.content&&this.content.off(r);this.element&&this.element.off(r);i.fn.destroy.call(this);this._isMobile()&&!this._isMobilePhoneView()&&this.options.editable&&(this.options.editable.create!==!1&&this._addUserEvents.destroy(),this.options.editable.update!==!1&&this._editUserEvents.destroy())},events:["remove","add","edit","navigate"],options:{title:"Month",name:"month",eventHeight:25,moreButtonHeight:13,editable:!0,selectedDateFormat:"{0:y}",selectedShortDateFormat:"{0:y}",groupHeaderTemplate:"#=text#",dayTemplate:l,eventTemplate:v}})})(window.kendo.jQuery)}(),function(){(function(n,t){function y(n,t){var i;return n!==0&&n<t?i=t-n:(i=n%t,i&&(i=t-i)),i}function vt(n){var t=n.getMonth(),i=wt(n)?ri[t]:ui[t];return i+n.getDate()}function b(n,i){var u,f;return n=new Date(n.getFullYear(),n.getMonth(),n.getDate()),r(n,0),u=n.getFullYear(),i!==t?(s(n,i,-1),n.setDate(n.getDate()+4)):n.setDate(n.getDate()+(4-(n.getDay()||7))),r(n,0),f=Math.floor((n.getTime()-new Date(u,0,1,-6))/864e5),1+Math.floor(f/7)}function h(n,t){var r=ii(n).getDay(),i=7-(r+7-(t||7))||7;return i<0&&(i+=7),Math.ceil((n.getDate()-i)/7)+1}function p(n,t){return n+(n<t?7:0)}function yt(n,t,i){var r=t.offset;if(!r)return h(n,i);var f=new Date(n.getFullYear(),n.getMonth()+1,0),u=h(f,i),e=p(t.day,i),o=e<p(new Date(n.getFullYear(),n.getMonth(),1).getDay(),i),s=e>p(f.getDay(),i);return(r<0?r=u+(r+1-(s?1:0)):o&&(r+=1),u-=s?1:0,r<(o?1:0)||r>u)?null:r}function pt(n,t){return h(new Date(n.getFullYear(),n.getMonth()+1,0),t)}function vi(n,t,i){return h(n,i)===yt(n,t,i)}function yi(n,t,i){for(var c=p(t.getDay(),i),l=n.length,u,r,f,e,o=[],s=0;s<l;s++)if(r=n[s],e=h(t,i),u=yt(t,r,i),u!==null)if(e<u)o.push(r);else if(e===u)if(f=p(r.day,i),c<f)o.push(r);else if(c===f)return null;return o}function c(n,t,i){for(var u=0,e=n.length,f=[],r;u<e;u++){if(r=n[u],i&&(r=i(r)),t===r)return null;t<r&&f.push(r)}return f}function o(n,t){for(var r=0,u=n.length,i;r<u;r++){if(i=parseInt(n[r],10),isNaN(i)||i<t.start||i>t.end||i===0&&t.start<0)return null;n[r]=i}return n.sort(k)}function pi(n){for(var r=0,e=n.length,u,f,i;r<e;r++){if(u=n[r],f=u.length,i=u.substring(f-2).toUpperCase(),i=st[i],i===t)return null;n[r]={offset:parseInt(u.substring(0,f-2),10)||0,day:i}}return n}function wi(n){for(var r=0,f=n.length,t,i,u=[];r<f;r++)t=n[r],typeof t=="string"?i=t:(i=""+ot[t.day],t.offset&&(i=t.offset+i)),u.push(i);return u.toString()}function bi(n){var t=n.getMonth();return t===1?new Date(n.getFullYear(),1,29).getMonth()===1?29:28:fi[t]}function wt(n){return n=n.getFullYear(),n%4==0&&n%100!=0||n%400==0}function k(n,t){return n-t}function bt(n,t){var i=0,u,r,f=[];if(n)for(n=n.split(";"),u=n.length;i<u;i++)r=tt(n[i],t),r&&f.push(r);return f}function kt(t,i,r){for(var f=n.isArray(t)?t:bt(t,r),e=i.getTime()-i.getMilliseconds(),u=0,o=f.length;u<o;u++)if(f[u].getTime()===e)return!0;return!1}function dt(n,t){for(var u=0,r,f=[].concat(n),e=f.length;u<e;u++)r=f[u],r=i.timezone.convert(r,t||r.getTimezoneOffset(),"Etc/UTC"),f[u]=i.toString(r,oi);return f.join(";")+";"}function ki(n,t){var i=new Date(n);switch(t.freq){case"yearly":i.setFullYear(i.getFullYear(),0,1);break;case"monthly":i.setFullYear(i.getFullYear(),i.getMonth(),1);break;case"weekly":s(i,t.weekStart,-1)}return t.hours&&i.setHours(0),t.minutes&&i.setMinutes(0),t.seconds&&i.setSeconds(0),i}function nt(n,t){var i=new Date(n);switch(t.freq){case"yearly":i.setFullYear(i.getFullYear(),11,31);break;case"monthly":i.setFullYear(i.getFullYear(),i.getMonth()+1,0);break;case"weekly":s(i,t.weekStart,-1);i.setDate(i.getDate()+6)}return t.hours&&i.setHours(23),t.minutes&&i.setMinutes(59),t.seconds&&i.setSeconds(59),i}function di(n,t,i){for(var e=n.slice(i._startIdx),h=e.length,o=i.positions,s=[],r,u,f=0,c=o.length;f<c;f++)r=o[f],r<0?r=h+r:r-=1,u=e[r],u&&u.start>=t&&s.push(u);return n=n.slice(0,i._startIdx).concat(s),i._startIdx=n.length,n}function gi(n,i,r,f){var e=d(n.recurrenceRule,f),a,rt,k,h,ut,ft,et,ot,st,g,tt,ht,y,p,ct,it,o,c,s,w,b,l=[],lt;if(!e)return[n];for(w=e.positions,b=w?0:1,g=e.start,tt=e.end,(g||tt)&&(n=n.clone({start:g?new Date(g.value[0]):t,end:tt?new Date(tt.value[0]):t})),o=n.start,it=o.getTime(),ct=v(o),p=bt(n.recurrenceException,f),!p[0]&&e.exdates&&(p=e.exdates.value,n.set("recurrenceException",dt(p,f))),ot=i=new Date(i),r=new Date(r),y=e.freq,s=ai[y],c=e.count,e.until&&e.until<r&&(r=new Date(e.until)),ht=y==="yearly"||y==="monthly"||y==="weekly",i<it||c||e.interval>1||ht?i=new Date(it):(h=i.getHours(),ut=i.getMinutes(),ft=i.getSeconds(),e.hours||(h=o.getHours()),e.minutes||(ut=o.getMinutes()),e.seconds||(ft=o.getSeconds()),i.setHours(h,ut,ft,o.getMilliseconds())),e._startPeriod=new Date(i),w&&(i=ki(i,e),r=nt(r,e),lt=v(r)-v(i),lt<0&&(h=i.getHours(),r.setHours(h,i.getMinutes(),i.getSeconds(),i.getMilliseconds()),u.adjustDST(r,h)),e._startPeriod=new Date(i),e._endPeriod=nt(i,e),e._startIdx=0),et=n.duration(),e._startTime=a=u.toInvariantTime(i),s.setup&&s.setup(e,o,i),s.limit(i,r,e);i<=r;)if(k=new Date(i),ti(k,et),st=i>=ot||k>ot,(st&&!kt(p,i,f)||w)&&(a=u.toUtcTime(u.getDate(i))+v(e._startTime),rt=a+et,it!==i.getTime()||ct!==v(e._startTime)?l.push(n.toOccurrence({start:new Date(i),end:k,_startTime:a,_endTime:rt})):(n._startTime=a,n._endTime=rt,l.push(n))),w){if(s.next(i,e),s.limit(i,r,e),i>e._endPeriod&&(l=di(l,o,e),e._endPeriod=nt(i,e),b=l.length),c&&c===b)break}else{if(c&&c===b)break;b++;s.next(i,e);s.limit(i,r,e)}return l}function tt(n,t){return n=i.parseDate(n,ei),n&&t&&(n=g.convert(n,n.getTimezoneOffset(),t)),n}function it(n,t){for(var s=n.split(";"),f,u,i,e,r,h,o=0,c=s.length;o<c;o++)if(f=s[o].split(":"),u=f[0],i=f[1],u.indexOf("TZID")!==-1&&(e=u.substring(u.indexOf("TZID")).split("=")[1]),i)for(i=i.split(","),r=0,h=i.length;r<h;r++)i[r]=tt(i[r],e||t);if(i)return{value:i,tzid:e}}function d(r,u){var f={},p,e,c=0,y,h=!1,l,s,a,b,v,w,k=function(n,t){var i=n.day,r=t.day;return i<v&&(i+=7),r<v&&(r+=7),i-r};if(!r)return null;for(a=r.split("\n"),a[1]||r.indexOf("DTSTART")===-1&&r.indexOf("DTEND")===-1&&r.indexOf("EXDATE")===-1||(a=r.split(" ")),c=0,y=a.length;c<y;c++)s=n.trim(a[c]),s.indexOf("DTSTART")!==-1?f.start=it(s,u):s.indexOf("DTEND")!==-1?f.end=it(s,u):s.indexOf("EXDATE")!==-1?f.exdates=it(s,u):s.indexOf("RRULE")!==-1?l=s.substring(6):n.trim(s)&&(l=s);for(l=l.split(";"),c=0,y=l.length;c<y;c++){b=l[c];p=b.split("=");e=n.trim(p[1]).split(",");switch(n.trim(p[0]).toUpperCase()){case"FREQ":f.freq=e[0].toLowerCase();break;case"UNTIL":f.until=tt(e[0],u);break;case"COUNT":f.count=parseInt(e[0],10);break;case"INTERVAL":f.interval=parseInt(e[0],10);break;case"BYSECOND":f.seconds=o(e,{start:0,end:60});h=!0;break;case"BYMINUTE":f.minutes=o(e,{start:0,end:59});h=!0;break;case"BYHOUR":f.hours=o(e,{start:0,end:23});h=!0;break;case"BYMONTHDAY":f.monthDays=o(e,{start:-31,end:31});h=!0;break;case"BYYEARDAY":f.yearDays=o(e,{start:-366,end:366});h=!0;break;case"BYMONTH":f.months=o(e,{start:1,end:12});h=!0;break;case"BYDAY":f.weekDays=w=pi(e);h=!0;break;case"BYWEEKNO":f.weeks=o(e,{start:-53,end:53});h=!0;break;case"BYSETPOS":f.positions=o(e,{start:-366,end:366});break;case"WKST":f.weekStart=v=st[e[0]]}}return f.freq===t||f.count!==t&&f.until?null:(f.interval||(f.interval=1),v===t&&(f.weekStart=v=i.culture().calendar.firstDay),w&&(f.weekDays=w.sort(k)),f.positions&&!h&&(f.positions=null),f._hasRuleValue=h,f)}function rt(n,t){for(var f=n.value,r=n.tzid||"",o=f.length,e=0,u;e<o;e++)u=f[e],u=g.convert(u,r||t||u.getTimezoneOffset(),"Etc/UTC"),f[e]=i.toString(u,"yyyyMMddTHHmmssZ");return r&&(r=";TZID="+r),r+":"+f.join(",")+" "}function ut(n,r){var h=n.weekStart,u="FREQ="+n.freq.toUpperCase(),f=n.exdates||"",e=n.start||"",o=n.end||"",s=n.until;return n.interval>1&&(u+=";INTERVAL="+n.interval),n.count&&(u+=";COUNT="+n.count),s&&(s=g.convert(s,r||s.getTimezoneOffset(),"Etc/UTC"),u+=";UNTIL="+i.toString(s,"yyyyMMddTHHmmssZ")),n.months&&(u+=";BYMONTH="+n.months),n.weeks&&(u+=";BYWEEKNO="+n.weeks),n.yearDays&&(u+=";BYYEARDAY="+n.yearDays),n.monthDays&&(u+=";BYMONTHDAY="+n.monthDays),n.weekDays&&(u+=";BYDAY="+wi(n.weekDays)),n.hours&&(u+=";BYHOUR="+n.hours),n.minutes&&(u+=";BYMINUTE="+n.minutes),n.seconds&&(u+=";BYSECOND="+n.seconds),n.positions&&(u+=";BYSETPOS="+n.positions),h!==t&&(u+=";WKST="+ot[h]),e&&(e="DTSTART"+rt(e,r)),o&&(o="DTEND"+rt(o,r)),f&&(f="EXDATE"+rt(f,r)),(e||o||f)&&(u=e+o+f+"RRULE:"+u),u}var i=window.kendo,g=i.timezone,ni=i.Class,w=i.ui,et=w.Widget,a=w.DropDownList,u=i.date,ti=u.setTime,s=u.setDayOfWeek,r=u.adjustDST,ii=u.firstDayOfMonth,v=u.getMilliseconds,ri=[0,31,60,91,121,152,182,213,244,274,305,335,366],ui=[0,31,59,90,120,151,181,212,243,273,304,334,365],fi=[31,28,30,31,30,31,30,31,30,31,30,31],ot={0:"SU",1:"MO",2:"TU",3:"WE",4:"TH",5:"FR",6:"SA"},st={SU:0,MO:1,TU:2,WE:3,TH:4,FR:5,SA:6},ei=["yyyy-MM-ddTHH:mm:ss.fffzzz","yyyy-MM-ddTHH:mm:sszzz","yyyy-MM-ddTHH:mm:ss","yyyy-MM-ddTHH:mm","yyyy-MM-ddTHH","yyyy-MM-dd","yyyyMMddTHHmmssfffzzz","yyyyMMddTHHmmsszzz","yyyyMMddTHHmmss","yyyyMMddTHHmm","yyyyMMddTHH","yyyyMMdd"],ht=["months","weeks","yearDays","monthDays","weekDays","hours","minutes","seconds"],ct=ht.length,oi="yyyyMMddTHHmmssZ",si={months:function(n,t,i){var u=i.months,r=c(u,n.getMonth()+1),f=!1;return r!==null&&(r.length?n.setMonth(r[0]-1,1):n.setFullYear(n.getFullYear()+1,u[0]-1,1),f=!0),f},monthDays:function(n,t,i){for(var o,u,f,e=!1,s=n.getHours(),h=function(n){return n<0&&(n=o+n),n};n<=t;){if(u=n.getMonth(),o=bi(n),f=c(i.monthDays,n.getDate(),h),f===null)return e;if(e=!0,f.length){if(n.setMonth(u,f.sort(k)[0]),r(n,s),u===n.getMonth())break}else n.setMonth(u+1,1)}return e},yearDays:function(n,t,i){for(var u,f,e=!1,o=n.getHours(),s=function(n){return n<0&&(n=u+n),n};n<t;){if(u=wt(n)?366:365,f=c(i.yearDays,vt(n),s),f===null)return e;if(e=!0,u=n.getFullYear(),f.length){n.setFullYear(u,0,f.sort(k)[0]);r(n,o);break}else n.setFullYear(u+1,0,1)}return e},weeks:function(n,t,i){for(var o=i.weekStart,f,u,h,e=!1,l=n.getHours(),a=function(n){return n<0&&(n=53+n),n};n<t;){if(u=c(i.weeks,b(n,o),a),u===null)return e;if(e=!0,f=n.getFullYear(),u.length){h=u.sort(k)[0]*7-1;n.setFullYear(f,0,h);s(n,o,-1);r(n,l);break}else n.setFullYear(f+1,0,1)}return e},weekDays:function(n,t,i){var o=i.weekDays,u=i.weekStart,c=yi(o,n,u),l=n.getHours(),f,e;if(c===null)return!1;if(f=c[0],f||(f=o[0],s(n,u)),e=f.day,f.offset)while(n<=t&&!vi(n,f,u))h(n,u)===pt(n,u)?(n.setMonth(n.getMonth()+1,1),r(n,l)):(n.setDate(n.getDate()+7),r(n,l),s(n,u,-1));return n.getDay()!==e&&s(n,e),!0},hours:function(n,t,i){var e=i.hours,o=i._startTime,f=o.getHours(),u=c(e,f),s=!1;return u!==null&&(s=!0,n.setHours(f),r(n,f),u.length?(u=u[0],n.setHours(u)):(u=n.getHours(),n.setDate(n.getDate()+1),r(n,u),u=e[0],n.setHours(u),r(n,u)),i.minutes&&n.setMinutes(0),o.setHours(u,n.getMinutes())),s},minutes:function(n,t,i){var e=i.minutes,s=n.getMinutes(),u=c(e,s),f=i._startTime.getHours(),o=!1;return u!==null&&(o=!0,u.length?u=u[0]:(f+=1,u=e[0]),i.seconds&&n.setSeconds(0),n.setHours(f,u),f=f%24,r(n,f),i._startTime.setHours(f,u,n.getSeconds())),o},seconds:function(n,t,i){var e=i.seconds,u=i._startTime.getHours(),f=c(e,n.getSeconds()),r=n.getMinutes(),o=!1;return f!==null&&(o=!0,f.length?n.setSeconds(f[0]):(r+=1,n.setMinutes(r,e[0]),r>59&&(r=r%60,u=(u+1)%24)),i._startTime.setHours(u,r,n.getSeconds())),o}},e=ni.extend({next:function(n,t){var i=t._startTime,f=i.getDate(),r,u;if(t.seconds)u=n.getSeconds()+1,n.setSeconds(u),i.setSeconds(u),i.setDate(f);else if(t.minutes)r=n.getMinutes()+1,n.setMinutes(r),i.setMinutes(r),i.setDate(f);else return!1;return!0},normalize:function(n){var t=n.rule;n.idx===4&&t.hours&&(t._startTime.setHours(0),this._hour(n.date,t))},limit:function(n,i,r){for(var h=r.interval,e,o,f,u,s;n<=i;){for(f=o=t,s=n.getDate(),u=0;u<ct;u++){if(e=ht[u],r[e])if(f=si[e](n,i,r),o!==t&&f)break;else o=f;f&&this.normalize({date:n,rule:r,day:s,idx:u})}if((h===1||!this.interval(r,n))&&u===ct)break}},interval:function(n,t){var o=new Date(n._startPeriod),e=new Date(t),h=t.getHours(),p=n.weekStart,c=n.interval,l=n.freq,s=!1,i=0,w=0,a=1,f,v;return l==="hourly"?(f=e.getTimezoneOffset()-o.getTimezoneOffset(),v=n._startTime.getHours(),e=e.getTime(),h!==v&&(e+=(v-h)*u.MS_PER_HOUR),e-=o,f&&(e-=f*u.MS_PER_MINUTE),f=Math.floor(e/u.MS_PER_HOUR),i=y(f,c),i!==0&&(this._hour(t,n,i),s=!0)):l==="daily"?(u.setTime(e,-o),f=Math.floor(e/u.MS_PER_DAY),i=y(f,c),i!==0&&(this._date(t,n,i),s=!0)):l==="weekly"?(f=(t.getFullYear()-o.getFullYear())*52,i=b(t,p)-b(o,p)+f,i=y(i,c),i!==0&&(u.setDayOfWeek(t,n.weekStart,-1),t.setDate(t.getDate()+i*7),r(t,h),s=!0)):l==="monthly"?(f=t.getFullYear()-o.getFullYear(),f=t.getMonth()-o.getMonth()+f*12,i=y(f,c),i!==0&&(a=n._hasRuleValue?1:t.getDate(),t.setFullYear(t.getFullYear(),t.getMonth()+i,a),r(t,h),s=!0)):l==="yearly"&&(f=t.getFullYear()-o.getFullYear(),i=y(f,c),n.months||(w=t.getMonth()),n.yearDays||n.monthDays||n.weekDays||(a=t.getDate()),i!==0&&(t.setFullYear(t.getFullYear()+i,w,a),r(t,h),s=!0)),s},_hour:function(n,t,i){var f=t._startTime,u=f.getHours();i&&(u+=i);n.setHours(u);u=u%24;f.setHours(u);r(n,u)},_date:function(n,t,i){var u=n.getHours();n.setDate(n.getDate()+i);r(n,u)||this._hour(n,t)}}),hi=e.extend({next:function(n,t){e.fn.next(n,t)||this._hour(n,t,1)},normalize:function(n){var t=n.rule;n.idx===4&&(t._startTime.setHours(0),this._hour(n.date,t))}}),lt=e.extend({next:function(n,t){e.fn.next(n,t)||this[t.hours?"_hour":"_date"](n,t,1)}}),ci=lt.extend({setup:function(n,t){n.weekDays||(n.weekDays=[{day:t.getDay(),offset:0}])}}),at=e.extend({next:function(n,t){var i,u;if(!e.fn.next(n,t))if(t.hours)this._hour(n,t,1);else if(t.monthDays||t.weekDays||t.yearDays||t.weeks)this._date(n,t,1);else{for(i=n.getDate(),u=n.getHours(),n.setMonth(n.getMonth()+1),r(n,u);n.getDate()!==i;)n.setDate(i),r(n,u);this._hour(n,t)}},normalize:function(n){var i=n.rule,t=n.date,u=t.getHours();n.idx!==0||i.monthDays||i.weekDays?e.fn.normalize(n):(t.setDate(n.day),r(t,u))},setup:function(n,t,i){n.monthDays||n.weekDays||i.setDate(t.getDate())}}),li=at.extend({next:function(n,t){var i,u=n.getHours();if(!e.fn.next(n,t))if(t.hours)this._hour(n,t,1);else if(t.monthDays||t.weekDays||t.yearDays||t.weeks)this._date(n,t,1);else if(t.months){for(i=n.getDate(),n.setMonth(n.getMonth()+1),r(n,u);n.getDate()!==i;)n.setDate(i),r(n,u);this._hour(n,t)}else n.setFullYear(n.getFullYear()+1),r(n,u),this._hour(n,t)},setup:function(){}}),ai={hourly:new hi,daily:new lt,weekly:new ci,monthly:new at,yearly:new li},f="click";i.recurrence={rule:{parse:d,serialize:ut},expand:gi,dayInYear:vt,weekInYear:b,weekInMonth:h,numberOfWeeks:pt,isException:kt,toExceptionString:dt};var gt=function(n){for(var r=i.culture().calendar.days.namesShort,f=r.length,e="",t=0,u=[];t<f;t++)u.push(t);for(r=r.slice(n).concat(r.slice(0,n)),u=u.slice(n).concat(u.slice(0,n)),t=0;t<f;t++)e+='<label class="k-check"><input class="k-recur-weekday-checkbox" type="checkbox" value="'+u[t]+'" /> '+r[t]+"<\/label>";return e},nr=i.template('# if (frequency !== "never") { #<div class="k-edit-label"><label>#:messages.repeatEvery#<\/label><\/div><div class="k-edit-field"><input class="k-recur-interval"/>#:messages.interval#<\/div># } ## if (frequency === "weekly") { #<div class="k-edit-label"><label>#:messages.repeatOn#<\/label><\/div><div class="k-edit-field">#=weekDayCheckBoxes(firstWeekDay)#<\/div># } else if (frequency === "monthly") { #<div class="k-edit-label"><label>#:messages.repeatOn#<\/label><\/div><div class="k-edit-field"><ul class="k-reset"><li><label><input class="k-recur-month-radio" type="radio" name="month" value="monthday" />#:messages.day#<\/label><input class="k-recur-monthday" /><\/li><li><input class="k-recur-month-radio" type="radio" name="month" value="weekday" /><input class="k-recur-weekday-offset" /><input class="k-recur-weekday" /><\/li><\/ul><\/div># } else if (frequency === "yearly") { #<div class="k-edit-label"><label>#:messages.repeatOn#<\/label><\/div><div class="k-edit-field"><ul class="k-reset"><li><input class="k-recur-year-radio" type="radio" name="year" value="monthday" /><input class="k-recur-month" /><input class="k-recur-monthday" /><\/li><li><input class="k-recur-year-radio" type="radio" name="year" value="weekday" /><input class="k-recur-weekday-offset" /><input class="k-recur-weekday" />#:messages.of#<input class="k-recur-month" /><\/li><\/ul><\/div># } ## if (frequency !== "never") { #<div class="k-edit-label"><label>#:end.label#<\/label><\/div><div class="k-edit-field"><ul class="k-reset"><li><label><input class="k-recur-end-never" type="radio" name="end" value="never" />#:end.never#<\/label><\/li><li><label><input class="k-recur-end-count" type="radio" name="end" value="count" />#:end.after#<\/label><input class="k-recur-count" />#:end.occurrence#<\/li><li><label><input class="k-recur-end-until" type="radio" name="end" value="until" />#:end.on#<\/label><input class="k-recur-until" /><\/li><\/ul><\/div># } #'),tr=[{day:0,offset:0},{day:1,offset:0},{day:2,offset:0},{day:3,offset:0},{day:4,offset:0},{day:5,offset:0},{day:6,offset:0}],ir=[{day:1,offset:0},{day:2,offset:0},{day:3,offset:0},{day:4,offset:0},{day:5,offset:0}],rr=[{day:0,offset:0},{day:6,offset:0}],l=et.extend({init:function(n,t){var f,r=this,e=t&&t.frequencies;et.fn.init.call(r,n,t);r.wrapper=r.element;t=r.options;t.start=f=t.start||u.today();e&&(t.frequencies=e);typeof f=="string"&&(t.start=i.parseDate(f,"yyyyMMddTHHmmss"));t.firstWeekDay===null&&(t.firstWeekDay=i.culture().calendar.firstDay);r._namespace="."+t.name},options:{value:"",start:"",timezone:"",spinners:!0,firstWeekDay:null,frequencies:["never","daily","weekly","monthly","yearly"],mobile:!1,messages:{frequencies:{never:"Never",hourly:"Hourly",daily:"Daily",weekly:"Weekly",monthly:"Monthly",yearly:"Yearly"},hourly:{repeatEvery:"Repeat every: ",interval:" hour(s)"},daily:{repeatEvery:"Repeat every: ",interval:" day(s)"},weekly:{interval:" week(s)",repeatEvery:"Repeat every: ",repeatOn:"Repeat on: "},monthly:{repeatEvery:"Repeat every: ",repeatOn:"Repeat on: ",interval:" month(s)",day:"Day "},yearly:{repeatEvery:"Repeat every: ",repeatOn:"Repeat on: ",interval:" year(s)",of:" of "},end:{label:"End:",mobileLabel:"Ends",never:"Never",after:"After ",occurrence:" occurrence(s)",on:"On "},offsetPositions:{first:"first",second:"second",third:"third",fourth:"fourth",last:"last"},weekdays:{day:"day",weekday:"weekday",weekend:"weekend day"}}},events:["change"],_initInterval:function(){var n=this,t=n._value;n._container.find(".k-recur-interval").kendoNumericTextBox({spinners:n.options.spinners,value:t.interval||1,decimals:0,format:"#",min:1,change:function(){t.interval=this.value();n._trigger()}})},_weekDayRule:function(n){var t=this,r=(t._weekDay.element||t._weekDay).val(),u=Number((t._weekDayOffset.element||t._weekDayOffset).val()),i=null,f=null;n||(r==="day"?(i=tr,f=u):r==="weekday"?(i=ir,f=u):r==="weekend"?(i=rr,f=u):i=[{offset:u,day:Number(r)}]);t._value.weekDays=i;t._value.positions=f},_weekDayView:function(){var r=this,n=r._value.weekDays,u=r._value.positions,o=r._weekDayOffset,i,t,f,e;n&&(f=n.length,u&&(f===7?(t="day",i=u):f===5?(t="weekday",i=u):f===2&&(t="weekend",i=u)),t||(n=n[0],t=n.day,i=n.offset||""),e=o.value?"value":"val",o[e](i),r._weekDay[e](t))},_initWeekDay:function(){var t=this,f,u=t.options.messages.weekdays,r=t.options.messages.offsetPositions,e=t._container.find(".k-recur-weekday"),o=function(){t._weekDayRule();t._trigger()};e[0]&&(t._weekDayOffset=new a(t._container.find(".k-recur-weekday-offset"),{change:o,dataTextField:"text",dataValueField:"value",dataSource:[{text:r.first,value:"1"},{text:r.second,value:"2"},{text:r.third,value:"3"},{text:r.fourth,value:"4"},{text:r.last,value:"-1"}]}),f=[{text:u.day,value:"day"},{text:u.weekday,value:"weekday"},{text:u.weekend,value:"weekend"}],t._weekDay=new a(e,{value:t.options.start.getDay(),change:o,dataTextField:"text",dataValueField:"value",dataSource:f.concat(n.map(i.culture().calendar.days.names,function(n,t){return{text:n,value:t}}))}),t._weekDayView())},_initWeekDays:function(){var t=this,r=t._value,i=t._container.find(".k-recur-weekday-checkbox");if(i[0]){i.on(f+t._namespace,function(){r.weekDays=n.map(i.filter(":checked"),function(n){return{day:Number(n.value),offset:0}});t.options.mobile||t._trigger()});if(r.weekDays)for(var u,e,o=0,s=i.length,h=r.weekDays.length;o<s;o++)for(e=i[o],u=0;u<h;u++)e.value==r.weekDays[u].day&&(e.checked=!0)}},_initMonthDay:function(){var n=this,t=n._value,r=n._container.find(".k-recur-monthday");r[0]&&(n._monthDay=new i.ui.NumericTextBox(r,{spinners:n.options.spinners,min:1,max:31,decimals:0,format:"#",value:t.monthDays?t.monthDays[0]:n.options.start.getDate(),change:function(){var i=this.value();t.monthDays=i?[i]:i;n._trigger()}}))},_initCount:function(){var n=this,i=n._container.find(".k-recur-count"),t=n._value;n._count=i.kendoNumericTextBox({spinners:n.options.spinners,value:t.count||1,decimals:0,format:"#",min:1,change:function(){t.count=this.value();n._trigger()}}).data("kendoNumericTextBox")},_initUntil:function(){var n=this,u=n._container.find(".k-recur-until"),t=n.options.start,r=n._value,i=r.until;n._until=u.kendoDatePicker({min:i&&i<t?i:t,value:i||new Date(t.getFullYear(),t.getMonth(),t.getDate(),23,59,59),change:function(){var t=this.value();r.until=new Date(t.getFullYear(),t.getMonth(),t.getDate(),23,59,59);n._trigger()}}).data("kendoDatePicker")},_trigger:function(){this.options.mobile||this.trigger("change")}}),ur=l.extend({init:function(n,t){var i=this;l.fn.init.call(i,n,t);i._initFrequency();i._initContainer();i.value(i.options.value)},options:{name:"RecurrenceEditor"},events:["change"],destroy:function(){var n=this;n._frequency.destroy();n._container.find("input[type=radio],input[type=checkbox]").off(f+n._namespace);i.destroy(n._container);l.fn.destroy.call(n)},value:function(n){var i=this,u=i.options.timezone,r;if(n===t)return i._value.freq?ut(i._value,u):"";i._value=d(n,u)||{};r=i._value.freq;r?i._frequency.value(r):i._frequency.select(0);i._initView(i._frequency.value())},_initContainer:function(){var i=this.element,t=n('<div class="k-recur-view" />'),r=i.parent(".k-edit-field");r[0]?t.insertAfter(r):i.append(t);this._container=t},_initFrequency:function(){var t=this,u=t.options,i=u.frequencies,e=u.messages.frequencies,f=n("<input />"),r;i=n.map(i,function(n){return{text:e[n],value:n}});r=i[0];r&&r.value==="never"&&(r.value="");t.element.append(f);t._frequency=new a(f,{dataTextField:"text",dataValueField:"value",dataSource:i,change:function(){t._value={};t._initView(t._frequency.value());t.trigger("change")}})},_initView:function(n){var t=this,u=t._value,r=t.options,f={frequency:n||"never",weekDayCheckBoxes:gt,firstWeekDay:r.firstWeekDay,messages:r.messages[n],end:r.messages.end};if(i.destroy(t._container),t._container.html(nr(f)),!n){t._value={};return}u.freq=n;n!=="weekly"||u.weekDays||(u.weekDays=[{day:r.start.getDay(),offset:0}]);t._initInterval();t._initWeekDays();t._initMonthDay();t._initWeekDay();t._initMonth();t._initCount();t._initUntil();t._period();t._end()},_initMonth:function(){var t=this,e=t._value,r=e.months||[t.options.start.getMonth()+1],u=t._container.find(".k-recur-month"),f;u[0]&&(f={change:function(){e.months=[Number(this.value())];t.trigger("change")},dataTextField:"text",dataValueField:"value",dataSource:n.map(i.culture().calendar.months.names,function(n,t){return{text:n,value:t+1}})},t._month1=new a(u[0],f),t._month2=new a(u[1],f),r&&(r=r[0],t._month1.value(r),t._month2.value(r)))},_end:function(){var n=this,e=n._value,t=n._container,i=n._namespace,r=function(t){n._toggleEnd(t.currentTarget.value);n.trigger("change")},u;n._buttonNever=t.find(".k-recur-end-never").on(f+i,r);n._buttonCount=t.find(".k-recur-end-count").on(f+i,r);n._buttonUntil=t.find(".k-recur-end-until").on(f+i,r);e.count?u="count":e.until&&(u="until");n._toggleEnd(u)},_period:function(){var n=this,t=n._value,i=t.freq==="monthly",u=i?n._toggleMonthDay:n._toggleYear,e=".k-recur-"+(i?"month":"year")+"-radio",r=n._container.find(e);if(i||t.freq==="yearly"){r.on(f+n._namespace,function(t){u.call(n,t.currentTarget.value);n.trigger("change")});n._buttonMonthDay=r.eq(0);n._buttonWeekDay=r.eq(1);u.call(n,t.weekDays?"weekday":"monthday")}},_toggleEnd:function(n){var t=this,i,r,u,f;n==="count"?(t._buttonCount.prop("checked",!0),u=!0,f=!1,i=t._count.value(),r=null):n==="until"?(t._buttonUntil.prop("checked",!0),u=!1,f=!0,i=null,r=t._until.value()):(t._buttonNever.prop("checked",!0),u=f=!1,i=r=null);t._count.enable(u);t._until.enable(f);t._value.count=i;t._value.until=r},_toggleMonthDay:function(n){var t=this,u=!1,i=!0,f=!1,r;n==="monthday"?(t._buttonMonthDay.prop("checked",!0),r=[t._monthDay.value()],u=!0,i=!1,f=!0):(t._buttonWeekDay.prop("checked",!0),r=null);t._weekDay.enable(i);t._weekDayOffset.enable(i);t._monthDay.enable(u);t._value.monthDays=r;t._weekDayRule(f)},_toggleYear:function(n){var t=this,r=!1,u=!0,i;n==="monthday"?(r=!0,u=!1,i=t._month1.value()):i=t._month2.value();t._month1.enable(r);t._month2.enable(u);t._value.months=[i];t._toggleMonthDay(n)}});w.plugin(ur);var fr=i.template('<div class="k-edit-label"><label>#:headerTitle#<\/label><\/div><div class="k-edit-field k-recur-pattern k-scheduler-toolbar"><\/div><div class="k-recur-view"><\/div>'),er=i.template('# if (frequency !== "never") { #<div class="k-edit-label"><label>#:messages.repeatEvery#<\/label><\/div><div class="k-edit-field"><input class="k-recur-interval" pattern="\\\\d*"/>#:messages.interval#<\/div># } ## if (frequency === "weekly") { #<div class="k-edit-label"><label>#:messages.repeatOn#<\/label><\/div><div class="k-edit-field">#=weekDayCheckBoxes(firstWeekDay)#<\/div># } else if (frequency === "monthly") { #<div class="k-edit-label"><label>#:messages.repeatBy#<\/label><\/div><div class="k-edit-field k-scheduler-toolbar k-repeat-rule"><\/div><div class="k-monthday-view" style="display:none"><div class="k-edit-label"><label>#:messages.day#<\/label><\/div><div class="k-edit-field"><input class="k-recur-monthday" pattern="\\\\d*"/><\/div><\/div><div class="k-weekday-view" style="display:none"><div class="k-edit-label"><label>#:messages.every#<\/label><\/div><div class="k-edit-field"><select class="k-recur-weekday-offset"><\/select><\/div><div class="k-edit-label"><label>#:messages.day#<\/label><\/div><div class="k-edit-field"><select class="k-recur-weekday"><\/select><\/div><\/div># } else if (frequency === "yearly") { #<div class="k-edit-label"><label>#:messages.repeatBy#<\/label><\/div><div class="k-edit-field k-scheduler-toolbar k-repeat-rule"><\/div><div class="k-monthday-view" style="display:none"><div class="k-edit-label"><label>#:messages.day#<\/label><\/div><div class="k-edit-field"><input class="k-recur-monthday" pattern="\\\\d*"/><\/div><\/div><div class="k-weekday-view" style="display:none"><div class="k-edit-label"><label>#:messages.every#<\/label><\/div><div class="k-edit-field"><select class="k-recur-weekday-offset"><\/select><\/div><div class="k-edit-label"><label>#:messages.day#<\/label><\/div><div class="k-edit-field"><select class="k-recur-weekday"><\/select><\/div><\/div><div class="k-edit-label"><label>#:messages.month#<\/label><\/div><div class="k-edit-field"><select class="k-recur-month"><\/select><\/div># } #'),or=i.template('# if (endPattern === "count") { #<div class="k-edit-label"><label>#:messages.after#<\/label><\/div><div class="k-edit-field"><input class="k-recur-count" pattern="\\\\d*" /><\/div># } else if (endPattern === "until") { #<div class="k-edit-label"><label>#:messages.on#<\/label><\/div><div class="k-edit-field"><input type="date" class="k-recur-until" /><\/div># } #'),ft=i.template('<ul class="k-reset k-header k-scheduler-navigation">#for (var i = 0, length = dataSource.length; i < length; i++) {#<li class="k-state-default #= value === dataSource[i].value ? "k-state-selected" : "" #"><a role="button" href="\\#" class="k-link" data-#=ns#value="#=dataSource[i].value#">#:dataSource[i].text#<\/a><\/li>#}#<\/ul>'),sr=l.extend({init:function(n,t){var r=this;l.fn.init.call(r,n,t);t=r.options;r._optionTemplate=i.template('<option value="#:value#">#:text#<\/option>');r.value(t.value);r._pane=t.pane;r._initRepeatButton();r._initRepeatEnd();r._defaultValue=r._value},options:{name:"MobileRecurrenceEditor",animations:{left:"slide",right:"slide:right"},mobile:!0,messages:{cancel:"Cancel",update:"Save",endTitle:"Repeat ends",repeatTitle:"Repeat pattern",headerTitle:"Repeat event",end:{patterns:{never:"Never",after:"After...",on:"On..."},never:"Never",after:"End repeat after",on:"End repeat on"},daily:{interval:""},hourly:{interval:""},weekly:{interval:""},monthly:{interval:"",repeatBy:"Repeat by: ",dayOfMonth:"Day of the month",dayOfWeek:"Day of the week",repeatEvery:"Repeat every",every:"Every",day:"Day "},yearly:{interval:"",repeatBy:"Repeat by: ",dayOfMonth:"Day of the month",dayOfWeek:"Day of the week",repeatEvery:"Repeat every: ",every:"Every",month:"Month",day:"Day"}}},events:["change"],value:function(n){var i=this,r=i.options.timezone;if(n===t)return i._value.freq?ut(i._value,r):"";i._value=d(n,r)||{}},destroy:function(){this._destroyView();i.destroy(this._endFields);this._repeatButton.off(f+this._namespace);l.fn.destroy.call(this)},_initRepeatButton:function(){var t=this,i=t.options.messages.frequencies[this._value.freq||"never"];t._repeatButton=n('<a href="#" class="k-button k-scheduler-recur">'+i+"<\/a>").on(f+t._namespace,function(n){n.preventDefault();t._createView("repeat");t._pane.navigate("recurrence",t.options.animations.left)});t.element.append(t._repeatButton)},_initRepeatEnd:function(){var t=this,i=n('<div class="k-edit-label"><label>'+t.options.messages.end.mobileLabel+"<\/label><\/div>").insertAfter(t.element.parent(".k-edit-field")),r=n('<div class="k-edit-field"><a href="#" class="k-button k-scheduler-recur-end"><\/a><\/div>').on(f+t._namespace,function(n){(n.preventDefault(),t._value.freq)&&(t._createView("end"),t._pane.navigate("recurrence",t.options.animations.left))}).insertAfter(i);t._endFields=i.add(r).toggleClass("k-state-disabled",!t._value.freq);t._endButton=r.find(".k-scheduler-recur-end").text(t._endText())},_endText:function(){var n=this._value,t=this.options.messages.end,r=t.never;return n.count?r=i.format("{0} {1}",t.after,n.count):n.until&&(r=i.format("{0} {1:d}",t.on,n.until)),r},_initFrequency:function(){var t=this,r=t.options.messages.frequencies,u=ft({dataSource:n.map(this.options.frequencies,function(n){return{text:r[n],value:n!=="never"?n:""}}),value:t._value.freq||"",ns:i.ns});t._view.element.find(".k-recur-pattern").append(u).on(f+t._namespace,".k-scheduler-navigation li",function(r){var u=n(this);r.preventDefault();u.addClass("k-state-selected").siblings().removeClass("k-state-selected");t._value={freq:u.children("a").attr(i.attr("value"))};t._initRepeatView()})},_initEndNavigation:function(){var t=this,u=t.options.messages.end.patterns,r=t._value,e="",o;r.count?e="count":r.until&&(e="until");o=ft({dataSource:[{text:u.never,value:""},{text:u.after,value:"count"},{text:u.on,value:"until"}],value:e,ns:i.ns});t._view.element.find(".k-recur-pattern").append(o).on(f+t._namespace,".k-scheduler-navigation li",function(u){var o=n(this),f=null,e=null;u.preventDefault();o.addClass("k-state-selected").siblings().removeClass("k-state-selected");t._initEndView(o.children("a").attr(i.attr("value")));t._count?(f=t._count.value(),e=null):t._until&&(f=null,e=t._until.val?i.parseDate(t._until.val(),"yyyy-MM-dd"):t._until.value());r.count=f;r.until=e})},_createView:function(t){var i=this,u=i.options,r=u.messages,e=r[t==="repeat"?"repeatTitle":"endTitle"],o='<div data-role="view" class="k-popup-edit-form k-scheduler-edit-form k-mobile-list" id="recurrence"><div data-role="header" class="k-header"><a href="#" class="k-button k-scheduler-cancel">'+r.cancel+"<\/a>"+r.headerTitle+'<a href="#" class="k-button k-scheduler-update">'+r.update+"<\/a><\/div>",s=i._pane.view().id;i._view=i._pane.append(o+fr({headerTitle:e}));i._view.element.on(f+i._namespace,"a.k-scheduler-cancel, a.k-scheduler-update",function(t){t.preventDefault();t.stopPropagation();n(this).hasClass("k-scheduler-update")?(i.trigger("change"),i._defaultValue=n.extend({},i._value)):i._value=i._defaultValue;var u=i._value.freq;i._endButton.text(i._endText());i._endFields.toggleClass("k-state-disabled",!u);i._repeatButton.text(r.frequencies[u||"never"]);i._pane.one("viewShow",function(){i._destroyView()});i._pane.navigate(s,i.options.animations.right)});i._container=i._view.element.find(".k-recur-view");t==="repeat"?(i._initFrequency(),i._initRepeatView()):(i._initEndNavigation(),i._initEndView())},_destroyView:function(){this._view&&(this._view.destroy(),this._view.element.remove());this._view=null},_initRepeatView:function(){var n=this,t=n._value.freq||"never",e={frequency:t,weekDayCheckBoxes:gt,firstWeekDay:n.options.firstWeekDay,messages:n.options.messages[t]},r=er(e),u=n._container,f=n._value;if(i.destroy(u),u.html(r),!r){n._value={};return}t!=="weekly"||f.weekDays||(f.weekDays=[{day:n.options.start.getDay(),offset:0}]);n._initInterval();n._initMonthDay();n._initWeekDays();n._initWeekDay();n._initMonth();n._period()},_initEndView:function(n){var r=this,u=r._value,f;n===t&&(u.count?n="count":u.until&&(n="until"));f={endPattern:n,messages:r.options.messages.end};i.destroy(r._container);r._container.html(or(f));r._initCount();r._initUntil()},_initWeekDay:function(){var t=this,u,f=t.options.messages.weekdays,r=t.options.messages.offsetPositions,e=t._container.find(".k-recur-weekday"),o=function(){t._weekDayRule();t.trigger("change")};e[0]&&(t._weekDayOffset=t._container.find(".k-recur-weekday-offset").html(t._options([{text:r.first,value:"1"},{text:r.second,value:"2"},{text:r.third,value:"3"},{text:r.fourth,value:"4"},{text:r.last,value:"-1"}])).change(o),u=[{text:f.day,value:"day"},{text:f.weekday,value:"weekday"},{text:f.weekend,value:"weekend"}],u=u.concat(n.map(i.culture().calendar.days.names,function(n,t){return{text:n,value:t}})),t._weekDay=e.html(t._options(u)).change(o).val(t.options.start.getDay()),t._weekDayView())},_initMonth:function(){var t=this,u=t._value,o=t.options.start,f=u.months||[o.getMonth()+1],r=t._container.find(".k-recur-month"),s=i.culture().calendar.months.names,e;r[0]&&(e=n.map(s,function(n,t){return{text:n,value:t+1}}),r.html(t._options(e)).change(function(){u.months=[Number(this.value)]}),t._monthSelect=r,f&&r.val(f[0]))},_period:function(){var t=this,r=t._value,u=t._container,e=t.options.messages[r.freq],o=u.find(".k-repeat-rule"),s=u.find(".k-weekday-view"),h=u.find(".k-monthday-view");if(o[0]){var c=r.weekDays?"weekday":"monthday",a=ft({value:c,dataSource:[{text:e.dayOfMonth,value:"monthday"},{text:e.dayOfWeek,value:"weekday"}],ns:i.ns}),l=function(n){var f=t._weekDay.val(),e=t._weekDayOffset.val(),u=t._monthDay.value(),i=t._monthSelect?t._monthSelect.val():null;n==="monthday"?(r.weekDays=null,r.monthDays=u?[u]:u,r.months=i?[Number(i)]:i,s.hide(),h.show()):(r.monthDays=null,r.months=i?[Number(i)]:i,r.weekDays=[{offset:Number(e),day:Number(f)}],s.show(),h.hide())};o.append(a).on(f+t._namespace,".k-scheduler-navigation li",function(t){var r=n(this).addClass("k-state-selected"),u;t.preventDefault();r.siblings().removeClass("k-state-selected");u=r.children("a").attr(i.attr("value"));l(u)});l(c)}},_initUntil:function(){var t=this,f=t._container.find(".k-recur-until"),r=t.options.start,u=t._value,n=u.until,e=n&&n<r?n:r;t._until=i.support.input.date?f.attr("min",i.toString(e,"yyyy-MM-dd")).val(i.toString(n||r,"yyyy-MM-dd")).on("change",function(){u.until=i.parseDate(this.value,"yyyy-MM-dd")}):f.kendoDatePicker({min:e,value:n||r,change:function(){u.until=this.value()}}).data("kendoDatePicker")},_options:function(n,t){var i=0,r="",f=n.length,u=this._optionTemplate;for(t&&(r+=u({value:"",text:t}));i<f;i++)r+=u(n[i]);return r}});w.plugin(sr)})(window.kendo.jQuery)}(),function(){(function(n,t){function v(n){var t=new Date(1980,1,1,0,0,0);return r(t,u(n)),t}function d(n){var i=[],t=n.workWeekStart;for(i.push(t);n.workWeekEnd!=t;)t>6?t-=7:t++,i.push(t);return i}function y(n){var i=0,t;if(n.columns){for(t=0;t<n.columns.length;t++)i+=y(n.columns[t]);return n.colspan=i,i}return n.colspan=1,1}function g(n,t,i){for(var r,e,f,u=n.length-1;u>=0;u--)r=n[u].rectLeft,f=n[u].rectRight,e=r<=t&&f>=t,(e||r>=t&&f<=i||t<=r&&i>=r)&&(r<t&&(t=r),f>i&&(i=f));return nt(n,t,i)}function nt(n,t,i){for(var u,f=[],r=0;r<n.length;r++)u={rectLeft:n[r].rectLeft,rectRight:n[r].rectRight},(u.rectLeft<t&&u.rectRight>t||u.rectLeft>=t&&u.rectRight<=i)&&f.push(n[r]);return f}var i=window.kendo,l=i.ui,r=i.date.setTime,o=l.SchedulerView,h=n.extend,p=n.proxy,f=i.date.getDate,u=i.date.getMilliseconds,e=i.date.MS_PER_DAY,a=i.date.MS_PER_MINUTE,s=".kendoTimelineView",w=i.template('<div><div class="k-event-template k-event-time">#:kendo.format("{0:t} - {1:t}", start, end)#<\/div><div class="k-event-template">${title}<\/div><\/div>'),b=i.template("<span class='k-link k-nav-day'>#=kendo.format('{0:m}', date)#<\/span>"),k='<div role="gridcell" aria-selected="false" data-#=ns#uid="#=uid#"#if (resources[0]) { #style="background-color:#=resources[0].color#; border-color: #=resources[0].color#"class="k-event#=inverseColor ? " k-event-inverse" : ""#" #} else {#class="k-event"#}#><span class="k-event-actions"># if(data.tail) {#<span class="k-icon k-i-arrow-w"><\/span>#}## if(data.isException()) {#<span class="k-icon k-i-exception"><\/span># } else if(data.isRecurring()) {#<span class="k-icon k-i-refresh"><\/span># } #<\/span>{0}<span class="k-event-actions">#if (showDelete) {#<a href="\\#" class="k-link k-event-delete"><span class="k-icon k-si-close"><\/span><\/a>#}## if(data.head) {#<span class="k-icon k-i-arrow-e"><\/span>#}#<\/span>#if(resizable && !data.tail){#<span class="k-resize-handle k-resize-w"><\/span>#}##if(resizable && !data.head){#<span class="k-resize-handle k-resize-e"><\/span>#}#<\/div>',c=o.extend({init:function(n,t){var i=this;o.fn.init.call(i,n,t);i.title=i.options.title||i.options.name;i._workDays=d(i.options);i._templates();i._editable();i.calculateDateRange();i._groups();i._currentTime()},name:"timeline",_currentTimeMarkerUpdater:function(){var t=new Date,r=this.options,f,o,s,u,c,l;if(this.datesHeader.find(".k-current-time").remove(),this._isInDateSlot({start:t,end:t}))for(r.currentTimeMarker.useLocalTimezone===!1&&(f=r.dataSource.options.schema.timezone,r.dataSource&&f&&(o=i.timezone.offset(t,f),t=i.timezone.convert(t,t.getTimezoneOffset(),o))),s=!r.group||r.group.orientation=="vertical"?1:this.groups.length,u=0;u<s;u++){var a=this.groups[u],h=i.date.toUtcTime(t),e=a.timeSlotRanges(h,h+1);if(e.length===0)return;if(c=e[0].collection,l=c.slotByStartDate(t),l){var v=n("<div class='k-current-time'><\/div>"),y=this.datesHeader,p=Math.round(e[0].innerRect(t,new Date(t.getTime()+1),!1).left);v.appendTo(y.find(".k-scheduler-header-wrap")).css({left:this._adjustLeftPosition(p),width:"1px",bottom:"1px",top:0})}}},_adjustLeftPosition:function(n){return this._isRtl&&(n-=this.content[0].scrollWidth-this.content[0].offsetWidth),n},_currentTime:function(){var n=this,i=n.options.currentTimeMarker,r;i!==!1&&i.updateInterval!==t&&(r=i.updateInterval,n._currentTimeMarkerUpdater(),n._currentTimeUpdateTimer=setInterval(p(this._currentTimeMarkerUpdater,n),r))},_editable:function(){this.options.editable&&(this._isMobile()?this._touchEditable():this._mouseEditable())},_mouseEditable:function(){var t=this;t.element.on("click"+s,".k-event a:has(.k-si-close)",function(r){t.trigger("remove",{uid:n(this).closest(".k-event").attr(i.attr("uid"))});r.preventDefault()});if(t.options.editable.create!==!1)t.element.on("dblclick"+s,".k-scheduler-content td",function(n){var i=t._slotByPosition(n.pageX,n.pageY),r;i&&(r=t._resourceBySlot(i),t.trigger("add",{eventInfo:h({start:i.startDate(),end:i.endDate()},r)}));n.preventDefault()});if(t.options.editable.update!==!1)t.element.on("dblclick"+s,".k-event",function(r){t.trigger("edit",{uid:n(this).closest(".k-event").attr(i.attr("uid"))});r.preventDefault()})},_touchEditable:function(){var t=this,r=0;i.support.mobileOS.android&&(r=5);t.options.editable.create!==!1&&(t._addUserEvents=new i.UserEvents(t.element,{threshold:r,filter:".k-scheduler-content td",tap:function(n){var i=t._slotByPosition(n.x.location,n.y.location),r;i&&(r=t._resourceBySlot(i),t.trigger("add",{eventInfo:h({start:i.startDate(),end:i.endDate()},r)}));n.preventDefault()}}));t.options.editable.update!==!1&&(t._editUserEvents=new i.UserEvents(t.element,{threshold:r,filter:".k-event",tap:function(r){var u=n(r.target).closest(".k-event");u.hasClass("k-event-active")||t.trigger("edit",{uid:u.attr(i.attr("uid"))});r.preventDefault()}}))},_slotByPosition:function(n,t){var e,r=this.content,o=r.offset(),s,u,f;for(n-=o.left,t-=o.top,this._isRtl?(f=i.support.browser,f.mozilla?(n+=r[0].scrollWidth-r[0].offsetWidth,n+=r[0].scrollLeft):f.msie?(n-=r.scrollLeft(),n+=r[0].scrollWidth-r[0].offsetWidth):f.webkit&&(n+=r[0].scrollLeft)):n+=r[0].scrollLeft,t+=r[0].scrollTop,n=Math.ceil(n),t=Math.ceil(t),u=0;u<this.groups.length;u++)if(s=this.groups[u],e=s.timeSlotByPosition(n,t),e)return e;return null},options:{name:"TimelineView",title:"Timeline",selectedDateFormat:"{0:D}",selectedShortDateFormat:"{0:d}",date:i.date.today(),startTime:i.date.today(),endTime:i.date.today(),showWorkHours:!1,minorTickCount:2,editable:!0,workDayStart:new Date(1980,1,1,8,0,0),workDayEnd:new Date(1980,1,1,17,0,0),workWeekStart:1,workWeekEnd:5,majorTick:60,eventHeight:25,eventMinWidth:0,columnWidth:100,groupHeaderTemplate:"#=text#",majorTimeHeaderTemplate:"#=kendo.toString(date, 't')#",slotTemplate:"&nbsp;",eventTemplate:w,dateHeaderTemplate:b,footer:{command:"workDay"},currentTimeMarker:{updateInterval:1e4,useLocalTimezone:!0},messages:{defaultRowText:"All events",showFullDay:"Show full day",showWorkDay:"Show business hours"}},events:["remove","add","edit"],_templates:function(){var n=this.options,t=h({},i.Template,n.templateSettings);this.eventTemplate=this._eventTmpl(n.eventTemplate,k);this.majorTimeHeaderTemplate=i.template(n.majorTimeHeaderTemplate,t);this.dateHeaderTemplate=i.template(n.dateHeaderTemplate,t);this.slotTemplate=i.template(n.slotTemplate,t);this.groupHeaderTemplate=i.template(n.groupHeaderTemplate,t)},_render:function(t){var i=this;t=t||[];i._dates=t;i._startDate=t[0];i._endDate=t[t.length-1||0];i._calculateSlotRanges();i.createLayout(i._layout(t));i._content(t);i._footer();i._setContentWidth();i.refreshLayout();i.datesHeader.on("click"+s,".k-nav-day",function(t){var r=n(t.currentTarget).closest("th"),u=i._slotByPosition(r.offset().left,i.content.offset().top);i.trigger("navigate",{view:"timeline",date:u.startDate()})});i.timesHeader.find("table tr:last").hide();i.datesHeader.find("table tr:last").hide()},_setContentWidth:function(){var u=this.content,n=u.width(),t=this.content.find("table"),f=t.find("tr:first").children().length,i=100,r=f*this.options.columnWidth;n<r&&(i=Math.ceil(r/n*100));t.add(this.datesHeader.find("table")).css("width",i+"%")},_calculateSlotRanges:function(){var o=this._dates,s=this.startTime(),n=this.endTime(),h,t,c,l;for(u(n)===u(i.date.getDate(n))&&(n=i.date.getDate(n),r(n,e-1)),n=u(n),s=u(s),h=[],t=0;t<o.length;t++)c=f(o[t]),r(c,s),l=f(o[t]),r(l,n),h.push({start:i.date.toUtcTime(c),end:i.date.toUtcTime(l)});this._slotRanges=h},_forTimeRange:function(n,t,i,f){var it;n=v(n);t=v(t);var d=this,p=u(n),c=u(t),s=d.options.minorTickCount,g=d.options.majorTick*a,l=g/s||1,h=new Date(+n),rt=h.getDate(),w,y=0,o,b="";for(o=e/l,p!=c&&(p>c&&(c+=e),o=(c-p)/l),o=Math.round(o);y<o;y++){var k=y%(g/l),nt=k===0,ut=k<s-1,ft=k===s-1,tt=s;o%s!=0&&(it=o-(y+1)<s,nt&&it&&(tt=o%s));b+=i(h,nt,ut,ft,tt);r(h,l,!1)}return c&&(w=u(h),rt<h.getDate()&&(w+=e),w>c&&(h=new Date(+t))),f&&(b+=f(h)),b},_layout:function(n){for(var r,u,f=[],i=[],t=this,e=[{text:t.options.messages.defaultRowText}],o=[],s=0;s<t.options.minorTickCount;s++)o.push({text:"",className:""});for(this._forTimeRange(t.startTime(),t.endTime(),function(n,i,r,u,e){var h=t.majorTimeHeaderTemplate,s;i&&(s={text:h({date:n}),className:u?"k-slot-cell":"",columns:o.slice(0,e)},y(s),f.push(s))}),r=0;r<n.length;r++)i.push({text:t.dateHeaderTemplate({date:n[r]}),className:"k-slot-cell",columns:f.slice(0)});return u=this.groupedResources,u.length&&(this._groupOrientation()==="vertical"?e=t._createRowsLayout(u,null,this.groupHeaderTemplate):i=t._createColumnsLayout(u,i,this.groupHeaderTemplate)),{columns:i,rows:e}},_footer:function(){var i=this.options,t,u,r;if(i.footer!==!1){t='<div class="k-header k-scheduler-footer">';u=i.footer.command;u&&u==="workDay"?(t+='<ul class="k-reset k-header">',t+='<li class="k-state-default k-scheduler-fullday"><a href="#" class="k-link"><span class="k-icon k-i-clock"><\/span>',t+=(i.showWorkHours?i.messages.showFullDay:i.messages.showWorkDay)+"<\/a><\/li>",t+="<\/ul>"):t+="&nbsp;";t+="<\/div>";this.footer=n(t).appendTo(this.element);r=this;this.footer.on("click"+s,".k-scheduler-fullday",function(n){n.preventDefault();r.trigger("navigate",{view:r.name||i.name,date:r.startDate(),isWorkDay:!i.showWorkHours})})}},_columnCountForLevel:function(n){var t=this.columnLevels[n];return t?t.length:0},_rowCountForLevel:function(n){var t=this.rowLevels[n];return t?t.length:0},_isWorkDay:function(n){for(var r=n.getDay(),i=this._workDays,t=0;t<i.length;t++)if(i[t]===r)return!0;return!1},_content:function(n){var t=this,s=t.options,v=t.startTime(),y=this.endTime(),h=1,c=1,p=n.length,r="",w=this.groupedResources,b=this.slotTemplate,o=!1,l,f,e,u,a;for(w.length&&(o=t._groupOrientation()==="vertical",o?c=t._groupCount():h=t._groupCount()),r+="<tbody>",l=function(r){var c="",h="",l,a=function(n){return function(){return t._resourceBySlot({groupIndex:n})}};return i.date.isToday(n[u])&&(h+="k-today"),(i.date.getMilliseconds(r)<i.date.getMilliseconds(s.workDayStart)||i.date.getMilliseconds(r)>=i.date.getMilliseconds(s.workDayEnd)||!t._isWorkDay(n[u]))&&(h+=" k-nonwork-hour"),c+="<td"+(h!==""?' class="'+h+'"':"")+">",l=i.date.getDate(n[u]),i.date.setTime(l,i.date.getMilliseconds(r)),c+=b({date:l,resources:a(o?f:e)}),c+"<\/td>"},f=0;f<c;f++){for(r+="<tr>",e=0;e<h;e++)for(u=0,a=p;u<a;u++)r+=this._forTimeRange(v,y,l);r+="<\/tr>"}r+="<\/tbody>";this.content.find("table").append(r)},_groups:function(){var r=this._groupCount(),n=this._dates,u=n.length,t;for(this.groups=[],t=0;t<r;t++){var f=this._addResourceView(t),e=n[0],o=n[n.length-1||0];f.addTimeSlotCollection(e,i.date.addDays(o,1))}this._timeSlotGroups(r,u)},_isVerticallyGrouped:function(){return this.groupedResources.length&&this._groupOrientation()==="vertical"},_isHorizontallyGrouped:function(){return this.groupedResources.length&&this._groupOrientation()==="horizontal"},_timeSlotGroups:function(n,t){var y=this._timeSlotInterval(),f=this._isVerticallyGrouped(),o=this.content.find("tr"),s=o.length,i,h,p,c,w,l,r,g,e;for(o.attr("role","row"),f&&(s=Math.floor(s/n)),i=0;i<n;i++){h=0;p=this.groups[i];f&&(h=i);w=h*s;l=0;f||(l=i);var b=o[w].children,k=b.length/(f?1:n),d=k/t;for(r=0;r<t;r++)for(g=r*d+k*l,c=u(new Date(+this.startTime())),e=0;e<d;e++){var a=b[e+g],tt=p.getTimeSlotCollection(0),v=this._dates[r],it=Date.UTC(v.getFullYear(),v.getMonth(),v.getDate()),nt=it+c,rt=nt+y;a.setAttribute("role","gridcell");a.setAttribute("aria-selected",!1);tt.addTimeSlot(a,nt,rt,!0);c+=y}}},startDate:function(){return this._startDate},endDate:function(){return this._endDate},startTime:function(){var n=this.options;return n.showWorkHours?n.workDayStart:n.startTime},endTime:function(){var n=this.options;return n.showWorkHours?n.workDayEnd:n.endTime},_timeSlotInterval:function(){var n=this.options;return n.majorTick/n.minorTickCount*a},nextDate:function(){return i.date.nextDay(this.endDate())},previousDate:function(){return i.date.previousDay(this.startDate())},calculateDateRange:function(){this._render([this.options.date])},render:function(n){var t,f,e,r,u;for(this._headerColumnCount=0,this._groups(),this.element.find(".k-event").remove(),n=new i.data.Query(n).sort([{field:"start",dir:"asc"},{field:"end",dir:"desc"}]).toArray(),t=[],this._eventsByResource(n,this.groupedResources,t),f=[],e=0,r=0;r<t.length;r++)u={groupIndex:r,maxRowCount:0,events:{}},f.push(u),this._renderEvents(t[r],r,u),e<u.maxRowCount&&(e=u.maxRowCount);this._setRowsHeight(f,t.length,e);this._positionEvents(f,t.length);this.trigger("activate")},_positionEvents:function(n,t){for(var r,u,f,i=0;i<t;i++){r=n[i].events;for(u in r)f=r[u],this._positionEvent(f)}},_setRowsHeight:function(t,i,r){var o=this.options.eventHeight+2,s=this._getBottomRowOffset(),u,f;for(i=this._isVerticallyGrouped()?i:1,u=0;u<i;u++){f=this._isVerticallyGrouped()?t[u].maxRowCount:r;f=f?f:1;var e=(o+2)*f+s,h=n(this.times.find("tr")[u]),c=n(this.content.find("tr")[u]);h.height(e);c.height(e)}this._setContentWidth();this.refreshLayout();this._refreshSlots()},_getBottomRowOffset:function(){var n=this.options.eventHeight*.5,r=this._isMobile(),t,i;return r?(t=30,i=60):(t=15,i=30),n>i?n=i:n<t&&(n=t),n},_positionEvent:function(n){var o=this.options.eventHeight+2,i=n.slotRange.innerRect(n.start,n.end,!1),r=this._adjustLeftPosition(i.left),t=i.right-i.left-2;if(t<0&&(t=0),t<this.options.eventMinWidth){var u=n.slotRange.collection,f=u._slots[u._slots.length-1],e=f.offsetLeft+f.offsetWidth;t=this.options.eventMinWidth;e<r+t&&(t=e-i.left-2)}n.element.css({top:n.slotRange.start.offsetTop+n.rowIndex*(o+2)+"px",left:r,width:t})},_refreshSlots:function(){for(var n=0;n<this.groups.length;n++)this.groups[n].refresh()},_eventsByResource:function(n,t,r){var u=t[0],e,f,h,s;if(u)for(e=u.dataSource.view(),f=0;f<e.length;f++)h=this._resourceValue(u,e[f]),s=new i.data.Query(n).filter({field:u.field,operator:o.groupEqFilter(h)}).toArray(),t.length>1?this._eventsByResource(s,t.slice(1),r):r.push(s);else r.push(n)},_isInDateSlot:function(n){var t=n.start,r=n.end,u=f(this._startDate),e=i.date.addDays(f(this._endDate),1);return t<e&&u<=r?!0:!1},_isInTimeSlot:function(n){var f=n._startTime||i.date.toUtcTime(n.start),r=n._endTime||i.date.toUtcTime(n.end),u=this._slotRanges,t;for(f===r&&(r=r+1),t=0;t<u.length;t++)if(f<u[t].end&&u[t].start<r)return!0;return!1},_adjustEvent:function(n){var c=n.start,l=n.end,y=n._time("start"),p=n._time("end"),h=u(this.startTime()),s=u(this.endTime()),o=null,t=null,w,a=!1,v=!1;return n.isAllDay?(o=f(c),h>y&&(r(o,h),v=!0),t=f(l),s===u(f(this.endTime()))?t=i.date.addDays(t,1):(r(t,s),a=!0)):(s=s===0?e:s,h>y?(o=f(c),r(o,h),v=!0):s<y&&(o=f(c),o=i.date.addDays(o,1),r(o,h),v=!0),s<p?(t=f(l),r(t,s),a=!0):h>p&&(t=f(l),t=i.date.addDays(t,-1),r(t,s),a=!0)),w=n.clone({start:o?o:c,end:t?t:l,_startTime:o?i.date.toUtcTime(o):n._startTime,_endTime:t?i.date.toUtcTime(t):n._endTime,isAllDay:!1}),{occurrence:w,head:a,tail:v}},_renderEvents:function(n,t,i){for(var r,a,v,u,o,y,f,h,c,s=0,l=n.length;s<l;s++)r=n[s],this._isInDateSlot(r)&&(a=r.isAllDay||r.end.getTime()-r.start.getTime()>=e,v=this.content,(a||this._isInTimeSlot(r))&&(u=this._adjustEvent(r),o=this.groups[t],o._continuousEvents||(o._continuousEvents=[]),y=o.slotRanges(u.occurrence,!1),f=y[0],this._isInTimeSlot(u.occurrence)&&(h=this._createEventElement(u.occurrence,r,f.head||u.head,f.tail||u.tail),h.appendTo(v).css({top:0,height:this.options.eventHeight}),c={start:u.occurrence._startTime||u.occurrence.start,end:u.occurrence._endTime||u.occurrence.end,element:h,uid:r.uid,slotRange:f,rowIndex:0,offsetTop:0},i.events[r.uid]=c,this.addContinuousEvent(o,f,h,r.isAllDay),this._arrangeRows(c,f,i))))},addContinuousEvent:function(n,t,r,u){var f=n._continuousEvents;f.push({element:r,isAllDay:u,uid:r.attr(i.attr("uid")),start:t.start,end:t.end})},_createEventElement:function(t,r,u,f){var p=this.eventTemplate,e=this.options.editable,w=this._isMobile(),b=e&&e.destroy!==!1&&!w,k=e&&e.resize!==!1,v=r._time("start"),y=r._time("end"),o=r.start,s=r.end,c=this.eventResources(r),l,a;return r._startTime&&v!==i.date.getMilliseconds(r.start)&&(o=new Date(v),o=i.timezone.apply(o,"Etc/UTC")),r._endTime&&y!==i.date.getMilliseconds(r.end)&&(s=new Date(y),s=i.timezone.apply(s,"Etc/UTC")),l=h({},{ns:i.ns,resizable:k,showDelete:b,head:u,tail:f,singleDay:this._dates.length==1,resources:c,inverseColor:c&&c[0]?this._shouldInverseResourceColor(c[0]):!1},r,{start:o,end:s}),a=n(p(l)),this.angular("compile",function(){return{elements:a,data:[{dataItem:l}]}}),a},_arrangeRows:function(n,t,i){var e=t.start.index,c=t.end.index,s=n.slotRange.innerRect(n.start,n.end,!1),l=s.right+this.options.eventMinWidth,a=g(t.events(),s.left,l),r,u,v,h,f,y;for(t.addEvent({slotIndex:e,start:e,end:c,rectLeft:s.left,rectRight:l,element:n.element,uid:n.uid}),a.push({start:e,end:c,uid:n.uid}),r=o.createRows(a),i.maxRowCount<r.length&&(i.maxRowCount=r.length),u=0,v=r.length;u<v;u++)for(h=r[u].events,f=0,y=h.length;f<y;f++)i.events[h[f].uid].rowIndex=u},_groupCount:function(){var n=this.groupedResources;return n.length?this._groupOrientation()==="vertical"?this._rowCountForLevel(n.length-1):this._columnCountForLevel(n.length-1):1},_updateEventForSelection:function(n){var t=this._adjustEvent(n.clone());return t.occurrence},_eventOptionsForMove:function(n){return n.isAllDay?{isAllDay:!1}:{}},_updateEventForResize:function(n){n.isAllDay&&n.set("isAllDay",!1)},_updateMoveHint:function(n,t,i){var p=this.groups[t],r=n.clone({start:n.start,end:n.end}),w=r.duration(),u,s,f,e,o,a,v,y;for(r.start=new Date(r.start.getTime()+i),r.end=new Date(+r.start+w),u=this._adjustEvent(r),s=p.slotRanges(u.occurrence,!1),this._removeMoveHint(),f=0;f<s.length;f++){var c=s[f],l=c.start,h=this._createEventElement(u.occurrence,u.occurrence,!1,!1);h.addClass("k-event-drag-hint");e=c.innerRect(u.occurrence.start,u.occurrence.end,this.options.snap);o=e.right-e.left-2;o<0&&(o=0);a=this._adjustLeftPosition(e.left);v={left:a,top:l.offsetTop,height:l.offsetHeight-2,width:o};h.css(v);this._moveHint=this._moveHint.add(h)}y=this.content;this._moveHint.appendTo(y)},_updateResizeHint:function(n,t,r,u){var v=this.groups[t],h=v.ranges(r,u,!1,!1),e,s,a;for(this._removeResizeHint(),e=0;e<h.length;e++){var c=h[e],l=c.startSlot(),f=c.innerRect(r,u,!1);f.top=l.offsetTop;var y=f.right-f.left,p=l.offsetHeight,w=this._adjustLeftPosition(f.left),b=o.fn._createResizeHint.call(this,w,f.top,y,p);this._resizeHint=this._resizeHint.add(b)}s="t";a=this.content;this._resizeHint.appendTo(a);this._resizeHint.find(".k-label-top,.k-label-bottom").text("");this._resizeHint.first().addClass("k-first").find(".k-label-top").text(i.toString(i.timezone.toLocalDate(r),s));this._resizeHint.last().addClass("k-last").find(".k-label-bottom").text(i.toString(i.timezone.toLocalDate(u),s))},selectionByElement:function(n){var t=n.offset();return this._slotByPosition(t.left,t.top)},_updateDirection:function(n,t,i,r,u){var f=t[0].start,e=t[t.length-1].end;i&&!u&&f.index===e.index&&f.collectionIndex===e.collectionIndex&&(n.backward=r)},_changeGroup:function(n,t){var r=t?"prevGroupSlot":"nextGroupSlot",i=this[r](n.start,n.groupIndex,!1);return i&&(n.groupIndex+=t?-1:1),i},prevGroupSlot:function(n,t,i){var r=this.groups[t],f=r.ranges(n,n,i,!1)[0].start,u;if(!(t<=0))return this._isVerticallyGrouped()?f:(u=r._collection(0,i),u.last())},nextGroupSlot:function(n,t,i){var r=this.groups[t],f=r.ranges(n,n,i,!1)[0].start,u;if(!(t>=this.groups.length-1))return this._isVerticallyGrouped()?f:(u=r._collection(0,i),u.first())},_verticalSlots:function(n,t,i,r){var e=r?"leftSlot":"rightSlot",u=t[0].start,f=t[t.length-1].end,o=this.groups[n.groupIndex];return u=o[e](u),f=o[e](f),i||!this._isVerticallyGrouped()||u&&f||(u=f=this._changeGroup(n,r)),{startSlot:u,endSlot:f}},_horizontalSlots:function(n,t,i,r){var e=r?"upSlot":"downSlot",u=t[0].start,f=t[t.length-1].end,o=this.groups[n.groupIndex];return u=o[e](u),f=o[e](f),i||!this._isHorizontallyGrouped()||u&&f||(u=f=this._changeGroup(n,r)),{startSlot:u,endSlot:f}},_changeViewPeriod:function(n,t){var s=t?this.previousDate():this.nextDate(),f=n.start,i=n.end,o;return n.start=new Date(s),n.end=new Date(s),this._isHorizontallyGrouped()&&(n.groupIndex=t?this.groups.length-1:0),o=i-f,t?(i=u(this.endTime()),i=i===0?e:i,r(n.start,i-o),r(n.end,i)):(f=u(this.startTime()),r(n.start,f),r(n.end,f+o)),n.events=[],!0},move:function(n,t,r){var o=!1,a=this.groups[n.groupIndex],f=i.keys,c=a.ranges(n.start,n.end,!1,!1),s,h,u,e,l;if(t===f.DOWN||t===f.UP)o=!0,u=t===f.UP,this._updateDirection(n,c,r,u,!0),e=this._verticalSlots(n,c,r,u);else if((t===f.LEFT||t===f.RIGHT)&&(o=!0,u=t===f.LEFT,this._updateDirection(n,c,r,u,!1),e=this._horizontalSlots(n,c,r,u),(!e.startSlot||!e.endSlot)&&!r&&this._changeViewPeriod(n,u,!1)))return o;return o&&(s=e.startSlot,h=e.endSlot,r?(l=n.backward,l&&s?n.start=s.startDate():!l&&h&&(n.end=h.endDate())):s&&h&&(n.start=s.startDate(),n.end=h.endDate()),n.events=[]),o},destroy:function(){var n=this;n.element&&n.element.off(s);n.footer&&n.footer.remove();n._currentTimeUpdateTimer&&clearInterval(n._currentTimeUpdateTimer);o.fn.destroy.call(this);this._isMobile()&&n.options.editable&&(n.options.editable.create!==!1&&n._addUserEvents.destroy(),n.options.editable.update!==!1&&n._editUserEvents.destroy())}});h(!0,l,{TimelineView:c,TimelineWeekView:c.extend({options:{name:"TimelineWeekView",title:"Timeline Week",selectedDateFormat:"{0:D} - {1:D}",selectedShortDateFormat:"{0:d} - {1:d}",majorTick:120},name:"timelineWeek",calculateDateRange:function(){for(var f=this.options.date,n=i.date.dayOfWeek(f,this.calendarInfo().firstDay,-1),u=[],t=0,r=7;t<r;t++)u.push(n),n=i.date.nextDay(n);this._render(u)}}),TimelineWorkWeekView:c.extend({options:{name:"TimelineWorkWeekView",title:"Timeline Work Week",selectedDateFormat:"{0:D} - {1:D}",selectedShortDateFormat:"{0:d} - {1:d}",majorTick:120},name:"timelineWorkWeek",nextDate:function(){return i.date.dayOfWeek(i.date.nextDay(this.endDate()),this.options.workWeekStart,1)},previousDate:function(){return i.date.previousDay(this.startDate())},calculateDateRange:function(){for(var r=this.options.date,n=i.date.dayOfWeek(r,this.options.workWeekStart,-1),u=i.date.dayOfWeek(n,this.options.workWeekEnd,1),t=[];n<=u;)t.push(n),n=i.date.nextDay(n);this._render(t)}}),TimelineMonthView:c.extend({options:{name:"TimelineMonthView",title:"Timeline Month",selectedDateFormat:"{0:D} - {1:D}",selectedShortDateFormat:"{0:d} - {1:d}",workDayStart:new Date(1980,1,1,0,0,0),workDayEnd:new Date(1980,1,1,23,59,59),footer:!1,majorTick:1440,minorTickCount:1},name:"timelineMonth",calculateDateRange:function(){for(var r=this.options.date,n=i.date.firstDayOfMonth(r),e=i.date.lastDayOfMonth(r),f=[],t=0,u=e.getDate();t<u;t++)f.push(n),n=i.date.nextDay(n);this._render(f)}})})})(window.kendo.jQuery)}(),function(){(function(n,t){function vt(n,t){return t=t||"",n.startTimezone&&(t=n.startTimezone,n.endTimezone&&(t+=" | "+n.endTimezone)),t}function yt(n,t){var r=t.timezone;r&&(n[i.attr("timezone")]=r)}function pt(n,t){var u=t.model.fields[t.field].validation,r;u&&(r=u.dateCompare,r&&e(r)&&r.message&&(n[i.attr("dateCompare-msg")]=r.message))}function fr(n,t){return function(i){return i=n(i),wt(i,"apply",t),i||[]}}function er(n,t){return function(r){return r&&(si.call(r)==="[object Array]"||r instanceof i.data.ObservableArray||(r=[r])),wt(r,"remove",t,!0),r=n(r),r||[]}}function wt(n,t,r,u){var f,e,o;for(n=n||[],e=0,o=n.length;e<o;e++)f=n[e],u?f.startTimezone||f.endTimezone?r?(f.start=i.timezone.convert(f.start,f.startTimezone||f.endTimezone,r),f.end=i.timezone.convert(f.end,f.endTimezone||f.startTimezone,r),f.start=i.timezone[t](f.start,r),f.end=i.timezone[t](f.end,r)):(f.start=i.timezone[t](f.start,f.startTimezone||f.endTimezone),f.end=i.timezone[t](f.end,f.endTimezone||f.startTimezone)):r&&(f.start=i.timezone[t](f.start,r),f.end=i.timezone[t](f.end,r)):f.startTimezone||f.endTimezone?(f.start=i.timezone[t](f.start,f.startTimezone||f.endTimezone),f.end=i.timezone[t](f.end,f.endTimezone||f.startTimezone),r&&(f.start=i.timezone.convert(f.start,f.startTimezone||f.endTimezone,r),f.end=i.timezone.convert(f.end,f.endTimezone||f.startTimezone,r))):r&&(f.start=i.timezone[t](f.start,r),f.end=i.timezone[t](f.end,r)),u&&delete f.uid;return n}function bt(n,t){for(var u=n.length,i=0,r;i<u;i++)if(r=n[i],r.uid===t)return r}function dt(n,t,r){return r?i.timezone.convert(n,t,r):i.timezone.remove(n,t)}function or(n){if(n.filter("[name=end]").length){var o=n.closest(".k-scheduler-edit-form"),f=o.find("[name=start]:visible"),s=o.find("[name=end]:visible");if(s[0]&&f[0]){var t,r,c=i.widgetInstance(f,i.ui),l=i.widgetInstance(s,i.ui),a=o.data("kendoEditable"),h=a?a.options.model:null;if(c&&l?(t=c.value(),r=l.value()):(t=i.parseDate(f.val()),r=i.parseDate(s.val())),t&&r){if(h){var v=f.attr(i.attr("timezone")),u=h.startTimezone,e=h.endTimezone;u=u||e;e=e||u;u&&(t=dt(t,u,v),r=dt(r,e,v))}return t<=r}}}return!0}function sr(n,t,i,r){for(var e=n.length,u=[],f=0;f<e;f++)u=u.concat(n[f].expand(t,i,r));return u}function hr(n){return delete n.name,delete n.prefix,delete n.remove,delete n.edit,delete n.add,delete n.navigate,n}function g(t,r){var s=(t.fields||t)[r],c=["url","email","number","date","boolean"],h=s?s.validation:{},l=i.attr("type"),a=n.inArray,u,f,o={};for(u in h)f=h[u],a(u,c)>=0?o[l]=u:i.isFunction(f)||(o[u]=e(f)?f.value||u:f),o[i.attr(u+"-msg")]=f.message;return o}function gt(t,r){var u=g(r,t.field);return function(r){n(i.format('<select data-{0}bind="value:{1}">',i.ns,t.field)).appendTo(r).attr(u).kendoDropDownList({dataTextField:t.dataTextField,dataValueField:t.dataValueField,dataSource:t.dataSource,valuePrimitive:t.valuePrimitive,optionLabel:"None",template:i.format('<span class="k-scheduler-mark" style="background-color:#= data.{0}?{0}:"none" #"><\/span>#={1}#',t.dataColorField,t.dataTextField)})}}function ni(t){var i=g(t.model,t.field);return function(t){n('<textarea name="description" class="k-textbox"/>').attr(i).appendTo(t)}}function cr(t,r){var u=g(r,t.field);return function(r){n(i.format('<select data-{0}bind="value:{1}">',i.ns,t.field)).appendTo(r).attr(u).kendoMultiSelect({dataTextField:t.dataTextField,dataValueField:t.dataValueField,dataSource:t.dataSource,valuePrimitive:t.valuePrimitive,itemTemplate:i.format('<span class="k-scheduler-mark" style="background-color:#= data.{0}?{0}:"none" #"><\/span>#={1}#',t.dataColorField,t.dataTextField),tagTemplate:i.format('<span class="k-scheduler-mark" style="background-color:#= data.{0}?{0}:"none" #"><\/span>#={1}#',t.dataColorField,t.dataTextField)})}}function lr(t,r){var u=g(r,t.field);return function(r){for(var o="",e=t.dataSource.view(),f=0,s=e.length;f<s;f++)o+=i.format('<option value="{0}">{1}<\/option>',i.getter(t.dataValueField)(e[f]),i.getter(t.dataTextField)(e[f]));n(i.format('<select data-{0}bind="value:{1}" multiple="multiple" data-{0}value-primitive="{3}">{2}<\/select>',i.ns,t.field,o,t.valuePrimitive)).appendTo(r).attr(u)}}function ti(n,t){var f=n.end.getTime()-n.start.getTime(),r=new Date(n.start.getTime()),u;return i.date.setTime(r,t),u=new Date(r.getTime()),i.date.setTime(u,f,!0),{start:r,end:u}}var i=window.kendo,ht=i.date,ui=i.support.input,b=ht.MS_PER_DAY,f=ht.getDate,nt=i.date.getMilliseconds,v=i.recurrence,tt=i.keys,h=i.ui,s=h.Widget,fi=h.DataBoundWidget,y="string",ei=h.Popup,oi=h.Calendar,c=i.data.DataSource,e=n.isPlainObject,u=n.extend,l=n.proxy,si=Object.prototype.toString,ct=n.isArray,r=".kendoScheduler",o="click",it="change",k="cancel",p="remove",rt="save",lt="add",w="edit",hi=/(?:value:start|value:end)(?:,|$)/,ci=f(new Date),ut="recurrenceException",li="Do you want to delete only this event occurrence or the whole series?",at="Do you want to edit only this event occurrence or the whole series?",ai="Are you sure you want to delete this event occurrence?",vi="Are you sure you want to delete the whole series?",yi='<a class="k-button #=className#" #=attr# href="\\#">#=text#<\/a>',pi=i.template('<li class="k-current-view" data-#=ns#name="#=view#"><a role="button" href="\\#" class="k-link">${views[view].title}<\/a><\/li>'),wi=i.template('<div class="k-floatwrap k-header k-scheduler-toolbar"># if (pdf) { #<ul class="k-reset k-scheduler-tools"><li><a role="button" href="\\#" class="k-button k-pdf"><span class="k-icon k-i-pdf"><\/span>${messages.pdf}<\/a><\/li><\/ul># } #<ul class="k-reset k-scheduler-navigation"><li class="k-state-default k-header k-nav-today"><a role="button" href="\\#" class="k-link">${messages.today}<\/a><\/li><li class="k-state-default k-header k-nav-prev"><a role="button" href="\\#" class="k-link"><span class="k-icon k-i-arrow-w"><\/span><\/a><\/li><li class="k-state-default k-header k-nav-next"><a role="button" href="\\#" class="k-link"><span class="k-icon k-i-arrow-e"><\/span><\/a><\/li><li class="k-state-default k-nav-current"><a role="button" href="\\#" class="k-link"><span class="k-icon k-i-calendar"><\/span><span class="k-sm-date-format" data-#=ns#bind="text: formattedShortDate"><\/span><span class="k-lg-date-format" data-#=ns#bind="text: formattedDate"><\/span><\/a><\/li><\/ul>#if(viewsCount === 1){#<a role="button" data-#=ns#name="#=view#" href="\\#" class="k-link k-scheduler-refresh"><span class="k-icon k-i-refresh"><\/span><\/a>#}else{#<ul class="k-reset k-header k-scheduler-views">#for(var view in views){#<li class="k-state-default k-view-#= view.toLowerCase() #" data-#=ns#name="#=view#"><a role="button" href="\\#" class="k-link">${views[view].title}<\/a><\/li>#}#<\/ul>#}#<\/div>'),bi=i.template('<div class="k-floatwrap k-header k-scheduler-toolbar"><ul class="k-reset k-header k-scheduler-navigation"><li class="k-state-default k-nav-today"><a role="button" href="\\#" class="k-link">${messages.today}<\/a><\/li><\/ul>#if(viewsCount === 1){#<a role="button" data-#=ns#name="#=view#" href="\\#" class="k-link k-scheduler-refresh"><span class="k-icon k-i-refresh"><\/span><\/a>#}else{#<ul class="k-reset k-header k-scheduler-views">#for(var view in views){#<li class="k-state-default k-view-#= view.toLowerCase() #" data-#=ns#name="#=view#"><a role="button" href="\\#" class="k-link">${views[view].title}<\/a><\/li>#}#<\/ul>#}#<\/div><div class="k-floatwrap k-header k-scheduler-toolbar"><ul class="k-reset k-header k-scheduler-navigation"><li class="k-state-default k-nav-prev"><a role="button" href="\\#" class="k-link"><span class="k-icon k-i-arrow-w"><\/span><\/a><\/li><li class="k-state-default k-nav-current"><span class="k-sm-date-format" data-#=ns#bind="text: formattedShortDate"><\/span><span class="k-lg-date-format" data-#=ns#bind="text: formattedDate"><\/span><\/li><li class="k-state-default k-nav-next"><a role="button" href="\\#" class="k-link"><span class="k-icon k-i-arrow-e"><\/span><\/a><\/li><\/ul><\/div>'),ki=function(t,r){var u={name:r.field},e=ui.date?"":i.attr("role")+'="datepicker" ',o=i.attr("role")+'="datetimepicker" ',f=r.model.isAllDay,s=i.attr("validate")+"='"+!f+"'",h=i.attr("validate")+"='"+f+"'";yt(u,r);pt(u,r);n('<input type="datetime-local" required '+i.attr("type")+'="date" '+o+i.attr("bind")+'="value:'+r.field+',invisible:isAllDay" '+s+"/>").attr(u).appendTo(t);n('<input type="date" required '+i.attr("type")+'="date" '+e+i.attr("bind")+'="value:'+r.field+',visible:isAllDay" '+h+"/>").attr(u).appendTo(t);n("<span "+i.attr("for")+'="'+r.field+'" class="k-invalid-msg"/>').hide().appendTo(t)},di=function(t,r){var u={name:r.field},f=r.model.isAllDay,e=i.attr("validate")+"='"+!f+"' ",o=i.attr("validate")+"='"+f+"' ";yt(u,r);pt(u,r);n('<input type="text" required '+i.attr("type")+'="date" '+i.attr("role")+'="datetimepicker" '+i.attr("bind")+'="value:'+r.field+',invisible:isAllDay" '+e+"/>").attr(u).appendTo(t);n('<input type="text" required '+i.attr("type")+'="date" '+i.attr("role")+'="datepicker" '+i.attr("bind")+'="value:'+r.field+',visible:isAllDay" '+o+"/>").attr(u).appendTo(t);n("<span "+i.attr("bind")+'="text: '+r.field+'Timezone"><\/span>').appendTo(t);r.field==="end"&&n("<span "+i.attr("bind")+'="text: startTimezone, invisible: endTimezone"><\/span>').appendTo(t);n("<span "+i.attr("for")+'="'+r.field+'" class="k-invalid-msg"/>').hide().appendTo(t)},gi=function(t,r){n("<div "+i.attr("bind")+'="value:'+r.field+'" />').attr({name:r.field}).appendTo(t).kendoRecurrenceEditor({start:r.model.start,timezone:r.timezone,messages:r.messages})},nr=function(t,r){n("<div "+i.attr("bind")+'="value:'+r.field+'" />').attr({name:r.field}).appendTo(t).kendoMobileRecurrenceEditor({start:r.model.start,timezone:r.timezone,messages:r.messages,pane:r.pane,value:r.model[r.field]})},tr=function(t,i){var r=vt(i.model,i.messages.noTimezone);n('<a href="#" class="k-button k-timezone-button" data-bind="invisible:isAllDay">'+r+"<\/a>").click(i.click).appendTo(t)},ir=function(t,i){n('<a href="#" class="k-button" data-bind="invisible:isAllDay">'+i.messages.timezoneEditorButton+"<\/a>").click(i.click).appendTo(t)},rr=function(t,r){n("<div "+i.attr("bind")+'="value:'+r.field+'" />').attr({name:r.field}).toggle(r.visible).appendTo(t).kendoMobileTimezoneEditor({optionLabel:r.noTimezone})},ur=function(t,r){n("<div "+i.attr("bind")+'="value:'+r.field+'" />').attr({name:r.field}).toggle(r.visible).appendTo(t).kendoTimezoneEditor({optionLabel:r.noTimezone})},kt=i.Class.extend({init:function(t,i){var r=t.timezone;this.reader=i;i.model&&(this.model=i.model);this.timezone=r;this.data=fr(n.proxy(this.data,this),r);this.serialize=er(n.proxy(this.serialize,this),r)},errors:function(n){return this.reader.errors(n)},parse:function(n){return this.reader.parse(n)},data:function(n){return this.reader.data(n)},total:function(n){return this.reader.total(n)},groups:function(n){return this.reader.groups(n)},aggregates:function(n){return this.reader.aggregates(n)},serialize:function(n){return this.reader.serialize(n)}}),d=i.data.Model.define({init:function(n){var t=this;i.data.Model.fn.init.call(t,n);t._defaultId=t.defaults[t.idField]},_time:function(n){var t=this[n],r="_"+n+"Time";return this[r]?this[r]-i.date.toUtcTime(i.date.getDate(t)):nt(t)},_date:function(n){var t="_"+n+"Time";return this[t]?this[t]-this._time(n):i.date.getDate(this[n])},clone:function(t,i){var u=this.uid,r=new this.constructor(n.extend({},this.toJSON(),t));return i||(r.uid=u),r},duration:function(){var n=this.end,t=this.start,r=(n.getTimezoneOffset()-t.getTimezoneOffset())*i.date.MS_PER_MINUTE;return n-t-r},expand:function(n,t,i){return v?v.expand(this,n,t,i):[this]},update:function(n){for(var t in n)this.set(t,n[t]);this._startTime&&this.set("_startTime",i.date.toUtcTime(this.start));this._endTime&&this.set("_endTime",i.date.toUtcTime(this.end))},isMultiDay:function(){return this.isAllDay||this.duration()>=i.date.MS_PER_DAY},isException:function(){return!this.isNew()&&this.recurrenceId},isOccurrence:function(){return this.isNew()&&this.recurrenceId},isRecurring:function(){return!!(this.recurrenceRule||this.recurrenceId)},isRecurrenceHead:function(){return!!(this.id&&this.recurrenceRule)},toOccurrence:function(t){return t=n.extend(t,{recurrenceException:null,recurrenceRule:null,recurrenceId:this.id||this.recurrenceId}),t[this.idField]=this.defaults[this.idField],this.clone(t,!0)},toJSON:function(){var n=i.data.Model.fn.toJSON.call(this);return n.uid=this.uid,delete n._startTime,delete n._endTime,n},shouldSerialize:function(n){return i.data.Model.fn.shouldSerialize.call(this,n)&&n!=="_defaultId"},set:function(n,t){var e=this.isAllDay||!1;if(i.data.Model.fn.set.call(this,n,t),n=="isAllDay"&&t!=e){var f=i.date.getDate(this.start),r=new Date(this.end),u=i.date.getMilliseconds(r);u===0&&t&&(u=b);this.set("start",f);t===!0?(i.date.setTime(r,-u),r<f&&(r=f)):i.date.setTime(r,b-u);this.set("end",r)}},id:"id",fields:{id:{type:"number"},title:{defaultValue:"",type:"string"},start:{type:"date",validation:{required:!0}},startTimezone:{type:"string"},end:{type:"date",validation:{required:!0,dateCompare:{value:or}}},endTimezone:{type:"string"},recurrenceRule:{defaultValue:"",type:"string"},recurrenceException:{defaultValue:"",type:"string"},isAllDay:{type:"boolean",defaultValue:!1},description:{type:"string"}}}),a=c.extend({init:function(n){c.fn.init.call(this,u(!0,{},{schema:{modelBase:d,model:d}},n));this.reader=new kt(this.options.schema,this.reader)},expand:function(n,t){var r=this.view(),u={};return n&&t&&(t=new Date(t.getTime()+b-1),u={logic:"or",filters:[{logic:"and",filters:[{field:"start",operator:"gte",value:n},{field:"end",operator:"gte",value:n},{field:"start",operator:"lte",value:t}]},{logic:"and",filters:[{field:"start",operator:"lte",value:new Date(n.getTime()+b-1)},{field:"end",operator:"gte",value:n}]}]},r=new i.data.Query(sr(r,n,t,this.reader.timezone)).filter(u).toArray()),r},cancelChanges:function(n){n&&n.isOccurrence()&&this._removeExceptionDate(n);c.fn.cancelChanges.call(this,n)},insert:function(n,t){if(t){if(!(t instanceof d)){var i=t;t=this._createNewModel();t.accept(i)}return(!this._pushCreated&&t.isRecurrenceHead()||t.recurrenceId)&&(t=t.recurrenceId?t:t.toOccurrence(),this._addExceptionDate(t)),c.fn.insert.call(this,n,t)}},pushCreate:function(n){this._pushCreated=!0;c.fn.pushCreate.call(this,n);this._pushCreated=!1},remove:function(n){return n.isRecurrenceHead()?this._removeExceptions(n):n.isRecurring()&&this._addExceptionDate(n),c.fn.remove.call(this,n)},_removeExceptions:function(n){for(var i=this.data().slice(0),t=i.shift(),r=n.id;t;)t.recurrenceId===r&&c.fn.remove.call(this,t),t=i.shift();n.set(ut,"")},_removeExceptionDate:function(n){var t,i;n.recurrenceId&&(t=this.get(n.recurrenceId),t&&(i=n.start,t.set(ut,t.recurrenceException.replace(v.toExceptionString(i,this.reader.timezone),""))))},_addExceptionDate:function(n){var t=n.start,i=this.reader.timezone,r=this.get(n.recurrenceId),u=r.recurrenceException||"";v.isException(u,t,i)||r.set(ut,u+v.toExceptionString(t,i))}}),ft,st,ri;a.create=function(n){(ct(n)||n instanceof i.data.ObservableArray)&&(n={data:n});var t=n||{},r=t.data;if(t.data=r,!(t instanceof a)&&t instanceof i.data.DataSource)throw new Error("Incorrect DataSource type. Only SchedulerDataSource instances are supported");return t instanceof a?t:new a(t)};u(!0,i.data,{SchedulerDataSource:a,SchedulerDataReader:kt,SchedulerEvent:d});ft={update:{text:"Save",className:"k-primary k-scheduler-update"},canceledit:{text:"Cancel",className:"k-scheduler-cancel"},destroy:{text:"Delete",imageClass:"k-delete",className:"k-primary k-scheduler-delete",iconClass:"k-icon"}};var ii={mobile:{dateRange:ki,timezonePopUp:tr,timezone:rr,recurrence:nr,description:ni,multipleResources:lr,resources:gt},desktop:{dateRange:di,timezonePopUp:ir,timezone:ur,recurrence:gi,description:ni,multipleResources:cr,resources:gt}},et=i.Observable.extend({init:function(n,t){i.Observable.fn.init.call(this);this.element=n;this.options=u(!0,{},this.options,t);this.createButton=this.options.createButton;this.toggleDateValidationHandler=l(this._toggleDateValidation,this)},_toggleDateValidation:function(t){if(t.field=="isAllDay"){var o=this.container,s=this.editable.options.model.isAllDay,u=i.attr("bind"),r,f,e;o.find("["+u+"*=end],["+u+"*=start]").each(function(){r=n(this);hi.test(r.attr(u))&&(f=r.is("["+i.attr("role")+"=datetimepicker],[type*=datetime]"),e=s!==f,r.attr(i.attr("validate"),e))})}},fields:function(n,t){var o=this,r=o.options.messages,s=o.options.timezone,h=function(n){n.preventDefault();o._initTimezoneEditor(t,this)},u=[{field:"title",title:r.editor.title},{field:"start",title:r.editor.start,editor:n.dateRange,timezone:s},{field:"end",title:r.editor.end,editor:n.dateRange,timezone:s},{field:"isAllDay",title:r.editor.allDayEvent}],e,f;for(i.timezone.windows_zones&&(u.push({field:"timezone",title:r.editor.timezone,editor:n.timezonePopUp,click:h,messages:r.editor,model:t}),u.push({field:"startTimezone",title:r.editor.startTimezone,editor:n.timezone,noTimezone:r.editor.noTimezone}),u.push({field:"endTimezone",title:r.editor.endTimezone,editor:n.timezone,noTimezone:r.editor.noTimezone})),t.recurrenceId||u.push({field:"recurrenceRule",title:r.editor.repeat,editor:n.recurrence,timezone:s,messages:r.recurrenceEditor,pane:this.pane}),("description"in t)&&u.push({field:"description",title:r.editor.description,editor:n.description({model:t,field:"description"})}),e=0;e<this.options.resources.length;e++)f=this.options.resources[e],u.push({field:f.field,title:f.title,editor:f.multiple?n.multipleResources(f,t):n.resources(f,t)});return u},end:function(){return this.editable.end()},_buildEditTemplate:function(n,t,r){var a=this.options.messages,c=u({},i.Template,this.options.templateSettings),v=c.paramName,s=this.options.editable.template,e="",h,l,f,o;if(s)typeof s===y&&(s=window.unescape(s)),e+=i.template(s,c)(n);else for(h=0,l=t.length;h<l;h++)f=t[h],f.field==="startTimezone"&&(e+='<div class="k-popup-edit-form k-scheduler-edit-form k-scheduler-timezones" style="display:none">',e+='<div class="k-edit-form-container">',e+='<div class="k-edit-label"><\/div>',e+='<div class="k-edit-field"><label class="k-check"><input class="k-timezone-toggle" type="checkbox" />'+a.editor.separateTimezones+"<\/label><\/div>"),e+='<div class="k-edit-label"><label for="'+f.field+'">'+(f.title||f.field||"")+"<\/label><\/div>",!n.editable||n.editable(f.field)?(r.push(f),e+="<div "+i.attr("container-for")+'="'+f.field+'" class="k-edit-field"><\/div>'):(o="#:",f.field?(f=i.expr(f.field,v),o+=f+"==null?'':"+f):o+="''",o+="#",o=i.template(o,c),e+='<div class="k-edit-field">'+o(n)+"<\/div>"),f.field==="endTimezone"&&(e+=this._createEndTimezoneButton());return e},_createEndTimezoneButton:function(){return"<\/div><\/div>"},_revertTimezones:function(n){n.set("startTimezone",this._startTimezone);n.set("endTimezone",this._endTimezone);delete this._startTimezone;delete this._endTimezone}}),ar=et.extend({init:function(){et.fn.init.apply(this,arguments);this.pane=i.mobile.ui.Pane.wrap(this.element);this.pane.element.parent().css("height",this.options.height);this.view=this.pane.view();this._actionSheetButtonTemplate=i.template('<li><a #=attr# class="k-button #=className#" href="\\#">#:text#<\/a><\/li>');this._actionSheetPopupOptions=n(document.documentElement).hasClass("km-root")?{modal:!1}:{align:"bottom center",position:"bottom center",effect:"slideIn:up"}},options:{animations:{left:"slide",right:"slide:right"}},destroy:function(){this.close();this.unbind();this.pane.destroy()},_initTimezoneEditor:function(t){var i=this,e=i.pane,s=i.options.messages,u=i.timezoneView,h=i.container.find(".k-scheduler-timezones"),f=h.find(".k-timezone-toggle"),c=h.find(".k-edit-label:last").add(h.find(".k-edit-field:last")),l=function(n){if(n.field==="startTimezone"){var i=t.startTimezone;f.prop("disabled",!i);i||(c.hide(),t.set("endTimezone",""),f.prop("checked",!1))}},a;if(i._startTimezone=t.startTimezone||"",i._endTimezone=t.endTimezone||"",!u){a='<div data-role="view" class="k-popup-edit-form k-scheduler-edit-form k-mobile-list"><div data-role="header" class="k-header"><a href="#" class="k-button k-scheduler-cancel">'+s.cancel+"<\/a>"+s.editor.timezoneTitle+'<a href="#" class="k-button k-scheduler-update">'+s.save+"<\/a><\/div><\/div>";this.timezoneView=u=e.append(a);u.contentElement().append(h.show());u.element.on(o+r,".k-scheduler-cancel, .k-scheduler-update",function(r){r.preventDefault();r.stopPropagation();n(this).hasClass("k-scheduler-cancel")&&i._revertTimezones(t);t.unbind("change",l);var u=e.element.find("#edit").data("kendoMobileView"),f=vt(t,s.editor.noTimezone);u.contentElement().find(".k-timezone-button").text(f);e.navigate(u,i.options.animations.right)});f.click(function(){c.toggle(f.prop("checked"));t.set("endTimezone","")});t.bind("change",l)}f.prop("checked",t.endTimezone).prop("disabled",!t.startTimezone);t.endTimezone?c.show():c.hide();e.navigate(u,i.options.animations.left)},_createActionSheetButton:function(n){return n.template=this._actionSheetButtonTemplate,this.createButton(n)},showDialog:function(t){var o="",f='<ul><li class="km-actionsheet-title">'+t.title+"<\/li>",e=this.element.find(".k-event["+i.attr("uid")+"='"+t.model.uid+"']"),r,u;for(this.container&&(e=this.container.find(".k-scheduler-delete"),e[0]&&(o="phone")),r=0;r<t.buttons.length;r++)f+=this._createActionSheetButton(t.buttons[r]);f+="<\/ul>";u=n(f).appendTo(this.pane.view().element).kendoMobileActionSheet({type:o,cancel:this.options.messages.cancel,cancelTemplate:'<li class="km-actionsheet-cancel"><a class="k-button" href="\\#">#:cancel#<\/a><\/li>',close:function(){this.destroy()},command:function(i){var r=u.element.find("li:not(.km-actionsheet-cancel) > .k-button").index(n(i.currentTarget));r>-1&&(u.close(),t.buttons[r].click())},popup:this._actionSheetPopupOptions}).data("kendoMobileActionSheet");u.open(e)},editEvent:function(t){var h=this.pane,f="",s=this.options.messages,a=s.save,v=s.destroy,y=s.cancel,p=s.editor.editorTitle,c,u;f+='<div data-role="view" class="k-popup-edit-form k-scheduler-edit-form k-mobile-list" id="edit" '+i.attr("uid")+'="'+t.uid+'"><div data-role="header" class="k-header"><a href="#" class="k-button k-scheduler-cancel">'+y+"<\/a>"+p+'<a href="#" class="k-button k-scheduler-update">'+a+"<\/a><\/div>";var w=this.fields(ii.mobile,t),e=this,l=[];if(f+=this._buildEditTemplate(t,w,l),!t.isNew()&&this.options.editable&&this.options.editable.destroy!==!1&&(f+='<div class="k-edit-buttons"><a href="#" class="k-scheduler-delete k-button">'+v+"<\/a><\/div>"),f+="<\/div>",c=h.append(f),u=this.container=c.element,this.editable=u.kendoEditable({fields:l,model:t,clearContainer:!1,target:e.options.target,validateOnBlur:!0}).data("kendoEditable"),u.find("input[type=checkbox],input[type=radio]").parent(".k-edit-field").addClass("k-check").prev(".k-edit-label").addClass("k-check").click(function(){n(this).next().children("input").click()}),this.trigger("edit",{container:u,model:t}))this.trigger("cancel",{container:u,model:t});else{u.on(o+r,"a.k-scheduler-edit, a.k-scheduler-cancel, a.k-scheduler-update, a.k-scheduler-delete",function(i){var r,f;i.preventDefault();i.stopPropagation();r=n(this);r.hasClass("k-scheduler-edit")?h.navigate("#edit",e.options.animations.right):(f="cancel",r.hasClass("k-scheduler-update")?f="save":r.hasClass("k-scheduler-delete")&&(f="remove"),e.trigger(f,{container:u,model:t}))});h.navigate(c,e.options.animations.left);t.bind("change",e.toggleDateValidationHandler)}return this.editable},_views:function(){return this.pane.element.find(i.roleSelector("view")).not(this.view.element)},close:function(){var n,i,t,r;if(this.container){for(this.pane.navigate("",this.options.animations.right),n=this._views(),t=0,r=n.length;t<r;t++)i=n.eq(t).data("kendoMobileView"),i&&i.purge();n.remove();this.container=null;this.editable&&(this.editable.options.model.unbind("change",this.toggleDateValidationHandler),this.editable.destroy(),this.editable=null);this.timezoneView=null}}}),vr=et.extend({destroy:function(){this.close();this.unbind()},editEvent:function(t){var f=this,l=f.options.editable,h="<div "+i.attr("uid")+'="'+t.uid+'" class="k-popup-edit-form k-scheduler-edit-form"><div class="k-edit-form-container">',c=f.options.messages,b=c.save,d=c.cancel,g=c.destroy,nt=this.fields(ii.desktop,t),v=[],a,y,s;if(h+=this._buildEditTemplate(t,nt,v),y=e(l)?l.window:{},h+='<div class="k-edit-buttons k-state-default">',h+=this.createButton({name:"update",text:b,attr:a})+this.createButton({name:"canceledit",text:d,attr:a}),t.isNew()||l.destroy===!1||(h+=this.createButton({name:"delete",text:g,attr:a})),h+="<\/div><\/div><\/div>",s=this.container=n(h).appendTo(f.element).eq(0).kendoWindow(u({modal:!0,resizable:!1,draggable:!0,title:c.editor.editorTitle,visible:!1,close:function(n){n.userTriggered&&f.trigger(k,{container:s,model:t})&&n.preventDefault()}},y)),f.editable=s.kendoEditable({fields:v,model:t,clearContainer:!1,validateOnBlur:!0,target:f.options.target}).data("kendoEditable"),f.trigger(w,{container:s,model:t}))f.trigger(k,{container:s,model:t});else{s.data("kendoWindow").center().open();s.on(o+r,"a.k-scheduler-cancel",function(n){n.preventDefault();n.stopPropagation();f.trigger(k,{container:s,model:t})});s.on(o+r,"a.k-scheduler-update",function(n){n.preventDefault();n.stopPropagation();f.trigger("save",{container:s,model:t})});s.on(o+r,"a.k-scheduler-delete",function(n){n.preventDefault();n.stopPropagation();f.trigger(p,{container:s,model:t})});i.cycleForm(s);t.bind("change",f.toggleDateValidationHandler)}return f.editable},close:function(){var n=this,t=function(){n.editable&&(n.editable.options.model.unbind("change",n.toggleDateValidationHandler),n.editable.destroy(),n.editable=null,n.container=null);n.popup&&(n.popup.destroy(),n.popup=null)};n.editable?(n._timezonePopup&&n._timezonePopup.data("kendoWindow")&&(n._timezonePopup.data("kendoWindow").destroy(),n._timezonePopup=null),n.container.is(":visible")?n.container.data("kendoWindow").bind("deactivate",t).close():t()):t()},_createEndTimezoneButton:function(){var t=this.options.messages,n="";return n+='<div class="k-edit-buttons k-state-default">',n+=this.createButton({name:"savetimezone",text:t.save})+this.createButton({name:"canceltimezone",text:t.cancel}),n+"<\/div><\/div><\/div>"},showDialog:function(t){var r=i.format("<div class='k-popup-edit-form'><div class='k-edit-form-container'><p class='k-popup-message'>{0}<\/p>",t.text),u,f,e;for(r+='<div class="k-edit-buttons k-state-default">',u=0;u<t.buttons.length;u++)r+=this.createButton(t.buttons[u]);r+="<\/div><\/div><\/div>";f=this.element;this.popup&&this.popup.destroy();e=this.popup=n(r).appendTo(f).eq(0).on("click",".k-button",function(i){i.preventDefault();e.close();var r=n(i.currentTarget).index();t.buttons[r].click()}).kendoWindow({modal:!0,resizable:!1,draggable:!1,title:t.title,visible:!1,close:function(){this.destroy();f.focus()}}).getKendoWindow();e.center().open()},_initTimezoneEditor:function(n,t){var i=this,r=i.container.find(".k-scheduler-timezones"),u=r.find(".k-timezone-toggle"),f=r.find(".k-edit-label:last").add(r.find(".k-edit-field:last")),h=r.find(".k-scheduler-savetimezone"),c=r.find(".k-scheduler-canceltimezone"),o=i._timezonePopup,s=function(t){if(t.field==="startTimezone"){var i=n.startTimezone;u.prop("disabled",!i);i||(f.hide(),n.set("endTimezone",""),u.prop("checked",!1))}},e;i._startTimezone=n.startTimezone;i._endTimezone=n.endTimezone;o||(i._timezonePopup=o=r.kendoWindow({modal:!0,resizable:!1,draggable:!0,title:i.options.messages.editor.timezoneEditorTitle,visible:!1,close:function(r){n.unbind("change",s);r.userTriggered&&i._revertTimezones(n);t&&t.focus()}}),u.click(function(){f.toggle(u.prop("checked"));n.set("endTimezone","")}),h.click(function(n){n.preventDefault();e.close()}),c.click(function(t){t.preventDefault();i._revertTimezones(n);e.close()}),n.bind("change",s));u.prop("checked",n.endTimezone).prop("disabled",!n.startTimezone);n.endTimezone?f.show():f.hide();e=o.data("kendoWindow");e.center().open()}}),ot=fi.extend({init:function(t,u){var f=this;s.fn.init.call(f,t,u);f.options.views&&f.options.views.length||(f.options.views=["day","week"]);f.resources=[];f._initModel();f._wrapper();f._views();f._toolbar();f._dataSource();f._resources();f._resizeHandler=function(){f.resize()};f.wrapper.on("mousedown"+r+" selectstart"+r,function(t){n(t.target).is(":kendoFocusable")||t.preventDefault()});f.options.editable&&f.options.editable.resize!==!1&&f._resizable();f._movable();f._bindResize();f.options.messages&&f.options.messages.recurrence&&(v.options=f.options.messages.recurrence);f._selectable();f._ariaId=i.guid();f._createEditor()},_bindResize:function(){n(window).on("resize"+r,this._resizeHandler)},_unbindResize:function(){n(window).off("resize"+r,this._resizeHandler)},dataItems:function(){for(var e=this,l=e.items(),o=e._data,s=n.map(l,function(t){return n(t).attr("data-uid")}),h,r={},a=s.length,c,u,f,i=0;i<a;i++)r[s[i]]=null;for(c=o.length,i=0;i<c;i++)u=o[i],r[u.uid]!==t&&(r[u.uid]=u);f=[];for(h in r)f.push(r[h]);return f},_isMobile:function(){var n=this.options;return n.mobile===!0&&i.support.mobileOS||n.mobile==="phone"||n.mobile==="tablet"},_isMobilePhoneView:function(){var n=this.options;return n.mobile===!0&&i.support.mobileOS&&!i.support.mobileOS.tablet||n.mobile==="phone"},_groupsByResource:function(n,t,r,u,f){var o,e,h,c,s,l,a;if(r||(r=[]),o=n[0],o){for(h=o.dataSource.view(),c=0,s=0;s<h.length;s++)l=i.getter(o.dataValueField)(h[s]),a=t+c+s,e=this._groupsByResource(n.slice(1),a,r,l,o.field),e[o.field]=l,c=e.groupIndex,f&&u&&(e[f]=u),n.length===1&&(e.groupIndex=t+s,r.push(e));return e}return{}},data:function(){return this._data},select:function(r){var u=this,e=u.view(),s=u._selection,c=e.groups,h,y,p,l,a,v,w,b,k,o;if(r===t)return(p=e._selectedSlots,!s)?[]:(s&&s.events&&(y=u._selectedEvents()),{start:s.start,end:s.end,events:y,slots:p,resources:e._resourceBySlot(s)});if(!r){u._selection=null;e.clearSelection();return}if(n.isArray(r)&&(r={events:r.splice(0)}),r.resources){a=[];v=[];e.groupedResources&&u._groupsByResource(e.groupedResources,0,v);for(l in r.resources)a.push({field:l,operator:"eq",value:r.resources[l]});h=new i.data.Query(v).filter(a).toArray()}if(r.events&&r.events.length){u._selectEvents(r.events,h);u._select();return}c&&r.start&&r.end&&(w=f(e._startDate),b=i.date.addDays(f(e._endDate),1),r.start<b&&w<=r.end&&(k=h&&h.length?c[h[0].groupIndex]:c[0],o=k.ranges(r.start,r.end,r.isAllDay,!1),o.length&&(u._selection={start:i.timezone.toLocalDate(o[0].start.start),end:i.timezone.toLocalDate(o[o.length-1].end.end),groupIndex:o[0].start.groupIndex,index:o[0].start.index,isAllDay:o[0].start.isDaySlot,events:[]},u._select())))},_selectEvents:function(n,t){for(var s=this,c=s.view(),l=c.groups,a=n.length,v=t&&t.length,e,o,h,u=0;u<a;u++)if(l&&v){var f=l[t[0].groupIndex],r=[],y=f.timeSlotCollectionCount(),p=f.daySlotCollectionCount();for(e=0;e<y;e++)r=r.concat(f.getTimeSlotCollection(e).events());for(o=0;o<p;o++)r=r.concat(f.getDaySlotCollection(o).events());r=new i.data.Query(r).filter({field:"element[0].getAttribute('data-uid')",operator:"eq",value:n[u]}).toArray();r[0]&&s._createSelection(r[0].element)}else h=c.element.find(i.format(".k-event[data-uid={0}], .k-task[data-uid={0}]",n[u])),h.length&&s._createSelection(h[0])},_selectable:function(){var t=this,u=t.wrapper,e=i.support.mobileOS?"touchend":"mousedown",f;if(t.options.selectable){t._tabindex();u.on(e+r,".k-scheduler-header-all-day td, .k-scheduler-content td, .k-event",function(n){var r=n.which,f=n.button,e=i.support.browser,o=r&&r===3||f&&f==2;i.support.mobileOS&&n.isDefaultPrevented()||(o||t._createSelection(n.currentTarget),u.focus(),e.msie&&e.version<9&&setTimeout(function(){u.focus()}))});f=n.proxy(t._mouseMove,t);u.on("mousedown"+r,".k-scheduler-header-all-day td, .k-scheduler-content td",function(n){var t=n.which,i=n.button,e=t&&t===3||i&&i==2;if(!e)u.on("mousemove"+r,".k-scheduler-header-all-day td, .k-scheduler-content td",f)});u.on("mouseup"+r+" mouseleave"+r,function(){u.off("mousemove"+r,".k-scheduler-header-all-day td, .k-scheduler-content td",f)});u.on("focus"+r,function(){t._selection||t._createSelection(t.wrapper.find(".k-scheduler-content").find("td:first"));t._select()});u.on("focusout"+r,function(){t.view().clearSelection();t._ctrlKey=t._shiftKey=!1});u.on("keydown"+r,l(t._keydown,t));u.on("keyup"+r,function(n){t._ctrlKey=n.ctrlKey;t._shiftKey=n.shiftKey})}},_select:function(){var t=this,e=t.view(),c=t.wrapper,r=e.current(),u=t._selection,o;if(r&&(r.removeAttribute("id"),r.removeAttribute("aria-label"),c.removeAttr("aria-activedescendant")),e.select(u),r=e.current(),r&&t._old!==r){if(o=n(r).data("uid"),t._old&&o&&o===n(t._old).data("uid"))return;var s,f=u,h=t._selectedEvents(),l=e._selectedSlots;h[0]?(f=h[0]||u,s=i.format(t.options.messages.ariaEventLabel,f.title,f.start,f.start)):s=i.format(t.options.messages.ariaSlotLabel,f.start,f.end);r.setAttribute("id",t._ariaId);r.setAttribute("aria-label",s);c.attr("aria-activedescendant",t._ariaId);t._old=r;t.trigger("change",{start:u.start,end:u.end,events:h,slots:l,resources:e._resourceBySlot(u)})}},_selectedEvents:function(){for(var i=this._selection.events,u=i.length,n=0,t,r=[];n<u;n++)t=this.occurrenceByUid(i[n]),t&&r.push(t);return r},_mouseMove:function(t){var i=this;clearTimeout(i._moveTimer);i._moveTimer=setTimeout(function(){var o=i.view(),r=i._selection,u,f,e;r&&(u=o.selectionByElement(n(t.currentTarget)),u&&r.groupIndex===u.groupIndex&&(f=u.startDate(),e=u.endDate(),f>=r.end?r.backward=!1:e<=r.start&&(r.backward=!0),r.backward?r.start=f:r.end=e,i._select()))},5)},_viewByIndex:function(n){var t,i=this.views;for(t in i){if(!n)return t;n--}},_keydown:function(t){var r=this,e=t.keyCode,o=r.view(),s=o.options.editable,f=r._selection,h=t.shiftKey;r._ctrlKey=t.ctrlKey;r._shiftKey=t.shiftKey;e===tt.TAB?o.moveToEvent(f,h)&&(r._select(),t.preventDefault()):s&&e===tt.ENTER?f.events.length?s.update!==!1&&r.editEvent(f.events[0]):s.create!==!1&&(f.isAllDay&&(f=n.extend({},f,{end:i.date.addDays(f.end,-1)})),r.addEvent(u({},f,o._resourceBySlot(f)))):e===tt.DELETE&&s!==!1&&s.destroy!==!1?r.removeEvent(f.events[0]):e>=49&&e<=57?r.view(r._viewByIndex(e-49)):o.move(f,e,h)&&(o.inRange(f)?r._select():r.date(f.start),t.preventDefault());r._adjustSelectedDate()},_createSelection:function(t){var u,r,f;this._selection&&(this._ctrlKey||this._shiftKey)||(this._selection={events:[],groupIndex:0});t=n(t);f=this._selection;t.is(".k-event")&&(u=t.attr(i.attr("uid")));r=this.view().selectionByElement(t);r&&(f.groupIndex=r.groupIndex||0);u&&(r=bt(this._data,u));r&&r.uid&&(u=[r.uid]);this._updateSelection(r,u);this._adjustSelectedDate()},_updateSelection:function(n,t){var r=this._selection,u,f;n&&r&&(u=this.view(),n.uid&&(n=u._updateEventForSelection(n)),this._shiftKey&&r.start&&r.end?(f=n.end<r.end,r.end=n.endDate?n.endDate():n.end,f&&u._timeSlotInterval&&i.date.setTime(r.end,-u._timeSlotInterval())):(r.start=n.startDate?n.startDate():n.start,r.end=n.endDate?n.endDate():n.end),r.isAllDay="isDaySlot"in n?n.isDaySlot:n.isAllDay,r.index=n.index,r.events=this._ctrlKey?r.events.concat(t||[]):t||[])},options:{name:"Scheduler",date:ci,editable:!0,autoBind:!0,snap:!0,mobile:!1,timezone:"",allDaySlot:!0,min:new Date(1900,0,1),max:new Date(2099,11,31),toolbar:null,messages:{today:"Today",pdf:"Export to PDF",save:"Save",cancel:"Cancel",destroy:"Delete",deleteWindowTitle:"Delete event",ariaSlotLabel:"Selected from {0:t} to {1:t}",ariaEventLabel:"{0} on {1:D} at {2:t}",views:{day:"Day",week:"Week",workWeek:"Work Week",agenda:"Agenda",month:"Month",timeline:"Timeline",timelineWeek:"Timeline Week",timelineWorkWeek:"Timeline Work Week",timelineMonth:"Timeline Month"},recurrenceMessages:{deleteWindowTitle:"Delete Recurring Item",deleteWindowOccurrence:"Delete current occurrence",deleteWindowSeries:"Delete the series",editWindowTitle:"Edit Recurring Item",editWindowOccurrence:"Edit current occurrence",editWindowSeries:"Edit the series"},editable:{confirmation:"Are you sure you want to delete this event?"},editor:{title:"Title",start:"Start",end:"End",allDayEvent:"All day event",description:"Description",repeat:"Repeat",timezone:" ",startTimezone:"Start timezone",endTimezone:"End timezone",separateTimezones:"Use separate start and end time zones",timezoneEditorTitle:"Timezones",timezoneEditorButton:"Time zone",timezoneTitle:"Time zones",noTimezone:"No timezone",editorTitle:"Event"}},height:null,width:null,resources:[],group:{resources:[],direction:"horizontal"},views:[],selectable:!1},events:[p,w,k,rt,"add","dataBinding","dataBound","moveStart","move","moveEnd","resizeStart","resize","resizeEnd","navigate","change"],destroy:function(){var t=this,u;s.fn.destroy.call(t);t.dataSource&&(t.dataSource.unbind(it,t._refreshHandler),t.dataSource.unbind("progress",t._progressHandler),t.dataSource.unbind("error",t._errorHandler));t.calendar&&(t.calendar.destroy(),t.popup.destroy());t.view()&&t.view().destroy();t._editor&&t._editor.destroy();this._moveDraggable&&this._moveDraggable.destroy();this._resizeDraggable&&this._resizeDraggable.destroy();u=t.element.add(t.wrapper).add(t.toolbar).add(t.popup);u.off(r);clearTimeout(t._moveTimer);t._model=null;t.toolbar=null;t.element=null;n(window).off("resize"+r,t._resizeHandler);i.destroy(t.wrapper)},setDataSource:function(n){this.options.dataSource=n;this._dataSource();this.options.autoBind&&n.fetch()},items:function(){return this.wrapper.find(".k-scheduler-content").children(".k-event, .k-task")},_movable:function(){var e,r,o,s,f,u,t=this,c,l=0,h=t._isMobile(),a=t.options.editable&&t.options.editable.move!==!1,v=t.options.editable&&t.options.editable.resize!==!1;(a||v&&h)&&(h&&i.support.mobileOS.android&&(l=5),t._moveDraggable=new i.ui.Draggable(t.element,{distance:l,filter:".k-event",ignore:".k-resize-handle",holdToDrag:h}),a&&t._moveDraggable.bind("dragstart",function(n){var s=t.view(),l=n.currentTarget;if(!s.options.editable||s.options.editable.move===!1){n.preventDefault();return}if(h&&!l.hasClass("k-event-active")){t.element.find(".k-event-active").removeClass("k-event-active");n.preventDefault();return}f=t.occurrenceByUid(l.attr(i.attr("uid")));u=f.clone();u.update(s._eventOptionsForMove(u));e=s._slotByPosition(n.x.startLocation,n.y.startLocation);o=e.startOffset(n.x.startLocation,n.y.startLocation,t.options.snap);r=e;c=e;(!e||t.trigger("moveStart",{event:f}))&&n.preventDefault()}).bind("drag",function(n){var c=t.view(),h=c._slotByPosition(n.x.location,n.y.location),l,a;h&&(s=h.startOffset(n.x.location,n.y.location,t.options.snap),h.isDaySlot!==e.isDaySlot?(e=c._slotByPosition(n.x.location,n.y.location),o=e.startOffset(n.x.location,n.y.location,t.options.snap),l=s-o,u.isAllDay=h.isDaySlot,u.start=i.timezone.toLocalDate(o),u.end=i.timezone.toLocalDate(s),c._updateMoveHint(u,h.groupIndex,l),a={start:u.start,end:u.end}):(l=s-o,c._updateMoveHint(u,h.groupIndex,l),a=ti(u,l)),t.trigger("move",{event:f,slot:{element:h.element,start:h.startDate(),end:h.endDate(),isDaySlot:h.isDaySlot},resources:c._resourceBySlot(h),start:a.start,end:a.end})?c._updateMoveHint(u,h.groupIndex,l):r=h)}).bind("dragend",function(h){var y,w;t.view()._removeMoveHint();var b=s-o,p=ti(u,b),a=p.start,v=p.end,l=t.view()._resourceBySlot(r),k=t.view()._resourceBySlot(e),d=t.trigger("moveEnd",{event:f,slot:{element:r.element,start:r.startDate(),end:r.endDate()},start:a,end:v,resources:l});d||f.start.getTime()===a.getTime()&&f.end.getTime()===v.getTime()&&c.isDaySlot===r.isDaySlot&&i.stringify(l)===i.stringify(k)||(y=t.view()._eventOptionsForMove(f),w=c.isDaySlot!==r.isDaySlot?r.isDaySlot?n.extend({start:r.startDate(),end:r.startDate(),isAllDay:r.isDaySlot},y,l):n.extend({isAllDay:r.isDaySlot,start:a,end:v},y,l):n.extend({isAllDay:f.isAllDay,start:a,end:v},y,l),t._updateEvent(null,f,w));h.currentTarget.removeClass("k-event-active");this.cancelHold()}).bind("dragcancel",function(){t.view()._removeMoveHint();this.cancelHold()}),h&&(t._moveDraggable.bind("hold",function(n){t.element.find(".k-scheduler-monthview").length&&n.preventDefault();t.element.find(".k-event-active").removeClass("k-event-active");n.currentTarget.addClass("k-event-active")}),t._moveDraggable.userEvents.bind("press",function(n){n.preventDefault()})))},_resizable:function(){function h(n){var t={"k-resize-e":"east","k-resize-w":"west","k-resize-n":"north","k-resize-s":"south"};for(var i in t)if(n.hasClass(i))return t[i]}var e,f,o,u,t,r=this,s=0;r._isMobile()&&i.support.mobileOS.android&&(s=5);r._resizeDraggable=new i.ui.Draggable(r.element,{distance:s,filter:".k-resize-handle",dragstart:function(s){var c=n(s.currentTarget),l=c.closest(".k-event"),a=l.attr(i.attr("uid")),h=r.view();o=r.occurrenceByUid(a);u=o.clone();h._updateEventForResize(u);t=h._slotByPosition(s.x.startLocation,s.y.startLocation);r.trigger("resizeStart",{event:o})&&s.preventDefault();e=i.date.toUtcTime(u.start);f=i.date.toUtcTime(u.end)},drag:function(s){var v,y;if(t){var p=n(s.currentTarget),l=h(p),c=r.view(),a=c._slotByPosition(s.x.location,s.y.location);a&&t.groupIndex==a.groupIndex&&(t=a,v=e,y=f,l=="south"?!t.isDaySlot&&t.end-i.date.toUtcTime(u.start)>=c._timeSlotInterval()&&(f=u.isAllDay?t.startOffset(s.x.location,s.y.location,r.options.snap):t.endOffset(s.x.location,s.y.location,r.options.snap)):l=="north"?!t.isDaySlot&&i.date.toUtcTime(u.end)-t.start>=c._timeSlotInterval()&&(e=t.startOffset(s.x.location,s.y.location,r.options.snap)):l=="east"?t.isDaySlot&&i.date.toUtcTime(i.date.getDate(t.endDate()))>=i.date.toUtcTime(i.date.getDate(u.start))?f=u.isAllDay?t.startOffset(s.x.location,s.y.location,r.options.snap):t.endOffset(s.x.location,s.y.location,r.options.snap):!t.isDaySlot&&t.end-i.date.toUtcTime(u.start)>=c._timeSlotInterval()&&(f=t.endOffset(s.x.location,s.y.location,r.options.snap)):l=="west"&&(t.isDaySlot&&i.date.toUtcTime(i.date.getDate(u.end))>=i.date.toUtcTime(i.date.getDate(t.startDate()))?e=t.startOffset(s.x.location,s.y.location,r.options.snap):!t.isDaySlot&&i.date.toUtcTime(u.end)-t.start>=c._timeSlotInterval()&&(e=t.startOffset(s.x.location,s.y.location,r.options.snap))),r.trigger("resize",{event:o,slot:{element:t.element,start:t.startDate(),end:t.endDate()},start:i.timezone.toLocalDate(e),end:i.timezone.toLocalDate(f),resources:c._resourceBySlot(t)})?(e=v,f=y):c._updateResizeHint(u,t.groupIndex,e,f))}},dragend:function(s){var y=n(s.currentTarget),c=new Date(u.start.getTime()),l=new Date(u.end.getTime()),a=h(y),v;r.view()._removeResizeHint();a=="south"?l=i.timezone.toLocalDate(f):a=="north"?c=i.timezone.toLocalDate(e):a=="east"?l=t.isDaySlot?i.date.getDate(i.timezone.toLocalDate(f)):i.timezone.toLocalDate(f):a=="west"&&(t.isDaySlot?(c=new Date(i.timezone.toLocalDate(e)),c.setHours(0),c.setMinutes(0)):c=i.timezone.toLocalDate(e));v=r.trigger("resizeEnd",{event:o,slot:{element:t.element,start:t.startDate(),end:t.endDate()},start:c,end:l,resources:r.view()._resourceBySlot(t)});!v&&l.getTime()>=c.getTime()&&(u.start.getTime()!=c.getTime()||u.end.getTime()!=l.getTime())&&(r.view()._updateEventForResize(o),r._updateEvent(a,o,{start:c,end:l}));t=null;o=null},dragcancel:function(){r.view()._removeResizeHint();t=null;o=null}})},_updateEvent:function(n,t,r){var u=this,e=function(n,t){try{u._preventRefresh=!0;n.update(r);u._convertDates(n)}finally{u._preventRefresh=!1}u.trigger(rt,{event:n})||(t&&t(),u._updateSelection(n),u.dataSource.sync())},o=function(n){return n.recurrenceRule?u.dataSource.getByUid(n.uid):u.dataSource.get(n.recurrenceId)},s=function(){var f=o(t),s,h;(n=="south"||n=="north")&&(r.start&&(s=i.date.getDate(f.start),i.date.setTime(s,nt(r.start)),r.start=s),r.end&&(h=i.date.getDate(f.end),i.date.setTime(h,nt(r.end)),r.end=h));u.dataSource._removeExceptions(f);e(f)},h=function(){var n=o(t),i=function(){u._convertDates(n)},r=n.toOccurrence({start:t.start,end:t.end});e(u.dataSource.add(r),i)},f;t.recurrenceRule||t.isOccurrence()?(f=u.options.messages.recurrenceMessages,u._showRecurringDialog(t,h,s,{title:f.editWindowTitle,text:f.editRecurring?f.editRecurring:at,occurrenceText:f.editWindowOccurrence,seriesText:f.editWindowSeries})):e(u.dataSource.getByUid(t.uid))},_modelForContainer:function(t){return t=n(t).closest("["+i.attr("uid")+"]"),this.dataSource.getByUid(t.attr(i.attr("uid")))},showDialog:function(n){this._editor.showDialog(n)},focus:function(){this.wrapper.focus()},_confirmation:function(n,t){var u=this.options.editable,r,e;if(u===!0||u.confirmation!==!1){var f=this.options.messages,o=f.deleteWindowTitle,s=typeof u.confirmation===y?u.confirmation:f.editable.confirmation;this._isEditorOpened()&&t.isRecurring()&&(r=this.options.messages.recurrenceMessages,o=r.deleteWindowTitle,s=t.isException()?r.deleteRecurringConfirmation?r.deleteRecurringConfirmation:ai:r.deleteSeriesConfirmation?r.deleteSeriesConfirmation:vi);e=[{name:"destroy",text:f.destroy,click:function(){n()}}];this._isMobile()&&i.mobile.ui.Pane||e.push({name:"canceledit",text:f.cancel,click:function(){n(!0)}});this._unbindResize();this.showDialog({model:t,text:s,title:o,buttons:e});this._bindResize()}else n()},addEvent:function(n){var t=this._editor.editable,u=this.dataSource,i,r;n=n||{};r=this.trigger("add",{event:n});!r&&(t&&t.end()||!t)&&(this.cancelEvent(),n&&n.toJSON&&(n=n.toJSON()),i=u.add(n),i&&(this.cancelEvent(),this._editEvent(i)))},saveEvent:function(){var t=this._editor;if(t){var r=t.editable,i=t.container,n=this._modelForContainer(i);i&&r&&r.end()&&!this.trigger(rt,{container:i,event:n})&&(n.isRecurrenceHead()&&this.dataSource._removeExceptions(n),n.dirty||n.isOccurrence()||this._convertDates(n,"remove"),this.dataSource.sync())}},cancelEvent:function(){var t=this._editor,i=t.container,n;i&&(n=this._modelForContainer(i),n&&n.isOccurrence()&&(this._convertDates(n,"remove"),this._convertDates(this.dataSource.get(n.recurrenceId),"remove")),this.dataSource.cancelChanges(n),t.close())},editEvent:function(n){var t=typeof n=="string"?this.occurrenceByUid(n):n;t&&(this.cancelEvent(),t.isRecurring()?this._editRecurringDialog(t):this._editEvent(t))},_editEvent:function(n){this._unbindResize();this._createPopupEditor(n);this._bindResize()},_editRecurringDialog:function(n){var t=this,r=function(){n.isException()?t._editEvent(n):t.addEvent(n)},u=function(){n.recurrenceId&&(n=t.dataSource.get(n.recurrenceId));t._editEvent(n)},i=t.options.messages.recurrenceMessages;t._showRecurringDialog(n,r,u,{title:i.editWindowTitle,text:i.editRecurring?i.editRecurring:at,occurrenceText:i.editWindowOccurrence,seriesText:i.editWindowSeries})},_showRecurringDialog:function(n,t,i,r){var u=this,f=u.options.editable,o=e(f)?f.editRecurringMode:"dialog";o==="series"?i():o==="occurrence"?t():(this._unbindResize(),u.showDialog({model:n,title:r.title,text:r.text,buttons:[{text:r.occurrenceText,click:t},{text:r.seriesText,click:i}]}),this._bindResize())},_createButton:function(n){var f=n.template||yi,t=typeof n===y?n:n.name||n.text,r={className:"k-scheduler-"+(t||"").replace(/\s/g,""),text:t,attr:""};if(!t&&!(e(n)&&n.template))throw new Error("Custom commands should have name specified");return e(n)?(n.className&&(n.className+=" "+r.className),t==="edit"&&e(n.text)&&(n=u(!0,{},n),n.text=n.text.edit),r=u(!0,r,ft[t],n)):r=u(!0,r,ft[t]),i.template(f)(r)},_convertDates:function(n,t){var f=this.dataSource.reader.timezone,r=n.startTimezone,u=n.endTimezone,e=n.start,o=n.start;t=t||"apply";r=r||u;u=u||r;r&&(f?t==="apply"?(e=i.timezone.convert(n.start,f,r),o=i.timezone.convert(n.end,f,u)):(e=i.timezone.convert(n.start,r,f),o=i.timezone.convert(n.end,u,f)):(e=i.timezone[t](n.start,r),o=i.timezone[t](n.end,u)),n._set("start",e),n._set("end",o))},_createEditor:function(){var n=this,t;t=this._isMobile()&&i.mobile.ui.Pane?n._editor=new ar(this.wrapper,u({},this.options,{target:this,timezone:n.dataSource.reader.timezone,resources:n.resources,createButton:l(this._createButton,this)})):n._editor=new vr(this.wrapper,u({},this.options,{target:this,createButton:l(this._createButton,this),timezone:n.dataSource.reader.timezone,resources:n.resources}));t.bind("cancel",function(t){if(n.trigger("cancel",{container:t.container,event:t.model})){t.preventDefault();return}n.cancelEvent();n.focus()});t.bind("edit",function(t){n.trigger(w,{container:t.container,event:t.model})&&t.preventDefault()});t.bind("save",function(){n.saveEvent()});t.bind("remove",function(t){n.removeEvent(t.model)})},_createPopupEditor:function(n){var t=this._editor;(!n.isNew()||n.isOccurrence())&&(n.isOccurrence()&&this._convertDates(n.recurrenceId?this.dataSource.get(n.recurrenceId):n),this._convertDates(n));this.editable=t.editEvent(n)},removeEvent:function(n){var i=this,t=typeof n=="string"?i.occurrenceByUid(n):n;t&&(t.isRecurring()?i._deleteRecurringDialog(t):i._confirmation(function(n){n||i._removeEvent(t)},t))},occurrenceByUid:function(n){var t=this.dataSource.getByUid(n);return t||(t=bt(this._data,n)),t},occurrencesInRange:function(n,t){return new i.data.Query(this._data).filter({logic:"or",filters:[{logic:"and",filters:[{field:"start",operator:"gte",value:n},{field:"end",operator:"gte",value:n},{field:"start",operator:"lt",value:t}]},{logic:"and",filters:[{field:"start",operator:"lte",value:n},{field:"end",operator:"gt",value:n}]}]}).toArray()},_removeEvent:function(n){this.trigger(p,{event:n})||this.dataSource.remove(n)&&this.dataSource.sync()},_deleteRecurringDialog:function(n){var t=this,i=n,h=t.options.editable,u,f,c,l,a=e(h)?h.editRecurringMode:"dialog",o,s,r;u=function(){var n=i.recurrenceId?i:i.toOccurrence(),r=t.dataSource.get(n.recurrenceId);t._convertDates(r);t._removeEvent(n)};f=function(){i.recurrenceId&&(i=t.dataSource.get(i.recurrenceId));t._removeEvent(i)};(a!="dialog"||t._isEditorOpened())&&(c=function(){t._confirmation(function(n){n||u()},i)},l=function(){t._confirmation(function(n){n||f()},i)});o=l||f;s=c||u;t._isEditorOpened()?n.isException()?s():o():(r=t.options.messages.recurrenceMessages,t._showRecurringDialog(n,s,o,{title:r.deleteWindowTitle,text:r.deleteRecurring?r.deleteRecurring:li,occurrenceText:r.deleteWindowOccurrence,seriesText:r.deleteWindowSeries}))},_isEditorOpened:function(){return!!this._editor.container},_unbindView:function(n){var t=this;t.angular("cleanup",function(){return{elements:t.items()}});n.destroy()},_bindView:function(n){var t=this;t.options.editable&&(t._viewRemoveHandler&&n.unbind(p,t._viewRemoveHandler),t._viewRemoveHandler=function(n){t.removeEvent(n.uid)},n.bind(p,t._viewRemoveHandler),t._viewAddHandler&&n.unbind(lt,t._viewAddHandler),t._viewAddHandler=function(n){t.addEvent(n.eventInfo)},n.bind(lt,this._viewAddHandler),t._viewEditHandler&&n.unbind(w,t._viewEditHandler),t._viewEditHandler=function(n){t.editEvent(n.uid)},n.bind(w,this._viewEditHandler));t._viewNavigateHandler&&n.unbind("navigate",t._viewNavigateHandler);t._viewNavigateHandler=function(n){if(n.view){var i="isWorkDay"in n,r=i?"changeWorkDay":"changeView";t.trigger("navigate",{view:n.view,isWorkDay:n.isWorkDay,action:r,date:n.date})||(i&&(t._workDayMode=n.isWorkDay),t._selectView(n.view),t.date(n.date))}};n.bind("navigate",t._viewNavigateHandler);t._viewActivateHandler&&n.unbind("activate",t._viewActivateHandler);t._viewActivateHandler=function(){var n=this;t._selection&&(n.constrainSelection(t._selection),t._select(),t._adjustSelectedDate())};n.bind("activate",t._viewActivateHandler)},_selectView:function(n){var t=this,r,u,f;n&&t.views[n]&&(t._selectedView&&t._unbindView(t._selectedView),t._selectedView=t._renderView(n),t._selectedViewName=n,t._viewsCount>1&&(r=pi({views:t.views,view:n,ns:i.ns}),u=t.toolbar.find(".k-scheduler-views li:first-child"),u.is(".k-current-view")?u.replaceWith(r):t.toolbar.find(".k-scheduler-views").prepend(r),f=t.toolbar.find(".k-scheduler-views li").removeClass("k-state-selected"),f.end().find(".k-view-"+n.replace(/\./g,"\\.").toLowerCase()).addClass("k-state-selected")))},view:function(n){var t=this;if(n){t._selectView(n);t.rebind();return}return t._selectedView},viewName:function(){return this.view().name},_renderView:function(n){var t=this._initializeView(n);return this._bindView(t),this._model.set("formattedDate",t.dateForTitle()),this._model.set("formattedShortDate",t.shortDateForTitle()),t},resize:function(n){var t=this.getSize(),i=this._size,r=this.view();r&&r.groups&&(n||!i||t.width!==i.width||t.height!==i.height)&&(this.refresh({action:"resize"}),this._size=t)},_adjustSelectedDate:function(){var t=this._model.selectedDate,r=this._selection,n=r.start;n&&!i.date.isInDateRange(t,f(n),f(r.end))&&t.setFullYear(n.getFullYear(),n.getMonth(),n.getDate())},_initializeView:function(n){var t=this.views[n],f,r;if(t)if(f=e(t),r=t.type,typeof r===y&&(r=i.getter(t.type)(window)),r)t=new r(this.wrapper,hr(u(!0,{},this.options,f?t:{},{resources:this.resources,date:this.date(),showWorkHours:this._workDayMode})));else throw new Error("There is no such view");return t},_views:function(){var c=this.options.views,n,t,r,o,i,s,f,l,h;for(this.views={},this._viewsCount=0,f=0,l=c.length;f<l;f++)h=!1,n=c[f],o=e(n),o?(s=i=n.type?n.type:n,typeof s!==y&&(i=n.title,h=!0)):s=i=n,t=yr[i],t&&!h&&(n.type=t.type,t.title=this.options.messages.views[i],t.type==="day"?t.messages={allDay:this.options.messages.allDay}:t.type==="agenda"&&(t.messages={event:this.options.messages.event,date:this.options.messages.date,time:this.options.messages.time})),n=u({title:i},t,o?n:{}),i&&(this.views[i]=n,this._viewsCount++,(!r||n.selected)&&(r=i));r&&(this._selectedViewName=r)},rebind:function(){this.dataSource.fetch()},_dataSource:function(){var n=this,r=n.options,t=r.dataSource;t=ct(t)?{data:t}:t;!r.timezone||t instanceof a?t instanceof a&&(r.timezone=t.options.schema?t.options.schema.timezone:""):t=u(!0,t,{schema:{timezone:r.timezone}});n.dataSource&&n._refreshHandler?n.dataSource.unbind(it,n._refreshHandler).unbind("progress",n._progressHandler).unbind("error",n._errorHandler):(n._refreshHandler=l(n.refresh,n),n._progressHandler=l(n._requestStart,n),n._errorHandler=l(n._error,n));n.dataSource=i.data.SchedulerDataSource.create(t).bind(it,n._refreshHandler).bind("progress",n._progressHandler).bind("error",n._errorHandler);n.options.dataSource=n.dataSource},_error:function(){this._progress(!1)},_requestStart:function(){this._progress(!0)},_progress:function(n){var t=this.element.find(".k-scheduler-content");i.ui.progress(t,n)},_resources:function(){for(var s,r=this,e=r.options.resources,f=0;f<e.length;f++){var t=e[f],u=t.field,o=t.dataSource;if(!u||!o)throw new Error('The "field" and "dataSource" options of the scheduler resource are mandatory.');r.resources.push({field:u,name:t.name||u,title:t.title||u,dataTextField:t.dataTextField||"text",dataValueField:t.dataValueField||"value",dataColorField:t.dataColorField||"color",valuePrimitive:t.valuePrimitive!=null?t.valuePrimitive:!0,multiple:t.multiple||!1,dataSource:i.data.DataSource.create(o)})}s=n.map(r.resources,function(n){return n.dataSource.fetch()});n.when.apply(null,s).then(function(){r.options.autoBind?r.view(r._selectedViewName):r._selectView(r._selectedViewName)})},_initModel:function(){var n=this;n._model=i.observable({selectedDate:new Date(this.options.date),formattedDate:"",formattedShortDate:""});n._model.bind("change",function(t){t.field==="selectedDate"&&n.view(n._selectedViewName)})},_wrapper:function(){var n=this,t=n.options,i=t.height,r=t.width;n.wrapper=n.element.addClass("k-widget k-scheduler k-floatwrap").attr("role","grid").attr("aria-multiselectable",!0);n._isMobile()&&n.wrapper.addClass("k-scheduler-mobile");n._isMobilePhoneView()&&n.wrapper.addClass("k-scheduler-phone");i&&n.wrapper.height(i);r&&n.wrapper.width(r)},date:function(n){return n!=null&&f(n)>=f(this.options.min)&&f(n)<=f(this.options.max)&&this._model.set("selectedDate",n),f(this._model.get("selectedDate"))},_toolbar:function(){var t=this,f=t.options,e=[],s,u;f.toolbar&&(e=n.isArray(f.toolbar)?f.toolbar:[f.toolbar]);s=this._isMobilePhoneView()?bi:wi;u=n(s({messages:f.messages,pdf:n.grep(e,function(n){return n=="pdf"||n.name=="pdf"}).length>0,ns:i.ns,views:t.views,viewsCount:t._viewsCount}));t.wrapper.append(u);t.toolbar=u;i.bind(t.toolbar,t._model);u.on(o+r,".k-pdf",function(n){n.preventDefault();t.saveAsPDF()});u.on(o+r,".k-scheduler-navigation li",function(i){var u=n(this),r=new Date(t.date()),f="";if(i.preventDefault(),u.hasClass("k-nav-today"))f="today",r=new Date;else if(u.hasClass("k-nav-next"))f="next",r=t.view().nextDate();else if(u.hasClass("k-nav-prev"))f="previous",r=t.view().previousDate();else if(u.hasClass("k-nav-current")&&!t._isMobilePhoneView()){t._showCalendar();return}t.trigger("navigate",{view:t._selectedViewName,action:f,date:r})||t.date(r)});u.on(o+r,".k-scheduler-views li, .k-scheduler-refresh",function(r){r.preventDefault();var u=n(this).attr(i.attr("name"));t.trigger("navigate",{view:u,action:"changeView",date:t.date()})||(t.view(u),t.element.find(".k-state-expanded").removeClass("k-state-expanded"))});u.on(o+r,".k-scheduler-views li.k-current-view",function(){t.element.find(".k-scheduler-views").toggleClass("k-state-expanded")});u.find("li").hover(function(){n(this).addClass("k-state-hover")},function(){n(this).removeClass("k-state-hover")})},_showCalendar:function(){var t=this,i=t.toolbar.find(".k-nav-current"),r=n('<div class="k-calendar-container"><div class="k-scheduler-calendar"/><\/div>');t.popup||(t.popup=new ei(r,{anchor:i,activate:function(){t.calendar||(t.calendar=new oi(this.element.find(".k-scheduler-calendar"),{change:function(){var n=this.value();t.trigger("navigate",{view:t._selectedViewName,action:"changeDate",date:n})||(t.date(n),t.popup.close())},min:t.options.min,max:t.options.max}));t.calendar.value(t.date())},copyAnchorStyles:!1}));t.popup.open()},refresh:function(n){var i=this,t=this.view();(this._progress(!1),this.angular("cleanup",function(){return{elements:i.items()}}),n=n||{},t)&&(n&&n.action==="itemchange"&&(this._editor.editable||this._preventRefresh)||this.trigger("dataBinding",{action:n.action||"rebind",index:n.index,items:n.items})||(n&&n.action==="resize"||!this._editor||this._editor.close(),this._data=this.dataSource.expand(t.startDate(),t.endDate()),t.render(this._data),this.trigger("dataBound")))},slotByPosition:function(n,t){var r=this.view(),i;return r._slotByPosition?(i=r._slotByPosition(n,t),!i)?null:{startDate:i.startDate(),endDate:i.endDate(),groupIndex:i.groupIndex,element:i.element,isDaySlot:i.isDaySlot}:null},slotByElement:function(t){var i=n(t).offset();return this.slotByPosition(i.left,i.top)},resourcesBySlot:function(n){return this.view()._resourceBySlot(n)}}),yr={day:{type:"kendo.ui.DayView"},week:{type:"kendo.ui.WeekView"},workWeek:{type:"kendo.ui.WorkWeekView"},agenda:{type:"kendo.ui.AgendaView"},month:{type:"kendo.ui.MonthView"},timeline:{type:"kendo.ui.TimelineView"},timelineWeek:{type:"kendo.ui.TimelineWeekView"},timelineWorkWeek:{type:"kendo.ui.TimelineWorkWeekView"},timelineMonth:{type:"kendo.ui.TimelineMonthView"}};h.plugin(ot);i.PDFMixin&&(i.PDFMixin.extend(ot.prototype),st="k-scheduler-pdf-export",ot.fn._drawPDF=function(t){var i=this.wrapper,f=i[0].style.cssText,u,r;return i.css({width:i.width(),height:i.height()}),i.addClass(st),this.resize(!0),u=this,r=new n.Deferred,this._drawPDFShadow({},{avoidLinks:this.options.pdf.avoidLinks}).done(function(n){var i={page:n,pageNumber:1,progress:1,totalPages:1};t.notify(i);r.resolve(i.page)}).fail(function(n){r.reject(n)}).always(function(){i[0].style.cssText=f;i.removeClass(st);u.resize(!0)}),r});ri=s.extend({init:function(n,t){var r=this,u=i.timezone.windows_zones;if(!u||!i.timezone.zones_titles)throw new Error("kendo.timezones.min.js is not included.");s.fn.init.call(r,n,t);r.wrapper=r.element;r._zonesQuery=new i.data.Query(u);r._zoneTitleId=i.guid();r._zoneTitlePicker();r._zonePicker();r._zoneTitle.bind("cascade",function(){this.value()||r._zone.wrapper.hide()});r._zone.bind("cascade",function(){r._value=this.value();r.trigger("change")});r.value(r.options.value)},options:{name:"TimezoneEditor",value:"",optionLabel:"No timezone"},events:["change"],_zoneTitlePicker:function(){var t=this,r=n('<input id="'+t._zoneTitleId+'"/>').appendTo(t.wrapper);t._zoneTitle=new i.ui.DropDownList(r,{dataSource:i.timezone.zones_titles,dataValueField:"other_zone",dataTextField:"name",optionLabel:t.options.optionLabel})},_zonePicker:function(){var t=this,r=n("<input />").appendTo(this.wrapper);t._zone=new i.ui.DropDownList(r,{dataValueField:"zone",dataTextField:"territory",dataSource:t._zonesQuery.data,cascadeFrom:t._zoneTitleId,dataBound:function(){t._value=this.value();this.wrapper.toggle(this.dataSource.view().length>1)}});t._zone.wrapper.hide()},destroy:function(){s.fn.destroy.call(this);i.destroy(this.wrapper)},value:function(n){var i=this,r;if(n===t)return i._value;r=i._zonesQuery.filter({field:"zone",operator:"eq",value:n}).data[0];r?(i._zoneTitle.value(r.other_zone),i._zone.value(r.zone)):i._zoneTitle.select(0)}});h.plugin(ri);var pr=i.template('<option value="#=other_zone#">#=name#<\/option>'),wr=i.template('<option value="#=zone#">#=territory#<\/option>'),br=s.extend({init:function(n,t){var r=this,u=i.timezone.windows_zones;if(!u||!i.timezone.zones_titles)throw new Error("kendo.timezones.min.js is not included.");s.fn.init.call(r,n,t);r.wrapper=r.element;r._zonesQuery=new i.data.Query(u);r._zoneTitlePicker();r._zonePicker();r.value(r.options.value)},options:{name:"MobileTimezoneEditor",optionLabel:"No timezone",value:""},events:["change"],_bindZones:function(n){var t=n?this._filter(n):[];this._zone.html(this._options(t,wr))},_filter:function(n){return this._zonesQuery.filter({field:"other_zone",operator:"eq",value:n}).data},_options:function(n,t,i){var r=0,u="",f=n.length;for(i&&(u+=t({other_zone:"",name:i}));r<f;r++)u+=t(n[r]);return u},_zoneTitlePicker:function(){var t=this,r=t._options(i.timezone.zones_titles,pr,t.options.optionLabel);t._zoneTitle=n("<select>"+r+"<\/select>").appendTo(t.wrapper).change(function(){var i=this.value,n=t._zone;t._bindZones(i);i&&n[0].children.length>1?n.show():n.hide();t._value=n[0].value;t.trigger("change")})},_zonePicker:function(){var t=this;t._zone=n('<select style="display:none"><\/select>').appendTo(this.wrapper).change(function(){t._value=this.value;t.trigger("change")});t._bindZones(t._zoneTitle.val());t._value=t._zone[0].value},destroy:function(){s.fn.destroy.call(this);i.destroy(this.wrapper)},value:function(n){var i=this,r=i._zone,e="",u="",f;if(n===t)return i._value;f=i._zonesQuery.filter({field:"zone",operator:"eq",value:n}).data[0];f&&(u=f.zone,e=f.other_zone);i._zoneTitle.val(e);i._bindZones(e);r.val(u);u=r[0].value;u&&r[0].children.length>1?r.show():r.hide();i._value=u}});h.plugin(br)})(window.kendo.jQuery)}(),function(){(function(n){var t=window.kendo,u=t.ui.Widget,i=n.proxy,r=Math.abs,f=20,e=u.extend({init:function(n,r){function e(n){return function(t){f._triggerTouch(n,t)}}function o(n){return function(t){f.trigger(n,{touches:t.touches,distance:t.distance,center:t.center,event:t.event})}}var f=this;u.fn.init.call(f,n,r);r=f.options;n=f.element;f.wrapper=n;f.events=new t.UserEvents(n,{filter:r.filter,surface:r.surface,minHold:r.minHold,multiTouch:r.multiTouch,allowSelection:!0,press:e("touchstart"),hold:e("hold"),tap:i(f,"_tap"),gesturestart:o("gesturestart"),gesturechange:o("gesturechange"),gestureend:o("gestureend")});r.enableSwipe?(f.events.bind("start",i(f,"_swipestart")),f.events.bind("move",i(f,"_swipemove"))):(f.events.bind("start",i(f,"_dragstart")),f.events.bind("move",e("drag")),f.events.bind("end",e("dragend")));t.notify(f)},events:["touchstart","dragstart","drag","dragend","tap","doubletap","hold","swipe","gesturestart","gesturechange","gestureend"],options:{name:"Touch",surface:null,global:!1,multiTouch:!1,enableSwipe:!1,minXDelta:30,maxYDelta:20,maxDuration:1e3,minHold:800,doubleTapTimeout:800},cancel:function(){this.events.cancel()},_triggerTouch:function(n,t){this.trigger(n,{touch:t.touch,event:t.event})&&t.preventDefault()},_tap:function(n){var i=this,r=i.lastTap,u=n.touch;r&&u.endTime-r.endTime<i.options.doubleTapTimeout&&t.touchDelta(u,r).distance<f?(i._triggerTouch("doubletap",n),i.lastTap=null):(i._triggerTouch("tap",n),i.lastTap=u)},_dragstart:function(n){this._triggerTouch("dragstart",n)},_swipestart:function(n){r(n.x.velocity)*2>=r(n.y.velocity)&&n.sender.capture()},_swipemove:function(n){var u=this,i=u.options,t=n.touch,f=n.event.timeStamp-t.startTime,e=t.x.initialDelta>0?"right":"left";r(t.x.initialDelta)>=i.minXDelta&&r(t.y.initialDelta)<i.maxYDelta&&f<i.maxDuration&&(u.trigger("swipe",{direction:e,touch:n.touch}),t.cancel())}});t.ui.plugin(e)})(window.kendo.jQuery)}(),function(){(function(n){function tt(n){for(var t=[],u=n.className,r=0,f=n.level;r<f;r++)t.push(i("span",{className:u}));return t}function w(){var i=t._activeElement();i.nodeName.toLowerCase()!=="body"&&n(i).blur()}var t=window.kendo,e=t.dom,i=e.element,a=e.text,v=t.support.browser,y=t.support.mobileOS,o=t.ui,s=o.Widget,h=n.extend,b=n.map,k=n.isFunction,d=v.msie&&v.version<9,c=t.keys,g={title:"Title",start:"Start Time",end:"End Time",percentComplete:"% Done",parentId:"Predecessor ID",id:"ID",orderId:"Order ID"},l="string",u=".kendoGanttList",p="click",f=".",nt="<table style='visibility: hidden;'><tbody><tr style='height:{0}'><td>&nbsp;<\/td><\/tr><\/tbody><\/table>",r=o.GanttList=s.extend({init:function(t,i){s.fn.init.call(this,t,i);this.options.columns.length===0&&this.options.columns.push("title");this.dataSource=this.options.dataSource;this._columns();this._layout();this._domTrees();this._header();this._sortable();this._editable();this._selectable();this._draggable();this._resizable();this._attachEvents();this._adjustHeight();this.bind("render",function(){var t,i;this.options.resizable&&(t=this.header.find("col"),i=this.content.find("col"),this.header.find("th").not(":last").each(function(r){var u=n(this).outerWidth();t.eq(r).width(u);i.eq(r).width(u)}),t.last().css("width","auto"),i.last().css("width","auto"))},!0)},_adjustHeight:function(){this.content.height(this.element.height()-this.header.parent().outerHeight())},destroy:function(){s.fn.destroy.call(this);this._reorderDraggable&&this._reorderDraggable.destroy();this._tableDropArea&&this._tableDropArea.destroy();this._contentDropArea&&this._contentDropArea.destroy();this._columnResizable&&this._columnResizable.destroy();this.touch&&this.touch.destroy();this.timer&&clearTimeout(this.timer);this.content.off(u);this.header.find("thead").off(u);this.header.find(f+r.link).off(u);this.header=null;this.content=null;this.levels=null;t.destroy(this.element)},options:{name:"GanttList",selectable:!0,editable:!0,resizable:!1},_attachEvents:function(){var t=this,i=r.styles;t.content.on(p+u,"td > span."+i.icon+":not(."+i.iconHidden+")",function(i){var u=n(this),r=t._modelFromElement(u);r.set("expanded",!r.get("expanded"));i.stopPropagation()})},_domTrees:function(){this.headerTree=new e.Tree(this.header[0]);this.contentTree=new e.Tree(this.content[0])},_columns:function(){var n=this.options.columns,t=function(){this.field="";this.title="";this.editable=!1;this.sortable=!1};this.columns=b(n,function(n){return n=typeof n===l?{field:n,title:g[n]}:n,h(new t,n)})},_layout:function(){var o=this,u=this.options,e=this.element,i=r.styles,s=function(){var f=typeof u.rowHeight===l?u.rowHeight:u.rowHeight+"px",i=n(t.format(nt,f)),r;return o.content.append(i),r=i.find("tr").outerHeight(),i.remove(),r};e.addClass(i.wrapper).append("<div class='"+i.gridHeader+"'><div class='"+i.gridHeaderWrap+"'><\/div><\/div>").append("<div class='"+i.gridContentWrap+"'><\/div>");this.header=e.find(f+i.gridHeaderWrap);this.content=e.find(f+i.gridContent);u.rowHeight&&(this._rowHeight=s())},_header:function(){var u=this.headerTree,n,t,r;n=i("colgroup",null,this._cols());t=i("thead",{role:"rowgroup"},[i("tr",{role:"row"},this._ths())]);r=i("table",{style:{minWidth:this.options.listWidth+"px"},role:"grid"},[n,t]);u.render([r])},_render:function(n){var t,r,u,f={style:{minWidth:this.options.listWidth+"px"},tabIndex:0,role:"treegrid"};this._rowHeight&&(f.style.height=n.length*this._rowHeight+"px");this.levels=[{field:null,value:0}];t=i("colgroup",null,this._cols());r=i("tbody",{role:"rowgroup"},this._trs(n));u=i("table",f,[t,r]);this.contentTree.render([u]);this.trigger("render")},_ths:function(){for(var f=this.columns,n,e,t=[],u=0,o=f.length;u<o;u++)n=f[u],e={"data-field":n.field,"data-title":n.title,className:r.styles.header,role:"columnheader"},t.push(i("th",e,[a(n.title)]));return this.options.resizable&&t.push(i("th",{className:r.styles.header,role:"columnheader"})),t},_cols:function(){for(var u=this.columns,f,e,n,t=[],r=0,o=u.length;r<o;r++)f=u[r],n=f.width,e=n&&parseInt(n,10)!==0?{style:{width:typeof n===l?n:n+"px"}}:null,t.push(i("col",e,[]));return this.options.resizable&&t.push(i("col",{style:{width:"1px"}})),t},_trs:function(n){for(var t,o=[],u,i=[],e,s=r.styles,f=0,h=n.length;f<h;f++)t=n[f],e=this._levels({idx:t.parentId,id:t.id,summary:t.summary}),u={"data-uid":t.uid,"data-level":e,role:"row"},t.summary&&(u["aria-expanded"]=t.expanded),f%2!=0&&i.push(s.alt),t.summary&&i.push(s.group),i.length&&(u.className=i.join(" ")),o.push(this._tds({task:t,attr:u,level:e})),i=[];return o},_tds:function(n){for(var t=[],u=this.columns,f,r=0,e=u.length;r<e;r++)f=u[r],t.push(this._td({task:n.task,column:f,level:n.level}));return this.options.resizable&&t.push(i("td",{role:"gridcell"})),i("tr",n.attr,t)},_td:function(n){var h=[],v=this.options.resourcesField,f=r.styles,c=n.task,e=n.column,o=c.get(e.field)||[],u,l,s;if(e.field==v){for(u=[],s=0;s<o.length;s++)u.push(t.format("{0} [{1}]",o[s].get("name"),o[s].get("formatedValue")));u=u.join(", ")}else u=e.format?t.format(e.format,o):o;return e.field==="title"&&(h=tt({level:n.level,className:f.iconPlaceHolder}),h.push(i("span",{className:f.icon+" "+(c.summary?c.expanded?f.iconCollapse:f.iconExpand:f.iconHidden)})),l=t.format("{0}, {1:P0}",u,c.percentComplete)),h.push(i("span",{"aria-label":l},[a(u)])),i("td",{role:"gridcell"},h)},_levels:function(n){for(var i=this.levels,t,u=n.summary,f=n.idx,e=n.id,r=0,o=i.length;r<o;r++)if(t=i[r],t.field==f)return u&&i.push({field:e,value:t.value+1}),t.value},_sortable:function(){for(var h=this,c=this.options.resourcesField,l=this.columns,n,e,o=this.header.find("th["+t.attr("field")+"]"),a=function(n){h.editable&&h.editable.trigger("validate")&&(n.preventDefault(),n.stopImmediatePropagation())},s,i=0,v=o.length;i<v;i++)if(n=l[i],n.sortable&&n.field!==c){s=o.eq(i);e=s.data("kendoColumnSorter");e&&e.destroy();s.attr("data-"+t.ns+"field",n.field).kendoColumnSorter({dataSource:this.dataSource}).find(f+r.link).on("click"+u,a)}o=null},_selectable:function(){var t=this,i=this.options.selectable;if(i)this.content.on(p+u,"tr",function(i){var r=n(this);t.editable&&t.editable.trigger("validate");i.ctrlKey?t.clearSelection():t.select(r)})},select:function(n){var i=this.content.find(n),t=r.styles.selected;if(i.length){i.siblings(f+t).removeClass(t).attr("aria-selected",!1).end().addClass(t).attr("aria-selected",!0);this.trigger("change");return}return this.content.find(f+t)},clearSelection:function(){var n=this.select();n.length&&(n.removeClass(r.styles.selected),this.trigger("change"))},_setDataSource:function(n){this.dataSource=n},_editable:function(){var t=this,i=r.styles,f="span."+i.icon+":not("+i.iconHidden+")",e=function(){var n=t.editable;n&&(n.end()?t._closeCell():n.trigger("validate"))},o=function(t){var r=n(t.currentTarget);r.hasClass(i.editCell)||w()};if(this.options.editable){this._startEditHandler=function(i){var u=i.currentTarget?n(i.currentTarget):i,r=t._columnFromElement(u);t.editable||r&&r.editable&&t._editCell({cell:u,column:r})};t.content.on("focusin"+u,function(){clearTimeout(t.timer);t.timer=null}).on("focusout"+u,function(){t.timer=setTimeout(e,1)}).on("keydown"+u,function(n){n.keyCode===c.ENTER&&n.preventDefault()}).on("keyup"+u,function(n){var u=n.keyCode,i,r;switch(u){case c.ENTER:w();e();break;case c.ESC:t.editable&&(i=t._editableContainer,r=t._modelFromElement(i),t.trigger("cancel",{model:r,cell:i})||t._closeCell(!0))}});if(y)t.touch=t.content.kendoTouch({filter:"td",touchstart:function(n){o(n.touch)},doubletap:function(i){n(i.touch.initialTouch).is(f)||t._startEditHandler(i.touch)}}).data("kendoTouch");else t.content.on("mousedown"+u,"td",function(n){o(n)}).on("dblclick"+u,"td",function(i){n(i.target).is(f)||t._startEditHandler(i)})}},_editCell:function(i){var a=this.options.resourcesField,v=r.styles,f=i.cell,u=i.column,c=this._modelFromElement(f),e=this.dataSource._createNewModel(c.toJSON()),o=e.fields[u.field]||e[u.field],s=o.validation,y=t.attr("type"),p=t.attr("bind"),w=t.attr("format"),h={name:u.field,required:o.validation?o.validation.required===!0:!1},l;if(u.field===a){u.editor(f,e);return}this._editableContent=f.children().detach();this._editableContainer=f;f.data("modelCopy",e);(o.type==="date"||n.type(o)==="date")&&(!u.format||/H|m|s|F|g|u/.test(u.format))&&(h[p]="value:"+u.field,h[y]="date",u.format&&(h[w]=t._extractFormat(u.format)),l=function(t,i){n('<input type="text"/>').attr(h).appendTo(t).kendoDateTimePicker({format:i.format})});this.editable=f.addClass(v.editCell).kendoEditable({fields:{field:u.field,format:u.format,editor:u.editor||l},model:e,clearContainer:!1}).data("kendoEditable");s&&s.dateCompare&&k(s.dateCompare)&&s.message&&(n("<span "+t.attr("for")+'="'+u.field+'" class="k-invalid-msg"/>').hide().appendTo(f),f.find("[name="+u.field+"]").attr(t.attr("dateCompare-msg"),s.message));this.trigger("edit",{model:c,cell:f})&&this._closeCell(!0);this.editable.bind("validate",function(n){var t=this.element.find(":kendoFocusable:first").focus();d&&t.focus();n.preventDefault()})},_closeCell:function(n){var e=r.styles,t=this._editableContainer,f=this._modelFromElement(t),o=this._columnFromElement(t),u=o.field,s=t.data("modelCopy"),i={};i[u]=s.get(u);t.empty().removeData("modelCopy").removeClass(e.editCell).append(this._editableContent);this.editable.unbind();this.editable.destroy();this.editable=null;this._editableContainer=null;this._editableContent=null;n||(u==="start"&&(i.end=new Date(i.start.getTime()+f.duration())),this.trigger("update",{task:f,updateInfo:i}))},_draggable:function(){var e=this,o=null,s=!0,u,i=r.styles,v="tr["+t.attr("level")+" = 0]:last",c={},a=function(){o=null;u=null;s=!0;c={}},p=function(n){for(var t=n;t;){if(o.get("id")===t.get("id")){s=!1;break}t=e.dataSource.taskParent(t)}},w=function(){var i=n(u).height(),r=t.getOffset(u).top;h(u,{beforeLimit:r+i*.25,afterLimit:r+i*.75})},b=function(n){var o=n.location,r=i.dropAdd,e="add",s=parseInt(u.attr(t.attr("level")),10),f;o<=u.beforeLimit?(f=u.prev(),r=i.dropTop,e="insert-before"):o>=u.afterLimit&&(f=u.next(),r=i.dropBottom,e="insert-after");f&&parseInt(f.attr(t.attr("level")),10)===s&&(r=i.dropMiddle);c.className=r;c.command=e},l=function(){return e._reorderDraggable.hint.children(f+i.dragStatus).removeClass(i.dropPositions)};this.options.editable&&(this._reorderDraggable=this.content.kendoDraggable({distance:10,holdToDrag:y,group:"listGroup",filter:"tr[data-uid]",ignore:f+i.input,hint:function(t){return n('<div class="'+i.header+" "+i.dragClue+'"/>').css({width:300,paddingLeft:t.css("paddingLeft"),paddingRight:t.css("paddingRight"),lineHeight:t.height()+"px",paddingTop:t.css("paddingTop"),paddingBottom:t.css("paddingBottom")}).append('<span class="'+i.icon+" "+i.dragStatus+'" /><span class="'+i.dragClueText+'"/>')},cursorOffset:{top:-20,left:0},container:this.content,dragstart:function(n){if(e.editable&&e.editable.trigger("validate")){n.preventDefault();return}o=e._modelFromElement(n.currentTarget);this.hint.children(f+i.dragClueText).text(o.get("title"))},drag:function(n){s&&(b(n.y),l().addClass(c.className))},dragend:function(){a()},dragcancel:function(){a()}}).data("kendoDraggable"),this._tableDropArea=this.content.kendoDropTargetArea({distance:0,group:"listGroup",filter:"tr[data-uid]",dragenter:function(n){u=n.dropTarget;p(e._modelFromElement(u));w();l().toggleClass(i.dropDenied,!s)},dragleave:function(){s=!0;l()},drop:function(){var n=e._modelFromElement(u),t=n.orderId,i={parentId:n.parentId};if(s){switch(c.command){case"add":i.parentId=n.id;break;case"insert-before":i.orderId=n.parentId===o.parentId&&n.orderId>o.orderId?t-1:t;break;case"insert-after":i.orderId=n.parentId===o.parentId&&n.orderId>o.orderId?t:t+1}e.trigger("update",{task:o,updateInfo:i})}}}).data("kendoDropTargetArea"),this._contentDropArea=this.element.kendoDropTargetArea({distance:0,group:"listGroup",filter:f+i.gridContent,drop:function(){var t=e._modelFromElement(e.content.find(v)),n=t.orderId,i={parentId:null,orderId:o.parentId!==null?n+1:n};e.trigger("update",{task:o,updateInfo:i})}}).data("kendoDropTargetArea"))},_resizable:function(){var t=this,i=r.styles,e=function(r){var u=n(r.currentTarget),f=t.resizeHandle,s=u.position(),h=s.left,c=u.outerWidth(),l=u.closest("div"),a=r.clientX+n(window).scrollLeft(),e=t.options.columnResizeHandleWidth,o,v;if(h+=l.scrollLeft(),f||(f=t.resizeHandle=n('<div class="'+i.resizeHandle+'"><div class="'+i.resizeHandleInner+'" /><\/div>')),o=u.offset().left+c,v=a>o-e&&a<o+e,!v){f.hide();return}l.append(f);f.show().css({top:s.top,left:h+c-e-1,height:u.outerHeight(),width:e*3}).data("th",u)};if(this.options.resizable){this._columnResizable&&this._columnResizable.destroy();this.header.find("thead").on("mousemove"+u,"th",e);this._columnResizable=this.header.kendoResizable({handle:f+i.resizeHandle,start:function(i){var r=n(i.currentTarget).data("th"),f="col:eq("+r.index()+")",u=t.header.find("table"),e=t.content.find("table");t.element.addClass("k-grid-column-resizing");this.col=e.children("colgroup").find(f).add(u.find(f));this.th=r;this.startLocation=i.x.location;this.columnWidth=r.outerWidth();this.table=u.add(e);this.totalWidth=this.table.width()-u.find("th:last").outerWidth()},resize:function(n){var i=11,t=n.x.location-this.startLocation;this.columnWidth+t<i&&(t=i-this.columnWidth);this.table.css({minWidth:this.totalWidth+t});this.col.width(this.columnWidth+t)},resizeend:function(){t.element.removeClass("k-grid-column-resizing");var n=Math.floor(this.columnWidth),i=Math.floor(this.th.outerWidth()),r=t.columns[this.th.index()];t.trigger("columnResize",{column:r,oldWidth:n,newWidth:i});this.table=this.col=this.th=null}}).data("kendoResizable")}},_modelFromElement:function(n){var i=n.closest("tr");return this.dataSource.getByUid(i.attr(t.attr("uid")))},_columnFromElement:function(n){var t=n.closest("td"),i=t.parent(),r=i.children().index(t);return this.columns[r]}});h(!0,o.GanttList,{styles:{wrapper:"k-treelist k-grid k-widget",header:"k-header",alt:"k-alt",editCell:"k-edit-cell",group:"k-treelist-group",gridHeader:"k-grid-header",gridHeaderWrap:"k-grid-header-wrap",gridContent:"k-grid-content",gridContentWrap:"k-grid-content",selected:"k-state-selected",icon:"k-icon",iconCollapse:"k-i-collapse",iconExpand:"k-i-expand",iconHidden:"k-i-none",iconPlaceHolder:"k-icon k-i-none",input:"k-input",link:"k-link",resizeHandle:"k-resize-handle",resizeHandleInner:"k-resize-handle-inner",dropPositions:"k-insert-top k-insert-bottom k-add k-insert-middle",dropTop:"k-insert-top",dropBottom:"k-insert-bottom",dropAdd:"k-add",dropMiddle:"k-insert-middle",dropDenied:"k-denied",dragStatus:"k-drag-status",dragClue:"k-drag-clue",dragClueText:"k-clue-text"}})})(window.kendo.jQuery)}(),function(){(function(n){function pt(n){return delete n.name,delete n.prefix,delete n.views,n}function wt(n){var i=[],t=n.workWeekStart;for(i.push(t);n.workWeekEnd!=t;)t>6?t-=7:t++,i.push(t);return i}function l(){var t=kendo._activeElement();t.nodeName.toLowerCase()!=="body"&&n(t).blur()}var o=kendo.ui.Widget,r=kendo.dom.element,h=kendo.dom.text,nt=kendo.dom.html,tt=n.isPlainObject,c=n.extend,it=n.proxy,a=kendo.support.browser,u=!1,rt=kendo.keys,v=kendo.data.Query,ut="string",e=".kendoGanttTimeline",s="click",ft="dblclick",y="mousemove",et="mouseenter",p="mouseleave",ot="keydown",t=".",st=kendo.template("#=kendo.toString(start, 't')#"),w=kendo.template("#=kendo.toString(start, 'ddd M/dd')#"),b=kendo.template("#=kendo.toString(start, 'ddd M/dd')# - #=kendo.toString(kendo.date.addDays(end, -1), 'ddd M/dd')#"),k=kendo.template("#=kendo.toString(start, 'MMM')#"),ht=kendo.template("#=kendo.toString(start, 'yyyy')#"),ct=kendo.template('<div class="#=styles.marquee#"><div class="#=styles.marqueeColor#"><\/div><\/div>'),d=kendo.template('<div style="z-index: 100002;" class="#=styles.tooltipWrapper#"><div class="#=styles.tooltipContent#"><div>#=messages.start#: #=kendo.toString(start, format)#<\/div><div>#=messages.end#: #=kendo.toString(end, format)#<\/div><\/div><\/div>'),lt=kendo.template('<div style="z-index: 100002;" class="#=styles.tooltipWrapper#" ><div class="#=styles.tooltipContent#">#=text#%<\/div><div class="#=styles.tooltipCallout#" style="left:13px;"><\/div><\/div>'),at=kendo.template('<div class="#=styles.taskDetails#"><strong>#=task.title#<\/strong><div class="#=styles.taskDetailsPercent#">#=kendo.toString(task.percentComplete, "p0")#<\/div><ul class="#=styles.reset#"><li>#=messages.start#: #=kendo.toString(task.start, "h:mm tt ddd, MMM d")#<\/li><li>#=messages.end#: #=kendo.toString(task.end, "h:mm tt ddd, MMM d")#<\/li><\/ul><\/div>'),vt="<table style='visibility: hidden;'><tbody><tr style='height:{0}'><td>&nbsp;<\/td><\/tr><\/tbody><\/table>",yt={day:{type:"kendo.ui.GanttDayView"},week:{type:"kendo.ui.GanttWeekView"},month:{type:"kendo.ui.GanttMonthView"},year:{type:"kendo.ui.GanttYearView"}},i=kendo.ui.GanttView=o.extend({init:function(n,r){o.fn.init.call(this,n,r);this.title=this.options.title||this.options.name;this.header=this.element.find(t+i.styles.gridHeader);this.content=this.element.find(t+i.styles.gridContent);this.contentWidth=this.content.width();this._workDays=wt(this.options);this._headerTree=r.headerTree;this._taskTree=r.taskTree;this._taskTemplate=r.taskTemplate?kendo.template(r.taskTemplate,c({},kendo.Template,r.templateSettings)):null;this._dependencyTree=r.dependencyTree;this._taskCoordinates={};this._currentTime()},destroy:function(){o.fn.destroy.call(this);clearTimeout(this._tooltipTimeout);this.headerRow=null;this.header=null;this.content=null;this._dragHint=null;this._resizeHint=null;this._resizeTooltip=null;this._taskTooltip=null;this._percentCompleteResizeTooltip=null;this._headerTree=null;this._taskTree=null;this._dependencyTree=null},options:{showWorkHours:!1,showWorkDays:!1,workDayStart:new Date(1980,1,1,8,0,0),workDayEnd:new Date(1980,1,1,17,0,0),workWeekStart:1,workWeekEnd:5,hourSpan:1,slotSize:100,currentTimeMarker:{updateInterval:1e4}},renderLayout:function(){this._slots=this._createSlots();this._tableWidth=this._calculateTableWidth();this.createLayout(this._layout());this._slotDimensions();this._adjustHeight();this.content.find(t+i.styles.dependenciesWrapper).width(this._tableWidth)},_adjustHeight:function(){this.content.height(this.element.height()-this.header.outerHeight())},createLayout:function(n){var t=this._headers(n),i=this._colgroup(),u=this._headerTree,f=r("thead",null,t),e=r("table",{style:{width:this._tableWidth+"px"}},[i,f]);u.render([e]);this.headerRow=this.header.find("table:first tr").last()},_slotDimensions:function(){for(var r=this.headerRow[0].children,u=this._timeSlots(),t,i,n=0,f=r.length;n<f;n++)i=r[n],t=u[n],t.offsetLeft=i.offsetLeft,t.offsetWidth=i.offsetWidth},render:function(n){var o=n.length,f=i.styles,r,h=this._rowsTable(o),c=this._columnsTable(o),l=this._tasksTable(n),s=this.options.currentTimeMarker,u=this.options.calculatedSize,e;this._taskTree.render([h,c,l]);r=this.content.find(t+f.rowsTable);u&&(e=u.row*n.length,this.content.find(t+f.tasksTable).height(e),r.height(e));this._contentHeight=r.height();this._rowHeight=u?u.row:this._contentHeight/r.find("tr").length;this.content.find(t+f.columnsTable).height(this._contentHeight);s!==!1&&s.updateInterval!==undefined&&this._renderCurrentTime()},_rowsTable:function(n){for(var u=[],f,e=i.styles,o=[null,{className:e.alt}],t=0;t<n;t++)f=r("tr",o[t%2],[r("td",null,[h(" ")])]),u.push(f);return this._createTable(1,u,{className:e.rowsTable})},_columnsTable:function(){for(var e=[],o,s=i.styles,c=this._timeSlots(),a=c.length,u,n,l=0,t,f=0;f<a;f++)u=c[f],t={},n=u.span,l+=n,n!==1&&(t.colspan=n),u.isNonWorking&&(t.className=s.nonWorking),e.push(r("td",t,[h(" ")]));return o=r("tr",null,e),this._createTable(l,[o],{className:s.columnsTable})},_tasksTable:function(n){for(var v=[],s,h,t,f,c=i.styles,b=this._taskCoordinates={},y=this._calculateMilestoneWidth(),p=Math.round(y.width),l=this.options.resourcesField,k=[c.resource,c.resourceAlt],w=this.options.calculatedSize,a,d=this._calculateResourcesMargin(),g=this._calculateTaskBorderWidth(),o,nt=function(n){var i,r;i=t.left;r=i+t.width;f.isMilestone()&&(i-=p/2,r=i+p);b[f.id]={start:i,end:r,rowIndex:n}},e=0,tt=n.length;e<tt;e++)f=n[e],t=this._taskPosition(f),t.borderWidth=g,s=r("tr",null),h=r("td",null,[this._renderTask(n[e],t)]),f[l]&&f[l].length&&(a=u?this._tableWidth-t.left:Math.max(t.width||y.clientWidth,0)+t.left,o={width:this._tableWidth-(a+d)+"px"},o[u?"right":"left"]=a+"px",w&&(o.height=w.cell+"px"),h.children.push(r("div",{className:c.resourcesWrap,style:o},this._renderResources(f[l],k[e%2])))),s.children.push(h),v.push(s),nt(e);return this._createTable(1,v,{className:i.styles.tasksTable})},_createTable:function(n,t,i){for(var u=[],f,e,o=0;o<n;o++)u.push(r("col"));return f=r("colgroup",null,u),e=r("tbody",null,t),i.style||(i.style={}),i.style.width=this._tableWidth+"px",r("table",i,[f,e])},_calculateTableWidth:function(){for(var r=this._timeSlots(),t=0,u=0,n,i=0,f=r.length;i<f;i++)n=r[i].span,u+=n,n>t&&(t=n);return Math.round(u*this.options.slotSize/t)},_calculateMilestoneWidth:function(){var u,f=i.styles.task+" "+i.styles.taskMilestone,t=n("<div class='"+f+"' style='visibility: hidden; position: absolute'>"),r;return this.content.append(t),r=t[0].getBoundingClientRect(),u={width:r.right-r.left,clientWidth:t[0].clientWidth},t.remove(),u},_calculateResourcesMargin:function(){var r,t=n("<div class='"+i.styles.resourcesWrap+"' style='visibility: hidden; position: absolute'>");return this.content.append(t),r=parseInt(t.css(u?"margin-right":"margin-left"),10),t.remove(),r},_calculateTaskBorderWidth:function(){var r,f=i.styles.task+" "+i.styles.taskSingle,t=n("<div class='"+f+"' style='visibility: hidden; position: absolute'>"),u;return this.content.append(t),u=kendo.getComputedStyles(t[0],["border-left-width"]),r=parseFloat(u["border-left-width"],10),t.remove(),r},_renderTask:function(n,t){var e,o,h=this.options.editable,c,v=t.left,f=i.styles,y=f.taskWrap,l=this.options.calculatedSize,a={},s={className:y,style:{left:v+"px"}};return l&&(s.style.height=l.cell+"px"),n.summary?o=this._renderSummary(n,t):n.isMilestone()?(o=this._renderMilestone(n,t),s.className+=" "+f.taskMilestoneWrap):o=this._renderSingleTask(n,t),e=r("div",s,[o]),h&&(e.children.push(r("div",{className:f.taskDot+" "+f.taskDotStart})),e.children.push(r("div",{className:f.taskDot+" "+f.taskDotEnd}))),n.summary||n.isMilestone()||!h||this._taskTemplate!==null||(c=Math.round(t.width*n.percentComplete),a[u?"right":"left"]=c+"px",e.children.push(r("div",{className:f.taskDragHandle,style:a}))),e},_renderSingleTask:function(n,t){var u=i.styles,s=Math.round(t.width*n.percentComplete),e=[],o,f;return this._taskTemplate!==null?o=nt(this._taskTemplate(n)):(o=h(n.title),e.push(r("div",{className:u.taskComplete,style:{width:s+"px"}}))),f=r("div",{className:u.taskContent},[r("div",{className:u.taskTemplate},[o])]),e.push(f),this.options.editable&&(f.children.push(r("span",{className:u.taskActions},[r("a",{className:u.link+" "+u.taskDelete,href:"#"},[r("span",{className:u.icon+" "+u.iconDelete})])])),f.children.push(r("span",{className:u.taskResizeHandle+" "+u.taskResizeHandleWest})),f.children.push(r("span",{className:u.taskResizeHandle+" "+u.taskResizeHandleEast}))),r("div",{className:u.task+" "+u.taskSingle,"data-uid":n.uid,style:{width:Math.max(t.width-t.borderWidth*2,0)+"px"}},e)},_renderMilestone:function(n){var t=i.styles;return r("div",{className:t.task+" "+t.taskMilestone,"data-uid":n.uid})},_renderSummary:function(n,t){var u=i.styles,f=Math.round(t.width*n.percentComplete);return r("div",{className:u.task+" "+u.taskSummary,"data-uid":n.uid,style:{width:t.width+"px"}},[r("div",{className:u.taskSummaryProgress,style:{width:f+"px"}},[r("div",{className:u.taskSummaryComplete,style:{width:t.width+"px"}})])])},_renderResources:function(n,t){for(var i=[],f,e=0,o=n.length;e<o;e++)f=n[e],i.push(r("span",{className:t,style:{color:f.get("color")}},[h(f.get("name"))]));return u&&i.reverse(),i},_taskPosition:function(n){var t=Math.round,i=t(this._offset(u?n.end:n.start)),r=t(this._offset(u?n.start:n.end));return{left:i,width:r-i}},_offset:function(n){var r=this._timeSlots(),t,f,e,i=0,o;return r.length?(o=this._slotIndex("start",n),t=r[o],t.end<n?i=t.offsetWidth:t.start<=n&&(f=n-t.start,e=t.end-t.start,i=f/e*t.offsetWidth),u&&(i=t.offsetWidth+1-i),t.offsetLeft+i):0},_slotIndex:function(n,t,i){var f=this._timeSlots(),r=0,e=f.length-1,u;i&&(f=[].slice.call(f).reverse());do u=Math.ceil((e+r)/2),f[u][n]<t?r=u:(u===e&&u--,e=u);while(r!==e);return i&&(r=f.length-1-r),r},_timeByPosition:function(r,f,e){var o=this._slotByPosition(r);if(f)return e?o.end:o.start;var h=r-n(t+i.styles.tasksTable).offset().left,c=o.end-o.start,s=h-o.offsetLeft;return u&&(s=o.offsetWidth-s),new Date(o.start.getTime()+c*(s/o.offsetWidth))},_slotByPosition:function(r){var f=r-n(t+i.styles.tasksTable).offset().left,e=this._slotIndex("offsetLeft",f,u);return this._timeSlots()[e]},_renderDependencies:function(n){for(var t=[],r=this._dependencyTree,i=0,u=n.length;i<u;i++)t.push.apply(t,this._renderDependency(n[i]));r.render(t)},_renderDependency:function(n){var r=this._taskCoordinates[n.predecessorId],f=this._taskCoordinates[n.successorId],t,e,i,o;if(!r||!f)return[];for(e="_render"+["FF","FS","SF","SS"][u?3-n.type:n.type],t=this[e](r,f),i=0,o=t.length;i<o;i++)t[i].attr["data-uid"]=n.uid;return t},_renderFF:function(n,t){var i=this._dependencyFF(n,t,!1);return i[i.length-1].children[0]=this._arrow(!0),i},_renderSS:function(n,t){var i=this._dependencyFF(t,n,!0);return i[0].children[0]=this._arrow(!1),i.reverse()},_renderFS:function(n,t){var i=this._dependencyFS(n,t,!1);return i[i.length-1].children[0]=this._arrow(!1),i},_renderSF:function(n,t){var i=this._dependencyFS(t,n,!0);return i[0].children[0]=this._arrow(!0),i.reverse()},_dependencyFF:function(n,t,r){var w=this,v=[],e=0,f=0,u=0,o=0,s=r?"start":"end",y,h=2,b=1,c=this._rowHeight,k=10,g=n.rowIndex*c+Math.floor(c/2)-1,l=t.rowIndex*c+Math.floor(c/2)-1,a=i.styles,p=function(){v.push(w._line(a.line+" "+a.lineHorizontal,{left:e+"px",top:f+"px",width:u+"px"}))},d=function(){v.push(w._line(a.line+" "+a.lineVertical,{left:e+"px",top:f+"px",height:o+"px"}))};return e=n[s],f=g,u=k,y=t[s]-n[s],y>0!==r&&(u=Math.abs(y)+k),r?(e-=u,u-=b,p()):(p(),e+=u-h),l<f?(o=f-l,o+=h,f=l,d()):(o=l-f,o+=h,d(),f+=o-h),u=Math.abs(e-t[s]),r||(u-=b,e-=u),p(),v},_dependencyFS:function(n,t,r){var g=this,p=[],o=0,f=0,u=0,e=0,h=this._rowHeight,nt=Math.floor(h/2),c=10,w=2*c,b=t.start-n.end,l=2,k=1,a=n.rowIndex*h+Math.floor(h/2)-1,s=t.rowIndex*h+Math.floor(h/2)-1,v=i.styles,d=function(){p.push(g._line(v.line+" "+v.lineHorizontal,{left:o+"px",top:f+"px",width:u+"px"}))},y=function(){p.push(g._line(v.line+" "+v.lineVertical,{left:o+"px",top:f+"px",height:e+"px"}))};return o=n.end,f=a,u=c,r&&(o+=k,b>w&&(u=b-(c-l)),u-=k),d(),o+=u-l,b<=w&&(e=r?Math.abs(s-a)-nt:nt,s<a?(f-=e,e+=l,y()):(y(),f+=e),u=n.end-t.start+w,u<c&&(u=c),o-=u-l,d()),s<a?(e=f-s,f=s,e+=l,y()):(e=s-f,y(),f+=e),u=t.start-o,r||(u-=k),d(),p},_line:function(n,t){return r("div",{className:n,style:t})},_arrow:function(n){return r("span",{className:n?i.styles.arrowWest:i.styles.arrowEast})},_colgroup:function(){for(var t,f,i=this._timeSlots(),e=i.length,u=[],n=0;n<e;n++)for(t=0,f=i[n].span;t<f;t++)u.push(r("col"));return r("colgroup",null,u)},_createDragHint:function(n){this._dragHint=n.clone().addClass(i.styles.dragHint).css("cursor","move");n.parent().append(this._dragHint)},_updateDragHint:function(n){var t=this._offset(n);this._dragHint.css({left:t})},_removeDragHint:function(){this._dragHint.remove();this._dragHint=null},_createResizeHint:function(t){var u=i.styles,f=this._taskCoordinates[t.id].rowIndex*this._rowHeight,e,r,o=this.options,s=o.messages;this._resizeHint=n(ct({styles:u})).css({top:0,height:this._contentHeight});this.content.append(this._resizeHint);this._resizeTooltip=n(d({styles:u,start:t.start,end:t.end,messages:s.views,format:o.resizeTooltipFormat})).css({top:0,left:0});this.content.append(this._resizeTooltip);this._resizeTooltipWidth=this._resizeTooltip.outerWidth();e=this._resizeTooltip.outerHeight();r=f-e;r<0&&(r=f+this._rowHeight);this._resizeTooltipTop=r},_updateResizeHint:function(r,f,e){var s=this._offset(u?f:r),c=this._offset(u?r:f),y=c-s,o=e!==u?s:c,l=this._tableWidth-kendo.support.scrollbar(),h=this._resizeTooltipWidth,a=this.options,p=a.messages,v=n(t+i.styles.tasksTable).offset().left-n(t+i.styles.tasksWrapper).offset().left;u&&(s+=v);this._resizeHint.css({left:s,width:y});this._resizeTooltip&&this._resizeTooltip.remove();o-=Math.round(h/2);o<0?o=0:o+h>l&&(o=l-h);u&&(o+=v);this._resizeTooltip=n(d({styles:i.styles,start:r,end:f,messages:p.views,format:a.resizeTooltipFormat})).css({top:this._resizeTooltipTop,left:o,"min-width":h}).appendTo(this.content)},_removeResizeHint:function(){this._resizeHint.remove();this._resizeHint=null;this._resizeTooltip.remove();this._resizeTooltip=null},_updatePercentCompleteTooltip:function(r,u,f){this._removePercentCompleteTooltip();var e=this._percentCompleteResizeTooltip=n(lt({styles:i.styles,text:f})).appendTo(this.element),o=Math.round(e.outerWidth()/2),s=e.find(t+i.styles.callout),h=Math.round(s.outerWidth()/2);e.css({top:r-(e.outerHeight()+h),left:u-o});s.css("left",o-h)},_removePercentCompleteTooltip:function(){this._percentCompleteResizeTooltip&&this._percentCompleteResizeTooltip.remove();this._percentCompleteResizeTooltip=null},_updateDependencyDragHint:function(n,t,i){this._removeDependencyDragHint();i?this._creteVmlDependencyDragHint(n,t):this._creteDependencyDragHint(n,t)},_creteDependencyDragHint:function(t,r){var e=i.styles,u=r.x-t.x,o=r.y-t.y,s=Math.sqrt(u*u+o*o),f=Math.atan(o/u);u<0&&(f+=Math.PI);n("<div class='"+e.line+" "+e.lineHorizontal+" "+e.dependencyHint+"'><\/div>").css({top:t.y,left:t.x,width:s,"transform-origin":"0% 0","-ms-transform-origin":"0% 0","-webkit-transform-origin":"0% 0",transform:"rotate("+f+"rad)","-ms-transform":"rotate("+f+"rad)","-webkit-transform":"rotate("+f+"rad)"}).appendTo(this.content)},_creteVmlDependencyDragHint:function(t,r){var u=n("<kvml:line class='"+i.styles.dependencyHint+"' style='position:absolute; top: 0px; left: 0px;' strokecolor='black' strokeweight='2px' from='"+t.x+"px,"+t.y+"px' to='"+r.x+"px,"+r.y+"px'><\/kvml:line>").appendTo(this.content);u[0].outerHTML=u[0].outerHTML},_removeDependencyDragHint:function(){this.content.find(t+i.styles.dependencyHint).remove()},_createTaskTooltip:function(r,f,e){var a=i.styles,v=this.options,o=this.content,c=o.offset(),w=o.width(),l=kendo.scrollLeft(o),b=n(f).parents("tr").first(),p=b.offset(),k=v.tooltip&&v.tooltip.template?kendo.template(v.tooltip.template):at,s=u?e-(c.left+l+kendo.support.scrollbar()):e-(c.left-l),d=p.top+b.outerHeight()-c.top+o.scrollTop(),h=this._taskTooltip=n('<div style="z-index: 100002;" class="'+a.tooltipWrapper+'" ><div class="'+a.taskContent+'"><\/div><\/div>'),y;h.css({left:s,top:d}).appendTo(o).find(t+a.taskContent).append(k({styles:a,task:r,messages:v.messages.views}));h.outerHeight()<p.top-c.top&&h.css("top",p.top-c.top-h.outerHeight()+o.scrollTop());y=h.outerWidth();y+s-l>w&&(s-=y,s<l&&(s=l+w-(y+17)),h.css("left",s))},_removeTaskTooltip:function(){this._taskTooltip&&this._taskTooltip.remove();this._taskTooltip=null},_scrollTo:function(n){var i=n.offset().left,r=n.width(),e=i+r,c=n.closest("tr"),s=c.offset().top,p=c.height(),l=s+p,t=this.content,a=t.offset(),h=a.top,w=t.height(),v=h+w,u=a.left,f=t.width(),o=u+f,y=kendo.support.scrollbar();s<h?t.scrollTop(t.scrollTop()+(s-h)):l>v&&t.scrollTop(t.scrollTop()+(l+y-v));i<u&&r>f&&e<o||e>o&&r<f?t.scrollLeft(t.scrollLeft()+(e+y-o)):(e>o&&r>f&&i>u||i<u&&r<f)&&t.scrollLeft(t.scrollLeft()+(i-u))},_timeSlots:function(){return!this._slots||!this._slots.length?[]:this._slots[this._slots.length-1]},_headers:function(n){for(var u,a,s=[],f,e,t,c,l=i.styles,o=0,v=n.length;o<v;o++){for(f=n[o],e=[],u=0,a=f.length;u<a;u++)t=f[u],c=h(t.text),e.push(r("th",{colspan:t.span,className:l.header+(t.isNonWorking?" "+l.nonWorking:"")},[c]));s.push(r("tr",null,e))}return s},_hours:function(n,t){var i,e=[],r=this.options,s=r.workDayStart.getHours(),h=r.workDayEnd.getHours(),f,u,o=r.hourSpan;for(n=new Date(n),t=new Date(t);n<t;)i=new Date(n),u=i.getHours(),f=u>=s&&u<h,i.setHours(i.getHours()+o),u==i.getHours()&&i.setHours(i.getHours()+2*o),(!r.showWorkHours||f)&&e.push({start:n,end:i,isNonWorking:!f,span:1}),n=i;return e},_days:function(n,t){var i,u=[],r;for(n=new Date(n),t=new Date(t);n<t;)i=kendo.date.nextDay(n),r=this._isWorkDay(n),(!this.options.showWorkDays||r)&&u.push({start:n,end:i,isNonWorking:!r,span:1}),n=i;return u},_weeks:function(n,t){var i,f=[],e=this.calendarInfo().firstDay,r,u;for(n=new Date(n),t=new Date(t);n<t;)i=kendo.date.dayOfWeek(kendo.date.addDays(n,1),e,1),i>t&&(i=t),r=this._days(n,i),u=r.length,u>0&&f.push({start:r[0].start,end:r[u-1].end,span:u}),n=i;return f},_months:function(n,t){var i,f=[],r,u;for(n=new Date(n),t=new Date(t);n<t;)i=new Date(n),i.setMonth(i.getMonth()+1),r=this._days(n,i),u=r.length,u>0&&f.push({start:r[0].start,end:r[u-1].end,span:u}),n=i;return f},_years:function(n,t){var i,r=[];for(n=new Date(n),t=new Date(t);n<t;)i=new Date(n),i.setFullYear(i.getFullYear()+1),r.push({start:n,end:i,span:12}),n=i;return r},_slotHeaders:function(n,t){for(var u=[],i,r=0,f=n.length;r<f;r++)i=n[r],u.push({text:t(i),isNonWorking:!!i.isNonWorking,span:i.span});return u},_isWorkDay:function(n){for(var r=n.getDay(),i=this._workDays,t=0,u=i.length;t<u;t++)if(i[t]===r)return!0;return!1},calendarInfo:function(){return kendo.getCulture().calendars.standard},_renderCurrentTime:function(){var r=this._getCurrentTime(),f=this._offset(r),h=n("<div class='k-current-time'><\/div>"),e=i.styles,o=n(t+e.tasksWrapper),s=n(t+e.tasksTable),u;this.content&&this._timeSlots().length&&((this.content.find(".k-current-time").remove(),u=this._timeSlots()[this._slotIndex("start",r)],r<u.start||r>u.end)||(o.length&&s.length&&(f+=s.offset().left-o.offset().left),h.css({left:f+"px",top:"0px",width:"1px",height:this._contentHeight+"px"}).appendTo(this.content)))},_getCurrentTime:function(){return new Date},_currentTime:function(){var n=this.options.currentTimeMarker;n!==!1&&n.updateInterval!==undefined&&(this._renderCurrentTime(),this._currentTimeUpdateTimer=setInterval(it(this._renderCurrentTime,this),n.updateInterval))}}),g,f;c(!0,i,{styles:{alt:"k-alt",reset:"k-reset",nonWorking:"k-nonwork-hour",header:"k-header",gridHeader:"k-grid-header",gridHeaderWrap:"k-grid-header-wrap",gridContent:"k-grid-content",tasksWrapper:"k-gantt-tables",rowsTable:"k-gantt-rows",columnsTable:"k-gantt-columns",tasksTable:"k-gantt-tasks",dependenciesWrapper:"k-gantt-dependencies",resource:"k-resource",resourceAlt:"k-resource k-alt",task:"k-task",taskSingle:"k-task-single",taskMilestone:"k-task-milestone",taskSummary:"k-task-summary",taskWrap:"k-task-wrap",taskMilestoneWrap:"k-milestone-wrap",resourcesWrap:"k-resources-wrap",taskDot:"k-task-dot",taskDotStart:"k-task-start",taskDotEnd:"k-task-end",taskDragHandle:"k-task-draghandle",taskContent:"k-task-content",taskTemplate:"k-task-template",taskActions:"k-task-actions",taskDelete:"k-task-delete",taskComplete:"k-task-complete",taskDetails:"k-task-details",taskDetailsPercent:"k-task-pct",link:"k-link",icon:"k-icon",iconDelete:"k-si-close",taskResizeHandle:"k-resize-handle",taskResizeHandleWest:"k-resize-w",taskResizeHandleEast:"k-resize-e",taskSummaryProgress:"k-task-summary-progress",taskSummaryComplete:"k-task-summary-complete",line:"k-line",lineHorizontal:"k-line-h",lineVertical:"k-line-v",arrowWest:"k-arrow-w",arrowEast:"k-arrow-e",dragHint:"k-drag-hint",dependencyHint:"k-dependency-hint",tooltipWrapper:"k-widget k-tooltip k-popup k-group k-reset",tooltipContent:"k-tooltip-content",tooltipCallout:"k-callout k-callout-s",callout:"k-callout",marquee:"k-marquee k-gantt-marquee",marqueeColor:"k-marquee-color"}});kendo.ui.GanttDayView=i.extend({name:"day",options:{timeHeaderTemplate:st,dayHeaderTemplate:w,resizeTooltipFormat:"h:mm tt ddd, MMM d"},range:function(n){this.start=kendo.date.getDate(n.start);this.end=kendo.date.getDate(n.end);(kendo.date.getMilliseconds(n.end)>0||this.end.getTime()===this.start.getTime())&&(this.end=kendo.date.addDays(this.end,1))},_createSlots:function(){var n,t,i,u,f=[],r,e;for(n=this._days(this.start,this.end),i=[],r=0,e=n.length;r<e;r++)t=n[r],u=this._hours(t.start,t.end),t.span=u.length,i.push.apply(i,u);return f.push(n),f.push(i),f},_layout:function(){var n=[],t=this.options;return n.push(this._slotHeaders(this._slots[0],kendo.template(t.dayHeaderTemplate))),n.push(this._slotHeaders(this._slots[1],kendo.template(t.timeHeaderTemplate))),n}});kendo.ui.GanttWeekView=i.extend({name:"week",options:{dayHeaderTemplate:w,weekHeaderTemplate:b,resizeTooltipFormat:"h:mm tt ddd, MMM d"},range:function(n){var r=this.calendarInfo(),i=r.firstDay,t=n.end;i===t.getDay()&&t.setDate(t.getDate()+7);this.start=kendo.date.getDate(kendo.date.dayOfWeek(n.start,i,-1));this.end=kendo.date.getDate(kendo.date.dayOfWeek(t,i,1))},_createSlots:function(){var n=[];return n.push(this._weeks(this.start,this.end)),n.push(this._days(this.start,this.end)),n},_layout:function(){var n=[],t=this.options;return n.push(this._slotHeaders(this._slots[0],kendo.template(t.weekHeaderTemplate))),n.push(this._slotHeaders(this._slots[1],kendo.template(t.dayHeaderTemplate))),n}});kendo.ui.GanttMonthView=i.extend({name:"month",options:{weekHeaderTemplate:b,monthHeaderTemplate:k,resizeTooltipFormat:"dddd, MMM d, yyyy"},range:function(n){this.start=kendo.date.firstDayOfMonth(n.start);this.end=kendo.date.addDays(kendo.date.getDate(kendo.date.lastDayOfMonth(n.end)),1)},_createSlots:function(){var n=[];return n.push(this._months(this.start,this.end)),n.push(this._weeks(this.start,this.end)),n},_layout:function(){var n=[],t=this.options;return n.push(this._slotHeaders(this._slots[0],kendo.template(t.monthHeaderTemplate))),n.push(this._slotHeaders(this._slots[1],kendo.template(t.weekHeaderTemplate))),n}});kendo.ui.GanttYearView=i.extend({name:"year",options:{yearHeaderTemplate:ht,monthHeaderTemplate:k,resizeTooltipFormat:"dddd, MMM d, yyyy"},range:function(n){this.start=kendo.date.firstDayOfMonth(new Date(n.start.setMonth(0)));this.end=kendo.date.firstDayOfMonth(new Date(n.end.setMonth(12)))},_createSlots:function(){var t=[],i=this._months(this.start,this.end);return n(i).each(function(n,t){t.span=1}),t.push(this._years(this.start,this.end)),t.push(i),t},_layout:function(){var n=[],t=this.options;return n.push(this._slotHeaders(this._slots[0],kendo.template(t.yearHeaderTemplate))),n.push(this._slotHeaders(this._slots[1],kendo.template(t.monthHeaderTemplate))),n}});g={wrapper:"k-timeline k-grid k-widget",gridHeader:"k-grid-header",gridHeaderWrap:"k-grid-header-wrap",gridContent:"k-grid-content",gridContentWrap:"k-grid-content",tasksWrapper:"k-gantt-tables",dependenciesWrapper:"k-gantt-dependencies",task:"k-task",line:"k-line",taskResizeHandle:"k-resize-handle",taskResizeHandleWest:"k-resize-w",taskDragHandle:"k-task-draghandle",taskComplete:"k-task-complete",taskDelete:"k-task-delete",taskWrapActive:"k-task-wrap-active",taskWrap:"k-task-wrap",taskDot:"k-task-dot",taskDotStart:"k-task-start",taskDotEnd:"k-task-end",hovered:"k-state-hover",selected:"k-state-selected",origin:"k-origin"};f=kendo.ui.GanttTimeline=o.extend({init:function(n,t){o.fn.init.call(this,n,t);this.options.views&&this.options.views.length||(this.options.views=["day","week","month"]);u=kendo.support.isRtl(n);this._wrapper();this._domTrees();this._views();this._selectable();this._draggable();this._resizable();this._percentResizeDraggable();this._createDependencyDraggable();this._attachEvents();this._tooltip()},options:{name:"GanttTimeline",messages:{views:{day:"Day",week:"Week",month:"Month",year:"Year",start:"Start",end:"End"}},snap:!0,selectable:!0,editable:!0},destroy:function(){o.fn.destroy.call(this);clearTimeout(this._tooltipTimeout);this._currentTimeUpdateTimer&&clearInterval(this._currentTimeUpdateTimer);this._unbindView(this._selectedView);this._moveDraggable&&this._moveDraggable.destroy();this._resizeDraggable&&this._resizeDraggable.destroy();this._percentDraggable&&this._percentDraggable.destroy();this._dependencyDraggable&&this._dependencyDraggable.destroy();this.touch&&this.touch.destroy();this._headerTree=null;this._taskTree=null;this._dependencyTree=null;this.wrapper.off(e);kendo.destroy(this.wrapper)},_wrapper:function(){var i=f.styles,u=this,r=this.options,e=function(){var s=typeof r.rowHeight===ut?r.rowHeight:r.rowHeight+"px",f=n(kendo.format(vt,s)),e,o,h=u.wrapper.find(t+i.tasksWrapper);return h.append(f),e=f.find("tr").outerHeight(),o=f.find("td").height(),f.remove(),{row:e,cell:o}};this.wrapper=this.element.addClass(i.wrapper).append("<div class='"+i.gridHeader+"'><div class='"+i.gridHeaderWrap+"'><\/div><\/div>").append("<div class='"+i.gridContentWrap+"'><div class='"+i.tasksWrapper+"'><\/div><div class='"+i.dependenciesWrapper+"'><\/div><\/div>");r.rowHeight&&(this._calculatedSize=e())},_domTrees:function(){var n=f.styles,i=kendo.dom.Tree,r=this.wrapper;this._headerTree=new i(r.find(t+n.gridHeaderWrap)[0]);this._taskTree=new i(r.find(t+n.tasksWrapper)[0]);this._dependencyTree=new i(r.find(t+n.dependenciesWrapper)[0])},_views:function(){var e=this.options.views,n,i,t,r,u,f,o;for(this.views={},f=0,o=e.length;f<o;f++)(n=e[f],i=tt(n),i&&n.selectable===!1)||(t=i?typeof n.type!="string"?n.title:n.type:n,r=yt[t],r&&(i&&(n.type=r.type),r.title=this.options.messages.views[t]),n=c({title:t},r,i?n:{}),t&&(this.views[t]=n,(!u||n.selected)&&(u=t)));u&&(this._selectedViewName=u)},view:function(n){return n&&(this._selectView(n),this.trigger("navigate",{view:n,action:"changeView"})),this._selectedView},_selectView:function(n){n&&this.views[n]&&(this._selectedView&&this._unbindView(this._selectedView),this._selectedView=this._initializeView(n),this._selectedViewName=n)},_viewByIndex:function(n){var t,i=this.views;for(t in i){if(!n)return t;n--}},_initializeView:function(n){var t=this.views[n],i;if(t)if(i=t.type,typeof i=="string"&&(i=kendo.getter(t.type)(window)),i)t=new i(this.wrapper,pt(c(!0,{headerTree:this._headerTree,taskTree:this._taskTree,dependencyTree:this._dependencyTree,calculatedSize:this._calculatedSize},t,this.options)));else throw new Error("There is no such view");return t},_unbindView:function(n){n&&n.destroy()},_range:function(n){var t,i;return!n||!n.length?{start:new Date,end:new Date}:(t=new v(n).sort({field:"start",dir:"asc"}).toArray()[0].start||new Date,i=new v(n).sort({field:"end",dir:"desc"}).toArray()[0].end||new Date,{start:new Date(t),end:new Date(i)})},_render:function(n){var t=this.view(),i=this._range(n);this._tasks=n;t.range(i);t.renderLayout();t.render(n)},_renderDependencies:function(n){this.view()._renderDependencies(n)},_taskByUid:function(n){for(var r=this._tasks,u=r.length,t,i=0;i<u;i++)if(t=r[i],t.uid===n)return t},_draggable:function(){var n=this,r,i,e,o,s=this.options.snap,h=f.styles,c=function(){n.view()._removeDragHint();r&&r.css("opacity",1);r=null;i=null;n.dragInProgress=!1};this.options.editable&&(this._moveDraggable=new kendo.ui.Draggable(this.wrapper,{distance:0,filter:t+h.task,holdToDrag:kendo.support.mobileOS,ignore:t+h.taskResizeHandle}),this._moveDraggable.bind("dragstart",function(t){var u=n.view();if(r=t.currentTarget.parent(),i=n._taskByUid(t.currentTarget.attr("data-uid")),n.trigger("moveStart",{task:i})){t.preventDefault();return}e=i.start;o=u._timeByPosition(t.x.location,s)-e;u._createDragHint(r);r.css("opacity",.5);clearTimeout(n._tooltipTimeout);n.dragInProgress=!0}).bind("drag",kendo.throttle(function(t){if(n.dragInProgress){var f=n.view(),r=new Date(f._timeByPosition(t.x.location,s)-o),h=r;n.trigger("move",{task:i,start:r})||(e=r,u&&(h=new Date(e.getTime()+i.duration())),f._updateDragHint(h))}},15)).bind("dragend",function(){n.trigger("moveEnd",{task:i,start:e});c()}).bind("dragcancel",function(){c()}).userEvents.bind("select",function(){l()}))},_resizable:function(){var n=this,s,i,r,e,o,a=this.options.snap,h=f.styles,c=function(){n.view()._removeResizeHint();s=null;i=null;n.dragInProgress=!1};this.options.editable&&(this._resizeDraggable=new kendo.ui.Draggable(this.wrapper,{distance:0,filter:t+h.taskResizeHandle,holdToDrag:!1}),this._resizeDraggable.bind("dragstart",function(f){if(o=f.currentTarget.hasClass(h.taskResizeHandleWest),u&&(o=!o),s=f.currentTarget.closest(t+h.task),i=n._taskByUid(s.attr("data-uid")),n.trigger("resizeStart",{task:i})){f.preventDefault();return}r=i.start;e=i.end;n.view()._createResizeHint(i);clearTimeout(n._tooltipTimeout);n.dragInProgress=!0}).bind("drag",kendo.throttle(function(t){if(n.dragInProgress){var f=n.view(),u=f._timeByPosition(t.x.location,a,!o);o?r=u<e?u:e:e=u>r?u:r;n.trigger("resize",{task:i,start:r,end:e})||f._updateResizeHint(r,e,o)}},15)).bind("dragend",function(){n.trigger("resizeEnd",{task:i,resizeStart:o,start:r,end:e});c()}).bind("dragcancel",function(){c()}).userEvents.bind("select",function(){l()}))},_percentResizeDraggable:function(){var n=this,e,i,h,c,a,o,s,y,v,r=f.styles,p,w=function(){n.view()._removePercentCompleteTooltip();i=null;e=null;n.dragInProgress=!1},b=function(n){i.find(t+r.taskComplete).width(n).end().siblings(t+r.taskDragHandle).css(u?"right":"left",n)};this.options.editable&&(this._percentDraggable=new kendo.ui.Draggable(this.wrapper,{distance:0,filter:t+r.taskDragHandle,holdToDrag:!1}),this._percentDraggable.bind("dragstart",function(u){if(n.trigger("percentResizeStart")){u.preventDefault();return}i=u.currentTarget.siblings(t+r.task);e=n._taskByUid(i.attr("data-uid"));s=e.percentComplete;h=i.offset();c=this.element.offset();a=i.find(t+r.taskComplete).width();o=i.outerWidth();clearTimeout(n._tooltipTimeout);n.dragInProgress=!0}).bind("drag",kendo.throttle(function(t){if(n.dragInProgress){p=u?-t.x.initialDelta:t.x.initialDelta;var i=Math.max(0,Math.min(o,a+p));s=Math.round(i/o*100);b(i);y=h.top-c.top;v=h.left+i-c.left;u&&(v+=o-2*i);n.view()._updatePercentCompleteTooltip(y,v,s)}},15)).bind("dragend",function(){n.trigger("percentResizeEnd",{task:e,percentComplete:s/100});w()}).bind("dragcancel",function(){b(a);w()}).userEvents.bind("select",function(){l()}))},_createDependencyDraggable:function(){var r=this,u,e=n(),o=n(),h,c,v=a.msie&&a.version<9,i=f.styles,y=function(){u.css("display","").removeClass(i.hovered);u.parent().removeClass(i.origin);u=null;s(!1);o=n();e=n();r.view()._removeDependencyDragHint();r.dragInProgress=!1},s=function(n){o.hasClass(i.origin)||(o.find(t+i.taskDot).css("display",n?"block":""),e.toggleClass(i.hovered,n))};this.options.editable&&(v&&document.namespaces&&document.namespaces.add("kvml","urn:schemas-microsoft-com:vml","#default#VML"),this._dependencyDraggable=new kendo.ui.Draggable(this.wrapper,{distance:0,filter:t+i.taskDot,holdToDrag:!1}),this._dependencyDraggable.bind("dragstart",function(f){if(r.trigger("dependencyDragStart")){f.preventDefault();return}u=f.currentTarget.css("display","block").addClass(i.hovered);u.parent().addClass(i.origin);var e=u.offset(),o=n(t+i.tasksWrapper).offset();h=Math.round(e.left-o.left+u.outerHeight()/2);c=Math.round(e.top-o.top+u.outerWidth()/2);clearTimeout(r._tooltipTimeout);r.dragInProgress=!0}).bind("drag",kendo.throttle(function(u){if(r.dragInProgress){r.view()._removeDependencyDragHint();var f=n(kendo.elementUnderCursor(u)),l=n(t+i.tasksWrapper).offset(),a=u.x.location-l.left,y=u.y.location-l.top;r.view()._updateDependencyDragHint({x:h,y:c},{x:a,y:y},v);s(!1);e=f.hasClass(i.taskDot)?f:n();o=f.closest(t+i.taskWrap);s(!0)}},15)).bind("dragend",function(){if(e.length){var s=u.hasClass(i.taskDotStart),n=e.hasClass(i.taskDotStart),h=s?n?3:2:n?1:0,f=r._taskByUid(u.siblings(t+i.task).attr("data-uid")),o=r._taskByUid(e.siblings(t+i.task).attr("data-uid"));f!==o&&r.trigger("dependencyDragEnd",{type:h,predecessor:f,successor:o})}y()}).bind("dragcancel",function(){y()}).userEvents.bind("select",function(){l()}))},_selectable:function(){var i=this,r=f.styles;if(this.options.selectable)this.wrapper.on(s+e,t+r.task,function(t){t.stopPropagation();t.ctrlKey?i.trigger("clear"):i.trigger("select",{uid:n(this).attr("data-uid")})}).on(s+e,t+r.taskWrap,function(t){t.stopPropagation();n(this).css("z-index","0");var i=n(document.elementFromPoint(t.clientX,t.clientY));i.hasClass(r.line)&&i.click();n(this).css("z-index","")}).on(s+e,t+r.tasksWrapper,function(){i.selectDependency().length>0?i.clearSelection():i.trigger("clear")}).on(s+e,t+r.line,function(n){n.stopPropagation();i.selectDependency(this)})},select:function(n){var r=this.wrapper.find(n),i=f.styles;if(r.length){this.clearSelection();r.addClass(i.selected);kendo.support.mobileOS&&r.parent().addClass(i.taskWrapActive);return}return this.wrapper.find(t+i.task+t+i.selected)},selectDependency:function(i){var u=this.wrapper.find(i),e,r=f.styles;if(u.length){this.clearSelection();this.trigger("clear");e=n(u).attr("data-uid");this.wrapper.find(t+r.line+"[data-uid='"+e+"']").addClass(r.selected);return}return this.wrapper.find(t+r.line+t+r.selected)},clearSelection:function(){var n=f.styles;this.wrapper.find(t+n.selected).removeClass(n.selected);kendo.support.mobileOS&&this.wrapper.find(t+n.taskWrapActive).removeClass(n.taskWrapActive)},_attachEvents:function(){var i=this,r=f.styles;if(this.options.editable){this._tabindex();this.wrapper.on(s+e,t+r.taskDelete,function(u){i.trigger("removeTask",{uid:n(this).closest(t+r.task).attr("data-uid")});u.stopPropagation();u.preventDefault()}).on(ot+e,function(n){var t;n.keyCode===rt.DELETE&&(t=i.selectDependency(),t.length&&(i.trigger("removeDependency",{uid:t.attr("data-uid")}),i.clearSelection()))});if(kendo.support.mobileOS)this.touch=this.wrapper.kendoTouch({filter:t+r.task,doubletap:function(t){i.trigger("editTask",{uid:n(t.touch.currentTarget).attr("data-uid")})}}).data("kendoTouch");else this.wrapper.on(ft+e,t+r.task,function(t){i.trigger("editTask",{uid:n(this).attr("data-uid")});t.stopPropagation();t.preventDefault()})}},_tooltip:function(){var i=this,u=this.options.tooltip,r=f.styles,o,h=function(n){o=n.clientX};if(!u||u.visible!==!1)if(kendo.support.mobileOS){this.wrapper.on(s+e,t+r.taskDelete,function(n){n.stopPropagation();i.view()._removeTaskTooltip()}).on(p+e,t+r.task,function(u){var f=n(u.relatedTarget).parents(t+r.taskWrap,t+r.task);f.length===0&&i.view()._removeTaskTooltip()});this.touch.bind("tap",function(t){var r=t.touch.target,u=i._taskByUid(n(r).attr("data-uid")),f=t.touch.x.client;i.view()._taskTooltip&&i.view()._removeTaskTooltip();i.view()._createTaskTooltip(u,r,f)}).bind("doubletap",function(){i.view()._removeTaskTooltip()})}else this.wrapper.on(et+e,t+r.task,function(){var t=this,r=i._taskByUid(n(this).attr("data-uid"));if(!i.dragInProgress){i._tooltipTimeout=setTimeout(function(){i.view()._createTaskTooltip(r,t,o)},800);n(this).on(y,h)}}).on(p+e,t+r.task,function(){clearTimeout(i._tooltipTimeout);i.view()._removeTaskTooltip();n(this).off(y,h)})}});c(!0,f,{styles:g})})(window.kendo.jQuery)}(),function(){(function(n,t){function l(n){return"["+i.attr("uid")+(n?"='"+n+"']":"]")}function hi(n){return delete n.name,delete n.prefix,delete n.remove,delete n.edit,delete n.add,delete n.navigate,n}function ci(n){if(n.filter("[name=end], [name=start]").length){for(var o=n.attr("name"),e=i.widgetInstance(n,i.ui),t={},r=n,u,f;r!==window&&!u;)r=r.parent(),u=r.data("kendoEditable");return(f=u?u.options.model:null,!f)?!0:(t.start=f.start,t.end=f.end,t[o]=e?e.value():i.parseDate(n.value()),t.start<=t.end)}return!0}function g(t,r){var e=t.parents("["+i.attr("role")+'="gantt"]'),u=[],f=li(e);t.attr(it,0);r&&f.each(function(t,i){u[t]=n(i).scrollTop()});try{t[0].setActive()}catch(o){t[0].focus()}r&&f.each(function(t,i){n(i).scrollTop(u[t])})}function li(t){return n(t).parentsUntil("body").filter(function(n,t){var r=i.getComputedStyles(t,["overflow"]);return r.overflow!="visible"}).add(window)}var i=window.kendo,et="matchMedia"in window,ot=i.support.browser,bt=i.support.mobileOS,st=i.Observable,v=i.ui.Widget,a=i.data.DataSource,ht=i.data.ObservableObject,kt=i.data.ObservableArray,c=i.data.Query,y=n.isArray,dt=n.inArray,gt=i.isFunction,o=n.proxy,e=n.extend,p=n.isPlainObject,ni=n.map,s=i.keys,f=".kendoGantt",tt="p0",it="tabIndex",h="click",ct="width",rt="string",ti={down:{origin:"bottom left",position:"top left"},up:{origin:"top left",position:"bottom left"}},k="aria-activedescendant",lt="gantt_active_cell",d="action-option-focused",r=".",ii=i.template('<button class="#=styles.buttonToggle#"><span class="#=styles.iconToggle#">&nbps;<\/span><\/button>'),at='<button class="#=styles.button# #=className#" #if (action) {#data-action="#=action#"#}#><span class="#=iconClass#"><\/span><span>#=text#<\/span><\/button>',ri='<a class="#=className#" #=attr# href="\\#">#=text#<\/a>',ui=i.template('<li class="#=styles.currentView# #=styles.viewButtonDefault#"><a href="\\#" class="#=styles.link#">&nbps;<\/a><\/li>'),fi=i.template('<ul class="#=styles.viewsWrapper#">#for(var view in views){#<li class="#=styles.viewButtonDefault# #=styles.viewButton#-#= view.toLowerCase() #" data-#=ns#name="#=view#"><a href="\\#" class="#=styles.link#">#=views[view].title#<\/a><\/li>#}#<\/ul>'),ei=i.template('<div class="#=styles.popupWrapper#"><ul class="#=styles.popupList#" role="listbox">#for(var i = 0, l = actions.length; i < l; i++){#<li class="#=styles.item#" data-action="#=actions[i].data#" role="option">#=actions[i].text#<\/span>#}#<\/ul><\/div>'),oi=function(t,r){var f={name:r.field},u=r.model.fields[r.field].validation;u&&p(u)&&u.message&&(f[i.attr("dateCompare-msg")]=u.message);n('<input type="text" required '+i.attr("type")+'="date" '+i.attr("role")+'="datetimepicker" '+i.attr("bind")+'="value:'+r.field+'" '+i.attr("validate")+"='true' />").attr(f).appendTo(t);n("<span "+i.attr("for")+'="'+r.field+'" class="k-invalid-msg"/>').hide().appendTo(t)},si=function(t,i){n('<a href="#" class="'+i.styles.button+'">'+i.messages.assignButton+"<\/a>").click(i.click).appendTo(t)},vt={wrapper:"k-widget k-gantt",rowHeight:"k-gantt-rowheight",listWrapper:"k-gantt-layout k-gantt-treelist",list:"k-gantt-treelist",timelineWrapper:"k-gantt-layout k-gantt-timeline",timeline:"k-gantt-timeline",splitBarWrapper:"k-splitbar k-state-default k-splitbar-horizontal k-splitbar-draggable-horizontal k-gantt-layout",splitBar:"k-splitbar",splitBarHover:"k-splitbar-horizontal-hover",popupWrapper:"k-list-container",popupList:"k-list k-reset",resizeHandle:"k-resize-handle",icon:"k-icon",item:"k-item",line:"k-line",buttonDelete:"k-gantt-delete",buttonCancel:"k-gantt-cancel",buttonSave:"k-gantt-update",buttonToggle:"k-gantt-toggle",primary:"k-primary",hovered:"k-state-hover",selected:"k-state-selected",focused:"k-state-focused",gridHeader:"k-grid-header",gridHeaderWrap:"k-grid-header-wrap",gridContent:"k-grid-content",popup:{form:"k-popup-edit-form",editForm:"k-gantt-edit-form",formContainer:"k-edit-form-container",resourcesFormContainer:"k-resources-form-container",message:"k-popup-message",buttonsContainer:"k-edit-buttons k-state-default",button:"k-button",editField:"k-edit-field",editLabel:"k-edit-label",resourcesField:"k-gantt-resources"},toolbar:{headerWrapper:"k-floatwrap k-header k-gantt-toolbar",footerWrapper:"k-floatwrap k-header k-gantt-toolbar",toolbar:"k-gantt-toolbar",expanded:"k-state-expanded",views:"k-gantt-views",viewsWrapper:"k-reset k-header k-gantt-views",actions:"k-gantt-actions",button:"k-button k-button-icontext",buttonToggle:"k-button k-button-icon k-gantt-toggle",iconPlus:"k-icon k-i-plus",iconPdf:"k-icon k-i-pdf",iconToggle:"k-icon k-i-gantt-toggle",viewButtonDefault:"k-state-default",viewButton:"k-view",currentView:"k-current-view",link:"k-link",pdfButton:"k-gantt-pdf",appendButton:"k-gantt-create"}},w,yt=st.extend({init:function(n,t){st.fn.init.call(this);this.element=n;this.options=e(!0,{},this.options,t);this._popup()},options:{direction:"down",navigatable:!1},_current:function(n){var t=u.styles,i=this.list.find(r+t.focused),f=i[n]();f.length&&(i.removeClass(t.focused).removeAttr("id"),f.addClass(t.focused).attr("id",d),this.list.find("ul").removeAttr(k).attr(k,d))},_popup:function(){var t=this,o=u.styles,c="li"+r+o.item,a=r+o.toolbar.appendButton,l=this.options.messages.actions,v=this.options.navigatable;this.list=n(ei({styles:o,actions:[{data:"add",text:l.addChild},{data:"insert-before",text:l.insertBefore},{data:"insert-after",text:l.insertAfter}]}));this.element.append(this.list);this.popup=new i.ui.Popup(this.list,e({anchor:this.element.find(a),open:function(){t._adjustListWidth()},animation:this.options.animation},ti[this.options.direction]));this.element.on(h+f,a,function(r){var f=n(this),u=f.attr(i.attr("action"));r.preventDefault();u?t.trigger("command",{type:u}):(t.popup.open(),v&&t.list.find("li:first").addClass(o.focused).attr("id",d).end().find("ul").attr({TABINDEX:0,"aria-activedescendant":d}).focus())});this.list.find(c).hover(function(){n(this).addClass(o.hovered)},function(){n(this).removeClass(o.hovered)}).end().on(h+f,c,function(){t.trigger("command",{type:n(this).attr(i.attr("action"))});t.popup.close()});if(v){this.popup.bind("close",function(){t.list.find(c).removeClass(o.focused).end().find("ul").attr(it,0);t.element.parents("["+i.attr("role")+'="gantt"]').find(r+o.gridContent+" > table:first").focus()});this.list.find("ul").on("keydown"+f,function(n){var i=n.keyCode;switch(i){case s.UP:n.preventDefault();t._current("prev");break;case s.DOWN:n.preventDefault();t._current("next");break;case s.ENTER:t.list.find(r+o.focused).click();break;case s.ESC:n.preventDefault();t.popup.close()}})}},_adjustListWidth:function(){var t=this.list,s=u.styles,i=t[0].style.width,e=this.element.find(r+s.toolbar.appendButton),o=t.outerWidth(),n,f;(t.data(ct)||!i)&&(n=window.getComputedStyle?window.getComputedStyle(e[0],null):0,f=n?parseFloat(n.width):e.outerWidth(),n&&(ot.mozilla||ot.msie)&&(f+=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight)+parseFloat(n.borderLeftWidth)+parseFloat(n.borderRightWidth)),i=t.css("box-sizing")!=="border-box"?f-(t.outerWidth()-t.width()):f,o>i&&(i=o),t.css({fontFamily:e.css("font-family"),width:i}).data(ct,i))},destroy:function(){clearTimeout(this._focusTimeout);this.popup.destroy();this.element.off(f);this.list.off(f);this.unbind()}}),pt=function(n,t){return function(i){i=y(i)?{data:i}:i;var r=i||{},u=r.data;if(r.data=u,!(r instanceof n)&&r instanceof a)throw new Error("Incorrect DataSource type. Only "+t+" instances are supported");return r instanceof n?r:new n(r)}},ut=i.data.Model.define({id:"id",fields:{id:{type:"number"},predecessorId:{type:"number"},successorId:{type:"number"},type:{type:"number"}}}),ft=a.extend({init:function(n){a.fn.init.call(this,e(!0,{},{schema:{modelBase:ut,model:ut}},n))},successors:function(n){return this._dependencies("predecessorId",n)},predecessors:function(n){return this._dependencies("successorId",n)},dependencies:function(n){var t=this.predecessors(n),i=this.successors(n);return t.push.apply(t,i),t},_dependencies:function(n,t){var i=this.view(),r={field:n,operator:"eq",value:t};return new c(i).filter(r).toArray()}}),b,nt;ft.create=pt(ft,"GanttDependencyDataSource");b=i.data.Model.define({duration:function(){var n=this.end,t=this.start;return n-t},isMilestone:function(){return this.duration()===0},_offset:function(n){for(var i=["start","end"],r,t=0;t<i.length;t++)r=new Date(this.get(i[t]).getTime()+n),this.set(i[t],r)},id:"id",fields:{id:{type:"number"},parentId:{type:"number",defaultValue:null,validation:{required:!0}},orderId:{type:"number",validation:{required:!0}},title:{type:"string",defaultValue:"New task"},start:{type:"date",validation:{required:!0}},end:{type:"date",validation:{required:!0,dateCompare:ci,message:"End date should be after or equal to the start date"}},percentComplete:{type:"number",validation:{required:!0,min:0,max:1,step:.01}},summary:{type:"boolean"},expanded:{type:"boolean",defaultValue:!0}}});nt=a.extend({init:function(n){a.fn.init.call(this,e(!0,{},{schema:{modelBase:b,model:b}},n))},remove:function(n){var t=n.get("parentId"),i=this.taskAllChildren(n);return this._removeItems(i),n=a.fn.remove.call(this,n),this._childRemoved(t,n.get("orderId")),n},add:function(n){if(n)return n=this._toGanttTask(n),this.insert(this.taskSiblings(n).length,n)},insert:function(n,t){if(t)return t=this._toGanttTask(t),t.set("orderId",n),t=a.fn.insert.call(this,n,t),this._reorderSiblings(t,this.taskSiblings(t).length-1),this._resolveSummaryFields(this.taskParent(t)),t},taskChildren:function(n){var u=this.view(),r={field:"parentId",operator:"eq",value:null},f=this._sort||{field:"orderId",dir:"asc"},i;if(!!n){if(i=n.get("id"),i===t||i===null||i==="")return[];r.value=i}return new c(u).filter(r).sort(f).toArray()},taskAllChildren:function(n){var t=[],r=this,i=function(n){var u=r.taskChildren(n);t.push.apply(t,u);ni(u,i)};return n?i(n):t=this.view(),t},taskSiblings:function(n){if(!n)return null;var t=this.taskParent(n);return this.taskChildren(t)},taskParent:function(n){return!n||n.get("parentId")===null?null:this.get(n.parentId)},taskLevel:function(n){for(var i=0,t=this.taskParent(n);t!==null;)i+=1,t=this.taskParent(t);return i},taskTree:function(n){for(var f,t=[],i,u=this.taskChildren(n),r=0,e=u.length;r<e;r++)i=u[r],t.push(i),i.get("expanded")&&(f=this.taskTree(i),t.push.apply(t,f));return t},update:function(n,i){var r=this,u,o=function(n,t){for(var u=r.taskAllChildren(n),i=0,f=u.length;i<f;i++)u[i]._offset(t)},e=function(n){var i=n.field,t=n.sender;switch(i){case"start":r._resolveSummaryStart(r.taskParent(t));o(t,t.get(i).getTime()-u.getTime());break;case"end":r._resolveSummaryEnd(r.taskParent(t));break;case"percentComplete":r._resolveSummaryPercentComplete(r.taskParent(t));break;case"orderId":r._reorderSiblings(t,u)}},f;i.parentId!==t&&(u=n.get("parentId"),u!==i.parentId&&(n.set("parentId",i.parentId),r._childRemoved(u,n.get("orderId")),n.set("orderId",r.taskSiblings(n).length-1),r._resolveSummaryFields(r.taskParent(n))),delete i.parentId);n.bind("change",e);for(f in i)u=n.get(f),n.set(f,i[f]);n.unbind("change",e)},_resolveSummaryFields:function(n){n&&(this._updateSummary(n),this.taskChildren(n).length)&&(this._resolveSummaryStart(n),this._resolveSummaryEnd(n),this._resolveSummaryPercentComplete(n))},_resolveSummaryStart:function(n){var t=this,i=function(n){for(var i=t.taskChildren(n),r=i[0].start.getTime(),u,f=1,e=i.length;f<e;f++)u=i[f].start.getTime(),u<r&&(r=u);return new Date(r)};this._updateSummaryRecursive(n,"start",i)},_resolveSummaryEnd:function(n){var t=this,i=function(n){for(var i=t.taskChildren(n),r=i[0].end.getTime(),u,f=1,e=i.length;f<e;f++)u=i[f].end.getTime(),u>r&&(r=u);return new Date(r)};this._updateSummaryRecursive(n,"end",i)},_resolveSummaryPercentComplete:function(n){var t=this,i=function(n){var i=t.taskChildren(n),r=new c(i).aggregate([{field:"percentComplete",aggregate:"average"}]);return r.percentComplete.average};this._updateSummaryRecursive(n,"percentComplete",i)},_updateSummaryRecursive:function(n,t,i){var u,r;n&&(u=i(n),n.set(t,u),r=this.taskParent(n),r&&this._updateSummaryRecursive(r,t,i))},_childRemoved:function(n,t){for(var r=n===null?null:this.get(n),u=this.taskChildren(r),i=t,f=u.length;i<f;i++)u[i].set("orderId",i);this._resolveSummaryFields(r)},_reorderSiblings:function(n,t){for(var r=n.get("orderId"),u=r>t,f=u?t:r,e=u?r:t,s=u?f:f+1,o=this.taskSiblings(n),e=Math.min(e,o.length-1),i=f;i<=e;i++)o[i]!==n&&(o[i].set("orderId",s),s+=1)},_updateSummary:function(n){if(n!==null){var t=this.taskChildren(n).length;n.set("summary",t>0)}},_toGanttTask:function(n){if(!(n instanceof b)){var t=n;n=this._createNewModel();n.accept(t)}return n}});nt.create=pt(nt,"GanttDataSource");e(!0,i.data,{GanttDataSource:nt,GanttTask:b,GanttDependencyDataSource:ft,GanttDependency:ut});var wt={desktop:{dateRange:oi,resources:si}},ai=i.Observable.extend({init:function(n,t){i.Observable.fn.init.call(this);this.element=n;this.options=e(!0,{},this.options,t);this.createButton=this.options.createButton},fields:function(t,i){var h=this,o=this.options,f=o.messages.editor,s=o.resources,e,c=function(n){n.preventDefault();s.editor(h.container.find(r+u.styles.popup.resourcesField),i)};return o.editable.template?e=n.map(i.fields,function(n,t){return{field:t}}):(e=[{field:"title",title:f.title},{field:"start",title:f.start,editor:t.dateRange},{field:"end",title:f.end,editor:t.dateRange},{field:"percentComplete",title:f.percentComplete,format:tt}],i.get(s.field)&&e.push({field:s.field,title:f.resources,messages:f,editor:t.resources,click:c,styles:u.styles.popup})),e},_buildEditTemplate:function(n,t,r){var y=this.options.resources,h=this.options.editable.template,a=e({},i.Template,this.options.templateSettings),p=a.paramName,c=u.styles.popup,s="",l,v,f,o;if(h)typeof h===rt&&(h=window.unescape(h)),s+=i.template(h,a)(n);else for(l=0,v=t.length;l<v;l++)f=t[l],s+='<div class="'+c.editLabel+'"><label for="'+f.field+'">'+(f.title||f.field||"")+"<\/label><\/div>",f.field===y.field&&(s+='<div class="'+c.resourcesField+'" style="display:none"><\/div>'),!n.editable||n.editable(f.field)?(r.push(f),s+="<div "+i.attr("container-for")+'="'+f.field+'" class="'+c.editField+'"><\/div>'):(o="#:",f.field?(f=i.expr(f.field,p),o+=f+"==null?'':"+f):o+="''",o+="#",o=i.template(o,a),s+='<div class="'+c.editField+'">'+o(n)+"<\/div>");return s}}),vi=ai.extend({destroy:function(){this.close();this.unbind()},editTask:function(n){this.editable=this._createPopupEditor(n)},close:function(){var n=this,t=function(){n.editable&&(n.editable.destroy(),n.editable=null,n.container=null);n.popup&&(n.popup.destroy(),n.popup=null)};this.editable&&this.container.is(":visible")?this.container.data("kendoWindow").bind("deactivate",t).close():t()},showDialog:function(t){for(var h,c,e=t.buttons,f=u.styles.popup,o=i.format('<div class="{0}"><div class="{1}"><p class="{2}">{3}<\/p><div class="{4}">',f.form,f.formContainer,f.message,t.text,f.buttonsContainer),s=0,l=e.length;s<l;s++)o+=this.createButton(e[s]);o+="<\/div><\/div><\/div>";h=this.element;this.popup&&this.popup.destroy();c=this.popup=n(o).appendTo(h).eq(0).on("click",r+f.button,function(t){t.preventDefault();c.close();var i=n(t.currentTarget).index();e[i].click()}).kendoWindow({modal:!0,resizable:!1,draggable:!1,title:t.title,visible:!1,close:function(){this.destroy();h.focus()}}).getKendoWindow();c.center().open()},_createPopupEditor:function(t){var s=this,l=this.options.messages,a=u.styles,v=a.popup,c=i.format('<div {0}="{1}" class="{2} {3}"><div class="{4}">',i.attr("uid"),t.uid,v.form,v.editForm,v.formContainer),w=this.fields(wt.desktop,t),y=[],o,p;if(c+=this._buildEditTemplate(t,w,y),c+='<div class="'+v.buttonsContainer+'">',c+=this.createButton({name:"update",text:l.save,className:u.styles.primary}),c+=this.createButton({name:"cancel",text:l.cancel}),c+=this.createButton({name:"delete",text:l.destroy}),c+="<\/div><\/div><\/div>",o=this.container=n(c).appendTo(this.element).eq(0).kendoWindow(e({modal:!0,resizable:!1,draggable:!0,title:l.editor.editorTitle,visible:!1,close:function(n){n.userTriggered&&s.trigger("cancel",{container:o,model:t})&&n.preventDefault()}},{})),p=o.kendoEditable({fields:y,model:t,clearContainer:!1,validateOnBlur:!0,target:s.options.target}).data("kendoEditable"),i.cycleForm(o),this.trigger("edit",{container:o,model:t}))s.trigger("cancel",{container:o,model:t});else{o.data("kendoWindow").center().open();o.on(h+f,r+a.buttonCancel,function(n){n.preventDefault();n.stopPropagation();s.trigger("cancel",{container:o,model:t})});o.on(h+f,r+a.buttonSave,function(n){var r,u,f,i,e;for(n.preventDefault(),n.stopPropagation(),r=s.fields(wt.desktop,t),u={},i=0,e=r.length;i<e;i++)f=r[i].field,u[f]=t.get(f);s.trigger("save",{container:o,model:t,updateInfo:u})});o.on(h+f,r+a.buttonDelete,function(n){n.preventDefault();n.stopPropagation();s.trigger("remove",{container:o,model:t})})}return p}}),yi=v.extend({init:function(n,t){v.fn.init.call(this,n,t);this.wrapper=this.element;this.model=this.options.model;this.resourcesField=this.options.resourcesField;this.createButton=this.options.createButton;this._initContainer();this._attachHandlers()},events:["save"],open:function(){this.window.center().open();this.grid.resize(!0)},close:function(){this.window.bind("deactivate",o(this.destroy,this)).close()},destroy:function(){this._dettachHandlers();this.grid.destroy();this.grid=null;this.window.destroy();this.window=null;v.fn.destroy.call(this);i.destroy(this.wrapper);this.element=this.wrapper=null},_attachHandlers:function(){var t=u.styles,e=this.grid,s=this._cancelProxy=o(this._cancel,this);this.container.on(h+f,r+t.buttonCancel,this._cancelProxy);this._saveProxy=o(this._save,this);this.container.on(h+f,r+t.buttonSave,this._saveProxy);this.window.bind("close",function(n){n.userTriggered&&s(n)});e.wrapper.on(h+f,"input[type='checkbox']",function(){var t=n(this),r=n(t).closest("tr"),u=e.dataSource.getByUid(r.attr(i.attr("uid"))),f=n(t).is(":checked")?1:"";u.set("value",f)})},_dettachHandlers:function(){this._cancelProxy=null;this._saveProxy=null;this.container.off(f);this.grid.wrapper.off()},_cancel:function(n){n.preventDefault();this.close()},_save:function(n){n.preventDefault();this._updateModel();this.wrapper.is(r+u.styles.popup.resourcesField)||this.trigger("save",{container:this.wrapper,model:this.model});this.close()},_initContainer:function(){var t=u.styles.popup,f=i.format('<div class="{0} {1}"><div class="{2} {3}"/><\/div>"',t.form,t.editForm,t.formContainer,t.resourcesFormContainer);f=n(f);this.container=f.find(r+t.resourcesFormContainer);this.window=f.kendoWindow({modal:!0,resizable:!1,draggable:!0,visible:!1,title:this.options.messages.resourcesEditorTitle}).data("kendoWindow");this._resourceGrid();this._createButtons()},_resourceGrid:function(){var r=this,t=this.options.messages,u=n('<div id="resources-grid"/>').appendTo(this.container);this.grid=new i.ui.Grid(u,{columns:[{field:"name",title:t.resourcesHeader,template:"<label><input type='checkbox' value='#=name#'# if (value > 0 && value !== null) {#checked='checked'# } #/>#=name#<\/labe>"},{field:"value",title:t.unitsHeader,template:function(n){var t=n.format,r=n.value!==null?n.value:"";return t?i.toString(r,t):r}}],height:280,sortable:!0,editable:!0,filterable:!0,dataSource:{data:r.options.data,schema:{model:{id:"id",fields:{id:{from:"id"},name:{from:"name",type:"string",editable:!1},value:{from:"value",type:"number",defaultValue:""},format:{from:"format",type:"string"}}}}},save:function(n){var t=!!n.values.value;n.container.parent().find("input[type='checkbox']").prop("checked",t)}})},_createButtons:function(){for(var i=this.options.buttons,n='<div class="'+u.styles.popup.buttonsContainer+'">',t=0,r=i.length;t<r;t++)n+=this.createButton(i[t]);n+="<\/div>";this.container.append(n)},_updateModel:function(){for(var r=[],t,i=this.grid.dataSource.data(),n=0,u=i.length;n<u;n++)t=i[n].get("value"),t!==null&&t>0&&r.push(i[n]);this.model[this.resourcesField]=r}}),u=v.extend({init:function(n,t){y(t)&&(t={dataSource:t});w={append:{text:"Add Task",action:"add",className:u.styles.toolbar.appendButton,iconClass:u.styles.toolbar.iconPlus},pdf:{text:"Export to PDF",className:u.styles.toolbar.pdfButton,iconClass:u.styles.toolbar.iconPdf}};v.fn.init.call(this,n,t);this._wrapper();this._resources();this._timeline();this._toolbar();this._footer();this._adjustDimensions();this._preventRefresh=!0;this.view(this.timeline._selectedViewName);this._preventRefresh=!1;this._dataSource();this._assignments();this._dropDowns();this._list();this._dependencies();this._resizable();this._scrollable();this._dataBind();this._attachEvents();this._createEditor();i.notify(this)},events:["dataBinding","dataBound","add","edit","remove","cancel","save","change","navigate","moveStart","move","moveEnd","resizeStart","resize","resizeEnd","columnResize"],options:{name:"Gantt",autoBind:!0,navigatable:!1,selectable:!0,editable:!0,resizable:!1,columnResizeHandleWidth:3,columns:[],views:[],dataSource:{},dependencies:{},resources:{},assignments:{},taskTemplate:null,messages:{save:"Save",cancel:"Cancel",destroy:"Delete",deleteTaskConfirmation:"Are you sure you want to delete this task?",deleteDependencyConfirmation:"Are you sure you want to delete this dependency?",deleteTaskWindowTitle:"Delete task",deleteDependencyWindowTitle:"Delete dependency",views:{day:"Day",week:"Week",month:"Month",year:"Year",start:"Start",end:"End"},actions:{append:"Add Task",addChild:"Add Child",insertBefore:"Add Above",insertAfter:"Add Below",pdf:"Export to PDF"},editor:{editorTitle:"Task",resourcesEditorTitle:"Resources",title:"Title",start:"Start",end:"End",percentComplete:"Complete",resources:"Resources",assignButton:"Assign",resourcesHeader:"Resources",unitsHeader:"Units"}},showWorkHours:!0,showWorkDays:!0,toolbar:null,workDayStart:new Date(1980,1,1,8,0,0),workDayEnd:new Date(1980,1,1,17,0,0),workWeekStart:1,workWeekEnd:5,hourSpan:1,snap:!0,height:600,listWidth:"30%",rowHeight:null},select:function(n){var t=this.list;if(!n)return t.select();t.select(n);return},clearSelection:function(){this.list.clearSelection()},destroy:function(){v.fn.destroy.call(this);this.dataSource&&(this.dataSource.unbind("change",this._refreshHandler),this.dataSource.unbind("progress",this._progressHandler),this.dataSource.unbind("error",this._errorHandler));this.dependencies&&(this.dependencies.unbind("change",this._dependencyRefreshHandler),this.dependencies.unbind("error",this._dependencyErrorHandler));this.timeline&&(this.timeline.unbind(),this.timeline.destroy());this.list&&(this.list.unbind(),this.list.destroy());this.footerDropDown&&this.footerDropDown.destroy();this.headerDropDown&&this.headerDropDown.destroy();this._editor&&this._editor.destroy();this._resizeDraggable&&this._resizeDraggable.destroy();this.toolbar.off(f);et&&(this._mediaQuery.removeListener(this._mediaQueryHandler),this._mediaQuery=null);n(window).off("resize"+f,this._resizeHandler);n(this.wrapper).off(f);this.toolbar=null;this.footer=null},_attachEvents:function(){this._resizeHandler=o(this.resize,this,!1);n(window).on("resize"+f,this._resizeHandler)},_wrapper:function(){var n=u.styles,e=[n.icon,n.resizeHandle].join(" "),t=this.options,i=t.height,f=t.width;this.wrapper=this.element.addClass(n.wrapper).append("<div class='"+n.listWrapper+"'><div><\/div><\/div>").append("<div class='"+n.splitBarWrapper+"'><div class='"+e+"'><\/div><\/div>").append("<div class='"+n.timelineWrapper+"'><div><\/div><\/div>");this.wrapper.find(r+n.list).width(t.listWidth);i&&this.wrapper.height(i);f&&this.wrapper.width(f);t.rowHeight&&this.wrapper.addClass(n.rowHeight)},_toolbar:function(){var e=this,t=u.styles,k=r+t.toolbar.views+" > li",d=r+t.toolbar.pdfButton,g=r+t.buttonToggle,y=r+t.gridContent,c=n(r+t.list),l=n(r+t.timeline),p=t.hovered,s=this.options.toolbar,w=n("<div class='"+t.toolbar.actions+"'>"),v,a,b,nt=function(n){n.matches?c.css({display:"none","max-width":0}):(c.css({display:"inline-block",width:"30%","max-width":"none"}),l.css("display","inline-block"),e.refresh(),l.find(y).scrollTop(e.scrollTop));e._resize()};gt(s)||(s=typeof s===rt?s:this._actions(s),s=o(i.template(s),this));b=n(ii({styles:t.toolbar}));a=n(fi({ns:i.ns,views:this.timeline.views,styles:t.toolbar}));w.append(s({}));v=n("<div class='"+t.toolbar.headerWrapper+"'>").append(b).append(a).append(w);a.find("li").length>1&&a.prepend(ui({styles:t.toolbar}));this.wrapper.prepend(v);this.toolbar=v;et&&(this._mediaQueryHandler=o(nt,this),this._mediaQuery=window.matchMedia("(max-width: 480px)"),this._mediaQuery.addListener(this._mediaQueryHandler));v.on(h+f,k,function(u){u.preventDefault();var f=e.list,o=n(this).attr(i.attr("name")),s=a.find(r+t.toolbar.currentView);(s.is(":visible")&&s.parent().toggleClass(t.toolbar.expanded),f.editable&&f.editable.trigger("validate"))||e.trigger("navigate",{view:o})||e.view(o)}).on(h+f,d,function(n){n.preventDefault();e.saveAsPDF()}).on(h+f,g,function(n){n.preventDefault();c.is(":visible")?(c.css({display:"none",width:"0"}),l.css({display:"inline-block",width:"100%"}),e.refresh(),l.find(y).scrollTop(e.scrollTop)):(l.css({display:"none",width:0}),c.css({display:"inline-block",width:"100%","max-width":"none"}).find(y).scrollTop(e.scrollTop));e._resize()});this.wrapper.find(r+t.toolbar.toolbar+" li").hover(function(){n(this).addClass(p)},function(){n(this).removeClass(p)})},_actions:function(){var r=this.options,n=r.toolbar,i="",t,u;if(!y(n))if(r.editable)n=["append"];else return i;for(t=0,u=n.length;t<u;t++)i+=this._createButton(n[t]);return i},_footer:function(){if(this.options.editable){var t=u.styles.toolbar,f=this.options.messages.actions,o=n(i.template(at)(e(!0,{styles:t},w.append,{text:f.append}))),s=n("<div class='"+t.actions+"'>").append(o),r=n("<div class='"+t.footerWrapper+"'>").append(s);this.wrapper.append(r);this.footer=r}},_createButton:function(n){var f=n.template||at,o=this.options.messages.actions,t=typeof n===rt?n:n.name||n.text,s=w[t]?w[t].className:"k-gantt-"+(t||"").replace(/\s/g,""),r={iconClass:"",action:"",text:t,className:s,styles:u.styles.toolbar};if(!t&&!(p(n)&&n.template))throw new Error("Custom commands should have name specified");return r=e(!0,r,w[t],{text:o[t]}),p(n)&&(n.className&&dt(r.className,n.className.split(" "))<0&&(n.className+=" "+r.className),r=e(!0,r,n)),i.template(f)(r)},_adjustDimensions:function(){var n=this.element,t=u.styles,i=r+t.list,o=r+t.timeline,s=r+t.splitBar,c=this.toolbar.outerHeight(),l=this.footer?this.footer.outerHeight():0,a=n.height(),f=n.width(),e=n.find(s).outerWidth(),h=n.find(i).outerWidth();n.children([i,o,s].join(",")).height(a-(c+l)).end().children(o).width(f-(e+h));f<h+e&&n.find(i).width(f-e)},_scrollTo:function(n){var r=this.timeline.view(),e=this.list,o=i.attr("uid"),f=typeof n=="string"?n:n.closest("tr"+l()).attr(o),u,t,s=function(){t.length!==0&&u()};r.content.is(":visible")?(t=r.content.find(l(f)),u=function(){r._scrollTo(t)}):(t=e.content.find(l(f)),u=function(){t.get(0).scrollIntoView()});s()},_dropDowns:function(){var n=this,t=r+u.styles.toolbar.actions,i=this.options.messages.actions,e=this.timeline,f=function(t){var f=t.type,r,s=n.dataSource,i=s._createNewModel(),o=n.dataItem(n.select()),l=s.taskParent(o),h=e.view()._timeSlots()[0],u=f==="add"?o:l,c=n.list.editable;c&&c.trigger("validate")||(i.set("title","New task"),u?(i.set("parentId",u.get("id")),i.set("start",u.get("start")),i.set("end",u.get("end"))):(i.set("start",h.start),i.set("end",h.end)),f!=="add"&&(r=o.get("orderId"),r=f==="insert-before"?r:r+1),n._createTask(i,r))};this.options.editable&&(this.footerDropDown=new yt(this.footer.children(t).eq(0),{messages:{actions:i},direction:"up",animation:{open:{effects:"slideIn:up"}},navigatable:n.options.navigatable}),this.headerDropDown=new yt(this.toolbar.children(t).eq(0),{messages:{actions:i},navigatable:n.options.navigatable}),this.footerDropDown.bind("command",f),this.headerDropDown.bind("command",f))},_list:function(){for(var n=this,v=n.options.navigatable,e=u.styles,s=this.wrapper.find(r+e.list),y=s.find("> div"),h=this.wrapper.find(r+e.toolbar.actions+" > button"),c={columns:this.options.columns||[],dataSource:this.dataSource,selectable:this.options.selectable,editable:this.options.editable,resizable:this.options.resizable,columnResizeHandleWidth:this.options.columnResizeHandleWidth,listWidth:s.outerWidth(),resourcesField:this.resources.field,rowHeight:this.options.rowHeight},l=c.columns,t,a=function(){v&&(n._current(n._cachedCurrent),g(n.list.content.find("table"),!0));delete n._cachedCurrent},f=0;f<l.length;f++)t=l[f],t.field===this.resources.field&&typeof t.editor!="function"&&(t.editor=o(this._createResourceEditor,this));this.list=new i.ui.GanttList(y,c);this.list.bind("render",function(){n._navigatable()},!0).bind("edit",function(t){n._cachedCurrent=t.cell;n.trigger("edit",{task:t.model,container:t.cell})&&t.preventDefault()}).bind("cancel",function(t){n.trigger("cancel",{task:t.model,container:t.cell})&&t.preventDefault();a()}).bind("update",function(t){n._updateTask(t.task,t.updateInfo);a()}).bind("change",function(){n.trigger("change");var t=n.list.select();t.length?(h.removeAttr("data-action","add"),n.timeline.select("[data-uid='"+t.attr("data-uid")+"']")):(h.attr("data-action","add"),n.timeline.clearSelection())}).bind("columnResize",function(t){n.trigger("columnResize",{column:t.column,oldWidth:t.oldWidth,newWidth:t.newWidth})})},_timeline:function(){var n=this,t=u.styles,f=hi(e(!0,{resourcesField:this.resources.field},this.options)),o=this.wrapper.find(r+t.timeline+" > div"),s=r+t.toolbar.currentView+" > "+r+t.toolbar.link;this.timeline=new i.ui.GanttTimeline(o,f);this.timeline.bind("navigate",function(i){var u=i.view.replace(/\./g,"\\.").toLowerCase(),f=n.toolbar.find(r+t.toolbar.views+" > li").removeClass(t.selected).end().find(r+t.toolbar.viewButton+"-"+u).addClass(t.selected).find(r+t.toolbar.link).text();n.toolbar.find(s).text(f);n.refresh()}).bind("moveStart",function(t){var i=n.list.editable;if(i&&i.trigger("validate")){t.preventDefault();return}n.trigger("moveStart",{task:t.task})&&t.preventDefault()}).bind("move",function(t){var i=t.task,r=t.start,u=new Date(r.getTime()+i.duration());n.trigger("move",{task:i,start:r,end:u})&&t.preventDefault()}).bind("moveEnd",function(t){var i=t.task,r=t.start,u=new Date(r.getTime()+i.duration());n.trigger("moveEnd",{task:i,start:r,end:u})||n._updateTask(n.dataSource.getByUid(i.uid),{start:r,end:u})}).bind("resizeStart",function(t){var i=n.list.editable;if(i&&i.trigger("validate")){t.preventDefault();return}n.trigger("resizeStart",{task:t.task})&&t.preventDefault()}).bind("resize",function(t){n.trigger("resize",{task:t.task,start:t.start,end:t.end})&&t.preventDefault()}).bind("resizeEnd",function(t){var r=t.task,i={};t.resizeStart?i.start=t.start:i.end=t.end;n.trigger("resizeEnd",{task:r,start:t.start,end:t.end})||n._updateTask(n.dataSource.getByUid(r.uid),i)}).bind("percentResizeStart",function(t){var i=n.list.editable;i&&i.trigger("validate")&&t.preventDefault()}).bind("percentResizeEnd",function(t){n._updateTask(n.dataSource.getByUid(t.task.uid),{percentComplete:t.percentComplete})}).bind("dependencyDragStart",function(t){var i=n.list.editable;i&&i.trigger("validate")&&t.preventDefault()}).bind("dependencyDragEnd",function(t){var i=n.dependencies._createNewModel({type:t.type,predecessorId:t.predecessor.id,successorId:t.successor.id});n._createDependency(i)}).bind("select",function(t){var i=n.list.editable;i&&i.trigger("validate");n.select("[data-uid='"+t.uid+"']")}).bind("editTask",function(t){var i=n.list.editable;i&&i.trigger("validate")||n.editTask(t.uid)}).bind("clear",function(){n.clearSelection()}).bind("removeTask",function(t){var i=n.list.editable;i&&i.trigger("validate")||n.removeTask(n.dataSource.getByUid(t.uid))}).bind("removeDependency",function(t){var i=n.list.editable;i&&i.trigger("validate")||n.removeDependency(n.dependencies.getByUid(t.uid))})},_dataSource:function(){var t=this.options,n=t.dataSource;n=y(n)?{data:n}:n;this.dataSource&&this._refreshHandler?this.dataSource.unbind("change",this._refreshHandler).unbind("progress",this._progressHandler).unbind("error",this._errorHandler):(this._refreshHandler=o(this.refresh,this),this._progressHandler=o(this._requestStart,this),this._errorHandler=o(this._error,this));this.dataSource=i.data.GanttDataSource.create(n).bind("change",this._refreshHandler).bind("progress",this._progressHandler).bind("error",this._errorHandler)},_dependencies:function(){var n=this.options.dependencies||{},t=y(n)?{data:n}:n;this.dependencies&&this._dependencyRefreshHandler?this.dependencies.unbind("change",this._dependencyRefreshHandler).unbind("error",this._dependencyErrorHandler):(this._dependencyRefreshHandler=o(this.refreshDependencies,this),this._dependencyErrorHandler=o(this._error,this));this.dependencies=i.data.GanttDependencyDataSource.create(t).bind("change",this._dependencyRefreshHandler).bind("error",this._dependencyErrorHandler)},_resources:function(){var n=this.options.resources,t=n.dataSource||{};this.resources={field:"resources",dataTextField:"name",dataColorField:"color",dataFormatField:"format"};e(this.resources,n);this.resources.dataSource=i.data.DataSource.create(t)},_assignments:function(){var n=this.options.assignments,t=n.dataSource||{};this.assignments?this.assignments.dataSource.unbind("change",this._assignmentsRefreshHandler):this._assignmentsRefreshHandler=o(this.refresh,this);this.assignments={dataTaskIdField:"taskId",dataResourceIdField:"resourceId",dataValueField:"value"};e(this.assignments,n);this.assignments.dataSource=i.data.DataSource.create(t);this.assignments.dataSource.bind("change",this._assignmentsRefreshHandler)},_createEditor:function(){var n=this,t=this._editor=new vi(this.wrapper,e({},this.options,{target:this,resources:{field:this.resources.field,editor:o(this._createResourceEditor,this)},createButton:o(this._createPopupButton,this)}));t.bind("cancel",function(t){var i=n.dataSource.getByUid(t.model.uid);if(n.trigger("cancel",{container:t.container,task:i})){t.preventDefault();return}n.cancelTask()}).bind("edit",function(t){var i=n.dataSource.getByUid(t.model.uid);n.trigger("edit",{container:t.container,task:i})&&t.preventDefault()}).bind("save",function(t){var i=n.dataSource.getByUid(t.model.uid);n.saveTask(i,t.updateInfo)}).bind("remove",function(t){n.removeTask(t.model.uid)})},_createResourceEditor:function(n,t){var r=this,f=t instanceof ht?t:t.model,h=f.get("id"),i=this.options.messages,s=r.resources.field,c=this._resourceEditor=new yi(n,{resourcesField:s,data:this._wrapResourceData(h),model:f,messages:e({},i.editor),buttons:[{name:"update",text:i.save,className:u.styles.primary},{name:"cancel",text:i.cancel}],createButton:o(this._createPopupButton,this),save:function(n){r._updateAssignments(n.model.get("id"),n.model.get(s))}});c.open()},_createPopupButton:function(n){var r=n.name||n.text,t={className:u.styles.popup.button+" k-gantt-"+(r||"").replace(/\s/g,""),text:r,attr:""};if(!r&&!(p(n)&&n.template))throw new Error("Custom commands should have name specified");return p(n)&&(n.className&&(n.className+=" "+t.className),t=e(!0,t,n)),i.template(ri)(t)},view:function(n){return this.timeline.view(n)},dataItem:function(n){if(!n)return null;var t=this.list,i=t.content.find(n);return t._modelFromElement(i)},setDataSource:function(n){this.options.dataSource=n;this._dataSource();this.list._setDataSource(this.dataSource);this.options.autoBind&&n.fetch()},setDependenciesDataSource:function(n){this.options.dependencies=n;this._dependencies();this.options.autoBind&&n.fetch()},items:function(){return this.wrapper.children(".k-task")},_updateAssignments:function(n,t){for(var s=this.assignments.dataSource,v=this.assignments.dataTaskIdField,y=this.assignments.dataResourceIdField,e=!1,o=new c(s.view()).filter({field:v,operator:"eq",value:n}).toArray(),r,u,h,i,l,f,a;o.length;){for(r=o[0],i=0,l=t.length;i<l;i++)if(u=t[i],r.get(y)===u.get("id")){h=t[i].get("value");this._updateAssignment(r,h);t.splice(i,1);e=!0;break}e||this._removeAssignment(r);e=!1;o.shift()}for(f=0,a=t.length;f<a;f++)u=t[f],this._createAssignment(u,n);s.sync()},cancelTask:function(){var n=this._editor,t=n.container;t&&n.close()},editTask:function(n){var t=typeof n=="string"?this.dataSource.getByUid(n):n,i;t&&(i=this.dataSource._createNewModel(t.toJSON()),i.uid=t.uid,this.cancelTask(),this._editTask(i))},_editTask:function(n){this._editor.editTask(n)},saveTask:function(n,t){var i=this._editor,u=i.container,r=i.editable;u&&r&&r.end()&&this._updateTask(n,t)},_updateTask:function(n,t){var i=this.resources.field;this.trigger("save",{task:n,values:t})||(this._preventRefresh=!0,this.dataSource.update(n,t),t[i]&&this._updateAssignments(n.get("id"),t[i]),this._syncDataSource())},_updateAssignment:function(n,t){var i=this.assignments.dataValueField;n.set(i,t)},removeTask:function(n){var i=this,t=typeof n=="string"?this.dataSource.getByUid(n):n;t&&this._taskConfirm(function(n){n||i._removeTask(t)},t)},_createTask:function(n,i){if(!this.trigger("add",{task:n,dependency:null})){var r=this.dataSource;this._preventRefresh=!0;i===t?r.add(n):r.insert(i,n);this._scrollToUid=n.uid;this._syncDataSource()}},_createDependency:function(n){this.trigger("add",{task:null,dependency:n})||(this._preventDependencyRefresh=!0,this.dependencies.add(n),this._preventDependencyRefresh=!1,this.dependencies.sync())},_createAssignment:function(n,t){var i=this.assignments,u=i.dataSource,f=i.dataTaskIdField,e=i.dataResourceIdField,o=i.dataValueField,r=u._createNewModel();r[f]=t;r[e]=n.get("id");r[o]=n.get("value");u.add(r)},removeDependency:function(n){var i=this,t=typeof n=="string"?this.dependencies.getByUid(n):n;t&&this._dependencyConfirm(function(n){n||i._removeDependency(t)},t)},_removeTaskDependencies:function(n,t){this._preventDependencyRefresh=!0;for(var i=0,r=t.length;i<r;i++)this.dependencies.remove(t[i]);this._preventDependencyRefresh=!1;this.dependencies.sync()},_removeTaskAssignments:function(n){var r=this.assignments.dataSource,t=r.view(),f={field:this.assignments.dataTaskIdField,operator:"eq",value:n.get("id")},i,u;for(t=new c(t).filter(f).toArray(),this._preventRefresh=!0,i=0,u=t.length;i<u;i++)r.remove(t[i]);this._preventRefresh=!1;r.sync()},_removeTask:function(n){var t=this.dependencies.dependencies(n.id);this.trigger("remove",{task:n,dependencies:t})||(this._removeTaskDependencies(n,t),this._removeTaskAssignments(n),this._preventRefresh=!0,this.dataSource.remove(n)&&this._syncDataSource(),this._preventRefresh=!1)},_removeDependency:function(n){this.trigger("remove",{task:null,dependencies:[n]})||this.dependencies.remove(n)&&this.dependencies.sync()},_removeAssignment:function(n){this.assignments.dataSource.remove(n)},_taskConfirm:function(n,t){var i=this.options.messages;this._confirm(n,{model:t,text:i.deleteTaskConfirmation,title:i.deleteTaskWindowTitle})},_dependencyConfirm:function(n,t){var i=this.options.messages;this._confirm(n,{model:t,text:i.deleteDependencyConfirmation,title:i.deleteDependencyWindowTitle})},_confirm:function(n,t){var r=this.options.editable,i,f;r===!0||r.confirmation!==!1?(i=this.options.messages,f=[{name:"delete",text:i.destroy,className:u.styles.primary,click:function(){n()}},{name:"cancel",text:i.cancel,click:function(){n(!0)}}],this.showDialog(e(!0,{},t,{buttons:f}))):n()},showDialog:function(n){this._editor.showDialog(n)},refresh:function(){if(!this._preventRefresh&&!this.list.editable){this._progress(!1);var e=this.dataSource,t=e.taskTree(),n=this._scrollToUid,f,r,u=-1;(this.current&&(r=this.current.closest("tr").attr(i.attr("uid")),u=this.current.index()),this.trigger("dataBinding"))||(this.resources.dataSource.data().length!==0&&this._assignResources(t),this._editor&&this._editor.close(),this.clearSelection(),this.list._render(t),this.timeline._render(t),this.timeline._renderDependencies(this.dependencies.view()),n&&(this._scrollTo(n),this.select(l(n))),(n||r)&&u>=0&&(f=this.list.content.find("tr"+l(n||r)+" > td:eq("+u+")"),this._current(f)),this._scrollToUid=null,this.trigger("dataBound"))}},refreshDependencies:function(){this._preventDependencyRefresh||this.trigger("dataBinding")||(this.timeline._renderDependencies(this.dependencies.view()),this.trigger("dataBound"))},_assignResources:function(n){for(var t=this.resources,r=this.assignments,e=function(){var n=r.dataSource.view(),t={field:r.dataTaskIdField};return new c(n).group(t).toArray()},u=e(),o=function(n,r){var o=n.get("id"),f,e;for(i.setter(t.field)(n,new kt([])),f=0,e=u.length;f<e;f++)u[f].value===o&&r(n,u[f].items)},s=function(n,u){for(var f=0,s=u.length;f<s;f++){var e=u[f],o=t.dataSource.get(e.get(r.dataResourceIdField)),h=e.get(r.dataValueField),c=e.get(r.dataResourceIdField),l=o.get(t.dataFormatField)||tt,a=i.toString(h,l);n[t.field].push(new ht({id:c,name:o.get(t.dataTextField),color:o.get(t.dataColorField),value:h,formatedValue:a}))}},f=0,h=n.length;f<h;f++)o(n[f],s)},_wrapResourceData:function(n){for(var t=this,u=[],i,f=this.resources.dataSource.view(),e=this.assignments.dataSource.view(),o=new c(e).filter({field:t.assignments.dataTaskIdField,operator:"eq",value:n}).toArray(),s=function(n){var i=null;return new c(o).filter({field:t.assignments.dataResourceIdField,operator:"eq",value:n}).select(function(n){i+=n.get(t.assignments.dataValueField)}),i},r=0,h=f.length;r<h;r++)i=f[r],u.push({id:i.get("id"),name:i.get(t.resources.dataTextField),format:i.get(t.resources.dataFormatField)||tt,value:s(i.id)});return u},_syncDataSource:function(){this._preventRefresh=!1;this._requestStart();this.dataSource.sync()},_requestStart:function(){this._progress(!0)},_error:function(){this._progress(!1)},_progress:function(n){i.ui.progress(this.element,n)},_resizable:function(){var a=this,f=this.wrapper,t=u.styles,c=r+t.gridContent,o=f.find(r+t.list),e=f.find(r+t.timeline),s,h,l;this._resizeDraggable=f.find(r+t.splitBar).height(o.height()).hover(function(){n(this).addClass(t.splitBarHover)},function(){n(this).removeClass(t.splitBarHover)}).end().kendoResizable({orientation:"horizontal",handle:r+t.splitBar,start:function(){s=o.width();h=e.width();l=e.find(c).scrollLeft()},resize:function(n){var t=n.x.initialDelta;(i.support.isRtl(f)&&(t*=-1),s+t<0||h-t<0)||(o.width(s+t),e.width(h-t),e.find(c).scrollLeft(l+t),a.timeline.view()._renderCurrentTime())}}).data("kendoResizable")},_scrollable:function(){var o=this,s=u.styles,h=r+s.gridContent,c=r+s.gridHeaderWrap,l=this.timeline.element.find(c),t=this.timeline.element.find(h),a=this.list.element.find(c),e=this.list.element.find(h);bt&&e.css("overflow-y","auto");t.on("scroll",function(){o.scrollTop=this.scrollTop;l.scrollLeft(this.scrollLeft);e.scrollTop(this.scrollTop)});e.on("scroll",function(){o.scrollTop=this.scrollTop;a.scrollLeft(this.scrollLeft);t.scrollTop(this.scrollTop)}).on("DOMMouseScroll"+f+" mousewheel"+f,function(r){var e=t.scrollTop(),u=i.wheelDeltaY(r);if(u){r.preventDefault();n(r.currentTarget).one("wheel"+f,!1);t.scrollTop(e+-u)}})},_navigatable:function(){var t=this,c=this.options.navigatable,rt=this.options.editable,a=this.list.header.find("table"),e=this.list.content.find("table"),v=u.styles,o=i.support.isRtl(this.wrapper),y=this.timeline.element.find(r+v.gridContent),ut=a.add(e),p=l(),w,h={collapse:!1,expand:!0},b=function(n){var i=t.timeline.view()._timeSlots()[0].offsetWidth;y.scrollLeft(y.scrollLeft()+(n?-i:i))},k=function(n){var r=t.current.parent("tr"+l()),u=t.current.index(),i=r[n]();t.select().length!==0&&t.clearSelection();i.length!==0?(t._current(i.children("td:eq("+u+")")),t._scrollTo(t.current)):t.current.is("td")&&n=="prev"?g(a):t.current.is("th")&&n=="next"&&g(e)},d=function(n){var i=t.current[n]();i.length!==0&&(t._current(i),w=t.current.index())},nt=function(n){var i=t.dataItem(t.current);i.summary&&i.expanded!==n&&i.set("expanded",n)},tt=function(){if(t.options.editable&&!t.list.editable){var n=t.select(),r=i.attr("uid");n.length&&t.removeTask(n.attr(r))}};n(this.wrapper).on("mousedown"+f,"tr"+p+", div"+p+":not("+r+v.line+")",function(r){var u=n(r.currentTarget),e=n(r.target).is(":button,a,:input,a>.k-icon,textarea,span.k-icon,span.k-link,.k-input,.k-multiselect-wrap"),f;r.ctrlKey||(c&&(f=u.is("tr")?n(r.target).closest("td"):t.list.content.find("tr"+l(u.attr(i.attr("uid")))+" > td:first"),t._current(f)),(c||rt)&&!e&&(t._focusTimeout=setTimeout(function(){g(t.list.content.find("table"),!0)},2)))});if(c!==!0){e.on("keydown"+f,function(n){n.keyCode==s.DELETE&&tt()});return}ut.on("focus"+f,function(){var r=this===e.get(0)?"td":"th",i=t.select(),u=t.current||n(i.length?i:this).find(r+":eq("+(w||0)+")");t._current(u)}).on("blur"+f,function(){t._current();this==a&&n(this).attr(it,-1)}).on("keydown"+f,function(i){var r=i.keyCode,u;if(t.current){u=t.current.is("td");switch(r){case s.RIGHT:i.preventDefault();i.altKey?b():i.ctrlKey?nt(o?h.collapse:h.expand):d(o?"prev":"next");break;case s.LEFT:i.preventDefault();i.altKey?b(!0):i.ctrlKey?nt(o?h.expand:h.collapse):d(o?"next":"prev");break;case s.UP:i.preventDefault();k("prev");break;case s.DOWN:i.preventDefault();k("next");break;case s.SPACEBAR:i.preventDefault();u&&t.select(t.current.closest("tr"));break;case s.ENTER:if(i.preventDefault(),u){if(t.options.editable){t._cachedCurrent=t.current;t.list._startEditHandler(t.current);n(this).one("keyup",function(n){n.stopPropagation()})}}else t.current.children("a.k-link").click();break;case s.ESC:i.stopPropagation();break;case s.DELETE:u&&tt();break;default:r>=49&&r<=57&&t.view(t.timeline._viewByIndex(r-49))}}})},_current:function(t){var f=u.styles,r;this.current&&this.current.length&&this.current.removeClass(f.focused).removeAttr("id");t&&t.length?(this.current=t.addClass(f.focused).attr("id",lt),r=n(i._activeElement()),r.is("table")&&this.wrapper.find(r).length>0&&r.removeAttr(k).attr(k,lt)):this.current=null},_dataBind:function(){var t=this,i;t.options.autoBind&&(this._preventRefresh=!0,this._preventDependencyRefresh=!0,i=n.map([this.dataSource,this.dependencies,this.resources.dataSource,this.assignments.dataSource],function(n){return n.fetch()}),n.when.apply(null,i).done(function(){t._preventRefresh=!1;t._preventDependencyRefresh=!1;t.refresh()}))},_resize:function(){this._adjustDimensions();this.timeline.view()._adjustHeight();this.timeline.view()._renderCurrentTime();this.list._adjustHeight()}});i.PDFMixin&&(i.PDFMixin.extend(u.fn),u.fn._drawPDF=function(){var n="."+vt.list,i=this.wrapper.find(n).width(),t=this.wrapper.clone();return t.find(n).css("width",i),this._drawPDFShadow({content:t},{avoidLinks:this.options.pdf.avoidLinks})});i.ui.plugin(u);e(!0,u,{styles:vt})})(window.kendo.jQuery)}(),function(){(function(n,t){function d(n){return function(t){return t[n]}}function vi(n){return function(t){return!n(t)}}function ki(){return this.style.display!=="none"}function di(i){var u=i.find(">tr:not(.k-filter-row)"),e=function(){var t=n(this);return!t.hasClass("k-group-cell")&&!t.hasClass("k-hierarchy-cell")},r=n(),f;return u.length>1&&(r=u.find("th").filter(e).filter(function(){return this.rowSpan>1})),r=r.add(u.last().find("th").filter(e)),f=kendo.attr("index"),r.sort(function(i,r){i=n(i);r=n(r);var u=i.attr(f),e=r.attr(f);return u===t&&(u=n(i).index()),e===t&&(e=n(r).index()),u=parseInt(u,10),e=parseInt(e,10),u>e?1:u<e?-1:0}),r}function yi(n){for(var t=[],r=n.className,i=0,u=n.level;i<u;i++)t.push(o("span",{className:r}));return t}function pi(n){for(var t,r=0,i=0,u=n.length;i<u;i++)t=n[i].style.width,t&&t.indexOf("%")==-1&&(r+=parseInt(t,10));return r}function gi(n,t){if(n=n[0],t=t[0],n.rows.length!==t.rows.length){var r=n.offsetHeight,u=t.offsetHeight,i,f;r>u?(i=t.rows[t.rows.length-1],f=r-u):(i=n.rows[n.rows.length-1],f=u-r);i.style.height=i.offsetHeight+f+"px"}}var nt=kendo.data,u=n.extend,e=kendo.dom,o=e.element,ft=e.text,v=e.html,y=kendo.ui,et=y.DataBoundWidget,l=nt.DataSource,vt=nt.ObservableArray,k=nt.Query,a=nt.Model,i=n.proxy,ot=n.map,s=n.grep,st=n.inArray,yt=n.isPlainObject,pt=Array.prototype.push,wt="string",p="change",ht="error",ct="progress",h=".",f=".kendoTreeList",tt="click",wi="mousedown",bt="edit",it="save",kt="expand",dt="collapse",gt="remove",ni="dataBinding",ti="dataBound",rt="cancel",ii="filterMenuInit",ri="columnHide",ui="columnShow",bi="th.k-header",fi="columnReorder",lt="columnResize",ei="columnMenuInit",oi="columnLock",si="columnUnlock",w="parentId",hi="dragstart",ci="drag",li="drop",ai="dragend",r={wrapper:"k-treelist k-grid k-widget",header:"k-header",button:"k-button",alt:"k-alt",editCell:"k-edit-cell",group:"k-treelist-group",gridToolbar:"k-grid-toolbar",gridHeader:"k-grid-header",gridHeaderWrap:"k-grid-header-wrap",gridContent:"k-grid-content",gridContentWrap:"k-grid-content",gridFilter:"k-grid-filter",footerTemplate:"k-footer-template",loading:"k-loading",refresh:"k-i-refresh",retry:"k-request-retry",selected:"k-state-selected",status:"k-status",link:"k-link",withIcon:"k-with-icon",filterable:"k-filterable",icon:"k-icon",iconFilter:"k-filter",iconCollapse:"k-i-collapse",iconExpand:"k-i-expand",iconHidden:"k-i-none",iconPlaceHolder:"k-icon k-i-none",input:"k-input",dropPositions:"k-insert-top k-insert-bottom k-add k-insert-middle",dropTop:"k-insert-top",dropBottom:"k-insert-bottom",dropAdd:"k-add",dropMiddle:"k-insert-middle",dropDenied:"k-denied",dragStatus:"k-drag-status",dragClue:"k-drag-clue",dragClueText:"k-clue-text"},at={create:{imageClass:"k-add",className:"k-grid-add",methodName:"addRow"},createchild:{imageClass:"k-add",className:"k-grid-add",methodName:"addRow"},destroy:{imageClass:"k-delete",className:"k-grid-delete",methodName:"removeRow"},edit:{imageClass:"k-edit",className:"k-grid-edit",methodName:"editRow"},update:{imageClass:"k-update",className:"k-primary k-grid-update",methodName:"saveRow"},canceledit:{imageClass:"k-cancel",className:"k-grid-cancel",methodName:"_cancelEdit"},excel:{imageClass:"k-i-excel",className:"k-grid-excel",methodName:"saveAsExcel"},pdf:{imageClass:"k-i-pdf",className:"k-grid-pdf",methodName:"saveAsPDF"}},c=a.define({id:"id",parentId:w,fields:{id:{type:"number"},parentId:{type:"number",nullable:!0}},init:function(n){a.fn.init.call(this,n);this._loaded=!1;this.parentIdField||(this.parentIdField=w);this.parentId=this.get(this.parentIdField)},accept:function(n){a.fn.accept.call(this,n);this.parentId=this.get(this.parentIdField)},set:function(n,t,i){n==w&&this.parentIdField!=w&&(this[this.parentIdField]=t);a.fn.set.call(this,n,t,i);n==this.parentIdField&&(this.parentId=this.get(this.parentIdField))},loaded:function(n){if(n!==t)this._loaded=n;else return this._loaded},shouldSerialize:function(n){return a.fn.shouldSerialize.call(this,n)&&n!=="_loaded"&&n!="_error"&&n!="_edit"&&!(this.parentIdField!=="parentId"&&n==="parentId")}}),b;c.parentIdField=w;c.define=function(n,i){var r,u;return i===t&&(i=n,n=c),r=i.parentId||w,i.parentIdField=r,u=a.define(n,i),r&&(u.parentIdField=r),u};b=l.extend({init:function(n){l.fn.init.call(this,u(!0,{},{schema:{modelBase:c,model:c}},n))},_createNewModel:function(n){var t={},i=n instanceof a;return i&&(t=n),t=l.fn._createNewModel.call(this,t),i||(n.parentId&&(n[t.parentIdField]=n.parentId),t.accept(n)),t},_shouldWrap:function(){return!0},_readData:function(n){var t=this.data();return(n=l.fn._readData.call(this,n),this._concat(n,t),n instanceof vt)?n:t},_concat:function(n,t){for(var r=t.length,i=0;i<n.length;i++)t[r++]=n[i];t.length=r},_readAggregates:function(n){var t=u(this._aggregateResult,this.reader.aggregates(n));return""in t&&(t[this._defaultParentId()]=t[""],delete t[""]),t},remove:function(n){var t=this._subtree(this._childrenMap(this.data()),n.id);this._removeItems(t);l.fn.remove.call(this,n)},_filterCallback:function(n){for(var t,r={},u=[],f=n.toArray(),i=0;i<f.length;i++)for(t=f[i];t;)if(r[t.id]||(r[t.id]=!0,u.push(t)),r[t.parentId])break;else r[t.parentId]=!0,t=this.parentNode(t),t&&u.push(t);return new k(u)},_subtree:function(n,t){for(var i=n[t]||[],u=this._defaultParentId(),r=0,f=i.length;r<f;r++)i[r].id!==u&&(i=i.concat(this._subtree(n,i[r].id)));return i},_childrenMap:function(n){var t={},i,r,f,u;for(n=this._observeView(n),i=0;i<n.length;i++)r=n[i],f=r.id,u=r.parentId,t[f]=t[f]||[],t[u]=t[u]||[],t[u].push(r);return t},_calculateAggregates:function(n,t){var r,f,s,u,e,o;for(t=t||{},r={},e=t.filter,e&&(n=k.process(n,{filter:e,filterCallback:i(this._filterCallback,this)}).data),o=this._childrenMap(n),r[this._defaultParentId()]=new k(this._subtree(o,this._defaultParentId())).aggregate(t.aggregate),u=0;u<n.length;u++)f=n[u],s=this._subtree(o,f.id),r[f.id]=new k(s).aggregate(t.aggregate);return r},_queryProcess:function(n,t){t=t||{};t.filterCallback=i(this._filterCallback,this);var s=this._defaultParentId(),o=k.process(n,t),h=this._childrenMap(o.data),f,u,r,e;for(n=h[s]||[],u=0;u<n.length;u++)(r=n[u],r.id!==s)&&(e=h[r.id],f=!!(e&&e.length),r.loaded()||r.loaded(f||!r.hasChildren),(r.loaded()||r.hasChildren!==!0)&&(r.hasChildren=f),f&&(n=n.slice(0,u+1).concat(e,n.slice(u+1))));return o.data=n,o},_queueRequest:function(n,t){t.call(this)},_modelLoaded:function(n){var t=this.get(n);t.loaded(!0);t.hasChildren=this.childNodes(t).length>0},_modelError:function(n,t){this.get(n)._error=t},success:function(n,t){return t&&t.id||(this._data=this._observe([])),l.fn.success.call(this,n,t)},load:function(t){var r="_query",u=this.options.serverSorting||this.options.serverPaging||this.options.serverFiltering||this.options.serverGrouping||this.options.serverAggregates,f=n.Deferred().resolve().promise();if(t.loaded()){if(u)return f}else t.hasChildren&&(r="read");return this[r]({id:t.id}).then(i(this._modelLoaded,this,t.id),i(this._modelError,this,t.id))},contains:function(n,t){for(var i=n.id;t;){if(t.parentId===i)return!0;t=this.parentNode(t)}return!1},_byParentId:function(n,t){var u=[],f=this.view(),r,i;if(n===t)return[];for(i=0;i<f.length;i++)r=f.at(i),r.parentId==n&&u.push(r);return u},_defaultParentId:function(){return this.reader.model.fn.defaults[this.reader.model.parentIdField]},childNodes:function(n){return this._byParentId(n.id,this._defaultParentId())},rootNodes:function(){return this._byParentId(this._defaultParentId())},parentNode:function(n){return this.get(n.parentId)},level:function(n){var t=-1;n instanceof c||(n=this.get(n));do n=this.parentNode(n),t++;while(n);return t},filter:function(n){var i=l.fn.filter;if(n===t)return i.call(this,n);i.call(this,n)}});b.create=function(t){return n.isArray(t)?t={data:t}:t instanceof vt&&(t={data:t.toJSON()}),t instanceof b?t:new b(t)};var ut=kendo.Observable.extend({init:function(n,t){kendo.Observable.fn.init.call(this);t=this.options=u(!0,{},this.options,t);this.element=n;this.bind(this.events,t);this.model=this.options.model;this.fields=this._fields(this.options.columns);this._initContainer();this.createEditable()},events:[],_initContainer:function(){this.wrapper=this.element},createEditable:function(){var n=this.options;this.editable=new y.Editable(this.wrapper,{fields:this.fields,target:n.target,clearContainer:n.clearContainer,model:this.model})},_isEditable:function(n){return n.field&&this.model.editable(n.field)},_fields:function(n){for(var r=[],t,i=0,u=n.length;i<u;i++)t=n[i],this._isEditable(t)&&r.push({field:t.field,format:t.format,editor:t.editor});return r},end:function(){return this.editable.end()},close:function(){this.destroy()},destroy:function(){this.editable.destroy();this.editable.element.find("["+kendo.attr("container-for")+"]").empty().end().removeAttr(kendo.attr("role"));this.model=this.wrapper=this.element=this.columns=this.editable=null}}),nr=ut.extend({init:function(n,t){ut.fn.init.call(this,n,t);this._attachHandlers();kendo.cycleForm(this.wrapper);this.open()},events:[rt,it],options:{window:{modal:!0,resizable:!1,draggable:!0,title:"Edit",visible:!1}},_initContainer:function(){var i=this.options,t=[];this.wrapper=n('<div class="k-popup-edit-form"/>').attr(kendo.attr("uid"),this.model.uid).append('<div class="k-edit-form-container"/>');i.template?(this._appendTemplate(t),this.fields=[]):this._appendFields(t);this._appendButtons(t);new e.Tree(this.wrapper.children()[0]).render(t);this.wrapper.appendTo(i.appendTo);this.window=new y.Window(this.wrapper,i.window)},_appendTemplate:function(n){var t=this.options.template;typeof t===wt&&(t=window.unescape(t));t=kendo.template(t)(this.model);n.push(v(t))},_appendFields:function(n){for(var t,u=this.options.columns,i=0,r=u.length;i<r;i++)(t=u[i],t.command)||(n.push(v('<div class="k-edit-label"><label for="'+t.field+'">'+(t.title||t.field||"")+"<\/label><\/div>")),this._isEditable(t)?n.push(v("<div "+kendo.attr("container-for")+'="'+t.field+'" class="k-edit-field"><\/div>')):n.push(o("div",{"class":"k-edit-field"},[this.options.fieldRenderer(t,this.model)])))},_appendButtons:function(n){n.push(o("div",{"class":"k-edit-buttons k-state-default"},this.options.commandRenderer()))},_attachHandlers:function(){var n=this._cancelProxy=i(this._cancel,this);this.wrapper.on(tt+f,".k-grid-cancel",this._cancelProxy);this._saveProxy=i(this._save,this);this.wrapper.on(tt+f,".k-grid-update",this._saveProxy);this.window.bind("close",function(t){t.userTriggered&&n(t)})},_dettachHandlers:function(){this._cancelProxy=null;this._saveProxy=null;this.wrapper.off(f)},_cancel:function(n){this.trigger(rt,n)},_save:function(){this.trigger(it)},open:function(){this.window.center().open()},close:function(){this.window.bind("deactivate",i(this.destroy,this)).close()},destroy:function(){this.window.destroy();this.window=null;this._dettachHandlers();ut.fn.destroy.call(this)}}),g=et.extend({init:function(t,i){if(et.fn.init.call(this,t,i),this._dataSource(this.options.dataSource),this._columns(),this._layout(),this._selectable(),this._sortable(),this._resizable(),this._filterable(),this._attachEvents(),this._toolbar(),this._scrollable(),this._reorderable(),this._columnMenu(),this._minScreenSupport(),this._draggable(),this.options.autoBind&&this.dataSource.fetch(),this._hasLockedColumns){var r=this;this.wrapper.addClass("k-grid-lockedcolumns");this._resizeHandler=function(){r.resize()};n(window).on("resize"+f,this._resizeHandler)}kendo.notify(this)},_draggable:function(){var t=this.options.editable;t&&t.move&&(this._dragging=new kendo.ui.HierarchicalDragAndDrop(this.wrapper,{$angular:this.$angular,autoScroll:!0,filter:"tbody>tr",itemSelector:"tr",allowedContainers:this.wrapper,hintText:function(t){var i=function(){return n(this).text()};return t.children("td").map(i).toArray().join("<span class='k-header k-drag-separator' />")},contains:i(function(n,t){var i=this.dataItem(t),r=this.dataItem(n);return r==i||this.dataSource.contains(r,i)},this),itemFromTarget:function(n){var t=n.closest("tr");return{item:t,content:t}},dragstart:i(function(n){this.wrapper.addClass("k-treelist-dragging");var t=this.dataItem(n);return this.trigger(hi,{source:t})},this),drag:i(function(n){n.source=this.dataItem(n.source);this.trigger(ci,n)},this),drop:i(function(n){return n.source=this.dataItem(n.source),n.destination=this.dataItem(n.destination),this.wrapper.removeClass("k-treelist-dragging"),this.trigger(li,n)},this),dragend:i(function(n){var t=this.dataItem(n.destination),i=this.dataItem(n.source);i.set("parentId",t?t.id:null);n.source=i;n.destination=t;this.trigger(ai,n)},this),reorderable:!1,dropHintContainer:function(n){return n.children("td:eq(1)")},dropPositionFrom:function(n){return n.prevAll(".k-i-none").length>0?"after":"before"}}))},itemFor:function(n){return typeof n=="number"&&(n=this.dataSource.get(n)),this.tbody.find("["+kendo.attr("uid")+"="+n.uid+"]")},_scrollable:function(){var u,r,t;this.options.scrollable&&(u=this.thead.closest(".k-grid-header-wrap"),r=n(this.lockedContent).bind("DOMMouseScroll"+f+" mousewheel"+f,i(this._wheelScroll,this)),this.content.bind("scroll"+f,function(){u.scrollLeft(this.scrollLeft);r.scrollTop(this.scrollTop)}),t=kendo.touchScroller(this.content),t&&t.movable&&(this._touchScroller=t,t.movable.bind("change",function(n){u.scrollLeft(-n.sender.x);r&&r.scrollTop(-n.sender.y)})))},_wheelScroll:function(t){if(!t.ctrlKey){var i=kendo.wheelDeltaY(t);if(i){t.preventDefault();n(t.currentTarget).one("wheel"+f,!1);this.content.scrollTop(this.content.scrollTop()+-i)}}},_progress:function(){var n=this.options.messages;this.tbody.find("tr").length||this._showStatus(kendo.template("<span class='#= className #' /> #: messages.loading #")({className:r.icon+" "+r.loading,messages:n}))},_error:function(n){this.dataSource.rootNodes().length||this._render({error:n})},refresh:function(n){(n=n||{},n.action=="itemchange"&&this.editor)||this.trigger(ni)||(this._cancelEditor(),this._render(),this._adjustHeight(),this.trigger(ti))},_angularFooters:function(n){for(var i,r,f=this.dataSource.aggregates(),u=this._footerItems(),t=0;t<u.length;t++)i=u.eq(t),r=f[i.attr("data-parentId")],this._angularFooter(n,i.find("td").get(),r)},_angularFooter:function(n,t,i){var r=this.columns;this.angular(n,function(){return{elements:t,data:ot(r,function(n){return{column:n,aggregate:i&&i[n.field]}})}})},items:function(){return this._hasLockedColumns?this._items(this.tbody).add(this._items(this.lockedTable)):this._items(this.tbody)},_items:function(t){return t.find("tr").filter(function(){return!n(this).hasClass(r.footerTemplate)})},_footerItems:function(){var t=this.tbody;return this._hasLockedColumns&&(t=t.add(this.lockedTable)),t.find("tr").filter(function(){return n(this).hasClass(r.footerTemplate)})},dataItems:function(){var t=kendo.ui.DataBoundWidget.fn.dataItems.call(this),i,r,n;if(this._hasLockedColumns){for(i=t.length,r=new Array(2*i),n=i;--n>=0;)r[n]=r[n+i]=t[n];t=r}return t},_showStatus:function(t){var i=this.element.find(".k-status"),r=n(this.content).add(this.lockedContent);i.length||(i=n("<div class='k-status' />").appendTo(this.element));this._contentTree.render([]);this._hasLockedColumns&&this._lockedContentTree.render([]);r.hide();i.html(t)},_hideStatus:function(){this.element.find(".k-status").remove();n(this.content).add(this.lockedContent).show()},_adjustHeight:function(){var n=this.element,f=n.find(h+r.gridContentWrap),e=n.find(h+r.gridHeader),o=n.find(h+r.gridToolbar),t,i=kendo.support.scrollbar(),u;n.height(this.options.height);u=function(n){var t,i;return n[0].style.height?!0:(t=n.height(),n.height("auto"),i=n.height(),n.height(""),t!=i)};u(n)&&(t=n.height()-e.outerHeight()-o.outerHeight(),f.height(t),this._hasLockedColumns&&(i=this.table[0].offsetWidth>this.table.parent()[0].clientWidth?i:0,this.lockedContent.height(t-i)))},_resize:function(){this._applyLockedContainersWidth();this._adjustHeight()},_minScreenSupport:function(){var t=this.hideMinScreenCols();if(t){this.minScreenResizeHandler=i(this.hideMinScreenCols,this);n(window).on("resize",this.minScreenResizeHandler)}},hideMinScreenCols:function(){for(var n,i,u=this.columns,f=!1,e=window.innerWidth>0?window.innerWidth:screen.width,r=0;r<u.length;r++)n=u[r],i=n.minScreenWidth,i!==t&&i!==null&&(f=!0,i>e?this.hideColumn(n):this.showColumn(n));return f},destroy:function(){et.fn.destroy.call(this);var t=this.dataSource;t.unbind(p,this._refreshHandler);t.unbind(ht,this._errorHandler);t.unbind(ct,this._progressHandler);this._resizeHandler&&n(window).off("resize"+f,this._resizeHandler);this._dragging&&(this._dragging.destroy(),this._dragging=null);this.resizable&&(this.resizable.destroy(),this.resizable=null);this.reorderable&&(this.reorderable.destroy(),this.reorderable=null);this._draggableInstance&&this._draggableInstance.element&&(this._draggableInstance.destroy(),this._draggableInstance=null);this.minScreenResizeHandler&&n(window).off("resize",this.minScreenResizeHandler);this._destroyEditor();this.element.off(f);this._touchScroller&&this._touchScroller.destroy();this._autoExpandable=null;this._refreshHandler=this._errorHandler=this._progressHandler=null;this.thead=this.content=this.tbody=this.table=this.element=this.lockedHeader=this.lockedContent=null;this._statusTree=this._headerTree=this._contentTree=this._lockedHeaderColsTree=this._lockedContentColsTree=this._lockedHeaderTree=this._lockedContentTree=null},options:{name:"TreeList",columns:[],autoBind:!0,scrollable:!0,selectable:!1,sortable:!1,toolbar:null,height:null,columnMenu:!1,messages:{noRows:"No records to display",loading:"Loading...",requestFailed:"Request failed.",retry:"Retry",commands:{edit:"Edit",update:"Update",canceledit:"Cancel",create:"Add new record",createchild:"Add child record",destroy:"Delete",excel:"Export to Excel",pdf:"Export to PDF"}},excel:{hierarchy:!0},resizable:!1,filterable:!1,editable:!1,reorderable:!1},events:[p,bt,it,gt,kt,dt,ni,ti,rt,hi,ci,li,ai,ii,ri,ui,fi,lt,ei,oi,si],_toggle:function(n,r){var u=n.loaded();(n._error&&(n.expanded=!1,n._error=t),u||!n.expanded)&&(typeof r=="undefined"&&(r=!n.expanded),n.expanded=r,u||this.dataSource.load(n).always(i(function(){this._render();this._syncLockedContentHeight()},this)),this._render(),this._syncLockedContentHeight())},expand:function(n){this._toggle(this.dataItem(n),!0)},collapse:function(n){this._toggle(this.dataItem(n),!1)},_toggleChildren:function(t){var r=n(t.currentTarget),i=this.dataItem(r),u=i.expanded?dt:kt;this.trigger(u,{model:i})||this._toggle(i);t.preventDefault()},_attachEvents:function(){var t=h+r.iconCollapse+", ."+r.iconExpand+", ."+r.refresh,u=h+r.retry,n=this.dataSource;this.element.on(wi+f,t,i(this._toggleChildren,this)).on(tt+f,u,i(n.fetch,n)).on(tt+f,".k-button[data-command]",i(this._commandClick,this))},_commandByName:function(t){var o=this.columns,e=n.isArray(this.options.toolbar)?this.options.toolbar:[],i,u,f,r;if(t=t.toLowerCase(),at[t])return at[t];for(i=0;i<o.length;i++)if(f=o[i].command,f)for(u=0;u<f.length;u++)if((r=f[u].name,r)&&r.toLowerCase()==t)return f[u];for(i=0;i<e.length;i++)if((r=e[i].name,r)&&r.toLowerCase()==t)return e[i]},_commandClick:function(i){var f=n(i.currentTarget),e=f.attr("data-command"),r=this._commandByName(e),u=f.parentsUntil(this.wrapper,"tr");u=u.length?u:t;r&&(r.methodName?this[r.methodName](u):r.click&&r.click.call(this,i),i.preventDefault())},_ensureExpandableColumn:function(){this._autoExpandable&&delete this._autoExpandable.expandable;var n=s(this.columns,vi(d("hidden"))),t=s(n,d("expandable"));this.columns.length&&!t.length&&(this._autoExpandable=n[0],n[0].expandable=!0)},_columns:function(){var t=this.options.columns||[],n;this.columns=ot(t,function(n){return n=typeof n=="string"?{field:n}:n,u({encoded:!0},n)});n=this._lockedColumns();n.length>0&&(this._hasLockedColumns=!0,this.columns=n.concat(this._nonLockedColumns()));this._ensureExpandableColumn();this._columnTemplates();this._columnAttributes()},_columnTemplates:function(){for(var n,r=this.columns,t=0,i=r.length;t<i;t++)n=r[t],n.template&&(n.template=kendo.template(n.template)),n.headerTemplate&&(n.headerTemplate=kendo.template(n.headerTemplate)),n.footerTemplate&&(n.footerTemplate=kendo.template(n.footerTemplate))},_columnAttributes:function(){function u(t){var r,i,u,f;if(t&&t.style)for(r=t.style.split(";"),t.style={},i=0;i<r.length;i++)u=r[i].split(":"),f=n.trim(u[0]),f&&(t.style[n.camelCase(f)]=n.trim(u[1]))}for(var i=this.columns,t=0,r=i.length;t<r;t++)u(i[t].attributes),u(i[t].headerAttributes)},_layout:function(){var f=this.columns,t=this.element,n="",u,i;this.wrapper=t.addClass(r.wrapper);n="<div class='#= gridHeader #' style=\"padding-right: "+kendo.support.scrollbar()+'px;">';this._hasLockedColumns&&(n+="<div class='k-grid-header-locked'><table role='grid'><colgroup><\/colgroup><thead role='rowgroup' /><\/table><\/div>");n+="<div class='#= gridHeaderWrap #'><table role='grid'><colgroup><\/colgroup><thead role='rowgroup' /><\/table><\/div><\/div>";this._hasLockedColumns&&(n+="<div class='k-grid-content-locked'><table role='treegrid' tabindex='0'><colgroup><\/colgroup><tbody /><\/table><\/div>");n+="<div class='#= gridContentWrap #'><table role='treegrid' tabindex='0'><colgroup><\/colgroup><tbody /><\/table><\/div>";this.options.scrollable||(n="<table role='treegrid' tabindex='0'><colgroup><\/colgroup><thead class='#= gridHeader #' role='rowgroup' /><tbody /><\/table>");this.options.toolbar&&(n="<div class='#= header # #= gridToolbar #' />"+n);t.append(kendo.template(n)(r)+"<div class='k-status' />");this.toolbar=t.find(h+r.gridToolbar);u=t.find(h+r.gridHeader).find("thead").addBack().filter("thead");this.thead=u.last();i=t.find(h+r.gridContentWrap);i.length?this.content=i:i=t;this.table=i.find(">table");this.tbody=this.table.find(">tbody");this._hasLockedColumns&&(this.lockedHeader=u.first().closest(".k-grid-header-locked"),this.lockedContent=t.find(".k-grid-content-locked"),this.lockedTable=this.lockedContent.children());this._initVirtualTrees();this._renderCols();this._renderHeader();this.angular("compile",function(){return{elements:u.find("th.k-header").get(),data:ot(f,function(n){return{column:n}})}})},_initVirtualTrees:function(){this._headerColsTree=new e.Tree(this.thead.prev()[0]);this._contentColsTree=new e.Tree(this.tbody.prev()[0]);this._headerTree=new e.Tree(this.thead[0]);this._contentTree=new e.Tree(this.tbody[0]);this._statusTree=new e.Tree(this.element.children(".k-status")[0]);this.lockedHeader&&(this._lockedHeaderColsTree=new e.Tree(this.lockedHeader.find("colgroup")[0]),this._lockedContentColsTree=new e.Tree(this.lockedTable.find(">colgroup")[0]),this._lockedHeaderTree=new e.Tree(this.lockedHeader.find("thead")[0]),this._lockedContentTree=new e.Tree(this.lockedTable.find(">tbody")[0]))},_toolbar:function(){var t=this.options.toolbar,i=this.toolbar,r;t&&(n.isArray(t)?(r=this._buildCommands(t),new e.Tree(i[0]).render(r)):i.append(kendo.template(t)({})),this.angular("compile",function(){return{elements:i.get()}}))},_lockedColumns:function(){return s(this.columns,d("locked"))},_nonLockedColumns:function(){return s(this.columns,vi(d("locked")))},_templateColumns:function(){return s(this.columns,d("template"))},_flushCache:function(){this.options.$angular&&this._templateColumns().length&&(this._contentTree.render([]),this._hasLockedColumns&&this._lockedContentTree.render([]))},_render:function(t){t=t||{};var u=this.options.messages,i=this.dataSource.rootNodes(),f=this.select().map(function(t,i){return n(i).attr(kendo.attr("uid"))});this._absoluteIndex=0;this._angularItems("cleanup");this._angularFooters("cleanup");this._flushCache();t.error?this._showStatus(kendo.template("#: messages.requestFailed # <button class='#= buttonClass #'>#: messages.retry #<\/button>")({buttonClass:[r.button,r.retry].join(" "),messages:u})):i.length?(this._hideStatus(),this._contentTree.render(this._trs({columns:this._nonLockedColumns(),aggregates:t.aggregates,selected:f,data:i,visible:!0,level:0})),this._hasLockedColumns&&(this._absoluteIndex=0,this._lockedContentTree.render(this._trs({columns:this._lockedColumns(),aggregates:t.aggregates,selected:f,data:i,visible:!0,level:0})))):this._showStatus(kendo.htmlEncode(u.noRows));this._touchScroller&&this._touchScroller.contentResized();this._muteAngularRebind(function(){this._angularItems("compile");this._angularFooters("compile")});this._adjustRowsHeight()},_adjustRowsHeight:function(){if(this._hasLockedColumns){var s=this.table,h=this.lockedTable,t=s[0].rows,c=t.length,n,i=h[0].rows,r=s.add(h),l=r.length,u=[],a=this.lockedHeader.find("tr"),v=this.thead.find("tr");for(a.add(v).height("auto").height(Math.max(a.height(),v.height())),n=0;n<c;n++){if(!i[n])break;t[n].style.height&&(t[n].style.height=i[n].style.height="");var f=t[n].offsetHeight,e=i[n].offsetHeight,o=0;f>e?o=f:f<e&&(o=e);u.push(o)}for(n=0;n<l;n++)r[n].style.display="none";for(n=0;n<c;n++)u[n]&&(t[n].style.height=i[n].style.height=u[n]+1+"px");for(n=0;n<l;n++)r[n].style.display=""}},_ths:function(n){for(var c=[],t,e,i,l,f,s,h=0,a=n.length;h<a;h++)t=n[h],i=[],l=[r.header],e=t.headerTemplate?t.headerTemplate({}):t.title||t.field||"",s=t.headerTemplate?v(e):ft(e),t.sortable?i.push(o("a",{href:"#",className:r.link},[s])):i.push(s),f={"data-field":t.field,"data-title":t.title,style:t.hidden===!0?{display:"none"}:{},className:l.join(" "),role:"columnheader"},f=u(!0,{},f,t.headerAttributes),c.push(o("th",f,i));return c},_cols:function(n){for(var u=[],t,r,i=0;i<n.length;i++)n[i].hidden!==!0&&(t=n[i].width,r={},t&&parseInt(t,10)!==0&&(r.style={width:typeof t=="string"?t:t+"px"}),u.push(o("col",r)));return u},_renderCols:function(){var n=this._nonLockedColumns();this._headerColsTree.render(this._cols(n));this.options.scrollable&&this._contentColsTree.render(this._cols(n));this._hasLockedColumns&&(n=this._lockedColumns(),this._lockedHeaderColsTree.render(this._cols(n)),this._lockedContentColsTree.render(this._cols(n)))},_renderHeader:function(){var n=this._nonLockedColumns();this._headerTree.render([o("tr",{role:"row"},this._ths(n))]);this._hasLockedColumns&&(n=this._lockedColumns(),this._lockedHeaderTree.render([o("tr",{role:"row"},this._ths(n))]),this._applyLockedContainersWidth())},_applyLockedContainersWidth:function(){var r;if(this._hasLockedColumns){var n=pi(this.lockedHeader.find(">table>colgroup>col")),t=this.thead.parent(),f=pi(t.find(">colgroup>col")),i=this.wrapper[0].clientWidth,u=kendo.support.scrollbar();n>=i&&(n=i-3*u);this.lockedHeader.add(this.lockedContent).width(n);t.add(this.table).width(f);r=i-n-2;this.content.width(r);t.parent().width(r-u)}},_trs:function(t){for(var u,f,e,s,h,o=[],l=t.level,y=t.data,p=this.dataSource,w=p.aggregates()||{},a=t.columns,c=0,v=y.length;c<v;c++)e=[],u=y[c],h=u.loaded()&&p.childNodes(u),s=h&&h.length,f={role:"row"},f[kendo.attr("uid")]=u.uid,s&&(f["aria-expanded"]=!!u.expanded),t.visible?(this._absoluteIndex%2!=0&&e.push(r.alt),this._absoluteIndex++):f.style={display:"none"},n.inArray(u.uid,t.selected)>=0&&e.push(r.selected),s&&e.push(r.group),u._edit&&e.push("k-grid-edit-row"),f.className=e.join(" "),o.push(this._tds({model:u,attr:f,level:l},a,i(this._td,this))),s&&(o=o.concat(this._trs({columns:a,aggregates:w,selected:t.selected,visible:t.visible&&!!u.expanded,data:h,level:l+1})));return this._hasFooterTemplate()&&(f={className:r.footerTemplate,"data-parentId":u.parentId},t.visible||(f.style={display:"none"}),o.push(this._tds({model:w[u.parentId],attr:f,level:l},a,this._footerTd))),o},_footerTd:function(t){var f=[],i=t.column,s=t.column.footerTemplate||n.noop,h=t.model[i.field]||{},e={role:"gridcell",style:i.hidden===!0?{display:"none"}:{}};return i.expandable&&(f=f.concat(yi({level:t.level+1,className:r.iconPlaceHolder}))),i.attributes&&u(e,i.attributes),f.push(v(s(h)||"")),o("td",e,f)},_hasFooterTemplate:function(){return!!s(this.columns,function(n){return n.footerTemplate}).length},_tds:function(n,t,i){for(var u=[],f,r=0,e=t.length;r<e;r++)f=t[r],u.push(i({model:n.model,column:f,level:n.level}));return o("tr",n.attr,u)},_td:function(n){var e=[],i=n.model,t=n.column,f,s={role:"gridcell",style:t.hidden===!0?{display:"none"}:{}};return i._edit&&t.field&&i.editable(t.field)?s[kendo.attr("container-for")]=t.field:(t.expandable&&(e=yi({level:n.level,className:r.iconPlaceHolder}),f=[r.icon],i.hasChildren?f.push(i.expanded?r.iconCollapse:r.iconExpand):f.push(r.iconHidden),i._error?f.push(r.refresh):!i.loaded()&&i.expanded&&f.push(r.loading),e.push(o("span",{className:f.join(" ")})),s.style["white-space"]="nowrap"),t.attributes&&u(!0,s,t.attributes),t.command?e=i._edit?this._buildCommands(["update","canceledit"]):this._buildCommands(t.command):e.push(this._cellContent(t,i))),o("td",s,e)},_cellContent:function(n,t){var i;return n.template?i=n.template(t):n.field&&(i=t.get(n.field),i!==null&&n.format&&(i=kendo.format(n.format,i))),(i===null||typeof i=="undefined")&&(i=""),n.template||!n.encoded?v(i):ft(i)},_buildCommands:function(n){for(var i=[],t=0;t<n.length;t++)i.push(this._button(n[t]));return i},_button:function(n){var t=(n.name||n).toLowerCase(),r=this.options.messages.commands[t],i=[];return n=u({},at[t],{text:r},n),n.imageClass&&i.push(o("span",{className:["k-icon",n.imageClass].join(" ")})),o("button",{type:"button","data-command":t,className:["k-button","k-button-icontext",n.className].join(" ")},i.concat([ft(n.text||n.name)]))},_positionResizeHandle:function(t){var i=n(t.currentTarget),r=this.resizeHandle,h=i.position(),c=h.left,l=i.outerWidth(),a=i.closest("div"),v=t.clientX+n(window).scrollLeft(),u=this.options.columnResizeHandleWidth||3,o,y,e;if(c+=a.scrollLeft(),r||(r=this.resizeHandle=n('<div class="k-resize-handle"><div class="k-resize-handle-inner" /><\/div>')),o=i.offset().left+l,y=v>o-u&&v<o+u,!y){r.hide();return}a.append(r);r.show().css({top:h.top,left:c+l-u-1,height:i.outerHeight(),width:u*3}).data("th",i);e=this;r.off("dblclick"+f).on("dblclick"+f,function(){var t=i.index();n.contains(e.thead[0],i[0])&&(t+=s(e.columns,function(n){return n.locked&&!n.hidden}).length);e.autoFitColumn(t)})},autoFitColumn:function(t){var i=this,g=i.options,f=i.columns,r,nt=kendo.support.browser,b,e,o,tt=i.lockedHeader?di(i.lockedHeader.find(">table>thead")).filter(ki).length:0,a,h,k,v,c,u,it,y,d,p,l,w,rt;if(t=typeof t=="number"?f[t]:yt(t)?s(f,function(n){return n===t})[0]:s(f,function(n){return n.field===t})[0],t&&!t.hidden){for(r=st(t,f),o=t.locked,e=o?i.lockedHeader.children("table"):i.thead.parent(),b=e.find("[data-index='"+r+"']"),h=o?i.lockedTable:i.table,k=i.footer||n(),i.footer&&i.lockedContent&&(k=o?i.footer.children(".k-grid-footer-locked"):i.footer.children(".k-grid-footer-wrap")),v=k.find("table").first(),i.lockedHeader&&tt>=r&&!o&&(r-=tt),c=0;c<f.length;c++)if(f[c]===t)break;else f[c].hidden&&r--;if(a=g.scrollable?e.find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+r+")").add(h.children("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+r+")")).add(v.find("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+r+")")):h.children("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+r+")"),u=e.add(h).add(v),it=b.outerWidth(),a.width(""),u.css("table-layout","fixed"),a.width("auto"),u.addClass("k-autofitting"),u.css("table-layout",""),y=Math.ceil(Math.max(b.outerWidth(),h.find("tr").eq(0).children("td:visible").eq(r).outerWidth(),v.find("tr").eq(0).children("td:visible").eq(r).outerWidth())),a.width(y),t.width=y,g.scrollable){for(d=e.find("col"),l=0,w=0,rt=d.length;w<rt;w+=1)if(p=d[w].style.width,p&&p.indexOf("%")==-1)l+=parseInt(p,10);else{l=0;break}l&&u.each(function(){this.style.width=l+"px"})}nt.msie&&nt.version==8&&(u.css("display","inline-table"),setTimeout(function(){u.css("display","table")},1));u.removeClass("k-autofitting");i.trigger(lt,{column:t,oldWidth:it,newWidth:y});i._applyLockedContainersWidth();i._syncLockedContentHeight();i._syncLockedHeaderHeight()}},_adjustLockedHorizontalScrollBar:function(){var n=this.table,t=n.parent(),i=n[0].offsetWidth>t[0].clientWidth?kendo.support.scrollbar():0;this.lockedContent.height(t.height()-i)},_syncLockedContentHeight:function(){this.lockedTable&&(this._touchScroller||this._adjustLockedHorizontalScrollBar(),this._adjustRowsHeight(this.table,this.lockedTable))},_syncLockedHeaderHeight:function(){if(this.lockedHeader){var n=this.lockedHeader.children("table"),t=this.thead.parent();this._adjustRowsHeight(n,t);gi(n,t)}},_resizable:function(){if(this.options.resizable){this.resizable&&this.resizable.destroy();var t=this;n(this.lockedHeader).find("thead").add(this.thead).on("mousemove"+f,"th",n.proxy(this._positionResizeHandle,this));this.resizable=new kendo.ui.Resizable(this.wrapper,{handle:".k-resize-handle",start:function(i){var r=n(i.currentTarget).data("th"),e="col:eq("+n.inArray(r[0],r.parent().children().filter(":visible"))+")",u,f;t.wrapper.addClass("k-grid-column-resizing");t.lockedHeader&&n.contains(t.lockedHeader[0],r[0])?(u=t.lockedHeader,f=t.lockedTable):(u=t.thead.parent(),f=t.table);this.col=f.children("colgroup").find(e).add(u.find(e));this.th=r;this.startLocation=i.x.location;this.columnWidth=r.outerWidth();this.table=this.col.closest("table");this.totalWidth=this.table.width()},resize:function(n){var i=11,t=n.x.location-this.startLocation;this.columnWidth+t<i&&(t=i-this.columnWidth);this.table.width(this.totalWidth+t);this.col.width(this.columnWidth+t)},resizeend:function(){t.wrapper.removeClass("k-grid-column-resizing");var r=this.th.attr("data-field"),n=s(t.columns,function(n){return n.field==r}),i=Math.floor(this.th.outerWidth());n[0].width=i;t._resize();t._adjustRowsHeight();t.trigger(lt,{column:n,oldWidth:this.columnWidth,newWidth:i});this.table=this.col=this.th=null}})}},_sortable:function(){var h=this.columns,t,r,e=n(this.lockedHeader).add(this.thead).find("th"),f,i,o,c=kendo.attr("field"),s=this.options.sortable;if(s)for(i=0,o=e.length;i<o;i++)t=h[i],t.sortable!==!1&&!t.command&&t.field&&(f=e.eq(i),r=f.data("kendoColumnSorter"),r&&r.destroy(),f.attr(c,t.field).kendoColumnSorter(u({},s,t.sortable,{dataSource:this.dataSource})))},_filterable:function(){var o=n(this.lockedHeader).add(this.thead).find("th"),s=this.options.filterable,t,h,r,f,e,c;if(s&&!this.options.columnMenu)for(c=i(function(n){this.trigger(ii,{field:n.field,container:n.container})},this),t=0,h=o.length;t<h;t++)(r=this.columns[t],f=o.eq(t),e=f.data("kendoFilterMenu"),e&&e.destroy(),r.command||r.filterable===!1)||f.kendoFilterMenu(u(!0,{},s,r.filterable,{dataSource:this.dataSource,init:c}))},_change:function(){this.trigger(p)},_selectable:function(){var n=this.options.selectable,r,u=this.table,f;n&&(n=kendo.ui.Selectable.parseOptions(n),this._hasLockedColumns&&(u=u.add(this.lockedTable),f=n.multiple&&n.cell),r=">tbody>tr:not(.k-footer-template)",n.cell&&(r=r+">td"),this.selectable=new kendo.ui.Selectable(u,{filter:r,aria:!0,multiple:n.multiple,change:i(this._change,this),useAllItems:f,continuousItems:i(this._continuousItems,this,r,n.cell),relatedTarget:!n.cell&&this._hasLockedColumns?i(this._selectableTarget,this):t}))},_continuousItems:function(t,i){var r;if(this.lockedContent){var e=n(t,this.lockedTable),o=n(t,this.table),u=i?this._lockedColumns().length:1,s=i?this.columns.length-u:1,f=[];for(r=0;r<e.length;r+=u)pt.apply(f,e.slice(r,r+u)),pt.apply(f,o.splice(0,s));return f}},_selectableTarget:function(t){for(var i,r=n(),u=0,f=t.length;u<f;u++)i=this._relatedRow(t[u]),st(i[0],t)<0&&(r=r.add(i));return r},_relatedRow:function(t){var r=this.lockedTable,i,u;return(t=n(t),!r)?t:(i=t.closest(this.table.add(this.lockedTable)),u=i.find(">tbody>tr").index(t),i=i[0]===this.table[0]?r:this.table,i.find(">tbody>tr").eq(u))},select:function(t){var r=this.selectable;return r?(typeof t!="undefined"&&(r.options.multiple||(r.clear(),t=t.first()),this._hasLockedColumns&&(t=t.add(n.map(t,i(this._relatedRow,this))))),r.value(t)):n()},clearSelection:function(){var n=this.select();n.length&&(this.selectable.clear(),this.trigger(p))},_dataSource:function(n){var t=this.dataSource;t&&(t.unbind(p,this._refreshHandler),t.unbind(ht,this._errorHandler),t.unbind(ct,this._progressHandler));this._refreshHandler=i(this.refresh,this);this._errorHandler=i(this._error,this);this._progressHandler=i(this._progress,this);t=this.dataSource=b.create(n);t.bind(p,this._refreshHandler);t.bind(ht,this._errorHandler);t.bind(ct,this._progressHandler)},setDataSource:function(n){this._dataSource(n);this._sortable();this._filterable();this._contentTree.render([]);this.options.autoBind&&this.dataSource.fetch()},dataItem:function(t){var i=n(t).closest("tr");return this.dataSource.getByUid(i.attr(kendo.attr("uid")))},editRow:function(n){var t;(typeof n===wt&&(n=this.tbody.find(n)),t=this.dataItem(n),t)&&(this._editMode()!="popup"&&(t._edit=!0),this._cancelEditor(),this._render(),this._createEditor(t),this.trigger(bt,{container:this.editor.wrapper,model:t}))},_cancelEdit:function(n){(n=u(n,{container:this.editor.wrapper,model:this.editor.model}),this.trigger(rt,n))||this.cancelRow()},cancelRow:function(){this._cancelEditor();this._render()},saveRow:function(){var n=this.editor,t;n&&(t={model:n.model,container:n.wrapper},n.end()&&!this.trigger(it,t)&&this.dataSource.sync())},addRow:function(n){var u=this.editor,t=0,r={};if(!u||u.end()){if(n){n instanceof c||(n=this.dataItem(n));r[n.parentIdField]=n.id;t=this.dataSource.indexOf(n)+1;n.set("expanded",!0);this.dataSource.load(n).then(i(this._insertAt,this,r,t));return}this._insertAt(r,t)}},_insertAt:function(n,t){n=this.dataSource.insert(t,n);var i=this.itemFor(n);this.editRow(i)},removeRow:function(n){var t=this.dataItem(n),i={model:t,row:n};t&&!this.trigger(gt,i)&&(this.dataSource.remove(t),this.dataSource.sync())},_cancelEditor:function(){var n,t=this.editor;t&&(n=t.model,this._destroyEditor(),this.dataSource.cancelChanges(n),n._edit=!1)},_destroyEditor:function(){this.editor&&(this.editor.close(),this.editor=null)},_createEditor:function(n){var t=this.itemFor(n),f,r;t=t.add(this._relatedRow(t));f=this._editMode();r={columns:this.columns,model:n,target:this,clearContainer:!1,template:this.options.editable.template};f=="inline"?this.editor=new ut(t,r):(u(r,{window:this.options.editable.window,commandRenderer:i(function(){return this._buildCommands(["update","canceledit"])},this),fieldRenderer:this._cellContent,save:i(this.saveRow,this),cancel:i(this._cancelEdit,this),appendTo:this.wrapper}),this.editor=new nr(t,r))},_editMode:function(){var t="inline",n=this.options.editable;return n!==!0&&(t=typeof n=="string"?n:n.mode||t),t.toLowerCase()},hideColumn:function(n){this._toggleColumnVisibility(n,!0)},showColumn:function(n){this._toggleColumnVisibility(n,!1)},_toggleColumnVisibility:function(n,t){(n=this._findColumn(n),n&&n.hidden!==t)&&(n.hidden=t,this._ensureExpandableColumn(),this._renderCols(),this._renderHeader(),this._render(),this._adjustTablesWidth(),this.trigger(t?ri:ui,{column:n}),t||n.width||this.table.add(this.thead.closest("table")).width(""))},_findColumn:function(n){return n=typeof n=="number"?this.columns[n]:yt(n)?s(this.columns,function(t){return t===n})[0]:s(this.columns,function(t){return t.field===n})[0]},_adjustTablesWidth:function(){for(var u=this.thead.prev().children(),t,i=0,n=0,r=u.length;n<r;n++)if(t=u[n].style.width,t&&t.indexOf("%")==-1)i+=parseInt(t,10);else{i=0;break}i&&this.table.add(this.thead.closest("table")).width(i)},_reorderable:function(){if(this.options.reorderable){var r=this.options.scrollable===!0,u=(r?".k-grid-header:first ":"table:first>.k-grid-header ")+bi,t=this;this._draggableInstance=new y.Draggable(this.wrapper,{group:kendo.guid(),filter:u,hint:function(t){return n('<div class="k-header k-drag-clue" />').css({width:t.width(),paddingLeft:t.css("paddingLeft"),paddingRight:t.css("paddingRight"),lineHeight:t.height()+"px",paddingTop:t.css("paddingTop"),paddingBottom:t.css("paddingBottom")}).html(t.attr(kendo.attr("title"))||t.attr(kendo.attr("field"))||t.text()).prepend('<span class="k-icon k-drag-status k-denied" />')}});this.reorderable=new y.Reorderable(this.wrapper,{draggable:this._draggableInstance,dragOverContainers:i(this._allowDragOverContainers,this),inSameContainer:function(t){return n(t.source).parent()[0]===n(t.target).parent()[0]},change:function(n){var i=n.newIndex,r=n.oldIndex,f=n.position==="before",u=t.columns[r];t.trigger(fi,{newIndex:i,oldIndex:r,column:u});t.reorderColumn(i,u,f)}})}},_allowDragOverContainers:function(n){return this.columns[n].lockable!==!1},reorderColumn:function(i,r,u){var h,o=this.columns,f=st(r,o),a=o[i],s=!!a.locked,l=this._nonLockedColumns().length,c,e;f!==i&&(!s||r.locked||l!=1)&&(s||!r.locked||o.length-l!=1)&&(u===t&&(u=i<f),h=!!r.locked,h=h!=s,r.locked=s,o.splice(u?i:i+1,0,r),o.splice(f<i?f:f+1,1),this._renderCols(),c=n(this.lockedHeader).add(this.thead).find("th"),c.eq(f)[u?"insertBefore":"insertAfter"](c.eq(i)),e=this._headerTree.children[0].children,this._hasLockedColumns&&(e=this._lockedHeaderTree.children[0].children.concat(e)),e.splice(u?i:i+1,0,e[f]),e.splice(f<i?f:f+1,1),this._hasLockedColumns&&(this._lockedHeaderTree.children[0].children=e.splice(0,this._lockedColumns().length),this._headerTree.children[0].children=e),this._applyLockedContainersWidth(),this.refresh(),h)&&(s?this.trigger(oi,{column:r}):this.trigger(si,{column:r}))},lockColumn:function(n){var t=this.columns,i;(n=typeof n=="number"?t[n]:s(t,function(t){return t.field===n})[0],n&&!n.hidden)&&(i=this._lockedColumns().length-1,this.reorderColumn(i,n,!1))},unlockColumn:function(n){var t=this.columns,i;(n=typeof n=="number"?t[n]:s(t,function(t){return t.field===n})[0],n&&!n.hidden)&&(i=this._lockedColumns().length,this.reorderColumn(i,n,!0))},_columnMenu:function(){var o=n(this.lockedHeader).add(this.thead).find("th"),a=this.columns,r=this.options,f=r.columnMenu,t,s,h,c,l,v=i(this._columnMenuInit,this),y=this._lockedColumns().length,e;if(f)for(typeof f=="boolean"&&(f={}),e=0;e<o.length;e++)(t=a[e],t.field)&&(s=o.eq(e).data("kendoColumnMenu"),s&&s.destroy(),c=!1,t.sortable!==!1&&f.sortable!==!1&&r.sortable!==!1&&(c=u({},r.sortable,{compare:(t.sortable||{}).compare})),l=!1,r.filterable&&t.filterable!==!1&&f.filterable!==!1&&(l=u({pane:this.pane},t.filterable,r.filterable)),h={dataSource:this.dataSource,values:t.values,columns:f.columns,sortable:c,filterable:l,messages:f.messages,owner:this,closeCallback:n.noop,init:v,pane:this.pane,lockedColumns:t.lockable!==!1&&y>0},r.$angular&&(h.$angular=r.$angular),o.eq(e).kendoColumnMenu(h))},_columnMenuInit:function(n){this.trigger(ei,{field:n.field,container:n.container})}});kendo.ExcelMixin&&kendo.ExcelMixin.extend(g.prototype);kendo.PDFMixin&&(kendo.PDFMixin.extend(g.prototype),g.fn._drawPDF=function(t){var i=new n.Deferred;return this._drawPDFShadow({width:this.wrapper.width()},{avoidLinks:this.options.pdf.avoidLinks}).done(function(n){var r={page:n,pageNumber:1,progress:1,totalPages:1};t.notify(r);i.resolve(r.page)}).fail(function(n){i.reject(n)}),i});u(!0,kendo.data,{TreeListDataSource:b,TreeListModel:c});u(!0,kendo.ui,{TreeList:g});y.plugin(g)})(window.kendo.jQuery)}(),function(){(function(n){var e,u,f;if(!n.support.browser.msie||!(n.support.browser.version<9)){var i=n.jQuery,t=n.spreadsheet.Command=n.Class.extend({init:function(n){this.options=n;this._workbook=n.workbook;this._property=n&&n.property;this._state={}},range:function(n){return n!==undefined&&(this._range=n),this._range},redo:function(){this.exec()},undo:function(){this.range().setState(this._state)},getState:function(){this._state=this.range().getState(this._property)},_forEachCell:function(n){var t=this.range(),i=t._ref;i.forEach(function(i){t.sheet().forEach(i.toRangeRef(),n.bind(this))}.bind(this))}}),r=n.spreadsheet.PropertyChangeCommand=t.extend({init:function(n){t.fn.init.call(this,n);this._value=n.value},exec:function(){var n=this.range();this.getState();n[this._property](this._value)}});n.spreadsheet.ClearContentCommand=t.extend({exec:function(){this.getState();this.range().clearContent()}});n.spreadsheet.EditCommand=r.extend({init:function(n){n.property="input";r.fn.init.call(this,n)},rejectState:function(n){return this.undo(),{title:n.title,body:n.message,reason:"error"}},exec:function(){var i=this.range(),r=this._value,t;this.getState();try{if(i.input(r),t=i._getValidationState(),t)return this.rejectState(t)}catch(u){if(u instanceof n.spreadsheet.calc.ParseError)try{if(i.input(r+")"),t=i._getValidationState(),t)return this.rejectState(t)}catch(f){if(f instanceof n.spreadsheet.calc.ParseError)return i.input("'"+r),{title:"Error in formula",body:u+"",reason:"error"}}else throw u;}}});n.spreadsheet.TextWrapCommand=r.extend({init:function(n){n.property="wrap";r.fn.init.call(this,n);this._value=n.value},getState:function(){var n={};this.range().forEachRow(function(t){var i=t.topLeft().row;n[i]=t.sheet().rowHeight(i)});this._state=this.range().getState(this._property);this._rowHeight=n},undo:function(){var i=this.range().sheet(),t=this._rowHeight,n;this.range().setState(this._state);for(n in t)i.rowHeight(n,t[n])}});n.spreadsheet.AdjustDecimalsCommand=t.extend({init:function(n){this._decimals=n.decimals;n.property="format";t.fn.init.call(this,n)},exec:function(){var t=this.range().sheet(),i=this._decimals,r=n.spreadsheet.formatting;this.getState();t.batch(function(){this.range().forEachCell(function(n,u,f){var e=f.format;(e||i>0)&&(e=r.adjustDecimals(e||"#",i),t.range(n,u).format(e))})}.bind(this))}});n.spreadsheet.BorderChangeCommand=t.extend({init:function(n){n.property="border";t.fn.init.call(this,n);this._type=n.border;this._style=n.style},exec:function(){this.getState();this[this._type](this._style)},noBorders:function(){var n=this.range();n.sheet().batch(function(){n.borderLeft(null).borderTop(null).borderRight(null).borderBottom(null)}.bind(this),{})},allBorders:function(n){var t=this.range();t.sheet().batch(function(){t.borderLeft(n).borderTop(n).borderRight(n).borderBottom(n)}.bind(this),{})},leftBorder:function(n){this.range().leftColumn().borderLeft(n)},rightBorder:function(n){this.range().rightColumn().borderRight(n)},topBorder:function(n){this.range().topRow().borderTop(n)},bottomBorder:function(n){this.range().bottomRow().borderBottom(n)},outsideBorders:function(n){var t=this.range();t.sheet().batch(function(){t.leftColumn().borderLeft(n);t.topRow().borderTop(n);t.rightColumn().borderRight(n);t.bottomRow().borderBottom(n)}.bind(this),{})},insideBorders:function(n){this.range().sheet().batch(function(){this.allBorders(n);this.outsideBorders(null)}.bind(this),{})},insideHorizontalBorders:function(n){var t=this.range();t.sheet().batch(function(){t.borderBottom(n);t.bottomRow().borderBottom(null)}.bind(this),{})},insideVerticalBorders:function(n){var t=this.range();t.sheet().batch(function(){t.borderRight(n);t.rightColumn().borderRight(null)}.bind(this),{})}});n.spreadsheet.MergeCellCommand=t.extend({init:function(n){t.fn.init.call(this,n);this._type=n.value},exec:function(){this.getState();this[this._type]()},activate:function(n){this.range().sheet().activeCell(n)},getState:function(){this._state=this.range().getState()},undo:function(){this._type!=="unmerge"&&(this.range().unmerge(),this.activate(this.range().topLeft()));this.range().setState(this._state)},cells:function(){var n=this.range(),t=n._ref;n.merge();this.activate(t)},horizontally:function(){var n=this.range().topRow()._ref;this.range().forEachRow(function(n){n.merge()});this.activate(n)},vertically:function(){var n=this.range().leftColumn()._ref;this.range().forEachColumn(function(n){n.merge()});this.activate(n)},unmerge:function(){var n=this.range(),t=n._ref.topLeft;n.unmerge();this.activate(t)}});n.spreadsheet.FreezePanesCommand=t.extend({init:function(n){t.fn.init.call(this,n);this._type=n.value},exec:function(){this.getState();this._topLeft=this.range().topLeft();this[this._type]()},getState:function(){this._state=this.range().sheet().getState()},undo:function(){this.range().sheet().setState(this._state)},panes:function(){var n=this._topLeft,t=this.range().sheet();t.frozenColumns(n.col).frozenRows(n.row)},rows:function(){var n=this._topLeft,t=this.range().sheet();t.frozenRows(n.row)},columns:function(){var n=this._topLeft,t=this.range().sheet();t.frozenColumns(n.col)},unfreeze:function(){var n=this.range().sheet();n.frozenRows(0).frozenColumns(0)}});n.spreadsheet.PasteCommand=t.extend({init:function(n){t.fn.init.call(this,n);this._clipboard=this._workbook.clipboard()},getState:function(){this._range=this._workbook.activeSheet().range(this._clipboard.pasteRef());this._state=this._range.getState()},exec:function(){var i=this._clipboard.canPaste(),t,r;if(this._clipboard.menuInvoked=!0,!i.canPaste)return i.menuInvoked?{reason:"useKeyboard"}:i.pasteOnMerged?{reason:"modifyMerged"}:void 0;this.getState();this._clipboard.paste();t=this._workbook.activeSheet();r=t.range(this._clipboard.pasteRef());r.forEachRow(function(i){var r=i.sheet().rowHeight(i.topLeft().row);i.forEachCell(function(i,u,f){var e=t.columnWidth(u);r=Math.max(r,n.spreadsheet.util.getTextHeight(f.value,e,f.fontSize,f.wrap))});t.rowHeight(i.topLeft().row,r)})}});n.spreadsheet.ToolbarPasteCommand=t.extend({exec:function(){if(n.support.clipboard.paste)this._workbook._view.clipboard.focus().select(),document.execCommand("paste");else return{reason:"useKeyboard"}}});n.spreadsheet.CopyCommand=t.extend({init:function(n){t.fn.init.call(this,n);this._clipboard=n.workbook.clipboard()},undo:i.noop,exec:function(){var n=this._clipboard.canCopy();if(this._clipboard.menuInvoked=!0,!n.canCopy)return n.menuInvoked?{reason:"useKeyboard"}:n.multiSelection?{reason:"unsupportedSelection"}:void 0;this._clipboard.copy()}});n.spreadsheet.ToolbarCopyCommand=t.extend({init:function(n){t.fn.init.call(this,n);this._clipboard=n.workbook.clipboard()},undo:i.noop,exec:function(){if(n.support.clipboard.copy){var t=this._workbook._view.clipboard,r=document.createElement("textarea");i(r).addClass("k-spreadsheet-clipboard").val(t.html()).appendTo(document.body).focus().select();document.execCommand("copy");t.trigger("copy");i(r).remove()}else return{reason:"useKeyboard"}}});n.spreadsheet.CutCommand=t.extend({init:function(n){t.fn.init.call(this,n);this._clipboard=n.workbook.clipboard()},exec:function(){this._clipboard.canCopy()&&(this.getState(),this._clipboard.cut())}});n.spreadsheet.AutoFillCommand=t.extend({init:function(n){t.fn.init.call(this,n)},origin:function(n){this._origin=n},exec:function(){this.getState();this._range.fillFrom(this._origin)}});n.spreadsheet.ToolbarCutCommand=t.extend({init:function(n){t.fn.init.call(this,n);this._clipboard=n.workbook.clipboard()},exec:function(){if(n.support.clipboard.copy){var t=this._workbook._view.clipboard,r=document.createElement("textarea");i(r).val(t.html()).appendTo(document.body).focus().select();document.execCommand("copy");t.trigger("cut");i(r).remove()}else return{reason:"useKeyboard"}}});n.spreadsheet.FilterCommand=t.extend({undo:function(){this.range().filter(this._state)},exec:function(){var n=this.range();if(this._state=n.hasFilter(),n.hasFilter())n.filter(!1);else{if(n.intersectingMerged().length)return{reason:"filterRangeContainingMerges"};n.filter(!0)}}});n.spreadsheet.SortCommand=t.extend({undo:function(){var n=this.range().sheet();n.setState(this._state)},exec:function(){var n=this.range(),t=n.sheet(),u=t.activeCell(),i=u.topLeft.col,r=this.options.asc;this._state=t.getState();this.options.sheet?this.expandRange().sort({column:i,ascending:r}):n.sort({column:i,ascending:r})},expandRange:function(){var t=this.range().sheet();return new n.spreadsheet.Range(t._sheetRef,t)}});e=n.spreadsheet.ApplyFilterCommand=t.extend({column:function(){return this.options.column||0},undo:function(){var n=this.range().sheet();n.clearFilter(this.column());this._state.length&&this.range().filter(this._state)},getState:function(){var t=this.range().sheet(),n=t.filter();n&&(this._state=n.columns.filter(function(n){return n.index==this.column()}.bind(this)))},exec:function(){var i=this.range(),r=this.column(),t;this.options.valueFilter?t=new n.spreadsheet.ValueFilter(this.options.valueFilter):this.options.customFilter&&(t=new n.spreadsheet.CustomFilter(this.options.customFilter));this.getState();i.clearFilter(r);i.filter({column:r,filter:t})}});n.spreadsheet.ClearFilterCommand=e.extend({exec:function(){var n=this.range(),t=this.column();this.getState();n.clearFilter(t)}});n.spreadsheet.HideLineCommand=t.extend({init:function(n){t.fn.init.call(this,n);this.axis=n.axis},undo:function(){var n=this.range().sheet();n.setAxisState(this._state)},exec:function(){var n=this.range().sheet();this._state=n.getAxisState();this.axis=="row"?n.axisManager().hideSelectedRows():n.axisManager().hideSelectedColumns()}});n.spreadsheet.UnHideLineCommand=n.spreadsheet.HideLineCommand.extend({exec:function(){var n=this.range().sheet();this._state=n.getAxisState();this.axis=="row"?n.axisManager().unhideSelectedRows():n.axisManager().unhideSelectedColumns()}});u=n.spreadsheet.DeleteCommand=t.extend({undo:function(){var n=this.range().sheet();n.setState(this._state)}});n.spreadsheet.DeleteRowCommand=u.extend({exec:function(){var n=this.range().sheet();this._state=n.getState();n.axisManager().deleteSelectedRows()}});n.spreadsheet.DeleteColumnCommand=u.extend({exec:function(){var n=this.range().sheet();this._state=n.getState();n.axisManager().deleteSelectedColumns()}});f=t.extend({init:function(n){t.fn.init.call(this,n);this._value=n.value},undo:function(){var n=this.range().sheet();n.setState(this._state)}});n.spreadsheet.AddColumnCommand=f.extend({exec:function(){var n=this.range().sheet();this._state=n.getState();this._value==="left"?n.axisManager().addColumnLeft():n.axisManager().addColumnRight()}});n.spreadsheet.AddRowCommand=f.extend({exec:function(){var n=this.range().sheet();if(!n.axisManager().canAddRow())return{reason:"error",type:"shiftingNonblankCells"};this._state=n.getState();this._value==="above"?n.axisManager().addRowAbove():n.axisManager().addRowBelow()}});n.spreadsheet.EditValidationCommand=t.extend({init:function(n){t.fn.init.call(this,n);this._value=n.value},exec:function(){this.range().validation(this._value)}});n.spreadsheet.SaveAsCommand=t.extend({exec:function(){this.options.workbook.saveAsExcel({fileName:this.options.fileName})}})}})(kendo)}(),function(){(function(n){if(!n.support.browser.msie||!(n.support.browser.version<9)){var i=n.jQuery,t=n.ui.Widget.extend({init:function(r,u){n.ui.Widget.call(this,r,u);r=this.element.addClass(t.classNames.wrapper);this.formulaInput=new n.spreadsheet.FormulaInput(i("<div/>").appendTo(r))},destroy:function(){this.formulaInput&&this.formulaInput.destroy();this.formulaInput=null}});n.spreadsheet.FormulaBar=t;i.extend(!0,t,{classNames:{wrapper:"k-spreadsheet-formula-bar"}})}})(window.kendo)}(),function(){(function(n,t){function s(n){return n=="("||n=="["||n=="{"}function a(n){return n==")"||n=="]"||n=="}"}function v(n,t){return t=="("?n==")":t=="["?n=="]":t=="{"?n=="}":!1}function r(n,t){return n.begin<=t.begin&&n.end>=t.end}function y(t){return n.spreadsheet.calc.runtime.FUNCS[t.toLowerCase()]}function p(n,t){return!n||!t?!1:n.type=="ref"&&t.type=="ref"?n.ref.eq(t.ref):n.value===t.value}if(!n.support.browser.msie||!(n.support.browser.version<9)){var u=n.jQuery,e=n.ui.Widget,o=".kendoFormulaInput",i=n.keys,h=["font-family","font-size","font-stretch","font-style","font-weight","letter-spacing","text-transform","line-height"],c={27:"esc",37:"left",39:"right",35:"end",36:"home",32:"spacebar"},l=/(^_|[^a-z0-9]$)/i,f=e.extend({init:function(n,t){if(e.call(this,n,t),n=this.element,n.addClass(f.classNames.wrapper).attr("contenteditable",!0).attr("spellcheck",!1),this.options.autoScale)n.on("input",this.scale.bind(this));this._highlightedRefs=[];this._staticTokens=[];this._formulaSource();this._formulaList();this._popup();this._tooltip();n.on("keydown",this._keydown.bind(this)).on("keyup",this._keyup.bind(this)).on("blur",this._blur.bind(this)).on("input click",this._input.bind(this)).on("focus",this._focus.bind(this))},options:{name:"FormulaInput",autoScale:!1,filterOperator:"startswith",scalePadding:30,minLength:1},events:["keyup"],getPos:function(){function f(n,t){try{(function i(r){if(r===n)throw t;else if(r.nodeType==1)for(var u=r.firstChild;u;u=u.nextSibling)i(u);else r.nodeType==3&&(t+=r.nodeValue.length)})(e)}catch(r){return r}}var e=this.element[0],r=t.getSelection(),n=f(r.focusNode,r.focusOffset),i=f(r.anchorNode,r.anchorOffset),u;if(n!=null&&i!=null)return n>i&&(u=n,n=i,i=u),{begin:n,end:i,collapsed:n==i}},setPos:function(n,i){function e(n,t){try{(function i(n){var u,r;if(n.nodeType==3){if(u=n.nodeValue.length,u>=t)throw n;t-=u}else if(n.nodeType==1)for(r=n.firstChild;r;r=r.nextSibling)i(r)})(n)}catch(r){return{node:r,pos:t}}}var f=this.element[0],r,u;n=e(f,n);i=i!=null?e(f,i):n;n&&i&&(r=document.createRange(),r.setStart(n.node,n.pos),r.setEnd(i.node,i.pos),u=t.getSelection(),u.removeAllRanges(),u.addRange(r))},end:function(){this.setPos(this.length())},home:function(){this.setPos(0)},length:function(){return this.value().length},_formulaSource:function(){var i=[],t;for(var r in n.spreadsheet.calc.runtime.FUNCS)l.test(r)||(t=r.toUpperCase(),i.push({value:t,text:t}));this.formulaSource=new n.data.DataSource({data:i})},_formulaList:function(){this.list=new n.ui.StaticList(u("<ul />").addClass(f.classNames.listWrapper).insertAfter(this.element),{autoBind:!1,selectable:!0,change:this._formulaListChange.bind(this),dataSource:this.formulaSource,dataValueField:"value",template:"#:data.value#"});this.list.element.on("mousedown",function(n){n.preventDefault()})},_formulaListChange:function(){var n=this._tokenContext();if(n&&!this._mute){var t=n.token,i=this.list.value()[0],r={replace:!0,token:t,end:t.end};n.nextToken&&n.nextToken.value=="("||(i+="(");this._replaceAt(r,i);this.popup.close()}},_popup:function(){this.popup=new n.ui.Popup(this.list.element,{anchor:this.element})},_blur:function(){this.popup.close();clearTimeout(this._focusId)},_isFormula:function(){return/^=/.test(this.value())},_keydown:function(n){var t=n.keyCode;c[t]?(this.popup.close(),this._navigated=!0):this._move(t)&&(this._navigated=!0,n.preventDefault());this._keyDownTimeout=setTimeout(this._syntaxHighlight.bind(this))},_keyup:function(){var n=this.popup,t;this._isFormula()&&!this._navigated&&(t=((this._tokenContext()||{}).token||{}).value,this.filter(t),t&&this.formulaSource.view().length?(n[n.visible()?"position":"open"](),this.list.focusFirst()):n.close());this._navigated=!1;this._syntaxHighlight();this.trigger("keyup")},_input:function(){this._syntaxHighlight()},_focus:function(){this._focusTimeout=setTimeout(this._syntaxHighlight.bind(this))},_move:function(n){var t=this.list,r=!1;return n===i.DOWN?(t.focusNext(),t.focus()||t.focusFirst(),r=!0):n===i.UP?(t.focusPrev(),t.focus()||t.focusLast(),r=!0):n===i.ENTER?(t.select(t.focus()),this.popup.close(),r=!0):n===i.TAB?(t.select(t.focus()),this.popup.close(),r=!0):n===i.PAGEUP?(t.focusFirst(),r=!0):n===i.PAGEDOWN&&(t.focusLast(),r=!0),r},_tokenContext:function(){var f=this.getPos(),e=this.value(),i,u,t;if(!e||!f||!f.collapsed)return null;for(i=n.spreadsheet.calc.tokenize(e),t=0;t<i.length;++t)if(u=i[t],r(u,f)&&/^(?:str|sym|func)$/.test(u.type))return{token:u,nextToken:i[t+1]};return null},_sync:function(){this._editorToSync&&this.isActive()&&this._editorToSync.value(this.value())},_textContainer:function(){var t=n.getComputedStyles(this.element[0],h);t.position="absolute";t.visibility="hidden";t.top=-3333;t.left=-3333;this._span=u("<span/>").css(t).insertAfter(this.element)},_tooltip:function(){this._cellTooltip=u('<div class="k-widget k-tooltip" style="position:absolute; display:none">A1<\/div>').insertAfter(this.element)},tooltip:function(n){this._cellTooltip.text(n)},toggleTooltip:function(n){this._cellTooltip.toggle(n)},isActive:function(){return this.element[0]===n._activeElement()},filter:function(n){!n||n.length<this.options.minLength||(this._mute=!0,this.list.select(-1),this._mute=!1,this.formulaSource.filter({field:this.list.options.dataValueField,operator:this.options.filterOperator,value:n}))},hide:function(){this.element.hide();this._cellTooltip.hide()},show:function(){this.element.show()},position:function(n){n&&(this.element.show().css({top:n.top+"px",left:n.left+"px"}),this._cellTooltip.css({top:n.top-this._cellTooltip.height()-10+"px",left:n.left}))},resize:function(n){n&&this.element.css({width:n.width+1,height:n.height+1})},canInsertRef:function(n){var i=this._canInsertRef(n),r=i&&i.token,t;if(r)for(t=0;t<this._staticTokens.length;t++)if(p(r,this._staticTokens[t]))return null;return i},_canInsertRef:function(t){function c(n){return n.begin>i.begin}function l(n){if(n){if(/^(?:num|str|bool|sym|ref)$/.test(n.type))return{replace:!0,token:n,end:n.end};if(/^(?:op|punc|startexp)$/.test(n.type))return n.end==i.end?o(n,f[u+1]):o(f[u-1],n)}}function o(n,t){if(n==null)return null;if(t==null)return/^(?:op|startexp)$/.test(n.type)||s(n.value)?{token:n,end:i.end}:null;if(h){if(n.type=="op"&&/^(?:punc|op)$/.test(t.type))return{token:n,end:i.end}}else{if(n.type=="startexp")return{token:n,end:i.end};if(/^(?:ref|op|punc)$/.test(n.type))return{token:n,end:i.end};if(/^(?:punc|op)$/.test(n.type))return/^[,;({]$/.test(n.value)?{token:n,end:i.end}:null}return!1}var h,i,f,e,u;if(this.popup.visible())return null;if(h=t,i=this.getPos(),i&&this._isFormula()){if(i.begin===0)return null;for(f=n.spreadsheet.calc.tokenize(this.value()),u=0;u<f.length;++u){if(e=f[u],r(e,i))return l(e);if(c(e))return o(f[u-1],e)}return o(e,null)}return null},refAtPoint:function(n){var t=this._canInsertRef();t&&this._replaceAt(t,n.simplify().toString())},_replaceAt:function(n,t){var i=this.value(),u=n.token,f=i.substr(n.end),r;i=i.substr(0,n.replace?u.begin:n.end)+t;r=i.length;i+=f;this._value(i);this.setPos(r);this.scale();this._syntaxHighlight();this._sync()},syncWith:function(n){var t="input"+o;this._editorToSync=n;this.element.off(t).on(t,this._sync.bind(this))},scale:function(){var n=this.element,t;this._span||this._textContainer();this._span.html(n.html());t=this._span.width()+this.options.scalePadding;t>n.width()&&n.width(t)},_value:function(n){this.element.text(n)},value:function(n){if(n===undefined)return this.element.text();this._value(n);this._syntaxHighlight()},highlightedRefs:function(){return this._highlightedRefs.slice()},_syntaxHighlight:function(){var t=this.getPos(),i=this.value(),e=n.spreadsheet.Pane.classNames.series,o=[],c=0,h=[],u=[],f;(!t||t.collapsed)&&(/^=/.test(i)?(u=n.spreadsheet.calc.tokenize(i),u.forEach(function(n){if(n.active=!1,n.cls=["k-syntax-"+n.type],n.type=="ref"&&(n.colorClass=e[c++%e.length],n.cls.push(n.colorClass),o.push(n)),t&&n.type=="punc")if(s(n.value))h.unshift(n);else if(a(n.value)){var i=h.shift();i?v(n.value,i.value)?(r(n,t)||r(i,t))&&(n.cls.push("k-syntax-paren-match"),i.cls.push("k-syntax-paren-match")):(n.cls.push("k-syntax-error"),i.cls.push("k-syntax-error")):n.cls.push("k-syntax-error")}t&&r(n,t)&&(n.cls.push("k-syntax-at-point"),n.active=!0,f=n);n.type!="func"||y(n.value)||t&&r(n,t)||n.cls.push("k-syntax-error")}),u.reverse().forEach(function(t){var r=t.begin,u=t.end,f=n.htmlEncode(i.substring(r,u));i=i.substr(0,r)+"<span class='"+t.cls.join(" ")+"'>"+f+"<\/span>"+i.substr(u)}),this.element.html(i)):(this.element.text(i),this.popup.close()),t&&this.setPos(t.begin,t.end),f&&/^(?:startexp|op|punc)$/.test(f.type)&&this._setStaticTokens(u),this._highlightedRefs=o)},_setStaticTokens:function(n){var t,i;for(this._staticTokens=[],t=0;t<n.length;t++)i=n[t],/^(?:num|str|bool|sym|ref)$/.test(i.type)&&this._staticTokens.push(i)},destroy:function(){this._editorToSync=null;this.element.off(o);clearTimeout(this._focusTimeout);clearTimeout(this._keyDownTimeout);this._cellTooltip=null;this._span=null;this.popup.destroy();this.popup=null;e.fn.destroy.call(this)}});n.spreadsheet.FormulaInput=f;u.extend(!0,f,{classNames:{wrapper:"k-spreadsheet-formula-input",listWrapper:"k-spreadsheet-formula-list"}})}})(kendo,window)}(),function(){(function(n){if(!n.support.browser.msie||!(n.support.browser.version<9)){var t=n.jQuery,i={8:"backspace",9:"tab",13:"enter",27:"esc",37:"left",38:"up",39:"right",40:"down",35:"end",36:"home",32:"spacebar",33:"pageup",34:"pagedown",46:"delete",113:":edit"},r=navigator.platform.toUpperCase().indexOf("MAC")>=0,u=function(n){return n>47&&n<58||n>64&&n<91||n>95&&n<112||n>185&&n<193||n>218&&n<223?!0:!1},f=function(n){var t=i[n];return!t&&u(n)&&(t=":alphanum"),t},e=n.Class.extend({init:function(n,i,r){this._handlers={};this.target=n;this._observer=i||window;this.keyDownProxy=this.keyDown.bind(this);this.mouseProxy=this.mouse.bind(this);this.threshold=5;this._pressLocation=null;n.on("keydown",this.keyDownProxy);n.on("contextmenu mousedown cut copy paste scroll wheel click dblclick focus",this.mouseProxy);t(document.documentElement).on("mousemove mouseup",this.mouseProxy);if(r)for(var u in r)this.on(u,r[u])},keyDown:function(n){this.handleEvent(n,f(n.keyCode))},mouse:function(n){var i,t;if(n.which?i=n.which==3:n.button&&(i=n.button==2),t=n.type,t==="mousedown"&&(i?t="rightmousedown":this._pressLocation={x:n.pageX,y:n.pageY}),t==="mouseup"&&(i||(this._pressLocation=null)),t==="mousemove"&&this._pressLocation){var r=this._pressLocation.x-n.pageX,u=this._pressLocation.y-n.pageY,f=Math.sqrt(r*r+u*u);f>this.threshold&&(t="mousedrag")}this.handleEvent(n,t)},handleEvent:function(n,t){var i="",u,f;n.mod=r?n.metaKey:n.ctrlKey;n.shiftKey&&(i+="shift+");n.ctrlKey&&(i+="ctrl+");i+=t;u=this._handlers["*+"+t];u&&u.call(this._observer,n,i);f=this._handlers[i];f&&f.call(this._observer,n,i)},on:function(n,t){var i=this._handlers;typeof t=="string"&&(t=this._observer[t]);typeof n=="string"&&(n=n.split(","));n.forEach(function(n){i[n]=t})},destroy:function(){this.target.off("keydown",this.keyDownProxy);this.target.off("keydown",this.mouseProxy);t(document.documentElement).off("mousemove mouseup",this.mouseProxy)}});n.spreadsheet.EventListener=e}})(window.kendo)}(),function(){(function(n){function v(n){return n}function u(n){if(n.left.level===n.level){var t=n;n=n.left;t.left=n.right;n.right=t}return n}function e(n){if(n.right.right.level===n.level){var t=n;n=n.right;t.right=n.left;n.left=t;n.level+=1}return n}function o(n,i){return n===t?new a(1,i,t,t):(n.value.start-i.start>0?n.left=o(n.left,i):n.right=o(n.right,i),e(u(n)))}function f(n,i){var o,r;if(n===t)return n;if(o=n.value.start-i.start,o===0)if(n.left!==t&&n.right!==t){for(r=n.left;r.right!==t;)r=r.right;n.value=r.value;n.left=f(n.left,n.value)}else n=n.left===t?n.right:n.left;else o>0?n.left=f(n.left,i):n.right=f(n.right,i);return(n.left.level<n.level-1||n.right.level<n.level-1)&&(n.level-=1,n.right.level>n.level&&(n.right.level=n.level),n=u(n),n.right=u(n.right),n.right.right=u(n.right.right),n=e(n),n.right=e(n.right)),n}function s(n,i){n!==t&&(s(n.left,i),i.push(n.value),s(n.right,i))}function h(n,i,r){if(n!==t){var u=n.value;i.start<u.start&&h(n.left,i,r);u.intersects(i)&&r.push(u);i.end>u.end&&h(n.right,i,r)}}function c(n,i,r){i!==t&&(c(n,i.left,r),n.insert(r(i.value)),c(n,i.right,r))}var a,t,i,r;if(!n.support.browser.msie||!(n.support.browser.version<9)){a=n.Class.extend({init:function(n,t,i,r){this.level=n;this.value=t;this.left=i;this.right=r}});t=new function(){this.left=this;this.right=this;this.level=0};i=n.Class.extend({init:function(n,t,i){this.start=n;this.end=t;this.value=i},intersects:function(n){return n.start<=this.end&&n.end>=this.start}});r=n.Class.extend({init:function(){this.root=t},insert:function(n){this.root=o(this.root,n)},remove:function(n){this.root=f(this.root,n)},findrange:function(n){for(var i=this.root;i!=t;)if(n<i.value.start)i=i.left;else if(n>i.value.end)i=i.right;else return i.value;return null},values:function(){var n=[];return s(this.root,n),n},intersecting:function(n,t){var r=[];return h(this.root,new i(n,t),r),r},map:function(n){var t=new r;return c(t,this.root,n),t},clone:function(){return this.map(v)},first:function(){for(var n=this.root;n.left!=t;)n=n.left;return n},last:function(){for(var n=this.root;n.right!=t;)n=n.right;return n}});var l=n.Class.extend({init:function(n,t,u){t===undefined?this.tree=n:(this.tree=new r,this.tree.insert(new i(n,t,u)))},values:function(){return this.tree.values()},map:function(n){return new l(this.tree.map(n))},intersecting:function(n,t){return this.tree.intersecting(n,t)},first:function(){return this.tree.first().value},last:function(){return this.tree.last().value},insert:function(n,t,r){return this.tree.insert(new i(n,t,r))},value:function(n,t,i){var r,u,f,e,l;if(i===undefined)return t===undefined&&(t=n),this.intersecting(n,t)[0].value;if(r=this.tree.intersecting(n-1,t+1),r.length)for(u=r[0],f=r[r.length-1],u.end<n&&(u.value===i?n=u.start:r.shift()),f.start>t&&(f.value===i?t=f.end:r.pop()),e=0,l=r.length;e<l;e++){var o=r[e],s=o.value,h=o.start,c=o.end;this.tree.remove(o);h<n&&(s!==i?this.insert(h,n-1,s):n=h);c>t&&(s!==i?this.insert(t+1,c,s):t=c)}this.insert(n,t,i)},expandedValues:function(n,t){for(var u=this.intersecting(n,t),f=[],r=0,i=n;i<=t;i++)u[r].end<i&&r++,f.push({index:i-n,value:u[r].value});return f},sortedIndices:function(n,t,i,r){var u=this.expandedValues(n,t),f=function(n,t){return n.value===t.value?n.index-t.index:i(n.value,t.value)};return r&&(f=function(n,t){var u=r[n.index],f=r[t.index];return u.value===f.value?i(n.value,t.value):n.index-t.index}),u.sort(f),u},sort:function(n,t,i){var u,r,f;if(this.intersecting(n,t).length!==1)for(u=this.expandedValues(n,t),r=0,f=i.length;r<f;r++)this.value(r+n,r+n,u[i[r].index].value)},copy:function(n,t,i){for(var f,e,u=this.intersecting(n,t),o=i,s,r=0,h=u.length;r<h;r++)f=u[r].start,f<n&&(f=n),e=u[r].end,e>t&&(e=t),s=o+(e-f),this.value(o,s,u[r].value),o=++s},iterator:function(n,t){return new y(n,t,this.intersecting(n,t))},getState:function(){return this.tree.clone()},setState:function(n){this.tree=n}}),y=n.Class.extend({init:function(n,t,i){this.start=n;this.end=t;this.index=0;this.ranges=i},unique:function(){return this.ranges.map(function(n){return n.value})},at:function(n){while(this.ranges[this.index].end<n)this.index++;return this.ranges[this.index].value},forEach:function(n){for(var t=this.start;t<=this.end;t++)n(this.at(t),t);this.index=0}}),p=l.extend({init:function(n,t,u){this.tree=new r;this.range=new i(n,t,u)},intersecting:function(n,t){var e=this.tree.intersecting(n,t),u=[],r,f,o;if(!e.length)return[this.range];for(f=0,o=e.length;f<o;f++)r=e[f],r.start>n&&u.push(new i(n,r.start-1,this.range.value)),u.push(r),n=r.end+1;return r.end<t&&u.push(new i(r.end+1,t,this.range.value)),u},insert:function(n,t,r){r!==this.range.value&&this.tree.insert(new i(n,t,r))},lastRangeStart:function(){var n=this.tree.root;if(n===t)return this.range.start;while(n.right!==t)n=n.right;return n.value.end+1}});n.spreadsheet.RangeTree=r;n.spreadsheet.RangeList=l;n.spreadsheet.SparseRangeList=p;n.spreadsheet.ValueRange=i}})(kendo)}(),function(){(function(n){function f(n){return n.replace(/M/g,"m").replace(/'/g,'"').replace(/tt/,"am/pm")}if(!n.support.browser.msie||!(n.support.browser.version<9)){var r=n.jQuery,t=n.Class.extend({init:function(n){this.list=n},get:function(n){return this.parse(this.list.value(n,n))},set:function(n,t,i){i===undefined&&(i=t,t=n);this.list.value(n,t,i)},parse:function(n){return n},copy:function(n,t,i){this.list.copy(n,t,i)},iterator:function(n,t){return this.list.iterator(n,t)}}),i=t.extend({set:function(n,t,i){this.list.value(n,t,JSON.stringify(i))},parse:function(n){return JSON.parse(n)}}),u=t.extend({init:function(n,i,r){t.prototype.init.call(this,n);this.validations=r;this.formats=i},set:function(t,i,r){r instanceof Date&&(r=n.spreadsheet.dateToNumber(r),this.formats.value(t,i,f(n.culture().calendar.patterns.d)));this.list.value(t,i,r)}});n.spreadsheet.PropertyBag=n.Class.extend({specs:[{property:u,name:"value",value:null,sortable:!0,serializable:!0,depends:"format"},{property:t,name:"format",value:null,sortable:!0,serializable:!0},{property:t,name:"formula",value:null,sortable:!0,serializable:!0},{property:t,name:"background",value:null,sortable:!0,serializable:!0},{property:i,name:"borderBottom",value:null,sortable:!1,serializable:!0},{property:i,name:"borderRight",value:null,sortable:!1,serializable:!0},{property:i,name:"borderLeft",value:null,sortable:!1,serializable:!0},{property:i,name:"borderTop",value:null,sortable:!1,serializable:!0},{property:t,name:"color",value:null,sortable:!0,serializable:!0},{property:t,name:"fontFamily",value:null,sortable:!0,serializable:!0},{property:t,name:"underline",value:null,sortable:!0,serializable:!0},{property:t,name:"fontSize",value:null,sortable:!0,serializable:!0},{property:t,name:"italic",value:null,sortable:!0,serializable:!0},{property:t,name:"bold",value:null,sortable:!0,serializable:!0},{property:t,name:"textAlign",value:null,sortable:!0,serializable:!0},{property:t,name:"verticalAlign",value:null,sortable:!0,serializable:!0},{property:t,name:"wrap",value:null,sortable:!0,serializable:!0},{property:t,name:"validation",value:null,sortable:!1,serializable:!0}],init:function(t){this.properties={};this.lists={};this.specs.forEach(function(i){this.lists[i.name]=new n.spreadsheet.SparseRangeList(0,t,i.value)},this);this.specs.forEach(function(n){this.properties[n.name]=new n.property(this.lists[n.name],this.lists[n.depends])},this)},getState:function(){var n={};return this.specs.forEach(function(t){n[t.name]=this.lists[t.name].getState()},this),n},setState:function(n){this.specs.forEach(function(t){this.lists[t.name].setState(n[t.name])},this)},get:function(n,t){return t===undefined?this.lists[n]:this.properties[n].get(t)},set:function(n,t,i,r){this.properties[n].set(t,i,r)},fromJSON:function(n,t){for(var i,r=0;r<this.specs.length;r++)i=this.specs[r],i.serializable&&t[i.name]!==undefined&&this.set(i.name,n,n,t[i.name],!1)},copy:function(n,t,i){this.specs.forEach(function(r){this.properties[r.name].copy(n,t,i)},this)},iterator:function(n,t,i){return this.properties[n].iterator(t,i)},sortable:function(){return this.specs.filter(function(n){return n.sortable}).map(function(n){return this.lists[n.name]},this)},iterators:function(n,t){var i=this.specs.filter(function(n){return n.serializable});return i.map(function(i){var r=this.iterator(i.name,n,t);return{name:i.name,value:i.value,at:function(n){return i.property.fn.parse(r.at(n))}}},this)},forEach:function(n,t,i){for(var e,r,u,o,s=this.iterators(n,t),f=n;f<=t;f++){for(e={},r=0;r<s.length;r++)u=s[r],o=u.at(f),o!==u.value&&(e[u.name]=o);i(e)}},forEachProperty:function(n){for(var t in this.properties)n(this.properties[t])}});n.spreadsheet.ALL_PROPERTIES=r.map(n.spreadsheet.PropertyBag.prototype.specs,function(n){return n.name})}})(window.kendo)}(),function(){"use strict";function s(n){var t=Math.floor(n/26)-1;return(t>=0?s(t):"")+String.fromCharCode(65+n%26)}function e(n,t,i,r){var u="";return++t,isFinite(t)?r==null||r&2||(t="$"+t):t="",isFinite(i)?(u=s(i),r==null||r&1||(u="$"+u)):i="",n?n+"!"+u+t:u+t}var u,o,f;if(!kendo.support.browser.msie||!(kendo.support.browser.version<9)){u=kendo.spreadsheet;o=kendo.Class;f=o.extend({type:"ref",hasSheet:function(){return this._hasSheet},simplify:function(){return this},setSheet:function(n,t){return this.sheet=n,t!=null&&(this._hasSheet=t),this},absolute:function(){return this},relative:function(){return this},adjust:function(){return this},toString:function(){return this.relative(0,0,3,3).print(0,0)},forEach:function(n,t){n.call(t,this)},map:function(n,t){return n.call(t,this)},intersects:function(n){return this.intersect(n)!==i},isCell:function(){return!1},toColumn:function(){return this},first:function(){return this},lastRange:function(){return this},size:function(){return 1},rangeAt:function(){return this},nextRangeIndex:function(){return 0},previousRangeIndex:function(){return 0},eq:function(u){var e=this,f=u,s,h,o,c;if(e===i||f===i)return e===f;if((f instanceof n||f instanceof t&&!(e instanceof n))&&(e=u,f=this),e instanceof n)return f=f.simplify(),f instanceof n&&e.row==f.row&&e.col==f.col&&e.sheet==f.sheet;if(e instanceof t){if(f instanceof t)return f.topLeft.eq(e.topLeft)&&f.bottomRight.eq(e.bottomRight);if(f instanceof r)return f.single()&&e.eq(f.refs[0])}else if(e instanceof r&&f instanceof r){if(s=e.refs,h=f.refs,s.length!=h.length)return!1;for(o=0,c=s.length;o<c;o++)if(!s[o].eq(h[o]))return!1;return!0}return e===f},concat:function(n){return new r([this,n])},replaceAt:function(n,t){return t},forEachColumnIndex:function(n){this.forEachAxisIndex("col",n)},forEachRowIndex:function(n){this.forEachAxisIndex("row",n)},forEachAxisIndex:function(n,t){var i=[],r=n==="row"?"forEachRow":"forEachColumn";this[r](function(t){var r=t.first()[n];i.indexOf(r)===-1&&i.push(r)});i.sort(function(n,t){return n>t?1:n<t?-1:0}).forEach(t)}});f.display=e;var i=new(f.extend({init:function(){},print:function(){return"#NULL!"},clone:function(){return this},eq:function(n){return n===this},forEach:function(){}})),h=f.extend({ref:"name",init:function(n){this.name=n},print:function(){var n=this.name;return this.hasSheet()&&(n=this.sheet+"!"+n),n}}),n=f.extend({ref:"cell",init:function(n,t,i){this.row=n;this.col=t;this.rel=i||0},clone:function(){return new n(this.row,this.col,this.rel).setSheet(this.sheet,this.hasSheet())},intersect:function(t){return t instanceof n?this.eq(t)?this:i:t.intersect(this)},print:function(n,t){var i=this.col,r=this.row,u=this.rel;return n==null?(i=isFinite(i)?u&1?"C["+i+"]":"C"+(i+1):"",r=isFinite(r)?u&2?"R["+r+"]":"R"+(r+1):"",r+i):(u&1&&(i+=t),u&2&&(r+=n),isFinite(i)&&i<0||isFinite(r)&&r<0)?"#REF!":e(this._hasSheet&&this.sheet,r,i,u)},absolute:function(n,t){var i=this.clone();return i.rel&!1?i:(i.rel&1&&(i.col+=t),i.rel&2&&(i.row+=n),i.rel=0,i)},toRangeRef:function(){return new t(this,this)},relative:function(t,i,r){r==null&&(r=this.rel);var u=r&2?this.row-t:this.row,f=r&1?this.col-i:this.col;return new n(u,f,r).setSheet(this.sheet,this.hasSheet())},height:function(){return 1},width:function(){return 1},toString:function(){return e(null,this.row,this.col,3)},isCell:function(){return!0},leftColumn:function(){return this},rightColumn:function(){return this},topRow:function(){return this},bottomRow:function(){return this},forEachRow:function(n){n(this.toRangeRef())},forEachColumn:function(n){n(this.toRangeRef())},adjust:function(n,t,r,u,f,e,o){var s=this.absolute(n,t);if(f){if(s.row>=e){if(o<0&&s.row<e-o)return i;s.row+=o}}else if(s.col>=e){if(o<0&&s.col<e-o)return i;s.col+=o}return r!=null&&u!=null&&(s=s.relative(r,u,this.rel)),s}}),t=f.extend({ref:"range",init:function(t,i){t._hasSheet&&i._hasSheet&&t.sheet.toLowerCase()!=i.sheet.toLowerCase()&&(this.endSheet=i.sheet);this.topLeft=new n(t.row,t.col,t.rel);this.bottomRight=new n(i.row,i.col,i.rel);this.normalize()},clone:function(){return new t(this.topLeft.clone(),this.bottomRight.clone()).setSheet(this.sheet,this.hasSheet())},_containsRange:function(n){return this._containsCell(n.topLeft)&&this._containsCell(n.bottomRight)},_containsCell:function(n){return n.sheet==this.sheet&&n.row>=this.topLeft.row&&n.col>=this.topLeft.col&&n.row<=this.bottomRight.row&&n.col<=this.bottomRight.col},contains:function(i){if(i instanceof Array){var r=this;return i.some(function(n){return r.contains(n)})}return i instanceof n?this._containsCell(i):i instanceof t?this._containsRange(i):!1},_intersectRange:function(r){if(this.sheet!=r.sheet)return i;var u=this.topLeft.col,f=this.topLeft.row,e=this.bottomRight.col,o=this.bottomRight.row,s=r.topLeft.col,h=r.topLeft.row,c=r.bottomRight.col,l=r.bottomRight.row;return u<=c&&s<=e&&f<=l&&h<=o?new t(new n(Math.max(f,h),Math.max(u,s)),new n(Math.min(o,l),Math.min(e,c))).setSheet(this.sheet,this.hasSheet()):i},intersect:function(u){if(u===i)return u;if(u instanceof n)return this._containsCell(u)?u:i;if(u instanceof t)return this._intersectRange(u).simplify();if(u instanceof r)return u.intersect(this);throw new Error("Unknown reference");},simplify:function(){return this.isCell()?new n(this.topLeft.row,this.topLeft.col,this.topLeft.rel).setSheet(this.sheet,this.hasSheet()):this},normalize:function(){var i=this.topLeft,r=this.bottomRight,u=i.row,f=i.col,e=r.row,o=r.col,s=i.rel&2,h=i.rel&1,c=r.rel&2,l=r.rel&1,t,a=!1;return u>e&&(a=!0,t=u,u=e,e=t,t=s,s=c,c=t),f>o&&(a=!0,t=f,f=o,o=t,t=h,h=l,l=t),a&&(this.topLeft=new n(u,f,h|s),this.bottomRight=new n(e,o,l|c)),this},print:function(n,t){var i=this.topLeft.print(n,t)+":"+this.bottomRight.print(n,t);return this.hasSheet()&&(i=this.sheet+"!"+i),i},absolute:function(n,i){return new t(this.topLeft.absolute(n,i),this.bottomRight.absolute(n,i)).setSheet(this.sheet,this.hasSheet())},relative:function(n,i,r,u){return u==null&&(u=r),new t(this.topLeft.relative(n,i,r),this.bottomRight.relative(n,i,u)).setSheet(this.sheet,this.hasSheet())},height:function(){if(this.topLeft.rel!=this.bottomRight.rel)throw new Error("Mixed relative/absolute references");return this.bottomRight.row-this.topLeft.row+1},width:function(){if(this.topLeft.rel!=this.bottomRight.rel)throw new Error("Mixed relative/absolute references");return this.bottomRight.col-this.topLeft.col+1},collapse:function(){return this.topLeft.toRangeRef()},leftColumn:function(){return new t(this.topLeft,new n(this.bottomRight.row,this.topLeft.col))},rightColumn:function(){return new t(new n(this.topLeft.row,this.bottomRight.col),this.bottomRight)},topRow:function(){return new t(this.topLeft,new n(this.topLeft.row,this.bottomRight.col))},bottomRow:function(){return new t(new n(this.bottomRight.row,this.topLeft.col),this.bottomRight)},toRangeRef:function(){return this},toColumn:function(i){return new t(new n(this.topLeft.row,this.topLeft.col+i),new n(this.bottomRight.row,this.topLeft.col+i))},forEachRow:function(i){for(var u=this.topLeft.row,f=this.bottomRight.row,e=this.topLeft.col,o=this.bottomRight.col,r=u;r<=f;r++)i(new t(new n(r,e),new n(r,o)))},forEachColumn:function(i){for(var u=this.topLeft.row,f=this.bottomRight.row,e=this.topLeft.col,o=this.bottomRight.col,r=e;r<=o;r++)i(new t(new n(u,r),new n(f,r)))},intersecting:function(n){return n.filter(function(n){return n.toRangeRef().intersects(this)},this)},union:function(i,r){var c=this.intersecting(i),f=this.topLeft.row,e=this.topLeft.col,o=this.bottomRight.row,s=this.bottomRight.col,u=!1,h;return c.forEach(function(n){n=n.toRangeRef();n.topLeft.row<f&&(u=!0,f=n.topLeft.row);n.topLeft.col<e&&(u=!0,e=n.topLeft.col);n.bottomRight.row>o&&(u=!0,o=n.bottomRight.row);n.bottomRight.col>s&&(u=!0,s=n.bottomRight.col);r&&r(n)}),h=new t(new n(f,e),new n(o,s)),u?h.union(i,r):h},resize:function(r){function f(n){return n||0}var u=Math.max.bind(Math,0),e=this.topLeft.row+f(r.top),o=this.topLeft.col+f(r.left),s=this.bottomRight.row+f(r.bottom),h=this.bottomRight.col+f(r.right);return o<0&&h<0||e<0&&s<0?i:e<=s&&o<=h?new t(new n(u(e),u(o)),new n(u(s),u(h))):i},move:function(i,r){return new t(new n(this.topLeft.row+i,this.topLeft.col+r),new n(this.bottomRight.row+i,this.bottomRight.col+r))},first:function(){return this.topLeft},isCell:function(){return!this.endSheet&&this.topLeft.eq(this.bottomRight)},toString:function(){return this.topLeft+":"+this.bottomRight},adjust:function(n,r,u,f,e,o,s){var h=this.topLeft.adjust(n,r,u,f,e,o,s),c=this.bottomRight.adjust(n,r,u,f,e,o,s);return h===i&&c===i?i:(h===i?(h=this.topLeft.absolute(n,r),e?h.row=o:h.col=o,u!=null&&f!=null&&(h=h.relative(u,f,this.topLeft.rel))):c===i&&(c=this.bottomRight.absolute(n,r),e?c.row=o-1:c.col=o-1,u!=null&&f!=null&&(c=c.relative(u,f,this.bottomRight.rel))),new t(h,c).setSheet(this.sheet,this.hasSheet()).simplify())}}),r=f.extend({init:function(n){this.refs=n;this.length=this.refs.length},intersect:function(n){for(var f,t=[],u=0;u<this.length;++u)f=n.intersect(this.refs[u]),f!==i&&t.push(f);return t.length>0?new r(t).simplify():i},simplify:function(){var n=new r(this.refs.reduce(function(n,t){return t=t.simplify(),t!==i&&n.push(t),n},[]));return n.empty()?i:n.single()?n.refs[0]:n},absolute:function(n,t){return new r(this.refs.map(function(i){return i.absolute(n,t)}))},forEach:function(n,t){this.refs.forEach(n,t)},toRangeRef:function(){return this.refs[0].toRangeRef()},contains:function(n){return this.refs.some(function(t){return t.contains(n)})},map:function(n,t){return new r(this.refs.map(n,t))},first:function(){return this.refs[0].first()},lastRange:function(){return this.refs[this.length-1]},size:function(){return this.length},single:function(){return this.length==1},empty:function(){return this.length===0},isCell:function(){return this.single()&&this.refs[0].isCell()},rangeAt:function(n){return this.refs[n]},nextRangeIndex:function(n){return n===this.length-1?0:n+1},previousRangeIndex:function(n){return n===0?this.length-1:n-1},concat:function(n){return new r(this.refs.concat([n]))},print:function(){return this.refs.map(function(n){return n.print()}).join(",")},replaceAt:function(n,t){var i=this.refs.slice();return i.splice(n,1,t),new r(i)},leftColumn:function(){return this.map(function(n){return n.leftColumn()})},rightColumn:function(){return this.map(function(n){return n.rightColumn()})},topRow:function(){return this.map(function(n){return n.topRow()})},bottomRow:function(){return this.map(function(n){return n.bottomRow()})},forEachRow:function(n){this.forEach(function(t){t.forEachRow(n)})},forEachColumn:function(n){this.forEach(function(t){t.forEachColumn(n)})},adjust:function(n,t,i,r,u,f,e){return this.map(function(o){return o.adjust(n,t,i,r,u,f,e)}).simplify()},toString:function(){return this.refs.map(function(n){return n.toString()}).join(", ")}});u.NULLREF=i;u.SHEETREF=new t(new n(0,0),new n(Infinity,Infinity));u.FIRSTREF=new n(0,0);u.Ref=f;u.NameRef=h;u.CellRef=n;u.RangeRef=t;u.UnionRef=r;u.SHEETREF.print=function(){return"#SHEET"}}}(),function(){(function(n){if(!n.support.browser.msie||!(n.support.browser.version<9)){var i=n.spreadsheet.RangeRef,t=n.spreadsheet.CellRef,r=n.Class.extend({init:function(n){this._grid=n},rectIsVertical:function(n,t,i,r){var u=this._grid.rectangle(n.toRangeRef()),f=this._grid.rectangle(t.toRangeRef());return Math.abs(f[r]-u[r])>Math.abs(u[i]-f[i])},autoFillDest:function(n,r){var u=n.topLeft,f=n.bottomRight,h,y=r.row>=u.row,c=r.col>=u.col,o,e,s,l,a,v;return h=y?c?4:3:c?2:1,h===4?(o=u,e=f,l=r.row>e.row||r.col>e.col,l&&(r=new t(Math.max(r.row,e.row),Math.max(r.col,e.col))),s=this.rectIsVertical(e,r,"right","bottom")?new t(r.row,e.col):new t(e.row,r.col)):h===3?(a=new t(u.col,f.row),r.row>f.row&&this.rectIsVertical(a,r,"left","bottom")?(o=u,s=new t(r.row,f.col)):(o=f,s=new t(u.row,r.col))):h===2?(v=new t(u.row,f.col),r.col>f.col&&!this.rectIsVertical(v,r,"right","top")?(o=u,s=new t(f.row,r.col)):(o=f,s=new t(r.row,u.col))):(o=f,s=this.rectIsVertical(u,r,"left","top")?new t(r.row,u.col):new t(u.row,r.col)),this._grid.normalize(new i(o,s))}});n.spreadsheet.AutoFillCalculator=r}})(kendo)}(),function(){(function(n){if(!n.support.browser.msie||!(n.support.browser.version<9)){var i=n.spreadsheet.RangeRef,t=n.spreadsheet.CellRef,r=n.Class.extend({init:function(n,t,i,r){this.rangeGetter=i;this.prevLeft=function(i){var u=r(this.range(i)),f=this.range(t.prevVisible(u.topLeft[n]));return r(f).topLeft[n]};this.nextRight=function(i){var u=r(this.range(i)),f=this.range(t.nextVisible(u.bottomRight[n]));return r(f).bottomRight[n]};this.nextLeft=function(i){var u=r(this.range(i));return t.nextVisible(u.bottomRight[n])};this.prevRight=function(i){var u=r(this.range(i));return t.prevVisible(u.topLeft[n])}},boundary:function(n,t){this.top=n;this.bottom=t},range:function(n){return this.rangeGetter(n,this.top,this.bottom)}}),u=n.Class.extend({init:function(t){this._sheet=t;this.columns=this._sheet._grid._columns;this.autoFillCalculator=new n.spreadsheet.AutoFillCalculator(t._grid);this.colEdge=new r("col",this._sheet._grid._columns,this.columnRange.bind(this),this.union.bind(this));this.rowEdge=new r("row",this._sheet._grid._rows,this.rowRange.bind(this),this.union.bind(this))},height:function(n){this._viewPortHeight=n},union:function(n){return this._sheet.unionWithMerged(n)},columnRange:function(n,t,i){return this._sheet._ref(t,n,i-t,1)},rowRange:function(n,t,i){return this._sheet._ref(n,t,1,i-t)},selectionIncludesMergedCells:function(){return this._sheet.select().contains(this._sheet._mergedCells)},setSelectionValue:function(n){var t=this._sheet.selection();setTimeout(function(){t.value(n())})},selectAll:function(){this._sheet.select(this._sheet._sheetRef)},select:function(n,t,i){n=this.refForMode(n,t);i&&(n=this._sheet.select().concat(n));this._sheet.select(n)},refForMode:function(n,t){var i=this._sheet._grid;switch(t){case"range":n=i.normalize(n);break;case"row":n=i.rowRef(n.row);break;case"column":n=i.colRef(n.col);break;case"sheet":n=this._sheet._sheetRef}return n},startSelection:function(n,t,i){t=="autofill"?this._sheet.startAutoFill():(this._sheet.startSelection(),this.select(n,t,i))},completeSelection:function(){this._sheet.completeSelection()},selectForContextMenu:function(n,t){var i=this._sheet;i.select().contains(this.refForMode(n,t))||this.select(n,t)},modifySelection:function(n){var a=this.determineDirection(n),o=this._sheet,s=this._viewPortHeight,f=o._grid._rows,h=o._grid._columns,v=o.currentOriginalSelectionRange(),c=o.select().toRangeRef(),e=o.activeCell(),t=v.topLeft.clone(),r=v.bottomRight.clone(),u,l;this.colEdge.boundary(c.topLeft.row,c.bottomRight.row);this.rowEdge.boundary(c.topLeft.col,c.bottomRight.col);switch(a){case"expand-left":t.col=this.colEdge.prevLeft(t.col);u=t;break;case"shrink-right":t.col=this.colEdge.nextLeft(t.col);u=t;break;case"expand-right":r.col=this.colEdge.nextRight(r.col);u=r;break;case"shrink-left":r.col=this.colEdge.prevRight(r.col);u=r;break;case"expand-up":t.row=this.rowEdge.prevLeft(t.row);u=t;break;case"shrink-down":t.row=this.rowEdge.nextLeft(t.row);u=t;break;case"expand-down":r.row=this.rowEdge.nextRight(r.row);u=r;break;case"shrink-up":r.row=this.rowEdge.prevRight(r.row);u=r;break;case"expand-page-up":t.row=f.prevPage(t.row,s);break;case"shrink-page-up":r.row=f.prevPage(r.row,s);break;case"expand-page-down":r.row=f.nextPage(r.row,s);break;case"shrink-page-down":t.row=f.nextPage(t.row,s);break;case"first-col":t.col=h.firstVisible();r.col=e.bottomRight.col;u=t;break;case"last-col":r.col=h.lastVisible();t.col=e.topLeft.col;u=r;break;case"first-row":t.row=f.firstVisible();r.row=e.bottomRight.row;u=t;break;case"last-row":r.row=f.lastVisible();t.row=e.topLeft.row;u=r;break;case"last":r.row=f.lastVisible();r.col=h.lastVisible();t=e.topLeft;u=r;break;case"first":t.row=f.firstVisible();t.col=h.firstVisible();r=e.bottomRight;u=t}if(l=new i(t,r),!this.union(l).intersects(e)){this.modifySelection(a.replace("shrink","expand"));return}u&&o.focus(u);this.updateCurrentSelectionRange(l)},moveActiveCell:function(n){var e=this._sheet,s=e.activeCell(),h=s.topLeft,o=s.bottomRight,c=e.originalActiveCell(),r=e._grid._rows,f=e._grid._columns,i=c.row,u=c.col;switch(n){case"left":u=f.prevVisible(h.col);break;case"up":i=r.prevVisible(h.row);break;case"right":u=f.nextVisible(o.col);break;case"down":i=r.nextVisible(o.row);break;case"first-col":u=f.firstVisible();break;case"last-col":u=f.lastVisible();break;case"first-row":i=r.firstVisible();break;case"last-row":i=r.lastVisible();break;case"last":i=r.lastVisible();u=f.lastVisible();break;case"first":i=r.firstVisible();u=f.firstVisible();break;case"next-page":i=r.nextPage(o.row,this._viewPortHeight);break;case"prev-page":i=r.prevPage(o.row,this._viewPortHeight)}e.select(new t(i,u))},navigateInSelection:function(n){for(var f=this._sheet,w=f.activeCell(),v=w.topLeft,y=f.originalActiveCell(),h=f._grid._rows,c=f._grid._columns,i=y.row,r=y.col,u=f.currentNavigationRange(),e=u.topLeft,o=u.bottomRight,p=!1,l=v.col,a=v.row,s;!p;){s=new t(i,r);switch(n){case"next":o.eq(s)?(u=f.nextNavigationRange(),i=u.topLeft.row,r=u.topLeft.col):(r=c.nextVisible(l,!0),r>o.col&&(r=e.col,i=h.nextVisible(i,!0)));break;case"previous":e.eq(s)?(u=f.previousNavigationRange(),i=u.bottomRight.row,r=u.bottomRight.col):(r=c.prevVisible(l,!0),r<e.col&&(r=o.col,i=h.prevVisible(i,!0)));break;case"lower":o.eq(s)?(u=f.nextNavigationRange(),i=u.topLeft.row,r=u.topLeft.col):(i=h.nextVisible(a,!0),i>o.row&&(i=e.row,r=c.nextVisible(r,!0)));break;case"upper":e.eq(s)?(u=f.previousNavigationRange(),i=u.bottomRight.row,r=u.bottomRight.col):(i=h.prevVisible(a,!0),i<e.row&&(i=o.row,r=c.prevVisible(r,!0)));break;default:throw new Error("Unknown entry navigation: "+n);}p=!this.shouldSkip(i,r);l=r;a=i}f.singleCellSelection()?f.select(new t(i,r)):f.activeCell(new t(i,r))},extendSelection:function(n,t){var u=this._sheet,r=u._grid,f;if(t==="autofill"){this.resizeAutoFill(n);return}t==="range"?n=r.normalize(n):t==="row"?n=r.rowRef(n.row).bottomRight:t==="column"&&(n=r.colRef(n.col).bottomRight);f=u.originalActiveCell().toRangeRef();this.updateCurrentSelectionRange(new i(f.topLeft,n))},shouldSkip:function(n,i){var r=new t(n,i),u=!1;return this._sheet.forEachMergedCell(function(n){n.intersects(r)&&!n.collapse().eq(r)&&(u=!0)}),u},resizeAutoFill:function(n){var u=this._sheet,s=u.select(),c=u._autoFillOrigin,o=this.autoFillCalculator.autoFillDest(s,n),h=this.punch(s,o),f,i,t,e,r;h||(e=u.range(o)._previewFillFrom(u.range(c)),e&&(i=e.direction,r=e.props,i===0||i==1?(t=r[r.length-1],f=t[t.length-1].value):i===2?(t=r[0],f=t[t.length-1].value):i===3&&(t=r[r.length-1],f=t[0].value)));u.updateAutoFill(o,h,f,i)},determineDirection:function(n){var t=this._sheet.currentSelectionRange(),i=this._sheet.activeCell(),f=i.topLeft.col==t.topLeft.col,e=i.bottomRight.col==t.bottomRight.col,r=i.topLeft.row==t.topLeft.row,u=i.bottomRight.row==t.bottomRight.row;switch(n){case"left":n=e?"expand-left":"shrink-left";break;case"right":n=f?"expand-right":"shrink-right";break;case"up":n=u?"expand-up":"shrink-up";break;case"down":n=r?"expand-down":"shrink-down";break;case"prev-page":n=u?"expand-page-up":"shrink-page-up";break;case"next-page":n=r?"expand-page-down":"shrink-page-down"}return n},updateCurrentSelectionRange:function(n){var t=this._sheet;t.select(t.originalSelect().replaceAt(t.selectionRangeIndex(),n),!1)},punch:function(n,r){var u,f,e;return r.topLeft.eq(n.topLeft)&&(r.bottomRight.row<n.bottomRight.row?(f=this.rowEdge.nextRight(r.bottomRight.row),u=new i(new t(f,n.topLeft.col),n.bottomRight)):r.bottomRight.col<n.bottomRight.col&&(e=this.colEdge.nextRight(r.bottomRight.col),u=new i(new t(n.topLeft.row,e),n.bottomRight))),u}});n.spreadsheet.SheetNavigator=u}})(kendo)}(),function(){(function(n){if(!n.support.browser.msie||!(n.support.browser.version<9)){var t=n.Class.extend({init:function(n){this._sheet=n},forEachSelectedColumn:function(n){var t=this._sheet;t.batch(function(){t.select().forEachColumnIndex(function(i,r){n(t,i,r)})},{layout:!0,recalc:!0})},forEachSelectedRow:function(n){var t=this._sheet;t.batch(function(){t.select().forEachRowIndex(function(i,r){n(t,i,r)})},{layout:!0,recalc:!0})},includesHiddenColumns:function(n){return this._sheet._grid._columns.includesHidden(n.topLeft.col,n.bottomRight.col)},includesHiddenRows:function(n){return this._sheet._grid._rows.includesHidden(n.topLeft.row,n.bottomRight.row)},selectionIncludesHiddenColumns:function(){return this.includesHiddenColumns(this._sheet.select())},selectionIncludesHiddenRows:function(){return this.includesHiddenRows(this._sheet.select())},deleteSelectedColumns:function(){this.forEachSelectedColumn(function(n,t,i){n.deleteColumn(t-i)})},deleteSelectedRows:function(){this.forEachSelectedRow(function(n,t,i){n.deleteRow(t-i)})},hideSelectedColumns:function(){this.forEachSelectedColumn(function(n,t){n.hideColumn(t)})},hideSelectedRows:function(){this.forEachSelectedRow(function(n,t){n.hideRow(t)})},unhideSelectedColumns:function(){this.forEachSelectedColumn(function(n,t){n.unhideColumn(t)})},unhideSelectedRows:function(){this.forEachSelectedRow(function(n,t){n.unhideRow(t)})},addColumnLeft:function(){this.forEachSelectedColumn(function(n,t,i){n.insertColumn(t-i)})},addColumnRight:function(){this.forEachSelectedColumn(function(n,t,i){n.insertColumn(t+(i+1))})},canAddRow:function(){var n=this._sheet.select().toRangeRef(),t=n.height();return this._sheet.canInsertRow(0,t)},addRowAbove:function(){this.forEachSelectedRow(function(n,t,i){n.insertRow(t-i)})},addRowBelow:function(){this.forEachSelectedRow(function(n,t,i){n.insertRow(t+(i+1))})}});n.spreadsheet.AxisManager=t}})(kendo)}(),function(){(function(n){if(!n.support.browser.msie||!(n.support.browser.version<9)){var t=n.jQuery,r=n.spreadsheet.RangeRef,i=n.spreadsheet.CellRef,u=n.Class.extend({init:function(t){this.workbook=t;this.origin=n.spreadsheet.NULLREF;this.iframe=document.createElement("iframe");this.iframe.className="k-spreadsheet-clipboard-paste";this.menuInvoked=!0;this._external={};this._uid=n.guid();document.body.appendChild(this.iframe)},canCopy:function(){var t={canCopy:!0},i=this.workbook.activeSheet().select();return i===n.spreadsheet.NULLREF&&(t.canCopy=!1),i instanceof n.spreadsheet.UnionRef&&(t.canCopy=!1,t.multiSelection=!0),this.menuInvoked&&(t.canCopy=!1,t.menuInvoked=!0),t},canPaste:function(){var u=this.workbook.activeSheet(),i=this.pasteRef(),t={canPaste:!0},r;return i===n.spreadsheet.NULLREF?(r=this._external.hasOwnProperty("html")||this._external.hasOwnProperty("plain"),t.pasteOnMerged=this.intersectsMerged(),t.canPaste=t.pasteOnMerged?!1:r,t):(i.eq(u.unionWithMerged(i))||(t.canPaste=!1,t.pasteOnMerged=!0),this.menuInvoked&&(t.canPaste=!1,t.menuInvoked=!0),t)},intersectsMerged:function(){var t=this.workbook.activeSheet(),i=this.parse(this._external),n;return this.origin=this.stateRangeRef(i),n=this.pasteRef(),!n.eq(t.unionWithMerged(n))},copy:function(){var n=this.workbook.activeSheet();this.origin=n.select();this.contents=n.selection().getState()},cut:function(){var n=this.workbook.activeSheet();this.copy();n.range(n.select()).clear()},pasteRef:function(){var i=this.workbook.activeSheet(),n=i.activeCell().first(),t=this.origin.first(),r=t.row-n.row,u=t.col-n.col;return this.origin.relative(r,u,3)},stateRangeRef:function(n){var u=[],f=[],t,e,o,s;for(t in n)t!=="mergedCells"&&t!=="ref"&&(e=t.split(","),u.push(e[0]),f.push(e[1]));return o=new i(Math.min.apply(null,u),Math.min.apply(null,f)),s=new i(Math.max.apply(null,u),Math.max.apply(null,f)),new r(o,s,0)},destroy:function(){document.body.removeChild(this.iframe)},paste:function(){var n={},t=this.workbook.activeSheet(),i;this._isInternal()?n=this.contents:(n=this.parse(this._external),this.origin=this.stateRangeRef(n));i=this.pasteRef();t.range(i).clear().setState(n);t.triggerChange({recalc:!0})},external:function(n){if(n.html||n.plain)this._external=n;else return this._external},parse:function(n){var u={ref:new i(0,0,0),mergedCells:[]},r,f,e;return n.html?(r=this.iframe.contentWindow.document,r.open(),r.write(n.html),r.close(),f=t(r).find("table:first"),f.length?u=this._parseHTML(f.find("tbody:first")):n.plain?u=this._parseTSV(n.plain):(e=t(r.body).find(":not(style)"),u["0,0"]=this._cellState(e.text()))):u=this._parseTSV(n.plain),u},_parseHTML:function(n){var u=this,r={ref:new i(0,0,0),mergedCells:[]};return n.find("tr").each(function(i,r){t(r).find("td").each(function(u,f){var l=parseInt(t(f).attr("rowspan"),10)-1||0,c=parseInt(t(f).attr("colspan"),10)-1||0,o="<td/>",e,a,s,h,v;if(l){for(a=i+l,s=i;s<=a;s++)if(h=n.find("tr").eq(s),s>i&&(o="<td class='rowspan'><\/td>",u===0?h.find("td").eq(u).after(o):(v=Math.min(h.find("td").length,u),h.find("td").eq(v-1).after(o))),c)for(e=u;e<c+u;e++)o="<td class='rowspan colspan'><\/td>",h.find("td").eq(e).after(o)}else if(c)for(e=u;e<c+u;e++)o="<td class='colspan'><\/td>",t(r).find("td").eq(e).after(o)})}),n.find("tr").each(function(n,i){t(i).find("td").each(function(i,f){var s=n+","+i,e=parseInt(t(f).attr("rowspan"),10)-1||0,o=parseInt(t(f).attr("colspan"),10)-1||0,h=u._cellState(t(f));if(r[s]=h,e||o){var c=String.fromCharCode(65+i),l=String.fromCharCode(65+i+o),a=c+(n+1)+":"+l+(n+1+e);r.mergedCells.push(a)}})}),r},_parseTSV:function(n){var u={ref:new i(0,0,0),mergedCells:[]},f,t,e,r;if(n.indexOf("\t")===-1&&n.indexOf("\n")==-1)u["0,0"]={value:n};else for(f=n.split("\n"),t=0;t<f.length;t++)for(e=f[t].split("\t"),r=0;r<e.length;r++)u[t+","+r]={value:e[r]};return u},_isInternal:function(){if(this._external.html===undefined)return!0;var n=t("<div/>").html(this._external.html).find("table.kendo-clipboard-"+this._uid).length?!0:!1,i=t("<div/>").html(this._external.plain).find("table.kendo-clipboard-"+this._uid).length?!0:!1;return n||i?!0:!1},_cellState:function(n){var t=window.getComputedStyle(n[0]),u=n.text(),r=this._borderObject(t),i={value:u===""?null:u,borderBottom:r.borderBottom,borderRight:r.borderRight,borderLeft:r.borderLeft,borderTop:r.borderTop,fontSize:parseInt(t["font-size"],10)};return t["background-color"]!=="rgb(0, 0, 0)"&&t["background-color"]!=="rgba(0, 0, 0, 0)"&&(i.background=t["background-color"]),t.color!=="rgb(0, 0, 0)"&&t.color!=="rgba(0, 0, 0, 0)"&&(i.color=t.color),t["text-decoration"]=="underline"&&(i.underline=!0),t["font-style"]=="italic"&&(i.italic=!0),t["font-weight"]=="bold"&&(i.bold=!0),this._strippedStyle(t["text-align"])!=="right"&&(i.textAlign=this._strippedStyle(t["text-align"])),t["vertical-align"]!=="middle"&&(i.verticalAlign=t["vertical-align"]),t["word-wrap"]!=="normal"&&(i.wrap=!0),i},_strippedStyle:function(n){return["-ms-","-moz-","-webkit-"].forEach(function(t){n=n.replace(t,"")}),n},_borderObject:function(n){var t={};return["borderBottom","borderRight","borderLeft","borderTop"].forEach(function(i){if(n[i+"Style"]=="none"){t[i]=null;return}t[i]={size:1,color:n[i+"Color"]}}),t}});n.spreadsheet.Clipboard=u}})(kendo)}(),function(){(function(n){function o(n){return n.replace(/M/g,"m").replace(/'/g,'"').replace(/tt/,"am/pm")}function s(t){return!/^=/.test(t)&&/number|percent/.test(n.spreadsheet.calc.parse(null,0,0,t).type)}function h(t,i,r,u){var f={baselineMarkerSize:0,width:i+"px","font-size":(r||12)+"px","word-break":u===!0?"break-all":"normal"};return n.util.measureText(t,f,e).height}var e;if(!n.support.browser.msie||!(n.support.browser.version<9)){var u=n.jQuery,i=n.spreadsheet.UnionRef,f=["color","fontFamily","underline","italic","bold","textAlign","verticalAlign","background"],r={borderTop:{complement:"borderBottom",direction:{top:-1,bottom:-1}},borderLeft:{complement:"borderRight",direction:{left:-1,right:-1}},borderRight:{complement:"borderLeft",direction:{left:1,right:1}},borderBottom:{complement:"borderTop",direction:{top:1,bottom:1}}},t=n.Class.extend({init:function(n,t){this._sheet=t;this._ref=n},_normalize:function(n){return this._sheet._grid.normalize(n)},_set:function(n,t,i){var r=this._sheet;return this._ref.forEach(function(i){r._set(i.toRangeRef(),n,t)}),i||r.triggerChange({recalc:n=="formula"||n=="value"||n=="validation",value:t,ref:this._ref}),this},_get:function(n){return this._sheet._get(this._ref.toRangeRef(),n)},_property:function(n,t){return t===undefined?this._get(n):this._set(n,t)},value:function(n){return n!==undefined&&this._set("formula",null,!0),this._property("value",n)},resize:function(n){var i=this._resizedRef(n);return new t(i,this._sheet)},_resizedRef:function(n){return this._ref.map(function(t){return t.toRangeRef().resize(n)})},_border:function(i,u){var f,o=r[i].complement,s=r[i].direction,e=this._sheet;return e.batch(function(){f=this._property(i,u);u!==undefined&&this._resizedRef(s).forEach(function(i){i!==n.spreadsheet.NULLREF&&new t(i,e)._property(o,null)})}.bind(this),{}),f},_collapsedBorder:function(i){var u=this._property(i),f=r[i].complement,e=r[i].direction;return this._resizedRef(e).forEach(function(i){if(!u&&i!==n.spreadsheet.NULLREF){var r=new t(i,this._sheet);u=r._property(f)}}.bind(this)),u},borderTop:function(n){return this._border("borderTop",n)},borderRight:function(n){return this._border("borderRight",n)},borderBottom:function(n){return this._border("borderBottom",n)},borderLeft:function(n){return this._border("borderLeft",n)},collapsedBorderTop:function(){return this._collapsedBorder("borderTop")},collapsedBorderRight:function(){return this._collapsedBorder("borderRight")},collapsedBorderBottom:function(){return this._collapsedBorder("borderBottom")},collapsedBorderLeft:function(){return this._collapsedBorder("borderLeft")},input:function(t){var r,i;if(t!==undefined)return r=this._ref.toRangeRef().topLeft,i=n.spreadsheet.calc.parse(this._sheet.name(),r.row,r.col,t),this._sheet.batch(function(){var t=null;i.type=="exp"?t=n.spreadsheet.calc.compile(i):i.type=="date"?this.format(o(n.culture().calendar.patterns.d)):i.type=="percent"&&this.format(i.value*100==(i.value*100|0)?"0%":"0.00%");this.formula(t);t||this.value(i.value)}.bind(this),{recalc:!0,value:t,ref:this._ref}),this;t=this._get("value");var f=this._get("format"),u=this._get("formula"),e=f&&!u&&n.spreadsheet.formatting.type(t,f);return u?t="="+u:e==="date"?t=n.toString(n.spreadsheet.numberToDate(t),n.culture().calendar.patterns.d):e==="percent"?t=t*100+"%":typeof t=="string"&&(/^[=']/.test(t)||/^(?:true|false)$/i.test(t)||s(t))&&(t="'"+t),t},format:function(n){return this._property("format",n)},formula:function(n){if(n===undefined){var t=this._get("formula");return t?""+t:null}return this._property("formula",n)},validation:function(n){if(n===undefined){var t=this._get("validation");return t?t.toJSON():null}return this._property("validation",n)},_getValidationState:function(){for(var t=this._ref.toRangeRef(),u=t.topLeft.row,f=t.topLeft.col,e=t.bottomRight.row,o=t.bottomRight.col,r,n,i=f;i<=o;i++)for(r=u;r<=e;r++)if(n=this._sheet._validation(r,i),n&&n.type==="reject"&&n.value===!1)return n;return!1},merge:function(){return this._ref=this._sheet._merge(this._ref),this},unmerge:function(){var n=this._sheet._mergedCells;return this._ref.forEach(function(t){t.toRangeRef().intersecting(n).forEach(function(t){n.splice(n.indexOf(t),1)})}),this._sheet.triggerChange({}),this},select:function(){return this._sheet.select(this._ref),this},values:function(t){var s,h,c;if(this._ref instanceof i)throw new Error("Unsupported for multiple ranges.");if(this._ref===n.spreadsheet.NULLREF)if(t!==undefined)throw new Error("Unsupported for NULLREF.");else return[];var f=this._ref.toRangeRef(),e=f.topLeft.row,o=f.topLeft.col,l=f.bottomRight.row,a=f.bottomRight.col,r,u;if(t===undefined){for(t=new Array(f.height()),s=0;s<t.length;s++)t[s]=new Array(f.width());for(r=o;r<=a;r++)for(u=e;u<=l;u++)t[u-e][r-o]=this._sheet._value(u,r);return t}for(r=o;r<=a;r++)for(u=e;u<=l;u++)h=t[u-e],h&&(c=h[r-o],c!==undefined&&this._sheet._value(u,r,c));return this._sheet.triggerChange({recalc:!0}),this},_properties:function(t){var e,l,c;if(this._ref instanceof i)throw new Error("Unsupported for multiple ranges.");if(this._ref===n.spreadsheet.NULLREF)if(t!==undefined)throw new Error("Unsupported for NULLREF.");else return[];var r=this._ref.toRangeRef(),o=r.topLeft.row,s=r.topLeft.col,a=r.bottomRight.row,v=r.bottomRight.col,u,f,h=this._sheet;if(t===undefined)return t=new Array(r.height()),h.forEach(r,function(n,i,r){n-=o;i-=s;var u=t[n]||(t[n]=[]);u[i]=r}),t;for(r=r.clone(),l=function(n){var t=e[n];r.topLeft.row=r.bottomRight.row=f;r.topLeft.col=r.bottomRight.col=u;h._set(r,n,t)},u=s;u<=v;u++)for(f=o;f<=a;f++)c=t[f-o],c&&(e=c[u-s],e&&Object.keys(e).forEach(l));return h.triggerChange({recalc:!0}),this},clear:function(n){var t=!n||!Object.keys(n).length,r=this._sheet,i={recalc:t||n&&n.contentsOnly===!0};return r.batch(function(){i.recalc&&this.formula(null);t&&this.validation(null);(t||n&&n.formatOnly===!0)&&(f.forEach(function(n){this[n](null)}.bind(this)),this.format(null),this.unmerge())}.bind(this),i),this},clearContent:function(){return this.clear({contentsOnly:!0})},clearFormat:function(){return this.clear({formatOnly:!0})},isSortable:function(){return!(this._ref instanceof i||this._ref===n.spreadsheet.NULLREF)},sort:function(t){if(this._ref instanceof i)throw new Error("Unsupported for multiple ranges.");if(this._ref===n.spreadsheet.NULLREF)throw new Error("Unsupported for NULLREF.");return t===undefined&&(t={column:0}),t=t instanceof Array?t:[t],this._sheet._sortBy(this._ref.toRangeRef(),t.map(function(n,t){return typeof n=="number"&&(n={column:n}),{index:n.column===undefined?t:n.column,ascending:n.ascending===undefined?!0:n.ascending}})),this},isFilterable:function(){return!(this._ref instanceof i)},filter:function(n){if(this._ref instanceof i)throw new Error("Unsupported for multiple ranges.");return n===!1?this.clearFilters():(n=n===!0?[]:n instanceof Array?n:[n],this._sheet._filterBy(this._ref.toRangeRef(),n.map(function(n,t){return{index:n.column===undefined?t:n.column,filter:n.filter}}))),this},clearFilter:function(n){this._sheet.clearFilter(n)},clearFilters:function(){var t=this._sheet.filter(),i=[],n;if(t){for(n=0;n<t.columns.length;n++)i.push(n);this._sheet.batch(function(){this.clearFilter(i);this._filter=null},{layout:!0,filter:!0})}},hasFilter:function(){var n=this._sheet.filter();return!!n},leftColumn:function(){return new t(this._ref.leftColumn(),this._sheet)},rightColumn:function(){return new t(this._ref.rightColumn(),this._sheet)},topRow:function(){return new t(this._ref.topRow(),this._sheet)},bottomRow:function(){return new t(this._ref.bottomRow(),this._sheet)},column:function(n){return new t(this._ref.toColumn(n),this._sheet)},forEachRow:function(n){this._ref.forEachRow(function(i){n(new t(i,this._sheet))}.bind(this))},forEachColumn:function(n){this._ref.forEachColumn(function(i){n(new t(i,this._sheet))}.bind(this))},sheet:function(){return this._sheet},topLeft:function(){return this._ref.toRangeRef().topLeft},intersectingMerged:function(){var t=this._sheet,n=[];return t._mergedCells.forEach(function(t){t.intersects(this._ref)&&n.push(t.toString())}.bind(this)),n},getState:function(t){var i={ref:this._ref.first()},r;return t?r=t==="input"?["value","formula"]:t==="border"?["borderLeft","borderTop","borderRight","borderBottom"]:[t]:(r=n.spreadsheet.ALL_PROPERTIES,i.mergedCells=this.intersectingMerged()),this.forEachCell(function(n,t,u){var f=i[n+","+t]={};r.forEach(function(n){f[n]=u[n]||null})}),i},setState:function(n){var t=this._sheet,i=this._ref.first(),r=n.ref.row-i.row,u=n.ref.col-i.col;t.batch(function(){n.mergedCells&&this.unmerge();this.forEachCell(function(i,f){var e=n[i+r+","+(f+u)],s=t.range(i,f);for(var o in e)o!="value"&&s._set(o,e[o]);e.formula||s._set("value",e.value)});n.mergedCells&&n.mergedCells.forEach(function(n){n=t._ref(n).relative(r,u,3);t.range(n).merge()},this)}.bind(this),{recalc:!0})},forEachCell:function(n){this._ref.forEach(function(t){this._sheet.forEach(t.toRangeRef(),n.bind(this))}.bind(this))},hasValue:function(){var n=!1;return this.forEachCell(function(t,i,r){Object.keys(r).length!==0&&(n=!0)}),n},wrap:function(t){return t===undefined?!!this._property("wrap"):(this.forEachRow(function(t){var i=t.sheet().rowHeight(t.topLeft().row);t.forEachCell(function(t,r,u){var f=this._sheet.columnWidth(r);i=Math.max(i,n.spreadsheet.util.getTextHeight(u.value,f,u.fontSize,!0))});t.sheet().rowHeight(t.topLeft().row,i)}.bind(this)),this._property("wrap",t),this)},fontSize:function(t){return t===undefined?this._property("fontSize"):(this.forEachRow(function(i){var r=i.sheet().rowHeight(i.topLeft().row);i.forEachCell(function(i,u,f){var e=this._sheet.columnWidth(u);r=Math.max(r,n.spreadsheet.util.getTextHeight(f.value,e,t,f.wrap))});i.sheet().rowHeight(i.topLeft().row,r)}.bind(this)),this._property("fontSize",t),this)}});u.each(f,function(n,i){t.prototype[i]=function(n){return this._property(i,n)}});e=u('<div style="position: absolute !important; top: -4000px !important; height: auto !important;padding: 1px !important; margin: 0 !important; border: 1px solid black !important;line-height: normal !important; visibility: hidden !important;white-space: normal !important; word-break: break-all !important;" />')[0];n.spreadsheet.util={getTextHeight:h};n.spreadsheet.Range=t}})(window.kendo)}(),function(){"use strict";function r(n){if(n instanceof r)return n;this.code=n}function ct(n,t,i){for(var u=i(n),f=n,r;++n<t;)r=i(n),r>u&&(u=r,f=n);return f}function d(n,t){function l(n){var t,r,s,h;return i=n[0],t="{ ",Array.isArray(i)?(e+="while (i < args.length) { ",f+="while (i < args.length) { ",t+="xargs.push(tmp = []); stack.push(xargs); xargs = tmp; ",t+="while (i < args.length) { ",t+=n.map(l).join(""),t+="} ",t+="xargs = stack.pop(); ",f+="} ",e+="} "):i=="+"?(e+="while (i < args.length) { ",f+="while (i < args.length) { ",t+="xargs.push(tmp = []); stack.push(xargs); xargs = tmp; ",t+="do { ",t+=n.slice(1).map(l).join(""),t+="} while (i < args.length); ",t+="xargs = stack.pop(); ",f+="} ",e+="} "):i=="?"?t+="if (!("+o(n[1])+")) return new CalcError(err); ":(r=n[1],Array.isArray(r)&&/^#?collect/.test(r[0])?(s=r[2],u(),t+="try {var $"+i+" = this.cellValues(args.slice(i",s&&(t+=", i + "+s),t+=")).filter(function($"+i+"){ ",r[0]=="collect"&&(t+="if ($"+i+" instanceof CalcError) throw $"+i+"; "),t+="return "+o(r[1])+"; }, this); ",t+=s?"i += "+s+"; ":"i = args.length; ",t+="xargs.push($"+i+")} catch(ex) { if (ex instanceof CalcError) return ex; throw ex; } ",f+="toResolve.push(args.slice(i)); "):r=="rest"?t+="xargs.push(args.slice(i)); i = args.length; ":((v=/^\*/.test(i))&&(y=!0,i=i.substr(1)),t+="var $"+i+" = args[i++]; ",h=!1,/!$/.test(r)?(r=r.substr(0,r.length-1),h=!0):t+="if ($"+i+" instanceof CalcError) return $"+i+"; ",t+=p(r,h)+"xargs.push($"+i+"); ")),t+"} "}function u(){return h?"$"+i+"":(a=!0,h=!0,f+="toResolve.push(args[i++]); ","($"+i+" = this.force($"+i+"))")}function p(n,t){h=!1;var r="if (!("+o(n)+")) { ";return h&&!t&&(r+=" if ($"+i+" instanceof CalcError) return $"+i+"; "),r+="return new CalcError(err); } ",h||(f+="i++; "),e+=v?"var $"+i+" = this.asMatrix(args[i]); if ($"+i+") { xargs.push($"+i+"); width = Math.max(width, $"+i+".width); height = Math.max(height, $"+i+".height); arrays.push(true) } else { xargs.push(args[i]); arrays.push(false); } i++; ":"xargs.push(args[i++]); arrays.push(false); ",r}function o(n){if(Array.isArray(n)){if(n[0]=="or")return"("+n.slice(1).map(o).join(") || (")+")";if(n[0]=="and")return"("+n.slice(1).map(o).join(") && (")+")";if(n[0]=="values")return"("+n.slice(1).map(function(n){return u()+" === "+n}).join(") || (")+")";if(n[0]=="null")return"("+o("null")+" ? (($"+i+" = "+n[1]+"), true) : false)";if(n[0]=="between"||n[0]=="[between]")return"("+u()+" >= "+n[1]+" && $"+i+" <= "+n[2]+" ? true : ((err = 'NUM'), false))";if(n[0]=="(between)")return"("+u()+" > "+n[1]+" && $"+i+" < "+n[2]+" ? true : ((err = 'NUM'), false))";if(n[0]=="(between]")return"("+u()+" > "+n[1]+" && $"+i+" <= "+n[2]+" ? true : ((err = 'NUM'), false))";if(n[0]=="[between)")return"("+u()+" >= "+n[1]+" && $"+i+" < "+n[2]+" ? true : ((err = 'NUM'), false))";if(n[0]=="assert"){var t=n[2]||"N/A";return"(("+n[1]+") ? true : (err = "+JSON.stringify(t)+", false))"}if(n[0]=="not")return"!("+o(n[1])+")";throw new Error("Unknown array type condition: "+n[0]);}if(n=="number")return"(typeof "+u()+" == 'number' || typeof $"+i+" == 'boolean')";if(n=="integer")return"((typeof "+u()+" == 'number' || typeof $"+i+" == 'boolean') ? ($"+i+" |= 0, true) : false)";if(n=="date")return"((typeof "+u()+" == 'number') ? ($"+i+" |= 0, true) : false)";if(n=="datetime")return"(typeof "+u()+" == 'number')";if(n=="divisor")return"((typeof "+u()+" == 'number' || typeof $"+i+" == 'boolean') && ($"+i+" == 0 ? ((err = 'DIV/0'), false) : true))";if(n=="number+")return"((typeof "+u()+" == 'number' || typeof $"+i+" == 'boolean') && ($"+i+" >= 0 ? true : ((err = 'NUM'), false)))";if(n=="integer+")return"((typeof "+u()+" == 'number' || typeof $"+i+" == 'boolean') && (($"+i+" |= 0) >= 0 ? true : ((err = 'NUM'), false)))";if(n=="number++")return"((typeof "+u()+" == 'number' || typeof $"+i+" == 'boolean') && ($"+i+" > 0 ? true : ((err = 'NUM'), false)))";if(n=="integer++")return"((typeof "+u()+" == 'number' || typeof $"+i+" == 'boolean') && (($"+i+" |= 0 ) > 0) ? true : ((err = 'NUM'), false))";if(n=="string")return"(typeof "+u()+" == 'string')";if(n=="boolean")return"(typeof "+u()+" == 'boolean')";if(n=="logical")return"(typeof "+u()+" == 'boolean' || (typeof $"+i+" == 'number' ? ($"+i+" = !!$"+i+", true) : false))";if(n=="matrix")return u(),"((m = this.asMatrix($"+i+")) ? ($"+i+" = m) : false)";if(n=="#matrix")return"((m = this.asMatrix($"+i+")) ? ($"+i+" = m) : false)";if(n=="ref")return"($"+i+" instanceof kendo.spreadsheet.Ref)";if(n=="area")return"($"+i+" instanceof kendo.spreadsheet.CellRef || $"+i+" instanceof kendo.spreadsheet.RangeRef)";if(n=="cell")return"($"+i+" instanceof kendo.spreadsheet.CellRef)";if(n=="null")return"("+u()+" == null)";if(n=="anyvalue")return"("+u()+" != null && i <= args.length)";if(n=="forced")return"("+u()+", i <= args.length)";if(n=="anything")return"(i <= args.length)";if(n=="blank")return"("+u()+" == null || $"+i+" === '')";throw new Error("Can't check for type: "+n);}var e="function arrayArgs(args) { var xargs = [], width = 0, height = 0, arrays = [], i = 0; ",f="function resolve(args, callback) { var toResolve = [], i = 0; ",i,h,c="'use strict'; function check(args) { var stack = [], tmp, xargs = [], i = 0, m, err = 'VALUE'; ",a=!1,v=!1,y=!1,s;return c+=t.map(l).join(""),c+="if (i < args.length) return new CalcError('N/A'); ",c+="return xargs; } ",e+="return { args: xargs, width: width, height: height, arrays: arrays }; } ",a?(f+="this.resolveCells(toResolve, callback); } ",s=new Function("CalcError",c+f+e+" return { resolve: resolve, check: check, arrayArgs: arrayArgs };")):s=new Function("CalcError",c+" return { check: check };"),s=s(r),y||delete s.arrayArgs,s}function g(n,t,i){if(i instanceof r)return i;try{return t.apply(n,i)}catch(u){if(u instanceof r)return u;throw u;}}function lt(n,i,r,u){return function(f,e){function o(){var i,l,h,c,s,o;if(u&&(i=u.call(this,e),e=i.args,i.width>0&&i.height>0)){for(l=new t(this),h=0;h<i.height;++h)for(c=0;c<i.width;++c){for(o=[],s=0;s<e.length;++s)o[s]=i.arrays[s]?e[s].get(h,c):e[s];o=r.call(this,o);l.set(h,c,g(this,n,o))}return f(l)}o=r.call(this,e);f(g(this,n,o))}i?i.call(this,e,o):o.call(this)}}function at(n,i,u,f){return function(e,o){function s(){var l,a,s,h,i;if(f&&(i=f.call(this,o),o=i.args,i.width>0&&i.height>0)){var v=new t(this),c=i.width*i.height,y=function(n,t){return function(i){return v.set(n,t,i),--c,c===0?e(v):void 0}};for(l=0;l<i.height&&c>0;++l)for(a=0;a<i.width&&c>0;++a){for(s=[],h=0;h<o.length;++h)s[h]=i.arrays[h]?o[h].get(l,a):o[h];if(s=u.call(this,s),s instanceof r){if(v.set(l,a,s),--c,c===0)return e(v)}else s.unshift(y(l,a)),n.apply(this,s)}return}i=u.call(this,o);i instanceof r?e(i):(i.unshift(e),n.apply(this,i))}i?i.call(this,o,s):s.call(this)}}function n(n,t){return n=n.toLowerCase(),f[n]=t,{args:function(i,r){var u=d(n,i),e;return r&&(u.arrayArgs&&console.log(u.arrayArgs.toString()),u.resolve&&console.log(u.resolve.toString()),u.check&&console.log(u.check.toString())),e=f[n]=lt(t,u.resolve,u.check,u.arrayArgs),e.kendoSpreadsheetArgs=i,this},argsAsync:function(i,r){var u=d(n,i),e;return r&&(u.arrayArgs&&console.log(u.arrayArgs.toString()),u.resolve&&console.log(u.resolve.toString()),u.check&&console.log(u.check.toString())),e=f[n]=at(t,u.resolve,u.check,u.arrayArgs),e.kendoSpreadsheetArgs=i,this}}}function nt(n,t,i){return t++,(1461*(n+4800+((t-14)/12|0))/4|0)+(367*(t-2-12*((t-14)/12|0))/12|0)-(3*((n+4900+((t-14)/12|0))/100|0)/4|0)+i-32075}function vt(n){var t,u,i,f,r,e,o;return t=n+68569,u=4*t/146097|0,t=t-((146097*u+3)/4|0),f=4e3*(t+1)/1461001|0,t=t-(1461*f/4|0)+31,i=80*t/2447|0,e=t-(2447*i/80|0),t=i/11|0,r=i+2-12*t,o=100*(u-49)+f+t,r--,{year:o,month:r,date:e,day:(n+1)%7,ord:pt[c(o)][r]+e}}function c(n){return n%4?0:n%100?1:n%400?0:1}function wt(n){return c(n)?366:365}function bt(n,t){return c(n)&&t==1?29:yt[t]}function it(n){return vt((n|0)+tt)}function rt(n,t,i){return nt(n,t,i)-tt}function ut(n){var i=n-(n|0),t,r,u,f;return i<0&&i++,t=Math.round(kt*i),r=Math.floor(t/w),t-=r*w,u=Math.floor(t/p),t-=u*p,f=Math.floor(t/1e3),t-=f*1e3,{hours:r,minutes:u,seconds:f,milliseconds:t}}function ft(n){var i=it(n),t=ut(n);return new Date(i.year,i.month,i.date,t.hours,t.minutes,t.seconds,t.milliseconds)}function et(n,t,i,r){return(n+t/60+i/3600+r/36e5)/24}function ot(n){var t=et(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds());return n=rt(n.getFullYear(),n.getMonth(),n.getDate()),n<0?n-1+t:n+t}function dt(n){return kendo.parseDate(n,["MM/dd/yyyy","MM-dd-yyyy","MM/dd/yy","MM-dd-yy","MMMM dd yyyy","MMMM dd yy","MMM dd yyyy","MMM dd yy","dd MMMM yyyy","dd MMMM yy","dd MMM yyyy","dd MMM yy","MMMM dd, yyyy","MMMM dd, yy","MMM dd, yyyy","MMM dd, yy","MMMM dd","MMM dd","MMMM yyyy","MMM yyyy","dd MMMM","dd MMM","MM-dd","MM/dd"])||kendo.parseDate(n)}function l(n){return function(t,i){return typeof t=="string"&&typeof i!="string"&&(i=i==null?"":i+""),typeof t!="string"&&typeof i=="string"&&(t=t==null?"":t+""),typeof t=="number"&&i==null&&(i=0),typeof i=="number"&&t==null&&(t=0),typeof t=="string"&&typeof i=="string"&&(t=t.toLowerCase(),i=i.toLowerCase()),typeof i==typeof t?n(t,i):new r("VALUE")}}var a,u,k,t,y,f,s,o;if(!kendo.support.browser.msie||!(kendo.support.browser.version<9)){a={};u=kendo.spreadsheet;u.calc=a;var i=a.runtime={},v=kendo.Class,e=u.Ref,b=u.CellRef,h=u.RangeRef,st=u.UnionRef,ht=u.NULLREF;r.prototype.toString=function(){return"#"+this.code+(this.code=="NAME"?"?":"!")};k=v.extend({init:function(n,t,i,r){this.callback=n;this.formula=t;this.ss=i;this.parent=r},resolve:function(n){var t=this;n instanceof e?t.resolveCells([n],function(){n=t.getRefData(n);Array.isArray(n)&&(n=n[0]);t._resolve(n)}):t._resolve(n)},_resolve:function(n){n===undefined&&(n=null);var t=this.formula;t.value=n;this.ss.onFormula(t)&&this.callback&&this.callback.call(t,n)},resolveCells:function(n,t){function s(n){n.formula.exec(i.ss,function(){--f||t.call(i)},i)}function h(n){for(var i,t=0;t<n.length;++t)i=n[t],i.formula&&r.push(i);return!0}var i=this,r=[],f,u;if(function o(n){for(var t,r=0;r<n.length;++r)t=n[r],t instanceof e&&h(i.getRefCells(t)),Array.isArray(t)&&o(t)}(n),!r.length)return t.call(i);for(f=r.length,u=0;u<r.length;++u)s(r[u])},cellValues:function(n,i){for(var r,u=[],f=0;f<n.length;++f)r=n[f],r instanceof e?(r=this.getRefData(r),u=u.concat(r)):Array.isArray(r)?u=u.concat(this.cellValues(r)):r instanceof t?u=u.concat(this.cellValues(r.data)):u.push(r);return i?i.apply(this,u):u},force:function(n){return n instanceof e?this.getRefData(n):n},func:function(n,t,i){n=n.toLowerCase();var u=f[n];if(u)return u.call(this,t,i);t(new r("NAME"))},bool:function(n){return(n instanceof e&&(n=this.getRefData(n)),typeof n=="string")?n.toLowerCase()=="true":typeof n=="number"?n!==0:typeof n=="boolean"?n:n!=null},asMatrix:function(n){var r,i,u;if(n instanceof t)return n;if(r=this,n instanceof h){var s=n.topLeft,f=s.row,o=s.col,c=r.getRefCells(n),i=new t(r);return isFinite(n.width())&&(i.width=n.width()),isFinite(n.height())&&(i.height=n.height()),isFinite(f)||(f=0),isFinite(o)||(o=0),c.forEach(function(n){i.set(n.row-f,n.col-o,n.value)}),i}if(Array.isArray(n)&&n.length>0)return i=new t(r),u=0,n.forEach(function(n){var f=0,o=1;n.forEach(function(n){var s=n instanceof h;n instanceof e&&!s&&(n=r.getRefData(n));(s||Array.isArray(n))&&(n=r.asMatrix(n));n instanceof t?(n.each(function(n,t,r){i.set(u+t,f+r,n)}),o=Math.max(o,n.height),f+=n.width):i.set(u,f++,n)});u+=o}),i},getRefCells:function(n,t){return this.ss.getRefCells(n,t)},getRefData:function(n){return this.ss.getData(n)},workbook:function(){return this.ss.workbook}});t=v.extend({init:function(n){this.context=n;this.height=0;this.width=0;this.data=[]},clone:function(){var n=new t(this.context);return n.height=this.height,n.width=this.width,n.data=this.data.map(function(n){return n.slice()}),n},get:function(n,t){var r=this.data[n],i=r?r[t]:null;return i instanceof e?this.context.getRefData(i):i},set:function(n,t,i){var r=this.data[n];r==null&&(r=this.data[n]=[]);r[t]=i;n>=this.height&&(this.height=n+1);t>=this.width&&(this.width=t+1)},each:function(n,t){for(var u,i,r=0;r<this.height;++r)for(u=0;u<this.width;++u)if(i=this.get(r,u),(t||i!=null)&&(i=n.call(this.context,i,r,u),i!==undefined))return i},map:function(n,i){var r=new t(this.context);return this.each(function(t,i,u){r.set(i,u,n.call(this,t,i,u))},i),r},eachRow:function(n){for(var i,t=0;t<this.height;++t)if(i=n.call(this.context,t),i!==undefined)return i},eachCol:function(n){for(var i,t=0;t<this.width;++t)if(i=n.call(this.context,t),i!==undefined)return i},mapRow:function(n){var i=new t(this.context);return this.eachRow(function(t){i.set(t,0,n.call(this.context,t))}),i},mapCol:function(n){var i=new t(this.context);return this.eachCol(function(t){i.set(0,t,n.call(this.context,t))}),i},toString:function(){return JSON.stringify(this.data)},transpose:function(){var n=new t(this.context);return this.each(function(t,i,r){n.set(r,i,t)}),n},unit:function(n){var r,t,u,i;for(this.width=this.height=n,r=this.data=new Array(n),t=n;--t>=0;)for(u=r[t]=new Array(n),i=n;--i>=0;)u[i]=t==i?1:0;return this},multiply:function(n){for(var i,o,u,s,h,f=this,c=new t(f.context),e=0;e<f.height;++e)for(i=0;i<n.width;++i){for(o=0,u=0;u<f.width;++u){if(s=f.get(e,u),h=n.get(u,i),typeof s!="number"||typeof h!="number")throw new r("VALUE");o+=s*h}c.set(e,i,o)}return c},adds:function(n,i){for(var r,o,s,f=this,e=new t(f.context),h=i?-1:1,u=0;u<f.height;++u)for(r=0;r<f.width;++r)o=f.get(u,r),s=n.get(u,r),e.set(u,r,o+h*s);return e},determinant:function(){for(var i=this.clone().data,u=i.length,e=1,r,f,t,o,n=0;n<u;n++){for(r=n;r<u&&!i[r][n];r++);if(r==u)return 0;if(r!=n)for(e=-e,t=n;t<u;t++)o=i[n][t],i[n][t]=i[r][t],i[r][t]=o;for(f=n+1;f<u;f++)for(t=n+1;t<u;t++)i[f][t]-=i[n][t]*i[f][n]/i[n][n];e*=i[n][n]}return e},inverse:function(){for(var e,h,r,f,u=this.width,o=this.augment(new t(this.context).unit(u)),i=o.data,s,n=0;n<u;++n){if(e=ct(n,u,function(t){return i[t][n]}),!i[e][n])return null;for(n!=e&&(s=i[n],i[n]=i[e],i[e]=s),r=n+1;r<u;++r){for(f=n+1;f<2*u;++f)i[r][f]-=i[n][f]*i[r][n]/i[n][n];i[r][n]=0}}for(r=0;r<u;++r)for(h=i[r][r],f=0;f<2*u;++f)i[r][f]/=h;for(n=u;--n>=0;)for(r=n;--r>=0;)if(i[r][n])for(f=2*u;--f>=u;)i[r][f]-=i[n][f]*i[r][n];return o.slice(0,u,u,u)},augment:function(n){var t=this.clone(),i=t.width;return n.each(function(n,r,u){t.set(r,u+i,n)}),t},slice:function(n,i,r,u){for(var f,o=new t(this.context),e=0;e<r;++e)for(f=0;f<u;++f)o.set(e,f,this.get(n+e,i+f));return o}});y=v.extend({init:function(n,t,i,r,u,f){this.refs=n;this.handler=t;this.print=i;this.absrefs=null;this.sheet=r;this.row=u;this.col=f;this.onReady=[];this.pending=!1},clone:function(n,t,i){var u=n.toLowerCase(),r=this.refs;return u!=this.sheet.toLowerCase()&&(r=r.map(function(t){return t.hasSheet()||t.sheet.toLowerCase()==u||(t=t.clone().setSheet(n)),t})),new y(r,this.handler,this.print,n,t,i)},resolve:function(n){this.pending=!1;this.onReady.forEach(function(t){t(n)})},exec:function(n,t,i){if("value"in this)t&&t(this.value);else{t&&this.onReady.push(t);for(var u=new k(this.resolve,this,n,i);i;){if(i.formula===this){this.pending=!1;u.resolve(new r("CIRCULAR"));return}i=i.parent}if(this.pending)return;this.pending=!0;this.absrefs||(this.absrefs=this.refs.map(function(n){return n.absolute(this.row,this.col)},this));this.handler.call(u)}},reset:function(){this.onReady=[];this.pending=!1;delete this.value},renameSheet:function(n,t){n=n.toLowerCase();this.absrefs=null;this.sheet.toLowerCase()==n&&(this.sheet=t);this.refs.forEach(function(i){i.sheet.toLowerCase()==n&&(i.sheet=t)})},adjust:function(n,t,i,r){var o,s;n=n.toLowerCase();var u=this.row,f=this.col,h=this.sheet.toLowerCase(),e=!1;h==n&&(t=="row"&&u>=i&&(this.row+=r,e=!0),t=="col"&&f>=i&&(this.col+=r,e=!0));o=this.row;s=this.col;this.absrefs=null;this.refs=this.refs.map(function(h){return h===ht?h:h.sheet.toLowerCase()!=n?(e&&(t=="row"&&u>=i&&(h=h.relative(r,0)),t=="col"&&f>=i&&(h=h.relative(0,r))),h):h.adjust(u,f,o,s,t=="row",i,r)},this)},toString:function(){return this.print(this.row,this.col)}});f=Object.create(null);f["if"]=function(n,t){var i=this,r=t[0],u=t[1],f=t[2];this.resolveCells([r],function(){var t=i.asMatrix(r);t?u(function(r){f(function(u){var f=i.asMatrix(r),e=i.asMatrix(u);n(t.map(function(n,t,o){return i.bool(n)?f?f.get(t,o):r:e?e.get(t,o):u}))})}):i.bool(r)?u(n):f(n)})};f["φ"]=function(n){n((1+Math.sqrt(5))/2)};var tt=nt(1900,0,-1),yt=[31,28,31,30,31,30,31,31,30,31,30,31],pt=[[0,31,59,90,120,151,181,212,243,273,304,334],[0,31,60,91,121,152,182,213,244,274,305,335]];var p=6e4,w=60*p,kt=24*w;i.CalcError=r;i.Formula=y;i.Matrix=t;i.packDate=rt;i.unpackDate=it;i.packTime=et;i.unpackTime=ut;i.serialToDate=ft;i.dateToSerial=ot;i.daysInMonth=bt;i.isLeapYear=c;i.daysInYear=wt;i.parseDate=dt;u.dateToNumber=ot;u.numberToDate=ft;u.defineFunction=n;u.CalcError=r;i.defineFunction=n;i.defineAlias=function(n,t){var i=f[t];if(!i)throw new Error("Function "+t+" is not yet defined");i.kendoSpreadsheetAliases||(i.kendoSpreadsheetAliases=[t]);i.kendoSpreadsheetAliases.push(n);f[n]=i};i.FUNCS=f;s=[["*a","number"],["*b","number"]];o=[["*a","anyvalue"],["*b","anyvalue"]];n("binary+",function(n,t){return n+t}).args(s);n("binary-",function(n,t){return n-t}).args(s);n("binary*",function(n,t){return n*t}).args(s);n("binary/",function(n,t){return n/t}).args([["*a","number"],["*b","divisor"]]);n("binary^",function(n,t){return Math.pow(n,t)}).args(s);n("binary&",function(n,t){return n==null&&(n=""),t==null&&(t=""),""+n+t}).args([["*a",["or","number","string","boolean","null"]],["*b",["or","number","string","boolean","null"]]]);n("binary=",function(n,t){return n===t}).args(o);n("binary<>",function(n,t){return n!==t}).args(o);n("binary<",l(function(n,t){return n<t})).args(o);n("binary<=",l(function(n,t){return n<=t})).args(o);n("binary>",l(function(n,t){return n>t})).args(o);n("binary>=",l(function(n,t){return n>=t})).args(o);n("unary+",function(n){return n}).args([["*a","number"]]);n("unary-",function(n){return-n}).args([["*a","number"]]);n("unary%",function(n){return n/100}).args([["*a","number"]]);n("binary:",function(n,t){return new h(n,t).setSheet(n.sheet||this.formula.sheet,n.hasSheet())}).args([["a","cell"],["b","cell"]]);n("binary,",function(n,t){return new st([n,t])}).args([["a","ref"],["b","ref"]]);n("binary ",function(n,t){return n.intersect(t)}).args([["a","ref"],["b","ref"]]);n("not",function(n){return!this.bool(n)}).args([["*a","anyvalue"]]);n("isblank",function(n){return n instanceof b?(n=this.getRefData(n),n==null):!1}).args([["*value","anything!"]]);n("iserror",function(n){return n instanceof r}).args([["*value","forced!"]]);n("iserr",function(n){return n instanceof r&&n.code!="N/A"}).args([["*value","forced!"]]);n("isna",function(n){return n instanceof r&&n.code=="N/A"}).args([["*value","forced!"]]);n("islogical",function(n){return typeof n=="boolean"}).args([["*value","forced!"]]);n("isnontext",function(n){return typeof n!="string"}).args([["*value","forced!"]]);n("istext",function(n){return typeof n=="string"}).args([["*value","forced!"]]);n("isnumber",function(n){return typeof n=="number"}).args([["*value","forced!"]]);n("isref",function(n){return n instanceof b||n instanceof h}).args([["*value","anything!"]])}}(),function(){"use strict";function e(i,r,u,e){var s,o;if(typeof e=="string"&&(e=JSON.parse(e)),e.from&&(e.dataType==="list"&&(e.from=kendo.format(f,e.from)),e.from=t.compile(t.parseFormula(i,r,u,e.from))),e.to&&(e.to=t.compile(t.parseFormula(i,r,u,e.to))),o=e.dataType=="custom"?n.validationComparers.custom:e.dataType=="list"?n.validationComparers.list:n.validationComparers[e.comparerType],!o)throw kendo.format("'{0}' comparer is not implemented.",e.comparerType);return s=function(n){var t=this.to&&this.to.value?this.to.value:undefined,i;return this.dataType=="custom"?this.value=o(n,this.from.value,t):this.dataType=="list"?(i=this._getListData(),this.value=o(n,i,t)):this.value=n===null?this.allowNulls?!0:!1:o(n,this.from.value,t),this.value},new kendo.spreadsheet.validation.Validation($.extend(e,{handler:s,sheet:i,row:r,col:u}))}var i,n,r;if(!kendo.support.browser.msie||!(kendo.support.browser.version<9)){i=kendo.spreadsheet;n={};i.validation=n;var t=i.calc,u=kendo.Class,f="_matrix({0})";t.runtime.defineFunction("_matrix",function(n){return n}).args([["m","matrix"]]);r=u.extend({init:function(n){this.handler=n.handler;this.from=n.from;this.to=n.to;this.dataType=n.dataType;this.comparerType=n.comparerType;this.type=n.type?n.type:"warning";this.allowNulls=n.allowNulls?!0:!1;this.sheet=n.sheet;this.row=n.row;this.col=n.col;n.tooltipMessageTemplate&&(this.tooltipMessageTemplate=n.tooltipMessageTemplate);n.tooltipTitleTemplate&&(this.tooltipTitleTemplate=n.tooltipTitleTemplate);n.messageTemplate&&(this.messageTemplate=n.messageTemplate);n.titleTemplate&&(this.titleTemplate=n.titleTemplate)},_formatMessages:function(n){var t=this.from?this.from.value:"",i=this.to?this.to.value:"",r=this.from?this.from.toString():"",u=this.to?this.to.toString():"",f=this.dataType,e=this.type,o=this.comparerType;return kendo.format(n,t,i,r,u,f,e,o)},_setMessages:function(){this.title="";this.message="";this.tooltipTitleTemplate&&(this.tooltipTitle=this._formatMessages(this.tooltipTitleTemplate));this.tooltipMessageTemplate&&(this.tooltipMessage=this._formatMessages(this.tooltipMessageTemplate));this.titleTemplate&&(this.title=this._formatMessages(this.titleTemplate));this.messageTemplate&&(this.message=this._formatMessages(this.messageTemplate))},_getListData:function(){var r,n,t,u,i;if(!this.from.value||!this.from.value.data)return[];for(r=this.from.value.data,u=[],n=0;n<r.length;n++)if(i=r[n],i)for(t=0;t<i.length;t++)u.push(i[t]);return u},clone:function(n,t,i){var u=this._getOptions();return u.from&&(u.from=u.from.clone(n,t,i)),u.to&&(u.to=u.to.clone(n,t,i)),new r($.extend(u,{handler:this.handler},{sheet:n,row:t,col:i}))},exec:function(n,t,i,r){var u=this,f=function(){u.value=u.handler.call(u,t,i);u._setMessages();r&&r(u.value)};u.to?u.to.exec(n,function(){u.from.exec(n,f)}):u.from.exec(n,f)},reset:function(){this.from&&this.from.reset();this.to&&this.to.reset();delete this.value},adjust:function(n,t,i,r){if(this.from&&this.from.adjust(n,t,i,r),this.to&&this.to.adjust(n,t,i,r),this.sheet.toLowerCase()==n.toLowerCase()){var u=this.row,f=this.col;switch(t){case"row":u>=i&&(this.row+=r);break;case"col":f>=i&&(this.col+=r)}}},toJSON:function(){var n=this._getOptions();return n.from&&(n.from=n.from.toString(),n.dataType==="list"&&(n.from=n.from.replace(/^_matrix\((.*)\)$/i,"$1"))),n.to&&(n.to=n.to.toString()),n},_getOptions:function(){return{from:this.from,to:this.to,dataType:this.dataType,type:this.type,comparerType:this.comparerType,row:this.row,col:this.col,sheet:this.sheet,allowNulls:this.allowNulls,tooltipMessageTemplate:this.tooltipMessageTemplate,tooltipTitleTemplate:this.tooltipTitleTemplate,messageTemplate:this.messageTemplate,titleTemplate:this.titleTemplate}}});n.compile=e;n.validationComparers={greaterThan:function(n,t){return n>t},lessThan:function(n,t){return n<t},between:function(n,t,i){return n>t&&n<i},equalTo:function(n,t){return n==t},notEqualTo:function(n,t){return n!=t},greaterThanOrEqualTo:function(n,t){return n>=t},lessThanOrEqualTo:function(n,t){return n<=t},notBetween:function(n,t,i){return n<t||n>i},custom:function(n,t){return t},list:function(n,t){return t.indexOf(n)>-1}};n.Validation=r}}(),function(){(function(n){if(!n.support.browser.msie||!(n.support.browser.version<9)){var i=n.spreadsheet.RangeRef,t=n.spreadsheet.CellRef,r=n.spreadsheet.Range,u=n.Color,f=n.Class.extend({init:function(t){this._sheet=t;this.selection=n.spreadsheet.FIRSTREF.toRangeRef();this.originalSelection=n.spreadsheet.FIRSTREF.toRangeRef();this._activeCell=n.spreadsheet.FIRSTREF.toRangeRef();this.originalActiveCell=n.spreadsheet.FIRSTREF},currentSelectionRange:function(){return this.selection.rangeAt(this.selectionRangeIndex).toRangeRef()},currentOriginalNavigationRange:function(){return this.originalSelection.rangeAt(this.selectionRangeIndex).toRangeRef()},currentNavigationRange:function(){return this.singleCellSelection()?this._sheet._sheetRef:this.selection.rangeAt(this.selectionRangeIndex).toRangeRef()},nextNavigationRange:function(){return this.singleCellSelection()||(this.selectionRangeIndex=this.selection.nextRangeIndex(this.selectionRangeIndex)),this.currentNavigationRange()},previousNavigationRange:function(){return this.singleCellSelection()||(this.selectionRangeIndex=this.selection.previousRangeIndex(this.selectionRangeIndex)),this.currentNavigationRange()},activeCell:function(n){return n&&(this.originalActiveCell=n,this._activeCell=this._sheet.unionWithMerged(n.toRangeRef()),this._sheet.focus(n),this._sheet.triggerChange({activeCell:!0,selection:!0})),this._activeCell},select:function(n,t,i){if(n){if(n.eq(this.originalSelection))return;this.originalSelection=n;this.selection=t;i!==!1?(n.isCell()?this.activeCell(n):this.activeCell(this.selection.lastRange().first()),this.selectionRangeIndex=this.selection.size()-1):this._sheet.triggerChange({selection:!0})}return this.selection},singleCellSelection:function(){return this._activeCell.eq(this.selection)}}),e=n.Observable.extend({init:function(t,i,r,u,e,o){n.Observable.prototype.init.call(this);var s=t*i-1;this._rows=new n.spreadsheet.Axis(t,r);this._columns=new n.spreadsheet.Axis(i,u);this._mergedCells=[];this._frozenRows=0;this._frozenColumns=0;this._suspendChanges=!1;this._filter=null;this._grid=new n.spreadsheet.Grid(this._rows,this._columns,t,i,e,o);this._sheetRef=this._grid.normalize(n.spreadsheet.SHEETREF);this._properties=new n.spreadsheet.PropertyBag(s);this._sorter=new n.spreadsheet.Sorter(this._grid,this._properties.sortable());this._viewSelection=new f(this);this._editSelection=new f(this);this._formulaSelections=[]},_selectionState:function(){return this._inEdit?this._editSelection:this._viewSelection},navigator:function(){return this._navigator||(this._navigator=new n.spreadsheet.SheetNavigator(this)),this._navigator},axisManager:function(){return this._axisManager||(this._axisManager=new n.spreadsheet.AxisManager(this)),this._axisManager},name:function(n){return n?(this._name=n,this):this._name},_property:function(n,t,i){return t===undefined?n():(n(t),this.triggerChange(i))},_field:function(n,t,i){return t===undefined?this[n]:(this[n]=t,this.triggerChange(i))},suspendChanges:function(n){return n===undefined?this._suspendChanges:(this._suspendChanges=n,this)},triggerChange:function(n){return this._suspendChanges||this.trigger("change",n),this},setDataSource:function(t,i){this.dataSourceBinder&&this.dataSourceBinder.destroy();this.dataSourceBinder=new n.spreadsheet.SheetDataSourceBinder({dataSource:t,sheet:this,columns:i})},hideColumn:function(n){return this._property(this._columns.hide.bind(this._columns),n,{layout:!0})},unhideColumn:function(n){return this._property(this._columns.unhide.bind(this._columns),n,{layout:!0})},isHiddenColumn:function(n){return this._grid._columns.hidden(n)},_copyRange:function(n,t){var i=this._grid,r=i.rowCount,u=i.normalize(n.topLeft),f=i.normalize(n.bottomRight),e=u.col*r+u.row,o=f.col*r+f.row,s=t.col*r+t.row;this._properties.copy(e,o,s)},_adjustReferences:function(t,i,r,u){var e,f;this._mergedCells=u.reduce(function(u,f){return f=f.adjust(null,null,null,null,t=="row",i,r),f!==n.spreadsheet.NULLREF&&u.push(f),u},[]);this._workbook&&(e=this._name,this._workbook._sheets.forEach(function(n){n._forFormulas(function(n){n.adjust(e,t,i,r)});n._forValidations(function(n){n.adjust(e,t,i,r)})}));f=this.select();f=f.adjust(null,null,null,null,t=="row",i,r);f!==n.spreadsheet.NULLREF&&this.select(f)},_forFormulas:function(n){var t=this._properties;t.get("formula").values().forEach(function(t){n.call(this,t.value)},this)},_forValidations:function(n){var t=this._properties;t.get("validation").values().forEach(function(t){n.call(this,t.value)},this)},canInsertRow:function(n,t){t=t||1;var i=this._grid,r=this.range(i.rowCount-t,0,t,i.columnCount);return!r.hasValue()},insertRow:function(n){if(!this.canInsertRow(n))throw new Error("Shifting nonblank cells off the worksheet is not supported!");return this.batch(function(){var f=this._grid,c=f.columnCount,l=f.rowCount,s=this.frozenRows(),h,u;for(n<s&&this.frozenRows(s+1),h=this._mergedCells.slice(),u=0;u<c;u++){var o=new i(new t(n,u),new t(n,u)),e=f.normalize(o.topLeft),a=f.normalize(o.bottomRight),v=new i(new t(e.row,e.col),new t(l-2,a.col));this._copyRange(v,new t(e.row+1,e.col));new r(o,this).clear()}this._adjustReferences("row",n,1,h)},{recalc:!0,layout:!0}),this.trigger("insertRow",{index:n}),this},deleteRow:function(n){return this.batch(function(){var f=this._grid,a=f.columnCount,h=this.frozenRows(),c,u,e,s;for(n<h&&this.frozenRows(h-1),c=this._mergedCells.slice(),u=0;u<a;u++){e=new i(new t(n,u),new t(n,u));new r(e,this).clear();var o=f.normalize(e.topLeft),v=f.normalize(e.bottomRight),l=new i(new t(o.row+1,o.col),new t(Infinity,v.col));this._copyRange(l,o);s=f.normalize(l.bottomRight);new r(new i(s,s),this).clear()}this._adjustReferences("row",n,-1,c)},{recalc:!0,layout:!0}),this.trigger("deleteRow",{index:n}),this},insertColumn:function(n){return this.batch(function(){var e=this._grid,l=e.columnCount,s=this.frozenColumns(),h,u,f;for(n<s&&this.frozenColumns(s+1),h=this._mergedCells.slice(),u=l;u>=n;u--){if(f=new i(new t(0,u),new t(Infinity,u)),new r(f,this).clear(),u==n)break;var o=e.normalize(f.topLeft),c=e.normalize(f.bottomRight),a=new i(new t(o.row,o.col-1),new t(c.row,c.col-1));this._copyRange(a,o)}this._adjustReferences("col",n,1,h)},{recalc:!0,layout:!0}),this},deleteColumn:function(n){return this.batch(function(){var e=this._grid,s=e.columnCount,h=this.frozenColumns(),c,u,f;for(n<h&&this.frozenColumns(h-1),c=this._mergedCells.slice(),u=n;u<s;u++){if(f=new i(new t(0,u),new t(Infinity,u)),new r(f,this).clear(),u==s-1)break;var o=e.normalize(f.topLeft),l=e.normalize(f.bottomRight),a=new i(new t(o.row,o.col+1),new t(l.row,l.col+1));this._copyRange(a,o)}this._adjustReferences("col",n,-1,c)},{recalc:!0,layout:!0}),this},hideRow:function(n){return this._property(this._rows.hide.bind(this._rows),n,{layout:!0})},unhideRow:function(n){return this._property(this._rows.unhide.bind(this._rows),n,{layout:!0})},isHiddenRow:function(n){return this._grid._rows.hidden(n)},columnWidth:function(n,t){return this._property(this._columns.value.bind(this._columns,n,n),t,{layout:!0})},rowHeight:function(n,t){return this._property(this._rows.value.bind(this._rows,n,n),t,{layout:!0})},frozenRows:function(n){return this._field("_frozenRows",n,{layout:!0})},frozenColumns:function(n){return this._field("_frozenColumns",n,{layout:!0})},_ref:function(r,u,f,e){var o=null;return r instanceof n.spreadsheet.Ref?r:(typeof r=="string"?o=n.spreadsheet.calc.parseReference(r):(f||(f=1),e||(e=1),o=new i(new t(r,u),new t(r+f-1,u+e-1))),o)},range:function(n,t,i,u){return new r(this._ref(n,t,i,u),this)},forEachMergedCell:function(n,t){var i=!1;typeof t=="undefined"&&(t=n,i=!0);this._mergedCells.forEach(function(r){(i||r.intersects(n))&&t(r)})},forEachFilterHeader:function(n,t){var r=!1,i;typeof t=="undefined"&&(t=n,r=!0);this._filter&&(i=[],this._filter.ref.forEachColumn(function(t){(r||t.intersects(n))&&i.push(t.topLeft)}),this._mergedCells.forEach(function(n){i=i.map(function(t){return n.intersects(t)?n:t})}),i.reduce(function(n,t){return n.indexOf(t)<0&&n.push(t),n},[]).forEach(t))},forEach:function(n,t){for(var r=this._grid.normalize(n.topLeft),u=this._grid.normalize(n.bottomRight),i=r.col;i<=u.col;i++){var f=r.row,e=this._grid.index(f,i),o=this._grid.index(u.row,i);this._properties.forEach(e,o,function(n){t(f++,i,n)})}},startResizing:function(n){this._initialPosition=n;this._resizeInProgress=!0},startAutoFill:function(){this._autoFillInProgress=!0;var n=this.select();this._autoFillOrigin=n;this._autoFillDest=n;this.triggerChange({selection:!0})},updateAutoFill:function(n,t,i,r){this._autoFillDest=n;this._autoFillPunch=t;this._autoFillHint=i;this._autoFillDirection=r;this.triggerChange({selection:!0})},autoFillRef:function(){return this._autoFillDest},autoFillPunch:function(){return this._autoFillPunch},autoFillInProgress:function(){return this._autoFillInProgress},resizingInProgress:function(){return this._resizeInProgress},completeResizing:function(){var t,n;this._resizeInProgress&&(this._resizeInProgress=!1,t=this.resizeHintPosition(),this._initialPosition&&t?(n=this.resizeHandlePosition(),n.col!==-Infinity?this.columnWidth(n.col,this.columnWidth(n.col)-(this._initialPosition.x-t.x)):this.rowHeight(n.row,this.rowHeight(n.row)-(this._initialPosition.y-t.y))):this.trigger("change",{resize:!0}))},resizeHandlePosition:function(){return this._resizeHandlePosition},resizeHintPosition:function(n){return n!==undefined&&(this._resizeHintPosition=n,this.trigger("change",{resize:!0})),this._resizeHintPosition},removeResizeHandle:function(){this._resizeHandlePosition&&(this._resizeHintPosition=undefined,this._resizeHandlePosition=undefined,this._initialPosition=undefined,this.trigger("change",{resize:!0}))},positionResizeHandle:function(n){this._resizeHandlePosition=n;this.trigger("change",{resize:!0})},startSelection:function(){this._selectionInProgress=!0},completeSelection:function(){if(this._selectionInProgress&&(this._selectionInProgress=!1,this._resizeHintPosition=undefined,this.trigger("change",{selection:!0})),this._autoFillInProgress){this._autoFillInProgress=!1;var n=this._autoFillDest,t=this._autoFillOrigin;this._autoFillPunch?this._workbook.execute({command:"ClearContentCommand",options:{operatingRange:this.range(this._autoFillPunch)}}):n.eq(t)?this.triggerChange({selection:!0}):this._workbook.execute({command:"AutoFillCommand",options:{operatingRange:this.range(n),origin:this.range(t)}});this._autoFillDest=null;this._autoFillPunch=null;this._autoFillOrigin=null;this.select(n)}},selectionInProgress:function(){return this._selectionInProgress},select:function(n,t){var r=this._selectionState(),i;return n&&(n=this._ref(n),i=this._grid.isAxis(n)?n:this.unionWithMerged(n)),r.select(n,i,t)},originalSelect:function(){return this._selectionState().originalSelection},currentSelectionRange:function(){return this._selectionState().currentSelectionRange()},currentOriginalSelectionRange:function(){return this._selectionState().currentOriginalNavigationRange()},currentNavigationRange:function(){return this._selectionState().currentNavigationRange()},nextNavigationRange:function(){return this._selectionState().nextNavigationRange()},previousNavigationRange:function(){return this._selectionState().previousNavigationRange()},selectionRangeIndex:function(){return this._selectionState().selectionRangeIndex},activeCell:function(n){return this._selectionState().activeCell(n)},originalActiveCell:function(){return this._selectionState().originalActiveCell},singleCellSelection:function(){return this._selectionState().singleCellSelection()},unionWithMerged:function(n){var t=this._mergedCells;return n.map(function(n){return n.toRangeRef().union(t)})},trim:function(n){var t=[],i=this._grid;return this._properties.forEachProperty(function(r){t.push(i.trim(n,r.list))}),this.unionWithMerged(n.topLeft.toRangeRef().union(t))},focus:function(n){if(n)this._focus=n.toRangeRef();else{var t=this._focus;return this._focus=null,t}},activeCellSelection:function(){return new r(this._grid.normalize(this.activeCell()),this)},selection:function(){return new r(this._grid.normalize(this._selectionState().selection),this)},selectedHeaders:function(){var u=this.select(),n={},t={},i=!1,r=!1;return u.forEach(function(u){var f,o="partial",s="partial";u=u.toRangeRef();var e=u.bottomRight,h=e.col===Infinity,c=e.row===Infinity;if(c&&(r=!0,s="full"),h&&(i=!0,o="full"),!c)for(f=u.topLeft.row;f<=e.row;f++)n[f]!=="full"&&(n[f]=o);if(!h)for(f=u.topLeft.col;f<=e.col;f++)t[f]!=="full"&&(t[f]=s)}),{rows:n,cols:t,allRows:r,allCols:i,all:r&&i}},isInEditMode:function(n){if(n===undefined)return this._inEdit;this._inEdit=n;n&&(this._editSelection.selection=this._viewSelection.selection.clone(),this._editSelection.originalSelection=this._viewSelection.originalSelection.clone(),this._editSelection._activeCell=this._viewSelection._activeCell.clone(),this._editSelection.originalActiveCell=this._viewSelection.originalActiveCell.clone())},_setFormulaSelections:function(n){this._formulaSelections=(n||[]).slice();this.triggerChange({selection:!0})},_viewActiveCell:function(){return this._viewSelection._activeCell.toRangeRef()},toJSON:function(){var r={},t=this._rows.toJSON("height",r),e=this._columns.toJSON("width",{}),f=this._viewSelection,i;return this.forEach(n.spreadsheet.SHEETREF,function(n,i,f){if(Object.keys(f).length!==0){var e=r[n];e===undefined&&(e=t.length,t.push({index:n}),r[n]=e);n=t[e];f.index=i;n.cells===undefined&&(n.cells=[]);f.formula&&(f.formula=f.formula.toString());f.validation&&(f.validation=f.validation.toJSON());f.color&&(f.color=new u(f.color).toHex());f.background&&(f.background=new u(f.background).toHex());f.borderTop&&f.borderTop.color&&(f.borderTop.color=new u(f.borderTop.color).toHex());f.borderBottom&&f.borderBottom.color&&(f.borderBottom.color=new u(f.borderBottom.color).toHex());f.borderRight&&f.borderRight.color&&(f.borderRight.color=new u(f.borderRight.color).toHex());f.borderLeft&&f.borderLeft.color&&(f.borderLeft.color=new u(f.borderLeft.color).toHex());n.cells.push(f)}}),i={name:this._name,rows:t,columns:e,selection:f.selection.toString(),activeCell:f.activeCell().toString(),frozenRows:this.frozenRows(),frozenColumns:this.frozenColumns(),mergedCells:this._mergedCells.map(function(n){return n.toString()})},this._sort&&(i.sort={ref:this._sort.ref.toString(),columns:this._sort.columns.map(function(n){return{index:n.index,ascending:n.ascending}})}),this._filter&&(i.filter={ref:this._filter.ref.toString(),columns:this._filter.columns.map(function(n){var t=n.filter.toJSON();return t.index=n.index,t})}),i},fromJSON:function(t){this.batch(function(){var f,e,r,o,i,u,s,h;if(t.name!==undefined&&(this._name=t.name),t.frozenColumns!==undefined&&this.frozenColumns(t.frozenColumns),t.frozenRows!==undefined&&this.frozenRows(t.frozenRows),t.columns!==undefined&&this._columns.fromJSON("width",t.columns),t.rows!==undefined)for(this._rows.fromJSON("height",t.rows),f=0;f<t.rows.length;f++)if(e=t.rows[f],r=e.index,r===undefined&&(r=f),e.cells)for(o=0;o<e.cells.length;o++)i=e.cells[o],u=i.index,u===undefined&&(u=o),i.formula&&(i.formula=this._compileFormula(r,u,i.formula)),i.validation&&(i.validation=this._compileValidation(r,u,i.validation)),this._properties.fromJSON(this._grid.index(r,u),i);t.selection&&(this._viewSelection.selection=this._viewSelection.originalSelection=this._ref(t.selection));t.activeCell&&(s=this._ref(t.activeCell),this._viewSelection._activeCell=s.toRangeRef(),this._viewSelection.originalActiveCell=s);t.mergedCells&&t.mergedCells.forEach(function(n){this.range(n).merge()},this);t.sort&&(this._sort={ref:this._ref(t.sort.ref),columns:t.sort.columns.slice(0)});t.filter&&(h=t.filter.ref,h?this._filter={ref:this._ref(h),columns:t.filter.columns.map(function(t){return{index:t.index,filter:n.spreadsheet.Filter.create(t)}})}:n.logToConsole("Dropping filter for sheet '"+t.name+"' due to missing ref"))})},formula:function(n){return this._properties.get("formula",this._grid.cellRefIndex(n))},validation:function(n){return this._properties.get("validation",this._grid.cellRefIndex(n))},resetFormulas:function(){this._forFormulas(function(n){n.reset()})},resetValidations:function(){this._forValidations(function(n){n.reset()})},recalc:function(n){this._forFormulas(function(t){t.exec(n)})},revalidate:function(n){var r=this;this._forValidations(function(u){var f=new t(u.row,u.col),e=new i(f,f);u.exec(n,r._get(e,"value"),r._get(e,"format"))})},_value:function(n,t,i){var r=this._grid.index(n,t);if(i!==undefined)this._properties.set("value",r,r,i);else return this._properties.get("value",r)},_validation:function(n,t){var i=this._grid.index(n,t);return this._properties.get("validation",i)},_compileValidation:function(t,i,r){return r.from&&(r.from=(r.from+"").replace(/^=/,"")),r.to&&(r.to=(r.to+"").replace(/^=/,"")),n.spreadsheet.validation.compile(this._name,t,i,r)},_compileFormula:function(t,i,r){return r=r.replace(/^=/,""),r=n.spreadsheet.calc.parseFormula(this._name,t,i,r),n.spreadsheet.calc.compile(r)},_copyValuesInRange:function(n,t,i,r){for(var o,s,f,e,u=n.col;u<=t.col;u++)for(o=this._grid.index(n.row,u),s=this._grid.index(t.row,u),f=o,e=n.row;f<=s;++f,++e)i=i.clone(this._name,e,u),this._properties.set(r,f,f,i);return i},_set:function(n,t,i){var r=this._grid.normalize(n.topLeft),f=this._grid.normalize(n.bottomRight),u,e,o;if(i&&t=="formula")typeof i=="string"&&(i=this._compileFormula(r.row,r.col,i)),i=this._copyValuesInRange(r,f,i,"formula");else if(i&&t=="validation")i=this._compileValidation(r.row,r.col,i),i=this._copyValuesInRange(r,f,i,"validation");else for(u=r.col;u<=f.col;u++)e=this._grid.index(r.row,u),o=this._grid.index(f.row,u),this._properties.set(t,e,o,i),t=="formula"&&this._properties.set("value",e,o,null)},_get:function(n,t){var i=this._grid.normalize(n.topLeft),r=this._grid.index(i.row,i.col);return this._properties.get(t,r)},batch:function(n,t){var i=this.suspendChanges();return this.suspendChanges(!0),n.call(this),this.suspendChanges(i).triggerChange(t)},_sortBy:function(n,t){var i=null;t.forEach(function(t){i=this._sorter.sortBy(n,t.index,this._properties.get("value"),t.ascending,i)},this);this._sort={ref:n,columns:t};this._refreshFilter();this.triggerChange({recalc:!0})},_refreshFilter:function(){this._filter&&this._filterBy(this._filter.ref,this._filter.columns)},_filterBy:function(t,i){this.batch(function(){for(var r=t.topLeft.row;r<=t.bottomRight.row;r++)this._rows.hidden(r)&&this._rows.unhide(r);i.forEach(function(i){var e=t.resize({top:1}).toColumn(i.index),r=[],u,f,o;if(e!==n.spreadsheet.NULLREF)for(this.forEach(e,function(n,t,i){i.row=n;r.push(i)}),i.filter.prepare(r),u=0;u<r.length;u++)f=r[u],o=i.filter.value(f),i.filter.matches(o)===!1&&this.hideRow(f.row)},this);this._filter={ref:t,columns:i}},{layout:!0,filter:!0})},filter:function(){return this._filter},clearFilter:function(n){this._clearFilter(n instanceof Array?n:[n])},_clearFilter:function(n){this._filter&&this.batch(function(){this._filter.columns=this._filter.columns.filter(function(t){return n.indexOf(t.index)<0});this._refreshFilter()},{layout:!0,filter:!0})},getAxisState:function(){return{rows:this._rows.getState(),columns:this._columns.getState()}},setAxisState:function(n){this._rows.setState(n.rows);this._columns.setState(n.columns);this.triggerChange({layout:!0})},getState:function(){return{rows:this._rows.getState(),columns:this._columns.getState(),mergedCells:this._mergedCells.map(function(n){return n.clone()}),properties:this._properties.getState()}},setState:function(t){this._rows.setState(t.rows);this._columns.setState(t.columns);this._mergedCells=t.mergedCells;this._properties.setState(t.properties);this.triggerChange(n.spreadsheet.ALL_REASONS)},_merge:function(t){var u=this._mergedCells,i=this,f;return this.batch(function(){f=t.map(function(t){var o;if(t instanceof n.spreadsheet.CellRef)return t;var e=t.toRangeRef().union(u,function(n){u.splice(u.indexOf(n),1)}),f=new r(e,i),s=f.value(),h=f.format(),c=f.background();return f.value(null),f.format(null),f.background(null),o=new r(e.collapse(),i),o.value(s),o.format(h),o.background(c),u.push(e),e});var e=i._viewSelection;e.selection=i.unionWithMerged(e.originalSelection);e._activeCell=i.unionWithMerged(e.originalActiveCell)},{activeCell:!0,selection:!0}),f}});n.spreadsheet.Sheet=e}})(kendo)}(),function(){(function(n){if(!n.support.browser.msie||!(n.support.browser.version<9)){var u=n.jQuery,i=".",t=" ",r=n.ui.Widget.extend({init:function(t,u){var f=r.classNames;n.ui.Widget.call(this,t,u);t=this.element;t.addClass(f.sheetsBarWrapper);this._tree=new n.dom.Tree(t[0]);this._tree.render([this._addButton(),this._createSheetsWrapper([])]);this._createSortable();this._sortable.bind("start",this._onSheetReorderStart.bind(this));this._sortable.bind("end",this._onSheetReorderEnd.bind(this));t.on("click",i+f.sheetsBarRemove,this._onSheetRemove.bind(this));t.on("click","li",this._onSheetSelect.bind(this));t.on("dblclick","li"+i+f.sheetsBarActive,this._createEditor.bind(this));t.on("click",i+f.sheetsBarAdd,this._onAddSelect.bind(this))},options:{name:"SheetsBar",scrollable:{distance:200}},events:["select","reorder","rename"],_createEditor:function(){this._editor||(this._renderSheets(this._sheets,this._selectedIndex,!0),this._editor=this.element.find(n.format("input{0}{1}",i,r.classNames.sheetsBarEditor)).focus().on("keydown",this._onEditorKeydown.bind(this)).on("blur",this._onEditorBlur.bind(this)))},_destroyEditor:function(){this._editor.off();this._editor=null;this._renderSheets(this._sheets,this._selectedIndex,!1)},renderSheets:function(n,t){!n||t<0||this._renderSheets(n,t,!1)},_renderSheets:function(u,f,e){var o=this,a,v,c,l,s=o._sheetsWrapper(),y=o._sheetsGroup(),p=o.options,h=r.classNames;if(o._sheets=u,o._selectedIndex=f,!o._scrollableAllowed()){o._renderHtml(e,!1);return}if(s.addClass(h.sheetsBarScrollable+t+h.sheetsBarSheetsWrapper),a=s[0].offsetWidth,v=y[0].scrollWidth,v>a&&!o._scrollableModeActive){o._nowScrollingSheets=!1;o._isRtl=n.support.isRtl(o.element);o._renderHtml(e,!0);c=s.children(i+h.sheetsBarPrev);l=s.children(i+h.sheetsBarNext);y.css({marginLeft:c.outerWidth()+9,marginRight:l.outerWidth()+12});c.on("mousedown",function(){o._nowScrollingSheets=!0;o._scrollSheetsByDelta(p.scrollable.distance*(o._isRtl?1:-1))});l.on("mousedown",function(){o._nowScrollingSheets=!0;o._scrollSheetsByDelta(p.scrollable.distance*(o._isRtl?-1:1))});c.add(l).on("mouseup",function(){o._nowScrollingSheets=!1});o._scrollableModeActive=!0;o._toggleScrollButtons()}else o._scrollableModeActive&&v<=a?(o._scrollableModeActive=!1,s.children(i+h.sheetsBarPrev).off(),s.children(i+h.sheetsBarNext).off(),o._renderHtml(e,!1),o._sheetsGroup().css({marginLeft:"",marginRight:""})):o._renderHtml(e,!1)},_renderHtml:function(i,u){for(var c=[],l=n.dom,o=l.element,a=this._sheets,w=this._selectedIndex,f=r.classNames,p,e=0;e<a.length;e++){var h=a[e],v=e===w,y={className:f.sheetsBarKItem+t},s=[];y.className+=v?f.sheetsBarKActive+t+f.sheetsBarActive:f.sheetsBarInactive;v&&i?s.push(o("input",{type:"text",value:h.name(),className:f.sheetsBarKTextbox+t+f.sheetsBarEditor,maxlength:50},[])):(s.push(o("span",{className:f.sheetsBarKLink,title:h.name()},[l.text(h.name())])),p=o("span",{className:f.sheetsBarKIcon+t+f.sheetsBarKFontIcon+t+f.sheetsBarKIconX},[]),s.push(o("span",{className:f.sheetsBarKLink+t+f.sheetsBarRemove},[p])));c.push(o("li",y,s))}this._tree.render([this._addButton(),this._createSheetsWrapper(c,u)])},_createSheetsWrapper:function(i,u){var e=n.dom.element,f=r.classNames,o=[e("ul",{style:{paddingLeft:"50px"},className:f.sheetsBarKReset},i)],s;return u&&(s=f.sheetsBarKButton+t+f.sheetsBarKButtonBare+t,o.push(e("span",{className:s+f.sheetsBarPrev},[e("span",{className:f.sheetsBarKIcon+t+f.sheetsBarKArrowW},[])])),o.push(e("span",{className:s+f.sheetsBarNext},[e("span",{className:f.sheetsBarKIcon+t+f.sheetsBarKArrowE},[])]))),e("div",{className:f.sheetsBarItems},o)},_createSortable:function(){var t=r.classNames;this._sortable=new n.ui.Sortable(this.element,{filter:n.format("ul li.{0},ul li.{1}",t.sheetsBarActive,t.sheetsBarInactive),container:i+t.sheetsBarItems,axis:"x",animation:!1,ignore:"input",hint:function(n){var i=u(n).clone();return i.wrap("<div class='"+t.sheetsBarHintWrapper+"'><ul class='"+t.sheetsBarKResetItems+"'><\/ul><\/div>").closest("div")}})},_onEditorKeydown:function(n){this._editor&&(n.which===13&&(this._destroyEditor(),this._onSheetRename(u(n.target).val())),n.which===27&&(this._destroyEditor(),this._onSheetRename()))},_onEditorBlur:function(n){this._editor&&(this._destroyEditor(),this._onSheetRename(u(n.target).val()))},_onSheetReorderEnd:function(n){n.preventDefault();this.trigger("reorder",{oldIndex:n.oldIndex,newIndex:n.newIndex})},_onSheetReorderStart:function(n){this._editor&&n.preventDefault()},_onSheetRemove:function(n){var t=u(n.target).closest("li").text();this._editor&&(this._destroyEditor(),this._onSheetRename(this._editor.val()));this.trigger("remove",{name:t})},_onSheetSelect:function(n){var t=u(n.target).text(),f;if(u(n.target).is(i+r.classNames.sheetsBarEditor)||!t){n.preventDefault();return}this._editor&&(f=this._editor.val(),this._destroyEditor(),this._onSheetRename(f));this.trigger("select",{name:t,isAddButton:!1})},_onSheetRename:function(n){this.trigger("rename",{name:n,sheetIndex:this._selectedIndex})},_onAddSelect:function(){this.trigger("select",{isAddButton:!0})},_addButton:function(){var u=n.dom.element,i=r.classNames;return u("a",{className:i.sheetsBarAdd+t+i.sheetsBarKButton},[u("span",{className:i.sheetsBarKSprite+t+i.sheetsBarKIcon+t+i.sheetsBarKFontIcon+t+i.sheetsBarKIconPlus},[])])},destroy:function(){this._sortable.destroy()},_scrollableAllowed:function(){var n=this.options;return n.scrollable&&!isNaN(n.scrollable.distance)},_scrollSheetsToItem:function(n){var f=this,i=f._sheetsGroup(),r=i.scrollLeft(),e=n.outerWidth(),t=f._isRtl?n.position().left:n.position().left-i.children().first().position().left,o=i[0].offsetWidth,s=Math.ceil(parseFloat(i.css("padding-left"))),u;f._isRtl?t<0?u=r+t-(o-r)-s:t+e>o&&(u=r+t-e+s*2):r+o<t+e?u=t+e-o+s*2:r>t&&(u=t-s);i.finish().animate({scrollLeft:u},"fast","linear",function(){f._toggleScrollButtons()})},_sheetsGroup:function(){return this._sheetsWrapper().children("ul")},_sheetsWrapper:function(){return this.element.find(i+r.classNames.sheetsBarItems)},_scrollSheetsByDelta:function(n){var t=this,i=t._sheetsGroup(),r=i.scrollLeft();i.finish().animate({scrollLeft:r+n},"fast","linear",function(){t._nowScrollingSheets?t._scrollSheetsByDelta(n):t._toggleScrollButtons()})},_toggleScrollButtons:function(){var t=this,n=t._sheetsGroup(),f=t._sheetsWrapper(),u=n.scrollLeft();f.find(i+r.classNames.sheetsBarPrev).toggle(t._isRtl?u<n[0].scrollWidth-n[0].offsetWidth-1:u!==0);f.find(i+r.classNames.sheetsBarNext).toggle(t._isRtl?u!==0:u<n[0].scrollWidth-n[0].offsetWidth-1)}});n.spreadsheet.SheetsBar=r;u.extend(!0,r,{classNames:{sheetsBarWrapper:"k-widget k-header",sheetsBarSheetsWrapper:"k-tabstrip k-floatwrap k-tabstrip-bottom",sheetsBarActive:"k-spreadsheet-sheets-bar-active",sheetsBarInactive:"k-spreadsheet-sheets-bar-inactive",sheetsBarAdd:"k-spreadsheet-sheets-bar-add",sheetsBarRemove:"k-spreadsheet-sheets-remove",sheetsBarItems:"k-spreadsheet-sheets-items",sheetsBarEditor:"k-spreadsheet-sheets-editor",sheetsBarScrollable:"k-spreadsheet-sheets-scrollable",sheetsBarNext:"k-spreadsheet-sheets-next",sheetsBarPrev:"k-spreadsheet-sheets-prev",sheetsBarKItem:"k-item k-state-default",sheetsBarKActive:"k-state-active k-state-tab-on-top",sheetsBarKTextbox:"k-textbox",sheetsBarKLink:"k-link",sheetsBarKIcon:"k-icon",sheetsBarKFontIcon:"k-font-icon",sheetsBarKButton:"k-button k-button-icon",sheetsBarKButtonBare:"k-button-bare",sheetsBarKArrowW:"k-i-arrow-w",sheetsBarKArrowE:"k-i-arrow-e",sheetsBarKReset:"k-reset k-tabstrip-items",sheetsBarKIconX:"k-i-x",sheetsBarKSprite:"k-sprite",sheetsBarKIconPlus:"k-i-plus",sheetsBarHintWrapper:"k-widget k-tabstrip k-tabstrip-bottom k-spreadsheet-sheets-items-hint",sheetsBarKResetItems:"k-reset k-tabstrip-items"}})}})(window.kendo)}(),function(){(function(n){if(!n.support.browser.msie||!(n.support.browser.version<9)){var t=n.jQuery,i=n.Observable.extend({init:function(t,i){n.Observable.fn.init.call(this);this.options=t;this._view=i;this._sheets=[];this._sheetsSearchCache={};this._sheet=this.insertSheet({rows:this.options.rows,columns:this.options.columns,rowHeight:this.options.rowHeight,columnWidth:this.options.columnWidth,headerHeight:this.options.headerHeight,headerWidth:this.options.headerWidth,dataSource:this.options.dataSource});this.undoRedoStack=new n.util.UndoRedoStack;this.undoRedoStack.bind(["undo","redo"],this._onUndoRedo.bind(this));this._context=new n.spreadsheet.FormulaContext(this);this._validationContext=new n.spreadsheet.ValidationFormulaContext(this);this.fromJSON(this.options)},clipboard:function(){return this._clipboard||(this._clipboard=new n.spreadsheet.Clipboard(this)),this._clipboard},destroy:function(){this.unbind();this._clipboard&&this._clipboard.destroy()},events:["change"],_sheetChange:function(n){this.trigger("change",n)},_inputForRef:function(t){return new n.spreadsheet.Range(t,this._sheet).input()},_onUndoRedo:function(n){n.command.range().select()},execute:function(i){var r=t.extend({workbook:this},i.options),u=new n.spreadsheet[i.command](r),e=this.activeSheet(),f;return r.origin&&u.origin(r.origin),r.operatingRange?u.range(r.operatingRange):r.editActiveCell?u.range(e.activeCellSelection()):u.range(e.selection()),f=u.exec(),f&&f.reason==="error"||this.undoRedoStack.push(u),f},resetFormulas:function(){this._sheets.forEach(function(n){n.resetFormulas()})},resetValidations:function(){this._sheets.forEach(function(n){n.resetValidations()})},refresh:function(n){n.recalc&&(this.resetFormulas(),this.resetValidations(),this._sheet.recalc(this._context),this._sheet.revalidate(this._validationContext))},activeSheet:function(t){if(t===undefined)return this._sheet;this.sheetByName(t.name())&&(this._sheet=t,t.triggerChange(n.spreadsheet.ALL_REASONS))},moveSheetToIndex:function(n,t){var i=this.sheetIndex(n),r=this._sheets;i!==-1&&(this._sheetsSearchCache={},r.splice(t,0,r.splice(i,1)[0]),this.trigger("change",{sheetSelection:!0}))},insertSheet:function(t){var i;t=t||{};var r=this,e=typeof t.index=="number"?t.index:r._sheets.length,u,o=r._sheets,f=function(n){n=n?n:1;var t="Sheet"+n;return r.sheetByName(t)?f(n+1):t};if(!t.name||!r.sheetByName(t.name))return this._sheetsSearchCache={},u=t.name||f(),i=new n.spreadsheet.Sheet(t.rows||this.options.rows,t.columns||this.options.columns,t.rowHeight||this.options.rowHeight,t.columnWidth||this.options.columnWidth,t.headerHeight||this.options.headerHeight,t.headerWidth||this.options.headerWidth),i._workbook=this,i.name(u),i.bind("change",this._sheetChange.bind(this)),o.splice(e,0,i),t.data&&i.fromJSON(t.data),t.dataSource&&i.setDataSource(t.dataSource),this.trigger("change",{sheetSelection:!0}),i},sheets:function(){return this._sheets.slice()},sheetByName:function(n){return this._sheets[this.sheetIndex(n)]},sheetByIndex:function(n){return this._sheets[n]},sheetIndex:function(n){var r=this._sheets,u=(typeof n=="string"?n:n.name()).toLowerCase(),t=this._sheetsSearchCache[u],i;if(t>=0)return t;for(t=0;t<r.length;t++)if(i=r[t].name().toLowerCase(),this._sheetsSearchCache[i]=t,i===u)return t;return-1},renameSheet:function(n,t){var i=n.name();if(t&&i!==t)return(n=this.sheetByName(i),!n)?void 0:(this._sheetsSearchCache={},this._sheets.forEach(function(n){n._forFormulas(function(n){n.renameSheet(i,t)})}),n.name(t),this.trigger("change",{sheetSelection:!0}),n)},removeSheet:function(n){var i=this,r=i._sheets,f=n.name(),t=i.sheetIndex(n),u;r.length!==1&&(this._sheetsSearchCache={},t>-1&&(n.unbind(),r.splice(t,1),i.activeSheet().name()===f?(u=r[t===r.length?t-1:t],i.activeSheet(u)):this.trigger("change",{recalc:!0,sheetSelection:!0})))},fromJSON:function(n){var t,i,r;if(n.sheets)for(t=0;t<n.sheets.length;t++)i=this.sheetByIndex(t),i||(i=this.insertSheet()),i.fromJSON(n.sheets[t]),r=n.sheets[t].dataSource,r&&i.setDataSource(r);n.activeSheet&&this.activeSheet(this.sheetByName(n.activeSheet))},toJSON:function(){return this.resetFormulas(),this.resetValidations(),{activeSheet:this.activeSheet().name(),sheets:this._sheets.map(function(n){return n.recalc(this._context),n.toJSON()},this)}},saveAsExcel:function(i){var r,u;i=t.extend({},this.options.excel,i);r=this.toJSON();this.trigger("excelExport",{workbook:r})||(u=new n.ooxml.Workbook(r),n.saveAs({dataURI:u.toDataURL(),fileName:r.fileName||i.fileName,proxyURL:i.proxyURL,forceProxy:i.forceProxy}))}});n.spreadsheet.Workbook=i}})(kendo)}(),function(){if(!kendo.support.browser.msie||!(kendo.support.browser.version<9)){var n=kendo.spreadsheet,t=kendo.spreadsheet.CellRef,r=kendo.spreadsheet.RangeRef,u=kendo.spreadsheet.UnionRef,f=kendo.spreadsheet.NameRef,i=kendo.Class.extend({init:function(n){this.workbook=n},getRefCells:function(n,i){var e,h,c,o,y,s,k,l,a,b,v;if(n instanceof t)return(e=this.workbook.sheetByName(n.sheet),!e)?[{value:new kendo.spreadsheet.calc.runtime.CalcError("REF")}]:(h=e.formula(n),c=e.range(n.row,n.col).value(),h!=null||c!=null?[{formula:h,value:c,row:n.row,col:n.col,sheet:n.sheet,hidden:i?e.columnWidth(n.col)===0||e.rowHeight(n.row)===0:!1}]:[]);if(n instanceof r){if(o=this.workbook.sheetIndex(n.sheet),y=[],s=o,n.endSheet&&(s=this.workbook.sheetIndex(n.endSheet),o>s&&(k=o,o=s,s=k)),o<0||s<0)return[{value:new kendo.spreadsheet.calc.runtime.CalcError("REF")}];while(o<=s){e=this.workbook.sheetByIndex(o++);var p=e._grid.normalize(n.topLeft),w=e._grid.normalize(n.bottomRight),d=e._grid.cellRefIndex(p),g=e._grid.cellRefIndex(w),nt=e._properties.iterator("value",d,g);for(l=p.col;l<=w.col;++l)for(a=p.row;a<=w.row;++a)b=e._grid.index(a,l),h=e._properties.get("formula",b),c=nt.at(b),(h!=null||c!=null)&&y.push({formula:h,value:c,row:a,col:l,sheet:e.name(),hidden:i?e.columnWidth(l)===0||e.rowHeight(a)===0:!1})}return y}if(n instanceof u){for(v=[],o=0;o<n.refs.length;++o)v=v.concat(this.getRefCells(n.refs[o],i));return v}return n instanceof f?[{value:new kendo.spreadsheet.calc.runtime.CalcError("NAME")}]:[]},getData:function(n){var i=this.getRefCells(n).map(function(n){return n.value});return n instanceof t?i[0]:i},onFormula:function(n){var t=this.workbook.sheetByName(n.sheet),i=n.row,r=n.col,u=n.value,f=t.formula({row:i,col:r});return f!==n?!1:(u instanceof kendo.spreadsheet.calc.runtime.Matrix?u.each(function(n,u,f){t._value(i+u,r+f,n)}):t._value(i,r,u),!0)}}),e=i.extend({onFormula:function(){return!0}});n.FormulaContext=i;n.ValidationFormulaContext=e}}(),function(){(function(n){"use strict";function l(n){return n.map(function(n){return'[data-action="'+n+'"]'}).join(",")}var r,v;if(!n.support.browser.msie||!(n.support.browser.version<9)){var t=n.jQuery,y=/:alphanum$/,i={up:"up",down:"down",left:"left",right:"right",home:"first-col","ctrl+left":"first-col",end:"last-col","ctrl+right":"last-col","ctrl+up":"first-row","ctrl+down":"last-row","ctrl+home":"first","ctrl+end":"last",pageup:"prev-page",pagedown:"next-page"},f={tab:"next","shift+tab":"previous",enter:"lower","shift+enter":"upper","delete":"clearContents",backspace:"clearContents","shift+:alphanum":"edit",":alphanum":"edit","ctrl+:alphanum":"ctrl",":edit":"edit"},p={wheel:"onWheel","*+mousedown":"onMouseDown",contextmenu:"onContextMenu","*+mousedrag":"onMouseDrag","*+mouseup":"onMouseUp","*+dblclick":"onDblClick",mousemove:"onMouseMove"},u={"*+pageup":"onPageUp","*+pagedown":"onPageDown",mouseup:"onMouseUp","*+cut":"onCut","*+paste":"onPaste","*+copy":"onCopy"},h={esc:"onEditorEsc",enter:"onEditorBlur","shift+enter":"onEditorBlur",tab:"onEditorBlur","shift+tab":"oonEditorBlur"},w=t.extend({focus:"onEditorBarFocus"},h),e=t.extend({focus:"onEditorCellFocus"},h),c={cell:"range",rowheader:"row",columnheader:"column",topcorner:"sheet",autofill:"autofill"};var b=l(["cut","copy","paste","insert-left","insert-right","insert-above","insert-below"]),k=l(["unhide-row","unhide-column"]),o=[],s=[],a=[];for(r in i)o.push(r),s.push("shift+"+r);for(r in f)a.push(r);u[o]="onAction";u[s]="onShiftAction";u[a]="onEntryAction";e[o]="onEditorAction";e[s]="onEditorShiftAction";v=n.Class.extend({init:function(i,r){this.view=i;this.workbook(r);this.container=t(i.container);this.clipboardElement=t(i.clipboard);this.cellContextMenu=i.cellContextMenu;this.rowHeaderContextMenu=i.rowHeaderContextMenu;this.colHeaderContextMenu=i.colHeaderContextMenu;this.scroller=i.scroller;this.tabstrip=i.tabstrip;this.sheetsbar=i.sheetsbar;this.editor=i.editor;this.editor.bind("change",this.onEditorChange.bind(this));this.editor.bind("activate",this.onEditorActivate.bind(this));this.editor.bind("deactivate",this.onEditorDeactivate.bind(this));this.editor.bind("update",this.onEditorUpdate.bind(this));t(i.scroller).on("scroll",this.onScroll.bind(this));this.listener=new n.spreadsheet.EventListener(this.container,this,p);this.keyListener=new n.spreadsheet.EventListener(this.clipboardElement,this,u);this.barKeyListener=new n.spreadsheet.EventListener(this.editor.barElement(),this,w);this.inputKeyListener=new n.spreadsheet.EventListener(this.editor.cellElement(),this,e);this.sheetsbar&&(this.sheetsbar.bind("select",this.onSheetBarSelect.bind(this)),this.sheetsbar.bind("reorder",this.onSheetBarReorder.bind(this)),this.sheetsbar.bind("rename",this.onSheetBarRename.bind(this)),this.sheetsbar.bind("remove",this.onSheetBarRemove.bind(this)));this.cellContextMenu.bind("select",this.onContextMenuSelect.bind(this));this.rowHeaderContextMenu.bind("select",this.onContextMenuSelect.bind(this));this.colHeaderContextMenu.bind("select",this.onContextMenuSelect.bind(this));this.cellContextMenu.element.add(this.rowHeaderContextMenu.element).add(this.colHeaderContextMenu.element).on("contextmenu",!1);this.tabstrip&&(this.tabstrip.bind("action",this.onCommandRequest.bind(this)),this.tabstrip.bind("dialog",this.onDialogRequest.bind(this)))},_execute:function(n){var t=this._workbook.execute(n);t&&(t.reason==="error"?this.view.showError(t):this.view.openDialog(t.reason))},_activeTooltip:function(){return this._workbook.activeSheet().activeCell().simplify().toString()},onContextMenuSelect:function(n){var r=t(n.item).data("action"),i;switch(r){case"cut":i={command:"ToolbarCutCommand",options:{workbook:this._workbook}};break;case"copy":i={command:"ToolbarCopyCommand",options:{workbook:this._workbook}};break;case"paste":i={command:"ToolbarPasteCommand",options:{workbook:this._workbook}};break;case"unmerge":i={command:"MergeCellCommand",options:{value:"unmerge"}};break;case"merge":this.view.openDialog("merge");break;case"hide-row":i={command:"HideLineCommand",options:{axis:"row"}};break;case"hide-column":i={command:"HideLineCommand",options:{axis:"column"}};break;case"unhide-row":i={command:"UnHideLineCommand",options:{axis:"row"}};break;case"unhide-column":i={command:"UnHideLineCommand",options:{axis:"column"}};break;case"delete-row":i={command:"DeleteRowCommand"};break;case"delete-column":i={command:"DeleteColumnCommand"}}i&&this._execute(i)},onSheetBarRemove:function(n){var t=this._workbook.sheetByName(n.name);t&&this._workbook.removeSheet(t)},destroy:function(){this.listener.destroy();this.keyListener.destroy();this.inputKeyListener.destroy()},onSheetBarSelect:function(n){var i,t=this._workbook;i=n.isAddButton?t.insertSheet():t.sheetByName(n.name);t.activeSheet().name()!==i.name()&&t.activeSheet(i)},onSheetBarReorder:function(n){var t=this._workbook.sheetByIndex(n.oldIndex);this._workbook.moveSheetToIndex(t,n.newIndex);this._workbook.activeSheet(t)},onSheetBarRename:function(n){var t=this._workbook.sheetByIndex(n.sheetIndex);this._workbook.renameSheet(t,n.name);this.clipboardElement.focus()},sheet:function(n){this.navigator=n.navigator();this.axisManager=n.axisManager()},workbook:function(n){this._workbook=n;this.clipboard=n.clipboard()},refresh:function(){var n=this._workbook;this._viewPortHeight=this.view.scroller.clientHeight;this.navigator.height(this._viewPortHeight);this.editor.isActive()||this.editor.value(n._inputForRef(n.activeSheet().activeCell()))},onScroll:function(){this.view.render()},onWheel:function(n){var t=n.originalEvent.deltaX,i=n.originalEvent.deltaY;n.originalEvent.deltaMode===1&&(t*=10,i*=10);this.scrollWith(t,i);n.preventDefault()},onAction:function(n,t){this.navigator.moveActiveCell(i[t]);n.preventDefault()},onPageUp:function(){this.scrollDown(-this._viewPortHeight)},onPageDown:function(){this.scrollDown(this._viewPortHeight)},onEntryAction:function(n,t){if(n.mod){var i=!0,r=String.fromCharCode(n.keyCode);switch(r){case"A":this.navigator.selectAll();break;case"Y":this._workbook.undoRedoStack.redo();break;case"Z":this._workbook.undoRedoStack.undo();break;default:i=!1}i&&n.preventDefault()}else t=="delete"||t=="backspace"?(this._execute({command:"ClearContentCommand"}),n.preventDefault()):y.test(t)||t===":edit"?(t!==":edit"&&this.editor.value(""),this.editor.activate({rect:this.view.activeCellRectangle(),tooltip:this._activeTooltip()}).focus()):(this.navigator.navigateInSelection(f[t]),n.preventDefault())},onShiftAction:function(n,t){this.navigator.modifySelection(i[t.replace("shift+","")],this.appendSelection);n.preventDefault()},onMouseMove:function(n){var t=this._workbook.activeSheet(),i;t.resizingInProgress()||t.selectionInProgress()||(i=this.objectAt(n),i.type==="columnresizehandle"||i.type==="rowresizehandle"?t.positionResizeHandle(i.ref):t.removeResizeHandle())},onMouseDown:function(n){var t=this.objectAt(n),i;if(t.pane&&(this.originFrame=t.pane),this.editor.canInsertRef(!1)&&t.ref){this._workbook.activeSheet()._setFormulaSelections(this.editor.highlightedRefs());this.navigator.startSelection(t.ref,this._selectionMode,this.appendSelection);n.preventDefault();return}if(this.editor.deactivate(),i=this._workbook.activeSheet(),t.type==="columnresizehandle"||t.type==="rowresizehandle"){i.startResizing({x:t.x,y:t.y});n.preventDefault();return}if(t.type==="filtericon"){this.openFilterMenu(n.target);n.preventDefault();return}this._selectionMode=c[t.type];this.appendSelection=n.mod;this.navigator.startSelection(t.ref,this._selectionMode,this.appendSelection)},onContextMenu:function(t){var s=this._workbook.activeSheet(),r,e,i;if(!s.resizingInProgress()&&(t.preventDefault(),this.cellContextMenu.close(),this.colHeaderContextMenu.close(),this.rowHeaderContextMenu.close(),e={pageX:t.pageX,pageY:t.pageY},i=this.objectAt(e),i.type!=="columnresizehandle"&&i.type!=="rowresizehandle")){this.navigator.selectForContextMenu(i.ref,c[i.type]);var u=this.navigator._sheet.select()instanceof n.spreadsheet.UnionRef,f=!1,o=!1;i.type==="cell"?(r=this.cellContextMenu,o=this.navigator.selectionIncludesMergedCells()):i.type=="columnheader"?(r=this.colHeaderContextMenu,f=!u&&this.axisManager.selectionIncludesHiddenColumns()):i.type=="rowheader"&&(r=this.rowHeaderContextMenu,f=!u&&this.axisManager.selectionIncludesHiddenRows());r.element.find(b).toggle(!u);r.element.find(k).toggle(f);r.element.find("[data-action=unmerge]").toggle(o);setTimeout(function(){r.open(t.pageX,t.pageY)})}},prevent:function(n){n.preventDefault()},constrainResize:function(n,t){var r=this._workbook.activeSheet(),i=r.resizeHandlePosition();return!i||n==="outside"||n==="topcorner"||t.col<i.col||t.row<i.row},onMouseDrag:function(n){var i;if(this._selectionMode!=="sheet"){var r={pageX:n.pageX,pageY:n.pageY},t=this.objectAt(r),u=this._workbook.activeSheet();if(u.resizingInProgress()){this.constrainResize(t.type,t.ref)||u.resizeHintPosition({x:t.x,y:t.y});return}if(t.type==="outside"){this.startAutoScroll(t);return}this.originFrame===t.pane?this.selectToLocation(r):(i=this.originFrame._grid,t.x>i.right&&this.scrollLeft(),t.y>i.bottom&&this.scrollTop(),t.y<i.top||t.x<i.left?this.startAutoScroll(t,r):this.selectToLocation(r));n.preventDefault()}},onMouseUp:function(n){var r=this._workbook.activeSheet(),t,i,u;if(r.completeResizing(),this.navigator.completeSelection(),this.stopAutoScroll(),t=this.editor.activeEditor(),t){for(i=n.target;i;){if(i===t.element[0])return;i=i.parentNode}u=this.objectAt(n);u&&u.ref&&t.canInsertRef(!1)&&(t.refAtPoint(r.selection()._ref),r._setFormulaSelections(t.highlightedRefs()))}},onDblClick:function(n){var t=this.objectAt(n);t.type==="cell"&&(this.editor.activate({rect:this.view.activeCellRectangle(),tooltip:this._activeTooltip()}).focus(),this.onEditorUpdate())},onCut:function(n){if(n){var t=this.clipboardElement.find("table.kendo-clipboard-"+this.clipboard._uid).detach();this.clipboardElement.append(t.clone(!1));setTimeout(function(){this.clipboardElement.empty().append(t)}.bind(this))}this._execute({command:"CutCommand",options:{workbook:this.view._workbook}})},clipBoardValue:function(){return this.clipboardElement.html()},onPaste:function(t){var u="",f="",i,r,e;if(this.clipboard.menuInvoked=t===undefined,t)if(t.originalEvent.clipboardData&&t.originalEvent.clipboardData.getData)t.preventDefault(),i=!1,r=!1,window.DOMStringList&&t.originalEvent.clipboardData.types instanceof window.DOMStringList?(i=t.originalEvent.clipboardData.types.contains("text/html"),r=t.originalEvent.clipboardData.types.contains("text/plain")):(i=/text\/html/.test(t.originalEvent.clipboardData.types),r=/text\/plain/.test(t.originalEvent.clipboardData.types)),i&&(u=t.originalEvent.clipboardData.getData("text/html")),r&&(f=t.originalEvent.clipboardData.getData("text/plain").trim());else{e=this.clipboardElement.find("table.kendo-clipboard-"+this.clipboard._uid).detach();this.clipboardElement.empty();setTimeout(function(){this.clipboard.external({html:this.clipboardElement.html(),plain:window.clipboardData.getData("Text").trim()});this.clipboardElement.empty().append(e);this._execute({command:"PasteCommand",options:{workbook:this.view._workbook}});this.clipboard.menuInvoked=!0}.bind(this));return}else{if(n.support.browser.msie){this.clipboardElement.focus().select();document.execCommand("paste");return}this.clipboard.menuInvoked=!0}this.clipboard.external({html:u,plain:f});this._execute({command:"PasteCommand",options:{workbook:this.view._workbook}})},onCopy:function(n){this.clipboard.menuInvoked=n===undefined;this._execute({command:"CopyCommand",options:{workbook:this.view._workbook}})},scrollTop:function(){this.scroller.scrollTop=0},scrollLeft:function(){this.scroller.scrollLeft=0},scrollDown:function(n){this.scroller.scrollTop+=n},scrollRight:function(n){this.scroller.scrollLeft+=n},scrollWith:function(n,t){this.scroller.scrollTop+=t;this.scroller.scrollLeft+=n},objectAt:function(n){var t=this.container.offset(),i={left:n.pageX-t.left,top:n.pageY-t.top};return this.view.objectAt(i.left,i.top)},selectToLocation:function(n){var t=this.objectAt(n);t.pane&&(this.extendSelection(t),this.lastKnownCellLocation=n,this.originFrame=t.pane);this.stopAutoScroll()},extendSelection:function(n){this.navigator.extendSelection(n.ref,this._selectionMode,this.appendSelection)},autoScroll:function(){var r=this._autoScrollTarget.x,u=this._autoScrollTarget.y,n=this.originFrame._grid,t=this.view.scroller,i=8,f=t.scrollLeft,e=t.scrollTop;r<n.left&&this.scrollRight(-i);r>n.right&&this.scrollRight(i);u<n.top&&this.scrollDown(-i);u>n.bottom&&this.scrollDown(i);e===t.scrollTop&&f===t.scrollLeft?this.selectToLocation(this.finalLocation):this.extendSelection(this.objectAt(this.lastKnownCellLocation))},startAutoScroll:function(n,t){this._scrollInterval||(this._scrollInterval=setInterval(this.autoScroll.bind(this),50));this.finalLocation=t||this.lastKnownCellLocation;this._autoScrollTarget=n},stopAutoScroll:function(){clearInterval(this._scrollInterval);this._scrollInterval=null},openFilterMenu:function(n){var r=t(n).closest(".k-spreadsheet-filter"),i=this.view.createFilterMenu(r.data("column"));i.bind("action",this.onCommandRequest.bind(this));i.bind("action",i.close.bind(i));i.openFor(n)},onEditorChange:function(n){this._workbook.activeSheet().isInEditMode(!1);this._execute({command:"EditCommand",options:{editActiveCell:!0,value:n.value}})},onEditorActivate:function(){var t=this._workbook,n=t.activeSheet();n._setFormulaSelections(this.editor.highlightedRefs());n.isInEditMode(!0)},onEditorDeactivate:function(){var n=this._workbook.activeSheet();n.isInEditMode(!1);n._setFormulaSelections([])},onEditorUpdate:function(){this._workbook.activeSheet()._setFormulaSelections(this.editor.highlightedRefs())},onEditorBarFocus:function(){this.editor.activate({rect:this.view.activeCellRectangle(),tooltip:this._activeTooltip()})},onEditorCellFocus:function(){this.editor.scale()},onEditorEsc:function(){this.editor.value(this._workbook._inputForRef(this._workbook.activeSheet()._viewActiveCell()));this.editor.deactivate();this.clipboardElement.focus()},onEditorBlur:function(n,t){this.editor.isFiltered()||(this.editor.deactivate(),this.clipboardElement.focus(),this.navigator.navigateInSelection(f[t]))},onEditorAction:function(n,t){var r=this.editor,u=this._workbook.activeSheet();r.canInsertRef(!0)&&(this.navigator.moveActiveCell(i[t]),r.activeEditor().refAtPoint(u.selection()._ref),u._setFormulaSelections(r.highlightedRefs()),n.preventDefault())},onEditorShiftAction:function(n,t){var r=this.editor,u=this._workbook.activeSheet();r.canInsertRef(!0)&&(this.navigator.modifySelection(i[t.replace("shift+","")],this.appendSelection),r.activeEditor().refAtPoint(u.selection()._ref),u._setFormulaSelections(r.highlightedRefs()),n.preventDefault())},onCommandRequest:function(n){n.command?this._execute(n):this._workbook.undoRedoStack[n.action]()},onDialogRequest:function(n){this.view.openDialog(n.name,n.options)}});n.spreadsheet.Controller=v}})(window.kendo)}(),function(){(function(n){function v(n){var i=window.getSelection(),t;i.removeAllRanges();t=document.createRange();t.selectNodeContents(n);i.addRange(t)}function y(n,t){var i=n.trs[t].children;return i[i.length-2]}function p(n,t){var i=n.trs[t-1],r=n.trs[t].children.length-1;if(i&&r>=0)return i.children[r]}function s(n){return["solid",(n.size||1)+"px",n.color||"#000"].join(" ")}function h(t,i,r){var u={},f,h,c,e,o;if(r.background&&(u.backgroundColor=r.background),r.color&&(u.color=r.color),r.fontFamily&&(u.fontFamily=r.fontFamily),r.underline&&(u.textDecoration="underline"),r.italic&&(u.fontStyle="italic"),r.textAlign&&(u.textAlign=r.textAlign),r.verticalAlign&&(u.verticalAlign=r.verticalAlign),r.bold&&(u.fontWeight="bold"),r.fontSize&&(u.fontSize=r.fontSize+"px"),r.wrap===!0?(u.whiteSpace="normal",u.wordBreak="break-all"):u.whiteSpace="nowrap",r.borderRight?u.borderRight=s(r.borderRight):r.background&&(u.borderRightColor=r.background),r.borderBottom?u.borderBottom=s(r.borderBottom):r.background&&(u.borderBottomColor=r.background),f=r.value,h=typeof f,r.format&&f!==null&&(f=n.spreadsheet.formatting.format(f,r.format),f.__dataType&&(h=f.__dataType)),!u.textAlign)switch(h){case"number":case"date":case"percent":u.textAlign="right";break;case"boolean":u.textAlign="center"}return c=t.addCell(i,f,u,null,r.validation),r.borderLeft?(o=y(t,i),e=s(r.borderLeft),o&&e&&(o.attr.style.borderRight=e)):r.background&&(u.borderLeftColor=r.background),r.borderTop?(o=p(t,i),e=s(r.borderTop),o&&e&&(o.attr.style.borderBottom=e)):r.background&&(u.borderTopColor=r.background),c}function a(n,t,i){return n>=t&&n<=i}var l;if(!n.support.browser.msie||!(n.support.browser.version<9)){var i=n.jQuery,e=n.spreadsheet.CellRef,r=".",u=7,c=n.spreadsheet.messages.view={errors:{shiftingNonblankCells:"Cannot insert cells due to data loss possibility. Select another insert location or delete the data from the end of your worksheet.",filterRangeContainingMerges:"Cannot create a filter within a range containing merges"},tabs:{home:"Home",insert:"Insert",data:"Data"}};var o=n.Class.extend({init:function(){this.cols=[];this.trs=[];this._height=0;this._width=0},addColumn:function(t){this._width+=t;var i=n.dom.element("col",{style:{width:t+"px"}});i.visible=t>0;this.cols.push(i)},addRow:function(t){var r=null,i;r={style:{height:t+"px"}};this._height+=t;i=n.dom.element("tr",r);i.visible=t>0;this.trs.push(i)},addCell:function(t,i,r,u,f){var o,e,s;return(i===null||i===undefined)&&(i=""),i instanceof n.dom.Node||(i=n.dom.text(i)),o=[i],e={style:r},f&&!f.value&&(o.push(n.dom.element("span",{className:"k-dirty"})),u=(u||"")+(u?" ":"")+"k-dirty-cell",e.title=f._getOptions().messageTemplate),u&&(e.className=u),s=n.dom.element("td",e,o),this.trs[t].children.push(s),s},toDomTree:function(t,i,r){this.trs=this.trs.filter(function(n){return n.visible});var u=0;return this.cols=this.cols.filter(function(n,t){return n.visible||(this.trs.forEach(function(n){n.children.splice(t-u,1)}),u++),n.visible},this),n.dom.element("table",{style:{left:t+"px",top:i+"px",height:this._height+"px",width:this._width+"px"},className:r},[n.dom.element("colgroup",null,this.cols),n.dom.element("tbody",null,this.trs)])}});n.spreadsheet.ContextMenu=n.ui.ContextMenu;l=n.template('<div class="#=classNames.view#"><div class="#=classNames.fixedContainer#"><\/div><div class="#=classNames.scroller#"><div class="#=classNames.viewSize#"><\/div><\/div><div tabindex="0" class="#=classNames.clipboard#" contenteditable=true><\/div><div class="#=classNames.cellEditor#"><\/div><\/div><div class="#=classNames.sheetsBar#"><\/div><ul class="#=classNames.cellContextMenu#"><li data-action=cut>Cut<\/li><li data-action=copy>Copy<\/li><li data-action=paste>Paste<\/li><li class="k-separator"><\/li><li data-action=merge>Merge<\/li><li data-action=unmerge>Unmerge<\/li><\/ul><ul class="#=classNames.rowHeaderContextMenu#"><li data-action=cut>Cut<\/li><li data-action=copy>Copy<\/li><li data-action=paste>Paste<\/li><li class="k-separator"><\/li><li data-action="delete-row">Delete<\/li><li data-action="hide-row">Hide<\/li><li data-action="unhide-row">Unhide<\/li><\/ul><ul class="#=classNames.colHeaderContextMenu#"><li data-action=cut>Cut<\/li><li data-action=copy>Copy<\/li><li data-action=paste>Paste<\/li><li class="k-separator"><\/li><li data-action="delete-column">Delete<\/li><li data-action="hide-column">Hide<\/li><li data-action="unhide-column">Unhide<\/li><\/ul>');var f=n.Class.extend({init:function(t,u){var e=f.classNames,o,s;this.element=t;this.options=i.extend(!0,{},this.options,u);this._chrome();this._dialogs=[];t.append(l({classNames:e}));this._formulaInput();this.wrapper=t.find(r+e.view);this.container=t.find(r+e.fixedContainer)[0];this.scroller=t.find(r+e.scroller)[0];this.clipboard=t.find(r+e.clipboard);this.viewSize=i(this.scroller.firstChild);this.tree=new n.dom.Tree(this.container);this.clipboardContents=new n.dom.Tree(this.clipboard[0]);this.editor=new n.spreadsheet.SheetEditor(this);this._sheetsbar();o={target:t,animation:!1,showOn:"never"};this.cellContextMenu=new n.spreadsheet.ContextMenu(t.find(r+e.cellContextMenu),o);this.colHeaderContextMenu=new n.spreadsheet.ContextMenu(t.find(r+e.colHeaderContextMenu),o);this.rowHeaderContextMenu=new n.spreadsheet.ContextMenu(t.find(r+e.rowHeaderContextMenu),o);s=n.support.scrollbar();i(this.container).css({width:this.wrapper[0].clientWidth-s,height:this.wrapper[0].clientHeight-s})},_resize:function(){var n=this.tabstrip?this.tabstrip.element.outerHeight():0,t=this.formulaBar?this.formulaBar.element.outerHeight():0,i=this.sheetsbar?this.sheetsbar.element.outerHeight():0;this.wrapper.height(this.element.height()-(n+t+i));this.tabstrip&&this.tabstrip.quickAccessAdjust()},_chrome:function(){var t=i("<div />").prependTo(this.element);this.formulaBar=new n.spreadsheet.FormulaBar(t);this.options.toolbar&&this._tabstrip()},_formulaInput:function(){var t=this.element.find(r+f.classNames.cellEditor);this.formulaInput=new n.spreadsheet.FormulaInput(t,{autoScale:!0})},_sheetsbar:function(){this.options.sheetsbar&&(this.sheetsbar=new n.spreadsheet.SheetsBar(this.element.find(r+f.classNames.sheetsBar),i.extend(!0,{},this.options.sheetsbar)))},_tabstrip:function(){var f=c.tabs,r=i.extend(!0,{home:!0,insert:!0,data:!0},this.options.toolbar),u=[],t;this.tabstrip&&(this.tabstrip.destroy(),this.element.children(".k-tabstrip").remove());for(t in r)(r[t]===!0||r[t]instanceof Array)&&u.push({id:t,text:f[t],content:""});this.tabstrip=new n.spreadsheet.TabStrip(i("<div />").prependTo(this.element),{animation:!1,dataTextField:"text",dataContentField:"content",dataSource:u,toolbarOptions:r,view:this});this.tabstrip.select(0)},_executeCommand:function(n){this._workbook.execute(n)},workbook:function(n){this._workbook=n},sheet:function(n){this._sheet=n},activeCellRectangle:function(){return this.cellRectangle(this._sheet._viewActiveCell())},_rectangle:function(n,t){return n._grid.boundingRectangle(t.toRangeRef())},isColumnResizer:function(n,t,i){var e=this._rectangle(t,i),r,f;return n-=this._sheet._grid._headerWidth,r=u/2,f=e.right-this.scroller.scrollLeft,f-r<=n&&n<=f+r},isRowResizer:function(n,t,i){var e=this._rectangle(t,i),r,f;return n-=this._sheet._grid._headerHeight,r=u/2,f=e.bottom-this.scroller.scrollTop,f-r<=n&&n<=f+r},isFilterIcon:function(n,t,i,r){var u=!1;return n-=this._sheet._grid._headerWidth,t-=this._sheet._grid._headerHeight,this._sheet.forEachFilterHeader(r,function(r){var f=this._rectangle(i,r);u=u||i.filterIconRect(f).intersects(n,t)}.bind(this)),u},isAutoFill:function(n,t,i){var u=this._sheet.select(),r;return u.size>1?!1:(n-=this._sheet._grid._headerWidth,t-=this._sheet._grid._headerHeight,i._grid.columns.frozen||(n+=this.scroller.scrollLeft),i._grid.rows.frozen||(t+=this.scroller.scrollTop),r=this._rectangle(i,u),Math.abs(r.right-n)<8&&Math.abs(r.bottom-t)<8)},objectAt:function(n,t){var o=this._sheet._grid,r,i;if(n<0||t<0||n>this.scroller.clientWidth||t>this.scroller.clientHeight)r={type:"outside"};else if(n<o._headerWidth&&t<o._headerHeight)r={type:"topcorner"};else{i=this.paneAt(n,t);var s=i._grid.rows.index(t,this.scroller.scrollTop),h=i._grid.columns.index(n,this.scroller.scrollLeft),f="cell",u=new e(s,h);this.isAutoFill(n,t,i)?f="autofill":this.isFilterIcon(n,t,i,u)?f="filtericon":n<o._headerWidth?(u=new e(s,-Infinity),f=this.isRowResizer(t,i,u)?"rowresizehandle":"rowheader"):t<o._headerHeight&&(u=new e(-Infinity,h),f=this.isColumnResizer(n,i,u)?"columnresizehandle":"columnheader");r={type:f,ref:u}}return r.pane=i,r.x=n,r.y=t,r},paneAt:function(n,t){return this.panes.filter(function(i){var r=i._grid;return a(t,r.top,r.bottom)&&a(n,r.left,r.right)})[0]},containingPane:function(n){return this.panes.filter(function(t){return t._grid.contains(n)?!0:!1})[0]},cellRectangle:function(n){var t=this.containingPane(n)._grid,i=this._sheet._grid.rectangle(n);return i.offset(t.headerWidth-this.scroller.scrollLeft,t.headerHeight-this.scroller.scrollTop)},refresh:function(n){var t=this._sheet,i,r;this.tabstrip&&this.tabstrip.refreshTools(t.range(t.activeCell()));n.sheetSelection&&this.sheetsbar&&this.sheetsbar.renderSheets(this._workbook.sheets(),this._workbook.sheetIndex(this._sheet));this._resize();this.viewSize[0].style.height=t._grid.totalHeight()+"px";this.viewSize[0].style.width=t._grid.totalWidth()+"px";n.layout&&(i=t.frozenColumns(),r=t.frozenRows(),this.panes=[this._pane(r,i)],i>0&&this.panes.push(this._pane(r,0,null,i)),r>0&&this.panes.push(this._pane(0,i,r,null)),r>0&&i>0&&this.panes.push(this._pane(0,0,r,i)));n.filter&&this._destroyFilterMenu();n.activeCell&&(this._focus=t.activeCell().toRangeRef())},createFilterMenu:function(t){if(this._filterMenu&&this._filterMenu.options.column==t)return this._filterMenu;var i=this._sheet,u=i.filter().ref,f=new n.spreadsheet.Range(u,i),r=new n.spreadsheet.FilterMenu({column:t,range:f});return this._destroyFilterMenu(),this._filterMenu=r,r},selectClipBoardContents:function(){this.clipboard.focus();v(this.clipboard[0])},scrollIntoView:function(n){var r=!1,u=this.containingPane(n)._grid,t=u.scrollBoundaries(n),i=this.scroller,f=u.rows.frozen?0:i.scrollTop,e=u.columns.frozen?0:i.scrollLeft;return t.top<f&&(r=!0,i.scrollTop=t.scrollTop),t.bottom>f&&(r=!0,i.scrollTop=t.scrollBottom),t.left<e&&(r=!0,i.scrollLeft=t.scrollLeft),t.right>e&&(r=!0,i.scrollLeft=t.scrollRight),r},openDialog:function(t,i){var u=this._sheet,f=u.activeCell(),e=new n.spreadsheet.Range(f,u),r=n.spreadsheet.dialogs.create(t,i);if(r)return r.bind("action",this._executeCommand.bind(this)),this._dialogs.push(r),r.open(e),r},showError:function(n){var t=c.errors;this.openDialog("message",{title:n.title||"Error",text:n.type?t[n.type]:n.body})},destroy:function(){this._dialogs.forEach(function(n){n.destroy()});this.cellContextMenu.destroy();this.rowHeaderContextMenu.destroy();this.colHeaderContextMenu.destroy();this.tabstrip&&this.tabstrip.destroy();this._destroyFilterMenu()},_destroyFilterMenu:function(){this._filterMenu&&(this._filterMenu.destroy(),this._filterMenu=undefined,this._filterMenuColumn=undefined)},render:function(){var t,r,s,i,h;if(this.element.is(":visible")&&(t=this._sheet,r=t.focus(),!r||!this.scrollIntoView(r))){var o=t._grid,u=this.scroller.scrollTop,e=this.scroller.scrollLeft;u<0&&(u=0);e<0&&(e=0);s=this.panes.map(function(n){return n.render(e,u)},this);i=[];i=Array.prototype.concat.apply(i,s);h=n.dom.element("div",{style:{width:o._headerWidth+"px",height:o._headerHeight+"px"},className:f.classNames.topCorner});i.push(h);t.resizeHandlePosition()&&t.resizeHintPosition()&&i.push(this.renderResizeHint());this.tree.render(i);this.editor.isActive()?this.editor.toggleTooltip(this.activeCellRectangle()):t.selectionInProgress()||t.resizingInProgress()||t.isInEditMode()||this.renderClipboardContents()}},renderResizeHint:function(){var r=this._sheet,o=r.resizeHandlePosition(),f=o.col!==-Infinity,e,i;return e=f?{height:this.scroller.clientHeight+"px",width:u+"px",left:r.resizeHintPosition().x+"px"}:{height:u+"px",width:this.scroller.clientWidth+"px",top:r.resizeHintPosition().y+"px"},i=t.classNames,n.dom.element("div",{className:i.resizeHint+(f?"":" "+i.resizeHintVertical),style:e},[n.dom.element("div",{className:i.resizeHintHandle}),n.dom.element("div",{className:i.resizeHintMarker})])},renderClipboardContents:function(){var t=this._sheet,s=t._grid,n=t.select(),c=this._workbook.clipboard().canCopy(),i,r,u,f;if(c.canCopy===!1&&c.multiSelection){this.clipboardContents.render([]);this.selectClipBoardContents();return}n=t.trim(n);i=new o;r=s.rangeDimensions(n);r.rows.forEach(function(n){i.addRow(n)});r.columns.forEach(function(n){i.addColumn(n)});u={};f={};t.forEachMergedCell(n,function(n){var t=n.topLeft;s.forEach(n,function(i){t.eq(i)?u[i.print()]=n:f[i.print()]=!0})});t.forEach(n,function(t,r,o){var l=new e(t,r).print(),c,s;f[l]||(c=h(i,t-n.topLeft.row,o),s=u[l],s&&(c.attr.colspan=s.width(),c.attr.rowspan=s.height()))});this.clipboardContents.render([i.toDomTree(0,0,"kendo-clipboard-"+this._workbook.clipboard()._uid)]);this.selectClipBoardContents()},_pane:function(n,i,r,u){var f=new t(this._sheet,this._sheet._grid.pane({row:n,column:i,rowCount:r,columnCount:u}));return f.refresh(this.scroller.clientWidth,this.scroller.clientHeight),f}}),t=n.Class.extend({init:function(n,t){this._sheet=n;this._grid=t},refresh:function(n,t){this._grid.refresh(n,t)},isVisible:function(n,t,i){return this._grid.view(n,t).ref.intersects(i)},render:function(i,r){var h=t.classNames,s=this._sheet,f=this._grid,e=f.view(i,r),u,c,l,v,a;return this._currentView=e,this._selectedHeaders=s.selectedHeaders(),u=[],u.push(this.renderData()),u.push(this.renderMergedCells()),u.push(this.renderSelection()),u.push(this.renderAutoFill()),u.push(this.renderEditorSelection()),u.push(this.renderFilterHeaders()),f.hasRowHeader&&(c=new o,c.addColumn(f.headerWidth),e.rows.values.forEach(function(n){c.addRow(n)}),s.forEach(e.ref.leftColumn(),function(n){var t=n+1;c.addCell(n-e.ref.topLeft.row,t,{},this.headerClassName(n,"row"))}.bind(this)),u.push(c.toDomTree(0,e.rowOffset,h.rowHeader))),f.hasColumnHeader&&(l=new o,e.columns.values.forEach(function(n){l.addColumn(n)}),l.addRow(f.headerHeight),s.forEach(e.ref.topRow(),function(t,i){var r=n.spreadsheet.Ref.display(null,Infinity,i);l.addCell(0,r,{},this.headerClassName(i,"col"))}.bind(this)),u.push(l.toDomTree(e.columnOffset,0,h.columnHeader))),s.resizeHandlePosition()&&(f.hasColumnHeader||f.hasRowHeader)&&(v=s._grid.normalize(s.resizeHandlePosition()),e.ref.intersects(v)&&(s.resizeHintPosition()||u.push(this.renderResizeHandler()))),a=[h.pane],f.hasColumnHeader&&a.push(h.top),f.hasRowHeader&&a.push(h.left),n.dom.element("div",{style:f.style,className:a.join(" ")},u)},headerClassName:function(n,t){var i=this._selectedHeaders,u,f,r;return t==="row"?(u=i.rows[n],f=i.allRows):(u=i.cols[n],f=i.allCols),r=u||(i.all?"full":f?"partial":"none"),r&&(r="k-selection-"+r),r},renderData:function(){var i=new o,n=this._currentView;return n.rows.values.forEach(function(n){i.addRow(n)}),n.columns.values.forEach(function(n){i.addColumn(n)}),this._sheet.forEach(n.ref,function(t,r,u){h(i,t-n.ref.topLeft.row,u)}),i.toDomTree(n.columnOffset,n.rowOffset,t.classNames.data)},renderMergedCells:function(){var i=t.classNames,r=[],u=this._sheet;return u.forEachMergedCell(function(n){this._addTable(r,n,i.mergedCell)}.bind(this)),n.dom.element("div",{className:i.mergedCellsWrapper},r)},renderResizeHandler:function(){var e=this._sheet,i=e.resizeHandlePosition(),r=this._rectangle(i),f;return f=i.col!==-Infinity?{height:this._grid.headerHeight+"px",width:u+"px",left:r.right-u/2+"px"}:{height:u+"px",width:this._grid.headerWidth+"px",top:r.bottom-u/2+"px"},n.dom.element("div",{className:t.classNames.resizeHandle,style:f})},filterIconRect:function(t){var i=16,r=3;return new n.spreadsheet.Rectangle(t.right-i-r,t.top+r,i,i)},renderFilterHeaders:function(){function o(i){return n.dom.element("span",{className:t.icon+" "+i})}function s(t,r,u){var e={left:r.left+"px",top:r.top+"px"},s=i&&i.columns.some(function(n){return n.index===u}),f=t.filterButton;return s&&(f+=" "+t.filterButtonActive),n.dom.element("span",{className:f,style:e,"data-column":u},[o(t.iconFilterDefault)])}var u=this._sheet,r=[],t=f.classNames,e=0,i=u.filter();return i&&this._addDiv(r,i.ref,t.filterRange),u.forEachFilterHeader(this._currentView.ref,function(n){var i=this._rectangle(n),u=this.filterIconRect(i),f=s(t,u,e);e++;r.push(f)}.bind(this)),n.dom.element("div",{className:t.filterHeadersWrapper},r)},renderEditorSelection:function(){var i=t.classNames,u=this._sheet,r=[];return u._formulaSelections.forEach(function(t){var u=t.ref;u!==n.spreadsheet.NULLREF&&this._addDiv(r,u,i.selectionHighlight+" "+t.colorClass)}.bind(this)),n.dom.element("div",{className:i.selectionWrapper},r)},renderSelection:function(){var r=t.classNames,f=[],u=[r.activeCell],i=[r.selection],e=this._sheet,o=e.activeCell().toRangeRef(),s=this._activeFormulaColor(),h=e.select();return u=u.concat(s,this._directionClasses(o)),i=i.concat(s),e.singleCellSelection()&&u.push(r.single),h.size()===1&&i.push("k-single-selection"),this._sheet.autoFillPunch()&&i.push("k-dim-auto-fill-handle"),h.forEach(function(t){t!==n.spreadsheet.NULLREF&&this._addDiv(f,t,i.join(" "))}.bind(this)),this._addTable(f,o,u.join(" ")),n.dom.element("div",{className:r.selectionWrapper},f)},renderAutoFill:function(){var f=[],r,u,h;if(this._sheet.autoFillInProgress()){var i=this._sheet.autoFillRef(),o=this._sheet.autoFillPunch(),s=this._sheet._autoFillDirection;if(this._addDiv(f,i,"k-auto-fill"),o)this._addDiv(f,o,"k-auto-fill-punch");else if(s!==undefined){switch(s){case 0:r=i.bottomRight;u="k-auto-fill-br-hint";break;case 1:r=i.bottomRight;u="k-auto-fill-br-hint";break;case 2:r=new e(i.topLeft.row,i.bottomRight.col);u="k-auto-fill-tr-hint";break;case 3:r=new e(i.bottomRight.row,i.topLeft.col);u="k-auto-fill-bl-hint"}h=n.dom.element("span",{className:"k-tooltip"},[n.dom.text(this._sheet._autoFillHint)]);this._addDiv(f,r,u).children.push(h)}}return n.dom.element("div",{className:t.classNames.autoFillWrapper},f)},_addDiv:function(n,t,i){var u=this._currentView,r;return u.ref.intersects(t)&&(r=this._rectangle(t).resize(1,1).toDiv(i),n.push(r)),r},_addTable:function(n,t,i){var r=this._sheet,u=this._currentView;u.ref.intersects(t)&&r.forEach(t.collapse(),function(r,u,f){var e=this._rectangle(t),s=new o;s.addColumn(e.width);s.addRow(e.height);h(s,0,f);n.push(s.toDomTree(e.left,e.top,i))}.bind(this))},_activeFormulaColor:function(){var n,t=[];return this._sheet.isInEditMode()&&(n=this._sheet._formulaSelections.filter(function(n){return n.active&&n.type=="ref"})[0],n&&t.push(n.colorClass)),t},_directionClasses:function(n){var i=[],r=t.classNames,u=this._currentView.ref;return n.move(0,-1).intersects(u)||i.push(r.left),n.move(-1,0).intersects(u)||i.push(r.top),n.move(0,1).intersects(u)||i.push(r.right),n.move(1,0).intersects(u)||i.push(r.bottom),i},_rectangle:function(n){return this._grid.boundingRectangle(n.toRangeRef()).offset(-this._currentView.mergedCellLeft,-this._currentView.mergedCellTop)}});n.spreadsheet.View=f;n.spreadsheet.Pane=t;n.spreadsheet.addCell=h;i.extend(!0,f,{classNames:{view:"k-spreadsheet-view",fixedContainer:"k-spreadsheet-fixed-container",scroller:"k-spreadsheet-scroller",viewSize:"k-spreadsheet-view-size",clipboard:"k-spreadsheet-clipboard",cellEditor:"k-spreadsheet-cell-editor",barEditor:"k-spreadsheet-editor",topCorner:"k-spreadsheet-top-corner",filterHeadersWrapper:"k-filter-wrapper",filterRange:"k-filter-range",filterButton:"k-spreadsheet-filter",filterButtonActive:"k-state-active",icon:"k-icon k-font-icon",iconFilterDefault:"k-i-arrow-s",sheetsBar:"k-spreadsheet-sheets-bar",sheetsBarActive:"k-spreadsheet-sheets-bar-active",sheetsBarInactive:"k-spreadsheet-sheets-bar-inactive",cellContextMenu:"k-spreadsheet-cell-context-menu",rowHeaderContextMenu:"k-spreadsheet-row-header-context-menu",colHeaderContextMenu:"k-spreadsheet-col-header-context-menu"}});i.extend(!0,t,{classNames:{rowHeader:"k-spreadsheet-row-header",columnHeader:"k-spreadsheet-column-header",pane:"k-spreadsheet-pane",data:"k-spreadsheet-data",mergedCell:"k-spreadsheet-merged-cell",mergedCellsWrapper:"k-merged-cells-wrapper",activeCell:"k-spreadsheet-active-cell",selection:"k-spreadsheet-selection",selectionWrapper:"k-selection-wrapper",autoFillWrapper:"k-auto-fill-wrapper",single:"k-single",top:"k-top",right:"k-right",bottom:"k-bottom",left:"k-left",resizeHandle:"k-resize-handle",resizeHint:"k-resize-hint",resizeHintHandle:"k-resize-hint-handle",resizeHintMarker:"k-resize-hint-marker",resizeHintVertical:"k-resize-hint-vertical",selectionHighlight:"k-spreadsheet-selection-highlight",series:["k-series-a","k-series-b","k-series-c","k-series-d","k-series-e","k-series-f"]}})}})(window.kendo)}(),function(){(function(n){if(!n.support.browser.msie||!(n.support.browser.version<9)){var t=n.spreadsheet.CellRef,i=n.spreadsheet.RangeRef,f=n.spreadsheet.UnionRef,r=n.Class.extend({init:function(n,t,i,r){this.left=n;this.width=i;this.right=n+i;this.top=t;this.height=r;this.bottom=t+r},offset:function(n,t){return new r(this.left+n,this.top+t,this.width,this.height)},resize:function(n,t){return new r(this.left,this.top,this.width+n,this.height+t)},intersects:function(n,t){return this.left<n&&n<this.left+this.width&&this.top<t&&t<this.top+this.height},toDiv:function(t){return n.dom.element("div",{className:t,style:{width:this.width+"px",height:this.height+"px",top:this.top+"px",left:this.left+"px"}})}}),e=n.Class.extend({init:function(n,t,i,r,u,f){this.rowCount=i;this.columnCount=r;this._columns=t;this._rows=n;this._headerHeight=u;this._headerWidth=f},isAxis:function(n){n=n.toRangeRef();var t=n.topLeft,i=n.bottomRight;return t.row===0&&i.row===this.rowCount-1||t.col===0&&i.col===this.columnCount-1},width:function(n,t){return this._columns.sum(n,t)},height:function(n,t){return this._rows.sum(n,t)},totalHeight:function(){return this._rows.total+this._headerHeight},totalWidth:function(){return this._columns.total+this._headerWidth},index:function(n,t){return t*this.rowCount+n},cellRef:function(n){return new t(n%this.rowCount,n/this.rowCount>>0)},rowRef:function(n){return new i(new t(n,0),new t(n,this.columnCount-1))},colRef:function(n){return new i(new t(0,n),new t(this.rowCount-1,n))},cellRefIndex:function(n){return this.index(n.row,n.col)},normalize:function(n){if(n instanceof i)return new i(this.normalize(n.topLeft),this.normalize(n.bottomRight)).setSheet(n.sheet,n.hasSheet());if(n instanceof f)return n.map(function(n){return this.normalize(n)},this);var t=n.clone();return t.col=Math.max(0,Math.min(this.columnCount-1,n.col)),t.row=Math.max(0,Math.min(this.rowCount-1,n.row)),t},rectangle:function(n){var t=this.normalize(n.topLeft),i=this.normalize(n.bottomRight);return new r(this.width(0,t.col-1),this.height(0,t.row-1),this.width(t.col,i.col),this.height(t.row,i.row))},pane:function(t){return new u(new n.spreadsheet.PaneAxis(this._rows,t.row,t.rowCount,this._headerHeight),new n.spreadsheet.PaneAxis(this._columns,t.column,t.columnCount,this._headerWidth),this)},rangeDimensions:function(n){return{rows:this._rows.values.iterator(n.topLeft.row,n.bottomRight.row),columns:this._columns.values.iterator(n.topLeft.col,n.bottomRight.col)}},forEach:function(n,i){for(var r,f=this.normalize(n.topLeft),e=this.normalize(n.bottomRight),u=f.col;u<=e.col;u++)for(r=f.row;r<=e.row;r++)i(new t(r,u))},trim:function(n,r){for(var c,f=n.topLeft,s=n.bottomRight,e=f.row,h=f.col,u=f.col;u<=s.col;u++){var l=this.index(f.row,u),a=this.index(s.row,u),o=r.tree.intersecting(l,a);o.length&&(c=this.cellRef(o[o.length-1].end),e=Math.max(e,c.row),h=u)}return new i(n.topLeft,new t(Math.min(e,n.bottomRight.row),h))}}),u=n.Class.extend({init:function(n,t,i){this.rows=n;this.columns=t;this._grid=i;this.headerHeight=n.headerSize;this.headerWidth=t.headerSize;this.hasRowHeader=t.hasHeader;this.hasColumnHeader=n.hasHeader},refresh:function(n,t){this.columns.viewSize(n);this.rows.viewSize(t);var i=this.columns.paneSegment(),r=this.rows.paneSegment();this.left=i.offset;this.top=r.offset;this.right=i.offset+i.length;this.bottom=r.offset+r.length;this.style={top:r.offset+"px",left:i.offset+"px",height:r.length+"px",width:i.length+"px"}},view:function(n,r){var u=this.rows.visible(r),f=this.columns.visible(n);return{rows:u,columns:f,rowOffset:u.offset,columnOffset:f.offset,mergedCellLeft:f.start,mergedCellTop:u.start,ref:new i(new t(u.values.start,f.values.start),new t(u.values.end,f.values.end))}},contains:function(n){return this.rows.contains(n.topLeft.row,n.bottomRight.row)&&this.columns.contains(n.topLeft.col,n.bottomRight.col)},index:function(n,t){return this._grid.index(n,t)},boundingRectangle:function(n){return this._grid.rectangle(n)},cellRefIndex:function(n){return this._grid.cellRefIndex(n)},scrollBoundaries:function(n){var i=this.boundingRectangle(n),t={top:Math.max(0,i.top-this.top+(this.hasColumnHeader?0:this.headerHeight)),left:Math.max(0,i.left-this.left+(this.hasRowHeader?0:this.headerWidth)),right:i.right-this.columns._viewSize+this.headerWidth,bottom:i.bottom-this.rows._viewSize+this.headerHeight},r=this.columns.defaultValue/2,u=this.rows.defaultValue/2;return t.scrollTop=t.top-u,t.scrollBottom=t.bottom+u,t.scrollLeft=t.left-r,t.scrollRight=t.right+r,t}});n.spreadsheet.Grid=e;n.spreadsheet.PaneGrid=u;n.spreadsheet.Rectangle=r}})(kendo)}(),function(){(function(n){if(!n.support.browser.msie||!(n.support.browser.version<9)){var t=n.Class.extend({init:function(t,i){this._value=i;this._count=t;this.values=new n.spreadsheet.RangeList(0,t-1,i);this._hidden=new n.spreadsheet.RangeList(0,t-1,0);this.scrollBarSize=n.support.scrollbar();this._refresh()},toJSON:function(n,t){for(var f,r,e,u=[],o=this.values.iterator(0,this._count-1),i=0;i<this._count;i++)(f=o.at(i),f!==this._value)&&(r=t[i],r===undefined&&(r=u.length,e={index:i},e[n]=f,u.push(e),t[i]=r));return u},fromJSON:function(n,t){for(var u,r,i=0;i<t.length;i++)u=t[i][n],r=t[i].index,r===undefined&&(r=i),this.value(r,r,u)},hide:function(n){var t=this.value(n,n);this._hidden.value(n,n,t);this.value(n,n,0)},hidden:function(n){return this._hidden.value(n,n)!==0},includesHidden:function(n,t){return this._hidden.intersecting(n,t).length>1},nextVisible:function(n,t){var r=this._count-1,i;return n===r?t?n+1:n:(n+=1,i=this._hidden.intersecting(n,n)[0],i.value!==0?i.end===r?n-1:i.end+1:n)},nextPage:function(n,t){return this.index(this.sum(0,n-1)+t)},prevPage:function(n,t){return this.index(this.sum(0,n)-t)},firstVisible:function(){var n=this._hidden.first();return n.value===0?0:n.end+1},lastVisible:function(){var n=this._hidden.last();return n.value===0?this._count-1:n.start-1},prevVisible:function(n,t){if(n===0)return t?-1:0;n-=1;var i=this._hidden.intersecting(n,n)[0];return i.value!==0?i.start===0?n+1:i.start-1:n},unhide:function(n){if(this.hidden(n)){var t=this._hidden.value(n,n);this._hidden.value(n,n,0);this.value(n,n,t)}},value:function(n,t,i){if(i!==undefined)this.values.value(n,t,i),this._refresh();else return this.values.iterator(n,t).at(0)},sum:function(n,t){for(var u=this.values.iterator(n,t),r=0,i=n;i<=t;i++)r+=u.at(i);return r},visible:function(n,t){var r=null,i=null,o=!1,u;t>=this.total+this.scrollBarSize&&(o=!0);u=this._pixelValues.intersecting(n,t);r=u[0];i=u[u.length-1];var s=n-r.start,h=(s/r.value.value>>0)+r.value.start,f=s-(h-r.value.start)*r.value.value,c=t-i.start,e=(c/i.value.value>>0)+i.value.start;return e>i.value.end&&(e=i.value.end),o&&(f+=i.value.value-(c-(e-i.value.start)*i.value.value)),f=Math.min(-f,0),{values:this.values.iterator(h,e),offset:f}},index:function(n){for(var t=0,i=this.values.iterator(0,this._count-1),r=i.at(0);r<n&&t<this._count-1;)r+=i.at(++t);return t},_refresh:function(){var t=0;this._pixelValues=this.values.map(function(i){var u=t,r;return t+=(i.end-i.start+1)*i.value,r=t-1,new n.spreadsheet.ValueRange(u,r,i)});this.total=t},getState:function(){return{values:this.values.getState(),hidden:this._hidden.getState()}},setState:function(n){this.values.setState(n.values);this._hidden.setState(n.hidden);this._refresh()}}),i=n.Class.extend({init:function(n,t,i,r){this._axis=n;this._start=t;this._count=i;this.hasHeader=t===0;this.headerSize=r;this.defaultValue=n._value;this.frozen=i>0},viewSize:function(n){this._viewSize=n},sum:function(n,t){return this._axis.sum(n,t-1)},start:function(){return this.sum(0,this._start)},size:function(){return this.sum(this._start,this._start+this._count)},index:function(n,t){return this._axis.index(n+(this.frozen?0:t)-this.headerSize)},paneSegment:function(){var t=this.start(),n;return this.hasHeader||(t+=this.headerSize),this.frozen?(n=this.size(),this.hasHeader?n+=this.headerSize:n-=this.headerSize):n=this._viewSize-t,{offset:t,length:n}},visible:function(n){var i=this.start(),r,t;return this.frozen?(r=this.size(),this.hasHeader||(r-=this.headerSize)):(r=this._viewSize-i-this.headerSize,i+=n),t=this._axis.visible(i,i+r-1),this.frozen&&(t.offset=0),t.start=i,this.hasHeader&&(t.offset+=this.headerSize,t.start-=this.headerSize),t},contains:function(n,t){return this.frozen?n>this._start+this._count?!1:t<this._start?!1:!0:t>=this._start}});n.spreadsheet.Axis=t;n.spreadsheet.PaneAxis=i}})(kendo)}(),function(){(function(n){function t(n){var t=n.getMonth()+1;return t>=1&&t<=3?1:t>=4&&t<=6?2:t>=7&&t<=9?3:4}function r(t,i){if(t instanceof Date){var r=n.date.today();return r.setFullYear(r.getFullYear()+i),r.getFullYear()===t.getFullYear()}return!1}function u(t,i){if(t instanceof Date){var r=n.date.firstDayOfMonth(n.date.today());return r.setMonth(r.getMonth()+i,1),r.getTime()===n.date.firstDayOfMonth(t).getTime()}return!1}function f(t,i){if(i instanceof Date){var r=n.date.dayOfWeek(n.date.getDate(t),1),u=n.date.dayOfWeek(n.date.getDate(i),1);return r.getTime()===u.getTime()}return!1}if(!n.support.browser.msie||!(n.support.browser.version<9)){var i=n.spreadsheet.Filter=n.Class.extend({prepare:function(){},value:function(n){return n.value},matches:function(){throw new Error("The 'matches' method is not implemented.");},toJSON:function(){throw new Error("The 'toJSON' method is not implemented.");}});i.create=function(t){var i=t.filter,r;if(!i)throw new Error("Filter type not specified.");if(r=n.spreadsheet[i.charAt(0).toUpperCase()+i.substring(1)+"Filter"],!r)throw new Error("Filter type not recognized.");return new r(t)};n.spreadsheet.ValueFilter=i.extend({_values:[],_dates:[],_blanks:!1,init:function(n){n.values!==undefined&&(this._values=n.values);n.blanks!==undefined&&(this._blanks=n.blanks);n.dates!==undefined&&(this._dates=n.dates)},value:function(t){var i=t.value,r;return this._dates.length>0&&t.format&&typeof i=="number"&&(r=n.spreadsheet.formatting.type(i,t.format),r==="date"&&(i=n.spreadsheet.numberToDate(i))),i},matches:function(n){return n===null||n===undefined?this._blanks:n instanceof Date?this._dates.some(function(t){return t.year===n.getFullYear()&&(t.month===undefined||t.month===n.getMonth())&&(t.day===undefined||t.day===n.getDate())&&(t.hours===undefined||t.hours===n.getHours())&&(t.minutes===undefined||t.minutes===n.getMinutes())&&(t.seconds===undefined||t.seconds===n.getSeconds())}):this._values.indexOf(n)>=0},toJSON:function(){return{filter:"value",values:this._values.slice(0)}}});n.spreadsheet.CustomFilter=i.extend({_logic:"and",init:function(t){if(t.logic!==undefined&&(this._logic=t.logic),t.criteria===undefined)throw new Error("Must specify criteria.");this._criteria=t.criteria;var i=n.data.Query.filterExpr({logic:this._logic,filters:this._criteria}).expression;this._matches=new Function("d","return "+i)},matches:function(n){return n===null?!1:this._matches(n)},value:function(t){var i=t.value,u=this._criteria[0].type||typeof this._criteria[0].value,r=typeof i,f;return t.format&&(r=n.spreadsheet.formatting.type(i,t.format)),r!=u?u=="string"&&(t.format&&(f=n.spreadsheet.formatting.format(i,t.format),i=f.children[0].nodeValue),i=i+""):r=="date"&&(i=n.spreadsheet.numberToDate(i)),i},toJSON:function(){return{filter:"custom",logic:this._logic,criteria:this._criteria}}});n.spreadsheet.TopFilter=i.extend({init:function(n){this._type=n.type;this._value=n.value;this._values=[]},prepare:function(n){var t=n.map(this.value).sort().filter(function(n,t,i){return t===0||n!==i[t-1]}),i;this._type==="topNumber"||this._type=="topPercent"?t.sort(function(n,t){return t-n}):t.sort(function(n,t){return n-t});i=this._value;(this._type==="topPercent"||this._type==="bottomPercent")&&(i=t.length*i/100>>0);this._values=t.slice(0,i)},matches:function(n){return this._values.indexOf(n)>=0},toJSON:function(){return{filter:"top",type:this._type,value:this._value}}});n.spreadsheet.DynamicFilter=i.extend({init:function(n){if(this._type=n.type,this._predicate=this[n.type],typeof this._predicate!="function")throw new Error("DynamicFilter type '"+n.type+"' not recognized.");},value:function(t){var i=t.value,r;return t.format&&(r=n.spreadsheet.formatting.type(i,t.format),r==="date"&&(i=n.spreadsheet.numberToDate(i))),i},prepare:function(n){for(var r,u=0,t=0,i=0;i<n.length;i++)r=this.value(n[i]),typeof r=="number"&&(u+=r,t++);this._average=t>0?u/t:0},matches:function(n){return this._predicate(n)},aboveAverage:function(t){return(t instanceof Date&&(t=n.spreadsheet.dateToNumber(t)),typeof t!="number")?!1:t>this._average},belowAverage:function(t){return(t instanceof Date&&(t=n.spreadsheet.dateToNumber(t)),typeof t!="number")?!1:t<this._average},tomorrow:function(t){if(t instanceof Date){var i=n.date.addDays(n.date.today(),1);return n.date.getDate(t).getTime()===i.getTime()}return!1},today:function(t){return t instanceof Date?n.date.isToday(t):!1},yesterday:function(t){if(t instanceof Date){var i=n.date.addDays(n.date.today(),-1);return n.date.getDate(t).getTime()===i.getTime()}return!1},nextWeek:function(t){return f(n.date.addDays(n.date.today(),7),t)},thisWeek:function(t){return f(n.date.today(),t)},lastWeek:function(t){return f(n.date.addDays(n.date.today(),-7),t)},nextMonth:function(n){return u(n,1)},thisMonth:function(n){return u(n,0)},lastMonth:function(n){return u(n,-1)},nextQuarter:function(i){if(i instanceof Date){var r=n.date.today(),u=t(i)-t(r);return u===1&&r.getFullYear()===i.getFullYear()||u==-3&&r.getFullYear()+1===i.getFullYear()}return!1},thisQuarter:function(i){if(i instanceof Date){var r=n.date.today(),u=t(i)-t(r);return u===0&&r.getFullYear()===i.getFullYear()}return!1},lastQuarter:function(i){if(i instanceof Date){var r=n.date.today(),u=t(r)-t(i);return u===1&&r.getFullYear()===i.getFullYear()||u==-3&&r.getFullYear()-1===i.getFullYear()}return!1},nextYear:function(n){return r(n,1)},thisYear:function(n){return r(n,0)},lastYear:function(n){return r(n,-1)},yearToDate:function(t){if(t instanceof Date){var i=n.date.today();return t.getFullYear()===i.getFullYear()&&t<=i}return!1},toJSON:function(){return{filter:"dynamic",type:this._type}}});[1,2,3,4].forEach(function(i){n.spreadsheet.DynamicFilter.prototype["quarter"+i]=function(n){return n instanceof Date?t(n)===i:!1}});n.cultures["en-US"].calendar.months.names.forEach(function(t,i){n.spreadsheet.DynamicFilter.prototype[t.toLowerCase()]=function(n){return n instanceof Date?n.getMonth()===i:!1}})}})(kendo)}(),function(){(function(n){if(!n.support.browser.msie||!(n.support.browser.version<9)){var t=n.Class.extend({init:function(n,t){this._grid=n;this._lists=t},indices:function(n,i,r,u){var f=t.ascendingComparer;return r===!1&&(f=t.descendingComparer),i.sortedIndices(this._grid.cellRefIndex(n.topLeft),this._grid.cellRefIndex(n.bottomRight),f,u)},sortBy:function(n,t,i,r,u){for(var o,h,f,s=this.indices(n.toColumn(t),i,r,u),e=n.topLeft.col;e<=n.bottomRight.col;e++)for(o=this._grid.index(n.topLeft.row,e),h=this._grid.index(n.bottomRight.row,e),f=0;f<this._lists.length;f++)o<this._lists[f].lastRangeStart()&&this._lists[f].sort(o,h,s);return s}});t.ascendingComparer=function(t,i){if(t===null&&i===null)return 0;if(t===null)return 1;if(i===null)return-1;var r=typeof t,u=typeof i;if(r==="number")return u==="number"?t-i:-1;if(r==="string")switch(u){case"number":return 1;case"string":return t.localeCompare(i);default:return-1}if(r==="boolean")switch(u){case"number":return 1;case"string":return 1;case"boolean":return t-i;default:return-1}if(t instanceof n.spreadsheet.calc.runtime.CalcError)return i instanceof n.spreadsheet.calc.runtime.CalcError?0:1;throw new Error("Cannot compare "+t+" and "+i);};t.descendingComparer=function(n,i){return n===null&&i===null?0:n===null?1:i===null?-1:t.ascendingComparer(i,n)};n.spreadsheet.Sorter=t}})(kendo)}(),function(){"use strict";function u(n){n=n.toUpperCase();for(var t=0,i=0;i<n.length;++i)t=t*26+n.charCodeAt(i)-64;return t-1}function r(n){return parseFloat(n)-1}function s(t,i){if(t.toLowerCase()=="#sheet")return n.SHEETREF;if(t.indexOf(",")>=0)return new n.UnionRef(t.split(/\s*,\s*/g).map(s));var f;if(f=/^(([A-Z0-9]+)!)?\$?([A-Z]+)\$?([0-9]+)$/i.exec(t))return new n.CellRef(r(f[4]),u(f[3]),0).setSheet(f[2],!!f[2]);if(f=/^(([A-Z0-9]+)!)?\$?([A-Z]+)\$?([0-9]+):(([A-Z0-9]+)!)?\$?([A-Z]+)\$?([0-9]+)$/i.exec(t))return new n.RangeRef(new n.CellRef(r(f[4]),u(f[3]),0).setSheet(f[2],!!f[2]),new n.CellRef(r(f[8]),u(f[7]),0).setSheet(f[6],!!f[6])).setSheet(f[2],!!f[2]);if(f=/^(([A-Z0-9]+)!)?\$?([A-Z]+):(([A-Z0-9]+)!)?\$?([A-Z]+)$/i.exec(t))return new n.RangeRef(new n.CellRef(-Infinity,u(f[3]),0).setSheet(f[2],!!f[2]),new n.CellRef(+Infinity,u(f[6]),0).setSheet(f[5],!!f[5])).setSheet(f[2],!!f[2]);if(f=/^(([A-Z0-9]+)!)?\$?([0-9]+):(([A-Z0-9]+)!)?\$?([0-9]+)$/i.exec(t))return new n.RangeRef(new n.CellRef(r(f[3]),-Infinity,0).setSheet(f[2],!!f[2]),new n.CellRef(r(f[6]),+Infinity,0).setSheet(f[5],!!f[5])).setSheet(f[2],!!f[2]);if(!i)throw new Error("Cannot parse reference: "+t);}function v(i,o,s,h){function k(n){return n.index=w.length,w.push(n),n}function v(n,t){if(c(n,t))return h.next();var i=h.peek();i?h.croak("Expected "+n+" «"+t+"» but found "+i.type+" «"+i.value+"»"):h.croak("Expected "+n+" «"+t+"»")}function c(n,t){var i=h.peek();return i!=null&&(n==null||i.type===n)&&(t==null||i.value===t)?i:null}function a(n){return b(ut(g(n)),0,n)}function it(t){var f,e,t;if(f=/^((.+)!)?(\$)?([A-Z]+)(\$)?([0-9]+)$/i.exec(t)){var e=f[1]&&f[2],h=f[3]?0:1,c=u(f[4]),l=f[5]?0:2,a=r(f[6]);return h&&(c-=s),l&&(a-=o),new n.CellRef(a,c,h|l).setSheet(e||i,!!e)}if(f=/^((.*)!)?(.+)$/i.exec(t))return e=f[1]&&f[2],t=f[3],new n.NameRef(t).setSheet(e||i,!!e)}function d(n,t){if(n.upper=="TRUE"||n.upper=="FALSE")return n.upper=="TRUE"?f:e;var i=it(n.value);return i?(t&&k(i),i):n}function g(n){var t=et()||ft();return t||(c("punc","(")?(h.next(),t=a(!0),v("punc",")")):c("num")||c("str")?t=h.next():c("sym")?t=d(h.next(),!0):c("op","+")||c("op","-")?t={type:"prefix",op:h.next().value,exp:a(n)}:c("punc","{")?(h.next(),t=rt()):h.peek()?h.croak("Parse error"):h.croak("Incomplete expression")),nt(t)}function rt(){for(var n=[],t=[n],i=!0;!h.eof()&&!c("punc","}");)i?i=!1:c("punc",";")?(t.push(n=[]),h.next()):v("op",","),n.push(a(!1));return v("punc","}"),{type:"matrix",value:t}}function ut(n){return c("punc","(")||c("sym")||c("num")?{type:"binary",op:" ",left:n,right:a(!1)}:n}function ft(){return h.ahead(2,function(n,t){if(n.type=="sym"&&t.type=="punc"&&t.value=="("){n=n.value;h.skip(2);var i=[];if(!c("punc",")"))for(;;){if(c("op",",")){i.push({type:"null"});h.next();continue}if(i.push(a(!1)),h.eof()||c("punc",")"))break;v("op",",")}return v("punc",")"),{type:"func",func:n,args:i}}})}function nt(n){return c("op","%")?(h.next(),nt({type:"postfix",op:"%",exp:n})):n}function b(n,i,r){var u=c("op"),f,e;return u&&(r||u.value!=",")&&(f=t[u.value],f>i)?(h.next(),e=b(g(r),f,r),b({type:"binary",op:u.value,left:n,right:e},i,r)):n}function et(){return h.ahead(4,function(t,i,r,u){if(p(t,i,r,u)){var f=tt(t,!0),e=tt(r,!1);if(f!=null&&e!=null)if(e.hasSheet()&&f.sheet.toLowerCase()!=e.sheet.toLowerCase())h.croak("Invalid range");else return h.skip(3),k(new n.RangeRef(f,e).setSheet(f.sheet,f.hasSheet()))}})}function tt(t,f){var e,h,c;return t.type=="num"&&t.value==t.value|0?new n.CellRef(r(t.value)-o,f?-Infinity:+Infinity,2).setSheet(i,!1):(e=d(t),e.type=="ref"?e.ref=="name"?(h=e.name,c=h.charAt(0)=="$",c&&(h=h.substr(1)),/^[0-9]+$/.test(h)?new n.CellRef(r(h)-(c?0:o),f?-Infinity:+Infinity,c?0:2).setSheet(e.sheet||i,e.hasSheet()):new n.CellRef(f?-Infinity:+Infinity,u(h)-(c?0:s),c?0:1).setSheet(e.sheet||i,e.hasSheet())):e:void 0)}var w=[];return typeof h=="string"&&(h=y(l(h))),{type:"exp",ast:a(!0),refs:w,sheet:i,row:o,col:s}}function w(i){function r(i,e){switch(i.type){case"num":case"bool":return JSON.stringify(i.value);case"str":return JSON.stringify(JSON.stringify(i.value));case"ref":return"this.refs["+i.index+"].print(row, col)";case"prefix":return f(i.op,e,function(){return JSON.stringify(i.op)+" + "+r(i.exp,t[i.op])});case"postfix":return f(i.op,e,function(){return r(i.exp,t[i.op])+" + "+JSON.stringify(i.op)});case"binary":return f(i.op,e,function(){var f=u(r(i.left,t[i.op]),i.left instanceof n.NameRef&&i.op==":"),e=u(r(i.right,t[i.op]),i.right instanceof n.NameRef&&i.op==":");return f+" + "+JSON.stringify(i.op)+" + "+e});case"func":return JSON.stringify(i.func+"(")+" + "+(i.args.length>0?i.args.map(function(n){return r(n,0)}).join(" + ', ' + "):"''")+" + ')'";case"matrix":return"'{ ' + "+i.value.map(function(n){return n.map(function(n){return r(n,0)}).join(" + ', ' + ")}).join(" + '; ' + ")+"+ ' }'";case"null":return"''"}throw new Error("Cannot make printer for node "+i.type);}function u(n,t){return t?"'(' + "+n+" + ')'":n}function f(n,i,r){var f=t[n]<i||!i&&n==",";return u(r(),f)}return h("function(row, col){return("+r(i.ast,0)+")}")}function b(n,t){function i(n,t){switch(n.type){case"ref":case"num":case"str":case"null":case"bool":return u(n,t);case"prefix":case"postfix":return c(n,t);case"binary":return l(n,t);case"func":return p(n,t);case"lambda":return w(n,t);case"matrix":return o(n.value,t,!0)}throw new Error("Cannot CPS "+n.type);}function u(n,t){return t(n)}function c(n,t){return i({type:"func",func:"unary"+n.op,args:[n.exp]},t)}function l(n,t){return i({type:"func",func:"binary"+n.op,args:[n.left,n.right]},t)}function a(n,t,u,o){return i(n,function(n){var l=s(o),h=r("T"),c=r("E");return{type:"func",func:"if",args:[l,n,{type:"lambda",vars:[h],body:i(t||f,function(n){return{type:"call",func:{type:"var",name:h},args:[n]}})},{type:"lambda",vars:[c],body:i(u||e,function(n){return{type:"call",func:{type:"var",name:c},args:[n]}})}]}})}function v(n,t){return n.length===0?u(f,t):i({type:"func",func:"IF",args:[n[0],{type:"func",func:"AND",args:n.slice(1)},e]},t)}function y(n,t){return n.length===0?u(e,t):i({type:"func",func:"IF",args:[n[0],f,{type:"func",func:"OR",args:n.slice(1)}]},t)}function p(n,t){switch(n.func.toLowerCase()){case"if":return a(n.args[0],n.args[1],n.args[2],t);case"and":return v(n.args,t);case"or":return y(n.args,t);case"true":return t(f);case"false":return t(e)}return function r(t,u){return u==n.args.length?{type:"func",func:n.func,args:t}:i(n.args[u],function(n){return r(t.concat([n]),u+1)})}([s(t)],0)}function w(n,t){var u=r("K"),f=i(n.body,function(n){return{type:"call",func:{type:"var",value:u},args:[n]}});return t({type:"lambda",vars:[u].concat(n.vars),body:f})}function o(n,t,r){var u=[];return function f(e){return e==n.length?t({type:"matrix",value:u}):(r?o:i)(n[e],function(n){return u[e]=n,f(e+1)})}(0)}function s(n){var t=r("R");return{type:"lambda",vars:[t],body:n({type:"var",name:t})}}function r(n){return n||(n=""),n="_"+n,n+ ++h}var h=0;return i(n,t)}function k(n){function t(n){var i=n.type;if(i=="num")return n.value+"";if(i=="str")return JSON.stringify(n.value);if(i=="return")return"context.resolve("+t(n.value)+")";if(i=="func")return"context.func("+JSON.stringify(n.func)+", "+t(n.args[0])+", "+e(n.args.slice(1))+")";if(i=="call")return t(n.func)+"("+n.args.map(t).join(", ")+")";if(i=="ref")return"refs["+n.index+"]";if(i=="bool")return""+n.value;if(i=="if")return"(context.bool("+t(n.co)+") ? "+t(n.th)+" : "+t(n.el)+")";if(i=="lambda")return"(function("+n.vars.join(", ")+"){ return("+t(n.body)+") })";if(i=="var")return n.name;if(i=="matrix")return e(n.value);if(i=="null")return"null";throw new Error("Cannot compile expression "+i);}function e(n){return"[ "+n.map(t).join(", ")+" ]"}var u=w(n),f=u.call(n),i=c[f],r;return i?i.clone(n.sheet,n.row,n.col):(r=t(b(n.ast,function(n){return{type:"return",value:n}})),r=["function(){","var context = this, refs = context.formula.absrefs",r,"}"].join(";\n"),i=new o.Formula(n.refs,h(r),u,n.sheet,n.row,n.col),c[f]=i,i)}function y(n,i){function o(n){return/[0-9]/i.test(n)}function h(n){return/[a-z$_]/i.test(n)||n.toLowerCase()!=n.toUpperCase()}function a(n){return h(n)||o(n)||n=="!"||n=="."}function v(n){return n in t}function y(n){return";(){}[]".indexOf(n)>=0}function c(n){return" \t\n ".indexOf(n)>=0}function p(){var n=!1,t=f(function(t){return t=="."?n?!1:(n=!0,!0):o(t)});return{type:"num",value:parseFloat(t)}}function w(){var t=f(a);return{type:"sym",value:t,upper:t.toUpperCase(),space:c(n.peek())}}function b(){return n.next(),{type:"str",value:n.readEscaped('"')}}function k(){return{type:"op",value:f(function(n,i){return i+n in t})}}function d(){return{type:"punc",value:n.next()}}function g(){if(f(c),n.eof())return null;var t=n.peek(),u;return t=='"'?r(b):o(t)?r(p):h(t)?r(w):v(t)?r(k):y(t)?r(d):(u=n.lookingAt(/^#([a-z\/]+)[?!]/i))?r(function(){return n.skip(u),{type:"error",value:u[1]}}):(i||n.croak("Can't handle character: "+t),r(function(){return{type:"error",value:n.next()}}))}function s(){while(e.length<=u)e.push(g());return e[u]}function l(){var n=s();return n&&u++,n}function nt(n,t){for(var r=u,i=[],f={type:"eof"};n-->0;)i.push(l()||f);return u=r,t.apply(i,i)}function tt(n){u+=n}function it(){return s()==null}var e=[],u=0,f=n.readWhile,r=i?function(t){var i=n.pos();return t=t(),t.begin=i,t.end=n.pos(),t}:function(n){return n()};return{next:l,peek:s,eof:it,croak:n.croak,ahead:nt,skip:tt}}function l(n){function h(){return t}function i(){var i=n.charAt(t++);return i=="\n"?(s++,e=0):e++,i}function u(){return n.charAt(t)}function f(){return u()===""}function o(n){throw new a(n,t);}function c(i){if(typeof i=="string")n.substr(t,i.length)!=i&&o("Expected "+i),r(i.length);else if(i instanceof RegExp){var u=i.exec(n.substr(t));if(u)return r(u[0].length),u}else r(i[0].length)}function r(n){while(n-->0)i()}function l(n){for(var r=!1,u="",t;!f();)if(t=i(),r)u+=t,r=!1;else if(t=="\\")r=!0;else if(t==n)break;else u+=t;return u}function v(n){for(var t="";!f()&&n(u(),t);)t+=i();return t}function y(i){return i.exec(n.substr(t))}var t=0,s=1,e=0;return{next:i,peek:u,eof:f,croak:o,readWhile:v,readEscaped:l,lookingAt:y,skip:c,forward:r,pos:h}}function p(n,t,i,r){return(n.type=="sym"||n.type=="num")&&t.type=="op"&&t.value==":"&&(i.type=="sym"||i.type=="num")&&!(r.type=="punc"&&r.value=="("&&!i.space)}function d(n){function r(t,i,r,u){if(p(t,i,r,u)){var f=s(t.value+":"+r.value,!0);if(f)return n.skip(3),{type:"ref",ref:f,begin:t.begin,end:r.end}}}function u(){var t=n.next(),i;return t.type=="sym"&&(i=s(t.value,!0),i?(t.type="ref",t.ref=i):t.upper=="TRUE"?(t.type="bool",t.value=!0):t.upper=="FALSE"&&(t.type="bool",t.value=!1)),t}function f(t,i){if(t.type=="sym"&&i.type=="punc"&&i.value=="(")return n.skip(1),t.type="func",t}var i=[],t;for(n=y(l(n),!0);!n.eof();)i.push(n.ahead(4,r)||n.ahead(2,f)||u());return t=i[0],t.type=="op"&&t.value=="="&&(t.type="startexp"),i}var f,e,h,c;if(!kendo.support.browser.msie||!(kendo.support.browser.version<9)){var n=kendo.spreadsheet,i=n.calc,o=i.runtime,t=Object.create(null),a=kendo.Class.extend({init:function(n,t){this.message=n;this.pos=t},toString:function(){return this.message}});(function(n){n.forEach(function(i,r){i.forEach(function(i){t[i]=n.length-r})})})([[":"],[" "],[","],["%"],["^"],["*","/"],["+","-"],["&"],["=","<",">","<=",">=","<>"]]);f={type:"bool",value:!0};e={type:"bool",value:!1};h=function(n){return function(t){var i=n[t];return i||(i=n[t]=new Function("'use strict';return("+t+")")()),i}}(Object.create(null));c=Object.create(null);i.parse=function(n,t,i,r){var f,e,u;return r instanceof Date?{type:"date",value:o.dateToSerial(r)}:typeof r=="number"?{type:"number",value:r}:typeof r=="boolean"?{type:"boolean",value:r}:(r+="",/^'/.test(r))?{type:"string",value:r.substr(1)}:/^[0-9.]+%$/.test(r)&&(f=r.substr(0,r.length-1),u=parseFloat(f),!isNaN(u)&&u==f)?{type:"percent",value:u/100}:/^=/.test(r)?(r=r.substr(1),/\S/.test(r)?v(n,t,i,r):{type:"string",value:"="+r}):r.toLowerCase()=="true"?{type:"boolean",value:!0}:r.toLowerCase()=="false"?{type:"boolean",value:!1}:(e=o.parseDate(r),e)?{type:"date",value:o.dateToSerial(e)}:(u=parseFloat(r),!isNaN(u)&&r.length>0&&u==r)?{type:"number",value:u}:{type:"string",value:r}};i.parseFormula=v;i.parseReference=s;i.compile=k;i.InputStream=l;i.ParseError=a;i.tokenize=d}}(),function(){"use strict";function i(n){function f(){i.push({cond:"text",body:[{type:"text"}]})}function c(){var t=n.skip(e);if(t)return t[1].toLowerCase()}function l(){var t=n.skip(o),i;if(t&&(i=parseFloat(t[2]),!isNaN(i)))return{op:t[1],value:i}}function a(){for(var t=[],i;!n.eof()&&(i=v());)t.push(i);return t}function v(){var i,f,t;if(t=n.skip(/^([#0?]+),([#0?]+)/))return{type:"digit",sep:!0,format:t[1]+t[2],decimal:u};if(t=n.skip(/^[#0?]+/))return{type:"digit",sep:!1,format:t[0],decimal:u};if(t=n.skip(/^(e)([+-])/i))return{type:"exp",ch:t[1],sign:t[2]};if(t=n.skip(/^(d{1,4}|m{1,5}|yyyy|yy)/i))return f="date",t=t[1].toLowerCase(),r&&(t=="m"||t=="mm")&&(f="time"),r=!1,{type:f,part:t.charAt(0),format:t.length};if(t=n.skip(/^(hh?|ss?)/i))return r=!0,t=t[1].toLowerCase(),{type:"time",part:t.charAt(0),format:t.length};if(t=n.skip(/^\[(hh?|mm?|ss?)\]/i))return r=!0,t=t[1].toLowerCase(),{type:"eltime",part:t.charAt(0),format:t.length};if(t=n.skip(/^(am\/pm|a\/p)/i))return t=t[1].split("/"),{type:"ampm",am:t[0],pm:t[1]};switch(i=n.next()){case";":return null;case"\\":return{type:"str",value:n.next()};case'"':return{type:"str",value:n.readEscaped(i)};case"@":return{type:"text"};case"_":return{type:"space",value:n.next()};case"*":return{type:"fill",value:n.next()};case".":return n.lookingAt(/^\s*[#0?]/)?(u=!0,{type:"dec"}):{type:"str",value:"."};case"%":return{type:"percent"};case",":return{type:"comma"}}return{type:"str",value:i}}function y(){u=!1;var n=c(),t=l();return!n&&t&&(n=c()),{color:n,cond:t,body:a()}}var s;n=t.InputStream(n);for(var i=[],r=!1,h=!1,u;!n.eof();)s=y(),i.push(s),s.cond&&(h=!0);return h?f():i.length==1?(i[0].cond="num",f()):i.length==2?(i[0].cond={op:">=",value:0},i[1].cond={op:"<",value:0},f()):i.length>=3&&(i[0].cond={op:">",value:0},i[1].cond={op:"<",value:0},i[2].cond={op:"=",value:0},f(),i.length>3&&(i[3].cond="text",i=i.slice(0,4))),i}function s(t){function i(n){var t="";return n.color&&(t+="["+n.color+"]"),n.cond&&(n.cond=="text"||n.cond=="num"||(t+="["+n.cond.op+n.cond.value+"]")),t+n.body.map(r).join("")}function r(t){return t.type=="digit"?t.sep?t.format.charAt(0)+","+t.format.substr(1):t.format:t.type=="exp"?t.ch+t.sign:t.type=="date"||t.type=="time"?n("",t.format,t.part):t.type=="ampm"?t.am+"/"+t.pm:t.type=="str"?JSON.stringify(t.value):t.type=="text"?"@":t.type=="space"?"_"+t.value:t.type=="fill"?"*"+t.value:t.type=="dec"?".":t.type=="percent"?"%":t.type=="comma"?",":void 0}return t.map(i).join(";")}function h(t,i){t.forEach(function(t){var u=i,r,o;if(t.cond!="text"){for(var e=t.body,s=!1,f=e.length;u!==0&&--f>=0;)if(r=e[f],r.type=="digit"){if(r.decimal&&(s=!0,u>0?r.format+=n("",u,"0"):u<0&&(o=r.format.length,r.format=r.format.substr(0,o+u),u+=o-r.format.length),r.format.length===0))for(e.splice(f,1);--f>=0;){if(r=e[f],r.type=="digit"&&r.decimal){++f;break}if(r.type=="dec"){e.splice(f,1);break}}if(u>0)break}!s&&u>0&&e.splice(f+1,0,{type:"dec"},{type:"digit",sep:!1,decimal:!0,format:n("",u,"0")})}})}function c(n){var t=0;return{next:function(){return n[t++]},eof:function(){return t>=n.length},ahead:function(i,r){if(t+i<=n.length){var u=r.apply(null,n.slice(t,t+i));return u&&(t+=i),u}},restart:function(){t=0}}}function l(n){function b(n,t){(n.type=="digit"&&t.type=="comma"||n.type=="comma"&&n.hidden&&t.type=="comma")&&(t.hidden=!0,a++)}var u=c(n.body),h=!1,e=!1,y=!1,l=0,a=0,i="",p=!1,v=0,o=[],s=[],f=n.cond,r="",w,t;for(f=="text"?r="if (typeof value == 'string') { ":f=="num"?r="if (typeof value == 'number') { ":f&&(w=f.op=="="?"==":f.op,r="if (typeof value == 'number' && value "+w+" "+f.value+") { ",i+="value = Math.abs(value); "),n.color&&(i+="element.attr.style = { color: "+JSON.stringify(n.color)+"}; ");!u.eof();)u.ahead(2,b),t=u.next(),t.type=="percent"?l++:t.type=="digit"?t.decimal?(v+=t.format.length,s.push(t.format)):(o.push(t.format),t.sep&&(p=!0)):t.type=="time"?e=!0:t.type=="date"?h=!0:t.type=="ampm"&&(y=e=!0);for(l>0&&(i+="value *= "+Math.pow(100,l)+"; "),a>0&&(i+="value /= "+Math.pow(1e3,a)+"; "),o.length&&(i+="var intPart = runtime.formatInt(culture, value, "+JSON.stringify(o)+", "+v+", "+p+"); "),s.length&&(i+="var decPart = runtime.formatDec(culture, value, "+JSON.stringify(s)+", "+v+"); "),(o.length||s.length)&&(i+="type = 'number'; "),h&&(i+="var date = runtime.unpackDate(value); "),e&&(i+="var time = runtime.unpackTime(value); "),(h||e)&&(i+="type = 'date'; "),(l>0||a>0||o.length||s.length||h||e)&&(r||(r="if (typeof value == 'number') { ")),u.restart();!u.eof();)t=u.next(),t.type=="dec"?i+="output += culture.numberFormat['.']; ":t.type!="comma"||t.hidden?t.type=="percent"?(i+="type = 'percent'; ",i+="output += culture.numberFormat.percent.symbol; "):t.type=="str"?i+="output += "+JSON.stringify(t.value)+"; ":t.type=="text"?(i+="type = 'text'; ",i+="output += value; "):t.type=="space"?(i+="element.children.push(dom.text(output)); ",i+="output = ''; ",i+="element.children.push(dom.element('span', { style: { visibility: 'hidden' }}, [ dom.text("+JSON.stringify(t.value)+") ])); "):t.type=="fill"?i+="output += runtime.fill("+JSON.stringify(t.value)+"); ":t.type=="digit"?i+="output += "+(t.decimal?"decPart":"intPart")+".shift(); ":t.type=="date"?i+="output += runtime.date(culture, date, "+JSON.stringify(t.part)+", "+t.format+"); ":t.type=="time"?i+="output += runtime.time(culture, time, "+JSON.stringify(t.part)+", "+t.format+", "+y+"); ":t.type=="eltime"?i+="output += runtime.eltime(culture, value, "+JSON.stringify(t.part)+", "+t.format+"); ":t.type=="ampm"&&(i+="output += time.hours < 12 ? "+JSON.stringify(t.am)+" : "+JSON.stringify(t.pm)+"; "):i+="output += ','; ";return i+="element.children.push(dom.text(output)); ",i+="element.__dataType = type; ",i+="return element; ",r&&(i=r+i+"}"),i}function u(n){var u=r[n],e,t;return u||(e=i(n),t=e.map(l).join("\n"),t="return function(value, culture){ 'use strict'; if (!culture) culture = kendo.culture(); var output = '', type = null, element = dom.element('span'); "+t+"; return element; };",u=r[n]=new Function("runtime","dom",t)(f,kendo.dom)),u}function n(n,t,i){for(n+="";n.length<t;)n=i+n;return n}var r,f;if(!kendo.support.browser.msie||!(kendo.support.browser.version<9)){var t=kendo.spreadsheet.calc,e=/^\[(black|green|white|blue|magenta|yellow|cyan|red)\]/i,o=/^\[(<=|>=|<>|<|>|=)(-?[0-9.]+)\]/;r=Object.create(null);f={unpackDate:t.runtime.unpackDate,unpackTime:t.runtime.unpackTime,space:function(n){return"<span style='visibility: hidden'>"+kendo.htmlEncode(n)+"<\/span>"},date:function(t,i,r,u){switch(r){case"d":switch(u){case 1:return i.date;case 2:return n(i.date,2,"0");case 3:return t.calendars.standard.days.namesAbbr[i.day];case 4:return t.calendars.standard.days.names[i.day]}break;case"m":switch(u){case 1:return i.month+1;case 2:return n(i.month+1,2,"0");case 3:return t.calendars.standard.months.namesAbbr[i.month];case 4:return t.calendars.standard.months.names[i.month];case 5:return t.calendars.standard.months.names[i.month].charAt(0)}break;case"y":switch(u){case 2:return i.year%100;case 4:return i.year}}return"##"},time:function(t,i,r,u,f){switch(r){case"h":var e=f?i.hours%12||12:i.hours;switch(u){case 1:return e;case 2:return n(e,2,"0")}break;case"m":switch(u){case 1:return i.minutes;case 2:return n(i.minutes,2,"0")}break;case"s":switch(u){case 1:return i.seconds;case 2:return n(i.seconds,2,"0")}}return"##"},eltime:function(t,i,r,u){switch(r){case"h":i=i*24;break;case"m":i=i*1440;break;case"s":i=i*86400}i|=0;switch(u){case 1:return i;case 2:return n(i,2,"0")}return"##"},fill:function(n){return n},formatInt:function(n,t,i,r,u){function o(t){u&&h&&h%3==0&&t!=" "&&(f=n.numberFormat[","]+f);f=t+f;h++}var s,c,l,a;t=t.toFixed(r).replace(/\..*$/,"");r>0&&(t==="0"?t="":t==="-0"&&(t="-"));var e=t.length-1,v=[],h=0,f;for(s=i.length;--s>=0;){for(c=i[s],f="",l=c.length;--l>=0;)a=c.charAt(l),e<0?a=="0"?o("0"):a=="?"&&o(" "):o(t.charAt(e--));if(s===0)while(e>=0)o(t.charAt(e--));v.unshift(f)}return v},formatDec:function(n,t,i,r){var o,s,h,f,c,u,e,l;for(t=t.toFixed(r),o=t.indexOf("."),t=o>=0?t.substr(o+1).replace(/0+$/,""):"",s=0,h=[],f=0;f<i.length;++f){for(c=i[f],u="",e=0;e<c.length;++e)l=c.charAt(e),s<t.length?u+=t.charAt(s++):l=="0"?u+="0":l=="?"&&(u+=" ");h.push(u)}return h}};kendo.spreadsheet.formatting={compile:u,parse:i,format:function(n,t,i){return u(t)(n,i)},type:function(n,t){return u(t)(n).__dataType},adjustDecimals:function(n,t){var r=i(n);return h(r,t),s(r)}}}}(),function(){"use strict";function g(n){return(Math.exp(n)+Math.exp(-n))/2}function nt(n){return(Math.exp(n)-Math.exp(-n))/2}function ct(n){return nt(n)/g(n)}function lt(n,t){while(t){var i=n%t;n=t;t=i}return n}function ti(n,t){return Math.abs(n*t)/lt(n,t)}function tt(n,t){for(var f=[],i=0,o=n[0],r,u,e;i<n.length;)f.push({matrix:n[i++],pred:s(n[i++])});for(r=0;r<o.height;++r)t:for(u=0;u<o.width;++u){for(i=0;i<f.length;++i)if(e=f[i].matrix.get(r,u),!f[i].pred(e==null||e===""?0:e))continue t;t(r,u)}}function p(n){return n.reduce(function(n,t){return n+t},0)/n.length}function w(n,t,i){return i==null&&(i=p(n)),n.reduce(function(n,t){return n+Math.pow(t-i,2)},0)/t}function at(n,t){return Math.sqrt(w(n,t))}function b(n,i,r){var e=0,o=0,u=null,f=null,s=!1;return(n.forEach(function(n){n<i?(e++,u=u==null?n:Math.max(u,n)):n>i?(o++,f=f==null?n:Math.min(f,n)):s=!0}),!e&&!o)?new t("N/A"):s?r?(e+1)/(n.length+1):e/(e+o):((f-i)*b(n,u,r)+(i-u)*b(n,f,r))/(f-u)}function vt(n,t,i){for(var u=0,f=p(n),e=p(t),o=n.length,r=0;r<o;++r)u+=(n[r]-f)*(t[r]-e);return u/i}function yt(n,t){n.sort(f);var r=n.length,i=t|0,u=t-i;return i===0?n[0]:i>=r?n[r-1]:(--i,n[i]+u*(n[i+1]-n[i]))}function pt(n,t){var i=t*(n.length-1)+1;return yt(n,i)}function wt(n,t){var i=t*(n.length+1);return yt(n,i)}function bt(n,t,i,r){var f,u;if(r){for(f=0,u=0;u<=n;++u)f+=o(t,u)*Math.pow(i,u)*Math.pow(1-i,t-u);return f}return o(t,n)*Math.pow(i,n)*Math.pow(1-i,t-n)}function kt(n){var t=r(a(n,0,1));return t.day==4||t.day==3&&i.isLeapYear(n)?53:52}function et(n,t,i){var u=r(n),f=r(t);return i?(u.date==31&&(u.date=30),f.date==31&&(f.date=30)):(u.month==1&&f.month==1&&u.date==l(u.year,1)&&f.date==l(f.year,1)&&(f.date=30),u.date==l(u.year,u.month)&&(u.date=30,f.date==31&&(f.date=30))),360*(f.year-u.year)+30*(f.month-u.month)+(f.date-u.date)}function d(n){return typeof n=="number"||typeof n=="boolean"||n==null||n===""}function f(n,t){return n===t?0:n<t?-1:1}function ot(n,t){return n===t?0:n<t?1:-1}var it,rt,ut,ft,k,o,dt,s;if(!kendo.support.browser.msie||!(kendo.support.browser.version<9)){var v=kendo.util,e=kendo.spreadsheet,st=e.calc,i=st.runtime,n=i.defineFunction,u=i.defineAlias,t=i.CalcError,ht=e.RangeRef,h=e.CellRef,gt=e.UnionRef,c=i.Matrix,y=e.Ref,l=i.daysInMonth,a=i.packDate,r=i.unpackDate,ni=i.daysInYear;["abs","cos","sin","acos","asin","tan","atan","exp","sqrt"].forEach(function(t){n(t,Math[t]).args([["*n","number"]])});n("ln",Math.log).args([["*n","number"]]);n("log",function(n,t){return Math.log(n)/Math.log(t)}).args([["*num","number++"],["*base",["or","number++",["null",10]]],["?",["assert","$base != 1","DIV/0"]]]);n("log10",function(n){return Math.log(n)/Math.log(10)}).args([["*num","number++"]]);n("pi",function(){return Math.PI}).args([]);n("sqrtpi",function(n){return Math.sqrt(n*Math.PI)}).args([["*num","number+"]]);n("degrees",function(n){return 180*n/Math.PI%360}).args([["*radians","number"]]);n("radians",function(n){return Math.PI*n/180}).args([["*degrees","number"]]);n("cosh",g).args([["*num","number"]]);n("acosh",function(n){return Math.log(n+Math.sqrt(n-1)*Math.sqrt(n+1))}).args([["*num","number"],["?",["assert","$num >= 1"]]]);n("sinh",nt).args([["*num","number"]]);n("asinh",function(n){return Math.log(n+Math.sqrt(n*n+1))}).args([["*num","number"]]);n("sec",function(n){return 1/Math.cos(n)}).args([["*num","number"]]);n("sech",function(n){return 1/g(n)}).args([["*num","number"]]);n("csc",function(n){return 1/Math.sin(n)}).args([["*num","number"]]);n("csch",function(n){return 1/nt(n)}).args([["*num","number"]]);n("atan2",function(n,t){return Math.atan(t/n)}).args([["*x","divisor"],["*y","number"]]);n("tanh",ct).args([["*num","number"]]);n("atanh",function(n){return Math.log(Math.sqrt(1-n*n)/(1-n))}).args([["*num",["and","number",["(between)",-1,1]]]]);n("cot",function(n){return 1/Math.tan(n)}).args([["*num","divisor"]]);n("coth",function(n){return 1/ct(n)}).args([["*num","divisor"]]);n("acot",function(n){return Math.PI/2-Math.atan(n)}).args([["*num","number"]]);n("acoth",function(n){return Math.log((n+1)/(n-1))/2}).args([["*num","number"],["?",["or",["assert","$num < -1"],["assert","$num > 1"]]]]);n("power",function(n,t){return Math.pow(n,t)}).args([["*a","number"],["*b","number"]]);n("mod",function(n,t){return n%t}).args([["*a","number"],["*b","divisor"]]);n("quotient",function(n,t){return Math.floor(n/t)}).args([["*a","number"],["*b","divisor"]]);n("ceiling",function(n,t){return t?t*Math.ceil(n/t):0}).args([["*number","number"],["*significance","number"],["?",["assert","$significance >= 0 || $number < 0"]]]);n("ceiling.precise",function(n,t){return t=Math.abs(t),t?t*Math.ceil(n/t):0}).args([["*number","number"],["*significance",["or","number",["null",1]]]]);u("iso.ceiling","ceiling.precise");n("ceiling.math",function(n,t,i){return!t||!n?0:(n<0&&(!i&&t<0||i&&t>0)&&(t=-t),t?t*Math.ceil(n/t):0)}).args([["*number","number"],["*significance",["or","number",["null","$number < 0 ? -1 : 1"]]],["*mode",["or","logical",["null",0]]]]);n("floor",function(n,t){return t?t*Math.floor(n/t):0}).args([["*number","number"],["*significance","number"],["?",["assert","$significance >= 0 || $number < 0"]]]);n("floor.precise",function(n,t){return t=Math.abs(t),t?t*Math.floor(n/t):0}).args([["*number","number"],["*significance",["or","number",["null",1]]]]);n("floor.math",function(n,t,i){return!t||!n?0:(n<0&&(!i&&t<0||i&&t>0)&&(t=-t),t?t*Math.floor(n/t):0)}).args([["*number","number"],["*significance",["or","number",["null","$number < 0 ? -1 : 1"]]],["*mode",["or","logical",["null",0]]]]);n("int",Math.floor).args([["*number","number"]]);n("mround",function(n,t){return t?t*Math.round(n/t):0}).args([["*number","number"],["*multiple","number"]]);n("even",function(n){var t=n<0?Math.floor(n):Math.ceil(n);return t%2?t+(t<0?-1:1):t}).args([["*number","number"]]);n("odd",function(n){var t=n<0?Math.floor(n):Math.ceil(n);return t%2?t:t+(t<0?-1:1)}).args([["*number","number"]]);n("sign",function(n){return n<0?-1:n>0?1:0}).args([["*number","number"]]);n("gcd",function(n){for(var t=n[0],i=1;i<n.length;++i)t=lt(t,n[i]);return t}).args([["numbers",["collect","number"]]]);n("lcm",function(n){for(var t=n[0],i=1;i<n.length;++i)t=ti(t,n[i]);return t}).args([["numbers",["collect","number"]]]);n("sum",function(n){return n.reduce(function(n,t){return n+t},0)}).args([["numbers",["collect","number"]]]);n("product",function(n){return n.reduce(function(n,t){return n*t},1)}).args([["numbers",["collect","number"]]]);n("sumproduct",function(n){var t=0;return n[0].each(function(i,r,u){var f,e;if(typeof i=="number"){for(f=1;f<n.length;++f){if(e=n[f].get(r,u),typeof e!="number")return;i*=e}t+=i}}),t}).args([["a1","matrix"],["+",["a2",["and","matrix",["assert","$a2.width == $a1.width"],["assert","$a2.height == $a1.height"]]]]]);n("sumsq",function(n){return n.reduce(function(n,t){return n+t*t},0)}).args([["numbers",["collect","number"]]]);n("sumx2my2",function(n,t){var i=0;return n.each(function(n,r,u){var f=t.get(r,u);typeof n=="number"&&typeof f=="number"&&(i+=n*n-f*f)}),i}).args([["a","matrix"],["b",["and","matrix",["assert","$b.width == $a.width"],["assert","$b.height == $a.height"]]]]);n("sumx2py2",function(n,t){var i=0;return n.each(function(n,r,u){var f=t.get(r,u);typeof n=="number"&&typeof f=="number"&&(i+=n*n+f*f)}),i}).args([["a","matrix"],["b",["and","matrix",["assert","$b.width == $a.width"],["assert","$b.height == $a.height"]]]]);n("sumxmy2",function(n,t){var i=0;return n.each(function(n,r,u){var f=t.get(r,u);typeof n=="number"&&typeof f=="number"&&(i+=(n-f)*(n-f))}),i}).args([["a","matrix"],["b",["and","matrix",["assert","$b.width == $a.width"],["assert","$b.height == $a.height"]]]]);n("seriessum",function(n,i,r,u){var f=0;return u.each(function(u){if(typeof u!="number")throw new t("VALUE");f+=u*Math.pow(n,i);i+=r}),f}).args([["x","number"],["y","number"],["m","number"],["a","matrix"]]);n("min",function(n){return Math.min.apply(Math,n)}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length > 0","N/A"]]]);n("max",function(n){return Math.max.apply(Math,n)}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length > 0","N/A"]]]);n("counta",function(n){return n.length}).args([["values",["#collect","anyvalue"]]]);n("count",function(n){return n.length}).args([["numbers",["#collect","number"]]]);n("countunique",function(n){var t=0,i=[];return n.forEach(function(n){i.indexOf(n)<0&&(t++,i.push(n))}),t}).args([["values",["#collect","anyvalue"]]]);n("countblank",function(n){function i(n){(n==null||n==="")&&t++}function r(n){for(var r,t=0;t<n.length;++t)r=n[t],r instanceof c?r.each(i,!0):i(r)}var t=0;return r(n),t}).args([["+",["args",["or","matrix","anyvalue"]]]]);n("iseven",function(n){return n%2==0}).args([["*number","number"]]);n("isodd",function(n){return n%2!=0}).args([["*number","number"]]);n("n",function(n){return typeof n=="boolean"?n?1:0:typeof n=="number"?n:0}).args([["*value","anyvalue"]]);n("na",function(){return new t("N/A")}).args([]);it=[["m1","matrix"],["c1","anyvalue"],[["m2",["and","matrix",["assert","$m1.width == $m2.width"],["assert","$m1.height == $m2.height"]]],["c2","anyvalue"]]];n("countifs",function(n,t,i){var r=0;return i.unshift(n,t),tt(i,function(){r++}),r}).args(it);rt=[["range","matrix"]].concat(it);n("sumifs",function(n,t,i,r){r.unshift(n,d,t,i);var u=0;return tt(r,function(t,i){var r=n.get(t,i);r&&(u+=r)}),u}).args(rt);n("averageifs",function(n,i,r,u){u.unshift(n,d,i,r);var e=0,f=0;return tt(u,function(t,i){var r=n.get(t,i);(r==null||r==="")&&(r=0);e+=r;f++}),f?e/f:new t("DIV/0")}).args(rt);n("countif",function(n,t){t=s(t);var i=0;return n.each(function(n){t(n)&&i++}),i}).args([["range","matrix"],["*criteria","anyvalue"]]);ut=[["range","matrix"],["*criteria","anyvalue"],["sumRange",["or",["and","matrix",["assert","$sumRange.width == $range.width"],["assert","$sumRange.height == $range.height"]],["null","$range"]]]];n("sumif",function(n,t,i){var r=0;return t=s(t),n.each(function(n,u,f){if(t(n)){var e=i.get(u,f);d(e)&&(r+=e||0)}}),r}).args(ut);n("averageif",function(n,i,r){var f=0,u=0;return i=s(i),n.each(function(n,t,e){if(i(n)){var o=r.get(t,e);d(o)&&(f+=o||0,u++)}}),u?f/u:new t("DIV/0")}).args(ut),function(n){n("large",function(n,t){return n.sort(ot)[t]});n("small",function(n,t){return n.sort(f)[t]})}(function(i,r){n(i,function(n,i){var u=[],f=n.each(function(n){if(n instanceof t)return n;typeof n=="number"&&u.push(n)});return f?f:i>u.length?new t("NUM"):r(u,i-1)}).args([["array","matrix"],["*nth","number++"]])});n("stdev.s",function(n){return at(n,n.length-1)}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length >= 2","NUM"]]]);n("stdev.p",function(n){return at(n,n.length)}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length >= 2","NUM"]]]);n("var.s",function(n){return w(n,n.length-1)}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length >= 2","NUM"]]]);n("var.p",function(n){return w(n,n.length)}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length >= 2","NUM"]]]);n("median",function(n){var t=n.length;return(n.sort(f),t%2)?n[t>>1]:(n[t>>1]+n[t>>2])/2}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length > 0","N/A"]]]);n("mode.sngl",function(n){var r,u;n.sort(f);var o=null,i=0,s=1,e=null;for(r=0;r<n.length;++r)u=n[r],u!=o?(i=1,o=u):i++,i>s&&(s=i,e=u);return e==null?new t("N/A"):e}).args([["numbers",["collect","number"]]]);n("mode.mult",function(n){var u=Object.create(null),t=2,i=[],r;return n.forEach(function(n){var r=u[n]||0;u[n]=++r;r==t?i.push(n):r>t&&(t=r,i=[n])}),r=new c(this),i.forEach(function(n,t){r.set(t,0,n)}),r}).args([["numbers",["collect","number"]]]);n("geomean",function(n){var i=n.length,r=n.reduce(function(n,i){if(i<0)throw new t("NUM");return n*i},1);return Math.pow(r,1/i)}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length > 0","NUM"]]]);n("harmean",function(n){var i=n.length,r=n.reduce(function(n,i){if(!i)throw new t("DIV/0");return n+1/i},0);return i/r}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length > 0","NUM"]]]);n("trimmean",function(n,t){var u=n.length,i,e,r;for(n.sort(f),i=Math.floor(u*t),i%2&&--i,i/=2,e=0,r=i;r<u-i;++r)e+=n[r];return e/(u-i*2)}).args([["numbers",["collect","number",1]],["percent",["and","number",["[between)",0,1]]],["?",["assert","$numbers.length > 0","NUM"]]]);n("frequency",function(n,t){function e(t){for(var r=0;i<n.length&&n[i]>u&&n[i]<=t;)++r,++i;return r}var u,i,r;return n.sort(f),t.sort(f),u=-Infinity,i=0,r=new c(this),t.forEach(function(n,t){var i=e(n);u=n;r.set(t,0,i)}),r.set(r.height,0,n.length-i),r}).args([["data",["collect","number",1]],["bins",["collect","number",1]]]);n("rank.eq",function(n,i,r){i.sort(r?f:ot);var u=i.indexOf(n);return u<0?new t("N/A"):u+1}).args([["value","number"],["numbers",["collect","number"]],["order",["or","logical",["null",!1]]]]);u("rank","rank.eq");n("rank.avg",function(n,i,r){var u,e;if(i.sort(r?f:ot),u=i.indexOf(n),u<0)return new t("N/A");for(e=u;i[e]==n;++e);return(u+e+1)/2}).args([["value","number"],["numbers",["collect","number"]],["order",["or","logical",["null",!1]]]]);n("kurt",function(n){var t=n.length,i=p(n),r=w(n,t-1,i),u=Math.sqrt(r),f=n.reduce(function(n,t){return n+Math.pow((t-i)/u,4)},0);return t*(t+1)/((t-1)*(t-2)*(t-3))*f-3*Math.pow(t-1,2)/((t-2)*(t-3))}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length >= 4","NUM"]]]);ft=[["array",["collect","number",1]],["x","number"],["significance",["or",["null",3],"integer++"]],["?",["assert","$array.length > 0","NUM"]]];n("percentrank.inc",function(n,t,i){var r=b(n,t,0);return r=r.toFixed(i+1),parseFloat(r.substr(0,r.length-1))}).args(ft);n("percentrank.exc",function(n,t,i){var r=b(n,t,1);return r=r.toFixed(i+1),parseFloat(r.substr(0,r.length-1))}).args(ft);u("percentrank","percentrank.inc");n("covariance.p",function(n,t){return vt(n,t,n.length)}).args([["array1",["collect","number",1]],["array2",["collect","number",1]],["?",["assert","$array1.length == $array2.length","N/A"]],["?",["assert","$array1.length > 0","DIV/0"]]]);n("covariance.s",function(n,t){return vt(n,t,n.length-1)}).args([["array1",["collect","number",1]],["array2",["collect","number",1]],["?",["assert","$array1.length == $array2.length","N/A"]],["?",["assert","$array1.length > 1","DIV/0"]]]);u("covar","covariance.p");k=v.memoize(function(n){for(var t=2,i=1;t<=n;++t)i*=t;return i});n("fact",k).args([["*n","integer+"]]);n("factdouble",function(n){for(var t=2+(n&1),i=1;t<=n;t+=2)i*=t;return i}).args([["*n","integer+"]]);n("multinomial",function(n){var i=1,r=0;return n.forEach(function(n){if(n<0)throw new t("NUM");r+=n;i*=k(n)}),k(r)/i}).args([["numbers",["collect","number"]]]);o=v.memoize(function(n,t){for(var r=t+1,i=1,u=1,f=1;i<=n-t;++r,++i)u*=r,f*=i;return u/f});n("combin",o).args([["*n","integer++"],["*k",["and","integer",["[between]",0,"$n"]]]]);n("combina",function(n,t){return o(n+t-1,n-1)}).args([["*n","integer++"],["*k",["and","integer",["[between]",1,"$n"]]]]);n("average",function(n){var t=n.reduce(function(n,t){return n+t},0);return t/n.length}).args([["numbers",["collect",["and","number",["not","boolean"]]]],["?",["assert","$numbers.length > 0","DIV/0"]]]);n("averagea",function(n){var r=0,i=0;return n.forEach(function(n){typeof n!="string"&&(r+=n);++i}),i?r/i:new t("DIV/0")}).args([["values",["collect","anyvalue"]]]);n("percentile.inc",pt).args([["numbers",["collect","number",1]],["p",["and","number",["[between]",0,1]]]]);n("percentile.exc",wt).args([["numbers",["collect","number",1]],["p",["and","number",["(between)",0,1]]]]);n("quartile.inc",function(n,t){return pt(n,t/4)}).args([["numbers",["collect","number",1]],["quarter",["values",0,1,2,3,4]]]);n("quartile.exc",function(n,t){return wt(n,t/4)}).args([["numbers",["collect","number",1]],["quarter",["values",0,1,2,3,4]]]);u("quartile","quartile.inc");u("percentile","percentile.inc");n("aggregate",function(n,i,r,u){function o(n){if(n instanceof y)f.getRefCells(n,!0).forEach(function(n){var i=n.value,u;if(!(r&l)||!n.hidden){if(n.formula){if(u=n.formula.print(n.row,n.col),/^\s*(?:aggregate|subtotal)\s*\(/i.test(u)&&!(r&a))return;"value"in n.formula&&(i=n.formula.value)}r&s&&i instanceof t||(typeof i=="number"||i instanceof t)&&e.push(i)}});else if(Array.isArray(n))for(var i=0;i<n.length;++i)o(n[i]);else n instanceof c?n.each(o):typeof n=="number"?e.push(n):n instanceof t&&!(r&s)&&e.push(n)}var f=this,l=1,s=2,a=4,v=["AVERAGE","COUNT","COUNTA","MAX","MIN","PRODUCT","STDEV.S","STDEV.P","SUM","VAR.S","VAR.P","MEDIAN","MODE.SNGL","LARGE","SMALL","PERCENTILE.INC","QUARTILE.INC","PERCENTILE.EXC","QUARTILE.EXC"][i-1],e=[];f.resolveCells(u,function(){if(i>12){o(u[0]);var r=u[1];if(r instanceof h&&(r=f.getRefData(r)),typeof r!="number")return n(new t("VALUE"))}else o(u);f.func(v,n,e)})}).argsAsync([["funcId",["values",1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]],["options",["or",["null",0],["values",0,1,2,3,4,5,6,7]]],["args","rest"]]);n("avedev",function(n){var t=n.reduce(function(n,t){return n+t},0)/n.length;return n.reduce(function(n,i){return n+Math.abs(i-t)},0)/n.length}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length >= 2","NUM"]]]);n("binom.dist",bt).args([["successes","integer+"],["trials",["and","integer",["assert","$trials >= $successes"]]],["probability",["and","number",["[between]",0,1]]],["cumulative","logical"]]);u("binomdist","binom.dist");n("binom.inv",function(n,i,r){for(var u=0;u<=n;++u)if(bt(u,n,i,!0)>=r)return u;return new t("N/A")}).args([["trials","integer+"],["probability",["and","number",["[between]",0,1]]],["alpha",["and","number",["[between]",0,1]]]]);u("critbinom","binom.inv");n("binom.dist.range",function(n,t,i,r){for(var f=0,u=i;u<=r;++u)f+=o(n,u)*Math.pow(t,u)*Math.pow(1-t,n-u);return f}).args([["trials","integer+"],["probability",["and","number",["[between]",0,1]]],["successes_min",["and","integer",["[between]",0,"$trials"]]],["successes_max",["or",["and","integer",["[between]","$successes_min","$trials"]],["null","$successes_min"]]]]);n("negbinom.dist",function(n,t,i,r){if(r){for(var u=0;n>=0;)u+=o(n+t-1,n)*Math.pow(i,t)*Math.pow(1-i,n),n--;return u}return o(n+t-1,n)*Math.pow(i,t)*Math.pow(1-i,n)}).args([["number_f","integer+"],["number_s","integer+"],["probability_s",["and","number",["[between]",0,1]]],["cumulative","logical"]]);u("negbinomdist","negbinom.dist");n("address",function(n,t,i,r,u){var f=new h(n-1,t-1,i-1);return u&&f.setSheet(u,!0),r?f.print(0,0):f.print()}).args([["row","integer++"],["col","integer++"],["abs",["or",["null",1],["values",1,2,3,4]]],["a1",["or",["null",!0],"logical"]],["sheet",["or","null","string"]]]);n("areas",function(n){var t=0;return function i(n){n instanceof h||n instanceof ht?t++:n instanceof gt&&n.refs.forEach(i)}(n),t}).args([["ref","ref"]]);n("choose",function(n,i){return n>i.length?new t("N/A"):i[n-1]}).args([["*index","integer"],["+",["value","anything"]]]);n("column",function(n){return n?n instanceof h?n.col+1:this.asMatrix(n).mapCol(function(t){return t+n.topLeft.col+1}):this.formula.col+1}).args([["ref",["or","area","null"]]]);n("columns",function(n){return n instanceof y?n.width():n.width}).args([["ref",["or","area","#matrix"]]]);n("formulatext",function(n){var i=this.getRefCells(n)[0];return i.formula?i.formula.print(i.row,i.col):new t("N/A")}).args([["ref","ref"]]);n("hlookup",function(n,i,r,u){var f=null;return(i.eachCol(function(t){var r=i.get(0,t);if(u){if(r>n)return!0;f=t}else if(r===n)return f=t,!0}),f==null)?new t("N/A"):i.get(r-1,f)}).args([["value","anyvalue"],["range","matrix"],["row","integer++"],["approx",["or","logical",["null",!0]]]]);n("index",function(n,i,r){if(i==null&&r==null)return new t("N/A");if(n.width>1&&n.height>1){if(i!=null&&r!=null)return n.get(i-1,r-1);if(i==null)return n.mapRow(function(t){return n.get(t,r-1)});if(r==null)return n.mapCol(function(t){return n.get(i-1,t)})}return n.width==1?n.get(i-1,0):n.height==1?n.get(0,r-1):new t("REF")}).args([["range","matrix"],["row",["or","integer++","null"]],["col",["or","integer++","null"]]]);n("indirect",function(n){try{var i=this.formula,r=st.parseFormula(i.sheet,i.row,i.col,n);if(!(r.ast instanceof y))throw 1;return r.ast.absolute(i.row,i.col)}catch(u){return new t("REF")}}).args([["thing","string"]]);n("match",function(n,i,r){var u=1,f;return r===0?f=s(n):r===-1?f=s("<="+n):r===1&&(f=s(">="+n)),i.each(function(t){if(t!=null&&f(t))return r!==0&&n!=t&&--u,!0;u++},!0)&&u>0?u:new t("N/A")}).args([["value","anyvalue"],["range","matrix"],["type",["or",["values",-1,0,1],["null",1]]]]);n("offset",function(n,i,r,u,f){var e=(n instanceof h?n:n.topLeft).clone();return(e.row+=i,e.col+=r,e.row<0||e.col<0)?new t("VALUE"):u>1||f>1?new ht(e,new h(e.row+u-1,e.col+f-1)).setSheet(n.sheet,n.hasSheet()):e}).args([["ref","area"],["*rows","integer"],["*cols","integer"],["*height",["or","integer++",["null","$ref.height()"]]],["*width",["or","integer++",["null","$ref.width()"]]]]);n("row",function(n){return n?n instanceof h?n.row+1:this.asMatrix(n).mapRow(function(t){return t+n.topLeft.row+1}):this.formula.row+1}).args([["ref",["or","area","null"]]]);n("rows",function(n){return n instanceof y?n.height():n.height}).args([["ref",["or","area","#matrix"]]]);n("vlookup",function(n,i,r,u){var f=null;return(i.eachRow(function(t){var r=i.get(t,0);if(u){if(r>n)return!0;f=t}else if(r===n)return f=t,!0}),f==null)?new t("N/A"):i.get(f,r-1)}).args([["value","anyvalue"],["range","matrix"],["col","integer++"],["approx",["or","logical",["null",!0]]]]);n("date",function(n,t,i){return a(n,t-1,i)}).args([["*year","integer"],["*month","integer"],["*date","integer"]]);n("day",function(n){return r(n).date}).args([["*date","date"]]);n("month",function(n){return r(n).month+1}).args([["*date","date"]]);n("year",function(n){return r(n).year}).args([["*date","date"]]);n("weekday",function(n){return r(n).day+1}).args([["*date","date"]]);n("weeknum",function(n,t){var u=a(r(n).year,0,1),f=r(u),i;return t==21?(i=3-(f.day+6)%7,i<0&&(i+=7),u+=i,f.date+=i,f.day=4,t=1):t=t==1?0:t==2?1:(t-10)%7,i=f.day-t,i<0&&(i+=7),u-=i,Math.ceil((n+1-u)/7)}).args([["*date","date"],["*type",["or",["null",1],["values",1,2,11,12,13,14,15,16,17,21]]]]);n("isoweeknum",function(n){var t=r(n),u=t.day||7,i=Math.floor((t.ord-u+10)/7);return i<1?kt(t.year-1):i==53&&i>kt(t.year)?1:i}).args([["*date","date"]]);n("now",function(){return i.dateToSerial(new Date)}).args([]);n("today",function(){return i.dateToSerial(new Date)|0}).args([]);n("time",function(n,t,r){return i.packTime(n,t,r,0)}).args([["*hours","integer"],["*minutes","integer"],["*seconds","integer"]]);n("hour",function(n){return i.unpackTime(n).hours}).args([["*time","datetime"]]);n("minute",function(n){return i.unpackTime(n).minutes}).args([["*time","datetime"]]);n("second",function(n){return i.unpackTime(n).seconds}).args([["*time","datetime"]]);n("edate",function(n,t){var u=r(n),i=u.month+t,f=u.year+Math.floor(i/12);return i%=12,i<0&&(i+=12),u=Math.min(u.date,l(f,i)),a(f,i,u)}).args([["*start_date","date"],["*months","integer"]]);n("eomonth",function(n,t){var u=r(n),i=u.month+t,f=u.year+Math.floor(i/12);return i%=12,i<0&&(i+=12),u=l(f,i),a(f,i,u)}).args([["*start_date","date"],["*months","integer"]]);n("workday",function(n,t,i){var f=t>0?1:-1,u;for(t=Math.abs(t),u=r(n).day;t>0;)n+=f,u=(u+f)%7,u>0&&u<6&&i.indexOf(n)<0&&--t;return n}).args([["start_date","date"],["days","integer"],["holidays",["collect","date"]]]);n("networkdays",function(n,t,i){var e,f,u;for(n>t&&(e=n,n=t,t=e),f=0,u=r(n).day;n<=t;)u>0&&u<6&&i.indexOf(n)<0&&f++,n++,u=(u+1)%7;return f}).args([["start_date","date"],["end_date","date"],["holidays",["collect","date"]]]);n("days",function(n,t){return t-n}).args([["*start_date","date"],["*end_date","date"]]);n("days360",et).args([["*start_date","date"],["*end_date","date"],["*method",["or","logical",["null","false"]]]]);n("yearfrac",function(n,t,i){switch(i){case 0:return et(n,t,!1)/360;case 1:return(t-n)/ni(r(n).year);case 2:return(t-n)/360;case 3:return(t-n)/365;case 4:return et(n,t,!0)/360}}).args([["*start_date","date"],["*end_date","date"],["*method",["or",["null",0],["values",0,1,2,3,4]]]]);n("datevalue",function(n){var r=i.parseDate(n);return r?i.dateToSerial(r):new t("VALUE")}).args([["*text","string"]]);n("timevalue",function(n){var r=n.toLowerCase().match(/(\d+):(\d+)(:(\d+)(\.(\d+))?)?\s*(am?|pm?)?/);if(r){var u=parseFloat(r[1]),e=parseFloat(r[2]),o=r[3]?parseFloat(r[4]):0,f=r[7];return f&&(u>12||u<1)?new t("VALUE"):(/^p/.test(f)&&(u+=12),i.packTime(u,e,o,0))}return new t("VALUE")}).args([["*text","string"]]);n("mdeterm",function(n){var i=n.each(function(n){if(typeof n!="number")return new t("VALUE")},!0);return i||n.determinant()}).args([["m",["and","matrix",["assert","$m.width == $m.height"]]]]);n("transpose",function(n){return n.transpose()}).args([["range","matrix"]]);n("mmult",function(n,t){return n.multiply(t)}).args([["a","matrix"],["b",["and","matrix",["assert","$b.height == $a.width"]]]]);n("munit",function(n){return new c(this).unit(n)}).args([["n","integer+"]]);n("minverse",function(n){var i=n.each(function(n){if(typeof n!="number")return new t("VALUE")},!0);return i||n.inverse()||new t("VALUE")}).args([["m",["and","matrix",["assert","$m.width == $m.height"]]]]);n("rand",function(){return Math.random()}).args([]);n("randbetween",function(n,t){return n+Math.floor((t-n+1)*Math.random())}).args([["min","integer"],["max",["and","integer",["assert","$max >= $min"]]]]);n("true",function(){return!0}).args([]);n("false",function(){return!0}).args([]);n("roman",function(n){return v.arabicToRoman(n).toUpperCase()}).args([["*number","integer"]]);n("arabic",function(n){var i=v.romanToArabic(n);return i==null?new t("VALUE"):i}).args([["*roman","string"]]);n("base",function(n,t,i){for(var r=n.toString(t).toUpperCase();r.length<i;)r="0"+r;return r}).args([["*number","integer"],["*radix",["and","integer",["[between]",2,36]]],["*minLen",["or","integer+",["null",0]]]]);n("decimal",function(n,i){var u,f,r;for(n=n.toUpperCase(),u=0,f=0;f<n.length;++f){if(r=n.charCodeAt(f),r>=48&&r<=57)r-=48;else if(r>=65&&r<55+i)r-=55;else return new t("VALUE");u=u*i+r}return u}).args([["*text","string"],["*radix",["and","integer",["[between]",2,36]]]]);n("char",function(n){return String.fromCharCode(n)}).args([["*code","integer+"]]);dt=/[\0-\x1F\x7F-\x9F\xAD\u0378\u0379\u037F-\u0383\u038B\u038D\u03A2\u0528-\u0530\u0557\u0558\u0560\u0588\u058B-\u058E\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08A1\u08AD-\u08E3\u08FF\u0978\u0980\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0C00\u0C04\u0C0D\u0C11\u0C29\u0C34\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5A-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C80\u0C81\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D01\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D4F-\u0D56\u0D58-\u0D5F\u0D64\u0D65\u0D76-\u0D78\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F5-\u13FF\u169D-\u169F\u16F1-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191D-\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C80-\u1CBF\u1CC8-\u1CCF\u1CF7-\u1CFF\u1DE7-\u1DFB\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20BB-\u20CF\u20F1-\u20FF\u218A-\u218F\u23F4-\u23FF\u2427-\u243F\u244B-\u245F\u2700\u2B4D-\u2B4F\u2B5A-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E3C-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FCD-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA698-\uA69E\uA6F8-\uA6FF\uA78F\uA794-\uA79F\uA7AB-\uA7F7\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C5-\uA8CD\uA8DA-\uA8DF\uA8FC-\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9E0-\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAA7C-\uAA7F\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F-\uABBF\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE27-\uFE2F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF]/g;n("clean",function(n){return n.replace(dt,"")}).args([["*text","string"]]);n("code",function(n){return n.charAt(0)}).args([["*text","string"]]);u("unichar","char");u("unicode","code");n("concatenate",function(){for(var t="",n=0;n<arguments.length;++n)t+=arguments[n];return t}).args([["+",["*text","string"]]]);n("dollar",function(n,t){for(var i="$#,##0.DECIMALS;($#,##0.DECIMALS)",r="";t-->0;)r+="0";return i=i.replace(/DECIMALS/g,r),e.formatting.format(n,i).text()}).args([["*number","number"],["*decimals",["or","integer++",["null",2]]]]);n("exact",function(n,t){return n===t}).args([["*text1","string"],["*text2","string"]]);n("find",function(n,i,r){var u=i.indexOf(n,r-1);return u<0?new t("VALUE"):u+1}).args([["*substring","string"],["*string","string"],["*start",["or","integer++",["null",1]]]]);n("fixed",function(n,t,i){for(var r=i?"0.DECIMALS":"#,##0.DECIMALS",u="";t-->0;)u+="0";return r=r.replace(/DECIMALS/g,u),e.formatting.format(n,r).text()}).args([["*number","number"],["*decimals",["or","integer++",["null",2]]],["*noCommas",["or","boolean",["null",!1]]]]);n("left",function(n,t){return n.substr(0,t)}).args([["*text","string"],["*length",["or","integer+",["null",1]]]]);n("right",function(n,t){return n.substr(-t)}).args([["*text","string"],["*length",["or","integer+",["null",1]]]]);n("len",function(n){return n.length}).args([["*text","string"]]);n("lower",function(n){return n.toLowerCase()}).args([["*text","string"]]);n("upper",function(n){return n.toUpperCase()}).args([["*text","string"]]);n("ltrim",function(n){return n.replace(/^\s+/,"")}).args([["*text","string"]]);n("rtrim",function(n){return n.replace(/\s+$/,"")}).args([["*text","string"]]);n("trim",function(n){return n.replace(/^\s+|\s+$/,"")}).args([["*text","string"]]);n("mid",function(n,t,i){return n.substr(t-1,i)}).args([["*text","string"],["*start","integer++"],["*length","integer+"]]);n("proper",function(n){return n.toLowerCase().replace(/\b./g,function(n){return n.toUpperCase()})}).args([["*text","string"]]);n("replace",function(n,t,i,r){return n.substr(0,--t)+r+n.substr(t+i)}).args([["*text","string"],["*start","integer++"],["*length","integer+"],["*newText","string"]]);n("rept",function(n,t){for(var i="";t-->0;)i+=n;return i}).args([["*text","string"],["*number","integer+"]]);n("search",function(n,i,r){var u=i.toLowerCase().indexOf(n.toLowerCase(),r-1);return u<0?new t("VALUE"):u+1}).args([["*substring","string"],["*string","string"],["*start",["or","integer++",["null",1]]]]);n("substitute",function(n,t,i,r){function f(){n=n.substring(0,u)+i+n.substring(u+t.length)}if(t===i)return n;for(var u=-1;(u=n.indexOf(t,u+1))>=0;)if(r==null)f();else if(--r==0){f();break}return n}).args([["*text","string"],["*oldText","string"],["*newText","string"],["*nth",["or","integer++","null"]]]);n("t",function(n){return typeof n=="string"?n:""}).args([["*value","anyvalue"]]);n("text",function(n,t){return e.formatting.format(n,t).text()}).args([["*value","anyvalue"],["*format","string"]]);n("value",function(n){return typeof n=="number"?n:typeof n=="boolean"?+n:(n=(n+"").replace(/[$€,]/g,""),n=parseFloat(n),isNaN(n)?new t("VALUE"):n)}).args([["*value","anyvalue"]]);s=function(){function t(n,t){if(typeof t=="string"){var i=parseFloat(t);isNaN(i)||(t=i)}return function(i){var r=t;return typeof i=="string"&&typeof r=="string"&&(i=i.toLowerCase(),r=r.toLowerCase()),n(i,r)}}function n(n){return typeof n=="string"?n.toLowerCase():n}function u(t,i){return n(t)<n(i)}function f(t,i){return n(t)<=n(i)}function e(t,i){return n(t)>n(i)}function o(t,i){return n(t)>=n(i)}function s(t,i){return n(t)!=n(i)}function i(t,i){return i instanceof RegExp?i.test(t):n(t)==n(i)}var r=Object.create(null);return function(n){var h,c;return typeof n=="function"?n:(h=/^=(.*)$/.exec(n))?t(i,h[1]):(h=/^<>(.*)$/.exec(n))?t(s,h[1]):(h=/^<=(.*)$/.exec(n))?t(f,h[1]):(h=/^<(.*)$/.exec(n))?t(u,h[1]):(h=/^>=(.*)$/.exec(n))?t(o,h[1]):(h=/^>(.*)$/.exec(n))?t(e,h[1]):/[?*]/.exec(n)?(c=r[n],c||(c=n.replace(/(~\?|~\*|[\]({\+\.\|\^\$\\})\[]|[?*])/g,function(n){switch(n){case"~?":return"\\?";case"~*":return"\\*";case"?":return".";case"*":return".*";default:return"\\"+n}}),c=r[n]=new RegExp("^"+c+"$","i")),t(i,c)):t(i,n)}}()}}(),function(){"use strict";function f(n){var r,u,f,i;if(t(n)>=3.3)return 1-ft(n);for(r=n>0?1:-1,r==-1&&(n=-n),u=0,f=1,i=1;i<100;i++)u+=f,f*=2*n*n/(2*i+1);return r*2/Math.sqrt(Math.PI)*n*Math.exp(-n*n)*u}function ft(n){var u,i,r;if(t(n)<3.3)return 1-f(n);for(u=1,n<0&&(u=-1,n=-n),i=n,r=8;r>=1;r-=.5)i=n+r/i;return i=1/(n+i),u==1?Math.exp(-n*n)/Math.sqrt(Math.PI)*i:2-Math.exp(-n*n)/Math.sqrt(Math.PI)*i}function u(n){var r=[1.0000000001900149,76.180091729471457,-86.505320329416776,24.014098240830911,-1.231739572450155,.001208650973866179,-5395239384953e-18],u=n,i=n+5.5,f=r[0],t;for(i-=(n+.5)*Math.log(i),t=1;t<=6;t++)u+=1,f+=r[t]/u;return-i+Math.log(Math.sqrt(2*Math.PI)*f/n)}function y(n){if(n>0)return Math.exp(u(n));var i=Math.PI,t=-n;return-i/(t*y(t)*Math.sin(i*t))}function p(n,t){return u(n)+u(t)-u(n+t)}function et(n,t){return Math.exp(p(n,t))}function ti(n,t){return t<n+1?ii(n,t):1-ri(n,t)}function ii(n,i){for(var r=1/n,f=r,s=n,h=u(n),e=1;e<=o;e++)if(s++,f*=i/s,r+=f,t(f)<t(r)*c)break;return r*Math.exp(-i+n*Math.log(i)-h)}function ri(n,r){for(var v,h=i,e=h,f=0,l=1,a=r+1-n,y=u(n),s=1;s<=o;s++){if(f=a+l*f,t(f)<i&&(f=i),e=a+l/e,t(e)<i&&(e=i),f=1/f,v=e*f,h*=v,t(v-1)<c)break;a+=2;l=-s*(s-n)}return h*Math.exp(-r-y+n*Math.log(r))}function w(n,t,i,r){return r?ti(t,n/i):Math.pow(n/i,t-1)*Math.exp(-n/i)/(i*y(t))}function ot(n,i,r){var e,s;if(n===0)return 0;if(n==1)return Infinity;var h=0,f=10,u=0,c=i*r;for(c>1&&(f*=c),e=0;e<o;e++){if(u=.5*(h+f),s=w(u,i,r,!0),t(n-s)<1e-16)break;s>n?f=u:h=u}return u}function l(n,t){return t?.5+.5*f(n/Math.sqrt(2)):Math.exp(-n*n/2)/Math.sqrt(2*Math.PI)}function b(n){var f=[-39.696830286653757,220.9460984245205,-275.92851044696869,138.357751867269,-30.66479806614716,2.5066282774592392],e=[-54.476098798224058,161.58583685804089,-155.69897985988661,66.80131188771972,-13.280681552885721],i=[-.0077848940024302926,-.32239645804113648,-2.4007582771618381,-2.5497325393437338,4.3746641414649678,2.9381639826987831],u=[.0077846957090414622,.32246712907003983,2.445134137142996,3.7544086619074162],o=.02425,s=1-o,t,r;return n<o?(t=Math.sqrt(-2*Math.log(n)),(((((i[0]*t+i[1])*t+i[2])*t+i[3])*t+i[4])*t+i[5])/((((u[0]*t+u[1])*t+u[2])*t+u[3])*t+1)):s<n?(t=Math.sqrt(-2*Math.log(1-n)),-(((((i[0]*t+i[1])*t+i[2])*t+i[3])*t+i[4])*t+i[5])/((((u[0]*t+u[1])*t+u[2])*t+u[3])*t+1)):(t=n-.5,r=t*t,(((((f[0]*r+f[1])*r+f[2])*r+f[3])*r+f[4])*r+f[5])*t/(((((e[0]*r+e[1])*r+e[2])*r+e[3])*r+e[4])*r+1))}function ui(n,t,i,r){return r?l((n-t)/i,!0):Math.exp(-(n-t)*(n-t)/(2*i*i))/(i*Math.sqrt(2*Math.PI))}function st(n,t,i){return t+i*b(n)}function fi(n,t,i){return Math.exp((t-1)*Math.log(n)+(i-1)*Math.log(1-n)-p(t,i))}function s(n,t,i){var r=Math.exp(t*Math.log(n)+i*Math.log(1-n)-p(t,i));return n<(t+1)/(t+i+2)?r*ht(t,i,n)/t:1-r*ht(i,t,1-n)/i}function ht(n,r,u){var s,l,h,e,f,v,a,y,w,p;for(y=n+r,p=n+1,w=n-1,e=1,f=1-y*u/p,t(f)<i&&(f=i),f=1/f,a=f,s=1;s<=o;s++)if(l=2*s,h=s*(r-s)*u/((w+l)*(n+l)),f=1+h*f,t(f)<i&&(f=i),e=1+h/e,t(e)<i&&(e=i),f=1/f,a*=f*e,h=-(n+s)*(y+s)*u/((n+l)*(p+l)),f=1+h*f,t(f)<i&&(f=i),e=1+h/e,t(e)<i&&(e=i),f=1/f,v=f*e,a*=v,t(v-1)<c)break;return a}function ct(n,i,r){for(var f,e=0,h=1,u=0,l=0;l<o;l++){if(u=.5*(e+h),f=s(u,i,r),t(n-f)<c)break;f>n?h=u:e=u}return u}function ei(n,t,i,r,u){return s((n-r)/(u-r),t,i)}function oi(n,t,i,r,u,f){return r?s((n-u)/(f-u),t,i):fi((n-u)/(f-u),t,i)/(f-u)}function k(n,t,i,r,u){return r+(u-r)*ct(n,t,i)}function d(n,t,i){return w(n,t/2,2,i)}function lt(n,t){return 1-d(n,t,!0)}function at(n,t){return ot(n,t/2,2)}function si(n,t){return at(1-n,t)}function hi(n,t){for(var e=n.length,o=n[0].length,s=0,r,f,u,h,i=0;i<e;i++)for(r=0;r<o;r++)f=t[i][r],u=n[i][r]-f,u*=u,s+=u/f;return h=(e-1)*(o-1),lt(s,h)}function ci(n,t,i){return i?1-Math.exp(-t*n):t*Math.exp(-t*n)}function li(n,t,i){var u,r;if(i)return 1-d(2*t,2*(n+1),!0);for(u=0,r=2;r<=n;r++)u+=Math.log(r);return Math.exp(n*Math.log(t)-t-u)}function g(n,t,i,r){if(r)return s(t*n/(i+t*n),t/2,i/2);var u=t/i;return t/=2,i/=2,u/et(t,i)*Math.pow(u*n,t-1)/Math.pow(1+u*n,t+i)}function ai(n,t,i){return 1-g(n,t,i,!0)}function vi(n,t,i){return i/t*(1/k(n,i/2,t/2,0,1)-1)}function yi(n,t,i){return i/t*(1/k(1-n,i/2,t/2,0,1)-1)}function r(n){for(var i=0,r=n.length,t=0;t<r;t++)i+=n[t];return i/r}function a(n,t){for(var r,u=0,f=n.length,i=0;i<f;i++)r=n[i]-t,u+=r*r;return u/(f-1)}function pi(n,t){var f=n.length-1,o=t.length-1,i=a(n,r(n)),u=a(t,r(t));if(!i||!u)throw new e("DIV/0");return 2*g(i/u,f,o,!0)}function wi(n){return.5*Math.log((1+n)/(1-n))}function bi(n){var t=Math.exp(2*n);return(t-1)/(t+1)}function vt(n,t,i){return i?1-.5*s(t/(n*n+t),t/2,.5):1/(Math.sqrt(t)*et(.5,t/2))*Math.pow(1+n*n/t,-(t+1)/2)}function h(n,t){return 1-vt(n,t,!0)}function v(n,t){return n<0&&(n=-n),2*h(n,t)}function nt(n,t){var i=ct(2*Math.min(n,1-n),t/2,.5);return i=Math.sqrt(t*(1-i)/i),n>.5?i:-i}function ki(n,t){return nt(1-n/2,t)}function di(n,i,u,f){var e=n.length,c=i.length,o,s,y,w,l,p,b;if(f==1){for(y=0,w=0,l=0;l<e;l++)p=n[l]-i[l],y+=p,w+=p*p;return b=y/e,o=b/Math.sqrt((w-y*b)/(e*(e-1))),u==1?h(o,e-1):v(o,e-1)}var k=r(n),d=r(i),nt=a(n,k),tt=a(i,d);if(f==3){var it=nt/e,rt=tt/c,g=it+rt,ut=it/g,ft=rt/g;return s=1/(ut*ut/(e-1)+ft*ft/(c-1)),o=t(k-d)/Math.sqrt(g),u==1?h(o,s):v(o,s)}return s=e+c-2,o=t(k-d)*Math.sqrt(s*e*c/((e+c)*((e-1)*nt+(c-1)*tt))),u==1?h(o,s):v(o,s)}function gi(n,t,i){return-nt(n/2,i-1)*t/Math.sqrt(i)}function nr(n,t,i){return-b(n/2)*t/Math.sqrt(i)}function tr(n){return l(n,!0)-.5}function ir(n){return l(n)}function rr(n,t,i,r){if(r)return.5+.5*f((Math.log(n)-t)/(i*Math.sqrt(2)));var u=Math.log(n)-t;return Math.exp(-u*u/(2*i*i))/(n*i*Math.sqrt(2*Math.PI))}function ur(n,t,i){return Math.exp(st(n,t,i))}function fr(n,t,i,r){for(var s=n.length,h=0,f,o,u=0;u<s;u++){if(t[u]<=0||t[u]>1)throw new e("NUM");h+=t[u]}if(h!=1)throw new e("NUM");for(f=0,u=0;u<s;u++)o=n[u],o>=i&&o<=r&&(f+=t[u]);return f}function er(n,t){for(var u,o=r(t),s=r(n),f=0,e=0,i=0,h=n.length;i<h;i++)u=t[i]-o,f+=u*(n[i]-s),e+=u*u;return f/e}function or(n,t){for(var u,f=r(t),e=r(n),o=0,s=0,i=0,h=n.length;i<h;i++)u=t[i]-f,o+=u*(n[i]-e),s+=u*u;return e-o*f/s}function yt(n,t){for(var u,f,h=r(n),c=r(t),e=0,o=0,s=0,i=0,l=n.length;i<l;i++)u=n[i]-h,f=t[i]-c,e+=u*f,o+=u*u,s+=f*f;return e/Math.sqrt(o*s)}function sr(n,t){var i=yt(n,t);return i*i}function hr(n,t){for(var u,f,o=t.length,c=r(t),l=r(n),s=0,e=0,h=0,i=0;i<o;i++)u=t[i]-c,f=n[i]-l,s+=f*f,e+=u*f,h+=u*u;return Math.sqrt((s-e*e/h)/(o-2))}function cr(n,t,i){for(var f,a,s,v,h=r(i),c=r(t),l=0,o=0,u=0,y=i.length;u<y;u++)f=i[u]-h,a=t[u]-c,l+=f*a,o+=f*f;if(o===0)throw new e("N/A");return s=l/o,v=c-s*h,v+s*n}function pt(n){for(var i=n.height,r=0,t=0;t<i;t++)r+=n.data[t][0];return r/i}function wt(n,t){for(var r,f=n.height,u=0,i=0;i<f;i++)r=n.data[i][0]-t,u+=r*r;return u}function bt(n,t,i,r){var u=0,d,v,y,p;t||(t=n.map(function(){return++u}));i&&(t=t.clone(),t.eachRow(function(n){t.data[n].unshift(1)}),++t.width);var h=t.transpose(),c=h.multiply(t).inverse().multiply(h).multiply(n),o=[];for(u=c.height-1;u>=0;u--)o.push(c.data[u][0]);if(i||o.push(0),!r)return this.asMatrix([o]);var l=t.multiply(c),w=n.adds(l,!0),g=i?pt(l):0,s=wt(l,g),nt=i?pt(w):0,f=wt(w,nt),b=[];b.push(s,f);var a=s/(s+f),e=n.height-t.width,tt=Math.sqrt(f/e),k=[];for(k.push(a,tt),d=i?s/(t.width-1)/(f/e):a/t.width/((1-a)/e),v=[],v.push(d,e),y=h.multiply(t).inverse(),p=[],u=y.height-1;u>=0;u--)p.push(Math.sqrt(y.data[u][u]*f/e));return this.asMatrix([o,p,k,v,b])}function lr(n,t,i,r){return bt.call(this,n.map(Math.log),t,i,r).map(Math.exp)}function kt(n,t,i,r){var e=0,u,f;return t||(t=n.map(function(){return++e})),r&&(t=t.clone(),t.eachRow(function(n){t.data[n].unshift(1)}),++t.width),u=t.transpose(),f=u.multiply(t).inverse().multiply(u).multiply(n),i?r&&(i=i.clone(),i.eachRow(function(n){i.data[n].unshift(1)}),++i.width):i=t,i.multiply(f)}function ar(n,t,i,r){return kt.call(this,n.map(Math.log),t,i,r).map(Math.exp)}function tt(n,t,i,r){for(var h=i||20,c=r||1e-7,u=t,f=1;f<=h;f++){var o=n(u),l=o[0],a=o[1],s=l/a;if(u-=s,Math.abs(s)<c)return u}return new e("NUM")}function dt(n,t,i,r,u){var f=Math.pow(1+n,t),e=n?(f-1)/n:t;return-(r*f+i*e*(1+n*u))}function vr(n,t,i,r,u){if(!n)return-r-i*t;var f=Math.pow(1+n,t);return-(r+i*(f-1)/n*(1+n*u))/f}function it(n,t,i,r,u){if(!n)return-(r+i)/t;var f=Math.pow(1+n,t);return-n*(r+i*f)/((1+n*u)*(f-1))}function yr(n,t,i,r,u){if(!n)return-(r+i)/t;var f=t*(1+n*u);return Math.log((f-r*n)/(f+i*n))/Math.log(1+n)}function pr(n,t,i,r,u,f){function e(f){var e=Math.pow(1+f,n-1),o=e*(1+f);return[i*o+t*(1/f+u)*(o-1)+r,n*i*e+t*(-(o-1)/(f*f)+(1/f+u)*n*e)]}return tt(e,f)}function rt(n,t,i,r,u,f){if(f==1&&t==1)return 0;var o=it(n,i,r,u,f),e=dt(n,t-1,o,r,f)*n;return f?e/(1+n):e}function wr(n,t,i,r,u,f){var e=it(n,i,r,u,f);return e-rt(n,t,i,r,u,f)}function br(n,t,i,r,u,f){f==1&&(r--,u--);var e=Math.pow(1+n,t),o=Math.pow(1+n,r-1),s=Math.pow(1+n,u),h=n*i*e/(e-1),c=o*i-(o-1)/n*h,l=s*i-(s-1)/n*h;return l-c}function kr(n,t,i,r,u,f){for(var o=0,e=r;e<=u;e++)o+=rt(n,e,t,i,0,f);return o}function dr(n,t){for(var r=0,i=0,u=t.length;i<u;i++)r+=t[i]*Math.pow(1+n,-i-1);return r}function gr(n,t){function i(t){for(var r=0,u=0,i=0,f=n.length;i<f;i++)r+=n[i]*Math.pow(1+t,-i-1),u+=-i*n[i]*Math.pow(1+t,-i-2);return[r,u]}return tt(i,t)}function nu(n,t){return Math.pow(1+n/t,t)-1}function tu(n,t){return t*(Math.pow(n+1,1/t)-1)}function iu(n,t,i){for(var u=0,r=0,f=t.length;r<f;r++)u+=t[r]*Math.pow(1+n,(i[0]-i[r])/365);return u}function ru(n,t,i){function r(i){for(var u,f=n[0],e=0,r=1,o=n.length;r<o;r++)u=(t[0]-t[r])/365,f+=n[r]*Math.pow(1+i,u),e+=u*n[r]*Math.pow(1+i,u-1);return[f,e]}return tt(r,i)}function uu(n,t,i,r){var u=-r*n;return u*(1-t/i)}function fu(n,t,i,r,u){var f=1-Math.pow(t/n,1/i),e,o;if(f=Math.floor(f*1e3+.5)/1e3,e=n*f*u/12,r==1)return e;for(o=1;o<i;o++){if(o==r-1)return(n-e)*f;e+=(n-e)*f}return(n-e)*f*(12-u)/12}function eu(n,t,i,r,u){var f=u/i,e=-n*(Math.pow(1-f,r-1)-1),o=(n-e)*f;return Math.min(o,Math.max(0,n-e-t))}function ou(n,t,i){return(n-t)/i}function su(n,t,i,r){return(n-t)*(i-r+1)*2/(i*(i+1))}function hu(n,t,i,r,u,f,e){function y(n,i){var r,u,f;return u=h==1?i==1?n:0:n*Math.pow(1-h,i-1),f=n*Math.pow(1-h,i),r=f<t?u-t:u-f,r<0?0:r}function p(n,i,r){for(var o,h=n-t,s=Math.ceil(r),u,e=0,c=0,l=!1,f=1;f<=s;f++)l?u=e:(o=y(n,f),e=h/(i-f+1),e>o?(u=e,l=!0):(u=o,h-=o)),f==s&&(u*=r+1-s),c+=u;return c}var h=f>=i?1:f/i,c=Math.floor(r),l=Math.ceil(u),a=0,o,s,v,w;if(e)for(o=c+1;o<=l;o++)s=y(n,o),o==c+1?s*=Math.min(u,c+1)-r:o==l&&(s*=u+1-l),a+=s;else v=i,r!=Math.floor(r)&&f>1&&r>=i/2&&(w=r-i/2,r=i/2,u-=w,v+=1),n-=p(n,v,r),a=p(n,i-r,u-r);return a}if(!kendo.support.browser.msie||!(kendo.support.browser.version<9)){var gt=kendo.spreadsheet,ni=gt.calc,ut=ni.runtime,n=ut.defineFunction,e=ut.CalcError;n("ERF",function(n,t){return t==null?f(n):f(t)-f(n)}).args([["lower_limit","number"],["upper_limit",["or","number","null"]]]);n("ERFC",ft).args([["x","number"]]);n("GAMMALN",u).args([["x","number++"]]);n("GAMMA",y).args([["x","number"]]);n("GAMMA.DIST",w).args([["x","number+"],["alpha","number++"],["beta","number++"],["cumulative","logical"]]);n("GAMMA.INV",ot).args([["p",["and","number",["[between]",0,1]]],["alpha","number++"],["beta","number++"]]);n("NORM.S.DIST",l).args([["z","number"],["cumulative","logical"]]);n("NORM.S.INV",b).args([["p",["and","number",["[between]",0,1]]]]);n("NORM.DIST",ui).args([["x","number"],["mean","number"],["stddev","number++"],["cumulative","logical"]]);n("NORM.INV",st).args([["p",["and","number",["[between]",0,1]]],["mean","number"],["stddev","number++"]]);n("BETADIST",ei).args([["x","number"],["alpha","number++"],["beta","number++"],["A",["or","number",["null",0]]],["B",["or","number",["null",1]]],["?",["assert","$x >= $A","NUM"]],["?",["assert","$x <= $B","NUM"]],["?",["assert","$A < $B","NUM"]]]);n("BETA.DIST",oi).args([["x","number"],["alpha","number++"],["beta","number++"],["cumulative","logical"],["A",["or","number",["null",0]]],["B",["or","number",["null",1]]],["?",["assert","$x >= $A","NUM"]],["?",["assert","$x <= $B","NUM"]],["?",["assert","$A < $B","NUM"]]]);n("BETA.INV",k).args([["p",["and","number",["[between]",0,1]]],["alpha","number++"],["beta","number++"],["A",["or","number",["null",0]]],["B",["or","number",["null",1]]]]);n("CHISQ.DIST",d).args([["x","number+"],["deg_freedom","integer++"],["cumulative","logical"]]);n("CHISQ.DIST.RT",lt).args([["x","number+"],["deg_freedom","integer++"]]);n("CHISQ.INV",at).args([["p",["and","number",["[between]",0,1]]],["deg_freedom","integer++"]]);n("CHISQ.INV.RT",si).args([["p",["and","number",["[between]",0,1]]],["deg_freedom","integer++"]]);n("CHISQ.TEST",function(n,t){return hi(n.data,t.data)}).args([["actual_range","matrix"],["expected_range","matrix"],["?",["assert","$actual_range.width == $expected_range.width"]],["?",["assert","$actual_range.height == $expected_range.height"]]]);n("EXPON.DIST",ci).args([["x","number+"],["lambda","number++"],["cumulative","logical"]]);n("POISSON.DIST",li).args([["x","integer+"],["mean","number+"],["cumulative","logical"]]);n("F.DIST",g).args([["x","number+"],["deg_freedom1","integer++"],["deg_freedom2","integer++"],["cumulative","logical"]]);n("F.DIST.RT",ai).args([["x","number+"],["deg_freedom1","integer++"],["deg_freedom2","integer++"]]);n("F.INV",yi).args([["p",["and","number",["[between]",0,1]]],["deg_freedom1","integer++"],["deg_freedom2","integer++"]]);n("F.INV.RT",vi).args([["p",["and","number",["[between]",0,1]]],["deg_freedom1","integer++"],["deg_freedom2","integer++"]]);n("F.TEST",pi).args([["array1",["collect","number",1]],["array2",["collect","number",1]],["?",["assert","$array1.length >= 2","DIV/0"]],["?",["assert","$array2.length >= 2","DIV/0"]]]);n("FISHER",wi).args([["x",["and","number",["(between)",-1,1]]]]);n("FISHERINV",bi).args([["y","number"]]);n("T.DIST",vt).args([["x","number"],["deg_freedom","integer++"],["cumulative","logical"]]);n("T.DIST.RT",h).args([["x","number"],["deg_freedom","integer++"]]);n("T.DIST.2T",v).args([["x","number+"],["deg_freedom","integer++"]]);n("T.INV",nt).args([["p",["and","number",["(between]",0,1]]],["deg_freedom","integer++"]]);n("T.INV.2T",ki).args([["p",["and","number",["(between]",0,1]]],["deg_freedom","integer++"]]);n("T.TEST",di).args([["array1",["collect","number",1]],["array2",["collect","number",1]],["tails",["and","integer",["values",1,2]]],["type",["and","integer",["values",1,2,3]]],["?",["assert","$type != 1 || $array1.length == $array2.length","N/A"]],["?",["assert","$array1.length >= 2","DIV/0"]],["?",["assert","$array2.length >= 2","DIV/0"]]]);n("CONFIDENCE.T",gi).args([["alpha",["and","number",["(between)",0,1]]],["standard_dev","number++"],["size",["and","integer++",["assert","$size != 1","DIV/0"]]]]);n("CONFIDENCE.NORM",nr).args([["alpha",["and","number",["(between)",0,1]]],["standard_dev","number++"],["size",["and","integer++"]]]);n("GAUSS",tr).args([["z","number"]]);n("PHI",ir).args([["x","number"]]);n("LOGNORM.DIST",rr).args([["x","number++"],["mean","number"],["standard_dev","number++"],["cumulative","logical"]]);n("LOGNORM.INV",ur).args([["probability",["and","number",["(between)",0,1]]],["mean","number"],["standard_dev","number++"]]);n("PROB",fr).args([["x_range",["collect","number",1]],["prob_range",["collect","number",1]],["lower_limit","number"],["upper_limit",["or","number",["null","$lower_limit"]]],["?",["assert","$prob_range.length == $x_range.length","N/A"]]]);n("SLOPE",er).args([["known_y",["collect","number",1]],["known_x",["collect","number",1]],["?",["assert","$known_x.length == $known_y.length","N/A"]],["?",["assert","$known_x.length > 0 && $known_y.length > 0","N/A"]]]);n("INTERCEPT",or).args([["known_y",["collect","number",1]],["known_x",["collect","number",1]],["?",["assert","$known_x.length == $known_y.length","N/A"]],["?",["assert","$known_x.length > 0 && $known_y.length > 0","N/A"]]]);n("PEARSON",yt).args([["array1",["collect","number",1]],["array2",["collect","number",1]],["?",["assert","$array2.length == $array1.length","N/A"]],["?",["assert","$array2.length > 0 && $array1.length > 0","N/A"]]]);n("RSQ",sr).args([["known_y",["collect","number",1]],["known_x",["collect","number",1]],["?",["assert","$known_x.length == $known_y.length","N/A"]],["?",["assert","$known_x.length > 0 && $known_y.length > 0","N/A"]],["?",["assert","$known_x.length != 1 && $known_y.length != 1","N/A"]]]);n("STEYX",hr).args([["known_y",["collect","number",1]],["known_x",["collect","number",1]],["?",["assert","$known_x.length == $known_y.length","N/A"]],["?",["assert","$known_x.length >= 3 && $known_y.length >= 3","DIV/0"]]]);n("FORECAST",cr).args([["x","number"],["known_y",["collect","number",1]],["known_x",["collect","number",1]],["?",["assert","$known_x.length == $known_y.length","N/A"]],["?",["assert","$known_x.length > 0 && $known_y.length > 0","N/A"]]]);n("LINEST",bt).args([["known_y","matrix"],["known_x",["or","matrix","null"]],["const",["or","logical",["null",!0]]],["stats",["or","logical",["null",!1]]]]);n("LOGEST",lr).args([["known_y","matrix"],["known_x",["or","matrix","null"]],["const",["or","logical",["null",!0]]],["stats",["or","logical",["null",!1]]]]);n("TREND",kt).args([["known_y","matrix"],["known_x",["or","matrix","null"]],["new_x",["or","matrix","null"]],["const",["or","logical",["null",!0]]]]);n("GROWTH",ar).args([["known_y","matrix"],["known_x",["or","matrix","null"]],["new_x",["or","matrix","null"]],["const",["or","logical",["null",!0]]]]);n("FV",dt).args([["rate","number"],["nper","number"],["pmt",["or","number",["null",0]]],["pv",["or","number",["null",0]]],["type",["or",["values",0,1],["null",0]]],["?",["assert","$pmt || $pv"]]]);n("PV",vr).args([["rate","number"],["nper","number"],["pmt",["or","number",["null",0]]],["fv",["or","number",["null",0]]],["type",["or",["values",0,1],["null",0]]],["?",["assert","$pmt || $fv"]]]);n("PMT",it).args([["rate","number"],["nper","number"],["pmt","number"],["fv",["or","number",["null",0]]],["type",["or",["values",0,1],["null",0]]]]);n("NPER",yr).args([["rate","number"],["pmt","number"],["pv","number"],["fv",["or","number",["null",0]]],["type",["or",["values",0,1],["null",0]]]]);n("RATE",pr).args([["nper","number"],["pmt",["or","number",["null",0]]],["pv","number"],["fv",["or","number",["null",0]]],["type",["or",["values",0,1],["null",0]]],["guess",["or","number++",["null",.01]]],["?",["assert","$pmt || $fv"]]]);n("IPMT",rt).args([["rate","number"],["per","number++"],["nper","number++"],["pv","number"],["fv",["or","number",["null",0]]],["type",["or",["values",0,1],["null",0]]],["?",["assert","$per >= 1 && $per <= $nper"]]]);n("PPMT",wr).args([["rate","number"],["per","number++"],["nper","number++"],["pv","number"],["fv",["or","number",["null",0]]],["type",["or",["values",0,1],["null",0]]],["?",["assert","$per >= 1 && $per <= $nper"]]]);n("CUMPRINC",br).args([["rate","number++"],["nper","number++"],["pv","number++"],["start_period","number++"],["end_period","number++"],["type",["or",["values",0,1],["null",0]]],["?",["assert","$end_period >= $start_period","NUM"]]]);n("CUMIPMT",kr).args([["rate","number++"],["nper","number++"],["pv","number++"],["start_period","number++"],["end_period","number++"],["type",["or",["values",0,1],["null",0]]],["?",["assert","$end_period >= $start_period","NUM"]]]);n("NPV",dr).args([["rate","number"],["values",["collect","number"]],["?",["assert","$values.length > 0","N/A"]]]);n("IRR",gr).args([["values",["collect","number",1]],["guess",["or","number",["null",.1]]]]);n("EFFECT",nu).args([["nominal_rate","number++"],["npery","integer++"]]);n("NOMINAL",tu).args([["effect_rate","number++"],["npery","integer++"]]);n("XNPV",iu).args([["rate","number"],["values",["collect","number",1]],["dates",["collect","date",1]],["?",["assert","$values.length == $dates.length","NUM"]]]);n("XIRR",ru).args([["values",["collect","number",1]],["dates",["collect","date",1]],["guess",["or","number",["null",.1]]],["?",["assert","$values.length == $dates.length","NUM"]]]);n("ISPMT",uu).args([["rate","number"],["per","number++"],["nper","number++"],["pv","number"],["?",["assert","$per >= 1 && $per <= $nper"]]]);n("DB",fu).args([["cost","number"],["salvage","number"],["life","number++"],["period","number++"],["month",["or","number",["null",12]]]]);n("DDB",eu).args([["cost","number"],["salvage","number"],["life","number++"],["period","number++"],["factor",["or","number",["null",2]]]]);n("SLN",ou).args([["cost","number"],["salvage","number"],["life","number++"]]);n("SYD",su).args([["cost","number"],["salvage","number"],["life","number++"],["per","number++"]]);n("VDB",hu).args([["cost","number+"],["salvage","number+"],["life","number++"],["start_period","number+"],["end_period","number+"],["factor",["or","number+",["null",2]]],["no_switch",["or","logical",["null",!1]]],["?",["assert","$end_period >= $start_period","NUM"]]]);var o=300,c=22204e-20,i=1e-30,t=Math.abs}}(),function(){(function(n){if(!n.support.browser.msie||!(n.support.browser.version<9)){var t=n.jQuery,i=["allBorders","insideBorders","insideHorizontalBorders","insideVerticalBorders","outsideBorders","leftBorder","topBorder","rightBorder","bottomBorder","noBorders"],r=n.spreadsheet.messages.borderPalette={allBorders:"All borders",insideBorders:"Inside borders",insideHorizontalBorders:"Inside horizontal borders",insideVerticalBorders:"Inside vertical borders",outsideBorders:"Outside borders",leftBorder:"Left border",topBorder:"Top border",rightBorder:"Right border",bottomBorder:"Bottom border",noBorders:"No border"},u=n.ui.Widget.extend({init:function(t,i){n.ui.Widget.call(this,t,i);this.element=t;this.color="#000";this.element.addClass("k-spreadsheet-border-palette");this._borderTypePalette();this._borderColorPalette();this.element.on("click",".k-spreadsheet-border-type-palette .k-button",this._click.bind(this))},options:{name:"BorderPalette"},events:["change"],_borderTypePalette:function(){var u=r,f=i.map(function(t){return'<a title="'+u[t]+'" href="#" data-border-type="'+t+'" class="k-button k-button-icon"><span class="k-sprite k-font-icon k-icon k-i-'+n.toHyphens(t)+'"><\/span><\/a>'}).join(""),e=t("<div />",{"class":"k-spreadsheet-border-type-palette",html:f});e.appendTo(this.element)},_borderColorPalette:function(){var n=t("<div />",{"class":"k-spreadsheet-border-style-palette"}),i=this.colorPalette=t("<div />").kendoColorPalette({palette:["#ffffff","#000000","#d6ecff","#4e5b6f","#7fd13b","#ea157a","#feb80a","#00addc","#738ac8","#1ab39f","#f2f2f2","#7f7f7f","#a7d6ff","#d9dde4","#e5f5d7","#fad0e4","#fef0cd","#c5f2ff","#e2e7f4","#c9f7f1","#d8d8d8","#595959","#60b5ff","#b3bcca","#cbecb0","#f6a1c9","#fee29c","#8be6ff","#c7d0e9","#94efe3","#bfbfbf","#3f3f3f","#007dea","#8d9baf","#b2e389","#f272af","#fed46b","#51d9ff","#aab8de","#5fe7d5","#a5a5a5","#262626","#003e75","#3a4453","#5ea226","#af0f5b","#c58c00","#0081a5","#425ea9","#138677","#7f7f7f","#0c0c0c","#00192e","#272d37","#3f6c19","#750a3d","#835d00","#00566e","#2c3f71","#0c594f"],value:this.color,change:this._colorChange.bind(this)}).data("kendoColorPalette");n.append(i.wrapper).appendTo(this.element)},_colorChange:function(n){this.color=n.value;this.type&&this.trigger("change",{type:this.type,color:this.color})},_click:function(n){this.type=t(n.currentTarget).data("borderType");this.trigger("change",{type:this.type,color:this.color})},destroy:function(){this.colorPalette.destroy();this.element.off("click")}});n.spreadsheet.BorderPalette=u}})(window.kendo)}(),function(){(function(n){var v,y,p,w,b,k,d,g,nt,tt,it,rt,ut,ft;if(!n.support.browser.msie||!(n.support.browser.version<9)){var i=n.jQuery,s=n.ui.ToolBar,t=n.spreadsheet.messages.toolbar={addColumnLeft:"Add column left",addColumnRight:"Add column right",addRowAbove:"Add row above",addRowBelow:"Add row below",alignment:"Alignment",alignmentButtons:{justtifyLeft:"Align left",justifyCenter:"Center",justifyRight:"Align right",justifyFull:"Justify",alignTop:"Align top",alignMiddle:"Align middle",alignBottom:"Align bottom"},backgroundColor:"Background",bold:"Bold",borders:"Borders",copy:"Copy",cut:"Cut",deleteColumn:"Delete column",deleteRow:"Delete row",excelExport:"Export to Excel...",filter:"Filter",fontFamily:"Font",fontSize:"Font size",format:"Custom format...",formatTypes:{automatic:"Automatic",number:"Number",percent:"Percent",financial:"Financial",currency:"Currency",date:"Date",time:"Time",dateTime:"Date time",duration:"Duration",moreFormats:"More formats..."},formatDecreaseDecimal:"Decrease decimal",formatIncreaseDecimal:"Increase decimal",freeze:"Freeze panes",freezeButtons:{freezePanes:"Freeze panes",freezeRows:"Freeze rows",freezeColumns:"Freeze columns",unfreeze:"Unfreeze panes"},italic:"Italic",merge:"Merge cells",mergeButtons:{mergeCells:"Merge all",mergeHorizontally:"Merge horizontally",mergeVertically:"Merge vertically",unmerge:"Unmerge"},paste:"Paste",quickAccess:{redo:"Redo",undo:"Undo"},sortAsc:"Sort ascending",sortDesc:"Sort descending",sortButtons:{sortSheetAsc:"Sort sheet A to Z",sortSheetDesc:"Sort sheet Z to A",sortRangeAsc:"Sort range A to Z",sortRangeDesc:"Sort range Z to A"},textColor:"Text Color",textWrap:"Wrap text",underline:"Underline",validation:"Data validation..."},h={excelExport:{type:"dialog",dialogName:"excelExport",overflow:"never",text:"",iconClass:"xlsa"},bold:{type:"button",command:"PropertyChangeCommand",property:"bold",value:!0,iconClass:"bold",togglable:!0},italic:{type:"button",command:"PropertyChangeCommand",property:"italic",value:!0,iconClass:"italic",togglable:!0},underline:{type:"button",command:"PropertyChangeCommand",property:"underline",value:!0,iconClass:"underline",togglable:!0},formatDecreaseDecimal:{type:"button",command:"AdjustDecimalsCommand",value:-1,iconClass:"decrease-decimal"},formatIncreaseDecimal:{type:"button",command:"AdjustDecimalsCommand",value:1,iconClass:"increase-decimal"},textWrap:{type:"button",command:"TextWrapCommand",property:"wrap",value:!0,iconClass:"text-wrap",togglable:!0},cut:{type:"button",command:"ToolbarCutCommand",iconClass:"cut"},copy:{type:"button",command:"ToolbarCopyCommand",iconClass:"copy"},paste:{type:"button",command:"ToolbarPasteCommand",iconClass:"paste"},separator:{type:"separator"},alignment:{type:"alignment",iconClass:"justify-left"},backgroundColor:{type:"colorPicker",property:"background",iconClass:"background"},textColor:{type:"colorPicker",property:"color",iconClass:"text"},fontFamily:{type:"fontFamily",property:"fontFamily",iconClass:"text"},fontSize:{type:"fontSize",property:"fontSize",iconClass:"font-size"},format:{type:"format",property:"format",iconClass:"format-number"},filter:{type:"filter",property:"hasFilter",iconClass:"filter"},merge:{type:"merge",iconClass:"merge-cells"},freeze:{type:"freeze",iconClass:"freeze-panes"},borders:{type:"borders",iconClass:"all-borders"},formatCells:{type:"dialog",dialogName:"formatCells",overflow:"never"},addColumnLeft:{type:"button",command:"AddColumnCommand",value:"left",iconClass:"add-column-left"},addColumnRight:{type:"button",command:"AddColumnCommand",value:"right",iconClass:"add-column-right"},addRowBelow:{type:"button",command:"AddRowCommand",value:"below",iconClass:"add-row-below"},addRowAbove:{type:"button",command:"AddRowCommand",value:"above",iconClass:"add-row-above"},deleteColumn:{type:"button",command:"DeleteColumnCommand",iconClass:"delete-column"},deleteRow:{type:"button",command:"DeleteRowCommand",iconClass:"delete-row"},sort:{type:"sort",iconClass:"sort-desc"},validation:{type:"dialog",dialogName:"validation",iconClass:"exception",overflow:"never"}},c=s.extend({init:function(n,t){t.items=this._expandTools(t.tools||c.prototype.options.tools[t.toolbarName]);s.fn.init.call(this,n,t);var i=this._click.bind(this);this.element.addClass("k-spreadsheet-toolbar");this._addSeparators(this.element);this.bind({click:i,toggle:i})},_addSeparators:function(n){var t=n.children(".k-widget, .k-button, .k-button-group");t.slice(2).before("<span class='k-separator' />")},_expandTools:function(n){function r(n){var u=i.isPlainObject(n)?n:h[n]||{},e="k-icon k-font-icon k-i-"+u.iconClass,o=u.type,s={splitButton:{spriteCssClass:e},button:{showText:"overflow"},colorPicker:{toolIcon:e}},f=i.extend({name:u.name||n,text:t[u.name||n],spriteCssClass:e,attributes:{title:t[u.name||n]}},s[o],u);return o=="splitButton"&&(f.menuButtons=f.menuButtons.map(r)),f.attributes["data-tool"]=n,u.property&&(f.attributes["data-property"]=u.property),f}return n.reduce(function(n,t){return i.isArray(t)?n.push({type:"buttonGroup",buttons:t.map(r)}):n.push(r.call(this,t)),n},[])},_click:function(n){var u=n.target.attr("data-tool"),i=h[u]||{},r=i.command,t;r&&(t={command:r,options:{property:i.property||null,value:i.value||null}},typeof t.options.value=="boolean"&&(t.options.value=n.checked?!0:null),this.action(t))},events:["click","toggle","open","close","overflowOpen","overflowClose","action","dialog"],options:{name:"SpreadsheetToolBar",resizable:!0,tools:{home:["excelExport",["cut","copy","paste"],["bold","italic","underline"],"backgroundColor","textColor","borders","fontSize","fontFamily","alignment","textWrap",["formatDecreaseDecimal","formatIncreaseDecimal"],"format","merge","freeze","filter"],insert:[["addColumnLeft","addColumnRight","addRowBelow","addRowAbove"],["deleteColumn","deleteRow"]],data:["sort","filter","validation"]}},action:function(n){this.trigger("action",n)},dialog:function(n){this.trigger("dialog",n)},refresh:function(t){function s(n,t){var r=n.toolbar,u=n.overflow,f=r&&r.options.togglable||u&&u.options.togglable,i;f&&(i=!1,typeof t=="boolean"?i=t:typeof t=="string"&&(i=r.options.value===t),r.toggle(i),u&&u.toggle(i))}function h(n,t){var i=n.toolbar,r=n.overflow;i&&i.update&&i.update(t);r&&r.update&&r.update(t)}for(var r=t,u=this._tools(),i=0;i<u.length;i++){var e=u[i].property,f=u[i].tool,o=n.isFunction(r[e])?r[e]():r;f.type==="button"?s(f,o):h(f,o)}},_tools:function(){return this.element.find("[data-property]").toArray().reduce(function(n,t){t=i(t);var r=t.attr("data-property");return n.push({property:r,tool:this._getItem(t)}),n}.bind(this),[])},destroy:function(){this.element.find("[data-command],.k-button").each(function(){var t=i(this),n=t.data("instance");n&&n.destroy&&n.destroy()});s.fn.destroy.call(this)}}),f=n.toolbar.Item.extend({init:function(n,t){var r=i("<select />").kendoDropDownList({height:"auto"}).data("kendoDropDownList");this.dropDownList=r;this.element=r.wrapper;this.options=n;this.toolbar=t;this.attributes();this.addUidAttr();this.addOverflowAttr();r.bind("open",this._open.bind(this));r.bind("change",this._change.bind(this));this.element.width(n.width).attr({"data-command":"PropertyChangeCommand","data-property":n.property})},_open:function(){var i=this.dropDownList,r=i.list,t;r.css({whiteSpace:"nowrap",width:"auto"});t=r.width();t?t+=20:t=i._listWidth;r.css("width",t+n.support.scrollbar());i._listWidth=t},_change:function(n){var t=n.sender,i=t.value(),r=t.dataItem(),u=r?r.popup:undefined;u?this.toolbar.dialog({name:u}):this.toolbar.action({command:"PropertyChangeCommand",options:{property:this.options.property,value:i=="null"?null:i}})},value:function(n){if(n!==undefined)this.dropDownList.value(n);else return this.dropDownList.value()}}),r=n.toolbar.Item.extend({init:function(n,t){this.element=i("<a href='#' class='k-button k-button-icon'><span class='"+n.spriteCssClass+"'><\/span><span class='k-icon k-i-arrow-s'><\/span><\/a>");this.element.on("click",this.open.bind(this)).attr("data-command",n.command);this.options=n;this.toolbar=t;this.attributes();this.addUidAttr();this.addOverflowAttr();this._popup()},destroy:function(){this.popup.destroy()},open:function(){this.popup.toggle()},_popup:function(){var n=this.element;this.popup=i("<div class='k-spreadsheet-popup' />").appendTo(n).kendoPopup({anchor:n}).data("kendoPopup")}});n.toolbar.registerComponent("dialog",n.toolbar.ToolBarButton.extend({init:function(t,i){n.toolbar.ToolBarButton.fn.init.call(this,t,i);this._dialogName=t.dialogName;this.element.bind("click",this.open.bind(this)).data("instance",this)},open:function(){this.toolbar.dialog({name:this._dialogName})}}));var u=n.toolbar.OverflowButton.extend({init:function(t,i){n.toolbar.OverflowButton.fn.init.call(this,t,i);this.element.on("click",this._click.bind(this));this.message=this.options.text;var r=this.element.data("button");this.element.data(this.options.type,r)},_click:i.noop}),et=r.extend({init:function(n,t){r.fn.init.call(this,n,t);this._colorPalette();this.element.attr({"data-property":n.property});this.element.data({type:"colorPicker",colorPicker:this,instance:this})},destroy:function(){this.colorPalette.destroy();r.fn.destroy.call(this)},update:function(n){this.value(n)},value:function(n){if(n!==undefined)this.colorPalette.value(n);else return this.colorPalette.value()},_colorPalette:function(){var n=i("<div />").appendTo(this.popup.element);this.colorPalette=n.kendoColorPalette({palette:["#ffffff","#000000","#d6ecff","#4e5b6f","#7fd13b","#ea157a","#feb80a","#00addc","#738ac8","#1ab39f","#f2f2f2","#7f7f7f","#a7d6ff","#d9dde4","#e5f5d7","#fad0e4","#fef0cd","#c5f2ff","#e2e7f4","#c9f7f1","#d8d8d8","#595959","#60b5ff","#b3bcca","#cbecb0","#f6a1c9","#fee29c","#8be6ff","#c7d0e9","#94efe3","#bfbfbf","#3f3f3f","#007dea","#8d9baf","#b2e389","#f272af","#fed46b","#51d9ff","#aab8de","#5fe7d5","#a5a5a5","#262626","#003e75","#3a4453","#5ea226","#af0f5b","#c58c00","#0081a5","#425ea9","#138677","#7f7f7f","#0c0c0c","#00192e","#272d37","#3f6c19","#750a3d","#835d00","#00566e","#2c3f71","#0c594f"],change:this._colorChange.bind(this)}).data("kendoColorPalette")},_colorChange:function(n){this.toolbar.action({command:"PropertyChangeCommand",options:{property:this.options.property,value:n.sender.value()}});this.popup.close()}}),ot=u.extend({init:function(n,t){n.iconName="text";u.fn.init.call(this,n,t)},_click:function(){this.toolbar.dialog({name:"colorPicker",options:{title:this.options.property,property:this.options.property}})}});n.toolbar.registerComponent("colorPicker",et,ot);var l=[8,9,10,11,12,13,14,16,18,20,22,24,26,28,36,48,72],e=12,st=n.toolbar.Item.extend({init:function(n,t){var r=i("<input />").kendoComboBox({change:this._valueChange.bind(this),dataSource:n.fontSizes||l,value:e}).data("kendoComboBox");this.comboBox=r;this.element=r.wrapper;this.options=n;this.toolbar=t;this.attributes();this.addUidAttr();this.addOverflowAttr();this.element.width(n.width).attr({"data-command":"PropertyChangeCommand","data-property":n.property});this.element.data({type:"fontSize",fontSize:this})},_valueChange:function(t){this.toolbar.action({command:"PropertyChangeCommand",options:{property:this.options.property,value:n.parseInt(t.sender.value())}})},update:function(t){this.value(n.parseInt(t)||e)},value:function(n){if(n!==undefined)this.comboBox.value(n);else return this.comboBox.value()}}),ht=u.extend({_click:function(){this.toolbar.dialog({name:"fontSize",options:{sizes:l,defaultSize:e}})},update:function(n){this._value=n||e;this.element.find(".k-text").text(this.message+" ("+this._value+") ...")}});n.toolbar.registerComponent("fontSize",st,ht);var a=["Arial","Courier New","Georgia","Times New Roman","Trebuchet MS","Verdana"],o="Arial",ct=f.extend({init:function(n,t){f.fn.init.call(this,n,t);var i=this.dropDownList;i.setDataSource(n.fontFamilies||a);i.value(o);this.element.data({type:"fontFamily",fontFamily:this})},update:function(n){this.value(n||o)}}),lt=u.extend({_click:function(){this.toolbar.dialog({name:"fontFamily",options:{fonts:a,defaultFont:o}})},update:function(n){this._value=n||o;this.element.find(".k-text").text(this.message+" ("+this._value+") ...")}});n.toolbar.registerComponent("fontFamily",ct,lt);v=f.extend({_revertTitle:function(n){n.sender.value("");n.sender.wrapper.width("auto")},init:function(n,i){f.fn.init.call(this,n,i);var r=this.dropDownList;r.bind("change",this._revertTitle.bind(this));r.bind("dataBound",this._revertTitle.bind(this));r.setOptions({dataValueField:"format",dataValuePrimitive:!0,valueTemplate:"<span class='k-icon k-font-icon k-i-"+n.iconClass+"' style='line-height: 1em; width: 1.35em;'><\/span>",template:"# if (data.sample) { #<span class='k-spreadsheet-sample'>#: data.sample #<\/span># } ##: data.name #"});r.setDataSource([{format:null,name:t.formatTypes.automatic},{format:"#,0.00",name:t.formatTypes.number,sample:"1,499.99"},{format:"0.00%",name:t.formatTypes.percent,sample:"14.50%"},{format:'_("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(@_)',name:t.formatTypes.financial,sample:"(1,000.12)"},{format:"$#,##0.00;[Red]$#,##0.00",name:t.formatTypes.currency,sample:"$1,499.99"},{format:"m/d/yyyy",name:t.formatTypes.date,sample:"4/21/2012"},{format:"h:mm:ss AM/PM",name:t.formatTypes.time,sample:"5:49:00 PM"},{format:"m/d/yyyy h:mm",name:t.formatTypes.dateTime,sample:"4/21/2012 5:49:00"},{format:"[h]:mm:ss",name:t.formatTypes.duration,sample:"168:05:00"},{popup:"formatCells",name:t.formatTypes.moreFormats}]);this.element.data({type:"format",format:this})}});y=u.extend({_click:function(){this.toolbar.dialog({name:"formatCells"})}});n.toolbar.registerComponent("format",v,y);p=r.extend({init:function(n,t){r.fn.init.call(this,n,t);this._borderPalette();this.element.data({type:"borders",instance:this})},destroy:function(){this.borderPalette.destroy();r.fn.destroy.call(this)},_borderPalette:function(){var t=i("<div />").appendTo(this.popup.element);this.borderPalette=new n.spreadsheet.BorderPalette(t,{change:this._action.bind(this)})},_action:function(n){this.toolbar.action({command:"BorderChangeCommand",options:{border:n.type,style:{size:1,color:n.color}}})}});w=u.extend({_click:function(){this.toolbar.dialog({name:"borders"})}});n.toolbar.registerComponent("borders",p,w);b=r.extend({init:function(n,t){r.fn.init.call(this,n,t);this.element.attr({"data-property":"alignment"});this._commandPalette();this.popup.element.on("click",".k-button",function(n){this._action(i(n.currentTarget))}.bind(this));this.element.data({type:"alignment",alignment:this,instance:this})},buttons:[{property:"textAlign",value:"left",iconClass:"justify-left",text:t.alignmentButtons.justtifyLeft},{property:"textAlign",value:"center",iconClass:"justify-center",text:t.alignmentButtons.justifyCenter},{property:"textAlign",value:"right",iconClass:"justify-right",text:t.alignmentButtons.justifyRight},{property:"textAlign",value:"justify",iconClass:"justify-full",text:t.alignmentButtons.justifyFull},{property:"verticalAlign",value:"top",iconClass:"align-top",text:t.alignmentButtons.alignTop},{property:"verticalAlign",value:"middle",iconClass:"align-middle",text:t.alignmentButtons.alignMiddle},{property:"verticalAlign",value:"bottom",iconClass:"align-bottom",text:t.alignmentButtons.alignBottom}],destroy:function(){this.popup.element.off();r.fn.destroy.call(this)},update:function(n){var t=n.textAlign(),i=n.verticalAlign();this.popup.element.find(".k-button").removeClass("k-state-active");t&&this.popup.element.find(".k-button[data-value="+t+"]").addClass("k-state-active");i&&this.popup.element.find(".k-button[data-value="+i+"]").addClass("k-state-active")},_commandPalette:function(){var n=this.buttons,t=i("<div />").appendTo(this.popup.element);n.forEach(function(r,u){var f="<a title='"+r.text+"' data-property='"+r.property+"' data-value='"+r.value+"' class='k-button k-button-icon'><span class='k-icon k-font-icon k-i-"+r.iconClass+"'><\/span><\/a>";u!==0&&n[u-1].property!==r.property&&t.append(i("<span class='k-separator' />"));t.append(f)})},_action:function(n){var t=n.attr("data-property"),i=n.attr("data-value");this.toolbar.action({command:"PropertyChangeCommand",options:{property:t,value:i}})}});k=u.extend({_click:function(){this.toolbar.dialog({name:"alignment"})}});n.toolbar.registerComponent("alignment",b,k);d=r.extend({init:function(n,t){r.fn.init.call(this,n,t);this._commandPalette();this.popup.element.on("click",".k-button",function(n){this._action(i(n.currentTarget))}.bind(this));this.element.data({type:"merge",merge:this,instance:this})},buttons:[{value:"cells",iconClass:"merge-cells",text:t.mergeButtons.mergeCells},{value:"horizontally",iconClass:"merge-horizontally",text:t.mergeButtons.mergeHorizontally},{value:"vertically",iconClass:"merge-vertically",text:t.mergeButtons.mergeVertically},{value:"unmerge",iconClass:"normal-layout",text:t.mergeButtons.unmerge}],destroy:function(){this.popup.element.off();r.fn.destroy.call(this)},_commandPalette:function(){var n=i("<div />").appendTo(this.popup.element);this.buttons.forEach(function(t){var i="<a title='"+t.text+"' data-value='"+t.value+"' class='k-button k-button-icontext'><span class='k-icon k-font-icon k-i-"+t.iconClass+"'><\/span>"+t.text+"<\/a>";n.append(i)})},_action:function(n){var t=n.attr("data-value");this.toolbar.action({command:"MergeCellCommand",options:{value:t}})}});g=u.extend({_click:function(){this.toolbar.dialog({name:"merge"})}});n.toolbar.registerComponent("merge",d,g);nt=r.extend({init:function(n,t){r.fn.init.call(this,n,t);this._commandPalette();this.popup.element.on("click",".k-button",function(n){this._action(i(n.currentTarget))}.bind(this));this.element.data({type:"freeze",freeze:this,instance:this})},buttons:[{value:"panes",iconClass:"freeze-panes",text:t.freezeButtons.freezePanes},{value:"rows",iconClass:"freeze-row",text:t.freezeButtons.freezeRows},{value:"columns",iconClass:"freeze-col",text:t.freezeButtons.freezeColumns},{value:"unfreeze",iconClass:"normal-layout",text:t.freezeButtons.unfreeze}],destroy:function(){this.popup.element.off();r.fn.destroy.call(this)},_commandPalette:function(){var n=i("<div />").appendTo(this.popup.element);this.buttons.forEach(function(t){var i="<a title='"+t.text+"' data-value='"+t.value+"' class='k-button k-button-icontext'><span class='k-icon k-font-icon k-i-"+t.iconClass+"'><\/span>"+t.text+"<\/a>";n.append(i)})},_action:function(n){var t=n.attr("data-value");this.toolbar.action({command:"FreezePanesCommand",options:{value:t}})}});tt=u.extend({_click:function(){this.toolbar.dialog({name:"freeze"})}});n.toolbar.registerComponent("freeze",nt,tt);it=f.extend({_revertTitle:function(n){n.sender.value("");n.sender.wrapper.width("auto")},init:function(n,i){f.fn.init.call(this,n,i);var r=this.dropDownList;r.bind("change",this._revertTitle.bind(this));r.bind("dataBound",this._revertTitle.bind(this));r.setOptions({valueTemplate:"<span class='k-icon k-font-icon k-i-"+n.iconClass+"' style='line-height: 1em; width: 1.35em;'><\/span>",template:"<span class='k-icon k-font-icon k-i-#= iconClass #' style='line-height: 1em; width: 1.35em;'><\/span>#=text#",dataValueField:"value"});r.setDataSource([{value:1,sheet:!1,asc:!0,text:t.sortButtons.sortRangeAsc,iconClass:"sort-asc"},{value:2,sheet:!1,asc:!1,text:t.sortButtons.sortRangeDesc,iconClass:"sort-desc"}]);this.element.data({type:"sort",sort:this})},_change:function(n){var i=n.sender,t=i.dataItem();t&&this.toolbar.action({command:"SortCommand",options:{asc:t.asc,sheet:t.sheet}})},value:i.noop});rt=u.extend({_click:function(){this.toolbar.dialog({name:"sort"})}});n.toolbar.registerComponent("sort",it,rt);ut=n.toolbar.ToolBarButton.extend({init:function(t,i){t.showText="overflow";n.toolbar.ToolBarButton.fn.init.call(this,t,i);this.element.on("click",this._click.bind(this));this.element.data({type:"filter",filter:this})},_click:function(){this.toolbar.action({command:"FilterCommand"})},update:function(n){this.toggle(n)}});ft=u.extend({init:function(n,t){u.fn.init.call(this,n,t);this.element.data({type:"filter",filter:this})},_click:function(){this.toolbar.action({command:"FilterCommand"})},update:function(n){this.toggle(n)}});n.toolbar.registerComponent("filter",ut,ft);n.spreadsheet.ToolBar=c;n.spreadsheet.TabStrip=n.ui.TabStrip.extend({init:function(t,r){n.ui.TabStrip.fn.init.call(this,t,r);t.addClass("k-spreadsheet-tabstrip");this._quickAccessButtons();this.quickAccessToolBar.on("click",".k-button",function(n){var t=i(n.currentTarget).attr("title").toLowerCase();this.trigger("action",{action:t})}.bind(this));this.toolbars={};var u=r.dataSource;this.contentElements.each(function(n,t){this._toolbar(i(t),u[n].id,r.toolbarOptions[u[n].id])}.bind(this));this.one("activate",function(){this.toolbars[this.options.dataSource[0].id].resize()})},events:n.ui.TabStrip.fn.events.concat(["action","dialog"]),destroy:function(){this.quickAccessToolBar.off("click");n.ui.TabStrip.fn.destroy.call(this);for(var t in this.toolbars)this.toolbars[t].destroy()},action:function(n){this.trigger("action",n)},dialog:function(n){this.trigger("dialog",n)},refreshTools:function(n){var t=this.toolbars;for(var i in t)t.hasOwnProperty(i)&&t[i].refresh(n)},_quickAccessButtons:function(){var r=[{title:t.quickAccess.undo,iconClass:"undo-large",action:"undo"},{title:t.quickAccess.redo,iconClass:"redo-large",action:"redo"}],u=n.template("<a href='\\#' title='#= title #' data-action='#= action #' class='k-button k-button-icon'><span class='k-icon k-font-icon k-i-#=iconClass#'><\/span><\/a>");this.quickAccessToolBar=i("<div />",{"class":"k-spreadsheet-quick-access-toolbar",html:n.render(u,r)}).insertBefore(this.wrapper);this.quickAccessToolBar.on("click",".k-button",function(n){var t=i(n.currentTarget).attr("title").toLowerCase();this.action({action:t})}.bind(this));this.quickAccessAdjust()},quickAccessAdjust:function(){this.tabGroup.css("padding-left",this.quickAccessToolBar.outerWidth())},_toolbar:function(t,i,r){var u,f;this.toolbars[i]&&(this.toolbars[i].destroy(),t.children(".k-toolbar").remove());r&&(u=t.html("<div />").children("div"),f={tools:typeof r=="boolean"?undefined:r,toolbarName:i,action:this.action.bind(this),dialog:this.dialog.bind(this)},this.toolbars[i]=new n.spreadsheet.ToolBar(u,f))}})}})(window.kendo)}(),function(){(function(n){function s(t,i){var r=n.spreadsheet.formatting.format(t,i);return r.children[0].nodeValue}function a(n,t){for(var u=[],f=[],i=0;i<t.length;i++)r.inArray(t[i][n],f)==-1&&(u.push(t[i]),f.push(t[i][n]));return u}var i,u,f,e,v,y,p,w,b,k,d,g,h,c,nt,tt,it,rt;if(!n.support.browser.msie||!(n.support.browser.version<9)){var r=n.jQuery,o=n.data.ObservableObject,t=n.spreadsheet.messages.dialogs={apply:"Apply",save:"Save",cancel:"Cancel",remove:"Remove",okText:"OK",formatCellsDialog:{title:"Format",categories:{number:"Number",currency:"Currency",date:"Date"}},fontFamilyDialog:{title:"Font"},fontSizeDialog:{title:"Font size"},bordersDialog:{title:"Borders"},alignmentDialog:{title:"Alignment",buttons:{justtifyLeft:"Align left",justifyCenter:"Center",justifyRight:"Align right",justifyFull:"Justify",alignTop:"Align top",alignMiddle:"Align middle",alignBottom:"Align bottom"}},mergeDialog:{title:"Merge cells",buttons:{mergeCells:"Merge all",mergeHorizontally:"Merge horizontally",mergeVertically:"Merge vertically",unmerge:"Unmerge"}},freezeDialog:{title:"Freeze panes",buttons:{freezePanes:"Freeze panes",freezeRows:"Freeze rows",freezeColumns:"Freeze columns",unfreeze:"Unfreeze panes"}},validationDialog:{title:"Data Validation",hintMessage:"Please enter a valid {0} value {1}.",hintTitle:"Validation {0}",criteria:{any:"Any value",number:"Number",text:"Text",date:"Date",custom:"Custom Formula",list:"List"},comparers:{greaterThan:"greater than",lessThan:"less than",between:"between",notBetween:"not between",equalTo:"equal to",notEqualTo:"not equal to",greaterThanOrEqualTo:"greater than or equal to",lessThanOrEqualTo:"less than or equal to"},comparerMessages:{greaterThan:"greater than {0}",lessThan:"less than {0}",between:"between {0} and {1}",notBetween:"not between {0} and {1}",equalTo:"equal to {0}",notEqualTo:"not equal to {0}",greaterThanOrEqualTo:"greater than or equal to {0}",lessThanOrEqualTo:"less than or equal to {0}",custom:"that satisfies the formula: {0}"},labels:{criteria:"Criteria",comparer:"Comparer",min:"Min",max:"Max",value:"Value",start:"Start",end:"End",onInvalidData:"On invalid data",rejectInput:"Reject input",showWarning:"Show warning",showHint:"Show hint",hintTitle:"Hint title",hintMessage:"Hint message"},placeholders:{typeTitle:"Type title",typeMessage:"Type message"}},saveAsDialog:{title:"Save As...",labels:{fileName:"File name",saveAsType:"Save as type"}},excelExportDialog:{title:"Export to Excel..."},modifyMergedDialog:{errorMessage:"Cannot change part of a merged cell."},useKeyboardDialog:{title:"Copying and pasting",errorMessage:"These actions cannot be invoked through the menu. Please use the keyboard shortcuts instead:",labels:{forCopy:"for copy",forCut:"for cut",forPaste:"for paste"}},unsupportedSelectionDialog:{errorMessage:"That action cannot be performed on multiple selection."}},l={};n.spreadsheet.dialogs={register:function(n,t){l[n]=t},create:function(n,t){var i=l[n];if(i)return new i(t)}};i=n.spreadsheet.SpreadsheetDialog=n.Observable.extend({init:function(t){n.Observable.fn.init.call(this,t);this.options=r.extend(!0,{},this.options,t)},dialog:function(){return this._dialog||(this._dialog=r("<div class='k-spreadsheet-window k-action-window' />").addClass(this.options.className||"").append(this.options.template).appendTo(document.body).kendoWindow({scrollable:!1,resizable:!1,maximizable:!1,modal:!0,visible:!1,width:this.options.width||320,title:this.options.title,open:function(){this.center()},deactivate:function(){this._dialog.destroy();this._dialog=null}.bind(this)}).data("kendoWindow")),this._dialog},destroy:function(){this._dialog&&(this._dialog.destroy(),this._dialog=null)},open:function(){this.dialog().open()},apply:function(){this.close()},close:function(){this.dialog().close()}});u=n.spreadsheet.FormatCellsViewModel=o.extend({init:function(n){o.fn.init.call(this,n);this.useCategory(this.category)},useCategory:function(n){var t=n&&n.type||"number",i=t=="currency";this.category=n;this.set("showCurrencyFilter",i&&this.currencies.length>1);i?this.currency(this.currencies[0]):this.set("formats",this.allFormats[t+"Formats"]);this.useFirstFormat()},useFirstFormat:function(){this.formats.length&&this.set("format",this.formats[0].value)},currency:function(n){if(n!==undefined){this._currency=n;var t=n.value,i=[{currency:t,decimals:!0},{currency:t,decimals:!0,iso:!0},{currency:t,decimals:!1}];i=i.map(function(n){return n=u.convert.currency(n),{value:n,name:s(1e3,n)}});this.set("formats",i);this.useFirstFormat()}return this._currency||this.currencies[0]},categoryFilter:function(n){return n!==undefined&&this.useCategory(n),this.category},preview:function(){var n=this.get("format"),t=this.value||0;return n&&n.length?s(t,n):t}});u.convert={currency:function(n){function r(n,t){return new Array(t+1).join(n)}var i=n.currency,t=i.pattern[1];return n.decimals&&(t=t.replace(/n/g,"n"+i["."]+r("0",i.decimals))),t=n.iso?'"'+i.abbr+'" '+t.replace(/\s*\$\s*/g,""):t.replace(/\$/g,i.symbol),t.replace(/n/g,"?")},date:function(n){return/T|Z/.test(n)?"":n.toLowerCase().replace(/tt/g,"AM/PM").replace(/'/g,'"')}};f=i.extend({init:function(n){i.fn.init.call(this,n);this._generateFormats()},options:{title:t.formatCellsDialog.title,className:"k-spreadsheet-format-cells",categories:[{type:"number",name:t.formatCellsDialog.categories.number},{type:"currency",name:t.formatCellsDialog.categories.currency},{type:"date",name:t.formatCellsDialog.categories.date}],template:"<div class='k-root-tabs' data-role='tabstrip' data-text-field='name' data-bind='source: categories, value: categoryFilter' data-animation='false' /><div class='k-spreadsheet-preview' data-bind='text: preview' /><script type='text/x-kendo-template' id='format-item-template'>#: data.name #<\/script><select data-role='dropdownlist' class='k-format-filter' data-text-field='description' data-value-field='value.name' data-bind='visible: showCurrencyFilter, value: currency, source: currencies' /><ul data-role='staticlist' tabindex='0' class='k-list k-reset' data-template='format-item-template' data-value-primitive='true' data-value-field='value' data-bind='source: formats, value: format' /><div class='k-action-buttons'><button class='k-button k-primary' data-bind='click: apply'>"+t.apply+"<\/button><button class='k-button' data-bind='click: close'>"+t.cancel+"<\/button><\/div>"},_generateFormats:function(){var t=this.options,i;t.currencies||(t.currencies=f.currenciesFrom(n.cultures));t.numberFormats||(t.numberFormats=[{value:"#.00%",name:"100.00%"},{value:"#%",name:"100%"},{value:"#.00",name:"1024.00"},{value:"#,###.00",name:"1,024.00"}]);t.dateFormats||(i=n.cultures.current.calendars.standard.patterns,t.dateFormats=a("value",r.map(i,function(n){if(n=u.convert.date(n),n)return{value:n,name:s(34567.7678,n)}})))},open:function(t){var r=this.options,o=t.value(),e=r.categories.slice(0),f,s;this.viewModel=new u({currencies:r.currencies.slice(0),allFormats:{numberFormats:r.numberFormats.slice(0),dateFormats:r.dateFormats.slice(0)},categories:e,format:t.format(),category:o instanceof Date?e[2]:e[0],apply:this.apply.bind(this),close:this.close.bind(this),value:o});i.fn.open.call(this);f=this.dialog().element;n.bind(f,this.viewModel);s=f.find("select.k-format-filter").data("kendoDropDownList");r.currencies.length>10&&s.setOptions({filter:"contains"});f.find(n.roleSelector("staticlist")).parent().addClass("k-list-wrapper")},apply:function(){var n=this.viewModel.format;i.fn.apply.call(this);this.trigger("action",{command:"PropertyChangeCommand",options:{property:"format",value:n}})}});f.currenciesFrom=function(t){return a("description",r.map(t,function(t,i){if(/-/.test(i)){var r=t.numberFormat.currency,u=n.format("{0} ({1}, {2})",r.name,r.abbr,r.symbol);return{description:u,value:r}}}))};n.spreadsheet.dialogs.register("formatCells",f);n.spreadsheet.dialogs.FormatCellsDialog=f;e=i.extend({options:{className:"k-spreadsheet-message",title:"",text:"",template:"<div class='k-spreadsheet-message-content' data-bind='text: text' /><div class='k-action-buttons'><button class='k-button k-primary' data-bind='click: close, text: okText' /><\/div>"},open:function(){i.fn.open.call(this);n.bind(this.dialog().element,{text:this.options.text,okText:t.okText,close:this.close.bind(this)})}});n.spreadsheet.dialogs.register("message",e);v=i.extend({init:function(n){i.fn.init.call(this,n);this._list()},options:{title:t.fontFamilyDialog.title,template:"<ul class='k-list k-reset'><\/ul>"},_list:function(){var t=this.dialog().element.find("ul"),i=this.options.fonts,r=this.options.defaultFont;this.list=new n.ui.StaticList(t,{dataSource:new n.data.DataSource({data:i}),template:"#:data#",value:r,change:this.apply.bind(this)});this.list.dataSource.fetch()},apply:function(n){i.fn.apply.call(this);this.trigger("action",{command:"PropertyChangeCommand",options:{property:"fontFamily",value:n.sender.value()[0]}})}});n.spreadsheet.dialogs.register("fontFamily",v);y=i.extend({init:function(n){i.fn.init.call(this,n);this._list()},options:{title:t.fontSizeDialog.title,template:"<ul class='k-list k-reset'><\/ul>"},_list:function(){var t=this.dialog().element.find("ul"),i=this.options.sizes,r=this.options.defaultSize;this.list=new n.ui.StaticList(t,{dataSource:new n.data.DataSource({data:i}),template:"#:data#",value:r,change:this.apply.bind(this)});this.list.dataSource.fetch()},apply:function(t){i.fn.apply.call(this);this.trigger("action",{command:"PropertyChangeCommand",options:{property:"fontSize",value:n.parseInt(t.sender.value()[0])}})}});n.spreadsheet.dialogs.register("fontSize",y);p=i.extend({init:function(t){i.fn.init.call(this,t);this.element=this.dialog().element;this._borderPalette();this.viewModel=n.observable({apply:this.apply.bind(this),close:this.close.bind(this)});n.bind(this.element.find(".k-action-buttons"),this.viewModel)},options:{title:t.bordersDialog.title,width:177,template:"<div><\/div><div class='k-action-buttons'><button class='k-button k-primary' data-bind='click: apply'>"+t.apply+"<\/button><button class='k-button' data-bind='click: close'>"+t.cancel+"<\/button><\/div>"},apply:function(){i.fn.apply.call(this);var n=this.value();this.trigger("action",{command:"BorderChangeCommand",options:{border:n.type,style:{size:1,color:n.color}}})},_borderPalette:function(){var t=this.dialog().element.find("div:first");this.borderPalette=new n.spreadsheet.BorderPalette(t,{change:this.value.bind(this)})},value:function(n){if(n===undefined)return this._state;this._state=n}});n.spreadsheet.dialogs.register("borders",p);w=i.extend({init:function(t){i.fn.init.call(this,t);this.element=this.dialog().element;this._colorPalette();this.property=t.property;this.options.title=t.title;this.viewModel=n.observable({apply:this.apply.bind(this),close:this.close.bind(this)});n.bind(this.element.find(".k-action-buttons"),this.viewModel)},options:{width:177,template:"<div><\/div><div class='k-action-buttons'><button class='k-button k-primary' data-bind='click: apply'>"+t.apply+"<\/button><button class='k-button' data-bind='click: close'>"+t.cancel+"<\/button><\/div>"},apply:function(){i.fn.apply.call(this);this.trigger("action",{command:"PropertyChangeCommand",options:{property:this.property,value:this.value()}})},_colorPalette:function(){var n=this.dialog().element.find("div:first");this.colorPalette=n.kendoColorPalette({palette:["#ffffff","#000000","#d6ecff","#4e5b6f","#7fd13b","#ea157a","#feb80a","#00addc","#738ac8","#1ab39f","#f2f2f2","#7f7f7f","#a7d6ff","#d9dde4","#e5f5d7","#fad0e4","#fef0cd","#c5f2ff","#e2e7f4","#c9f7f1","#d8d8d8","#595959","#60b5ff","#b3bcca","#cbecb0","#f6a1c9","#fee29c","#8be6ff","#c7d0e9","#94efe3","#bfbfbf","#3f3f3f","#007dea","#8d9baf","#b2e389","#f272af","#fed46b","#51d9ff","#aab8de","#5fe7d5","#a5a5a5","#262626","#003e75","#3a4453","#5ea226","#af0f5b","#c58c00","#0081a5","#425ea9","#138677","#7f7f7f","#0c0c0c","#00192e","#272d37","#3f6c19","#750a3d","#835d00","#00566e","#2c3f71","#0c594f"],change:this.value.bind(this)}).data("kendoColorPalette")},value:function(n){if(n===undefined)return this._value;this._value=n.value}});n.spreadsheet.dialogs.register("colorPicker",w);b=i.extend({init:function(n){i.fn.init.call(this,n);this._list()},options:{title:"Alignment",template:"<ul class='k-list k-reset'><\/ul>",buttons:[{property:"textAlign",value:"left",iconClass:"justify-left",text:t.alignmentDialog.buttons.justtifyLeft},{property:"textAlign",value:"center",iconClass:"justify-center",text:t.alignmentDialog.buttons.justifyCenter},{property:"textAlign",value:"right",iconClass:"justify-right",text:t.alignmentDialog.buttons.justifyRight},{property:"textAlign",value:"justify",iconClass:"justify-full",text:t.alignmentDialog.buttons.justifyFull},{property:"verticalAlign",value:"top",iconClass:"align-top",text:t.alignmentDialog.buttons.alignTop},{property:"verticalAlign",value:"middle",iconClass:"align-middle",text:t.alignmentDialog.buttons.alignMiddle},{property:"verticalAlign",value:"bottom",iconClass:"align-bottom",text:t.alignmentDialog.buttons.alignBottom}]},_list:function(){var t=this.dialog().element.find("ul");this.list=new n.ui.StaticList(t,{dataSource:new n.data.DataSource({data:this.options.buttons}),template:"<a title='#=text#' data-property='#=property#' data-value='#=value#'><span class='k-icon k-font-icon k-i-#=iconClass#'><\/span>#=text#<\/a>",change:this.apply.bind(this)});this.list.dataSource.fetch()},apply:function(n){var t=n.sender.value()[0];i.fn.apply.call(this);this.trigger("action",{command:"PropertyChangeCommand",options:{property:t.property,value:t.value}})}});n.spreadsheet.dialogs.register("alignment",b);k=i.extend({init:function(n){i.fn.init.call(this,n);this._list()},options:{title:t.mergeDialog.title,template:"<ul class='k-list k-reset'><\/ul>",buttons:[{value:"cells",iconClass:"merge-cells",text:t.mergeDialog.buttons.mergeCells},{value:"horizontally",iconClass:"merge-horizontally",text:t.mergeDialog.buttons.mergeHorizontally},{value:"vertically",iconClass:"merge-vertically",text:t.mergeDialog.buttons.mergeVertically},{value:"unmerge",iconClass:"normal-layout",text:t.mergeDialog.buttons.unmerge}]},_list:function(){var t=this.dialog().element.find("ul");this.list=new n.ui.StaticList(t,{dataSource:new n.data.DataSource({data:this.options.buttons}),template:"<a title='#=text#' data-value='#=value#'><span class='k-icon k-font-icon k-i-#=iconClass#'><\/span>#=text#<\/a>",change:this.apply.bind(this)});this.list.dataSource.fetch()},apply:function(n){var t=n.sender.value()[0];i.fn.apply.call(this);this.trigger("action",{command:"MergeCellCommand",options:{value:t.value}})}});n.spreadsheet.dialogs.register("merge",k);d=i.extend({init:function(n){i.fn.init.call(this,n);this._list()},options:{title:t.freezeDialog.title,template:"<ul class='k-list k-reset'><\/ul>",buttons:[{value:"panes",iconClass:"freeze-panes",text:t.freezeDialog.buttons.freezePanes},{value:"rows",iconClass:"freeze-row",text:t.freezeDialog.buttons.freezeRows},{value:"columns",iconClass:"freeze-col",text:t.freezeDialog.buttons.freezeColumns},{value:"unfreeze",iconClass:"normal-layout",text:t.freezeDialog.buttons.unfreeze}]},_list:function(){var t=this.dialog().element.find("ul");this.list=new n.ui.StaticList(t,{dataSource:new n.data.DataSource({data:this.options.buttons}),template:"<a title='#=text#' data-value='#=value#'><span class='k-icon k-font-icon k-i-#=iconClass#'><\/span>#=text#<\/a>",change:this.apply.bind(this)});this.list.dataSource.fetch()},apply:function(n){var t=n.sender.value()[0];i.fn.apply.call(this);this.trigger("action",{command:"FreezePanesCommand",options:{value:t.value}})}});n.spreadsheet.dialogs.register("freeze",d);g=n.spreadsheet.ValidationCellsViewModel=o.extend({init:function(n){o.fn.init.call(this,n);this.bind("change",function(n){n.field==="criterion"&&(this.reset(),(this.criterion==="custom"||this.criterion==="list")&&this.setHintMessageTemplate());n.field==="comparer"&&this.setHintMessageTemplate();n.field!="hintMessage"&&n.field!="hintTitle"||this._mute||(this.shouldBuild=!1);(n.field=="from"||n.field=="to"||n.field=="hintMessageTemplate"||n.field=="type")&&this.shouldBuild&&this.buildMessages()}.bind(this));this.reset()},buildMessages:function(){this._mute=!0;this.set("hintTitle",this.hintTitleTemplate?n.format(this.hintTitleTemplate,this.type):"");this.set("hintMessage",this.hintMessageTemplate?n.format(this.hintMessageTemplate,this.from,this.to):"");this._mute=!1},reset:function(){this.setComparers();this.set("comparer",this.comparers[0].type);this.set("from",null);this.set("to",null);this.set("useCustomMessages",!1);this.shouldBuild=!0;this.hintTitleTemplate=this.defaultHintTitle;this.buildMessages()},setComparers:function(){var t=this.defaultComparers,i=[],r,n;if(this.criterion==="text")for(r=["equalTo","notEqualTo"],n=0;n<t.length;n++)r[0]==t[n].type&&(i.push(t[n]),r.shift());else i=t.slice();this.set("comparers",i)},setHintMessageTemplate:function(){this.criterion!=="custom"&&this.criterion!=="list"?this.set("hintMessageTemplate",n.format(this.defaultHintMessage,this.criterion,this.comparerMessages[this.comparer])):(this.set("hintMessageTemplate",""),this.set("hintMessage",""))},isAny:function(){return this.get("criterion")==="any"},isNumber:function(){return this.get("criterion")==="number"},isText:function(){return this.get("criterion")==="text"},isDate:function(){return this.get("criterion")==="date"},isList:function(){return this.get("criterion")==="list"},isCustom:function(){return this.get("criterion")==="custom"},showRemove:function(){return this.get("hasValidation")},showTo:function(){return this.get("comparer")=="between"||this.get("comparer")=="notBetween"},update:function(n){this.set("hasValidation",!!n);n&&this.fromValidationObject(n)},fromValidationObject:function(n){this.set("criterion",n.dataType);this.set("comparer",n.comparerType);this.set("from",n.from);this.set("to",n.to);this.set("type",n.type);n.messageTemplate||n.titleTemplate?(this.hintMessageTemplate=n.messageTemplate,this.hintMessage=n.messageTemplate,this.hintTitle=n.titleTemplate,this.useCustomMessages=!0,this.buildMessages()):this.useCustomMessages=!1},toValidationObject:function(){if(this.criterion==="any")return null;var n={type:this.type,dataType:this.criterion,comparerType:this.comparer,from:this.from,to:this.to};return this.useCustomMessages&&(n.messageTemplate=this.shouldBuild?this.hintMessageTemplate:this.hintMessage,n.titleTemplate=this.hintTitle),n}});h=i.extend({init:function(n){i.fn.init.call(this,n)},options:{width:420,title:t.validationDialog.title,criterion:"any",type:"reject",hintMessage:t.validationDialog.hintMessage,hintTitle:t.validationDialog.hintTitle,useCustomMessages:!1,criteria:[{type:"any",name:"Any value"},{type:"number",name:"Number"},{type:"text",name:"Text"},{type:"date",name:"Date"},{type:"custom",name:"Custom Formula"},{type:"list",name:"List"}],comparers:[{type:"greaterThan",name:t.validationDialog.comparers.greaterThan},{type:"lessThan",name:t.validationDialog.comparers.lessThan},{type:"between",name:t.validationDialog.comparers.between},{type:"notBetween",name:t.validationDialog.comparers.notBetween},{type:"equalTo",name:t.validationDialog.comparers.equalTo},{type:"notEqualTo",name:t.validationDialog.comparers.notEqualTo},{type:"greaterThanOrEqualTo",name:t.validationDialog.comparers.greaterThanOrEqualTo},{type:"lessThanOrEqualTo",name:t.validationDialog.comparers.lessThanOrEqualTo}],comparerMessages:t.validationDialog.comparerMessages,template:'<div class="k-edit-form-container"><div class="k-edit-label"><label>'+t.validationDialog.labels.criteria+':<\/label><\/div><div class="k-edit-field"><select data-role="dropdownlist" data-text-field="name" data-value-field="type" data-bind="value: criterion, source: criteria" /><\/div><div data-bind="visible: isNumber"><div class="k-edit-label"><label>'+t.validationDialog.labels.comparer+':<\/label><\/div><div class="k-edit-field"><select data-role="dropdownlist" data-text-field="name" data-value-field="type" data-bind="value: comparer, source: comparers" /><\/div><div class="k-edit-label"><label>'+t.validationDialog.labels.min+':<\/label><\/div><div class="k-edit-field"><input placeholder="e.g. 10" class="k-textbox" data-bind="value: from" /><\/div><div data-bind="visible: showTo"><div class="k-edit-label"><label>'+t.validationDialog.labels.max+':<\/label><\/div><div class="k-edit-field"><input placeholder="e.g. 100" class="k-textbox" data-bind="value: to" /><\/div><\/div><\/div><div data-bind="visible: isText"><div class="k-edit-label"><label>'+t.validationDialog.labels.comparer+':<\/label><\/div><div class="k-edit-field"><select data-role="dropdownlist" data-text-field="name" data-value-field="type" data-bind="value: comparer, source: comparers" /><\/div><div class="k-edit-label"><label>'+t.validationDialog.labels.value+':<\/label><\/div><div class="k-edit-field"><input class="k-textbox" data-bind="value: from" /><\/div><\/div><div data-bind="visible: isDate"><div class="k-edit-label"><label>'+t.validationDialog.labels.comparer+':<\/label><\/div><div class="k-edit-field"><select data-role="dropdownlist" data-text-field="name" data-value-field="type" data-bind="value: comparer, source: comparers" /><\/div><div class="k-edit-label"><label>'+t.validationDialog.labels.start+':<\/label><\/div><div class="k-edit-field"><input class="k-textbox" data-bind="value: from" /><\/div><div data-bind="visible: showTo"><div class="k-edit-label"><label>'+t.validationDialog.labels.end+':<\/label><\/div><div class="k-edit-field"><input class="k-textbox" data-bind="value: to" /><\/div><\/div><\/div><div data-bind="visible: isCustom"><div class="k-edit-label"><label>'+t.validationDialog.labels.value+':<\/label><\/div><div class="k-edit-field"><input class="k-textbox" data-bind="value: from" /><\/div><\/div><div data-bind="visible: isList"><div class="k-edit-label"><label>'+t.validationDialog.labels.value+':<\/label><\/div><div class="k-edit-field"><input class="k-textbox" data-bind="value: from" /><\/div><\/div><div data-bind="invisible: isAny"><div class="k-action-buttons"><\/div><div class="k-edit-label"><label>'+t.validationDialog.labels.onInvalidData+':<\/label><\/div><div class="k-edit-field"><input type="radio" id="validationTypeReject" name="validationType" value="reject" data-bind="checked: type" class="k-radio" /><label for="validationTypeReject" class="k-radio-label">'+t.validationDialog.labels.rejectInput+'<\/label> <input type="radio" id="validationTypeWarning" name="validationType" value="warning" data-bind="checked: type" class="k-radio" /><label for="validationTypeWarning" class="k-radio-label">'+t.validationDialog.labels.showWarning+'<\/label><\/div><\/div><div data-bind="invisible: isAny"><div class="k-edit-label"><label>'+t.validationDialog.labels.showHint+':<\/label><\/div><div class="k-edit-field"><input type="checkbox" name="useCustomMessages" id="useCustomMessages" class="k-checkbox" data-bind="checked: useCustomMessages" /><label class="k-checkbox-label" for="useCustomMessages"><\/label><\/div><div data-bind="visible: useCustomMessages"><div class="k-edit-label"><label>'+t.validationDialog.labels.hintTitle+':<\/label><\/div><div class="k-edit-field"><input class="k-textbox" placeholder="'+t.validationDialog.placeholders.typeTitle+'" data-bind="value: hintTitle" /><\/div><div class="k-edit-label"><label>'+t.validationDialog.labels.hintMessage+':<\/label><\/div><div class="k-edit-field"><input class="k-textbox" placeholder="'+t.validationDialog.placeholders.typeMessage+'" data-bind="value: hintMessage" /><\/div><\/div><\/div><div class="k-action-buttons"><button class="k-button" data-bind="visible: showRemove, click: remove">'+t.remove+'<\/button><button class="k-button k-primary" data-bind="click: apply">'+t.apply+'<\/button><button class="k-button" data-bind="click: close">'+t.cancel+"<\/button><\/div><\/div>"},open:function(t){var r=this.options,u;this.viewModel=new g({type:r.type,defaultHintMessage:r.hintMessage,defaultHintTitle:r.hintTitle,defaultComparers:r.comparers.slice(0),comparerMessages:r.comparerMessages,criteria:r.criteria.slice(0),criterion:r.criterion,apply:this.apply.bind(this),close:this.close.bind(this),remove:this.remove.bind(this)});this.viewModel.update(t.validation());i.fn.open.call(this);u=this.dialog().element;n.bind(u,this.viewModel)},apply:function(){i.fn.apply.call(this);this.trigger("action",{command:"EditValidationCommand",options:{value:this.viewModel.toValidationObject()}})},remove:function(){this.viewModel.set("criterion","any");this.apply()}});n.spreadsheet.dialogs.register("validation",h);n.spreadsheet.dialogs.ValidationDialog=h;c=i.extend({init:function(t){i.fn.init.call(this,t);this.viewModel=n.observable({name:this.options.name,extension:this.options.extension,fileFormats:this.options.fileFormats,fileName:function(){return this.name+this.extension},apply:this.apply.bind(this),close:this.close.bind(this)});n.bind(this.dialog().element,this.viewModel)},options:{title:t.saveAsDialog.title,name:"Workbook",extension:".xlsx",editExtension:!0,fileFormats:[{description:"Excel Workbook (.xlsx)",extension:".xlsx"}],width:350,template:"<div class='k-edit-label'><label>"+t.saveAsDialog.labels.fileName+":<\/label><\/div><div class='k-edit-field'><input class='k-textbox' data-bind='value: name' /><\/div><div data-bind='visible: editExtension'><div class='k-edit-label'><label>"+t.saveAsDialog.labels.saveAsType+":<\/label><\/div><div class='k-edit-field'><select data-role='dropdownlist' class='k-file-format' data-text-field='description' data-value-field='extension' data-bind='value: extension, source: fileFormats' /><\/div><\/div><div class='k-action-buttons'><button class='k-button k-primary' data-bind='click: apply'>"+t.save+"<\/button><button class='k-button' data-bind='click: close'>"+t.cancel+"<\/button><\/div>"},apply:function(){i.fn.apply.call(this);this.trigger("action",{command:"SaveAsCommand",options:{fileName:this.viewModel.fileName()}})}});n.spreadsheet.dialogs.register("saveAs",c);nt=c.extend({options:{title:t.excelExportDialog.title,editExtension:!1}});n.spreadsheet.dialogs.register("excelExport",nt);tt=e.extend({init:function(n){i.fn.init.call(this,n)},options:{template:t.modifyMergedDialog.errorMessage+"<div class=\"k-action-buttons\"><button class='k-button k-primary' data-bind='click: close, text: okText' /><\/div>"}});n.spreadsheet.dialogs.register("modifyMerged",tt);it=e.extend({init:function(n){i.fn.init.call(this,n)},options:{title:t.useKeyboardDialog.title,template:t.useKeyboardDialog.errorMessage+"<div>Ctrl+C "+t.useKeyboardDialog.labels.forCopy+"<\/div><div>Ctrl+X "+t.useKeyboardDialog.labels.forCut+"<\/div><div>Ctrl+V "+t.useKeyboardDialog.labels.forPaste+"<\/div><div class=\"k-action-buttons\"><button class='k-button k-primary' data-bind='click: close, text: okText' /><\/div>"}});n.spreadsheet.dialogs.register("useKeyboard",it);rt=e.extend({init:function(n){i.fn.init.call(this,n)},options:{template:t.unsupportedSelectionDialog.errorMessage+"<div class=\"k-action-buttons\"><button class='k-button k-primary' data-bind='click: close, text: okText' /><\/div>"}});n.spreadsheet.dialogs.register("unsupportedSelection",rt)}})(window.kendo)}(),function(){(function(n){if(!n.support.browser.msie||!(n.support.browser.version<9)){var t=n.Class.extend({init:function(n){this.options=$.extend({},this.options,n);this.columns=this._normalizeColumns(this.options.columns);this._sheet();this._dataSource();this._header();this.dataSource.fetch()},_sheet:function(){this.sheet=this.options.sheet;this._sheetChangeHandler=this._sheetChange.bind(this);this._sheetDeleteRowHandler=this._sheetDeleteRow.bind(this);this._sheetInsertRowHandler=this._sheetInsertRow.bind(this);this.sheet.bind("change",this._sheetChangeHandler).bind("deleteRow",this._sheetDeleteRowHandler).bind("insertRow",this._sheetInsertRowHandler)},_sheetInsertRow:function(n){n.index!==undefined&&this.dataSource.insert(Math.max(n.index-1,0),{})},_sheetDeleteRow:function(n){if(n.index!==undefined){var t=this.dataSource,i=t.view()[n.index-1];i&&t.remove(i)}},_header:function(){this.sheet.batch(function(){this.columns.forEach(function(n,t){this.sheet.range(0,t).value(n.title)}.bind(this))}.bind(this))},_sheetChange:function(n){if(n.recalc&&n.ref){var r=this.dataSource,t=r.view(),i=this.columns;!i.length&&t.length&&(i=Object.keys(t[0].toJSON()));this._skipRebind=!0;n.ref.forEach(function(u){var f,o,e;for(u=u.toRangeRef(),f=u.topLeft.row;f<=u.bottomRight.row;f++)for(o=t[f-1],o||(o=r.insert(f-1,{}),t=r.view()),e=u.topLeft.col;e<=u.bottomRight.col&&e<i.length;e++)o.set(i[e].field,n.value)});this._skipRebind=!1}},_normalizeColumns:function(n){return n.map(function(n){var t=n.field||n;return{field:t,title:n.title||t}})},_dataSource:function(){var i=this.options,t=i.dataSource;t=Array.isArray(t)?{data:t}:t;this.dataSource&&this._changeHandler?this.dataSource.unbind("change",this._changeHandler):this._changeHandler=this._change.bind(this);this.dataSource=n.data.DataSource.create(t).bind("change",this._changeHandler)},_change:function(){var t,i,r;this._skipRebind||(t=this.dataSource.view(),i=this.columns,!i.length&&t.length&&(this.columns=i=this._normalizeColumns(Object.keys(t[0].toJSON())),this._header()),r=i.map(function(t){return n.getter(t.field)}),this.sheet.batch(function(){for(var i,n=0,u=t.length;n<u;n++)for(i=0;i<r.length;i++)this.sheet.range(n+1,i).value(r[i](t[n]))}.bind(this)))},destroy:function(){this.dataSource.unbind("change",this._changeHandler);this.sheet.unbind("change",this._sheetChangeHandler).unbind("deleteRow",this._sheetDeleteRowHandler).unbind("insertRow",this._sheetInsertRowHandler)},options:{columns:[]}});n.spreadsheet.SheetDataSourceBinder=t}})(kendo)}(),function(){(function(n){function h(n){for(var i={},r=[],t=0;t<n.length;t++)i[n[t].value]||(i[n[t].value]=!0,r.push(n[t]));return r}function c(n){var u=f.operators,r=[],t,i;for(t in n)for(i in n[t])r.push({text:u[t][i],value:i,unique:t+"_"+i,type:t});return r}var e,t;if(!n.support.browser.msie||!(n.support.browser.version<9)){var i=n.jQuery,u=n.ui.Widget,r={details:"k-details",button:"k-button",detailsSummary:"k-details-summary",detailsContent:"k-details-content",icon:"k-icon k-font-icon",iconCollapse:"k-i-collapse-se",iconExpand:"k-i-expand-e",iconSearch:"k-i-search",textbox:"k-textbox",wrapper:"k-spreadsheet-filter-menu",filterByCondition:"k-spreadsheet-condition-filter",filterByValue:"k-spreadsheet-value-filter",valuesTreeViewWrapper:"k-spreadsheet-value-treeview-wrapper",actionButtons:"k-action-buttons"},o=u.extend({init:function(r,f){u.fn.init.call(this,r,f);this.element.addClass(t.classNames.details);this._summary=this.element.find("."+t.classNames.detailsSummary).on("click",this._toggle.bind(this));var e=f.expanded?t.classNames.iconCollapse:t.classNames.iconExpand;this._icon=i("<span />",{"class":t.classNames.icon+" "+e}).prependTo(this._summary);this._container=n.wrap(this._summary.next(),!0);f.expanded||this._container.hide()},options:{name:"Details"},events:["toggle"],visible:function(){return this.options.expanded},toggle:function(i){var r=n.fx(this._container).expand("vertical");r.stop()[i?"reverse":"play"]();this._icon.toggleClass(t.classNames.iconExpand,i).toggleClass(t.classNames.iconCollapse,!i);this.options.expanded=!i},_toggle:function(){var n=this.visible();this.toggle(n);this.trigger("toggle",{show:n})}}),f=n.spreadsheet.messages.filterMenu={sortAscending:"Sort range A to Z",sortDescending:"Sort range Z to A",filterByValue:"Filter by value",filterByCondition:"Filter by condition",apply:"Apply",search:"Search",clear:"Clear",blanks:"(Blanks)",operatorNone:"None",and:"AND",or:"OR",operators:{string:{contains:"Text contains",doesnotcontain:"Text does not contain",startswith:"Text starts with",endswith:"Text ends with"},date:{eq:"Date is",neq:"Date is not",lt:"Date is before",gt:"Date is after"},number:{eq:"Is equal to",neq:"Is not equal to",gte:"Is greater than or equal to",gt:"Is greater than",lte:"Is less than or equal to",lt:"Is less than"}}},s={filterByValue:"<div class='"+r.detailsSummary+"'>#= messages.filterByValue #<\/div><div class='"+r.detailsContent+"'><div class='"+r.valuesTreeViewWrapper+"'><div data-#=ns#role='treeview' data-#=ns#checkboxes='{ checkChildren: true }' data-#=ns#bind='events: { check: valuesChange, select: valueSelect }' /><\/div><\/div>",filterByCondition:"<div class='"+r.detailsSummary+"'>#= messages.filterByCondition #<\/div><div class='"+r.detailsContent+'\'><select data-#=ns#role="dropdownlist"data-#=ns#bind="value: customFilter.criteria[0].operator, source: operators"data-value-primitive="false"data-option-label="#=messages.operatorNone#"data-height="auto"data-text-field="text"data-value-field="unique"><\/select><input data-#=ns#bind="value: customFilter.criteria[0].value" class="k-textbox" /><\/div>',menuItem:"<li data-command='#=command#' data-dir='#=dir#'><span class='k-icon k-font-icon k-i-#=iconClass#'><\/span>#=text#<\/li>",actionButtons:"<button data-#=ns#bind='click: apply' class='k-button k-primary'>#=messages.apply#<\/button><button data-#=ns#bind='click: clear' class='k-button'>#=messages.clear#<\/button>"};e=n.spreadsheet.FilterMenuViewModel=n.data.ObservableObject.extend({valuesChange:function(t){var u=function(n){return n.checked&&n.value},f=function(t){return t.dataType==="date"?n.spreadsheet.dateToNumber(t.value):t.value},e=t.sender.dataSource.data(),i=e[0].children.data().toJSON(),r=i.filter(function(n){return n.dataType==="blank"});r=r.length?r[0].checked:!1;i=i.filter(u).map(f);this.set("valueFilter",{values:i,blanks:r})},valueSelect:function(n){n.preventDefault();var t=n.sender.dataItem(n.node);t.set("checked",!t.checked)},validateCriteria:function(t){return t.filter(function(t){var i=t.operator.type;return i==="number"?!!n.parseFloat(t.value):i==="date"?!!n.parseDate(t.value):i==="string"?!!t.value.toString():!1})},normalizeCriteria:function(t){return t.map(function(t){return t.type=t.operator.type,t.operator=t.operator.value,t.value=t.type==="number"?n.parseFloat(t.value):t.type==="date"?n.parseDate(t.value):t.value.toString(),t})},buildCustomFilter:function(){var n=this.customFilter.toJSON();return n.criteria=this.validateCriteria(n.criteria),n.criteria=this.normalizeCriteria(n.criteria),n},reset:function(){this.set("customFilter",{logic:"and",criteria:[{operator:null,value:null}]});this.set("valueFilter",{values:[]})}});t=u.extend({init:function(n){var r=i("<div />",{"class":t.classNames.wrapper}).appendTo(document.body);u.call(this,r,n);this.viewModel=new e({active:"value",operators:c(this.options.operators),clear:this.clear.bind(this),apply:this.apply.bind(this)});this._setFilter();this._popup();this._sort();this._filterByCondition();this._filterByValue();this._actionButtons()},options:{name:"FilterMenu",column:0,range:null,operators:{string:{contains:"Text contains",doesnotcontain:"Text does not contain",startswith:"Text starts with",endswith:"Text ends with"},date:{eq:"Date is",neq:"Date is not",lt:"Date is before",gt:"Date is after"},number:{eq:"Is equal to",neq:"Is not equal to",gte:"Is greater than or equal to",gt:"Is greater than",lte:"Is less than or equal to",lt:"Is less than"}}},events:["action"],destroy:function(){u.fn.destroy.call(this);this.menu.destroy();this.valuesTreeView.destroy();this.popup.destroy()},openFor:function(n){this.popup.setOptions({anchor:n});this.popup.open()},close:function(){this.popup.close()},clear:function(){this.action({command:"ClearFilterCommand",options:{column:this.options.column}});this.viewModel.reset();this.close()},apply:function(){this._active();var t={operatingRange:this.options.range,column:this.options.column},n,i;this.viewModel.active==="value"?(this.viewModel.valuesChange({sender:this.valuesTreeView}),n=this.viewModel.valueFilter.toJSON(),n.values&&n.values.length&&(t.valueFilter=n)):this.viewModel.active==="custom"&&(i=this.viewModel.buildCustomFilter(),i.criteria.length&&(t.customFilter=i));this.action({command:"ApplyFilterCommand",options:t})},action:function(n){this.trigger("action",i.extend({},n))},getValues:function(){var t=[],i=f,r=this.options.column,u=this.options.range.resize({top:1}).column(r),e=this.options.range.sheet();return u.forEachCell(function(r,u,f){var o;f.dataType=f.value===undefined?"blank":f.format?n.spreadsheet.formatting.type(f.value,f.format):typeof f.value;f.value!==null&&f.format?(o=n.spreadsheet.formatting.compile(f.format),f.text=o(f.value).text()):f.text=f.value?f.value:i.blanks;f.dataType==="date"&&(f.value=n.spreadsheet.numberToDate(f.value));f.checked=!e.isHiddenRow(r);t.push(f)}),t=h(t),t.sort(function(n,t){return n.dataType===t.dataType?0:n.dataType==="blank"||t.dataType==="blank"?n.dataType==="blank"?-1:1:n.dataType==="number"||t.dataType==="number"?n.dataType==="number"?-1:1:n.dataType==="date"||t.dataType==="date"?n.dataType==="date"?-1:1:0}),[{text:"All",expanded:!0,checked:!0,items:t}]},_setFilter:function(){var f=this.options.column,e=this.options.range.sheet(),i=e.filter(),t,n,r,u;i&&(i=i.columns.filter(function(n){return n.index===f})[0]);i?(t=i.filter.toJSON(),t.filter==="custom"&&(n=t.criteria.pop(),typeof n.operator=="string"?(r=n.value instanceof Date?"date":typeof n.value,u=n.operator,t.criteria.push({operator:{text:this.options.operators[r][u],type:r,value:u,unique:r+"_"+u},value:n.value})):t.criteria.push({operator:{text:this.options.operators[n.type][n.operator],type:n.type,value:n.operator,unique:n.type+"_"+n.operator},value:n.value})),this.viewModel.set("active",t.filter),this.viewModel.set(t.filter+"Filter",t)):this.viewModel.reset()},_popup:function(){this.popup=this.element.kendoPopup({copyAnchorStyles:!1}).data("kendoPopup")},_sort:function(){var u=n.template(t.templates.menuItem),r=f,e=[{command:"sort",dir:"asc",text:r.sortAscending,iconClass:"sort-asc"},{command:"sort",dir:"desc",text:r.sortDescending,iconClass:"sort-desc"}],o=i("<ul />",{html:n.render(u,e)}).appendTo(this.element);this.menu=o.kendoMenu({orientation:"vertical",select:function(n){var r=i(n.item).data("dir")==="asc",t=this.options.range.resize({top:1}),u={asc:r,sheet:!1,operatingRange:t};t.isSortable()?this.action({command:"SortCommand",options:u}):this.close()}.bind(this)}).data("kendoMenu")},_appendTemplate:function(t,r,u,e){var h=n.template(t),s=i("<div class='"+r+"'/>").html(h({messages:f,ns:n.ns}));return this.element.append(s),u&&(u=new o(s,{expanded:e,toggle:this._detailToggle.bind(this)})),n.bind(s,this.viewModel),s},_detailToggle:function(n){this.element.find("[data-role=details]").not(n.sender.element).data("kendoDetails").toggle(!n.show)},_filterByCondition:function(){var n=this.viewModel.active==="custom";this._appendTemplate(t.templates.filterByCondition,t.classNames.filterByCondition,!0,n)},_filterByValue:function(){var n=this.viewModel.active==="value",i=this._appendTemplate(t.templates.filterByValue,t.classNames.filterByValue,!0,n);this.valuesTreeView=i.find("[data-role=treeview]").data("kendoTreeView");this.valuesTreeView.setDataSource(this.getValues())},_actionButtons:function(){this._appendTemplate(t.templates.actionButtons,t.classNames.actionButtons,!1)},_active:function(){var n=this.element.find("[data-role=details]").filter(function(n,t){return i(t).data("kendoDetails").visible()});n.hasClass(t.classNames.filterByValue)?this.viewModel.set("active","value"):n.hasClass(t.classNames.filterByCondition)&&this.viewModel.set("active","custom")}});n.spreadsheet.FilterMenu=t;i.extend(!0,t,{classNames:r,templates:s})}})(window.kendo)}(),function(){(function(n){function i(n,t){return n&&(n.top!==t.top||n.left!==t.left)}if(!n.support.browser.msie||!(n.support.browser.version<9)){var t=n.Observable.extend({init:function(t){n.Observable.fn.init.call(this);this.view=t;this.formulaBar=t.formulaBar;this.barInput=t.formulaBar.formulaInput;this.cellInput=t.formulaInput;this.barInput.syncWith(this.cellInput);this.cellInput.syncWith(this.barInput);this.barInput.bind("keyup",this._triggerUpdate.bind(this));this.cellInput.bind("keyup",this._triggerUpdate.bind(this))},events:["activate","deactivate","change","update"],_triggerUpdate:function(){this.trigger("update",{value:this.value()})},activeEditor:function(){var t=null,i=n._activeElement();return this.barElement()[0]===i?t=this.barInput:this.cellElement()[0]===i&&(t=this.cellInput),t},activate:function(n){return this._active=!0,this._rect=n.rect,this.cellInput.position(n.rect),this.cellInput.resize(n.rect),this.cellInput.tooltip(n.tooltip),this.trigger("activate"),this},deactivate:function(){var n=this.cellInput;this._active&&(this._active=!1,this._rect=null,n.hide(),n.value()!=this._value&&this.trigger("change",{value:n.value()}),this.trigger("deactivate"))},barElement:function(){return this.barInput.element},cellElement:function(){return this.cellInput.element},focus:function(n){n=n||"cell";n==="cell"?(this.cellInput.element.focus(),this.cellInput.end()):this.barInput.element.focus()},isActive:function(){return this._active},isFiltered:function(){return this.barInput.popup.visible()||this.cellInput.popup.visible()},canInsertRef:function(n){var t=this.activeEditor();return t&&t.canInsertRef(n)},highlightedRefs:function(){var n=this.activeEditor(),t=[];return n&&(t=n.highlightedRefs()),t},scale:function(){this.cellInput.scale()},toggleTooltip:function(n){this.cellInput.toggleTooltip(i(this._rect,n))},value:function(n){if(n===undefined)return this.barInput.value();n===null&&(n="");this._value=n;this.barInput.value(n);this.cellInput.value(n)}});n.spreadsheet.SheetEditor=t}})(kendo)}(),function(){"use strict";function u(n){for(var i,h,f,c,r=n.length,e=(r+1)/2,o=n.reduce(function(n,t){return n+t},0)/r,s=0,u=0,t=0;t<r;t++)i=t+1-e,h=n[t]-o,s+=i*h,u+=i*i;return u?(f=s/u,c=o-f*e,function(n){return c+f*(n+1)}):function(t){return n[t%n.length]}}function s(n){function e(n){for(var i=n[1]-n[0],t=2;t<n.length;++t)if(n[t]-n[t-1]!=i)return null;return i}function i(n){return n.map(function(n){return n.number})}var f=[],t=n.map(function(n){return n.formula||n.value});return c(t,function(r,o,s,h){var l,c,v,y,a;for(s=="number"?(c=i(h),c.length==1&&(r>0||o<t.length||n[r].format)&&c.push(c[0]+1),l=u(c)):s=="string"||s=="formula"?l=function(n,i){return t[i]}:Array.isArray(s)?h.length==1?l=function(n){return s[(h[0].number+n)%s.length]}:(v=e(i(h)),l=v==null?function(n){return h[n%h.length].value}:function(n){var t=h[0].number+v*n;return s[t%s.length]}):s!="null"?(c=i(h),c.length==1&&c.push(c[0]+1),c=u(c),l=function(n,i){return t[i].replace(/^(.*\D)\d+/,"$1"+c(n,i))}):l=function(){return null},y={f:l,begin:r,end:o,len:o-r},a=r;a<o;++a)f[a]=y}),function(i,u){var e=f[u],c=i/t.length|0,l=i%t.length,a=c*e.len+l-e.begin,o=e.f(a,u),s=h(n[u]);return o instanceof r?s.formula=o:s.value=o,s}}function h(n){var t={};return Object.keys(n||{}).forEach(function(i){t[i]=n[i]}),t}function c(n,t){for(var r=null,u=0,e=[],f,i=0;i<n.length;++i)f=l(n[i]),e.push(f),r!=null&&f.type!==r.type&&(t(u,i,r.type,e.slice(u,i)),u=i),r=f;t(u,i,r.type,e.slice(u,i))}function l(n){var i,t;if(typeof n=="number")return{type:"number",number:n};if(typeof n=="string")return(i=v(n),i)?i:(t=/^(.*\D)(\d+)/.exec(n),t)?(n=n.replace(/^(.*\D)\d+/,"$1-######"),{type:n,match:t,number:parseFloat(t[2])}):{type:"string"};if(typeof n=="boolean")return{type:"boolean"};if(n==null)return{type:"null"};if(n instanceof r)return{type:"formula"};window.console.error(n);throw new Error("Cannot fill data");}function a(){var n=kendo.culture();return[n.calendars.standard.days.namesAbbr,n.calendars.standard.days.names,n.calendars.standard.months.namesAbbr,n.calendars.standard.months.names]}function v(n){for(var t,i,f,e=n.toLowerCase(),u=a(),r=0;r<u.length;++r)for(t=u[r],i=t.length;--i>=0;)if(f=t[i].toLowerCase(),f==e)return{type:t,number:i,value:n}}function f(n){for(var i,u=n.length,f=n[0].length,r=[],t=0;t<f;++t)for(r[t]=[],i=0;i<u;++i)r[t][i]=n[i][t];return r}if(!kendo.support.browser.msie||!(kendo.support.browser.version<9)){var t=kendo.spreadsheet,i=t.Range,e=t.calc.runtime,r=e.Formula,n="Incompatible ranges in fillFrom",o="Cannot determine fill direction";i.prototype._previewFillFrom=function(t,i){var w=this,b=w._sheet,u,r,c,p,h,l,a,v,e,k,d;if(typeof t=="string"&&(t=b.range(t)),u=t._ref.toRangeRef(),r=w._ref.toRangeRef(),u.intersects(r)){if(u.eq(r))return null;if(r=r.clone(),u.topLeft.eq(r.topLeft))if(u.width()==r.width())r.topLeft.row+=u.height(),i=0;else if(u.height()==r.height())r.topLeft.col+=u.width(),i=1;else throw new Error(n);else if(u.bottomRight.eq(r.bottomRight))if(u.width()==r.width())r.bottomRight.row-=u.height(),i=2;else if(u.height()==r.height())r.bottomRight.col-=u.width(),i=3;else throw new Error(n);else throw new Error(n);return b.range(r)._previewFillFrom(t,i)}if(i==null)if(u.topLeft.col==r.topLeft.col)i=u.topLeft.row<r.topLeft.row?0:2;else if(u.topLeft.row==r.topLeft.row)i=u.topLeft.col<r.topLeft.col?1:3;else throw new Error(o);if(c=i&1,p=i&2,c&&u.height()!=r.height()||!c&&u.width()!=r.width())throw new Error(n);for(h=t._properties(),c?l=r.width():(h=f(h),l=r.height()),a=new Array(h.length),v=0;v<h.length;++v){var y=h[v],g=s(y),nt=a[v]=new Array(l);for(e=0;e<l;++e)k=p?-e-1:y.length+e,d=p?y.length-e%y.length-1:e%y.length,nt[p?l-e-1:e]=g(k,d)}return c||(a=f(a)),{props:a,direction:i,dest:w}};i.prototype.fillFrom=function(n,t){var i=this._previewFillFrom(n,t);return i.dest._properties(i.props),i.dest}}}(),function(){(function(n,t){if(!n.support.browser.msie||!(n.support.browser.version<9)){var i=n.jQuery,o=n.ui.Widget,u=n.spreadsheet.Workbook,s=n.spreadsheet.Controller,h=n.spreadsheet.View,f=".kendoSpreadsheet",e={recalc:!0,selection:!0,activeCell:!0,layout:!0,sheetSelection:!0,resize:!0},r=n.ui.Widget.extend({init:function(n,t){o.fn.init.call(this,n,t);this.element.addClass(r.classNames.wrapper);this._view=new h(this.element,{toolbar:this.options.toolbar,sheetsbar:this.options.sheetsbar});this._workbook=new u(this.options,this._view);this._controller=new s(this._view,this._workbook);this._autoRefresh=!0;this._bindWorkbookEvents();this._view.workbook(this._workbook);this.refresh();this._resizeHandler=function(){this.resize()}.bind(this);i(window).on("resize"+f,this._resizeHandler)},_resize:function(){this.refresh({layout:!0})},_workbookChange:function(n){this._autoRefresh&&this.refresh(n)},activeSheet:function(n){return this._workbook.activeSheet(n)},moveSheetToIndex:function(n,t){return this._workbook.moveSheetToIndex(n,t)},insertSheet:function(n){return this._workbook.insertSheet(n)},sheets:function(){return this._workbook.sheets()},removeSheet:function(n){return this._workbook.removeSheet(n)},sheetByName:function(n){return this._workbook.sheetByName(n)},sheetIndex:function(n){return this._workbook.sheetIndex(n)},sheetByIndex:function(n){return this._workbook.sheetByIndex(n)},renameSheet:function(n,t){return this._workbook.renameSheet(n,t)},refresh:function(n){return n||(n=e),this._view.sheet(this._workbook.activeSheet()),this._controller.sheet(this._workbook.activeSheet()),this._workbook.refresh(n),this._view.refresh(n),this._controller.refresh(),this._view.render(),this.trigger("render"),this},openDialog:function(n,t){return this._view.openDialog(n,t)},autoRefresh:function(n){return n!==t?(this._autoRefresh=n,n===!0&&this.refresh(),this):this._autoRefresh},toJSON:function(){return this._workbook.toJSON()},fromJSON:function(n){n.sheets?(this._workbook.destroy(),this._workbook=new u(i.extend({},this.options,n)),this._bindWorkbookEvents(),this._view.workbook(this._workbook),this._controller.workbook(this._workbook),this.activeSheet(this.activeSheet())):this.refresh()},saveAsExcel:function(n){this._workbook.saveAsExcel(n)},_workbookExcelExport:function(n){this.trigger("excelExport",n)&&n.preventDefault()},_bindWorkbookEvents:function(){this._workbook.bind("change",this._workbookChange.bind(this));this._workbook.bind("excelExport",this._workbookExcelExport.bind(this))},destroy:function(){n.ui.Widget.fn.destroy.call(this);this._workbook.destroy();this._controller.destroy();this._view.destroy();this._resizeHandler&&i(window).off("resize"+f,this._resizeHandler)},options:{name:"Spreadsheet",toolbar:!0,sheetsbar:!0,rows:200,columns:50,rowHeight:20,columnWidth:64,headerHeight:20,headerWidth:32,excel:{proxyURL:"",fileName:"Workbook.xlsx"}},events:["excelExport","render"]});n.spreadsheet.ALL_REASONS=e;n.ui.plugin(r);i.extend(!0,r,{classNames:{wrapper:"k-widget k-spreadsheet"}})}})(window.kendo)}(),function(){(function(n){function l(n){for(var i,t=0,r=n.length;t<r;t++)if(n[t].type==2){i=!0;break}i&&n.splice(t+1,0,{caption:"KPIs",defaultHierarchy:"[KPIs]",name:"KPIs",uniqueName:"[KPIs]"})}function o(n){return{name:n.uniqueName,type:n.type}}function a(n){for(var t=0,i=n.length;t<i;t++)n[t].uniqueName=n[t].name,n[t].type="kpi";return n}function s(t){var i=n(t).closest(".k-pivot-setting");return i.length?i.data("kendoPivotSettingTarget"):null}function i(n,t,i){return{hierarchyUniqueName:n,uniqueName:t,caption:t,measure:t,name:t,type:i,kpi:!0}}function h(n){var t=n.name;return[i(t,n.value,"value"),i(t,n.goal,"goal"),i(t,n.status,"status"),i(t,n.trend,"trend")]}var t=window.kendo,e=t.ui,r=e.Widget,u=".kendoPivotConfigurator",c="mouseenter"+u+" mouseleave"+u,f=t.template('<p class="k-reset"><span class="k-icon #=icon#"><\/span>${name}<\/p><div class="k-list-container k-reset"/>'),v=r.extend({init:function(n,i){r.fn.init.call(this,n,i);this.element.addClass("k-widget k-fieldselector k-alt k-edit-form-container");this._dataSource();this._layout();this.refresh();t.notify(this)},events:[],options:{name:"PivotConfigurator",filterable:!1,sortable:!1,messages:{measures:"Drop Data Fields Here",columns:"Drop Column Fields Here",rows:"Drop Rows Fields Here",measuresLabel:"Measures",columnsLabel:"Columns",rowsLabel:"Rows",fieldsLabel:"Fields"}},_dataSource:function(){var i=this;i.dataSource&&i._refreshHandler?i.dataSource.unbind("change",i._refreshHandler).unbind("error",i._errorHandler).unbind("progress",i._progressHandler):(i._errorHandler=n.proxy(i._error,i),i._refreshHandler=n.proxy(i.refresh,i),i._progressHandler=n.proxy(i._requestStart,i));i.dataSource=t.data.PivotDataSource.create(i.options.dataSource);i.dataSource.bind("change",i._refreshHandler).bind("error",i._errorHandler).bind("progress",i._progressHandler)},setDataSource:function(n){this.options.dataSource=n;this._dataSource();this.measures&&this.measures.setDataSource(n);this.rows&&this.rows.setDataSource(n);this.columns&&this.columns.setDataSource(n);this.refresh()},_treeViewDataSource:function(){var i=this;return t.data.HierarchicalDataSource.create({schema:{model:{id:"uniqueName",hasChildren:function(n){return!("hierarchyUniqueName"in n)&&!("aggregator"in n)}}},transport:{read:function(t){var r,u,f;n.isEmptyObject(t.data)?(r=i.dataSource.schemaDimensions(),r.done(function(n){i.dataSource.cubeBuilder||l(n);t.success(n)}).fail(t.error)):(u=i.treeView.dataSource.get(t.data.uniqueName),u.uniqueName==="[KPIs]"?(f=!0,r=i.dataSource.schemaKPIs(),r.done(function(n){t.success(a(n))}).fail(t.error)):u.type=="kpi"&&(f=!0,t.success(h(u))),f||(r=u.type==2?i.dataSource.schemaMeasures():u.dimensionUniqueName?i.dataSource.schemaLevels(t.data.uniqueName):i.dataSource.schemaHierarchies(t.data.uniqueName),r.done(t.success).fail(t.error)))}}})},_progress:function(n){t.ui.progress(this.element,n)},_error:function(){this._progress(!1)},_requestStart:function(){this._progress(!0)},_layout:function(){this.form=n('<div class="k-columns k-state-default k-floatwrap"/>').appendTo(this.element);this._fields();this._targets()},_fields:function(){var t=n('<div class="k-state-default"><p class="k-reset"><span class="k-icon k-i-group"><\/span>'+this.options.messages.fieldsLabel+"<\/p><\/div>").appendTo(this.form);this.treeView=n("<div/>").appendTo(t).kendoTreeView({template:'# if (item.type == 2 || item.uniqueName == "[KPIs]") { #<span class="k-icon k-i-#= (item.type == 2 ? "sum" : "kpi") #"><\/span># } else if (item.type && item.type !== "kpi") { #<span class="k-icon k-i-dimension"><\/span># } ##: item.caption || item.name #',dataTextField:"caption",dragAndDrop:!0,autoBind:!1,dataSource:this._treeViewDataSource(),dragstart:function(n){var t=this.dataItem(n.sourceNode);(t.hasChildren||t.aggregator||t.measure)&&t.type!=2&&t.uniqueName!=="[KPIs]"||n.preventDefault()},drag:function(n){var t="k-denied",i=s(n.dropTarget);i&&i.validate(this.dataItem(n.sourceNode))&&(t="k-add");n.setStatusClass(t)},drop:function(n){n.preventDefault();var u=s(n.dropTarget),t=this.dataItem(n.sourceNode),r,e,f,i;if(u&&u.validate(t)){if(i=t.defaultHierarchy||t.uniqueName,t.type==="kpi")for(f=h(t),e=f.length,i=[],r=0;r<e;r++)i.push(o(f[r]));else t.kpi&&(i=[o(t)]);u.add(i)}}}).data("kendoTreeView")},_createTarget:function(i,r){var f='<li class="k-item k-header" data-'+t.ns+'name="${data.name}">${data.name}',e=r.sortable,u="";return e&&(u+="#if (data.sortIcon) {#",u+='<span class="k-icon ${data.sortIcon} k-setting-sort"><\/span>',u+="#}#"),(r.filterable||e)&&(u+='<span class="k-icon k-i-arrowhead-s k-setting-fieldmenu"><\/span>'),u+='<span class="k-icon k-si-close k-setting-delete"><\/span>',f+='<span class="k-field-actions">'+u+"<\/span><\/li>",new t.ui.PivotSettingTarget(i,n.extend({dataSource:this.dataSource,hint:function(t){var i=n('<div class="k-fieldselector"><ul class="k-list k-reset"><\/ul><\/div>');return i.find(".k-list").append(t.clone()),i},template:f,emptyTemplate:'<li class="k-item k-empty">${data}<\/li>'},r))},_targets:function(){var i=n('<div class="k-state-default"/>').appendTo(this.form),o=n(f({name:this.options.messages.columnsLabel,icon:"k-i-vbars"})).appendTo(i),r=n('<ul class="k-pivot-configurator-settings k-list k-reset" />').appendTo(o.last()),s=n(f({name:this.options.messages.rowsLabel,icon:"k-i-hbars"})).appendTo(i),u=n('<ul class="k-pivot-configurator-settings k-list k-reset" />').appendTo(s.last()),h=n(f({name:this.options.messages.measuresLabel,icon:"k-i-sum"})).appendTo(i),e=n('<ul class="k-pivot-configurator-settings k-list k-reset" />').appendTo(h.last()),t=this.options;this.columns=this._createTarget(r,{filterable:t.filterable,sortable:t.sortable,connectWith:u,messages:{empty:t.messages.columns,fieldMenu:t.messages.fieldMenu}});this.rows=this._createTarget(u,{filterable:t.filterable,setting:"rows",connectWith:r,messages:{empty:this.options.messages.rows,fieldMenu:this.options.messages.fieldMenu}});this.measures=this._createTarget(e,{setting:"measures",messages:{empty:t.messages.measures}});r.add(u).add(e).on(c,".k-item:not(.k-empty)",this._toggleHover)},_toggleHover:function(t){n(t.currentTarget).toggleClass("k-state-hover",t.type==="mouseenter")},_resize:function(){var t=this.element,n=this.options.height,r,i;n&&(t.height(n),t.is(":visible")&&(i=t.children(".k-columns").children("div.k-state-default"),n=t.innerHeight(),r=(t.outerHeight()-n)/2,n=n-(i.outerHeight(!0)-i.height())-r,i.height(n)))},refresh:function(){var n=this.dataSource;(n.cubeBuilder||this._cube!==n.cube()||this._catalog!==n.catalog())&&this.treeView.dataSource.fetch();this._catalog=this.dataSource.catalog();this._cube=this.dataSource.cube();this._resize();this._progress(!1)},destroy:function(){r.fn.destroy.call(this);this.dataSource.unbind("change",this._refreshHandler);this.form.find(".k-list").off(u);this.rows.destroy();this.columns.destroy();this.measures.destroy();this.treeView.destroy();this.element=null;this._refreshHandler=null}});e.plugin(v)})(window.kendo.jQuery)}(),function(){(function(n,t,i){"use strict";function g(n){var t=s;try{return s=function(n){return n()},n()}finally{s=t}}function u(t,r,u,f,e,o){function k(){var v,i,w,o,s,h,l;return u.kRebind&&(v=n(n(r)[0].cloneNode(!0))),y=p(t,r,u,f,a).options,r.is("select")&&function(t){if(t.length>0){var i=n(t[0]);!/\S/.test(i.text())&&/^\?/.test(i.val())&&i.remove()}}(r[0].options),i=a.call(r,c=y).data(f),ft(i,t,u,f,e),t.$emit("kendoWidgetCreated",i),w=ht(t,i),u.kRebind&&lt(i,t,r,v,u.kRebind,w,u),u.kNgDisabled&&(o=u.kNgDisabled,s=t.$eval(o),s&&i.enable(!s),rt(i,t,r,o)),u.kNgReadonly&&(h=u.kNgReadonly,l=t.$eval(h),l&&i.readonly(l),ut(i,t,r,h)),u.kNgModel&&st(i,t,u.kNgModel),g&&ot(i,t,r,g,at),i&&ct(i,r),i}var h,d,l,y,w,v,nt,tt,it,et,b;if(!(r instanceof jQuery))throw new Error("The Kendo UI directives require jQuery to be available before AngularJS. Please include jquery before angular in the document.");h=u.kNgDelay;d=t.$eval(h);o=o||[];var g=o[0],at=o[1],a=n(r)[f];if(!a)return window.console.error("Could not find: "+f),null;if(l=p(t,r,u,f,a),y=l.options,l.unresolved.length){for(w=[],v=0,nt=l.unresolved.length;v<nt;v++)tt=l.unresolved[v],it=n.Deferred(function(n){var r=t.$watch(tt.path,function(t){t!==i&&(r(),n.resolve())})}).promise(),w.push(it);n.when.apply(null,w).then(k);return}if(h&&!d){et=t.$root||t;b=function(){var n=t.$watch(h,function(t){t!==i&&(n(),r.removeAttr(u.$attr.kNgDelay),h=null,s(k))})};/^\$(digest|apply)$/.test(et.$$phase)?b():t.$apply(b);return}return k()}function p(r,u,f,e,o){function l(n,u){var f=t.copy(r.$eval(u));f===i?h.push({option:n,path:u}):s[n]=f}var w=e.replace(/^kendo/,""),h=[],c=f.kOptions||f.options,y=r.$eval(c),s,a,p,v;return c&&y===i&&h.push({option:"options",path:c}),s=t.extend({},f.defaultOptions,y),a=o.widget.prototype.options,p=o.widget.prototype.events,n.each(f,function(n,t){var u,f,i,r;n!=="source"&&n!=="kDataSource"&&n!=="kScopeField"&&n!=="scopeField"&&(u="data"+n.charAt(0).toUpperCase()+n.slice(1),n.indexOf("on")===0&&(f=n.replace(/^on./,function(n){return n.charAt(2).toLowerCase()}),p.indexOf(f)>-1&&(s[f]=t)),a.hasOwnProperty(u)?l(u,t):a.hasOwnProperty(n)&&!it[n]?l(n,t):tt[n]||(i=n.match(/^k(On)?([A-Z].*)/),i&&(r=i[2].charAt(0).toLowerCase()+i[2].slice(1),i[1]&&n!="kOnLabel"?s[r]=t:(n=="kOnLabel"&&(r="onLabel"),l(r,t)))))}),v=f.kDataSource||f.source,v&&(s.dataSource=nt(r,u,w,v)),s.$angular=[r],{options:s,unresolved:h}}function rt(n,t,i,r){if(kendo.ui.PanelBar&&n instanceof kendo.ui.PanelBar||kendo.ui.Menu&&n instanceof kendo.ui.Menu){h.warn("k-ng-disabled specified on a widget that does not have the enable() method: "+n.options.name);return}t.$watch(r,function(t,i){t!=i&&n.enable(!t)})}function ut(n,t,i,r){if(typeof n.readonly!="function"){h.warn("k-ng-readonly specified on a widget that does not have the readonly() method: "+n.options.name);return}t.$watch(r,function(t,i){t!=i&&n.readonly(t)})}function ft(n,t,i,r,u){if(i[u]){var f=o(i[u]).assign;if(f)f(t,n);else throw new Error(u+" attribute used but expression in it is not assignable: "+i[r]);}}function et(n){return/checkbox|radio/i.test(n.attr("type"))?n.prop("checked"):n.val()}function b(n){return w.test(n[0].tagName)}function ot(n,t,r,u,f){var s,h,c,o;if(n.value){if(s=b(r)?function(){return et(r)}:function(){return n.value()},u.$render=function(){var r=u.$viewValue;r===i&&(r=u.$modelValue);r===i&&(r=null);setTimeout(function(){if(n){var i=t[n.element.attr("k-ng-model")];i&&(r=i);n.value(r)}},0)},h=!1,b(r))r.on("change",function(){h=!0});c=function(n){return function(){var i;h||(n&&f&&(i=f.$pristine),u.$setViewValue(s()),n&&(u.$setPristine(),i&&f.$setPristine()),e(t))}};n.first("change",c(!1));kendo.ui.AutoComplete&&n instanceof kendo.ui.AutoComplete||n.first("dataBound",c(!0));o=s();isNaN(u.$viewValue)||o==u.$viewValue||(u.$isEmpty(u.$viewValue)?o!=null&&o!==""&&o!=u.$viewValue&&u.$setViewValue(o):n.value(u.$viewValue));u.$setPristine()}}function st(t,r,u){var s,a,v;if(typeof t.value!="function"){h.warn("k-ng-model specified on a widget that does not have the value() method: "+t.options.name);return}var p=n(t.element).parents("form"),c=r[p.attr("name")],y=o(u),w=y.assign,l=!1,f=y(r);t.$angular_setLogicValue(f);s=kendo.ui.MultiSelect&&t instanceof kendo.ui.MultiSelect;s&&(a=f.length);v=function(n){if(n===i&&(n=null),s){if(n==f&&n.length==a)return}else if(n==f)return;l||(f=n,s&&(a=f.length),t.$angular_setLogicValue(n))};s?r.$watchCollection(u,v):r.$watch(u,v);t.first("change",function(){l=!0;c&&c.$pristine&&c.$setDirty();e(r,function(){w(r,t.$angular_getLogicValue())});l=!1})}function ht(n,t){var i=n.$on("$destroy",function(){i();t&&(t.element&&(t=d(t.element),t&&t.destroy()),t=null)});return i}function ct(t,i){function f(){u.disconnect()}function e(){u.observe(n(i)[0],{attributes:!0})}if(window.MutationObserver&&t.wrapper){var r=[].slice.call(n(i)[0].classList),u=new MutationObserver(function(i){(f(),t)&&(i.forEach(function(i){var f=n(t.wrapper)[0],u;switch(i.attributeName){case"class":u=[].slice.call(i.target.classList);u.forEach(function(n){r.indexOf(n)<0&&(f.classList.add(n),kendo.ui.ComboBox&&t instanceof kendo.ui.ComboBox&&t.input[0].classList.add(n))});r.forEach(function(n){u.indexOf(n)<0&&(f.classList.remove(n),kendo.ui.ComboBox&&t instanceof kendo.ui.ComboBox&&t.input[0].classList.remove(n))});r=u;break;case"disabled":typeof t.enable!="function"||t.element.attr("readonly")||t.enable(!n(i.target).attr("disabled"));break;case"readonly":typeof t.readonly!="function"||t.element.attr("disabled")||t.readonly(!!n(i.target).attr("readonly"))}}),e())});e();t.first("destroy",f)}}function lt(t,i,r,u,f,o,s){var h=i.$watch(f,function(f,e){var c;if(!t._muteRebind&&f!==e){h();c=v[t.options.name];c&&c.forEach(function(t){var r=i.$eval(s["k"+t]);r&&u.append(n(r).attr(kendo.toHyphens("k"+t),""))});var l=n(t.wrapper)[0],a=n(t.element)[0],y=r.injector().get("$compile");t._destroy();o&&o();t=null;a&&(l&&l.parentNode.replaceChild(a,l),n(r).replaceWith(u));y(u)(i)}},!0);e(i)}function yt(n,i){function e(n,t){f.directive(n,["directiveFactory",function(i){return i.create(t,n)}])}var r=i?"Mobile":"",o,u,s,h;(r+=n.fn.options.name,o=r,u="kendo"+r.charAt(0)+r.substr(1).toLowerCase(),r="kendo"+r,s=r.replace(/([A-Z])/g,"-$1"),vt.indexOf(r.replace("kendo",""))==-1&&(h=r===u?[r]:[r,u],t.forEach(h,function(n){f.directive(n,function(){return{restrict:"E",replace:!0,template:function(n,t){var i=at[o]||"div",r=t.kScopeField||t.scopeField;return"<"+i+" "+s+(r?'="'+r+'"':"")+">"+n.html()+"<\/"+i+">"}}})})),k.indexOf(r.replace("kendo",""))>-1)||(e(r,r),u!=r&&e(u,r))}function d(t){return t=n(t),kendo.widgetInstance(t,kendo.ui)||kendo.widgetInstance(t,kendo.mobile.ui)||kendo.widgetInstance(t,kendo.dataviz.ui)}function e(n,t){var i=n.$root||n,r=/^\$(digest|apply)$/.test(i.$$phase);t?r?t():i.$apply(t):r||i.$digest()}function pt(t,i){t.$destroy();i&&n(i).removeData("$scope").removeData("$$kendoScope").removeData("$isolateScope").removeData("$isolateScopeNoTemplate").removeClass("ng-scope")}function r(i,u,f){var o,e,s;if(n.isArray(i))return t.forEach(i,function(n){r(n,u,f)});if(typeof i=="string"){for(o=i.split("."),e=kendo;e&&o.length>0;)e=e[o.shift()];if(!e)return l.push([i,u,f]),!1;i=e.prototype}return s=i[u],i[u]=function(){var n=this,t=arguments;return f.apply({self:n,next:function(){return s.apply(n,arguments.length>0?arguments:t)}},t)},!0}var w,l,v;if(t&&t.injector){var f=t.module("kendo.directives",[]),a=t.injector(["ng"]),o=a.get("$parse"),s=a.get("$timeout"),y,h=a.get("$log");var c,nt=function(){var t={TreeList:"TreeListDataSource",TreeView:"HierarchicalDataSource",Scheduler:"SchedulerDataSource",PanelBar:"$PLAIN",Menu:"$PLAIN",ContextMenu:"$PLAIN"},n=function(n,t){return t=="$PLAIN"?n:kendo.data[t].create(n)};return function(i,r,u,f){var o=t[u]||"DataSource",e=i.$eval(f),s=n(e,o);return i.$watch(f,function(t){var i=d(r),u;i&&typeof i.setDataSource=="function"&&t!==e&&(u=n(t,o),i.setDataSource(u),e=t)}),s}}(),tt={kDataSource:!0,kOptions:!0,kRebind:!0,kNgModel:!0,kNgDelay:!0},it={name:!0,title:!0,style:!0};w=/^(input|select|textarea)$/i;f.factory("directiveFactory",["$compile",function(t){var i,r=!1,f;return y=t,f=function(t,f){return{restrict:"AC",require:["?ngModel","^?form"],scope:!1,controller:["$scope","$attrs","$element",function(n,t){var i=this;i.template=function(n,i){t[n]=kendo.stringify(i)};n.$on("$destroy",function(){i.template=null;i=null})}],link:function(e,o,s,h){var c=n(o),l=t.replace(/([A-Z])/g,"-$1"),a;(c.attr(l,c.attr("data-"+l)),c[0].removeAttribute("data-"+l),a=u(e,o,s,t,f,h),a)&&(i&&clearTimeout(i),i=setTimeout(function(){e.$emit("kendoRendered");r||(r=!0,n("form").each(function(){var t=n(this).controller("form");t&&t.$setPristine()}))}))}}},{create:f}}]);var at={Editor:"textarea",NumericTextBox:"input",DatePicker:"input",DateTimePicker:"input",TimePicker:"input",AutoComplete:"input",ColorPicker:"input",MaskedTextBox:"input",MultiSelect:"input",Upload:"input",Validator:"form",Button:"button",MobileButton:"a",MobileBackButton:"a",MobileDetailButton:"a",ListView:"ul",MobileListView:"ul",TreeView:"ul",Menu:"ul",ContextMenu:"ul",ActionSheet:"ul"},vt=["MobileView","MobileDrawer","MobileLayout","MobileSplitView","MobilePane","MobileModalView"],k=["MobileApplication","MobileView","MobileModalView","MobileLayout","MobileActionSheet","MobileDrawer","MobileSplitView","MobilePane","MobileScrollView","MobilePopOver"];t.forEach(["MobileNavBar","MobileButton","MobileBackButton","MobileDetailButton","MobileTabStrip","MobileScrollView","MobileScroller"],function(n){k.push(n);n="kendo"+n;f.directive(n,function(){return{restrict:"A",link:function(t,i,r){u(t,i,r,n,n)}}})});l=[];kendo.onWidgetRegistered(function(t){l=n.grep(l,function(n){return!r.apply(null,n)});yt(t.widget,t.prefix=="Mobile")});r(["ui.Widget","mobile.ui.Widget"],"angular",function(r,u){var o=this.self,f;if(r=="init"){!u&&c&&(u=c);c=null;u&&u.$angular&&(o.$angular_scope=u.$angular[0],o.$angular_init(o.element,u));return}f=o.$angular_scope;f&&g(function(){var s=u(),h=s.elements,l=s.data,c,a;if(h.length>0)switch(r){case"cleanup":t.forEach(h,function(t){var i=n(t).data("$$kendoScope");i&&i!==f&&i.$$kendoScope&&pt(i,t)});break;case"compile":c=o.element.injector();a=c?c.get("$compile"):y;t.forEach(h,function(t,r){var u,e;s.scopeFrom?u=s.scopeFrom:(e=l&&l[r],e!==i?(u=n.extend(f.$new(),e),u.$$kendoScope=!0):u=f);n(t).data("$$kendoScope",u);a(t)(u)});e(f)}})});r("ui.Widget","$angular_getLogicValue",function(){return this.self.value()});r("ui.Widget","$angular_setLogicValue",function(n){this.self.value(n)});r("ui.Select","$angular_getLogicValue",function(){var n=this.self.dataItem(),t=this.self.options.dataValueField;return n?this.self.options.valuePrimitive?t?n[t]:n:n.toJSON():null});r("ui.Select","$angular_setLogicValue",function(n){var t=this.self,r=t.options,f=r.dataValueField,u=r.text||"";n===i&&(n="");f&&!r.valuePrimitive&&n&&(u=n[r.dataTextField]||"",n=n[f||r.dataTextField]);t.options.autoBind!==!1||t.listView.isBound()?t.value(n):!u&&n&&r.valuePrimitive?t.value(n):t._preselect(n,u)});r("ui.MultiSelect","$angular_getLogicValue",function(){var t=this.self.dataItems().slice(0),i=this.self.options.dataValueField;return i&&this.self.options.valuePrimitive&&(t=n.map(t,function(n){return n[i]})),t});r("ui.MultiSelect","$angular_setLogicValue",function(t){t==null&&(t=[]);var i=this.self,r=i.options,u=r.dataValueField,f=t;u&&!r.valuePrimitive&&(t=n.map(t,function(n){return n[u]}));r.autoBind!==!1||r.valuePrimitive||i.listView.isBound()?i.value(t):i._preselect(f,t)});r("ui.AutoComplete","$angular_getLogicValue",function(){for(var t,f,i,n=this.self.options,e=this.self.value().split(n.separator),s=n.valuePrimitive,o=this.self.dataSource.data(),r=[],u=0,h=o.length;u<h;u++)for(t=o[u],f=n.dataTextField?t[n.dataTextField]:t,i=0;i<e.length;i++)if(f===e[i]){s?r.push(f):r.push(t.toJSON());break}return r});r("ui.AutoComplete","$angular_setLogicValue",function(t){t==null&&(t=[]);var i=this.self,r=i.options.dataTextField;r&&!i.options.valuePrimitive&&(t=n.map(t,function(n){return n[r]}));i.value(t)});r("ui.Widget","$angular_init",function(t,i){var r=this.self,o,e,u,f;if(i&&!n.isArray(i))for(o=r.$angular_scope,e=r.events.length;--e>=0;)u=r.events[e],f=i[u],f&&typeof f=="string"&&(i[u]=r.$angular_makeEventHandler(u,o,f))});r("ui.Widget","$angular_makeEventHandler",function(n,t,i){return i=o(i),function(n){e(t,function(){i(t,{kendoEvent:n})})}});r(["ui.Grid","ui.ListView","ui.TreeView"],"$angular_makeEventHandler",function(n,i,r){return n!="change"?this.next():(r=o(r),function(n){var y=n.sender,c=y.options,l,p,u={kendoEvent:n},f,s,a,v,o,w,h;for(t.isString(c.selectable)&&(l=c.selectable.indexOf("cell")!==-1,p=c.selectable.indexOf("multiple")!==-1),f=u.selected=this.select(),s=u.data=[],a=u.columns=[],o=0;o<f.length;o++)w=l?f[o].parentNode:f[o],h=y.dataItem(w),l?(t.element.inArray(h,s)<0&&s.push(h),v=t.element(f[o]).index(),t.element.inArray(v,a)<0&&a.push(v)):s.push(h);p||(u.dataItem=u.data=s[0],u.selected=f[0]);e(i,function(){r(i,u)})})});r("ui.Grid","$angular_init",function(r,u){if(this.next(),u.columns){var f=n.extend({},kendo.Template,u.templateSettings);t.forEach(u.columns,function(n){!n.field||n.template||n.format||n.values||n.encoded!==i&&!n.encoded||(n.template="<span ng-bind='"+kendo.expr(n.field,"dataItem")+"'>#: "+kendo.expr(n.field,f.paramName)+"#<\/span>")})}});r("mobile.ui.ButtonGroup","value",function(n){var t=this.self;return n!=null&&(t.select(t.element.children("li.km-button").eq(n)),t.trigger("change"),t.trigger("select",{index:t.selectedIndex})),t.selectedIndex});r("mobile.ui.ButtonGroup","_select",function(){this.next();this.self.trigger("change")});f.directive("kendoMobileApplication",function(){return{terminal:!0,link:function(n,t,i){u(n,t,i,"kendoMobileApplication","kendoMobileApplication")}}}).directive("kendoMobileView",function(){return{scope:!0,link:{pre:function(n,t,i){i.defaultOptions=n.viewOptions;i._instance=u(n,t,i,"kendoMobileView","kendoMobileView")},post:function(n,t,i){i._instance._layout();i._instance._scroller()}}}}).directive("kendoMobileDrawer",function(){return{scope:!0,link:{pre:function(n,t,i){i.defaultOptions=n.viewOptions;i._instance=u(n,t,i,"kendoMobileDrawer","kendoMobileDrawer")},post:function(n,t,i){i._instance._layout();i._instance._scroller()}}}}).directive("kendoMobileModalView",function(){return{scope:!0,link:{pre:function(n,t,i){i.defaultOptions=n.viewOptions;i._instance=u(n,t,i,"kendoMobileModalView","kendoMobileModalView")},post:function(n,t,i){i._instance._layout();i._instance._scroller()}}}}).directive("kendoMobileSplitView",function(){return{terminal:!0,link:{pre:function(n,t,i){i.defaultOptions=n.viewOptions;i._instance=u(n,t,i,"kendoMobileSplitView","kendoMobileSplitView")},post:function(n,t,i){i._instance._layout()}}}}).directive("kendoMobilePane",function(){return{terminal:!0,link:{pre:function(n,t,i){i.defaultOptions=n.viewOptions;u(n,t,i,"kendoMobilePane","kendoMobilePane")}}}}).directive("kendoMobileLayout",function(){return{link:{pre:function(n,t,i){u(n,t,i,"kendoMobileLayout","kendoMobileLayout")}}}}).directive("kendoMobileActionSheet",function(){return{restrict:"A",link:function(t,i,r){i.find("a[k-action]").each(function(){n(this).attr("data-"+kendo.ns+"action",n(this).attr("k-action"))});u(t,i,r,"kendoMobileActionSheet","kendoMobileActionSheet")}}}).directive("kendoMobilePopOver",function(){return{terminal:!0,link:{pre:function(n,t,i){i.defaultOptions=n.viewOptions;u(n,t,i,"kendoMobilePopOver","kendoMobilePopOver")}}}}).directive("kendoViewTitle",function(){return{restrict:"E",replace:!0,template:function(n){return"<span data-"+kendo.ns+"role='view-title'>"+n.html()+"<\/span>"}}}).directive("kendoMobileHeader",function(){return{restrict:"E",link:function(n,t){t.addClass("km-header").attr("data-role","header")}}}).directive("kendoMobileFooter",function(){return{restrict:"E",link:function(n,t){t.addClass("km-footer").attr("data-role","footer")}}}).directive("kendoMobileScrollViewPage",function(){return{restrict:"E",replace:!0,template:function(n){return"<div data-"+kendo.ns+"role='page'>"+n.html()+"<\/div>"}}});t.forEach(["align","icon","rel","transition","actionsheetContext"],function(n){var t="k"+n.slice(0,1).toUpperCase()+n.slice(1);f.directive(t,function(){return{restrict:"A",priority:2,link:function(i,r,u){r.attr(kendo.attr(kendo.toHyphens(n)),i.$eval(u[t]))}}})});v={TreeMap:["Template"],MobileListView:["HeaderTemplate","Template"],MobileScrollView:["EmptyTemplate","Template"],Grid:["AltRowTemplate","DetailTemplate","RowTemplate"],ListView:["EditTemplate","Template","AltTemplate"],Pager:["SelectTemplate","LinkTemplate"],PivotGrid:["ColumnHeaderTemplate","DataCellTemplate","RowHeaderTemplate"],Scheduler:["AllDayEventTemplate","DateHeaderTemplate","EventTemplate","MajorTimeHeaderTemplate","MinorTimeHeaderTemplate"],TreeView:["Template"],Validator:["ErrorTemplate"]},function(){var n={};t.forEach(v,function(i,r){t.forEach(i,function(t){n[t]||(n[t]=[]);n[t].push("?^^kendo"+r)})});t.forEach(n,function(n,t){var i="k"+t,r=kendo.toHyphens(i);f.directive(i,function(){return{restrict:"A",require:n,terminal:!0,compile:function(t,u){if(u[i]===""){t.removeAttr(r);var f=t[0].outerHTML;return function(u,e,o,s){for(var c;!c&&s.length;)c=s.shift();c?(c.template(i,f),t.remove()):h.warn(r+" without a matching parent widget found. It can be one of the following: "+n.join(", "))}}}}})})}()}})(window.kendo.jQuery,window.angular)}(),function(){(function(n,t,i){function h(n,t){var r=n.getAttribute(t);return r===null?r=i:r==="null"?r=null:r==="true"?r=!0:r==="false"?r=!1:s.test(r)?r=parseFloat(r):e.test(r)&&!o.test(r)&&(r=new Function("return ("+r+")")()),r}function c(n,t){var i={};return Object.keys(t).concat("dataSource").forEach(function(t){n.hasAttribute(kendo.toHyphens(t))&&(i[t]=h(n,kendo.toHyphens(t)))}),i}function l(n){var t={};return Object.keys(n).forEach(function(i){i[0]!="_"&&(t[i]=n[i])}),t}function a(n,t){var i=document.createEvent("CustomEvent");i.initCustomEvent(n,!1,!0,l(t));this.dispatchEvent(i);i.defaultPrevented&&t.preventDefault()}function v(n,t){for(var r=Object.keys(t),i=0;i<=r.length;i++)if(typeof t[r[i]]=="function")n[r[i]]||(n[r[i]]=t[r[i]].bind(n.widget));else{if(r[i]==="options")continue;n[r[i]]=n[r[i]]||t[r[i]]}}function y(t,i){var e=i.prototype.options,f=Object.create(HTMLElement.prototype);Object.defineProperty(f,"options",{get:function(){return this.widget.options},set:function(i){var u=this.widget,f,e,o;i=n.extend(!0,{},u.options,i);f=n(u.wrapper)[0];e=n(u.element)[0];u._destroy();o=document.createElement(r[t]||"div");f&&e&&(f.parentNode.replaceChild(e,f),n(e).replaceWith(o));u.value&&(i.value=u.value());u.init(o,i);this.bindEvents()}});f.bindEvents=function(){i.prototype.events.forEach(function(n){this.widget.bind(n,a.bind(this,n));this.hasAttribute(u+n)&&this.bind(n,function(t){window[this.getAttribute(u+n)].call(this,t)}.bind(this))}.bind(this))};f.attachedCallback=function(){var u=this,f=document.createElement(r[t]||"div"),o;n(f).append(u.childNodes);n(f).attr("class",n(u).attr("class"));n(f).attr("style",n(u).attr("style"));u.appendChild(f);u.widget=new i(f,c(u,e));o=u.widget;do v(u,o);while(o=Object.getPrototypeOf(o));this.bindEvents()};f.detachedCallback=function(){kendo.destroy(this.element)};kendo.webComponents.push("kendo-"+t);document.registerElement("kendo-"+t,{prototype:f})}if(kendo.support.customElements&&!kendo.webComponents.length&&(!t||t.version.major!=1&&!t.injector)){var r={editor:"textarea",numerictextbox:"input",datepicker:"input",datetimepicker:"input",timepicker:"input",autocomplete:"input",colorpicker:"input",maskedtextbox:"input",dropdownlist:"select",multiselect:"select",upload:"input",validator:"form",button:"button",mobilebutton:"a",mobilebackbutton:"a",mobiledetailbutton:"a",listview:"ul",mobilelistview:"ul",treeview:"ul",menu:"ul",contextmenu:"ul",actionsheet:"ul"},u="on-",f=[];kendo.onWidgetRegistered(function(n){var t=n.prefix+n.widget.prototype.options.name.toLowerCase();f.indexOf(t)===-1&&(f.push(t),y(t,n.widget))});var e=/^\s*(?:\{(?:.|\r\n|\n)*\}|\[(?:.|\r\n|\n)*\])\s*$/,o=/^\{(\d+)(:[^\}]+)?\}|^\[[A-Za-z_]*\]$/,s=/^(\+|-?)\d+(\.?)\d*$/}})(window.kendo.jQuery,window.angular)}(),function(){(function(n,t){if(t&&t.register){var i=this&&this.__decorate||function(n,t,i,r){if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")return Reflect.decorate(n,t,i,r);switch(arguments.length){case 2:return n.reduceRight(function(n,t){return t&&t(n)||n},t);case 3:return n.reduceRight(function(n,r){return r&&r(t,i),void 0},void 0);case 4:return n.reduceRight(function(n,r){return r&&r(t,i,n)||n},r)}},r=this&&this.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)};t.register("kendo/angular2",["angular2/angular2"],function(t){var u,f;return{setters:[function(n){u=n}],execute:function(){f=function(){function t(n,t){var i=this;this.elementRef=t;this.onChange=function(){};this.onTouched=function(){};this.element=t.nativeElement;this.element.addEventListener("change",function(){i.onChange(i.element.value())});this.element.addEventListener("spin",function(){i.onChange(i.element.value())});n.valueAccessor=this;this.cd=n;n.valueAccessor=this}return t.prototype.writeValue=function(n){this.element.value(n)},t.prototype.registerOnChange=function(n){this.onChange=n},t.prototype.registerOnTouched=function(n){this.onTouched=n},i([u.Directive({selector:n.webComponents.join(",")}),r("design:paramtypes",[u.NgControl,u.ElementRef])],t)}();t("KendoValueAccessor",f)}}})}})(window.kendo,window.System)}(),function(){(function(n){function rt(n,t){var i={top:0,right:0,bottom:0,left:0};return t=t||0,typeof n=="number"?i[l]=i[g]=i[p]=i[y]=n:(i[l]=n[l]||t,i[g]=n[g]||t,i[p]=n[p]||t,i[y]=n[y]||t),i}function sr(n,t){var f=n.tickX,e=n.tickY,i=n.position,u=new r.Path({stroke:{width:t.width,color:t.color}});return n.vertical?u.moveTo(f,i).lineTo(f+t.size,i):u.moveTo(i,e).lineTo(i,e+t.size),wt(u),u}function hr(n,t){var f=n.lineStart,e=n.lineEnd,i=n.position,u=new r.Path({stroke:{width:t.width,color:t.color,dashType:t.dashType}});return n.vertical?u.moveTo(f,i).lineTo(e,i):u.moveTo(i,f).lineTo(i,e),wt(u),u}function hi(n,r){var u=i(r-n,fi-1);if(u===0){if(r===0)return.1;u=t.abs(r)}var e=t.pow(10,t.floor(t.log(u)/t.log(10))),f=i(u/e,fi),o=1;return o=f<1.904762?.2:f<4.761904?.5:f<9.523809?1:2,i(e*o,fi)}function pt(n,i,r,u,f){var e=f*ct;return new a(r+(n-r)*t.cos(e)+(i-u)*t.sin(e),u-(n-r)*t.sin(e)+(i-u)*t.cos(e))}function vr(i,r){if(i.x1==r.x1&&i.y1==r.y1&&i.x2==r.x2&&i.y2==r.y2)return r;var e=t.min(i.x1,r.x1),o=t.max(i.x1,r.x1),s=t.min(i.x2,r.x2),a=t.max(i.x2,r.x2),h=t.min(i.y1,r.y1),c=t.max(i.y1,r.y1),l=t.min(i.y2,r.y2),v=t.max(i.y2,r.y2),f=[];return f[0]=u(o,h,s,c),f[1]=u(e,c,o,l),f[2]=u(s,c,a,l),f[3]=u(o,l,s,v),i.x1==e&&i.y1==h||r.x1==e&&r.y1==h?(f[4]=u(e,h,o,c),f[5]=u(s,l,a,v)):(f[4]=u(s,h,a,c),f[5]=u(e,l,o,v)),n.grep(f,function(n){return n.height()>0&&n.width()>0})[0]}function et(n,t){return ui(n,t)!=-1}function ci(n,r){return i(t.ceil(n/r)*r,c)}function li(n,r){return i(t.floor(n/r)*r,c)}function i(n,i){var r=t.pow(10,i||0);return t.round(n*r)/r}function w(n,i){return t.log(n)/t.log(i)}function yr(n,r,u){var f=i(t.abs(n%r),c),e=r*(1-u);return f===0||f>e}function eu(n,t,r){return i(n+(t-n)*r,nt)}function ou(n,t){return n-t}function pr(n,t){return n.match(nr)?b.format.apply(this,arguments):b.toString(t,n)}function wr(n,t){return-n.x*t.y+n.y*t.x<0}function su(n,t){return n&&t?n.getTime()-t.getTime():-1}function hu(n){var u=n.originalEvent,r=0;return u.wheelDelta&&(r=-u.wheelDelta/120,r=r>0?t.ceil(r):t.floor(r)),u.detail&&(r=i(u.detail/3)),r}function ai(n){if(!n||!n.indexOf||n.indexOf("&")<0)return n;var t=ai._element;return t.innerHTML=n,t.textContent||t.innerText}function wt(n){var t,i;if(!b.support.vml)for(t=.5,n.options.stroke&&o(n.options.stroke.width)&&n.options.stroke.width%2==0&&(t=0),i=0;i<n.segments.length;i++)n.segments[i].anchor().round(0).translate(t,t);return n}function cu(n){for(var r=n.stops,u=n.innerRadius/n.radius*100,e=r.length,i,f=[],t=0;t<e;t++)i=h({},r[t]),i.offset=(i.offset*(100-u)+u)/100,f.push(i);return f}function vi(n){var t=n.origin,i=n.bottomRight();return new u(t.x,t.y,i.x,i.y)}var b=window.kendo,it=b.util,br=it.append,o=it.defined,ot=it.last,lt=it.valueOrDefault,ht=b.dataviz,k=ht.geometry,r=ht.drawing,kr=r.util.measureText,yi=b.Class,pi=b.template,dr=n.noop,ui=n.inArray,gr=n.isPlainObject,nu=n.trim,t=Math,h=b.deepExtend,wi="axisLabelClick",ft="#000",p="bottom",d="center",nt=3,bt="circle",tu="cross",bi="12px sans-serif",ki=400,di=7,c=6,fi=10,gi=600,ct=t.PI/180,nr=/\{\d+:?/,kt="height",dt=1e5,tr="inside",y="left",ei=Number.MAX_VALUE,oi=-Number.MAX_VALUE,gt="none",ir="noteClick",rr="noteHover",ni="outside",ti="radial",g="right",l="top",iu="triangle",ii="width",s="#fff",f="x",e="y",ur=.2,a=function(n,t){var i=this;if(!(i instanceof a))return new a(n,t);i.x=n||0;i.y=t||0},u,vt,ar,ri;a.fn=a.prototype={clone:function(){var n=this;return new a(n.x,n.y)},equals:function(n){return n&&n.x===this.x&&n.y===this.y},rotate:function(n,r){var u=this,o=r*ct,s=t.cos(o),h=t.sin(o),f=n.x,e=n.y,c=u.x,l=u.y;return u.x=i(f+(c-f)*s+(l-e)*h,nt),u.y=i(e+(l-e)*s-(c-f)*h,nt),u},multiply:function(n){var t=this;return t.x*=n,t.y*=n,t},distanceTo:function(n){var i=this.x-n.x,r=this.y-n.y;return t.sqrt(i*i+r*r)}};a.onCircle=function(n,i,r){return i*=ct,new a(n.x-r*t.cos(i),n.y-r*t.sin(i))};u=function(n,t,i,r){var f=this;if(!(f instanceof u))return new u(n,t,i,r);f.x1=n||0;f.x2=i||0;f.y1=t||0;f.y2=r||0};u.fn=u.prototype={width:function(){return this.x2-this.x1},height:function(){return this.y2-this.y1},translate:function(n,t){var i=this;return i.x1+=n,i.x2+=n,i.y1+=t,i.y2+=t,i},move:function(n,t){var i=this,r=i.height(),u=i.width();return o(n)&&(i.x1=n,i.x2=i.x1+u),o(t)&&(i.y1=t,i.y2=i.y1+r),i},wrap:function(n){var i=this;return i.x1=t.min(i.x1,n.x1),i.y1=t.min(i.y1,n.y1),i.x2=t.max(i.x2,n.x2),i.y2=t.max(i.y2,n.y2),i},wrapPoint:function(n){return this.wrap(new u(n.x,n.y,n.x,n.y)),this},snapTo:function(n,t){var i=this;return t!=f&&t||(i.x1=n.x1,i.x2=n.x2),t!=e&&t||(i.y1=n.y1,i.y2=n.y2),i},alignTo:function(n,t){var i=this,s=i.height(),h=i.width(),r=t==l||t==p?e:f,c=r==e?s:h,u,o;return t===d?(u=n.center(),o=i.center(),i.x1+=u.x-o.x,i.y1+=u.y-o.y):i[r+1]=t===l||t===y?n[r+1]-c:n[r+2],i.x2=i.x1+h,i.y2=i.y1+s,i},shrink:function(n,t){var i=this;return i.x2-=n,i.y2-=t,i},expand:function(n,t){return this.shrink(-n,-t),this},pad:function(n){var t=this,i=rt(n);return t.x1-=i.left,t.x2+=i.right,t.y1-=i.top,t.y2+=i.bottom,t},unpad:function(n){var i=this,t=rt(n);return t.left=-t.left,t.top=-t.top,t.right=-t.right,t.bottom=-t.bottom,i.pad(t)},clone:function(){var n=this;return new u(n.x1,n.y1,n.x2,n.y2)},center:function(){var n=this;return new a(n.x1+n.width()/2,n.y1+n.height()/2)},containsPoint:function(n){var t=this;return n.x>=t.x1&&n.x<=t.x2&&n.y>=t.y1&&n.y<=t.y2},points:function(){var n=this;return[new a(n.x1,n.y1),new a(n.x2,n.y1),new a(n.x2,n.y2),new a(n.x1,n.y2)]},getHash:function(){var n=this;return[n.x1,n.y1,n.x2,n.y2].join(",")},overlaps:function(n){return!(n.y2<this.y1||this.y2<n.y1||n.x2<this.x1||this.x2<n.x1)},rotate:function(n){var i=this,r=i.width(),u=i.height(),l=i.center(),f=l.x,e=l.y,o=pt(0,0,f,e,n),s=pt(r,0,f,e,n),h=pt(r,u,f,e,n),c=pt(0,u,f,e,n);return r=t.max(o.x,s.x,h.x,c.x)-t.min(o.x,s.x,h.x,c.x),u=t.max(o.y,s.y,h.y,c.y)-t.min(o.y,s.y,h.y,c.y),i.x2=i.x1+r,i.y2=i.y1+u,i},toRect:function(){return new k.Rect([this.x1,this.y1],[this.width(),this.height()])},hasSize:function(){return this.width()!==0&&this.height()!==0},align:function(n,t,i){var r=this,u=t+1,e=t+2,s=t===f?ii:kt,o=r[s]();et(i,[y,l])?(r[u]=n[u],r[e]=r[u]+o):et(i,[g,p])?(r[e]=n[e],r[u]=r[e]-o):i==d&&(r[u]=n[u]+(n[s]()-o)/2,r[e]=r[u]+o)}};var st=yi.extend({init:function(n,t,i,r,u){var f=this;f.c=n;f.ir=t;f.r=i;f.startAngle=r;f.angle=u},clone:function(){var n=this;return new st(n.c,n.ir,n.r,n.startAngle,n.angle)},middle:function(){return this.startAngle+this.angle/2},radius:function(n,t){var i=this;return t?i.ir=n:i.r=n,i},point:function(n,r){var u=this,f=n*ct,o=t.cos(f),s=t.sin(f),e=r?u.ir:u.r,h=i(u.c.x-o*e,nt),c=i(u.c.y-s*e,nt);return new a(h,c)},adjacentBox:function(n,i,r){var c=this.clone().expand(n),f=c.middle(),l=c.point(f),a=i/2,v=r/2,e=l.x-a,o=l.y-v,s=t.sin(f*ct),h=t.cos(f*ct);return t.abs(s)<.9&&(e+=a*-h/t.abs(h)),t.abs(h)<.9&&(o+=v*-s/t.abs(s)),new u(e,o,e+i,o+r)},containsPoint:function(n){var t=this,r=t.c,o=t.ir,s=t.r,y=t.startAngle,p=t.startAngle+t.angle,u=n.x-r.x,f=n.y-r.y,e=new a(u,f),h=t.point(y),c=new a(h.x-r.x,h.y-r.y),l=t.point(p),w=new a(l.x-r.x,l.y-r.y),v=i(u*u+f*f,nt);return(c.equals(e)||wr(c,e))&&!wr(w,e)&&v>=o*o&&v<=s*s},getBBox:function(){for(var t=this,r=new u(ei,ei,oi,oi),f=i(t.startAngle%360),o=i((f+t.angle)%360),a=t.ir,n=[0,90,180,270,f,o].sort(ou),s=ui(f,n),h=ui(o,n),l,c=f==o?n:s<h?n.slice(s,h+1):[].concat(n.slice(0,h+1),n.slice(s,n.length)),e=0;e<c.length;e++)l=t.point(c[e]),r.wrapPoint(l),r.wrapPoint(l,a);return a||r.wrapPoint(t.c),r},expand:function(n){return this.r+=n,this}}),fr=st.extend({init:function(n,t,i,r){st.fn.init.call(this,n,0,t,i,r)},expand:function(n){return st.fn.expand.call(this,n)},clone:function(){var n=this;return new fr(n.c,n.r,n.startAngle,n.angle)},radius:function(n){return st.fn.radius.call(this,n)},point:function(n){return st.fn.point.call(this,n)}}),at=function(){};at.fn=at.prototype={createRing:function(n,i){var o=n.startAngle+180,s=n.angle+o,h=new k.Point(n.c.x,n.c.y),l=t.max(n.r,0),u=t.max(n.ir,0),f=new k.Arc(h,{startAngle:o,endAngle:s,radiusX:l,radiusY:l}),e=r.Path.fromArc(f,i).close(),c;return u?(f.radiusX=f.radiusY=u,c=f.pointAt(s),e.lineTo(c.x,c.y),e.arc(s,o,u,u,!0)):e.lineTo(h.x,h.y),e}};at.current=new at;var v=yi.extend({init:function(n){var t=this;t.children=[];t.options=h({},t.options,n)},reflow:function(n){for(var u=this,f=u.children,t,r,i=0;i<f.length;i++)r=f[i],r.reflow(n),t=t?t.wrap(r.box):r.box.clone();u.box=t||n},destroy:function(){var i=this,t=i.children,n;for(this.animation&&this.animation.destroy(),n=0;n<t.length;n++)t[n].destroy()},getRoot:function(){var n=this.parent;return n?n.getRoot():null},getChart:function(){var n=this.getRoot();if(n)return n.chart},translateChildren:function(n,t){for(var u=this,r=u.children,f=r.length,i=0;i<f;i++)r[i].box.translate(n,t)},append:function(){br(this.children,arguments);for(var n=0;n<arguments.length;n++)arguments[n].parent=this},renderVisual:function(){this.options.visible!==!1&&(this.createVisual(),this.addVisual(),this.renderChildren(),this.createAnimation(),this.renderComplete())},addVisual:function(){this.visual&&(this.visual.chartElement=this,this.parent&&this.parent.appendVisual(this.visual))},renderChildren:function(){for(var t=this.children,n=0;n<t.length;n++)t[n].renderVisual()},createVisual:function(){this.visual=new ht.drawing.Group({zIndex:this.options.zIndex,visible:lt(this.options.visible,!0)})},createAnimation:function(){this.visual&&(this.animation=r.Animation.create(this.visual,this.options.animation))},appendVisual:function(n){n.chartElement||(n.chartElement=this);n.options.noclip?this.clipRoot().visual.append(n):o(n.options.zIndex)?this.stackRoot().stackVisual(n):this.visual?this.visual.append(n):this.parent.appendVisual(n)},clipRoot:function(){return this.parent?this.parent.clipRoot():this},stackRoot:function(){return this.parent?this.parent.stackRoot():this},stackVisual:function(n){for(var r,u,f=n.options.zIndex||0,i=this.visual.children,t=0;t<i.length;t++)if(r=i[t],u=lt(r.options.zIndex,0),u>f)break;this.visual.insertAt(n,t)},traverse:function(n){for(var t,r=this.children,i=0;i<r.length;i++)t=r[i],n(t),t.traverse&&t.traverse(n)},closest:function(n){for(var t=this,i=!1;t&&!i;)i=n(t),i||(t=t.parent);if(i)return t},renderComplete:n.noop,hasHighlight:function(){var n=(this.options||{}).highlight;return!(!this.createHighlight||n&&n.visible===!1)},toggleHighlight:function(t){var i=this,r=i._highlight,e=(i.options||{}).highlight,f=(e||{}).visual,u;if(!r){if(u={fill:{color:s,opacity:.2},stroke:{color:s,width:1,opacity:.2}},f){if(r=i._highlight=f(n.extend(i.highlightVisualArgs(),{createVisual:function(){return i.createHighlight(u)},sender:i.getChart(),series:i.series,dataItem:i.dataItem,category:i.category,value:i.value,percentage:i.percentage,runningTotal:i.runningTotal,total:i.total})),!r)return}else r=i._highlight=i.createHighlight(u);r.options.zIndex=i.options.zIndex;i.appendVisual(r)}r.visible(t)},createGradientOverlay:function(n,t,i){var u=new r.Path(h({stroke:{color:gt},fill:this.createGradient(i),closed:n.options.closed},t));return u.segments.elements(n.segments.elements()),u},createGradient:function(n){if(this.parent)return this.parent.createGradient(n)}}),ru=v.extend({init:function(n){var t=this;t.gradients={};v.fn.init.call(t,n)},options:{width:gi,height:ki,background:s,border:{color:ft,width:0},margin:rt(5),zIndex:-2},reflow:function(){var i=this,r=i.options,f=i.children,t=new u(0,0,r.width,r.height),n;for(i.box=t.unpad(r.margin),n=0;n<f.length;n++)f[n].reflow(t),t=vr(t,f[n].box)||u()},createVisual:function(){this.visual=new r.Group;this.createBackground()},createBackground:function(){var t=this.options,n=t.border||{},i=this.box.clone().pad(t.margin).unpad(n.width),u=r.Path.fromRect(i.toRect(),{stroke:{color:n.width?n.color:"",width:n.width,dashType:n.dashType},fill:{color:t.background,opacity:t.opacity},zIndex:-10});this.visual.append(u)},getRoot:function(){return this},createGradient:function(n){var u=this.gradients,f=it.objectKey(n),e=ht.Gradients[n.gradient],t,i;return u[f]?t=u[f]:(i=h({},e,n),e.type=="linear"?t=new r.LinearGradient(i):(n.innerRadius&&(i.stops=cu(i)),t=new r.RadialGradient(i),t.supportVML=e.supportVML!==!1),u[f]=t),t}}),tt=v.extend({options:{align:y,vAlign:l,margin:{},padding:{},border:{color:ft,width:0},background:"",shrinkToFit:!1,width:0,height:0,visible:!0},reflow:function(n){function d(){t.align(n,f,r.align);t.align(n,e,r.vAlign);t.paddingBox=o.clone().unpad(s).unpad(c)}var t=this,o,i,r=t.options,a=r.width,y=r.height,p=a&&y,b=r.shrinkToFit,s=rt(r.margin),h=rt(r.padding),c=r.border.width,k=t.children,l,w;for(i=n.clone(),p&&(i.x2=i.x1+a,i.y2=i.y1+y),b&&i.unpad(s).unpad(c).unpad(h),v.fn.reflow.call(t,i),o=p?t.box=u(0,0,a,y):t.box,b&&p?(d(),i=t.contentBox=t.paddingBox.clone().unpad(h)):(i=t.contentBox=o.clone(),o.pad(h).pad(c).pad(s),d()),t.translateChildren(o.x1-i.x1+s.left+c+h.left,o.y1-i.y1+s.top+c+h.top),l=0;l<k.length;l++)w=k[l],w.reflow(w.box)},align:function(n,t,i){this.box.align(n,t,i)},hasBox:function(){var n=this.options;return n.border.width||n.background},createVisual:function(){v.fn.createVisual.call(this);var n=this.options;n.visible&&this.hasBox()&&this.visual.append(r.Path.fromRect(this.paddingBox.toRect(),this.visualStyle()))},visualStyle:function(){var i=this,n=i.options,t=n.border||{};return{stroke:{width:t.width,color:t.color,opacity:lt(t.opacity,n.opacity),dashType:t.dashType},fill:{color:n.background,opacity:n.opacity},cursor:n.cursor}}}),er=v.extend({init:function(n,t){var i=this;v.fn.init.call(i,t);i.content=n;i.reflow(u())},options:{font:bi,color:ft,align:y,vAlign:""},reflow:function(n){var t=this,r=t.options,i;i=r.size=kr(t.content,{font:r.font});t.baseline=i.baseline;t.box=u(n.x1,n.y1,n.x1+i.width,n.y1+i.height)},createVisual:function(){var n=this.options;this.visual=new r.Text(this.content,this.box.toRect().topLeft(),{font:n.font,fill:{color:n.color,opacity:n.opacity},cursor:n.cursor})}}),or=v.extend({init:function(n){v.fn.init.call(this,n);this._initDirection()},_initDirection:function(){var n=this.options;n.vertical?(this.groupAxis=f,this.elementAxis=e,this.groupSizeField=ii,this.elementSizeField=kt,this.groupSpacing=n.spacing,this.elementSpacing=n.vSpacing):(this.groupAxis=e,this.elementAxis=f,this.groupSizeField=kt,this.elementSizeField=ii,this.groupSpacing=n.vSpacing,this.elementSpacing=n.spacing)},options:{vertical:!0,wrap:!0,vSpacing:0,spacing:0},reflow:function(n){this.box=n.clone();this.reflowChildren()},reflowChildren:function(){var n=this,t=n.box,r=n.elementAxis,f=n.groupAxis,b=n.elementSizeField,a=n.groupSizeField,o=n.groupOptions(),k=o.groups,d=k.length,v=t[f+1]+n.alignStart(o.groupsSize,t[a]()),g=v,s,y,h,p,nt,c,l,w,i,e;if(d){for(l=0;l<d;l++){for(h=k[l],p=h.groupElements,nt=p.length,s=t[r+1],c=0;c<nt;c++)w=p[c],e=n.elementSize(w),y=g+n.alignStart(e[a],h.groupSize),i=u(),i[f+1]=y,i[f+2]=y+e[a],i[r+1]=s,i[r+2]=s+e[b],w.reflow(i),s+=e[b]+n.elementSpacing;g+=h.groupSize+n.groupSpacing}t[f+1]=v;t[f+2]=v+o.groupsSize;t[r+2]=t[r+1]+o.maxGroupElementsSize}},alignStart:function(n,t){var i=0,r=this.options.align;return r==g||r==p?i=t-n:r==d&&(i=(t-n)/2),i},groupOptions:function(){for(var h=this,v=h.box,y=h.children,w=y.length,c=this.elementSizeField,b=this.groupSizeField,p=this.elementSpacing,k=this.groupSpacing,d=i(v[c]()),e=0,r=0,o,u,n=0,l=0,a=[],s=[],f=0,e=0;e<w;e++)u=y[e],u.box||u.reflow(v),o=this.elementSize(u),h.options.wrap&&i(n+p+o[c])>d&&(a.push({groupElements:s,groupSize:r,groupElementsSize:n}),f=t.max(f,n),l+=k+r,r=0,n=0,s=[]),r=t.max(r,o[b]),n>0&&(n+=p),n+=o[c],s.push(u);return a.push({groupElements:s,groupSize:r,groupElementsSize:n}),f=t.max(f,n),l+=r,{groups:a,groupsSize:l,maxGroupElementsSize:f}},elementSize:function(n){return{width:n.box.width(),height:n.box.height()}},createVisual:dr}),ut=tt.extend({ROWS_SPLIT_REGEX:/\n|\\n/m,init:function(n,t){var i=this;i.content=n;tt.fn.init.call(i,t);i._initContainer();i.reflow(u())},_initContainer:function(){var n=this,r=n.options,u=(n.content+"").split(n.ROWS_SPLIT_REGEX),i=new or({vertical:!0,align:r.align,wrap:!1}),e=h({},r,{opacity:1,animation:null}),f,t;for(n.container=i,n.append(i),t=0;t<u.length;t++)f=new er(nu(u[t]),e),i.append(f)},reflow:function(n){var i=this.options,f=i.visual,u,t,r;this.container.options.align=i.align;f&&!this._boxReflow?(n.hasSize()||(this._boxReflow=!0,this.reflow(n),this._boxReflow=!1,n=this.box),this.visual=f(this.visualContext(n)),u=n,this.visual&&(u=vi(this.visual.clippedBBox()||new k.Rect),this.visual.options.zIndex=i.zIndex,this.visual.options.noclip=i.noclip),this.box=this.contentBox=this.paddingBox=u):(tt.fn.reflow.call(this,n),i.rotation&&(t=rt(i.margin),r=this.box.unpad(t),this.targetBox=n,this.normalBox=r.clone(),r=this.rotate(),r.translate(t.left-t.right,t.top-t.bottom),this.rotatedBox=r.clone(),r.pad(t)))},createVisual:function(){var n=this.options,t;n.visible&&(this.visual=new ht.drawing.Group({transform:this.rotationTransform(),zIndex:n.zIndex,noclip:n.noclip}),this.hasBox()&&(t=r.Path.fromRect(this.paddingBox.toRect(),this.visualStyle()),this.visual.append(t)))},renderVisual:function(){this.options.visual?(this.addVisual(),this.createAnimation()):tt.fn.renderVisual.call(this)},visualOptions:function(){var n=this.options;return{background:n.background,border:n.border,color:n.color,font:n.font,margin:n.margin,padding:n.padding,visible:n.visible}},visualContext:function(n){var t=this;return{text:t.content,rect:n.toRect(),sender:this.getChart(),options:t.visualOptions(),createVisual:function(){return t._boxReflow=!0,t.reflow(n),t._boxReflow=!1,t.getDefaultVisual()}}},getDefaultVisual:function(){this.createVisual();this.renderChildren();var n=this.visual;return delete this.visual,n},rotate:function(){var n=this.options;return this.box.rotate(n.rotation),this.align(this.targetBox,f,n.align),this.align(this.targetBox,e,n.vAlign),this.box},rotationTransform:function(){var n=this.options.rotation;if(!n)return null;var t=this.normalBox.center(),i=t.x,r=t.y,u=this.rotatedBox.center();return k.transform().translate(u.x-i,u.y-r).rotate(n,[i,r])}}),si=v.extend({init:function(n){var t=this;v.fn.init.call(t,n);n=t.options;t.append(new ut(n.text,h({},n,{vAlign:n.position})))},options:{color:ft,position:l,align:d,margin:rt(5),padding:rt(5)},reflow:function(n){var t=this;v.fn.reflow.call(t,n);t.box.snapTo(n,f)}});si.buildTitle=function(n,t,i){var r;return typeof n=="string"&&(n={text:n}),n=h({visible:!0},i,n),n&&n.visible&&n.text&&(r=new si(n),t.append(r)),r};vt=ut.extend({init:function(n,t,i,r,u){var f=this;f.text=t;f.value=n;f.index=i;f.dataItem=r;ut.fn.init.call(f,t,u)},visualContext:function(n){var t=ut.fn.visualContext.call(this,n);return t.value=this.value,t.dataItem=this.dataItem,t.format=this.options.format,t.culture=this.options.culture,t},click:function(t,i){var r=this;t.trigger(wi,{element:n(i.target),value:r.value,text:r.text,index:r.index,dataItem:r.dataItem,axis:r.parent.options})},rotate:function(){if(this.options.alignRotation!=d){var n=this.normalBox.toRect(),t=this.rotationTransform();this.box=vi(n.bbox(t.matrix()))}else ut.fn.rotate.call(this);return this.box},rotationTransform:function(){var nt=this.options,tt=nt.rotation,it,rt,s,g,st;if(!tt)return null;if(nt.alignRotation==d)return ut.fn.rotationTransform.call(this);var h=k.transform().rotate(tt).matrix(),a=this.normalBox.toRect(),v=this.targetBox.toRect(),r=nt.rotationOrigin||l,o=r==l||r==p?f:e,n=r==l||r==p?e:f,ft=r==l||r==y?v.origin:v.bottomRight(),w=a.topLeft().transformCopy(h),b=a.topRight().transformCopy(h),et=a.bottomRight().transformCopy(h),ot=a.bottomLeft().transformCopy(h),ht=k.Rect.fromPoints(w,b,et,ot),u={};return u[n]=v.origin[n]-ht.origin[n],it=t.abs(w[n]+u[n]-ft[n]),rt=t.abs(b[n]+u[n]-ft[n]),i(it,c)===i(rt,c)?(s=w,g=b):rt<it?(s=b,g=et):(s=w,g=ot),st=s[o]+(g[o]-s[o])/2,u[o]=v.center()[o]-st,k.transform().translate(u.x,u.y).rotate(tt)}});var yt=v.extend({init:function(n){var t=this;v.fn.init.call(t,n);t.options.visible||(t.options=h({},t.options,{labels:{visible:!1},line:{visible:!1},margin:0,majorTickSize:0,minorTickSize:0}));t.options.minorTicks=h({},{color:t.options.line.color,width:t.options.line.width,visible:t.options.minorTickType!=gt},t.options.minorTicks,{size:t.options.minorTickSize,align:t.options.minorTickType});t.options.majorTicks=h({},{color:t.options.line.color,width:t.options.line.width,visible:t.options.majorTickType!=gt},t.options.majorTicks,{size:t.options.majorTickSize,align:t.options.majorTickType});this.options._deferLabels||t.createLabels();t.createTitle();t.createNotes()},options:{labels:{visible:!0,rotation:0,mirror:!1,step:1,skip:0},line:{width:1,color:ft,visible:!0},title:{visible:!0,position:d},majorTicks:{align:ni,size:4,skip:0,step:1},minorTicks:{align:ni,size:3,skip:0,step:1},axisCrossingValue:0,majorTickType:ni,minorTickType:gt,majorGridLines:{skip:0,step:1},minorGridLines:{visible:!1,width:1,color:ft,skip:0,step:1},margin:5,visible:!0,reverse:!1,justified:!0,notes:{label:{text:""}},_alignLines:!0,_deferLabels:!1},labelsRange:function(){return{min:this.options.labels.skip,max:this.labelsCount()}},createLabels:function(){var i=this,u=i.options,c=u.vertical?g:d,r=h({},u.labels,{align:c,zIndex:u.zIndex}),l=t.max(1,r.step),s,f,e,o;if(i.children=n.grep(i.children,function(n){return!(n instanceof vt)}),i.labels=[],r.visible)for(s=i.labelsRange(),f=r.rotation,gr(f)&&(r.alignRotation=f.align,r.rotation=f.angle),r.rotation=="auto"&&(r.rotation=0,u.autoRotateLabels=!0),o=s.min;o<s.max;o+=l)e=i.createAxisLabel(o,r),e&&(i.append(e),i.labels.push(e))},lineBox:function(){var i=this,t=i.options,n=i.box,s=t.vertical,r=t.labels.mirror,f=r?n.x1:n.x2,e=r?n.y2:n.y1,o=t.line.width||0;return s?u(f,n.y1,f,n.y2-o):u(n.x1,e,n.x2-o,e)},createTitle:function(){var t=this,r=t.options,n=h({rotation:r.vertical?-90:0,text:"",zIndex:1,visualSize:!0},r.title),i;n.visible&&n.text&&(i=new ut(n.text,n),t.append(i),t.title=i)},createNotes:function(){var r=this,t=r.options,f=t.notes,e=f.data||[],u,i,n;for(r.notes=[],u=0;u<e.length;u++)i=h({},f,e[u]),i.value=r.parseNoteValue(i.value),n=new cr(i.value,i.label.text,null,null,null,i),n.options.visible&&(o(n.options.position)?t.vertical&&!et(n.options.position,[y,g])?n.options.position=t.reverse?y:g:t.vertical||et(n.options.position,[l,p])||(n.options.position=t.reverse?p:l):n.options.position=t.vertical?t.reverse?y:g:t.reverse?p:l,r.append(n),r.notes.push(n))},parseNoteValue:function(n){return n},renderVisual:function(){v.fn.renderVisual.call(this);this.createPlotBands()},createVisual:function(){v.fn.createVisual.call(this);this.createBackground();this.createLine()},gridLinesVisual:function(){var n=this._gridLines;return n||(n=this._gridLines=new r.Group({zIndex:-2}),this.appendVisual(this._gridLines)),n},createTicks:function(n){function e(t,i,e){var s,h=t.length;if(i.visible)for(s=i.skip;s<h;s+=i.step)o(e)&&s%e==0||(u.tickX=f?r.x2:r.x2-i.size,u.tickY=f?r.y1-i.size:r.y1,u.position=t[s],n.append(sr(u,i)))}var i=this,t=i.options,r=i.lineBox(),f=t.labels.mirror,s=t.majorTicks.visible?t.majorUnit:0,u={vertical:t.vertical};e(i.getMajorTickPositions(),t.majorTicks);e(i.getMinorTickPositions(),t.minorTicks,s/t.minorUnit)},createLine:function(){var f=this,e=f.options,n=e.line,t=f.lineBox(),i,u;n.width>0&&n.visible&&(i=new r.Path({stroke:{width:n.width,color:n.color,dashType:n.dashType}}),i.moveTo(t.x1,t.y1).lineTo(t.x2,t.y2),e._alignLines&&wt(i),u=this._lineGroup=new r.Group,u.append(i),this.visual.append(u),this.createTicks(u))},getActualTickSize:function(){var r=this,n=r.options,i=0;return n.majorTicks.visible&&n.minorTicks.visible?i=t.max(n.majorTicks.size,n.minorTicks.size):n.majorTicks.visible?i=n.majorTicks.size:n.minorTicks.visible&&(i=n.minorTicks.size),i},createBackground:function(){var n=this,i=n.options,t=i.background,u=n.box;t&&(n._backgroundPath=r.Path.fromRect(u.toRect(),{fill:{color:t},stroke:null}),this.visual.append(n._backgroundPath))},createPlotBands:function(){var t=this,o=t.options,s=o.plotBands||[],c=o.vertical,h=t.plotArea,i,u,l,a,f,e;s.length!==0&&(f=this._plotbandGroup=new r.Group({zIndex:-1}),e=n.grep(t.pane.axes,function(n){return n.options.vertical!==t.options.vertical})[0],n.each(s,function(n,o){if(l=lt(o.from,oi),a=lt(o.to,ei),c?(i=(e||h.axisX).lineBox(),u=t.getSlot(o.from,o.to,!0)):(i=t.getSlot(o.from,o.to,!0),u=(e||h.axisY).lineBox()),i.width()!==0&&u.height()!==0){var s=new k.Rect([i.x1,u.y1],[i.width(),u.height()]),v=r.Path.fromRect(s,{fill:{color:o.color,opacity:o.opacity},stroke:null});f.append(v)}}),t.appendVisual(f))},createGridLines:function(n){function c(n,t,u){var e=n.length,f;if(t.visible)for(f=t.skip;f<e;f+=t.step)r=i(n[f]),et(r,s)||f%u==0||l&&y===r||(o.position=r,h.append(hr(o,t)),s.push(r))}var f=this,t=f.options,l=n.options.line.visible,a=t.majorGridLines,v=a.visible?t.majorUnit:0,u=t.vertical,e=n.lineBox(),y=e[u?"y1":"x1"],o={lineStart:e[u?"x1":"y1"],lineEnd:e[u?"x2":"y2"],vertical:u},r,s=[],h=this.gridLinesVisual();return c(f.getMajorTickPositions(),t.majorGridLines),c(f.getMinorTickPositions(),t.minorGridLines,v/t.minorUnit),h.children},reflow:function(n){for(var i=this,h=i.options,c=h.vertical,l=i.labels,v=l.length,a=i.title,e=c?ii:kt,y=a?a.box[e]():0,o=i.getActualTickSize()+h.margin+y,r=0,p=(this.getRoot()||{}).box||n,w=p[e](),s,f=0;f<v;f++)s=l[f].box[e](),s+o<=w&&(r=t.max(r,s));i.box=c?u(n.x1,n.y1,n.x1+r+o,n.y2):u(n.x1,n.y1,n.x2,n.y1+r+o);i.arrangeTitle();i.arrangeLabels();i.arrangeNotes()},getLabelsTickPositions:function(){return this.getMajorTickPositions()},labelTickIndex:function(n){return n.index},arrangeLabels:function(){for(var t=this,s=t.options,k=t.labels,d=!s.justified,nt=s.vertical,tt=t.lineBox(),it=s.labels.mirror,r=t.getLabelsTickPositions(),h=t.getActualTickSize()+s.margin,w,f,c=0;c<k.length;c++){var n=k[c],e=t.labelTickIndex(n),b=nt?n.box.height():n.box.width(),a=r[e]-b/2,i,o,rt,v;nt?(d&&(i=r[e],o=r[e+1],rt=i+(o-i)/2,a=rt-b/2),v=tt.x2,it?(v+=h,n.options.rotationOrigin=y):(v-=h+n.box.width(),n.options.rotationOrigin=g),w=n.box.move(v,a)):(d?(i=r[e],o=r[e+1]):(i=a,o=a+b),f=tt.y1,it?(f-=h+n.box.height(),n.options.rotationOrigin=p):(f+=h,n.options.rotationOrigin=l),w=u(i,f,o,f+n.box.height()));n.reflow(w)}},autoRotateLabels:function(){if(this.options.autoRotateLabels&&!this.options.vertical){for(var e=this.getMajorTickPositions(),t=this.labels,r,i,f,n=0;n<t.length;n++)if(f=e[n+1]-e[n],r=t[n].box,r.width()>f){if(r.height()>f){i=-90;break}i=-45}if(i){for(n=0;n<t.length;n++)t[n].options.rotation=i,t[n].reflow(u());return!0}}},arrangeTitle:function(){var t=this,i=t.options,r=i.labels.mirror,u=i.vertical,n=t.title;n&&(u?(n.options.align=r?g:y,n.options.vAlign=n.options.position):(n.options.align=n.options.position,n.options.vAlign=r?l:p),n.reflow(t.box))},arrangeNotes:function(){for(var t=this,n,u,r,i=0;i<t.notes.length;i++)n=t.notes[i],r=n.options.value,o(r)?(t.shouldRenderNote(r)?n.show():n.hide(),u=t.getSlot(r)):n.hide(),n.reflow(u||t.lineBox())},alignTo:function(n){var t=this,r=n.lineBox(),u=t.options.vertical,i=u?e:f;t.box.snapTo(r,i);u?t.box.shrink(0,t.lineBox().height()-r.height()):t.box.shrink(t.lineBox().width()-r.width(),0);t.box[i+1]-=t.lineBox()[i+1]-r[i+1];t.box[i+2]-=t.lineBox()[i+2]-r[i+2]},axisLabelText:function(n,t,i){var r=n,u;return i.template?(u=pi(i.template),r=u({value:n,dataItem:t,format:i.format,culture:i.culture})):i.format&&(r=i.format.match(nr)?b.format(i.format,n):b.toString(n,i.format,i.culture)),r},slot:function(n,t){var i=this.getSlot(n,t);if(i)return i.toRect()},contentBox:function(){var t=this.box.clone(),n=this.labels;return n.length&&(n[0].options.visible&&t.wrap(n[0].box),ot(n).options.visible&&t.wrap(ot(n).box)),t},limitRange:function(n,t,i,r){var u=this.options,f=t-n;return n<i&&(!o(u.min)||i<u.min)?(n=i,t=n+f):r<t&&(!o(u.max)||u.max<r)&&(t=r,n=t-f),n>=i&&r>=t?{min:n,max:t}:void 0}}),cr=tt.extend({init:function(n,t,i,r,u,f){var e=this;tt.fn.init.call(e,f);e.value=n;e.text=t;e.dataItem=i;e.category=r;e.series=u;e.render()},options:{icon:{visible:!0,type:bt},label:{position:tr,visible:!0,align:d,vAlign:d},line:{visible:!0},visible:!0,position:l,zIndex:2},hide:function(){this.options.visible=!1},show:function(){this.options.visible=!0},render:function(){var n=this,c=n.options,i=c.label,r=n.text,f=c.icon,s=f.size,l=u(),e,a,v,y;c.visible&&(o(i)&&i.visible&&(i.template?(y=pi(i.template),r=y({dataItem:n.dataItem,category:n.category,value:n.value,text:r,series:n.series})):i.format&&(r=pr(i.format,r)),n.label=new ut(r,h({},i)),i.position!==tr||o(s)||(f.type===bt?s=t.max(n.label.box.width(),n.label.box.height()):(a=n.label.box.width(),v=n.label.box.height()),l.wrap(n.label.box))),f.width=a||s||di,f.height=v||s||di,e=new lr(h({},f)),n.marker=e,n.append(e),n.label&&n.append(n.label),e.reflow(u()),n.wrapperBox=l.wrap(e.box))},reflow:function(n){var r=this,u=r.options,f=n.center(),e=r.wrapperBox,c=u.line.length,o=u.position,s=r.label,l=r.marker,i,h,t;u.visible&&(et(o,[y,g])?o===y?(t=e.alignTo(n,o).translate(-c,n.center().y-e.center().y),u.line.visible&&(i=[n.x1,f.y],r.linePoints=[i,[t.x2,f.y]],h=t.clone().wrapPoint(i))):(t=e.alignTo(n,o).translate(c,n.center().y-e.center().y),u.line.visible&&(i=[n.x2,f.y],r.linePoints=[i,[t.x1,f.y]],h=t.clone().wrapPoint(i))):o===p?(t=e.alignTo(n,o).translate(n.center().x-e.center().x,c),u.line.visible&&(i=[f.x,n.y2],r.linePoints=[i,[f.x,t.y1]],h=t.clone().wrapPoint(i))):(t=e.alignTo(n,o).translate(n.center().x-e.center().x,-c),u.line.visible&&(i=[f.x,n.y1],r.linePoints=[i,[f.x,t.y2]],h=t.clone().wrapPoint(i))),l&&l.reflow(t),s&&(s.reflow(t),l&&(u.label.position===ni&&s.box.alignTo(l.box,o),s.reflow(s.box))),r.contentBox=t,r.targetBox=n,r.box=h||t)},createVisual:function(){tt.fn.createVisual.call(this);this.options.visible&&this.createLine()},renderVisual:function(){var n=this,t=n.options,i=t.visual;t.visible&&i?(n.visual=i({dataItem:n.dataItem,category:n.category,value:n.value,text:n.text,sender:n.getChart(),series:n.series,rect:n.targetBox.toRect(),options:{background:t.background,border:t.background,icon:t.icon,label:t.label,line:t.line,position:t.position,visible:t.visible},createVisual:function(){n.createVisual();n.renderChildren();var t=n.visual;return delete n.visual,t}}),n.addVisual()):tt.fn.renderVisual.call(n)},createLine:function(){var n=this.options.line,t;this.linePoints&&(t=r.Path.fromPoints(this.linePoints,{stroke:{color:n.color,width:n.width,dashType:n.dashType}}),wt(t),this.visual.append(t))},click:function(n,t){var i=this.eventArgs(t);n.trigger(ir,i)||t.preventDefault()},hover:function(n,t){var i=this.eventArgs(t);n.trigger(rr,i)||t.preventDefault()},leave:function(n){n._unsetActivePoint()},eventArgs:function(t){var i=this,r=i.options;return{element:n(t.target),text:o(r.label)?r.label.text:"",dataItem:i.dataItem,series:i.series,value:i.value,category:i.category,visual:i.visual}}}),lr=tt.extend({init:function(n,t){this.pointData=t;tt.fn.init.call(this,n)},options:{type:bt,align:d,vAlign:d},getElement:function(){var f=this,e=f.options,o=e.type,h=e.rotation,n=f.paddingBox,t,c=n.center(),s=n.width()/2,u;if(e.visible&&f.hasBox())return u=f.visualStyle(),o===bt?t=new r.Circle(new k.Circle([i(n.x1+s,nt),i(n.y1+n.height()/2,nt)],s),u):o===iu?t=r.Path.fromPoints([[n.x1+s,n.y1],[n.x1,n.y2],[n.x2,n.y2]],u).close():o===tu?(t=new r.MultiPath(u),t.moveTo(n.x1,n.y1).lineTo(n.x2,n.y2),t.moveTo(n.x1,n.y2).lineTo(n.x2,n.y1)):t=r.Path.fromRect(n.toRect(),u),h&&t.transform(k.transform().rotate(-h,[c.x,c.y])),t.options.zIndex=this.options.zIndex,t},createElement:function(){var n=this,i=n.options.visual,t=n.pointData||{};return i?i({value:t.value,dataItem:t.dataItem,sender:n.getChart(),series:t.series,category:t.category,rect:n.paddingBox.toRect(),options:n.visualOptions(),createVisual:function(){return n.getElement()}}):n.getElement()},visualOptions:function(){var n=this.options;return{background:n.background,border:n.border,margin:n.margin,padding:n.padding,type:n.type,size:n.width,visible:n.visible}},createVisual:function(){this.visual=this.createElement()}}),uu=yt.extend({init:function(n,t,i){var r=this,u=r.initDefaults(n,t,i);yt.fn.init.call(r,u)},startValue:function(){return 0},options:{type:"numeric",min:0,max:1,vertical:!0,majorGridLines:{visible:!0,width:1,color:ft},labels:{format:"#.####################"},zIndex:1},initDefaults:function(n,i,r){var l=this,a=r.narrowRange,e=l.autoAxisMin(n,i,a),s=l.autoAxisMax(n,i,a),f=hi(e,s),u={majorUnit:f},c;return r.roundToMajorUnit!==!1&&(e<0&&yr(e,f,1/3)&&(e-=f),s>0&&yr(s,f,1/3)&&(s+=f)),u.min=li(e,f),u.max=ci(s,f),this.totalMin=o(r.min)?t.min(u.min,r.min):u.min,this.totalMax=o(r.max)?t.max(u.max,r.max):u.max,this.totalMajorUnit=f,r&&(c=o(r.min)||o(r.max),c&&r.min===r.max&&(r.min>0?r.min=0:r.max=1),r.majorUnit?(u.min=li(u.min,r.majorUnit),u.max=ci(u.max,r.majorUnit)):c&&(r=h(u,r),u.majorUnit=hi(r.min,r.max))),u.minorUnit=(r.majorUnit||u.majorUnit)/5,h(u,r)},range:function(){var n=this.options;return{min:n.min,max:n.max}},autoAxisMax:function(n,i,r){var u,f;if(!n&&!i)return 1;if(n<=0&&i<=0){if(i=n==i?0:i,f=t.abs((i-n)/i),r===!1||!r&&f>ur)return 0;u=t.min(0,i-(n-i)/2)}else n=n==i?0:n,u=i;return u},autoAxisMin:function(n,i,r){var u,f;if(!n&&!i)return 0;if(n>=0&&i>=0){if(n=n==i?0:n,f=(i-n)/i,r===!1||!r&&f>ur)return 0;u=t.max(0,n-(i-n)/2)}else i=n==i?0:i,u=n;return u},getDivisions:function(n){if(n===0)return 1;var r=this.options,u=r.max-r.min;return t.floor(i(u/n,nt))+1},getTickPositions:function(n,t){var o=this,r=o.options,s=r.vertical,y=r.reverse,h=o.lineBox(),p=s?h.height():h.width(),w=r.max-r.min,b=p/w,k=n*b,l=0,d=o.getDivisions(n),a=(s?-1:1)*(y?-1:1),g=a===1?1:2,c=h[(s?e:f)+g],v=[],u;for(t&&(l=t/n),u=0;u<d;u++)u%l!=0&&v.push(i(c,nt)),c=c+k*a;return v},getMajorTickPositions:function(){var n=this;return n.getTickPositions(n.options.majorUnit)},getMinorTickPositions:function(){var n=this;return n.getTickPositions(n.options.minorUnit)},getSlot:function(n,i,r){var w=this,s=w.options,c=s.reverse,v=s.vertical,y=v?e:f,h=w.lineBox(),b=h[y+(c?2:1)],d=v?h.height():h.width(),g=c?-1:1,k=g*(d/(s.max-s.min)),l,a,p=new u(h.x1,h.y1,h.x1,h.y1);return o(n)||(n=i||0),o(i)||(i=n||0),r&&(n=t.max(t.min(n,s.max),s.min),i=t.max(t.min(i,s.max),s.min)),v?(l=s.max-t.max(n,i),a=s.max-t.min(n,i)):(l=t.min(n,i)-s.min,a=t.max(n,i)-s.min),p[y+1]=t.max(t.min(b+k*(c?a:l),dt),-dt),p[y+2]=t.max(t.min(b+k*(c?l:a),dt),-dt),p},getValue:function(n){var s=this,t=s.options,h=t.reverse,r=t.vertical,l=t.max*1,a=t.min*1,v=r?e:f,u=s.lineBox(),b=u[v+(h?2:1)],y=r?u.height():u.width(),k=h?-1:1,o=k*(n[v]-b),d=(l-a)/y,p=o*d,w;return o<0||o>y?null:(w=r?l-p:a+p,i(w,c))},translateRange:function(n){var f=this,t=f.options,e=f.lineBox(),u=t.vertical,o=t.reverse,s=u?e.height():e.width(),h=t.max-t.min,l=s/h,r=i(n/l,c);return!(u||o)||u&&o||(r=-r),{min:t.min+r,max:t.max+r}},scaleRange:function(n){var r=this,t=r.options,i=-n*t.majorUnit;return{min:t.min-i,max:t.max+i}},labelsCount:function(){return this.getDivisions(this.options.majorUnit)},createAxisLabel:function(n,t){var r=this,u=r.options,f=i(u.min+n*u.majorUnit,c),e=r.axisLabelText(f,null,t);return new vt(f,e,n,null,t)},shouldRenderNote:function(n){var t=this.range();return t.min<=n&&n<=t.max},pan:function(n){var t=this.translateRange(n);return this.limitRange(t.min,t.max,this.totalMin,this.totalMax)},pointsRange:function(n,i){var r=this.getValue(n),u=this.getValue(i),f=t.min(r,u),e=t.max(r,u);return{min:f,max:e}},zoomRange:function(n){var t=this.scaleRange(n),i=this.totalMax,r=this.totalMin,u=it.limitValue(t.min,r,i),f=it.limitValue(t.max,r,i),e=this.options.max-this.options.min;if(e<this.totalMajorUnit||f-u>=this.totalMajorUnit)return{min:u,max:f}}}),fu=yt.extend({init:function(n,t,i){this.options=this._initOptions(n,t,i);yt.fn.init.call(this,i)},startValue:function(){return this.options.min},options:{type:"log",majorUnit:10,minorUnit:1,axisCrossingValue:1,vertical:!0,majorGridLines:{visible:!0,width:1,color:ft},zIndex:1},getSlot:function(n,i,r){var c=this,s=c.options,l=s.reverse,y=s.vertical,p=y?e:f,h=c.lineBox(),g=h[p+(l?2:1)],it=y?h.height():h.width(),rt=l?-1:1,nt=s.majorUnit,b=c.logMin,k=c.logMax,tt=rt*(it/(k-b)),a,v,d=new u(h.x1,h.y1,h.x1,h.y1);if(o(n)||(n=i||1),o(i)||(i=n||1),!(n<=0)&&!(i<=0))return r&&(n=t.max(t.min(n,s.max),s.min),i=t.max(t.min(i,s.max),s.min)),n=w(n,nt),i=w(i,nt),y?(a=k-t.max(n,i),v=k-t.min(n,i)):(a=t.min(n,i)-b,v=t.max(n,i)-b),d[p+1]=g+tt*(l?v:a),d[p+2]=g+tt*(l?a:v),d},getValue:function(n){var r=this,u=r.options,w=u.reverse,o=u.vertical,s=r.lineBox(),b=u.majorUnit,l=r.logMin,k=r.logMax,a=o===w?1:-1,d=a===1?1:2,v=o?s.height():s.width(),g=(k-l)/v,y=o?e:f,nt=s[y+d],h=a*(n[y]-nt),tt=h*g,p;return h<0||h>v?null:(p=l+tt,i(t.pow(b,p),c))},range:function(){var n=this.options;return{min:n.min,max:n.max}},scaleRange:function(n){var i=this,f=i.options,r=f.majorUnit,u=-n;return{min:t.pow(r,i.logMin-u),max:t.pow(r,i.logMax+u)}},translateRange:function(n){var r=this,f=r.options,o=f.majorUnit,s=r.lineBox(),e=f.vertical,h=f.reverse,l=e?s.height():s.width(),a=l/(r.logMax-r.logMin),u=i(n/a,c);return!(e||h)||e&&h||(u=-u),{min:t.pow(o,r.logMin+u),max:t.pow(o,r.logMax+u)}},labelsCount:function(){var n=this,i=t.floor(n.logMax);return t.floor(i-n.logMin)+1},getMajorTickPositions:function(){var t=this,n=[];return t.traverseMajorTicksPositions(function(t){n.push(t)},{step:1,skip:0}),n},createTicks:function(n){function s(t,i){u.tickX=f?r.x2:r.x2-i.size;u.tickY=f?r.y1-i.size:r.y1;u.position=t;n.append(sr(u,i))}var t=this,i=t.options,r=t.lineBox(),f=i.labels.mirror,e=i.majorTicks,o=i.minorTicks,u={vertical:i.vertical};return e.visible&&t.traverseMajorTicksPositions(s,e),o.visible&&t.traverseMinorTicksPositions(s,o),[]},createGridLines:function(n){function c(n,t){et(n,s)||(o.position=n,h.append(hr(o,t)),s.push(n))}var t=this,i=t.options,u=i.majorGridLines,f=i.minorGridLines,r=i.vertical,e=n.lineBox(),o={lineStart:e[r?"x1":"y1"],lineEnd:e[r?"x2":"y2"],vertical:r},s=[],h=this.gridLinesVisual();return u.visible&&t.traverseMajorTicksPositions(c,u),f.visible&&t.traverseMinorTicksPositions(c,f),h.children},traverseMajorTicksPositions:function(n,r){for(var f=this,e=f._lineOptions(),h=e.lineStart,l=e.step,o=f.logMin,a=f.logMax,s,u=t.ceil(o)+r.skip;u<=a;u+=r.step)s=i(h+l*(u-o),c),n(s,r)},traverseMinorTicksPositions:function(n,r){for(var u=this,f=u.options,l=u._lineOptions(),y=l.lineStart,p=l.step,b=f.majorUnit,a=u.logMin,k=u.logMax,d=t.floor(a),g=f.max,nt=f.min,tt=f.minorUnit,o,v,h,s,e=d;e<k;e++)for(h=u._minorIntervalOptions(e),s=r.skip;s<tt;s+=r.step){if(o=h.value+s*h.minorStep,o>g)break;o>=nt&&(v=i(y+p*(w(o,b)-a),c),n(v,r))}},createAxisLabel:function(n,i){var r=this,f=r.options,e=t.ceil(r.logMin+n),u=Math.pow(f.majorUnit,e),o=r.axisLabelText(u,null,i);return new vt(u,o,n,null,i)},shouldRenderNote:function(n){var t=this.range();return t.min<=n&&n<=t.max},_throwNegativeValuesError:function(){throw new Error("Non positive values cannot be used for a logarithmic axis");},_initOptions:function(n,r,u){var e=this,f=h({},e.options,{min:n,max:r},u),l=f.min,a=f.max,s=f.majorUnit,v=this._autoMax(r,s),y=this._autoMin(n,r,f);return f.axisCrossingValue<=0&&e._throwNegativeValuesError(),o(u.max)?u.max<=0&&e._throwNegativeValuesError():a=v,o(u.min)?u.min<=0&&e._throwNegativeValuesError():l=y,this.totalMin=o(u.min)?t.min(y,u.min):y,this.totalMax=o(u.max)?t.max(v,u.max):v,e.logMin=i(w(l,s),c),e.logMax=i(w(a,s),c),f.max=a,f.min=l,f.minorUnit=u.minorUnit||i(s-1,c),f},_autoMin:function(n,i,r){var u=n,f=r.majorUnit;return n<=0?u=i<=1?t.pow(f,-2):1:r.narrowRange||(u=t.pow(f,t.floor(w(n,f)))),u},_autoMax:function(n,r){var u=i(w(n,r),c)%1;return n<=0?r:u!==0&&(u<.3||u>.9)?t.pow(r,w(n,r)+.2):t.pow(r,t.ceil(w(n,r)))},pan:function(n){var t=this.translateRange(n);return this.limitRange(t.min,t.max,this.totalMin,this.totalMax,-n)},pointsRange:function(n,i){var r=this.getValue(n),u=this.getValue(i),f=t.min(r,u),e=t.max(r,u);return{min:f,max:e}},zoomRange:function(n){var t=this.options,s=this.scaleRange(n),u=this.totalMax,f=this.totalMin,e=it.limitValue(s.min,f,u),o=it.limitValue(s.max,f,u),r=t.majorUnit,h=o>e&&t.min&&t.max&&i(w(t.max,r)-w(t.min,r),c)<1,l=!(t.min===f&&t.max===u)&&i(w(o,r)-w(e,r),c)>=1;if(h||l)return{min:e,max:o}},_minorIntervalOptions:function(n){var i=this.options.majorUnit,r=t.pow(i,n),u=t.pow(i,n+1),f=u-r,e=f/this.options.minorUnit;return{value:r,minorStep:e}},_lineOptions:function(){var n=this,r=n.options,o=r.reverse,i=r.vertical,s=i?e:f,t=n.lineBox(),u=i===o?1:-1,h=u===1?1:2,c=i?t.height():t.width(),l=u*(c/(n.logMax-n.logMin)),a=t[s+h];return{step:l,lineStart:a,lineBox:t}}});ht.Gradients={glass:{type:"linear",rotation:0,stops:[{offset:0,color:s,opacity:0},{offset:.25,color:s,opacity:.3},{offset:1,color:s,opacity:0}]},sharpBevel:{type:ti,stops:[{offset:0,color:s,opacity:.55},{offset:.65,color:s,opacity:0},{offset:.95,color:s,opacity:.25}]},roundedBevel:{type:ti,stops:[{offset:.33,color:s,opacity:.06},{offset:.83,color:s,opacity:.2},{offset:.95,color:s,opacity:0}]},roundedGlass:{type:ti,supportVML:!1,stops:[{offset:0,color:s,opacity:0},{offset:.5,color:s,opacity:.3},{offset:.99,color:s,opacity:0}]},sharpGlass:{type:ti,supportVML:!1,stops:[{offset:0,color:s,opacity:.2},{offset:.15,color:s,opacity:.15},{offset:.17,color:s,opacity:.35},{offset:.85,color:s,opacity:.05},{offset:.87,color:s,opacity:.15},{offset:.99,color:s,opacity:0}]}};ar={extend:function(n,t){if(!n.exportVisual)throw new Error("Mixin target has no exportVisual method defined.");n.exportSVG=this.exportSVG;n.exportImage=this.exportImage;n.exportPDF=this.exportPDF;t||(n.svg=this.svg,n.imageDataURL=this.imageDataURL)},exportSVG:function(n){return r.exportSVG(this.exportVisual(),n)},exportImage:function(n){return r.exportImage(this.exportVisual(n),n)},exportPDF:function(n){return r.exportPDF(this.exportVisual(),n)},svg:function(){if(r.svg.Surface)return r.svg._exportGroup(this.exportVisual());throw new Error("SVG Export failed. Unable to export instantiate kendo.drawing.svg.Surface");},imageDataURL:function(){var i,t,u;if(!b.support.canvas)return null;if(r.canvas.Surface)return i=n("<div />").css({display:"none",width:this.element.width(),height:this.element.height()}).appendTo(document.body),t=new r.canvas.Surface(i),t.draw(this.exportVisual()),u=t._rootElement.toDataURL(),t.destroy(),i.remove(),u;throw new Error("Image Export failed. Unable to export instantiate kendo.drawing.canvas.Surface");}};ri=function(n){this.closed=n};ri.prototype=ri.fn={WEIGHT:.333,EXTREMUM_ALLOWED_DEVIATION:.01,process:function(n){var s=this,p=s.closed,t=n.slice(0),h=t.length,u=[],o,i,c,l,w,b,v,y,a,k;if(h>2&&(s.removeDuplicates(0,t),h=t.length),h<2||h==2&&t[0].equals(t[1]))return u;for(o=t[0],i=t[1],c=t[2],u.push(new r.Segment(o));o.equals(t[h-1]);)p=!0,t.pop(),h--;if(h==2)return v=s.tangent(o,i,f,e),ot(u).controlOut(s.firstControlPoint(v,o,i,f,e)),u.push(new r.Segment(i,s.secondControlPoint(v,o,i,f,e))),u;for(p?(o=t[h-1],i=t[0],c=t[1],l=s.controlPoints(o,i,c),w=l[1],b=l[0]):(v=s.tangent(o,i,f,e),w=s.firstControlPoint(v,o,i,f,e)),y=w,a=0;a<=h-3;a++)s.removeDuplicates(a,t),h=t.length,a+3<=h&&(o=t[a],i=t[a+1],c=t[a+2],l=s.controlPoints(o,i,c),ot(u).controlOut(y),y=l[1],k=l[0],u.push(new r.Segment(i,k)));return p?(o=t[h-2],i=t[h-1],c=t[0],l=s.controlPoints(o,i,c),ot(u).controlOut(y),u.push(new r.Segment(i,l[0])),ot(u).controlOut(l[1]),u.push(new r.Segment(c,b))):(v=s.tangent(i,c,f,e),ot(u).controlOut(y),u.push(new r.Segment(c,s.secondControlPoint(v,i,c,f,e)))),u},removeDuplicates:function(n,t){while(t[n].equals(t[n+1])||t[n+1].equals(t[n+2]))t.splice(n+1,1)},invertAxis:function(n,t,i){var f=this,e,u,r=!1;return n.x===t.x?r=!0:t.x===i.x?(t.y<i.y&&n.y<=t.y||i.y<t.y&&t.y<=n.y)&&(r=!0):(e=f.lineFunction(n,t),u=f.calculateFunction(e,i.x),n.y<=t.y&&i.y<=u||t.y<=n.y&&i.y>=u||(r=!0)),r},isLine:function(n,t,r){var u=this,f=u.lineFunction(n,t),e=u.calculateFunction(f,r.x);return n.x==t.x&&t.x==r.x||i(e,1)===i(r.y,1)},lineFunction:function(n,t){var i=(t.y-n.y)/(t.x-n.x),r=n.y-i*n.x;return[r,i]},controlPoints:function(n,t,i){var u=this,o=f,r=e,a=!1,v=!1,s,h,c,l,w=u.EXTREMUM_ALLOWED_DEVIATION,y,p;return u.isLine(n,t,i)?s=u.tangent(n,t,f,e):(h={x:u.isMonotonicByField(n,t,i,f),y:u.isMonotonicByField(n,t,i,e)},h.x&&h.y?(s=u.tangent(n,i,f,e),a=!0):(u.invertAxis(n,t,i)&&(o=e,r=f),h[o]?s=0:(y=i[r]<n[r]&&n[r]<=t[r]||n[r]<i[r]&&t[r]<=n[r]?u.sign((i[r]-n[r])*(t[o]-n[o])):-u.sign((i[o]-n[o])*(t[r]-n[r])),s=w*y,v=!0))),l=u.secondControlPoint(s,n,t,o,r),v&&(p=o,o=r,r=p),c=u.firstControlPoint(s,t,i,o,r),a&&(u.restrictControlPoint(n,t,l,s),u.restrictControlPoint(t,i,c,s)),[l,c]},sign:function(n){return n<=0?-1:1},restrictControlPoint:function(n,t,i,r){n.y<t.y?t.y<i.y?(i.x=n.x+(t.y-n.y)/r,i.y=t.y):i.y<n.y&&(i.x=t.x-(t.y-n.y)/r,i.y=n.y):i.y<t.y?(i.x=n.x-(n.y-t.y)/r,i.y=t.y):n.y<i.y&&(i.x=t.x+(n.y-t.y)/r,i.y=n.y)},tangent:function(n,t,i,r){var u=t[i]-n[i],f=t[r]-n[r];return u===0?0:f/u},isMonotonicByField:function(n,t,i,r){return i[r]>t[r]&&t[r]>n[r]||i[r]<t[r]&&t[r]<n[r]},firstControlPoint:function(n,t,i,r,u){var f=this,e=t[r],s=i[r],o=(s-e)*f.WEIGHT;return f.point(e+o,t[u]+o*n,r,u)},secondControlPoint:function(n,t,i,r,u){var f=this,s=t[r],e=i[r],o=(e-s)*f.WEIGHT;return f.point(e-o,i[u]-o*n,r,u)},point:function(n,t,i,r){var u=new k.Point;return u[i]=n,u[r]=t,u},calculateFunction:function(n,t){for(var r=0,u=n.length,i=0;i<u;i++)r+=Math.pow(t,i)*n[i];return r}};ai._element=document.createElement("span");h(b.dataviz,{AXIS_LABEL_CLICK:wi,COORD_PRECISION:nt,DEFAULT_PRECISION:c,DEFAULT_WIDTH:gi,DEFAULT_HEIGHT:ki,DEFAULT_FONT:bi,INITIAL_ANIMATION_DURATION:600,NOTE_CLICK:ir,NOTE_HOVER:rr,CLIP:"clip",Axis:yt,AxisLabel:vt,Box2D:u,BoxElement:tt,ChartElement:v,CurveProcessor:ri,ExportMixin:ar,FloatElement:or,LogarithmicAxis:fu,Note:cr,NumericAxis:uu,Point2D:a,Ring:st,RootElement:ru,Sector:fr,ShapeBuilder:at,ShapeElement:lr,Text:er,TextBox:ut,Title:si,alignPathToPixel:wt,autoFormat:pr,autoMajorUnit:hi,boxDiff:vr,dateComparer:su,decodeEntities:ai,getSpacing:rt,inArray:et,interpolateValue:eu,mwDelta:hu,rectToBox:vi,rotatePoint:pt,round:i,ceil:ci,floor:li})})(window.kendo.jQuery)}(),function(){(function(n){function h(t,i){return n.map(t,function(n,t){return[[n,i[t]]]})}var c=window.kendo,l=c.dataviz.ui,u=c.deepExtend,o=1.5,f=.4,r="#000",s="Arial,Helvetica,sans-serif",v="11px "+s,e="12px "+s,a="16px "+s,t="#fff",y={title:{font:a},legend:{labels:{font:e}},seriesDefaults:{visible:!0,labels:{font:v},donut:{margin:1},line:{width:2},vericalLine:{width:2},scatterLine:{width:1},area:{opacity:.4,markers:{visible:!1,size:6},highlight:{markers:{border:{color:"#fff",opacity:1,width:1}}},line:{opacity:1,width:0}},verticalArea:{opacity:.4,markers:{visible:!1,size:6},line:{opacity:1,width:0}},radarLine:{width:2,markers:{visible:!1}},radarArea:{opacity:.5,markers:{visible:!1,size:6},line:{opacity:1,width:0}},candlestick:{line:{width:1,color:r},border:{width:1,_brightness:.8},gap:1,spacing:.3,downColor:t,highlight:{line:{width:2},border:{width:2,opacity:1}}},ohlc:{line:{width:1},gap:1,spacing:.3,highlight:{line:{width:3,opacity:1}}},bubble:{opacity:.6,border:{width:0},labels:{background:"transparent"}},bar:{gap:o,spacing:f},column:{gap:o,spacing:f},rangeColumn:{gap:o,spacing:f},rangeBar:{gap:o,spacing:f},waterfall:{gap:.5,spacing:f,line:{width:1,color:r}},horizontalWaterfall:{gap:.5,spacing:f,line:{width:1,color:r}},bullet:{gap:o,spacing:f,target:{color:"#ff0000"}},verticalBullet:{gap:o,spacing:f,target:{color:"#ff0000"}},boxPlot:{outliersField:"",meanField:"",whiskers:{width:1,color:r},mean:{width:1,color:r},median:{width:1,color:r},border:{width:1,_brightness:.8},gap:1,spacing:.3,downColor:t,highlight:{whiskers:{width:2},border:{width:2,opacity:1}}},funnel:{labels:{color:"",background:""}},notes:{icon:{border:{width:1}},label:{padding:3,font:e},line:{length:10,width:1},visible:!0}},categoryAxis:{majorGridLines:{visible:!0}},axisDefaults:{labels:{font:e},title:{font:a,margin:5},crosshair:{tooltip:{font:e}},notes:{icon:{size:7,border:{width:1}},label:{padding:3,font:e},line:{length:10,width:1},visible:!0}},tooltip:{font:e},navigator:{pane:{height:90,margin:{top:10}}}},p={scale:{labels:{font:e}}},w={shapeDefaults:{hover:{opacity:.2},stroke:{width:0}},editable:{resize:{handles:{width:7,height:7}}},selectable:{stroke:{width:1,dashType:"dot"}},connectionDefaults:{stroke:{width:2},selection:{handles:{width:8,height:8}},editable:{tools:["edit","delete"]}}},b=l.themes,i=l.registerTheme=function(n,t){var r={},i;r.chart=u({},y,t.chart);r.gauge=u({},p,t.gauge);r.diagram=u({},w,t.diagram);r.treeMap=u({},t.treeMap);i=r.chart.seriesDefaults;i.verticalLine=u({},i.line);i.verticalArea=u({},i.area);i.polarArea=u({},i.radarArea);i.polarLine=u({},i.radarLine);b[n]=r};i("black",{chart:{title:{color:t},legend:{labels:{color:t},inactiveItems:{labels:{color:"#919191"},markers:{color:"#919191"}}},seriesDefaults:{labels:{color:t},errorBars:{color:t},notes:{icon:{background:"#3b3b3b",border:{color:"#8e8e8e"}},label:{color:t},line:{color:"#8e8e8e"}},pie:{overlay:{gradient:"sharpBevel"}},donut:{overlay:{gradient:"sharpGlass"}},line:{markers:{background:"#3d3d3d"}},scatter:{markers:{background:"#3d3d3d"}},scatterLine:{markers:{background:"#3d3d3d"}},waterfall:{line:{color:"#8e8e8e"}},horizontalWaterfall:{line:{color:"#8e8e8e"}},candlestick:{downColor:"#555",line:{color:t},border:{_brightness:1.5,opacity:1},highlight:{border:{color:t,opacity:.2}}},ohlc:{line:{color:t}}},chartArea:{background:"#3d3d3d"},seriesColors:["#0081da","#3aafff","#99c900","#ffeb3d","#b20753","#ff4195"],axisDefaults:{line:{color:"#8e8e8e"},labels:{color:t},majorGridLines:{color:"#545454"},minorGridLines:{color:"#454545"},title:{color:t},crosshair:{color:"#8e8e8e"},notes:{icon:{background:"#3b3b3b",border:{color:"#8e8e8e"}},label:{color:t},line:{color:"#8e8e8e"}}}},gauge:{pointer:{color:"#0070e4"},scale:{rangePlaceholderColor:"#1d1d1d",labels:{color:t},minorTicks:{color:t},majorTicks:{color:t},line:{color:t}}},diagram:{shapeDefaults:{fill:{color:"#0066cc"},connectorDefaults:{fill:{color:t},stroke:{color:"#384049"},hover:{fill:{color:"#3d3d3d"},stroke:{color:"#efefef"}}},content:{color:t}},editable:{resize:{handles:{fill:{color:"#3d3d3d"},stroke:{color:t},hover:{fill:{color:t},stroke:{color:t}}}},rotate:{thumb:{stroke:{color:t},fill:{color:t}}}},selectable:{stroke:{color:t}},connectionDefaults:{stroke:{color:t},content:{color:t},selection:{handles:{fill:{color:"#3d3d3d"},stroke:{color:"#efefef"}}}}},treeMap:{colors:[["#0081da","#314b5c"],["#3aafff","#3c5464"],["#99c900","#4f5931"],["#ffeb3d","#64603d"],["#b20753","#543241"],["#ff4195","#643e4f"]]}});i("blueopal",{chart:{title:{color:"#293135"},legend:{labels:{color:"#293135"},inactiveItems:{labels:{color:"#27A5BA"},markers:{color:"#27A5BA"}}},seriesDefaults:{labels:{color:r,background:t,opacity:.5},errorBars:{color:"#293135"},candlestick:{downColor:"#c4d0d5",line:{color:"#9aabb2"}},waterfall:{line:{color:"#9aabb2"}},horizontalWaterfall:{line:{color:"#9aabb2"}},notes:{icon:{background:"transparent",border:{color:"#9aabb2"}},label:{color:"#293135"},line:{color:"#9aabb2"}}},seriesColors:["#0069a5","#0098ee","#7bd2f6","#ffb800","#ff8517","#e34a00"],axisDefaults:{line:{color:"#9aabb2"},labels:{color:"#293135"},majorGridLines:{color:"#c4d0d5"},minorGridLines:{color:"#edf1f2"},title:{color:"#293135"},crosshair:{color:"#9aabb2"},notes:{icon:{background:"transparent",border:{color:"#9aabb2"}},label:{color:"#293135"},line:{color:"#9aabb2"}}}},gauge:{pointer:{color:"#005c83"},scale:{rangePlaceholderColor:"#daecf4",labels:{color:"#293135"},minorTicks:{color:"#293135"},majorTicks:{color:"#293135"},line:{color:"#293135"}}},diagram:{shapeDefaults:{fill:{color:"#7ec6e3"},connectorDefaults:{fill:{color:"#003f59"},stroke:{color:t},hover:{fill:{color:t},stroke:{color:"#003f59"}}},content:{color:"#293135"}},editable:{resize:{handles:{fill:{color:t},stroke:{color:"#003f59"},hover:{fill:{color:"#003f59"},stroke:{color:"#003f59"}}}},rotate:{thumb:{stroke:{color:"#003f59"},fill:{color:"#003f59"}}}},selectable:{stroke:{color:"#003f59"}},connectionDefaults:{stroke:{color:"#003f59"},content:{color:"#293135"},selection:{handles:{fill:{color:"#3d3d3d"},stroke:{color:"#efefef"}}}}},treeMap:{colors:[["#0069a5","#bad7e7"],["#0098ee","#b9e0f5"],["#7bd2f6","#ceeaf6"],["#ffb800","#e6e3c4"],["#ff8517","#e4d8c8"],["#e34a00","#ddccc2"]]}});i("highcontrast",{chart:{title:{color:"#ffffff"},legend:{labels:{color:"#ffffff"},inactiveItems:{labels:{color:"#66465B"},markers:{color:"#66465B"}}},seriesDefaults:{labels:{color:"#ffffff"},errorBars:{color:"#ffffff"},notes:{icon:{background:"transparent",border:{color:"#ffffff"}},label:{color:"#ffffff"},line:{color:"#ffffff"}},pie:{overlay:{gradient:"sharpGlass"}},donut:{overlay:{gradient:"sharpGlass"}},line:{markers:{background:"#2c232b"}},scatter:{markers:{background:"#2c232b"}},scatterLine:{markers:{background:"#2c232b"}},area:{opacity:.5},waterfall:{line:{color:"#ffffff"}},horizontalWaterfall:{line:{color:"#ffffff"}},candlestick:{downColor:"#664e62",line:{color:"#ffffff"},border:{_brightness:1.5,opacity:1},highlight:{border:{color:"#ffffff",opacity:1}}},ohlc:{line:{color:"#ffffff"}}},chartArea:{background:"#2c232b"},seriesColors:["#a7008f","#ffb800","#3aafff","#99c900","#b20753","#ff4195"],axisDefaults:{line:{color:"#ffffff"},labels:{color:"#ffffff"},majorGridLines:{color:"#664e62"},minorGridLines:{color:"#4f394b"},title:{color:"#ffffff"},crosshair:{color:"#ffffff"},notes:{icon:{background:"transparent",border:{color:"#ffffff"}},label:{color:"#ffffff"},line:{color:"#ffffff"}}}},gauge:{pointer:{color:"#a7008f"},scale:{rangePlaceholderColor:"#2c232b",labels:{color:"#ffffff"},minorTicks:{color:"#2c232b"},majorTicks:{color:"#664e62"},line:{color:"#ffffff"}}},diagram:{shapeDefaults:{fill:{color:"#a7018f"},connectorDefaults:{fill:{color:t},stroke:{color:"#2c232b"},hover:{fill:{color:"#2c232b"},stroke:{color:t}}},content:{color:t}},editable:{resize:{handles:{fill:{color:"#2c232b"},stroke:{color:t},hover:{fill:{color:t},stroke:{color:t}}}},rotate:{thumb:{stroke:{color:t},fill:{color:t}}}},selectable:{stroke:{color:t}},connectionDefaults:{stroke:{color:t},content:{color:t},selection:{handles:{fill:{color:"#2c232b"},stroke:{color:t}}}}},treeMap:{colors:[["#a7008f","#451c3f"],["#ffb800","#564122"],["#3aafff","#2f3f55"],["#99c900","#424422"],["#b20753","#471d33"],["#ff4195","#562940"]]}});i("default",{chart:{title:{color:"#8e8e8e"},legend:{labels:{color:"#232323"},inactiveItems:{labels:{color:"#919191"},markers:{color:"#919191"}}},seriesDefaults:{labels:{color:r,background:t,opacity:.5},errorBars:{color:"#232323"},candlestick:{downColor:"#dedede",line:{color:"#8d8d8d"}},waterfall:{line:{color:"#8e8e8e"}},horizontalWaterfall:{line:{color:"#8e8e8e"}},notes:{icon:{background:"transparent",border:{color:"#8e8e8e"}},label:{color:"#232323"},line:{color:"#8e8e8e"}}},seriesColors:["#ff6800","#a0a700","#ff8d00","#678900","#ffb53c","#396000"],axisDefaults:{line:{color:"#8e8e8e"},labels:{color:"#232323"},minorGridLines:{color:"#f0f0f0"},majorGridLines:{color:"#dfdfdf"},title:{color:"#232323"},crosshair:{color:"#8e8e8e"},notes:{icon:{background:"transparent",border:{color:"#8e8e8e"}},label:{color:"#232323"},line:{color:"#8e8e8e"}}}},gauge:{pointer:{color:"#ea7001"},scale:{rangePlaceholderColor:"#dedede",labels:{color:"#2e2e2e"},minorTicks:{color:"#2e2e2e"},majorTicks:{color:"#2e2e2e"},line:{color:"#2e2e2e"}}},diagram:{shapeDefaults:{fill:{color:"#e15613"},connectorDefaults:{fill:{color:"#282828"},stroke:{color:t},hover:{fill:{color:t},stroke:{color:"#282828"}}},content:{color:"#2e2e2e"}},editable:{resize:{handles:{fill:{color:t},stroke:{color:"#282828"},hover:{fill:{color:"#282828"},stroke:{color:"#282828"}}}},rotate:{thumb:{stroke:{color:"#282828"},fill:{color:"#282828"}}}},selectable:{stroke:{color:"#a7018f"}},connectionDefaults:{stroke:{color:"#282828"},content:{color:"#2e2e2e"},selection:{handles:{fill:{color:t},stroke:{color:"#282828"}}}}},treeMap:{colors:[["#ff6800","#edcfba"],["#a0a700","#dadcba"],["#ff8d00","#edd7ba"],["#678900","#cfd6ba"],["#ffb53c","#eddfc6"],["#396000","#c6ceba"]]}});i("silver",{chart:{title:{color:"#4e5968"},legend:{labels:{color:"#4e5968"},inactiveItems:{labels:{color:"#B1BCC8"},markers:{color:"#B1BCC8"}}},seriesDefaults:{labels:{color:"#293135",background:"#eaeaec",opacity:.5},errorBars:{color:"#4e5968"},notes:{icon:{background:"transparent",border:{color:"#4e5968"}},label:{color:"#4e5968"},line:{color:"#4e5968"}},line:{markers:{background:"#eaeaec"}},scatter:{markers:{background:"#eaeaec"}},scatterLine:{markers:{background:"#eaeaec"}},pie:{connectors:{color:"#A6B1C0"}},donut:{connectors:{color:"#A6B1C0"}},waterfall:{line:{color:"#a6b1c0"}},horizontalWaterfall:{line:{color:"#a6b1c0"}},candlestick:{downColor:"#a6afbe"}},chartArea:{background:"#eaeaec"},seriesColors:["#007bc3","#76b800","#ffae00","#ef4c00","#a419b7","#430B62"],axisDefaults:{line:{color:"#a6b1c0"},labels:{color:"#4e5968"},majorGridLines:{color:"#dcdcdf"},minorGridLines:{color:"#eeeeef"},title:{color:"#4e5968"},crosshair:{color:"#a6b1c0"},notes:{icon:{background:"transparent",border:{color:"#4e5968"}},label:{color:"#4e5968"},line:{color:"#4e5968"}}}},gauge:{pointer:{color:"#0879c0"},scale:{rangePlaceholderColor:"#f3f3f4",labels:{color:"#515967"},minorTicks:{color:"#515967"},majorTicks:{color:"#515967"},line:{color:"#515967"}}},diagram:{shapeDefaults:{fill:{color:"#1c82c2"},connectorDefaults:{fill:{color:"#515967"},stroke:{color:t},hover:{fill:{color:t},stroke:{color:"#282828"}}},content:{color:"#515967"}},editable:{resize:{handles:{fill:{color:t},stroke:{color:"#515967"},hover:{fill:{color:"#515967"},stroke:{color:"#515967"}}}},rotate:{thumb:{stroke:{color:"#515967"},fill:{color:"#515967"}}}},selectable:{stroke:{color:"#515967"}},connectionDefaults:{stroke:{color:"#515967"},content:{color:"#515967"},selection:{handles:{fill:{color:t},stroke:{color:"#515967"}}}}},treeMap:{colors:[["#007bc3","#c2dbea"],["#76b800","#dae7c3"],["#ffae00","#f5e5c3"],["#ef4c00","#f2d2c3"],["#a419b7","#e3c7e8"],["#430b62","#d0c5d7"]]}});i("metro",{chart:{title:{color:"#777777"},legend:{labels:{color:"#777777"},inactiveItems:{labels:{color:"#CBCBCB"},markers:{color:"#CBCBCB"}}},seriesDefaults:{labels:{color:r},errorBars:{color:"#777777"},notes:{icon:{background:"transparent",border:{color:"#777777"}},label:{color:"#777777"},line:{color:"#777777"}},candlestick:{downColor:"#c7c7c7",line:{color:"#787878"}},waterfall:{line:{color:"#c7c7c7"}},horizontalWaterfall:{line:{color:"#c7c7c7"}},overlay:{gradient:"none"},border:{_brightness:1}},seriesColors:["#8ebc00","#309b46","#25a0da","#ff6900","#e61e26","#d8e404","#16aba9","#7e51a1","#313131","#ed1691"],axisDefaults:{line:{color:"#c7c7c7"},labels:{color:"#777777"},minorGridLines:{color:"#c7c7c7"},majorGridLines:{color:"#c7c7c7"},title:{color:"#777777"},crosshair:{color:"#c7c7c7"},notes:{icon:{background:"transparent",border:{color:"#777777"}},label:{color:"#777777"},line:{color:"#777777"}}}},gauge:{pointer:{color:"#8ebc00"},scale:{rangePlaceholderColor:"#e6e6e6",labels:{color:"#777"},minorTicks:{color:"#777"},majorTicks:{color:"#777"},line:{color:"#777"}}},diagram:{shapeDefaults:{fill:{color:"#8ebc00"},connectorDefaults:{fill:{color:r},stroke:{color:t},hover:{fill:{color:t},stroke:{color:r}}},content:{color:"#777"}},editable:{resize:{handles:{fill:{color:t},stroke:{color:"#787878"},hover:{fill:{color:"#787878"},stroke:{color:"#787878"}}}},rotate:{thumb:{stroke:{color:"#787878"},fill:{color:"#787878"}}}},selectable:{stroke:{color:"#515967"}},connectionDefaults:{stroke:{color:"#787878"},content:{color:"#777"},selection:{handles:{fill:{color:t},stroke:{color:"#787878"}}}}},treeMap:{colors:[["#8ebc00","#e8f2cc"],["#309b46","#d6ebda"],["#25a0da","#d3ecf8"],["#ff6900","#ffe1cc"],["#e61e26","#fad2d4"],["#d8e404","#f7facd"],["#16aba9","#d0eeee"],["#7e51a1","#e5dcec"],["#313131","#d6d6d6"],["#ed1691","#fbd0e9"]]}});i("metroblack",{chart:{title:{color:"#ffffff"},legend:{labels:{color:"#ffffff"},inactiveItems:{labels:{color:"#797979"},markers:{color:"#797979"}}},seriesDefaults:{border:{_brightness:1},labels:{color:"#ffffff"},errorBars:{color:"#ffffff"},notes:{icon:{background:"transparent",border:{color:"#cecece"}},label:{color:"#ffffff"},line:{color:"#cecece"}},line:{markers:{background:"#0e0e0e"}},bubble:{opacity:.6},scatter:{markers:{background:"#0e0e0e"}},scatterLine:{markers:{background:"#0e0e0e"}},candlestick:{downColor:"#828282",line:{color:"#ffffff"}},waterfall:{line:{color:"#cecece"}},horizontalWaterfall:{line:{color:"#cecece"}},overlay:{gradient:"none"}},chartArea:{background:"#0e0e0e"},seriesColors:["#00aba9","#309b46","#8ebc00","#ff6900","#e61e26","#d8e404","#25a0da","#7e51a1","#313131","#ed1691"],axisDefaults:{line:{color:"#cecece"},labels:{color:"#ffffff"},minorGridLines:{color:"#2d2d2d"},majorGridLines:{color:"#333333"},title:{color:"#ffffff"},crosshair:{color:"#cecece"},notes:{icon:{background:"transparent",border:{color:"#cecece"}},label:{color:"#ffffff"},line:{color:"#cecece"}}}},gauge:{pointer:{color:"#00aba9"},scale:{rangePlaceholderColor:"#2d2d2d",labels:{color:"#ffffff"},minorTicks:{color:"#333333"},majorTicks:{color:"#cecece"},line:{color:"#cecece"}}},diagram:{shapeDefaults:{fill:{color:"#00aba9"},connectorDefaults:{fill:{color:t},stroke:{color:"#0e0e0e"},hover:{fill:{color:"#0e0e0e"},stroke:{color:t}}},content:{color:t}},editable:{resize:{handles:{fill:{color:"#0e0e0e"},stroke:{color:"#787878"},hover:{fill:{color:"#787878"},stroke:{color:"#787878"}}}},rotate:{thumb:{stroke:{color:t},fill:{color:t}}}},selectable:{stroke:{color:"#787878"}},connectionDefaults:{stroke:{color:t},content:{color:t},selection:{handles:{fill:{color:"#0e0e0e"},stroke:{color:t}}}}},treeMap:{colors:[["#00aba9","#0b2d2d"],["#309b46","#152a19"],["#8ebc00","#28310b"],["#ff6900","#3e200b"],["#e61e26","#391113"],["#d8e404","#36390c"],["#25a0da","#132b37"],["#7e51a1","#241b2b"],["#313131","#151515"],["#ed1691","#3b1028"]]}});i("moonlight",{chart:{title:{color:"#ffffff"},legend:{labels:{color:"#ffffff"},inactiveItems:{labels:{color:"#A1A7AB"},markers:{color:"#A1A7AB"}}},seriesDefaults:{labels:{color:"#ffffff"},errorBars:{color:"#ffffff"},notes:{icon:{background:"transparent",border:{color:"#8c909e"}},label:{color:"#ffffff"},line:{color:"#8c909e"}},pie:{overlay:{gradient:"sharpBevel"}},donut:{overlay:{gradient:"sharpGlass"}},line:{markers:{background:"#212a33"}},bubble:{opacity:.6},scatter:{markers:{background:"#212a33"}},scatterLine:{markers:{background:"#212a33"}},area:{opacity:.3},candlestick:{downColor:"#757d87",line:{color:"#ea9d06"},border:{_brightness:1.5,opacity:1},highlight:{border:{color:t,opacity:.2}}},waterfall:{line:{color:"#8c909e"}},horizontalWaterfall:{line:{color:"#8c909e"}},ohlc:{line:{color:"#ea9d06"}}},chartArea:{background:"#212a33"},seriesColors:["#ffca08","#ff710f","#ed2e24","#ff9f03","#e13c02","#a00201"],axisDefaults:{line:{color:"#8c909e"},minorTicks:{color:"#8c909e"},majorTicks:{color:"#8c909e"},labels:{color:"#ffffff"},majorGridLines:{color:"#3e424d"},minorGridLines:{color:"#2f3640"},title:{color:"#ffffff"},crosshair:{color:"#8c909e"},notes:{icon:{background:"transparent",border:{color:"#8c909e"}},label:{color:"#ffffff"},line:{color:"#8c909e"}}}},gauge:{pointer:{color:"#f4af03"},scale:{rangePlaceholderColor:"#2f3640",labels:{color:t},minorTicks:{color:"#8c909e"},majorTicks:{color:"#8c909e"},line:{color:"#8c909e"}}},diagram:{shapeDefaults:{fill:{color:"#f3ae03"},connectorDefaults:{fill:{color:t},stroke:{color:"#414550"},hover:{fill:{color:"#414550"},stroke:{color:t}}},content:{color:t}},editable:{resize:{handles:{fill:{color:"#414550"},stroke:{color:t},hover:{fill:{color:t},stroke:{color:t}}}},rotate:{thumb:{stroke:{color:t},fill:{color:t}}}},selectable:{stroke:{color:t}},connectionDefaults:{stroke:{color:t},content:{color:t},selection:{handles:{fill:{color:"#414550"},stroke:{color:t}}}}},treeMap:{colors:[["#ffca08","#4e4b2b"],["#ff710f","#4e392d"],["#ed2e24","#4b2c31"],["#ff9f03","#4e422a"],["#e13c02","#482e2a"],["#a00201","#3b232a"]]}});i("uniform",{chart:{title:{color:"#686868"},legend:{labels:{color:"#686868"},inactiveItems:{labels:{color:"#B6B6B6"},markers:{color:"#B6B6B6"}}},seriesDefaults:{labels:{color:"#686868"},errorBars:{color:"#686868"},notes:{icon:{background:"transparent",border:{color:"#9e9e9e"}},label:{color:"#686868"},line:{color:"#9e9e9e"}},pie:{overlay:{gradient:"sharpBevel"}},donut:{overlay:{gradient:"sharpGlass"}},line:{markers:{background:"#ffffff"}},bubble:{opacity:.6},scatter:{markers:{background:"#ffffff"}},scatterLine:{markers:{background:"#ffffff"}},area:{opacity:.3},candlestick:{downColor:"#cccccc",line:{color:"#cccccc"},border:{_brightness:1.5,opacity:1},highlight:{border:{color:"#cccccc",opacity:.2}}},waterfall:{line:{color:"#9e9e9e"}},horizontalWaterfall:{line:{color:"#9e9e9e"}},ohlc:{line:{color:"#cccccc"}}},chartArea:{background:"#ffffff"},seriesColors:["#527aa3","#6f91b3","#8ca7c2","#a8bdd1","#c5d3e0","#e2e9f0"],axisDefaults:{line:{color:"#9e9e9e"},minorTicks:{color:"#aaaaaa"},majorTicks:{color:"#888888"},labels:{color:"#686868"},majorGridLines:{color:"#dadada"},minorGridLines:{color:"#e7e7e7"},title:{color:"#686868"},crosshair:{color:"#9e9e9e"},notes:{icon:{background:"transparent",border:{color:"#9e9e9e"}},label:{color:"#686868"},line:{color:"#9e9e9e"}}}},gauge:{pointer:{color:"#527aa3"},scale:{rangePlaceholderColor:"#e7e7e7",labels:{color:"#686868"},minorTicks:{color:"#aaaaaa"},majorTicks:{color:"#888888"},line:{color:"#9e9e9e"}}},diagram:{shapeDefaults:{fill:{color:"#d1d1d1"},connectorDefaults:{fill:{color:"#686868"},stroke:{color:t},hover:{fill:{color:t},stroke:{color:"#686868"}}},content:{color:"#686868"}},editable:{resize:{handles:{fill:{color:t},stroke:{color:"#686868"},hover:{fill:{color:"#686868"},stroke:{color:"#686868"}}}},rotate:{thumb:{stroke:{color:"#686868"},fill:{color:"#686868"}}}},selectable:{stroke:{color:"#686868"}},connectionDefaults:{stroke:{color:"#686868"},content:{color:"#686868"},selection:{handles:{fill:{color:t},stroke:{color:"#686868"}}}}},treeMap:{colors:[["#527aa3","#d0d8e1"],["#6f91b3","#d6dde4"],["#8ca7c2","#dce1e7"],["#a8bdd1","#e2e6ea"],["#c5d3e0","#e7eaed"],["#e2e9f0","#edeff0"]]}});i("bootstrap",{chart:{title:{color:"#333333"},legend:{labels:{color:"#333333"},inactiveItems:{labels:{color:"#999999"},markers:{color:"#9A9A9A"}}},seriesDefaults:{labels:{color:"#333333"},overlay:{gradient:"none"},errorBars:{color:"#343434"},notes:{icon:{background:"#000000",border:{color:"#000000"}},label:{color:"#333333"},line:{color:"#000000"}},pie:{overlay:{gradient:"none"}},donut:{overlay:{gradient:"none"}},line:{markers:{background:"#ffffff"}},bubble:{opacity:.6},scatter:{markers:{background:"#ffffff"}},scatterLine:{markers:{background:"#ffffff"}},area:{opacity:.8},candlestick:{downColor:"#d0d0d0",line:{color:"#333333"},border:{_brightness:1.5,opacity:1},highlight:{border:{color:"#b8b8b8",opacity:.2}}},waterfall:{line:{color:"#cccccc"}},horizontalWaterfall:{line:{color:"#cccccc"}},ohlc:{line:{color:"#333333"}}},chartArea:{background:"#ffffff"},seriesColors:["#428bca","#5bc0de","#5cb85c","#f2b661","#e67d4a","#da3b36"],axisDefaults:{line:{color:"#cccccc"},minorTicks:{color:"#ebebeb"},majorTicks:{color:"#cccccc"},labels:{color:"#333333"},majorGridLines:{color:"#cccccc"},minorGridLines:{color:"#ebebeb"},title:{color:"#333333"},crosshair:{color:"#000000"},notes:{icon:{background:"#000000",border:{color:"#000000"}},label:{color:"#ffffff"},line:{color:"#000000"}}}},gauge:{pointer:{color:"#428bca"},scale:{rangePlaceholderColor:"#cccccc",labels:{color:"#333333"},minorTicks:{color:"#ebebeb"},majorTicks:{color:"#cccccc"},line:{color:"#cccccc"}}},diagram:{shapeDefaults:{fill:{color:"#428bca"},connectorDefaults:{fill:{color:"#333333"},stroke:{color:t},hover:{fill:{color:t},stroke:{color:"#333333"}}},content:{color:"#333333"}},editable:{resize:{handles:{fill:{color:t},stroke:{color:"#333333"},hover:{fill:{color:"#333333"},stroke:{color:"#333333"}}}},rotate:{thumb:{stroke:{color:"#333333"},fill:{color:"#333333"}}}},selectable:{stroke:{color:"#333333"}},connectionDefaults:{stroke:{color:"#c4c4c4"},content:{color:"#333333"},selection:{handles:{fill:{color:t},stroke:{color:"#333333"}},stroke:{color:"#333333"}}}},treeMap:{colors:[["#428bca","#d1e0ec"],["#5bc0de","#d6eaf0"],["#5cb85c","#d6e9d6"],["#5cb85c","#f4e8d7"],["#e67d4a","#f2ddd3"],["#da3b36","#f0d0cf"]]}});i("flat",{chart:{title:{color:"#4c5356"},legend:{labels:{color:"#4c5356"},inactiveItems:{labels:{color:"#CBCBCB"},markers:{color:"#CBCBCB"}}},seriesDefaults:{labels:{color:"#4c5356"},errorBars:{color:"#4c5356"},notes:{icon:{background:"transparent",border:{color:"#cdcdcd"}},label:{color:"#4c5356"},line:{color:"#cdcdcd"}},candlestick:{downColor:"#c7c7c7",line:{color:"#787878"}},area:{opacity:.9},waterfall:{line:{color:"#cdcdcd"}},horizontalWaterfall:{line:{color:"#cdcdcd"}},overlay:{gradient:"none"},border:{_brightness:1}},seriesColors:["#10c4b2","#ff7663","#ffb74f","#a2df53","#1c9ec4","#ff63a5","#1cc47b"],axisDefaults:{line:{color:"#cdcdcd"},labels:{color:"#4c5356"},minorGridLines:{color:"#cdcdcd"},majorGridLines:{color:"#cdcdcd"},title:{color:"#4c5356"},crosshair:{color:"#cdcdcd"},notes:{icon:{background:"transparent",border:{color:"#cdcdcd"}},label:{color:"#4c5356"},line:{color:"#cdcdcd"}}}},gauge:{pointer:{color:"#10c4b2"},scale:{rangePlaceholderColor:"#cdcdcd",labels:{color:"#4c5356"},minorTicks:{color:"#4c5356"},majorTicks:{color:"#4c5356"},line:{color:"#4c5356"}}},diagram:{shapeDefaults:{fill:{color:"#10c4b2"},connectorDefaults:{fill:{color:"#363940"},stroke:{color:t},hover:{fill:{color:t},stroke:{color:"#363940"}}},content:{color:"#4c5356"}},editable:{resize:{handles:{fill:{color:t},stroke:{color:"#363940"},hover:{fill:{color:"#363940"},stroke:{color:"#363940"}}}},rotate:{thumb:{stroke:{color:"#363940"},fill:{color:"#363940"}}}},selectable:{stroke:{color:"#363940"}},connectionDefaults:{stroke:{color:"#cdcdcd"},content:{color:"#4c5356"},selection:{handles:{fill:{color:t},stroke:{color:"#363940"}},stroke:{color:"#363940"}}}},treeMap:{colors:[["#10c4b2","#cff3f0"],["#ff7663","#ffe4e0"],["#ffb74f","#fff1dc"],["#a2df53","#ecf9dd"],["#1c9ec4","#d2ecf3"],["#ff63a5","#ffe0ed"],["#1cc47b","#d2f3e5"]]}});i("material",{chart:{title:{color:"#444444"},legend:{labels:{color:"#444444"},inactiveItems:{labels:{color:"#CBCBCB"},markers:{color:"#CBCBCB"}}},seriesDefaults:{labels:{color:"#444444"},errorBars:{color:"#444444"},notes:{icon:{background:"transparent",border:{color:"#e5e5e5"}},label:{color:"#444444"},line:{color:"#e5e5e5"}},candlestick:{downColor:"#c7c7c7",line:{color:"#787878"}},area:{opacity:.9},waterfall:{line:{color:"#e5e5e5"}},horizontalWaterfall:{line:{color:"#e5e5e5"}},overlay:{gradient:"none"},border:{_brightness:1}},seriesColors:["#3f51b5","#03a9f4","#4caf50","#f9ce1d","#ff9800","#ff5722"],axisDefaults:{line:{color:"#e5e5e5"},labels:{color:"#444444"},minorGridLines:{color:"#e5e5e5"},majorGridLines:{color:"#e5e5e5"},title:{color:"#444444"},crosshair:{color:"#7f7f7f"},notes:{icon:{background:"transparent",border:{color:"#e5e5e5"}},label:{color:"#444444"},line:{color:"#e5e5e5"}}}},gauge:{pointer:{color:"#3f51b5"},scale:{rangePlaceholderColor:"#e5e5e5",labels:{color:"#444444"},minorTicks:{color:"#444444"},majorTicks:{color:"#444444"},line:{color:"#444444"}}},diagram:{shapeDefaults:{fill:{color:"#3f51b5"},connectorDefaults:{fill:{color:"#7f7f7f"},stroke:{color:t},hover:{fill:{color:t},stroke:{color:"#7f7f7f"}}},content:{color:"#444444"}},editable:{resize:{handles:{fill:{color:t},stroke:{color:"#444444"},hover:{fill:{color:"#444444"},stroke:{color:"#444444"}}}},rotate:{thumb:{stroke:{color:"#444444"},fill:{color:"#444444"}}}},selectable:{stroke:{color:"#444444"}},connectionDefaults:{stroke:{color:"#7f7f7f"},content:{color:"#444444"},selection:{handles:{fill:{color:t},stroke:{color:"#444444"}},stroke:{color:"#444444"}}}},treeMap:{colors:[["#3f51b5","#cff3f0"],["#03a9f4","#e5f6fe"],["#4caf50","#edf7ed"],["#f9ce1d","#fefae8"],["#ff9800","#fff4e5"],["#ff5722","#ffeee8"]]}});i("materialblack",{chart:{title:{color:"#fff"},legend:{labels:{color:"#fff"},inactiveItems:{labels:{color:"#CBCBCB"},markers:{color:"#CBCBCB"}}},seriesDefaults:{labels:{color:"#fff"},errorBars:{color:"#fff"},notes:{icon:{background:"transparent",border:{color:"#e5e5e5"}},label:{color:"#fff"},line:{color:"#e5e5e5"}},candlestick:{downColor:"#c7c7c7",line:{color:"#787878"}},area:{opacity:.9},waterfall:{line:{color:"#4d4d4d"}},horizontalWaterfall:{line:{color:"#4d4d4d"}},overlay:{gradient:"none"},border:{_brightness:1}},chartArea:{background:"#1c1c1c"},seriesColors:["#3f51b5","#03a9f4","#4caf50","#f9ce1d","#ff9800","#ff5722"],axisDefaults:{line:{color:"#4d4d4d"},labels:{color:"#fff"},minorGridLines:{color:"#4d4d4d"},majorGridLines:{color:"#4d4d4d"},title:{color:"#fff"},crosshair:{color:"#7f7f7f"},notes:{icon:{background:"transparent",border:{color:"#4d4d4d"}},label:{color:"#fff"},line:{color:"#4d4d4d"}}}},gauge:{pointer:{color:"#3f51b5"},scale:{rangePlaceholderColor:"#4d4d4d",labels:{color:"#fff"},minorTicks:{color:"#fff"},majorTicks:{color:"#fff"},line:{color:"#fff"}}},diagram:{shapeDefaults:{fill:{color:"#3f51b5"},connectorDefaults:{fill:{color:"#7f7f7f"},stroke:{color:t},hover:{fill:{color:t},stroke:{color:"#7f7f7f"}}},content:{color:"#fff"}},editable:{resize:{handles:{fill:{color:t},stroke:{color:"#fff"},hover:{fill:{color:"#fff"},stroke:{color:"#fff"}}}},rotate:{thumb:{stroke:{color:"#fff"},fill:{color:"#fff"}}}},selectable:{stroke:{color:"#fff"}},connectionDefaults:{stroke:{color:"#7f7f7f"},content:{color:"#fff"},selection:{handles:{fill:{color:t},stroke:{color:"#fff"}},stroke:{color:"#fff"}}}},treeMap:{colors:[["#3f51b5","#cff3f0"],["#03a9f4","#e5f6fe"],["#4caf50","#edf7ed"],["#f9ce1d","#fefae8"],["#ff9800","#fff4e5"],["#ff5722","#ffeee8"]]}}),function(){function c(){return{icon:{background:"#007cc0",border:{color:"#007cc0"}},label:{color:"#ffffff"},line:{color:u}}}var n="#333333",e="#7f7f7f",r="#bdbdbd",u="#c8c8c8",o=["#008fd3","#99d101","#f39b02","#f05662","#c03c53","#acacac"],s=o[0],f=t;i("fiori",{chart:{title:{color:n},legend:{labels:{color:n},inactiveItems:{labels:{color:e},markers:{color:e}}},seriesDefaults:{labels:{color:n},errorBars:{color:n},notes:c(),candlestick:{downColor:u,line:{color:r}},area:{opacity:.8},waterfall:{line:{color:u}},horizontalWaterfall:{line:{color:u}},overlay:{gradient:"none"},border:{_brightness:1}},seriesColors:o,axisDefaults:{line:{color:u},labels:{color:n},minorGridLines:{color:"#dddddd"},majorGridLines:{color:u},title:{color:n},crosshair:{color:e},notes:c()}},gauge:{pointer:{color:s},scale:{rangePlaceholderColor:u,labels:{color:n},minorTicks:{color:n},majorTicks:{color:n},line:{color:n}}},diagram:{shapeDefaults:{fill:{color:s},connectorDefaults:{fill:{color:n},stroke:{color:f},hover:{fill:{color:f},stroke:{color:n}}},content:{color:n}},editable:{resize:{handles:{fill:{color:f},stroke:{color:r},hover:{fill:{color:r},stroke:{color:r}}}},rotate:{thumb:{stroke:{color:r},fill:{color:r}}}},selectable:{stroke:{color:r}},connectionDefaults:{stroke:{color:r},content:{color:r},selection:{handles:{fill:{color:f},stroke:{color:r}},stroke:{color:r}}}},treeMap:{colors:h(o,["#cbe8f5","#eaf5cb","#fceacc","#fbdcdf","#f2d7dc","#eeeeee"])}})}(),function(){function c(){return{icon:{background:"#00b0ff",border:{color:"#00b0ff"}},label:{color:"#ffffff"},line:{color:u}}}var n="#4e4e4e",e="#7f7f7f",r="#bdbdbd",u="#c8c8c8",o=["#0072c6","#5db2ff","#008a17","#82ba00","#ff8f32","#ac193d"],s=o[0],f=t;i("office365",{chart:{title:{color:n},legend:{labels:{color:n},inactiveItems:{labels:{color:e},markers:{color:e}}},seriesDefaults:{labels:{color:n},errorBars:{color:n},notes:c(),candlestick:{downColor:u,line:{color:r}},area:{opacity:.8},waterfall:{line:{color:u}},horizontalWaterfall:{line:{color:u}},overlay:{gradient:"none"},border:{_brightness:1}},seriesColors:o,axisDefaults:{line:{color:u},labels:{color:n},minorGridLines:{color:"#e5e5e5"},majorGridLines:{color:u},title:{color:n},crosshair:{color:e},notes:c()}},gauge:{pointer:{color:s},scale:{rangePlaceholderColor:u,labels:{color:n},minorTicks:{color:n},majorTicks:{color:n},line:{color:n}}},diagram:{shapeDefaults:{fill:{color:s},connectorDefaults:{fill:{color:n},stroke:{color:f},hover:{fill:{color:f},stroke:{color:n}}},content:{color:n}},editable:{resize:{handles:{fill:{color:f},stroke:{color:r},hover:{fill:{color:r},stroke:{color:r}}}},rotate:{thumb:{stroke:{color:r},fill:{color:r}}}},selectable:{stroke:{color:r}},connectionDefaults:{stroke:{color:r},content:{color:r},selection:{handles:{fill:{color:f},stroke:{color:r}},stroke:{color:r}}}},treeMap:{colors:h(o,["#cbe2f3","#deeffe","#cbe7d0","#e5f0cb","#fee8d5","#eed0d7"])}})}(),function(){function c(){return{icon:{background:"#007cc0",border:{color:"#007cc0"}},label:{color:"#ffffff"},line:{color:u}}}var n="#32364c",o="#7f7f7f",r="#bdbdbd",u="#dfe0e1",e=["#ff4350","#ff9ea5","#00acc1","#80deea","#ffbf46","#ffd78c"],s=e[0],f=t;i("nova",{chart:{title:{color:n},legend:{labels:{color:n},inactiveItems:{labels:{color:o},markers:{color:o}}},seriesDefaults:{labels:{color:n},errorBars:{color:n},notes:c(),candlestick:{downColor:u,line:{color:r}},area:{opacity:.8},waterfall:{line:{color:u}},horizontalWaterfall:{line:{color:u}},overlay:{gradient:"none"},border:{_brightness:1}},seriesColors:e,axisDefaults:{line:{color:u},labels:{color:n},minorGridLines:{color:"#dfe0e1"},majorGridLines:{color:u},title:{color:n},crosshair:{color:n},notes:c()}},gauge:{pointer:{color:s},scale:{rangePlaceholderColor:u,labels:{color:n},minorTicks:{color:n},majorTicks:{color:n},line:{color:n}}},diagram:{shapeDefaults:{fill:{color:s},connectorDefaults:{fill:{color:n},stroke:{color:f},hover:{fill:{color:f},stroke:{color:n}}},content:{color:n}},editable:{resize:{handles:{fill:{color:f},stroke:{color:r},hover:{fill:{color:r},stroke:{color:r}}}},rotate:{thumb:{stroke:{color:r},fill:{color:r}}}},selectable:{stroke:{color:r}},connectionDefaults:{stroke:{color:r},content:{color:r},selection:{handles:{fill:{color:f},stroke:{color:r}},stroke:{color:r}}}},treeMap:{colors:h(e,["#ffd9dc","#ffeced","#cceef3","#e6f8fb","#fff2da","#fff7e8"])}})}()})(window.kendo.jQuery)}(),function(){(function(n,t){function sh(){return this}function si(){this._defaults={}}function pa(n,t,i,r){var f,o=(r.x-i.x)*(n.y-i.y)-(r.y-i.y)*(n.x-i.x),e=(r.y-i.y)*(t.x-n.x)-(r.x-i.x)*(t.y-n.y),u;return e!==0&&(u=o/e,f=new v(n.x+u*(t.x-n.x),n.y+u*(t.y-n.y))),f}function np(n,t){var u=n.series,i,c=u.length,f,l=n.seriesDefaults,o=r({},n.seriesDefaults),s=t?r({},t.seriesDefaults):{},h=r({},s),e;for(wa(o),wa(h),i=0;i<c;i++)f=u[i].type||n.seriesDefaults.type,e=r({data:[]},h,s[f],{tooltip:n.tooltip},o,l[f]),u[i]._defaults=e,u[i]=r({},e,u[i])}function wa(n){delete n.bar;delete n.column;delete n.rangeColumn;delete n.line;delete n.verticalLine;delete n.pie;delete n.donut;delete n.area;delete n.verticalArea;delete n.scatter;delete n.scatterLine;delete n.bubble;delete n.candlestick;delete n.ohlc;delete n.boxPlot;delete n.bullet;delete n.verticalBullet;delete n.polarArea;delete n.polarLine;delete n.radarArea;delete n.radarLine;delete n.waterfall}function co(n){for(var f=n.series,e=n.seriesColors||[],i,u,r,t=0;t<f.length;t++)i=f[t],u=e[t%e.length],i.color=i.color||u,r=i._defaults,r&&(r.color=r.color||u)}function tp(n){var t;re([bt,gt,a,l],function(){t=this+"Axes";n[t]&&(n[this+"Axis"]=n[t],delete n[t])})}function ip(t,i){var u=(i||{}).axisDefaults||{};re([bt,gt,a,l],function(){var i=this+"Axis",f=[].concat(t[i]),e=t.axisDefaults||{};f=n.map(f,function(n){var t=(n||{}).color,f=r({},u,u[i],e,e[i],{line:{color:t},labels:{color:t},title:{color:t}},n);return delete f[i],f});t[i]=f.length>1?f:f[0]})}function lo(n){for(var u=n.length,r=0,t=0;t<u;t++)r=i.max(r,n[t].data.length);return r}function yh(n){return n*n}function df(n,t){if(t===null)return t;var i=tf(n,!0);return i(t)}function ba(n,t){if(t===null)return t;var r="_date_"+n,i=t[r];return i||(i=s(tf(n,!0)(t)),t[r]=i),i}function s(n){var t,i;if(n instanceof Date)t=n;else if(typeof n===au)t=h.parseDate(n)||new Date(n);else if(n)if(er(n))for(t=[],i=0;i<n.length;i++)t.push(s(n[i]));else t=new Date(n);return t}function g(n){return er(n)?sv(n,g):n?s(n).getTime():void 0}function p(n,t,i,r){var u=n,f;return n&&(n=s(n),f=n.getHours(),i===pu?(u=new Date(n.getFullYear()+t,0,1),h.date.adjustDST(u,0)):i===of?(u=new Date(n.getFullYear(),n.getMonth()+t,1),h.date.adjustDST(u,f)):i===ke?(u=p(ka(n,r),t*7,rr),h.date.adjustDST(u,f)):i===rr?(u=new Date(n.getFullYear(),n.getMonth(),n.getDate()+t),h.date.adjustDST(u,f)):i===pe?(u=new Date(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours()+t),t>0&&te(n,u)&&(u=p(n,t+1,i,r))):i===os?(u=new Date(n.getTime()+t*vu),u.getSeconds()>0&&u.setSeconds(0)):i===vs&&(u=new Date(n.getTime()+t*ws)),u.getMilliseconds()>0&&u.setMilliseconds(0)),u}function ka(n,t){var i=n.getDay(),r=0;if(!isNaN(i))for(t=t||0;i!==t;)i===0?i=6:i--,r++;return ut(n,-r*pi)}function gf(n,t,i){return n=s(n),p(n,0,t,i)}function ph(n,t,i){return(n=s(n),n&&gf(n,t,i).getTime()===n.getTime())?n:p(n,1,t,i)}function gi(n,t){var i=n.getTime()-t,r=n.getTimezoneOffset()-t.getTimezoneOffset();return i-r*vu}function ut(n,t){var r=n.getTimezoneOffset(),i=new Date(n.getTime()+t),u=i.getTimezoneOffset()-r;return new Date(i.getTime()+u*vu)}function ao(n,t,r){return r===pu?t.getFullYear()-n.getFullYear():r===of?ao(n,t,pu)*12+t.getMonth()-n.getMonth():r===rr?i.floor(gi(t,n)/pi):i.floor((t-n)/vf[r])}function ne(n){return n.length===1?n[0]:n}function vo(n){var u=n.length,t,i,r;if(u>0)for(i=0;i<u;i++)r=n[i].contentBox(),t?t.wrap(r):t=r.clone();return t||b()}function kr(n,t){return n&&t?n.toLowerCase()===t.toLowerCase():n===t}function te(n,t){return n&&t?g(n)===g(t):n===t}function yo(n,t){t!==null&&n.push(t)}function wh(n,t){for(var u=0,f=t.length-1,r,e;u<=f;){if(r=i.floor((u+f)/2),e=t[r],e<n){u=r+1;continue}if(e>n){f=r-1;continue}while(te(t[r-1],n))r--;return r}return t[r]<=n?r:r-1}function w(n){return typeof n=="number"&&!isNaN(n)}function po(n){for(var u=n.length,i=0,r,t=0;t<u;t++)r=n[t],w(r)&&i++;return i}function bh(n){return po(n)===n.length}function rp(n){for(var i,r,u={},t=0;t<n.length;t++)i=n[t],r=i.options.name,r&&(u[r]=i.range());return u}function dr(n,t,i,r){var u,f,h,o,s,e=!1;if(i=i||{},h=i.excluded=i.excluded||[],o=i.defaults=i.defaults||{},s=i.depth=i.depth||0,!(s>fy)){for(u in n)!rt(u,i.excluded)&&n.hasOwnProperty(u)&&(f=n[u],hi(f)?(e=!0,r||(n[u]=nt(f(t),o[u]))):typeof f===yi&&(i.defaults=o[u],i.depth++,e=dr(f,t,i,r)||e,i.depth--));return e}}function up(n,i){var c=[],e,s=n.groupNameTemplate,o,l=i.length,f;if(l===0)return f=r({},n),f.visibleInLegend=!1,[f];for(u(s)?(h.logToConsole("'groupNameTemplate' is obsolete and will be removed in future versions. Specify the group name template as 'series.name'"),s&&(e=wt(s))):(e=wt(n.name||""),e._slotCount===0&&(e=wt(u(n.name)?"#= group.value #: #= series.name #":"#= group.value #"))),o=0;o<l;o++)f=r({},n),hi(f.color)||(f.color=t),f._groupIx=o,c.push(f),e&&(f.name=e({series:f,group:i[o]}));return c}function ot(n,t){var i,r,u=[];for(t=[].concat(t),i=0;i<n.length;i++)r=n[i],rt(r.type,t)&&u.push(r);return u}function ie(t,i){if(t instanceof Date){for(var r=0,u=i.length;r<u;r++)if(te(i[r],t))return r;return-1}return n.inArray(t,i)}function da(n,t){t=t||hr;for(var i=1,r=n.length;i<r;i++)if(t(n[i],n[i-1])<0){n.sort(t);break}return n}function ga(n,t){var i,r=da(n,t),f=r.length,u=f>0?[r[0]]:[];for(t=t||hr,i=1;i<f;i++)t(r[i],st(u))!==0&&u.push(r[i]);return u}function nv(n,t){var i=n.type,r=t instanceof Date;return!i&&r||kr(i,lr)}function tv(n){for(var i=[],e=n.length,u,t,f,r=0;r<e;r++)for(u=n[r],f=u.length,t=0;t<f;t++)i[t]=i[t]||[],i[t].push(u[t]);return i}function iv(n,t){if(n.indexOf(".")>-1)for(var r=n.split("."),i="",u;r.length>1;)i+=r.shift(),u=h.getter(i)(t)||{},h.setter(i)(t,u),i+="."}function rv(n){for(var u,t,e=n.data,f=0,r=0;r<e.length;r++)u=d.current.bindPoint(n,r),t=u.valueFields.value,typeof t===au&&(t=parseFloat(t)),w(t)&&u.fields.visible!==!1&&(f+=i.abs(t));return f}function kh(n){var t=n.overlay;return t&&t.gradient&&t.gradient!="none"}function uv(n){for(var t=0;t<n.length;t++)if(u(n[t].zIndex))return!0}function fp(){this._defaultPrevented=!0}function fv(n,t){if(n)for(var i=0;i<n.length;i++)if(n[i].category===t)return[n[i]]}function gr(n){return u(n)&&n!==null}function dh(n){for(var r={},t,i=0;i<n.length;i++)t=n[i],t.axis.options.name&&(r[t.axis.options.name]={min:t.range.min,max:t.range.max});return r}function ev(n,t){var i=(t||"").toLowerCase();return i=="none"&&!(n.ctrlKey||n.shiftKey||n.altKey)||n[i+"Key"]}var re=n.each,er=n.isArray,ov=n.isPlainObject,sv=n.map,i=Math,nf=n.noop,or=n.extend,y=n.proxy,h=window.kendo,nr=h.Class,ue=h.Observable,gh=h.data.DataSource,fe=h.ui.Widget,r=h.deepExtend,tf=h.getter,hi=h.isFunction,wt=h.template,e=h.dataviz,nu=e.Axis,wo=e.AxisLabel,b=e.Box2D,sr=e.BoxElement,f=e.ChartElement,tu=h.drawing.Color,nc=e.CurveProcessor,hv=e.FloatElement,cv=e.Note,tc=e.LogarithmicAxis,ee=e.NumericAxis,v=e.Point2D,lv=e.RootElement,av=e.Ring,iu=e.ShapeElement,ic=e.ShapeBuilder,oe=e.TextBox,rc=e.Title,ru=e.alignPathToPixel,vt=e.autoFormat,hr=e.dateComparer,ci=e.getSpacing,rt=e.inArray,bo=e.interpolateValue,uc=e.mwDelta,k=e.round,ri=h.util,rf=ri.append,u=ri.defined,st=ri.last,tt=ri.limitValue,vv=ri.sparseArrayLimits,yv=ri.sparseArrayMin,fc=ri.sparseArrayMax,ec=ri.renderTemplate,nt=ri.valueOrDefault,c=e.geometry,o=e.drawing,tr=".kendoChart",oc="above",cr="area",pv="auto",se="fit",wv=e.AXIS_LABEL_CLICK,li="bar",bv=6,he=.8,kv="below",uu="#000",ai="bottom",uf="boxPlot",fu="bubble",eu="bullet",ou="candlestick",bt="category",it="center",ce="change",su="circle",dv="contextmenu"+tr,gv=e.CLIP,vi="color",ir="column",le=e.COORD_PRECISION,ht="k-",ae="custom",ve="dataBound",lr="date",rr="days",ny=e.DEFAULT_FONT,ty=e.DEFAULT_HEIGHT,ff=e.DEFAULT_PRECISION,iy=e.DEFAULT_WIDTH,sc=4,ef="donut",ry=50,ye="drag",ko="dragEnd",go="dragStart",hc="errorLow",cc="errorHigh",ar="fadeIn",yt="first",ns="funnel",ts="glass",lc="horizontal",hu="horizontalWaterfall",pe="hours",kt=e.INITIAL_ANIMATION_DURATION,uy="insideBase",is="insideEnd",rs="interpolate",ac="leave",ct="left",vc="legendItemClick",yc="legendItemHover",cu="line",us=8,fs="log",lt="max",fy=5,ft=Number.MAX_VALUE,es="min",at=-Number.MAX_VALUE,os="minutes",of="months",we="mouseleave"+tr,ss="mousemove.tracking",ey="mouseover"+tr,oy="mouseout"+tr,hs="mousemove"+tr,sy=20,pc=150,wc="DOMMouseScroll"+tr+" mousewheel"+tr,hy=e.NOTE_CLICK,cy=e.NOTE_HOVER,ur="noteText",yi="object",sf="ohlc",vr="outsideEnd",fr="pie",ly=70,cs="plotAreaClick",lu="rangeBar",hf="rangeColumn",bc="render",et="right",ls="scatter",as="scatterLine",vs="seconds",cf="selectStart",yr="select",lf="selectEnd",kc="seriesClick",ys="seriesHover",af=.001,pr="step",ps="smooth",ay="stderr",au="string",ws=1e3,vu=60*ws,bs=60*vu,pi=24*bs,ks=7*pi,ds=31*pi,gs=365*pi,vf={years:gs,months:ds,weeks:ks,days:pi,hours:bs,minutes:vu,seconds:ws},dt="top",pt=5,vy=100,yy=100,py="chart-tooltip-inverse",gt="value",wr="verticalArea",be="verticalBullet",yu="verticalLine",yf="waterfall",ke="weeks",wi="#fff",a="x",l="y",pu="years",de="zero",wy=3,dc="zoomStart",ge="zoom",gc="zoomEnd",wu=[vs,os,pe,rr,ke,of,pu],nl=[li,ir,sf,ou,uf,eu,hf,lu,yf,hu],tl={seconds:"HH:mm:ss",minutes:"HH:mm",hours:"HH:mm",days:"M/d",weeks:"M/d",months:"MMM 'yy",years:"yyyy"},nh=fe.extend({init:function(n,i){var u=this,f,o;h.destroy(n);fe.fn.init.call(u,n);u.element.addClass(ht+this.options.name.toLowerCase()).css("position","relative");i&&(o=i.dataSource,i.dataSource=t);f=r({},u.options,i);u._originalOptions=r({},f);u._initTheme(f);u._initSurface();u.bind(u.events,u.options);u.wrapper=u.element;i&&(i.dataSource=o);u._initDataSource(i);h.notify(u,e.ui)},_initTheme:function(i){for(var f=this,s=e.ui.themes||{},o=i.theme,h=s[o]||s[o.toLowerCase()],c=o&&h?h.chart:{},l=[],a=i.series||[],u=0;u<a.length;u++)l.push(n.extend({},a[u]));i.series=l;tp(i);f._applyDefaults(i,c);i.seriesColors===null&&(i.seriesColors=t);f.options=r({},c,i);co(f.options)},_initDataSource:function(n){var t=this,i=(n||{}).dataSource;t._dataChangeHandler=y(t._onDataChanged,t);t.dataSource=gh.create(i).bind(ce,t._dataChangeHandler);t._bindCategories();i&&(t._hasDataSource=!0);t._redraw();t._attachEvents();i&&t.options.autoBind&&t.dataSource.fetch()},setDataSource:function(n){var t=this;t.dataSource.unbind(ce,t._dataChangeHandler);t.dataSource=n=gh.create(n);t._hasDataSource=!0;t._hasData=!1;n.bind(ce,t._dataChangeHandler);t.options.autoBind&&n.fetch()},events:[ve,kc,ys,wv,vc,yc,cs,go,ye,ko,dc,ge,gc,cf,yr,lf,hy,cy,bc],items:function(){return n()},options:{name:"Chart",renderAs:"",theme:"default",chartArea:{},legend:{visible:!0,labels:{}},categoryAxis:{},autoBind:!0,seriesDefaults:{type:ir,data:[],highlight:{visible:!0},labels:{},negativeValues:{visible:!1}},series:[],seriesColors:null,tooltip:{visible:!1},transitions:!0,valueAxis:{},plotArea:{},title:{},xAxis:{},yAxis:{},panes:[{}],pannable:!1,zoomable:!1},refresh:function(){var n=this;n._applyDefaults(n.options);co(n.options);n._bindSeries();n._bindCategories();n.trigger(ve);n._redraw()},getSize:function(){return h.dimensions(this.element)},_resize:function(){var n=this.options.transitions;this.options.transitions=!1;this._redraw();this.options.transitions=n},redraw:function(n){var t=this,r,i;t._applyDefaults(t.options);co(t.options);n?(i=t._model._plotArea,r=i.findPane(n),i.redraw(r)):t._redraw()},getAxis:function(n){for(var i=this._plotArea.axes,t=0;t<i.length;t++)if(i[t].options.name===n)return new vh(i[t])},toggleHighlight:function(n,t){var i=this._plotArea,s=this._highlight,o=(i.srcSeries||i.series||[])[0],r,u,f,e;if(ov(t)?(r=t.series,u=t.category):r=u=t,f=o.type===ef?fv(i.pointsBySeriesName(r),u):o.type===fr||o.type===ns?fv((i.charts[0]||{}).points,u):i.pointsBySeriesName(r),f)for(e=0;e<f.length;e++)s.togglePointHighlight(f[e],n)},_initSurface:function(){var n=this.surface,i=this._surfaceWrap(),t=this.options.chartArea;t.width&&i.css("width",t.width);t.height&&i.css("height",t.height);n&&n.options.type===this.options.renderAs?(this.surface.clear(),this.surface.resize()):(n&&n.destroy(),this.surface=o.Surface.create(i,{type:this.options.renderAs}))},_surfaceWrap:function(){return this.element},_redraw:function(){var n=this,t=n._getModel(),i;n._destroyView();n._model=t;n._plotArea=t._plotArea;t.renderVisual();this.options.transitions!==!1&&t.traverse(function(n){n.animation&&n.animation.setup()});n._initSurface();n.surface.draw(t.visual);this.options.transitions!==!1&&t.traverse(function(n){n.animation&&n.animation.play()});n._tooltip=n._createTooltip();n._highlight=new ca(i);n._setupSelection();n._createPannable();n._createZoomSelection();n._createMousewheelZoom();n._hasDataSource&&!n._hasData&&n.options.autoBind||n.trigger(bc)},exportVisual:function(n){var i,t,u,f;return n&&(n.width||n.height)?(t=this.options.chartArea,u=this._originalOptions.chartArea,r(t,n),f=this._getModel(),t.width=u.width,t.height=u.height,f.renderVisual(),i=f.visual):i=this.surface.exportVisual(),i},_sharedTooltip:function(){var n=this,t=n.options;return n._plotArea instanceof ch&&t.tooltip.shared},_createPannable:function(){var n=this.options;n.pannable!==!1&&(this._pannable=new ky(this._plotArea,n.pannable))},_createZoomSelection:function(){var n=this.options.zoomable,t=(n||{}).selection;n!==!1&&t!==!1&&(this._zoomSelection=new dy(this,t))},_createMousewheelZoom:function(){var n=this.options.zoomable,t=(n||{}).mousewheel;n!==!1&&t!==!1&&(this._mousewheelZoom=new gy(this._plotArea,t))},_createTooltip:function(){var n=this,i=n.options,r=n.element,t;return t=n._sharedTooltip()?new aa(r,n._plotArea,i.tooltip):new la(r,i.tooltip),t.bind(ac,y(n._tooltipleave,n)),t},_tooltipleave:function(){var n=this,t=n._plotArea,i=n._highlight;t.hideCrosshairs();i.hide()},_applyDefaults:function(n,t){ip(n,t);np(n,t)},_getModel:function(){var t=this,r=t.options,n=new lv(t._modelOptions()),i;return n.chart=t,rc.buildTitle(r.title,n),i=n._plotArea=t._createPlotArea(),r.legend.visible&&n.append(new ul(i.options.legend)),n.append(i),n.reflow(),n},_modelOptions:function(){var n=this,t=n.options,u=n.element,f=i.floor(u.height()),e=i.floor(u.width());return n._size=null,r({width:e||iy,height:f||ty,transitions:t.transitions},t.chartArea)},_createPlotArea:function(n){var i=this,t=i.options;return bi.current.create(n?[]:t.series,t)},_setupSelection:function(){var n=this,h=n._plotArea,s=h.axes,c=n._selections=[],f,e,u,o,i,t;for(n._selectStartHandler||(n._selectStartHandler=y(n._selectStart,n),n._selectHandler=y(n._select,n),n._selectEndHandler=y(n._selectEnd,n)),e=0;e<s.length;e++)u=s[e],t=u.options,u instanceof ui&&t.select&&!t.vertical&&(o=0,i=t.categories.length-1,u instanceof pf&&(o=t.categories[o],i=t.categories[i]),t.justified||(u instanceof pf?i=p(i,1,t.baseUnit,t.weekStartDay):i++),f=new ho(n,u,r({min:o,max:i},t.select)),f.bind(cf,n._selectStartHandler),f.bind(yr,n._selectHandler),f.bind(lf,n._selectEndHandler),c.push(f))},_selectStart:function(n){return this.trigger(cf,n)},_select:function(n){return this.trigger(yr,n)},_selectEnd:function(n){return this.trigger(lf,n)},_attachEvents:function(){var n=this,t=n.element;t.on(dv,y(n._click,n));t.on(ey,y(n._mouseover,n));t.on(oy,y(n._mouseout,n));t.on(wc,y(n._mousewheel,n));t.on(we,y(n._mouseleave,n));if(n._mousemove=h.throttle(y(n._mousemove,n),sy),n._shouldAttachMouseMove())t.on(hs,n._mousemove);h.UserEvents&&(n._userEvents=new h.UserEvents(t,{global:!0,filter:":not(.k-selector)",multiTouch:!1,tap:y(n._tap,n),start:y(n._start,n),move:y(n._move,n),end:y(n._end,n)}))},_mouseout:function(n){var i=this,t=i._getChartElement(n);t&&t.leave&&t.leave(i,n)},_start:function(n){var t=this,i=t._events;u(i[go]||i[ye]||i[ko])&&t._startNavigation(n,go);t._pannable&&t._pannable.start(n);t._zoomSelection&&t._zoomSelection.start(n)},_move:function(n){var t=this,f=t._navState,e=t._pannable,o,i={},u,r,c,s,h;if(e)n.preventDefault(),i=e.move(n),i&&!t.trigger(ye,{axisRanges:i,originalEvent:n})&&e.pan();else if(f){for(n.preventDefault(),o=f.axes,u=0;u<o.length;u++)r=o[u],c=r.options.name,c&&(s=r.options.vertical?n.y:n.x,h=s.startLocation-s.location,h!==0&&(i[r.options.name]=r.translateRange(h)));f.axisRanges=i;t.trigger(ye,{axisRanges:i,originalEvent:n})}t._zoomSelection&&t._zoomSelection.move(n)},_end:function(n){if(this._endNavigation(n,ko),this._zoomSelection){var t=this._zoomSelection.end(n);t&&!this.trigger(ge,{axisRanges:t,originalEvent:n})&&this._zoomSelection.zoom()}this._pannable&&this._pannable.end(n)},_mousewheel:function(n){var t=this,a=n.originalEvent,l,i=uc(n),e,r=t._navState,o,f,s,h,u={},c=t._mousewheelZoom;if(c)n.preventDefault(),u=c.updateRanges(i),u&&!t.trigger(ge,{delta:i,axisRanges:u,originalEvent:n})&&c.zoom();else if(r||(l=t._startNavigation(a,dc),l||(r=t._navState)),r){for(e=r.totalDelta||i,r.totalDelta=e+i,o=t._navState.axes,f=0;f<o.length;f++)s=o[f],h=s.options.name,h&&(u[h]=s.scaleRange(-e));t.trigger(ge,{delta:i,axisRanges:u,originalEvent:n});t._mwTimeout&&clearTimeout(t._mwTimeout);t._mwTimeout=setTimeout(function(){t._endNavigation(n,gc)},pc)}},_startNavigation:function(n,t){var i=this,f=i._eventCoordinates(n),e=i._model._plotArea,o=e.findPointPane(f),r=e.axes.slice(0),u,s,h=!1,c;if(o){for(u=0;u<r.length;u++)if(s=r[u],s.box.containsPoint(f)){h=!0;break}!h&&e.backgroundBox().containsPoint(f)&&(c=i.trigger(t,{axisRanges:rp(r),originalEvent:n}),c?i._userEvents.cancel():(i._suppressHover=!0,i._unsetActivePoint(),i._navState={pane:o,axes:r}))}},_endNavigation:function(n,t){var i=this;i._navState&&(i.trigger(t,{axisRanges:i._navState.axisRanges,originalEvent:n}),i._suppressHover=!1,i._navState=null)},_getChartElement:function(n,t){var r=this.surface.eventTarget(n),i;if(r){while(r&&!i)i=r.chartElement,r=r.parent;if(i)return i.aliasFor&&(i=i.aliasFor(n,this._eventCoordinates(n))),t&&(i=i.closest(t)),i}},_eventCoordinates:function(n){var i=this,t=u((n.x||{}).client),r=t?n.x.client:n.clientX,f=t?n.y.client:n.clientY;return i._toModelCoordinates(r,f)},_toModelCoordinates:function(t,i){var r=this.element,u=r.offset(),e=parseInt(r.css("paddingLeft"),10),o=parseInt(r.css("paddingTop"),10),f=n(window);return new v(t-u.left-e+f.scrollLeft(),i-u.top-o+f.scrollTop())},_tap:function(n){var t=this,i=t._getChartElement(n);t._activePoint===i?t._click(n):(t._startHover(n)||t._unsetActivePoint(),t._click(n))},_click:function(n){for(var i=this,t=i._getChartElement(n);t;)t.click&&t.click(i,n),t=t.parent},_startHover:function(n){var t=this,e=t._getChartElement(n),o=t._tooltip,u=t._highlight,f=t.options.tooltip,i;if(!t._suppressHover&&u&&!u.isHighlighted(e)&&!t._sharedTooltip())return i=t._getChartElement(n,function(n){return n.hover}),i&&!i.hover(t,n)?(t._activePoint=i,f=r({},f,i.options.tooltip),f.visible&&o.show(i),u.show(i),i.tooltipTracking):void 0},_mouseover:function(t){var i=this;if(i._startHover(t))n(document).on(ss,y(i._mouseMoveTracking,i))},_mouseMoveTracking:function(t){var i=this,s=i.options,h=i._tooltip,c=i._highlight,e=i._eventCoordinates(t),u=i._activePoint,o,f;i._plotArea.box.containsPoint(e)?u&&u.tooltipTracking&&u.series&&u.parent.getNearestPoint&&(f=u.parent.getNearestPoint(e.x,e.y,u.seriesIx),f&&f!=u&&(f.hover(i,t),i._activePoint=f,o=r({},s.tooltip,u.options.tooltip),o.visible&&h.show(f),c.show(f))):(n(document).off(ss),i._unsetActivePoint())},_mousemove:function(n){var t=this._eventCoordinates(n);this._trackCrosshairs(t);this._sharedTooltip()&&this._trackSharedTooltip(t,n)},_trackCrosshairs:function(n){for(var r=this._plotArea.crosshairs,i,t=0;t<r.length;t++)i=r[t],i.box.containsPoint(n)?i.showAt(n):i.hide()},_trackSharedTooltip:function(t,i){var r=this,c=r.options,e=r._plotArea,l=e.categoryAxis,h=r._tooltip,a=c.tooltip,v=r._highlight,f,u,o,s;e.box.containsPoint(t)&&(f=l.pointCategoryIndex(t),f!==r._tooltipCategoryIx&&(u=e.pointsByCategoryIndex(f),o=n.map(u,function(n){return n.eventArgs(i)}),s=o[0]||{},s.categoryPoints=o,u.length>0&&!this.trigger(ys,s)?(a.visible&&h.showAt(u,t),v.show(u)):h.hide(),r._tooltipCategoryIx=f))},_mouseleave:function(t){var i=this,f=i._plotArea,r=i._tooltip,e=i._highlight,u=t.relatedTarget;u&&n(u).closest(r.element).length||(i._mousemove.cancel(),f.hideCrosshairs(),e.hide(),setTimeout(y(r.hide,r),yy),i._tooltipCategoryIx=null)},_unsetActivePoint:function(){var n=this,t=n._tooltip,i=n._highlight;n._activePoint=null;t&&t.hide();i&&i.hide()},_onDataChanged:function(){for(var n=this,f=n.options,r=n._sourceSeries||f.series,e=r.length,o=n.dataSource.view(),s=(n.dataSource.group()||[]).length>0,u=[],i,t=0;t<e;t++)i=r[t],n._isBindable(i)&&s?rf(u,up(i,o)):u.push(i||[]);n._sourceSeries=r;f.series=u;co(n.options);n._bindSeries();n._bindCategories();n._hasData=!0;n._deferRedraw()},_deferRedraw:function(){var n=this;h.support.vml?(n._clearRedrawTimeout(),n._redrawTimeout=setTimeout(function(){n.surface&&(n.trigger(ve),n._redraw())},0)):(n.trigger(ve),n._redraw())},_clearRedrawTimeout:function(){this._redrawTimeout&&(clearInterval(this._redrawTimeout),this._redrawTimeout=null)},_bindSeries:function(){for(var i=this,f=i.dataSource.view(),e=i.options.series,s=e.length,n,r,o,t=0;t<s;t++)n=e[t],i._isBindable(n)&&(r=n._groupIx,o=u(r)?(f[r]||{}).items:f,n.autoBind!==!1&&(n.data=o))},_bindCategories:function(){var t=this,i=t.dataSource.view()||[],e=(t.dataSource.group()||[]).length>0,u=i,o=t.options,f=[].concat(o.categoryAxis),n,r;for(e&&i.length&&(u=i[0].items),n=0;n<f.length;n++)r=f[n],r.autoBind!==!1&&t._bindCategoryAxis(r,u,n)},_bindCategoryAxis:function(n,t,i){var e=(t||[]).length,r,f,u;if(n.field)for(n.categories=[],r=0;r<e;r++)u=t[r],f=df(n.field,u),r===0?(n.categories=[f],n.dataItems=[u]):(n.categories.push(f),n.dataItems.push(u));else this._bindCategoryAxisFromSeries(n,i)},_bindCategoryAxisFromSeries:function(n,t){for(var w=this,r=[],h,a=w.options.series,b=a.length,i,v,e,o,c,l,s,y={},p,u,f=0;f<b;f++)if(i=a[f],v=i.categoryAxis===n.name||!i.categoryAxis&&t===0,e=i.data,c=e.length,i.categoryField&&v&&c>0)for(u=nv(n,df(i.categoryField,e[0])),p=u?ba:df,o=0;o<c;o++)l=e[o],s=p(i.categoryField,l),(u||!y[s])&&(r.push([s,l]),u||(y[s]=!0));r.length>0&&(u&&(r=ga(r,function(n,t){return hr(n[0],t[0])})),h=tv(r),n.categories=h[0],n.dataItems=h[1])},_isBindable:function(n){for(var r=d.current.valueFields(n),f=!0,t,i=0;i<r.length;i++)if(t=r[i],t=t===gt?"field":t+"Field",!u(n[t])){f=!1;break}return f},_legendItemClick:function(n,t){var i=this,s=i._plotArea,e=(s.srcSeries||s.series)[n],o=(i._sourceSeries||[])[n]||e,h,r,f;rt(e.type,[fr,ef,ns])?(f=o.data[t],r=u(f.visible)?!f.visible:!1,f.visible=r):(r=!o.visible,o.visible=r,e.visible=r);i.options.transitions&&(i.options.transitions=!1,h=!0);i.redraw();h&&(i.options.transitions=!0)},_legendItemHover:function(n,t){var r=this,i=r._plotArea,e=r._highlight,o=(i.srcSeries||i.series)[n],u,f;u=rt(o.type,[fr,ef,ns])?t:n;f=i.pointsBySeriesIndex(u);e.show(f)},_shouldAttachMouseMove:function(){var n=this;return n._plotArea.crosshairs.length||n._tooltip&&n._sharedTooltip()},setOptions:function(i){var u=this,f=i.dataSource;if(i.dataSource=t,u._originalOptions=r(u._originalOptions,i),u.options=r({},u._originalOptions),u._sourceSeries=null,n(document).off(hs),fe.fn._setEvents.call(u,i),u._initTheme(u.options),f&&u.setDataSource(f),u._hasDataSource?u._onDataChanged():(u._bindCategories(),u.redraw()),u._shouldAttachMouseMove())u.element.on(hs,u._mousemove)},destroy:function(){var t=this,i=t.dataSource;t.element.off(tr);i.unbind(ce,t._dataChangeHandler);n(document).off(ss);t._userEvents&&t._userEvents.destroy();t._destroyView();t.surface.destroy();t.surface=null;t._clearRedrawTimeout();fe.fn.destroy.call(t)},_destroyView:function(){var n=this,i=n._model,t=n._selections;if(i&&(i.destroy(),n._model=null),t)while(t.length>0)t.shift().destroy();n._unsetActivePoint();n._tooltip&&n._tooltip.destroy();n._highlight&&n._highlight.destroy();n._zoomSelection&&n._zoomSelection.destroy()}}),bi,d,ol,sl,bu,ih,io,ti,fo,eh,di,ku,du,oh,gu,eo,ha,vh;e.ExportMixin.extend(nh.fn);h.PDFMixin&&h.PDFMixin.extend(nh.fn);bi=nr.extend({init:function(){this._registry=[]},register:function(n,t){this._registry.push({type:n,seriesTypes:t})},create:function(n,t){for(var r=this._registry,e=r[0],u,f,i=0;i<r.length;i++)if(u=r[i],f=ot(n,u.seriesTypes),f.length>0){e=u;break}return new e.type(f,t)}});bi.current=new bi;d=nr.extend({init:function(){this._valueFields={};this._otherFields={};this._nullValue={};this._undefinedValue={}},register:function(n,i,r){var u=this,e,f;for(i=i||[gt],e=0;e<n.length;e++)f=n[e],u._valueFields[f]=i,u._otherFields[f]=r,u._nullValue[f]=u._makeValue(i,null),u._undefinedValue[f]=u._makeValue(i,t)},canonicalFields:function(n){return this.valueFields(n).concat(this.otherFields(n))},valueFields:function(n){return this._valueFields[n.type]||[gt]},otherFields:function(n){return this._otherFields[n.type]||[gt]},bindPoint:function(n,t){var i=this,v=n.data,r=v[t],o={valueFields:{value:r}},s,c,l,a,e=i.valueFields(n),h=i._otherFields[n.type],f;return r===null?f=i._nullValue[n.type]:u(r)?er(r)?(c=r.slice(e.length),f=i._bindFromArray(r,e),s=i._bindFromArray(c,h)):typeof r===yi&&(l=i.sourceFields(n,e),a=i.sourceFields(n,h),f=i._bindFromObject(r,e,l),s=i._bindFromObject(r,h,a)):f=i._undefinedValue[n.type],u(f)&&(e.length===1?o.valueFields.value=f[e[0]]:o.valueFields=f),o.fields=s||{},o},_makeValue:function(n,t){for(var r={},f=n.length,u,i=0;i<f;i++)u=n[i],r[u]=t;return r},_bindFromArray:function(n,t){var u={},r,f;if(t)for(f=i.min(t.length,n.length),r=0;r<f;r++)u[t[r]]=n[r];return u},_bindFromObject:function(n,t,i){var u={},r,f,e,o;if(t)for(f=t.length,i=i||t,r=0;r<f;r++)e=t[r],o=i[r],u[e]=df(o,n);return u},sourceFields:function(n,t){var i,f,r,u,e;if(t)for(f=t.length,u=[],i=0;i<f;i++)r=t[i],e=r===gt?"field":r+"Field",u.push(n[e]||r);return u}});d.current=new d;var th=f.extend({init:function(n,t){var i=this;f.fn.init.call(i,t);this.textBox=new oe(n,i.options);i.append(this.textBox)},options:{position:vr,margin:ci(3),padding:ci(4),color:uu,background:"",border:{width:1,color:""},aboveAxis:!0,vertical:!1,animation:{type:ar,delay:kt},zIndex:2},createVisual:function(){this.textBox.options.noclip=this.options.noclip},reflow:function(n){var o=this,i=o.options,r=i.vertical,u=i.aboveAxis,t=o.children[0],f=t.box,e=t.options.padding;t.options.align=r?it:ct;t.options.vAlign=r?dt:it;i.position==is?r?(t.options.vAlign=dt,!u&&f.height()<n.height()&&(t.options.vAlign=ai)):t.options.align=u?et:ct:i.position==it?(t.options.vAlign=it,t.options.align=it):i.position==uy?r?t.options.vAlign=u?ai:dt:t.options.align=u?ct:et:i.position==vr&&(r?n=u?new b(n.x1,n.y1-f.height(),n.x2,n.y1):new b(n.x1,n.y2,n.x2,n.y2+f.height()):(t.options.align=it,n=u?new b(n.x2,n.y1,n.x2+f.width(),n.y2):new b(n.x1-f.width(),n.y1,n.x1,n.y2)));i.rotation||(r?e.left=e.right=(n.width()-t.contentBox.width())/2:e.top=e.bottom=(n.height()-t.contentBox.height())/2);t.reflow(n)},alignToClipBox:function(n){var e=this,s=e.options.vertical,o=s?l:a,t=o+"1",r=o+"2",h=e.children[0],u=e.parent.box,f;(u[t]<n[t]||n[r]<u[r])&&(f=h.paddingBox.clone(),f[t]=i.max(u[t],n[t]),f[r]=i.min(u[r],n[r]),this.reflow(f))}}),il=sr.extend({init:function(n){var t=this;sr.fn.init.call(t,n);t.createContainer();t.createMarker();t.createLabel()},createContainer:function(){var n=this;n.container=new hv({vertical:!1,wrap:!1,align:it});n.append(n.container)},createMarker:function(){this.container.append(new iu(this.markerOptions()))},markerOptions:function(){var n=this.options,t=n.markerColor;return r({},n.markers,{background:t,border:{color:t}})},createLabel:function(){var n=this,t=n.options,i=r({},t.labels);n.container.append(new oe(t.text,i))},renderComplete:function(){f.fn.renderComplete.call(this);var n=this.options.cursor||{},t=this._itemOverlay=o.Path.fromRect(this.container.box.toRect(),{fill:{color:wi,opacity:0},stroke:null,cursor:n.style||n});this.appendVisual(t)},click:function(n,t){var i=this.eventArgs(t);n.trigger(vc,i)||(t.preventDefault(),n._legendItemClick(i.seriesIndex,i.pointIndex))},hover:function(n,t){var i=this.eventArgs(t);return n.trigger(yc,i)||(t.preventDefault(),n._legendItemHover(i.seriesIndex,i.pointIndex)),!0},leave:function(n){n._unsetActivePoint()},eventArgs:function(t){var i=this.options;return{element:n(t.target),text:i.text,series:i.series,seriesIndex:i.series.index,pointIndex:i.pointIndex}},renderVisual:function(){var n=this,t=n.options,i=t.visual;i?(n.visual=i({active:t.active,series:t.series,pointIndex:t.pointIndex,options:{markers:n.markerOptions(),labels:t.labels},createVisual:function(){n.createVisual();n.renderChildren();n.renderComplete();var t=n.visual;return delete n.visual,t}}),this.addVisual()):f.fn.renderVisual.call(n)}}),rl=f.extend({render:function(){var t,u=this.children,i=this.options,r=i.vertical,n;for(this.visual=new o.Layout(null,{spacing:r?0:i.spacing,lineSpacing:r?i.spacing:0,orientation:r?"vertical":"horizontal"}),n=0;n<u.length;n++)t=u[n],t.reflow(new b),t.renderVisual()},reflow:function(n){this.visual.rect(n.toRect());this.visual.reflow();var t=this.visual.clippedBBox();this.box=t?e.rectToBox(t):new b},renderVisual:function(){this.addVisual()},createVisual:nf}),ul=f.extend({init:function(n){var t=this;f.fn.init.call(t,n);rt(t.options.position,[dt,et,ai,ct,ae])||(t.options.position=et);t.createContainer();t.createItems()},options:{position:et,items:[],labels:{margin:{left:6}},offsetX:0,offsetY:0,margin:ci(5),padding:ci(5),border:{color:uu,width:0},item:{cursor:"pointer"},spacing:6,background:"",zIndex:1,markers:{border:{width:1},width:7,height:7,type:"rect",align:ct,vAlign:it}},createContainer:function(){var i=this,n=i.options,t=n.align,r=n.position,f=r,u=it;r==ae?f=ct:rt(r,[dt,ai])?(f=t=="start"?ct:t=="end"?et:it,u=r):t&&(t=="start"?u=dt:t=="end"&&(u=ai));i.container=new sr({margin:n.margin,padding:n.padding,background:n.background,border:n.border,vAlign:u,align:f,zIndex:n.zIndex,shrinkToFit:!0});i.append(i.container)},createItems:function(){var f=this,n=f.options,t=n.items,o=t.length,s=f.isVertical(),i,u,e;for(i=new rl({vertical:s,spacing:n.spacing}),n.reverse&&(t=t.slice(0).reverse()),u=0;u<o;u++)e=t[u],i.append(new il(r({},{markers:n.markers,labels:n.labels},n.item,e)));i.render();f.container.append(i)},isVertical:function(){var r=this,t=r.options,n=t.orientation,i=t.position;return i==ae&&n!=lc||(u(n)?n!=lc:rt(i,[ct,et]))},hasItems:function(){return this.container.children[0].children.length>0},reflow:function(n){var t=this,i=t.options;if(n=n.clone(),!t.hasItems()){t.box=n;return}i.position===ae?(t.containerCustomReflow(n),t.box=n):t.containerReflow(n)},containerReflow:function(n){var r=this,i=r.options,u=i.position,f=u==dt||u==ai?a:l,t=n.clone(),e=r.container,h=i.width,c=i.height,v=r.isVertical(),s=n.clone(),o;(u==ct||u==et)&&(t.y1=s.y1=0);v&&c?(t.y2=t.y1+c,t.align(s,l,e.options.vAlign)):!v&&h&&(t.x2=t.x1+h,t.align(s,a,e.options.align));e.reflow(t);t=e.box;o=t.clone();(i.offsetX||i.offsetY)&&(t.translate(i.offsetX,i.offsetY),r.container.reflow(t));o[f+1]=n[f+1];o[f+2]=n[f+2];r.box=o},containerCustomReflow:function(n){var r=this,i=r.options,f=i.offsetX,e=i.offsetY,u=r.container,o=i.width,s=i.height,h=r.isVertical(),t=n.clone();h&&s?t.y2=t.y1+s:!h&&o&&(t.x2=t.x1+o);u.reflow(t);t=u.box;u.reflow(b(f,e,f+t.width(),e+t.height()))},renderVisual:function(){this.hasItems()&&f.fn.renderVisual.call(this)}}),ui=nu.extend({init:function(n){var t=this;n=n||{};this._initFields();this._initCategories(n);nu.fn.init.call(t,n)},_initFields:function(){this._ticks={};this.outOfRangeMin=0;this.outOfRangeMax=0},_initCategories:function(n){var f=(n.categories||[]).slice(0),t,r;n.categories=f;n.limitCategories&&(u(n.min)||u(n.max))&&f.length&&(n.srcCategories=n.categories,t=u(n.min)?i.floor(n.min):0,r=u(n.max)?i.ceil(n.max)+1:f.length,n.outOfRangePoints&&(t-1>=0&&(t--,this.outOfRangeMin=1),r+1<n.srcCategories.length&&(r++,this.outOfRangeMax=1)),n.categories=n.categories.slice(t,r))},options:{type:bt,categories:[],vertical:!1,majorGridLines:{visible:!1,width:1,color:uu},labels:{zIndex:1},justified:!1},rangeIndices:function(){var n=this.options,t;if(n.limitCategories){var i=(n.categories.length||1)-1,r=this.outOfRangeMin+(u(n.min)?n.min%1:0),f=(u(n.max)&&n.max%1!=0?i-(1-n.max%1):i)-this.outOfRangeMax;t={min:r,max:f}}else t=this.totalRangeIndices();return t},totalRangeIndices:function(){var n=this.options;return{min:w(n.min)?n.min:0,max:w(n.max)?n.max:((n.srcCategories||n.categories).length||1)-1}},range:function(){var n=this.options;return{min:w(n.min)?n.min:0,max:w(n.max)?n.max:n.categories.length}},totalRange:function(){return{min:0,max:(this.options.srcCategories||this.options.categories).length}},getScale:function(){var n=this.rangeIndices(),i=n.min,r=n.max+(this.options.justified?0:1),t=this.lineBox(),u=this.options.vertical?t.height():t.width(),f=u/(r-i||1);return f*(this.options.reverse?-1:1)},getTickPositions:function(n){for(var t=this,u=t.options,s=u.vertical,h=t.lineBox(),c=u.reverse,v=t.getScale(),e=t.rangeIndices(),r=e.min,y=e.max+(u.justified?0:1),f=r%1!=0?i.floor(r/1)+n:r,p=h[(s?l:a)+(c?2:1)],o=[];f<=y;)o.push(p+k(v*(f-r),le)),f+=n;return o},getLabelsTickPositions:function(){var n=this.getMajorTickPositions().slice(0),t=this.rangeIndices(),i=this.getScale();return t.min%1!=0&&n.unshift(n[0]-i),t.max%1!=0&&n.push(st(n)+i),n},labelTickIndex:function(n){var t=n.index,r=this.rangeIndices();return r.min>0&&(t=t-i.floor(r.min)),t},arrangeLabels:function(){nu.fn.arrangeLabels.call(this);this.hideOutOfRangeLabels()},hideOutOfRangeLabels:function(){var u=this.box,t=this.labels,n=this.options.vertical?l:a,f=u[n+1],e=u[n+2],i=t[0],r=st(t);t.length&&((i.box[n+1]>e||i.box[n+2]<f)&&(i.options.visible=!1),(r.box[n+1]>e||r.box[n+2]<f)&&(r.options.visible=!1))},getMajorTickPositions:function(){return this.getTicks().majorTicks},getMinorTickPositions:function(){return this.getTicks().minorTicks},getTicks:function(){var n=this,t=n._ticks,r=n.options,u=n.rangeIndices(),f=r.reverse,e=r.justified,o=n.lineBox(),i;return i=o.getHash()+u.min+","+u.max+f+e,t._hash!==i&&(t._hash=i,t.majorTicks=n.getTickPositions(1),t.minorTicks=n.getTickPositions(.5)),t},getSlot:function(n,t,r){var h=this,c=h.options,v=c.reverse,d=c.justified,f=c.vertical?l:a,e=h.lineBox(),y=h.totalRange(),g=h.rangeIndices(),w=g.min,b=this.getScale(),k=e[f+(v?2:1)],p=e.clone(),o,s,it=!u(t);return n=nt(n,0),t=nt(t,n),n=tt(n,y.min,y.max||1),t=tt(t-1,n,y.max||1),t=i.max(n,t),o=k+(n-w)*b,s=k+(t+1-w)*b,it&&d&&(s=o),r&&(o=tt(o,e[f+1],e[f+2]),s=tt(s,e[f+1],e[f+2])),p[f+1]=v?s:o,p[f+2]=v?o:s,p},pointCategoryIndex:function(n){var r=this,u=r.options,p=u.reverse,o=u.justified,f=u.vertical?l:a,s=r.lineBox(),h=r.rangeIndices(),w=p?h.max+(o?0:1):h.min,b=this.getScale(),c=s[f+1],k=s[f+2],e=n[f],v,t,y;return e<c||e>k?null:(v=e-c,t=v/b,t=w+t,y=t%1,o?t=i.round(t):y===0&&t>0&&t--,i.floor(t))},getCategory:function(n){var t=this.pointCategoryIndex(n);return t===null?null:this.options.categories[t]},categoryIndex:function(n){return ie(n,this.options.categories)},translateRange:function(n){var t=this,i=t.options,r=t.lineBox(),e=i.vertical?r.height():r.width(),u=i.categories.length,o=e/u,f=k(n/o,ff);return{min:f,max:u+f}},zoomRange:function(n){var t=this.totalRangeIndices(),i=this.totalRange(),r=i.max-1,u=i.min,f=tt(t.min+n,u,r),e=tt(t.max-n,u,r);if(e-f>=0)return{min:f,max:e}},scaleRange:function(n){var r=this,u=r.options,t=u.categories.length,i=n*t;return{min:-i,max:t+i}},labelsCount:function(){var n=this.labelsRange();return n.max-n.min},labelsRange:function(){var u=this.options,t=u.labels,s=u.justified,f=this.totalRangeIndices(),n=f.min,r=f.max,e=u.limitCategories?i.floor(n)-this.outOfRangeMin:0,o;return s?(n=i.ceil(n),r=i.floor(r)):(n=i.floor(n),r=i.ceil(r)),o=n>t.skip?t.skip+t.step*i.ceil((n-t.skip)/t.step):t.skip,{min:o-e,max:(u.categories.length?r+1:0)-e}},createAxisLabel:function(n,t){var r=this,i=r.options,u=i.dataItems?i.dataItems[n]:null,f=nt(i.categories[n],""),e=r.axisLabelText(f,u,t);return new wo(f,e,n,u,t)},shouldRenderNote:function(n){var t=this.options.categories;return t.length&&t.length>n&&n>=0},pan:function(n){var t=this.totalRangeIndices(),u=this.getScale(),i=k(n/u,ff),r=this.totalRange(),f=t.min+i,e=t.max+i;return this.limitRange(f,e,r.min,r.max-1)},pointsRange:function(n,t,r){var e=this,o=e.options,y=o.reverse,p=o.justified,s=o.vertical?l:a,w=e.lineBox(),h=e.totalRangeIndices(),c=this.getScale(),v=w[s+(y?2:1)],b=n[s]-v,k=t[s]-v,f=h.min+b/c,u=h.min+k/c;return f=i.min(f,u),u=i.max(f,u),r||p||u--,{min:f,max:u}}}),pf=ui.extend({init:function(n){var t=this,i,u;n=n||{};n=r({roundToBaseUnit:!0},n,{categories:s(n.categories),min:s(n.min),max:s(n.max)});n.categories&&n.categories.length>0?(i=(n.baseUnit||"").toLowerCase(),u=i!==se&&!rt(i,wu),u&&(n.baseUnit=t.defaultBaseUnit(n)),(i===se||n.baseUnitStep===pv)&&t.autoBaseUnit(n),t.groupCategories(n)):n.baseUnit=n.baseUnit||rr;this._initFields();nu.fn.init.call(t,n)},options:{type:lr,labels:{dateFormats:tl},autoBaseUnitSteps:{seconds:[1,2,5,15,30],minutes:[1,2,5,15,30],hours:[1,2,3],days:[1,2,3],weeks:[1,2],months:[1,2,3,6],years:[1,2,3,5,10,25,50]},maxDateGroups:10},shouldRenderNote:function(n){var t=this,i=t.range(),r=t.options.categories||[];return hr(n,i.min)>=0&&hr(n,i.max)<=0&&r.length},parseNoteValue:function(n){return s(n)},translateRange:function(n){var r=this,i=r.options,u=i.baseUnit,f=i.weekStartDay,e=r.lineBox(),c=i.vertical?e.height():e.width(),t=r.range(),l=c/(t.max-t.min),o=k(n/l,ff),s,h;return t.min&&t.max&&(s=ut(i.min||t.min,o),h=ut(i.max||t.max,o),t={min:p(s,0,u,f),max:p(h,0,u,f)}),t},scaleRange:function(n){var e=this,o=i.abs(n),t=e.range(),r=t.min,u=t.max,f;if(t.min&&t.max){while(o--)t=gi(r,u),f=i.round(t*.1),n<0?(r=ut(r,f),u=ut(u,-f)):(r=ut(r,-f),u=ut(u,f));t={min:r,max:u}}return t},defaultBaseUnit:function(n){for(var e=n.categories,c=u(e)?e.length:0,f,o,t=ft,s,h,r=0;r<c;r++)f=e[r],f&&s&&(o=gi(f,s),o>0&&(t=i.min(t,o),h=t>=gs?pu:t>=ds-pi*3?of:t>=ks?ke:t>=pi?rr:t>=bs?pe:t>=vu?os:vs)),s=f;return h||rr},_categoryRange:function(n){var t=n._range;return t||(t=n._range=vv(n)),t},totalRange:function(){return{min:0,max:this.options.categories.length}},rangeIndices:function(){var n=this.options,t=n.categories,o=this._categoryRange(n.srcCategories||t),h=n.min||s(o.min),c=n.max||s(o.max),u=t.length-1,f=0,r=0,e;return t.length&&(e=gi(st(t),t[0])||1,f=gi(h,t[0])/e*u,r=u-gi(st(t),c)/e*u,n.justified||n.roundToBaseUnit||r==u||r--,n.roundToBaseUnit&&(f=i.floor(f),r=i.floor(r))),{min:f,max:r}},labelsRange:function(){var n=this.options,r=n.labels,t=this.rangeIndices(),u=i.floor(t.min),f=i.ceil(t.max);return{min:u+r.skip,max:n.categories.length?f+1:0}},panRange:function(n,t){var r=this._categoryRange(this.options.srcCategories),i=this.options,u=i.baseUnit,e=i.baseUnitStep||1,f=i.weekStartDay,o=g(p(r.min,0,u,f)),s=g(p(r.max,i.justified||i.roundToBaseUnit?0:e,u,f));return this.limitRange(n,t,o,s)},datesRange:function(){var n=this._categoryRange(this.options.srcCategories);return{min:s(n.min),max:s(n.max)}},pan:function(n){var u=this,i=u.options,h=i.baseUnit,f=u.lineBox(),c=i.vertical?f.height():f.width(),t=u.range(),l=c/(t.max-t.min),e=k(n/l,ff),r,o,s;return t.min&&t.max&&(o=ut(i.min||t.min,e),s=ut(i.max||t.max,e),r=this.panRange(o,s),r&&(r.baseUnit=h,r.baseUnitStep=i.baseUnitStep||1)),r},pointsRange:function(n,t){var r=ui.fn.pointsRange.call(this,n,t,!0),i=this.options.categories,u=i.length-1,f=gi(st(i),i[0]),e=ut(i[0],r.min/u*f),o=ut(i[0],r.max/u*f);return{min:e,max:o}},zoomRange:function(n){var t=this.options,h=this._categoryRange(this.options.categories),r=this._categoryRange(this.options.srcCategories),i=t.baseUnit,o=t.baseUnitStep||1,u=t.weekStartDay,f=p(s(t.min||h.min),n*o,i,u),e=p(s(t.max||h.max),-n*o,i,u),c=vf[i]*o;return f=s(tt(f,r.min,r.max)),e=s(tt(e,r.min,r.max)),gi(e,f)>c?{min:p(f,0,i,u),max:p(e,0,i,u)}:void 0},range:function(n){n=n||this.options;var e=n.categories,h=n.baseUnit===se,i=h?wu[0]:n.baseUnit,r=n.baseUnitStep||1,c=g(n.min),l=g(n.max),o=this._categoryRange(e),u=this._categoryRange(n.srcCategories||e),a=g(o.min),v=g(o.max),f=p(c||a,0,i,n.weekStartDay),t=p(l||v,r,i,n.weekStartDay);return n.outOfRangePoints&&(u.min<f&&(f=p(f,-r,i,n.weekStartDay)),t<=u.max&&(t=p(t,r,i,n.weekStartDay))),n.limitRange&&(t=tt(t,u.min,p(u.max,r,i,n.weekStartDay))),{min:s(f),max:s(t)}},autoBaseUnit:function(n){for(var h=this,l=h.range(r({},n,{baseUnitStep:1})),a=n.baseUnit===se,v=0,t=a?wu[v++]:n.baseUnit,y=l.max-l.min,f=y/vf[t],e=f,o=n.maxDateGroups||h.options.maxDateGroups,p=r({},h.options.autoBaseUnitSteps,n.autoBaseUnitSteps),s,u,c;!u||f>o;)if(s=s||p[t].slice(0),c=s.shift(),c)u=c,f=e/u;else if(t===st(wu)){u=i.ceil(e/o);break}else if(a)t=wu[v++]||st(wu),e=y/vf[t],s=null;else{f>o&&(u=i.ceil(e/o));break}n.baseUnitStep=u;n.baseUnit=t},_timeScale:function(){var t=this,i=t.range(),n=t.options,u=t.lineBox(),o=n.vertical,h=o?u.height():u.width(),r,f,e;return n.justified&&n._collapse!==!1?(f=this._categoryRange(n.categories),e=g(f.max),r=s(e)-i.min):r=i.max-i.min,h/r},groupCategories:function(n){for(var e=this,r=n.categories,o=s(fc(r)),h=n.baseUnit,c=n.baseUnitStep||1,u=e.range(n),l=u.max,i,f=[],t=u.min;t<l;t=i)if(f.push(t),i=p(t,c,h,n.weekStartDay),i>o&&!n.max)break;n.srcCategories=r;n.categories=f},createAxisLabel:function(n,t){var i=this.options,e=i.dataItems?i.dataItems[n]:null,r=i.categories[n],o=i.baseUnit,u=!0,h=t.dateFormats[o],s,f;return i.justified?(s=gf(r,o,i.weekStartDay),u=te(s,r)):i.roundToBaseUnit||(u=!te(this.range().max,r)),u&&(t.format=t.format||h,f=this.axisLabelText(r,e,t),f)?new wo(r,f,n,e,t):void 0},categoryIndex:function(n,t,i){var r=this,u=r.options,f=u.categories;return(n=s(n),t=t||r.range(),i&&n&&u.roundToBaseUnit&&n>=t.max)?f.length:!n||n<t.min||n>=t.max?-1:wh(n,f)},getSlot:function(n,t,i){var r=this;return typeof n===yi&&(n=r.categoryIndex(n,null,i)),typeof t===yi&&(t=r.categoryIndex(t,null,i)),ui.fn.getSlot.call(r,n,t,i)}}),fl=nu.extend({init:function(n,t,i){var u=this;i=i||{};r(i,{min:s(i.min),max:s(i.max),axisCrossingValue:s(i.axisCrossingValues||i.axisCrossingValue)});i=u.applyDefaults(s(n),s(t),i);nu.fn.init.call(u,i)},options:{type:lr,majorGridLines:{visible:!0,width:1,color:uu},labels:{dateFormats:tl}},applyDefaults:function(n,r,u){var k=this,a=u.min||n,o=u.max||r,f=u.baseUnit||k.timeUnits(o-a),v=vf[f],h=gf(g(a)-1,f)||s(o),c=ph(g(o)+1,f),d=u.majorUnit?u.majorUnit:t,l=d||e.ceil(e.autoMajorUnit(h.getTime(),c.getTime()),v)/v,y=ao(h,c,f),nt=e.ceil(y,l),w=nt-y,b=i.floor(w/2),tt=w-b;return u.baseUnit||delete u.baseUnit,u.baseUnit=u.baseUnit||f,u.min=u.min||p(h,-b,f),u.max=u.max||p(c,tt,f),u.minorUnit=u.minorUnit||l/5,u.majorUnit=l,this.totalMin=g(gf(g(n)-1,f)),this.totalMax=g(ph(g(r)+1,f)),u},range:function(){var n=this.options;return{min:n.min,max:n.max}},getDivisions:function(n){var t=this.options;return i.floor(ao(t.min,t.max,t.baseUnit)/n+1)},getTickPositions:function(n){for(var s,h,t=this.options,i=t.vertical,c=t.reverse,r=this.lineBox(),f=(i?-1:1)*(c?-1:1),v=f===1?1:2,e=r[(i?l:a)+v],y=this.getDivisions(n),w=t.max-t.min,b=i?r.height():r.width(),d=b/w,o=[e],u=1;u<y;u++)s=p(t.min,u*t.majorUnit,t.baseUnit),h=e+(s-t.min)*d*f,o.push(k(h,le));return o},getMajorTickPositions:function(){var n=this;return n.getTickPositions(n.options.majorUnit)},getMinorTickPositions:function(){var n=this;return n.getTickPositions(n.options.minorUnit)},getSlot:function(n,t,i){return ee.fn.getSlot.call(this,s(n),s(t),i)},getValue:function(n){var t=ee.fn.getValue.call(this,n);return t!==null?s(t):null},labelsCount:function(){return this.getDivisions(this.options.majorUnit)},createAxisLabel:function(n,t){var i=this.options,u=n*i.majorUnit,r=i.min,f,e;return u>0&&(r=p(r,u,i.baseUnit)),f=t.dateFormats[i.baseUnit],t.format=t.format||f,e=this.axisLabelText(r,null,t),new wo(r,e,n,null,t)},timeUnits:function(n){var t=pe;return n>=gs?t=pu:n>=ds?t=of:n>=ks?t=ke:n>=pi&&(t=rr),t},translateRange:function(n,t){var r=this,i=r.options,e=i.baseUnit,o=i.weekStartDay,s=r.lineBox(),l=i.vertical?s.height():s.width(),h=r.range(),a=l/(h.max-h.min),c=k(n/a,ff),u=ut(i.min,c),f=ut(i.max,c);return t||(u=p(u,0,e,o),f=p(f,0,e,o)),{min:u,max:f}},scaleRange:function(n){for(var o=this,f=o.options,s=i.abs(n),t=f.min,r=f.max,e,u;s--;)e=gi(t,r),u=i.round(e*.1),n<0?(t=ut(t,u),r=ut(r,-u)):(t=ut(t,-u),r=ut(r,u));return{min:t,max:r}},shouldRenderNote:function(n){var t=this.range();return hr(n,t.min)>=0&&hr(n,t.max)<=0},pan:function(n){var i=this.translateRange(n,!0),t=this.limitRange(g(i.min),g(i.max),this.totalMin,this.totalMax);if(t)return{min:s(t.min),max:s(t.max)}},pointsRange:function(n,t){var r=this.getValue(n),u=this.getValue(t),f=i.min(r,u),e=i.max(r,u);return{min:s(f),max:s(e)}},zoomRange:function(n){var t=this.scaleRange(n),i=s(tt(g(t.min),this.totalMin,this.totalMax)),r=s(tt(g(t.max),this.totalMin,this.totalMax));return{min:i,max:r}}}),wf=f.extend({options:{vertical:!1,gap:0,spacing:0},reflow:function(n){for(var h=this,e=h.options,c=e.vertical,o=c?l:a,s=h.children,v=e.gap,y=e.spacing,i=s.length,p=i+v+y*(i-1),r=(c?n.height():n.width())/p,u=n[o+1]+r*(v/2),f,t=0;t<i;t++)f=(s[t].box||n).clone(),f[o+1]=u,f[o+2]=u+r,s[t].reflow(f),t<i-1&&(u+=r*y),u+=r}}),el=f.extend({options:{vertical:!0},reflow:function(n){for(var e=this.options,o=e.vertical,s=o?a:l,u=this.children,f=this.box=new b,h=u.length,r,i,t=0;t<h;t++)r=u[t],r.visible!==!1&&(i=r.box.clone(),i.snapTo(n,s),t===0&&(f=this.box=i.clone()),r.reflow(i),f.wrap(i))}}),ki={click:function(n,t){return n.trigger(kc,this.eventArgs(t))},hover:function(n,t){return n.trigger(ys,this.eventArgs(t))},eventArgs:function(t){return{value:this.value,percentage:this.percentage,category:this.category,series:this.series,dataItem:this.dataItem,runningTotal:this.runningTotal,total:this.total,element:n((t||{}).target),originalEvent:t,point:this}}},no={createNote:function(){var n=this,i=n.options.notes,t=n.noteText||i.label.text;i.visible!==!1&&u(t)&&t!==null&&(n.note=new cv(n.value,t,n.dataItem,n.category,n.series,n.options.notes),n.append(n.note))}},bf=f.extend({init:function(n,t){var i=this;f.fn.init.call(i);i.options=t;i.color=t.color||wi;i.aboveAxis=nt(i.options.aboveAxis,!0);i.value=n},defaults:{border:{width:1},vertical:!0,overlay:{gradient:ts},labels:{visible:!1,format:"{0}"},opacity:1,notes:{label:{}}},render:function(){this._rendered||(this._rendered=!0,this.createLabel(),this.createNote(),this.errorBar&&this.append(this.errorBar))},createLabel:function(){var t=this.options,n=t.labels,i,u;n.visible&&(n.template?(u=wt(n.template),i=u({dataItem:this.dataItem,category:this.category,value:this.value,percentage:this.percentage,runningTotal:this.runningTotal,total:this.total,series:this.series})):i=this.formatValue(n.format),this.label=new th(i,r({vertical:t.vertical},t.labels)),this.append(this.label))},formatValue:function(n){return this.owner.formatPointValue(this,n)},reflow:function(n){var t,i,r;if(this.render(),t=this,i=t.label,t.box=n,i&&(i.options.aboveAxis=t.aboveAxis,i.reflow(n)),t.note&&t.note.reflow(n),t.errorBars)for(r=0;r<t.errorBars.length;r++)t.errorBars[r].reflow(n)},createVisual:function(){var n=this,t=n.box,r=n.options,u=r.visual,i;n.visible!==!1&&(f.fn.createVisual.call(n),u?(i=this.rectVisual=u({category:n.category,dataItem:n.dataItem,value:n.value,sender:n.getChart(),series:n.series,percentage:n.percentage,runningTotal:n.runningTotal,total:n.total,rect:t.toRect(),createVisual:function(){var t=new o.Group;return n.createRect(t),t},options:r}),i&&n.visual.append(i)):t.width()>0&&t.height()>0&&n.createRect(n.visual))},createRect:function(n){var i=this.options,f=i.border,l=u(f.opacity)?f.opacity:i.opacity,s=this.box.toRect();s.size.width=Math.round(s.size.width);var e=this.rectVisual=o.Path.fromRect(s,{fill:{color:this.color,opacity:i.opacity},stroke:{color:this.getBorderColor(),width:f.width,opacity:l,dashType:f.dashType}}),h=this.box.width(),c=this.box.height(),a=i.vertical?h:c;a>bv&&(ru(e),(h<1||c<1)&&(e.options.stroke.lineJoin="round"));n.append(e);kh(i)&&n.append(this.createGradientOverlay(e,{baseColor:this.color},r({end:i.vertical?t:[0,1]},i.overlay)))},createHighlight:function(n){var t=o.Path.fromRect(this.box.toRect(),n);return ru(t)},highlightVisual:function(){return this.rectVisual},highlightVisualArgs:function(){return{options:this.options,rect:this.box.toRect(),visual:this.rectVisual}},getBorderColor:function(){var t=this,r=t.options,f=t.color,i=r.border,n=i.color,e=i._brightness||he;return u(n)||(n=new tu(f).brightness(e).toHex()),n},tooltipAnchor:function(n,t){var u=this,l=u.options,r=u.box,a=l.vertical,s=u.aboveAxis,f=u.owner.pane.clipBox()||r,e,o,h,c;return a?(e=r.x2+pt,o=s?i.max(r.y1,f.y1):i.min(r.y2,f.y2)-t):(h=i.max(r.x1,f.x1),c=i.min(r.x2,f.x2),l.isStacked?(e=s?c-n:h,o=r.y1-t-pt):(e=s?c+pt:h-n-pt,o=r.y1)),new v(e,o)}});r(bf.fn,ki);r(bf.fn,no);ol=o.Animation.extend({options:{duration:kt},setup:function(){var t=this.element,i=this.options,u=t.bbox(),r,n;u?(this.origin=i.origin,r=i.vertical?l:a,n=this.fromScale=new c.Point(1,1),n[r]=af,t.transform(c.transform().scale(n.x,n.y))):this.abort()},step:function(n){var t=bo(this.fromScale.x,1,n),i=bo(this.fromScale.y,1,n);this.element.transform(c.transform().scale(t,i,this.origin))},abort:function(){o.Animation.fn.abort.call(this);this.element.transform(null)}});o.AnimationFactory.current.register(li,ol);sl=o.Animation.extend({options:{duration:200,easing:"linear"},setup:function(){this.fadeTo=this.element.opacity();this.element.opacity(0)},step:function(n){this.element.opacity(n*this.fadeTo)}});o.AnimationFactory.current.register(ar,sl);bu=function(n,t,i){var r=this;r.initGlobalRanges(n,t,i)};bu.prototype=bu.fn={percentRegex:/percent(?:\w*)\((\d+)\)/,standardDeviationRegex:new RegExp("^stddev(?:\\((\\d+(?:\\.\\d+)?)\\))?$"),initGlobalRanges:function(n,t,i){var r=this,u=t.data,f=r.standardDeviationRegex.exec(n),o;if(f){r.valueGetter=r.createValueGetter(t,i);var e=r.getAverage(u),s=r.getStandardDeviation(u,e,!1),h=f[1]?parseFloat(f[1]):1,c={low:e.value-s*h,high:e.value+s*h};r.globalRange=function(){return c}}else n.indexOf&&n.indexOf(ay)>=0&&(r.valueGetter=r.createValueGetter(t,i),o=r.getStandardError(u,r.getAverage(u)),r.globalRange=function(n){return{low:n-o,high:n+o}})},createValueGetter:function(n,t){var e=n.data,o=d.current,r=o.valueFields(n),f=u(e[0])?e[0]:{},s,h,i;return er(f)?(s=t?ie(t,r):0,i=tf("["+s+"]")):w(f)?i=tf():typeof f===yi&&(h=o.sourceFields(n,r),i=tf(h[ie(t,r)])),i},getErrorRange:function(n,t){var o=this,f,e,r,s;if(u(t)){if(o.globalRange)return o.globalRange(n);if(er(t))f=n-t[0],e=n+t[1];else if(w(r=parseFloat(t)))f=n-r,e=n+r;else if(r=o.percentRegex.exec(t))s=n*(parseFloat(r[1])/100),f=n-i.abs(s),e=n+i.abs(s);else throw new Error("Invalid ErrorBar value: "+t);return{low:f,high:e}}},getStandardError:function(n,t){return this.getStandardDeviation(n,t,!0)/i.sqrt(t.count)},getStandardDeviation:function(n,t,r){for(var e=0,o=n.length,s=r?t.count-1:t.count,u,f=0;f<o;f++)u=this.valueGetter(n[f]),w(u)&&(e+=i.pow(u-t.value,2));return i.sqrt(e/s)},getAverage:function(n){for(var u=0,t=0,f=n.length,i,r=0;r<f;r++)i=this.valueGetter(n[r]),w(i)&&(u+=i,t++);return{value:u/t,count:t}}};var ni=f.extend({init:function(n,t){var i=this;f.fn.init.call(i,t);i.plotArea=n;i.categoryAxis=n.seriesCategoryAxis(t.series[0]);i.valueAxisRanges={};i.points=[];i.categoryPoints=[];i.seriesPoints=[];i.seriesOptions=[];i._evalSeries=[];i.render()},options:{series:[],invertAxes:!1,isStacked:!1,clip:!0},render:function(){var n=this;n.traverseDataPoints(y(n.addValue,n))},pointOptions:function(n,t){var i=this.seriesOptions[t],u;return i||(u=this.pointType().fn.defaults,this.seriesOptions[t]=i=r({},u,{vertical:!this.options.invertAxes},n)),i},plotValue:function(n){var r,t,f,e;if(!n)return 0;if(this.options.isStacked100&&w(n.value)){var s=n.categoryIx,o=this.categoryPoints[s],u=0,h=[];for(r=0;r<o.length;r++)if(t=o[r],t){if(f=n.series.stack,e=t.series.stack,f&&e&&f.group!==e.group)continue;w(t.value)&&(u+=i.abs(t.value),h.push(i.abs(t.value)))}if(u>0)return n.value/u}return n.value},plotRange:function(n,t){var y=n.categoryIx,c=this.categoryPoints[y],e,o,r,s,f;if(this.options.isStacked){t=t||0;var u=this.plotValue(n),l=u>=0,h=t,a=!1;for(e=0;e<c.length;e++){if(o=c[e],n===o)break;if(r=n.series.stack,s=o.series.stack,r&&s){if(typeof r===au&&r!==s)continue;if(r.group&&r.group!==s.group)continue}f=this.plotValue(o);(f>=0&&l||f<0&&!l)&&(h+=f,u+=f,a=!0,this.options.isStacked100&&(u=i.min(u,1)))}return a&&(h-=t),[h,u]}var p=n.series,w=this.seriesValueAxis(p),v=this.categoryAxisCrossingValue(w);return[v,n.value||v]},stackLimits:function(n,t){for(var c,e,r,f,o=ft,s=at,h=0;h<this.categoryPoints.length;h++)for(c=this.categoryPoints[h],e=0;e<c.length;e++)r=c[e],r&&(r.series.stack===t||r.series.axis===n)&&(f=this.plotRange(r,0)[1],u(f)&&isFinite(f)&&(s=i.max(s,f),o=i.min(o,f)));return{min:o,max:s}},updateStackRange:function(){var r=this,o=r.options.series,c=r.options.isStacked,n,s={},u,t;if(c)for(u=0;u<o.length;u++){var f=o[u],e=f.axis,h=e+f.stack;n=s[h];n||(n=r.stackLimits(e,f.stack),t=r.errorTotals,t&&(t.negative.length&&(n.min=i.min(n.min,yv(t.negative))),t.positive.length&&(n.max=i.max(n.max,fc(t.positive)))),n.min!==ft||n.max!==at?s[h]=n:n=null);n&&(r.valueAxisRanges[e]=n)}},addErrorBar:function(n,t,i){var r=this,c=n.value,l=n.series,o=n.seriesIx,e=n.options.errorBars,f,s=t.fields[hc],h=t.fields[cc];w(s)&&w(h)?f={low:s,high:h}:e&&u(e.value)&&(r.seriesErrorRanges=r.seriesErrorRanges||[],r.seriesErrorRanges[o]=r.seriesErrorRanges[o]||new bu(e.value,l,gt),f=r.seriesErrorRanges[o].getErrorRange(c,e.value));f&&(n.low=f.low,n.high=f.high,r.addPointErrorBar(n,i))},addPointErrorBar:function(n,t){var i=this,s=n.series,r=n.low,u=n.high,h=!i.options.invertAxes,c=n.options.errorBars,f,e,o;i.options.isStacked?(e=i.stackedErrorRange(n,t),r=e.low,u=e.high):(o={categoryIx:t,series:s},i.updateRange({value:r},o),i.updateRange({value:u},o));f=new al(r,u,h,i,s,c);n.errorBars=[f];n.append(f)},stackedErrorRange:function(n,t){var r=this,e=r.plotRange(n,0)[1]-n.value,u=n.low+e,f=n.high+e;return r.errorTotals=r.errorTotals||{positive:[],negative:[]},u<0&&(r.errorTotals.negative[t]=i.min(r.errorTotals.negative[t]||0,u)),f>0&&(r.errorTotals.positive[t]=i.max(r.errorTotals.positive[t]||0,f)),{low:u,high:f}},addValue:function(t,i){var u=this,f=i.categoryIx,h=i.series,s=i.seriesIx,o=u.categoryPoints[f],e,r;o||(u.categoryPoints[f]=o=[]);e=u.seriesPoints[s];e||(u.seriesPoints[s]=e=[]);r=u.createPoint(t,i);r&&(n.extend(r,i),r.owner=u,r.dataItem=h.data[f],r.noteText=t.fields.noteText,u.addErrorBar(r,t,f));u.points.push(r);e.push(r);o.push(r);u.updateRange(t.valueFields,i)},evalPointOptions:function(n,t,i,f,e,o){var h={defaults:e._defaults,excluded:["data","aggregate","_events","tooltip","template","visual","toggle"]},s=this._evalSeries[o];return u(s)||(this._evalSeries[o]=s=dr(n,{},h,!0)),s&&(n=r({},n),dr(n,{value:t,category:i,index:f,series:e,dataItem:e.data[f]},h)),n},updateRange:function(n,t){var f=this,e=t.series.axis,u=n.value,r=f.valueAxisRanges[e];isFinite(u)&&u!==null&&(r=f.valueAxisRanges[e]=r||{min:ft,max:at},r.min=i.min(r.min,u),r.max=i.max(r.max,u))},seriesValueAxis:function(n){var i=this.plotArea,t=n.axis,r=t?i.namedValueAxes[t]:i.valueAxis;if(!r)throw new Error("Unable to locate value axis with name "+t);return r},reflow:function(n){var t=this,f=0,u=t.categorySlots=[],e=t.points,o=t.categoryAxis,s,r,i;t.traverseDataPoints(function(n,h){var l=h.categoryIx,p=h.series,c,a,v,y;s=t.pointValue(n);r=t.seriesValueAxis(p);i=e[f++];c=u[l];c||(u[l]=c=t.categorySlot(o,l,r));i&&(a=t.plotRange(i,r.startValue()),v=r.getSlot(a[0],a[1],!t.options.clip),v?(y=t.pointSlot(c,v),i.aboveAxis=t.aboveAxis(i,r),t.options.isStacked100&&(i.percentage=t.plotValue(i)),t.reflowPoint(i,y)):i.visible=!1)});t.reflowCategories(u);t.box=n},aboveAxis:function(n,t){var i=this.categoryAxisCrossingValue(t),r=n.value;return t.options.reverse?r<i:r>=i},categoryAxisCrossingValue:function(n){var i=this.categoryAxis,t=n.options,r=[].concat(t.axisCrossingValues||t.axisCrossingValue);return r[i.axisIndex||0]||0},reflowPoint:function(n,t){n.reflow(t)},reflowCategories:function(){},pointSlot:function(n,t){var f=this,e=f.options,i=e.invertAxes,r=i?t:n,u=i?n:t;return new b(r.x1,u.y1,r.x2,u.y2)},categorySlot:function(n,t){return n.getSlot(t)},traverseDataPoints:function(n){for(var f=this,s=f.options,r=s.series,h=f.categoryAxis.options.categories||[],c=lo(r),i,e,o,u,l=r.length,t=0;t<c;t++)for(i=0;i<l;i++)u=r[i],o=h[t],e=this._bindPoint(u,i,t),n(e,{category:o,categoryIx:t,series:u,seriesIx:i})},_bindPoint:function(n,t,i){var r,u;return this._bindCache||(this._bindCache=[]),r=this._bindCache[t],r||(r=this._bindCache[t]=[]),u=r[i],u||(u=r[i]=d.current.bindPoint(n,i)),u},formatPointValue:function(n,t){return n.value===null?"":vt(t,n.value)},pointValue:function(n){return n.valueFields.value}}),br=ni.extend({options:{animation:{type:li}},render:function(){var n=this;ni.fn.render.apply(n);n.updateStackRange()},pointType:function(){return bf},clusterType:function(){return wf},stackType:function(){return el},stackLimits:function(n,t){return ni.fn.stackLimits.call(this,n,t)},createPoint:function(n,t){var i=this,v=t.categoryIx,w=t.category,f=t.series,y=t.seriesIx,s=i.pointValue(n),c=i.options,b=i.children,l=i.options.isStacked,e,k=i.pointType(),r,u,d=i.clusterType(),a,o,p;return r=this.pointOptions(f,y),a=r.labels,l&&a.position==vr&&(a.position=is),r.isStacked=l,o=n.fields.color||f.color,s<0&&r.negativeColor&&(o=r.negativeColor),r=i.evalPointOptions(r,s,w,v,f,y),h.isFunction(f.color)&&(o=r.color),e=new k(s,r),e.color=o,u=b[v],u||(u=new d({vertical:c.invertAxes,gap:c.gap,spacing:c.spacing}),i.append(u)),l?(p=i.getStackWrap(f,u),p.append(e)):u.append(e),e},getStackWrap:function(n,t){var u=n.stack,e=u?u.group||u:u,f=t.children,i,r,o;if(typeof e===au){for(r=0;r<f.length;r++)if(f[r]._stackGroup===e){i=f[r];break}}else i=f[0];return i||(o=this.stackType(),i=new o({vertical:!this.options.invertAxes}),i._stackGroup=e,t.append(i)),i},categorySlot:function(n,t,i){var s=this,f=s.options,u=n.getSlot(t),e=i.startValue(),r,o;return f.isStacked&&(o=i.getSlot(e,e,!0),r=f.invertAxes?a:l,u[r+1]=u[r+2]=o[r+1]),u},reflowCategories:function(n){for(var r=this,i=r.children,u=i.length,t=0;t<u;t++)i[t].reflow(n[t])},createAnimation:function(){this._setAnimationOptions();f.fn.createAnimation.call(this);uv(this.options.series)&&this._setChildrenAnimation()},_setChildrenAnimation:function(){for(var r=this.points,n,t,i=0;i<r.length;i++)n=r[i],t=n.visual,t&&u(t.options.zIndex)&&(n.options.animation=this.options.animation,n.createAnimation())},_setAnimationOptions:function(){var t=this.options,r=t.animation||{},n,i;this.options.isStacked?(i=this.seriesValueAxis(t.series[0]),n=i.getSlot(i.startValue())):n=this.categoryAxis.getSlot(0);r.origin=new c.Point(n.x1,n.y1);r.vertical=!t.invertAxes}}),hl=bf.extend({defaults:{labels:{format:"{0} - {1}"},tooltip:{format:"{1}"}},createLabel:function(){var n=this.options.labels,t=r({},n,n.from),i=r({},n,n.to);t.visible&&(this.labelFrom=this._createLabel(t),this.append(this.labelFrom));i.visible&&(this.labelTo=this._createLabel(i),this.append(this.labelTo))},_createLabel:function(n){var t,i;return n.template?(i=wt(n.template),t=i({dataItem:this.dataItem,category:this.category,value:this.value,percentage:this.percentage,runningTotal:this.runningTotal,total:this.total,series:this.series})):t=this.formatValue(n.format),new th(t,r({vertical:this.options.vertical},n))},reflow:function(n){this.render();var t=this,i=t.labelFrom,r=t.labelTo;t.box=n;i&&(i.options.aboveAxis=t.value.from>t.value.to,i.reflow(n));r&&(r.options.aboveAxis=t.value.to>t.value.from,r.reflow(n));t.note&&t.note.reflow(n)}}),cl=br.extend({pointType:function(){return hl},pointValue:function(n){return n.valueFields},formatPointValue:function(n,t){return n.value.from===null&&n.value.to===null?"":vt(t,n.value.from,n.value.to)},plotLimits:ni.fn.plotLimits,plotRange:function(n){return n?[n.value.from,n.value.to]:0},updateRange:function(n,t){var e=this,o=t.series.axis,u=n.from,f=n.to,r=e.valueAxisRanges[o];n!==null&&w(u)&&w(f)&&(r=e.valueAxisRanges[o]=r||{min:ft,max:at},r.min=i.min(r.min,u),r.max=i.max(r.max,u),r.min=i.min(r.min,f),r.max=i.max(r.max,f))},aboveAxis:function(n){var t=n.value;return t.from<t.to}}),ll=ni.extend({init:function(n,t){var i=this;i.wrapData(t);ni.fn.init.call(i,n,t)},options:{animation:{type:li}},wrapData:function(n){for(var u=n.series,t,r,i=0;i<u.length;i++)r=u[i],t=r.data,t&&!er(t[0])&&typeof t[0]!=yi&&(r.data=[t])},reflowCategories:function(n){for(var r=this,i=r.children,u=i.length,t=0;t<u;t++)i[t].reflow(n[t])},plotRange:function(n){var i=n.series,r=this.seriesValueAxis(i),t=this.categoryAxisCrossingValue(r);return[t,n.value.current||t]},createPoint:function(n,t){var o=this,c=t.categoryIx,v=t.category,i=t.series,y=t.seriesIx,a=n.valueFields,u=o.options,p=o.children,s,f,e,l;return f=r({vertical:!u.invertAxes,overlay:i.overlay,categoryIx:c,invertAxes:u.invertAxes},i),l=n.fields.color||i.color,f=o.evalPointOptions(f,a,v,c,i,y),h.isFunction(i.color)&&(l=f.color),s=new to(a,f),s.color=l,e=p[c],e||(e=new wf({vertical:u.invertAxes,gap:u.gap,spacing:u.spacing}),o.append(e)),e.append(s),s},updateRange:function(n,t){var o=this,s=t.series.axis,f=n.current,e=n.target,r=o.valueAxisRanges[s];u(f)&&!isNaN(f)&&u(e&&!isNaN(e))&&(r=o.valueAxisRanges[s]=r||{min:ft,max:at},r.min=i.min.apply(i,[r.min,f,e]),r.max=i.max.apply(i,[r.max,f,e]))},formatPointValue:function(n,t){return vt(t,n.value.current,n.value.target)},pointValue:function(n){return n.valueFields.current},aboveAxis:function(n){var t=n.value.current;return t>0},createAnimation:function(){var i=this.points,t,n;for(this._setAnimationOptions(),n=0;n<i.length;n++)t=i[n],t.options.animation=this.options.animation,t.createAnimation()},_setAnimationOptions:br.fn._setAnimationOptions}),to=f.extend({init:function(n,t){var i=this;f.fn.init.call(i,t);i.aboveAxis=i.options.aboveAxis;i.color=t.color||wi;i.value=n},options:{border:{width:1},vertical:!1,opacity:1,target:{shape:"",border:{width:0,color:"green"},line:{width:2}},tooltip:{format:"Current: {0}<\/br>Target: {1}"}},render:function(){var n=this,t=n.options;n._rendered||(n._rendered=!0,u(n.value.target)&&(n.target=new ih({type:t.target.shape,background:t.target.color||n.color,opacity:t.opacity,zIndex:t.zIndex,border:t.target.border,vAlign:dt,align:et}),n.append(n.target)),n.createNote())},reflow:function(n){this.render();var t=this,i=t.options,e=t.owner,r=t.target,u=i.invertAxes,o=e.seriesValueAxis(t.options),s=e.categorySlot(e.categoryAxis,i.categoryIx,o),h=o.getSlot(t.value.target),c=u?h:s,l=u?s:h,f;r&&(f=new b(c.x1,l.y1,c.x2,l.y2),r.options.height=u?f.height():i.target.line.width,r.options.width=u?i.target.line.width:f.width(),r.reflow(f));t.note&&t.note.reflow(n);t.box=n},createVisual:function(){f.fn.createVisual.call(this);var n=this.options,t=o.Path.fromRect(this.box.toRect(),{fill:{color:this.color,opacity:n.opacity},stroke:null});n.border.width>0&&t.options.set("stroke",{color:n.border.color||this.color,width:n.border.width,dashType:n.border.dashType,opacity:nt(n.border.opacity,n.opacity)});this.bodyVisual=t;ru(t);this.visual.append(t)},createAnimation:function(){this.bodyVisual&&(this.animation=o.Animation.create(this.bodyVisual,this.options.animation))},tooltipAnchor:function(n,t){var u=this,l=u.options,r=u.box,a=l.vertical,s=u.aboveAxis,f=u.owner.pane.clipBox()||r,e,o,h,c;return a?(e=r.x2+pt,o=s?i.max(r.y1,f.y1):i.min(r.y2,f.y2)-t):(h=i.max(r.x1,f.x1),c=i.min(r.x2,f.x2),l.isStacked?(e=s?c-n:h,o=r.y1-t-pt):(e=s?c+pt:h-n-pt,o=r.y1)),new v(e,o)},createHighlight:function(n){return o.Path.fromRect(this.box.toRect(),n)},highlightVisual:function(){return this.bodyVisual},highlightVisualArgs:function(){return{rect:this.box.toRect(),visual:this.bodyVisual,options:this.options}},formatValue:function(n){var t=this;return t.owner.formatPointValue(t,n)}});r(to.fn,ki);r(to.fn,no);ih=iu.extend();r(ih.fn,ki);var rh=f.extend({init:function(n,t,i,r,u,e){var o=this;o.low=n;o.high=t;o.isVertical=i;o.chart=r;o.series=u;f.fn.init.call(o,e)},options:{animation:{type:ar,delay:kt},endCaps:!0,line:{width:1},zIndex:1},getAxis:function(){},reflow:function(n){var e,i=this,s=i.options.endCaps,o=i.isVertical,l=i.getAxis(),t=l.getSlot(i.low,i.high),r=n.center(),h=i.getCapsWidth(n,o),c=o?r.x:r.y,u=c-h,f=c+h;o?(e=[v(r.x,t.y1),v(r.x,t.y2)],s&&e.push(v(u,t.y1),v(f,t.y1),v(u,t.y2),v(f,t.y2)),i.box=b(u,t.y1,f,t.y2)):(e=[v(t.x1,r.y),v(t.x2,r.y)],s&&e.push(v(t.x1,u),v(t.x1,f),v(t.x2,u),v(t.x2,f)),i.box=b(t.x1,u,t.x2,f));i.linePoints=e},getCapsWidth:function(n,t){var r=t?n.width():n.height();return i.min(i.floor(r/2),sc)||sc},createVisual:function(){var n=this,t=n.options,i=t.visual;i?n.visual=i({low:n.low,high:n.high,rect:n.box.toRect(),sender:n.getChart(),options:{endCaps:t.endCaps,color:t.color,line:t.line},createVisual:function(){n.createDefaultVisual();var t=n.visual;return delete n.visual,t}}):n.createDefaultVisual()},createDefaultVisual:function(){var r=this,i=r.options,e={stroke:{color:i.color,width:i.line.width,dashType:i.line.dashType}},t=r.linePoints,n,u;for(f.fn.createVisual.call(this),n=0;n<t.length;n+=2)u=new o.Path(e).moveTo(t[n].x,t[n].y).lineTo(t[n+1].x,t[n+1].y),this.visual.append(u)}}),al=rh.extend({getAxis:function(){var n=this,t=n.chart,i=n.series;return t.seriesValueAxis(i)}}),vl=rh.extend({getAxis:function(){var n=this,i=n.chart,r=n.series,t=i.seriesAxes(r);return n.isVertical?t.y:t.x}}),fi=f.extend({init:function(n,t){var i=this;f.fn.init.call(i);i.value=n;i.options=t;i.aboveAxis=nt(i.options.aboveAxis,!0);i.tooltipTracking=!0},defaults:{vertical:!0,markers:{visible:!0,background:wi,size:us,type:su,border:{width:2},opacity:1},labels:{visible:!1,position:oc,margin:ci(3),padding:ci(4),animation:{type:ar,delay:kt}},notes:{label:{}},highlight:{markers:{border:{}}}},render:function(){var n=this,u=n.options,f=u.markers,t=u.labels,i=n.value,e;n._rendered||(n._rendered=!0,f.visible&&f.size&&(n.marker=n.createMarker(),n.append(n.marker)),t.visible&&(t.template?(e=wt(t.template),i=e({dataItem:n.dataItem,category:n.category,value:n.value,percentage:n.percentage,series:n.series})):t.format&&(i=n.formatValue(t.format)),n.label=new oe(i,r({align:it,vAlign:it,margin:{left:5,right:5},zIndex:nt(t.zIndex,this.series.zIndex)},t)),n.append(n.label)),n.createNote(),n.errorBar&&n.append(n.errorBar))},markerBorder:function(){var t=this.options.markers,i=t.background,n=r({color:this.color},t.border);return u(n.color)||(n.color=new tu(i).brightness(he).toHex()),n},createVisual:nf,createMarker:function(){var n=this.options.markers;return new iu({type:n.type,width:n.size,height:n.size,rotation:n.rotation,background:n.background,border:this.markerBorder(),opacity:n.opacity,zIndex:nt(n.zIndex,this.series.zIndex),animation:n.animation,visual:n.visual},{dataItem:this.dataItem,value:this.value,series:this.series,category:this.category})},markerBox:function(){return this.marker||(this.marker=this.createMarker(),this.marker.reflow(this._childBox)),this.marker.box},reflow:function(n){var t=this,o=t.options,s=o.vertical,e=t.aboveAxis,i,r,u,f;if(t.render(),t.box=n,i=n.clone(),s?e?i.y1-=i.height():i.y2+=i.height():e?i.x1+=i.width():i.x2-=i.width(),t._childBox=i,t.marker&&t.marker.reflow(i),t.reflowLabel(i),t.errorBars)for(u=0;u<t.errorBars.length;u++)t.errorBars[u].reflow(i);t.note&&(f=t.markerBox(),t.marker||(r=f.center(),f=b(r.x,r.y,r.x,r.y)),t.note.reflow(f))},reflowLabel:function(n){var r=this,u=r.options,i=r.label,t=u.labels.position;i&&(t=t===oc?dt:t,t=t===kv?ai:t,i.reflow(n),i.box.alignTo(r.markerBox(),t),i.reflow(i.box))},createHighlight:function(){var r=this.options.highlight,n=r.markers,u=this.markerBorder().color,t=this.options.markers,i=new iu({type:t.type,width:t.size,height:t.size,rotation:t.rotation,background:n.color||u,border:{color:n.border.color,width:n.border.width,opacity:nt(n.border.opacity,1)},opacity:nt(n.opacity,1)});return i.reflow(this._childBox),i.getElement()},highlightVisual:function(){return(this.marker||{}).visual},highlightVisualArgs:function(){var n=this.marker,r,t;if(n)t=n.paddingBox.toRect(),r=n.visual;else{var i=this.options.markers.size,u=i/2,f=this.box.center();t=new c.Rect([f.x-u,f.y-u],[i,i])}return{options:this.options,rect:t,visual:r}},tooltipAnchor:function(n,t){var r=this,i=r.markerBox(),f=r.aboveAxis,e=i.x2+pt,o=f?i.y1-t:i.y2,u=r.owner.pane.clipBox(),s=!u||u.overlaps(i);if(s)return v(e,o)},formatValue:function(n){var t=this;return t.owner.formatPointValue(t,n)}});r(fi.fn,ki);r(fi.fn,no);var yl=fi.extend({init:function(n,t){var i=this;fi.fn.init.call(i,n,t);i.category=n.category},defaults:{labels:{position:it},highlight:{opacity:1,border:{width:1,opacity:1}}},createHighlight:function(){var i=this.options.highlight,n=i.border,t=this.options.markers,r=this.box.center(),u=t.size/2-n.width/2;return new o.Circle(new c.Circle([r.x,r.y],u),{stroke:{color:n.color||new tu(t.background).brightness(he).toHex(),width:n.width,opacity:n.opacity},fill:{color:t.background,opacity:i.opacity}})}}),ei=f.extend({init:function(n,t,i){var r=this;f.fn.init.call(r);r.linePoints=n;r.series=t;r.seriesIx=i},options:{closed:!1},points:function(n){for(var u=this,i=u.linePoints.concat(n||[]),r=[],t=0,f=i.length;t<f;t++)i[t].visible!==!1&&r.push(i[t]._childBox.toRect().center());return r},createVisual:function(){var u=this.options,n=this.series,r=n._defaults,t=n.color,i;hi(t)&&r&&(t=r.color);i=o.Path.fromPoints(this.points(),{stroke:{color:t,width:n.width,opacity:n.opacity,dashType:n.dashType},zIndex:n.zIndex});u.closed&&i.close();this.visual=i},aliasFor:function(n,t){var i=this,r=i.seriesIx;return i.parent.getNearestPoint(t.x,t.y,r)}}),pl={renderSegments:function(){var i=this,c=i.options,l=c.series,s=i.seriesPoints,u,n,a=s.length,e,t,o,f,h,r;for(this._segments=[],n=0;n<a;n++){for(u=l[n],e=i.sortPoints(s[n]),h=e.length,t=[],f=0;f<h;f++)o=e[f],o?t.push(o):i.seriesMissingValues(u)!==rs&&(t.length>1&&(r=i.createSegment(t,u,n,r),this._addSegment(r)),t=[]);t.length>1&&(r=i.createSegment(t,u,n,r),this._addSegment(r))}this.children.unshift.apply(this.children,this._segments)},_addSegment:function(n){this._segments.push(n);n.parent=this},sortPoints:function(n){return n},seriesMissingValues:function(n){var t=n.missingValues,i=!t&&this.options.isStacked;return i?de:t||rs},getNearestPoint:function(n,t,i){for(var r,c,e,l=new v(n,t),o=this.seriesPoints[i],s=ft,h,f=0;f<o.length;f++)r=o[f],r&&u(r.value)&&r.value!==null&&r.visible!==!1&&(c=r.box,e=c.center().distanceTo(l),e<s&&(h=r,s=e));return h}},uh={createAnimation:function(){var t=this.getRoot(),i,n;t&&(t.options||{}).transitions!==!1&&(i=t.box,n=o.Path.fromRect(i.toRect()),this.visual.clip(n),this.animation=new io(n,{box:i}),uv(this.options.series)&&this._setChildrenAnimation(n))},_setChildrenAnimation:function(n){for(var r=this.animationPoints(),t,i=0;i<r.length;i++)t=r[i],t&&t.visual&&u(t.visual.options.zIndex)&&t.visual.clip(n)}},kf=ni.extend({render:function(){var n=this;ni.fn.render.apply(n);n.updateStackRange();n.renderSegments()},pointType:function(){return fi},createPoint:function(n,t){var o=this,l=t.categoryIx,a=t.category,i=t.series,c=t.seriesIx,r=n.valueFields.value,v=o.seriesMissingValues(i),e,f,s;if(!u(r)||r===null)if(v===de)r=0;else return null;return f=this.pointOptions(i,c),f=o.evalPointOptions(f,r,a,l,i,c),s=n.fields.color||i.color,h.isFunction(i.color)&&(s=f.color),e=new fi(r,f),e.color=s,o.append(e),e},plotRange:function(n){var i=this.plotValue(n),f,r,t,u;if(this.options.isStacked)for(f=n.categoryIx,r=this.categoryPoints[f],t=0;t<r.length;t++){if(u=r[t],n===u)break;i+=this.plotValue(u)}return[i,i]},createSegment:function(n,t,i){var r,u=t.style;return r=u===pr?ro:u===ps?fh:ei,new r(n,t,i)},animationPoints:function(){for(var t=this.points,i=[],n=0;n<t.length;n++)i.push((t[n]||{}).marker);return i.concat(this._segments)}});r(kf.fn,pl,uh);io=o.Animation.extend({options:{duration:kt},setup:function(){this._setEnd(this.options.box.x1)},step:function(n){var t=this.options.box;this._setEnd(bo(t.x1,t.x2,n))},_setEnd:function(n){var t=this.element,i=t.segments,r=i[1].anchor(),u=i[2].anchor();t.suspend();r.setX(n);t.resume();u.setX(n)}});o.AnimationFactory.current.register(gv,io);var ro=ei.extend({points:function(n){var i=this,t;return t=i.calculateStepPoints(i.linePoints),n&&n.length&&(t=t.concat(i.calculateStepPoints(n).reverse())),t},calculateStepPoints:function(n){for(var h=this,y=h.parent,k=y.plotArea,v=k.seriesCategoryAxis(h.series),p=y.seriesMissingValues(h.series)===rs,d=n.length,w=v.options.reverse,b=v.options.vertical,f=w?2:1,s=w?1:2,e,u,i,r,t=[],o=1;o<d;o++)e=n[o-1],u=n[o],i=e.markerBox().center(),r=u.markerBox().center(),v.options.justified?(t.push(new c.Point(i.x,i.y)),b?t.push(new c.Point(i.x,r.y)):t.push(new c.Point(r.x,i.y)),t.push(new c.Point(r.x,r.y))):b?(t.push(new c.Point(i.x,e.box[l+f])),t.push(new c.Point(i.x,e.box[l+s])),p&&t.push(new c.Point(i.x,u.box[l+f])),t.push(new c.Point(r.x,u.box[l+f])),t.push(new c.Point(r.x,u.box[l+s]))):(t.push(new c.Point(e.box[a+f],i.y)),t.push(new c.Point(e.box[a+s],i.y)),p&&t.push(new c.Point(u.box[a+f],i.y)),t.push(new c.Point(u.box[a+f],r.y)),t.push(new c.Point(u.box[a+s],r.y)));return t||[]}}),fh=ei.extend({createVisual:function(){var n=this.series,r=n._defaults,t=n.color;hi(t)&&r&&(t=r.color);var u=new nc(this.options.closed),f=u.process(this.points()),i=new o.Path({stroke:{color:t,width:n.width,opacity:n.opacity,dashType:n.dashType},zIndex:n.zIndex});i.segments.push.apply(i.segments,f);this.visual=i}}),wl={points:function(){var t=this,r=t.parent,v=r.plotArea,u=r.options.invertAxes,y=r.seriesValueAxis(t.series),o=y.lineBox(),p=v.seriesCategoryAxis(t.series),s=p.lineBox(),i=u?s.x1:s.y1,w=t.stackPoints,n=t._linePoints(w),h=u?a:l,f,e;return i=tt(i,o[h+1],o[h+2]),!t.stackPoints&&n.length>1&&(f=n[0],e=st(n),u?(n.unshift(new c.Point(i,f.y)),n.push(new c.Point(i,e.y))):(n.unshift(new c.Point(f.x,i)),n.push(new c.Point(e.x,i)))),n},createVisual:function(){var t=this.series,i=t._defaults,n=t.color;hi(n)&&i&&(n=i.color);this.visual=new o.Group({zIndex:t.zIndex});this.createArea(n);this.createLine(n)},createLine:function(n){var i=this.series,t=r({color:n,opacity:i.opacity},i.line),u;t.visible!==!1&&t.width>0&&(u=o.Path.fromPoints(this._linePoints(),{stroke:{color:t.color,width:t.width,opacity:t.opacity,dashType:t.dashType,lineCap:"butt"}}),this.visual.append(u))},createArea:function(n){var t=this.series,i=o.Path.fromPoints(this.points(),{fill:{color:n,opacity:t.opacity},stroke:null});this.visual.append(i)}},uo=ei.extend({init:function(n,t,i,r){var u=this;u.stackPoints=t;ei.fn.init.call(u,n,i,r)},_linePoints:ei.fn.points});r(uo.fn,wl);var bl=kf.extend({createSegment:function(n,t,i,r){var h=this,c=h.options,e=c.isStacked,u,o,f=(t.line||{}).style,s;return(e&&i>0&&r&&(s=this.seriesMissingValues(t),u=s!="gap"?r.linePoints:this._gapStackPoints(n,i,f),f!==pr&&(u=u.slice(0).reverse())),f===ps)?new kl(n,r,e,t,i):(o=f===pr?dl:uo,new o(n,u,t,i))},reflow:function(n){var t,r,u,i;if(kf.fn.reflow.call(this,n),t=this._stackPoints,t)for(i=0;i<t.length;i++)r=t[i],u=this.categoryAxis.getSlot(r.categoryIx),r.reflow(u)},_gapStackPoints:function(n,t,i){var o=this.seriesPoints,s=n[0].categoryIx,c=s+n.length,f=[],u,e,h,r;for(this._stackPoints=this._stackPoints||[],r=s;r<c;r++){u=t;do u--,e=o[u][r];while(u>0&&!e);e?(i!==pr&&r>s&&!o[u][r-1]&&f.push(this._previousSegmentPoint(r,r-1,u)),f.push(e),i!==pr&&r+1<c&&!o[u][r+1]&&f.push(this._previousSegmentPoint(r,r+1,u))):(h=this._createGapStackPoint(r),this._stackPoints.push(h),f.push(h))}return f},_previousSegmentPoint:function(n,t,i){for(var u=this.seriesPoints,r;i>0&&!r;)i--,r=u[i][t];return r?r=u[i][n]:(r=this._createGapStackPoint(n),this._stackPoints.push(r)),r},_createGapStackPoint:function(n){var i=this.pointOptions({},0),t=new fi(0,i);return t.categoryIx=n,t.series={},t},seriesMissingValues:function(n){return n.missingValues||de}}),kl=uo.extend({init:function(n,t,i,r,u){var f=this;f.prevSegment=t;f.isStacked=i;ei.fn.init.call(f,n,r,u)},strokeSegments:function(){var n=this._strokeSegments,t,i;return n||(t=new nc(this.options.closed),i=ei.fn.points.call(this),n=this._strokeSegments=t.process(i)),n},createVisual:function(){var n=this.series,i=n._defaults,t=n.color;hi(t)&&i&&(t=i.color);this.visual=new o.Group({zIndex:n.zIndex});this.createFill({fill:{color:t,opacity:n.opacity},stroke:null});this.createStroke({stroke:r({color:t,opacity:n.opacity,lineCap:"butt"},n.line)})},createFill:function(t){var h=this.strokeSegments(),i=h.slice(0),c=this.prevSegment,u,f,e,s,r;this.isStacked&&c&&(u=c.strokeSegments(),f=st(u).anchor(),i.push(new o.Segment(f,f,st(h).anchor())),e=n.map(u,function(n){return new o.Segment(n.anchor(),n.controlOut(),n.controlIn())}).reverse(),rf(i,e),s=i[0].anchor(),i.push(new o.Segment(s,s,st(e).anchor())));r=new o.Path(t);r.segments.push.apply(r.segments,i);this.closeFill(r);this.visual.append(r)},closeFill:function(n){var i=this,r=i.parent,v=i.prevSegment,y=r.plotArea,u=r.options.invertAxes,p=r.seriesValueAxis(i.series),e=p.lineBox(),w=y.seriesCategoryAxis(i.series),o=w.lineBox(),t=u?o.x1:o.y1,s=u?a:l,f=i.strokeSegments(),h=f[0].anchor(),c=st(f).anchor();t=tt(t,e[s+1],e[s+2]);!(r.options.isStacked&&v)&&f.length>1&&(u?n.lineTo(t,c.y).lineTo(t,h.y):n.lineTo(c.x,t).lineTo(h.x,t))},createStroke:function(n){if(n.stroke.width>0){var t=new o.Path(n);t.segments.push.apply(t.segments,this.strokeSegments());this.visual.append(t)}}}),dl=ro.extend({init:function(n,t,i,r){var u=this;u.stackPoints=t;ro.fn.init.call(u,n,i,r)},_linePoints:ro.fn.points});r(dl.fn,wl);ti=f.extend({init:function(n,t){var i=this;f.fn.init.call(i,t);i.plotArea=n;i.xAxisRanges={};i.yAxisRanges={};i.points=[];i.seriesPoints=[];i.seriesOptions=[];i._evalSeries=[];i.render()},options:{series:[],tooltip:{format:"{0}, {1}"},labels:{format:"{0}, {1}"},clip:!0},render:function(){var n=this;n.traverseDataPoints(y(n.addValue,n))},addErrorBar:function(n,t,i){var f,r=this,h=n.value[t],o=t+"Value",a=t+"ErrorLow",v=t+"ErrorHigh",s=i.seriesIx,y=i.series,e=n.options.errorBars,c=i[a],l=i[v];w(h)&&(w(c)&&w(l)&&(f={low:c,high:l}),e&&u(e[o])&&(r.seriesErrorRanges=r.seriesErrorRanges||{x:[],y:[]},r.seriesErrorRanges[t][s]=r.seriesErrorRanges[t][s]||new bu(e[o],y,t),f=r.seriesErrorRanges[t][s].getErrorRange(h,e[o])),f&&r.addPointErrorBar(f,n,t))},addPointErrorBar:function(n,t,i){var u=this,f=n.low,e=n.high,o=t.series,h=i===l,c=t.options.errorBars,r={},s;t[i+"Low"]=f;t[i+"High"]=e;t.errorBars=t.errorBars||[];s=new vl(f,e,h,u,o,c);t.errorBars.push(s);t.append(s);r[i]=f;u.updateRange(r,o);r[i]=e;u.updateRange(r,o)},addValue:function(n,t){var r=this,i,f=n.x,e=n.y,u=t.seriesIx,o=this.options.series[u],s=this.seriesMissingValues(o),h=r.seriesPoints[u];gr(f)&&gr(e)||(n=this.createMissingValue(n,s));n&&(i=r.createPoint(n,t),i&&(or(i,t),r.addErrorBar(i,a,t),r.addErrorBar(i,l,t)),r.updateRange(n,t.series));r.points.push(i);h.push(i)},seriesMissingValues:function(n){return n.missingValues},createMissingValue:nf,updateRange:function(n,t){var o=this,r=n.x,u=n.y,h=t.xAxis,c=t.yAxis,f=o.xAxisRanges[h],e=o.yAxisRanges[c];gr(r)&&(f=o.xAxisRanges[h]=f||{min:ft,max:at},typeof r===au&&(r=s(r)),f.min=i.min(f.min,r),f.max=i.max(f.max,r));gr(u)&&(e=o.yAxisRanges[c]=e||{min:ft,max:at},typeof u===au&&(u=s(u)),e.min=i.min(e.min,u),e.max=i.max(e.max,u))},evalPointOptions:function(n,t,i){var e=i.series,o=i.seriesIx,s={defaults:e._defaults,excluded:["data","tooltip","tempate","visual","toggle"]},f=this._evalSeries[o];return u(f)||(this._evalSeries[o]=f=dr(n,{},s,!0)),f&&(n=r({},n),dr(n,{value:t,series:e,dataItem:i.dataItem},s)),n},pointType:function(){return fi},pointOptions:function(n,t){var i=this.seriesOptions[t],u;return i||(u=this.pointType().fn.defaults,this.seriesOptions[t]=i=r({},u,{markers:{opacity:n.opacity},tooltip:{format:this.options.tooltip.format},labels:{format:this.options.labels.format}},n)),i},createPoint:function(n,t){var f=this,u=t.series,i,r=this.pointOptions(u,t.seriesIx),e=t.color||u.color;return r=f.evalPointOptions(r,n,t),h.isFunction(u.color)&&(e=r.color),i=new fi(n,r),i.color=e,f.append(i),i},seriesAxes:function(n){var t=this.plotArea,i=n.xAxis,u=i?t.namedXAxes[i]:t.axisX,r=n.yAxis,f=r?t.namedYAxes[r]:t.axisY;if(!u)throw new Error("Unable to locate X axis with name "+i);if(!f)throw new Error("Unable to locate Y axis with name "+r);return{x:u,y:f}},reflow:function(n){var t=this,f=t.points,e=0,i,r,u=!t.options.clip;t.traverseDataPoints(function(n,o){i=f[e++];r=t.seriesAxes(o.series);var s=r.x.getSlot(n.x,n.x,u),h=r.y.getSlot(n.y,n.y,u),c;i&&(s&&h?(c=t.pointSlot(s,h),i.reflow(c)):i.visible=!1)});t.box=n},pointSlot:function(n,t){return new b(n.x1,t.y1,n.x2,t.y2)},traverseDataPoints:function(n){for(var f=this,a=f.options,o=a.series,s=f.seriesPoints,i,u,h,e,c,l,t=0;t<o.length;t++)for(u=o[t],h=s[t],h||(s[t]=[]),i=0;i<u.data.length;i++)e=this._bindPoint(u,t,i),c=e.valueFields,l=e.fields,n(c,r({pointIx:i,series:u,seriesIx:t,dataItem:u.data[i],owner:f},l))},_bindPoint:ni.fn._bindPoint,formatPointValue:function(n,t){var i=n.value;return vt(t,i.x,i.y)},animationPoints:function(){for(var t=this.points,i=[],n=0;n<t.length;n++)i.push((t[n]||{}).marker);return i}});r(ti.fn,uh);fo=ti.extend({render:function(){var n=this;ti.fn.render.call(n);n.renderSegments()},createSegment:function(n,t,i){var r,u=t.style;return r=u===ps?fh:ei,new r(n,t,i)},animationPoints:function(){var n=ti.fn.animationPoints.call(this);return n.concat(this._segments)},createMissingValue:function(n,t){if(t===de){var i={x:n.x,y:n.y};return gr(i.x)||(i.x=0),gr(i.y)||(i.y=0),i}}});r(fo.fn,pl);eh=ti.extend({init:function(n,t){this._maxSize=at;ti.fn.init.call(this,n,t)},options:{tooltip:{format:"{3}"},labels:{format:"{3}"}},addValue:function(n,t){n.size!==null&&(n.size>0||n.size<0&&t.series.negativeValues.visible)?(this._maxSize=i.max(this._maxSize,i.abs(n.size)),ti.fn.addValue.call(this,n,t)):(this.points.push(null),this.seriesPoints[t.seriesIx].push(null))},reflow:function(n){var t=this;t.updateBubblesSize(n);ti.fn.reflow.call(t,n)},pointType:function(){return yl},createPoint:function(n,t){var s=this,i=t.series,c=i.data.length,e=t.pointIx*(kt/c),l={delay:e,duration:kt-e,type:fu},o,u,f=t.color||i.color;return n.size<0&&i.negativeValues.visible&&(f=nt(i.negativeValues.color,f)),u=r({labels:{animation:{delay:e,duration:kt-e}}},this.pointOptions(i,t.seriesIx),{markers:{type:su,border:i.border,opacity:i.opacity,animation:l}}),u=s.evalPointOptions(u,n,t),h.isFunction(i.color)&&(f=u.color),u.markers.background=f,o=new yl(n,u),o.color=f,s.append(o),o},updateBubblesSize:function(n){for(var e=this,w=e.options,h=w.series,c=i.min(n.width(),n.height()),f,u,t=0;t<h.length;t++){var l=h[t],a=e.seriesPoints[t],b=l.minSize||i.max(c*.02,10),k=l.maxSize||c*.2,v=b/2,o=k/2,y=i.PI*v*v,d=i.PI*o*o,g=d-y,tt=g/e._maxSize;for(f=0;f<a.length;f++)if(u=a[f],u){var it=i.abs(u.value.size)*tt,p=i.sqrt((y+it)/i.PI),rt=nt(u.options.zIndex,0),s=rt+(1-p/o);r(u.options,{zIndex:s,markers:{size:p*2,zIndex:s},labels:{zIndex:s+1}})}}},formatPointValue:function(n,t){var i=n.value;return vt(t,i.x,i.y,i.size,n.category)},createAnimation:nf,createVisual:nf});di=f.extend({init:function(n,t){f.fn.init.call(this,t);this.value=n},options:{border:{_brightness:.8},line:{width:2},overlay:{gradient:ts},tooltip:{format:"<table style='text-align: left;'><th colspan='2'>{4:d}<\/th><tr><td>Open:<\/td><td>{0:C}<\/td><\/tr><tr><td>High:<\/td><td>{1:C}<\/td><\/tr><tr><td>Low:<\/td><td>{2:C}<\/td><\/tr><tr><td>Close:<\/td><td>{3:C}<\/td><\/tr><\/table>"},highlight:{opacity:1,border:{width:1,opacity:1},line:{width:1,opacity:1}},notes:{visible:!0,label:{}}},reflow:function(n){var t=this,s=t.options,h=t.owner,f=t.value,o=h.seriesValueAxis(s),e=[],u,i,r;i=o.getSlot(f.open,f.close);r=o.getSlot(f.low,f.high);i.x1=r.x1=n.x1;i.x2=r.x2=n.x2;t.realBody=i;u=r.center().x;e.push([[u,r.y1],[u,i.y1]]);e.push([[u,i.y2],[u,r.y2]]);t.lines=e;t.box=r.clone().wrap(i);t._rendered||(t._rendered=!0,t.createNote());t.reflowNote()},reflowNote:function(){var n=this;n.note&&n.note.reflow(n.box)},createVisual:function(){f.fn.createVisual.call(this);this._mainVisual=this.mainVisual(this.options);this.visual.append(this._mainVisual);this.createOverlay()},mainVisual:function(n){var t=new o.Group;return this.createBody(t,n),this.createLines(t,n),t},createBody:function(n,t){var i=o.Path.fromRect(this.realBody.toRect(),{fill:{color:this.color,opacity:t.opacity},stroke:null});t.border.width>0&&i.options.set("stroke",{color:this.getBorderColor(),width:t.border.width,dashType:t.border.dashType,opacity:nt(t.border.opacity,t.opacity)});ru(i);n.append(i);kh(t)&&n.append(this.createGradientOverlay(i,{baseColor:this.color},r({},t.overlay)))},createLines:function(n,t){this.drawLines(n,t,this.lines,t.line)},drawLines:function(n,t,i,r){var e,u,f;if(i)for(e={stroke:{color:r.color||this.color,opacity:nt(r.opacity,t.opacity),width:r.width,dashType:r.dashType,lineCap:"butt"}},u=0;u<i.length;u++)f=o.Path.fromPoints(i[u],e),ru(f),n.append(f)},getBorderColor:function(){var t=this,r=t.options,i=r.border,n=i.color;return u(n)||(n=new tu(t.color).brightness(i._brightness).toHex()),n},createOverlay:function(){var n=o.Path.fromRect(this.box.toRect(),{fill:{color:wi,opacity:0},stroke:null});this.visual.append(n)},createHighlight:function(){var n=this.options.highlight,i=this.color,t;return this.color=n.color||this.color,t=this.mainVisual(r({},this.options,{line:{color:this.getBorderColor()}},n)),this.color=i,t},highlightVisual:function(){return this._mainVisual},highlightVisualArgs:function(){return{options:this.options,rect:this.box.toRect(),visual:this._mainVisual}},tooltipAnchor:function(){var t=this,n=t.box,r=t.owner.pane.clipBox()||n;return new v(n.x2+pt,i.max(n.y1,r.y1)+pt)},formatValue:function(n){var t=this;return t.owner.formatPointValue(t,n)}});r(di.fn,ki);r(di.fn,no);ku=ni.extend({options:{},reflowCategories:function(n){for(var r=this,i=r.children,u=i.length,t=0;t<u;t++)i[t].reflow(n[t])},addValue:function(n,t){var r=this,u=t.categoryIx,c=t.category,s=t.series,l=t.seriesIx,e=r.options,h=n.valueFields,a=r.children,v=r.splitValue(h),y=bh(v),o=r.categoryPoints[u],p=s.data[u],i,f;o||(r.categoryPoints[u]=o=[]);y&&(i=r.createPoint(n,t));f=a[u];f||(f=new wf({vertical:e.invertAxes,gap:e.gap,spacing:e.spacing}),r.append(f));i&&(r.updateRange(h,t),f.append(i),i.categoryIx=u,i.category=c,i.series=s,i.seriesIx=l,i.owner=r,i.dataItem=p,i.noteText=n.fields.noteText);r.points.push(i);o.push(i)},pointType:function(){return di},createPoint:function(n,t){var s=this,c=t.categoryIx,l=t.category,i=t.series,a=t.seriesIx,u=n.valueFields,f=r({},i),v=s.pointType(),e=n.fields.color||i.color,o;return f=s.evalPointOptions(f,u,l,c,i,a),i.type==ou&&u.open>u.close&&(e=n.fields.downColor||i.downColor||i.color),h.isFunction(i.color)&&(e=f.color),o=new v(u,f),o.color=e,o},splitValue:function(n){return[n.low,n.open,n.close,n.high]},updateRange:function(n,t){var u=this,f=t.series.axis,r=u.valueAxisRanges[f],e=u.splitValue(n);r=u.valueAxisRanges[f]=r||{min:ft,max:at};r=u.valueAxisRanges[f]={min:i.min.apply(i,e.concat([r.min])),max:i.max.apply(i,e.concat([r.max]))}},formatPointValue:function(n,t){var i=n.value;return vt(t,i.open,i.high,i.low,i.close,n.category)},animationPoints:function(){return this.points}});r(ku.fn,uh);var gl=di.extend({reflow:function(n){var u=this,l=u.options,a=u.owner,f=u.value,o=a.seriesValueAxis(l),s=[],h=[],c=[],e,t,i,r;r=o.getSlot(f.low,f.high);t=o.getSlot(f.open,f.open);i=o.getSlot(f.close,f.close);t.x1=i.x1=r.x1=n.x1;t.x2=i.x2=r.x2=n.x2;e=r.center().x;s.push([t.x1,t.y1]);s.push([e,t.y1]);h.push([e,i.y1]);h.push([i.x2,i.y1]);c.push([e,r.y1]);c.push([e,r.y2]);u.lines=[s,h,c];u.box=r.clone().wrap(t.clone().wrap(i));u.reflowNote()},createBody:n.noop}),na=ku.extend({pointType:function(){return gl}}),by=ku.extend({addValue:function(n,t){var r=this,u=t.categoryIx,c=t.category,s=t.series,l=t.seriesIx,e=r.options,a=r.children,h=n.valueFields,v=r.splitValue(h),y=bh(v),o=r.categoryPoints[u],p=s.data[u],i,f;o||(r.categoryPoints[u]=o=[]);y&&(i=r.createPoint(n,t));f=a[u];f||(f=new wf({vertical:e.invertAxes,gap:e.gap,spacing:e.spacing}),r.append(f));i&&(r.updateRange(h,t),f.append(i),i.categoryIx=u,i.category=c,i.series=s,i.seriesIx=l,i.owner=r,i.dataItem=p);r.points.push(i);o.push(i)},pointType:function(){return ta},splitValue:function(n){return[n.lower,n.q1,n.median,n.q3,n.upper]},updateRange:function(n,t){var r=this,o=t.series.axis,f=r.valueAxisRanges[o],e=r.splitValue(n).concat(r.filterOutliers(n.outliers));u(n.mean)&&(e=e.concat(n.mean));f=r.valueAxisRanges[o]=f||{min:ft,max:at};f=r.valueAxisRanges[o]={min:i.min.apply(i,e.concat([f.min])),max:i.max.apply(i,e.concat([f.max]))}},formatPointValue:function(n,t){var i=n.value;return vt(t,i.lower,i.q1,i.median,i.q3,i.upper,i.mean,n.category)},filterOutliers:function(n){for(var f=(n||[]).length,r=[],i,t=0;t<f;t++)i=n[t],u(i)&&yo(r,i);return r}}),ta=di.extend({init:function(n,t){var i=this;f.fn.init.call(i,t);i.value=n;i.createNote()},options:{border:{_brightness:.8},line:{width:2},mean:{width:2,dashType:"dash"},overlay:{gradient:ts},tooltip:{format:"<table style='text-align: left;'><th colspan='2'>{6:d}<\/th><tr><td>Lower:<\/td><td>{0:C}<\/td><\/tr><tr><td>Q1:<\/td><td>{1:C}<\/td><\/tr><tr><td>Median:<\/td><td>{2:C}<\/td><\/tr><tr><td>Mean:<\/td><td>{5:C}<\/td><\/tr><tr><td>Q3:<\/td><td>{3:C}<\/td><\/tr><tr><td>Upper:<\/td><td>{4:C}<\/td><\/tr><\/table>"},highlight:{opacity:1,border:{width:1,opacity:1},line:{width:1,opacity:1}},notes:{visible:!0,label:{}},outliers:{visible:!0,size:us,type:"cross",background:wi,border:{width:2,opacity:1},opacity:0},extremes:{visible:!0,size:us,type:su,background:wi,border:{width:2,opacity:1},opacity:0}},reflow:function(n){var i=this,l=i.options,a=i.owner,f=i.value,e=a.seriesValueAxis(l),r,t,u,o,s,h,c;if(u=e.getSlot(f.q1,f.q3),i.boxSlot=u,t=e.getSlot(f.lower,f.upper),o=e.getSlot(f.median),u.x1=t.x1=n.x1,u.x2=t.x2=n.x2,i.realBody=u,f.mean){s=e.getSlot(f.mean);var v=[n.x1,s.y1],y=[n.x2,s.y1],p=[v,y];i.meanPoints=[p]}r=t.center().x;var w=[r-5,t.y1],b=[r+5,t.y1],k=[r,t.y1],d=[r,u.y1],g=[r,u.y1],nt=[r-5,t.y2],tt=[r+5,t.y2],it=[r,t.y2];i.whiskerPoints=[[w,b,k,d],[g,nt,tt,it]];h=[n.x1,o.y1];c=[n.x2,o.y1];i.medianPoints=[[h,c]];i.box=t.clone().wrap(u);i.reflowNote()},renderOutliers:function(n){for(var h=this,t=n.markers||{},f=h.value,a=f.outliers||[],v=i.abs(f.q3-f.q1)*3,e,c,o,l=[],s=0;s<a.length;s++)o=a[s],t=o<f.q3+v&&o>f.q1-v?n.outliers:n.extremes,e=r({},t.border),u(e.color)||(e.color=u(h.color)?h.color:new tu(t.background).brightness(he).toHex()),c=new iu({type:t.type,width:t.size,height:t.size,rotation:t.rotation,background:t.background,border:e,opacity:t.opacity}),c.value=o,l.push(c);return this.reflowOutliers(l),l},reflowOutliers:function(n){for(var r,i,u=this.owner.seriesValueAxis(this.options),f=this.box.center().x,t=0;t<n.length;t++)r=n[t].value,i=u.getSlot(r).move(f),this.box=this.box.wrap(i),n[t].reflow(i)},mainVisual:function(n){for(var i,r=di.fn.mainVisual.call(this,n),u=this.renderOutliers(n),t=0;t<u.length;t++)i=u[t].getElement(),i&&r.append(i);return r},createLines:function(n,t){this.drawLines(n,t,this.whiskerPoints,t.line);this.drawLines(n,t,this.medianPoints,t.median);this.drawLines(n,t,this.meanPoints,t.mean)},getBorderColor:function(){return this.color?this.color:di.getBorderColor.call(this)}});r(ta.fn,ki);du=f.extend({init:function(n,t,i){var r=this;r.value=n;r.sector=t;f.fn.init.call(r,i)},options:{color:wi,overlay:{gradient:"roundedBevel"},border:{width:.5},labels:{visible:!1,distance:35,font:ny,margin:ci(.5),align:su,zIndex:1,position:vr},animation:{type:fr},highlight:{visible:!0,border:{width:1}},visible:!0},render:function(){var n=this,f=n.options,t=f.labels,i=n.value,u;n._rendered||n.visible===!1||(n._rendered=!0,t.template?(u=wt(t.template),i=u({dataItem:n.dataItem,category:n.category,value:n.value,series:n.series,percentage:n.percentage})):t.format&&(i=vt(t.format,i)),t.visible&&i&&(n.label=new oe(i,r({},t,{align:it,vAlign:"",animation:{type:ar,delay:n.animationDelay}})),n.append(n.label)))},reflow:function(n){var t=this;t.render();t.box=n;t.reflowLabel()},reflowLabel:function(){var f=this,t=f.sector.clone(),c=f.options,r=f.label,e=c.labels,l=e.distance,o=t.middle(),n,s,h,u;r&&(u=r.box.height(),h=r.box.width(),e.position==it?(t.r=i.abs((t.r-u)/2)+u,n=t.point(o),r.reflow(b(n.x,n.y-u/2,n.x,n.y))):e.position==is?(t.r=t.r-u/2,n=t.point(o),r.reflow(b(n.x,n.y-u/2,n.x,n.y))):(n=t.clone().expand(l).point(o),n.x>=t.c.x?(s=n.x+h,r.orientation=et):(s=n.x-h,r.orientation=ct),r.reflow(b(s,n.y-u,n.x,n.y))))},createVisual:function(){var n=this,t=n.sector,i=n.options,r,u;f.fn.createVisual.call(this);n.value&&(i.visual?(r=(t.startAngle+180)%360,u=i.visual({category:n.category,dataItem:n.dataItem,value:n.value,series:n.series,percentage:n.percentage,center:new c.Point(t.c.x,t.c.y),radius:t.r,innerRadius:t.ir,startAngle:r,endAngle:r+t.angle,options:i,createVisual:function(){var t=new o.Group;return n.createSegmentVisual(t),t}}),u&&n.visual.append(u)):n.createSegmentVisual(n.visual))},createSegmentVisual:function(n){var f=this,i=f.sector,t=f.options,u=t.border||{},h=u.width>0?{stroke:{color:u.color,width:u.width,opacity:u.opacity,dashType:u.dashType}}:{},o=t.color,s={color:o,opacity:t.opacity},e;e=f.createSegment(i,r({fill:s,stroke:{opacity:t.opacity},zIndex:t.zIndex},h));n.append(e);kh(t)&&n.append(this.createGradientOverlay(e,{baseColor:o,fallbackFill:s},r({center:[i.c.x,i.c.y],innerRadius:i.ir,radius:i.r,userSpace:!0},t.overlay)))},createSegment:function(n,t){return t.singleSegment?new o.Circle(new c.Circle(new c.Point(n.c.x,n.c.y),n.r),t):ic.current.createRing(n,t)},createAnimation:function(){var t=this.options,n=this.sector.c;r(t,{animation:{center:[n.x,n.y],delay:this.animationDelay}});f.fn.createAnimation.call(this)},createHighlight:function(n){var t=this,i=t.options.highlight||{},u=i.border||{};return t.createSegment(t.sector,r({},n,{fill:{color:i.color,opacity:i.opacity},stroke:{opacity:u.opacity,width:u.width,color:u.color}}))},highlightVisual:function(){return this.visual.children[0]},highlightVisualArgs:function(){var n=this.sector;return{options:this.options,radius:n.r,innerRadius:n.ir,center:new c.Point(n.c.x,n.c.y),startAngle:n.startAngle,endAngle:n.angle+n.startAngle,visual:this.visual}},tooltipAnchor:function(n,t){var r=this,i=r.sector.adjacentBox(pt,n,t);return new v(i.x1,i.y1)},formatValue:function(n){var t=this;return t.owner.formatPointValue(t,n)}});r(du.fn,ki);oh={createLegendItem:function(n,t,i){var h=this,c=h.options.legend||{},l=c.labels||{},a=c.inactiveItems||{},u=a.labels||{},r,f,e,o,s;i&&i.visibleInLegend!==!1&&(s=i.visible!==!1,r=i.category||"",f=s?l.template:u.template||l.template,f&&(r=wt(f)({text:r,series:i.series,dataItem:i.dataItem,percentage:i.percentage,value:n})),s?(o={},e=t.color):(o={color:u.color,font:u.font},e=(a.markers||{}).color),r&&h.legendItems.push({pointIndex:i.index,text:r,series:i.series,markerColor:e,labels:o}))}};gu=f.extend({init:function(n,t){var i=this;f.fn.init.call(i,t);i.plotArea=n;i.points=[];i.legendItems=[];i.render()},options:{startAngle:90,connectors:{width:1,color:"#939393",padding:4},inactiveItems:{markers:{},labels:{}}},render:function(){var n=this;n.traverseDataPoints(y(n.addValue,n))},traverseDataPoints:function(n){for(var o=this,b=o.options,k=o.plotArea.options.seriesColors||[],rt=k.length,g=b.series,s=g.length,t,h,e,a,c,nt,v,y,tt,l,p,f,w=0,r=0;r<s;r++){for(t=g[r],c=t.data,l=rv(t),nt=360/l,p=u(t.startAngle)?t.startAngle:b.startAngle,r!=s-1&&t.labels.position==vr&&(t.labels.position=it),f=0;f<c.length;f++)h=d.current.bindPoint(t,f),v=h.valueFields.value,y=i.abs(v),e=h.fields,a=y*nt,tt=c.length!=1&&!!e.explode,hi(t.color)||(t.color=e.color||k[f%rt]),n(v,new av(null,0,0,p,a),{owner:o,category:e.category||"",index:w,series:t,seriesIx:r,dataItem:c[f],percentage:l!==0?y/l:0,explode:tt,visibleInLegend:e.visibleInLegend,visible:e.visible,zIndex:s-r,animationDelay:o.animationDelay(f,r,s)}),h.fields.visible!==!1&&(p+=a),w++;w=0}},evalSegmentOptions:function(n,t,i){var r=i.series;dr(n,{value:t,series:r,dataItem:i.dataItem,category:i.category,percentage:i.percentage},{defaults:r._defaults,excluded:["data","template","visual","toggle"]})},addValue:function(n,t,i){var u=this,f,e=r({},i.series,{index:i.index});(u.evalSegmentOptions(e,n,i),u.createLegendItem(n,e,i),i.visible!==!1)&&(f=new du(n,t,e),or(f,i),u.append(f),u.points.push(f))},reflow:function(n){var r=this,d=r.options,u=n.clone(),g=5,h=i.min(u.width(),u.height()),w=h/2,st=h-h*.85,f=nt(d.padding,st),e=b(u.x1,u.y1,u.x1+h,u.y1+h),tt=e.center(),it=r.seriesConfigs||[],rt=u.center(),ut=r.points,ht=ut.length,ft=d.series.length,c=[],l=[],k,a,o,s,t,y,p,ot;for(f=f>w-g?w-g:f,e.translate(rt.x-tt.x,rt.y-tt.y),y=w-f,ot=v(y+e.x1+f,y+e.y1+f),p=0;p<ht;p++)s=ut[p],t=s.sector,t.r=y,t.c=ot,a=s.seriesIx,it.length&&(k=it[a],t.ir=k.ir,t.r=k.r),a==ft-1&&s.explode&&(t.c=t.clone().radius(t.r*.15).point(t.middle())),s.reflow(e),o=s.label,o&&o.options.position===vr&&a==ft-1&&(o.orientation===et?l.push(o):c.push(o));c.length>0&&(c.sort(r.labelComparator(!0)),r.leftLabelsReflow(c));l.length>0&&(l.sort(r.labelComparator(!1)),r.rightLabelsReflow(l));r.box=e},leftLabelsReflow:function(n){var t=this,i=t.distanceBetweenLabels(n);t.distributeLabels(i,n)},rightLabelsReflow:function(n){var t=this,i=t.distanceBetweenLabels(n);t.distributeLabels(i,n)},distanceBetweenLabels:function(n){var l=this,o=l.points,s=o[o.length-1],f=s.sector,i=n[0].box,e=n.length-1,h=f.r+s.options.labels.distance,u=[],c,t,r;for(t=k(i.y1-(f.c.y-h-i.height()-i.height()/2)),u.push(t),r=0;r<e;r++)i=n[r].box,c=n[r+1].box,t=k(c.y1-i.y2),u.push(t);return t=k(f.c.y+h-n[e].box.y2-n[e].box.height()/2),u.push(t),u},distributeLabels:function(n,t){for(var u=this,o=n.length,r,f,e,i=0;i<o;i++)for(f=e=i,r=-n[i];r>0&&(f>=0||e<o);)r=u._takeDistance(n,i,--f,r),r=u._takeDistance(n,i,++e,r);u.reflowLabels(n,t)},_takeDistance:function(n,t,r,u){if(n[r]>0){var f=i.min(n[r],u);u-=f;n[r]-=f;n[t]+=f}return u},reflowLabels:function(n,t){var c=this,l=c.points,a=l[l.length-1],r=a.sector,v=t.length,h=a.options.labels,s=h.distance,i=r.c.y-(r.r+s)-t[0].box.height(),f,u,e,o;for(n[0]+=2,o=0;o<v;o++)f=t[o],i+=n[o],e=f.box,u=c.hAlignLabel(e.x2,r.clone().expand(s),i,i+e.height(),f.orientation==et),f.orientation==et?(h.align!==su&&(u=r.r+r.c.x+s),f.reflow(b(u+e.width(),i,u,i))):(h.align!==su&&(u=r.c.x-r.r-s),f.reflow(b(u-e.width(),i,u,i))),i+=e.height()},createVisual:function(){var w=this,nt=w.options,y=nt.connectors,d=w.points,t,tt=d.length,h=4,r,k,c,it,p,b;for(f.fn.createVisual.call(this),this._connectorLines=[],b=0;b<tt;b++)if(c=d[b],r=c.sector,k=r.middle(),p=c.label,it={seriesId:c.seriesIx},p&&(t=new o.Path({stroke:{color:y.color,width:y.width},animation:{type:ar,delay:c.animationDelay}}),p.options.position===vr&&c.value!==0)){var a=p.box,g=r.c,e=r.point(k),s=v(a.x1,a.center().y),l,u,n;e=r.clone().expand(y.padding).point(k);t.moveTo(e.x,e.y);p.orientation==et?(u=v(a.x1-y.padding,a.center().y),n=pa(g,e,s,u),s=v(u.x-h,u.y),n=n||s,n.x=i.min(n.x,s.x),w.pointInCircle(n,r.c,r.r+h)||n.x<r.c.x?(l=r.c.x+r.r+h,c.options.labels.align!==ir?l<s.x?t.lineTo(l,e.y):t.lineTo(e.x+h*2,e.y):t.lineTo(l,e.y),t.lineTo(s.x,u.y)):(n.y=u.y,t.lineTo(n.x,n.y))):(u=v(a.x2+y.padding,a.center().y),n=pa(g,e,s,u),s=v(u.x+h,u.y),n=n||s,n.x=i.max(n.x,s.x),w.pointInCircle(n,r.c,r.r+h)||n.x>r.c.x?(l=r.c.x-r.r-h,c.options.labels.align!==ir?l>s.x?t.lineTo(l,e.y):t.lineTo(e.x-h*2,e.y):t.lineTo(l,e.y),t.lineTo(s.x,u.y)):(n.y=u.y,t.lineTo(n.x,n.y)));t.lineTo(u.x,u.y);this._connectorLines.push(t);this.visual.append(t)}},labelComparator:function(n){return n=n?-1:1,function(t,i){return t=(t.parent.sector.middle()+270)%360,i=(i.parent.sector.middle()+270)%360,(t-i)*n}},hAlignLabel:function(n,t,r,u,f){var h=t.c.x,s=t.c.y,e=t.r,o=i.min(i.abs(s-r),i.abs(s-u));return o>e?n:h+i.sqrt(e*e-o*o)*(f?1:-1)},pointInCircle:function(n,t,i){return yh(t.x-n.x)+yh(t.y-n.y)<yh(i)},formatPointValue:function(n,t){return vt(t,n.value)},animationDelay:function(n){return n*ly}});r(gu.fn,oh);eo=du.extend({options:{overlay:{gradient:"roundedGlass"},labels:{position:it},animation:{type:fr}},reflowLabel:function(){var i=this,n=i.sector.clone(),f=i.options,r=i.label,e=f.labels,t,o=n.middle(),u;r&&(u=r.box.height(),e.position==it?(n.r-=(n.r-n.ir)/2,t=n.point(o),r.reflow(new b(t.x,t.y-u/2,t.x,t.y))):du.fn.reflowLabel.call(i))},createSegment:function(n,t){return ic.current.createRing(n,t)}});r(eo.fn,ki);var ia=gu.extend({options:{startAngle:90,connectors:{width:1,color:"#939393",padding:4}},addValue:function(n,t,i){var u=this,f,e=r({},i.series,{index:i.index});(u.evalSegmentOptions(e,n,i),u.createLegendItem(n,e,i),n&&i.visible!==!1)&&(f=new eo(n,t,e),or(f,i),u.append(f),u.points.push(f))},reflow:function(n){var h=this,p=h.options,w=n.clone(),b=5,a=i.min(w.width(),w.height()),c=a/2,it=a-a*.85,e=nt(p.padding,it),v=p.series,t,l=v.length,k=0,o,f,d,g=0,r,y,s=0,tt=0;for(h.seriesConfigs=[],e=e>c-b?c-b:e,f=c-e,r=0;r<l;r++)t=v[r],r===0&&u(t.holeSize)&&(o=t.holeSize,f-=t.holeSize),u(t.size)?f-=t.size:k++,u(t.margin)&&r!=l-1&&(f-=t.margin);for(u(o)||(tt=(c-e)/(l+.75),o=tt*.75,f-=o),s=o,r=0;r<l;r++)t=v[r],d=nt(t.size,f/k),s+=g,y=s+d,h.seriesConfigs.push({ir:s,r:y}),g=t.margin||0,s=y;gu.fn.reflow.call(h,n)},animationDelay:function(n,t,i){return n*ry+kt*(t+1)/(i+1)}}),ra=br.extend({render:function(){br.fn.render.call(this);this.createSegments()},traverseDataPoints:function(n){for(var i,o=this.options.series,a=this.categoryAxis.options.categories||[],v=lo(o),y=!this.options.invertAxes,f=0;f<o.length;f++){var c=o[f],t=0,r=0;for(i=0;i<v;i++){var u=d.current.bindPoint(c,i),s=u.valueFields.value,l=u.fields.summary,h=t,e;l?l.toLowerCase()==="total"?(u.valueFields.value=t,h=0,e=t):(u.valueFields.value=r,e=h-r,r=0):w(s)&&(r+=s,t+=s,e=t);n(u,{category:a[i],categoryIx:i,series:c,seriesIx:f,total:t,runningTotal:r,from:h,to:e,isVertical:y})}}},updateRange:function(n,t){br.fn.updateRange.call(this,{value:t.to},t)},aboveAxis:function(n){return n.value>=0},plotRange:function(n){return[n.from,n.to]},createSegments:function(){for(var o,t,u,i,r,f,e=this.options.series,s=this.seriesPoints,h=this.segments=[],n=0;n<e.length;n++)if(o=e[n],t=s[n],t)for(i=0;i<t.length;i++)r=t[i],r&&u&&(f=new ua(u,r,o),h.push(f),this.append(f)),u=r}}),ua=f.extend({init:function(n,t,i){var r=this;f.fn.init.call(r);r.from=n;r.to=t;r.series=i},options:{animation:{type:ar,delay:kt}},linePoints:function(){var i=[],t=this.from,n=t.box,f=this.to.box,r,u;return t.isVertical?(r=t.aboveAxis?n.y1:n.y2,i.push([n.x1,r],[f.x2,r])):(u=t.aboveAxis?n.x2:n.x1,i.push([u,n.y1],[u,f.y2])),i},createVisual:function(){f.fn.createVisual.call(this);var n=this.series.line||{},t=o.Path.fromPoints(this.linePoints(),{stroke:{color:n.color,width:n.width,opacity:n.opacity,dashType:n.dashType}});ru(t);this.visual.append(t)}});var hh=sr.extend({init:function(n){var t=this;sr.fn.init.call(t,n);n=t.options;t.id=h.guid();t.createTitle();t.content=new f;t.chartContainer=new fa({},t);t.append(t.content);t.axes=[];t.charts=[]},options:{zIndex:-1,shrinkToFit:!0,title:{align:ct},visible:!0},createTitle:function(){var t=this,n=t.options.title;typeof n===yi&&(n=r({},n,{align:n.position,position:dt}));t.title=rc.buildTitle(n,t,hh.fn.options.title)},appendAxis:function(n){var t=this;t.content.append(n);t.axes.push(n);n.pane=t},appendChart:function(n){var t=this;t.chartContainer.parent!==t.content&&t.content.append(t.chartContainer);t.charts.push(n);t.chartContainer.append(n);n.pane=t},empty:function(){var n=this,i=n.parent,t;if(i){for(t=0;t<n.axes.length;t++)i.removeAxis(n.axes[t]);for(t=0;t<n.charts.length;t++)i.removeChart(n.charts[t])}n.axes=[];n.charts=[];n.content.destroy();n.content.children=[];n.chartContainer.children=[]},reflow:function(n){var t=this,i;st(t.children)===t.content&&(i=t.children.pop());sr.fn.reflow.call(t,n);i&&t.children.push(i);t.title&&(t.contentBox.y1+=t.title.box.height())},visualStyle:function(){var n=sr.fn.visualStyle.call(this);return n.zIndex=-10,n},renderComplete:function(){this.options.visible&&this.createGridLines()},stackRoot:sh,clipRoot:sh,createGridLines:function(){for(var o=this,i=o.axes,s=i.concat(o.parent.axes),h=[],c=[],r,t,u,f,e,n=0;n<i.length;n++)for(u=i[n],f=u.options.vertical,r=f?h:c,t=0;t<s.length;t++)r.length===0&&(e=s[t],f!==e.options.vertical&&rf(r,u.createGridLines(e)))},refresh:function(){this.visual.clear();this.content.parent=null;this.content.createGradient=n.proxy(this.createGradient,this);this.content.renderVisual();this.content.parent=this;this.title&&this.visual.append(this.title.visual);this.visual.append(this.content.visual);this.renderComplete()},clipBox:function(){return this.chartContainer.clipBox}}),fa=f.extend({init:function(n,t){var i=this;f.fn.init.call(i,n);i.pane=t},shouldClip:function(){for(var i=this,t=i.children,r=t.length,n=0;n<r;n++)if(t[n].options.clip===!0)return!0;return!1},_clipBox:function(){for(var o=this,f=o.pane,e=f.axes,s=e.length,i=f.box.clone(),n,r,u,t=0;t<s;t++)u=e[t],n=u.options.vertical?l:a,r=u.lineBox(),i[n+1]=r[n+1],i[n+2]=r[n+2];return i},createVisual:function(){if(this.visual=new o.Group({zIndex:0}),this.shouldClip()){var n=this.clipBox=this._clipBox(),t=n.toRect(),i=o.Path.fromRect(t);this.visual.clip(i);this.unclipLabels()}},stackRoot:sh,unclipLabels:function(){for(var u=this,f=u.children,e=u.clipBox,r,n,i,o,t=0;t<f.length;t++)for(r=f[t].points||{},o=r.length,i=0;i<o;i++)n=r[i],n&&n.label&&n.label.options.visible&&n.box.overlaps(e)&&(n.label.alignToClipBox&&n.label.alignToClipBox(e),n.label.options.noclip=!0)},destroy:function(){f.fn.destroy.call(this);delete this.parent}}),ii=f.extend({init:function(n,t){var i=this;f.fn.init.call(i,t);i.series=n;i.initSeries();i.charts=[];i.options.legend.items=[];i.axes=[];i.crosshairs=[];i.createPanes();i.render();i.createCrosshairs()},options:{series:[],plotArea:{margin:{}},background:"",border:{color:uu,width:0},legend:{inactiveItems:{labels:{color:"#919191"},markers:{color:"#919191"}}}},initSeries:function(){for(var t=this.series,i,n=0;n<t.length;n++)i=t[n],i.index=n},createPanes:function(){for(var r=this,u=[],f=r.options.panes||[],e=i.max(f.length,1),t,n=0;n<e;n++)t=new hh(f[n]),t.paneIndex=n,u.push(t),r.append(t);r.panes=u},createCrosshairs:function(n){var e=this,i,r,u,t,f;for(n=n||e.panes,i=0;i<n.length;i++)for(u=n[i],r=0;r<u.axes.length;r++)t=u.axes[r],t.options.crosshair&&t.options.crosshair.visible&&(f=new va(t,t.options.crosshair),e.crosshairs.push(f),u.content.append(f))},removeCrosshairs:function(n){for(var f=this,r=f.crosshairs,u=n.axes,i,t=r.length-1;t>=0;t--)for(i=0;i<u.length;i++)if(r[t].axis===u[i]){r.splice(t,1);break}},hideCrosshairs:function(){for(var t=this.crosshairs,n=0;n<t.length;n++)t[n].hide()},findPane:function(n){for(var u=this,i=u.panes,r,t=0;t<i.length;t++)if(i[t].options.name===n){r=i[t];break}return r||i[0]},findPointPane:function(n){for(var u=this,i=u.panes,r,t=0;t<i.length;t++)if(i[t].box.containsPoint(n)){r=i[t];break}return r},appendAxis:function(n){var t=this,i=t.findPane(n.options.pane);i.appendAxis(n);t.axes.push(n);n.plotArea=t},removeAxis:function(n){for(var r=this,i,u=[],t=0;t<r.axes.length;t++)i=r.axes[t],n!==i?u.push(i):i.destroy();r.axes=u},appendChart:function(n,t){var i=this;i.charts.push(n);t?t.appendChart(n):i.append(n)},removeChart:function(n){for(var r=this,i,u=[],t=0;t<r.charts.length;t++)i=r.charts[t],i!==n?u.push(i):i.destroy();r.charts=u},addToLegend:function(n){for(var p=n.length,a=[],t,i,e=this.options.legend,v=e.labels||{},y=e.inactiveItems||{},o=y.labels||{},u,s,h,c,f,l,r=0;r<p;r++)(t=n[r],f=t.visible!==!1,t.visibleInLegend!==!1)&&(i=t.name||"",l=f?v.template:o.template||v.template,l&&(i=wt(l)({text:i,series:t})),u=t.color,c=t._defaults,hi(u)&&c&&(u=c.color),f?(s={},h=u):(s={color:o.color,font:o.font},h=y.markers.color),i&&a.push({text:i,labels:s,markerColor:h,series:t,active:f}));rf(e.items,a)},groupAxes:function(n){for(var u=[],f=[],e,t,r,i=0;i<n.length;i++)for(e=n[i].axes,r=0;r<e.length;r++)t=e[r],t.options.vertical?f.push(t):u.push(t);return{x:u,y:f,any:u.concat(f)}},groupSeriesByPane:function(){for(var u=this,f=u.series,n={},i,r,t=0;t<f.length;t++)r=f[t],i=u.seriesPaneName(r),n[i]?n[i].push(r):n[i]=[r];return n},filterVisibleSeries:function(n){for(var i,r=[],t=0;t<n.length;t++)i=n[t],i.visible!==!1&&r.push(i);return r},reflow:function(n){var t=this,r=t.options.plotArea,i=t.panes,u=ci(r.margin);t.box=n.clone().unpad(u);t.reflowPanes();t.reflowAxes(i);t.reflowCharts(i)},redraw:function(n){var i=this,t;for(n=[].concat(n),this.initSeries(),t=0;t<n.length;t++)i.removeCrosshairs(n[t]),n[t].empty();for(i.render(n),i.reflowAxes(i.panes),i.reflowCharts(n),i.createCrosshairs(n),t=0;t<n.length;t++)n[t].refresh()},axisCrossingValues:function(n,t){for(var u=n.options,i=[].concat(u.axisCrossingValues||u.axisCrossingValue),f=t.length-i.length,e=i[0]||0,r=0;r<f;r++)i.push(e);return i},alignAxisTo:function(n,t,i,r){var u=n.getSlot(i,i,!0),f=n.options.reverse?2:1,e=t.getSlot(r,r,!0),o=t.options.reverse?2:1,s=n.box.translate(e[a+o]-u[a+f],e[l+o]-u[l+f]);n.pane!==t.pane&&s.translate(0,n.pane.box.y1-t.pane.box.y1);n.reflow(s)},alignAxes:function(n,t){for(var e=this,o=n[0],f=t[0],s=e.axisCrossingValues(o,t),h=e.axisCrossingValues(f,n),l={},a={},v={},y={},c,u,i,r=0;r<t.length;r++)(i=t[r],c=i.pane,u=c.id,e.alignAxisTo(i,o,h[r],s[r]),i.options._overlap)||(k(i.lineBox().x1)===k(o.lineBox().x1)&&(l[u]&&i.reflow(i.box.alignTo(l[u].box,ct).translate(-i.options.margin,0)),l[u]=i),k(i.lineBox().x2)===k(o.lineBox().x2)&&(i._mirrored||(i.options.labels.mirror=!i.options.labels.mirror,i._mirrored=!0),e.alignAxisTo(i,o,h[r],s[r]),a[u]&&i.reflow(i.box.alignTo(a[u].box,et).translate(i.options.margin,0)),a[u]=i),r!==0&&f.pane===i.pane&&(i.alignTo(f),i.reflow(i.box)));for(r=0;r<n.length;r++)(i=n[r],c=i.pane,u=c.id,e.alignAxisTo(i,f,s[r],h[r]),i.options._overlap)||(k(i.lineBox().y1)===k(f.lineBox().y1)&&(i._mirrored||(i.options.labels.mirror=!i.options.labels.mirror,i._mirrored=!0),e.alignAxisTo(i,f,s[r],h[r]),v[u]&&i.reflow(i.box.alignTo(v[u].box,dt).translate(0,-i.options.margin)),v[u]=i),k(i.lineBox().y2,le)===k(f.lineBox().y2,le)&&(y[u]&&i.reflow(i.box.alignTo(y[u].box,ai).translate(0,i.options.margin)),y[u]=i),r!==0&&(i.alignTo(o),i.reflow(i.box)))},shrinkAxisWidth:function(n){for(var o=this,f=o.groupAxes(n).any,s=vo(f),r=0,e,u,t=0;t<n.length;t++)e=n[t],e.axes.length>0&&(r=i.max(r,s.width()-e.contentBox.width()));if(r!==0)for(t=0;t<f.length;t++)u=f[t],u.options.vertical||u.reflow(u.box.shrink(r,0))},shrinkAxisHeight:function(n){for(var e,r,o,u,f,s,t=0;t<n.length;t++)if(e=n[t],r=e.axes,o=i.max(0,vo(r).height()-e.contentBox.height()),o!==0){for(u=0;u<r.length;u++)f=r[u],f.options.vertical&&f.reflow(f.box.shrink(0,o));s=!0}return s},fitAxes:function(n){for(var a=this,c=a.groupAxes(n).any,s=0,u,f,e,l,h,r,o,t=0;t<n.length;t++)if(h=n[t],u=h.axes,f=h.contentBox,u.length>0)for(e=vo(u),s=i.max(s,f.x1-e.x1),l=i.max(f.y1-e.y1,f.y2-e.y2),o=0;o<u.length;o++)r=u[o],r.reflow(r.box.translate(0,l));for(t=0;t<c.length;t++)r=c[t],r.reflow(r.box.translate(s,0))},reflowAxes:function(n){for(var t=this,i=t.groupAxes(n),r=0;r<n.length;r++)t.reflowPaneAxes(n[r]);i.x.length>0&&i.y.length>0&&(t.alignAxes(i.x,i.y),t.shrinkAxisWidth(n),t.autoRotateAxisLabels(i),t.alignAxes(i.x,i.y),t.shrinkAxisWidth(n)&&t.alignAxes(i.x,i.y),t.shrinkAxisHeight(n),t.alignAxes(i.x,i.y),t.shrinkAxisHeight(n)&&t.alignAxes(i.x,i.y),t.fitAxes(n))},autoRotateAxisLabels:function(n){for(var r=this.axes,i=this.panes,u,f,t=0;t<r.length;t++)u=r[t],u.autoRotateLabels()&&(f=!0);if(f){for(t=0;t<i.length;t++)this.reflowPaneAxes(i[t]);n.x.length>0&&n.y.length>0&&(this.alignAxes(n.x,n.y),this.shrinkAxisWidth(i))}},reflowPaneAxes:function(n){var i=n.axes,t,r=i.length;if(r>0)for(t=0;t<r;t++)i[t].reflow(n.contentBox)},reflowCharts:function(n){for(var u=this,i=u.charts,f=i.length,e=u.box,r,t=0;t<f;t++)r=i[t].pane,(!r||rt(r,n))&&i[t].reflow(e)},reflowPanes:function(){for(var e=this,i=e.box,r=e.panes,u=r.length,n,o,s=i.height(),a=u,h=0,c=i.y1,f,l,t=0;t<u;t++)n=r[t],f=n.options.height,n.options.width=i.width(),n.options.height?(f.indexOf&&f.indexOf("%")&&(l=parseInt(f,10)/100,n.options.height=l*i.height()),n.reflow(i.clone()),s-=n.options.height):h++;for(t=0;t<u;t++)n=r[t],n.options.height||(n.options.height=s/h);for(t=0;t<u;t++)n=r[t],o=i.clone().move(i.x1,c),n.reflow(o),a--,c+=n.options.height},backgroundBox:function(){for(var o=this,r=o.axes,s=r.length,u,n,i,f,e,t=0;t<s;t++)for(f=r[t],i=0;i<s;i++)e=r[i],f.options.vertical!==e.options.vertical&&(u=f.lineBox().clone().wrap(e.lineBox()),n=n?n.wrap(u):u);return n||o.box},createVisual:function(){var u;f.fn.createVisual.call(this);var e=this.backgroundBox(),t=this.options.plotArea,n=t.border||{},i=t.background,r=t.opacity;ri.isTransparent(i)&&(i=wi,r=0);u=this._bgVisual=o.Path.fromRect(e.toRect(),{fill:{color:i,opacity:r},stroke:{color:n.width?n.color:"",width:n.width,dashType:n.dashType},zIndex:-1});this.appendVisual(u)},pointsByCategoryIndex:function(n){var e=this.charts,o=[],t,f,i,r,s;if(n!==null)for(t=0;t<e.length;t++)if((s=e[t],s.pane.options.name!=="_navigator")&&(i=e[t].categoryPoints[n],i&&i.length))for(f=0;f<i.length;f++)r=i[f],r&&u(r.value)&&r.value!==null&&o.push(r);return o},pointsBySeriesIndex:function(n){for(var f=this.charts,e=[],u,t,r,o,i=0;i<f.length;i++)for(o=f[i],u=o.points,r=0;r<u.length;r++)t=u[r],t&&t.options.index===n&&e.push(t);return e},pointsBySeriesName:function(n){for(var f=this.charts,e=[],u,t,r,o,i=0;i<f.length;i++)for(o=f[i],u=o.points,r=0;r<u.length;r++)t=u[r],t&&t.series.name===n&&e.push(t);return e},paneByPoint:function(n){for(var u=this,r=u.panes,i,t=0;t<r.length;t++)if(i=r[t],i.box.containsPoint(n))return i}}),ch=ii.extend({init:function(n,t){var i=this,r,u;if(i.namedCategoryAxes={},i.namedValueAxes={},i.valueAxisRangeTracker=new oo,n.length>0)for(i.invertAxes=rt(n[0].type,[li,eu,yu,wr,lu,hu]),r=0;r<n.length;r++)if(u=n[r].stack,u&&u.type==="100%"){i.stack100=!0;break}ii.fn.init.call(i,n,t)},options:{categoryAxis:{categories:[]},valueAxis:{}},render:function(n){var t=this;n=n||t.panes;t.createCategoryAxes(n);t.aggregateCategories(n);t.createCategoryAxesLabels(n);t.createCharts(n);t.createValueAxes(n)},removeAxis:function(n){var t=this,i=n.options.name;ii.fn.removeAxis.call(t,n);n instanceof ui?delete t.namedCategoryAxes[i]:(t.valueAxisRangeTracker.reset(i),delete t.namedValueAxes[i]);n===t.categoryAxis&&delete t.categoryAxis;n===t.valueAxis&&delete t.valueAxis},createCharts:function(n){for(var r,u,f,e,t,o=this.groupSeriesByPane(),i=0;i<n.length;i++)if(r=n[i],u=o[r.options.name||"default"]||[],this.addToLegend(u),f=this.filterVisibleSeries(u),f)for(e=this.groupSeriesByCategoryAxis(f),t=0;t<e.length;t++)this.createChartGroup(e[t],r)},createChartGroup:function(n,t){this.createAreaChart(ot(n,[cr,wr]),t);this.createBarChart(ot(n,[ir,li]),t);this.createRangeBarChart(ot(n,[hf,lu]),t);this.createBulletChart(ot(n,[eu,be]),t);this.createCandlestickChart(ot(n,ou),t);this.createBoxPlotChart(ot(n,uf),t);this.createOHLCChart(ot(n,sf),t);this.createWaterfallChart(ot(n,[yf,hu]),t);this.createLineChart(ot(n,[cu,yu]),t)},aggregateCategories:function(n){for(var t=this,f=t.srcSeries||t.series,e=[],i,u,o,s,r=0;r<f.length;r++)i=f[r],u=t.seriesCategoryAxis(i),o=t.findPane(u.options.pane),s=kr(u.options.type,lr),(s||i.categoryField)&&rt(o,n)&&(i=t.aggregateSeries(i,u)),e.push(i);t.srcSeries=f;t.series=e},aggregateSeries:function(n,t){var e=t.options,p=kr(t.options.type,lr),o=e.categories,w=e.srcCategories||o,h=n.data,u=[],b=t.range(),c=r({},n),k=r({},n),l=e.dataItems||[],i,a,f,s,v,y=df;for(c.data=s=[],p&&(y=ba),i=0;i<h.length;i++)a=n.categoryField?y(n.categoryField,h[i]):w[i],f=t.categoryIndex(a,b),f>-1&&(u[f]=u[f]||[],u[f].push(i));for(v=new ah(k,d.current,si.current),i=0;i<o.length;i++)s[i]=v.aggregatePoints(u[i],o[i]),u[i]&&(l[i]=s[i]);return t.options.dataItems=l,c},appendChart:function(n,t){for(var r=this,u=n.options.series,e=r.seriesCategoryAxis(u[0]),f=e.options.categories,o=i.max(0,lo(u)-f.length);o--;)f.push("");r.valueAxisRangeTracker.update(n.valueAxisRanges);ii.fn.appendChart.call(r,n,t)},seriesPaneName:function(t){var r=this,i=r.options,u=t.axis,f=[].concat(i.valueAxis),e=n.grep(f,function(n){return n.name===u})[0],o=i.panes||[{}],s=(o[0]||{}).name||"default";return(e||{}).pane||s},seriesCategoryAxis:function(n){var i=this,t=n.categoryAxis,r=t?i.namedCategoryAxes[t]:i.categoryAxis;if(!r)throw new Error("Unable to locate category axis with name "+t);return r},stackableChartOptions:function(n,t){var i=n.stack,f=i&&i.type==="100%",r;return u(t.options.clip)?r=t.options.clip:f&&(r=!1),{isStacked:i,isStacked100:f,clip:r}},groupSeriesByCategoryAxis:function(t){function s(i,r){return n.grep(t,function(n){return r===0&&!n.categoryAxis||n.categoryAxis==i})}for(var o,r,u={},f=n.map(t,function(n){var t=n.categoryAxis||"$$default$$";if(!u.hasOwnProperty(t))return u[t]=!0,t}),e=[],i=0;i<f.length;i++)(o=f[i],r=s(o,i),r.length!==0)&&e.push(r);return e},createBarChart:function(n,t){if(n.length!==0){var i=this,r=n[0],u=new br(i,or({series:n,invertAxes:i.invertAxes,gap:r.gap,spacing:r.spacing},i.stackableChartOptions(r,t)));i.appendChart(u,t)}},createRangeBarChart:function(n,t){if(n.length!==0){var i=this,r=n[0],u=new cl(i,{series:n,invertAxes:i.invertAxes,gap:r.gap,spacing:r.spacing});i.appendChart(u,t)}},createBulletChart:function(n,t){if(n.length!==0){var i=this,r=n[0],u=new ll(i,{series:n,invertAxes:i.invertAxes,gap:r.gap,spacing:r.spacing,clip:t.options.clip});i.appendChart(u,t)}},createLineChart:function(n,t){if(n.length!==0){var i=this,r=n[0],u=new kf(i,or({invertAxes:i.invertAxes,series:n},i.stackableChartOptions(r,t)));i.appendChart(u,t)}},createAreaChart:function(n,t){if(n.length!==0){var i=this,r=n[0],u=new bl(i,or({invertAxes:i.invertAxes,series:n},i.stackableChartOptions(r,t)));i.appendChart(u,t)}},createOHLCChart:function(n,t){if(n.length!==0){var i=this,r=n[0],u=new na(i,{invertAxes:i.invertAxes,gap:r.gap,series:n,spacing:r.spacing,clip:t.options.clip});i.appendChart(u,t)}},createCandlestickChart:function(n,t){if(n.length!==0){var i=this,r=n[0],u=new ku(i,{invertAxes:i.invertAxes,gap:r.gap,series:n,spacing:r.spacing,clip:t.options.clip});i.appendChart(u,t)}},createBoxPlotChart:function(n,t){if(n.length!==0){var i=this,r=n[0],u=new by(i,{invertAxes:i.invertAxes,gap:r.gap,series:n,spacing:r.spacing,clip:t.options.clip});i.appendChart(u,t)}},createWaterfallChart:function(n,t){if(n.length!==0){var i=this,r=n[0],u=new ra(i,{series:n,invertAxes:i.invertAxes,gap:r.gap,spacing:r.spacing});i.appendChart(u,t)}},axisRequiresRounding:function(n,t){for(var u=this,f=ot(u.series,nl),e,r,o,i=0;i<u.series.length;i++)r=u.series[i],(r.type===cu||r.type===cr)&&(o=r.line,o&&o.style===pr&&f.push(r));for(i=0;i<f.length;i++)if(e=f[i].categoryAxis||"",e===n||!e&&t===0)return!0},aggregatedAxis:function(n,t){for(var f=this,r=f.series,u,i=0;i<r.length;i++)if(u=r[i].categoryAxis||"",(u===n||!u&&t===0)&&r[i].categoryField)return!0},axisRequiresOutOfRangePoints:function(n,t){for(var e=this,r=ot(e.series,[cu,yu,cr,wr]),u,f,i=0;i<r.length;i++)if(f=r[i].categoryAxis||"",u=r[i].line,(f===n||!f&&t===0)&&(!u||u.style!==pr))return!0},createCategoryAxesLabels:function(){for(var t=this.axes,n=0;n<t.length;n++)t[n]instanceof ui&&t[n].createLabels()},createCategoryAxes:function(n){for(var i=this,h=i.invertAxes,c=[].concat(i.options.categoryAxis),t,l,a,y,e,o,v=[],s,f=0;f<c.length;f++)if(t=c[f],l=i.findPane(t.pane),rt(l,n)){if(e=t.name,a=t.categories||[],y=t.type||"",t=r({vertical:h,axisCrossingValue:h?ft:0,_deferLabels:!0},t),u(t.justified)||(t.justified=i.isJustified()),i.axisRequiresRounding(e,f)&&(t.justified=!1),i.axisRequiresOutOfRangePoints(e,f)&&(t.outOfRangePoints=!0),nv(t,a[0])?o=new pf(t):(t.limitCategories=i.aggregatedAxis(e,f),o=new ui(t)),e){if(i.namedCategoryAxes[e])throw new Error("Category axis with name "+e+" is already defined");i.namedCategoryAxes[e]=o}o.axisIndex=f;v.push(o);i.appendAxis(o)}s=i.categoryAxis||v[0];i.categoryAxis=s;h?i.axisY=s:i.axisX=s},isJustified:function(){for(var r=this,t=r.series,i,n=0;n<t.length;n++)if(i=t[n],!rt(i.type,[cr,wr]))return!1;return!0},createValueAxes:function(n){var t=this,a=t.valueAxisRangeTracker,h=a.query(),v=[].concat(t.options.valueAxis),y=t.invertAxes,l={vertical:!y},f,p,s,c,w=[],u,b,k,e,o;for(t.stack100&&(l.roundToMajorUnit=!1,l.labels={format:"P0"}),o=0;o<v.length;o++)if(f=v[o],p=t.findPane(f.pane),rt(p,n)){if(e=f.name,k=kr(f.type,fs)?{min:.1,max:1}:{min:0,max:1},u=a.query(e)||h||k,o===0&&u&&h&&(u.min=i.min(u.min,h.min),u.max=i.max(u.max,h.max)),b=kr(f.type,fs)?tc:ee,s=new b(u.min,u.max,r({},l,f)),e){if(t.namedValueAxes[e])throw new Error("Value axis with name "+e+" is already defined");t.namedValueAxes[e]=s}s.axisIndex=o;w.push(s);t.appendAxis(s)}c=t.valueAxis||w[0];t.valueAxis=c;y?t.axisX=c:t.axisY=c},click:function(t,i){var h=this,c=t._eventCoordinates(i),u=new v(c.x,c.y),l=h.pointPane(u),o,f,e,r=[],s=[];if(l){for(o=l.axes,f=0;f<o.length;f++)e=o[f],e.getValue?yo(s,e.getValue(u)):yo(r,e.getCategory(u));r.length===0&&yo(r,h.categoryAxis.getCategory(u));r.length>0&&s.length>0&&t.trigger(cs,{element:n(i.target),originalEvent:i,category:ne(r),value:ne(s)})}},pointPane:function(n){for(var u=this,r=u.panes,i,t=0;t<r.length;t++)if(i=r[t],i.contentBox.containsPoint(n))return i},updateAxisOptions:function(n,t){var i=n instanceof ui?[].concat(this.options.categoryAxis):[].concat(this.options.valueAxis);r(i[n.axisIndex],t)}}),oo=nr.extend({init:function(){var n=this;n.axisRanges={}},update:function(n){var e=this,f=e.axisRanges,t,r;for(var u in n)t=f[u],r=n[u],f[u]=t=t||{min:ft,max:at},t.min=i.min(t.min,r.min),t.max=i.max(t.max,r.max)},reset:function(n){this.axisRanges[n]=t},query:function(n){return this.axisRanges[n]}}),ea=ii.extend({init:function(n,t){var i=this;i.namedXAxes={};i.namedYAxes={};i.xAxisRangeTracker=new oo;i.yAxisRangeTracker=new oo;ii.fn.init.call(i,n,t)},options:{xAxis:{},yAxis:{}},render:function(n){var t=this,e=t.groupSeriesByPane(),u,i,f,r;for(n=n||t.panes,u=0;u<n.length;u++)(i=n[u],f=e[i.options.name||"default"]||[],t.addToLegend(f),r=t.filterVisibleSeries(f),r)&&(t.createScatterChart(ot(r,ls),i),t.createScatterLineChart(ot(r,as),i),t.createBubbleChart(ot(r,fu),i));t.createAxes(n)},appendChart:function(n,t){var i=this;i.xAxisRangeTracker.update(n.xAxisRanges);i.yAxisRangeTracker.update(n.yAxisRanges);ii.fn.appendChart.call(i,n,t)},removeAxis:function(n){var t=this,i=n.options.name;ii.fn.removeAxis.call(t,n);n.options.vertical?(t.yAxisRangeTracker.reset(i),delete t.namedYAxes[i]):(t.xAxisRangeTracker.reset(i),delete t.namedXAxes[i]);n===t.axisX&&delete t.axisX;n===t.axisY&&delete t.axisY},seriesPaneName:function(t){var r=this,i=r.options,u=t.xAxis,f=[].concat(i.xAxis),e=n.grep(f,function(n){return n.name===u})[0],o=t.yAxis,s=[].concat(i.yAxis),h=n.grep(s,function(n){return n.name===o})[0],c=i.panes||[{}],l=c[0].name||"default";return(e||{}).pane||(h||{}).pane||l},createScatterChart:function(n,t){var i=this;n.length>0&&i.appendChart(new ti(i,{series:n,clip:t.options.clip}),t)},createScatterLineChart:function(n,t){var i=this;n.length>0&&i.appendChart(new fo(i,{series:n,clip:t.options.clip}),t)},createBubbleChart:function(n,t){var i=this;n.length>0&&i.appendChart(new eh(i,{series:n,clip:t.options.clip}),t)},createXYAxis:function(n,t,u){for(var e=this,s=n.name,w=t?e.namedYAxes:e.namedXAxes,b=t?e.yAxisRangeTracker:e.xAxisRangeTracker,f=r({},n,{vertical:t}),k=kr(f.type,fs),h=b.query(),rt=k?{min:.1,max:1}:{min:0,max:1},o=b.query(s)||h||rt,c,g,nt=e.series,v,y,tt,p=[f.min,f.max],it,a,l=0;l<nt.length;l++)if(v=nt[l],y=v[t?"yAxis":"xAxis"],y==f.name||u===0&&!y){tt=d.current.bindPoint(v,0).valueFields;p.push(tt[t?"y":"x"]);break}for(u===0&&h&&(o.min=i.min(o.min,h.min),o.max=i.max(o.max,h.max)),a=0;a<p.length;a++)if(p[a]instanceof Date){it=!0;break}if(g=kr(f.type,lr)||!f.type&&it?fl:k?tc:ee,c=new g(o.min,o.max,f),s){if(w[s])throw new Error((t?"Y":"X")+" axis with name "+s+" is already defined");w[s]=c}return e.appendAxis(c),c},createAxes:function(n){var t=this,r=t.options,i,e=[].concat(r.xAxis),u=[],o=[].concat(r.yAxis),f=[];re(e,function(r){i=t.findPane(this.pane);rt(i,n)&&u.push(t.createXYAxis(this,!1,r))});re(o,function(r){i=t.findPane(this.pane);rt(i,n)&&f.push(t.createXYAxis(this,!0,r))});t.axisX=t.axisX||u[0];t.axisY=t.axisY||f[0]},click:function(t,i){for(var l=this,s=t._eventCoordinates(i),a=new v(s.x,s.y),h=l.axes,y=h.length,u,f=[],e=[],o,c,r=0;r<y;r++)u=h[r],c=u.options.vertical?e:f,o=u.getValue(a),o!==null&&c.push(o);f.length>0&&e.length>0&&t.trigger(cs,{element:n(i.target),originalEvent:i,x:ne(f),y:ne(e)})},updateAxisOptions:function(n,t){var i=n.options.vertical,u=ie(n,[].concat(i?this.axisY:this.axisX)),f=[].concat(i?this.options.yAxis:this.options.xAxis)[u];r(f,t)}}),lh=ii.extend({render:function(){var n=this,t=n.series;n.createPieChart(t)},createPieChart:function(n){var t=this,i=n[0],r=new gu(t,{series:n,padding:i.padding,startAngle:i.startAngle,connectors:i.connectors,legend:t.options.legend});t.appendChart(r)},appendChart:function(n,t){ii.fn.appendChart.call(this,n,t);rf(this.options.legend.items,n.legendItems)}}),oa=lh.extend({render:function(){var n=this,t=n.series;n.createDonutChart(t)},createDonutChart:function(n){var t=this,i=n[0],r=new ia(t,{series:n,padding:i.padding,connectors:i.connectors,legend:t.options.legend});t.appendChart(r)}}),sa=o.Animation.extend({options:{easing:"easeOutElastic",duration:kt},setup:function(){this.element.transform(c.transform().scale(af,af,this.options.center))},step:function(n){this.element.transform(c.transform().scale(n,n,this.options.center))}});o.AnimationFactory.current.register(fr,sa);ha=o.Animation.extend({options:{easing:"easeOutElastic"},setup:function(){var n=this.center=this.element.bbox().center();this.element.transform(c.transform().scale(af,af,n))},step:function(n){this.element.transform(c.transform().scale(n,n,this.center))}});o.AnimationFactory.current.register(fu,ha);var ca=nr.extend({init:function(){this._points=[]},destroy:function(){this._points=[]},show:function(n){var i,t;for(n=[].concat(n),this.hide(),i=0;i<n.length;i++)t=n[i],t&&t.toggleHighlight&&t.hasHighlight()&&(this.togglePointHighlight(t,!0),this._points.push(t))},togglePointHighlight:function(n,t){var r=(n.options.highlight||{}).toggle,i;r?(i={category:n.category,series:n.series,dataItem:n.dataItem,value:n.value,preventDefault:fp,visual:n.highlightVisual(),show:t},r(i),i._defaultPrevented||n.toggleHighlight(t)):n.toggleHighlight(t)},hide:function(){for(var n=this._points;n.length;)this.togglePointHighlight(n.pop(),!1)},isHighlighted:function(n){for(var r,i=this._points,t=0;t<i.length;t++)if(r=i[t],n==r)return!0;return!1}}),oi=ue.extend({init:function(t,i){var u=this,f,e;ue.fn.init.call(u);u.options=r({},u.options,i);u.chartElement=t;u.template=oi.template;u.template||(u.template=oi.template=ec("<div class='"+ht+"tooltip "+ht+"chart-tooltip' style='display:none; position: absolute; font: #= d.font #;border: #= d.border.width #px solid;opacity: #= d.opacity #; filter: alpha(opacity=#= d.opacity * 100 #);'><\/div>"));f=ci(u.options.padding||{},"auto");u.element=n(u.template(u.options)).css({"padding-top":f.top,"padding-right":f.right,"padding-bottom":f.bottom,"padding-left":f.left});u.move=y(u.move,u);u._mouseleave=y(u._mouseleave,u);e=h.format("[{0}='content'],[{0}='scroller']",h.attr("role"));u._mobileScroller=t.closest(e).data("kendoMobileScroller")},destroy:function(){this._clearShowTimeout();this.element&&(this.element.off(we).remove(),this.element=null)},options:{border:{width:1},opacity:1,animation:{duration:150}},move:function(){var n=this,r=n.options,i=n.element,t;n.anchor&&n.element&&(t=n._offset(),n.visible||i.css({top:t.top,left:t.left}),n.visible=!0,n._ensureElement(document.body),i.stop(!0,!0).show().animate({left:t.left,top:t.top},r.animation.duration))},_clearShowTimeout:function(){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=null)},_padding:function(){if(!this._chartPadding){var n=this.chartElement;this._chartPadding={top:parseInt(n.css("paddingTop"),10),left:parseInt(n.css("paddingLeft"),10)}}return this._chartPadding},_offset:function(){var t=this,e=t._measure(),o=t.anchor,s=t._padding(),l=t.chartElement.offset(),r=k(o.y+s.top+l.top),u=k(o.x+s.left+l.left),a=h.support.zoomLevel(),v=n(window),p=window.pageYOffset||document.documentElement.scrollTop||0,w=window.pageXOffset||document.documentElement.scrollLeft||0,i=(this._mobileScroller||{}).movable,y,f;return i&&i.scale!==1?(y=c.transform().scale(i.scale,i.scale,[i.x,i.y]),f=new c.Point(u,r).transform(y),u=f.x,r=f.y):(r+=t._fit(r-p,e.height,v.outerHeight()/a),u+=t._fit(u-w,e.width,v.outerWidth()/a)),{top:r,left:u}},setStyle:function(n,t){var i=n.background,r=n.border.color,f,e;t&&(f=t.color||t.options.color,i=nt(i,f),r=nt(r,f));u(n.color)||(e=new tu(i).percBrightness(),this.element.toggleClass(ht+py,e>180));this.element.css({backgroundColor:i,borderColor:r,font:n.font,color:n.color,opacity:n.opacity,borderWidth:n.border.width})},show:function(){this._clearShowTimeout();this.showTimeout=setTimeout(this.move,vy)},hide:function(){var n=this;clearTimeout(n.showTimeout);n._hideElement();n.visible&&(n.point=null,n.visible=!1,n.index=null)},_measure:function(){this._ensureElement();return{width:this.element.outerWidth(),height:this.element.outerHeight()}},_ensureElement:function(){if(this.element)this.element.appendTo(document.body).on(we,this._mouseleave)},_mouseleave:function(t){var i=t.relatedTarget,r=this.chartElement[0];i&&i!==r&&!n.contains(r,i)&&(this.trigger(ac),this.hide())},_hideElement:function(){var t=this,n=this.element;n&&n.fadeOut({always:function(){t.visible||n.off(we).remove()}})},_pointContent:function(n){var e=this,t=r({},e.options,n.options.tooltip),i,f;return u(n.value)&&(i=n.value.toString()),t.template?(f=wt(t.template),i=f({value:n.value,category:n.category,series:n.series,dataItem:n.dataItem,percentage:n.percentage,runningTotal:n.runningTotal,total:n.total,low:n.low,high:n.high,xLow:n.xLow,xHigh:n.xHigh,yLow:n.yLow,yHigh:n.yHigh})):t.format&&(i=n.formatValue(t.format)),i},_pointAnchor:function(n){var t=this._measure();return n.tooltipAnchor(t.width,t.height)},_fit:function(n,t,i){var r=0;return n+t>i&&(r=i-(n+t)),n<0&&(r=-n),r}}),la=oi.extend({show:function(n){var t=this,i=r({},t.options,n.options.tooltip);n&&n.tooltipAnchor&&t.element&&(t.element.html(t._pointContent(n)),t.anchor=t._pointAnchor(n),t.anchor?(t.setStyle(i,n),oi.fn.show.call(t,n)):t.hide())}}),aa=oi.extend({init:function(n,t,i){var r=this;oi.fn.init.call(r,n,i);r.plotArea=t},options:{sharedTemplate:"<table><th colspan='2'>#= categoryText #<\/th># for(var i = 0; i < points.length; i++) { ## var point = points[i]; #<tr># if(point.series.name) { # <td> #= point.series.name #:<\/td># } #<td>#= content(point) #<\/td><\/tr># } #<\/table>",categoryFormat:"{0:d}"},showAt:function(t,i){var r=this,e=r.options,o=r.plotArea,u=o.categoryAxis,s=u.pointCategoryIndex(i),h=u.getCategory(i),c=u.getSlot(s),f;t=n.grep(t,function(n){var t=n.series.tooltip,i=t&&t.visible===!1;return!i});t.length>0&&(f=r._content(t,h),r.element.html(f),r.anchor=r._slotAnchor(i,c),r.setStyle(e,t[0]),oi.fn.show.call(r))},_slotAnchor:function(n,t){var r=this,u=r.plotArea,f=u.categoryAxis,e=this._measure(),i=n.y-e.height/2;return f.options.vertical?v(n.x,i):v(t.center().x,i)},_content:function(n,t){var i=this,r;return r=h.template(i.options.sharedTemplate),r({points:n,category:t,categoryText:vt(i.options.categoryFormat,t),content:i._pointContent})}}),va=f.extend({init:function(n,t){f.fn.init.call(this,t);this.axis=n;this.stickyMode=n instanceof ui},options:{color:uu,width:1,zIndex:-1,tooltip:{visible:!1}},showAt:function(n){this.point=n;this.moveLine();this.line.visible(!0);var t=this.options.tooltip;t.visible&&(this.tooltip||(this.tooltip=new ya(this,r({},t,{stickyMode:this.stickyMode}))),this.tooltip.showAt(n))},hide:function(){this.line.visible(!1);this.tooltip&&this.tooltip.hide()},moveLine:function(){var i=this,f=i.axis,o=f.options.vertical,n=i.getBox(),e=i.point,t=o?l:a,s,r,u;r=new c.Point(n.x1,n.y1);u=o?new c.Point(n.x2,n.y1):new c.Point(n.x1,n.y2);e&&(i.stickyMode?(s=f.getSlot(f.pointCategoryIndex(e)),r[t]=u[t]=s.center()[t]):r[t]=u[t]=e[t]);i.box=n;this.line.moveTo(r).lineTo(u)},getBox:function(){for(var s=this,u=s.axis,e=u.pane.axes,h=e.length,o=u.options.vertical,f=u.lineBox().clone(),t=o?a:l,n,i,r=0;r<h;r++)i=e[r],i.options.vertical!=o&&(n?n.wrap(i.lineBox()):n=i.lineBox().clone());return f[t+1]=n[t+1],f[t+2]=n[t+2],f},createVisual:function(){f.fn.createVisual.call(this);var n=this.options;this.line=new o.Path({stroke:{color:n.color,width:n.width,opacity:n.opacity,dashType:n.dashType},visible:!1});this.moveLine();this.visual.append(this.line)},destroy:function(){var n=this;n.tooltip&&n.tooltip.destroy();f.fn.destroy.call(n)}}),ya=oi.extend({init:function(n,t){var i=this,u=n.axis.getRoot().chart.element;i.crosshair=n;oi.fn.init.call(i,u,r({},i.options,{background:n.axis.plotArea.options.seriesColors[0]},t));i.setStyle(i.options)},options:{padding:10},showAt:function(n){var t=this,i=t.element;i&&(t.point=n,t.element.html(t.content(n)),t.anchor=t.getAnchor(),t.move())},move:function(){var n=this,i=n.element,t=n._offset();n._ensureElement();i.css({top:t.top,left:t.left}).show()},content:function(n){var f=this,t=f.options,e=f.crosshair.axis,u=e.options,i,r,o;return r=i=e[t.stickyMode?"getCategory":"getValue"](n),t.template?(o=wt(t.template),i=o({value:r})):t.format?i=vt(t.format,r):u.type===lr&&(i=vt(u.labels.dateFormats[u.baseUnit],r)),i},getAnchor:function(){var s=this,r=s.options,u=r.position,f=this.crosshair,h=!f.axis.options.vertical,n=f.line.bbox(),t=this._measure(),e=t.width/2,o=t.height/2,i=r.padding;return h?u===ai?n.bottomLeft().translate(-e,i):n.topLeft().translate(-e,-t.height-i):u===ct?n.topLeft().translate(-t.width-i,-o):n.topRight().translate(i,-o)},hide:function(){this.element.hide();this.point=null},destroy:function(){oi.fn.destroy.call(this);this.point=null}}),so={min:function(n){for(var t=ft,f=n.length,u,r=0;r<f;r++)u=n[r],w(u)&&(t=i.min(t,u));return t===ft?n[0]:t},max:function(n){for(var t=at,f=n.length,u,r=0;r<f;r++)u=n[r],w(u)&&(t=i.max(t,u));return t===at?n[0]:t},sum:function(n){for(var u=n.length,r=0,i,t=0;t<u;t++)i=n[t],w(i)&&(r+=i);return r},sumOrNull:function(n){var t=null;return po(n)&&(t=so.sum(n)),t},count:function(n){for(var f=n.length,r=0,i,t=0;t<f;t++)i=n[t],i!==null&&u(i)&&r++;return r},avg:function(n){var t=n[0],i=po(n);return i>0&&(t=so.sum(n)/i),t},first:function(n){for(var r=n.length,i,t=0;t<r;t++)if(i=n[t],i!==null&&u(i))return i;return n[0]}};si.prototype={register:function(n,t){for(var i=0;i<n.length;i++)this._defaults[n[i]]=t},query:function(n){return this._defaults[n]}};si.current=new si;var ho=ue.extend({init:function(t,i,u){var f=this,c=t.element,p=i.lineBox(),v=f.getValueAxis(i),a=v.lineBox(),o="."+ht,e,l;if(ue.fn.init.call(f),f.options=r({},f.options,u),u=f.options,f.chart=t,f.chartElement=c,f.categoryAxis=i,f._dateAxis=f.categoryAxis instanceof pf,f.valueAxis=v,f._dateAxis&&r(u,{min:s(u.min),max:s(u.max),from:s(u.from),to:s(u.to)}),f.template=ho.template,f.template||(f.template=ho.template=ec("<div class='"+ht+"selector' style='width: #= d.width #px; height: #= d.height #px; top: #= d.offset.top #px; left: #= d.offset.left #px;'><div class='"+ht+"mask'><\/div><div class='"+ht+"mask'><\/div><div class='"+ht+"selection'><div class='"+ht+"selection-bg'><\/div><div class='"+ht+"handle "+ht+"leftHandle'><div><\/div><\/div><div class='"+ht+"handle "+ht+"rightHandle'><div><\/div><\/div><\/div><\/div>")),l={left:parseInt(c.css("paddingLeft"),10),right:parseInt(c.css("paddingTop"),10)},f.options=r({},{width:p.width(),height:a.height(),padding:l,offset:{left:a.x2+l.left,top:a.y1+l.right},from:u.min,to:u.max},u),f.options.visible){f.wrapper=e=n(f.template(f.options)).appendTo(c);f.selection=e.find(o+"selection");f.leftMask=e.find(o+"mask").first();f.rightMask=e.find(o+"mask").last();f.leftHandle=e.find(o+"leftHandle");f.rightHandle=e.find(o+"rightHandle");f.options.selection={border:{left:parseFloat(f.selection.css("border-left-width"),10),right:parseFloat(f.selection.css("border-right-width"),10)}};f.leftHandle.css("top",(f.selection.height()-f.leftHandle.height())/2);f.rightHandle.css("top",(f.selection.height()-f.rightHandle.height())/2);f.set(f._index(u.from),f._index(u.to));f.bind(f.events,f.options);f.wrapper[0].style.cssText=f.wrapper[0].style.cssText;f.wrapper.on(wc,y(f._mousewheel,f));h.UserEvents?f.userEvents=new h.UserEvents(f.wrapper,{global:!0,stopPropagation:!0,multiTouch:!0,start:y(f._start,f),move:y(f._move,f),end:y(f._end,f),tap:y(f._tap,f),gesturestart:y(f._gesturechange,f),gesturechange:y(f._gesturechange,f)}):f.leftHandle.add(f.rightHandle).removeClass(ht+"handle")}},events:[cf,yr,lf],options:{visible:!0,mousewheel:{zoom:"both"},min:at,max:ft},destroy:function(){var n=this,t=n.userEvents;t&&t.destroy();clearTimeout(n._mwTimeout);n._state=null;n.wrapper.remove()},_rangeEventArgs:function(n){var t=this;return{axis:t.categoryAxis.options,from:t._value(n.from),to:t._value(n.to)}},_start:function(t){var i=this,r=i.options,u=n(t.event.target),f;!i._state&&u&&(i.chart._unsetActivePoint(),i._state={moveTarget:u.parents(".k-handle").add(u).first(),startLocation:t.x?t.x.location:0,range:{from:i._index(r.from),to:i._index(r.to)}},f=i._rangeEventArgs({from:i._index(r.from),to:i._index(r.to)}),i.trigger(cf,f)&&(i.userEvents.cancel(),i._state=null))},_move:function(n){if(this._state){var r=this,o=r._state,u=r.options,v=r.categoryAxis.options.categories,c=r._index(u.from),y=r._index(u.to),s=r._index(u.min),f=r._index(u.max),p=o.startLocation-n.x.location,t=o.range,l={from:t.from,to:t.to},a=t.to-t.from,e=o.moveTarget,w=r.wrapper.width()/(v.length-1),h=i.round(p/w);e&&(n.preventDefault(),e.is(".k-selection, .k-selection-bg")?(t.from=i.min(i.max(s,c-h),f-a),t.to=i.min(t.from+a,f)):e.is(".k-leftHandle")?(t.from=i.min(i.max(s,c-h),f-1),t.to=i.max(t.from+1,t.to)):e.is(".k-rightHandle")&&(t.to=i.min(i.max(s+1,y-h),f),t.from=i.min(t.to-1,t.from)),(t.from!==l.from||t.to!==l.to)&&(r.move(t.from,t.to),r.trigger(yr,r._rangeEventArgs(t))))}},_end:function(){var n=this,t=n._state.range;delete n._state;n.set(t.from,t.to);n.trigger(lf,n._rangeEventArgs(t))},_gesturechange:function(n){if(this._state){var t=this,u=t.chart,f=t._state,o=t.options,s=t.categoryAxis,r=f.range,h=u._toModelCoordinates(n.touches[0].x.location).x,c=u._toModelCoordinates(n.touches[1].x.location).x,l=i.min(h,c),a=i.max(h,c);n.preventDefault();f.moveTarget=null;r.from=s.pointCategoryIndex(new e.Point2D(l))||o.min;r.to=s.pointCategoryIndex(new e.Point2D(a))||o.max;t.move(r.from,r.to)}},_tap:function(n){var t=this,u=t.options,l=t.chart._eventCoordinates(n),f=t.categoryAxis,a=f.pointCategoryIndex(new e.Point2D(l.x,f.box.y1)),o=t._index(u.from),v=t._index(u.to),y=t._index(u.min),h=t._index(u.max),s=v-o,p=o+s/2,c=i.round(p-a),r={},w=n.event.which===3;t._state||w||(n.preventDefault(),t.chart._unsetActivePoint(),f.options.justified||c--,r.from=i.min(i.max(y,o-c),h-s),r.to=i.min(r.from+s,h),t._start(n),t._state&&(t._state.range=r,t.trigger(yr,t._rangeEventArgs(r)),t._end()))},_mousewheel:function(n){var t=this,f=t.options,r=uc(n),u;t._start({event:{target:t.selection}});t._state&&(u=t._state.range,n.preventDefault(),n.stopPropagation(),i.abs(r)>1&&(r*=wy),f.mousewheel.reverse&&(r*=-1),t.expand(r)&&t.trigger(yr,{axis:t.categoryAxis.options,delta:r,originalEvent:n,from:t._value(u.from),to:t._value(u.to)}),t._mwTimeout&&clearTimeout(t._mwTimeout),t._mwTimeout=setTimeout(function(){t._end()},pc))},_index:function(n){var u=this,i=u.categoryAxis,r=i.options.categories,t=n;return n instanceof Date&&(t=wh(n,r),!i.options.justified&&n>st(r)&&(t+=1)),t},_value:function(n){var t=this,u=this.categoryAxis,i=u.options.categories,r=n;return t._dateAxis&&(r=n>i.length-1?t.options.max:i[n]),r},_slot:function(n){var t=this,i=this.categoryAxis;return i.getSlot(t._index(n))},move:function(n,t){var r=this,u=r.options,h=u.offset,c=u.padding,l=u.selection.border,f,e,o,s;o=r._slot(n);f=k(o.x1-h.left+c.left);r.leftMask.width(f);r.selection.css("left",f);o=r._slot(t);e=k(u.width-(o.x1-h.left+c.left));r.rightMask.width(e);s=u.width-e;s!=u.width&&(s+=l.right);r.rightMask.css("left",s);r.selection.width(i.max(u.width-(f+e)-l.right,0))},set:function(n,t){var i=this,r=i.options,f=i._index(r.min),u=i._index(r.max);n=tt(i._index(n),f,u);t=tt(i._index(t),n+1,u);r.visible&&i.move(n,t);r.from=i._value(n);r.to=i._value(t)},expand:function(n){var i=this,u=i.options,o=i._index(u.min),f=i._index(u.max),s=u.mousewheel.zoom,h=i._index(u.from),e=i._index(u.to),t={from:h,to:e},c=r({},t);return i._state&&(t=i._state.range),s!==et&&(t.from=tt(tt(h-n,0,e-1),o,f)),s!==ct&&(t.to=tt(tt(e+n,t.from+1,f),o,f)),t.from!==c.from||t.to!==c.to?(i.set(t.from,t.to),!0):void 0},getValueAxis:function(n){for(var r=n.pane.axes,u=r.length,i,t=0;t<u;t++)if(i=r[t],i.options.vertical!==n.options.vertical)return i}}),ky=nr.extend({init:function(n,t){this.plotArea=n;this.options=r({},this.options,t)},options:{key:"none",lock:"none"},start:function(n){this._active=ev(n.event,this.options.key)},move:function(n){if(this._active){var t=this.axisRanges=this._panAxes(n,a).concat(this._panAxes(n,l));if(t.length)return this.axisRanges=t,dh(t)}},end:function(){this._active=!1},pan:function(){var t=this.plotArea,i=this.axisRanges,r,n;if(i.length){for(n=0;n<i.length;n++)r=i[n],t.updateAxisOptions(r.axis,r.range);t.redraw(t.panes)}},_panAxes:function(n,t){var s=this.plotArea,e=-n[t].delta,h=(this.options.lock||"").toLowerCase(),o=[],f,i,r,u;if(e!==0&&(h||"").toLowerCase()!=t)for(f=s.axes,u=0;u<f.length;u++)i=f[u],(t==a&&!i.options.vertical||t==l&&i.options.vertical)&&(r=i.pan(e),r&&(r.limitRange=!0,o.push({axis:i,range:r})));return o}}),dy=nr.extend({init:function(t,i){this.chart=t;this.options=r({},this.options,i);this._marquee=n("<div class='k-marquee'><div class='k-marquee-color'><\/div><\/div>")},options:{key:"shift",lock:"none"},start:function(n){var t,i;if(ev(n.event,this.options.key)){var r=this.chart,f=r._toModelCoordinates(n.x.client,n.y.client),u=this._zoomPane=r._plotArea.paneByPoint(f);u&&(t=u.clipBox().clone(),i=this._elementOffset(),t.translate(i.left,i.top),this._zoomPaneClipBox=t,this._marquee.appendTo(document.body).css({left:n.x.client+1,top:n.y.client+1,width:0,height:0}))}},_elementOffset:function(){var n=this.chart.element,t=n.offset();return{left:parseInt(n.css("paddingTop"),10)+t.left,top:parseInt(n.css("paddingLeft"),10)+t.top}},move:function(n){var i=this._zoomPane,t;i&&(t=this._selectionPosition(n),this._marquee.css(t))},end:function(n){var f=this._zoomPane,i,t,r,u;if(f)return i=this._elementOffset(),t=this._selectionPosition(n),t.left-=i.left,t.top-=i.top,r={x:t.left,y:t.top},u={x:t.left+t.width,y:t.top+t.height},this._updateAxisRanges(r,u),this._marquee.remove(),delete this._zoomPane,dh(this.axisRanges)},zoom:function(){var n=this.axisRanges,t,r,i;if(n&&n.length){for(t=this.chart._plotArea,i=0;i<n.length;i++)r=n[i],t.updateAxisOptions(r.axis,r.range);t.redraw(t.panes)}},destroy:function(){this._marquee.remove();delete this._marquee},_updateAxisRanges:function(n,t){for(var s,f=(this.options.lock||"").toLowerCase(),e=[],o=this._zoomPane.axes,i,r,u=0;u<o.length;u++)i=o[u],r=i.options.vertical,f==a&&!r||f===l&&r||(s=i.pointsRange(n,t),e.push({axis:i,range:s}));this.axisRanges=e},_selectionPosition:function(n){var f=(this.options.lock||"").toLowerCase(),e=i.min(n.x.startLocation,n.x.location),o=i.min(n.y.startLocation,n.y.location),r=i.abs(n.x.initialDelta),u=i.abs(n.y.initialDelta),t=this._zoomPaneClipBox;return f==a&&(e=t.x1,r=t.width()),f==l&&(o=t.y1,u=t.height()),n.x.location>t.x2&&(r=t.x2-n.x.startLocation),n.x.location<t.x1&&(r=n.x.startLocation-t.x1),n.y.location>t.y2&&(u=t.y2-n.y.startLocation),n.y.location<t.y1&&(u=n.y.startLocation-t.y1),{left:i.max(e,t.x1),top:i.max(o,t.y1),width:r,height:u}}}),gy=nr.extend({init:function(n,t){this.plotArea=n;this.options=r({},this.options,t)},updateRanges:function(n){for(var f,e=(this.options.lock||"").toLowerCase(),i=[],o=this.plotArea.axes,t,r,u=0;u<o.length;u++)t=o[u],r=t.options.vertical,e==a&&!r||e===l&&r||(f=t.zoomRange(-n),f&&i.push({axis:t,range:f}));return this.axisRanges=i,dh(i)},zoom:function(){var n=this.axisRanges,t,r,i;if(n&&n.length){for(t=this.plotArea,i=0;i<n.length;i++)r=n[i],t.updateAxisOptions(r.axis,r.range);t.redraw(t.panes)}}}),ah=function(n,t,i){var e=this,o=t.canonicalFields(n),h=t.valueFields(n),c=t.sourceFields(n,o),l=e._seriesFields=[],a=i.query(n.type),s=n.aggregate||a,r,f,u;for(e._series=n,e._binder=t,r=0;r<o.length;r++){if(f=o[r],typeof s===yi)u=s[f];else if(r===0||rt(f,h))u=s;else break;u&&l.push({canonicalName:f,name:c[r],transform:hi(u)?u:so[u]})}};ah.prototype={aggregatePoints:function(n,t){var e=this,c=e._bindPoints(n||[]),y=e._series,a=e._seriesFields,o,r,v,i,s=c.dataItems[0],f={},l;for(!s||w(s)||er(s)||(l=function(){},l.prototype=s,f=new l),o=0;o<a.length;o++)if(r=a[o],v=e._bindField(c.values,r.canonicalName),i=r.transform(v,y,c.dataItems,t),i===null||typeof i!==yi||u(i.length))u(i)&&(iv(r.name,f),h.setter(r.name)(f,i));else{f=i;break}return f},_bindPoints:function(n){for(var r=this,o=r._binder,u=r._series,f=[],e=[],i,t=0;t<n.length;t++)i=n[t],f.push(o.bindPoint(u,i)),e.push(u.data[i]);return{values:f,dataItems:e}},_bindField:function(n,t){for(var e=[],s=n.length,r,o,f,i=0;i<s;i++)r=n[i],f=r.valueFields,o=u(f[t])?f[t]:r.fields[t],e.push(o);return e}};vh=nr.extend({init:function(n){this._axis=n},slot:function(n,t){return this._axis.slot(n,t)},range:function(){return this._axis.range()}});or(n.easing,{easeOutElastic:function(n,t,r,u){var o=1.70158,f=0,e=u;return n===0?r:n===1?r+u:(f||(f=.5),e<i.abs(u)?(e=u,o=f/4):o=f/(2*i.PI)*i.asin(u/e),e*i.pow(2,-10*n)*i.sin((n*1-o)*1.1*i.PI/f)+u+r)}});e.ui.plugin(nh);bi.current.register(ch,[li,ir,cu,yu,cr,wr,ou,sf,eu,be,uf,hf,lu,yf,hu]);bi.current.register(ea,[ls,as,fu]);bi.current.register(lh,[fr]);bi.current.register(oa,[ef]);d.current.register([li,ir,cu,yu,cr,wr],[gt],[bt,vi,ur,hc,cc]);d.current.register([hf,lu],["from","to"],[bt,vi,ur]);d.current.register([yf,hu],[gt],[bt,vi,ur,"summary"]);si.current.register([li,ir,cu,yu,cr,wr,yf,hu],{value:lt,color:yt,noteText:yt,errorLow:es,errorHigh:lt});si.current.register([hf,lu],{from:es,to:lt,color:yt,noteText:yt});d.current.register([ls,as,fu],[a,l],[vi,ur,"xErrorLow","xErrorHigh","yErrorLow","yErrorHigh"]);d.current.register([fu],[a,l,"size"],[vi,bt,ur]);d.current.register([ou,sf],["open","high","low","close"],[bt,vi,"downColor",ur]);si.current.register([ou,sf],{open:lt,high:lt,low:es,close:lt,color:yt,downColor:yt,noteText:yt});d.current.register([uf],["lower","q1","median","q3","upper","mean","outliers"],[bt,vi,ur]);si.current.register([uf],{lower:lt,q1:lt,median:lt,q3:lt,upper:lt,mean:lt,outliers:yt,color:yt,noteText:yt});d.current.register([eu,be],["current","target"],[bt,vi,"visibleInLegend",ur]);si.current.register([eu,be],{current:lt,target:lt,color:yt,noteText:yt});d.current.register([fr,ef],[gt],[bt,vi,"explode","visibleInLegend","visible"]);r(e,{EQUALLY_SPACED_SERIES:nl,Aggregates:so,AreaChart:bl,AreaSegment:uo,AxisGroupRangeTracker:oo,Bar:bf,BarChart:br,BarLabel:th,BubbleChart:eh,Bullet:to,BulletChart:ll,CandlestickChart:ku,Candlestick:di,CategoricalChart:ni,CategoricalErrorBar:al,CategoricalPlotArea:ch,CategoryAxis:ui,ChartAxis:vh,ChartContainer:fa,ClipAnimation:io,ClusterLayout:wf,Crosshair:va,CrosshairTooltip:ya,DateCategoryAxis:pf,DateValueAxis:fl,DefaultAggregates:si,DonutChart:ia,DonutPlotArea:oa,DonutSegment:eo,ErrorBarBase:rh,ErrorRangeCalculator:bu,Highlight:ca,SharedTooltip:aa,Legend:ul,LegendItem:il,LegendLayout:rl,LineChart:kf,LinePoint:fi,LineSegment:ei,Pane:hh,PieAnimation:sa,PieChart:gu,PieChartMixin:oh,PiePlotArea:lh,PieSegment:du,PlotAreaBase:ii,PlotAreaFactory:bi,PointEventsMixin:ki,RangeBar:hl,RangeBarChart:cl,ScatterChart:ti,ScatterErrorBar:vl,ScatterLineChart:fo,Selection:ho,SeriesAggregator:ah,SeriesBinder:d,ShapeElement:iu,SplineSegment:fh,SplineAreaSegment:kl,StackWrap:el,Tooltip:la,OHLCChart:na,OHLCPoint:gl,WaterfallChart:ra,WaterfallSegment:ua,XYPlotArea:ea,addDuration:p,areNumbers:bh,axisGroupBox:vo,categoriesCount:lo,ceilDate:ph,countNumbers:po,duration:ao,ensureTree:iv,indexOf:ie,isNumber:w,floorDate:gf,filterSeriesByType:ot,hasValue:gr,lteDateIndex:wh,evalOptions:dr,seriesTotal:rv,singleItemOrArray:ne,sortDates:da,startOfWeek:ka,transpose:tv,toDate:s,toTime:g,uniqueDates:ga})})(window.kendo.jQuery)}(),function(){(function(n){function wr(n,t){return n.value.x-t.value.x}function k(n,t){return 180-i.abs(i.abs(n-t)-180)}var i=Math,h=window.kendo,r=h.deepExtend,ht=h.util,ct=ht.append,f=h.drawing,e=h.geometry,t=h.dataviz,lt=t.AreaSegment,at=t.Axis,gi=t.AxisGroupRangeTracker,vt=t.BarChart,c=t.Box2D,nr=t.CategoryAxis,tr=t.CategoricalChart,ir=t.CategoricalPlotArea,yt=t.ChartElement,rr=t.CurveProcessor,pt=t.DonutSegment,ur=t.LineChart,y=t.LineSegment,wt=t.LogarithmicAxis,o=t.NumericAxis,d=t.PlotAreaBase,bt=t.PlotAreaFactory,l=t.Point2D,g=t.Ring,fr=t.ScatterChart,er=t.ScatterLineChart,kt=t.SeriesBinder,dt=t.ShapeBuilder,or=t.SplineSegment,gt=t.SplineAreaSegment,nt=t.getSpacing,s=t.filterSeriesByType,p=ht.limitValue,sr=t.round,u="arc",hr=t.COORD_PRECISION,cr=.15,a=i.PI/180,ni="gap",lr="interpolate",ar="log",ti="plotAreaClick",ii="polarArea",ri="polarLine",ui="polarScatter",fi="radarArea",ei="radarColumn",oi="radarLine",tt="smooth",it="zero",si=[ii,ri,ui],rt=[fi,ei,oi],hi={createGridLines:function(n){var t=this,r=t.options,e=i.abs(t.box.center().y-n.lineBox().y1),o,s,u=!1,f=[];return r.majorGridLines.visible&&(o=t.majorGridLineAngles(n),u=!0,f=t.renderMajorGridLines(o,e,r.majorGridLines)),r.minorGridLines.visible&&(s=t.minorGridLineAngles(n,u),ct(f,t.renderMinorGridLines(s,e,r.minorGridLines,n,u))),f},renderMajorGridLines:function(n,t,i){return this.renderGridLines(n,t,i)},renderMinorGridLines:function(n,t,i,r,u){var f=this.radiusCallback&&this.radiusCallback(t,r,u);return this.renderGridLines(n,t,i,f)},renderGridLines:function(n,t,i,r){for(var s,l={stroke:{width:i.width,color:i.color,dashType:i.dashType}},h=this.box.center(),o=new e.Circle([h.x,h.y],t),c=this.gridLinesVisual(),u=0;u<n.length;u++)s=new f.Path(l),r&&(o.radius=r(n[u])),s.moveTo(o.center).lineTo(o.pointAt(n[u])),c.append(s);return c.children},gridLineAngles:function(t,i,r,u,f){var e=this,s=e.intervals(i,r,u,f),o=t.options,h=o.visible&&(o.line||{}).visible!==!1;return n.map(s,function(n){var t=e.intervalAngle(n);if(!h||t!==90)return t})}},v=nr.extend({options:{startAngle:90,labels:{margin:nt(10)},majorGridLines:{visible:!0},justified:!0},range:function(){return{min:0,max:this.options.categories.length}},reflow:function(n){this.box=n;this.reflowLabels()},lineBox:function(){return this.box},reflowLabels:function(){for(var i=this,u=i.options.labels,f=u.skip||0,e=u.step||1,o=new c,t=i.labels,r,n=0;n<t.length;n++)t[n].reflow(o),r=t[n].box,t[n].reflow(i.getSlot(f+n*e).adjacentBox(0,r.width(),r.height()))},intervals:function(n,i,r,u){var l=this,o=l.options,a=o.categories.length,f=0,s=a/n||1,h=360/s,c=[],e;for(i=i||0,r=r||1,e=i;e<s;e+=r)f=o.reverse?360-e*h:e*h,f=sr(f,hr)%360,u&&t.inArray(f,u)||c.push(f);return c},majorIntervals:function(){return this.intervals(1)},minorIntervals:function(){return this.intervals(.5)},intervalAngle:function(n){return(360+n+this.options.startAngle)%360},majorAngles:function(){return n.map(this.majorIntervals(),n.proxy(this.intervalAngle,this))},createLine:function(){return[]},majorGridLineAngles:function(n){var t=this.options.majorGridLines;return this.gridLineAngles(n,1,t.skip,t.step)},minorGridLineAngles:function(n,t){var i=this.options,r=i.minorGridLines,u=i.majorGridLines,f=t?this.intervals(1,u.skip,u.step):null;return this.gridLineAngles(n,.5,r.skip,r.step,f)},radiusCallback:function(n,r,f){if(r.options.type!==u){var e=180/this.options.categories.length,o=i.cos(e*a)*n,s=this.majorAngles();return function(i){return!f&&t.inArray(i,s)?n:o}}},createPlotBands:function(){for(var t=this,a=t.options,s=a.plotBands||[],n,u,e,o,h,c=this._plotbandGroup=new f.Group({zIndex:-1}),l,r=0;r<s.length;r++)n=s[r],u=t.plotBandSlot(n),e=t.getSlot(n.from),o=n.from-i.floor(n.from),u.startAngle+=o*e.angle,h=i.ceil(n.to)-n.to,u.angle-=(h+o)*e.angle,l=dt.current.createRing(u,{fill:{color:n.color,opacity:n.opacity},stroke:{opacity:n.opacity}}),c.append(l);t.appendVisual(c)},plotBandSlot:function(n){return this.getSlot(n.from,n.to-1)},getSlot:function(n,t){var f=this,e=f.options,o=e.justified,s=f.box,h=f.majorAngles(),u=h.length,c,l=360/u,r,a;return e.reverse&&!o&&(n=(n+1)%u),n=p(i.floor(n),0,u-1),r=h[n],o&&(r=r-l/2,r<0&&(r+=360)),t=p(i.ceil(t||n),n,u-1),c=t-n+1,a=l*c,new g(s.center(),0,s.height()/2,r,a)},slot:function(n,t){var i=this.getSlot(n,t),r=i.startAngle+180,u=r+i.angle;return new e.Arc([i.c.x,i.c.y],{startAngle:r,endAngle:u,radiusX:i.r,radiusY:i.r})},pointCategoryIndex:function(n){for(var i=this,r=null,f=i.options.categories.length,u,t=0;t<f;t++)if(u=i.getSlot(t),u.containsPoint(n)){r=t;break}return r}}),ut,w,ft,b;r(v.fn,hi);ut={options:{majorGridLines:{visible:!0}},createPlotBands:function(){for(var t=this,h=t.options,c=h.plotBands||[],y=h.majorGridLines.type,l=t.plotArea.polarAxis,p=l.majorAngles(),r=l.box.center(),n,e,o,s,a=this._plotbandGroup=new f.Group({zIndex:-1}),v,i=0;i<c.length;i++)n=c[i],e={fill:{color:n.color,opacity:n.opacity},stroke:{opacity:n.opacity}},o=t.getSlot(n.from,n.to,!0),s=new g(r,r.y-o.y2,r.y-o.y1,0,360),v=y===u?dt.current.createRing(s,e):f.Path.fromPoints(t.plotBandPoints(s,p),e).close(),a.append(v);t.appendVisual(a)},plotBandPoints:function(n,t){for(var i=[],r=[],f=[n.c.x,n.c.y],o=new e.Circle(f,n.ir),s=new e.Circle(f,n.r),u=0;u<t.length;u++)i.push(o.pointAt(t[u])),r.push(s.pointAt(t[u]));return i.reverse(),i.push(i[0]),r.push(r[0]),r.concat(i)},createGridLines:function(n){var t=this,i=t.options,o=t.radarMajorGridLinePositions(),u=n.majorAngles(),f,e=n.box.center(),r=[];return i.majorGridLines.visible&&(r=t.renderGridLines(e,o,u,i.majorGridLines)),i.minorGridLines.visible&&(f=t.radarMinorGridLinePositions(),ct(r,t.renderGridLines(e,f,u,i.minorGridLines))),r},renderGridLines:function(n,t,i,r){for(var c,s,v={stroke:{width:r.width,color:r.color,dashType:r.dashType}},l=this.gridLinesVisual(),a,h,o=0;o<t.length;o++)if(c=n.y-t[o],c>0)if(a=new e.Circle([n.x,n.y],c),r.type===u)l.append(new f.Circle(a,v));else{for(h=new f.Path(v),s=0;s<i.length;s++)h.lineTo(a.pointAt(i[s]));h.close();l.append(h)}return l.children},getValue:function(n){var t=this,y=t.options,o=t.lineBox(),s=t.plotArea.polarAxis,r=s.majorAngles(),f=s.box.center(),h=n.distanceTo(f),c=h;if(y.majorGridLines.type!==u&&r.length>1){var p=n.x-f.x,w=n.y-f.y,e=(i.atan2(w,p)/a+540)%360;r.sort(function(n,t){return k(n,e)-k(t,e)});var b=k(r[0],r[1])/2,d=k(e,r[0]),v=90-b,g=180-d-v;c=h*(i.sin(g*a)/i.sin(v*a))}return t.axisType().fn.getValue.call(t,new l(o.x1,o.y2-c))}};w=o.extend({radarMajorGridLinePositions:function(){return this.getTickPositions(this.options.majorUnit)},radarMinorGridLinePositions:function(){var t=this,n=t.options,i=0;return n.majorGridLines.visible&&(i=n.majorUnit),t.getTickPositions(n.minorUnit,i)},axisType:function(){return o}});r(w.fn,ut);ft=wt.extend({radarMajorGridLinePositions:function(){var n=this,t=[];return n.traverseMajorTicksPositions(function(n){t.push(n)},n.options.majorGridLines),t},radarMinorGridLinePositions:function(){var n=this,t=[];return n.traverseMinorTicksPositions(function(n){t.push(n)},n.options.minorGridLines),t},axisType:function(){return wt}});r(ft.fn,ut);b=at.extend({init:function(n){var t=this;at.fn.init.call(t,n);n=t.options;n.minorUnit=n.minorUnit||t.options.majorUnit/2},options:{type:"polar",startAngle:0,reverse:!1,majorUnit:60,min:0,max:360,labels:{margin:nt(10)},majorGridLines:{color:"#000",visible:!0,width:1},minorGridLines:{color:"#aaa"}},getDivisions:function(n){return o.fn.getDivisions.call(this,n)-1},reflow:function(n){this.box=n;this.reflowLabels()},reflowLabels:function(){for(var t=this,u=t.options,f=u.labels,e=f.skip||0,o=f.step||1,s=new c,h=t.intervals(u.majorUnit,e,o),i=t.labels,r,n=0;n<i.length;n++)i[n].reflow(s),r=i[n].box,i[n].reflow(t.getSlot(h[n]).adjacentBox(0,r.width(),r.height()))},lineBox:function(){return this.box},intervals:function(n,i,r,u){var o=this,h=o.options,c=o.getDivisions(n),l=h.min,e,s=[],f;for(i=i||0,r=r||1,f=i;f<c;f+=r)e=(360+l+f*n)%360,u&&t.inArray(e,u)||s.push(e);return s},majorIntervals:function(){return this.intervals(this.options.majorUnit)},minorIntervals:function(){return this.intervals(this.options.minorUnit)},intervalAngle:function(n){return(540-n-this.options.startAngle)%360},majorAngles:v.fn.majorAngles,createLine:function(){return[]},majorGridLineAngles:function(n){var t=this.options.majorGridLines;return this.gridLineAngles(n,this.options.majorUnit,t.skip,t.step)},minorGridLineAngles:function(n,t){var i=this.options,r=i.minorGridLines,u=i.majorGridLines,f=t?this.intervals(i.majorUnit,u.skip,u.step):null;return this.gridLineAngles(n,this.options.minorUnit,r.skip,r.step,f)},createPlotBands:v.fn.createPlotBands,plotBandSlot:function(n){return this.getSlot(n.from,n.to)},getSlot:function(n,t){var r=this,i=r.options,u=i.startAngle,f=r.box,e;return n=p(n,i.min,i.max),t=p(t||n,n,i.max),i.reverse&&(n*=-1,t*=-1),n=(540-n-u)%360,t=(540-t-u)%360,t<n&&(e=n,n=t,t=e),new g(f.center(),0,f.height()/2,n,t-n)},slot:function(n,r){var c=this.options,l=360-c.startAngle,o=this.getSlot(n,r),u,f,s,h;return t.util.defined(r)||(r=n),s=i.min(n,r),h=i.max(n,r),c.reverse?(u=s,f=h):(u=360-h,f=360-s),u=(u+l)%360,f=(f+l)%360,new e.Arc([o.c.x,o.c.y],{startAngle:u,endAngle:f,radiusX:o.r,radiusY:o.r})},getValue:function(n){var t=this,r=t.options,u=t.box.center(),o=n.x-u.x,s=n.y-u.y,f=i.round(i.atan2(s,o)/a),e=r.startAngle;return r.reverse||(f*=-1,e*=-1),(f+e+360)%360},range:o.fn.range,labelsCount:o.fn.labelsCount,createAxisLabel:o.fn.createAxisLabel});r(b.fn,hi);var ci=yt.extend({options:{gap:1,spacing:0},reflow:function(n){for(var e=this,o=e.options,r=e.children,s=o.gap,h=o.spacing,f=r.length,l=f+s+h*(f-1),u=n.angle/l,i,c=n.startAngle+u*(s/2),t=0;t<f;t++)i=n.clone(),i.startAngle=c,i.angle=u,r[t].sector&&(i.r=r[t].sector.r),r[t].reflow(i),r[t].sector=i,c+=u+u*h}}),li=yt.extend({reflow:function(n){var i=this,u=i.options.isReversed,f=i.children,e=f.length,r,t,o=u?e-1:0,s=u?-1:1;for(i.box=new c,t=o;t>=0&&t<e;t+=s)r=f[t].sector,r.startAngle=n.startAngle,r.angle=n.angle}}),vr=pt.extend({init:function(n,t){pt.fn.init.call(this,n,null,t)},options:{overlay:{gradient:null},labels:{distance:10}}}),ai=vt.extend({pointType:function(){return vr},clusterType:function(){return ci},stackType:function(){return li},categorySlot:function(n,t){return n.getSlot(t)},pointSlot:function(n,t){var i=n.clone(),r=n.c.y;return i.r=r-t.y1,i.ir=r-t.y2,i},reflow:tr.fn.reflow,reflowPoint:function(n,t){n.sector=t;n.reflow()},options:{clip:!1,animation:{type:"pie"}},createAnimation:function(){this.options.animation.center=this.box.toRect().center();vt.fn.createAnimation.call(this)}}),et=ur.extend({options:{clip:!1},pointSlot:function(n,t){var r=n.c.y-t.y1,i=l.onCircle(n.c,n.middle(),r);return new c(i.x,i.y,i.x,i.y)},createSegment:function(n,t,i){var r,u,f=t.style;return u=f==tt?or:y,r=new u(n,t,i),n.length===t.data.length&&(r.options.closed=!0),r}}),yr=lt.extend({points:function(){return y.fn.points.call(this,this.stackPoints)}}),vi=gt.extend({closeFill:n.noop}),yi=et.extend({createSegment:function(n,t,i,r){var o=this,s=o.options,f=s.isStacked,e,u,h=(t.line||{}).style;return h===tt?(u=new vi(n,r,f,t,i),u.options.closed=!0):(f&&i>0&&r&&(e=r.linePoints.slice(0).reverse()),n.push(n[0]),u=new yr(n,e,t,i)),u},seriesMissingValues:function(n){return n.missingValues||it}}),pi=fr.extend({pointSlot:function(n,t){var r=n.c.y-t.y1,i=l.onCircle(n.c,n.startAngle,r);return new c(i.x,i.y,i.x,i.y)},options:{clip:!1}}),ot=er.extend({pointSlot:pi.fn.pointSlot,options:{clip:!1}}),pr=lt.extend({points:function(){var t=this,r=t.parent,u=r.plotArea,f=u.polarAxis,n=f.box.center(),e=t.stackPoints,i=y.fn.points.call(t,e);return i.unshift([n.x,n.y]),i.push([n.x,n.y]),i}}),wi=gt.extend({closeFill:function(n){var t=this._polarAxisCenter();n.lineTo(t.x,t.y)},_polarAxisCenter:function(){var n=this.parent,t=n.plotArea,i=t.polarAxis;return i.box.center()},strokeSegments:function(){var n=this._strokeSegments;if(!n){var i=this._polarAxisCenter(),r=new rr(!1),t=y.fn.points.call(this);t.push(i);n=this._strokeSegments=r.process(t);n.pop()}return n}}),bi=ot.extend({createSegment:function(n,t,i){var r=(t.line||{}).style;return r==tt?new wi(n,null,!1,t,i):new pr(n,[],t,i)},createMissingValue:function(n,i){var r;return t.hasValue(n.x)&&i!=lr&&(r={x:n.x,y:n.y},i==it&&(r.y=0)),r},seriesMissingValues:function(n){return n.missingValues||it},_hasMissingValuesGap:function(){for(var t=this.options.series,n=0;n<t.length;n++)if(this.seriesMissingValues(t[n])===ni)return!0},sortPoints:function(n){var u,r,i;if(n.sort(wr),this._hasMissingValuesGap())for(i=0;i<n.length;i++)r=n[i],r&&(u=r.value,t.hasValue(u.y)||this.seriesMissingValues(r.series)!==ni||delete n[i]);return n}}),st=d.extend({init:function(n,t){var i=this;i.valueAxisRangeTracker=new gi;d.fn.init.call(i,n,t)},render:function(){var n=this;n.addToLegend(n.series);n.createPolarAxis();n.createCharts();n.createValueAxis()},alignAxes:function(){var n=this.valueAxis,t=n.range(),u=n.options.reverse?t.max:t.min,i=n.getSlot(u),r=this.polarAxis.getSlot(0).c,f=n.box.translate(r.x-i.x1,r.y-i.y1);n.reflow(f)},createValueAxis:function(){var t=this,o=t.valueAxisRangeTracker,r=o.query(),n,u,s=t.valueAxisOptions({roundToMajorUnit:!1,zIndex:-1}),f,e;s.type===ar?(f=ft,e={min:.1,max:1}):(f=w,e={min:0,max:1});n=o.query(name)||r||e;n&&r&&(n.min=i.min(n.min,r.min),n.max=i.max(n.max,r.max));u=new f(n.min,n.max,s);t.valueAxis=u;t.appendAxis(u)},reflowAxes:function(){var n=this,e=n.options.plotArea,t=n.valueAxis,o=n.polarAxis,u=n.box,s=i.min(u.width(),u.height())*cr,h=nt(e.padding||{},s),r=u.clone().unpad(h),c=r.clone().shrink(0,r.height()/2),f;o.reflow(r);t.reflow(c);f=t.lineBox().height()-t.box.height();t.reflow(t.box.unpad({top:f}));n.axisBox=r;n.alignAxes(r)},backgroundBox:function(){return this.box}}),ki=st.extend({options:{categoryAxis:{categories:[]},valueAxis:{}},createPolarAxis:function(){var n=this,t;t=new v(n.options.categoryAxis);n.polarAxis=t;n.categoryAxis=t;n.appendAxis(t)},valueAxisOptions:function(n){var t=this;return t._hasBarCharts&&r(n,{majorGridLines:{type:u},minorGridLines:{type:u}}),t._isStacked100&&r(n,{roundToMajorUnit:!1,labels:{format:"P0"}}),r(n,t.options.valueAxis)},appendChart:ir.fn.appendChart,createCharts:function(){var n=this,t=n.filterVisibleSeries(n.series),i=n.panes[0];n.createAreaChart(s(t,[fi]),i);n.createLineChart(s(t,[oi]),i);n.createBarChart(s(t,[ei]),i)},chartOptions:function(n){var t={series:n},u=n[0],r,i;return u&&(r=this.filterVisibleSeries(n),i=u.stack,t.isStacked=i&&r.length>1,t.isStacked100=i&&i.type==="100%"&&r.length>1,t.isStacked100&&(this._isStacked100=!0)),t},createAreaChart:function(n,t){if(n.length!==0){var i=new yi(this,this.chartOptions(n));this.appendChart(i,t)}},createLineChart:function(n,t){if(n.length!==0){var i=new et(this,this.chartOptions(n));this.appendChart(i,t)}},createBarChart:function(n,t){var r,i,u;n.length!==0&&(r=n[0],i=this.chartOptions(n),i.gap=r.gap,i.spacing=r.spacing,u=new ai(this,i),this.appendChart(u,t),this._hasBarCharts=!0)},seriesCategoryAxis:function(){return this.categoryAxis},click:function(t,i){var f=this,e=t._eventCoordinates(i),o=new l(e.x,e.y),r,u;r=f.categoryAxis.getCategory(o);u=f.valueAxis.getValue(o);r!==null&&u!==null&&t.trigger(ti,{element:n(i.target),category:r,value:u})},createCrosshairs:n.noop}),di=st.extend({options:{xAxis:{},yAxis:{}},createPolarAxis:function(){var n=this,t;t=new b(n.options.xAxis);n.polarAxis=t;n.axisX=t;n.appendAxis(t)},valueAxisOptions:function(n){var t=this;return r(n,{majorGridLines:{type:u},minorGridLines:{type:u}},t.options.yAxis)},createValueAxis:function(){var n=this;st.fn.createValueAxis.call(n);n.axisY=n.valueAxis},appendChart:function(n,t){var i=this;i.valueAxisRangeTracker.update(n.yAxisRanges);d.fn.appendChart.call(i,n,t)},createCharts:function(){var n=this,t=n.filterVisibleSeries(n.series),i=n.panes[0];n.createLineChart(s(t,[ri]),i);n.createScatterChart(s(t,[ui]),i);n.createAreaChart(s(t,[ii]),i)},createLineChart:function(n,t){if(n.length!==0){var i=this,r=new ot(i,{series:n});i.appendChart(r,t)}},createScatterChart:function(n,t){if(n.length!==0){var i=this,r=new pi(i,{series:n});i.appendChart(r,t)}},createAreaChart:function(n,t){if(n.length!==0){var i=this,r=new bi(i,{series:n});i.appendChart(r,t)}},click:function(t,i){var f=this,e=t._eventCoordinates(i),o=new l(e.x,e.y),r,u;r=f.axisX.getValue(o);u=f.axisY.getValue(o);r!==null&&u!==null&&t.trigger(ti,{element:n(i.target),x:r,y:u})},createCrosshairs:n.noop});bt.current.register(di,si);bt.current.register(ki,rt);kt.current.register(si,["x","y"],["color"]);kt.current.register(rt,["value"],["color"]);t.DefaultAggregates.current.register(rt,{value:"max",color:"first"});r(t,{PolarAreaChart:bi,PolarAxis:b,PolarLineChart:ot,PolarPlotArea:di,RadarAreaChart:yi,RadarBarChart:ai,RadarCategoryAxis:v,RadarClusterLayout:ci,RadarLineChart:et,RadarNumericAxis:w,RadarPlotArea:ki,SplinePolarAreaSegment:wi,SplineRadarAreaSegment:vi,RadarStackLayout:li})})(window.kendo.jQuery)}(),function(){(function(n,t){var r=window.kendo,f=r.deepExtend,c=n.extend,d=r.isFunction,g=r.template,l=r.util,nt=l.append,s=r.drawing,u=r.geometry,i=r.dataviz,tt=r.drawing.Color,e=i.ChartElement,it=i.PieChartMixin,a=i.PlotAreaBase,rt=i.PlotAreaFactory,ut=i.Point2D,v=i.Box2D,y=i.SeriesBinder,ft=i.TextBox,p=i.autoFormat,et=i.evalOptions,w=l.limitValue,ot=i.seriesTotal,b="funnel",st="black",k="white",ht=a.extend({render:function(){var n=this,t=n.series;n.createFunnelChart(t)},createFunnelChart:function(n){var i=this,t=n[0],r=new h(i,{series:n,legend:i.options.legend,neckRatio:t.neckRatio,dynamicHeight:t.dynamicHeight,dynamicSlope:t.dynamicSlope,segmentSpacing:t.segmentSpacing,highlight:t.highlight});i.appendChart(r)},appendChart:function(n,t){a.fn.appendChart.call(this,n,t);nt(this.options.legend.items,n.legendItems)}}),h=e.extend({init:function(n,t){var i=this;e.fn.init.call(i,t);i.plotArea=n;i.points=[];i.labels=[];i.legendItems=[];i.render()},options:{neckRatio:.3,width:300,dynamicSlope:!1,dynamicHeight:!0,segmentSpacing:0,labels:{visible:!1,align:"center",position:"center"}},formatPointValue:function(n,t){return p(t,n.value)},render:function(){var e=this,v=e.options,l=e.plotArea.options.seriesColors||[],p=l.length,r=v.series[0],o,n,s=r.data,a,u,i,h,c;if(s)for(a=ot(r),i=0;i<s.length;i++)(o=y.current.bindPoint(r,i),u=o.valueFields.value,u!==null&&u!==t)&&(n=o.fields,d(r.color)||(r.color=n.color||l[i%p]),n=f({index:i,owner:e,series:r,category:n.category,dataItem:s[i],percentage:Math.abs(u)/a,visibleInLegend:n.visibleInLegend,visible:n.visible},n),h=e.createSegment(u,n),c=e.createLabel(u,n),h&&c&&h.append(c))},evalSegmentOptions:function(n,t,i){var r=i.series;et(n,{value:t,series:r,dataItem:i.dataItem,index:i.index},{defaults:r._defaults,excluded:["data","toggle","visual"]})},createSegment:function(n,t){var r=this,i,u=f({},t.series);return r.evalSegmentOptions(u,n,t),r.createLegendItem(n,u,t),t.visible!==!1?(i=new o(n,u,t),c(i,t),r.append(i),r.points.push(i),i):void 0},createLabel:function(n,t){var u=this,e=t.series,c=t.dataItem,i=f({},u.options.labels,e.labels),r=n,o,s,h;if(i.visible)return i.template?(s=g(i.template),r=s({dataItem:c,value:n,percentage:t.percentage,category:t.category,series:e})):i.format&&(r=p(i.format,r)),i.color||i.align!=="center"||(h=new tt(e.color).percBrightness(),i.color=h>180?st:k),u.evalSegmentOptions(i,n,t),o=new ft(r,f({vAlign:i.position},i)),u.labels.push(o),o},labelPadding:function(){for(var i=this.labels,f,r,u,n={left:0,right:0},t=0;t<i.length;t++)f=i[t],r=f.options.align,r!=="center"&&(u=i[t].box.width(),r==="left"?n.left=Math.max(n.left,u):n.right=Math.max(n.right,u));return n},reflow:function(t){var d=this,l=d.options,c=d.points,a=c.length,g=l.neckRatio<=1,r,v,p,e,y,o,i=t.clone().unpad(d.labelPadding()),f=i.width(),s=0,h=g?0:(f-f/l.neckRatio)/2,nt=l.segmentSpacing,et=l.dynamicSlope,b=i.height()-nt*(a-1),ot=g?l.neckRatio*f:f,tt,k,it,rt,ft,ut;if(a){if(et)for(tt=c[0],k=tt,n.each(c,function(n,t){t.percentage>k.percentage&&(k=t)}),p=tt.percentage/k.percentage*f,h=(f-p)/2,r=0;r<a;r++)y=c[r].percentage,it=c[r+1],rt=it?it.percentage:y,e=c[r].points=[],v=l.dynamicHeight?b*y:b/a,o=(f-p*(rt/y))/2,o=w(o,0,f),e.push(new u.Point(i.x1+h,i.y1+s)),e.push(new u.Point(i.x1+f-h,i.y1+s)),e.push(new u.Point(i.x1+f-o,i.y1+v+s)),e.push(new u.Point(i.x1+o,i.y1+v+s)),h=o,s+=v+nt,p*=rt/y,p=w(p,0,f);else for(ft=g?f:f-h*2,ut=(ft-ot)/2,r=0;r<a;r++)e=c[r].points=[],y=c[r].percentage,o=l.dynamicHeight?ut*y:ut/a,v=l.dynamicHeight?b*y:b/a,e.push(new u.Point(i.x1+h,i.y1+s)),e.push(new u.Point(i.x1+f-h,i.y1+s)),e.push(new u.Point(i.x1+f-h-o,i.y1+v+s)),e.push(new u.Point(i.x1+h+o,i.y1+v+s)),h+=o,s+=v+nt;for(r=0;r<a;r++)c[r].reflow(t)}}}),o;f(h.fn,it);o=e.extend({init:function(n,t,i){var r=this;e.fn.init.call(r,t);r.value=n;r.options.index=i.index},options:{color:k,border:{width:1}},reflow:function(n){var i=this,t=i.points,r=i.children[0];i.box=new v(t[0].x,t[0].y,t[1].x,t[2].y);r&&r.reflow(new v(n.x1,t[0].y,n.x2,t[2].y))},createVisual:function(){var n=this,t=n.options,i;e.fn.createVisual.call(this);i=t.visual?t.visual({category:n.category,dataItem:n.dataItem,value:n.value,series:n.series,percentage:n.percentage,points:n.points,options:t,createVisual:function(){return n.createPath()}}):n.createPath();i&&this.visual.append(i)},createPath:function(){var n=this.options,t=n.border;return s.Path.fromPoints(this.points,{fill:{color:n.color,opacity:n.opacity},stroke:{color:t.color,opacity:t.opacity,width:t.width}}).close()},createHighlight:function(n){return s.Path.fromPoints(this.points,n)},highlightVisual:function(){return this.visual.children[0]},highlightVisualArgs:function(){var n=s.Path.fromPoints(this.points).close();return{options:this.options,path:n}},highlightOverlay:function(n,t){var u=this.options,i=u.highlight||{};if(i.visible!==!1){var r=i.border||{},f=c({},t,{fill:i.color,stroke:r.color,strokeOpacity:r.opacity,strokeWidth:r.width,fillOpacity:i.opacity});return n.createPolyline(this.points,!0,f)}},tooltipAnchor:function(n){var t=this.box;return new ut(t.center().x-n/2,t.y1)},formatValue:function(n){var t=this;return t.owner.formatPointValue(t,n)}});f(o.fn,i.PointEventsMixin);rt.current.register(ht,[b]);y.current.register([b],["value"],["category","color","visibleInLegend","visible"]);f(i,{FunnelChart:h,FunnelSegment:o})})(window.kendo.jQuery)}(),function(){(function(n,t){function li(n,t){var i=n.box,s=n.children[0].box,r=t.border||{},y=t.background||"",f=new e,l,a,v,o;return v=h.fromRect(new c([i.x1,i.y1],[i.width(),i.height()]),{stroke:{}}),o=new ki(n.text,new u(s.x1,s.y1),{font:t.font,fill:{color:t.color}}),a=vi(o.bbox().clone(),t.padding),l=h.fromRect(a,{stroke:{color:r.width?r.color:"",width:r.width,dashType:r.dashType,lineJoin:"round",lineCap:"round"},fill:{color:y}}),f.append(v),f.append(l),f.append(o),f}function ai(n,t,r){var u=b(n.from)?n.from:nr,f=b(n.to)?n.to:gi;return n.from=i.max(i.min(f,u),t),n.to=i.min(i.max(f,u),r),n}function vi(n,t){var r=n.getOrigin(),u=n.getSize(),i=k(t);return n.setOrigin([r.x-i.left,r.y-i.top]),n.setSize([u.width+(i.left+i.right),u.height+(i.top+i.bottom)]),n}function yi(n,t){var i=k(t);return i.left=-i.left,i.top=-i.top,i.right=-i.right,i.bottom=-i.bottom,vi(n,i)}var i=Math,a=window.kendo,at=a.util,ut=a.ui.Widget,f=a.deepExtend,r=a.dataviz,vt=r.autoMajorUnit,pi=r.ChartElement,yt=r.NumericAxis,pt=r.Axis,v=r.Box2D,wi=a.Class,b=at.defined,bi=at.isNumber,tt=r.interpolateValue,k=r.getSpacing,d=r.round,s=r.geometry,o=r.drawing,u=s.Point,e=o.Group,h=o.Path,c=s.Rect,ki=o.Text,wt=150,bt=250,di="arrow",kt="arrowPointer",g="barPointer",y="#000",it=r.COORD_PRECISION,gi=Number.MAX_VALUE,nr=-Number.MAX_VALUE,dt=200,p=.5,gt=200,tr=60,ir=60,rr=5,ni=i.PI/180,rt=180,l="inside",ft="linear",ti="needle",et="outside",ii="radialPointer",ot="x",st="y",ht=wi.extend({init:function(n,t){var r=this,u=n.options;pi.fn.init.call(r,t);t=r.options;t.fill=t.color;r.scale=n;t.value=b(t.value)?i.min(i.max(t.value,u.min),u.max):u.min},options:{color:y},value:function(n){var u=this,r=u.options,e=r.value,f=u.scale.options;if(arguments.length===0)return e;r._oldValue=r._oldValue!==t?r.value:f.min;r.value=i.min(i.max(n,f.min),f.max);u.elements&&u.repaint()}}),ri=ht.extend({options:{shape:ti,cap:{size:.05},arrow:{width:16,height:14},animation:{type:ii,duration:wt}},setRadius:function(n){var t=this;n&&(t.elements.clear(),t.render(t.parent,t.center,n))},setAngle:function(n){this.elements.transform(s.transform().rotate(n,this.center))},repaint:function(){var n=this,i=n.scale,t=n.options,u=i.slotAngle(t._oldValue),r=i.slotAngle(t.value);t.animation.transitions===!1?n.setAngle(r):new ci(n.elements,f(t.animation,{oldAngle:u,newAngle:r})).play()},render:function(){var n=this,r=n.scale,u=r.arc.center,i=n.options,t=new e;return i.animation!==!1&&f(i.animation,{startAngle:0,center:u,reverse:r.options.reverse}),i.shape===ti?t.append(n._renderNeedle(),n._renderCap()):t.append(n._renderArrow()),n.elements=t,n.setAngle(ni),t},reflow:function(n){var t=this,i=t.center=n.center,f=t.radius=n.getRadiusX(),r=t.capSize=Math.round(f*t.options.cap.size);t.bbox=c.fromPoints(new u(i.x-r,i.y-r),new u(i.x+r,i.y+r))},_renderNeedle:function(){var n=this,u=n.options,f=n.scale.options.minorTicks.size,t=n.center,i=u.color,r=new h({fill:{color:i},stroke:{color:i,width:p}});return r.moveTo(t.x+n.radius-f,t.y).lineTo(t.x,t.y-n.capSize/2).lineTo(t.x,t.y+n.capSize/2).close(),r},_renderCap:function(){var n=this,t=n.options,i=t.cap.color||t.color,r=new s.Circle(n.center,n.capSize);return new o.Circle(r,{fill:{color:i},stroke:{color:i}})}}),ui=yt.extend({init:function(n){var t=this;t.options=f({},t.options,n);t.options.majorUnit=t.options.majorUnit||vt(t.options.min,t.options.max);t.options.minorUnit=t.options.minorUnit||t.options.majorUnit/10;pt.fn.init.call(t,t.options)},options:{min:0,max:100,majorTicks:{size:15,align:l,color:y,width:p,visible:!0},minorTicks:{size:10,align:l,color:y,width:p,visible:!0},startAngle:-30,endAngle:210,labels:{position:l,padding:2}},render:function(n,t){var i=this,r=i.renderArc(n,t);i.bbox=r.bbox();i.labelElements=i.renderLabels();i.ticks=i.renderTicks();i.ranges=i.renderRanges()},reflow:function(n){var r=this,u=n.center(),f=i.min(n.height(),n.width())/2;if(r.bbox!==t)r.bbox=r.arc.bbox(),r.radius(r.arc.getRadiusX()),r.repositionRanges(),r.renderLabels();else return r.render(u,f)},slotAngle:function(n){var t=this.options,r=t.startAngle,o=t.reverse,u=t.endAngle-r,i=t.min,f=t.max,e;return e=o?t.endAngle-(n-i)/(f-i)*u:(n-i)/(f-i)*u+r,e+rt},renderLabels:function(){var n=this,f=n.options,lt=f.majorTicks.size,y=n.arc.clone(),a=y.getRadiusX(),at=n.tickAngles(y,f.majorUnit),st=n.labels,vt=st.length,b=f.labels,ht=b.padding,k=a*.05,yt=f.rangeSize=f.rangeSize||a*.1,pt=f.ranges||[],p,w,d,g,o,nt,v,tt,it,ut,ct=new e,h,ft,et,ot;for(n.options.rangeDistance!==t?k=n.options.rangeDistance:n.options.rangeDistance=k,b.position===l&&(a-=lt,pt.length&&n.labelElements===t&&(a-=yt+k),y.setRadiusX(a).setRadiusY(a)),v=0;v<vt;v++)o=st[v],p=o.box.width()/2,w=o.box.height()/2,g=at[v],d=(g-rt)*ni,ut=b.position===l,nt=y.pointAt(g),tt=nt.x+i.cos(d)*(p+ht)*(ut?1:-1),it=nt.y+i.sin(d)*(w+ht)*(ut?1:-1),o.reflow(new r.Box2D(tt-p,it-w,tt+p,it+w)),ft=new u(o.box.x1,o.box.y1),n.labelElements===t?(h=li(o,f.labels),ct.append(h)):(h=n.labelElements.children[v],et=h.bbox().origin,ot=h.transform()||s.transform(),ot.translate(ft.x-et.x,ft.y-et.y),h.transform(ot)),n.bbox=c.union(n.bbox,h.bbox());return ct},repositionRanges:function(){var n=this,i=n.ranges.children,f=n.options.rangeSize,e=n.options.rangeDistance,r,u,t;if(i.length>0){for(r=n.getRangeRadius(),n.options.labels.position===l&&(r+=f+e),u=r+f/2,t=0;t<i.length;t++)i[t]._geometry.setRadiusX(u).setRadiusY(u);n.bbox=c.union(n.bbox,n.ranges.bbox())}},renderRanges:function(){var n=this,p=n.arc,c=new e,u,f,l=n.rangeSegments(),a=l.length,v=n.options.reverse,i=n.options.rangeSize,w=n.options.rangeDistance,t,h,y,r;if(a)for(h=n.getRangeRadius(),n.radius(n.radius()-i-w),r=0;r<a;r++)t=l[r],u=n.slotAngle(t[v?"to":"from"]),f=n.slotAngle(t[v?"from":"to"]),f-u!=0&&(y=new s.Arc(p.center,{radiusX:h+i/2,radiusY:h+i/2,startAngle:u,endAngle:f}),c.append(new o.Arc(y,{stroke:{width:i,color:t.color,opacity:t.opacity}})));return c},rangeSegments:function(){function e(n,t,i,r){return{from:n,to:t,color:i,opacity:r}}var v=this,r=v.options,o=r.ranges||[],s=o.length,n,h,c=r.rangePlaceholderColor,i=[],t,l=r.min,a=r.max,u,f;if(s)for(i.push(e(l,a,c)),u=0;u<s;u++)for(n=ai(o[u],l,a),h=i.length,f=0;f<h;f++)if(t=i[f],t.from<=n.from&&n.from<=t.to){i.push(e(n.from,n.to,n.color,n.opacity));t.from<=n.to&&n.to<=t.to&&i.push(e(n.to,t.to,c,n.opacity));t.to=n.from;break}return i},getRangeRadius:function(){var t=this,n=t.options,u=n.majorTicks.size,i=n.rangeSize,f=n.rangeDistance,r=t.arc;return n.labels.position===et?r.getRadiusX()-u-f-i:r.getRadiusX()-i},renderArc:function(n,t){var i=this,r=i.options;return i.arc=new s.Arc(n,{radiusX:t,radiusY:t,startAngle:r.startAngle+rt,endAngle:r.endAngle+rt})},renderTicks:function(){function l(n,t,i,r){var s=new e,o=n.center,a=n.getRadiusX(),f,c,l,v=r.visible;if(v)for(f=0;f<t.length;f++)c=n.pointAt(t[f]),l=new u(o.x+a-r.size,o.y).rotate(t[f],o),s.append(new h({stroke:{color:r.color,width:r.width}}).moveTo(c).lineTo(l));return s}var n=this,r=n.arc,t=n.options,a=t.labels.position,f=new e,o=t.majorTicks.size,s=t.minorTicks.size,i=r.clone(),c=i.getRadiusX();return n.majorTickAngles=n.tickAngles(r,t.majorUnit),n.majorTicks=l(i,n.majorTickAngles,t.majorUnit,t.majorTicks),f.append(n.majorTicks),n._tickDifference=o-s,a===et&&i.setRadiusX(c-o+s).setRadiusY(c-o+s),n.minorTickAngles=n.normalizeTickAngles(n.tickAngles(r,t.minorUnit)),n.minorTicks=l(i,n.minorTickAngles,t.minorUnit,t.minorTicks,t.majorUnit),f.append(n.minorTicks),f},normalizeTickAngles:function(n){for(var r=this,i=r.options,u=i.majorUnit/i.minorUnit,t=n.length-1;t>=0;t--)t%u==0&&n.splice(t,1);return n},tickAngles:function(n,t){var h=this,r=h.options,c=r.reverse,l=r.max-r.min,o=n.endAngle-n.startAngle,i=n.startAngle,s=l/t,u=o/s,f=[],e;for(c&&(i+=o,u=-u),e=0;e<s;e++)f.push(d(i,it)),i+=u;return d(i)<=n.endAngle&&f.push(i),f},radius:function(n){var t=this;if(n)t.arc.setRadiusX(n).setRadiusY(n),t.repositionTicks(t.majorTicks.children,t.majorTickAngles),t.repositionTicks(t.minorTicks.children,t.minorTickAngles,!0);else return t.arc.getRadiusX()},repositionTicks:function(n,t,i){var u=this,e=i?u._tickDifference||0:0,f=u.arc,o=f.getRadiusX(),r;for(i&&u.options.labels.position===et&&e!==0&&(f=u.arc.clone(),f.setRadiusX(o-e).setRadiusY(o-e)),r=0;r<n.length;r++){var h=f.pointAt(t[r]),c=n[r].segments,l=h.x-c[0].anchor().x,a=h.y-c[0].anchor().y;n[r].transform((new s.Transformation).translate(l,a))}}}),w=ut.extend({init:function(t,i){var u=this,e,h,s,l=r.ui.themes||{},c,o;if(a.destroy(t),n(t).empty(),ut.fn.init.call(u,t),u.wrapper=u.element,u._originalOptions=f({},i),e=f({},u.options,i),s=e.theme,c=l[s]||l[s.toLowerCase()],h=s&&c?c.gauge:{},u.options=f({},h,e),n.isArray(e.pointer))for(o=0;o<e.pointer.length;o++)u.options.pointer[o]=f({},h.pointer,e.pointer[o]);u.element.addClass("k-gauge");u.surface=u._createSurface();u.redraw()},options:{plotArea:{},theme:"default",renderAs:"",pointer:{},scale:{},gaugeArea:{}},destroy:function(){this.surface.destroy();ut.fn.destroy.call(this)},value:function(n){var t=this,i=t.pointers[0];if(arguments.length===0)return i.value();i.value(n);t._setValueOptions(n)},_draw:function(){var n=this.surface;n.clear();n.draw(this._visuals)},exportVisual:function(){return this._visuals},allValues:function(t){var u=this,r=u.pointers,f=[],i;if(arguments.length===0){for(i=0;i<r.length;i++)f.push(r[i].value());return f}if(n.isArray(t))for(i=0;i<t.length;i++)bi(t[i])&&r[i].value(t[i]);u._setValueOptions(t)},_setValueOptions:function(n){var i=[].concat(this.options.pointer),t;for(n=[].concat(n),t=0;t<n.length;t++)i[t].value=n[t]},_resize:function(){var n=this,i=n.options.transitions,t;for(n.options.transitions=!1,t=0;t<n.pointers.length;t++)n.pointers[t].options.animation.transitions=!1;for(n.redraw(),n.options.transitions=i,t=0;t<n.pointers.length;t++)n.pointers[t].options.animation.transitions=i},redraw:function(){var n=this,t=f(n._getSize(),n.options.gaugeArea),r=new c([0,0],[t.width,t.height]),i;n.surface.clear();n.gaugeArea=n._createGaugeArea();n.surface.element.css({width:t.width,height:t.height});n._createModel();i=yi(r.bbox(),n._gaugeAreaMargin);n.reflow(i)},_createGaugeArea:function(){var t=this,i=t.options.gaugeArea,u=t.surface.size(),n=i.border||{},r=new c([0,0],[u.width,u.height]);return t._gaugeAreaMargin=i.margin||rr,n.width>0&&(r=yi(r,n.width)),h.fromRect(r,{stroke:{color:n.width?n.color:"",width:n.width,dashType:n.dashType,lineJoin:"round",lineCap:"round"},fill:{color:i.background}})},_createSurface:function(){var i=this,r=i.options,t=i._getSize(),u;return t=r.gaugeArea?f(t,r.gaugeArea):t,u=n("<div><\/div>").appendTo(i.element).css({width:t.width,height:t.height}),new o.Surface.create(u,{type:r.renderAs})},getSize:function(){return this._getSize()},_getSize:function(){var r=this,i=r.element,n=i.width(),t=i.height();return n||(n=gt),t||(t=dt),{width:n,height:t}}}),fi=w.extend({init:function(n,t){var i=this;w.fn.init.call(i,n,t);a.notify(i,r.ui)},options:{name:"RadialGauge",transitions:!0,gaugeArea:{background:""}},reflow:function(n){var t=this,r=t.pointers,i;for(t.scale.reflow(n),t._initialPlotArea=t.scale.bbox,i=0;i<r.length;i++)r[i].reflow(t.scale.arc),t._initialPlotArea=c.union(t._initialPlotArea,r[i].bbox);t.fitScale(n);t.alignScale(n);t._buildVisual(t.gaugeArea,r,t.scale);t._draw()},_buildVisual:function(n,t,i){var r=new e,u,f;for(r.append(n),r.append(i.ticks),r.append(i.ranges),f=0;f<t.length;f++)u=t[f],u.render(),r.append(u.elements),u.value(u.options.value);r.append(i.labelElements);this._visuals=r},fitScale:function(n){for(var r=this,v=r.scale,h=v.arc,y=r._initialPlotArea,l=i.abs(r.getDiff(y,n)),o=d(l,it),s=d(-l,it),u,f,t,e,a,c=0,p=0;p++<100;){if(c=a===t?c+1:0,c>5)break;if(o!=e&&(u=r.getPlotBox(o,n,h),0<=u&&u<=2))break;if(s!=e&&(t=r.getPlotBox(s,n,h),0<=t&&t<=2))break;if(e=u>0&&t>0?o*2:u<0&&t<0?s*2:d((o+s)/2||1,it),f=r.getPlotBox(e,n,h),0<=f&&f<=2)break;a=t;f>0?(s=e,t=f):(o=e,u=f)}},getPlotBox:function(n,t,i){var r=this,f=r.scale,e=r.pointers,o=i.getRadiusX(),u;for(i=i.clone(),i.setRadiusX(o+n).setRadiusY(o+n),f.arc=i,f.reflow(t),r.plotBbox=f.bbox,u=0;u<e.length;u++)e[u].reflow(i),r.plotBbox=c.union(r.plotBbox,e[u].bbox);return r.getDiff(r.plotBbox,t)},getDiff:function(n,t){return i.min(t.width()-n.width(),t.height()-n.height())},alignScale:function(n){var r=this,f=r.plotBbox.center(),e=n.center(),o=f.x-e.x,s=f.y-e.y,t=r.scale,u=r.pointers,i;for(t.arc.center.x-=o,t.arc.center.y-=s,t.reflow(n),i=0;i<u.length;i++)u[i].reflow(t.arc),r.plotBbox=c.union(t.bbox,u[i].bbox)},_createModel:function(){var i=this,u=i.options,t=u.pointer,o=i.scale=new ui(u.scale),e,r;for(i.pointers=[],t=n.isArray(t)?t:[t],r=0;r<t.length;r++)e=new ri(o,f({},t[r],{animation:{transitions:u.transitions}})),i.pointers.push(e)}}),ei=w.extend({init:function(n,t){var i=this;w.fn.init.call(i,n,t);a.notify(i,r.ui)},options:{name:"LinearGauge",transitions:!0,gaugeArea:{background:""},scale:{vertical:!0}},reflow:function(n){var t=this,f=t.pointers,u=n.origin.x,o=n.origin.y,e=new r.Box2D(u,u,u+n.width(),o+n.height()),i;for(t.scale.reflow(e),i=0;i<f.length;i++)f[i].reflow();t.bbox=t._getBox(e);t._alignElements();t._shrinkElements();t._buildVisual();t._draw()},_buildVisual:function(){var n=this,t=new e,f=n.scale.render(),u=n.pointers,i,r;for(t.append(n.gaugeArea),t.append(f),r=0;r<u.length;r++)i=u[r],t.append(i.render()),i.value(i.options.value);n._visuals=t},_createModel:function(){var i=this,e=i.options,t=e.pointer,o=i.scale=new oi(e.scale),s,r,u;for(i.pointers=[],t=n.isArray(t)?t:[t],u=0;u<t.length;u++)r=f({},t[u],{animation:{transitions:e.transitions}}),s=r.shape===di?new si(o,r):new hi(o,r),i.pointers.push(s)},_getSize:function(){var i=this,r=i.element,n=r.width(),t=r.height(),u=i.options.scale.vertical;return n||(n=u?tr:gt),t||(t=u?dt:ir),{width:n,height:t}},_getBox:function(n){for(var e=this,o=e.scale,u=e.pointers,r=n.center(),t=u[0].box.clone().wrap(o.box),i,f=0;f<u.length;f++)t.wrap(u[f].box.clone());return o.options.vertical?(i=t.width()/2,t=new v(r.x-i,n.y1,r.x+i,n.y2)):(i=t.height()/2,t=new v(n.x1,r.y-i,n.x2,r.y+i)),t},_alignElements:function(){for(var f=this,r=f.scale,u=f.pointers,e=r.box,o=u[0].box.clone().wrap(r.box),t=f.bbox,i,n=0;n<u.length;n++)o.wrap(u[n].box.clone());for(r.options.vertical?(i=t.center().x-o.center().x,r.reflow(new v(e.x1+i,t.y1,e.x2+i,t.y2))):(i=t.center().y-o.center().y,r.reflow(new v(t.x1,e.y1+i,t.x2,e.y2+i))),n=0;n<u.length;n++)u[n].reflow(f.bbox)},_shrinkElements:function(){for(var f=this,e=f.scale,r=f.pointers,u=e.box.clone(),t=e.options.vertical?"y":"x",o=r[0].box,n=0;n<r.length;n++)o.wrap(r[n].box.clone());for(u[t+1]+=i.max(u[t+1]-o[t+1],0),u[t+2]-=i.max(o[t+2]-u[t+2],0),e.reflow(u),n=0;n<r.length;n++)r[n].reflow(f.bbox)}}),oi=yt.extend({init:function(n){var t=this;t.options=f({},t.options,n);t.options=f({},t.options,{labels:{mirror:t.options.mirror}});t.options.majorUnit=t.options.majorUnit||vt(t.options.min,t.options.max);pt.fn.init.call(t,t.options);t.options.minorUnit=t.options.minorUnit||t.options.majorUnit/10},options:{min:0,max:50,majorTicks:{size:15,align:l,color:y,width:p,visible:!0},minorTicks:{size:10,align:l,color:y,width:p,visible:!0},line:{width:p},labels:{position:l,padding:2},mirror:!1,_alignLines:!1},render:function(){var n=this,t=n.elements=new e,i=n.renderLabels(),r=n.renderLine(),u=n.renderTicks(),f=n.renderRanges();return t.append(r,i,u,f),t},renderRanges:function(){var u=this,n=u.options,w=n.min,b=n.max,l=n.ranges||[],o=n.vertical,a=n.labels.mirror,v=new e,y=l.length,p=n.rangeSize||n.minorTicks.size/2,t,s,i,r,f;if(y)for(f=0;f<y;f++)t=ai(l[f],w,b),s=u.getSlot(t.from,t.to),i=o?u.lineBox():s,r=o?s:u.lineBox(),o?i.x1-=p*(a?-1:1):r.y2+=p*(a?-1:1),v.append(h.fromRect(new c([i.x1,r.y1],[i.x2-i.x1,r.y2-r.y1]),{fill:{color:t.color,opacity:t.opacity},stroke:{}}));return v},renderLabels:function(){for(var t=this,u=t.options,i=t.labels,r=new e,n=0;n<i.length;n++)r.append(li(i[n],u.labels));return r},renderLine:function(){var r=this,f=r.options,n=f.line,t=r.lineBox(),i,u=new e;return n.width>0&&n.visible&&(i=new h({stroke:{color:n.color,dashType:n.dashType,width:n.width}}),i.moveTo(t.x1,t.y1).lineTo(t.x2,t.y2),u.append(i)),u},renderTicks:function(){function s(n,f){var e,s=n.length;if(f.visible)for(e=f.skip;e<s;e+=f.step)e%f.skipUnit!=0&&(r.tickX=o?i.x2:i.x2-f.size,r.tickY=o?i.y1-f.size:i.y1,r.position=n[e],u.append(t.renderAxisTick(r,f)))}var t=this,u=new e,n=t.options,i=t.lineBox(),o=n.labels.mirror,h=n.majorTicks.visible?n.majorUnit:0,r={_alignLines:n._alignLines,vertical:n.vertical};return s(t.getMajorTickPositions(),n.majorTicks),s(t.getMinorTickPositions(),f({},{skipUnit:h/n.minorUnit},n.minorTicks)),u},renderAxisTick:function(n,t){var e=n.tickX,o=n.tickY,i=n.position,r,f;return n.vertical?(r=new u(e,i),f=new u(e+t.size,i)):(r=new u(i,o),f=new u(i,o+t.size)),new h({stroke:{color:t.color,width:t.width}}).moveTo(r).lineTo(f)}}),nt=ht.extend({init:function(n,t){var i=this;ht.fn.init.call(i,n,t);i.options=f({track:{visible:b(t.track)}},i.options)},options:{shape:g,track:{border:{width:1}},color:y,border:{width:1},opacity:1,margin:k(3),animation:{type:g},visible:!0},reflow:function(){var u=this,r=u.options,h=u.scale,n=h.lineBox(),o=r.track.size||r.size,s=r.size/2,f=h.options.mirror,l=k(r.margin),a=h.options.vertical,t=a?l[f?"left":"right"]:l[f?"bottom":"top"],c,e,i;t=f?-t:t;a?(i=new v(n.x1+t,n.y1,n.x1+t,n.y2),f?i.x1-=o:i.x2+=o,r.shape!==g&&(e=new v(n.x2+t,n.y1-s,n.x2+t,n.y2+s),c=e)):(i=new v(n.x1,n.y1-t,n.x2,n.y1-t),f?i.y2+=o:i.y1-=o,r.shape!==g&&(e=new v(n.x1-s,n.y1-t,n.x2+s,n.y1-t),c=e));u.trackBox=i;u.pointerRangeBox=e;u.box=c||i.clone().pad(r.border.width)},getElementOptions:function(){var n=this.options;return{fill:{color:n.color,opacity:n.opacity},stroke:b(n.border)?{color:n.border.width?n.border.color||n.color:"",width:n.border.width,dashType:n.border.dashType,opacity:n.opacity}:null}},_margin:function(){var n=this,u=n.options,t=n.scale,i=t.options.mirror,r=k(u.margin),f=t.options.vertical;return f?r[i?"left":"right"]:r[i?"bottom":"top"]}}),si=nt.extend({init:function(n,i){nt.fn.init.call(this,n,i);this.options.size===t&&(this.options.size=this.scale.options.majorTicks.size*.6)},pointerShape:function(){var f=this,h=f.options,t=f.scale,i=h.size,c=t.options.vertical,n=i/2,e=t.options.mirror?-1:1,o=t.options.reverse,s,r;return c?(s=o?"y2":"y1",r=[new u(0,0-n),new u(0-e*i,0),new u(0,0+n)]):(s=o?"x1":"x2",r=[new u(0-n,0),new u(0,0+e*i),new u(0+n,0)]),r},repaint:function(){var t=this,i=t.scale,n=t.options,r=new ct(t.elements,f(n.animation,{vertical:i.options.vertical,mirror:i.options.mirror,margin:t._margin(n.margin),from:i.getSlot(n._oldValue),to:i.getSlot(n.value)}));n.animation.transitions===!1&&(r.options.duration=0);r.setup();r.play()},render:function(){var n=this,i=n.options,t=new e,o=n.scale,f=n.getElementOptions(),r=n.pointerShape(i.value),u;return i.animation.type=kt,t=new h({stroke:f.stroke,fill:f.fill}).moveTo(r[0]).lineTo(r[1]).lineTo(r[2]).close(),u=o.getSlot(i.value),t.transform(s.transform().translate(u.x1,u.y1)),n.elements=t,t}}),hi=nt.extend({init:function(n,i){nt.fn.init.call(this,n,i);this.options.size===t&&(this.options.size=this.scale.options.majorTicks.size*.3)},pointerShape:function(n){var a=this,w=a.options,r=a.scale,f=r.options.vertical,b=r.options.mirror,v=b==f?-1:1,e=w.size*v,y=r.getSlot(r.options.min),p=r.getSlot(n),o=f?st:ot,s=f?ot:st,h=a._margin()*v,i=new u,t,c,l;return i[o]=y[o+"1"],i[s]=y[s+"1"],t=new u,t[o]=p[o+"1"],t[s]=p[s+"1"],f?(i.translate(h,0),t.translate(h,0)):(i.translate(0,h),t.translate(0,h)),c=t.clone(),l=i.clone(),f?(c.translate(e,0),l.translate(e,0)):(c.translate(0,e),l.translate(0,e)),[i,t,c,l]},repaint:function(){var t=this,u=t.scale,i=t.options,n=t.pointerShape(i.value),e=t.elements.children[0],o=t.pointerShape(i._oldValue),r;e.moveTo(n[0]).lineTo(n[1]).lineTo(n[2]).lineTo(n[3]).close();r=new lt(e,f(i.animation,{reverse:u.options.reverse,vertical:u.options.vertical,oldPoints:[o[1],o[2]],newPoints:[n[1],n[2]]}));i.animation.transitions===!1&&(r.options.duration=0);r.setup();r.play()},render:function(){var t=this,n=new e,i=t.getElementOptions(),r=new h({stroke:i.stroke,fill:i.fill});return n.append(r),t.elements=n,n}}),ci=o.Animation.extend({init:function(n,t){o.Animation.fn.init.call(this,n,t);t=this.options;t.duration=i.max(i.abs(t.newAngle-t.oldAngle)/t.duration*1e3,1)},options:{easing:ft,duration:wt},step:function(n){var i=this,t=i.options,r=tt(t.oldAngle,t.newAngle,n);i.element.transform(s.transform().rotate(r,t.center))}}),ct,lt;o.AnimationFactory.current.register(ii,ci);ct=o.Animation.extend({options:{easing:ft,duration:bt},setup:function(){var n=this.options,t=n.margin,r=n.from,f=n.to,e=n.vertical?"x1":"y1",o,s;n.mirror==n.vertical?(r[e]-=t,f[e]-=t):(r[e]+=t,f[e]+=t);o=this.fromScale=new u(r.x1,r.y1);s=this.toScale=new u(f.x1,f.y1);n.duration!==0&&(n.duration=i.max(o.distanceTo(s)/n.duration*1e3,1))},step:function(n){var t=tt(this.fromScale.x,this.toScale.x,n),i=tt(this.fromScale.y,this.toScale.y,n);this.element.transform(s.transform().translate(t,i))}});o.AnimationFactory.current.register(kt,ct);lt=o.Animation.extend({options:{easing:ft,speed:bt},setup:function(){var n=this.options,u=n.newPoints,f=n.oldPoints,t=this.axis=n.vertical?st:ot,e=this.to=u[0][t],r=this.from=f[0][t];n.duration!==0&&(n.duration=i.max(i.abs(e-r)/n.speed*1e3,1));this._set(r)},step:function(n){var t=tt(this.from,this.to,n);this._set(t)},_set:function(n){var t="set"+this.axis.toUpperCase(),i=this.options.newPoints;i[0][t](n);i[1][t](n)}});o.AnimationFactory.current.register(g,lt);r.ui.plugin(fi);r.ui.plugin(ei);r.ExportMixin.extend(w.fn);f(r,{Gauge:w,RadialPointer:ri,LinearPointer:nt,ArrowLinearPointer:si,BarLinearPointer:hi,LinearScale:oi,RadialScale:ui,LinearGauge:ei,RadialGauge:fi})})(window.kendo.jQuery)}(),function(){(function(n){function y(n,t,i){return n.substring(t,t+i)}var i=window.kendo,w=i.ui.Widget,b=n.extend,k=i.deepExtend,u=n.inArray,rt=n.isPlainObject,f=i.drawing,c=i.geometry,ut=i.util,l=ut.defined,e=i.dataviz,d=e.Box2D,ft=e.TextBox,et=300,ot=100,g=10,a=/^\d+$/,st=/^[a-z0-9]+$/i,ht="Character '{0}' is not valid for symbology {1}",r=i.Class.extend({init:function(n){this.setOptions(n)},setOptions:function(n){var t=this;t.options=b({},t.options,n);t.quietZoneLength=t.options.addQuietZone?2*t.options.quietZoneLength:0},encode:function(n,t,i){var r=this;return l(n)&&(n+=""),r.initValue(n,t,i),r.options.addQuietZone&&r.addQuietZone(),r.addData(),r.options.addQuietZone&&r.addQuietZone(),{baseUnit:r.baseUnit,pattern:r.pattern}},options:{quietZoneLength:g,addQuietZone:!0,addCheckSum:!0},initValue:function(){},addQuietZone:function(){this.pattern.push(this.options.quietZoneLength||g)},addData:function(){},invalidCharacterError:function(n){throw new Error(i.format(ht,n,this.name));}}),t={},nt=r.extend({minBaseUnitLength:.7,addData:function(){var n=this,i=n.value,t;for(n.addStart(),t=0;t<i.length;t++)n.addCharacter(i.charAt(t));n.options.addCheckSum&&n.pushCheckSum();n.addStop();n.prepareValues()},addCharacter:function(n){var t=this,i=t.characterMap[n];i||t.invalidCharacterError(n);t.addBase(i)},addBase:function(){}}),tt={addCharacter:function(n){var t=this;t.characterMap[n]?t.addBase(t.characterMap[n]):n.charCodeAt(0)>127?t.invalidCharacterError(n):t.addExtended(n.charCodeAt(0))},addExtended:function(n){for(var r,t=this,i,u=0;u<t.extendedMappings.length;u++)if(i=t.extendedMappings[u].call(t,n)){for(r=0;r<i.length;r++)t.addBase(i[r]);t.dataLength+=i.length-1;return}},extendedMappings:[function(n){if(97<=n&&n<=122){var t=this;return[t.characterMap[t.shiftCharacters[0]],t.characterMap[String.fromCharCode(n-32)]]}},function(n){if(33<=n&&n<=58){var t=this;return[t.characterMap[t.shiftCharacters[1]],t.characterMap[String.fromCharCode(n+32)]]}},function(n){if(1<=n&&n<=26){var t=this;return[t.characterMap[t.shiftCharacters[2]],t.characterMap[String.fromCharCode(n+64)]]}},function(n){var t=this,i,u,r;if(t.specialAsciiCodes[n])for(i=[],r=0;r<t.specialAsciiCodes[n].length;r++)i.push(t.characterMap[t.shiftCharacters[3]]),i.push(t.characterMap[t.specialAsciiCodes[n][r]]);else u=Math.floor(n/32)*6+(n-27)%32+64,i=[t.characterMap[t.shiftCharacters[3]],t.characterMap[String.fromCharCode(u)]];return i}],specialAsciiCodes:{"0":["U"],"64":["V"],"96":["W"],"127":["T","X","Y","Z"]},shiftValuesAsciiCodes:{"39":36,"40":47,"41":43,"42":37},characterMap:{"+":!1,"/":!1,$:!1,"%":!1},shiftCharacters:["SHIFT0","SHIFT1","SHIFT2","SHIFT3"]},s,h,p;t.code39=nt.extend({name:"Code 39",checkSumMod:43,minRatio:2.5,maxRatio:3,gapWidth:1,splitCharacter:"|",initValue:function(n,t,i){var r=this;r.width=t;r.height=i;r.value=n;r.dataLength=n.length;r.pattern=[];r.patternString=""},prepareValues:function(){var n=this,i,r=n.minBaseUnitLength,t=n.maxRatio,u=n.minRatio,f=Math.max(.15*n.width,24),e;if(n.height<f)throw new Error("Insufficient Height. The minimum height for value: "+n.value+" is: "+f);while((i=n.getBaseUnit(t))<r&&t>u)t=parseFloat((t-.1).toFixed(1));if(i<r){e=Math.ceil(n.getBaseWidth(u)*r);throw new Error("Insufficient width. The minimum width for value: "+n.value+" is: "+e);}n.ratio=t;n.baseUnit=i;n.patternString=n.patternString.substring(0,n.patternString.length-1);n.pattern=n.pattern.concat(n.patternString.replace(/ratio/g,t).split(n.splitCharacter))},getBaseUnit:function(n){return this.width/this.getBaseWidth(n)},getBaseWidth:function(n){var t=this,i=3*(n+2);return t.quietZoneLength+i*(t.dataLength+2)+t.gapWidth*(t.dataLength+1)},addStart:function(){var n=this;n.addPattern(n.characterMap.START.pattern);n.addCharacterGap()},addBase:function(n){this.addPattern(n.pattern);this.addCharacterGap()},addStop:function(){this.addPattern(this.characterMap.START.pattern)},addPattern:function(n){for(var t=0;t<n.length;t++)this.patternString+=this.patternMappings[n.charAt(t)]},addCharacterGap:function(){var n=this;n.patternString+=n.gapWidth+n.splitCharacter},patternMappings:{b:"1|",w:"1|",B:"ratio|",W:"ratio|"},characterMap:{"0":{pattern:"bwbWBwBwb",value:0},"1":{pattern:"BwbWbwbwB",value:1},"2":{pattern:"bwBWbwbwB",value:2},"3":{pattern:"BwBWbwbwb",value:3},"4":{pattern:"bwbWBwbwB",value:4},"5":{pattern:"BwbWBwbwb",value:5},"6":{pattern:"bwBWBwbwb",value:6},"7":{pattern:"bwbWbwBwB",value:7},"8":{pattern:"BwbWbwBwb",value:8},"9":{pattern:"bwBWbwBwb",value:9},A:{pattern:"BwbwbWbwB",value:10},B:{pattern:"bwBwbWbwB",value:11},C:{pattern:"BwBwbWbwb",value:12},D:{pattern:"bwbwBWbwB",value:13},E:{pattern:"BwbwBWbwb",value:14},F:{pattern:"bwBwBWbwb",value:15},G:{pattern:"bwbwbWBwB",value:16},H:{pattern:"BwbwbWBwb",value:17},I:{pattern:"bwBwbWBwb",value:18},J:{pattern:"bwbwBWBwb",value:19},K:{pattern:"BwbwbwbWB",value:20},L:{pattern:"bwBwbwbWB",value:21},M:{pattern:"BwBwbwbWb",value:22},N:{pattern:"bwbwBwbWB",value:23},O:{pattern:"BwbwBwbWb",value:24},P:{pattern:"bwBwBwbWb",value:25},Q:{pattern:"bwbwbwBWB",value:26},R:{pattern:"BwbwbwBWb",value:27},S:{pattern:"bwBwbwBWb",value:28},T:{pattern:"bwbwBwBWb",value:29},U:{pattern:"BWbwbwbwB",value:30},V:{pattern:"bWBwbwbwB",value:31},W:{pattern:"BWBwbwbwb",value:32},X:{pattern:"bWbwBwbwB",value:33},Y:{pattern:"BWbwBwbwb",value:34},Z:{pattern:"bWBwBwbwb",value:35},"-":{pattern:"bWbwbwBwB",value:36},".":{pattern:"BWbwbwBwb",value:37}," ":{pattern:"bWBwbwBwb",value:38},$:{pattern:"bWbWbWbwb",value:39},"/":{pattern:"bWbWbwbWb",value:40},"+":{pattern:"bWbwbWbWb",value:41},"%":{pattern:"bwbWbWbWb",value:42},START:{pattern:"bWbwBwBwb"}},options:{addCheckSum:!1}});t.code39extended=t.code39.extend(k({},tt,{name:"Code 39 extended",characterMap:{SHIFT0:{pattern:"bWbwbWbWb",value:41},SHIFT1:{pattern:"bWbWbwbWb",value:40},SHIFT2:{pattern:"bWbWbWbwb",value:39},SHIFT3:{pattern:"bwbWbWbWb",value:42}}}));t.code93=nt.extend({name:"Code 93",cCheckSumTotal:20,kCheckSumTotal:15,checkSumMod:47,initValue:function(n,t,i){var r=this;r.value=n;r.width=t;r.height=i;r.pattern=[];r.values=[];r.dataLength=n.length},prepareValues:function(){var n=this,t=Math.max(.15*n.width,24);if(n.height<t)throw new Error("Insufficient Height");if(n.setBaseUnit(),n.baseUnit<n.minBaseUnitLength)throw new Error("Insufficient Width");},setBaseUnit:function(){var n=this;n.baseUnit=n.width/(9*(n.dataLength+2+2)+n.quietZoneLength+1)},addStart:function(){var n=this.characterMap.START.pattern;this.addPattern(n)},addStop:function(){var n=this;n.addStart();n.pattern.push(n.characterMap.TERMINATION_BAR)},addBase:function(n){this.addPattern(n.pattern);this.values.push(n.value)},pushCheckSum:function(){var n=this,i=n._getCheckValues(),r,t;for(n.checksum=i.join(""),t=0;t<i.length;t++)r=n.characterMap[n._findCharacterByValue(i[t])],n.addPattern(r.pattern)},_getCheckValues:function(){for(var t=this,u=t.values,r=u.length,i=0,f,e,n=r-1;n>=0;n--)i+=t.weightedValue(u[n],r-n,t.cCheckSumTotal);for(f=i%t.checkSumMod,i=t.weightedValue(f,1,t.kCheckSumTotal),n=r-1;n>=0;n--)i+=t.weightedValue(u[n],r-n+1,t.kCheckSumTotal);return e=i%t.checkSumMod,[f,e]},_findCharacterByValue:function(n){for(var t in this.characterMap)if(this.characterMap[t].value===n)return t},weightedValue:function(n,t,i){return(t%i||i)*n},addPattern:function(n){for(var i,t=0;t<n.length;t++)i=parseInt(n.charAt(t),10),this.pattern.push(i)},characterMap:{"0":{pattern:"131112",value:0},"1":{pattern:"111213",value:1},"2":{pattern:"111312",value:2},"3":{pattern:"111411",value:3},"4":{pattern:"121113",value:4},"5":{pattern:"121212",value:5},"6":{pattern:"121311",value:6},"7":{pattern:"111114",value:7},"8":{pattern:"131211",value:8},"9":{pattern:"141111",value:9},A:{pattern:"211113",value:10},B:{pattern:"211212",value:11},C:{pattern:"211311",value:12},D:{pattern:"221112",value:13},E:{pattern:"221211",value:14},F:{pattern:"231111",value:15},G:{pattern:"112113",value:16},H:{pattern:"112212",value:17},I:{pattern:"112311",value:18},J:{pattern:"122112",value:19},K:{pattern:"132111",value:20},L:{pattern:"111123",value:21},M:{pattern:"111222",value:22},N:{pattern:"111321",value:23},O:{pattern:"121122",value:24},P:{pattern:"131121",value:25},Q:{pattern:"212112",value:26},R:{pattern:"212211",value:27},S:{pattern:"211122",value:28},T:{pattern:"211221",value:29},U:{pattern:"221121",value:30},V:{pattern:"222111",value:31},W:{pattern:"112122",value:32},X:{pattern:"112221",value:33},Y:{pattern:"122121",value:34},Z:{pattern:"123111",value:35},"-":{pattern:"121131",value:36},".":{pattern:"311112",value:37}," ":{pattern:"311211",value:38},$:{pattern:"321111",value:39},"/":{pattern:"112131",value:40},"+":{pattern:"113121",value:41},"%":{pattern:"211131",value:42},SHIFT0:{pattern:"122211",value:46},SHIFT1:{pattern:"311121",value:45},SHIFT2:{pattern:"121221",value:43},SHIFT3:{pattern:"312111",value:44},START:{pattern:"111141"},TERMINATION_BAR:"1"}});t.code93extended=t.code93.extend(k({},tt,{name:"Code 93 extended",pushCheckSum:function(){var n=this,r=n._getCheckValues(),t,i;for(n.checksum=r.join(""),i=0;i<r.length;i++)t=r[i],n.shiftValuesAsciiCodes[t]?n.addExtended(n.shiftValuesAsciiCodes[t]):n.addPattern(n.characterMap[n._findCharacterByValue(t)].pattern)}}));var v=i.Class.extend({init:function(n){this.encoding=n},addStart:function(){},is:function(){},move:function(){},pushState:function(){}}),it=v.extend({FNC4:"FNC4",init:function(n,t){var i=this;i.encoding=n;i.states=t;i._initMoves(t)},addStart:function(){this.encoding.addPattern(this.START)},is:function(n,t){var i=n.charCodeAt(t);return this.isCode(i)},move:function(n){for(var t=this,i=0;!t._moves[i].call(t,n)&&i<t._moves.length;)i++},pushState:function(n){var t=this,o=t.states,i=n.value,e=i.length,r,f;for(u("C",o)>=0&&(f=i.substr(n.index).match(/\d{4,}/g),f&&(e=i.indexOf(f[0],n.index)));(r=n.value.charCodeAt(n.index))>=0&&t.isCode(r)&&n.index<e;)t.encoding.addPattern(t.getValue(r)),n.index++},_initMoves:function(n){var t=this;t._moves=[];u(t.FNC4,n)>=0&&t._moves.push(t._moveFNC);u(t.shiftKey,n)>=0&&t._moves.push(t._shiftState);t._moves.push(t._moveState)},_moveFNC:function(n){if(n.fnc)return n.fnc=!1,n.previousState==this.key},_shiftState:function(n){var t=this;if(n.previousState==t.shiftKey&&(n.index+1>=n.value.length||t.encoding[t.shiftKey].is(n.value,n.index+1)))return t.encoding.addPattern(t.SHIFT),n.shifted=!0,!0},_moveState:function(){return this.encoding.addPattern(this.MOVE),!0},SHIFT:98}),o={};o.A=it.extend({key:"A",shiftKey:"B",isCode:function(n){return 0<=n&&n<96},getValue:function(n){return n<32?n+64:n-32},MOVE:101,START:103});o.B=it.extend({key:"B",shiftKey:"A",isCode:function(n){return 32<=n&&n<128},getValue:function(n){return n-32},MOVE:100,START:104});o.C=v.extend({key:"C",addStart:function(){this.encoding.addPattern(this.START)},is:function(n,t){var i=y(n,t,4);return(t+4<=n.length||n.length==2)&&a.test(i)},move:function(){this.encoding.addPattern(this.MOVE)},pushState:function(n){for(var t;(t=y(n.value,n.index,2))&&a.test(t)&&t.length==2;)this.encoding.addPattern(parseInt(t,10)),n.index+=2},getValue:function(n){return n},MOVE:99,START:105});o.FNC4=v.extend({key:"FNC4",dependentStates:["A","B"],init:function(n,t){this.encoding=n;this._initSubStates(t)},addStart:function(n){var t=n.value.charCodeAt(0)-128,i=this._getSubState(t);this.encoding[i].addStart()},is:function(n,t){var i=n.charCodeAt(t);return this.isCode(i)},isCode:function(n){return 128<=n&&n<256},pushState:function(n){var r=this,t=r._initSubState(n),i=r.encoding,u=t.value.length,f;if(n.index+=u,u<3)for(;t.index<u;t.index++)f=t.value.charCodeAt(t.index),t.state=r._getSubState(f),t.previousState!=t.state&&(t.previousState=t.state,i[t.state].move(t)),i.addPattern(i[t.state].MOVE),i.addPattern(i[t.state].getValue(f));else t.state!=t.previousState&&i[t.state].move(t),r._pushStart(t),i.pushData(t,r.subStates),n.index<n.value.length&&r._pushStart(t);n.fnc=!0;n.state=t.state},_pushStart:function(n){var t=this;t.encoding.addPattern(t.encoding[n.state].MOVE);t.encoding.addPattern(t.encoding[n.state].MOVE)},_initSubState:function(n){var i=this,t={value:i._getAll(n.value,n.index),index:0};return t.state=i._getSubState(t.value.charCodeAt(0)),t.previousState=n.previousState==i.key?t.state:n.previousState,t},_initSubStates:function(n){var i=this,t;for(i.subStates=[],t=0;t<n.length;t++)u(n[t],i.dependentStates)>=0&&i.subStates.push(n[t])},_getSubState:function(n){for(var t=this,i=0;i<t.subStates.length;i++)if(t.encoding[t.subStates[i]].isCode(n))return t.subStates[i]},_getAll:function(n,t){for(var i,r="";(i=n.charCodeAt(t++))&&this.isCode(i);)r+=String.fromCharCode(i-128);return r}});o.FNC1=v.extend({key:"FNC1",startState:"C",dependentStates:["C","B"],startAI:"(",endAI:")",init:function(n,t){this.encoding=n;this.states=t},addStart:function(){this.encoding[this.startState].addStart()},is:function(){return u(this.key,this.states)>=0},pushState:function(n){var t=this,o=t.encoding,i=n.value.replace(/\s/g,""),h=new RegExp("["+t.startAI+t.endAI+"]","g"),r=n.index,f={state:t.startState},u,e,s;for(o.addPattern(t.START);;){if(f.index=0,s=i.charAt(r)===t.startAI?2:0,u=s>0?t.getBySeparator(i,r):t.getByLength(i,r),u.ai.length)e=r+s+u.id.length+u.ai.length;else if(e=i.indexOf(t.startAI,r+1),e<0){if(r+u.ai.max+u.id.length+s<i.length)throw new Error("Separators are required after variable length identifiers");e=i.length}if(f.value=i.substring(r,e).replace(h,""),t.validate(u,f.value),o.pushData(f,t.dependentStates),e>=i.length)break;r=e;f.state!=t.startState&&(o[t.startState].move(f),f.state=t.startState);u.ai.length||o.addPattern(t.START)}n.index=n.value.length},validate:function(n,t){var r=t.substr(n.id.length),i=n.ai;if(!i.type&&!a.test(r))throw new Error("Application identifier "+n.id+" is numeric only but contains non numeric character(s).");if(i.type=="alphanumeric"&&!st.test(r))throw new Error("Application identifier "+n.id+" is alphanumeric only but contains non alphanumeric character(s).");if(i.length&&i.length!==r.length)throw new Error("Application identifier "+n.id+" must be "+i.length+" characters long.");if(i.min&&i.min>r.length)throw new Error("Application identifier "+n.id+" must be at least "+i.min+" characters long.");if(i.max&&i.max<r.length)throw new Error("Application identifier "+n.id+" must be at most "+i.max+" characters long.");},getByLength:function(n,t){for(var r=this,i,u,f=2;f<=4;f++)if(i=y(n,t,f),u=r.getAI(i)||r.getAI(i.substring(0,i.length-1)),u)return{id:i,ai:u};r.unsupportedAIError(i)},unsupportedAIError:function(n){throw new Error(i.format("'{0}' is not a supported Application Identifier"),n);},getBySeparator:function(n,t){var i=this,u=n.indexOf(i.startAI,t),e=n.indexOf(i.endAI,u),r=n.substring(u+1,e),f=i.getAI(r)||i.getAI(r.substr(r.length-1));return f||i.unsupportedAIError(r),{ai:f,id:r}},getAI:function(n){var e=this.applicationIdentifiers,i=e.multiKey,t,f,r;if(e[n])return e[n];for(t=0;t<i.length;t++){if(i[t].ids&&u(n,i[t].ids)>=0)return i[t].type;if(i[t].ranges)for(f=i[t].ranges,r=0;r<f.length;r++)if(f[r][0]<=n&&n<=f[r][1])return i[t].type}},applicationIdentifiers:{"22":{max:29,type:"alphanumeric"},"402":{length:17},"7004":{max:4,type:"alphanumeric"},"242":{max:6,type:"alphanumeric"},"8020":{max:25,type:"alphanumeric"},"703":{min:3,max:30,type:"alphanumeric"},"8008":{min:8,max:12,type:"alphanumeric"},"253":{min:13,max:17,type:"alphanumeric"},"8003":{min:14,max:30,type:"alphanumeric"},multiKey:[{ids:["15","17","8005","8100"],ranges:[[11,13],[310,316],[320,336],[340,369]],type:{length:6}},{ids:["240","241","250","251","400","401","403","7002","8004","8007","8110"],ranges:[[-9]],type:{max:30,type:"alphanumeric"}},{ids:["7001"],ranges:[[410,414]],type:{length:13}},{ids:["10","21","254","420","8002"],type:{max:20,type:"alphanumeric"}},{ids:["00","8006","8017","8018"],type:{length:18}},{ids:["01","02","8001"],type:{length:14}},{ids:["422"],ranges:[[424,426]],type:{length:3}},{ids:["20","8102"],type:{length:2}},{ids:["30","37"],type:{max:8,type:"alphanumeric"}},{ids:["390","392"],type:{max:15,type:"alphanumeric"}},{ids:["421","423"],type:{min:3,max:15,type:"alphanumeric"}},{ids:["391","393"],type:{min:3,max:18,type:"alphanumeric"}},{ids:["7003","8101"],type:{length:10}}]},START:102});s=r.extend({init:function(n){r.fn.init.call(this,n);this._initStates()},_initStates:function(){for(var n=this,t=0;t<n.states.length;t++)n[n.states[t]]=new o[n.states[t]](n,n.states)},initValue:function(n,t,i){var r=this;r.pattern=[];r.value=n;r.width=t;r.height=i;r.checkSum=0;r.totalUnits=0;r.index=0;r.position=1},addData:function(){var n=this,t={value:n.value,index:0,state:""};n.value.length!==0&&(t.state=t.previousState=n.getNextState(t,n.states),n.addStart(t),n.pushData(t,n.states),n.addCheckSum(),n.addStop(),n.setBaseUnit())},pushData:function(n,t){for(var i=this,r;;){if(i[n.state].pushState(n),n.index>=n.value.length)break;n.shifted?(r=n.state,n.state=n.previousState,n.previousState=r,n.shifted=!1):(n.previousState=n.state,n.state=i.getNextState(n,t),i[n.state].move(n))}},addStart:function(n){this[n.state].addStart(n);this.position=1},addCheckSum:function(){var n=this;n.checksum=n.checkSum%103;n.addPattern(n.checksum)},addStop:function(){this.addPattern(this.STOP)},setBaseUnit:function(){var n=this;n.baseUnit=n.width/(n.totalUnits+n.quietZoneLength)},addPattern:function(n){for(var t=this,u=t.characterMap[n].toString(),i,r=0;r<u.length;r++)i=parseInt(u.charAt(r),10),t.pattern.push(i),t.totalUnits+=i;t.checkSum+=n*t.position++},getNextState:function(n,t){for(var i=0;i<t.length;i++)if(this[t[i]].is(n.value,n.index))return t[i];this.invalidCharacterError(n.value.charAt(n.index))},characterMap:[212222,222122,222221,121223,121322,131222,122213,122312,132212,221213,221312,231212,112232,122132,122231,113222,123122,123221,223211,221132,221231,213212,223112,312131,311222,321122,321221,312212,322112,322211,212123,212321,232121,111323,131123,131321,112313,132113,132311,211313,231113,231311,112133,112331,132131,113123,113321,133121,313121,211331,231131,213113,213311,213131,311123,311321,331121,312113,312311,332111,314111,221411,431111,111224,111422,121124,121421,141122,141221,112214,112412,122114,122411,142112,142211,241211,221114,413111,241112,134111,111242,121142,121241,114212,124112,124211,411212,421112,421211,212141,214121,412121,111143,111341,131141,114113,114311,411113,411311,113141,114131,311141,411131,211412,211214,211232,2331112],STOP:106});t.code128a=s.extend({name:"Code 128 A",states:["A"]});t.code128b=s.extend({name:"Code 128 B",states:["B"]});t.code128c=s.extend({name:"Code 128 C",states:["C"]});t.code128=s.extend({name:"Code 128",states:["C","B","A","FNC4"]});t["gs1-128"]=s.extend({name:"Code GS1-128",states:["FNC1","C","B"]});h=r.extend({initValue:function(n,t){var i=this;i.pattern=[];i.value=n;i.checkSumLength=0;i.width=t},setBaseUnit:function(){var n=this;n.baseUnit=n.width/(12*(n.value.length+n.checkSumLength)+n.quietZoneLength+7)},addData:function(){var n=this,i=n.value,t;for(n.addPattern(n.START),t=0;t<i.length;t++)n.addCharacter(i.charAt(t));n.options.addCheckSum&&n.addCheckSum();n.addPattern(n.STOP);n.setBaseUnit()},addCharacter:function(n){var t=this,i=t.characterMap[n];i||t.invalidCharacterError(n);t.addPattern(i)},addPattern:function(n){for(var t=0;t<n.length;t++)this.pattern.push(parseInt(n.charAt(t),10))},addCheckSum:function(){var n=this,r=n.checkSums[n.checkSumType],t,i;for(t=r.call(n.checkSums,n.value),n.checksum=t.join(""),i=0;i<t.length;i++)n.checkSumLength++,n.addPattern(n.characterMap[t[i]])},checkSums:{Modulo10:function(n){for(var i=[0,""],f=n.length%2,r,u,t=0;t<n.length;t++)i[(t+f)%2]+=parseInt(n.charAt(t),10);for(u=i[0],r=(i[1]*2).toString(),t=0;t<r.length;t++)u+=parseInt(r.charAt(t),10);return[(10-u%10)%10]},Modulo11:function(n){for(var u=0,i=11,f=n.length,e,r,t=0;t<f;t++)e=((f-t)%6||6)+1,u+=e*n.charAt(t);return(r=(i-u%i)%i,r!=10)?[r]:[1,0]},Modulo11Modulo10:function(n){var t=this.Modulo11(n),i;return i=n+t[0],t.concat(this.Modulo10(i))},Modulo10Modulo10:function(n){var t=this.Modulo10(n),i;return i=n+t[0],t.concat(this.Modulo10(i))}},characterMap:["12121212","12121221","12122112","12122121","12211212","12211221","12212112","12212121","21121212","21121221"],START:"21",STOP:"121",checkSumType:""});t.msimod10=h.extend({name:"MSI Modulo10",checkSumType:"Modulo10"});t.msimod11=h.extend({name:"MSI Modulo11",checkSumType:"Modulo11"});t.msimod1110=h.extend({name:"MSI Modulo11 Modulo10",checkSumType:"Modulo11Modulo10"});t.msimod1010=h.extend({name:"MSI Modulo10 Modulo10",checkSumType:"Modulo10Modulo10"});t.code11=r.extend({name:"Code 11",cCheckSumTotal:10,kCheckSumTotal:9,kCheckSumMinLength:10,checkSumMod:11,DASH_VALUE:10,DASH:"-",START:"112211",STOP:"11221",initValue:function(n,t){var i=this;i.pattern=[];i.value=n;i.width=t;i.totalUnits=0},addData:function(){var n=this,i=n.value,t;for(n.addPattern(n.START),t=0;t<i.length;t++)n.addCharacter(i.charAt(t));n.options.addCheckSum&&n.addCheckSum();n.addPattern(n.STOP);n.setBaseUnit()},setBaseUnit:function(){var n=this;n.baseUnit=n.width/(n.totalUnits+n.quietZoneLength)},addCheckSum:function(){var n=this,r=n.value,t=r.length,i,u;i=n.getWeightedSum(r,t,n.cCheckSumTotal)%n.checkSumMod;n.checksum=i+"";n.addPattern(n.characterMap[i]);t++;t>=n.kCheckSumMinLength&&(u=(i+n.getWeightedSum(r,t,n.kCheckSumTotal))%n.checkSumMod,n.checksum+=u,n.addPattern(n.characterMap[u]))},getWeightedSum:function(n,t,i){for(var u=0,r=0;r<n.length;r++)u+=this.weightedValue(this.getValue(n.charAt(r)),t,r,i);return u},weightedValue:function(n,t,i,r){var u=(t-i)%r||r;return u*n},getValue:function(n){var t=this;if(isNaN(n))n!==t.DASH&&t.invalidCharacterError(n);else return parseInt(n,10);return t.DASH_VALUE},addCharacter:function(n){var t=this,i=t.getValue(n),r=t.characterMap[i];t.addPattern(r)},addPattern:function(n){for(var t,i=0;i<n.length;i++)t=parseInt(n.charAt(i),10),this.pattern.push(t),this.totalUnits+=t},characterMap:["111121","211121","121121","221111","112121","212111","122111","111221","211211","211111","112111"],options:{addCheckSum:!0}});t.postnet=r.extend({name:"Postnet",START:"2",VALID_CODE_LENGTHS:[5,9,11],DIGIT_SEPARATOR:"-",initValue:function(n,t,i){var r=this;r.height=i;r.width=t;r.baseHeight=i/2;r.value=n.replace(new RegExp(r.DIGIT_SEPARATOR,"g"),"");r.pattern=[];r.validate(r.value);r.checkSum=0;r.setBaseUnit()},addData:function(){var n=this,i=n.value,t;for(n.addPattern(n.START),t=0;t<i.length;t++)n.addCharacter(i.charAt(t));n.options.addCheckSum&&n.addCheckSum();n.addPattern(n.START);n.pattern.pop()},addCharacter:function(n){var t=this,i=t.characterMap[n];t.checkSum+=parseInt(n,10);t.addPattern(i)},addCheckSum:function(){var n=this;n.checksum=(10-n.checkSum%10)%10;n.addCharacter(n.checksum)},setBaseUnit:function(){var n=this;n.baseUnit=n.width/((n.value.length+1)*10+3+n.quietZoneLength)},validate:function(n){var t=this;if(a.test(n)||t.invalidCharacterError(n.match(/[^0-9]/)[0]),u(n.length,t.VALID_CODE_LENGTHS)<0)throw new Error("Invalid value length. Valid lengths for the Postnet symbology are "+t.VALID_CODE_LENGTHS.join(","));},addPattern:function(n){for(var t=this,r,i=0;i<n.length;i++)r=t.height-t.baseHeight*n.charAt(i),t.pattern.push({width:1,y1:r,y2:t.height}),t.pattern.push(1)},characterMap:["22111","11122","11212","11221","12112","12121","12211","21112","21121","21211"]});t.ean13=r.extend({initValue:function(n,t,i){if(n+="",n.length!=12||/\D/.test(n))throw new Error('The value of the "EAN13" encoding should be 12 symbols');var r=this;r.pattern=[];r.options.height=i;r.baseUnit=t/(95+r.quietZoneLength);r.value=n;r.checksum=r.calculateChecksum();r.leftKey=n[0];r.leftPart=n.substr(1,6);r.rightPart=n.substr(7)+r.checksum},addData:function(){var n=this;n.addPieces(n.characterMap.start);n.addSide(n.leftPart,n.leftKey);n.addPieces(n.characterMap.middle);n.addSide(n.rightPart);n.addPieces(n.characterMap.start)},addSide:function(n,t){for(var i=this,r=0;r<n.length;r++)t&&parseInt(i.keyTable[t].charAt(r),10)?i.addPieces(Array.prototype.slice.call(i.characterMap.digits[n.charAt(r)]).reverse(),!0):i.addPieces(i.characterMap.digits[n.charAt(r)],!0)},addPieces:function(n,t){for(var r=this,i=0;i<n.length;i++)t?r.pattern.push({y1:0,y2:r.options.height*.95,width:n[i]}):r.pattern.push(n[i])},calculateChecksum:function(){for(var i=0,r=0,t=this.value.split("").reverse().join(""),n=0;n<t.length;n++)n%2?r+=parseInt(t.charAt(n),10):i+=parseInt(t.charAt(n),10);return(10-(3*i+r)%10)%10},keyTable:["000000","001011","001101","001110","010011","011001","011100","010101","010110","011010"],characterMap:{digits:[[3,2,1,1],[2,2,2,1],[2,1,2,2],[1,4,1,1],[1,1,3,2],[1,2,3,1],[1,1,1,4],[1,3,1,2],[1,2,1,3],[3,1,1,2]],start:[1,1,1],middle:[1,1,1,1,1]}});t.ean8=t.ean13.extend({initValue:function(n,t,i){var r=this;if(n.length!=7||/\D/.test(n))throw new Error("Invalid value provided");r.value=n;r.options.height=i;r.checksum=r.calculateChecksum(r.value);r.leftPart=r.value.substr(0,4);r.rightPart=r.value.substr(4)+r.checksum;r.pattern=[];r.baseUnit=t/(67+r.quietZoneLength)}});p=w.extend({init:function(t,i){var r=this;w.fn.init.call(r,t,i);r.element=n(t);r.wrapper=r.element;r.element.addClass("k-barcode").css("display","block");r.surfaceWrap=n("<div />").css("position","relative").appendTo(this.element);r.surface=f.Surface.create(r.surfaceWrap,{type:r.options.renderAs});r.setOptions(i)},setOptions:function(n){var i=this;if(i.type=(n.type||i.options.type).toLowerCase(),i.type=="upca"&&(i.type="ean13",n.value="0"+n.value),i.type=="upce"&&(i.type="ean8",n.value="0"+n.value),!t[i.type])throw new Error("Encoding "+i.type+"is not supported.");(i.encoding=new t[i.type],i.options=b(!0,i.options,n),l(n.value))&&i.redraw()},redraw:function(){var n=this._getSize();this.surface.clear();this.surface.setSize({width:n.width,height:n.height});this.createVisual();this.surface.draw(this.visual)},getSize:function(){return i.dimensions(this.element)},_resize:function(){this.redraw()},createVisual:function(){this.visual=this._render()},_render:function(){var n=this,t=n.options,u=t.value,i=t.text,y=e.getSpacing(i.margin),o=n._getSize(),w=t.border||{},s=n.encoding,h=d(0,0,o.width,o.height).unpad(w.width).unpad(t.padding),c=h.height(),a,v,p,r=new f.Group;return n.contentBox=h,r.append(n._getBackground(o)),i.visible&&(p=f.util.measureText(u,{font:i.font}).height,c-=p+y.top+y.bottom),a=s.encode(u,h.width(),c),i.visible&&(v=u,t.checksum&&l(s.checksum)&&(v+=" "+s.checksum),r.append(n._getText(v))),n.barHeight=c,this._bandsGroup=this._getBands(a.pattern,a.baseUnit),r.append(this._bandsGroup),r},exportVisual:function(){return this._render()},_getSize:function(){var n=this,i=n.element,t=new c.Size(et,ot);return i.width()>0&&(t.width=i.width()),i.height()>0&&(t.height=i.height()),n.options.width&&(t.width=n.options.width),n.options.height&&(t.height=n.options.height),t},value:function(n){var t=this;if(!l(n))return t.options.value;t.options.value=n+"";t.redraw()},_getBands:function(n,t){for(var l,a,u=this,e=u.contentBox,o=e.x1,s,r,h=new f.Group,i=0;i<n.length;i++)r=rt(n[i])?n[i]:{width:n[i],y1:0,y2:u.barHeight},s=r.width*t,i%2&&(l=c.Rect.fromPoints(new c.Point(o,r.y1+e.y1),new c.Point(o+s,r.y2+e.y1)),a=f.Path.fromRect(l,{fill:{color:u.options.color},stroke:null}),h.append(a)),o+=s;return h},_getBackground:function(n){var r=this,i=r.options,t=i.border||{},u=d(0,0,n.width,n.height).unpad(t.width/2);return f.Path.fromRect(u.toRect(),{fill:{color:i.background},stroke:{color:t.width?t.color:"",width:t.width,dashType:t.dashType}})},_getText:function(n){var t=this,i=t.options.text,r=t._textbox=new ft(n,{font:i.font,color:i.color,align:"center",vAlign:"bottom",margin:i.margin});return r.reflow(t.contentBox),r.renderVisual(),r.visual},options:{name:"Barcode",renderAs:"svg",value:"",type:"code39",checksum:!1,width:0,height:0,color:"black",background:"white",text:{visible:!0,font:"16px Consolas, Monaco, Sans Mono, monospace, sans-serif",color:"black",margin:{top:0,bottom:0,left:0,right:0}},border:{width:0,dashType:"solid",color:"black"},padding:{top:0,bottom:0,left:0,right:0}}});e.ExportMixin.extend(p.fn);e.ui.plugin(p);i.deepExtend(e,{encodings:t,Encoding:r})})(window.kendo.jQuery)}(),function(){(function(n,t){function b(n){return parseInt(n,2)}function r(n,t){var i=Number(n).toString(2);return i.length<t&&(i=new Array(t-i.length+1).join(0)+i),i}function ti(n,t){for(var r=[],i=0;i<n.length;)r.push(n.substring(i,i+t)),i+=t;return r}function i(n,t,i,r){for(var u=0;u<n.length;u++)n[u][i][r]=t}function ii(n,t,i,r){for(var u=0;u<it.length;u++)n[u][i][r]=it[u](i,r)?t^1:parseInt(t,10)}function br(){for(var n,t=1;t<255;t++)n=u[t-1]*2,n>255&&(n=n^285),u[t]=n,y[n]=t;n=u[t-1]*2^285;u[t]=n;u[-1]=0}function kr(){for(var t,i,n=2;n<=68;n++)t=p[n-1],i=[n,0],p[n]=ht(t,i)}function dr(n,i){var f=[],r=n.length-1;do f[r]=u[(n[r]+i)%255],r--;while(n[r]!==t);return f}function c(n,t){return parseInt(n.charAt(t),10)}function wi(n,t,i,r,u){t[n][r]=(t[n][r]<<1^u)%128;t[n][r]==sr&&(i[n]+=40)}function bi(n,t,i,r,u,f){i[n][f]==r?u[n][f]++:(i[n][f]=r,u[n][f]>=5&&(t[n]+=3+u[n][f]-5),u[n][f]=1)}function gr(n,t){var i=Math.floor(n/t*100),r=i%5,u=Math.abs(i-r-50),f=Math.abs(i+5-r-50);return 10*Math.min(u/5,f/5)}var e=window.kendo,gi=n.extend,a=e.drawing,v=e.dataviz,wt=e.ui.Widget,nr=v.Box2D,bt="0000",kt="numeric",g="alphanumeric",nt="byte",y={"1":0},u={"0":1},p=[[1,0],[1,25,0]],tr={15:20,16:20,18:24,19:24,22:20,24:22,26:24,28:20,30:20,31:24,32:28,33:24,36:18,37:22,39:20,40:24},s=[{L:{groups:[[1,19]],totalDataCodewords:19,errorCodewordsPerBlock:7},M:{groups:[[1,16]],totalDataCodewords:16,errorCodewordsPerBlock:10},Q:{groups:[[1,13]],totalDataCodewords:13,errorCodewordsPerBlock:13},H:{groups:[[1,9]],totalDataCodewords:9,errorCodewordsPerBlock:17}},{L:{groups:[[1,34]],totalDataCodewords:34,errorCodewordsPerBlock:10},M:{groups:[[1,28]],totalDataCodewords:28,errorCodewordsPerBlock:16},Q:{groups:[[1,22]],totalDataCodewords:22,errorCodewordsPerBlock:22},H:{groups:[[1,16]],totalDataCodewords:16,errorCodewordsPerBlock:28}},{L:{groups:[[1,55]],totalDataCodewords:55,errorCodewordsPerBlock:15},M:{groups:[[1,44]],totalDataCodewords:44,errorCodewordsPerBlock:26},Q:{groups:[[2,17]],totalDataCodewords:34,errorCodewordsPerBlock:18},H:{groups:[[2,13]],totalDataCodewords:26,errorCodewordsPerBlock:22}},{L:{groups:[[1,80]],totalDataCodewords:80,errorCodewordsPerBlock:20},M:{groups:[[2,32]],totalDataCodewords:64,errorCodewordsPerBlock:18},Q:{groups:[[2,24]],totalDataCodewords:48,errorCodewordsPerBlock:26},H:{groups:[[4,9]],totalDataCodewords:36,errorCodewordsPerBlock:16}},{L:{groups:[[1,108]],totalDataCodewords:108,errorCodewordsPerBlock:26},M:{groups:[[2,43]],totalDataCodewords:86,errorCodewordsPerBlock:24},Q:{groups:[[2,15],[2,16]],totalDataCodewords:62,errorCodewordsPerBlock:18},H:{groups:[[2,11],[2,12]],totalDataCodewords:46,errorCodewordsPerBlock:22}},{L:{groups:[[2,68]],totalDataCodewords:136,errorCodewordsPerBlock:18},M:{groups:[[4,27]],totalDataCodewords:108,errorCodewordsPerBlock:16},Q:{groups:[[4,19]],totalDataCodewords:76,errorCodewordsPerBlock:24},H:{groups:[[4,15]],totalDataCodewords:60,errorCodewordsPerBlock:28}},{L:{groups:[[2,78]],totalDataCodewords:156,errorCodewordsPerBlock:20},M:{groups:[[4,31]],totalDataCodewords:124,errorCodewordsPerBlock:18},Q:{groups:[[2,14],[4,15]],totalDataCodewords:88,errorCodewordsPerBlock:18},H:{groups:[[4,13],[1,14]],totalDataCodewords:66,errorCodewordsPerBlock:26}},{L:{groups:[[2,97]],totalDataCodewords:194,errorCodewordsPerBlock:24},M:{groups:[[2,38],[2,39]],totalDataCodewords:154,errorCodewordsPerBlock:22},Q:{groups:[[4,18],[2,19]],totalDataCodewords:110,errorCodewordsPerBlock:22},H:{groups:[[4,14],[2,15]],totalDataCodewords:86,errorCodewordsPerBlock:26}},{L:{groups:[[2,116]],totalDataCodewords:232,errorCodewordsPerBlock:30},M:{groups:[[3,36],[2,37]],totalDataCodewords:182,errorCodewordsPerBlock:22},Q:{groups:[[4,16],[4,17]],totalDataCodewords:132,errorCodewordsPerBlock:20},H:{groups:[[4,12],[4,13]],totalDataCodewords:100,errorCodewordsPerBlock:24}},{L:{groups:[[2,68],[2,69]],totalDataCodewords:274,errorCodewordsPerBlock:18},M:{groups:[[4,43],[1,44]],totalDataCodewords:216,errorCodewordsPerBlock:26},Q:{groups:[[6,19],[2,20]],totalDataCodewords:154,errorCodewordsPerBlock:24},H:{groups:[[6,15],[2,16]],totalDataCodewords:122,errorCodewordsPerBlock:28}},{L:{groups:[[4,81]],totalDataCodewords:324,errorCodewordsPerBlock:20},M:{groups:[[1,50],[4,51]],totalDataCodewords:254,errorCodewordsPerBlock:30},Q:{groups:[[4,22],[4,23]],totalDataCodewords:180,errorCodewordsPerBlock:28},H:{groups:[[3,12],[8,13]],totalDataCodewords:140,errorCodewordsPerBlock:24}},{L:{groups:[[2,92],[2,93]],totalDataCodewords:370,errorCodewordsPerBlock:24},M:{groups:[[6,36],[2,37]],totalDataCodewords:290,errorCodewordsPerBlock:22},Q:{groups:[[4,20],[6,21]],totalDataCodewords:206,errorCodewordsPerBlock:26},H:{groups:[[7,14],[4,15]],totalDataCodewords:158,errorCodewordsPerBlock:28}},{L:{groups:[[4,107]],totalDataCodewords:428,errorCodewordsPerBlock:26},M:{groups:[[8,37],[1,38]],totalDataCodewords:334,errorCodewordsPerBlock:22},Q:{groups:[[8,20],[4,21]],totalDataCodewords:244,errorCodewordsPerBlock:24},H:{groups:[[12,11],[4,12]],totalDataCodewords:180,errorCodewordsPerBlock:22}},{L:{groups:[[3,115],[1,116]],totalDataCodewords:461,errorCodewordsPerBlock:30},M:{groups:[[4,40],[5,41]],totalDataCodewords:365,errorCodewordsPerBlock:24},Q:{groups:[[11,16],[5,17]],totalDataCodewords:261,errorCodewordsPerBlock:20},H:{groups:[[11,12],[5,13]],totalDataCodewords:197,errorCodewordsPerBlock:24}},{L:{groups:[[5,87],[1,88]],totalDataCodewords:523,errorCodewordsPerBlock:22},M:{groups:[[5,41],[5,42]],totalDataCodewords:415,errorCodewordsPerBlock:24},Q:{groups:[[5,24],[7,25]],totalDataCodewords:295,errorCodewordsPerBlock:30},H:{groups:[[11,12],[7,13]],totalDataCodewords:223,errorCodewordsPerBlock:24}},{L:{groups:[[5,98],[1,99]],totalDataCodewords:589,errorCodewordsPerBlock:24},M:{groups:[[7,45],[3,46]],totalDataCodewords:453,errorCodewordsPerBlock:28},Q:{groups:[[15,19],[2,20]],totalDataCodewords:325,errorCodewordsPerBlock:24},H:{groups:[[3,15],[13,16]],totalDataCodewords:253,errorCodewordsPerBlock:30}},{L:{groups:[[1,107],[5,108]],totalDataCodewords:647,errorCodewordsPerBlock:28},M:{groups:[[10,46],[1,47]],totalDataCodewords:507,errorCodewordsPerBlock:28},Q:{groups:[[1,22],[15,23]],totalDataCodewords:367,errorCodewordsPerBlock:28},H:{groups:[[2,14],[17,15]],totalDataCodewords:283,errorCodewordsPerBlock:28}},{L:{groups:[[5,120],[1,121]],totalDataCodewords:721,errorCodewordsPerBlock:30},M:{groups:[[9,43],[4,44]],totalDataCodewords:563,errorCodewordsPerBlock:26},Q:{groups:[[17,22],[1,23]],totalDataCodewords:397,errorCodewordsPerBlock:28},H:{groups:[[2,14],[19,15]],totalDataCodewords:313,errorCodewordsPerBlock:28}},{L:{groups:[[3,113],[4,114]],totalDataCodewords:795,errorCodewordsPerBlock:28},M:{groups:[[3,44],[11,45]],totalDataCodewords:627,errorCodewordsPerBlock:26},Q:{groups:[[17,21],[4,22]],totalDataCodewords:445,errorCodewordsPerBlock:26},H:{groups:[[9,13],[16,14]],totalDataCodewords:341,errorCodewordsPerBlock:26}},{L:{groups:[[3,107],[5,108]],totalDataCodewords:861,errorCodewordsPerBlock:28},M:{groups:[[3,41],[13,42]],totalDataCodewords:669,errorCodewordsPerBlock:26},Q:{groups:[[15,24],[5,25]],totalDataCodewords:485,errorCodewordsPerBlock:30},H:{groups:[[15,15],[10,16]],totalDataCodewords:385,errorCodewordsPerBlock:28}},{L:{groups:[[4,116],[4,117]],totalDataCodewords:932,errorCodewordsPerBlock:28},M:{groups:[[17,42]],totalDataCodewords:714,errorCodewordsPerBlock:26},Q:{groups:[[17,22],[6,23]],totalDataCodewords:512,errorCodewordsPerBlock:28},H:{groups:[[19,16],[6,17]],totalDataCodewords:406,errorCodewordsPerBlock:30}},{L:{groups:[[2,111],[7,112]],totalDataCodewords:1006,errorCodewordsPerBlock:28},M:{groups:[[17,46]],totalDataCodewords:782,errorCodewordsPerBlock:28},Q:{groups:[[7,24],[16,25]],totalDataCodewords:568,errorCodewordsPerBlock:30},H:{groups:[[34,13]],totalDataCodewords:442,errorCodewordsPerBlock:24}},{L:{groups:[[4,121],[5,122]],totalDataCodewords:1094,errorCodewordsPerBlock:30},M:{groups:[[4,47],[14,48]],totalDataCodewords:860,errorCodewordsPerBlock:28},Q:{groups:[[11,24],[14,25]],totalDataCodewords:614,errorCodewordsPerBlock:30},H:{groups:[[16,15],[14,16]],totalDataCodewords:464,errorCodewordsPerBlock:30}},{L:{groups:[[6,117],[4,118]],totalDataCodewords:1174,errorCodewordsPerBlock:30},M:{groups:[[6,45],[14,46]],totalDataCodewords:914,errorCodewordsPerBlock:28},Q:{groups:[[11,24],[16,25]],totalDataCodewords:664,errorCodewordsPerBlock:30},H:{groups:[[30,16],[2,17]],totalDataCodewords:514,errorCodewordsPerBlock:30}},{L:{groups:[[8,106],[4,107]],totalDataCodewords:1276,errorCodewordsPerBlock:26},M:{groups:[[8,47],[13,48]],totalDataCodewords:1e3,errorCodewordsPerBlock:28},Q:{groups:[[7,24],[22,25]],totalDataCodewords:718,errorCodewordsPerBlock:30},H:{groups:[[22,15],[13,16]],totalDataCodewords:538,errorCodewordsPerBlock:30}},{L:{groups:[[10,114],[2,115]],totalDataCodewords:1370,errorCodewordsPerBlock:28},M:{groups:[[19,46],[4,47]],totalDataCodewords:1062,errorCodewordsPerBlock:28},Q:{groups:[[28,22],[6,23]],totalDataCodewords:754,errorCodewordsPerBlock:28},H:{groups:[[33,16],[4,17]],totalDataCodewords:596,errorCodewordsPerBlock:30}},{L:{groups:[[8,122],[4,123]],totalDataCodewords:1468,errorCodewordsPerBlock:30},M:{groups:[[22,45],[3,46]],totalDataCodewords:1128,errorCodewordsPerBlock:28},Q:{groups:[[8,23],[26,24]],totalDataCodewords:808,errorCodewordsPerBlock:30},H:{groups:[[12,15],[28,16]],totalDataCodewords:628,errorCodewordsPerBlock:30}},{L:{groups:[[3,117],[10,118]],totalDataCodewords:1531,errorCodewordsPerBlock:30},M:{groups:[[3,45],[23,46]],totalDataCodewords:1193,errorCodewordsPerBlock:28},Q:{groups:[[4,24],[31,25]],totalDataCodewords:871,errorCodewordsPerBlock:30},H:{groups:[[11,15],[31,16]],totalDataCodewords:661,errorCodewordsPerBlock:30}},{L:{groups:[[7,116],[7,117]],totalDataCodewords:1631,errorCodewordsPerBlock:30},M:{groups:[[21,45],[7,46]],totalDataCodewords:1267,errorCodewordsPerBlock:28},Q:{groups:[[1,23],[37,24]],totalDataCodewords:911,errorCodewordsPerBlock:30},H:{groups:[[19,15],[26,16]],totalDataCodewords:701,errorCodewordsPerBlock:30}},{L:{groups:[[5,115],[10,116]],totalDataCodewords:1735,errorCodewordsPerBlock:30},M:{groups:[[19,47],[10,48]],totalDataCodewords:1373,errorCodewordsPerBlock:28},Q:{groups:[[15,24],[25,25]],totalDataCodewords:985,errorCodewordsPerBlock:30},H:{groups:[[23,15],[25,16]],totalDataCodewords:745,errorCodewordsPerBlock:30}},{L:{groups:[[13,115],[3,116]],totalDataCodewords:1843,errorCodewordsPerBlock:30},M:{groups:[[2,46],[29,47]],totalDataCodewords:1455,errorCodewordsPerBlock:28},Q:{groups:[[42,24],[1,25]],totalDataCodewords:1033,errorCodewordsPerBlock:30},H:{groups:[[23,15],[28,16]],totalDataCodewords:793,errorCodewordsPerBlock:30}},{L:{groups:[[17,115]],totalDataCodewords:1955,errorCodewordsPerBlock:30},M:{groups:[[10,46],[23,47]],totalDataCodewords:1541,errorCodewordsPerBlock:28},Q:{groups:[[10,24],[35,25]],totalDataCodewords:1115,errorCodewordsPerBlock:30},H:{groups:[[19,15],[35,16]],totalDataCodewords:845,errorCodewordsPerBlock:30}},{L:{groups:[[17,115],[1,116]],totalDataCodewords:2071,errorCodewordsPerBlock:30},M:{groups:[[14,46],[21,47]],totalDataCodewords:1631,errorCodewordsPerBlock:28},Q:{groups:[[29,24],[19,25]],totalDataCodewords:1171,errorCodewordsPerBlock:30},H:{groups:[[11,15],[46,16]],totalDataCodewords:901,errorCodewordsPerBlock:30}},{L:{groups:[[13,115],[6,116]],totalDataCodewords:2191,errorCodewordsPerBlock:30},M:{groups:[[14,46],[23,47]],totalDataCodewords:1725,errorCodewordsPerBlock:28},Q:{groups:[[44,24],[7,25]],totalDataCodewords:1231,errorCodewordsPerBlock:30},H:{groups:[[59,16],[1,17]],totalDataCodewords:961,errorCodewordsPerBlock:30}},{L:{groups:[[12,121],[7,122]],totalDataCodewords:2306,errorCodewordsPerBlock:30},M:{groups:[[12,47],[26,48]],totalDataCodewords:1812,errorCodewordsPerBlock:28},Q:{groups:[[39,24],[14,25]],totalDataCodewords:1286,errorCodewordsPerBlock:30},H:{groups:[[22,15],[41,16]],totalDataCodewords:986,errorCodewordsPerBlock:30}},{L:{groups:[[6,121],[14,122]],totalDataCodewords:2434,errorCodewordsPerBlock:30},M:{groups:[[6,47],[34,48]],totalDataCodewords:1914,errorCodewordsPerBlock:28},Q:{groups:[[46,24],[10,25]],totalDataCodewords:1354,errorCodewordsPerBlock:30},H:{groups:[[2,15],[64,16]],totalDataCodewords:1054,errorCodewordsPerBlock:30}},{L:{groups:[[17,122],[4,123]],totalDataCodewords:2566,errorCodewordsPerBlock:30},M:{groups:[[29,46],[14,47]],totalDataCodewords:1992,errorCodewordsPerBlock:28},Q:{groups:[[49,24],[10,25]],totalDataCodewords:1426,errorCodewordsPerBlock:30},H:{groups:[[24,15],[46,16]],totalDataCodewords:1096,errorCodewordsPerBlock:30}},{L:{groups:[[4,122],[18,123]],totalDataCodewords:2702,errorCodewordsPerBlock:30},M:{groups:[[13,46],[32,47]],totalDataCodewords:2102,errorCodewordsPerBlock:28},Q:{groups:[[48,24],[14,25]],totalDataCodewords:1502,errorCodewordsPerBlock:30},H:{groups:[[42,15],[32,16]],totalDataCodewords:1142,errorCodewordsPerBlock:30}},{L:{groups:[[20,117],[4,118]],totalDataCodewords:2812,errorCodewordsPerBlock:30},M:{groups:[[40,47],[7,48]],totalDataCodewords:2216,errorCodewordsPerBlock:28},Q:{groups:[[43,24],[22,25]],totalDataCodewords:1582,errorCodewordsPerBlock:30},H:{groups:[[10,15],[67,16]],totalDataCodewords:1222,errorCodewordsPerBlock:30}},{L:{groups:[[19,118],[6,119]],totalDataCodewords:2956,errorCodewordsPerBlock:30},M:{groups:[[18,47],[31,48]],totalDataCodewords:2334,errorCodewordsPerBlock:28},Q:{groups:[[34,24],[34,25]],totalDataCodewords:1666,errorCodewordsPerBlock:30},H:{groups:[[20,15],[61,16]],totalDataCodewords:1276,errorCodewordsPerBlock:30}}],tt=[1,0,1,1,1],ir=[1,0,1],rr={L:"01",M:"00",Q:"11",H:"10"},ur="101010000010010",fr="10100110111",er="1111100100101",or=["11101100","00010001"],sr=93,it=[function(n,t){return(n+t)%2==0},function(n){return n%2==0},function(n,t){return t%3==0},function(n,t){return(n+t)%3==0},function(n,t){return(Math.floor(n/2)+Math.floor(t/3))%2==0},function(n,t){return n*t%2+n*t%3==0},function(n,t){return(n*t%2+n*t%3)%2==0},function(n,t){return((n+t)%2+n*t%3)%2==0}],hr=/^\d+/,dt="A-Z0-9 $%*+./:-",cr=new RegExp("^[A-Z $%*+./:-]+"),gt=new RegExp("^["+dt+"]+"),ni=new RegExp("^[^"+dt+"]+"),lr=8,ar=5,vr=8,yr=17,pr=9,wr=16,w=Math.round,rt=e.Class.extend({getVersionIndex:function(n){return n<10?0:n>26?2:1},getBitsCharacterCount:function(n){var t=this;return t.bitsInCharacterCount[t.getVersionIndex(n||40)]},getModeCountString:function(n,t){var i=this;return i.modeIndicator+r(n,i.getBitsCharacterCount(t))},encode:function(){},getStringBitsLength:function(){},getValue:function(){},modeIndicator:"",bitsInCharacterCount:[]}),h={},o,ut,ft,et,ot,st,ht;h[kt]=rt.extend({bitsInCharacterCount:[10,12,14],modeIndicator:"0001",getValue:function(n){return parseInt(n,10)},encode:function(n,t){for(var e=this,u=ti(n,3),f=e.getModeCountString(n.length,t),i=0;i<u.length-1;i++)f+=r(u[i],10);return f+r(u[i],1+3*u[i].length)},getStringBitsLength:function(n,t){var i=n%3;return 4+this.getBitsCharacterCount(t)+10*Math.floor(n/3)+3*i+(i===0?0:1)}});h[g]=rt.extend({characters:{"0":0,"1":1,"2":2,"3":3,"4":4,"5":5,"6":6,"7":7,"8":8,"9":9,A:10,B:11,C:12,D:13,E:14,F:15,G:16,H:17,I:18,J:19,K:20,L:21,M:22,N:23,O:24,P:25,Q:26,R:27,S:28,T:29,U:30,V:31,W:32,X:33,Y:34,Z:35," ":36,$:37,"%":38,"*":39,"+":40,"-":41,".":42,"/":43,":":44},bitsInCharacterCount:[9,11,13],modeIndicator:"0010",getValue:function(n){return this.characters[n]},encode:function(n,t){for(var f=this,u=ti(n,2),o=f.getModeCountString(n.length,t),e,i=0;i<u.length-1;i++)e=45*f.getValue(u[i].charAt(0))+f.getValue(u[i].charAt(1)),o+=r(e,11);return e=u[i].length==2?45*f.getValue(u[i].charAt(0))+f.getValue(u[i].charAt(1)):f.getValue(u[i].charAt(0)),o+r(e,1+5*u[i].length)},getStringBitsLength:function(n,t){return 4+this.getBitsCharacterCount(t)+11*Math.floor(n/2)+6*(n%2)}});h[nt]=rt.extend({bitsInCharacterCount:[8,16,16],modeIndicator:"0100",getValue:function(n){var t=n.charCodeAt(0);if(t<=127||160<=t&&t<=255)return t;throw new Error("Unsupported character: "+n);},encode:function(n,t){for(var u=this,f=u.getModeCountString(n.length,t),i=0;i<n.length;i++)f+=r(u.getValue(n.charAt(i)),8);return f},getStringBitsLength:function(n,t){return 4+this.getBitsCharacterCount(t)+8*n}});o={};for(ut in h)o[ut]=new h[ut];ft=function(n){var u=this,i=n.length-1,r=n.length-1,f=r,e=-1,o=0;u.move=function(){i+=e*o;o^=1;r=f-o};u.getNextCell=function(){while(n[i][r]!==t)u.move(),(i<0||i>=n.length)&&(e=-e,f-=f!=8?2:3,r=f,i=e<0?n.length-1:0);return{row:i,column:r}};u.getNextRemainderCell=function(){return u.move(),n[i][r]===t?{row:i,column:r}:void 0}};et=function(n,t){for(var f,e,s=new ft(n[0]),i,u,r,o=0;o<t.length;o++)for(i=t[o],u=0;i.length>0;){for(f=0;f<i.length;f++)for(e=0;e<8;e++)r=s.getNextCell(),ii(n,i[f][u].charAt(e),r.row,r.column);for(u++;i[0]&&u==i[0].length;)i.splice(0,1)}while(r=s.getNextRemainderCell())ii(n,0,r.row,r.column)};ot=function(n,t){for(var i=t*8,r=0,u=0;n.length<i&&r<bt.length;)n+=bt.charAt(r++);for(n.length%8!=0&&(n+=new Array(9-n.length%8).join("0"));n.length<i;)n+=or[u],u^=1;return n};st=function(n,t){for(var r=[],u=n.length-2,i=u;i>=0;i--)r[i]=n[i]^t[i];return r};ht=function(n,i){for(var r,e=[],f=0;f<n.length;f++)for(r=0;r<i.length;r++)e[f+r]=e[f+r]===t?(n[f]+(i[r]>=0?i[r]:0))%255:y[u[e[f+r]]^u[(n[f]+i[r])%255]];return e};br();kr();var ri=function(n,t){for(var f=p[t-1],u=new Array(t).concat(n),e=new Array(u.length-f.length).concat(f),h=n.length,o=[],s,i=0;i<h;i++)s=dr(e,y[u[u.length-1]]),e.splice(0,1),u=st(s,u);for(i=u.length-1;i>=0;i--)o[t-1-i]=r(u[i],8);return o},ui=function(n,t){for(var c,r,u=0,l=[],a=[],f,e=t.groups,o,v,s,h,i=0;i<e.length;i++)for(v=e[i][0],c=0;c<v;c++){for(o=e[i][1],f=[],s=[],r=1;r<=o;r++)h=n.substring(u,u+8),f.push(h),s[o-r]=b(h),u+=8;l.push(f);a.push(ri(s,t.errorCodewordsPerBlock))}return[l,a]},ct=function(n,t,i,r,u){var h=hr.exec(n),f=h?h[0]:"",c=cr.exec(n),a=c?c[0]:"",l=gt.exec(n),e=l?l[0]:"",o,s;return f&&(f.length>=t||n.length==f.length||f.length>=i&&!gt.test(n.charAt(f.length)))?(o=kt,s=f):e&&(n.length==e.length||e.length>=r||u==g)?(o=g,s=f||a):(o=nt,s=e?e+ni.exec(n.substring(e.length))[0]:ni.exec(n)[0]),{mode:o,modeString:s}},fi=function(n){var t=[],r,u=0,i;for(t.push(ct(n,lr,ar,vr,r)),r=t[0].mode,n=n.substr(t[0].modeString.length);n.length>0;)i=ct(n,yr,pr,wr,r),i.mode!=r?(r=i.mode,t.push(i),u++):t[u].modeString+=i.modeString,n=n.substr(i.modeString.length);return t},ei=function(n){for(var i=0,r,t=0;t<n.length;t++)r=o[n[t].mode],i+=r.getStringBitsLength(n[t].modeString.length);return Math.ceil(i/8)},lt=function(n,t){var i=0,u=s.length-1,r=Math.floor(s.length/2);do n<s[r][t].totalDataCodewords?u=r:i=r,r=i+Math.floor((u-i)/2);while(u-i>1);return n<=s[i][t].totalDataCodewords?r+1:u+1},oi=function(n,t){for(var r="",u,i=0;i<n.length;i++)u=o[n[i].mode],r+=u.encode(n[i].modeString,t);return r},si=function(n){var u=b(n),i,r="",t;if(u===0)return"101010000010010";for(i=at(b(n),fr,15),t=0;t<i.length;t++)r+=i.charAt(t)^ur.charAt(t);return r},at=function(n,t,i){var f=b(t),u=t.length-1,e=n<<u,o=i-u,s=r(n,o),h=hi(e,f);return s+r(h,u)},hi=function(n,t){var r=t.toString(2).length,i=n.toString(2).length;do n^=t<<i-r,i=n.toString(2).length;while(i>=r);return n};var ci=function(n){for(var i,r=[],u=17+4*n,t=0;t<it.length;t++)for(r[t]=new Array(u),i=0;i<u;i++)r[t][i]=new Array(u);return r},vt=function(n,t){for(var f=n[0],e=0,o=t.length,r=0,u=8;r<=8;r++)r!==6&&i(n,c(t,o-1-e++),r,u);for(r=8,u=7;u>=0;u--)u!==6&&i(n,c(t,o-1-e++),r,u);for(e=0,u=f.length-1,r=8;u>=f.length-8;u--)i(n,c(t,o-1-e++),r,u);for(i(n,1,f.length-8,8),r=f.length-7,u=8;r<f.length;r++)i(n,c(t,o-1-e++),r,u)},li=function(n){return at(n,er,18)},yt=function(n,t){for(var s=n[0],o=s.length,h=o-11,l=o-11,u,f,e,r=0;r<t.length;r++)u=Math.floor(r/3),f=r%3,e=c(t,t.length-r-1),i(n,e,0+u,h+f),i(n,e,l+f,0+u)},l=function(n,t,r,u){for(var e,h=t.length+2,s=t.length+1,o,f=0;f<t.length;f++)for(e=f;e<h-f;e++)o=t[f],i(n,o,r+e,u+f),i(n,o,r+f,u+e),i(n,o,r+s-e,u+s-f),i(n,o,r+s-f,u+s-e)},k=function(n,t,r,u){var f=r,e=u,o=n[0];do i(n,0,f,u),i(n,0,r,e),f+=t[0],e+=t[1];while(f>=0&&f<o.length)},ai=function(n){var t=n[0].length;l(n,tt,0,0);k(n,[-1,-1],7,7);l(n,tt,t-7,0);k(n,[1,-1],t-8,7);l(n,tt,0,t-7);k(n,[-1,1],7,t-8)},vi=function(n,i){var u,f;if(!(i<2)){var c=n[0],s=c.length,a=Math.floor(i/7),r=[6],e,o,h=0;for((e=tr[i])?o=(s-13-e)/a:e=o=(s-13)/(a+1),r.push(r[h++]+e);r[h]+o<s;)r.push(r[h++]+o);for(u=0;u<r.length;u++)for(f=0;f<r.length;f++)c[r[u]][r[f]]===t&&l(n,ir,r[u]-2,r[f]-2)}},yi=function(n){for(var r=1,u=n[0].length,t=8;t<u-8;t++)i(n,r,6,t),i(n,r,t,6),r^=1},pi=function(n){for(var u=[],e=[],h=[],c=[],l=[],f,o=0,v=1,s=n[0].length,r,i,y,p,a,t=0;t<n.length;t++)u[t]=0,h[t]=0,l[t]=[0,0],c[t]=[0,0],e[t]=[];for(t=0;t<s;t++)for(r=0;r<s;r++)for(i=0;i<n.length;i++)f=n[i],h[i]+=parseInt(f[t][r],10),e[i][o]===f[t][r]&&t+1<s&&r-1>=0&&f[t+1][r]==e[i][o]&&f[t+1][r-1]==e[i][o]&&(u[i]+=3),wi(i,c,u,o,f[t][r]),wi(i,c,u,v,f[r][t]),bi(i,u,e,f[t][r],l,o),bi(i,u,e,f[r][t],l,v);for(y=s*s,a=Number.MAX_VALUE,t=0;t<u.length;t++)u[t]+=gr(h[t],y),u[t]<a&&(a=u[t],p=t);return p};var ki=function(n,t){this.dataString=n;this.version=t},nu=function(){this.getEncodingResult=function(n,t){var i=fi(n),u=ei(i),r=lt(u,t),f=oi(i,r);return new ki(f,r)}},d=function(){this.mode=o[this.encodingMode]};d.fn=d.prototype={encodingMode:nt,utfBOM:"111011111011101110111111",initialModeCountStringLength:20,getEncodingResult:function(n,t){var i=this,r=i.encode(n),f=i.getDataCodewordsCount(r),u=lt(f,t),e=i.mode.getModeCountString(r.length/8,u)+r;return new ki(e,u)},getDataCodewordsCount:function(n){var t=this,i=n.length;return Math.ceil((t.initialModeCountStringLength+i)/8)},encode:function(n){for(var i=this,r=i.utfBOM,t=0;t<n.length;t++)r+=i.encodeCharacter(n.charCodeAt(t));return r},encodeCharacter:function(n){var u=this.getBytesCount(n),e=u-1,t="",f,i;if(u==1)t=r(n,8);else{for(f=8-u,i=0;i<e;i++)t=r(n>>i*6&63|128,8)+t;t=(n>>e*6|255>>f<<f).toString(2)+t}return t},getBytesCount:function(n){for(var i=this.ranges,t=0;t<i.length;t++)if(n<i[t])return t+1},ranges:[128,2048,65536,2097152,67108864]};var tu=function(n){return n&&n.toLowerCase().indexOf("utf_8")>=0?new d:new nu},di=function(n,t,i){var a=new tu(i),h=a.getEncodingResult(n,t),f=h.version,c=s[f-1][t],v=ot(h.dataString,c.totalDataCodewords),y=ui(v,c),u=ci(f),o,e,l;return ai(u),vi(u,f),yi(u),f>=7&&yt(u,r(0,18)),vt(u,r(0,15)),et(u,y),o=pi(u),e=u[o],f>=7&&yt([e],li(f)),l=rr[t]+r(o,3),vt([e],si(l)),e},f={DEFAULT_SIZE:200,QUIET_ZONE_LENGTH:4,DEFAULT_ERROR_CORRECTION_LEVEL:"L",DEFAULT_BACKGROUND:"#fff",DEFAULT_DARK_MODULE_COLOR:"#000",MIN_BASE_UNIT_SIZE:1},pt=wt.extend({init:function(t,i){var r=this;wt.fn.init.call(r,t,i);r.element=n(t);r.wrapper=r.element;r.element.addClass("k-qrcode");r.surfaceWrap=n("<div />").css("position","relative").appendTo(this.element);r.surface=a.Surface.create(r.surfaceWrap,{type:r.options.renderAs});r.setOptions(i)},redraw:function(){var n=this._getSize();this.surfaceWrap.css({width:n,height:n});this.surface.clear();this.createVisual();this.surface.draw(this.visual)},getSize:function(){return e.dimensions(this.element)},_resize:function(){this.redraw()},createVisual:function(){this.visual=this._render()},exportVisual:function(){return this._render()},_render:function(){var n=this,s=n._value,r,u=n.options.border||{},h=n.options.padding||0,f=u.width||0,c,t,e,l,o,i;return u.width=f,i=new a.Group,s&&(t=di(s,n.options.errorCorrection,n.options.encoding),e=n._getSize(),o=e-2*(f+h),r=n._calculateBaseUnit(o,t.length),l=t.length*r,c=f+h+(o-l)/2,i.append(n._renderBackground(e,u)),i.append(n._renderMatrix(t,r,c))),i},_getSize:function(){var n=this,t,i,r;return n.options.size?t=parseInt(n.options.size,10):(i=n.element,r=Math.min(i.width(),i.height()),t=r>0?r:f.DEFAULT_SIZE),t},_calculateBaseUnit:function(n,t){var i=Math.floor(n/t);if(i<f.MIN_BASE_UNIT_SIZE)throw new Error("Insufficient size.");return i*t>=n&&i-1>=f.MIN_BASE_UNIT_SIZE&&i--,i},_renderMatrix:function(n,t,i){for(var f,r,o,e=new a.MultiPath({fill:{color:this.options.color},stroke:null}),u=0;u<n.length;u++)for(f=i+u*t,r=0;r<n.length;){while(n[u][r]===0&&r<n.length)r++;if(r<n.length){for(o=r;n[u][r]==1;)r++;var s=w(i+o*t),h=w(f),c=w(i+r*t),l=w(f+t);e.moveTo(s,h).lineTo(s,l).lineTo(c,l).lineTo(c,h).close()}}return e},_renderBackground:function(n,t){var i=nr(0,0,n,n).unpad(t.width/2);return a.Path.fromRect(i.toRect(),{fill:{color:this.options.background},stroke:{color:t.color,width:t.width}})},setOptions:function(n){var i=this;n=n||{};i.options=gi(i.options,n);n.value!==t&&(i._value=i.options.value+"");i.redraw()},value:function(n){var i=this;if(n===t)return i._value;i._value=n+"";i.redraw()},options:{name:"QRCode",renderAs:"svg",encoding:"ISO_8859_1",value:"",errorCorrection:f.DEFAULT_ERROR_CORRECTION_LEVEL,background:f.DEFAULT_BACKGROUND,color:f.DEFAULT_DARK_MODULE_COLOR,size:"",padding:0,border:{color:"",width:0}}});v.ExportMixin.extend(pt.fn);v.ui.plugin(pt);e.deepExtend(v,{QRCode:pt,QRCodeDefaults:f,QRCodeFunctions:{FreeCellVisitor:ft,fillData:et,padDataString:ot,generateErrorCodewords:ri,xorPolynomials:st,getBlocks:ui,multiplyPolynomials:ht,chooseMode:ct,getModes:fi,getDataCodewordsCount:ei,getVersion:lt,getDataString:oi,encodeFormatInformation:si,encodeBCH:at,dividePolynomials:hi,initMatrices:ci,addFormatInformation:vt,encodeVersionInformation:li,addVersionInformation:yt,addCentricPattern:l,addFinderSeparator:k,addFinderPatterns:ai,addAlignmentPatterns:vi,addTimingFunctions:yi,scoreMaskMatrixes:pi,encodeData:di,UTF8Encoder:d},QRCodeFields:{modes:o,powersOfTwo:y,powersOfTwoResult:u,generatorPolynomials:p}})})(window.kendo.jQuery)}(),function(){(function(n){function g(){}function pt(n){return g.prototype=n,new g}var e=window.kendo,nt=e.Class,tt=e.Observable,t=e.deepExtend,y=Math,l=n.proxy,a=e.util,it=a.last,rt=a.renderTemplate,i=e.dataviz,p=a.defined,ut=i.filterSeriesByType,ft=e.template,s=i.ui.Chart,et=i.Selection,v=i.addDuration,w=a.limitValue,b=i.lteDateIndex,r=i.toDate,o=i.toTime,ot=28,k="change",c="k-",st="drag",ht="dragEnd",h="_navigator",u=h,ct=i.EQUALLY_SPACED_SERIES,lt=3,at="zoom",vt="zoomEnd",yt=s.extend({init:function(t,i){n(t).addClass(c+"chart");s.fn.init.call(this,t,i)},_applyDefaults:function(n,r){var u=this,e=u.element.width()||i.DEFAULT_WIDTH,o={seriesDefaults:{categoryField:n.dateField},axisDefaults:{categoryAxis:{name:"default",majorGridLines:{visible:!1},labels:{step:2},majorTicks:{visible:!1},maxDateGroups:y.floor(e/ot)}}};r&&(r=t({},r,o));u._navigator||f.setup(n,r);s.fn._applyDefaults.call(u,n,r)},_initDataSource:function(n){var e=n||{},u=e.dataSource,c=u&&u.serverFiltering,l=[].concat(e.categoryAxis)[0],a=e.navigator||{},r=a.select,v=r&&r.from&&r.to,o,h;c&&v&&(o=[].concat(u.filter||[]),h=new i.DateCategoryAxis(t({baseUnit:"fit"},l,{categories:[r.from,r.to]})),u.filter=f.buildFilter(h.range().min,r.to).concat(o));s.fn._initDataSource.call(this,n)},options:{name:"StockChart",dateField:"date",axisDefaults:{categoryAxis:{type:"date",baseUnit:"fit",justified:!0},valueAxis:{narrowRange:!0,labels:{format:"C"}}},navigator:{select:{},seriesDefaults:{markers:{visible:!1},tooltip:{visible:!0,template:"#= kendo.toString(category, 'd') #"},line:{width:2}},hint:{},visible:!0},tooltip:{visible:!0},legend:{visible:!1}},_resize:function(){var n=this.options.transitions;this.options.transitions=!1;this._fullRedraw();this.options.transitions=n},_redraw:function(){var t=this,n=t._navigator;!this._dirty()&&n&&n.dataSource?n.redrawSlaves():t._fullRedraw()},_dirty:function(){var t=this.options,r=[].concat(t.series,t.navigator.series),i=n.grep(r,function(n){return n&&n.visible}).length,u=this._seriesCount!==i;return this._seriesCount=i,u},_fullRedraw:function(){var n=this,t=n._navigator;t||(t=n._navigator=new f(n));t._setRange();s.fn._redraw.call(n);t._initSelection()},_onDataChanged:function(){var n=this;s.fn._onDataChanged.call(n);n._dataBound=!0},_bindCategoryAxis:function(n,t,i){var e=this,f=e.options.categoryAxis,o=f.length,r;if(s.fn._bindCategoryAxis.apply(this,arguments),n.name===u)while(i<o)r=f[i++],r.pane==h&&(r.categories=n.categories)},_trackSharedTooltip:function(n){var t=this,r=t._plotArea,i=r.paneByPoint(n);i&&i.options.name===h?t._unsetActivePoint():s.fn._trackSharedTooltip.call(t,n)},destroy:function(){var n=this;n._navigator.destroy();s.fn.destroy.call(n)}}),f=tt.extend({init:function(n){var i=this;i.chart=n;i.options=t({},i.options,n.options.navigator);i._initDataSource();p(i.options.hint.visible)||(i.options.hint.visible=i.options.visible);n.bind(st,l(i._drag,i));n.bind(ht,l(i._dragEnd,i));n.bind(at,l(i._zoom,i));n.bind(vt,l(i._zoomEnd,i))},options:{},_initDataSource:function(){var n=this,i=n.options,t=i.autoBind,r=i.dataSource;p(t)||(t=n.chart.options.autoBind);n._dataChangedHandler=l(n._onDataChanged,n);r&&(n.dataSource=e.data.DataSource.create(r).bind(k,n._dataChangedHandler),t&&n.dataSource.fetch())},_onDataChanged:function(){for(var i=this,n=i.chart,o=n.options.series,a=o.length,s=n.options.categoryAxis,r,v=s.length,c=i.dataSource.view(),e,t,l,f=0;f<a;f++)e=o[f],e.axis==u&&n._isBindable(e)&&(e.data=c);for(r=0;r<v;r++)t=s[r],t.pane==h&&(t.name==u?(n._bindCategoryAxis(t,c,r),l=t.categories):t.categories=l);n._model&&(i.redraw(),i.filterAxes(),(!n.options.dataSource||n.options.dataSource&&n._dataBound)&&i.redrawSlaves())},destroy:function(){var n=this,t=n.dataSource;t&&t.unbind(k,n._dataChangeHandler);n.selection&&n.selection.destroy()},redraw:function(){this._redrawSelf();this._initSelection()},_initSelection:function(){var t=this,e=t.chart,f=t.options,i=t.mainAxis(),o=pt(i),s=i.range(),h=s.min,c=s.max,a=i.options.categories,l=t.options.select,u=t.selection,v=r(l.from),y=r(l.to);a.length!==0&&(u&&(u.destroy(),u.wrapper.remove()),o.box=i.box,u=t.selection=new et(e,o,{min:h,max:c,from:v,to:y,selectStart:n.proxy(t._selectStart,t),select:n.proxy(t._select,t),selectEnd:n.proxy(t._selectEnd,t),mousewheel:{zoom:"left"}}),f.hint.visible&&(t.hint=new d(e.element,{min:h,max:c,template:f.hint.template,format:f.hint.format})))},_setRange:function(){var c=this.chart._createPlotArea(!0),e=c.namedCategoryAxes[u],o=e.options,s=e.range(),t=s.min,i=v(s.max,o.baseUnitStep,o.baseUnit),h=this.options.select||{},f=r(h.from)||t,n;f<t&&(f=t);n=r(h.to)||i;n>i&&(n=i);this.options.select={from:f,to:n};this.filterAxes()},_redrawSelf:function(n){var t=this.chart._plotArea;t&&t.redraw(it(t.panes),n)},redrawSlaves:function(){var i=this,t=i.chart,n=t._plotArea,r=n.panes.slice(0,-1);n.srcSeries=t.options.series;n.redraw(r)},_drag:function(n){var t=this,c=t.chart,v=c._eventCoordinates(n.originalEvent),l=t.mainAxis(),u=l.datesRange(),y=l.pane.box.containsPoint(v),p=c._plotArea.categoryAxis,a=n.axisRanges[p.options.name],f=t.options.select,e=t.selection,s,i,h;a&&!y&&e&&(s=f.from&&f.to?o(f.to)-o(f.from):o(e.options.to)-o(e.options.from),i=r(w(o(a.min),u.min,o(u.max)-s)),h=r(w(o(i)+s,o(u.min)+s,u.max)),t.options.select={from:i,to:h},t._liveDrag()&&(t.filterAxes(),t.redrawSlaves()),e.set(i,h),t.showHint(i,h))},_dragEnd:function(){var n=this;n.filterAxes();n.filterDataSource();n.redrawSlaves();n.hint&&n.hint.hide()},_liveDrag:function(){var t=e.support,i=t.touch,n=t.browser,r=n.mozilla,u=n.msie&&n.version<9;return!i&&!r&&!u},readSelection:function(){var n=this,r=n.selection,t=r.options,i=n.options.select;i.from=t.from;i.to=t.to},filterAxes:function(){for(var i=this,u=i.options.select||{},e=i.chart,f=e.options.categoryAxis,o=u.from,s=u.to,t,n=0;n<f.length;n++)t=f[n],t.pane!==h&&(t.min=r(o),t.max=r(s))},filterDataSource:function(){var r=this,e=r.options.select||{},o=r.chart,u=o.dataSource,s=u&&u.options.serverFiltering,n;r.dataSource&&s&&(n=new i.DateCategoryAxis(t({baseUnit:"fit"},o.options.categoryAxis[0],{categories:[e.from,e.to]})).options,u.filter(f.buildFilter(v(n.min,-n.baseUnitStep,n.baseUnit),v(n.max,n.baseUnitStep,n.baseUnit))))},_zoom:function(n){var t=this,c=t.chart,u=n.delta,f=c._plotArea.categoryAxis,r=t.options.select,i=t.selection,o=t.mainAxis().options.categories,s,h;i&&(s=b(i.options.from,o),h=b(i.options.to,o),n.originalEvent.preventDefault(),y.abs(u)>1&&(u*=lt),h-s>1?(i.expand(u),t.readSelection()):(f.options.min=r.from,r.from=f.scaleRange(-n.delta).min),e.support.touch||(t.filterAxes(),t.redrawSlaves()),i.set(r.from,r.to),t.showHint(t.options.select.from,t.options.select.to))},_zoomEnd:function(n){this._dragEnd(n)},showHint:function(n,t){var i=this,r=i.chart,u=r._plotArea;i.hint&&i.hint.show(n,t,u.backgroundBox())},_selectStart:function(n){var t=this.chart;t._selectStart.call(t,n)},_select:function(n){var t=this,i=t.chart;t.showHint(n.from,n.to);i._select.call(i,n)},_selectEnd:function(n){var t=this,i=t.chart;t.hint&&t.hint.hide();t.readSelection();t.filterAxes();t.filterDataSource();t.redrawSlaves();i._selectEnd.call(i,n)},mainAxis:function(){var n=this.chart._plotArea;if(n)return n.namedCategoryAxes[u]}}),d;f.setup=function(n,i){n=n||{};i=i||{};var r=t({},i.navigator,n.navigator),e=n.panes=[].concat(n.panes),u=t({},r.pane,{name:h});r.visible||(u.visible=!1,u.height=.1);e.push(u);f.attachAxes(n,r);f.attachSeries(n,r,i)};f.attachAxes=function(n,i){var e,o,c=i.series||[];e=n.categoryAxis=[].concat(n.categoryAxis);o=n.valueAxis=[].concat(n.valueAxis);var l=ut(c,ct),s=l.length===0,r=t({type:"date",pane:h,roundToBaseUnit:!s,justified:s,_collapse:!1,majorTicks:{visible:!0},tooltip:{visible:!1},labels:{step:1},autoBind:!i.dataSource,autoBaseUnitSteps:{minutes:[1],hours:[1,2],days:[1,2],weeks:[],months:[1],years:[1]},_overlap:!1}),f=i.categoryAxis;e.push(t({},r,{maxDateGroups:200},f,{name:u,baseUnit:"fit",baseUnitStep:"auto",labels:{visible:!1},majorTicks:{visible:!1}}),t({},r,f,{name:u+"_labels",maxDateGroups:20,baseUnitStep:"auto",plotBands:[],autoBaseUnitSteps:{minutes:[]}}),t({},r,f,{name:u+"_ticks",maxDateGroups:200,majorTicks:{width:.5},plotBands:[],labels:{visible:!1,mirror:!0}}));o.push(t({name:u,pane:h,majorGridLines:{visible:!1},visible:!1},i.valueAxis))};f.attachSeries=function(n,i,r){for(var s=n.series=n.series||[],e=[].concat(i.series||[]),o=r.seriesColors,h=i.seriesDefaults,f=0;f<e.length;f++)s.push(t({color:o[f%o.length],categoryField:i.dateField,visibleInLegend:!1,tooltip:{visible:!1}},h,e[f],{axis:u,categoryAxis:u,autoBind:!i.dataSource}))};f.buildFilter=function(n,t){return[{field:"Date",operator:"gte",value:r(n)},{field:"Date",operator:"lt",value:r(t)}]};d=nt.extend({init:function(i,r){var u=this;u.options=t({},u.options,r);u.container=i;u.chartPadding={top:parseInt(i.css("paddingTop"),10),left:parseInt(i.css("paddingLeft"),10)};u.template=u.template;u.template||(u.template=u.template=rt("<div class='"+c+"navigator-hint' style='display: none; position: absolute; top: 1px; left: 1px;'><div class='"+c+"tooltip "+c+"chart-tooltip'>&nbsp;<\/div><div class='"+c+"scroll' /><\/div>"));u.element=n(u.template()).appendTo(i)},options:{format:"{0:d} - {1:d}",hideDelay:500},show:function(n,t,i){var u=this,y=r(o(n)+o(t-n)/2),f=u.options,h=e.format(u.options.format,n,t),s=u.element.find("."+c+"tooltip"),p=u.element.find("."+c+"scroll"),l=i.width()*.4,a=i.center().x-l,w=i.center().x,b=w-a,k=f.max-f.min,d=b/k,g=y-f.min,v;u._hideTimeout&&clearTimeout(u._hideTimeout);u._visible||(u.element.stop(!1,!0).css("visibility","hidden").show(),u._visible=!0);f.template&&(v=ft(f.template),h=v({from:n,to:t}));s.html(h).css({left:i.center().x-s.outerWidth()/2,top:i.y1});p.css({width:l,left:a+g*d,top:i.y1+parseInt(s.css("margin-top"),10)+parseInt(s.css("border-top-width"),10)+s.height()/2});u.element.css("visibility","visible")},hide:function(){var n=this;n._hideTimeout&&clearTimeout(n._hideTimeout);n._hideTimeout=setTimeout(function(){n._visible=!1;n.element.fadeOut("slow")},n.options.hideDelay)}});i.ui.plugin(yt);t(i,{Navigator:f})})(window.kendo.jQuery)}(),function(){(function(n){function a(n){return typeof n=="number"?[n]:n}var r=window.kendo,t=r.dataviz,u=t.ui.Chart,v=r.data.ObservableArray,e=t.SharedTooltip,i=r.deepExtend,y=n.isArray,p=n.proxy,o=t.inArray,f=Math,w="k-",b=150,k=150,s="bar",h="bullet",d="pie",g="leave",c=[s,h],nt=u.extend({init:function(t,r){var s=this,h=s.stage=n("<span />"),e=r||{};t=n(t).addClass(w+"sparkline").empty().append(h);s._initialWidth=f.floor(t.width());e=a(e);(y(e)||e instanceof v)&&(e={seriesDefaults:{data:e}});e.series||(e.series=[{data:a(e.data)}]);i(e,{seriesDefaults:{type:e.type}});(o(e.series[0].type,c)||o(e.seriesDefaults.type,c))&&(e=i({},{categoryAxis:{crosshair:{visible:!1}}},e));u.fn.init.call(s,t,e)},options:{name:"Sparkline",chartArea:{margin:2},axisDefaults:{visible:!1,majorGridLines:{visible:!1},valueAxis:{narrowRange:!0}},seriesDefaults:{type:"line",area:{line:{width:.5}},bar:{stack:!0},padding:2,width:.5,overlay:{gradient:null},highlight:{visible:!1},border:{width:0},markers:{size:2,visible:!1}},tooltip:{visible:!0,shared:!0},categoryAxis:{crosshair:{visible:!0,tooltip:{visible:!1}}},legend:{visible:!1},transitions:!1,pointWidth:5,panes:[{clip:!1}]},_modelOptions:function(){var t=this,f=t.options,r,e=t._initialWidth,o=t.stage,u;return t.stage.children().hide(),u=n("<span>&nbsp;<\/span>"),t.stage.append(u),r=i({width:e?e:t._autoWidth(),height:o.height(),transitions:f.transitions},f.chartArea,{inline:!0,align:!1}),o.css({width:r.width,height:r.height}),u.remove(),t.stage.children().show(),t.surface.resize(),r},_createTooltip:function(){var n=this,i=n.options,r=n.element,t;return t=n._sharedTooltip()?new l(r,n._plotArea,i.tooltip):u.fn._createTooltip.call(n),t.bind(g,p(n._tooltipleave,n)),t},_surfaceWrap:function(){return this.stage},_autoWidth:function(){for(var u=this,e=u.options,c=t.getSpacing(e.chartArea.margin),l=e.series,a=u.dataSource.total(),o=0,i,n,r=0;r<l.length;r++){if(n=l[r],n.type===s)return b;if(n.type===h)return k;if(n.type===d)return u.stage.height();n.data&&(o=f.max(o,n.data.length))}return i=f.max(a,o)*e.pointWidth,i>0&&(i+=c.left+c.right),i}}),l=e.extend({options:{animation:{duration:0}},_anchor:function(n,t){var i=e.fn._anchor.call(this,n,t),r=this._measure();return i.y=-r.height-this.options.offset,i},_hideElement:function(){this.element&&this.element.hide().remove()}});t.ui.plugin(nt);i(t,{SparklineSharedTooltip:l})})(window.kendo.jQuery)}(),function(){(function(){var t=Math,d=t.abs,y=t.atan,h=t.atan2,u=t.cos,p=t.max,w=t.min,r=t.sin,b=t.tan,e=window.kendo,k=e.Class,a=e.dataviz,g=e.deepExtend,o=e.util,nt=o.defined,c=o.deg,s=o.rad,v=o.round,i=o.sqr,l=o.valueOrDefault,n=k.extend({init:function(n,t){arguments.length===1?(this.lat=n[0],this.lng=n[1]):(this.lat=n,this.lng=t)},DISTANCE_ITERATIONS:100,DISTANCE_CONVERGENCE:1e-12,DISTANCE_PRECISION:2,FORMAT:"{0:N6},{1:N6}",toArray:function(){return[this.lat,this.lng]},equals:function(n){return n&&n.lat===this.lat&&n.lng===this.lng},clone:function(){return new n(this.lat,this.lng)},round:function(n){return this.lng=v(this.lng,n),this.lat=v(this.lat,n),this},wrap:function(){return this.lng=this.lng%180,this.lat=this.lat%90,this},distanceTo:function(n,t){return this.greatCircleTo(n,t).distance},destination:function(i,f,o){f=s(f);o=o||a.map.datums.WGS84;var l=s(this.lat),p=s(this.lng),v=i/e.dataviz.map.datums.WGS84.a,y=t.asin(r(l)*u(v)+u(l)*r(v)*u(f)),w=p+h(r(f)*r(v)*u(l),u(v)-r(l)*r(y));return new n(c(y),c(w))},greatCircleTo:function(f,e){var ct,ot;if(f=n.create(f),e=e||a.map.datums.WGS84,!f||this.clone().round(8).equals(f.clone().round(8)))return{distance:0,azimuthFrom:0,azimuthTo:0};for(var bt=e.a,st=e.b,nt=e.f,at=s(f.lng-this.lng),vt=y((1-nt)*b(s(this.lat))),tt=r(vt),w=u(vt),yt=y((1-nt)*b(s(f.lat))),it=r(yt),p=u(yt),rt=at,pt,kt=this.DISTANCE_ITERATIONS,wt=!1,ut,ft,k,g,et,o,ht;!wt&&kt-->0;)ut=r(rt),ft=u(rt),k=t.sqrt(i(p*ut)+i(w*it-tt*p*ft)),et=tt*it+w*p*ft,ht=h(k,et),ct=w*p*ut/k,g=1-i(ct),o=0,g!==0&&(o=et-2*tt*it/g),pt=rt,ot=nt/16*g*(4+nt*(4-3*g)),rt=at+(1-ot)*nt*ct*(ht+ot*k*(o+ot*et*(-1+2*i(o)))),wt=d(rt-pt)<=this.DISTANCE_CONVERGENCE;var l=g*(i(bt)-i(st))/i(st),dt=1+l/16384*(4096+l*(-768+l*(320-175*l))),lt=l/1024*(256+l*(-128+l*(74-47*l))),gt=lt*k*(o+lt/4*(et*(-1+2*i(o))-lt/6*o*(-3+4*i(k))*(-3+4*i(o)))),ni=h(p*ut,w*it-tt*p*ft),ti=h(w*ut,-tt*p+w*it*ft);return{distance:v(st*dt*(ht-gt),this.DISTANCE_PRECISION),azimuthFrom:c(ni),azimuthTo:c(ti)}}}),f;n.fn.toString=function(){return e.format(this.FORMAT,this.lat,this.lng)};n.fromLngLat=function(t){return new n(t[1],t[0])};n.fromLatLng=function(t){return new n(t[0],t[1])};n.create=function(t,i){if(nt(t))return t instanceof n?t.clone():arguments.length===1&&t.length===2?n.fromLatLng(t):new n(t,i)};f=k.extend({init:function(t,i){t=n.create(t);i=n.create(i);t.lng+180>i.lng+180&&t.lat+90<i.lat+90?(this.se=t,this.nw=i):(this.se=i,this.nw=t)},contains:function(n){var t=this.nw,i=this.se,r=l(n.lng,n[1]),u=l(n.lat,n[0]);return n&&r+180>=t.lng+180&&r+180<=i.lng+180&&u+90>=i.lat+90&&u+90<=t.lat+90},center:function(){var t=this.nw,i=this.se,r=t.lng+(i.lng-t.lng)/2,u=t.lat+(i.lat-t.lat)/2;return new n(u,r)},containsAny:function(n){for(var t=!1,i=0;i<n.length;i++)t=t||this.contains(n[i]);return t},include:function(n){var t=this.nw,i=this.se,r=l(n.lng,n[1]),u=l(n.lat,n[0]);t.lng=w(t.lng,r);t.lat=p(t.lat,u);i.lng=p(i.lng,r);i.lat=w(i.lat,u)},includeAll:function(n){for(var t=0;t<n.length;t++)this.include(n[t])},edges:function(){var t=this.nw,i=this.se;return{nw:this.nw,ne:new n(t.lat,i.lng),se:this.se,sw:new n(i.lat,t.lng)}},toArray:function(){var t=this.nw,i=this.se;return[t,new n(t.lat,i.lng),i,new n(i.lat,t.lng)]},overlaps:function(n){return this.containsAny(n.toArray())||n.containsAny(this.toArray())}});f.World=new f([90,-180],[-90,180]);f.create=function(n,t){return n instanceof f?n:n&&t?new f(n,t):n&&n.length===4&&!t?new f([n[0],n[1]],[n[2],n[3]]):void 0};g(a,{map:{Extent:f,Location:n}})})(window.kendo.jQuery)}(),function(){(function(){var n=window.kendo,t=n.ui.Widget,r=n.template,i=n.util.valueOrDefault,u=n.util.defined,f=t.extend({init:function(n,i){t.fn.init.call(this,n,i);this._initOptions(i);this.items=[];this.element.addClass("k-widget k-attribution")},options:{name:"Attribution",separator:"&nbsp;|&nbsp;",itemTemplate:"#= text #"},filter:function(n,t){this._extent=n;this._zoom=t;this._render()},add:function(n){u(n)&&(typeof n=="string"&&(n={text:n}),this.items.push(n),this._render())},remove:function(n){for(var i,r=[],t=0;t<this.items.length;t++)i=this.items[t],i.text!==n&&r.push(i);this.items=r;this._render()},clear:function(){this.items=[];this.element.empty()},_render:function(){for(var u,i,n=[],f=r(this.options.itemTemplate),t=0;t<this.items.length;t++)u=this.items[t],i=this._itemText(u),i!==""&&n.push(f({text:i}));n.length>0?this.element.empty().append(n.join(this.options.separator)).show():this.element.hide()},_itemText:function(n){var t="",i=this._inZoomLevel(n.minZoom,n.maxZoom),r=this._inArea(n.extent);return i&&r&&(t+=n.text),t},_inZoomLevel:function(n,t){return n=i(n,-Number.MAX_VALUE),t=i(t,Number.MAX_VALUE),this._zoom>n&&this._zoom<t},_inArea:function(n){var t=!0;return n&&(t=n.contains(this._extent)),t}});n.dataviz.ui.plugin(f)})(window.kendo.jQuery)}(),function(){(function(n){function r(n){return t.format('<button class="k-button k-navigator-{0}"><span class="k-icon k-i-arrow-{0}"/><\/button>',n)}var t=window.kendo,u=t.ui.Widget,i=t.keys,f=n.proxy,e=".kendoNavigator",o=r("n")+r("e")+r("s")+r("w"),s=u.extend({init:function(n,i){u.fn.init.call(this,n,i);this._initOptions(i);this.element.addClass("k-widget k-header k-shadow k-navigator").append(o).on("click"+e,".k-button",f(this,"_click"));var r=this.element.parent().closest("["+t.attr("role")+"]");this._keyroot=r.length>0?r:this.element;this._tabindex(this._keyroot);this._keydown=f(this._keydown,this);this._keyroot.on("keydown",this._keydown)},options:{name:"Navigator",panStep:1},events:["pan"],dispose:function(){this._keyroot.off("keydown",this._keydown)},_pan:function(n,t){var i=this.options.panStep;this.trigger("pan",{x:n*i,y:t*i})},_click:function(t){var r=0,u=0,i=n(t.currentTarget);i.is(".k-navigator-n")?u=1:i.is(".k-navigator-s")?u=-1:i.is(".k-navigator-e")?r=1:i.is(".k-navigator-w")&&(r=-1);this._pan(r,u);t.preventDefault()},_keydown:function(n){switch(n.which){case i.UP:this._pan(0,1);n.preventDefault();break;case i.DOWN:this._pan(0,-1);n.preventDefault();break;case i.RIGHT:this._pan(1,0);n.preventDefault();break;case i.LEFT:this._pan(-1,0);n.preventDefault()}}});t.dataviz.ui.plugin(s)})(window.kendo.jQuery)}(),function(){(function(n){function f(n,i){return t.format('<button class="k-button k-zoom-{0}" title="zoom-{0}">{1}<\/button>',n,i)}var t=window.kendo,i=t.ui.Widget,r=t.keys,u=n.proxy,e=".kendoZoomControl",o=f("in","+")+f("out","-"),s=187,h=189,c=61,l=173,a=i.extend({init:function(n,r){i.fn.init.call(this,n,r);this._initOptions(r);this.element.addClass("k-widget k-zoom-control k-button-wrap k-buttons-horizontal").append(o).on("click"+e,".k-button",u(this,"_click"));var f=this.element.parent().closest("["+t.attr("role")+"]");this._keyroot=f.length>0?f:this.element;this._tabindex(this._keyroot);this._keydown=u(this._keydown,this);this._keyroot.on("keydown",this._keydown)},options:{name:"ZoomControl",zoomStep:1},events:["change"],_change:function(n){var t=this.options.zoomStep;this.trigger("change",{delta:n*t})},_click:function(t){var r=n(t.currentTarget),i=1;r.is(".k-zoom-out")&&(i=-1);this._change(i);t.preventDefault()},_keydown:function(n){switch(n.which){case r.NUMPAD_PLUS:case s:case c:this._change(1);break;case r.NUMPAD_MINUS:case h:case l:this._change(-1)}}});t.dataviz.ui.plugin(a)})(window.kendo.jQuery)}(),function(){(function(){var n=Math,f=n.atan,l=n.exp,a=n.pow,v=n.sin,y=n.log,p=n.tan,t=window.kendo,i=t.Class,w=t.dataviz,rt=t.deepExtend,e=t.geometry,b=e.Point,ut=w.map,k=ut.Location,o=t.util,s=o.rad,d=o.deg,r=o.limitValue,u=n.PI,h=u/2,g=u/4,ft=u/180,nt={a:6378137,b:6356752.3142451793,f:.0033528106647474805,e:.081819190842621486},c=i.extend({init:function(n){this._initOptions(n)},MAX_LNG:180,MAX_LAT:85.0840590501,INVERSE_ITERATIONS:15,INVERSE_CONVERGENCE:1e-12,options:{centralMeridian:0,datum:nt},forward:function(n,t){var i=this,u=i.options,f=u.datum,e=f.a,o=u.centralMeridian,h=r(n.lat,-i.MAX_LAT,i.MAX_LAT),c=t?r(n.lng,-i.MAX_LNG,i.MAX_LNG):n.lng,l=s(c-o)*e,a=i._projectLat(h);return new b(l,a)},_projectLat:function(n){var t=this.options.datum,i=t.e,f=t.a,r=s(n),e=p(g+r/2),u=i*v(r),o=a((1-u)/(1+u),i/2);return f*y(e*o)},inverse:function(n,t){var i=this,f=i.options,e=f.datum,o=e.a,s=f.centralMeridian,u=n.x/(ft*o)+s,h=r(i._inverseY(n.y),-i.MAX_LAT,i.MAX_LAT);return t&&(u=r(u,-i.MAX_LNG,i.MAX_LNG)),new k(h,u)},_inverseY:function(t){for(var r=this,e=r.options.datum,p=e.a,o=e.e,w=o/2,s=l(-t/p),i=h-2*f(s),u=0;u<=r.INVERSE_ITERATIONS;u++){var c=o*v(i),b=a((1-c)/(1+c),w),y=h-2*f(s*b)-i;if(i+=y,n.abs(y)<=r.INVERSE_CONVERGENCE)break}return d(i)}}),tt=c.extend({MAX_LAT:85.0511287798,_projectLat:function(n){var t=this.options.datum.a,i=s(n),r=p(g+i/2);return t*y(r)},_inverseY:function(n){var t=this.options.datum.a,i=l(-n/t);return d(h-2*f(i))}}),it=i.extend({forward:function(n){return new b(n.lng,n.lat)},inverse:function(n){return new k(n.y,n.x)}}),et=i.extend({init:function(){var t=this,i=t._proj=new tt,n=this.c=2*u*i.options.datum.a;this._tm=e.transform().translate(.5,.5).scale(1/n,-1/n);this._itm=e.transform().scale(n,-n).translate(-.5,-.5)},toPoint:function(n,t,i){var r=this._proj.forward(n,i);return r.transform(this._tm).scale(t||1)},toLocation:function(n,t,i){return n=n.clone().scale(1/(t||1)).transform(this._itm),this._proj.inverse(n,i)}}),ot=i.extend({init:function(){this._proj=new c},toPoint:function(n){return this._proj.forward(n)},toLocation:function(n){return this._proj.inverse(n)}}),st=i.extend({init:function(){this._proj=new it},toPoint:function(n){return this._proj.forward(n)},toLocation:function(n){return this._proj.inverse(n)}});rt(w,{map:{crs:{EPSG3395:ot,EPSG3857:et,EPSG4326:st},datums:{WGS84:nt},projections:{Equirectangular:it,Mercator:c,SphericalMercator:tt}}})})(window.kendo.jQuery)}(),function(){(function(n){var t=n.proxy,i=window.kendo,f=i.Class,r=i.dataviz,e=i.deepExtend,o=r.map.Extent,s=i.util,u=s.defined,h=f.extend({init:function(i,r){this._initOptions(r);this.map=i;this.element=n("<div class='k-layer'><\/div>").css({zIndex:this.options.zIndex,opacity:this.options.opacity}).appendTo(i.scrollElement);this._beforeReset=t(this._beforeReset,this);this._reset=t(this._reset,this);this._resize=t(this._resize,this);this._panEnd=t(this._panEnd,this);this._activate();this._updateAttribution()},destroy:function(){this._deactivate()},show:function(){this.reset();this._activate();this._applyExtent(!0)},hide:function(){this._deactivate();this._setVisibility(!1)},reset:function(){this._beforeReset();this._reset()},_reset:function(){this._applyExtent()},_beforeReset:n.noop,_resize:n.noop,_panEnd:function(){this._applyExtent()},_applyExtent:function(){var n=this.options,t=this.map.zoom(),r=!u(n.minZoom)||t>=n.minZoom,f=!u(n.maxZoom)||t<=n.maxZoom,i=o.create(n.extent),e=!i||i.overlaps(this.map.extent());this._setVisibility(r&&f&&e)},_setVisibility:function(n){this.element.css("display",n?"":"none")},_activate:function(){var n=this.map;n.bind("beforeReset",this._beforeReset);n.bind("reset",this._reset);n.bind("resize",this._resize);n.bind("panEnd",this._panEnd)},_deactivate:function(){var n=this.map;n.unbind("beforeReset",this._beforeReset);n.unbind("reset",this._reset);n.unbind("resize",this._resize);n.unbind("panEnd",this._panEnd)},_updateAttribution:function(){var n=this.map.attribution;n&&n.add(this.options.attribution)}});e(r,{map:{layers:{Layer:h}}})})(window.kendo.jQuery)}(),function(){(function(n){var l=n.proxy,t=window.kendo,a=t.Class,v=t.data.DataSource,f=t.dataviz,e=t.deepExtend,y=t.util.last,p=t.util.defined,w=t.geometry,i=t.drawing,u=i.Group,o=f.map,s=o.Location,r=o.layers.Layer,h=r.extend({init:function(n,u){r.fn.init.call(this,n,u);this.surface=i.Surface.create(this.element,{width:n.scrollElement.width(),height:n.scrollElement.height()});this._initRoot();this.movable=new t.ui.Movable(this.surface.element);this._markers=[];this._click=this._handler("shapeClick");this.surface.bind("click",this._click);this._mouseenter=this._handler("shapeMouseEnter");this.surface.bind("mouseenter",this._mouseenter);this._mouseleave=this._handler("shapeMouseLeave");this.surface.bind("mouseleave",this._mouseleave);this._initDataSource()},options:{autoBind:!0},destroy:function(){r.fn.destroy.call(this);this.surface.destroy();this.dataSource.unbind("change",this._dataChange)},setDataSource:function(n){this.dataSource&&this.dataSource.unbind("change",this._dataChange);this.dataSource=t.data.DataSource.create(n);this.dataSource.bind("change",this._dataChange);this.options.autoBind&&this.dataSource.fetch()},_reset:function(){r.fn._reset.call(this);this._translateSurface();this._data&&this._load(this._data)},_initRoot:function(){this._root=new u;this.surface.draw(this._root)},_beforeReset:function(){this.surface.clear();this._initRoot()},_resize:function(){this.surface.size(this.map.size())},_initDataSource:function(){var n=this.options.dataSource;this._dataChange=l(this._dataChange,this);this.dataSource=v.create(n).bind("change",this._dataChange);n&&this.options.autoBind&&this.dataSource.fetch()},_dataChange:function(n){this._data=n.sender.view();this._load(this._data)},_load:function(n){var i,t,r;for(this._clearMarkers(),this._loader||(this._loader=new c(this.map,this.options.style,this)),i=new u,t=0;t<n.length;t++)r=this._loader.parse(n[t]),r&&i.append(r);this._root.clear();this._root.append(i)},shapeCreated:function(n){var t=!1,r;return n instanceof i.Circle&&(t=p(this._createMarker(n))),t||(r={layer:this,shape:n},t=this.map.trigger("shapeCreated",r)),t},_createMarker:function(n){var t=this.map.markers.bind({location:n.location},n.dataItem);return t&&this._markers.push(t),t},_clearMarkers:function(){for(var n=0;n<this._markers.length;n++)this.map.markers.remove(this._markers[n]);this._markers=[]},_panEnd:function(n){r.fn._panEnd.call(this,n);this._translateSurface()},_translateSurface:function(){var t=this.map,n=t.locationToView(t.extent().nw);this.surface.translate&&(this.surface.translate(n),this.movable.moveTo({x:n.x,y:n.y}))},_handler:function(n){var t=this;return function(i){if(i.element){var r={layer:t,shape:i.element,originalEvent:i.originalEvent};t.map.trigger(n,r)}}}}),c=a.extend({init:function(n,t,i){this.observer=i;this.locator=n;this.style=t},parse:function(n){var t=new u;return n.type==="Feature"?this._loadGeometryTo(t,n.geometry,n):this._loadGeometryTo(t,n,n),t.children.length<2&&(t=t.children[0]),t},_shapeCreated:function(n){var t=!1;return this.observer&&this.observer.shapeCreated&&(t=this.observer.shapeCreated(n)),t},_loadGeometryTo:function(n,t,i){var u=t.coordinates,r,f;switch(t.type){case"LineString":f=this._loadPolygon(n,[u],i);this._setLineFill(f);break;case"MultiLineString":for(r=0;r<u.length;r++)f=this._loadPolygon(n,[u[r]],i),this._setLineFill(f);break;case"Polygon":this._loadPolygon(n,u,i);break;case"MultiPolygon":for(r=0;r<u.length;r++)this._loadPolygon(n,u[r],i);break;case"Point":this._loadPoint(n,u,i);break;case"MultiPoint":for(r=0;r<u.length;r++)this._loadPoint(n,u[r],i)}},_setLineFill:function(n){var t=n.segments;(t.length<4||!t[0].anchor().equals(y(t).anchor()))&&(n.options.fill=null)},_loadShape:function(n,t){return this._shapeCreated(t)||n.append(t),t},_loadPolygon:function(n,t,i){var r=this._buildPolygon(t);return r.dataItem=i,this._loadShape(n,r)},_buildPolygon:function(n){for(var t,r,e=n.length>1?i.MultiPath:i.Path,f=new e(this.style),u=0;u<n.length;u++)for(t=0;t<n[u].length;t++)r=this.locator.locationToView(s.fromLngLat(n[u][t])),t===0?f.moveTo(r.x,r.y):f.lineTo(r.x,r.y);return f},_loadPoint:function(n,t,r){var f=s.fromLngLat(t),e=this.locator.locationToView(f),o=new w.Circle(e,10),u=new i.Circle(o,this.style);return u.dataItem=r,u.location=f,this._loadShape(n,u)}});e(t.data,{schemas:{geojson:{type:"json",data:function(n){return n.type==="FeatureCollection"?n.features:n.type==="GeometryCollection"?n.geometries:n}}},transports:{geojson:{read:{dataType:"json"}}}});e(f,{map:{layers:{shape:h,ShapeLayer:h},GeoJSONLoader:c}})})(window.kendo.jQuery)}(),function(){(function(){var n=window.kendo,i=n.getter,t=n.dataviz,o=n.deepExtend,s=n.util,r=s.defined,h=n.geometry,u=n.drawing,f=t.map,c=f.Location,l=f.layers.ShapeLayer,e=l.extend({options:{autoBind:!0,locationField:"location",valueField:"value",minSize:0,maxSize:100,scale:"sqrt",symbol:"circle"},_load:function(n){var t,h,a,l,f;if(this.surface.clear(),n.length!==0)for(t=this.options,h=i(t.valueField),n=n.slice(0),n.sort(function(n,t){return h(t)-h(n)}),a=this._scaleType(),f=0;f<n.length;f++){var e=n[f],u=i(t.locationField)(e),o=i(t.valueField)(e);if(r(u)&&r(o)){l||(l=new a([0,o],[t.minSize,t.maxSize]));u=c.create(u);var v=this.map.locationToView(u),y=l.map(o),s=this._createSymbol({center:v,size:y,style:t.style,dataItem:e,location:u});s.dataItem=e;s.location=u;s.value=o;this._drawSymbol(s)}}},_scaleType:function(){var i=this.options.scale;return n.isFunction(i)?i:t.map.scales[i]},_createSymbol:function(i){var r=this.options.symbol;return n.isFunction(r)||(r=t.map.symbols[r]),r(i)},_drawSymbol:function(n){var t={layer:this,shape:n},i=this.map.trigger("shapeCreated",t);i||this.surface.draw(n)}}),a=n.Class.extend({init:function(n,t){this._domain=n;this._range=t;var i=Math.sqrt(n[1])-Math.sqrt(n[0]),r=t[1]-t[0];this._ratio=r/i},map:function(n){var t=(Math.sqrt(n)-Math.sqrt(this._domain[0]))*this._ratio;return this._range[0]+t}}),v={circle:function(n){var t=new h.Circle(n.center,n.size/2);return new u.Circle(t,n.style)},square:function(n){var r=new u.Path(n.style),t=n.size/2,i=n.center;return r.moveTo(i.x-t,i.y-t).lineTo(i.x+t,i.y-t).lineTo(i.x+t,i.y+t).lineTo(i.x-t,i.y+t).close(),r}};o(t,{map:{layers:{bubble:e,BubbleLayer:e},scales:{sqrt:a},symbols:v}})})(window.kendo.jQuery)}(),function(){(function(n){function g(n){return new e(l(n.x),l(n.y))}var t=Math,o=n.proxy,i=window.kendo,f=i.Class,s=i.template,h=i.dataviz,b=i.deepExtend,k=i.geometry,e=k.Point,r=h.map.layers.Layer,u=i.util,c=u.objectKey,l=u.round,a=u.renderSize,d=u.limitValue,v=r.extend({init:function(n,t){r.fn.init.call(this,n,t);typeof this.options.subdomains=="string"&&(this.options.subdomains=this.options.subdomains.split(""));var i=this._viewType();this._view=new i(this.element,this.options)},destroy:function(){r.fn.destroy.call(this);this._view.destroy();this._view=null},_reset:function(){r.fn._reset.call(this);this._updateView();this._view.reset()},_viewType:function(){return y},_activate:function(){r.fn._activate.call(this);i.support.mobileOS||(this._pan||(this._pan=i.throttle(o(this._render,this),100)),this.map.bind("pan",this._pan))},_deactivate:function(){r.fn._deactivate.call(this);this._pan&&this.map.unbind("pan",this._pan)},_updateView:function(){var t=this._view,n=this.map,i=n.extent(),r={nw:n.locationToLayer(i.nw).round(),se:n.locationToLayer(i.se).round()};t.center(n.locationToLayer(n.center()));t.extent(r);t.zoom(n.zoom())},_resize:function(){this._render()},_panEnd:function(n){r.fn._panEnd.call(this,n);this._render()},_render:function(){this._updateView();this._view.render()}}),y=f.extend({init:function(n,t){this.element=n;this._initOptions(t);this.pool=new w},options:{tileSize:256,subdomains:["a","b","c"],urlTemplate:""},center:function(n){this._center=n},extent:function(n){this._extent=n},zoom:function(n){this._zoom=n},pointToTileIndex:function(n){return new e(t.floor(n.x/this.options.tileSize),t.floor(n.y/this.options.tileSize))},tileCount:function(){var n=this.size(),u=this.pointToTileIndex(this._extent.nw),i=this._extent.nw,r=this.indexToPoint(u).translate(-i.x,-i.y);return{x:t.ceil((t.abs(r.x)+n.width)/this.options.tileSize),y:t.ceil((t.abs(r.y)+n.height)/this.options.tileSize)}},size:function(){var n=this._extent.nw,i=this._extent.se,t=i.clone().translate(-n.x,-n.y);return{width:t.x,height:t.y}},indexToPoint:function(n){var t=n.x,i=n.y;return new e(t*this.options.tileSize,i*this.options.tileSize)},subdomainText:function(){var n=this.options.subdomains;return n[this.subdomainIndex++%n.length]},destroy:function(){this.element.empty();this.pool.empty()},reset:function(){this.pool.reset();this.subdomainIndex=0;this.basePoint=this._extent.nw;this.render()},render:function(){for(var r=this.tileCount(),u=this.pointToTileIndex(this._extent.nw),i,t,n=0;n<r.x;n++)for(t=0;t<r.y;t++)i=this.createTile({x:u.x+n,y:u.y+t}),i.visible||i.show()},createTile:function(n){var i=this.tileOptions(n),t=this.pool.get(this._center,i);return t.element.parent().length===0&&this.element.append(t.element),t},tileOptions:function(n){var r=this.wrapIndex(n),t=this.indexToPoint(n),i=this.basePoint,u=t.clone().translate(-i.x,-i.y);return{index:r,currentIndex:n,point:t,offset:g(u),zoom:this._zoom,size:this.options.tileSize,subdomain:this.subdomainText(),urlTemplate:this.options.urlTemplate,errorUrlTemplate:this.options.errorUrlTemplate}},wrapIndex:function(n){var i=t.pow(2,this._zoom);return{x:this.wrapValue(n.x,i),y:d(n.y,0,i-1)}},wrapValue:function(n,i){var r=t.abs(n)%i;return n>=0?r:i-(r===0?i:r)}}),p=f.extend({init:function(n,t){this.id=n;this.visible=!0;this._initOptions(t);this.createElement();this.show()},options:{urlTemplate:"",errorUrlTemplate:""},createElement:function(){this.element=n("<img style='position: absolute; display: block;' />").css({width:this.options.size,height:this.options.size}).error(o(function(n){this.errorUrl()?n.target.setAttribute("src",this.errorUrl()):n.target.removeAttribute("src")},this))},show:function(){var n=this.element[0],t;n.style.top=a(this.options.offset.y);n.style.left=a(this.options.offset.x);t=this.url();t&&n.setAttribute("src",t);n.style.visibility="visible";this.visible=!0},hide:function(){this.element[0].style.visibility="hidden";this.visible=!1},url:function(){var n=s(this.options.urlTemplate);return n(this.urlOptions())},errorUrl:function(){var n=s(this.options.errorUrlTemplate);return n(this.urlOptions())},urlOptions:function(){var n=this.options;return{zoom:n.zoom,subdomain:n.subdomain,z:n.zoom,x:n.index.x,y:n.index.y,s:n.subdomain,quadkey:n.quadkey,q:n.quadkey,culture:n.culture,c:n.culture}},destroy:function(){this.element&&(this.element.remove(),this.element=null)}}),w=f.extend({init:function(){this._items=[]},options:{maxSize:100},get:function(n,t){return this._items.length>=this.options.maxSize&&this._remove(n),this._create(t)},empty:function(){for(var t=this._items,n=0;n<t.length;n++)t[n].destroy();this._items=[]},reset:function(){for(var t=this._items,n=0;n<t.length;n++)t[n].hide()},_create:function(n){for(var r=this._items,t,f=u.hashKey(c(n)+c(n.currentIndex)),i=0;i<r.length;i++)r[i].id===f&&(t=r[i]);return t?t.show():(t=new p(f,n),this._items.push(t)),t},_remove:function(n){for(var u,t=this._items,f=-1,i=-1,r=0;r<t.length;r++)u=t[r].options.point.distanceTo(n),u>f&&(i=r,f=u);i!==-1&&(t[i].destroy(),t.splice(i,1))}});b(h,{map:{layers:{tile:v,TileLayer:v,ImageTile:p,TilePool:w,TileView:y}}})})(window.kendo.jQuery)}(),function(){(function(n){var i=window.kendo,t=i.dataviz,r=i.deepExtend,u=i.util.defined,c=t.map.Extent,f=t.map.Location,e=t.map.layers.TileLayer,o=t.map.layers.TileView,s=e.extend({init:function(t,i){e.fn.init.call(this,t,i);this._onMetadata=n.proxy(this._onMetadata,this);this._fetchMetadata()},options:{baseUrl:"//dev.virtualearth.net/REST/v1/Imagery/Metadata/",imagerySet:"road"},_fetchMetadata:function(){var t=this.options;if(!t.key)throw new Error("Bing tile layer: API key is required");n.ajax({url:t.baseUrl+t.imagerySet,data:{output:"json",include:"ImageryProviders",key:t.key,uriScheme:this._scheme(window.location.protocol)},type:"get",dataType:"jsonp",jsonp:"jsonp",success:this._onMetadata})},_scheme:function(n){return n.replace(":","")==="https"?"https":"http"},_onMetadata:function(n){var t,i;n&&n.resourceSets.length&&(t=this.resource=n.resourceSets[0].resources[0],r(this._view.options,{urlTemplate:t.imageUrl.replace("{subdomain}","#= subdomain #").replace("{quadkey}","#= quadkey #").replace("{culture}","#= culture #"),subdomains:t.imageUrlSubdomains}),i=this.options,u(i.minZoom)||(i.minZoom=t.zoomMin),u(i.maxZoom)||(i.maxZoom=t.zoomMax),this._addAttribution(),this.element.css("display")!=="none"&&this.reset())},_viewType:function(){return h},_addAttribution:function(){var e=this.map.attribution,t,i,r,u,n;if(e&&(t=this.resource.imageryProviders,t))for(i=0;i<t.length;i++)for(r=t[i],u=0;u<r.coverageAreas.length;u++)n=r.coverageAreas[u],e.add({text:r.attribution,minZoom:n.zoomMin,maxZoom:n.zoomMax,extent:new c(new f(n.bbox[2],n.bbox[1]),new f(n.bbox[0],n.bbox[3]))})},imagerySet:function(n){if(n)this.options.imagerySet=n,this.map.attribution.clear(),this._fetchMetadata(),this._reset();else return this.options.imagerySet}}),h=o.extend({options:{culture:"en-US"},tileOptions:function(n){var t=o.fn.tileOptions.call(this,n);return t.culture=this.options.culture,t.quadkey=this.tileQuadKey(this.wrapIndex(n)),t},tileQuadKey:function(n){for(var u="",t,r,i=this._zoom;i>0;i--)t=0,r=1<<i-1,(n.x&r)!=0&&t++,(n.y&r)!=0&&(t+=2),u+=t;return u}});r(t,{map:{layers:{bing:s,BingLayer:s,BingView:h}}})})(window.kendo.jQuery)}(),function(){(function(n){var a=document,f=Math,v=n.inArray,e=n.proxy,t=window.kendo,y=t.Class,p=t.data.DataSource,o=t.ui.Tooltip,s=t.dataviz,h=t.deepExtend,u=s.map,c=u.Location,r=u.layers.Layer,l=r.extend({init:function(n,t){r.fn.init.call(this,n,t);this._markerClick=e(this._markerClick,this);this.element.on("click",".k-marker",this._markerClick);this.items=[];this._initDataSource()},destroy:function(){r.fn.destroy.call(this);this.element.off("click",".k-marker",this._markerClick);this.dataSource.unbind("change",this._dataChange);this.clear()},options:{zIndex:1e3,autoBind:!0,dataSource:{},locationField:"location",titleField:"title"},add:function(t){if(n.isArray(t))for(var i=0;i<t.length;i++)this._addOne(t[i]);else return this._addOne(t)},remove:function(n){n.destroy();var t=v(n,this.items);t>-1&&this.items.splice(t,1)},clear:function(){for(var n=0;n<this.items.length;n++)this.items[n].destroy();this.items=[]},update:function(n){var t=n.location(),i;t&&(n.showAt(this.map.locationToView(t)),i={marker:n,layer:this},this.map.trigger("markerActivate",i))},_reset:function(){var t,n;for(r.fn._reset.call(this),t=this.items,n=0;n<t.length;n++)this.update(t[n])},bind:function(n,t){var i=u.Marker.create(n,this.options),r,f;return i.dataItem=t,r={marker:i,layer:this},f=this.map.trigger("markerCreated",r),f?void 0:(this.add(i),i)},setDataSource:function(n){this.dataSource&&this.dataSource.unbind("change",this._dataChange);this.dataSource=t.data.DataSource.create(n);this.dataSource.bind("change",this._dataChange);this.options.autoBind&&this.dataSource.fetch()},_addOne:function(n){var t=i.create(n,this.options);return t.addTo(this),t},_initDataSource:function(){var n=this.options.dataSource;this._dataChange=e(this._dataChange,this);this.dataSource=p.create(n).bind("change",this._dataChange);n&&this.options.autoBind&&this.dataSource.fetch()},_dataChange:function(n){this._load(n.sender.view())},_load:function(n){var u,f,i,r;for(this._data=n,this.clear(),u=t.getter(this.options.locationField),f=t.getter(this.options.titleField),i=0;i<n.length;i++)r=n[i],this.bind({location:u(r),title:f(r)},r)},_markerClick:function(t){var i={marker:n(t.target).data("kendoMarker"),layer:this};this.map.trigger("markerClick",i)}}),i=y.extend({init:function(n){this.options=n||{}},addTo:function(n){this.layer=n.markers||n;this.layer.items.push(this);this.layer.update(this)},location:function(n){return n?(this.options.location=c.create(n).toArray(),this.layer&&this.layer.update(this),this):c.create(this.options.location)},showAt:function(n){this.render();this.element.css({left:f.round(n.x),top:f.round(n.y)});this.tooltip&&this.tooltip.popup&&this.tooltip.popup._position()},hide:function(){this.element&&(this.element.remove(),this.element=null);this.tooltip&&(this.tooltip.destroy(),this.tooltip=null)},destroy:function(){this.layer=null;this.hide()},render:function(){if(!this.element){var i=this.options,r=this.layer;this.element=n(a.createElement("span")).addClass("k-marker k-marker-"+t.toHyphens(i.shape||"pin")).attr("title",i.title).attr(i.attributes||{}).data("kendoMarker",this).css("zIndex",i.zIndex);r&&r.element.append(this.element);this.renderTooltip()}},renderTooltip:function(){var i=this,f=i.options.title,n=i.options.tooltip||{},r,u;n&&o&&(r=n.template,r&&(u=t.template(r),n.content=function(n){return n.location=i.location(),n.marker=i,u(n)}),(f||n.content||n.contentUrl)&&(this.tooltip=new o(this.element,n),this.tooltip.marker=this))}});i.create=function(n,t){return n instanceof i?n:new i(h({},t,n))};h(s,{map:{layers:{marker:l,MarkerLayer:l},Marker:i}})})(window.kendo.jQuery)}(),function(){(function(n){var d=document,r=Math,y=r.min,a=r.pow,t=n.proxy,i=window.kendo,o=i.ui.Widget,p=i.deepExtend,u=i.dataviz,f=u.ui,s=i.geometry,w=s.Point,h=u.map,b=h.Extent,e=h.Location,g=h.crs.EPSG3857,c=i.util,nt=c.defined,l=c.limitValue,k=c.renderPos,v=c.valueOrDefault,tt="k-",it=.9,rt=.93,ut="DOMMouseScroll mousewheel",ft=5,et=o.extend({init:function(n,r){i.destroy(n);o.fn.init.call(this,n);this._initOptions(r);this.bind(this.events,r);this.crs=new g;this.element.addClass(tt+this.options.name.toLowerCase()).css("position","relative").empty().append(d.createElement("div"));this._viewOrigin=this._getOrigin();this._initScroller();this._initMarkers();this._initControls();this._initLayers();this._reset();this._mousewheel=t(this._mousewheel,this);this.element.bind("click",t(this._click,this));this.element.bind(ut,this._mousewheel)},options:{name:"Map",controls:{attribution:!0,navigator:{panStep:100},zoom:!0},layers:[],layerDefaults:{shape:{style:{fill:{color:"#fff"},stroke:{color:"#aaa",width:.5}}},bubble:{style:{fill:{color:"#fff",opacity:.5},stroke:{color:"#aaa",width:.5}}},marker:{shape:"pinTarget",tooltip:{position:"top"}}},center:[0,0],zoom:3,minSize:256,minZoom:1,maxZoom:19,markers:[],markerDefaults:{shape:"pinTarget",tooltip:{position:"top"}},wraparound:!0},events:["beforeReset","click","reset","pan","panEnd","markerActivate","markerClick","markerCreated","shapeClick","shapeCreated","shapeMouseEnter","shapeMouseLeave","zoomStart","zoomEnd"],destroy:function(){this.scroller.destroy();this.navigator&&this.navigator.destroy();this.attribution&&this.attribution.destroy();this.zoomControl&&this.zoomControl.destroy();this.markers.destroy();for(var n=0;n<this.layers.length;n++)this.layers[n].destroy();o.fn.destroy.call(this)},zoom:function(n){var t=this.options;return nt(n)?(n=r.round(l(n,t.minZoom,t.maxZoom)),t.zoom!==n&&(t.zoom=n,this._reset()),this):t.zoom},center:function(n){return n?(this.options.center=e.create(n).toArray(),this._reset(),this):e.create(this.options.center)},extent:function(n){return n?(this._setExtent(n),this):this._getExtent()},setOptions:function(n){o.fn.setOptions.call(this,n);this._reset()},locationToLayer:function(n,t){var i=!this.options.wraparound;return n=e.create(n),this.crs.toPoint(n,this._layerSize(t),i)},layerToLocation:function(n,t){var i=!this.options.wraparound;return n=w.create(n),this.crs.toLocation(n,this._layerSize(t),i)},locationToView:function(n){n=e.create(n);var t=this.locationToLayer(this._viewOrigin),i=this.locationToLayer(n);return i.translateWith(t.scale(-1))},viewToLocation:function(n,t){var i=this.locationToLayer(this._getOrigin(),t);return n=w.create(n),n=n.clone().translateWith(i),this.layerToLocation(n,t)},eventOffset:function(n){var i=this.element.offset(),t=n.originalEvent||n,r=v(t.pageX,t.clientX)-i.left,u=v(t.pageY,t.clientY)-i.top;return new s.Point(r,u)},eventToView:function(n){var t=this.eventOffset(n);return this.locationToView(this.viewToLocation(t))},eventToLayer:function(n){return this.locationToLayer(this.eventToLocation(n))},eventToLocation:function(n){var t=this.eventOffset(n);return this.viewToLocation(t)},viewSize:function(){var t=this.element,i=this._layerSize(),n=t.width();return this.options.wraparound||(n=y(i,n)),{width:n,height:y(i,t.height())}},exportVisual:function(){return this._reset(),!1},_setOrigin:function(n,t){var r=this.viewSize(),i;return n=this._origin=e.create(n),i=this.locationToLayer(n,t),i.x+=r.width/2,i.y+=r.height/2,this.options.center=this.layerToLocation(i,t).toArray(),this},_getOrigin:function(n){var i=this.viewSize(),t;return(n||!this._origin)&&(t=this.locationToLayer(this.center()),t.x-=i.width/2,t.y-=i.height/2,this._origin=this.layerToLocation(t)),this._origin},_setExtent:function(n){var i,u,t;for(n=b.create(n),this.center(n.center()),i=this.element.width(),u=this.element.height(),t=this.options.maxZoom;t>=this.options.minZoom;t--){var f=this.locationToLayer(n.nw,t),e=this.locationToLayer(n.se,t),o=r.abs(e.x-f.x),s=r.abs(e.y-f.y);if(o<=i&&s<=u)break}this.zoom(t)},_getExtent:function(){var t=this._getOrigin(),n=this.locationToLayer(t),i=this.viewSize(),r;return n.x+=i.width,n.y+=i.height,r=this.layerToLocation(n),new b(t,r)},_zoomAround:function(n,t){this._setOrigin(this.layerToLocation(n,t),t);this.zoom(t)},_initControls:function(){var n=this.options.controls;f.Attribution&&n.attribution&&this._createAttribution(n.attribution);i.support.mobileOS||(f.Navigator&&n.navigator&&this._createNavigator(n.navigator),f.ZoomControl&&n.zoom&&this._createZoomControl(n.zoom))},_createControlElement:function(t,i){var u=t.position||i,f="."+k(u).replace(" ","."),r=n(".k-map-controls"+f,this.element);return r.length===0&&(r=n("<div>").addClass("k-map-controls "+k(u)).appendTo(this.element)),n("<div>").appendTo(r)},_createAttribution:function(n){var t=this._createControlElement(n,"bottomRight");this.attribution=new f.Attribution(t,n)},_createNavigator:function(n){var r=this._createControlElement(n,"topLeft"),i=this.navigator=new f.Navigator(r,n);this._navigatorPan=t(this._navigatorPan,this);i.bind("pan",this._navigatorPan);this._navigatorCenter=t(this._navigatorCenter,this);i.bind("center",this._navigatorCenter)},_navigatorPan:function(n){var t=this,f=t.scroller,r=f.scrollLeft+n.x,u=f.scrollTop-n.y,i=this._virtualSize,e=this.element.height(),o=this.element.width();r=l(r,i.x.min,i.x.max-o);u=l(u,i.y.min,i.y.max-e);t.scroller.one("scroll",function(n){t._scrollEnd(n)});t.scroller.scrollTo(-r,-u)},_navigatorCenter:function(){this.center(this.options.center)},_createZoomControl:function(n){var i=this._createControlElement(n,"topLeft"),r=this.zoomControl=new f.ZoomControl(i,n);this._zoomControlChange=t(this._zoomControlChange,this);r.bind("change",this._zoomControlChange)},_zoomControlChange:function(n){this.trigger("zoomStart",{originalEvent:n})||(this.zoom(this.zoom()+n.delta),this.trigger("zoomEnd",{originalEvent:n}))},_initScroller:function(){var r=i.support.mobileOS?rt:it,u=this.options.zoomable!==!1,n=this.scroller=new i.mobile.ui.Scroller(this.element.children(0),{friction:r,velocityMultiplier:ft,zoom:u,mousewheelScrolling:!1});n.bind("scroll",t(this._scroll,this));n.bind("scrollEnd",t(this._scrollEnd,this));n.userEvents.bind("gesturestart",t(this._scaleStart,this));n.userEvents.bind("gestureend",t(this._scale,this));this.scrollElement=n.scrollElement},_initLayers:function(){for(var t=this.options.layers,f=this.layers=[],n=0;n<t.length;n++){var i=t[n],r=i.type||"shape",e=this.options.layerDefaults[r],o=u.map.layers[r];f.push(new o(this,p({},e,i)))}},_initMarkers:function(){this.markers=new h.layers.MarkerLayer(this,this.options.markerDefaults);this.markers.add(this.options.markers)},_scroll:function(n){var t=this.locationToLayer(this._viewOrigin).round(),i=n.sender.movable,r=new s.Point(i.x,i.y).scale(-1).scale(1/i.scale);t.x+=r.x;t.y+=r.y;this._scrollOffset=r;this._setOrigin(this.layerToLocation(t));this.trigger("pan",{originalEvent:n,origin:this._getOrigin(),center:this.center()})},_scrollEnd:function(n){this._scrollOffset&&this._panComplete()&&(this._scrollOffset=null,this._panEndTS=new Date,this.trigger("panEnd",{originalEvent:n,origin:this._getOrigin(),center:this.center()}))},_panComplete:function(){return new Date-(this._panEndTS||0)>50},_scaleStart:function(n){if(this.trigger("zoomStart",{originalEvent:n})){var t=n.touches[1];t&&t.cancel()}},_scale:function(n){var r=this.scroller.movable.scale,t=this._scaleToZoom(r),i=new s.Point(n.center.x,n.center.y),u=this.viewToLocation(i,t),f=this.locationToLayer(u,t),e=f.translate(-i.x,-i.y);this._zoomAround(e,t);this.trigger("zoomEnd",{originalEvent:n})},_scaleToZoom:function(n){var t=this._layerSize()*n,i=t/this.options.minSize,u=r.log(i)/r.log(2);return r.round(u)},_reset:function(){this.attribution&&this.attribution.filter(this.center(),this.zoom());this._viewOrigin=this._getOrigin(!0);this._resetScroller();this.trigger("beforeReset");this.trigger("reset")},_resetScroller:function(){var t=this.scroller,o=t.dimensions.x,s=t.dimensions.y,u=this._layerSize(),h=this.extent().nw,r=this.locationToLayer(h).round(),f,n,i,e;t.movable.round=!0;t.reset();t.userEvents.cancel();f=this.zoom();t.dimensions.forcedMinScale=a(2,this.options.minZoom-f);t.dimensions.maxScale=a(2,this.options.maxZoom-f);n={min:-r.x,max:u-r.x};i={min:-r.y,max:u-r.y};this.options.wraparound&&(n.max=20*u,n.min=-n.max);this.options.pannable===!1&&(e=this.viewSize(),n.min=i.min=0,n.max=e.width,i.max=e.height);o.makeVirtual();s.makeVirtual();o.virtualSize(n.min,n.max);s.virtualSize(i.min,i.max);this._virtualSize={x:n,y:i}},_renderLayers:function(){var t=this.options.layers,f=this.layers=[],e=this.scrollWrap,n;for(e.empty(),n=0;n<t.length;n++){var i=t[n],r=i.type||"shape",o=this.options.layerDefaults[r],s=u.map.layers[r];f.push(new s(this,p({},o,i)))}},_layerSize:function(n){return n=v(n,this.options.zoom),this.options.minSize*a(2,n)},_click:function(n){if(this._panComplete()){var t=this.eventOffset(n);this.trigger("click",{originalEvent:n,location:this.viewToLocation(t)})}},_mousewheel:function(n){n.preventDefault();var e=u.mwDelta(n)>0?-1:1,t=this.options,f=this.zoom(),i=l(f+e,t.minZoom,t.maxZoom);if(t.zoomable!==!1&&i!==f&&!this.trigger("zoomStart",{originalEvent:n})){var r=this.eventOffset(n),o=this.viewToLocation(r),s=this.locationToLayer(o,i),h=s.translate(-r.x,-r.y);this._zoomAround(h,i);this.trigger("zoomEnd",{originalEvent:n})}}});u.ui.plugin(et)})(window.kendo.jQuery)}(),function(){}(),function(){(function(n){function h(n,i,r){function s(n){for(var t=1;n*t%1;)t*=10;return t}var f,o,e,u;if(typeof n=="undefined"||typeof i=="undefined")return[];if(r&&t.sign(i-n)!=t.sign(r))throw"The sign of the increment should allow to reach the stop-value.";if(r=r||1,n=n||0,i=i||n,(i-n)/r==Infinity)throw"Infinite range defined.";if(f=[],o=-1,u=s(Math.abs(r)),n*=u,i*=u,r*=u,n>i&&r>0&&(r=-r),r<0)while((e=n+r*++o)>=i)f.push(e/u);else while((e=n+r*++o)<=i)f.push(e/u);return f}function c(n,t){if(n==t)return 0;var r=t.x-n.x,u=n.y-t.y,i=Math.atan(r/u);return u>=0?r<0?i+2*Math.PI:i:i+Math.PI}var i=window.kendo,r=i.dataviz.diagram={},e=i.deepExtend,o=n.isArray,s=1e-6,t={},u,f;e(t,{isNearZero:function(n){return Math.abs(n)<s},isDefined:function(n){return typeof n!="undefined"},isUndefined:function(n){return typeof n=="undefined"||n===null},isObject:function(n){return n===Object(n)},has:function(n,t){return Object.hasOwnProperty.call(n,t)},isString:function(n){return Object.prototype.toString.call(n)=="[object String]"},isBoolean:function(n){return Object.prototype.toString.call(n)=="[object Boolean]"},isType:function(n,t){return Object.prototype.toString.call(n)=="[object "+t+"]"},isNumber:function(n){return!isNaN(parseFloat(n))&&isFinite(n)},isEmpty:function(n){if(n===null)return!0;if(o(n)||t.isString(n))return n.length===0;for(var i in n)if(t.has(n,i))return!1;return!0},simpleExtend:function(n,i){if(t.isObject(i))for(var r in i)n[r]=i[r]},initArray:function(n,t){for(var r=[],i=0;i<n;++i)r[i]=t;return r},serializePoints:function(n){for(var i,r=[],t=0;t<n.length;t++)i=n[t],r.push(i.x+";"+i.y);return r.join(";")},deserializePoints:function(n){var i=n.split(";"),u=[],t;if(i.length%2!=0)throw"Not an array of points.";for(t=0;t<i.length;t+=2)u.push(new r.Point(parseInt(i[t],10),parseInt(i[t+1],10)));return u},randomInteger:function(n,t){return parseInt(Math.floor(Math.random()*t)+n,10)},DFT:function(n,t){var i,r;if(t(n),n.childNodes)for(i=0;i<n.childNodes.length;i++)r=n.childNodes[i],this.DFT(r,t)},getMatrixAngle:function(n){return n===null||n.d===0?0:Math.atan2(n.b,n.d)*180/Math.PI},getMatrixScaling:function(n){var t=Math.sqrt(n.a*n.a+n.c*n.c),i=Math.sqrt(n.b*n.b+n.d*n.d);return[t,i]}});t.sign=function(n){return n?n<0?-1:1:0};t.findAngle=function(n,t){return c(n,t)*180/Math.PI};t.forEach=function(n,t,i){for(var r=0;r<n.length;r++)t.call(i,n[r],r,n)};t.any=function(n,t){for(var i=0;i<n.length;++i)if(t(n[i]))return n[i];return null};t.remove=function(n,i){for(var r;(r=t.indexOf(n,i))!==-1;)n.splice(r,1);return n};t.contains=function(n,i){return t.indexOf(n,i)!==-1};t.indexOf=function(t,i){return n.inArray(i,t)};t.fold=function(n,t,i,r){for(var e,f=arguments.length>2,u=0;u<n.length;u++)e=n[u],f?i=t.call(r,i,e,u,n):(i=e,f=!0);if(!f)throw"Reduce of empty array with no initial value";return i};t.find=function(n,i,r){var u;return t.any(n,function(n,t,f){return i.call(r,n,t,f)?(u=n,!0):!1}),u};t.first=function(n,i,r){return n.length===0?null:t.isUndefined(i)?n[0]:t.find(n,i,r)};t.insert=function(n,t,i){return n.splice(i,0,t),n};t.all=function(n,t,i){for(var r=!0,f,u=0;u<n.length;u++)if(f=n[u],r=r&&t.call(i,f,u,n),!r)break;return r};t.clear=function(n){n.splice(0,n.length)};t.bisort=function(n,i,r){if(t.isUndefined(n))throw"First array is not specified.";if(t.isUndefined(i))throw"Second array is not specified.";if(n.length!=i.length)throw"The two arrays should have equal length";for(var f=[],u=0;u<n.length;u++)f.push({x:n[u],y:i[u]});for(t.isUndefined(r)?f.sort(function(n,t){return n.x-t.x}):f.sort(function(n,t){return r(n.x,t.x)}),t.clear(n),t.clear(i),u=0;u<f.length;u++)n.push(f[u].x),i.push(f[u].y)};t.addRange=function(n,t){n.push.apply(n,t)};u={easeInOut:function(n){return-Math.cos(n*Math.PI)/2+.5}};f=i.Class.extend({init:function(){this.adapters=[];this.target=0;this.tick=0;this.interval=20;this.duration=800;this.lastTime=null;this.handlers=[];var n=this;this.transition=u.easeInOut;this.timerDelegate=function(){n.onTimerEvent()}},addAdapter:function(n){this.adapters.push(n)},onComplete:function(n){this.handlers.push(n)},removeHandler:function(t){this.handlers=n.grep(this.handlers,function(n){return n!==t})},trigger:function(){var n=this;this.handlers&&t.forEach(this.handlers,function(t){return t.call(n.caller!==null?n.caller:n)})},onStep:function(){},seekTo:function(n){this.seekFromTo(this.tick,n)},seekFromTo:function(n,t){this.target=Math.max(0,Math.min(1,t));this.tick=Math.max(0,Math.min(1,n));this.lastTime=(new Date).getTime();this.intervalId||(this.intervalId=window.setInterval(this.timerDelegate,this.interval))},stop:function(){this.intervalId&&(window.clearInterval(this.intervalId),this.intervalId=null,this.trigger())},play:function(n){this.adapters.length!==0&&(n!==null&&(this.caller=n),this.initState(),this.seekFromTo(0,1))},reverse:function(){this.seekFromTo(1,0)},initState:function(){if(this.adapters.length!==0)for(var n=0;n<this.adapters.length;n++)this.adapters[n].initState()},propagate:function(){for(var t=this.transition(this.tick),n=0;n<this.adapters.length;n++)this.adapters[n].update(t)},onTimerEvent:function(){var t=(new Date).getTime(),i=t-this.lastTime,n;this.lastTime=t;n=i/this.duration*(this.tick<this.target?1:-1);Math.abs(n)>=Math.abs(this.tick-this.target)?this.tick=this.target:this.tick+=n;try{this.propagate()}finally{this.onStep.call(this);this.target==this.tick&&this.stop()}}});i.deepExtend(r,{init:function(n){i.init(n,r.ui)},Utils:t,Range:h,Ticker:f})})(window.kendo.jQuery)}(),function(){(function(n,t){function st(n){return Math.abs(n)<et}function it(n,t,i,u,f){var o=(t.x-n.x)*(u.y-i.y)-(t.y-n.y)*(u.x-i.x);if(!st(o)){var h=(n.y-i.y)*(u.x-i.x)-(n.x-i.x)*(u.y-i.y),c=(n.y-i.y)*(t.x-n.x)-(n.x-i.x)*(t.y-n.y),e=h/o,s=c/o;if(!f||!(e<0||e>1||s<0||s>1))return new r(n.x+e*(t.x-n.x),n.y+e*(t.y-n.y))}}function ct(n,t){var r,u,i;do r=Math.random()*2-1,u=Math.random()*2-1,i=r*r+u*u;while(!i||i>1);return n+t*r*Math.sqrt(-2*Math.log(i)/i)}function p(n){var t,r,u;for(i.isUndefined(n)&&(n=10),t="",r="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",u=n;u>0;--u)t+=r.charAt(Math.round(Math.random()*(r.length-1)));return t}var u=window.kendo,l=u.dataviz.diagram,y=u.Class,g=u.deepExtend,ut=u.dataviz,i=l.Utils,r=ut.Point2D,ft=u.isFunction,e=i.contains,k=n.map,d=3,et=1e-6,tt;g(r.fn,{plus:function(n){return new r(this.x+n.x,this.y+n.y)},minus:function(n){return new r(this.x-n.x,this.y-n.y)},offset:function(n){return new r(this.x-n,this.y-n)},times:function(n){return new r(this.x*n,this.y*n)},normalize:function(){return this.length()===0?new r:this.times(1/this.length())},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},toString:function(){return"("+this.x+","+this.y+")"},lengthSquared:function(){return this.x*this.x+this.y*this.y},middleOf:function(n,t){return new r(t.x-n.x,t.y-n.y).times(.5).plus(n)},toPolar:function(n){var i=1;n&&(i=180/Math.PI);var u=Math.atan2(Math.abs(this.y),Math.abs(this.x)),r=Math.PI/2,t=this.length();if(this.x===0){if(this.y===0)return new v(0,0);if(this.y>0)return new v(t,i*r);if(this.y<0)return new v(t,i*3*r)}else if(this.x>0){if(this.y===0)return new v(t,0);if(this.y>0)return new v(t,i*u);if(this.y<0)return new v(t,i*(4*r-u))}else{if(this.y===0)return new v(t,2*r);if(this.y>0)return new v(t,i*(2*r-u));if(this.y<0)return new v(t,i*(2*r+u))}},isOnLine:function(n,t){var o,i,r,u,e;return(n.x>t.x&&(o=t,t=n,n=o),i=new f(n.x,n.y).inflate(d,d),r=new f(t.x,t.y).inflate(d,d),i.union(r).contains(this))?n.x===t.x||n.y===t.y?!0:(n.y<t.y?(u=i.x+(r.x-i.x)*(this.y-(i.y+i.height))/(r.y+r.height-(i.y+i.height)),e=i.x+i.width+(r.x+r.width-(i.x+i.width))*(this.y-i.y)/(r.y-i.y)):(u=i.x+(r.x-i.x)*(this.y-i.y)/(r.y-i.y),e=i.x+i.width+(r.x+r.width-(i.x+i.width))*(this.y-(i.y+i.height))/(r.y+r.height-(i.y+i.height))),this.x>u&&this.x<e):!1}});g(r,{parse:function(n){var f=n.slice(1,n.length-1),t=f.split(","),i=parseInt(t[0],10),u=parseInt(t[1],10);if(!isNaN(i)&&!isNaN(u))return new r(i,u)}});var ot=y.extend({init:function(n,t,i){this.point=n;this.left=t;this.right=i}}),f=y.extend({init:function(n,t,i,r){this.x=n||0;this.y=t||0;this.width=i||0;this.height=r||0},contains:function(n){return n.x>=this.x&&n.x<=this.x+this.width&&n.y>=this.y&&n.y<=this.y+this.height},inflate:function(n,i){return i===t&&(i=n),this.x-=n,this.y-=i,this.width+=2*n+1,this.height+=2*i+1,this},offset:function(n,t){var i=n,u=t;return n instanceof r&&(i=n.x,u=n.y),this.x+=i,this.y+=u,this},union:function(n){var t=Math.min(this.x,n.x),i=Math.min(this.y,n.y),r=Math.max(this.x+this.width,n.x+n.width),u=Math.max(this.y+this.height,n.y+n.height);return new f(t,i,r-t,u-i)},center:function(){return new r(this.x+this.width/2,this.y+this.height/2)},top:function(){return new r(this.x+this.width/2,this.y)},right:function(){return new r(this.x+this.width,this.y+this.height/2)},bottom:function(){return new r(this.x+this.width/2,this.y+this.height)},left:function(){return new r(this.x,this.y+this.height/2)},topLeft:function(){return new r(this.x,this.y)},topRight:function(){return new r(this.x+this.width,this.y)},bottomLeft:function(){return new r(this.x,this.y+this.height)},bottomRight:function(){return new r(this.x+this.width,this.y+this.height)},clone:function(){return new f(this.x,this.y,this.width,this.height)},isEmpty:function(){return!this.width&&!this.height},equals:function(n){return this.x===n.x&&this.y===n.y&&this.width===n.width&&this.height===n.height},rotatedBounds:function(n){var t=this.clone(),i=this.rotatedPoints(n),r=i[0],u=i[1],f=i[2],e=i[3];return t.x=Math.min(f.x,r.x,u.x,e.x),t.y=Math.min(f.y,r.y,u.y,e.y),t.width=Math.max(f.x,r.x,u.x,e.x)-t.x,t.height=Math.max(f.y,r.y,u.y,e.y)-t.y,t},rotatedPoints:function(n){var t=this,i=t.center(),r=t.bottomRight().rotate(i,360-n),u=t.topLeft().rotate(i,360-n),f=t.topRight().rotate(i,360-n),e=t.bottomLeft().rotate(i,360-n);return[u,f,r,e]},toString:function(n){return n=n||" ",this.x+n+this.y+n+this.width+n+this.height},scale:function(n,t,i,u,f){var e=this.topLeft(),s=this.center();e.rotate(s,360-f).rotate(u,f);var o=i.minus(e),h=new r(o.x*n,o.y*t),c=o.minus(h);e=e.plus(c);e.rotate(u,360-f).rotate(s,f);this.x=e.x;this.y=e.y;this.width*=n;this.height*=t},zoom:function(n){return this.x*=n,this.y*=n,this.width*=n,this.height*=n,this},overlaps:function(n){var t=this.bottomRight(),i=n.bottomRight();return!(t.x<n.x||t.y<n.y||i.x<this.x||i.y<this.y)}}),nt=y.extend({init:function(n,t){this.width=n;this.height=t}});nt.prototype.Empty=new nt(0,0);f.toRect=function(n){return n instanceof f||(n=new f(n.x,n.y,n.width,n.height)),n};f.empty=function(){return new f(0,0,0,0)};f.fromPoints=function(n,t){if(isNaN(n.x)||isNaN(n.y)||isNaN(t.x)||isNaN(t.y))throw"Some values are NaN.";return new f(Math.min(n.x,t.x),Math.min(n.y,t.y),Math.abs(n.x-t.x),Math.abs(n.y-t.y))};var a={lines:function(n,t,i,r){return it(n,t,i,r)},segments:function(n,t,i,r){return it(n,t,i,r,!0)},rectWithLine:function(n,t,i){return a.segments(t,i,n.topLeft(),n.topRight())||a.segments(t,i,n.topRight(),n.bottomRight())||a.segments(t,i,n.bottomLeft(),n.bottomRight())||a.segments(t,i,n.topLeft(),n.bottomLeft())},rects:function(n,t,i){var r=t.topLeft(),u=t.topRight(),f=t.bottomLeft(),e=t.bottomRight(),o=t.center(),h,s;return i&&(r=r.rotate(o,i),u=u.rotate(o,i),f=f.rotate(o,i),e=e.rotate(o,i)),h=n.contains(r)||n.contains(u)||n.contains(f)||n.contains(e)||a.rectWithLine(n,r,u)||a.rectWithLine(n,r,f)||a.rectWithLine(n,u,e)||a.rectWithLine(n,f,e),h||(r=n.topLeft(),u=n.topRight(),f=n.bottomLeft(),e=n.bottomRight(),i&&(s=360-i,r=r.rotate(o,s),u=u.rotate(o,s),f=f.rotate(o,s),e=e.rotate(o,s)),h=t.contains(r)||t.contains(u)||t.contains(f)||t.contains(e)),h}},ht=y.extend({init:function(n){this.container=f.toRect(n)},align:function(n,t){for(var r=t.toLowerCase().split(" "),i=0;i<r.length;i++)n=this._singleAlign(n,r[i]);return n},_singleAlign:function(n,t){return ft(this[t])?this[t](n):n},left:function(n){return this._align(n,this._left)},center:function(n){return this._align(n,this._center)},right:function(n){return this._align(n,this._right)},stretch:function(n){return this._align(n,this._stretch)},top:function(n){return this._align(n,this._top)},middle:function(n){return this._align(n,this._middle)},bottom:function(n){return this._align(n,this._bottom)},_left:function(n,t){t.x=n.x},_center:function(n,t){t.x=(n.width-t.width)/2||0},_right:function(n,t){t.x=n.width-t.width},_top:function(n,t){t.y=n.y},_middle:function(n,t){t.y=(n.height-t.height)/2||0},_bottom:function(n,t){t.y=n.height-t.height},_stretch:function(n,t){t.x=0;t.y=0;t.height=n.height;t.width=n.width},_align:function(n,t){return n=f.toRect(n),t(this.container,n),n}}),v=y.extend({init:function(n,t){this.r=n;this.angle=t}}),s=y.extend({init:function(n,t,i,r,u,f){this.a=n||0;this.b=t||0;this.c=i||0;this.d=r||0;this.e=u||0;this.f=f||0},plus:function(n){this.a+=n.a;this.b+=n.b;this.c+=n.c;this.d+=n.d;this.e+=n.e;this.f+=n.f},minus:function(n){this.a-=n.a;this.b-=n.b;this.c-=n.c;this.d-=n.d;this.e-=n.e;this.f-=n.f},times:function(n){return new s(this.a*n.a+this.c*n.b,this.b*n.a+this.d*n.b,this.a*n.c+this.c*n.d,this.b*n.c+this.d*n.d,this.a*n.e+this.c*n.f+this.e,this.b*n.e+this.d*n.f+this.f)},apply:function(n){return new r(this.a*n.x+this.c*n.y+this.e,this.b*n.x+this.d*n.y+this.f)},applyRect:function(n){return f.fromPoints(this.apply(n.topLeft()),this.apply(n.bottomRight()))},toString:function(){return"matrix("+this.a+" "+this.b+" "+this.c+" "+this.d+" "+this.e+" "+this.f+")"}});g(s,{fromSVGMatrix:function(n){var t=new s;return t.a=n.a,t.b=n.b,t.c=n.c,t.d=n.d,t.e=n.e,t.f=n.f,t},fromMatrixVector:function(n){var t=new s;return t.a=n.a,t.b=n.b,t.c=n.c,t.d=n.d,t.e=n.e,t.f=n.f,t},fromList:function(n){if(n.length!==6)throw"The given list should consist of six elements.";var t=new s;return t.a=n[0],t.b=n[1],t.c=n[2],t.d=n[3],t.e=n[4],t.f=n[5],t},translation:function(n,t){var i=new s;return i.a=1,i.b=0,i.c=0,i.d=1,i.e=n,i.f=t,i},unit:function(){return new s(1,0,0,1,0,0)},rotation:function(n,t,i){var r=new s;return r.a=Math.cos(n*Math.PI/180),r.b=Math.sin(n*Math.PI/180),r.c=-r.b,r.d=r.a,r.e=t-t*r.a+i*r.b||0,r.f=i-i*r.a-t*r.b||0,r},scaling:function(n,t){var i=new s;return i.a=n,i.b=0,i.c=0,i.d=t,i.e=0,i.f=0,i},parse:function(n){var t,i;if(n){if(n=n.trim(),n.slice(0,6).toLowerCase()==="matrix"){if(i=n.slice(7,n.length-1).trim(),t=i.split(","),t.length===6)return s.fromList(k(t,function(n){return parseFloat(n)}));if(t=i.split(" "),t.length===6)return s.fromList(k(t,function(n){return parseFloat(n)}))}if(n.slice(0,1)==="("&&n.slice(n.length-1)===")"&&(n=n.substr(1,n.length-1)),n.indexOf(",")>0&&(t=n.split(","),t.length===6))return s.fromList(k(t,function(n){return parseFloat(n)}));if(n.indexOf(" ")>0&&(t=n.split(" "),t.length===6))return s.fromList(k(t,function(n){return parseFloat(n)}))}return t}});tt=y.extend({init:function(n,t,i,r,u,f){this.a=n||0;this.b=t||0;this.c=i||0;this.d=r||0;this.e=u||0;this.f=f||0},fromMatrix:function(n){var t=new tt;return t.a=n.a,t.b=n.b,t.c=n.c,t.d=n.d,t.e=n.e,t.f=n.f,t}});var lt={_distanceToLineSquared:function(n,t,i){function e(n,t){return(n.x-t.x)*(n.x-t.x)+(n.y-t.y)*(n.y-t.y)}if(t===i)return e(n,t);var u=i.x-t.x,f=i.y-t.y,r=(n.x-t.x)*u+(n.y-t.y)*f;return r<0?e(t,n):(r=(i.x-n.x)*u+(i.y-n.y)*f,r<0)?e(i,n):(r=(i.x-n.x)*f-(i.y-n.y)*u,r*r/(u*u+f*f))},distanceToLine:function(n,t,i){return Math.sqrt(this._distanceToLineSquared(n,t,i))},distanceToPolyline:function(n,t){var u=Number.MAX_VALUE,r;if(i.isUndefined(t)||t.length===0)return Number.MAX_VALUE;for(r=0;r<t.length-1;r++){var e=t[r],o=t[r+1],f=this._distanceToLineSquared(n,e,o);f<u&&(u=f)}return Math.sqrt(u)}},w=u.Class.extend({init:function(){this._buckets=[];this.length=0},add:function(n,t){var r=this._createGetBucket(n);return i.isDefined(t)&&(r.value=t),r},get:function(n){return this._bucketExists(n)?this._createGetBucket(n):null},set:function(n,t){this.add(n,t)},containsKey:function(n){return this._bucketExists(n)},remove:function(n){if(this._bucketExists(n)){var t=this._hash(n);return delete this._buckets[t],this.length--,n}},forEach:function(n){for(var f,r,u=this._hashes(),t=0,e=u.length;t<e;t++)(f=u[t],r=this._buckets[f],i.isUndefined(r))||n(r)},clone:function(){for(var f,n,r=new w,u=this._hashes(),t=0,e=u.length;t<e;t++)(f=u[t],n=this._buckets[f],i.isUndefined(n))||r.add(n.key,n.value);return r},_hashes:function(){var n=[];for(var t in this._buckets)this._buckets.hasOwnProperty(t)&&n.push(t);return n},_bucketExists:function(n){var t=this._hash(n);return i.isDefined(this._buckets[t])},_createGetBucket:function(n){var r=this._hash(n),t=this._buckets[r];return i.isUndefined(t)&&(t={key:n},this._buckets[r]=t,this.length++),t},_hash:function(n){if(i.isNumber(n))return n;if(i.isString(n))return this._hashString(n);if(i.isObject(n))return this._objectHashId(n);throw"Unsupported key type.";},_hashString:function(n){var t=0,i,r;if(n.length===0)return t;for(i=0;i<n.length;i++)r=n.charCodeAt(i),t=t*32-t+r;return t},_objectHashId:function(n){var t=n._hashId;return i.isUndefined(t)&&(t=p(),n._hashId=t),t}}),h=u.Observable.extend({init:function(t){var f=this,r;if(u.Observable.fn.init.call(f),this._hashTable=new w,this.length=0,i.isDefined(t))if(n.isArray(t))for(r=0;r<t.length;r++)this.add(t[r]);else t.forEach(function(n,t){this.add(n,t)},this)},add:function(n,t){var i=this._hashTable.get(n);i||(i=this._hashTable.add(n),this.length++,this.trigger("changed"));i.value=t},set:function(n,t){this.add(n,t)},get:function(n){var t=this._hashTable.get(n);if(t)return t.value;throw new Error("Cannot find key "+n);},containsKey:function(n){return this._hashTable.containsKey(n)},remove:function(n){if(this.containsKey(n))return this.trigger("changed"),this.length--,this._hashTable.remove(n)},forEach:function(n,t){this._hashTable.forEach(function(i){n.call(t,i.key,i.value)})},forEachValue:function(n,t){this._hashTable.forEach(function(i){n.call(t,i.value)})},forEachKey:function(n,t){this._hashTable.forEach(function(i){n.call(t,i.key)})},keys:function(){var n=[];return this.forEachKey(function(t){n.push(t)}),n}}),rt=u.Class.extend({init:function(){this._tail=null;this._head=null;this.length=0},enqueue:function(n){var t={value:n,next:null};this._head?(this._tail.next=t,this._tail=this._tail.next):(this._head=t,this._tail=this._head);this.length++},dequeue:function(){if(this.length<1)throw new Error("The queue is empty.");var n=this._head.value;return this._head=this._head.next,this.length--,n},contains:function(n){for(var t=this._head;t;){if(t.value===n)return!0;t=t.next}return!1}}),at=u.Observable.extend({init:function(n){var t=this;u.Observable.fn.init.call(t);this._hashTable=new w;this.length=0;i.isDefined(n)&&(n instanceof w?n.forEach(function(n){this.add(n)}):n instanceof h&&n.forEach(function(n,t){this.add({key:n,value:t})},this))},contains:function(n){return this._hashTable.containsKey(n)},add:function(n){var t=this._hashTable.get(n);t||(this._hashTable.add(n,n),this.length++,this.trigger("changed"))},get:function(n){return this.contains(n)?this._hashTable.get(n).value:null},hash:function(n){return this._hashTable._hash(n)},remove:function(n){this.contains(n)&&(this._hashTable.remove(n),this.length--,this.trigger("changed"))},forEach:function(n,t){this._hashTable.forEach(function(t){n(t.value)},t)},toArray:function(){var n=[];return this.forEach(function(t){n.push(t)}),n}}),c=u.Class.extend({init:function(n,t){if(this.links=[],this.outgoing=[],this.incoming=[],this.weight=1,this.id=i.isDefined(n)?n:p(),i.isDefined(t)){this.associatedShape=t;var r=t.bounds();this.width=r.width;this.height=r.height;this.x=r.x;this.y=r.y}else this.associatedShape=null;this.data=null;this.type="Node";this.shortForm="Node '"+this.id+"'";this.isVirtual=!1},isIsolated:function(){return i.isEmpty(this.links)},bounds:function(n){if(!i.isDefined(n))return new l.Rect(this.x,this.y,this.width,this.height);this.x=n.x;this.y=n.y;this.width=n.width;this.height=n.height},isLinkedTo:function(n){var t=this;return i.any(t.links,function(i){return i.getComplement(t)===n})},getChildren:function(){var t,n,i,r;if(this.outgoing.length===0)return[];for(t=[],n=0,i=this.outgoing.length;n<i;n++)r=this.outgoing[n],t.push(r.getComplement(this));return t},getParents:function(){var t,n,i,r;if(this.incoming.length===0)return[];for(t=[],n=0,i=this.incoming.length;n<i;n++)r=this.incoming[n],t.push(r.getComplement(this));return t},clone:function(){var n=new c;return i.isDefined(this.weight)&&(n.weight=this.weight),i.isDefined(this.balance)&&(n.balance=this.balance),i.isDefined(this.owner)&&(n.owner=this.owner),n.associatedShape=this.associatedShape,n.x=this.x,n.y=this.y,n.width=this.width,n.height=this.height,n},adjacentTo:function(n){return this.isLinkedTo(n)!==null},removeLink:function(n){n.source===this&&(i.remove(this.links,n),i.remove(this.outgoing,n),n.source=null);n.target===this&&(i.remove(this.links,n),i.remove(this.incoming,n),n.target=null)},hasLinkTo:function(n){return i.any(this.outgoing,function(t){return t.target===n})},degree:function(){return this.links.length},incidentWith:function(n){return e(this.links,n)},getLinksWith:function(n){return i.all(this.links,function(t){return t.getComplement(this)===n},this)},getNeighbors:function(){var n=[];return i.forEach(this.incoming,function(t){n.push(t.getComplement(this))},this),i.forEach(this.outgoing,function(t){n.push(t.getComplement(this))},this),n}}),b=u.Class.extend({init:function(n,t,r,u){if(i.isUndefined(n))throw"The source of the new link is not set.";if(i.isUndefined(t))throw"The target of the new link is not set.";var f,e;f=i.isString(n)?new c(n):n;e=i.isString(t)?new c(t):t;this.source=f;this.target=e;this.source.links.push(this);this.target.links.push(this);this.source.outgoing.push(this);this.target.incoming.push(this);this.id=i.isDefined(r)?r:p();this.associatedConnection=i.isDefined(u)?u:null;this.type="Link";this.shortForm="Link '"+this.source.id+"->"+this.target.id+"'"},getComplement:function(n){if(this.source!==n&&this.target!==n)throw"The given node is not incident with this link.";return this.source===n?this.target:this.source},getCommonNode:function(n){return this.source===n.source||this.source===n.target?this.source:this.target===n.source||this.target===n.target?this.target:null},isBridging:function(n,t){return this.source===n&&this.target===t||this.source===t&&this.target===n},getNodes:function(){return[this.source,this.target]},incidentWith:function(n){return this.source===n||this.target===n},adjacentTo:function(n){return e(this.source.links,n)||e(this.target.links,n)},changeSource:function(n){i.remove(this.source.links,this);i.remove(this.source.outgoing,this);n.links.push(this);n.outgoing.push(this);this.source=n},changeTarget:function(n){i.remove(this.target.links,this);i.remove(this.target.incoming,this);n.links.push(this);n.incoming.push(this);this.target=n},changesNodes:function(n,t){this.source===n?this.changeSource(t):this.target===n&&this.changeTarget(t)},reverse:function(){var n=this.source,t=this.target;return this.source=t,i.remove(n.outgoing,this),this.source.outgoing.push(this),this.target=n,i.remove(t.incoming,this),this.target.incoming.push(this),this},directTo:function(n){if(this.source!==n&&this.target!==n)throw"The given node is not incident with this link.";this.target!==n&&this.reverse()},createReverseEdge:function(){var n=this.clone();return n.reverse(),n.reversed=!0,n},clone:function(){return new b(this.source,this.target)}}),o=u.Class.extend({init:function(n){this.links=[];this.nodes=[];this._nodeMap=new h;this.diagram=null;this._root=null;i.isDefined(n)?i.isString(n)?this.id=n:(this.diagram=n,this.id=n.id):this.id=p();this.bounds=new f;this._hasCachedRelationships=!1;this.type="Graph"},cacheRelationships:function(n){var r,u,t;if(i.isUndefined(n)&&(n=!1),!this._hasCachedRelationships||n){for(r=0,u=this.nodes.length;r<u;r++)t=this.nodes[r],t.children=this.getChildren(t),t.parents=this.getParents(t);this._hasCachedRelationships=!0}},assignLevels:function(n,t,r){var e,u,o,f;if(!n)throw"Start node not specified.";for(i.isUndefined(t)&&(t=0),this.cacheRelationships(),i.isUndefined(r)&&(r=new h,i.forEach(this.nodes,function(n){r.add(n,!1)})),r.set(n,!0),n.level=t,e=n.children,u=0,o=e.length;u<o;u++)(f=e[u],f&&!r.get(f))&&this.assignLevels(f,t+1,r)},root:function(n){if(i.isUndefined(n)){if(this._root)return this._root;var t=i.first(this.nodes,function(n){return n.incoming.length===0});return t?t:i.first(this.nodes)}this._root=n},getConnectedComponents:function(){var t,r,u,n,f;for(this.componentIndex=0,this.setItemIndices(),t=i.initArray(this.nodes.length,-1),r=0;r<this.nodes.length;r++)t[r]===-1&&(this._collectConnectedNodes(t,r),this.componentIndex++);for(u=[],n=0;n<this.componentIndex;++n)u[n]=new o;for(n=0;n<t.length;++n)f=u[t[n]],f.addNodeAndOutgoings(this.nodes[n]);return u.sort(function(n,t){return t.nodes.length-n.nodes.length}),u},_collectConnectedNodes:function(n,t){n[t]=this.componentIndex;var r=this.nodes[t];i.forEach(r.links,function(t){var u=t.getComplement(r),i=u.index;n[i]===-1&&this._collectConnectedNodes(n,i)},this)},calcBounds:function(){var n,t,r,i;if(this.isEmpty())return this.bounds=new f,this.bounds;for(n=null,t=0,r=this.nodes.length;t<r;t++)i=this.nodes[t],n=n?n.union(i.bounds()):i.bounds();return this.bounds=n,this.bounds},getSpanningTree:function(n){var r=new o,f=new h,s,c,a,l,v,u,y,k,t,d,p,w;for(r.root=n.clone(),r.root.level=0,r.root.id=n.id,f.add(n,r.root),n.level=0,a=[],l=[],r._addNode(r.root),a.push(n),l.push(n),v=1;l.length>0;)for(u=l.pop(),y=0;y<u.links.length;y++)(k=u.links[y],t=k.getComplement(u),e(a,t))||(t.level=u.level+1,v<t.level+1&&(v=t.level+1),e(l,t)||l.push(t),e(a,t)||a.push(t),f.containsKey(u)?s=f.get(u):(s=u.clone(),s.level=u.level,s.id=u.id,f.add(u,s)),f.containsKey(t)?c=f.get(t):(c=t.clone(),c.level=t.level,c.id=t.id,f.add(t,c)),d=new b(s,c),r.addLink(d));for(p=[],w=0;w<v;w++)p.push([]);return i.forEach(r.nodes,function(n){p[n.level].push(n)}),r.treeLevels=p,r.cacheRelationships(),r},takeRandomNode:function(t,r){if(i.isUndefined(t)&&(t=[]),i.isUndefined(r)&&(r=4),this.nodes.length===0)return null;if(this.nodes.length===1)return e(t,this.nodes[0])?null:this.nodes[0];var u=n.grep(this.nodes,function(n){return!e(t,n)&&n.degree()<=r});return i.isEmpty(u)?null:u[i.randomInteger(0,u.length)]},isEmpty:function(){return i.isEmpty(this.nodes)},isHealthy:function(){return i.all(this.links,function(n){return e(this.nodes,n.source)&&e(this.nodes,n.target)},this)},getParents:function(n){if(!this.hasNode(n))throw"The given node is not part of this graph.";return n.getParents()},getChildren:function(n){if(!this.hasNode(n))throw"The given node is not part of this graph.";return n.getChildren()},addLink:function(n,t,r){var u,f,e;if(i.isUndefined(n))throw"The source of the link is not defined.";if(i.isUndefined(t)){if(i.isDefined(n.type)&&n.type==="Link"){this.addExistingLink(n);return}throw"The target of the link is not defined.";}return u=this.getNode(n),i.isUndefined(u)&&(u=this.addNode(n)),f=this.getNode(t),i.isUndefined(f)&&(f=this.addNode(t)),e=new b(u,f),i.isDefined(r)&&(e.owner=r),this.links.push(e),e},removeAllLinks:function(){while(this.links.length>0){var n=this.links[0];this.removeLink(n)}},addExistingLink:function(n){var t,i;this.hasLink(n)||(this.links.push(n),this.hasNode(n.source.id)?(t=this.getNode(n.source.id),n.changeSource(t)):this.addNode(n.source),this.hasNode(n.target.id)?(i=this.getNode(n.target.id),n.changeTarget(i)):this.addNode(n.target))},hasLink:function(n){if(i.isString(n))return i.any(this.links,function(t){return t.id===n});if(n.type==="Link")return e(this.links,n);throw"The given object is neither an identifier nor a Link.";},getNode:function(n){var t=n.id||n;if(this._nodeMap.containsKey(t))return this._nodeMap.get(t)},hasNode:function(n){var t=n.id||n;return this._nodeMap.containsKey(t)},_addNode:function(n){this.nodes.push(n);this._nodeMap.add(n.id,n)},_removeNode:function(n){i.remove(this.nodes,n);this._nodeMap.remove(n.id)},removeNode:function(n){var t=n,u,r,f,e;if(i.isString(n)&&(t=this.getNode(n)),i.isDefined(t)){for(u=t.links,t.links=[],r=0,f=u.length;r<f;r++)e=u[r],this.removeLink(e);this._removeNode(t)}else throw"The identifier should be a Node or the Id (string) of a node.";},areConnected:function(n,t){return i.any(this.links,function(i){return i.source==n&&i.target==t||i.source==t&&i.target==n})},removeLink:function(n){i.remove(this.links,n);i.remove(n.source.outgoing,n);i.remove(n.source.links,n);i.remove(n.target.incoming,n);i.remove(n.target.links,n)},addNode:function(n,t,r){var u=null;if(!i.isDefined(n))throw"No Node or identifier for a new Node is given.";if(i.isString(n)){if(this.hasNode(n))return this.getNode(n);u=new c(n)}else{if(this.hasNode(n))return this.getNode(n);u=n}return i.isDefined(t)&&u.bounds(t),i.isDefined(r)&&(u.owner=r),this._addNode(u),u},addNodeAndOutgoings:function(n){this.hasNode(n)||this._addNode(n);var t=n.outgoing;n.outgoing=[];i.forEach(t,function(n){this.addExistingLink(n)},this)},setItemIndices:function(){for(var n=0;n<this.nodes.length;++n)this.nodes[n].index=n;for(n=0;n<this.links.length;++n)this.links[n].index=n},clone:function(n){var t=new o,u=i.isDefined(n)&&n===!0,r;return u&&(t.nodeMap=new h,t.linkMap=new h),r=new h,i.forEach(this.nodes,function(n){var i=n.clone();r.set(n,i);t._addNode(i);u&&t.nodeMap.set(i,n)}),i.forEach(this.links,function(n){if(r.containsKey(n.source)&&r.containsKey(n.target)){var i=t.addLink(r.get(n.source),r.get(n.target));u&&t.linkMap.set(i,n)}}),t},linearize:function(n){return o.Utils.linearize(this,n)},depthFirstTraversal:function(n,t){if(i.isUndefined(n))throw"You need to supply a starting node.";if(i.isUndefined(t))throw"You need to supply an action.";if(!this.hasNode(n))throw"The given start-node is not part of this graph";var r=this.getNode(n);this._dftIterator(r,t,[])},_dftIterator:function(n,t,i){var u,r,o,f;for(t(n),i.push(n),u=n.getChildren(),r=0,o=u.length;r<o;r++)(f=u[r],e(i,f))||this._dftIterator(f,t,i)},breadthFirstTraversal:function(n,t){var u,s,f,c,o;if(i.isUndefined(n))throw"You need to supply a starting node.";if(i.isUndefined(t))throw"You need to supply an action.";if(!this.hasNode(n))throw"The given start-node is not part of this graph";var l=this.getNode(n),r=new rt,h=[];for(r.enqueue(l);r.length>0;)for(u=r.dequeue(),t(u),h.push(u),s=u.getChildren(),f=0,c=s.length;f<c;f++)(o=s[f],e(h,o)||e(r,o))||r.enqueue(o)},_stronglyConnectedComponents:function(n,t,i,r,u,f,o){var l,s,h,a,c;for(i.add(t,o),r.add(t,o),o++,f.push(t),l=t.getChildren(),h=0,a=l.length;h<a;h++)s=l[h],i.containsKey(s)?e(f,s)&&r.add(t,Math.min(r.get(t),i.get(s))):(this._stronglyConnectedComponents(n,s,i,r,u,f,o),r.add(t,Math.min(r.get(t),r.get(s))));if(r.get(t)===i.get(t)){c=[];do s=f.pop(),c.push(s);while(s!==t);(!n||c.length>1)&&u.push(c)}},findCycles:function(n){var t,e,r;i.isUndefined(n)&&(n=!0);var u=new h,o=new h,f=[],s=[];for(t=0,e=this.nodes.length;t<e;t++)(r=this.nodes[t],u.containsKey(r))||this._stronglyConnectedComponents(n,r,u,o,f,s,0);return f},isAcyclic:function(){return i.isEmpty(this.findCycles())},isSubGraph:function(n){var t=n.linearize(),r=this.linearize();return i.all(t,function(n){return e(r,n)})},makeAcyclic:function(){var g,st,ht,v,ct,nt,lt,e,tt,r,u,o,it,w,rt,ut,b,ft,s,at,c,k,et,l,d,a,ot;if(this.isEmpty()||this.nodes.length<=1||this.links.length<=1)return[];if(this.nodes.length==2){if(g=[],this.links.length>1)for(st=this.links[0],ht=st.source,v=0,ct=this.links.length;v<ct;v++)(nt=this.links[v],nt.source!=ht)&&(lt=nt.reverse(),g.push(lt));return g}var f=this.clone(!0),t=this.nodes.length,n=new h,y=function(n){return n.outgoing.length===0?2-t:n.incoming.length===0?t-2:n.outgoing.length-n.incoming.length},p=function(n,i){var r=y(n,t);i.containsKey(r)||i.set(r,[]);i.get(r).push(n)};for(i.forEach(f.nodes,function(t){p(t,n)}),e=[],tt=[];f.nodes.length>0;){if(n.containsKey(2-t))for(it=n.get(2-t);it.length>0;){for(u=it.pop(),w=0;w<u.links.length;w++)rt=u.links[w],r=rt.getComplement(u),o=y(r,t),i.remove(n.get(o),r),r.removeLink(rt),p(r,n);f._removeNode(u);tt.unshift(u)}if(n.containsKey(t-2))for(ut=n.get(t-2);ut.length>0;){for(r=ut.pop(),b=0;b<r.links.length;b++)ft=r.links[b],u=ft.getComplement(r),o=y(u,t),i.remove(n.get(o),u),u.removeLink(ft),p(u,n);e.push(r);f._removeNode(r)}if(f.nodes.length>0)for(s=t-3;s>2-t;s--)if(n.containsKey(s)&&n.get(s).length>0){for(at=n.get(s),c=at.pop(),k=0;k<c.links.length;k++)et=c.links[k],l=et.getComplement(c),o=y(l,t),i.remove(n.get(o),l),l.removeLink(et),p(l,n);e.push(c);f._removeNode(c);break}}for(e=e.concat(tt),d=new h,a=0;a<this.nodes.length;a++)d.set(f.nodeMap.get(e[a]),a);return ot=[],i.forEach(this.links,function(n){d.get(n.source)>d.get(n.target)&&(n.reverse(),ot.push(n))}),ot}});o.Predefined={EightGraph:function(){return o.Utils.parse(["1->2","2->3","3->4","4->1","3->5","5->6","6->7","7->3"])},Mindmap:function(){return o.Utils.parse(["0->1","0->2","0->3","0->4","0->5","1->6","1->7","7->8","2->9","9->10","9->11","3->12","12->13","13->14","4->15","4->16","15->17","15->18","18->19","18->20","14->21","14->22","5->23","23->24","23->25","6->26"])},ThreeGraph:function(){return o.Utils.parse(["1->2","2->3","3->1"])},BinaryTree:function(n){return i.isUndefined(n)&&(n=5),o.Utils.createBalancedTree(n,2)},Linear:function(n){return i.isUndefined(n)&&(n=10),o.Utils.createBalancedTree(n,1)},Tree:function(n,t){return o.Utils.createBalancedTree(n,t)},Forest:function(n,t,i){return o.Utils.createBalancedForest(n,t,i)},Workflow:function(){return o.Utils.parse(["0->1","1->2","2->3","1->4","4->3","3->5","5->6","6->3","6->7","5->4"])},Grid:function(n,t){var i=new l.Graph,r,e,u,f,o;if(n<=0&&t<=0)return i;for(r=0;r<n+1;r++)for(e=null,u=0;u<t+1;u++)f=new c(r.toString()+"."+u.toString()),i.addNode(f),e&&i.addLink(e,f),r>0&&(o=i.getNode((r-1).toString()+"."+u.toString()),i.addLink(o,f)),e=f;return i}};o.Utils={parse:function(n){for(var t,f,r,o=new l.Graph,s=n.slice(),e=0,h=s.length;e<h;e++){if(t=s[e],i.isString(t)){if(t.indexOf("->")<0)throw"The link should be specified as 'a->b'.";if(f=t.split("->"),f.length!=2)throw"The link should be specified as 'a->b'.";r=new b(f[0],f[1]);o.addLink(r)}if(i.isObject(t)){if(!r)throw"Specification found before Link definition.";u.deepExtend(r,t)}}return o},linearize:function(n,t){var r,u,e,f;if(i.isUndefined(n))throw"Expected an instance of a Graph object in slot one.";for(i.isUndefined(t)&&(t=!1),r=[],u=0,e=n.links.length;u<e;u++)f=n.links[u],r.push(f.source.id+"->"+f.target.id),t&&r.push({id:f.id});return r},_addShape:function(n,t,r,f){return i.isUndefined(t)&&(t=new l.Point(0,0)),i.isUndefined(r)&&(r=p()),f=u.deepExtend({width:20,height:20,id:r,radius:10,fill:"#778899",data:"circle",undoable:!1,x:t.x,y:t.y},f),n.addShape(f)},_addConnection:function(n,t,i,r){return n.connect(t,i,r)},createDiagramFromGraph:function(n,t,e,o){var a,g,v,b,h,y,p,k,d,nt,w;if(i.isUndefined(n))throw"The diagram surface is undefined.";if(i.isUndefined(t))throw"No graph specification defined.";i.isUndefined(e)&&(e=!0);i.isUndefined(o)&&(o=!1);var tt=n.element.clientWidth||200,it=n.element.clientHeight||200,l=[],s,c;for(a=0,g=t.nodes.length;a<g;a++)s=t.nodes[a],v=s.position,i.isUndefined(v)&&(v=i.isDefined(s.x)&&i.isDefined(s.y)?new r(s.x,s.y):new r(i.randomInteger(10,tt-20),i.randomInteger(10,it-20))),b={},s.id==="0"||o&&u.deepExtend(b,{width:Math.random()*150+20,height:Math.random()*80+50,data:"rectangle",fill:{color:"#778899"}}),c=this._addShape(n,v,s.id,b),h=c.bounds(),i.isDefined(h)&&(s.x=h.x,s.y=h.y,s.width=h.width,s.height=h.height),l[s.id]=c;for(y=0;y<t.links.length;y++)(p=t.links[y],k=l[p.source.id],i.isUndefined(k))||(d=l[p.target.id],i.isUndefined(d))||this._addConnection(n,k,d,{id:p.id});if(e)for(nt=new n.SpringLayout(n),nt.layoutGraph(t,{limitToView:!1}),w=0;w<t.nodes.length;w++)s=t.nodes[w],c=l[s.id],c.bounds(new f(s.x,s.y,s.width,s.height))},createBalancedTree:function(n,t){var f,s,e,y,h,a;i.isUndefined(n)&&(n=3);i.isUndefined(t)&&(t=3);var r=new l.Graph,v=-1,u=[],o;if(n<=0||t<=0)return r;for(f=new c((++v).toString()),r.addNode(f),r.root=f,u.push(f),s=0;s<n;s++){for(o=[],e=0;e<u.length;e++)for(y=u[e],h=0;h<t;h++)a=new c((++v).toString()),r.addLink(y,a),o.push(a);u=o}return r},createBalancedForest:function(n,t,r){var s,h,a,e,w,v,y;i.isUndefined(n)&&(n=3);i.isUndefined(t)&&(t=3);i.isUndefined(r)&&(r=5);var u=new l.Graph,p=-1,f=[],o;if(n<=0||t<=0||r<=0)return u;for(s=0;s<r;s++)for(h=new c((++p).toString()),u.addNode(h),f=[h],a=0;a<n;a++){for(o=[],e=0;e<f.length;e++)for(w=f[e],v=0;v<t;v++)y=new c((++p).toString()),u.addLink(w,y),o.push(y);f=o}return u},createRandomConnectedGraph:function(n,t,r){var u,a,v,f,s,y,p,h,e,o;if((i.isUndefined(n)&&(n=40),i.isUndefined(t)&&(t=4),i.isUndefined(r)&&(r=!1),u=new l.Graph,a=-1,n<=0)||(v=new c((++a).toString()),u.addNode(v),n===1))return u;if(n>1){for(f=1;f<n;f++){if(s=u.takeRandomNode([],t),!s)break;y=u.addNode(f.toString());u.addLink(s,y)}if(!r&&n>1)for(p=i.randomInteger(1,n),h=0;h<p;h++)e=u.takeRandomNode([],t),o=u.takeRandomNode([],t),e&&o&&!u.areConnected(e,o)&&u.addLink(e,o);return u}},randomDiagram:function(n,t,i,r,f){var e=u.dataviz.diagram.Graph.Utils.createRandomConnectedGraph(t,i,r);o.Utils.createDiagramFromGraph(n,e,!1,f)}};u.deepExtend(l,{init:function(n){u.init(n,l.ui)},Point:r,Intersect:a,Geometry:lt,Rect:f,Size:nt,RectAlign:ht,Matrix:s,MatrixVector:tt,normalVariable:ct,randomId:p,Dictionary:h,HashTable:w,Queue:rt,Set:at,Node:c,Link:b,Graph:o,PathDefiner:ot})})(window.kendo.jQuery)}(),function(){(function(n,t){function gt(n,t){for(var f=this.options,e=!1,i,r,u=0;u<t.length;u++)r=t[u],i=n[r],g(i)&&f[r]!==i&&(f[r]=i,e=!0);return e}function ei(n){return{x:n.x||0,y:n.y||0,width:n.width||0,height:n.height||0}}function d(n){if(n){var t=n;return ut(t)&&(t={color:t}),t.color&&(t.color=bt(t.color)),t}}function bt(n){return n!=ft?new i.Color(n).toHex():n}function li(n,t){var i=t.x-n.x,r=t.y-n.y;return f.util.deg(Math.atan2(r,i))}function a(n,t){return new i.Segment(new o.Point(n,t))}function oi(n){if(n)return new o.Rect([n.x,n.y],[n.width,n.height])}var f=window.kendo,c=f.dataviz.diagram,v=f.Class,e=f.deepExtend,y=c.Point,p=c.Rect,w=c.Matrix,kt=c.Utils,g=kt.isNumber,ut=kt.isString,si=c.MatrixVector,o=f.geometry,i=f.drawing,u=f.util.defined,dt=n.inArray,ft="transparent",nt={none:"none",arrowStart:"ArrowStart",filledCircle:"FilledCircle",arrowEnd:"ArrowEnd"},hi=360,l="start",tt="end",et="width",ot="height",st="x",ht="y",yt,pt,ri,k,ui,wt,fi;c.Markers=nt;var it=v.extend({init:function(n,t){this.x=n;this.y=t},toMatrix:function(){return w.scaling(this.x,this.y)},toString:function(){return f.format("scale({0},{1})",this.x,this.y)},invert:function(){return new it(1/this.x,1/this.y)}}),b=v.extend({init:function(n,t){this.x=n;this.y=t},toMatrixVector:function(){return new si(0,0,0,0,this.x,this.y)},toMatrix:function(){return w.translation(this.x,this.y)},toString:function(){return f.format("translate({0},{1})",this.x,this.y)},plus:function(n){this.x+=n.x;this.y+=n.y},times:function(n){this.x*=n;this.y*=n},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},normalize:function(){this.Length!==0&&this.times(1/this.length())},invert:function(){return new b(-this.x,-this.y)}}),s=v.extend({init:function(n,t,i){this.x=t||0;this.y=i||0;this.angle=n},toString:function(){return this.x&&this.y?f.format("rotate({0},{1},{2})",this.angle,this.x,this.y):f.format("rotate({0})",this.angle)},toMatrix:function(){return w.rotation(this.angle,this.x,this.y)},center:function(){return new y(this.x,this.y)},invert:function(){return new s(hi-this.angle,this.x,this.y)}});s.ZERO=new s(0);s.create=function(n){return new s(n.angle,n.x,n.y)};s.parse=function(n){var t=n.slice(1,n.length-1).split(","),i=t[0],r=t[1],u=t[2];return new s(i,r,u)};var ct=v.extend({init:function(n,i,r,u,f,e){this.translate=new b(n,i);r!==t&&u!==t&&(this.scale=new it(r,u));f!==t&&(this.rotate=e?new s(f,e.x,e.y):new s(f))},toString:function(){var n=function(n){return n?n.toString():""};return n(this.translate)+n(this.rotate)+n(this.scale)},render:function(n){n._transform=this;n._renderTransform()},toMatrix:function(){var n=w.unit();return this.translate&&(n=n.times(this.translate.toMatrix())),this.rotate&&(n=n.times(this.rotate.toMatrix())),this.scale&&(n=n.times(this.scale.toMatrix())),n},invert:function(){var r=this.rotate?this.rotate.invert():t,e=r?r.toMatrix():w.unit(),u=this.scale?this.scale.invert():t,o=u?u.toMatrix():w.unit(),i=new y(-this.translate.x,-this.translate.y),f,n;return i=e.times(o).apply(i),f=new b(i.x,i.y),n=new ct,n.translate=f,n.rotate=r,n.scale=u,n}}),rt={_setScale:function(){var i=this.options,r=this._originWidth,u=this._originHeight,n=i.width/r,t=i.height/u;g(n)||(n=1);g(t)||(t=1);this._transform.scale=new it(n,t)},_setTranslate:function(){var n=this.options,t=n.x||0,i=n.y||0;this._transform.translate=new b(t,i)},_initSize:function(){var n=this.options,t=!1;n.autoSize!==!1&&(u(n.width)||u(n.height))&&(this._measure(!0),this._setScale(),t=!0);(u(n.x)||u(n.y))&&(this._setTranslate(),t=!0);t&&this._renderTransform()},_updateSize:function(n){var t=!1;return this.options.autoSize!==!1&&this._diffNumericOptions(n,[et,ot])&&(t=!0,this._measure(!0),this._setScale()),this._diffNumericOptions(n,[st,ht])&&(t=!0,this._setTranslate()),t&&this._renderTransform(),t}},h=v.extend({init:function(n){var t=this;t.options=e({},t.options,n);t.id=t.options.id;t._originSize=p.empty();t._transform=new ct},visible:function(n){return this.drawingContainer().visible(n)},redraw:function(n){n&&n.id&&(this.id=n.id)},position:function(n,t){var i=this.options;if(!u(n))return new y(i.x,i.y);u(t)?(i.x=n,i.y=t):n instanceof y&&(i.x=n.x,i.y=n.y);this._transform.translate=new b(i.x,i.y);this._renderTransform()},rotate:function(n,t){return u(n)&&(this._transform.rotate=new s(n,t.x,t.y),this._renderTransform()),this._transform.rotate||s.ZERO},drawingContainer:function(){return this.drawingElement},_renderTransform:function(){var n=this._transform.toMatrix();this.drawingContainer().transform(new o.Matrix(n.a,n.b,n.c,n.d,n.e,n.f))},_hover:function(){},_diffNumericOptions:gt,_measure:function(n){var t,i,r;return!this._measured||n?(i=this._boundingBox()||new o.Rect,r=i.topLeft(),t=new p(r.x,r.y,i.width(),i.height()),this._originSize=t,this._originWidth=t.width,this._originHeight=t.height,this._measured=!0):t=this._originSize,t},_boundingBox:function(){return this.drawingElement.rawBBox()}}),r=h.extend({init:function(n){h.fn.init.call(this,n);n=this.options;n.fill=d(n.fill);n.stroke=d(n.stroke)},options:{stroke:{color:"gray",width:1},fill:{color:ft}},fill:function(n,t){this._fill({color:bt(n),opacity:t})},stroke:function(n,t,i){this._stroke({color:bt(n),width:t,opacity:i})},redraw:function(n){if(n){var t=n.stroke,i=n.fill;t&&this._stroke(d(t));i&&this._fill(d(i));h.fn.redraw.call(this,n)}},_hover:function(n){var u=this.drawingElement,r=this.options,t=r.hover,i;t&&t.fill&&(i=n?d(t.fill):r.fill,u.fill(i.color,i.opacity))},_stroke:function(n){var i=this.options,t;e(i,{stroke:n});n=i.stroke;t=null;n.width>0&&(t={color:n.color,width:n.width,opacity:n.opacity,dashType:n.dashType});this.drawingElement.options.set("stroke",t)},_fill:function(n){var u=this.options,t,r,f;e(u,{fill:n||{}});t=u.fill;t.gradient?(r=t.gradient,f=r.type==="radial"?i.RadialGradient:i.LinearGradient,this.drawingElement.fill(new f(r))):this.drawingElement.fill(t.color,t.opacity)}}),ni=r.extend({init:function(n){this._textColor(n);r.fn.init.call(this,n);this._font();this._initText();this._initSize()},options:{fontSize:15,fontFamily:"sans-serif",stroke:{width:0},fill:{color:"black"},autoSize:!0},_initText:function(){var n=this.options;this.drawingElement=new i.Text(u(n.text)?n.text:"",new o.Point,{font:n.font});this._fill();this._stroke()},_textColor:function(n){n&&n.color&&e(n,{fill:{color:n.color}})},_font:function(){var n=this.options;n.fontFamily&&u(n.fontSize)?n.font=n.fontSize+"px "+n.fontFamily:delete n.font},content:function(n){return this.drawingElement.content(n)},redraw:function(n){if(n){var t=!1,i=this.options;this._textColor(n);r.fn.redraw.call(this,n);(n.fontFamily||u(n.fontSize))&&(e(i,{fontFamily:n.fontFamily,fontSize:n.fontSize}),this._font(),this.drawingElement.options.set("font",i.font),t=!0);n.text&&(this.content(n.text),t=!0);!this._updateSize(n)&&t&&this._initSize()}}});e(ni.fn,rt);var ci=r.extend({init:function(n){r.fn.init.call(this,n);this._initPath();this._setPosition()},_setPosition:function(){var n=this.options,t=n.x,i=n.y;(u(t)||u(i))&&this.position(t||0,i||0)},redraw:function(n){n&&(r.fn.redraw.call(this,n),this._diffNumericOptions(n,[et,ot])&&this._drawPath(),this._diffNumericOptions(n,[st,ht])&&this._setPosition())},_initPath:function(){var n=this.options;this.drawingElement=new i.Path({stroke:n.stroke,closed:!0});this._fill();this._drawPath()},_drawPath:function(){var r=this.drawingElement,n=ei(this.options),t=n.width,i=n.height;r.segments.elements([a(0,0),a(t,0),a(t,i),a(0,i)])}}),lt=r.extend({init:function(n){r.fn.init.call(this,n);var t=this.options.anchor;this.anchor=new o.Point(t.x,t.y);this.createElement()},options:{stroke:{color:ft,width:0},fill:{color:"black"}},_transformToPath:function(n,t){var i=t.transform();return n&&i&&(n=n.transformCopy(i)),n},redraw:function(n){n&&(n.position&&(this.options.position=n.position),r.fn.redraw.call(this,n))}}),ti=lt.extend({options:{radius:4,anchor:{x:0,y:0}},createElement:function(){var n=this.options;this.drawingElement=new i.Circle(new o.Circle(this.anchor,n.radius),{fill:n.fill,stroke:n.stroke})},positionMarker:function(n){var u=this.options,f=u.position,t=n.segments,i,r;i=f==l?t[0]:t[t.length-1];i&&(r=this._transformToPath(i.anchor(),n),this.drawingElement.transform(o.transform().translate(r.x,r.y)))}}),ii=lt.extend({options:{path:"M 0 0 L 10 5 L 0 10 L 3 5 z",anchor:{x:10,y:5}},createElement:function(){var n=this.options;this.drawingElement=i.Path.parse(n.path,{fill:n.fill,stroke:n.stroke})},positionMarker:function(n){var f=this._linePoints(n),e=f.start,t=f.end,i=o.transform(),r,u;e&&i.rotate(li(e,t),t);t&&(r=this.anchor,u=t.clone().translate(-r.x,-r.y),i.translate(u.x,u.y));this.drawingElement.transform(i)},_linePoints:function(n){var o=this.options,r=n.segments,i,u,t,f,e;return o.position==l?(t=r[0],t&&(u=t.anchor(),i=t.controlOut(),f=r[1],!i&&f&&(i=f.anchor()))):(t=r[r.length-1],t&&(u=t.anchor(),i=t.controlIn(),e=r[r.length-2],!i&&e&&(i=e.anchor()))),u?{start:this._transformToPath(i,n),end:this._transformToPath(u,n)}:void 0}}),at={_getPath:function(n){var t=this.drawingElement;return t instanceof i.MultiPath&&(t=n==l?t.paths[0]:t.paths[t.paths.length-1]),t&&t.segments.length?t:void 0},_normalizeMarkerOptions:function(n){var t=n.startCap,i=n.endCap;ut(t)&&(n.startCap={type:t});ut(i)&&(n.endCap={type:i})},_removeMarker:function(n){var t=this._markers[n];t&&(this.drawingContainer().remove(t.drawingElement),delete this._markers[n])},_createMarkers:function(){var n=this.options;this._normalizeMarkerOptions(n);this._markers={};this._markers[l]=this._createMarker(n.startCap,l);this._markers[tt]=this._createMarker(n.endCap,tt)},_createMarker:function(n,t){var u=(n||{}).type,f=this._getPath(t),i,r;if(!f){this._removeMarker(t);return}return u==nt.filledCircle?i=ti:u==nt.arrowStart||u==nt.arrowEnd?i=ii:this._removeMarker(t),i?(r=new i(e({},n,{position:t})),r.positionMarker(f),this.drawingContainer().append(r.drawingElement),r):void 0},_positionMarker:function(n){var i=this._markers[n],t;i&&(t=this._getPath(n),t?i.positionMarker(t):this._removeMarker(n))},_capMap:{start:"startCap",end:"endCap"},_redrawMarker:function(n,t,i){this._normalizeMarkerOptions(i);var u=this.options,r=this._capMap[t],s=(u[r]||{}).type,f=i[r],o=!1;return f?(u[r]=e({},u[r],f),f.type&&s!=f.type?(this._removeMarker(t),this._markers[t]=this._createMarker(u[r],t),o=!0):this._markers[t]&&this._markers[t].redraw(f)):n&&!this._markers[t]&&u[r]&&(this._markers[t]=this._createMarker(u[r],t),o=!0),o},_redrawMarkers:function(n,t){!this._redrawMarker(n,l,t)&&n&&this._positionMarker(l);!this._redrawMarker(n,tt,t)&&n&&this._positionMarker(tt)}},vt=r.extend({init:function(n){r.fn.init.call(this,n);this.container=new i.Group;this._createElements();this._initSize()},options:{autoSize:!0},drawingContainer:function(){return this.container},data:function(n){var t=this.options;if(n)t.data!=n&&(t.data=n,this._setData(n),this._initSize(),this._redrawMarkers(!0,{}));else return t.data},redraw:function(n){if(n){r.fn.redraw.call(this,n);var i=this.options,t=n.data;u(t)&&i.data!=t?(i.data=t,this._setData(t),this._updateSize(n)||this._initSize(),this._redrawMarkers(!0,n)):(this._updateSize(n),this._redrawMarkers(!1,n))}},_createElements:function(){var n=this.options;this.drawingElement=i.Path.parse(n.data||"",{stroke:n.stroke});this._fill();this.container.append(this.drawingElement);this._createMarkers()},_setData:function(n){var r=this.drawingElement,t=i.Path.parse(n||""),u=t.paths.slice(0);t.paths.elements([]);r.paths.elements(u)}});e(vt.fn,rt);e(vt.fn,at);yt=r.extend({init:function(n){r.fn.init.call(this,n);this.container=new i.Group;this._initPath();this._createMarkers()},drawingContainer:function(){return this.container},redraw:function(n){if(n){n=n||{};var t=n.from,i=n.to;t&&(this.options.from=t);i&&(this.options.to=i);t||i?(this._drawPath(),this._redrawMarkers(!0,n)):this._redrawMarkers(!1,n);r.fn.redraw.call(this,n)}},_initPath:function(){var n=this.options,t=this.drawingElement=new i.Path({stroke:n.stroke});this._fill();this._drawPath();this.container.append(t)},_drawPath:function(){var n=this.options,r=this.drawingElement,t=n.from||new y,i=n.to||new y;r.segments.elements([a(t.x,t.y),a(i.x,i.y)])}});e(yt.fn,at);pt=r.extend({init:function(n){r.fn.init.call(this,n);this.container=new i.Group;this._initPath();this._createMarkers()},drawingContainer:function(){return this.container},points:function(n){var t=this.options;if(n)t.points=n,this._updatePath();else return t.points},redraw:function(n){if(n){var t=n.points;r.fn.redraw.call(this,n);t&&this._pointsDiffer(t)?(this.points(t),this._redrawMarkers(!0,n)):this._redrawMarkers(!1,n)}},_initPath:function(){var n=this.options;this.drawingElement=new i.Path({stroke:n.stroke});this._fill();this.container.append(this.drawingElement);n.points&&this._updatePath()},_pointsDiffer:function(n){var i=this.options.points,r=i.length!==n.length,t;if(!r)for(t=0;t<n.length;t++)if(i[t].x!==n[t].x||i[t].y!==n[t].y){r=!0;break}return r},_updatePath:function(){for(var u=this.drawingElement,f=this.options,i=f.points,r=[],n,t=0;t<i.length;t++)n=i[t],r.push(a(n.x,n.y));u.segments.elements(r)},options:{points:[]}});e(pt.fn,at);ri=h.extend({init:function(n){h.fn.init.call(this,n);this._initImage()},redraw:function(n){n&&(n.source&&this.drawingElement.src(n.source),this._diffNumericOptions(n,[et,ot,st,ht])&&this.drawingElement.rect(this._rect()),h.fn.redraw.call(this,n))},_initImage:function(){var n=this.options,t=this._rect();this.drawingElement=new i.Image(n.source,t,{})},_rect:function(){var n=ei(this.options),t=new o.Point(n.x,n.y),i=new o.Size(n.width,n.height);return new o.Rect(t,i)}});k=h.extend({init:function(n){this.children=[];h.fn.init.call(this,n);this.drawingElement=new i.Group;this._initSize()},options:{autoSize:!1},append:function(n){this.drawingElement.append(n.drawingContainer());this.children.push(n);this._childrenChange=!0},remove:function(n){this._remove(n)&&(this._childrenChange=!0)},_remove:function(n){var t=dt(n,this.children);if(t>=0)return this.drawingElement.removeAt(t),this.children.splice(t,1),!0},clear:function(){this.drawingElement.clear();this.children=[];this._childrenChange=!0},toFront:function(n){for(var t,i=0;i<n.length;i++)t=n[i],this._remove(t)&&this.append(t)},toBack:function(n){this._reorderChildren(n,0)},toIndex:function(n,t){this._reorderChildren(n,t)},_reorderChildren:function(n,t){for(var r=this.drawingElement,e=r.children.slice(0),o=this.children,c=g(t),u,s,h,f,i=0;i<n.length;i++)f=n[i],h=f.drawingContainer(),u=dt(f,o),u>=0&&(e.splice(u,1),o.splice(u,1),s=c?t:t[i],e.splice(s,0,h),o.splice(s,0,f));r.clear();r.append.apply(r,e)},redraw:function(n){n&&(this._childrenChange?(this._childrenChange=!1,this._updateSize(n)||this._initSize()):this._updateSize(n),h.fn.redraw.call(this,n))},_boundingBox:function(){for(var u=this.children,n,t,i,r=0;r<u.length;r++)t=u[r],t.visible()&&t._includeInBBox!==!1&&(i=t.drawingContainer().clippedBBox(null),i&&(n=n?p.union(n,i):i));return n}});e(k.fn,rt);ui=k.extend({init:function(n,t){this.children=[];h.fn.init.call(this,t);this.drawingElement=new i.Layout(oi(n),t);this._initSize()},rect:function(n){if(n)this.drawingElement.rect(oi(n));else{var t=this.drawingElement.rect();if(t)return new p(t.origin.x,t.origin.y,t.size.width,t.size.height)}},reflow:function(){this.drawingElement.reflow()},redraw:function(n){f.deepExtend(this.drawingElement.options,n);k.fn.redraw.call(this,n)}});wt=r.extend({init:function(n){r.fn.init.call(this,n);this._initCircle();this._initSize()},redraw:function(n){if(n){var t=this.options;n.center&&(e(t,{center:n.center}),this._center.move(t.center.x,t.center.y));this._diffNumericOptions(n,["radius"])&&this._circle.setRadius(t.radius);this._updateSize(n);r.fn.redraw.call(this,n)}},_initCircle:function(){var n=this.options,r=n.width,f=n.height,t=n.radius,e;u(t)||(u(r)||(r=f),u(f)||(f=r),n.radius=t=Math.min(r,f)/2);e=n.center||{x:t,y:t};this._center=new o.Point(e.x,e.y);this._circle=new o.Circle(this._center,t);this.drawingElement=new i.Circle(this._circle,{stroke:n.stroke});this._fill()}});e(wt.fn,rt);fi=v.extend({init:function(n,t){t=t||{};this.element=n;this.surface=i.Surface.create(n,t);f.isFunction(this.surface.translate)&&(this.translate=this._translate);this.drawingElement=new i.Group;this._viewBox=new p(0,0,t.width,t.height);this.size(this._viewBox)},bounds:function(){var n=this.drawingElement.clippedBBox();return new p(0,0,n.width(),n.height())},size:function(n){var t=this._viewBox;return u(n)&&(t.width=n.width,t.height=n.height,this.surface.setSize(n)),{width:t.width,height:t.height}},_translate:function(n,t){var i=this._viewBox;return u(n)&&u(t)&&(i.x=n,i.y=t,this.surface.translate({x:n,y:t})),{x:i.x,y:i.y}},draw:function(){this.surface.draw(this.drawingElement)},append:function(n){return this.drawingElement.append(n.drawingContainer()),this},remove:function(n){this.drawingElement.remove(n.drawingContainer())},insertBefore:function(){},clear:function(){this.drawingElement.clear()},destroy:function(t){this.surface.destroy();t&&n(this.element).remove()}});f.deepExtend(c,{init:function(n){f.init(n,c.ui)},diffNumericOptions:gt,Element:h,Scale:it,Translation:b,Rotation:s,Circle:wt,Group:k,Rectangle:ci,Canvas:fi,Path:vt,Layout:ui,Line:yt,MarkerBase:lt,ArrowMarker:ii,CircleMarker:ti,Polyline:pt,CompositeTransform:ct,TextBlock:ni,Image:ri,VisualBase:r})})(window.kendo.jQuery)}(),function(){(function(n,t){function rt(n,t){n.isSelected?t.ctrlKey&&n.select(!1):n.diagram.select(n,{addToSelection:t.ctrlKey})}function yr(n){return n.ctrlKey===!1&&n.altKey===!1&&n.shiftKey===!1}function ut(n,t){var i=n!==!1;return n.key&&n.key!="none"&&(i=t[n.key+"Key"]),i}function c(n,t){return t.charCodeAt(0)==n||t.toUpperCase().charCodeAt(0)==n}function gr(n,t){var i;return n.x==-1&&n.y==-1?i=t.bottomRight():n.x==1&&n.y==1?i=t.topLeft():n.x==-1&&n.y==1?i=t.topRight():n.x==1&&n.y==-1?i=t.bottomLeft():n.x===0&&n.y==-1?i=t.bottom():n.x===0&&n.y==1?i=t.top():n.x==1&&n.y===0?i=t.left():n.x==-1&&n.y===0&&(i=t.right()),i}function v(n){var t=n.options.editable;return t&&t.drag!==!1}function iu(n,t){for(var i,r,u,f=0;f<n.connectors.length;f++)if(i=n.connectors[f],r=i.position(),u=new o(r.x,r.y),u.inflate(y,y),u.contains(t))return i}var f=window.kendo,ri=f.dataviz,u=ri.diagram,r=f.Class,ui=u.Group,o=u.Rect,w=u.Rectangle,l=u.Utils,fi=l.isUndefined,i=u.Point,b=u.Circle,ei=u.Ticker,e=f.deepExtend,oi=f.ui.Movable,et=f.support.browser,h=f.util.defined,ot=n.inArray,st=n.proxy,s={arrow:"default",grip:"pointer",cross:"pointer",add:"pointer",move:"move",select:"pointer",south:"s-resize",east:"e-resize",west:"w-resize",north:"n-resize",rowresize:"row-resize",colresize:"col-resize"},y=10,ht="Auto",k="Top",ct="Right",d="Left",lt="Bottom",si=10,hi=10,g="dragStart",nt="drag",tt="dragEnd",ci="itemRotate",it="itemBoundsChange",li=5,ai=5,vi="mouseEnter",yi="mouseLeave",pi="zoomStart",wi="zoomEnd",bi=-2e4,ki=2e4,di=.9,gi=.93,nr=5,at="transparent",tr="pan",vt="rotated";u.Cursors=s;var ir=f.Class.extend({init:function(n){this.layoutState=n;this.diagram=n.diagram},initState:function(){function n(n,t){var i=this.diagram.getShapeById(n);i&&(this.subjects.push(i),this.froms.push(i.bounds().topLeft()),this.tos.push(t.topLeft()))}this.froms=[];this.tos=[];this.subjects=[];this.layoutState.nodeMap.forEach(n,this)},update:function(n){if(!(this.subjects.length<=0))for(var t=0;t<this.subjects.length;t++)this.subjects[t].position(new i(this.froms[t].x+(this.tos[t].x-this.froms[t].x)*n,this.froms[t].y+(this.tos[t].y-this.froms[t].y)*n))}}),rr=r.extend({init:function(n,t,i){this.animate=fi(i)?!1:i;this._initialState=n;this._finalState=t;this.title="Diagram layout"},undo:function(){this.setState(this._initialState)},redo:function(){this.setState(this._finalState)},setState:function(n){var t=n.diagram,i;if(this.animate){n.linkMap.forEach(function(n,i){var r=t.getShapeById(n);r.visible(!1);r&&r.points(i)});i=new ei;i.addAdapter(new ir(n));i.onComplete(function(){n.linkMap.forEach(function(n){var i=t.getShapeById(n);i.visible(!0)})});i.play()}else n.nodeMap.forEach(function(n,i){var r=t.getShapeById(n);r&&r.position(i.topLeft())}),n.linkMap.forEach(function(n,i){var r=t.getShapeById(n);r&&r.points(i)})}}),yt=r.extend({init:function(n){this.units=[];this.title="Composite unit";n!==t&&this.units.push(n)},add:function(n){this.units.push(n)},undo:function(){for(var n=0;n<this.units.length;n++)this.units[n].undo()},redo:function(){for(var n=0;n<this.units.length;n++)this.units[n].redo()}}),ur=r.extend({init:function(n,t,i){this.item=n;this._redoSource=t;this._redoTarget=i;h(t)&&(this._undoSource=n.source());h(i)&&(this._undoTarget=n.target());this.title="Connection Editing"},undo:function(){this._undoSource!==t&&this.item._updateConnector(this._undoSource,"source");this._undoTarget!==t&&this.item._updateConnector(this._undoTarget,"target");this.item.updateModel()},redo:function(){this._redoSource!==t&&this.item._updateConnector(this._redoSource,"source");this._redoTarget!==t&&this.item._updateConnector(this._redoTarget,"target");this.item.updateModel()}}),fr=r.extend({init:function(n,t,i){this.item=n;this._undoSource=t;this._undoTarget=i;this._redoSource=n.source();this._redoTarget=n.target();this.title="Connection Editing"},undo:function(){this.item._updateConnector(this._undoSource,"source");this.item._updateConnector(this._undoTarget,"target");this.item.updateModel()},redo:function(){this.item._updateConnector(this._redoSource,"source");this.item._updateConnector(this._redoTarget,"target");this.item.updateModel()}}),er=r.extend({init:function(n){this.connection=n;this.diagram=n.diagram;this.targetConnector=n.targetConnector;this.title="Delete connection"},undo:function(){this.diagram._addConnection(this.connection,!1)},redo:function(){this.diagram.remove(this.connection,!1)}}),or=r.extend({init:function(n){this.shape=n;this.diagram=n.diagram;this.title="Deletion"},undo:function(){this.diagram._addShape(this.shape,!1);this.shape.select(!1)},redo:function(){this.shape.select(!1);this.diagram.remove(this.shape,!1)}}),pt=r.extend({init:function(n,t,i){var r,u;for(this.shapes=n,this.undoStates=t,this.title="Transformation",this.redoStates=[],this.adorner=i,r=0;r<this.shapes.length;r++)u=this.shapes[r],this.redoStates.push(u.bounds())},undo:function(){for(var t,n=0;n<this.shapes.length;n++)t=this.shapes[n],t.bounds(this.undoStates[n]),t.hasOwnProperty("layout")&&t.layout(t,this.redoStates[n],this.undoStates[n]),t.updateModel();this.adorner&&(this.adorner.refreshBounds(),this.adorner.refresh())},redo:function(){for(var t,n=0;n<this.shapes.length;n++)t=this.shapes[n],t.bounds(this.redoStates[n]),t.hasOwnProperty("layout")&&t.layout(t,this.undoStates[n],this.redoStates[n]),t.updateModel();this.adorner&&(this.adorner.refreshBounds(),this.adorner.refresh())}}),sr=r.extend({init:function(n,t){this.connection=n;this.diagram=t;this.title="New connection"},undo:function(){this.diagram.remove(this.connection,!1)},redo:function(){this.diagram._addConnection(this.connection,!1)}}),hr=r.extend({init:function(n,t){this.shape=n;this.diagram=t;this.title="New shape"},undo:function(){this.diagram.deselect();this.diagram.remove(this.shape,!1)},redo:function(){this.diagram._addShape(this.shape,!1)}}),cr=r.extend({init:function(n,t,i){this.initial=n;this.finalPos=t;this.diagram=i;this.title="Pan Unit"},undo:function(){this.diagram.pan(this.initial)},redo:function(){this.diagram.pan(this.finalPos)}}),wt=r.extend({init:function(n,t,i){var r,u;for(this.shapes=t,this.undoRotates=i,this.title="Rotation",this.redoRotates=[],this.redoAngle=n._angle,this.adorner=n,this.center=n._innerBounds.center(),r=0;r<this.shapes.length;r++)u=this.shapes[r],this.redoRotates.push(u.rotate().angle)},undo:function(){for(var n,t=0;t<this.shapes.length;t++)n=this.shapes[t],n.rotate(this.undoRotates[t],this.center,!1),n.hasOwnProperty("layout")&&n.layout(n),n.updateModel();this.adorner&&(this.adorner._initialize(),this.adorner.refresh())},redo:function(){for(var n,t=0;t<this.shapes.length;t++)n=this.shapes[t],n.rotate(this.redoRotates[t],this.center,!1),n.hasOwnProperty("layout")&&n.layout(n),n.updateModel();this.adorner&&(this.adorner._initialize(),this.adorner.refresh())}}),lr=r.extend({init:function(n,t,i){this.diagram=n;this.indices=i;this.items=t;this.title="Rotate Unit"},undo:function(){this.diagram._toIndex(this.items,this.indices)},redo:function(){this.diagram.toFront(this.items,!1)}}),ar=r.extend({init:function(n,t,i){this.diagram=n;this.indices=i;this.items=t;this.title="Rotate Unit"},undo:function(){this.diagram._toIndex(this.items,this.indices)},redo:function(){this.diagram.toBack(this.items,!1)}}),vr=f.Observable.extend({init:function(n){f.Observable.fn.init.call(this,n);this.bind(this.events,n);this.stack=[];this.index=0;this.capacity=100},events:["undone","redone"],begin:function(){this.composite=new yt},cancel:function(){this.composite=t},commit:function(n){this.composite.units.length>0&&this._restart(this.composite,n);this.composite=t},addCompositeItem:function(n){this.composite?this.composite.add(n):this.add(n)},add:function(n,t){this._restart(n,t)},pop:function(){this.index>0&&(this.stack.pop(),this.index--)},count:function(){return this.stack.length},undo:function(){this.index>0&&(this.index--,this.stack[this.index].undo(),this.trigger("undone"))},redo:function(){this.stack.length>0&&this.index<this.stack.length&&(this.stack[this.index].redo(),this.index++,this.trigger("redone"))},_restart:function(n,t){this.stack.splice(this.index,this.stack.length-this.index);this.stack.push(n);t!==!1?this.redo():this.index++;this.stack.length>this.capacity&&(this.stack.splice(0,this.stack.length-this.capacity),this.index=this.capacity)},clear:function(){this.stack=[];this.index=0}}),bt=r.extend({init:function(n){this.toolService=n},start:function(){},move:function(){},end:function(){},tryActivate:function(){return!1},getCursor:function(){return s.arrow}});var kt=bt.extend({init:function(t){var i=this,s=f.support.mobileOS?gi:di,e;bt.fn.init.call(i,t);var r=i.toolService.diagram,o=r.canvas,u=r.scroller=i.scroller=n(r.scrollable).kendoMobileScroller({friction:s,velocityMultiplier:nr,mousewheelScrolling:!1,zoom:!1,scroll:st(i._move,i)}).data("kendoMobileScroller");o.translate&&(i.movableCanvas=new oi(o.element));e=function(n,t,i){n.makeVirtual();n.virtualSize(t||bi,i||ki)};e(u.dimensions.x);e(u.dimensions.y);u.disable()},tryActivate:function(n,t){var r=this.toolService,i=r.diagram.options.pannable,u=t.ctrlKey;return h(i.key)&&(u=i.key&&i.key!="none"?t[i.key+"Key"]&&!(t.ctrlKey&&h(r.hoveredItem)):yr(t)),i!==!1&&u&&!h(r.hoveredAdorner)&&!h(r._hoveredConnector)},start:function(){this.scroller.enable()},move:function(){},_move:function(n){var u=this,r=u.toolService.diagram,f=r.canvas,t=new i(n.scrollLeft,n.scrollTop);f.translate?(r._storePan(t.times(-1)),u.movableCanvas.moveTo(t),f.translate(t.x,t.y)):t=t.plus(r._pan.times(-1));r.trigger(tr,{pan:t})},end:function(){this.scroller.disable()},getCursor:function(){return s.move}}),dt=r.extend({init:function(n){this.toolService=n},tryActivate:function(){return!0},start:function(n,t){var i=this.toolService,r=i.diagram,u=i.hoveredItem,f=r.options.selectable;u&&(ut(f,t)&&rt(u,t),u.adorner&&(this.adorner=u.adorner,this.handle=this.adorner._hitTest(n)));this.handle||(this.handle=r._resizingAdorner._hitTest(n),this.handle&&(this.adorner=r._resizingAdorner));this.adorner&&(this.adorner.isDragHandle(this.handle)&&r.trigger(g,{shapes:this.adorner.shapes,connections:[]})?(i.startPoint=n,i.end(n)):this.adorner.start(n))},move:function(n){this.adorner&&(this.adorner.move(this.handle,n),this.adorner.isDragHandle(this.handle)&&this.toolService.diagram.trigger(nt,{shapes:this.adorner.shapes,connections:[]}))},end:function(n,i){var f=this.toolService.diagram,e=this.toolService,r=this.adorner,u;r&&(r.isDragHandle(this.handle)&&f.trigger(tt,{shapes:r.shapes,connections:[]})?r.cancel():(u=r.stop(),u&&f.undoRedoService.add(u,!1)));e.hoveredItem&&this.toolService.triggerClick({item:e.hoveredItem,point:n,meta:i});this.adorner=t;this.handle=t},getCursor:function(n){return this.toolService.hoveredItem?this.toolService.hoveredItem._getCursor(n):s.arrow}}),gt=r.extend({init:function(n){this.toolService=n},tryActivate:function(n,t){var i=this.toolService,r=ut(i.diagram.options.selectable,t);return r&&!h(i.hoveredItem)&&!h(i.hoveredAdorner)},start:function(n){var t=this.toolService.diagram;t.deselect();t.selector.start(n)},move:function(n){var t=this.toolService.diagram;t.selector.move(n)},end:function(n,t){var i=this.toolService.diagram,r=this.toolService.hoveredItem,u=i.selector.bounds();r&&r.isSelected||t.ctrlKey||i.deselect();u.isEmpty()||i.selectArea(u);i.selector.end()},getCursor:function(){return s.arrow}}),ni=r.extend({init:function(n){this.toolService=n;this.type="ConnectionTool"},tryActivate:function(){return this.toolService._hoveredConnector},start:function(n,t){var r=this.toolService.diagram,u=this.toolService._hoveredConnector,i=r._createConnection({},u._c,n);v(i)&&!r.trigger(g,{shapes:[],connections:[i]})&&r._addConnection(i)?(this.toolService._connectionManipulation(i,u._c.shape,!0),this.toolService._removeHover(),rt(this.toolService.activeConnection,t)):(i.source(null),this.toolService.end(n))},move:function(n){var t=this.toolService,i=t.activeConnection;return i.target(n),t.diagram.trigger(nt,{shapes:[],connections:[i]}),!0},end:function(n){var i=this.toolService,r=i.diagram,t=i.activeConnection,f=i.hoveredItem,e=i._hoveredConnector,o;t&&(o=e&&e._c!=t.sourceConnector?e._c:f&&f instanceof u.Shape?f.getConnector(ht)||f.getConnector(n):n,t.target(o),r.trigger(tt,{shapes:[],connections:[t]})?(r.remove(t,!1),r.undoRedoService.pop()):(t.updateModel(),r._syncConnectionChanges()),i._connectionManipulation())},getCursor:function(){return s.arrow}}),ti=r.extend({init:function(n){this.toolService=n;this.type="ConnectionTool"},tryActivate:function(n,t){var r=this.toolService,f=r.diagram,e=f.options.selectable,i=r.hoveredItem,u=ut(e,t)&&i&&i.path&&!(i.isSelected&&t.ctrlKey);return u&&(this._c=i),u},start:function(n,t){var i=this._c,r;rt(i,t);r=i.adorner;v(i)&&r&&!this.toolService.diagram.trigger(g,{shapes:[],connections:[i]})?(this.handle=r._hitTest(n),r.start(n)):(this.toolService.startPoint=n,this.toolService.end(n))},move:function(n){var t=this._c.adorner;if(v(this._c)&&t)return t.move(this.handle,n),this.toolService.diagram.trigger(nt,{shapes:[],connections:[this._c]}),!0},end:function(n,t){var i=this._c,f=i.adorner,e=this.toolService,r=e.diagram,u;f&&(e.triggerClick({item:i,point:n,meta:t}),v(i)&&(u=f.stop(n),r.trigger(tt,{shapes:[],connections:[i]})?u.undo():(r.undoRedoService.add(u,!1),i.updateModel(),r._syncConnectionChanges())))},getCursor:function(){return s.move}});var pr=r.extend({init:function(n){this.diagram=n;this.tools=[new kt(this),new ti(this),new ni(this),new gt(this),new dt(this)];this.activeTool=t},start:function(n,t){return t=e({},t),this.activeTool&&this.activeTool.end(n,t),this._updateHoveredItem(n),this._activateTool(n,t),this.activeTool.start(n,t),this._updateCursor(n),this.diagram.focus(),this.startPoint=n,!0},move:function(n,t){t=e({},t);var i=!0;return this.activeTool&&(i=this.activeTool.move(n,t)),i&&this._updateHoveredItem(n),this._updateCursor(n),!0},end:function(n,i){return i=e({},i),this.activeTool&&this.activeTool.end(n,i),this.activeTool=t,this._updateCursor(n),!0},keyDown:function(n,t){var i=this.diagram,r;if(t=e({ctrlKey:!1,metaKey:!1,altKey:!1},t),(t.ctrlKey||t.metaKey)&&!t.altKey){if(c(n,"a"))return i.selectAll(),i._destroyToolBar(),!0;if(c(n,"z"))return i.undo(),i._destroyToolBar(),!0;if(c(n,"y"))return i.redo(),i._destroyToolBar(),!0;c(n,"c")?(i.copy(),i._destroyToolBar()):c(n,"x")?(i.cut(),i._destroyToolBar()):c(n,"v")?(i.paste(),i._destroyToolBar()):c(n,"l")?(i.layout(),i._destroyToolBar()):c(n,"d")&&(i._destroyToolBar(),i.copy(),i.paste())}else{if(n===46||n===8)return r=this.diagram._triggerRemove(i.select()),r.length&&(this.diagram.remove(r,!0),this.diagram._syncChanges(),this.diagram._destroyToolBar()),!0;if(n===27)return this._discardNewConnection(),i.deselect(),i._destroyToolBar(),!0}},wheel:function(n,t){var r=this.diagram,s=t.delta,i=r.zoom(),e=r.options,o=e.zoomRate,u={point:n,meta:t,zoom:i};if(!r.trigger(pi,u))return s<0?i+=o:i-=o,i=f.dataviz.round(Math.max(e.zoomMin,Math.min(e.zoomMax,i)),2),u.zoom=i,r.zoom(i,u),r.trigger(wi,u),!0},setTool:function(n,t){n.toolService=this;this.tools[t]=n},triggerClick:function(n){this.startPoint.equals(n.point)&&this.diagram.trigger("click",n)},_discardNewConnection:function(){this.newConnection&&(this.diagram.remove(this.newConnection),this.newConnection=t)},_activateTool:function(n,t){for(var r,i=0;i<this.tools.length;i++)if(r=this.tools[i],r.tryActivate(n,t)){this.activeTool=r;break}},_updateCursor:function(n){var t=this.diagram.element,i=this.activeTool?this.activeTool.getCursor(n):this.hoveredAdorner?this.hoveredAdorner._getCursor(n):this.hoveredItem?this.hoveredItem._getCursor(n):s.arrow;t.css({cursor:i});et.msie&&et.version==7&&(t[0].style.cssText=t[0].style.cssText)},_connectionManipulation:function(n,i,r){this.activeConnection=n;this.disabledShape=i;this.newConnection=r?this.activeConnection:t},_updateHoveredItem:function(n){var i=this._hitTest(n),r=this.diagram;i==this.hoveredItem||this.disabledShape&&i==this.disabledShape||(this.hoveredItem&&(r.trigger(yi,{item:this.hoveredItem}),this.hoveredItem._hover(!1)),i&&i.options.enable?(r.trigger(vi,{item:i}),this.hoveredItem=i,this.hoveredItem._hover(!0)):this.hoveredItem=t)},_removeHover:function(){this.hoveredItem&&(this.hoveredItem._hover(!1),this.hoveredItem=t)},_hitTest:function(n){var i,r=this.diagram,e,f,o;if(this._hoveredConnector&&(this._hoveredConnector._hover(!1),this._hoveredConnector=t),r._connectorsAdorner._visible&&(i=r._connectorsAdorner._hitTest(n),i))return i;if(i=this.diagram._resizingAdorner._hitTest(n),i){if(this.hoveredAdorner=r._resizingAdorner,i.x!==0||i.y!==0)return;i=t}else this.hoveredAdorner=t;if(!this.activeTool||this.activeTool.type!=="ConnectionTool"){for(o=[],f=0;f<r._selectedItems.length;f++)e=r._selectedItems[f],e instanceof u.Connection&&o.push(e);i=this._hitTestItems(o,n)}return i||this._hitTestElements(n)},_hitTestElements:function(n){var r=this.diagram,t=this._hitTestItems(r.shapes,n),i=this._hitTestItems(r.connections,n),u;if((!this.activeTool||this.activeTool.type!="ConnectionTool")&&t&&i&&!iu(t,n)){var f=r.mainLayer,e=ot(t.visual,f.children),o=ot(i.visual,f.children);u=e>o?t:i}return u||t||i},_hitTestItems:function(n,t){for(var u,r,i=n.length-1;i>=0;i--)if(u=n[i],r=u._hitTest(t),r)return r}}),ft=f.Class.extend({init:function(){}}),p=ft.extend({init:function(n){var t=this;ft.fn.init.call(t);this.connection=n},hitTest:function(n){var t=this.getBounds().inflate(y);return t.contains(n)?u.Geometry.distanceToPolyline(n,this.connection.allPoints())<y:!1},getBounds:function(){for(var n=this.connection.allPoints(),i=n[0],r=n[n.length-1],e=Math.max(i.x,r.x),u=Math.min(i.x,r.x),f=Math.min(i.y,r.y),s=Math.max(i.y,r.y),t=1;t<n.length-1;++t)e=Math.max(e,n[t].x),u=Math.min(u,n[t].x),f=Math.min(f,n[t].y),s=Math.max(s,n[t].y);return new o(u,f,e-u,s-f)}}),wr=p.extend({init:function(n){var t=this;p.fn.init.call(t);this.connection=n},route:function(){}}),br=p.extend({SAME_SIDE_DISTANCE_RATIO:5,init:function(n){var t=this;p.fn.init.call(t);this.connection=n},routePoints:function(n,t,i,r){return i&&r?this._connectorPoints(n,t,i,r):this._floatingPoints(n,t,i)},route:function(){var n=this.connection._resolvedSourceConnector,t=this.connection._resolvedTargetConnector,i=this.connection.sourcePoint(),r=this.connection.targetPoint(),u=this.routePoints(i,r,n,t);this.connection.points(u)},_connectorSides:[{name:"Top",axis:"y",boundsPoint:"topLeft",secondarySign:1},{name:"Left",axis:"x",boundsPoint:"topLeft",secondarySign:1},{name:"Bottom",axis:"y",boundsPoint:"bottomRight",secondarySign:-1},{name:"Right",axis:"x",boundsPoint:"bottomRight",secondarySign:-1}],_connectorSide:function(n,t){for(var o=n.position(),c=n.shape.bounds(vt),a={topLeft:c.topLeft(),bottomRight:c.bottomRight()},l=this._connectorSides,s=f.util.MAX_NUM,e,i,u,r,h=0;h<l.length;h++)r=l[h],u=r.axis,e=Math.round(Math.abs(o[u]-a[r.boundsPoint][u])),e<s?(s=e,i=r):e===s&&(o[u]-t[u])*r.secondarySign>(o[i.axis]-t[i.axis])*i.secondarySign&&(i=r);return i.name},_sameSideDistance:function(n){var t=n.shape.bounds(vt);return Math.min(t.width,t.height)/this.SAME_SIDE_DISTANCE_RATIO},_connectorPoints:function(n,t,r,u){var e=this._connectorSide(r,t),o=this._connectorSide(u,n),a=t.x-n.x,h=t.y-n.y,s=this._sameSideDistance(r),f=[],c,l;return e===k||e==lt?o==k||o==lt?e==o?(l=e==k?Math.min(n.y,t.y)-s:Math.max(n.y,t.y)+s,f=[new i(n.x,l),new i(t.x,l)]):f=[new i(n.x,n.y+h/2),new i(t.x,n.y+h/2)]:f=[new i(n.x,t.y)]:o==d||o==ct?e==o?(c=e==d?Math.min(n.x,t.x)-s:Math.max(n.x,t.x)+s,f=[new i(c,n.y),new i(c,t.y)]):f=[new i(n.x+a/2,n.y),new i(n.x+a/2,n.y+h)]:f=[new i(t.x,n.y)],f},_floatingPoints:function(n,t,r){for(var a=r?this._connectorSide(r,t):null,h=this._startHorizontal(n,t,a),u=[n,n,t,t],c=t.x-n.x,l=t.y-n.y,f=u.length,o,s,e=1;e<f-1;++e)h?e%2!=0?(o=c/(f/2),s=0):(o=0,s=l/((f-1)/2)):e%2!=0?(o=0,s=l/(f/2)):(o=c/((f-1)/2),s=0),u[e]=new i(u[e-1].x+o,u[e-1].y+s);return e--,u[f-2]=h&&e%2!=0||!h&&e%2==0?new i(u[f-1].x,u[f-2].y):new i(u[f-2].x,u[f-1].y),[u[1],u[2]]},_startHorizontal:function(n,t,i){return i!==null&&(i===ct||i===d)?!0:Math.abs(n.x-t.x)>Math.abs(n.y-t.y)}}),a=r.extend({init:function(n,t){var i=this;i.diagram=n;i.options=e({},i.options,t);i.visual=new ui;i.diagram._adorners.push(i)},refresh:function(){}}),kr=a.extend({init:function(n,t){var i=this,r,u,f;i.connection=n;r=i.connection.diagram;i._ts=r.toolService;a.fn.init.call(i,r,t);u=i.connection.sourcePoint();f=i.connection.targetPoint();i.spVisual=new b(e(i.options.handles,{center:u}));i.epVisual=new b(e(i.options.handles,{center:f}));i.visual.append(i.spVisual);i.visual.append(i.epVisual)},options:{handles:{}},_getCursor:function(){return s.move},start:function(n){this.handle=this._hitTest(n);this.startPoint=n;this._initialSource=this.connection.source();this._initialTarget=this.connection.target();switch(this.handle){case-1:this.connection.targetConnector&&this._ts._connectionManipulation(this.connection,this.connection.targetConnector.shape);break;case 1:this.connection.sourceConnector&&this._ts._connectionManipulation(this.connection,this.connection.sourceConnector.shape)}},move:function(n,t){switch(n){case-1:this.connection.source(t);break;case 1:this.connection.target(t);break;default:var i=t.minus(this.startPoint);this.startPoint=t;this.connection.sourceConnector||this.connection.source(this.connection.sourcePoint().plus(i));this.connection.targetConnector||this.connection.target(this.connection.targetPoint().plus(i))}return this.refresh(),!0},stop:function(n){var r=this.diagram.toolService,i=r.hoveredItem,f;return f=r._hoveredConnector?r._hoveredConnector._c:i&&i instanceof u.Shape?i.getConnector(ht)||i.getConnector(n):n,this.handle===-1?this.connection.source(f):this.handle===1&&this.connection.target(f),this.handle=t,this._ts._connectionManipulation(),new fr(this.connection,this._initialSource,this._initialTarget)},_hitTest:function(n){var t=this.connection.sourcePoint(),i=this.connection.targetPoint(),r=this.options.handles.width/2,u=this.options.handles.height/2,f=new o(t.x,t.y).inflate(r,u),e=new o(i.x,i.y).inflate(r,u);return f.contains(n)?-1:e.contains(n)?1:0},refresh:function(){this.spVisual.redraw({center:this.diagram.modelToLayer(this.connection.sourcePoint())});this.epVisual.redraw({center:this.diagram.modelToLayer(this.connection.targetPoint())})}}),dr=a.extend({init:function(n,t){var i=this;a.fn.init.call(i,n,t);i._refreshHandler=function(n){n.item==i.shape&&i.refresh()}},show:function(n){var t=this,u,i,r;for(t._visible=!0,t.shape=n,t.diagram.bind(it,t._refreshHandler),u=n.connectors.length,t.connectors=[],t.visual.clear(),i=0;i<u;i++)r=new ii(n.connectors[i]),t.connectors.push(r),t.visual.append(r.visual);t.visual.visible(!0);t.refresh()},destroy:function(){var n=this;n.diagram.unbind(it,n._refreshHandler);n.shape=t;n._visible=t;n.visual.visible(!1)},_hitTest:function(n){for(var t,i=0;i<this.connectors.length;i++)if(t=this.connectors[i],t._hitTest(n)){t._hover(!0);this.diagram.toolService._hoveredConnector=t;break}},refresh:function(){if(this.shape){var t=this.shape.bounds();t=this.diagram.modelToLayer(t);this.visual.position(t.topLeft());n.each(this.connectors,function(){this.refresh()})}}});var nu=a.extend({init:function(n,t){var i=this;a.fn.init.call(i,n,t);i._manipulating=!1;i.map=[];i.shapes=[];i._initSelection();i._createHandles();i.redraw();i.diagram.bind("select",function(n){i._initialize(n.selected)});i._refreshHandler=function(){i._internalChange||(i.refreshBounds(),i.refresh())};i._rotatedHandler=function(){i.shapes.length==1&&(i._angle=i.shapes[0].rotate().angle);i._refreshHandler()};i.diagram.bind(it,i._refreshHandler).bind(ci,i._rotatedHandler);i.refreshBounds();i.refresh()},options:{handles:{fill:{color:"#fff"},stroke:{color:"#282828"},height:7,width:7,hover:{fill:{color:"#282828"},stroke:{color:"#282828"}}},selectable:{stroke:{color:"#778899",width:1,dashType:"dash"},fill:{color:at}},offset:10},_initSelection:function(){var n=this,t=n.diagram,i=t.options.selectable,r=e({},n.options.selectable,i);n.rect=new w(r);n.visual.append(n.rect)},_resizable:function(){return this.options.editable&&this.options.editable.resize!==!1},_handleOptions:function(){return(this.options.editable.resize||{}).handles||this.options.handles},_createHandles:function(){var r,i,n,t;if(this._resizable())for(r=this._handleOptions(),t=-1;t<=1;t++)for(n=-1;n<=1;n++)(t!==0||n!==0)&&(i=new w(r),i.drawingElement._hover=st(this._hover,this),this.map.push({x:t,y:n,visual:i}),this.visual.append(i))},bounds:function(n){if(n)this._innerBounds=n.clone(),this._bounds=this.diagram.modelToLayer(n).inflate(this.options.offset,this.options.offset);else return this._bounds},_hitTest:function(n){var t=this.diagram.modelToLayer(n),r,u,f,o=this.map.length,e;if(this._angle&&(t=t.clone().rotate(this._bounds.center(),this._angle)),this._resizable())for(r=0;r<o;r++)if(e=this.map[r],u=new i(e.x,e.y),f=this._getHandleBounds(u),f.offset(this._bounds.x,this._bounds.y),f.contains(t))return u;if(this._bounds.contains(t))return new i(0,0)},_getHandleBounds:function(n){if(this._resizable()){var u=this._handleOptions(),i=u.width,r=u.height,t=new o(0,0,i,r);return n.x<0?t.x=-i/2:n.x===0?t.x=Math.floor(this._bounds.width/2)-i/2:n.x>0&&(t.x=this._bounds.width+1-i/2),n.y<0?t.y=-r/2:n.y===0?t.y=Math.floor(this._bounds.height/2)-r/2:n.y>0&&(t.y=this._bounds.height+1-r/2),t}},_getCursor:function(n){var t=this._hitTest(n),r;if(t&&t.x>=-1&&t.x<=1&&t.y>=-1&&t.y<=1&&this._resizable()){if(r=this._angle,r&&(r=360-r,t.rotate(new i(0,0),r),t=new i(Math.round(t.x),Math.round(t.y))),t.x==-1&&t.y==-1)return"nw-resize";if(t.x==1&&t.y==1)return"se-resize";if(t.x==-1&&t.y==1)return"sw-resize";if(t.x==1&&t.y==-1)return"ne-resize";if(t.x===0&&t.y==-1)return"n-resize";if(t.x===0&&t.y==1)return"s-resize";if(t.x==1&&t.y===0)return"e-resize";if(t.x==-1&&t.y===0)return"w-resize"}return this._manipulating?s.move:s.select},_initialize:function(){var n=this,t,r,f=n.diagram.select();for(n.shapes=[],t=0;t<f.length;t++)r=f[t],r instanceof u.Shape&&(n.shapes.push(r),r._rotationOffset=new i);n._angle=n.shapes.length==1?n.shapes[0].rotate().angle:0;n._startAngle=n._angle;n._rotates();n._positions();n.refreshBounds();n.refresh();n.redraw()},_rotates:function(){var n=this,t,i;for(n.initialRotates=[],t=0;t<n.shapes.length;t++)i=n.shapes[t],n.initialRotates.push(i.rotate().angle)},_positions:function(){var n=this,t,i;for(n.initialStates=[],t=0;t<n.shapes.length;t++)i=n.shapes[t],n.initialStates.push(i.bounds())},_hover:function(n,t){if(this._resizable()){var u=this._handleOptions(),r=u.hover,i=u.stroke,f=u.fill;n&&l.isDefined(r.stroke)&&(i=e({},i,r.stroke));n&&l.isDefined(r.fill)&&(f=r.fill);t.stroke(i.color,i.width,i.opacity);t.fill(f.color,f.opacity)}},start:function(n){var t,i;for(this._sp=n,this._cp=n,this._lp=n,this._manipulating=!0,this._internalChange=!0,this.shapeStates=[],t=0;t<this.shapes.length;t++)i=this.shapes[t],this.shapeStates.push(i.bounds())},redraw:function(){for(var t,i=this._resizable(),n=0;n<this.map.length;n++)t=this.map[n],t.visual.visible(i)},angle:function(n){return h(n)&&(this._angle=n),this._angle},rotate:function(){var r=this._innerBounds.center(),t=this.angle(),n,i;for(this._internalChange=!0,n=0;n<this.shapes.length;n++)i=this.shapes[n],t=(t+this.initialRotates[n]-this._startAngle)%360,i.rotate(t,r);this.refresh()},move:function(n,t){var f,h,c=new i,a=new i,y,b,r,e,d,u,k=0,g,nt,tt,s,p,w;if(n.y===-2&&n.x===-1){for(b=this._innerBounds.center(),this._angle=this._truncateAngle(l.findAngle(b,t)),e=0;e<this.shapes.length;e++)r=this.shapes[e],d=(this._angle+this.initialRotates[e]-this._startAngle)%360,r.rotate(d,b),r.hasOwnProperty("layout")&&r.layout(r),this._rotating=!0;this.refresh()}else{if(this.shouldSnap()){if(s=this._truncateDistance(t.minus(this._lp)),s.x===0&&s.y===0){this._cp=t;return}f=s;this._lp=new i(this._lp.x+s.x,this._lp.y+s.y)}else f=t.minus(this._cp);for(this.isDragHandle(n)?(a=c=f,h=!0):(this._angle&&f.rotate(new i(0,0),this._angle),n.x==-1?c.x=f.x:n.x==1&&(a.x=f.x),n.y==-1?c.y=f.y:n.y==1&&(a.y=f.y)),h||(g=gr(n,this._innerBounds),nt=(this._innerBounds.width+f.x*n.x)/this._innerBounds.width,tt=(this._innerBounds.height+f.y*n.y)/this._innerBounds.height),e=0;e<this.shapes.length;e++){if(r=this.shapes[e],y=r.bounds(),h){if(!v(r))continue;u=this._displaceBounds(y,c,a,h)}else u=y.clone(),u.scale(nt,tt,g,this._innerBounds.center(),r.rotate().angle),p=u.center(),p.rotate(y.center(),-this._angle),u=new o(p.x-u.width/2,p.y-u.height/2,u.width,u.height);u.width>=r.options.minWidth&&u.height>=r.options.minHeight&&(w=y,r.bounds(u),r.hasOwnProperty("layout")&&r.layout(r,w,u),(w.width!==u.width||w.height!==u.height)&&r.rotate(r.rotate().angle),k+=1)}k&&(k==e?(u=this._displaceBounds(this._innerBounds,c,a,h),this.bounds(u)):this.refreshBounds(),this.refresh());this._positions()}this._cp=t},isDragHandle:function(n){return n.x===0&&n.y===0},cancel:function(){for(var i=this.shapes,r=this.shapeStates,n=0;n<i.length;n++)i[n].bounds(r[n]);this.refreshBounds();this.refresh();this._manipulating=t;this._internalChange=t;this._rotating=t},_truncatePositionToGuides:function(n){return this.diagram.ruler?this.diagram.ruler.truncatePositionToGuides(n):n},_truncateSizeToGuides:function(n){return this.diagram.ruler?this.diagram.ruler.truncateSizeToGuides(n):n},_truncateAngle:function(n){var t=this.snapOptions(),i=Math.max(t.angle||hi,ai);return t?Math.floor(n%360/i)*i:n%360},_truncateDistance:function(n){if(n instanceof u.Point)return new u.Point(this._truncateDistance(n.x),this._truncateDistance(n.y));var t=this.snapOptions()||{},i=Math.max(t.size||si,li);return t?Math.floor(n/i)*i:n},snapOptions:function(){var n=this.diagram.options.editable;return((n||{}).drag||{}).snap||{}},shouldSnap:function(){var n=this.diagram.options.editable,t=(n||{}).drag,i=(t||{}).snap;return n!==!1&&t!==!1&&i!==!1},_displaceBounds:function(n,t,i,r){var e=n.topLeft().plus(t),s=n.bottomRight().plus(i),u=o.fromPoints(e,s),f;return r||(f=u.center(),f.rotate(n.center(),-this._angle),u=new o(f.x-u.width/2,f.y-u.height/2,u.width,u.height)),u},stop:function(){var u,n,i,r;if(this._cp!=this._sp)if(this._rotating)u=new wt(this,this.shapes,this.initialRotates),this._rotating=!1;else if(this._diffStates()){if(this.diagram.ruler)for(n=0;n<this.shapes.length;n++)i=this.shapes[n],r=i.bounds(),r=this._truncateSizeToGuides(this._truncatePositionToGuides(r)),i.bounds(r),this.refreshBounds(),this.refresh();for(n=0;n<this.shapes.length;n++)i=this.shapes[n],i.updateModel();u=new pt(this.shapes,this.shapeStates,this);this.diagram._syncShapeChanges()}return this._manipulating=t,this._internalChange=t,this._rotating=t,u},_diffStates:function(){for(var t=this.shapes,i=this.shapeStates,n=0;n<t.length;n++)if(!t[n].bounds().equals(i[n]))return!0;return!1},refreshBounds:function(){var n=this.shapes.length==1?this.shapes[0].bounds().clone():this.diagram.boundingBox(this.shapes,!0);this.bounds(n)},refresh:function(){var e=this,u,t,f,r;this.shapes.length>0?(t=this.bounds(),this.visual.visible(!0),this.visual.position(t.topLeft()),n.each(this.map,function(){u=e._getHandleBounds(new i(this.x,this.y));this.visual.position(u.topLeft())}),this.visual.position(t.topLeft()),f=new i(t.width/2,t.height/2),this.visual.rotate(this._angle,f),this.rect.redraw({width:t.width,height:t.height}),this.rotationThumb&&(r=this.options.editable.rotate.thumb,this._rotationThumbBounds=new o(t.center().x,t.y+r.y,0,0).inflate(r.width),this.rotationThumb.redraw({x:t.width/2-r.width/2}))):this.visual.visible(!1)}}),tu=r.extend({init:function(n){var t=n.options.selectable;this.options=e({},this.options,t);this.visual=new w(this.options);this.diagram=n},options:{stroke:{color:"#778899",width:1,dashType:"dash"},fill:{color:at}},start:function(n){this._sp=this._ep=n;this.refresh();this.diagram._adorn(this,!0)},end:function(){this._sp=this._ep=t;this.diagram._adorn(this,!1)},bounds:function(n){return n&&(this._bounds=n),this._bounds},move:function(n){this._ep=n;this.refresh()},refresh:function(){if(this._sp){var n=o.fromPoints(this.diagram.modelToLayer(this._sp),this.diagram.modelToLayer(this._ep));this.bounds(o.fromPoints(this._sp,this._ep));this.visual.position(n.topLeft());this.visual.redraw({height:n.height+1,width:n.width+1})}}}),ii=r.extend({init:function(n){this.options=e({},n.options);this._c=n;this.visual=new b(this.options);this.refresh()},_hover:function(n){var i=this.options,t=i.hover,r=i.stroke,u=i.fill;n&&l.isDefined(t.stroke)&&(r=e({},r,t.stroke));n&&l.isDefined(t.fill)&&(u=t.fill);this.visual.redraw({stroke:r,fill:u})},refresh:function(){var n=this._c.shape.diagram.modelToView(this._c.position()),t=n.minus(this._c.shape.bounds("transformed").topLeft()),r=new o(n.x,n.y,0,0);r.inflate(this.options.width/2,this.options.height/2);this._visualBounds=r;this.visual.redraw({center:new i(t.x,t.y)})},_hitTest:function(n){var t=this._c.shape.diagram.modelToView(n);return this._visualBounds.contains(t)}});e(u,{CompositeUnit:yt,TransformUnit:pt,PanUndoUnit:cr,AddShapeUnit:hr,AddConnectionUnit:sr,DeleteShapeUnit:or,DeleteConnectionUnit:er,ConnectionEditAdorner:kr,ConnectionTool:ni,ConnectorVisual:ii,UndoRedoService:vr,ResizingAdorner:nu,Selector:tu,ToolService:pr,ConnectorsAdorner:dr,LayoutUndoUnit:rr,ConnectionEditUnit:ur,ToFrontUnit:lr,ToBackUnit:ar,ConnectionRouterBase:ft,PolylineRouter:wr,CascadingRouter:br,SelectionTool:gt,ScrollerTool:kt,PointerTool:dt,ConnectionEditTool:ti,RotateUnit:wt})})(window.kendo.jQuery)}(),function(){(function(n){var e=window.kendo,u=e.dataviz.diagram,p=u.Graph,v=u.Node,y=u.Link,k=e.deepExtend,o=u.Size,f=u.Rect,i=u.Dictionary,w=u.Set,d=u.Graph,t=u.Utils,r=u.Point,l=1e-6,b=Math.PI/180,h=t.contains,c=n.grep,s=e.Class.extend({defaultOptions:{type:"Tree",subtype:"Down",roots:null,animate:!1,limitToView:!1,friction:.9,nodeDistance:50,iterations:300,horizontalSeparation:90,verticalSeparation:50,underneathVerticalTopOffset:15,underneathHorizontalOffset:15,underneathVerticalSeparation:15,grid:{width:1500,offsetX:50,offsetY:50,componentSpacingX:20,componentSpacingY:20},layerSeparation:50,layeredIterations:2,startRadialAngle:0,endRadialAngle:360,radialSeparation:150,radialFirstLevelSeparation:200,keepComponentsInOneRadialLayout:!1,ignoreContainers:!0,layoutContainerChildren:!1,ignoreInvisible:!0,animateTransitions:!1},init:function(){},gridLayoutComponents:function(n){var u,h,f,e;if(!n)throw"No components supplied.";t.forEach(n,function(n){n.calcBounds()});n.sort(function(n,t){return t.bounds.width-n.bounds.width});for(var y=this.options.grid.width,p=this.options.grid.componentSpacingX,w=this.options.grid.componentSpacingY,o=0,c=this.options.grid.offsetX,b=this.options.grid.offsetY,s=c,l=b,i,a=[],v=[];n.length>0;){for(s>=y&&(s=c,l+=o+w,o=0),u=n.pop(),this.moveToOffset(u,new r(s,l)),i=0;i<u.nodes.length;i++)v.push(u.nodes[i]);for(i=0;i<u.links.length;i++)a.push(u.links[i]);h=u.bounds;f=h.height;(f<=0||isNaN(f))&&(f=0);e=h.width;(e<=0||isNaN(e))&&(e=0);f>=o&&(o=f);s+=e+p}return{nodes:v,links:a}},moveToOffset:function(n,t){for(var e,h=n.bounds,c=t.x-h.x,l=t.y-h.y,a,i,o,v,y,s,u=0;u<n.nodes.length;u++)a=n.nodes[u],i=a.bounds(),i.width===0&&i.height===0&&i.x===0&&i.y===0&&(i=new f(0,0,0,0)),i.x+=c,i.y+=l,a.bounds(i);for(u=0;u<n.links.length;u++)if(o=n.links[u],o.points){for(v=[],y=o.points,e=0;e<y.length;e++)s=y[e],s.x+=c,s.y+=l,v.push(s);o.points=v}return this.currentHorizontalOffset+=h.width+this.options.grid.offsetX,new r(c,l)},transferOptions:function(n){(this.options=e.deepExtend({},this.defaultOptions),t.isUndefined(n))||(this.options=e.deepExtend(this.options,n||{}))}}),a=e.Class.extend({init:function(n){this.nodeMap=new i;this.shapeMap=new i;this.nodes=[];this.edges=[];this.edgeMap=new i;this.finalNodes=[];this.finalLinks=[];this.ignoredConnections=[];this.ignoredShapes=[];this.hyperMap=new i;this.hyperTree=new p;this.finalGraph=null;this.diagram=n},convert:function(n){if(t.isUndefined(this.diagram))throw"No diagram to convert.";return this.options=e.deepExtend({ignoreInvisible:!0,ignoreContainers:!0,layoutContainerChildren:!1},n||{}),this.clear(),this._renormalizeShapes(),this._renormalizeConnections(),this.finalNodes=new i(this.nodes),this.finalLinks=new i(this.edges),this.finalGraph=new p,this.finalNodes.forEach(function(n){this.finalGraph.addNode(n)},this),this.finalLinks.forEach(function(n){this.finalGraph.addExistingLink(n)},this),this.finalGraph},mapConnection:function(n){return this.edgeMap.get(n.id)},mapShape:function(n){return this.nodeMap.get(n.id)},getEdge:function(n,i){return t.first(n.links,function(t){return t.getComplement(n)===i})},clear:function(){this.finalGraph=null;this.hyperTree=!this.options.ignoreContainers&&this.options.layoutContainerChildren?new d:null;this.hyperMap=!this.options.ignoreContainers&&this.options.layoutContainerChildren?new i:null;this.nodeMap=new i;this.shapeMap=new i;this.nodes=[];this.edges=[];this.edgeMap=new i;this.ignoredConnections=[];this.ignoredShapes=[];this.finalNodes=[];this.finalLinks=[]},listToRoot:function(n){var i=[],t=n.container;if(!t)return i;for(i.push(t);t.parentContainer;)t=t.parentContainer,i.push(t);return i.reverse(),i},firstNonIgnorableContainer:function(n){return n.isContainer&&!this._isIgnorableItem(n)?n:n.parentContainer?this.firstNonIgnorableContainer(n.parentContainer):null},isContainerConnection:function(n,t){return n.isContainer&&this.isDescendantOf(n,t)?!0:t.isContainer&&this.isDescendantOf(t,n)},isDescendantOf:function(n,t){var u,i,f,r;if(!n.isContainer)throw"Expecting a container.";if(n===t)return!1;if(h(n.children,t))return!0;for(u=[],i=0,f=n.children.length;i<f;i++)r=n.children[i],r.isContainer&&this.isDescendantOf(r,t)&&u.push(r);return u.length>0},isIgnorableItem:function(n){return this.options.ignoreInvisible?n.isCollapsed&&this._isVisible(n)?!1:!n.isCollapsed&&this._isVisible(n)?!1:!0:n.isCollapsed&&!this._isTop(n)},isShapeMapped:function(n){return n.isCollapsed&&!this._isVisible(n)&&!this._isTop(n)},leastCommonAncestor:function(n,i){if(!n)throw"Parameter should not be null.";if(!i)throw"Parameter should not be null.";if(!this.hyperTree)throw"No hypertree available.";var u=this.listToRoot(n),f=this.listToRoot(i),e=null;if(t.isEmpty(u)||t.isEmpty(f))return this.hyperTree.root.data;for(var o=u[0],s=f[0],r=0;o===s;){if(e=u[r],r++,r>=u.length||r>=f.length)break;o=u[r];s=f[r]}return e?c(this.hyperTree.nodes,function(n){return n.data.container===e}):this.hyperTree.root.data},_isTop:function(n){return!n.parentContainer},_isVisible:function(n){return n.visible()?n.parentContainer?this._isVisible(n.parentContainer):n.visible():!1},_isCollapsed:function(n){return n.isContainer&&n.isCollapsed?!0:n.parentContainer&&this._isCollapsed(n.parentContainer)},_renormalizeShapes:function(){var t,r,n,i;if(this.options.ignoreContainers)for(t=0,r=this.diagram.shapes.length;t<r;t++){if(n=this.diagram.shapes[t],this.options.ignoreInvisible&&!this._isVisible(n)||n.isContainer){this.ignoredShapes.push(n);continue}i=new v(n.id,n);i.isVirtual=!1;this.nodeMap.add(n.id,i);this.nodes.push(i)}else throw"Containers are not supported yet, but stay tuned.";},_renormalizeConnections:function(){var f,o,n,t,i,r,u,e;if(this.diagram.connections.length!==0)for(f=0,o=this.diagram.connections.length;f<o;f++){if(n=this.diagram.connections[f],this.isIgnorableItem(n)){this.ignoredConnections.push(n);continue}if(t=n.sourceConnector?n.sourceConnector.shape:null,i=n.targetConnector?n.targetConnector.shape:null,!t||!i){this.ignoredConnections.push(n);continue}if(h(this.ignoredShapes,t)&&!this.shapeMap.containsKey(t)){this.ignoredConnections.push(n);continue}if(h(this.ignoredShapes,i)&&!this.shapeMap.containsKey(i)){this.ignoredConnections.push(n);continue}if(this.shapeMap.containsKey(t)&&(t=this.shapeMap[t]),this.shapeMap.containsKey(i)&&(i=this.shapeMap[i]),r=this.mapShape(t),u=this.mapShape(i),r===u||this.areConnectedAlready(r,u)){this.ignoredConnections.push(n);continue}if(r===null||u===null)throw"A shape was not mapped to a node.";if(this.options.ignoreContainers){if(r.isVirtual||u.isVirtual){this.ignoredConnections.push(n);continue}e=new y(r,u,n.id,n);this.edgeMap.add(n.id,e);this.edges.push(e)}else throw"Containers are not supported yet, but stay tuned.";}},areConnectedAlready:function(n,i){return t.any(this.edges,function(t){return t.source===n&&t.target===i||t.source===i&&t.target===n})}}),g=s.extend({init:function(n){var i=this;if(s.fn.init.call(i),t.isUndefined(n))throw"Diagram is not specified.";this.diagram=n},layout:function(n){var e,f,i,r,o,s;if((this.transferOptions(n),e=new a(this.diagram),f=e.convert(n),!f.isEmpty())&&(i=f.getConnectedComponents(),!t.isEmpty(i))){for(r=0;r<i.length;r++)o=i[r],this.layoutGraph(o,n);return s=this.gridLayoutComponents(i),new u.LayoutState(this.diagram,s)}},layoutGraph:function(n,i){var u,f,r;for(t.isDefined(i)&&this.transferOptions(i),this.graph=n,u=this.options.nodeDistance*9,this.temperature=u,f=this._expectedBounds(),this.width=f.width,this.height=f.height,r=0;r<this.options.iterations;r++)this.refineStage=r>=this.options.iterations*5/6,this.tick(),this.temperature=this.refineStage?u/30:u*(1-r/(2*this.options.iterations))},tick:function(){for(var n,i,t=0;t<this.graph.nodes.length;t++)this._repulsion(this.graph.nodes[t]);for(t=0;t<this.graph.links.length;t++)this._attraction(this.graph.links[t]);for(t=0;t<this.graph.nodes.length;t++){if(n=this.graph.nodes[t],i=Math.sqrt(n.dx*n.dx+n.dy*n.dy),i===0)return;n.x+=Math.min(i,this.temperature)*n.dx/i;n.y+=Math.min(i,this.temperature)*n.dy/i;this.options.limitToView&&(n.x=Math.min(this.width,Math.max(n.width/2,n.x)),n.y=Math.min(this.height,Math.max(n.height/2,n.y)))}},_shake:function(n){var t=Math.random()*this.options.nodeDistance/4,i=Math.random()*2*Math.PI;n.x+=t*Math.cos(i);n.y-=t*Math.sin(i)},_InverseSquareForce:function(n,t,i){var r;if(this.refineStage){var u=t.x-i.x,f=t.y-i.y,e=t.width/2,o=t.height/2,s=i.width/2,h=i.height/2;r=Math.pow(u,2)/Math.pow(e+s+this.options.nodeDistance,2)+Math.pow(f,2)/Math.pow(o+h+this.options.nodeDistance,2)}else r=Math.pow(n,2)/Math.pow(this.options.nodeDistance,2);return r*4/3},_SquareForce:function(n,t,i){return 1/this._InverseSquareForce(n,t,i)},_repulsion:function(n){n.dx=0;n.dy=0;t.forEach(this.graph.nodes,function(t){if(t!==n){while(n.x===t.x&&n.y===t.y)this._shake(t);var i=n.x-t.x,r=n.y-t.y,u=Math.sqrt(i*i+r*r),f=this._SquareForce(u,n,t)*2;n.dx+=i/u*f;n.dy+=r/u*f}},this)},_attraction:function(n){var t=n.target,i=n.source;if(i!==t){while(i.x===t.x&&i.y===t.y)this._shake(t);var r=i.x-t.x,u=i.y-t.y,f=Math.sqrt(r*r+u*u),e=this._InverseSquareForce(f,i,t)*5,o=r/f*e,s=u/f*e;t.dx+=o;t.dy+=s;i.dx-=o;i.dy-=s}},_expectedBounds:function(){var n,i=this.graph.nodes.length,r=1.5,u=4;if(i===0)return n;n=t.fold(this.graph.nodes,function(n,t){var i=t.width*t.height;return i>0?n+Math.sqrt(i):0},0,this);var e=n/i,f=e*Math.ceil(Math.sqrt(i)),o=f*Math.sqrt(r),s=f/Math.sqrt(r);return{width:o*u,height:s*u}}}),nt=e.Class.extend({init:function(n){this.center=null;this.options=n},layout:function(n,t){if(this.graph=n,this.graph.nodes&&this.graph.nodes.length!==0){if(!h(this.graph.nodes,t))throw"The given root is not in the graph.";this.center=t;this.graph.cacheRelationships();this.layoutSwitch()}},layoutLeft:function(n){var u,f,e,t,i,s,h,c;for(this.setChildrenDirection(this.center,"Left",!1),this.setChildrenLayout(this.center,"Default",!1),u=0,f=0,t=0;t<n.length;t++)i=n[t],i.TreeDirection="Left",s=this.measure(i,o.Empty),f=Math.max(f,s.Width),u+=s.height+this.options.verticalSeparation;for(u-=this.options.verticalSeparation,h=this.center.x-this.options.horizontalSeparation,e=this.center.y+(this.center.height-u)/2,t=0;t<n.length;t++)i=n[t],c=new r(h-i.Size.width,e),this.arrange(i,c),e+=i.Size.height+this.options.verticalSeparation},layoutRight:function(n){var u,f,e,t,i,s,h,c;for(this.setChildrenDirection(this.center,"Right",!1),this.setChildrenLayout(this.center,"Default",!1),u=0,f=0,t=0;t<n.length;t++)i=n[t],i.TreeDirection="Right",s=this.measure(i,o.Empty),f=Math.max(f,s.Width),u+=s.height+this.options.verticalSeparation;for(u-=this.options.verticalSeparation,h=this.center.x+this.options.horizontalSeparation+this.center.width,e=this.center.y+(this.center.height-u)/2,t=0;t<n.length;t++)i=n[t],c=new r(h,e),this.arrange(i,c),e+=i.Size.height+this.options.verticalSeparation},layoutUp:function(n){var u,e,i,t,s,f,h;for(this.setChildrenDirection(this.center,"Up",!1),this.setChildrenLayout(this.center,"Default",!1),u=0,t=0;t<n.length;t++)i=n[t],i.TreeDirection="Up",s=this.measure(i,o.Empty),u+=s.width+this.options.horizontalSeparation;for(u-=this.options.horizontalSeparation,f=this.center.x+this.center.width/2-u/2,t=0;t<n.length;t++)i=n[t],e=this.center.y-this.options.verticalSeparation-i.Size.height,h=new r(f,e),this.arrange(i,h),f+=i.Size.width+this.options.horizontalSeparation},layoutDown:function(n){var i,t,u,e,s,f,h;for(this.setChildrenDirection(this.center,"Down",!1),this.setChildrenLayout(this.center,"Default",!1),u=0,t=0;t<n.length;t++)i=n[t],i.treeDirection="Down",s=this.measure(i,o.Empty),u+=s.width+this.options.horizontalSeparation;for(u-=this.options.horizontalSeparation,f=this.center.x+this.center.width/2-u/2,e=this.center.y+this.options.verticalSeparation+this.center.height,t=0;t<n.length;t++)i=n[t],h=new r(f,e),this.arrange(i,h),f+=i.Size.width+this.options.horizontalSeparation},layoutRadialTree:function(){this.setChildrenDirection(this.center,"Radial",!1);this.setChildrenLayout(this.center,"Default",!1);this.previousRoot=null;var n=this.options.startRadialAngle*b,t=this.options.endRadialAngle*b;if(t<=n)throw"Final angle should not be less than the start angle.";this.maxDepth=0;this.origin=new r(this.center.x,this.center.y);this.calculateAngularWidth(this.center,0);this.maxDepth>0&&this.radialLayout(this.center,this.options.radialFirstLevelSeparation,n,t);this.center.Angle=t-n},tipOverTree:function(n,i){var f,h,e,u,c,s,l;for(t.isUndefined(i)&&(i=0),this.setChildrenDirection(this.center,"Down",!1),this.setChildrenLayout(this.center,"Default",!1),this.setChildrenLayout(this.center,"Underneath",!1,i),f=0,u=0;u<n.length;u++)e=n[u],e.TreeDirection="Down",c=this.measure(e,o.Empty),f+=c.width+this.options.horizontalSeparation;for(f-=this.options.horizontalSeparation,f-=n[n.length-1].width,f+=n[n.length-1].associatedShape.bounds().width,s=this.center.x+this.center.width/2-f/2,h=this.center.y+this.options.verticalSeparation+this.center.height,u=0;u<n.length;u++)e=n[u],l=new r(s,h),this.arrange(e,l),s+=e.Size.width+this.options.horizontalSeparation},calculateAngularWidth:function(n,t){var r,o,s;t>this.maxDepth&&(this.maxDepth=t);var i=0,u=1e3,f=1e3,e=t===0?0:Math.sqrt(u*u+f*f)/t;if(n.children.length>0){for(r=0,o=n.children.length;r<o;r++)s=n.children[r],i+=this.calculateAngularWidth(s,t+1);i=Math.max(e,i)}else i=e;return n.sectorAngle=i,i},sortChildren:function(n){var v=0,i,f,s,h,e,c,o,l,u,a,y;if(n.parents.length>1)throw"Node is not part of a tree.";if(f=n.parents[0],f&&(s=new r(f.x,f.y),h=new r(n.x,n.y),v=this.normalizeAngle(Math.atan2(s.y-h.y,s.x-h.x))),e=n.children.length,e===0)return null;for(c=[],o=[],i=0;i<e;++i)l=n.children[i],u=new r(l.x,l.y),o[i]=i,c[i]=this.normalizeAngle(-v+Math.atan2(u.y-u.y,u.x-u.x));for(t.bisort(c,o),a=[],y=n.children,i=0;i<e;++i)a.push(y[o[i]]);return a},normalizeAngle:function(n){while(n>Math.PI*2)n-=2*Math.PI;while(n<0)n+=Math.PI*2;return n},radialLayout:function(n,t,i,r){for(var u=r-i,l=u/2,a=n.sectorAngle,f=0,h=this.sortChildren(n),s=0,v=h.length;s<v;s++){var e=h[s],c=e,o=c.sectorAngle/a;e.children.length>0&&this.radialLayout(e,t+this.options.radialSeparation,i+f*u,i+(f+o)*u);this.setPolarLocation(e,t,i+f*u+o*l);c.angle=o*u;f+=o}},setPolarLocation:function(n,t,i){n.x=this.origin.x+t*Math.cos(i);n.y=this.origin.y+t*Math.sin(i);n.BoundingRectangle=new f(n.x,n.y,n.width,n.height)},setChildrenDirection:function(n,t,i){var r=n.treeDirection;this.graph.depthFirstTraversal(n,function(n){n.treeDirection=t});i||(n.treeDirection=r)},setChildrenLayout:function(n,i,r,u){t.isUndefined(u)&&(u=0);var f=n.childrenLayout;u>0?(this.graph.assignLevels(n),this.graph.depthFirstTraversal(n,function(n){n.level>=u+1&&(n.childrenLayout=i)})):(this.graph.depthFirstTraversal(n,function(n){n.childrenLayout=i}),r||(n.childrenLayout=f))},measure:function(n,i){var u=0,f=0,r,a=new o(0,0),y,e,c;if(!n)throw"";var v=n.associatedShape.bounds(),s=v.width,h=v.height;if(n.parents.length!==1)throw"Node not in a spanning tree.";if(y=n.parents[0],n.treeDirection==="Undefined"&&(n.treeDirection=y.treeDirection),t.isEmpty(n.children))a=new o(Math.abs(s)<l?50:s,Math.abs(h)<l?25:h);else if(n.children.length===1){switch(n.treeDirection){case"Radial":r=this.measure(n.children[0],i);u=s+this.options.radialSeparation*Math.cos(n.AngleToParent)+r.width;f=h+Math.abs(this.options.radialSeparation*Math.sin(n.AngleToParent))+r.height;break;case"Left":case"Right":switch(n.childrenLayout){case"TopAlignedWithParent":break;case"BottomAlignedWithParent":break;case"Underneath":r=this.measure(n.children[0],i);u=s+r.width+this.options.underneathHorizontalOffset;f=h+this.options.underneathVerticalTopOffset+r.height;break;case"Default":r=this.measure(n.children[0],i);u=s+this.options.horizontalSeparation+r.width;f=Math.max(h,r.height);break;default:throw"Unhandled TreeDirection in the Radial layout measuring.";}break;case"Up":case"Down":switch(n.childrenLayout){case"TopAlignedWithParent":case"BottomAlignedWithParent":break;case"Underneath":r=this.measure(n.children[0],i);u=Math.max(s,r.width+this.options.underneathHorizontalOffset);f=h+this.options.underneathVerticalTopOffset+r.height;break;case"Default":r=this.measure(n.children[0],i);f=h+this.options.verticalSeparation+r.height;u=Math.max(s,r.width);break;default:throw"Unhandled TreeDirection in the Down layout measuring.";}break;default:throw"Unhandled TreeDirection in the layout measuring.";}a=new o(u,f)}else{switch(n.treeDirection){case"Left":case"Right":switch(n.childrenLayout){case"TopAlignedWithParent":case"BottomAlignedWithParent":break;case"Underneath":for(u=s,f=h+this.options.underneathVerticalTopOffset,e=0;e<n.children.length;e++)c=n.children[e],r=this.measure(c,i),u=Math.max(u,r.width+this.options.underneathHorizontalOffset),f+=r.height+this.options.underneathVerticalSeparation;f-=this.options.underneathVerticalSeparation;break;case"Default":for(u=s,f=0,e=0;e<n.children.length;e++)c=n.children[e],r=this.measure(c,i),u=Math.max(u,s+this.options.horizontalSeparation+r.width),f+=r.height+this.options.verticalSeparation;f-=this.options.verticalSeparation;break;default:throw"Unhandled TreeDirection in the Right layout measuring.";}break;case"Up":case"Down":switch(n.childrenLayout){case"TopAlignedWithParent":case"BottomAlignedWithParent":break;case"Underneath":for(u=s,f=h+this.options.underneathVerticalTopOffset,e=0;e<n.children.length;e++)c=n.children[e],r=this.measure(c,i),u=Math.max(u,r.width+this.options.underneathHorizontalOffset),f+=r.height+this.options.underneathVerticalSeparation;f-=this.options.underneathVerticalSeparation;break;case"Default":for(u=0,f=0,e=0;e<n.children.length;e++)c=n.children[e],r=this.measure(c,i),u+=r.width+this.options.horizontalSeparation,f=Math.max(f,r.height+this.options.verticalSeparation+h);u-=this.options.horizontalSeparation;break;default:throw"Unhandled TreeDirection in the Down layout measuring.";}break;default:throw"Unhandled TreeDirection in the layout measuring.";}a=new o(u,f)}return n.SectorAngle=Math.sqrt(u*u/4+f*f/4),n.Size=a,a},arrange:function(n,i){var u,c,p,o,a,w=n.associatedShape.bounds(),v=w.width,y=w.height,h,s,e;if(t.isEmpty(n.children))n.x=i.x,n.y=i.y,n.BoundingRectangle=new f(i.x,i.y,v,y);else switch(n.treeDirection){case"Left":switch(n.childrenLayout){case"TopAlignedWithParent":case"BottomAlignedWithParent":break;case"Underneath":for(e=i,n.x=e.x,n.y=e.y,n.BoundingRectangle=new f(n.x,n.y,n.width,n.height),s=i.y+y+this.options.underneathVerticalTopOffset,u=0;u<o.children.length;u++)o=o.children[u],h=e.x-o.associatedShape.width-this.options.underneathHorizontalOffset,c=new r(h,s),this.arrange(o,c),s+=o.Size.height+this.options.underneathVerticalSeparation;break;case"Default":for(e=new r(i.x+n.Size.width-v,i.y+(n.Size.height-y)/2),n.x=e.x,n.y=e.y,n.BoundingRectangle=new f(n.x,n.y,n.width,n.height),h=e.x-this.options.horizontalSeparation,s=i.y,u=0;u<n.children.length;u++)o=n.children[u],c=new r(h-o.Size.width,s),this.arrange(o,c),s+=o.Size.height+this.options.verticalSeparation;break;default:throw"Unsupported TreeDirection";}break;case"Right":switch(n.childrenLayout){case"TopAlignedWithParent":case"BottomAlignedWithParent":break;case"Underneath":for(e=i,n.x=e.x,n.y=e.y,n.BoundingRectangle=new f(n.x,n.y,n.width,n.height),h=i.x+v+this.options.underneathHorizontalOffset,s=i.y+y+this.options.underneathVerticalTopOffset,u=0;u<n.children.length;u++)o=n.children[u],c=new r(h,s),this.arrange(o,c),s+=o.Size.height+this.options.underneathVerticalSeparation;break;case"Default":for(e=new r(i.x,i.y+(n.Size.height-y)/2),n.x=e.x,n.y=e.y,n.BoundingRectangle=new f(n.x,n.y,n.width,n.height),h=i.x+v+this.options.horizontalSeparation,s=i.y,u=0;u<n.children.length;u++)o=n.children[u],c=new r(h,s),this.arrange(o,c),s+=o.Size.height+this.options.verticalSeparation;break;default:throw"Unsupported TreeDirection";}break;case"Up":if(e=new r(i.x+(n.Size.width-v)/2,i.y+n.Size.height-y),n.x=e.x,n.y=e.y,n.BoundingRectangle=new f(n.x,n.y,n.width,n.height),Math.abs(e.x-i.x)<l){for(a=0,u=0;u<n.children.length;u++)p=n.children[u],a+=p.Size.width+this.options.horizontalSeparation;a-=this.options.horizontalSeparation;h=i.x+(v-a)/2}else h=i.x;for(u=0;u<n.children.length;u++)o=n.children[u],s=e.y-this.options.verticalSeparation-o.Size.height,c=new r(h,s),this.arrange(o,c),h+=o.Size.width+this.options.horizontalSeparation;break;case"Down":switch(n.childrenLayout){case"TopAlignedWithParent":case"BottomAlignedWithParent":break;case"Underneath":for(e=i,n.x=e.x,n.y=e.y,n.BoundingRectangle=new f(n.x,n.y,n.width,n.height),h=i.x+this.options.underneathHorizontalOffset,s=i.y+y+this.options.underneathVerticalTopOffset,u=0;u<n.children.length;u++)o=n.children[u],c=new r(h,s),this.arrange(o,c),s+=o.Size.height+this.options.underneathVerticalSeparation;break;case"Default":if(e=new r(i.x+(n.Size.width-v)/2,i.y),n.x=e.x,n.y=e.y,n.BoundingRectangle=new f(n.x,n.y,n.width,n.height),Math.abs(e.x-i.x)<l){for(a=0,u=0;u<n.children.length;u++)p=n.children[u],a+=p.Size.width+this.options.horizontalSeparation;a-=this.options.horizontalSeparation;h=i.x+(v-a)/2}else h=i.x;for(u=0;u<n.children.length;u++)o=n.children[u],s=e.y+this.options.verticalSeparation+y,c=new r(h,s),this.arrange(o,c),h+=o.Size.width+this.options.horizontalSeparation;break;default:throw"Unsupported TreeDirection";}break;case"None":break;default:throw"Unsupported TreeDirection";}},layoutSwitch:function(){var r,u,f,e,i,n;if(this.center&&!t.isEmpty(this.center.children)){r=this.options.subtype;t.isUndefined(r)&&(r="Down");n=this.center.children;switch(r.toLowerCase()){case"radial":case"radialtree":this.layoutRadialTree();break;case"mindmaphorizontal":case"mindmap":u=this.center.children;this.center.children.length===1?this.layoutRight(u):(i=n.length/2,f=c(this.center.children,function(r){return t.indexOf(n,r)<i}),e=c(this.center.children,function(r){return t.indexOf(n,r)>=i}),this.layoutLeft(f),this.layoutRight(e));break;case"mindmapvertical":u=this.center.children;this.center.children.length===1?this.layoutDown(u):(i=n.length/2,f=c(this.center.children,function(r){return t.indexOf(n,r)<i}),e=c(this.center.children,function(r){return t.indexOf(n,r)>=i}),this.layoutUp(f),this.layoutDown(e));break;case"right":this.layoutRight(this.center.children);break;case"left":this.layoutLeft(this.center.children);break;case"up":case"bottom":this.layoutUp(this.center.children);break;case"down":case"top":this.layoutDown(this.center.children);break;case"tipover":case"tipovertree":if(this.options.tipOverTreeStartLevel<0)throw"The tip-over level should be a positive integer.";this.tipOverTree(this.center.children,this.options.tipOverTreeStartLevel)}}}}),tt=s.extend({init:function(n){var i=this;if(s.fn.init.call(i),t.isUndefined(n))throw"No diagram specified.";this.diagram=n},layout:function(n){var t,i;return this.transferOptions(n),t=new a(this.diagram),this.graph=t.convert(),i=this.layoutComponents(),new u.LayoutState(this.diagram,i)},layoutComponents:function(){var n,e,u,i,o,r,s,f;if(!this.graph.isEmpty()&&(n=this.graph.getConnectedComponents(),!t.isEmpty(n))){for(e=new nt(this.options),u=[],i=0;i<n.length;i++){if(o=n[i],r=this.getTree(o),!r)throw"Failed to find a spanning tree for the component.";s=r.root;f=r.tree;e.layout(f,s);u.push(f)}return this.gridLayoutComponents(u)}},getTree:function(n){var t=null,i,f,u,r,e;if(this.options.roots&&this.options.roots.length>0)for(i=0,f=n.nodes.length;i<f;i++)for(u=n.nodes[i],r=0;r<this.options.roots.length;r++)if(e=this.options.roots[r],e===u.associatedShape){t=u;break}if(!t&&(t=n.root(),!t))throw"Unable to find a root for the tree.";return this.getTreeForRoot(n,t)},getTreeForRoot:function(n,i){var r=n.getSpanningTree(i);return t.isUndefined(r)||r.isEmpty()?null:{tree:r,root:r.root}}}),it=s.extend({init:function(n){var i=this;if(s.fn.init.call(i),t.isUndefined(n))throw"Diagram is not specified.";this.diagram=n},layout:function(n){var e,f,i,r,o,s;if((this.transferOptions(n),e=new a(this.diagram),f=e.convert(n),!f.isEmpty())&&(i=f.getConnectedComponents(),!t.isEmpty(i))){for(r=0;r<i.length;r++)o=i[r],this.layoutGraph(o,n);return s=this.gridLayoutComponents(i),new u.LayoutState(this.diagram,s)}},_initRuntimeProperties:function(){for(var n,t=0;t<this.graph.nodes.length;t++)n=this.graph.nodes[t],n.layer=-1,n.downstreamLinkCount=0,n.upstreamLinkCount=0,n.isVirtual=!1,n.uBaryCenter=0,n.dBaryCenter=0,n.upstreamPriority=0,n.downstreamPriority=0,n.gridPosition=0},_prepare:function(n){var s=[],r,f,v,u=new i,b=0,y,c,e,p,w,l,a,o;for(t.forEach(n.nodes,function(n){n.incoming.length===0&&(u.set(n,0),s.push(n))});s.length>0;)for(c=s.shift(),r=0;r<c.outgoing.length;r++)v=c.outgoing[r],e=v.target,y=u.containsKey(e)?Math.max(u.get(c)+1,u.get(e)):u.get(c)+1,u.set(e,y),y>b&&(b=y),h(s,e)||s.push(e);for(p=u.keys(),p.sort(function(n,i){var r=u.get(n),f=u.get(i);return t.sign(f-r)}),w=0;w<p.length;++w)if(l=p[w],a=Number.MAX_VALUE,l.outgoing.length!==0){for(f=0;f<l.outgoing.length;++f)v=l.outgoing[f],a=Math.min(a,u.get(v.target));a>1&&u.set(l,a-1)}for(this.layers=[],r=0;r<b+1;r++)o=[],o.linksTo={},this.layers.push(o);for(u.forEach(function(n,t){n.layer=t;this.layers[t].push(n)},this),f=0;f<this.layers.length;f++)for(o=this.layers[f],r=0;r<o.length;r++)o[r].gridPosition=r},layoutGraph:function(n,i){if(t.isUndefined(n))throw"No graph given or graph analysis of the diagram failed.";t.isDefined(i)&&this.transferOptions(i);this.graph=n;n.setItemIndices();var r=n.makeAcyclic();this._initRuntimeProperties();this._prepare(n,i);this._dummify();this._optimizeCrossings();this._swapPairs();this.arrangeNodes();this._moveThingsAround();this._dedummify();t.forEach(r,function(n){n.points&&n.points.reverse()})},setMinDist:function(n,t,i){var r=n.layer,u=n.layerIndex;this.minDistances[r][u]=i},getMinDist:function(n,t){for(var r=0,u=n.layerIndex,f=t.layerIndex,e=n.layer,o=Math.min(u,f),s=Math.max(u,f),i=o;i<s;++i)r+=this.minDistances[e][i];return r},placeLeftToRight:function(n){for(var e,h,c,f,l,a,v,o=new i,r,u,s=0;s<this.layers.length;++s)if(e=n[s],e){for(r=0;r<e.length;r++)u=e[r],o.containsKey(u)||this.placeLeft(u,o,s);for(h=Number.POSITIVE_INFINITY,r=0;r<e.length;r++)u=e[r],c=this.rightSibling(u),c&&this.nodeLeftClass.get(c)!==s&&(h=Math.min(h,o.get(c)-o.get(u)-this.getMinDist(u,c)));if(h===Number.POSITIVE_INFINITY){for(f=[],r=0;r<e.length;r++)for(u=e[r],l=[],t.addRange(l,this.upNodes.get(u)),t.addRange(l,this.downNodes.get(u)),a=0;a<l.length;a++)v=l[a],this.nodeLeftClass.get(v)<s&&f.push(o.get(v)-o.get(u));f.sort();h=f.length===0?0:f.length%2==1?f[this.intDiv(f.length,2)]:(f[this.intDiv(f.length,2)-1]+f[this.intDiv(f.length,2)])/2}for(r=0;r<e.length;r++)u=e[r],o.set(u,o.get(u)+h)}return o},placeRightToLeft:function(n){for(var e,h,c,f,l,a,v,o=new i,r,u,s=0;s<this.layers.length;++s)if(e=n[s],e){for(r=0;r<e.length;r++)u=e[r],o.containsKey(u)||this.placeRight(u,o,s);for(h=Number.NEGATIVE_INFINITY,r=0;r<e.length;r++)u=e[r],c=this.leftSibling(u),c&&this.nodeRightClass.get(c)!==s&&(h=Math.max(h,o.get(c)-o.get(u)+this.getMinDist(c,u)));if(h===Number.NEGATIVE_INFINITY){for(f=[],r=0;r<e.length;r++)for(u=e[r],l=[],t.addRange(l,this.upNodes.get(u)),t.addRange(l,this.downNodes.get(u)),a=0;a<l.length;a++)v=l[a],this.nodeRightClass.get(v)<s&&f.push(o.get(u)-o.get(v));f.sort();h=f.length===0?0:f.length%2==1?f[this.intDiv(f.length,2)]:(f[this.intDiv(f.length,2)-1]+f[this.intDiv(f.length,2)])/2}for(r=0;r<e.length;r++)u=e[r],o.set(u,o.get(u)+h)}return o},_getLeftWing:function(){var n={value:null},t=this.computeClasses(n,1);return this.nodeLeftClass=n.value,t},_getRightWing:function(){var n={value:null},t=this.computeClasses(n,-1);return this.nodeRightClass=n.value,t},computeClasses:function(n,t){for(var h,e,r,l,c,v,u,a,o=0,f=n.value=new i,s=0;s<this.layers.length;++s)for(o=s,h=this.layers[s],e=t===1?0:h.length-1;0<=e&&e<h.length;e+=t)if(r=h[e],f.containsKey(r))o=f.get(r);else if(f.set(r,o),r.isVirtual)for(l=this._nodesInLink(r),c=0;c<l.length;c++)v=l[c],f.set(v,o);for(u=[],a=0;a<this.layers.length;a++)u.push(null);return f.forEach(function(n,t){u[t]===null&&(u[t]=[]);u[t].push(n)}),u},_isVerticalLayout:function(){return this.options.subtype.toLowerCase()==="up"||this.options.subtype.toLowerCase()==="down"||this.options.subtype.toLowerCase()==="vertical"},_isHorizontalLayout:function(){return this.options.subtype.toLowerCase()==="right"||this.options.subtype.toLowerCase()==="left"||this.options.subtype.toLowerCase()==="horizontal"},_isIncreasingLayout:function(){return this.options.subtype.toLowerCase()==="right"||this.options.subtype.toLowerCase()==="down"},_moveThingsAround:function(){function st(n,t){for(var u,i=Number.MIN_VALUE,r=0;r<n.length;++r)u=n[r],i=t._isVerticalLayout()?Math.max(i,u.height):Math.max(i,u.width);return i}for(var n,e,u,r,a,p,h,c,d,w,b,v,l,s,g,nt,y,f=0;f<this.layers.length;++f)u=this.layers[f],u.sort(this._gridPositionComparer);for(this.minDistances=[],f=0;f<this.layers.length;++f)for(u=this.layers[f],this.minDistances[f]=[],r=0;r<u.length;++r)e=u[r],e.layerIndex=r,this.minDistances[f][r]=this.options.nodeDistance,r<u.length-1&&(this.minDistances[f][r]+=this._isVerticalLayout()?(e.width+u[r+1].width)/2:(e.height+u[r+1].height)/2);for(this.downNodes=new i,this.upNodes=new i,t.forEach(this.graph.nodes,function(n){this.downNodes.set(n,[]);this.upNodes.set(n,[])},this),t.forEach(this.graph.links,function(n){var r=n.source,u=n.target,t=null,i=null;r.layer>u.layer?(t=n.source,i=n.target):(i=n.source,t=n.target);this.downNodes.get(i).push(t);this.upNodes.get(t).push(i)},this),this.downNodes.forEachValue(function(n){n.sort(this._gridPositionComparer)},this),this.upNodes.forEachValue(function(n){n.sort(this._gridPositionComparer)},this),f=0;f<this.layers.length-1;++f)for(u=this.layers[f],a=0;a<u.length-1;a++)if((p=u[a],p.isVirtual)&&(h=this.downNodes.get(p)[0],h.isVirtual))for(r=a+1;r<u.length;++r)(e=u[r],e.isVirtual)&&(c=this.downNodes.get(e)[0],c.isVirtual)&&h.gridPosition>c.gridPosition&&(d=h.gridPosition,h.gridPosition=c.gridPosition,c.gridPosition=d,w=h.layerIndex,b=c.layerIndex,this.layers[f+1][w]=c,this.layers[f+1][b]=h,h.layerIndex=b,c.layerIndex=w);var tt=this._getLeftWing(),it=this._getRightWing(),rt=this.placeLeftToRight(tt),ut=this.placeRightToLeft(it),o=new i;for(t.forEach(this.graph.nodes,function(n){o.set(n,(rt.get(n)+ut.get(n))/2)}),v=new i,l=new i,f=0;f<this.layers.length;++f)for(u=this.layers[f],s=-1,g=-1,r=0;r<u.length;++r)e=u[r],v.set(e,0),l.set(e,!1),e.isVirtual&&(s===-1?s=r:s===r-1?s=r:(g=r,v.set(u[s],0),o.get(e)-o.get(u[s])===this.getMinDist(u[s],e)?l.set(u[s],!0):l.set(u[s],!1),s=r));nt=[1,-1];t.forEach(nt,function(t){for(var s,h,c=t===1?0:this.layers.length-1,e=c;0<=e&&e<this.layers.length;e+=t){var u=this.layers[e],f=this._firstVirtualNode(u),r=null,i=null;if(f!==-1)for(r=u[f],i=[],n=0;n<f;n++)i.push(u[n]);else r=null,i=u;if(i.length>0){for(this._sequencer(o,null,r,t,i),n=0;n<i.length-1;++n)this.setMinDist(i[n],i[n+1],o.get(i[n+1])-o.get(i[n]));r&&this.setMinDist(i[i.length-1],r,o.get(r)-o.get(i[i.length-1]))}while(r){if(s=this.nextVirtualNode(u,r),s){if(v.get(r)===t){for(f=r.layerIndex,h=s.layerIndex,i=[],n=f+1;n<h;n++)i.push(u[n]);i.length>0&&this._sequencer(o,r,s,t,i);l.set(r,!0)}}else{for(f=r.layerIndex,i=[],n=f+1;n<u.length;n++)i.push(u[n]);if(i.length>0){for(this._sequencer(o,r,null,t,i),n=0;n<i.length-1;++n)this.setMinDist(i[n],i[n+1],o.get(i[n+1])-o.get(i[n]));this.setMinDist(r,i[0],o.get(i[0])-o.get(r))}}r=s}this.adjustDirections(e,t,v,l)}},this);var ft=this._isIncreasingLayout()?0:this.layers.length-1,et=function(n,t){return t._isIncreasingLayout()?n<t.layers.length:n>=0},ot=this._isIncreasingLayout()?1:-1,k=0;for(n=ft;et(n,this);n+=ot){for(u=this.layers[n],y=st(u,this),r=0;r<u.length;++r)e=u[r],this._isVerticalLayout()?(e.x=o.get(e),e.y=k+y/2):(e.x=k+y/2,e.y=o.get(e));k+=this.options.layerSeparation+y}},adjustDirections:function(n,t,i,r){var h,u,c,f,y,p,e;if(!(n+t<0)&&!(n+t>=this.layers.length)){var o=null,l=null,s=this.layers[n+t];for(h=0;h<s.length;++h)if(u=s[h],u.isVirtual&&(c=this.getNeighborOnLayer(u,n),c.isVirtual)){if(o){var a=r.get(l),v=this.layers[n],w=l.layerIndex,b=c.layerIndex;for(f=w+1;f<b;++f)v[f].isVirtual&&(a=a&&r.get(v[f]));if(a)for(i.set(o,t),y=o.layerIndex,p=u.layerIndex,e=y+1;e<p;++e)s[e].isVirtual&&i.set(s[e],t)}o=u;l=c}}},getNeighborOnLayer:function(n,t){var i=this.upNodes.get(n)[0];return i.layer===t?i:(i=this.downNodes.get(n)[0],i.layer===t)?i:null},_sequencer:function(n,t,i,r,u){if(u.length===1&&this._sequenceSingle(n,t,i,r,u[0]),u.length>1){var e=u.length,f=this.intDiv(e,2);this._sequencer(n,t,i,r,u.slice(0,f));this._sequencer(n,t,i,r,u.slice(f));this.combineSequences(n,t,i,r,u)}},_sequenceSingle:function(n,t,i,r,u){var e=r===-1?this.downNodes.get(u):this.upNodes.get(u),f=e.length;f!==0&&(f%2==1?n.set(u,n.get(e[this.intDiv(f,2)])):n.set(u,(n.get(e[this.intDiv(f,2)-1])+n.get(e[this.intDiv(f,2)]))/2),t&&n.set(u,Math.max(n.get(u),n.get(t)+this.getMinDist(t,u))),i&&n.set(u,Math.min(n.get(u),n.get(i)-this.getMinDist(u,i))))},combineSequences:function(n,t,i,r,u){for(var p=u.length,f=this.intDiv(p,2),c=[],o,s,l,a,v,h,e=0;e<f;++e){for(o=0,l=r===-1?this.downNodes.get(u[e]):this.upNodes.get(u[e]),s=0;s<l.length;++s)a=l[s],n.get(a)>=n.get(u[e])?o++:(o--,c.push({k:n.get(a)+this.getMinDist(u[e],u[f-1]),v:2}));c.push({k:n.get(u[e])+this.getMinDist(u[e],u[f-1]),v:o})}for(t&&c.push({k:n.get(t)+this.getMinDist(t,u[f-1]),v:Number.MAX_VALUE}),c.sort(this._positionDescendingComparer),h=[],e=f;e<p;++e){for(o=0,l=r===-1?this.downNodes.get(u[e]):this.upNodes.get(u[e]),s=0;s<l.length;++s)a=l[s],n.get(a)<=n.get(u[e])?o++:(o--,h.push({k:n.get(a)-this.getMinDist(u[e],u[f]),v:2}));h.push({k:n.get(u[e])-this.getMinDist(u[e],u[f]),v:o})}i&&h.push({k:n.get(i)-this.getMinDist(i,u[f]),v:Number.MAX_VALUE});h.sort(this._positionAscendingComparer);for(var w=0,b=0,y=this.getMinDist(u[f-1],u[f]);n.get(u[f])-n.get(u[f-1])<y;)if(w<b)if(c.length===0){n.set(u[f-1],n.get(u[f])-y);break}else v=c.shift(),w=w+v.v,n.set(u[f-1],v.k),n.set(u[f-1],Math.max(n.get(u[f-1]),n.get(u[f])-y));else if(h.length===0){n.set(u[f],n.get(u[f-1])+y);break}else v=h.shift(),b=b+v.v,n.set(u[f],v.k),n.set(u[f],Math.min(n.get(u[f]),n.get(u[f-1])+y));for(e=f-2;e>=0;e--)n.set(u[e],Math.min(n.get(u[e]),n.get(u[f-1])-this.getMinDist(u[e],u[f-1])));for(e=f+1;e<p;e++)n.set(u[e],Math.max(n.get(u[e]),n.get(u[f])+this.getMinDist(u[e],u[f])))},placeLeft:function(n,i,r){var u=Number.NEGATIVE_INFINITY;t.forEach(this._getComposite(n),function(n){var t=this.leftSibling(n);t&&this.nodeLeftClass.get(t)===this.nodeLeftClass.get(n)&&(i.containsKey(t)||this.placeLeft(t,i,r),u=Math.max(u,i.get(t)+this.getMinDist(t,n)))},this);u===Number.NEGATIVE_INFINITY&&(u=0);t.forEach(this._getComposite(n),function(n){i.set(n,u)})},placeRight:function(n,i,r){var u=Number.POSITIVE_INFINITY;t.forEach(this._getComposite(n),function(n){var t=this.rightSibling(n);t&&this.nodeRightClass.get(t)===this.nodeRightClass.get(n)&&(i.containsKey(t)||this.placeRight(t,i,r),u=Math.min(u,i.get(t)-this.getMinDist(n,t)))},this);u===Number.POSITIVE_INFINITY&&(u=0);t.forEach(this._getComposite(n),function(n){i.set(n,u)})},leftSibling:function(n){var i=this.layers[n.layer],t=n.layerIndex;return t===0?null:i[t-1]},rightSibling:function(n){var t=this.layers[n.layer],i=n.layerIndex;return i===t.length-1?null:t[i+1]},_getComposite:function(n){return n.isVirtual?this._nodesInLink(n):[n]},arrangeNodes:function(){for(var u,t,r,i,o,e,f,n=0;n<this.layers.length;n++)for(r=this.layers[n],t=0;t<r.length;t++)i=r[t],i.upstreamPriority=i.upstreamLinkCount,i.downstreamPriority=i.downstreamLinkCount;for(o=2,e=0;e<o;e++){for(u=this.layers.length-1;u>=1;u--)this.layoutLayer(!1,u);for(u=0;u<this.layers.length-1;u++)this.layoutLayer(!0,u)}for(f=Number.MAX_VALUE,n=0;n<this.layers.length;n++)for(r=this.layers[n],t=0;t<r.length;t++)i=r[t],f=Math.min(f,i.gridPosition);if(f<0)for(n=0;n<this.layers.length;n++)for(r=this.layers[n],t=0;t<r.length;t++)i=r[t],i.gridPosition=i.gridPosition-f},layoutLayer:function(n,i){var r,u,f,e;for(u=n?this.layers[r=i+1]:this.layers[r=i-1],f=[],e=0;e<u.length;e++)f.push(u[e]);f.sort(function(n,t){var i=(n.upstreamPriority+n.downstreamPriority)/2,r=(t.upstreamPriority+t.downstreamPriority)/2;return Math.abs(i-r)<.0001?0:i<r?1:-1});t.forEach(f,function(n){var t=n.gridPosition,i=this.calcBaryCenter(n),r=(n.upstreamPriority+n.downstreamPriority)/2;if(!(Math.abs(t-i)<.0001)&&!(Math.abs(t-i)<.25+.0001))if(t<i)while(t<i){if(!this.moveRight(n,u,r))break;t=n.gridPosition}else while(t>i){if(!this.moveLeft(n,u,r))break;t=n.gridPosition}},this);r>0&&this.calcDownData(r-1);r<this.layers.length-1&&this.calcUpData(r+1)},moveRight:function(n,i,r){var e=t.indexOf(i,n),u,f;return e===i.length-1?(n.gridPosition=n.gridPosition+.5,!0):(u=i[e+1],f=(u.upstreamPriority+u.downstreamPriority)/2,u.gridPosition>n.gridPosition+1)?(n.gridPosition=n.gridPosition+.5,!0):f>r||Math.abs(f-r)<.0001?!1:this.moveRight(u,i,r)?(n.gridPosition=n.gridPosition+.5,!0):!1},moveLeft:function(n,i,r){var e=t.indexOf(i,n),u,f;return e===0?(n.gridPosition=n.gridPosition-.5,!0):(u=i[e-1],f=(u.upstreamPriority+u.downstreamPriority)/2,u.gridPosition<n.gridPosition-1)?(n.gridPosition=n.gridPosition-.5,!0):f>r||Math.abs(f-r)<.0001?!1:this.moveLeft(u,i,r)?(n.gridPosition=n.gridPosition-.5,!0):!1},mapVirtualNode:function(n,t){this.nodeToLinkMap.set(n,t);this.linkToNodeMap.containsKey(t)||this.linkToNodeMap.set(t,[]);this.linkToNodeMap.get(t).push(n)},_nodesInLink:function(n){return this.linkToNodeMap.get(this.nodeToLinkMap.get(n))},_dummify:function(){this.linkToNodeMap=new i;this.nodeToLinkMap=new i;for(var e,r,n,w,a,c,u,nt=this.graph.links.slice(0),l=this.layers,k=function(n,t,i){l[n].linksTo[t]=l[n].linksTo[t]||[];l[n].linksTo[t].push(i)},g=0;g<nt.length;g++){var h=nt[g],o=h.source,tt=h.target,s=o.layer,f=tt.layer,p=o.gridPosition,d=tt.gridPosition,it=(d-p)/Math.abs(f-s),b=o;if(s-f>1){for(u=s-1;u>f;u--){for(n=new v,n.x=o.x,n.y=o.y,n.width=o.width/100,n.height=o.height/100,e=l[u],r=(u-f)*it+p,r>e.length&&(r=e.length),p>=l[s].length-1&&d>=l[f].length-1?r=e.length:p===0&&d===0&&(r=0),n.layer=u,n.uBaryCenter=0,n.dBaryCenter=0,n.upstreamLinkCount=0,n.downstreamLinkCount=0,n.gridPosition=r,n.isVirtual=!0,t.insert(e,n,r),a=r+1;a<e.length;a++)w=e[a],w.gridPosition=w.gridPosition+1;c=new y(b,n);c.depthOfDumminess=0;k(u-1,u,c);b=n;this.graph._addNode(n);this.graph.addLink(c);n.index=this.graph.nodes.length-1;this.mapVirtualNode(n,h)}k(f-1,f,c);h.changeSource(b);h.depthOfDumminess=s-f-1}else if(s-f<-1){for(u=s+1;u<f;u++){for(n=new v,n.x=o.x,n.y=o.y,n.width=o.width/100,n.height=o.height/100,e=l[u],r=(u-s)*it+p,r>e.length&&(r=e.length),p>=l[s].length-1&&d>=l[f].length-1?r=e.length:p===0&&d===0&&(r=0),n.layer=u,n.uBaryCenter=0,n.dBaryCenter=0,n.upstreamLinkCount=0,n.downstreamLinkCount=0,n.gridPosition=r,n.isVirtual=!0,r&=r,t.insert(e,n,r),a=r+1;a<e.length;a++)w=e[a],w.gridPosition=w.gridPosition+1;c=new y(b,n);c.depthOfDumminess=0;k(u-1,u,c);b=n;this.graph._addNode(n);this.graph.addLink(c);n.index=this.graph.nodes.length-1;this.mapVirtualNode(n,h)}k(f-1,f,h);h.changeSource(b);h.depthOfDumminess=f-s-1}else k(s,f,h)}},_dedummify:function(){for(var f=!0,i,n,t,r,o,e,s,u;f;)for(f=!1,i=0;i<this.graph.links.length;i++)if(n=this.graph.links[i],n.depthOfDumminess){for(t=[],t.unshift({x:n.target.x,y:n.target.y}),t.unshift({x:n.source.x,y:n.source.y}),r=n,o=n.depthOfDumminess,e=0;e<o;e++)s=r.source,u=s.incoming[0],t.unshift({x:u.source.x,y:u.source.y}),r=u;n.changeSource(r.source);n.depthOfDumminess=0;t.length>2?(t.splice(0,1),t.splice(t.length-1),n.points=t):n.points=[];f=!0;break}},_optimizeCrossings:function(){for(var t=-1,n,i=0;t!==0;){if(i++>3)break;for(t=0,n=this.layers.length-1;n>=1;n--)t+=this.optimizeLayerCrossings(!1,n);for(n=0;n<this.layers.length-1;n++)t+=this.optimizeLayerCrossings(!0,n)}},calcUpData:function(n){if(n!==0){for(var s=this.layers[n],i,u,e=new w,h=this.layers[n-1],t=0;t<h.length;t++)e.add(h[t]);for(t=0;t<s.length;t++){var r=s[t],o=0,f=0;for(i=0;i<r.incoming.length;i++)u=r.incoming[i],e.contains(u.source)&&(f++,o+=u.source.gridPosition);for(i=0;i<r.outgoing.length;i++)u=r.outgoing[i],e.contains(u.target)&&(f++,o+=u.target.gridPosition);f>0?(r.uBaryCenter=o/f,r.upstreamLinkCount=f):(r.uBaryCenter=t,r.upstreamLinkCount=0)}}},calcDownData:function(n){if(n!==this.layers.length-1){for(var s=this.layers[n],i,u,e=new w,h=this.layers[n+1],t=0;t<h.length;t++)e.add(h[t]);for(t=0;t<s.length;t++){var r=s[t],o=0,f=0;for(i=0;i<r.incoming.length;i++)u=r.incoming[i],e.contains(u.source)&&(f++,o+=u.source.gridPosition);for(i=0;i<r.outgoing.length;i++)u=r.outgoing[i],e.contains(u.target)&&(f++,o+=u.target.gridPosition);f>0?(r.dBaryCenter=o/f,r.downstreamLinkCount=f):(r.dBaryCenter=t,r.downstreamLinkCount=0)}}},optimizeLayerCrossings:function(n,t){var f,r,o,u,i,e,s,h;for(r=n?this.layers[f=t+1]:this.layers[f=t-1],o=r.slice(0),n?this.calcUpData(f):this.calcDownData(f),u=this,r.sort(function(n,t){var r=u.calcBaryCenter(n),f=u.calcBaryCenter(t),i;return Math.abs(r-f)<.0001?n.degree()===t.degree()?u.compareByIndex(n,t):n.degree()<t.degree()?1:-1:(i=(f-r)*1e3,i>0)?-1:i<0?1:u.compareByIndex(n,t)}),e=0,i=0;i<r.length;i++)r[i]!==o[i]&&e++;if(e>0)for(s=0,i=0;i<r.length;i++)h=r[i],h.gridPosition=s++;return e},_swapPairs:function(){for(var k=this.options.layeredIterations,h=0,o,p,n,t,v,y;;){if(h++>k)break;for(o=h%4<=1,p=h%4==1,n=o?0:this.layers.length-1;o?n<=this.layers.length-1:n>=0;n+=o?1:-1){var i=this.layers[n],w=!1,c=!0,b=0;for(t=0;t<i.length-1;t++){var r=0,u=0,s=0;if(c?(n!==0&&(r=this.countLinksCrossingBetweenTwoLayers(n-1,n)),n!==this.layers.length-1&&(u=this.countLinksCrossingBetweenTwoLayers(n,n+1)),o?r*=2:u*=2,s=r+u):s=b,s!==0){var f=i[t],e=i[t+1],l=f.gridPosition,a=e.gridPosition;i[t]=e;i[t+1]=f;f.gridPosition=a;e.gridPosition=l;r=0;n!==0&&(r=this.countLinksCrossingBetweenTwoLayers(n-1,n));u=0;n!==this.layers.length-1&&(u=this.countLinksCrossingBetweenTwoLayers(n,n+1));o?r*=2:u*=2;v=r+u;y=!1;y=p?v>=s:v>s;y?(f=i[t],e=i[t+1],l=f.gridPosition,a=e.gridPosition,i[t]=e,i[t+1]=f,f.gridPosition=a,e.gridPosition=l,b=s,c=!1):(w=!0,c=!0)}}w&&(n!==this.layers.length-1&&this.calcUpData(n+1),n!==0&&this.calcDownData(n-1))}}},countLinksCrossingBetweenTwoLayers:function(n,t){for(var e=this.layers[n].linksTo[t],i,r,o,s,h,c,f,l=0,a=e.length,u=0;u<a;u++)for(i=e[u],f=u+1;f<a;f++){r=e[f];i.target.layer===t?(o=i.source,s=i.target):(o=i.target,s=i.source);r.target.layer===t?(h=r.source,c=r.target):(h=r.target,c=r.source);var v=o.gridPosition,y=s.gridPosition,p=h.gridPosition,w=c.gridPosition;(v-p)*(y-w)<0&&l++}return l},calcBaryCenter:function(n){var t=n.upstreamLinkCount,i=n.downstreamLinkCount,r=n.uBaryCenter,u=n.dBaryCenter;return t>0&&i>0?(r+u)/2:t>0?r:i>0?u:0},_gridPositionComparer:function(n,t){return n.gridPosition<t.gridPosition?-1:n.gridPosition>t.gridPosition?1:0},_positionAscendingComparer:function(n,t){return n.k<t.k?-1:n.k>t.k?1:0},_positionDescendingComparer:function(n,t){return n.k<t.k?1:n.k>t.k?-1:0},_firstVirtualNode:function(n){for(var t=0;t<n.length;t++)if(n[t].isVirtual)return t;return-1},compareByIndex:function(n,t){var i=n.index,r=t.index;return i<r?1:i>r?-1:0},intDiv:function(n,t){return(n-n%t)/t},nextVirtualNode:function(n,t){for(var r=t.layerIndex,i=r+1;i<n.length;++i)if(n[i].isVirtual)return n[i];return null}}),rt=e.Class.extend({init:function(n,r){if(t.isUndefined(n))throw"No diagram given";this.diagram=n;this.nodeMap=new i;this.linkMap=new i;this.capture(r?r:n)},capture:function(n){var i,o,r,t,e,s,h,c,l;if(n instanceof u.Graph){for(t=0;t<n.nodes.length;t++)i=n.nodes[t],r=i.associatedShape,this.nodeMap.set(r.visual.id,new f(i.x,i.y,i.width,i.height));for(t=0;t<n.links.length;t++)s=n.links[t],e=s.associatedConnection,this.linkMap.set(e.visual.id,s.points())}else if(n instanceof Array)for(o=n,t=0;t<o.length;t++)i=o[t],r=i.associatedShape,r&&this.nodeMap.set(r.visual.id,new f(i.x,i.y,i.width,i.height));else if(n.hasOwnProperty("links")&&n.hasOwnProperty("nodes")){for(o=n.nodes,h=n.links,t=0;t<o.length;t++)i=o[t],r=i.associatedShape,r&&this.nodeMap.set(r.visual.id,new f(i.x,i.y,i.width,i.height));for(t=0;t<h.length;t++)s=h[t],e=s.associatedConnection,e&&this.linkMap.set(e.visual.id,s.points)}else{for(c=this.diagram.shapes,l=this.diagram.connections,t=0;t<c.length;t++)r=c[t],this.nodeMap.set(r.visual.id,r.bounds());for(t=0;t<l.length;t++)e=l[t],this.linkMap.set(e.visual.id,e.points())}}});k(u,{init:function(n){e.init(n,u.ui)},SpringLayout:g,TreeLayout:tt,GraphAdapter:a,LayeredLayout:it,LayoutBase:s,LayoutState:rt})})(window.kendo.jQuery)}(),function(){(function(n,t){function tf(n){var i=n.originalEvent,t=0;return i.wheelDelta?(t=-i.wheelDelta/40,t=t>0?o.ceil(t):o.floor(t)):i.detail&&(t=i.detail),t}function ut(n){return n.options.name.toLowerCase()===d.toLowerCase()}function ti(n,t){for(var i,u,f=kt,e,o=t.connectors,r=0;r<o.length;r++)i=o[r],ut(i)||(u=n.distanceTo(i.position()),u<f&&(f=u,e=i));return e}function gi(n,t){for(var u=[],f,e=n.drawingContainer().children,o=e.length,i,r=0;r<t.length;r++)for(f=t[r],i=0;i<o;i++)if(e[i]==f.drawingContainer()){u.push(i);break}return u}function nr(n){var t={};return n=n||{},r(n.text)&&n.text!==null&&(t.text=n.text),r(n.x)&&n.x!==null&&(t.x=n.x),r(n.y)&&n.y!==null&&(t.y=n.y),r(n.width)&&n.width!==null&&(t.width=n.width),r(n.height)&&n.height!==null&&(t.height=n.height),r(n.type)&&n.type!==null&&(t.type=n.type),t}function rf(n){var t={};return n=n||{},r(n.text)&&n.text!==null&&(t.content=n.text),r(n.type)&&n.type!==null&&(t.type=n.type),r(n.from)&&n.from!==null&&(t.from=n.from),r(n.fromConnector)&&n.fromConnector!==null&&(t.fromConnector=n.fromConnector),r(n.fromX)&&n.fromX!==null&&(t.fromX=n.fromX),r(n.fromY)&&n.fromY!==null&&(t.fromY=n.fromY),r(n.to)&&n.to!==null&&(t.to=n.to),r(n.toConnector)&&n.toConnector!==null&&(t.toConnector=n.toConnector),r(n.toX)&&n.toX!==null&&(t.toX=n.toX),r(n.toY)&&n.toY!==null&&(t.toY=n.toY),t}function uf(t,i){var r=this.dataSource.reader.model,u;r&&(u=r.fn.fields.text?"text":r.idField,n("<input name='"+i.field+"' />").appendTo(t).kendoDropDownList({dataValueField:r.idField,dataTextField:u,dataSource:this.dataSource.data().toJSON(),optionLabel:" ",valuePrimitive:!0}))}function fi(n){this.dataItem=n;this.callbacks=[]}function ei(){this.items={}}function ht(n){var t=n;return n instanceof kendo.data.Model&&(t=n.toJSON(),t[n.idField]=n._defaultId),t}function rr(n){for(var r=[],u=[],t,i=0;i<n.length;i++)t=n[i],t instanceof s?u.push(t):r.push(t);return{shapes:u,connections:r}}function ct(n,t){return n.reader.model?new n.reader.model(t):new kendo.data.ObservableObject(t)}function w(n,t){r(t[n])&&t.set(n,null)}function ur(n,t,i){for(var u,f=0;f<i.length;f++)u=i[f],t&&!r(t[u])&&(t[u]=n[u])}function ff(n){var t=n.drawingContainer().clippedBBox(null);(t.origin.x!==0||t.origin.y!==0)&&n.position(-t.origin.x,-t.origin.y)}var g=kendo.dataviz,et=kendo.drawing,lt=kendo.geometry,i=g.diagram,at=kendo.ui.Widget,vt=kendo.Class,f=n.proxy,e=kendo.deepExtend,fr=n.extend,er=kendo.data.HierarchicalDataSource,or=i.Canvas,yt=i.Group,sr=i.Rectangle,hr=i.Circle,pt=i.CompositeTransform,c=i.Rect,oi=i.Path,cr=i.DeleteShapeUnit,lr=i.DeleteConnectionUnit,wt=i.TextBlock,ar=i.Image,u=i.Point,si=i.Intersect,vr=i.ConnectionEditAdorner,yr=i.UndoRedoService,hi=i.ToolService,pr=i.Selector,wr=i.ResizingAdorner,br=i.ConnectorsAdorner,kr=i.Cursors,h=i.Utils,ci=kendo.Observable,dr=i.ToBackUnit,gr=i.ToFrontUnit,nu=i.PolylineRouter,li=i.CascadingRouter,b=h.isUndefined,y=h.isDefined,r=kendo.util.defined,k=n.isArray,ot=kendo.isFunction,st=h.isString,tu=n.isPlainObject,o=Math,l=".kendoDiagram",ai="cascading",bt="itemBoundsChange",nt="change",it="click",vi="error",d="Auto",kt=9007199254740992,yi="select",dt="itemRotate",gt="pan",ni="zoomStart",pi="zoomEnd",wi="none",iu=600,ru=600,uu="rectangle",fu=100,eu=100,ou=20,su=20,bi=0,hu=Number.MAX_VALUE,cu=-Number.MAX_VALUE,lu="absolute",ki="transformed",rt="rotated",au="transparent",vu="width",yu="height",pu="x",wu="y",bu="DOMMouseScroll"+l+" mousewheel"+l,ku=.05,du=5,gu='<a class="k-button k-button-icontext #=className#" href="\\#"><span class="#=iconClass# #=imageClass#"><\/span>#=text#<\/a>',nf=5,di,p,a;i.DefaultConnectors=[{name:"Top"},{name:"Bottom"},{name:"Left"},{name:"Right"},{name:d,position:function(n){return n.getPosition("center")}}];di={cancel:{text:"Cancel",imageClass:"k-cancel",className:"k-diagram-cancel",iconClass:"k-icon"},update:{text:"Update",imageClass:"k-update",className:"k-diagram-update",iconClass:"k-icon"}};i.shapeDefaults=function(n){var t={type:uu,path:"",autoSize:!0,visual:null,x:bi,y:bi,minWidth:ou,minHeight:su,width:fu,height:eu,hover:{},editable:{connect:!0,tools:[]},connectors:i.DefaultConnectors,rotation:{angle:0}};return h.simpleExtend(t,n),t};p=ci.extend({init:function(n){var t=this;t.dataItem=(n||{}).dataItem;ci.fn.init.call(t);t.options=e({id:i.randomId()},t.options,n);t.isSelected=!1;t.visual=new yt({id:t.options.id,autoSize:t.options.autoSize});t.id=t.options.id;t._template()},options:{hover:{},cursor:kr.grip,content:{align:"center middle"},selectable:!0,serializable:!0,enable:!0},_getCursor:function(n){return this.adorner?this.adorner._getCursor(n):this.options.cursor},visible:function(n){if(b(n))return this.visual.visible();this.visual.visible(n)},bounds:function(){},refresh:function(){this.visual.redraw()},position:function(n){this.options.x=n.x;this.options.y=n.y;this.visual.position(n)},toString:function(){return this.options.id},serialize:function(){var n=e({},{options:this.options});return this.dataItem&&(n.dataItem=this.dataItem.toString()),n},_content:function(n){var r,u,f;return n!==t&&(r=this.options,i.Utils.isString(n)?r.content.text=n:e(r.content,n),u=r.content,f=this._contentVisual,f?this._updateContentVisual(u):this._createContentVisual(u)),this.options.content.text},_createContentVisual:function(n){n.text&&(this._contentVisual=new wt(n),this._contentVisual._includeInBBox=!1,this.visual.append(this._contentVisual))},_updateContentVisual:function(n){this._contentVisual.redraw(n)},_hitTest:function(n){var t=this.bounds();return this.visible()&&t.contains(n)&&this.options.enable},_template:function(){var n=this,t,i;n.options.content.template&&(t=n.dataItem||{},i=kendo.template(n.options.content.template,{paramName:"dataItem"}),n.options.content.text=i(t))},_canSelect:function(){return this.options.selectable!==!1},toJSON:function(){return{id:this.options.id}}});a=vt.extend({init:function(n,t){this.options=e({},this.options,t);this.connections=[];this.shape=n},options:{width:7,height:7,fill:{color:"Yellow"},hover:{}},position:function(){return this.options.position?this.options.position(this.shape):this.shape.getPosition(this.options.name)},toJSON:function(){return{shapeId:this.shape.toString(),connector:this.options.name}}});a.parse=function(n,t){for(var r,u=t.split(":"),f=u[0],e=u[1]||d,i=0;i<n.shapes.length;i++)if(r=n.shapes[i],r.options.id==f)return r.getConnector(e.trim())};var s=p.extend({init:function(n,t){var i=this;p.fn.init.call(i,n);this.diagram=t;this.updateOptionsFromModel();n=i.options;i.connectors=[];i.type=n.type;i.createShapeVisual();i.updateBounds();i.content(i.content());i._createConnectors()},options:i.shapeDefaults(),_setOptionsFromModel:function(n){var t=nr(n||this.dataItem);this.options=e({},this.options,t);this.redrawVisual();this.options.content&&(this._template(),this.content(this.options.content))},updateOptionsFromModel:function(n,t){var i,r;this.diagram&&this.diagram._isEditable&&(i=nr(n||this.dataItem),n&&t?g.inArray(t,["x","y","width","height"])?(r=this.bounds(),r[t]=n[t],this.bounds(r)):(this.options.visual?this.redrawVisual():i.type&&(this.options=e({},this.options,i),this.redrawVisual()),this.options.content&&(this._template(),this.content(this.options.content))):this.options=e({},this.options,i))},redrawVisual:function(){this.visual.clear();this._contentVisual=null;this.options.dataItem=this.dataItem;this.createShapeVisual();this.updateBounds()},updateModel:function(n){var u=this.diagram,i,t;u&&u._isEditable&&(i=this._bounds,t=this.dataItem,t&&(u._suspendModelRefresh(),r(t.x)&&i.x!==t.x&&t.set("x",i.x),r(t.y)&&i.y!==t.y&&t.set("y",i.y),r(t.width)&&i.width!==t.width&&t.set("width",i.width),r(t.height)&&i.height!==t.height&&t.set("height",i.height),this.dataItem=t,u._resumeModelRefresh(),n&&u._syncShapeChanges()))},updateBounds:function(){var n=this.visual._measure(!0),t=this.options;this.bounds(new c(t.x,t.y,n.width,n.height));this._rotate();this._alignContent()},content:function(n){var t=this._content(n);return this._alignContent(),t},_alignContent:function(){var t=this.options.content||{},n=this._contentVisual;if(n&&t.align){var u=this.visual._measure(),f=new i.RectAlign(u),r=n.drawingElement.bbox(null),e=new c(0,0,r.width(),r.height()),o=f.align(e,t.align);n.position(o.topLeft())}},_createConnectors:function(){for(var t=this.options,r=t.connectors.length,u=t.connectorDefaults,i,n=0;n<r;n++)i=new a(this,e({},u,t.connectors[n])),this.connectors.push(i)},bounds:function(n){var t,i;if(n)if(st(n))switch(n){case ki:t=this._transformedBounds();break;case lu:t=this._transformedBounds();i=this.diagram._pan;t.x+=i.x;t.y+=i.y;break;case rt:t=this._rotatedBounds();break;default:t=this._bounds}else this._setBounds(n),this._triggerBoundsChange(),this.diagram&&this.diagram._layouting||this.refreshConnections();else t=this._bounds;return t},_setBounds:function(n){var t=this.options,i=n.topLeft(),r=t.x=i.x,u=t.y=i.y,f=t.width=o.max(n.width,t.minWidth),e=t.height=o.max(n.height,t.minHeight);this._bounds=new c(r,u,f,e);this.visual.redraw({x:r,y:u,width:f,height:e})},position:function(n){if(n)this.bounds(new c(n.x,n.y,this._bounds.width,this._bounds.height));else return this._bounds.topLeft()},clone:function(){var n=this.serialize();return n.options.id=i.randomId(),this.diagram&&this.diagram._isEditable&&r(this.dataItem)&&(n.options.dataItem=ht(this.dataItem)),new s(n.options)},select:function(n){var t=this.diagram,i,r;return b(n)&&(n=!0),this._canSelect()&&this.isSelected!=n?(i=[],r=[],this.isSelected=n,this.isSelected?(t._selectedItems.push(this),i.push(this)):(h.remove(t._selectedItems,this),r.push(this)),t._internalSelection||t._selectionChanged(i,r),!0):void 0},rotate:function(n,r,f){var o=this.visual.rotate(),e,s,c,h;return n!==t&&(f!==!1&&this.diagram&&this.diagram.undoRedoService&&n!==o.angle&&this.diagram.undoRedoService.add(new i.RotateUnit(this.diagram._resizingAdorner,[this],[o.angle]),!1),e=this.bounds(),s=new u(e.width/2,e.height/2),r&&(c=n-o.angle,h=e.center().rotate(r,360-c).minus(s),this._rotationOffset=this._rotationOffset.plus(h.minus(e.topLeft())),this.position(h)),this.visual.rotate(n,s),this.options.rotation.angle=n,this.diagram&&this.diagram._connectorsAdorner&&this.diagram._connectorsAdorner.refresh(),this.refreshConnections(),this.diagram&&this.diagram.trigger(dt,{item:this})),o},connections:function(n){for(var i=[],u,t,f,s,e,o,r=0;r<this.connectors.length;r++)for(s=this.connectors[r],f=s.connections,u=0,f;u<f.length;u++)t=f[u],n=="out"?(e=t.source(),e.shape&&e.shape==this&&i.push(t)):n=="in"?(o=t.target(),o.shape&&o.shape==this&&i.push(t)):i.push(t);return i},refreshConnections:function(){n.each(this.connections(),function(){this.refresh()})},getConnector:function(n){var t,i;if(st(n)){for(n=n.toLocaleLowerCase(),t=0;t<this.connectors.length;t++)if(i=this.connectors[t],i.options.name.toLocaleLowerCase()==n)return i}else return n instanceof u?ti(n,this):this.connectors.length?this.connectors[0]:null},getPosition:function(n){var t=this.bounds(),i=n.charAt(0).toLowerCase()+n.slice(1);return ot(t[i])?this._transformPoint(t[i]()):t.center()},redraw:function(n){if(n){var t=this.options,i;this.shapeVisual.redraw(this._visualOptions(n));this._diffNumericOptions(n,[vu,yu,pu,wu])&&(this.bounds(new c(t.x,t.y,t.width,t.height)),i=!0);n.connectors&&(t.connectors=n.connectors,this._updateConnectors());t=e(t,n);(n.rotation||i)&&this._rotate();t.content&&this.content(t.content)}},_updateConnectors:function(){var u=this.connections(),n,t,i,r;for(this.connectors=[],this._createConnectors(),r=0;r<u.length;r++)n=u[r],t=n.source(),i=n.target(),t.shape&&t.shape===this?n.source(this.getConnector(t.options.name)||null):i.shape&&i.shape===this&&n.target(this.getConnector(i.options.name)||null),n.updateModel()},_diffNumericOptions:i.diffNumericOptions,_visualOptions:function(n){return{data:n.path,source:n.source,hover:n.hover,fill:n.fill,stroke:n.stroke}},_triggerBoundsChange:function(){this.diagram&&this.diagram.trigger(bt,{item:this,bounds:this._bounds.clone()})},_transformPoint:function(n){var t=this.rotate(),i=this.bounds(),r=i.topLeft();return t.angle&&n.rotate(t.center().plus(r),360-t.angle),n},_transformedBounds:function(){var n=this.bounds(),t=n.topLeft(),i=n.bottomRight();return c.fromPoints(this.diagram.modelToView(t),this.diagram.modelToView(i))},_rotatedBounds:function(){var n=this.bounds().rotatedBounds(this.rotate().angle),t=n.topLeft(),i=n.bottomRight();return c.fromPoints(t,i)},_rotate:function(){var n=this.options.rotation;n&&n.angle&&this.rotate(n.angle);this._rotationOffset=new u},_hover:function(n){var t=this.options,i=t.hover,r=t.stroke,u=t.fill;n&&y(i.stroke)&&(r=e({},r,i.stroke));n&&y(i.fill)&&(u=i.fill);this.shapeVisual.redraw({stroke:r,fill:u});t.editable&&t.editable.connect&&this.diagram._showConnectors(this,n)},_hitTest:function(n){if(this.visible()){var t=this.bounds(),r,i=this.rotate().angle;if(n.isEmpty&&!n.isEmpty())return si.rects(n,t,i?i:0);if(r=n.clone().rotate(t.center(),i),t.contains(r))return this}},toJSON:function(){return{shapeId:this.options.id}},createShapeVisual:function(){var t=this.options,n=this._visualOptions(t),u=t.visual,r=(t.type+"").toLocaleLowerCase(),i;n.width=t.width;n.height=t.height;ot(u)?i=u.call(this,t):n.data?(i=new oi(n),ff(i)):i=r=="rectangle"?new sr(n):r=="circle"?new hr(n):r=="text"?new wt(n):r=="image"?new ar(n):new oi(n);this.shapeVisual=i;this.visual.append(this.shapeVisual)}}),v=p.extend({init:function(n,t,f){var e=this;p.fn.init.call(e,f);this.updateOptionsFromModel();this._initRouter();e.path=new i.Polyline(e.options);e.path.fill(au);e.visual.append(e.path);e._sourcePoint=e._targetPoint=new u;e._setSource(n);e._setTarget(t);e.content(e.options.content);e.definers=[];r(f)&&f.points&&e.points(f.points)},options:{hover:{stroke:{}},startCap:wi,endCap:wi,points:[],selectable:!0,fromConnector:d,toConenctor:d},_setOptionsFromModel:function(n){this.updateOptionsFromModel(n||this.dataItem)},updateOptionsFromModel:function(n){var o,t,i,f;this.diagram&&this.diagram._isEditable&&(o=this.diagram._dataMap,t=rf(n||this.dataItem),n?(r(t.from)?(i=o[t.from],i&&r(t.fromConnector)&&(i=i.getConnector(t.fromConnector)),this.source(i)):r(t.fromX)&&r(t.fromY)&&this.source(new u(t.fromX,t.fromY)),r(t.to)?(f=o[t.to],f&&r(t.toConnector)&&(f=f.getConnector(t.toConnector)),this.target(f)):r(t.toX)&&r(t.toY)&&this.target(new u(t.toX,t.toY)),r(t.type)&&this.type()!==t.type&&(this.points([]),this.type(t.type)),this.dataItem=n,this._template(),this.redraw(this.options)):this.options=e({},t,this.options))},updateModel:function(n){if(this.diagram&&this.diagram._isEditable&&this.diagram.connectionsDataSource){var t=this.diagram.connectionsDataSource.getByUid(this.dataItem.uid);t&&(this.diagram._suspendModelRefresh(),r(this.options.fromX)&&this.options.fromX!==null?(w("from",t),w("fromConnector",t),t.set("fromX",this.options.fromX),t.set("fromY",this.options.fromY)):(t.set("from",this.options.from),r(t.fromConnector)&&t.set("fromConnector",this.sourceConnector?this.sourceConnector.options.name:null),w("fromX",t),w("fromY",t)),r(this.options.toX)&&this.options.toX!==null?(w("to",t),w("toConnector",t),t.set("toX",this.options.toX),t.set("toY",this.options.toY)):(t.set("to",this.options.to),r(t.toConnector)&&t.set("toConnector",this.targetConnector?this.targetConnector.options.name:null),w("toX",t),w("toY",t)),r(this.options.type)&&r(t.type)&&t.set("type",this.options.type),this.dataItem=t,this.diagram._resumeModelRefresh(),n&&this.diagram._syncConnectionChanges())}},sourcePoint:function(){return this._resolvedSourceConnector?this._resolvedSourceConnector.position():this._sourcePoint},_setSource:function(n){var r=n instanceof s,f=this.options.fromConnector||d,i;(!r||n.getConnector(f))&&(n!==t&&(this.from=n),this._removeFromSourceConnector(),n===null?this.sourceConnector&&(this._sourcePoint=(this._resolvedSourceConnector||this.sourceConnector).position(),this._clearSourceConnector(),this._setFromOptions(null,this._sourcePoint)):n instanceof a?(i=n.shape.dataItem,i&&this._setFromOptions(i.id),this.sourceConnector=n,this.sourceConnector.connections.push(this)):n instanceof u?(this._setFromOptions(null,n),this._sourcePoint=n,this.sourceConnector&&this._clearSourceConnector()):r&&(i=n.dataItem,i&&this._setFromOptions(i.id),this.sourceConnector=n.getConnector(f),this.sourceConnector.connections.push(this)))},source:function(n,t){return y(n)&&(t&&this.diagram&&this.diagram.undoRedoService.addCompositeItem(new i.ConnectionEditUnit(this,n)),this._setSource(n),this.refresh()),this.sourceConnector?this.sourceConnector:this._sourcePoint},_setFromOptions:function(n,t){this.options.from=n;t?(this.options.fromX=t.x,this.options.fromY=t.y):(this.options.fromX=null,this.options.fromY=null)},sourceDefiner:function(n){if(n)if(n instanceof i.PathDefiner)n.left=null,this._sourceDefiner=n,this.source(n.point);else throw"The sourceDefiner needs to be a PathDefiner.";else return this._sourceDefiner||(this._sourceDefiner=new i.PathDefiner(this.sourcePoint(),null,null)),this._sourceDefiner},targetPoint:function(){return this._resolvedTargetConnector?this._resolvedTargetConnector.position():this._targetPoint},_setTarget:function(n){var r=n instanceof s,f=this.options.toConnector||d,i;(!r||n.getConnector(f))&&(n!==t&&(this.to=n),this._removeFromTargetConnector(),n===null?this.targetConnector&&(this._targetPoint=(this._resolvedTargetConnector||this.targetConnector).position(),this._clearTargetConnector(),this._setToOptions(null,this._targetPoint)):n instanceof a?(i=n.shape.dataItem,i&&this._setToOptions(i.id),this.targetConnector=n,this.targetConnector.connections.push(this)):n instanceof u?(this._setToOptions(null,n),this._targetPoint=n,this.targetConnector&&this._clearTargetConnector()):r&&(i=n.dataItem,i&&this._setToOptions(i.id),this.targetConnector=n.getConnector(f),this.targetConnector.connections.push(this)))},target:function(n,r){return y(n)&&(r&&this.diagram&&this.diagram.undoRedoService.addCompositeItem(new i.ConnectionEditUnit(this,t,n)),this._setTarget(n),this.refresh()),this.targetConnector?this.targetConnector:this._targetPoint},_setToOptions:function(n,t){this.options.to=n;t?(this.options.toX=t.x,this.options.toY=t.y):(this.options.toX=null,this.options.toY=null)},targetDefiner:function(n){if(n)if(n instanceof i.PathDefiner)n.right=null,this._targetDefiner=n,this.target(n.point);else throw"The sourceDefiner needs to be a PathDefiner.";else return this._targetDefiner||(this._targetDefiner=new i.PathDefiner(this.targetPoint(),null,null)),this._targetDefiner},_updateConnectors:function(){this._updateConnector(this.source(),"source");this._updateConnector(this.target(),"target")},_updateConnector:function(n,t){var r=this,i=r.diagram,f;if(n instanceof a&&!i.getShapeById(n.shape.id)){var u=n.shape.dataItem,o=n.options.name,e=function(){var f=i._dataMap[u.id];n=f.getConnector(o);r[t](n,!1);r.updateModel()};i._dataMap[u.id]?e():(f=i._inactiveShapeItems.getByUid(u.uid),f&&i._deferredConnectionUpdates.push(f.onActivate(e)))}else r[t](n,!1)},content:function(n){var t=this._content(n);return r(n)&&this._alignContent(),t},_createContentVisual:function(n){var t;return ot(n.visual)?t=n.visual.call(this,n):n.text&&(t=new wt(n)),t&&(this._contentVisual=t,t._includeInBBox=!1,this.visual.append(t)),t},_updateContentVisual:function(n){ot(n.visual)?(this.visual.remove(this._contentVisual),this._createContentVisual(n)):this._contentVisual.redraw(n)},_alignContent:function(){var n,f,a,w,b;if(this._contentVisual){for(var e=nf,i=this.allPoints(),h=o.floor(i.length/2),c=h-1;c>0&&i[c].equals(i[h]);)c--,h++;var r=i[h],t=i[c],l=this._contentVisual._measure(),v=l.width,s=l.height,y=i.length%2==0,p=t.distanceTo(r);y&&i.length>2&&p>0&&(t.y===r.y&&p<v||t.x===r.x&&p<s)&&(y=!1,e=0);y?(f=kendo.util.deg(o.atan2(r.y-t.y,r.x-t.x)),n=new u((r.x-t.x)/2+t.x,(r.y-t.y)/2+t.y),o.abs(f)===90?(n.x+=e,n.y-=s/2):f%180==0?(n.x-=v/2,n.y-=s+e):f<-90||0<f&&f<90?n.y-=s:(f<0||f>90)&&(n.x-=v,n.y-=s)):(a=o.floor(i.length/2),n=i[a].clone(),t=i[a-1],r=i[a+1],w=t.x<=n.x&&r.x<=n.x?e:-l.width-e,b=t.y<=n.y&&r.y<=n.y?e:-l.height-e,n.x+=w,n.y+=b);this._contentVisual.position(n)}},select:function(n){var i=this.diagram,r,u;if(this._canSelect()&&this.isSelected!==n)return this.isSelected=n,r=[],u=[],this.isSelected?(this.adorner=new vr(this,this.options.selection),i._adorn(this.adorner,!0),i._selectedItems.push(this),r.push(this)):this.adorner&&(i._adorn(this.adorner,!1),h.remove(i._selectedItems,this),this.adorner=t,u.push(this)),this.adorner&&this.adorner.refresh(),i._internalSelection||i._selectionChanged(r,u),!0},bounds:function(n){if(n&&!st(n))this._bounds=n;else return this._bounds},type:function(n){var t=this.options;if(n)n!==t.type&&(t.type=n,this._initRouter(),this.refresh());else return t.type},_initRouter:function(){var n=(this.options.type||"").toLowerCase();this._router=n==ai?new li(this):new nu(this)},points:function(n){var r,t,e,f;if(n)for(this.definers=[],r=0;r<n.length;r++)if(t=n[r],t instanceof i.Point)this.definers.push(new i.PathDefiner(t));else if(t.hasOwnProperty("x")&&t.hasOwnProperty("y"))this.definers.push(new i.PathDefiner(new u(t.x,t.y)));else throw"A Connection point needs to be a Point or an object with x and y properties.";else{if(e=[],y(this.definers))for(f=0;f<this.definers.length;f++)e.push(this.definers[f].point);return e}},allPoints:function(){var t=[this.sourcePoint()],n;if(this.definers)for(n=0;n<this.definers.length;n++)t.push(this.definers[n].point);return t.push(this.targetPoint()),t},refresh:function(){this._resolveConnectors();this._refreshPath();this._alignContent();this.adorner&&this.adorner.refresh()},_resolveConnectors:function(){var i=this,f,e,n=i.source(),t=i.target(),o,r;n instanceof u?f=n:n instanceof a&&(ut(n)?o=n.shape:(i._resolvedSourceConnector=n,f=n.position()));t instanceof u?e=t:t instanceof a&&(ut(t)?r=t.shape:(i._resolvedTargetConnector=t,e=t.position()));f?r&&(i._resolvedTargetConnector=ti(f,r)):o&&(e?i._resolvedSourceConnector=ti(e,o):r&&this._resolveAutoConnectors(o,r))},_resolveAutoConnectors:function(n,t){for(var y=kt,p=kt,w=n.connectors,s,h,b,c,l,a,v,i,r,e,u,f=0;f<w.length;f++)if(i=w[f],!ut(i))for(c=i.position(),s=t.connectors,e=0;e<s.length;e++)r=s[e],ut(r)||(l=r.position(),u=o.round(c.distanceTo(l)),u<y&&this.diagram&&this._testRoutePoints(c,l,i,r)&&(y=u,h=i,b=r),u<p&&(a=i,v=r,p=u));h&&(a=h,v=b);this._resolvedSourceConnector=a;this._resolvedTargetConnector=v},_testRoutePoints:function(n,t,i,r){var l=this._router,a=!0,f,e,s,u,h;if(l instanceof li)for(f=l.routePoints(n,t,i,r),f.unshift(n),f.push(t),h=1;h<f.length;h++)if(e=f[h-1],s=f[h],u=new c(o.min(e.x,s.x),o.min(e.y,s.y),o.abs(e.x-s.x),o.abs(e.y-s.y)),u.width>0&&(u.x++,u.width-=2),u.height>0&&(u.y++,u.height-=2),!u.isEmpty()&&this.diagram._shapesQuadTree.hitTestRect(u)){a=!1;break}return a},redraw:function(n){if(n){this.options=e({},this.options,n);var t=this.options.points;r(t)&&t.length>0&&(this.points(t),this._refreshPath());(n&&n.content||n.text)&&this.content(n.content);this.path.redraw({fill:n.fill,stroke:n.stroke,startCap:n.startCap,endCap:n.endCap})}},clone:function(){var n=this.serialize();return this.diagram&&this.diagram._isEditable&&r(this.dataItem)&&(n.options.dataItem=ht(this.dataItem)),new v(this.from,this.to,n.options)},serialize:function(){var t=this.from.toJSON?this.from.toJSON:this.from.toString(),i=this.to.toJSON?this.to.toJSON:this.to.toString(),n=e({},{options:this.options,from:t,to:i});return r(this.dataItem)&&(n.dataItem=this.dataItem.toString()),n.options.points=this.points(),n},_hitTest:function(n){if(this.visible()){var t=new u(n.x,n.y),i=this.sourcePoint(),r=this.targetPoint();if(n.isEmpty&&!n.isEmpty()&&n.contains(i)&&n.contains(r)||this._router.hitTest(t))return this}},_hover:function(n){var t=(this.options.stroke||{}).color;n&&y(this.options.hover.stroke.color)&&(t=this.options.hover.stroke.color);this.path.redraw({stroke:{color:t}})},_refreshPath:function(){r(this.path)&&(this._drawPath(),this.bounds(this._router.getBounds()))},_drawPath:function(){this._router&&this._router.route();var n=this.sourcePoint(),t=this.targetPoint(),i=this.points();this.path.redraw({points:[n].concat(i,[t])})},_clearSourceConnector:function(){this.sourceConnector=t;this._resolvedSourceConnector=t},_clearTargetConnector:function(){this.targetConnector=t;this._resolvedTargetConnector=t},_removeFromSourceConnector:function(){this.sourceConnector&&h.remove(this.sourceConnector.connections,this)},_removeFromTargetConnector:function(){this.targetConnector&&h.remove(this.targetConnector.connections,this)},toJSON:function(){var n=this,i,r,t;return n.from&&n.from.toJSON?i=n.from.toJSON():(t=n._sourcePoint,i={x:t.x,y:t.y}),n.to&&n.to.toJSON?r=n.to.toJSON():(t=n._targetPoint,r={x:t.x,y:t.y}),{from:i,to:r}}}),ii=at.extend({init:function(n,t){var i=this;kendo.destroy(n);at.fn.init.call(i,n,t);i._initTheme();i._initElements();i._extendLayoutOptions(i.options);i._initDefaults(t);i._initCanvas();i.mainLayer=new yt({id:"main-layer"});i.canvas.append(i.mainLayer);i._shapesQuadTree=new ir(i);i._pan=new u;i._adorners=[];i.adornerLayer=new yt({id:"adorner-layer"});i.canvas.append(i.adornerLayer);i._createHandlers();i._initialize();i._fetchFreshData();i._createGlobalToolBar();i._resizingAdorner=new wr(i,{editable:i.options.editable});i._connectorsAdorner=new br(i);i._adorn(i._resizingAdorner,!0);i._adorn(i._connectorsAdorner,!0);i.selector=new pr(i);i._clipboard=[];i.pauseMouseHandlers=!1;i._createOptionElements();i.zoom(i.options.zoom);i.canvas.draw()},options:{name:"Diagram",theme:"default",layout:"",zoomRate:.1,zoom:1,zoomMin:0,zoomMax:2,dataSource:{},draggable:!0,template:"",autoBind:!0,editable:{rotate:{},resize:{},text:!0,tools:[],drag:{snap:{size:10,angle:10}},remove:!0},pannable:{key:"ctrl"},selectable:{key:"none"},tooltip:{enabled:!0,format:"{0}"},copy:{enabled:!0,offsetX:20,offsetY:20},shapeDefaults:i.shapeDefaults({undoable:!0}),connectionDefaults:{editable:{tools:[]},type:ai},shapes:[],connections:[]},events:[pi,ni,gt,yi,dt,bt,nt,it,"mouseEnter","mouseLeave","toolBarClick","save","cancel","edit","remove","add","dataBound","dragStart","drag","dragEnd"],items:function(){return n()},_createGlobalToolBar:function(){var t=this.options.editable,n;t&&(n=t.tools,this._isEditable&&n!==!1&&(!n||n.length===0)&&(n=["createShape","undo","redo","rotateClockwise","rotateAnticlockwise"]),n&&n.length&&(this.toolBar=new ri(this,{tools:n||{},click:f(this._toolBarClick,this),modal:!1}),this.toolBar.element.css({textAlign:"left"}),this.element.prepend(this.toolBar.element),this._resize()))},createShape:function(){var r;if(this.editor&&this.editor.end()||!this.editor){var n=this.dataSource,u=n.view()||[],f=u.length,t=ct(n,{}),i=this._createShape(t,{});this.trigger("add",{shape:i})||(n.insert(f,t),r=this._inactiveShapeItems.getByUid(t.uid),r.element=i,this.edit(i))}},_createShape:function(n,t){t=e({},this.options.shapeDefaults,t);t.dataItem=n;return new s(t,this)},createConnection:function(){if(this.editor&&this.editor.end()||!this.editor){var t=this.connectionsDataSource,r=t.view()||[],u=r.length,i=ct(t,{}),n=this._createConnection(i);this.trigger("add",{connection:n})||(this._connectionsDataMap[i.uid]=n,t.insert(u,i),this.addConnection(n,!1),this.edit(n))}},_createConnection:function(n,t,i){var r=e({},this.options.connectionDefaults);return r.dataItem=n,new v(t||new u,i||new u,r)},editModel:function(n,t){var r,u,i,o;if(this.cancelEdit(),i=this.options.editable,t=="shape")r=i.shapeEditors,u=i.shapeTemplate;else if(t=="connection")o=f(uf,this),r=e({},{from:o,to:o},i.connectionEditors),u=i.connectionTemplate;else return;this.editor=new tr(this.element,{update:f(this._update,this),cancel:f(this._cancel,this),model:n,type:t,target:this,editors:r,template:u});this.trigger("edit",this._editArgs())},edit:function(n){if(n.dataItem){var t=n instanceof s?"shape":"connection";this.editModel(n.dataItem,t)}},cancelEdit:function(){this.editor&&(this._getEditDataSource().cancelChanges(this.editor.model),this._destroyEditor())},saveEdit:function(){this.editor&&this.editor.end()&&!this.trigger("save",this._editArgs())&&this._getEditDataSource().sync()},_update:function(){this.editor&&this.editor.end()&&!this.trigger("save",this._editArgs())&&(this._getEditDataSource().sync(),this._destroyEditor())},_cancel:function(){var n,t;this.editor&&!this.trigger("cancel",this._editArgs())&&(n=this.editor.model,this._getEditDataSource().cancelChanges(n),t=this._connectionsDataMap[n.uid]||this._dataMap[n.id],t&&t._setOptionsFromModel(n),this._destroyEditor())},_getEditDataSource:function(){return this.editor.options.type==="shape"?this.dataSource:this.connectionsDataSource},_editArgs:function(){var n={container:this.editor.wrapper};return n[this.editor.options.type]=this.editor.model,n},_destroyEditor:function(){this.editor&&(this.editor.close(),this.editor=null)},_initElements:function(){this.wrapper=this.element.empty().css("position","relative").attr("tabindex",0).addClass("k-widget k-diagram");this.scrollable=n("<div />").appendTo(this.element)},_initDefaults:function(n){var t=this.options,i=t.editable,u=t.shapeDefaults,f=t.connectionDefaults,r=(n||{}).shapeDefaults;i===!1?(u.editable=!1,f.editable=!1):(ur(i,u.editable,["drag","remove","connect"]),ur(i,f.editable,["drag","remove"]));r&&r.connectors&&(t.shapeDefaults.connectors=r.connectors)},_initCanvas:function(){var i=n("<div class='k-layer'><\/div>").appendTo(this.scrollable)[0],t=this.viewport();this.canvas=new or(i,{width:t.width||iu,height:t.height||ru})},_createHandlers:function(){var n=this,t=n.element;t.on(bu,f(n._wheel,n));if(kendo.support.touch||kendo.support.mobileOS)n._userEvents=new kendo.UserEvents(t,{multiTouch:!0,tap:f(n._tap,n)}),n._userEvents.bind(["gesturestart","gesturechange","gestureend"],{gesturestart:f(n._gestureStart,n),gesturechange:f(n._gestureChange,n),gestureend:f(n._gestureEnd,n)}),n.toolService=new hi(n),n.options.pannable!==!1&&n.scroller.enable();else{n.toolService=new hi(n);this.scroller.wrapper.on("mousemove"+l,f(n._mouseMove,n)).on("mouseup"+l,f(n._mouseUp,n)).on("mousedown"+l,f(n._mouseDown,n)).on("mouseover"+l,f(n._mouseover,n)).on("mouseout"+l,f(n._mouseout,n));t.on("keydown"+l,f(n._keydown,n))}this._syncHandler=f(n._syncChanges,n);n._resizeHandler=f(n.resize,n,!1);kendo.onResize(n._resizeHandler);this.bind(ni,f(n._destroyToolBar,n));this.bind(gt,f(n._destroyToolBar,n))},_tap:function(n){var i=this.toolService,r=this._caculateMobilePosition(n),t;i._updateHoveredItem(r);i.hoveredItem&&(t=i.hoveredItem,this.options.selectable!==!1&&(this._destroyToolBar(),t.isSelected?t.select(!1):this.select(t,{addToSelection:!0}),this._createToolBar()),this.trigger("click",{item:t,point:r}))},_caculateMobilePosition:function(n){return this.documentToModel(u(n.x.location,n.y.location))},_gestureStart:function(n){this._destroyToolBar();this.scroller.disable();var t=this.documentToModel(new u(n.center.x,n.center.y)),i={point:t,zoom:this.zoom()};this.trigger(ni,i)||(this._gesture=n,this._initialCenter=t)},_gestureChange:function(n){var s=this._gesture,h=this._initialCenter,c=this.documentToView(new u(n.center.x,n.center.y)),r=n.distance/s.distance,t=this._zoom,f=!1,e,i;o.abs(r-1)>=ku&&(this._zoom=t=this._getValidZoom(t*r),this.options.zoom=t,this._gesture=n,f=!0);e=h.times(t);i=c.minus(e);(f||this._pan.distanceTo(i)>=du)&&(this._panTransform(i),this._updateAdorners());n.preventDefault()},_gestureEnd:function(){this.options.pannable!==!1&&this.scroller.enable();this.trigger(pi,{point:this._initialCenter,zoom:this.zoom()})},_resize:function(){var n=this.viewport();this.canvas&&this.canvas.size(n);this.scrollable&&this.toolBar&&this.scrollable.height(n.height)},_mouseover:function(n){var t=n.target._kendoNode;t&&t.srcElement._hover&&t.srcElement._hover(!0,t.srcElement)},_mouseout:function(n){var t=n.target._kendoNode;t&&t.srcElement._hover&&t.srcElement._hover(!1,t.srcElement)},_initTheme:function(){var n=this,i=g.ui.themes||{},r=((n.options||{}).theme||"").toLowerCase(),t=(i[r]||{}).diagram;n.options=e({},t,n.options);n.options.editable===!0&&e(n.options,{editable:(t||{}).editable})},_createOptionElements:function(){var n=this.options,t=n.shapes.length;t&&this._createShapes();n.connections.length&&this._createConnections();t&&n.layout&&this.layout(n.layout)},_createShapes:function(){for(var t=this,u=t.options,i=u.shapes,r,n=0;n<i.length;n++)r=i[n],t.addShape(r)},_createConnections:function(){for(var n=this,r=n.options,s=r.connectionDefaults,u=r.connections,t,f,o,i=0;i<u.length;i++)t=u[i],f=n._findConnectionTarget(t.from),o=n._findConnectionTarget(t.to),n.connect(f,o,e({},s,t))},_findConnectionTarget:function(n){var r=this,i=st(n)?n:n.shapeId||n.id,t;return i?(t=r.getShapeById(i),n.connector&&(t=t.getConnector(n.connector))):t=new u(n.x||0,n.y||0),t},destroy:function(){var n=this;at.fn.destroy.call(n);this._userEvents&&this._userEvents.destroy();kendo.unbindResize(n._resizeHandler);n.clear();n.element.off(l);n.scroller.wrapper.off(l);n.canvas.destroy(!0);n.canvas=t;n._destroyEditor();n.destroyScroller();n._destroyGlobalToolBar();n._destroyToolBar()},destroyScroller:function(){var n=this.scroller;n&&(n.destroy(),n.element.remove(),this.scroller=null)},save:function(){for(var t={shapes:[],connections:[]},i,r,n=0;n<this.shapes.length;n++)r=this.shapes[n],r.options.serializable&&t.shapes.push(r.options);for(n=0;n<this.connections.length;n++)i=this.connections[n],t.connections.push(e({},i.options,i.toJSON()));return t},focus:function(){if(!this.element.is(kendo._activeElement())){var r=this.element,n=r[0],i=[],u=[],f=document.documentElement,t;do n=n.parentNode,n.scrollHeight>n.clientHeight&&(i.push(n),u.push(n.scrollTop));while(n!=f);for(r.focus(),t=0;t<i.length;t++)i[t].scrollTop=u[t]}},load:function(n){this.clear();this.setOptions(n);this._createShapes();this._createConnections()},setOptions:function(n){e(this.options,n)},clear:function(){var n=this;n.select(!1);n.mainLayer.clear();n._shapesQuadTree.clear();n._initialize()},connect:function(n,t,i){var r,u;return this.connectionsDataSource&&this._isEditable?(u=this.connectionsDataSource.add({}),r=this._connectionsDataMap[u.uid],r.source(n),r.target(t),r.redraw(i),r.updateModel()):(r=new v(n,t,e({},this.options.connectionDefaults,i)),this.addConnection(r)),r},connected:function(n,t){for(var r,i=0;i<this.connections.length;i++)if(r=this.connections[i],r.from==n&&r.to==t)return!0;return!1},addConnection:function(n,t){return t!==!1&&this.undoRedoService.add(new i.AddConnectionUnit(n,this),!1),n.diagram=this,n._setOptionsFromModel(),n.refresh(),this.mainLayer.append(n.visual),this.connections.push(n),this.trigger(nt,{added:[n],removed:[]}),n},_addConnection:function(n,t){var r=this.connectionsDataSource,i;if(r&&this._isEditable){if(i=ct(r,ht(n.dataItem)),n.dataItem=i,n.updateModel(),!this.trigger("add",{connection:n}))return this._connectionsDataMap[i.uid]=n,r.add(i),this.addConnection(n,t),n._updateConnectors(),n}else if(!this.trigger("add",{connection:n}))return this.addConnection(n,t),n._updateConnectors(),n},addShape:function(n,t){var r,u=this.options.shapeDefaults;if(n instanceof s)r=n;else{if(n instanceof kendo.Class)return;u=e({},u,n||{});r=new s(u,this)}return t!==!1&&this.undoRedoService.add(new i.AddShapeUnit(r,this),!1),this.shapes.push(r),r.diagram!==this&&(this._shapesQuadTree.insert(r),r.diagram=this),this.mainLayer.append(r.visual),this.trigger(nt,{added:[r],removed:[]}),r},_addShape:function(n,t){var f=this,u=f.dataSource,i,r;if(u&&this._isEditable){if(i=ct(u,ht(n.dataItem)),n.dataItem=i,n.updateModel(),!this.trigger("add",{shape:n}))return this.dataSource.add(i),r=this._inactiveShapeItems.getByUid(i.uid),r.element=n,r.undoable=t,n}else if(!this.trigger("add",{shape:n}))return this.addShape(n,t)},remove:function(n,t){n=k(n)?n.slice(0):[n];var f=rr(n),e=f.shapes,u=f.connections,i;for(r(t)||(t=!0),t&&this.undoRedoService.begin(),this._suspendModelRefresh(),i=e.length-1;i>=0;i--)this._removeItem(e[i],t,u);for(i=u.length-1;i>=0;i--)this._removeItem(u[i],t);this._resumeModelRefresh();t&&this.undoRedoService.commit(!1);this.trigger(nt,{added:[],removed:n})},_removeShapeDataItem:function(n){this._isEditable&&(this.dataSource.remove(n.dataItem),delete this._dataMap[n.dataItem.id])},_removeConnectionDataItem:function(n){this._isEditable&&(this.connectionsDataSource.remove(n.dataItem),delete this._connectionsDataMap[n.dataItem.uid])},_triggerRemove:function(n){for(var u=[],t,f,i,r=0;r<n.length;r++)t=n[r],i=t.options.editable,f=t instanceof s?{shape:t}:{connection:t},i&&i.remove!==!1&&!this.trigger("remove",f)&&u.push(t);return u},undo:function(){this.undoRedoService.undo()},redo:function(){this.undoRedoService.redo()},select:function(n,t){if(y(n)){t=e({addToSelection:!1},t);var o=t.addToSelection,i=[],f=[],r,u;for(o||this.deselect(),this._internalSelection=!0,n instanceof Array?i=n:n instanceof p&&(i=[n]),r=0;r<i.length;r++)u=i[r],u.select(!0)&&f.push(u);this._selectionChanged(f,[]);this._internalSelection=!1}else return this._selectedItems},selectAll:function(){this.select(this.shapes.concat(this.connections))},selectArea:function(n){var i,r,t,u;if(this._internalSelection=!0,u=[],n instanceof c)for(r=this.shapes.concat(this.connections),i=0;i<r.length;i++)t=r[i],(!n||t._hitTest(n))&&t.options.enable&&t.select(!0)&&u.push(t);this._selectionChanged(u,[]);this._internalSelection=!1},deselect:function(n){this._internalSelection=!0;var u=[],t=[],r,i;for(n instanceof Array?t=n:n instanceof p?t.push(n):y(n)||(t=this._selectedItems.slice(0)),i=0;i<t.length;i++)r=t[i],r.select(!1)&&u.push(r);this._selectionChanged([],u);this._internalSelection=!1},toFront:function(n,t){var i,u,f;n||(n=this._selectedItems.slice());i=this._getDiagramItems(n);!r(t)||t?(u=gi(this.mainLayer,i.visuals),f=new gr(this,n,u),this.undoRedoService.add(f)):(this.mainLayer.toFront(i.visuals),this._fixOrdering(i,!0))},toBack:function(n,t){var i,u,f;n||(n=this._selectedItems.slice());i=this._getDiagramItems(n);!r(t)||t?(u=gi(this.mainLayer,i.visuals),f=new dr(this,n,u),this.undoRedoService.add(f)):(this.mainLayer.toBack(i.visuals),this._fixOrdering(i,!1))},bringIntoView:function(n,t){var u=this.viewport(),l=new i.RectAlign(u),s,r,f,h;u.width!==0&&u.height!==0&&(t=e({animate:!1,align:"center middle"},t),t.align=="none"&&(t.align="center middle"),n instanceof p?r=n.bounds(ki):k(n)?r=this.boundingBox(n):n instanceof c&&(r=n.clone()),f=r.clone(),r.zoom(this._zoom),(r.width>u.width||r.height>u.height)&&(this._zoom=this._getValidZoom(o.min(u.width/f.width,u.height/f.height)),r=f.clone().zoom(this._zoom)),this._zoomMainLayer(),s=r.clone(),l.align(r,t.align),h=r.topLeft().minus(s.topLeft()),this.pan(h.times(-1),t.animate))},alignShapes:function(n){var e,r,t,f,h,c,l;if(b(n)&&(n="Left"),e=this.select(),e.length!==0){switch(n.toLowerCase()){case"left":case"top":r=hu;break;case"right":case"bottom":r=cu}for(f=0;f<e.length;f++)if(t=e[f],t instanceof s)switch(n.toLowerCase()){case"left":r=o.min(r,t.options.x);break;case"top":r=o.min(r,t.options.y);break;case"right":r=o.max(r,t.options.x);break;case"bottom":r=o.max(r,t.options.y)}for(h=[],c=[],f=0;f<e.length;f++)if(t=e[f],t instanceof s){c.push(t);h.push(t.bounds());switch(n.toLowerCase()){case"left":case"right":t.position(new u(r,t.options.y));break;case"top":case"bottom":t.position(new u(t.options.x,r))}}l=new i.TransformUnit(c,h);this.undoRedoService.add(l,!1)}},zoom:function(n,t){var r;if(n){if(r=t?t.point:new i.Point(0,0),n=this._zoom=this._getValidZoom(n),!b(r)){r=new i.Point(o.round(r.x),o.round(r.y));var f=r.times(n),e=this.modelToView(r),u=e.minus(f);this._storePan(new i.Point(o.round(u.x),o.round(u.y)))}t&&(t.zoom=n);this._panTransform();this._updateAdorners()}return this._zoom},_getPan:function(n){var t=this.canvas;return t.translate||(n=n.plus(this._pan)),n},pan:function(n,t){if(n instanceof u){var i=this,r=i.scroller;n=i._getPan(n);n=n.times(-1);t?r.animatedScrollTo(n.x,n.y,function(){i._updateAdorners()}):(r.scrollTo(n.x,n.y),i._updateAdorners())}},viewport:function(){var n=this.element,i=n.width(),t=n.height();return this.toolBar&&(t-=this.toolBar.element.outerHeight()),new c(0,0,i,t)},copy:function(){var n,t;if(this.options.copy.enabled)for(this._clipboard=[],this._copyOffset=1,n=0;n<this._selectedItems.length;n++)t=this._selectedItems[n],this._clipboard.push(t)},cut:function(){var n,t;if(this.options.copy.enabled){for(this._clipboard=[],this._copyOffset=0,n=0;n<this._selectedItems.length;n++)t=this._selectedItems[n],this._clipboard.push(t);this.remove(this._clipboard,!0)}},paste:function(){if(this._clipboard.length>0){var t,n,i,f={},e=rr(this._clipboard),o=e.connections,s=e.shapes,r={x:this._copyOffset*this.options.copy.offsetX,y:this._copyOffset*this.options.copy.offsetY};for(this.deselect(),i=0;i<s.length;i++)t=s[i],n=t.clone(),f[t.id]=n,n.position(new u(t.options.x+r.x,t.options.y+r.y)),n.diagram=this,n=this._addShape(n),n&&n.select();for(i=0;i<o.length;i++)t=o[i],n=this._addConnection(t.clone()),n&&(this._updateCopiedConnection(n,t,"source",f,r),this._updateCopiedConnection(n,t,"target",f,r),n.select(!0),n.updateModel());this._syncChanges();this._copyOffset+=1}},_updateCopiedConnection:function(n,t,i,r,f){var c,h,e,o=t[i](),s=this;o instanceof a&&r[o.shape.id]?(e=r[o.shape.id],s.getShapeById(e.id)?n[i](e.getConnector(o.options.name)):(h=s._inactiveShapeItems.getByUid(e.dataItem.uid),h&&(c=function(t){e=s._dataMap[t.id];n[i](e.getConnector(o.options.name));n.updateModel()},s._deferredConnectionUpdates.push(h.onActivate(c))))):n[i](new u(t[i+"Point"]().x+f.x,t[i+"Point"]().y+f.y))},boundingBox:function(n,t){var r=c.empty(),u,f=y(n)?this._getDiagramItems(n):{shapes:this.shapes},i,e;if(f.shapes.length>0)for(i=f.shapes[0],r=i.bounds(rt),e=1;e<f.shapes.length;e++)i=f.shapes[e],u=i.bounds(rt),t===!0&&(u.x-=i._rotationOffset.x,u.y-=i._rotationOffset.y),r=r.union(u);return r},_containerOffset:function(){var n=this.element.offset();return this.toolBar&&(n.top+=this.toolBar.element.outerHeight()),n},documentToView:function(n){var t=this._containerOffset();return new u(n.x-t.left,n.y-t.top)},viewToDocument:function(n){var t=this._containerOffset();return new u(n.x+t.left,n.y+t.top)},viewToModel:function(n){return this._transformWithMatrix(n,this._matrixInvert)},modelToView:function(n){return this._transformWithMatrix(n,this._matrix)},modelToLayer:function(n){return this._transformWithMatrix(n,this._layerMatrix)},layerToModel:function(n){return this._transformWithMatrix(n,this._layerMatrixInvert)},documentToModel:function(n){var t=this.documentToView(n);return this.canvas.translate||(t.x=t.x+this.scroller.scrollLeft,t.y=t.y+this.scroller.scrollTop),this.viewToModel(t)},modelToDocument:function(n){return this.viewToDocument(this.modelToView(n))},_transformWithMatrix:function(n,t){var i=n,r,f;return n instanceof u?t&&(i=t.apply(n)):(r=this._transformWithMatrix(n.topLeft(),t),f=this._transformWithMatrix(n.bottomRight(),t),i=c.fromPoints(r,f)),i},setDataSource:function(n){this.options.dataSource=n;this._dataSource();this.options.autoBind&&this.dataSource.fetch()},setConnectionsDataSource:function(n){this.options.connectionsDataSource=n;this._connectionDataSource();this.options.autoBind&&this.connectionsDataSource.fetch()},layout:function(n){var r,t,f,u,e;this._layouting=!0;b(n)&&(n=this.options.layout);r=b(n)||b(n.type)?"Tree":n.type;switch(r.toLowerCase()){case"tree":t=new i.TreeLayout(this);break;case"layered":t=new i.LayeredLayout(this);break;case"forcedirected":case"force":case"spring":case"springembedder":t=new i.SpringLayout(this);break;default:throw"Layout algorithm '"+r+"' is not supported.";}f=new i.LayoutState(this);u=t.layout(n);u&&(e=new i.LayoutUndoUnit(f,u,n?n.animate:null),this.undoRedoService.add(e));this._layouting=!1;this._redrawConnections()},getShapeById:function(n){var t;return(t=h.first(this.shapes,function(t){return t.visual.id===n}),t)?t:h.first(this.connections,function(t){return t.visual.id===n})},_extendLayoutOptions:function(n){n.layout&&(n.layout=e(i.LayoutBase.fn.defaultOptions||{},n.layout))},_selectionChanged:function(n,t){(n.length||t.length)&&this.trigger(yi,{selected:n,deselected:t})},_getValidZoom:function(n){return o.min(o.max(n,this.options.zoomMin),this.options.zoomMax)},_panTransform:function(n){var t=this,i=n||t._pan;t.canvas.translate?(t.scroller.scrollTo(i.x,i.y),t._zoomMainLayer()):(t._storePan(i),t._transformMainLayer())},_finishPan:function(){this.trigger(gt,{total:this._pan,delta:Number.NaN})},_storePan:function(n){this._pan=n;this._storeViewMatrix()},_zoomMainLayer:function(){var n=this._zoom,t=new pt(0,0,n,n);t.render(this.mainLayer);this._storeLayerMatrix(t);this._storeViewMatrix()},_transformMainLayer:function(){var n=this._pan,t=this._zoom,i=new pt(n.x,n.y,t,t);i.render(this.mainLayer);this._storeLayerMatrix(i);this._storeViewMatrix()},_storeLayerMatrix:function(n){this._layerMatrix=n.toMatrix();this._layerMatrixInvert=n.invert().toMatrix()},_storeViewMatrix:function(){var n=this._pan,t=this._zoom,i=new pt(n.x,n.y,t,t);this._matrix=i.toMatrix();this._matrixInvert=i.invert().toMatrix()},_toIndex:function(n,t){var i=this._getDiagramItems(n);this.mainLayer.toIndex(i.visuals,t);this._fixOrdering(i,!1)},_fixOrdering:function(n,t){for(var u=t?this.shapes.length-1:0,f=t?this.connections.length-1:0,r,i=0;i<n.shapes.length;i++)r=n.shapes[i],h.remove(this.shapes,r),h.insert(this.shapes,r,u);for(i=0;i<n.cons.length;i++)r=n.cons[i],h.remove(this.connections,r),h.insert(this.connections,r,f)},_getDiagramItems:function(n){var r,t={},u=n,i;for(t.visuals=[],t.shapes=[],t.cons=[],n?k(n)||(u=[n]):u=this._selectedItems.slice(),r=0;r<u.length;r++)i=u[r],i instanceof s?(t.shapes.push(i),t.visuals.push(i.visual)):i instanceof v&&(t.cons.push(i),t.visuals.push(i.visual));return t},_removeItem:function(n,t,i){n.select(!1);n instanceof s?(this._removeShapeDataItem(n),this._removeShape(n,t,i)):n instanceof v&&(this._removeConnectionDataItem(n),this._removeConnection(n,t));this.mainLayer.remove(n.visual)},_removeShape:function(n,t,i){var r,u,f,e=[],o=[],s;for(this.toolService._removeHover(),t&&this.undoRedoService.addCompositeItem(new cr(n)),h.remove(this.shapes,n),this._shapesQuadTree.remove(n),r=0;r<n.connectors.length;r++)for(f=n.connectors[r],s=0;s<f.connections.length;s++)u=f.connections[s],i&&g.inArray(u,i)||(u.sourceConnector==f?e.push(u):u.targetConnector==f&&o.push(u));for(r=0;r<e.length;r++)e[r].source(null,t),e[r].updateModel();for(r=0;r<o.length;r++)o[r].target(null,t),o[r].updateModel()},_removeConnection:function(n,t){n.sourceConnector&&h.remove(n.sourceConnector.connections,n);n.targetConnector&&h.remove(n.targetConnector.connections,n);t&&this.undoRedoService.addCompositeItem(new lr(n));h.remove(this.connections,n)},_removeDataItems:function(n,t){var i,f,r,u;for(n=k(n)?n:[n];n.length;)if(i=n.shift(),r=this._dataMap[i.uid],r&&(this._removeShapeConnections(r),this._removeItem(r,!1),delete this._dataMap[i.uid],t&&i.hasChildren&&i.loaded()))for(f=i.children.data(),u=0;u<f.length;u++)n.push(f[u])},_removeShapeConnections:function(n){var i=n.connections(),t;if(i)for(t=0;t<i.length;t++)this._removeItem(i[t],!1)},_addDataItem:function(n,t){var i,u;if(r(n))return(i=this._dataMap[n.id],i)?i:(u=e({},this.options.shapeDefaults),u.dataItem=n,i=new s(u,this),this.addShape(i,t!==!1),this._dataMap[n.id]=i,i)},_addDataItemByUid:function(n){var t,i;if(r(n))return(t=this._dataMap[n.uid],t)?t:(i=e({},this.options.shapeDefaults),i.dataItem=n,t=new s(i,this),this.addShape(t),this._dataMap[n.uid]=t,t)},_addDataItems:function(n,t){for(var f,u,r,e,i=0;i<n.length;i++)f=n[i],u=this._addDataItemByUid(f),r=this._addDataItemByUid(t),r&&!this.connected(r,u)&&(e=this.connect(r,u))},_refreshSource:function(n){var r=this,e=n.node,t=n.action,u=n.items,o=r.options,i,f;if(!n.field){if(t=="remove")this._removeDataItems(n.items,!0);else for(t&&t!=="itemloaded"||this._bindingRoots||(this._bindingRoots=!0,f=!0),t||e||r.clear(),this._addDataItems(u,e),i=0;i<u.length;i++)u[i].load();o.layout&&(f||t=="remove"||t=="add")&&r.layout(o.layout);f&&(this.trigger("dataBound"),this._bindingRoots=!1)}},_mouseDown:function(n){var t=this._calculatePosition(n);n.which==1&&this.toolService.start(t,this._meta(n))&&(this._destroyToolBar(),n.preventDefault())},_addItem:function(n){n instanceof s?this.addShape(n):n instanceof v&&this.addConnection(n)},_mouseUp:function(n){var t=this._calculatePosition(n);n.which==1&&this.toolService.end(t,this._meta(n))&&(this._createToolBar(),n.preventDefault())},_createToolBar:function(){var c=this.toolService.diagram,t,r,i,l,n,a,y,e,h;this.singleToolBar||c.select().length!==1||(t=c.select()[0],t&&t.options.editable!==!1&&(r=t.options.editable,i=r.tools,this._isEditable&&i.length===0&&(t instanceof s?i=["edit","rotateClockwise","rotateAnticlockwise"]:t instanceof v&&(i=["edit"]),r&&r.remove!==!1&&i.push("delete")),i&&i.length&&(l=20,this.singleToolBar=new ri(c,{tools:i,click:f(this._toolBarClick,this),modal:!0}),a=this.singleToolBar._popup.element.outerWidth(),y=this.singleToolBar._popup.element.outerHeight(),t instanceof s?(e=this.modelToView(t.bounds(rt)),n=u(e.x,e.y).minus(u((a-e.width)/2,y+l))):t instanceof v&&(h=this.modelToView(t.bounds()),n=u(h.x,h.y).minus(u((a-h.width-20)/2,y+l))),n?(this.canvas.translate||(n=n.minus(u(this.scroller.scrollLeft,this.scroller.scrollTop))),n=this.viewToDocument(n),n=u(o.max(n.x,0),o.max(n.y,0)),this.singleToolBar.showAt(n)):this._destroyToolBar())))},_toolBarClick:function(n){this.trigger("toolBarClick",n);this._destroyToolBar()},_mouseMove:function(n){if(!this.pauseMouseHandlers){var t=this._calculatePosition(n);(n.which===0||n.which==1)&&this.toolService.move(t,this._meta(n))&&n.preventDefault()}},_keydown:function(n){this.toolService.keyDown(n.keyCode,this._meta(n))&&n.preventDefault()},_wheel:function(n){var t=tf(n),i=this._calculatePosition(n),r=e(this._meta(n),{delta:t});this.toolService.wheel(i,r)&&n.preventDefault()},_meta:function(n){return{ctrlKey:n.ctrlKey,metaKey:n.metaKey,altKey:n.altKey,shiftKey:n.shiftKey}},_calculatePosition:function(n){var i=n.pageX===t?n.originalEvent:n,r=new u(i.pageX,i.pageY);return this.documentToModel(r)},_normalizePointZoom:function(n){return n.times(1/this.zoom())},_initialize:function(){this.shapes=[];this._selectedItems=[];this.connections=[];this._dataMap={};this._connectionsDataMap={};this._inactiveShapeItems=new ei;this._deferredConnectionUpdates=[];this.undoRedoService=new yr({undone:this._syncHandler,redone:this._syncHandler});this.id=i.randomId()},_fetchFreshData:function(){var n=this;n._dataSource();n._isEditable&&n._connectionDataSource();n.options.autoBind&&(n._isEditable?(this._loadingShapes=!0,this._loadingConnections=!0,n.dataSource.fetch(),n.connectionsDataSource.fetch()):n.dataSource.fetch())},_dataSource:function(){if(r(this.options.connectionsDataSource)){this._isEditable=!0;var n=this.options.dataSource||{},t=k(n)?{data:n}:n;this.dataSource&&this._shapesRefreshHandler?this.dataSource.unbind("change",this._shapesRefreshHandler).unbind("requestStart",this._shapesRequestStartHandler).unbind("error",this._shapesErrorHandler):(this._shapesRefreshHandler=f(this._refreshShapes,this),this._shapesRequestStartHandler=f(this._shapesRequestStart,this),this._shapesErrorHandler=f(this._error,this));this.dataSource=kendo.data.DataSource.create(t).bind("change",this._shapesRefreshHandler).bind("requestStart",this._shapesRequestStartHandler).bind("error",this._shapesErrorHandler)}else this._treeDataSource(),this._isEditable=!1},_connectionDataSource:function(){var n=this.options.connectionsDataSource,t;n&&(t=k(n)?{data:n}:n,this.connectionsDataSource&&this._connectionsRefreshHandler?this.connectionsDataSource.unbind("change",this._connectionsRefreshHandler).unbind("requestStart",this._connectionsRequestStartHandler).unbind("error",this._connectionsErrorHandler):(this._connectionsRefreshHandler=f(this._refreshConnections,this),this._connectionsRequestStartHandler=f(this._connectionsRequestStart,this),this._connectionsErrorHandler=f(this._connectionsError,this)),this.connectionsDataSource=kendo.data.DataSource.create(t).bind("change",this._connectionsRefreshHandler).bind("requestStart",this._connectionsRequestStartHandler).bind("error",this._connectionsErrorHandler))},_shapesRequestStart:function(n){n.type=="read"&&(this._loadingShapes=!0)},_connectionsRequestStart:function(n){n.type=="read"&&(this._loadingConnections=!0)},_error:function(){this._loadingShapes=!1},_connectionsError:function(){this._loadingConnections=!1},_refreshShapes:function(n){n.action==="remove"?this._shouldRefresh()&&this._removeShapes(n.items):n.action==="itemchange"?this._shouldRefresh()&&this._updateShapes(n.items,n.field):n.action==="add"?this._inactiveShapeItems.add(n.items):n.action==="sync"?this._syncShapes(n.items):this.refresh()},_shouldRefresh:function(){return!this._suspended},_suspendModelRefresh:function(){this._suspended=(this._suspended||0)+1},_resumeModelRefresh:function(){this._suspended=o.max((this._suspended||0)-1,0)},refresh:function(){this._loadingShapes=!1;this._loadingConnections||this._rebindShapesAndConnections()},_rebindShapesAndConnections:function(){this.clear();this._addShapes(this.dataSource.view());this.connectionsDataSource&&this._addConnections(this.connectionsDataSource.view(),!1);this.options.layout?this.layout(this.options.layout):this._redrawConnections();this.trigger("dataBound")},refreshConnections:function(){this._loadingConnections=!1;this._loadingShapes||this._rebindShapesAndConnections()},_redrawConnections:function(){for(var t=this.connections,n=0;n<t.length;n++)t[n].refresh()},_removeShapes:function(n){for(var r=this._dataMap,t,i=0;i<n.length;i++)t=n[i],r[t.id]&&(this.remove(r[t.id],!1),r[t.id]=null)},_syncShapes:function(){var n=this,t=n._inactiveShapeItems;t.forEach(function(i){var r=i.dataItem,u=i.element;r.isNew()||(u?(u._setOptionsFromModel(),n.addShape(u,i.undoable),n._dataMap[r.id]=u):n._addDataItem(r),i.activate(),t.remove(r))})},_updateShapes:function(n,t){for(var r,u,i=0;i<n.length;i++)r=n[i],u=this._dataMap[r.id],u&&u.updateOptionsFromModel(r,t)},_addShapes:function(n){for(var t=0;t<n.length;t++)this._addDataItem(n[t],!1)},_refreshConnections:function(n){n.action==="remove"?this._shouldRefresh()&&this._removeConnections(n.items):n.action==="add"?this._addConnections(n.items):n.action==="sync"||(n.action==="itemchange"?this._shouldRefresh()&&this._updateConnections(n.items):this.refreshConnections())},_removeConnections:function(n){for(var t=0;t<n.length;t++)this.remove(this._connectionsDataMap[n[t].uid],!1),this._connectionsDataMap[n[t].uid]=null},_updateConnections:function(n){for(var i,r,t=0;t<n.length;t++)i=n[t],r=this._connectionsDataMap[i.uid],r.updateOptionsFromModel(i)},_addConnections:function(n,t){for(var r,u=n.length,i=0;i<u;i++)r=n[i],this._addConnectionDataItem(r,t)},_addConnectionDataItem:function(n,t){var i,f,o,s;this._connectionsDataMap[n.uid]||(i=this._validateConnector(n.from),r(i)&&i!==null||(i=new u(n.fromX,n.fromY)),f=this._validateConnector(n.to),r(f)&&f!==null||(f=new u(n.toX,n.toY)),r(i)&&r(f)&&(o=e({},this.options.connectionDefaults),o.dataItem=n,s=new v(i,f,o),this._connectionsDataMap[n.uid]=s,this.addConnection(s,t)))},_validateConnector:function(n){var t;return r(n)&&n!==null&&(t=this._dataMap[n]),t},_treeDataSource:function(){var n=this,i=n.options,t=i.dataSource;t=k(t)?{data:t}:t;t.fields||(t.fields=[{field:"text"},{field:"url"},{field:"spriteCssClass"},{field:"imageUrl"}]);n.dataSource&&n._refreshHandler&&n._unbindDataSource();n._refreshHandler=f(n._refreshSource,n);n._errorHandler=f(n._error,n);n.dataSource=er.create(t).bind(nt,n._refreshHandler).bind(vi,n._errorHandler)},_unbindDataSource:function(){var n=this;n.dataSource.unbind(nt,n._refreshHandler).unbind(vi,n._errorHandler)},_adorn:function(n,i){i!==t&&n&&(i?(this._adorners.push(n),this.adornerLayer.append(n.visual)):(h.remove(this._adorners,n),this.adornerLayer.remove(n.visual)))},_showConnectors:function(n,t){t?this._connectorsAdorner.show(n):this._connectorsAdorner.destroy()},_updateAdorners:function(){for(var n,i=this._adorners,t=0;t<i.length;t++)n=i[t],n.refreshBounds&&n.refreshBounds(),n.refresh()},_refresh:function(){for(var n=0;n<this.connections.length;n++)this.connections[n].refresh()},_destroyToolBar:function(){this.singleToolBar&&(this.singleToolBar.hide(),this.singleToolBar.destroy(),this.singleToolBar=null)},_destroyGlobalToolBar:function(){this.toolBar&&(this.toolBar.hide(),this.toolBar.destroy(),this.toolBar=null)},exportDOMVisual:function(){var n=this.canvas._viewBox,r=lt.transform().translate(-n.x,-n.y),u=new lt.Rect([0,0],[n.width,n.height]),f=et.Path.fromRect(u),t=new et.Group({transform:r}),i=new et.Group({clip:f}),e=this.canvas.drawingElement.children[0];return i.append(t),t.children.push(e),i},exportVisual:function(){var t=lt.transform().scale(1/this._zoom),n=new et.Group({transform:t}),i=this.mainLayer.drawingElement;return n.children.push(i),n},_syncChanges:function(){this._syncShapeChanges();this._syncConnectionChanges()},_syncShapeChanges:function(){this.dataSource&&this._isEditable&&this.dataSource.sync()},_syncConnectionChanges:function(){var t=this;t.connectionsDataSource&&t._isEditable&&(n.when.apply(n,t._deferredConnectionUpdates).then(function(){t.connectionsDataSource.sync()}),t.deferredConnectionUpdates=[])}});g.ExportMixin.extend(ii.fn,!0);kendo.PDFMixin&&kendo.PDFMixin.extend(ii.fn);var ri=kendo.Observable.extend({init:function(n,t){kendo.Observable.fn.init.call(this);this.diagram=n;this.options=e({},this.options,t);this._tools=[];this.createToolBar();this.createTools();this.appendTools();this.options.modal&&this.createPopup();this.bind(this.events,t)},events:["click"],createPopup:function(){this.container=n("<div/>").append(this.element);this._popup=this.container.kendoPopup({}).getKendoPopup()},appendTools:function(){for(var n,t=0;t<this._tools.length;t++)n=this._tools[t],(n.buttons&&n.buttons.length||!r(n.buttons))&&this._toolBar.add(n)},createToolBar:function(){this.element=n("<div/>");this._toolBar=this.element.kendoToolBar({click:f(this.click,this),resizable:!1}).getKendoToolBar();this.element.css("border","none")},createTools:function(){for(var n=0;n<this.options.tools.length;n++)this.createTool(this.options.tools[n])},createTool:function(n){var t=(tu(n)?n.name:n)+"Tool";this[t]?this[t](n):this._tools.push(n)},showAt:function(n){this._popup&&this._popup.open(n.x,n.y)},hide:function(){this._popup&&this._popup.close()},newGroup:function(){return{type:"buttonGroup",buttons:[]}},editTool:function(){this._tools.push({spriteCssClass:"k-icon k-i-pencil",showText:"overflow",type:"button",text:"Edit",attributes:this._setAttributes({action:"edit"})})},deleteTool:function(){this._tools.push({spriteCssClass:"k-icon k-i-close",showText:"overflow",type:"button",text:"Delete",attributes:this._setAttributes({action:"delete"})})},rotateAnticlockwiseTool:function(n){this._appendGroup("rotate");this._rotateGroup.buttons.push({spriteCssClass:"k-icon k-i-rotateccw",showText:"overflow",text:"RotateAnticlockwise",group:"rotate",attributes:this._setAttributes({action:"rotateAnticlockwise",step:n.step})})},rotateClockwiseTool:function(n){this._appendGroup("rotate");this._rotateGroup.buttons.push({spriteCssClass:"k-icon k-i-rotatecw",attributes:this._setAttributes({action:"rotateClockwise",step:n.step}),showText:"overflow",text:"RotateClockwise",group:"rotate"})},createShapeTool:function(){this._appendGroup("create");this._createGroup.buttons.push({spriteCssClass:"k-icon k-i-shape",showText:"overflow",text:"CreateShape",group:"create",attributes:this._setAttributes({action:"createShape"})})},createConnectionTool:function(){this._appendGroup("create");this._createGroup.buttons.push({spriteCssClass:"k-icon k-i-connector",showText:"overflow",text:"CreateConnection",group:"create",attributes:this._setAttributes({action:"createConnection"})})},undoTool:function(){this._appendGroup("history");this._historyGroup.buttons.push({spriteCssClass:"k-icon k-i-undo",showText:"overflow",text:"Undo",group:"history",attributes:this._setAttributes({action:"undo"})})},redoTool:function(){this._appendGroup("history");this._historyGroup.buttons.push({spriteCssClass:"k-icon k-i-redo",showText:"overflow",text:"Redo",group:"history",attributes:this._setAttributes({action:"redo"})})},_appendGroup:function(n){var t="_"+n+"Group";this[t]||(this[t]=this.newGroup(),this._tools.push(this[t]))},_setAttributes:function(n){var t={};return n.action&&(t[kendo.attr("action")]=n.action),n.step&&(t[kendo.attr("step")]=n.step),t},_getAttributes:function(n){var t={},r=n.attr(kendo.attr("action")),i;return r&&(t.action=r),i=n.attr(kendo.attr("step")),i&&(t.step=i),t},click:function(t){var r=this._getAttributes(n(t.target)),i=r.action;i&&this[i](r);this.trigger("click",this.eventData(i))},eventData:function(n){var t=this.selectedElements(),i=[],r=[];return t instanceof s?i.push(t):r.push(t),{shapes:i,connections:r,action:n}},"delete":function(){var t=this.diagram,n=t._triggerRemove(this.selectedElements());n.length&&(this.diagram.remove(n,!0),this.diagram._syncChanges())},edit:function(){this.diagram.edit(this.selectedElements()[0])},rotateClockwise:function(n){var t=parseFloat(n.step||90);this._rotate(t)},rotateAnticlockwise:function(n){var t=parseFloat(n.step||90);this._rotate(-t)},_rotate:function(n){var t=this.diagram._resizingAdorner;t.angle(t.angle()+n);t.rotate()},selectedElements:function(){return this.diagram.select()},createShape:function(){this.diagram.createShape()},createConnection:function(){this.diagram.createConnection()},undo:function(){this.diagram.undo()},redo:function(){this.diagram.redo()},destroy:function(){this.diagram=null;this.element=null;this.options=null;this._toolBar&&this._toolBar.destroy();this._popup&&this._popup.destroy()}}),ui=kendo.Observable.extend({init:function(n,t){kendo.Observable.fn.init.call(this);this.options=fr(!0,{},this.options,t);this.element=n;this.model=this.options.model;this.fields=this._getFields();this._initContainer();this.createEditable()},options:{editors:{}},_initContainer:function(){this.wrapper=this.element},createEditable:function(){var n=this.options;this.editable=new kendo.ui.Editable(this.wrapper,{fields:this.fields,target:n.target,clearContainer:!1,model:this.model})},_isEditable:function(n){return this.model.editable&&this.model.editable(n)},_getFields:function(){var r=[],u=this.model.fields,n,t,i;for(n in u)t={},this._isEditable(n)&&(i=this.options.editors[n],i&&(t.editor=i),t.field=n,r.push(t));return r},end:function(){return this.editable.end()},destroy:function(){this.editable.destroy();this.editable.element.find("["+kendo.attr("container-for")+"]").empty();this.model=this.wrapper=this.element=this.columns=this.editable=null}}),tr=ui.extend({init:function(n,t){ui.fn.init.call(this,n,t);this.bind(this.events,this.options);this.open()},events:["update","cancel"],options:{window:{modal:!0,resizable:!1,draggable:!0,title:"Edit",visible:!1}},_initContainer:function(){var i=this,t;this.wrapper=n('<div class="k-popup-edit-form"/>').attr(kendo.attr("uid"),this.model.uid);t="";this.options.template?(t+=this._renderTemplate(),this.fields=[]):t+=this._renderFields();t+=this._renderButtons();this.wrapper.append(n('<div class="k-edit-form-container"/>').append(t));this.window=new kendo.ui.Window(this.wrapper.appendTo(this.element),this.options.window);this.window.bind("close",function(n){n.userTriggered&&(n.sender.element.focus(),i._cancelClick(n))});this._attachButtonEvents()},_renderTemplate:function(){var n=this.options.template;return typeof n=="string"&&(n=window.unescape(n)),kendo.template(n)(this.model)},_renderFields:function(){for(var n,t="",i=0;i<this.fields.length;i++)n=this.fields[i],t+='<div class="k-edit-label"><label for="'+n.field+'">'+(n.field||"")+"<\/label><\/div>",this._isEditable(n.field)&&(t+="<div "+kendo.attr("container-for")+'="'+n.field+'" class="k-edit-field"><\/div>');return t},_renderButtons:function(){var n='<div class="k-edit-buttons k-state-default">';return n+=this._createButton("update"),n+=this._createButton("cancel"),n+"<\/div>"},_createButton:function(n){return kendo.template(gu)(di[n])},_attachButtonEvents:function(){this._cancelClickHandler=f(this._cancelClick,this);this.window.element.on(it+l,"a.k-diagram-cancel",this._cancelClickHandler);this._updateClickHandler=f(this._updateClick,this);this.window.element.on(it+l,"a.k-diagram-update",this._updateClickHandler)},_updateClick:function(n){n.preventDefault();this.trigger("update")},_cancelClick:function(n){n.preventDefault();this.trigger("cancel")},open:function(){this.window.center().open()},close:function(){this.window.bind("deactivate",f(this.destroy,this)).close()},destroy:function(){this.window.close().destroy();this.window.element.off(it+l,"a.k-diagram-cancel",this._cancelClickHandler);this.window.element.off(it+l,"a.k-diagram-update",this._updateClickHandler);this._cancelClickHandler=null;this._editUpdateClickHandler=null;this.window=null;ui.fn.destroy.call(this)}});fi.fn=fi.prototype={onActivate:function(t){var i=n.Deferred();return this.callbacks.push({callback:t,deferred:i}),i},activate:function(){for(var i=this.callbacks,n,t=0;t<i.length;t++)n=this.callbacks[t],n.callback(this.dataItem),n.deferred.resolve();this.callbacks=[]}};ei.fn=ei.prototype={add:function(n){for(var t=0;t<n.length;t++)this.items[n[t].uid]=new fi(n[t])},forEach:function(n){for(var t in this.items)n(this.items[t])},getByUid:function(n){return this.items[n]},remove:function(n){delete this.items[n.uid]}};var ft=vt.extend({init:function(){this.shapes=[]},_add:function(n,t){this.shapes.push({bounds:t,shape:n});n._quadNode=this},insert:function(n,t){this._add(n,t)},remove:function(n){for(var i=this.shapes,r=i.length,t=0;t<r;t++)if(i[t].shape===n){i.splice(t,1);break}},hitTestRect:function(n){for(var i=this.shapes,r=i.length,t=0;t<r;t++)if(this._testRect(i[t].shape,n))return!0},_testRect:function(n,t){var i=n.rotate().angle,r=n.bounds();return i?si.rects(t,r,-i):r.overlaps(t)}}),tt=ft.extend({init:function(n){ft.fn.init.call(this);this.children=[];this.rect=n},inBounds:function(n){var t=this.rect,i=t.bottomRight(),r=n.bottomRight();return t.x<=n.x&&t.y<=n.y&&r.x<=i.x&&r.y<=i.y},overlapsBounds:function(n){return this.rect.overlaps(n)},insert:function(n,t){var i=!1,u=this.children,f=u.length,r;if(this.inBounds(t)){if(!f&&this.shapes.length<4)this._add(n,t);else{for(f||this._initChildren(),r=0;r<u.length;r++)if(u[r].insert(n,t)){i=!0;break}i||this._add(n,t)}i=!0}return i},_initChildren:function(){var n=this.rect,o=this.children,i=this.shapes,r=n.center(),u=n.width/2,f=n.height/2,e,t;for(o.push(new tt(new c(n.x,n.y,u,f)),new tt(new c(r.x,n.y,u,f)),new tt(new c(n.x,r.y,u,f)),new tt(new c(r.x,r.y,u,f))),t=i.length-1;t>=0;t--)for(e=0;e<o.length;e++)if(o[e].insert(i[t].shape,i[t].bounds)){i.splice(t,1);break}},hitTestRect:function(n){var t,r=this.children,u=r.length,i=!1;if(this.overlapsBounds(n))if(ft.fn.hitTestRect.call(this,n))i=!0;else for(t=0;t<u;t++)if(r[t].hitTestRect(n)){i=!0;break}return i}}),ir=vt.extend({ROOT_SIZE:1e3,init:function(n){var t=f(this._boundsChange,this);n.bind(bt,t);n.bind(dt,t);this.initRoots()},initRoots:function(){this.rootMap={};this.root=new ft},clear:function(){this.initRoots()},_boundsChange:function(n){n.item._quadNode&&n.item._quadNode.remove(n.item);this.insert(n.item)},insert:function(n){var u=n.bounds(rt),i=this.ROOT_SIZE,f=this.getSectors(u),t=f[0][0],r=f[1][0];this.inRoot(f)?this.root.insert(n,u):(this.rootMap[t]||(this.rootMap[t]={}),this.rootMap[t][r]||(this.rootMap[t][r]=new tt(new c(t*i,r*i,i,i))),this.rootMap[t][r].insert(n,u))},remove:function(n){n._quadNode&&n._quadNode.remove(n)},inRoot:function(n){return n[0].length>1||n[1].length>1},getSectors:function(n){for(var i,t=this.ROOT_SIZE,f=n.bottomRight(),e=o.floor(f.x/t),s=o.floor(f.y/t),r=[[],[]],u=o.floor(n.x/t);u<=e;u++)r[0].push(u);for(i=o.floor(n.y/t);i<=s;i++)r[1].push(i);return r},hitTestRect:function(n){var t=this.getSectors(n),i,r,f,e,u;if(this.root.hitTestRect(n))return!0;for(i=0;i<t[0].length;i++)for(f=t[0][i],r=0;r<t[1].length;r++)if(e=t[1][r],u=(this.rootMap[f]||{})[e],u&&u.hitTestRect(n))return!0;return!1}});g.ui.plugin(ii);e(i,{Shape:s,Connection:v,Connector:a,DiagramToolBar:ri,QuadNode:tt,QuadRoot:ft,ShapesQuadTree:ir,PopupEditor:tr})})(window.kendo.jQuery)}(),function(){}(),function(){(function(n,t){function y(n,t){if(t===null)return t;var i=ot(n,!0);return i(t)}function u(n){return typeof n!==ct}function vt(n,t,i){var f=w(n),e=w(t),o=d(n)-d(t)<0,u=[],r,s;for(u.push(n),r=0;r<i;r++)s={r:p(f.r,e.r,r,i,o),g:p(f.g,e.g,r,i,o),b:p(f.b,e.b,r,i,o)},u.push(yt(s));return u.push(t),u}function p(n,t,i,u,f){var e=r.min(r.abs(n),r.abs(t)),o=r.max(r.abs(n),r.abs(t)),h=(o-e)/(u+1),s=h*(i+1);return f?e+s:o-s}function yt(n){return"#"+b(n.r)+b(n.g)+b(n.b)}function w(n){n=n.replace("#","");var t=pt(n);return{r:k(t.r),g:k(t.g),b:k(t.b)}}function b(n){var t=r.round(n).toString(16).toUpperCase();return t.length===1&&(t="0"+t),t}function pt(n){var i=n.length,t={};return i===3?(t.r=n[0],t.g=n[1],t.b=n[2]):(t.r=n.substring(0,2),t.g=n.substring(2,4),t.b=n.substring(4,6)),t}function k(n){return parseInt(n.toString(16),16)}function d(n){var t=0;return n&&(n=w(n),t=r.sqrt(.241*n.r*n.r+.691*n.g*n.g+.068*n.b*n.b)),t}function s(n){var t=r.pow(10,4);return r.round(n*t)/t}var r=Math,h=n.proxy,ft=n.isArray,i=window.kendo,c=i.Class,e=i.ui.Widget,et=i.template,f=i.deepExtend,g=i.data.HierarchicalDataSource,ot=i.getter,l=i.dataviz,a=".kendoTreeMap",o="change",nt="dataBound",v="itemCreated",tt=Number.MAX_VALUE,st="mouseover"+a,ht="mouseleave"+a,ct="undefined",lt=e.extend({init:function(t,r){i.destroy(t);n(t).empty();e.fn.init.call(this,t,r);this.wrapper=this.element;this._initTheme(this.options);this.element.addClass("k-widget k-treemap");this._setLayout();this._originalOptions=f({},this.options);this._initDataSource();this._attachEvents();i.notify(this,l.ui)},options:{name:"TreeMap",theme:"default",autoBind:!0,textField:"text",valueField:"value",colorField:"color"},events:[nt,v],_initTheme:function(n){var t=this,i=l.ui.themes||{},r=((n||{}).theme||"").toLowerCase(),u=(i[r]||{}).treeMap;t.options=f({},u,n)},_attachEvents:function(){this.element.on(st,h(this._mouseover,this)).on(ht,h(this._mouseleave,this))},_setLayout:function(){this.options.type==="horizontal"?(this._layout=new rt(!1),this._view=new ut(this,this.options)):this.options.type==="vertical"?(this._layout=new rt(!0),this._view=new ut(this,this.options)):(this._layout=new at,this._view=new it(this,this.options))},_initDataSource:function(){var n=this,i=n.options,t=i.dataSource;n._dataChangeHandler=h(n._onDataChange,n);n.dataSource=g.create(t).bind(o,n._dataChangeHandler);t&&n.options.autoBind&&n.dataSource.fetch()},setDataSource:function(n){var t=this;t.dataSource.unbind(o,t._dataChangeHandler);t.dataSource=n.bind(o,t._dataChangeHandler);n&&t.options.autoBind&&t.dataSource.fetch()},_onDataChange:function(n){var e=n.node,t=n.items,s=this.options,f,r,u,o;if(e){if(t.length){for(u=this._getByUid(e.uid),u.children=[],t=new i.data.Query(t)._sortForGrouping(s.valueField,"desc"),r=0;r<t.length;r++)f=t[r],u.children.push(this._wrapItem(f));o=this._view.htmlSize(u);this._layout.compute(u.children,u.coord,o);this._setColors(u.children);this._view.render(u)}}else this.element.empty(),f=this._wrapItem(t[0]),this._layout.createRoot(f,this.element.outerWidth(),this.element.outerHeight(),this.options.type==="vertical"),this._view.createRoot(f),this._root=f,this._colorIdx=0;for(r=0;r<t.length;r++)t[r].load();e&&this.trigger(nt,{node:e})},_setColors:function(n){var o=this.options.colors,s=this._colorIdx,i=o[s%o.length],f,r,e,t;for(ft(i)&&(f=vt(i[0],i[1],n.length)),e=!1,t=0;t<n.length;t++)r=n[t],u(r.color)||(r.color=f?f[t]:i),r.dataItem.hasChildren||(e=!0);e&&this._colorIdx++},_contentSize:function(n){this.view.renderHeight(n)},_wrapItem:function(n){var t={};return u(this.options.valueField)&&(t.value=y(this.options.valueField,n)),u(this.options.colorField)&&(t.color=y(this.options.colorField,n)),u(this.options.textField)&&(t.text=y(this.options.textField,n)),t.level=n.level(),t.dataItem=n,t},_getByUid:function(n){for(var i=[this._root],t;i.length;){if(t=i.pop(),t.dataItem.uid===n)return t;t.children&&(i=i.concat(t.children))}},dataItem:function(t){var u=n(t).attr(i.attr("uid")),r=this.dataSource;return r&&r.getByUid(u)},findByUid:function(n){return this.element.find(".k-treemap-tile["+i.attr("uid")+"='"+n+"']")},_mouseover:function(t){var i=n(t.target);i.hasClass("k-leaf")&&(this._removeActiveState(),i.removeClass("k-state-hover").addClass("k-state-hover"))},_removeActiveState:function(){this.element.find(".k-state-hover").removeClass("k-state-hover")},_mouseleave:function(){this._removeActiveState()},destroy:function(){e.fn.destroy.call(this);this.element.off(a);this.dataSource&&this.dataSource.unbind(o,this._dataChangeHandler);this._root=null;i.destroy(this.element)},items:function(){return n()},getSize:function(){return i.dimensions(this.element)},_resize:function(){this.dataSource.fetch()},setOptions:function(n){var i=n.dataSource;n.dataSource=t;this._originalOptions=f(this._originalOptions,n);this.options=f({},this._originalOptions);this._setLayout();this._initTheme(this.options);e.fn._setEvents.call(this,n);i&&this.setDataSource(g.create(i));this.options.autoBind&&this.dataSource.fetch()}}),at=c.extend({createRoot:function(n,t,i){n.coord={width:t,height:i,top:0,left:0}},leaf:function(n){return!n.children},layoutChildren:function(n,t){for(var f=t.width*t.height,u=0,r=[],i=0;i<n.length;i++)r[i]=parseFloat(n[i].value),u+=r[i];for(i=0;i<r.length;i++)n[i].area=f*r[i]/u;var e=this.layoutHorizontal()?t.height:t.width,o=[n[0]],s=n.slice(1);this.squarify(s,o,e,t)},squarify:function(n,t,i,r){this.computeDim(n,t,i,r)},computeDim:function(n,t,i,r){var e,u,f;if(n.length+t.length==1){e=n.length==1?n:t;this.layoutLast(e,i,r);return}if(n.length>=2&&t.length===0&&(t=[n[0]],n=n.slice(1)),n.length===0){t.length>0&&this.layoutRow(t,i,r);return}u=n[0];this.worstAspectRatio(t,i)>=this.worstAspectRatio([u].concat(t),i)?this.computeDim(n.slice(1),t.concat([u]),i,r):(f=this.layoutRow(t,i,r),this.computeDim(n,[],f.dim,f))},layoutLast:function(n,t,i){n[0].coord=i},layoutRow:function(n,t,i){return this.layoutHorizontal()?this.layoutV(n,t,i):this.layoutH(n,t,i)},orientation:"h",layoutVertical:function(){return this.orientation==="v"},layoutHorizontal:function(){return this.orientation==="h"},layoutChange:function(){this.orientation=this.layoutVertical()?"h":"v"},worstAspectRatio:function(n,t){var o,i;if(!n||n.length===0)return tt;var u=0,f=0,e=tt;for(o=0;o<n.length;o++)i=n[o].area,u+=i,e=e<i?e:i,f=f>i?f:i;return r.max(t*t*f/(u*u),u*u/(t*t*e))},compute:function(n,t,i){if(t.width>=t.height&&this.layoutHorizontal()||this.layoutChange(),n&&n.length>0){var r={width:t.width,height:t.height-i.text,top:0,left:0};this.layoutChildren(n,r)}},layoutV:function(n,t,i){var h=this._totalArea(n),o=0,f,e,u;for(t=s(h/t),f=0;f<n.length;f++)e=s(n[f].area/t),n[f].coord={height:e,width:t,top:i.top+o,left:i.left},o+=e;return u={height:i.height,width:i.width-t,top:i.top,left:i.left+t},u.dim=r.min(u.width,u.height),u.dim!=u.height&&this.layoutChange(),u},layoutH:function(n,t,i){for(var u,h=this._totalArea(n),e=s(h/t),c=i.top,o=0,f=0;f<n.length;f++)n[f].coord={height:e,width:s(n[f].area/e),top:c,left:i.left+o},o+=n[f].coord.width;return u={height:i.height-e,width:i.width,top:i.top+e,left:i.left},u.dim=r.min(u.width,u.height),u.dim!=u.width&&this.layoutChange(),u},_totalArea:function(n){for(var i=0,t=0;t<n.length;t++)i+=n[t].area;return i}}),it=c.extend({init:function(t,i){this.options=f({},this.options,i);this.treeMap=t;this.element=n(t.element);this.offset=0},htmlSize:function(n){var t=this._getByUid(n.dataItem.uid),r={text:0},u,i;return n.children&&(this._clean(t),u=this._getText(n),u&&(i=this._createTitle(n),t.append(i),r.text=i.height()),t.append(this._createWrap()),this.offset=(t.outerWidth()-t.innerWidth())/2),r},_getByUid:function(n){return this.element.find(".k-treemap-tile["+i.attr("uid")+"='"+n+"']")},render:function(n){var e=this._getByUid(n.dataItem.uid),i=n.children,u,t,f,r;if(i)for(u=e.find(".k-treemap-wrap"),t=0;t<i.length;t++)f=i[t],r=this._createLeaf(f),u.append(r),this.treeMap.trigger(v,{element:r})},createRoot:function(n){var t=this._createLeaf(n);this.element.append(t);this.treeMap.trigger(v,{element:t})},_clean:function(n){n.css("background-color","");n.removeClass("k-leaf");n.removeClass("k-inverse");n.empty()},_createLeaf:function(t){return this._createTile(t).css("background-color",t.color).addClass("k-leaf").toggleClass("k-inverse",this._tileColorBrightness(t)>180).append(n("<div><\/div>").html(this._getText(t)))},_createTile:function(t){var r={width:t.coord.width,height:t.coord.height,left:t.coord.left,top:t.coord.top},f;return r.width+=r.left&&this.offset?this.offset*2:this.offset,r.height+=r.top?this.offset*2:this.offset,f=n("<div class='k-treemap-tile'><\/div>").css({width:r.width,height:r.height,left:r.left,top:r.top}),u(t.dataItem)&&u(t.dataItem.uid)&&f.attr(i.attr("uid"),t.dataItem.uid),f},_getText:function(n){var t=n.text;return this.options.template&&(t=this._renderTemplate(n)),t},_renderTemplate:function(n){var t=et(this.options.template);return t({dataItem:n.dataItem,text:n.text})},_createTitle:function(t){return n("<div class='k-treemap-title'><\/div>").append(n("<div><\/div>").html(this._getText(t)))},_createWrap:function(){return n("<div class='k-treemap-wrap'><\/div>")},_tileColorBrightness:function(n){return d(n.color)}}),rt=c.extend({createRoot:function(n,t,i,r){n.coord={width:t,height:i,top:0,left:0};n.vertical=r},init:function(n){this.vertical=n;this.quotient=n?1:0},compute:function(n,t,i){var r,u,f;n.length>0&&(r=t.width,u=t.height,this.vertical?u-=i.text:r-=i.text,f={width:r,height:u,top:0,left:0},this.layoutChildren(n,f))},layoutChildren:function(n,t){for(var e=t.width*t.height,u=0,r=[],f,i=0;i<n.length;i++)f=n[i],r[i]=parseFloat(n[i].value),u+=r[i],f.vertical=this.vertical;for(i=0;i<r.length;i++)n[i].area=e*r[i]/u;this.sliceAndDice(n,t)},sliceAndDice:function(n,t){var i=this._totalArea(n);n[0].level%2===this.quotient?this.layoutHorizontal(n,t,i):this.layoutVertical(n,t,i)},layoutHorizontal:function(n,t,i){for(var u,f,e=0,r=0;r<n.length;r++)u=n[r],f=u.area/(i/t.width),u.coord={height:t.height,width:f,top:t.top,left:t.left+e},e+=f},layoutVertical:function(n,t,i){for(var u,f,e=0,r=0;r<n.length;r++)u=n[r],f=u.area/(i/t.height),u.coord={height:f,width:t.width,top:t.top+e,left:t.left},e+=f},_totalArea:function(n){for(var i=0,t=0;t<n.length;t++)i+=n[t].area;return i}}),ut=it.extend({htmlSize:function(n){var t=this._getByUid(n.dataItem.uid),r={text:0,offset:0},u,i;return n.children&&(this._clean(t),u=this._getText(n),u&&(i=this._createTitle(n),t.append(i),r.text=n.vertical?i.height():i.width()),t.append(this._createWrap()),this.offset=(t.outerWidth()-t.innerWidth())/2),r},_createTitle:function(t){var i;return i=t.vertical?n("<div class='k-treemap-title'><\/div>"):n("<div class='k-treemap-title-vertical'><\/div>"),i.append(n("<div><\/div>").html(this._getText(t)))}});l.ui.plugin(lt)})(window.kendo.jQuery)}(),function(){(function(n){var o=window.kendo,t=o.mobile.ui,s=t.Shim,r=t.Widget,u="beforeOpen",f="open",i="close",e="init",h='<div class="km-modalview-wrapper" />',c=t.View.extend({init:function(n,t){var i=this;r.fn.init.call(i,n,t);i._id();i._wrap();i._shim();this.options.$angular||(i._layout(),i._scroller(),i._model());i.element.css("display","");i.trigger(e)},events:[e,u,f,i],options:{name:"ModalView",modal:!0,width:null,height:null},destroy:function(){r.fn.destroy.call(this);this.shim.destroy()},open:function(t){var i=this;i.target=n(t);i.shim.show();i._invokeNgController();i.trigger("show",{view:i})},openFor:function(n){this.trigger(u,{target:n})||(this.open(n),this.trigger(f,{target:n}))},close:function(){this.element.is(":visible")&&!this.trigger(i)&&this.shim.hide()},_wrap:function(){var t=this,n=t.element,r=t.options,u,i;u=n[0].style.width||"auto";i=n[0].style.height||"auto";n.addClass("km-modalview").wrap(h);t.wrapper=n.parent().css({width:r.width||u||300,height:r.height||i||300}).addClass(i=="auto"?" km-auto-height":"");n.css({width:"",height:""})},_shim:function(){var n=this;n.shim=new s(n.wrapper,{modal:n.options.modal,position:"center center",align:"center center",effect:"fade:in",className:"km-modalview-root",hide:function(t){n.trigger(i)&&t.preventDefault()}})}});t.plugin(c)})(window.kendo.jQuery)}(),function(){(function(n){var t=window.kendo,e=t.mobile,u=t.support.mobileOS,o=t.effects.Transition,s=t.roleSelector,r="x",f=e.ui,y=!(u.ios&&u.majorVersion==7&&!u.appMode),h="beforeShow",c="init",l="show",a="hide",v="afterHide",p={enable:n.noop},i=f.View.extend({init:function(i,r){var o,f,h,u,l;if(n(i).parent().prepend(i),e.ui.Widget.fn.init.call(this,i,r),this.options.$angular||(this._layout(),this._scroller()),this._model(),o=this.element.closest(s("pane")).data("kendoMobilePane"),o)this.pane=o,this.pane.bind("viewShow",function(n){u._viewShow(n)}),this.pane.bind("sameViewRequested",function(){u.hide()}),f=this.userEvents=new t.UserEvents(o.element,{filter:s("view splitview"),allowSelection:!0});else{if(this.currentView=p,h=n(this.options.container),!h)throw new Error("The drawer needs a container configuration option set.");f=this.userEvents=new t.UserEvents(h,{allowSelection:!0});this._attachTransition(h)}u=this;l=function(n){u.visible&&(u.hide(),n.preventDefault())};this.options.swipeToOpen&&y?(f.bind("press",function(){u.transition.cancel()}),f.bind("start",function(n){u._start(n)}),f.bind("move",function(n){u._update(n)}),f.bind("end",function(n){u._end(n)}),f.bind("tap",l)):f.bind("press",l);this.leftPositioned=this.options.position==="left";this.visible=!1;this.element.hide().addClass("km-drawer").addClass(this.leftPositioned?"km-left-drawer":"km-right-drawer");this.trigger(c)},options:{name:"Drawer",position:"left",views:[],swipeToOpenViews:[],swipeToOpen:!0,title:"",container:null},events:[h,a,v,c,l],show:function(){this._activate()&&this._show()},hide:function(){this.currentView&&(this.currentView.enable(),i.current=null,this._moveViewTo(0),this.trigger(a,{view:this}))},openFor:function(){this.visible?this.hide():this.show()},destroy:function(){f.View.fn.destroy.call(this);this.userEvents.destroy()},_activate:function(){if(this.visible)return!0;var n=this._currentViewIncludedIn(this.options.views);return!n||this.trigger(h,{view:this})?!1:(this._setAsCurrent(),this.element.show(),this.trigger(l,{view:this}),this._invokeNgController(),!0)},_currentViewIncludedIn:function(t){if(!this.pane||!t.length)return!0;var i=this.pane.view();return n.inArray(i.id.replace("#",""),t)>-1||n.inArray(i.element.attr("id"),t)>-1},_show:function(){this.currentView.enable(!1);this.visible=!0;var n=this.element.width();this.leftPositioned||(n=-n);this._moveViewTo(n)},_setAsCurrent:function(){i.last!==this&&(i.last&&i.last.element.hide(),this.element.show());i.last=this;i.current=this},_moveViewTo:function(n){this.userEvents.cancel();this.transition.moveTo({location:n,duration:400,ease:o.easeOutExpo})},_viewShow:function(n){if(this.currentView&&this.currentView.enable(),this.currentView===n.view){this.hide();return}this.currentView=n.view;this._attachTransition(n.view.element)},_attachTransition:function(n){var i=this,u=this.movable,f=u&&u.x;this.transition&&(this.transition.cancel(),this.movable.moveAxis("x",0));u=this.movable=new t.ui.Movable(n);this.transition=new o({axis:r,movable:this.movable,onEnd:function(){u[r]===0&&(n[0].style.cssText="",i.element.hide(),i.trigger(v),i.visible=!1)}});f&&(n.addClass("k-fx-hidden"),t.animationFrame(function(){n.removeClass("k-fx-hidden");i.movable.moveAxis(r,f);i.hide()}))},_start:function(n){var u=n.sender;if(Math.abs(n.x.velocity)<Math.abs(n.y.velocity)||t.triggeredByInput(n.event)||!this._currentViewIncludedIn(this.options.swipeToOpenViews)){u.cancel();return}var r=this.leftPositioned,f=this.visible,o=r&&f||!r&&!i.current,s=!r&&f||r&&!i.current,e=n.x.velocity<0;if((o&&e||s&&!e)&&this._activate()){u.capture();return}u.cancel()},_update:function(n){var u=this.movable,t=u.x+n.x.delta,i;i=this.leftPositioned?Math.min(Math.max(0,t),this.element.width()):Math.max(Math.min(0,t),-this.element.width());this.movable.moveAxis(r,i);n.event.preventDefault();n.event.stopPropagation()},_end:function(n){var t=n.x.velocity,r=Math.abs(this.movable.x)>this.element.width()/2,i=.8,u;u=this.leftPositioned?t>-i&&(t>i||r):t<i&&(t<-i||r);u?this._show():this.hide()}});f.plugin(i)})(window.kendo.jQuery)}(),function(){(function(n){var t=window.kendo,i=t.mobile.ui,r=i.Widget,u="<div class='km-expanded-pane-shim' />",f=i.View,e=f.extend({init:function(f,e){var o=this,s,h;r.fn.init.call(o,f,e);f=o.element;n.extend(o,e);o._id();o.options.$angular?o._overlay():(o._layout(),o._overlay());o._style();h=f.children(o._locate("modalview"));o.options.$angular?h.each(function(i,r){t.compileMobileDirective(n(r),e.$angular[0])}):t.mobile.init(h);o.panes=[];o._paramsHistory=[];o.options.$angular?(o.element.children(t.directiveSelector("pane")).each(function(){s=t.compileMobileDirective(n(this),e.$angular[0]);o.panes.push(s)}),o.element.children(t.directiveSelector("header footer")).each(function(){t.compileMobileDirective(n(this),e.$angular[0])})):o.content.children(t.roleSelector("pane")).each(function(){s=t.initWidget(this,{},i.roles);o.panes.push(s)});o.expandedPaneShim=n(u).appendTo(o.element);o._shimUserEvents=new t.UserEvents(o.expandedPaneShim,{tap:function(){o.collapsePanes()}})},_locate:function(n){return this.options.$angular?t.directiveSelector(n):t.roleSelector(n)},options:{name:"SplitView",style:"horizontal"},expandPanes:function(){this.element.addClass("km-expanded-splitview")},collapsePanes:function(){this.element.removeClass("km-expanded-splitview")},_layout:function(){var n=this,i=n.element;n.transition=t.attrValue(i,"transition");t.mobile.ui.View.prototype._layout.call(this);t.mobile.init(this.header.add(this.footer));n.element.addClass("km-splitview");n.content.addClass("km-split-content")},_style:function(){var t=this.options.style,r=this.element,i;t&&(i=t.split(" "),n.each(i,function(){r.addClass("km-split-"+this)}))},showStart:function(){var t=this;t.element.css("display","");t.inited?this._invokeNgController():(t.inited=!0,n.each(t.panes,function(){this.options.initial?this.navigateToInitial():this.navigate("")}),t.trigger("init",{view:t}));t.trigger("show",{view:t})}});i.plugin(e)})(window.kendo.jQuery)}(),function(){(function(n,t){function wt(n,t){var r=[];return i&&r.push("km-on-"+i.name),n.skin?r.push("km-"+n.skin):n.name=="ios"&&n.majorVersion>6?r.push("km-ios7"):r.push("km-"+n.name),(n.name=="ios"&&n.majorVersion<7||n.name!="ios")&&r.push("km-"+n.name+n.majorVersion),r.push("km-"+n.majorVersion),r.push("km-m"+(n.minorVersion?n.minorVersion[0]:0)),n.variant&&(n.skin&&n.skin===n.name||!n.skin||n.setDefaultPlatform===!1)&&r.push("km-"+(n.skin?n.skin:n.name)+"-"+n.variant),n.cordova&&r.push("km-cordova"),n.appMode?r.push("km-app"):r.push("km-web"),t&&t.statusBarStyle&&r.push("km-"+t.statusBarStyle+"-status-bar"),r.join(" ")}function bt(t){return"km-wp-"+(t.noVariantSet?parseInt(n("<div style='background: Background' />").css("background-color").split(",")[1],10)===0?"dark":"light":t.variant+" km-wp-"+t.variant+"-force")}function v(n){return i.wp?n.css("animation-name")=="-kendo-landscape":Math.abs(window.orientation)/90==1}function k(n){return v(n)?ft:ut}function d(n){n.parent().addBack().css("min-height",window.innerHeight)}function g(){n("meta[name=viewport]").remove();e.append(w({height:", width=device-width"+(v()?", height="+window.innerHeight+"px":u.mobileOS.flatVersion>=600&&u.mobileOS.flatVersion<700?", height="+window.innerWidth+"px":", height=device-height")}))}var r=window.kendo,h=r.mobile,u=r.support,c=h.ui.Widget,tt=h.ui.Pane,it="ios7",i=u.mobileOS,l=i.device=="blackberry"&&i.flatVersion>=600&&i.flatVersion<1e3&&i.appMode,rt=.93,ut="km-vertical",a=i.browser==="chrome",y=i.ios&&i.flatVersion>=700&&i.flatVersion<800&&(i.appMode||a),o=Math.abs(window.orientation)/90==1,ft="km-horizontal",p={ios7:{ios:!0,browser:"default",device:"iphone",flatVersion:"700",majorVersion:"7",minorVersion:"0.0",name:"ios",tablet:!1},ios:{ios:!0,browser:"default",device:"iphone",flatVersion:"612",majorVersion:"6",minorVersion:"1.2",name:"ios",tablet:!1},android:{android:!0,browser:"default",device:"android",flatVersion:"442",majorVersion:"4",minorVersion:"4.2",name:"android",tablet:!1},blackberry:{blackberry:!0,browser:"default",device:"blackberry",flatVersion:"710",majorVersion:"7",minorVersion:"1.0",name:"blackberry",tablet:!1},meego:{meego:!0,browser:"default",device:"meego",flatVersion:"850",majorVersion:"8",minorVersion:"5.0",name:"meego",tablet:!1},wp:{wp:!0,browser:"default",device:"wp",flatVersion:"800",majorVersion:"8",minorVersion:"0.0",name:"wp",tablet:!1}},w=r.template('<meta content="initial-scale=#: data.scale #, maximum-scale=#: data.scale #, user-scalable=no#=data.height#" name="viewport" />',{usedWithBlock:!1}),et=r.template('<meta name="apple-mobile-web-app-capable" content="#= data.webAppCapable === false ? \'no\' : \'yes\' #" /> <meta name="apple-mobile-web-app-status-bar-style" content="#=data.statusBarStyle#" /> <meta name="msapplication-tap-highlight" content="no" /> ',{usedWithBlock:!1}),ot=r.template("<style>.km-view { clip: rect(0 #= data.width #px #= data.height #px 0); }<\/style>",{usedWithBlock:!1}),st=i.android&&i.browser!="chrome"||i.blackberry,ht=r.template('<link rel="apple-touch-icon'+(i.android?"-precomposed":"")+'" # if(data.size) { # sizes="#=data.size#" #}# href="#=data.icon#" />',{usedWithBlock:!1}),ct=(i.device=="iphone"||i.device=="ipod")&&i.majorVersion<7,lt=(i.device=="iphone"||i.device=="ipod")&&i.majorVersion>=7,at=lt?"none":null,vt=i.browser=="mobilesafari"?60:0,s=20,yt=n(window),f=window.screen,e=n("head"),b="init",pt=n.proxy,nt=c.extend({init:function(t,i){h.application=this;n(n.proxy(this,"bootstrap",t,i))},bootstrap:function(t,i){var f,u,e;t=n(t);t[0]||(t=n(document.body));c.fn.init.call(this,t,i);this.element.removeAttr("data-"+r.ns+"role");this._setupPlatform();this._attachMeta();this._setupElementClass();this._attachHideBarHandlers();f=n.extend({},this.options);delete f.name;u=this;e=function(){u.pane=new tt(u.element,f);u.pane.navigateToInitial();u.options.updateDocumentTitle&&u._setupDocumentTitle();u._startHistory();u.trigger(b)};this.options.$angular?setTimeout(e):e()},options:{name:"Application",hideAddressBar:!0,browserHistory:!0,historyTransition:at,modelScope:window,statusBarStyle:"black",transition:"",retina:!1,platform:null,skin:null,updateDocumentTitle:!0,useNativeScrolling:!1},events:[b],navigate:function(n,t){this.pane.navigate(n,t)},replace:function(n,t){this.pane.replace(n,t)},scroller:function(){return this.view().scroller},hideLoading:function(){if(this.pane)this.pane.hideLoading();else throw new Error("The mobile application instance is not fully instantiated. Please consider activating loading in the application init event handler.");},showLoading:function(){if(this.pane)this.pane.showLoading();else throw new Error("The mobile application instance is not fully instantiated. Please consider activating loading in the application init event handler.");},changeLoadingMessage:function(n){if(this.pane)this.pane.changeLoadingMessage(n);else throw new Error("The mobile application instance is not fully instantiated. Please consider changing the message in the application init event handler.");},view:function(){return this.pane.view()},skin:function(n){var t=this;return arguments.length?(t.options.skin=n||"",t.element[0].className="km-pane",t._setupPlatform(),t._setupElementClass(),t.options.skin):t.options.skin},destroy:function(){c.fn.destroy.call(this);this.pane.destroy();this.router.destroy()},_setupPlatform:function(){var t=this,f=t.options.platform,e=t.options.skin,u=[],r=i||p[it];if(f&&(r.setDefaultPlatform=!0,typeof f=="string"?(u=f.split("-"),r=n.extend({variant:u[1]},r,p[u[0]])):r=f),e&&(u=e.split("-"),i||(r.setDefaultPlatform=!1),r=n.extend({},r,{skin:u[0],variant:u[1]})),r.variant||(r.noVariantSet=!0,r.variant="dark"),t.os=r,t.osCssClass=wt(t.os,t.options),r.name=="wp"&&(t.refreshBackgroundColorProxy||(t.refreshBackgroundColorProxy=n.proxy(function(){(t.os.variant&&t.os.skin&&t.os.skin===t.os.name||!t.os.skin)&&t.element.removeClass("km-wp-dark km-wp-light km-wp-dark-force km-wp-light-force").addClass(bt(t.os))},t)),n(document).off("visibilitychange",t.refreshBackgroundColorProxy),n(document).off("resume",t.refreshBackgroundColorProxy),!r.skin)){t.element.parent().css("overflow","hidden");n(document).on("visibilitychange",t.refreshBackgroundColorProxy);n(document).on("resume",t.refreshBackgroundColorProxy);t.refreshBackgroundColorProxy()}},_startHistory:function(){this.options.browserHistory?(this.router=new r.Router({pushState:this.options.pushState,root:this.options.root,hashBang:this.options.hashBang}),this.pane.bindToRouter(this.router),this.router.start()):this.options.initial||this.pane.navigate("")},_resizeToScreenHeight:function(){var t=n("meta[name=apple-mobile-web-app-status-bar-style]").attr("content").match(/black-translucent|hidden/),i=this.element,r;r=a?window.innerHeight:v(i)?t?o?f.availWidth+s:f.availWidth:o?f.availWidth:f.availWidth-s:t?o?f.availHeight:f.availHeight+s:o?f.availHeight-s:f.availHeight;i.height(r)},_setupElementClass:function(){var i=this,f,t=i.element;t.parent().addClass("km-root km-"+(i.os.tablet?"tablet":"phone"));t.addClass(i.osCssClass+" "+k(t));this.options.useNativeScrolling&&t.parent().addClass("km-native-scrolling");a&&t.addClass("km-ios-chrome");u.wpDevicePixelRatio&&t.parent().css("font-size",u.wpDevicePixelRatio+"em");this.options.retina&&(t.parent().addClass("km-retina"),t.parent().css("font-size",u.devicePixelRatio*rt+"em"));l&&g();i.options.useNativeScrolling?t.parent().addClass("km-native-scrolling"):st&&(f=(screen.availWidth>screen.availHeight?screen.availWidth:screen.availHeight)+200,n(ot({width:f,height:f})).appendTo(e));y&&i._resizeToScreenHeight();r.onResize(function(){t.removeClass("km-horizontal km-vertical").addClass(k(t));i.options.useNativeScrolling&&d(t);y&&i._resizeToScreenHeight();l&&g();r.resize(t)})},_clearExistingMeta:function(){e.find("meta").filter("[name|='apple-mobile-web-app'],[name|='msapplication-tap'],[name='viewport']").remove()},_attachMeta:function(){var t=this.options,n=t.icon,i;if(this._clearExistingMeta(),l||e.prepend(w({height:"",scale:this.options.retina?1/u.devicePixelRatio:"1.0"})),e.prepend(et(t)),n){typeof n=="string"&&(n={"":n});for(i in n)e.prepend(ht({icon:n[i],size:i}))}t.useNativeScrolling&&d(this.element)},_attachHideBarHandlers:function(){var n=this,t=pt(n,"_hideBar");if(!u.mobileOS.appMode&&n.options.hideAddressBar&&ct&&!n.options.useNativeScrolling){n._initialHeight={};yt.on("load",t);r.onResize(function(){setTimeout(window.scrollTo,0,0,1)})}},_setupDocumentTitle:function(){var n=this,i=document.title;n.pane.bind("viewShow",function(n){var r=n.view.title;document.title=r!==t?r:i})},_hideBar:function(){var t=this,i=t.element;i.height(r.support.transforms.css+"calc(100% + "+vt+"px)");n(window).trigger(r.support.resize)}});r.mobile.Application=nt;r.ui.plugin(nt,r.mobile,"Mobile")})(window.kendo.jQuery)}(),function(){(function(n){function e(t,i,r){n(i.target).closest(".km-button,.km-detail").toggleClass("km-state-active",r);s&&t.deactivateTimeoutID&&(clearTimeout(t.deactivateTimeoutID),t.deactivateTimeoutID=0)}function c(t){return n('<span class="km-badge">'+t+"<\/span>")}var u=window.kendo,l=u.mobile,i=l.ui,f=i.Widget,a=u.support,o=a.mobileOS,s=o.android&&o.flatVersion>=300,h="click",r="disabled",v="km-state-disabled",t=f.extend({init:function(n,t){var i=this,o;if(f.fn.init.call(i,n,t),o=i.options.clickOn==="up",i._wrap(),i._style(),o||i.element.attr("data-navigate-on-press",!0),i.options.enable=i.options.enable&&!i.element.attr(r),i.enable(i.options.enable),i._userEvents=new u.UserEvents(i.element,{allowSelection:!o,press:function(n){i._activate(n)},release:function(n){e(i,n,!1);o||n.event.stopPropagation()}}),i._userEvents.bind(o?"tap":"press",function(n){i._release(n)}),s)i.element.on("move",function(n){i._timeoutDeactivate(n)})},destroy:function(){f.fn.destroy.call(this);this._userEvents.destroy()},events:[h],options:{name:"Button",icon:"",style:"",badge:"",clickOn:"up",enable:!0},badge:function(n){var t=this.badgeElement=this.badgeElement||c(n).appendTo(this.element);return n||n===0?(t.html(n),this):n===!1?(t.empty().remove(),this.badgeElement=!1,this):t.html()},enable:function(n){var t=this.element;typeof n=="undefined"&&(n=!0);this.options.enable=n;n?t.removeAttr(r):t.attr(r,r);t.toggleClass(v,!n)},_timeoutDeactivate:function(n){this.deactivateTimeoutID||(this.deactivateTimeoutID=setTimeout(e,500,this,n,!1))},_activate:function(n){var t=document.activeElement,i=t?t.nodeName:"";this.options.enable&&(e(this,n,!0),(i=="INPUT"||i=="TEXTAREA")&&t.blur())},_release:function(t){var i=this;if(!(t.which>1)){if(!i.options.enable){t.preventDefault();return}i.trigger(h,{target:n(t.target),button:i.element})&&t.preventDefault()}},_style:function(){var t=this.options.style,r=this.element,i;t&&(i=t.split(" "),n.each(i,function(){r.addClass("km-"+this)}))},_wrap:function(){var i=this,f=i.options.icon,r=i.options.badge,e='<span class="km-icon km-'+f,t=i.element.addClass("km-button"),u=t.children("span:not(.km-icon)").addClass("km-text"),o=t.find("img").addClass("km-image");!u[0]&&t.html()&&(u=t.wrapInner('<span class="km-text" />').children("span.km-text"));!o[0]&&f&&(u[0]||(e+=" km-notext"),i.iconElement=t.prepend(n(e+'" />')));(r||r===0)&&(i.badgeElement=c(r).appendTo(t))}}),y=t.extend({options:{name:"BackButton",style:"back"},init:function(n,i){var r=this;t.fn.init.call(r,n,i);typeof r.element.attr("href")=="undefined"&&r.element.attr("href","#:back")}}),p=t.extend({options:{name:"DetailButton",style:""},init:function(n,i){t.fn.init.call(this,n,i)},_style:function(){var t=this.options.style+" detail",r=this.element,i;t&&(i=t.split(" "),n.each(i,function(){r.addClass("km-"+this)}))},_wrap:function(){var i=this,r=i.options.icon,u='<span class="km-icon km-'+r,t=i.element,f=t.children("span"),e=t.find("img").addClass("km-image");!e[0]&&r&&(f[0]||(u+=" km-notext"),t.prepend(n(u+'" />')))}});i.plugin(t);i.plugin(y);i.plugin(p)})(window.kendo.jQuery)}(),function(){(function(n,t){function s(t){return n('<span class="km-badge">'+t+"<\/span>")}var u=window.kendo,f=u.mobile.ui,e=f.Widget,i="km-state-active",r="km-state-disabled",o="select",h="li:not(."+i+")",c=e.extend({init:function(n,t){var i=this;e.fn.init.call(i,n,t);i.element.addClass("km-buttongroup").find("li").each(i._button);i.element.on(i.options.selectOn,h,"_select");i._enable=!0;i.select(i.options.index);i.options.enable||(i._enable=!1,i.wrapper.addClass(r))},events:[o],options:{name:"ButtonGroup",selectOn:"down",index:-1,enable:!0},current:function(){return this.element.find("."+i)},select:function(u){var f=this,e=-1;u!==t&&u!==-1&&f._enable&&!n(u).is("."+r)&&(f.current().removeClass(i),typeof u=="number"?(e=u,u=n(f.element[0].children[u])):u.nodeType&&(u=n(u),e=u.index()),u.addClass(i),f.selectedIndex=e)},badge:function(t,i){var u=this.element,r;return(isNaN(t)||(t=u.children().get(t)),t=u.find(t),r=n(t.children(".km-badge")[0]||s(i).appendTo(t)),i||i===0)?(r.html(i),this):i===!1?(r.empty().remove(),this):r.html()},enable:function(n){var t=this.wrapper;typeof n=="undefined"&&(n=!0);n?t.removeClass(r):t.addClass(r);this._enable=this.options.enable=n},_button:function(){var t=n(this).addClass("km-button"),f=u.attrValue(t,"icon"),i=u.attrValue(t,"badge"),r=t.children("span"),e=t.find("img").addClass("km-image");r[0]||(r=t.wrapInner("<span/>").children("span"));r.addClass("km-text");!e[0]&&f&&t.prepend(n('<span class="km-icon km-'+f+'"/>'));(i||i===0)&&s(i).appendTo(t)},_select:function(n){n.which>1||n.isDefaultPrevented()||!this._enable||(this.select(n.currentTarget),this.trigger(o,{index:this.selectedIndex}))}});f.plugin(c)})(window.kendo.jQuery)}(),function(){(function(n){var t=window.kendo,e=t.mobile.ui,r=e.Widget,h="km-collapsible",c="km-collapsibleinset",l="<div data-role='collapsible-header' class='km-collapsible-header'><\/div>",a="<div data-role='collapsible-content' class='km-collapsible-content'><\/div>",i="km-collapsed",u="km-expanded",f="km-animated",o="expand",s="collapse",v=r.extend({init:function(e,o){var s=this,l=n(e);r.fn.init.call(s,l,o);l.addClass(h);s._buildHeader();s.content=l.children().not(s.header).wrapAll(a).parent();s._userEvents=new t.UserEvents(s.header,{tap:function(){s.toggle()}});l.addClass(s.options.collapsed?i:u);s.options.inset&&l.addClass(c);s.options.animation?(s.content.addClass(f),s.content.height(0),s.options.collapsed&&s.content.hide()):s.options.collapsed&&s.content.hide()},events:[o,s],options:{name:"Collapsible",collapsed:!0,collapseIcon:"arrow-n",expandIcon:"arrow-s",iconPosition:"left",animation:!0,inset:!1},destroy:function(){r.fn.destroy.call(this);this._userEvents.destroy()},expand:function(n){var e=this.options.collapseIcon,r=this.content,s=t.support.mobileOS.ios;this.trigger(o)||(e&&this.header.find(".km-icon").removeClass().addClass("km-icon km-"+e),this.element.removeClass(i).addClass(u),this.options.animation&&!n?(r.off("transitionend"),r.show(),s&&r.removeClass(f),r.height(this._getContentHeight()),s&&r.addClass(f),t.resize(r)):r.show())},collapse:function(n){var r=this.options.expandIcon,t=this.content;if(!this.trigger(s))if(r&&this.header.find(".km-icon").removeClass().addClass("km-icon km-"+r),this.element.removeClass(u).addClass(i),this.options.animation&&!n){t.one("transitionend",function(){t.hide()});t.height(0)}else t.hide()},toggle:function(n){this.isCollapsed()?this.expand(n):this.collapse(n)},isCollapsed:function(){return this.element.hasClass(i)},resize:function(){!this.isCollapsed()&&this.options.animation&&this.content.height(this._getContentHeight())},_buildHeader:function(){var t=this.element.children(":header").wrapAll(l),i=n('<span class="km-icon"/>'),r=this.options.collapsed?this.options.expandIcon:this.options.collapseIcon,u=this.options.iconPosition;r&&(t.prepend(i),i.addClass("km-"+r));this.header=t.parent();this.header.addClass("km-icon-"+u)},_getContentHeight:function(){var n=this.content.attr("style"),t;return this.content.css({position:"absolute",visibility:"hidden",height:"auto"}),t=this.content.height(),this.content.attr("style",n?n:""),t}});e.plugin(v)})(window.kendo.jQuery)}(),function(){(function(n){function vt(){return this.nodeType===it.TEXT_NODE&&this.nodeValue.match(lt)}function o(n,t){t&&!n[0].querySelector(".km-icon")&&n.prepend('<span class="km-icon km-'+t+'"/>')}function yt(n){o(n,r(n,"icon"));o(n,r(n.children(ft),"icon"))}function pt(n){var i=n.parent(),u=n.add(i.children(t.roleSelector("detailbutton"))),f=i.contents().not(u).not(vt);f.length||(n.addClass("km-listview-link").attr(t.attr("role"),"listview-link"),o(n,r(i,"icon")),o(n,r(n,"icon")))}function wt(n){if(n[0].querySelector("input[type=checkbox],input[type=radio]")){var t=n.parent();t.contents().not(n).not(function(){return this.nodeType==3})[0]||(n.addClass("km-listview-label"),n.children("[type=checkbox],[type=radio]").addClass("km-widget km-icon km-check"))}}function v(t,i){n(t).css("transform","translate3d(0px, "+i+"px, 0px)")}var t=window.kendo,it=window.Node,s=t.mobile,i=s.ui,rt=t.data.DataSource,h=i.DataBoundWidget,ut=".km-list > li, > li:not(.km-group-container)",y=".km-listview-link, .km-listview-label",ft="["+t.attr("icon")+"]",u=n.proxy,r=t.attrValue,f="km-group-title",et="km-state-active",ot='<div class="'+f+'"><div class="km-text"><\/div><\/div>',st=t.template('<li><div class="'+f+'"><div class="km-text">#= this.headerTemplate(data) #<\/div><\/div><ul>#= kendo.render(this.template, data.items)#<\/ul><\/li>'),ht='<div class="km-listview-wrapper" />',ct=t.template('<form class="km-filter-form"><div class="km-filter-wrap"><input type="search" placeholder="#=placeholder#"/><a href="\\#" class="km-filter-reset" title="Clear"><span class="km-icon km-clear"><\/span><span class="km-text">Clear<\/span><\/a><\/div><\/form>'),e=".kendoMobileListView",p="styled",c="dataBound",w="dataBinding",l="itemChange",a="click",b="change",k="progress",d="function",lt=/^\s+$/,at=/button/,bt=t.Class.extend({init:function(n){var r=n.scroller(),i,t;r&&(this.options=n.options,this.element=n.element,this.scroller=n.scroller(),this._shouldFixHeaders(),i=this,t=function(){i._cacheHeaders()},n.bind("resize",t),n.bind(p,t),n.bind(c,t),r.bind("scroll",function(n){i._fixHeader(n)}))},_fixHeader:function(t){if(this.fixedHeaders){var r=0,e=this.scroller,o=this.headers,s=t.scrollTop,i,f,u;do{if(i=o[r++],!i){u=n("<div />");break}f=i.offset;u=i.header}while(f+1>s);this.currentHeader!=r&&(e.fixedContainer.html(u.clone()),this.currentHeader=r)}},_shouldFixHeaders:function(){this.fixedHeaders=this.options.type==="group"&&this.options.fixedHeaders},_cacheHeaders:function(){if(this._shouldFixHeaders(),this.fixedHeaders){var t=[],i=this.scroller.scrollTop;this.element.find("."+f).each(function(r,u){u=n(u);t.unshift({offset:u.position().top+i,header:u})});this.headers=t;this._fixHeader({scrollTop:i})}}}),kt=function(){return{page:1}},dt=t.Class.extend({init:function(n){var t=this,i=n.options,r=n.scroller(),u=i.pullParameters||kt;this.listView=n;this.scroller=r;n.bind("_dataSource",function(n){t.setDataSource(n.dataSource)});r.setOptions({pullToRefresh:!0,pull:function(){t._pulled||(t._pulled=!0,t.dataSource.read(u.call(n,t._first)))},messages:{pullTemplate:i.messages.pullTemplate,releaseTemplate:i.messages.releaseTemplate,refreshTemplate:i.messages.refreshTemplate}})},setDataSource:function(n){var t=this;this._first=n.view()[0];this.dataSource=n;n.bind("change",function(){t._change()});n.bind("error",function(){t._change()})},_change:function(){var t=this.scroller,i=this.dataSource,n;this._pulled&&t.pullHandled();(this._pulled||!this._first)&&(n=i.view(),n[0]&&(this._first=n[0]));this._pulled=!1}}),g=t.Observable.extend({init:function(n){var i=this;t.Observable.fn.init.call(i);i.buffer=n.buffer;i.height=n.height;i.item=n.item;i.items=[];i.footer=n.footer;i.buffer.bind("reset",function(){i.refresh()})},refresh:function(){for(var r=this.buffer,n=this.items,u=!1,f,e,t,i;n.length;)n.pop().destroy();for(this.offset=r.offset,f=this.item,i=0;i<r.viewSize;i++){if(i===r.total()){u=!0;break}t=f(this.content(this.offset+n.length));t.below(e);e=t;n.push(t)}this.itemCount=n.length;this.trigger("reset");this._resize();u&&this.trigger("endReached")},totalHeight:function(){if(!this.items[0])return 0;var n=this,t=n.items,r=t[0].top,i=t[t.length-1].bottom,u=(i-r)/n.itemCount,f=n.buffer.length-n.offset-n.itemCount;return(this.footer?this.footer.height:0)+i+f*u},batchUpdate:function(n){var u=this.height(),t=this.items,i,f=this.offset,r;if(t[0]){if(this.lastDirection)while(t[t.length-1].bottom>n+u*2){if(this.offset===0)break;this.offset--;i=t.pop();i.update(this.content(this.offset));i.above(t[0]);t.unshift(i)}else while(t[0].top<n-u){if(r=this.offset+this.itemCount,r===this.buffer.total()){this.trigger("endReached");break}if(r===this.buffer.length)break;i=t.shift();i.update(this.content(this.offset+this.itemCount));i.below(t[t.length-1]);t.push(i);this.offset++}f!==this.offset&&this._resize()}},update:function(n){var u=this,t=this.items,i,e,o,s=this.height(),a=this.itemCount,r=s/2,h=(this.lastTop||0)>n,c=n-r,l=n+s+r,f;t[0]&&(this.lastTop=n,this.lastDirection=h,h?t[0].top>c&&t[t.length-1].bottom>l+r&&this.offset>0&&(this.offset--,i=t.pop(),e=t[0],i.update(this.content(this.offset)),t.unshift(i),i.above(e),u._resize()):t[t.length-1].bottom<l&&t[0].top<c-r&&(f=this.offset+a,f===this.buffer.total()?this.trigger("endReached"):f!==this.buffer.length&&(i=t.shift(),o=t[t.length-1],t.push(i),i.update(this.content(this.offset+this.itemCount)),u.offset++,i.below(o),u._resize())))},content:function(n){return this.buffer.at(n)},destroy:function(){this.unbind()},_resize:function(){var n=this.items,t=0,i=0,r=n[0],u=n[n.length-1];r&&(t=r.top,i=u.bottom);this.trigger("resize",{top:t,bottom:i});this.footer&&this.footer.below(u)}});t.mobile.ui.VirtualList=g;var gt=t.Class.extend({init:function(t,i){var r=t.append([i],!0)[0],u=r.offsetHeight;n.extend(this,{top:0,element:r,listView:t,height:u,bottom:u})},update:function(n){this.element=this.listView.setDataItem(this.element,n)},above:function(n){n&&(this.height=this.element.offsetHeight,this.top=n.top-this.height,this.bottom=n.top,v(this.element,this.top))},below:function(n){n&&(this.height=this.element.offsetHeight,this.top=n.bottom,this.bottom=this.top+this.height,v(this.element,this.top))},destroy:function(){t.destroy(this.element);n(this.element).remove()}}),nt='<div><span class="km-icon"><\/span><span class="km-loading-left"><\/span><span class="km-loading-right"><\/span><\/div>',tt=t.Class.extend({init:function(t){this.element=n('<li class="km-load-more km-scroller-refresh" style="display: none"><\/li>').appendTo(t.element);this._loadIcon=n(nt).appendTo(this.element)},enable:function(){this.element.show();this.height=this.element.outerHeight(!0)},disable:function(){this.element.hide();this.height=0},below:function(n){n&&(this.top=n.bottom,this.bottom=this.height+this.top,v(this.element,this.top))}}),ni=tt.extend({init:function(t,i){this._loadIcon=n(nt).hide();this._loadButton=n('<a class="km-load">'+t.options.messages.loadMoreText+"<\/a>").hide();this.element=n('<li class="km-load-more" style="display: none"><\/li>').append(this._loadIcon).append(this._loadButton).appendTo(t.element);var r=this;this._loadButton.kendoMobileButton().data("kendoMobileButton").bind("click",function(){r._hideShowButton();i.next()});i.bind("resize",function(){r._showLoadButton()});this.height=this.element.outerHeight(!0);this.disable()},_hideShowButton:function(){this._loadButton.hide();this.element.addClass("km-scroller-refresh");this._loadIcon.css("display","block")},_showLoadButton:function(){this._loadButton.show();this.element.removeClass("km-scroller-refresh");this._loadIcon.hide()}}),ti=t.Class.extend({init:function(n){var t=this;this.chromeHeight=n.wrapper.children().not(n.element).outerHeight()||0;this.listView=n;this.scroller=n.scroller();this.options=n.options;n.bind("_dataSource",function(n){t.setDataSource(n.dataSource,n.empty)});n.bind("resize",function(){t.list.items.length&&(t.scroller.reset(),t.buffer.range(0),t.list.refresh())});this.scroller.makeVirtual();this.scroller.bind("scroll",function(n){t.list.update(n.scrollTop)});this.scroller.bind("scrollEnd",function(n){t.list.batchUpdate(n.scrollTop)})},destroy:function(){this.list.unbind();this.buffer.unbind()},setDataSource:function(i,r){var s=this,l=this.options,f=this.listView,h=f.scroller(),a=l.loadMore,c,e,o,u;if(this.dataSource=i,c=i.pageSize()||l.virtualViewSize,!c&&!r)throw new Error("the DataSource does not have page size configured. Page Size setting is mandatory for the mobile listview virtual scrolling to work as expected.");this.buffer&&this.buffer.destroy();e=new t.data.Buffer(i,Math.floor(c/2),a);o=a?new ni(f,e):new tt(f);this.list&&this.list.destroy();u=new g({buffer:e,footer:o,item:function(n){return new gt(f,n)},height:function(){return h.height()}});u.bind("resize",function(){s.updateScrollerSize();f.updateSize()});u.bind("reset",function(){s.footer.enable()});u.bind("endReached",function(){o.disable();s.updateScrollerSize()});e.bind("expand",function(){u.lastDirection=!1;u.batchUpdate(h.scrollTop)});n.extend(this,{buffer:e,scroller:h,list:u,footer:o})},updateScrollerSize:function(){this.scroller.virtualSize(0,this.list.totalHeight()+this.chromeHeight)},refresh:function(){this.list.refresh()},reset:function(){this.buffer.range(0);this.list.refresh()}}),ii=t.Class.extend({init:function(n){var i=this,t;this.listView=n;this.options=n.options;t=this;this._refreshHandler=function(n){t.refresh(n)};this._progressHandler=function(){n.showLoading()};n.bind("_dataSource",function(n){i.setDataSource(n.dataSource)})},destroy:function(){this._unbindDataSource()},reset:function(){},refresh:function(n){var u=n&&n.action,r=n&&n.items,t=this.listView,v=this.dataSource,y=this.options.appendOnRefresh,f=v.view(),p=v.group(),e=p&&p[0],s,h,o,l,b,k,a;if(u==="itemchange"){t._hasBindingTarget()||(s=t.findByDataItem(r)[0],s&&t.setDataItem(s,r[0]));return}if(b=u==="add"&&!e||y&&!t._filter,k=u==="remove"&&!e,b?h=[]:k&&(h=t.findByDataItem(r)),t.trigger(w,{action:u||"rebind",items:r,removedItems:h,index:n&&n.index})){this._shouldShowLoading()&&t.hideLoading();return}u!=="add"||e?u!=="remove"||e?e?t.replaceGrouped(f):y&&!t._filter?(o=t.prepend(f),l=f):t.replace(f):(o=[],t.remove(r)):(a=f.indexOf(r[0]),a>-1&&(o=t.insertAt(r,a),l=r));this._shouldShowLoading()&&t.hideLoading();t.trigger(c,{ns:i,addedItems:o,addedDataItems:l})},setDataSource:function(n){this.dataSource&&this._unbindDataSource();this.dataSource=n;n.bind(b,this._refreshHandler);this._shouldShowLoading()&&this.dataSource.bind(k,this._progressHandler)},_unbindDataSource:function(){this.dataSource.unbind(b,this._refreshHandler).unbind(k,this._progressHandler)},_shouldShowLoading:function(){var n=this.options;return!n.pullToRefresh&&!n.loadMore&&!n.endlessScroll}}),ri=t.Class.extend({init:function(t){var r=this,i=t.options.filterable,f="change paste",o=this;this.listView=t;this.options=i;t.element.before(ct({placeholder:i.placeholder||"Search..."}));i.autoFilter!==!1&&(f+=" keyup");this.element=t.wrapper.find(".km-search-form");this.searchInput=t.wrapper.find("input[type=search]").closest("form").on("submit"+e,function(n){n.preventDefault()}).end().on("focus"+e,function(){r._oldFilter=r.searchInput.val()}).on(f.split(" ").join(e+" ")+e,u(this._filterChange,this));this.clearButton=t.wrapper.find(".km-filter-reset").on(a,u(this,"_clearFilter")).hide();this._dataSourceChange=n.proxy(this._refreshInput,this);t.bind("_dataSource",function(n){n.dataSource.bind("change",o._dataSourceChange)})},_refreshInput:function(){var n=this.listView.dataSource.filter(),t=this.listView._filter.searchInput;n&&n.filters[0].field===this.listView.options.filterable.field?t.val(n.filters[0].value):t.val("")},_search:function(n){this._filter=!0;this.clearButton[n?"show":"hide"]();this.listView.dataSource.filter(n)},_filterChange:function(n){var t=this;n.type=="paste"&&this.options.autoFilter!==!1?setTimeout(function(){t._applyFilter()},1):this._applyFilter()},_applyFilter:function(){var t=this.options,n=this.searchInput.val(),i=n.length?{field:t.field,operator:t.operator||"startswith",ignoreCase:t.ignoreCase,value:n}:null;n!==this._oldFilter&&(this._oldFilter=n,this._search(i))},_clearFilter:function(n){this.searchInput.val("");this._search(null);n.preventDefault()}}),ui=h.extend({init:function(i,r){var u=this;h.fn.init.call(this,i,r);i=this.element;r=this.options;r.scrollTreshold&&(r.scrollThreshold=r.scrollTreshold);i.on("down",y,"_highlight").on("move up cancel",y,"_dim");this._userEvents=new t.UserEvents(i,{filter:ut,allowSelection:!0,tap:function(n){u._click(n)}});i.css("-ms-touch-action","auto");i.wrap(ht);this.wrapper=this.element.parent();this._headerFixer=new bt(this);this._itemsCache={};this._templates();this.virtual=r.endlessScroll||r.loadMore;this._style();this.options.$angular&&(this.virtual||this.options.pullToRefresh)?setTimeout(n.proxy(this,"_start")):this._start()},_start:function(){var n=this.options;this.options.filterable&&(this._filter=new ri(this));this._itemBinder=this.virtual?new ti(this):new ii(this);this.options.pullToRefresh&&(this._pullToRefreshHandler=new dt(this));this.setDataSource(n.dataSource);this._enhanceItems(this.items());t.notify(this,i)},events:[a,w,c,l],options:{name:"ListView",style:"",type:"flat",autoBind:!0,fixedHeaders:!1,template:"#:data#",headerTemplate:'<span class="km-text">#:value#<\/span>',appendOnRefresh:!1,loadMore:!1,endlessScroll:!1,scrollThreshold:30,pullToRefresh:!1,messages:{loadMoreText:"Press to load more",pullTemplate:"Pull to refresh",releaseTemplate:"Release to refresh",refreshTemplate:"Refreshing"},pullOffset:140,filterable:!1,virtualViewSize:null},refresh:function(){this._itemBinder.refresh()},reset:function(){this._itemBinder.reset()},setDataSource:function(n){var t=!n;this.dataSource=rt.create(n);this.trigger("_dataSource",{dataSource:this.dataSource,empty:t});this.options.autoBind&&!t&&(this.items().remove(),this.dataSource.fetch())},destroy:function(){h.fn.destroy.call(this);t.destroy(this.element);this._userEvents.destroy();this._itemBinder&&this._itemBinder.destroy();this.element.unwrap();delete this.element;delete this.wrapper;delete this._userEvents},items:function(){return this.options.type==="group"?this.element.find(".km-list").children():this.element.children().not(".km-load-more")},scroller:function(){return this._scrollerInstance||(this._scrollerInstance=this.element.closest(".km-scroll-wrapper").data("kendoMobileScroller")),this._scrollerInstance},showLoading:function(){var n=this.view();n&&n.loader&&n.loader.show()},hideLoading:function(){var n=this.view();n&&n.loader&&n.loader.hide()},insertAt:function(n,t,r){var u=this;return u._renderItems(n,function(f){if(t===0?u.element.prepend(f):t===-1?u.element.append(f):u.items().eq(t-1).after(f),r)for(var e=0;e<f.length;e++)u.trigger(l,{item:f.eq(e),data:n[e],ns:i})})},append:function(n,t){return this.insertAt(n,-1,t)},prepend:function(n,t){return this.insertAt(n,0,t)},replace:function(n){return this.options.type="flat",this._angularItems("cleanup"),this.element.empty(),this._userEvents.cancel(),this._style(),this.insertAt(n,0)},replaceGrouped:function(i){this.options.type="group";this._angularItems("cleanup");this.element.empty();var r=n(t.render(this.groupTemplate,i));this._enhanceItems(r.children("ul").children("li"));this.element.append(r);s.init(r);this._style();this._angularItems("compile")},remove:function(n){var i=this.findByDataItem(n);this.angular("cleanup",function(){return{elements:i}});t.destroy(i);i.remove()},findByDataItem:function(n){for(var r=[],i=0,u=n.length;i<u;i++)r[i]="[data-"+t.ns+"uid="+n[i].uid+"]";return this.element.find(r.join(","))},setDataItem:function(r,u){var f=this,e=function(e){var o=n(e[0]);t.destroy(r);f.angular("cleanup",function(){return{elements:[n(r)]}});n(r).replaceWith(o);f.trigger(l,{item:o,data:u,ns:i})};return this._renderItems([u],e)[0]},updateSize:function(){this._size=this.getSize()},_renderItems:function(i,r){var u=n(t.render(this.template,i));return r(u),this.angular("compile",function(){return{elements:u,data:i.map(function(n){return{dataItem:n}})}}),s.init(u),this._enhanceItems(u),u},_dim:function(n){this._toggle(n,!1)},_highlight:function(n){this._toggle(n,!0)},_toggle:function(t,i){if(!(t.which>1)){var u=n(t.currentTarget),f=u.parent(),e=r(u,"role")||"",o=!e.match(at),s=t.isDefaultPrevented();o&&f.toggleClass(et,i&&!s)}},_templates:function(){var n=this.options.template,i=this.options.headerTemplate,f={},r={};typeof n===d&&(f.template=n,n="#=this.template(data)#");this.template=u(t.template('<li data-uid="#=arguments[0].uid || ""#">'+n+"<\/li>"),f);r.template=this.template;typeof i===d&&(r._headerTemplate=i,i="#=this._headerTemplate(data)#");r.headerTemplate=t.template(i);this.groupTemplate=u(st,r)},_click:function(r){if(!(r.event.which>1)&&!r.event.isDefaultPrevented()){var u,f=r.target,e=n(r.event.target),s=e.closest(t.roleSelector("button","detailbutton","backbutton")),h=t.widgetInstance(s,i),o=f.attr(t.attr("uid"));o&&(u=this.dataSource.getByUid(o));this.trigger(a,{target:e,item:f,dataItem:u,button:h})&&r.preventDefault()}},_styleGroups:function(){var t=this.element.children();t.children("ul").addClass("km-list");t.each(function(){var i=n(this),t=i.contents().first();i.addClass("km-group-container");t.is("ul")||t.is("div."+f)||t.wrap(ot)})},_style:function(){var r=this.options,n=r.type==="group",i=this.element,t=r.style==="inset";i.addClass("km-listview").toggleClass("km-list",!n).toggleClass("km-virtual-list",this.virtual).toggleClass("km-listinset",!n&&t).toggleClass("km-listgroup",n&&!t).toggleClass("km-listgroupinset",n&&t);i.parents(".km-listview")[0]||i.closest(".km-content").toggleClass("km-insetcontent",t);n&&this._styleGroups();this.trigger(p)},_enhanceItems:function(t){t.each(function(){var r=n(this),t,i=!1;r.children().each(function(){t=n(this);t.is("a")?(pt(t),i=!0):t.is("label")&&(wt(t),i=!0)});i||yt(r)})}});i.plugin(ui)})(window.kendo.jQuery)}(),function(){(function(n){function u(i,r){var u=r.find("["+t.attr("align")+"="+i+"]");if(u[0])return n('<div class="km-'+i+'item" />').append(u).prependTo(r)}function e(i){var r=i.siblings(),u=!!i.children("ul")[0],f=!!r[0]&&n.trim(i.text())==="",e=!!(t.mobile.application&&t.mobile.application.element.is(".km-android"));i.prevAll().toggleClass("km-absolute",u);i.toggleClass("km-show-title",f);i.toggleClass("km-fill-title",f&&!n.trim(i.html()));i.toggleClass("km-no-title",u);i.toggleClass("km-hide-title",e&&!r.children().is(":visible"))}var t=window.kendo,f=t.mobile,r=f.ui,i=r.Widget,o=i.extend({init:function(t,r){var f=this;i.fn.init.call(f,t,r);t=f.element;f.container().bind("show",n.proxy(this,"refresh"));t.addClass("km-navbar").wrapInner(n('<div class="km-view-title km-show-title" />'));f.leftElement=u("left",t);f.rightElement=u("right",t);f.centerElement=t.find(".km-view-title")},options:{name:"NavBar"},title:function(n){this.element.find(t.roleSelector("view-title")).text(n);e(this.centerElement)},refresh:function(n){var t=n.view;this.title(t.options.title)},destroy:function(){i.fn.destroy.call(this);t.destroy(this.element)}});r.plugin(o)})(window.kendo.jQuery)}(),function(){(function(n,t){var i=window.kendo,lt=i.mobile,d=lt.ui,r=n.proxy,s=i.effects.Transition,at=i.ui.Pane,vt=i.ui.PaneDimensions,y=d.DataBoundWidget,g=i.data.DataSource,yt=i.data.Buffer,pt=i.data.BatchBuffer,e=Math,h=e.abs,c=e.ceil,nt=e.round,wt=e.max,bt=e.min,tt=e.floor,u="change",l="changing",f="refresh",p="km-current-page",it="km-virtual-page",rt="function",w="itemChange",ut="cleanup",kt=3,dt=-1,gt=0,ni=1,a=-1,ti=0,v=1,ft=i.Class.extend({init:function(t){var i=this,e=n("<ol class='km-pages'/>");t.element.append(e);this._changeProxy=r(i,"_change");this._refreshProxy=r(i,"_refresh");t.bind(u,this._changeProxy);t.bind(f,this._refreshProxy);n.extend(i,{element:e,scrollView:t})},items:function(){return this.element.children()},_refresh:function(n){for(var t="",i=0;i<n.pageCount;i++)t+="<li/>";this.element.html(t);this.items().eq(n.page).addClass(p)},_change:function(n){this.items().removeClass(p).eq(n.page).addClass(p)},destroy:function(){this.scrollView.unbind(u,this._changeProxy);this.scrollView.unbind(f,this._refreshProxy);this.element.remove()}}),b,o,k,ct;i.mobile.ui.ScrollViewPager=ft;var et="transitionEnd",ot="dragStart",st="dragEnd",ht=i.Observable.extend({init:function(t,r){var f=this,o,l,e,c,a,v;i.Observable.fn.init.call(this);this.element=t;this.container=t.parent();o=new i.ui.Movable(f.element);l=new s({axis:"x",movable:o,onEnd:function(){f.trigger(et)}});e=new i.UserEvents(t,{start:function(n){h(n.x.velocity)*2>=h(n.y.velocity)?e.capture():e.cancel();f.trigger(ot,n);l.cancel()},allowSelection:!0,end:function(n){f.trigger(st,n)}});c=new vt({element:f.element,container:f.container});a=c.x;a.bind(u,function(){f.trigger(u)});v=new at({dimensions:c,userEvents:e,movable:o,elastic:!0});n.extend(f,{duration:r&&r.duration||1,movable:o,transition:l,userEvents:e,dimensions:c,dimension:a,pane:v});this.bind([et,ot,st,u],r)},size:function(){return{width:this.dimensions.x.getSize(),height:this.dimensions.y.getSize()}},total:function(){return this.dimension.getTotal()},offset:function(){return-this.movable.x},updateDimension:function(){this.dimension.update(!0)},refresh:function(){this.dimensions.refresh()},moveTo:function(n){this.movable.moveAxis("x",-n)},transitionTo:function(n,t,i){i?this.moveTo(-n):this.transition.moveTo({location:n,duration:this.duration,ease:t})}});i.mobile.ui.ScrollViewElasticPane=ht;b=i.Observable.extend({init:function(n,t,r){var u=this;i.Observable.fn.init.call(this);u.element=n;u.pane=t;u._getPages();this.page=0;this.pageSize=r.pageSize||1;this.contentHeight=r.contentHeight;this.enablePager=r.enablePager;this.pagerOverlay=r.pagerOverlay},scrollTo:function(n,t){this.page=n;this.pane.transitionTo(-n*this.pane.size().width,s.easeOutExpo,t)},paneMoved:function(n,t,i,r){var u=this,f=u.pane,l=f.size().width*u.pageSize,o=nt,y=t?s.easeOutBack:s.easeOutExpo,h,e;n===a?o=c:n===v&&(o=tt);e=o(f.offset()/l);h=wt(u.minSnap,bt(-e*l,u.maxSnap));e!=u.page&&i&&i({currentPage:u.page,nextPage:e})&&(h=-u.page*f.size().width);f.transitionTo(h,y,r)},updatePage:function(){var n=this.pane,t=nt(n.offset()/n.size().width);return t!=this.page?(this.page=t,!0):!1},forcePageUpdate:function(){return this.updatePage()},resizeTo:function(n){var r=this.pane,t=n.width,i,u;this.pageElements.width(t);this.contentHeight==="100%"&&(i=this.element.parent().height(),this.enablePager===!0&&(u=this.element.parent().find("ol.km-pages"),!this.pagerOverlay&&u.length&&(i-=u.outerHeight(!0))),this.element.css("height",i),this.pageElements.css("height",i));r.updateDimension();this._paged||(this.page=tt(r.offset()/t));this.scrollTo(this.page,!0);this.pageCount=c(r.total()/t);this.minSnap=-(this.pageCount-1)*t;this.maxSnap=0},_getPages:function(){this.pageElements=this.element.find(i.roleSelector("page"));this._paged=this.pageElements.length>0}});i.mobile.ui.ScrollViewContent=b;o=i.Observable.extend({init:function(n,t,r){var u=this;i.Observable.fn.init.call(this);u.element=n;u.pane=t;u.options=r;u._templates();u.page=r.page||0;u.pages=[];u._initPages();u.resizeTo(u.pane.size());u.pane.dimension.forceEnabled()},setDataSource:function(n){this.dataSource=g.create(n);this._buffer();this._pendingPageRefresh=!1;this._pendingWidgetRefresh=!1},_viewShow:function(){var n=this;n._pendingWidgetRefresh&&(setTimeout(function(){n._resetPages()},0),n._pendingWidgetRefresh=!1)},_buffer:function(){var n=this.options.itemsPerPage;this.buffer&&this.buffer.destroy();this.buffer=n>1?new pt(this.dataSource,n):new yt(this.dataSource,n*3);this._resizeProxy=r(this,"_onResize");this._resetProxy=r(this,"_onReset");this._endReachedProxy=r(this,"_onEndReached");this.buffer.bind({resize:this._resizeProxy,reset:this._resetProxy,endreached:this._endReachedProxy})},_templates:function(){var n=this.options.template,t=this.options.emptyTemplate,u={},f={};typeof n===rt&&(u.template=n,n="#=this.template(data)#");this.template=r(i.template(n),u);typeof t===rt&&(f.emptyTemplate=t,t="#=this.emptyTemplate(data)#");this.emptyTemplate=r(i.template(t),f)},_initPages:function(){for(var i=this.pages,r=this.element,n,t=0;t<kt;t++)n=new k(r),i.push(n);this.pane.updateDimension()},resizeTo:function(n){for(var t,u,i=this.pages,f=this.pane,r=0;r<i.length;r++)i[r].setWidth(n.width);this.options.contentHeight==="auto"?this.element.css("height",this.pages[1].element.height()):this.options.contentHeight==="100%"&&(t=this.element.parent().height(),this.options.enablePager===!0&&(u=this.element.parent().find("ol.km-pages"),!this.options.pagerOverlay&&u.length&&(t-=u.outerHeight(!0))),this.element.css("height",t),i[0].element.css("height",t),i[1].element.css("height",t),i[2].element.css("height",t));f.updateDimension();this._repositionPages();this.width=n.width},scrollTo:function(n){var t=this.buffer,i;(t.syncDataSource(),i=t.at(n),i)&&(this._updatePagesContent(n),this.page=n)},paneMoved:function(n,t,r,u){var f=this,h=f.pane,y=h.size().width,s=h.offset(),c=Math.abs(s)>=y/3,p=t?i.effects.Transition.easeOutBack:i.effects.Transition.easeOutExpo,l=f.page+2>f.buffer.total(),o,e=0;n===v?f.page!==0&&(e=-1):n!==a||l?s>0&&c&&!l?e=1:s<0&&c&&f.page!==0&&(e=-1):e=1;o=f.page;e&&(o=e>0?o+1:o-1);r&&r({currentPage:f.page,nextPage:o})&&(e=0);e===0?f._cancelMove(p,u):e===-1?f._moveBackward(u):e===1&&f._moveForward(u)},updatePage:function(){var n=this.pages;return this.pane.offset()===0?!1:(this.pane.offset()>0?(n.push(this.pages.shift()),this.page++,this.setPageContent(n[2],this.page+1)):(n.unshift(this.pages.pop()),this.page--,this.setPageContent(n[0],this.page-1)),this._repositionPages(),this._resetMovable(),!0)},forcePageUpdate:function(){var n=this.pane.offset(),t=this.pane.size().width*3/4;return h(n)>t?this.updatePage():!1},_resetMovable:function(){this.pane.moveTo(0)},_moveForward:function(n){this.pane.transitionTo(-this.width,i.effects.Transition.easeOutExpo,n)},_moveBackward:function(n){this.pane.transitionTo(this.width,i.effects.Transition.easeOutExpo,n)},_cancelMove:function(n,t){this.pane.transitionTo(0,n,t)},_resetPages:function(){this.page=this.options.page||0;this._updatePagesContent(this.page);this._repositionPages();this.trigger("reset")},_onResize:function(){this.pageCount=c(this.dataSource.total()/this.options.itemsPerPage);this._pendingPageRefresh&&(this._updatePagesContent(this.page),this._pendingPageRefresh=!1);this.trigger("resize")},_onReset:function(){this.pageCount=c(this.dataSource.total()/this.options.itemsPerPage);this._resetPages()},_onEndReached:function(){this._pendingPageRefresh=!0},_repositionPages:function(){var n=this.pages;n[0].position(dt);n[1].position(gt);n[2].position(ni)},_updatePagesContent:function(n){var t=this.pages,i=n||0;this.setPageContent(t[0],i-1);this.setPageContent(t[1],i);this.setPageContent(t[2],i+1)},setPageContent:function(t,r){var f=this.buffer,e=this.template,o=this.emptyTemplate,u=null;r>=0&&(u=f.at(r),n.isArray(u)&&!u.length&&(u=null));this.trigger(ut,{item:t.element});u!==null?t.content(e(u)):t.content(o({}));i.mobile.init(t.element);this.trigger(w,{item:t.element,data:u,ns:i.mobile.ui})}});i.mobile.ui.VirtualScrollViewContent=o;k=i.Class.extend({init:function(t){this.element=n("<div class='"+it+"'><\/div>");this.width=t.width();this.element.width(this.width);t.append(this.element)},content:function(n){this.element.html(n)},position:function(n){this.element.css("transform","translate3d("+this.width*n+"px, 0, 0)")},setWidth:function(n){this.width=n;this.element.width(n)}});i.mobile.ui.VirtualPage=k;ct=y.extend({init:function(n,t){var u=this,h,e,s;y.fn.init.call(u,n,t);t=u.options;n=u.element;i.stripWhitespace(n[0]);n.wrapInner("<div/>").addClass("km-scrollview");this.options.enablePager&&(this.pager=new ft(this),this.options.pagerOverlay&&n.addClass("km-scrollview-overlay"));u.inner=n.children().first();u.page=0;u.inner.css("height",t.contentHeight);u.pane=new ht(u.inner,{duration:this.options.duration,transitionEnd:r(this,"_transitionEnd"),dragStart:r(this,"_dragStart"),dragEnd:r(this,"_dragEnd"),change:r(this,f)});u.bind("resize",function(){u.pane.refresh()});u.page=t.page;h=this.inner.children().length===0;e=h?new o(u.inner,u.pane,t):new b(u.inner,u.pane,t);e.page=u.page;e.bind("reset",function(){this._pendingPageRefresh=!1;u._syncWithContent();u.trigger(f,{pageCount:e.pageCount,page:e.page})});e.bind("resize",function(){u.trigger(f,{pageCount:e.pageCount,page:e.page})});e.bind(w,function(n){u.trigger(w,n);u.angular("compile",function(){return{elements:n.item,data:[{dataItem:n.data}]}})});e.bind(ut,function(n){u.angular("cleanup",function(){return{elements:n.item}})});u._content=e;u.setDataSource(t.dataSource);s=u.container();s.nullObject?(u.viewInit(),u.viewShow()):s.bind("show",r(this,"viewShow")).bind("init",r(this,"viewInit"))},options:{name:"ScrollView",page:0,duration:400,velocityThreshold:.8,contentHeight:"auto",pageSize:1,itemsPerPage:1,bounceVelocityThreshold:1.6,enablePager:!0,pagerOverlay:!1,autoBind:!0,template:"",emptyTemplate:""},events:[l,u,f],destroy:function(){y.fn.destroy.call(this);i.destroy(this.element)},viewInit:function(){this.options.autoBind&&this._content.scrollTo(this._content.page,!0)},viewShow:function(){this.pane.refresh()},refresh:function(){var n=this._content;n.resizeTo(this.pane.size());this.page=n.page;this.trigger(f,{pageCount:n.pageCount,page:n.page})},content:function(n){this.element.children().first().html(n);this._content._getPages();this.pane.refresh()},value:function(n){var t=this.dataSource;if(n)this.scrollTo(t.indexOf(n),!0);else return t.at(this.page)},scrollTo:function(n,t){this._content.scrollTo(n,t);this._syncWithContent()},prev:function(){var n=this,i=n.page-1;n._content instanceof o?n._content.paneMoved(v,t,function(t){return n.trigger(l,t)}):i>-1&&n.scrollTo(i)},next:function(){var n=this,i=n.page+1;n._content instanceof o?n._content.paneMoved(a,t,function(t){return n.trigger(l,t)}):i<n._content.pageCount&&n.scrollTo(i)},setDataSource:function(n){if(this._content instanceof o){var t=!n;this.dataSource=g.create(n);this._content.setDataSource(this.dataSource);this.options.autoBind&&!t&&this.dataSource.fetch()}},items:function(){return this.element.find("."+it)},_syncWithContent:function(){var i=this._content.pages,r=this._content.buffer,n,f;this.page=this._content.page;n=r?r.at(this.page):t;n instanceof Array||(n=[n]);f=i?i[1].element:t;this.trigger(u,{page:this.page,element:f,data:n})},_dragStart:function(){this._content.forcePageUpdate()&&this._syncWithContent()},_dragEnd:function(n){var u=this,t=n.x.velocity,r=this.options.velocityThreshold,i=ti,f=h(t)>this.options.bounceVelocityThreshold;t>r?i=v:t<-r&&(i=a);this._content.paneMoved(i,f,function(n){return u.trigger(l,n)})},_transitionEnd:function(){this._content.updatePage()&&this._syncWithContent()}});d.plugin(ct)})(window.kendo.jQuery)}(),function(){(function(n,t){function p(n,t,i){return Math.max(t,Math.min(i,n))}var i=window.kendo,o=i.mobile.ui,u=o.Widget,a=i.support,s="change",h="km-switch-on",c="km-switch-off",f="margin-left",l="km-state-active",v="km-state-disabled",r="disabled",y=a.transitions.css+"transform",e=n.proxy,w='<span class="km-switch km-widget">        <span class="km-switch-wrapper"><span class="km-switch-background"><\/span><\/span>         <span class="km-switch-container"><span class="km-switch-handle" >             <span class="km-switch-label-on">{0}<\/span>             <span class="km-switch-label-off">{1}<\/span>         <\/span>     <\/span>',b=u.extend({init:function(t,e){var o=this,s;u.fn.init.call(o,t,e);e=o.options;o.wrapper=n(i.format(w,e.onLabel,e.offLabel));o.handle=o.wrapper.find(".km-switch-handle");o.background=o.wrapper.find(".km-switch-background");o.wrapper.insertBefore(o.element).prepend(o.element);o._drag();o.origin=parseInt(o.background.css(f),10);o.constrain=0;o.snapPoint=0;t=o.element[0];t.type="checkbox";o._animateBackground=!0;s=o.options.checked;s===null&&(s=t.checked);o.check(s);o.options.enable=o.options.enable&&!o.element.attr(r);o.enable(o.options.enable);o.refresh();i.notify(o,i.mobile.ui)},refresh:function(){var n=this,t=n.handle.outerWidth(!0);n.width=n.wrapper.width();n.constrain=n.width-t;n.snapPoint=n.constrain/2;typeof n.origin!="number"&&(n.origin=parseInt(n.background.css(f),10));n.background.data("origin",n.origin);n.check(n.element[0].checked)},events:[s],options:{name:"Switch",onLabel:"on",offLabel:"off",checked:null,enable:!0},check:function(n){var i=this,r=i.element[0];if(n===t)return r.checked;i._position(n?i.constrain:0);r.checked=n;i.wrapper.toggleClass(h,n).toggleClass(c,!n)},value:function(){return this.check.apply(this,arguments)},destroy:function(){u.fn.destroy.call(this);this.userEvents.destroy()},toggle:function(){var n=this;n.check(!n.element[0].checked)},enable:function(n){var t=this.element,i=this.wrapper;typeof n=="undefined"&&(n=!0);this.options.enable=n;n?t.removeAttr(r):t.attr(r,r);i.toggleClass(v,!n)},_resize:function(){this.refresh()},_move:function(n){var t=this;n.preventDefault();t._position(p(t.position+n.x.delta,0,t.width-t.handle.outerWidth(!0)))},_position:function(n){var t=this;t.position=n;t.handle.css(y,"translatex("+n+"px)");t._animateBackground&&t.background.css(f,t.origin+n)},_start:function(){this.options.enable?(this.userEvents.capture(),this.handle.addClass(l)):this.userEvents.cancel()},_stop:function(){var n=this;n.handle.removeClass(l);n._toggle(n.position>n.snapPoint)},_toggle:function(n){var t=this,e=t.handle,u=t.element[0],o=u.checked,f=i.mobile.application&&i.mobile.application.os.wp?100:200,r;t.wrapper.toggleClass(h,n).toggleClass(c,!n);t.position=r=n*t.constrain;t._animateBackground&&t.background.kendoStop(!0,!0).kendoAnimate({effects:"slideMargin",offset:r,reset:!0,reverse:!n,axis:"left",duration:f});e.kendoStop(!0,!0).kendoAnimate({effects:"slideTo",duration:f,offset:r+"px,0",reset:!0,complete:function(){o!==n&&(u.checked=n,t.trigger(s,{checked:n}))}})},_drag:function(){var n=this;n.userEvents=new i.UserEvents(n.wrapper,{tap:function(){n.options.enable&&n._toggle(!n.element[0].checked)},start:e(n._start,n),move:e(n._move,n),end:e(n._stop,n)})}});o.plugin(b)})(window.kendo.jQuery)}(),function(){(function(n){function e(t){return n('<span class="km-badge">'+t+"<\/span>")}var t=window.kendo,r=t.mobile.ui,u=r.Widget,i="km-state-active",f="select",o=u.extend({init:function(t,r){var f=this;u.fn.init.call(f,t,r);f.container().bind("show",n.proxy(this,"refresh"));f.element.addClass("km-tabstrip").find("a").each(f._buildButton).eq(f.options.selectedIndex).addClass(i);f.element.on("down","a","_release")},events:[f],switchTo:function(t){var i=this.element.find("a"),r,u,f=0,e=i.length;if(isNaN(t)){for(;f<e;f++)if(r=i[f],u=r.href.replace(/(\#.+)(\?.+)$/,"$1"),u.indexOf(t,u.length-t.length)!==-1)return this._setActiveItem(n(r)),!0}else return this._setActiveItem(i.eq(t)),!0;return!1},switchByFullUrl:function(n){var t;t=this.element.find("a[href$='"+n+"']");this._setActiveItem(t)},clear:function(){this.currentItem().removeClass(i)},currentItem:function(){return this.element.children("."+i)},badge:function(t,i){var u=this.element,r;return(isNaN(t)||(t=u.children().get(t)),t=u.find(t),r=n(t.find(".km-badge")[0]||e(i).insertAfter(t.children(".km-icon"))),i||i===0)?(r.html(i),this):i===!1?(r.empty().remove(),this):r.html()},_release:function(t){if(!(t.which>1)){var i=this,r=n(t.currentTarget);r[0]!==i.currentItem()[0]&&(i.trigger(f,{item:r})?t.preventDefault():i._setActiveItem(r))}},_setActiveItem:function(n){n[0]&&(this.clear(),n.addClass(i))},_buildButton:function(){var i=n(this),o=t.attrValue(i,"icon"),r=t.attrValue(i,"badge"),u=i.find("img"),f=n('<span class="km-icon"/>');i.addClass("km-button").attr(t.attr("role"),"tab").contents().not(u).wrapAll('<span class="km-text"/>');u[0]?u.addClass("km-image").prependTo(i):(i.prepend(f),o&&(f.addClass("km-"+o),(r||r===0)&&e(r).insertAfter(f)))},refresh:function(n){var t=n.view.id;t&&!this.switchTo(n.view.id)&&this.switchTo(t)},options:{name:"TabStrip",selectedIndex:0,enable:!0}});r.plugin(o)})(window.kendo.jQuery)}(),window.kendo},typeof define=="function"&&define.amd?define:function(n,t){t()}),function(n,t){t(["./kendo.data","./kendo.combobox","./kendo.multiselect","./kendo.validator"],n)}(function(){return function(n,t){function u(t,i,r,u){var f={};return t.sort?(f[this.options.prefix+"sort"]=n.map(t.sort,function(n){return n.field+"-"+n.dir}).join("~"),delete t.sort):f[this.options.prefix+"sort"]="",t.page&&(f[this.options.prefix+"page"]=t.page,delete t.page),t.pageSize&&(f[this.options.prefix+"pageSize"]=t.pageSize,delete t.pageSize),t.group?(f[this.options.prefix+"group"]=n.map(t.group,function(n){return n.field+"-"+n.dir}).join("~"),delete t.group):f[this.options.prefix+"group"]="",t.aggregate&&(f[this.options.prefix+"aggregate"]=n.map(t.aggregate,function(n){return n.field+"-"+n.aggregate}).join("~"),delete t.aggregate),t.filter?(f[this.options.prefix+"filter"]=s(t.filter,r),delete t.filter):(f[this.options.prefix+"filter"]="",delete t.filter),delete t.take,delete t.skip,o(f,t,"",u),f}function v(n){var t=i.culture().numberFormat[f];return n.toString().replace(f,t)}function y(n,t){return n instanceof Date?n=t?i.stringify(n).replace(/"/g,""):i.format("{0:G}",n):typeof n=="number"&&(n=v(n)),n}function e(n,i,r,u,f,e){l(i)?p(n,i,f,e):a(i)?o(n,i,f,e):n[f]===t&&(n[f]=r[u]=y(i,e))}function o(n,t,i,r){var u,f,o;for(u in t)f=i?i+"."+u:u,o=t[u],e(n,o,t,u,f,r)}function p(n,t,i,r){for(var u=0,f=0;u<t.length;u++){var s=t[u],o="["+f+"]",h=i+o;e(n,s,t,o,h,r);f++}}function s(i,r){return i.filters?n.map(i.filters,function(n){var i=n.filters&&n.filters.length>1,t=s(n,r);return t&&i&&(t="("+t+")"),t}).join("~"+i.logic+"~"):i.field?i.field+"~"+i.operator+"~"+w(i.value,r):t}function w(n,t){if(typeof n=="string")if(n.indexOf("Date(")>-1)n=new Date(parseInt(n.replace(/^\/Date\((.*?)\)\/$/,"$1"),10));else return n=n.replace(c,"''"),t&&(n=encodeURIComponent(n)),"'"+n+"'";return n&&n.getTime?"datetime'"+i.format("{0:yyyy-MM-ddTHH-mm-ss}",n)+"'":n}function h(t){return{value:typeof t.Key!="undefined"?t.Key:t.value,field:t.Member||t.field,hasSubgroups:t.HasSubgroups||t.hasSubgroups||!1,aggregates:k(t.Aggregates||t.aggregates),items:t.HasSubgroups?n.map(t.Items||t.items,h):t.Items||t.items}}function b(n){var t={};return t[n.AggregateMethodName.toLowerCase()]=n.Value,t}function k(n){var t={},i,r,u;for(i in n){t={};u=n[i];for(r in u)t[r.toLowerCase()]=u[r];n[i]=t}return n}var i=window.kendo,c=/'/ig,r=n.extend,l=n.isArray,a=n.isPlainObject,f=".";r(!0,i.data,{schemas:{"aspnetmvc-ajax":{groups:function(t){return n.map(this._dataAccessFunction(t),h)},aggregates:function(n){n=n.d||n;for(var u={},f=n.AggregateResults||[],t,i=0,e=f.length;i<e;i++)t=f[i],u[t.Member]=r(!0,u[t.Member],b(t));return u}}}});r(!0,i.data,{transports:{"aspnetmvc-ajax":i.data.RemoteTransport.extend({init:function(n){var t=this,f=(n||{}).stringifyDates;i.data.RemoteTransport.fn.init.call(this,r(!0,{},this.options,n,{parameterMap:function(n,i){return u.call(t,n,i,!1,f)}}))},read:function(n){var t=this.options.data,r=this.options.read.url;t?(r&&(this.options.data=null),!t.Data.length&&r?i.data.RemoteTransport.fn.read.call(this,n):n.success(t)):i.data.RemoteTransport.fn.read.call(this,n)},options:{read:{type:"POST"},update:{type:"POST"},create:{type:"POST"},destroy:{type:"POST"},parameterMap:u,prefix:""}})}});r(!0,i.data,{schemas:{webapi:i.data.schemas["aspnetmvc-ajax"]}});r(!0,i.data,{transports:{webapi:i.data.RemoteTransport.extend({init:function(n){var e=this,o=(n||{}).stringifyDates,t,f;n.update&&(t=typeof n.update=="string"?n.update:n.update.url,n.update=r(n.update,{url:function(r){return i.format(t,r[n.idField])}}));n.destroy&&(f=typeof n.destroy=="string"?n.destroy:n.destroy.url,n.destroy=r(n.destroy,{url:function(t){return i.format(f,t[n.idField])}}));n.create&&typeof n.create=="string"&&(n.create={url:n.create});i.data.RemoteTransport.fn.init.call(this,r(!0,{},this.options,n,{parameterMap:function(n,t){return u.call(e,n,t,!1,o)}}))},read:function(n){var t=this.options.data,r=this.options.read.url;t?(r&&(this.options.data=null),!t.Data.length&&r?i.data.RemoteTransport.fn.read.call(this,n):n.success(t)):i.data.RemoteTransport.fn.read.call(this,n)},options:{read:{type:"GET"},update:{type:"PUT"},create:{type:"POST"},destroy:{type:"DELETE"},parameterMap:u,prefix:""}})}});r(!0,i.data,{transports:{"aspnetmvc-server":i.data.RemoteTransport.extend({init:function(n){var t=this;i.data.RemoteTransport.fn.init.call(this,r(n,{parameterMap:function(n,i){return u.call(t,n,i,!0)}}))},read:function(t){var r,u=this.options.prefix,f=[u+"sort",u+"page",u+"pageSize",u+"group",u+"aggregate",u+"filter"],e=new RegExp("("+f.join("|")+")=[^&]*&?","g"),i;i=location.search.replace(e,"").replace("?","");i.length&&!/&$/.test(i)&&(i+="&");t=this.setup(t,"read");r=t.url;r.indexOf("?")>=0?(i=i.replace(/(.*?=.*?)&/g,function(n){return r.indexOf(n.substr(0,n.indexOf("=")))>=0?"":n}),r+="&"+i):r+="?"+i;r+=n.map(t.data,function(n,t){return t+"="+n}).join("&");location.href=r}})}})}(window.kendo.jQuery),function(n){var i=window.kendo,t=i.ui;t&&t.ComboBox&&(t.ComboBox.requestData=function(t){var i=n(t).data("kendoComboBox"),u=i.dataSource.filter(),r=i.input.val();return u||(r=""),{text:r}})}(window.kendo.jQuery),function(n){var i=window.kendo,t=i.ui;t&&t.MultiSelect&&(t.MultiSelect.requestData=function(t){var i=n(t).data("kendoMultiSelect"),r=i.input.val();return{text:r!==i.options.placeholder?r:""}})}(window.kendo.jQuery),function(n){var t=window.kendo,u=t.ui,i=n.extend,r=n.isFunction;i(!0,t.data,{schemas:{"imagebrowser-aspnetmvc":{data:function(n){return n||[]},model:{id:"name",fields:{name:{field:"Name"},size:{field:"Size"},type:{field:"EntryType",parse:function(n){return n==0?"f":"d"}}}}}}});i(!0,t.data,{transports:{"imagebrowser-aspnetmvc":t.data.RemoteTransport.extend({init:function(i){t.data.RemoteTransport.fn.init.call(this,n.extend(!0,{},this.options,i))},_call:function(i,u){u.data=n.extend({},u.data,{path:this.options.path()});r(this.options[i])?this.options[i].call(this,u):t.data.RemoteTransport.fn[i].call(this,u)},read:function(n){this._call("read",n)},create:function(n){this._call("create",n)},destroy:function(n){this._call("destroy",n)},update:function(){},options:{read:{type:"POST"},update:{type:"POST"},create:{type:"POST"},destroy:{type:"POST"},parameterMap:function(n,t){return t!="read"&&(n.EntryType=n.EntryType==="f"?0:1),n}}})}})}(window.kendo.jQuery),function(n){function r(){var n,i={};for(n in t)i["mvc"+n]=s(n);return i}function u(){var n,i={};for(n in t)i["mvc"+n]=h(n);return i}function f(n,t){var f={},r,e=n.data(),o=t.length,i;for(var u in e)i=u.toLowerCase(),r=i.indexOf(t),r>-1&&(i=i.substring(r+o,u.length),i&&(f[i]=e[u]));return f}function e(t){for(var u=t.Fields||[],f={},i=0,r=u.length;i<r;i++)n.extend(!0,f,o(u[i]));return f}function o(n){for(var f={},e={},u=n.FieldName,i=n.ValidationRules,r,o,t=0,s=i.length;t<s;t++)r=i[t].ValidationType,o=i[t].ValidationParameters,f[u+r]=l(u,r,o),e[u+r]=c(i[t].ErrorMessage);return{rules:f,messages:e}}function s(n){return function(t){return t.attr("data-val-"+n)}}function h(n){return function(i){return i.filter("[data-val-"+n+"]").length?t[n](i,f(i,n)):!0}}function c(n){return function(){return n}}function l(n,i,r){return function(u){return u.filter("[name="+n+"]").length?t[i](u,r):!0}}function a(n,t){return typeof t=="string"&&(t=new RegExp("^(?:"+t+")$")),t.test(n)}var i=/("|\%|'|\[|\]|\$|\.|\,|\:|\;|\+|\*|\&|\!|\#|\(|\)|<|>|\=|\?|\@|\^|\{|\}|\~|\/|\||`)/g,t={required:function(n){var t=n.val(),r=n.filter("[type=checkbox]"),f,u;return r.length&&(f=r[0].name.replace(i,"\\$1"),u=r.next("input:hidden[name='"+f+"']"),t=u.length?u.val():n.attr("checked")==="checked"),!(t===""||!t)},number:function(n){return n.val()===""||n.val()==null||kendo.parseFloat(n.val())!==null},regex:function(n,t){return n.val()!==""?a(n.val(),t.pattern):!0},range:function(n,t){return n.val()!==""?this.min(n,t)&&this.max(n,t):!0},min:function(n,t){var i=parseFloat(t.min)||0,r=kendo.parseFloat(n.val());return i<=r},max:function(n,t){var i=parseFloat(t.max)||0,r=kendo.parseFloat(n.val());return r<=i},date:function(n){return n.val()===""||kendo.parseDate(n.val())!==null},length:function(t,i){if(t.val()!==""){var r=n.trim(t.val()).length;return(!i.min||r>=(i.min||0))&&(!i.max||r<=(i.max||0))}return!0}};n.extend(!0,kendo.ui.validator,{rules:u(),messages:r(),messageLocators:{mvcLocator:{locate:function(n,t){return t=t.replace(i,"\\$1"),n.find(".field-validation-valid[data-valmsg-for='"+t+"'], .field-validation-error[data-valmsg-for='"+t+"']")},decorate:function(n,t){n.addClass("field-validation-error").attr("data-valmsg-for",t||"")}},mvcMetadataLocator:{locate:function(n,t){return t=t.replace(i,"\\$1"),n.find("#"+t+"_validationMessage.field-validation-valid")},decorate:function(n,t){n.addClass("field-validation-error").attr("id",t+"_validationMessage")}}},ruleResolvers:{mvcMetaDataResolver:{resolve:function(t){var r=window.mvcClientValidationMetadata||[],i;if(r.length)for(t=n(t),i=0;i<r.length;i++)if(r[i].FormId==t.attr("id"))return e(r[i]);return{}}}}})}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t){t()})