(function(n,t){t("kendo.core",["jquery"],n)})(function(){return function(n,t,i){function ut(){}function ki(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)?ur[t].substring(0,i)+n:n}function fr(n){var u=n.css(r.support.transitions.css+"box-shadow")||n.css("box-shadow"),t=u?u.match(yi)||[0,0,0,0,0]:[0,0,0,0,0],i=c.max(+t[3],+(t[4]||0));return{left:-t[1]+i,right:+t[1]+i,bottom:+t[2]+i}}function er(t,i){var a=u.browser,e,h=r._outerWidth,v=r._outerHeight,f,l;if(t.parent().hasClass("k-animation-container"))f=t.parent(".k-animation-container"),l=f[0].style,f.is(":hidden")&&f.css({display:"",position:""}),e=tt.test(l.width)||tt.test(l.height),e||f.css({width:h(t)+1,height:v(t),boxSizing:"content-box",mozBoxSizing:"content-box",webkitBoxSizing:"content-box"});else{var o=t[0].style.width,s=t[0].style.height,y=tt.test(o),p=tt.test(s);e=y||p;!y&&(!i||i&&o)&&(o=i?h(t)+1:h(t));!p&&(!i||i&&s)&&(s=v(t));t.wrap(n("<div/>").addClass("k-animation-container").css({width:o+1,height:s}));e&&t.css({width:"100%",height:"100%",boxSizing:"border-box",mozBoxSizing:"border-box",webkitBoxSizing:"border-box"})}return a.msie&&c.floor(a.version)<=7&&(t.css({zoom:1}),t.children(".k-menu").width(t.width())),t.parent()}function ct(n){for(var t=1,i=arguments.length,t=1;t<i;t++)ni(n,arguments[t]);return n}function ni(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===p&&i!==null?i.constructor:null,f&&f!==Array&&f!==s&&f!==h&&f!==c&&f!==l&&f!==RegExp?i instanceof Date?n[u]=new Date(i.getTime()):ft(i.clone)?n[u]=i.clone():(o=n[u],n[u]=typeof o===p?o||{}:{},ni(n[u],i)):e!==rt&&(n[u]=i);return n}function lt(n,t,r){for(var u in t)if(t.hasOwnProperty(u)&&t[u].test(n))return u;return r!==i?r:n}function or(n){return n.replace(/([a-z][A-Z])/g,function(n){return n.charAt(0)+"-"+n.charAt(1).toLowerCase()})}function ti(n){return n.replace(/\-(\w)/g,function(n,t){return t.toUpperCase()})}function ii(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[ti(t)]})),r.size(u)||(u=f),u}function sr(n){if(n&&n.className&&typeof n.className=="string"&&n.className.indexOf("k-auto-scrollable")>-1)return!0;var t=ii(n,["overflow"]).overflow;return t=="auto"||t=="scroll"}function hr(t,r){var o=u.browser.webkit,s=u.browser.mozilla,f=t instanceof n?t[0]:t,e;if(t)if(e=u.isRtl(t),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 cr(n){var t=0;for(var i in n)n.hasOwnProperty(i)&&i!="toJSON"&&t++;return t}function lr(n,i,r){var f,e,o;return i||(i="offset"),f=n[i](),e={top:f.top,right:f.right,bottom:f.bottom,left:f.left},u.browser.msie&&(u.pointers||u.msPointers)&&!r&&(o=u.isRtl(n)?1:-1,e.top-=t.pageYOffset-document.documentElement.scrollTop,e.left-=t.pageXOffset+o*document.documentElement.scrollLeft),e}function ar(n){var t={};return d(typeof n=="string"?n.split(" "):n,function(n){t[n]=this}),t}function vr(n){return new r.effects.Element(n)}function yr(n,t,i,r){return typeof n===e&&(ft(t)&&(r=t,t=400,i=!1),ft(i)&&(r=i,i=!1),typeof t===kt&&(i=t,t=400),n={effects:n,duration:t,reverse:i,complete:r}),h({effects:{},duration:400,reverse:!1,init:g,teardown:g,hide:!1},n,{completeCallback:n.complete,complete:g})}function ui(t,i,r,u,f){for(var e=0,s=t.length,o;e<s;e++)o=n(t[e]),o.queue(function(){w.promise(o,yr(i,r,u,f))});return t}function pr(n,t,i,r){return t&&(t=t.split(" "),d(t,function(t,i){n.toggleClass(i,r)})),n}function nu(n){return(""+n).replace(wr,"&amp;").replace(br,"&lt;").replace(gr,"&gt;").replace(kr,"&quot;").replace(dr,"&#39;")}function yt(n,t){var u;return t.indexOf("data")===0&&(t=t.substring(4),t=t.charAt(0).toLowerCase()+t.substring(1)),t=t.replace(uu,"-$1"),u=n.getAttribute("data-"+r.ns+t),u===null?u=i:u==="null"?u=null:u==="true"?u=!0:u==="false"?u=!1:pi.test(u)?u=parseFloat(u):iu.test(u)&&!ru.test(u)&&(u=new Function("return ("+u+")")()),u}function oi(t,u){var o={},e,f;for(e in u)f=yt(t,e),f!==i&&(tu.test(e)&&(f=typeof f=="string"?r.template(n("#"+f).html()):t.getAttribute(e)),o[e]=f);return o}function fu(t,i){return n.contains(t,i)?-1:1}function eu(){var t=n(this);return n.inArray(t.attr("data-"+r.ns+"role"),["slider","rangeslider"])>-1||t.is(":visible")}function ou(n,t){var i=n.nodeName.toLowerCase();return(/input|select|textarea|button|object/.test(i)?!n.disabled:"a"===i?n.href||t:t)&&su(n)}function su(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,d=n.each,ai=n.isArray,ot=n.proxy,g=n.noop,c=Math,v,nt=t.JSON||{},u={},tt=/%/,vi=/\{(\d+)(:[^\}]+)?\}/g,yi=/(\d+(?:\.?)\d*)px\s*(\d+(?:\.?)\d*)px\s*(\d+(?:\.?)\d*)px\s*(\d+)?/i,pi=/^(\+|-?)\d+(\.?)\d*$/,l="function",e="string",y="number",p="object",it="null",kt="boolean",rt="undefined",dt={},gt={},st=[].slice,ri,w,at,fi,ei,b,vt,pt,wt,hi,bt,et,ci,li,a;r.version="2017.3.1026".replace(/^\s+|\s+$/g,"");ut.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};ut.prototype._initOptions=function(n){this.options=ct({},this.options,n)};var ft=r.isFunction=function(n){return typeof n=="function"},wi=function(){this._defaultPrevented=!0},bi=function(){return this._defaultPrevented===!0},ht=ut.extend({init:function(){this._events={}},bind:function(n,t,r){var u=this,f,h=typeof n===e?[n]:n,c,s,o,v=typeof t===l,a;if(t===i){for(f in n)u.bind(f,n[f]);return u}for(f=0,c=h.length;f<c;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===l,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=wi,t.isDefaultPrevented=bi,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 di=/^\w+/,gi=/\$\{([^}]*)\}/g,nr=/\\\}/g,tr=/__CURLY__/g,ir=/\\#/g,rr=/__SHARP__/g,ur=["","0","00","000","0000"];v={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(di)[0],c=o.useWithBlock,i="var $kendoOutput, $kendoHtmlEncode = kendo.htmlEncode;",e,f,u;if(ft(n))return n;for(i+=c?"with("+s+"){":"",i+="$kendoOutput=",f=n.replace(nr,"__CURLY__").replace(gi,"#=$kendoHtmlEncode($1)#").replace(tr,"}").replace(ir,"__SHARP__").split("#"),u=0;u<f.length;u++)i+=ki(f[u],u%2==0);i+=c?";}":";";i+="return $kendoOutput;";i=i.replace(rr,"#");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 c,w,a,k,d=n,v,s=f[u],b;if(s&&typeof s===p&&typeof s.toJSON===l&&(s=s.toJSON(u)),typeof t===l&&(s=t.call(f,u,s)),b=typeof s,b===e)return o(s);if(b===y)return isFinite(s)?String(s):it;if(b===kt||b===it)return String(s);if(b===p){if(!s)return it;if(n+=i,v=[],h.apply(s)==="[object Array]"){for(k=s.length,c=0;c<k;c++)v[c]=r(c,s)||it;return a=v.length===0?"[]":n?"[\n"+n+v.join(",\n"+n)+"\n"+d+"]":"["+v.join(",")+"]",n=d,a}if(t&&typeof t===p)for(k=t.length,c=0;c<k;c++)typeof t[c]===e&&(w=t[c],a=r(w,s),a&&v.push(o(w)+(n?": ":":")+a));else for(w in s)Object.hasOwnProperty.call(s,w)&&(a=r(w,s),a&&v.push(o(w)+(n?": ":":")+a));return a=v.length===0?"{}":n?"{\n"+n+v.join(",\n"+n)+"\n"+d+"}":"{"+v.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!==l&&(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 nt.stringify!==l&&(nt.stringify=function(u,f,o){var s;if(n="",i="",typeof o===y)for(s=0;s<o;s+=1)i+=" ";else typeof o===e&&(i=o);if(t=f,f&&typeof f!==l&&(typeof f!==p||typeof f.length!==y))throw new Error("JSON.stringify");return r("",{"":u})})}(),function(){function a(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 v(n){return n&&(n=a(n)),n||r.cultures.current}function rt(n,t,r){r=v(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=c.floor(n.getMilliseconds()/100):t==="ff"?(r=n.getMilliseconds(),r>99&&(r=c.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=c.abs(s/60).toString().split(".")[0],s=c.abs(s)-r*60,r=(h?"+":"-")+f(r)+(":"+f(s))):(t==="zz"||t==="z")&&(r=n.getTimezoneOffset()/60,h=r<0,r=c.abs(r).toString().split(".")[0],r=(h?"+":"-")+(t==="zz"?f(r):r)),r!==i?r:t.slice(1,t.length-1)})}function ut(n,r,f){f=v(f);var l=f.numberFormat,lt=l[u],ct=l.decimals,bt=l.pattern[0],kt=[],at,ft,st,vt,yt,rt=n<0,et,y,pt,ui,dt=t,ut=t,e,it,k,gt,ni,d,a,c,wt,ti,ri,ii,fi,ot=-1,ht;if(n===i)return t;if(!isFinite(n))return n;if(!r)return f.name.length?n.toLocaleString():n.toString();if(yt=g.exec(r),yt){if(r=yt[1].toLowerCase(),ft=r==="c",st=r==="p",(ft||st)&&(l=ft?l.currency:l.percent,lt=l[u],ct=l.decimals,at=l.symbol,bt=l.pattern[rt?0:1]),vt=yt[2],vt&&(ct=+vt),r==="e")return vt?n.toExponential(ct):n.toExponential();if(st&&(n*=100),n=h(n,ct),rt=n<0,n=n.split(u),et=n[0],y=n[1],rt&&(et=et.substring(1)),ut=b(et,0,et.length,l),y&&(ut+=lt+y),r==="n"&&!rt)return ut;for(n=t,e=0,it=bt.length;e<it;e++)k=bt.charAt(e),n+=k==="n"?ut:k==="$"||k==="%"?at:k;return n}if(rt&&(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 kt.push(i),w})),r=r.split(";"),rt&&r[1])r=r[1],ni=!0;else if(n===0){if(r=r[2]||r[0],r.indexOf(o)==-1&&r.indexOf(s)==-1)return r}else r=r[0];if(ri=r.indexOf("%"),ii=r.indexOf("$"),st=ri!=-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,lt=l[u],ct=l.decimals,at=l.symbol),gt=r.indexOf(p)>-1,gt&&(r=r.replace(tt,t)),d=r.indexOf(u),it=r.length,d!=-1?(y=n.toString().split("e"),y=y[1]?h(n,Math.abs(y[1])):y[0],y=y.split(u)[1]||t,c=r.lastIndexOf(s)-d,a=r.lastIndexOf(o)-d,wt=c>-1,ti=a>-1,e=y.length,wt||ti||(r=r.substring(0,d)+r.substring(d+1),it=r.length,d=-1,e=0),wt&&c>a?e=c:a>c&&(ti&&e>a?e=a:wt&&e<c&&(e=c)),e>-1&&(n=h(n,e))):n=h(n),a=r.indexOf(o),fi=c=r.indexOf(s),ot=a==-1&&c!=-1?c:a!=-1&&c==-1?a:a>c?c:a,a=r.lastIndexOf(o),c=r.lastIndexOf(s),ht=a==-1&&c!=-1?c:a!=-1&&c==-1?a:a>c?a:c,ot==it&&(ht=ot),ot!=-1){for(ut=n.toString().split(u),et=ut[0],y=ut[1]||t,pt=et.length,ui=y.length,rt&&n*-1>=0&&(rt=!1),n=r.substring(0,ot),rt&&!ni&&(n+="-"),e=ot;e<it;e++){if(k=r.charAt(e),d==-1){if(ht-e<pt){n+=et;break}}else if(c!=-1&&c<e&&(dt=t),d-e<=pt&&d-e>-1&&(n+=et,e=d),d===e){n+=(y?lt:t)+y;e+=ht-d+1;continue}k===s?(n+=k,dt=k):k===o&&(n+=dt)}if(gt&&(n=b(n,ot+(rt&&!ni?1:0),Math.max(ht,pt+ot),l)),ht>=ot&&(n+=r.substring(ht+1)),ft||st){for(ut=t,e=0,it=n.length;e<it;e++)k=n.charAt(e),ut+=k==="$"||k==="%"?at:k;n=ut}if(it=kt.length,it)for(e=0;e<it;e++)n=n.replace(w,kt[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=".",p=",",o="#",s="0",w="??",l="en-US",it={}.toString;r.cultures["en-US"]={name:l,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=a(n)||u[l],t.calendar=t.calendars.standard,u.current=t;else return u.current};r.findCulture=a;r.getCulture=v;r.culture(l);var b=function(n,t,r,f){var v=n.indexOf(f[u]),y=f.groupSize.slice(),o=y.shift(),s,c,e,h,l,a;if(r=v!==-1?v:r+1,s=n.substring(t,r),c=s.length,c>=o){for(e=c,h=[];e>-1;)if(l=s.substring(e-o,e),l&&h.push(l),e-=o,a=y.shift(),o=a!==i?a:o,o===0){e>0&&h.push(s.substring(0,e));break}s=h.reverse().join(f[p]);n=n.substring(0,t)+s+n.substring(r)}return n},h=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(Math.min(t,20))},k=function(n,t,r){if(t){if(it.call(n)==="[object Date]")return rt(n,t,r);if(typeof n===y)return ut(n,t,r)}return n!==i?n:""};r.format=function(n){var t=arguments;return n.replace(vi,function(n,i,r){var u=t[parseInt(i,10)+1];return k(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=h;r._outerWidth=function(t,i){return n(t).outerWidth(i||!1)||0};r._outerHeight=function(t,i){return n(t).outerHeight(i||!1)||0};r.toString=k}(),function(){function t(n,t,i){return!(n>=t&&n<=i)}function d(n){return n.charAt(0)}function s(t){return n.map(t,d)}function g(n,t){t||n.getHours()!==23||n.setHours(n.getHours()+2)}function nt(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]=nt(n[i]);return t}function tt(n,u,f,e){if(!n)return null;var nt=function(n){for(var t=0;u[et]===n;)t++,et++;return t>0&&(et-=1),t},rt=function(t){var r=o[t]||new RegExp("^\\d{1,"+t+"}"),i=n.substr(y,t).match(r);return i?(i=i[0],y+=i.length,parseInt(i,10)):null},ct=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(y,u),i&&(e=e.toLowerCase()),e==o&&u>f&&(f=u,s=r);return f?(y+=f,s+1):null},lt=function(){var t=!1;return n.charAt(y)===u[et]&&(y++,t=!0),t},b=f.calendars.standard,a=null,ut=null,k=null,l=null,ft=null,ot=null,tt=null,et=0,y=0,pt=!1,wt=new Date,at=b.twoDigitYearMax||2029,ht=wt.getFullYear(),w,c,gt,bt,kt,dt,st,vt,yt,d,it,ni,ti;for(u||(u="d"),bt=b.patterns[u],bt&&(u=bt),u=u.split(""),gt=u.length;et<gt;et++)if(w=u[et],pt)w==="'"?pt=!1:lt();else if(w==="d"){if(c=nt("d"),b._lowerDays||(b._lowerDays=h(b.days)),k!==null&&c>2)continue;if(k=c<3?rt(2):ct(b._lowerDays[c==3?"namesAbbr":"names"],!0),k===null||t(k,1,31))return null}else if(w==="M"){if(c=nt("M"),b._lowerMonths||(b._lowerMonths=h(b.months)),ut=c<3?rt(2):ct(b._lowerMonths[c==3?"namesAbbr":"names"],!0),ut===null||t(ut,1,12))return null;ut-=1}else if(w==="y"){if(c=nt("y"),a=rt(c),a===null)return null;c==2&&(typeof at=="string"&&(at=ht+parseInt(at,10)),a=ht-ht%100+a,a>at&&(a-=100))}else if(w==="h"){if(nt("h"),l=rt(2),l==12&&(l=0),l===null||t(l,0,11))return null}else if(w==="H"){if(nt("H"),l=rt(2),l===null||t(l,0,23))return null}else if(w==="m"){if(nt("m"),ft=rt(2),ft===null||t(ft,0,59))return null}else if(w==="s"){if(nt("s"),ot=rt(2),ot===null||t(ot,0,59))return null}else if(w==="f"){if(c=nt("f"),ti=n.substr(y,c).match(o[3]),tt=rt(c),tt!==null&&(tt=parseFloat("0."+ti[0],10),tt=r._round(tt,3)*1e3),tt===null||t(tt,0,999))return null}else if(w==="t"){if(c=nt("t"),vt=b.AM,yt=b.PM,c===1&&(vt=s(vt),yt=s(yt)),kt=ct(yt),!kt&&!ct(vt))return null}else if(w==="z"){if(dt=!0,c=nt("z"),n.substr(y,1)==="Z"){lt();continue}if((st=n.substr(y,6).match(c>2?p:v),!st)||(st=st[0].split(":"),d=st[0],it=st[1],!it&&d.length>3&&(y=d.length-2,it=d.substring(y),d=d.substring(0,y)),d=parseInt(d,10),t(d,-12,13))||c>2&&(it=parseInt(it,10),isNaN(it)||t(it,0,59)))return null}else if(w==="'")pt=!0,lt();else if(!lt())return null;return e&&!/^\s*$/.test(n.substr(y))?null:(ni=l!==null||ft!==null||ot||null,a===null&&ut===null&&k===null&&ni?(a=ht,ut=wt.getMonth(),k=wt.getDate()):(a===null&&(a=ht),k===null&&(k=1)),kt&&l<12&&(l+=12),dt?(d&&(l+=-d),it&&(ft+=-it),n=new Date(Date.UTC(a,ut,k,l,ft,ot,tt))):(n=new Date(a,ut,k,l,ft,ot,tt),g(n,l)),a<100&&n.setFullYear(a),n.getDate()!==k&&dt===i)?null:n}function it(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}function rt(n){for(var o=c.max(f.length,e.length),s=n.calendar.patterns,u,i,r=[],t=0;t<o;t++){for(u=f[t],i=0;i<u.length;i++)r.push(s[u[i]]);r=r.concat(e[t])}return r}function l(n,t,i,u){var o,f,h,e,s;if(k.call(n)==="[object Date]")return n;if(o=0,f=null,n&&n.indexOf("/D")===0&&(f=w.exec(n),f))return f=f[1],e=b.exec(f.substring(1)),f=new Date(parseInt(f,10)),e&&(e=it(e[0]),f=r.timezone.apply(f,0),f=r.timezone.convert(f,0,-1*e)),f;for(i=r.getCulture(i),t||(t=rt(i)),t=ai(t)?t:[t],h=t.length;o<h;o++)if(f=tt(n,t[o],i,u),f)return f;return dsiCommon.isNullOrEmpty(f)&&!dsiCommon.isNullOrEmpty(n)&&(f=new Date(Date.parse(n,"yyyy-MM-dd HH:mm:ss")),f=="Invalid Date"?f=null:(s=f.getFullYear(),s<1970&&n.indexOf(s.toString())==-1&&f.setFullYear(s+100))),f}var u=/\u00A0/g,a=/[eE][\-+]?[0-9]+/,v=/[+|\-]\d{1,2}/,p=/[+|\-]\d{1,2}:?\d{2}/,w=/^\/Date\((.*?)\)\/$/,b=/[+-]\d*/,f=[[],["G","g","F"],["D","d","y","m","T","t"]],e=[["yyyy-MM-ddTHH:mm:ss.fffffffzzz","yyyy-MM-ddTHH:mm:ss.fffffff","yyyy-MM-ddTHH:mm:ss.fffzzz","yyyy-MM-ddTHH:mm:ss.fff","ddd MMM dd yyyy HH:mm:ss","yyyy-MM-ddTHH:mm:sszzz","yyyy-MM-ddTHH:mmzzz","yyyy-MM-ddTHH:mmzz","yyyy-MM-ddTHH:mm:ss","yyyy-MM-dd HH:mm:ss","yyyy/MM/dd HH:mm:ss"],["yyyy-MM-ddTHH:mm","yyyy-MM-dd HH:mm","yyyy/MM/dd HH:mm"],["yyyy/MM/dd","yyyy-MM-dd","HH:mm:ss","HH:mm"]],o={2:/^\d{1,2}/,3:/^\d{1,3}/,4:/^\d{4}/},k={}.toString;r.parseDate=function(n,t,i){return l(n,t,i,!1)};r.parseExactDate=function(n,t,i){return l(n,t,i,!0)};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===y)return n;n=n.toString();t=r.getCulture(t);var f=t.numberFormat,h=f.percent,c=f.currency,s=c.symbol,l=h.symbol,e=n.indexOf("-"),o,v;return a.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=c,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(l)>-1&&(v=!0,f=h,s=l),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&&v&&(n/=100),n)}}(),function(){var h,r,f,a,v;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};h=document.createElement("table");try{h.innerHTML="<tr><td><\/td><\/tr>";u.tbodyInnerHtml=!0}catch(y){u.tbodyInnerHtml=!1}u.touch="ontouchstart"in t;var o=document.documentElement.style,c=u.transitions=!1,l=u.transforms=!1,s="HTMLElement"in t?HTMLElement.prototype:[];u.hasHW3D="WebKitCSSMatrix"in t&&"m11"in new t.WebKitCSSMatrix||"MozPerspective"in o||"msPerspective"in o;u.cssFlexbox="flexWrap"in o||"WebkitFlexWrap"in o||"msFlexWrap"in o;d(["Moz","webkit","O","ms"],function(){var t=this.toString(),i=typeof h.style[t+"Transition"]===e,n;if(i||typeof h.style[t+"Transform"]===e)return n=t.toLowerCase(),l={css:n!="ms"?"-"+n+"-":"",prefix:t,event:n==="o"||n==="webkit"?n:""},i&&(c=l,c.event=c.event?c.event+"TransitionEnd":"transitionend"),!1});h=null;u.transforms=l;u.transitions=c;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(y){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=lt(r,c,!1);i.browser=lt(n,l,"default");i.name=lt(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!==rt||typeof t.cordova!==rt;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};r=u.mobileOS=u.detectOS(navigator.userAgent);u.wpDevicePixelRatio=r.wp?screen.width/320:0;u.hasNativeScrolling=!1;(r.ios||r.android&&r.majorVersion>2||r.wp)&&(u.hasNativeScrolling=r);u.delayedClick=function(){if(u.touch){if(r.ios)return!0;if(r.android)return u.browser.chrome?u.browser.version<32?!1:!(n("meta[name=viewport]").attr("content")||"").match(/user-scalable=no/i):!0}return!1};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&&(n.paste=!1,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 o.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");u.cssFlexbox||(i+=" k-no-flexbox");r.addClass(i)}(u.browser);u.eventCapture=document.documentElement.addEventListener;f=document.createElement("input");u.placeholder="placeholder"in f;u.propertyChangeEvent="onpropertychange"in f;u.input=function(){for(var i=["number","date","time","month","week","datetime","datetime-local"],e=i.length,r="test",u={},n=0,t;n<e;n++)t=i[n],f.setAttribute("type",t),f.value=r,u[t.replace("-","")]=f.type!=="text"&&f.value!==r;return u}();f.style.cssText="float:left;";u.cssFloat=!!f.style.cssFloat;f=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=s.webkitMatchesSelector||s.mozMatchesSelector||s.msMatchesSelector||s.oMatchesSelector||s.matchesSelector||s.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;a=document.documentMode;u.hashChange="onhashchange"in t&&!(u.browser.msie&&(!a||a<=8));u.customElements="registerElement"in t.document;v=u.browser.chrome;u.msPointers=!v&&t.MSPointerEvent;u.pointers=!v&&t.PointerEvent;u.kineticScrollNeeded=r&&(u.touch||u.msPointers||u.pointers)}();ri={left:{reverse:"right"},right:{reverse:"left"},down:{reverse:"up"},up:{reverse:"down"},top:{reverse:"bottom"},bottom:{reverse:"top"},"in":{reverse:"out"},out:{reverse:"in"}};w={};n.extend(w,{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}});w.promiseShim=w.promise;"kendoAnimate"in n.fn||h(n.fn,{kendoStop:function(n,t){return this.stop(n,t)},kendoAnimate:function(n,t,i,r){return ui(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 wr=/&/g,br=/</g,kr=/"/g,dr=/'/g,gr=/>/g;at=function(n){return n.target};u.touch&&(at=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},d(["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");fi=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};ei=/^([a-z]+:)?\/\//i;h(r,{widgets:[],_widgetRegisteredCallbacks:[],ui:r.ui||{},fx:r.fx||vr,effects:r.effects||w,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||ui,ns:"",attr:function(n){return"data-"+r.ns+n},getShadows:fr,wrap:er,deepExtend:ct,getComputedStyles:ii,webComponents:r.webComponents||[],isScrollable:sr,scrollLeft:hr,size:cr,toCamelCase:ti,toHyphens:or,getOffset:r.getOffset||lr,parseEffects:r.parseEffects||ar,toggleClass:r.toggleClass||pr,directions:r.directions||ri,Observable:ht,Class:ut,Template:v,template:ot(v.compile,v),render:ot(v.render,v),stringify:ot(nt.stringify,nt),eventTarget:at,htmlEncode:nu,isLocalUrl:function(n){return n&&!ei.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=fi(n.split("."),i),n=n.replace(/_\$DOT\$_/g,".")):n=i+n,n},getter:function(n,t){var i=n+t;return dt[i]=dt[i]||new Function("d","return "+r.expr(n,t))},setter:function(n){return gt[n]=gt[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=c.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,i){var u=t.console;!r.suppressLog&&typeof u!="undefined"&&u.log&&u[i||"log"](n)}});b=ht.extend({init:function(n,t){var i=this,u;i.element=r.jQuery(n).handler(i);i.angular("init",t);ht.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;dsiCommon.isNullOrEmpty(n.element)||(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}});vt=b.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=g;var tu=/template$/i,iu=/^\s*(?:\{(?:.|\r\n|\n)*\}|\[(?:.|\r\n|\n)*\])\s*$/,ru=/^\{(\d+)(:[^\}]+)?\}|^\[[A-Za-z_]+\]$/,uu=/([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=yt(u,"dataSource"),f=n.extend({},oi(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=yt(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(st.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===l&&t[i].destroy()})};r.resize=function(t,i){var f=n(t).find("[data-"+r.ns+"role]").addBack().filter(eu),u;f.length&&(u=n.makeArray(f),u.sort(fu),n.each(u,function(){var t=r.widgetInstance(n(this));t&&t.resize(i)}))};r.parseOptions=oi;h(r.ui,{Widget:b,DataBoundWidget:vt,roles:{},progress:function(t,i,u){var f=t.find(".k-loading-mask"),s=r.support,a=s.browser,e,h,c,o,l;u=n.extend({},{width:"100%",height:"100%",top:t.scrollTop(),opacity:!1},u);l=u.opacity?"k-loading-mask k-opaque":"k-loading-mask";i?f.length||(e=s.isRtl(t),h=e?"right":"left",o=t.scrollLeft(),c=a.webkit?e?t[0].scrollWidth-t.width()-2*o:0:0,f=n(r.format("<div class='{0}'><span class='k-loading-text'>{1}<\/span><div class='k-loading-image'/><div class='k-loading-color'/><\/div>",l,r.ui.progress.messages.loading)).width(u.width).height(u.height).css("top",u.top).css(h,Math.abs(o)+c).prependTo(t)):f&&f.remove()},plugin:function(t,u,f){var o=t.fn.options.name,c,h,s,a;for(u=u||r.ui,f=f||"",u[o]=t,u.roles[o.toLowerCase()]=t,c="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=st.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!==l)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[c]=function(){return this.data(o)}}});r.ui.progress.messages={loading:"Loading..."};pt={bind:function(){return this},nullObject:!0,options:{}};wt=b.extend({init:function(n,t){b.fn.init.call(this,n,t);this.element.autoApplyNS();this.wrapper=this.element;this.element.addClass("km-widget")},destroy:function(){b.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)||pt},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)||pt}});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:wt,DataBoundWidget:vt.extend(wt.prototype),roles:{},plugin:function(n){r.ui.plugin(n,r.mobile.ui,"Mobile")}}});ct(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 ou(t,!isNaN(i)&&i>-1)}});var si=["mousedown","mousemove","mouseenter","mouseleave","mouseover","mouseout","mouseup","click"],hu="label, input, [data-rel=external]",o={setupMouseMute:function(){var t=0,r=si.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(hu)&&(t.preventDefault(),t.stopPropagation()):t.stopPropagation())};t<r;t++)f.addEventListener(si[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)}},k={down:"touchstart mousedown",move:"mousemove touchmove",up:"mouseup touchend touchcancel",cancel:"mouseleave touchcancel"};u.touch&&(u.mobileOS.ios||u.mobileOS.android)?k={down:"touchstart",move:"touchmove",up:"touchend touchcancel",cancel:"touchcancel"}:u.pointers?k={down:"pointerdown",move:"pointermove",up:"pointerup",cancel:"pointercancel pointerleave"}:u.msPointers&&(k={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}}});hi=function(n){return k[n]||n};bt=/([^ ]+)/g;r.applyEventMap=function(n,t){return n=n.replace(bt,hi),t&&(n=n.replace(bt,"$1."+t)),n};et=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,ci)};s.fn.init.prototype=s.fn;ci=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?et.call(t,arguments[0]):(s=t,n=st.call(arguments),typeof n[n.length-1]===rt&&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,et.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,et.apply(t,n),t)},kendoDestroy:function(n){return n=n||this.data("kendoNS"),n&&this.off("."+n),this}});r.jQuery=s;r.eventMap=k;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!=y&&(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=i,u,f,o;return typeof t==e&&(t=this.offset(n,t)),typeof i==e&&(i=this.offset(n,i)),f=n.getTimezoneOffset(),n=new Date(n.getTime()+(t-i)*6e4),o=n.getTimezoneOffset(),typeof r==e&&(r=this.offset(n,r)),u=o-f+(i-r),new Date(n.getTime()+u*6e4)}function l(n,t){return this.convert(n,n.getTimezoneOffset(),t)}function a(n,t){return this.convert(n,t,n.getTimezoneOffset())}function v(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:v}}();r.date=function(){function u(n,t){return t===0&&n.getHours()===23?(n.setHours(n.getHours()+2),!0):!1}function c(n,t,i){var r=n.getHours();i=i||1;t=(t-n.getDay()+7*i)%7;n.setDate(n.getDate()+t);u(n,r)}function l(n,t,i){return n=new Date(n),c(n,t,i),n}function a(n){return new Date(n.getFullYear(),n.getMonth(),1)}function p(n){var t=new Date(n.getFullYear(),n.getMonth()+1,0),i=a(n),r=Math.abs(t.getTimezoneOffset()-i.getTimezoneOffset());return r&&t.setHours(i.getHours()+r/60),t}function w(n,i){return i!==1?t(l(n,i,-1),4):t(n,4-(n.getDay()||7))}function s(t,i){var r=new Date(t.getFullYear(),0,1,-6),u=w(t,i),f=u.getTime()-r.getTime(),e=Math.floor(f/n);return 1+Math.floor(e/7)}function b(n,u){u===i&&(u=r.culture().calendar.firstDay);var e=t(n,-7),o=t(n,7),f=s(n,u);return f===0?s(e,u)+1:f===53&&s(o,u)>1?1:f}function f(n){return n=new Date(n.getFullYear(),n.getMonth(),n.getDate(),0,0,0),u(n,0),n}function k(n){return Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function e(n){return h(n).getTime()-f(h(n))}function d(t,i,r){var f=e(i),o=e(r),u;return!t||f==o?!0:(i>=r&&(r+=n),u=e(t),f>u&&(u+=n),o<f&&(o+=n),u>=f&&u<=o)}function g(t,i,r){var e=i.getTime(),u=r.getTime(),f;return e>=u&&(u+=n),f=t.getTime(),f>=e&&f<=u}function t(t,i){var r=t.getHours();return t=new Date(t),v(t,i*n),u(t,r),t}function v(n,t,i){var u=n.getTimezoneOffset(),r;n.setTime(n.getTime()+t);i||(r=n.getTimezoneOffset()-u,n.setTime(n.getTime()+r*o))}function nt(n,t){return n=new Date(r.date.getDate(n).getTime()+r.date.getMilliseconds(t)),u(n,t.getHours()),n}function y(){return f(new Date)}function tt(n){return f(n).getTime()==y().getTime()}function h(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 o=6e4,n=864e5;return{adjustDST:u,dayOfWeek:l,setDayOfWeek:c,getDate:f,isInDateRange:g,isInTimeRange:d,isToday:tt,nextDay:function(n){return t(n,1)},previousDay:function(n){return t(n,-1)},toUtcTime:k,MS_PER_DAY:n,MS_PER_HOUR:60*o,MS_PER_MINUTE:o,setTime:v,setHours:nt,addDays:t,today:y,toInvariantTime:h,firstDayOfMonth:a,lastDayOfMonth:p,weekInYear:b,getMilliseconds:e}}();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)};li=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame||function(n){setTimeout(n,1e3/60)};r.animationFrame=function(n){li.call(t,n)};a=[];r.queueAnimation=function(n){a[a.length]=n;a.length===1&&r.runNextAnimation()};r.runNextAnimation=function(){r.animationFrame(function(){a[0]&&(a.shift()(),a[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,i){var r,u,f;return(i=dsiCommon.isNullOrEmpty(i)?!0:!1,u=0,!t||t<=0)?n:(f=function(){function f(){u=+new Date;n.apply(o,s)}var o=this,e=+new Date-u,s=arguments;if(!u)return f();r&&clearTimeout(r);e>t?f():i&&(r=setTimeout(f,t-e))},f.cancel=function(){clearTimeout(r)},f)};r.caret=function(t,r,f){var e,o=r!==i,s,h,c,l;if(f===i&&(f=r),t[0]&&(t=t[0]),!o||!t.disabled){try{t.selectionStart!==i?o?(t.focus(),s=u.mobileOS,s.wp||s.android?setTimeout(function(){t.setSelectionRange(r,f)},0):t.setSelectionRange(r,f)):r=[t.selectionStart,t.selectionEnd]:document.selection&&(n(t).is(":visible")&&t.focus(),e=t.createTextRange(),o?(e.collapse(!0),e.moveStart("character",r),e.moveEnd("character",f-r),e.select()):(h=e.duplicate(),e.moveToBookmark(document.selection.createRange().getBookmark()),h.setEndPoint("EndToStart",e),c=h.text.length,l=c+e.text.length,r=[c,l]))}catch(a){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))})};r.focusElement=function(i){var u=[],f=i.parentsUntil("body").filter(function(n,t){var i=r.getComputedStyles(t,["overflow"]);return i.overflow!=="visible"}).add(t);f.each(function(t,i){u[t]=n(i).scrollTop()});try{i[0].setActive()}catch(e){i[0].focus()}f.each(function(t,i){n(i).scrollTop(u[t])})},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);setTimeout(function(){URL.revokeObjectURL(n)})}var i=document.createElement("a"),f="download"in i&&!r.support.browser.edge;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)}}();r.proxyModelSetters=function(n){var t={};return Object.keys(n||{}).forEach(function(i){Object.defineProperty(t,i,{get:function(){return n[i]},set:function(t){n[i]=t;n.dirty=!0}})}),t}}(jQuery,window),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.router",["kendo.core"],n)}(function(){return 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,decode:!1}))&&(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,r){var u,f=0,e,o=n.parseQueryStringParams(t);if(o._back=i,t=s(t),u=this.route.exec(t).slice(1),e=u.length,r)for(;f<e;f++)typeof u[f]!="undefined"&&(u[f]=decodeURIComponent(u[f]));u.push(o);this._callback.apply(null,u)},worksWith:function(n,t,i){return this.route.test(s(n))?(this.callback(n,t,i),!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,h=!!t.decode,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,c=o.length;f<c;f++)if(s=o[f],s.worksWith(r,u,h))return;this.trigger(e,{url:r,params:n.parseQueryStringParams(r),backButtonPressed:u})&&t.preventDefault()}});n.Router=w}(),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.data.odata",["kendo.core"],n)}(function(){return function(n,t){function e(r,f){for(var v=[],k=r.logic||"and",h,y,s,c,l,w,b=r.filters,a=0,p=b.length;a<p;a++)r=b[a],h=r.field,l=r.value,c=r.operator,r.filters?r=e(r,f):(w=r.ignoreCase,h=h.replace(/\./g,"/"),r=u[c],f&&(r=o[c]),c==="isnull"||c==="isnotnull"?r=i.format("{0} {1} null",h,r):c==="isempty"||c==="isnotempty"?r=i.format("{0} {1} ''",h,r):r&&l!==t&&(y=n.type(l),y==="string"?(s="'{1}'",l=l.replace(/'/g,"''"),w===!0&&(h="tolower("+h+")")):y==="date"?f?(s="{1:yyyy-MM-ddTHH:mm:ss+00:00}",l=i.timezone.apply(l,"Etc/UTC")):s="datetime'{1:yyyy-MM-ddTHH:mm:ss}'":s="{1}",r.length>3?r!=="substringof"?s="{0}({2},"+s+")":(s="{0}("+s+",{2})",c==="doesnotcontain"&&(f?(s="{0}({2},'{1}') eq -1",r="indexof"):s+=" eq false")):s="{2} {0} "+s,r=i.format(s,r,l,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",isnull:"eq",isnotnull:"ne",isempty:"eq",isnotempty:"ne"},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),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.data.xml",["kendo.core"],n)}(function(){return 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),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.data",["kendo.core","kendo.data.odata","kendo.data.xml"],n)}(function(){return function(n,t){function ui(n,t,i,u){return function(f){var e={};for(var o in f)e[o]=f[o];e.dsField=dsiCommon.isNullOrEmpty(f.field)?i:i+"."+f.field;e.field=u?i+"."+f.field:i;t==r&&n._notifyChange&&n._notifyChange(e);n.trigger(t,e)}}function di(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(!di(t[u],i[u]))return!1;return!0}function nr(n,t){var i;for(var r in n)if((i=n[r],b(i)&&i.field&&i.field===t)||i===t)return i;return null}function u(n){this.data=n||[]}function ut(n,i){if(n){var r=typeof n===s?{field:n,dir:i}:n,u=c(r)?r:r!==t?[r]:[];return ru(u,function(n){return!!n.dir})}}function rr(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=ir[t.toLowerCase()]||t),rr(r)}function it(n){if(n&&!w(n))return(c(n)||!n.filters)&&(n={logic:"and",filters:c(n)?n:[n]}),rr(n),n}function vu(n,t){return n.logic||t.logic?!1:n.field===t.field&&n.value===t.value&&n.operator===t.operator}function ur(n){return(n=n||{},w(n))?{logic:"and",filters:[]}:it(n)}function fr(n,t){return t.logic||n.field>t.field?1:n.field<t.field?-1:0}function er(n,t){var f,e,i,r,u;if((n=ur(n),t=ur(t),n.logic!==t.logic)||(i=(n.filters||[]).slice(),r=(t.filters||[]).slice(),i.length!==r.length))return!1;for(i=i.sort(fr),r=r.sort(fr),u=0;u<i.length;u++)if(f=i[u],e=r[u],f.logic&&e.logic){if(!er(f,e))return!1}else if(!vu(f,e))return!1;return!0}function yu(n){return c(n)?n:[n]}function ct(n,i){var r=typeof n===s?{field:n,dir:i}:n,u=c(r)?r:r!==t?[r]:[];return ti(u,function(n){return{field:n.field,dir:n.dir||"asc",aggregates:n.aggregates}})}function pu(n,t){return n&&n.getTime&&t&&t.getTime?n.getTime()===t.getTime():n===t}function wu(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]=or[s.toLowerCase()](n[o][s],r,i.accessor(o),u,f,e[o][s])}function y(n){return typeof n=="number"&&!isNaN(n)}function bt(n){return n&&n.getTime}function kt(n){for(var i=n.length,r=new Array(i),t=0;t<i;t++)r[t]=n[t].toJSON();return r}function bu(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 cr(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 lr(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?lr(f.items,t,i,r,u):cr(f.items,t,i,r,u)}function oi(n,t,i,r,u,f){return function(e){return e=n(e),e&&!w(r)&&(wt.call(e)==="[object Array]"||e instanceof a||(e=[e]),i(e,r,new t,u,f)),e||[]}}function hi(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?hi(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?(hi(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 ci(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(ci(u.items));else for(f=u.items,r=0;r<f.length;r++)i.push(f.at(r));return i}function ar(n,t){var r,u,i;if(t)for(r=0,u=n.length;r<u;r++)i=n.at(r),i.hasSubgroups?ar(i.items,t):i.items=new st(i.items,t)}function vr(n,t){for(var i=0,r=n.length;i<r;i++)if(n[i].hasSubgroups){if(vr(n[i].items,t))return!0}else if(t(n[i].items,n[i]))return!0}function ku(n,t,i,r){for(var u=0;u<n.length;u++){if(n[u].data===t)break;if(yr(n[u].data,i,r))break}}function yr(n,t,i){for(var r=0,u=n.length;r<u;r++){if(n[r]&&n[r].hasSubgroups)return yr(n[r].items,t,i);if(n[r]===t||n[r]===i)return n[r]=i,!0}}function pr(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);ku(r,i,e,n[o]);break}}else pr(e.items,i,r,u,f)}function dt(n,t,i,r){for(var o=n.length,s=i||0,h=typeof r!="undefined"?f.min(s+r,o):o,e,u=s;u<h;u++)if(e=n.at(u),e.uid==t.uid)return n.splice(u,1),e}function wr(n,t){return t?kr(n,function(n){return n.uid&&n.uid==t.uid||n[t.idField]===t.id&&t.id!==t._defaultId}):-1}function br(n,t){return t?kr(n,function(n){return n.uid==t.uid}):-1}function kr(n,t){for(var i=0,r=n.length;i<r;i++)if(t(n[i]))return i;return-1}function dr(n,t){if(n&&!w(n)){var i=n[t],r;return(r=b(i)?i.from||i.field||t:n[t]||t,l(r))?t:r}return t}function gr(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]=gr(n.filters[r],t);else i.field=dr(t.fields,i.field);return i}function gt(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=dr(t.fields,i.field);i.aggregates&&c(i.aggregates)&&(i.aggregates=gt(i.aggregates,t));o.push(i)}return o}function du(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 gu(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 nu(n){return function(){var t=this._data,i=h.fn[n].apply(this,ot.call(arguments));return this._data!=t&&this._attachBubbleHandlers(),i}}function tu(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=tu(t.eq(0),i)),f.attr("data-hasChildren")=="true"&&(r.hasChildren=!0),v.push(r);return v}var e=n.extend,p=n.proxy,b=n.isPlainObject,w=n.isEmptyObject,c=n.isArray,ru=n.grep,ni=n.ajax,ti,ii=n.each,k=n.noop,i=window.kendo,l=i.isFunction,d=i.Observable,at=i.Class,s="string",ri="function",yi="create",pi="read",wi="update",bi="destroy",r="change",ki="sync",vt="get",nt="error",tt="requestStart",ft="progress",rt="requestEnd",uu=[yi,pi,wi,bi],et=function(n){return n},yt=i.getter,pt=i.stringify,f=Math,fu=[].push,eu=[].join,ou=[].pop,su=[].splice,hu=[].shift,ot=[].slice,cu=[].unshift,wt={}.toString,lu=i.support.stableSort,au=/^\/Date\((.*?)\)\/$/,a=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&&wt.call(n)==="[object Object]"&&(u=n instanceof i.type||n instanceof v,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=fu.apply(this,n),this.trigger(r,{action:"add",index:i,items:n}),t},slice:ot,sort:[].sort,join:eu,pop:function(){var n=this.length,t=ou.apply(this);return n&&this.trigger(r,{action:"remove",index:n-1,items:[t]}),t},splice:function(n,t,i){var e=this.wrapAll(ot.call(arguments,2)),u,f,o;if(u=su.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=hu.apply(this);return t&&this.trigger(r,{action:"remove",index:0,items:[n]}),n},unshift:function(){var n=this.wrapAll(arguments),t;return t=cu.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)}}),st,o,fi,gi,v,ht,tr,ei,ir,or,si,h,li,ai,g,vi,iu;typeof Symbol!="undefined"&&Symbol.iterator&&!a.prototype[Symbol.iterator]&&(a.prototype[Symbol.iterator]=[][Symbol.iterator]);st=a.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=p(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]!==ri&&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 a)&&(n=n.toJSON()),i[t]=n);return i},get:function(n){var t=this;return t.trigger(vt,{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=!1,o=n.indexOf(".")>=0,f=i.getter(n,!0)(u);return f!==t&&(f instanceof d&&this._handlers[n]&&(this._handlers[n].get&&f.unbind(vt,this._handlers[n].get),f.unbind(r,this._handlers[n].change)),e=u.trigger("set",{field:n,value:t}),e||(o||(t=u.wrap(t,n,function(){return u})),(!u._set(n,t)||n.indexOf("(")>=0||n.indexOf("[")>=0)&&u.trigger(r,{field:n}))),e},parent:k,wrap:function(n,t,i){var f=this,l,u,e=wt.call(n),s,c;return n!=null&&(e==="[object Object]"||e==="[object Array]")&&(s=n instanceof a,c=n instanceof h,e!=="[object Object]"||c||s?(e==="[object Array]"||s||c)&&(s||c||(n=new a(n)),u=ui(f,r,t,!1),n.bind(r,u),f._handlers[t]={change:u}):(n instanceof o||(n=new o(n)),l=ui(f,vt,t,!0),n.bind(vt,l),u=ui(f,r,t,!0),n.bind(r,u),f._handlers[t]={get:l,change:u}),n.parent=i),n}});fi={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}};gi={string:"",number:0,date:new Date,boolean:!1,"default":""};v=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.dirtyFields={};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!=="dirtyFields"&&n!=="_accessors"},_parse:function(n,t){var u=this,f=n,r=u.fields||{},i;return n=r[n],n||(n=nr(r,f)),n&&(i=n.parse,!i&&n.type&&(i=fi[n.type.toLowerCase()])),i?i(t):t},_notifyChange:function(n){var t=n.action;(t=="add"||t=="remove")&&(this.dirty=!0,this.dirtyFields[n.field]=!0)},editable:function(n){return n=(this.fields||{})[n],n?n.editable!==!1:!0},set:function(t,i,r){var u=this,v=u.dirty,c=!1,e,f,s,l,h,a;if(u.editable(t)){if(!dsiCommon.isNullOrEmpty(u.dsi)&&!dsiCommon.isNullOrEmpty(u.dsi.changedFields)&&(n.inArray(t,u.dsi.changedFields)===-1&&u.dsi.changedFields.push(t),!dsiCommon.isNullOrEmpty(u.dsi.submodels)))if(u.dsi.submodels.length<30)for(e=0;e<u.dsi.submodels.length;e++)u.dsi.submodels[e].set(t,i,r);else for(e=0;e<u.dsi.submodels.length;e++)u.dsi.submodels[e][t]=i;if(f=u._parse(t,i),dsiCommon.isCurrentValue(i)&&(f=dsiCommon.getTranslation("CURRENT_VALUE")),f===null&&!dsiCommon.isNullOrEmpty(i)&&(l=u.fields||{},s=l[t],s||(s=nr(l,t)),s))switch(s.type){case"date":if(h=n.grep(u.dsi.columnData,function(n){return n.field===t}),h.length!==1)break;h=h[0];f=dsiCommon.getDataFormat(i,"date",h.dsi.fieldFormat)}dsiCommon.isNullOrEmpty(u.dsi)||(f===null||dsiCommon.isBlankValue(f)||dsiCommon.isCurrentValue(f)?(u.dsi.allowBlank&&dsiCommon.isBlankValue(i)?i=null:u.dsi.allowCurrentValue&&dsiCommon.isCurrentValue(i)&&(dsiCommon.isNullOrEmpty(u.dsi.originalValues)?f=i:(f=u.dsi.originalValues[t],u.dsi.resetValues.push(t),c=!0)),dsiCommon.isNullOrEmpty(u.dsi.originalValues)||n.inArray(t,Object.keys(u.dsi.originalValues))===-1||i!=u.dsi.originalValues[t]||(f=u.dsi.originalValues[t],u.dsi.resetValues.push(t),c=!0)):dsiCommon.isNullOrEmpty(u.dsi.originalValues)||n.inArray(t,Object.keys(u.dsi.originalValues))===-1||i!=u.dsi.originalValues[t]||(f=u.dsi.originalValues[t],u.dsi.resetValues.push(t),c=!0));c&&(a=n.inArray(t,u.dsi.changedFields),a!=-1&&u.dsi.changedFields.splice(a,1));i=f;di(i,u.get(t))||(dsiCommon.isNullOrEmpty(u.dsi)||n.inArray(t,Object.keys(u.dsi.originalValues))!==-1||(u.dsi.originalValues[t]=u.get(t)),u.dirty=!0,u.dirtyFields[t]=!0,o.fn.set.call(u,t,i,r)&&!v&&(u.dirty=v,u.dirty||(u.dirtyFields[t]=!1)));!u.dirty||dsiCommon.isNullOrEmpty(u.dsi)||dsiCommon.isNullOrEmpty(u.dsi.changedFields)||u.dsi.changedFields.length!=0||(u.dirty=!1)}},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;t.dirtyFields={}},isNew:function(){return this.id===this._defaultId}});v.define=function(n,i){i===t&&(i=n,n=v);var o,r=e({defaults:{}},i),f,u,y,h,l,b,p={},c,a=r.id,w=[];if(a&&(r.idField=a),r.id&&delete r.id,a&&(r.defaults[a]=r._defaultId=""),wt.call(r.fields)==="[object Array]"){for(l=0,b=r.fields.length;l<b;l++)u=r.fields[l],typeof u===s?p[u]={}:u.field&&(p[u.field]=u);r.fields=p}for(f in r.fields)u=r.fields[f],y=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:gi[y.toLowerCase()],typeof h=="function"&&w.push(f)),i.id===f&&(r._defaultId=h),r.defaults[c!==f?c:f]=h,u.parse=u.parse||fi[y];return w.length>0&&(r._initializers=w),o=n.extend(r),o.define=function(n){return v.define(o,n)},r.fields&&(o.fields=r.fields,o.idField=r.idField),o};ht={selector:function(n){return l(n)?n:yt(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}}};tr=e({},ht,{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)}});ti=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};ei=function(){function i(n){return typeof n=="string"&&(n=n.replace(/[\r\n]+/g,"")),JSON.stringify(n)}function n(n){return function(t,r,u){return r+="",u&&(t="("+t+" || '').toLowerCase()",r=r.toLowerCase()),n(t,i(r),u)}}function t(n,t,r,u){if(r!=null){if(typeof r===s){var f=au.exec(r);f?r=new Date(+f[1]):u?(r=i(r.toLowerCase()),t="(("+t+" || '')+'').toLowerCase()"):r=i(r)}r.getTime&&(t="("+t+"&&"+t+".getTime?"+t+".getTime():"+t+")",r=r.getTime())}return t+" "+n+" "+r}function r(n){for(var t,i="/^",r=!1,u=0;u<n.length;++u){if(t=n.charAt(u),r)i+="\\"+t;else if(t=="~"){r=!0;continue}else i+=t=="*"?".*":t=="?"?".":".+^$()[]{}|\\/\n\r\u2028\u2029 ".indexOf(t)>=0?"\\"+t:t;r=!1}return i+"$/"}return{quote:function(n){return n&&n.getTime?"new Date("+n.getTime()+")":i(n)},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:n(function(n,t){return n+".lastIndexOf("+t+", 0) == 0"}),doesnotstartwith:n(function(n,t){return n+".lastIndexOf("+t+", 0) == -1"}),endswith:n(function(n,t){var i=t?t.length-2:0;return n+".indexOf("+t+", "+n+".length - "+i+") >= 0"}),doesnotendwith:n(function(n,t){var i=t?t.length-2:0;return n+".indexOf("+t+", "+n+".length - "+i+") < 0"}),contains:n(function(n,t){return n+".indexOf("+t+") >= 0"}),doesnotcontain:n(function(n,t){return n+".indexOf("+t+") == -1"}),matches:n(function(n,t){return t=t.substring(1,t.length-1),r(t)+".test("+n+")"}),doesnotmatch:n(function(n,t){return t=t.substring(1,t.length-1),"!"+r(t)+".test("+n+")"}),isempty:function(n){return n+" === ''"},isnotempty:function(n){return n+" !== ''"},isnull:function(n){return"("+n+" == null)"},isnotnull:function(n){return"("+n+" != null)"}}}();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===ri?(f="__f["+e.length+"](d)",e.push(h)):f=i.expr(h),typeof c===ri?(r="__o["+o.length+"]("+f+", "+ei.quote(r.value)+")",o.push(c)):r=ei[(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}};ir={"==":"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",isnull:"isnull",isempty:"isempty",isnotempty:"isnotempty"};u.normalizeFilter=it;u.compareFilters=er;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(ti(this.data,n))},order:function(n,t,i){var r={dir:t};return(n&&(n.compare?r.compare=n.compare:r.field=n),i)?new u(this.data.sort(ht.create(r))):new u(this.data.slice(0).sort(ht.create(r)))},orderBy:function(n,t){return this.order(n,"asc",t)},orderByDescending:function(n,t){return this.order(n,"desc",t)},sort:function(n,t,i,r){var f,e,u=ut(n,t),o=[];if(i=i||ht,!dsiCommon.isNullOrEmpty(this.dsThis)&&u.length==1&&u[0].field==this.dsThis.detailSetGroupingID)return this;if(u.length){for(f=0,e=u.length;f<e;f++)o.push(i.create(u[f]));return this.orderBy({compare:i.combine(o)},r)}return this},filter:function(n){var t,r,s,i,h,c=this.data,f,e,l=[],o;if(n=it(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){var e=n.sortField,r,i,f;return n=ct(n||[]),dsiCommon.isNullOrEmpty(this.dsThis)||n.length==1&&n[0].field==this.dsThis.detailSetGroupingID&&(n[0].sortField=e),t=t||this.data,r=this,i=new u(r.data),n.length>0&&(f=n[0],dsiCommon.isNullOrEmpty(r.dsThis)||(i.dsThis=r.dsThis),i=i.groupBy(f).select(function(i){var r=new u(t).filter([{field:i.field,operator:"eq",value:i.value,ignoreCase:!1}]);return{field:i.field,value:i.value,displayDupe:i.displayDupe,items:n.length>1?new u(i.items).group(n.slice(1),r.toArray()).toArray():i.items,hasSubgroups:n.length>1,aggregates:r.aggregate(f.aggregates)}})),i},groupBy:function(n){var p,l;if(w(n)||!this.data.length)return new u([]);var h=!dsiCommon.isNullOrEmpty(n.sortField)||!dsiCommon.isNullOrEmpty(this.dsThis)&&n.field==this.dsThis.detailSetGroupingID,r=n.field,c=h?this.data:this._sortForGrouping(dsiCommon.isNullOrEmpty(n.sortField)?n.field:n.sortField,n.dir||"asc"),y=i.accessor(r),f,a=y.get(c[0],r),e={field:r,value:a,items:[],displayDupe:h},o,s,v,t=[e];if(h)for(t=[],s=0,v=c.length;s<v;s++){if(f=c[s],o=y.get(f,r),o==0){e={field:r,value:o,items:[f],displayDupe:h};t.push(e);continue}for(p=!1,l=0;l<t.length;l++)if(t[l].value==o){t[l].items.push(f);p=!0;break}p||(e={field:r,value:o,items:[f],displayDupe:h},t.push(e))}else for(s=0,v=c.length;s<v;s++)f=c[s],o=y.get(f,r),pu(a,o)||(a=o,e={field:r,value:a,items:[],displayDupe:h},t.push(e)),e.items.push(f);return h&&!dsiCommon.isNullOrEmpty(n.sortField)&&(t=new u(t)._sortForGrouping("items[0]."+n.sortField,n.dir||"asc")),new u(t)},_sortForGrouping:function(n,t){var i,f,r=this.data;if(!lu){for(i=0,f=r.length;i<f;i++)r[i].__position=i;for(r=new u(r).sort(n,t,tr).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++)wu(r,n,this.data[t],t,i,u);return r}};or={sum:function(n,t,i){var r=i.get(t);return y(n)?y(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),y(n)?y(o)&&(n+=o):n=o,y(o)&&e.count++,u==f-1&&y(n)&&(n=n/e.count),n},max:function(n,t,i){var r=i.get(t);return y(n)||bt(n)||(n=r),n<r&&(y(r)||bt(r))&&(n=r),n},min:function(n,t,i){var r=i.get(t);return y(n)||bt(n)||(n=r),n>r&&(y(r)||bt(r))&&(n=r),n}};u.process=function(n,i,r){i=i||{};var f=new u(n),e=i.group,o=ct(e||[]).concat(ut(i.sort||[])),s,h=i.filterCallback,c=i.filter,l=i.skip,a=i.take;return dsiCommon.isNullOrEmpty(i.dsThis)||(f.dsThis=i.dsThis),dsiCommon.isNullOrEmpty(i.dsThis)||e.length==1&&e[0].field==i.dsThis.detailSetGroupingID&&(o.length==2&&(e[0].dir=o[1].dir,e.sortField=o[1].field),o=ut(o.push({dir:"asc",field:"DOCID"}))),c&&(f=f.filter(c),h&&(f=h(f)),s=f.toArray().length),o&&(f=r?f.sort(o,t,t,r):f.sort(o),e&&(n=f.toArray())),l!==t&&a!==t&&(f=f.range(l,a)),dsiCommon.isNullOrEmpty(i.dsThis)||(f.dsThis=i.dsThis),e&&(f=f.group(e,n)),{total:s,data:f.toArray()}};var sr=at.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)}}),hr=at.extend({init:function(n){var t=this,i;n=t.options=e({},t.options,n);ii(uu,function(t,i){typeof n[i]===s&&(n[i]={url:n[i]})});t.cache=n.cache?lt.create(n.cache):{find:k,add:k};i=n.parameterMap;l(n.push)&&(t.push=n.push);t.push||(t.push=et);t.parameterMap=l(i)?i:function(n){var t={};return ii(n,function(n,r){n in i&&(n=i[n],b(n)&&(r=n.value(r),n=n.key));t[n]=r}),t}},options:{parameterMap:et},create:function(n){return ni(this.setup(n,yi))},read:function(i){var f=this,r,o,u,e=f.cache;i=f.setup(i,pi);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 ni(this.setup(n,wi))},destroy:function(n){return ni(this.setup(n,bi))},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}}),lt=at.extend({init:function(){this._store={}},add:function(n,i){n!==t&&(this._store[pt(n)]=i)},find:function(n){return this._store[pt(n)]},clear:function(){this._store={}},remove:function(n){delete this._store[pt(n)]}});lt.create=function(n){var t={inmemory:function(){return new lt}};return b(n)&&l(n.find)?n:n===!0?new lt:t[n]()};si=at.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?yt(u):u;if(a=n.modelBase||v,b(t.model)&&(t.model=i=a.define(t.model)),f=p(t.data,t),t._dataAccessFunction=f,t.model){var w=p(t.groups,t),k=p(t.serialize,t),e={},c={},y={},o={},l=!1,r;i=t.model;i.fields&&(ii(i.fields,function(n,t){var i;r=n;b(t)&&t.field?r=t.field:typeof t===s&&(r=t);b(t)&&t.from&&(i=t.from);l=l||i&&i!==n||r!==n;c[n]=yt(i||r);y[n]=yt(n);e[i||r]=n;o[n]=i||r}),!n.serialize&&l&&(t.serialize=oi(k,i,bu,y,e,o)));t._dataAccessFunction=f;t.data=oi(f,i,cr,c,e,o);t.groups=oi(w,i,lr,c,e,o)}},errors:function(n){return n?n.errors:null},parse:et,data:et,total:function(n){return n.length},groups:et,aggregates:function(){return{}},serialize:function(n){return n}});h=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=ut(n.sort);u._filter=it(n.filter);u._group=ct(n.group);u._aggregate=n.aggregate;u._total=n.total;u._shouldDetachObservableParents=!0;d.fn.init.call(u);u.transport=li.create(n,o,u);l(u.transport.push)&&u.transport.push({pushCreate:p(u._pushCreate,u),pushUpdate:p(u._pushUpdate,u),pushDestroy:p(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,pt(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,ki,rt,ft],n)},options:{data:null,schema:{modelBase:v},offlineStorage:null,serverSorting:!1,serverPaging:!1,serverFiltering:!1,serverGrouping:!1,serverAggregates:!1,batch:!1,inPlaceSort:!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 ci(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,this.options.useRanges),t=0,r=i.length;t<r;t++)if(i[t].id==n)return i[t]},getByUid:function(n){return this._getByUid(n,this._data)},_getByUid:function(n,t){var i,u,r=this._flatData(t,this.options.useRanges);if(r)for(i=0,u=r.length;i<u;i++)if(r[i].uid==n)return r[i]},indexOf:function(n){return br(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 pr(n,t._data,t._ranges,t.reader.model||o,t._isServerGrouped()),i=new st(n,t.reader.model),i.parent=function(){return t.parent()},i},flatView:function(){var n=this.group()||[];return n.length?ci(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 v||(t=this._createNewModel(t)),this._isServerGrouped()?this._data.splice(n,0,this._wrapInEmptyGroup(t)):this._data.splice(n,0,t),this._insertModelInRange(n,t),t},pushInsert:function(n,t){var i,e,r,o,f,u;t||(t=n,n=0);c(t)||(t=[t]);i=[];e=this.options.autoSync;this.options.autoSync=!1;try{for(r=0;r<t.length;r++)o=t[r],f=this.insert(n,o),i.push(f),u=f.toJSON(),this._isServerGrouped()&&(u=this._wrapInEmptyGroup(u)),this._pristineData.push(u),n++}finally{this.options.autoSync=e}i.length&&this.trigger("push",{type:"create",items:i})},pushCreate:function(n){this.pushInsert(this._data.length,n)},pushUpdate:function(n){var i,u;for(c(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;c(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 i,t=this,r=t._isServerGrouped();return this._eachItem(t._data,function(u){return i=t.options.useRanges&&!t.options.serverPaging?dt(u,n,t.currentRangeStart(),t.take()):dt(u,n),i&&r?(i.isNew&&i.isNew()||t._destroyed.push(i),!0):void 0}),this._removeModelFromRanges(n),n},destroyed:function(){return this._destroyed},created:function(){for(var r=[],t=this._flatData(this._data,this.options.useRanges),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,this.options.useRanges),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++)arguments[n]&&t._accept(arguments[n]);t._storeData(!0);t._change({action:"sync"});t.trigger(ki)})}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,0),t._change(),t._markOfflineUpdatesAsDirty())},_markOfflineUpdatesAsDirty:function(){var n=this;n.options.offlineStorage!=null&&n._eachItem(n._data,function(n){for(var i,t=0;t<n.length;t++)i=n.at(t),(i.__state__=="update"||i.__state__=="create")&&(i.dirty=!0)})},hasChanges:function(){var n,i,t=this._flatData(this._data,this.options.useRanges);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(),h=r._pristineData,e=t.type,o;if(r.trigger(rt,{response:i,type:e}),i&&!w(i)){if(i=r.reader.parse(i),r._handleCustomErrors(i))return;i=r.reader.data(i);c(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"?h.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=wr(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()?vr(n,t):t(n))},_pristineForModel:function(n){var i,t,r=function(r){return t=wr(r,n),t>-1?(i=r[t],!0):void 0};return this._eachPristineItem(r),i},_cancelModel:function(n){var i=this,t=this._pristineForModel(n);this._eachItem(this._data,function(r){var u=br(r,n);u>=0&&(t&&(!n.isNew()||t.__state__)?(r[u].accept(t),t.__state__=="update"&&(r[u].dirty=!0)):(r.splice(u,1),i._removeModelFromRanges(n)))})},_submit:function(t,i){var r=this;r.trigger(tt,{type:"submit"});r.trigger(ft);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(kt(t)),updated:u.reader.serialize(kt(i)),destroyed:u.reader.serialize(kt(r))}})),f},_promise:function(t,i,r){var u=this;return n.Deferred(function(n){u.trigger(tt,{type:r});u.trigger(ft);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(kt(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(ft),i._ranges=[],i.trigger("reset"),i.online()?i.transport.read({data:u,success:function(n){i._ranges=[];i.success(n,u);r.resolve()},error:function(){var n=ot.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 i=this,y=i.options,s,o,f,v,e;if(i.trigger(rt,{response:n,type:"read"}),i.online()){if(n=i.reader.parse(n),i._handleCustomErrors(n)){i._dequeueRequest();return}i._total=i.reader.total(n);i._aggregate&&y.serverAggregates&&(i._aggregateResult=i._readAggregates(n));s=arguments.length>1?arguments[1]:t;n=i._readData(n,s);i._destroyed=[]}else{n=i._readData(n);for(var h=[],c={},l=i.reader.model,a=l?l.idField:"id",u=0;u<this._destroyed.length;u++)o=this._destroyed[u][a],c[o]=o;for(u=0;u<n.length;u++)f=n[u],v=f.__state__,v=="destroy"?c[f[a]]||this._destroyed.push(this._createNewModel(f)):h.push(f);n=h;i._total=n.length}if(i._pristineTotal=i._total,i._pristineData=n.slice(0),i._detachObservableParents(),i.options.endless){for(i._data.unbind(r,i._changeHandler),n=i._observe(n),e=0;e<n.length;e++)i._data.push(n[e]);i._data.bind(r,i._changeHandler)}else i._data=i._observe(n);i._markOfflineUpdatesAsDirty();i._storeData();i._addRange(i._data);i._process(i._data);i._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=this._readData(i))}},_addRange:function(n,t){var i=this,r=typeof t!="undefined"?t:i._skip||0,u=r+i._flatData(n,!0).length;i._ranges.push({start:r,end:u,data:n,timestamp:(new Date).getTime()});i._ranges.sort(function(n,t){return n.start-t.start})},error:function(n,t,i){this._dequeueRequest();this.trigger(rt,{});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=gt(i.group,t.reader.model)):delete i.group,t.options.serverFiltering?t.reader.model&&i.filter&&(i.filter=gr(i.filter,t.reader.model)):delete i.filter,t.options.serverSorting?t.reader.model&&i.sort&&(i.sort=gt(i.sort,t.reader.model)):delete i.sort,t.options.serverAggregates?t.reader.model&&i.aggregate&&(i.aggregate=gt(i.aggregate,t.reader.model)):delete i.aggregate,i},_queueRequest:function(n,i){var r=this;r._requestInProgress?r._pending={callback:p(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 a?(t._shouldDetachObservableParents=!1,t._shouldWrap(n)&&(n.type=t.reader.model,n.wrapAll(n,n))):(i=t.pageSize()&&!t.options.serverPaging?st:a,n=new i(n,t.reader.model),n.parent=function(){return t.parent()}),t._isServerGrouped()&&ar(n,u),t._changeHandler&&t._data&&t._data instanceof a?t._data.unbind(r,t._changeHandler):t._changeHandler=p(t._change,t),n.bind(r,t._changeHandler)},_updateTotalForAction:function(n,t){var i=this,r=parseInt(i._total,10);y(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;dsiCommon.isNullOrEmpty(u.options.dsi)||dsiCommon.isNullOrEmpty(u.options.dsi.dsThis)||(f.dsThis=u.options.dsi.dsThis);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 this.options.inPlaceSort?u.process(n,t,this.options.inPlaceSort):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=i._currentRangeStart=n.skip,i._take=n.take,i._skip===t&&(i._skip=i._currentRangeStart=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=ut(n.sort)),n.filter&&(i._filter=n.filter=it(n.filter)),n.group&&(i._group=n.group=ct(n.group)),n.aggregate&&(i._aggregate=n.aggregate=yu(n.aggregate))),n},query:function(i){var u,o=this.options.serverSorting||this.options.serverPaging||this.options.serverFiltering||this.options.serverGrouping||this.options.serverAggregates,f,e;return o||(this._data===t||this._data.length===0)&&!this._destroyed.length?(this.options.endless&&(f=i.pageSize-this.pageSize(),f>0?(f=this.pageSize(),i.page=i.pageSize/f,i.pageSize=f):(i.page=1,this.options.endless=!1)),this.read(this._mergeState(i))):(e=this.trigger(tt,{type:"read"}),e||(this.trigger(ft),dsiCommon.isNullOrEmpty(this.options.dsi)||(i.dsThis=this.options.dsi.dsThis),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(rt,{type:"read"}),this.trigger(r,{items:u.data})),n.Deferred().resolve(e).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=t._currentRangeStart=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._currentRangeStart=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,r,u;if(n===t||n.length!=1||dsiCommon.isNullOrEmpty(i.options.dsi_hasAllPages)||(r=null,dsiCommon.isNullOrEmpty(i.options)&&dsiCommon.isNullOrEmpty(i.options.dsi)&&dsiCommon.isNullOrEmpty(i.options.dsi.dsThis)||(r=i.options.dsi.dsThis),u=n[0].field,u=="DOCIDBIND"&&(u="DOCID"),dsiCommon.isNullOrEmpty(r)||(i.options.dsi_hasAllPages.value?i.options.dsi_hasAllPages.sortHasAllPages.call(r,u,n[0].dir):(r.runDataBoundFunctions.run=!1,i.data([]),i.options.data=[],i.transport.data=[],i.options.dsi_hasAllPages.resort.call(r,u,n[0].dir)))),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(i){var r=this;if(dsiCommon.isNullOrEmpty(r.options.dsi)||i!=t&&i.length>1&&(i=n.grep(i,function(n){return n.field!=r.options.dsi.dsThis.detailSetGroupingID}),i.length==0&&(i=t)),i!==t){r._query({group:i});return}return r._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 w(n)&&(n=this._emptyAggregates(this.aggregate())),n},_emptyAggregates:function(n){var r={},i,t;if(!w(n))for(i={},c(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,r){this._currentRequestTimeStamp=this._timeStamp();this._skipRequestsInProgress=!0;n=f.min(n||0,this.total());var u=this,o=f.max(f.floor(n/i),0)*i,e=f.min(o+i,u.total()),s;if(s=u._findRange(n,f.min(n+i,u.total())),s.length){u._pending=t;u._skip=n>u.skip()?f.min(e,(u.totalPages()-1)*u.take()):o;u._currentRangeStart=n;u._take=i;var h=u.options.serverPaging,c=u.options.serverSorting,a=u.options.serverFiltering,v=u.options.serverAggregates;try{u.options.serverPaging=!0;u._isServerGrouped()||u.group()&&u.group().length||(u.options.serverSorting=!0);u.options.serverFiltering=!0;u.options.serverPaging=!0;u.options.serverAggregates=!0;h&&(u._detachObservableParents(),u._data=s=u._observe(s));u._process(s)}finally{u.options.serverPaging=h;u.options.serverSorting=c;u.options.serverFiltering=a;u.options.serverAggregates=v}l(r)&&r();return}i!==t&&(u._rangeExists(o,e)?o<n&&u.prefetch(e,i,function(){u.range(n,i,r)}):u.prefetch(o,i,function(){n>o&&e<u.total()&&!u._rangeExists(e,f.min(e+i,u.total()))?u.prefetch(e,i,function(){u.range(n,i,r)}):u.range(n,i,r)}))},_findRange:function(n,i){for(var u=this,y=u._ranges,r,p=[],c,l,s,w,a,h,f=u.options,d=f.serverSorting||f.serverPaging||f.serverFiltering||f.serverGrouping||f.serverAggregates,v,e,k,o=0,b=y.length;o<b;o++)if(r=y[o],n>=r.start&&n<=r.end){for(e=0,c=o;c<b;c++)if(r=y[c],v=u._flatData(r.data,!0),v.length&&n+e>=r.start&&(w=r.data,a=r.end,d||(f.inPlaceSort?h=u._queryProcess(r.data,{filter:u.filter()}):(k=ct(u.group()||[]).concat(ut(u.sort()||[])),h=u._queryProcess(r.data,{sort:k,filter:u.filter()})),v=w=h.data,h.total!==t&&(a=h.total)),l=0,n+e>r.start&&(l=n+e-r.start),s=v.length,a>i&&(s=s-(a-i)),e+=s-l,p=u._mergeGroups(p,w,l,s),i<=r.end&&e==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]),hi(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},currentRangeStart:function(){return this._currentRangeStart||0},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(rt,{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=ot.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 t=this,i,u,f,r=0,e=this._ranges.length;r<e;r++)if(f=this._ranges[r],this._eachItem(f.data,function(r){i=t.options.useRanges&&!t.options.serverPaging?dt(r,n,t.currentRangeStart(),t.take()):dt(r,n);i&&(u=!0)}),u)break;t._updateRangesLength()},_insertModelInRange:function(n,t){for(var r=this,f=r._ranges||[],e=f.length,i,u=0;u<e;u++)if(i=f[u],i.start<=n&&i.end>=n){r._getByUid(t.uid,i.data)||(r._isServerGrouped()?i.data.splice(n,0,r._wrapInEmptyGroup(t)):i.data.splice(n,0,t));break}r._updateRangesLength()},_updateRangesLength:function(){for(var e=this,o=e._ranges||[],s=o.length,r=!1,t=0,u=0,n,i=0;i<s;i++){if(n=o[i],u=e._flatData(n.data,!0).length-f.abs(n.end-n.start),!r&&u!==0){r=!0;t=u;n.end+=t;continue}r&&(n.start+=t,n.end+=t)}}});li={};li.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]?b(i.data.transports[t.type])?f=e(!0,{},i.data.transports[t.type],f):o=new i.data.transports[t.type](e(f,{data:r})):i.logToConsole("Unknown DataSource transport type '"+t.type+"'.\nVerify that registration scripts for this type are included after Kendo UI on the page.","warn"),t.schema=e(!0,{},i.data.schemas[t.type],t.schema)),o||(o=l(f.read)?f:new hr(f))):o=new sr({data:t.data||[]}),o};h.create=function(n){(c(n)||n instanceof a)&&(n={data:n});var r=n||{},u=r.data,f=r.fields,l=r.table,v=r.select,o,p,y={},s;if(u||!f||r.transport||(l?u=gu(l,f):v&&(u=du(v,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&&(y[s.field]=s);w(y)||(r.schema=e(!0,r.schema,{model:{fields:y}}))}return r.data=u,v=null,r.select=null,l=null,r.table=null,r instanceof h?r:new h(r)};ai=v.define({idField:"id",init:function(n){var t=this,r=t.hasChildren||n&&n.hasChildren,o="items",u={},f;i.data.Model.fn.init.call(t,n);typeof t.children===s&&(o=t.children);u={schema:{data:o,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)&&(f=r.call(t,t),t.hasChildren=f&&f.length===0?!1:!!f);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,p(this._childrenLoaded,this));this._matchFilter&&(u.filter={field:"_matchFilter",operator:"eq",value:!0});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 v.fn.shouldSerialize.call(this,n)&&n!=="children"&&n!=="_loaded"&&n!=="hasChildren"&&n!=="_childrenOptions"}});g=h.extend({init:function(n){var t=ai.define({children:n});n.filter&&!n.serverFiltering&&(this._hierarchicalFilter=n.filter,n.filter=null);h.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)})},read:function(n){var t=h.fn.read.call(this,n);return this._hierarchicalFilter&&(this._data&&this._data.length>0?this.filter(this._hierarchicalFilter):(this.options.filter=this._hierarchicalFilter,this._filter=it(this.options.filter),this._hierarchicalFilter=null)),t},remove:function(n){var t=n.parentNode(),i=this,r;return t&&t._initChildren&&(i=t.children),r=h.fn.remove.call(i,n),t&&!i.data().length&&(t.hasChildren=!1),r},success:nu("success"),data:nu("data"),insert:function(n,t){var i=this.parent();return i&&i._initChildren&&(i.hasChildren=!0,i._initChildren()),h.fn.insert.call(this,n,t)},filter:function(n){if(n===t)return this._filter;!this.options.serverFiltering&&this._markHierarchicalQuery(n)&&(n={logic:"or",filters:[n,{field:"_matchFilter",operator:"equals",value:!0}]});this.trigger("reset");this._query({filter:n,page:1})},_markHierarchicalQuery:function(n){var t,e,i,r,f;return(n=it(n),!n||n.filters.length===0)?(this._updateHierarchicalFilter(function(){return!0}),!1):(t=u.filterExpr(n),i=t.fields,r=t.operators,e=f=new Function("d, __f, __o","return "+t.expression),(i.length||r.length)&&(f=function(n){return e(n,i,r)}),this._updateHierarchicalFilter(f),!0)},_updateHierarchicalFilter:function(n){for(var t,r=this._data,u=!1,i=0;i<r.length;i++)t=r[i],t.hasChildren?(t._matchFilter=t.children._updateHierarchicalFilter(n),t._matchFilter||(t._matchFilter=n(t))):t._matchFilter=n(t),t._matchFilter&&(u=!0);return u},_find:function(n,t){var r,e,i,f,u=this._data;if(u){if(i=h.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=tu(u,r)),t.data=i,t instanceof g?t:new g(t))};vi=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}});iu=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 vi(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:si},Query:u,DataSource:h,HierarchicalDataSource:g,Node:ai,ObservableObject:o,ObservableArray:a,LazyObservableArray:st,LocalTransport:sr,RemoteTransport:hr,Cache:lt,DataReader:si,Model:v,Buffer:vi,BatchBuffer:iu})}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.binder",["kendo.core","kendo.data"],n)}(function(){return 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,o,s=this.widget,e=n.addedItems||s.items(),h=s[u],f,c,l=i.data.HierarchicalDataSource;if((!l||!(h instanceof l))&&e.length)for(f=n.addedDataItems||h.flatView(),c=this.bindings[t]._parents(),r=0,o=f.length;r<o;r++)e[r]&&a(e[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"),p=[],b=!0,o,l={},c,v;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),v=n.children,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(),i,r=0;r<t.length;r++)i=u.children[n],p(i,!0),i.parentNode==u&&u.removeChild(i)},render:function(){var t=this.bindings.source.get(),f,r,o,u=this.container(),s=this.template();if(t!=null)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,h=this.options.valueField||this.options.textField,w=this.options.valuePrimitive,c,l,n,y,p,r=0,a=v.options.length;r<a;r++)c=v.options[r],c.selected&&(n=c.attributes.value,n=n&&n.specified?c.value:c.text,h?u.push(n):u.push(this._parseValue(n,this.dataType())));if(h)for(f=this.bindings.source.get(),f instanceof i.data.DataSource&&(f=f.view()),l=0;l<u.length;l++)for(r=0,a=f.length;r<a;r++)if(y=f[r].get(h),p=String(y)===u[l],p){u[l]=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||!h)?this.bindings[s].set(u[0]):this.bindings[s].set(u[0].get(h))},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=!dsiCommon.isNullOrEmpty(u.dsi)&&u.dsi.allowNullOverride?!1:!u.valuePrimitive&&(s==null||s instanceof o);this._valueIsObservableArray=s instanceof e;this._initChange=!1},_source:function(){var n;return this.widget.dataItem&&(n=this.widget.dataItem(),n&&n instanceof o)?[n]:(this.bindings.source&&(n=this.bindings.source.get()),(!n||n instanceof i.data.DataSource)&&(n=this.widget.dataSource.flatView()),n)},change:function(){var t=this.widget.value(),u=this.options.dataValueField||this.options.dataTextField,l=k.call(t)==="[object Array]",h=this._valueIsObservableObject,r,a,i=[],f,e,o,v,c,s;if(this._initChange=!0,s=n(this.widget.element[0]).attr("fieldType"),(s=="kendoCascadeDropDown"||s=="kendoCascadeComboBox")&&t!=""&&(t=this.widget.text()),u)if(t===""&&(h||this.options.valuePrimitive))t=null;else{for(c=this._source(),l&&(a=t.length,i=t.slice(0)),o=0,v=c.length;o<v;o++)if(f=c[o],e=f.get(u),l){for(r=0;r<a;r++)if(e==i[r]){i[r]=f;break}}else if(e==t){t=h?f:e;break}i[0]&&(t=this._valueIsObservableArray?i:h||!u?i[0]:i[0].get(u))}s=="kendoCascadeDropDown"?(t==""?this.widget.dsSetOnce==!0&&this.bindings.value.set(t):this.bindings.value.set(t),this.widget.dsSetOnce=!0):this.bindings.value.set(t);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.bound()?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._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),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.fx",["kendo.core"],n)}(function(){return 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 u=this,e,o=u.element,l=i._outerWidth,a=i._outerHeight,r=c[u._direction],v=-r.modifier*(r.vertical?a(o):l(o)),s=v/(u.options&&u.options.divisor||1)+w,h="0px";u._reverse&&(e=n,n=t,t=e);f?(n[r.transition]=s,t[r.transition]=h):(n[r.property]=s,t[r.property]=h)}});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 r=t.offset();return r.width=i._outerWidth(t),r.height=i._outerHeight(t),r};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),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.view",["kendo.core","kendo.binder","kendo.fx"],n)}(function(){return 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),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.dom",["kendo.core"],n)}(function(){return 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=String(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&&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.parentNode&&(i.nodeValue=this.nodeValue));this.node=i};r.prototype.text=function(){return this.nodeValue};o.prototype={nodeName:"#html",attr:{},remove:function(){for(var t,n=0;n<this.nodes.length;n++)t=this.nodes[n],t.parentNode&&t.parentNode.removeChild(t)},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 u=this.children,r,t=0,f=n.length;t<f;t++)r=u[t],r?r.node&&r.node.parentNode||(r.remove(),r=i):r=i,n[t].render(this.root,r);for(t=f;t<u.length;t++)u[t].remove();this.children=n}};n.dom={html:s,text:c,element:h,Tree:l,Node:u}}(window.kendo),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("ooxml/utils",["kendo.core"],n)}(function(){(function(){kendo.ooxml=kendo.ooxml||{};kendo.ooxml.createZip=function(){if(typeof JSZip=="undefined")throw new Error("JSZip not found. Check http://docs.telerik.com/kendo-ui/framework/excel/introduction#requirements for more details.");return new JSZip}})()},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("ooxml/kendo-ooxml",["kendo.core","ooxml/utils"],n)}(function(){(function(n){function d(n){return ct+n}function e(n,t){return t.indexOf(n)}function t(n){return String(n).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/g,"&quot;").replace(/\'/g,"&#39;")}function g(n,t){for(var r="",i=0;i<n;++i)r+=t(i);return r}function i(n,t){for(var r="",i=0;i<n.length;++i)r+=t(n[i],i);return r}function a(n){var t=Math.floor(n/26)-1;return(t>=0?a(t):"")+String.fromCharCode(65+n%26)}function o(n,t){return a(t)+(n+1)}function nt(n,t){return a(t)+"$"+(n+1)}function h(n){var t=n.frozenRows||(n.freezePane||{}).rowSplit||1;return t-1}function v(n){return(n/7*100+.5)/100}function ii(n){return n*.75}function ri(n){return String(n).replace(/[\x00-\x08]/g,"").replace(/\n/g,"\r\n")}function p(n){var t=n;return t.length<6&&(t=t.replace(/(\w)/g,function(n,t){return t+t})),t=t.substring(1).toUpperCase(),t.length<8&&(t="FF"+t),t}function ei(n){var t="thin";return n===2?t="medium":n===3&&(t="thick"),t}function c(n,t){var i="";return t&&(i+="<"+n+' style="'+ei(t.size)+'">',t.color&&(i+='<color rgb="'+p(t.color)+'"/>'),i+="<\/"+n+">"),i}function oi(n){return"<border>"+c("left",n.left)+c("right",n.right)+c("top",n.top)+c("bottom",n.bottom)+"<\/border>"}function si(n,t){var r=[],f=[],u,e,i;for(hi(n,function(n,t){var i={_source:n,index:t,height:n.height,cells:[]};r.push(i);f[t]=i}),u=ut(r).slice(0),e={rowData:r,rowsByIndex:f,mergedCells:t},i=0;i<u.length;i++)ai(u[i],e),delete u[i]._source;return ut(r)}function hi(n,t){for(var r,u,i=0;i<n.length;i++)(r=n[i],r)&&(u=r.index,typeof u!="number"&&(u=i),t(r,u))}function ut(n){return n.sort(function(n,t){return n.index-t.index})}function ci(n,t){n.indexOf(t)<0&&n.push(t)}function li(n,t){for(var r,u=0;u<n.length;++u){var e=n[u],f=e.split(":"),i=f[0];if(i===t)return r=f[1],i=ft(i),r=ft(r),{rowSpan:r.row-i.row+1,colSpan:r.col-i.col+1}}}function ft(n){function i(n){for(var r=n.toUpperCase(),t=0,i=0;i<r.length;++i)t=t*26+r.charCodeAt(i)-64;return t-1}function r(n){return parseInt(n,10)-1}var t=/^([a-z]+)(\d+)$/i.exec(n);return{row:r(t[2]),col:i(t[1])}}function ai(n,t){var p=n._source,s=n.index,a=p.cells,v=n.cells,h,l,u,e;if(a)for(h=0;h<a.length;h++){var f=a[h]||w,i=f.rowSpan||1,r=f.colSpan||1,c=vi(v,f),y=o(s,c);if(i===1&&r===1&&(l=li(t.mergedCells,y),l&&(r=l.colSpan,i=l.rowSpan)),ot(f,v,c,r),(i>1||r>1)&&ci(t.mergedCells,y+":"+o(s+i-1,c+r-1)),i>1)for(u=s+1;u<s+i;u++)e=t.rowsByIndex[u],e||(e=t.rowsByIndex[u]={index:u,cells:[]},t.rowData.push(e)),ot(f,e.cells,c-1,r+1)}}function vi(n,t){var i;return typeof t.index=="number"?(i=t.index,et(n,t,t.index)):i=yi(n,t),i}function et(n,t,i){n[i]=t}function yi(n,t){for(var r=n.length,i=0;i<n.length+1;i++)if(!n[i]){n[i]=t;r=i;break}return r}function ot(n,t,i,r){for(var f,u=1;u<r;u++)f={borderTop:n.borderTop,borderRight:n.borderRight,borderBottom:n.borderBottom,borderLeft:n.borderLeft},et(t,f,i+u)}function f(n){return pi({ref:n.ref,columns:n.columns,generators:{custom:wi,dynamic:bi,top:ki,value:di}})}var l,rt,w;window.kendo.ooxml=window.kendo.ooxml||{};var st=kendo.ooxml,u=n.map,ht=st.createZip,b={toString:function(n){return n}},s=kendo.Class.extend({});s.register=function(n){b=n};s.toString=function(n,t){return b.toString(n,t)};var ct="data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,",k={compression:"DEFLATE",type:"base64"},lt=6e4,at=864e5;l=JSON.parse.bind(JSON);var r='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r',vt=r+'\n            <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">\n               <Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/>\n               <Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/>\n               <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/>\n            <\/Relationships>',yt=function(n){var i=n.creator,u=n.lastModifiedBy,f=n.created,e=n.modified;return r+'\n <cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"\n   xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/"\n   xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\n   <dc:creator>'+t(i)+"<\/dc:creator>\n   <cp:lastModifiedBy>"+t(u)+'<\/cp:lastModifiedBy>\n   <dcterms:created xsi:type="dcterms:W3CDTF">'+t(f)+'<\/dcterms:created>\n   <dcterms:modified xsi:type="dcterms:W3CDTF">'+t(e)+"<\/dcterms:modified>\n<\/cp:coreProperties>"},pt=function(n){var u=n.sheets;return r+'\n<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">\n  <Application>Microsoft Excel<\/Application>\n  <DocSecurity>0<\/DocSecurity>\n  <ScaleCrop>false<\/ScaleCrop>\n  <HeadingPairs>\n    <vt:vector size="2" baseType="variant">\n      <vt:variant>\n        <vt:lpstr>Worksheets<\/vt:lpstr>\n      <\/vt:variant>\n      <vt:variant>\n        <vt:i4>'+u.length+'<\/vt:i4>\n      <\/vt:variant>\n    <\/vt:vector>\n  <\/HeadingPairs>\n  <TitlesOfParts>\n    <vt:vector size="'+u.length+'" baseType="lpstr">'+i(u,function(n,i){return n.options.title?"<vt:lpstr>"+t(n.options.title)+"<\/vt:lpstr>":"<vt:lpstr>Sheet"+(i+1)+"<\/vt:lpstr>"})+"<\/vt:vector>\n  <\/TitlesOfParts>\n  <LinksUpToDate>false<\/LinksUpToDate>\n  <SharedDoc>false<\/SharedDoc>\n  <HyperlinksChanged>false<\/HyperlinksChanged>\n  <AppVersion>14.0300<\/AppVersion>\n<\/Properties>"},wt=function(n){var t=n.count;return r+'\n<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">\n  <Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" />\n  <Default Extension="xml" ContentType="application/xml" />\n  <Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" />\n  <Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/>\n  <Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"/>\n  '+g(t,function(n){return'<Override PartName="/xl/worksheets/sheet'+(n+1)+'.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" />'})+'\n  <Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml" />\n  <Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml" />\n<\/Types>'},bt=function(n){var e=n.sheets,u=n.filterNames,f=n.userNames;return r+'\n<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">\n  <fileVersion appName="xl" lastEdited="5" lowestEdited="5" rupBuild="9303" />\n  <workbookPr defaultThemeVersion="124226" />\n  <bookViews>\n    <workbookView xWindow="240" yWindow="45" windowWidth="18195" windowHeight="7995" />\n  <\/bookViews>\n  <sheets>\n  '+i(e,function(n,i){var r=n.options,u=r.name||r.title||"Sheet"+(i+1);return'<sheet name="'+t(u)+'" sheetId="'+(i+1)+'" r:id="rId'+(i+1)+'" />'})+"\n  <\/sheets>\n  "+(u.length||f.length?"\n    <definedNames>\n      "+i(u,function(n){return'\n          <definedName name="_xlnm._FilterDatabase" hidden="1" localSheetId="'+n.localSheetId+'">'+t(n.name)+"!$"+t(n.from)+":$"+t(n.to)+"<\/definedName>"})+"\n      "+i(f,function(n){return'\n         <definedName name="'+n.name+'" hidden="'+(n.hidden?1:0)+'"'+(n.localSheetId!=null?'localSheetId="'+n.localSheetId+'"':"")+"<\/definedName>"})+"\n    <\/definedNames>":"")+'\n  <calcPr fullCalcOnLoad="1" calcId="145621" />\n<\/workbook>'},kt=function(n){var s=n.frozenColumns,h=n.frozenRows,o=n.columns,u=n.defaults,w=n.data,b=n.index,c=n.mergeCells,l=n.autoFilter,a=n.filter,k=n.showGridLines,y=n.hyperlinks,p=n.validations,e=n.defaultCellStyleId,d=n.rtl;return 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">\n   <dimension ref="A1" />\n\n   <sheetViews>\n     <sheetView '+(d?'rightToLeft="1"':"")+" "+(b===0?'tabSelected="1"':"")+' workbookViewId="0" '+(k===!1?'showGridLines="0"':"")+">\n     "+(h||s?'\n       <pane state="frozen"\n         '+(s?'xSplit="'+s+'"':"")+"\n         "+(h?'ySplit="'+h+'"':"")+'\n         topLeftCell="'+(String.fromCharCode(65+(s||0))+((h||0)+1))+'"\n       />':"")+'\n     <\/sheetView>\n   <\/sheetViews>\n\n   <sheetFormatPr x14ac:dyDescent="0.25" defaultRowHeight="'+(u.rowHeight?u.rowHeight*.75:15)+'"\n     '+(u.columnWidth?'defaultColWidth="'+v(u.columnWidth)+'"':"")+" />\n\n   "+(e!=null||o&&o.length>0?"\n     <cols>\n       "+(!o||!o.length?'\n         <col min="1" max="16384" style="'+e+'"\n              '+(u.columnWidth?'width="'+v(u.columnWidth)+'"':"")+" /> ":"")+"\n       "+i(o,function(n,t){var i=typeof n.index=="number"?n.index+1:t+1;return n.width===0?"<col "+(e!=null?'style="'+e+'"':"")+'\n                        min="'+i+'" max="'+i+'" hidden="1" customWidth="1" />':"<col "+(e!=null?'style="'+e+'"':"")+'\n                      min="'+i+'" max="'+i+'" customWidth="1"\n                      '+(n.autoWidth?'width="'+(n.width*7+5)/7/1+'" bestFit="1"':'width="'+v(n.width)+'"')+" />"})+"\n     <\/cols>":"")+"\n\n   <sheetData>\n     "+i(w,function(n,r){var u=typeof n.index=="number"?n.index+1:r+1;return'\n         <row r="'+u+'" x14ac:dyDescent="0.25"\n              '+(n.height===0?'hidden="1"':n.height?'ht="'+ii(n.height)+'" customHeight="1"':"")+">\n           "+i(n.data,function(n){return'\n             <c r="'+n.ref+'" '+(n.style?'s="'+n.style+'"':"")+" "+(n.type?'t="'+n.type+'"':"")+">\n               "+(n.formula!=null?"<f>"+t(n.formula)+"<\/f>":"")+"\n               "+(n.value!=null?"<v>"+t(n.value)+"<\/v>":"")+"\n             <\/c>"})+"\n         <\/row>\n       "})+"\n   <\/sheetData>\n\n   "+(l?'<autoFilter ref="'+l.from+":"+l.to+'"/>':a?f(a):"")+"\n\n   "+(c.length?'\n     <mergeCells count="'+c.length+'">\n       '+i(c,function(n){return'<mergeCell ref="'+n+'"/>'})+"\n     <\/mergeCells>":"")+"\n\n   "+(p.length?"\n     <dataValidations>\n       "+i(p,function(n){return'\n         <dataValidation sqref="'+n.sqref.join(" ")+'"\n                         showErrorMessage="'+n.showErrorMessage+'"\n                         type="'+t(n.type)+'"\n                         '+(n.type!=="list"?'operator="'+t(n.operator)+'"':"")+'\n                         allowBlank="'+n.allowBlank+'"\n                         showDropDown="'+n.showDropDown+'"\n                         '+(n.error?'error="'+t(n.error)+'"':"")+"\n                         "+(n.errorTitle?'errorTitle="'+t(n.errorTitle)+'"':"")+">\n           "+(n.formula1?"<formula1>"+t(n.formula1)+"<\/formula1>":"")+"\n           "+(n.formula2?"<formula2>"+t(n.formula2)+"<\/formula2>":"")+"\n         <\/dataValidation>"})+"\n     <\/dataValidations>":"")+"\n\n   "+(y.length?"\n     <hyperlinks>\n       "+i(y,function(n,t){return'\n         <hyperlink ref="'+n.ref+'" r:id="rId'+t+'"/>'})+"\n     <\/hyperlinks>":"")+'\n\n   <pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3" />\n<\/worksheet>'},dt=function(n){var t=n.count;return r+'\n<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">\n  '+g(t,function(n){return'\n    <Relationship Id="rId'+(n+1)+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet'+(n+1)+'.xml" />'})+'\n  <Relationship Id="rId'+(t+1)+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml" />\n  <Relationship Id="rId'+(t+2)+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Target="sharedStrings.xml" />\n<\/Relationships>'},gt=function(n){var u=n.hyperlinks;return r+'\n<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">\n  '+i(u,function(n,i){return'\n    <Relationship Id="rId'+i+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" Target="'+t(n.target)+'" TargetMode="External" />'})+"\n<\/Relationships>"},ni=function(n){var u=n.count,f=n.uniqueCount,e=n.indexes;return r+'\n<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="'+u+'" uniqueCount="'+f+'">\n  '+i(Object.keys(e),function(n){return"\n    <si><t>"+t(n.substring(1))+"<\/t><\/si>"})+"\n<\/sst>"},ti=function(n){var u=n.formats,f=n.fonts,e=n.fills,o=n.borders,s=n.styles;return r+'\n<styleSheet\n    xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"\n    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"\n    mc:Ignorable="x14ac"\n    xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac">\n  <numFmts count="'+u.length+'">\n  '+i(u,function(n,i){return'\n    <numFmt formatCode="'+t(n.format)+'" numFmtId="'+(165+i)+'" />'})+'\n  <\/numFmts>\n  <fonts count="'+(f.length+1)+'" x14ac:knownFonts="1">\n    <font>\n       <sz val="11" />\n       <color theme="1" />\n       <name val="Calibri" />\n       <family val="2" />\n       <scheme val="minor" />\n    <\/font>\n    '+i(f,function(n){return'\n    <font>\n      <sz val="'+(n.fontSize||11)+'" />\n      '+(n.bold?"<b/>":"")+"\n      "+(n.italic?"<i/>":"")+"\n      "+(n.underline?"<u/>":"")+"\n      "+(n.color?'<color rgb="'+t(n.color)+'" />':'<color theme="1" />')+"\n      "+(n.fontFamily?'\n        <name val="'+t(n.fontFamily)+'" />\n        <family val="2" />\n      ':'\n        <name val="Calibri" />\n        <family val="2" />\n        <scheme val="minor" />\n      ')+"\n    <\/font>"})+'\n  <\/fonts>\n  <fills count="'+(e.length+2)+'">\n      <fill><patternFill patternType="none"/><\/fill>\n      <fill><patternFill patternType="gray125"/><\/fill>\n    '+i(e,function(n){return"\n      "+(n.background?'\n        <fill>\n          <patternFill patternType="solid">\n              <fgColor rgb="'+t(n.background)+'"/>\n          <\/patternFill>\n        <\/fill>\n      ':"")})+'\n  <\/fills>\n  <borders count="'+(o.length+1)+'">\n    <border><left/><right/><top/><bottom/><diagonal/><\/border>\n    '+i(o,oi)+'\n  <\/borders>\n  <cellStyleXfs count="1">\n    <xf borderId="0" fillId="0" fontId="0" />\n  <\/cellStyleXfs>\n  <cellXfs count="'+(s.length+1)+'">\n    <xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" />\n    '+i(s,function(n){return'\n      <xf xfId="0"\n          '+(n.fontId?'fontId="'+n.fontId+'" applyFont="1"':"")+"\n          "+(n.fillId?'fillId="'+n.fillId+'" applyFill="1"':"")+"\n          "+(n.numFmtId?'numFmtId="'+n.numFmtId+'" applyNumberFormat="1"':"")+"\n          "+(n.textAlign||n.verticalAlign||n.wrap?'applyAlignment="1"':"")+"\n          "+(n.borderId?'borderId="'+n.borderId+'" applyBorder="1"':"")+">\n        "+(n.textAlign||n.verticalAlign||n.wrap?"\n        <alignment\n          "+(n.textAlign?'horizontal="'+t(n.textAlign)+'"':"")+"\n          "+(n.verticalAlign?'vertical="'+t(n.verticalAlign)+'"':"")+"\n          "+(n.wrap?'wrapText="1"':"")+" />\n        ":"")+"\n      <\/xf>\n    "})+'\n  <\/cellXfs>\n  <cellStyles count="1">\n    <cellStyle name="Normal" xfId="0" builtinId="0"/>\n  <\/cellStyles>\n  <dxfs count="0" />\n  <tableStyles count="0" defaultTableStyle="TableStyleMedium2" defaultPivotStyle="PivotStyleMedium9" />\n<\/styleSheet>'};var tt=new Date(1900,0,0),it=kendo.Class.extend({init:function(n,t,i,r){this.options=n;this._strings=t;this._styles=i;this._borders=r;this._validations={}},relsToXML:function(){var n=this.options.hyperlinks||[];return n.length?gt({hyperlinks:n}):""},toXML:function(n){var s=this,c=this.options.mergedCells||[],v=this.options.rows||[],l=si(v,c),t,a,i,r,u,f,e;this._readCells(l);t=this.options.filter;t&&typeof t.from=="number"&&typeof t.to=="number"?t={from:o(h(this.options),t.from),to:o(h(this.options),t.to)}:t&&t.ref&&t.columns&&(a=t,t=null);i=[];for(r in this._validations)Object.prototype.hasOwnProperty.call(s._validations,r)&&i.push(s._validations[r]);return u=null,this.options.defaultCellStyle&&(u=this._lookupStyle(this.options.defaultCellStyle)),f=this.options.freezePane||{},e=this.options.defaults||{},kt({frozenColumns:this.options.frozenColumns||f.colSplit,frozenRows:this.options.frozenRows||f.rowSplit,columns:this.options.columns,defaults:e,data:l,index:n,mergeCells:c,autoFilter:t,filter:a,showGridLines:this.options.showGridLines,hyperlinks:this.options.hyperlinks||[],validations:i,defaultCellStyleId:u,rtl:this.options.rtl!==undefined?this.options.rtl:e.rtl})},_lookupString:function(n){var i="$"+n,r=this._strings.indexes[i],t;return r!==undefined?t=r:(t=this._strings.indexes[i]=this._strings.uniqueCount,this._strings.uniqueCount++),this._strings.count++,t},_lookupStyle:function(n){var i=JSON.stringify(n),t;return i==="{}"?0:(t=e(i,this._styles),t<0&&(t=this._styles.push(i)-1),t+1)},_lookupBorder:function(n){var i=JSON.stringify(n),t;if(i!=="{}")return t=e(i,this._borders),t<0&&(t=this._borders.push(i)-1),t+1},_readCells:function(n){for(var t,u,i,f,e=this,r=0;r<n.length;r++)for(t=n[r],u=t.cells,t.data=[],i=0;i<u.length;i++)f=e._cell(u[i],t.index,i),f&&t.data.push(f)},_cell:function(n,t,i){var r,f,a,e,c,v,l;if(!n||n===w)return null;r=n.value;f={};n.borderLeft&&(f.left=n.borderLeft);n.borderRight&&(f.right=n.borderRight);n.borderTop&&(f.top=n.borderTop);n.borderBottom&&(f.bottom=n.borderBottom);f=this._lookupBorder(f);a=this.options.defaultCellStyle||{};e={borderId:f},function(n){n("color");n("background");n("bold");n("italic");n("underline");n("fontFamily")||n("fontName","fontFamily");n("fontSize");n("format");n("textAlign")||n("hAlign","textAlign");n("verticalAlign")||n("vAlign","verticalAlign");n("wrap")}(function(t,i){var r=n[t];return r===undefined&&(r=a[t]),r!==undefined?(e[i||t]=r,!0):void 0});var y=this.options.columns||[],h=y[i],u=typeof r;return h&&h.autoWidth&&(c=r,u==="number"&&(c=s.toString(r,n.format)),h.width=Math.max(h.width||0,String(c).length)),u==="string"?(r=ri(r),r=this._lookupString(r),u="s"):u==="number"?u="n":u==="boolean"?(u="b",r=Number(r)):r&&r.getTime?(u=null,v=(r.getTimezoneOffset()-tt.getTimezoneOffset())*lt,r=(r-tt-v)/at+1,e.format||(e.format="mm-dd-yy")):(u=null,r=null),e=this._lookupStyle(e),l=o(t,i),n.validation&&this._addValidation(n.validation,l),{value:r,formula:n.formula,type:u,style:e,ref:l}},_addValidation:function(n,t){var i={showErrorMessage:n.type==="reject"?1:0,formula1:n.from,formula2:n.to,type:fi[n.dataType]||n.dataType,operator:ui[n.comparerType]||n.comparerType,allowBlank:n.allowNulls?1:0,showDropDown:n.showButton?0:1,error:n.messageTemplate,errorTitle:n.titleTemplate},r=JSON.stringify(i);this._validations[r]||(this._validations[r]=i,i.sqref=[]);this._validations[r].sqref.push(t)}}),ui={greaterThanOrEqualTo:"greaterThanOrEqual",lessThanOrEqualTo:"lessThanOrEqual"},fi={number:"decimal"},y={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};rt=kendo.Class.extend({init:function(n){var t=this;this.options=n||{};this._strings={indexes:{},count:0,uniqueCount:0};this._styles=[];this._borders=[];this._sheets=u(this.options.sheets||[],function(n){return n.defaults=t.options,new it(n,t._strings,t._styles,t._borders)})},toZIP:function(){var ut=this,i=ht(),c=i.folder("docProps"),r,a,n,v,o,s,w,t;for(c.file("core.xml",yt({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()})),r=this._sheets.length,c.file("app.xml",pt({sheets:this._sheets})),a=i.folder("_rels"),a.file(".rels",vt),n=i.folder("xl"),v=n.folder("_rels"),v.file("workbook.xml.rels",dt({count:r})),o={},n.file("workbook.xml",bt({sheets:this._sheets,filterNames:u(this._sheets,function(n,t){var r=n.options,u=r.name||r.title||"Sheet"+(t+1),i;return o[u.toLowerCase()]=t,i=r.filter,i&&typeof i.from!="undefined"&&typeof i.to!="undefined"?{localSheetId:t,name:u,from:nt(h(r),i.from),to:nt(h(r),i.to)}:void 0}),userNames:u(this.options.names||[],function(n){return{name:n.localName,localSheetId:n.sheet?o[n.sheet.toLowerCase()]:null,value:n.value,hidden:n.hidden}})})),s=n.folder("worksheets"),w=s.folder("_rels"),t=0;t<r;t++){var b=ut._sheets[t],k="sheet"+(t+1)+".xml",d=b.relsToXML();d&&w.file(k+".rels",d);s.file(k,b.toXML(t))}var ft=u(this._borders,l),f=u(this._styles,l),g=function(n){return n.underline||n.bold||n.italic||n.color||n.fontFamily||n.fontSize},tt=u(f,function(n){return n.color&&(n.color=p(n.color)),g(n)?n:void 0}),it=u(f,function(n){if(n.format&&y[n.format]===undefined)return n}),rt=u(f,function(n){if(n.background)return n.background=p(n.background),n});return n.file("styles.xml",ti({fonts:tt,fills:rt,formats:it,borders:ft,styles:u(f,function(n){var t={};return g(n)&&(t.fontId=e(n,tt)+1),n.background&&(t.fillId=e(n,rt)+2),t.textAlign=n.textAlign,t.verticalAlign=n.verticalAlign,t.wrap=n.wrap,t.borderId=n.borderId,n.format&&(t.numFmtId=y[n.format]!==undefined?y[n.format]:165+e(n,it)),t})})),n.file("sharedStrings.xml",ni(this._strings)),i.file("[Content_Types].xml",wt({count:r})),i},toDataURL:function(){var n=this.toZIP();return n.generateAsync?n.generateAsync(k).then(d):d(n.generate(k))}});w={};var pi=function(n){var t=n.ref,r=n.columns,u=n.generators;return'\n<autoFilter ref="'+t+'">\n  '+i(r,function(n){return'\n    <filterColumn colId="'+n.index+'">\n      '+u[n.filter](n)+"\n    <\/filterColumn>\n  "})+"\n<\/autoFilter>"},wi=function(n){var t=n.logic,r=n.criteria;return"\n<customFilters "+(t==="and"?'and="1"':"")+">\n"+i(r,function(n){var t=f.customOperator(n),i=f.customValue(n);return"<customFilter "+(t?'operator="'+t+'"':"")+' val="'+i+'"/>'})+"\n<\/customFilters>"},bi=function(n){var t=n.type;return'<dynamicFilter type="'+f.dynamicFilterType(t)+'" />'},ki=function(n){var t=n.type,i=n.value;return'<top10 percent="'+(/percent$/i.test(t)?1:0)+'"\n       top="'+(/^top/i.test(t)?1:0)+'"\n       val="'+i+'" />'},di=function(n){var t=n.blanks,r=n.values;return"<filters "+(t?'blank="1"':"")+">\n    "+i(r,function(n){return'\n      <filter val="'+n+'" />'})+"\n  <\/filters>"};f.customOperator=function(n){return{eq:"equal",gt:"greaterThan",gte:"greaterThanOrEqual",lt:"lessThan",lte:"lessThanOrEqual",ne:"notEqual",doesnotstartwith:"notEqual",doesnotendwith:"notEqual",doesnotcontain:"notEqual",doesnotmatch:"notEqual"}[n.operator.toLowerCase()]};f.customValue=function(n){function t(n){return n.replace(/([*?])/g,"~$1")}switch(n.operator.toLowerCase()){case"startswith":case"doesnotstartwith":return t(n.value)+"*";case"endswith":case"doesnotendwith":return"*"+t(n.value);case"contains":case"doesnotcontain":return"*"+t(n.value)+"*";default:return n.value}};f.dynamicFilterType=function(n){return{quarter1:"Q1",quarter2:"Q2",quarter3:"Q3",quarter4:"Q4",january:"M1",february:"M2",march:"M3",april:"M4",may:"M5",june:"M6",july:"M7",august:"M8",september:"M9",october:"M10",november:"M11",december:"M12"}[n.toLowerCase()]||n};kendo.deepExtend(kendo.ooxml,{IntlService:s,Workbook:rt,Worksheet:it})})(window.kendo.jQuery)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("ooxml/main",["kendo.core","ooxml/kendo-ooxml"],n)}(function(){(function(n){var t=kendo.ooxml.Workbook;kendo.ooxml.IntlService.register({toString:kendo.toString});kendo.ooxml.Workbook=t.extend({toDataURL:function(){var n=t.fn.toDataURL.call(this);if(typeof n!="string")throw new Error("The toDataURL method can be used only with jsZip 2. Either include jsZip 2 or use the toDataURLAsync method.");return n},toDataURLAsync:function(){var r=n.Deferred(),i=t.fn.toDataURL.call(this);return typeof i=="string"?i=r.resolve(i):i&&i.then&&i.then(function(n){r.resolve(n)},function(){r.reject()}),r.promise()}})})(window.kendo.jQuery)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.ooxml",["ooxml/main"],n)}(function(){},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("excel/kendo-excel",["kendo.core"],n)}(function(){(function(n){function o(n){return n.title+": "+n.value}function i(n,t){for(var r=[],i=0;i<n;i++)r.push(t(i));return r}var f;window.kendo.excel=window.kendo.excel||{};var r=kendo.getter,e=n.map,u={compile:function(n){return n}},t=kendo.Class.extend({});t.register=function(n){u=n};t.compile=function(n){return u.compile(n)};f=kendo.Class.extend({init:function(n){n.columns=this._trimColumns(n.columns||[]);this.allColumns=e(this._leafColumns(n.columns||[]),this._prepareColumn);this.columns=this.allColumns.filter(function(n){return!n.hidden});this.options=n;this.data=n.data||[];this.aggregates=n.aggregates||{};this.groups=[].concat(n.groups||[]);this.hierarchy=n.hierarchy},workbook:function(){return{sheets:[{columns:this._columns(),rows:this.hierarchy?this._hierachyRows():this._rows(),freezePane:this._freezePane(),filter:this._filter()}]}},_trimColumns:function(n){var t=this;return n.filter(function(n){var i=Boolean(n.field);return!i&&n.columns&&(i=t._trimColumns(n.columns).length>0),i})},_leafColumns:function(n){for(var r=this,i=[],t=0;t<n.length;t++)n[t].columns?i=i.concat(r._leafColumns(n[t].columns)):i.push(n[t]);return i},_prepareColumn:function(i){if(!i.field)return null;var f=function(n){return r(i.field)(n)},u=null;return i.values&&(u={},i.values.forEach(function(n){u[n.value]=n.text}),f=function(n){return u[r(i.field)(n)]}),n.extend({},i,{value:f,values:u,groupHeaderTemplate:i.groupHeaderTemplate?t.compile(i.groupHeaderTemplate):o,groupFooterTemplate:i.groupFooterTemplate?t.compile(i.groupFooterTemplate):null,footerTemplate:i.footerTemplate?t.compile(i.footerTemplate):null})},_filter:function(){if(!this.options.filterable)return null;var n=this._depth();return{from:n,to:n+this.columns.length-1}},_createPaddingCells:function(t){var r=this;return i(t,function(){return n.extend({background:"#dfdfdf",color:"#333"},r.options.paddingCellOptions)})},_dataRow:function(t,i,r){var h=this,o=this._createPaddingCells(i),s,e,f;if(r&&t.items){var u=this.allColumns.filter(function(n){return n.field===t.field})[0],c=u&&u.title?u.title:t.field,l=u?u.groupHeaderTemplate:null,v=n.extend({title:c,field:t.field,value:u&&u.values?u.values[t.value]:t.value,aggregates:t.aggregates,items:t.items},t.aggregates[t.field]),a=c+": "+t.value;return l&&(a=l(v)),o.push(n.extend({value:a,background:"#dfdfdf",color:"#333",colSpan:this.columns.length+r-i},(u||{}).groupHeaderCellOptions)),s=this._dataRows(t.items,i+1),s.unshift({type:"group-header",cells:o}),s.concat(this._footer(t))}for(e=[],f=0;f<this.columns.length;f++)e[f]=h._cell(t,h.columns[f]);return this.hierarchy&&(e[0].colSpan=r-i+1),[{type:"data",cells:o.concat(e)}]},_dataRows:function(n,t){for(var u=this,f=this._depth(),i=[],r=0;r<n.length;r++)i.push.apply(i,u._dataRow(n[r],t,f));return i},_hierachyRows:function(){for(var f,t,l,s=this,i=this._depth(),r=this.data,a=this.hierarchy.itemLevel,h=this._hasFooterTemplate(),n=[],e=[],u=0,c,o=0;o<r.length;o++)f=r[o],t=a(f),h&&(t>u?e.push({id:c,level:u}):t<u&&n.push.apply(n,s._hierarchyFooterRows(e,t,i)),u=t,c=f.id),n.push.apply(n,s._dataRow(f,t+1,i));return h&&(n.push.apply(n,this._hierarchyFooterRows(e,0,i)),l=r.length?this.aggregates[r[0].parentId]:{},n.push(this._hierarchyFooter(l,0,i))),this._prependHeaderRows(n),n},_hierarchyFooterRows:function(n,t,i){for(var u=this,f=[],r;n.length&&n[n.length-1].level>=t;)r=n.pop(),f.push(u._hierarchyFooter(u.aggregates[r.id],r.level+1,i));return f},_hasFooterTemplate:function(){for(var t=this.columns,n=0;n<t.length;n++)if(t[n].footerTemplate)return!0},_hierarchyFooter:function(t,i,r){var u=this.columns.map(function(u,f){var e=f?1:r-i+1;return u.footerTemplate?n.extend({background:"#dfdfdf",color:"#333",colSpan:e,value:u.footerTemplate(n.extend({},(t||{})[u.field]))},u.footerCellOptions):n.extend({background:"#dfdfdf",color:"#333",colSpan:e},u.footerCellOptions)});return{type:"footer",cells:this._createPaddingCells(i).concat(u)}},_footer:function(t){var u=this,i=[],r=!1,f=this.columns.map(function(i){if(i.groupFooterTemplate){var f=n.extend({},u.aggregates,t.aggregates,t.aggregates[i.field],{group:{items:t.items,field:t.field,value:t.value}});return f[t.field]=f,r=!0,n.extend({background:"#dfdfdf",color:"#333",value:i.groupFooterTemplate(f)},i.groupFooterCellOptions)}return n.extend({background:"#dfdfdf",color:"#333"},i.groupFooterCellOptions)});return r&&i.push({type:"group-footer",cells:this._createPaddingCells(this.groups.length).concat(f)}),i},_isColumnVisible:function(n){return this._visibleColumns([n]).length>0&&(n.field||n.columns)},_visibleColumns:function(n){var t=this;return n.filter(function(n){var i=!n.hidden;return i&&n.columns&&(i=t._visibleColumns(n.columns).length>0),i})},_headerRow:function(t,r){var f=this,u=t.cells.map(function(i){return n.extend(i,{colSpan:i.colSpan>1?i.colSpan:1,rowSpan:t.rowSpan>1&&!i.colSpan?t.rowSpan:1})});return this.hierarchy&&(u[0].colSpan=this._depth()+1),{type:"header",cells:i(r.length,function(){return n.extend({background:"#7a7a7a",color:"#fff"},f.options.headerPaddingCellOptions)}).concat(u)}},_prependHeaderRows:function(n){var r=this,u=this.groups,i=[{rowSpan:1,cells:[],index:0}],t;for(this._prepareHeaderRows(i,this.options.columns),t=i.length-1;t>=0;t--)n.unshift(r._headerRow(i[t],u))},_prepareHeaderRows:function(t,i,r,u){for(var f,e,o=this,s=u||t[t.length-1],h=t[s.index+1],l=0,c=0;c<i.length;c++)f=i[c],o._isColumnVisible(f)&&(e=n.extend({background:"#7a7a7a",color:"#fff",value:f.title||f.field,colSpan:0},f.headerCellOptions),s.cells.push(e),f.columns&&f.columns.length&&(h||(h={rowSpan:0,cells:[],index:t.length},t.push(h)),e.colSpan=o._trimColumns(o._visibleColumns(f.columns)).length,o._prepareHeaderRows(t,f.columns,e,h),l+=e.colSpan-1,s.rowSpan=t.length-s.index));r&&(r.colSpan+=l)},_rows:function(){var r=this,t=this._dataRows(this.data,0),i,u;return this.columns.length&&(this._prependHeaderRows(t),i=!1,u=this.columns.map(function(t){return t.footerTemplate?(i=!0,n.extend({background:"#dfdfdf",color:"#333",value:t.footerTemplate(n.extend({},r.aggregates,r.aggregates[t.field]))},t.footerCellOptions)):n.extend({background:"#dfdfdf",color:"#333"},t.footerCellOptions)}),i&&t.push({type:"footer",cells:this._createPaddingCells(this.groups.length).concat(u)})),t},_headerDepth:function(n){for(var r,u=this,i=0,t=0;t<n.length;t++)n[t].columns&&(r=u._headerDepth(n[t].columns),r>i&&(i=r));return 1+i},_freezePane:function(){var n=this._visibleColumns(this.options.columns||[]),t=this._visibleColumns(this._trimColumns(this._leafColumns(n.filter(function(n){return n.locked})))).length;return{rowSplit:this._headerDepth(n),colSplit:t?t+this.groups.length:0}},_cell:function(t,i){return n.extend({value:i.value(t)},i.cellOptions)},_depth:function(){return this.hierarchy?this.hierarchy.depth:this.groups.length},_columns:function(){var n=this._depth(),t=i(n,function(){return{width:20}});return t.concat(this.columns.map(function(n){return{width:parseInt(n.width,10),autoWidth:n.width?!1:!0}}))}});kendo.deepExtend(kendo.excel,{ExcelExporter:f,TemplateService:t})})(window.kendo.jQuery)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("excel/main",["kendo.core","kendo.data","excel/kendo-excel"],n)}(function(){return function(n,t){var r=t.excel.ExcelExporter,i=n.extend;t.excel.TemplateService.register({compile:t.template});t.ExcelExporter=t.Class.extend({init:function(n){var r,f,u;this.options=n;r=n.dataSource;r instanceof t.data.DataSource?(this.dataSource=new r.constructor(i({},r.options,{page:n.allPages?0:r.page(),filter:r.filter(),pageSize:n.allPages?r.total():r.pageSize(),sort:r.sort(),group:r.group(),aggregate:r.aggregate()})),f=r.data(),f.length>0&&(this.dataSource._data=f,u=this.dataSource.transport,r._isServerGrouped()&&u.options&&u.options.data&&(u.options.data=null))):this.dataSource=t.data.DataSource.create(r)},_hierarchy:function(){var n=this.options.hierarchy,t=this.dataSource,u,i,f,r;if(n&&t.level){for(n={itemLevel:function(n){return t.level(n)}},u=t.view(),i=0,r=0;r<u.length;r++)f=t.level(u[r]),f>i&&(i=f);n.depth=i+1}else n=!1;return{hierarchy:n}},workbook:function(){return n.Deferred(n.proxy(function(t){this.dataSource.fetch().then(n.proxy(function(){var n=new r(i({},this.options,this._hierarchy(),{data:this.dataSource.view(),groups:this.dataSource.group(),aggregates:this.dataSource.aggregates()})).workbook();t.resolve(n,this.dataSource.view())},this))},this)).promise()}})}(kendo.jQuery,kendo),kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("excel/mixins",["excel/main","kendo.ooxml"],n)}(function(){return function(n,t){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);u.toDataURLAsync().then(function(r){t.saveAs({dataURI:r,fileName:n.fileName||i.fileName,proxyURL:i.proxyURL,forceProxy:i.forceProxy})})}},this))}}}(kendo.jQuery,kendo),kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.excel",["excel/main","excel/mixins"],n)}(function(){},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.data.signalr",["kendo.data"],n)}(function(){return 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),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("drawing/util",["kendo.core"],n)}(function(){return function(n){function t(){return n.Deferred()}function i(t){return n.when.apply(n,t)}kendo.drawing.util=kendo.drawing.util||{};kendo.deepExtend(kendo.drawing.util,{createPromise:t,promiseAll:i})}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.color",["kendo.core"],n)}(function(){function e(n,t,i){i===void 0&&(i="0");for(var r=n.toString(16);t>r.length;)r=i+r;return r}function s(n,t,i){var r=i;return(r<0&&(r+=1),r>1&&(r-=1),r<1/6)?n+(t-n)*6*r:r<1/2?t:r<2/3?n+(t-n)*(2/3-r)*6:n}function h(n,u){var e,s,o;if(n==null||n==="none")return null;if(n instanceof i)return n;if(o=n.toLowerCase(),e=a(o))return o=e[1]==="transparent"?new t(1,1,1,0):h(f[e[1]],u),o.match=[e[1]],o;if((e=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})\b/i.exec(o))?s=new r(parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16),1):(e=/^#?([0-9a-f])([0-9a-f])([0-9a-f])\b/i.exec(o))?s=new r(parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16),1):(e=/^rgb\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/.exec(o))?s=new r(parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3],10),1):(e=/^rgba\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9.]+)\s*\)/.exec(o))?s=new r(parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3],10),parseFloat(e[4])):(e=/^rgb\(\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*\)/.exec(o))?s=new t(parseFloat(e[1])/100,parseFloat(e[2])/100,parseFloat(e[3])/100,1):(e=/^rgba\(\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9.]+)\s*\)/.exec(o))&&(s=new t(parseFloat(e[1])/100,parseFloat(e[2])/100,parseFloat(e[3])/100,parseFloat(e[4]))),s)s.match=e;else if(!u)throw new Error("Cannot parse color: "+o);return s}var u,o,n;window.kendo=window.kendo||{};var c=kendo.Class,v=kendo.support,f={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"},l=v.browser,a=function(n){var i=Object.keys(f),t;return i.push("transparent"),t=new RegExp("^("+i.join("|")+")(\\W|$)","i"),a=function(n){return t.exec(n)},t.exec(n)},i=c.extend({init:function(){},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+", "+parseFloat(Number(this.a).toFixed(3))+")"},toDisplay:function(){return l.msie&&l.version<9?this.toCss():this.toCssRgba()},equals:function(n){return n===this||n!==null&&this.toCssRgba()===h(n).toCssRgba()},diff:function(n){if(n===null)return NaN;var t=this.toBytes(),i=n.toBytes();return Math.sqrt(Math.pow((t.r-i.r)*.3,2)+Math.pow((t.g-i.g)*.59,2)+Math.pow((t.b-i.b)*.11,2))},clone:function(){var n=this.toBytes();return n===this&&(n=new r(n.r,n.g,n.b,n.a)),n}}),t=i.extend({init:function(n,t,r,u){i.fn.init.call(this);this.r=n;this.g=t;this.b=r;this.a=u},toHSV:function(){var o=this,i=o.r,r=o.g,e=o.b,c=Math.min(i,r,e),n=Math.max(i,r,e),f=n-c,h=n,t,s;return f===0?new u(0,0,h,this.a):(n!==0?(s=f/n,t=i===n?(r-e)/f:r===n?2+(e-i)/f:4+(i-r)/f,t*=60,t<0&&(t+=360)):(s=0,t=-1),new u(t,s,h,this.a))},toHSL:function(){var h=this,f=h.r,n=h.g,t=h.b,i=Math.max(f,n,t),e=Math.min(f,n,t),r,s,c=(i+e)/2,u;if(i===e)r=s=0;else{u=i-e;s=c>.5?u/(2-i-e):u/(i+e);switch(i){case f:r=(n-t)/u+(n<t?6:0);break;case n:r=(t-f)/u+2;break;case t:r=(f-n)/u+4}r*=60;s*=100;c*=100}return new o(r,s,c,this.a)},toBytes:function(){return new r(this.r*255,this.g*255,this.b*255,this.a)}}),r=t.extend({init:function(n,i,r,u){t.fn.init.call(this,Math.round(n),Math.round(i),Math.round(r),u)},toRGB:function(){return new t(this.r/255,this.g/255,this.b/255,this.a)},toHSV:function(){return this.toRGB().toHSV()},toHSL:function(){return this.toRGB().toHSL()},toHex:function(){return e(this.r,2)+e(this.g,2)+e(this.b,2)},toBytes:function(){return this}});u=i.extend({init:function(n,t,r,u){i.fn.init.call(this);this.h=n;this.s=t;this.v=r;this.a=u},toRGB:function(){var o=this,s=o.h,e=o.s,n=o.v,i,r,u;if(e===0)i=r=u=n;else{s/=60;var l=Math.floor(s),a=s-l,f=n*(1-e),h=n*(1-e*a),c=n*(1-e*(1-a));switch(l){case 0:i=n;r=c;u=f;break;case 1:i=h;r=n;u=f;break;case 2:i=f;r=n;u=c;break;case 3:i=f;r=h;u=n;break;case 4:i=c;r=f;u=n;break;default:i=n;r=f;u=h}}return new t(i,r,u,this.a)},toHSL:function(){return this.toRGB().toHSL()},toBytes:function(){return this.toRGB().toBytes()}});o=i.extend({init:function(n,t,r,u){i.fn.init.call(this);this.h=n;this.s=t;this.l=r;this.a=u},toRGB:function(){var e=this,u=e.h,i=e.s,n=e.l,o,h,c,r,f;return i===0?o=h=c=n:(u/=360,i/=100,n/=100,r=n<.5?n*(1+i):n+i-n*i,f=2*n-r,o=s(f,r,u+1/3),h=s(f,r,u),c=s(f,r,u-1/3)),new t(o,h,c,this.a)},toHSV:function(){return this.toRGB().toHSV()},toBytes:function(){return this.toRGB().toBytes()}});n=c.extend({init:function(t){var f=this,r,e,i,u;if(arguments.length===1)for(r=n.formats,e=this.resolveColor(t),i=0;i<r.length;i++){var s=r[i].re,h=r[i].process,o=s.exec(e);o&&(u=h(o),f.r=u[0],f.g=u[1],f.b=u[2])}else this.r=arguments[0],this.g=arguments[1],this.b=arguments[2];this.r=this.normalizeByte(this.r);this.g=this.normalizeByte(this.g);this.b=this.normalizeByte(this.b)},toHex:function(){var n=this.padDigit,t=this.r.toString(16),i=this.g.toString(16),r=this.b.toString(16);return"#"+n(t)+n(i)+n(r)},resolveColor:function(t){var i=t||"black";return i.charAt(0)==="#"&&(i=i.substr(1,6)),i=i.replace(/ /g,""),i=i.toLowerCase(),n.namedColors[i]||i},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=Math.round;return this.r=t(this.normalizeByte(this.r*n)),this.g=t(this.normalizeByte(this.g*n)),this.b=t(this.normalizeByte(this.b*n)),this},percBrightness:function(){return Math.sqrt(.241*this.r*this.r+.691*this.g*this.g+.068*this.b*this.b)}});n.fromBytes=function(n,t,i,u){return new r(n,t,i,u!=null?u:1)};n.fromRGB=function(n,i,r,u){return new t(n,i,r,u!=null?u:1)};n.fromHSV=function(n,t,i,r){return new u(n,t,i,r!=null?r:1)};n.fromHSL=function(n,t,i,r){return new o(n,t,i,r!=null?r:1)};n.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)]}}];n.namedColors=f;kendo.deepExtend(kendo,{parseColor:h,Color:n})},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("util/text-metrics",["kendo.core"],n)}(function(){(function(n){function u(n){return String(n).replace(h,c)}function f(n){var t=[];for(var i in n)t.push(i+n[i]);return t.sort().join("")}function e(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 o(){return{width:0,height:0,baseline:0}}function l(n,i,r){return t.current.measure(n,i,r)}var s,i,t;window.kendo.util=window.kendo.util||{};var r=kendo.Class.extend({init:function(n){this._size=n;this._length=0;this._map={}},put:function(n,t){var r=this._map,i={key:n,value:t};r[n]=i;this._head?(this._tail.newer=i,i.older=this._tail,this._tail=i):this._head=this._tail=i;this._length>=this._size?(r[this._head.key]=null,this._head=this._head.newer,this._head.older=null):this._length++},get:function(n){var t=this._map[n];if(t)return t===this._head&&t!==this._tail&&(this._head=t.newer,this._head.older=null),t!==this._tail&&(t.older&&(t.older.newer=t.newer,t.newer.older=t.older),t.older=this._tail,t.newer=null,this._tail.newer=t,this._tail=t),t.value}}),h=/\r?\n|\r|\t/g,c=" ";s={baselineMarkerSize:1};typeof document!="undefined"&&(i=document.createElement("div"),i.style.cssText="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: pre!important;");t=kendo.Class.extend({init:function(t){this._cache=new r(1e3);this.options=n.extend({},s,t)},measure:function(n,t,r){var c,l,a;if(r===void 0&&(r={}),!n)return o();var w=f(t),v=e(n+w),y=this._cache.get(v);if(y)return y;var h=o(),s=r.box||i,p=this._baselineMarker().cloneNode(!1);for(c in t)l=t[c],typeof l!="undefined"&&(s.style[c]=l);return a=r.normalizeText!==!1?u(n):String(n),s.textContent=a,s.appendChild(p),document.body.appendChild(s),a.length&&(h.width=s.offsetWidth-this.options.baselineMarkerSize,h.height=s.offsetHeight,h.baseline=p.offsetTop+this.options.baselineMarkerSize),h.width>0&&h.height>0&&this._cache.put(v,h),s.parentNode.removeChild(s),h},_baselineMarker:function(){var n=document.createElement("div");return n.style.cssText="display: inline-block; vertical-align: baseline;width: "+this.options.baselineMarkerSize+"px; height: "+this.options.baselineMarkerSize+"px;overflow: hidden;",n}});t.current=new t;kendo.deepExtend(kendo.util,{LRUCache:r,TextMetrics:t,measureText:l,objectKey:f,hashKey:e,normalizeText:u})})(window.kendo.jQuery)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("drawing/kendo-drawing",["drawing/util","kendo.color","util/text-metrics"],n)}(function(){(function(n){function di(n,t){return n.push.apply(n,t),n}function kr(n){for(var 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+=ke[t[0]],n-=t[0]);return i}function r(n){return typeof n!==de}function dr(){return"kdef"+ge++}function yt(n){return n/gu}function pc(n){for(var t,i="",r=0;r<n.length;r++)t=n.charCodeAt(r),t<128?i+=dt(t):t<2048?(i+=dt(192|t>>>6),i+=dt(128|t&63)):t<65536&&(i+=dt(224|t>>>12),i+=dt(128|t>>>6&63),i+=dt(128|t&63));return i}function no(n){for(var r="",t=0,i=pc(n);t<i.length;){var o=i.charCodeAt(t++),u=i.charCodeAt(t++),f=i.charCodeAt(t++),h=o>>2,c=(o&3)<<4|u>>4,s=(u&15)<<2|f>>6,e=f&63;isNaN(u)?s=e=64:isNaN(f)&&(e=64);r=r+gi.charAt(h)+gi.charAt(c)+gi.charAt(s)+gi.charAt(e)}return r}function to(n){return r((n.x||{}).location)?{x:n.x.location,y:n.y.location}:{x:n.pageX||n.clientX||0,y:n.pageY||n.clientY||0}}function io(n){return n===void 0&&(n={}),n.touch?n.touch.initialTouch:n.target}function gt(n){return n===""||n===null||n==="none"||n==="transparent"||!r(n)}function d(n){if(n)return n[n.length-1]}function ro(n,t,i){return Math.max(Math.min(n,i),t)}function gr(n,t){function r(n,i){for(var r=[],u=0,f=0,e=0;u<n.length&&f<i.length;)r[e++]=t(n[u],i[f])<=0?n[u++]:i[f++];return u<n.length&&r.push.apply(r,n.slice(u)),f<i.length&&r.push.apply(r,i.slice(f)),r}return n.length<2?n.slice():function i(n){if(n.length<=1)return n;var f=Math.floor(n.length/2),t=n.slice(0,f),u=n.slice(f);return t=i(t),u=i(u),r(t,u)}(n)}function ut(n){return n*gu}function wc(n){return n?Math.pow(10,n):1}function s(n,t){var i=wc(t);return Math.round(n*i)/i}function nf(n,t){return r(n)?n:t}function tf(n,t){var r,u,i;for(r in t)for(u=r.trim().split(" "),i=0;i<u.length;i++)n.addEventListener(u[i],t[r],!1)}function uo(n){var i=n.getBoundingClientRect(),t=document.documentElement;return{top:i.top+(window.pageYOffset||t.scrollTop)-(t.clientTop||0),left:i.left+(window.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}}function nu(n,t){for(var r,u={},e=window.getComputedStyle(n),f=Array.isArray(t)?t:[t],i=0;i<f.length;i++)r=f[i],u[r]=e[r];return u}function fo(n){return isNaN(n)?n:n+"px"}function nr(n,t){var i,u,f;if(t)i=t.width,u=t.height,r(i)&&(n.style.width=fo(i)),r(u)&&(n.style.height=fo(u));else return f=nu(n,["width","height"]),{width:parseInt(f.width,10),height:parseInt(f.height,10)}}function rf(n,t){var r,u,i;t===void 0&&(t={});for(r in t)for(u=r.trim().split(" "),i=0;i<u.length;i++)n.removeEventListener(u[i],t[r],!1)}function dc(n){return function(t){return this[n]!==t&&(this[n]=t,this.geometryChange()),this}}function gc(n){return function(){return this[n]}}function tu(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]=dc(i),n["get"+u]=gc(i)}function pt(n){return n&&typeof n.matrix=="function"?n.matrix():n}function p(n){return n===null?null:n instanceof hi?n:new hi(n)}function eo(n,t,i,r){var u=0,f=0;return r&&(u=Math.atan2(r.c*i,r.a*t),r.b!==0&&(f=Math.atan2(r.d*i,r.b*t))),{x:u,y:f}}function il(n){var t="_"+n;return function(n){return r(n)?(this._observerField(t,n),this.geometryChange(),this):this[t]}}function iu(n,t){for(var i=0;i<t.length;i++)n[t[i]]=il(t[i])}function so(n,t,i){return i===void 0&&(i=ft),s(Math.abs(n-t),i)===0}function ff(n,t,i){return n<t||so(n,t,i)}function rl(n,i,r,u){var e=i.x-n.x,s=u.x-r.x,o=i.y-n.y,h=u.y-r.y,c=n.x-r.x,l=n.y-r.y,a=e*h-s*o,v=(e*l-o*c)/a,f=(s*l-h*c)/a;if(v>=0&&v<=1&&f>=0&&f<=1)return new t(n.x+f*e,n.y+f*o)}function ho(n,t,i,r,u,f){var e=s((u-n)/i,3),o=s((f-t)/r,3);return s(yt(Math.atan2(o,e)))}function fl(n){var rt=n.x1,ft=n.y1,et=n.x2,ot=n.y2,i=n.rx,r=n.ry,at=n.largeArc,st=n.swipe,a=n.rotation,h,l,lt;a===void 0&&(a=0);var ht=ut(a),v=Math.cos(ht),y=Math.sin(ht),p=v*(rt-et)/2+y*(ft-ot)/2,w=-y*(rt-et)/2+v*(ft-ot)/2,vt=at!==st?1:-1,b=Math.pow(p,2),k=Math.pow(w,2),e=Math.pow(i,2),o=Math.pow(r,2),d=b/e+k/o;d>1&&(d=Math.sqrt(b/e+k/o),i=d*i,e=Math.pow(i,2),r=d*r,o=Math.pow(r,2));h=vt*Math.sqrt((e*o-e*k-o*b)/(e*k+o*b));isNaN(h)&&(h=0);var g=h*i*w/r,nt=-h*r*p/i,pt=v*g-y*nt+(rt+et)/2,wt=y*g+v*nt+(ft+ot)/2,u=(p-g)/i,f=(w-nt)/r,tt=-(p+g)/i,it=-(w+nt)/r,ct=(f>=0?1:-1)*yt(Math.acos(u/Math.sqrt(u*u+f*f))),bt=s((u*tt+f*it)/(Math.sqrt(u*u+f*f)*Math.sqrt(tt*tt+it*it)),10),c=(u*it-f*tt>=0?1:-1)*yt(Math.acos(bt));return!st&&c>0&&(c-=360),st&&c<0&&(c+=360),l=ct+c,lt=l>=0?1:-1,l=Math.abs(l)%360*lt,{center:new t(pt,wt),startAngle:ct,endAngle:l,radiusX:i,radiusY:r,xRotation:a}}function co(n,t){for(var i=n;i<t;)i+=90;return i}function ll(n){var i="_"+n;return function(n){return r(n)?(this._observerField(i,t.create(n)),this.geometryChange(),this):this[i]}}function uu(n,t){for(var i=0;i<t.length;i++)n[t[i]]=ll(t[i])}function ao(n,t,i){var r=yt(Math.atan2(t.y-n.y,t.x-n.x)),u=i.transformCopy(p().rotate(-r,n));return u.x<n.x}function fu(n,t,i){var r=1-n;return Math.pow(r,3)*i[0][t]+3*Math.pow(r,2)*n*i[1][t]+3*Math.pow(n,2)*r*i[2][t]+Math.pow(n,3)*i[3][t]}function vo(n,t){return[-n[0][t]+3*n[1][t]-3*n[2][t]+n[3][t],3*(n[0][t]-2*n[1][t]+n[2][t]),3*(-n[0][t]+n[1][t]),n[0][t]]}function yo(n){return n<0?-1:1}function al(n,t,i){var r=Math.sqrt(Math.pow(t,2)-4*n*i);return[(-t+r)/(2*n),(-t-r)/(2*n)]}function po(n,t,i,r){var h;if(n===0)return al(t,i,r);var b=(3*n*i-Math.pow(t,2))/(3*Math.pow(n,2)),e=(2*Math.pow(t,3)-9*n*t*i+27*Math.pow(n,2)*r)/(27*Math.pow(n,3)),o=Math.pow(b/3,3)+Math.pow(e/2,2),w=new tt(0,1),c=-t/(3*n),u,f,l,a,v,y,p;return o<0?(u=new tt(-e/2,Math.sqrt(-o)).nthRoot(3),f=new tt(-e/2,-Math.sqrt(-o)).nthRoot(3)):(u=-e/2+Math.sqrt(o),u=new tt(yo(u)*Math.pow(Math.abs(u),1/3)),f=-e/2-Math.sqrt(o),f=new tt(yo(f)*Math.pow(Math.abs(f),1/3))),l=u.add(f),y=u.add(f).multiplyConstant(-1/2),p=u.add(f.negate()).multiplyConstant(Math.sqrt(3)/2),a=y.add(w.multiply(p)),v=y.add(w.negate().multiply(p)),h=[],l.isReal()&&h.push(s(l.real+c,ft)),a.isReal()&&h.push(s(a.real+c,ft)),v.isReal()&&h.push(s(v.real+c,ft)),h}function eu(n,t,i,r,u){for(var e=vo(n,r),o=po(e[0],e[1],e[2],e[3]-t[r]),s,f=0;f<o.length;f++)if(0<=o[f]&&o[f]<=1&&(s=fu(o[f],i,n),Math.abs(s-t[i])<=u))return!0}function vl(n,t,i){for(var f=vo(n,"x"),u=po(f[0],f[1],f[2],f[3]-t.x),e,o,s=0,r=0;r<u.length;r++)e=fu(u[r],"y",n),o=so(e,t.y)||e>t.y,o&&((u[r]===0||u[r]===1)&&i.bottomRight().x>t.x||0<u[r]&&u[r]<1)&&s++;return s}function wo(n,t,i){var e;if(n.x!==t.x){var u=Math.min(n.x,t.x),f=Math.max(n.x,t.x),r=Math.min(n.y,t.y),o=Math.max(n.y,t.y),s=u<=i.x&&i.x<f;e=r===o?i.y<=r&&s:s&&(o-r)*((n.x-t.x)*(n.y-t.y)>0?i.x-u:f-i.x)/(f-u)+r-i.y>=0}return e?1:0}function bo(n){for(var u=n.length,i=oi,r=si,t=0;t<u;t++)r=Math.max(r,n[t]),i=Math.min(i,n[t]);return{min:i,max:r}}function ou(n,t,i){for(var u,e,r,o=0;o<n.length;o++)u=n[o],u.visible()&&(e=t?u.bbox(i):u.rawBBox(),e&&(r=r?f.union(r,e):e));return r}function go(n,t){for(var e,r,i,u=0;u<n.length;u++)e=n[u],e.visible()&&(r=e.clippedBBox(t),r&&(i=i?f.union(i,r):r));return i}function hu(n,t,i){var r=i.transform()||p(),u=r.matrix();u.e+=n.x-t.origin.x;u.f+=n.y-t.origin.y;r.matrix(u);i.transform(r)}function ir(n,t,i,r,u){return i==="start"?t.origin[r]:i==="end"?t.origin[r]+t.size[u]-n:t.origin[r]+(t.size[u]-n)/2}function wl(n,t,i,r,u){return i==="start"?t.origin[r]+t.size[u]-n:i==="end"?t.origin[r]:t.origin[r]+(t.size[u]-n)/2}function ns(n,t,i,r,u){for(var e,o,f=0;f<n.length;f++)e=n[f].clippedBBox(),e&&(o=e.origin.clone(),o[r]=ir(e.size[u],t,i||"start",r,u),hu(o,e,n[f]))}function na(n,t,i){ns(n,t,i,"x","width")}function ta(n,t,i){ns(n,t,i,"y","height")}function sf(n,i,r,u){var f,s,e,h,o;if(n.length>1)for(f=new t,s=n[0].bbox,e=1;e<n.length;e++)h=n[e].element,o=n[e].bbox,f[i]=s.origin[i]+s.size[u],f[r]=o.origin[r],hu(f,o,h),o.origin[i]=f[i],s=o}function ts(n){for(var i,r,u=[],t=0;t<n.length;t++)i=n[t],r=i.clippedBBox(),r&&u.push({element:i,bbox:r});return u}function ia(n){sf(ts(n),"x","y","width")}function ra(n){sf(ts(n),"y","x","height")}function ua(n,t,i){for(var o,l=t.size[i],u=[],r=[],f=0,s,e,h=function(){r.push({element:s,bbox:e})},c=0;c<n.length;c++)s=n[c],e=s.clippedBBox(),e&&(o=e.size[i],f+o>l?r.length?(u.push(r),r=[],h(),f=o):(h(),u.push(r),r=[],f=0):(h(),f+=o));return r.length&&u.push(r),u}function is(n,t,i,r,u){for(var f,e,s,l=ua(n,t,u),h=t.origin.clone(),c=[],o=0;o<l.length;o++)for(f=l[o],e=f[0],h[r]=e.bbox.origin[r],hu(h,e.bbox,e.element),e.bbox.origin[i]=h[i],sf(f,i,r,u),c.push([]),s=0;s<f.length;s++)c[o].push(f[s].element);return c}function fa(n,t){return is(n,t,"x","y","width")}function ea(n,t){return is(n,t,"y","x","height")}function oa(n,t){var e=n.clippedBBox(),i,r,u,f;e&&(i=e.size,r=t.size,(r.width<i.width||r.height<i.height)&&(u=Math.min(r.width/i.width,r.height/i.height),f=n.transform()||p(),f.scale(u,u),n.transform(f)))}function sa(n){return function(t){return r(t)?(this.options.set(n,t),this):this.options.get(n)}}function ha(n,t){for(var i=0;i<t.length;i++)n[t[i]]=sa(t[i])}function ca(n){return.5-Math.cos(n*Math.PI)/2}function la(n){return n}function aa(n,t,i,r){var e=1.70158,u=0,f=r;return n===0?i:n===1?i+r:(u||(u=.5),f<Math.abs(r)?(f=r,e=u/4):e=u/(2*Math.PI)*Math.asin(r/f),f*Math.pow(2,-10*n)*Math.sin((Number(n)-e)*1.1*Math.PI/u)+r+i)}function fs(n,t,i){for(var u=t?0:1,r=0;r<n.length;r+=2)n.splice(r+u,0,i)}function es(n,t){if(n&&t)return t.scaleCopy(2).translate(-n.x,-n.y)}function os(n,t,i){var r=t.clone().scale(2/3);return{controlOut:r.clone().translateWith(n.scaleCopy(lf)),controlIn:r.translateWith(i.scaleCopy(lf))}}function ba(n){var t=[];return n.replace(pa,function(n,i){t.push(parseFloat(i))}),t}function ii(n,t){return r(t)&&t!==null?" "+n+"='"+t+"' ":""}function ri(n){for(var i="",t=0;t<n.length;t++)i+=ii(n[t][0],n[t][1]);return i}function cs(n){for(var u,i="",t=0;t<n.length;t++)u=n[t][1],r(u)&&(i+=n[t][0]+":"+u+";");if(i!=="")return i}function ps(n,t){return n==="clip"||n==="fill"&&(!t||t.nodeType==="Gradient")}function ga(){var r=document.getElementsByTagName("base")[0],n=document.location.href,t=n.indexOf("#"),i="";return r&&!br.msie&&(t!==-1&&(n=n.substring(0,t)),i=n),i}function nv(n,t){var i=t?"":ga();return"url("+i+"#"+n+")"}function iv(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 df(n){if(!n||typeof n!="string"||!vu.test(n))return n;var t=df._element;return vu.lastIndex=0,n.replace(vu,function(n){return t.innerHTML=n,t.textContent||t.innerText})}function fh(n){var i=new af({skipBaseHref:!0}),u=n.clippedBBox(),f=n,r,t,e;return u&&(r=u.getOrigin(),t=new a,t.transform(p().translate(-r.x,-r.y)),t.children.push(n),f=t),i.load([f]),e="<?xml version='1.0' ?><svg xmlns='"+or+"' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1'>"+i.render()+"<\/svg>",i.destroy(),e}function yu(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()}}function fv(n,t){return n._zIndex<t._zIndex?1:n._zIndex>t._zIndex?-1:0}function ev(n,t){for(var r,u,i=0;i<t.length;i++)r=t[i],u=kendo.parseColor(r.color()),u.a*=r.opacity(),n.addColorStop(r.offset(),u.toCssRgba())}function ov(t,i){var e={width:"800px",height:"600px",cors:"Anonymous"},u=t,o=t.clippedBBox(),s,h,r,v,y;o&&(s=o.getOrigin(),u=new a,u.transform(p().translate(-s.x,-s.y)),u.children.push(t),h=o.getSize(),e.width=h.width+"px",e.height=h.height+"px");var c=n.extend(e,i),f=document.createElement("div"),l=f.style;return l.display="none",l.width=c.width,l.height=c.height,document.body.appendChild(f),r=new sr(f,c),r.suspendTracking(),r.draw(u),v=r.image(),y=function(){r.destroy();document.body.removeChild(f)},v.then(y,y),v}function sv(n,t){var i=fh(n);return t&&t.raw||(i="data:image/svg+xml;base64,"+no(i)),ei().resolve(i)}function vt(n){return Array.prototype.slice.call(n)}function hv(n,t){n.classList?n.classList.add(t):n.className+=" "+t}function cv(n,t){n.classList?n.classList.remove(t):n.className=n.className.split(/\s+/).reduce(function(n,i){return i!=t&&n.push(i),n},[]).join(" ")}function lr(n,t){Object.keys(t).forEach(function(i){n.style[i]=t[i]})}function vr(n,t){if(n.closest)return n.closest(t);while(n&&!/^\[object (?:HTML)?Document\]$/.test(String(n))){if(ar(n,t))return n;n=n.parentNode}}function lv(n){return typeof n=="number"?{x:n,y:n}:Array.isArray(n)?{x:n[0],y:n[1]}:{x:n.x,y:n.y}}function se(n,t){function e(n){var i=new a,f=n.getBoundingClientRect();return ku(i,[r.x,0,0,r.y,-f.left*r.x,-f.top*r.y]),u._clipbox=!1,u._matrix=o.unit(),u._stackingContext={element:n,group:i},u._avoidLinks=t.avoidLinks===!0?"a":t.avoidLinks,hv(n,"k-pdf-export"),wr(n,i),cv(n,"k-pdf-export"),i}function s(n){if(n!=null)return(typeof n=="string"&&(n=kendo.template(n.replace(/^\s+|\s+$/g,""))),typeof n=="function")?function(t){var i=n(t),r;return i&&typeof i=="string"&&(r=document.createElement("div"),r.innerHTML=i,i=r.firstElementChild),i}:function(){return n.cloneNode(!0)}}function h(n,t,r,u,f,e,o){function nt(){(r!="-"||f)&&p(h);var t=b();h.parentNode.insertBefore(t,h);t.appendChild(h);g&&l.forEach(function(n,t){var i=g({element:n,pageNum:t+1,totalPages:l.length});i&&n.appendChild(i)});dh(l,function(){bv(l,function(){n({pages:l,container:a})})})}function it(n){if(o.keepTogether&&ar(n,o.keepTogether)&&n.offsetHeight<=f-v)return!0;var t=n.tagName;return/^h[1-6]$/i.test(t)&&n.offsetHeight>=f-v?!1:n.getAttribute("data-kendo-chart")||/^(?:img|tr|thead|th|tfoot|iframe|svg|object|canvas|input|textarea|select|video|h[1-6])/i.test(n.tagName)}function p(n){var u,t,e;n.tagName=="TABLE"&&lr(n,{tableLayout:"fixed"});var o=w(n),s=parseFloat(i(o,"padding-bottom")),h=parseFloat(i(o,"border-bottom-width")),l=v;for(v+=s+h,u=!0,t=n.firstChild;t;t=t.nextSibling)if(t.nodeType==1){if(u=!1,ar(t,r)){c(t);continue}if(!f){p(t);continue}if(!/^(?:static|relative)$/.test(i(w(t),"position")))continue;e=k(t);e==1?c(t):e?it(t)?c(t):p(t):p(t)}else t.nodeType==3&&f&&(tt(t,u),u=!1);v=l}function rt(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 c(n){var t,u,f,i,e,s,r;if(n.nodeType==1&&n!==h&&rt(n))return c(n.parentNode);t=vr(n,"table");u=t&&t.querySelector("colgroup");o.repeatHeaders&&(f=t&&t.querySelector("thead"),i=vr(n,".k-grid.k-widget"),i&&i.querySelector(".k-auto-scrollable")&&(e=i.querySelector(".k-grid-header")));s=b();r=y.createRange();r.setStartBefore(h);r.setEndBefore(n);s.appendChild(r.extractContents());h.parentNode.insertBefore(s,h);d(n.parentNode);t&&(t=vr(n,"table"),o.repeatHeaders&&f&&t.insertBefore(f.cloneNode(!0),t.firstChild),u&&t.insertBefore(u.cloneNode(!0),t.firstChild));o.repeatHeaders&&e&&(i=vr(n,".k-grid.k-widget"),i.insertBefore(e.cloneNode(!0),i.firstChild))}function b(){var n=y.createElement("KENDO-PDF-PAGE");return lr(n,{display:"block",boxSizing:"content-box",width:u?u+"px":"auto",padding:e.top+"px "+e.right+"px "+e.bottom+"px "+e.left+"px",position:"relative",height:f?f+"px":"auto",overflow:f||u?"hidden":"visible",clear:"both"}),o&&o.pageClassName&&(n.className=o.pageClassName),l.push(n),n}function k(n){var t=n.getBoundingClientRect(),r,i;return t.width===0||t.height===0?0:(r=h.getBoundingClientRect().top,i=f-v,t.height>i?3:t.top-r>i?1:t.bottom-r>i?2:0)}function tt(n,t){var u,i,f,r,e;/\S/.test(n.data)&&(u=n.data.length,i=y.createRange(),i.selectNodeContents(n),f=k(i),f)&&(r=n,f==1?t?c(n.parentNode):c(n):(function o(t,r,u){return(i.setEnd(n,r),t==r||r==u)?r:k(i)?o(t,t+r>>1,r):o(r,r+u>>1,u)}(0,u>>1,u),!/\S/.test(i.toString())&&t?c(n.parentNode):(r=n.splitText(i.endOffset),e=b(),i.setStartBefore(h),e.appendChild(i.extractContents()),h.parentNode.insertBefore(e,h),d(r.parentNode))),tt(r))}function d(n){var t=vr(n,"li");t&&(t.setAttribute("kendo-no-bullet","1"),d(t.parentNode))}var g=s(o.template),y=t.ownerDocument,l=[],h=o._destructive?t:ah(t),a=y.createElement("KENDO-PDF-DOCUMENT"),v=0;vt(h.querySelectorAll("tfoot")).forEach(function(n){n.parentNode.appendChild(n)});vt(h.querySelectorAll("ol")).forEach(function(n){vt(n.children).forEach(function(n,t){n.setAttribute("kendo-split-index",t)})});lr(a,{display:"block",position:"absolute",boxSizing:"content-box",left:"-10000px",top:"-10000px"});u&&(lr(a,{width:u+"px",paddingLeft:e.left+"px",paddingRight:e.right+"px"}),lr(h,{overflow:"hidden"}));t.parentNode.insertBefore(a,t);a.appendChild(h);o.beforePageBreak?setTimeout(function(){o.beforePageBreak(a,nt)},15):setTimeout(nt,15)}var f,r;if(t||(t={}),f=ei(),!n)return f.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.defineFont(ph(n.ownerDocument)),r=lv(t.scale||1),dh(n,function(){var v=t&&t.forcePageBreak,s=t&&t.paperSize&&t.paperSize!="auto",c=kendo.pdf.getPaperOptions(function(n,i){return n=="paperSize"?s?t[n]:"A4":n in t?t[n]:i}),l=s&&c.paperSize[0],u=s&&c.paperSize[1],i=t.margin&&c.margin,y=Boolean(i),o;v||u?(i||(i={left:0,top:0,right:0,bottom:0}),l&&(l/=r.x),u&&(u/=r.y),i.left/=r.x,i.right/=r.x,i.top/=r.y,i.bottom/=r.y,o=new a({pdf:{multiPage:!0,paperSize:s?c.paperSize:"auto",_ignoreMargin:y}}),h(function(n){if(t.progress){var r=!1,i=0;(function u(){if(i<n.pages.length){var s=e(n.pages[i]);o.append(s);t.progress({page:s,pageNum:++i,totalPages:n.pages.length,cancel:function(){r=!0}});r?n.container.parentNode.removeChild(n.container):setTimeout(u)}else n.container.parentNode.removeChild(n.container),f.resolve(o)})()}else n.pages.forEach(function(n){o.append(e(n))}),n.container.parentNode.removeChild(n.container),f.resolve(o)},n,v,l?l-i.left-i.right:null,u?u-i.top-i.bottom:null,i,t)):f.resolve(e(n))}),f}function ph(n){function u(n){if(n){var t=null;try{t=n.cssRules}catch(i){}t&&e(n,t)}}function f(n){var r=i(n.style,"src"),t;return r?nt(r).reduce(function(n,t){var i=yh(t);return i&&n.push(i),n},[]):(t=yh(n.cssText),t?[t]:[])}function e(n,t){for(var r,e=0;e<t.length;++e){r=t[e];switch(r.type){case 3:u(r.styleSheet);break;case 5:var s=r.style,c=nt(i(s,"font-family")),l=/^([56789]00|bold)$/i.test(i(s,"font-weight")),a="italic"==i(s,"font-style"),h=f(r);h.length>0&&o(n,c,l,a,h[0])}}}function o(n,t,i,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");i&&(n+="|bold");u&&(n+="|italic");r[n]=f})}var r,t;for(n==null&&(n=document),r={},t=0;t<n.styleSheets.length;++t)u(n.styleSheets[t]);return r}function yr(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function vv(n){return n="_counter_"+n,u[n]}function yv(n){var i=[],t=u;for(n="_counter_"+n;t;)yr(t,n)&&i.push(t[n]),t=Object.getPrototypeOf(t);return i.reverse()}function pv(n,t){var i=u;for(n="_counter_"+n;i&&!yr(i,n);)i=Object.getPrototypeOf(i);i||(i=u._root);i[n]=(i[n]||0)+(t==null?1:t)}function wv(n,t){n="_counter_"+n;u[n]=t==null?0:t}function wh(n,t,i){for(var u,f,r=0;r<n.length;)u=n[r++],f=parseFloat(n[r]),isNaN(f)?t(u,i):(t(u,f),++r)}function bh(n){var r=i(n,"counter-reset"),t;r&&wh(nt(r,/^\s+/),wv,0);t=i(n,"counter-increment");t&&wh(nt(t,/^\s+/),pv,1)}function kh(n,t){var i=kendo.parseColor(n,!0);return i&&(i=i.toRGB(),t?i=i.toCssRgba():i.a===0&&(i=null)),i}function bv(n,t){function r(){--i<=0&&t()}var i=0;n.forEach(function(n){for(var t,f=n.querySelectorAll("img"),u=0;u<f.length;++u)t=f[u],t.complete||(i++,t.onload=t.onerror=r)});i||r()}function dh(n,t){function o(n){cr[n]||(cr[n]=!0,u.push(n))}function f(n){/^img$/i.test(n.tagName)&&o(n.src);vh(i(w(n),"background-image")).forEach(function(n){n.type=="url"&&o(n.url)});n.children&&vt(n.children).forEach(f)}function r(){--e<=0&&t()}var u=[],e;Array.isArray(n)?n.forEach(f):f(n);e=u.length;e===0&&r();u.forEach(function(n){var t=cr[n]=new window.Image;/^data:/i.test(n)||(t.crossOrigin="Anonymous");t.src=n;t.complete?r():(t.onload=r,t.onerror=function(){cr[n]=null;r()})})}function he(n){var t="",i;do i=n%26,t=String.fromCharCode(97+i)+t,n=Math.floor(n/26);while(n>0);return t}function gh(n,t,r){var f,e;u=Object.create(u);u[n.tagName.toLowerCase()]={element:n,style:t};f=i(t,"text-decoration");f&&f!="none"&&(e=i(t,"color"),f.split(/\s+/g).forEach(function(n){u[n]||(u[n]=e)}));dv(t)&&(u._stackingContext={element:n,group:r})}function nc(){u=Object.getPrototypeOf(u)}function tc(n){if(u._clipbox!=null){var t=n.bbox(u._matrix);u._clipbox=u._clipbox?f.intersect(u._clipbox,t):t}}function kv(){var n=u._clipbox;return n==null?!0:n?n.width()===0||n.height()===0:void 0}function dv(n){function t(t){return i(n,t)}if(t("transform")!="none"||t("position")!="static"||t("z-index")!="auto"||t("opacity")<1)return!0}function w(n,t){return window.getComputedStyle(n,t||null)}function i(n,t,i){var r=n.getPropertyValue(t);return(r==null||r==="")&&(h.webkit?r=n.getPropertyValue("-webkit-"+t):h.mozilla?r=n.getPropertyValue("-moz-"+t):h.opera?r=n.getPropertyValue("-o-"+t):(h.msie||h.edge)&&(r=n.getPropertyValue("-ms-"+t))),arguments.length>2&&(r==null||r==="")?i:r}function ce(n,t,i,r){n.setProperty(t,i,r);h.webkit?n.setProperty("-webkit-"+t,i,r):h.mozilla?n.setProperty("-moz-"+t,i,r):h.opera?n.setProperty("-o-"+t,i,r):(h.msie||h.edge)&&(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 ct(n,t){return t="border-"+t,{width:parseFloat(i(n,t+"-width")),style:i(n,t+"-style"),color:kh(i(n,t+"-color"),!0)}}function ic(n,t){var i=n.style.cssText,r=t();return n.style.cssText=i,r}function kt(n,t){var r=i(n,"border-"+t+"-radius").split(/\s+/g).map(parseFloat);return r.length==1&&r.push(r[0]),le({x:r[0],y:r[1]})}function gv(n){var t=n.getBoundingClientRect();return t=fi(t,"border-*-width",n),fi(t,"padding-*",n)}function fi(n,t,r){var u,f,e,o,s;return typeof t=="string"?(u=w(r),f=parseFloat(i(u,t.replace("*","top"))),e=parseFloat(i(u,t.replace("*","right"))),o=parseFloat(i(u,t.replace("*","bottom"))),s=parseFloat(i(u,t.replace("*","left")))):typeof t=="number"&&(f=e=o=s=t),{top:n.top+f,right:n.right-e,bottom:n.bottom-o,left:n.left+s,width:n.right-n.left-e-s,height:n.bottom-n.top-o-f}}function ny(n){var u=i(n,"transform"),t,r;return u=="none"?null:(t=/^\s*matrix\(\s*(.*?)\s*\)\s*$/.exec(u),t?(r=i(n,"transform-origin"),t=t[1].split(/\s*,\s*/g).map(parseFloat),r=r.split(/\s+/g).map(parseFloat),{matrix:t,origin:r}):void 0)}function rc(n){return 180*n/Math.PI%360}function ty(n){var t=parseFloat(n);return/grad$/.test(n)?Math.PI*t/200:/rad$/.test(n)?t:/turn$/.test(n)?Math.PI*t*2:/deg$/.test(n)?Math.PI*t/180:void 0}function ku(n,t){return t=new o(t[0],t[1],t[2],t[3],t[4],t[5]),n.transform(t),t}function pr(n,t){n.clip(t)}function ki(n,t,i,r){for(var u=new et([t,i],r).curvePoints(),f=1;f<u.length;)n.curveTo(u[f++],u[f++],u[f++])}function le(n){return(n.x<=0||n.y<=0)&&(n.x=n.y=0),n}function uc(n,t,i,r,u){var e=Math.max(0,t.x),o=Math.max(0,t.y),s=Math.max(0,i.x),h=Math.max(0,i.y),c=Math.max(0,r.x),l=Math.max(0,r.y),a=Math.max(0,u.x),v=Math.max(0,u.y),f=Math.min(n.width/(e+s),n.height/(h+l),n.width/(c+a),n.height/(v+o));return f<1&&(e*=f,o*=f,s*=f,h*=f,c*=f,l*=f,a*=f,v*=f),{tl:{x:e,y:o},tr:{x:s,y:h},br:{x:c,y:l},bl:{x:a,y:v}}}function ae(n,t,r){var u=w(n),f=kt(u,"top-left"),e=kt(u,"top-right"),o=kt(u,"bottom-left"),s=kt(u,"bottom-right");if(r=="padding"||r=="content"){var h=ct(u,"top"),c=ct(u,"right"),l=ct(u,"bottom"),a=ct(u,"left");if(f.x-=a.width,f.y-=h.width,e.x-=c.width,e.y-=h.width,s.x-=c.width,s.y-=l.width,o.x-=a.width,o.y-=l.width,r=="content"){var v=parseFloat(i(u,"padding-top")),y=parseFloat(i(u,"padding-right")),p=parseFloat(i(u,"padding-bottom")),b=parseFloat(i(u,"padding-left"));f.x-=b;f.y-=v;e.x-=y;e.y-=v;s.x-=y;s.y-=p;o.x-=b;o.y-=p}}return typeof r=="number"&&(f.x-=r,f.y-=r,e.x-=r,e.y-=r,s.x-=r,s.y-=r,o.x-=r,o.y-=r),fc(t,f,e,s,o)}function fc(n,t,i,r,u){var l=uc(n,t,i,r,u),o=l.tl,s=l.tr,h=l.br,c=l.bl,f=new e({fill:null,stroke:null});return f.moveTo(n.left,n.top+o.y),o.x&&ki(f,n.left+o.x,n.top+o.y,{startAngle:-180,endAngle:-90,radiusX:o.x,radiusY:o.y}),f.lineTo(n.right-s.x,n.top),s.x&&ki(f,n.right-s.x,n.top+s.y,{startAngle:-90,endAngle:0,radiusX:s.x,radiusY:s.y}),f.lineTo(n.right,n.bottom-h.y),h.x&&ki(f,n.right-h.x,n.bottom-h.y,{startAngle:0,endAngle:90,radiusX:h.x,radiusY:h.y}),f.lineTo(n.left+c.x,n.bottom),c.x&&ki(f,n.left+c.x,n.bottom-c.y,{startAngle:90,endAngle:180,radiusX:c.x,radiusY:c.y}),f.close()}function ec(n,t){var i=String(parseFloat(n));switch(t){case"decimal-leading-zero":return i.length<2&&(i="0"+i),i;case"lower-roman":return kr(n).toLowerCase();case"upper-roman":return kr(n).toUpperCase();case"lower-latin":case"lower-alpha":return he(n-1);case"upper-latin":case"upper-alpha":return he(n-1).toUpperCase();default:return i}}function iy(n,t){function u(n,t,i){return i?(i=i.replace(/^\s*(["'])(.*)\1\s*$/,"$2"),yv(n).map(function(n){return ec(n,t)}).join(i)):ec(vv(n)||0,t)}var f=nt(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=nt(i[1]),r.push(u(f[0],f[1]))):(i=/^\s*counters\((.*?)\)\s*$/.exec(t))?(f=nt(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 ve(n){var r,t;if(n.cssText)return n.cssText;for(r=[],t=0;t<n.length;++t)r.push(n[t]+": "+i(n,n[t]));return r.join(";\n")}function oc(n,t){function r(t,r){var u=w(n,t),f;bh(u);u.content&&u.content!="normal"&&u.content!="none"&&u.width!="0px"&&(f=n.ownerDocument.createElement(hr),f.style.cssText=ve(u),f.textContent=iy(n,u.content),n.insertBefore(f,r),i.push(f))}var i,u;if(n.tagName==hr){ye(n,t);return}i=[];r(":before",n.firstChild);r(":after",null);u=n.className;n.className+=" kendo-pdf-hide-pseudo-elements";ye(n,t);n.className=u;i.forEach(function(t){n.removeChild(t)})}function ye(n,t){function yt(t){var r,f,e;if(/^td$/i.test(n.tagName)&&(r=u.table,r&&i(r.style,"border-collapse")=="collapse")){if(f=ct(r.style,"left").width,e=ct(r.style,"top").width,f===0&&e===0)return t;var o=r.element.getBoundingClientRect(),h=r.element.rows[0].cells[0],s=h.getBoundingClientRect();if(s.top==o.top||s.left==o.left)return vt(t).map(function(n){return{left:n.left+f,top:n.top+e,right:n.right+f,bottom:n.bottom+e,height:n.height,width:n.width}})}return t}function d(n,i,r,u,f,o,s,h){function v(t,i,u){var s=Math.PI/2*t/(t+r),f={x:i.x-t,y:i.y-r},o=new e({fill:{color:n},stroke:null}).moveTo(0,0);ku(o,u);ki(o,0,i.y,{startAngle:-90,endAngle:-rc(s),radiusX:i.x,radiusY:i.y});f.x>0&&f.y>0?(o.lineTo(f.x*Math.cos(s),i.y-f.y*Math.sin(s)),ki(o,0,i.y,{startAngle:-rc(s),endAngle:-90,radiusX:f.x,radiusY:f.y,anticlockwise:!0})):f.x>0?o.lineTo(f.x,r).lineTo(0,r):o.lineTo(f.x,r).lineTo(f.x,0);c.append(o.close())}if(!(r<=0)){var l,c=new a;ku(c,h);t.append(c);le(o);le(s);l=new e({fill:{color:n},stroke:null});c.append(l);l.moveTo(o.x?Math.max(o.x,u):0,0).lineTo(i-(s.x?Math.max(s.x,f):0),0).lineTo(i-Math.max(s.x,f),r).lineTo(Math.max(o.x,u),r).close();o.x&&v(u,o,[-1,0,0,1,o.x,0]);s.x&&v(f,s,[1,0,0,1,i-s.x,0])}}function pt(n){var r=new a,u,i;for(pr(r,fc(n,g,tt,rt,it)),t.append(r),k&&(u=new e({fill:{color:k.toCssRgba()},stroke:null}),u.moveTo(n.left,n.top).lineTo(n.right,n.top).lineTo(n.right,n.bottom).lineTo(n.left,n.bottom).close(),r.append(u)),i=st.length;--i>=0;)wt(r,n,st[i],ht[i%ht.length],ut[i%ut.length],lt[i%lt.length],at[i%at.length])}function wt(t,i,r,u,e,o,s){function c(t,i,r,h,c){function w(){while(v.origin.x>i.left)v.origin.x-=r}function b(){while(v.origin.y>i.top)v.origin.y-=h}function k(){while(v.origin.x<i.right)c(t,v.clone()),v.origin.x+=r}var g=r/h,p,a=i,y,l,v,d;o=="content-box"?(a=fi(a,"border-*-width",n),a=fi(a,"padding-*",n)):o=="padding-box"&&(a=fi(a,"border-*-width",n));/^\s*auto(\s+auto)?\s*$/.test(s)||(s=="contain"?(p=Math.min(a.width/r,a.height/h),r*=p,h*=p):s=="cover"?(p=Math.max(a.width/r,a.height/h),r*=p,h*=p):(y=s.split(/\s+/g),r=/%$/.test(y[0])?a.width*parseFloat(y[0])/100:parseFloat(y[0]),h=y.length==1||y[1]=="auto"?r/g:/%$/.test(y[1])?a.height*parseFloat(y[1])/100:parseFloat(y[1])));l=String(e);switch(l){case"bottom":l="50% 100%";break;case"top":l="50% 0";break;case"left":l="0 50%";break;case"right":l="100% 50%";break;case"center":l="50% 50%"}if(l=l.split(/\s+/),l.length==1&&(l[1]="50%"),l[0]=/%$/.test(l[0])?parseFloat(l[0])/100*(a.width-r):parseFloat(l[0]),l[1]=/%$/.test(l[1])?parseFloat(l[1])/100*(a.height-h):parseFloat(l[1]),v=new f([a.left+l[0],a.top+l[1]],[r,h]),u=="no-repeat")c(t,v);else if(u=="repeat-x")w(),k();else if(u=="repeat-y")for(b();v.origin.y<i.bottom;)c(t,v.clone()),v.origin.y+=h;else if(u=="repeat")for(w(),b(),d=v.origin.clone();v.origin.y<i.bottom;)v.origin.x=d.x,k(),v.origin.y+=h}if(r&&r!="none")if(r.type=="url"){if(/^url\(\"data:image\/svg/i.test(r.url))return;var h=cr[r.url];h&&h.width>0&&h.height>0&&c(t,i,h.width,h.height,function(n,t){n.append(new pi(r.url,t))})}else if(r.type=="linear")c(t,i,i.width,i.height,ry(r));else return}function bt(){function f(i){ic(n,function(){n.style.position="relative";var r=n.ownerDocument.createElement(hr);r.style.position="absolute";r.style.boxSizing="border-box";o=="outside"?(r.style.width="6em",r.style.left="-6.8em",r.style.textAlign="right"):r.style.left="0px";i(r);n.insertBefore(r,n.firstChild);wr(r,t);n.removeChild(r)})}function e(t){var r=n.parentNode.children,u=n.getAttribute("kendo-split-index"),i;if(u!=null)return t(u|0,r.length);for(i=0;i<r.length;++i)if(r[i]===n)return t(i,r.length)}var u=i(r,"list-style-type"),o;if(u!="none"){o=i(r,"list-style-position");switch(u){case"circle":case"disc":case"square":f(function(n){n.style.fontSize="60%";n.style.lineHeight="200%";n.style.paddingRight="0.5em";n.style.fontFamily="DejaVu Serif";n.innerHTML={disc:"●",circle:"◯",square:"■"}[u]});break;case"decimal":case"decimal-leading-zero":f(function(n){e(function(t){++t;u=="decimal-leading-zero"&&t<10&&(t="0"+t);n.innerHTML=t+"."})});break;case"lower-roman":case"upper-roman":f(function(n){e(function(t){t=kr(t+1);u=="upper-roman"&&(t=t.toUpperCase());n.innerHTML=t+"."})});break;case"lower-latin":case"lower-alpha":case"upper-latin":case"upper-alpha":f(function(n){e(function(t){t=he(t);/^upper/i.test(u)&&(t=t.toUpperCase());n.innerHTML=t+"."})})}}}function dt(i,r,u){function h(n){return{x:n.y,y:n.x}}var a,v,y;if(i.width!==0&&i.height!==0&&(pt(i),a=l.width>0&&(r&&b=="ltr"||u&&b=="rtl"),v=s.width>0&&(u&&b=="ltr"||r&&b=="rtl"),o.width!==0||l.width!==0||s.width!==0||c.width!==0)){if(o.color==s.color&&o.color==c.color&&o.color==l.color&&o.width==s.width&&o.width==c.width&&o.width==l.width&&a&&v){i=fi(i,o.width/2);y=ae(n,i,o.width/2);y.options.stroke={color:o.color,width:o.width};t.append(y);return}if(g.x===0&&tt.x===0&&rt.x===0&&it.x===0&&o.width<2&&l.width<2&&s.width<2&&c.width<2){o.width>0&&t.append(new e({stroke:{width:o.width,color:o.color}}).moveTo(i.left,i.top+o.width/2).lineTo(i.right,i.top+o.width/2));c.width>0&&t.append(new e({stroke:{width:c.width,color:c.color}}).moveTo(i.left,i.bottom-c.width/2).lineTo(i.right,i.bottom-c.width/2));a&&t.append(new e({stroke:{width:l.width,color:l.color}}).moveTo(i.left+l.width/2,i.top).lineTo(i.left+l.width/2,i.bottom));v&&t.append(new e({stroke:{width:s.width,color:s.color}}).moveTo(i.right-s.width/2,i.top).lineTo(i.right-s.width/2,i.bottom));return}var f=uc(i,g,tt,rt,it),p=f.tl,w=f.tr,k=f.br,nt=f.bl;d(o.color,i.width,o.width,l.width,s.width,p,w,[1,0,0,1,i.left,i.top]);d(c.color,i.width,c.width,s.width,l.width,k,nt,[-1,0,0,-1,i.right,i.bottom]);d(l.color,i.height,l.width,c.width,o.width,h(nt),h(p),[0,-1,1,0,i.left,i.bottom]);d(s.color,i.height,s.width,o.width,c.width,h(w),h(k),[0,1,-1,0,i.right,i.top])}}var r=w(n),o=ct(r,"top"),s=ct(r,"right"),c=ct(r,"bottom"),l=ct(r,"left"),g=kt(r,"top-left"),tt=kt(r,"top-right"),it=kt(r,"bottom-left"),rt=kt(r,"bottom-right"),b=i(r,"direction"),k=i(r,"background-color"),y,v,p,ft,et,ot;k=kh(k);var st=vh(i(r,"background-image")),ht=nt(i(r,"background-repeat")),ut=nt(i(r,"background-position")),lt=nt(i(r,"background-origin")),at=nt(i(r,"background-size"));if(h.msie&&h.version<10&&(ut=nt(n.currentStyle.backgroundPosition)),y=fi(n.getBoundingClientRect(),"border-*-width",n),function(){var v=i(r,"clip"),f=/^\s*rect\((.*)\)\s*$/.exec(v);if(f){var n=f[1].split(/[ ,]+/g),o=n[0]=="auto"?y.top:parseFloat(n[0])+y.top,s=n[1]=="auto"?y.right:parseFloat(n[1])+y.left,h=n[2]=="auto"?y.bottom:parseFloat(n[2])+y.top,c=n[3]=="auto"?y.left:parseFloat(n[3])+y.left,u=new a,l=(new e).moveTo(c,o).lineTo(s,o).lineTo(s,h).lineTo(c,h).close();pr(u,l);t.append(u);t=u;tc(l)}}(),et=i(r,"display"),et=="table-row")for(v=[],p=0,ft=n.children;p<ft.length;++p)v.push(ft[p].getBoundingClientRect());else v=n.getClientRects(),v.length==1&&(v=[n.getBoundingClientRect()]);for(v=yt(v),p=0;p<v.length;++p)dt(v[p],p===0,p==v.length-1);return n.tagName=="A"&&n.href&&!/^#?$/.test(n.getAttribute("href"))&&(u._avoidLinks&&ar(n,u._avoidLinks)||(ot=document.createRange(),ot.selectNodeContents(n),vt(ot.getClientRects()).forEach(function(i){var r=new a;r._pdfLink={url:n.href,top:i.top,right:i.right,bottom:i.bottom,left:i.left};t.append(r)}))),v.length>0&&et=="list-item"&&!n.getAttribute("kendo-no-bullet")&&bt(v[0]),function(){function u(){var r=ae(n,y,"padding"),i=new a;pr(i,r);t.append(i);t=i;tc(r)}fy(n)?u():/^(hidden|auto|scroll)/.test(i(r,"overflow"))?u():/^(hidden|auto|scroll)/.test(i(r,"overflow-x"))?u():/^(hidden|auto|scroll)/.test(i(r,"overflow-y"))&&u()}(),uy(n,t)||hc(n,t),t}function ry(n){return function(t,i){var u=i.width(),f=i.height(),r;switch(n.type){case"linear":r=n.angle!=null?n.angle:Math.PI;switch(n.to){case"top":r=0;break;case"left":r=-Math.PI/2;break;case"bottom":r=Math.PI;break;case"right":r=Math.PI/2;break;case"top left":case"left top":r=-Math.atan2(f,u);break;case"top right":case"right top":r=Math.atan2(f,u);break;case"bottom left":case"left bottom":r=Math.PI+Math.atan2(f,u);break;case"bottom right":case"right bottom":r=Math.PI-Math.atan2(f,u)}n.reverse&&(r-=Math.PI);r%=2*Math.PI;r<0&&(r+=2*Math.PI);var p=Math.abs(u*Math.sin(r))+Math.abs(f*Math.cos(r)),l=Math.atan(u*Math.tan(r)/f),a=Math.sin(l),v=Math.cos(l),y=Math.abs(a)+Math.abs(v),o=y/2*a,s=y/2*v;r>Math.PI/2&&r<=3*Math.PI/2&&(o=-o,s=-s);var h=[],c=0,w=n.stops.map(function(t,i){var r=t.percent,u;return r?r=parseFloat(r)/100:t.length?r=parseFloat(t.length)/p:i===0?r=0:i==n.stops.length-1&&(r=1),u={color:t.color.toCssRgba(),offset:r},r!=null?(c=r,h.forEach(function(n,t){var i=n.stop;i.offset=n.left+(c-n.left)*(t+1)/(h.length+1)}),h=[]):h.push({left:c,stop:u}),u}),b=[.5-o,.5+s],k=[.5+o,.5-s];t.append(e.fromRect(i).stroke(null).fill(new wi({start:b,end:k,stops:w,userSpace:!1})));break;case"radial":window.console&&window.console.log&&window.console.log("Radial gradients are not yet supported in HTML renderer")}}}function uy(n,t){var r,i,u,f;return(n._kendoExportVisual?r=n._kendoExportVisual():window.kendo&&window.kendo.jQuery&&n.getAttribute(window.kendo.attr("role"))&&(i=window.kendo.widgetInstance(window.kendo.jQuery(n)),i&&(i.exportDOMVisual||i.exportVisual)&&(r=i.exportDOMVisual?i.exportDOMVisual():i.exportVisual())),!r)?!1:(u=new a,u.children.push(r),f=n.getBoundingClientRect(),u.transform(p().translate(f.left,f.top)),t.append(u),!0)}function sc(n,t,i){var r=gv(n),e=new f([r.left,r.top],[r.width,r.height]),u=new pi(t,e);pr(u,ae(n,r,"content"));i.append(u)}function pe(n,t){var f=w(n),e=w(t),r=parseFloat(i(f,"z-index")),u=parseFloat(i(e,"z-index")),o=i(f,"position"),s=i(e,"position");return isNaN(r)&&isNaN(u)?/static|absolute/.test(o)&&/static|absolute/.test(s)?0:o=="static"?-1:s=="static"?1:0:isNaN(r)?u===0?0:u>0?-1:1:isNaN(u)?r===0?0:r>0?1:-1:parseFloat(r)-parseFloat(u)}function fy(n){return/^(?:textarea|select|input)$/i.test(n.tagName)}function ey(n){return n.selectedOptions&&n.selectedOptions.length>0?n.selectedOptions[0]:n.options[n.selectedIndex]}function oy(n,t){var o=w(n),u=i(o,"color"),r=n.getBoundingClientRect();n.type=="checkbox"?(t.append(e.fromRect(new f([r.left+1,r.top+1],[r.width-2,r.height-2])).stroke(u,1)),n.checked&&t.append((new e).stroke(u,1.2).moveTo(r.left+.22*r.width,r.top+.55*r.height).lineTo(r.left+.45*r.width,r.top+.75*r.height).lineTo(r.left+.78*r.width,r.top+.22*r.width))):(t.append(new bt(new wt([(r.left+r.right)/2,(r.top+r.bottom)/2],Math.min(r.width-2,r.height-2)/2)).stroke(u,1)),n.checked&&t.append(new bt(new wt([(r.left+r.right)/2,(r.top+r.bottom)/2],Math.min(r.width-8,r.height-8)/2)).fill(u).stroke(null)))}function sy(n,t){var u=n.tagName.toLowerCase(),f;if(u=="input"&&(n.type=="checkbox"||n.type=="radio"))return oy(n,t);var e=n.parentNode,o=n.ownerDocument,i=o.createElement(hr),r;if(i.style.cssText=ve(w(n)),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=o.createElement(hr),r.style.cssText=ve(w(n.options[f])),r.style.display="block",r.textContent=n.options[f].textContent,i.appendChild(r);else r=ey(n),r&&(i.textContent=r.textContent);else i.textContent=n.value;e.insertBefore(i,n);i.scrollLeft=n.scrollLeft;i.scrollTop=n.scrollTop;n.style.display="none";hc(i,t);n.style.display="";e.removeChild(i)}function hc(n,t){var r;u._stackingContext.element===n&&(u._stackingContext.group=t);switch(n.tagName.toLowerCase()){case"img":sc(n,n.src,t);break;case"canvas":try{sc(n,n.toDataURL("image/png"),t)}catch(l){}break;case"textarea":case"input":case"select":sy(n,t);break;default:var f=[],e=[],o=[];for(r=n.firstChild;r;r=r.nextSibling)switch(r.nodeType){case 3:/\S/.test(r.data)&&cc(n,r,t);break;case 1:var s=w(r),h=i(s,"float"),c=i(s,"position");c!="static"?o.push(r):h!="none"?e.push(r):f.push(r)}gr(f,pe).forEach(function(n){wr(n,t)});gr(e,pe).forEach(function(n){wr(n,t)});gr(o,pe).forEach(function(n){wr(n,t)})}}function cc(n,t,r){function p(n){var u,t,r,i;if(h.msie||h.edge||h.chrome){for(u=n.getClientRects(),t={top:Infinity,right:-Infinity,bottom:-Infinity,left:Infinity},r=0;r<u.length;++r)(i=u[r],i.width<=1||i.bottom===nt)||(t.left=Math.min(i.left,t.left),t.top=Math.min(i.top,t.top),t.right=Math.max(i.right,t.right),t.bottom=Math.max(i.bottom,t.bottom));return t.width=t.right-t.left,t.height=t.bottom-t.top,t}return n.getBoundingClientRect()}function lt(){var b=c,i,n=a.substr(c).search(/\S/),f,s,r,u,e,w;if(c+=n,n<0||c>=v)return!0;if(o.setStart(t,c),o.setEnd(t,c+1),i=p(o),f=!1,(et||ot>1)&&(n=a.substr(c).search(/\s/),n>=0&&(o.setEnd(t,c+n),s=p(o),s.bottom==i.bottom&&(i=s,f=!0,c+=n))),!f){if(n=function l(n,r,u){o.setEnd(t,r);var f=p(o);return f.bottom!=i.bottom&&n<r?l(n,n+r>>1,r):f.right!=i.right?(i=f,r<u?l(r,r+u>>1,u):r):r}(c,Math.min(v,c+y),v),n==c)return!0;if(c=n,n=o.toString().search(/\s+$/),n===0)return!1;n>0&&(o.setEnd(t,o.startOffset+n),i=p(o))}if((h.msie||h.edge)&&(i=o.getClientRects()[0]),r=o.toString(),/^(?:pre|pre-wrap)$/i.test(st)){if(/\t/.test(r)){for(u=0,n=b;n<o.startOffset;++n)e=a.charCodeAt(n),e==9?u+=8-u%8:e==10||e==13?u=0:u++;while((n=r.search("\t"))>=0)w="        ".substr(0,8-(u+n)%8),r=r.substr(0,n)+w+r.substr(n+1)}}else r=r.replace(/\s+/g," ");f||(nt=i.bottom);at(r,i)}function at(n,t){var i,u,e;(h.msie||h.edge)&&!isNaN(b)&&(i=av(d),u=(t.top+t.bottom-i)/2,t={top:u,right:t.right,bottom:u+i,left:t.left,height:i,width:t.right-t.left});switch(ht){case"uppercase":n=n.toUpperCase();break;case"lowercase":n=n.toLowerCase();break;case"capitalize":n=n.replace(/(?:^|\s)\S/g,function(n){return n.toUpperCase()})}e=new lh(n,new f([t.left,t.top],[t.width,t.height]),{font:d,fill:{color:ut}});r.append(e)}function yt(n){function t(t,i){if(t){var u=l/12,f=new e({stroke:{width:u,color:t}});i-=u;f.moveTo(n.left,i).lineTo(n.right,i);r.append(f)}}t(tt,n.bottom);t(it,n.bottom-n.height/2.7);t(rt,n.top)}var s,y;if(!kv()&&(s=w(n),!(parseFloat(i(s,"text-indent"))<-500))){var a=t.data,c=0,v=a.search(/\S\s*$/)+1;if(v){var l=i(s,"font-size"),b=i(s,"line-height"),d=[i(s,"font-style"),i(s,"font-variant"),i(s,"font-weight"),l,i(s,"font-family")].join(" ");if(l=parseFloat(l),b=parseFloat(b),l!==0){var ut=i(s,"color"),o=n.ownerDocument.createRange(),ft=i(s,"text-align"),et=ft=="justify",ot=i(s,"column-count",1),st=i(s,"white-space"),ht=i(s,"text-transform"),k,g;(h.msie||h.edge)&&(k=s.textOverflow,k=="ellipsis"&&(g=n.style.textOverflow,n.style.textOverflow="clip"));y=n.getBoundingClientRect().width/l*5;y===0&&(y=500);for(var nt=null,tt=u.underline,it=u["line-through"],rt=u.overline,ct=tt||it||rt;!lt(););(h.msie||h.edge)&&k=="ellipsis"&&(n.style.textOverflow=g);ct&&(o.selectNode(t),vt(o.getClientRects()).forEach(yt));return}}}}function hy(n,t,i){var f,s,r,o,h,c;for(i!="auto"?(f=u._stackingContext.group,i=parseFloat(i)):(f=t,i=0),s=f.children,r=0;r<s.length;++r)if(s[r]._dom_zIndex!=null&&s[r]._dom_zIndex>i)break;return o=new a,f.insert(r,o),o._dom_zIndex=i,f!==t&&u._clipbox&&(h=u._matrix.invert(),c=u._clipbox.transformCopy(h),pr(o,e.fromRect(c))),o}function wr(n,t){var r=w(n),e,f,s;if((bh(r),!/^(style|script|link|meta|iframe|svg|col|colgroup)$/i.test(n.tagName))&&u._clipbox!=null){var o=parseFloat(i(r,"opacity")),h=i(r,"visibility"),c=i(r,"display");o!==0&&h!="hidden"&&c!="none"&&(e=ny(r),s=i(r,"z-index"),(e||o<1)&&s=="auto"&&(s=0),f=hy(n,t,s),o<1&&f.opacity(o*f.opacity()),gh(n,r,f),e?ic(n,function(){ce(n.style,"transform","none","important");ce(n.style,"transition","none","important");i(r,"position")=="static"&&ce(n.style,"position","relative","important");var o=n.getBoundingClientRect(),s=o.left+e.origin[0],h=o.top+e.origin[1],t=[1,0,0,1,-s,-h];t=lc(t,e.matrix);t=lc(t,[1,0,0,1,s,h]);t=ku(f,t);u._matrix=u._matrix.multiplyCopy(t);oc(n,f)}):oc(n,f),nc())}}function lc(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 ke,de,ge,gi,dt,o,t,y,f,hi,l,uf,wt,oo,bt,ft,of,tt,li,e,ko,ai,vi,pi,su,a,rs,ot,lt,wi,ur,fr,cf,lf,er,ti,hs,v,g,au,vf,pf,wf,bf,kf,vu,gf,ne,uh,eh,st,pu,ui,oh,wu,hh,sr,rt,ie,re,ue,fe,ee,oe,ch,h,lh,ar,ah,ac;window.kendo=window.kendo||{};var vc=kendo.drawing,we=vc.util,c=kendo.Class,du=kendo.util,yc=kendo.support,br=yc.browser,ei=we.createPromise,be=we.promiseAll,k={extend:function(n){var i=this;for(var t in this)t!=="extend"&&(n[t]=i[t])},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=t.indexOf(n);return i!==-1&&t.splice(i,1),this},trigger:function(n,t){var r=this._observers,i,u;if(r&&!this._suspended)for(i=0;i<r.length;i++)u=r[i],u[n]&&u[n](t);return this},optionsChange:function(n){n===void 0&&(n={});n.element=this;this.trigger("optionsChange",n)},geometryChange:function(){this.trigger("geometryChange",{element:this})},suspend:function(){return this._suspended=(this._suspended||0)+1,this},resume:function(){return this._suspended=Math.max((this._suspended||0)-1,0),this},_observerField:function(n,t){this[n]&&this[n].removeObserver(this);this[n]=t;t.addObserver(this)}};ke={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"};de="undefined";ge=1;var gu=Math.PI/180,oi=Number.MAX_VALUE,si=-Number.MAX_VALUE;gi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";dt=String.fromCharCode;var bc={append:di,arabicToRoman:kr,createPromise:ei,defined:r,definitionId:dr,deg:yt,encodeBase64:no,eventCoordinates:to,eventElement:io,isTransparent:gt,last:d,limitValue:ro,mergeSort:gr,promiseAll:be,rad:ut,round:s,valueOrDefault:nf,bindEvents:tf,elementOffset:uo,elementSize:nr,elementStyles:nu,unbindEvents:rf,DEG_TO_RAD:gu,MAX_NUM:oi,MIN_NUM:si},kc={}.toString,ni=c.extend({init:function(n,t){var u=this,i,r;t===void 0&&(t="");this.prefix=t;for(i in n)r=n[i],r=u._wrap(r,i),u[i]=r},get:function(n){for(var i=n.split("."),t=this,r;i.length&&t;)r=i.shift(),t=t[r];return t},set:function(n,t){var i=this.get(n);i!==t&&(this._set(n,this._wrap(t,n)),this.optionsChange({field:this.prefix+n,value:t}))},_set:function(n,t){var o=this,s=n.indexOf(".")>=0,u=this,i=n,f,e,r;if(s){for(f=i.split("."),e=this.prefix;f.length>1;)i=f.shift(),e+=i+".",r=u[i],r||(r=new ni({},e),r.addObserver(o),u[i]=r),u=r;i=f[0]}u._clear(i);u[i]=t},_clear:function(n){var t=this[n];t&&t.removeObserver&&t.removeObserver(this)},_wrap:function(n,t){var u=kc.call(n),i=n;return i!==null&&r(i)&&u==="[object Object]"&&(n instanceof ni||n instanceof c||(i=new ni(i,this.prefix+t+".")),i.addObserver(this)),i}});k.extend(ni.prototype);o=c.extend({init:function(n,t,i,r,u,f){n===void 0&&(n=0);t===void 0&&(t=0);i===void 0&&(i=0);r===void 0&&(r=0);u===void 0&&(u=0);f===void 0&&(f=0);this.a=n;this.b=t;this.c=i;this.d=r;this.e=u;this.f=f},multiplyCopy:function(n){return new o(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,i=t.a,r=t.b,u=t.c,f=t.d,e=t.e,s=t.f,n=i*f-r*u;return n===0?null:new o(f/n,-r/n,-u/n,i/n,(u*s-f*e)/n,(r*e-i*s)/n)},clone:function(){return new o(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=s(this.a,n),this.b=s(this.b,n),this.c=s(this.c,n),this.d=s(this.d,n),this.e=s(this.e,n),this.f=s(this.f,n),this},toArray:function(n){var i=[this.a,this.b,this.c,this.d,this.e,this.f],t;if(r(n))for(t=0;t<i.length;t++)i[t]=s(i[t],n);return i},toString:function(n,t){return t===void 0&&(t=","),this.toArray(n).join(t)}});o.translate=function(n,t){return new o(1,0,0,1,n,t)};o.unit=function(){return new o(1,0,0,1,0,0)};o.rotate=function(n,t,i){var r=new o;return r.a=Math.cos(ut(n)),r.b=Math.sin(ut(n)),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};o.scale=function(n,t){return new o(n,0,0,t,0,0)};o.IDENTITY=o.unit();t=c.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,i){var r=t.create(i)||t.ZERO;return this.transform(o.rotate(n,r.x,r.y))},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 t===void 0&&(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=pt(n),i=this,r=i.x,u=i.y;return this.x=t.a*r+t.c*u+t.e,this.y=t.b*r+t.d*u+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,i=this.y-n.y;return Math.sqrt(t*t+i*i)},round:function(n){return this.x=s(this.x,n),this.y=s(this.y,n),this.geometryChange(),this},toArray:function(n){var t=r(n),i=t?s(this.x,n):this.x,u=t?s(this.y,n):this.y;return[i,u]},toString:function(n,t){t===void 0&&(t=" ");var f=this,i=f.x,u=f.y;return r(n)&&(i=s(i,n),u=s(u,n)),i+t+u}});t.create=function(n,i){if(r(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 u,f=arguments,n=oi,i=oi,r=0;r<arguments.length;r++)u=f[r],n=Math.min(u.x,n),i=Math.min(u.y,i);return new t(n,i)};t.max=function(){for(var u,f=arguments,n=si,i=si,r=0;r<arguments.length;r++)u=f[r],n=Math.max(u.x,n),i=Math.max(u.y,i);return new t(n,i)};t.minPoint=function(){return new t(si,si)};t.maxPoint=function(){return new t(oi,oi)};Object.defineProperties&&Object.defineProperties(t,{ZERO:{get:function(){return new t(0,0)}}});tu(t.prototype,["x","y"]);k.extend(t.prototype);y=c.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 y(this.width,this.height)},toArray:function(n){var t=r(n),i=t?s(this.width,n):this.width,u=t?s(this.height,n):this.height;return[i,u]}});y.create=function(n,t){if(r(n))return n instanceof y?n:arguments.length===1&&n.length===2?new y(n[0],n[1]):new y(n,t)};Object.defineProperties&&Object.defineProperties(y,{ZERO:{get:function(){return new y(0,0)}}});tu(y.prototype,["width","height"]);k.extend(y.prototype);f=c.extend({init:function(n,i){n===void 0&&(n=new t);i===void 0&&(i=new y);this.setOrigin(n);this.setSize(i)},clone:function(){return new f(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",y.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 f.fromPoints(t,i,r,u)},transformCopy:function(n){return f.fromPoints(this.topLeft().transform(n),this.bottomRight().transform(n))},expand:function(n,t){return t===void 0&&(t=n),this.size.width+=2*n,this.size.height+=2*t,this.origin.translate(-n,-t),this},expandCopy:function(n,t){return this.clone().expand(n,t)},containsPoint:function(n){var t=this.origin,i=this.bottomRight();return!(n.x<t.x||n.y<t.y||i.x<n.x||i.y<n.y)},_isOnPath:function(n,t){var i=this.expandCopy(t,t),r=this.expandCopy(-t,-t);return i.containsPoint(n)&&!r.containsPoint(n)}});f.fromPoints=function(){var n=t.min.apply(null,arguments),i=t.max.apply(null,arguments),r=new y(i.x-n.x,i.y-n.y);return new f(n,r)};f.union=function(n,i){return f.fromPoints(t.min(n.topLeft(),i.topLeft()),t.max(n.bottomRight(),i.bottomRight()))};f.intersect=function(n,i){var r={left:n.topLeft().x,top:n.topLeft().y,right:n.bottomRight().x,bottom:n.bottomRight().y},u={left:i.topLeft().x,top:i.topLeft().y,right:i.bottomRight().x,bottom:i.bottomRight().y};if(r.left<=u.right&&u.left<=r.right&&r.top<=u.bottom&&u.top<=r.bottom)return f.fromPoints(new t(Math.max(r.left,u.left),Math.max(r.top,u.top)),new t(Math.min(r.right,u.right),Math.min(r.bottom,u.bottom)))};k.extend(f.prototype);hi=c.extend({init:function(n){n===void 0&&(n=o.unit());this._matrix=n},clone:function(){return new hi(this._matrix.clone())},equals:function(n){return n&&n._matrix.equals(this._matrix)},translate:function(n,t){return this._matrix=this._matrix.multiplyCopy(o.translate(n,t)),this._optionsChange(),this},scale:function(n,i,r){i===void 0&&(i=n);r===void 0&&(r=null);var u=r;return u&&(u=t.create(u),this._matrix=this._matrix.multiplyCopy(o.translate(u.x,u.y))),this._matrix=this._matrix.multiplyCopy(o.scale(n,i)),u&&(this._matrix=this._matrix.multiplyCopy(o.translate(-u.x,-u.y))),this._optionsChange(),this},rotate:function(n,i){var r=t.create(i)||t.ZERO;return this._matrix=this._matrix.multiplyCopy(o.rotate(n,r.x,r.y)),this._optionsChange(),this},multiply:function(n){var t=pt(n);return this._matrix=this._matrix.multiplyCopy(t),this._optionsChange(),this},matrix:function(n){return n?(this._matrix=n,this._optionsChange(),this):this._matrix},_optionsChange:function(){this.optionsChange({field:"transform",value:this})}});k.extend(hi.prototype);l=c.extend({init:function(n){this._initOptions(n)},_initOptions:function(n){n===void 0&&(n={});var t=n.clip,i=n.transform;i&&(n.transform=p(i));t&&!t.id&&(t.id=dr());this.options=new ni(n);this.options.addObserver(this)},transform:function(n){if(r(n))this.options.set("transform",p(n));else return this.options.get("transform")},parentTransform:function(){for(var n=this,t,i;n.parent;)n=n.parent,i=n.transform(),i&&(t=i.matrix().multiplyCopy(t||o.unit()));if(t)return p(t)},currentTransform:function(n){n===void 0&&(n=this.parentTransform());var u=this.transform(),t=pt(u),i=pt(n),r;return r=t&&i?i.multiplyCopy(t):t||i,r?p(r):void 0},visible:function(n){return r(n)?(this.options.set("visible",n),this):this.options.get("visible")!==!1},clip:function(n){var t=this.options;return r(n)?(n&&!n.id&&(n.id=dr()),t.set("clip",n),this):t.get("clip")},opacity:function(n){return r(n)?(this.options.set("opacity",n),this):nf(this.options.get("opacity"),1)},clippedBBox:function(n){var t=this._clippedBBox(n),i;if(t)return i=this.clip(),i?f.intersect(t,i.bbox(n)):t},containsPoint:function(n,t){if(this.visible()){var r=this.currentTransform(t),i=n;return r&&(i=n.transformCopy(r.matrix().invert())),this._hasFill()&&this._containsPoint(i)||this._isOnPath&&this._hasStroke()&&this._isOnPath(i)}return!1},_hasFill:function(){var n=this.options.fill;return n&&!gt(n.color)},_hasStroke:function(){var n=this.options.stroke;return n&&n.width>0&&!gt(n.color)},_clippedBBox:function(n){return this.bbox(n)}});l.prototype.nodeType="Element";k.extend(l.prototype);uf=Math.PI/2;wt=c.extend({init:function(n,i){n===void 0&&(n=new t);i===void 0&&(i=0);this.setCenter(n);this.setRadius(i)},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 wt(this.center.clone(),this.radius)},pointAt:function(n){return this._pointAt(ut(n))},bbox:function(n){for(var e=this,o=eo(this.center,this.radius,this.radius,n),r=t.maxPoint(),u=t.minPoint(),i=0;i<4;i++){var h=e._pointAt(o.x+i*uf).transformCopy(n),c=e._pointAt(o.y+i*uf).transformCopy(n),s=new t(h.x,c.y);r=t.min(r,s);u=t.max(u,s)}return f.fromPoints(r,u)},_pointAt:function(n){var i=this,r=i.center,u=i.radius;return new t(r.x+u*Math.cos(n),r.y+u*Math.sin(n))},containsPoint:function(n){var t=this,i=t.center,r=t.radius;return Math.pow(n.x-i.x,2)+Math.pow(n.y-i.y,2)<=Math.pow(r,2)},_isOnPath:function(n,t){var i=this,f=i.center,r=i.radius,u=f.distanceTo(n);return r-t<=u&&u<=r+t}});tu(wt.prototype,["radius"]);k.extend(wt.prototype);var nl="Gradient",ci={extend:function(n){n.fill=this.fill;n.stroke=this.stroke},fill:function(n,t){var i=this.options,u;return r(n)?(n&&n.nodeType!==nl?(u={color:n},r(t)&&(u.opacity=t),i.set("fill",u)):i.set("fill",n),this):i.get("fill")},stroke:function(n,t,i){return r(n)?(this.options.set("stroke.color",n),r(t)&&this.options.set("stroke.width",t),r(i)&&this.options.set("stroke.opacity",i),this):this.options.get("stroke")}},tl=o.IDENTITY.toString(),tr={extend:function(n){n.bbox=this.bbox;n.geometryChange=this.geometryChange},bbox:function(n){var i=pt(this.currentTransform(n)),u=i?i.toString():tl,t,r;return this._bboxCache&&this._matrixHash===u?t=this._bboxCache.clone():(t=this._bbox(i),this._bboxCache=t?t.clone():null,this._matrixHash=u),r=this.options.get("stroke.width"),r&&t&&t.expand(r/2),t},geometryChange:function(){delete this._bboxCache;this.trigger("geometryChange",{element:this})}};oo="#000";bt=l.extend({init:function(n,t){n===void 0&&(n=new wt);t===void 0&&(t={});l.fn.init.call(this,t);this.geometry(n);r(this.options.stroke)||this.stroke(oo)},rawBBox:function(){return this._geometry.bbox()},_bbox:function(n){return this._geometry.bbox(n)},_containsPoint:function(n){return this.geometry().containsPoint(n)},_isOnPath:function(n){return this.geometry()._isOnPath(n,this.options.stroke.width/2)}});bt.prototype.nodeType="Circle";ci.extend(bt.prototype);tr.extend(bt.prototype);iu(bt.prototype,["geometry"]);ft=10;var ul=45,ru=Math.pow,et=c.extend({init:function(n,i){n===void 0&&(n=new t);i===void 0&&(i={});this.setCenter(n);this.radiusX=i.radiusX;this.radiusY=i.radiusY||i.radiusX;this.startAngle=i.startAngle;this.endAngle=i.endAngle;this.anticlockwise=i.anticlockwise||!1;this.xRotation=i.xRotation},clone:function(){return new et(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},pointAt:function(n){var i=this.center,r=ut(n);return new t(i.x+this.radiusX*Math.cos(r),i.y+this.radiusY*Math.sin(r))},curvePoints:function(){var c=this,u=this.startAngle,l=this.anticlockwise?-1:1,f=[this.pointAt(u)],e=this._arcInterval(),o=e.endAngle-e.startAngle,s=Math.ceil(o/ul),a=o/s,t=u,h,i,r,n;for(this.xRotation&&(h=p().rotate(this.xRotation,this.center)),i=1;i<=s;i++)r=t+l*a,n=c._intervalCurvePoints(t,r,h),f.push(n.cp1,n.cp2,n.p2),t=r;return f},bbox:function(n){for(var a=this,v=this._arcInterval(),o=v.startAngle,i=v.endAngle,y=eo(this.center,this.radiusX,this.radiusY,n),w=yt(y.x),b=yt(y.y),p=this.pointAt(i).transformCopy(n),u=co(w,o),e=co(b,o),r=this.pointAt(o).transformCopy(n),s=t.min(r,p),h=t.max(r,p),c,l;u<i||e<i;)c=void 0,u<i&&(c=a.pointAt(u).transformCopy(n),u+=90),l=void 0,e<i&&(l=a.pointAt(e).transformCopy(n),e+=90),r=new t(c.x,l.y),s=t.min(s,r),h=t.max(h,r);return f.fromPoints(s,h)},_arcInterval:function(){var i=this,t=i.startAngle,n=i.endAngle,r=i.anticlockwise,u;return r&&(u=t,t=n,n=u),(t>n||r&&t===n)&&(n+=360),{startAngle:t,endAngle:n}},_intervalCurvePoints:function(n,i,r){var u=this.pointAt(n),f=this.pointAt(i),o=this._derivativeAt(n),s=this._derivativeAt(i),e=(ut(i)-ut(n))/3,h=new t(u.x+e*o.x,u.y+e*o.y),c=new t(f.x-e*s.x,f.y-e*s.y);return r&&(u.transform(r),f.transform(r),h.transform(r),c.transform(r)),{p1:u,cp1:h,cp2:c,p2:f}},_derivativeAt:function(n){var i=ut(n);return new t(-this.radiusX*Math.sin(i),this.radiusY*Math.cos(i))},containsPoint:function(n){var r=this._arcInterval(),v=r.endAngle-r.startAngle,f=this,t=f.center,e=f.radiusX,o=f.radiusY,s=t.distanceTo(n),l=Math.atan2(n.y-t.y,n.x-t.x),a=e*o/Math.sqrt(ru(e,2)*ru(Math.sin(l),2)+ru(o,2)*ru(Math.cos(l),2)),y=this.pointAt(this.startAngle).round(ft),p=this.pointAt(this.endAngle).round(ft),u=rl(t,n.round(ft),y,p),h,i,c;return v<180?h=u&&ff(t.distanceTo(u),s)&&ff(s,a):(i=ho(t.x,t.y,e,o,n.x,n.y),i!==360&&(i=(360+i)%360),c=r.startAngle<=i&&i<=r.endAngle,h=c&&ff(s,a)||!c&&(!u||u.equals(n))),h},_isOnPath:function(n,t){var r=this._arcInterval(),u=this.center,i=ho(u.x,u.y,this.radiusX,this.radiusY,n.x,n.y),f;return i!==360&&(i=(360+i)%360),f=r.startAngle<=i&&i<=r.endAngle,f&&this.pointAt(i).distanceTo(n)<=t}});et.fromPoints=function(n,t,i,r,u,f,e){var o=fl({x1:n.x,y1:n.y,x2:t.x,y2:t.y,rx:i,ry:r,largeArc:u,swipe:f,rotation:e});return new et(o.center,{startAngle:o.startAngle,endAngle:o.endAngle,radiusX:o.radiusX,radiusY:o.radiusY,xRotation:o.xRotation,anticlockwise:f===0})};tu(et.prototype,["radiusX","radiusY","startAngle","endAngle","anticlockwise"]);k.extend(et.prototype);var el=[].push,ol=[].pop,sl=[].splice,hl=[].shift,lo=[].slice,cl=[].unshift,ef=c.extend({init:function(n){n===void 0&&(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=el.apply(this,n);return this._add(n),t},slice:function(){return lo.call(this)},pop:function(){var t=this.length,n=ol.apply(this);return t&&this._remove([n]),n},splice:function(n,t){var i=lo.call(arguments,2),r=this._splice(n,t,i);return this._change(),r},shift:function(){var t=this.length,n=hl.apply(this);return t&&this._remove([n]),n},unshift:function(){var n=arguments,t=cl.apply(this,n);return this._add(n),t},indexOf:function(n){for(var i=this,r=this.length,t=0;t<r;t++)if(i[t]===n)return t;return-1},_splice:function(n,t,i){var r=sl.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 i=this,t=0;t<n.length;t++)n[t].addObserver(i)},_clearObserver:function(n){for(var i=this,t=0;t<n.length;t++)n[t].removeObserver(i)},_change:function(){}});k.extend(ef.prototype);of=ef.extend({_change:function(){this.geometryChange()}});tt=c.extend({init:function(n,t){n===void 0&&(n=0);t===void 0&&(t=0);this.real=n;this.img=t},add:function(n){return new tt(s(this.real+n.real,ft),s(this.img+n.img,ft))},addConstant:function(n){return new tt(this.real+n,this.img)},negate:function(){return new tt(-this.real,-this.img)},multiply:function(n){return new tt(this.real*n.real-this.img*n.img,this.real*n.img+this.img*n.real)},multiplyConstant:function(n){return new tt(this.real*n,this.img*n)},nthRoot:function(n){var t=Math.atan2(this.img,this.real),r=Math.sqrt(Math.pow(this.img,2)+Math.pow(this.real,2)),i=Math.pow(r,1/n);return new tt(i*Math.cos(t/n),i*Math.sin(t/n))},equals:function(n){return this.real===n.real&&this.img===n.img},isReal:function(){return this.img===0}});li=c.extend({init:function(n,i,r){this.anchor(n||new t);this.controlIn(i);this.controlOut(r)},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,t){return f.fromPoints(n,t)},_curveBoundingBox:function(n,i,r,u){var e=[n,i,r,u],o=this._curveExtremesFor(e,"x"),s=this._curveExtremesFor(e,"y"),h=bo([o.min,o.max,n.x,u.x]),c=bo([s.min,s.max,n.y,u.y]);return f.fromPoints(new t(h.min,c.min),new t(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:fu(i.min,t,n),max:fu(i.max,t,n)}},_curveExtremes:function(n,t,i,r){var o=n-3*t+3*i-r,u=-2*(n-2*t+i),l=n-t,c=Math.sqrt(u*u-4*o*l),s=0,h=1,f,e;return o===0?u!==0&&(s=h=-l/u):isNaN(c)||(s=(-u+c)/(2*o),h=(-u-c)/(2*o)),f=Math.max(Math.min(s,h),0),(f<0||f>1)&&(f=0),e=Math.min(Math.max(s,h),1),(e>1||e<0)&&(e=1),{min:f,max:e}},_intersectionsTo:function(n,t){return this.controlOut()&&n.controlIn()?vl([this.anchor(),this.controlOut(),n.controlIn(),n.anchor()],t,this.bboxTo(n)):wo(this.anchor(),n.anchor(),t)},_isOnCurveTo:function(n,t,i,r){var l=this.bboxTo(n).expand(i,i),h,u,c;if(l.containsPoint(t)){var f=this.anchor(),o=this.controlOut(),s=n.controlIn(),e=n.anchor();return r==="start"&&f.distanceTo(t)<=i?!ao(f,o,t):r==="end"&&e.distanceTo(t)<=i?!ao(e,s,t):(h=[f,o,s,e],eu(h,t,"x","y",i)||eu(h,t,"y","x",i))?!0:(u=p().rotate(45,t),c=[f.transformCopy(u),o.transformCopy(u),s.transformCopy(u),e.transformCopy(u)],eu(c,t,"x","y",i)||eu(c,t,"y","x",i))}},_isOnLineTo:function(n,t,i){var r=this.anchor(),u=n.anchor(),e=yt(Math.atan2(u.y-r.y,u.x-r.x)),o=new f([r.x,r.y-i/2],[r.distanceTo(u),i]);return o.containsPoint(t.transformCopy(p().rotate(-e,r)))},_isOnPathTo:function(n,t,i,r){return this.controlOut()&&n.controlIn()?this._isOnCurveTo(n,t,i/2,r):this._isOnLineTo(n,t,i)}});uu(li.prototype,["anchor","controlIn","controlOut"]);k.extend(li.prototype);e=l.extend({init:function(n){l.fn.init.call(this,n);this.segments=new of;this.segments.addObserver(this);r(this.options.stroke)||(this.stroke("#000"),r(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,i){var u=r(i)?new t(n,i):n,f=new li(u);return this.segments.push(f),this},curveTo:function(n,t,i){if(this.segments.length>0){var r=d(this.segments),u=new li(i,t);this.suspend();r.controlOut(n);this.resume();this.segments.push(u)}return this},arc:function(n,i,r,u,f){if(this.segments.length>0){var s=d(this.segments),e=s.anchor(),o=ut(n),h=new t(e.x-r*Math.cos(o),e.y-u*Math.sin(o)),c=new et(h,{startAngle:n,endAngle:i,radiusX:r,radiusY:u,anticlockwise:f});this._addArcSegments(c)}return this},arcTo:function(n,t,i,r,u,f){if(this.segments.length>0){var e=d(this.segments),o=e.anchor(),s=et.fromPoints(o,n,t,i,r,u,f);this._addArcSegments(s)}return this},_addArcSegments:function(n){var r=this,i,t;for(this.suspend(),i=n.curvePoints(),t=1;t<i.length;t+=3)r.curveTo(i[t],i[t+1],i[t+2]);this.resume();this.geometryChange()},close:function(){return this.options.closed=!0,this.geometryChange(),this},rawBBox:function(){return this._bbox()},_containsPoint:function(n){for(var t=this.segments,r=t.length,u=0,f,e,i=1;i<r;i++)f=t[i-1],e=t[i],u+=f._intersectionsTo(e,n);return(this.options.closed||!t[0].anchor().equals(t[r-1].anchor()))&&(u+=wo(t[0].anchor(),t[r-1].anchor(),n)),u%2!=0},_isOnPath:function(n,t){var i=this.segments,u=i.length,f=t||this.options.stroke.width,r;if(u>1){if(i[0]._isOnPathTo(i[1],n,f,"start"))return!0;for(r=2;r<=u-2;r++)if(i[r-1]._isOnPathTo(i[r],n,f))return!0;if(i[u-2]._isOnPathTo(i[u-1],n,f,"end"))return!0}return!1},_bbox:function(n){var r=this.segments,u=r.length,t,o,i,e;if(u===1)o=r[0].anchor().transformCopy(n),t=new f(o,y.ZERO);else if(u>0)for(i=1;i<u;i++)e=r[i-1].bboxTo(r[i],n),t=t?f.union(t,e):e;return t}});e.fromRect=function(n,t){return new e(t).moveTo(n.topLeft()).lineTo(n.topRight()).lineTo(n.bottomRight()).lineTo(n.bottomLeft()).close()};e.fromPoints=function(n,i){var u,r,f;if(n){for(u=new e(i),r=0;r<n.length;r++)f=t.create(n[r]),f&&(r===0?u.moveTo(f):u.lineTo(f));return u}};e.fromArc=function(n,t){var i=new e(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};e.prototype.nodeType="Path";ci.extend(e.prototype);tr.extend(e.prototype);ko="#000";ai=l.extend({init:function(n,t){n===void 0&&(n=new et);t===void 0&&(t={});l.fn.init.call(this,t);this.geometry(n);r(this.options.stroke)||this.stroke(ko)},_bbox:function(n){return this._geometry.bbox(n)},rawBBox:function(){return this.geometry().bbox()},toPath:function(){var i=new e,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},_containsPoint:function(n){return this.geometry().containsPoint(n)},_isOnPath:function(n){return this.geometry()._isOnPath(n,this.options.stroke.width/2)}});ai.prototype.nodeType="Arc";ci.extend(ai.prototype);tr.extend(ai.prototype);iu(ai.prototype,["geometry"]);vi=l.extend({init:function(n){l.fn.init.call(this,n);this.paths=new of;this.paths.addObserver(this);r(this.options.stroke)||this.stroke("#000")},moveTo:function(n,t){var i=new e;return i.moveTo(n,t),this.paths.push(i),this},lineTo:function(n,t){return this.paths.length>0&&d(this.paths).lineTo(n,t),this},curveTo:function(n,t,i){return this.paths.length>0&&d(this.paths).curveTo(n,t,i),this},arc:function(n,t,i,r,u){return this.paths.length>0&&d(this.paths).arc(n,t,i,r,u),this},arcTo:function(n,t,i,r,u,f){return this.paths.length>0&&d(this.paths).arcTo(n,t,i,r,u,f),this},close:function(){return this.paths.length>0&&d(this.paths).close(),this},_bbox:function(n){return ou(this.paths,!0,n)},rawBBox:function(){return ou(this.paths,!1)},_containsPoint:function(n){for(var i=this.paths,t=0;t<i.length;t++)if(i[t]._containsPoint(n))return!0;return!1},_isOnPath:function(n){for(var i=this.paths,r=this.options.stroke.width,t=0;t<i.length;t++)if(i[t]._isOnPath(n,r))return!0;return!1},_clippedBBox:function(n){return go(this.paths,this.currentTransform(n))}});vi.prototype.nodeType="MultiPath";ci.extend(vi.prototype);tr.extend(vi.prototype);var yl="12px sans-serif",pl="#000",yi=l.extend({init:function(n,i,u){i===void 0&&(i=new t);u===void 0&&(u={});l.fn.init.call(this,u);this.content(n);this.position(i);this.options.font||(this.options.font=yl);r(this.options.fill)||this.fill(pl)},content:function(n){return r(n)?(this.options.set("content",n),this):this.options.get("content")},measure:function(){return du.measureText(this.content(),{font:this.options.get("font")})},rect:function(){var n=this.measure(),t=this.position().clone();return new f(t,[n.width,n.height])},bbox:function(n){var t=pt(this.currentTransform(n));return this.rect().bbox(t)},rawBBox:function(){return this.rect().bbox()},_containsPoint:function(n){return this.rect().containsPoint(n)}});yi.prototype.nodeType="Text";ci.extend(yi.prototype);uu(yi.prototype,["position"]);pi=l.extend({init:function(n,t,i){t===void 0&&(t=new f);i===void 0&&(i={});l.fn.init.call(this,i);this.src(n);this.rect(t)},src:function(n){return r(n)?(this.options.set("src",n),this):this.options.get("src")},bbox:function(n){var t=pt(this.currentTransform(n));return this._rect.bbox(t)},rawBBox:function(){return this._rect.bbox()},_containsPoint:function(n){return this._rect.containsPoint(n)},_hasFill:function(){return this.src()}});pi.prototype.nodeType="Image";iu(pi.prototype,["rect"]);su={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}}};a=l.extend({init:function(n){l.fn.init.call(this,n);this.children=[]},childrenChange:function(n,t,i){this.trigger("childrenChange",{action:n,items:t,index:i})},append:function(){return di(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=this.children.indexOf(n);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 ou(this.children,!0,this.currentTransform(n))},rawBBox:function(){return ou(this.children,!1)},_clippedBBox:function(n){return go(this.children,this.currentTransform(n))},currentTransform:function(n){return l.prototype.currentTransform.call(this,n)||null},containsPoint:function(n,t){var r,u,i;if(this.visible())for(r=this.children,u=this.currentTransform(t),i=0;i<r.length;i++)if(r[i].containsPoint(n,u))return!0;return!1},_reparent:function(n,t){for(var r,i,f=this,u=0;u<n.length;u++)r=n[u],i=r.parent,i&&i!==f&&i.remove&&i.remove(r),r.parent=t}});a.prototype.nodeType="Group";su.extend(a.prototype,"children");var bl={alignContent:"start",justifyContent:"start",alignItems:"start",spacing:0,orientation:"horizontal",lineSpacing:0,wrap:!0,revers:!1},kl=function(n,t){n.forEach(t)},dl=function(n,t){for(var r=n.length,i=r-1;i>=0;i--)t(n[i],i)},gl=a.extend({init:function(t,i){a.fn.init.call(this,n.extend({},bl,i));this._rect=t;this._fieldMap={}},rect:function(n){return n?(this._rect=n,this):this._rect},_initMap:function(){var t=this.options,n=this._fieldMap;t.orientation==="horizontal"?(n.sizeField="width",n.groupsSizeField="height",n.groupAxis="x",n.groupsAxis="y"):(n.sizeField="height",n.groupsSizeField="width",n.groupAxis="y",n.groupsAxis="x");t.reverse?(this.forEach=dl,this.justifyAlign=wl):(this.forEach=kl,this.justifyAlign=ir)},reflow:function(){var nt=this,a;if(this._rect&&this.children.length!==0){this._initMap();this.options.transform&&this.transform(null);var i=this.options,r=this._rect,tt=this._initGroups(),it=tt.groups,ft=tt.groupsSize,c=this._fieldMap,u=c.sizeField,e=c.groupsSizeField,l=c.groupAxis,o=c.groupsAxis,b=new t,k=new t,d=new y,rt=ir(ft,r,i.alignContent,o,e),g,n,s,et=function(t,r){var f=n.elements[r];k[l]=g;k[o]=ir(t.size[e],s,i.alignItems,o,e);hu(k,t,f);g+=t.size[u]+i.spacing};for(a=0;a<it.length;a++)n=it[a],b[l]=g=nt.justifyAlign(n.size,r,i.justifyContent,l,u),b[o]=rt,d[u]=n.size,d[e]=n.lineSize,s=new f(b,d),nt.forEach(n.bboxes,et),rt+=n.lineSize+i.lineSpacing;if(!i.wrap&&n.size>r.size[u]){var h=r.size[u]/s.size[u],v=s.topLeft().scale(h,h),ot=s.size[e]*h,ut=ir(ot,r,i.alignContent,o,e),w=p();l==="x"?w.translate(r.origin.x-v.x,ut-v.y):w.translate(ut-v.x,r.origin.y-v.y);w.scale(h,h);this.transform(w)}}},_initGroups:function(){for(var r,i,t=this,s=this,f=s.options,e=s.children,h=f.lineSpacing,v=f.wrap,y=f.spacing,c=this._fieldMap.sizeField,n=this._newGroup(),l=[],o=function(){l.push(n);a+=n.lineSize+h},a=-h,u=0;u<e.length;u++)r=e[u],i=e[u].clippedBBox(),r.visible()&&i&&(v&&n.size+i.size[c]+y>t._rect.size[c]?n.bboxes.length===0?(t._addToGroup(n,i,r),o(),n=t._newGroup()):(o(),n=t._newGroup(),t._addToGroup(n,i,r)):t._addToGroup(n,i,r));return n.bboxes.length&&o(),{groups:l,groupsSize:a}},_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:[]}}}),rr=l.extend({init:function(n,t){n===void 0&&(n=new f);t===void 0&&(t={});l.fn.init.call(this,t);this.geometry(n);r(this.options.stroke)||this.stroke("#000")},_bbox:function(n){return this._geometry.bbox(n)},rawBBox:function(){return this._geometry.bbox()},_containsPoint:function(n){return this._geometry.containsPoint(n)},_isOnPath:function(n){return this.geometry()._isOnPath(n,this.options.stroke.width/2)}});rr.prototype.nodeType="Rect";ci.extend(rr.prototype);tr.extend(rr.prototype);iu(rr.prototype,["geometry"]);rs=ef.extend({_change:function(){this.optionsChange({field:"stops"})}});ot=c.extend({init:function(n,t,i){this.options=new ni({offset:n,color:t,opacity:r(i)?i:1});this.options.addObserver(this)}});ot.create=function(n){if(r(n))return n instanceof ot?n:n.length>1?new ot(n[0],n[1],n[2]):new ot(n.offset,n.color,n.opacity)};ha(ot.prototype,["offset","color","opacity"]);k.extend(ot.prototype);lt=c.extend({init:function(n){n===void 0&&(n={});this.stops=new rs(this._createStops(n.stops));this.stops.addObserver(this);this._userSpace=n.userSpace;this.id=dr()},userSpace:function(n){return r(n)?(this._userSpace=n,this.optionsChange(),this):this._userSpace},_createStops:function(n){var i,t;for(n===void 0&&(n=[]),i=[],t=0;t<n.length;t++)i.push(ot.create(n[t]));return i},addStop:function(n,t,i){this.stops.push(new ot(n,t,i))},removeStop:function(n){var t=this.stops.indexOf(n);t>=0&&this.stops.splice(t,1)}});lt.prototype.nodeType="Gradient";k.extend(lt.prototype);n.extend(lt.prototype,{optionsChange:function(n){this.trigger("optionsChange",{field:"gradient"+(n?"."+n.field:""),value:this})},geometryChange:function(){this.optionsChange()}});wi=lt.extend({init:function(n){n===void 0&&(n={});lt.fn.init.call(this,n);this.start(n.start||new t);this.end(n.end||new t(1,0))}});uu(wi.prototype,["start","end"]);ur=lt.extend({init:function(n){n===void 0&&(n={});lt.fn.init.call(this,n);this.center(n.center||new t);this._radius=r(n.radius)?n.radius:1;this._fallbackFill=n.fallbackFill},radius:function(n){return r(n)?(this._radius=n,this.geometryChange(),this):this._radius},fallbackFill:function(n){return r(n)?(this._fallbackFill=n,this.optionsChange(),this):this._fallbackFill}});uu(ur.prototype,["center"]);var va={swing:ca,linear:la,easeOutElastic:aa},us=Date.now||function(){return(new Date).getTime()},hf=c.extend({init:function(t,i){this.options=n.extend({},this.options,i);this.element=t},setup:function(){},step:function(){},play:function(){var i=this,r=this.options,n=r.duration,t=r.delay;t===void 0&&(t=0);var f=va[r.easing],u=us()+t,e=u+n;n===0?(this.step(1),this.abort()):setTimeout(function(){var t=function(){if(!i._stopped){var r=us(),o=ro(r-u,0,n),s=o/n,h=f(s,o,0,1,n);i.step(h);r<e?kendo.animationFrame(t):i.abort()}};t()},t)},abort:function(){this._stopped=!0},destroy:function(){this.abort()}});hf.prototype.options={duration:500,easing:"swing"};fr=c.extend({init:function(){this._items=[]},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)}});fr.current=new fr;hf.create=function(n,t,i){return fr.current.create(n,t,i)};cf={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,r=0;r<u.length;r+=6){var 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;fs(t.parameters,!0,i);this.l(n,t)},h:function(n,t){var i=t.isRelative?0:t.position.y;fs(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+2],c=u[r+3],l=u[r+4],f=new t(u[r+5],u[r+6]);i.isRelative&&f.translateWith(e);(e.x!==f.x||e.y!==f.y)&&(n.arcTo(f,o,s,c,l,h),e.x=f.x,e.y=f.y)}},s:function(n,i){var f=i.parameters,u=i.position,h=i.previousCommand,e,r;for((h==="s"||h==="c")&&(e=d(d(n.paths).segments).controlIn()),r=0;r<f.length;r+=4){var s=new t(f[r],f[r+1]),o=new t(f[r+2],f[r+3]),c=void 0;i.isRelative&&(s.translateWith(u),o.translateWith(u));c=e?es(e,u):u.clone();e=s;n.curveTo(c,s,o);u.x=o.x;u.y=o.y}},q:function(n,i){for(var o,u,s,f=i.parameters,e=i.position,r=0;r<f.length;r+=4)o=new t(f[r],f[r+1]),u=new t(f[r+2],f[r+3]),i.isRelative&&(o.translateWith(e),u.translateWith(e)),s=os(e,o,u),n.curveTo(s.controlOut,s.controlIn,u),e.x=u.x,e.y=u.y},t:function(n,i){var o=i.parameters,r=i.position,h=i.previousCommand,f,c,e,u,s;for((h==="q"||h==="t")&&(c=d(d(n.paths).segments),f=c.controlIn().clone().translateWith(r.scaleCopy(-1/3)).scale(3/2)),e=0;e<o.length;e+=2)u=new t(o[e],o[e+1]),i.isRelative&&u.translateWith(r),f=f?es(f,r):r.clone(),s=os(r,f,u),n.curveTo(s.controlOut,s.controlIn,u),r.x=u.x,r.y=u.y}};lf=1/3;var ya=/([a-df-z]{1})([^a-df-z]*)(z)?/gi,pa=/[,\s]?([+\-]?(?:\d*\.\d+|\d+)(?:[eE][+\-]?\d+)?)/g,ss="m",wa="z";er=c.extend({parse:function(n,i){var u=new vi(i),r=new t,f;return n.replace(ya,function(n,t,i,e){var o=t.toLowerCase(),h=o===t,s=ba(i.trim());if(o===ss&&(h?(r.x+=s[0],r.y+=s[1]):(r.x=s[0],r.y=s[1]),u.moveTo(r.x,r.y),s.length>2&&(o="l",s.splice(0,2))),cf[o])cf[o](u,{parameters:s,position:r,isRelative:h,previousCommand:f}),e&&e.toLowerCase()===wa&&u.close();else if(o!==ss)throw new Error("Error while parsing SVG path. Unsupported command: "+o);f=o}),u}});er.current=new er;e.parse=function(n,t){return er.current.parse(n,t)};ti=c.extend({init:function(){this._items=[]},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,t){var r=this._items,u=r[0],f,i;if(t&&t.type)for(f=t.type.toLowerCase(),i=0;i<r.length;i++)if(r[i].name===f){u=r[i];break}if(u)return new u.type(n,t);kendo.logToConsole("Warning: Unable to create Kendo UI Drawing Surface. Possible causes:\n- The browser does not support SVG and Canvas. User agent: "+navigator.userAgent)}});ti.current=new ti;hs=["click","mouseenter","mouseleave","mousemove","resize"];v=kendo.Observable.extend({init:function(t,i){kendo.Observable.fn.init.call(this);this.options=n.extend({},i);this.element=t;this.element._kendoExportVisual=this.exportVisual.bind(this);this._click=this._handler("click");this._mouseenter=this._handler("mouseenter");this._mouseleave=this._handler("mouseleave");this._mousemove=this._handler("mousemove");this._visual=new a;nr(t,this.options);this.bind(hs,this.options);this._enableTracking()},draw:function(n){this._visual.children.push(n)},clear:function(){this._visual.children=[]},destroy:function(){this._visual=null;this.element._kendoExportVisual=null;this.unbind()},eventTarget:function(n){for(var r=this,t=io(n),i;!i&&t;){if(i=t._kendoNode,t===r.element)break;t=t.parentElement}if(i)return i.srcElement},exportVisual:function(){return this._visual},getSize:function(){return nr(this.element)},currentSize:function(n){if(n)this._size=n;else return this._size},setSize:function(n){nr(this.element,n);this.currentSize(n);this._resize()},resize:function(n){var t=this.getSize(),i=this.currentSize();(n||(t.width>0||t.height>0)&&(!i||t.width!==i.width||t.height!==i.height))&&(this.currentSize(t),this._resize(t,n),this.trigger("resize",t))},size:function(n){if(!n)return this.getSize();this.setSize(n)},suspendTracking:function(){this._suspendedTracking=!0},resumeTracking:function(){this._suspendedTracking=!1},_enableTracking:function(){},_resize:function(){},_handler:function(n){var t=this;return function(i){var r=t.eventTarget(i);r&&!t._suspendedTracking&&t.trigger(n,{element:r,originalEvent:i,type:n})}},_elementOffset:function(){var n=this.element,t=nu(n,["paddingLeft","paddingTop"]),r=t.paddingLeft,u=t.paddingTop,i=uo(n),f=i.left,e=i.top;return{left:f+parseInt(r,10),top:e+parseInt(u,10)}},_surfacePoint:function(n){var i=this._elementOffset(),r=to(n),u=r.x-i.left,f=r.y-i.top;return new t(u,f)}});v.create=function(n,t){return ti.current.create(n,t)};v.support={};g=c.extend({init:function(n){this.childNodes=[];this.parent=null;n&&(this.srcElement=n,this.observe())},destroy:function(){var i=this,t,n;for(this.srcElement&&this.srcElement.removeObserver(this),t=this.childNodes,n=0;n<t.length;n++)i.childNodes[n].destroy();this.parent=null},load:function(){},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=this,u=n+t,i=n;i<u;i++)r.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()}});var at={},or="http://www.w3.org/2000/svg",cu="none",ls=function(n,t){n.innerHTML=t};if(typeof document!="undefined"){var ka="<svg xmlns='"+or+"'><\/svg>",as=document.createElement("div"),da=typeof DOMParser!="undefined";as.innerHTML=ka;da&&as.firstChild.namespaceURI!==or&&(ls=function(n,t){var i=new DOMParser,r=i.parseFromString(t,"text/xml"),u=document.adoptNode(r.documentElement);n.innerHTML="";n.appendChild(u)})}var vs=ls,ys="transform",lu={clip:"clip-path",fill:"fill"};var b=g.extend({init:function(n,t){g.fn.init.call(this,n);this.definitions={};this.options=t},destroy:function(){this.element&&(this.element._kendoNode=null,this.element=null);this.clearDefinitions();g.fn.destroy.call(this)},load:function(n,t){for(var s,u=this,f=0;f<n.length;f++){var e=n[f],o=e.children,i=new at[e.nodeType](e,u.options);r(t)?u.insertAt(i,t):u.append(i);i.createDefinitions();o&&o.length>0&&i.load(o);s=u.element;s&&i.attachTo(s,t)}},root:function(){for(var n=this;n.parent;)n=n.parent;return n},attachTo:function(n,t){var u=document.createElement("div"),i;vs(u,"<svg xmlns='"+or+"' version='1.1'>"+this.render()+"<\/svg>");i=u.firstChild.firstChild;i&&(r(t)?n.insertBefore(i,n.childNodes[t]||null):n.appendChild(i),this.setElement(i))},setElement:function(n){var i,t,r;for(this.element&&(this.element._kendoNode=null),this.element=n,this.element._kendoNode=this,i=this.childNodes,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}g.fn.removeSelf.call(this)},template:function(){return this.renderChildren()},render:function(){return this.template()},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?"":cu):lu[t]&&ps(t,i)?this.updateDefinition(t,i):t==="opacity"?this.attr("opacity",i):t==="cursor"?this.css("cursor",i):t==="id"&&(i?this.attr("id",i):this.removeAttr("id"));g.fn.optionsChange.call(this,n)},attr:function(n,t){this.element&&this.element.setAttribute(n,t)},allAttr:function(n){for(var i=this,t=0;t<n.length;t++)i.attr(n[t][0],n[t][1])},css:function(n,t){this.element&&(this.element.style[n]=t)},allCss:function(n){for(var i=this,t=0;t<n.length;t++)i.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([ys,"matrix("+n.matrix().toString(6)+")"]),t},renderTransform:function(){return ri(this.mapTransform(this.srcElement.transform()))},transformChange:function(n){n?this.allAttr(this.mapTransform(n)):this.removeAttr(ys)},mapStyle:function(){var n=this.srcElement.options,t=[["cursor",n.cursor]];return n.visible===!1&&t.push(["display",cu]),t},renderStyle:function(){return ii("style",cs(this.mapStyle(!0)))},renderOpacity:function(){return ii("opacity",this.srcElement.options.opacity)},renderId:function(){return ii("id",this.srcElement.options.id)},createDefinitions:function(){var i=this.srcElement,r=this.definitions,u,f,n,t;if(i){u=i.options;for(n in lu)t=u.get(n),t&&ps(n,t)&&(r[n]=t,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=lu[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,this.refUrl(t.id))):u&&this.removeAttr(f)},clearDefinitions:function(){var n=this.definitions;this.definitionChange({action:"remove",definitions:n});this.definitions={}},renderDefinitions:function(){return ri(this.mapDefinitions())},mapDefinitions:function(){var r=this,n=this.definitions,t=[];for(var i in n)t.push([lu[i],r.refUrl(n[i].id)]);return t},refUrl:function(n){var t=(this.options||{}).skipBaseHref;return nv(n,t)}}),ws=b.extend({template:function(){return"<stop "+this.renderOffset()+" "+this.renderStyle()+" />"},renderOffset:function(){return ii("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)}}),bs=b.extend({init:function(n){b.fn.init.call(this,n);this.id=n.id;this.loadStops()},loadStops:function(){for(var t,u=this,i=this.srcElement.stops,r=this.element,n=0;n<i.length;n++)t=new ws(i[n]),u.append(t),r&&t.attachTo(r)},optionsChange:function(n){n.field==="gradient.stops"?(g.prototype.clear.call(this),this.loadStops()):n.field==="gradient"&&this.allAttr(this.mapCoordinates())},renderCoordinates:function(){return ri(this.mapCoordinates())},mapSpace:function(){return["gradientUnits",this.srcElement.userSpace()?"userSpaceOnUse":"objectBoundingBox"]}}),ks=bs.extend({template:function(){return"<linearGradient id='"+this.id+"' "+this.renderCoordinates()+">"+this.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()]}}),ds=bs.extend({template:function(){return"<radialGradient id='"+this.id+"' "+this.renderCoordinates()+">"+this.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()]}}),gs=b.extend({init:function(n){b.fn.init.call(this);this.srcElement=n;this.id=n.id;this.load([n])},template:function(){return"<clipPath id='"+this.id+"'>"+this.renderChildren()+"<\/clipPath>"}}),nh=b.extend({init:function(){b.fn.init.call(this);this.definitionMap={}},attachTo:function(n){this.element=n},template:function(){return"<defs>"+this.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=gs:n==="fill"&&(t instanceof wi?i=ks:t instanceof ur&&(i=ds)),new i(t)},addDefinitions:function(n){var i=this;for(var t in n)i.addDefinition(t,n[t])},addDefinition:function(n,t){var r=this,o=r.element,u=r.definitionMap,f=t.id,e=u[f],i;e?e.count++:(i=this.createDefinition(n,t),u[f]={element:i,count:1},this.append(i),o&&i.attachTo(this.element))},removeDefinitions:function(n){var t=this;for(var i in n)t.removeDefinition(n[i])},removeDefinition:function(n){var i=this.definitionMap,r=n.id,t=i[r];t&&(t.count--,t.count===0&&(this.remove(this.childNodes.indexOf(t.element),1),delete i[r]))}}),af=b.extend({init:function(n){b.fn.init.call(this);this.options=n;this.defs=new nh},attachTo:function(n){this.element=n;this.defs.attachTo(n.firstElementChild)},clear:function(){g.prototype.clear.call(this)},template:function(){return this.defs.render()+this.renderChildren()},definitionChange:function(n){this.defs.definitionChange(n)}}),tv="rtl";au=v.extend({init:function(t,i){v.fn.init.call(this,t,i);this._root=new af(n.extend({rtl:nu(t,"direction").direction===tv},this.options));vs(this.element,this._template());this._rootElement=this.element.firstElementChild;iv(this._rootElement);this._root.attachTo(this._rootElement);tf(this.element,{click:this._click,mouseover:this._mouseenter,mouseout:this._mouseleave,mousemove:this._mousemove});this.resize()},destroy:function(){this._root&&(this._root.destroy(),this._root=null,this._rootElement=null,rf(this.element,{click:this._click,mouseover:this._mouseenter,mouseout:this._mouseleave,mousemove:this._mousemove}));v.fn.destroy.call(this)},translate:function(n){var t=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){v.fn.draw.call(this,n);this._root.load([n])},clear:function(){v.fn.clear.call(this);this._root.clear()},svg:function(){return"<?xml version='1.0' ?>"+this._template()},exportVisual:function(){var r=this,t=r._visual,i=r._offset,n;return i&&(n=new a,n.children.push(t),n.transform(p().translate(-i.x,-i.y)),t=n),t},_resize:function(){this._offset&&this.translate(this._offset)},_template:function(){return"<svg style='width: 100%; height: 100%; overflow: hidden;' xmlns='"+or+"' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1'>"+this._root.render()+"<\/svg>"}});au.prototype.type="svg";typeof document!="undefined"&&document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(v.support.svg=!0,ti.current.register("svg",au,10));vf=b.extend({template:function(){return"<g"+(this.renderId()+this.renderTransform()+this.renderStyle()+this.renderOpacity()+this.renderDefinitions())+">"+this.renderChildren()+"<\/g>"},optionsChange:function(n){n.field==="transform"&&this.transformChange(n.value);b.fn.optionsChange.call(this,n)}});at.Group=vf;var th={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]},yf="solid",ih="butt",rv={"fill.opacity":"fill-opacity","stroke.color":"stroke","stroke.width":"stroke-width","stroke.opacity":"stroke-opacity"},rh=" ",it=b.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"transform":this.transformChange(n.value);break;default:var t=rv[n.field];t&&this.attr(t,n.value)}b.fn.optionsChange.call(this,n)},content:function(){this.element&&(this.element.textContent=this.srcElement.content())},renderData:function(){return this.printPath(this.srcElement)},printPath:function(n){var f=this,i=n.segments,o=i.length,r,e,s,t,u;if(o>0){for(r=[],t=1;t<o;t++)u=f.segmentType(i[t-1],i[t]),u!==s&&(s=u,r.push(u)),u==="L"?r.push(f.printPoints(i[t].anchor())):r.push(f.printPoints(i[t-1].controlOut(),i[t].controlIn(),i[t].anchor()));return e="M"+this.printPoints(i[0].anchor())+rh+r.join(rh),n.options.closed&&(e+="Z"),e}},printPoints:function(){for(var t=arguments,r=t.length,i=[],n=0;n<r;n++)i.push(t[n].toString(3));return i.join(" ")},segmentType:function(n,t){return n.controlOut()&&t.controlIn()?"C":"L"},mapStroke:function(n){var t=[];return n&&!gt(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]),r(n.opacity)&&t.push(["stroke-opacity",n.opacity]),r(n.dashType)&&t.push(["stroke-dasharray",this.renderDashType(n)])):t.push(["stroke",cu]),t},renderStroke:function(){return ri(this.mapStroke(this.srcElement.options.stroke))},renderDashType:function(n){var i=n.dashType,r=n.width,u,f,t;if(r===void 0&&(r=1),i&&i!==yf){for(u=th[i.toLowerCase()],f=[],t=0;t<u.length;t++)f.push(u[t]*r);return f.join(" ")}},renderLinecap:function(n){var t=n.dashType,i=n.lineCap;return t&&t!=="solid"?ih:i},mapFill:function(n){var t=[];return n&&n.nodeType==="Gradient"||(n&&!gt(n.color)?(t.push(["fill",n.color]),r(n.opacity)&&t.push(["fill-opacity",n.opacity])):t.push(["fill",cu])),t},renderFill:function(){return ri(this.mapFill(this.srcElement.options.fill))},template:function(){return"<path "+this.renderId()+" "+this.renderStyle()+" "+this.renderOpacity()+" "+ii("d",this.renderData())+""+this.renderStroke()+this.renderFill()+this.renderDefinitions()+this.renderTransform()+"><\/path>"}});at.Path=it;pf=it.extend({renderData:function(){return this.printPath(this.srcElement.toPath())}});at.Arc=pf;wf=it.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:function(){return"<circle "+this.renderId()+" "+this.renderStyle()+" "+this.renderOpacity()+"cx='"+this.center().x+"' cy='"+this.center().y+"' r='"+this.radius()+"'"+this.renderStroke()+" "+this.renderFill()+" "+this.renderDefinitions()+this.renderTransform()+" ><\/circle>"}});at.Circle=wf;bf=it.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:function(){return"<rect "+this.renderId()+" "+this.renderStyle()+" "+this.renderOpacity()+" x='"+this.origin().x+"' y='"+this.origin().y+"' width='"+this.size().width+"' height='"+this.size().height+"' "+this.renderStroke()+" "+this.renderFill()+" "+this.renderDefinitions()+" "+this.renderTransform()+" />"}});at.Rect=bf;kf=it.extend({geometryChange:function(){this.allAttr(this.mapPosition());this.invalidate()},optionsChange:function(n){n.field==="src"&&this.allAttr(this.mapSource());it.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 ri(this.mapPosition())},mapSource:function(n){var t=this.srcElement.src();return n&&(t=kendo.htmlEncode(t)),[["xlink:href",t]]},renderSource:function(){return ri(this.mapSource(!0))},template:function(){return"<image preserveAspectRatio='none' "+this.renderId()+" "+this.renderStyle()+" "+this.renderTransform()+" "+this.renderOpacity()+this.renderPosition()+" "+this.renderSource()+" "+this.renderDefinitions()+"><\/image>"}});at.Image=kf;vu=/&(?:[a-zA-Z]+|#\d+);/g;typeof document!="undefined"&&(df._element=document.createElement("span"));gf=it.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",cs(this.mapStyle())),this.geometryChange()):n.field==="content"&&it.fn.content.call(this,this.srcElement.content());it.fn.optionsChange.call(this,n)},mapStyle:function(n){var i=it.fn.mapStyle.call(this,n),t=this.srcElement.options.font;return n&&(t=kendo.htmlEncode(t)),i.push(["font",t],["white-space","pre"]),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=df(n),n=kendo.htmlEncode(n),du.normalizeText(n)},renderTextAnchor:function(){var n;return!(this.options||{}).rtl||br.msie||br.edge||(n="end"),ii("text-anchor",n)},template:function(){return"<text "+this.renderId()+" "+this.renderTextAnchor()+" "+this.renderStyle()+" "+this.renderOpacity()+"x='"+this.pos().x+"' y='"+this.pos().y+"' "+this.renderStroke()+" "+this.renderTransform()+" "+this.renderDefinitions()+this.renderFill()+">"+this.renderContent()+"<\/text>"}});at.Text=gf;ne=it.extend({renderData:function(){var r=this,t=this.srcElement.paths,i,n;if(t.length>0){for(i=[],n=0;n<t.length;n++)i.push(r.printPath(t[n]));return i.join(" ")}}});at.MultiPath=ne;uh={Circle:wt,Arc:et,Rect:f,Point:t,Segment:li,Matrix:o,Size:y,toMatrix:pt,Transformation:hi,transform:p};eh={Surface:au,RootNode:af,Node:b,GroupNode:vf,ArcNode:pf,CircleNode:wf,RectNode:bf,ImageNode:kf,TextNode:gf,PathNode:it,MultiPathNode:ne,DefinitionNode:nh,ClipNode:gs,GradientStopNode:ws,LinearGradientNode:ks,RadialGradientNode:ds,exportGroup:fh};st={};pu=g.extend({init:function(n){g.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();g.fn.clear.call(this)},clearClip:function(){this.clip&&(this.clip.removeObserver(this),delete this.clip)},setClip:function(n){this.clip&&(n.beginPath(),yu(n,this.clip),n.clip())},optionsChange:function(n){n.field==="clip"&&(this.clearClip(),this.initClip());g.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 s=this,u=0;u<n.length;u++){var f=n[u],e=f.children,o=new st[f.nodeType](f,i);e&&e.length>0&&o.load(e,t,i);r(t)?s.insertAt(o,t):s.append(o)}},load:function(n,t,i){this.loadElements(n,t,i);this.invalidate()},setOpacity:function(n){if(this.srcElement){var t=this.srcElement.opacity();r(t)&&this.globalAlpha(n,t)}},globalAlpha:function(n,t){var i=t;i&&n.globalAlpha&&(i*=n.globalAlpha);n.globalAlpha=i},visible:function(){var n=this.srcElement;return!n||n&&n.options.visible!==!1}});ui=pu.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()}}});su.extend(ui.prototype,"childNodes");st.Group=ui;oh=1e3/60;wu=ui.extend({init:function(n){ui.fn.init.call(this);this.canvas=n;this.ctx=n.getContext("2d");var t=this._invalidate.bind(this);this.invalidate=kendo.throttle(function(){kendo.animationFrame(t)},oh)},destroy:function(){ui.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))}});su.extend(wu.prototype,"childNodes");var bu=c.extend({init:function(){this.shapes=[]},_add:function(n,t){this.shapes.push({bbox:t,shape:n});n._quadNode=this},pointShapes:function(n){for(var i=this.shapes,u=i.length,r=[],t=0;t<u;t++)i[t].bbox.containsPoint(n)&&r.push(i[t].shape);return r},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}}}),bi=bu.extend({init:function(n){bu.fn.init.call(this);this.children=[];this.rect=n},inBounds:function(n){var t=this.rect,i=t.bottomRight(),r=n.bottomRight();return t.origin.x<=n.origin.x&&t.origin.y<=n.origin.y&&r.x<=i.x&&r.y<=i.y},pointShapes:function(n){for(var i=this.children,u=i.length,r=bu.fn.pointShapes.call(this,n),t=0;t<u;t++)di(r,i[t].pointShapes(n));return r},insert:function(n,t){var u=this.children,i=!1,r;if(this.inBounds(t)){if(this.shapes.length<4)this._add(n,t);else{for(u.length||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 u=this,n=u.rect,e=u.children,t=n.center(),i=n.width()/2,r=n.height()/2;e.push(new bi(new f([n.origin.x,n.origin.y],[i,r])),new bi(new f([t.x,n.origin.y],[i,r])),new bi(new f([n.origin.x,t.y],[i,r])),new bi(new f([t.x,t.y],[i,r])))}}),ht=3e3,sh=1e4,uv=75,te=c.extend({init:function(){this.initRoots()},initRoots:function(){this.rootMap={};this.root=new bu;this.rootElements=[]},clear:function(){for(var i=this,t=this.rootElements,n=0;n<t.length;n++)i.remove(t[n]);this.initRoots()},pointShape:function(n){var r=(this.rootMap[Math.floor(n.x/ht)]||{})[Math.floor(n.y/ht)],t=this.root.pointShapes(n),i;for(r&&(t=t.concat(r.pointShapes(n))),this.assignZindex(t),t.sort(fv),i=0;i<t.length;i++)if(t[i].containsPoint(n))return t[i]},assignZindex:function(n){for(var e=this,i=0;i<n.length;i++){for(var t=n[i],u=0,f=Math.pow(sh,uv),r=[];t;)r.push(t),t=t.parent;while(r.length)t=r.pop(),u+=((t.parent?t.parent.children:e.rootElements).indexOf(t)+1)*f,f/=sh;n[i]._zIndex=u}},optionsChange:function(n){(n.field==="transform"||n.field==="stroke.width")&&this.bboxChange(n.element)},geometryChange:function(n){this.bboxChange(n.element)},bboxChange:function(n){var i=this,t;if(n.nodeType==="Group")for(t=0;t<n.children.length;t++)i.bboxChange(n.children[t]);else n._quadNode&&n._quadNode.remove(n),this._insertShape(n)},add:function(n){var t=Array.isArray(n)?n.slice(0):[n];di(this.rootElements,t);this._insert(t)},childrenChange:function(n){var i=this,t;if(n.action==="remove")for(t=0;t<n.items.length;t++)i.remove(n.items[t]);else this._insert(Array.prototype.slice.call(n.items,0))},_insert:function(n){for(var i=this,t;n.length>0;)t=n.pop(),t.addObserver(i),t.nodeType==="Group"?di(n,t.children):i._insertShape(t)},_insertShape:function(n){var r=n.bbox(),i;if(r){var e=this.getSectors(r),t=e[0][0],u=e[1][0];this.inRoot(e)?this.root.insert(n,r):(i=this.rootMap,i[t]||(i[t]={}),i[t][u]||(i[t][u]=new bi(new f([t*ht,u*ht],[ht,ht]))),i[t][u].insert(n,r))}},remove:function(n){var r=this,i,t;if(n.removeObserver(this),n.nodeType==="Group")for(i=n.children,t=0;t<i.length;t++)r.remove(i[t]);else n._quadNode&&(n._quadNode.remove(n),delete n._quadNode)},inRoot:function(n){return n[0].length>1||n[1].length>1},getSectors:function(n){for(var t,u=n.bottomRight(),f=Math.floor(u.x/ht),e=Math.floor(u.y/ht),i=[[],[]],r=Math.floor(n.origin.x/ht);r<=f;r++)i[0].push(r);for(t=Math.floor(n.origin.y/ht);t<=e;t++)i[1].push(t);return i}});hh=c.extend({init:function(n){n.bind("mouseenter",this._mouseenter.bind(this));n.bind("mouseleave",this._mouseleave.bind(this));this.element=n.element},clear:function(){this._resetCursor()},destroy:function(){this._resetCursor();delete this.element},_mouseenter:function(n){var t=this._shapeCursor(n);t?(this._current||(this._defaultCursor=this._getCursor()),this._setCursor(t)):this._resetCursor()},_mouseleave:function(){this._resetCursor()},_shapeCursor:function(n){for(var t=n.element;t&&!r(t.options.cursor);)t=t.parent;if(t)return t.options.cursor},_getCursor:function(){if(this.element)return this.element.style.cursor},_setCursor:function(n){this.element&&(this.element.style.cursor=n,this._current=n)},_resetCursor:function(){this._current&&(this._setCursor(this._defaultCursor||""),delete this._current)}});sr=v.extend({init:function(n,t){v.fn.init.call(this,n,t);this.element.innerHTML=this._template(this);var i=this.element.firstElementChild,r=nr(n);i.width=r.width;i.height=r.height;this._rootElement=i;this._root=new wu(i);this._mouseTrackHandler=this._trackMouse.bind(this);tf(this.element,{click:this._mouseTrackHandler,mousemove:this._mouseTrackHandler})},destroy:function(){v.fn.destroy.call(this);this._root&&(this._root.destroy(),this._root=null);this._searchTree&&(this._searchTree.clear(),delete this._searchTree);this._cursor&&(this._cursor.destroy(),delete this._cursor);rf(this.element,{click:this._mouseTrackHandler,mousemove:this._mouseTrackHandler})},draw:function(n){v.fn.draw.call(this,n);this._root.load([n],undefined,this.options.cors);this._searchTree&&this._searchTree.add([n])},clear:function(){v.fn.clear.call(this);this._root.clear();this._searchTree&&this._searchTree.clear();this._cursor&&this._cursor.clear()},eventTarget:function(n){if(this._searchTree){var t=this._surfacePoint(n);return this._searchTree.pointShape(t)}},image:function(){var i=this,r=i._root,f=i._rootElement,u=[],n,t;return r.traverse(function(n){n.loading&&u.push(n.loading)}),n=ei(),t=function(){r._invalidate();try{var t=f.toDataURL();n.resolve(t)}catch(i){n.reject(i)}},be(u).then(t,t),n},suspendTracking:function(){v.fn.suspendTracking.call(this);this._searchTree&&(this._searchTree.clear(),delete this._searchTree)},resumeTracking:function(){var t,i,n;if(v.fn.resumeTracking.call(this),!this._searchTree){for(this._searchTree=new te,t=this._root.childNodes,i=[],n=0;n<t.length;n++)i.push(t[n].srcElement);this._searchTree.add(i)}},_resize:function(){this._rootElement.width=this._size.width;this._rootElement.height=this._size.height;this._root.invalidate()},_template:function(){return"<canvas style='width: 100%; height: 100%;'><\/canvas>"},_enableTracking:function(){this._searchTree=new te;this._cursor=new hh(this);v.fn._enableTracking.call(this)},_trackMouse:function(n){var t,i;this._suspendedTracking||(t=this.eventTarget(n),n.type!=="click"?(i=this._currentShape,i&&i!==t&&this.trigger("mouseleave",{element:i,originalEvent:n,type:"mouseleave"}),t&&i!==t&&this.trigger("mouseenter",{element:t,originalEvent:n,type:"mouseenter"}),this.trigger("mousemove",{element:t,originalEvent:n,type:"mousemove"}),this._currentShape=t):t&&this.trigger("click",{element:t,originalEvent:n,type:"click"}))}});sr.prototype.type="canvas";typeof document!="undefined"&&document.createElement("canvas").getContext&&(v.support.canvas=!0,ti.current.register("canvas",sr,20));rt=pu.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):gt(t.color)||(n.fillStyle=t.color,n.save(),this.globalAlpha(n,t.opacity),n.fill(),n.restore(),i=!0)),i},setGradientFill:function(n,t){var r=this.srcElement.rawBBox(),u,f,e,i;t instanceof wi?(f=t.start(),e=t.end(),u=n.createLinearGradient(f.x,f.y,e.x,e.y)):t instanceof ur&&(i=t.center(),u=n.createRadialGradient(i.x,i.y,0,i.x,i.y,t.radius()));ev(u,t.stops);n.save();t.userSpace()||n.transform(r.width(),0,0,r.height(),r.origin.x,r.origin.y);n.fillStyle=u;n.fill();n.restore()},setStroke:function(n){var t=this.srcElement.options.stroke;if(t&&!gt(t.color)&&t.width>0)return n.strokeStyle=t.color,n.lineWidth=nf(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!==yf&&(t=th[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!==yf?n.lineCap=ih: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){yu(n,t)}});st.Path=rt;ie=rt.extend({renderPoints:function(n){var t=this.srcElement.toPath();yu(n,t)}});st.Arc=ie;re=rt.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)}});st.Circle=re;ue=rt.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)}});st.Rect=ue;fe=rt.extend({init:function(n,t){rt.fn.init.call(this,n);this.onLoad=this.onLoad.bind(this);this.onError=this.onError.bind(this);this.loading=ei();var i=this.img=new Image;t&&!/^data:/i.test(n.src())&&(i.crossOrigin=t);i.src=n.src();i.complete?this.onLoad():(i.onload=this.onLoad,i.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(n){n.field==="src"?(this.loading=ei(),this.img.src=this.srcElement.src()):rt.fn.optionsChange.call(this,n)},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())}});st.Image=fe;ee=rt.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;n.textAlign="left";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()}});st.Text=ee;oe=rt.extend({renderPoints:function(n){for(var i=this.srcElement.paths,t=0;t<i.length;t++)yu(n,i[t])}});st.MultiPath=oe;ch={Surface:sr,RootNode:wu,Node:pu,GroupNode:ui,ArcNode:ie,CircleNode:re,RectNode:ue,ImageNode:fe,TextNode:ee,PathNode:rt,MultiPathNode:oe};h=br;var hr="KENDO-PSEUDO-ELEMENT",cr={},u={};u._root=u;lh=yi.extend({init:function(n,t,i){yi.fn.init.call(this,n,t.getOrigin(),i);this._pdfRect=t},rect:function(){return this._pdfRect},rawBBox:function(){return this._pdfRect}});ar=typeof Element!="undefined"&&Element.prototype&&function(n){return n.matches?function(n,t){return n.matches(t)}:n.webkitMatchesSelector?function(n,t){return n.webkitMatchesSelector(t)}:n.mozMatchesSelector?function(n,t){return n.mozMatchesSelector(t)}:n.msMatchesSelector?function(n,t){return n.msMatchesSelector(t)}:function(n){return[].indexOf.call(document.querySelectorAll(n),this)!==-1}}(Element.prototype);ah=function(n){return n?function t(i){var r=i.cloneNode(!1);if(i.nodeType==1){var e=n(i),o=n(r),u,f=e.data();for(u in f)o.data(u,f[u]);for(/^canvas$/i.test(i.tagName)?r.getContext("2d").drawImage(i,0,0):/^(?:input|select|textarea|option)$/i.test(i.tagName)&&(r.removeAttribute("id"),r.removeAttribute("name"),r.value=i.value,r.checked=i.checked,r.selected=i.selected),u=i.firstChild;u;u=u.nextSibling)r.appendChild(t(u))}return r}:function(n){var i=function u(n){var i=n.cloneNode(!1),t;for(n._kendoExportVisual&&(i._kendoExportVisual=n._kendoExportVisual),t=n.firstChild;t;t=t.nextSibling)i.appendChild(u(t));return i}(n),r=n.querySelectorAll("canvas"),t;return r.length&&vt(i.querySelectorAll("canvas")).forEach(function(n,t){n.getContext("2d").drawImage(r[t],0,0)}),t=n.querySelectorAll("input, select, textarea, option"),vt(i.querySelectorAll("input, select, textarea, option")).forEach(function(n,i){n.removeAttribute("id");n.removeAttribute("name");n.value=t[i].value;n.checked=t[i].checked;n.selected=t[i].selected}),i}}(typeof window!="undefined"&&window.kendo&&window.kendo.jQuery);se.getFontFaces=ph;se.drawText=function(n){var t=new a;return u._clipbox=!1,u._matrix=o.unit(),u._stackingContext={element:n,group:t},gh(n,w(n),t),n.firstChild.nodeType==3?cc(n,n.firstChild,t):ye(n,t),nc(),t};var vh=function(){function v(u){function w(){var n=c.exec(u);n&&(u=u.substr(n[1].length))}function v(n){w();var t=n.exec(u);if(t)return u=u.substr(t[1].length),t[1]}function b(){var n=kendo.parseColor(u,!0),i,r,f;if(n)return f=/^#[0-9a-f]+/i.exec(u)||/^rgba?\(.*?\)/i.exec(u)||/^..*?\b/.exec(u),u=u.substr(f[0].length),n=n.toRGB(),(i=v(s))||(r=v(t)),{color:n,length:i,percent:r}}function k(r){var c,o,s,w=[],l=!1,a,y,p;if(v(f)){for(c=v(h),c?(c=ty(c),v(n)):(o=v(i),o=="to"?o=v(i):o&&/^-/.test(r)&&(l=!0),s=v(i),v(n)),/-moz-/.test(r)&&c==null&&o==null&&(a=v(t),y=v(t),l=!0,a=="0%"?o="left":a=="100%"&&(o="right"),y=="0%"?s="top":y=="100%"&&(s="bottom"),v(n));u&&!v(e);){if(p=b(),!p)break;w.push(p);v(n)}return{type:"linear",angle:c,to:o&&s?o+" "+s:o?o:s?s:null,stops:w,reverse:l}}}function d(){if(v(f)){var n=v(a);return n=n.replace(/^['"]+|["']+$/g,""),v(e),{type:"url",url:n}}}var p=u,y;return yr(r,p)?r[p]:((y=v(o))?y=k(y):(y=v(l))&&(y=d()),r[p]=y||{type:"none"})}var o=/^((-webkit-|-moz-|-o-|-ms-)?linear-gradient\s*)\(/,t=/^([-0-9.]+%)/,s=/^([-0-9.]+px)/,i=/^(left|right|top|bottom|to|center)\W/,h=/^([-0-9.]+(deg|grad|rad|turn))/,c=/^(\s+)/,f=/^(\()/,e=/^(\))/,n=/^(,)/,l=/^(url)\(/,a=/^(.*?)\)/,r={},u={};return function(n){return yr(u,n)?u[n]:u[n]=nt(n).map(v)}}(),nt=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,yr(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}}(),yh=function(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}}(Object.create?Object.create(null):{}),av=function(n){return function(t){var i=n[t];return i==null&&(i=n[t]=du.measureText("Mapq",{font:t}).height),i}}(Object.create?Object.create(null):{});ac={svg:eh,canvas:ch,util:bc,PathParser:er,Surface:v,BaseNode:g,SurfaceFactory:ti,OptionsStore:ni,exportImage:ov,exportSVG:sv,QuadNode:bi,ShapesQuadTree:te,ObserversMixin:k,Element:l,Circle:bt,Arc:ai,Path:e,MultiPath:vi,Text:yi,Image:pi,Group:a,Layout:gl,Rect:rr,align:na,vAlign:ta,stack:ia,vStack:ra,wrap:fa,vWrap:ea,fit:oa,LinearGradient:wi,RadialGradient:ur,GradientStop:ot,Gradient:lt,Animation:hf,AnimationFactory:fr,drawDOM:se};kendo.deepExtend(kendo,{drawing:ac,geometry:uh});kendo.drawing.Segment=kendo.geometry.Segment;kendo.dataviz.drawing=kendo.drawing;kendo.dataviz.geometry=kendo.geometry;kendo.drawing.util.measureText=kendo.util.measureText;kendo.drawing.util.objectKey=kendo.util.objectKey;kendo.drawing.Color=kendo.Color;kendo.util.encodeBase64=kendo.drawing.util.encodeBase64})(window.kendo.jQuery)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.popup",["kendo.core"],n)}(function(){return function(n,t){function ut(t,i){return!t||!i?!1:t===i||n.contains(t,i)}var i=window.kendo,b=i.ui,k=b.Widget,pt=i.Class,r=i.support,e=i.getOffset,o=i._outerWidth,f=i._outerHeight,d="open",g="close",et="deactivate",ot="activate",s="center",st="left",a="right",v="top",y="bottom",p="absolute",nt="hidden",tt="body",it="location",l="position",ht="visible",ct="effects",lt="k-state-active",w="k-state-border",wt=/k-state-border-(\w+)/,at=".k-picker-wrap, .k-dropdown-wrap, .k-link",bt="down",rt=n(document.documentElement),kt=n.proxy,dt=n(window),vt="scroll",gt=r.transitions.css,yt=gt+"transform",u=n.extend,h=".kendoPopup",c=["font-size","font-family","font-stretch","font-style","font-weight","line-height"],ni=k.extend({init:function(t,f){var e=this,o;f=f||{};f.isRtl&&(f.origin=f.origin||y+" "+a,f.position=f.position||v+" "+a);k.fn.init.call(e,t,f);t=e.element;f=e.options;e.collisions=f.collision?f.collision.split(" "):[];e.downEvent=i.applyEventMap(bt,i.guid());e.collisions.length===1&&e.collisions.push(e.collisions[0]);o=n(e.options.anchor).closest(".k-popup,.k-group").filter(":not([class^=km-])");f.appendTo=n(n(f.appendTo)[0]||o[0]||document.body);e.element.hide().addClass("k-popup k-group k-reset").toggleClass("k-rtl",!!f.isRtl).css({position:p}).appendTo(f.appendTo).attr("aria-hidden",!0).on("mouseenter"+h,function(){e._hovered=!0}).on("wheel"+h,function(t){var i=n(this).find(".k-list").parent();(i.scrollTop()===0&&t.originalEvent.deltaY<0||i.scrollTop()===i.prop("scrollHeight")-i.prop("offsetHeight")&&t.originalEvent.deltaY>0)&&t.preventDefault()}).on("mouseleave"+h,function(){e._hovered=!1});if(e.wrapper=n(),f.animation===!1&&(f.animation={open:{effects:{}},close:{hide:!0,effects:{}}}),u(f.animation.open,{complete:function(){e.wrapper.css({overflow:ht});e._activated=!0;e._trigger(ot)}}),u(f.animation.close,{complete:function(){e._animationClose()}}),e._mousedownProxy=function(n){e._mousedown(n)},e._resizeProxy=r.mobileOS.android?function(n){setTimeout(function(){e._resize(n)},600)}:function(n){e._resize(n)},f.toggleTarget)n(f.toggleTarget).on(f.toggleEvent+h,n.proxy(e.toggle,e))},events:[d,ot,g,et],options:{name:"Popup",toggleEvent:"click",origin:y+" "+st,position:v+" "+st,anchor:tt,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 n=this,t=n.wrapper.data(it);n.wrapper.hide();t&&n.wrapper.css(t);n.options.anchor!=tt&&n._hideDirClass();n._closing=!1;n._trigger(et)},destroy:function(){var t=this,r=t.options,u=t.element.off(h),f;k.fn.destroy.call(t);r.toggleTarget&&n(r.toggleTarget).off(h);r.modal||(rt.unbind(t.downEvent,t._mousedownProxy),t._toggleResize(!1));i.destroy(t.element.children());u.removeData();r.appendTo[0]===document.body&&(f=u.parent(".k-animation-container"),f[0]?f.remove():u.remove())},open:function(t,u){var f=this,a={isFixed:!isNaN(parseInt(u,10)),x:t,y:u},e=f.element,o=f.options,s,h,y=n(o.anchor),w=e[0]&&e.hasClass("km-widget");if(!f.visible()){if(o.copyAnchorStyles&&(w&&c[0]=="font-size"&&c.shift(),e.css(i.getComputedStyles(y[0],c))),e.data("animating")||f._trigger(d))return;f._activated=!1;o.modal||(rt.unbind(f.downEvent,f._mousedownProxy).bind(f.downEvent,f._mousedownProxy),f._toggleResize(!1),f._toggleResize(!0));f.wrapper=h=i.wrap(e,o.autosize).css({overflow:nt,display:"block",position:p}).attr("aria-hidden",!1);r.mobileOS.android&&h.css(yt,"translatez(0)");h.css(l);n(o.appendTo)[0]==document.body&&h.css(v,"-10000px");f.flipped=f._position(a);s=f._openAnimation();o.anchor!=tt&&f._showDirClass(s);e.data(ct,s.effects).kendoStop(!0).kendoAnimate(s).attr("aria-hidden",!1)}},_location:function(t){var f=this,e=f.element,o=f.options,u,h=n(o.anchor),a=e[0]&&e.hasClass("km-widget"),s;return o.copyAnchorStyles&&(a&&c[0]=="font-size"&&c.shift(),e.css(i.getComputedStyles(h[0],c))),f.wrapper=u=i.wrap(e,o.autosize).css({overflow:nt,display:"block",position:p}),r.mobileOS.android&&u.css(yt,"translatez(0)"),u.css(l),n(o.appendTo)[0]==document.body&&u.css(v,"-10000px"),f._position(t||{}),s=u.offset(),{width:i._outerWidth(u),height:i._outerHeight(u),left:s.left,top:s.top}},_openAnimation:function(){var n=u(!0,{},this.options.animation.open);return n.effects=i.parseEffects(n.effects,this.flipped),n},_hideDirClass:function(){var t=n(this.options.anchor),r=((t.attr("class")||"").match(wt)||["","down"])[1],u=w+"-"+r;t.removeClass(u).children(at).removeClass(lt).removeClass(u);this.element.removeClass(w+"-"+i.directions[r].reverse)},_showDirClass:function(t){var r=t.effects.slideIn?t.effects.slideIn.direction:"down",u=w+"-"+r;n(this.options.anchor).addClass(u).children(at).addClass(lt).addClass(u);this.element.addClass(w+"-"+i.directions[r].reverse)},position:function(){this.visible()&&(this.flipped=this._position())},toggle:function(){var n=this;n[n.visible()?g:d]()},visible:function(){return this.element.is(":"+ht)},close:function(t){var r=this,h=r.options,s,f,e,o;if(r.visible()){if(s=r.wrapper[0]?r.wrapper:i.wrap(r.element).hide(),r._toggleResize(!1),r._closing||r._trigger(g)){r._toggleResize(!0);return}r.element.find(".k-popup").each(function(){var r=n(this),i=r.data("kendoPopup");i&&i.close(t)});rt.unbind(r.downEvent,r._mousedownProxy);t?f={hide:!0,effects:{}}:(f=u(!0,{},h.animation.close),e=r.element.data(ct),o=f.effects,!o&&!i.size(o)&&e&&i.size(e)&&(f.effects=e,f.reverse=!0),r._closing=!0);r.element.kendoStop(!0).attr("aria-hidden",!0);s.css({overflow:nt}).attr("aria-hidden",!0);r.element.kendoAnimate(f);t&&r._animationClose()}},_trigger:function(n){return this.trigger(n,{type:n})},_resize:function(n){var t=this;r.resize.indexOf(n.type)!==-1?(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",i=r.resize;r.mobileOS.ios||r.mobileOS.android||(i+=" "+vt);this._scrollableParents()[t](vt,this._resizeProxy);dt[t](i,this._resizeProxy)},_mousedown:function(t){var u=this,s=u.element[0],e=u.options,h=n(e.anchor)[0],o=e.toggleTarget,f=i.eventTarget(t),r=n(f).closest(".k-popup"),c=r.parent().parent(".km-shim").length;(r=r[0],c||!r||r===u.element[0])&&n(t.target).closest("a").data("rel")!=="popover"&&(ut(s,f)||ut(h,f)||o&&ut(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,u,f,e){var o=0;return e=e||t,f!==u&&f!==s&&u!==s&&(n+e>r&&(o+=-(i+t)),n+o<0&&(o+=i+t)),o},_scrollableParents:function(){return n(this.options.anchor).parentsUntil("body").filter(function(n,t){return i.isScrollable(t)})},_position:function(t){var h=this,ft=h.element,s=h.wrapper,a=h.options,k=n(a.viewport),w=r.zoomLevel(),yt=!!(k[0]==window&&window.innerWidth&&w<=1.02),y=n(a.anchor),et=a.origin.toLowerCase().split(" "),ot=a.position.toLowerCase().split(" "),d=h.collisions,g,st,v,nt=10002,ht=0,pt=document.documentElement,wt,ct,b,tt,bt;if(ct=a.viewport===window?{top:window.pageYOffset||document.documentElement.scrollTop||0,left:window.pageXOffset||document.documentElement.scrollLeft||0}:k.offset(),yt?(b=window.innerWidth,tt=window.innerHeight):(b=k.width(),tt=k.height()),yt&&pt.scrollHeight-pt.clientHeight>0&&(bt=a.isRtl?-1:1,b-=bt*i.support.scrollbar()),g=y.parents().filter(s.siblings()),g[0])if(v=Math.max(Number(g.css("zIndex")),0),v)nt=v+10;else for(st=y.parentsUntil(g),wt=st.length;ht<wt;ht++)v=Number(n(st[ht]).css("zIndex")),v&&nt<v&&(nt=v+10);s.css("zIndex",nt);t&&t.isFixed?s.css({left:t.x,top:t.y}):s.css(h._align(et,ot));var lt=e(s,l,y[0]===s.offsetParent()[0]),rt=e(s),gt=y.offsetParent().parent(".k-animation-container,.k-popup,.k-group");gt.length&&(lt=e(s,l,!0),rt=e(s));rt.top-=ct.top;rt.left-=ct.left;h.wrapper.data(it)||s.data(it,u({},lt));var ut=u({},rt),c=u({},lt),kt=a.adjustSize;d[0]==="fit"&&(c.top+=h._fit(ut.top,f(s)+kt.height,tt/w));d[1]==="fit"&&(c.left+=h._fit(ut.left,o(s)+kt.width,b/w));var dt=u({},c),at=f(ft),vt=f(s);return!s.height()&&at&&(vt=vt+at),d[0]==="flip"&&(c.top+=h._flip(ut.top,at,f(y),tt/w,et[0],ot[0],vt)),d[1]==="flip"&&(c.left+=h._flip(ut.left,o(ft),o(y),b/w,et[1],ot[1],o(s))),ft.css(l,p),s.css(c),c.left!=dt.left||c.top!=dt.top},_align:function(t,i){var c=this,l=c.wrapper,v=n(c.options.anchor),w=t[0],b=t[1],k=i[0],d=i[1],g=e(v),nt=n(c.options.appendTo),p,tt=o(l),it=f(l)||f(l.children().first()),rt=o(v),ut=f(v),r=g.top,u=g.left,h=Math.round;return nt[0]!=document.body&&(p=e(nt),r-=p.top,u-=p.left),w===y&&(r+=ut),w===s&&(r+=h(ut/2)),k===y&&(r-=it),k===s&&(r-=h(it/2)),b===a&&(u+=rt),b===s&&(u+=h(rt/2)),d===a&&(u-=tt),d===s&&(u-=h(tt/2)),{top:r,left:u}}});b.plugin(ni);var ti=i.support.stableSort,ft="kendoTabKeyTrap",ii="a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex], *[contenteditable]",ri=pt.extend({init:function(t){this.element=n(t);this.element.autoApplyNS(ft)},trap:function(){this.element.on("keydown",kt(this._keepInTrap,this))},removeTrap:function(){this.element.kendoDestroy(ft)},destroy:function(){this.element.kendoDestroy(ft);this.element=t},shouldTrap:function(){return!0},_keepInTrap:function(n){if(n.which===9&&this.shouldTrap()&&!n.isDefaultPrevented()){var t=this._focusableElements(),i=this._sortFocusableElements(t),r=this._nextFocusable(n,i);this._focus(r);n.preventDefault()}},_focusableElements:function(){var t=this.element.find(ii).filter(function(t,i){return i.tabIndex>=0&&n(i).is(":visible")&&!n(i).is(":disabled")});return this.element.is("[tabindex]")&&t.push(this.element[0]),t},_sortFocusableElements:function(n){var i,t;return ti?i=n.sort(function(n,t){return n.tabIndex-t.tabIndex}):(t="__k_index",n.each(function(n,i){i.setAttribute(t,n)}),i=n.sort(function(n,i){return n.tabIndex===i.tabIndex?parseInt(n.getAttribute(t),10)-parseInt(i.getAttribute(t),10):n.tabIndex-i.tabIndex}),n.removeAttr(t)),i},_nextFocusable:function(n,t){var i=t.length,r=t.index(n.target);return t.get((r+(n.shiftKey?-1:1))%i)},_focus:function(n){dsiCommon.writeToConsole("focus element");var t=this;n.focus();n.nodeName=="INPUT"&&n.setSelectionRange&&this._haveSelectionRange(n)&&n.setSelectionRange(0,n.value.length);setTimeout(function(){n.focus();n.nodeName=="INPUT"&&n.setSelectionRange&&t._haveSelectionRange(n)&&n.setSelectionRange(0,n.value.length)},100)},_haveSelectionRange:function(n){var t=n.type.toLowerCase();return t==="text"||t==="search"||t==="url"||t==="tel"||t==="password"}});b.Popup.TabKeyTrap=ri}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("drawing/surface-tooltip",["kendo.popup","drawing/kendo-drawing"],n)}(function(){(function(n){var r=".kendo",t=window.kendo,u=t.deepExtend,f=t.drawing.util,e=f.defined,o=f.limitValue,s=f.eventCoordinates,h=t._outerWidth,c=t._outerHeight,i=n.proxy,l='<div class="k-tooltip"><div class="k-tooltip-content"><\/div><\/div>',a='<div class="k-tooltip-button"><a href="\\#" class="k-icon k-i-close">close<\/a><\/div>',v=t.Class.extend({init:function(t,i){this.element=n(l);this.content=this.element.children(".k-tooltip-content");i=i||{};this.options=u({},this.options,this._tooltipOptions(i));this.popupOptions={appendTo:i.appendTo,animation:i.animation,copyAnchorStyles:!1,collision:"fit fit"};this._openPopupHandler=n.proxy(this._openPopup,this);this.surface=t;this._bindEvents()},options:{position:"top",showOn:"mouseenter",offset:7,autoHide:!0,hideDelay:0,showAfter:100},_bindEvents:function(){this._showHandler=i(this._showEvent,this);this._surfaceLeaveHandler=i(this._surfaceLeave,this);this._mouseleaveHandler=i(this._mouseleave,this);this._mousemoveHandler=i(this._mousemove,this);this.surface.bind("click",this._showHandler);this.surface.bind("mouseenter",this._showHandler);this.surface.bind("mouseleave",this._mouseleaveHandler);this.surface.bind("mousemove",this._mousemoveHandler);this.surface.element.on("mouseleave"+r,this._surfaceLeaveHandler);this.element.on("click"+r,".k-tooltip-button",i(this._hideClick,this))},getPopup:function(){return this.popup||(this.popup=new t.ui.Popup(this.element,this.popupOptions)),this.popup},destroy:function(){var n=this.popup;this.surface.unbind("click",this._showHandler);this.surface.unbind("mouseenter",this._showHandler);this.surface.unbind("mouseleave",this._mouseleaveHandler);this.surface.unbind("mousemove",this._mousemoveHandler);this.surface.element.off("mouseleave"+r,this._surfaceLeaveHandler);this.element.off("click"+r);n&&(n.destroy(),delete this.popup);delete this.popupOptions;clearTimeout(this._timeout);delete this.element;delete this.content;delete this.surface},_tooltipOptions:function(n){return n=n||{},{position:n.position,showOn:n.showOn,offset:n.offset,autoHide:n.autoHide,width:n.width,height:n.height,content:n.content,shared:n.shared,hideDelay:n.hideDelay,showAfter:n.showAfter}},_tooltipShape:function(n){while(n&&!n.options.tooltip)n=n.parent;return n},_updateContent:function(n,i,r){var u=r.content;return t.isFunction(u)&&(u=u({element:i,target:n})),u?(this.content.html(u),!0):void 0},_position:function(n,t,i,r){var l=t.position,c=t.offset||0,y=this.surface,f=y._instance._elementOffset(),b=y.getSize(),p=y._instance._offset,u=n.bbox(),a=i.width,v=i.height,e=0,h=0,w;return u.origin.translate(f.left,f.top),p&&u.origin.translate(-p.x,-p.y),l=="cursor"&&r?(w=s(r),e=w.x-a/2,h=w.y-v-c):l=="left"?(e=u.origin.x-a-c,h=u.center().y-v/2):l=="right"?(e=u.bottomRight().x+c,h=u.center().y-v/2):l=="bottom"?(e=u.center().x-a/2,h=u.bottomRight().y+c):(e=u.center().x-a/2,h=u.origin.y-v-c),{left:o(e,f.left,f.left+b.width),top:o(h,f.top,f.top+b.height)}},show:function(n,t){this._show(n,n,u({},this.options,this._tooltipOptions(n.options.tooltip),t))},hide:function(){var n=this.popup,t=this._current;delete this._current;clearTimeout(this._showTimeout);n&&n.visible()&&t&&!this.surface.trigger("tooltipClose",{element:t.shape,target:t.target,popup:n})&&n.close()},_hideClick:function(n){n.preventDefault();this.hide()},_show:function(n,t,i,r,u){var e=this._current,f,o;(clearTimeout(this._timeout),e&&(e.shape===t&&i.shared||e.target===n))||(clearTimeout(this._showTimeout),f=this.getPopup(),!this.surface.trigger("tooltipOpen",{element:t,target:n,popup:f})&&this._updateContent(n,t,i)&&(this._autoHide(i),o=this._measure(i),f.visible()&&f.close(!0),this._current={options:i,elementSize:o,shape:t,target:n,position:this._position(i.shared?t:n,i,o,r)},u?this._showTimeout=setTimeout(this._openPopupHandler,i.showAfter||0):this._openPopup()))},_openPopup:function(){var t=this._current,n=t.position;this.getPopup().open(n.left,n.top)},_autoHide:function(t){t.autoHide&&this._closeButton&&(this.element.removeClass("k-tooltip-closable"),this._closeButton.remove(),delete this._closeButton);t.autoHide||this._closeButton||(this.element.addClass("k-tooltip-closable"),this._closeButton=n(a).prependTo(this.element))},_showEvent:function(n){var i=this._tooltipShape(n.element),t;i&&(t=u({},this.options,this._tooltipOptions(i.options.tooltip)),t&&t.showOn==n.type&&this._show(n.element,i,t,n.originalEvent,!0))},_measure:function(n){var t=this.getPopup(),r,u,i;return this.element.css({width:"auto",height:"auto"}),i=t.visible(),i||t.wrapper.show(),this.element.css({width:e(n.width)?n.width:"auto",height:e(n.height)?n.height:"auto"}),r=h(this.element),u=c(this.element),i||t.wrapper.hide(),{width:r,height:u}},_mouseleave:function(n){if(this.popup&&!this._popupRelatedTarget(n.originalEvent)){var t=this,i=t._current;i&&i.options.autoHide&&(t._timeout=setTimeout(function(){clearTimeout(t._showTimeout);t.hide()},i.options.hideDelay||0))}},_mousemove:function(n){var t=this._current,r,i;t&&n.element&&(r=t.options,r.position=="cursor"&&(i=this._position(n.element,r,t.elementSize,n.originalEvent),t.position=i,this.getPopup().wrapper.css({left:i.left,top:i.top})))},_surfaceLeave:function(n){this.popup&&!this._popupRelatedTarget(n)&&(clearTimeout(this._showTimeout),this.hide())},_popupRelatedTarget:function(t){return t.relatedTarget&&n(t.relatedTarget).closest(this.popup.wrapper).length}});t.drawing.SurfaceTooltip=v})(window.kendo.jQuery)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("drawing/surface",["drawing/kendo-drawing","drawing/surface-tooltip"],n)}(function(){(function(n){function s(n){this._instance.translate(n)}var t=window.kendo,f=t.drawing,r=f.Surface,u=t.ui.Widget,e=t.deepExtend,o=n.proxy,i;t.support.svg=r.support.svg;t.support.canvas=r.support.canvas;i=u.extend({init:function(n,t){u.fn.init.call(this,n,{});this.options=e({},this.options,t);this._instance=r.create(this.element[0],t);this._instance.translate&&(this.translate=s);this._triggerInstanceHandler=o(this._triggerInstanceEvent,this);this._bindHandler("click");this._bindHandler("mouseenter");this._bindHandler("mouseleave");this._bindHandler("mousemove");this._enableTracking()},options:{name:"Surface",tooltip:{}},events:["click","mouseenter","mouseleave","mousemove","resize","tooltipOpen","tooltipClose"],_triggerInstanceEvent:function(n){this.trigger(n.type,n)},_bindHandler:function(n){this._instance.bind(n,this._triggerInstanceHandler)},draw:function(n){this._instance.draw(n)},clear:function(){this._instance&&this._instance.clear();this.hideTooltip()},destroy:function(){this._instance&&(this._instance.destroy(),delete this._instance);this._tooltip&&(this._tooltip.destroy(),delete this._tooltip);u.fn.destroy.call(this)},exportVisual:function(){return this._instance.exportVisual()},eventTarget:function(n){return this._instance.eventTarget(n)},showTooltip:function(n,t){this._tooltip&&this._tooltip.show(n,t)},hideTooltip:function(){this._tooltip&&this._tooltip.hide()},suspendTracking:function(){this._instance.suspendTracking();this.hideTooltip()},resumeTracking:function(){this._instance.resumeTracking()},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._instance.currentSize(n);this._resize()},_resize:function(){this._instance.currentSize(this._size);this._instance._resize()},_enableTracking:function(){t.ui.Popup&&(this._tooltip=new f.SurfaceTooltip(this,this.options.tooltip||{}))}});t.ui.plugin(i);i.create=function(n,t){return new i(n,t)};t.drawing.Surface=i})(window.kendo.jQuery)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("drawing/html",["drawing/kendo-drawing"],n)}(function(){(function(n){var r=window.kendo,t=r.drawing,i=t.drawDOM;t.drawDOM=function(t,r){return i(n(t)[0],r)};t.drawDOM.drawText=i.drawText;t.drawDOM.getFontFaces=i.getFontFaces})(window.kendo.jQuery)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.drawing",["drawing/util","drawing/kendo-drawing","drawing/surface-tooltip","drawing/surface","drawing/html"],n)}(function(){},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.validator",["kendo.core"],n)}(function(){return function(n){function ut(i){var r=t.ui.validator.ruleResolvers||{},u={};for(var f in r)n.extend(!0,u,r[f].resolve(i));return u}function ft(n){return n.replace(/&amp/g,"&amp;").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&lt;/g,"<").replace(/&gt;/g,">")}function et(n){return(n=(n+"").split("."),n.length>1)?n[1].length:0}function ot(t){return n.parseHTML?n(n.parseHTML(t)):n(t)}function st(i,r){for(var f=n(),u,o,e=0,s=i.length;e<s;e++)u=i[e],k.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",k=new RegExp(r,"i"),d="k-invalid",g="k-valid",nt=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/i,tt=/^(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])",s=":checkbox:not([disabled],[readonly])",e="[type=number],[type=range]",h="blur",c="name",l="form",a="novalidate",v="validate",o="change",y="validateInput",it=n.proxy,p=function(n,t){return typeof t=="string"&&(t=new RegExp("^(?:"+t+")$")),t.test(n)},w=function(n,t,i){var r=n.val();return n.filter(t).length&&r!==""?p(r,i):!0},rt=function(n,t){return n.length?n[0].attributes[t]!=null:!1},b;t.ui.validator||(t.ui.validator={rules:{},messages:{}});b=f.extend({init:function(i,r){var e=this,o=ut(i),h="["+t.attr("validate")+"!=false]";r=r||{};r.rules=n.extend({},t.ui.validator.rules,o.rules,r.rules);r.messages=n.extend({},t.ui.validator.messages,o.messages,r.messages);f.fn.init.call(e,i,r);e._errorTemplate=t.template(e.options.errorTemplate);e.element.is(l)&&e.element.attr(a,a);e._inputSelector=u+h;e._checkboxSelector=s+h;e._errors={};e._attachEvents();e._isValidated=!1},events:[v,o,y],options:{name:"Validator",errorTemplate:'<span class="k-widget k-tooltip k-tooltip-validation"><span class="k-icon k-i-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!(rt(n,"required")&&(!t||t===""||t.length===0||i))},pattern:function(n){return n.filter("[type=text],[type=email],[type=url],[type=tel],[type=search],[type=password]").filter("[pattern]").length&&n.val()!==""?p(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=et(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 w(n,"[type=email],["+t.attr("type")+"=email]",nt)},url:function(n){return w(n,"[type=url],["+t.attr("type")+"=url]",tt)},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(o)},_attachEvents:function(){var t=this;if(t.element.is(l))t.element.on("submit"+i,it(t._submit,t));if(t.options.validateOnBlur)if(t.element.is(u)){t.element.on(h+i,function(){t._checkElement(t.element)});if(t.element.is(s))t.element.on("click"+i,function(){t._checkElement(t.element)})}else{t.element.on(h+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(v,{valid:n}),e!==n&&this.trigger(o),n},validateInput:function(i){var e,h;i=n(i);this._isValidated=!0;var u=this,v=u._errorTemplate,l=u._checkValidity(i),f=l.valid,p="."+r,o=i.attr(c)||"",a=u._findMessageContainer(o).add(i.next(p).filter(function(){var i=n(this);return i.filter("["+t.attr("for")+"]").length?i.attr(t.attr("for"))===o:!0})).hide(),s,w=!i.attr("aria-invalid");return i.removeAttr("aria-invalid"),f?delete u._errors[o]:(s=u._extractMessage(i,l.key),u._errors[o]=s,e=ot(v({message:ft(s)})),h=a.attr("id"),u._decorateMessageContainer(e,o),h&&e.attr("id",h),a.replaceWith(e).length||e.insertAfter(i),e.show(),i.attr("aria-invalid",!0)),w!==f&&this.trigger(y,{valid:f,input:i}),i.toggleClass(d,!f),i.toggleClass(g,f),f},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(st(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 f=this,r=f.options.messages[i],e=n.attr(c),u;return t.ui.Validator.prototype.options.messages[i]||(u=t.isFunction(r)?r(n):r),r=t.isFunction(r)?r(n):r,t.format(n.attr(t.attr(i+"-msg"))||n.attr("validationMessage")||u||n.attr("title")||r||"",e,n.attr(i)||n.attr(t.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(b)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.userevents",["kendo.core"],n)}(function(){return 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,c=t.Class,l=t.Observable,u=n.now,f=n.extend,a=i.mobileOS,et=a&&a.android,v=800,y=i.browser.msie?5:0,p="press",w="hold",b="select",k="start",o="move",s="end",d="cancel",e="tap",g="release",ot="gesturestart",nt="gesturechange",tt="gestureend",it="gesturetap",st={api:0,touch:0,mouse:9,pointer:9},ht=!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||!et)&&(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]}}),ct=c.extend({init:function(n,t,i){f(this,{x:new ut("X",i.location),y:new ut("Y",i.location),type:i.type,useClickAsTap:n.useClickAsTap,threshold:n.threshold||st[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(o,n)}},end:function(t){if(this.endTime=u(),!this._finished){if(this._finished=!0,this._trigger(g,t),this._moved)this._trigger(s,t);else if(!this.useClickAsTap){var r=null,i=null;n(t.target).is("td")&&(r=n(t.target).parent(),r!=null&&(i=r.data("ds-mlb-sel")));dsiCommon.isNullOrEmpty(r)||dsiCommon.isNullOrEmpty(i)?this._trigger(e,t):i.class.indexOf("ds-selected")==-1&&(i.class.indexOf("ds-unselected")>-1?(i.class=i.class.replace("ds-unselected",""),i.class.trim()==""&&r.removeData("ds-mlb-sel")):this._trigger(e,t))}clearTimeout(this._holdTimeout);this.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,et;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.useClickAsTap=!u.fastTap&&!i.delayedClick();h.eventNS=c;h.dsiStartTouch=!1;r=n(r).handler(h);l.fn.init.call(h);f(h,{element:r,surface:u.global&&ht?n(r[0].ownerDocument.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(h.useClickAsTap)r.on(t.applyEventMap("click",c),a,"_click");if((i.pointers||i.msPointers)&&(i.browser.version<11?(rt="pinch-zoom double-tap-zoom",r.css("-ms-touch-action",u.touchAction&&u.touchAction!="none"?rt+" "+u.touchAction:rt)):r.css("touch-action",u.touchAction||"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&&(ut=h.surface[0],et=n.proxy(h.preventIfMoving,h),ft(function(n){ut.addEventListener(n,et,!0)}));h.bind([p,w,e,k,o,s,g,d,ot,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 o:n=nt;break;case s:n=tt;break;case e: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;i.dsiStartTouch=!0;var 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 ct(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);this.dsiStartTouch=!1},_click:function(t){var i={touch:{initialTouch:t.target,target:n(t.currentTarget),endTime:u(),x:{location:t.pageX,client:t.clientX},y:{location:t.pageY,client:t.clientY}},x:t.pageX,y:t.pageY,target:n(t.currentTarget),event:t,type:"tap"};this.trigger("tap",i)&&t.preventDefault()},_eachTouch:function(n,t){var e=this;if(e.dsiStartTouch||dsiCommon.getElementFromPath(t,"handleObj.type")=="touchend"){for(var o={},s=h(t),c=e.touches,r,u,f,i=0;i<c.length;i++)r=c[i],o[r.id]=r;for(i=0;i<s.length;i++)u=s[i],f=o[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),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.draganddrop",["kendo.core","kendo.userevents"],n)}(function(){return 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 r=k(n),e=i._outerWidth,o=i._outerHeight,u=r.left+w(n,"borderLeftWidth")+w(n,"paddingLeft"),f=r.top+w(n,"borderTopWidth")+w(n,"paddingTop"),s=u+n.width()-e(t,!0),h=f+n.height()-o(t,!0);return{x:{min:u,max:s},y:{min:f,max:h}}}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];r&&!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 i,r;t.preventDefault();i=this._elementUnderCursor(t);this.options.autoScroll&&this._cursorElement!==i&&(this._scrollableParent=dt(i),this._cursorElement=i);this._lastEvent=t;this._processMovement(t,i);this.options.autoScroll&&this._scrollableParent[0]&&(r=gt(t.x.location,t.y.location,kt(this._scrollableParent)),this._scrollCompenstation=n.extend({},this.hintOffset),this._scrollVelocity=r,r.y===0&&r.x===0?(clearInterval(this._scrollInterval),this._scrollInterval=null):this._scrollInterval||(this._scrollInterval=setInterval(n.proxy(this,"_autoScroll"),50)));this.hint&&this._updateHint(t)},_processMovement:function(t,i){this._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})});this._trigger(ft,r(t,{dropTarget:e,elementUnderCursor:i}))},_autoScroll:function(){var n=this._scrollableParent[0],t=this._scrollVelocity,i=this._scrollCompenstation,h,r,u,e;if(n){h=this._elementUnderCursor(this._lastEvent);this._processMovement(this._lastEvent,h);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 c=n.scrollTop+t.y,o=r&&c>0&&c<n.scrollHeight,l=n.scrollLeft+t.x,s=u&&l>0&&l<n.scrollWidth;o&&(n.scrollTop+=t.y);s&&(n.scrollLeft+=t.x);this.hint&&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),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.mobile.scroller",["kendo.fx","kendo.draganddrop"],n)}(function(){return 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,{touchAction:"pan-y",fastTap:!0,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),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.groupable",["kendo.core","kendo.draganddrop"],n)}(function(){return function(n){function h(n){return n.position().top+3}var t=window.kendo,e=t.ui.Widget,f=t._outerWidth,u=n.proxy,i=!1,o=".kendoGroupable",c="change",l=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-i-sort-${(data.dir || "asc") == "asc" ? "asc-sm" : "desc-sm"}" title="(sorted ${(data.dir || "asc") == "asc" ? "ascending": "descending"})"><\/span>${data.title ? data.title: data.field}<\/a><a class="k-button k-button-icon k-bare"><span class="k-icon k-i-close"><\/span><\/a><\/div>',{useWithBlock:!1}),s=function(i){var r=i.attr(t.attr("title"));return r&&(r=t.htmlEncode(r)),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(r||i.attr(t.attr("field"))).prepend('<span class="k-icon k-drag-status k-i-cancel" />')},r=n('<div class="k-grouping-dropclue"/>'),a=e.extend({init:function(l,a){var v=this,k=t.guid(),w=u(v._intializePositions,v),y,b,p=v._dropCuePositions=[];e.fn.init.call(v,l,a);i=t.support.isRtl(l);b=i?"right":"left";v.draggable=y=v.options.draggable||new t.ui.Draggable(v.element,{filter:v.options.draggableElements,hint:s,group:k});v.groupContainer=n(v.options.groupContainer,v.element).kendoDropTarget({group:y.options.group,dragenter:function(n){v._canDrag(n.draggable.currentTarget)&&(n.draggable.hint.find(".k-drag-status").removeClass("k-i-cancel").addClass("k-i-plus"),r.css("top",h(v.groupContainer)).css(b,0).appendTo(v.groupContainer))},dragleave:function(n){n.draggable.hint.find(".k-drag-status").removeClass("k-i-plus").addClass("k-i-cancel");r.remove()},drop:function(u){var e=u.draggable.currentTarget,o=e.attr(t.attr("field")),s=e.attr(t.attr("title")),h=v.indicator(o),l=v._dropCuePositions,c=l[l.length-1],f;(e.hasClass("k-group-indicator")||v._canDrag(e))&&(c?(f=v._dropCuePosition(t.getOffset(r).left+parseInt(c.element.css("marginLeft"),10)*(i?-1:1)+parseInt(c.element.css("marginRight"),10)),f&&v._canDrop(n(h),f.element,f.left)&&(f.before?f.element.before(h||v.buildIndicator(o,s)):f.element.after(h||v.buildIndicator(o,s)),v._change())):(v.groupContainer.append(v.buildIndicator(o,s)),v._change()))}}).kendoDraggable({filter:"div.k-group-indicator",hint:s,group:y.options.group,dragcancel:u(v._dragCancel,v),dragstart:function(n){var t=n.currentTarget,e=parseInt(t.css("marginLeft"),10),u=t.position(),o=i?u.left-e:u.left+f(t);w();r.css({top:h(v.groupContainer),left:o}).appendTo(v.groupContainer);this.hint.find(".k-drag-status").removeClass("k-i-cancel").addClass("k-i-plus")},dragend:function(){v._dragEnd(this)},drag:u(v._drag,v)}).on("click"+o,".k-button",function(t){t.preventDefault();v._removeIndicator(n(this).parent())}).on("click"+o,".k-link",function(i){var r=n(this).parent(),u=v.buildIndicator(r.attr(t.attr("field")),r.attr(t.attr("title")),r.attr(t.attr("dir"))=="asc"?"desc":"asc");r.before(u).remove();v._change();i.preventDefault()});y.bind(["dragend","dragcancel","dragstart","drag"],{dragend:function(){v._dragEnd(this)},dragcancel:u(v._dragCancel,v),dragstart:function(n){var t,i,r;if(!v.options.allowDrag&&!v._canDrag(n.currentTarget)){n.preventDefault();return}w();p.length?(t=p[p.length-1].element,i=parseInt(t.css("marginRight"),10),r=t.position().left+f(t)+i):r=0},drag:u(v._drag,v)});v.dataSource=v.options.dataSource;v.dataSource&&v._refreshHandler?v.dataSource.unbind(c,v._refreshHandler):v._refreshHandler=u(v.refresh,v);v.dataSource&&(v.dataSource.bind("change",v._refreshHandler),v.refresh())},refresh:function(){var i=this,r=i.dataSource;i.groupContainer&&i.groupContainer.empty().append(n.map(r.group()||[],function(r){if(!dsiCommon.isNullOrEmpty(i.dataSource.options.dsi)&&r.field==i.dataSource.options.dsi.dsThis.detailSetGroupingID)return"";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;e.fn.destroy.call(n);n.groupContainer.off(o);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},events:["change"],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 l({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,t;if(n.dataSource){if(t=n.descriptors(),n.trigger("change",{groups:t})){n.refresh();return}n.dataSource.group(t)}},_dropCuePosition:function(t){var e=this._dropCuePositions;if(r.is(":visible")&&e.length!==0){t=Math.ceil(t);var u=e[e.length-1],h=u.left,c=u.right,o=parseInt(u.element.css("marginLeft"),10),s=parseInt(u.element.css("marginRight"),10);return t>=c&&!i||t<h&&i?t={left:u.element.position().left+(i?-o:f(u.element)+s),element:u.element,before:!1}:(t=n.grep(e,function(n){return n.left<=t&&t<=n.right||i&&t>n.right})[0],t&&(t={left:i?t.element.position().left+f(t.element)+s:t.element.position().left-o,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+f(r),10),element:r}})},_invalidateGroupContainer:function(){var n=this.groupContainer;n&&n.is(":empty")&&n.html(this.options.messages.empty)}});t.ui.plugin(a)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.reorderable",["kendo.core","kendo.draganddrop"],n)}(function(){return function(n){function e(t,i){t=n(t);i?t.find(".k-drag-status").removeClass("k-i-plus").addClass("k-i-cancel"):t.find(".k-drag-status").removeClass("k-i-cancel").addClass("k-i-plus")}var t=window.kendo,u=t._outerWidth,o=t._outerHeight,i=t.getOffset,r=t.ui.Widget,f="change",s="k-reorderable",h=r.extend({init:function(h,c){var l=this,a,v=t.guid()+"-reorderable";r.fn.init.call(l,h,c);h=l.element.addClass(s);c=l.options;l.draggable=a=c.draggable||new t.ui.Draggable(h,{group:v,autoScroll:!0,filter:c.filter,hint:c.hint});l.reorderDropCue=n('<div class="k-reorder-cue"><\/div><\/div>');h.find(a.options.filter).kendoDropTarget({group:a.options.group,dragenter:function(n){var t,r,f,s;l._draggable&&(t=this.element,f=!l._dropTargetAllowed(t)||l._isLastDraggable(),e(n.draggable.hint,f),f||(r=i(t),s=r.left,c.inSameContainer&&!c.inSameContainer({source:t,target:l._draggable,sourceIndex:l._index(t),targetIndex:l._index(l._draggable)})?l._dropTarget=t:l._index(t)>l._index(l._draggable)&&(s+=u(t)),l.reorderDropCue.css({height:o(t),top:r.top,left:s}).appendTo(document.body)))},dragleave:function(n){e(n.draggable.hint,!0);l.reorderDropCue.remove();l._dropTarget=null},drop:function(){if(l._dropTarget=null,l._draggable){var n=this.element,t=l._draggable;l._dropTargetAllowed(n)&&!l._isLastDraggable()&&l.trigger(f,{element:l._draggable,target:n,oldIndex:l._index(t),newIndex:l._index(n),position:i(l.reorderDropCue).left>i(n).left?"after":"before"})}}});a.bind(["dragcancel","dragend","dragstart","drag"],{dragcancel:function(){l.reorderDropCue.remove();l._draggable=null;l._elements=null},dragend:function(){l.reorderDropCue.remove();l._draggable=null;l._elements=null},dragstart:function(n){l._draggable=n.currentTarget;l._elements=l.element.find(l.draggable.options.filter)},drag:function(n){if(l._dropTarget&&!this.hint.find(".k-drag-status").hasClass("k-i-cancel")){var t=i(l._dropTarget).left,r=u(l._dropTarget);n.pageX>t+r/2?l.reorderDropCue.css({left:t+r}):l.reorderDropCue.css({left:t})}}})},options:{name:"Reorderable",filter:"*"},events:[f],_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(h)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.resizable",["kendo.core","kendo.draganddrop"],n)}(function(){return 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(t.draggableElement||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),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.sortable",["kendo.draganddrop"],n)}(function(){return function(n){function p(t,i){try{return n.contains(t,i)||t==i}catch(r){return!1}}function w(n){return n.clone()}function b(n){return n.clone().removeAttr("id").css("visibility","hidden")}var t=window.kendo,r=t.ui.Widget,e=t._outerWidth,o=t._outerHeight,s="start",h="beforeMove",c="move",i="end",u="change",l="cancel",a="sort",v="remove",y="receive",f=-1,k=r.extend({init:function(n,t){var i=this;r.fn.init.call(i,n,t);i.options.placeholder||(i.options.placeholder=b);i.options.hint||(i.options.hint=w);i.draggable=i._createDraggable()},events:[s,h,c,i,u,l],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,e=this.options.handler,u=this.options.placeholder,o=this.placeholder=t.isFunction(u)?n(u.call(this,r)):n(u);f&&r.is(f)?i.preventDefault():e&&!n(i.initialTarget).is(e)?i.preventDefault():this.trigger(s,{item:r,draggableEvent:i})?i.preventDefault():(r.css("display","none"),r.before(o),this._setCursor())},_dragcancel:function(){this._cancel();this.trigger(l,{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},e,o={x:t.x.delta,y:t.y.delta},u,f,a,h=this.options.axis,r=this.options.moveOnDragEnter,s={item:v,list:this,draggableEvent:t};if(h==="x"||h==="y"){this._movementByAxis(h,l,o[h],s);return}if(i){if(c=this._getElementCenter(i.element),e={left:Math.round(l.left-c.left),top:Math.round(l.top-c.top)},n.extend(s,{target:i.element}),i.appendToBottom){this._movePlaceholder(i,null,s);return}if(i.appendAfterHidden&&this._movePlaceholder(i,"next",s),this._isFloating(i.element)?o.x<0&&r||!r&&e.left<0?u="prev":(o.x>0&&r||!r&&e.left>0)&&(u="next"):o.y<0&&r||!r&&e.top<0?u="prev":(o.y>0&&r||!r&&e.top>0)&&(u="next"),u){for(a=u==="prev"?jQuery.fn.prev:jQuery.fn.next,f=a.call(i.element);f.length&&!f.is(":visible");)f=a.call(f);f[0]!=this.placeholder[0]&&this._movePlaceholder(i,u,s)}}},_dragend:function(t){var s=this.placeholder,r=this.draggedElement,c=this.indexOf(r),l=this.indexOf(s),w=this.options.connectWith,o,p,e,h;if(this._resetCursor(),e={action:a,item:r,oldIndex:c,newIndex:l,draggableEvent:t},l>=0?p=this.trigger(i,e):(o=s.parents(w).getKendoSortable(),e.action=v,h=n.extend({},e,{action:y,oldIndex:f,newIndex:o.indexOf(s)}),p=!(!this.trigger(i,e)&&!o.trigger(i,h))),p||l===c){this._cancel();return}s.replaceWith(r);r.show();this.draggable.dropped=!0;e={action:this.indexOf(r)!=f?a:v,item:r,oldIndex:c,newIndex:this.indexOf(r),draggableEvent:t};this.trigger(u,e);o&&(h=n.extend({},e,{action:y,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 p(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,s;return r=t.getOffset(u),r.top+=o(u),r.left+=e(u),s=this._isFloating(u)?r.left-f.left:r.top-f.top,s<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(h,i)||(t?t==="prev"?n.element.before(r):t==="next"&&n.element.after(r):n.element.append(r),n.sortable.trigger(c,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+=o(n)/2,i.left+=e(n)/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(k)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.selectable",["kendo.core","kendo.userevents"],n)}(function(){return function(n){function w(n,t){if(!n.is(":visible"))return!1;var r=i.getOffset(n),u=t.left+t.width,f=t.top+t.height;return r.right=r.left+i._outerWidth(n),r.bottom=r.top+i._outerHeight(n),!(r.left>u||r.right<t.left||r.top>f||r.bottom<t.top)}var i=window.kendo,h=i.ui.Widget,u=n.proxy,l=Math.abs,a="aria-selected",t="k-state-selected",f="k-state-selecting",e="k-selectable",o="change",p=".kendoSelectable",r="k-state-unselecting",s="input,a,textarea,.k-multiselect-wrap,select,button,.k-button>span,.k-button>img,span.k-icon.k-i-arrow-60-down,span.k-icon.k-i-arrow-60-up",v=i.support.browser.msie,y=!1,c;(function(n){(function(){n('<div class="parent"><span /><\/div>').on("click",">*",function(){y=!0}).find("span").click().end().off()})()})(n);c=h.extend({init:function(t,r){var f=this,o;h.fn.init.call(f,t,r);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;s=f.options.inputSelectors;this.options.aria&&o&&f.element.attr("aria-multiselectable",!0);f.userEvents=new i.UserEvents(f.element,{global:!0,allowSelection:!0,filter:(y?"":"."+e+" ")+f.options.filter,tap:u(f._tap,f),touchAction:o?"none":"pan-x pan-y"});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:">*",inputSelectors:s,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),u=u.add(r.relatedTarget(u)),a?r.selectRange(r._firstSelectee(),u,i):(h&&f?(r._unselect(u),r._notify(o,i)):(s&&f||r.clear(),r.value(u)),r._lastActive=r._downTarget=u))},_start:function(i){var u=this,f=n(i.target),h=f.hasClass(t),o,s=i.event.ctrlKey||i.event.metaKey;if(this._allowSelection(i.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));i.sender.capture();u._marquee.appendTo(document.body).css({left:i.x.client+1,top:i.y.client+1,width:0,height:0});s||u.clear();f=f.add(u.relatedTarget(f));h&&(u._selectElement(f,!0),s&&f.addClass(r))}},_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:l(n.x.initialDelta),height:l(n.y.initialDelta)};t._marquee.css(i);t._invalidateSelectables(i,n.event.ctrlKey||n.event.metaKey);n.preventDefault()},_end:function(n){var t=this,i;t._marquee.remove();t._unselect(t.element.find(t.options.filter).filter("."+r)).removeClass(r);i=t.element.find(t.options.filter).filter("."+f);i=i.add(t.relatedTarget(i));t.value(i,n);t._lastActive=t._downTarget;t._items=null},_invalidateSelectables:function(n,i){var s,l,a=this._downTarget[0],h=this._items,o,u,e=h.index(a),c=e+40;for(e=e-40,e<0&&(e=0),c>h.length&&(c=h.length),s=e,l=c;s<l;s++)u=h.eq(s),o=u.add(this.relatedTarget(u)),w(u,n)?u.hasClass(t)?i&&a!==u[0]&&o.removeClass(t).addClass(r):u.hasClass(f)||u.hasClass(r)||o.addClass(f):u.hasClass(f)?o.removeClass(f):i&&u.hasClass(r)&&o.removeClass(r).addClass(t)},value:function(n,r){var f=this,c=u(f._selectElement,f),e,s,h;if(n){n.each(function(){c(this)});e=n.find("td").first();s=n.closest(".k-grid");s.length>0&&(s.data("kendoGrid").current(e),h=e.closest("table.k-selectable"),h.length>0&&i.focusElement(h));f._notify(o,r);return}return f.options.itemsFilter?f.element.find(f.options.itemsFilter).filter("."+t):f.element.find(f.options.filter).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(a,!0))},_notify:function(n,t){return t=t||{},this.trigger(n,t)},_unselect:function(n){return n.removeClass(t),n.removeData("ds-mlb-sel"),this.options.aria&&n.attr(a,!1),n},_select:function(t){this._allowSelection(t.event.target)&&(v&&(!v||n(i._activeElement()).is(s))||t.preventDefault())},_allowSelection:function(t){return n(t).is(s)?(this.userEvents.cancel(),this._downTarget=null,!1):!0},resetTouchEvents:function(){this.userEvents.cancel()},clear:function(){var n=this.element.find("."+t);this._unselect(n)},selectRange:function(t,i,r){var u=this,e,s,f;for(u.clear(),u.element.length>1&&(f=u.options.continuousItems()),f&&f.length||(f=u.element.find(u.options.filter),u.options.filter.indexOf(".dsi-selectable-row")!=-1&&(f=f.filter(":visible"))),t=n.inArray(n(t)[0],f),i=n.inArray(n(i)[0],f),t>i&&(s=t,t=i,i=s),u.options.useAllItems||(i+=u.element.length-1),e=t;e<=i;e++)u._selectElement(f[e]);u._notify(o,r)},destroy:function(){var n=this;h.fn.destroy.call(n);dsiCommon.isNullOrEmpty(n.element)||n.element.off(p);dsiCommon.isNullOrEmpty(n.userEvents)||n.userEvents.destroy();n._marquee=n._lastActive=n.element=n.userEvents=null}});c.parseOptions=function(n){var t=typeof n=="string"&&n.toLowerCase();return{multiple:t&&t.indexOf("multiple")>-1,cell:t&&t.indexOf("cell")>-1}};i.ui.plugin(c)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.button",["kendo.core"],n)}(function(){return 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-active",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(){if(this.options.enable){if(!dsiCommon.isNullOrEmpty(this.element.data())&&!dsiCommon.isNullOrEmpty(this.element.data().button)&&this.element.data().button.options.enable===!1)return!1;this.element.addClass(h)}},_blur:function(){this.element.removeClass(h)},_keydown:function(n){var t=this;(n.keyCode==e.ENTER||n.keyCode==e.SPACEBAR)&&(t.options.enable&&t.element.addClass(c),t._isNativeButton()||(n.keyCode==e.SPACEBAR&&n.preventDefault(),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().filter(function(){return!n(this).hasClass("k-sprite")&&!n(this).hasClass("k-icon")&&!n(this).hasClass("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),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.pager",["kendo.data"],n)}(function(){return function(n,t){function p(n,t,r,u,f){return n({idx:t,text:r,ns:i.ns,numeric:u,title:f||""})}function o(n,t,i){return it({className:n.substring(1),text:t,wrapClassName:i||""})}function s(t,r,u,f){if(dsiCommon.getElementFromPath(n(t).data("kendoPager"),"dataSource.options.dsi_hasAllPages.value")===!1){f&&r==".k-i-arrow-e"&&(f=!1);var e=t.find(".k-pager-info");dsiCommon.isNullOrEmpty(e.html())||e.html(e.html().replace(/\s\[\+\]/g,"")+" [+]")}t.find(r).parent().attr(i.attr("page"),u).attr("tabindex",-1).toggleClass("k-state-disabled",f)}function b(n,t){s(n,c,1,t<=1)}function k(n,t){s(n,a,Math.max(1,t-1),t<=1)}function d(n,t,i){s(n,v,Math.min(i,t+1),t>=i)}function g(n,t,i){s(n,l,i,t>=i)}var i=window.kendo,w=i.ui,h=w.Widget,u=n.proxy,c=".k-i-seek-w",l=".k-i-seek-e",a=".k-i-arrow-w",v=".k-i-arrow-e",r="change",f=".kendoPager",y="click",nt="keydown",tt="disabled",e=n(document.documentElement),it=i.template('<a href="\\#" aria-label="#=text#" title="#=text#" class="k-link k-pager-nav #= wrapClassName #"><span class="k-icon #= className #"><\/span><\/a>'),rt=h.extend({init:function(t,e){var s=this,w,p,tt,it;if(h.fn.init.call(s,t,e),e=s.options,s.dataSource=i.data.DataSource.create(e.dataSource),s.linkTemplate=i.template(s.options.linkTemplate),s.selectTemplate=i.template(s.options.selectTemplate),s.currentPageTemplate=i.template(s.options.currentPageTemplate),w=s.page(),p=s.totalPages(),s._refreshHandler=u(s.refresh,s),s.dataSource.bind(r,s._refreshHandler),e.attributes&&(dsiCommon.isNullOrEmpty(e.attributes["class"])||t.addClass(e.attributes["class"])),e.previousNext&&((dsiCommon.isNullOrEmpty(e.displayFirstLastPage)||e.displayFirstLastPage===!0)&&(s.element.find(c).length||(s.element.append(o(c,e.messages.first,"k-pager-first")),b(s.element,w,p))),s.element.find(a).length||(s.element.append(o(a,e.messages.previous,"dsi-pager-prev")),k(s.element,w,p))),e.numeric&&(s.list=s.element.find(".k-pager-numbers"),s.list.length||(s.list=n('<ul class="k-pager-numbers k-reset" />').appendTo(s.element))),e.input){s.element.find(".k-pager-input").length||s.element.append('<span class="k-pager-input k-label">'+e.messages.page+'<input class="k-textbox">'+i.format(e.messages.of,p)+"<\/span>");s.element.on(nt+f,".k-pager-input input",u(s._keydown,s))}if(e.previousNext&&(s.element.find(v).length||(s.element.append(o(v,e.messages.next,"dsi-pager-next")),d(s.element,w,p)),(dsiCommon.isNullOrEmpty(e.displayFirstLastPage)||e.displayFirstLastPage===!0)&&(s.element.find(l).length||(s.element.append(o(l,e.messages.last,"k-pager-last")),g(s.element,w,p)))),e.pageSizes){s.element.find(".k-pager-sizes").length||(tt=e.pageSizes.length?e.pageSizes:["all",5,10,20],it=n.map(tt,function(n){return n.toLowerCase&&n.toLowerCase()==="all"?"<option value='all'>"+e.messages.allPages+"<\/option>":"<option>"+n+"<\/option>"}),n('<span class="k-pager-sizes k-label"><select/>'+e.messages.itemsPerPage+"<\/span>").appendTo(s.element).find("select").html(it.join("")).end().appendTo(s.element));s.element.find(".k-pager-sizes select").val(s.pageSize());i.ui.DropDownList&&s.element.find(".k-pager-sizes select").show().kendoDropDownList();s.element.on(r+f,".k-pager-sizes select",u(s._change,s))}if(e.refresh){s.element.find(".k-pager-refresh").length||s.element.append('<a href="#" class="k-pager-refresh k-link" title="'+e.messages.refresh+'" aria-label="'+e.messages.refresh+'"><span class="k-icon k-i-reload"><\/span><\/a>');s.element.on(y+f,".k-pager-refresh",u(s._refreshClick,s))}e.info&&(s.element.find(".k-pager-info").length||s.element.append('<span class="k-pager-info k-label" />'));s.element.on(y+f,"a",u(s._click,s)).addClass("k-pager-wrap k-widget k-floatwrap");s.element.on(y+f,".k-current-page",u(s._toggleActive,s));e.autoBind&&s.refresh();i.notify(s)},destroy:function(){var n=this;h.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(t){var r=this,a,h,o=1,w,u=r.page(),s="",f=r.options,l=r.pageSize(),v=r.dataSource.total(),c=r.totalPages(),nt=r.linkTemplate,y=f.buttonCount;if(e.unbind(r.downEvent,n.proxy(r._hideList,r)),!t||t.action!="itemchange"){if(f.numeric){u>y&&(w=u%y,o=w===0?u-y+1:u-w+1);h=Math.min(o+y-1,c);var ut=n(r.list).find("li:not(.k-current-page)"),it=+ut.first().children().first().text(),rt=+ut.last().children().first().text();for(u>=it&&u<=rt?(o=it,h=rt):u<it?(o=u,h=o+y-1):u>rt&&(h=u,o=h-y+1),o<1&&(o=1),h>c&&(h=c),(dsiCommon.isNullOrEmpty(f.displayMorePages)||f.displayMorePages===!0)&&o>1&&(s+=p(nt,o-1,"...",!1,f.messages.morePages)),a=o;a<=h;a++)s+=p(a==u?r.selectTemplate:nt,a,a,!0);(dsiCommon.isNullOrEmpty(f.displayMorePages)||f.displayMorePages===!0)&&h<c&&(s+=p(nt,a,"...",!1,f.messages.morePages));s===""&&(s=r.selectTemplate({text:0}));s=this.currentPageTemplate({text:u})+s;r.list.removeClass("k-state-expanded").html(s)}if(f.info&&(s=v>0?i.format(f.messages.display,r.dataSource.options.endless?1:Math.min((u-1)*l+1,v),Math.min(u*l,v),v):f.messages.empty,r.element.find(".k-pager-info").html(s)),f.input&&r.element.find(".k-pager-input").html(r.options.messages.page+'<input class="k-textbox" aria-label="'+u+'">'+i.format(f.messages.of,c)).find("input").val(u).attr(tt,v<1).toggleClass("k-state-disabled",v<1),f.previousNext&&(b(r.element,u,c),k(r.element,u,c),d(r.element,u,c),g(r.element,u,c)),f.pageSizes){var et=r.element.find(".k-pager-sizes option[value='all']").length>0,ot=et&&l===this.dataSource.total(),ft=l;r.element.find(".k-pager-sizes").find(".k-input").text()==f.messages.allPages&&(l="all",ft=f.messages.allPages,this.dataSource.pageSize()!=this.dataSource.total()&&this.dataSource.pageSize(this.dataSource.total()));r.element.find(".k-pager-sizes select").val(l).attr("aria-label",l).filter("["+i.attr("role")+"=dropdownlist]").kendoDropDownList("value",l).kendoDropDownList("text",ft)}}},_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(){var t=this;t.list.hasClass("k-state-expanded")?e.unbind(t.downEvent,n.proxy(t._hideList,t)):e.bind(t.downEvent,n.proxy(t._hideList,t));t.list.toggleClass("k-state-expanded")},_hideList:function(t){var r=this,u=i.eventTarget(t);n.contains(r.list[0],u)||(e.unbind(r.downEvent,n.proxy(r._hideList,r)),r.list.removeClass("k-state-expanded"))},_click:function(t){var f=n(t.currentTarget),u,r,e;if(t.preventDefault(),!f.is(".k-state-disabled")){if(u=f.attr(i.attr("page")),r=f.closest(".panel-body").find(".k-listview"),r.length>0){if(r=r.data("kendoListView"),dsiCommon.isNullOrEmpty(r.dsi))r.dsi={};else if(r.dsi.navigated==!1)return;r.dsi.navigated=!1;setTimeout(function(){r.dsi.navigated=!0},100);e=r.dataSource.page(u);t.stopPropagation()}else e=this.page(u);u!=e&&t.stopPropagation()}},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){if(this.dataSource.page()==n)return this.dataSource.page();var i=dsiCommon.getElementFromPath(this,"options.dataSource.options.dsi.dsThis.hasAllPages.value");if(i==!1&&this.options.dataSource._data.length<this.options.dataSource.pageSize()*n)return n;if(this.trigger("pageChange",{index:n}))return;this.dataSource.page(n);this.trigger(r,{index:n})}else return this.dataSource.total()>0?this.dataSource.page():0}});w.plugin(rt)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.notification",["kendo.core","kendo.popup"],n)}(function(){return function(n,t){var r=window.kendo,s=r.ui.Widget,g=n.proxy,h=n.extend,f=window.setTimeout,y="click",p="show",w="hide",a="k-notification",e=".k-notification-wrap .k-i-close",v="k-hiding",b="info",nt="success",tt="warning",it="error",i="top",o="left",c="bottom",l="right",k="up",u=".kendoNotification",rt='<div class="k-widget k-popup k-notification"><\/div>',d='<div class="k-notification-wrap"><span class="k-icon k-i-#=typeIcon#" title="#=typeIcon#"><\/span>#=content#<span class="k-icon k-i-close" title="Hide"><\/span><\/div>',ut=d.replace("#=content#","#:content#"),ft=s.extend({init:function(t,i){var u=this;s.fn.init.call(u,t,i);i=u.options;i.appendTo&&n(i.appendTo).is(t)||u.element.hide();u._compileTemplates(i.templates);u._guid="_"+r.guid();u._isRtl=r.support.isRtl(t);u._compileStacking(i.stacking,i.position.top,i.position.left);r.notify(u)},events:[p,w],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 i=this,u=r.template;i._compiled={};n.each(t,function(t,r){i._compiled[r.type]=u(r.template||n("#"+r.templateId).html())});i._defaultCompiled=u(d);i._safeCompiled=u(ut)},_getCompiled:function(n,t){var i=t?this._safeCompiled:this._defaultCompiled;return n?this._compiled[n]||i:i},_compileStacking:function(n,t,r){var h=this,f={paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0},u=r!==null?o:l,e,s;switch(n){case"down":e=c+" "+u;s=i+" "+u;delete f.paddingBottom;break;case l:e=i+" "+l;s=i+" "+o;delete f.paddingRight;break;case o:e=i+" "+o;s=i+" "+l;delete f.paddingLeft;break;case k:e=i+" "+u;s=c+" "+u;delete f.paddingTop;break;default:t!==null?(e=c+" "+u,s=i+" "+u,delete f.paddingBottom):(e=i+" "+u,s=c+" "+u,delete f.paddingTop)}h._popupOrigin=e;h._popupPosition=s;h._popupPaddings=f},_attachPopupEvents:function(n,t){function r(n){n.on(y+u,function(){h._hidePopup(t)})}var h=this,i=n.allowHideAfter,s=!isNaN(i)&&i>0,o;n.hideOnClick?t.bind("activate",function(){s?f(function(){r(t.element)},i):r(t.element)}):n.button&&(o=t.element.find(e),s?f(function(){r(o)},i):r(o))},_showPopup:function(t,i){var o=this,y=i.autoHideAfter,l=i.position.left,a=i.position.top,s,c;c=n("."+o._guid+":not(."+v+")").last();s=new r.ui.Popup(t,{anchor:c[0]?c:document.body,origin:o._popupOrigin,position:o._popupPosition,animation:i.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(i,s);t.removeClass("k-group k-reset");c[0]?s.open():(l===null&&(l=n(window).width()-t.width()-i.position.right),a===null&&(a=n(window).height()-t.height()-i.position.bottom),s.open(l,a));s.wrapper.addClass(o._guid).css(h({margin:0,zIndex:10050},o._popupPaddings));i.position.pinned?(s.wrapper.css("position","fixed"),c[0]&&o._togglePin(s.wrapper,!0)):c[0]||o._togglePin(s.wrapper,!1);y>0&&f(function(){o._hidePopup(s)},y)},_hidePopup:function(n){n.wrapper.addClass(v);n.close()},_togglePin:function(t,r){var u=n(window),f=r?-1:1;t.css({top:parseInt(t.css(i),10)+f*u.scrollTop(),left:parseInt(t.css(o),10)+f*u.scrollLeft()})},_attachStaticEvents:function(n,t){function r(n){n.on(y+u,g(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==k||t.stacking==o?"prependTo":"appendTo";n.removeClass("k-popup").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(h(this.options.animation.close||!1,{complete:function(){n.off(u).find(e).off(u);n.remove()}}));this._triggerHide(n)},_triggerHide:function(n){this.trigger(w,{element:n});this.angular("cleanup",function(){return{elements:n}})},show:function(i,u,f){var e=this,o=e.options,s=n(rt),c,l;return u||(u=b),i!==null&&i!==t&&i!==""&&(r.isFunction(i)&&(i=i()),l={typeIcon:u,content:""},c=n.isPlainObject(i)?h(l,i):h(l,{content:i}),s.addClass(a+"-"+u).toggleClass(a+"-button",o.button).attr("data-role","alert").css({width:o.width,height:o.height}).append(e._getCompiled(u,f)(c)),e.angular("compile",function(){return{elements:s,data:[{dataItem:c}]}}),n(o.appendTo)[0]?e._showStatic(s,o):e._showPopup(s,o),e.trigger(p,{element:s})),e},showText:function(n,t){this.show(n,t,!0)},info:function(n){return this.show(n,b)},success:function(n){return this.show(n,nt)},warning:function(n){return this.show(n,tt)},error:function(n){return this.show(n,it)},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+":not(."+v+")");return t.options.appendTo?i:i.children("."+a)},setOptions:function(n){var r=this,i;s.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(){s.fn.destroy.call(this);this.getNotifications().off(u).find(e).off(u)}});r.ui.plugin(ft)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.tooltip",["kendo.core","kendo.popup"],n)}(function(){return function(n){function b(n){while(n.length){if(ot(n))break;n=n.parent()}}function ot(n){var i=n.data(t.ns+"title");if(i)return n.attr("title",i),n.removeData(t.ns+"title"),!0}function st(n){var i=n.attr("title");if(i)return n.data(t.ns+"title",i),n.attr("title",""),!0}function s(n){while(n.length&&!n.is("body")){if(st(n))break;n=n.parent()}}var t=window.kendo,u=t.ui.Widget,k=t.ui.Popup,d=t.isFunction,g=n.isPlainObject,h=n.extend,r=n.proxy,f=n(document),nt=t.isLocalUrl,c="_tt_active",l="aria-describedby",a="show",v="hide",y="error",e="contentLoad",p="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" title="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"},w={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));if(!this._isShownOnFocus())f.element.on("mouseenter"+i,f.options.filter,r(f._mouseenter,f));if(this.options.autoHide&&!this._isShownOnFocus())f.element.on("mouseleave"+i,f.options.filter,r(f._mouseleave,f));if(this.options.autoHide&&this._isShownOnFocus())f.element.on("blur"+i,f.options.filter,r(f._blur,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:{duration:40,hide:!0}}},events:[a,v,e,y,p],_isShownOnFocus:function(){return this.options.showOn&&this.options.showOn.match(/focus/)},_mouseenter:function(t){s(n(t.currentTarget))},_showOn:function(t){var i=this,r=n(t.currentTarget);i.options.showOn&&i.options.showOn.match(/click/)?i._show(r):i._isShownOnFocus()?(s(r),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(p,{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(h({type:"GET",dataType:"html",cache:!1,error:function(n,r){t.ui.progress(i.content,!1);i.trigger(y,{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;s(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(){b(n);n.removeAttr(l);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:w[e.position],autoHide:e.autoHide}));if(u.popup=new k(o,h({activate:function(){var t=this.options.anchor,n=t[0].id||u.element[0].id;n&&(t.attr(l,n+c),this.element.attr("id",n+c));e.callout&&u._positionCallout();this.element.removeAttr("aria-hidden");f.on("keydown"+i,u._documentKeyDownHandler);u.trigger(a)},close:function(){u.trigger(v)},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&&!this._isShownOnFocus())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(n){this._closePopup(n.currentTarget);clearTimeout(this.timeout)},_blur:function(n){this._closePopup(n.currentTarget)},_closePopup:function(t){this.popup?this.popup.close():b(n(t))},_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=w[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),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.list",["kendo.data","kendo.popup"],n)}(function(){return function(n,t){function k(n,i){return n!==t&&n!==""&&n!==null&&(i==="boolean"?n=Boolean(n):i==="number"?n=Number(n):i==="string"&&(n=n.toString())),n}function s(n){return n[n.length-1]}function d(n){var t=n.selectedIndex;return t>-1?n.options[t]:{}}function ii(n,t){var h=t.length,e=n.length,r,f,i,u,o=[],s=[];if(e)for(i=0;i<e;i++){for(r=n[i],f=!1,u=0;u<h;u++)if(r===t[u]){f=!0;o.push({index:i,item:r});break}f||s.push(r)}return{changed:o,unchanged:s}}function pt(t){return!t||n.isEmptyObject(t)?!1:t.filters&&!t.filters.length?!1:!0}function g(t,i){var u,r=!1;return t.filters&&(u=n.grep(t.filters,function(n){return r=g(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,a=i.ui,nt=i._outerWidth,tt=i._outerHeight,e=a.Widget,f=i.keys,o=i.support,wt=i.htmlEncode,it=i._activeElement,bt=i.data.ObservableArray,v="id",u="change",rt="k-state-focused",p="k-state-hover",ut="k-i-loading",ft="k-hidden",et=".k-group-header",kt="_label",ot="open",st="close",y="cascade",w="select",ht="selected",ct="requestStart",lt="requestEnd",at="width",h=n.extend,r=n.proxy,dt=n.isArray,b=o.browser,vt=b.msie,gt=vt&&b.version<9,ni=/"/g,ti={ComboBox:"DropDownList",DropDownList:"ComboBox"},c=i.ui.DataBoundWidget.extend({init:function(t,i){var u=this,o=u.ns,f;e.fn.init.call(u,t,i);t=u.element;i=u.options;u._isSelect=t.is(w);u._isSelect&&u.element[0].length&&(i.dataSource||(i.dataTextField=i.dataTextField||"text",i.dataValueField=i.dataValueField||"value"));u.ul=n('<ul unselectable="on" class="k-list k-reset"/>').attr({tabIndex:-1,"aria-hidden":!0});u.list=n("<div class='k-list-container'/>").append(u.ul).on("mousedown"+o,r(u._listMousedown,u));f=t.attr(v);f&&(u.list.attr(v,f+"-list"),u.ul.attr(v,f+"_listbox"));u._header();u._noData();u._footer();u._accessors();u._initValue()},options:{valuePrimitive:!1,footerTemplate:"",headerTemplate:"",noDataTemplate:"No data found."},setOptions:function(n){e.fn.setOptions.call(this,n);n&&n.enable!==t&&(n.enabled=n.enable);this._header();this._noData();this._footer();this._renderFooter();this._renderNoData()},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(t){var u=this,f=u.options,e=f.virtual,o=r(u._listBound,u);return e=typeof e=="object"?e:{},t=n.extend({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")},dataBound:o,height:f.height,dataValueField:f.dataValueField,dataTextField:f.dataTextField,groupTemplate:f.groupTemplate,fixedGroupTemplate:f.fixedGroupTemplate,template:f.template,dsDoNotDisableFields:f.dsDoNotDisableFields},t,e),t.template||(t.template="#:"+i.expr(t.dataTextField,"data")+"#"),f.$angular&&(t.$angular=f.$angular),t},_initList:function(){var n=this,t=n._listOptions({selectedItemChange:r(n._listChange,n)});n.listView=n.options.virtual?new i.ui.VirtualList(n.ul,t):new i.ui.StaticList(n.ul,t);n.listView.bind("listBound",r(n._listBound,n));n._setListValue()},_setListValue:function(n){n=n||this.options.value;n!==t&&this.listView.value(n).done(r(this._updateSelectionState,this))},_updateSelectionState:n.noop,_listMousedown:function(n){this.filterInput&&this.filterInput[0]===n.target||n.preventDefault()},_isFilterEnabled:function(){var n=this.options.filter;return n&&n!=="none"},_hideClear:function(){var n=this;n._clear&&this._clear.addClass(ft)},_showClear:function(){var n=this;n._clear&&this._clear.removeClass(ft)},_clearValue:function(){this._clearText();this._accessor("");this.listView.value([]);this._isFilterEnabled()&&!this.options.enforceMinLength&&this._filter({word:"",open:!1});this._change()},_clearText:function(){this.text("")},_clearFilter:function(){this.options.virtual||this.listView.bound(!1);this._filterSource()},_filterSource:function(n,t){var f=this,s=f.options,i=f.dataSource,u=h({},i.filter()||{}),e=n||u.filters&&u.filters.length&&!n,c=g(u,s.dataTextField),r,o;(n||c)&&f.trigger("filtering",{filter:n})||(r={filters:[],logic:"and"},pt(n)&&r.filters.push(n),pt(u)&&(r.logic===u.logic?r.filters=r.filters.concat(u.filters):r.filters.push(u)),f._cascading&&this.listView.setDSFilter(r),o=h({},{page:e?1:i.page(),pageSize:e?i.options.pageSize:i.pageSize(),sort:i.sort(),filter:i.filter(),group:i.group(),aggregate:i.aggregate()},{filter:r}),i[t?"read":"query"](i._mergeState(o)))},_angularElement:function(n,t){n&&this.angular(t,function(){return{elements:n}})},_noData:function(){var r=n(this.noData),t=this.options.noDataTemplate;if(this.angular("cleanup",function(){return{elements:r}}),i.destroy(r),r.remove(),!t){this.noData=null;return}this.noData=n('<div class="k-nodata" style="display:none"><div><\/div><\/div>').appendTo(this.list);this.noDataTemplate=typeof t!="function"?i.template(t):t},_renderNoData:function(){var n=this.noData;n&&(this._angularElement(n,"cleanup"),n.children(":first").html(this.noDataTemplate({instance:this})),this._angularElement(n,"compile"))},_toggleNoData:function(t){n(this.noData).toggle(t)},_toggleHeader:function(n){var t=this.listView.content.prev(et);t.toggle(n)},_footer:function(){var r=n(this.footer),t=this.options.footerTemplate;if(this._angularElement(r,"cleanup"),i.destroy(r),r.remove(),!t){this.footer=null;return}this.footer=n('<div class="k-footer"><\/div>').appendTo(this.list);this.footerTemplate=typeof t!="function"?i.template(t):t},_renderFooter:function(){var n=this.footer;n&&(this._angularElement(n,"cleanup"),n.html(this.footerTemplate({instance:this})),this._angularElement(n,"compile"))},_header:function(){var t=n(this.header),r=this.options.headerTemplate,u;if(this._angularElement(t,"cleanup"),i.destroy(t),t.remove(),!r){this.header=null;return}u=typeof r!="function"?i.template(r):r;t=n(u({}));this.header=t[0]?t:null;this.list.prepend(t);this._angularElement(this.header,"compile")},_allowOpening:function(){return this.options.noDataTemplate||this.dataSource.flatView().length},_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)},_filter:function(n){var t=this,i=t.options,r=i.ignoreCase,u=i.dataTextField,f={value:r?n.word.toLowerCase():n.word,field:u,operator:i.filter,ignoreCase:r};t._open=n.open;t._filterSource(f)},_clearButton:function(){this._clear||(this._clear=n('<span unselectable="on" class="k-icon k-clear-value k-i-close" title="clear"><\/span>').attr({role:"button",tabIndex:-1}));this.options.clearButton||this._clear.remove()},search:function(n){var t=this.options;n=typeof n=="string"?n:this._inputValue();clearTimeout(this._typingTimeout);(!t.enforceMinLength&&!n.length||n.length>=t.minLength)&&(this._state="filter",this._isFilterEnabled()?this._filter({word:n,open:!0}):this._searchByWord(n))},current:function(n){return this._focus(n)},items:function(){return this.ul[0].children},destroy:function(){var n=this,t=n.ns;e.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",i._isFilterEnabled()?"polite":"off");i._ariaLabel()},_ariaLabel:function(){var r=this,t=r._focused,i=r.element,f=i.attr("id"),u=n('label[for="'+f+'"]'),e=i.attr("aria-label"),o=i.attr("aria-labelledby"),s;t!==i&&(e?t.attr("aria-label",e):o?t.attr("aria-labelledby",o):u.length&&(s=u.attr("id")||r._generateLabelId(u,f),t.attr("aria-labelledby",s)))},_generateLabelId:function(n,t){var i=t+kt;return n.attr("id",i),i},_blur:function(){var n=this;n._change();n.close()},_change:function(){var n=this,r=n.selectedIndex,e=n.options.value,i=n.value(),f;n._isSelect&&!n.listView.bound()&&e&&(i=e);i!==k(n._old,typeof i)?f=!0:r!==t&&r!==n._oldIndex&&(f=!0);f&&(n._old=i,n._oldIndex=r,n._typing||n.element.trigger(u),n.trigger(u));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+=tt(i,!0)}),t},_height:function(t){var r=this,f=r.list,i=r.options.height,s=r.popup.visible(),e,u,o;if(t||r.options.noDataTemplate){if(u=f.add(f.parent(".k-animation-container")).show(),!f.is(":visible")){u.hide();return}i=r.listView.content[0].scrollHeight>i?i:"auto";u.height(i);i!=="auto"&&(e=r._offsetHeight(),o=tt(n(r.footer))||0,i=i-e-o);r.listView.content.height(i);s||u.hide()}return i},_adjustListWidth:function(){var t=this.list,i=t[0].style.width,u=this.wrapper,n,r;if(t.data(at)||!i)return n=window.getComputedStyle?window.getComputedStyle(u[0],null):0,r=parseFloat(n&&n.width)||nt(u),n&&b.msie&&(r+=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight)+parseFloat(n.borderLeftWidth)+parseFloat(n.borderRightWidth)),i=t.css("box-sizing")!=="border-box"?r-(nt(t)-t.width()):r,t.css({fontFamily:u.css("font-family"),width:this.options.autoWidth?"auto":i,minWidth:i}).data(at,i),!0},_openHandler:function(n){this._adjustListWidth();this.trigger(ot)?n.preventDefault():(this._focused.attr("aria-expanded",!0),this.ul.attr("aria-hidden",!1))},_closeHandler:function(n){this.trigger(st)?n.preventDefault():(this._focused.attr("aria-expanded",!1),this.ul.attr("aria-hidden",!0))},_focusItem:function(){var n=this.listView,r=!n.focus(),i=s(n.select());i===t&&this.options.highlightFirst&&r&&(i=0);i!==t?n.focus(i):r&&n.scrollToIndex(0)},_calculateGroupPadding:function(n){var u=this.ul.children(".k-first:first"),t=this.listView.content.prev(et),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))},_calculatePopupHeight:function(n){var t=this._height(this.dataSource.flatView().length||n);this._calculateGroupPadding(t)},_resizePopup:function(n){if(!this.options.virtual)if(this.popup.element.is(":visible"))this._calculatePopupHeight(n);else this.popup.one("open",function(n){return r(function(){this._calculatePopupHeight(n)},this)}.call(this,n))},_popup:function(){var n=this;n.popup=new a.Popup(n.list,h({},n.options.popup,{anchor:n.wrapper,open:r(n._openHandler,n),close:r(n._closeHandler,n),animation:n.options.animation,isRtl:o.isRtl(n.wrapper),autosize:n.options.autoWidth}))},_makeUnselectable:function(){gt&&this.list.find("*").not(".k-textbox").attr("unselectable","on")},_toggleHover:function(t){n(t.currentTarget).toggleClass(p,t.type==="mouseenter")},_toggle:function(n,i){var r=this,u=o.mobileOS&&(o.touch||o.MSPointers||o.pointers);n=n!==t?n:!r.popup.visible();i||u||r._focused[0]===it()||(r._prevent=!0,r._focused.focus(),r._prevent=!1);r[n?ot:st]()},_triggerCascade:function(){var n=this;n._cascadeTriggered&&n._old===n.value()&&n._oldIndex===n.selectedIndex||(n._cascadeTriggered=!0,n.trigger(y,{userTriggered:n._userTriggered}))},_triggerChange:function(){this._valueBeforeCascade!==this.value()&&this.trigger(u)},_unbindDataSource:function(){var n=this;n.dataSource.unbind(ct,n._requestStartHandler).unbind(lt,n._requestEndHandler).unbind("error",n._errorHandler)},requireValueMapper:function(n,t){var i=(n.value instanceof Array?n.value.length:n.value)||(t instanceof Array?t.length:t);if(i&&n.virtual&&typeof n.virtual.valueMapper!="function")throw new Error("ValueMapper is not provided while the value is being set. See http://docs.telerik.com/kendo-ui/controls/editors/combobox/virtualization#the-valuemapper-function");}}),l,yt;h(c,{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},unifyType:k});i.ui.List=c;a.Select=c.extend({init:function(n,t){c.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.bound()&&(t._initialIndex=null,t.listView._current=null);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;return n===t?i.selectedIndex:i._select(n).done(function(){i._old=i._accessor();i._oldIndex=i.selectedIndex})},_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],u;if(n===t)return d(r).value||"";d(r).selected=!1;i===t&&(i=-1);u=n!==null&&n!=="";u&&i==-1?this._custom(n):n?r.value=n:r.selectedIndex=i},_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].selected=!0},_hideBusy:function(){var n=this;clearTimeout(n._busy);n._arrowIcon.removeClass(ut);n._focused.attr("aria-busy",!1);n._busy=null;n._showClear()},_showBusy:function(n){var t=this;n.isDefaultPrevented()||(t._request=!0,t._busy)||(t._busy=setTimeout(function(){t._arrowIcon&&(t._focused.attr("aria-busy",!0),t._arrowIcon.addClass(ut),t._hideClear())},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(ct,t._requestStartHandler).bind(lt,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,o=t.listView,e=n.keyCode,h=e===f.DOWN,i,s,r,a,l,v;if(e===f.UP||h){if(n.altKey)t.toggle(h);else{if(!o.bound()){if(!t._fetch){t.dataSource.one(u,function(){t._fetch=!1;t._move(n)});t._fetch=!0;t._filterSource()}return n.preventDefault(),!0}if(r=t._focus(),t._fetch||r&&!r.hasClass("k-state-selected")||(h?(t._nextItem(),t._focus()||t._lastItem()):(t._prevItem(),t._focus()||t._firstItem())),i=o.dataItemByIndex(o.getElementIndex(t._focus())),t.trigger(w,{dataItem:i,item:t._focus()})){t._focus(r);return}t._select(t._focus(),!0).done(function(){t.popup.visible()||t._blur();t._oldIndex=t.selectedIndex})}n.preventDefault();s=!0}else if(e===f.ENTER||e===f.TAB){if(t.popup.visible()&&n.preventDefault(),r=t._focus(),i=t.dataItem(),t.popup.visible()||i&&t.text()===t._text(i)||(r=null),a=t.filterInput&&t.filterInput[0]===it(),r){if(i=o.dataItemByIndex(o.getElementIndex(r)),l=!0,i&&(l=t._value(i)!==c.unifyType(t.value(),typeof t._value(i))),l&&t.trigger(w,{dataItem:i,item:r}))return;t._select(r)}else t.input&&(t._accessor(t.input.val()),t.listView.value(t.input.val()));t._focusElement&&t._focusElement(t.wrapper);a&&e===f.TAB?t.wrapper.focusout():t._blur();t.close();s=!0}else e===f.ESC?(t.popup.visible()&&n.preventDefault(),t.close(),s=!0):t.popup.visible()&&(e===f.PAGEDOWN||e===f.PAGEUP)&&(n.preventDefault(),v=e===f.PAGEDOWN?1:-1,o.scrollWith(v*o.screenHeight()),s=!0);return s},_fetchData:function(){var n=this,t=!!n.dataSource.view().length;n._request||n.options.cascadeFrom||n.listView.bound()||n._fetch||t||(n._fetch=!0,n.dataSource.fetch().done(function(){n._fetch=!1}))},_options:function(n,i,r){var o=this,a=o.element,e=a[0],v=n.length,s="",u,h,c,f,l=0;for(i&&(s=i);l<v;l++)u="<option",h=n[l],c=o._text(h),f=o._value(h),f!==t&&(f+="",f.indexOf('"')!==-1&&(f=f.replace(ni,"&quot;")),u+=' value="'+f+'"'),u+=">",c!==t&&(u+=wt(c)),u+="<\/option>",s+=u;a.html(s);r!==t&&(e.value=r,e.value&&!r&&(e.selectedIndex=-1));e.selectedIndex!==-1&&(u=d(e),u&&u.setAttribute(ht,ht))},_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 r=this.options.name,i,t;if(this.options.cascadeFrom)return i=n("#"+this.options.cascadeFrom),t=i.data("kendo"+r),t||(t=i.data("kendo"+ti[r])),t},_cascade:function(){var n=this,i=n.options,u=i.cascadeFrom,t;if(u){if(t=n._parentWidget(),!t)return;if(n._cascadeHandlerProxy=r(n._cascadeHandler,n),n._cascadeFilterRequests=[],i.autoBind=!1,t.bind("set",function(){n.one("set",function(t){n._selectedValue=t.value||n._accessor()})}),t.first(y,n._cascadeHandlerProxy),t.listView.bound())n._toggleCascadeOnFocus(),n._cascadeSelect(t);else{t.one("dataBound",function(){n._toggleCascadeOnFocus()});t.value()||i.dsDoNotDisableFields===!0||n.enable(!1)}}},_toggleCascadeOnFocus:function(){var t=this,n=t._parentWidget(),i=vt?"blur":"focusout";n._focused.add(n.filterInput).bind("focus",function(){n.unbind(y,t._cascadeHandlerProxy);n.first(u,t._cascadeHandlerProxy)});n._focused.add(n.filterInput).bind(i,function(){n.unbind(u,t._cascadeHandlerProxy);n.first(y,t._cascadeHandlerProxy)})},_cascadeHandler:function(n){var t=this._parentWidget(),i=this.value();this._userTriggered=n.userTriggered;this.listView.bound()&&this._clearSelection(t,!0);this._cascadeSelect(t,i)},_cascadeChange:function(n){var t=this,i=t._accessor()||t._selectedValue;t._cascadeFilterRequests.length||(t._selectedValue=null);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._triggerChange();t._userTriggered=!1},_cascadeSelect:function(n,i){var r=this,o=n.dataItem(),u=o?n._value(o):null,f=r.options.cascadeFromField||n.options.dataValueField,s,e;r._valueBeforeCascade=i!==t?i:r.value();u||u===0?(s=r.dataSource.filter()||{},g(s,f),e=function(){var t=r._cascadeFilterRequests.shift();t&&r.unbind("dataBound",t);t=r._cascadeFilterRequests[0];t&&r.first("dataBound",t);r._cascadeChange(n)},r._cascadeFilterRequests.push(e),r._cascadeFilterRequests.length===1&&r.first("dataBound",e),r._cascading=!0,r._filterSource({field:f,operator:"eq",value:u}),r._cascading=!1):(r.options.dsDoNotDisableFields!==!0&&r.enable(!1),r.options.dsDoNotDisableFields===!0&&r._filterSource({field:f,operator:"eq",value:""}),r._clearSelection(n),r._triggerCascade(),r._triggerChange(),r._userTriggered=!1)}});l=".StaticList";yt=i.ui.DataBoundWidget.extend({init:function(t,u){e.fn.init.call(this,t,u);this.element.attr("role","listbox").on("click"+l,"li",r(this._click,this)).on("mouseenter"+l,"li",function(){n(this).addClass(p)}).on("mouseleave"+l,"li",function(){n(this).removeClass(p)});this.options.selectable==="multiple"&&this.element.attr("aria-multiselectable",!0);this.content=this.element.wrap("<div class='k-list-scroller' unselectable='on'><\/div>").parent();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 f=this.options.value;f&&(this._values=n.isArray(f)?f.slice(0):[f]);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",u,"activate","deactivate","dataBinding","dataBound","selectedItemChange"],setDataSource:function(t){var f=this,e=t||{},o;e=n.isArray(e)?{data:e}:e;e=i.data.DataSource.create(e);f.dataSource?(f.dataSource.unbind(u,f._refreshHandler),o=f.value(),f.value([]),f.bound(!1),f.value(o)):f._refreshHandler=r(f.refresh,f);f.setDSFilter(e.filter());f.dataSource=e.bind(u,f._refreshHandler);f._fixedHeader()},skip:function(){return this.dataSource.skip()},setOptions:function(n){e.fn.setOptions.call(this,n);this._getter();this._templates();this._render()},destroy:function(){this.element.off(l);this._refreshHandler&&this.dataSource.unbind(u,this._refreshHandler);clearTimeout(this._scrollId);e.fn.destroy.call(this)},dataItemByIndex:function(n){return this.dataSource.flatView()[n]},screenHeight:function(){return this.content[0].clientHeight},scrollToIndex:function(n){var t=this.element[0].children[n];t&&this.scroll(t)},scrollWith:function(n){this.content.scrollTop(this.content.scrollTop()+n)},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(n){if(n===t)return this._dataItems.slice();this._dataItems=n;this._values=this._getValues(n)},_getValues:function(t){var i=this._valueGetter;return n.map(t,function(n){return i(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(s(this.element[0].children))},focus:function(i){var r=this,f=r._optionID,u;if(i===t)return r._current;i=s(r._get(i));i=n(this.element[0].children[i]);r._current&&(r._current.removeClass(rt).removeAttr(v),r.trigger("deactivate"));u=!!i[0];u&&(i.addClass(rt),r.scroll(i),i.attr("id",f));r._current=u?i:null;r.trigger("activate")},focusIndex:function(){return this.focus()?this.focus().index():t},skipUpdate:function(n){this._skipUpdate=n},select:function(i){var r=this,v=r.options.selectable,e=v!=="multiple"&&v!==!1,o=r._selectedIndices,h=[],c=[],l,f,a;return i===t?o.slice():(i=r._get(i),i.length===1&&i[0]===-1&&(i=[]),f=n.Deferred().resolve(),a=r.isFiltered(),a&&!e&&r._deselectFiltered(i))?f:e&&!a&&n.inArray(s(i),o)!==-1?(r._dataItems.length&&r._view.length&&(r._dataItems=[r._view[o[0]].item]),f):(l=r._deselect(i),c=l.removed,i=l.indices,i.length&&(e&&(i=[s(i)]),h=r._select(i)),(h.length||c.length)&&(r._valueComparer=null,r.trigger(u,{added:h,removed:c})),f)},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 bt?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.bound()&&(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,t){var i=this,r=0,f,e,u=[];if(!i._valueComparer||i._valueType!==n){for(i._valueType=n;r<t.length;r++)u.push(k(t[r],n));f="for (var idx = 0; idx < "+u.length+"; idx++) { if (current === values[idx]) {   return idx; }} return -1;";e=new Function("current","values",f);i._valueComparer=function(n){return e(n,u)}}return i._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").attr("aria-selected",!1);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").attr("aria-selected",!1),o.push({position:i,dataItem:l[i]});u._values=[];u._dataItems=[];u._selectedIndices=[]}return{indices:t,removed:o}},_deselectFiltered:function(t){for(var s=this.element[0].children,o,i,r,f=[],e=0;e<t.length;e++)i=t[e],o=this._view[i].item,r=this._dataItemPosition(o,this._values),r>-1&&(f.push(this.removeAt(r)),n(s[i]).removeClass("k-state-selected"));return f.length?(this.trigger(u,{added:[],removed:f}),!0):!1},_select:function(t){var i=this,o=i.element[0].children,h=i._view,r,u,e=[],f=0;for(s(t)!==-1&&i.focus(t);f<t.length;f++)(u=t[f],r=h[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},getElementIndex:function(t){return n(t).data("offset-index")},_get:function(n){return typeof n=="number"?n=[n]:dt(n)||(n=this.getElementIndex(n),n=[n!==t?n:-1]),n},_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,r=this.options,t={template:r.template,groupTemplate:r.groupTemplate,fixedGroupTemplate:r.fixedGroupTemplate};for(var u in t)n=t[u],n&&typeof n!="function"&&(t[u]=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+='" aria-selected="'+(r?"true":"false")+'" 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.isFiltered()||this.options.selectable==="multiple";return i&&this._dataItemPosition(n,t)!==-1},setDSFilter:function(n){this._lastDSFilter=h({},n)},isFiltered:function(){return this._lastDSFilter||this.setDSFilter(this.dataSource.filter()),!i.data.Query.compareFilters(this.dataSource.filter(),this._lastDSFilter)},refresh:function(n){var t=this,i=n&&n.action,f=t.options.skipUpdateOnBind,u=i==="itemchange",r;t.trigger("dataBinding");t._angularItems("cleanup");t._fixedHeader();t._render();t.bound(!0);u||i==="remove"?(r=ii(t._dataItems,n.items),r.changed.length&&(u?t.trigger("selectedItemChange",{items:r.changed}):t.value(t._getValues(r.unchanged)))):t.isFiltered()||t._skipUpdate?(t.focus(0),t._skipUpdate&&(t._skipUpdate=!1,t._selectedIndices=t._valueIndices(t._values,t._selectedIndices))):f||i&&i!=="add"||t.value(t._values);t._valueDeferred&&t._valueDeferred.resolve();t._angularItems("compile");t.trigger("dataBound")},bound:function(n){if(n===t)return this._bound;this._bound=n},isGrouped:function(){return(this.dataSource.group()||[]).length}});a.plugin(yt)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.calendar",["kendo.core","kendo.selectable"],n)}(function(){return function(n,t){function di(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 et(n){var i=0,f,h=n.min,c=n.max,t=n.start,l=n.setter,a=n.build,e=n.weekNumberBuild,v=n.cells||12,o=n.isWeekColumnVisible,y=n.perRow||4,s=n.weekNumber||cr,p=n.content||sr,w=n.empty||hr,u=n.html||'<table tabindex="0" role="grid" class="k-content k-meta-view" cellspacing="0"><tbody><tr role="row">';for(o&&(u+=s(e(t)));i<v;i++)i>0&&i%y==0&&(u+='<\/tr><tr role="row">',o&&(u+=s(e(t)))),t=r(t.getFullYear(),t.getMonth(),t.getDate()),nt(t,0),f=a(t,i,n.disableDates),u+=b(t,h,c)?p(f):w(f),l(t,1);return u+"<\/tr><\/tbody><\/table>"}function pt(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 w(){var n=new f;return new f(n.getFullYear(),n.getMonth(),n.getDate())}function g(n,t,i){var r=w();return n&&(r=new f(+n)),t>r?r=new f(+t):i<r&&(r=new f(+i)),r}function b(n,t,i){return+n>=+t&&+n<=+i}function gi(n,t){return n.slice(t).concat(n.slice(0,t))}function nr(n,t,i){t=t instanceof f?t.getFullYear():n.getFullYear()+i*t;n.setFullYear(t)}function tr(n,t){var r,u,f;return+t<+n&&(r=+n,e.views[0].setDate(n,t),e.views[0].setDate(t,new Date(r))),u=Date.UTC(n.getFullYear(),n.getMonth(),n.getDate()),f=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()),Math.ceil((+f-+u)/i.date.MS_PER_DAY)}function ir(n,t,i,r){for(var u,f=0;f<=t;f++)u=new Date(i.getTime()),u=new Date(u.setDate(u.getDate()+f)),r(u)||n.push(u)}function rr(t){var i=n(this).hasClass("k-state-disabled");i||n(this).toggleClass(at,wr.indexOf(t.type)>-1||t.type==ai)}function dr(n){n.preventDefault()}function r(n,t,i){var r=new f(1904,t,i);return r.setFullYear(n),r}function wt(n){return ni(n).calendars.standard}function bt(n){var i=l[n.start],r=l[n.depth],u=ni(n.culture);n.format=or(n.format||u.calendars.standard.patterns.d);isNaN(i)&&(i=0,n.start=tt);(r===t||r>i)&&(n.depth=tt);n.dates===null&&(n.dates=[])}function ur(n){lr&&n.find("*").attr("unselectable","on")}function fr(n,t){n.addClass("k-"+t)}function gr(n,t){for(var i=0,r=t.length;i<r;i++)if(n===+t[i])return!0;return!1}function nu(n,t){return n?n.getFullYear()===t.getFullYear()&&n.getMonth()===t.getMonth()&&n.getDate()===t.getDate():!1}function tu(n,t){return n?n.getFullYear()===t.getFullYear()&&n.getMonth()===t.getMonth():!1}function kt(t){return i.isFunction(t)?t:n.isArray(t)?ru(t):n.noop}function iu(n){for(var i=[],t=0;t<n.length;t++)i.push(n[t].setHours(0,0,0,0));return i}function ru(t){var u,i=[],h=["su","mo","tu","we","th","fr","sa"],o="if (found) { return true } else {return false}",r,s,e;if(t[0]instanceof f)i=iu(t),u="var found = date && window.kendo.jQuery.inArray(date.setHours(0, 0, 0, 0),["+i+"]) > -1;"+o;else{for(r=0;r<t.length;r++)s=t[r].slice(0,2).toLowerCase(),e=n.inArray(s,h),e>-1&&i.push(e);u="var found = date && window.kendo.jQuery.inArray(date.getDay(),["+i+"]) > -1;"+o}return new Function("date",u)}function dt(n,t){return n instanceof Date&&t instanceof Date&&(n=n.getTime(),t=t.getTime()),n===t}var i=window.kendo,ot=i.support,gt=i.ui,rt=gt.Widget,u=i.keys,st=i.parseDate,nt=i.date.adjustDST,er=i.date.weekInYear,ht=i.ui.Selectable,or=i._extractFormat,p=i.template,ni=i.getCulture,ti=i.support.transitions,ii=ti?ti.css+"transform-origin":"",sr=p('<td#=data.cssClass# role="gridcell"><a tabindex="-1" class="k-link" href="\\#" data-#=data.ns#value="#=data.dateString#">#=data.value#<\/a><\/td>',{useWithBlock:!1}),hr=p('<td role="gridcell">&nbsp;<\/td>',{useWithBlock:!1}),cr=p('<td class="k-alt">#= data.weekNumber #<\/td>',{useWithBlock:!1}),ri=i.support.browser,lr=ri.msie&&ri.version<9,ar=i._outerHeight,vr=i._outerWidth,o=".kendoCalendar",a="click"+o,yr="keydown"+o,ct="id",ui="min",fi="left",lt="slideIn",tt="month",ei="century",v="change",oi="navigate",ut="value",at="k-state-hover",s="k-state-disabled",c="k-state-focused",it="k-other-month",si=' class="'+it+'"',hi="k-nav-today",y="td:has(.k-link)",h="td:has(.k-link):not(."+s+")",pr="td:not(:has(.k-link))",ci="k-state-selected",li="blur"+o,ai="focus",vi=ai+o,wr=ot.touch?"touchstart":"mouseenter",yi=ot.touch?"touchstart"+o:"mouseenter"+o,pi=ot.touch?"touchend"+o+" touchmove"+o:"mouseleave"+o,br=6e4,wi=864e5,k="_prevArrow",d="_nextArrow",vt="aria-disabled",bi="aria-selected",yt="aria-label",ft=n.proxy,ki=n.extend,f=Date,l={month:0,year:1,decade:2,century:3},kr=rt.extend({init:function(t,r){var u=this,e,v;if(rt.fn.init.call(u,t,r),t=u.wrapper=u.element,r=u.options,r.url=window.unescape(r.url),u.options.disableDates=kt(u.options.disableDates),u._templates(),u._selectable(),u._header(),u._footer(u.footer),v=t.addClass("k-widget k-calendar "+(r.weekNumber?" k-week-number":"")).on(yi+" "+pi,y,rr).on(yr,"table.k-content",ft(u._move,u)).on(a,y,function(t){var i=t.currentTarget.firstChild,f=u._toDateObject(i);(i.href.indexOf("#")!=-1&&t.preventDefault(),u._view.name=="month"&&u.options.disableDates(f))||(u._view.name!="month"||r.selectable=="single")&&u._click(n(i))}).on("mouseup"+o,"table.k-content, .k-footer",function(){u._focusView(u.options.focusOnNav!==!1)}).attr(ct),v&&(u._cellID=v+"_cell_selected"),u._isMultipleSelection()&&u.options.weekNumber)t.on(a,pr,function(t){var r=n(t.currentTarget).closest("tr").find(h).first(),i=u.selectable._lastActive=n(t.currentTarget).closest("tr").find(h).last();u.selectable.selectRange(r,i,{event:t});u._current=u._value=u._toDateObject(i.find("a"));u._class(c,u._current)});bt(r);e=st(r.value,r.format,r.culture);u._selectDates=[];u._index=l[r.start];u._current=new f(+g(e,r.min,r.max));u._addClassProxy=function(){if(u._active=!0,u._cell.hasClass(s)){var n=u._view.toDateString(w());u._cell=u._cellByDate(n)}u._cell.addClass(c)};u._removeClassProxy=function(){u._active=!1;u._cell.removeClass(c)};u.value(e);u._isMultipleSelection()&&r.selectDates.length>0&&u.selectDates(r.selectDates);i.notify(u)},options:{name:"Calendar",value:null,min:new f(1900,0,1),max:new f(2099,11,31),dates:[],disableDates:null,url:"",culture:"",footer:"",format:"",month:{},weekNumber:!1,selectable:"single",selectDates:[],start:tt,depth:tt,animation:{horizontal:{effects:lt,reverse:!0,duration:500,divisor:2},vertical:{effects:"zoomIn",duration:400}},messages:{weekColumnHeader:""}},events:[v,oi],setOptions:function(n){var t=this;bt(n);n.disableDates=kt(n.disableDates);rt.fn.setOptions.call(t,n);t._templates();t._selectable();t._footer(t.footer);t._index=l[t.options.start];t.navigate()},destroy:function(){var n=this,t=n._today;n.element.off(o);n._title.off(o);n[k].off(o);n[d].off(o);n._destroySelectable();i.destroy(n._table);t&&i.destroy(t.off(o));rt.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(ui,n)},max:function(n){return this._option("max",n)},navigateToPast:function(){this._navigate(k,-1)},navigateToFuture:function(){this._navigate(d,1)},navigateUp:function(){var n=this,t=n._index;n._title.hasClass(s)||n.navigate(n._current,++t)},navigateDown:function(n){var t=this,i=t._index,r=t.options.depth;if(n){if(i===l[r]){dt(t._value,t._current)&&dt(t._value,n)||(t.value(n),t.trigger(v));return}t.navigate(n,--i)}},navigate:function(i,r){var ut;r=isNaN(r)?l[r]:r;var u=this,o=u.options,tt=o.culture,p=o.min,w=o.max,it=u._title,a=u._table,b=u._oldTable,rt=u._current,ft=i&&+i>+rt,et=r!==t&&r!==u._index,y,v,nt,h;i||(i=rt);u._current=i=new f(+g(i,p,w));r===t?r=u._index:u._index=r;u._view=v=e.views[r];nt=v.compare;h=r===l[ei];it.toggleClass(s,h).attr(vt,h);h=nt(i,p)<1;u[k].toggleClass(s,h).attr(vt,h);u[k].hasClass(s)&&u[k].removeClass(at);h=nt(i,w)>-1;u[d].toggleClass(s,h).attr(vt,h);u[d].hasClass(s)&&u[d].removeClass(at);a&&b&&b.data("animating")&&(b.kendoStop(!0,!0),a.kendoStop(!0,!0));u._oldTable=a;(!a||u._changeView)&&(it.html(v.title(i,p,w,tt)),u._table=y=n(v.content(ki({min:p,max:w,date:i,url:o.url,dates:o.dates,format:o.format,culture:tt,disableDates:o.disableDates,isWeekColumnVisible:o.weekNumber,messages:o.messages},u[v.name]))),fr(y,v.name),ur(y),ut=a&&a.data("start")===y.data("start"),u._animate({from:a,to:y,vertical:et,future:ft,replace:ut}),u.trigger(oi),u._focus(i));r===l[o.depth]&&u._selectDates.length>0&&u._visualizeSelectedDatesInView();u.options.selectable==="single"&&r===l[o.depth]&&u._value&&!u.options.disableDates(u._value)&&u._class("k-state-selected",u._value);u._class(c,i);!a&&u._cell&&u._cell.removeClass(c);u._changeView=!0},selectDates:function(i){var r=this,u,f;if(i===t)return r._selectDates;f=i.map(function(n){return n.getTime()}).filter(function(n,t,i){return i.indexOf(n)===t}).map(function(n){return new Date(n)});u=n.grep(f,function(n){if(n)return+r._validateValue(new Date(n.setHours(0,0,0,0)))==+n});r._selectDates=u.length>0?u:r._selectDates;r._visualizeSelectedDatesInView()},value:function(n){var i=this,f=i._view,u=i._view,r;if(n===t)return i._value;n=i._validateValue(n);n&&i._isMultipleSelection()&&(r=new Date(+n),r.setHours(0,0,0,0),i._selectDates=[r],i.selectable._lastActive=null);f&&n===null&&i._cell?i._cell.removeClass(ci):(i._changeView=!n||u&&u.compare(n,i._current)!==0,i.navigate(n))},_validateValue:function(n){var i=this,u=i.options,e=u.min,o=u.max;return n===null&&(i._current=r(i._current.getFullYear(),i._current.getMonth(),i._current.getDate())),n=st(n,u.format,u.culture),n!==null&&(n=new f(+n),b(n,e,o)||(n=null)),n!==null&&i.options.disableDates(new Date(+n))?i._value===t&&(i._value=null):i._value=n,i._value},_visualizeSelectedDatesInView:function(){var t=this,u={},r;n.each(t._selectDates,function(n,t){u[i.calendar.views[0].toDateString(t)]=t});t.selectable.clear();r=t._table.find(y).filter(function(t,r){return u[n(r.firstChild).attr(i.attr(ut))]});r.length>0&&t.selectable._selectElement(r,!0)},_isMultipleSelection:function(){var n=this;return n.options.selectable==="multiple"},_selectable:function(){var n=this,i,t;n._isMultipleSelection()&&(i=n.options.selectable,t=ht.parseOptions(i),t.multiple&&n.element.attr("aria-multiselectable","true"),n.selectable=new ht(n.wrapper,{aria:!0,inputSelectors:"input,textarea,.k-multiselect-wrap,select,button,.k-button>span,.k-button>img,span.k-icon.k-i-arrow-60-down,span.k-icon.k-i-arrow-60-up",multiple:t.multiple,filter:"table.k-month:eq(0) "+h,change:ft(n._onSelect,n),relatedTarget:ft(n._onRelatedTarget,n)}))},_onRelatedTarget:function(n){var t=this;t.selectable.options.multiple&&n.is(h)&&(t._current=t._toDateObject(n.find("a")),t._class(c,t._toDateObject(n.find("a"))))},_onSelect:function(t){var i=this,r=t,u=ht.parseOptions(i.options.selectable);if(!u.multiple){n(r.event.currentTarget).is("td")&&!n(r.event.currentTarget).hasClass("k-state-selected")?n(r.event.currentTarget).addClass("k-state-selected"):i._click(n(r.event.currentTarget).find("a"));return}r.event.ctrlKey?n(r.event.currentTarget).is(h)?i._toggleSelection(n(r.event.currentTarget)):(i._cellsBySelector(h).each(function(t,r){var u=i._toDateObject(n(r).find("a"));i._deselect(u)}),i._addSelectedCellsToArray()):r.event.shiftKey?i._rangeSelection(i._cell):n(r.event.currentTarget).is(y)?i.value(i._toDateObject(n(r.event.currentTarget).find("a"))):(i._selectDates=[],i._addSelectedCellsToArray());i.trigger(v)},_destroySelectable:function(){var n=this;n.selectable&&(n.selectable.destroy(),n.selectable=null)},_toggleSelection:function(n){var t=this,i=t._toDateObject(n.find("a"));n.hasClass("k-state-selected")?t._selectDates.push(i):t._deselect(i)},_rangeSelection:function(n,t){var i=this,r=t||i._toDateObject(i.selectable.value().first().find("a")),f=i._toDateObject(n.find("a")),u;i.selectable._lastActive||i._value?r=i.selectable._lastActive?i._toDateObject(i.selectable._lastActive.find("a")):new Date(+i._value):i.selectable._lastActive=t?i._cellByDate(i._view.toDateString(t),h):i.selectable.value().first();i._selectDates=[];u=tr(r,f);ir(i._selectDates,u,r,i.options.disableDates);i._visualizeSelectedDatesInView()},_cellsBySelector:function(n){var t=this;return t._table.find(n)},_addSelectedCellsToArray:function(){var t=this;t.selectable.value().each(function(i,r){var u=t._toDateObject(n(r.firstChild));t.options.disableDates(u)||t._selectDates.push(u)})},_deselect:function(n){var t=this,i=t._selectDates.map(Number).indexOf(+n);i!=-1&&t._selectDates.splice(i,1)},_dateInView:function(n){var t=this,i=t._toDateObject(t._cellsBySelector(y+":first").find("a")),r=t._toDateObject(t._cellsBySelector(y+":last").find("a"));return+n<=+r&&+n>=+i},_move:function(e){var o=this,d=o.options,h=e.keyCode,nt=o._view,tt=o._index,y=o.options.min,it=o.options.max,s=new f(+o._current),p=i.support.isRtl(o.wrapper),rt=o.options.disableDates,a,l,w,k,ut;return e.target===o._table[0]&&(o._active=!0),h==u.RIGHT&&!p||h==u.LEFT&&p?(a=1,l=!0):h==u.LEFT&&!p||h==u.RIGHT&&p?(a=-1,l=!0):h==u.UP?(a=tt===0?-7:-4,l=!0):h==u.DOWN?(a=tt===0?7:4,l=!0):h==u.SPACEBAR?(a=0,l=!0):(h==u.HOME||h==u.END)&&(w=h==u.HOME?"first":"last",k=nt[w](s),s=new f(k.getFullYear(),k.getMonth(),k.getDate(),s.getHours(),s.getMinutes(),s.getSeconds(),s.getMilliseconds()),s.setFullYear(k.getFullYear()),l=!0),e.ctrlKey?h==u.RIGHT&&!p||h==u.LEFT&&p?(o.navigateToFuture(),l=!0):h==u.LEFT&&!p||h==u.RIGHT&&p?(o.navigateToPast(),l=!0):h==u.UP?(o.navigateUp(),l=!0):h==u.DOWN?(o._click(n(o._cell[0].firstChild)),l=!0):(h==u.ENTER||h==u.SPACEBAR)&&o._isMultipleSelection()&&(o._keyboardToggleSelection(e),ut=o._toDateObject(n(o._cell[0]).find("a")),o._class(c,ut)):e.shiftKey?(a!==t||w)&&(w||nt.setDate(s,a),rt(s)&&(s=o._nextNavigatable(s,a)),y=r(y.getFullYear(),y.getMonth(),y.getDate()),b(s,y,it)&&(o._isMultipleSelection()?o._keyboardRangeSelection(e,s):o._focus(g(s,d.min,d.max)))):(h==u.ENTER||h==u.SPACEBAR?(nt.name=="month"&&o._isMultipleSelection()?(o.value(o._toDateObject(n(o._cell.find("a")))),o.selectable._lastActive=n(o._cell[0]),o.trigger(v)):o._click(n(o._cell[0].firstChild)),l=!0):h==u.PAGEUP?(l=!0,o.navigateToPast()):h==u.PAGEDOWN&&(l=!0,o.navigateToFuture()),(a||w)&&(w||nt.setDate(s,a),rt(s)&&(s=o._nextNavigatable(s,a)),y=r(y.getFullYear(),y.getMonth(),y.getDate()),b(s,y,it)&&(o._isMultipleSelection()?o._dateInView(s)?(o._current=s,o._class(c,s)):o.navigate(s):o._focus(g(s,d.min,d.max))))),l&&e.preventDefault(),o._current},_keyboardRangeSelection:function(n,t){var i=this,r,u;if(!i._dateInView(t)){i._selectDates=[];r=i.selectable._lastActive?i._toDateObject(i.selectable._lastActive.find("a")):t;u=tr(r,new Date(+t));ir(i._selectDates,u,r,i.options.disableDates);i.navigate(t);i._current=t;i.selectable._lastActive=i.selectable._lastActive||i._cellByDate(i._view.toDateString(t),h);i.trigger(v);return}i.selectable.options.filter=i.wrapper.find("table").length>1&&+t>+i._current?"table.k-month:eq(1) "+h:"table.k-month:eq(0) "+h;i._class(c,t);i._current=t;i._rangeSelection(i._cellByDate(i._view.toDateString(t),h),t);i.trigger(v);i.selectable.options.filter="table.k-month:eq(0) "+h},_keyboardToggleSelection:function(t){var i=this;t.currentTarget=i._cell[0];i.selectable._lastActive=n(i._cell[0]);n(i._cell[0]).hasClass(ci)?(i.selectable._unselect(n(i._cell[0])),i.selectable.trigger(v,{event:t})):i.selectable.value(n(i._cell[0]),{event:t})},_nextNavigatable:function(n,t){var i=this,r=!0,u=i._view,e=i.options.min,o=i.options.max,s=i.options.disableDates,f=new Date(n.getTime());for(u.setDate(f,-t);r;){if(u.setDate(n,t),!b(n,e,o)){n=f;break}r=s(n)}return n},_animate:function(n){var i=this,t=n.from,r=n.to,u=i._active;t?t.parent().data("animating")?(t.off(o),t.parent().kendoStop(!0,!0).remove(),t.remove(),r.insertAfter(i.element[0].firstChild),i._focusView(u)):!t.is(":visible")||i.options.animation===!1||n.replace?(r.insertAfter(t),t.off(o).remove(),i._focusView(u)):i[n.vertical?"_vertical":"_horizontal"](t,r,n.future):(r.insertAfter(i.element[0].firstChild),i._bindTable(r))},_horizontal:function(n,t,i){var r=this,e=r._active,u=r.options.animation.horizontal,s=u.effects,f=vr(n);s&&s.indexOf(lt)!=-1&&(n.add(t).css({width:f}),n.wrap("<div/>"),r._focusView(e,n),n.parent().css({position:"relative",width:f*2,float:fi,"margin-left":i?0:-f}),t[i?"insertAfter":"insertBefore"](n),ki(u,{effects:lt+":"+(i?"right":fi),complete:function(){n.off(o).remove();r._oldTable=null;t.unwrap();r._focusView(e)}}),n.parent().kendoStop(!0,!0).kendoAnimate(u))},_vertical:function(n,t){var i=this,f=i.options.animation.vertical,e=f.effects,s=i._active,u,r;e&&e.indexOf("zoom")!=-1&&(t.css({position:"absolute",top:ar(n.prev()),left:0}).insertBefore(n),ii&&(u=i._cellByDate(i._view.toDateString(i._current)),r=u.position(),r=r.left+parseInt(u.width()/2,10)+"px "+(r.top+parseInt(u.height()/2,10)+"px"),t.css(ii,r)),n.kendoStop(!0,!0).kendoAnimate({effects:"fadeOut",duration:600,complete:function(){n.off(o).remove();i._oldTable=null;t.css({position:"static",top:0,left:0});i._focusView(s)}}),t.kendoStop(!0,!0).kendoAnimate(f))},_cellByDate:function(t,r){return this._table.find(r?r:"td:not(."+it+")").filter(function(){return n(this.firstChild).attr(i.attr(ut))===t})},_class:function(n,t){var i=this,u=i._cellID,r=i._cell,e=i._view.toDateString(t),f;r&&r.removeAttr(bi).removeAttr(yt).removeAttr(ct);t&&i._view.name=="month"&&(f=i.options.disableDates(t));i._cellsBySelector(i._isMultipleSelection()?y:"td:not(."+it+")").removeClass(n);r=i._cellByDate(e,i.options.selectable=="multiple"?y:"td:not(."+it+")").attr(bi,!0);(n===c&&!i._active&&i.options.focusOnNav!==!1||f)&&(n="");r.addClass(n);r[0]&&(i._cell=r);u&&(r.attr(ct,u),i._table.removeAttr("aria-activedescendant").attr("aria-activedescendant",u))},_bindTable:function(n){n.on(vi,this._addClassProxy).on(li,this._removeClassProxy)},_click:function(n){var t=this,r=t.options,u=new Date(+t._current),i=t._toDateObject(n);nt(i,0);t._view.name=="month"&&t.options.disableDates(i)&&(i=t._value);t._view.setDate(u,i);t.navigateDown(g(u,r.min,r.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,n))},_focusView:function(n,t){n&&this.focus(t)},_footer:function(t){var r=this,f=w(),e=r.element,u=e.find(".k-footer");if(!t){r._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));r._today=u.show().find(".k-link").html(t(f)).attr("title",i.toString(f,"D",r.options.culture));r._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" '+yt+'="Previous"><span class="k-icon k-i-arrow-60-left"><\/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" '+yt+'="Next"><span class="k-icon k-i-arrow-60-right"><\/span><\/a><\/div>');t=i.find(".k-link").on(yi+" "+pi+" "+vi+" "+li,rr).click(!1);n._title=t.eq(1).on(a,function(){n._active=n.options.focusOnNav!==!1;n.navigateUp()});n[k]=t.eq(0).on(a,function(){n._active=n.options.focusOnNav!==!1;n.navigateToPast()});n[d]=t.eq(2).on(a,function(){n._active=n.options.focusOnNav!==!1;n.navigateToFuture()})},_navigate:function(n,t){var i=this,u=i._index+1,r=new f(+i._current),o;i._isMultipleSelection()&&(o=i._table.find("td:not(.k-other-month)").has(".k-link").first(),r=i._toDateObject(o.find("a")),i._current=new Date(+r));n=i[n];n.hasClass(s)||(u>3?r.setFullYear(r.getFullYear()+100*t):e.views[u].setDate(r,t),i.navigate(r))},_option:function(n,i){var r=this,u=r.options,e=r._value||r._current,o;if(i===t)return u[n];(i=st(i,u.format,u.culture),i)&&(u[n]=new f(+i),o=n===ui?i>e:e>i,(o||tu(e,i))&&(o&&(r._value=null),r._changeView=!0),r._changeView||(r._changeView=!!(u.month.content||u.month.empty)),r.navigate(r._value),r._toggle())},_toggle:function(n){var i=this,u=i.options,f=i.options.disableDates(w()),r=i._today;if(n===t&&(n=b(w(),u.min,u.max)),r)if(r.off(a),n&&!f)r.addClass(hi).removeClass(s).on(a,ft(i._todayClick,i));else r.removeClass(hi).addClass(s).on(a,dr)},_todayClick:function(n){var t=this,r=l[t.options.depth],u=t.options.disableDates,i=w();(n.preventDefault(),u(i))||(t._view.compare(t._current,i)===0&&t._index==r&&(t._changeView=!1),t._isMultipleSelection()&&(t._selectDates=[i],t.selectable._lastActive=null),t._value=i,t.navigate(i,r),t.trigger(v))},_toDateObject:function(t){var u=n(t).attr(i.attr(ut)).split("/");return r(u[0],u[1],u[2])},_templates:function(){var n=this,t=n.options,u=t.footer,r=t.month,f=r.content,e=r.weekNumber,o=r.empty;n.month={content:p('<td#=data.cssClass# role="gridcell"><a tabindex="-1" class="k-link#=data.linkClass#" href="#=data.url#" '+i.attr(ut)+'="#=data.dateString#" title="#=data.title#">'+(f||"#=data.value#")+"<\/a><\/td>",{useWithBlock:!!f}),empty:p('<td role="gridcell">'+(o||"&nbsp;")+"<\/td>",{useWithBlock:!!o}),weekNumber:p('<td class="k-alt">'+(e||"#= data.weekNumber #")+"<\/td>",{useWithBlock:!!e})};n.footer=u!==!1?p(u||'#= kendo.toString(data,"D","'+t.culture+'") #',{useWithBlock:!1}):null}}),e;gt.plugin(kr);e={firstDayOfMonth:function(n){return r(n.getFullYear(),n.getMonth(),1)},firstVisibleDay:function(n,t){t=t||i.culture().calendar;var u=t.firstDay,r=new f(n.getFullYear(),n.getMonth(),1,n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds());for(r.setFullYear(n.getFullYear());r.getDay()!=u;)e.setTime(r,-1*wi);return r},setTime:function(n,t){var r=n.getTimezoneOffset(),i=new f(n.getTime()+t),u=i.getTimezoneOffset()-r;n.setTime(i.getTime()+u*br)},views:[{name:tt,title:function(n,t,i,r){return wt(r).months.names[n.getMonth()]+" "+n.getFullYear()},content:function(n){var t=this,u=0,o=n.min,h=n.max,c=n.date,l=n.dates,rt=n.format,a=n.culture,p=n.url,b=n.isWeekColumnVisible,ut=p&&l[0],v=wt(a),k=v.firstDay,d=v.days,ft=gi(d.names,k),ot=gi(d.namesShort,k),g=e.firstVisibleDay(c,v),st=t.first(c),ht=t.last(c),tt=t.toDateString,f=w(),y='<table tabindex="0" role="grid" class="k-content" cellspacing="0" data-start="'+tt(g)+'"><thead><tr role="row">';for(b&&(y+='<th scope="col" class="k-alt">'+n.messages.weekColumnHeader+"<\/th>");u<7;u++)y+='<th scope="col" title="'+ft[u]+'">'+ot[u]+"<\/th>";return nt(f,0),f=+f,et({cells:42,perRow:7,html:y+='<\/tr><\/thead><tbody><tr role="row">',start:g,isWeekColumnVisible:b,weekNumber:n.weekNumber,min:r(o.getFullYear(),o.getMonth(),o.getDate()),max:r(h.getFullYear(),h.getMonth(),h.getDate()),content:n.content,empty:n.empty,setter:t.setDate,disableDates:n.disableDates,build:function(n,t,r){var u=[],e=n.getDay(),o="",h="#";return(n<st||n>ht)&&u.push(it),r(n)&&u.push(s),+n===f&&u.push("k-today"),(e===0||e===6)&&u.push("k-weekend"),ut&&gr(+n,l)&&(h=p.replace("{0}",i.toString(n,rt,a)),o=" k-action-link"),{date:n,dates:l,ns:i.ns,title:i.toString(n,"D",a),value:n.getDate(),dateString:tt(n),cssClass:u[0]?' class="'+u.join(" ")+'"':"",linkClass:o,url:h}},weekNumberBuild:function(n){return{weekNumber:er(n,i.culture().calendar.firstDay),currentDate:n}}})},first:function(n){return e.firstDayOfMonth(n)},last:function(n){var t=r(n.getFullYear(),n.getMonth()+1,0),i=e.firstDayOfMonth(n),u=Math.abs(t.getTimezoneOffset()-i.getTimezoneOffset());return u&&t.setHours(i.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 i=n.getHours();t instanceof f?n.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()):e.setTime(n,t*wi);nt(n,i)},toDateString:function(n){return n.getFullYear()+"/"+n.getMonth()+"/"+n.getDate()}},{name:"year",title:function(n){return n.getFullYear()},content:function(n){var f=wt(n.culture).months.namesAbbr,e=this.toDateString,t=n.min,u=n.max;return et({min:r(t.getFullYear(),t.getMonth(),1),max:r(u.getFullYear(),u.getMonth(),1),start:r(n.date.getFullYear(),0,1),setter:this.setDate,build:function(n){return{value:f[n.getMonth()],ns:i.ns,dateString:e(n),cssClass:""}}})},first:function(n){return r(n.getFullYear(),0,n.getDate())},last:function(n){return r(n.getFullYear(),11,n.getDate())},compare:function(n,t){return pt(n,t)},setDate:function(n,t){var i,r=n.getHours();t instanceof f?(i=t.getMonth(),n.setFullYear(t.getFullYear(),i,n.getDate()),i!==n.getMonth()&&n.setDate(0)):(i=n.getMonth()+t,n.setMonth(i),i>11&&(i-=12),i>0&&n.getMonth()!=i&&n.setDate(0));nt(n,r)},toDateString:function(n){return n.getFullYear()+"/"+n.getMonth()+"/1"}},{name:"decade",title:function(n,t,i){return di(n,t,i,10)},content:function(n){var t=n.date.getFullYear(),u=this.toDateString;return et({start:r(t-t%10-1,0,1),min:r(n.min.getFullYear(),0,1),max:r(n.max.getFullYear(),0,1),setter:this.setDate,build:function(n,t){return{value:n.getFullYear(),ns:i.ns,dateString:u(n),cssClass:t===0||t==11?si:""}}})},first:function(n){var t=n.getFullYear();return r(t-t%10,n.getMonth(),n.getDate())},last:function(n){var t=n.getFullYear();return r(t-t%10+9,n.getMonth(),n.getDate())},compare:function(n,t){return pt(n,t,10)},setDate:function(n,t){nr(n,t,1)},toDateString:function(n){return n.getFullYear()+"/0/1"}},{name:ei,title:function(n,t,i){return di(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),et({start:r(o-o%100-10,0,1),min:r(t,0,1),max:r(u,0,1),setter:this.setDate,build:function(n,t){var r=n.getFullYear(),u=r+9;return r<f&&(r=f),u>e&&(u=e),{ns:i.ns,value:r+" - "+u,dateString:s(n),cssClass:t===0||t==11?si:""}}})},first:function(n){var t=n.getFullYear();return r(t-t%100,n.getMonth(),n.getDate())},last:function(n){var t=n.getFullYear();return r(t-t%100+99,n.getMonth(),n.getDate())},compare:function(n,t){return pt(n,t,100)},setDate:function(n,t){nr(n,t,10)},toDateString:function(n){var t=n.getFullYear();return t-t%10+"/0/1"}}]};e.isEqualDatePart=nu;e.isEqualDate=dt;e.makeUnselectable=ur;e.restrictValue=g;e.isInRange=b;e.addClassToViewContainer=fr;e.normalize=bt;e.viewsEnum=l;e.disabled=kt;i.calendar=e}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.dateinput",["kendo.core"],n)}(function(){return function(n,t){function nt(n,t,i,r){var h=n[r+n.length-i.length],e,u,o,s;if(n=n.substring(0,r+n.length-i.length),i=i.substring(0,r),e=[],n===i&&r>0)return e.push([t[r-1],i[r-1]]),e;if(n.indexOf(i)===0&&(i.length===0||t[i.length-1]!==t[i.length])){for(o="",u=i.length;u<n.length;u++)t[u]!==o&&f.indexOf(t[u])>=0&&(o=t[u],e.push([o,""]));return e}if(i[i.length-1]===" "||i[i.length-1]===h)return[[t[r-1]," "]];if(i.indexOf(n)===0||f.indexOf(t[r-1])===-1){for(s=t[0],u=Math.max(0,n.length-1);u<t.length;u++)if(f.indexOf(t[u])>=0){s=t[u];break}return[[s,i[r-1]]]}return[[t[r-1],i[r-1]]]}var b=window,i=b.kendo,u=i.caret,c=i.ui,o=c.Widget,k=i.keys,r=".kendoDateInput",e=n.proxy,d={}.toString,l=(i.support.propertyChangeEvent?"propertychange.kendoDateInput input":"input")+r,a="k-state-disabled",v="k-state-default",y="k-state-invalid",p="disabled",s="readonly",h="change",f="dMyHhmftsz",g=o.extend({init:function(t,u){var f=this,e,s;o.fn.init.call(f,t,u);t=f.element;u=f.options;u.format=i._extractFormat(u.format||i.getCulture(u.culture).calendars.standard.patterns.d);u.min=i.parseDate(t.attr("min"))||i.parseDate(u.min);u.max=i.parseDate(t.attr("max"))||i.parseDate(u.max);e=(t.parent().attr("class")||"").indexOf("k-picker-wrap")>=0;e?f.wrapper=t.parent():(f.wrapper=t.wrap("<span class='k-widget k-dateinput'><\/span>").parent(),f.wrapper.addClass(t[0].className),f.wrapper[0].style.cssText=t[0].style.cssText,t.css({width:"100%",height:t[0].style.height}));n("<span class='k-icon k-i-warning'><\/span>").insertAfter(t);f._form();f.element.addClass(e?" ":"k-textbox").attr("autocomplete","off").on("focusout"+r,function(){f._change()});try{t[0].setAttribute("type","text")}catch(h){t[0].type="text"}s=t.is("[disabled]")||n(f.element).parents("fieldset").is(":disabled");s?f.enable(!1):f.readonly(t.is("[readonly]"));f.value(f.options.value||t.val());i.notify(f)},options:{name:"DateInput",culture:"",value:"",format:"",min:new Date(1900,0,1),max:new Date(2099,11,31),messages:{year:"year",month:"month",day:"day",weekday:"day of the week",hour:"hours",minute:"minutes",second:"seconds",dayperiod:"AM/PM"}},events:[h],min:function(n){if(n!==t)this.options.min=n;else return this.options.min},max:function(n){if(n!==t)this.options.max=n;else return this.options.max},setOptions:function(n){var t=this;o.fn.setOptions.call(t,n);this._unbindInput();this._bindInput();this._updateElementValue()},destroy:function(){var n=this;n.element.off(r);n._formElement&&n._formElement.off("reset",n._resetHandler);o.fn.destroy.call(n)},value:function(n){if(n===t)return this._dateTime.getDateObject();n===null&&(n="");d.call(n)!=="[object Date]"&&(n=i.parseDate(n,this.options.format,this.options.culture));n&&!n.getTime()&&(n=null);this._dateTime=new w(n,this.options.format,this.options.culture,this.options.messages);this._updateElementValue();this._oldValue=n},_updateElementValue:function(){var n=this._dateTime.toPair(this.options.format,this.options.culture,this.options.messages);this.element.val(n[0]);this._oldText=n[0];this._format=n[1]},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;n.element.on("paste"+r,e(n._paste,n)).on("keydown"+r,e(n._keydown,n)).on(l,e(n._input,n)).on("mouseup"+r,e(n._mouseUp,n)).on("DOMMouseScroll"+r+" mousewheel"+r,e(n._scroll,n))},_unbindInput:function(){this.element.off("keydown"+r).off("paste"+r).off(l).off("mouseup"+r).off("DOMMouseScroll"+r+" mousewheel"+r)},_editable:function(n){var t=this,i=t.element,r=n.disable,u=n.readonly,f=t.wrapper;t._unbindInput();u||r?(r&&(f.addClass(a).removeClass(v),i.attr(p,r),i.removeAttr(s)),u&&i.attr(s,u)):(f.addClass(v).removeClass(a),i.removeAttr(p).removeAttr(s),t._bindInput())},_change:function(){var n=this,i=n._oldValue,t=n.value();t&&n.min()&&t<n.min()&&(n.value(n.min()),t=n.value());t&&n.max()&&t>n.max()&&(n.value(n.max()),t=n.value());(i&&t&&t.getTime()!==i.getTime()||i&&!t||!i&&t)&&(n._oldValue=t,n.trigger(h),n.element.trigger(h))},_input:function(){var t=this,l=t.element[0],e=!1,n,f,r,o,s,h,c;if(i._activeElement()===l){if(n=nt(this._oldText,this._format,this.element[0].value,u(this.element[0])[0]),f=n.length===1&&n[0][1]===" ",!f)for(r=0;r<n.length;r++)o=this._dateTime.parsePart(n[r][0],n[r][1]),e=e||!o;this._updateElementValue();n.length&&n[0][0]!==" "&&(this._selectSegment(n[0][0]),f||(s=n[0][0],setTimeout(function(){t._selectSegment(s)})));f&&(h={keyCode:39,preventDefault:function(){}},this._keydown(h));e&&(clearTimeout(t._blinkInvalidTimeout),c=y,t.wrapper.addClass(y),t._blinkInvalidTimeout=setTimeout(function(){t.wrapper.removeClass(c)},100))}},_mouseUp:function(){var n=u(this.element[0]);n[0]===n[1]&&this._selectNearestSegment()},_scroll:function(n){if(i._activeElement()===this.element[0]&&!this.element.is("[readonly]")){n=window.event||n;var t={keyCode:37,preventDefault:function(){}};t.keyCode=n.shiftKey?(n.wheelDelta||-n.detail)>0?37:39:(n.wheelDelta||-n.detail)>0?38:40;this._keydown(t);n.returnValue=!1;n.preventDefault&&n.preventDefault();n.stopPropagation&&n.stopPropagation()}},_form: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._formElement=u.on("reset",t._resetHandler))},_paste:function(n){n.preventDefault()},_keydown:function(n){var t=n.keyCode,e,s,r,o,h,c;if(t==37||t==39)for(n.preventDefault(),e=u(this.element[0]),e[0]!=e[1]&&this._selectNearestSegment(),s=t==37?-1:1,r=s==-1?u(this.element[0])[0]-1:u(this.element[0])[1]+1;r>=0&&r<this._format.length;){if(f.indexOf(this._format[r])>=0){this._selectSegment(this._format[r]);break}r+=s}(t==38||t==40)&&(n.preventDefault(),e=u(this.element[0]),o=this._format[e[0]],f.indexOf(o)>=0&&(this._dateTime.modifyPart(o,t==38?1:-1),this._updateElementValue(),this._selectSegment(o)));i.support.browser.msie&&i.support.browser.version<10&&(h=n.keyCode?n.keyCode:n.which,(h===8||h===46)&&(c=this,setTimeout(function(){c._input()},0)));t===k.ENTER&&this._change()},_selectNearestSegment:function(){for(var r=u(this.element[0]),i=r[0],n=i,t=i-1;n<this._format.length||t>=0;n++,t--){if(n<this._format.length&&f.indexOf(this._format[n])!==-1){this._selectSegment(this._format[n]);return}if(t>=0&&f.indexOf(this._format[t])!==-1){this._selectSegment(this._format[t]);return}}},_selectSegment:function(n){for(var t=-1,r=0,i=0;i<this._format.length;i++)this._format[i]===n&&(r=i+1,t===-1&&(t=i));t<0&&(t=0);u(this.element,t,r)}}),w;c.plugin(g);w=function(n,r,u,f){function s(n,t,i){return(n=n+"",t=t||2,i=t-n.length,i)?et[t].substring(0,i)+n:n}function ft(n){return ut=n,ot}function tt(n,t){switch(n){case"y":a=t;break;case"M":h=t;t||(e.setMonth(0),p="");break;case"d":l=t;break;case"H":case"h":c=t;t||(y="");break;case"m":w=t;break;case"s":b=t;break;default:return}}var e=null,a=!0,h=!0,l=!0,c=!0,w=!0,b=!0,k=!0,p="",y="",o={},et=["","0","00","000","0000"],rt=/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=null,v=null,nt=null,ut=!1,ot=function(n){var r,u,i,f,y;switch(n){case"d":i=l?e.getDate():o.day;break;case"dd":i=l?s(e.getDate()):o.day;break;case"ddd":i=l&&h&&a?nt.namesAbbr[e.getDay()]:o.weekday;break;case"dddd":i=l&&h&&a?nt.names[e.getDay()]:o.weekday;break;case"M":i=h?e.getMonth()+1:o.month;break;case"MM":i=h?s(e.getMonth()+1):o.month;break;case"MMM":i=h?g.namesAbbr[e.getMonth()]:o.month;break;case"MMMM":i=h?g.names[e.getMonth()]:o.month;break;case"yy":i=a?s(e.getFullYear()%100):o.year;break;case"yyyy":i=a?s(e.getFullYear(),4):o.year;break;case"h":i=c?e.getHours()%12||12:o.hour;break;case"hh":i=c?s(e.getHours()%12||12):o.hour;break;case"H":i=c?e.getHours():o.hour;break;case"HH":i=c?s(e.getHours()):o.hour;break;case"m":i=w?e.getMinutes():o.minute;break;case"mm":i=w?s(e.getMinutes()):o.minute;break;case"s":i=b?e.getSeconds():o.second;break;case"ss":i=b?s(e.getSeconds()):o.second;break;case"f":i=k?Math.floor(e.getMilliseconds()/100):k;break;case"ff":i=e.getMilliseconds();i>99&&(i=Math.floor(i/10));i=k?s(i):n;break;case"fff":i=k?s(e.getMilliseconds(),3):n;break;case"tt":i=c?e.getHours()<12?v.AM[0]:v.PM[0]:o.dayperiod;break;case"zzz":r=e.getTimezoneOffset();u=r<0;i=Math.abs(r/60).toString().split(".")[0];r=Math.abs(r)-i*60;i=(u?"+":"-")+s(i)+(":"+s(r));break;case"z":case"zz":i=e.getTimezoneOffset()/60;u=i<0;i=Math.abs(i).toString().split(".")[0];i=(u?"+":"-")+(n==="zz"?s(i):i)}if(i=i!==t?i:n.slice(1,n.length-1),ut){for(i=""+i,f="",n=="ddd"&&(n="EEE"),n=="dddd"&&(n="EEEE"),y=0;y<i.length;y++)f+=n[0];return f}return i},it,d;if(this.setValue=function(n){l=n},this.getValue=function(){return l},this.modifyPart=function(n,t){var i=new Date(e&&e.getTime?e.getTime():e),r;switch(n){case"y":i.setFullYear(i.getFullYear()+t);break;case"M":r=i.getMonth()+t;i.setMonth(r);i.getMonth()%12!=(r+12)%12&&(i.setDate(1),i.setMonth(r));break;case"d":case"E":i.setDate(i.getDate()+t);break;case"H":case"h":i.setHours(i.getHours()+t);break;case"m":i.setMinutes(i.getMinutes()+t);break;case"s":i.setSeconds(i.getSeconds()+t);break;case"t":i.setHours((i.getHours()+12)%24)}i.getFullYear()>0&&(tt(n,!0),e=i)},this.parsePart=function(n,t){var i,r,f,u,g,d,o,s,k;if(!t)return tt(n,!1),!0;i=new Date(e&&e.getTime?e.getTime():e);switch(n){case"d":if(f=(l?i.getDate()*10:0)+parseInt(t,10),isNaN(f))return;while(f>31)f=parseInt(f.toString().slice(1),10);if(f<1)l=!1;else{if(i.setDate(f),i.getMonth()!==e.getMonth())return;l=!0}break;case"M":if(u=(h?(i.getMonth()+1)*10:0)+parseInt(t,10),isNaN(u)){for(g=v.months.names,p+=t.toLowerCase();p.length>0;){for(d=0;d<g.length;d++)if(g[d].toLowerCase().indexOf(p)===0)return i.setMonth(d),h=!0,e=i,!0;p=p.substring(1,p.length)}return!1}while(u>12)u=parseInt(u.toString().slice(1),10);u<1?h=!1:(i.setMonth(u-1),i.getMonth()!==u-1&&(i.setDate(1),i.setMonth(u-1)),h=!0);break;case"y":if(o=(a?i.getFullYear()*10:0)+parseInt(t,10),isNaN(o))return;while(o>9999)o=parseInt(o.toString().slice(1),10);o<1?a=!1:(i.setFullYear(o),a=!0);break;case"h":if(r=(c?(i.getHours()%12||12)*10:0)+parseInt(t,10),isNaN(r))return;while(r>12)r=parseInt(r.toString().slice(1),10);i.setHours(Math.floor(i.getHours()/12)*12+r%12);c=!0;break;case"H":if(r=(c?i.getHours()*10:0)+parseInt(t,10),isNaN(r))return;while(r>23)r=parseInt(r.toString().slice(1),10);i.setHours(r);c=!0;break;case"m":if(s=(w?i.getMinutes()*10:0)+parseInt(t,10),isNaN(s))return;while(s>59)s=parseInt(s.toString().slice(1),10);i.setMinutes(s);w=!0;break;case"s":if(k=(b?i.getSeconds()*10:0)+parseInt(t,10),isNaN(k))return;while(k>59)k=parseInt(k.toString().slice(1),10);i.setSeconds(k);b=!0;break;case"t":if(c){for(y+=t.toLowerCase();y.length>0;){if(v.AM[0].toLowerCase().indexOf(y)===0&&i.getHours()>=12||v.PM[0].toLowerCase().indexOf(y)===0&&i.getHours()<12)return i.setHours((i.getHours()+12)%24),e=i,!0;y=y.substring(1,y.length)}return!1}}return e=i,!0},this.toPair=function(n,t,r){return n?(t=i.getCulture(t),v=t.calendars.standard,n=v.patterns[n]||n,nt=v.days,g=v.months,o=r,[n.replace(rt,ft(!1)),n.replace(rt,ft(!0))]):["",""]},this.getDateObject=function(){return a&&h&&l&&c&&w&&b&&k?new Date(e.getTime()):null},n)e=new Date(n.getTime());else for(e=new Date,it=this.toPair(r,u,f)[1],d=0;d<it.length;d++)tt(it[d],!1)}}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.datepicker",["kendo.calendar","kendo.popup","kendo.dateinput"],n)}(function(){return function(n,t){function d(t){var i=t.parseFormats,u=t.format,r;o.normalize(t);i=n.isArray(i)?i:[i];i.push("yyyy-MM-dd HH:mm:ss");i.push("yyyy-MM-dd");n.inArray(u,i)===-1&&i.splice(0,0,t.format);t.format.indexOf("yyyy")==-1&&t.format.indexOf("yy")!=-1&&(r=t.format.replace("yy","yyyy"),n.inArray(r,i)===-1&&i.splice(0,0,r));t.parseFormats=i}function yt(n){n.preventDefault()}var i=window.kendo,e=i.ui,s=e.Widget,u=i.parseDate,f=i.keys,wt=i.template,bt=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",kt="k-state-hover",dt="mouseenter"+r+" mouseleave"+r,et="mousedown"+r,b="id",ot="min",st="max",ht="month",ct="aria-disabled",lt="aria-expanded",k="aria-hidden",o=i.calendar,gt=o.isInRange,at=o.restrictValue,ni=o.isEqualDatePart,h=n.extend,c=n.proxy,vt=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)},pt;l.prototype={_calendar:function(){var t=this,r=t.calendar,f=t.options,o,u;r||(o=n(g).attr(b,i.guid()).appendTo(t.popup.element).on(et,yt).on(tt,"td:has(.k-link)",c(t._click,t)),t.calendar=r=new e.Calendar(o),t._setOptions(f),i.calendar.makeUnselectable(r.element),dsiCommon.isNullOrEmpty(t.options.dsi)||t.options.dsi.allowBlank&&dsiCommon.isBlankValue(t._value)&&(u=new Date,t._current=new Date(u.getFullYear(),u.getMonth(),u.getDate()),t._value=null),r.navigate(t._value||t._current,f.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,weekNumber:n.weekNumber,start:n.start,disableDates:n.disableDates})},setOptions:function(n){var t=this.options,i=n.disableDates;i&&(n.disableDates=o.disabled(i));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,r=t.calendar,i=t.options,u=i.disableDates;u&&u(n)&&(n=null);t._value=n;t._current=new vt(+at(n,i.min,i.max));r&&r.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;pt=s.extend({init:function(r,f){f.format&&f.format.indexOf("yyyy")==-1&&f.format.indexOf("yy")!=-1&&((f.parseFormats==null||f.parseFormats==t)&&(f.parseFormats=[]),f.format.substr(0,1)=="{"?f.parseFormats.splice(0,0,f.format.substr(3,f.format.length-4)):f.parseFormats.splice(0,0,f.format),f.format=f.format.replace("yy","yyyy"));var o=this,y,c;s.fn.init.call(o,r,f);r=o.element;f=o.options;f.disableDates=i.calendar.disabled(f.disableDates);f.min=u(r.attr("min"))||u(f.min);f.max=u(r.attr("max"))||u(f.max);d(f);o._initialOptions=h({},f);o._wrapper();o.dateView=new l(h({},f,{id:r.attr(b),anchor:o.wrapper,change:function(){o._change(this.value());o.close()},close:function(n){o.element.removeAttr("readonly");o.trigger(v)?n.preventDefault():(r.attr(lt,!1),c.attr(k,!0))},open:function(n){var i=o.options,t;o.trigger(a)?n.preventDefault():(o.element.val()!==o._oldText&&(t=u(r.val(),i.parseFormats,i.culture),o.dateView[t?"current":"value"](t)),r.attr(lt,!0),c.attr(k,!1),o._updateARIA(t))}}));c=o.dateView.div;o._icon();try{r[0].setAttribute("type","text")}catch(p){r[0].type="text"}r.addClass("k-input").attr({role:"combobox","aria-expanded":!1,"aria-owns":o.dateView._dateViewID});o._reset();o._template();y=r.is("[disabled]")||n(o.element).parents("fieldset").is(":disabled");y?o.enable(!1):o.readonly(r.is("[readonly]"));f.dateInput&&(o._dateInput=new e.DateInput(r,{culture:f.culture,format:f.format,min:f.min,max:f.max,value:f.value}));o._old=o._update(f.value||o.element.val());o._oldText=r.val();r.on("tap",function(){r.data("kendoDatePicker").dateView.close()});i.notify(o)},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:[],disableDates:null,ARIATemplate:'Current focused date is #=kendo.toString(data.current, "D")#',dateInput:!1,weekNumber:!1},setOptions:function(n){var t=this,r=t._value;s.fn.setOptions.call(t,n);n=t.options;n.min=u(n.min);n.max=u(n.max);d(n);t.dateView.setOptions(n);t._dateInput&&t._dateInput.setOptions({culture:n.culture,format:n.format,min:n.min,max:n.max,value:n.value});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),u=t.element.off(r),f=t._inputWrapper.off(r),e=n.readonly,i=n.disable;if(e||i)f.addClass(i?w:p).removeClass(i?p:w),u.attr(it,i).attr(rt,e).attr(ct,i);else{f.addClass(p).removeClass(w).on(dt,t._toggleHover);u.removeAttr(it).removeAttr(rt).attr(ct,!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,yt)}},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;s.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(kt,t.type==="mouseenter")},_blur:function(){var n=this,t=n.element.val();n.close();(t!==n._oldText||n._old==dsiCommon.getTranslation("CURRENT_VALUE"))&&n._change(t);n._inputWrapper.removeClass(ut)},_click:function(){var t=this,n=t.element;n.attr("readyonly","readonly");t.dateView.toggle();i.support.touch||n[0]===bt()||n.focus()},_change:function(n){var t=this,e=t.element.val(),r,u,f;n=t._update(n);r=!i.calendar.isEqualDate(t._old,n);u=r&&!t._typing;f=e!==t.element.val();(u||f)&&t.element.trigger(y);r&&(t._old=n,t._oldText=t.element.val(),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._dateInput&&n.stopImmediatePropagation&&n.stopImmediatePropagation():t._typing=!0):t._change(r);i.popup.visible()&&(n.keyCode==f.ENTER||n.keyCode==f.ESC)&&n.stopPropagation()},_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" aria-label="select"><span class="k-icon k-i-calendar"><\/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 vt(+i),f.dateView[n](i))},_update:function(n){var e=this,f=e.options,s=f.min,l=f.max,h=e._value,r=u(n,f.parseFormats,f.culture),a=r===null&&h===null||r instanceof Date&&h instanceof Date,c,o=!1;if(dsiCommon.isNullOrEmpty(f.dsi)||typeof n=="string"&&(f.dsi.allowANDOR&&(n.indexOf("^")!=-1||n.indexOf("&")!=-1)&&(o=!0,f.dsi.override="andor",r=n),!o&&f.dsi.allowWildCards&&(n.indexOf("*")!=-1||n.indexOf("_")!=-1)&&(o=!0,f.dsi.override="wildcard",r=n)),!o){if(f.disableDates(r)&&(r=null,e._old||e.element.val()||(n=null)),+r==+h&&a)return c=i.toString(r,f.format,f.culture),c!==n&&e.element.val(r===null?n:c),r;r!==null&&ni(r,s)?r=at(r,s,l):gt(r,s,l)||(r=null)}return r===null&&f.dsi&&(f.dsi.allowBlank&&dsiCommon.isBlankValue(n)&&(o=!0,f.dsi.override="blank",r=n),f.dsi.allowCurrentValue&&dsiCommon.isCurrentValue(n)&&(o=!0,f.dsi.override="currentvalue",r=n)),e._value=r,e.dateView.value(r),e._dateInput&&r?e._dateInput.value(r||n):e.element.val(i.toString(r||n,f.format,f.culture)),e._updateARIA(r),o||dsiCommon.isNullOrEmpty(f.dsi)||(f.dsi.override=t),r},_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=wt(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(pt)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.virtuallist",["kendo.data"],n)}(function(){return function(n,t){function c(n){return n[n.length-1]}function o(n){return n instanceof Array?n:[n]}function s(n){return typeof n=="string"||typeof n=="number"||typeof n=="boolean"}function lt(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 at(){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 vt(n,t,i){return{down:n*i,up:n*(t-1-i)}}function yt(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 pt(n,t){return function(i){return t(n.scrollTop,i)}}function wt(n){return function(t,i){return n(t.items,t.index,i),t}}function bt(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 kt(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})}}function dt(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 gt(i,f,e){var o=e.template;i=n(i);f.item||(o=e.placeholderTemplate);f.index===0&&this.header&&f.group&&this.header.html(e.fixedGroupTemplate(f.group));this.angular("cleanup",function(){return{elements:[i]}});i.attr("data-uid",f.item?f.item.uid:"").attr("data-offset-index",f.index).html(o(f.item||{}));i.toggleClass(r,f.current);i.toggleClass(u,f.selected);i.toggleClass("k-first",f.newGroup);i.toggleClass("k-loading-item",!f.item);f.index!==0&&f.newGroup&&n("<div class="+ct+"><\/div>").appendTo(i).html(e.groupTemplate(f.group));f.top!==t&&bt(i[0],f.top);this.angular("compile",function(){return{elements:[i],data:[{dataItem:f.item,group:f.group,newGroup:f.newGroup}]}})}function ni(n,t){var h=t.length,e=n.length,r,f,i,u,o=[],s=[];if(e)for(i=0;i<e;i++){for(r=n[i],f=!1,u=0;u<h;u++)if(r===t[u]){f=!0;o.push({index:i,item:r});break}f||s.push(r)}return{changed:o,unchanged:s}}function g(n){return n&&n.state()!=="resolved"}var i=window.kendo,v=i.ui,l=v.Widget,tt=v.DataBoundWidget,it=n.proxy,rt="k-virtual-wrap",ut="k-virtual-list",ft="k-virtual-content",et="k-list",ot="k-group-header",a="k-virtual-item",st="k-item",ht="k-height-container",ct="k-group",u="k-state-selected",r="k-state-focused",y="k-state-hover",f="change",h="click",p="listBound",w="itemChange",b="activate",k="deactivate",e=".VirtualList",nt=tt.extend({init:function(t,r){var u=this;u.bound(!1);u._fetching=!1;l.fn.init.call(u,t,r);u.options.itemHeight||(u.options.itemHeight=at());r=u.options;u.element.addClass(et+" "+ut).attr("role","listbox");u.content=u.element.wrap("<div unselectable='on' class='"+ft+"'><\/div>").parent();u.wrapper=u.content.wrap("<div class='"+rt+"'><\/div>").parent();u.header=u.content.before("<div class='"+ot+"'><\/div>").prev();u.element.on("mouseenter"+e,"li:not(.k-loading-item)",function(){n(this).addClass(y)}).on("mouseleave"+e,"li",function(){n(this).removeClass(y)});u._values=o(u.options.value);u._selectedDataItems=[];u._selectedIndexes=[];u._rangesList={};u._promisesList=[];u._optionID=i.guid();u._templates();u.setDataSource(r.dataSource);u.content.on("scroll"+e,i.throttle(function(){u._renderItems();u._triggerListBound()},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:"#:data#",mapValueTo:"index",valueMapper:null},events:[f,h,p,w,b,k],setOptions:function(n){l.fn.setOptions.call(this,n);this._selectProxy&&this.options.selectable===!1?this.element.off(h,"."+a,this._selectProxy):!this._selectProxy&&this.options.selectable&&this._selectable();this._templates();this.refresh()},items:function(){return n(this._items)},destroy:function(){this.wrapper.off(e);this.dataSource.unbind(f,this._refreshHandler);l.fn.destroy.call(this)},setDataSource:function(t){var r=this,u=t||{},e;u=n.isArray(u)?{data:u}:u;u=i.data.DataSource.create(u);r.dataSource?(r.dataSource.unbind(f,r._refreshHandler),r._clean(),r.bound(!1),r._deferValueSet=!0,e=r.value(),r.value([]),r.mute(function(){r.value(e)})):r._refreshHandler=n.proxy(r.refresh,r);r.dataSource=u.bind(f,r._refreshHandler);r.setDSFilter(u.filter());u.view().length!==0?r.refresh():r.options.autoBind&&u.fetch()},skip:function(){return this.dataSource.currentRangeStart()},_triggerListBound:function(){var n=this,t=n.skip();n.bound()&&!n._selectingValue&&n._skip!==t&&(n._skip=t,n.trigger(p))},_getValues:function(t){var i=this._valueGetter;return n.map(t,function(n){return i(n)})},refresh:function(n){var t=this,r=n&&n.action,u=r==="itemchange",f=this.isFiltered(),i;t._mute||(t._deferValueSet=!1,t._fetching?(t._renderItems&&t._renderItems(!0),t._triggerListBound()):(f&&t.focus(0),t._createList(),r||!t._values.length||f||t.options.skipUpdateOnBind?(t.bound(!0),t._triggerListBound()):(t._selectingValue=!0,t.value(t._values,!0).done(function(){t.bound(!0);t._selectingValue=!1;t._triggerListBound()}))),(u||r==="remove")&&(i=ni(t._selectedDataItems,n.items),i.changed.length&&(u?t.trigger("selectedItemChange",{items:i.changed}):t.value(t._getValues(i.unchanged)))),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=o(n)},value:function(i,r){var u=this,f;return i===t?u._values.slice():(i===null&&(i=[]),i=o(i),u._valueDeferred&&u._valueDeferred.state()!=="resolved"||(u._valueDeferred=n.Deferred()),f=u.options.selectable==="multiple"&&u.select().length&&i.length,(f||!i.length)&&u.select(-1),u._values=i,(u.bound()&&!u._mute&&!u._deferValueSet||r)&&u._prefetchByValue(i),u._valueDeferred)},_prefetchByValue:function(n){for(var r,t=this,f=t._dataView,c=t._valueGetter,o=t.options.mapValueTo,i,h=!1,e=[],u=0;u<n.length;u++)for(r=0;r<f.length;r++)i=f[r].item,i&&(h=s(i)?n[u]===i:n[u]===c(i),h&&e.push(f[r].index));if(e.length===n.length){t._values=[];t.select(e);return}typeof t.options.valueMapper=="function"?t.options.valueMapper({value:this.options.selectable==="multiple"?n:n[0],success:function(n){o==="index"?t.mapValueToIndex(n):o==="dataItem"&&t.mapValueToDataItem(n)}}):t.select([-1])},mapValueToIndex:function(n){if(n=n===t||n===-1||n===null?[]:o(n),n.length){var i=this._deselect([]).removed;i.length&&this._triggerChange(i,[])}else n=[-1];this.select(n)},mapValueToDataItem:function(i){var e,s,r,f;if(i=i===t||i===null?[]:o(i),i.length){for(e=n.map(this._selectedDataItems,function(n,t){return{index:t,dataItem:n}}),s=n.map(i,function(n,t){return{index:t,dataItem:n}}),this._selectedDataItems=i,this._selectedIndexes=[],r=0;r<this._selectedDataItems.length;r++)f=this._getElementByDataItem(this._selectedDataItems[r]),this._selectedIndexes.push(this._getIndecies(f)[0]),f.addClass(u);this._triggerChange(e,s);this._valueDeferred&&this._valueDeferred.resolve()}else this.select([-1])},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 g(i._activeDeferred)||(i._activeDeferred=n.Deferred(),i._promisesList=[]),n.each(t,function(n,t){i._promisesList.push(i.deferredRange(i._getSkip(t,r)))}),u&&n.when.apply(n,i._promisesList).done(function(){i._promisesList=[];i._activeDeferred.resolve()}),i._activeDeferred},_findDataItem:function(n,t){var i,r;if(this.options.type==="group")for(r=0;r<n.length;r++)if(i=n[r].items,i.length<=t)t=t-i.length;else return i[t];return n[t]},_getRange:function(n,t){return this.dataSource._findRange(n,Math.min(n+t,this.dataSource.total()))},dataItemByIndex:function(n){var t=this.itemCount,i=this._getSkip(n,t),r=this._getRange(i,t);return this._findDataItem(r,[n-i])},selectedDataItems:function(){return this._selectedDataItems.slice()},scrollWith:function(n){this.content.scrollTop(this.content.scrollTop()+n)},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,h;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=c(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),h=this._getElementLocation(u),h==="top"?this.scrollTo(u*s):h==="bottom"?this.scrollTo(u*s+s-this._screenHeight):h==="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)},_triggerChange:function(n,t){n=n||[];t=t||[];(n.length||t.length)&&this.trigger(f,{removed:n,added:t})},select:function(i){var r=this,u,h=r.options.selectable!=="multiple",l=g(r._activeDeferred),v=this.isFiltered(),a,e,o,f=[],s;return i===t?r._selectedIndexes.slice():(r._selectDeferred&&r._selectDeferred.state()!=="resolved"||(r._selectDeferred=n.Deferred()),u=r._getIndecies(i),a=h&&!v&&c(u)===c(this._selectedIndexes),f=r._deselectCurrentValues(u),f.length||!u.length||a)?(r._triggerChange(f),r._valueDeferred&&r._valueDeferred.resolve(),r._selectDeferred.resolve().promise()):(u.length===1&&u[0]===-1&&(u=[]),o=r._deselect(u),f=o.removed,u=o.indices,h&&(l=!1,u.length&&(u=[c(u)])),s=function(){var n=r._select(u);r.focus(u);r._triggerChange(f,n);r._valueDeferred&&r._valueDeferred.resolve();r._selectDeferred.resolve()},e=r.prefetch(u),l||(e?e.done(s):s()),r._selectDeferred.promise())},bound:function(n){if(n===t)return this._listCreated;this._listCreated=n},mute:function(n){this._mute=!0;it(n(),this);this._mute=!1},setDSFilter:function(t){this._lastDSFilter=n.extend({},t)},isFiltered:function(){return this._lastDSFilter||this.setDSFilter(this.dataSource.filter()),!i.data.Query.compareFilters(this.dataSource.filter(),this._lastDSFilter)},skipUpdate:n.noop,_getElementByIndex:function(t){return this.items().filter(function(i,r){return t===parseInt(n(r).attr("data-offset-index"),10)})},_getElementByDataItem:function(t){for(var r=this._dataView,f=this._valueGetter,u,e,i=0;i<r.length;i++)if(e=r[i].item&&s(r[i].item)?r[i].item===t:r[i].item&&t&&f(r[i].item)==f(t),e){u=r[i];break}return u?this._getElementByIndex(u.index):n()},_clean:function(){this.result=t;this._lastScrollTop=t;this._skip=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},setScreenHeight:function(){var n=this._height();this.content.height(n);this._screenHeight=n},screenHeight:function(){return this._screenHeight},_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 t=this.options,n={template:t.template,placeholderTemplate:t.placeholderTemplate,groupTemplate:t.groupTemplate,fixedGroupTemplate:t.fixedGroupTemplate};for(var r in n)typeof n[r]!="function"&&(n[r]=i.template(n[r]||""));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+" "+st,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.bound()&&t._clean();t._saveInitialRanges();t._buildValueGetter();t.setScreenHeight();t.itemCount=lt(t._screenHeight,r.listScreens,r.itemHeight);t.itemCount>i.total()&&(t.itemCount=i.total());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(pt(u,t._onScroll),wt(t._reorderList(t._items,n.proxy(gt,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],ht),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&&this.mute(function(){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&&this.mute(function(){n.range(o,t);i=o}),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._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,n.range(o,t))})),null}},_fixedHeader:function(n,t){var f=this.currentVisibleGroup,e=this.options.itemHeight,o=Math.floor((n-t.top)/e),r=t.items[o],i,u;return r&&r.item&&(i=r.group,i!==f&&(u=i||"",this.header.html(this.templates.fixedGroupTemplate(u)),this.currentVisibleGroup=i)),t},_itemMapper:function(n,t,i){var c=this.options.type,l=this.options.itemHeight,a=this._focusedIndex,u=!1,f=!1,e=!1,o=null,h=!1,v=this._valueGetter,r;if(c==="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),!this.isFiltered()&&i.length&&n)for(r=0;r<i.length;r++)if(h=s(n)?i[r]===n:i[r]===v(n),h){i.splice(r,1);u=!0;break}return a===t&&(f=!0),{item:n?n:null,group:o,newGroup:e,selected:u,current:f,index:t,top:t*l}},_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=yt(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(kt(i,this.templates),this),function(n,e,o){var s=e-r,h,c;o||Math.abs(s)>=f?(h=t,c=n):(h=dt(t,s),c=s>0?n.slice(-s):n.slice(0,-s));i(h,c,u.bound());r=e}},_bufferSizes:function(){var n=this.options;return vt(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(h+e,"."+a,this._selectProxy)}},getElementIndex:function(n){return(n instanceof jQuery)?parseInt(n.attr("data-offset-index"),10):t},_getIndecies:function(n){var t=[],r,i,u;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),u=this.getElementIndex(n),isNaN(u)||t.push(u),n instanceof Array&&(t=n),t},_deselect:function(i){var p=[],a,c,e=this._selectedIndexes,o=this._selectedDataItems,v=0,b=this.options.selectable,w=0,k=this._valueGetter,y,d,l=null,r,f,h;if(i=i.slice(),b!==!0&&i.length){if(b==="multiple")for(f=0;f<i.length;f++){if(l=null,v=n.inArray(i[f],e),c=this.dataItemByIndex(i[f]),v===-1&&c)for(h=0;h<o.length;h++)d=s(c)?o[h]===c:k(o[h])===k(c),d&&(y=this._getElementByIndex(i[f]),l=this._deselectSingleItem(y,h,i[f],w));else a=e[v],a!==t&&(y=this._getElementByIndex(a),l=this._deselectSingleItem(y,v,a,w));l&&(i.splice(f,1),p.push(l),w++,f--)}}else{for(r=0;r<e.length;r++)o[r]?this._getElementByDataItem(o[r]).removeClass(u):e[r]!==t&&this._getElementByIndex(e[r]).removeClass(u),p.push({index:e[r],position:r,dataItem:o[r]});this._values=[];this._selectedDataItems=[];this._selectedIndexes=[]}return{indices:i,removed:p}},_deselectSingleItem:function(n,t,i,r){var f;if(n.hasClass("k-state-selected"))return n.removeClass(u),this._values.splice(t,1),this._selectedIndexes.splice(t,1),f=this._selectedDataItems.splice(t,1)[0],{index:i,position:t+r,dataItem:f}},_deselectCurrentValues:function(t){var o=this.element[0].children,s,f,r,h=this._values,u=[],e=0,i;if(this.options.selectable!=="multiple"||!this.isFiltered())return[];if(t[0]===-1)return n(o).removeClass("k-state-selected"),u=n.map(this._selectedDataItems.slice(0),function(n,t){return{dataItem:n,position:t}}),this._selectedIndexes=[],this._selectedDataItems=[],this._values=[],u;for(;e<t.length;e++){for(r=-1,f=t[e],s=this._valueGetter(this.dataItemByIndex(f)),i=0;i<h.length;i++)if(s==h[i]){r=i;break}r>-1&&(u.push(this.removeAt(r)),n(o[f]).removeClass("k-state-selected"))}return u},_getSkip:function(n,t){var i=n<t?1:Math.floor(n/t)+1;return(i-1)*t},_select:function(t){var i=this,c=this.options.selectable!=="multiple",f=this.dataSource,r,o,e=this.itemCount,l=this._valueGetter,h=[];return c&&(i._selectedIndexes=[],i._selectedDataItems=[],i._values=[]),o=f.skip(),n.each(t,function(n,t){var c=i._getSkip(t,e);i.mute(function(){f.range(c,e);r=i._findDataItem(f.view(),[t-c]);i._selectedIndexes.push(t);i._selectedDataItems.push(r);i._values.push(s(r)?r:l(r));h.push({index:t,dataItem:r});i._getElementByIndex(t).addClass(u);f.range(o,e)})}),h},_clickHandler:function(t){var i=n(t.currentTarget);!t.isDefaultPrevented()&&i.attr("data-uid")&&this.trigger(h,{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=nt;i.ui.plugin(nt)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.autocomplete",["kendo.list","kendo.mobile.scroller","kendo.virtuallist"],n)}(function(){return function(n,t){function a(n,t,i){return i?t.substring(0,n).split(i).length-1:0}function ut(n,t,i){return t.split(i)[a(n,t,i)]}function ft(n,t,i,r,u){var f=t.split(r);return f.splice(a(n,t,r),1,i),r&&f[f.length-1]!==""&&f.push(""),f.join(u)}var u=window.kendo,g=u.support,e=u.caret,s=u._activeElement,v=g.placeholder,y=u.ui,f=y.List,i=u.keys,nt=u.data.DataSource,p="aria-disabled",w="aria-readonly",h="change",c="k-state-default",b="disabled",k="readonly",d="k-state-focused",tt="k-state-selected",l="k-state-disabled",it="k-state-hover",r=".kendoAutoComplete",rt="mouseenter"+r+" mouseleave"+r,o=n.proxy,et=f.extend({init:function(t,i){var e=this,s,h;e.ns=r;i=n.isArray(i)?{dataSource:i}:i;f.fn.init.call(e,t,i);t=e.element;i=e.options;i.placeholder=i.placeholder||t.attr("placeholder");v&&t.attr("placeholder",i.placeholder);e._wrapper();e._loader();e._clearButton();e._dataSource();e._ignoreCase();t[0].type="text";s=e.wrapper;e._popup();t.addClass("k-input").on("keydown"+r,o(e._keydown,e)).on("keypress"+r,o(e._keypress,e)).on("paste"+r,o(e._search,e)).on("focus"+r,function(){e._prev=e._accessor();e._oldText=e._prev;e._placeholder(!1);s.addClass(d)}).on("focusout"+r,function(){e._change();e._placeholder();e.close();s.removeClass(d)}).attr({autocomplete:"off",role:"textbox","aria-haspopup":!0});e._clear.on("click"+r,o(e._clearValue,e));e._enable();e._old=e._accessor();t[0].id&&t.attr("aria-owns",e.ul[0].id);e._aria();e._placeholder();e._initList();h=n(e.element).parents("fieldset").is(":disabled");h&&e.enable(!1);e.listView.bind("click",function(n){n.preventDefault()});e._resetFocusItemHandler=n.proxy(e._resetFocusItem,e);u.notify(e);e._toggleCloseVisibility()},options:{name:"AutoComplete",enabled:!0,suggest:!1,template:"",groupTemplate:"#:data#",fixedGroupTemplate:"#:data#",dataTextField:"",minLength:1,enforceMinLength:!1,delay:200,height:200,filter:"startswith",ignoreCase:!0,highlightFirst:!1,separator:null,placeholder:"",animation:{},virtual:!1,value:null,clearButton:!0},_dataSource:function(){var n=this;n.dataSource&&n._refreshHandler?n._unbindDataSource():(n._progressHandler=o(n._showBusy,n),n._errorHandler=o(n._hideBusy,n));n.dataSource=nt.create(n.options.dataSource).bind("progress",n._progressHandler).bind("error",n._errorHandler)},setDataSource:function(n){this.options.dataSource=n;this._dataSource();this.listView.setDataSource(this.dataSource)},events:["open","close",h,"select","filtering","dataBinding","dataBound"],setOptions:function(n){var t=this._listOptions(n);f.fn.setOptions.call(this,n);this.listView.setOptions(t);this._accessors();this._aria();this._clearButton()},_listOptions:function(t){var i=f.fn._listOptions.call(this,n.extend(t,{skipUpdateOnBind:!0}));return i.dataValueField=i.dataTextField,i.selectedItemChange=null,i},_editable:function(n){var i=this,f=i.element,e=i.wrapper.off(r),u=n.readonly,t=n.disable;if(u||t)e.addClass(t?l:c).removeClass(t?c:l),f.attr(b,t).attr(k,u).attr(p,t).attr(w,u);else{e.addClass(c).removeClass(l).on(rt,i._toggleHover);f.removeAttr(b).removeAttr(k).attr(p,!1).attr(w,!1)}},close:function(){var n=this,t=n.listView.focus();t&&t.removeClass(tt);n.popup.close()},destroy:function(){var n=this;n.element.off(r);n._clear.off(r);n.wrapper.off(r);f.fn.destroy.call(n)},refresh:function(){this.listView.refresh()},select:function(n){this._select(n)},search:function(t){var i=this,r=i.options,f=r.ignoreCase,o=i._separator(),u;if(t=t||i._accessor(),clearTimeout(i._typingTimeout),o&&(t=ut(e(i.element)[0],t,o)),u=t.length,!r.enforceMinLength&&!u||u>=r.minLength){i._open=!0;i._mute(function(){this.listView.value([])});i._filterSource({value:f?t.toLowerCase():t,operator:r.filter,field:r.dataTextField,ignoreCase:f});i.one("close",n.proxy(i._unifySeparators,i))}i._toggleCloseVisibility()},suggest:function(n){var r=this,y=r._last,u=r._accessor(),v=r.element[0],o=e(v)[0],c=r._separator(),l=u.split(c),p=a(o,u,c),w=o,h;if(y==i.BACKSPACE||y==i.DELETE){r._last=t;return}n=n||"";typeof n!="string"&&(n[0]&&(n=r.dataSource.view()[f.inArray(n[0],r.ul[0])]),n=n?r._text(n):"");o<=0&&(o=u.toLowerCase().indexOf(n.toLowerCase())+1);h=u.substring(0,o).lastIndexOf(c);h=h>-1?o-(h+c.length):o;u=l[p].substring(0,h);n&&(n=n.toString(),h=n.toLowerCase().indexOf(u.toLowerCase()),h>-1&&(n=n.substring(h+u.length),w=o+n.length,u+=n),c&&l[l.length-1]!==""&&l.push(""));l[p]=u;r._accessor(l.join(c||""));v===s()&&e(v,o,w)},value:function(n){if(n!==t)this.listView.value(n),this._accessor(n),this._old=this._accessor(),this._oldText=this._accessor();else return this._accessor()},_click:function(n){var i=n.item,t=this,r=t.element,u=t.listView.dataItemByIndex(t.listView.getElementIndex(i));if(n.preventDefault(),t._active=!0,t.trigger("select",{dataItem:u,item:i})){t.close();return}t._oldText=r.val();t._select(i).done(function(){t._blur();e(r,r.val().length)})},_clearText:n.noop,_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,h=n.dataSource._group.length,o=n.element[0]===s(),r;if(n._renderFooter(),n._renderNoData(),n._toggleNoData(!i),n._toggleHeader(!!h&&!!i),n._resizePopup(),u.position(),i&&f.suggest&&o&&n.suggest(e[0]),n._open){if(n._open=!1,r=n._allowOpening()?"open":"close",n._typingTimeout&&!o&&(r="close"),i&&(n._resetFocusItem(),f.virtual))n.popup.unbind("activate",n._resetFocusItemHandler).one("activate",n._resetFocusItemHandler);u[r]();n._typingTimeout=t}n._touchScroller&&n._touchScroller.reset();n._hideBusy();n._makeUnselectable();n.trigger("dataBound")},_mute:function(n){this._muted=!0;n.call(this);this._muted=!1},_listChange:function(){var n=this._active||this.element[0]===s();n&&!this._muted&&this._selectValue(this.listView.selectedDataItems()[0])},_selectValue:function(n){var i=this._separator(),t="";n&&(t=this._text(n));t===null&&(t="");i&&(t=ft(e(this.element)[0],this._accessor(),t,i,this._defaultSeparator()));this._prev=t;this._accessor(t);this._placeholder()},_unifySeparators:function(){return this._accessor(this.value().split(this._separator()).join(this._defaultSeparator())),this},_preselect:function(n,t){this._inputValue(t);this._accessor(n);this._old=this.oldText=this._accessor();this.listView.setValue(n);this._placeholder()},_change:function(){var n=this,t=n._unifySeparators().value(),i=t!==f.unifyType(n._old,typeof t),r=i&&!n._typing,u=n._oldText!==t;n._old=t;n._oldText=t;(r||u)&&n.element.trigger(h);i&&n.trigger(h);n.typing=!1;n._toggleCloseVisibility()},_accessor:function(n){var i=this,r=i.element[0],f;if(n!==t)n!==null&&i.options.format&&(f=i.options.format.match("^{0:")?i.options.format.slice(3,-1):i.options.format,f.length>0&&(n=u.toString(n,f))),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 r=this,t=n.keyCode,f=r.listView,e=r.popup.visible(),u=f.focus(),o,s;if(r._last=t,t===i.DOWN)e?this._move(u?"focusNext":"focusFirst"):r.value()&&r.popup.open(),n.preventDefault();else if(t===i.UP)e&&this._move(u?"focusPrev":"focusLast"),n.preventDefault();else if(t===i.HOME)this._move("focusFirst");else if(t===i.END)this._move("focusLast");else if(t===i.ENTER||t===i.TAB){if(t===i.ENTER&&e&&n.preventDefault(),e&&u){if(o=f.dataItemByIndex(f.getElementIndex(u)),r.trigger("select",{dataItem:o,item:u}))return;this._select(u)}this._blur()}else t===i.ESC?(e?n.preventDefault():r._clearValue(),r.close()):r.popup.visible()&&(t===i.PAGEDOWN||t===i.PAGEUP)?(n.preventDefault(),s=t===i.PAGEDOWN?1:-1,f.scrollWith(s*f.screenHeight())):(r.popup._hovered=!0,r._search())},_keypress:function(){this._oldText=this.element.val();this._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;n._showClear()},_showBusy:function(){var n=this;n._busy||(n._busy=setTimeout(function(){n.element.attr("aria-busy",!0);n._loading.show();n._hideClear()},100))},_placeholder:function(n){if(!v){var f=this,u=f.element,i=f.options.placeholder,r;if(i){if(r=u.val(),n===t&&(n=!r),n||(i=r!==i?r:""),r===f._old&&!n)return;u.toggleClass("k-readonly",n).val(i);i||u[0]!==document.activeElement||e(u[0],0,0)}}},_separator:function(){var n=this.options.separator;return n instanceof Array?new RegExp(n.join("|"),"gi"):n},_defaultSeparator:function(){var n=this.options.separator;return n instanceof Array?n[0]:n},_inputValue:function(){return this.element.val()},_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){var t=this;return t._active=!0,t.listView.select(n).done(function(){t._active=!1})},_loader:function(){this._loading=n('<span class="k-icon k-i-loading" style="display:none"><\/span>').insertAfter(this.element)},_clearButton:function(){f.fn._clearButton.call(this);this.options.clearButton&&(this._clear.insertAfter(this.element),this.wrapper.addClass("k-autocomplete-clearable"))},_toggleHover:function(t){n(t.currentTarget).toggleClass(it,t.type==="mouseenter")},_toggleCloseVisibility:function(){this.value()?this._showClear():this._hideClear()},_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)}});y.plugin(et)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.dropdownlist",["kendo.list","kendo.mobile.scroller","kendo.virtuallist"],n)}(function(){return function(n,t){function tt(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}function it(n,t){return n>=t&&(n-=t),n}function et(n,t){for(var i=0;i<n.length;i++)if(n.charAt(i)!==t)return!1;return!0}var r=window.kendo,h=r.ui,rt=h.List,e=h.Select,o=r.support,c=r._activeElement,l=r.data.ObservableObject,u=r.keys,i=".kendoDropDownList",k="disabled",d="readonly",a="change",g="k-state-focused",v="k-state-default",y="k-state-disabled",nt="aria-disabled",p="mouseenter"+i+" mouseleave"+i,s="tabindex",w="filter",b="accept",ut="The `optionLabel` option is not valid due to missing fields. Define a custom optionLabel as shown here http://docs.telerik.com/kendo-ui/api/javascript/ui/dropdownlist#configuration-optionLabel",f=n.proxy,ft=e.extend({init:function(u,o){var h=this,a=o&&o.index,l,c,v;h.ns=i;o=n.isArray(o)?{dataSource:o}:o;e.fn.init.call(h,u,o);o=h.options;u=h.element.on("focus"+i,f(h._focusHandler,h));h._focusInputHandler=n.proxy(h._focusInput,h);h.optionLabel=n();h._optionLabel();h._inputTemplate();h._reset();h._prev="";h._word="";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&&(o.index=a);h._initialIndex=o.index;h.requireValueMapper(h.options);h._initList();h._cascade();o.autoBind?h.dataSource.fetch():h.selectedIndex===-1&&(c=o.text||"",c||(l=o.optionLabel,l&&o.index===0?c=l:h._isSelect&&(c=u.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,enforceMinLength:!1,virtual:!1,template:null,valueTemplate:null,optionLabelTemplate:null,groupTemplate:"#:data#",fixedGroupTemplate:"#:data#"},events:["open","close",a,"select","filtering","dataBinding","dataBound","cascade","set"],setOptions:function(n){e.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.hasOptionLabel()&&this.select(0)},destroy:function(){var n=this;e.fn.destroy.call(n);n.wrapper.off(i);n.element.off(i);n._inputWrapper.off(i);n._arrow.off();n._arrow=null;n._arrowIcon=null;n.optionLabel.off()},open:function(){var n=this,t=n.dataSource.filter()?n.dataSource.filter().filters.length>0:!1;if(!n.popup.visible())if(n.listView.bound()&&n._state!==b){if(n._allowOpening()){n._open=!0;n.popup.one("activate",n._focusInputHandler);n.popup._hovered=!0;n.popup.open();n._resizeFilterInput();n._focusItem()}}else if(n._open=!0,n._state="rebind",n.filterInput&&(n.filterInput.val(""),n._prev=""),n.filterInput&&n.options.minLength!==1&&!t){n.refresh();n.popup.one("activate",n._focusInputHandler);n.popup.open();n._resizeFilterInput()}else n._filterSource()},_focusInput:function(){this._focusElement(this.filterInput)},_resizeFilterInput:function(){var n=this.filterInput,u=this._prevent,t,i;n&&(t=this.filterInput[0]===c(),i=r.caret(this.filterInput[0])[0],this._prevent=!0,n.css("display","none").css("width",this.popup.element.css("width")).css("display","inline-block"),t&&(n.focus(),r.caret(n[0],i)),this._prevent=u)},_allowOpening:function(){return this.hasOptionLabel()||this.filterInput||e.fn._allowOpening.call(this)},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.hasOptionLabel())?this.optionLabel:i;this._focus(n)},dataItem:function(i){var r=this,u=null;if(i===null)return i;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 r.hasOptionLabel()&&(i-=1);u=r.dataSource.flatView()[i]}return u||(u=r._optionLabelDataItem()),u},refresh:function(){this.listView.refresh()},text:function(n){var i=this,r,u=i.options.ignoreCase;if(n=n===null?"":n,n!==t){if(typeof n!="string"){i._textAccessor(n);return}r=u?n.toLowerCase():n;i._select(function(n){return n=i._text(n),u&&(n=(n+"").toLowerCase()),n===r}).done(function(){i._textAccessor(i.dataItem()||n)})}else return i._textAccessor()},_clearFilter:function(){n(this.filterInput).val("");e.fn._clearFilter.call(this)},value:function(n){var i=this,r=i.listView,u=i.dataSource;if(n===t)return!dsiCommon.isNullOrEmpty(i.options.dsi)&&i.options.dsi.allowNullOverride?(n=i.listView.value()[0],n===t||n):(n=i._accessor()||i.listView.value()[0],n===t||n===null?"":n);if(i.requireValueMapper(i.options,n),(n||!i.hasOptionLabel())&&(i._initialIndex=null),this.trigger("set",{value:n}),i._request&&i.options.cascadeFrom&&i.listView.bound()){i._valueSetter&&u.unbind(a,i._valueSetter);i._valueSetter=f(function(){i.value(n)},i);u.one(a,i._valueSetter);return}i._isFilterEnabled()&&r.bound()&&r.isFiltered()?i._clearFilter():i._fetchData();r.value(n).done(function(){i._old=i._accessor();i._oldIndex=i.selectedIndex})},hasOptionLabel:function(){return this.optionLabel&&!!this.optionLabel[0]},_optionLabel:function(){var t=this,u=t.options,e=u.optionLabel,i=u.optionLabelTemplate;if(!e){t.optionLabel.off().remove();t.optionLabel=n();return}i||(i="#:",i+=typeof e=="string"?"data":r.expr(u.dataTextField,"data"),i+="#");typeof i!="function"&&(i=r.template(i));t.optionLabelTemplate=i;t.hasOptionLabel()||(t.optionLabel=n('<div class="k-list-optionlabel"><\/div>').prependTo(t.list));t.optionLabel.html(i(e)).off().click(f(t._click,t)).on(p,t._toggleHover);t.angular("compile",function(){return{elements:t.optionLabel,data:[{dataItem:t._optionLabelDataItem()}]}})},_optionLabelText:function(){var n=this.options.optionLabel;return typeof n=="string"?n:this._text(n)},_optionLabelDataItem:function(){var i=this,r=i.options.optionLabel;return i.hasOptionLabel()?n.isPlainObject(r)?new l(r):i._assignInstance(i._optionLabelText(),""):t},_buildOptions:function(n){var i=this;if(i._isSelect){var r=i.listView.value()[0],u=i._optionLabelDataItem(),f=u&&i._value(u);(r===t||r===null)&&(r="");u&&((f===t||f===null)&&(f=""),u='<option value="'+f+'">'+i._text(u)+"<\/option>");i._options(n,u,r);r!==rt.unifyType(i._accessor(),typeof r)&&(i._customOption=null,i._custom(r))}},_listBound:function(){var n=this,i=n._initialIndex,u=n._state===w,r=n.dataSource.flatView(),t;n._presetValue=!1;n._renderFooter();n._renderNoData();n._toggleNoData(!r.length);n._resizePopup(!0);n.popup.position();n._buildOptions(r);n._makeUnselectable();u||(n._open&&n.toggle(n._allowOpening()),n._open=!1,n._fetch||(r.length?(!n.listView.value().length&&i>-1&&i!==null&&n.select(i),n._initialIndex=null,t=n.listView.selectedDataItems()[0],t&&n.text()!==n._text(t)&&n._selectValue(t)):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)},_filterPaste:function(){this._search()},_focusHandler:function(){this.wrapper.focus()},_focusinHandler:function(){this._inputWrapper.addClass(g);this._prevent=!1},_focusoutHandler:function(){var n=this,t=window.self!==window.top;n._prevent||(clearTimeout(n._typingTimeout),o.mobileOS.ios&&t?n._change():n._blur(),n._inputWrapper.removeClass(g),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._prevent=!1;this._toggle()},_editable:function(n){var t=this,o=t.element,u=n.disable,h=n.readonly,r=t.wrapper.add(t.filterInput).off(i),e=t._inputWrapper.off(p);if(h||u)if(u)r.removeAttr(s),e.addClass(y).removeClass(v);else{e.addClass(v).removeClass(y);r.on("focusin"+i,f(t._focusinHandler,t)).on("focusout"+i,f(t._focusoutHandler,t))}else{o.removeAttr(k).removeAttr(d);e.addClass(v).removeClass(y).on(p,t._toggleHover);r.attr(s,r.data(s)).attr(nt,!1).on("keydown"+i,f(t._keydown,t)).on("focusin"+i,f(t._focusinHandler,t)).on("focusout"+i,f(t._focusoutHandler,t)).on("mousedown"+i,f(t._wrapperMousedown,t)).on("paste"+i,f(t._filterPaste,t));t.wrapper.on("click"+i,f(t._wrapperClick,t));if(!t.filterInput)r.on("keypress"+i,f(t._keypress,t))}o.attr(k,u).attr(d,h);r.attr(nt,u)},_keydown:function(n){var t=this,i=n.keyCode,o=n.altKey,e,r,f=t.popup.visible(),s;if(f&&(n.keyCode==u.ENTER||n.keyCode==u.ESC)&&n.stopPropagation(),t.filterInput&&(e=t.filterInput[0]===c()),i===u.LEFT?(i=u.UP,r=!0):i===u.RIGHT&&(i=u.DOWN,r=!0),!r||!e){if(n.keyCode=i,(o&&i===u.UP||i===u.ESC)&&t._focusElement(t.wrapper),t._state===w&&i===u.ESC&&(t._clearFilter(),t._open=!1,t._state=b),i===u.ENTER&&t._typingTimeout&&t.filterInput&&f){n.preventDefault();return}if(i!==u.SPACEBAR||e||(t.toggle(!f),n.preventDefault()),r=t._move(n),!r){if((!f||!t.filterInput)&&(s=t._focus(),i===u.HOME?(r=!0,t._firstItem()):i===u.END&&(r=!0,t._lastItem()),r)){if(t.trigger("select",{dataItem:t._getElementDataItem(t._focus()),item:t._focus()})){t._focus(s);return}t._select(t._focus(),!0).done(function(){f||t._blur()});n.preventDefault()}o||r||!t.filterInput||t._search()}}},_matchText:function(n,i){var r=this.options.ignoreCase;return n===t||n===null?!1:(n=n+"",r&&(n=n.toLowerCase()),n.indexOf(i)===0)},_shuffleData:function(n,t){var i=this._optionLabelDataItem();return i&&(n=[i].concat(n)),n.slice(t).concat(n.slice(0,t))},_selectNext:function(){var n=this,t=n.dataSource.flatView(),u=t.length+(n.hasOptionLabel()?1:0),e=et(n._word,n._last),i=n.selectedIndex,o,f,r;for(i===-1?i=0:(i+=e?1:0,i=it(i,u)),t=t.toJSON?t.toJSON():t.slice(),t=n._shuffleData(t,i),r=0;r<u;r++)if(f=n._text(t[r]),e&&n._matchText(f,n._last))break;else if(n._matchText(f,n._word))break;r!==u&&(o=n._focus(),n._select(it(i+r,u)).done(function(){var t=function(){n.popup.visible()||n._change()};n.trigger("select",{dataItem:n._getElementDataItem(n._focus()),item:n._focus()})?n._select(o).done(t):t()}))},_keypress:function(n){var i=this,t;n.which!==0&&n.keyCode!==r.keys.ENTER&&(t=String.fromCharCode(n.charCode||n.keyCode),i.options.ignoreCase&&(t=t.toLowerCase()),t===" "&&n.preventDefault(),i._word+=t,i._last=t,i._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(){e.fn._popup.call(this);this.popup.one("open",f(this._popupOpen,this))},_getElementDataItem:function(n){return!n||!n[0]?null:n[0]===this.optionLabel[0]?this._optionLabelDataItem():this.listView.dataItemByIndex(this.listView.getElementIndex(n))},_click:function(t){var i=this,r=t.item||n(t.currentTarget);if(t.preventDefault(),i.trigger("select",{dataItem:i._getElementDataItem(r),item:r})){i.close();return}i._userTriggered=!0;i._select(r).done(function(){i._focusElement(i.wrapper);i._blur()})},_focusElement:function(n){var i=c(),r=this.wrapper,t=this.filterInput,u=n===t?r:t,f=o.mobileOS&&(o.touch||o.MSPointers||o.pointers);t&&t[0]===n[0]&&f||t&&(u[0]===i||this._open)&&(this._prevent=!0,this._focused=n.focus())},_searchByWord:function(n){if(n){var t=this,i=t.options.ignoreCase;i&&(n=n.toLowerCase());t._select(function(i){return t._matchText(t._text(i),n)})}},_inputValue:function(){return this.text()},_search:function(){var n=this,t=n.dataSource;if(clearTimeout(n._typingTimeout),n._isFilterEnabled())n._typingTimeout=setTimeout(function(){var t=n.filterInput.val();n._prev!==t&&(n._prev=t,n.search(t),n._resizeFilterInput());n._typingTimeout=null},n.options.delay);else{if(n._typingTimeout=setTimeout(function(){n._word=""},n.options.delay),!n.listView.bound()){t.fetch().done(function(){n._selectNext()});return}n._selectNext()}},_get:function(t){var r,u,i,f=typeof t=="function",e=f?n():n(t);if(this.hasOptionLabel()&&(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.hasOptionLabel()?this._focus(this.optionLabel):this.listView.focusFirst()},_lastItem:function(){this._resetOptionLabel();this.listView.focusLast()},_nextItem:function(){this.optionLabel.hasClass("k-state-focused")?(this._resetOptionLabel(),this.listView.focusFirst()):this.listView.focusNext()},_prevItem:function(){this.optionLabel.hasClass("k-state-focused")||(this.listView.focusPrev(),this.listView.focus()||this._focus(this.optionLabel))},_focusItem:function(){var i=this.options,r=this.listView,u=r.focus(),n=r.select();n=n[n.length-1];n===t&&i.highlightFirst&&!u&&(n=0);n!==t?r.focus(n):i.optionLabel&&(!i.virtual||i.virtual.mapValueTo!=="dataItem")?(this._focus(this.optionLabel),this._select(this.optionLabel)):r.scrollToIndex(0)},_resetOptionLabel:function(n){this.optionLabel.removeClass("k-state-focused"+(n||"")).removeAttr("id")},_focus:function(n){var i=this.listView,r=this.optionLabel;if(n===t)return n=i.focus(),!n&&r.hasClass("k-state-focused")&&(n=r),n;this._resetOptionLabel();n=this._get(n);i.focus(n);n===-1&&(r.addClass("k-state-focused").attr("id",i._optionID),this._focused.add(this.filterInput).removeAttr("aria-activedescendant").attr("aria-activedescendant",i._optionID))},_select:function(n,t){var i=this;return n=i._get(n),i.listView.select(n).done(function(){t||i._state!==w||(i._state=b);n===-1&&i._selectValue(null)})},_selectValue:function(n){var i=this,f=i.options.optionLabel,r=i.listView.select(),u="",e="";r=r[r.length-1];r===t&&(r=-1);this._resetOptionLabel(" k-state-selected");n||n===0?(e=n,u=i._dataValue(n),f&&(r+=1)):f&&(i._focus(i.optionLabel.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=o.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;this.filterInput&&(this.filterInput.off(i).parent().remove(),this.filterInput=null);this._isFilterEnabled()&&(t='<span class="k-icon k-i-zoom"><\/span>',this.filterInput=n('<input class="k-textbox"/>').attr({placeholder:this.element.attr("placeholder"),title:this.element.attr("title"),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" aria-label="select"><span class="k-icon k-i-arrow-60-down"><\/span><\/span><\/span>').append(t.element),r=i.find(u));t.span=r;t._inputWrapper=n(i[0].firstChild);t._arrow=i.find(".k-select");t._arrowIcon=t._arrow.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);i._focused=i.wrapper=n.addClass("k-widget k-dropdown k-header").addClass(r.className).css("display","").attr({accesskey:t.attr("accesskey"),unselectable:"on",role:"listbox","aria-haspopup":!0,"aria-expanded":!1});t.hide().removeAttr("accesskey")},_clearSelection:function(n){this.select(n.value()?0:-1)},_inputTemplate:function(){var t=this,i=t.options.valueTemplate;if(i=i?r.template(i):n.proxy(r.template("#:this._text(data)#",{useWithBlock:!1}),t),t.valueTemplate=i,t.hasOptionLabel()&&!t.options.optionLabelTemplate)try{t.valueTemplate(t._optionLabelDataItem())}catch(u){throw new Error(ut);}},_textAccessor:function(i){var r=null,o=this.valueTemplate,u=this._optionLabelText(),f=this.span,e;if(i===t)return f.text();n.isPlainObject(i)||i instanceof l?r=i:u&&u===i&&(r=this.options.optionLabel);r||(r=this._assignInstance(i,this._accessor()));this.hasOptionLabel()&&(r===u||this._text(r)===u)&&(o=this.optionLabelTemplate,typeof this.options.optionLabel!="string"||this.options.optionLabelTemplate||(r=u));e=function(){return{elements:f.get(),data:[{dataItem:r}]}};this.angular("cleanup",e);try{f.html(o(r))}catch(s){f.html("")}this.angular("compile",e)},_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?(tt(i,r.split("."),n),tt(i,this.options.dataValueField.split("."),t),i=new l(i)):i=n,i}});h.plugin(ft)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.combobox",["kendo.list","kendo.mobile.scroller","kendo.virtuallist"],n)}(function(){return function(n,t){var f=window.kendo,a=f.ui,v=a.List,e=a.Select,h=f.caret,k=f.support,d=k.placeholder,y=f._activeElement,r=f.keys,i=".kendoComboBox",o="click"+i,s="mousedown"+i,g="disabled",nt="readonly",c="change",p="k-state-default",tt="k-state-focused",w="k-state-disabled",it="aria-disabled",l="filter",b="accept",rt="rebind",ut="mouseenter"+i+" mouseleave"+i,u=n.proxy,ft=e.extend({init:function(t,r){var o=this,s,h;o.ns=i;r=n.isArray(r)?{dataSource:r}:r;e.fn.init.call(o,t,r);r=o.options;t=o.element.on("focus"+i,u(o._focusHandler,o));r.placeholder=r.placeholder||t.attr("placeholder");o._reset();o._wrapper();o._input();o._clearButton();o._tabindex(o.input);o._popup();o._dataSource();o._ignoreCase();o._enable();o._oldIndex=o.selectedIndex=-1;o._aria();o._initialIndex=r.index;o.requireValueMapper(o.options);o._initList();o._cascade();r.autoBind?o._filterSource():(s=r.text,!s&&o._isSelect&&(s=t.children(":selected").text()),s&&o._setText(s));s||o._placeholder();h=n(o.element).parents("fieldset").is(":disabled");h&&o.enable(!1);f.notify(o);o._toggleCloseVisibility()},options:{name:"ComboBox",enabled:!0,index:-1,text:null,value:null,autoBind:!0,delay:200,dataTextField:"",dataValueField:"",minLength:1,enforceMinLength:!1,height:200,highlightFirst:!0,filter:"none",placeholder:"",suggest:!1,cascadeFrom:"",cascadeFromField:"",ignoreCase:!0,animation:{},virtual:!1,template:null,groupTemplate:"#:data#",fixedGroupTemplate:"#:data#",clearButton:!0,syncValueAndText:!0},events:["open","close",c,"select","filtering","dataBinding","dataBound","cascade","set"],setOptions:function(n){var t=this._listOptions(n);e.fn.setOptions.call(this,n);this.listView.setOptions(t);this._accessors();this._aria();this._clearButton()},destroy:function(){var n=this;n.input.off(i);n.element.off(i);n._inputWrapper.off(i);clearTimeout(n._pasteTimeout);n._arrow.off(o+" "+s);n._clear.off(o+" "+s);e.fn.destroy.call(n)},_change:function(){var n=this,t=n.text(),r=t&&t!==n._oldText&&t!==n.options.placeholder,i=n.selectedIndex,u=i===-1;if(!n.options.syncValueAndText&&!n.value()&&u&&r){n._old="";n._oldIndex=i;n._oldText=t;n._typing||n.element.trigger(c);n.trigger(c);n._typing=!1;return}e.fn._change.call(n);n._toggleCloseVisibility()},_focusHandler:function(){this.input.focus()},_arrowClick:function(){this._toggle()},_inputFocus:function(){this._inputWrapper.addClass(tt);this._placeholder(!1)},_inputFocusout:function(){var n=this,i=n.value(),t,r;if(n._inputWrapper.removeClass(tt),clearTimeout(n._typingTimeout),n._typingTimeout=null,n.text(n.text()),t=n._focus(),r=this.listView.dataItemByIndex(this.listView.getElementIndex(t)),i!==n.value()&&n.trigger("select",{dataItem:r,item:t})){n.value(i);return}n._placeholder();n._blur();n.element.blur()},_inputPaste:function(){var n=this;clearTimeout(n._pasteTimeout);n._pasteTimeout=null;n._pasteTimeout=setTimeout(function(){n.search()})},_editable:function(n){var t=this,r=n.disable,f=n.readonly,e=t._inputWrapper.off(i),h=t.element.add(t.input.off(i)),c=t._arrow.off(o+" "+s),l=t._clear;if(f||r)e.addClass(r?w:p).removeClass(r?p:w),h.attr(g,r).attr(nt,f).attr(it,r);else{e.addClass(p).removeClass(w).on(ut,t._toggleHover);h.removeAttr(g).removeAttr(nt).attr(it,!1);c.on(o,u(t._arrowClick,t)).on(s,function(n){n.preventDefault()});l.on(o,u(t._clearValue,t)).on(s,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)).on("paste"+i,u(t._inputPaste,t))}},open:function(){var n=this,t=n._state;n.popup.visible()||((n.listView.bound()||t===l)&&t!==b?n._allowOpening()&&(n.popup._hovered=!0,n._openPopup(),n._focusItem()):(n._open=!0,n._state=rt,n.options.minLength!==1?(n.refresh(),n._openPopup()):n._filterSource()))},_scrollToFocusedItem:function(){var n=this.listView;n.scrollToIndex(n.getElementIndex(n.focus()))},_openPopup:function(){this.popup.one("activate",u(this._scrollToFocusedItem,this));this.popup.open()},_updateSelectionState:function(){var n=this,i=n.options.text,r=n.options.value;n.listView.isFiltered()||(n.selectedIndex===-1?((i===t||i===null)&&(i=r),n._accessor(r),n.input.val(i||n.input.val()),n._placeholder()):n._oldIndex===-1&&(n._oldIndex=n.selectedIndex))},_buildOptions:function(n){var i=this,r;i._isSelect&&(r=i._customOption,i._state===rt&&(i._state=""),i._customOption=t,i._options(n,"",i.value()),r&&r[0].selected&&i._custom(r.val()))},_updateSelection:function(){var t=this,r=t.listView,u=t._initialIndex,f=u!==null&&u>-1,e=t._state===l,i;if(e){n(r.focus()).removeClass("k-state-selected");return}t._fetch||(r.value().length||(f?t.select(u):t._accessor()&&r.value(t._accessor())),t._initialIndex=null,i=r.selectedDataItems()[0],i)&&(t._value(i)!==t.value()&&t._custom(t._value(i)),t.text()&&t.text()!==t._text(i)&&t._selectValue(i))},_updateItemFocus:function(){var n=this.listView;this.options.highlightFirst?n.focus()||n.focusIndex()||n.focus(0):n.focus(-1)},_listBound:function(){var n=this,r=n.input[0]===y(),i=n.dataSource.flatView(),u=n.listView.skip(),f=i.length,e=n.dataSource._group?n.dataSource._group.length:0,o=u===t||u===0;n._presetValue=!1;n._renderFooter();n._renderNoData();n._toggleNoData(!f);n._toggleHeader(!!e&&!!f);n._resizePopup();n.popup.position();n._buildOptions(i);n._makeUnselectable();n._updateSelection();i.length&&o&&(n._updateItemFocus(),n.options.suggest&&r&&n.input.val()&&n.suggest(i[0]));n._open&&(n._open=!1,n._typingTimeout&&!r?n.popup.close():n.toggle(n._allowOpening()),n._typingTimeout=null);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){var i=this;return n=i._get(n),n===-1&&(i.input[0].value="",i._accessor("")),i.listView.select(n).done(function(){t||i._state!==l||(i._state=b)})},_selectValue:function(n){var i=this.listView.select(),r="",u="";i=i[i.length-1];i===t&&(i=-1);this.selectedIndex=i;i!==-1||n?((n||n===0)&&(r=this._dataValue(n),u=this._text(n)),r===null&&(r="")):(u=this.input[0].value,this.options.syncValueAndText&&(r=u),this.listView.focus(-1));this._setDomInputValue(u);this._accessor(r!==t?r:u,i);this._placeholder();this._triggerCascade()},_setDomInputValue:function(n){var u=this,i=h(this.input),t,r;i&&i.length&&(t=i[0]);this._prev=this.input[0].value=n;t&&this.selectedIndex===-1&&(r=k.mobileOS,r.wp||r.android?setTimeout(function(){u.input[0].setSelectionRange(t,t)},0):this.input[0].setSelectionRange(t,t))},refresh:function(){this.listView.refresh()},_toggleCloseVisibility:function(){this.text()?this._showClear():this._hideClear()},suggest:function(n){var u=this,e=u.input[0],i=u.text(),f=h(e)[0],s=u._last,o;if(s==r.BACKSPACE||s==r.DELETE){u._last=t;return}n=n||"";typeof n!="string"&&(n[0]&&(n=u.dataSource.view()[v.inArray(n[0],u.ul[0])]),n=n?u._text(n):"");f<=0&&(f=i.toLowerCase().indexOf(n.toLowerCase())+1);n?(n=n.toString(),o=n.toLowerCase().indexOf(i.toLowerCase()),o>-1&&(i+=n.substring(o+i.length))):i=i.substring(0,f);i.length===f&&n||(e.value=i,e===y()&&h(e,f,i.length))},text:function(n){n=n===null?"":n;var i=this,u=i.input[0],o=i.options.ignoreCase,f=n,r,e;if(n===t)return u.value;if(i.options.autoBind===!1&&!i.listView.bound()){i._setText(n);return}if(r=i.dataItem(),r&&i._text(r)===n&&(e=i._value(r),e===v.unifyType(i._old,typeof e))){i._triggerCascade();return}o&&!i.listView.value().length&&(f=f.toLowerCase());i._select(function(n){return n=i._text(n),o&&!i.listView.value().length&&(n=(n+"").toLowerCase()),n===f}).done(function(){i.selectedIndex<0&&(u.value=n,i.options.syncValueAndText&&i._accessor(n),i._triggerCascade());i._prev=u.value})},toggle:function(n){this._toggle(n,!0)},value:function(n){var i=this,u=i.options,r=i.listView;if(n===t)return n=i._accessor()||i.listView.value()[0],n===t||n===null?"":n;(i.requireValueMapper(i.options,n),i.trigger("set",{value:n}),n!==u.value||i.input.val()!==u.text)&&(i._accessor(n),i._isFilterEnabled()&&r.bound()&&r.isFiltered()?i._clearFilter():i._fetchData(),r.value(n).done(function(){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===l&&(i._state=b)}))},_click:function(n){var t=this,i=n.item,r=t.listView.dataItemByIndex(t.listView.getElementIndex(i));if(n.preventDefault(),t.trigger("select",{dataItem:r,item:i})){t.close();return}t._userTriggered=!0;t._select(i).done(function(){t._blur()})},_inputValue:function(){return this.text()},_searchByWord: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(c,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 t=this,r=t.element.removeClass("k-input")[0],o=r.accessKey,u=t.wrapper,s="input.k-input",f=r.name||"",i,e;f&&(f='name="'+f+'_input" ');i=u.find(s);i[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 unselectable="on" class="k-select" aria-label="select"><span class="k-icon k-i-arrow-60-down"><\/span><\/span><\/span>').append(t.element),i=u.find(s));i[0].style.cssText=r.style.cssText;i[0].title=r.title;e=parseInt(this.element.prop("maxlength")||this.element.attr("maxlength"),10);e>-1&&(i[0].maxLength=e);i.addClass(r.className).css({width:"100%",height:r.style.height}).attr({role:"combobox","aria-expanded":!1}).show();d&&i.attr("placeholder",t.options.placeholder);o&&(r.accessKey="",i[0].accessKey=o);t._focused=t.input=i;t._inputWrapper=n(u[0].firstChild);t._arrow=u.find(".k-select").attr({role:"button",tabIndex:-1});t._arrowIcon=t._arrow.find(".k-icon");r.id&&t._arrow.attr("aria-controls",t.ul[0].id)},_clearButton:function(){v.fn._clearButton.call(this);this.options.clearButton&&(this._clear.insertAfter(this.input),this.wrapper.addClass("k-combobox-clearable"))},_keydown:function(n){var t=this,i=n.keyCode;t._last=i;clearTimeout(t._typingTimeout);t._typingTimeout=null;i===r.HOME?t._firstItem():i===r.END?t._lastItem():i==r.TAB||t._move(n)?i!==r.ESC||t.popup.visible()||t._clearValue():t._search();t.popup.visible()&&(n.keyCode==r.ENTER||n.keyCode==r.ESC)&&n.stopPropagation()},_placeholder:function(n){if(!d){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]!==y()||h(i[0],0,0)}}},_search:function(){var n=this;n._typingTimeout=setTimeout(function(){var t=n.text();n._prev!==t&&(n._prev=t,n.options.filter==="none"&&n.listView.select(-1),n.search(t),n._toggleCloseVisibility());n._typingTimeout=null},n.options.delay)},_setText:function(n){this.input.val(n);this._prev=n},_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;this.selectedIndex==-1&&this.value()||(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;this._toggleCloseVisibility()}});a.plugin(ft)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.multiselect",["kendo.list","kendo.mobile.scroller","kendo.virtuallist"],n)}(function(){return function(n,t){function bt(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 r=window.kendo,d=r.ui,e=d.List,i=n.extend({A:65},r.keys),g=r._activeElement,st=r.data.ObservableArray,f=n.proxy,o="id",a="li",s="accept",v="filter",y="rebind",nt="open",tt="close",p="change",ht="progress",w="select",h="deselect",it="aria-disabled",c="k-state-focused",ct="k-state-selected",b="k-hidden",rt="k-state-hover",k="k-state-disabled",ut="disabled",ft="readonly",u=".kendoMultiSelect",lt="click"+u,at="keydown"+u,et="mouseenter"+u,ot="mouseleave"+u,vt=et+" "+ot,yt=/"/g,l=n.isArray,pt=["font-family","font-size","font-stretch","font-style","font-weight","letter-spacing","text-transform","line-height"],wt=e.extend({init:function(t,i){var f=this,s,h;f.ns=u;e.fn.init.call(f,t,i);f._optionsMap={};f._customOptions={};f._wrapper();f._tagList();f._input();f._textContainer();f._loader();f._clearButton();f._tabindex(f.input);t=f.element.attr("multiple","multiple").hide();i=f.options;i.placeholder||(i.placeholder=t.data("placeholder"));s=t.attr(o);s&&(f._tagID=s+"_tag_active",s=s+"_taglist",f.tagList.attr(o,s));f._aria(s);f._dataSource();f._ignoreCase();f._popup();f._tagTemplate();f.requireValueMapper(f.options);f._initList();f._reset();f._enable();f._placeholder();i.autoBind?f.dataSource.fetch():i.value&&f._preselect(i.value);h=n(f.element).parents("fieldset").is(":disabled");h&&f.enable(!1);r.notify(f);f._toggleCloseVisibility()},options:{name:"MultiSelect",tagMode:"multiple",enabled:!0,autoBind:!0,autoClose:!0,highlightFirst:!0,dataTextField:"",dataValueField:"",filter:"startswith",ignoreCase:!0,minLength:1,enforceMinLength:!1,delay:100,value:null,maxSelectedItems:null,placeholder:"",height:200,animation:{},virtual:!1,itemTemplate:"",tagTemplate:"",groupTemplate:"#:data#",fixedGroupTemplate:"#:data#",clearButton:!0},events:[nt,tt,p,w,h,"filtering","dataBinding","dataBound"],setDataSource:function(n){this.options.dataSource=n;this._state="";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.listView.setOptions(t);this._accessors();this._aria(this.tagList.attr(o));this._tagTemplate();this._placeholder();this._clearButton()},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);n._clear.off(t);e.fn.destroy.call(n)},_activateItem:function(){e.fn._activateItem.call(this);this.currentTag(null)},_listOptions:function(t){var u=this,i=e.fn._listOptions.call(u,n.extend(t,{selectedItemChange:f(u._selectedItemChange,u),selectable:"multiple"})),s=this.options.itemTemplate||this.options.template,o=i.itemTemplate||s||i.template;return o||(o="#:"+r.expr(i.dataTextField,"data")+"#"),i.template=o,i},_setListValue:function(){e.fn._setListValue.call(this,this._initialValues.slice(0))},_listChange:function(n){var r=this.dataSource.flatView(),u=this._optionsMap,f=this._value,i;for(this._state===y&&(this._state=""),i=0;i<n.added.length;i++)if(u[f(n.added[i].dataItem)]===t){this._render(r);break}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 i=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-60-down").length);!e||u&&r.support.mobileOS||t.preventDefault();u||(i.input[0]!==g()&&e&&i.input.focus(),i.options.minLength===1&&i.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===v&&(n._state=s,n.listView.skipUpdate(!0));n.listView.bound()&&n.listView.isFiltered()&&(n.persistTagList=!0,n._clearFilter());n.element.blur()},_removeTag:function(n){var i=this,o=i._state,r=n.index(),u=i.listView,c=u.value()[r],a=i.listView.selectedDataItems()[r],f=i._customOptions[c],l,e;if(i.trigger(h,{dataItem:a,item:n})){i._close();return}f===t&&(o===s||o===v)&&(f=i._optionsMap[c]);e=function(){i.currentTag(null);i._change();i._close()};f===t?(i.persistTagList=!1,u.select(u.select()[r]).done(e)):(l=i.element[0].children[f],l.selected=!1,u.removeAt(r),n.remove(),e())},_tagListClick:function(t){var i=n(t.currentTarget);i.children(".k-i-arrow-60-down").length||this._removeTag(i.closest(a))},_clearClick:function(){var t=this;t.options.tagMode==="single"?t.value([]):t.tagList.children().each(function(i,r){t._removeTag(n(r))});t.input.val("");t._search();t.trigger("change");t.focus()},_editable:function(t){var i=this,r=t.disable,o=t.readonly,e=i.wrapper.off(u),h=i.tagList.off(u),s=i.element.add(i.input.off(u));if(o||r)r?e.addClass(k):e.removeClass(k),s.attr(ut,r).attr(ft,o).attr(it,r);else{e.removeClass(k).on(vt,i._toggleHover).on("mousedown"+u+" touchend"+u,f(i._wrapperMousedown,i));i.input.on(at,f(i._keydown,i)).on("paste"+u,f(i._search,i)).on("focus"+u,f(i._inputFocus,i)).on("focusout"+u,f(i._inputFocusout,i));i._clear.on("click"+u,f(i._clearClick,i));s.removeAttr(ut).removeAttr(ft).attr(it,!1);h.on(et,a,function(){n(this).addClass(rt)}).on(ot,a,function(){n(this).removeClass(rt)}).on(lt,"li.k-button .k-select",f(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._activeItem=null;this.popup.close()},open:function(){var n=this;n._request&&(n._retrieveData=!1);n._retrieveData||!n.listView.bound()||n._state===s?(n._open=!0,n._state=y,n.listView.skipUpdate(!0),n.persistTagList=!0,n._filterSource(),n._focusItem()):n._allowOpening()&&(n.popup._hovered=!0,n.popup.open(),n._focusItem())},toggle:function(n){n=n!==t?n:!this.popup.visible();this[n?nt:tt]()},refresh:function(){this.listView.refresh()},_listBound:function(){var n=this,i=n.dataSource.flatView(),r=n.listView.skip();n._render(i);n._renderFooter();n._renderNoData();n._toggleNoData(!i.length);n._resizePopup();n._open&&(n._open=!1,n.toggle(n._allowOpening()));n.popup.position();n.options.highlightFirst&&(r===t||r===0)&&n.listView.focusFirst();n._touchScroller&&n._touchScroller.reset();n._hideBusy();n._makeUnselectable();n.trigger("dataBound")},_inputValue:function(){var t=this,n=t.input.val();return t.options.placeholder===n&&(n=""),n},value:function(n){var i=this,r=i.listView,e=r.value().slice(),u=i.options.maxSelectedItems,f=r.bound()&&r.isFiltered();if(n===t)return e;i.requireValueMapper(i.options,n);n=i._normalizeValues(n);u!==null&&n.length>u&&(n=n.slice(0,u));f&&(i.persistTagList=!1,i._clearFilter());r.value(n);i._old=r.value();f||(i.persistTagList=!1,i._fetchData())},_preselect:function(t,i){var u=this;l(t)||t instanceof r.data.ObservableArray||(t=[t]);(n.isPlainObject(t[0])||t[0]instanceof r.data.ObservableObject||!u.options.dataValueField)&&(u.dataSource.data(t),u.value(i||u._initialValues),u._retrieveData=!0)},_setOption:function(n,t){var i=this.element[0].children[this._optionsMap[n]];i&&(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}))},_isBound:function(){return this.listView.bound()&&!this._retrieveData},_dataSource:function(){var n=this,u=n.element,i=n.options,t=i.dataSource||{};t=l(t)?{data:t}:t;t.select=u;t.fields=[{field:i.dataTextField},{field:i.dataValueField}];n.dataSource&&n._refreshHandler?n._unbindDataSource():(n._progressHandler=f(n._showBusy,n),n._errorHandler=f(n._hideBusy,n));n.dataSource=r.data.DataSource.create(t).bind(ht,n._progressHandler).bind("error",n._errorHandler)},_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)}):l(t)||t instanceof st?l(t)&&(t=t.slice()):t=[t],t},_change:function(){var n=this,t=n.value();bt(t,n._old)||(n._old=t.slice(),n.trigger(p),n.element.trigger(p));n._toggleCloseVisibility()},_click:function(n){var t=this,i=n.item;n.preventDefault();t._select(i).done(function(){t._activeItem=i;t._change();t._close()})},_getActiveItem:function(){return this._activeItem||n(this.listView.items()[this._getSelectedIndices().length-1])||this.listView.focus()},_getSelectedIndices:function(){return this.listView._selectedIndices||this.listView._selectedIndexes},_keydown:function(u){var f=this,s=u.keyCode,o=f._currentTag,e=f.listView,c=f.input.val(),l=r.support.isRtl(f.wrapper),h=f.popup.visible(),a=0,v,y,p,w;if(s===i.DOWN){if(u.preventDefault(),!h){f.open();e.focus()||e.focusFirst();return}e.focus()?(!f._activeItem&&u.shiftKey&&(f._activeItem=e.focus(),a=-1),v=e.getElementIndex(f._getActiveItem()[0]),e.focusNext(),e.focus()?u.shiftKey&&f._selectRange(v,e.getElementIndex(e.focus()[0])+a):e.focusLast()):e.focusFirst()}else if(s===i.UP)h&&(!f._activeItem&&u.shiftKey&&(f._activeItem=e.focus(),a=1),v=e.getElementIndex(f._getActiveItem()[0]),e.focusPrev(),e.focus()?u.shiftKey&&f._selectRange(v,e.getElementIndex(e.focus()[0])+a):f.close()),u.preventDefault();else if(s===i.LEFT&&!l||s===i.RIGHT&&l)c||(o=o?o.prev():n(f.tagList[0].lastChild),o[0]&&f.currentTag(o));else if(s===i.RIGHT&&!l||s===i.LEFT&&l)!c&&o&&(o=o.next(),f.currentTag(o[0]?o:null));else if(u.ctrlKey&&s===i.A&&h)this._getSelectedIndices().length===e.items().length&&(f._activeItem=null),e.items().length&&f._selectRange(0,e.items().length-1);else if(s===i.ENTER&&h)f._select(e.focus()).done(function(){f._change();f._close()}),u.preventDefault();else if(s===i.SPACEBAR&&u.ctrlKey&&h)f._activeItem&&e.focus()&&e.focus()[0]===f._activeItem[0]&&(f._activeItem=null),n(e.focus()).hasClass(ct)||(f._activeItem=e.focus()),f._select(e.focus()).done(function(){f._change()}),u.preventDefault();else if(s===i.SPACEBAR&&u.shiftKey&&h)y=e.getElementIndex(f._getActiveItem()),p=e.getElementIndex(e.focus()),y!==t&&p!==t&&f._selectRange(y,p),u.preventDefault();else if(s===i.ESC)h?u.preventDefault():f.tagList.children().each(function(t,i){f._removeTag(n(i))}),f.close();else if(s===i.HOME)h?e.focus()?(u.ctrlKey&&u.shiftKey&&f._selectRange(e.getElementIndex(e.focus()[0]),0),e.focusFirst()):f.close():c||(o=f.tagList[0].firstChild,o&&f.currentTag(n(o)));else if(s===i.END)h?e.focus()?(u.ctrlKey&&u.shiftKey&&f._selectRange(e.getElementIndex(e.focus()[0]),e.element.children().length-1),e.focusLast()):f.close():c||(o=f.tagList[0].lastChild,o&&f.currentTag(n(o)));else if(s!==i.DELETE&&s!==i.BACKSPACE||c)f.popup.visible()&&(s===i.PAGEDOWN||s===i.PAGEUP)?(u.preventDefault(),w=s===i.PAGEDOWN?1:-1,e.scrollWith(w*e.screenHeight())):(clearTimeout(f._typingTimeout),setTimeout(function(){f._scale()}),f._search());else{if(f._state="",f.options.tagMode==="single"){e.value([]);f._change();f._close();return}s!==i.BACKSPACE||o||(o=n(f.tagList[0].lastChild));o&&o[0]&&f._removeTag(o)}},_hideBusy:function(){var n=this;clearTimeout(n._busy);n.input.attr("aria-busy",!1);n._loading.addClass(b);n._request=!1;n._busy=null;n._showClear()},_showBusyHandler:function(){this.input.attr("aria-busy",!0);this._loading.removeClass(b);this._hideClear()},_showBusy:function(){var n=this;(n._request=!0,n._busy)||(n._busy=setTimeout(f(n._showBusyHandler,n),100))},_placeholder:function(n,i){var u=this,f=u.input,s=g(),h=u.options.placeholder,e=f.val(),c=f[0]===s,o=e.length;(!c||u.options.autoClose||e===h)&&(o=0,e="");n===t&&(n=!1,f[0]!==s&&(n=!u.listView.selectedDataItems()[0]));u._prev=e;f.toggleClass("k-readonly",n).val(n?h:e);c&&!i&&r.caret(f[0],o,o);u._scale()},_scale:function(){var n=this,r=n.wrapper.find(".k-multiselect-wrap"),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,i,u){var f="<option";return n!==t&&(n+="",n.indexOf('"')!==-1&&(n=n.replace(yt,"&quot;")),f+=' value="'+n+'"'),u&&(f+=" selected"),f+=">",i!==t&&(f+=r.htmlEncode(i)),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._inputValue();n._prev!==t&&(n._prev=t,n.search(t),n._toggleCloseVisibility())},n.options.delay)},_toggleCloseVisibility:function(){this.value().length||this.input.val()&&this.input.val()!==this.options.placeholder?this._showClear():this._hideClear()},_allowOpening:function(){return this._allowSelection()&&e.fn._allowOpening.call(this)},_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}})}})},updatePersistTagList:function(n,t){this.persistTagList=this.persistTagList.added&&this.persistTagList.added.length===t.length&&this.persistTagList.removed&&this.persistTagList.removed.length===n.length?!1:{added:n,removed:t}},_selectValue:function(n,t){var i=this,h=i.value(),e=i.dataSource.total(),u=i.tagList,f=i._value,o,s,r;if(this.persistTagList){this.updatePersistTagList(n,t);return}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(t){var u=n.Deferred().resolve();if(!t)return u;var i=this,r=i.listView,e=r.dataItemByIndex(r.getElementIndex(t)),f=t.hasClass("k-state-selected");return(i._state===y&&(i._state=""),!i._allowSelection()&&!f)?u:i.trigger(f?h:w,{dataItem:e,item:t})?(i._close(),u):(i.persistTagList=!1,r.select(t).done(function(){i._placeholder();i._state===v&&(i._state=s,r.skipUpdate(!0))}))},_selectRange:function(t,i){var o=this,s=this.listView,c=this.options.maxSelectedItems,f=this._getSelectedIndices().slice(),u=[],r,e;if(t<i)for(r=t;r<=i;r++)u.push(r);else for(r=t;r>=i;r--)u.push(r);for(c!==null&&u.length>c&&(u=u.slice(0,c)),r=0;r<u.length;r++)e=u[r],this._getSelectedIndices().indexOf(e)==-1?f.push(e):f.splice(f.indexOf(e),1);if(f.length)return o.persistTagList=!1,s.select(f).done(function(){f.forEach(function(t){var r=s.dataItemByIndex(t),i=s.element.children()[t],u=n(i).hasClass("k-state-selected");o.trigger(u?w:h,{dataItem:r,item:i})});o._change()})},_input:function(){var t=this,i=t.element,u=i[0].accessKey,r=t._innerWrapper.children("input.k-input");r[0]||(r=n('<input class="k-input" style="width: 25px" />').appendTo(t._innerWrapper));i.removeAttr("accesskey");t._focused=t.input=r.attr({accesskey:u,autocomplete:"off",role:"listbox",title:i[0].title,"aria-expanded":!1})},_tagList:function(){var t=this,i=t._innerWrapper.children("ul");i[0]||(i=n('<ul role="listbox" deselectable="on" class="k-reset"/>').appendTo(t._innerWrapper));t.tagList=i},_tagTemplate:function(){var t=this,n=t.options,i=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?r.template("#:"+r.expr(n.dataTextField,"data")+"#",{useWithBlock:!1}):r.template("#:values.length# item(s) selected");t.tagTextTemplate=i=i?r.template(i):f;t.tagTemplate=function(n){return'<li class="k-button" deselectable="on"><span deselectable="on">'+i(n)+'<\/span><span unselectable="on" aria-label="'+(u?"delete":"open")+'" class="k-select"><span class="k-icon '+(u?"k-i-close":"k-i-arrow-60-down")+'"><\/span><\/span><\/li>'}},_loader:function(){this._loading=n('<span class="k-icon k-i-loading '+b+'"><\/span>').insertAfter(this.input)},_clearButton:function(){e.fn._clearButton.call(this);this.options.clearButton&&(this._clear.insertAfter(this.input),this.wrapper.addClass("k-multiselect-clearable"))},_textContainer:function(){var t=r.getComputedStyles(this.input[0],pt);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" deselectable="on" />').parent(),i[0].style.cssText=t[0].style.cssText,i[0].title=t[0].title,n('<div class="k-multiselect-wrap k-floatwrap" deselectable="on" />').insertBefore(t));r.wrapper=i.addClass(t[0].className).css("display","");r._innerWrapper=n(i[0].firstChild)}});d.plugin(wt)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.slider",["kendo.draganddrop"],n)}(function(){return function(n,t){function hi(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 ui(n,t,i,r){var u="";return u=i?!r&&t=="increase"||r&&t!="increase"?"k-i-arrow-60-right":"k-i-arrow-60-left":t=="increase"?"k-i-arrow-60-up":"k-i-arrow-60-down","<a class='k-button k-button-"+t+"' title='"+n[t+"ButtonTitle"]+"' aria-label='"+n[t+"ButtonTitle"]+"'><span class='k-icon "+u+"'><\/span><\/a>"}function ci(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 li(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 nt(n){return function(t){return t+n}}function fi(n){return function(){return n}}function l(n){return(n+"").replace(".",r.cultures.current.numberFormat["."])}function ai(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=ai(n),t=i.pow(10,r||0),i.round(n*t)/t}function s(n,i){var r=oi(n.getAttribute(i));return r===null&&(r=t),r}function gt(n){return typeof n!==si}function ut(n){return n*1e4}var r=window.kendo,ft=r.ui.Widget,ei=r.ui.Draggable,b=r._outerWidth,et=r._outerHeight,ni=n.extend,ot=r.format,oi=r.parseFloat,f=n.proxy,kt=n.isArray,i=Math,dt=r.support,ti=dt.pointers,ii=dt.msPointers,tt="change",st="slide",u=".slider",it="touchstart"+u+" mousedown"+u,k=ti?"pointerdown"+u:ii?"MSPointerDown"+u:it,a="touchend"+u+" mouseup"+u,ht=ti?"pointerup":ii?"MSPointerUp"+u:a,ct="moveSelection",y="keydown"+u,lt="click"+u,rt="mouseover"+u,at="focus"+u,vt="blur"+u,e=".k-draghandle",p=".k-slider-track",h=".k-tick",w="k-state-selected",c="k-state-focused",yt="k-state-default",pt="k-state-disabled",d="disabled",si="undefined",wt="tabindex",ri=r.getTouches,g=ft.extend({init:function(n,t){var i=this,u;if(ft.fn.init.call(i,n,t),t=i.options,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?b:et,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:nt(-1*u*t.smallStep),40:nt(-t.smallStep),39:nt(1*u*t.smallStep),38:nt(+t.smallStep),35:fi(t.max),36:fi(t.min),33:nt(+t.largeStep),34:nt(-t.largeStep)};r.notify(i)},events:[tt,st],options:{enabled:!0,min:0,max:10,smallStep:1,largeStep:5,orientation:"horizontal",tickPlacement:"both",tooltip:{enabled:!0,format:"{0}"}},_distance:function(){return o(this.options.max-this.options.min)},_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 t=this,r=t.options,u=t._maxSelection/((r.max-r.min)/r.smallStep),f=t._calculateItemsWidth(i.floor(t._distance()/r.smallStep));r.tickPlacement!="none"&&u>=2&&(n(this.element).parent().find(".k-slider-items").remove(),t._trackDiv.before(ci(r,t._distance())),t._setItemsWidth(f),t._setItemsTitle());t._calculateSteps(f);r.tickPlacement!="none"&&u>=2&&r.largeStep>=r.smallStep&&t._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",ot(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(ut(r.largeStep)%ut(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(ut(s-this.options.min)),e%ut(r.smallStep)==0&&e%ut(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,e=t.options,o=parseFloat(t._trackDiv.css(t._sizeFn))+1,u=t._distance(),h=o/u,s,r,f;for(u/e.smallStep-i.floor(u/e.smallStep)>0&&(o-=u%e.smallStep*h),s=o/n,r=[],f=0;f<n-1;f++)r[f]=s;return r[n-1]=r[n]=s/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,h=t._distance(),r=i.ceil(h/u.smallStep),f=1,c;if(r+=h/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++;c=h%u.smallStep==0?r-1:r;t._pixelSteps[c]=t._maxSelection;t._values[c]=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 kt(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)),kt(n)||t&&t.type?i?o=i({selectionStart:u,selectionEnd:f}):(u=ot(e.format,u),f=ot(e.format,f),o=u+" - "+f):(t&&(t.val=n),o=i?i({value:n}):ot(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 t=this,i=t.element,n=t.options,r=i.find("input");r.length==2?(r.eq(0).prop("value",l(n.selectionStart)),r.eq(1).prop("value",l(n.selectionEnd))):i.prop("value",l(n.value));i.wrap(hi(n,i,t._isHorizontal)).hide();n.showButtons&&i.before(ui(n,"increase",t._isHorizontal,t._isRtl)).before(ui(n,"decrease",t._isHorizontal,t._isRtl));i.before(li(n,i))},_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)))},min:function(n){if(!n)return this.options.min;this.setOptions({min:n})},max:function(n){if(!n)return this.options.max;this.setOptions({max:n})},setOptions:function(n){ft.fn.setOptions.call(this,n);this._sliderItemsInit();this._refresh()},destroy:function(){this._form&&this._form.off("reset",this._formResetHandler);ft.fn.destroy.call(this)}}),v=g.extend({init:function(r,u){var f=this,o;r.type="text";u=ni({},{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]"));g.fn.init.call(f,r,u);u=f.options;gt(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(pt).addClass(yt);i.wrapper.find("input").removeAttr(d);v=function(t){var r=ri(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(k,v).end().on(k,function(){n(document.documentElement).one("selectstart",r.preventDefault)}).on(ht,function(){i._drag._end()});i.wrapper.find(e).attr(wt,0).on(a,function(){i._setTooltipTimeout()}).on(lt,function(n){i._focusWithMouse(n.target);n.preventDefault()}).on(at,f(i._focus,i)).on(vt,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||dt.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(rt,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(it,f(function(n){s(n,1)},i)).click(!1).end().eq(1).on(it,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(yt).addClass(pt);n(t.element).prop(d,d);t.wrapper.find(".k-button").off(it).on(it,function(t){t.preventDefault();n(this).addClass("k-state-active")}).off(a).on(a,function(t){t.preventDefault();n(this).removeClass("k-state-active")}).off("mouseleave"+u).on("mouseleave"+u,r.preventDefault).off(rt).on(rt,r.preventDefault);t.wrapper.find(h+", "+p).off(k).off(ht);t.wrapper.find(e).attr(wt,-1).off(a).off(y).off(lt).off(at).off(vt);t.options.enabled=!1},_update:function(n){var t=this,i=t.value()!=n;t.value(n);i&&t.trigger(tt,{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(ct,{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;g.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)}}),bt;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(t._outerSize(n)/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([st,ct],function(n){u(parseFloat(n.value,10))});t.bind(tt,function(n){u(parseFloat(n.sender.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 ei(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._dragstart(n);this.dragend()},_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(rt);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(st,e));t._updateTooltip(t.val)},_updateTooltip:function(n){var t=this,r=t.options,u=r.tooltip,i="";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.draggable.userEvents.cancel(),t._end()},_end:function(){var n=this,t=n.owner;t._focusWithMouse(n.element);t.element.on(rt);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=b(t.tooltipDiv),p=et(t.tooltipDiv),w,h,c,k;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),k=b(w.eq(0))+2*a):(i=o.top,u=o.left,k=b(l)+2*a);f._isHorizontal?(u-=parseInt((y-f._outerSize(l))/2,10),i-=p+s.height()+a):(i-=parseInt((p-f._outerSize(l))/2,10),u-=y+s.width()+a);f._isHorizontal?(c=t._flip(i,p,k,et(v)+t._scrollOffset.top),i+=c,u+=t._fit(u,y,b(v)+t._scrollOffset.left)):(c=t._flip(u,y,k,b(v)+t._scrollOffset.left),i+=t._fit(i,p,et(v)+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);bt=g.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=ni({},{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]"));g.fn.init.call(u,i,r);r=u.options;gt(r.selectionStart)&&r.selectionStart!==null||(r.selectionStart=r.min,f.eq(0).prop("value",l(r.min)));gt(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 bt.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(pt).addClass(yt);i.wrapper.find("input").removeAttr(d);o=function(t){var s=ri(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(k,o).end().on(k,function(){n(document.documentElement).one("selectstart",r.preventDefault)}).on(ht,function(){i._activeDragHandle&&i._activeDragHandle._end()});i.wrapper.find(e).attr(wt,0).on(a,function(){i._setTooltipTimeout()}).on(lt,function(n){i._focusWithMouse(n.target);n.preventDefault()}).on(at,f(i._focus,i)).on(vt,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(yt).addClass(pt);n.wrapper.find("input").prop(d,d);n.wrapper.find(h+", "+p).off(k).off(ht);n.wrapper.find(e).attr(wt,-1).off(a).off(y).off(lt).off(at).off(vt);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(tt,{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 kt(n)?this._value(n[0],n[1]):this._value(n,t)},_refresh:function(){var t=this,n=t.options;t.trigger(ct,{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;g.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()}});bt.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(t._outerSize(n.eq(0))/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([tt,st,ct],function(n){u(n.values)})};r.ui.plugin(bt)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.colorpicker",["kendo.core","kendo.color","kendo.popup","kendo.slider","kendo.userevents","kendo.button"],n)}(function(){return function(n,t,i){function nt(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",rt="000000,7f7f7f,880015,ed1c24,ff7f27,fff200,22b14c,00a2e8,3f48cc,a349a4,ffffff,c3c3c3,b97a57,ffaec9,ffc90e,efe4b0,b5e61d,99d9ea,7092be,c8bfe7",ut="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="#ffffff",d={apply:"Apply",cancel:"Cancel",noColor:"no color",clearColor:"Clear color",previewInput:"Color Hexadecimal Code"},u=".kendoColorTools",a="click"+u,y="keydown"+u,g=f.support.browser,ft=g.msie&&g.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){nt(this,"select",n)},_triggerChange:function(n){nt(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")}}),tt=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=ut,i.columns=18):r=="basic"&&(r=rt);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&&!this.wrapper.is("[unselectable='on']")&&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>')}),it=o.extend({init:function(t,i){var u=this;o.fn.init.call(u,t,i);i=u.options;i.messages=i.options?n.extend(u.options.messages,i.options.messages):u.options.messages;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.options._clearedColor?u.trigger("change"):u._select(u._getHSV())}).on(a,".k-controls button.cancel",function(){u._updateUI(u.color());u._cancel()});ft&&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,clearButton:!1,autoupdate:!0,messages:d},_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 u(t){n._updateUI(n._getHSV(t.value,null,null,null))}function f(t){n._updateUI(n._getHSV(null,null,null,t.value/100))}var n=this,t=n.element,i=t.find(".k-hue-slider"),r=t.find(".k-transparency-slider");i.attr("aria-label","hue saturation");n._hueSlider=i.kendoSlider({min:0,max:360,tickPlacement:"none",showButtons:!1,slide:u,change:u}).data("kendoSlider");r.attr("aria-label","opacity");n._opacitySlider=r.kendoSlider({min:0,max:100,tickPlacement:"none",showButtons:!1,slide:f,change:f}).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.attr("title",i.options.messages.previewInput),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"><div class="k-color-input"><input class="k-color-value" # if (clearButton && !_standalone) { #placeholder="#: messages.noColor #" # } ##= !data.input ? \'style="visibility: hidden;"\' : "" #># if (clearButton && !_standalone) { #<span class="k-clear-color k-button k-bare" title="#: messages.clearColor #"><\/span># } #<\/div><\/div><\/div># } ## if (clearButton && !_standalone && !preview) { #<div class="k-clear-color-container"><span class="k-clear-color k-button k-bare">#: messages.clearColor #<\/span><\/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># } #')}),et=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")});else t.close()},_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-icon k-tool-icon #= toolIcon #"><span class="k-selected-color"><\/span><\/span># } else { #<span class="k-selected-color"><span class="k-icon k-i-line" style="display: none;"><\/span><\/span># } #<span class="k-select" unselectable="on" aria-label="select"><span class="k-icon k-i-arrow-60-down"><\/span><\/span><\/span><\/span>'),options:{name:"ColorPicker",palette:null,columns:10,toolIcon:null,value:null,messages:d,opacity:!1,buttons:!0,preview:!0,clearButton:!1,ARIATemplate:'Current selected color is #=data || ""#'},events:["activate","change","select","open","close"],open:function(){this.element.prop("disabled")||this._getPopup().open()},close:function(){var n=this._selector&&this._selector.options||{};n._closing=!0;this._getPopup().close();delete n._closing},toggle:function(){this.element.prop("disabled")||this._getPopup().toggle()},_noColorIcon:function(){return this.wrapper.find(".k-picker-wrap > .k-selected-color > .k-icon.k-i-line")},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():k);this._noColorIcon()[t?"hide":"show"]()},_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,r,h,o,i;return u||(r=t.options,h=r.palette?tt:it,r._standalone=!1,delete r.select,delete r.change,delete r.cancel,o=f.guid(),i=t._selector=new h(n('<div id="'+o+'"/>').appendTo(document.body),r),t.wrapper.attr("aria-owns",o),t._popup=u=i.wrapper.kendoPopup({anchor:t.wrapper,adjustSize:{width:5,height:0}}).data("kendoPopup"),i.element.find(".k-clear-color").kendoButton({icon:"reset-color",click:function(n){i.options._clearedColor=!0;t.value(null);t.element.val(null);t._updateUI(null);i._colorAsText.val("");i._hsvHandle.css({top:"0px",left:"0px"});i._selectedColor.css(s,k);t.trigger("change",{value:t.value()});n.preventDefault()}}),i.bind({select:function(n){t._updateUI(e(n.value));delete i.options._clearedColor},change:function(){i.options._clearedColor||t._select(i.color());t.close()},cancel:function(){i.options._clearedColor&&!t.value()&&i.value()&&t._select(i.color(),!0);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 u=i._selectOnHide(),f=i.value(),e=t.value(),r=i.options;u?r._clearedColor&&!e||t._select(u):(setTimeout(function(){t.wrapper&&!t.wrapper.is("[unselectable='on']")&&t.wrapper.focus()}),!r._closing&&r._clearedColor&&!e&&f?t._select(f,!0):t._updateUI(t.color()))},open:function(n){t.trigger("open")?n.preventDefault():t.wrapper.children(".k-picker-wrap").addClass("k-state-focused")},activate:function(){i._select(t.color(),!0);i.focus();t.wrapper.children(".k-picker-wrap").addClass("k-state-focused")}})),u}});v.plugin(tt);v.plugin(it);v.plugin(et)}(jQuery,parseInt),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.numerictextbox",["kendo.core","kendo.userevents"],n)}(function(){return function(n,t){function ut(n,t){var i="k-i-arrow-"+(n==="increase"?"60-up":"60-down");return'<span unselectable="on" class="k-link k-link-'+n+'" aria-label="'+t+'" title="'+t+'"><span unselectable="on" class="'+v+" "+i+'"><\/span><\/span>'}function wt(n,t){var i=parseFloat(n,10).toString().split(f);return i[1]&&(i[1]=i[1].substring(0,t)),i.join(f)}var u=window.kendo,s=u.caret,e=u.keys,w=u.ui,h=w.Widget,ft=u._activeElement,et=u._extractFormat,ot=u.parseFloat,st=u.support.placeholder,ht=u.getCulture,c="change",b="disabled",k="readonly",ct="k-input",d="spin",r=".kendoNumericTextBox",lt="touchend",at="mouseleave"+r,g="mouseenter"+r+" "+at,l="k-state-default",nt="k-state-focused",tt="k-state-hover",a="focus",f=".",v="k-icon",y="k-state-selected",p="k-state-disabled",it="k-state-invalid",rt="aria-disabled",vt=/^(-)?(\d*)$/,i=null,o=n.proxy,yt=n.extend,pt=h.extend({init:function(f,e){var s=this,w=e&&e.step!==t,c,l,v,y,p;if(h.fn.init.call(s,f,e),e=s.options,f=s.element.on("focusout"+r,o(s._focusout,s)).attr("role","spinbutton"),e.placeholder=e.placeholder||f.attr("placeholder"),s._initialOptions=yt({},e),c=s.min(f.attr("min")),l=s.max(f.attr("max")),v=s._parse(f.attr("step")),e.min===i&&c!==i&&(e.min=c),e.max===i&&l!==i&&(e.max=l),w||v===i||(e.step=v),s._reset(),s._wrapper(),s._arrows(),s._validation(),s._input(),u.support.mobileOS)s._text.on(lt+r+" "+a+r,function(){if(u.support.browser.edge)s._text.one(a+r,function(){s._toggleText(!1);f.focus()});else s._toggleText(!1),f.focus()});else s._text.on(a+r,o(s._click,s));f.attr("aria-valuemin",e.min!==i?e.min*e.factor:e.min).attr("aria-valuemax",e.max!==i?e.max*e.factor:e.max);e.format=et(e.format);y=e.value;s.value(y!==i?y:f.val());p=f.is("[disabled]")||n(s.element).parents("fieldset").is(":disabled");p?s.enable(!1):s.readonly(f.is("[readonly]"));u.notify(s)},options:{name:"NumericTextBox",decimals:i,restrictDecimals:!1,min:i,max:i,value:i,step:1,round:!0,culture:"",format:"n",spinners:!0,placeholder:"",factor:1,upArrowText:"Increase value",downArrowText:"Decrease value"},events:[c,d],_editable:function(n){var t=this,u=t.element,i=n.disable,f=n.readonly,e=t._text.add(u),s=t._inputWrapper.off(g);if(t._toggleText(!0),t._upArrowEventHandler.unbind("press"),t._downArrowEventHandler.unbind("press"),u.off("keydown"+r).off("keypress"+r).off("keyup"+r).off("paste"+r),f||i)s.addClass(i?p:l).removeClass(i?l:p),e.attr(b,i).attr(k,f).attr(rt,i);else{s.addClass(l).removeClass(p).on(g,t._toggleHover);e.removeAttr(b).removeAttr(k).attr(rt,!1);t._upArrowEventHandler.bind("press",function(n){n.preventDefault();t._spin(1);t._upArrow.addClass(y)});t._downArrowEventHandler.bind("press",function(n){n.preventDefault();t._spin(-1);t._downArrow.addClass(y)});t.element.on("keydown"+r,o(t._keydown,t)).on("keypress"+r,o(t._keypress,t)).on("keyup"+r,o(t._keyup,t)).on("paste"+r,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(r);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(y)},r=t.options,e=r.spinners,o=t.element;i=o.siblings("."+v);i[0]||(i=n(ut("increase",r.upArrowText)+ut("decrease",r.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 u.UserEvents(t._upArrow,{release:f});t._downArrow=i.eq(1);t._downArrowEventHandler=new u.UserEvents(t._downArrow,{release:f})},_validation:function(){var t=this,i=t.element;t._validationIcon=n("<span class='"+v+" k-i-warning'><\/span>").hide().insertAfter(i)},_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,i=t.options.factor;i&&i!==1&&(n=parseFloat(n),n!==null&&(n=n/i));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(nt);n._toggleText(!1);n.element[0].focus()},_focusout:function(){var n=this;clearTimeout(n._focusing);n._inputWrapper.removeClass(nt).removeClass(tt);n._blur();n._removeInvalidState()},_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 e=this,r=e.options,o="k-formatted-value",t=e.element.addClass(ct).show()[0],s=t.accessKey,h=e.wrapper,u;u=h.find(f+o);u[0]||(u=n('<input type="text"/>').insertBefore(t).addClass(o));try{t.setAttribute("type","text")}catch(c){t.type="text"}e._initialTitle=t.title;u[0].title=t.title;u[0].tabIndex=t.tabIndex;u[0].style.cssText=t.style.cssText;u.prop("placeholder",r.placeholder);s&&(u.attr("accesskey",s),t.accessKey="");e._text=u.addClass(t.className).attr({role:"spinbutton","aria-valuemin":r.min!==i?r.min*r.factor:r.min,"aria-valuemax":r.max!==i?r.max*r.factor:r.max})},_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)&&(t._addInvalidState(),n.preventDefault());t._key=0}},_keyup:function(){this._removeInvalidState()},_addInvalidState:function(){var n=this;n._inputWrapper.addClass(it);n._validationIcon.show()},_removeInvalidState:function(){var n=this;n._inputWrapper.removeClass(it);n._validationIcon.hide()},_numericRegex:function(n){var r=this,t=n[f],u=r.options.decimals,e="*";return(t===f&&(t="\\"+t),u===i&&(u=n.decimals),u===0)?vt:(r.options.restrictDecimals&&(e="{0,"+u+"}"),r._separator!==t&&(r._separator=t,r._floatRegExp=new RegExp("^(-)?(((\\d+("+t+"\\d"+e+")?)|("+t+"\\d"+e+")))?$")),r._floatRegExp)},_paste:function(n){var t=this,r=n.target,u=r.value,e=t._format(t.options.format);setTimeout(function(){var n=t._parse(r.value);n===i?t._update(u):(r.value=n.toString().replace(f,e[f]),t._adjust(n)===n&&t._numericRegex(e).test(r.value)||t._update(u))})},_option:function(n,i){var r=this,u=r.element,f=r.options;if(i===t)return f[n];(i=r._parse(i),i||n!=="step")&&(f[n]=i,u.add(r._text).attr("aria-value"+n,i),u.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,r=t.element,i=t._parse(r.val())||0;ft()!=r[0]&&t._focusin();t.options.factor&&i&&(i=i/t.options.factor);i+=t.options.step*n;t._update(t._adjust(i));t._typing=!1;t.trigger(d)},_toggleHover:function(t){n(t.currentTarget).toggleClass(tt,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)},_round:function(n,t){var i=this.options.round?u._round:wt;return i(n,t)},_update:function(n){var t=this,e=t.options,h=e.factor,c=e.format,r=e.decimals,o=t._culture(),l=t._format(c,o),s;r===i&&(r=l.decimals);n=t._parse(n,o);s=n!==i;s&&(n=parseFloat(t._round(n,r),10));t._value=n=t._adjust(n);t._placeholder(u.toString(n,c,o));s?(h&&(n=parseFloat(t._round(n*h,r),10)),n=n.toString(),n.indexOf("e")!==-1&&(n=t._round(+n,r)),n=n.replace(f,l[f])):n=null;t.element.val(n);t.element.add(t._text).attr("aria-valuenow",n)},_placeholder:function(n){var t=this._text;t.val(n);st||n||t.val(this.options.placeholder);t.attr("title",this._initialTitle||t.val())},_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))}});w.plugin(pt)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.filtermenu",["kendo.datepicker","kendo.numerictextbox","kendo.dropdownlist","kendo.binder"],n)}(function(){return function(n,t){function k(t,i){t.filters&&(t.filters=n.grep(t.filters,function(n){return k(n,i),n.filters?n.filters.length:n.field!=i}))}function d(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.text||t.value||t:t.text,f=t.value==null?t.text||t:t.value,r[i]={text:e,value:f};return r}function ht(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 g(t,i){t.filters&&(t.filters=n.grep(t.filters,function(n){return g(n,i),n.filters?n.filters.length:n.field==i&&n.operator=="eq"}))}function nt(i){return i.logic=="and"&&i.filters.length>1?[]:i.filters?n.map(i.filters,function(n){return nt(n)}):i.value!==null&&i.value!==t?[i.value]:[]}function w(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 ct(n,t){return function(i){var r=n(i);return w(r,t)}}var i=window.kendo,c=i.ui,r=n.proxy,s="kendoPopup",l="init",a="open",b="refresh",u="change",f=".kendoFilterMenu",v="Is equal to",y="Is not equal to",it={number:"numerictextbox",date:"datepicker"},rt={string:"text",number:"number",date:"date"},ut=i.isFunction,h=c.Widget,ft='<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>',et='<div><div class="k-filter-help-text">#=messages.info#<\/div><select title="#=messages.operator#" 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 title="#=messages.value#" 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 title="#=messages.value#" data-#=ns#bind="value:filters[0].value" class="k-textbox" type="text" #=role ? "data-" + ns + "role=\'" + role + "\'" : ""# />#}##if(extra){#<select title="#=messages.logic#" 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 title="#=messages.additionalOperator#" 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 title="#=messages.additionalValue#" 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 title="#=messages.additionalValue#" 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>',ot='<div data-#=ns#role="view" data-#=ns#init-widgets="false" data-#=ns#use-native-scrolling="true" class="k-grid-filter-menu"><div data-#=ns#role="header" class="k-header"><button class="k-button k-i-cancel">#=messages.cancel#<\/button>#=title#<button type="submit" class="k-button k-submit">#=messages.filter#<\/button><\/div><form title="#=messages.title#" 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.additionalOperator#<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.additionalValue##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>',st='<div data-#=ns#role="view" data-#=ns#init-widgets="false" data-#=ns#use-native-scrolling="true" class="k-grid-filter-menu"><div data-#=ns#role="header" class="k-header"><button class="k-button k-i-cancel">#=messages.cancel#<\/button>#=title#<button type="submit" class="k-button k-submit">#=messages.filter#<\/button><\/div><form title="#=messages.title#" 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="#" title="'+e.messages.filter+'" aria-label="'+e.messages.filter+'"><span class="k-icon k-i-filter"><\/span><\/a>').find(".k-grid-filter"));l.attr("tabindex",-1).on("click"+f,r(o._click,o))}o.link=l||n();o.dataSource=p.create(e.dataSource);o.field=e.field||t.attr(i.attr("field"));o.model=o.dataSource.reader.model;o._parse=function(n){return n!=null?n+"":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=ut(u),e;t.pane=t.options.pane;t.pane&&(t._isMobile=!0);o||(e=u||it[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 title="'+u.options.messages.title+'" class="k-filter-menu"/>').html(i.template(o==="boolean"?ft:et)({field:u.field,format:e.format,ns:i.ns,messages:e.messages,extra:e.extra,operators:h,type:o,role:t,values:d(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"?st:ot)({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:rt[u],values:d(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-i-cancel",function(n){r._closeForm();n.preventDefault()})},refresh:function(){var n=this,u=n.dataSource.filter()||{filters:[],logic:"and"},t=[n._defaultFilter()],r=n._defaultFilter().operator;(n.options.extra||r!=="isnull"&&r!=="isnotnull")&&t.push(n._defaultFilter());n.filterModel=i.observable({logic:"and",filters:t});n.form&&i.bind(n.form.children().first(),n.filterModel);n._bind(u)?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||n.operator==="isnull"||n.operator==="isnotnull"||n.operator==="isempty"||n.operator==="isnotempty"})},_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(k(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){var t=this._stripFilters(n.filters);t.length&&this.trigger("change",{filter:{logic:n.logic,filters:t},field:this.field})||(n=this._merge(n),n.filters.length&&this.dataSource.filter(n))},clear:function(){var t=this,i=t.dataSource.filter()||{filters:[]};this.trigger("change",{filter:null,field:t.field})||(i.filters=n.grep(i.filters,function(n){return n.filters?(n.filters=ht(n.filters,t.field),n.filters.length):n.field!=t.field}),i.filters.length||(i=null),t.dataSource.filter(i))},_submit:function(n){n.preventDefault();n.stopPropagation();this.filter(this.filterModel.toJSON());this._closeForm()},_reset:function(){this.clear();this.options.search&&this.container&&this.container.find("label").parent().show();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();this.trigger(a,{field:this.field,container:this.form})},_keydown:function(n){n.keyCode==i.keys.ESC&&this.popup.close()},events:[l,"change",a],options:{name:"FilterMenu",extra:!0,appendToElement:!1,type:"string",operators:{string:{eq:v,neq:y,startswith:"Starts with",contains:"Contains",doesnotcontain:"Does not contain",endswith:"Ends with",isnull:"Is null",isnotnull:"Is not null",isempty:"Is empty",isnotempty:"Is not empty"},number:{eq:v,neq:y,gte:"Is greater than or equal to",gt:"Is greater than",lte:"Is less than or equal to",lt:"Is less than",isnull:"Is null",isnotnull:"Is not null"},date:{eq:v,neq:y,gte:"Is after or equal to",gt:"Is after",lte:"Is before or equal to",lt:"Is before",isnull:"Is null",isnotnull:"Is not null"},enums:{eq:v,neq:y,isnull:"Is null",isnotnull:"Is not null"}},messages:{info:"Show items with value that:",title:"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",additionalValue:"Additional value",additionalOperator:"Additional operator",logic:"Filters logic",cancel:"Cancel"},animations:{left:"slide",right:"slide:right"}}}),e=".kendoFilterMultiCheck",p=i.data.DataSource,lt='<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-i-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">#if(search){#<div class=\'k-textbox k-space-right\'><input placeholder=\'#=messages.search#\'/><span class=\'k-icon k-i-zoom\' /><\/div>#}#<ul class="k-multicheck-wrap"><\/ul><\/li><li class="k-button-container">#if(messages.selectedItemsFormat){#<div class=\'k-filter-selected-items\'><\/div>#}#<button type="reset" class="k-button">#=messages.clear#<\/button><\/li><\/ul><\/form><\/div>',tt=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=p.create(f.values),this.checkSource.fetch()):f.forceUnique?(o=n.extend(!0,{},f.dataSource.options),delete o.pageSize,this.checkSource=p.create(o),this.checkSource.reader.data=ct(this.checkSource.reader.data,this.field)):this.checkSource=p.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.type=="number"?this._parse=parseFloat: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="#" aria-label="'+this.options.messages.filter+'"><span class="k-icon k-i-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(w(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)},_input:function(){var n=this;n._clearTypingTimeout();n._typingTimeout=setTimeout(function(){n.search()},100)},_clearTypingTimeout:function(){this._typingTimeout&&(clearTimeout(this._typingTimeout),this._typingTimeout=null)},search:function(){var f=this.options.ignoreCase,t=this.searchTextBox[0].value,i=this.container.find("label"),n,r,u;for(f&&(t=t.toLowerCase()),n=0,this.options.checkAll&&i.length&&(i[0].parentNode.style.display=t?"none":"",n++);n<i.length;)r=i[n],u=r.textContent||r.innerText,f&&(u=u.toLowerCase()),r.parentNode.style.display=u.indexOf(t)>=0?"":"none",n++},_activate:function(){this.form.find(":kendoFocusable:first").focus();this.trigger(a,{field:this.field,container:this.form})},_createForm:function(){var t=this.options,f="",u,e;if(this._isMobile||(t.search&&(f+="<div class='k-textbox k-space-right'><input placeholder='"+t.messages.search+"'/><span class='k-icon k-i-zoom' /><\/div>"),f+="<ul class='k-reset k-multicheck-wrap'><\/ul>",t.messages.selectedItemsFormat&&(f+="<div class='k-filter-selected-items'>"+i.format(t.messages.selectedItemsFormat,0)+"<\/div>"),f+="<button type='submit' class='k-button k-primary'>"+t.messages.filter+"<\/button>",f+="<button type='reset' class='k-button'>"+t.messages.clear+"<\/button>",this.form=n('<form class="k-filter-menu"/>').html(f),this.container=this.form.find(".k-multicheck-wrap")),this._isMobile){u=this;u.form=n("<div />").html(i.template(lt)({field:u.field,title:t.title||u.field,ns:i.ns,messages:t.messages,search:t.search}));u.view=u.pane.append(u.form.html());u.form=u.view.element.find("form");e=this.view.element;this.container=e.find(".k-multicheck-wrap");e.on("click",".k-submit",function(n){u.form.submit();n.preventDefault()}).on("click",".k-i-cancel",function(n){u._closeForm();n.preventDefault()})}else t.appendToElement?(this.popup=this.element.closest(".k-popup").data(s),this.element.append(this.form)):this.popup=this.form.kendoPopup({anchor:this._link,activate:r(this._activate,this)}).data(s);if(t.search){this.searchTextBox=this.form.find(".k-textbox > input");this.searchTextBox.on("input",r(this._input,this))}},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.options.messages.selectedItemsFormat&&this.form.find(".k-filter-selected-items").text(i.format(this.options.messages.selectedItemsFormat,this.container.find(":checked:not(.k-check-all)").length)),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(w(this.dataSource.data(),this.field)),this.container.empty()),this.container.is(":empty")&&this.createCheckBoxes(),this.checkValues(i),this.trigger(b))},getFilterArray:function(){var t=n.extend(!0,{},{filters:[],logic:"and"},this.dataSource.filter());return g(t,this.field),nt(t)},createCheckBoxes:function(){var t=this.options,n,f={field:this.field,format:t.format,mobile:this._isMobile,type:this.type},o,s;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.filters.length&&this.trigger("change",{filter:i,field:r.field}))||(i=this._merge(i),i.filters.length?this.dataSource.filter(i):this.clear(),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);this._clearTypingTimeout();this.searchTextBox=null;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,search:!1,ignoreCase:!0,appendToElement:!1,messages:{checkAll:"Select All",clear:"Clear",filter:"Filter",search:"Search",cancel:"Cancel",selectedItemsFormat:"{0} items selected"},forceUnique:!0,animations:{left:"slide",right:"slide:right"}},events:[l,b,"change",a]});n.extend(tt.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(tt)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.menu",["kendo.popup"],n)}(function(){return function(n,t){function iu(n,t){return n=n.split(" ")[!t+0]||n,n.replace("top","up").replace("bottom","down")}function ru(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 c(t,i){try{return n.contains(t,i)}catch(r){return!1}}function ur(t){t=n(t);t.addClass("k-item").children(wi).addClass(kt);t.children("a").addClass(ct).children(wi).addClass(kt);t.filter(":not([disabled])").addClass(tr);t.filter(".k-separator").empty().append("&nbsp;");t.filter("li[disabled]").addClass(d).removeAttr("disabled").attr("aria-disabled",!0);t.filter("[role]").length||t.attr("role","menuitem");t.children("."+ct).length||t.contents().filter(function(){return!this.nodeName.match(vr)&&!(this.nodeType==3&&!n.trim(this.nodeValue))}).wrapAll("<span class='"+ct+"'/>");ot(t);tt(t)}function ot(t){t=n(t);t.find("> .k-link > [class*=k-i-arrow-60]: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=uu(t);t.append("<span class='k-icon"+i+" k-menu-expand-arrow'/>")})}function uu(n){var t=n.parent().parent(),r=i.support.isRtl(t);return t.hasClass(a+"-horizontal")?" k-i-arrow-60-down":r?" k-i-arrow-60-left":" k-i-arrow-60-right"}function tt(t){t=n(t);t.filter(".k-first:not(:first-child)").removeClass(ki);t.filter(".k-last:not(:last-child)").removeClass(bi);t.filter(":first-child").addClass(ki);t.filter(":last-child").addClass(bi)}function fr(n){var i,t;if(n&&n.length)for(i in n)t=n.eq(i),t.find("ul").length?t.attr("aria-haspopup",!0):t.removeAttr("aria-haspopup")}function er(n){if(!n.hasClass(a))return n.parentsUntil("."+a,"li")}function gt(t,i){var r=eu(i);r&&fu(t,r);i.items&&n(t).children("ul").children("li").each(function(n){gt(this,i.items[n])})}function fu(t,i){n(t).children(".k-link").data({selectHandler:i})}function eu(n){var t=n.select,r=i.isFunction;return t&&r(t)?t:null}function w(n){return n?"li[data-groupparent='"+n+"']":"li[data-groupparent]"}function st(n){return n?"ul[data-group='"+n+"']":"ul[data-group]"}function vt(t,i){var u=t.find(w()),r=[];return u.each(function(u,f){f=n(f);for(var o=f.data(y),e=t;o;)e=i.find(st(o)+":visible"),e.length&&r.push(e),f=e.find(w()),o=f.data(y)}),r}function yi(t,i){var r=t.data(v);return r?i.find(w(r)):n([])}function or(t,i){var r=t.data(y);return r?i.children(e).children(st(r)):n([])}function ou(t,i){var r=[],o=function(n){while(n.parentNode&&!i.is(n.parentNode))r.push(n.parentNode),n=n.parentNode},u=t[0]||t,f,s;for(o(u),f=r[r.length-1];n(f).is(e);){if(s=n(f).children("ul"),u=yi(s,i)[0],!u)break;r.push(u);o(u);f=r[r.length-1]}return r}function su(n){var t=0;return n.wheelDelta&&(t=-n.wheelDelta/120,t=t>0?Math.ceil(t):Math.floor(t)),n.detail&&(t=Math.round(n.detail/3)),t}function sr(n,t){for(var r=0,i=n.parentNode;i&&!isNaN(i[t]);)r+=i[t],i=i.parentNode;return r}function yt(n){return gi&&n.originalEvent&&n.originalEvent.pointerType in tu}function hu(n){var t=n.originalEvent;return it&&/touch/i.test(t.type||"")}function hr(n){n.contents().filter(function(){return this.nodeName!="LI"}).remove()}var i=window.kendo,ni=i.ui,lr=i._activeElement,it=i.support.touch&&i.support.mobileOS,pt="mousedown",ti="click",pi=30,ar=50,o=n.extend,u=n.proxy,ii=n.each,b=i.template,l=i.keys,wt=ni.Widget,vr=/^(ul|a|div)$/i,r=".kendoMenu",wi="img",ht="open",a="k-menu",ct="k-link",bi="k-last",rt="close",bt="timer",ki="k-first",kt="k-image",ut="select",ft="zIndex",ri="activate",ui="deactivate",di="touchstart"+r+" MSPointerDown"+r+" pointerdown"+r,fi=i.support.pointers,ei=i.support.msPointers,gi=ei||fi,k=fi?"pointerenter":ei?"MSPointerEnter":"mouseenter",lt=fi?"pointerleave":ei?"MSPointerLeave":"mouseleave",oi="DOMMouseScroll"+r+" mousewheel"+r,nr=i.support.resize+r,yr="scrollWidth",pr="scrollHeight",wr="offsetWidth",br="offsetHeight",v="group",y="groupparent",dt=n(document.documentElement),g="kendoPopup",tr="k-state-default",si="k-state-hover",p="k-state-focused",d="k-state-disabled",kr="k-state-selected",hi=".k-menu",ci=".k-menu-group",e=".k-animation-container",li=ci+","+e,s=":not(.k-list) > .k-item",dr=".k-item.k-state-disabled",at=".k-item",ai=".k-item:not(.k-state-disabled)",gr=".k-item:not(.k-state-disabled) > .k-link",ir=":not(.k-item.k-separator)",et=at+ir+":eq(0)",rr=at+ir+":last",nu="div:not(.k-animation-container,.k-list-container)",nt=".k-menu-scroll-button",tu={"2":1,touch:1},h={content:b("<div #= contentCssAttributes(item) # tabindex='-1'>#= content(item) #<\/div>"),group:b("<ul class='#= groupCssClass(group) #'#= groupAttributes(group) # role='menu' aria-hidden='true'>#= renderItems(data) #<\/ul>"),itemWrapper:b("<#= tag(item) # class='#= textClass(item) #'#= textAttributes(item) #>#= image(data) ##= sprite(item) ##= text(item) ##= arrow(data) #<\/#= tag(item) #>"),item:b("<li class='#= wrapperCssClass(group, item) #' #= itemCssAttributes(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>"),scrollButton:b("<span class='k-button k-button-icon k-menu-scroll-button k-scroll-#= direction #' unselectable='on'><span class='k-icon k-i-arrow-60-#= direction #'><\/span><\/span>"),image:b("<img #= imageCssAttributes(item) # alt='' src='#= item.imageUrl #' />"),arrow:b("<span class='#= arrowClass(item, group) #'><\/span>"),sprite:b("<span class='k-sprite #= spriteCssClass #'><\/span>"),empty:b("")},vi={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),t.attr&&t.attr.hasOwnProperty("class")&&(i+=" "+t.attr["class"]),t.selected&&(i+=" "+kr),i},itemCssAttributes:function(n){var r="",i=n.attr||{};for(var t in i)i.hasOwnProperty(t)&&t!=="class"&&(r+=t+'="'+i[t]+'" ');return r},imageCssAttributes:function(n){var r="",t=n.imageAttr||{},i;t["class"]?t["class"]+=" "+kt:t["class"]=kt;for(i in t)t.hasOwnProperty(i)&&(r+=i+'="'+t[i]+'" ');return r},contentCssAttributes:function(n){var r="",t=n.contentAttr||{},u="k-content k-group k-menu-group",i;t["class"]?t["class"]+=" "+u:t["class"]=u;for(i in t)t.hasOwnProperty(i)&&(r+=i+'="'+t[i]+'" ');return r},textClass:function(){return ct},textAttributes:function(n){return n.url?" href='"+n.url+"'":""},arrowClass:function(n,t){return"k-icon"+(t.horizontal?" k-i-arrow-60-down":" k-i-arrow-60-right")},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=wt.extend({init:function(n,t){var r=this;wt.fn.init.call(r,n,t);n=r.wrapper=r.element;t=r.options;r._updateClasses();r._initData(t);r._animations(t);r.nextItemZIndex=100;r._tabindex();r._initOverflow(t);r._attachMenuEventsHandlers();t.openOnClick&&(r.clicked=!1);n.attr("role","menubar");n[0].id&&(r._ariaId=i.format("{0}_mn_active",n[0].id));i.notify(r)},events:[ht,rt,ri,ui,ut],options:{name:"Menu",animation:{open:{duration:200},close:{duration:100}},orientation:"horizontal",direction:"default",openOnClick:!1,closeOnClick:!0,hoverDelay:100,scrollable:!1,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()}}))},_attachMenuEventsHandlers:function(){var t=this,f=t.element,e=t.options,i=t._overflowWrapper();(i||f).on(di,at,u(t._focusHandler,t)).on(ti+r,dr,!1).on(ti+r,at,u(t._click,t)).on(di+" "+pt+r,".k-content",u(t._preventClose,t)).on(k+r,ai,u(t._mouseenter,t)).on(lt+r,ai,u(t._mouseleave,t)).on(pt+r,ai,u(t._mousedown,t)).on(k+r+" "+lt+r+" "+pt+r+" "+ti+r,gr,u(t._toggleHover,t));f.on("keydown"+r,u(t._keydown,t)).on("focus"+r,u(t._focus,t)).on("focus"+r,".k-content",u(t._focus,t)).on("blur"+r,u(t._removeHoverItem,t)).on("blur"+r,"[tabindex]",u(t._checkActiveElement,t));if(i)i.on(lt+r,li,u(t._mouseleavePopup,t)).on(k+r,li,u(t._mouseenterPopup,t));e.openOnClick&&(t._documentClickHandler=u(t._documentClick,t),n(document).click(t._documentClickHandler))},_detachMenuEventsHandlers:function(){var t=this,i=t._overflowWrapper();i&&i.off(r);t.element.off(r);t._documentClickHandler&&n(document).unbind("click",t._documentClickHandler)},_initOverflow:function(t){var r=this,u=t.orientation=="horizontal",e,o,s,f;if(t.scrollable){if(r._openedPopups={},r._scrollWrapper=r.element.wrap("<div class='k-menu-scroll-wrapper "+t.orientation+"'><\/div>").parent(),u&&hr(r.element),e=n(h.scrollButton({direction:u?"left":"up"})),o=n(h.scrollButton({direction:u?"right":"down"})),e.add(o).appendTo(r._scrollWrapper),r._initScrolling(r.element,e,o,u),s=r.element.outerWidth(),f=r.element[0].style.width,f=f==="auto"?"":f,u)n(window).on(nr,i.throttle(function(){r._setOverflowWrapperWidth(s,f);r._toggleScrollButtons(r.element,e,o,u)},100));r._setOverflowWrapperWidth(s,f);r._toggleScrollButtons(r.element,e,o,u)}},_overflowWrapper:function(){return this._scrollWrapper||this._popupsWrapper},_setOverflowWrapperWidth:function(n,t){var i=this,o=i._scrollWrapper.css("width"),r,f,e,u;i._scrollWrapper.css({width:""});r=i._scrollWrapper.outerWidth();i._scrollWrapper.css({width:o});f=i.element.outerWidth();e=i.element[0].offsetWidth-i.element[0].clientWidth;f!=r&&r>0&&(u=t?Math.min(n,r):r,i.element.width(u-e),i._scrollWrapper.width(u))},_reinitOverflow:function(n){var t=this,i=n.scrollable&&!t.options.scrollable||!n.scrollable&&t.options.scrollable||n.scrollable&&t.options.scrollable&&n.scrollable.distance!=t.options.scrollable.distance||n.orientation!=t.options.orientation;i&&(t._detachMenuEventsHandlers(),t._destroyOverflow(),t._initOverflow(n),t._attachMenuEventsHandlers())},_destroyOverflow:function(){var u=this,i=u._overflowWrapper();i&&(i.off(r),i.find(nt).off(r).remove(),i.children(e).each(function(t,r){var f=n(r).children(ci),u;f.off(oi);u=yi(f,i);u.length&&u.append(r)}),i.find(w()).removeAttr("data-groupparent"),i.find(st()).removeAttr("data-group"),u.element.off(oi),n(window).off(nr),i.contents().unwrap(),u._scrollWrapper=u._popupsWrapper=u._openedPopups=t)},_initScrolling:function(t,u,f,e){var o=this,l=o.options.scrollable,h=n.isNumeric(l.distance)?l.distance:ar,p=h/2,w="-="+h,b="+="+h,d="-="+h*2,g="+="+h*2,s=!1,c=!1,a=function(n){var i=e?{scrollLeft:n}:{scrollTop:n};t.finish().animate(i,"fast","linear",function(){s&&a(n)});o._toggleScrollButtons(t,u,f,e)},v=function(n){s||c||(a(n.data.direction),s=!0)},y=function(i){var r=e?{scrollLeft:i.data.direction}:{scrollTop:i.data.direction};c=hu(i)||yt(i);t.stop().animate(r,"fast","linear",function(){c?(o._toggleScrollButtons(t,u,f,e),s=!0):n(i.currentTarget).trigger(k)});s=!1;i.stopPropagation();i.preventDefault()};u.on(k+r,{direction:w},v).on(i.eventMap.down+r,{direction:d},y);f.on(k+r,{direction:b},v).on(i.eventMap.down+r,{direction:g},y);u.add(f).on(lt+r,function(){t.stop();s=!1;o._toggleScrollButtons(t,u,f,e)});t.on(oi,function(n){if(!n.ctrlKey&&!n.shiftKey&&!n.altKey){var i=su(n.originalEvent),s=Math.abs(i)*p,r=(i>0?"+=":"-=")+s,h=e?{scrollLeft:r}:{scrollTop:r};o._closeChildPopups(t);t.finish().animate(h,"fast","linear",function(){o._toggleScrollButtons(t,u,f,e)});n.preventDefault()}})},_toggleScrollButtons:function(n,t,i,r){var u=r?n.scrollLeft():n.scrollTop(),f=r?yr:pr,e=r?wr:br;t.toggle(u!==0);i.toggle(u<n[0][f]-n[0][e]-1)},setOptions:function(n){var t=this.options.animation;this._animations(n);n.animation=o(!0,t,n.animation);"dataSource"in n&&this._initData(n);this._updateClasses();this._reinitOverflow(n);wt.fn.setOptions.call(this,n)},destroy:function(){var n=this;wt.fn.destroy.call(n);n._detachMenuEventsHandlers();n._destroyOverflow();i.destroy(n.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 ii(i.items,function(t){i.group.append(this);ot(this);gt(this,n[t]||n)}),ot(t),tt(i.group.find(".k-first, .k-last").add(i.items)),fr(er(i.group)),this},insertBefore:function(n,t){t=this.element.find(t);var i=this._insert(n,t,t.parent());return ii(i.items,function(i){t.before(this);ot(this);tt(this);gt(this,n[i]||n)}),tt(t),this},insertAfter:function(n,t){t=this.element.find(t);var i=this._insert(n,t,t.parent());return ii(i.items,function(i){t.after(this);ot(this);tt(this);gt(this,n[i]||n)}),tt(t),this},_insert:function(t,i,r){var h=this,u,c,e,s;return i&&i.length||(r=h.element),e=n.isPlainObject(t),s={firstLevel:r.hasClass(a),horizontal:r.hasClass(a+"-horizontal"),expanded:!0,length:r.children().length},i&&!r.length&&(r=n(f.renderGroup({group:s})).appendTo(i)),e||n.isArray(t)?u=n(n.map(e?[t]:t,function(t,i){return typeof t=="string"?n(t).get():n(f.renderItem({group:s,item:o(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(){ur(this)})),{items:u,group:r}},remove:function(n){var f,r;n=this.element.find(n);var u=this,t=n.parentsUntil(u.element,s),i=n.parent("ul:not(.k-menu)");return n.remove(),i&&!i.children(s).length&&(f=er(i),r=i.parent(e),r.length?r.remove():i.remove(),fr(f)),t.length&&(t=t.eq(0),ot(t),tt(t)),u},open:function(r){var f=this,e=f.options,c=e.orientation=="horizontal",s=e.direction,l=i.support.isRtl(f.wrapper),h=f._overflowWrapper();return r=(h||f.element).find(r),/^(top|bottom|default)$/.test(s)&&(s=l?c?(s+" left").replace("default","bottom"):"left":c?(s+" right").replace("default","bottom"):"right"),f.options.openOnClick&&(f.clicked=!0),r.each(function(){var r=n(this);clearTimeout(r.data(bt));r.data(bt,setTimeout(function(){var y=r.find(".k-menu-group:first:hidden"),p,k,et,d,tt;if((!y[0]&&h&&(k=f._getPopup(r),y=k&&k.element),!y.is(":visible"))&&y[0]&&f._triggerEvent({item:r[0],type:ht})===!1){!y.find(".k-menu-group")[0]&&y.children(".k-item").length>1?(et=n(window).height(),d=function(){y.css({maxHeight:et-(i._outerHeight(y)-y.height())-i.getShadows(y).bottom,overflow:"auto"})},i.support.browser.msie&&i.support.browser.version<=7?setTimeout(d,0):d()):y.css({maxHeight:"",overflow:""});r.data(ft,r.css(ft));tt=f.nextItemZIndex++;r.css(ft,tt);f.options.scrollable&&r.parent().siblings(nt).css({zIndex:++tt});p=y.data(g);var ut=r.parent().hasClass(a),ct=ut&&c,b=ru(s,ut,l),ot=e.animation.open.effects,st=ot!==t?ot:"slideIn:"+iu(s,ut);p?(p=y.data(g),p.options.origin=b.origin,p.options.position=b.position,p.options.animation.open.effects=st):p=y.kendoPopup({activate:function(){f._triggerEvent({item:this.wrapper.parent(),type:ri})},deactivate:function(n){n.sender.element.removeData("targetTransform").css({opacity:""});f._triggerEvent({item:this.wrapper.parent(),type:ui})},origin:b.origin,position:b.position,collision:e.popupCollision!==t?e.popupCollision:ct?"fit":"fit flip",anchor:r,appendTo:h||r,animation:{open:o(!0,{effects:st},e.animation.open),close:e.animation.close},open:u(f._popupOpen,f),close:function(n){var t=n.sender.wrapper.parent(),i;h&&(i=n.sender.element.data(v),i&&(t=(h||f.element).find(w(i))),n.sender.wrapper.children(nt).hide());f._triggerEvent({item:t[0],type:rt})?n.preventDefault():(t.css(ft,t.data(ft)),t.removeData(ft),f.options.scrollable&&t.parent().siblings(nt).css({zIndex:""}),(it||gi)&&(t.removeClass(si),f._removeHoverItem()))}}).data(g);y.removeAttr("aria-hidden");f._configurePopupOverflow(p,r);p._hovered=!0;p.open();f._initPopupScrolling(p)}},f.options.hoverDelay))}),f},_configurePopupOverflow:function(n,t){var r=this,i;r.options.scrollable&&(r._wrapPopupElement(n),t.attr("data-groupparent")||(i=(new Date).getTime(),t.attr("data-groupparent",i),n.element.attr("data-group",i)))},_wrapPopupElement:function(n){n.element.parent().is(e)||(n.wrapper=i.wrap(n.element,n.options.autosize).css({overflow:"hidden",display:"block",position:"absolute"}))},_initPopupScrolling:function(n,t,i){var r=this;r.options.scrollable&&n.element[0].scrollHeight>n.element[0].offsetHeight&&r._initPopupScrollButtons(n,t,i)},_initPopupScrollButtons:function(t,i,u){var f=this,e=t.wrapper.children(nt),o=f.options.animation,s=(o&&o.open&&o.open.duration||0)+pi;setTimeout(function(){if(!e.length){var o=n(h.scrollButton({direction:i?"left":"up"})),s=n(h.scrollButton({direction:i?"right":"down"}));if(e=o.add(s).appendTo(t.wrapper),f._initScrolling(t.element,o,s,i),!u)e.on(k+r,function(){var i=f._overflowWrapper();n(vt(t.element,i)).each(function(n,t){var r=i.find(w(t.data(v)));f.close(r)})}).on(lt+r,function(){setTimeout(function(){n.isEmptyObject(f._openedPopups)&&f._closeParentPopups(t.element)},pi)})}f._toggleScrollButtons(t.element,e.first(),e.last(),i)},s)},_popupOpen:function(n){this._keyTriggered||n.sender.element.children("."+p).removeClass(p);this.options.scrollable&&this._setPopupHeight(n.sender)},_setPopupHeight:function(t,r){var u=t.element,o=u.add(u.parent(e)),v;o.height(u.hasClass(a)&&this._initialHeight||"");var s=t._location(r),h=n(window).height(),y=s.height,c=r?0:Math.max(s.top,0),l=r?0:sr(this._overflowWrapper()[0],"scrollTop"),p=window.innerHeight-h,f=h-i.getShadows(u).bottom+p,w=f+l>y+c;w||(v=Math.min(f,f-c+l),o.css({overflow:"hidden",height:v+"px"}))},close:function(t,i){var r=this,u=r._overflowWrapper(),f=u||r.element,e,o;return t=f.find(t),t.length||(t=f.find(">.k-item")),e=function(t){var i=!1;return n.isEmptyObject(r._openedPopups)?i:(n(vt(t,u)).each(function(n,t){return i=!!r._openedPopups[t.data(v).toString()],!i}),i)},o=function(n){var t=n.data(y);return!u||!t||!r._openedPopups[t.toString()]},t.each(function(){var f=n(this);!i&&r._isRootItem(f)&&(r.clicked=!1);clearTimeout(f.data(bt));f.data(bt,setTimeout(function(){var n=r._getPopup(f);if(n&&(o(f)||r._forceClose)){if(!r._forceClose&&e(n.element))return;n.close();n.element.attr("aria-hidden",!0);u&&r._forceClose&&t.last().is(f[0])&&delete r._forceClose}},r.options.hoverDelay))}),r},_getPopup:function(n){var f=this,t=n.find(".k-menu-group:not(.k-list-container):not(.k-calendar-container):first:visible").data(g),r=f._overflowWrapper(),i,u;return!t&&r&&(i=n.data(y),i&&(u=r.find(st(i)),t=u.data(g))),t},_toggleDisabled:function(t,i){this.element.find(t).each(function(){n(this).toggleClass(tr,i).toggleClass(d,!i).attr("aria-disabled",!i)})},_toggleHover:function(t){var r=n(i.eventTarget(t)||t.target).closest(s),u=t.type==k||pt.indexOf(t.type)!==-1;r.parents("li."+d).length||r.toggleClass(si,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()&&(c(r,i._activeElement())||!t||c(r,t.currentTarget))||u.close(r)},0);this._closurePrevented=!1},_removeHoverItem:function(){var n=this._hoverItem();n&&n.hasClass(p)&&(n.removeClass(p),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 "+a).addClass(a+"-"+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")).parent("li").attr("aria-haspopup","true").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(){ur(this)})},_mouseenter:function(t){var i=this,r=n(t.currentTarget),e=i._itemHasChildren(r),f=r.data(y)||r.parent().data(v),o=yt(t);(f&&(i._openedPopups[f.toString()]=!0),t.delegateTarget==r.parents(hi)[0]||t.delegateTarget==r.parents(".k-menu-scroll-wrapper,.k-popups-wrapper")[0])&&((i._keyTriggered=!1,i.options.openOnClick.rootMenuItems&&i._isRootItem(r.closest(s))||i.options.openOnClick.subMenuItems&&!i._isRootItem(r.closest(s)))||(i.options.openOnClick!==!1&&(i.options.openOnClick.rootMenuItems!==!1||!i._isRootItem(r.closest(s)))&&(i.options.openOnClick.subMenuItems!==!1||i._isRootItem(r.closest(s)))&&!i.clicked||it||o&&i._isRootItem(r.closest(s))||!c(t.currentTarget,t.relatedTarget)&&e&&i.open(r),(i.options.openOnClick===!0&&i.clicked||it)&&r.siblings().each(u(function(n,t){i.close(t,!0)},i))))},_mousedown:function(t){var i=this,r=n(t.currentTarget);(i.options.openOnClick.subMenuItems&&!i._isRootItem(r)||it)&&r.siblings().each(u(function(n,t){i.close(t,!0)},i))},_mouseleave:function(t){var r=this,u=n(t.currentTarget),f=u.data(y),s=u.children(e).length||u.children(ci).length||f,o=n(window);if(f&&delete r._openedPopups[f.toString()],u.parentsUntil(e,".k-list-container,.k-calendar-container")[0]){t.stopImmediatePropagation();return}if((r.options.openOnClick===!1||!r.options.openOnClick.rootMenuItems&&r._isRootItem(u)||!r.options.openOnClick.subMenuItems&&!r._isRootItem(u))&&!it&&!yt(t)&&!c(t.currentTarget,t.relatedTarget||t.target)&&s&&!c(t.currentTarget,i._activeElement())){r.close(u,!0);return}(i.support.browser.msie&&!t.toElement&&!t.relatedTarget||t.clientX<0||t.clientY<0||t.clientY>o.height()||t.clientX>o.width())&&r.close(u)},_mouseenterPopup:function(t){var u=this,i=n(t.currentTarget),r;i.parent().is(e)||(i=i.children("ul"),r=i.data(v),r&&(u._openedPopups[r.toString()]=!0))},_mouseleavePopup:function(t){var r=this,i=n(t.currentTarget);!yt(t)&&i.is(e)&&r._closePopups(i.children("ul"))},_closePopups:function(t){var i=this,f=i._overflowWrapper(),r=t.data(v),u;r&&(delete i._openedPopups[r.toString()],u=f.find(w(r)),setTimeout(function(){if(i.options.openOnClick)i._closeChildPopups(t);else if(n.isEmptyObject(i._openedPopups)){var r=i._innerPopup(t);i._closeParentPopups(r)}else i.close(u,!0)},0))},_closeChildPopups:function(t){var i=this,r=i._overflowWrapper();n(vt(t,r)).each(function(){var n=r.find(w(this.data(v)));i.close(n,!0)})},_innerPopup:function(n){var i=this._overflowWrapper(),t=vt(n,i);return t[t.length-1]||n},_closeParentPopups:function(n){var r=this,u=r._overflowWrapper(),t=n.data(v),i=u.find(w(t));for(t=i.parent().data(v),r.close(i,!0);t&&!r._openedPopups[t];){if(i.parent().is(hi))break;i=u.find(w(t));r.close(i,!0);t=i.parent().data(v)}},_click:function(t){for(var r=this,a,e=r.options,f=n(i.eventTarget(t)),o=f[0],c=f[0]?f[0].nodeName.toUpperCase():"",k=c=="INPUT"||c=="SELECT"||c=="BUTTON"||c=="LABEL",v=f.closest("."+ct),u=f.closest(s),g=u[0],p=v.attr("href"),h,nt,tt=f.attr("href"),it=n("<a href='#' />").attr("href"),l=!!p&&p!==it,et=l&&!!p.match(/^#/),ot=!!tt&&tt!==it,w=r._overflowWrapper(),ut,b,ft;o&&o.parentNode!=g;)o=o.parentNode;if(!n(o).is(nu)){if(u.hasClass(d)){t.preventDefault();return}if(t.handled||!r._triggerSelect(f,g)||k||t.preventDefault(),t.handled=!0,h=u.children(li),w&&(b=u.data(y),b&&(h=w.find(st(b)))),nt=h.is(":visible"),ut=e.openOnClick&&nt&&r._isRootItem(u),e.closeOnClick&&(!l||et)&&(!h.length||ut)){u.removeClass(si).css("height");r._oldHoverItem=r._findRootParent(u);ft=r._parentsUntil(v,r.element,s);r._forceClose=!!w;r.close(ft);r.clicked=!1;"MSPointerUp".indexOf(t.type)!=-1&&t.preventDefault();return}(l&&t.enterKey&&v[0].click(),r._isRootItem(u)&&e.openOnClick!==!1||e.openOnClick.subMenuItems||i.support.touch||yt(t)&&r._isRootItem(u.closest(s)))&&(l||k||ot||t.preventDefault(),r.clicked=!0,a=h.is(":visible")?rt:ht,e.closeOnClick||a!=rt)&&r[a](u)}},_parentsUntil:function(t,i,r){var f=this._overflowWrapper(),e,u;return f?(e=ou(t,f),u=[],n(e).each(function(){var t=n(this);if(t.is(i))return!1;t.is(r)&&u.push(this)}),n(u)):t.parentsUntil(i,r)},_triggerSelect:function(n,t){var r,i,u,f;return n=n.is(".k-link")?n:n.closest(".k-link"),r=n.data("selectHandler"),r&&(i=this._getEventData(n),r.call(this,i)),u=i&&i.isDefaultPrevented(),f=this._triggerEvent({item:t,type:ut}),u||f},_getEventData:function(n){return{sender:this,target:n,_defaultPrevented:!1,preventDefault:function(){this._defaultPrevented=!0},isDefaultPrevented:function(){return this._defaultPrevented}}},_documentClick:function(n){var t=this;c((t._overflowWrapper()||t.element)[0],n.target)||(t.clicked=!1)},_focus:function(t){var i=this,r=t.target,u=i._hoverItem(),f=lr();if(r!=i.wrapper[0]&&!n(r).is(":kendoFocusable")){t.stopPropagation();n(r).closest(".k-content").closest(".k-menu-group").closest(".k-item").addClass(p);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,s=i.support.isRtl(t.wrapper);if(n.target==n.currentTarget||f==l.ESC){if(r||(r=t._oldHoverItem=t._hoverItem()),e=t._itemBelongsToVertival(r),o=t._itemHasChildren(r),t._keyTriggered=!0,f==l.RIGHT)u=t[s?"_itemLeft":"_itemRight"](r,e,o);else if(f==l.LEFT)u=t[s?"_itemRight":"_itemLeft"](r,e,o);else if(f==l.DOWN)u=t._itemDown(r,e,o);else if(f==l.UP)u=t._itemUp(r,e,o);else if(f==l.HOME)t._moveHover(r,r.parent().children().first()),n.preventDefault();else if(f==l.END)t._moveHover(r,r.parent().children().last()),n.preventDefault();else if(f==l.ESC)u=t._itemEsc(r,e);else if(f==l.ENTER||f==l.SPACEBAR)u=r.children(".k-link"),u.length>0&&(t._click({target:u[0],preventDefault:function(){},enterKey:!0}),o&&!r.hasClass(d)?(t.open(r),t._moveHover(r,t._childPopupElement(r).children().first())):t._moveHover(r,t._findRootParent(r)));else if(f==l.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||!n.length||!n[0].nodeType?!1:n.children("ul.k-menu-group, div.k-animation-container").length>0||!!n.data(y)&&!!this._overflowWrapper().children(st(n.data(y)))},_moveHover:function(t,i){var r=this,u=r._ariaId;t.length&&i.length&&t.removeClass(p);i.length&&(i[0].id&&(u=i[0].id),i.addClass(p),r._oldHoverItem=i,u&&(r.element.removeAttr("aria-activedescendant"),n("#"+u).removeAttr("id"),i.attr("id",u),r.element.attr("aria-activedescendant",u)),r._scrollToItem(i))},_findRootParent:function(n){return this._isRootItem(n)?n:this._parentsUntil(n,hi,"li.k-item").last()},_isRootItem:function(n){return n.parent().hasClass(a)},_itemRight:function(n,t,i){var u=this,r,f,e,o;return t?i&&!n.hasClass(d)?(u.open(n),r=u._childPopupElement(n).children().first()):u.options.orientation=="horizontal"&&(f=u._findRootParent(n),e=u._overflowWrapper(),e&&(o=or(f,e),u._closeChildPopups(o)),u.close(f),r=f.nextAll(et)):(r=n.nextAll(et),r.length||(r=n.prevAll(rr)),u.close(n)),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,u;return t?(i=n.parent().closest(".k-item"),u=r._overflowWrapper(),!i.length&&u&&(i=yi(n.parent(),u)),r.close(i),r._isRootItem(i)&&r.options.orientation=="horizontal"&&(i=i.prevAll(et))):(i=n.prevAll(et),i.length||(i=n.nextAll(rr)),r.close(n)),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(et);else{if(!i||n.hasClass(d))return;u.open(n);r=u._childPopupElement(n).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(et);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},_scrollToItem:function(n){var s=this,c;if(s.options.scrollable&&n&&n.length){var t=n.parent(),r=t.hasClass(a)?s.options.orientation=="horizontal":!1,l=r?"scrollLeft":"scrollTop",h=r?i._outerWidth:i._outerHeight,v=t[l](),y=h(n),u=n[0][r?"offsetLeft":"offsetTop"],p=h(t),f=t.siblings(nt),e=f.length?h(f.first()):0,o;v+p<u+y+e?o=u+y-p+e:v>u-e&&(o=u-e);isNaN(o)||(c={},c[l]=o,t.finish().animate(c,"fast","linear",function(){s._toggleScrollButtons(t,f.first(),f.last(),r)}))}},_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},_childPopupElement:function(n){var t=n.find(".k-menu-group"),i=this._overflowWrapper();return!t.length&&i&&(t=or(n,i)),t},_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(s);r.hasClass(d)||setTimeout(function(){u._moveHover([],r);r.children(".k-content")[0]&&r.parent().closest(".k-item").removeClass(p)},200)},_animations:function(n){n&&"animation"in n&&!n.animation&&(n.animation={open:{effects:{}},close:{hide:!0,effects:{}}})}}),cr;o(f,{renderItem:function(n){n=o({menu:{},group:{}},n);var i=h.empty,t=n.item;return h.item(o(n,{image:t.imageUrl?h.image:i,sprite:t.spriteCssClass?h.sprite:i,itemWrapper:h.itemWrapper,renderContent:f.renderContent,arrow:t.items||t.content?h.arrow:i,subGroup:f.renderGroup},vi))},renderGroup:function(n){return h.group(o({renderItems:function(n){for(var r="",t=0,i=n.items,u=i?i.length:0,e=o({length:u},n.group);t<u;t++)r+=f.renderItem(o(n,{group:e,item:o({index:t},i[t])}));return r}},n,vi))},renderContent:function(n){return h.content(o(n,vi))}});cr=f.extend({init:function(t,r){var u=this;f.fn.init.call(u,t,r);u._marker=i.guid().substring(0,8);u.target=n(u.options.target);u._popup();u._wire()},_initOverflow:function(n){var t=this;n.scrollable&&!t._overflowWrapper()&&(t._openedPopups={},t._popupsWrapper=(t.element.parent().is(e)?t.element.parent():t.element).wrap("<div class='k-popups-wrapper "+n.orientation+"'><\/div>").parent(),t.options.orientation=="horizontal"&&hr(t.element),n.appendTo&&n.appendTo.append(t._popupsWrapper),t._initialHeight=t.element[0].style.height,t._initialWidth=t.element[0].style.width)},options:{name:"ContextMenu",filter:null,showOn:"contextmenu",orientation:"vertical",alignToAnchor:!1,target:"body"},events:[ht,rt,ri,ui,ut],setOptions:function(t){var i=this;f.fn.setOptions.call(i,t);i.target.off(i.showOn+r+i._marker,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+n._marker);dt.off(i.support.mousedown+r+n._marker,n._closeProxy);n.userEvents&&n.userEvents.destroy();f.fn.destroy.call(n)},open:function(u,e){var o=this,s,h;if(u=n(u)[0],c(o.element[0],n(u)[0])||o._itemHasChildren(n(u)))f.fn.open.call(o,u);else if(o._triggerEvent({item:o.element,type:ht})===!1){o.popup.visible()&&o.options.filter&&(o.popup.close(!0),o.popup.element.kendoStop(!0));e!==t?(s=o._overflowWrapper(),s&&(h=s.offset(),u-=h.left,e-=h.top),o.popup.wrapper.hide(),o._configurePopupScrolling(u,e),o.popup.open(u,e)):(o.popup.options.anchor=(u?u:o.popup.anchor)||o.target,o.popup.element.kendoStop(!0),o._configurePopupScrolling(),o.popup.open());dt.off(o.popup.downEvent,o.popup._mousedownProxy);dt.on(i.support.mousedown+r+o._marker,o._closeProxy)}return o},_configurePopupScrolling:function(n,i){var u=this,r=u.popup,f=u.options.orientation=="horizontal";u.options.scrollable&&(u._wrapPopupElement(r),r.element.parent().css({position:"",height:""}),r.element.css({visibility:"hidden",display:"",position:""}),f?u._setPopupWidth(r,isNaN(n)?t:{isFixed:!0,x:n,y:i}):u._setPopupHeight(r,isNaN(n)?t:{isFixed:!0,x:n,y:i}),r.element.css({visibility:"",display:"none",position:"absolute"}),u._initPopupScrollButtons(r,f,!0),r.element.siblings(nt).hide())},_setPopupWidth:function(t,r){var u=t.element,f=u.add(u.parent(e));f.width(this._initialWidth||"");var o=t._location(r),a=n(window).width(),v=o.width,s=Math.max(o.left,0),h=r?0:sr(this._overflowWrapper()[0],"scrollLeft"),c=i.getShadows(u),l=a-c.left-c.right,y=l+h>v+s;y||f.css({overflow:"hidden",width:l-s+h+"px"})},close:function(){var t=this;c(t.element[0],n(arguments[0])[0])||t._itemHasChildren(arguments[0])?f.fn.close.call(t,arguments[0]):t.popup.visible()&&t._triggerEvent({item:t.element,type:rt})===!1&&(t.popup.close(),dt.off(i.support.mousedown+r,t._closeProxy),t.unbind(ut,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),c(r.element[0],n.relatedTarget||n.target))||(r._eventOrigin=t,t.preventDefault(),t.stopImmediatePropagation(),r.element.find("."+p).removeClass(p),(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(at),h=i._itemHasChildren(s),e=i._overflowWrapper(),u=c(i.element[0],r[0])||e&&c(e[0],r[0]),o;i._eventOrigin=t;o=t.which!==3;i.popup.visible()&&(o&&f||!f)&&(i.options.closeOnClick&&!h&&u||!u)&&(u?(this.unbind(ut,this._closeTimeoutProxy),i.bind(ut,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+n._marker,!1);n.userEvents.bind("hold",n._showProxy)}else if(t.filter)f.on(t.showOn+r+n._marker,t.filter,n._showProxy);else f.on(t.showOn+r+n._marker,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,o({type:i.type,item:i.item||this.element[0],target:f},u?{event:u}:{}))},_popup:function(){var t=this,i=t._overflowWrapper();t._triggerProxy=u(t._triggerEvent,t);t.popup=t.element.addClass("k-context-menu").kendoPopup({anchor:t.target||"body",copyAnchorStyles:t.options.copyAnchorStyles,collision:t.options.popupCollision||"fit",animation:t.options.animation,activate:t._triggerProxy,deactivate:t._triggerProxy,appendTo:i||t.options.appendTo,close:i?function(t){n(vt(t.sender.element,i)).each(function(n,t){var i=t.data(g);i&&i.close(!0)})}:n.noop}).data(g);t._targetChild=c(t.target[0],t.popup.element[0])}});ni.plugin(f);ni.plugin(cr)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.columnmenu",["kendo.popup","kendo.filtermenu","kendo.menu"],n)}(function(){return function(n,t){function tt(t){return n.trim(t).replace(/&nbsp;/gi,"")}function it(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}function rt(n,t){return"["+i.attr(n)+"="+t+"]"}function ut(n,t,i){n>0?t.insertAfter(i.children().eq(n-1)):i.prepend(t)}var i=window.kendo,v=i.ui,f=n.proxy,g=n.extend,r=n.grep,h=n.map,y=n.inArray,e="k-state-selected",c="asc",p="desc",w="change",b="init",k="open",o="select",l="kendoPopup",nt="kendoFilterMenu",d="kendoMenu",u=".kendoColumnMenu",s=v.Widget,ft=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="#" title="'+r.messages.settings+'" aria-label="'+r.messages.settings+'"><span class="k-icon k-i-more-vertical"><\/span><\/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.owner._muteAngularRebind(function(){n._angularItems("compile")});n._sort();n._columns();n._filter();n._lockColumns();n.trigger(b,{field:n.field,container:n.wrapper})},events:[b,k,"sort","filtering"],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(et)({uid:i.guid(),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()[d]({orientation:"vertical",closeOnClick:!1}).data(d)},_createMobileMenu:function(){var n=this,t=n.options,r=i.template(ot)({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 st(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){var i=this,t;(n.preventDefault(),n.stopPropagation(),t=this.options,t.filter&&this.element.is(!t.filter))||(this.popup||this.pane?i._reorderColumnList():this._init(),this._isMobile?this.pane.navigate(this.view,this.options.animations.left):this.popup.toggle())},_reorderColumnList:function(){for(var i=this,r,u=i._ownerColumns()||[],f=i._isMobile&&i.view?n(i.view.element).find(".k-columns-item").children("ul"):n(i.wrapper).find(".k-menu-group"),t=0;t<u.length;t++)r=f.find(rt("field",u[t].originalField)).closest("li"),r[0]&&r.index()!==t&&ut(t,r,f)},_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();this.trigger(k,{field:this.field,container:this.wrapper})},_ownerColumns:function(){var n=null,t,i;return this.owner.columns.length===1&&!dsiCommon.isNullOrEmpty(this.owner.columns[0].dsi)&&!dsiCommon.isNullOrEmpty(this.owner.columns[0].dsi.columns)&&this.owner.columns[0].dsi.columns.length>0&&(n=this.owner.columns[0].dsi.columns),t=a(n==null?this.owner.columns:n),i=r(t,function(n){var t=!0,i=tt(n.title||"");return n.menu!==!1&&(n.field||i.length)||(t=!1),t}),h(i,function(n){return{originalField:n.field,field:n.field||n.title,title:n.title||n.field,hidden:n.hidden,index:y(n,t),locked:!!n.locked,_originalObject:n}})},_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 r=this,f=r.options.sortable,s=f.compare===null?t:f.compare,h=r.dataSource,o,c,u=h.sort()||[],l=n.hasClass(e)&&f&&f.allowUnsort!==!1;if(i=l?t:i,!r.trigger("sort",{sort:{field:r.field,dir:i,compare:s}})){if(l?n.removeClass(e):n.addClass(e),f.mode==="multiple"){for(o=0,c=u.length;o<c;o++)if(u[o].field===r.field){u.splice(o,1);break}u.push({field:r.field,dir:i,compare:s})}else u=[{field:r.field,dir:i,compare:s}];h.sort(u)}},_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 o=null,s,h,f,l,e,c;(t.owner.columns.length===1&&!dsiCommon.isNullOrEmpty(t.owner.columns[0].dsi)&&!dsiCommon.isNullOrEmpty(t.owner.columns[0].dsi.columns)&&t.owner.columns[0].dsi.columns.length>0&&(o=t.owner.columns[0].dsi.columns),s=n(u.item),l=a(o==null?t.owner.columns:o),t._isMobile&&u.preventDefault(),s.parent().closest("li.k-columns-item")[0])&&((h=s.find(":checkbox"),h.attr("disabled"))||(e=h.attr(i.attr("field")),f=r(l,function(n){return n.field==e||n.title==e}),f.length===1?f=f[0]:(c=r(f,function(n){return n.field==e}),f=c.length===1?c[0]:r(f,function(n){return n.title==e&&dsiCommon.isNullOrEmpty(n.field)})[0]),f.hidden===!0?t.owner.showColumn(f):t.owner.hideColumn(f)))}))},_updateColumnsMenu:function(){var u,s,n,t,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}),this.wrapper.find("[role='menuitemcheckbox']").attr("aria-checked",!1),o=this.wrapper.find(".k-columns-item input["+c+"]").prop("disabled",!1).prop("checked",!1),u=0,s=o.length;u<s;u++)n=o.eq(u),e=n.attr(a)==="true",t=!1,y(n.attr(c),f)>-1&&(t=!0,n.prop("checked",t)),n.closest("[role='menuitemcheckbox']").attr("aria-checked",t),t&&(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=it(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=nt,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](g(!0,{},{appendToElement:!0,dataSource:i.dataSource,values:i.values,field:t.field,title:t.title,change:function(n){t.trigger("filtering",{filter:n.filter,field:n.field})&&n.preventDefault()}},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}}}),et='<ul id="#=uid#">#if(sortable){#<li class="k-item k-sort-asc"><span class="k-link"><span class="k-icon k-i-sort-asc-sm"><\/span>${messages.sortAscending}<\/span><\/li><li class="k-item k-sort-desc"><span class="k-link"><span class="k-icon k-i-sort-desc-sm"><\/span>${messages.sortDescending}<\/span><\/li>#if(showColumns || filterable){#<li class="k-separator" role="presentation"><\/li>#}##}##if(showColumns){#<li class="k-item k-columns-item" aria-haspopup="true"><span class="k-link"><span class="k-icon k-i-columns"><\/span>${messages.columns}<\/span><ul>#for (var idx = 0; idx < columns.length; idx++) {#<li role="menuitemcheckbox" aria-checked="false"><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" role="presentation"><\/li>#}##}##if(filterable){#<li class="k-item k-filter-item" aria-haspopup="true"><span class="k-link"><span class="k-icon k-i-filter"><\/span>${messages.filter}<\/span><ul><li><div class="k-filterable"><\/div><\/li><\/ul><\/li>#if(lockedColumns){#<li class="k-separator" role="presentation"><\/li>#}##}##if(lockedColumns){#<li class="k-item k-lock"><span class="k-link"><span class="k-icon k-i-lock"><\/span>${messages.lock}<\/span><\/li><li class="k-item k-unlock"><span class="k-link"><span class="k-icon k-i-unlock"><\/span>${messages.unlock}<\/span><\/li>#}#<\/ul>',ot='<div data-#=ns#role="view" data-#=ns#init-widgets="false" data-#=ns#use-native-scrolling="true" 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-icon k-i-sort-asc-sm"><\/span>${messages.sortAscending}<\/span><\/li><li class="k-item k-sort-desc"><span class="k-link"><span class="k-icon k-i-sort-desc-sm"><\/span>${messages.sortDescending}<\/span><\/li>#}##if(lockedColumns){#<li class="k-item k-lock"><span class="k-link"><span class="k-icon k-i-lock"><\/span>${messages.lock}<\/span><\/li><li class="k-item k-unlock"><span class="k-link"><span class="k-icon 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-icon k-i-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>',st=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(ft)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.columnsorter",["kendo.core"],n)}(function(){return function(n,t){var i=window.kendo,s=i.ui,f=s.Widget,u="dir",r="asc",h="single",c="field",e="desc",l=".kendoColumnSorter",a=".k-link",o="aria-sort",v=n.proxy,y=f.extend({init:function(n,t){var i=this,u;f.fn.init.call(i,n,t);i._refreshHandler=v(i.refresh,i);i.dataSource=i.options.dataSource.bind("change",i._refreshHandler);i.directions=i.options.initialDirection===r?[r,e]:[e,r];u=i.element.find(a);u[0]||(u=i.element.wrapInner('<a class="k-link" href="#"/>').find(a));i.link=u;i.element.on("click"+l,v(i._click,i))},options:{name:"ColumnSorter",mode:h,allowUnsort:!0,compare:null,filter:"",initialDirection:r,showIndexes:!1},events:["change"],destroy:function(){var n=this;f.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 h=this,v=h.dataSource.sort()||[],l,w,y,a,f=h.element,b=f.attr(i.attr(c)),p,s;for(f.removeAttr(i.attr(u)),f.removeAttr(o),l=0,w=v.length;l<w;l++)y=v[l],b==y.field&&(f.attr(i.attr(u),y.dir),p=l+1);a=f.attr(i.attr(u));f.is("th")&&(s=f.closest("table"),s.parent().hasClass("k-grid-header-wrap")?s=s.closest(".k-grid").find(".k-grid-content > table"):s.parent().hasClass("k-grid")||(s=null),s&&(f.toggleClass("k-sorted",a!==t),s.children("colgroup").children().eq(f.index()).toggleClass("k-sorted",a!==t)));f.find(".k-i-sort-asc-sm,.k-i-sort-desc-sm,.k-sort-order").remove();a===r?(n('<span class="k-icon k-i-sort-asc-sm" />').appendTo(h.link),f.attr(o,"ascending")):a===e&&(n('<span class="k-icon k-i-sort-desc-sm" />').appendTo(h.link),f.attr(o,"descending"));h.options.showIndexes&&v.length>1&&p&&n('<span class="k-sort-order" />').html(p).appendTo(h.link)},_toggleSortDirection:function(n){var i=this.directions;return n===i[i.length-1]&&this.options.allowUnsort?t:i[0]===n?i[1]:i[0]},_click:function(n){var r=this,s=r.element,l=s.attr(i.attr(c)),e=s.attr(i.attr(u)),a=r.options,v=r.options.compare===null?t:r.options.compare,f=r.dataSource.sort()||[],o,y;if((n.preventDefault(),!a.filter||s.is(a.filter))&&(e=this._toggleSortDirection(e),!this.trigger("change",{sort:{field:l,dir:e,compare:v}}))){if(a.mode===h)f=[{field:l,dir:e,compare:v}];else if(a.mode==="multiple"){for(o=0,y=f.length;o<y;o++)if(f[o].field===l){f.splice(o,1);break}f.push({field:l,dir:e,compare:v})}this.dataSource.options.endless&&(this.dataSource.options.endless=null,s.closest(".k-grid").getKendoGrid()._endlessPageSize=r.dataSource.options.pageSize,this.dataSource.pageSize(r.dataSource.options.pageSize));this.dataSource.sort(f)}}});s.plugin(y)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.editable",["kendo.datepicker","kendo.numerictextbox","kendo.validator","kendo.binder"],n)}(function(){return 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, .k-combobox .k-input, ["+i.attr("role")+"=listbox], ["+i.attr("role")+"=upload], ["+i.attr("skip")+"], [type=file])").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,title:n.title};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-i-warning"> <\/span>#=message#<div class="k-callout k-callout-n"><\/div><\/div>',skipFocus:!1},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});r.options.skipFocus||(d=f.find(":kendoFocusable").eq(0).focus(),p&&d.focus())}});e.plugin(d)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.window",["kendo.draganddrop","kendo.popup"],n)}(function(){return function(n,t){function ut(n){return typeof n!="undefined"}function s(n,t,i){return Math.max(Math.min(parseInt(n,10),i===Infinity?i:parseInt(i,10)),parseInt(t,10))}function wi(){return!this.type||this.type.toLowerCase().indexOf("script")>=0}function si(n){var t=this;t.owner=n;t._preventDragging=!1;t._draggable=new ht(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 ki(t){for(var r={top:t.offsetTop,left:t.offsetLeft},i=t.offsetParent,u,f;i;)r.top+=i.offsetTop,r.left+=i.offsetLeft,u=n(i).css("overflowX"),f=n(i).css("overflowY"),(f==="auto"||f==="scroll")&&(r.top-=i.scrollTop),(u==="auto"||u==="scroll")&&(r.left-=i.scrollLeft),i=i.offsetParent;return r}function hi(n,t){var i=this;i.owner=n;i._preventDragging=!1;i._draggable=new ht(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,g=i.ui.Widget,ci=i.ui.Popup.TabKeyTrap,ht=i.ui.Draggable,ct=n.isPlainObject,li=i._activeElement,nt=i._outerWidth,ai=i._outerHeight,r=n.proxy,a=n.extend,vi=n.each,h=i.template,tt="body",e,u=".kendoWindow",v=".k-window",ft=".k-window-title",f=ft+"bar",o=".k-window-content",yi=".k-dialog-content",c=".k-resize-handle",b=".k-overlay",y="k-content-frame",lt="k-i-loading",at="k-state-hover",vt="k-state-focused",yt="k-window-maximized",p=":visible",it="hidden",w="cursor",et="open",ot="activate",pt="deactivate",wt="close",rt="refresh",bt="resizeStart",kt="resizeEnd",dt="dragstart",gt="dragend",ni="error",l="overflow",st="original-overflow-rule",k="zIndex",ti=".k-window-actions .k-i-window-minimize,.k-window-actions .k-i-window-maximize",ii=".k-i-pin",ri=".k-i-unpin",ui=ii+","+ri,d=".k-window-titlebar .k-window-action",fi=".k-window-titlebar .k-i-refresh",ei="WindowEventsHandled",oi=/^0[a-z]*$/i,pi=i.isLocalUrl,bi=g.extend({init:function(e,s){var h=this,c,nt={},tt,rt,l,st=!1,a,w,ht,k,lt=s&&s.actions&&!s.actions.length,b;g.fn.init.call(h,e,s);s=h.options;l=s.position;e=h.element;a=s.content;k=n(window);lt&&(s.actions=[]);h.appendTo=n(s.appendTo);a&&!ct(a)&&(a=s.content={url:a});e.find("script").filter(wi).remove();e.parent().is(h.appendTo)||l.top!==t&&l.left!==t||(e.is(p)?(nt=e.offset(),st=!0):(tt=e.css("visibility"),rt=e.css("display"),e.css({visibility:it,display:""}),nt=e.offset(),e.css({visibility:tt,display:rt})),l.top===t&&(l.top=nt.top),l.left===t&&(l.left=nt.left));ut(s.visible)&&s.visible!==null||(s.visible=e.is(p));c=h.wrapper=e.closest(v);e.is(".k-content")&&c[0]||(e.addClass("k-window-content k-content"),h._createWindow(e,s),c=h.wrapper=e.closest(v),h._dimensions());h._position();a&&h.refresh(a);s.visible&&h.toFront();w=c.children(o);h._tabindex(w);s.visible&&s.modal&&h._overlay(c.is(p)).css({opacity:.5});c.on("mouseenter"+u,d,r(h._buttonEnter,h)).on("mouseleave"+u,d,r(h._buttonLeave,h)).on("click"+u,"> "+d,r(h._windowActionHandler,h)).on("keydown"+u,r(h._keydown,h)).on("focus"+u,r(h._focus,h)).on("blur"+u,r(h._blur,h));w.on("keydown"+u,r(h._keydown,h)).on("focus"+u,r(h._focus,h)).on("blur"+u,r(h._blur,h));if(ht=w.find("."+y)[0],ht&&!k.data(ei)){k.on("blur"+u,function(){var t=n(document.activeElement).parent(o),r;t.length&&(r=i.widgetInstance(t),r._focus())});k.on("focus"+u,function(){n(o).not(yi).each(function(t,r){i.widgetInstance(n(r))._blur()})});k.data(ei,!0)}this._resizable();this._draggable();s.pinned&&st&&h.pin();b=e.attr("id");b&&(b=b+"_wnd_title",c.children(f).children(ft).attr("id",b),w.attr({role:"dialog","aria-labelledby":b}));c.add(c.children(".k-resize-handle,"+f)).on("mousedown"+u,r(h.toFront,h));h.touchScroller=i.touchScroller(e);h._resizeHandler=r(h._onDocumentResize,h);h._marker=i.guid().substring(0,8);n(window).on("resize"+u+h._marker,h._resizeHandler);s.visible&&(h.trigger(et),h.trigger(ot));i.notify(h);this.options.modal&&(this._tabKeyTrap=new ci(c),this._tabKeyTrap.trap(),this._tabKeyTrap.shouldTrap=function(){return w.data("isFront")})},_buttonEnter:function(t){n(t.currentTarget).addClass(at)},_buttonLeave:function(t){n(t.currentTarget).removeClass(at)},_focus:function(){this.wrapper.addClass(vt)},_blur:function(){this.wrapper.removeClass(vt)},_dimensions:function(){var t=this.wrapper,n=this.options,i=n.width,r=n.height,o=n.maxHeight,f=["minWidth","minHeight","maxWidth","maxHeight"],u,e;for(this.title(n.title),u=0;u<f.length;u++)e=n[f[u]]||"",e!=Infinity&&t.css(f[u],e);o!=Infinity&&this.element.css("maxHeight",o);i?isNaN(i)&&i.toString().indexOf("px")<0?t.width(i):t.width(s(i,n.minWidth,n.maxWidth)):t.width("");r?isNaN(r)&&r.toString().indexOf("px")<0?t.height(r):t.height(s(r,n.minHeight,n.maxHeight)):t.height("");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));vi("n e s w se sw ne nw".split(" "),function(n,i){t.append(e.resizeHandle(i))});this.resizing=new si(this)}t=null},_draggable:function(){var n=this.options.draggable;this.dragging&&(this.dragging.destroy(),this.dragging=null);n&&(this.dragging=new hi(this,n.dragHandle||f))},_actions:function(){var r=this.options,t=r.actions,u=r.pinned,o=this.wrapper.children(f),s=o.find(".k-window-actions"),h=["maximize","minimize"];t=n.map(t,function(n){return n=u&&n.toLowerCase()==="pin"?"unpin":n,{name:h.indexOf(n.toLowerCase())>-1?"window-"+n:n}});s.html(i.render(e.action,t))},setOptions:function(n){var r=JSON.parse(JSON.stringify(n)),t,i;a(n.position,this.options.position);a(n.position,r.position);g.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:[et,ot,pt,wt,"minimize","maximize",rt,bt,"resize",kt,dt,gt,ni],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",isMaximized:!1,isMinimized:!1},_closable:function(){return n.inArray("close",n.map(this.options.actions,function(n){return n.toLowerCase()}))>-1},_keydown:function(n){var t=this,h=t.options,u=i.keys,r=n.keyCode,f=t.wrapper,c,e,o=10,l=t.options.isMaximized,y=t.options.isMinimized,p,w,a,v;(r==u.ESC&&t._closable()&&t._close(!1),n.target!=n.currentTarget||t._closing)||(n.altKey&&r==82&&t.refresh(),n.altKey&&r==80&&(t.options.pinned?t.unpin():t.pin()),n.altKey&&r==u.UP?y?(t.restore(),t.element.focus()):l||(t.maximize(),t.element.focus()):n.altKey&&r==u.DOWN&&(y||l?l&&(t.restore(),t.element.focus()):(t.minimize(),t.wrapper.focus())),!h.draggable||n.ctrlKey||n.altKey||l||(c=i.getOffset(f),r==u.UP?e=f.css("top",c.top-o):r==u.DOWN?e=f.css("top",c.top+o):r==u.LEFT?e=f.css("left",c.left-o):r==u.RIGHT&&(e=f.css("left",c.left+o))),h.resizable&&n.ctrlKey&&!l&&!y&&(r==u.UP?(e=!0,w=f.height()-o):r==u.DOWN&&(e=!0,w=f.height()+o),r==u.LEFT?(e=!0,p=f.width()-o):r==u.RIGHT&&(e=!0,p=f.width()+o),e&&(a=s(p,h.minWidth,h.maxWidth),v=s(w,h.minHeight,h.maxHeight),isNaN(a)||(f.width(a),t.options.width=a+"px"),isNaN(v)||(f.height(v),t.options.height=v+"px"),t.resize())),e&&n.preventDefault())},_overlay:function(t){var i=this.appendTo.children(b),r=this.wrapper;return i.length||(i=n("<div class='k-overlay' />")),i.insertBefore(r[0]).toggle(t).css(k,parseInt(r.css(k),10)-1),i},_actionForIcon:function(n){var t=/\bk-i(-\w+)+\b/.exec(n[0].className)[0];return{"k-i-close":"_close","k-i-window-maximize":"maximize","k-i-window-minimize":"minimize","k-i-window-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(v).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(p)}).sort(function(t,i){return+n(t).css("zIndex")-+n(i).css("zIndex")});return t=null,i},_object:function(n){var u=n.children(o),r=i.widgetInstance(u);return r?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 r=this,u=r.wrapper,h=r.options,t=u.children(f),s=t.children(ft),o;return arguments.length?(n===!1?(u.addClass("k-window-titleless"),t.remove()):(t.length?s.html(i.htmlEncode(n)):(u.prepend(e.titlebar(h)),r._actions(),t=u.children(f)),o=parseInt(ai(t),10),u.css("padding-top",o),t.css("margin-top",-o)),r.options.title=n,r):s.html()},content:function(n,t){var r=this.wrapper.children(o),u=r.children(".km-scroll-container");return(r=u[0]?u:r,!ut(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,e=t.wrapper,u=t.options,s=this._animationOptions("open"),a=e.children(o),f,c,v=n(document),h;if(!t.trigger(et)){if(t._closing&&e.kendoStop(!0,!0),t._closing=!1,t.toFront(),u.autoFocus&&t.element.focus(),u.visible=!0,u.modal){c=!!t._modals().length;f=t._overlay(c);f.kendoStop(!0,!0);s.duration&&i.effects.Fade&&!c?(h=i.fx(f).fadeIn(),h.duration(s.duration||0),h.endValue(.5),h.play()):f.css("opacity",.5);f.show();n(window).on("focus",function(){a.data("isFront")&&t.element.focus()})}e.is(p)||(a.css(l,it),e.show().kendoStop().kendoAnimate({effects:s.effects,duration:s.duration,complete:r(this._activate,this)}))}return u.isMaximized&&(t._documentScrollTop=v.scrollTop(),t._documentScrollLeft=v.scrollLeft(),t._stopDocumentScrolling()),u.pinned&&!t._isPinned&&t.pin(),t},_activate:function(){var n=this.options.scrollable!==!1;this.options.autoFocus&&this.element.focus();this.element.css(l,n?"":"hidden");i.resize(this.element.children());this.trigger(ot)},_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,s=i.options,h=this._animationOptions("open"),f=this._animationOptions("close"),e=n(document);if(u.is(p)&&!i.trigger(wt,{userTriggered:!t})){if(i._closing)return;i._closing=!0;s.visible=!1;n(v).each(function(t,i){var r=n(i).children(o);i!=u&&r.find("> ."+y).length>0&&r.children(b).remove()});this._removeOverlay();u.kendoStop().kendoAnimate({effects:f.effects||h.effects,reverse:f.reverse===!0,duration:f.duration,complete:r(this._deactivate,this)})}i.options.isMaximized&&(i._enableDocumentScrolling(),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(pt);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(d+","+d+" .k-icon,:input,a")},_shouldFocus:function(t){var r=li(),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 i=this,r=i.wrapper,h=r[0],u=+r.css(k),a=u,c=t&&t.target||null,l,f,s;return n(v).each(function(t,i){var f=n(i),s=f.css(k),r=f.children(o);isNaN(s)||(u=Math.max(+s,u));r.data("isFront",i==h);i!=h&&r.find("> ."+y).length>0&&r.append(e.overlay)}),(!r[0].style.zIndex||a<u)&&r.css(k,u+2),i.element.find("> .k-overlay").remove(),i._shouldFocus(c)&&(i.isMinimized()?i.wrapper.focus():n(c).is(b)?setTimeout(function(){i.element.focus()}):(l=dsiCommon.getElementFromPath(i.options,"dsi.focusOnClose"),l!=!1&&i.element.focus()),f=n(window).scrollTop(),s=parseInt(r.position().top,10),!i.options.pinned&&s>0&&s<f&&(f>0?n(window).scrollTop(s):r.css("top",f))),r=null,i},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(yt).find(".k-window-content,.k-resize-handle").show().end().find(".k-window-titlebar .k-i-window-restore").parent().remove().end().end().find(ti).parent().show().end().end().find(ui).parent().show(),i.isMaximized?t.wrapper.find(".k-i-window-maximize").parent().focus():i.isMinimized&&t.wrapper.find(".k-i-window-minimize").parent().focus(),t.options.width=r.width,t.options.height=r.height,t._enableDocumentScrolling(),this._documentScrollTop&&this._documentScrollTop>0&&f.scrollTop(this._documentScrollTop),this._documentScrollLeft&&this._documentScrollLeft>0&&f.scrollLeft(this._documentScrollLeft),i.isMaximized=i.isMinimized=!1,this.wrapper.removeAttr("tabindex"),this.wrapper.removeAttr("aria-labelled-by"),t.resize(),t)},_sizingAction:function(n,t){var i=this,r=i.wrapper,u=r[0].style,o=i.options;return o.isMaximized||o.isMinimized?i:(i.restoreOptions={width:dsiCommon.isNullOrEmpty(u.width)?r.width():u.width,height:dsiCommon.isNullOrEmpty(u.height)?r.height():u.height},r.children(c).hide().end().children(f).find(ti).parent().hide().eq(0).before(e.action({name:"window-restore"})),t.call(i),i.wrapper.children(f).find(ui).parent().toggle(n!=="maximize"),i.trigger(n),r.find(".k-i-window-restore").parent().focus(),i)},maximize:function(){return this._sizingAction("maximize",function(){var t=this,i=t.wrapper,r=i.position(),u=n(document);a(t.restoreOptions,{left:r.left,top:r.top});i.css({left:0,top:0,position:"fixed"}).addClass(yt);this._documentScrollTop=u.scrollTop();this._documentScrollLeft=u.scrollLeft();t._stopDocumentScrolling();t.options.isMaximized=!0;t._onDocumentResize()}),this},_stopDocumentScrolling:function(){var i=this,r=n("body"),t;i._storeOverflowRule(r);r.css(l,it);t=n("html");i._storeOverflowRule(t);t.css(l,it)},_enableDocumentScrolling:function(){var t=this;t._restoreOverflowRule(n(document.body));t._restoreOverflowRule(n("html"))},_storeOverflowRule:function(n){var t=n.get(0).style.overflow;t&&n.data(st,t)},_restoreOverflowRule:function(n){var t=n.data(st);t?(n.css(l,t),n.removeData(st)):n.css(l,"")},isMaximized:function(){return this.options.isMaximized},minimize:function(){return this._sizingAction("minimize",function(){var n=this;n.wrapper.css({height:"",minHeight:""});n.element.hide();n.options.isMinimized=!0}),this.wrapper.attr("tabindex",0),this.wrapper.attr("aria-labelled-by",this.element.attr("aria-labelled-by")),this},isMinimized:function(){return this.options.isMinimized},pin:function(){var t=this,r=n(window),i=t.wrapper,u=parseInt(i.css("top"),10),e=parseInt(i.css("left"),10);t.options.isMaximized||(i.css({position:"fixed",top:u-r.scrollTop(),left:e-r.scrollLeft()}),i.children(f).find(ii).addClass("k-i-unpin").removeClass("k-i-pin"),t._isPinned=!0,t.options.pinned=!0,t.options.draggable=!1)},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.isMaximized||(i.css({position:"",top:u+r.scrollTop(),left:e+r.scrollLeft()}),i.children(f).find(ri).addClass("k-i-pin").removeClass("k-i-unpin"),t._isPinned=!1,t.options.pinned=!1,t.options.draggable=!0)},_onDocumentResize:function(){var r=this,t=r.wrapper,e=n(window),o=i.support.zoomLevel(),u,f,s,h;r.options.isMaximized&&(s=parseInt(t.css("border-left-width"),10)+parseInt(t.css("border-right-width"),10),h=parseInt(t.css("border-top-width"),10)+parseInt(t.css("border-bottom-width"),10),u=e.width()/o-s,f=e.height()/o-parseInt(t.css("padding-top"),10)-h,t.css({width:u,height:f}),r.options.width=u,r.options.height=f,r.resize())},refresh:function(t){var i=this,o=i.options,s=n(i.element),c,f,l;if(ct(t)||(t={url:t}),t=a({},o.content,t),f=ut(o.iframe)?o.iframe:t.iframe,l=t.url,l)if(ut(f)||(f=!pi(l)),f){c=s.find("."+y)[0];c?c.src=l||c.src:s.html(e.contentFrame(a({},o,{content:t})));s.find("."+y).unbind("load"+u).on("load"+u,r(this._triggerRefresh,this))}else i._ajaxRequest(t);else t.template&&i.content(h(t.template)({})),i.trigger(rt);return s.toggleClass("k-window-iframecontent",!!f),i},_triggerRefresh:function(){this.trigger(rt)},_ajaxComplete:function(){clearTimeout(this._loadingIconTimeout);this.wrapper.find(fi).removeClass(lt)},_ajaxError:function(n,t){this.trigger(ni,{status:t,xhr:n})},_ajaxSuccess:function(n){return function(t){var i=t;n&&(i=h(n)(t||{}));this.content(i,t);this.element.prop("scrollTop",0);this.trigger(rt)}},_showLoading:function(){this.wrapper.find(fi).addClass(lt)},_ajaxRequest:function(t){this._loadingIconTimeout=setTimeout(r(this._showLoading,this),100);n.ajax(a({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(o).off(u).end().find(".k-resize-handle,.k-window-titlebar").off(u);n(window).off("resize"+u+this._marker);clearTimeout(this._loadingIconTimeout);g.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.css("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",nt(r.find(".k-window-actions"))+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:h("<div class='k-widget k-window' />"),action:h("<a role='button' href='\\#' class='k-button k-bare k-button-icon k-window-action' aria-label='#= name #'><span class='k-icon k-i-#= name.toLowerCase() #'><\/span><\/a>"),titlebar:h("<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:h("<iframe frameborder='0' title='#= title #' class='"+y+"' src='#= content.url #'>This page requires frames in order to show content<\/iframe>"),resizeHandle:h("<div class='k-resize-handle k-resize-#= data #'><\/div>")};si.prototype={addOverlay:function(){this.owner.wrapper.append(e.overlay)},removeOverlay:function(){this.owner.wrapper.find(b).remove()},dragstart:function(t){var r=this,e=r.owner,u=e.wrapper,f;if(r._preventDragging=e.trigger(bt),!r._preventDragging){if(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(e.appendTo,"position"),f=u.offsetParent(),f.is("html"))r.containerOffset.top=r.containerOffset.left=0;else{var l=f.css("margin-top"),a=f.css("margin-left"),v=!oi.test(l)||!oi.test(a);if(v){var o=ki(u[0]),s=o.left-r.containerOffset.left-r.initialPosition.left,h=o.top-r.containerOffset.top-r.initialPosition.top;r._relativeElMarginLeft=s>1?s:0;r._relativeElMarginTop=h>1?h:0;r.initialPosition.left+=r._relativeElMarginLeft;r.initialPosition.top+=r._relativeElMarginTop}}u.children(c).not(t.currentTarget).hide();n(tt).css(w,t.currentTarget.css(w))}},drag:function(t){var a;if(!this._preventDragging){var i=this,e=i.owner,h=e.wrapper,r=e.options,c=i.resizeDirection,o=i.containerOffset,l=i.initialPosition,p=i.initialSize,u,f,v,y,w=Math.max(t.x.location,0),b=Math.max(t.y.location,0);c.indexOf("e")>=0?(u=w-l.left-o.left,h.width(s(u,r.minWidth,r.maxWidth))):c.indexOf("w")>=0&&(y=l.left+p.width+o.left,u=s(y-w,r.minWidth,r.maxWidth),h.css({left:y-u-o.left-(i._relativeElMarginLeft||0),width:u}));a=b;e.options.pinned&&(a-=n(window).scrollTop());c.indexOf("s")>=0?(f=a-l.top-i.elementPadding-o.top,h.height(s(f,r.minHeight,r.maxHeight))):c.indexOf("n")>=0&&(v=l.top+p.height+o.top,f=s(v-a,r.minHeight,r.maxHeight),h.css({top:v-f-o.top-(i._relativeElMarginTop||0),height:f}));u&&(e.options.width=u+"px");f&&(e.options.height=f+"px");e.resize()}},dragend:function(t){if(!this._preventDragging){var r=this,i=r.owner,u=i.wrapper;return u.children(c).not(t.currentTarget).show(),n(tt).css(w,""),i.touchScroller&&i.touchScroller.reset(),t.keyCode==27&&u.css(r.initialPosition).css(r.initialSize),i.trigger(kt),!1}},destroy:function(){this._draggable&&this._draggable.destroy();this._draggable=this.owner=null}};hi.prototype={dragstart:function(t){var r=this.owner,u=r.element,f=u.find(".k-window-actions"),o=i.getOffset(r.appendTo);(this._preventDragging=r.trigger(dt)||!r.options.draggable,this._preventDragging)||(r.initialWindowPosition=i.getOffset(r.wrapper,"position"),r.initialPointerPosition={left:t.x.client,top:t.y.client},r.startPosition={left:t.x.client-r.initialWindowPosition.left,top:t.y.client-r.initialWindowPosition.top},r.minLeftPosition=f.length>0?nt(f)+parseInt(f.css("right"),10)-nt(u):20-nt(u),r.minLeftPosition-=o.left,r.minTopPosition=-o.top,r.wrapper.append(e.overlay).children(c).hide(),n(tt).css(w,t.currentTarget.css(w)))},drag:function(t){if(!this._preventDragging){var r=this.owner,u=r.options.position;u.top=Math.max(t.y.client-r.startPosition.top,r.minTopPosition);u.left=Math.max(t.x.client-r.startPosition.left,r.minLeftPosition);i.support.transforms?n(r.wrapper).css("transform","translate("+(t.x.client-r.initialPointerPosition.left)+"px, "+(t.y.client-r.initialPointerPosition.top)+"px)"):n(r.wrapper).css(u)}},_finishDrag:function(){var t=this.owner;t.wrapper.children(c).toggle(!t.options.isMinimized).end().find(b).remove();n(tt).css(w,"")},dragcancel:function(n){this._preventDragging||(this._finishDrag(),n.currentTarget.closest(v).css(this.owner.initialWindowPosition))},dragend:function(){if(!this._preventDragging)return n(this.owner.wrapper).css(this.owner.options.position).css("transform",""),this._finishDrag(),this.owner.trigger(gt),!1},destroy:function(){this._draggable&&this._draggable.destroy();this._draggable=this.owner=null}};i.ui.plugin(bi)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.mobile.view",["kendo.core","kendo.fx","kendo.mobile.scroller","kendo.view"],n)}(function(){return 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),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.mobile.loader",["kendo.core"],n)}(function(){return 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),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.mobile.pane",["kendo.mobile.view","kendo.mobile.loader"],n)}(function(){return 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,{fastTap:!0,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),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.mobile.popover",["kendo.popup","kendo.mobile.pane"],n)}(function(){return 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),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.mobile.shim",["kendo.popup"],n)}(function(){return 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),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.mobile.actionsheet",["kendo.mobile.popover","kendo.mobile.shim"],n)}(function(){return 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),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.progressbar",["kendo.core"],n)}(function(){return 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),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("pdf/pako",["kendo.core"],n)}(function(){return function(){kendo.pdf=kendo.pdf||{};kendo.pdf.supportsDeflate=function(){return window.pako&&typeof window.pako.deflate=="function"};kendo.pdf.deflate=function(n){return window.pako.deflate(n)}}(),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("pdf/core",["pdf/pako","kendo.core","kendo.color","kendo.drawing"],n)}(function(){return function(n){function r(n){function g(){return t>=i}function u(){return t<i?n[t++]:0}function r(r){c(t);n[t++]=r&255;t>i&&(i=t)}function f(){return u()<<8|u()}function e(n){r(n>>8);r(n)}function nt(){var n=f();return n>=32768?n-65536:n}function tt(n){e(n<0?n+65536:n)}function s(){return f()*65536+f()}function h(n){e(n>>>16&65535);e(n&65535)}function v(){var n=s();return n>=2147483648?n-4294967296:n}function y(n){h(n<0?n+4294967296:n)}function it(){return s()/65536}function rt(n){h(Math.round(n*65536))}function ut(){return v()/65536}function ft(n){y(Math.round(n*65536))}function p(n){return w(n,u)}function et(n){return String.fromCharCode.apply(String,p(n))}function o(n){for(var t=0;t<n.length;++t)r(n.charCodeAt(t))}function w(n,t){for(var r=new Array(n),i=0;i<n;++i)r[i]=t();return r}var t=0,i=0,b;n==null?n=d?new Uint8Array(256):[]:i=n.length;var c=d?function(t){if(t>=n.length){var i=new Uint8Array(Math.max(t+256,n.length*2));i.set(n,0);n=i}}:function(){},l=d?function(){return new Uint8Array(n.buffer,0,i)}:function(){return n},a=d?function(r){if(typeof r=="string")return o(r);var u=r.length;c(t+u);n.set(r,t);t+=u;t>i&&(i=t)}:function(n){if(typeof n=="string")return o(n);for(var t=0;t<n.length;++t)r(n[t])},k=d?function(t,i){if(n.buffer.slice)return new Uint8Array(n.buffer.slice(t,t+i));var r=new Uint8Array(i);return r.set(new Uint8Array(n.buffer,t,i)),r}:function(t,i){return n.slice(t,t+i)};return b={eof:g,readByte:u,writeByte:r,readShort:f,writeShort:e,readLong:s,writeLong:h,readFixed:it,writeFixed:rt,readShort_:nt,writeShort_:tt,readLong_:v,writeLong_:y,readFixed_:ut,writeFixed_:ft,read:p,write:a,readString:et,writeString:o,times:w,get:l,slice:k,offset:function(n){return n!=null?(t=n,b):t},skip:function(n){t+=n},toString:function(){throw new Error("FIX CALLER.  BinaryStream is no longer convertible to string!");},length:function(){return i},saveExcursion:function(n){var i=t;try{return n()}finally{t=i}},writeBase64:function(n){window.atob?o(window.atob(n)):a(ti.decode(n))},base64:function(){return ti.encode(l())}}}function ir(n){for(var r=[],i=0,f=n.length,t,u;i<f;)t=n.charCodeAt(i++),t>=55296&&t<=56319&&i<f?(u=n.charCodeAt(i++),(u&64512)==56320?r.push(((t&1023)<<10)+(u&1023)+65536):(r.push(t),i--)):r.push(t);return r}function rr(n){return n.map(function(n){var t="";return n>65535&&(n-=65536,t+=String.fromCharCode(n>>>10&1023|55296),n=56320|n&1023),t+String.fromCharCode(n)}).join("")}function w(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function ft(n){return Object.keys(n).sort(function(n,t){return n-t}).map(parseFloat)}function ii(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 c(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)w(n,i)&&(t[i]=t.prototype[i]=n[i]);return t}function vr(){for(var t="",i=String(ui),n=0;n<i.length;++n)t+=String.fromCharCode(i.charCodeAt(n)- -17);return++ui,t}function fi(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=vr()+"+"+this.font.psName}function ei(n,t){var u=this,i=u.contents=r(n),e,o,s,f;if(i.readString(4)=="ttcf"){if(o=function(){i.offset(e);u.parse()},!t)throw new Error("Must specify a name for TTC files");for(i.readLong(),s=i.readLong(),f=0;f<s;++f)if(e=i.readLong(),i.saveExcursion(o),u.psName==t)return;throw new Error("Font "+t+" not found in collection");}else i.offset(0),u.parse()}function ot(){function n(){for(var i,r,e=arguments,f=0;f<arguments.length;++f)if(i=e[f],i===undefined)throw new Error("Cannot output undefined to PDF");else if(i instanceof ct)i.beforeRender(n),i.render(n);else if(ht(i))nu(i,n);else if(gr(i))tu(i,n);else if(typeof i=="number"){if(isNaN(i))throw new Error("Cannot output NaN to PDF");r=i.toFixed(7);r.indexOf(".")>=0&&(r=r.replace(/\.?0+$/,""));r=="-0"&&(r="0");t.writeString(r)}else/string|boolean/.test(typeof i)?t.writeString(String(i)):typeof i.get=="function"?t.write(i.get()):typeof i=="object"&&(i?n(new u(i)):t.writeString("null"))}var f=0,t=r();return n.writeData=function(n){t.write(n)},n.withIndent=function(t){++f;t(n);--f},n.indent=function(){n(i,ci("",f*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 pr(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 si(n){var r,i,t;if(typeof n!="function"&&(r=n,n=function(n,t){return n in r?r[n]:t}),i=n("paperSize",oi.a4),!i)return{};if(typeof i=="string"&&(i=oi[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 o(t,i){return n&&n[t]!=null?n[t]:i}var t=this,r=ot(),v=0,f=[],c,h,a;t.getOption=o;t.attach=function(n){return f.indexOf(n)<0&&(pr(n,++v),f.push(n)),n};t.pages=[];t.FONTS={};t.IMAGES={};t.GRAD_COL_FUNCTIONS={};t.GRAD_OPC_FUNCTIONS={};t.GRAD_COL={};t.GRAD_OPC={};c=t.attach(new fu);h=t.attach(new eu);c.setPages(h);a=t.attach(new u({Producer:new s(o("producer","Kendo UI PDF Generator")),Title:new s(o("title","")),Author:new s(o("author","")),Subject:new s(o("subject","")),Keywords:new s(o("keywords","")),Creator:new s(o("creator","Kendo UI PDF Generator")),CreationDate:o("date",new Date)}));t.addPage=function(n){var f=si(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 s=new l(ot(),null,!0),c={Contents:t.attach(s),Parent:h,MediaBox:[0,0,u[0],u[1]]},r=new yi(t,c);return r._content=s,h.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(r("%PDF-1.4",i,"%ÂÁÚÏÎ",i,i),n=0;n<f.length;++n)f[n].renderFull(r),r(i,i);for(t=r.offset(),r("xref",i,0," ",f.length+1,i),r("0000000000 65535 f ",i),n=0;n<f.length;++n)r(e(f[n]._offset,10)," 00000 n ",i);return r(i),r("trailer",i),r(new u({Size:f.length+1,Root:c,Info:a}),i,i),r("startxref",i,t,i),r("%%EOF",i),r.stream().offset(0)}}function wr(n,t){function r(){window.console&&(window.console.error?window.console.error("Cannot load URL: %s",n):window.console.log("Cannot load URL: %s",n));t(null)}var i=new XMLHttpRequest;i.open("GET",n,!0);et&&(i.responseType="arraybuffer");i.onload=function(){i.status==200||i.status==304?et?t(new Uint8Array(i.response)):t(new window.VBArray(i.responseBody).toArray()):r()};i.onerror=r;i.send(null)}function br(n,t){var i=tt[n];i?t(i):wr(n,function(i){if(i==null)throw new Error("Cannot load font from "+n);else{var r=new ei(i);tt[n]=r;t(r)}})}function hi(){y={}}function kr(n,t,i){function h(n){u.src=n;u.complete&&!yr.msie?c():(u.onload=c,u.onerror=s)}function s(){i(y[n]="TAINTED")}function c(){var v,f,p,k,w,l,b;if(t&&(t.width>=u.width||t.height>=u.height)&&(t=null),!t&&o&&/^image\/jpe?g$/i.test(o.type)){v=new FileReader;v.onload=function(){var t=new vi(r(new Uint8Array(this.result)));URL.revokeObjectURL(e);i(y[n]=t)};v.readAsArrayBuffer(o);return}t||(t={width:u.width,height:u.height});f=document.createElement("canvas");f.width=t.width;f.height=t.height;p=f.getContext("2d");p.drawImage(u,0,0,t.width,t.height);try{k=p.getImageData(0,0,t.width,t.height)}catch(nt){s();return}finally{e&&URL.revokeObjectURL(e)}for(var d=!1,a=r(),g=r(),h=k.data,c=0;c<h.length;)a.writeByte(h[c++]),a.writeByte(h[c++]),a.writeByte(h[c++]),w=h[c++],w<255&&(d=!0),g.writeByte(w);d?u=new su(t.width,t.height,a,g):(l=f.toDataURL("image/jpeg"),l=l.substr(l.indexOf(";base64,")+8),b=r(),b.writeBase64(l),u=new vi(b));i(y[n]=u)}var u=y[n],e,o,f;u?i(u):(u=new Image,/^data:/i.test(n)||(u.crossOrigin="Anonymous"),et&&!/^data:/i.test(n)?(f=new XMLHttpRequest,f.onload=function(){o=f.response;e=URL.createObjectURL(o);h(e)},f.onerror=s,f.open("GET",n,!0),f.responseType="blob",f.send()):h(n))}function dr(n){return function(t,i){function f(){--r==0&&i()}var r=t.length,u=r;if(r===0)return i();while(u-->0)n(t[u],f)}}function ci(n,t,i){while(n.length<t)n=i+n;return n}function e(n,t){return ci(String(n),t,"0")}function ut(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function gr(n){return n instanceof Date}function nu(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 tu(n,t){t("(D:",e(n.getUTCFullYear(),4),e(n.getUTCMonth()+1,2),e(n.getUTCDate(),2),e(n.getUTCHours(),2),e(n.getUTCMinutes(),2),e(n.getUTCSeconds(),2),"Z)")}function li(n){return n*(72/25.4)}function iu(n){return li(n*10)}function ru(n){return n*72}function p(n,t){var i,r;if(typeof n=="number")return n;if(typeof n=="string"&&(i=/^\s*([0-9.]+)\s*(mm|cm|in|pt)\s*$/.exec(n),i&&(r=parseFloat(i[1]),!isNaN(r))))return i[2]=="pt"?r:{mm:li,cm:iu,"in":ru}[i[2]](r);if(t!=null)return t;throw new Error("Can't parse unit: "+n);}function ct(){}function o(n,t,i){i||(i=ct);n.prototype=new i;for(var r in t)ut(t,r)&&(n.prototype[r]=t[r]);return n}function t(n){return ut(lt,n)?lt[n]:lt[n]=new ai(n)}function vi(n){var u,f,r,e,o,s,h,c,i;if(n.offset(0),o=n.readShort(),o!=65496)throw new Error("Invalid JPEG image");while(!n.eof()){if(s=n.readByte(),s!=255)throw new Error("Invalid JPEG image");if(h=n.readByte(),c=n.readShort(),ou.indexOf(h)>=0){e=n.readByte();f=n.readShort();u=n.readShort();r=n.readByte();break}n.skip(c-2)}if(r==null)throw new Error("Invalid JPEG image");i={Type:t("XObject"),Subtype:t("Image"),Width:u,Height:f,BitsPerComponent:e,Filter:t("DCTDecode")};switch(r){case 1:i.ColorSpace=t("DeviceGray");break;case 3:i.ColorSpace=t("DeviceRGB");break;case 4:i.ColorSpace=t("DeviceCMYK");i.Decode=[1,0,1,0,1,0,1,0]}this.asStream=function(){n.offset(0);var r=new l(n,i);return r._resourceName=t("I"+ ++v),r}}function su(n,i,r,u){this.asStream=function(f){var o=new l(u,{Type:t("XObject"),Subtype:t("Image"),Width:n,Height:i,BitsPerComponent:8,ColorSpace:t("DeviceGray")},!0),e=new l(r,{Type:t("XObject"),Subtype:t("Image"),Width:n,Height:i,BitsPerComponent:8,ColorSpace:t("DeviceRGB"),SMask:f.attach(o)},!0);return e._resourceName=t("I"+ ++v),e}}function g(n){return n.map(function(n){return ht(n)?g(n):typeof n=="number"?(Math.round(n*1e3)/1e3).toFixed(3):n}).join(" ")}function lu(n,t,i,r,f,e,o){var h=g([t,i,r,f,e,o]),s=n.GRAD_COL_FUNCTIONS[h];return s||(s=n.GRAD_COL_FUNCTIONS[h]=n.attach(new u({FunctionType:2,Domain:[0,1],Range:[0,1,0,1,0,1],N:1,C0:[t,i,r],C1:[f,e,o]}))),s}function au(n,t,i){var f=g([t,i]),r=n.GRAD_OPC_FUNCTIONS[f];return r||(r=n.GRAD_OPC_FUNCTIONS[f]=n.attach(new u({FunctionType:2,Domain:[0,1],Range:[0,1],N:1,C0:[t],C1:[i]}))),r}function vu(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(lu(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(au(n,r.a,u.a));return s.pop(),{hasAlpha:e,colors:a(c),opacities:e?a(h):null}}function yu(n,i,r,f,e,o){var s,h,c;return o||(c=[i].concat(f),r.forEach(function(n){c.push(n.offset,n.color.r,n.color.g,n.color.b)}),h=g(c),s=n.GRAD_COL[h]),s||(s=new u({Type:t("Shading"),ShadingType:i?3:2,ColorSpace:t("DeviceRGB"),Coords:f,Domain:[0,1],Function:e,Extend:[!0,!0]}),n.attach(s),s._resourceName="S"+ ++v,h&&(n.GRAD_COL[h]=s)),s}function pu(n,i,r,f,e,o){var s,h,c;return o||(c=[i].concat(f),r.forEach(function(n){c.push(n.offset,n.color.a)}),h=g(c),s=n.GRAD_OPC[h]),s||(s=new u({Type:t("ExtGState"),AIS:!1,CA:1,ca:1,SMask:{Type:t("Mask"),S:t("Luminosity"),G:n.attach(new l("/a0 gs /s0 sh",{Type:t("XObject"),Subtype:t("Form"),FormType:1,BBox:o?[o.left,o.top+o.height,o.left+o.width,o.top]:[0,1,1,0],Group:{Type:t("Group"),S:t("Transparency"),CS:t("DeviceGray"),I:!0},Resources:{ExtGState:{a0:{CA:1,ca:1}},Shading:{s0:{ColorSpace:t("DeviceGray"),Coords:f,Domain:[0,1],ShadingType:i?3:2,Function:e,Extend:[!0,!0]}}}}))}}),n.attach(s),s._resourceName="O"+ ++v,h&&(n.GRAD_OPC[h]=s)),s}function wu(n,t,i){var u=t.type=="radial",r=vu(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=yu(n,u,t.stops,f,r.colors,t.userSpace&&i),o=r.hasAlpha?pu(n,u,t.stops,f,r.opacities,t.userSpace&&i):null;return{hasAlpha:r.hasAlpha,shading:e,opacity:o}}function bu(n){return n.replace(/^\s*(['"])(.*)\1\s*$/,"$2")}function vt(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(bu)}):{fontSize:12,fontFamily:"sans-serif"}}function yt(n){function e(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=e(i[r]),t=f[u],t)break}else t=f[i.toLowerCase()];while(typeof t=="function")t=t();return t||(t="Times-Roman"),t}function a(n,t){n=n.toLowerCase();f[n]=function(){return f[t]};f[n+"|bold"]=function(){return f[t+"|bold"]};f[n+"|italic"]=function(){return f[t+"|italic"]};f[n+"|bold|italic"]=function(){return f[t+"|bold|italic"]}}function pi(n,t){if(arguments.length==1)for(var i in n)ut(n,i)&&pi(i,n[i]);else{n=n.toLowerCase();f[n]=t;switch(n){case"dejavu sans":f["sans-serif"]=t;break;case"dejavu sans|bold":f["sans-serif|bold"]=t;break;case"dejavu sans|italic":f["sans-serif|italic"]=t;break;case"dejavu sans|bold|italic":f["sans-serif|bold|italic"]=t;break;case"dejavu serif":f.serif=t;break;case"dejavu serif|bold":f["serif|bold"]=t;break;case"dejavu serif|italic":f["serif|italic"]=t;break;case"dejavu serif|bold|italic":f["serif|bold|italic"]=t;break;case"dejavu mono":f.monospace=t;break;case"dejavu mono|bold":f["monospace|bold"]=t;break;case"dejavu mono|italic":f["monospace|italic"]=t;break;case"dejavu mono|bold|italic":f["monospace|bold|italic"]=t}}}function ku(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 du(n){return n[0]===1&&n[1]===0&&n[2]===0&&n[3]===1&&n[4]===0&&n[5]===0}function wt(n,t){function i(n,t,i){return(i||(i=s),i.pdf&&i.pdf[n]!=null)?i.pdf[n]:t}function e(){function u(n){var f=n.options,t=wf(n),e=t.bbox,u,o,s,c,l;n=t.root;u=i("paperSize",i("paperSize","auto"),f);o=!1;u=="auto"&&(e?(s=e.getSize(),u=[s.width,s.height],o=!0,c=e.getOrigin(),t=new h.Group,t.transform(new k.Matrix(1,0,0,1,-c.x,-c.y)),t.append(n),n=t):u="A4");l=r.addPage({paperSize:u,margin:i("margin",i("margin"),f),addMargin:o,landscape:i("landscape",i("landscape",!1),f)});ki(n,l,r)}if(!(--o>0)){var r=new st({producer:i("producer"),title:i("title"),author:i("author"),subject:i("subject"),keywords:i("keywords"),creator:i("creator"),date:i("date")});c?n.children.forEach(u):u(n);t(r.render(),r)}}var f=[],r={},s=n.options,c=i("multiPage"),u=i("imgDPI"),o;u&&hi();n.traverse(function(n){kt({Image:function(n){var f=n.src(),t,i;u?(t=n.bbox().size,i=r[f],t={width:Math.ceil(t.width*u/72),height:Math.ceil(t.height*u/72)},i&&(t.width=Math.max(i.width,t.width),t.height=Math.max(i.height,t.height)),r[f]=t):r[f]=null},Text:function(n){var i=vt(n.options.font),t=yt(i);f.indexOf(t)<0&&f.push(t)}},n)});o=2;it(f,e);rt(r,e)}function bt(n,t){wt(n,function(n){t("data:application/pdf;base64,"+n.base64())})}function bi(n,t){wt(n,function(n){t(new window.Blob([n.get()],{type:"application/pdf"}))})}function rf(t,i,r,u){window.Blob&&!nr.safari?bi(t,function(t){n.saveAs({dataURI:t,fileName:i});u&&u(t)}):bt(t,function(t){n.saveAs({dataURI:t,fileName:i,proxyURL:r});u&&u(t)})}function kt(n,t){var i=n[t.nodeType];return i?i.call.apply(i,arguments):t}function ki(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);uf(n,t,i);ff(n,t,i);f&&(r=f.matrix(),t.transform(r.a,r.b,r.c,r.d,r.e,r.f));ef(n,t,i);kt({Path:sf,MultiPath:hf,Circle:cf,Arc:lf,Text:af,Image:yf,Group:vf,Rect:pf},n,t,i);t.restore();n.options._pdfDebug&&t.comment("END: "+n.options._pdfDebug)}function uf(n,t){var r=n.stroke&&n.stroke(),i,u,f,e,o,s;if(r){if(i=r.color,i){if(i=gt(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(gu[f],0);e=r.lineCap;e&&t.setLineCap(nf[e]);o=r.lineJoin;o&&t.setLineJoin(tf[o]);s=r.opacity;s!=null&&t.setStrokeOpacity(s)}}function ff(n,t){var r=n.fill&&n.fill(),i,u;if(r&&!(r instanceof h.Gradient)){if(i=r.color,i){if(i=gt(i),i==null)return;t.setFillColor(i.r,i.g,i.b);i.a!=1&&t.setFillOpacity(i.a)}u=r.opacity;u!=null&&t.setFillOpacity(u)}}function ef(n,t,i){var r=n.clip();r&&(dt(r,t,i),t.clip())}function b(n){return n&&(n instanceof h.Gradient||n.color&&!/^(none|transparent)$/i.test(n.color)&&(n.width==null||n.width>0)&&(n.opacity==null||n.opacity>0))}function di(n,t,i,r){var u=n.fill(),o,s,c,f;if(u instanceof h.Gradient){r?t.clipStroke():t.clip();o=u instanceof h.RadialGradient;o?(s={x:u.center().x,y:u.center().y,r:0},c={x:u.center().x,y:u.center().y,r:u.radius()}):(s={x:u.start().x,y:u.start().y},c={x:u.end().x,y:u.end().y});f=u.stops.elements().map(function(n){var t=n.offset(),i;return t=/%$/.test(t)?parseFloat(t)/100:parseFloat(t),i=gt(n.color()),i.a*=n.opacity(),{offset:t,color:i}});f.unshift(f[0]);f.push(f[f.length-1]);var v={userSpace:u.userSpace(),type:o?"radial":"linear",start:s,end:c,stops:f},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 nt(n,t,i){b(n.fill())&&b(n.stroke())?di(n,t,i,!0)||t.fillStroke():b(n.fill())?di(n,t,i,!1)||t.fill():b(n.stroke())?t.stroke():t.nop()}function of(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 dt(n,t,i){var s=n.segments,h,u,f,r,e,o;if(s.length!==0&&!of(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 sf(n,t,i){dt(n,t,i);nt(n,t,i)}function hf(n,t,i){for(var u=n.paths,r=0;r<u.length;++r)dt(u[r],t,i);nt(n,t,i)}function cf(n,t,i){var r=n.geometry();t.circle(r.center.x,r.center.y,r.radius);nt(n,t,i)}function lf(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);nt(n,t,i)}function af(n,t){var r=vt(n.options.font),u=n._position,i;n.fill()&&n.stroke()?i=pt.fillAndStroke:n.fill()?i=pt.fill:n.stroke()&&(i=pt.stroke);t.transform(1,0,0,-1,u.x,u.y+r.fontSize);t.beginText();t.setFont(yt(r),r.fontSize);t.setTextRenderingMode(i);t.showText(n.content(),n._pdfRect?n._pdfRect.width():null);t.endText()}function vf(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)ki(u[r],t,i)}function yf(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 pf(n,t,i){var r=n.geometry();t.rect(r.origin.x,r.origin.y,r.size.width,r.size.height);nt(n,t,i)}function gt(t){var i=n.parseColor(t,!0);return i?i.toRGB():null}function wf(n){function t(n){return e=!0,n}function u(n){return n.visible()&&n.opacity()>0&&(b(n.fill())||b(n.stroke()))}function o(n){for(var i,r=[],t=0;t<n.length;++t)i=s(n[t]),i!=null&&r.push(i);return r}function c(n,t){var f=i,e=r,u;n.transform()&&(r=r.multiplyCopy(n.transform().matrix()));u=n.clip();u&&(u=u.bbox(),u&&(u=u.bbox(r),i=i?k.Rect.intersect(i,u):u));try{return t()}finally{i=f;r=e}}function l(n){if(i==null)return!1;var t=n.rawBBox().bbox(r);return i&&t&&(t=k.Rect.intersect(t,i)),t}function s(i){return c(i,function(){if(!(i instanceof h.Group||i instanceof h.MultiPath)){var r=l(i);if(!r)return t(null);f=f?k.Rect.union(f,r):r}return kt({Path:function(n){return n.segments.length===0||!u(n)?t(null):n},MultiPath:function(n){if(!u(n))return t(null);var i=new h.MultiPath(n.options);return(i.paths=o(n.paths),i.paths.length===0)?t(null):i},Circle:function(n){return u(n)?n:t(null)},Arc:function(n){return u(n)?n:t(null)},Text:function(n){return!/\S/.test(n.content())||!u(n)?t(null):n},Image:function(n){return(n.visible()&&n.opacity()>0)?n:t(null)},Group:function(i){var r=new h.Group(i.options);return(r.children=o(i.children),r._pdfLink=i._pdfLink,i!==n&&r.children.length===0&&!i._pdfLink)?t(null):r},Rect:function(n){return u(n)?n:t(null)}},i)})}var i=!1,r=k.Matrix.unit(),f=null,e;do e=!1,n=s(n);while(n&&e);return{root:n,bbox:f}}function bf(n,t){var r=tr.createPromise();for(var i in t)i=="margin"&&n.options.pdf&&n.options.pdf._ignoreMargin||n.options.set("pdf."+i,t[i]);return bt(n,r.resolve),r}var tt,y,it,rt,ht,yi,f;window.kendo.pdf=window.kendo.pdf||{};var gi=n.support,nr=gi.browser,ni=n.pdf,h=n.drawing,tr=h.util,k=n.geometry,d=typeof Uint8Array!="undefined",ti=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}}}();ii.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 v=this,e=Object.keys(n).length,s=Math.pow(2,Math.floor(Math.log(e)/Math.LN2)),h=s*16,y=Math.floor(Math.log(s)/Math.LN2),p=e*16-h,t=r(),u,f,l,a;t.writeLong(this.scalerType);t.writeShort(e);t.writeShort(h);t.writeShort(y);t.writeShort(p);var b=e*16,i=t.offset()+b,c=null,o=r();for(u in n)if(w(n,u))for(f=n[u],t.writeString(u),t.writeLong(v.checksum(f)),t.writeLong(i),t.writeLong(f.length),o.write(f),u=="head"&&(c=i),i+=f.length;i%4;)o.writeByte(0),i++;return t.write(o.get()),l=this.checksum(t.get()),a=2981146554-l,t.offset(c+8),t.writeLong(a),t.get()},checksum:function(n){n=r(n);for(var t=0;!n.eof();)t+=n.readLong();return t&4294967295}};var ur=c({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 t=r();return t.writeLong(this.version),t.writeLong(this.revision),t.writeLong(0),t.writeLong(this.magicNumber),t.writeShort(this.flags),t.writeShort(this.unitsPerEm),t.write(this.created),t.write(this.modified),t.writeShort_(this.xMin),t.writeShort_(this.yMin),t.writeShort_(this.xMax),t.writeShort_(this.yMax),t.writeShort(this.macStyle),t.writeShort(this.lowestRecPPEM),t.writeShort_(this.fontDirectionHint),t.writeShort_(n),t.writeShort_(this.glyphDataFormat),t.get()}}),fr=c({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 i=r(),u=n[n.length-1]>65535,t=0;t<n.length;++t)u?i.writeLong(n[t]):i.writeShort(n[t]/2);return{format:u?1:0,table:i.get()}}}),er=c({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 t=r();return t.writeLong(this.version),t.writeShort_(this.ascent),t.writeShort_(this.descent),t.writeShort_(this.lineGap),t.writeShort(this.advanceWidthMax),t.writeShort_(this.minLeftSideBearing),t.writeShort_(this.minRightSideBearing),t.writeShort_(this.xMaxExtent),t.writeShort_(this.caretSlopeRise),t.writeShort_(this.caretSlopeRun),t.writeShort_(this.caretOffset),t.write([0,0,0,0,0,0,0,0]),t.writeShort_(this.metricDataFormat),t.writeShort(n.length),t.get()}}),or=c({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 t=r();return t.writeLong(this.version),t.writeShort(n.length),t.writeShort(this.maxPoints),t.writeShort(this.maxContours),t.writeShort(this.maxComponentPoints),t.writeShort(this.maxComponentContours),t.writeShort(this.maxZones),t.writeShort(this.maxTwilightPoints),t.writeShort(this.maxStorage),t.writeShort(this.maxFunctionDefs),t.writeShort(this.maxInstructionDefs),t.writeShort(this.maxStackElements),t.writeShort(this.maxSizeOfInstructions),t.writeShort(this.maxComponentElements),t.writeShort(this.maxComponentDepth),t.get()}}),sr=c({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,f=this,t=r(),i=0;i<n.length;++i)u=f.forGlyph(n[i]),t.writeShort(u.advance),t.writeShort_(u.lsb);return t.get()}}),hr=function(){function n(n){this.raw=n}function t(n){var r,s,t;for(this.raw=n,r=this.glyphIds=[],s=this.idOffsets=[];;){if(t=n.readShort(),s.push(n.offset()),r.push(n.readShort()),!(t&f))break;n.skip(t&i?4:2);t&o?n.skip(8):t&e?n.skip(4):t&u&&n.skip(2)}}n.prototype={compound:!1,render:function(){return this.raw.get()}};var i=1,u=8,f=32,e=64,o=128;return t.prototype={compound:!0,render:function(n){for(var f,u=this,i=r(this.raw.get()),t=0;t<this.glyphIds.length;++t)f=u.glyphIds[t],i.offset(u.idOffsets[t]),i.writeShort(n[f]);return i.get()}},c({parse:function(){this.cache={}},glyphFor:function(i){var e=this.cache,o,s;if(w(e,i))return e[i];if(o=this.file.loca,s=o.lengthOf(i),s===0)return e[i]=null;var c=this.rawData,l=this.offset+o.offsetOf(i),u=r(c.slice(l,s)),h=u.readShort_(),a=u.readShort_(),v=u.readShort_(),y=u.readShort_(),p=u.readShort_(),f=e[i]=h==-1?new t(u):new n(u);return f.numberOfContours=h,f.xMin=a,f.yMin=v,f.xMax=y,f.yMax=p,f},render:function(n,t,i){for(var s,o,u=r(),f=[],e=0;e<t.length;++e)s=t[e],o=n[s],f.push(u.offset()),o&&u.write(o.render(i));return f.push(u.offset()),{table:u.get(),offsets:f}}})}(),cr=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 c({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(t){var l=this,e=this.strings,h=0,u,i,o,c,s,f;for(u in e)w(e,u)&&(h+=e[u].length);i=r();o=r();i.writeShort(0);i.writeShort(h);i.writeShort(6+12*h);for(u in e)if(w(e,u))for(c=u==6?[new n(t,l.postscriptEntry)]:e[u],s=0;s<c.length;++s)f=c[s],i.writeShort(f.platformID),i.writeShort(f.platformSpecificID),i.writeShort(f.languageID),i.writeShort(f.nameID),i.writeShort(f.length),i.writeShort(o.offset()),o.writeString(f.text);return i.write(o.get()),i.get()}})}(),lr=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 c({parse:function(n){var r=this,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;)r.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(t){var h=this,u,e,f,i;if(this.format==196608)return this.raw();for(u=r(this.rawData.slice(this.offset,32)),u.writeLong(131072),u.offset(32),e=[],f=[],i=0;i<t.length;++i){var c=t[i],o=h.glyphFor(c),s=n.indexOf(o);s>=0?e.push(s):(e.push(n.length+f.length),f.push(o))}for(u.writeShort(t.length),i=0;i<e.length;++i)u.writeShort(e[i]);for(i=0;i<f.length;++i)u.writeByte(f[i].length),u.writeString(f[i]);return u.get()}})}(),ri=function(){function n(n,t,i){var r=this;r.platformID=n.readShort();r.platformSpecificID=n.readShort();r.offset=t+n.readLong();n.saveExcursion(function(){var u,t,f,s,o,l,e,a,v,y,p,w;n.offset(r.offset);r.format=n.readShort();switch(r.format){case 0:for(r.length=n.readShort(),r.language=n.readShort(),t=0;t<256;++t)i[t]=n.readByte();break;case 4:r.length=n.readShort();r.language=n.readShort();f=n.readShort()/2;n.skip(6);s=n.times(f,n.readShort);n.skip(2);var b=n.times(f,n.readShort),h=n.times(f,n.readShort_),c=n.times(f,n.readShort),k=(r.length+r.offset-n.offset())/2,d=n.times(k,n.readShort);for(t=0;t<f;++t)for(o=b[t],l=s[t],u=o;u<=l;++u)c[t]===0?e=u+h[t]:(a=c[t]/2-(f-t)+(u-o),e=d[a]||0,e!==0&&(e+=h[t])),i[u]=e&65535;break;case 6:for(r.length=n.readShort(),r.language=n.readShort(),u=n.readShort(),v=n.readShort();v-->0;)i[u++]=n.readShort();break;case 12:for(n.readShort(),r.length=n.readLong(),r.language=n.readLong(),y=n.readLong();y-->0;)for(u=n.readLong(),p=n.readLong(),w=n.readLong();u<=p;)i[u++]=w++;break;default:window.console&&window.console.error("Unhandled CMAP format: "+r.format)}})}function t(n,t){function p(i){return t[n[i]]}for(var e,tt,b,y,i,k=ft(n),o=[],s=[],f=null,d=null,u=0;u<k.length;++u){var c=k[u],it=p(c),g=it-c;(f==null||g!==d)&&(f&&s.push(f),o.push(c),d=g);f=c}f&&s.push(f);s.push(65535);o.push(65535);var h=o.length,nt=h*2,w=2*Math.pow(2,Math.floor(Math.log(h)/Math.LN2)),rt=Math.log(w/2)/Math.LN2,ut=nt-w,l=[],a=[],v=[];for(u=0;u<h;++u){if(e=o[u],tt=s[u],e==65535){l.push(0);a.push(0);break}if(b=p(e),e-b>=32768)for(l.push(0),a.push(2*(v.length+h-u)),y=e;y<=tt;++y)v.push(p(y));else l.push(b-e),a.push(0)}return i=r(),i.writeShort(3),i.writeShort(1),i.writeLong(12),i.writeShort(4),i.writeShort(16+h*8+v.length*2),i.writeShort(0),i.writeShort(nt),i.writeShort(w),i.writeShort(rt),i.writeShort(ut),s.forEach(i.writeShort),i.writeShort(0),o.forEach(i.writeShort),l.forEach(i.writeShort_),a.forEach(i.writeShort),v.forEach(i.writeShort),i.get()}return c({parse:function(t){var i=this,r=i.offset,u;t.offset(r);i.codeMap={};i.version=t.readShort();u=t.readShort();i.tables=t.times(u,function(){return new n(t,r,i.codeMap)})},render:function(n,i){var u=r();return u.writeShort(0),u.writeShort(1),u.write(t(n,i)),u.get()}})}(),ar=c({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()}}),ui=1e5;fi.prototype={use:function(n){var t=this,i,r,u;return typeof n=="string"?ir(n).reduce(function(n,i){return n+String.fromCharCode(t.use(i))},""):(i=t.unicodes[n],i||(i=t.next++,t.subset[i]=n,t.unicodes[n]=i,r=t.font.cmap.codeMap[n],r&&(t.ncid2ogid[i]=r,t.ogid2ngid[r]==null&&(u=t.nextGid++,t.ogid2ngid[r]=u,t.ngid2ogid[u]=r))),i)},encodeText:function(n){return this.use(n)},glyphIds:function(){return ft(this.ogid2ngid)},glyphsFor:function(n,t){var f=this,i,r,u;for(t||(t={}),i=0;i<n.length;++i)r=n[i],t[r]||(u=t[r]=f.font.glyf.glyphFor(r),u&&u.compound&&f.glyphsFor(u.glyphIds,t));return t},render:function(){var r=this,u=this.glyphsFor(this.glyphIds()),t,f,s;for(t in u)w(u,t)&&(t=parseInt(t,10),r.ogid2ngid[t]==null&&(f=r.nextGid++,r.ogid2ngid[t]=f,r.ngid2ogid[f]=t));var h=ft(this.ngid2ogid),i=h.map(function(n){return this.ngid2ogid[n]},this),n=this.font,e=n.glyf.render(u,i,this.ogid2ngid),o=n.loca.render(e.offsets);return this.lastChar=this.next-1,s={cmap:ri.render(this.ncid2ogid,this.ogid2ngid),glyf:e.table,loca:o.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(o.format),"OS/2":n.os2.render()},this.font.directory.render(s)},cidToGidMap:function(){for(var u,e,f=this,n=r(),i=0,t=this.firstChar;t<this.next;++t){while(i<t)n.writeShort(0),i++;u=f.ncid2ogid[t];u?(e=f.ogid2ngid[u],n.writeShort(e)):n.writeShort(0);i++}return n.get()}};ei.prototype={parse:function(){var n=this.directory=new ii(this.contents);this.head=n.readTable("head",ur);this.loca=n.readTable("loca",fr);this.hhea=n.readTable("hhea",er);this.maxp=n.readTable("maxp",or);this.hmtx=n.readTable("hmtx",sr);this.glyf=n.readTable("glyf",hr);this.name=n.readTable("name",cr);this.post=n.readTable("post",lr);this.cmap=n.readTable("cmap",ri);this.os2=n.readTable("OS/2",ar);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 fi(this)}};var yr=n.support.browser,et=typeof Uint8Array!="undefined",i="\n",v=0,oi={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]};tt={"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};y={};it=dr(br);rt=function(n,t){function u(){--r==0&&t()}var i=Object.keys(n),r=i.length;if(r===0)return t();i.forEach(function(t){kr(t,n[t],u)})};st.prototype={loadFonts:it,loadImages:rt,getFont:function(n){var t=this.FONTS[n];if(!t){if(t=tt[n],!t)throw new Error("Font "+n+" has not been loaded");t=t===!0?this.attach(new hu(n)):this.attach(new at(this,t));this.FONTS[n]=t}return t},getImage:function(n){var t=this.IMAGES[n];if(!t){if(t=y[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 f=parseFloat(n).toFixed(3),o,r,e;return n=parseFloat(f),f+=i?"S":"F",o=this._opacityGSCache||(this._opacityGSCache={}),r=o[f],r||(e={Type:t("ExtGState")},i?e.CA=n:e.ca=n,r=this.attach(new u(e)),r._resourceName=t("GS"+ ++v),o[f]=r),r},dict:function(n){return new u(n)},name:function(n){return t(n)},stream:function(n,t){return new l(t,n)}};ht=Array.isArray||function(n){return n instanceof Array};ct.prototype.beforeRender=function(){};var s=o(function(n){this.value=n},{render:function(n){for(var i="",r=this.value,t=0;t<r.length;++t)i+=String.fromCharCode(r.charCodeAt(t)&255);n("(",i.replace(/([\(\)\\])/g,"\\$1"),")")},toString:function(){return this.value}}),uu=o(function(n){this.value=n},{render:function(n){var i=this,t;for(n("<"),t=0;t<this.value.length;++t)n(e(i.value.charCodeAt(t).toString(16),4));n(">")}},s),ai=o(function(n){this.name=n},{render:function(n){n("/"+this.escape())},escape:function(){return this.name.replace(/[^\x21-\x7E]/g,function(n){return"#"+e(n.charCodeAt(0).toString(16),2)})},toString:function(){return this.name}}),lt={};ai.get=t;var u=o(function(n){this.props=n},{render:function(n){var i=this.props,r=!0;n("<<");n.withIndent(function(){for(var u in i)ut(i,u)&&!/^_/.test(u)&&(r=!1,n.indent(t(u)," ",i[u]))});r||n.indent();n(">>")}}),l=o(function(n,t,i){if(typeof n=="string"){var u=r();u.write(n);n=u}this.data=n;this.props=t||{};this.compress=i},{render:function(n){var f=this.data.get(),r=this.props;this.compress&&ni.supportsDeflate()&&(r.Filter?r.Filter instanceof Array||(r.Filter=[r.Filter]):r.Filter=[],r.Filter.unshift(t("FlateDecode")),f=ni.deflate(f));r.Length=f.length;n(new u(r)," stream",i);n.writeData(f);n(i,"endstream")}}),fu=o(function(n){n=this.props=n||{};n.Type=t("Catalog")},{setPages:function(n){this.props.Pages=n}},u),eu=o(function(){this.props={Type:t("Pages"),Kids:[],Count:0}},{addPage:function(n){this.props.Kids.push(n);this.props.Count++}},u),ou=[192,193,194,195,197,198,199,201,202,203,205,206,207];var hu=o(function(n){this.props={Type:t("Font"),Subtype:t("Type1"),BaseFont:t(n)};this._resourceName=t("F"+ ++v)},{encodeText:function(n){return new s(String(n))}},u),at=o(function(n,i,r){var f,u;r=this.props=r||{};r.Type=t("Font");r.Subtype=t("Type0");r.Encoding=t("Identity-H");this._pdf=n;this._font=i;this._sub=i.makeSubset();this._resourceName=t("F"+ ++v);f=i.head;this.name=i.psName;u=this.scale=i.scale;this.bbox=[f.xMin*u,f.yMin*u,f.xMax*u,f.yMax*u];this.italicAngle=i.post.italicAngle;this.ascent=i.ascent*u;this.descent=i.descent*u;this.lineGap=i.lineGap*u;this.capHeight=i.os2.capHeight||this.ascent;this.xHeight=i.os2.xHeight||0;this.stemV=0;this.familyClass=(i.os2.familyClass||0)>>8;this.isSerif=this.familyClass>=1&&this.familyClass<=7;this.isScript=this.familyClass==10;this.flags=(i.post.isFixedPitch?1:0)|(this.isSerif?2:0)|(this.isScript?8:0)|(this.italicAngle!==0?64:0)|32},{encodeText:function(n){return new uu(this._sub.encodeText(String(n)))},getTextWidth:function(n,t){for(var u,f=this,r=0,e=this._font.cmap.codeMap,i=0;i<t.length;++i)u=e[t.charCodeAt(i)],r+=f._font.widthOfGlyph(u||0);return r*n/1e3},beforeRender:function(){var n=this,i=n._sub,c=i.render(),w=new l(r(c),{Length1:c.length},!0),b=n._pdf.attach(new u({Type:t("FontDescriptor"),FontName:t(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=i.ncid2ogid,e=i.firstChar,o=i.lastChar,a=[],y,f,p,h;(function v(t,i){if(t<=o){var r=k[t];r==null?v(t+1):(i||a.push(t,i=[]),i.push(n._font.widthOfGlyph(r)),v(t+1,i))}})(e);y=new u({Type:t("Font"),Subtype:t("CIDFontType2"),BaseFont:t(n._sub.psName),CIDSystemInfo:new u({Registry:new s("Adobe"),Ordering:new s("Identity"),Supplement:0}),FontDescriptor:b,FirstChar:e,LastChar:o,DW:Math.round(n._font.widthOfGlyph(0)),W:a,CIDToGIDMap:n._pdf.attach(n._makeCidToGidMap())});f=n.props;f.BaseFont=t(n._sub.psName);f.DescendantFonts=[n._pdf.attach(y)];p=new cu(e,o,i.subset);h=new l(ot(),null,!0);h.data(p);f.ToUnicode=n._pdf.attach(h)},_makeCidToGidMap:function(){return new l(r(this._sub.cidToGidMap()),null,!0)}},u),cu=o(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 f,u,r,i=t.firstChar;i<=t.lastChar;++i){for(f=t.map[i],u=rr([f]),n.indent("<",e(i.toString(16),4),">","<"),r=0;r<u.length;++r)n(e(u.charCodeAt(r).toString(16),4));n(">")}});n.indent("endbfchar");n.indent("endcmap");n.indent("CMapName currentdict /CMap defineresource pop");n.indent("end");n.indent("end")}});yi=o(function(n,i){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=[];i=this.props=i||{};i.Type=t("Page");i.ProcSet=[t("PDF"),t("Text"),t("ImageB"),t("ImageC"),t("ImageI")];i.Resources=new u({Font:new u(this._fontResources),ExtGState:new u(this._gsResources),XObject:new u(this._xResources),Pattern:new u(this._patResources),Shading:new u(this._shResources)});i.Annots=this._annotations},{_out:function(){this._content.data.apply(null,arguments)},transform:function(n,t,r,u,f,e){du(arguments)||(this._matrix=ku(arguments,this._matrix),this._out(n," ",t," ",r," ",u," ",f," ",e," cm"),this._out(i))},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",i)},endText:function(){this._textMode=!1;this._out("ET",i)},_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 at||(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",i)},setTextLeading:function(n){this._requireTextMode();this._out(n," TL",i)},setTextRenderingMode:function(n){this._requireTextMode();this._out(n," Tr",i)},showText:function(n,t){if(this._requireFont(),n.length>1&&t&&this._font instanceof at){var r=this._font.getTextWidth(this._fontSize,n),u=t/r*100;this._out(u," Tz ")}this._out(this._font.encodeText(n)," Tj",i)},showTextNL:function(n){this._requireFont();this._out(this._font.encodeText(n)," '",i)},addLink:function(n,i){var r=this._toPage({x:i.left,y:i.bottom}),f=this._toPage({x:i.right,y:i.top});this._annotations.push(new u({Type:t("Annot"),Subtype:t("Link"),Rect:[r.x,r.y,f.x,f.y],Border:[0,0,0],A:new u({Type:t("Action"),S:t("URI"),URI:new s(n)})}))},setStrokeColor:function(n,t,r){this._out(n," ",t," ",r," RG",i)},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",i)}},setFillColor:function(n,t,r){this._out(n," ",t," ",r," rg",i)},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",i)}},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 r=wu(this._pdf,n,t),f=r.shading._resourceName,u;this._shResources[f]=r.shading;r.hasAlpha&&(u=r.opacity._resourceName,this._gsResources[u]=r.opacity,this._out("/"+u+" gs "));this._out("/"+f+" sh",i);this.restore()},setDashPattern:function(n,t){this._out(n," ",t," d",i)},setLineWidth:function(n){this._out(n," w",i)},setLineCap:function(n){this._out(n," J",i)},setLineJoin:function(n){this._out(n," j",i)},setMitterLimit:function(n){this._out(n," M",i)},save:function(){this._contextStack.push(this._context());this._out("q",i)},restore:function(){this._out("Q",i);this._context(this._contextStack.pop())},moveTo:function(n,t){this._out(n," ",t," m",i)},lineTo:function(n,t){this._out(n," ",t," l",i)},bezier:function(n,t,r,u,f,e){this._out(n," ",t," ",r," ",u," ",f," ",e," c",i)},bezier1:function(n,t,r,u){this._out(n," ",t," ",r," ",u," y",i)},bezier2:function(n,t,r,u){this._out(n," ",t," ",r," ",u," v",i)},close:function(){this._out("h",i)},rect:function(n,t,r,u){this._out(n," ",t," ",r," ",u," re",i)},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",i)},nop:function(){this._out("n",i)},clip:function(){this._out("W n",i)},clipStroke:function(){this._out("W S",i)},closeStroke:function(){this._out("s",i)},fill:function(){this._out("f",i)},fillStroke:function(){this._out("B",i)},drawImage:function(n){var t=this._pdf.getImage(n);t&&(this._xResources[t._resourceName]=t,this._out(t._resourceName," Do",i))},comment:function(n){var t=this;n.split(/\r?\n/g).forEach(function(n){t._out("% ",n,i)})},_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}}},u);f={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");var wi={fill:0,stroke:1,fillAndStroke:2,invisible:3,fillAndClip:4,strokeAndClip:5,fillStrokeClip:6,clip:7},pt=wi,gu={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:[]},nf={butt:0,round:1,square:2},tf={miter:0,round:1,bevel:2};n.deepExtend(n.pdf,{Document:st,BinaryStream:r,defineFont:pi,parseFontDef:vt,getFontURL:yt,loadFonts:it,loadImages:rt,getPaperOptions:si,clearImageCache:hi,TEXT_RENDERING_MODE:wi,exportPDF:bf,saveAs:rf,toDataURL:bt,toBlob:bi,render:wt});n.drawing.exportPDF=n.pdf.exportPDF;n.drawing.pdf=n.pdf}(kendo),kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("pdf/mixins",["pdf/core"],n)}(function(){return function(n){kendo.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 v."+kendo.version,date:null},saveAsPDF:function(){var i=new n.Deferred,r=i.promise(),u={promise:r},t;if(!this.trigger("pdfExport",u))return t=this.options.pdf,t.multiPage=t.multiPage||t.allPages,this._drawPDF(i).then(function(n){return kendo.drawing.exportPDF(n,t)}).done(function(n){kendo.saveAs({dataURI:n,fileName:t.fileName,proxyURL:t.proxyURL,forceProxy:t.forceProxy,proxyTarget:t.proxyTarget});i.resolve()}).fail(function(n){i.reject(n)}),r},_drawPDF:function(t){var i=new n.Deferred;return kendo.drawing.drawDOM(this.wrapper).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},_drawPDFShadow:function(t,i){var f,u,r;return t=t||{},f=this.wrapper,u=n("<div class='k-pdf-export-shadow'>"),t.width&&u.css({width:t.width,overflow:"visible"}),f.before(u),u.append(t.content||f.clone(!0,!0)),r=n.Deferred(),setTimeout(function(){var n=kendo.drawing.drawDOM(u,i);n.always(function(){u.remove()}).then(function(){r.resolve.apply(r,arguments)}).fail(function(){r.reject.apply(r,arguments)}).progress(function(){r.progress.apply(r,arguments)})},15),r.promise()}}}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.pdf",["kendo.core","kendo.drawing","pdf/core","pdf/mixins"],n)}(function(){},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.grid",["kendo.data","kendo.columnsorter","kendo.editable","kendo.window","kendo.filtermenu","kendo.columnmenu","kendo.groupable","kendo.pager","kendo.selectable","kendo.sortable","kendo.reorderable","kendo.resizable","kendo.mobile.actionsheet","kendo.mobile.pane","kendo.ooxml","kendo.excel","kendo.progressbar","kendo.pdf"],n)}(function(){return function(n,t){function ru(n,t){return"["+i.attr(n)+"="+t+"]"}function nr(n){return new Array(n+1).join('<td class="k-group-cell">&nbsp;<\/td>')}function gt(n){var t,i=" ";if(n){if(typeof n===p)return n;for(t in n)i+=t+'="'+n[t]+'"'}return i}function df(t,i){n("th, th .k-grid-filter, th .k-link",t).add(document.body).css("cursor",i)}function bt(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 rt(t,i,r){return n(t).add(i).find(r)}function oo(n,t,i){var f,s,u,o;for(i=kt(i)?i:[i],f=0,s=i.length;f<s;f++)if(u=i[f],a(u)&&u.click){o=u.name||u.text;t.on(v+r,"a.k-grid-"+(o||"").replace(/\s/g,""),{commandName:o},e(u.click,n))}}function gf(n,t,r){return ei(n,function(n){var u,e;return n=typeof n===p?{field:n}:n,(!ut(n)||r)&&(n.attributes=ur(n.attributes),n.footerAttributes=ur(n.footerAttributes),n.headerAttributes=ur(n.headerAttributes),u=!0),n.columns&&(n.columns=gf(n.columns,t,u)),e=i.guid(),n.headerAttributes=f({id:e},n.headerAttributes),f({encoded:t,hidden:u},n)})}function uu(n,t){var i=[];return fu(n,t,i),i[i.length-1]}function fu(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]),fu(n,t[r].columns,i))return!0;i.splice(u,i.length-u)}}return!1}function ai(n,t){var i=t?vo:ur;n.hidden=!t;n.attributes=i(n.attributes);n.footerAttributes=i(n.footerAttributes);n.headerAttributes=i(n.headerAttributes)}function ni(){return this.style.display!=="none"}function ut(n){return k([n]).length>0}function k(n){return y(n,function(n){var t=!n.hidden;return t&&n.columns&&(t=k(n.columns).length>0),t})}function so(t){return n(t).map(function(){return this.toArray()})}function ho(n,t,i){var r=vi(s(t)),u=vi(vt(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 ne(t,i,r,u,f,e,o){var s=vi(t),h=vi([i]),c,l;s>h&&(c=new Array(o+1).join('<th class="k-group-cell k-header" scope="col">&nbsp;<\/th>'),l=e.children(":not(.k-filter-row)"),n(new Array(s-h+1).join("<tr>"+c+"<\/tr>")).insertAfter(l.last()));ao(e,s-h);ie(r,u,f,e)}function te(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=ti(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 vi(n){for(var r,i=0,t=0;t<n.length;t++)n[t].columns&&(r=vi(n[t].columns),r>i&&(i=r));return 1+i}function ie(t,i,r,u){for(var o=eu(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&&ie(e,i,r,u)}function ti(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=ti(n,t[u].columns,i+1,r),f))break;r[i]++}return f}function co(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 re(n,t,i,r){var e,f,u,o;return t.columns?(t=t.columns,t[r?0:t.length-1]):(e=uu(t,n),f=e?e.columns:n,u=c(t,f),u===0&&r?u++:u!=f.length-1||r?(u>0||u===0&&!r)&&(u+=r?-1:1):u--,o=c(i,f),t=co(f,u,i,o>u),t&&t!=i&&t.columns)?re(n,t,i,r):null}function eu(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=eu(n,t[u].columns,i+1,r),f))break;t[u].hidden||r[i]++}return f}function tr(n){var t=tt(s(n));return t.concat(tt(vt(n)))}function ir(n,t,i,r){var f=n[i],e=n[r],u=uu(f,t);return t=u?u.columns:t,c(e,t)}function tt(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(tt(r))),i}function ii(n){for(var i=0,t,r=0;r<n.length;r++)t=n[r],t.columns?i+=ii(t.columns):t.hidden&&i++;return i}function ue(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 lo(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 ao(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 ou(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 rr(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&&rr(e,t,i,r+1,u+n.length)}function s(n){return y(n,function(n){return n.locked})}function vt(n){return y(n,function(n){return!n.locked})}function fe(n){return y(n,function(n){return!n.locked&&ut(n)})}function su(n){return y(n,function(n){return n.locked&&ut(n)})}function ft(n){for(var i=[],t=0;t<n.length;t++)n[t].hidden||(n[t].columns?i=i.concat(ft(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 g(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 ee(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("data-colspan")?u[0].getAttribute("data-colspan"):1,e>=i&&e<r){f=ee(u).add(f);break}}return f}function yi(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(yi(u)),c=parseInt(u.attr(o),10),c>1&&(h-=c-1),r++}return e}function oe(t,i,r,u){var f,e=t;return u&&t.empty(),be?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 ur(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 vo(n){n=n||{};var t=n.style;return t&&(n.style=t.replace(/(display\s*:\s*none\s*;?)*/gi,"")),n}function ri(t,r,u,f){var e=t.find(">colgroup"),s,h=ei(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 yo(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 se(n){for(var r={},i,t=0,u=n.length;t<u;t++)i=n[t],r[i.value]=i.text;return r}function po(n,t,r,u){var e=r&&r.length&&a(r[0])&&"value"in r[0],f=e?se(r)[n]:n;return f=f!=null?f:"",t?i.format(t,f):u===!1?f:i.htmlEncode(f)}function yt(t,i,r){t=n(t).not(".dsi-expand-col");for(var f=0,e,u=t[f];u;){if(e=r?!0:u.style.display!=="none",e&&!io.test(u.className)&&--i<0){u.style.display=r?"":"none";break}u=t[++f]}}function he(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")),yt(u[0].cells,i,!1))}function hu(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(hu(t.items)))}return i}function ce(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(ce(t.items)));i.push(t.aggregates)}return i}function le(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),ri(r.find(">form>table"),k(o),!1,0),u=r.find("tr:first")),yt(u[0].cells,i,!0))}function ae(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 ve(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 wo(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],bf.test(i.className)&&(i=t.rows[t.rows.length-2]),f=r-u):(i=n.rows[n.rows.length-1],bf.test(i.className)&&(i=n.rows[n.rows.length-2]),f=u-r);i.style.height=i.offsetHeight+f+"px"}}function pi(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 cu(n,t){var r,u,i;if(typeof n===p&&n===t||a(n)&&n.name===t)return n;if(kt(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 b(t,r){if(r===!0){t=n(t);var u=t.parent().scrollLeft();i.focusElement(t);t.parent().scrollLeft(u)}else n(t).one("focusin",function(n){n.preventDefault()}).focus()}function lu(n,t){return!n.field||n.selectable?!1:t.editable&&!t.editable(n.field)?!1:n.editable&&!n.editable(t)?!1:!0}function ye(t){return n(t).is(":button,a,:input,a>.k-icon,textarea,span.k-select,span.k-icon,span.k-link,label.k-checkbox-label,.k-input,.k-multiselect-wrap,.k-picker-wrap,.k-picker-wrap>.k-selected-color,.k-tool-icon,.k-dropdown")}function pe(t){var u=n(t.currentTarget),e=u.is("th"),o=this.table.add(this.lockedTable),s=this.thead.parent().add(n(">table",this.lockedHeader)),h=ye(t.target),f=n(t.target),r=u.closest("table")[0];if(!i.support.touch){if(h&&u.find(i.roleSelector("filtercell")).length){this._setCurrent(u);return}(r===o[0]||r===o[1]||r===s[0]||r===s[1])&&(f.is("a.k-i-expand, a.k-i-collapse")||(this._editMode()==="incell"&&f.hasClass("k-checkbox-label")&&f.prev().attr(i.attr("bind"))&&t.preventDefault(),this.options.navigatable&&this._setCurrent(u),(e||!h)&&setTimeout(function(){eo&&n(i._activeElement()).hasClass("k-widget")||ye(i._activeElement())&&n.contains(r,i._activeElement())||b(r,!0)}),e&&t.preventDefault()))}}function bo(n){return n&&(n.hasClass("k-edit-cell")||n.parent().hasClass("k-grid-edit-row")||n.hasClass("k-grid-edit-row"))}function we(n,t,i){return'<tr role="row" class="k-grouping-row data-uid="'+t+"_"+CryptoJS.MD5(i)+'">'+nr(t)+'<td colspan="'+n+'" aria-expanded="true"><p class="k-reset"><a class="k-icon k-i-collapse" href="#" tabindex="-1" '+hi+'="'+tu+'"><\/a>'+i+"<\/p><\/td><\/tr>"}function ko(t,i,r,u){var f=n(r).first();return u?(f.addClass("dsi-dupe-group-row"),f.find(".k-group-cell").remove(),f.prepend('<td aria-expanded="true" class="dsi-expand-col"><p class="k-reset"><a class="k-icon k-i-collapse" href="#" tabindex="-1"><\/a><\/p><\/td>')):(f.find(".k-group-cell").removeClass("k-group-cell"),f.addClass("dsi-dupe-single-row"),f.find(":not([role])").first().addClass("dsi-expand-col")),f.prop("outerHTML")}function go(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,et=i.ui,au=i.data.DataSource,vu=i.data.ObservableObject,be=i.support.tbodyInnerHtml,ot=i._activeElement,fi=et.Widget,it=i._outerWidth,st=i._outerHeight,h=i.keys,a=n.isPlainObject,f=n.extend,ei=n.map,y=n.grep,kt=n.isArray,c=n.inArray,yu=Array.prototype.push,e=n.proxy,fr=i.isFunction,pu=n.isEmptyObject,er=n.contains,nt=Math,or="progress",sr="error",l=":not(.k-group-cell):not(.k-hierarchy-cell):visible",wu="tbody>tr:not(.k-grouping-row):not(.k-group-footer) > td:not(.k-group-cell):not(.k-hierarchy-cell)",ht="tr:not(.k-footer-template):visible",ct=":not(.k-group-cell):not(.k-hierarchy-cell):visible",at="tr:not(.k-grouping-row):not(.k-detail-row):not(.k-footer-template):not(.k-group-footer):visible",bu=at+":first",ke=at+":last",ku=ht+":first>"+ct+":first",hr="th.k-header:not(.k-group-cell):not(.k-hierarchy-cell)",r=".kendoGrid",wi="edit",bi="beforeEdit",cr="save",lr="remove",ar="detailInit",du="filterMenuInit",gu="columnMenuInit",nf="filterMenuOpen",tf="columnMenuOpen",rf="cellClose",w="change",vr="columnHide",yr="columnShow",uf="saveChanges",pr="dataBound",ff="detailExpand",ef="detailCollapse",wr="itemchange",br="page",kr="paging",of="scroll",ki="sync",oi="k-state-focused",sf=":kendoFocusable",dt="k-state-selected",dr="k-checkbox",pt="input[data-role='checkbox']."+dr,hf="k-grid-norecords",di="columnResize",cf="columnReorder",lf="columnLock",af="columnUnlock",vf="navigate",v="click",gr="height",si="tabIndex",wt="function",p="string",yf="bottom",nu="container-for",pf="field",de="input",wf="incell",ge="inline",no="uid",tu="Collapse",iu="Expand",hi="aria-label",to=/(\}|\#)/gi,ci=/#/gi,gi="[\\x20\\t\\r\\n\\f]",io=new RegExp("(^|"+gi+")(k-group-cell|k-hierarchy-cell)("+gi+"|$)"),bf=new RegExp("(^|"+gi+")(k-filter-row)("+gi+"|$)"),ro='# if (iconClass) {#<a role="button" class="k-button k-button-icontext #=className#" #=attr# href="\\#"><span class="#=iconClass#"><\/span>#=text#<\/a># } else { #<a role="button" class="k-button k-button-icontext #=className#" #=attr# href="\\#">#=text#<\/a># } #',uo='# var checkboxGuid = kendo.guid(); #<input class="'+dr+'" data-role="checkbox" id="#= checkboxGuid #" aria-label="Select row" aria-checked="false" type="checkbox"><label for="#= checkboxGuid #" class="k-checkbox-label k-no-text">&\\#8203;<\/label>',fo=i.template('# var checkboxGuid = kendo.guid(); #<input class="'+dr+'" data-role="checkbox" aria-label="Select all rows" aria-checked="false" type="checkbox" id="#= checkboxGuid #"><label for="#= checkboxGuid #" class="k-checkbox-label k-no-text">##&\\#8203;##<\/label>')({}),lt=!1,o=i.support.browser,li=o.msie&&o.version==7,eo=o.msie&&o.version==8,kf=fi.extend({init:function(n,t){var i=this;fi.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(w,t._refreshHandler);t.dataSource=n;t.dataSource.bind(w,t._refreshHandler);t.dataSource.options.useRanges=!0},options:{name:"VirtualScrollable",itemHeight:n.noop,prefetch:!0,maxScrollHeight:25e4},events:[kr,br,of],destroy:function(){var n=this;fi.fn.destroy.call(n);n.dataSource.unbind(w,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(lt?"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,allowSelection:!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(n){if(!n.ctrlKey){var r=this.verticalScrollbar,u=r.scrollTop(),t=i.wheelDeltaY(n);!t||t>0&&u===0||t<0&&u+r[0].clientHeight==r[0].scrollHeight||(n.preventDefault(),this.verticalScrollbar.scrollTop(u+-t))}},_scroll:function(n){var t=this,u=!t.options.prefetch,i=n.currentTarget.scrollTop,s=t.dataSource,r=t.itemHeight,h=s.skip()||0,c=t._rangeStart||h,f=t.element.innerHeight(),e=!!(t._scrollbarTop&&t._scrollbarTop>i),o=nt.max(nt.floor(i/r),0),l=e?nt.ceil(f/r):nt.floor(f/r),a=nt.max(o+l,0);if(t._preventScroll){t._preventScroll=!1;return}t._scrollTop=i-c*r;t._scrollbarTop=i;t._scrolling=u;t._fetch(o,a,e)||(t.wrapper[0].scrollTop=t._scrollTop);t.trigger(of);u&&(t._scrollingTimeout&&clearTimeout(t._scrollingTimeout),t._scrollingTimeout=setTimeout(function(){t._scrolling=!1;t._page(t._rangeStart,t.dataSource.take())},100))},scrollToTop:function(){this._scrollTo(0)},scrollToBottom:function(){var n=this.verticalScrollbar;this._scrollTo(n[0].scrollHeight-n.height())},_scrollWrapperToTop:function(){this.wrapper.scrollTop(0)},_scrollWrapperToBottom:function(){this.wrapper.scrollTop(this.wrapper[0].scrollHeight)},_scrollTo:function(n){var t=this,i=t.verticalScrollbar;i.scrollTop()!==n&&(t._preventScroll=!0);t.wrapper.scrollTop(n);t._scrollTop=t.wrapper.scrollTop();i.scrollTop(n);t._scrollbarTop=i.scrollTop()},_isScrolledToTop:function(){return this.verticalScrollbar.scrollTop()===0},_isScrolledToBottom:function(){var n=this.verticalScrollbar,t=n.scrollTop();return t>0&&t>=parseInt(n[0].scrollHeight-n.height(),10)},itemIndex:function(n){var t=this._rangeStart||this.dataSource.skip()||0;return t+n},_isElementVisible:function(n){return this._isElementVisibleInWrapper(n)},_isElementVisibleInWrapper:function(t){var f=this,u=f.wrapper,i,r;return(t=n(t),t[0]&&er(u[0],t[0])&&(i=parseInt(t.position().top,10),r=t.outerHeight()/2,(i>=0||nt.abs(i)<=r)&&i+r<=u.height()))?!0:!1},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=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,s=f.dataSource,a=f.itemHeight,u=s.take(),e=f._rangeStart||s.skip()||0,h=nt.floor(t/u)*u,l=!1,v=.33,c=f.verticalScrollbar,y=o.webkit?1:0;return t<e?(l=!0,e=nt.max(0,i-u),f._scrollTop=c.scrollTop()-e*a,f._page(e,u)):i>=e+u&&!r?(l=!0,e=nt.min(t,s.total()-u),f._scrollTop=c.scrollTop()>=c[0].scrollHeight-c.height()-y?f.wrapper[0].scrollHeight-f.wrapper.height():a,f._page(e,u)):!f._fetching&&f.options.prefetch&&(t<h+u-u*v&&t>u&&s.prefetch(h-u,u,n.noop),i>h+u*v&&s.prefetch(h+u,u,n.noop)),l},fetching:function(){return this._fetching},_page:function(t,r,u){var f=this,o=!f.options.prefetch,e=f.dataSource;(u=fr(u)?u:n.noop,f.trigger(kr,{skip:t,take:r}))||(clearTimeout(f._timeout),f._fetching=!0,f._rangeStart=t,e.inRange(t,r)?(i.ui.progress(n(f.wrapper).parent(),!0),e.range(t,r,function(){i.ui.progress(n(f.wrapper).parent(),!1);u();f.trigger(br)})):(o||i.ui.progress(f.wrapper.parent(),!0),f._timeout=setTimeout(function(){f._scrolling||(o&&i.ui.progress(f.wrapper.parent(),!0),e.range(t,r,function(){i.ui.progress(f.wrapper.parent(),!1);u();f.trigger(br)}))},100)))},repaintScrollbar:function(n){var t=this,f="",r=t.options.maxScrollHeight,c=t.dataSource,l=i.support.kineticScrollNeeded?0:i.support.scrollbar(),e=t.wrapper[0],u,o,s,a=t._isScrolledToBottom(),h;for(s=t.itemHeight=t.options.itemHeight()||0,h=e.scrollWidth>e.offsetWidth?l:0,u=c.total()*s+h,o=0;o<nt.floor(u/r);o++)f+='<div style="width:1px;height:'+r+'px"><\/div>';u%r&&(f+='<div style="width:1px;height:'+u%r+'px"><\/div>');t.verticalScrollbar.html(f);a&&!t._isScrolledToBottom()&&t.scrollToBottom();typeof t._scrollTop=="undefined"||!n||(e.scrollTop=t._scrollTop)},refresh:function(n){var t=this,u=t.dataSource,f=t._rangeStart,r=(n||{}).action,e=t._isScrolledToBottom()||!r||r!==wr&&r!==lr&&r!==ki;i.ui.progress(t.wrapper.parent(),!1);clearTimeout(t._timeout);t.repaintScrollbar(e);t.drag&&t.drag.cancel();typeof f=="undefined"||t._fetching||(r&&(r===ki||r===wr)||(t._rangeStart=u.skip()),u.page()!==1||r&&(r===ki||r===wr)||(t.verticalScrollbar[0].scrollTop=0));t._fetching=!1}}),d={create:{text:"Add new record",className:"k-grid-add"},cancel:{text:"Cancel changes",className:"k-grid-cancel-changes"},save:{text:"Save changes",className:"k-grid-save-changes"},destroy:{text:"Delete",className:"k-grid-delete"},edit:{text:"Edit",className:"k-grid-edit"},update:{text:"Update",className:"k-primary k-grid-update"},canceledit:{text:"Cancel",className:"k-grid-cancel"},excel:{text:"Export to Excel",className:"k-grid-excel"},pdf:{text:"Export to PDF",className:"k-grid-pdf"}},ui=i.ui.DataBoundWidget.extend({init:function(t,u,f){var e=this;if(u=kt(u)?{dataSource:u}:u,fi.fn.init.call(e,t,u),f&&(e._events=f),lt=i.support.isRtl(t),e._element(),e._aria(),e._columns(n.extend(!0,[],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:[w,"dataBinding","cancel",pr,ff,ef,ar,du,nf,gu,tf,wi,bi,cr,lr,uf,rf,di,cf,yr,vr,lf,af,vf,"page","sort","filter","group","groupExpand","groupCollapse"],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,persistSelection:!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:d.create.text,cancel:d.cancel.text,save:d.save.text,destroy:d.destroy.text,edit:d.edit.text,update:d.update.text,canceledit:d.canceledit.text,excel:d.excel.text,pdf:d.pdf.text},noRecords:"No records available.",expandCollapseColumnHeader:""}},destroy:function(){var t=this,u;t._angularItems("cleanup");t._destroyColumnAttachments();fi.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.options.persistSelection===!0&&(t._selectedIds=null),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._destroyVirtualScrollable();t._destroyEditable();t.dataSource&&(t.dataSource.unbind(w,t._refreshHandler).unbind(or,t._progressHandler).unbind(sr,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.lockedTable=t.lockedContent=t.lockedHeader=t.lockedFooter=t._groupableClickHandler=t._groupRows=t._setContentWidthHandler=null;t._current=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&&oo(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)));li&&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)),lt){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=g(i.closest("thead")).filter(":visible"),h=0;h<c.length;h++){if(c[h]==i[0])break;s+=c[h].offsetWidth}a>0&&(s+=it(t.find(".k-group-cell:first"))*a);e._hasDetails()&&(s+=it(t.find(".k-hierarchy-cell:first")))}u.css({top:i.position().top,left:s-l,height:st(i),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.lockedHeader?t.lockedHeader.find("thead:first"):n();t.thead.add(i).on("mousemove"+r,"th",function(i){var u=typeof i.buttons!="undefined"?i.buttons:i.which||i.button,r=n(this);r.hasClass("k-group-cell")||r.hasClass("k-hierarchy-cell")||r.hasClass("dsi-no-resize")||(typeof u=="undefined"||u===0)&&t._createResizeHandle(r.closest("div"),r)})},_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,v,h,p=this._isMobile,y=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,p?t._positionColumnResizeHandleTouch(c):t._positionColumnResizeHandle(c),t.resizable&&t.resizable.destroy(),t.resizable=new et.Resizable(c.add(t.lockedHeader),{handle:(!s.scrollable?">":"")+".k-resize-handle",hint:function(i){return n('<div class="k-grid-resize-indicator" />').css({height:st(i.data("th"))+t.tbody.attr("clientHeight")})},start:function(i){var w,c,y,b;r=n(i.currentTarget).data("th");p&&t._hideResizeHandle();w=r.closest("table");c=n.inArray(r[0],g(r.closest("thead")).filter(":visible"));f=w.parent().hasClass("k-grid-header-locked");y=f?t.lockedTable:t.table;b=t.footer||n();t.footer&&t.lockedContent&&(b=f?t.footer.children(".k-grid-footer-locked"):t.footer.children(".k-grid-footer-wrap"));df(t.wrapper,"col-resize");l=s.scrollable?w.find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+c+")").add(y.children("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+c+")")).add(b.find("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+c+")")):y.children("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+c+")");a=i.x.location;e=it(r);v=u(t.columns)[c].minResizableWidth||10;h=f?it(y.children("tbody")):it(t.tbody);o.webkit&&t.wrapper.addClass("k-grid-column-resizing")},resize:function(i){var p=lt?-1:1,c=e+i.x.location*p-a*p,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 k=r.closest("table"),d=f?t.lockedTable:t.table,b=!1,w=t.wrapper.width()-y,u=c;f&&h-e+u>w&&(u=e+(w-h-y*2),u<0&&(u=c),b=!0);u>10&&u>=v&&(l.css("width",u),h&&(u=b?w-y*2:h+i.x.location*p-a*p,d.add(k).add(o).css("width",u),f||(t._footerWidth=u)))}else c>10&&c>=v&&l.css("width",c)},resizeend:function(){var f=it(r),s,h,n;df(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(di,{column:s,oldWidth:e,newWidth:f}),t._applyLockedContainersWidth(),t._syncLockedContentHeight(),t._syncLockedHeaderHeight());t._hideResizeHandle();r=null}}))},_draggable:function(){var t=this,u;t.options.reorderable&&(t._draggableInstance&&t._draggableInstance.destroy(),u=t.wrapper.children(".k-grid-header"),t._draggableInstance=t.wrapper.kendoDraggable({group:i.guid(),autoScroll:!0,filter:t.content?".k-grid-header:first "+hr:"table:first>.k-grid-header "+hr,dragstart:function(){u.children(".k-grid-header-wrap").unbind("scroll"+r+"scrolling").bind("scroll"+r+"scrolling",function(n){t.virtualScrollable?t.content.find(">.k-virtual-scrollable-wrap").scrollLeft(this.scrollLeft):t.scrollables.not(n.currentTarget).scrollLeft(this.scrollLeft)})},dragend:function(){u.children(".k-grid-header-wrap").unbind("scroll"+r+"scrolling")},drag:function(){t._hideResizeHandle()},hint:function(t){var r=t.attr(i.attr("title"));return r&&(r=i.htmlEncode(r)),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(r||t.attr(i.attr("field"))||t.text()).prepend('<span class="k-icon k-drag-status k-i-cancel" />')}}).data("kendoDraggable"))},_reorderable:function(){var t=this;t.options.reorderable&&(t.wrapper.data("kendoReorderable")&&t.wrapper.data("kendoReorderable").destroy(),t.wrapper.kendoReorderable({draggable:t._draggableInstance,dragOverContainers:function(n,i){var r=tr(t.columns);return r[n].lockable!==!1&&ir(r,t.columns,n,i)>-1},inSameContainer:function(i){return n(i.source).parent()[0]===n(i.target).parent()[0]&&ir(tr(t.columns),t.columns,i.sourceIndex,i.targetIndex)>-1},change:function(n){var i=tr(t.columns),r=i[n.oldIndex],u=ir(i,t.columns,n.oldIndex,n.newIndex);t.trigger(cf,{newIndex:u,oldIndex:c(r,i),column:r});t.reorderColumn(u,r,n.position==="before")}}))},_reorderHeader:function(n,t,i){for(var r=this,f=ti(n[0],r.columns),h=ti(t,r.columns),u=[],e=0;e<n.length;e++)n[e].columns&&(u=u.concat(n[e].columns));var l=rt(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?ne(n,t,u,r.columns,r.lockedHeader.find("thead"),r.thead,this._groups()):o===0&&c>0&&ne(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=re(r.columns,t,n[0],i),t&&r._reorderHeader(u,t,i))):o!==c&&ho(l[f.cell],r.columns,o);bt(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=c(nt,u(f.columns)),l=c(i,u(f.columns)),w=c(nt,ft(f.columns)),a=c(i,ft(f.columns)),b=s(f.columns).length,it=!!i.locked,o=f.footer||f.wrapper.find(".k-grid-footer"),v,y,d,h,tt;for(v=y=a,i.hidden&&(it?(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()&&bt(f.wrapper.find(".k-filter-row th:not(.k-group-cell,.k-hierarchy-cell)"),e,l,r,t.length),bt(rt(f.lockedHeader,f.thead.prev(),"col:not(.k-group-col,.k-hierarchy-col)"),w,v,r,p.length),f.options.scrollable&&bt(rt(f.lockedTable,f.tbody.prev(),"col:not(.k-group-col,.k-hierarchy-col)"),w,a,r,p.length),o&&o.length&&(bt(rt(f.lockedFooter,o.find(".k-grid-footer-wrap"),">table>colgroup>col:not(.k-group-col,.k-hierarchy-col)"),w,y,r,p.length),bt(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&&ae(f.lockedTable.find(">tbody>tr.k-grouping-row"),f.table.find(">tbody>tr.k-grouping-row"),t.length):b>e&&ae(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)")),h=0,tt=d.length;h<tt;h+=1)bt(rt(g[h],d[h],">td:not(.k-group-cell,.k-hierarchy-cell,.dsi-expand-col)"),e,l,r,t.length)},_autoFitLeafColumn:function(n){this.autoFitColumn(u(this.columns)[n])},ds_autoFitColumns:function(n){for(var f,u,r=this,i=[],t=0;t<n.length;t++)f=new ds_autoFitColumn(r),f.initColumnData(n[t])&&i.push(f);for(i[0].tables.addClass("k-autofitting"),t=0;t<i.length;t++)i[t].autoFitColumn();for(u=i[0].tables,o.msie&&o.version==8&&(u.css("display","inline-table"),setTimeout(function(){u.css("display","table")},1)),u.removeClass("k-autofitting"),t=0;t<i.length;t++)i[t].triggerResize();r._applyLockedContainersWidth();r._syncLockedContentHeight();r._syncLockedHeaderHeight()},autoFitColumn:function(t){var i=this,e=i.options,s=i.columns,r,et,v,h,yt=i.lockedHeader?g(i.lockedHeader.find(">table>thead")).filter(ni).length:0,p,ot,st,k="col:not(.k-group-col):not(.k-hierarchy-col)",lt="td:visible:not(.k-group-cell):not(.k-hierarchy-cell)",l,ht,d,w,f,at,nt,ct,rt,b,ft,vt;if(t=typeof t=="number"?s[t]:a(t)?y(tt(s),function(n){return n===t})[0]:y(tt(s),function(n){return n.field===t})[0],t&&ut(t)){for(r=c(t,u(s)),h=t.locked,v=h?i.lockedHeader.children("table"):i.thead.parent(),et=v.find("[data-index='"+r+"']"),l=h?i.lockedTable:i.table,ht=i.footer||n(),i.footer&&i.lockedContent&&(ht=h?i.footer.children(".k-grid-footer-locked"):i.footer.children(".k-grid-footer-wrap")),d=ht.find("table").first(),i.lockedHeader&&!h&&(r-=yt),w=0;w<s.length;w++)if(s[w]===t)break;else s[w].hidden&&r--;if(e.scrollable?(p=v.find(k).eq(r).add(l.children("colgroup").find(k).eq(r)).add(d.find("colgroup").find(k).eq(r)),h||(ot=l.parent(),st=ot.scrollLeft())):p=l.children("colgroup").find(k).eq(r),f=v.add(l).add(d),at=it(et),p.width(""),f.css("table-layout","fixed"),p.width("auto"),f.addClass("k-autofitting"),f.css("table-layout",""),dsiCommon.isNullOrEmpty(e.ds_this)||dsiCommon.isNullOrEmpty(e.dataSource._group)||e.dataSource._group.length!=1||e.ds_this.detailSetGroupingID!=e.dataSource._group[0].field||r++,nt=Math.ceil(Math.max(it(et),it(l.find("tr:not(.k-grouping-row)").eq(0).children(lt).eq(r)),it(d.find("tr").eq(0).children(lt).eq(r))))+1,p.width(nt),t.width=nt,e.scrollable){for(ct=v.find("col"),b=0,ft=0,vt=ct.length;ft<vt;ft+=1)if(rt=ct[ft].style.width,rt&&rt.indexOf("%")==-1)b+=parseInt(rt,10);else{b=0;break}b&&f.each(function(){this.style.width=b+"px"})}o.msie&&o.version==8&&(f.css("display","inline-table"),setTimeout(function(){f.css("display","table")},1));f.removeClass("k-autofitting");st&&ot.scrollLeft(st);i.trigger(di,{column:t,oldWidth:at,newWidth:nt});i._applyLockedContainersWidth();i._syncLockedContentHeight();i._syncLockedHeaderHeight()}},setColumnWidth:function(t,i){var r=this,et=r.options,s=r.columns,f,ot,h,l,ct=r.lockedHeader?g(r.lockedHeader.find(">table>thead")).filter(ni).length:0,w,b="col:not(.k-group-col):not(.k-hierarchy-col)",k,it,rt,v,e,st,ft,d,p,nt,ht;if(t=typeof t=="number"?s[t]:a(t)?y(tt(s),function(n){return n===t})[0]:y(tt(s),function(n){return n.field===t})[0],t&&ut(t)){for(f=c(t,u(s)),l=t.locked,h=l?r.lockedHeader.children("table"):r.thead.parent(),ot=h.find("[data-index='"+f+"']"),k=l?r.lockedTable:r.table,it=r.footer||n(),r.footer&&r.lockedContent&&(it=l?r.footer.children(".k-grid-footer-locked"):r.footer.children(".k-grid-footer-wrap")),rt=it.find("table").first(),r.lockedHeader&&!l&&(f-=ct),v=0;v<s.length;v++)if(s[v]===t)break;else s[v].hidden&&f--;if(w=et.scrollable?h.find(b).eq(f).add(k.children("colgroup").find(b).eq(f)).add(rt.find("colgroup").find(b).eq(f)):k.children("colgroup").find(b).eq(f),e=h.add(k).add(rt),st=ot.outerWidth(),w.width(""),e.css("table-layout","fixed"),w.width("auto"),e.addClass("k-autofitting"),e.css("table-layout",""),w.width(i),t.width=i,et.scrollable){for(ft=h.find("col"),p=0,nt=0,ht=ft.length;nt<ht;nt+=1)if(d=ft[nt].style.width,d&&d.indexOf("%")==-1)p+=parseInt(d,10);else{p=0;break}p&&e.each(function(){this.style.width=p+"px"})}o.msie&&o.version==8&&(e.css("display","inline-table"),setTimeout(function(){e.css("display","table")},1));e.removeClass("k-autofitting");r.trigger(di,{column:t,oldWidth:st,newWidth:i});r._applyLockedContainersWidth();r._syncLockedContentHeight();r._syncLockedHeaderHeight()}},reorderColumn:function(n,i,r){var f=this,y=uu(i,f.columns),l=y?y.columns:f.columns,o=c(i,l),e=l[n],a,h=!!e.locked,p=s(f.columns).length,v;o!==n&&(i.locked||!h||vt(f.columns).length!=1)&&(!i.locked||h||p!=1)&&(f._hideResizeHandle(),r===t&&(r=n<o),v=[i],f._reorderHeader(v,e,r),f.lockedHeader&&(ou(f.thead),ou(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!=h,i.locked=h,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)&&(h?f.trigger(lf,{column:i}):f.trigger(af,{column:i}))},_updateColumnCellIndex:function(){var n,t=0;this.lockedHeader&&(n=this.lockedHeader.find("thead"),t=te(n,s(this.columns)));te(this.thead,vt(this.columns),t)},lockColumn:function(n){var t=this.columns,i;(n=typeof n=="number"?t[n]:y(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]:y(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,.dsi-expand-col)").index(t)+i},_modelForContainer:function(t){var r,u;return t=n(t),t.is("tr")||this._editMode()==="popup"||(r=t.closest("tr"),!dsiCommon.isNullOrEmpty(r)&&r.length>0&&(t=t.closest("tr"))),u=t.attr(i.attr("uid")),this.dataSource.getByUid(u)},_modelsForContainer:function(t){var f,r,u,e,o;if(t=n(t),t.is("tr")||this._editMode()==="popup"||(f=t.closest("tr"),!dsiCommon.isNullOrEmpty(f)&&f.length>0&&(t=t.closest("tr"))),t.length>1){for(r=[],u=0;u<t.length;u++)e=n(t[u]).attr(i.attr("uid")),dsiCommon.isNullOrEmpty(e)||r.push(this.dataSource.getByUid(e));if(r.length>0)return r}return o=t.attr(i.attr("uid")),this.dataSource.getByUid(o)},_editable:function(){var t=this,f=t.selectable&&t.selectable.options.multiple,i=t.options.editable,e=function(){var i=ot(),r=t._editContainer;!r||n.contains(r[0],i)||r[0]===i||n(i).closest(".k-animation-container").length||(t.editable.end()?t.closeCell():t._scrollVirtualWrapper())},u;if(i){if(this.wrapper.addClass("k-editable"),u=t._editMode(),u==="incell"){if(i.update!==!1)t.wrapper.on(v+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(ot()).blur(),t.closeCell(),t.editCell(r)):t._scrollVirtualWrapper():t.editCell(r))}).on("focusin"+r,function(){n.contains(this,ot())||(clearTimeout(t.timer),t.timer=null)}).on("focusout"+r,function(){t.timer=setTimeout(e,1)})}else if(i.update!==!1){t.wrapper.on(v+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(t._isVirtualInlineEditable())t.wrapper.on("focusout"+r,"tr:not(.k-grouping-row) > td",function(){t.editable&&!t.editable.end()&&t._scrollVirtualWrapper()})}if(i.destroy!==!1)t.wrapper.on(v+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(v+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,f=u(i.columns)[i.cellIndex(t)],r=i._modelForContainer(t);if(i.closeCell(),r&&lu(f,r)&&!f.command){if(i.trigger(bi,{model:r}))return;i._attachModelChange(r);i._editContainer=t;i._shouldClearEditableState&&i._clearEditableState();i.editable=t.addClass("k-edit-cell").kendoEditable({fields:{field:f.field,format:f.format,editor:f.editor,values:f.values},model:r,target:i,change:function(n){i.trigger(cr,{values:n.values,container:t,model:r})&&n.preventDefault()},skipFocus:i._isVirtualIncellEditable()&&i._editableState?!0:!1}).data("kendoEditable");e=t.parent().addClass("k-grid-edit-row");i.lockedContent&&pi(e[0],i._relatedRow(e).addClass("k-grid-edit-row")[0]);i.trigger(wi,{container:t,model:r})}},_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);wo(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(v+r,"a.k-grid-cancel",n._editCancelClickHandler),t.off(v+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(w,n._modelChangeHandler)},closeCell:function(n){var t=this,i=t._editContainer,e,r,f;i&&((f=t._modelForContainer(i),n&&t.trigger("cancel",{container:i,model:f}))||(t.trigger(rf,{type:n?"cancel":"save",model:f,container:i}),i.removeClass("k-edit-cell"),e=u(t.columns)[t.cellIndex(i)],r=i.parent().removeClass("k-grid-edit-row"),t.lockedContent&&t._relatedRow(r).removeClass("k-grid-edit-row"),t._destroyEditable(),t._displayCell(i,e,f),t._shouldClearEditableState&&t._clearEditableState(),t.trigger("itemChange",{item:r,data:f,ns:et}),t.lockedContent&&pi(r.css("height","")[0],t._relatedRow(r).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,f,e,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(lr,{row:t,model:r})?(i.options.persistSelection&&(f=i.dataSource.options.schema.model.id,e=r[f],delete i._selectedIds[e]),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(o,s){var h,c=this,b,nt,tt,k,a,p,rt,ot,st,w,d,g,y,et;if(o instanceof vu)h=o;else{if(o=n(o),h=c._modelsForContainer(o),dsiCommon.isNullOrEmpty(h))return;if(b=[],n.isArray(h))for(b=h,h=b[0],b.splice(0,1),a=0;a<b.length;a++)b[a].dsi={changedFields:[],modeOverride:s,allowBlank:!0,allowCurrentValue:!0,originalValues:{},resetValues:[],columnData:c.columns};h.dsi={submodels:b,changedFields:[],modeOverride:s,allowBlank:!0,allowCurrentValue:!0,originalValues:{},resetValues:[],columnData:c.columns,dsThis:c.options.ds_this}}if(nt=dsiCommon.isNullOrEmpty(s)?c._editMode():s,c.cancelRow(),h){if(o=c.tbody.children("["+i.attr("uid")+"="+h.uid+"]"),c._attachModelChange(h),!dsiCommon.isNullOrEmpty(h.dsi))for(a=0;a<h.dsi.submodels.length;a++)c._attachModelChange(h.dsi.submodels[a]);if(nt==="popup"){if(c._createPopupEditor(h),!dsiCommon.isNullOrEmpty(h.dsi))for(k=0;k<c.options.columns.length;k++)for(a=0;a<h.dsi.submodels.length;a++){if(p=c.options.columns[k].field,rt=!1,p===t){var ut=f({},i.Template,c.options.templateSettings),ft={storage:{},count:0},it=i.template(c._cellTmpl(c.options.columns[k],ft),ut);ft.count>0&&(it=e(it,ft.storage));ot=i.template(it,ut)(h);st=i.template(it,ut)(h.dsi.submodels[a]);rt=ot!=st}if(h[p]!=h.dsi.submodels[a][p]||rt){if(w=n("[name='"+p+"']")[0],w){for(h.dsi.originalValues[p]=h[p],d=0;d<h.dsi.submodels.length;d++)h.dsi.submodels[d].dsi.originalValues[p]=h.dsi.submodels[d][p];g=n(w).attr("data-role");y=null;g==="combobox"?(y=n(w).data("kendoComboBox"),y.value(dsiCommon.getTranslation("CURRENT_VALUE"))):g==="dropdownlist"?(y=n(w).data("kendoDropDownList"),y.options.dataSource.data!=t&&y.select(y.options.dataSource.data.length-1)):w.value=dsiCommon.getTranslation("CURRENT_VALUE");g==="datepicker"?y=n(w).data("kendoDatePicker"):g==="autocomplete"&&(y=n(w).data("kendoAutoComplete"));y&&(y._old=dsiCommon.getTranslation("CURRENT_VALUE"))}else et=n("[data-container-for='"+p+"']")[0],et&&(et.innerHTML=dsiCommon.getTranslation("CURRENT_VALUE"));break}}n(".k-edit-form-container .statusIcon").tooltip({html:!0,container:".k-window"})}else nt==="inline"?c._createInlineEditor(o,h):nt==="incell"&&n(o).children(l).each(function(){var t=n(this),i=u(c.columns)[c.cellIndex(t)];return h=c._modelForContainer(t),h&&(!h.editable||h.editable(i.field))&&i.field&&!i.selectable?(c.editCell(t),!1):void 0});if(tt=c.editView?c.editView.element:c._editContainer,tt){this._editCancelClickHandler||(this._editCancelClickHandler=e(this._editCancelClick,this));tt.on(v+r,"a.k-grid-cancel",this._editCancelClickHandler);this._editUpdateClickHandler||(this._editUpdateClickHandler=e(this._editUpdateClick,this));tt.on(v+r,"a.k-grid-update",this._editUpdateClickHandler)}}},_editUpdateClick:function(n){dsiCommon.isNullOrEmpty(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(ct).first()),b(i.table,!0)))},_createPopupEditor:function(r){function dt(){var t=n(".k-window").children("div.k-window-content").height(),i=n(".k-window").find(".dsi-dialog-toolbar").outerHeight(!0),r=n(".k-window").find(".dsi-dialog-content").outerHeight(!0)-o.element.parents(".k-window").find(".dsi-dialog-content").height();n(".k-window").find(".dsi-dialog-content, .k-edit-form-container").first().height(t-i-r)}var o=this,c="<div "+i.attr("uid")+'="'+r.uid+'" class="k-popup-edit-form'+(o._isMobile?" k-mobile-list":"")+'"><div><div class="k-edit-form-container">',h,l,bt=[],v,tt,it,at,vt,y,rt=o.columns.length>0&&!dsiCommon.isNullOrEmpty(o.columns[0].dsi)&&!dsiCommon.isNullOrEmpty(o.columns[0].dsi.columns)&&o.columns[0].dsi.columns.length>0?o.columns[0].dsi.columns:u(o.columns),d,yt=o.options.editable,g=yt.template,ut=a(yt)?yt.window:{},kt=f({},i.Template,o.options.templateSettings),ft,s,w,et,k,ot,ni,ti,pt,ht,wt,lt;if(!o.trigger(bi,{model:r})){if(ut=ut||{},g)for(typeof g===p&&(g=window.unescape(g)),c+=i.template(g,kt)(r),v=0,tt=rt.length;v<tt;v++)h=rt[v],h.command&&(y=cu(h.command,"edit"),y&&(l=y));else for(v=0,tt=rt.length;v<tt;v++)(h=rt[v],h.hidden!==!0)&&(h.command?h.command&&(y=cu(h.command,"edit"),y&&(l=y)):(c+='<div class="form-group dsi-alter-group"><div><label for="'+h.field+'">'+(h.title||h.field||"")+"<\/label><\/div>",lu(h,r)?(bt.push({field:h.field,format:h.format,editor:h.editor,values:h.values}),c+="<div "+i.attr("container-for")+'="'+h.field+'"><\/div>'):(ft={storage:{},count:0},it=i.template(o._cellTmpl(h,ft),kt),ft.count>0&&(it=e(it,ft.storage)),c+="<div "+i.attr("container-for")+'="'+h.field+'" class="dsi-lbl-noneditable">'+it(r)+"<\/div>"),c+="<\/div>"));l&&a(l)&&(l.text&&a(l.text)&&(at=l.text.update,vt=l.text.cancel),l.attr&&(d=l.attr));o._isMobile?(c+="<\/div><\/div>",o.editView=o.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">'+o._createButton({name:"update",text:at,attr:d})+(ut.title||"Edit")+o._createButton({name:"canceledit",text:vt,attr:d})+"<\/div>"+c+"<\/div>"),s=o._editContainer=o.editView.element.find(".k-popup-edit-form")):(c+='<\/div><div class="k-edit-buttons k-state-default dsi-edit-buttons dsi-dialog-toolbar">',c+=o._createButton({name:"update",text:at,attr:d})+o._createButton({name:"canceledit",text:vt,attr:d}),c+="<\/div><\/div><\/div>",s=o._editContainer=n(c).appendTo(o.wrapper).eq(0).kendoWindow(f({modal:!0,resizable:!0,draggable:!0,title:"Edit",visible:!1,close:function(t){if(t.userTriggered){if(t.sender.element.focus(),o.trigger("cancel",{container:s,model:r})){t.preventDefault();return}var i=o.items().index(n(o.current()).parent());o.cancelRow();o.options.navigatable&&(o._setCurrent(o.items().eq(i).children().filter(ct).first()),b(o.table,!0))}}},ut)));o.editable=o._editContainer.kendoEditable({fields:bt,model:r,clearContainer:!1,target:o}).data("kendoEditable");o._isMobile&&s.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()});o._openPopUpEditor();s.find(":input, a, .k-widget:not(.k-autocomplete)").filter(":visible").last().on("keydown",function(n){n.keyCode==9&&n.shiftKey==!1&&(n.preventDefault(),s.find(":input, a, .k-widget:not(.k-autocomplete)").filter(":visible").first().focus())});s.find(":input, a, .k-widget:not(.k-autocomplete)").filter(":visible").first().on("keydown",function(n){n.keyCode==9&&n.shiftKey==!0&&(n.preventDefault(),s.find(":input, a, .k-widget:not(.k-autocomplete)").filter(":visible").last().focus())});et=null;s.on("focusin",":input, a, .k-widget",function(){et=n(this)});s.on("focusout",function(){dsiCommon.isNullOrEmpty(w)||window.clearInterval(w);w=window.setInterval(function(){if(n("[data-uid='"+s.attr("data-uid")+"'].k-popup-edit-form").length==0){s.off("focusout");window.clearInterval(w);dsiCommon.writeToConsole("should exit focus - k-index");return}var t=s.find(document.activeElement);if((dsiCommon.isNullOrEmpty(t)||t.length===0)&&s[0]!=document.activeElement){if(!dsiCommon.isNullOrEmpty(n(document.activeElement).closest("div.k-animation-container"))&&n(document.activeElement).closest("div.k-animation-container").length!=0){window.clearInterval(w);return}dsiCommon.writeToConsole("should focus - k-index");et.length!=0&&dsiKendo.focusElement(et,!0);window.clearInterval(w)}},300)});k=!1;s.parent().on("keydown","*",function(t){if(k==!1&&(t.keyCode==27&&(k=!0,setTimeout(function(){var n=s.data("kendoWindow");dsiCommon.isNullOrEmpty(n)||n._close(!1);k=!1},100)),t.keyCode==13)){if(n(t.currentTarget).hasClass("k-button")){t.stopPropagation();return}k=!0;setTimeout(function(){var n=s.data("kendoWindow");dsiCommon.isNullOrEmpty(n)||o._editUpdateClick();k=!1},100)}});ot=s.data("kendoWindow");ot.bind("resize",dt);var nt=n(".k-window"),gt=nt.find(".k-window-titlebar").outerHeight()+nt.find(".dsi-dialog-toolbar").outerHeight(!0)+50,st=nt.find(".dsi-dialog-content, .k-edit-form-container").first();st.css("max-height","calc(100vh - "+gt+"px");(st.css("max-height")==""||st.css("max-height")=="none")&&(ni=n(window).height()/100,ti=100-gt/ni,st.css("max-height",ti+"vh"));pt=dsiCommon.findBootstrapEnvironment();ht=pt=="xs"||pt=="sm"?t:n(window).height()*.8;ht!=t&&nt.outerHeight(!0)>ht&&(nt.height(ht),dt(),ot.center());o.trigger(wi,{container:s,model:r});ot.bind("activate",function(){s.find(":input, a, .k-widget:not(.k-autocomplete)").filter(":visible").first().focus().select()});s.find(":input").filter(":visible").on("focusin",dsiCommon.selectAllText);for(wt=s.find(".k-datetimepicker"),lt=0;lt<wt.length;lt++)n(wt[lt]).find("input").data("kendoDateTimePicker").timeView.popup.element.switchClass("km-native-scroller","ds-native-scroller")}},_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=[];if(!f.trigger(bi,{model:r})){f.lockedContent&&(t=t.add(f._relatedRow(t)));t.children(":not(.k-group-cell,.k-hierarchy-cell,.dsi-expand-col)").each(function(){if(s=n(this),e=u(f.columns)[f.cellIndex(s)],!dsiCommon.isNullOrEmpty(e))if(!e.command&&lu(e,r))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=cu(e.command,"edit"),o)){s.empty();var c,l,t;a(o)&&(o.text&&a(o.text)&&(c=o.text.update,l=o.text.cancel),o.attr&&(t=o.attr));n(f._createButton({name:"update",text:c,attr:t})+f._createButton({name:"canceledit",text:l,attr:t})).appendTo(s)}});f._editContainer=t;f._editContainer.addClass("k-grid-edit-row");f._shouldClearEditableState&&f._clearEditableState();f.editable=new i.ui.Editable(f._editContainer,{target:f,fields:h,model:r,skipFocus:f._isVirtualInlineEditable()&&f._editableState&&f._editableState.field?!0:!1,clearContainer:!1});t.length>1&&(pi(t[0],t[1]),f._applyLockedContainersWidth());t.find(".k-input").filter(":visible").last().closest(".k-widget").on("keydown",function(n){n.keyCode==9&&n.shiftKey==!1&&(n.preventDefault(),dsiKendo.focusElement(t.find(":input").first().closest(".k-widget"),!0))});t.find(".k-input").filter(":visible").first().closest(".k-widget").on("keydown",function(n){n.keyCode==9&&n.shiftKey==!0&&(n.preventDefault(),dsiKendo.focusElement(t.find(":input").last().closest(".k-widget"),!0))});f.trigger(wi,{container:t,model:r});dsiKendo.focusElement(t.find(":input").first().closest(".k-widget"),!0);t.find(":input").filter(":visible").on("focusin",dsiCommon.selectAllText)}},cancelRow:function(t){var u=this,e=u._editContainer,r,o=u.virtualScrollable,s=o&&o._isScrolledToBottom(),f;if(e){if(r=u._modelForContainer(e),!r||t&&u.trigger("cancel",{container:e,model:r}))return;if(u._destroyEditable(),!dsiCommon.isNullOrEmpty(r.dsi)&&!dsiCommon.isNullOrEmpty(r.dsi.submodels))if(r.dsi.submodels.length<30)for(f=0;f<r.dsi.submodels.length;f++)u.dataSource.cancelChanges(r.dsi.submodels[f]),(dsiCommon.isNullOrEmpty(r.dsi.modeOverride)?u._editMode():r.dsi.modeOverride)!=="popup"?u._displayRow(e):u._displayRow(u.tbody.find("["+i.attr("uid")+"="+r.dsi.submodels[f].uid+"]"));else for(f=0;f<r.dsi.submodels.length;f++)n.each(r.dirtyFields,function(n){r.dsi.submodels[f][n]=r.dsi.originalValues[n]});u.dataSource.cancelChanges(r);(dsiCommon.isNullOrEmpty(r.dsi.modeOverride)?u._editMode():r.dsi.modeOverride)!=="popup"?u._displayRow(e):u._displayRow(u.tbody.find("["+i.attr("uid")+"="+r.uid+"]"))}},saveRow:function(){var r=this,i=this._editContainer,e=this._modelForContainer(i),o=n.Deferred(),u,s,f;return!i||!this.editable?o.resolve().promise():(u=r.editable&&r.editable.end(),s=n.grep(r.columns,function(n){var t=dsiCommon.getElementFromPath(n,"dsi");if(!dsiCommon.isNullOrEmpty(t))return t.fieldType=="date"}),f=[],n.each(s,function(t,r){var o=null,u=null,c=i.find("[data-container-for='"+r.field+"']"),s=c.find(".k-dropdown, .k-datepicker, .k-datetimepicker, .k-combobox"),h;o=i.find("[data-container-for='"+r.field+"']").find("input").val();s.hasClass("k-dropdown")?u=i.find("[data-container-for='"+r.field+"']").find("input").data("kendoDropDownList").value():s.hasClass("k-datepicker")?u=i.find("[data-container-for='"+r.field+"']").find("input").data("kendoDatePicker").value():s.hasClass("k-datetimepicker")?u=i.find("[data-container-for='"+r.field+"']").find("input").data("kendoDateTimePicker").value():s.hasClass("k-combobox")&&(u=i.find("[data-container-for='"+r.field+"']").find("input").last().data("kendoComboBox").value());!dsiCommon.isNullOrEmpty(o)&&(u==null||isNaN(Date.parse(u)))&&(dsiCommon.isBlankValue(o)||dsiCommon.isCurrentValue(o)||(h=n.grep(e.dsi.columnData,function(n){return n.field==r.field}),f.push(h[0].title)))}),f.length>0&&(dsiCommon.displayModalDialog(dsiCommon.getTranslation("INVALID_FIELD_VALUES"),f.join("<br>"),[{title:dsiCommon.getTranslation("LBL_OK")}],t,{autoCloseTime:2e3}),u=!1),!u||this.trigger(cr,{container:i,model:e}))?(u||r._scrollVirtualWrapper(),o.reject().promise()):(r._clearEditableState(),this.dataSource.sync())},_displayRow:function(t){var i=this,f=i._modelForContainer(t),u,r,e,c=t.hasClass("k-state-selected"),h=t.hasClass("k-alt"),o,s;f&&(i.lockedContent&&(u=n((h?i.lockedAltRowTemplate:i.lockedRowTemplate)(f)),i._relatedRow(t.last()).replaceWith(u)),i.angular("cleanup",function(){return{elements:t.get()}}),r=n((h?i.altRowTemplate:i.rowTemplate)(f)),dsiCommon.isNullOrEmpty(i.options.ds_this)||dsiCommon.isNullOrEmpty(i.dataSource.group())||i.dataSource.group().length!=1||i.options.ds_this.detailSetGroupingID!=i.dataSource.group()[0].field||(t.first().hasClass("dsi-dupe-group-row")&&(r.first().addClass("dsi-dupe-group-row"),r.first().children("td").first().replaceWith(t.first().children("td").first())),t.first().hasClass("dsi-dupe-single-row")&&(r.first().addClass("dsi-dupe-single-row"),r.first().children("td").first().replaceWith(t.first().children("td").first()))),t.replaceWith(r),i.trigger("itemChange",{item:r,data:f,ns:et}),u&&u.length&&i.trigger("itemChange",{item:u,data:f,ns:et}),o=r,s=[{dataItem:f}],u&&u.length&&(o=r.add(u),s.push({dataItem:f})),i.angular("compile",function(){return{elements:o.get(),data:s}}),c&&(i.options.selectable||i._checkBoxSelection)&&i.select(r.add(u)),u&&pi(r[0],u[0]),e=r.next(),e.hasClass("k-detail-row")&&e.is(":visible")&&r.find(".k-hierarchy-cell .k-icon").removeClass("k-i-expand").addClass("k-i-collapse"))},_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 i=this,r=i.options.editable,t=r===!0||typeof r===p?i.options.messages.editable.confirmation:r.confirmation;return(a(r)&&typeof r.mode===p&&typeof t!==wt&&typeof t!==p&&t!==!1&&(t=i.options.messages.editable.confirmation),t!==!1&&t!=null)?(typeof t===wt&&(t=t(i._modelForContainer(n))),i._showMessage({confirmDelete:r.confirmDelete||i.options.messages.editable.confirmDelete,cancelDelete:r.cancelDelete||i.options.messages.editable.cancelDelete,title:t===!0?i.options.messages.editable.confirmation:t},n)):!0},cancelChanges:function(){var n=this;n.dataSource.cancelChanges();n._isVirtualEditable()&&n._virtualPageToTop(function(){n.virtualScrollable.scrollToTop()})},saveChanges:function(){var n=this,t=n.editable&&n.editable.end();!t&&n.editable||n.trigger(uf)?t||n._scrollVirtualWrapper():n.dataSource.sync()},addRow:function(){var n=this,i,t=n.dataSource,f=n._editMode(),o=n.options.editable.createAt||"",r=t.pageSize(),u=t.view()||[],s=o.toLowerCase()===yf,e,h=n._isVirtualEditable();n.editable&&n.editable.end()||!n.editable?(f!="incell"&&n.cancelRow(),i=t.indexOf(u[0]),s&&(i+=u.length,r&&!t.options.serverPaging&&r<=u.length&&(i-=1)),i<0&&(i=t.page()>t.totalPages()?(t.page()-1)*r:0),n.options.navigatable&&f=="incell"&&n._removeCurrent(),h?n._virtualAddRow():(e=t.insert(i,{}),n._editModel(e))):n._scrollVirtualWrapper()},_editModel:function(n){var t=this,e=t.options.editable.createAt||"",u=t._editMode();if(n){var o=n.uid,s=t.lockedContent?t.lockedTable:t.table,r=s.find("tr["+i.attr("uid")+"="+o+"]"),f=r.children("td:not(.k-group-cell,.k-hierarchy-cell)").eq(t._firstEditableColumnIndex(r));u==="inline"&&r.length?t.editRow(r):u==="popup"?t.editRow(n):f.length&&t.editCell(f);e.toLowerCase()=="bottom"&&t.lockedContent&&(t.lockedContent[0].scrollTop=t.content[0].scrollTop=t.table[0].offsetHeight)}},_virtualAddRow:function(){var n=this,t=(n.options.editable.createAt||"").toLowerCase()===yf;n._clearEditableState();t?n._virtualAddRowAtBottom():n._virtualAddRowAtTop()},_virtualAddRowAtTop:function(){var n=this,i=n.dataSource,r=n.virtualScrollable,t;i.page()===1?(t=i.insert(0,{}),n._editModel(t),r.scrollToTop()):n._virtualPageToTop(function(){t=i.insert(0,{});n._editModel(t);r.scrollToTop()})},_virtualAddRowAtBottom:function(){var n=this,t=n.dataSource,u=n.virtualScrollable,r=t.total(),i;t.at(r-1)instanceof vu?(i=t.insert(r,{}),n._virtualPageToBottom(function(){n._editModel(i);u.scrollToBottom()})):n._virtualPageToBottom(function(){i=t.insert(r,{});n._editModel(i);u.scrollToBottom()})},_virtualPageToTop:function(n){var t=this;t._virtualPage(0,t.dataSource.take(),function(){n()})},_virtualPageToBottom:function(n){var t=this,i=t.dataSource,r=i.take();t._virtualPage(i.total()-r,r,function(){n()})},_virtualPage:function(n,t,i){var r=this;r._isVirtualEditable()&&(r.virtualScrollable._preventScroll=!0,r.virtualScrollable._page(n,t,i))},_restoreVirtualView:function(){var i=this,r=i.dataSource,n=i.virtualScrollable,t=n.verticalScrollbar,e=n.wrapper,u=r.take(),f=nt.min(r.currentRangeStart(),r.total()-u),o=n.itemHeight,s=t.scrollTop()/o;i._virtualPage(f,u,function(){var i=n.itemHeight,r=s*i;n._isScrolledToBottom()?n.scrollToBottom():(n._preventScroll=t.scrollTop()!==r?!0:!1,t.scrollTop(r),e.scrollTop(t.scrollTop()-f*i))})},_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||(fr(u)||(u=typeof u===p?u:t._toolbarTmpl(u).replace(ci,"\\#"),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(v+r,".k-grid-add",function(n){n.preventDefault();t.addRow()}).on(v+r,".k-grid-cancel-changes",function(n){n.preventDefault();t.cancelChanges()}).on(v+r,".k-grid-save-changes",function(n){n.preventDefault();t.saveChanges()});f.on(v+r,".k-grid-excel",function(n){n.preventDefault();t.saveAsExcel()});f.on(v+r,".k-grid-pdf",function(n){n.preventDefault();t.saveAsPDF()})}},_toolbarTmpl:function(n){var u=this,t,i,r="";if(kt(n))for(t=0,i=n.length;t<i;t++)r+=u._createButton(n[t]);return r},_createButton:function(n){var s=n.template||ro,r=typeof n===p?n:n.name||n.text,h=d[r]?d[r].className:"k-grid-"+(r||"").replace(/\s/g,""),u={className:h,text:r,attr:"",iconClass:""},o=this.options.messages.commands,e;if(!r&&!(a(n)&&n.template))throw new Error("Custom commands should have name specified");return a(n)?(n=f(!0,{},n),n.className&&c(u.className,n.className.split(" "))<0?n.className+=" "+u.className:n.className===t&&(n.className=u.className),r==="edit"&&a(n.text)&&(n=f(!0,{},n),n.text=n.text.edit),n.attr&&(a(n.attr)&&(n.attr=gt(n.attr)),typeof n.attr===p&&(e=n.attr.match(/class="(.+?)"/),e&&c(e[1],n.className.split(" "))<0&&(n.className+=" "+e[1]))),u=f(!0,u,d[r],{text:o[r]},n)):u=f(!0,u,d[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(v+r,t._groupableClickHandler):t._groupableClickHandler=function(i){var u=n(this),r=u.closest("tr"),f=t._groupRows?t._groupRows[t.wrapper.find(".k-grouping-row").index(r)]:{};u.hasClass("k-i-collapse")?t.trigger("groupCollapse",{group:f,element:r})||t.collapseGroup(r):t.trigger("groupExpand",{group:f,element:r})||t.expandGroup(r);i.preventDefault();i.stopPropagation()},t._isLocked())t.lockedTable.on(v+r,".k-grouping-row .k-i-expand, .k-grouping-row .k-i-collapse, .dsi-dupe-group-row .k-i-collapse, .dsi-dupe-group-row .k-i-expand",t._groupableClickHandler);else t.table.on(v+r,".k-grouping-row .k-i-expand, .k-grouping-row .k-i-collapse, .dsi-dupe-group-row .k-i-collapse, .dsi-dupe-group-row .k-i-expand",t._groupableClickHandler);t._attachGroupable()},_attachGroupable:function(){var t=this,r=t.wrapper,u=t.options.groupable,e=hr+"["+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 et.Groupable(r,f({},u,{draggable:t._draggableInstance,groupContainer:">div.k-grouping-header",dataSource:t.dataSource,draggableElements:o,filter:o,allowDrag:t.options.reorderable,change:function(n){t.trigger("group",{groups:n.groups})?n.preventDefault():(t._clearEditableState(),t.dataSource.options.endless&&(t.dataSource.options.endless=null,t._endlessPageSize=t.dataSource.options.pageSize,t.dataSource.pageSize(t.dataSource.options.pageSize)))}})))},_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)yu.apply(e,h.slice(r,r+f)),yu.apply(e,c.splice(0,l));return e}},_selectable:function(){var t=this,s,u,e=[],a=t._isLocked(),l=t.options.selectable,p=t.dataSource.options,f=[],o,v,y;if(l&&(t.selectable&&t.selectable.destroy(),t.options.persistSelection===!0&&(t._selectedIds={}),l=i.ui.Selectable.parseOptions(l),s=l.multiple,u=l.cell,(t.options.groupable||t._hasFooters()||t._groups())&&(e[e.length]=".k-grouping-row,.k-group-footer"),e=e.join(","),e!==""&&(e=":not("+e+")"),t._hasDetails()&&(f[f.length]=".k-detail-row"),(t.options.groupable||t._hasFooters())&&(f[f.length]=".k-grouping-row,.k-group-footer"),f=f.join(","),f!==""&&(f=":not("+f+")"),o=t.table,a&&(o=o.add(t.lockedTable)),v=u?">"+wu:".dsi-selectable-row,.k-detail-row",y=u?">"+wu:".dsi-selectable-row",t.selectable=new i.ui.Selectable(o,{filter:v,itemsFilter:y,aria:!0,multiple:s,change:function(){t.options.persistSelection&&!u&&t._persistSelectedRows();t.trigger(w)},useAllItems:a&&s&&u,relatedTarget:function(i){for(var r,u=n(),f=0,e=i.length;f<e;f++)r=t._relatedRow(i[f]),c(r[0],i)<0&&(u=u.add(r));return u},continuousItems:function(){return t._continuousItems(v,u)}}),t.options.navigatable))o.on("keydown"+r,function(i){var r=t.current(),f=i.target;if(i.keyCode===h.SPACEBAR&&!i.shiftKey&&n.inArray(f,o)>-1&&!r.is(".k-edit-cell,.k-header")&&r.parent().is(":not(.k-grouping-row,.k-group-footer)")){if(i.preventDefault(),i.stopPropagation(),r=u?r:r.parent(),r=r.add(t._relatedRow(r)),s)if(i.ctrlKey){if(r.hasClass(dt)){r.removeClass(dt);t.trigger(w);return}}else t.selectable.clear();else t.selectable.clear();u||(t.selectable._lastActive=r);t.selectable.value(r)}else!u&&(i.shiftKey&&i.keyCode==h.LEFT||i.shiftKey&&i.keyCode==h.RIGHT||i.shiftKey&&i.keyCode==h.UP||i.shiftKey&&i.keyCode==h.DOWN||i.keyCode===h.SPACEBAR&&i.shiftKey)&&(i.preventDefault(),i.stopPropagation(),r=r.parent(),a&&(r=r.add(t._relatedRow(r))),s?(t.selectable._lastActive||(t.selectable._lastActive=r),t.selectable.selectRange(t.selectable._firstSelectee(),r)):(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,ht+">"+ct,e(pe,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){var i;this.areaClipBoard&&t&&t.target===this.areaClipBoard[0]&&(i=this.options.navigatable?n(this.current()).closest("table"):this.table,b(i,!0));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(){var n=this.columns,t=window.innerWidth>0?window.innerWidth:screen.width;return this._iterateMinScreenCols(n,t)},_iterateMinScreenCols:function(n,i){for(var r,f,u=!1,e=0;e<n.length;e++)r=n[e],f=r.minScreenWidth,f!==t&&f!==null&&(u=!0,f>i?this.hideColumn(r):this.showColumn(r)),!r.hidden&&r.columns&&(u=this._iterateMinScreenCols(r.columns,i)||u);return u},_relatedRow:function(t){var u=this.lockedTable,i,r,f;return(t=n(t),!u)?(i=t.next(".k-detail-row"),i.length===0&&(i=t.prev(".k-master-row")),i.length>0)?i:t:(r=t.closest(this.table.add(this.lockedTable)),f=r.find(">tbody>tr").index(t),r=r[0]===this.table[0]?u:this.table,r.find(">tbody>tr").eq(f))},clearSelection:function(){var n=this;if(n.selectable&&n.selectable.clear(),n._checkBoxSelection){n._deselectCheckRows(n.select());return}n.options.persistSelection&&n._persistSelectedRows();n.trigger(w)},select:function(t){var i=this,r=i.selectable;if(t=i.table.add(i.lockedTable).find(t),t.length){r&&!r.options.multiple&&(r.clear(),t=t.first());t=t.add(t.map(function(){return i._relatedRow(this)}));r?r.value(t):(t.each(function(){n(this).addClass(dt).find(pt).prop("checked",!0).attr("aria-label","Deselect row").attr("aria-checked",!0)}),i.select().length===i.items().length&&i._toggleHeaderCheckState(!0),i.options.persistSelection&&i._persistSelectedRows(),i.trigger(w));return}return r?r.value():i.items().filter("."+dt)},_toggleHeaderCheckState:function(n){var t=this;n?t.thead.add(t.lockedHeader).find("tr "+pt).prop("checked",!0).attr("aria-checked",!0).attr("aria-label","Deselect all rows"):t.thead.add(t.lockedHeader).find("tr "+pt).prop("checked",!1).attr("aria-checked",!1).attr("aria-label","Select all rows")},_deselectCheckRows:function(t){var i=this;t=i.table.add(i.lockedTable).find(t);i._isLocked()&&(t=t.add(t.map(function(){return i._relatedRow(this)})));t.each(function(){n(this).removeClass(dt).find(pt).attr("aria-checked",!1).prop("checked",!1).attr("aria-label","Select row")});i._toggleHeaderCheckState(!1);i.options.persistSelection&&i._persistSelectedRows();i.trigger(w)},_persistSelectedRows:function(){var n=this,t,i,u=n.items(),o=n.dataSource.options,f=o.schema.model.id,e={},r;for(n.select().each(function(){i=n.dataItem(this);e[i[f]]=!0}),r=0;r<u.length;r++)i=n.dataItem(u[r]),t=i[f],e[t]?n._selectedIds[t]=!0:delete n._selectedIds[t]},selectedKeyNames:function(){var t=this,n=[];for(var i in t._selectedIds)n.push(i);return n.sort(),n},_updateCurrentAttr:function(t,i){var r=n(t).data("headerId");n(t).removeClass(oi).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(oi).closest("table").attr("aria-activedescendant",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").addBack().last()[0];s&&(u.virtual?(e=Math.max(c(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),i||this.trigger(vf,{element:t}))),t&&t.length&&(this._lastCellIndex=t.parent().children(l).index(t)),this._current},_removeCurrent:function(){this._current&&(this._current.removeClass(oi),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;lt&&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(si,-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(si,nt.max(f.attr(si)||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,ht+">"+ct,e(pe,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==h.DOWN&&(this.current().find(".k-grid-filter, .k-header-column-menu").click(),n.stopImmediatePropagation())},_setTabIndex:function(n){this._navigatableTables.attr(si,-1);n.attr(si,0)},_tableFocus:function(t){if(!i.support.touch){var r=this.current(),u=n(t.currentTarget);r&&r.is(":visible")?r.addClass(oi):this._setCurrent(u.find(ku));this._setTabIndex(u)}},_tableBlur:function(){var n=this.current();n&&n.removeClass(oi)},_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.options.scrollable?this.table:this.tbody).find(ku),i.length)&&(r=!1,u&&t.keyCode==h.UP&&(r=this._moveUp(i,t.shiftKey)),u&&t.keyCode==h.DOWN&&(r=this._moveDown(i,t.shiftKey)),u&&t.keyCode==(lt?h.LEFT:h.RIGHT)&&(r=this._moveRight(i,t.altKey,t.shiftKey,t.ctrlKey,t.currentTarget)),u&&t.keyCode==(lt?h.RIGHT:h.LEFT)&&(r=this._moveLeft(i,t.altKey,t.shiftKey,t.ctrlKey,t.currentTarget)),u&&t.keyCode==h.PAGEDOWN&&(r=this._handlePageDown()),u&&t.keyCode==h.PAGEUP&&(r=this._handlePageUp()),u&&t.keyCode==h.HOME&&(r=this._handleHome(i,t.ctrlKey)),u&&t.keyCode==h.END&&(r=this._handleEnd(i,t.ctrlKey)),(t.keyCode==h.ENTER||t.keyCode==h.F2)&&(r=this._handleEnterKey(i,t.currentTarget,f)),t.keyCode==h.ESC&&(r=this._handleEscKey(i,t.currentTarget)),t.keyCode==h.TAB&&(r=this._handleTabKey(i,t.currentTarget,t.shiftKey)),r&&(t.preventDefault(),t.stopPropagation()))},_moveLeft:function(t,i,r,u,f){var e,h,s=t.parent(),o=s.parent();return i?this.collapseRow(s):u&&t.is(".k-header")&&this.options.reorderable?this._moveColumn(t,!0):(h=o.find(ht).index(s),e=this._prevHorizontalCell(o,t,h),e[0]||(r?this.lockedTable?(e=this._relatedRow(s),n.contains(this.lockedTable[0],s[0])&&(e=e.prevAll(at+":first")),e=e.children(l+":last")):e=this._tabNext(t,f,!0):(o=this._horizontalContainer(o),e=this._prevHorizontalCell(o,t,h),e[0]!==t[0]&&b(o.parent(),!0))),this._setCurrent(e)),!0},_moveRight:function(t,i,r,u,f){var e,h,s=t.parent(),o=s.parent();return i?this.expandRow(s):u&&t.is(".k-header")&&this.options.reorderable?this._moveColumn(t,!1):(h=o.find(ht).index(s),e=this._nextHorizontalCell(o,t,h),e[0]||(r?this.lockedTable?(e=this._relatedRow(s),n.contains(this.table[0],s[0])&&(e=e.nextAll(at+":first")),e=e.children(l+":first")):e=this._tabNext(t,f,!1):(o=this._horizontalContainer(o,!0),e=this._nextHorizontalCell(o,t,h),e[0]!==t[0]&&b(o.parent(),!0))),this._setCurrent(e)),!0},_moveUp:function(n,t){var r=n.parent().parent(),i,u;return t?(i=n.parent(),i=i.prevAll(at+":first"),i=n.parent().is(at)?i.children().eq(n.index()):i.children(l+":last")):(i=this._prevVerticalCell(r,n),i[0]||(this._lastCellIndex=0,r=this._verticalContainer(r,!0),i=this._prevVerticalCell(r,n),i[0]&&b(r.parent(),!0))),u=this._lastCellIndex||0,this._setCurrent(i),this._lastCellIndex=u,!0},_moveDown:function(n,t){var r=n.parent().parent(),i,u;return t?(i=n.parent(),i=i.nextAll(at+":first"),i=n.parent().is(at)?i.children().eq(n.index()):i.children(l+":first")):(i=this._nextVerticalCell(r,n),i[0]||(this._lastCellIndex=0,r=this._verticalContainer(r),i=this._nextVerticalCell(r,n),i[0]&&b(r.parent(),!0))),u=this._lastCellIndex||0,this._setCurrent(i),this._lastCellIndex=u,!0},_moveColumn:function(t,i){var e=this.wrapper.data().kendoReorderable.element.find(this._draggableInstance.options.filter+":visible"),u=k(tr(this.columns)),r=e.index(n(t)),o=i?-1:1,s=u[r],f=ir(u,this.columns,r,r+o);f>=0&&this.reorderColumn(f,s,i)},_handleHome:function(n,t){var r=n.parent(),u=r.parent(),e=this.lockedTable&&this.lockedTable.children("tbody")[0]===u[0],f=u[0]===this.tbody[0],i;return t?i=this.lockedTable?this.lockedTable.find(bu+">"+ct+":first"):this.table.find(bu+">"+ct+":first"):(f||e)&&(f&&this.lockedTable&&(r=this._relatedRow(r)),i=r.children(l+":first")),i&&i.length?(this._setCurrent(i),!0):void 0},_handleEnd:function(n,t){var r=n.parent(),u=r.parent(),e=this.lockedTable&&this.lockedTable.children("tbody")[0]===u[0],f=u[0]===this.tbody[0],i;return t?i=this.table.find(ke+">"+ct+":last"):(f||e)&&(!f&&this.lockedTable&&(r=this._relatedRow(r)),i=r.children(l+":last")),i&&i.length?(this._setCurrent(i),!0):void 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(ot()).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=ot(),f=this._editMode()=="incell",u;return bo(t)?(f?this.closeCell(!0):(u=n(t).index(),r&&r.blur(),this.cancelRow(!0),u>=0&&this._setCurrent(this.items().eq(u).children(ct).first())),o.msie&&o.version<9&&document.body.focus(),b(i,!0),!0):t.has(r).length?(b(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 o=this.options.editable&&this.options.editable.update!==!1,u=r.closest("[role=gridcell]"),f,e;return(r.is("table")||n.contains(t[0],r[0])||(t=u),t.is("th"))?(f=t.find(".k-link"),f.length?f.click():t.find(pt).focus(),!0):this._toggleCurrent(t,o)?!0:(e=t.find(":kendoFocusable:first"),e[0]&&!t.hasClass("k-edit-cell")&&t.hasClass("k-state-focused")&&!t.hasClass("dsi-expand-col"))?(e.focus(),!0):o&&!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(l),r,e,u;return!f.length&&(r=n.find(ht),e=r.index(t.parent()),e==-1)?t.hasClass("k-header")?(u=[],rr([s(this.columns)[0]],yi(r.eq(0).children(":visible").first()),u,0,0),u[i])?u[i][0]:t:t.parent().hasClass("k-filter-row")?r.last().children(l).first():r.eq(i).children(l).first():f.first()},_prevHorizontalCell:function(n,t,i){var e=t.prevAll(l),r,o,u,f;return!e.length&&(r=n.find(ht),o=r.index(t.parent()),o==-1)?t.hasClass("k-header")?(u=[],f=s(this.columns),rr([f[f.length-1]],yi(r.eq(0).children().last()),u,0,0),u[i])?u[i][0]:t:t.parent().hasClass("k-filter-row")?r.last().children(l).last():r.eq(i).children(l).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(ht),e=o.index(u),f=this._currentDataIndex(t,i);if(f||i.hasClass("k-header"))return r=ee(i),r.eq(r.length-2);if(f=Math.max(u.children(l).index(i),this._lastCellIndex||0),u.hasClass("k-filter-row"))return g(t).filter(ni).eq(f);if(e==-1){if(u=t.find("tr.k-filter-row:visible"),!u[0])return g(t).filter(ni).eq(f)}else u=e===0?n():o.eq(e-1);return(r=u.children(l),r.length>f)?r.eq(f):r.eq(0)},_nextVerticalCell:function(n,i){var f,u=i.parent(),o=n.children(ht),s=o.index(u),r=this._currentDataIndex(n,i),h,c,a,e,v;if(s!=-1&&r===t&&i.hasClass("k-header"))return yi(i).eq(1);if(r=r?parseInt(r,10):u.children(l).index(i),r=Math.max(r,this._lastCellIndex||0),u=s==-1?o.eq(0):o.eq(s+i[0].rowSpan),h=r,this._currentDataIndex(n,i)!==t)for(c=u.children(":not(.k-group-cell):not(.k-hierarchy-cell)"),a=c.filter(":hidden"),e=0,v=a.length;e<v;e++)c.index(a[e])<r&&h--;return(r=h,f=u.children(l),f.length>r)?f.eq(r):f.eq(0)},_verticalContainer:function(n,t){var r=n.parent(),u=this._navigatableTables.length,f=Math.floor(u/2),i=c(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=c(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(l+":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(l+(i?":last":":first"))),r},_handleEditing:function(t,i,r){var u=this,f=n(ot()),e=u._editMode(),a=o.msie,v=a&&o.version<9,s=u._editContainer,h,y=u.options.editable&&u.options.editable.update!==!1,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||v?f.blur().change().triggerHandler("blur"):(f.blur(),a&&f.blur())),!u.editable){b(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(l).first());h=s.find(":kendoFocusable:first")[0];h&&h.focus();return}}(i&&u._setCurrent(i),v&&document.body.focus(),b(r,!0),y)&&((c||i)&&!i||(e=="incell"?u.editCell(u.current()):u.current().hasClass("dsi-selectable-row")?u.editRow(t):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 k-display-block");i&&(n.wrapper.css(gr,i),r.css(gr,"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(gr,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,o,y=t.options,e=y.scrollable,a=e!==!0&&e.virtual&&!t.virtualScrollable,v=!i.support.kineticScrollNeeded||a?i.support.scrollbar():0,s,h,c,l,u;if(e)if(f=t.wrapper.children(".k-grid-header"),f[0]||(f=n('<div class="k-grid-header" />').insertBefore(t.table)),f.css(lt?"padding-left":"padding-right",e.virtual?v+1:v),o=n('<table role="grid" />'),li&&o.attr("cellspacing",0),o.width(t.table[0].style.width),o.append(t.thead),f.empty().append(n('<div class="k-grid-header-wrap k-auto-scrollable" />').append(o)),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()),a&&t._createVirtualScrollable(),s=f.children(".k-grid-header-wrap"),t.scrollables=s.add(t.content),h=t.wrapper.find(".k-grid-footer"),h.length&&(t.scrollables=t.scrollables.add(h.children(".k-grid-footer-wrap"))),s.unbind("scroll"+r).bind("scroll"+r,function(n){t.scrollables.not(n.currentTarget).scrollLeft(this.scrollLeft)}),e.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(c=e.endless,l=t.dataSource.options.pageSize,c&&(t._endlessPageSize=l),t.content.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);c&&this.scrollTop+this.clientHeight-this.scrollHeight>=-10&&!t._endlessFetchInProgress&&t._endlessPageSize<t.dataSource.total()&&(t._skipRerenderItemsCount=t._endlessPageSize,t._endlessPageSize=t._endlessPageSize+l,t.dataSource.options.endless=!0,t._endlessFetchInProgress=!0,t.dataSource.pageSize(t._endlessPageSize))}),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(pr,function(n){n.sender.wrapper.addClass("k-grid-backface")})}},_createVirtualScrollable:function(){var n=this;n.virtualScrollable&&n.virtualScrollable.destroy();n.virtualScrollable=new kf(n.content,{dataSource:n.dataSource,itemHeight:function(){return n._averageRowHeight()},page:function(){n._restoreEditableState()},scroll:function(){n._focusEditable()}});n.virtualScrollable.bind(kr,e(n._onVirtualPaging,n))},_onVirtualPaging:function(){var n=this;n._cacheEditableState();n._isVirtualIncellEditable()&&(n._shouldClearEditableState=!1,n.closeCell(),n._shouldClearEditableState=!0)},_isVirtualEditable:function(){return this._isVirtualIncellEditable()||this._isVirtualInlineEditable()||this._isVirtualPopupEditable()},_isVirtualInlineEditable:function(){return this.virtualScrollable&&this._editMode()===ge},_isVirtualIncellEditable:function(){return this.virtualScrollable&&this._editMode()===wf},_isVirtualPopupEditable:function(){return this.virtualScrollable&&this._editMode()==="popup"},_scrollVirtualWrapper:function(){var t=this,n=t.virtualScrollable;(t._isVirtualInlineEditable()||t._isVirtualIncellEditable())&&(n._isScrolledToBottom()?n._scrollWrapperToBottom():n._isScrolledToTop()&&n._scrollWrapperToTop())},_restoreEditableState:function(){var t=this,u=t._editableState||{},i=u.model,f=t.dataSource,e=t._isVirtualInlineEditable(),o=t._isVirtualIncellEditable(),s,r;(e||o)&&i&&f._getByUid(i.uid,f.view())&&(e?(t._shouldClearEditableState=!1,t.editRow(i),t._focusEditable()):o&&(s=t.tbody.children(ru(no,i.uid)),r=n(s).children(ru(pf,u.field)),r[0]&&(t._shouldClearEditableState=!1,t.editCell(r),t._focusEditable())));t._shouldClearEditableState=!0},_focusEditable:function(){var n=this,i=(n._editableState||{}).field,t=n._editContainer;t&&!er(t[0],ot())&&n._canFocusEditable()&&(n._isVirtualInlineEditable()?t.find(ru(nu,i)).find(sf).eq(0).focus():n._isVirtualIncellEditable()&&t.find(sf).eq(0).focus())},_canFocusEditable:function(){var n=this;return(n._isVirtualIncellEditable()||n._isVirtualInlineEditable())&&n.virtualScrollable._isElementVisible(n._editContainer)},_cacheEditableState:function(){var r=this,u=r._editContainer,e=u?r._modelForContainer(u):null,o=r._isVirtualInlineEditable(),s=r._isVirtualIncellEditable(),t,f;(o||s)&&e&&(r._clearEditableState(),t=n(ot()),u&&t[0]&&er(u[0],t[0])&&(t.change(),f=i.widgetInstance(t,i.ui),f&&fr(f.value)&&t.is(de)&&(f.value(t.val()),f.trigger(w))),o?r._editableState={model:e,field:t.closest("["+i.attr(nu)+"]").attr(i.attr(nu))}:s&&(r._editableState={model:e,field:u.attr(i.attr(pf))}))},_clearEditableState:function(){var n=this;n.virtualScrollable&&(n._editableState=null)},_destroyVirtualScrollable:function(){var n=this;n._clearEditableState();n.virtualScrollable&&n.virtualScrollable.element&&n.virtualScrollable.destroy();n.virtualScrollable=null},_renderNoRecordsContent:function(){var t=this,i;t.options.noRecords&&(i=t.table.parent().children("."+hf),i.length&&(t.angular("cleanup",function(){return{elements:i.get()}}),i.remove()),t.dataSource&&t.dataSource.data().length||(i=n(t.noRecordsTemplate({})).insertAfter(t.table),t.angular("compile",function(){return{elements:i.get(),data:[{}]}})))},_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()),isNaN(parseFloat(t,10))||i.content.scrollLeft(t))),i._applyLockedContainersWidth(),i.lockedHeader&&i.table[0].clientWidth===0&&(i.table[0].style.width="1px"))},_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=ue(h),s=ue(c),f;e>0&&(n+=it(this.lockedHeader.find(".k-group-cell:first"))*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-=st(e),n.pager&&n.pager.element.is(":visible")&&(t-=st(n.pager.element)),u.groupable&&(t-=st(n.wrapper.children(".k-grouping-header"))),u.toolbar&&(t-=st(n.wrapper.children(".k-grid-toolbar"))),n.footerTemplate&&(t-=st(n.wrapper.children(".k-grid-footer"))),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=st(n.table)/i,n._sum=t,n._measures=1),r=st(n.table)/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=kt(i)?{data:i}:i;a(i)&&(f(i,{table:n.table,fields:n.columns}),r=u.pageable,a(r)&&r.pageSize!==t&&(i.pageSize=r.pageSize));n.dataSource&&n._refreshHandler?n.dataSource.unbind(w,n._refreshHandler).unbind(or,n._progressHandler).unbind(sr,n._errorHandler):(n._refreshHandler=e(n.refresh,n),n._progressHandler=e(n._requestStart,n),n._errorHandler=e(n._error,n));n.dataSource=au.create(i).bind(w,n._refreshHandler).bind(or,n._progressHandler).bind(sr,n._errorHandler)},_error:function(){this._progress(!1)},_requestStart:function(){this._progress(!0)},_modelChange:function(t){var r=this,w=r.tbody,e=t.model,o=r.tbody.find("tr["+i.attr("uid")+"="+e.uid+"]"),s,h,c,b=o.hasClass("k-alt"),f,l=r._items(w).index(o),v=r.lockedContent,y,a,k,d,g,p;if(v&&(s=r._relatedRow(o)),o.add(s).children(".k-edit-cell").length&&!r.options.rowTemplate)o.add(s).children(":not(.k-group-cell,.k-hierarchy-cell)").each(function(){h=n(this);c=u(r.columns)[r.cellIndex(h)];c.field===t.field&&(h.hasClass("k-edit-cell")?h.addClass("k-dirty-cell"):r._displayCell(h,c,e))});else if(!o.hasClass("k-grid-edit-row")){for(a=n().add(o),v&&(f=(b?r.lockedAltRowTemplate:r.lockedRowTemplate)(e),a=a.add(s),s.replaceWith(f)),r.angular("cleanup",function(){return{elements:a.get()}}),f=(b?r.altRowTemplate:r.rowTemplate)(e),dsiCommon.isNullOrEmpty(r.options.ds_this)||dsiCommon.isNullOrEmpty(r.dataSource.group())||r.dataSource.group().length!=1||r.options.ds_this.detailSetGroupingID!=r.dataSource.group()[0].field||(f=n(f),o.first().hasClass("dsi-dupe-group-row")&&(f.first().addClass("dsi-dupe-group-row"),f.first().children("td").first().replaceWith(o.first().children("td").first())),o.first().hasClass("dsi-dupe-single-row")&&(f.first().addClass("dsi-dupe-single-row"),f.first().children("td").first().replaceWith(o.first().children("td").first()))),o.replaceWith(f),f=r._items(w).eq(l),p=[{dataItem:e}],v&&(o=o.add(s),s=r._relatedRow(f)[0],pi(f[0],s),f=f.add(s),p.push({dataItem:e})),r.angular("compile",function(){return{elements:f.get(),data:p}}),y=r.options.selectable,y&&o.hasClass("k-state-selected")&&r.select(f),d=a.children(":not(.k-group-cell,.k-hierarchy-cell,.dsi-expand-col)"),k=f.children(":not(.k-group-cell,.k-hierarchy-cell,.dsi-expand-col)"),l=0,g=r.columns.length;l<g;l++)c=r.columns[l],h=k.eq(l),y&&d.eq(l).hasClass("k-state-selected")&&h.addClass("k-state-selected"),(c.field===t.field||(dsiCommon.isNullOrEmpty(e.dsi)?!1:n.inArray(c.field,Object.keys(e.dsi.originalValues))!==-1))&&(dsiCommon.isNullOrEmpty(e.dsi)||dsiCommon.isNullOrEmpty(e.dsi.resetValues)?n('<span class="k-dirty"/>').prependTo(h):n.inArray(c.field,e.dsi.resetValues)==-1&&e[c.field]!==e.dsi.originalValues[c.field]?n('<span class="k-dirty"/>').prependTo(h):e.dsi.resetValues=n.grep(e.dsi.resetValues,function(n){return n!=t.field}));r.trigger("itemChange",{item:f,data:e,ns:et})}},_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})),t.pager.bind("pageChange",function(n){t.trigger("page",{page:n.index})&&n.preventDefault()}))},_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;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:ei(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=n(t.scrollables.filter(function(){return!n(this).is(".k-grid-footer-wrap")}).toArray()).add(f)),t._footerWidth&&i.find("table").css("width",t._footerWidth),f&&(o=t.content.scrollLeft(),u.scrollable!==!0&&u.scrollable.virtual&&(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'+(li?' cellspacing="0"':"")+"><tbody>"+t+"<\/tbody><\/table><\/div><\/div>"),u._appendCols(r.find("table")),r.css(lt?"padding-left":"padding-right",f),r):'<tfoot class="k-grid-footer">'+t+"<\/tfoot>"},_columnMenu:function(){var n=this,a,w=u(n.columns),r,o=n.options,e=o.columnMenu,v,k,h,p,tt=y(n.columns,function(n){return n.columns!==t}).length>0,it=this._isMobile,rt=function(t){n.trigger(gu,{field:t.field,container:t.container})},ut=function(t){n.trigger(tf,{field:t.field,container:t.container})},ft=function(n){b(n.closest("table"),!0)},et=function(t){n.trigger("sort",{sort:t.sort})?t.preventDefault():(n._clearEditableState(),n.dataSource.options.endless&&(n.dataSource.options.endless=null,n._endlessPageSize=n.dataSource.options.pageSize,n.dataSource.pageSize(n.dataSource.options.pageSize)))},ot=function(t){n.trigger("filter",{filter:t.filter,field:t.field})?t.preventDefault():(n._clearEditableState(),n.dataSource.options.endless&&(n.dataSource.options.endless=null,n._endlessPageSize=n.dataSource.options.pageSize,n.dataSource.pageSize(n.dataSource.options.pageSize)))},d=o.$angular,c,nt,l;if(e)for(typeof e=="boolean"&&(e={}),p=g(n.thead),c=0,nt=p.length;c<nt;c++)(r=w[c],dsiCommon.isNullOrEmpty(r))||(l=p.eq(c),!r.command&&(r.field||l.attr("data-"+i.ns+"field"))&&(a=l.data("kendoColumnMenu"),a&&a.destroy(),k=r.sortable!==!1&&e.sortable!==!1&&o.sortable!==!1?f({},o.sortable,{compare:(r.sortable||{}).compare}):!1,h=o.filterable&&r.filterable!==!1&&e.filterable!==!1?f({pane:n.pane},o.filterable,r.filterable):!1,r.filterable&&r.filterable.dataSource&&(h.forceUnique=!1,h.checkSource=r.filterable.dataSource),h&&(h.format=r.format),v={dataSource:n.dataSource,values:r.values,columns:e.columns,sortable:k,filterable:h,messages:e.messages,owner:n,closeCallback:ft,init:rt,open:ut,pane:n.pane,sort:et,filtering:ot,filter:it?":not(.k-column-active)":"",lockedColumns:!tt&&r.lockable!==!1&&s(w).length>0},d&&(v.$angular=d),l.kendoColumnMenu(v)))},_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 n=this,e=u(n.columns),s,l,h,v=function(t){n.trigger(du,{field:t.field,container:t.container})},y=function(n){b(n.closest("table"),!0)},w=function(t){n.trigger("filter",{filter:t.filter,field:t.field})?t.preventDefault():(n._clearEditableState(),n.dataSource.options.endless&&(n.dataSource.options.endless=null,n._endlessPageSize=n.dataSource.options.pageSize,n.dataSource.pageSize(n.dataSource.options.pageSize)))},k=function(t){n.trigger(nf,{field:t.field,container:t.container})},o=n.options.filterable,t,a,r,c;if(o&&typeof o.mode==p&&o.mode.indexOf("menu")==-1&&(o=!1),o&&!n.options.columnMenu)for(l=g(n.thead),t=0,a=l.length;t<a;t++)h=l.eq(t),e[t].filterable!==!1&&!e[t].command&&(e[t].field||h.attr("data-"+i.ns+"field"))&&(s=h.data("kendoFilterMenu"),s&&s.destroy(),s=h.data("kendoFilterMultiCheck"),s&&s.destroy(),r=e[t].filterable,c=f({},o,r,{dataSource:n.dataSource,values:e[t].values,format:e[t].format,closeCallback:y,title:e[t].title||e[t].field,init:v,open:k,pane:n.pane,change:w}),r&&r.messages&&(c.messages=f(!0,{},o.messages,r.messages)),r&&r.dataSource&&(c.forceUnique=!1,c.checkSource=r.dataSource),r&&r.multi?h.kendoFilterMultiCheck(c):h.kendoFilterMenu(c))},_filterRow:function(){var t=this,h,e,a;if(t._hasFilterRow()){var c,v=t.options.$angular,y=u(t.columns),b=t.options.filterable,k=t.thead.find(".k-filter-row"),d=function(n){t.trigger("filter",{filter:n.filter,field:n.field})?n.preventDefault():(t._clearEditableState(),t.dataSource.options.endless&&(t.dataSource.options.endless=null,t._endlessPageSize=t.dataSource.options.pageSize,t.dataSource.pageSize(t.dataSource.options.pageSize)))};for(this._updateHeader(this.dataSource.group().length),h=0;h<y.length;h++){var o,r=y[h],p=t.options.filterable.operators,w=!1,s=n("<th/>"),l=r.field;if(r.hidden&&s.hide(),k.append(s),l&&r.filterable!==!1){if(e=r.filterable&&r.filterable.cell||{},o=t.options.dataSource,o instanceof au&&(o=t.options.dataSource.options),a=f(!0,{},b.messages),r.filterable&&f(!0,a,r.filterable.messages),e.enabled===!1){s.html("&nbsp;");continue}e.dataSource&&(o=e.dataSource,w=!0);r.filterable&&r.filterable.operators&&(p=r.filterable.operators);c={column:r,dataSource:t.dataSource,suggestDataSource:o,customDataSource:w,field:l,messages:a,values:r.values,template:e.template,delay:e.delay,inputWidth:e.inputWidth,suggestionOperator:e.suggestionOperator,minLength:e.minLength,dataTextField:e.dataTextField,operator:e.operator,operators:p,showOperators:e.showOperators,change:d};v&&(c.$angular=v);n("<span/>").attr(i.attr("field"),l).appendTo(s).kendoFilterCell(c)}else s.html("&nbsp;")}}},_sortable:function(){var t=this,l=u(t.columns),n,o,s,h=t.options.sortable,a=function(n){t.trigger("sort",{sort:n.sort})?n.preventDefault():t._clearEditableState()},e,r,c;if(h){for(e=g(t.thead),r=0,c=e.length;r<c;r++)(n=l[r],dsiCommon.isNullOrEmpty(n))||n.sortable!==!1&&!n.command&&n.field&&(s=e.eq(r),o=s.data("kendoColumnSorter"),o&&o.destroy(),s.attr("data-"+i.ns+"field",n.field).kendoColumnSorter(f({},h,n.sortable,{dataSource:t.dataSource,aria:!0,filter:":not(.k-column-active)",change:a})));e=null}},_columns:function(t){var f=this,h=f.table,c,y=h.find("col"),o,l=f.options.dataSource,a;if(t=t.length?t:ei(h.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")),c=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:c,template:t.attr(i.attr("template")),width:y.eq(r).css("width")}}),c=!(f.table.find("tbody tr").length>0&&(!l||!l.transport)),f.options.scrollable){if(a=t,o=s(t),t=vt(t),o.length>0&&t.length===0)throw new Error("There should be at least one non locked column");yo(f.element.find("tr:has(th):first"),a);t=o.concat(t)}if(f.columns=gf(t,c),n.grep(u(f.columns),function(n){return n.selectable}).length){f.options.persistSelection&&(f._selectedIds={});f._checkBoxSelection=!0;f.wrapper.on(v+r,"tbody > tr "+pt,e(f._checkboxClick,f));f.wrapper.on(v+r,"thead > tr "+pt,e(f._headerCheckboxClick,f))}},_headerCheckboxClick:function(t){var i=this,r=n(t.target),f=r.prop("checked"),u=r.closest(".k-grid.k-widget").getKendoGrid();i===u&&(f?i.select(u.items()):i.clearSelection())},_checkboxClick:function(t){var r=this,i=n(t.target).closest("tr"),u=!i.hasClass(dt);r===i.closest(".k-grid.k-widget").getKendoGrid()&&(u?r.select(i):r._deselectCheckRows(i))},_groups:function(){var n=this.dataSource.group();return n?n.length:0},_tmpl:function(n,t,r,u){var s=this,a=f({},i.Template,s.options.templateSettings),d=a.paramName,c,p=t.length,w,v={storage:{},count:0},o,g,b=s._hasDetails(),h=[],k=s._groups(),nt=s.options.navigatable,tt=i.attr("field"),l,y="";if(!n){for(n="<tr",r&&h.push("k-alt"),b&&h.push("k-master-row"),h.push("dsi-selectable-row"),h.length&&(n+=' class="'+h.join(" ")+'"'),p&&(n+=" "+i.attr("uid")+'="#='+i.expr("uid",a.paramName)+'#"'),n+=" role='row'>",k>0&&!u&&(n+=nr(k)),b&&(n+='<td class="k-hierarchy-cell" aria-expanded="false"><a class="k-icon k-i-expand" href="\\#" '+hi+'="'+iu+'" tabindex="-1"><\/a><\/td>'),c=0;c<p;c++)o=t[c],w=o.template,g=typeof w,l=o.field,s._editMode()===wf&&l&&(o.attributes=o.attributes||{},s.virtualScrollable&&(o.attributes[tt]=l),y=s._dirtyCellTemplate(l,d),o.attributes["class"]=o.attributes["class"]||"",o.attributes["class"].indexOf(y)<0&&(o.attributes["class"]+=y)),n+="<td"+gt(o.attributes),nt&&(n+=" aria-describedby='"+o.headerAttributes.id+"'"),o.command&&(n+=' class="k-command-cell"'),n+=" role='gridcell'>",n+=s._cellTmpl(o,v),n+="<\/td>";n+="<\/tr>"}return(n=i.template(n,a),v.count>0)?e(n,v.storage):n},_dirtyCellTemplate:function(n,t){var r;return n&&t?(r=n.indexOf("[")>=0?i.expr(n,t+".dirtyFields"):t+".dirtyFields['"+n+"']","#= "+t+" && "+t+".dirty && "+t+".dirtyFields && "+r+" ? ' k-dirty-cell' : '' #"):""},_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===wt?r=i.template(t,o)({}):u===p&&(r=t),r},_cellTmpl:function(n,t){var o=this,v=f({},i.Template,o.options.templateSettings),c=n.template,h=v.paramName,u=n.field,r="",e,y,l=n.format,w=typeof c,s=n.values;if(n.command){if(kt(n.command)){for(e=0,y=n.command.length;e<y;e++)r+=n.command[e].visible?i.format("#= {0}(data)? '{1}':'' #",n.command[e].visible,o._createButton(n.command[e]).replace(ci,"\\#")):o._createButton(n.command[e]).replace(ci,"\\#");return r}return o._createButton(n.command).replace(ci,"\\#")}return n.selectable?uo:(r+=o._dirtyIndicatorTemplate(u,h),w===wt?(t.storage["tmpl"+t.count]=c,r+="#=this.tmpl"+t.count+"("+h+")#",t.count++):w===p?r+=c:s&&s.length&&a(s[0])&&"value"in s[0]&&u?(r+="#var v ="+i.stringify(se(s)).replace(ci,"\\#")+"#",r+="#var f = v[",v.useWithBlock||(r+=h+"."),r+=u+"]#",r+="${f != null ? f : ''}"):(r+=n.encoded?"#:":"#=",l&&(r+='kendo.format("'+l.replace(to,"\\$1")+'",'),u?(u=i.expr(u,h),r+=u+"==null?'':"+u):r+="''",l&&(r+=")"),r+="#"),r)},_dirtyIndicatorTemplate:function(n,t){var r;return n&&t?(r=n.indexOf("[")>=0?i.expr(n,t+".dirtyFields"):t+".dirtyFields['"+n+"']","#= "+t+" && "+t+".dirty && "+t+".dirtyFields && "+r+" ? '<span class=\"k-dirty\"><\/span>' : '' #"):""},_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(vt(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||pu(r))&&(pu(r)||l.length)&&!y(o,function(n){return n.footerTemplate}).length||(t.footerTemplate=t._footerTmpl(o,r,"footerTemplate","k-footer-template"));c&&y(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>',hf,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+=nr(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"+gt(c.footerAttributes)+">",h?(b!==wt&&(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+=nr(c)),t+='<td class="k-hierarchy-cell"><\/td><td class="k-detail-cell"'+(l?' colspan="'+l+'"':"")+">",v===wt?(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[ar]||[]).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(v+r,".k-hierarchy-cell .k-i-expand, .k-hierarchy-cell .k-i-collapse",function(i){var e=n(this),s=e.closest("td.k-hierarchy-cell"),u=e.hasClass("k-i-expand"),f=e.closest("tr.k-master-row"),r,h=t.detailTemplate,o,c=t._hasDetails(),l=u?tu:iu,a=u?!0:!1;return e.toggleClass("k-i-expand",!u).toggleClass("k-i-collapse",u).attr(hi,l),s.attr("aria-expanded",a),r=f.next(),c&&!r.hasClass("k-detail-row")&&(o=t.dataItem(f),r=n(h(o)).addClass(f.hasClass("k-alt")?"k-alt":"").insertAfter(f),t.angular("compile",function(){return{elements:r.get(),data:[{dataItem:o}]}}),t.trigger(ar,{masterRow:f,detailRow:r,data:o,detailCell:r.find(".k-detail-cell")})),t.trigger(u?ff:ef,{masterRow:f,detailRow:r}),r.toggle(u),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-detail-row/.test(f[i].className)&&r--;for(i=0;i<u;i++)/k-grouping-row|k-group-footer/.test(f[i].className)&&r--;return this._data[r]},expandRow:function(t){n(t).find("> td .k-i-expand").click()},collapseRow:function(t){n(t).find("> td .k-i-collapse").click()},_createHeaderCells:function(n,r){for(var a=this,e,h,f="",y=u(a.columns),l,s,o=0,v=n.length;o<v;o++)e=n[o].column||n[o],h=a._headerCellText(e),l="",s=c(e,y),e.selectable?(f+="<th scope='col'"+gt(e.headerAttributes),r&&!n[o].colSpan&&(f+=" rowspan='"+r+"'"),s>-1&&(f+=i.attr("index")+"='"+s+"'"),h=e.headerTemplate?h:fo,f+=">"+h+"<\/th>"):e.command?(f+="<th scope='col'"+gt(e.headerAttributes),r&&!n[o].colSpan&&(f+=" rowspan='"+r+"'"),s>-1&&(f+=i.attr("index")+"='"+s+"'"),f+=">"+h+"<\/th>"):(e.field&&(l=i.attr("field")+"='"+e.field+"' "),f+="<th scope='col' role='columnheader' "+l,f+=" aria-haspopup='true'",r&&!n[o].colSpan&&(f+=" rowspan='"+r+"'"),n[o].colSpan>1&&(f+='colspan="'+(n[o].colSpan-ii(e.columns))+'" ',f+=i.attr("colspan")+"='"+n[o].colSpan+"'"),e.title&&(f+=i.attr("title")+'="'+e.title.replace('"',"&quot;").replace(/'/g,"'")+'" '),e.groupable!==t&&(f+=i.attr("groupable")+"='"+e.groupable+"' "),e.aggregates&&e.aggregates.length&&(f+=i.attr("aggregates")+"='"+e.aggregates+"'"),s>-1&&(f+=i.attr("index")+"='"+s+"'"),f+=gt(e.headerAttributes),f+=">"+h+"<\/th>");return f},_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-ii(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'+(li?' 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(su(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(h=null,r[i].columns&&(h=s-ii(r[i].columns)),h=h||1,v=0;v<h;v++)w=w.add(a.eq(i+k+v-p));k+=h-1}for(rr([r[i]],yi(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+=ii(r[i].columns));ut(r[i])||p++}if(e.length){for(c='<div class="k-grid-header-locked" style="width:1px"><table'+(li?' 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=so(e[i]),g.eq(i).append(f.thead.find("tr:eq("+i+") .k-group-cell").add(et));return d=ou(this.thead),e.length<d&&lo(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(),!0}return!1},_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,b=t._hasFilterRow(),h,o="",f=t.table.find(">thead"),k=t.element.find("thead:first").length>0,u,c,v,y,w,p;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=k?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 dsi-detail-header" scope="col">'+t.options.messages.expandCollapseColumnHeader+"<\/th>"),o+=t._createHeaderCells(c[h].cells,c[h].rowSpan),o+="<\/tr>";u=n(o)}b&&(v=n("<tr/>"),v.addClass("k-filter-row"),(a||u.find(".k-hierarchy-cell").length)&&v.prepend('<th class="k-hierarchy-cell" scope="col">&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" scope="col">&nbsp;<\/th>'):(o="",a&&(o+='<th class="k-hierarchy-cell" scope="col">&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:ei(l,function(n){return{column:n}})}});t.thead=f.attr("role","rowgroup");t._sortable();t._filterable();t._filterRow();t._scrollable();t._updateCols();t._columnMenu();p=this.options.scrollable&&s(this.columns).length;p&&(w=t._appendLockedColumnHeader(t.thead.closest(".k-grid-header")),t._appendLockedColumnContent(),t.lockedContent.bind("DOMMouseScroll"+r+" mousewheel"+r,e(t._wheelScroll,t)));t._updateColumnCellIndex();t._updateFirstColumnClass();t._resizable();t._draggable();t._reorderable();t._updateHeader(t._groups());p&&(w&&t._syncLockedHeaderHeight(),t._applyLockedContainersWidth());t.groupable&&t._attachGroupable()},_retrieveFirstColumn:function(t,i){var u=n(),r;if(i.length&&t[0]){for(r=t[0];r.columns&&r.columns.length;)r=r.columns[0],i=i.filter(":not(:first())");u=u.add(i)}return u},_updateFirstColumnClass:function(){var t=this,i=t.columns||[],f=t._hasDetails()&&i.length,r,u;f||t._groups()||(r=t.thead.find(">tr:not(.k-filter-row):not(:first)"),i=vt(i),u=t._retrieveFirstColumn(i,r),t._isLocked()&&(r=t.lockedHeader.find("thead>tr:not(.k-filter-row):not(:first)"),i=s(t.columns),u=u.add(t._retrieveFirstColumn(i,r))),u.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(n){var t,u,r;n.ctrlKey||(t=this.content,this.options.scrollable.virtual&&(t=this.virtualScrollable.verticalScrollbar),u=t.scrollTop(),r=i.wheelDeltaY(n),r&&(t[0].scrollHeight>t[0].clientHeight&&(t[0].scrollTop<t[0].scrollHeight-t[0].clientHeight&&r<0||t[0].scrollTop>0&&r>0)&&n.preventDefault(),t.scrollTop(u+-r)))},_isLocked:function(){return this.lockedHeader!=null},_updateHeaderCols:function(){var n=this.thead.parent().add(this.table);this._isLocked()?ri(n,ft(fe(this.columns)),this._hasDetails(),0):ri(n,ft(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),ri(n,ft(su(this.columns)),this._hasDetails(),this._groups()))},_appendCols:function(n,t){t?ri(n,ft(fe(this.columns)),this._hasDetails(),0):ri(n,ft(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 r=this,u="",e=t.rowTemplate,o=t.altRowTemplate,i=0,f=n.length;i<f;i++)r._skipRerenderItemsCount>0?r._skipRerenderItemsCount--:(u+=i%2?o(n[i]):e(n[i]),r._data.push(n[i]));return u},_groupRowHtml:function(n,t,r,e,o,s,h){var c=this,a="",v,tt,b=n.field,p=y(u(c.columns),function(n){return n.field==b})[0]||{},w=p.groupHeaderTemplate,k=(p.title||b)+": "+po(n.value,p.format,p.values,p.encoded),ut=c._groupAggregatesDefaultObject||{},l=n.items,d=f({},ut,n.aggregates),it=f({},{field:n.field,value:n.value,items:l,aggregates:d},n.aggregates[n.field]),rt=o.groupFooterTemplate,g,nt;if(w&&(k=typeof w===wt?w(it):i.template(w)(it)),n.displayDupe||h==1&&!dsiCommon.isNullOrEmpty(c.dataSource.options.dsi)&&b==c.dataSource.options.dsi.dsThis.detailSetGroupingID?a+=ko(t,r,c._rowsHtml([l.shift()],o),l.length>0):c._skipRerenderItemsCount?e(t,r,k):a+=e(t,r,k),n.hasSubgroups)for(v=0,tt=l.length;v<tt;v++)c._skipRerenderItemsCount?c._groupRowHtml(l[v],s?t:t-1,r+1,e,o,s):a+=c._groupRowHtml(l[v],s?t:t-1,r+1,e,o,s);else a+=c._rowsHtml(l,o);if(rt){g={};for(nt in d)g[nt]=f({},d[nt],{group:{field:n.field,value:n.value,items:l}});a+=rt(g)}return a},collapseGroup:function(t){var o,s=this,l=t,a=this.options.groupable,v=a.showFooter,e=v?0:1,h,u=n(),r,c,i,f;for(t=n(t),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()+")"))),o=t.find(".k-group-cell").length,t.find(".k-i-collapse").addClass("k-i-expand").removeClass("k-i-collapse"),t.find("td[aria-expanded='true']:first").attr("aria-expanded",!1).find("a").attr(hi,iu),t=t.nextAll("tr"),f=[],r=0,c=t.length;r<c;r++){if(i=t.eq(r),h=i.find(".k-group-cell").length,i.hasClass("k-grouping-row")?e++:i.hasClass("k-group-footer")&&e--,h<=o||i.hasClass("k-group-footer")&&e<0)break;u.length&&f.push(u[r]);f.push(i[0])}n(f).hide();this.options.scrollable.endless&&this.content&&setTimeout(function(){s.content.scroll();s._groupToCollapse=l})},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-i-expand").addClass("k-i-collapse").removeClass("k-i-expand"),t.find("td[aria-expanded='false']:first").attr("aria-expanded",!0).find("a").attr(hi,tu),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-i-collapse")&&(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" scope="col">'+r.options.messages.expandCollapseColumnHeader+"<\/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" scope="col">&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=ve(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(ve(i.eq(0))))},hideColumn:function(t){var i=this,h=null,it;i.columns.length===1&&!dsiCommon.isNullOrEmpty(i.columns[0].dsi)&&!dsiCommon.isNullOrEmpty(i.columns[0].dsi.columns)&&i.columns[0].dsi.columns.length>0&&(h=i.columns[0].dsi.columns);var ft,l,r,b,v,d,e=0,nt,et,p=i.footer||i.wrapper.find(".k-grid-footer"),s=h==null?i.columns:h,w=i.lockedHeader?g(i.lockedHeader.find(">table>thead")).filter(ni).length:0,f;if(t=typeof t=="number"?s[t]:a(t)?y(tt(s),function(n){return n===t})[0]:y(tt(s),function(n){return n.field===t})[0],t&&ut(t)){if(t.columns&&t.columns.length){for(d=eu(t,s),ai(t,!1),yt(rt(n(">table>thead",i.lockedHeader),i.thead,">tr:eq("+d.row+")>th"),d.cell,!1),r=0;r<t.columns.length;r++)this.hideColumn(t.columns[r]);i.trigger(vr,{column:t});return}if(f=c(t,k(u(s))),ai(t,!1),i._setParentsVisibility(t,!1),i._templates(),i._updateCols(),i._updateLockedCols(),it=i.thead,nt=f,i.lockedHeader&&w>f?it=i.lockedHeader.find(">table>thead"):nt-=w,h==null)if(ft=g(it).filter(ni).eq(nt),ft[0].style.display="none",yt(rt(n(">table>thead",i.lockedHeader),i.thead,">tr.k-filter-row>th"),f,!1),p[0]&&(i._updateCols(p.find(">.k-grid-footer-wrap>table")),i._updateLockedCols(p.find(">.k-grid-footer-locked>table")),yt(p.find(".k-footer-template>td"),f,!1)),i.lockedTable&&w>f?he(i.lockedTable.find(">tbody>tr"),f):he(i.tbody.children(),f-w),i.lockedTable)i._updateTablesWidth(),i._applyLockedContainersWidth(),i._syncLockedContentHeight(),i._syncLockedHeaderHeight(),i._syncLockedFooterHeight();else{for(b=i.thead.prev().find("col"),r=0,et=b.length;r<et;r+=1)if(v=b[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(vr,{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(fu(t,h,o)&&o.length)for(e=o.length-1;e>=0;e--)u=o[e],s=ti(u,h),f=rt(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)&&(ai(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-ii(u.columns)||1)},showColumn:function(t){var i=this,o=null,k;i.columns.length===1&&!dsiCommon.isNullOrEmpty(i.columns[0].dsi)&&!dsiCommon.isNullOrEmpty(i.columns[0].dsi.columns)&&i.columns[0].dsi.columns.length>0&&(o=i.columns[0].dsi.columns);var r,d,nt,v,f,y,p,w,b,e=o==null?i.columns:o,s=i.footer||i.wrapper.find(".k-grid-footer"),h=i.lockedHeader?g(i.lockedHeader.find(">table>thead")).length:0,l;if(typeof t=="number"?(l=t,t=e[t]):a(t)?n.each(tt(e),function(n,i){if(i===t)return t=i,l=n,!1}):n.each(tt(e),function(n,i){if(i.field===t)return t=i,l=n,!1}),t&&!ut(t)){if(t.columns&&t.columns.length){for(p=ti(t,e),originalColumn=tt(i.options.columns)[l],ai(t,!0),yt(rt(n(">table>thead",i.lockedHeader),i.thead,">tr:eq("+p.row+")>th"),p.cell,!0),r=0;r<t.columns.length;r++)originalColumn.columns[r].hidden||this.showColumn(t.columns[r]);i.trigger(yr,{column:t});return}if(columnLeafIndex=c(t,u(e)),ai(t,!0),i._setParentsVisibility(t,!0),i._templates(),i._updateCols(),i._updateLockedCols(),k=i.thead,y=columnLeafIndex,i.lockedHeader&&h>columnLeafIndex?k=i.lockedHeader.find(">table>thead"):y-=h,o==null)if(nt=g(k).eq(y),nt[0].style.display="",yt(rt(n(">table>thead",i.lockedHeader),i.thead,">tr.k-filter-row>th"),columnLeafIndex,!0),s[0]&&(i._updateCols(s.find(">.k-grid-footer-wrap>table")),i._updateLockedCols(s.find(">.k-grid-footer-locked>table")),yt(s.find(".k-footer-template>td"),columnLeafIndex,!0)),i.lockedTable&&h>columnLeafIndex?le(i.lockedTable.find(">tbody>tr"),columnLeafIndex):le(i.tbody.children(),columnLeafIndex-h),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(f=0,b=i.thead.prev().find("col"),r=0,d=b.length;r<d;r+=1){if(w=b[r].style.width,w.indexOf("%")>-1){f=0;break}f+=parseInt(w,10)}i._footerWidth=null;f&&(v.each(function(){this.style.width=f+"px"}),i._footerWidth=f)}else v.width("");i._updateFirstColumnClass();i.trigger(yr,{column:t})}},_progress:function(n){var t=this.element,r=this.options.scrollable&&this.options.scrollable.endless;this._editContainer&&this._editMode()==="popup"?t=this._editContainer:this.lockedContent||r?t=this.wrapper:this.element.is("table")?t=this.element.parent():this.content&&this.content.length&&(t=this.content);r&&n?i.ui.progress(t,n,{height:this.content.height(),top:this.content[0].offsetTop,opacity:!0}):i.ui.progress(t,n)},_resize:function(n,t){this._syncLockedContentHeight();this._syncLockedHeaderHeight();this.content&&(this._setContentWidth(),this._setContentHeight());this.virtualScrollable&&(t||this._rowHeight)&&(t&&(this._rowHeight=null),this.virtualScrollable.repaintScrollbar())},_isActiveInTable:function(){var t=ot();return t?this.table[0]===t||n.contains(this.table[0],t)||this._isLocked()&&(this.lockedTable[0]===t||n.contains(this.lockedTable[0],t)):!1},refresh:function(t){var r=this,f=r.dataSource.view(),a=r.options.navigatable,h,e=n(r.current()),o=!1,u=(r.dataSource.group()||[]).length,s=u+ft(k(r.columns)).length,l;if(!t||t.action!=="itemchange"||!r.editable){if(t&&t.action==="remove"&&r.editable&&r.editable.options.model&&c(r.editable.options.model,t.items)>-1&&r.editable.options.model.unbind(w,r._modelChangeHandler),t=t||{},t.action===ki&&r._isVirtualEditable()){r._destroyEditable();r._clearEditableState();r._restoreVirtualView();return}if(!r.trigger("dataBinding",{action:t.action||"rebind",index:t.index,items:t.items})){if(r._endlessFetchInProgress||(r._angularItems("cleanup"),a&&(r._isActiveInTable()||r._editContainer&&r._editContainer.data("kendoWindow"))&&(o=e.is("th"),h=o?e.index():Math.max(r.cellIndex(e),0)),r._destroyEditable(),r._data=[]),r.options.scrollable&&r.options.scrollable.endless?(clearTimeout(r._progressTimeOut),r._progressTimeOut=setTimeout(function(){r._endlessFetchInProgress||r._progress(!1)},100)):r._progress(!1),r._hideResizeHandle(),r.columns.length||(r._autoColumns(r._firstDataItem(f[0],u)),s=u+r.columns.length),r._group=u>0||r._group,r._group&&(r._templates(),r._updateCols(),r._updateLockedCols(),r._updateHeader(u),r._group=u>0,r._groupRows=hu(f)),r.content&&(l=r.content.scrollLeft()),r._renderContent(f,s,u),r._renderLockedContent(f,s,u),r._footer(),r._renderNoRecordsContent(),r._togglePagerVisibility(),r._setContentHeight(),r._setContentWidth(r.content&&l),r.lockedTable)if(r.options.scrollable.virtual)r.content.find(">.k-virtual-scrollable-wrap").trigger("scroll");else if(r.touchScroller)r.touchScroller.movable.trigger("change");else{r.wrapper.one("scroll",function(n){n.stopPropagation()});r.content.trigger("scroll")}r._endlessFetchInProgress||r._restoreCurrent(h,o);r.touchScroller&&r.touchScroller.contentResized();r.selectable&&r.selectable.resetTouchEvents();r._muteAngularRebind(function(){r._angularItems("compile")});r._checkBoxSelection&&r._toggleHeaderCheckState(!1);r.options.persistSelection&&(r.selectable&&!i.ui.Selectable.parseOptions(r.options.selectable).cell||r._checkBoxSelection)&&r._restoreSelection();r.trigger(pr)}}},_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&&b(this._current.closest("table")[0],!0))},_restoreSelection:function(){var n=this,i=n.items(),t;t=y(i,function(t){var i=n.dataItem(t)[n.dataSource.options.schema.model.id];if(n._selectedIds[i])return t});n.select(t)},_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(hu(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(ce(i.dataSource.view()),function(n){return{dataItem:n}})}})},_renderContent:function(n,t,i){var r=this,u,o,f="",e=r.lockedContent!=null,s=null,h=r.options.scrollable,c={rowTemplate:r.rowTemplate,altRowTemplate:r.altRowTemplate,groupFooterTemplate:r.groupFooterTemplate};if(h&&h.endless&&!r.dataSource.options.endless&&(r._skipRerenderItemsCount=0,r.content&&(r.content[0].scrollTop=0)),s=r._skipRerenderItemsCount>0,t=e?t-ft(su(r.columns)).length:t,i>0)for(t=e?t-i:t,r.detailTemplate&&t++,r.groupFooterTemplate&&(r._groupAggregatesDefaultObject=r.dataSource.aggregates()),u=0,o=n.length;u<o;u++)f+=r._groupRowHtml(n[u],t,0,e?go:we,c,e,i);else f+=r._rowsHtml(n,c);s?(r.tbody.append(f),setTimeout(function(){r._groupToCollapse&&(r.collapseGroup(r._groupToCollapse),r._groupToCollapse=null)}),r._endlessFetchInProgress=null):r.tbody=oe(r.tbody,r.table,f,this.options.$angular)},_renderLockedContent:function(n,i,r){var e="",f,s,h={rowTemplate:this.lockedRowTemplate,altRowTemplate:this.lockedAltRowTemplate,groupFooterTemplate:this.lockedGroupFooterTemplate},o;if(this.lockedContent){if(o=this.lockedTable,r>0)for(i=i-k(u(vt(this.columns))).length,f=0,s=n.length;f<s;f++)e+=this._groupRowHtml(n[f],i,0,we,h,t,r);else e=this._rowsHtml(n,h);oe(o.children("tbody"),o,e,this.options.$angular);this._syncLockedContentHeight()}},_togglePagerVisibility:function(){this.options.pageable.alwaysVisible===!1&&this.wrapper.find(".k-grid-pager").toggle(this.dataSource.total()>=this.dataSource.pageSize())},_adjustRowsHeight:function(n,t){for(var r=n[0].rows,f=r.length,u=t[0].rows,e=n.add(t),l=e.length,o=[],i=0;i<f;i++){if(!u[i])break;r[i].style.height&&(r[i].style.height=u[i].style.height="")}for(i=0;i<f;i++){if(!u[i])break;var s=r[i].offsetHeight,h=u[i].offsetHeight,c=0;s>h?c=s:s<h&&(c=h);o.push(c)}for(i=0;i<l;i++)e[i].style.display="none";for(i=0;i<f;i++)o[i]&&(r[i].style.height=u[i].style.height=o[i]+1+"px");for(i=0;i<l;i++)e[i].style.display=""}});i.ExcelMixin&&i.ExcelMixin.extend(ui.prototype);i.PDFMixin&&(i.PDFMixin.extend(ui.prototype),ui.prototype._drawPDF_autoPageBreak=function(r){function p(){if(s&&c!==t){u.one("change",v);u.page(c)}else f.refresh(),v()}function v(){h.appendTo(document.body);var t=n.extend({},f.options.pdf,{_destructive:!0,progress:function(n){r.notify({page:n.page,pageNumber:n.pageNum,progress:.5+n.pageNum/n.totalPages/2,totalPages:n.totalPages})}});i.drawing.drawDOM(e,t).always(function(){h.remove()}).then(function(n){o.resolve(n)}).fail(function(n){o.reject(n)})}function l(){var n=u.page(),t=s?u.totalPages():1;a.append(y.find("tr"));n<t?u.page(n+1):(u.unbind("change",l),p())}var f=this,o=new n.Deferred,u=f.dataSource,s=f.options.pdf.allPages,y=f.wrapper.find('table[role="grid"] > tbody'),h=n("<div>").css({position:"absolute",left:-1e4,top:-1e4}),e=f.wrapper.clone().css({height:"auto",width:"auto"}).appendTo(h),a,c;return e.find(".k-grid-content").css({height:"auto",width:"auto",overflow:"visible"}),e.find('table[role="grid"], .k-grid-footer table').css({height:"auto",width:"100%",overflow:"visible"}),e.find(".k-grid-pager, .k-grid-toolbar, .k-grouping-header").remove(),e.find(".k-grid-header, .k-grid-footer").css({paddingRight:0}),this._initPDFProgress(r),a=e.find('table[role="grid"] > tbody').empty(),c=u.page(),s?(u.bind("change",l),u.page(1)):l(),o.promise()},ui.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 f=this,o,h;if(f.options.pdf.paperSize&&f.options.pdf.paperSize!="auto")return f._drawPDF_autoPageBreak(r);var e=new n.Deferred,u=f.dataSource,s=f.options.pdf.allPages;return this._initPDFProgress(r),o=new i.drawing.Group,h=u.page(),s?(u.bind("change",c),u.page(1)):c(),e.promise()},ui.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()})});et.plugin(ui);et.plugin(kf)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.listview",["kendo.data","kendo.editable","kendo.selectable"],n)}(function(){return function(n,t){var i=window.kendo,f="change",c="cancel",l="dataBound",a="dataBinding",o=i.ui.Widget,r=i.keys,v=">*:not(.k-loading-mask)",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,{action:n.action||"rebind",items:n.items,index:n.index})}},_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,.listViewItem,.listViewItem-hover,.action-menu,.action-menu>div,a>div")||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,:password"),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),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.listbox",["kendo.draganddrop","kendo.data","kendo.selectable"],n)}(function(){return function(n,t){function vt(t){return n.map(t,function(t){return n(t).index()})}function si(n){return typeof n=="undefined"}function yr(n){return n.clone().removeClass(g).removeClass(l).addClass(i.format("{0} {1} {2}",w,er,ir)).width(n.width())}function hi(){return n("<li>").addClass(rr)}var i=window.kendo,k=i.attr,wi=i.data,u=i.keys,bi=i.template,ki=i.ui.Widget,di=wi.DataSource,kt=i.ui.Selectable,dt=i.ui.DataBoundWidget,rt=i.Class,s=n.extend,e=n.noop,f=n.proxy,p="-",gt=".",gi=" ",ni="#",d="kendoListBox",v=gt+d,h="k-state-disabled",w="k-state-selected",o=".k-item:not(.k-state-disabled)",nr=".k-list:not(.k-state-disabled) >"+o,c="k-listbox-toolbar",tr="li > a.k-button:not(.k-state-disabled)",l="k-state-focused",ir="k-drag-clue",rr="k-drop-hint",ur="k-reset k-list",fr=".k-reset.k-list",er="k-reset",ti="click"+v,or="keydown"+v,sr="blur"+v,hr=i._outerWidth,cr=i._outerHeight,y="change",ii="dataBound",ut="add",a="remove",ft="reorder",et="moveUp",ot="moveDown",st="transferTo",ht="transferFrom",ct="transferAllTo",lt="transferAllFrom",g="k-ghost",nt="uid",at="tabindex",lr="command",ri="dragstart",ui="drag",fi="drop",ei="dragend",ar="ul.k-reset.k-list>li.k-item",tt="right",oi="bottom",vr=[c+p+"left",c+p+tt,c+p+"top",c+p+oi],ci=dt.extend({init:function(n,t){var i=this;ki.fn.init.call(i,n,t);i._wrapper();i._list();n=i.element.attr("multiple","multiple").hide();n[0]&&!i.options.dataSource&&(i.options.dataTextField=i.options.dataTextField||"text",i.options.dataValueField=i.options.dataValueField||"value");i._templates();i._selectable();i._dataSource();i._createToolbar();i._createDraggable();i._createNavigatable()},destroy:function(){var n=this;dt.fn.destroy.call(n);isNaN(n._listTabIndex)||(n._getList().off(),n._listTabIndex=null);n._unbindDataSource();n._destroySelectable();n._destroyToolbar();n.wrapper.off(v);n._target&&(n._target=null);n._draggable&&(n._draggable.destroy(),n.placeholder=null);i.destroy(n.element)},events:[y,ii,ut,a,ft,ri,ui,fi,ei],options:{name:"ListBox",autoBind:!0,template:"",dataTextField:"",dataValueField:"",selectable:"single",draggable:null,dropSources:[],connectWith:"",navigatable:!0,toolbar:{position:tt,tools:[]},messages:{tools:{remove:"Delete",moveUp:"Move Up",moveDown:"Move Down",transferTo:"Transfer To",transferFrom:"Transfer From",transferAllTo:"Transfer All To",transferAllFrom:"Transfer All From"}}},add:function(n){var t=this,r=n&&n.length?n:[n],u=r.length,i;for(t._unbindDataSource(),i=0;i<u;i++)t._addItem(r[i]);t._bindDataSource();t._syncElement()},_addItem:function(t){var i=this,r=i.templates.itemTemplate({item:t,r:i.templates.itemContent});n(r).attr(k(nt),t.uid).appendTo(i._getList());typeof t=="string"?i.dataSource._data.push(t):i.dataSource.add(t)},_addItemAt:function(t,i){var r=this,u=r.templates.itemTemplate({item:t,r:r.templates.itemContent});r._unbindDataSource();typeof t=="string"?(r._insertElementAt(u,i),r.dataSource._data.push(t)):(r._insertElementAt(n(u).attr(k(nt),t.uid),i),r.dataSource.add(t));r._bindDataSource();r._syncElement()},_insertElementAt:function(t,i){var u=this,r=u._getList();i>0?n(t).insertAfter(r.children().eq(i-1)):n(r).prepend(t)},_createNavigatable:function(){var n=this,t=n.options;if(t.navigatable)n._getList().on(ti,o,f(n._click,n)).on(or,f(n._keyDown,n)).on(sr,f(n._blur,n))},_getTabIndex:function(){var n=this,t;return isNaN(n._listTabIndex)?(t=n.element.attr(at),n._listTabIndex=isNaN(t)?0:t,n.element.removeAttr(at),n._listTabIndex):n._listTabIndex},_blur:function(){this._target&&(this._target.removeClass(l),this._getList().removeAttr("aria-activedescendant"));this._target=null},_click:function(t){var r=this,u=n(t.currentTarget),f=r._target;f&&f.removeClass(l);r._target=u;u.addClass(l);r._getList().attr("aria-activedescendant",u.attr("id"));r._getList()[0]!==i._activeElement()&&r.focus()},_getNavigatableItem:function(n){var t=this,i;return i=t._target?t._target:t.items().filter(o).first(),n===u.UP&&t._target&&(i=t._target.prevAll(o).first()),n===u.DOWN&&t._target&&(i=t._target.nextAll(o).first()),i.length?i:null},_scrollIntoView:function(n){if(n){n[0]&&(n=n[0]);var i=this._getList().parent()[0],r=n.offsetTop,t=i.scrollTop,u=i.clientHeight,f=r+n.offsetHeight;t>r?t=r:f>t+u&&(t=f-u);i.scrollTop=t}},_keyDown:function(n){var t=this,i=n.keyCode,r=t._getNavigatableItem(i),f;if(t._target&&t._target.removeClass(l),n.shiftKey&&!n.ctrlKey&&(i===u.DOWN||i===u.UP)||(t._shiftSelecting=!1),i==u.DELETE)t._executeCommand(a),t._target&&(t._target.removeClass(l),t._getList().removeAttr("aria-activedescendant"),t._target=null),f=!0;else if(i===u.DOWN||i===u.UP){if(!r){n.preventDefault();return}if(n.shiftKey&&!n.ctrlKey)t._shiftSelecting||(t.clearSelection(),t._shiftSelecting=!0),t._target&&r.hasClass("k-state-selected")?(t._target.removeClass(w),t.trigger(y)):t.options.selectable=="single"?t.select(r):t.select(r.add(t._target));else{if(n.shiftKey&&n.ctrlKey){t._executeCommand(i===u.DOWN?ot:et);t._scrollIntoView(t._target);n.preventDefault();return}n.shiftKey||n.ctrlKey||(t.options.selectable==="multiple"&&t.clearSelection(),t.select(r))}t._target=r;t._target?(t._target.addClass(l),t._scrollIntoView(t._target),t._getList().attr("aria-activedescendant",t._target.attr("id"))):t._getList().removeAttr("aria-activedescendant");f=!0}else i==u.SPACEBAR?(n.ctrlKey&&t._target?t._target.hasClass(w)?(t._target.removeClass(w),t.trigger(y)):t.select(t._target):(t.clearSelection(),t.select(t._target)),f=!0):n.ctrlKey&&i==u.RIGHT?(n.shiftKey?t._executeCommand(ct):t._executeCommand(st),t._target=t.select().length?t.select():null,f=!0):n.ctrlKey&&i==u.LEFT&&(n.shiftKey?t._executeCommand(lt):t._executeCommand(ht),f=!0);f&&n.preventDefault()},focus:function(){i.focusElement(this._getList())},_createDraggable:function(){var t=this,u=t.options.draggable,r;if(u){if(r=u.hint,!t.options.selectable)throw new Error("Dragging requires selection to be enabled");r||(r=yr);t._draggable=new i.ui.Draggable(t.wrapper,{filter:u.filter?u.filter:ar,hint:i.isFunction(r)?r:n(r),dragstart:f(t._dragstart,t),dragcancel:f(t._clear,t),drag:f(t._drag,t),dragend:f(t._dragend,t)})}},_dragstart:function(t){var r=this,u=r.draggedElement=t.currentTarget,f=r.options.draggable.placeholder,e=r.dataItem(u),o={dataItems:e,items:n(u),draggableEvent:t};if(r.options.draggable.enabled===!1){t.preventDefault();return}f||(f=hi);r.placeholder=i.isFunction(f)?n(f.call(r,u)):n(f);u.is(gt+h)?t.preventDefault():r.trigger(ri,o)?t.preventDefault():(r.clearSelection(),r.select(u),u.addClass(g))},_clear:function(){this.draggedElement.removeClass(g);this.placeholder.remove()},_findElementUnderCursor:function(t){var r=i.elementUnderCursor(t),u=t.sender;return(n.contains(u.hint[0],r)||u.hint[0]===r)&&(u.hint.hide(),r=i.elementUnderCursor(t),u.hint.show()),r},_findTarget:function(t){var r=this,i=r._findElementUnderCursor(t),e=n(i),f=r._getList(),o,u;return n.contains(f[0],i)?(o=r.items(),i=e.is("li")?i:e.closest("li")[0],u=o.filter(i)[0]||o.has(i)[0],u?(u=n(u),u.hasClass(h)?null:{element:u,listBox:r}):null):f[0]==i||f.parent()[0]==i?{element:n(f),appendToBottom:!0,listBox:r}:r._searchConnectedListBox(e)},_getElementCenter:function(n){var t=n.length?i.getOffset(n):null;return t&&(t.top+=cr(n)/2,t.left+=hr(n)/2),t},_searchConnectedListBox:function(t){var i,u,r,e=t,f;if(f=t.hasClass("k-list-scroller k-selectable")?t:t.closest(".k-list-scroller.k-selectable"),f.length)i=f.parent().find("[data-role='listbox']").getKendoListBox();else return null;return i&&n.inArray(this.element[0].id,i.options.dropSources)!==-1?(u=i.items(),t=t.is("li")?t[0]:t.closest("li")[0],r=u.filter(t)[0]||u.has(t)[0],r?(r=n(r),r.hasClass(h)?null:{element:r,listBox:i}):!u.length||e.hasClass("k-list-scroller k-selectable")||e.hasClass("k-reset k-list")?{element:i._getList(),listBox:i,appendToBottom:!0}:null):null},_drag:function(t){var i=this,u=i.draggedElement,r=i._findTarget(t),s={left:t.x.location,top:t.y.location},h=i.dataItem(u),c={dataItems:[h],items:n(u),draggableEvent:t},e,o,f;if(i.trigger(ui,c)){t.preventDefault();return}if(r){if(e=this._getElementCenter(r.element),o={left:Math.round(s.left-e.left),top:Math.round(s.top-e.top)},r.appendToBottom){i._movePlaceholder(r,null,u);return}o.top<0?f="prev":o.top>0&&(f="next");f&&r.element[0]!=i.placeholder[0]&&i._movePlaceholder(r,f,u)}else i.placeholder.parent().length&&i.placeholder.remove()},_movePlaceholder:function(t,r,u){var f=this,o=f.placeholder,e=t.listBox.options.draggable;o.parent().length&&(f.placeholder.remove(),f.placeholder=e&&e.placeholder?i.isFunction(e.placeholder)?n(e.placeholder.call(f,u)):n(e.placeholder):n(hi.call(f,u)));r?r==="prev"?t.element.before(f.placeholder):r==="next"&&t.element.after(f.placeholder):t.element.append(f.placeholder)},_dragend:function(t){var i=this,r=i.draggedElement,o=i.items(),f=o.not(i.draggedElement).index(i.placeholder),h=o.not(i.placeholder).index(i.draggedElement),c=i.dataItem(r),u={dataItems:[c],items:n(r)},e=i.placeholder.closest(".k-widget.k-listbox").find("[data-role='listbox']").getKendoListBox();if(i.trigger(fi,s({},u,{draggableEvent:t}))){t.preventDefault();this._clear();return}f>=0?f===h||i.trigger(ft,s({},u,{offset:f-h}))||(r.removeClass(g),i.reorder(r,f)):e&&(i.trigger(a,u)||i.remove(n(r)),e.trigger(ut,u)||e._addItemAt(c,e.items().index(i.placeholder)));i._clear();i._draggable.dropped=!0;i.trigger(ei,s({},u,{draggableEvent:t}));i._updateToolbar();i._updateAllToolbars()},reorder:function(t,i){var r=this,f=r.dataSource,e=r.dataItem(t),o=f.at(i),s=r.items()[i],u=n(t);e&&s&&o&&(r._removeElement(u),r._insertElementAt(u,i),r._updateToolbar())},remove:function(t){var i=this,u=i._getItems(t),f=u.length,r;for(i._unbindDataSource(),r=0;r<f;r++)i._removeItem(n(u[r]));i._bindDataSource();i._syncElement();i._updateToolbar();i._updateAllToolbars()},_removeItem:function(n){var u=this,f=u.dataSource,r=u.dataItem(n),t,i;if(r&&f){if(typeof r=="string"){for(t=f._data,i=0;i<t.length;i++)if(r===t[i]){t[i]=t[t.length-1];t.pop();break}}else f.remove(r);u._removeElement(n)}},_removeElement:function(t){i.destroy(t);n(t).off().remove()},dataItem:function(t){var i=k(nt),r=n(t).attr(i)||n(t).closest("["+i+"]").attr(i);return r?this.dataSource.getByUid(r):n(t).html()},_dataItems:function(t){for(var r=[],u=n(t),f=u.length,i=0;i<f;i++)r.push(this.dataItem(u.eq(i)));return r},items:function(){var n=this._getList();return n.children()},select:function(n){var r=this,t=r.selectable,i;return si(n)?t.value():(i=r.items().filter(n).filter(nr),t.options.multiple||(t.clear(),i=i.first()),t.value(i))},clearSelection:function(){var t=this,n=t.selectable;n&&n.clear()},enable:function(t,i){for(var u=this,e=si(i)?!0:!!i,f=u._getItems(t),o=f.length,r=0;r<o;r++)u._enableItem(n(f[r]),e);u._updateAllToolbars()},_enableItem:function(t,i){var r=this,u=r.dataItem(t);u&&(i?n(t).removeClass(h):n(t).addClass(h).removeClass(w))},setDataSource:function(n){var t=this;t.options.dataSource=n;t._dataSource()},_dataSource:function(){var t=this,r=t.options,i=r.dataSource||{};i=n.isArray(i)?{data:i}:i;i.select=t.element;i.fields=[{field:r.dataTextField},{field:r.dataValueField}];t._unbindDataSource();t.dataSource=di.create(i);t._bindDataSource();t.options.autoBind&&t.dataSource.fetch()},_bindDataSource:function(){var n=this,t=n.dataSource;n._dataChangeHandler=f(n.refresh,n);t&&t.bind(y,n._dataChangeHandler)},_unbindDataSource:function(){var n=this,t=n.dataSource;t&&t.unbind(y,n._dataChangeHandler)},_wrapper:function(){var r=this,t=r.element,i=t.parent("div.k-listbox");i[0]||(i=t.wrap('<div class="k-widget k-listbox" deselectable="on" />').parent(),i[0].style.cssText=t[0].style.cssText,i[0].title=t[0].title,n('<div class="k-list-scroller" />').insertBefore(t));r.wrapper=i.addClass(t[0].className).css("display","");r._innerWrapper=n(i[0].firstChild)},_list:function(){var t=this;n("<ul class='"+ur+"' role='listbox'><\/ul>").appendTo(t._innerWrapper);t.options.navigatable&&t._getList().attr(at,t._getTabIndex())},_templates:function(){var r=this,n=this.options,t;t=n.template&&typeof n.template=="string"?i.template(n.template):n.template?n.template:i.template("${"+i.expr(n.dataTextField,"data")+"}",{useWithBlock:!1});r.templates={itemTemplate:i.template("# var item = data.item, r = data.r; # <li class='k-item' role='option' aria-selected='false'>#=r(item)#<\/li>",{useWithBlock:!1}),itemContent:t,toolbar:"<div class='"+c+"'><\/div>"}},refresh:function(){for(var n=this,i=n.dataSource.view(),u=n.templates.itemTemplate,r="",t=0;t<i.length;t++)r+=u({item:i[t],r:n.templates.itemContent});n._getList().html(r);n._setItemIds();n._createToolbar();n._syncElement();n._updateToolbar();n._updateAllToolbars();n.trigger(ii)},_syncElement:function(){for(var i="",t=this.dataSource.view(),n=0;n<t.length;n++)i+=this._option(t[n][this.options.dataValueField]||t[n],t[n][this.options.dataTextField]||t[n],!0);this.element.html(i)},_option:function(n,r){var u="<option";return n!==t&&(n+="",n.indexOf('"')!==-1&&(n=n.replace(/"/g,"&quot;")),u+=' value="'+n+'"'),u+=" selected>",r!==t&&(u+=i.htmlEncode(r)),u+"<\/option>"},_setItemIds:function(){for(var i=this,r=i.items(),t=i.dataSource.view(),u=t.length,n=0;n<u;n++)r.eq(n).attr(k(nt),t[n].uid).attr("id",t[n].uid)},_selectable:function(){var n=this,i=n.options.selectable,t=kt.parseOptions(i);t.multiple&&n.element.attr("aria-multiselectable","true");n.selectable=new kt(n._innerWrapper,{aria:!0,multiple:t.multiple,filter:o,change:f(n._onSelect,n)})},_onSelect:function(){var n=this;n._updateToolbar();n._updateAllToolbars();n.trigger(y)},_destroySelectable:function(){var n=this;n.selectable&&n.selectable.element&&(n.selectable.destroy(),n.selectable=null)},_getList:function(){return this.wrapper.find(fr)},_getItems:function(n){return this.items().filter(n)},_createToolbar:function(){var t=this,i=t.options.toolbar,r=i.position||tt,e=r===oi?"insertAfter":"insertBefore",u=i.tools||[],o=t.options.messages,f;t._destroyToolbar();t.wrapper.removeClass(vr.join(gi));u.length&&u.length>0&&(f=n(t.templates.toolbar)[e](t._innerWrapper),t.toolbar=new b(f,s({},i,{listBox:t,messages:o})),t.wrapper.addClass(c+p+r))},_destroyToolbar:function(){var n=this;n.toolbar&&(n.toolbar.destroy(),n.toolbar=null)},_executeCommand:function(n){var t=this,i=r.current.create(n,{listBox:t});i&&(i.execute(),t._updateToolbar(),t._updateAllToolbars())},_updateToolbar:function(){var n=this.toolbar;n&&n._updateToolStates()},_updateAllToolbars:function(){for(var r=n("select[data-role='listbox']"),u=r.length,i,t=0;t<u;t++)i=n(r[t]).data(d),i&&i._updateToolbar()}}),r,it,li,yt,ai,vi,pt,wt,bt,yi,pi,b;i.ui.plugin(ci);r=rt.extend({init:function(){this._commands=[]},register:function(n,t){this._commands.push({commandName:n,commandType:t})},create:function(n,t){for(var f=this._commands,e=f.length,o=n?n.toLowerCase():"",r,u,i=0;i<e;i++)if(u=f[i],u.commandName.toLowerCase()===o){r=u;break}if(r)return new r.commandType(t)}});r.current=new r;it=rt.extend({init:function(n){var t=this;t.options=s({},t.options,n);t.listBox=t.options.listBox},options:{listBox:null},getItems:function(){return n(this.listBox.select())},execute:e,canExecute:e});li=it.extend({execute:function(){var i=this,n=i.listBox,t=i.getItems();n.trigger(a,{dataItems:n._dataItems(t),items:t})||n.remove(t)},canExecute:function(){return this.listBox.select().length>0}});r.current.register(a,li);yt=it.extend({execute:function(){var n=this;n.canExecute()&&n.moveItems()},canExecute:e,moveItems:function(){var t=this,r=t.listBox,u=t.options,f=t.getItems(),e=u.offset,o=vt(f),i=n.makeArray(f.sort(t.itemComparer)),s=u.moveAction,h;if(!r.trigger(ft,{dataItems:r._dataItems(i),items:n(i),offset:e}))while(i.length>0&&o.length>0)h=i[s](),r.reorder(h,o[s]()+e)},options:{offset:0,moveAction:"pop"},itemComparer:function(t,i){var r=n(t).index(),u=n(i).index();return r===u?0:r>u?1:-1}});ai=yt.extend({options:{offset:-1,moveAction:"shift"},canExecute:function(){var t=this.getItems(),n=vt(t);return n.length>0&&n[0]>0}});r.current.register(et,ai);vi=yt.extend({options:{offset:1,moveAction:"pop"},canExecute:function(){var t=this,r=t.getItems(),i=vt(r);return i.length>0&&n(i).last()[0]<t.listBox.items().length-1}});r.current.register(ot,vi);pt=it.extend({options:{filter:o},execute:function(){var n=this,i=n.getSourceListBox(),t=n.getItems().filter(n.options.filter),r=i?i._dataItems(t):[],u=n.getDestinationListBox(),f=n.getUpdatedSelection(t);u&&t.length>0&&(u.trigger(ut,{dataItems:r,items:t})||u.add(r),i.trigger(a,{dataItems:r,items:t})||(i.remove(t),n.updateSelection(f)))},getUpdatedSelection:function(t){var r=this,i=r.options.filter,u=r.getSourceListBox(),e=u?u.items().filter(i).last():null,o=n(t).filter(e).length>0,f=o?n(t).prevAll(i)[0]:n(t).nextAll(i)[0];return n(t).length===1&&f?f:null},updateSelection:function(t){var i=this.getSourceListBox();i&&t&&(n(i.select(n(t))),i._scrollIntoView(t))},getSourceListBox:e,getDestinationListBox:e});wt=pt.extend({canExecute:function(){var n=this.getSourceListBox();return n?n.select().length>0:!1},getSourceListBox:function(){return this.listBox},getDestinationListBox:function(){var t=this.getSourceListBox();return t&&t.options.connectWith?n(ni+t.options.connectWith).data(d):null},getItems:function(){var t=this.getSourceListBox();return t?n(t.select()):n()}});r.current.register(st,wt);bt=pt.extend({canExecute:function(){var n=this.getSourceListBox();return n?n.select().length>0:!1},getSourceListBox:function(){var t=this.getDestinationListBox();return t&&t.options.connectWith?n(ni+t.options.connectWith).data(d):null},getDestinationListBox:function(){return this.listBox},getItems:function(){var t=this.getSourceListBox();return t?n(t.select()):n()}});r.current.register(ht,bt);yi=wt.extend({canExecute:function(){var n=this.getSourceListBox();return n?n.items().filter(o).length>0:!1},getItems:function(){var t=this.getSourceListBox();return t?t.items():n()},getUpdatedSelection:e,updateSelection:e});r.current.register(ct,yi);pi=bt.extend({canExecute:function(){var n=this.getSourceListBox();return n?n.items().filter(o).length>0:!1},getItems:function(){var t=this.getSourceListBox();return t?t.items():n()},getUpdatedSelection:e,updateSelection:e});r.current.register(lt,pi);b=rt.extend({init:function(t,i){var r=this;r.element=n(t).addClass(c);r.options=s({},r.options,i);r.listBox=r.options.listBox;r._initTemplates();r._createTools();r._updateToolStates();r._attachEventHandlers()},destroy:function(){var n=this;n._detachEventHandlers();i.destroy(n.element);n.element.remove();n.element=null},options:{position:tt,tools:[]},_initTemplates:function(){this.templates={tool:bi("<li><a href='\\\\#' class='k-button k-button-icon' data-command='#= command #' title='#= text #' aria-label='#= text #' role='button'><span class='k-icon #= iconClass #'><\/span><\/a><\/li>")}},_createTools:function(){for(var t=this,r=t.options.tools,e=r.length,o=t.options.messages.tools,f=t._createToolList(),u,i=0;i<e;i++)u=s({},b.defaultTools[r[i]],{text:o[r[i]]}),u&&f.append(n(t.templates.tool(u)));t.element.append(f)},_createToolList:function(){return n("<ul class='k-reset' />")},_attachEventHandlers:function(){var n=this;n.element.on(ti,tr,f(n._onToolClick,n))},_detachEventHandlers:function(){this.element.off(v).find("*").off(v)},_onToolClick:function(t){t.preventDefault();this._executeToolCommand(n(t.currentTarget).data(lr))},_executeToolCommand:function(n){var i=this,t=i.listBox;t&&t._executeCommand(n)},_updateToolStates:function(){for(var t=this,i=t.options.tools,r=i.length,n=0;n<r;n++)t._updateToolState(i[n])},_updateToolState:function(t){var f=this,i=r.current.create(t,{listBox:f.listBox}),u=f.element.find("[data-command='"+t+"']")[0];u&&i&&i.canExecute&&(i.canExecute()?n(u).removeClass(h):n(u).addClass(h))}});b.defaultTools={remove:{command:a,iconClass:"k-i-x"},moveUp:{command:et,iconClass:"k-i-arrow-60-up"},moveDown:{command:ot,iconClass:"k-i-arrow-60-down"},transferTo:{command:st,iconClass:"k-i-arrow-60-right"},transferFrom:{command:ht,iconClass:"k-i-arrow-60-left"},transferAllTo:{command:ct,iconClass:"k-i-arrow-double-60-right"},transferAllFrom:{command:lt,iconClass:"k-i-arrow-double-60-left"}};s(ci,{ToolBar:b})}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.upload",["kendo.core"],n)}(function(){return function(n,t){function ct(t){return n.map(lt(t),function(n){return n.name}).join(", ")}function lt(n){var t=n[0];return t.files?at(t.files):[{name:ui(t.value),extension:vt(t.value),size:null}]}function at(t){return n.map(t,function(n){return ri(n)})}function ri(n){var t=n.name||n.fileName;return{name:i.htmlEncode(t),extension:vt(t),size:typeof n.size=="number"?n.size:n.fileSize,rawFile:n}}function vt(n){var t=n.match(ni);return t?t[0]:""}function ui(n){var t=n.lastIndexOf("\\");return t!=-1?n.substr(t+1):n}function g(t,r){var u=i.guid();return n.map(t,function(n){return n.uid=r?i.guid():u,n})}function yt(n,t){for(var r=fi(t.allowedExtensions),u=t.maxFileSize,f=t.minFileSize,i=0;i<n.length;i++)ei(n[i],r),oi(n[i],f,u)}function fi(t){return n.map(t,function(n){var t=n.substring(0,1)==="."?n:"."+n;return t.toLowerCase()})}function ei(t,i){i.length>0&&i.indexOf(t.extension.toLowerCase())<0&&(t.validationErrors=t.validationErrors||[],n.inArray(st,t.validationErrors)===-1&&t.validationErrors.push(st))}function oi(t,i,r){i!==0&&t.size<i&&(t.validationErrors=t.validationErrors||[],n.inArray(ot,t.validationErrors)===-1&&t.validationErrors.push(ot));r!==0&&t.size>r&&(t.validationErrors=t.validationErrors||[],n.inArray(et,t.validationErrors)===-1&&t.validationErrors.push(et))}function pt(n){var t=0,i;if(typeof n[0].size=="number")for(i=0;i<n.length;i++)n[i].size&&(t+=n[i].size);else return"";return t/=1024,t<1024?t.toFixed(2)+" KB":(t/1024).toFixed(2)+" MB"}function wt(t){return!t.multiple&&n(".k-file",t.wrapper).length>1}function bt(t,i,r,u){if(!i._supportsRemove()){(wt(i)||!u)&&i._removeFileEntry(t);return}var f=t.data("fileNames"),e=n.map(f,function(n){return n.name});if(u===!1){i._removeFileEntry(t);return}i._submitRemove(e,r,function(n,r,u){var e=i.trigger(p,{operation:"remove",files:f,response:n,XMLHttpRequest:u});e||i._removeFileEntry(t)},function(n){wt(i)&&i._removeFileEntry(t);i.trigger(s,{operation:"remove",files:f,XMLHttpRequest:n});a("Server response: "+n.responseText)})}function kt(t,i,r){var u=!1,f="";try{f=n.parseJSON(dt(t));u=!0}catch(e){r()}u&&i(f)}function dt(n){return(typeof n=="undefined"||n==="")&&(n="{}"),n}function nt(n){n.stopPropagation();n.preventDefault()}function tt(n,t,i,r){var u,f;n.on("dragenter"+t,function(n){i(n);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 gt(n){return n.is(".k-file-progress, .k-file-success, .k-file-error")}function u(t){return n(t.target).closest(".k-file")}var i=window.kendo,o=i.ui.Widget,l=i.antiForgeryTokens,a=i.logToConsole,ni=/\.([^\.]+)$/,f=".kendoUpload",v="select",y="upload",p="success",s="error",it="complete",h="cancel",rt="clear",w="pause",ut="resume",ft="progress",r="remove",e="validationErrors",et="invalidMaxFileSize",ot="invalidMinFileSize",st="invalidFileExtension",ti=1e3,ii=2e3,c={loading:"k-i-loading",warning:"k-i-warning",success:"k-i-check"},b=o.extend({init:function(t,r){var u=this,e,s,h;o.fn.init.call(u,t,r);u.name=t.name;u.multiple=u.options.multiple;u.directory=u.options.directory;u.localization=u.options.localization;e=u.element;u.wrapper=e.closest(".k-upload");u.wrapper.length===0&&(u.wrapper=u._wrapInput(e));u._activeInput(e);u.toggle(u.options.enabled);s=u._ns=f+"-"+i.guid();e.closest("form").on("submit"+s,n.proxy(u._onParentFormSubmit,u)).on("reset"+s,n.proxy(u._onParentFormReset,u));u.options.async.saveUrl?(u._module=u._supportsFormData()?new d(u):new k(u),u._async=!0,h=u.options.files,h.length>0&&u._renderInitialFiles(h)):u._module=new ht(u);u._supportsDrop()&&(u.options.dropZone!==""?u._setupCustomDropZone():u._setupDropZone());u.wrapper.on("click",".k-upload-action",n.proxy(u._onFileAction,u)).on("click",".k-clear-selected",n.proxy(u._onClearSelected,u)).on("click",".k-upload-selected",n.proxy(u._onUploadSelected,u));u.element.val()&&u._onInputChange({target:u.element})},events:[v,y,p,s,it,h,rt,ft,r,w,ut],options:{name:"Upload",enabled:!0,multiple:!0,directory:!1,showFileList:!0,template:"",files:[],async:{autoRetryAfter:0,bufferChunkSize:1e7,maxAutoRetries:1,removeVerb:"POST",autoUpload:!0,withCredentials:!0,accept:"*/*; q=0.5, application/json",useArrayBuffer:!1},localization:{select:"Select files...",cancel:"Cancel",retry:"Retry",remove:"Remove",pause:"Pause",resume:"Resume",clearSelectedFiles:"Clear",uploadSelectedFiles:"Upload",dropFilesHere:"Drop files here to upload",invalidFiles:"Invalid file(s). Please check file upload requirements.",statusUploading:"uploading",statusUploaded:"uploaded",statusWarning:"warning",statusFailed:"failed",headerStatusUploading:"Uploading...",headerStatusPaused:"Paused",headerStatusUploaded:"Done",invalidMaxFileSize:"File size too large.",invalidMinFileSize:"File size too small.",invalidFileExtension:"File type not allowed."},validation:{allowedExtensions:[],maxFileSize:0,minFileSize:0},dropZone:""},setOptions:function(n){var t=this,i=t.element;o.fn.setOptions.call(t,n);t.multiple=t.options.multiple;t.directory=t.options.directory;i.attr("multiple",t._supportsMultiple()?t.multiple:!1);t.directory&&(i.attr("webkitdirectory",t.directory),i.attr("directory",t.directory));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)},focus:function(){this.element.focus()},destroy:function(){var t=this,i=n(t.options.dropZone);n(document).add(n(".k-dropzone",t.wrapper)).add(t.wrapper.closest("form")).off(t._ns);i.length>0&&i.off(t._ns);n(t.element).off(f);o.fn.destroy.call(t)},pause:function(t){this._module.onPause({target:n(t,this.wrapper)});var i=t.find(".k-i-pause-sm");i.removeClass("k-i-pause-sm").addClass("k-i-play-sm").attr("title",this.localization.resume);n(i).parent().attr("aria-label",this.localization.resume)},resume:function(t){this._module.onResume({target:n(t,this.wrapper)});var i=t.find(".k-i-play-sm");i.removeClass("k-i-play-sm").addClass("k-i-pause-sm").attr("title",this.localization.pause);n(i).parent().attr("aria-label",this.localization.pause)},upload:function(){var n=this;n._module.onSaveSelected()},getFiles:function(){for(var i,e=this,t,u=[],f=e.wrapper.find(".k-file"),r=0;r<f.length;r++)if(t=n(f[r]).data("fileNames"),t)for(i=0;i<t.length;i++)u.push(t[i]);return u},clearAllFiles:function(){var n=this,t=n.wrapper.find(".k-file");t.each(function(t,i){n._removeFileByDomElement(i,!1)})},removeAllFiles:function(){var n=this,t=n.wrapper.find(".k-file");t.each(function(t,i){n._removeFileByDomElement(i,!0)})},removeFileByUid:function(n){this._removeFileByUid(n,!0)},clearFileByUid:function(n){this._removeFileByUid(n,!1)},_removeFileByUid:function(t,r){var f=this,u;typeof t=="string"&&(u=n(".k-file["+i.attr("uid")+'="'+t+'"]',f.wrapper),u.length>0&&f._removeFileByDomElement(u,r))},clearFile:function(n){this._removeFile(n,!1)},removeFile:function(n){this._removeFile(n,!0)},_removeFile:function(t,i){var r=this,f=r.wrapper.find(".k-file"),u;typeof t=="function"&&f.each(function(f,e){u=n(e).data("fileNames");t(u)&&r._removeFileByDomElement(e,i)})},_removeFileByDomElement:function(t,i){var r=this,u={target:n(t,r.wrapper)},f;if(r.options.async.saveUrl){if(n(t).hasClass("k-file-progress"))r._module.onCancel(u);else r._module.onRemove(u,{},i);f=n(".k-file",r.wrapper);f.length===0?r._hideHeaderUploadstatus():r._updateHeaderUploadStatus()}else r._module.onRemove(u,{},i)},_addInput:function(t){if(t[0].nodeType){var i=this,r=t.clone().val("");r.insertAfter(i.element).data("kendoUpload",i);n(i.element).hide().attr("tabindex","-1").removeAttr("id").off(f);i._activeInput(r);i.element.focus()}},_activeInput:function(t){var i=this,r=i.wrapper;i.element=t;i.directory&&(t.attr("webkitdirectory",i.directory),t.attr("directory",i.directory));t.attr("multiple",i._supportsMultiple()?i.multiple:!1).attr("autocomplete","off").on("click"+f,function(n){r.hasClass("k-state-disabled")&&n.preventDefault()}).on("focus"+f,function(){n(this).parent().addClass("k-state-focused")}).on("blur"+f,function(){n(this).parent().removeClass("k-state-focused")}).on("change"+f,n.proxy(i._onInputChange,i)).on("keydown"+f,n.proxy(i._onInputKeyDown,i))},_onInputKeyDown:function(n){var r=this,t=r.wrapper.find(".k-upload-action:visible:first");n.keyCode===i.keys.TAB&&t.length>0&&!n.shiftKey&&(n.preventDefault(),t.focus())},_onInputChange:function(t){var i=this,r=n(t.target),u=g(i._inputFiles(r),i._isAsyncNonBatch()),f;if(yt(u,i.options.validation),f=i.trigger(v,{files:u}),f)i._addInput(r),r.remove();else i._module.onSelect({target:r},u)},_readDirectory:function(t){var i=new n.Deferred,f=t.createReader(),r=[],u=function(){f.readEntries(function(n){n.length?(r=r.concat(n),u()):i.resolve(r)},i.reject)};return u(),i.promise()},_readFile:function(n){var t=this,i=n.fullPath;n.file(function(n){n.relativePath=i.slice(1);t.droppedFolderFiles.push(n);t.droppedFolderCounter--;t.droppedFolderCounter===0&&setTimeout(function(){t.droppedFolderCounter===0&&t.droppedFolderFiles.length&&(t._proceedDroppedItems(t.droppedFolderFiles),t.droppedFolderFiles=[])},0)},function(){a("File error.")})},_traverseFileTree:function(n,t){var i=this;t||i.droppedFolderCounter--;this._readDirectory(n).then(function(n){i.droppedFolderCounter+=n.length;for(var t=0;t<n.length;t++)n[t].isFile?i._readFile(n[t]):n[t].isDirectory&&i._traverseFileTree(n[t])})},_onDrop:function(n){var i=n.originalEvent.dataTransfer,t=this,f=i.files,e,r,u;if(nt(n),t.options.directoryDrop&&i.items)for(e=i.items.length,t.droppedFolderCounter=0,t.droppedFolderFiles=[],r=0;r<e;r++)i.items[r].webkitGetAsEntry?(u=i.items[r].webkitGetAsEntry(),u.isDirectory?t._traverseFileTree(u,!0):u.isFile&&t.droppedFolderFiles.push(i.files[r])):t._proceedDroppedItems(f);else t._proceedDroppedItems(f)},_proceedDroppedItems:function(t){var i=this,r=g(at(t),i._isAsyncNonBatch()),u;if(t.length>0&&!i.wrapper.hasClass("k-state-disabled")&&(!i.multiple&&r.length>1&&r.splice(1,r.length-1),yt(r,i.options.validation),u=i.trigger(v,{files:r}),!u))i._module.onSelect({target:n(".k-dropzone",i.wrapper)},r)},_filesContainValidationErrors:function(t){var i=!1;return n(t).each(function(n,t){if(t[e]&&t[e].length>0)return i=!0,!1}),i},_isAsyncNonBatch:function(){return this._async&&!this.options.async.batch||!1},_renderInitialFiles:function(n){var i=this,t=0,u,f;for(n=g(n,!0),t=0;t<n.length;t++)u=n[t],f=i._enqueueFile(u.name,{fileNames:[u]}),f.addClass("k-file-success").data("files",[n[t]]),i._supportsRemove()&&i._fileAction(f,r)},_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},_prepareDefaultSingleFileEntryTemplate:function(t){var f=this,i=t.fileNames[0],o=pt(t.fileNames),r=i[e],u="";return u+=r&&r.length>0?"<li class='k-file k-file-invalid'><span class='k-progress'><\/span><span class='k-file-invalid-extension-wrapper'><span class='k-file-invalid-icon'>!<\/span><span class='k-file-state'><\/span><\/span><span class='k-file-name-size-wrapper'><span class='k-file-name k-file-name-invalid' title='"+i.name+"'>"+i.name+"<\/span><span class='k-file-validation-message'>"+f.localization[r[0]]+"<\/span><\/span>":"<li class='k-file'><span class='k-progress'><\/span><span class='k-file-extension-wrapper'><span class='k-file-extension'>"+i.extension.substring(1)+"<\/span><span class='k-file-state'><\/span><\/span><span class='k-file-name-size-wrapper'><span class='k-file-name' title='"+i.name+"'>"+i.name+"<\/span><span class='k-file-size'>"+o+"<\/span><\/span>",u+="<strong class='k-upload-status'><\/strong>",n(u)},_prepareDefaultMultipleFileEntriesTemplate:function(t){var o=this,u=t.fileNames,s=o._filesContainValidationErrors(u),h=pt(u),i="",f,r;for(i+=s?"<li class='k-file k-file-invalid'><span class='k-progress'><\/span><span class='k-multiple-files-invalid-extension-wrapper'><span class='k-file-invalid-icon'>!<\/span>":"<li class='k-file'><span class='k-progress'><\/span><span class='k-multiple-files-extension-wrapper'>",i+="<span class='k-file-state'><\/span><\/span>",u.sort(function(n,t){return n[e]?-1:t[e]?1:0}),i+="<span class='k-file-name-size-wrapper'>",f=0;f<u.length;f++)r=u[f],i+=r[e]&&r[e].length>0?"<span class='k-file-name k-file-name-invalid' title='"+r.name+"'>"+r.name+"<\/span>":"<span class='k-file-name' title='"+r.name+"'>"+r.name+"<\/span>";return i+=s?"<span class='k-file-validation-message'>"+o.localization.invalidFiles+"<\/span>":"<span class='k-file-information'>Total: "+u.length+" files, "+h+"<\/span>",i+="<\/span><strong class='k-upload-status'><\/strong>",n(i)},_enqueueFile:function(t,u){var f=this,s,e,a=u.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(t,u),h=i.template(h),e=n("<li class='k-file'>"+h(c)+"<\/li>"),e.find(".k-upload-action").addClass("k-button"),f.angular("compile",function(){return{elements:e,data:[c]}})):e=u.fileNames.length===1?f._prepareDefaultSingleFileEntryTemplate(u):f._prepareDefaultMultipleFileEntriesTemplate(u),e.attr(i.attr("uid"),a).appendTo(o).data(u),f._async||n(".k-progress",e).width("100%"),!f.multiple&&s.length>0&&(l={files:s.data("fileNames"),headers:{}},!f.trigger(r,l)))f._module.onRemove({target:n(s,f.wrapper)},l);return e},_removeFileEntry:function(t){var u=this,i=t.closest(".k-upload-files"),r,f,e;t.remove();r=n(".k-file",i);f=n(".k-file-success, .k-file-error",i);e=n(".k-file-invalid",i);(f.length===r.length||e.length===r.length)&&this._hideUploadButton();r.length===0?(i.remove(),u.wrapper.addClass("k-upload-empty"),u._hideHeaderUploadstatus()):u._updateHeaderUploadStatus()},_fileAction:function(n,t,i){var u={remove:"k-i-x",cancel:"k-i-cancel",retry:"k-i-retry",pause:"k-i-pause-sm"},f={remove:"k-i-close",cancel:"k-i-close",retry:"k-i-reload-sm",pause:"k-i-pause-sm"},r;u.hasOwnProperty(t)&&(i||this._clearFileAction(n),this.options.template?(r=n.find(".k-upload-action").first(),r.find(".k-icon").length?r.next(".k-upload-action").length&&r.next(".k-upload-action").addClass("k-button").append("<span class='k-icon "+f[t]+" "+u[t]+"' title='"+this.localization[t]+"'aria-label='"+this.localization[t]+"'><\/span>").show():r.addClass("k-button").append("<span class='k-icon "+f[t]+" "+u[t]+"' title='"+this.localization[t]+"'aria-label='"+this.localization[t]+"'><\/span>").show()):(i||n.find(".k-upload-status .k-upload-action").remove(),n.find(".k-upload-status").append(this._renderAction(u[t],this.localization[t],f[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("span.k-file-state",t).text(u.text)},_renderAction:function(t,i,r){return t!==""?n("<button type='button' class='k-button k-upload-action' aria-label='"+i+"'><span class='k-icon "+r+" "+t+"' title='"+i+"'><\/span><\/button>").on("focus",function(){n(this).addClass("k-state-focused")}).on("blur",function(){n(this).removeClass("k-state-focused")}):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 o=n(t.target).closest(".k-upload-action"),f=o.find(".k-icon"),u=o.closest(".k-file"),s=u.data("fileNames"),c=i._filesContainValidationErrors(s),e={files:s,headers:{}};if(i._retryClicked=!1,f.hasClass("k-i-x")){if(!i.trigger(r,e))i._module.onRemove({target:n(u,i.wrapper)},e,!c)}else if(f.hasClass("k-i-cancel")){i.trigger(h,e);i._module.onCancel({target:n(u,i.wrapper)});i._checkAllComplete();i._updateHeaderUploadStatus()}else if(f.hasClass("k-i-pause-sm"))i.trigger(w,e),i.pause(u),i._updateHeaderUploadStatus();else if(f.hasClass("k-i-play-sm"))i.trigger(ut,e),i.resume(u);else if(f.hasClass("k-i-retry")){n(".k-i-warning",u).remove();n(".k-progress",u).finish().show();i._module.onRetry({target:n(u,i.wrapper)});i._retryClicked=!0}}return!1},_onUploadSelected:function(){var n=this,t=n.wrapper;return t.hasClass("k-state-disabled")||this._module.onSaveSelected(),!1},_onClearSelected:function(){var n=this,t=n.wrapper;return t.hasClass("k-state-disabled")||n.trigger(rt,{})||n.clearAllFiles(),!1},_onFileProgress:function(t,i){var f,r;i>100&&(i=100);this.options.template?n(".k-progress",t.target).width(i+"%"):(f=n(".k-upload-pct",t.target),r=n(".k-i-warning",t.target),r.length?r.removeClass("k-i-warning").removeClass("k-icon").addClass("k-upload-pct"):f.length===0&&n(".k-upload-status",t.target).prepend("<span class='k-upload-pct'><\/span>"),i!==100?n(".k-upload-pct",t.target).text(i+"%"):n(".k-upload-pct",t.target).remove(),n(".k-progress",t.target).width(i+"%"));this.trigger(ft,{files:u(t).data("fileNames"),percentComplete:i})},_onUploadSuccess:function(n,t,i){var f=this,e=u(n),o=f.trigger(p,{files:e.data("fileNames"),response:t,operation:"upload",XMLHttpRequest:i});o?f._setUploadErrorState(e):(f._fileState(e,"uploaded"),e.removeClass("k-file-progress").addClass("k-file-success"),f._updateHeaderUploadStatus(),f._supportsRemove()?f._fileAction(e,r):f._clearFileAction(e));f._hideUploadProgress(e);f._checkAllComplete()},_onUploadError:function(n,t){var i=this,f=i._module,r=u(n),e=r.data("uid");i._setUploadErrorState(r);i.trigger(s,{operation:"upload",files:r.data("fileNames"),XMLHttpRequest:t});a("Server response: "+t.responseText);i.options.async.chunkSize?f._decreasePosition&&f._decreasePosition(e):i._hideUploadProgress(r);i._checkAllComplete();this.options.async.autoRetryAfter&&this._autoRetryAfter(r)},_autoRetryAfter:function(n){var i=this,t=this._module.retries;t&&(t[n.data("uid")]||(t[n.data("uid")]=1),t[n.data("uid")]<=this.options.async.maxAutoRetries&&(t[n.data("uid")]++,setTimeout(function(){i._module.performUpload(n)},this.options.async.autoRetryAfter)))},_setUploadErrorState:function(t){var u=this,i;u._fileState(t,"failed");t.removeClass("k-file-progress").addClass("k-file-error");u._updateUploadProgress(t);i=n(".k-upload-pct",t);i.length>0?(i.parent().find(".k-i-warning").length||i.removeClass("k-upload-pct").addClass("k-icon k-i-warning"),i.empty()):n(".k-upload-status",t).prepend("<span class='k-icon k-i-warning'><\/span>");this._updateHeaderUploadStatus();this._fileAction(t,"retry");this._fileAction(t,r,!0);u._retryClicked&&t.find(".k-i-retry").parent().focus()},_updateUploadProgress:function(t){var i=this,u,r,f;i.options.async.chunkSize?(u=t.data("uid"),i._module.metaData&&(r=i._module.metaData[u],r&&(f=r.totalChunks?Math.round(r.chunkIndex/r.totalChunks*100):100,i._onFileProgress({target:n(t,i.wrapper)},f)))):n(".k-progress",t).width("100%")},_hideUploadProgress:function(t){n(".k-progress",t).delay(ti).fadeOut(ii,function(){n(this).css("width","0%")})},_showUploadButton:function(){var t=this,i=n(".k-upload-selected",t.wrapper),r=n(".k-clear-selected",t.wrapper);i.length===0&&(i=t._renderAction("",this.localization.uploadSelectedFiles).addClass("k-upload-selected"),r=t._renderAction("",this.localization.clearSelectedFiles).addClass("k-clear-selected"));this.wrapper.append(r,i)},_hideUploadButton:function(){n(".k-upload-selected, .k-clear-selected",this.wrapper).remove()},_showHeaderUploadStatus:function(t){var r=this,u=r.localization,f=n(".k-dropzone",r.wrapper),i=n(".k-upload-status-total",r.wrapper);i.length!==0&&i.remove();i='<strong class="k-upload-status k-upload-status-total"><span class="k-icon"><\/span><\/strong>';t?(i=n(i).append(u.headerStatusUploading),i.find(".k-icon").addClass(c.loading)):(i=n(i).append(u.headerStatusUploaded),i.find(".k-icon").addClass(c.warning));f.length>0?f.append(i):n(".k-upload-button",r.wrapper).after(i)},_updateHeaderUploadStatus:function(){var t=this,i=n(".k-upload-status-total",this.wrapper),u=n(".k-file",t.wrapper).not(".k-file-success, .k-file-error, .k-file-invalid"),o=n(".k-file-invalid",t.wrapper),s=n(".k-file-error",t.wrapper),f=n(".k-file",t.wrapper).find(".k-i-play-sm"),e,r;f.length&&(f.length===u.length||!t.options.async.concurrent)?(r=n(".k-icon",i).removeClass().addClass("k-icon").addClass("k-i-pause-sm"),i.html(r).append(t.localization.headerStatusPaused)):(u.length===0||o.length>0||s.length>0)&&(e=n(".k-file.k-file-error, .k-file.k-file-invalid",t.wrapper),i=n(".k-upload-status-total",t.wrapper),r=n(".k-icon",i).removeClass().addClass("k-icon").addClass(e.length!==0?c.warning:c.success),i.html(r).append(t.localization.headerStatusUploaded))},_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!i.support.browser.opera&&!(i.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 t=this,r,i;n(".k-upload-button",t.wrapper).wrap("<div class='k-dropzone'><\/div>");r=t._ns;i=n(".k-dropzone",t.wrapper).append(n("<em>"+t.localization.dropFilesHere+"<\/em>")).on("dragenter"+r,nt).on("dragover"+r,function(n){n.originalEvent.dataTransfer.dropEffect="copy";n.preventDefault()}).on("drop"+r,n.proxy(t._onDrop,t));tt(i,r,function(){i.closest(".k-upload").hasClass("k-state-disabled")||i.addClass("k-dropzone-hovered")},function(){i.removeClass("k-dropzone-hovered")});t._bindDocumentDragEventWrappers(i)},_setupCustomDropZone:function(){var t=this,i=n(t.options.dropZone),r;n(".k-upload-button",t.wrapper).wrap("<div class='k-dropzone'><\/div>").after(n("<em>"+t.localization.dropFilesHere+"<\/em>"));r=t._ns;i.on("dragenter"+r,nt).on("dragover"+r,function(n){n.preventDefault()}).on("drop"+r,n.proxy(t._onDrop,t));tt(i,r,function(r){t.wrapper.hasClass("k-state-disabled")||(i.removeClass("k-dropzone-hovered"),n(r.target).addClass("k-dropzone-hovered"))},function(){i.removeClass("k-dropzone-hovered")});t._bindDocumentDragEventWrappers(i)},_bindDocumentDragEventWrappers:function(t){var i=this,r=i._ns;tt(n(document),r,function(){i.wrapper.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.data,l());f[o]=t;jQuery.ajax({type:this.options.async.removeVerb,dataType:"json",dataFilter:dt,url:this.options.async.removeUrl,traditional:!0,data:f,headers:i.headers,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' aria-label='"+this.localization.select+"'><\/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(it)},_inputFiles:function(n){return lt(n)}}),ht=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")},k,d;ht.prototype={onSelect:function(t,i){var u=this.upload,f=n(t.target),s=u._filesContainValidationErrors(i),e,o;u._addInput(f);e={fileNames:i};s?f.remove():e.relatedInput=f;o=u._enqueueFile(ct(f),e);s&&u._hideUploadProgress(o);u._fileAction(o,r)},onRemove:function(n){var t=u(n),i=t.data("relatedInput");i&&i.remove();this.upload._removeFileEntry(t)}};k=function(n){this.name="iframeUploadModule";this.element=n.wrapper;this.upload=n;this.iframes=[]};b._frameId=0;k.prototype={onSelect:function(i,u){var f=this.upload,h=n(i.target),o=f._filesContainValidationErrors(u),e=this.prepareUpload(h,u,o),s;f.options.async.autoUpload?o?(f._fileAction(e,r),f._showHeaderUploadStatus(!1)):(f.options.async.putUpload!=t&&f.options.async.putUpload==!0&&(s=f.options.async.arrUploadUrlObj.shift(),n(e).attr("url",s.PUT_URL),n(e).attr("objKey",s.OBJECTKEY)),this.performUpload(e)):(f._fileAction(e,r),o?f._updateHeaderUploadStatus():f._showUploadButton());o&&f._hideUploadProgress(e)},prepareUpload:function(t,i,r){var u=this.upload,s=n(u.element),c=u.options.async.saveField||t.attr("name"),e,o,f,h;return u._addInput(t),t.attr("name",c),r?(t.remove(),o={fileNames:i}):(f=this.createFrame(u.name+"_"+b._frameId++),this.registerFrame(f),h=this.createForm(u.options.async.saveUrl,f.attr("name")).append(s),o={frame:f,relatedInput:s,fileNames:i}),e=u._enqueueFile(ct(t),o),f&&f.data({form:h,file:e}),e},performUpload:function(t){var u={files:t.data("fileNames")},r=t.data("frame"),i=this.upload,f,e,o;if(i.trigger(y,u))i._removeFileEntry(r.data("file")),this.cleanupFrame(r),this.unregisterFrame(r);else{i._hideUploadButton();i._showHeaderUploadStatus(!0);r.appendTo(document.body);f=r.data("form").attr("action",i.options.async.saveUrl).appendTo(document.body);u.data=n.extend({},u.data,l());for(e in u.data)o=f.find("input[name='"+e+"']"),o.length===0&&(o=n("<input>",{type:"hidden",name:e}).prependTo(f)),o.val(u.data[e]);i._fileAction(t,h);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,i=t.upload;n(".k-file",this.element).each(function(){var r=n(this),u=gt(r),f=i._filesContainValidationErrors(r.data("fileNames"));u||f||t.performUpload(r)})},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};kt(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=u(n);this.performUpload(t)},onRemove:function(n,t,i){var f=this,e=f.upload,r=u(n),o=r.data("frame");o?(f.unregisterFrame(o),e._removeFileEntry(r),f.cleanupFrame(o)):r.hasClass("k-file-success")?bt(r,e,t,i):e._removeFileEntry(r)},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)}};d=function(n){this.name="formDataUploadModule";this.element=n.wrapper;this.upload=n;this.position={};this.metaData={};this.cancelled={};this.resume={};this.paused={};this.retries={}};d.prototype={onSelect:function(i,u){var f=this.upload,o=this,h=n(i.target),c=this.prepareUpload(h,u),e,s;n.each(c,function(i){if(e=f._filesContainValidationErrors(n(this.data("fileNames"))),f.options.async.autoUpload)if(e)f._fileAction(this,r),f._showHeaderUploadStatus(!1);else{if(f.options.async.putUpload!=t&&f.options.async.putUpload==!0){var u=f.options.async.arrUploadUrlObj.shift();n(this).attr("url",u.PUT_URL);n(this).attr("objKey",u.OBJECTKEY)}f.options.async.chunkSize?(o.prepareChunk(this),s=this.prev(),(f.options.async.concurrent||i===0&&!s.length||i===0&&s.hasClass("k-file-success"))&&o.performUpload(this)):o.performUpload(this)}else f._fileAction(this,r),e?f._updateHeaderUploadStatus():(f._showUploadButton(),this.addClass("k-toupload"));e&&f._hideUploadProgress(this)})},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 r=this.upload,f,e,s=t.length,i,u,o=[];if(r.options.async.batch===!0)f=n.map(t,function(n){return n.name}).join(", "),(r.directory||r.options.directoryDrop)&&n(t).each(function(){(this.rawFile.webkitRelativePath||this.rawFile.relativePath)&&(this.name=this.rawFile.webkitRelativePath||this.rawFile.relativePath)}),u=r._enqueueFile(f,{fileNames:t}),u.data("files",t),o.push(u);else for(e=0;e<s;e++)i=t[e],f=i.name,(r.directory||r.options.directoryDrop)&&(i.rawFile.webkitRelativePath||i.rawFile.relativePath)&&(i.name=i.rawFile.webkitRelativePath||i.rawFile.relativePath),u=r._enqueueFile(f,{fileNames:[i]}),u.data("files",[i]),o.push(u);return o},performUpload:function(t){var i=this.upload,u=this.createFormData(),f=this.createXHR(),r={files:t.data("fileNames"),XMLHttpRequest:f},e,o;if(i.trigger(y,r))this.removeFileEntry(t);else{if(t.find(".k-i-cancel").length===0&&(i.options.async.chunkSize&&i._fileAction(t,w),i._fileAction(t,h,i.options.async.chunkSize)),i.wrapper.find(".k-toupload").length||i._hideUploadButton(),i._showHeaderUploadStatus(!0),r.formData)u=r.formData;else{r.data=n.extend({},r.data,l());for(o in r.data)u.append(o,r.data[o]);e=t.data("files");e&&this.populateFormData(u,e)}i._fileState(t,"uploading");n(t).removeClass("k-file-error").addClass("k-file-progress");i.options.async.useArrayBuffer&&window.FileReader?this._readFile(i.options.async.saveUrl,u,t,f):this.postFormData(i.options.async.saveUrl,u,t,f)}},_readFile:function(t,i,r,u){var f=this,e=f.upload,o=r.data("files")[0],s=new FileReader;s.onload=function(s){try{f.fileArrayBuffer=f.fileArrayBuffer?f._appendBuffer(f.fileArrayBuffer,s.target.result):s.target.result}catch(h){e._onUploadError({target:n(r,e.wrapper)},u);return}f.position[o.uid]>o.size?(f.postFormData(e.options.async.saveUrl,f.fileArrayBuffer,r,u),f.fileArrayBuffer=null):f._readFile(t,i,r,u)};s.onerror=function(){e._onUploadError({target:n(r,e.wrapper)},u)};s.readAsArrayBuffer(f._getCurrentChunk(o.rawFile,o.uid))},_appendBuffer:function(n,t){var i=new Uint8Array(n.byteLength+t.byteLength);return i.set(new Uint8Array(n),0),i.set(new Uint8Array(t),n.byteLength),i.buffer},onSaveSelected:function(){var t=this,i=t.upload;n(".k-toupload",this.element).filter(function(){var t=n(this),r=gt(t),u=i._filesContainValidationErrors(t.data("fileNames"));return!r&&!u}).each(function(r){var u=n(this),f=u.prev();u.removeClass("k-toupload");i.options.async.chunkSize?(t.prepareChunk(u),(i.options.async.concurrent||r===0&&!f.length||r===0&&f.hasClass("k-file-success")||f.hasClass("k-file-error"))&&t.performUpload(u)):t.performUpload(u)})},onCancel:function(n){var t=u(n);this.upload.options.async.chunkSize&&(this.cancelled[t.data("uid")]=!0);this.stopUploadRequest(t);this.removeFileEntry(t)},onPause:function(n){var r=u(n),t=r.data("uid"),i=this.upload.options.async;i.chunkSize&&(this.retries[t]=i.maxAutoRetries+1,this.paused[t]=!0,this.resume[t]=!1)},onResume:function(n){var t=u(n),i=t.data("uid");this.upload.options.async.chunkSize&&(delete this.paused[i],this.resume[i]=!0,this.retries[t.data("uid")]=1,this._increaseChunkIndex(i),this.performUpload(t))},onRetry:function(n){var t=u(n),i=this.upload.options.async;i.chunkSize&&(this.retries[t.data("uid")]=i.maxAutoRetries+1,delete this.paused[t.data("uid")]);this.performUpload(t)},onRemove:function(n,t,i){var f=this,o=f.upload,r=u(n),e=this.upload.options.async;e.chunkSize&&(this.retries[r.data("uid")]=e.maxAutoRetries+1);r.hasClass("k-file-success")?bt(r,o,t,i):f.removeFileEntry(r)},createXHR:function(){return new XMLHttpRequest},postFormData:function(i,r,u,f){var e=this,o,c,h;if(u.data("request",f),f.addEventListener("load",function(n){e.onRequestSuccess.call(e,n,u)},!1),f.addEventListener(s,function(n){e.onRequestError.call(e,n,u)},!1),f.upload.addEventListener("progress",function(n){e.onRequestProgress.call(e,n,u)},!1),o=this.upload,o.options.async.putUpload!=t&&o.options.async.putUpload==!0){c=u.data("fileNames")[0].rawFile;f.open("PUT",n(u).attr("url"),!0);f.setRequestHeader("Content-type","multipart/form-data");f.setRequestHeader("Access-Control-Allow-Origin","*");f.send(c);return}f.open("POST",i,!0);f.withCredentials=this.upload.options.async.withCredentials;h=this.upload.options.async.accept;h&&f.setRequestHeader("Accept",h);f.send(r)},createFormData:function(){return new FormData},populateFormData:function(n,t){var f,r,o=t.length,u,i=this.upload,e;if(i.options.async.chunkSize)u=t[0].uid,f=this._getCurrentChunk(t[0].rawFile,u),n.append(i.options.async.saveField||i.name,f),e=JSON.stringify(this.metaData[u]),n.append("metadata",e);else for(r=0;r<o;r++)n.append(i.options.async.saveField||i.name,t[r].rawFile);return n},onRequestSuccess:function(t,i){function f(){r.upload._onUploadError({target:n(i,r.upload.wrapper)},u)}function e(t){var e=r.upload.options.async.batch,o=r.upload.options.async.chunkSize,s=r.upload.options.async.concurrent,f=t.fileUid;r.paused[f]||r.cancelled[f]||(delete r.retries[f],!o||e||t.uploaded?!o||e||s||!i.next().length||i.next().hasClass("k-toupload")?(r.upload._onFileProgress({target:n(i,r.upload.wrapper)},100),r.upload._onUploadSuccess({target:n(i,r.upload.wrapper)},t,u),r.cleanupFileEntry(i)):(r.upload._onFileProgress({target:n(i,r.upload.wrapper)},100),r._resetChunkIndex(f),r.upload._onUploadSuccess({target:n(i,r.upload.wrapper)},t,u),r.performUpload(i.next())):(r._increaseChunkIndex(f),r.performUpload(i)))}var u=t.target,r=this;u.status>=200&&u.status<=299?kt(u.responseText,e,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){var t=this.upload.options.async.chunkSize,i=this.upload.options.async.concurrent;this.cleanupFileEntry(n);t&&!i&&n.next().length&&this.performUpload(n.next());this.upload._removeFileEntry(n)},onRequestProgress:function(t,i){var u=Math.round(t.loaded*100/t.total),f=i.data("uid"),r;this.upload.options.async.chunkSize&&(r=this.metaData[f],u=r.totalChunks?Math.round(r.chunkIndex/r.totalChunks*100):100);this.upload._onFileProgress({target:n(i,this.upload.wrapper)},u)},stopUploadRequest:function(n){n.data("request").abort()},prepareChunk:function(n){var t=n.data("files")[0].rawFile,i=n.data("files")[0].uid,r=this.upload.options.async.chunkSize;this.position[i]=0;this.metaData[i]={chunkIndex:0,contentType:t.type,fileName:t.name,totalFileSize:t.size,totalChunks:Math.ceil(t.size/r),uploadUid:i}},_decreaseChunkIndex:function(n){this.metaData[n].chunkIndex--},_increaseChunkIndex:function(n){this.metaData[n].chunkIndex++},_resetChunkIndex:function(n){this.metaData[n].chunkIndex=0},_decreasePosition:function(n){this.position[n]-=this.upload.options.async.chunkSize},_getCurrentChunk:function(n,t){var u=this.position[t],i,r=this.upload.options.async,f=r.chunkSize||r.bufferChunkSize;return this.position[t]||(this.position[t]=0),this.position[t]+=f,(i=this._getChunker(n))?n[i](u,this.position[t]):n},_getChunker:function(n){return n.slice?"slice":n.mozSlice?"mozSlice":n.webkitSlice?"webkitSlice":null}};i.ui.plugin(b)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.filebrowser",["kendo.listview","kendo.dropdownlist","kendo.upload"],n)}(function(){return 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-i-plus"><\/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-i-folder-add" /><\/button># } ## if (showDelete) { #<button type="button" class="k-button k-button-icon k-state-disabled"><span class="k-icon k-i-close" /><\/button>&nbsp;# } #<\/div><div class="k-tiles-arrange"><label>#=messages.orderBy#: <select /><\/label><\/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-i-close)",r(i._deleteClick,i)).on(a+e,".k-filebrowser-toolbar button:not(.k-state-disabled):has(.k-i-folder-add)",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"),r=n.files[0].name,s=f,h=b,u;if(c.test(r))if(n.data={path:t.path()},u=t._createFile(r),u)t.upload.one("success",function(n){var r=t._insertFileToList(u);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,r,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 r=this,t={},o=u,e=r._findFile(n);return e?r._showMessage(i.format(r.options.messages.overwriteFile,n),"confirm")?(e._override=!0,e):null:(t[o]="f",t[f]=n,t[b]=0,t)},_insertFileToList:function(n){var f,i,r,t,e;if(n._override)return n;for(i=this.dataSource,r=i.view(),t=0,e=r.length;t<e;t++)if(r[t].get(u)==="f"){f=t;break}return i.insert(++f,n)},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-i-close").parent().addClass("k-state-disabled");(n.action==="remove"||n.action==="sync")&&(n.preventDefault(),i.ui.progress(t.listView.element,!1))},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-i-close").parent().removeClass("k-state-disabled"),this.trigger(s,{selected:n}))},_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,r;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."),r=t.dataSource,r.hasChanges()&&r.cancelChanges())},_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-i-folder"><\/span><\/div>',n+="#}else{#",n+='<div class="k-thumb"><span class="k-icon k-i-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-i-folder"><\/span><\/div>',n+="#}else{#",n+='<div class="k-thumb"><span class="k-icon k-i-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-zoom 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-60-up:first",r(i._rootClick,i)).on(a+h,"a:not(.k-i-arrow-60-up)",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-60-up)").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-60-up" title="Go to parent folder"><\/a>'),i+='<a class="k-link" href="#">'+f[u]+"<\/a>",i+='<span class="k-icon k-i-arrow-60-right" title="Go to child folder"><\/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),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.imagebrowser",["kendo.filebrowser"],n)}(function(){return 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;var u=t._insertFileToList(r);u.set(s,n.response[t._getFieldName(s)]);u.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-i-close").parent().addClass("k-state-disabled");(n.action==="remove"||n.action==="sync")&&(n.preventDefault(),i.ui.progress(t.listView.element,!1))},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,l=n(t),e=f.dataSource.getByUid(l.attr(i.attr("uid"))),o=e.get(u),r=f.options.transport.thumbnailUrl,c=n("<img />",{alt:o}),a="?";if(!e._uploading){c.hide().on("load"+h,function(){n(this).prev().remove().end().addClass("k-image").fadeIn()});l.find(".k-i-loading").after(c);s(r)?r=r(f.path(),encodeURIComponent(o)):(r.indexOf("?")>=0&&(a="&"),r=r+a+"path="+encodeURIComponent(f.path()+o),e._override&&(r+="&_="+(new Date).getTime(),delete e._override));c.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 u=i._outerHeight(n.list),t=n.list.scrollTop(),r=t+u;n._tiles.each(function(){var i=y(this),u=i+this.offsetHeight;return(i>=t&&i<r||u>=t&&u<r)&&n._loadImage(this),i>r?!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-i-folder"><\/span><\/div>',n+="#}else{#",n+=t.options.transport&&t.options.transport.thumbnailUrl?'<div class="k-thumb"><span class="k-icon k-i-loading"><\/span><\/div>':'<div class="k-thumb"><span class="k-icon k-i-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),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.tabstrip",["kendo.data"],n)}(function(){return function(n,t){function ni(t){t.children(st).addClass(vt);t.children("a").addClass(o).children(st).addClass(vt);t.filter(":not([disabled]):not([class*=k-state-disabled])").addClass(l);t.filter("li[disabled]").addClass(c).attr("aria-disabled","true").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(ui)&&!(this.nodeType==3&&!ot(this.nodeValue))}).wrapAll("<span UNSELECTABLE='on' class='"+o+"'/>")})}function k(n){var t=n.children(".k-item");t.filter(".k-first:not(:first-child)").removeClass(yt);t.filter(".k-last:not(:last-child)").removeClass(lt);t.filter(":first-child").addClass(yt);t.filter(":last-child").addClass(lt)}function ti(n,t){return"<span class='k-button k-button-icon k-bare k-tabstrip-"+n+"' unselectable='on'><span class='k-icon "+t+"'><\/span><\/span>"}var i=window.kendo,ii=i.ui,e=i.keys,et=n.map,g=n.each,ot=n.trim,u=n.extend,ri=i.isFunction,h=i.template,p=i._outerWidth,nt=i._outerHeight,w=ii.Widget,ui=/^(a|div)$/i,f=".kendoTabStrip",st="img",ht="href",b="prev",tt="next",ct="show",o="k-link",lt="k-last",at="click",fi=":empty",vt="k-image",yt="k-first",it="select",pt="activate",rt="k-content",y="contentUrl",wt="mouseenter",ei="mouseleave",bt="contentLoad",c="k-state-disabled",l="k-state-default",r="k-state-active",a="k-state-focused",ut="k-state-hover",s="k-tab-on-top",ft=".k-item:not(."+c+")",kt=".k-item",oi=".k-tabstrip-items > "+ft+":not(."+r+")",dt=200,v={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("")},gt={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+'"':""}},d=w.extend({init:function(t,u){var e=this,c,s,h;w.fn.init.call(e,t,u);e._animations(e.options);u=e.options;e._contentUrls=u.contentUrls||[];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._contentUrls.length?e.wrapper.find(".k-tabstrip-items > .k-item").each(function(t,i){var r=e._contentUrls[t];typeof r=="string"&&n(i).find(">."+o).data(y,r)}):e._contentUrls.length=e.tabGroup.find("li.k-item").length;e.wrapper.on(wt+f+" "+ei+f,oi,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(at+f,".k-state-disabled .k-link",!1).on(at+f," > "+ft,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(ft)[n]()},_getItem:function(n){return this.tabGroup.children(kt)[n]()},_item:function(n,t){var i;return(i=t===b?"last":"first",!n)?this._endItem(i):(n=n[t](),n[0]||(n=this.tabGroup.children(kt)[i]()),n.hasClass(c)&&n.addClass(a),(n.hasClass(c)||n.hasClass(r))&&(this._focused=n),n)},_current:function(n){var i=this,f=i._focused,u=i._ariaId;if(n===t)return f;f&&(i.tabGroup.children("#"+u).removeAttr("id"),f.removeClass(a));n&&(n.hasClass(r)||n.addClass(a),i.element.removeAttr("aria-activedescendant"),u=n[0].id||u,u&&(n.attr("id",u),i.element.attr("aria-activedescendant",u)));i._focused=n},_keydown:function(n){var t=this,i=n.keyCode,f=t._current(),o=t._isRtl,u=/top|bottom/.test(t.options.tabPosition),r;if(n.target==n.currentTarget){if(i!==e.DOWN||u)if(i!==e.UP||u)if(i===e.RIGHT&&u)r=o?b:tt;else if(i===e.LEFT&&u)r=o?tt:b;else if(i==e.ENTER||i==e.SPACEBAR)t._click(f),n.preventDefault();else{if(i==e.HOME){t._click(t._getItem("first"));n.preventDefault();return}if(i==e.END){t._click(t._getItem("last"));n.preventDefault();return}}else r=b;else r=tt;r&&(t._click(t._item(f,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)),n.field===u.dataUrlField&&(r._contentUrls[t]=f[0].get(n.field))):(r.trigger("dataBinding"),r.remove("li"),r._contentUrls=[],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.contentUrls&&(t._contentUrls=n.contentUrls),n.animation=u(!0,i,n.animation),n.navigatable)t.wrapper.on("keydown"+f,t._keyDownProxy);else t.wrapper.off("keydown"+f,t._keyDownProxy);w.fn.setOptions.call(t,n)},events:[it,pt,ct,"error",bt,"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:dt}},destroy:function(){var n=this,t=n.scrollWrap;w.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());i.destroy(n.wrapper);t.children(".k-tabstrip").unwrap()},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(it,{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,r=i._contentUrls;return t.each(function(){var t=n(this),u=t.find("."+o).data(y)||r[t.index()],f=i.contentHolder(t.index());u&&i.ajaxRequest(t,f,null,u)}),i},append:function(n){var t=this,i=t._create(n);return g(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]}})}),k(t.tabGroup),t._updateContentElements(),t.resize(!0),t},_appendUrlItem:function(n){this._contentUrls.push(n)},_moveUrlItem:function(n,t){this._contentUrls.splice(t,0,this._contentUrls.splice(n,1)[0])},_removeUrlItem:function(n){this._contentUrls.splice(n,1)},insertBefore:function(t,i){i=n(t).is(n(i))?this.tabGroup.find(i).next():this.tabGroup.find(i);var r=this,u=r._create(t),f=r.element.find("[id='"+i.attr("aria-controls")+"']");return g(u.tabs,function(t){var e=u.contents[t],o=u.newTabsCreated?r._contentUrls.length-(u.tabs.length-t):n(e).index()-1;i.before(this);f.before(e);r._moveUrlItem(o,n(this).index());r.angular("compile",function(){return{elements:[e]}})}),k(r.tabGroup),r._updateContentElements(u.newTabsCreated),r.resize(!0),r},insertAfter:function(t,i){i=n(t).is(n(i))?this.tabGroup.find(i).prev():this.tabGroup.find(i);var r=this,u=r._create(t),f=r.element.find("[id='"+i.attr("aria-controls")+"']");return g(u.tabs,function(t){var e=u.contents[t],o=u.newTabsCreated?r._contentUrls.length-(u.tabs.length-t):n(e).index()-1;i.after(this);f.after(e);r._moveUrlItem(o,n(this).index());r.angular("compile",function(){return{elements:[e]}})}),k(r.tabGroup),r._updateContentElements(u.newTabsCreated),r.resize(!0),r},remove:function(t){var r=this,f=typeof t,u;return f==="string"?t=r.tabGroup.find(t):f==="number"&&(t=r.tabGroup.children().eq(t)),u=t.map(function(){var t=n(this).index(),u=r.contentElement(t);return i.destroy(u),r._removeUrlItem(t),u}),t.remove(),u.empty(),u.remove(),r._updateContentElements(),r.resize(!0),r},_create:function(t){var e=this,r,f,o,s=!1;return t=t instanceof i.data.ObservableArray?t.toJSON():t,n.isPlainObject(t)||n.isArray(t)?(t=n.isArray(t)?t:[t],s=!0,r=et(t,function(i,r){return e._appendUrlItem(t[r].contentUrl||null),n(d.renderItem({group:e.tabGroup,item:u(i,{index:r})}))}),f=et(t,function(t,i){if(typeof t.content=="string"||t.contentUrl)return n(d.renderContent({item:u(t,{index:i})}))})):(r=typeof t=="string"&&t[0]!="<"?e.element.find(t):n(t),f=n(),r.each(function(){if(/k-tabstrip-items/.test(this.parentNode.className)){var t=e.element.find("[id='"+this.getAttribute("aria-controls")+"']");o=t}else o=n("<div class='"+rt+"'/>");f=f.add(o)}),ni(r)),{tabs:r,contents:f,newTabsCreated:s}},_toggleDisabled:function(t,i){t=this.tabGroup.find(t);t.each(function(){n(this).toggleClass(l,i).toggleClass(c,!i).attr("aria-disabled",!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&&!ot(this.nodeValue)}).remove());f>=0&&u.eq(f).addClass(s);i.contentElements=i.wrapper.children("div");i.contentElements.addClass(rt).eq(e).addClass(r).css({display:"block"});u.length&&(ni(u),k(i.tabGroup),i._updateContentElements(!0))},_elementId:function(n,t){var r=n.attr("id"),u=this.element.attr("id"),f;return!r||r.indexOf(u+"-")>-1?(f=(u||i.guid())+"-",f+(t+1)):r},_updateContentElements:function(t){var u=this,o=u._contentUrls,f=u.tabGroup.children(".k-item"),e=u.wrapper.children("div"),s=u._elementId.bind(u);e.length&&f.length>e.length?e.each(function(i){var u=s(n(this),i),r=f.filter("[aria-controls="+(this.id||0)+"]")[0];!r&&t&&(r=f[i]);r&&r.setAttribute("aria-controls",u);this.setAttribute("id",u)}):f.each(function(t){var i=e.eq(t),f=s(i,t);this.setAttribute("aria-controls",f);!i.length&&o[t]?n("<div class='"+rt+"'/>").appendTo(u.wrapper).attr("id",f):(i.attr("id",f),n(this).children(".k-loading")[0]||o[t]||n("<span class='k-loading k-complete'/>").prependTo(this));i.attr("role","tabpanel");i.filter(":not(."+r+")").attr("aria-hidden",!0).attr("aria-expanded",!1);i.filter("."+r).attr("aria-expanded",!0)});u.contentElements=u.contentAnimators=u.wrapper.children("div");u.tabsHeight=nt(u.tabGroup)+parseInt(u.wrapper.css("border-top-width"),10)+parseInt(u.wrapper.css("border-bottom-width"),10);i.kineticScrollNeeded&&i.mobile.ui.Scroller&&(i.touchScroller(u.contentElements),u.contentElements=u.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=p(u),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(nt(n,!0))+(t==="left"||t==="right"?2:this.tabsHeight);this.scrollWrap.css("height",i).css("height")}},_toggleHover:function(t){n(t.currentTarget).toggleClass(ut,t.type==wt)},_click:function(n){var t=this,f=n.find("."+o),i=f.attr(ht),e=t.options.collapsible,s=n.index(),l=t.contentHolder(s),u,h,v=n.parent().children(),p=v.filter("."+a);if(n.closest(".k-widget")[0]==t.wrapper[0])return n.is("."+c+(e?"":",."+r))?(p.removeClass(a),t._focused=n,n.addClass(a),t._current(n),t._scrollableModeActive&&t._scrollTabsToItem(n),!0):(h=f.data(y)||t._contentUrls[s]||i&&(i.charAt(i.length-1)=="#"||i.indexOf("#"+t.element[0].id+"-")!=-1),u=!i||h,t.tabGroup.children("[data-animating]").length)?u:t.trigger(it,{item:n[0],contentElement:l[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,s=n.options,u,e,t,r,o,h;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);o=i.support.mobileOS?"touchstart":"mousedown";h=i.support.mobileOS?"touchend":"mouseup";n.wrapper.append(ti("prev","k-i-arrow-60-left")+ti("next","k-i-arrow-60-right"));t=n._scrollPrevButton=n.wrapper.children(".k-tabstrip-prev");r=n._scrollNextButton=n.wrapper.children(".k-tabstrip-next");n.tabGroup.css({marginLeft:p(t)+9,marginRight:p(r)+12});t.on(o+f,function(){n._nowScrollingTabs=!0;n._scrollTabsByDelta(s.scrollable.distance*(n._isRtl?1:-1))});r.on(o+f,function(){n._nowScrollingTabs=!0;n._scrollTabsByDelta(s.scrollable.distance*(n._isRtl?-1:1))});t.add(r).on(h+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&&!n.scrollable.distance&&(n.scrollable={distance:dt}),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=p(n),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&&!jQuery.fx.off?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(l,{duration:f.duration}),n.kendoRemoveClass(r,{duration:f.duration})):(n.addClass(l),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 v;if(!this.tabGroup.children("[data-animating]").length){n=this.tabGroup.find(n);var t=this,p=t.options.animation,c=p.open,e=u({},p.close),tt=e&&"effects"in e,w=n.parent().children(),a=w.filter("."+r),b=w.index(n);if(e=u(tt?e:u({reverse:!0},c),{hide:!0}),i.size(c.effects)?(a.kendoRemoveClass(r,{duration:e.duration}),n.kendoRemoveClass(ut,{duration:e.duration})):(a.removeClass(r),n.removeClass(ut)),v=t.contentAnimators,t.inRequest&&(t.xhr.abort(),t.inRequest=!1),v.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=v.filter("."+r),f=t.contentHolder(b),k=f.closest(".k-content");if(t.tabsHeight=nt(t.tabGroup)+parseInt(t.wrapper.css("border-top-width"),10)+parseInt(t.wrapper.css("border-bottom-width"),10),t._sizeScrollWrap(h),f.length===0)return h.removeClass(r).attr("aria-hidden",!0).kendoStop(!0,!0).kendoAnimate(e),!1;n.attr("data-animating",!0);var it=(n.children("."+o).data(y)||t._contentUrls[b]||!1)&&f.is(fi),d=function(){a.removeAttr("aria-selected");n.attr("aria-selected",!0);t._current(n);t._sizeScrollWrap(k);k.addClass(r).removeAttr("aria-hidden").kendoStop(!0,!0).attr("aria-expanded",!0).kendoAnimate(u({init:function(){t.trigger(ct,{item:n[0],contentElement:f[0]});i.resize(f)}},c,{complete:function(){n.removeAttr("data-animating");t.trigger(pt,{item:n[0],contentElement:f[0]});i.resize(f);t.scrollWrap.css("height","").css("height");(i.support.browser.msie||i.support.browser.edge)&&f.finish().animate({opacity:.9},"fast","linear",function(){f.finish().animate({opacity:1},"fast","linear")})}}))},g=function(){it?(n.removeAttr("data-animating"),t.ajaxRequest(n,f,function(){n.attr("data-animating",!0);d();t.trigger("change")})):(d(),t.trigger("change"));t._scrollableModeActive&&t._scrollTabsToItem(n)};return h.removeClass(r),t.tabGroup.find("."+s).removeClass(s),n.addClass(s).css("z-index"),i.size(c.effects)?(a.kendoAddClass(l,{duration:c.duration}),n.kendoAddClass(r,{duration:c.duration})):(a.addClass(l),n.addClass(r)),h.attr("aria-hidden",!0),h.attr("aria-expanded",!1),h.length?h.kendoStop(!0,!0).kendoAnimate(u({complete:g},e)):g(),!0}},contentElement:function(r){var u,e,f,o;if(isNaN(+r))return t;if(u=this.contentElements&&this.contentElements[0]&&!i.kineticScrollNeeded?this.contentElements:this.contentAnimators,e=n(this.tabGroup.children()[r]).attr("aria-controls"),u)for(f=0,o=u.length;f<o;f++)if(u.eq(f).closest(".k-content")[0].id==e)return u[f];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 p,c,h;t=this.tabGroup.find(t);var s=this,w=n.ajaxSettings.xhr,l=t.find("."+o),a=t.width()/2,v=!1,e=t.find(".k-loading").removeClass("k-complete");e[0]||(e=n("<span class='k-loading'/>").prependTo(t));p=a*2-e.width();c=function(){e.animate({marginLeft:(parseInt(e.css("marginLeft"),10)||0)<a?p:0},500,c)};i.support.browser.msie&&i.support.browser.version<10&&setTimeout(c,40);f=f||l.data(y)||s._contentUrls[t.index()]||l.attr(ht);s.inRequest=!0;h={type:"GET",cache:!1,url:f,dataType:"html",data:{},xhr:function(){var t=this,i=w(),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(bt,{item:t[0],contentElement:r[0]})}};typeof f=="object"&&(h=n.extend(!0,{},h,f),ri(h.url)&&(h.url=h.url()));s.xhr=n.ajax(h)}});u(d,{renderItem:function(n){n=u({tabStrip:{},group:{}},n);var t=v.empty,i=n.item;return v.item(u(n,{image:i.imageUrl?v.image:t,sprite:i.spriteCssClass?v.sprite:t,itemWrapper:v.itemWrapper},gt))},renderContent:function(n){return v.content(u(n,gt))}});i.ui.plugin(d)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("util/undoredostack",["kendo.core"],n)}(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)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("editor/main",["util/undoredostack","kendo.combobox","kendo.dropdownlist","kendo.window","kendo.colorpicker"],n)}(function(){(function(n,t){var i=window.kendo,y=i.Class,a=i.ui.Widget,h=i.support.mobileOS,f=i.support.browser,c=n.extend,e=n.proxy,g=i.deepExtend,r=i.keys,p="select",w="select.k-select-overlay",b=y.extend({init:function(n){this.options=n},getHtml:function(){var n=this.options;return i.template(n.template,{useWithBlock:!1})(n)}}),l={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:'# var iconCssClass= "k-icon k-i-" + kendo.toHyphens(data.cssClass.replace("k-", ""));#<a tabindex="0" role="button" class="k-tool"#= data.popup ? " data-popup" : "" # unselectable="on" title="#= data.title #"><span unselectable="on" class="k-tool-icon #= iconCssClass #"><\/span><span class="k-tool-text">#= data.title #<\/span><\/a>',colorPickerTemplate:'<div class="k-colorpicker k-icon k-i-#= data.cssClass.replace("k-", "") #" />',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 tabindex="0" role="button" class="k-tool k-overflow-anchor" data-popup unselectable="on" title="#= data.title #" aria-haspopup="true" aria-expanded="false"><span unselectable="on" class="k-icon k-i-more-vertical"><\/span><span class="k-tool-text">#= data.title #<\/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]},getToolCssClass:function(n){var t={superscript:"sup-script",subscript:"sub-script",justifyLeft:"align-left",justifyCenter:"align-center",justifyRight:"align-right",justifyFull:"align-justify",insertUnorderedList:"list-unordered",insertOrderedList:"list-ordered","import":"login",indent:"indent-increase",outdent:"indent-decrease",createLink:"link-horizontal",unlink:"unlink-horizontal",insertImage:"image",insertFile:"file-add",viewHtml:"html",foreColor:"foreground-color",backColor:"paint",createTable:"table-insert",addColumnLeft:"table-column-insert-left",addColumnRight:"table-column-insert-right",addRowAbove:"table-row-insert-above",addRowBelow:"table-row-insert-below",deleteRow:"table-row-delete",deleteColumn:"table-column-delete",tableWizard:"table-properties",tableWizardInsert:"table-wizard",cleanFormatting:"clear-css"}[n];return t?t:n},registerTool:function(n,t){var i=t.options;i&&i.template&&(i.template.options.cssClass="k-"+l.getToolCssClass(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}},nt=!h||h.ios&&h.flatVersion>=500||!h.ios&&typeof document.documentElement.contentEditable!="undefined",o={basic:["bold","italic","underline"],alignment:["justifyLeft","justifyCenter","justifyRight"],lists:["insertUnorderedList","insertOrderedList"],indenting:["indent","outdent"],links:["createLink","unlink"],tables:["tableWizard","createTable","addColumnLeft","addColumnRight","addRowAbove","addRowBelow","deleteRow","deleteColumn"]},u=a.extend({init:function(r,u){var f=this,h,o=i.ui.editor,l,v,y,s,p=o.Dom;nt&&(a.fn.init.call(f,r,u),f.options=g({},f.options,u),f.options.tools=f.options.tools.slice(),r=f.element,s=r[0],y=p.name(s),this._registerHandler(r.closest("form"),"submit",e(f.update,f,t)),v=c({},f.options),v.editor=f,y=="textarea"?(f._wrapTextarea(),l=f.wrapper.find(".k-editor-toolbar"),s.id&&l.attr("aria-controls",s.id)):(f.element.attr("contenteditable",!0).addClass("k-widget k-editor k-editor-inline"),v.popup=!0,l=n('<ul class="k-editor-toolbar" role="toolbar" />').insertBefore(r)),f.toolbar=new o.Toolbar(l[0],v),f.toolbar.bindTo(f),y=="textarea"&&setTimeout(function(){var t=f.wrapper[0].style.height,n=parseInt(t,10),i=f.wrapper.height();t.indexOf("px")>0&&!isNaN(n)&&i>n&&f.wrapper.height(n-(i-n))}),f._resizable(),f._initializeContentElement(f),f.keyboard=new o.Keyboard([new o.BackspaceHandler(f),new o.TypingHandler(f),new o.SystemHandler(f),new o.SelectAllHandler(f)]),f.clipboard=new o.Clipboard(this),f.undoRedoStack=new i.util.UndoRedoStack,u&&u.value?h=u.value:f.textarea?(h=s.value,f.options.encoded&&n.trim(s.defaultValue).length&&(h=s.defaultValue),h=h.replace(/[\r\n\v\f\t ]+/gi," ")):h=s.innerHTML,f.value(h||i.ui.editor.emptyElementContent),this._registerHandler(document,{mousedown:function(){f._endTyping()},mouseup:function(n){f._mouseup(n)}}),f._initializeImmutables(),f.toolbar.resize(),i.notify(f))},setOptions:function(n){var t=this;a.fn.setOptions.call(t,n);n.tools&&t.toolbar.bindTo(t)},_endTyping:function(){var n=this.keyboard;try{n.isTypingInProgress()&&(n.endTyping(!0),this.saveSelection())}catch(t){}},_selectionChange:function(){this._selectionStarted=!1;this.saveSelection();this.trigger("select",{})},_resizable:function(){var r=this.options.resizable,f=n.isPlainObject(r)?r.content===t||r.content===!0:r,u;f&&this.textarea&&(n("<div class='k-resize-handle'><span class='k-icon k-i-arrow-45-down-right' /><\/div>").insertAfter(this.textarea),this.wrapper.addClass("k-resizable"),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}})),i.support.mobileOS.ios&&(u=this.wrapper.getKendoResizable(),u.draggable.options.ignore=w))},_initializeTableResizing:function(){var n=this;i.ui.editor.TableResizing.create(n);n._showTableResizeHandlesProxy=e(n._showTableResizeHandles,n);n.bind(p,n._showTableResizeHandlesProxy)},_destroyTableResizing:function(){var n=this,t=n.tableResizing;t&&(t.destroy(),n.tableResizing=null);n._showTableResizeHandlesProxy&&n.unbind(p,n._showTableResizeHandlesProxy)},_showTableResizeHandles:function(){var t=this,n=t.tableResizing;n&&n.showResizeHandles()},_initializeColumnResizing:function(){i.ui.editor.ColumnResizing.create(this)},_destroyColumnResizing:function(){var n=this;n.columnResizing&&(n.columnResizing.destroy(),n.columnResizing=null)},_initializeRowResizing:function(){i.ui.editor.RowResizing.create(this)},_destroyRowResizing:function(){var n=this;n.rowResizing&&(n.rowResizing.destroy(),n.rowResizing=null)},_wrapTextarea:function(){var i=this,t=i.element,u=t[0].style.width,f=t[0].style.height,e=l.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 e=this,r,s,u,o=e.textarea,l=e.options.domain,a=l||document.domain,c="",v='javascript:""';(l||a!=location.hostname)&&(c='<script>document.domain="'+a+'"<\/script>',v="javascript:document.write('"+c+"')");o.hide();r=n("<iframe />",{title:e.options.messages.editAreaTitle,frameBorder:"0"})[0];n(r).css("display","").addClass("k-content").attr("tabindex",o[0].tabIndex).insertBefore(o);r.src=v;s=r.contentWindow||r;u=s.document||r.contentDocument;n(r).one("load",function(){e.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{box-sizing:border-box;font-size:12px;font-family:Verdana,Geneva,sans-serif;margin-top:-1px;padding:5px .4em 0;word-wrap: break-word;-webkit-nbsp-mode: space;-webkit-line-break: after-white-space;"+(i.support.isRtl(o)?"direction:rtl;":"")+(f.msie||f.edge?"height:auto;":"")+(h.ios?"word-break:break-all;":"")+"}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{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-column-resize-handle-wrapper {position: absolute; height: 10px; width:10px; cursor: col-resize; z-index: 2;}.k-column-resize-handle {width: 100%; height: 100%;}.k-column-resize-handle > .k-column-resize-marker {width:2px; height:100%; margin:0 auto; background-color:#00b0ff; display:none; opacity:0.8;}.k-row-resize-handle-wrapper {position: absolute; cursor: row-resize; z-index:2; width: 10px; height: 10px;}.k-row-resize-handle {display: table; width: 100%; height: 100%;}.k-row-resize-marker-wrapper{display: table-cell; height:100%; width:100%; margin:0; padding:0; vertical-align: middle;}.k-row-resize-marker{margin: 0; padding:0; width:100%; height:2px; background-color: #00b0ff; opacity:0.8; display:none;}.k-table-resize-handle-wrapper {position: absolute; background-color: #fff; border: 1px solid #000; z-index: 100; width: 5px; height: 5px;}.k-table-resize-handle {width: 100%; height: 100%;}.k-table-resize-handle.k-resize-east{cursor:e-resize;}.k-table-resize-handle.k-resize-north{cursor:n-resize;}.k-table-resize-handle.k-resize-northeast{cursor:ne-resize;}.k-table-resize-handle.k-resize-northwest{cursor:nw-resize;}.k-table-resize-handle.k-resize-south{cursor:s-resize;}.k-table-resize-handle.k-resize-southeast{cursor:se-resize;}.k-table-resize-handle.k-resize-southwest{cursor:sw-resize;}.k-table-resize-handle.k-resize-west{cursor:w-resize;}.k-table.k-table-resizing{opacity:0.6;}k\\:script{display:none;}<\/style>"+c+"<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(),s},_blur:function(){var t=this.textarea,i=t?t.val():this._oldValue,r=this.options.encoded?this.encodedValue():this.value();this.update();t&&t.trigger("blur");r!=i&&(this.trigger("change"),t&&n(t.get(0).ownerDocument).trigger("change"))},_spellCorrect:function(n){var t,r=!1;this._registerHandler(n.body,{contextmenu:function(){n.one("select",function(){t=null});n._spellCorrectTimeout=setTimeout(function(){t=new i.ui.editor.RestorePoint(n.getRange(),n.body);r=!1},10)},input:function(){if(t){if(i.support.browser.mozilla&&!r){r=!0;return}i.ui.editor._finishUpdate(n,t)}}})},_registerHandler:function(t,r,u){var h=this,s=".kendoEditor",e,f,o;if(t=n(t),this._handlers||(this._handlers=[]),t.length)if(n.isPlainObject(r))for(o in r)r.hasOwnProperty(o)&&this._registerHandler(t,o,r[o]);else for(e=i.applyEventMap(r).split(" "),f=0;f<e.length;f++){h._handlers.push({element:t,type:e[f]+s,handler:u});t.on(e[f]+s,u)}},_deregisterHandlers:function(){for(var n,i=this._handlers,t=0;t<i.length;t++)n=i[t],n.element.off(n.type,n.handler);this._handlers=[]},_initializeContentElement:function(){var t=this,u,o,s,f,h;t.textarea?(t.window=t._createContentElement(t.options.stylesheets),u=t.document=t.window.contentDocument||t.window.document,u.body||(f=u.createElement("body"),f.setAttribute("contenteditable","true"),f.setAttribute("autocorrect","off"),u.getElementsByTagName("html")[0].appendChild(f),h=setInterval(function(){n(t.document).find("body").length>1&&(n(t.document).find("body:last").remove(),window.clearInterval(h))},10)),t.body=u.body,o=t.window,s=u,this._registerHandler(u,"mouseup",e(this._mouseup,this))):(t.window=window,u=t.document=document,t.body=t.element[0],o=t.body,s=t.body,t.toolbar.decorateFrom(t.body));this._registerHandler(o,"blur",e(this._blur,this));t._registerHandler(s,"down",e(t._mousedown,t));try{u.execCommand("enableInlineTableEditing",null,!1)}catch(c){}i.support.touch&&this._registerHandler(u,{keydown:function(){i._activeElement()!=u.body&&t.window.focus()}});this._spellCorrect(t);this._registerHandler(t.body,{keydown:function(n){var i;if((n.keyCode===r.BACKSPACE||n.keyCode===r.DELETE)&&t.body.getAttribute("contenteditable")!=="true")return!1;if(n.keyCode===r.F10){setTimeout(e(t.toolbar.focus,t.toolbar),100);n.preventDefault();return}if(n.keyCode==r.LEFT||n.keyCode==r.RIGHT){i=t.getRange();var f=n.keyCode==r.LEFT,o=i[f?"startContainer":"endContainer"],s=i[f?"startOffset":"endOffset"],l=f?-1:1,h=s+l,a=f?h:s;o.nodeType==3&&o.nodeValue[a]=="﻿"&&(i.setStart(o,h),i.collapse(!0),t.selectRange(i))}var c=t.toolbar.tools,u=t.keyboard.toolFromShortcut(c,n),v=u?c[u].options:{};if(u&&!v.keyPressCommand)return n.preventDefault(),/^(undo|redo)$/.test(u)||t.keyboard.endTyping(!0),t.trigger("keydown",n),t.exec(u),t._runPostContentKeyCommands(n),!1;t.keyboard.clearTimeout();t.keyboard.keydown(n)},keypress:function(n){setTimeout(function(){t._runPostContentKeyCommands(n);t._showTableResizeHandles()},0)},keyup:function(i){var u=[r.BACKSPACE,r.TAB,r.PAGEUP,r.PAGEDOWN,r.END,r.HOME,r.LEFT,r.UP,r.RIGHT,r.DOWN,r.INSERT,r.DELETE];(n.inArray(i.keyCode,u)>-1||i.keyCode==65&&i.ctrlKey&&!i.altKey&&!i.shiftKey)&&t._selectionChange();t.keyboard.keyup(i)},click:function(n){var u=i.ui.editor.Dom,r;u.name(n.target)==="img"&&(r=t.createRange(),r.selectNode(n.target),t.selectRange(r))},"cut copy paste drop dragover":function(n){t.clipboard["on"+n.type](n)},focusin:function(){t.body.hasAttribute("contenteditable")&&(n(this).addClass("k-state-active"),t.toolbar.show())},focusout:function(){setTimeout(function(){var r=i._activeElement(),e=t.body,u=t.toolbar,f;u.options.popup&&(f=u.window.element.get(0),!f||n.contains(f,r)||f==r||(u.preventPopupHide=!1));r==e||n.contains(e,r)||n(r).is(".k-editortoolbar-dragHandle")||u.focused()||(n(e).removeClass("k-state-active"),u.hide())},10)}});t._initializeColumnResizing();t._initializeRowResizing();t._initializeTableResizing()},_initializeImmutables:function(){var n=this,t=i.ui.editor;n.options.immutables&&(n.immutables=new t.Immutables(n))},_mousedown:function(t){var r=this,i;(r._selectionStarted=!0,n(r.body).parents(".k-window").length&&t.stopPropagation(),f.gecko)||(i=n(t.target),(t.which==2||t.which==1&&t.ctrlKey)&&i.is("a[href]")&&window.open(i.attr("href"),"_new"))},_mouseup:function(t){var r=this;i.support.mobileOS.ios&&t&&n(t.target).is(w)||r._selectionStarted&&setTimeout(function(){r._selectionChange()},1)},_runPostContentKeyCommands:function(n){for(var i,r,f,e=this.getRange(),u=this.keyboard.toolsFromShortcut(this.toolbar.tools,n),t=0;t<u.length;t++)(i=u[t],r=i.options,r.keyPressCommand)&&(f=new r.command({range:e}),f.changesContent()&&(this.keyboard.endTyping(!0),this.exec(i.name)))},refresh:function(){var n=this,t;n.textarea&&(n._destroyResizings(),t=n.value(),n.textarea.val(t),n.wrapper.find("iframe").remove(),n._initializeContentElement(n),n.value(t))},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",overflowAnchor:"More tools",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",fileText:"Text",linkWebAddress:"Web address",linkText:"Text",linkToolTip:"ToolTip",linkOpenInNewWindow:"Open link in new window",dialogUpdate:"Update",dialogInsert:"Insert",dialogOk:"Ok",dialogCancel:"Cancel",cleanFormatting:"Clean formatting",createTable:"Create a 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",tableWizard:"Table Wizard",tableTab:"Table",cellTab:"Cell",accessibilityTab:"Accessibility",caption:"Caption",summary:"Summary",width:"Width",height:"Height",units:"Units",cellSpacing:"Cell Spacing",cellPadding:"Cell Padding",cellMargin:"Cell Margin",alignment:"Alignment",background:"Background",cssClass:"CSS Class",id:"ID",border:"Border",borderStyle:"Border Style",collapseBorders:"Collapse borders",wrapText:"Wrap text",associateCellsWithHeaders:"Associate cells with headers",alignLeft:"Align Left",alignCenter:"Align Center",alignRight:"Align Right",alignLeftTop:"Align Left Top",alignCenterTop:"Align Center Top",alignRightTop:"Align Right Top",alignLeftMiddle:"Align Left Middle",alignCenterMiddle:"Align Center Middle",alignRightMiddle:"Align Right Middle",alignLeftBottom:"Align Left Bottom",alignCenterBottom:"Align Center Bottom",alignRightBottom:"Align Right Bottom",alignRemove:"Remove Alignment",columns:"Columns",rows:"Rows",selectAllCells:"Select All Cells",exportAs:"Export As","import":"Import"},formats:{},encoded:!0,domain:null,resizable:!1,deserialization:{custom:null},serialization:{entities:!0,semantic:!0,scripts:!1},pasteCleanup:{all:!1,css:!1,custom:null,keepNewLines:!1,msAllFormatting:!1,msConvertLists:!0,msTags:!0,none:!1,span:!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"],o.basic,o.alignment,o.lists,o.indenting,o.links,["insertImage"],o.tables)},destroy:function(){var n=this;a.fn.destroy.call(this);this._endTyping(!0);this._deregisterHandlers();clearTimeout(this._spellCorrectTimeout);this._focusOutside();this.toolbar.destroy();n._destroyUploadWidget();n._destroyResizings();i.destroy(this.wrapper)},_destroyResizings:function(){var n=this;n._destroyTableResizing();i.ui.editor.TableResizing.dispose(n);n._destroyRowResizing();i.ui.editor.RowResizing.dispose(n);n._destroyColumnResizing();i.ui.editor.ColumnResizing.dispose(n)},_focusOutside:function(){if(i.support.browser.msie&&this.textarea){var t=n("<input style='position:fixed;left:1px;top:1px;width:1px;height:1px;font-size:0;border:0;opacity:0' />").appendTo(document.body).focus();t.blur().remove()}},_destroyUploadWidget:function(){var n=this;n._uploadWidget&&(n._uploadWidget.destroy(),n._uploadWidget=null)},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=this.options,e=u.Serializer.domToXhtml(r,f.serialization);if(n===t)return e;n!=e&&(u.Serializer.htmlToDom(n,r,f.deserialization),this.selectionRestorePoint=null,this.update(),this.toolbar.refreshTools())},saveSelection:function(t){t=t||this.getRange();var u=t.commonAncestorContainer,r=this.body;(u==r||n.contains(r,u))&&(this.selectionRestorePoint=new i.ui.editor.RestorePoint(t,r))},_focusBody:function(){var n=this.body,r=this.wrapper&&this.wrapper.find("iframe")[0],u=this.document.documentElement,f=i._activeElement(),t;r?f!=n&&f!=r&&(t=u.scrollTop,n.focus(),u.scrollTop=t):(t=n.scrollTop,n.focus(),n.scrollTop=t)},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},_containsRange:function(n){var t=i.ui.editor.Dom,r=this.body;return n&&t.isAncestorOrSelf(r,n.startContainer)&&t.isAncestorOrSelf(r,n.endContainer)},selectedHtml:function(){return i.ui.editor.Serializer.domToXhtml(this.getRange().cloneContents())},paste:function(t,r){this.focus();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,f,h,o;if(!n)throw new Error("kendoEditor.exec(): `name` parameter cannot be empty");if(i.body.getAttribute("contenteditable")!=="true"&&n!=="print"&&n!=="pdf")return!1;if(n=n.toLowerCase(),i.keyboard.isTypingInProgress()||(i._focusBody(),i.selectRange(i._range||i.getRange())),f=i.toolbar.toolById(n),!f)for(o in u.defaultTools)if(o.toLowerCase()==n){f=u.defaultTools[o];break}if(f){if(s=i.getRange(),f.command&&(r=f.command(c({range:s,body:i.body,immutables:!!i.immutables},t))),h=i.trigger("execute",{name:n,command:r}),h)return;if(/^(undo|redo)$/i.test(n))i.undoRedoStack[n]();else if(r&&(i.execCommand(r),r.async)){r.change=e(i._selectionChange,i);return}i._selectionChange()}},execCommand:function(n){n.managesUndoRedo||this.undoRedoStack.push(n);n.editor=this;n.exec()}}),s,k;u.defaultTools={undo:{options:{key:"Z",ctrl:!0}},redo:{options:{key:"Y",ctrl:!0}}};i.ui.plugin(u);s=y.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});s.exec=function(n,t,i){n.exec(t,{value:i})};k=s.extend({init:function(n){s.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)}});l.registerTool("separator",new s({template:new b({template:l.separatorTemplate})}));var tt=f.msie&&f.version<9?"﻿":"",v="﻿",d=v;(f.msie||f.edge)&&(d=v="&nbsp;");c(i.ui,{editor:{ToolTemplate:b,EditorUtils:l,Tool:s,FormatTool:k,_bomFill:tt,emptyElementContent:v,emptyTableCellContent:d}});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(),f={promise:u},t;if(!this.trigger("pdfExport",f))return t=this.options.pdf,this._drawPDF(r).then(function(n){return i.drawing.exportPDF(n,t)}).done(function(n){i.saveAs({dataURI:n,fileName:t.fileName,proxyURL:t.proxyURL,proxyTarget:t.proxyTarget,forceProxy:t.forceProxy});r.resolve()}).fail(function(n){r.reject(n)}),u})})(window.kendo.jQuery)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("editor/dom",["editor/main"],n)}(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,c=n.extend,f=i.support.browser,e="style",l="float",a="cssFloat",v="styleFloat",y="class",p="k-marker",o=r("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed".split(",")),w="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=w.concat(["ul","ol","li"]),b=r(s),k="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(","),d=r(k),it=r("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected".split(",")),g=function(n){n.nodeType==1&&n.normalize()};f.msie&&f.version>=8&&(g=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 rt=/^\s+$/,nt=/^[\n\r\t]+$/,ut=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,tt=/\ufeff/g,ft=/^(\s+|\ufeff)$/,h,et="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(","),ot=/[<>\&]/g,st=/[\u00A0-\u2666<>\&]/g,ht={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:b,inline:d,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==l&&(f=n[i.support.cssFloat?a:v]),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:g,blockElements:s,nonListBlockElements:w,inlineElements:k,empty:o,fillAttrs:it,nodeTypes:{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12},toHex:function(n){var t=ut.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?st:ot;return n.replace(i,function(n){var i=n.charCodeAt(0),t=ht[i];return t?"&"+t+";":n})},isBom:function(n){return n&&n.nodeType===3&&/^[\ufeff]+$/.test(n.nodeValue)},stripBom:function(n){return(n||"").replace(tt,"")},stripBomNode:function(n){t.isBom(n)&&n.parentNode.removeChild(n)},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)},tableCell:function(n){return t.is(n,"td")||t.is(n,"th")},significantNodes:function(i){return n.grep(i,function(n){var i=t.name(n);return i=="br"?!1:t.insignificant(n)||t.emptyTextNode(n)||n.nodeType==1&&!o[i]&&t.emptyNode(n)?!1:!0})},emptyTextNode:function(n){return n&&n.nodeType==3&&ft.test(n.nodeValue)},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 n&&t.name(n)==i},isMarker:function(n){return n.className==p},isWhitespace:function(n){return rt.test(n.nodeValue)},allWhitespaceContent:function(n){for(var i=n.firstChild;i&&t.isWhitespace(i);)i=i.nextSibling;return!i},isEmptyspace:function(n){return nt.test(n.nodeValue)},htmlIndentSpace:function(i){var e,o;if(!(t.isDataNode(i)&&t.isWhitespace(i)))return!1;if(nt.test(i.nodeValue))return!0;var s=function(n,i){while(n[i])if(n=n[i],t.significantNodes([n]).length>0)return n},f=i.parentNode,r=s(i,"previousSibling"),u=s(i,"nextSibling");return tt.test(i.nodeValue)?!!(r||u):n(f).is("tr,tbody,thead,tfoot,table,ol,ul")?!0:(t.isBlock(f)||t.is(f,"body"))&&(e=r&&t.isBlock(r),o=u&&t.isBlock(u),!u&&e||!r&&o||e&&o)?!0:!1},isBlock:function(n){return b[t.name(n)]},isEmpty:function(n){return o[t.name(n)]},isInline:function(n){return d[t.name(n)]},list:function(n){var i=n?t.name(n):"";return i=="ul"||i=="ol"||i=="dl"},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,r){var o=i.ownerDocument,l=t.windowFromDocument(o),h=l.innerHeight,c=t.scrollContainer(o),u,s,f,e;t.isDataNode(i)?r?(e=t.create(o,"span",{innerHTML:"&#xfeff;"}),t.insertBefore(e,i),u=n(e)):u=n(i.parentNode):u=n(i);s=u.offset().top;f=u[0].offsetHeight;(r||!f)&&(f=parseInt(u.css("line-height"),10)||Math.ceil(1.2*parseInt(u.css("font-size"),10))||15);e&&t.remove(e);f+s>c.scrollTop+h&&(c.scrollTop=f+s-h)},persistScrollTop:function(n){h=t.scrollContainer(n).scrollTop},offset:function(n,i){for(var u={top:n.offsetTop,left:n.offsetLeft},r=n.offsetParent;r&&(!i||t.isAncestorOf(i,r));)u.top+=r.offsetTop,u.left+=r.offsetLeft,r=r.offsetParent;return u},restoreScrollTop:function(n){typeof h=="number"&&(t.scrollContainer(n).scrollTop=h)},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&&n.parentNode.removeChild(n)},removeChildren:function(n){while(n.firstChild)n.removeChild(n.firstChild)},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):i.className!=p&&(t.trim(i),(i.childNodes.length===0||t.allWhitespaceContent(i)&&t.isBlock(i)&&!t.isEmpty(i))&&t.remove(i));return n},closest:function(n,i){while(n&&t.name(n)!=i)n=n.parentNode;return n},closestBy:function(n,t,i){while(n&&!t(n)){if(i&&i(n))return null;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==y?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)},wrapper:function(i){var r=t.closestBy(i,function(n){return n.parentNode&&t.significantNodes(n.parentNode.childNodes).length>1});return n(r).is("body,.k-editor")?undefined:r},create:function(n,i,r){return t.attr(n.createElement(i),r)},attr:function(n,i){i=c({},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 c(n,i)},style:function(t,i){n(t).css(i||{})},unstyle:function(n,t){for(var r in t)r==l&&(r=i.support.cssFloat?a:v),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(et,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())},innerText:function(n){var t=n.innerHTML;return t=t.replace(/<!--(.|\s)*?-->/gi,""),t.replace(/<\/?[^>]+?\/?>/gm,"")},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(y)},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){var u=function(i){return t.name(i)==n};return t.filterBy(i,u,r)},filterBy:function(n,t,i){for(var r=0,e=n.length,f=[],u;r<e;r++)u=t(n[r]),(u&&!i||!u&&i)&&f.push(n[r]);return f},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)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("editor/serializer",["editor/dom"],n)}(function(){(function(n,t){var u=window.kendo,f=u.ui.editor,i=f.Dom,y=n.extend,s="xx-small,x-small,small,medium,large,x-large,xx-large".split(","),h=/"/g,p=/<br[^>]*>/i,c=/^\d+(\.\d*)?(px)?$/i,w=/<p>(?:&nbsp;)?<\/p>/i,l=/(\*?[-#\/\*\\\w]+(?:\[[0-9a-z_-]+\])?)\s*:\s*((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/g,b=/^sizzle-\d+/i,a=/^k-script-/i,k=/\s*onerror\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/i,e='<br class="k-br">',o=document.createElement("div"),v;o.innerHTML=" <hr>";v=o.firstChild.nodeType===3;o=null;var d=n.isFunction,g="td",r={toEditableHtml:function(n){return(n||"").replace(/<!\[CDATA\[(.*)?\]\]>/g,"<!--[CDATA[$1]]-->").replace(/<(\/?)script([^>]*)>/gi,"<$1k:script$2>").replace(/<img([^>]*)>/gi,function(n){return n.replace(k,"")}).replace(/(<\/?img[^>]*>)[\r\n\v\f\t ]+/gi,"$1").replace(/^<(table|blockquote)/i,e+"<$1").replace(/^[\s]*(&nbsp;|\u00a0)/i,"$1").replace(/<\/(table|blockquote)>$/i,"<\/$1>"+e)},_toEditableImmutables:function(t){for(var o=f.Immutables.immutable,s=i.emptyTextNode,r=t.firstChild,u=t.lastChild;s(r);)r=r.nextSibling;while(s(u))u=u.previousSibling;r&&o(r)&&n(e).prependTo(t);u&&o(u)&&n(e).appendTo(t)},_fillEmptyElements:function(t){n(t).find("p,td").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=i.is(t,"td")?u.ui.editor.emptyTableCellContent: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,e){var c=u.support.browser,l=c.msie,a=l&&c.version<9,o="originalsrc",s="originalhref",h=e||{},v=h.immutables;return t=r.toEditableHtml(t),a&&(t="<br/>"+t,t=t.replace(/href\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/,s+'="$1"'),t=t.replace(/src\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/,o+'="$1"')),d(h.custom)&&(t=h.custom(t)||t),f.innerHTML=t,v&&v.deserialize(f),a?(i.remove(f.firstChild),n(f).find("k\\:script,script,link,img,a").each(function(){var n=this;n[s]&&(n.setAttribute("href",n[s]),n.removeAttribute(s));n[o]&&(n.setAttribute("src",n[o]),n.removeAttribute(o))})):l&&(i.normalize(f),r._resetOrderedLists(f)),r._preventScriptExecution(f),r._fillEmptyElements(f),r._removeSystemElements(f),r._toEditableImmutables(f),n("table",f).addClass("k-table"),f},domToXhtml:function(r,e){function rt(t){return n.grep(t,function(n){return n.name!="style"})}function y(n,t){o.push("<"+t);d(n);o.push(">")}function et(t){var e=n.trim,s=e(t),f,u,r,o=[];for(l.lastIndex=0;;){if(f=l.exec(s),!f)break;(u=e(f[1].toLowerCase()),r=e(f[2]),u!="font-size-adjust"&&u!="font-stretch")&&(u.indexOf("color")>=0?r=i.toHex(r):u.indexOf("font")>=0?r=r.replace(h,"'"):/\burl\(/g.test(r)&&(r=r.replace(h,"")),o.push({property:u,value:r}))}return o}function ot(n){for(var i=et(n),t=0;t<i.length;t++)o.push(i[t].property),o.push(":"),o.push(i[t].value),o.push(";")}function k(n){for(var s=[],h=n.attributes,u,r,f,t,o=0,c=h.length;o<c;o++)u=h[o],r=u.nodeName,f=u.value,t=u.specified,r=="value"&&"value"in n&&n.value?t=!0:r=="type"&&f=="text"?t=!0:r!="class"||f?b.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")&&f=="1"?t=!1:r.indexOf("_moz")>=0?t=!1:a.test(r)?t=!!e.scripts:r=="data-role"&&f=="resizable"&&(i.is(n,"tr")||i.is(n,"td"))&&(t=!1):t=!1,t&&s.push(u);return s}function d(r,f){var s,p,l,e,h;if(f=f||k(r),i.is(r,"img")){var v=r.style.width,y=r.style.height,w=n(r);v&&c.test(v)&&(w.attr("width",parseInt(v,10)),i.unstyle(r,{width:t}));y&&c.test(y)&&(w.attr("height",parseInt(y,10)),i.unstyle(r,{height:t}))}if(f.length)for(s=0,p=f.length;s<p;s++)(l=f[s],e=l.nodeName,h=l.value,e!="class"||h!="k-table")&&(e=e.replace(a,""),o.push(" "),o.push(e),o.push('="'),e=="style"?ot(h||r.style.cssText):e=="src"||e=="href"?o.push(u.htmlEncode(r.getAttribute(e,2))):o.push(i.fillAttrs[e]?e:h),o.push('"'))}function tt(n,t,i){for(var r=n.firstChild;r;r=r.nextSibling)ht(r,t,i)}function ut(n){return n.nodeValue.replace(/\ufeff/g,"")}function st(n){if(i.isBom(n)){do{if(n=n.parentNode,i.is(n,g)&&n.childNodes.length===1)return!0;if(n.childNodes.length!==1)return!1}while(!i.isBlock(n));return!0}return!1}function ht(t,r,u){var a=t.nodeType,s,h,p,c,l,y;if(it&&f.Immutables.immutable(t))o.push(it.serialize(t));else if(a==1){if(s=i.name(t),y=n(t),y.hasClass("k-table-resize-handle-wrapper")||y.hasClass("k-column-resize-handle-wrapper")||y.hasClass("k-row-resize-handle-wrapper"))return;if(!s||i.insignificant(t))return;if(!e.scripts&&(s=="script"||s=="k:script"))return;if(h=nt[s],h&&(typeof h.semantic=="undefined"||e.semantic^h.semantic)){h.start(t);tt(t,!1,h.skipEncoding);h.end(t);return}o.push("<");o.push(s);d(t);i.empty[s]?o.push(" />"):(o.push(">"),tt(t,r||i.is(t,"pre")),o.push("<\/"),o.push(s),o.push(">"))}else if(a==3){if(st(t)){o.push("&nbsp;");return}c=ut(t);!r&&v&&(p=t.parentNode,l=t.previousSibling,l||(l=(i.isInline(p)?p:t).previousSibling),(!l||l.innerHTML===""||i.isBlock(l))&&(c=c.replace(/^[\r\n\v\f\t ]+/,"")),c=c.replace(/ +/," "));o.push(u?c:i.encode(c,e))}else a==4?(o.push("<![CDATA["),o.push(t.data),o.push("]\]>")):a==8&&(t.data.indexOf("[CDATA[")<0?(o.push("<!--"),o.push(t.data),o.push("-->")):(o.push("<!"),o.push(t.data),o.push(">")))}function ct(n){var t=n.childNodes.length,r=t&&n.firstChild.nodeType==3;return r&&(t==1||t==2&&i.insignificant(n.lastChild))}function ft(){n.isFunction(e.custom)&&(o=e.custom(o)||o)}var o=[],it=e&&e.immutables,nt={iframe:{start:function(n){y(n,"iframe")},end:function(){o.push("<\/iframe>")}},"k:script":{start:function(n){y(n,"script")},end:function(){o.push("<\/script>")},skipEncoding:!0},span:{semantic:!0,start:function(t){var r=t.style,h=k(t),f=rt(h),u,e;f.length&&(o.push("<span"),d(t,f),o.push(">"));r.textDecoration=="underline"&&o.push("<u>");u=[];r.color&&u.push('color="'+i.toHex(r.color)+'"');r.fontFamily&&u.push('face="'+r.fontFamily+'"');r.fontSize&&(e=n.inArray(r.fontSize,s),u.push('size="'+e+'"'));u.length&&o.push("<font "+u.join(" ")+">")},end:function(n){var t=n.style;(t.color||t.fontFamily||t.fontSize)&&o.push("<\/font>");t.textDecoration=="underline"&&o.push("<\/u>");rt(k(n)).length&&o.push("<\/span>")}},strong:{semantic:!0,start:function(n){y(n,"b")},end:function(){o.push("<\/b>")}},em:{semantic:!0,start:function(n){y(n,"i")},end:function(){o.push("<\/i>")}},b:{semantic:!1,start:function(n){y(n,"strong")},end:function(){o.push("<\/strong>")}},i:{semantic:!1,start:function(n){y(n,"em")},end:function(){o.push("<\/em>")}},u:{semantic:!1,start:function(t){o.push("<span");var i=k(t),u=n(i).filter(function(n,t){return t.name=="style"})[0],r={nodeName:"style",value:"text-decoration:underline;"};u&&(r.value=u.value,/text-decoration/i.test(r.value)||(r.value="text-decoration:underline;"+r.value),i.splice(n.inArray(u,i),1));i.push(r);d(t,i);o.push(">")},end:function(){o.push("<\/span>")}},font:{semantic:!1,start:function(n){o.push('<span style="');var t=n.getAttribute("color"),r=s[n.getAttribute("size")],u=n.getAttribute("face");t&&(o.push("color:"),o.push(i.toHex(t)),o.push(";"));u&&(o.push("font-family:"),o.push(u),o.push(";"));r&&(o.push("font-size:"),o.push(r),o.push(";"));o.push('">')},end:function(){o.push("<\/span>")}}};return(nt.script=nt["k:script"],e=e||{},typeof e.semantic=="undefined"&&(e.semantic=!0),ct(r))?(o=i.encode(ut(r.firstChild).replace(/[\r\n\v\f\t ]+/," "),e),ft(),o):(tt(r),o=o.join(""),ft(),o.replace(p,"").replace(w,"")==="")?"":o}};y(f,{Serializer:r})})(window.kendo.jQuery)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("editor/range",["editor/serializer"],n)}(function(){(function(n){function rt(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 b(n,t){function i(n){try{return rt(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 k(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 ut(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 c=window.kendo,o=c.Class,it=n.extend,f=c.ui.editor,y=c.support.browser,t=f.Dom,u=t.findNodeIndex,i=t.isDataNode,l=t.findClosestAncestor,p=t.getNodeLength,h=t.normalize,a={selectionFromWindow:function(n){return("getSelection"in n)?n.getSelection():new w(n.document)},selectionFromRange:function(n){var t=r.documentFromRange(n);return a.selectionFromDocument(t)},selectionFromDocument:function(n){return a.selectionFromWindow(t.windowFromDocument(n))}},s=o.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;k(this);b(this,!0)},setEnd:function(n,t){this.endContainer=n;this.endOffset=t;k(this);b(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(l(n.commonAncestorContainer,n.startContainer));n.collapse(!0),function i(n){while(n.next())n.hasPartialSubtree()?i(n.getSubtreeIterator()):n.remove()}(new e(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 e(this))},extractContents:function(){var n=this,i=n.cloneRange(),t;return n.startContainer!=n.commonAncestorContainer&&n.setStartAfter(l(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 e(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 s(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("")}}),e,w;s.fromNode=function(n){return new s(n.ownerDocument)};e=o.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]:l(r,t.startContainer);this._end=t.endContainer==r&&!i(t.endContainer)?t.endContainer.childNodes[t.endOffset]:l(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(){return new e(this.getSubRange())},getSubRange: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),i}});w=o.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 s(this.ownerDocument),l=this.ownerDocument.selection,a,o,h,c;try{if(r=l.createRange(),a=r.item?r.item(0):r.parentElement(),a.ownerDocument!=this.ownerDocument)return n}catch(v){return n}if(l.type=="Control")n.selectNode(r.item(0));else{o=ut(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==p(n.endContainer)&&!(t==f&&i(t)&&t.parentNode==e)){for(h=!1,c=!1;u(t)===0&&t==t.parentNode.firstChild&&t!=e;)t=t.parentNode,h=!0;while(u(f)==p(f.parentNode)-1&&f==f.parentNode.lastChild&&f!=e)f=f.parentNode,c=!0;t==e&&f==e&&h&&c&&(n.setStart(t,0),n.setEnd(f,p(e)))}}return n}});var nt=o.extend({init:function(n){this.enumerate=function(){function r(n){if(t.is(n,"img")||n.nodeType==3&&(!t.isEmptyspace(n)||n.nodeValue=="﻿"))i.push(n);else for(n=n.firstChild;n;)r(n),n=n.nextSibling}var i=[];return new e(n).traverse(r),i}}}),tt=e.extend({hasPartialSubtree:function(){var n=f.Immutables&&f.Immutables.immutable;return n&&!n(this._current)&&e.fn.hasPartialSubtree.call(this)},getSubtreeIterator:function(){return new tt(this.getSubRange())}}),ft=o.extend({init:function(n){this.enumerate=function(){function u(n){if(r&&!r(n))if(t.is(n,"img")||n.nodeType==3&&(!t.isEmptyspace(n)||n.nodeValue=="﻿"))i.push(n);else for(n=n.firstChild;n;)u(n),n=n.nextSibling}var i=[],r=f.Immutables&&f.Immutables.immutable;return new tt(n).traverse(u),i}}}),et=o.extend({init:function(n,i,u){var e=this;e.range=n;e.rootNode=r.documentFromRange(n);e.body=i||e.getEditable(n);t.name(e.body)!="body"&&(e.rootNode=e.body);e.startContainer=e.nodeToPath(n.startContainer);e.endContainer=e.nodeToPath(n.endContainer);e.startOffset=e.offset(n.startContainer,n.startOffset);e.endOffset=e.offset(n.endContainer,n.endOffset);e.immutables=u&&u.immutables;e.immutables&&(e.serializedImmutables=f.Immutables.removeImmutables(e.body));e.html=e.body.innerHTML;e.immutables&&!e.serializedImmutables.empty&&f.Immutables.restoreImmutables(e.body,e.serializedImmutables)},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.attributes.contentEditable.nodeValue.toLowerCase()=="false"));)t=t.parentNode;return t},restoreHtml:function(){var n=this;t.removeChildren(n.body);n.body.innerHTML=n.html;n.immutables&&!n.serializedImmutables.empty&&f.Immutables.restoreImmutables(n.body,n.serializedImmutables)},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}}),ot=o.extend({init:function(){this.caret=null},addCaret:function(n){var u=this,i=u.caret=t.create(r.documentFromRange(n),"span",{className:"k-marker"});return n.insertNode(i),t.stripBomNode(i.previousSibling),t.stripBomNode(i.nextSibling),n.selectNode(i),i},removeCaret:function(n){var s=this,r=s.caret.previousSibling,c=0,f,l,e,o;r&&(c=i(r)?r.nodeValue.length:u(r));f=s.caret.parentNode;l=r?u(r):0;t.remove(s.caret);h(f);e=f.childNodes[l];i(e)?n.setStart(e,c):e?(o=t.lastTextNode(e),o?n.setStart(o,o.nodeValue.length):n[r?"setStartAfter":"setStartBefore"](e)):(y.msie||f.innerHTML||(f.innerHTML='<br _moz_dirty="" />'),n.selectNodeContents(f));n.collapse(!0)},add:function(n,i){var u=this,s=n.collapsed&&!r.isExpandable(n),o=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(o,"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),s&&(e=o.createTextNode("﻿"),t.insertAfter(e.cloneNode(),u.start),t.insertBefore(e,u.end)),h(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,a,v,w,s,e,c,o,l;for(h(n.commonAncestorContainer);!r.nextSibling&&r.parentNode;)r=r.parentNode;while(!u.previousSibling&&u.parentNode)u=u.parentNode;if(a=r.previousSibling&&r.previousSibling.nodeType==3&&r.nextSibling&&r.nextSibling.nodeType==3,v=u.previousSibling&&u.previousSibling.nodeType==3&&u.nextSibling&&u.nextSibling.nodeType==3,w=a&&v,r=r.nextSibling,u=u.previousSibling,s=r===u&&t.isBom(r),s&&r.length>1&&(r.nodeValue=r.nodeValue.charAt(0)),e=s,c=!1,r==f.end&&(c=!!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(o=e?i(r)?r.nodeValue.length:r.childNodes.length:0,l=i(u)?u.nodeValue.length:u.childNodes.length,r.nodeType==3)while(r.previousSibling&&r.previousSibling.nodeType==3)r=r.previousSibling,o+=r.nodeValue.length;if(u.nodeType==3)while(u.previousSibling&&u.previousSibling.nodeType==3)u=u.previousSibling,l+=u.nodeValue.length;var y=r.parentNode,p=u.parentNode,b=this._normalizedIndex(r),k=this._normalizedIndex(u);h(y);r.nodeType==3&&(r=y.childNodes[b]);h(p);u.nodeType==3&&(u=p.childNodes[k]);e?(r.nodeType==3?n.setStart(r,o):n[c?"setStartAfter":"setStartBefore"](r),n.collapse(!0)):(r.nodeType==3?n.setStart(r,o):n.setStartBefore(r),u.nodeType==3?n.setEnd(u,l):n.setEndAfter(u));f.caret&&f.removeCaret(n)}}),v=/[\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()},editableTextNodes:function(n){var t=[],i=f.Immutables&&f.Immutables.immutableParent;return i&&!i(n.commonAncestorContainer)&&(t=new ft(n).enumerate()),t},documentFromRange:function(n){var t=n.startContainer;return t.nodeType==9?t:t.ownerDocument},createRange:function(n){return y.msie&&y.version<9?new s(n):n.createRange()},selectRange:function(n){var t=r.image(n),i;t&&(n.setStartAfter(t),n.setEndAfter(t));i=a.selectionFromRange(n);i.removeAllRanges();i.addRange(n)},stringify:function(n){return c.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 e(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){var r,u,f;if(n.startOffset!==0)return!1;for(r=n.cloneRange();r.startOffset===0&&r.startContainer!=i;){for(u=t.findNodeIndex(r.startContainer),f=r.startContainer.parentNode;u>0&&f[u-1]&&t.insignificant(f[u-1]);)u--;r.setStart(f,u)}return r.startOffset===0&&r.startContainer==i},isEndOf:function(n,i){function o(n){t.insignificant(n)||t.isDataNode(n)&&/^[\ufeff]*$/.test(n.nodeValue)||f.push(n)}var r=n.cloneRange(),u,f;return r.collapse(!1),u=r.startContainer,t.isDataNode(u)&&r.startOffset==t.getNodeLength(u)&&(r.setStart(u.parentNode,t.findNodeIndex(u)+1),r.collapse(!0)),r.setEnd(i,t.getNodeLength(i)),f=[],new e(r).traverse(o),!f.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(v),u=e.search(v),!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(v)),o&&(h=o.search(v)),s&&h}};it(f,{SelectionUtils:a,W3CRange:s,RangeIterator:e,W3CSelection:w,RangeEnumerator:nt,RestorePoint:et,Marker:ot,RangeUtils:r})})(window.kendo.jQuery)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("editor/system",["editor/range"],n)}(function(){(function(n){function l(n,t){var i=n.selectionRestorePoint=new e(n.getRange(),n.body),r=new k(t,i);return r.editor=n,n.undoRedoStack.push(r),i}function dt(n,t){return t.startContainer===n&&t.endContainer===n&&t.startOffset===0&&t.endOffset==n.childNodes.length}function it(n,t,i){for(var r=n?n[t]:null;r&&!i(r);)r=r[t];return r}var f=window.kendo,u=f.Class,i=f.ui.editor,a=i.EditorUtils,v=i.RangeUtils,w=a.registerTool,t=i.Dom,y=i.Tool,b=i.ToolTemplate,e=i.RestorePoint,c=i.Marker,o=f.support.browser,g='<br class="k-br">',p=n.extend,nt=t.nodeTypes,tt="previousSibling",s=u.extend({init:function(n){this.options=n;this.restorePoint=new e(n.range,n.body,{immutables:n.immutables});this.marker=new c;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(p({},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)},immutables:function(){return this.editor&&this.editor.options.immutables},expandImmutablesIn:function(n){this.immutables()&&(f.ui.editor.Immutables.expandImmutablesIn(n),this.restorePoint=new e(n,this.editor.body))}}),k=u.extend({init:function(n,t){this.body=n.body;this.startRestorePoint=n;this.endRestorePoint=t},redo:function(){t.removeChildren(this.body);this.body.innerHTML=this.endRestorePoint.html;this.editor.selectRange(this.endRestorePoint.toRange())},undo:function(){t.removeChildren(this.body);this.body.innerHTML=this.startRestorePoint.html;this.editor.selectRange(this.startRestorePoint.toRange())}}),rt=s.extend({init:function(n){s.fn.init.call(this,n);this.managesUndoRedo=!0},exec:function(){var n=this.editor,t=this.options,r=t.range,u=n.body,f=new e(r,u),o=t.html||t.value||"",i;n.selectRange(r);n.clipboard.paste(o,t);t.postProcess&&t.postProcess(n,n.getRange());i=new k(f,new e(n.getRange(),u));i.editor=n;n.undoRedoStack.push(i);n.focus()}}),ut=y.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(){y.exec(r,"insertHtml",this.value())},title:r.options.messages.insertHtml,highlightFirst:!1})},command:function(n){return new rt(n)},update:function(n){var t=n.data("kendoSelectBox")||n.find("select").data("kendoSelectBox");t.close();t.value(t.options.title)}}),h="td,th,caption",ft="table,tbody,thead,tfoot,tr",gt=ft+","+h,et=function(t){return!t.collapsed&&n(t.commonAncestorContainer).is(ft)},ot=u.extend({remove:function(i){var s=this,e=new c;e.add(i,!1);var o=v.getAll(i,function(t){return n(t).is(gt)}),l=v.documentFromRange(i),u=e.start,f=e.end,a=h.split(","),r=t.parentOfType(u,a),y=t.parentOfType(f,a);s._removeContent(u,r,!0);s._removeContent(f,y,!1);n(o).each(function(t,i){i=n(i);(i.is(h)?i:i.find(h)).each(function(n,t){t.innerHTML="&#65279;"})});r&&!u.previousSibling&&t.insertBefore(l.createTextNode("﻿"),u);y&&!f.nextSibling&&t.insertAfter(l.createTextNode("﻿"),f);r?i.setStartBefore(u):o[0]&&(r=n(o[0]),r=r.is(h)?r:r.find(h).first(),r.length&&i.setStart(r.get(0),0));i.collapse(!0);t.remove(u);t.remove(f)},_removeContent:function(i,r,u){if(r){var f=u?"nextSibling":"previousSibling",e,o=function(t){while(t&&!t[f])t=t.parentNode;return t&&n.contains(r,t)?t[f]:null};for(i=o(i);i;)e=o(i),t.remove(i),i=e}}}),ni=u.extend({init:function(n){this.editor=n},keydown:function(t){var f=this,u=f.editor,h=u.keyboard,y=h.isTypingKey(t),c=p(n.Event(),t),r,s,a,v;return(f.editor.trigger("keydown",c),c.isDefaultPrevented())?(t.preventDefault(),!0):!c.isDefaultPrevented()&&y&&!h.isTypingInProgress()?(r=u.getRange(),s=u.body,f.startRestorePoint=new e(r,s),et(r)&&(a=new ot(u),a.remove(r),u.selectRange(r)),o.webkit&&!r.collapsed&&dt(s,r)&&(s.innerHTML=""),u.immutables&&i.Immutables.immutablesContext(r)&&(v=new i.BackspaceHandler(u),v.deleteSelection(r)),h.startTyping(function(){f.endRestorePoint=l(u,f.startRestorePoint)}),!0):!1},keyup:function(n){var t=this.editor.keyboard;return(this.editor.trigger("keyup",n),t.isTypingInProgress())?(t.endTyping(),!0):!1}}),ti=u.extend({init:function(n){this.editor=n},_addCaret:function(n){var i=t.create(this.editor.document,"a");return t.insertAt(n,i,0),t.stripBomNode(i.previousSibling),t.stripBomNode(i.nextSibling),i},_restoreCaret:function(n){var i=this.editor.createRange();!n.nextSibling&&t.isDataNode(n.previousSibling)?i.setStart(n.previousSibling,n.previousSibling.length):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},_cleanBomBefore:function(n){for(var i=n.startOffset,r=n.startContainer,u=r.nodeValue,t=0;i-t>=0&&u[i-t-1]=="﻿";)t++;t>0&&(r.deleteData(i-t,t),n.setStart(r,Math.max(0,i-t)),n.collapse(!0),this.editor.selectRange(n))},_handleBackspace:function(r){var f=r.startContainer,u=t.closestEditableOfType(f,["li"]),s=t.closestEditableOfType(f,"p,h1,h2,h3,h4,h5,h6".split(",")),o=this.editor,a,w,h,b,d,g;if(t.isDataNode(f)){if(r.collapsed&&/^\s[\ufeff]+$/.test(f.nodeValue))return r.setStart(f,0),r.setEnd(f,f.length),o.selectRange(r),!1;this._cleanBomBefore(r)}a=it(s,tt,function(n){return!t.htmlIndentSpace(n)});r.collapsed&&r.startOffset!==r.endOffset&&r.startOffset<0&&(r.startOffset=0,r.endOffset=0,o.selectRange(r));var v=u&&i.RangeUtils.isStartOf(r,u),y=u&&n(u).index(),p=v&&y>0;if(p&&(s=u,a=t.prev(u)),s&&a&&i.RangeUtils.isStartOf(r,s)||p)return w=this._addCaret(s),this._merge(a,s),this._restoreCaret(w),!0;if(v&&y===0)return h=u.firstChild,h||(u.innerHTML=i.emptyElementContent,h=u.firstChild),b=new i.ListFormatter(t.name(u.parentNode),"p"),r.selectNodeContents(u),b.toggle(r),t.insignificant(h)?r.setStartBefore(h):r.setStart(h,0),o.selectRange(r),!0;var l=f.childNodes[r.startOffset-1],c=r,e=l&&t.closestEditableOfType(l,["a"]),k=it(l||f,tt,function(n){return!t.isDataNode(n)||!t.isBom(n)&&n.length>0});return(e||(r.startOffset===0||l)&&t.is(k,"a"))&&(e=e||k,c=o.createRange(),c.setStart(e,e.childNodes.length),c.collapse(!0)),e=e||t.closestEditableOfType(l||c.startContainer,["a"]),d=e&&i.RangeUtils.isEndOf(c,e),d&&(g=new i.UnlinkCommand({range:c,body:o.body,immutables:!!o.immutables}),o.execCommand(g),o._selectionChange()),!1},_handleSelection:function(r){var e=r.commonAncestorContainer,s=t.closest(e,"table"),a=i.emptyElementContent,o=this.editor,h,u,f,l;return et(r)?(h=new ot(o),h.remove(r),o.selectRange(r),!0):(u=new c,u.add(r,!1),o.immutables&&this._handleImmutables(u),this._surroundFullySelectedAnchor(u,r),r.setStartAfter(u.start),r.setEndBefore(u.end),f=r.startContainer,l=r.endContainer,r.deleteContents(),s&&n(s).text()===""&&(r.selectNode(s),r.deleteContents()),e=r.commonAncestorContainer,t.name(e)==="p"&&e.innerHTML===""&&(e.innerHTML=a,r.setStart(e,0)),this._join(f,l),t.insertAfter(o.document.createTextNode("﻿"),u.start),u.remove(r),f=r.startContainer,t.name(f)=="tr"&&(f=f.childNodes[Math.max(0,r.startOffset-1)],r.setStart(f,t.getNodeLength(f))),r.collapse(!0),o.selectRange(r),!0)},_handleImmutables:function(n){var f=i.Immutables.immutableParent,u=f(n.start),r=f(n.start);u&&t.insertBefore(n.start,u);r&&t.insertAfter(n.end,r);u&&t.remove(u);r&&r.parentNode&&t.remove(r)},_surroundFullySelectedAnchor:function(i,r){var e=i.start,u=n(e).closest("a").get(0),o=i.end,f=n(o).closest("a").get(0);u&&v.isStartOf(r,u)&&t.insertBefore(e,u);f&&v.isEndOf(r,f)&&t.insertAfter(o,f)},_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);n&&i.firstChild;)n.nodeType==1?(n=t.list(n)?n.children[n.children.length-1]:n,n&&n.appendChild(i.firstChild)):n.nodeType===nt.TEXT_NODE?this._mergeWithTextNode(n,i.firstChild):n.parentNode.appendChild(i.firstChild);t.remove(i)},_mergeWithTextNode:function(n,i){n&&n.nodeType===nt.TEXT_NODE&&(n.nextSibling&&this._isCaret(n.nextSibling)?t.insertAfter(i,n.nextSibling):t.insertAfter(i,n))},_isCaret:function(t){return n(t).is("a")},keydown:function(n){var t,u,i=this.editor,r=i.getRange(),o=n.keyCode,s=f.keys,h=o===s.BACKSPACE,c=o==s.DELETE;i.immutables&&i.immutables.keydown(n,r)||((h||c)&&!r.collapsed?t="_handleSelection":h?t="_handleBackspace":c&&(t="_handleDelete"),t)&&(u=new e(r,i.body),this[t](r)&&(n.preventDefault(),l(i,u)))},deleteSelection:function(n){this._handleSelection(n)},keyup:n.noop}),ii=u.extend({init:function(n){this.editor=n;this.systemCommandIsInProgress=!1},createUndoCommand:function(){this.startRestorePoint=this.endRestorePoint=l(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 e(r.getRange(),r.body),!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}}),ri=u.extend({init:function(n){this.editor=n},keydown:function(n){!o.webkit||n.isDefaultPrevented()||!n.ctrlKey||n.keyCode!=65||n.altKey||n.shiftKey||(this.editor.options.immutables&&this._toSelectableImmutables(),this._selectEditorBody())},_selectEditorBody:function(){var n=this.editor,t=n.getRange();t.selectNodeContents(n.body);n.selectRange(t)},_toSelectableImmutables:function(){for(var s=this.editor,f=s.body,e=i.Immutables.immutable,o=t.emptyTextNode,r=f.firstChild,u=f.lastChild;o(r);)r=r.nextSibling;while(o(u))u=u.previousSibling;r&&e(r)&&n(g).prependTo(f);u&&e(u)&&n(g).appendTo(f)},keyup:n.noop}),ui=u.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,e=this._getShortcutModifier(i,navigator.platform);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==e&&r.alt==i.altKey&&r.shift==i.shiftKey)return u},_getShortcutModifier:function(n,t){var i=t.toUpperCase().indexOf("MAC")>=0;return i?n.metaKey:n.ctrlKey},toolsFromShortcut:function(t,i){var s=String.fromCharCode(i.keyCode),u,r,f,e=[],o=function(n){return n==s||n==i.keyCode||n==i.charCode};for(u in t)r=n.extend({ctrl:!1,alt:!1,shift:!1},t[u].options),f=n.isArray(r.key)?n.grep(r.key,o).length>0:o(r.key),f&&r.ctrl==i.ctrlKey&&r.alt==i.altKey&&r.shift==i.shiftKey&&e.push(t[u]);return e},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")}}),fi=u.extend({init:function(n){this.editor=n;var t=n.options.pasteCleanup;this.cleaners=[new st(t),new ht(t),new ct(t),new lt(t),new vt(t),new yt(t),new d(t),new wt(t)]},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,r,i=this.editor;if(!this._inProgress)return this._inProgress=!0,n=i.getRange(),r=new e(n,i.body),t.persistScrollTop(i.document),{range:n,restorePoint:r}},_endModification:function(n){l(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)}))},_removeBomNodes:function(n){for(var u=i.RangeUtils.textNodes(n),r=0;r<u.length;r++)u[r].nodeValue=t.stripBom(u[r].nodeValue)},_onBeforeCopy:function(n){var t=new c;t.add(n);this._removeBomNodes(n);t.remove(n);this.editor.selectRange(n)},oncopy:function(){this._onBeforeCopy(this.editor.getRange())},oncut:function(){this._onBeforeCopy(this.editor.getRange());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(n){if("FileReader"in window&&(!o.msie||!(o.version>10))){var t=n.clipboardData||n.originalEvent.clipboardData||window.clipboardData||{},i=t.items||t.files;return this._insertImages(i)}},_insertImages:function(t){var i,u,r;if(t)return(i=n.grep(t,function(n){return/^image\//i.test(n.type)}),u=n.grep(t,function(n){return/^text\/html/i.test(n.type)}),u.length||!i.length)?void 0:(r=this._startModification(),!r)?void 0:(n.when.apply(n,n.map(i,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(r)},this)),!0)},onpaste:function(i){if(this._handleImagePaste(i)){i.preventDefault();return}this.expandImmutablesIn();this._contentModification(function(r,u){var e=t.create(r.document,"div",{className:"k-paste-container",innerHTML:"﻿"}),s=f.support.browser,o=r.body,h,c,l;this._decoreateClipboardNode(e,o);o.appendChild(e);s.webkit&&this._moveToCaretPosition(e,u);s.msie&&s.version<11?(i.preventDefault(),h=r.createRange(),h.selectNodeContents(e),r.selectRange(h),c=r.document.body.createTextRange(),c.moveToElementText(e),n(o).unbind("paste"),c.execCommand("Paste"),n(o).bind("paste",n.proxy(this.onpaste,this))):(l=r.createRange(),l.selectNodeContents(e),r.selectRange(l));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})})},ondragover:function(n){(o.msie||o.edge)&&(n.stopPropagation(),n.preventDefault())},ondrop:function(n){if("FileReader"in window){var t=(n.originalEvent||n).dataTransfer||{},i=t.items||t.files;this._insertImages(i)&&n.preventDefault()}},_decoreateClipboardNode:function(t,i){var r,u,f,e;(o.msie||o.webkit)&&(t=n(t),t.css({borderWidth:"0px",width:"0px",height:"0px",overflow:"hidden",margin:"0",padding:"0"}),o.msie&&(r=n(i.ownerDocument.documentElement),t.css({fontVariant:"normal",fontWeight:"normal",lineSpacing:"normal",lineHeight:"normal",textDecoration:"none"}),u=r.css("color"),u&&t.css("color",u),f=r.css("fontFamily"),f&&t.css("fontFamily",f),e=r.css("fontSize"),e&&t.css("fontSize",e)))},_moveToCaretPosition:function(i,r){var u=this,f=u.editor.body,e=t.offset(i,f),o=u._caretOffset(r,f),h=o.left-e.left,c=o.top-e.top,s="translate("+h+"px,"+c+"px)";n(i).css({"-webkit-transform":s,transform:s})},_caretOffset:function(n,i){var s=this.editor,u=t.create(s.document,"span",{innerHTML:"﻿"}),r=n.startContainer,h,o,c;n.collapsed?(o=t.isDataNode(r),o&&(t.isBom(r)||n.startOffset===0)?t.insertBefore(u,r):o&&n.startOffset===r.length?t.insertAfter(u,r):(n.insertNode(u),h=!0)):(r=r===i?r.childNodes[n.startOffset]:r,t.insertBefore(u,r));var l=t.offset(u,i),f=u.previousSibling,e=u.nextSibling;return t.remove(u),h&&t.isDataNode(f)&&t.isDataNode(e)&&!t.isBom(f)&&!t.isBom(e)&&(c=f.length,e.data=f.data+e.data,n.setStart(e,c),t.remove(f),n.collapse(!0),s.selectRange(n)),l},expandImmutablesIn:function(n){var t=this.editor,i,u,r;t&&t.options.immutables&&(i=t.body,n=n||t.getRange(),f.ui.editor.Immutables.expandImmutablesIn(n),n.startContainer===i&&n.startOffset===0&&(u=i.ownerDocument,r=u.createTextNode("﻿"),i.insertBefore(r,i.childNodes[0]),n.setStartBefore(r)),t.selectRange(n))},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,y,w;if(this.expandImmutablesIn(),u=p({clean:!1,split:!0},u),!u.skipCleaners)for(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))/gi,"$3"),r=r.replace(/<(a|span)[^>]*><\/\1>/gi,""));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 c,o=b.addCaret(f),l=this.splittableParent(v,o),k=!1,d=l!=h.body&&!t.is(l,"td");if(u.split&&d&&(v||t.isInline(l))&&(f.selectNode(o),i.RangeUtils.split(f,l,!0),k=!0),s=this.htmlToFragment(r),s.firstChild&&s.firstChild.className==="k-paste-container"){for(y=[],e=0,a=s.childNodes.length;e<a;e++)y.push(s.childNodes[e].innerHTML);s=this.htmlToFragment(y.join("<br />"))}if(n(s.childNodes).filter("table").addClass("k-table").end().find("table").addClass("k-table"),f.insertNode(s),l=this.splittableParent(v,o),k){while(o.parentNode!=l)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)}}),r=u.extend({init:function(n){this.options=n||{};this.replacements=[]},clean:function(n,t){for(var f=this,r=t||f.replacements,i=0,u=r.length;i<u;i+=2)n=n.replace(r[i],r[i+1]);return n}}),st=r.extend({init:function(n){r.fn.init.call(this,n);this.replacements=[/<(\/?)script([^>]*)>/i,"<$1telerik:script$2>"]},applicable:function(n){return!this.options.none&&/<script[^>]*>/i.test(n)}}),ht=r.extend({init:function(n){r.fn.init.call(this,n);var t=" ";this.replacements=[/<span\s+class="Apple-tab-span"[^>]*>\s*<\/span>/gi,t,/\t/gi,t,/&nbsp;&nbsp; &nbsp;/gi,t]},applicable:function(n){return/&nbsp;&nbsp; &nbsp;|class="?Apple-tab-span/i.test(n)}}),ct=r.extend({init:function(n){r.fn.init.call(this,n);this.junkReplacements=[/<\?xml[^>]*>/gi,"",/<!--(.|\n)*?-->/g,"",/&quot;/g,"'",/<o:p>&nbsp;<\/o:p>/gi,"&nbsp;",/<\/?(meta|link|style|o:|v:|x:)[^>]*>((?:.|\n)*?<\/(meta|link|style|o:|v:|x:)[^>]*>)?/gi,"",/<\/o>/g,""];this.replacements=this.junkReplacements.concat([/(?:<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-[^;"]*;?/gi,"",/<(\/?)b(\s[^>]*)?>/gi,"<$1strong$2>",/<(\/?)font(\s[^>]*)?>/gi,this.convertFontMatch,/<(\/?)i(\s[^>]*)?>/gi,"<$1em$2>",/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>/gi,function(n,t){return!t||t.indexOf("href")<0?"":n})},listType:function(n,i){var r=n.innerHTML,e=t.innerText(n),u,f=r.match(/^(?:<span [^>]*texhtml[^>]*>)?<span [^>]*(?:Symbol|Wingdings)[^>]*>([^<]+)/i),o=f&&f[1],h=/^[a-z\d]/i.test(o),s=function(n){return n.replace(/^(?:&nbsp;|[\u00a0\n\r\s])+/,"")};return(f&&(u=!0),r=r.replace(/<\/?\w+[^>]*>/g,"").replace(/&nbsp;/g," "),!u&&/^[\u2022\u00b7\u00a7\u00d8o]\u00a0+/.test(r)||u&&/^.\u00a0+/.test(r)||o&&!h&&i)?{tag:"ul",style:this._guessUnorderedListStyle(s(e))}:/^\s*\w+[\.\)][\u00a0 ]{2,}/.test(r)?{tag:"ol",style:this._guessOrderedListStyle(s(e))}:void 0},_convertToLi:function(n){var i,r=t.name(n);return n.childNodes.length==1?i=n.firstChild.innerHTML.replace(/^\w+[\.\)](&nbsp;)+ /,""):(t.remove(n.firstChild),n.firstChild.nodeType==3&&/^[ivxlcdm]+\.$/i.test(n.firstChild.nodeValue)&&t.remove(n.firstChild),/^(&nbsp;|\s)+$/i.test(n.firstChild.innerHTML)&&t.remove(n.firstChild),i=r!="p"?"<"+r+">"+n.innerHTML+"<\/"+r+">":n.innerHTML),t.remove(n),t.create(document,"li",{innerHTML:i})},_guessUnorderedListStyle:function(n){return/^[\u2022\u00b7\u00FC\u00D8\u002dv-]/.test(n)?null:/^o/.test(n)?"circle":"square"},_guessOrderedListStyle:function(n){var t=null;return/^\d/.test(n)||(t=(/^[a-z]/.test(n)?"lower-":"upper-")+(/^[ivxlcdm]/i.test(n)?"roman":"alpha")),t},extractListLevels:function(n){return n.replace(/style=['"]?[^'"]*?mso-list:\s?[a-zA-Z]+(\d+)\s[a-zA-Z]+(\d+)\s(\w+)/gi,function(n,t,i){return f.format('data-list="{0}" data-level="{1}" {2}',t,i,n)})},_createList:function(n,i){return t.create(document,n,{style:{listStyleType:i}})},lists:function(i){for(var d=n(i).find(t.blockElements.join(",")),c=-1,p,e={},o,l,g,nt,w,b,r,s,u,f,v,tt=["p","h1","h2","h3","h4","h5","h6"],k,h,y,a=0;a<d.length;a++)if(r=d[a],v=n(r).data(),k=v.list,p=t.name(r),p!="td"){if(h=this.listType(r,v),s=h&&h.tag,!s||tt.indexOf(p)<0){r.innerHTML?o&&!w&&o.append(r):t.remove(r);continue}u=v.level||parseFloat(r.style.marginLeft||0);y=s+k;e[u]||(e[u]={});(!l||l<0)&&(l=u,g=k,nt=n(i).find("[data-list='"+g+"']:last")[0],b=this._createList(s,h.style),t.insertBefore(b,r),c=u,e[u][y]=b);w=nt===r;f=e[u][y];(u>c||!f)&&(f=this._createList(s,h.style),e[u][y]=f,o.appendChild(f));o=this._convertToLi(r);f.appendChild(o);w?l=c=-1:c=u}},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")},removeFormatting:function(t){n(t).find("*").each(function(){n(this).css({fontSize:"",fontFamily:""});this.getAttribute("style")||this.style.cssText||this.removeAttribute("style")})},clean:function(n){var i=this,u,f=this.options;return f.none?(n=r.fn.clean.call(i,n,this.junkReplacements),n=i.stripEmptyAnchors(n)):(n=this.extractListLevels(n),n=r.fn.clean.call(i,n),n=i.stripEmptyAnchors(n),u=t.create(document,"div",{innerHTML:n}),i.headers(u),f.msConvertLists&&i.lists(u),i.tables(u),f.msAllFormatting&&i.removeFormatting(u),n=u.innerHTML.replace(/(<[^>]*)\s+class="?[^"\s>]*"?/gi,"$1")),n}}),lt=r.extend({init:function(n){r.fn.init.call(this,n);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)}}),at=r.extend({clean:function(n){var i=t.create(document,"div",{innerHTML:n});return i=this.cleanDom(i),i.innerHTML},cleanDom:function(n){return n}}),vt=at.extend({cleanDom:function(i){var r=this.collectTags();return n(i).find(r).each(function(){t.unwrap(this)}),i},collectTags:function(){if(this.options.span)return"span"},applicable:function(){return this.options.span}}),yt=at.extend({cleanDom:function(t){var i=this.collectAttr(),r=n(t).find("["+i.join("],[")+"]");return r.removeAttr(i.join(" ")),t},collectAttr:function(){return this.options.css?["class","style"]:[]},applicable:function(){return this.options.css}}),ei=function(){this.text="";this.add=function(n){this.text+=n}},pt=u.extend({init:function(n){this.separators=n||{text:" ",line:"<br/>"};this.lines=[];this.inlineBlockText=[];this.resetLine()},appendText:function(n){n.nodeType===3&&(n=n.nodeValue);this.textContainer.add(n)},appendInlineBlockText:function(n){this.inlineBlockText.push(n)},flashInlineBlockText:function(){this.inlineBlockText.length&&(this.appendText(this.inlineBlockText.join(" ")),this.inlineBlockText=[])},endLine:function(){this.flashInlineBlockText();this.resetLine()},html:function(){var u=this.separators,n="",f=this.lines,r,s;this.flashInlineBlockText();for(var t=0,e=f.length,h=e-1;t<e;t++){r=f[t];for(var i=0,o=r.length,c=o-1;i<o;i++)s=r[i].text,n+=s,i!==c&&(n+=u.text);t!==h&&(n+=u.line)}return n},resetLine:function(){this.textContainer=new ei;this.line=[];this.line.push(this.textContainer);this.lines.push(this.line)}}),oi=u.extend({init:function(n){this.callback=n},enumerate:function(n){if(n){var i=this.callback(n),t=n.firstChild;!i&&t&&this.enumerate(t);this.enumerate(n.nextSibling)}}}),d=r.extend({init:function(t){r.fn.init.call(this,t);this.hasText=!1;this.enumerator=new oi(n.proxy(this.buildText,this))},clean:function(n){var i=t.create(document,"div",{innerHTML:n});return this.cleanDom(i)},cleanDom:function(n){return this.separators=this.getDefaultSeparators(),this.htmlLines=new pt(this.separators),this.enumerator.enumerate(n.firstChild),this.hasText=!1,this.htmlLines.html()},buildText:function(n){if(t.isDataNode(n)){if(t.isEmptyspace(n))return;this.htmlLines.appendText(n.nodeValue.replace("\n",this.separators.line));this.hasText=!0}else if(t.isBlock(n)&&this.hasText){var i=this.actions[t.name(n)]||this.actions.block;return i(this,n)}},applicable:function(){var n=this.options;return n.all||n.keepNewLines},getDefaultSeparators:function(){return this.options.all?{text:" ",line:" "}:{text:" ",line:"<br/>"}},actions:{ul:n.noop,ol:n.noop,table:n.noop,thead:n.noop,tbody:n.noop,td:function(n,t){var i=new d({all:!0}),r=i.cleanDom(t);return n.htmlLines.appendInlineBlockText(r),!0},block:function(n){n.htmlLines.endLine()}}}),wt=r.extend({clean:function(n){return this.options.custom(n)},applicable:function(){return typeof this.options.custom=="function"}}),bt=s.extend({init:function(n){s.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()}}),kt=s.extend({init:function(n){this.async=!0;s.fn.init.call(this,n)},exec:function(){var t=this,i=t.lockRange(!0),n=t.editor;n._destroyResizings();n.saveAsPDF().then(function(){t.releaseRange(i);n._initializeColumnResizing();n._initializeRowResizing();n._initializeTableResizing()})}});p(i,{_finishUpdate:l,Command:s,GenericCommand:k,InsertHtmlCommand:rt,InsertHtmlTool:ut,TypingHandler:ni,SystemHandler:ii,BackspaceHandler:ti,SelectAllHandler:ri,Keyboard:ui,Clipboard:fi,Cleaner:r,ScriptCleaner:st,TabCleaner:ht,MSWordFormatCleaner:ct,WebkitFormatCleaner:lt,HtmlTagsCleaner:vt,HtmlAttrCleaner:yt,HtmlContentCleaner:d,HtmlTextLines:pt,CustomCleaner:wt,PrintCommand:bt,ExportPdfCommand:kt});w("insertHtml",new ut({template:new b({template:a.dropDownListTemplate,title:"Insert HTML",initialValue:"Insert HTML"})}));w("print",new y({command:bt,template:new b({template:a.buttonTemplate,title:"Print"})}));w("pdf",new y({command:kt,template:new b({template:a.buttonTemplate,title:"Export PDF"})}))})(window.kendo.jQuery)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("editor/inlineformat",["editor/system"],n)}(function(){(function(n){var e=window.kendo,nt=e.Class,i=e.ui.editor,s=e.ui.Editor.fn.options.formats,r=i.EditorUtils,h=i.Tool,u=i.ToolTemplate,tt=i.FormatTool,t=i.Dom,v=i.RangeUtils,c=n.extend,f=i.EditorUtils.registerTool,l=i.EditorUtils.registerFormat,rt=function(n){n.preventDefault()},k="mousedown.kendoEditor",ut="keydown.kendoEditor",y="k-marker",a=nt.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==y?f++:t.nodeType==3?r++:u++);return f>1&&i.firstChild.className==y&&i.lastChild.className==y?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}}),p=nt.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 i=this.immutables()?v.editableTextNodes:v.textNodes,t=i(n);t.length>0&&this.activate(n,t)},immutables:function(){return this.editor&&this.editor.options.immutables},apply:function(n){for(var o=[],r,i,f=this.attributes,e=f?f.style||{}:{},u=0,s=n.length;u<s;u++){if(r=n[u],i=this.finder.findSuitable(r),i)t.is(i,"font")&&(e.color&&i.removeAttribute("color"),e.fontName&&i.removeAttribute("face"),e.fontSize&&i.removeAttribute("size")),t.attr(i,f);else{while(!t.isBlock(r.parentNode)&&r.parentNode.childNodes.length==1&&r.parentNode.contentEditable!=="true")r=r.parentNode;i=this.wrap(r)}o.push(i)}this.consolidate(o)},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=v.textNodes(n),u=r.length,t,i;if(u>0)for(t=0;t<u;t++)i=this.finder.findFormat(r[t]),i&&v.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==y&&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)}}}),w=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)!==""}}),d=p.extend({init:function(n,t,i){p.fn.init.call(this,n,t);this.values=t;this.finder=new w(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=tt.extend({init:function(n){tt.fn.init.call(this,c(n,{finder:new a(n.format),formatter:function(){return new p(n.format)}}))}}),it=h.extend({update:function(n,t){var i=n.data(this.type);i.close();i.value(this.finder.getFormat(t))}}),g=it.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","font"]}];this.finder=new w(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 d(u,{style:r},t.cssAttr)}}))},initialize:function(n,t){var i=t.editor,r=this.options,u=r.name,s,f,c=[],o;r.defaultValue&&(c=[{text:i.options.messages[r.defaultValue[0].text],value:r.defaultValue[0].value}]);s=c.concat(r.items?r.items:i.options[u]||[]);n.attr({title:t.title});n[this.type]({dataTextField:"text",dataValueField:"value",dataSource:s,change:function(){i._range=f;h.exec(i,u,this.value())},close:function(){setTimeout(function(){"_range"in i&&delete i._range},0)},highlightFirst:!1});n.closest(".k-widget").removeClass("k-"+u).find("*").addBack().attr("unselectable","on");o=n.data(this.type);o.value("inherit");o.wrapper.on(k,".k-select,.k-input",function(){var n=i.getRange();f=i._containsRange(n)?n:f}).on(ut,function(n){n.keyCode===e.keys.ENTER&&n.preventDefault()})}}),b=h.extend({init:function(n){h.fn.init.call(this,n);this.format=[{tags:["span","font"]}];this.finder=new w(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 d(u,{style:r},t.cssAttr)}}))},initialize:function(n,t){var u=t.editor,f=this.name,i=c({},b.fn.options,this.options),o=i.palette,s=i.columns;n=this._widget=new e.ui.ColorPicker(n,{toolIcon:"k-icon k-i-"+r.getToolCssClass(i.name),palette:o,columns:s,change:function(){var t=n.value();t&&h.exec(u,f,t);u.focus()},open:function(n){var t=n.sender;t.value(null);t._popup.element.on(k,rt);t._popup.element.is("[unselectable='on']")||t._popup.element.attr({unselectable:"on"}).find("*").attr("unselectable","on")},close:function(n){n.sender._popup.element.off(k)},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:p,DelayedExecutionTool:it,GreedyInlineFormatFinder:w,GreedyInlineFormatter:d,InlineFormatTool:o,FontTool:g,ColorTool:b});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 b({cssAttr:"color",domAttr:"color",name:"foreColor",template:new u({template:r.colorPickerTemplate,title:"Color"})}));f("backColor",new b({cssAttr:"background-color",domAttr:"backgroundColor",name:"backColor",template:new u({template:r.colorPickerTemplate,title:"Background Color"})}));f("fontName",new g({cssAttr:"font-family",domAttr:"fontFamily",name:"fontName",defaultValue:[{text:"fontNameInherit",value:"inherit"}],template:new u({template:r.comboBoxTemplate,title:"Font Name"})}));f("fontSize",new g({cssAttr:"font-size",domAttr:"fontSize",name:"fontSize",defaultValue:[{text:"fontSizeInherit",value:"inherit"}],template:new u({template:r.comboBoxTemplate,title:"Font Size"})}))})(window.kendo.jQuery)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("editor/formatblock",["editor/inlineformat"],n)}(function(){(function(n){var a=window.kendo,v=a.Class,y=n.extend,i=a.ui.editor,e=a.ui.Editor.fn.options.formats,t=i.Dom,w=i.Command,o=i.ToolTemplate,b=i.FormatTool,r=i.EditorUtils,s=r.registerTool,h=r.registerFormat,p=i.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.closestEditableOfType(i[r],s[e].tags),f)break;if(!f||f.contentEditable==="true")return[];n.inArray(f,u)<0&&u.push(f)}for(this._resolveListsItems(u),r=0,o=u.length;r<o;r++)if(this.contains(u[r],u))return[u[r]];return u},_resolveListsItems:function(n){for(var u,i,r=0;r<n.length;r++)u=n[r],i=t.is(u,"li")?u:t.wrapper(u),i=i&&t.list(i)?i.children[0]:i,t.is(i,"li")&&(u=n[r]=i)},findFormat:function(n){for(var e=this.format,r,f,o,c=t.editableParent(n),l=this.options&&this.options.immutables,a=i.Immutables,s,u=0,h=e.length;u<h;u++){if(r=n,f=e[u].tags,o=e[u].attr,l&&f&&f[0]=="immutable"&&(s=a.immutableParent(r),s&&t.attrEquals(s,o)))return r;while(r&&t.isAncestorOf(c,r)){if(t.ofType(r,f)&&t.attrEquals(r,o))return r;r=r.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(i){function o(n){return y({},n&&n.attr,l)}var u,l=this.values,s,f,e,c;this._handleImmutables(i,!0);var h=t.filter("img",i),a=r.formatByName("img",this.format),v=o(a);if(n.each(h,function(){t.attr(this,v)}),h.length!=i.length)if(s=t.filter("img",i,!0),f=this.finder.findSuitable(s),f.length)for(e=0,c=f.length;e<c;e++)u=r.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)},_handleImmutables:function(n,u){var o,s,h,f,e;if(this.immutables()&&(o=r.formatByName("immutable",this.format),o))for(s=i.Immutables,h=n.length-1,f=h;f>=0;f--)(e=s.immutableParent(n[f]),e)&&(e!==n[f+1]&&(u?t.attr(e,o.attr):t.unstyle(e,o.attr.style)),n.splice(f,1))},immutables:function(){return this.editor&&this.editor.options.immutables},remove:function(n){var f,o,i,u,e;for(this._handleImmutables(n,!1),f=0,o=n.length;f<o;f++)i=this.finder.findFormat(n[f]),i&&(e=t.name(i),e!="div"||i.getAttribute("class")?(u=r.formatByName(e,this.format),u.attr.style&&t.unstyle(i,u.attr.style),u.attr.className&&t.removeClass(i,u.attr.className)):t.unwrap(i))},toggle:function(n){var i=this,r=t.filterBy(p.nodes(n),t.htmlIndentSpace,!0);i.finder.isFormatted(r)?i.remove(r):i.apply(r)}}),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,e=t.blockParents(n),o=f[0].tags[0],u,a,v,y,s,p,h,r,w,c;if(e.length)for(u=0,a=e.length;u<a;u++)r=e[u],w=this.immutables()&&i.Immutables.immutableParent(r),w||(h=t.name(r),h=="li"?(v=r.parentNode,y=new i.ListFormatter(v.nodeName.toLowerCase(),o),s=this.editor.createRange(),s.selectNode(e[u]),y.toggle(s)):o&&(h=="td"||r.attributes.contentEditable)?new l(f,this.values).apply(r.childNodes):(p=t.changeTag(r,o),t.attr(p,f[0].attr)));else c=new l(f,this.values),c.editor=this.editor,c.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)},immutables:function(){return this.editor&&this.editor.options.immutables}}),d=w.extend({init:function(n){n.formatter=n.formatter();var t=n.formatter.finder;t&&r.formatByName("immutable",t.format)&&t._initOptions({immutables:n.immutables});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(i,{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:["immutable"],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:r.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:["immutable"],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:r.buttonTemplate,title:"Justify Center"})}));h("justifyRight",[{tags:t.nonListBlockElements,attr:{style:{textAlign:"right"}}},{tags:["img"],attr:{style:{float:"right",display:"",marginLeft:"",marginRight:""}}},{tags:["immutable"],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:r.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:["immutable"],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:r.buttonTemplate,title:"Justify Full"})}))})(window.kendo.jQuery)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("editor/linebreak",["editor/formatblock"],n)}(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){var u,f;if(t.isEmpty(i))n.setStartBefore(i);else{if(n.selectNodeContents(i),u=r.textNodes(n)[0],!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="﻿"),f=u.firstChild||u,t.isDataNode(f)?n.setStart(f,0):n.setStartBefore(f))}},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 s=this.getRange(),y=r.documentFromRange(s),v,c,e,k=i.emptyElementContent,h,o,u,l,p,d,w;if(this.expandImmutablesIn(s),d=this.shouldTrim(s),s.deleteContents(),o=this._insertMarker(y,s),t.stripBomNode(o.previousSibling),t.stripBomNode(o.nextSibling),u=t.closestEditableOfType(o,["li"]),l=t.closestEditableOfType(o,"h1,h2,h3,h4,h5,h6".split(",")),u){if(t.emptyNode(u)){h=t.create(y,"p");t.next(u)&&(p=s.cloneRange(),p.selectNode(u),r.split(p,u.parentNode));w=n("br",u);w.length==1&&w.remove();var nt=u.parentNode,g=u.parentNode.children.length,b=g>1&&u.childNodes.length==1&&u.children[0];t.insertAfter(h,nt);t.remove(g==1?u.parentNode:u);b&&b!==o?(h.appendChild(b),h.appendChild(o)):h.innerHTML=k;e=h}}else l&&this._blankAfter(o)&&(h=t.create(y,"p"),t.insertAfter(h,l),h.innerHTML=k,t.remove(o),e=h);e||(u||l||new a([{tags:["p"]}]).apply([o]),s.selectNode(o),v=t.parentOfType(o,[u?"li":l?t.name(l):"p"]),r.split(s,v,d),c=v.previousSibling,t.is(c,"li")&&c.firstChild&&!t.is(c.firstChild,"br")&&(c=c.firstChild),e=v.nextSibling,this.clean(c),this.clean(e,{links:!0}),t.is(e,"li")&&e.firstChild&&!t.is(e.firstChild,"br")&&(e=e.firstChild),t.remove(v),f(c));f(e);this._moveFocus(s,e);s.collapse(!0);t.scrollTo(e,!0);r.selectRange(s)},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();this.expandImmutablesIn(i);var 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,!0);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)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("editor/lists",["editor/linebreak"],n)}(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){return t.list(n)},immutables:function(){return this.editor&&!!this.editor.options.immutables},wrap:function(r,u){for(var e=t.create(r.ownerDocument,"li"),f,s=this.immutables()?i.Immutables.immutable:n.noop,o=0;o<u.length;o++){if(f=u[o],t.is(f,"li")){r.appendChild(f);continue}if(this.isList(f)){while(f.firstChild)r.appendChild(f.firstChild);continue}if(t.is(f,"td")){while(f.firstChild)e.appendChild(f.firstChild);r.appendChild(e);f.appendChild(r);r=r.cloneNode(!1);e=e.cloneNode(!1);continue}e.appendChild(f);t.isBlock(f)&&(r.appendChild(e),s(f)||t.unwrap(f),e=e.cloneNode(!1))}e.firstChild&&r.appendChild(e)},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.children,v),t.remove(o)):s.push(o));for(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.isBom(f.nextSibling);)t.remove(f.nextSibling);t.is(f,h)||t.changeTag(f,h);this.merge(h,f)},apply:function(r){function c(){f&&e.push({section:f,nodes:s})}for(var u=0,e=[],f,s,h,o,l=r.length,a=this.immutables()?i.Immutables.immutableParent:n.noop,u=0;u<l;u++)o=a(r[u])||r[u],h=t.closestEditable(o,["td","body"]),f&&h==f?s.push(o):(c(),s=[o],f=h);for(c(),u=0;u<e.length;u++)this.applyOnSection(e[u].section,e[u].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 r=this,i=e(n),f=n.commonAncestorContainer,u;i.length||(n.selectNodeContents(f),i=e(n),i.length||(u=f.ownerDocument.createTextNode(""),n.startContainer.appendChild(u),i=[u],n.selectNode(u.parentNode)));i=t.filterBy(i,t.htmlIndentSpace,!0);r.finder.isFormatted(i)?(r.split(n),r.remove(i)):r.apply(i)}}),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)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("editor/link",["editor/lists"],n)}(function(){(function(n,t){function st(n,t){for(var i=n.length;i--&&!t.test(n[i]););return i}function vt(n,t){var i=t.exec(n);return i?i.index:-1}var u=window.kendo,s=u.Class,ct=n.extend,h=n.proxy,r=u.ui.editor,i=r.Dom,e=r.RangeUtils,b=r.EditorUtils,f=r.Command,o=r.Tool,k=r.ToolTemplate,d=r.InlineFormatter,lt=r.InlineFormatFinder,c=e.textNodes,g=e.editableTextNodes,l=r.EditorUtils.registerTool,nt=u.keys,a="http://",tt=/^\w*:\/\//,at=/[\w\/\$\-_\*\?]/i,it=s.extend({findSuitable:function(n){return i.parentOfType(n,["a"])}}),v=s.extend({init:function(){this.finder=new it},apply:function(n,t){var a=this.immutables?g(n):c(n),r,s,h,u,f,l,o;if(t.innerHTML){for(s=e.documentFromRange(n),r=e.getMarkers(n),n.deleteContents(),u=i.create(s,"a",t),n.insertNode(u),f=u.parentNode,i.name(f)=="a"&&i.insertAfter(u,f),i.emptyNode(f)&&i.remove(f),l=u,o=0;o<r.length;o++)i.insertAfter(r[o],l),l=r[o];r.length&&(i.insertBefore(s.createTextNode("﻿"),r[1]),i.insertAfter(s.createTextNode("﻿"),r[1]),n.setStartBefore(r[0]),n.setEndAfter(r[r.length-1]))}else h=new d([{tags:["a"]}],t),h.finder=this.finder,h.apply(a)}}),rt=f.extend({init:function(n){var t=this;n.formatter={toggle:function(n){var i=t.immutables()?g(n):c(n);new d([{tags:["a"]}]).remove(i)}};this.options=n;f.fn.init.call(this,n)}}),ut=f.extend({init:function(n){var t;this.options=n;f.fn.init.call(this,n);this.formatter=new v;n.url?this.exec=function(){this.formatter.immutables=t&&t.immutables();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 u.template("<div class=\"k-editor-dialog k-popup-edit-form\"><div class=\"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><\/div>")({messages:this.editor.options.messages})},exec:function(){var f=this.editor.options.messages;this._initialText="";this._range=this.lockRange(!0);this.formatter.immutables=this.immutables();var r=c(this._range),t=r.length?this.formatter.finder.findSuitable(r[0]):null,e=r.length&&i.name(r[0])=="img",u=this.createDialog(this._dialogTemplate(),{title:f.createLink,close:h(this._close,this),visible:!1});t&&(this._range.selectNodeContents(t),r=c(this._range));this._initialText=this.linkText(r);u.find(".k-dialog-insert").click(h(this._apply,this)).end().find(".k-dialog-close").click(h(this._close,this)).end().find(".k-edit-field input").keydown(h(this._keydown,this)).end().find("#k-editor-link-url").val(this.linkUrl(t)).end().find("#k-editor-link-text").val(this._initialText).end().find("#k-editor-link-title").val(t?t.title:"").end().find("#k-editor-link-target").attr("checked",t?t.target=="_blank":!1).end().find(".k-editor-link-text-row").toggle(!e);this._dialog=u.data("kendoWindow").center().open();n("#k-editor-link-url",u).focus().select()},_keydown:function(n){var t=u.keys;n.keyCode==t.ENTER?this._apply(n):n.keyCode==t.ESC&&this._close(n)},_apply:function(t){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!=a&&(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=i.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(t);this.change&&this.change()},_close:function(n){n.preventDefault();this._dialog.destroy();i.windowFromDocument(e.documentFromRange(this._range)).focus();this.releaseRange(this._range)},linkUrl:function(n){return n?n.getAttribute("href",2):a},linkText:function(n){for(var r="",t=0;t<n.length;t++)r+=n[t].nodeValue;return i.stripBom(r||"")},redo:function(){var n=this.lockRange(!0);this.formatter.apply(n,this.attributes);this.releaseRange(n)}}),ft=f.extend({init:function(n){f.fn.init.call(this,n);this.formatter=new v},exec:function(){var n=this.detectLink();if(n){var i=this.getRange(),r=new u.ui.editor.Marker,t=i.cloneRange();t.setStart(n.start.node,n.start.offset);t.setEnd(n.end.node,n.end.offset);i=this.lockRange();r.add(t);this.formatter.apply(t,{href:this._ensureWebProtocol(n.text)});r.remove(t);this.releaseRange(i)}},detectLink:function(){var r=this.getRange(),n=r.startContainer,t=r.startOffset,e=n.previousSibling,u,f;return e||(!i.isBom(n)||n.nextSibling)&&(t||!i.isDataNode(n))||(n=n.parentNode,t=0),u=new p({node:n,offset:t,cancelAtNode:function(n){return n&&i.name(n)==="a"}}),f=new ot(u),f.detectLink()},changesContent:function(){return!!this.detectLink()},_ensureWebProtocol:function(n){var t=this._hasProtocolPrefix(n);return t?n:this._prefixWithWebProtocol(n)},_hasProtocolPrefix:function(n){return tt.test(n)},_prefixWithWebProtocol:function(n){return a+n}}),et=o.extend({init:function(t){this.options=t;this.finder=new lt([{tags:["a"]}]);o.fn.init.call(this,n.extend(t,{command:rt}))},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")}}),ot=s.extend({init:function(n){this.traverser=n;this.start=y();this.end=y();this.text=""},detectLink:function(){var r=this.traverser.node,u=this.traverser.offset,f,t,e,o;if(i.isDataNode(r)){if(f=r.data.substring(0,u),/\s{2}$/.test(i.stripBom(f)))return}else u===0&&(t=i.closestEditableOfType(r,i.blockElements),t&&t.previousSibling&&this.traverser.init({node:t.previousSibling}));return this.traverser.traverse(n.proxy(this._detectEnd,this)),this.end.blank()||(this.traverser=this.traverser.clone(this.end),this.traverser.traverse(n.proxy(this._detectStart,this)),this._isLinkDetected()||(e=this.traverser.extendOptions(this.start),o=new w(e),o.traverse(n.proxy(this._skipStartPuntuation,this)),this._isLinkDetected()||(this.start=y()))),this.start.blank()?null:{start:this.start,end:this.end,text:this.text}},_isLinkDetected:function(){return tt.test(this.text)||/^w{3}\./i.test(this.text)},_detectEnd:function(n,t){var i=st(n,at);if(i>-1)return this.end.node=t,this.end.offset=i+1,!1},_detectStart:function(n,t){var i=st(n,/\s/),r=i+1;return this.text=n.substring(r)+this.text,this.start.node=t,this.start.offset=r,i>-1?!1:void 0},_skipStartPuntuation:function(n,t,i){var r=vt(n,/\w/),u=r;return r===-1&&(u=n.length),this.text=this.text.substring(u),this.start.node=t,this.start.offset=u+(i|0),r>-1?!1:void 0}}),y=function(){return{node:null,offset:null,blank:function(){return this.node===null&&this.offset===null}}},ht=s.extend({init:function(r){this.node=r.node;this.offset=r.offset===t?i.isDataNode(this.node)&&this.node.length||0:r.offset;this.cancelAtNode=r.cancelAtNode||this.cancelAtNode||n.noop},traverse:function(n){n&&(this.cancel=!1,this._traverse(n,this.node,this.offset))},_traverse:function(n,r,u){var o,s,f,e;if(r&&!this.cancel){if(r.nodeType===3)o=r.data,u!==t&&(o=this.subText(o,u)),this.cancel=n(o,r,u)===!1;else return s=this.edgeNode(r),this.cancel=this.cancel||this.cancelAtNode(s),this._traverse(n,s);if(f=this.next(r),!f)for(e=r.parentNode;!f&&i.isInline(e);)f=this.next(e),e=e.parentNode;this.cancel=this.cancel||this.cancelAtNode(f);this._traverse(n,f)}},extendOptions:function(t){return n.extend({node:this.node,offset:this.offset,cancelAtNode:this.cancelAtNode},t||{})},edgeNode:function(){},next:function(){},subText:function(){}}),p=ht.extend({subText:function(n,t){return n.substring(0,t)},next:function(n){return n.previousSibling},edgeNode:function(n){return n.lastChild},clone:function(n){var t=this.extendOptions(n);return new p(t)}}),w=ht.extend({subText:function(n,t){return n.substring(t)},next:function(n){return n.nextSibling},edgeNode:function(n){return n.firstChild},clone:function(n){var t=this.extendOptions(n);return new w(t)}});ct(u.ui.editor,{LinkFormatFinder:it,LinkFormatter:v,UnlinkCommand:rt,LinkCommand:ut,AutoLinkCommand:ft,UnlinkTool:et,DomTextLinkDetection:ot,LeftDomTextTraverser:p,RightDomTextTraverser:w});l("createLink",new o({key:"K",ctrl:!0,command:ut,template:new k({template:b.buttonTemplate,title:"Create Link"})}));l("unlink",new et({key:"K",ctrl:!0,shift:!0,template:new k({template:b.buttonTemplate,title:"Remove Link"})}));l("autoLink",new o({key:[nt.ENTER,nt.SPACEBAR],keyPressCommand:!0,command:ft}))})(window.kendo.jQuery)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("editor/file",["kendo.filebrowser","editor/link"],n)}(function(){(function(n,t){var i=window.kendo,v=n.extend,r=i.ui.editor,o=r.EditorUtils,u=r.Dom,y=o.registerTool,p=r.ToolTemplate,f=r.RangeUtils,s=r.Command,w=r.LinkFormatter,b=f.textNodes,h=i.keys,e="#k-editor-file-url",c="#k-editor-file-text",l="#k-editor-file-title",a=s.extend({init:function(n){var t=this;s.fn.init.call(t,n);t.formatter=new w;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,n.title=i.title,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 i.template('<div class="k-editor-dialog k-popup-edit-form"><div class="k-edit-form-container"><div class="k-edit-form-content"># 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-text">#: messages.fileText #<\/label><\/div><div class=\'k-edit-field\'><input type="text" class="k-input k-textbox" id="k-editor-file-text"><\/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><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><\/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 d(t){var i=a.element,u=i.find(e).val().replace(/ /g,"%20"),f=i.find(c).val(),o=i.find(l).val();n.attributes={href:u,innerHTML:f!==""?f:u,title:o};nt=n.insertFile(r,s);w(t);n.change&&n.change()}function w(t){t.preventDefault();a.destroy();u.windowFromDocument(f.documentFromRange(s)).focus();nt||n.releaseRange(s)}function ft(n){n.keyCode==h.ENTER?d(n):n.keyCode==h.ESC&&w(n)}var n=this,s=n.lockRange(),g=b(s),nt=!1,r=g.length?this.formatter.finder.findSuitable(g[0]):null,a,rt=i.support.browser.msie,tt=n.editor.options,ut=tt.messages,p=tt.fileBrowser,y=!!(i.ui.FileBrowser&&p&&p.transport&&p.transport.read!==t),k={title:ut.insertFile,visible:!1,resizable:y},o,it;this.expandImmutablesIn(s);k.close=w;y&&(k.width=750);a=this.createDialog(n._dialogTemplate(y),k).toggleClass("k-filebrowser-dialog",y).find(".k-dialog-insert").click(d).end().find(".k-dialog-close").click(w).end().find(".k-edit-field input").keydown(ft).end().find(e).val(r?r.getAttribute("href",2):"http://").end().find(c).val(r?r.innerText:"").end().find(l).val(r?r.title:"").end().data("kendoWindow");o=a.element;y&&(n._fileBrowser=new i.ui.FileBrowser(o.find(".k-filebrowser"),v({},p)),n._fileBrowser.bind("change",function(n){n.selected.get("type")==="f"&&o.find(e).val(this.value())}),n._fileBrowser.bind("apply",d));rt&&(it=o.closest(".k-window").height(),o.css("max-height",it));a.center().open();o.find(e).focus().select()}});i.ui.editor.FileCommand=a;y("insertFile",new r.Tool({command:a,template:new p({template:o.buttonTemplate,title:"Insert File"})}))})(window.kendo.jQuery)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("editor/image",["kendo.imagebrowser","editor/link"],n)}(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"><div class="k-edit-form-container"><div class="k-edit-form-content"># 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><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><\/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 d(t){var i=v.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);g=n.insertImage(r,s);b(t);n.change&&n.change()}function b(t){t.preventDefault();v.destroy();f.windowFromDocument(u.documentFromRange(s)).focus();g||n.releaseRange(s)}function et(n){n.keyCode==h.ENTER?d(n):n.keyCode==h.ESC&&b(n)}var n=this,s=n.lockRange(),g=!1,r=u.image(s),it=r&&r.getAttribute("width")||"",rt=r&&r.getAttribute("height")||"",v,ut=i.support.browser.msie,nt=n.editor.options,ft=nt.messages,w=nt.imageBrowser,p=!!(i.ui.ImageBrowser&&w&&w.transport&&w.transport.read!==t),k={title:ft.insertImage,visible:!1,resizable:p},o,tt;this.expandImmutablesIn(s);k.close=b;p&&(k.width=750);v=this.createDialog(n._dialogTemplate(p),k).toggleClass("k-filebrowser-dialog",p).find(".k-dialog-insert").click(d).end().find(".k-dialog-close").click(b).end().find(".k-edit-field input").keydown(et).end().find(e).val(r?r.getAttribute("src",2):"http://").end().find(c).val(r?r.alt:"").end().find(l).val(it).end().find(a).val(rt).end().data("kendoWindow");o=v.element;p&&(this._imageBrowser=new i.ui.ImageBrowser(o.find(".k-imagebrowser"),y({},w)),this._imageBrowser.bind("change",function(n){n.selected.get("type")==="f"&&o.find(e).val(this.value())}),this._imageBrowser.bind("apply",d));ut&&(tt=o.closest(".k-window").height(),o.css("max-height",tt));v.center().open();o.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)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("editor/components",["editor/image"],n)}(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)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("editor/indent",["editor/components"],n)}(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 e,o,s,v,r,a,h,l,f,y,c,p;if(t=i.filterBy(t,i.htmlIndentSpace,!0),e=this.finder.findSuitable(t),o=[],e=this.mapImmutables(e),e.length){for(s=0,v=e.length;s<v;s++)i.is(e[s],"li")?n(e[s]).index()?n.inArray(e[s].parentNode,o)<0&&o.push(e[s]):o.push(e[s].parentNode):o.push(e[s]);while(o.length)if(r=o.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=o.shift();else for(y=parseInt(u(r),10)+30,u(r,y),c=0;c<o.length;c++)n.contains(r,o[c])&&o.splice(c,1)}else p=new g([{tags:["p"]}],{style:{marginLeft:30}}),p.apply(t)},mapImmutables:function(t){if(this.immutables){var i=[];return n.map(t,function(t){var u=r.Immutables.immutableParent(t);if(u)if(n.inArray(u,i)===-1)i.push(u);else return null;return u||t})}return t},remove:function(t){t=i.filterBy(t,i.htmlIndentSpace,!0);var s=this.finder.findSuitable(t),f,h,l,r,o,c,e,a;for(s=this.mapImmutables(s),h=0,l=s.length;h<l;h++){if(e=n(s[h]),e.is("li"))if(r=e.parent(),o=r.parent(),o.is("li,ul,ol")&&!u(r[0])){if(f&&n.contains(f,o[0]))continue;c=e.nextAll("li");c.length&&n(r[0].cloneNode(!1)).appendTo(e).append(c);o.is("li")?e.insertAfter(o):e.appendTo(o);r.children("li").length||r.remove();continue}else{if(f==r[0])continue;f=r[0]}else f=s[h];a=parseInt(u(f),10)-30;u(f,a)}}}),y=f.extend({init:function(t){var i=this;t.formatter={toggle:n.proxy(function(n){var t=new s;t.immutables=this.editor&&this.editor.options.immutables;t.apply(a.nodes(n))},i)};f.fn.init.call(this,t)}}),p=f.extend({init:function(t){var i=this;t.formatter={toggle:n.proxy(function(n){var t=new s;t.immutables=this.editor&&this.editor.options.immutables;t.remove(a.nodes(n))},i)};f.fn.init.call(this,t)}}),w=e.extend({init:function(n){e.fn.init.call(this,n);this.finder=new v([{tags:d}])},initialize:function(t,i){e.fn.initialize.call(this,t,i);n.extend(this.options,{immutables:i.editor&&i.editor.options.immutables});t.addClass("k-state-disabled")},update:function(t,f){for(var l=this.finder.findSuitable(f),o,h,e,c,s=0,a=l.length;s<a;s++)if(e=l[s],this.options.immutables&&(c=r.Immutables.immutableParent(e),c&&(e=c)),o=u(e),o||(h=n(e).parents("ul,ol").length,o=i.is(e,"li")&&(h>1||u(e.parentNode))||i.ofType(e,["ul","ol"])&&h>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)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("editor/viewhtml",["editor/indent"],n)}(function(){(function(n,t){var u=window.kendo,e=n.extend,i=u.ui.editor,o=i.EditorUtils,f=i.Command,s=i.Tool,h=i.ToolTemplate,r=f.extend({init:function(n){var t=this;t.options=n;f.fn.init.call(t,n);t.attributes=null;t.async=!0},exec:function(){function a(n){f.deserialization.immutables=i.immutables;i.value(e.find(s).val());f.deserialization.immutables=t;h(n);o.change&&o.change();i.trigger("change")}function h(n){n.preventDefault();e.data("kendoWindow").destroy();i.immutables&&(i.immutables.serializedImmutables={});i.focus()}var o=this,i=o.editor,f=i.options,c=i.options.messages,e=n(u.template(r.template)(c)).appendTo(document.body),s=".k-editor-textarea",l;f.serialization.immutables=i.immutables;l=r.indent(i.value());f.serialization.immutables=t;this.createDialog(e,{title:c.viewHtml,close:h,visible:!1}).find(s).val(l).end().find(".k-dialog-update").click(a).end().find(".k-dialog-close").click(h).end().data("kendoWindow").center().open();e.find(s).focus()}});e(r,{template:"<div class='k-editor-dialog k-popup-edit-form k-viewhtml-dialog'><div class='k-edit-form-container'><\/div><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><\/div>",indent:function(n){return n.replace(/<\/(p|li|ul|ol|h[1-6]|table|tr|td|th)>/gi,"<\/$1>\n").replace(/<(ul|ol)([^>]*)><li/gi,"<$1$2>\n<li").replace(/<br \/>/gi,"<br />\n").replace(/\n$/,"")}});u.ui.editor.ViewHtmlCommand=r;i.EditorUtils.registerTool("viewHtml",new s({command:r,template:new h({template:o.buttonTemplate,title:"View HTML"})}))})(window.kendo.jQuery)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("editor/formatting",["editor/viewhtml"],n)}(function(){(function(n){function v(n){var u=i.closestEditableOfType(n,["li"]),e,f;u&&(e=new t.ListFormatter(i.name(u.parentNode)),f=r.ui.editor.W3CRange.fromNode(n),f.selectNode(u),e.toggle(f))}var r=window.kendo,t=r.ui.editor,u=t.Tool,e=t.ToolTemplate,o=t.DelayedExecutionTool,a=t.Command,i=t.Dom,f=t.EditorUtils,s=t.RangeUtils,h=f.registerTool,c=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 f=this,u=r.value;return u=this.toFormattingItem(u),new t.FormatCommand({range:r.range,formatter:function(){var r,e=(u.tag||u.context||"span").split(","),o=[{tags:e,attr:{className:u.className||""}}];return r=n.inArray(e[0],i.inlineElements)>=0?new t.GreedyInlineFormatter(o):new t.GreedyBlockFormatter(o),r.editor=f.editor,r}})},initialize:function(n,t){var i=t.editor,e=this.options,f=e.name,o=this;o.editor=i;n.width(e.width);n.kendoSelectBox({dataTextField:"text",dataValueField:"value",dataSource:e.items||i.options[f],title:i.options.messages[f],autoSize:!0,change:function(){var n=this.dataItem();n&&u.exec(i,f,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-"+f).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}}),l=a.extend({exec:function(){var t=this.lockRange(!0),i,n,r;for(this.tagsToClean=this.options.remove||"strong,em,span,sup,sub,del,b,i,u,font".split(","),s.wrapSelectedElements(t),i=s.mapAll(t,function(n){return n}),n=i.length-1;n>=0;n--)r=i[n],this.immutableParent(r)||this.clean(r);this.releaseRange(t)},clean:function(r){var u,e;if(r&&!i.isMarker(r)){if(u=i.name(r),u=="ul"||u=="ol"){var o=new t.ListFormatter(u),f=r.previousSibling,s=r.nextSibling;for(o.unwrap(r);f&&f!=s;f=f.nextSibling)this.clean(f)}else if(u=="blockquote")i.changeTag(r,"p");else if(r.nodeType!=1||i.insignificant(r))v(r);else{for(e=r.childNodes.length-1;e>=0;e--)this.clean(r.childNodes[e]);r.removeAttribute("style");r.removeAttribute("class")}n.inArray(u,this.tagsToClean)>-1&&i.unwrap(r)}},immutableParent:function(n){return this.immutables()&&t.Immutables.immutableParent(n)}});n.extend(t,{FormattingTool:c,CleanFormatCommand:l});h("formatting",new c({template:new e({template:f.dropDownListTemplate,title:"Format"})}));h("cleanFormatting",new u({command:l,template:new e({template:f.buttonTemplate,title:"Clean formatting"})}))})(window.kendo.jQuery)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("editor/toolbar",["editor/formatting"],n)}(function(){(function(n,t){var i=window.kendo,l=i.ui,h=l.editor,c=l.Widget,o=n.extend,s=n.proxy,r=i.keys,u=".kendoEditor",a=i.ui.editor.EditorUtils,w=i.ui.editor.ToolTemplate,b=i.ui.editor.Tool,v=i._outerWidth,k=i._outerHeight,f="overflowAnchor",e=".k-tool-group:visible a.k-tool:not(.k-state-disabled),.k-tool.k-overflow-anchor:visible,.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",y={"k-i-sup-script":"superscript","k-i-sub-script":"subscript","k-i-align-left":"justifyLeft","k-i-align-center":"justifyCenter","k-i-align-right":"justifyRight","k-i-align-justify":"justifyFull","k-i-list-unordered":"insertUnorderedList","k-i-list-ordered":"insertOrderedList","k-i-login":"import","k-i-indent-increase":"indent","k-i-indent-decrease":"outdent","k-i-link-horizontal":"createLink","k-i-unlink-horizontal":"unlink","k-i-image":"insertImage","k-i-file-add":"insertFile","k-i-html":"viewHtml","k-i-foreground-color":"foreColor","k-i-paint":"backColor","k-i-table-insert":"createTable","k-i-table-column-insert-left":"addColumnLeft","k-i-table-column-insert-right":"addColumnRight","k-i-table-row-insert-above":"addRowAbove","k-i-table-row-insert-below":"addRowBelow","k-i-table-row-delete":"deleteRow","k-i-table-column-delete":"deleteColumn","k-i-table-properties":"tableWizard","k-i-table-wizard":"tableWizardInsert","k-i-clear-css":"cleanFormatting"},d=b.extend({initialize:function(t,i){t.attr({unselectable:"on"});var r=i.editor.toolbar;t.attr("aria-controls",i.editor.element.attr("id")).on("click",n.proxy(function(){this.overflowPopup.toggle()},r))},options:{name:f},command:n.noop,update:n.noop,destroy:n.noop}),p;a.registerTool(f,new d({key:"",ctrl:!0,template:new w({template:a.overflowAnchorTemplate})}));p=c.extend({init:function(n,t){var r=this;t=o({},t,{name:"EditorToolbar"});c.fn.init.call(r,n,t);t.popup&&r._initPopup();t.resizable&&t.resizable.toolbar&&(r._resizeHandler=i.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","exportAs","import"],fonts:["fontName","fontSize"],colors:["foreColor","backColor"]},overflowFlaseTools:["formatting","fontName","fontSize","foreColor","backColor","insertHtml"],_initPopup:function(){var t=this;this.window=n(this.element).wrap("<div class='editorToolbarWindow k-header' />").parent().prepend("<button class='k-button k-bare k-editortoolbar-dragHandle'><span class='k-icon k-i-handler-drag' /><\/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(i){n(i.target).is(".k-icon")||(t.preventPopupHide=!0)}).on("focusout",function(){t.options.editor.element.focusout()}).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);t.attr("aria-expanded",!0)},close:function(){t.attr("aria-expanded",!1)},activate:s(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||this.preventPopupHide||this.overflowPopup&&this.overflowPopup.visible()},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 i=this,u=i.window;i._editor&&i._editor.unbind("select",s(i.resize,i));i._editor=t;i.options.resizable&&i.options.resizable.toolbar&&t.options.tools.push(f);i.tools=i.expandTools(t.options.tools);i.render();i.element.find(".k-combobox .k-input").keydown(function(t){var i=n(this).closest(".k-combobox").data("kendoComboBox"),u=t.keyCode;u==r.RIGHT||u==r.LEFT?i.close():u==r.DOWN&&(i.dropDown.isOpened()||(t.stopImmediatePropagation(),i.open()))});i._attachEvents();i.items().each(function(){var r=i._toolName(this),u=r!=="moreVertical"?i.tools[r]:i.tools.overflowAnchor,o=u&&u.options,s=t.options.messages,h=o&&o.tooltip||s[r],f=n(this),e;u&&u.initialize&&((r=="fontSize"||r=="fontName")&&(e=s[r+"Inherit"],f.find("input").val(e).end().find("span.k-input").text(e).end()),u.initialize(f,{title:i._appendShortcutSequence(h,u),editor:i._editor}),f.closest(".k-widget",i.element).addClass("k-editor-widget"),f.closest(".k-colorpicker",i.element).next(".k-colorpicker").addClass("k-editor-widget"))});t.bind("select",s(i.resize,i));i.update();u&&u.wrapper.css({top:"",left:"",width:""})},show:function(){var t=this,r=t.window,o=t.options.editor,n,u,f,e=i.support.browser;r&&(n=r.wrapper,u=o.element,n.is(":visible")&&t.window.options.visible||(n[0].style.width||n.width(v(u)-parseInt(n.css("border-left-width"),10)-parseInt(n.css("border-right-width"),10)),r._moved||(f=u.offset(),n.css({top:Math.max(0,parseInt(f.top,10)-k(n)-parseInt(t.window.element.css("padding-bottom"),10)),left:Math.max(0,parseInt(f.left,10))})),(e.msie||e.edge)&&t._overlaps(u)?setTimeout(function(){r.open()},0):r.open()))},_overlaps:function(n){var t=this.window.wrapper,i=t.offset(),r=i.left,u=i.top,f=n.offset(),e=f.left,o=f.top;return!(e+n.width()<r||e>r+t.width()||o+n.height()<u||o>u+t.height())},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(e).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(e).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","autoLink"],tools:{},isCustomTool:function(n){return!(n in i.ui.Editor.defaultTools)},expandTools:function(t){for(var f,l=this._nativeTools,r,c=i.deepExtend({},i.ui.Editor.defaultTools),e={},s,u=0;u<t.length;u++)f=t[u],s=f.name,n.isPlainObject(f)?s&&c[s]?(e[s]=o({},c[s]),o(e[s].options,f)):(r=o({cssClass:"k-i-gear",type:"button",title:""},f),r.name||(r.name="custom"),r.cssClass="k-"+r.name,r.template||r.type!="button"||(r.template=h.EditorUtils.buttonTemplate,r.title=r.title||r.tooltip),e[s]={options:r}):c[f]&&(e[f]=c[f]);for(u=0;u<l.length;u++)e[l[u]]||(e[l[u]]=c[l[u]]);return e},render:function(){function it(t){var r;return t.getHtml?r=t.getHtml():(n.isFunction(t)||(t=i.template(t)),r=t(u)),n.trim(r)}function v(){e.children().length&&(nt&&(e.data("position",g),g++),e.appendTo(b))}function y(t){t!==f?(e=n("<li class='k-tool-group' role='presentation' />"),e.data("overflow",n.inArray(t,l)===-1?!0:!1)):e=n("<li class='k-overflow-tools' />")}var t=this,w=t.tools,u,o,p,r,tt=t._editor.element,b=t.element.empty(),k,a,h=t._editor.options.tools,d=i.support.browser,e,c,g=0,nt=t.options.resizable&&t.options.resizable.toolbar,l=this.overflowFlaseTools;for(b.empty(),h.length&&(r=h[0].name||h[0]),y(r,l),c=0;c<h.length;c++)(r=h[c].name||h[c],u=w[r]&&w[r].options,!u&&n.isPlainObject(r)&&(u=r),o=u&&u.template,r=="break"&&(v(),n("<li class='k-row-break' />").appendTo(t.element),y(r,l)),o)&&(a=t.toolGroupFor(r),(k!=a||r==f)&&(v(),y(r,l),k=a),r==f&&(o.options.title=t.options.messages.overflowAnchor),o=it(o),p=n(o).appendTo(e),a=="custom"&&(v(),y(r,l)),u.exec&&p.hasClass("k-tool")&&p.click(s(u.exec,tt[0])));v();n(t.element).children(":has(> .k-tool)").addClass("k-button-group");t.options.popup&&d.msie&&d.version<9&&t.window.wrapper.find("*").attr("unselectable","on");t.updateGroups();nt&&t._initOverflowPopup(t.element.find(".k-overflow-anchor"));t.angular("compile",function(){return{elements:t.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(){c.fn.destroy.call(this);var n,t=this.tools;for(n in t)t[n].destroy&&t[n].destroy();this.window&&this.window.destroy();this._resizeHandler&&i.unbindResize(this._resizeHandler);this.overflowPopup&&this.overflowPopup.destroy()},_attachEvents:function(){var t=this,i=t.overflowPopup?t.overflowPopup.element:n([]);t.attachToolsEvents(t.element.add(i))},attachToolsEvents:function(t){var f=this,o="[role=button].k-tool",s=o+":not(.k-state-disabled)",h=o+".k-state-disabled",c=[o,".k-dropdown",".k-colorpicker"].join(",");t.off(u).on("mouseenter"+u,s,function(){n(this).addClass("k-state-hover")}).on("mouseleave"+u,s,function(){n(this).removeClass("k-state-hover")}).on("mousedown"+u,c,function(n){n.preventDefault()}).on("keydown"+u,e,function(t){function h(n,t,i){var r=t.find(e),u=r.index(s)+n;return i&&(u=Math.max(0,Math.min(r.length-1,u))),r[u]}var s=this,a=f.options.resizable&&f.options.resizable.toolbar,v=i.support.isRtl(f.element)?-1:1,c,u,l,o=t.keyCode;o==r.RIGHT||o==r.LEFT?u=n(s).is(".k-dropdown")?n(s):h(o==r.RIGHT?1*v:-1*v,f.element,!0):a&&(o==r.UP||o==r.DOWN)?u=h(o==r.DOWN?1:-1,f.overflowPopup.element,!0):o==r.HOME?(u=f.element.find(e)[0],t.preventDefault()):o==r.END?(c=f.element.find(e).filter(function(){return n(this).css("visibility")!=="hidden"}),u=c[c.length-1],t.preventDefault()):o==r.ESC?(f.overflowPopup&&f.overflowPopup.visible()&&f.overflowPopup.close(),u=f._editor):o!=r.TAB||t.ctrlKey||t.altKey||(l=a?n(s.parentElement).hasClass("k-overflow-tool-group")?f.overflowPopup.element:f.element:f.element,t.shiftKey?u=h(-1,l):(u=h(1,l),u&&n(u).closest(".k-overflow-tools").css("visibility")!=="hidden"||(u=f._editor)));u&&(t.preventDefault(),u.focus());(o===r.ENTER||o===r.SPACEBAR)&&n(s).is("a")&&!n(s).attr("href")&&f._executeToolCommand(s,t)}).on("click"+u,s,function(n){f._executeToolCommand(this,n)}).on("click"+u,h,function(n){n.preventDefault()})},_executeToolCommand:function(t,i){var r=this,u=n(t);i.preventDefault();i.stopPropagation();u.removeClass("k-state-hover");u.is("[data-popup]")||r._editor.exec(r._toolName(t))},_toolName:function(t){var u,f,r;if(t)return(u=t.className,/k-tool\b/i.test(u)&&(u=t.firstChild.className),f=n.grep(u.split(" "),function(n){return!/^k-(widget|tool|tool-icon|icon|state-hover|header|combobox|dropdown|selectbox|colorpicker)$/i.test(n)}),f[0])?(r=f[0],y[r]&&(r=y[r]),r.indexOf("k-i-")>=0?i.toCamelCase(r.substring(r.indexOf("k-i-")+4)):r.substring(r.lastIndexOf("-")+1)):"custom"},refreshTools:function(){var t=this,u=i.ui.editor,e=t._editor,f=e.getRange(),r=u.RangeUtils.textNodes(f),o=e.options.immutables,s=t._immutablesContext(f);r=u.Dom.filterBy(r,u.Dom.htmlIndentSpace,!0);r.length||(r=[f.startContainer]);t.items().each(function(){var i=t.tools[t._toolName(this)],u;i&&(u=n(this),i.update&&i.update(u,r),o&&t._updateImmutablesState(i,u,s))});this.update()},_immutablesContext:function(n){if(this._editor.options.immutables){var t=i.ui.editor;return n.collapsed?t.Immutables.immutablesContext(n):t.RangeUtils.editableTextNodes(n).length===0}},_updateImmutablesState:function(i,r,u){var v=i.name,f=r,e=i.options.trackImmutables,o,s,c,a,l;if(e===t&&(e=n.inArray(v,h.Immutables.toolsToBeUpdated)>-1),e){if(o=u?"none":"",!r.is(".k-tool")){s=r.data();for(c in s)if(c.match(/^kendo[A-Z][a-zA-Z]*/)){a=s[c];f=a.wrapper;break}}f.css("display",o);l=f.closest("li");l.children(":visible").length===0&&l.css("display",o)}},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",v(r,!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(h,{Toolbar:p})})(window.jQuery||window.kendo.jQuery)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("editor/tables",["editor/toolbar"],n)}(function(){(function(n){var r=window.kendo,y=n.extend,h=n.proxy,i=r.ui.editor,t=i.Dom,u=i.EditorUtils,it=i.RangeUtils,c=i.Command,p="kendoEditor",w="k-state-active",a="k-state-selected",l=i.Tool,f=i.ToolTemplate,v=i.InsertHtmlCommand,rt=i.BlockFormatFinder,e=i.EditorUtils.registerTool,ut=r.getTouches,ft=r.template,et="<td style='width:#=width#%;'>#=content#<\/td>",ot=new rt([{tags:["table"]}]),b=v.extend({init:function(t){var i=n.extend({postProcess:this.postProcess,skipCleaners:!0},t||{});v.fn.init.call(this,i)},_tableHtml:function(n,t){n=n||1;t=t||1;var r=ft(et)({width:100/t,content:i.emptyTableCellContent}),u=100/n;return"<table class='k-table' data-last>"+new Array(n+1).join("<tr style='height:"+u+"%;'>"+new Array(t+1).join(r)+"<\/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);v.fn.exec.call(this)}}),s=l.extend({initialize:function(t,r){var s,o,c,a;l.fn.initialize.call(this,t,r);s=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));o=this._editor=r.editor;this._popup=s;c=new i.TableWizardTool({template:new f({template:u.buttonTemplate,title:o.options.messages.tableWizard}),command:i.TableWizardCommand,insertNewTable:!0});e("tableWizardInsert",c);a=n("<div class='k-editor-toolbar'>"+c.options.template.getHtml()+"<\/div>");a.appendTo(s.element);o.toolbar&&o.toolbar.attachToolsEvents(a)},popup:function(){return this._popup},_activate:n.noop,_open:function(){this._popup.options.anchor.addClass(w)},_close:function(){this._popup.options.anchor.removeClass(w)},_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()}}),k=s.extend({init:function(t){this.cols=8;this.rows=6;s.fn.init.call(this,n.extend(t,{command:b,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"),l=e.eq(0),o=e.eq(e.length-1),i=r.getOffset(l),u=r.getOffset(o),a=t.cols,v=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)/a;h=(u.top-i.top)/v;f.autoApplyNS(p).on("mousemove",function(n){t._setTableSize(c(n))}).on("mouseleave",function(){t._setTableSize()}).on("down",function(n){n.preventDefault();var i=ut(n)[0];t._exec(c(i.location))})},_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(a,i%e<t.col&&i/e<t.row)})):(u.text(o.createTable),f.removeClass(a))},_keydown:function(n){var o;if(s.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++);o={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(o):this._setTableSize(o);u&&(n.preventDefault(),n.stopImmediatePropagation())}},_open:function(){var n=this._editor.options.messages;s.fn._open.call(this);this.popup().element.find(".k-status").text(n.createTable).end().find(".k-ct-cell").removeClass(a)},_close:function(){s.fn._close.call(this);this.popup().element.off("."+p)}}),d=c.extend({exec:function(){for(var e=this.lockRange(!0),r=e.endContainer,o,n,u,f;t.name(r)!="td";)r=r.parentNode;if(!this.immutables()||!i.Immutables.immutableParent(r)){for(n=r.parentNode,o=n.children.length,u=n.cloneNode(!0),f=0;f<n.cells.length;f++)u.cells[f].innerHTML=i.emptyTableCellContent;this.options.position=="before"?t.insertBefore(u,n):t.insertAfter(u,n);this.releaseRange(e)}}}),g=c.extend({exec:function(){var e=this.lockRange(!0),f=t.closest(e.endContainer,"td"),h=t.closest(f,"table"),o,n,s=h.rows,r,u,c=this.options.position;if(!this.immutables()||!i.Immutables.immutableParent(f)){for(o=t.findNodeIndex(f,!0),n=0;n<s.length;n++)r=s[n].cells[o],u=r.cloneNode(),u.innerHTML=i.emptyTableCellContent,c=="before"?t.insertBefore(u,r):t.insertAfter(u,r);this.releaseRange(e)}}}),nt=c.extend({exec:function(){var e=this.lockRange(),o=it.mapAll(e,function(t){return n(t).closest("tr")[0]}),u=o[0],f,r,s;if(!this.immutables()||!i.Immutables.immutableParent(u)){if(f=t.closest(u,"table"),f.rows.length<=o.length)r=t.next(f),(!r||t.insignificant(r))&&(r=t.prev(f)),t.remove(f);else for(s=0;s<o.length;s++)u=o[s],t.removeTextSiblings(u),r=t.next(u)||t.prev(u),r=r.cells[0],t.remove(u);r&&(e.setStart(r,0),e.collapse(!0),this.editor.selectRange(e))}}}),tt=c.extend({exec:function(){var u=this.lockRange(),r=t.closest(u.endContainer,"td"),f=t.closest(r,"table"),o=f.rows,s=t.findNodeIndex(r,!0),h=o[0].cells.length,n,e;if(!this.immutables()||!i.Immutables.immutableParent(r)){if(h==1)n=t.next(f),(!n||t.insignificant(n))&&(n=t.prev(f)),t.remove(f);else for(t.removeTextSiblings(r),n=t.next(r)||t.prev(r),e=0;e<o.length;e++)t.remove(o[e].cells[s]);n&&(u.setStart(n,0),u.collapse(!0),this.editor.selectRange(u))}}}),o=l.extend({command:function(n){return n=y(n,this.options),n.action=="delete"?n.type=="row"?new nt(n):new tt(n):n.type=="row"?new d(n):new g(n)},initialize:function(n,t){l.fn.initialize.call(this,n,t);n.addClass("k-state-disabled")},update:function(n,t){var i=!ot.isFormatted(t);n.toggleClass("k-state-disabled",i)}});y(r.ui.editor,{PopupTool:s,TableCommand:b,InsertTableTool:k,TableModificationTool:o,InsertRowCommand:d,InsertColumnCommand:g,DeleteRowCommand:nt,DeleteColumnCommand:tt});e("createTable",new k({template:new f({template:u.buttonTemplate,popup:!0,title:"Create table"})}));e("addColumnLeft",new o({type:"column",position:"before",template:new f({template:u.buttonTemplate,title:"Add column on the left"})}));e("addColumnRight",new o({type:"column",template:new f({template:u.buttonTemplate,title:"Add column on the right"})}));e("addRowAbove",new o({type:"row",position:"before",template:new f({template:u.buttonTemplate,title:"Add row above"})}));e("addRowBelow",new o({type:"row",template:new f({template:u.buttonTemplate,title:"Add row below"})}));e("deleteRow",new o({type:"row",action:"delete",template:new f({template:u.buttonTemplate,title:"Delete row"})}));e("deleteColumn",new o({type:"column",action:"delete",template:new f({template:u.buttonTemplate,title:"Delete column"})}))})(window.kendo.jQuery)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("editor/export",["editor/main"],n)}(function(){(function(n){var i=window.kendo,o=n.extend,s=n.proxy,t=i.ui.editor,u=t.EditorUtils,f=t.Command,r=t.Tool,h=u.registerTool,c=t.ToolTemplate,l=f.extend({init:function(n){var t=this;t.options=n;f.fn.init.call(t,n);t.attributes=null;t.exportType=n.exportType},exec:function(){var n=this,t=this.lockRange(!0);n.postToProxy();n.releaseRange(t)},postToProxy:function(){this.generateForm().appendTo("body").submit().remove()},generateForm:function(){var t=this,i=t.editor.options.exportAs,r=n("<form>").attr({action:i&&i.proxyURL||"",method:"POST"});return r.append([t.valueInput(),t.exportTypeInput(),t.fileNameInput()]),r},valueInput:function(){var t=this.editor;return n("<input>").attr({value:t.encodedValue(),name:"value",type:"hidden"})},exportTypeInput:function(){var t=this;return n("<input>").attr({value:t.exportType,name:"exportType",type:"hidden"})},fileNameInput:function(){var t=this.editor,i=t.options.exportAs,r=i&&i.fileName||t.element.attr("id")||"editor";return n("<input>").attr({value:r,name:"fileName",type:"hidden"})}}),e=r.extend({init:function(n){var t=this;r.fn.init.call(t,i.deepExtend({},t.options,n));t.type="kendoSelectBox"},options:{items:[{text:"Docx",value:"docx"},{text:"Rtf",value:"rtf"},{text:"Pdf",value:"pdf"},{text:"Html",value:"html"},{text:"Plain Text",value:"txt"}],width:115},command:function(n){var i=n.value;return new t.ExportAsCommand({range:n.range,exportType:i.exportType})},initialize:function(n,t){var r=this,u=t.editor,f=r.options,e=f.name,h=s(r.changeHandler,r),o=f.items||u.options[e];o.unshift({text:u.options.messages[e],value:""});r.editor=u;n.width(f.width);n.kendoSelectBox({dataTextField:"text",dataValueField:"value",dataSource:o,autoSize:!0,change:h,open:function(n){var t=n.sender;t.items()[0].style.display="none";t.unbind("open")},highlightFirst:!1,template:i.template('<span unselectable="on" style="display:block;#=(data.style||"")#">#:data.text#<\/span>')});n.addClass("k-decorated").closest(".k-widget").removeClass("k-"+e).find("*").addBack().attr("unselectable","on")},changeHandler:function(n){var t=n.sender,i=t.dataItem(),r=i&&i.value;this._exec(r);t.value("")},_exec:function(n){n&&r.exec(this.editor,this.options.name,{exportType:n})},destroy:function(){this._ancestor=null}});o(t,{ExportAsTool:e,ExportAsCommand:l});h("exportAs",new e({template:new c({template:u.dropDownListTemplate,title:"Export As"})}))})(window.kendo.jQuery)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("editor/import",["editor/main"],n)}(function(){(function(n){var r=window.kendo,o=n.extend,i=n.proxy,t=r.ui.editor,u=t.EditorUtils,s=t.Command,h=t.Tool,c=u.registerTool,l=t.ToolTemplate,f='<div contenteditable="false" class="k-loading-mask" style="width: 100%; height: 100%; position: absolute; top: 0px; left: 0px;"><div class="k-loading-image"><\/div><div class="k-loading-color"><\/div><\/div>',e=s.extend({exec:function(){(this.editor._uploadWidget||this._initializeUploadWidget()).element.click()},_initializeUploadWidget:function(){var t=this,u=t.editor,r=u.options["import"],f=n('<input id="editorImport" name="files" type="file" />').kendoUpload({success:i(t._onUploadSuccess,t),progress:i(t._onUploadProgress,t),select:i(t._onUploadSelect,t),error:i(t._onUploadError,t),complete:i(t._onUploadComplete,t),showFileList:!1,multiple:!1,async:{saveUrl:r.proxyUrl,autoUpload:!0,saveField:"file"},validation:{allowedExtensions:r.allowedExtensions,maxFileSize:r.maxFileSize}}).getKendoUpload();return u._uploadWidget=f,f},_onUploadComplete:function(n){this._trigger("complete",n);n.sender.clearAllFiles();this._removeLoadingOverlay()},_onUploadSuccess:function(n){this.editor.value(n.response.html.replace(/<\/?body>/gi,""));this._trigger("success",n)},_onUploadProgress:function(n){this._trigger("progress",n)},_onUploadSelect:function(n){this._trigger("select",n);n.files[0].validationErrors||this._initLoadingOverlay()},_onUploadError:function(n){this._trigger("error",n)},_trigger:function(n,t){var i=this.editor,r=i.options["import"];typeof r[n]=="function"&&r[n].call(i,t)},_initLoadingOverlay:function(){var i=this.editor.body;t.Dom.is(i,"body")?this._iframeWrapper=this._container=this.editor.wrapper.find("iframe").parent().css({position:"relative"}).append(f):this._container=n(i).append(f);r.ui.progress(this._container,!0)},_removeLoadingOverlay:function(){r.ui.progress(this._container,!1);n(this._iframeWrapper).css({position:""});delete this._container;delete this._iframeWrapper}});o(t,{ImportCommand:e});c("import",new h({command:e,template:new l({template:u.buttonTemplate,title:"Import"})}))})(window.kendo.jQuery)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("editor/resizing/resizing-utils",["editor/main"],n)}(function(){(function(n){function p(n){var i=n.value,r=n.min,u=n.max;return s(o(t(i),t(u)),t(r))}function w(t){return t&&!u(t).is("body")&&t.scrollHeight>t.clientHeight?n.support.scrollbar():0}function b(n,i){return e(n)?t(n):t(n)/i*100}function e(n){return typeof n===f&&v.test(n)}function k(n){return typeof n===f&&y.test(n)}function d(n){return t(n)+l}function g(n){return t(n)+a}var i=window,r=i.Math,o=r.min,s=r.max,t=i.parseFloat,u=n.jQuery,h=u.extend,c=n.ui.editor,l="%",a="px",v=/(\d+)(\.?)(\d*)%/,y=/(\d+)(\.?)(\d*)px/,f="string",nt={constrain:p,getScrollBarWidth:w,calculatePercentageRatio:b,inPercentages:e,inPixels:k,toPercentages:d,toPixels:g};h(c,{ResizingUtils:nt})})(window.kendo)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("editor/resizing/table-element-resizing",["editor/main","kendo.resizable","editor/resizing/resizing-utils"],n)}(function(){(function(n){var t=n.jQuery,h=t.extend,i=t.noop,u=t.proxy,v=n.ui.editor,c=n.Class,e="keydown",y="mousedown",p="mouseenter",l="mouseleave",w="mousemove",a="mouseup",b=",",o=".",k=":last-child",r="table",s=c.extend({init:function(n,i){var u=this;u.options=h({},u.options,i);u.options.tags=t.isArray(u.options.tags)?u.options.tags:[u.options.tags];t(n).is(r)&&(u.element=n,u._attachEventHandlers())},destroy:function(){var n=this,i=n.options.eventNamespace;n.element&&(t(n.element).off(i),n.element=null);t(n.options.rootElement).off(e+i);n._destroyResizeHandle()},options:{tags:[],min:0,rootElement:null,eventNamespace:"",rtl:!1,handle:{dataAttribute:"",height:0,width:0,classNames:{},template:""}},_attachEventHandlers:function(){var n=this,i=n.options;t(n.element).on(w+i.eventNamespace,i.tags.join(b),u(n.detectElementBorderHovering,n))},resizingInProgress:function(){var t=this,n=t._resizable;return n?!!n.resizing:!1},resize:i,detectElementBorderHovering:function(n){var i=this,e=i.options,o=e.handle,r=t(n.currentTarget),u=i.resizeHandle,f=o.dataAttribute;i.resizingInProgress()||(!r.is(k)&&i.elementBorderHovered(r,n)?u?u.data(f)&&u.data(f)!==r[0]&&i.showResizeHandle(r,n):i.showResizeHandle(r,n):u&&i._destroyResizeHandle())},elementBorderHovered:i,showResizeHandle:function(n,t){var i=this;t.buttons===0&&(i._initResizeHandle(),i.setResizeHandlePosition(n),i.setResizeHandleDimensions(),i.setResizeHandleDataAttributes(n[0]),i._attachResizeHandleEventHandlers(),i._initResizable(n),i._hideResizeMarker(),i.resizeHandle.show())},_initResizeHandle:function(){var n=this,i=n.options;n._destroyResizeHandle();n.resizeHandle=t(i.handle.template).appendTo(i.rootElement)},setResizeHandlePosition:i,setResizeHandleDimensions:i,setResizeHandleDataAttributes:function(n){var t=this;t.resizeHandle.data(t.options.handle.dataAttribute,n)},_attachResizeHandleEventHandlers:function(){var n=this,t=n.options,i=t.eventNamespace,r=t.handle.classNames.marker,u=n.resizeHandle;n.resizeHandle.on(y+i,function(){u.find(o+r).show()}).on(a+i,function(){u.find(o+r).hide()})},_hideResizeMarker:function(){var n=this;n.resizeHandle.find(o+n.options.handle.classNames.marker).hide()},_destroyResizeHandle:function(){var n=this;n.resizeHandle&&(n._destroyResizable(),n.resizeHandle.off(n.options.eventNamespace).remove(),n.resizeHandle=null)},_initResizable:function(t){var i=this;i.resizeHandle&&(i._destroyResizable(),i._resizable=new n.ui.Resizable(t,{draggableElement:i.resizeHandle[0],start:u(i.onResizeStart,i),resize:u(i.onResize,i),resizeend:u(i.onResizeEnd,i)}))},_destroyResizable:function(){var n=this;n._resizable&&(n._resizable.destroy(),n._resizable=null)},onResizeStart:function(){this._disableKeyboard()},onResize:function(n){this.setResizeHandleDragPosition(n)},setResizeHandleDragPosition:i,onResizeEnd:function(n){var t=this;t.resize(n);t._destroyResizeHandle();t._enableKeyboard()},_enableKeyboard:function(){var n=this.options;t(n.rootElement).off(e+n.eventNamespace)},_disableKeyboard:function(){var n=this.options;t(n.rootElement).on(e+n.eventNamespace,function(n){n.preventDefault()})},_forceResizing:function(n){var t=this._resizable;t&&t.userEvents&&t.userEvents._end(n)}}),f=c.extend({create:function(n,i){var u=this,f=i.name,e=i.eventNamespace;t(n.body).on(p+e,r,function(t){var r=t.currentTarget,e=n[f];t.stopPropagation();e?e.element===r||e.resizingInProgress()||(u._destroyResizing(n,i),u._initResizing(n,r,i)):u._initResizing(n,r,i)}).on(l+e,r,function(e){var s,o=n[f];e.stopPropagation();!o||o.resizingInProgress()||o.resizeHandle||(s=t(o.element).parents(r)[0],s&&(u._destroyResizing(n,i),u._initResizing(n,s,i)))}).on(l+e,function(){var t=n[f];t&&!t.resizingInProgress()&&u._destroyResizing(n,i)}).on(a+e,function(e){var o=n[f],s;o&&o.resizingInProgress()&&(s=t(e.target).parents(r)[0],s&&(o._forceResizing(e),u._destroyResizing(n,i),u._initResizing(n,s,i)))})},dispose:function(n,i){t(n.body).off(i.eventNamespace)},_initResizing:function(t,i,r){var u=r.name,f=r.type;t[u]=new f(i,{rtl:n.support.isRtl(t.element),rootElement:t.body})},_destroyResizing:function(n,t){var i=t.name;n[i]&&(n[i].destroy(),n[i]=null)}});f.current=new f;s.create=function(n,t){f.current.create(n,t)};s.dispose=function(n,t){f.current.dispose(n,t)};h(v,{TableElementResizing:s})})(window.kendo)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("editor/resizing/column-resizing",["editor/main","editor/resizing/resizing-utils","editor/resizing/table-element-resizing"],n)}(function(){(function(n){var tt=window,it=tt.Math,rt=it.abs,t=n.jQuery,ut=t.extend,o=n.ui.editor,s=o.TableElementResizing,u=o.ResizingUtils,h=u.constrain,y=u.calculatePercentageRatio,p=u.getScrollBarWidth,w=u.inPercentages,b=u.toPercentages,c=u.toPixels,i=n._outerWidth,l=".kendoEditorColumnResizing",k="k-column-resize-handle",d="k-column-resize-marker",a="body",f="tbody",g="td",v="tr",nt=",",r="width",e=s.extend({options:{tags:[g,"th"],min:20,rootElement:null,eventNamespace:l,rtl:!1,handle:{dataAttribute:"column",width:10,height:0,classNames:{handle:k,marker:d},template:'<div class="k-column-resize-handle-wrapper" unselectable="on" contenteditable="false"><div class="'+k+'"><div class="'+d+'"><\/div><\/div><\/div>'}},elementBorderHovered:function(n,r){var s=this,u=s.options,f=u.handle.width,e=n.offset().left+(u.rtl?0:i(n)),o=r.clientX+t(n[0].ownerDocument).scrollLeft();return o>e-f&&o<e+f?!0:!1},setResizeHandlePosition:function(n){var u=this,s=t(u.element).children(f),e=u.options,o=e.rtl,h=e.handle.width,r=t(e.rootElement),c=r.is(a)?0:r.scrollTop(),l=r.is(a)?0:r.scrollLeft(),v=o?0:i(n),y=o?p(r[0]):0;u.resizeHandle.css({top:s.position().top+c,left:n.position().left+v+(l-y)-h/2,position:"absolute"})},setResizeHandleDimensions:function(){var n=this,i=t(n.element).children(f);n.resizeHandle.css({width:n.options.handle.width,height:i.height()})},setResizeHandleDragPosition:function(n){var u=this,f=t(t(n.currentTarget).data(u.options.handle.dataAttribute)),r=u.options,b=r.handle?r.handle.width:0,l=r.min,e=r.rtl,k=i(f),v=f.position().left,y=i(f.next()),w=t(u.resizeHandle),o=t(r.rootElement),s=o.is(a)?0:o.scrollLeft(),c=e?p(o[0]):0,d=h({value:w.position().left+(s-c)+n.x.delta,min:v+(s-c)-(e?y:0)+l,max:v+k+(s-c)+(e?0:y)-b-l});w.css({left:d})},resize:function(n){var r=this,u=t(t(n.currentTarget).data(r.options.handle.dataAttribute)),s=r.options,l=s.rtl?-1:1,c=s.min,a=l*n.x.initialDelta,e,o,f;r._setTableComputedWidth();r._setColumnsComputedWidth();f=i(u);o=i(u.next());e=h({value:f+a,min:c,max:f+o-c});r._resizeColumn(u[0],e);r._resizeTopAndBottomColumns(u[0],e);r._resizeAdjacentColumns(u.index(),o,f,f-e)},_setTableComputedWidth:function(){var n=this.element;n.style[r]===""&&(n.style[r]=c(i(t(n))))},_setColumnsComputedWidth:function(){for(var s=this,e=t(s.element).children(f),h=i(e),u=e.children(v).children(g),l=u.length,o=u.map(function(){return i(t(this))}),n=0;n<l;n++)u[n].style[r]=w(u[n].style[r])?b(y(o[n],h)):c(o[n])},_resizeTopAndBottomColumns:function(n,i){for(var u=this,o=t(n).index(),e=t(u.element).children(f).children(v).children(u.options.tags.join(nt)).filter(function(){var i=this;return t(i).index()===o&&i!==n}),s=e.length,r=0;r<s;r++)u._resizeColumn(e[r],i)},_resizeColumn:function(n,u){n.style[r]=w(n.style[r])?b(y(u,i(t(this.element).children(f)))):c(u)},_resizeAdjacentColumns:function(n,i,r,u){for(var o=this,s=t(o.element).children(f).children(v).children(o.options.tags.join(nt)).filter(function(){return t(this).index()===n+1}),h=s.length,e=0;e<h;e++)o._resizeAdjacentColumn(s[e],i,r,u)},_resizeAdjacentColumn:function(n,t,i,r){var u=this,f=u.options.min,e;e=h({value:t+r,min:f,max:rt(i+t-f)});u._resizeColumn(n,e)}});e.create=function(n){s.create(n,{name:"columnResizing",type:e,eventNamespace:l})};e.dispose=function(n){s.dispose(n,{eventNamespace:l})};ut(o,{ColumnResizing:e})})(window.kendo)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("editor/resizing/row-resizing",["editor/main","editor/resizing/resizing-utils","editor/resizing/table-element-resizing"],n)}(function(){(function(n){var d=window.Math,g=d.abs,t=n.jQuery,nt=t.extend,o=n.ui.editor,s=o.TableElementResizing,u=o.ResizingUtils,tt=u.getScrollBarWidth,v=u.constrain,y=u.calculatePercentageRatio,p=u.inPercentages,w=u.toPercentages,h=u.toPixels,r=n._outerHeight,c=".kendoEditorRowResizing",b="k-row-resize-handle",k="k-row-resize-marker",l="body",a="tr",f="tbody",i="height",e=s.extend({options:{tags:[a],min:20,rootElement:null,eventNamespace:c,rtl:!1,handle:{dataAttribute:"row",width:0,height:10,classNames:{handle:b,marker:k},template:'<div class="k-row-resize-handle-wrapper" unselectable="on" contenteditable="false"><div class="'+b+'"><div class="k-row-resize-marker-wrapper"><div class="'+k+'"><\/div><\/div><\/div><\/div>'}},elementBorderHovered:function(n,u){var s=this,f=s.options.handle[i],e=n.offset().top+r(n),o=u.clientY+t(n[0].ownerDocument).scrollTop();return o>e-f&&o<e+f?!0:!1},setResizeHandlePosition:function(n){var e=this,f=e.options,s=f.handle[i],o=n.position(),u=t(f.rootElement),h=u.is(l)?0:u.scrollTop(),c=u.is(l)?0:u.scrollLeft(),a=f.rtl?tt(u[0]):0;e.resizeHandle.css({top:o.top+r(n)+h-s/2,left:o.left+(c-a),position:"absolute"})},setResizeHandleDimensions:function(){var n=this;n.resizeHandle.css({width:t(n.element).children(f).width(),height:n.options.handle[i]})},setResizeHandleDragPosition:function(n){var e=this,u=e.options,s=u.min,h=t(e.element).children(f),y=h.position().top,c=t(e.resizeHandle),p=t(n.currentTarget).data(u.handle.dataAttribute),a=t(u.rootElement),o=a.is(l)?0:a.scrollTop(),w=v({value:c.position().top+o+n.y.delta,min:t(p).position().top+o+s,max:y+r(h)+o-u.handle[i]-s});c.css({top:w})},resize:function(n){var u=this,e=u.options,o=t(n.currentTarget).data(e.handle.dataAttribute),s=r(t(o)),c=t(u.element),a=r(c),y=c.children(f),w=y.height(),b=o.style[i],l=v({value:s+n.y.initialDelta,min:e.min,max:g(w-e.min)});u._setRowsHeightInPixels();o.style[i]=h(l);u._setTableHeight(a+(l-s));p(b)&&u._setRowsHeightInPercentages()},_setRowsHeightInPixels:function(){for(var e=this,u=t(e.element).children(f).children(a),o=u.length,s=u.map(function(){return r(t(this))}),n=0;n<o;n++)u[n].style[i]=h(s[n])},_setRowsHeightInPercentages:function(){for(var o=this,e=t(o.element).children(f),s=e.height(),u=e.children(a),h=u.length,c=u.map(function(){return r(t(this))}),n=0;n<h;n++)u[n].style[i]=w(y(c[n],s))},_setTableHeight:function(n){var r=this.element;r.style[i]=p(r.style[i])?w(y(n,t(r).parent().height())):h(n)}});e.create=function(n){s.create(n,{name:"rowResizing",type:e,eventNamespace:c})};e.dispose=function(n){s.dispose(n,{eventNamespace:c})};nt(o,{RowResizing:e})})(window.kendo)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("editor/resizing/table-resize-handle",["editor/main","kendo.draganddrop","editor/resizing/resizing-utils"],n)}(function(){(function(n){var t=n.jQuery,c=t.extend,oi=t.noop,s=t.proxy,k=n.ui.editor,l=n.Class,si=n.ui.Draggable,d=n.Observable,hi=k.ResizingUtils.getScrollBarWidth,f=n._outerWidth,e=n._outerHeight,a=".kendoEditorTableResizeHandle",g="k-table-resize-handle",nt="dragStart",tt="drag",it="dragEnd",rt="halfInside",v="mouseover",y="mouseout",ci="body",li="table",ut="east",ft="north",et="northeast",ot="northwest",st="south",p="southeast",ht="southwest",ct="west",ai=".",vi=d.extend({init:function(n){var i=this;d.fn.init.call(i);i.options=c({},i.options,n);i.element=t(i.options.template).appendTo(i.options.appendTo)[0];i._attachEventHandlers();i._addStyles();i._initDraggable();i._initPositioningStrategy();i._initDraggingStrategy();t(i.element).data(li,i.options.resizableElement)},destroy:function(){var n=this;t(n.element).off(a).remove();n.element=null;n._destroyDraggable();n.unbind()},options:{appendTo:null,direction:p,resizableElement:null,rtl:!1,template:"<div class='k-table-resize-handle-wrapper' unselectable='on' contenteditable='false'><div class='"+g+"'><\/div><\/div>"},events:[nt,tt,it,v,y],show:function(){this._setPosition()},_setPosition:function(){var n=this,i=n._positioningStrategy.getPosition();t(n.element).css({top:i.top,left:i.left,position:"absolute"})},_attachEventHandlers:function(){var n=this;t(n.element).on(v+a,s(n._onMouseOver,n)).on(y+a,s(n._onMouseOut,n))},_onMouseOver:function(){this.trigger(v)},_onMouseOut:function(){this.trigger(y)},_addStyles:function(){var n=this;t(n.element).children(ai+g).addClass("k-resize-"+n.options.direction)},_initPositioningStrategy:function(){var t=this,n=t.options;t._positioningStrategy=u.create({name:n.direction,handle:t.element,resizableElement:n.resizableElement,rootElement:n.rootElement,rtl:n.rtl})},_initDraggable:function(){var n=this,t=n.element;!n._draggable&&t&&(n._draggable=new si(t,{dragstart:s(n._onDragStart,n),drag:s(n._onDrag,n),dragend:s(n._onDragEnd,n)}))},_onDragStart:function(){this.trigger(nt)},_onDrag:function(n){var t=this;t.trigger(tt,t._draggingStrategy.adjustDragDelta({deltaX:n.x.delta,deltaY:n.y.delta,initialDeltaX:n.x.initialDelta,initialDeltaY:n.y.initialDelta}))},_onDragEnd:function(){this.trigger(it)},_destroyDraggable:function(){var n=this;n._draggable&&(n._draggable.destroy(),n._draggable=null)},_initDraggingStrategy:function(){var n=this;n._draggingStrategy=o.create({name:n.options.direction})}}),lt=l.extend({init:function(){this._items=[]},register:function(n,t){this._items.push({name:n,type:t})},create:function(n){for(var u=this._items,f=u.length,e=n.name?n.name.toLowerCase():"",i,r,t=0;t<f;t++)if(r=u[t],r.name.toLowerCase()===e){i=r;break}if(i)return new i.type(n)}}),r=lt.extend({}),u,at,vt,yt,pt,wt,bt,kt,dt,i,o,w,gt,ni,b,ti,ii,h,ri,ui,fi,ei;r.current=new r;u=l.extend({init:function(n){var t=this;t.options=c({},t.options,n)},options:{handle:null,offset:rt,resizableElement:null,rootElement:null,rtl:!1},getPosition:function(){var n=this,t=n.calculatePosition(),i=n.applyHandleOffset(t);return n.applyScrollOffset(i)},calculatePosition:oi,applyHandleOffset:function(n){var i=this.options,r=t(i.handle);return i.offset===rt?{top:n.top-e(r)/2,left:n.left-f(r)/2}:n},applyScrollOffset:function(n){var r=this.options,i=t(r.rootElement),u=r.rtl?hi(i[0]):0;return i.is(ci)?n:{top:n.top+(i.scrollTop()||0),left:n.left+(i.scrollLeft()||0)-u}}});u.create=function(n){return r.current.create(n)};at=u.extend({calculatePosition:function(){var n=t(this.options.resizableElement),i=n.position();return{top:i.top+e(n)/2,left:i.left+f(n)}}});r.current.register(ut,at);vt=u.extend({calculatePosition:function(){var n=t(this.options.resizableElement),i=n.position();return{top:i.top,left:i.left+f(n)/2}}});r.current.register(ft,vt);yt=u.extend({calculatePosition:function(){var n=t(this.options.resizableElement),i=n.position();return{top:i.top,left:i.left+f(n)}}});r.current.register(et,yt);pt=u.extend({calculatePosition:function(){var i=t(this.options.resizableElement),n=i.position();return{top:n.top,left:n.left}}});r.current.register(ot,pt);wt=u.extend({calculatePosition:function(){var n=t(this.options.resizableElement),i=n.position();return{top:i.top+e(n),left:i.left+f(n)/2}}});r.current.register(st,wt);bt=u.extend({calculatePosition:function(){var n=t(this.options.resizableElement),i=n.position();return{top:i.top+e(n),left:i.left+f(n)}}});r.current.register(p,bt);kt=u.extend({calculatePosition:function(){var n=t(this.options.resizableElement),i=n.position();return{top:i.top+e(n),left:i.left}}});r.current.register(ht,kt);dt=u.extend({calculatePosition:function(){var n=t(this.options.resizableElement),i=n.position();return{top:i.top+e(n)/2,left:i.left}}});r.current.register(ct,dt);i=lt.extend({});i.current=new i;o=l.extend({init:function(n){var t=this;t.options=c({},t.options,n)},options:{deltaX:{adjustment:null,modifier:null},deltaY:{adjustment:null,modifier:null}},adjustDragDelta:function(n){var t=this.options,i=t.deltaX.adjustment*t.deltaX.modifier,r=t.deltaY.adjustment*t.deltaY.modifier;return{deltaX:n.deltaX*i,deltaY:n.deltaY*r,initialDeltaX:n.initialDeltaX*i,initialDeltaY:n.initialDeltaY*r}}});o.create=function(n){return i.current.create(n)};w=o.extend({options:{deltaX:{adjustment:1,modifier:1},deltaY:{adjustment:0,modifier:0}}});gt=w.extend({options:{deltaX:{modifier:1}}});i.current.register(ut,gt);ni=w.extend({options:{deltaX:{modifier:-1}}});i.current.register(ct,ni);b=o.extend({options:{deltaX:{adjustment:0,modifier:0},deltaY:{adjustment:1,modifier:1}}});ti=b.extend({options:{deltaY:{modifier:-1}}});i.current.register(ft,ti);ii=b.extend({options:{deltaY:{modifier:1}}});i.current.register(st,ii);h=o.extend({options:{deltaX:{adjustment:1,modifier:1},deltaY:{adjustment:1,modifier:1}}});ri=h.extend({options:{deltaX:{modifier:1},deltaY:{modifier:-1}}});i.current.register(et,ri);ui=h.extend({options:{deltaX:{modifier:-1},deltaY:{modifier:-1}}});i.current.register(ot,ui);fi=h.extend({options:{deltaX:{modifier:1},deltaY:{modifier:1}}});i.current.register(p,fi);ei=h.extend({options:{deltaX:{modifier:-1},deltaY:{modifier:1}}});i.current.register(ht,ei);c(k,{TableResizeHandle:vi})})(window.kendo)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("editor/resizing/table-resizing",["editor/main","editor/resizing/table-resize-handle","editor/resizing/resizing-utils"],n)}(function(){(function(n){function lt(n){return typeof n=="undefined"}var at=window,tt=at.Math,o=tt.min,s=tt.max,t=n.jQuery,w=t.contains,h=t.extend,f=t.proxy,it=n.support.browser,b=n.ui.editor,rt=n.Class,vt=b.TableResizeHandle,r=b.ResizingUtils,k=r.calculatePercentageRatio,ut=r.constrain,c=r.inPercentages,yt=r.inPixels,d=r.toPercentages,l=r.toPixels,ft=n._outerWidth,a=n._outerHeight,i=".kendoEditorTableResizing",et="k-table-resize-handle-wrapper",pt="k-table",ot="k-table-resizing",wt="dragStart",bt="drag",kt="dragEnd",g="keydown",st="mousedown",dt="mouseover",gt="mouseout",ht="td",v="tr",nt="tbody",ct="table",u="width",e="height",ni=".",y=rt.extend({init:function(n,i){var r=this;r.options=h({},r.options,i);r.handles=[];t(n).is(ct)&&(r.element=n)},destroy:function(){var n=this;t(n.element).off(i);n.element=null;t(n.options.rootElement).off(g+i);n._destroyResizeHandles()},options:{appendHandlesTo:null,rtl:!1,rootElement:null,minWidth:10,minHeight:10,handles:[{direction:"northwest"},{direction:"north"},{direction:"northeast"},{direction:"east"},{direction:"southeast"},{direction:"south"},{direction:"southwest"},{direction:"west"}]},resize:function(n){var i=this,t=h({},{deltaX:0,deltaY:0,initialDeltaX:0,initialDeltaY:0},n);i._resizeWidth(t.deltaX,t.initialDeltaX);i._resizeHeight(t.deltaY,t.initialDeltaY);i.showResizeHandles()},_resizeWidth:function(n,i){var r=this,h=t(r.element),w=h[0].style[u],p=ft(h),e=h.parent().width(),b=r._getMaxDimensionValue(u),a,v,y,f;n!==0&&(lt(r._initialElementWidth)&&(r._initialElementWidth=p),f=ut({value:r._initialElementWidth+i,min:r.options.minWidth,max:b}),c(w)?(p+n>e?(v=s(f,e),y=o(f,e)):(v=o(f,e),y=s(f,e)),a=d(k(v,y))):a=l(f),r._setColumnsWidth(),h[0].style[u]=a)},_resizeHeight:function(n,i){var r=this,h=t(r.element),g=h[0].style[e],w=a(h),nt=h.parent(),f=nt.height(),tt=r._getMaxDimensionValue(e),v,y,p,u,it=r.options.minHeight,b=r._hasRowsInPixels();n!==0&&(lt(r._initialElementHeight)&&(r._initialElementHeight=w),u=ut({value:r._initialElementHeight+i,min:it,max:tt}),b&&n<0&&r._setRowsHeightInPercentages(),c(g)?(w+n>f?(y=s(u,f),p=o(u,f)):(y=o(u,f),p=s(u,f)),v=d(k(y,p))):v=l(u),h[0].style[e]=v,b&&n<0&&r._setRowsHeightInPixels())},_getMaxDimensionValue:function(n){var i=this,h=t(i.element),f=n.toLowerCase(),l=i.options.rtl?-1:1,r=t(i.element).parent(),e=r[0],o=r[f](),s=l*(n===u?r.scrollLeft():r.scrollTop());return e===h.closest(ht)[0]?e.style[f]!==""||c(i.element.style[f])?o+s:Infinity:o+s},_setColumnsWidth:function(){function h(n){var i=n.style.width;return i!==""?c(i)?!0:!1:t(n).hasClass(pt)?!0:!1}var o=this,i=t(o.element),f=i.parent()[0],e=i.closest(ht),r=e.closest(v).children(),s=r.length,n;if(h(i[0])&&f===e[0]&&f.style[u]==="")for(n=0;n<s;n++)r[n].style[u]=l(t(r[n]).width())},_hasRowsInPixels:function(){for(var r=this,i=t(r.element).children(nt).children(v),n=0;n<i.length;n++)if(i[n].style.height===""||yt(i[n].style.height))return!0;return!1},_setRowsHeightInPercentages:function(){for(var u=this,r=t(u.element).children(nt),f=r.height(),i=r.children(v),o=i.length,s=i.map(function(){return a(t(this))}),n=0;n<o;n++)i[n].style[e]=d(k(s[n],f))},_setRowsHeightInPixels:function(){for(var r=this,i=t(r.element).children(nt).children(v),u=i.length,f=i.map(function(){return a(t(this))}),n=0;n<u;n++)i[n].style[e]=l(f[n])},showResizeHandles:function(){var n=this;n._initResizeHandles();n._showResizeHandles()},_initResizeHandles:function(){var n=this,r=n.handles,i=n.options,u=n.options.handles,f=u.length,t;if(!r||!(r.length>0)){for(t=0;t<f;t++)n.handles.push(new vt(h({appendTo:i.appendHandlesTo,resizableElement:n.element,rootElement:i.rootElement,rtl:i.rtl},u[t])));n._bindToResizeHandlesEvents()}},_destroyResizeHandles:function(){for(var n=this,i=n.handles?n.handles.length:0,t=0;t<i;t++)n.handles[t].destroy()},_showResizeHandles:function(){for(var t=this,i=t.handles||[],r=i.length,n=0;n<r;n++)t.handles[n].show()},_bindToResizeHandlesEvents:function(){for(var n=this,r=n.handles||[],u=r.length,t,i=0;i<u;i++)t=r[i],t.bind(wt,f(n._onResizeHandleDragStart,n)),t.bind(bt,f(n._onResizeHandleDrag,n)),t.bind(kt,f(n._onResizeHandleDragEnd,n)),t.bind(dt,f(n._onResizeHandleMouseOver,n)),t.bind(gt,f(n._onResizeHandleMouseOut,n))},_onResizeHandleDragStart:function(){var n=this,i=t(n.element);i.addClass(ot);n._initialElementHeight=a(i);n._initialElementWidth=ft(i);n._disableKeyboard()},_onResizeHandleDrag:function(n){this.resize(n)},_onResizeHandleDragEnd:function(){var n=this;t(n.element).removeClass(ot);n._enableKeyboard()},_enableKeyboard:function(){t(this.options.rootElement).off(g+i)},_disableKeyboard:function(){t(this.options.rootElement).on(g+i,function(n){n.preventDefault()})}}),p=rt.extend({create:function(n){var r=this;t(n.body).on(st+i,ct,function(t){var f=t.target,u=t.currentTarget,e=n.tableResizing,i=e?e.element:null;if(e){if(i&&u!==i){if(w(u,i)&&i!==f&&w(i,f))return;i!==f&&(n._destroyTableResizing(),r._initResizing(n,u))}}else r._initResizing(n,u);n._showTableResizeHandles()}).on(st+i,function(i){var u=n.tableResizing,f=u?u.element:null,r=i.target,e=t(r).hasClass(et)||t(r).parents(ni+et).length>0;!u||f===r||w(f,r)||e||n._destroyTableResizing()})},dispose:function(n){t(n.body).off(i)},_initResizing:function(t,i){it.msie||it.mozilla||(t.tableResizing=new y(i,{appendHandlesTo:t.body,rtl:n.support.isRtl(t.element),rootElement:t.body}))}});p.current=new p;y.create=function(n){p.current.create(n)};y.dispose=function(n){p.current.dispose(n)};h(b,{TableResizing:y})})(window.kendo)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("editor/immutables",["editor/tables"],n)}(function(){(function(n,t){var f=window.kendo,p=f.Class,o=f.ui.editor,i=o.Dom,w=f.template,h=o.RangeUtils,l=["ul","ol","tbody","thead","table"],e="k-immutable",a="["+e+"]",b="[contenteditable='false']",k=function(t){return n(t).is("body,.k-editor")},v=function(n){return n.getAttribute&&n.getAttribute("contenteditable")=="false"},r=function(n){return i.closestBy(n,v,k)},d=function(n){var t=r(n.startContainer),i=r(n.endContainer);(t||i)&&(t&&n.setStartBefore(t),i&&n.setEndAfter(i))},c=function(n){if(r(n.commonAncestorContainer))return!0;if(r(n.startContainer)||r(n.endContainer)){var t=h.editableTextNodes(n);if(t.length===0)return!0}return!1},y=function(n){for(var t="",i="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",r=n||10;r>0;--r)t+=i.charAt(Math.round(Math.random()*(i.length-1)));return t},g=function(t){var r={empty:!0},u,f,o;return n(t).find(b).each(function(t,s){u=i.name(s);f=y();o="<"+u+" "+e+"='"+f+"'><\/"+u+">";r[f]={node:s,style:n(s).attr("style")};r.empty=!1;n(s).replaceWith(o)}),r},nt=function(t,i){var u,r;n(t).find(a).each(function(t,f){u=f.getAttribute(e);r=i[u];n(f).replaceWith(r.node);r.style!=n(r.node).attr("style")&&n(r.node).removeAttr("style").attr("style",r.style)})},tt=function(n){var t=f.keys;return n===t.BACKSPACE||n==t.DELETE},s=function(n){var i=n?n.options:t;i&&i.finder&&i.finder._initOptions({immutables:!0})},u=p.extend({init:function(t){this.editor=t;this.serializedImmutables={};this.options=n.extend({},t&&t.options&&t.options.immutables);var i=t.toolbar.tools;s(i.justifyLeft);s(i.justifyCenter);s(i.justifyRight);s(i.justifyFull)},serialize:function(n){var t=this._toHtml(n),i;return t.indexOf(e)===-1?(i=this.randomId(),t=t.replace(/>/," "+e+'="'+i+'">')):i=t.match(/k-immutable\s*=\s*['"](.*)['"]/)[1],this.serializedImmutables[i]=n,t},_toHtml:function(n){var t=this.options.serialization,u=typeof t,r;switch(u){case"string":return w(t)(n);case"function":return t(n);default:return r=i.name(n),"<"+r+"><\/"+r+">"}},deserialize:function(t){var i=this,r=this.options.deserialization;n(a,t).each(function(){var u=this.getAttribute(e),t=i.serializedImmutables[u];f.isFunction(r)&&r(this,t);n(this).replaceWith(t)});i.serializedImmutables={}},randomId:function(n){return y(n)},keydown:function(n,t){var i=tt(n.keyCode),r=i&&this._cancelDeleting(n,t)||!i&&this._cancelTyping(n,t);if(r)return n.preventDefault(),!0},_cancelTyping:function(n,t){var r=this.editor,i=r.keyboard;return t.collapsed&&!i.typingInProgress&&i.isTypingKey(n)&&c(t)},_cancelDeleting:function(n,t){var s=f.keys,h=n.keyCode===s.BACKSPACE,a=n.keyCode==s.DELETE,u,r,e,o;if(!h&&!a)return!1;if(u=!1,t.collapsed){if(c(t))return!0;if(r=this.nextImmutable(t,a),r&&h&&(e=i.closest(t.commonAncestorContainer,"li"),e&&(o=i.closest(r,"li"),o&&o!==e)))return u;if(r&&!i.tableCell(r)){if(i.parentOfType(r,l)===i.parentOfType(t.commonAncestorContainer,l)){while(r&&r.parentNode.childNodes.length==1)r=r.parentNode;if(i.tableCell(r))return u;this._removeImmutable(r,t)}u=!0}}return u},nextImmutable:function(n,t){var f=n.commonAncestorContainer,u;if(i.isBom(f)||t&&h.isEndOf(n,f)||!t&&h.isStartOf(n,f)){if(u=this._nextNode(f,t),u&&i.isBlock(u)&&!r(u))while(u&&u.children&&u.children[t?0:u.children.length-1])u=u.children[t?0:u.children.length-1];return r(u)}},_removeImmutable:function(n,t){var r=this.editor,u=new o.RestorePoint(t,r.body);i.remove(n);o._finishUpdate(r,u)},_nextNode:function(n,t){for(var f=t?"nextSibling":"previousSibling",u=n,r;u&&!r;)r=u[f],r&&i.isDataNode(r)&&/^\s|[\ufeff]$/.test(r.nodeValue)&&(u=r,r=u[f]),r||(u=u.parentNode);return r}});u.immutable=v;u.immutableParent=r;u.expandImmutablesIn=d;u.immutablesContext=c;u.toolsToBeUpdated=["bold","italic","underline","strikethrough","superscript","subscript","forecolor","backcolor","fontname","fontsize","createlink","unlink","autolink","addcolumnleft","addcolumnright","addrowabove","addrowbelow","deleterow","deletecolumn","mergecells","formatting","cleanformatting"];u.removeImmutables=g;u.restoreImmutables=nt;o.Immutables=u})(window.kendo.jQuery)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("editor/table-wizard/table-wizard-command",["editor/tables"],n)}(function(){(function(n,t){var u=window.kendo,r=u.ui.editor,e=r.EditorUtils,o=r.RangeUtils,i=r.Dom,l=e.registerTool,a=r.ToolTemplate,s=r.Command,h=new r.BlockFormatFinder([{tags:["table"]}]),v=new r.BlockFormatFinder([{tags:["td","th"]}]),y=/([a-z]+|%)$/i,f=s.extend({exec:function(){var i=this,f=i.editor,e=i.range=i.lockRange(),o=i._sourceTable=i.options.insertNewTable?t:i._selectedTable(e),s=i._selectedTableCells=o?i._selectedCells(e):t,h={visible:!1,messages:f.options.messages,closeCallback:n.proxy(i.onDialogClose,i),table:i.parseTable(o,s),dialogOptions:f.options.dialogOptions,isRtl:u.support.isRtl(f.wrapper)},c=new r.TableWizardDialog(h);c.open()},onDialogClose:function(n){var t=this;t.releaseRange(t.range);n&&(t.options.insertNewTable?t.insertTable(t.createNewTable(n)):t.updateTable(n,t._sourceTable,t._selectedTableCells))},releaseRange:function(n){var t=this,r=t.editor.document;i.windowFromDocument(r).focus();s.fn.releaseRange.call(t,n)},insertTable:function(n){var t=this.range;t.insertNode(n);t.collapse(!0);this.editor.selectRange(t)},updateTable:function(t,r,u){for(var e=this,f=n(r.rows).toArray(),o=t.tableProperties,a=o.rows,h=o.columns,c=function(n){return n[n.length-1]},s,v,y,w,l;u.length>1;)u.pop();if(s=u.length?c(u).parentNode:c(f),e._deleteTableRows(f,f.length-a),f.length<a){var b=n(s).index(),k=s.cells.length,p=a-f.length;for(y=s.parentNode;p;)v=y.insertRow(b+1),e._insertCells(k-v.cells.length,v),p--}f[0].cells.length>h&&n(f).each(function(n,t){while(t.cells.length>h)t.deleteCell(-1)});f[0].cells.length<h&&(w=n(c(u)||c(s.cells)).index(),n(f).each(function(n,t){e._insertCells(h-t.cells.length,t,w+1)}));e._updateTableProperties(r,o);l=t.cellProperties;u[0]&&i.attr(u[0],{id:l.id||null});(l.selectAllCells?n(f).children():n(u)).each(function(n,t){e._updateCellProperties(t,l)});e._updateCaption(r,o);o.cellsWithHeaders=o.cellsWithHeaders||!1;e.cellsWithHeadersAssociated(r)!=o.cellsWithHeaders&&e.associateCellsWithHeader(r,o.cellsWithHeaders)},_isHeadingRow:function(n){return i.is(n.parentNode,"thead")||i.is(n.cells[0],"th")},associateCellsWithHeader:function(t,i){var s=(new Date).getTime(),f=[],h=t.rows[0].cells.length,e,r,u,c=function(){for(var n=0;n<h;n++)f[n]="table"+ ++s},l=function(t,r){n(r)[i?"attr":"removeAttr"]("id",f[t])},a=function(t,r){n(r)[i?"attr":"removeAttr"]("headers",f[t])},o=this._isHeadingRow;n(t.rows).each(function(i,f){if(o(f))for(e=i,r=t.rows[++e],u=r&&!o(r),u&&(c(),n(f.cells).each(l));u;)n(r.cells).each(a),r=t.rows[++e],u=r&&!o(r)})},cellsWithHeadersAssociated:function(t){var i=n(t.rows).children(),r=this._isHeadingRow,u=[],f;return i.each(function(n,t){t.id&&r(t.parentNode)&&u.push(t.id)}),f=i.filter(function(t,i){var f=i.getAttribute("headers");return f&&!r(i.parentNode)&&n.inArray(f,u)>-1}),!!f.length},_insertCells:function(n,t,i){i=isNaN(i)?-1:i;for(var r=0,u;r<n;r++)u=t.insertCell(i),u.innerHTML="&nbsp;"},_deleteTableRows:function(n,t){for(var f=0,u,r;f<t;f++)u=n.pop(),r=u.parentNode,r.removeChild(u),r.rows.length||i.remove(r)},createNewTable:function(n){var r=this,l=r.editor.document,t=n.tableProperties,o=n.cellProperties,a=o.selectAllCells,u=i.create(l,"table"),h,f,c,e,s;for(r._updateTableProperties(u,t),r._updateCaption(u,t),h=u.createTBody(),f=0;f<t.rows;f++)for(c=h.insertRow(),e=0;e<t.columns;e++)s=c.insertCell(),s.innerHTML="&nbsp;",f===0&&e===0&&o.id&&(s.id=o.id),r._updateCellProperties(s,a||f===0&&e===0?o:{});return t.cellsWithHeaders&&r.associateCellsWithHeader(u,t.cellsWithHeaders),u},_updateTableProperties:function(t,r){var u=this._getStylesData(r);i.attr(t,{cellSpacing:r.cellSpacing||null,cellPadding:r.cellPadding||null,className:r.className||null,id:r.id||null,summary:r.summary||null,style:u||null});n(t).addClass("k-table")},_updateCellProperties:function(n,t){var r=this._getStylesData(t);r.padding=t.cellPadding||null;r.margin=t.cellMargin||null;i.attr(n,{style:r||null,className:t.className||null})},_updateCaption:function(n,t){var r,u;n.caption&&!t.captionContent?n.deleteCaption():t.captionContent&&(r=n.createCaption(),r.innerHTML=t.captionContent,u=this._getAlignmentData(t.captionAlignment),i.attr(r,{style:{textAlign:u.textAlign,verticalAlign:u.verticalAlign}}))},_getStylesData:function(n){var t=this._getAlignmentData(n.alignment),i="wrapText"in n?n.wrapText?"":"nowrap":null;return{width:n.width?n.width+n.widthUnit:null,height:n.height?n.height+n.heightUnit:null,textAlign:t.textAlign,verticalAlign:t.verticalAlign,backgroundColor:n.bgColor||null,borderWidth:n.borderWidth,borderStyle:n.borderStyle,borderColor:n.borderColor,borderCollapse:n.collapseBorders?"collapse":null,whiteSpace:i}},_getAlignmentData:function(n){var t="",r=t,i;return n&&(n.indexOf(" ")!=-1?(i=n.split(" "),t=i[0],r=i[1]):t=n),{textAlign:t,verticalAlign:r}},parseTable:function(i,r){var f;if(!i)return{tableProperties:{},selectedCells:[]};var e=this,u=i.style,s=i.rows,o=i.caption,l=n(o?o.cloneNode(!0):t);l.find(".k-marker").remove();f=i.className;f=f.replace(/^k-table\s|\sk-table$/,"");f=f.replace(/\sk-table\s/," ");f=f.replace(/^k-table$/,"");var a=e._getAlignment(i,!0),h=o?e._getAlignment(o):t,v=e.cellsWithHeadersAssociated(i),c={tableProperties:{width:u.width||i.width?parseFloat(u.width||i.width):null,height:u.height||i.height?parseFloat(u.height||i.height):null,columns:s[0]?s[0].children.length:0,rows:s.length,widthUnit:e._getUnit(u.width),heightUnit:e._getUnit(u.height),cellSpacing:i.cellSpacing,cellPadding:i.cellPadding,alignment:a.textAlign,bgColor:u.backgroundColor||i.bgColor,className:f,id:i.id,borderWidth:u.borderWidth||i.border,borderColor:u.borderColor,borderStyle:u.borderStyle||"",collapseBorders:!!u.borderCollapse,summary:i.summary,captionContent:o?l.html():"",captionAlignment:o&&h.textAlign?h.textAlign+" "+h.verticalAlign:"",cellsWithHeaders:v},selectedCells:[]};return c.rows=e.parseTableRows(s,r,c),c},parseTableRows:function(t,i,r){for(var u,a=this,c=[],l,f,e,o,s,h=0;h<t.length;h++)for(l=t[h],f={cells:[]},e=l.cells,c.push(f),u=0;u<e.length;u++)o=e[u],s=a.parseCell(o),n.inArray(o,i)!=-1&&r.selectedCells.push(s),f.cells.push(s);return c},parseCell:function(n){var r=this,t=n.style,i=r._getAlignment(n);return i=i.textAlign?i.textAlign+" "+i.verticalAlign:"",{width:t.width||n.width?parseFloat(t.width||n.width):null,height:t.height||n.height?parseFloat(t.height||n.height):null,widthUnit:r._getUnit(t.width),heightUnit:r._getUnit(t.height),cellMargin:t.margin,cellPadding:t.padding,alignment:i,bgColor:t.backgroundColor||n.bgColor,className:n.className,id:n.id,borderWidth:t.borderWidth||n.border,borderColor:t.borderColor,borderStyle:t.borderStyle,wrapText:t.whiteSpace!="nowrap"}},_getAlignment:function(n,t){var u=n.style,i=u.textAlign||n.align||"",r;return t?{textAlign:i}:(r=u.verticalAlign||n.vAlign||"",i&&r)?{textAlign:i,verticalAlign:r}:!i&&r?{textAlign:"left",verticalAlign:r}:i&&!r?{textAlign:i,verticalAlign:"top"}:{textAlign:"",verticalAlign:""}},_getUnit:function(n){var t=(n||"").match(y);return t?t[0]:"px"},_selectedTable:function(n){var t=i.filterBy(o.nodes(n),i.htmlIndentSpace,!0);return h.findSuitable(t)[0]},_selectedCells:function(n){var t=i.filterBy(o.nodes(n),i.htmlIndentSpace,!0);return v.findSuitable(t)}}),c=r.Tool.extend({command:function(n){return n.insertNewTable=this.options.insertNewTable,new f(n)}}),p=c.extend({update:function(n,t){var i=!h.isFormatted(t);n.toggleClass("k-state-disabled",i)}});u.ui.editor.TableWizardTool=c;u.ui.editor.TableWizardCommand=f;l("tableWizard",new p({command:f,insertNewTable:!1,template:new a({template:e.buttonTemplate,title:"Table Wizard"})}))})(window.kendo.jQuery)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("editor/table-wizard/table-wizard-dialog",["editor/table-wizard/table-wizard-command"],n)}(function(){(function(n){var i=window.kendo,r={format:"0",min:0},t=["px","em"],u=["solid","dotted","dashed","double","groove","ridge","inset","outset","initial","inherit","none","hidden"],f={dataSource:[{className:"k-icon k-i-table-align-middle-left",value:"left"},{className:"k-icon k-i-table-align-middle-center",value:"center"},{className:"k-icon k-i-table-align-middle-right",value:"right"},{className:"k-icon k-i-align-remove",value:""}],dataTextField:"className",dataValueField:"value",template:"<span class='#: className #' title='#: tooltip #'><\/span>",valueTemplate:"<span class='k-align-group #: className #' title='#: tooltip #'><\/span>"},e={dataSource:[{className:"k-icon k-i-table-align-top-left",value:"left top"},{className:"k-icon k-i-table-align-top-center",value:"center top"},{className:"k-icon k-i-table-align-top-right",value:"right top"},{className:"k-icon k-i-table-align-middle-left",value:"left middle"},{className:"k-icon k-i-table-align-middle-center",value:"center middle"},{className:"k-icon k-i-table-align-middle-right",value:"right middle"},{className:"k-icon k-i-table-align-bottom-left",value:"left bottom"},{className:"k-icon k-i-table-align-bottom-center",value:"center bottom"},{className:"k-icon k-i-table-align-bottom-right",value:"right bottom"},{className:"k-icon k-i-align-remove",value:""}],dataTextField:"className",dataValueField:"value",template:"<span class='#: className #' title='#: tooltip #'><\/span>",valueTemplate:"<span class='k-align-group #: className #' title='#: tooltip #'><\/span>"},o={dataSource:[{className:"k-icon k-i-table-align-top-left",value:"left top"},{className:"k-icon k-i-table-align-top-center",value:"center top"},{className:"k-icon k-i-table-align-top-right",value:"right top"},{className:"k-icon k-i-table-align-bottom-left",value:"left bottom"},{className:"k-icon k-i-table-align-bottom-center",value:"center bottom"},{className:"k-icon k-i-table-align-bottom-right",value:"right bottom"},{className:"k-icon k-i-align-remove",value:""}],dataTextField:"className",dataValueField:"value",template:"<span class='#: className #' title='#: tooltip #'><\/span>",valueTemplate:"<span class='k-align-group #: className #' title='#: tooltip #'><\/span>"},s='<div class="k-editor-dialog k-editor-table-wizard-dialog k-action-window k-popup-edit-form"><div class="k-edit-form-container"><div id="k-table-wizard-tabs" class="k-root-tabs"><ul><li class="k-state-active">#= messages.tableTab #<\/li><li>#= messages.cellTab #<\/li><li>#= messages.accessibilityTab #<\/li><\/ul><div id="k-table-properties"><div class="k-edit-label"><label for="k-editor-table-width">#= messages.width #<\/label><\/div><div class="k-edit-field"><input type="numeric" id="k-editor-table-width" /><input id="k-editor-table-width-type" aria-label="#= messages.units #" /><\/div><div class="k-edit-label"><label for="k-editor-table-height">#= messages.height #<\/label><\/div><div class="k-edit-field"><input type="numeric" id="k-editor-table-height" /><input id="k-editor-table-height-type" aria-label="#= messages.units #" /><\/div><div class="k-edit-label"><label for="k-editor-table-columns">#= messages.columns #<\/label><\/div><div class="k-edit-field"><input type="numeric" id="k-editor-table-columns" /><\/div><div class="k-edit-label"><label for="k-editor-table-rows">#= messages.rows #<\/label><\/div><div class="k-edit-field"><input type="numeric" id="k-editor-table-rows" /><\/div><div class="k-edit-label"><label for="k-editor-table-cell-spacing">#= messages.cellSpacing #<\/label><\/div><div class="k-edit-field"><input type="numeric" id="k-editor-table-cell-spacing" /><\/div><div class="k-edit-label"><label for="k-editor-table-cell-padding">#= messages.cellPadding #<\/label><\/div><div class="k-edit-field"><input type="numeric" id="k-editor-table-cell-padding" /><\/div><div class="k-edit-label"><label for="k-editor-table-alignment">#= messages.alignment #<\/label><\/div><div class="k-edit-field"><input id="k-editor-table-alignment" class="k-align" /><\/div><div class="k-edit-label"><label for="k-editor-table-bg">#= messages.background #<\/label><\/div><div class="k-edit-field"><input id="k-editor-table-bg" /><\/div><div class="k-edit-label"><label for="k-editor-css-class">#= messages.cssClass #<\/label><\/div><div class="k-edit-field"><input id="k-editor-css-class" class="k-input k-textbox" type="text" /><\/div><div class="k-edit-label"><label for="k-editor-id">#= messages.id #<\/label><\/div><div class="k-edit-field"><input id="k-editor-id" class="k-input k-textbox" type="text" /><\/div><div class="k-edit-label"><label for="k-editor-border-width">#= messages.border #<\/label><\/div><div class="k-edit-field"><input type="numeric" id="k-editor-border-width" /><input id="k-editor-border-color" /><\/div><div class="k-edit-label"><label for="k-editor-border-style">#= messages.borderStyle #<\/label><\/div><div class="k-edit-field"><input id="k-editor-border-style" /><\/div><div class="k-edit-label">&nbsp;<\/div><div class="k-edit-field"><input id="k-editor-collapse-borders" type="checkbox" class="k-checkbox" /><label for="k-editor-collapse-borders" class="k-checkbox-label">#= messages.collapseBorders #<\/label><\/div><\/div><div id="k-cell-properties"><div class="k-edit-field"><input id="k-editor-selectAllCells" type="checkbox" class="k-checkbox" /><label for="k-editor-selectAllCells" class="k-checkbox-label">#= messages.selectAllCells #<\/label><\/div><div class="k-edit-label"><label for="k-editor-cell-width">#= messages.width #<\/label><\/div><div class="k-edit-field"><input type="numeric" id="k-editor-cell-width" /><input id="k-editor-cell-width-type" aria-label="#= messages.units #" /><\/div><div class="k-edit-label"><label for="k-editor-cell-height">#= messages.height #<\/label><\/div><div class="k-edit-field"><input type="numeric" id="k-editor-cell-height" /><input id="k-editor-cell-height-type" aria-label="#= messages.units #" /><\/div><div class="k-edit-label"><label for="k-editor-table-cell-margin">#= messages.cellMargin #<\/label><\/div><div class="k-edit-field"><input type="numeric" id="k-editor-table-cell-margin" /><\/div><div class="k-edit-label"><label for="k-editor-table-cells-padding">#= messages.cellPadding #<\/label><\/div><div class="k-edit-field"><input type="numeric" id="k-editor-table-cells-padding" /><\/div><div class="k-edit-label"><label for="k-editor-cell-alignment">#= messages.alignment #<\/label><\/div><div class="k-edit-field"><input id="k-editor-cell-alignment" class="k-align" /><\/div><div class="k-edit-label"><label for="k-editor-cell-bg">#= messages.background #<\/label><\/div><div class="k-edit-field"><input id="k-editor-cell-bg" /><\/div><div class="k-edit-label"><label for="k-editor-cell-css-class">#= messages.cssClass #<\/label><\/div><div class="k-edit-field"><input id="k-editor-cell-css-class" class="k-input k-textbox" type="text" /><\/div><div class="k-edit-label"><label for="k-editor-cell-id">#= messages.id #<\/label><\/div><div class="k-edit-field"><input id="k-editor-cell-id" class="k-input k-textbox" type="text" /><\/div><div class="k-edit-label"><label for="k-editor-cell-border-width">#= messages.border #<\/label><\/div><div class="k-edit-field"><input type="numeric" id="k-editor-cell-border-width" /><input id="k-editor-cell-border-color" /><\/div><div class="k-edit-label"><label for="k-editor-cell-border-style">#= messages.borderStyle #<\/label><\/div><div class="k-edit-field"><input id="k-editor-cell-border-style" /><\/div><div class="k-edit-label">&nbsp;<\/div><div class="k-edit-field"><input id="k-editor-wrap-text" type="checkbox" class="k-checkbox" /><label for="k-editor-wrap-text" class="k-checkbox-label">#= messages.wrapText #<\/label><\/div><\/div><div id="k-accessibility-properties"><div class="k-edit-label"><label for="k-editor-table-caption">#= messages.caption #<\/label><\/div><div class="k-edit-field"><input id="k-editor-table-caption" class="k-input k-textbox" type="text" /><\/div><div class="k-edit-label"><label for="k-editor-accessibility-alignment">#= messages.alignment #<\/label><\/div><div class="k-edit-field"><input id="k-editor-accessibility-alignment" class="k-align" /><\/div><div class="k-edit-label"><label for="k-editor-accessibility-summary">#= messages.summary #<\/label><\/div><div class="k-edit-field"><textarea id="k-editor-accessibility-summary" class="k-input k-textbox"><\/textarea><\/div><div class="k-edit-label">&nbsp;<\/div><div class="k-edit-field"><input id="k-editor-cells-headers" type="checkbox" class="k-checkbox" /><label for="k-editor-cells-headers" class="k-checkbox-label">#= messages.associateCellsWithHeaders #<\/label><\/div><\/div><\/div><div class="k-edit-buttons k-state-default"><button class="k-button k-primary k-dialog-ok">#= messages.dialogOk #<\/button><button class="k-button k-dialog-close">#= messages.dialogCancel #<\/button><\/div><\/div><\/div>',h=i.Class.extend({init:function(n){this.options=n},open:function(){function h(n){n.preventDefault();t.destroy();e.destroy()}function v(n){t.collectDialogValues(f);h(n);t.change&&t.change();r.closeCallback(f)}function c(n){h(n);r.closeCallback()}var t=this,r=t.options,o=r.dialogOptions,f=r.table,e,s=r.messages,a=i.support.browser.msie,u,l;o.close=c;o.title=s.tableWizard;o.visible=r.visible;e=n(t._dialogTemplate(s)).appendTo(document.body).kendoWindow(o).closest(".k-window").toggleClass("k-rtl",r.isRtl).end().find(".k-dialog-ok").click(v).end().find(".k-dialog-close").click(c).end().data("kendoWindow");u=e.element;t._initTabStripComponent(u);t._initTableViewComponents(u,f);t._initCellViewComponents(u,f);t._initAccessibilityViewComponents(u,f);e.center();e.open();a&&(l=u.closest(".k-window").height(),u.css("max-height",l))},_initTabStripComponent:function(n){var t=this.components={};t.tabStrip=n.find("#k-table-wizard-tabs").kendoTabStrip({animation:!1}).data("kendoTabStrip")},collectDialogValues:function(){var n=this,t=n.options.table;n._collectTableViewValues(t);n._collectCellViewValues(t);n._collectAccessibilityViewValues(t)},_collectTableViewValues:function(n){var t=this.components.tableView,i=n.tableProperties;i.width=t.width.value();i.widthUnit=t.widthUnit.value();i.height=t.height.value();i.columns=t.columns.value();i.rows=t.rows.value();i.heightUnit=t.heightUnit.value();i.cellSpacing=t.cellSpacing.value();i.cellPadding=t.cellPadding.value();i.alignment=t.alignment.value();i.bgColor=t.bgColor.value();i.className=t.className.value;i.id=t.id.value;i.borderWidth=t.borderWidth.value();i.borderColor=t.borderColor.value();i.borderStyle=t.borderStyle.value();i.collapseBorders=t.collapseBorders.checked},_collectCellViewValues:function(n){var t=n.cellProperties={},i=this.components.cellView;t.selectAllCells=i.selectAllCells.checked;t.width=i.width.value();t.widthUnit=i.widthUnit.value();t.height=i.height.value();t.heightUnit=i.heightUnit.value();t.cellMargin=i.cellMargin.value();t.cellPadding=i.cellPadding.value();t.alignment=i.alignment.value();t.bgColor=i.bgColor.value();t.className=i.className.value;t.id=i.id.value;t.borderWidth=i.borderWidth.value();t.borderColor=i.borderColor.value();t.borderStyle=i.borderStyle.value();t.wrapText=i.wrapText.checked},_collectAccessibilityViewValues:function(n){var t=n.tableProperties,i=this.components.accessibilityView;t.captionContent=i.captionContent.value;t.captionAlignment=i.captionAlignment.value();t.summary=i.summary.value;t.cellsWithHeaders=i.cellsWithHeaders.checked},_addUnit:function(t,i){i&&n.inArray(i,t)==-1&&t.push(i)},_initTableViewComponents:function(n,i){var e=this.components,f=e.tableView={},r=i.tableProperties=i.tableProperties||{};r.borderStyle=r.borderStyle||"";this._addUnit(t,r.widthUnit);this._addUnit(t,r.heightUnit);this._initNumericTextbox(n.find("#k-editor-table-width"),"width",r,f);this._initNumericTextbox(n.find("#k-editor-table-height"),"height",r,f);this._initNumericTextbox(n.find("#k-editor-table-columns"),"columns",r,f,{min:1,value:4});this._initNumericTextbox(n.find("#k-editor-table-rows"),"rows",r,f,{min:1,value:4});this._initDropDownList(n.find("#k-editor-table-width-type"),"widthUnit",r,f,t);this._initDropDownList(n.find("#k-editor-table-height-type"),"heightUnit",r,f,t);this._initNumericTextbox(n.find("#k-editor-table-cell-spacing"),"cellSpacing",r,f);this._initNumericTextbox(n.find("#k-editor-table-cell-padding"),"cellPadding",r,f);this._initTableAlignmentDropDown(n.find("#k-editor-table-alignment"),r);this._initColorPicker(n.find("#k-editor-table-bg"),"bgColor",r,f);this._initInput(n.find("#k-editor-css-class"),"className",r,f);this._initInput(n.find("#k-editor-id"),"id",r,f);this._initNumericTextbox(n.find("#k-editor-border-width"),"borderWidth",r,f);this._initColorPicker(n.find("#k-editor-border-color"),"borderColor",r,f);this._initDropDownList(n.find("#k-editor-border-style"),"borderStyle",r,f,u);this._initCheckbox(n.find("#k-editor-collapse-borders"),"collapseBorders",r,f)},_initCellViewComponents:function(n,i){var e=this.components,f=e.cellView={},r;i.selectedCells=i.selectedCells=i.selectedCells||[];r=i.selectedCells[0]||{borderStyle:"",wrapText:!0};this._addUnit(t,r.widthUnit);this._addUnit(t,r.heightUnit);this._initCheckbox(n.find("#k-editor-selectAllCells"),"selectAllCells",i.tableProperties,f);this._initNumericTextbox(n.find("#k-editor-cell-width"),"width",r,f);this._initNumericTextbox(n.find("#k-editor-cell-height"),"height",r,f);this._initDropDownList(n.find("#k-editor-cell-width-type"),"widthUnit",r,f,t);this._initDropDownList(n.find("#k-editor-cell-height-type"),"heightUnit",r,f,t);this._initNumericTextbox(n.find("#k-editor-table-cell-margin"),"cellMargin",r,f);this._initNumericTextbox(n.find("#k-editor-table-cells-padding"),"cellPadding",r,f);this._initCellAlignmentDropDown(n.find("#k-editor-cell-alignment"),r);this._initColorPicker(n.find("#k-editor-cell-bg"),"bgColor",r,f);this._initInput(n.find("#k-editor-cell-css-class"),"className",r,f);this._initInput(n.find("#k-editor-cell-id"),"id",r,f);this._initNumericTextbox(n.find("#k-editor-cell-border-width"),"borderWidth",r,f);this._initColorPicker(n.find("#k-editor-cell-border-color"),"borderColor",r,f);this._initDropDownList(n.find("#k-editor-cell-border-style"),"borderStyle",r,f,u);this._initCheckbox(n.find("#k-editor-wrap-text"),"wrapText",r,f)},_initAccessibilityViewComponents:function(n,t){var u=this.components,r=u.accessibilityView={},i=t.tableProperties;this._initInput(n.find("#k-editor-table-caption"),"captionContent",i,r);this._initAccessibilityAlignmentDropDown(n.find("#k-editor-accessibility-alignment"),i);this._initInput(n.find("#k-editor-accessibility-summary"),"summary",i,r);this._initCheckbox(n.find("#k-editor-cells-headers"),"cellsWithHeaders",i,r)},_initNumericTextbox:function(t,i,u,f,e){var o=f[i]=t.kendoNumericTextBox(e?n.extend({},r,e):r).data("kendoNumericTextBox");i in u&&o.value(parseInt(u[i],10))},_initDropDownList:function(n,t,i,r,u){var f=r[t]=n.kendoDropDownList({dataSource:u}).data("kendoDropDownList");this._setComponentValue(f,i,t)},_initTableAlignmentDropDown:function(n,t){var i=this.options.messages,u=this.components.tableView,r=f.dataSource;r[0].tooltip=i.alignLeft;r[1].tooltip=i.alignCenter;r[2].tooltip=i.alignRight;r[3].tooltip=i.alignRemove;this._initAlignmentDropDown(n,f,"alignment",t,u)},_initCellAlignmentDropDown:function(n,t){var i=this.options.messages,u=this.components.cellView,r=e.dataSource;r[0].tooltip=i.alignLeftTop;r[1].tooltip=i.alignCenterTop;r[2].tooltip=i.alignRightTop;r[3].tooltip=i.alignLeftMiddle;r[4].tooltip=i.alignCenterMiddle;r[5].tooltip=i.alignRightMiddle;r[6].tooltip=i.alignLeftBottom;r[7].tooltip=i.alignCenterBottom;r[8].tooltip=i.alignRightBottom;r[9].tooltip=i.alignRemove;this._initAlignmentDropDown(n,e,"alignment",t,u)},_initAccessibilityAlignmentDropDown:function(n,t){var i=this.options.messages,u=this.components.accessibilityView,r=o.dataSource;r[0].tooltip=i.alignLeftTop;r[1].tooltip=i.alignCenterTop;r[2].tooltip=i.alignRightTop;r[3].tooltip=i.alignLeftBottom;r[4].tooltip=i.alignCenterBottom;r[5].tooltip=i.alignRightBottom;r[6].tooltip=i.alignRemove;this._initAlignmentDropDown(n,o,"captionAlignment",t,u)},_initAlignmentDropDown:function(n,t,i,r,u){var f=u[i]=n.kendoDropDownList(t).data("kendoDropDownList");f.list.addClass("k-align").css("width","110px");this._setComponentValue(f,r,i)},_setComponentValue:function(n,t,i){i in t&&n.value(t[i])},_initColorPicker:function(n,t,i,r){var u=r[t]=n.kendoColorPicker({buttons:!1,clearButton:!0}).data("kendoColorPicker");i[t]&&u.value(i[t])},_initInput:function(n,t,i,r){var u=r[t]=n.get(0);t in i&&(u.value=i[t])},_initCheckbox:function(n,t,i,r){var u=r[t]=n.get(0);t in i&&(u.checked=i[t])},destroy:function(){this._destroyComponents(this.components.tableView);this._destroyComponents(this.components.cellView);this._destroyComponents(this.components.accessibilityView);this._destroyComponents(this.components);delete this.components},_destroyComponents:function(n){for(var t in n)n[t].destroy&&n[t].destroy(),delete n[t]},_dialogTemplate:function(n){return i.template(s)({messages:n})}});i.ui.editor.TableWizardDialog=h})(window.kendo.jQuery)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.editor",["kendo.combobox","kendo.dropdownlist","kendo.resizable","kendo.window","kendo.colorpicker","kendo.imagebrowser","kendo.tabstrip","kendo.numerictextbox","util/undoredostack","editor/main","editor/dom","editor/serializer","editor/range","editor/system","editor/inlineformat","editor/formatblock","editor/linebreak","editor/lists","editor/link","editor/file","editor/image","editor/components","editor/indent","editor/viewhtml","editor/formatting","editor/toolbar","editor/tables","editor/export","editor/import","editor/resizing/column-resizing","editor/resizing/row-resizing","editor/resizing/table-resizing","editor/resizing/table-resize-handle","editor/immutables","editor/table-wizard/table-wizard-command","editor/table-wizard/table-wizard-dialog"],n)}(function(){return window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.maskedtextbox",["kendo.core"],n)}(function(){return function(n,t){function r(n){return n+h}function rt(n,t){for(var i=0;i<t.length;){if(n[i]!==t[i])break;i++}return i}var a=window,v=a.Math.min,i=a.kendo,o=i.caret,y=i.keys,p=i.ui,s=p.Widget,h=".kendoMaskedTextBox",u=n.proxy,f=window.setTimeout,w="k-state-disabled",b="k-state-invalid",k="disabled",d="readonly",e="change",g="mouseup",c="drop",l="keydown",nt="paste",tt="input",it=r(i.support.propertyChangeEvent?"propertychange":tt),ut=s.extend({init:function(t,r){var u=this,e,c;s.fn.init.call(u,t,r);u._rules=n.extend({},u.rules,u.options.rules);t=u.element;e=t[0];u._wrapper();u._tokenize();u._form();u.element.addClass("k-textbox").attr("autocomplete","off").on("focus"+h,function(){var n=e.value;n?u._togglePrompt(!0):e.value=u._old=u._emptyMask;u._oldValue=n;u._timeoutId=f(function(){o(t,0,n?u._maskLength:0)})}).on("focusout"+h,function(){var n=t.val();clearTimeout(u._timeoutId);e.value=u._old="";n!==u._emptyMask&&(e.value=u._old=n);u._change();u._togglePrompt()});c=t.is("[disabled]")||n(u.element).parents("fieldset").is(":disabled");c?u.enable(!1):u.readonly(t.is("[readonly]"));u.value(u.options.value||t.val());u._validationIcon=n("<span class='k-icon k-i-warning'><\/span>").insertAfter(t);i.notify(u)},options:{name:"MaskedTextBox",clearPromptChar:!1,unmaskOnPost:!1,promptChar:"_",culture:"",rules:{},value:"",mask:""},events:[e],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;s.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(h);n._formElement&&(n._formElement.off("reset",n._resetHandler),n._formElement.off("submit",n._submitHandler));s.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 r=this.element,u=this._emptyMask;if(n===t)return this.element.val();if(n===null&&(n=""),!u){this._oldValue=n;r.val(n);return}n=this._unmask(n+"");r.val(n?u:"");this._mask(0,this._maskLength,n);this._unmaskedValue=null;n=r.val();this._oldValue=n;i._activeElement()!==r&&(n===u?r.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,t,f;if(n._maskLength){n.options.$angular&&n.element.off(tt);n.element.on(r(l),u(n._keydown,n)).on(r(c),u(n._drop,n)).on(r(e),u(n._trackChange,n)).on(it,u(n._inputHandler,n));if(i.support.browser.msie&&(t=i.support.browser.version,t>8&&t<11)){f=[r(g),r(c),r(l),r(nt)].join(" ");n.element.on(f,u(n._legacyIEInputHandler,n))}}},_unbindInput:function(){var n=[it,r(l),r(g),r(c),r(nt)].join(" ");this.element.off(n)},_editable:function(n){var t=this,r=t.element,u=t.wrapper,i=n.disable,f=n.readonly;t._unbindInput();f||i?(r.attr(k,i).attr(d,f),u.toggleClass(w,i)):(r.removeAttr(k).removeAttr(d),u.removeClass(w),t._bindInput())},_change:function(){var n=this,t=n.value();t!==n._oldValue?(n._oldValue=t,n.trigger(e),n.element.trigger(e)):t===""&&n.__changing&&n.element.trigger(e)},inputChange:function(n){var t=this,h=t._old,e=t.element[0],u=e.value,p=o(e),s=p[1],c=u.length-h.length,l=i.support.mobileOS,r,a;if(!t.__dropping||!(c<0)){c===-1&&l.android&&l.browser==="chrome"&&(n=!0);r=v(s,rt(u,h));a=u.substring(r,s);e.value=u.substring(0,r)+t._emptyMask.substring(r);var f=t._mask(r,s,a),y=t._trimStartPromptChars(u.substring(s),v(c,f-r)),w=t._unmask(y,h.length-y.length);t._mask(f,f,w);n&&(f=t._findCaretPosBackwards(r));o(e,f);t.__dropping=!1}},_trimStartPromptChars:function(n,t){for(var i=this.options.promptChar;t-->0&&n.indexOf(i)===0;)n=n.substring(1);return n},_findCaretPosBackwards:function(n){var t=this._find(n,!0);return t<n&&(t+=1),t},_inputHandler:function(){i._activeElement()===this.element[0]&&this.inputChange(this.__backward)},_legacyIEInputHandler:function(n){var t=this,i=t.element[0],u=i.value,r=n.type;t.__pasting=r==="paste";f(function(){r==="mouseup"&&t.__pasting||i.value!==u&&t.inputChange(t.__backward)})},_trackChange:function(){var n=this;n.__changing=!0;f(function(){n.__changing=!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(){f(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 t=n.keyCode;this.__backward=t===y.BACKSPACE;t===y.ENTER&&this._change()},_drop:function(){this.__dropping=!0},_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,u,f){var h=this.element[0],s=h.value||this._emptyMask,y=this.options.promptChar,l,a=0,c,v,e;for(n=this._find(n,f),n>r&&(r=n),c=this._unmask(s.substring(r),r),u=this._unmask(u,n),l=u.length,u&&(c=c.replace(new RegExp("^_{0,"+l+"}"),"")),u+=c,s=s.split(""),v=u.charAt(a);n<this._maskLength;)s[n]=v||y,v=u.charAt(++a),e===t&&a>l&&(e=n),n=this._find(n+1);return h.value=this._old=s.join(""),i._activeElement()===h&&(e===t&&(e=this._maskLength),o(h,e)),e},_unmask:function(t,i){if(!t)return"";if(this._unmaskedValue===t)return this._unmaskedValue;t=(t+"").split("");for(var u,r,e=0,f=i||0,s=this.options.promptChar,h=t.length,c=this.tokens.length,o="";f<c;)if(u=t[e],r=this.tokens[f],u===r||u===s?(o+=u===s?s:"",e+=1,f+=1):typeof r!="string"?(r&&r.test&&r.test(u)||n.isFunction(r)&&r(u)?(o+=u,f+=1):h===1&&this._blinkInvalidState(),e+=1):f+=1,e>=h)break;return this._unmaskedValue=o,o},_wrapper:function(){var t=this,i=t.element,n=i[0],r=i.wrap("<span class='k-widget k-maskedtextbox'><\/span>").parent();r[0].style.cssText=n.style.cssText;n.style.width="100%";t.wrapper=r.addClass(n.className)},_blinkInvalidState:function(){var n=this;n.wrapper.addClass(b);clearTimeout(n._invalidStateTimeout);n._invalidStateTimeout=f(u(n._removeInvalidState,n),100)},_removeInvalidState:function(){var n=this;n.wrapper.removeClass(b);n._invalidStateTimeout=null},_tokenize:function(){for(var e=[],u=0,l=this.options.mask||"",o=l.split(""),a=o.length,t=0,n,s,f="",v=this.options.promptChar,h=i.getCulture(this.options.culture).numberFormat,y=this._rules,r,c;t<a;t++)if(n=o[t],s=y[n],s)e[u]=s,f+=v,u+=1;else for(n==="."||n===","?n=h[n]:n==="$"?n=h.currency.symbol:n==="\\"&&(t+=1,n=o[t]),n=n.split(""),r=0,c=n.length;r<c;r++)e[u]=n[r],f+=n[r],u+=1;this.tokens=e;this._emptyMask=f;this._maskLength=f.length}});p.plugin(ut)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.toolbar",["kendo.core","kendo.userevents","kendo.popup"],n)}(function(){return function(n,t){function ir(){var n=this.options.anchor,t=tt(n),r;i.wrap(this.element).addClass("k-split-wrapper");r=this.element.css("box-sizing")!=="border-box"?t-(tt(this.element)-this.element.width()):t;this.element.css({fontFamily:n.css("font-family"),"min-width":r})}function hi(n){if(!n.target.is(".k-toggle-button")){if(n.target.hasClass("k-button")&&!dsiCommon.isNullOrEmpty(n.target.data())&&!dsiCommon.isNullOrEmpty(n.target.data().button)&&n.target.data().button.options.enable===!1)return!1;n.target.toggleClass(v,n.type=="press")}}function ci(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 at(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,vi=i.Class,ut=i.ui.Widget,nt=n.proxy,a=i.isFunction,r=i.keys,tt=i._outerWidth,yi="k-toolbar",e="k-button",it="k-overflow-button",vt="k-toggle-button",u="k-button-group",h="k-split-button",yt="k-separator",pt="k-popup",pi="k-toolbar-resizable",v="k-state-active",wt="k-state-disabled",c="k-state-hidden",wi="k-group-start",bi="k-group-end",ki="k-primary",d="k-icon",bt="k-i-",di="k-button-icon",gi="k-button-icontext",nr="k-list-container k-split-container",kt="k-split-button-arrow",y="k-overflow-anchor",dt="k-overflow-container",gt="k-toolbar-first-visible",ni="k-toolbar-last-visible",l="click",ti="toggle",ii="open",ri="close",ui="overflowOpen",fi="overflowClose",ei="never",ft="auto",tr="always",o="k-overflow-hidden",s=i.attr("uid"),g,f,p,w,b,rt,et,ot,st,ht,oi,si,ct,lt,li,ai;i.toolbar={};g={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){g[n]={toolbar:t,overflow:i}};f=i.Class.extend({addOverflowAttr:function(){this.element.attr(i.attr("overflow"),this.options.overflow||ft)},addUidAttr:function(){this.element.attr(s,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(c).show();this.options.hidden=!1},hide:function(){this.element.addClass(c).hide();this.options.hidden=!0},remove:function(){this.element.remove()},enable:function(n){n===t&&(n=!0);this.element.toggleClass(wt,!n);this.options.enable=n},twin:function(){var n=this.element.attr(s);return this.overflow?this.toolbar.element.find("["+s+"='"+n+"']").data(this.options.type):this.toolbar.options.resizable?this.toolbar.popup.element.find("["+s+"='"+n+"']").data(this.options.type):void 0}});i.toolbar.Item=f;p=f.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(ki);r.togglable&&(f.addClass(vt),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.group=this.toolbar.addToGroup(this,r.group));!r.togglable&&r.click&&a(r.click)&&(this.clickHandler=r.click);r.togglable&&r.toggle&&a(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("."+u).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().filter(function(){return!n(this).hasClass("k-sprite")&&!n(this).hasClass(d)&&!n(this).hasClass("k-image")}).each(function(t,i){(i.nodeType==1||i.nodeType==3&&n.trim(i.nodeValue).length>0)&&(o=!1)}),o?t.addClass(di):t.addClass(gi));u?(i=t.children("span."+d).first(),i[0]||(i=n('<span class="'+d+'"><\/span>').prependTo(t)),i.addClass(bt+u)):f?(i=t.children("span.k-sprite").first(),i[0]||(i=n('<span class="k-sprite '+d+'"><\/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(e);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(v,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(it+" "+e);n.hidden&&this.hide();n.togglable&&this.toggle(n.selected);this.element.data({type:"button",button:this})},_wrap:function(){this.element=this.element.wrap("<li><\/li>").parent()},overflowHidden:function(){this.element.addClass(o)},select:function(n){n===t&&(n=!1);this.options.isChild?this.element.toggleClass(v,n):this.element.find(".k-button").toggleClass(v,n);this.options.selected=n}});i.toolbar.OverflowButton=b;i.toolbar.registerComponent("button",w,b);rt=f.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('."+c+"'):first").addClass(wi);this.element.children().filter(":not('."+c+"'):last").addClass(bi)}});i.toolbar.ButtonGroup=rt;et=rt.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(u);this.element.data({type:"buttonGroup",buttonGroup:this})}});i.toolbar.ToolBarButtonGroup=et;ot=rt.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?"":u)+" k-overflow-group");this.element.data({type:"buttonGroup",buttonGroup:this})},overflowHidden:function(){this.element.addClass(o)}});i.toolbar.OverflowButtonGroup=ot;i.toolbar.registerComponent("buttonGroup",et,ot);st=f.extend({init:function(t,i){var r=this.element=n('<div class="'+h+'" tabindex="0"><\/div>');this.options=t;this.toolbar=i;this.mainButton=new w(n.extend({},t,{hidden:!1}),i);this.arrowButton=n('<a class="'+e+" "+kt+'"><span class="'+(t.mobile?"km-icon km-arrowdown":"k-icon k-i-arrow-60-down")+'"><\/span><\/a>');this.popupElement=n('<ul class="'+nr+'"><\/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;this.enable(t.enable);t.hidden&&this.hide();r.data({type:"splitButton",splitButton:this,kendoPopup:this.popup})},_navigatable:function(){var t=this;t.popupElement.on("keydown","."+e,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)}):i.keyCode===r.HOME?u.parent().find(":kendoFocusable").first().focus():i.keyCode===r.END&&u.parent().find(":kendoFocusable").last().focus()})},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(s,t.rootUid);t.mobile&&(this.popupElement=ci(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:ir,activate:function(){this.element.find(":kendoFocusable").first().focus()},close:function(){i.focus()}}).data("kendoPopup");this.popup.element.on(l,"a.k-button",at)},remove:function(){this.popup.element.off(l,"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()},hide:function(){this.popup&&this.popup.close();this.element.addClass(c).hide();this.options.hidden=!0},show:function(){this.element.removeClass(c).hide();this.options.hidden=!1}});i.toolbar.ToolBarSplitButton=st;ht=f.extend({init:function(t,i){var u=this.element=n('<li class="'+h+'"><\/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(o)}});i.toolbar.OverflowSplitButton=ht;i.toolbar.registerComponent("splitButton",st,ht);oi=f.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(yt);r.data({type:"separator",separator:this})}});si=f.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(yt);r.data({type:"separator",separator:this})},overflowHidden:function(){this.element.addClass(o)}});i.toolbar.registerComponent("separator",oi,si);ct=f.extend({init:function(t,i,r){var u=a(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=ct;lt=f.extend({init:function(t,i,r){var u=a(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(o)}});i.toolbar.OverflowTemplateItem=lt;li=vi.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 i,t=0;t<this.buttons.length;t++)i=this.buttons[t],i.select(!1);n.select(!0);n.twin()&&n.twin().select(!0)}});ai=ut.extend({init:function(t,r){var f=this,o;if(ut.fn.init.call(f,t,r),r=f.options,t=f.wrapper=f.element,t.addClass(yi+" k-widget"),this.uid=i.guid(),this._isRtl=i.support.isRtl(t),this._groups={},t.attr(s,this.uid),f.isMobile=typeof r.mobile=="boolean"?r.mobile:f.element.closest(".km-root")[0],f.animation=f.isMobile?{open:{effects:"fade"}}:{},f.isMobile&&(t.addClass("km-widget"),d="km-icon",bt="km-",e="km-button",u="km-buttongroup km-widget",v="km-state-active",wt="km-state-disabled"),r.resizable){f._renderOverflow();f._toggleOverflowAnchor();t.addClass(pi);f.overflowUserEvents=new i.UserEvents(f.element,{threshold:5,allowSelection:!0,filter:"."+y,tap:nt(f._toggleOverflow,f)});f._resizeHandler=nt(f.resize,f,!0);n(window).on("resize.dsPageFunction",f._resizeHandler);setTimeout(function(){f.resize(!0)},500)}else f.popup={element:n([])};if(r.items&&r.items.length)for(o=0;o<r.items.length;o++)f.add(r.items[o]);f.userEvents=new i.UserEvents(document,{threshold:5,allowSelection:!0,filter:"["+s+"="+this.uid+"] a."+e+", ["+s+"="+this.uid+"] ."+it,tap:nt(f._buttonClick,f),press:hi,release:hi});f.element.on(l,"a.k-button",at);if(f._navigatable(),r.resizable)f.popup.element.on(l,+'a.k-button',at);r.resizable&&this._toggleOverflowAnchor();i.notify(f)},events:[l,ti,ii,ri,ui,fi],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 li,i.add(n),i},destroy:function(){var t=this;t.element.find("."+h).each(function(t,i){n(i).data("kendoPopup").destroy()});t.element.off(l,"a.k-button");t.userEvents.destroy();t.options.resizable&&(i.unbindResize(t._resizeHandler),t.overflowUserEvents.destroy(),t.popup.element.off(l,"a.k-button"),t.popup.destroy());ut.fn.destroy.call(t)},add:function(t){var e=g[t.type],s=t.template,u,r=this,c=r.isMobile?"":"k-item k-state-default",h=t.overflowTemplate,f,o;if(n.extend(t,{uid:i.guid(),animation:r.animation,mobile:r.isMobile,rootUid:r.uid}),t.menuButtons)for(o=0;o<t.menuButtons.length;o++)n.extend(t.menuButtons[o],{uid:i.guid()});s&&!h?t.overflow=ei:t.overflow||(t.overflow=ft);t.overflow!==ei&&r.options.resizable&&(h?f=new lt(h,t,r):e&&(f=new e.overflow(t,r),f.element.addClass(c)),f&&(t.overflow===ft&&f.overflowHidden(),f.element.appendTo(r.popup.container),r.angular("compile",function(){return{elements:f.element.get()}})));t.overflow!==tr&&(s?u=new ct(s,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.find(".dsi-toolbar-split-collapse").length>0&&n("#"+u.element.attr("id").split("_split_wrapper")[0]).is(":visible")&&r._hideItem(u.element),u.element.css("visibility","visible")):u.element.appendTo(r.element),r.angular("compile",function(){return{elements:u.element.get()}})))},_getItem:function(t){var i,u,f,e=this.options.resizable,r;return i=this.element.find(t),i.length||(i=n(".k-split-container[data-uid="+this.uid+"]").find(t)),r=i.length?i.data("type"):"",u=i.data(r),u?(u.main&&(i=i.parent("."+h),r="splitButton",u=i.data(r)),e&&(f=u.twin())):e&&(i=this.popup.element.find(t),r=i.length?i.data("type"):"",f=i.data(r),f&&f.main&&(i=i.parent("."+h),r="splitButton",f=i.data(r))),{type:r,toolbar:u,overflow:f}},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.options.type==="button"&&t.toolbar.options.isChild?(t.toolbar.hide(),t.toolbar.getParentGroup().refresh()):t.toolbar.options.hidden||t.toolbar.hide());t.overflow&&(t.overflow.options.type==="button"&&t.overflow.options.isChild?(t.overflow.hide(),t.overflow.getParentGroup().refresh()):t.overflow.options.hidden||t.overflow.hide());this.resize(!0)},show:function(n){var t=this._getItem(n);t.toolbar&&(t.toolbar.options.type==="button"&&t.toolbar.options.isChild?(t.toolbar.show(),t.toolbar.getParentGroup().refresh()):t.toolbar.options.hidden&&t.toolbar.show());t.overflow&&(t.overflow.options.type==="button"&&t.overflow.options.isChild?(t.toolbar.show(),t.overflow.getParentGroup().refresh()):t.overflow.options.hidden&&t.overflow.show());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("."+vt+"[data-group='"+n+"']").filter("."+v)},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,f=g.overflowContainer,o=t._isRtl,c=o?"left":"right";t.overflowAnchor=n(g.overflowAnchor).addClass(e);t.element.append(t.overflowAnchor);t.isMobile?(t.overflowAnchor.append('<span class="km-icon km-more"><\/span>'),f=ci(f)):t.overflowAnchor.append('<span class="k-icon k-i-arrow-60-down"><\/span>');t.popup=new i.ui.Popup(f,{origin:"bottom "+c,position:"top "+c,anchor:t.overflowAnchor,isRtl:o,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",(o?-1:1)*((tt(u)-u.width())/2+1));t.trigger(ui)&&r.preventDefault()},activate:function(){this.element.find(":kendoFocusable").first().focus()},close:function(n){t.trigger(fi)&&n.preventDefault();this.element.focus()}});t.popup.element.on("keydown","."+e,function(i){var e=n(i.target),f=e.parent(),o=f.is("."+u)||f.is("."+h),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=!o||o&&e.is(":last-child")?f:e,k(s,"next").focus()):i.keyCode===r.UP?(s=!o||o&&e.is(":first-child")?f:e,k(s,"prev").focus()):i.keyCode===r.SPACEBAR||i.keyCode===r.ENTER?(t.userEvents.trigger("tap",{target:n(i.target)}),t.overflowAnchor.focus()):i.keyCode===r.HOME?f.parent().find(":kendoFocusable").first().focus():i.keyCode===r.END&&f.parent().find(":kendoFocusable").last().focus()});t.popup.container=t.isMobile?t.popup.element.find("."+dt):t.popup.element;t.popup.container.attr(s,this.uid)},_toggleOverflowAnchor:function(){var n=!1;n=this.options.mobile?this.popup.element.find("."+dt).children(":not(."+o+", ."+pt+", .dsi-toolbar-split-expand, .k-separator)").length>0:this.popup.element.children(":not(."+o+", ."+pt+", .dsi-toolbar-split-expand, .k-separator)").length>0;n?this.overflowAnchor.css({visibility:"visible",width:""}):this.overflowAnchor.css({visibility:"hidden",width:"1px"})},_buttonClick:function(t){var r=this,h,u,i,s,v=t.target.closest("."+kt).length,f,o,c;if(t.preventDefault(),v){r._toggle(t);return}(u=n(t.target).closest("."+e,r.element),u.hasClass(y))||(i=u.data("button"),!i&&r.popup&&(u=n(t.target).closest("."+it,r.popup.container),i=u.parent("li").data("button")),i&&i.options.enable)&&(i.options.togglable?(f=a(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},f&&f.call(r,o),r.trigger(ti,o)):(f=a(i.clickHandler)?i.clickHandler:null,o={sender:r,target:u,id:i.options.id},f&&f.call(r,o),r.trigger(l,o)),i.options.url&&(i.options.attributes&&i.options.attributes.target&&(c=i.options.attributes.target),window.open(i.options.url,c||"_self")),u.hasClass(it)&&r.popup.close(),s=u.closest(".k-split-container"),s[0]&&(h=s.data("kendoPopup"),(h?h:s.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.length!==0&&(t.is("."+y)&&(t=k(t,"next")),t[0].focus())}).on("keydown",nt(t._keydown,t))},_keydown:function(t){var i=n(t.target),e=t.keyCode,f=this.element.children(":not(.k-separator):visible"),s=this._isRtl?-1:1,p,c,l,w;if(e===r.TAB){var o=i.parentsUntil(this.element).last(),a=!1,v=!1;o.length||(o=i);o.is("."+y)&&(t.shiftKey&&t.preventDefault(),f.last().is(":kendoFocusable")?f.last().focus():f.last().find(":kendoFocusable").last().focus());t.shiftKey||f.index(o)!==f.length-1||(a=o.is("."+u)?i.is(":last-child"):!0);p=f.index(o)===f.not(".k-overflow-anchor").first().index();t.shiftKey&&p&&(v=o.is("."+u)?i.is(":first-child"):!0);a&&this.overflowAnchor&&this.overflowAnchor.css("visibility")!=="hidden"&&(t.preventDefault(),this.overflowAnchor.focus());v&&(t.preventDefault(),c=this._getPrevFocusable(this.wrapper),c&&c.focus());this._preventNextFocus=!1}if(t.altKey&&e===r.DOWN){l=n(document.activeElement).data("splitButton");w=n(document.activeElement).is("."+y);l?l.toggle():w&&this._toggleOverflow();return}if((e===r.SPACEBAR||e===r.ENTER)&&!i.is("input, checkbox")){t.preventDefault();i.is("."+h)&&(i=i.children().first());this.userEvents.trigger("tap",{target:i});return}if(e===r.HOME){if(i.is(".k-dropdown"))return;this.overflowAnchor?f.eq(1).focus():f.first().focus();t.preventDefault()}else if(e===r.END){if(i.is(".k-dropdown"))return;this.overflowAnchor&&n(this.overflowAnchor).css("visibility")!="hidden"?this.overflowAnchor.focus():f.last().focus();t.preventDefault()}else e!==r.RIGHT||this._preventNextFocus||i.is("input, select, .k-dropdown, .k-colorpicker")||!this._getNextElement(t.target,1*s)?e!==r.LEFT||this._preventNextFocus||i.is("input, select, .k-dropdown, .k-colorpicker")||!this._getNextElement(t.target,-1*s)||(this._getNextElement(t.target,-1*s).focus(),t.preventDefault()):(this._getNextElement(t.target,1*s).focus(),t.preventDefault())},_getNextElement:function(t,i){var f=this.element.children(":not(.k-separator):visible"),e=f.index(t)===-1?f.index(t.parentElement):f.index(t),s=this.overflowAnchor?1:0,o=i,h=i===1?f.length-1:s,c=i===1?s:f.length-1,r=f[e+i];if(this._preventNextFocus=!1,n(t).closest("."+u).length&&!n(t).is(i===1?":last-child":":first-child"))return n(t).closest("."+u).children()[n(t).closest("."+u).children().index(t)+i];for(this.overflowAnchor&&t===this.overflowAnchor[0]&&i===-1&&(r=f[f.length-1]),e===h&&(r=!this.overflowAnchor||this.overflowAnchor&&n(this.overflowAnchor).css("visibility")==="hidden"?f[c]:this.overflowAnchor);!n(r).is(":kendoFocusable");){if(r=i===-1&&n(r).closest("."+u).length?n(r).children(":not(label, div)").last():n(r).children(":not(label, div)").first(),!r.length&&(o=o+i,r=f[e+o],!r))return this.overflowAnchor;this._preventNextFocus=n(r).closest("."+u).length?!1:!0}return r},_getPrevFocusable:function(t){if(t.is("html"))return t;var r,i,u=t.prevAll();return u.each(function(){return(i=n(this),i.is(":kendoFocusable"))?(r=i,!1):i.find(":kendoFocusable").length>0?(r=i.find(":kendoFocusable").last(),!1):void 0}),r?r:this._getPrevFocusable(t.parent())},_toggle:function(t){var i=n(t.target).closest("."+h).data("splitButton"),r;(t.preventDefault(),i.options.enable)&&(r=i.popup.element.is(":visible")?this.trigger(ri,{target:i.element}):this.trigger(ii,{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(t){var i=0;return this.element.children(":visible:not('."+c+"')").each(function(){var r=n(this);r.css("visibility")!="hidden"&&(t==null||r.attr("id")!=t)&&(i+=tt(n(this),!0))}),Math.ceil(i)},_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('."+c+"')").not(":has(.dsi-toolbar-split-collapse)"),t=0;t<i.length;t++)if(r=i.eq(t),n<this._childrenWidth()||!this._showItem(r,n))break},_hideItem:function(t){t.hide();this.popup&&this.popup.container.find(">li[data-uid='"+t.data("uid")+"']").removeClass(o);var i=n("#"+t.attr("id")+"_split_wrapper");i.length==1&&i.show()},_showItem:function(t,i){var r,u;return t.find(".dsi-toolbar-split-collapse").length>0?!0:(r=null,t.hasClass("dsi-toolbar-split-expand")&&(r=t.attr("id")+"_split_wrapper"),t.length&&i>this._childrenWidth(r)+t.outerWidth(!0))?(t.show(),this.popup&&this.popup.container.find(">li[data-uid='"+t.data("uid")+"']").addClass(o),u=n("#"+t.attr("id")+"_split_wrapper"),u.length==1&&u.hide(),!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(gt+" "+ni);i.first().add(r.first()).addClass(gt);i.last().add(r.last()).addClass(ni)}});i.ui.plugin(ai)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.mediaplayer",["kendo.slider","kendo.toolbar","kendo.dropdownlist","kendo.tooltip"],n)}(function(){return function(n,t){var u=window.kendo,p="end",w="pause",b="play",k="ready",et="timeChange",a="volumeChange",o="k-i-full-screen",s="k-i-full-screen-exit",ot="k-i-volume-off",st="k-i-volume-down",ht="k-i-volume-up",ct="k-mediaplayer-quality",c="k-i-play",d="k-i-pause",g="k-mediaplayer-titlebar",nt="k-mediaplayer-toolbar",tt="k-mediaplayer-seekbar",lt="k-mediaplayer-volume",h="k-mediaplayer-media",at="k-mediaplayer-overlay",v="k-mediaplayer-yt",r=".",l=u.ui,e=".kendoMediaPlayer",it=new Date(1970,0,1),rt=it.getTimezoneOffset()*60,y=u.ui.Widget,ut=n.isArray,vt={shortTime:"mm:ss",longTime:"HH:mm:ss"},yt=u.template,i=n.proxy,ft=u.keys,f={htmlPlayer:"<video class='"+h+"'> <\/video>",titleBar:yt("<div class='"+g+"' role='heading'><span class='k-title'>Video Title<\/span><\/div>"),toolBar:"<div class='k-mediaplayer-toolbar-wrap'><div class='"+nt+"'><\/div><\/div>",youtubePlayer:"<div class='"+v+"'> <\/div>",toolBarTime:"<span class='k-mediaplayer-currenttime'>00:00:00<\/span> / <span class='k-mediaplayer-duration'>00:00:00<\/span>",slider:"<input class='"+tt+"' value='0' title='seekbar' />",volumeSlider:"<input class='"+lt+"' title='volume'/>",qualityDropDown:"<input class='"+ct+"' title='video quality' />",toolTip:"#= kendo.toString(new Date(value), 'HH:mm:ss') #"},pt=y.extend({init:function(t,i){this.wrapper=n(t);y.fn.init.call(this,t,i);this.wrapper.addClass("k-mediaplayer k-widget");i=this.options;this._currentIndex=0;this._createTitlebar();this._createToolbar();this._createDropDown();this._createSlider();this._createVolumeSlider();this._timers={};this._aria();this._navigatable();i.media&&this.media(this.options.media);u.notify(this)},events:[p,w,b,k,et,a],options:{name:"MediaPlayer",autoPlay:!1,autoRepeat:!1,volume:100,fullScreen:!1,mute:!1,navigatable:!1,forwardSeek:!0,media:null,messages:{pause:"Pause",play:"Play",mute:"Mute",unmute:"Unmute",quality:"Quality",fullscreen:"Full Screen"}},_msToTime:function(n){var t=new Date(it.getTime());return t.setSeconds(n),t},_timeToSec:function(n){var t=new Date(n).getTime();return t/1e3},_createTitlebar:function(){this._titleBar=this.wrapper.find(r+g);this._titleBar.length===0&&(this.wrapper.append(f.titleBar),this._titleBar=this.wrapper.find(r+g))},_createSlider:function(){var n=this.wrapper.find(r+tt);this._slider||(this._sliderDragChangeHandler=i(this._sliderDragChange,this),this._sliderDraggingHandler=i(this._sliderDragging,this),n=this.wrapper.find(r+tt),this._slider=new l.Slider(n[0],{smallStep:1e3,tickPlacement:"none",showButtons:!1,change:this._sliderDragChangeHandler,slide:this._sliderDraggingHandler,tooltip:{template:f.toolTip},dragHandleTitle:""}))},_createVolumeSlider:function(){var n=this.wrapper.find(r+lt);this._volumeSlider||(this._volumeDraggingHandler=i(this._volumeDragging,this),this._volumeChangeHandler=i(this._volumeChange,this),n.width(87),this._volumeSlider=new l.Slider(n[0],{smallStep:1,min:0,max:100,value:this.options.volume,slide:this._volumeDraggingHandler,change:this._volumeChangeHandler,tickPlacement:"none",showButtons:!1,tooltip:{enabled:!1},dragHandleTitle:""}))},_resetTime:function(){this._youTubeVideo?this._ytmedia.seekTo(0,!0):this._media.currentTime=0;this._mediaTimeUpdate();n.grep(this._toolBar.options.items,function(n){return!!n.template}).template=f.toolBarTime},_currentUrl:function(){var n=this.media();return ut(n.source)?n.source[this._currentIndex].url:n.source},_isYouTubeUrl:function(){return!!this._currentUrl().match("youtube.com/|youtu.be/")},_setPlayerUrl:function(){var t=this._youTubeVideo,n;this.stop();this._youTubeVideo=this._isYouTubeUrl();t!==this._youTubeVideo&&(this.wrapper.find(r+v).toggle(),this.wrapper.find(r+h).toggle());n=this._media||this._ytmedia;this._initializePlayer();n&&(this.mute(this.mute()),this.volume(this.volume()));this._youTubeVideo?this._ytmedia&&(this._videoOverlay&&this._videoOverlay.hide(),this.options.autoPlay?(this._ytmedia.loadVideoById(this._getMediaId()),this._playStateToggle(!0)):(this._ytmedia.cueVideoById(this._getMediaId()),this._playStateToggle(!0))):(this._videoOverlay.show(),this.wrapper.find(r+h+" > source").remove(),this.wrapper.find(r+h).attr("src",this._currentUrl()),this.options.autoPlay&&this.play())},_createToolbar:function(){var t=this.wrapper.find(r+nt);t.length===0&&(this._toolbarClickHandler=i(this._toolbarClick,this),this.wrapper.append(f.toolBar),t=this.wrapper.find(r+nt),t.width(this.wrapper.find(r+h).width()),this._toolBar=new l.ToolBar(t,{click:this._toolbarClickHandler,resizable:!1,items:[{type:"button",attributes:{"class":"k-play-button"},icon:"play"},{template:f.toolBarTime,attributes:{"class":"k-mediaplayer-currenttime-wrap"}},{type:"separator",attributes:{"class":"k-toolbar-spacer"}},{type:"button",attributes:{"class":"k-volume-button"},icon:"volume-up"},{template:f.volumeSlider,attributes:{"class":"k-mediaplayer-volume-wrap"}},{template:f.qualityDropDown,attributes:{"class":"k-mediaplayer-quality-wrap"}},{type:"button",attributes:{"class":"k-fullscreen-button"},icon:"full-screen"}]}),this._toolBar.wrapper.off("keydown"),t.before(f.slider),this._volumeButton=t.find(".k-volume-button"),this._fullscreenButton=t.find(".k-fullscreen-button"),this._volumeButton.attr("title",this.options.mute?this.options.messages.unmute:this.options.messages.mute),this._volumeButton.attr("aria-label",this.options.mute?this.options.messages.unmute:this.options.messages.mute),this._fullscreenButton.attr("title",this.options.messages.fullscreen),this._fullscreenButton.attr("aria-label",this.options.messages.fullscreen),t.width("auto"),this._currentTimeElement=t.find(".k-mediaplayer-currenttime"),this._durationElement=t.find(".k-mediaplayer-duration"),this._playButton=t.find(".k-play-button"),this._playButtonSpan=this._playButton.find(".k-i-play"),this.options.autoPlay&&this._playStateToggle(!0),n([this._volumeButton[0],t.find(".k-mediaplayer-volume-wrap")[0],t.find(".k-mediaplayer-quality-wrap")[0],this._fullscreenButton[0]]).wrapAll("<div class='k-align-right' />"),t.find(".k-button").addClass("k-bare"))},_createDropDown:function(){var t=this.wrapper.find(r+ct),n=this.media();typeof t.data("kendoDropDownList")=="undefined"&&(this._dropDownSelectHandler=i(this._dropDownSelect,this),this._dropDown=new l.DropDownList(t,{dataTextField:"quality",dataValueField:"url",popup:{position:"bottom",origin:"top",appendTo:this.wrapper},animation:{open:{effects:"slideIn:up",duration:1}},select:this._dropDownSelectHandler}),n&&ut(n.source)&&(this._dropDown.setDataSource(n.source),this._dropDown.select(0)),this._dropDown.wrapper.addClass("k-button k-bare"),this._dropDown.wrapper.attr("title",this.options.messages.quality).hide(),this._dropDown.wrapper.find("span.k-i-arrow-60-down").removeClass("k-i-arrow-60-down").addClass("k-icon k-i-hd"),this._dropDown.list.addClass("k-quality-list"))},_dropDownSelect:function(n){this._currentIndex!==n.item.index()&&(this._currentIndex=n.item.index(),this._setPlayerUrl())},_toolbarClick:function(t){var i=n(t.target).children().first(),u=i.hasClass(c),r;this.media()&&((i.hasClass(c)||i.hasClass(d))&&(u?this.play():this.pause()),(i.hasClass(o)||i.hasClass(s))&&(this._isInFullScreen?(i.removeClass(s).addClass(o),this.fullScreen(!1)):(i.removeClass(o).addClass(s),this.fullScreen(!0))),(i.hasClass(ot)||i.hasClass(st)||i.hasClass(ht))&&(r=this.mute(),this.mute(!r)))},_sliderDragging:function(){this.media()&&(this._isDragging=!0)},_sliderDragChange:function(n){var t=this,i=n.sender,r=rt*1e3;this.media()&&(t._sliderChangeFired=!0,t._isDragging=!1,!this.options.forwardSeek&&i.value()>this._seekBarLastPosition?setTimeout(function(){i.value(t._seekBarLastPosition)},1):this._youTubeVideo?t._ytmedia.seekTo(t._timeToSec(n.value-r)):t._media.currentTime=t._timeToSec(n.value-r),t.trigger(et),t._preventPlay=!0)},_changeVolumeButtonImage:function(n){var t=this._volumeButton,r=t.find("span"),i=r.attr("class");i=i.substring(0,i.lastIndexOf(" "));n===0?(r.attr("class",i+" "+ot),t.attr("title",this.options.messages.unmute),t.attr("aria-label",this.options.messages.unmute)):n>0&&n<51?(r.attr("class",i+" "+st),t.attr("title",this.options.messages.mute),t.attr("aria-label",this.options.messages.mute)):(r.attr("class",i+" "+ht),t.attr("title",this.options.messages.mute),t.attr("aria-label",this.options.messages.mute))},_volumeDragging:function(n){this.media()&&(this.volume(n.value),this._changeVolumeButtonImage(n.value),this.trigger(a))},_volumeChange:function(n){this.media()&&(this.volume(n.value),this._changeVolumeButtonImage(n.value),this.trigger(a))},_mediaTimeUpdate:function(){var n=this._youTubeVideo?this._ytmedia.getCurrentTime():this._media.currentTime,t=this._msToTime(n);return this._currentTimeElement.text(u.toString(t,this._timeFormat)),this._isDragging||(this._seekBarLastPosition=(n+rt)*1e3,this._slider.value(this._seekBarLastPosition)),this.isPlaying()},_playStateToggle:function(n){typeof n=="undefined"&&(n=this._playButtonSpan.is(r+c));n?(this._playButtonSpan.removeClass(c).addClass(d),this._playButton.attr("title",this.options.messages.pause),this._playButton.attr("aria-label",this.options.messages.pause)):(this._playButtonSpan.removeClass(d).addClass(c),this._playButton.attr("title",this.options.messages.play),this._playButton.attr("aria-label",this.options.messages.play))},_mediaEnded:function(){this._playStateToggle(!1);this._currentTimeElement.text(u.toString(this._msToTime(0),this._timeFormat));this._slider.value((0+rt)*1e3);this.trigger(p)},_mediaPlay:function(){this.trigger(b)},_mediaReady:function(){this.trigger(k)},_mediaDurationChange:function(){var n=this._msToTime(this._youTubeVideo?this._ytmedia.getDuration():this._media.duration);this._timeFormat=n.getHours()===0?vt.shortTime:vt.longTime;this._durationElement.text(u.toString(n,this._timeFormat));this._slider.setOptions({min:it.getTime(),max:n.getTime()});this._isFirstRun||(this._resetTime(),this._isFirstRun=!0)},_createYoutubePlayer:function(){this._mediaTimeUpdateHandler=i(this._mediaTimeUpdate,this);this._mediaDurationChangeHandler=i(this._mediaDurationChange,this);this.wrapper.prepend(f.youtubePlayer);this._ytPlayer=this.wrapper.find(r+v)[0];n(this._ytPlayer).css({width:this.wrapper.width(),height:this.wrapper.height()});window.YT&&window.YT.Player?this._configurePlayer():(window.onYouTubeIframeAPIReadyRegister||(window.onYouTubeIframeAPIReadyRegister=[],n.getScript("https://www.youtube.com/iframe_api"),window.onYouTubeIframeAPIReady=function(){if(window.onYouTubeIframeAPIReadyRegister)for(var n=0;n<window.onYouTubeIframeAPIReadyRegister.length;n++)window.onYouTubeIframeAPIReadyRegister[n]._youtubeApiReady();window.onYouTubeIframeAPIReadyRegister.length=0;window.onYouTubeIframeAPIReadyRegister=t}),window.onYouTubeIframeAPIReadyRegister[window.onYouTubeIframeAPIReadyRegister.length]=this)},_poll:function(n,t,i,r){var u=this;return u._timers[n]!==null&&clearTimeout(u._timers[n]),u._timers[n]=setTimeout(function(r){return function f(){t.call(r)&&(u._timers[n]=setTimeout(f,i))}}(r),i),u._timers[n]},_youtubeApiReady:function(){this._configurePlayer()},_configurePlayer:function(){var n={autoplay:+this.options.autoPlay,wmode:"transparent",controls:0,rel:0,showinfo:0},t;this._onYouTubePlayerReady=i(this._onYouTubePlayerReady,this);window.onYouTubePlayerReady=this._onYouTubePlayerReady;this._onPlayerStateChangeHandler=i(this._onPlayerStateChange,this);window.onPlayerStateChange=this._onPlayerStateChange;t=new window.YT.Player(this.wrapper.find(r+v)[0],{height:this.wrapper.height(),width:this.wrapper.width(),videoId:this._getMediaId(),playerVars:n,events:{onReady:this._onYouTubePlayerReady,onStateChange:this._onPlayerStateChangeHandler}})},_onYouTubePlayerReady:function(n){this._ytmedia=n.target;this._ytmedia.getIframe().style.width="100%";this._ytmedia.getIframe().style.height="100%";this._youTubeVideo=!0;this._mediaDurationChangeHandler();this.options.autoPlay?(this._playStateToggle(!0),this._ytmedia.loadVideoById(this._getMediaId())):this._ytmedia.cueVideoById(this._getMediaId());this.options.mute&&this.mute(!0);this.trigger(k)},_updateTitle:function(){this.titlebar().text(this.media().title||this.media().source)},_onPlayerStateChange:function(n){n.data===0?(this._slider.value(0),this._paused=!1,this._playStateToggle(!0),this.trigger(p),this.options.autoRepeat&&this.play()):n.data===1?(this._mediaDurationChange(),this._ytmedia.setVolume(this.volume()),this._sliderChangeFired?this._sliderChangeFired=!1:this._uiDisplay(!1),this.trigger(b),this._playStateToggle(!0),this._poll("progress",this._mediaTimeUpdate,500,this),this._paused=!1):n.data===2&&(this._paused||(this._uiDisplay(!0),this._playStateToggle(!1),this.trigger(w),this._paused=!0))},_getMediaId:function(){var n=this._currentUrl(),t=n.match(/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/);return t&&t[7].length===11&&(n=t[7]),n},_mouseClick:function(){this.isPaused()?this.play():this.pause()},_initializePlayer:function(){if(!this._mouseMoveHandler){this._mouseMoveHandler=i(this._mouseMove,this);this._mouseInHandler=i(this._mouseIn,this);this._mouseOutHandler=i(this._mouseOut,this);n(this.wrapper).on("mouseenter"+e,this._mouseInHandler).on("mouseleave"+e,this._mouseOutHandler).on("mousemove"+e,this._mouseMoveHandler)}!this._ytmedia&&this._youTubeVideo?this._createYoutubePlayer():this._media||this._youTubeVideo||this._createHtmlPlayer()},_createHtmlPlayer:function(){this._videoOverlay||(this._mouseClickHanlder=i(this._mouseClick,this),this.wrapper.append("<div class='"+at+"'><\/div>"),this._videoOverlay=this.wrapper.find(".k-mediaplayer-overlay").on("click"+e,this._mouseClickHanlder));this._mediaTimeUpdateHandler=i(this._mediaTimeUpdate,this);this._mediaDurationChangeHandler=i(this._mediaDurationChange,this);this._mediaEndedHandler=i(this._mediaEnded,this);this._mediaCanPlayHandler=i(this._mediaReady,this);this._mediaPlayHandler=i(this._mediaPlay,this);this._videoOverlay.after(f.htmlPlayer);this._media=this.wrapper.find(r+h)[0];n(this._media).css({width:"100%",height:"100%"});this.options.mute&&this.mute(!0);this._media.ontimeupdate=this._mediaTimeUpdateHandler;this._media.ondurationchange=this._mediaDurationChangeHandler;this._media.oncanplay=this._mediaCanPlayHandler;this._media.onplay=this._mediaPlayHandler;this._media.onended=this._mediaEndedHandler;this._media.loop=this.options.autoRepeat},_mouseIn:function(){this._uiDisplay(!0)},_mouseOut:function(){this._poll("mouseIdle",this._mouseIdle,3e3,this)},_mouseIdle:function(){return this._uiDisplay(!1),!1},_mouseMove:function(){this._titleBar.is(":animated")||this._toolBar.element.is(":animated")||this._slider.wrapper.is(":animated")||this._uiDisplay(!0);this._poll("mouseIdle",this._mouseIdle,3e3,this)},_uiDisplay:function(n){var t="slow",i=this._titleBar.add(this._toolBar.element.parent());n?i.fadeIn(t):(i.fadeOut(t),this.options.navigatable&&this.wrapper.focus())},setOptions:function(n){y.fn.setOptions.call(this,n)},destroy:function(){y.fn.destroy.call(this);this.isPaused()||this.pause();this.element.off(e);this.element.find(r+at).off(e);this._timers=null;this._mouseMoveHandler=null;this._mouseOutHandler=null;this._mouseInHandler=null;this._mouseClickHanlder=null;this._keyDownHandler=null;this._fullscreenHandler=null;this._toolbarClickHandler=null;this._sliderDragChangeHandler=null;this._sliderDraggingHandler=null;this._volumeDraggingHandler=null;this._volumeChangeHandler=null;this._youtubeApiReadyHandler=null;this._onYouTubePlayerReady=null;this._onPlayerStateChangeHandler=null;this._dropDownSelectHandler=null;this._youTubeVideo?this._ytmedia.destroy():(this._media.ontimeupdate=this._mediaTimeUpdateHandler=null,this._media.ondurationchange=this._mediaDurationChangeHandler=null,this._media.oncanplay=this._mediaCanPlayHandler=null,this._media.onplay=this._mediaPlayHandler=null,this._media.onended=this._mediaEndedHandler=null,this._media.src="",this._media.remove());this._mouseMoveTimer=null;clearTimeout(this._mouseMoveTimer);u.destroy(this.element)},seek:function(n){if(typeof n=="undefined")return 1e3*this._youTubeVideo?this._ytmedia.getCurrentTime():this._media?this._media.currentTime:0;var t=n/1e3;return this._youTubeVideo?t+3>=this._ytmedia.getDuration()|0?this._ytmedia.seekTo(this._ytmedia.getDuration()-3|0,!0):this._ytmedia.seekTo(t,!0):this._media.currentTime=t,this},play:function(){return this._youTubeVideo?this._ytmedia.playVideo():(u.support.mobileOS&&this._uiDisplay(!1),this._media.play()),this._paused=!1,this._playStateToggle(!0),this},stop:function(){return this._youTubeVideo&&this._ytmedia?this._ytmedia.stopVideo():this._media&&!this._youTubeVideo&&(u.support.mobileOS&&this._uiDisplay(!0),this._media.pause(),this._media.currentTime=0),this._paused=!0,this._playStateToggle(!1),this},pause:function(){return this._youTubeVideo?this._ytmedia.pauseVideo():(u.support.mobileOS&&this._uiDisplay(!0),this._media.pause()),this._paused=!0,this._playStateToggle(!1),this.trigger(w),this},toolbar:function(){return this._toolBar},dropdown:function(){return this._dropDown},titlebar:function(){return this._titleBar},fullScreen:function(n){if(typeof n=="undefined")return this._isInFullScreen||!1;var t=this.element.get(0);n?(this.element.addClass("k-mediaplayer-fullscreen"),t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.msRequestFullscreen&&t.msRequestFullscreen(),this._isInFullScreen=!0):(document.cancelFullscreen?document.cancelFullscreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msCancelFullscreen?document.msCancelFullscreen():document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen&&document.msExitFullscreen(),this.element.removeClass("k-mediaplayer-fullscreen"),this._isInFullScreen=!1);this._slider.resize()},volume:function(n){if(typeof n=="undefined")return typeof this._volume!="undefined"?this._volume:this._volume=this.options.volume;this._volume=n;this.mute(n<=0);this._youTubeVideo?this._ytmedia.setVolume(this._volume):this._media.volume=this._volume/100;this._volumeSlider.value(n)},mute:function(n){var t=this._youTubeVideo?this._ytmedia&&this._ytmedia.isMuted():this._media&&this._media.muted;if(typeof n=="undefined"||n===t)return t;this._youTubeVideo?n?this._ytmedia.mute():this._ytmedia.unMute():this._media.muted=n;n?this._volumeSlider.value(0):this._volumeSlider.value(this._media&&this._media.volume*100||this._ytmedia&&this._ytmedia.getVolume());this.trigger(a);this._changeVolumeButtonImage(this._volumeSlider.value())},isEnded:function(){return this._youTubeVideo?this._ytmedia.getPlayerState()===0:this._media.ended},media:function(n){var t=this.dropdown();if(typeof n=="undefined")return typeof this._mediaData!="undefined"?this._mediaData:this._mediaData=this.options.media;ut(n.source)?(t.setDataSource(n.source),t.wrapper.show()):t.wrapper.hide();this._mediaData=n;this._updateTitle();this._setPlayerUrl()},isPaused:function(){return this._paused},isPlaying:function(){return!this.isEnded()&&!this._paused},_aria:function(){this.wrapper.attr("role","region")},_navigatable:function(){this._fullscreenHandler=i(this._fullscreen,this);n(document).on("webkitfullscreenchange mozfullscreenchange fullscreenchange"+e,this._fullscreenHandler);if(this.options.navigatable){this.wrapper.attr("tabIndex",0);this._keyDownHandler=i(this._keyDown,this);this.wrapper.on("keydown"+e,this._keyDownHandler)}},_fullscreen:function(){var n=document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen;this._uiDisplay(!0);this._slider.resize();n||(this.wrapper.find('span[class*="k-i-fullscreen"]').removeClass(s).addClass(o),this.fullScreen(!1))},_keyDown:function(n){var t,i;n.preventDefault();t=this.wrapper.find('span[class*="k-i-fullscreen"]');n.keyCode===ft.SPACEBAR?this.isPlaying()?this.pause():this.play():n.keyCode!==ft.ENTER||this._isInFullScreen?n.keyCode===77?(i=this.mute(),this.mute(!i)):n.keyCode===ft.ESC&&this._isInFullScreen&&(t.removeClass(s).addClass(o),this.fullScreen(!1)):(t.removeClass(o).addClass(s),this.fullScreen(!0))},_error:function(){},_progress:function(){}});l.plugin(pt)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.pivotgrid",["kendo.dom","kendo.data"],n)}(function(){return function(n,t){function wt(n){var i=typeof n=="string"?[{name:n}]:n,r=h.call(i)==="[object Array]"?i:i!==t?[i]:[];return ni(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=h.call(i)==="[object Array]"?i:i!==t?[i]:[];return ni(r,function(n){return typeof n=="string"?{name:[n],expand:!1}:{name:h.call(n.name)==="[object Array]"?n.name.slice():[n.name],expand:n.expand}})}function si(n){return n.indexOf(" ")!==-1&&(n='["'+n+'"]'),n}function bt(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++)bt(n,t,s[o],u);bt(n,t,r,u+1)}}function kr(t){var i={},r,u;t.length&&bt(i,t[0]);r=[];for(u in i)r.push({name:n.parseJSON(u),expand:i[u]});return r}function dr(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(c(n[u]).indexOf(r[i].hierarchy)===0){e=!0;break}e||n.push({name:[r[i].name],expand:!1})}}function gr(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 nu(n,t,i){var u,r;return n=n||{},dr(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=gr(r.tuple))),t}function tu(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 ot(n){return n[n.length]={value:"",fmtValue:"",ordinal:n.length},n}function ci(n,t,i){if(n.tuples.length<s(t.tuples,i))return t}function uu(n,t,i,r,u){for(var f,o,h=n.length,l=s(t,r),c=r.length||1,e=0;e<i;e++)for(f=0;f<h;f++)o=li(n[f],t)*c,o+=f%c,u[e*h+f].ordinal=e*l+o}function fu(n,t,i,r,u){for(var e,o,h=n.length,s=r.length||1,f=0;f<h;f++)for(o=li(n[f],t),o*=s,o+=f%s,e=0;e<i;e++)u[f*i+e].ordinal=o*i+e}function li(n,t){return tt(t,n).index}function s(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 st(n){return n||(n={tuples:[]}),n.tuples||(n.tuples=[]),n}function ai(n,t,i){if(!n)return 0;for(var e=Math.max(i.length,1),u=n.members.slice(0,t),r=u.shift(),f=e;r;)r.name===y?f+=e-1:r.children?[].push.apply(u,r.children):(f++,[].push.apply(u,r.members)),r=u.shift();return f}function vi(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 eu(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&&c(n[i])===c(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],eu(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 ou(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 su(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 hu(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 cu(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 yi(n,t){var r,i,u;if(n.length<1)return[];var e=[],o={},f=hu(n[0],t);for(r=0;r<n.length;r++)i=n[r],i.dataIndex=r,cu(i,f),u=su(i,o),u?f<0||!u.measure?u.children.push(i):u.children.push(i.members[f].children[0]):e.push(i),ou(i.members,o);return e}function lu(n,t){if(!n||!n.length)return t;for(var e=[],o=pi(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 au(n,t){if(!n||!n.length)return t;for(var o=[],s=pi(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 pi(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 wi(n){var t=n.split(".");return t.length>2?t[0]+"."+t[1]:n}function bi(n,t){var u=n.length-1,i=n[u],r;return r=vu(t,i),r&&r.dir?i="ORDER("+i+".Children,"+r.field+".CurrentMember.MEMBER_CAPTION,"+r.dir+")":i+=".Children",n[u]=i,n}function vu(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 ki(n){var t="CROSSJOIN({",i;return n.length>2?(i=n.pop(),t+=ki(n)):(t+=n.shift(),i=n.pop()),t+="},{",t+=i,t+"})"}function di(n,t){var i=n.slice(0);return t.length>1&&i.push("{"+ht(t).join(",")+"}"),ki(i)}function ht(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 c(n){return n=n.name||n,h.call(n)==="[object Array]"&&(n=n[n.length-1]),n}function gi(n){for(var r=n.length,i=[],t=0;t<r;t++)i.push(n[t].name[0]);return i}function nr(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=wi(t[i]),r.indexOf(f)!==-1){t[i]=r;break}return{names:t,expandedIdx:i,uniquePath:t.slice(0,i+1).join("")}}function tr(n){for(var r=[],s=[],u=[],t,f,c,e=0,a=n.length,i,l,o;e<a;e++)if(t=n[e],i=t.name,o=!1,h.call(i)!=="[object Array]"&&(t.name=i=[i]),i.length>1)s.push(t);else{for(l=wi(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(s),{root:u,expanded:r}}function ir(n,t,i){var s="";n=n||[];var r=tr(n),l=r.root,f=gi(l),h=[];r=r.expanded;var c=r.length,u=0,e,o=[];if(f.length>1||t.length>1){for(h.push(di(f,t));u<c;u++)e=bi(r[u].name,i),o=nr(e,f).names,h.push(di(o,t));s+=h.join(",")}else{for(;u<c;u++)e=bi(r[u].name,i),o.push(e[0]);s+=f.concat(o).join(",")}return s}function yu(n){var t="",u=n.value,f=n.field,r=n.operator;return r=="in"?(t+="{",t+=u,t+="}"):(t+=r=="neq"||r=="doesnotcontain"?"-":"",t+="Filter(",t+=f+".MEMBERS",t+=i.format(rr[r],f,u),t+=")"),t}function pu(n,t){for(var u="",i,f=n.filters,e=f.length,r=e-1;r>=0;r--)i="SELECT (",i+=yu(f[r]),i+=") ON 0",r==e-1?(i+=" FROM ["+t+"]",u=i):u=i+" FROM ( "+u+" )";return u}function ur(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=h.call(n);return t!=="[object Array]"?[n]:n}function er(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,at=i.ui,b=i.Class,a=at.Widget,k=i.data.DataSource,dt=i._outerWidth,gt=i._outerHeight,h={}.toString,e=function(n){return n},ni=n.map,u=n.extend,vt=i.isFunction,v="change",ti="error",y="Measures",ii="progress",yt="stateReset",d="auto",ut="<div/>",g=".kendoPivotGrid",p="__row_total__",ri="dataBinding",ui="dataBound",fi="expandMember",ei="collapseMember",ft="k-i-collapse",pt="k-i-expand",oi="<span>#: data.member.caption || data.member.name #<\/span>",ar='<span class="k-icon k-i-kpi-status-#=data.dataItem.value > 0 ? "open" : data.dataItem.value < 0 ? "deny" : "hold"#" title="#:data.dataItem.value#"><\/span>',vr='<span class="k-icon k-i-kpi-trend-#=data.dataItem.value > 0 ? "increase" : data.dataItem.value < 0 ? "decrease" : "equal"#" title="#:data.dataItem.value#"><\/span>',yr='#= data.dataItem ? kendo.htmlEncode(data.dataItem.fmtValue || data.dataItem.value) || "&nbsp;" : "&nbsp;" #',pr='<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>',wr="rows",br="columns",iu={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}},hi=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={},h.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=iu[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:tu(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(si(r),!0);return u},_parseDescriptors:function(n){for(var i=tr(n),r=gi(i.root),u=i.expanded,f=[],t=0;t<u.length;t++)f.push(nr(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}}}),ru=b.extend({init:function(n,t){this.transport=t;this.options=t.options||{};this.transport.discover||vt(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,s="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 hi(r));k.fn.init.call(this,u(!0,{},{schema:f},t));this.transport=new ru(this.options.transport||{},this.transport);this._columns=o(this.options.columns);this._rows=o(this.options.rows);i=this.options.measures||[];h.call(i)==="[object Object]"&&(s=i.axis||"columns",i=i.values||[]);this._measures=wt(i);this._measuresAxis=s;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,o=this.options.schema.data,a=vt(o)?o:i.getter(o,!0),h=this.options.data&&a(this.options.data)||this._rawData||[],e=[],c,f,s=0,l={};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(c=i.getter(si(u),!0);s<h.length;s++)f=c(h[s]),(f||f===0)&&!l[f]&&(l[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(),sort:this.sort(),filter:this.filter()})},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(),sort:this.sort(),filter:this.filter()})},measures:function(n){if(n===t)return this._measures;this._skipNormalize+=1;this._clearAxesData=!0;this.query({columns:this.columnsAxisDescriptors(),rows:this.rowsAxisDescriptors(),measures:wt(n),sort:this.sort(),filter:this.filter()})},measuresAxis:function(){return this._measuresAxis||"columns"},_expandPath:function(n,t){var f=t==="columns"?"columns":"rows",e=t==="columns"?"rows":"columns",i=o(n),h=c(i[i.length-1]),r,s,u;for(this._lastExpanded=f,i=nu(this.axes()[f],i,this.measures()),r=0;r<i.length;r++)if(s=c(i[r]),s===h){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=kr(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(v,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=wt(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,c;this.cubeBuilder&&(f=this.cubeBuilder.process(n,this._requestData),n=f.data,t=f.axes);var l,a,u,i,r,e,o=this.columns(),h=this.rows(),v=t.columns&&t.columns.tuples;return!o.length&&h.length&&v&&(this._rowMeasures().length||!this.measures().length)&&(t={columns:{},rows:t.columns}),o.length||h.length||this.measuresAxis()!=="rows"||!v||(t={columns:{},rows:t.columns}),this._axes={columns:st(this._axes.columns),rows:st(this._axes.rows)},t={columns:st(t.columns),rows:st(t.rows)},l=this._normalizeTuples(t.columns.tuples,this._axes.columns.tuples,o,this._columnMeasures()),a=this._normalizeTuples(t.rows.tuples,this._axes.rows.tuples,h,this._rowMeasures()),this._skipNormalize>0&&(this._skipNormalize-=1),this.cubeBuilder||(n=this._normalizeData({columnsLength:t.columns.tuples.length,rowsLength:t.rows.tuples.length,columnIndexes:l,rowIndexes:a,data:n})),this._lastExpanded=="rows"?(u=t.columns.tuples,r=this._columnMeasures(),i=ci(t.columns,this._axes.columns,r),i&&(e="columns",t.columns=i,uu(u,i.tuples,t.rows.tuples.length,r,n),this.cubeBuilder||(n=this._normalizeData({columnsLength:s(t.columns.tuples,r),rowsLength:t.rows.tuples.length,data:n})))):this._lastExpanded=="columns"&&(u=t.rows.tuples,r=this._rowMeasures(),i=ci(t.rows,this._axes.rows,r),i&&(e="rows",t.rows=i,fu(u,i.tuples,t.columns.tuples.length,r,n),this.cubeBuilder||(n=this._normalizeData({columnsLength:s(t.rows.tuples,r),rowsLength:t.columns.tuples.length,data:n})))),this._lastExpanded=null,c=this._mergeAxes(t,n,e),this._axes=c.axes,c.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,h;if(t.length)return tt(t,n).tuple;for(u=n.members,o=!0,r=0,h=u.length;r<h;r++)if(f=u[r],s=Number(f.levelNum)||0,e=i[r],!(s===0||e&&f.name===c(e))){o=!1;break}return o},_mergeAxes:function(n,t,i){var e=this._columnMeasures(),f=this._rowMeasures(),r=this.axes(),c,u,p=s(r.rows.tuples,f),a=n.rows.tuples.length,v=s(r.columns.tuples,e),l=n.columns.tuples.length,o,h,y;return i=="columns"?(l=v,u=n.columns.tuples):(u=yi(n.columns.tuples,e),t=au(u,t)),o=vi(r.columns.tuples,u,e),i=="rows"?(a=s(n.rows.tuples,f),u=n.rows.tuples):(u=yi(n.rows.tuples,f),t=lu(u,t)),h=vi(r.rows.tuples,u,f),r.columns.tuples=o.tuples,r.rows.tuples=h.tuples,v!==s(r.columns.tuples,e)?(c=o.index+ai(o.parsedRoot,o.memberIndex,e),y=v+l,t=this._mergeColumnData(t,c,a,l,y)):p!==s(r.rows.tuples,f)&&(c=h.index+ai(h.parsedRoot,h.memberIndex,f),t=this._mergeRowData(t,c,a,l)),r.columns.tuples.length===0&&r.rows.tuples.length===0&&(t=[]),{axes:r,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||lr(c,h-1)!==lr(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}},_addMissingDataItems:function(n,i){while(i.rowIndexes[parseInt(n.length/i.columnsLength,10)]!==t)for(var r=0;r<i.columnsLength;r++)n=ot(n);while(i.columnIndexes[n.length%i.columnsLength]!==t)n=ot(n);return n},_normalizeOrdinals:function(n,t,i){var r=i.lastOrdinal;if(!t)return ot(n);if(t.ordinal-r>1)for(r+=1;r<t.ordinal&&n.length<i.length;)n=this._addMissingDataItems(ot(n),i),r+=1;return t.ordinal=n.length,n[n.length]=t,n},_normalizeData:function(n){var r=n.data,e=0,t,i=[],f,u;if(n.lastOrdinal=0,n.columnIndexes=n.columnIndexes||{},n.rowIndexes=n.rowIndexes||{},n.columnsLength=n.columnsLength||1,n.rowsLength=n.rowsLength||1,n.length=n.columnsLength*n.rowsLength,u=n.length,r.length===u)return r;while(i.length<u)t=r[e++],t&&(f=t.ordinal),i=this._normalizeOrdinals(this._addMissingDataItems(i,n),t,n),n.lastOrdinal=f;return i},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(yt));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}}),rr,hr,ct,kt;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)};rr={contains:', InStr({0}.CurrentMember.MEMBER_CAPTION,"{1}") > 0',doesnotcontain:', InStr({0}.CurrentMember.MEMBER_CAPTION,"{1}")',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:', {0}.CurrentMember.MEMBER_CAPTION = "{1}"'};var wu={schemaCubes:"MDSCHEMA_CUBES",schemaCatalogs:"DBSCHEMA_CATALOGS",schemaMeasures:"MDSCHEMA_MEASURES",schemaDimensions:"MDSCHEMA_DIMENSIONS",schemaHierarchies:"MDSCHEMA_HIERARCHIES",schemaLevels:"MDSCHEMA_LEVELS",schemaMembers:"MDSCHEMA_MEMBERS",schemaKPIs:"MDSCHEMA_KPIS"},bu={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+=ir(f,u?[]:i,e):i.length&&!u&&(t+=ht(i).join(",")),t+="} DIMENSION PROPERTIES CHILDREN_CARDINALITY, PARENT_UNIQUE_NAME ON COLUMNS",(r.length||u&&i.length>1)&&(t+=", NON EMPTY {",t+=r.length?ir(r,u?i:[],e):ht(i).join(","),t+="} DIMENSION PROPERTIES CHILDREN_CARDINALITY, PARENT_UNIQUE_NAME ON ROWS"),n.filter?(t+=" FROM ",t+="(",t+=pu(n.filter,n.connection.cube),t+=")"):t+=" FROM ["+n.connection.cube+"]",i.length==1&&f.length&&(t+=" WHERE ("+ht(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>"+(wu[t.command]||t.command)+"<\/RequestType>",i+="<Restrictions>"+ur("RestrictionList",t.restrictions,!0)+"<\/Restrictions>",t.connection&&t.connection.catalog&&(t.properties=n.extend({},{Catalog:t.connection.catalog},t.properties)),i+="<Properties>"+ur("PropertyList",t.properties)+"<\/Properties>",i+"<\/Discover><\/Body><\/Envelope>"}},fr=i.data.RemoteTransport.extend({init:function(n){var t=n;n=this.options=u(!0,{},this.options,n);i.data.RemoteTransport.call(this,n);vt(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 bu[t](n,t)}},discover:function(t){return n.ajax(this.setup(t,"discover"))}});var l={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)}},or=["axes","catalogs","cubes","dimensions","hierarchies","levels","measures"],sr=i.data.XmlDataReader.extend({init:function(n){i.data.XmlDataReader.call(this,n);this._extend(n)},_extend:function(n){for(var i=0,u=or.length,r,t;i<u;i++)r=or[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=er(r):t.columns=er(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,l.measures)},kpis:function(n){return this._mapSchema(n,l.kpis)},hierarchies:function(n){return this._mapSchema(n,l.hierarchies)},levels:function(n){return this._mapSchema(n,l.levels)},dimensions:function(n){return this._mapSchema(n,l.dimensions)},cubes:function(n){return this._mapSchema(n,l.cubes)},catalogs:function(n){return this._mapSchema(n,l.catalogs)},members:function(n){return this._mapSchema(n,l.members)}});u(!0,i.data,{PivotDataSource:nt,XmlaTransport:fr,XmlaDataReader:sr,PivotCubeBuilder:hi,transports:{xmla:fr},readers:{xmla:sr}});hr=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};ct=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=a.extend({init:function(t,r){var u=this;a.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(v,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-bare"><span class="k-icon k-i-close 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-i-close")?u.remove(f):u.options.sortable&&r[0]===t.currentTarget&&u.sort({field:f,dir:r.find(".k-i-sort-asc-sm")[0]?"desc":"asc"}))});(r.filterable||r.sortable)&&(u.fieldMenu=new at.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(v,this._refreshHandler);this.dataSource=this.options.dataSource=n;this.fieldMenu&&this.fieldMenu.setDataSource(n);n.first(v,this._refreshHandler);this.refresh()},_sortable:function(){var n=this;n.options.enabled&&(this.sortable=this.element.kendoSortable({connectWith:this.options.connectWith,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(c(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 r=this.dataSource[this.options.setting](),u=this._indexOf(n,r),i=this.dataSource.sort(),t=this.dataSource.filter();u>-1&&(t&&(t.filters=ct(t.filters,n),this.dataSource._filter.filters=t.filters,t.filters.length||(this.dataSource._filter=null)),i&&(i=ct(i,n),this.dataSource._sort=i),r.splice(u,1),this.dataSource[this.options.setting](r))},sort:function(n){var i=this.options.sortable,u=i===!0||i.allowUnsort,f=u&&n.dir==="asc",r=this.dataSource.sort()||[],t=ct(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(){a.fn.destroy.call(this);this.dataSource.unbind(v,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=hr(r,c(n)),i="";return t&&(i="k-i-sort-"+t.dir),i}});var lt=a.extend({init:function(r,u){var f=this,e,o;a.fn.init.call(f,r,u);f._dataSource();f._bindConfigurator();f._wrapper();f._createLayout();f._columnBuilder=e=new ku;f._rowBuilder=o=new du;f._contentBuilder=new gu;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?ei:fi,s.childrenLoaded=l.maxChildren>l.children,f.trigger(v,s))||(h.metadata[c].expanded=!r,u.toggleClass(ft,!r).toggleClass(pt,r),!r&&y?f.dataSource[a](s.path):f.refresh())});f._scrollable();f.options.autoBind&&f.dataSource.fetch();i.notify(f)},events:[ri,ui,fi,ei],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||oi,{useWithBlock:!!n});this._contentBuilder.dataTemplate=i.template(r||yr,{useWithBlock:!!r});this._contentBuilder.kpiStatusTemplate=i.template(u||ar,{useWithBlock:!!u});this._contentBuilder.kpiTrendTemplate=i.template(f||vr,{useWithBlock:!!f});this._rowBuilder.template=i.template(t||oi,{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){a.fn.setOptions.call(this,n);this._templates()},destroy:function(){a.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(v,t._refreshHandler).unbind(yt,t._stateResetHandler).unbind(ii,t._progressHandler).unbind(ti,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(v,t._refreshHandler).bind(ii,t._progressHandler).bind(yt,t._stateResetHandler).bind(ti,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}-sm"><\/span>',u+="#}#"),(r.filterable||e)&&(u+='<span class="k-icon k-i-more-vertical k-setting-fieldmenu"><\/span>'),this.options.reorderable&&(u+='<span class="k-icon k-i-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(pr),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(dt(this.measureFields),dt(this.rowFields));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-=gt(t.columnFields);n-=gt(t.columnsHeader);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,r=n._rowBuilder,o={},s={},u;n.trigger(ri,{action:"rebind"})||(t.measures=n._axisMeasures(br),r.measures=n._axisMeasures(wr),n.columnsHeaderTree.render(t.build(h)),n.rowsHeaderTree.render(r.build(c)),o={indexes:t._indexes,measures:t.measures,metadata:t.metadata},s={indexes:r._indexes,measures:r.measures,metadata:r.metadata},n.contentTree.render(n._contentBuilder.build(f.view(),o,s)),n._resize(),n.touchScroller?n.touchScroller.contentResized():(u=i.touchScroller(n.content),u&&u.movable&&(n.touchScroller=u,u.movable.bind("change",function(t){n.columnsHeader.scrollLeft(-t.sender.x);n.rowsHeader.scrollTop(-t.sender.y)}))),n._progress(!1),n.trigger(ui))},_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,cr=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},lr=function(n,t){for(var r="",i=0;i<=t;i++)r+=n.members[i].name;return r},ku=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=cr(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:pt)},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}}),du=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=cr(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:pt)},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}}),gu=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 i=this.rowIndexes,r=i.length,n=0,t;n<r;n++)t=i[n],t&&this.rows.push(this._buildRow(t))},_buildRow:function(n){for(var v=n.index*this.rowLength,l=this.columnIndexes,y=l.length,i,a=[],h=0,o,c,u,f,s,e;h<y;h++)(i=l[h],i!==t)&&(f={},i.children&&(f.className="k-alt"),u="",s=this.data[v+i.index],e=i.measure||n.measure,o={columnTuple:i.tuple,rowTuple:n.tuple,measure:e,dataItem:s},s.value!==""&&e&&e.type&&(e.type==="status"?u=this.kpiStatusTemplate(o):e.type==="trend"&&(u=this.kpiTrendTemplate(o))),u||(u=this.dataTemplate(o)),c=r("td",f,[w(u)]),c.value=s.value,a.push(c));return f={},n.children&&(f.className="k-grid-footer"),r("tr",f,a)}});at.plugin(lt);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=u.value),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))}});kt={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);r.toDataURLAsync().then(function(r){i.saveAs({dataURI:r,fileName:n.fileName||t.fileName,proxyURL:t.proxyURL,forceProxy:t.forceProxy})})}},this))}};i.PivotExcelMixin=kt;i.ooxml&&i.ooxml.Workbook&&kt.extend(lt.prototype);i.PDFMixin&&(i.PDFMixin.extend(lt.prototype),lt.fn._drawPDF=function(){return this._drawPDFShadow({width:this.wrapper.width()},{avoidLinks:this.options.pdf.avoidLinks})})}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.treeview.draganddrop",["kendo.data","kendo.draganddrop"],n)}(function(){return 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-arrow-60-right,span.k-icon.k-i-arrow-45-down-right";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(/(p|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-i-drag-and-drop' />").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-i-cancel":(f="k-i-insert-middle",a=c.itemFromTarget(e),o=a.item,o.length?(this._removeTouchHover(),v=t._outerHeight(o),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-i-plus":(d=o.position(),d.top+=s?0:v,this.dropHint.css(d)[s?"prependTo":"appendTo"](c.dropHintContainer(o)),s&&a.first&&(f="k-i-insert-up"),y&&a.last&&(f="k-i-insert-down"))):e[0]!=this.dropHint[0]&&(this._lastHover&&this._lastHover.removeClass(i),f=n.contains(this.element[0],w[0])?"k-i-cancel":"k-i-plus")):(f="k-i-cancel",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.indexOf("k-i-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-i-cancel",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),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.treeview",["kendo.data","kendo.treeview.draganddrop"],n)}(function(){return function(n,t){function ti(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 ft(n){return n.find("> div .k-checkbox-wrapper [type=checkbox]")}function ii(n){return function(t,i){i=i.closest(f);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 fi(t,i){for(var r;t&&t.nodeName.toLowerCase()!="ul";)r=t,t=t.nextSibling,r.nodeType==3&&(r.nodeValue=n.trim(r.nodeValue)),gt.test(r.className)?i.insertBefore(r,i.firstChild):i.appendChild(r)}function tt(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-wrapper' />").appendTo(i).append(e),r.length||(r=t.children("a").eq(0).addClass("k-in k-link"),r.length||(r=n("<span class='k-in' />")),r.appendTo(i),i.length&&fi(i[0].nextSibling,r[0])))}var i=window.kendo,v=i.ui,ri=i.data,y=n.extend,et=i.template,p=n.isArray,it=v.Widget,ot=ri.HierarchicalDataSource,u=n.proxy,o=i.keys,r=".kendoTreeView",rt="select",st="check",ht="navigate",d="change",ct="error",e="checked",h="indeterminate",lt="dragstart",at="drag",vt="drop",yt="dragend",pt="dataBound",wt="click",l="undefined",bt="k-state-hover",w="k-treeview",ui=":visible",f=".k-item",g="string",ut="aria-selected",kt="aria-disabled",a="k-state-disabled",dt,s,b,nt,gt,k={text:"dataTextField",url:"dataUrlField",spriteCssClass:"dataSpriteCssClassField",imageUrl:"dataImageUrlField"},ni=function(n){return typeof HTMLElement=="object"?n instanceof HTMLElement:n&&typeof n=="object"&&n.nodeType===1&&typeof n.nodeName===g};s=ti(".k-group");b=ti(".k-group,.k-content");nt=function(n){return n.children("div").children(".k-icon")};gt=/k-sprite/;dt=i.ui.DataBoundWidget.extend({init:function(n,t){var r=this,u=!1,e=t&&!!t.dataSource,f;p(t)&&(t={dataSource:t});t&&typeof t.loadOnDemand==l&&p(t.dataSource)&&(t.loadOnDemand=!1);it.prototype.init.call(r,n,t);n=r.element;t=r.options;f=n.is("ul")&&n||n.hasClass(w)&&n.children("ul");u=!e&&f.length;u&&(t.dataSource.list=f);r._animation();r._accessors();r._templates();n.hasClass(w)?(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(bt)}).on("mouseleave"+r,i,function(){n(this).removeClass(bt)}).on(wt+r,i,u(t._click,t)).on("dblclick"+r,".k-in:not(.k-state-disabled)",u(t._toggleButtonClick,t)).on(wt+r,".k-i-expand,.k-i-collapse",u(t._toggleButtonClick,t)).on("keydown"+r,u(t._keydown,t)).on("keypress"+r,u(t._keypress,t)).on("focus"+r,u(t._focus,t)).on("blur"+r,u(t._blur,t)).on("mousedown"+r,".k-in,.k-checkbox-wrapper :checkbox,.k-i-expand,.k-i-collapse",u(t._mousedown,t)).on("change"+r,".k-checkbox-wrapper :checkbox",u(t._checkboxChange,t)).on("click"+r,".checkbox-span",u(t._checkboxLabelClick,t)).on("click"+r,".k-request-retry",u(t._retryRequest,t)).on("click"+r,function(i){n(i.target).is(":kendoFocusable")||t.focus()})},_checkboxLabelClick:function(t){var i=n(t.target.previousSibling);i.prop("checked",!i.prop("checked"));i.trigger("change");i.data(h)&&(i.data(h,!1).prop(h,!1).prop(e,!0),this._checkboxChange(t))},_syncHtmlAndDataSource:function(n,t){n=n||this.root;t=t||this.dataSource;for(var c=t.view(),l=i.attr("uid"),a=i.attr("expanded"),v=this.options.checkboxes,h=n.children("li"),r,f,o,s,u=0;u<h.length;u++)f=c[u],o=f.uid,r=h.eq(u),r.attr("role","treeitem").attr(l,o).attr(ut,r.hasClass("k-state-selected")),f.expanded=r.attr(a)==="true",v&&(s=ft(r),f.checked=s.prop(e),s.attr("id","_"+o),s.next(".k-checkbox-label").attr("for","_"+o)),this._syncHtmlAndDataSource(r.children("ul"),f.children)},_animation:function(){var i=this.options,n=i.animation,r=n.collapse&&"effects"in n.collapse,t=y({},n.expand,n.collapse);r||(t=y(t,{reverse:!0}));n===!1&&(n={expand:{effects:{}},collapse:{hide:!0,effects:{}}});n.collapse=y(t,{hide:!0});i.animation=n},_dragging:function(){var r=this.options.dragAndDrop,i=this.dragging,t;r&&!i?(t=this,this.dragging=new v.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(lt,{sourceNode:n[0]})},drag:function(n){t.trigger(at,{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(vt,{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(yt,{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==g?n.template=et(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,t){var i="k-in";return t&&(i+=" k-link"),n.enabled===!1&&(i+=" k-state-disabled"),n.selected===!0&&(i+=" k-state-selected"),i},toggleButtonClass:function(n){return"k-icon"+(n.expanded!==!0?" k-i-expand":" k-i-collapse")},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) #'/># } ## if (data.treeview.checkboxes) { #<span class='k-checkbox-wrapper' role='presentation'>#= data.treeview.checkboxes.template(data) #<\/span># } ## var tag = url ? 'a' : 'span'; ## var textAttr = url ? ' href=\\'' + url + '\\'' : ''; #<#=tag# class='#= r.textClass(item, !!url) #'#= 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-i-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.options.autoBind&&this.dataSource.fetch()},_bindDataSource:function(){this._refreshHandler=u(this.refresh,this);this._errorHandler=u(this._error,this);this.dataSource.bind(d,this._refreshHandler);this.dataSource.bind(ct,this._errorHandler)},_unbindDataSource:function(){var n=this.dataSource;n&&(n.unbind(d,this._refreshHandler),n.unbind(ct,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=p(t)?{data:t}:t;i._unbindDataSource();t.fields||(t.fields=[{field:"text"},{field:"url"},{field:"spriteCssClass"},{field:"imageUrl"}]);i.dataSource=t=ot.create(t);n&&(t.fetch(),r(t.view()));i._bindDataSource()},events:[lt,at,vt,yt,pt,"expand","collapse",rt,d,ht,st],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 k)n=f[k[t]],r=e.attr(i.attr(t+"-field")),!n&&r&&(n=r),n||(n=t),p(n)||(n=[n]),f[k[t]]=n},_fieldAccessor:function(t){var u=this.options[k[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){it.fn.setOptions.call(this,n);this._animation();this._dragging();this._templates()},_trigger:function(n,t){return this.trigger(n,{node:t.closest(f)[0]})},_setChecked:function(t,i){if(t&&n.isFunction(t.view))for(var r=0,u=t.view();r<u.length;r++)u[r][e]=i,u[r].children&&this._setChecked(u[r].children,i)},_setIndeterminate:function(n){var f=s(n),t,u,r=!0,i;if(f.length){if(t=ft(f.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 ft(n).data(h,!r).prop(h,!r).prop(e,r&&t[0].checked)}},updateIndeterminate:function(n){n=n||this.wrapper;var i=s(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(e)&&(this.dataItem(n).checked=!0)}},_bubbleIndeterminate:function(n){if(n.length){this.updateIndeterminate(n);var t=this.parent(n),i;t.length&&(this._setIndeterminate(t),i=t.children("div").find(".k-checkbox-wrapper :checkbox"),i.prop(h)===!1?this.dataItem(t).set(e,i.prop(e)):delete this.dataItem(t).checked,this._bubbleIndeterminate(t))}},_checkboxChange:function(t){var i=n(t.target),r=i.prop(e),u=i.closest(f),o=this.dataItem(u);o.checked!=r&&(o.set(e,r),this._trigger(st,u))},_toggleButtonClick:function(t){var i=n(t.currentTarget).closest(f);i.is("[aria-disabled='true']")||this.toggle(n(t.target).closest(f))},_mousedown:function(t){var i=n(t.currentTarget).closest(f);i.is("[aria-disabled='true']")||(this._clickTarget=i,this.current(i))},_focusable:function(n){return n&&n.length&&n.is(":visible")&&!n.find(".k-in:first").hasClass(a)},_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(a)},parent:function(t){var u=/\bk-item\b/,i,r;typeof t==g&&(t=this.element.find(t));ni(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=s(n).children().first(),t.length||(t=r(n))):t=r(n):t=i.root.children().eq(0),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=s(t).children().last(),!r.length)break;t=r}else t=i.parent(n)||n;return t},_keydown:function(r){var u=this,c=r.keyCode,s,f=u.current(),y=u._expanded(f),l=f.find(".k-checkbox-wrapper:first :checkbox"),v=i.support.isRtl(u.element);r.target==r.currentTarget&&(!v&&c==o.RIGHT||v&&c==o.LEFT?y?s=u._nextVisible(f):f.find(".k-in:first").hasClass(a)||u.expand(f):!v&&c==o.LEFT||v&&c==o.RIGHT?y&&!f.find(".k-in:first").hasClass(a)?u.collapse(f):(s=u.parent(f),u._enabled(s)||(s=t)):c==o.DOWN?s=u._nextVisible(f):c==o.UP?s=u._previousVisible(f):c==o.HOME?s=u._nextVisible(n()):c==o.END?s=u._previousVisible(n()):c!=o.ENTER||f.find(".k-in:first").hasClass(a)?c==o.SPACEBAR&&l.length&&!f.find(".k-in:first").hasClass(a)&&(l.prop(e,!l.prop(e)).data(h,!1).prop(h,!1),u._checkboxChange({target:l}),s=f):f.find(".k-in:first").hasClass("k-state-selected")||u._trigger(rt,f)||u.select(f),s&&(r.preventDefault(),f[0]!=s[0]&&(u._trigger(ht,s),u.current(s))))},_keypress:function(n){var t=this,r=t._getSelectedNode(),i;n.keyCode!==o.ENTER&&n.keyCode!==o.SPACEBAR&&(t._match||(t._match=""),t._match+=String.fromCharCode(n.keyCode),clearTimeout(t._matchTimer),t._matchTimer=setTimeout(function(){t._match=""},300),i=r&&t._matchNextByText(Array.prototype.indexOf.call(this.element.find(".k-item"),r[0]),t._match),i||(i=t._matchNextByText(-1,t._match)),t.select(i))},_matchNextByText:function(t,i){return n(this.element).find(".k-in").filter(function(r,u){return r>t&&n(u).is(":visible")&&!n(u).hasClass(a)&&n(u).text().toLowerCase().indexOf(i)===0}).closest(f)[0]},_click:function(t){var u=this,i=n(t.currentTarget),e=b(i.closest(f)),r=i.attr("href"),o;o=r?r=="#"||r.indexOf("#"+this.element.id+"-")>=0:e.length&&!e.children().length;o&&t.preventDefault();i.hasClass(".k-state-selected")||u._trigger(rt,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},_getSelectedNode:function(){return this.element.find(".k-state-selected").closest(f)},_group:function(n){var t=this,r=n.hasClass(w),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=y({length:u.length},i);u.each(function(t,u){u=n(u);f={index:t,expanded:r._expanded(u)};tt(u);r._updateNodeClasses(u,i,f);r._group(u)})},_checkboxes:function(){var i=this.options,n=i.checkboxes,t;n&&(t="<input aria-label='#=item.text#' type='checkbox' tabindex='-1' #= (item.enabled === false) ? 'disabled' : '' # #= item.checked ? 'checked' : '' #",n.name&&(t+=" name='"+n.name+"'"),t+=" id='_#= item.uid #' class='k-checkbox' /><span class='k-checkbox-label checkbox-span'><\/span>",n=y({template:t},i.checkboxes),typeof n.template==g&&(n.template=et(n.template)),i.checkboxes=n)},_updateNodeClasses:function(n,t,i){var r=n.children("div"),e=n.children("ul"),u=this.templates,f,o;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(w),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)),f=r.children(".k-in"),o=f[0]&&f[0].nodeName.toLowerCase()=="a",f.removeClass("k-in k-link k-state-default k-state-disabled").addClass(u.textClass(i,o)),(e.length||n.attr("data-hasChildren")=="true")&&(r.children(".k-icon").removeClass("k-i-expand k-i-collapse").addClass(u.toggleButtonClass(i)),e.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(f))})},dataItem:function(t){var u=n(t).closest(f).attr(i.attr("uid")),r=this.dataSource;return r&&r.getByUid(u)},_insertNode:function(t,i,r,u,f){for(var h=this,l=s(r),p=l.children().length+1,a,v={firstLevel:r.hasClass(w),expanded:!f,length:p},o,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(o=n(y),o.length){for(h.angular("compile",function(){return{elements:o.get(),data:t.map(function(n){return{dataItem:n}})}}),l.length||(l=n(h._renderGroup({group:v})).appendTo(r)),u(o,l),r.hasClass("k-item")&&(tt(r),h._updateNodeClasses(r)),h._updateNodeClasses(o.prev().first()),h._updateNodeClasses(o.next().last()),e=0;e<t.length;e++)c=t[e],c.hasChildren&&(a=c.children.data(),a.length&&h._insertNode(a,c.index,o.eq(e),b,!h._expanded(o.eq(e))));return o}},_updateNodes:function(t,i){function w(n,t){n.find(".k-checkbox-wrapper :checkbox").not("[disabled]").prop(e,t).data(h,!1).prop(h,!1)}var u=this,s,f,o,r,c,a,p={treeview:u.options,item:r},y=i!="expanded"&&i!="checked",l;if(i=="selected")r=t[0],f=u.findByUid(r.uid).find(".k-in:first").removeClass("k-state-hover").toggleClass("k-state-selected",r[i]).end(),r[i]&&u.current(f),f.attr(ut,!!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],f=o.parent(),y&&o.children(".k-in").html(u.templates.itemContent(p)),i==e?(c=r[i],w(o,c),u.options.checkboxes.checkChildren&&(w(f.children(".k-group"),c),u._setChecked(r.children,c),u._bubbleIndeterminate(f))):i=="expanded"?u._toggle(f,r,r[i]):i=="enabled"&&(f.find(".k-checkbox-wrapper :checkbox").prop("disabled",!r[i]),a=!b(f).is(ui),f.removeAttr(kt),r[i]||(r.selected&&r.set("selected",!1),r.expanded&&r.set("expanded",!1),a=!0,f.attr(ut,!1).attr(kt,!0)),u._updateNodeClasses(f,{},{enabled:r[i],expanded:!a})),o.length&&this.trigger("itemChange",{item:o,data:r,ns:v});y&&u.angular("compile",function(){return{elements:l,data:n.map(t,function(n){return[{dataItem:n}]})}})}},_appendItems:function(n,t,i){var u=s(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),s(i).css("display","block"))},_refreshChildren:function(n,t,i){var r,u,f,e=this.options,o=e.loadOnDemand,h=e.checkboxes&&e.checkboxes.checkChildren;if(s(n).empty(),t.length)for(this._appendItems(i,t,n),u=s(n).children(),o&&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:v});else tt(n)},_refreshRoot:function(t){var u=this._renderGroup({items:t,group:{firstLevel:!0,expanded:!0}}),r,f,i;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"),f=this.root.children(".k-item"),i=0;i<t.length;i++)this.trigger("itemChange",{item:f.eq(i),data:t[i],ns:v});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(pt,{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),nt(t).addClass("k-i-reload"),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,e=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,e).closest(f);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(f);t=n(t,r).closest(f);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._clickTarget=t);i.trigger(d)},_toggle:function(n,t,i){var u=this.options,r=b(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(y({reset:!0},u.animation[f],{complete:function(){i&&r.css("height","")}}))))},toggle:function(t,i){(t=n(t),nt(t).is(".k-i-expand, .k-i-collapse"))&&(arguments.length==1&&(i=!this._expanded(t)),this._expanded(t,i))},destroy:function(){var n=this;it.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),f=t;if(arguments.length==1)return n.attr(u)==="true"||r&&r.expanded;b(n).data("animating")||(r&&(r.set("expanded",f),f=r.expanded),f?(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()):nt(n).toggleClass("k-i-loading",t).removeClass("k-i-reload")},text:function(n,t){var i=this.dataItem(n),r=this.options[k.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,e=this._objectOrSelf(r||i),o=e.dataSource,s=n.Deferred().resolve().promise();return r&&r[0]!=e.element[0]&&(f=e.dataItem(r),f.loaded()||(e._progress(r,!0),s=f.load()),r!=this.root&&(o=f.children,o&&o instanceof ot||(f._initChildren(),f.loaded(!0),o=f.children))),t=this._toObservableData(t),u.call(e,o,t,s)},_toObservableData:function(t){var r=t,u,f;return(t instanceof window.jQuery||ni(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():p(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:ii(1),insertBefore:ii(0),append:function(t,i,r){var u=this.root;return i&&(u=s(i)),this._dataSourceMove(t,u,i,function(t,u,f){function s(){i&&o._expanded(i,!0);var n=t.data(),r=Math.max(n.length,0);return o._insert(n,u,r)}var e,o=this;return f.done(function(){e=s();r=r||n.noop;r(e)}),e||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")&&(tt(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(f)},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 f(){u.shift();u.length?e(u[0]).then(f):o.call(r)}function e(t){var u=n.Deferred(),i=r.dataSource.get(t);return i?i.loaded()?(i.set("expanded",!0),u.resolve()):(r._progress(r.findByUid(i.uid),!0),i.load().then(function(){i.set("expanded",!0);u.resolve()})):u.resolve(),u.promise()}var r=this,u=t.slice(0),o=i||n.noop;e(u[0]).then(f)},_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)}});v.plugin(dt)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.pivot.fieldmenu",["kendo.pivotgrid","kendo.menu","kendo.window","kendo.treeview","kendo.dropdownlist"],n)}(function(){return function(n){function a(n,t){for(var r=[],i=0,u=n.length;i<u;i++)n[i].field!==t&&r.push(n[i]);return r}function e(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 v(t,i,r){var f,u=0,o=r.length;if(t=e(t,i,"in")[0],t)for(f=t.value.split(",");u<o;u++)r[u].checked=n.inArray(r[u].uniqueName,f)>=0;else for(;u<o;u++)r[u].checked=!0}function c(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&&c(n[i].children.view(),t)}var t=window.kendo,r=t.ui,s="kendoContextMenu",i=n.proxy,u=".kendoPivotFieldMenu",o=r.Widget,f="k-filter-item",h="aria-label",l=o.extend({init:function(n,i){o.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(p)({ns:t.ns,filterable:r.filterable,sortable:r.sortable,messages:r.messages}));this.menu=this.wrapper[s]({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(s);this._createWindow();r.filterable&&this._initFilterForm()},_initFilterForm:function(){var n=this.menu.element.find("."+f),r=i(this._filter,this);this._filterOperator=new t.ui.DropDownList(n.find("select"));this._filterValue=n.find(".k-textbox");this._updateFilterAriaLabel();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=e(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()},_updateFilterAriaLabel:function(){var n=this.menu.element.find("."+f),t=this._filterOperator.value(),i=this.options.messages.operators[t];n.find("select").attr(h,i)},_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=a(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(w)({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,f=this.treeView.dataSource.view(),o=f[0].checked,t=this.dataSource.filter(),u=e(t,this.currentMember,"in")[0];c(f,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){v(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(e(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"):i.hasClass(f)&&this._updateFilterAriaLabel()},_windowOpen:function(){this.treeView||this._createTreeView(this.includeWindow.element.find(".k-treeview"));r.progress(this.includeWindow.element,!0);this.treeView.dataSource.read()},destroy:function(){o.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}}),y='<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" '+h+'="#=messages.filter#" /><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>',p='<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-sm"><\/span>${messages.sortAscending}<\/span><\/li><li class="k-item k-sort-desc"><span class="k-link"><span class="k-icon k-i-sort-desc-sm"><\/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-i-filter"><\/span>${messages.include}<\/span><\/li><li class="k-separator"><\/li><li class="k-item '+f+'"><span class="k-link"><span class="k-icon k-i-filter"><\/span>${messages.filterFields}<\/span><ul><li>'+y+"<\/li><\/ul><\/li># } #<\/ul>",w='<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(l)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.filtercell",["kendo.autocomplete","kendo.datepicker","kendo.numerictextbox","kendo.combobox","kendo.dropdownlist"],n)}(function(){return function(n,t){function u(t){var i=typeof t=="string"?t:t.operator;return n.inArray(i,w)>-1}function y(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=y(r[u],i),f)return f}function p(t,i){t.filters&&(t.filters=n.grep(t.filters,function(n){return p(n,i),n.filters?n.filters.length:n.field!=i}))}function b(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,v=i.ui,h=i.data.DataSource,c=v.Widget,r="change",l="boolean",a="enums",f="string",e="Is equal to",o="Is not equal to",s=n.proxy,w=["isnull","isnotnull","isempty","isnotempty"],k=c.extend({init:function(e,o){var it,w,y;e=n(e).addClass("k-filtercell");var b=this.wrapper=n("<span/>").appendTo(e),h=this,k,d,rt=o,nt,v,p=h.operators=o.operators||{},tt=h.input=n("<input/>").attr(i.attr("bind"),"value: value").appendTo(b),g=o?o.suggestDataSource:null;if(g&&(o=n.extend({},o,{suggestDataSource:{}})),c.fn.init.call(h,e[0],o),g&&(h.options.suggestDataSource=g),o=h.options,k=h.dataSource=o.dataSource,h.model=k.reader.model,v=o.type=f,it=i.getter("reader.model.fields",!0)(k)||{},w=it[o.field],w&&w.type&&(v=o.type=w.type),o.values&&(o.type=v=a),p=p[v]||o.operators[v],!rt.operator)for(nt in p){o.operator=nt;break}h._parse=function(n){return n!=null?n+"":n};h.model&&h.model.fields&&(y=h.model.fields[o.field],y&&y.parse&&(h._parse=s(y.parse,y)));h.defaultOperator=o.operator;h.viewModel=d=i.observable({operator:o.operator,value:null,operatorVisible:function(){var n=this.get("value");return n!==null&&n!==t&&n!="undefined"||u(this.get("operator"))&&!h._clearInProgress}});d.bind(r,s(h.updateDsFilter,h));v==f&&h.initSuggestDataSource(o);o.inputWidth!==null&&tt.width(o.inputWidth);tt.attr("aria-label",h._getColumnTitle());h._setInputType(o,v);v!=l&&o.showOperators!==!1?h._createOperatorDropDown(p):(n('<div unselectable="on" />').css("display","none").text("eq").appendTo(b),b.addClass("k-operator-hidden"));h._createClearIcon();i.bind(this.wrapper,d);v==f&&(o.template||h.setAutoCompleteSource());v==a&&h.setComboBoxSource(h.options.values);h._refreshUI();h._refreshHandler=s(h._refreshUI,h);h.dataSource.bind(r,h._refreshHandler)},_setInputType:function(t,r){var u=this,e=u.input,s;if(typeof t.template=="function")t.template.call(u.viewModel,{element:u.input,dataSource:u.suggestDataSource}),u._angularItems("compile");else if(r==f)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==l){e.remove();var o=n("<input type='radio'/>"),c=u.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);c.append([h,s])}else r=="number"?e.attr(i.attr("role"),"numerictextbox").attr("title",u._getColumnTitle()):r==a&&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)},_getColumnTitle:function(){var n=this.options.column;return n?n.title||n.field:""},_createOperatorDropDown:function(t){var f=[],e=this.viewModel,r,u;for(r in t)f.push({text:t[r],value:r});u=n('<input class="k-dropdown-operator" '+i.attr("bind")+'="value: operator"/>').appendTo(this.wrapper);this.operatorDropDown=u.kendoDropDownList({dataSource:f,dataTextField:"text",dataValueField:"value",open:function(){this.popup.element.width(150)},valuePrimitive:!0}).data("kendoDropDownList");e.bind("change",function(){var n=t[e.operator];u.attr("aria-label",n)});this.operatorDropDown.wrapper.find(".k-i-arrow-60-down").removeClass("k-i-arrow-60-down").addClass("k-i-filter")},initSuggestDataSource:function(n){var i=n.suggestDataSource;i instanceof h||(!n.customDataSource&&i&&(i.group=t),i=this.suggestDataSource=h.create(i));n.customDataSource||(i._pageSize=t,i.reader.data=b(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=h.create({data:n}),t=this.input.data("kendoComboBox");t&&t.setDataSource(i)},_refreshUI:function(){var t=this,i=y(t.dataSource.filter(),this.options.field)||{},r=t.viewModel;t.manuallyUpdatingVM=!0;i=n.extend(!0,{},i);t.options.type==l&&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 f=this,c=f.viewModel,h;if(!f.manuallyUpdatingVM&&(i.field!="operator"||c.value!==t||u(c))){var e=n.extend({},f.viewModel.toJSON(),{field:f.options.field}),o={logic:"and",filters:[]},s=!1;((e.value!==t&&e.value!==null||u(e)&&!this._clearInProgress)&&(o.filters.push(e),s=f.trigger(r,{filter:o,field:f.options.field})),(f._clearInProgress||e.value===null)&&(s=f.trigger(r,{filter:null,field:f.options.field})),s)||(h=f._merge(o),h.filters.length?f.dataSource.filter(h):f.dataSource.filter({}))}},_merge:function(t){var e=this,h=t.logic||"and",r=t.filters,o,i=e.dataSource.filter()||{filters:[],logic:"and"},f,s;for(p(i,e.options.field),f=0,s=r.length;f<s;f++)o=r[f],o.value=e._parse(o.value);return r=n.grep(r,function(n){return n.value!==""&&n.value!==null||u(n)}),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=h)),i},_createClearIcon:function(){var t=this;n("<button type='button' class='k-button k-button-icon' title = "+t.options.messages.clear+"/>").attr("aria-label",t.options.messages.clear).attr(i.attr("bind"),"visible:operatorVisible").html("<span class='k-icon k-i-close'/>").click(s(t.clearFilter,t)).appendTo(t.wrapper)},clearFilter:function(){this._clearInProgress=!0;u(this.viewModel.operator)&&this.viewModel.set("operator",this.defaultOperator);this.viewModel.set("value",null);this._clearInProgress=!1},_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);c.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:e,neq:o,startswith:"Starts with",contains:"Contains",doesnotcontain:"Does not contain",endswith:"Ends with",isnull:"Is null",isnotnull:"Is not null",isempty:"Is empty",isnotempty:"Is not empty"},number:{eq:e,neq:o,gte:"Is greater than or equal to",gt:"Is greater than",lte:"Is less than or equal to",lt:"Is less than",isnull:"Is null",isnotnull:"Is not null"},date:{eq:e,neq:o,gte:"Is after or equal to",gt:"Is after",lte:"Is before or equal to",lt:"Is before",isnull:"Is null",isnotnull:"Is not null"},enums:{eq:e,neq:o,isnull:"Is null",isnotnull:"Is not null"}}}});v.plugin(k)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.panelbar",["kendo.data"],n)}(function(){return function(n,t){function a(t){t=n(t);t.filter(".k-first:not(:first-child)").removeClass(bt);t.filter(".k-last:not(:last-child)").removeClass(wt);t.filter(":first-child").addClass(bt);t.filter(":last-child").addClass(wt)}function di(t){var u=t,i=t.children("ul"),r=u.children(".k-link").children(".k-icon");t.hasClass("k-panelbar")||(!r.length&&i.length?r=n("<span class='k-icon' />").appendTo(u):i.length&&i.children().length||(r.remove(),i.remove()))}var r=window.kendo,ct=r.ui,h=r.keys,i=n.extend,g=n.proxy,lt=n.each,at=n.isArray,e=r.template,vt=ct.Widget,yt=r.data.HierarchicalDataSource,ai=/^(ul|a|div)$/i,s=".kendoPanelBar",ni="img",pt="href",wt="k-last",nt="k-link",u="."+nt,tt="error",f=".k-item",w=".k-group:visible",ti="k-image",bt="k-first",it="change",kt="expand",ii="select",rt="k-content",ri="activate",ut="collapse",ui="dataBound",fi="mouseenter",vi="mouseleave",ei="contentLoad",yi="undefined",c="k-state-active",y="> .k-panel",b="> .k-content",pi="string",oi="k-state-focused",o="k-state-disabled",k="k-state-selected",ft="."+k,l="k-state-highlight",d=f+":not(.k-state-disabled)",si="> "+d+" > "+u+", .k-panel > "+d+" > "+u,wi=f+".k-state-disabled > .k-link",hi="> li > "+ft+", .k-panel > li > "+ft,bi="k-state-default",dt="aria-disabled",p="aria-expanded",et="aria-hidden",ot="aria-selected",v=":visible",ki=":empty",ci="single",st={text:"dataTextField",url:"dataUrlField",spriteCssClass:"dataSpriteCssClassField",imageUrl:"dataImageUrlField"},gt,ht={aria:function(n){var t="";return(n.items||n.content||n.contentUrl||n.expanded)&&(t+=p+"='"+(n.expanded?"true":"false")+"' "),n.enabled===!1&&(t+=dt+"='true'"),t},wrapperCssClass:function(n,t){var i="k-item",r=t.index;return i+=t.enabled===!1?" "+o:t.expanded===!0?" "+c:" 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=nt;return t.firstLevel&&(i+=" k-header"),i},textAttributes:function(n){return n?" href='"+n+"'":""},arrowClass:function(n){return"k-icon"+(n.expanded?" k-panelbar-collapse k-i-arrow-60-up":" k-panelbar-expand k-i-arrow-60-down")},text:function(n){return n.encoded===!1?n.text:r.htmlEncode(n.text)},groupAttributes:function(n){return n.expanded!==!0?" style='display:none'":""},ariaHidden:function(n){return n.expanded!==!0},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+'"':""}},li;gt=function(n){return n.children("span").children(".k-icon")};li=r.ui.DataBoundWidget.extend({init:function(t,i){var u=this,f,e;at(i)&&(i={dataSource:i});e=i&&!!i.dataSource;vt.fn.init.call(u,t,i);t=u.wrapper=u.element.addClass("k-widget k-reset k-header k-panelbar");i=u.options;t[0].id&&(u._itemId=t[0].id+"_pb_active");u._tabindex();u._accessors();u._dataSource();u._templates();u._initData(e);u._updateClasses();u._animations(i);t.on("click"+s,si,function(t){u._click(n(t.currentTarget))&&t.preventDefault()}).on(fi+s+" "+vi+s,si,u._toggleHover).on("click"+s,wi,!1).on("click"+s,".k-request-retry",g(u._retryRequest,u)).on("keydown"+s,n.proxy(u._keydown,u)).on("focus"+s,function(){var n=u.select();u._current(n[0]?n:u._first())}).on("blur"+s,function(){u._current(null)}).attr("role","menu");f=t.find("li."+c+" > ."+rt);f[0]&&u.expand(f.parent(),!1);i.dataSource||u._angularCompile();r.notify(u)},events:[kt,ut,ii,ri,it,tt,ui,ei],options:{name:"PanelBar",dataSource:{},animation:{expand:{effects:"expand:vertical",duration:200},collapse:{duration:200}},messages:{loading:"Loading...",requestFailed:"Request failed.",retry:"Retry"},autoBind:!0,loadOnDemand:!0,expandMode:"multiple",dataTextField:null},_angularCompile:function(){var n=this;n.angular("compile",function(){return{elements:n.element.children("li"),data:[{dataItem:n.options.$angular}]}})},_angularCompileElements:function(t,i){var r=this;r.angular("compile",function(){return{elements:t,data:n.map(i,function(n){return[{dataItem:n}]})}})},_angularCleanup:function(){var n=this;n.angular("cleanup",function(){return{elements:n.element.children("li")}})},destroy:function(){vt.fn.destroy.call(this);this.element.off(s);this._angularCleanup();r.destroy(this.element)},_initData:function(n){var t=this;n&&(t.element.empty(),t.options.autoBind&&(t._progress(!0),t.dataSource.fetch()))},_templates:function(){var t=this,n=t.options,i=g(t._fieldAccessor,t);n.template&&typeof n.template==pi?n.template=e(n.template):n.template||(n.template=e("# var text = "+i("text")+"(data.item); ## if (typeof data.item.encoded != 'undefined' && data.item.encoded === false) {##= text ## } else { ##: text ## } #"));t.templates={content:e("<div role='region' class='k-content'#= contentAttributes(data) #>#= content(item) #<\/div>"),group:e("<ul role='group' aria-hidden='#= ariaHidden(group) #' class='#= groupCssClass(group) #'#= groupAttributes(group) #>#= renderItems(data) #<\/ul>"),itemWrapper:e("# var url = "+i("url")+"(item); ## var imageUrl = "+i("imageUrl")+"(item); ## var spriteCssClass = "+i("spriteCssClass")+"(item); ## var contentUrl = contentUrl(item); ## var tag = url||contentUrl ? 'a' : 'span'; #<#= tag # class='#= textClass(item, group) #' #= contentUrl ##= textAttributes(url) #># if (imageUrl) { #<img class='k-image' alt='' src='#= imageUrl #' /># } ## if (spriteCssClass) { #<span class='k-sprite #= spriteCssClass #'><\/span># } ##= data.panelBar.options.template(data) ##= arrow(data) #<\/#= tag #>"),item:e("<li role='menuitem' #=aria(item)#class='#= wrapperCssClass(group, item) #'"+r.attr("uid")+"='#= item.uid #'>#= itemWrapper(data) ## if (item.items && item.items.length > 0) { ##= subGroup({ items: item.items, panelBar: panelBar, group: { expanded: item.expanded } }) ## } else if (item.content || item.contentUrl) { ##= renderContent(data) ## } #<\/li>"),loading:e("<div class='k-item'><span class='k-icon k-i-loading'><\/span> #: data.messages.loading #<\/div>"),retry:e("#: data.messages.requestFailed # <button class='k-button k-request-retry'>#: data.messages.retry #<\/button>"),arrow:e("<span class='#= arrowClass(item) #'><\/span>"),empty:e("")}},setOptions:function(n){var t=this.options.animation;this._animations(n);n.animation=i(!0,t,n.animation);"dataSource"in n&&this.setDataSource(n.dataSource);vt.fn.setOptions.call(this,n)},expand:function(t,i){var r=this,u={};if(t=this.element.find(t),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.each(function(f,e){var s,h;if(e=n(e),s=t.children(".k-group,.k-content"),s.length||(s=r._addGroupElement(t)),h=s.add(e.find(b)),!e.hasClass(o)&&h.length>0){if(r.options.expandMode==ci&&r._collapseAllExpanded(e))return r;t.find("."+l).removeClass(l);e.addClass(l);i||(u=r.options.animation,r.options.animation={expand:{effects:{}},collapse:{hide:!0,effects:{}}});r._triggerEvent(kt,e)||r._toggleItem(e,!1,!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 e=f.find(y).add(f.find(b));!f.hasClass(o)&&e.is(v)&&(f.removeClass(l),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},updateArrow:function(t){var i=this;t=n(t);t.children(u).children(".k-panelbar-collapse, .k-panelbar-expand").remove();t.filter(function(){var t=i.dataItem(this);return t?t.hasChildren||t.content||t.contentUrl:n(this).find(".k-panel").length>0||n(this).find(".k-content").length>0}).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(c)?" k-panelbar-collapse k-i-arrow-60-up":" k-panelbar-expand k-i-arrow-60-down")+"'/>")})},_accessors:function(){var u=this,f=u.options,t,n,i,e=u.element;for(t in st)n=f[st[t]],i=e.attr(r.attr(t+"-field")),!n&&i&&(n=i),n||(n=t),at(n)||(n=[n]),f[st[t]]=n},_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()):gt(n).toggleClass("k-i-loading",t).removeClass("k-i-refresh")},_refreshRoot:function(t){var u=this,f=u.element,e={firstLevel:!0,expanded:!0,length:f.children().length},r;this.element.empty();r=n.map(t,function(t,r){return typeof t=="string"?n(t):(t.items=[],n(u.renderItem({group:e,item:i(t,{index:r})})))});this.element.append(r);this._angularCompileElements(r,t)},_refreshChildren:function(n,t){var r,i,u,f;if(t.children(".k-group").empty(),f=n.children.data(),f.length)for(this.append(n.children,t),this.options.loadOnDemand&&this._toggleGroup(t.children(".k-group"),!1),i=t.children(".k-group").children("li"),r=0;r<i.length;r++)u=i.eq(r),this.trigger("itemChange",{item:u,data:this.dataItem(u),ns:ct});else di(t),i=t.children(".k-group").children("li"),this._angularCompileElements(i,f)},findByUid:function(t){for(var u=this.element.find(".k-item"),e=r.attr("uid"),f,i=0;i<u.length;i++)if(u[i].getAttribute(e)==t){f=u[i];break}return n(f)},refresh:function(n){var s=this.options,e=n.node,r=n.action,i=n.items,u=this.wrapper,h=s.loadOnDemand,f,o;if(n.field)return!i[0]||!i[0].level?void 0:this._updateItems(i,n.field);if(e&&(u=this.findByUid(e.uid),this._progress(u,!1)),r=="add"?this._appendItems(n.index,i,u):r=="remove"?this.remove(this.findByUid(i[0].uid)):r=="itemchange"?this._updateItems(i):r=="itemloaded"?this._refreshChildren(e,u):this._refreshRoot(i),r!="remove")for(f=0;f<i.length;f++)(!h||i[f].expanded)&&(o=i[f],this._hasChildItems(o)&&o.load());this.trigger(ui,{node:e?u: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),gt(t).addClass("k-i-refresh"),n.node.loaded(!1)):(this._progress(!1),this.element.html(i))},_retryRequest:function(n){n.preventDefault();this.dataSource.fetch()},items:function(){return this.element.find(".k-item > span:first-child")},setDataSource:function(n){var t=this.options;t.dataSource=n;this._dataSource();this.options.autoBind&&(this._progress(!0),this.dataSource.fetch())},_bindDataSource:function(){this._refreshHandler=g(this.refresh,this);this._errorHandler=g(this._error,this);this.dataSource.bind(it,this._refreshHandler);this.dataSource.bind(tt,this._errorHandler)},_unbindDataSource:function(){var n=this.dataSource;n&&(n.unbind(it,this._refreshHandler),n.unbind(tt,this._errorHandler))},_fieldAccessor:function(t){var f=this.options[st[t]]||[],u=f.length,i="(function(item) {";return u===0?i+="return item['"+t+"'];":(i+="var levels = ["+n.map(f,function(n){return"function(d){ return "+r.expr(n)+"}"}).join(",")+"];",i+="if(item.level){return levels[Math.min(item.level(), "+u+"-1)](item);}else",i+="{return levels["+u+"-1](item)}"),i+"})"},_dataSource:function(){var t=this,i=t.options,n=i.dataSource;n&&(n=at(n)?{data:n}:n,t._unbindDataSource(),n.fields||(n.fields=[{field:"text"},{field:"url"},{field:"spriteCssClass"},{field:"imageUrl"}]),t.dataSource=yt.create(n),t._bindDataSource())},_appendItems:function(t,r,u){var f=this,e,o,c,s,h;for(u.hasClass("k-panelbar")?(e=u.children("li"),o=u):(o=u.children(".k-group"),o.length||(o=f._addGroupElement(u)),e=o.children("li")),c={firstLevel:u.hasClass("k-panelbar"),expanded:!0,length:e.length},s=n.map(r,function(t,r){return typeof t=="string"?n(t):n(f.renderItem({group:c,item:i(t,{index:r})}))}),typeof t==yi&&(t=e.length),h=0;h<s.length;h++)e.length===0||t===0?o.append(s[h]):s[h].insertAfter(e[t-1]);f._angularCompileElements(s,r);f.dataItem(u)&&(f.dataItem(u).hasChildren=!0,f.updateArrow(u))},_updateItems:function(t,r){var u=this,s,y,e,f,h={panelBar:u.options,item:f,group:{}},a=r!="expanded",v,l;if(r=="selected")t[0][r]?(v=u.findByUid(t[0].uid),v.hasClass(o)||u.select(v,!0)):u.clearSelection();else{for(l=n.map(t,function(n){return u.findByUid(n.uid)}),a&&u.angular("cleanup",function(){return{elements:l}}),s=0;s<t.length;s++)h.item=f=t[s],h.panelBar=u,e=l[s],y=e.parent(),a&&(h.group={firstLevel:y.hasClass("k-panelbar"),expanded:e.parent().hasClass(c),length:e.children().length},e.children(".k-link").remove(),e.prepend(u.templates.itemWrapper(i(h,{arrow:f.hasChildren||f.content||f.contentUrl?u.templates.arrow:u.templates.empty},ht)))),r=="expanded"?u._toggleItem(e,!f[r],f[r]?"true":!0):r=="enabled"&&(u.enable(e,f[r]),f[r]||f.selected&&f.set("selected",!1)),e.length&&this.trigger("itemChange",{item:e,data:f,ns:ct});a&&u.angular("compile",function(){return{elements:l,data:n.map(t,function(n){return[{dataItem:n}]})}})}},_toggleDisabled:function(n,t){n=this.element.find(n);n.toggleClass(bi,t).toggleClass(o,!t).attr(dt,!t)},dataItem:function(t){var u=n(t).closest(f).attr(r.attr("uid")),i=this.dataSource;return i&&i.getByUid(u)},select:function(i,r){var f=this;return i===t?f.element.find(hi).parent():(i=f.element.find(i),i.length?i.each(function(){var t=n(this),i=t.children(u);if(t.hasClass(o))return f;f._updateSelected(i,r)}):this._updateSelected(i),f)},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(y):null);return lt(i.items,function(){i.group.append(this);a(this)}),this.updateArrow(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 lt(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 lt(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,f),i=n.parent("ul");return n.remove(),!i||i.hasClass("k-panelbar")||i.children(f).length||i.remove(),t.length&&(t=t.eq(0),r.updateArrow(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(v))})},_first:function(){return this.element.children(d).first()},_last:function(){var n=this.element.children(d).last(),t=n.children(w);return t[0]?t.children(d).last():n},_current:function(i){var f=this,r=f._focused,e=f._itemId;if(i===t)return r;f.element.removeAttr("aria-activedescendant");r&&r.length&&(r[0].id===e&&r.removeAttr("id"),r.children(u).removeClass(oi));n(i).length&&(e=i[0].id||e,i.attr("id",e).children(u).addClass(oi),f.element.attr("aria-activedescendant",e));f._focused=i},_keydown:function(n){var t=this,i=n.keyCode,r=t._current();n.target==n.currentTarget&&(i==h.DOWN||i==h.RIGHT?(t._current(t._nextItem(r)),n.preventDefault()):i==h.UP||i==h.LEFT?(t._current(t._prevItem(r)),n.preventDefault()):i==h.ENTER||i==h.SPACEBAR?(t._click(r.children(u)),n.preventDefault()):i==h.HOME?(t._current(t._first()),n.preventDefault()):i==h.END&&(t._current(t._last()),n.preventDefault()))},_nextItem:function(n){if(!n)return this._first();var i=n.children(w),t=n.nextAll(":visible").first();return i[0]&&(t=i.children("."+bt)),t[0]||(t=n.parent(w).parent(f).next()),t[0]||(t=this._first()),t.hasClass(o)&&(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(w).children("."+wt),i[0]&&(t=i);else t=n.parent(w).parent(f),t[0]||(t=this._last());return t.hasClass(o)&&(t=this._prevItem(t)),t},_insert:function(t,r,u){var f=this,e,l=n.isPlainObject(t),s=r&&r[0],h,o;return s||(u=f.element),h={firstLevel:u.hasClass("k-panelbar"),expanded:n(r).hasClass(c),length:u.children().length},s&&!u.length&&(u=n(f.renderGroup({group:h,options:f.options})).appendTo(r)),l||n.isArray(t)||t instanceof yt?(t instanceof yt&&(t=t.data()),e=n.map(l?[t]:t,function(t,r){return typeof t=="string"?n(t):n(f.renderItem({group:h,item:i(t,{index:r})}))}),s&&(o=f.dataItem(r),o?(o.hasChildren=!0,r.attr(p,o.expanded).not("."+c).children("ul").attr(et,!o.expanded)):r.attr(p,!1))):(e=typeof t=="string"&&t.charAt(0)!="<"?f.element.find(t):n(t),f._updateItemsClasses(e)),t.length||(t=[t]),f._angularCompileElements(e,t),{items:e,group:u}},_toggleHover:function(t){var i=n(t.currentTarget);i.parents("li."+o).length||i.toggleClass("k-state-hover",t.type==fi)},_updateClasses:function(){var t=this,i,r,u,e,f;i=t.element.find("li > ul").not(function(){return n(this).parentsUntil(".k-panelbar","div").length}).addClass("k-group k-panel").attr("role","group");e=i.parent();f=t.dataItem(e);u=f&&f.expanded||!1;i.parent().attr(p,u).not("."+c).children("ul").attr(et,!u).hide();r=t.element.add(i).children();t._updateItemsClasses(r);t.updateArrow(r);a(r)},_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,f;t=n(t).addClass("k-item").attr("role","menuitem");r.support.browser.msie&&t.css("list-style-position","inside").css("list-style-position","");t.children(ni).addClass(ti);f=t.children("a").addClass(nt);f[0]&&(f.attr("href",h),f.children(ni).addClass(ti));t.filter(":not([disabled]):not([class*=k-state])").addClass("k-state-default");t.filter("li[disabled]").addClass("k-state-disabled").attr(dt,!0).removeAttr("disabled");t.children("div").addClass(rt).attr("role","region").attr(et,!0).hide().parent().attr(p,!1);f=t.children(ft);f[0]&&(s&&s.removeAttr(ot).children(ft).removeClass(k),f.addClass(k),this._selected=t.attr(ot,!0));t.children(u)[0]||(o="<span class='"+nt+"'/>",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(ai)&&!(this.nodeType==3&&!n.trim(this.nodeValue))}).wrapAll(o));t.parent(".k-panelbar")[0]&&t.children(u).addClass("k-header")},_click:function(n){var i=this,w=i.element,r,e,s,p,h,t,c,l,a;if(!n.parents("li."+o).length)return n.closest(".k-widget")[0]!=w[0]?void 0:(h=n.closest(u),t=h.closest(f),i._updateSelected(h),c=t.children(".k-group,.k-content"),l=this.dataItem(t),!c.length&&(i.options.loadOnDemand&&l&&l.hasChildren||this._hasChildItems(t)||t.content||t.contentUrl)&&(c=i._addGroupElement(t)),e=t.find(y).add(t.find(b)),s=h.attr(pt),p=s&&(s.charAt(s.length-1)=="#"||s.indexOf("#"+i.element[0].id+"-")!=-1),r=!!(p||e.length),e.data("animating"))?r:(i._triggerEvent(ii,t)&&(r=!0),r===!1)?void 0:i.options.expandMode==ci&&i._collapseAllExpanded(t)?r:(e.length&&(a=e.is(v),i._triggerEvent(a?ut:kt,t)||(r=i._toggleItem(t,a))),r)},_hasChildItems:function(n){return n.items&&n.items.length>0||n.hasChildren},_toggleItem:function(n,i,r){var o=this,h=n.find(y),l=n.find(u),a=l.attr(pt),s,e,f=o.dataItem(n),c=!i,v=f&&f.loaded();return f&&!r&&f.expanded!==c?(f.set("expanded",c),f.hasChildren||!!f.content||!!f.contentUrl):(!f||r&&r!=="true"||v||f.content||f.contentUrl?h.length?(this._toggleGroup(h,i),s=!0):(e=n.children("."+rt),e.length&&(s=!0,e.is(ki)&&a!==t?o._ajaxRequest(n,e,i):o._toggleGroup(e,i))):(o.options.loadOnDemand&&this._progress(n,!0),n.children(".k-group,.k-content").remove(),s=f.hasChildren,f.load()),s)},_toggleGroup:function(n,t){var r=this,u=r.options.animation,e=u.expand,s=u.collapse&&"effects"in u.collapse,o=i({},u.expand,u.collapse);if(s||(o=i(o,{reverse:!0})),n.is(v)!=t){r._animating=!1;return}n.attr(et,!!t);n.parent().attr(p,!t).toggleClass(c,!t).find("> .k-link > .k-panelbar-collapse,> .k-link > .k-panelbar-expand").toggleClass("k-i-arrow-60-up",!t).toggleClass("k-panelbar-collapse",!t).toggleClass("k-i-arrow-60-down",t).toggleClass("k-panelbar-expand",t);t?(e=i(o,{hide:!0}),e.complete=function(){r._animationCallback()}):e=i({complete:function(n){r._triggerEvent(ri,n.closest(f));r._animationCallback()}},e);n.kendoStop(!0,!0).kendoAnimate(e)},_animationCallback:function(){var n=this;n.trigger("complete");n._animating=!1},_addGroupElement:function(t){var i=n('<ul role="group" aria-hidden="true" class="k-group k-panel" style="display:none"><\/ul>');return t.append(i),i},_collapseAllExpanded:function(t){var i=this,r,u=!1,e=t.find(y).add(t.find(b));if(e.is(v)&&(u=!0),!(e.is(v)||e.length===0)){r=t.siblings();r.find(y).add(r.find(b)).filter(function(){return n(this).is(v)}).each(function(t,r){r=n(r);u=i._triggerEvent(ut,r.closest(f));u||i._toggleGroup(r,!0)});i.one("complete",function(){setTimeout(function(){r.each(function(n,t){var r=i.dataItem(t);r&&r.set("expanded",!1)})})})}return u},_ajaxRequest:function(t,i,r){var f=this,e=t.find(".k-panelbar-collapse, .k-panelbar-expand"),s=t.find(u),h=setTimeout(function(){e.addClass("k-i-loading")},100),o=s.attr(pt);n.ajax({type:"GET",cache:!1,url:o,dataType:"html",data:{},error:function(n,t){e.removeClass("k-i-loading");f.trigger(tt,{xhr:n,status:t})&&this.complete()},complete:function(){clearTimeout(h);e.removeClass("k-i-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 u=window.console;u&&u.error&&u.error(s.name+": "+s.message+" in "+o);this.error(this.xhr,"error")}f._toggleGroup(i,r);f.trigger(ei,{item:t[0],contentElement:i[0]})}})},_triggerEvent:function(n,t){var i=this;return i.trigger(n,{item:t[0]})},_updateSelected:function(n,t){var i=this,u=i.element,r=n.parent(f),e=i._selected,o=i.dataItem(r);e&&e.removeAttr(ot);i._selected=r.attr(ot,!0);u.find(hi).removeClass(k);u.find("> ."+l+", .k-panel > ."+l).removeClass(l);n.addClass(k);n.parentsUntil(u,f).filter(":has(.k-header)").addClass(l);i._current(r[0]?r:null);o&&o.set("selected",!0);t||i.trigger(it)},_animations:function(n){n&&"animation"in n&&!n.animation&&(n.animation={expand:{effects:{}},collapse:{hide:!0,effects:{}}})},renderItem:function(n){var t=this,u,r;return n=i({panelBar:t,group:{}},n),u=t.templates.empty,r=n.item,t.templates.item(i(n,{itemWrapper:t.templates.itemWrapper,renderContent:t.renderContent,arrow:t._hasChildItems(r)||r.content||r.contentUrl?t.templates.arrow:u,subGroup:!n.loadOnDemand||r.expanded?t.renderGroup:u},ht))},renderGroup:function(n){var t=this,r=t.templates||n.panelBar.templates;return r.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+=n.panelBar.renderItem(i(n,{group:e,item:i({index:t},r[t])}));return u}},n,ht))},renderContent:function(n){return n.panelBar.templates.content(i(n,ht))}});r.ui.plugin(li)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.responsivepanel",["kendo.core"],n)}(function(){return function(n){var r=n.proxy,i=".kendoResponsivePanel",f="open",e="close",t="click"+i+" touchstart"+i,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(t,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,!0);n(window).on("resize"+i,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);} .k-ie9 .#= guid #.k-rpanel-left { left: 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 k-rpanel-expanded");n(document.documentElement).off(t,this._closeHandler)},_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(t,this._closeHandler)},close:function(){this.trigger(e)||(this.element.addClass("k-rpanel-animate").removeClass("k-rpanel-expanded"),n(document.documentElement).off(t,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"+i,this._resizeHandler);n(document.documentElement).off(t,this._closeHandler)}});kendo.ui.plugin(o)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.timepicker",["kendo.popup","kendo.dateinput"],n)}(function(){return function(n,t){function ui(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 fi(){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 kt(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 gt(n){var t=n.parseFormats;n.format=ii(n.format||i.getCulture(n.culture).calendars.standard.patterns.t);t=bt(t)?t:[t];t.splice(0,0,n.format);n.parseFormats=t}function ni(n){n.preventDefault()}var i=window.kendo,s=i.keys,e=i.parseDate,ti=i._activeElement,ii=i._extractFormat,v=i.support,rt=v.browser,y=i.ui,p=y.Widget,w="open",ut="close",d="change",r=".kendoTimePicker",ft="click"+r,g="k-state-default",et="disabled",ot="readonly",nt="li",st="<span/>",ht="k-state-focused",tt="k-state-hover",ri="mouseenter"+r+" mouseleave"+r,ct="mousedown"+r,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-activedescendant",b="id",bt=n.isArray,k=n.extend,l=n.proxy,u=Date,o=new u,a,dt;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"+r,nt,function(){n(this).addClass(tt)}).on("mouseleave"+r,nt,function(){n(this).removeClass(tt)});u.list=n("<div class='k-list-container k-list-scroller' unselectable='on'/>").append(u.ul).on(ct,ni);f&&(u._timeViewID=f+"_timeview",u._optionID=f+"_option_selected",u.ul.attr(b,u._timeViewID));u._popup();u._heightHandler=l(u._height,u);u.template=i.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(b),i&&(i=n(i).addClass(lt).attr(b,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(r);n.list.off(r);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 r=this,t=r.options,o=t.format,s=i.toString,h=r.template,c=n.length,u=0,f,e="";u<c;u++)f=n[u],kt(f,t.min,t.max)&&(e+=h(s(f,o,t.culture)));r._html(e)},refresh:function(){var e=this,r=e.options,g=r.format,y=fi(),p=y<0,w=r.min,b=r.max,a=f(w),t=f(b),o=r.interval*c,nt=i.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&&ui(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,r.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(w,t._heightHandler);t.popup.one(w,t._heightHandler);t.current(null);t.select(t._value)},scroll:function(n){if(n){var i=this.list[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}},select:function(t){var r=this,f=r.options,u=r._current,e;t instanceof Date&&(t=i.toString(t,f.format,f.culture));typeof t=="string"&&(u&&u.text()===t?t=u:(t=n.grep(r.ul[0].childNodes,function(n){return(n.textContent||n.innerText)==t}),t=t[0]?t:null));e=r._distinctSelection(t);r.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=k(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,r=t[0].style.width,u=this.options.anchor,n,f,e=i._outerWidth;(t.data("width")||!r)&&(n=window.getComputedStyle?window.getComputedStyle(u[0],null):0,f=n?parseFloat(n.width):e(u),n&&(rt.mozilla||rt.msie)&&(f+=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight)+parseFloat(n.borderLeftWidth)+parseFloat(n.borderRightWidth)),r=f-(e(t)-t.width()),t.css({fontFamily:u.css("font-family"),width:r}).data("width",r))},_popup:function(){var t=this,i=t.list,n=t.options,r=n.anchor;t.popup=new y.Popup(i,k(n.popup,{anchor:r,open:n.open,close:n.close,animation:n.animation,isRtl:v.isRtl(n.anchor)}))},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;i.TimeView=a;dt=p.extend({init:function(t,r){var o=this,v,l,d;p.fn.init.call(o,t,r);t=o.element;r=o.options;r.min=e(t.attr("min"))||e(r.min);r.max=e(t.attr("max"))||e(r.max);gt(r);o._initialOptions=k({},r);o._wrapper();o.timeView=l=new a(k({},r,{id:t.attr(b),anchor:o.wrapper,format:r.format,change:function(n,i){i?o._change(n):t.val(n)},open:function(n){o.timeView._adjustListWidth();o.trigger(w)?n.preventDefault():(t.attr(vt,!0),v.attr(yt,!1))},close:function(n){o.trigger(ut)?n.preventDefault():(t.attr(vt,!1),v.attr(yt,!0))},active:function(n){t.removeAttr(wt);n&&t.attr(wt,l._optionID)}}));v=l.ul;o._icon();o._reset();try{t[0].setAttribute("type","text")}catch(g){t[0].type="text"}if(t.addClass("k-input").attr({role:"combobox","aria-expanded":!1,"aria-owns":l._timeViewID}),d=t.is("[disabled]")||n(o.element).parents("fieldset").is(":disabled"),d?o.enable(!1):o.readonly(t.is("[readonly]")),r.dateInput){var h=r.min,c=r.max,s=new u;f(h)==f(c)?(h=new u(s.getFullYear(),s.getMonth(),s.getDate(),0,0,0),c=new u(s.getFullYear(),s.getMonth(),s.getDate(),24,0,0)):(h=new u(s.getFullYear(),s.getMonth(),s.getDate(),h.getHours(),h.getMinutes(),h.getSeconds(),h.getMilliseconds()),c=new u(s.getFullYear(),s.getMonth(),s.getDate(),c.getHours(),c.getMinutes(),c.getSeconds(),c.getMilliseconds()));o._dateInput=new y.DateInput(t,{culture:r.culture,format:r.format,min:h,max:c,value:r.value})}o._old=o._update(r.value||o.element.val());o._oldText=t.val();i.notify(o)},options:{name:"TimePicker",min:o,max:o,format:"",dates:[],parseFormats:[],value:null,interval:30,height:200,animation:{},dateInput:!1},events:[w,ut,d],setOptions:function(n){var t=this,r=t._value;p.fn.setOptions.call(t,n);n=t.options;gt(n);t.timeView.setOptions(n);r&&t.element.val(i.toString(r,n.format,n.culture))},dataBind:function(n){bt(n)&&this.timeView.dataBind(n)},_editable:function(n){var t=this,i=n.disable,u=n.readonly,o=t._arrow.off(r),f=t.element.off(r),e=t._inputWrapper.off(r);if(u||i)e.addClass(i?it:g).removeClass(i?g:it),f.attr(et,i).attr(ot,u).attr(pt,i);else{e.addClass(g).removeClass(it).on(ri,t._toggleHover);f.removeAttr(et).removeAttr(ot).attr(pt,!1).on("keydown"+r,l(t._keydown,t)).on("focusout"+r,l(t._blur,t)).on("focus"+r,function(){t._inputWrapper.addClass(ht)});o.on(ft,l(t._click,t)).on(ct,ni)}},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;p.fn.destroy.call(n);n.timeView.destroy();n.element.off(r);n._arrow.off(r);n._inputWrapper.off(r);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]===ti()||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" aria-label="select"><span class="k-icon k-i-clock"><\/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),t._dateInput&&n.stopImmediatePropagation&&n.stopImmediatePropagation()):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 r=this,u=r.options,o=r.timeView,t=o._parse(n),f=r._value,s=t===null&&f===null||t instanceof Date&&f instanceof Date,e;return(kt(t,u.min,u.max)||(t=null),+t==+f&&s)?(e=i.toString(t,u.format,u.culture),e!==n&&r.element.val(t===null?n:e),t):(r._value=t,r._dateInput&&t?r._dateInput.value(t||n):r.element.val(i.toString(t||n,u.format,u.culture)),o.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))}});y.plugin(dt)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.datetimepicker",["kendo.datepicker","kendo.timepicker"],n)}(function(){return function(n,t){function wt(n){var t=new Date(2100,0,1);return t.setMinutes(-n),t}function bt(n){n.preventDefault()}function kt(t){var u=i.getCulture(t.culture).calendars.standard.patterns,f=!t.parseFormats.length,r;t.format=ut(t.format||u.g);t.timeFormat=r=ut(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.push(r)}var i=window.kendo,it=i.TimeView,f=i.parseDate,rt=i._activeElement,ut=i._extractFormat,p=i.calendar,w=p.isInRange,dt=p.restrictValue,e=p.isEqualDatePart,ft=it.getMilliseconds,b=i.ui,h=b.Widget,k="open",d="close",c="change",r=".kendoDateTimePicker",et="click"+r,ot="disabled",st="readonly",g="k-state-default",ht="k-state-focused",gt="k-state-hover",nt="k-state-disabled",ni="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",u=Date,o=new u(1800,0,1),s=new u(2099,11,31),yt={view:"date"},pt={view:"time"},tt=n.extend,ti=h.extend({init:function(r,u){u.format&&u.format.indexOf("yyyy")==-1&&u.format.indexOf("yy")!=-1&&((u.parseFormats==null||u.parseFormats==t)&&(u.parseFormats=[]),u.parseFormats.splice(0,0,u.format.substr(3,u.format.length-4)),u.format=u.format.replace("yy","yyyy"));var e=this,o;h.fn.init.call(e,r,u);r=e.element;u=e.options;u.disableDates=i.calendar.disabled(u.disableDates);u.min=f(r.attr("min"))||f(u.min);u.max=f(r.attr("max"))||f(u.max);kt(u);e._initialOptions=tt({},u);e._wrapper();e._views();e._icons();e._reset();e._template();try{r[0].setAttribute("type","text")}catch(s){r[0].type="text"}r.addClass("k-input").attr({role:"combobox","aria-expanded":!1});e._midnight=e._calculateMidnight(u.min,u.max);o=r.is("[disabled]")||n(e.element).parents("fieldset").is(":disabled");o?e.enable(!1):e.readonly(r.is("[readonly]"));u.dateInput&&(e._dateInput=new b.DateInput(r,{culture:u.culture,format:u.format,min:u.min,max:u.max,value:u.value}));e._old=e._update(u.value||e.element.val());e._oldText=r.val();i.notify(e)},options:{name:"DateTimePicker",value:null,format:"",timeFormat:"",culture:"",parseFormats:[],dates:[],disableDates:null,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")#',dateButtonText:"Open the date view",timeButtonText:"Open the time view",dateInput:!1,weekNumber:!1},events:[k,d,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);kt(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(tt({},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),o=u._inputWrapper.off(r),s=t.readonly,e=t.disable;if(s||e)o.addClass(e?nt:g).removeClass(e?g:nt),f.attr(ot,e).attr(st,s).attr(vt,e);else{o.addClass(g).removeClass(nt).on(ni,u._toggleHover);f.removeAttr(ot).removeAttr(st).attr(vt,!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,bt).on(et,function(){f.attr("readonly","readonly");u.toggle("date");i.support.touch||f[0]===rt()||f.focus()});c.on(ct,bt).on(et,function(){f.attr("readonly","readonly");u.toggle("time");i.support.touch||f[0]===rt()||f.focus()});f.on("tap",function(){f.data("kendoDateTimePicker").close("date");f.data("kendoDateTimePicker").close("time")})}},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){this.element.removeAttr("readonly");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,f=t.element.val(),i,r,u;n=t._update(n);i=+t._old!=+n;r=i&&!t._typing;u=f!==t.element.val();(r||u)&&t.element.trigger(c);i&&(t._old=n,t._oldText=t.element.val(),t.trigger(c));t._typing=!1},_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=wt(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(gt,t.type==="mouseenter")},_update:function(r){var l=this,h=l.options,y=h.min,d=h.max,p=h.dates,b=l.timeView,tt=l._value,u=f(r,h.parseFormats,h.culture),rt=u===null&&tt===null||u instanceof Date&&tt instanceof Date,k,v,g,nt,it,a=!1;if(dsiCommon.isNullOrEmpty(h.dsi)||typeof r=="string"&&(h.dsi.allowANDOR&&(r.indexOf("^")!=-1||r.indexOf("&")!=-1)&&(h.dsi.override="andor",a=!0,u=r),!a&&h.dsi.allowWildCards&&(r.indexOf("*")!=-1||r.indexOf("_")!=-1)&&(h.dsi.override="wildcard",a=!0,u=r)),h.disableDates&&h.disableDates(u)&&(u=null,l._old||l.element.val()||(r=null)),!a){if(+u==+tt&&rt)return it=i.toString(u,h.format,h.culture),it!==r&&(l.element.val(u===null?r:it),r instanceof String&&l.element.trigger(c)),u;u!==null&&e(u,y)?u=dt(u,y,d):w(u,y,d)||(u=null)}return u===null&&h.dsi&&(h.dsi.allowBlank&&dsiCommon.isBlankValue(r)&&(u=r,a=!0,h.dsi.override="blank"),h.dsi.allowCurrentValue&&dsiCommon.isCurrentValue(r)&&(u=r,a=!0,h.dsi.override="currentvalue")),l._value=u,b.value(u),l.dateView.value(u),a||typeof l._old=="string"||u&&(g=l._old,v=b.options,p[0]&&(p=n.grep(p,function(n){return e(u,n)}),p[0]&&(b.dataBind(p),nt=!0)),nt||(e(u,y)&&(v.min=y,v.max=wt(h.interval),k=!0),e(u,d)&&(l._midnight?(b.dataBind([s]),nt=!0):(v.max=d,k||(v.min=o),k=!0))),nt||(g||!k)&&(!g||e(g,u))||(k||(v.max=s,v.min=o),b.bind())),l._dateInput&&u?l._dateInput.value(u||r):l.element.val(i.toString(u||r,h.format,h.culture)),l._updateARIA(u),a||dsiCommon.isNullOrEmpty(h.dsi)||(h.dsi.override=t),u},_keydown:function(n){var t=this,r=t.dateView,f=t.timeView,e=t.element.val(),u=r.popup.visible(),o=t._dateInput&&n.stopImmediatePropagation;n.altKey&&n.keyCode===i.keys.DOWN?t.toggle(u?"time":"date"):u?(r.move(n),t._updateARIA(r._current)):f.popup.visible()?f.move(n):n.keyCode===i.keys.ENTER&&e!==t._oldText?t._change(e):(t._typing=!0,o=!1);o&&n.stopImmediatePropagation();u&&(n.keyCode==i.keys.ENTER||n.keyCode==i.keys.ESC)&&n.stopPropagation()},_views:function(){var n=this,r=n.element,t=n.options,nt=r.attr("id"),h,e,p,b,g,c;n.dateView=h=new i.DateView(tt({},t,{id:nt,anchor:n.wrapper,change:function(){var r=h.calendar.value(),s=+r,e=+t.min,o=+t.max,f,c;(s===e||s===o)&&(f=s===e?e:o,f=new u(n._value||f),f.setFullYear(r.getFullYear(),r.getMonth(),r.getDate()),w(f,e,o)&&(r=f));n._value&&(c=i.date.setHours(new Date(r),n._value),w(c,e,o)&&(r=c));n._change(r);n.close("date")},close:function(t){n.trigger(d,yt)?t.preventDefault():(r.attr(a,!1),p.attr(v,!0),e.popup.visible()||r.removeAttr(y))},open:function(i){n.trigger(k,yt)?i.preventDefault():(r.val()!==n._oldText&&(c=f(r.val(),t.parseFormats,t.culture),n.dateView[c?"current":"value"](c)),p.attr(v,!1),r.attr(a,!0).attr(y,h._dateViewID),n._updateARIA(c))}}));p=h.div;g=t.min.getTime();n.timeView=e=new it({id:nt,value:t.value,anchor:n.wrapper,animation:t.animation,format:t.timeFormat,culture:t.culture,height:t.height,interval:t.interval,min:new u(o),max:new u(s),dates:g===t.max.getTime()?[new Date(g)]:[],parseFormats:t.parseFormats,change:function(f,o){f=e._parse(f);f<t.min?(f=new u(+t.min),e.options.min=f):f>t.max&&(f=new u(+t.max),e.options.max=f);o?(n._timeSelected=!0,n._change(f)):(r.val(i.toString(f,t.format,t.culture)),h.value(f),n._updateARIA(f))},close:function(t){n.trigger(d,pt)?t.preventDefault():(b.attr(v,!0),r.attr(a,!1),h.popup.visible()||r.removeAttr(y))},open:function(i){e._adjustListWidth();n.trigger(k,pt)?i.preventDefault():(r.val()!==n._oldText&&(c=f(r.val(),t.parseFormats,t.culture),n.timeView.value(c)),b.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)}});b=e.ul},_icons:function(){var i=this,r=i.element,u=i.options,t;t=r.next("span.k-select");t[0]||(t=n('<span unselectable="on" class="k-select"><span class="k-link k-link-date" aria-label="'+u.dateButtonText+'"><span unselectable="on" class="k-icon k-i-calendar"><\/span><\/span><span class="k-link k-link-time" aria-label="'+u.timeButtonText+'"><span unselectable="on" class="k-icon k-i-clock"><\/span><\/span><\/span>').insertAfter(r));t=t.children();t=t.children();i._dateIcon=t.eq(0).attr("aria-controls",i.dateView._dateViewID);i._timeIcon=t.eq(1).attr("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 ft(n)+ft(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")))}});b.plugin(ti)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.splitter",["kendo.resizable"],n)}(function(){return function(n,t){function tt(n){return ht.test(n)}function it(n){return st.test(n)||/^\d+$/.test(n)}function a(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 y(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===e?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,p=f.ui,o=f.keys,ot=n.extend,u=n.proxy,v=p.Widget,st=/^\d+(\.\d+)?px$/i,ht=/^\d+(\.\d+)?%$/i,i=".kendoSplitter",h="expand",c="collapse",w="contentLoad",b="error",k="layoutChange",e="horizontal",s="vertical",ct="mouseenter",d="click",r="pane",lt="mouseleave",g="k-state-focused",nt="k-"+r,l="."+nt,at=v.extend({init:function(n,t){var r=this,u;v.fn.init.call(r,n,t);r.wrapper=r.element;r.options.orientation&&(u=r.options.orientation.toLowerCase()!=s);r.orientation=u?e:s;r._dimension=u?"width":"height";r._keys={decrease:u?o.LEFT:o.UP,increase:u?o.RIGHT:o.DOWN};r._resizeStep=10;r._marker=f.guid().substring(0,8);r._initPanes();r.resizing=new et(r);r.element.triggerHandler("init"+i)},events:[h,c,w,b,"resize",k],_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,s=t.options.orientation,o=t.element.children(".k-splitbar-draggable-"+s),r,f,e;if(o.length>0)o.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));if(r=t.element.children(".k-splitbar"),r.length>0){r.on("dblclick"+i,u(t._togglePane,t));if(f=r.children(".k-collapse-next, .k-collapse-prev"),f.length>0)f.on(d+i,t._arrowClick(c));if(e=r.children(".k-expand-next, .k-expand-prev"),e.length>0)e.on(d+i,t._arrowClick(h))}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:e,panes:[]},destroy:function(){v.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,u=t.keyCode,i=r.resizing,f=n(t.currentTarget),l=r._keys,a=u===l.increase,e=u===l.decrease,s;a||e?(t.ctrlKey?(s=f[e?"next":"prev"](),i&&i.isResizing()&&i.end(),s[r._dimension]()?r._triggerAction(c,f[e?"prev":"next"]()):r._triggerAction(h,s)):i&&i.move((e?-1:1)*r._resizeStep,f),t.preventDefault()):u===o.HOME?(i.move(-i._maxPosition,f),t.preventDefault()):u===o.END?(i.move(i._maxPosition,f),t.preventDefault()):u===o.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-i-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(w,{pane:n[0]})},error:function(t,i){u.trigger(b,{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(c,i.prev()):r.is(".k-collapse-next")?u._triggerAction(c,i.next()):r.is(".k-expand-prev")?u._triggerAction(h,i.prev()):r.is(".k-expand-next")&&u._triggerAction(h,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 u=function(n,t){return t?"<div class='k-icon "+n+"' />":""},r=this.orientation,l=t.resizable!==!1&&i.resizable!==!1,h=t.collapsible,f=t.collapsed,c=i.collapsible,o=i.collapsed;n.addClass("k-splitbar k-state-default k-splitbar-"+r).attr("role","separator").attr("aria-expanded",!(f||o)).removeClass("k-splitbar-"+r+"-hover").toggleClass("k-splitbar-draggable-"+r,l&&!f&&!o).toggleClass("k-splitbar-static-"+r,!l&&!h&&!c).html(u("k-collapse-prev k-i-arrow-60-up",h&&!f&&!o&&r==s)+u("k-collapse-prev k-i-arrow-60-left",h&&!f&&!o&&r==e)+u("k-expand-prev k-i-arrow-60-down",h&&f&&!o&&r==s)+u("k-expand-prev k-i-arrow-60-right",h&&f&&!o&&r==e)+u("k-resize-handle k-i-hbar",l&&r==s)+u("k-resize-handle k-i-vbar",l&&r==e)+u("k-collapse-next k-i-arrow-60-down",c&&!o&&!f&&r==s)+u("k-collapse-next k-i-arrow-60-right",c&&!o&&!f&&r==e)+u("k-expand-next k-i-arrow-60-up",c&&o&&!f&&r==s)+u("k-expand-next k-i-arrow-60-left",c&&o&&!f&&r==e));l||h||c||n.removeAttr("tabindex")},_updateSplitBars:function(){var t=this;this.element.children(".k-splitbar").each(function(){var i=n(this),f=i.prevAll(l).first().data(r),u=i.nextAll(l).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(l):n()},_resize:function(){var t=this,u=t.element,s=u.children(l),h=t.orientation==e,y=u.children(".k-splitbar"),p=y.length,c=h?"width":"height",i=u[c](),o,w,b;t.wrapper.addClass("k-splitter-resizing");p===0?(p=s.length-1,s.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[h?"offsetWidth":"offsetHeight"]});var d=0,it=0,v=n();s.css({position:"absolute",top:0})[c](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(a(t.size)){v=v.add(this);return}u=rt(t.size,i)}return it++,d+=u,u});i-=d;o=v.length;w=Math.floor(i/o);v.slice(0,o-1).css(c,w).end().eq(o-1).css(c,i-(o-1)*w);var g=0,nt=h?"height":"width",ut=h?"left":"top",tt=h?"offsetWidth":"offsetHeight";o===0&&(b=s.filter(function(){return!(n(this).data(r)||{}).collapsed}).last(),b[c](i+b[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(s);t.trigger(k)},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:y("size",!0),min:y("min"),max:y("max")}),ut,ft;p.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),h=i.owner;if(h._panes().children(".k-splitter-overlay").remove(),t.keyCode!==f.keys.ESC){var c=t.position,v=u.prev(),e=u.next(),o=v.data(r),y=e.data(r),p=c-parseInt(v[0].style[i.positioningProperty],10),w=parseInt(e[0].style[i.positioningProperty],10)+e[0][i.sizingDomProperty]-c-u[0][i.sizingDomProperty],s=i._element.children(l).filter(function(){return a(n(this).data(r).size)}).length;(!a(o.size)||s>1)&&(a(o.size)&&s--,o.size=p+"px");(!a(y.size)||s>1)&&(y.size=w+"px");h.resize(!0)}return!1}}}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.dialog",["kendo.core","kendo.popup"],n)}(function(){return function(n,t){function tt(n){return typeof n!="undefined"}function at(n,t,i){return Math.max(Math.min(parseInt(n,10),i===Infinity?i:parseInt(i,10)),parseInt(t,10))}function vt(n){return n.keyCode==o.ENTER||n.keyCode==o.SPACEBAR}var i=window.kendo,h=i.ui.Widget,gt=i.ui.Popup.TabKeyTrap,u=n.proxy,f=i.template,o=i.keys,ni=n.isFunction,c="kendoWindow",ti=".k-dialog",rt=".k-window",w=".k-dialog-close",ii="k-content k-window-content k-dialog-content",ut=".k-content",b="k-dialog-titleless",k=".k-dialog-title",ft=k+"bar",l=".k-dialog-buttongroup",a=".k-button",ri="k-alert",ui="k-confirm",fi="k-prompt",v=".k-textbox",ei=".k-overlay",y=":visible",s="zIndex",et="body",ot="initOpen",p="open",st="close",ht="show",d="hide",g="width",nt=100,ct=Math.ceil,r,lt=":not(link,meta,script,style)",it=h.extend({init:function(n,t){var r=this;h.fn.init.call(r,n,t);r._init(r.element,r.options);i.notify(r)},_init:function(i,f){var e=this,o;if(e._centerCallback=u(e._center,e),e.appendTo=n(et),tt(f.visible)&&f.visible!==null||(f.visible=i.is(y)),e.wrapperTemplate===t&&(e.wrapperTemplate=r.wrapper),e._createDialog(),o=e.wrapper=i.closest(ti),f._defaultFocus===t&&(e._defaultFocus=i[0]),e._tabindex(i),e._dimensions(),this._tabKeyTrap=new gt(o),e.options.visible?(e.toFront(),e._triggerInitOpen(),e.trigger(p),f.modal&&(e._overlay(o.is(y)).css({opacity:.5}),e._focusDialog())):e.wrapper.hide(),f.closable){o.autoApplyNS(c);i.autoApplyNS(c);o.find(w).on("click",u(e._closeClick,e)).on("keydown",u(e._closeKeyHandler,e));i.on("keydown",u(e._keydown,e))}},_dimensions:function(){for(var f,o=this,t=o.wrapper,n=o.options,i=n.width,r=n.height,e=["minWidth","minHeight","maxWidth","maxHeight"],u=0;u<e.length;u++)f=n[e[u]],f&&f!=Infinity&&t.css(e[u],f);this._setElementMaxHeight();i&&(i.toString().indexOf("%")>0?t.width(i):t.width(at(i,n.minWidth,n.maxWidth)));r&&(r.toString().indexOf("%")>0?t.height(r):t.height(at(r,n.minHeight,n.maxHeight)),this._setElementHeight())},_setElementMaxHeight:function(){var n=this,i=n.element,r=n.options.maxHeight,u,t;r!=Infinity&&(u=n._paddingBox(i),t=parseFloat(r,10)-n._uiHeight()-u.vertical,t>0&&i.css({maxHeight:ct(t)+"px",overflow:"hidden"}))},_paddingBox:function(n){var t=parseFloat(n.css("padding-top"),10),i=parseFloat(n.css("padding-left"),10),r=parseFloat(n.css("padding-bottom"),10),u=parseFloat(n.css("padding-right"),10);return{vertical:t+r,horizontal:i+u}},_setElementHeight:function(){var n=this,i=n.element,r=n.options.height,u=n._paddingBox(i),t=parseFloat(r,10)-n._uiHeight()-u.vertical;t>0&&n.element.css({height:ct(t)+"px",overflow:"hidden"})},_uiHeight:function(){var r=this,n=r.wrapper,t=n.children(l),u=t[0]&&t[0].offsetHeight||0,i=n.children(ft),f=i[0]&&i[0].offsetHeight||0;return u+f},_overlay:function(t){var i=this.appendTo.children(ei),u=this.wrapper;return i.length||(i=n(r.overlay)),i.insertBefore(u[0]).toggle(t).css(s,parseInt(u.css(s),10)-1),t?this._waiAriaOverlay():this._removeWaiAriaOverlay(),i},_waiAriaOverlay:function(){var t=this.wrapper;this._overlayedNodes=t.prevAll(lt).add(t.nextAll(lt)).each(function(){var t=n(this);t.data("ariaHidden",t.attr("aria-hidden"));t.attr("aria-hidden","true")})},_removeWaiAriaOverlay:function(){return this._overlayedNodes&&this._overlayedNodes.each(function(){var t=n(this),i=t.data("ariaHidden");i?t.attr("aria-hidden",i):t.removeAttr("aria-hidden")})},_closeClick:function(n){n.preventDefault();this.close()},_closeKeyHandler:function(n){(vt(n)||n.keyCode==o.ESC)&&this.close()},_keydown:function(n){var t=this,i=t.options,r=n.keyCode;r==o.ESC&&!t._closing&&i.closable&&t.close()},_createDialog:function(){var e=this,f=e.element,t=e.options,h=i.support.isRtl(f),o=n(r.titlebar(t)),c=o.find(".k-window-actions"),s=(f.id||i.guid())+"_title",u=n(e.wrapperTemplate(t));u.toggleClass("k-rtl",h);f.addClass(ii);e.appendTo.append(u);t.closable!==!1&&(t.title!==!1?c.append(r.close(t)):u.append(r.close(t)));t.title!==!1?(u.append(o),o.attr("id",s),u.attr("aria-labelledby",s)):u.addClass(b);u.append(f);t.content&&(i.destroy(f.children()),f.html(t.content));t.actions.length&&e._createActionbar(u)},_createActionbar:function(t){var u=this.options.buttonLayout==="stretched",f=u?"stretched":"normal",i=n(r.actionbar({buttonLayout:f}));this._addButtons(i);u&&this._normalizeButtonSize(i);t.append(i)},_addButtons:function(t){for(var a,i=this,v=i.options,y=u(i._actionClick,i),p=u(i._actionKeyHandler,i),h=i.options.actions,o=h.length,s=Math.round(nt/o),e,l,f=0;f<o;f++)e=h[f],l=i._mergeTextWithOptions(e),a=n(r.action(e)).autoApplyNS(c).html(l).appendTo(t).data("action",e.action).on("click",y).on("keydown",p),v.buttonLayout==="stretched"&&(f==o-1&&(s=nt-f*s),a.css(g,s+"%"))},_mergeTextWithOptions:function(n){var t=n.text;return t?f(t)(this.options):""},_normalizeButtonSize:function(n){var u=this,f=u.options,t=n.children(a+":last"),i=parseFloat(t[0].style[g]),r=nt-f.actions.length*i;r>0&&t.css(g,i+r+"%")},_tabindex:function(n){var r=this,i=r.wrapper,u=i.find(w),f=i.find(l+" "+a),t;h.fn._tabindex.call(this,n);t=n.attr("tabindex");u.attr("tabIndex",t);f.attr("tabIndex",t)},_actionClick:function(n){this._runActionBtn(n.currentTarget)},_actionKeyHandler:function(n){vt(n)?this._runActionBtn(n.currentTarget):n.keyCode==o.ESC&&this.close()},_runActionBtn:function(t){var i=this,r,u;i._closing||(r=n(t).data("action"),u=ni(r)&&r({sender:i})===!1,u||i.close())},open:function(){var n=this,e=n.wrapper,r=this._animationOptions(p),s=n.options,t,o,f;return this._triggerInitOpen(),n.trigger(p)||(n._closing&&e.kendoStop(!0,!0),n._closing=!1,n.toFront(),s.visible=!0,s.modal&&(o=!!n._modals().length,t=n._overlay(o),t.kendoStop(!0,!0),r.duration&&i.effects.Fade&&!o?(f=i.fx(t).fadeIn(),f.duration(r.duration||0),f.endValue(.5),f.play()):t.css("opacity",.5),t.show()),e.show().kendoStop().kendoAnimate({effects:r.effects,duration:r.duration,complete:u(n._openAnimationEnd,n)}),e.show()),n},_animationOptions:function(n){var t=this.options.animation;return t&&t[n]||{open:{effects:{}},close:{hide:!0,effects:{}}}[n]},_openAnimationEnd:function(){this.options.modal&&this._focusDialog();this.trigger(ht)},_triggerInitOpen:function(){tt(this._initOpenTriggered)||(this._initOpenTriggered=!0,this.trigger(ot))},toFront:function(){var i=this,r=i.wrapper,t=+r.css(s),u=t;return i.center(),n(rt).each(function(i,r){var f=n(r),u=f.css(s);isNaN(u)||(t=Math.max(+u,t))}),(!r[0].style.zIndex||u<t)&&r.css(s,t+2),i.element.find("> .k-overlay").remove(),r=null,i},close:function(){return this._close(!0),this._stopCenterOnResize(),this},_close:function(n){var t=this,r=t.wrapper,f=t.options,e=this._animationOptions("open"),i=this._animationOptions("close");if(r.is(y)&&!t.trigger(st,{userTriggered:!n})){if(t._closing)return;t._closing=!0;f.visible=!1;this._removeOverlay();r.kendoStop().kendoAnimate({effects:i.effects||e.effects,reverse:i.reverse===!0,duration:i.duration,complete:u(this._closeAnimationEnd,this)})}return t},center:function(){this._center();this._centerOnResize()},_center:function(){var i=this,t=i.wrapper,r=n(window),u=0+Math.max(0,(r.width()-t.width())/2),f=0+Math.max(0,(r.height()-t.height()-parseInt(t.css("paddingTop"),10))/2);return t.css({left:u,top:f}),i},_centerOnResize:function(){if(!this._trackResize){i.onResize(this._centerCallback);this._trackResize=!0}},_stopCenterOnResize:function(){i.unbindResize(this._centerCallback);this._trackResize=!1},_removeOverlay:function(){var n=this._modals(),t=this.options,i=t.modal&&!n.length;i?this._overlay(!1).remove():n.length&&this._object(n.last())._overlay(!0)},_closeAnimationEnd:function(){var n=this,t;n._closing=!1;n.wrapper.hide().css("opacity","");n.trigger(d);n.options.modal&&(t=n._object(n._modals().last()),t&&t.toFront())},_modals:function(){var t=this,i=n(rt).filter(function(){var r=n(this),u=t._object(r),i=u&&u.options;return i&&i.modal&&t.options.appendTo==i.appendTo&&i.visible&&r.is(y)}).sort(function(t,i){return+n(t).css("zIndex")-+n(i).css("zIndex")});return t=null,i},_object:function(n){var u=n.children(ut),r=i.widgetInstance(u);return r?r:t},destroy:function(){var t=this;t._destroy();h.fn.destroy.call(t);t.wrapper.remove();t.wrapper=t.element=n()},_destroy:function(){var n=this,t="."+c;n.wrapper.off(t);n.element.off(t);n.wrapper.find(w+","+l+" > "+a).off(t);n._stopCenterOnResize()},title:function(t){var f=this,e=f.wrapper,h=f.options,u=e.children(ft),o=u.children(k),s=i.htmlEncode(t);return arguments.length?(t===!1?(u.remove(),e.addClass(b)):(u.length||(u=n(r.titlebar(h)).prependTo(e),o=u.children(k),e.removeClass(b)),o.html(s)),f.options.title=s,f):o.html()},content:function(n,t){var u=this,r=u.wrapper.children(ut);return tt(n)?(this.angular("cleanup",function(){return{elements:r.children()}}),i.destroy(r.children()),r.html(n),this.angular("compile",function(){for(var n=[],i=r.length;--i>=0;)n.push({dataItem:t});return{elements:r.children(),data:n}}),u.options.content=n,u):r.html()},_focusDialog:function(){this._defaultFocus&&this._focus(this._defaultFocus);this._tabKeyTrap.trap()},_focus:function(n){n&&n.focus()},events:[ot,p,st,ht,d],options:{title:"",buttonLayout:"stretched",actions:[],modal:!0,width:null,height:null,minWidth:0,minHeight:0,maxWidth:Infinity,maxHeight:Infinity,content:null,visible:null,appendTo:et,closable:!0}}),oi=it.extend({options:{name:"Dialog",messages:{close:"Close"}}}),e,yt,pt,wt,bt,kt,dt;i.ui.plugin(oi);e=it.extend({_init:function(n,t){var i=this;i.wrapperTemplate=r.alertWrapper;t._defaultFocus=null;i._ensureContentId(n);it.fn._init.call(i,n,t);i.bind(d,u(i.destroy,i));i._ariaDescribedBy();i._initFocus()},_ensureContentId:function(t){var r=n(t);r.attr("id")||r.attr("id",i.guid()+"_k-popup")},_ariaDescribedBy:function(){this.wrapper.attr("aria-describedby",this.element.attr("id"))},_initFocus:function(){var n=this.options;this._defaultFocus=this._chooseEntryFocus();this._defaultFocus&&n.visible&&n.modal&&this._focusDialog()},_chooseEntryFocus:function(){return this.wrapper.find(l+" > "+a)[0]},options:{title:window.location.host,closable:!1,messages:{okText:"OK",cancel:"Cancel",promptInput:"Input"}}});yt=e.extend({_init:function(n,t){var i=this;e.fn._init.call(i,n,t);i.wrapper.addClass(ri)},options:{name:"Alert",modal:!0,actions:[{text:"#: messages.okText #"}]}});i.ui.plugin(yt);pt=function(t){return n(r.alert).kendoAlert({content:t}).data("kendoAlert").open()};wt=e.extend({_init:function(t,i){var r=this;e.fn._init.call(r,t,i);r.wrapper.addClass(ui);r.result=n.Deferred()},options:{name:"Confirm",modal:!0,actions:[{text:"#: messages.okText #",primary:!0,action:function(n){n.sender.result.resolve()}},{text:"#: messages.cancel #",action:function(n){n.sender.result.reject()}}]}});i.ui.plugin(wt);bt=function(t){var i=n(r.confirm).kendoConfirm({content:t}).data("kendoConfirm").open();return i.result};kt=e.extend({_init:function(t,i){var r=this;e.fn._init.call(r,t,i);r.wrapper.addClass(fi);r._createPrompt();r.result=n.Deferred()},_createPrompt:function(){var t=this.options.value,i=n(r.promptInputContainer(this.options)).insertAfter(this.element);t&&i.children(v).val(t);this._defaultFocus=this._chooseEntryFocus();this._focusDialog()},_chooseEntryFocus:function(){return this.wrapper.find(v)[0]},options:{name:"Prompt",modal:!0,value:"",actions:[{text:"#: messages.okText #",primary:!0,action:function(n){var t=n.sender,i=t.wrapper.find(v).val();t.result.resolve(i)}},{text:"#: messages.cancel #",action:function(n){var t=n.sender,i=t.wrapper.find(v).val();n.sender.result.reject(i)}}]}});i.ui.plugin(kt);dt=function(t,i){var u=n(r.prompt).kendoPrompt({content:t,value:i}).data("kendoPrompt").open();return u.result};r={wrapper:f("<div class='k-widget k-window k-dialog' role='dialog' />"),action:f("<button type='button' class='k-button# if (data.primary) { # k-primary# } role='button' #'><\/button>"),titlebar:f("<div class='k-window-titlebar k-dialog-titlebar k-header'><span class='k-window-title k-dialog-title'>#: title #<\/span><div class='k-window-actions k-dialog-actions' /><\/div>"),close:f("<a role='button' href='\\#' class='k-button k-bare k-button-icon k-window-action k-dialog-action k-dialog-close' title='#: messages.close #' aria-label='#: messages.close #' tabindex='-1'><span class='k-icon k-i-close'><\/span><\/a>"),actionbar:f("<div class='k-button-group k-dialog-buttongroup k-dialog-button-layout-#: buttonLayout #' role='toolbar' />"),overlay:"<div class='k-overlay' />",alertWrapper:f("<div class='k-widget k-window k-dialog' role='alertdialog' />"),alert:"<div />",confirm:"<div />",prompt:"<div />",promptInputContainer:f("<div class='k-prompt-container'><input type='text' class='k-textbox' title='#: messages.promptInput #' aria-label='#: messages.promptInput #' /><\/div>")};i.alert=pt;i.confirm=bt;i.prompt=dt}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.scheduler.view",["kendo.core"],n)}(function(){return kendo.ui.scheduler={},function(n){function y(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 a(){return t.support.cssBorderSpacing?"":'cellspacing="0"'}function o(t,i){return t.length?"<table "+a()+' class="'+n.trim("k-scheduler-table "+(i||""))+'"><tr>'+t.join("<\/tr><tr>")+"<\/tr><\/table>":""}function nt(n,t){return n.length?"<div style='position:relative'>"+o(n,t)+"<\/div>":""}function tt(t,i,r){var u=[],f;if(r>0)for(f=0;f<t;f++)u.push("<th>&#8203;<\/th>");return(i&&u.push('<th class="k-scheduler-times-all-day">'+i.text+"<\/th>"),r<1)?n():n('<div class="k-scheduler-times">'+o(u)+"<\/div>")}function it(t,i,r){for(var f,h,c=[],u,e=0;e<t.length;e++){var s=t[e],l=[],p=i/s.length;for(u=0;u<s.length;u++)f=s[u],l.push('<th colspan="'+(f.colspan||p)+'" class="'+(f.className||"")+'">'+f.text+"<\/th>");c.push(l.join(""))}if(h=[],r){var a=t[t.length-1],v=[],y=r.cellContent;for(u=0;u<a.length;u++)v.push('<td class="'+(a[u].className||"")+'">'+(y?y(u):"&nbsp;")+"<\/td>");h.push(v.join(""))}return n('<div class="k-scheduler-header k-state-default"><div class="k-scheduler-header-wrap">'+o(c)+nt(h,"k-scheduler-header-all-day")+"<\/div><\/div>")}function rt(t,i){for(var u,e,s,h=new Array(i).join().split(","),c=[],r,f=0;f<t.length;f++)for(u=t[f],e=i/u.length,r=0;r<u.length;r++)s=u[r].className||"",u[r].allDay&&(s="k-scheduler-times-all-day"),h[e*r]+='<th class="'+s+'" rowspan="'+e+'">'+u[r].text+"<\/th>";for(r=0;r<i;r++)c.push(h[r]);return i<1?n():n('<div class="k-scheduler-times">'+o(c)+"<\/div>")}function ut(){return n('<div class="k-scheduler-content"><table '+a()+' class="k-scheduler-table"/><\/div>')}function at(){return h=h?h:t.support.scrollbar()}function vt(n,t,i){for(var e,r,o,u,f=n.length-1;f>=0;f--)e=c(n[f]),r=e.start,u=e.end,o=r<=t&&u>=t,(o||r>=t&&u<=i||t<=r&&i>=r)&&(r<t&&(t=r),u>i&&(i=u));return yt(n,t,i)}function c(n){return{start:n.start,end:n.end}}function yt(n,t,i){for(var r,f=[],u=0;u<n.length;u++)r=c(n[u]),(r.start<t&&r.end>t||r.start>=t&&r.end<=i)&&f.push(n[u]);return f}function pt(n){return w(n)}function wt(n){return w(n)}function w(n){for(var u,o,s,i=[],f=0;f<n.length;f++){var e=n[f],r=c(e),t=null;for(u=0,o=i.length;u<o;u++)if(s=r.start>i[u].end,r.start<i[u].start||s){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 b(t,i,r,u){var f=[];return n.each(i,function(n,i){var o=i.className?"k-slot-cell "+i.className:"k-slot-cell",e={text:i.text,className:o};e[t]=u&&!i.minorTicks?b(t,i.columns,r,u):r;f.push(e)}),f}function f(i,r,u,e,o,s){var h=r[0],a=[],l,c,v;if(h){if(o&&u)n.each(o,function(n,t){t[i]=s&&!t.minorTicks?f(i,r,t.columns,e,t.columns,s):f(i,r,null,e)}),a=o;else for(l=h.dataSource.view(),c=0;c<l.length;c++)v={text:e({text:t.htmlEncode(t.getter(h.dataTextField)(l[c])),color:t.getter(h.dataColorField)(l[c]),field:h.field,title:h.title,name:h.name,value:t.getter(h.dataValueField)(l[c])}),className:"k-slot-cell"},v[i]=f(i,r.slice(1),u,e),a.push(v);return a}return u}function bt(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 kt(n){n.className=n.className.replace(k,"")+" k-state-selected"}var t=window.kendo,v=t.ui,e=t.date.getDate,l=v.Widget,u=t._outerHeight,r=t.keys,d=".kendoSchedulerView",g=Math,ft='<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>',et=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 ht(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,i){return this._slotByPosition(n,t,this._daySlotCollections,i)},timeSlotByPosition:function(n,t,i){return this._slotByPosition(n,t,this._timeSlotCollections,i)},_slotByPosition:function(n,t,i,r){for(var s,e,o=0;o<i.length;o++)for(s=i[o],e=0;e<s.count();e++){var u=s.at(e),l=u.offsetWidth,a=u.offsetHeight,f,h=u.offsetLeft+l,c=u.offsetTop+a;if(r||(f=s.at(e+1)),f&&(f.offsetLeft!=u.offsetLeft?h=this._isRtl?u.offsetLeft+(u.offsetLeft-f.offsetLeft):f.offsetLeft:c=f.offsetTop),n>=u.offsetLeft&&n<h&&t>=u.offsetTop&&t<c)return u}},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(ot,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(st,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,i){var r=this,u=function(n,i,u){var f=u===0;if(!t&&!n&&f&&r.daySlotCollectionCount())return r._daySlotCollections[0].at(i)};return this.timeSlotCollectionCount()||(t=!0),this._verticalSlot(n,-1,u,i)},downSlot:function(n,t,i){var r=this,u=function(n,i,u){if(!t&&n&&r.timeSlotCollectionCount())return r._timeSlotCollections[u].at(0)};return this.timeSlotCollectionCount()||(t=!0),this._verticalSlot(n,1,u,i)},leftSlot:function(n,t){return this._horizontalSlot(n,-1,t)},rightSlot:function(n,t){return this._horizontalSlot(n,1,t)},_horizontalSlot:function(n,t,i){var f=n.index,r=n.isDaySlot,e=n.collectionIndex,o=this._getCollections(r),u;return r=i?!1:r,r?f+=t:e+=t,u=o[e],u?u.at(f):undefined},_verticalSlot:function(n,t,i,r){var f=n.index,u=n.isDaySlot,e=n.collectionIndex,s=this._getCollections(u),o;return(n=i(u,e,f),n)?n:(u=r?!1:u,u?e+=t:f+=t,o=s[e],o?o.at(f):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]}}),p=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}}),ot=p.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)}}),st=p.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}}),ht=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 ct(n,t,i,this._groupIndex,this._collectionIndex,this._slots.length,r);this._slots.push(u)},addDaySlot:function(n,t,i,r){var u=new lt(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]}}),s=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},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},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}}),ct=s.extend({init:function(n,t,i,r,u,f,e){s.fn.init.apply(this,arguments);this.isHorizontal=e?!0:!1},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}}),lt=s.extend({init:function(n,t,i,r,u,f,e){s.fn.init.apply(this,arguments);this.eventCount=e;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)},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}}),h,i,k;t.ui.SchedulerView=l.extend({init:function(i,r){l.fn.init.call(this,i,r);this._normalizeOptions();this._scrollbar=at();this._isRtl=t.support.isRtl(i);this._resizeHint=n();this._moveHint=n();this._cellId=t.guid();this._resourcesForGroups();this._selectedSlots=[]},visibleEndDate:function(){return this.endDate()},_normalizeOptions:function(){var n=this.options;n.startTime&&n.startTime.setMilliseconds(0);n.endTime&&n.endTime.setMilliseconds(0);n.workDayStart&&n.workDayStart.setMilliseconds(0);n.workDayEnd&&n.workDayEnd.setMilliseconds(0)},_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 et(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),this._isGroupedByDate()&&!i&&(n.groupIndex=t?this.groups.length-1:0),i},_changeDate:function(n,t,i){var f=this.groups[n.groupIndex],u,r,e;if(i){if(u=f._getCollections(!1),r=f.daySlotCollectionCount()?t.index-1:t.collectionIndex-1,r>=0)return u[r]._slots[u[r]._slots.length-1]}else if(u=f._getCollections(f.daySlotCollectionCount()),r=f.daySlotCollectionCount()?0:t.collectionIndex+1,e=f.daySlotCollectionCount()?t.collectionIndex+1:0,u[r]&&u[r]._slots[e])return u[r]._slots[e]},_changeGroupContinuously:function(){return null},_changeViewPeriod:function(){return!1},_isInRange:function(n,t){return!n||!t||!this.options.min||!this.options.max?!1:e(n)<=e(this.options.min)||e(t)>=e(this.options.max)},_horizontalSlots:function(n,t,i,r){var e=r?"leftSlot":"rightSlot",u={startSlot:t[0].start,endSlot:t[t.length-1].end},o=this.groups[n.groupIndex],c=this._isVerticallyGrouped(),s,h,f;return i||(s=this._normalizeHorizontalSelection(n,t,r),s&&(u.startSlot=u.endSlot=s)),this._isGroupedByDate()&&!i?(h=this._changeGroup(n,r),h?u.startSlot=u.endSlot=h:u=this._getNextHorizontalRange(o,e,u)):(u.startSlot=o[e](u.startSlot),u.endSlot=o[e](u.endSlot),i||c||u.startSlot&&u.endSlot||(u.startSlot=u.endSlot=this._changeGroup(n,r))),u.startSlot&&u.endSlot||this._isGroupedByDate()||(f=this._continuousSlot(n,t,r),f=this._changeGroupContinuously(n,f,i,r),f&&(u.startSlot=u.endSlot=f)),u},_getNextHorizontalRange:function(n,t,i){return this._isVerticallyGrouped()||(i.startSlot=n[t](i.startSlot),i.endSlot=n[t](i.endSlot)),i},_verticalSlots:function(n,t,i,r){var o=this.groups[n.groupIndex],f,u={startSlot:t[0].start,endSlot:t[t.length-1].end},e;return i||(f=this._normalizeVerticalSelection(n,t,r),f&&(u.startSlot=u.endSlot=f)),e=r?"upSlot":"downSlot",u=this._getNextVerticalRange(o,e,u,i),i||!this._isVerticallyGrouped()||u.startSlot&&u.endSlot||(u.startSlot=this._isGroupedByDate()?u.endSlot=this._changeDate(n,f,r):u.endSlot=this._changeGroup(n,r)),u},_getNextVerticalRange:function(n,t,i,r){return i.startSlot=n[t](i.startSlot,r),i.endSlot=n[t](i.endSlot,r),i},_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()?i.timeSlotCollectionCount()||(n.isAllDay=!0):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],a=this._isGroupedByDate()&&this._isVerticallyGrouped(),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,!a))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,a)))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){var e=n.groupIndex,o=this.groups[e],f=o.ranges(n.start,n.end,n.isAllDay,!1)[0].start,l=this.groups.length,h=t?-1:1,s=n.events,i,c,u;if(this._isGroupedByDate()){var a=this._getAllEvents(),v=this._getUniqueEvents(a),r=this._getSortedEvents(v);if(s.length===0)c=this._getNextEventIndexBySlot(f,r,e),t&&c--,i=r[c];else for(u=this._getStartIdx(s,r);u<r.length&&u>-1;){if(s.length>0&&(f=this._getSelectedSlot(f,r,i,u,h,t)),!f)break;if((!t&&r[u].start.startDate()>=f.startDate()||t&&r[u].start.startDate()<=f.startDate())&&s[0]!=r[u].uid){i=r[u];break}u+=h}}else while(e<l&&e>-1){if(i=this.moveToEventInGroup(o,f,s,t),e+=h,o=this.groups[e],!o||i)break;s=[];f=t?o.lastSlot():o.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)},_getNextEventIndexBySlot:function(n,i,r){for(var e,f=0,o=t.date.getDate(n.startDate()),u=0;u<i.length;u++){if(e=t.date.getDate(i[u].start.startDate()),o>e){f++;continue}if(o.getTime()===e.getTime()&&r>i[u].start.groupIndex){f++;continue}if(o.getTime()===e.getTime()&&r>=i[u].start.groupIndex&&n.startDate()>i[u].start.startDate()){f++;continue}break}return f},_getSelectedSlot:function(n,t,i,r,u,f){if(t[r+u]&&t[r].start.groupIndex!==t[r+u].start.groupIndex){var o=t[r+u].start.groupIndex,e=this.groups[o];(!e||i)&&(n=null);n=f?e.lastSlot():e.firstSlot(!0)}return n},_getStartIdx:function(t,i){var r=0;return n.each(i,function(){if(this.uid===t[0])return!1;r++}),r},_getAllEvents:function(){for(var t=[],i=this.groups,n=0;n<i.length;n++)i[n]._continuousEvents&&(t=t.concat(i[n]._continuousEvents));return t},_getUniqueEvents:function(n){for(var u,r,t=[],i=0;i<n.length;i++){for(u=!1,r=0;r<t.length;r++)if(n[i].uid===t[r].uid){u=!0;break}u||t.push(n[i])}return t},_getSortedEvents:function(i){return i.sort(function(i,r){var f=i.start.startDate(),e=r.start.startDate(),u=t.date.getDate(f)-t.date.getDate(e);return u===0&&(u=i.start.groupIndex-r.start.groupIndex),u===0&&(u=f.getTime()-e.getTime()),u===0&&(i.start.isDaySlot&&!r.start.isDaySlot&&(u=-1),!i.start.isDaySlot&&r.start.isDaySlot&&(u=1)),u===0&&(u=n(i.element).index()-n(r.element).index()),u})},_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),kt(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 e=!1,s=t.events,f=this._getAllEvents(),u,r,h=f.length,o=[],i;if(!s[0]||!f[0])return e;for(i=n(),t.events=[],u=0;u<h;u++)n.inArray(f[u].uid,s)>-1&&(r=f[u],i=i.add(r.element),t.events.indexOf(r.uid)===-1?t.events.push(r.uid):o.indexOf(r.uid)===-1&&o.push(r.uid));return i[0]&&(i.addClass("k-state-selected").attr("aria-selected",!0),o.indexOf(i.last().attr("data-uid"))===-1&&this.current(i.last()[0]),this._selectedSlots=[],e=!0),e},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(ft).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=y(t,"columns");u=this.rowLevels=y(t,"rows");this.table=n("<table "+a()+' class="k-scheduler-layout k-scheduler-'+this.name+'view"><tbody><\/tbody><\/table>');e=u[u.length-1].length;this.table.find("tbody:first").append(this._topSection(f,o,e));this.table.find("tbody:first").append(this._bottomSection(f,u,e));this.element.append(this.table);this._scroller()},refreshLayout:function(){for(var a,c,i=this,l=i.element.find(">.k-scheduler-toolbar"),f=i.element.innerHeight(),o=this._scrollbar,e=0,s=this._isRtl?"left":"right",h=0;h<l.length;h++)f-=u(l.eq(h));i.datesHeader&&(e=u(i.datesHeader));i.timesHeader&&u(i.timesHeader)>e&&(e=u(i.timesHeader));i.datesHeader&&i.timesHeader&&(a=i.datesHeader.find("table:first tr"),i.timesHeader.find("tr").height(function(t){n(this).height(a.eq(t).height())}));e&&(f-=e);i.footer&&(f-=u(i.footer));var v=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],y=t.support.kineticScrollNeeded?0:o;v(i.element)&&(f>o*2?i.content.height(f):i.content.height(o*2+1),i.times.height(r.clientHeight),c=i.times.find("table"),c.length&&c.height(i.content.find("table")[0].clientHeight));r.offsetWidth-r.clientWidth>0?(i.table.addClass("k-scrollbar-v"),i.datesHeader.css("padding-"+s,y-parseInt(i.datesHeader.children().css("border-"+s+"-width"),10))):i.datesHeader.css("padding-"+s,"");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=tt(t.length,i,r);var u=t[t.length-1].length;return this.datesHeader=it(t,u,i),n("<tr>").append(this.timesHeader.add(this.datesHeader).wrap("<td>").parent())},_bottomSection:function(t,i,r){return this.times=rt(i,r),this.content=ut(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"+d,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},_createDateLayout:function(n,t,i){return b("rows",n,t,i)},_createColumnsLayout:function(n,t,i,r,u){return f("columns",n,t,i,r,u)},_groupOrientation:function(){var n=this.options.group;return n&&n.resources?n.orientation:"horizontal"},_isGroupedByDate:function(){return this.options.group&&this.options.group.date},_isVerticallyGrouped:function(){return this.groupedResources.length&&this._groupOrientation()==="vertical"},_createRowsLayout:function(n,t,i,r){return f("rows",n,t,i,r)},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;l.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._isGroupedByDate()?f: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._isGroupedByDate()?f: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 g.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"};k=/\s*k-state-selected/;n.extend(v.SchedulerView,{createColumns:pt,createRows:wt,rangeIndex:c,collidingEvents:vt,groupEqFilter:bt})}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.scheduler.dayview",["kendo.scheduler.view"],n)}(function(){return function(n,t){function nt(n){var t=new Date(1980,1,1,0,0,0);return h(t,r(n)),t}function o(n,t,i){return n>=t&&n<=i}function a(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 st(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,b=i.ui,k=i.support.browser,h=i.date.setTime,f=b.SchedulerView,d=i._outerWidth,l=i._outerHeight,c=n.extend,tt=n.proxy,e=i.date.getDate,y=i.date.MS_PER_MINUTE,u=i.date.MS_PER_DAY,p="k-current-time",g="k-current-time-arrow",it=.8666,r=i.date.getMilliseconds,s=".kendoMultiDayView",rt=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>'),ut=i.template('<div title="(#=kendo.format("{0:t}", start)#): #=title.replace(/"/g,"&\\#34;")#"><div class="k-event-template">${title}<\/div><\/div>'),ft=i.template("<span class='k-link k-nav-day'>#=kendo.toString(date, 'ddd M/dd')#<\/span>"),et='<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-60-left"><\/span>#}## if(data.isException()) {#<span class="k-icon k-i-non-recurrence"><\/span># } else if(data.isRecurring()) {#<span class="k-icon k-i-reload"><\/span># } #<\/span>{0}<span class="k-event-actions">#if (showDelete) {#<a href="\\#" class="k-link k-event-delete" title="${data.messages.destroy}" aria-label="${data.messages.destroy}"><span class="k-icon k-i-close"><\/span><\/a>#}## if(data.head || data.middle) {#<span class="k-icon k-i-arrow-60-right"><\/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>',ot='<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-non-recurrence"><\/span># } else if(data.isRecurring()) {#<span class="k-icon k-i-reload"><\/span># } #<\/span>{0}<span class="k-event-actions">#if (showDelete) {#<a href="\\#" class="k-link k-event-delete" title="${data.messages.destroy}" aria-label="${data.messages.destroy}"><span class="k-icon k-i-close"><\/span><\/a>#}#<\/span><span class="k-event-top-actions"># if(data.tail || data.middle) {#<span class="k-icon k-i-arrow-60-up"><\/span># } #<\/span><span class="k-event-bottom-actions"># if(data.head || data.middle) {#<span class="k-icon k-i-arrow-60-down"><\/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>',v=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=st(i.options);i._templates();i._editable();i.calculateDateRange();i._groups();i._currentTime(!0)},_currentTimeMarkerUpdater:function(){this._updateCurrentTimeMarker(new Date)},_updateCurrentTimeMarker:function(t){var r=this.options,s,a,u,h,c,f,w,b;r.currentTimeMarker.useLocalTimezone===!1&&(s=r.dataSource.options.schema.timezone,r.dataSource&&s&&(a=i.timezone.offset(t,s),t=i.timezone.convert(t,t.getTimezoneOffset(),a)));this.times.find("."+p).remove();this.content.find("."+p).remove();var ut=!r.group||r.group.orientation=="horizontal"?1:this.groups.length,v=this.times.find("tr:first th:first"),y=this.times.find("tr:first th:last");for(u=0;u<ut;u++){if(h=this.groups[u],!h)return;if(c=i.date.toUtcTime(t),f=h.timeSlotRanges(c,c+1),f.length===0)return;if(w=f[0].collection,b=w.slotByStartDate(t),b){var nt="<div class='"+p+"'><\/div>",e=n(nt).prependTo(this.times),tt=Math.round(f[0].innerRect(t,new Date(t.getTime()+1),!1).top),o={},rt=this.content[0].scrollWidth;(k.msie||k.edge)&&(rt-=1);this._isRtl?(o.right=v.position().left+l(v)-l(y),e.addClass(g+"-left")):(o.left=y.position().left,e.addClass(g+"-right"));o.top=tt-d(e)*it/2;e.css(o);n(nt).prependTo(this.content).css({top:tt,height:"1px",right:0,width:rt,left:0})}}},_currentTime:function(n){var i=this,r=i.options.currentTimeMarker;r!==!1&&r.updateInterval!==t&&(i._currentTimeMarkerUpdater(),n&&(i._currentTimeUpdateTimer=setInterval(tt(this._currentTimeMarkerUpdater,i),r.updateInterval)))},_updateResizeHint:function(n,t,r,u){var v=n.isMultiDay(),g=this.groups[t],d=g.ranges(r,u,v,n.isAllDay),s,h,c,y,p,e,o,w,l,b,k,a;for(this._removeResizeHint(),p=0;p<d.length;p++)if(e=d[p],o=e.startSlot(),this._isGroupedByDate()&&v)for(w=o.index;w<=e.end.index;w++)l=e.collection._slots[w],s=l.offsetWidth,h=l.clientHeight,c=l.offsetTop,y=f.fn._createResizeHint.call(this,l.offsetLeft,c,s,h),this._resizeHint=this._resizeHint.add(y);else s=o.offsetWidth,h=o.clientHeight,c=o.offsetTop,v?s=e.innerWidth():(b=e.outerRect(r,u,this.options.snap),c=b.top,h=b.bottom-b.top),y=f.fn._createResizeHint.call(this,o.offsetLeft,c,s,h),this._resizeHint=this._resizeHint.add(y);k="t";a=this.content;v&&(k="M/dd",a=this.element.find(".k-scheduler-header-wrap:has(.k-scheduler-header-all-day) > div"),a.length||(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),k));this._resizeHint.last().addClass("k-last").find(".k-label-bottom").text(i.toString(i.timezone.toLocalDate(u),k))},_updateMoveHint:function(n,t,u){var o=n.isMultiDay(),k=this.groups[t],s=i.date.toUtcTime(n.start)+u,e=s+n.duration(),v=k.ranges(s,e,o,n.isAllDay),y,w,c,b,a;for(s=i.timezone.toLocalDate(s),e=i.timezone.toLocalDate(e),this._removeMoveHint(),!o&&(r(e)===0||r(e)<r(this.startTime()))&&v.length>1&&v.pop(),y=0;y<v.length;y++){var l=v[y],h=l.start,p,f={left:h.offsetLeft+2,top:h.offsetTop};if(this._isGroupedByDate()&&o)for(w=h.index;w<=l.end.index;w++)c=l.collection._slots[w],f.left=this._isRtl?c.clientWidth*.1+c.offsetLeft+2:c.offsetLeft+2,f.height=c.offsetHeight,f.width=c.clientWidth*.9-4,p=this._createEventElement(n.clone({start:s,end:e}),!o),this._appendMoveHint(p,f);else this._isRtl&&(f.left=h.clientWidth*.1+h.offsetLeft+2),o?f.width=l.innerWidth()-4:(b=l.outerRect(s,e,this.options.snap),f.top=b.top,f.height=b.bottom-b.top,f.width=h.clientWidth*.9-4),p=this._createEventElement(n.clone({start:s,end:e}),!o),this._appendMoveHint(p,f)}a=this.content;o&&(a=this.element.find(".k-scheduler-header-wrap:has(.k-scheduler-header-all-day) > div"),a.length||(a=this.content));this._moveHint.appendTo(a)},_appendMoveHint:function(n,t){n.addClass("k-event-drag-hint");n.css(t);this._moveHint=this._moveHint.add(n)},_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,this._isGroupedByDate()),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,t=this._isGroupedByDate();return n.length?this._groupOrientation()==="vertical"?t?this._columnCountForLevel(n.length-1):this._rowCountForLevel(n.length-1):t?this._columnCountForLevel(n.length)/this._columnCountForLevel(0):this._columnCountForLevel(n.length)/this._columnOffsetForResource(n.length):1},_columnCountInResourceView:function(){var n=this.groupedResources,t=this._isGroupedByDate();return!n.length||this._isVerticallyGrouped()?t?this._rowCountForLevel(0):this._columnCountForLevel(0):t?this._columnCountForLevel(0):this._columnOffsetForResource(n.length)},_timeSlotGroups:function(n,t){var l=this._timeSlotInterval(),y=n,w=this._isGroupedByDate(),p=this.content.find("tr:not(.k-scheduler-header-all-day)"),f,o,s,i,e,u,a,h,v,c;for(p.attr("role","row"),e=p.length,this._isVerticallyGrouped()&&(w&&(y=t),e=Math.floor(e/y)),u=0;u<y;u++)for(a=0,h=0,this._isVerticallyGrouped()?a=u:h=u,s=a*e;s<(a+1)*e;){if(v=p[s].children,s%e==0&&(o=r(new Date(+this.startTime()))),c=0,w)if(this._isVerticallyGrouped())for(i=0;i<n;i++)f=this.groups[i],this._addTimeSlotGroup(f,v,i,o,l,u);else for(f=this.groups[u],i=h;i<n*t;i=i+n)this._addTimeSlotGroup(f,v,i,o,l,c),c++;else for(f=this.groups[u],i=h*t;i<(h+1)*t;i++)this._addTimeSlotGroup(f,v,i,o,l,c),c++;o+=l;s++}},_addTimeSlotGroup:function(n,t,i,r,u,f){var o=t[i],h=n.getTimeSlotCollection(f),e=this._dates[f];if(e){var c=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()),s=c+r,l=s+u;o.setAttribute("role","gridcell");o.setAttribute("aria-selected",!1);h.addTimeSlot(o,s,l)}},_addDaySlotGroup:function(n,t,r,u,f){var o=t[r],e=this._dates[f],s;e&&(s=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()),o.setAttribute("role","gridcell"),o.setAttribute("aria-selected",!1),n.addDaySlot(o,s,s+i.date.MS_PER_DAY))},_daySlotGroups:function(n,t){var s,i,l=n,a=this._isGroupedByDate(),r,c,u,f,h,e,o;for(this._isVerticallyGrouped()?(a&&(l=t),s=this.element.find(".k-scheduler-header-all-day")):s=this.element.find(".k-scheduler-header-all-day tr"),s.attr("role","row"),r=0;r<l;r++)if(c=0,this._isVerticallyGrouped()&&(c=r),h=s[c].children,e=0,this._isVerticallyGrouped()||(e=r),o=0,a)if(this._isVerticallyGrouped())for(i=0;i<n;i++)u=this.groups[i],f=u.getDaySlotCollection(0),this._addDaySlotGroup(f,h,i,t,r);else for(u=this.groups[r],f=u.getDaySlotCollection(0),i=e;i<n*t;i=i+n)this._addDaySlotGroup(f,h,i,t,o),o++;else for(u=this.groups[r],f=u.getDaySlotCollection(0),i=e*t;i<(e+1)*t;i++)this._addDaySlotGroup(f,h,i,t,o),o++},_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++)this._dates[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:"&\\#8203;",groupHeaderTemplate:"#=text#",slotTemplate:"&nbsp;",allDaySlotTemplate:"&nbsp;",eventTemplate:rt,allDayEventTemplate:ut,dateHeaderTemplate:ft,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=c({},i.Template,n.templateSettings);this.eventTemplate=this._eventTmpl(n.eventTemplate,ot);this.allDayEventTemplate=this._eventTmpl(n.allDayEventTemplate,et);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-i-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:c({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:c({},{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 r=this,u=0;i.support.mobileOS.android&&(u=5);r.options.editable.create!==!1&&(r._addUserEvents=new i.UserEvents(r.element,{threshold:u,filter:".k-scheduler-content td",tap:function(i){var f;if(!n(i.target).parent().hasClass("k-scheduler-header-all-day")){var e=i.x.location!==t?i.x.location:i.x,o=i.y.location!==t?i.y.location:i.y,u=r._slotByPosition(e,o);u&&(f=r._resourceBySlot(u),r.trigger("add",{eventInfo:c({start:u.startDate(),end:u.endDate()},f)}));i.preventDefault()}}}),r._allDayUserEvents=new i.UserEvents(r.element,{threshold:u,filter:".k-scheduler-header-all-day td",tap:function(n){var e=n.x.location!==t?n.x.location:n.x,o=n.y.location!==t?n.y.location:n.y,u=r._slotByPosition(e,o),f;u&&(f=r._resourceBySlot(u),r.trigger("add",{eventInfo:c({},{isAllDay:!0,start:i.date.getDate(u.startDate()),end:i.date.getDate(u.startDate())},f)}));n.preventDefault()}}));r.options.editable.update!==!1&&(r._editUserEvents=new i.UserEvents(r.element,{threshold:u,filter:".k-event",tap:function(t){var u=n(t.target).closest(".k-event");u.hasClass("k-event-active")||r.trigger("edit",{uid:u.attr(i.attr("uid"))});t.preventDefault()}}))},_layout:function(n){for(var o,f,t=[],r=[],s=this.options,u=this,h=u._isGroupedByDate(),e=0;e<n.length;e++)o={},o.text=u.dateHeaderTemplate({date:n[e]}),i.date.isToday(n[e])&&(o.className="k-today"),t.push(o);return f=this.groupedResources,s.allDaySlot&&r.push({text:s.messages.allDay,allDay:!0,cellContent:function(t){var i=t;return t=f.length&&u._groupOrientation()!=="vertical"?t%n.length:t,u.allDaySlotTemplate({date:n[t],resources:function(){return u._resourceBySlot({groupIndex:i})}})}}),this._forTimeRange(this.startTime(),this.endTime(),function(n,t,i,f){var e=t?u.majorTimeHeaderTemplate:u.minorTimeHeaderTemplate,o={text:e({date:n}),className:f?"k-slot-cell":""};r.push(o)}),f.length&&(this._groupOrientation()==="vertical"?h?(r=this._createDateLayout(t,r),t=this._createColumnsLayout(f,null,this.groupHeaderTemplate)):r=this._createRowsLayout(f,r,this.groupHeaderTemplate):t=h?this._createColumnsLayout(f,t,this.groupHeaderTemplate,t):this._createColumnsLayout(f,t,this.groupHeaderTemplate)),{columns:t,rows:r}},_footer:function(){var t=this.options,i,r,u;if(t.footer!==!1){i='<div class="k-header k-scheduler-footer">';r=t.footer.command;r&&r==="workDay"?(i+='<ul class="k-reset k-header">',i+='<li class="k-state-default k-scheduler-fullday"><a href="#" class="k-link"><span class="k-icon k-i-clock"><\/span>',i+=(t.showWorkHours?t.messages.showFullDay:t.messages.showWorkDay)+"<\/a><\/li>",i+="<\/ul>"):i+="&nbsp;";i+="<\/div>";this.footer=n(i).appendTo(this.element);u=this;this.footer.on("click"+s,".k-scheduler-fullday",function(n){n.preventDefault();u.trigger("navigate",{view:u.name||t.name,date:t.date,isWorkDay:!t.showWorkHours})})}},_forTimeRange:function(n,t,i,f){n=nt(n);t=nt(t);var k=this,l=r(n),o=r(t),a=k.options.minorTickCount,d=k.options.majorTick*y,c=d/a||1,e=new Date(+n),g=e.getDate(),v,p=0,s,w="";for(s=u/c,l!=o&&(l>o&&(o+=u),s=(o-l)/c),s=Math.round(s);p<s;p++){var b=p%(d/c),tt=b===0,it=b<a-1,rt=b===a-1;w+=i(e,tt,it,rt);h(e,c,!1)}return o&&(v=r(e),g<e.getDate()&&(v+=u),v>o&&(e=new Date(+t))),f&&(w+=f(e)),w},_content:function(n){var t=this,v=t.options,y=t.startTime(),p=this.endTime(),r=1,h=1,c=n.length,u="",w=this.groupedResources,l=this.allDaySlotTemplate,f=!1,o,e=t._isGroupedByDate(),s=0,a,i;for(w.length&&(f=t._groupOrientation()==="vertical",f?(h=this._rowCountForLevel(this.rowLevels.length-2),e&&(r=this._columnCountForLevel(this.columnLevels.length-1)),v.allDaySlot&&(o=function(i){var f='<tr class="k-scheduler-header-all-day">',o=e?0:i,h=function(){return t._resourceBySlot({groupIndex:o})},u;if(e)for(;o<r;o++)f+="<td>"+l({date:n[s],resources:h})+"<\/td>";else for(u=0;u<n.length;u++)f+="<td>"+l({date:n[u],resources:h})+"<\/td>";return f+"<\/tr>"})):r=e?this._columnCountForLevel(this.columnLevels.length-1)/this._columnCountForLevel(0):this._columnCountForLevel(this.columnLevels.length-2)),u+="<tbody>",a=function(u,o){var a="",l=0,h,v,y;if(a="<tr"+(o?' class="k-middle-row"':"")+">",e)for(h=0,v=c;h<v;h++){for(l=0;l<r;l++)y=h,f&&(y=s),a=t._addCellsToContent(a,n,u,y,l,i);if(f)break}else for(;l<r;l++)for(h=0,v=c;h<v;h++)a=t._addCellsToContent(a,n,u,h,l,i);return a+"<\/tr>"},i=0;i<h;i++)u+=o?o(i):"",u+=this._forTimeRange(y,p,a),f&&s++;u+="<\/tbody>";this.content.find("table").append(u)},_addCellsToContent:function(n,t,r,u,f,e){var h=this,o="",s,c=this.slotTemplate,l=this._groupOrientation()==="vertical",a=function(n){return function(){return h._resourceBySlot({groupIndex:n})}};return i.date.isToday(t[u])&&(o+="k-today"),(i.date.getMilliseconds(r)<i.date.getMilliseconds(this.options.workDayStart)||i.date.getMilliseconds(r)>=i.date.getMilliseconds(this.options.workDayEnd)||!this._isWorkDay(t[u]))&&(o+=" k-nonwork-hour"),n+="<td"+(o!==""?' class="'+o+'"':"")+">",s=i.date.getDate(t[u]),i.date.setTime(s,i.date.getMilliseconds(r)),n+=c({date:s,resources:a(l&&!h._isGroupedByDate()?e:f)}),n+"<\/td>"},_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.element.on("click"+s,".k-nav-day",function(t){var u=n(t.currentTarget).closest("th"),f=u.offset(),e=0,r=l(u),o;i._isGroupedByDate()&&(i._isVerticallyGrouped()?(e=d(i.times),r=0):r=l(i.datesHeader));o=i._slotByPosition(f.left+e,f.top+r);i.trigger("navigate",{view:"day",date:o.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);if(n.isAllDay)return t;var 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*y},_timeSlotIndex:function(n){var t=this.options,i=r(n),u=r(this.startTime()),f=t.majorTick/t.minorTickCount*y;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,h){var ut=f?this.eventTemplate:this.allDayEventTemplate,it=this.options,p=it.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"),rt,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?rt=!0:e(a)<d||f&&b<g?h=!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=c({},{ns:i.ns,resizable:ot,showDelete:et,middle:rt,head:s,tail:h,singleDay:this._dates.length==1,resources:y,inverseColor:y&&y[0]?this._shouldInverseResourceColor(y[0]):!1,messages:it.messages},t,{start:a,end:l}),tt=n(ut(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),h(t,u-1)),n._date("end")>n._date("start")&&(e=+n._date("end")+(u-1)),e=r(new Date(e)),f=r(new Date(f)),t=r(t),o=r(o),o===f&&f===e)?!0:(s=f!==t,a(f,o,t,s)||a(e,o,t,s)||a(o,f,e)||a(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 ut=this.datesHeader.find(".k-scheduler-header-wrap > div"),ft=this._isGroupedByDate(),r,h,y,f,o,i,s,l,e,p,c,d,rt,g,nt,b,k,a,tt,v=0,it=n.length;v<it;v++)if(r=n[v],this._isInDateSlot(r))if(h=r.isAllDay||r.duration()>=u,y=h&&!this._isVerticallyGrouped()?ut:this.content,h){if(this.options.allDaySlot&&(e=this.groups[t],e._continuousEvents||(e._continuousEvents=[]),o=e.slotRanges(r),o.length))if(i=o[0],g=i.start.index,nt=i.end.index,ft&&g!==nt)for(s=i.start.start,l=i.end.end,b=new Date(s),k=new Date(s),a=i.start.index;a<=i.end.index;a++)f=this._createEventElement(r,!h,a!==nt,a!==g),tt=e.daySlotRanges(b,k,!0)[0],k.setDate(k.getDate()+1),b.setDate(b.getDate()+1),this._positionAllDayEvent(f,tt),w(e,tt,f,!0),f.appendTo(y);else f=this._createEventElement(r,!h),this._positionAllDayEvent(f,o[0]),w(e,o[0],f,!0),f.appendTo(y)}else if(this._isInTimeSlot(r))for(e=this.groups[t],e._continuousEvents||(e._continuousEvents=[]),o=e.slotRanges(r),p=o.length,c=0;c<p;c++)i=o[c],s=r.start,l=r.end,p>1&&(c===0?l=i.end.endDate():c==p-1?s=i.start.startDate():(s=i.start.startDate(),l=i.end.endDate())),d=r.clone({start:s,end:l,_startTime:r._startTime,_endTime:r.endTime}),this._isInTimeSlot(d)&&(rt=i.head,f=this._createEventElement(r,!h,rt,i.tail),f.appendTo(y),this._positionEvent(d,f,i),w(e,i,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._currentTime(!1);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 w,l;if(!i){var a=t?this.previousDate():this.nextDate(),b=n.start,v=n.end,k=this._isGroupedByDate()&&this._isVerticallyGrouped(),f=this.groups[n.groupIndex],y=t?f._timeSlotCollections:f._getCollections(f.daySlotCollectionCount()),o=y[y.length-1]._slots,p=!t&&!f.daySlotCollectionCount()?0:o.length-1,e,s,c;return(s=new Date(a),c=new Date(a),this._isInRange(s,c))?!1:(n.start=s,n.end=c,k?(w=new Date(o[p].startDate()),l=new Date(o[p].endDate()),e=r(l)?r(l):u,h(n.start,r(w)),h(n.end,e),f.daySlotCollectionCount()&&(n.isAllDay=!n.isAllDay)):(e=n.isAllDay||!r(v)?u:r(v),h(n.start,r(b)),h(n.end,e)),this._isVerticallyGrouped()||(n.groupIndex=t?this.groups.length-1:0),n.events=[],!0)}}});c(!0,b,{MultiDayView:v,DayView:v.extend({options:{name:"DayView",title:"Day"},name:"day"}),WeekView:v.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:v.extend({options:{name:"WorkWeekView",title:"Work Week",selectedDateFormat:"{0:D} - {1:D}",selectedShortDateFormat:"{0:d} - {1:d}"},name:"workWeek",nextDate:function(){var n=i.date.dayOfWeek(i.date.nextDay(this.startDate()),this.calendarInfo().firstDay,1);return i.date.addDays(n,this._workDays[0])},previousDate:function(){var t=i.date.dayOfWeek(this.startDate(),this.calendarInfo().firstDay,-1),n=this._workDays;return i.date.addDays(t,n[n.length-1]-7)},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),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.scheduler.agendaview",["kendo.scheduler.view"],n)}(function(){return function(n){function s(n){for(var i=0,t=0,r=n.length;t<r;t++)i+=n[t].items.length;return i}function h(n,i){return n.valuePrimitive&&(i=t.getter(n.dataValueField)(i)),i}function c(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-non-recurrence"><\/span># } else if (data.isRecurring()) {#<span class="k-icon k-i-reload"><\/span># } #{0}#if (showDelete) {#<a href="\\#" class="k-link k-event-delete" title="${data.messages.destroy}" aria-label="${data.messages.destroy}"><span class="k-icon k-i-close"><\/span><\/a>#}#<\/div>',e=t.Class.extend({init:function(n){this._view=n},_getColumns:function(n,t){return n.concat(t)},_getGroupsInDay:function(){return[]},_getSumOfItemsForDate:function(){return 0},_renderTaskGroupsCells:function(n,t,i,r){var u=this._view;i===0&&r===0&&t.length&&u._renderTaskGroupsCells(n,t)},_renderDateCell:function(n,i,r,u,f,e){var o=this._view;n.push(t.format('<td class="k-scheduler-datecolumn{3}{2}" rowspan="{0}">{1}<\/td>',r.length,o._dateTemplate({date:u}),f==e.length-1&&!i.length?" k-last":"",i.length?"":" k-first"))},_renderDates:function(){return undefined},_getParents:function(n){return n.splice(0)},_getGroupsByDate:function(){return undefined},_renderTaskGroups:function(n,t,i){var r=this._view;n.append(r._renderTaskGroups(t,i))}}),o=t.Class.extend({init:function(n){this._view=n},_getColumns:function(n,t){var u=this._view,i,r;return u._isMobilePhoneView()?n.concat(t):(i=t.slice(0,1),r=t.slice(1),i.concat(n).concat(r))},_compareDateGroups:function(n,t,i){return n[i].text==t[i].text?i===0?!0:this._compareDateGroups(n,t,i-1):!1},_getGroupsInDay:function(n,t){for(var f,i,s,e,r=[],o=null,u=0;u<n.length;u++)for(f=0;f<n[u].items.length;f++){if(i=0,r.length===0)for(i;i<t[u].length;i++)r.push([1]);else for(i;i<t[u].length;i++)if(this._compareDateGroups(t[u],o,i))r[i][r[i].length-1]++;else{for(s=r[i][r[i].length-1]-1,e=0;e<s;e++)r[i].push(0);r[i].push(1)}o=t[u]}return r},_getSumOfItemsForDate:function(n){for(var i=0,t=0;t<n.length;t++)i+=n[t].items.length;return i},_renderTaskGroupsCells:function(n,i,r,u,f,e,o,s){var c=this._view,l=c._isMobilePhoneView(),h;if(l)r===0&&u===0&&i.length&&c._renderTaskGroupsCells(n,i);else for(r===0&&u===0&&n.push(t.format('<td class="k-scheduler-datecolumn k-first" rowspan="{0}">{1}<\/td>',e,c._dateTemplate({date:o}))),h=0;h<i[r].length;h++)f[h][s]&&n.push(t.format('<td class="k-scheduler-groupcolumn" rowspan="{0}">{1}<\/td>',f[h][s],c._groupTemplate({value:i[r][h].text}),i[r][h].className))},_renderDateCell:function(){return undefined},_renderDates:function(n){for(var r=this._view,i=r._groupsByDate.sort(function(n,t){return n.array[0].value.getTime()-t.array[0].value.getTime()}),t=0;t<i.length;t++)n.append(r._renderTaskGroups(i[t].array,i[t].groups))},_getParents:function(n){return n.slice(0)},_getGroupsByDate:function(n,t,i){var f=this._view,r,o,e,u;if(n[t].items)for(r=0;r<n[t].items.length;r++){for(o=n[t].items[r].value,e=!1,u=0;u<f._groupsByDate.length;u++)f._groupsByDate[u].array[0].value.getTime()===o.getTime()&&(e=!0,f._groupsByDate[u].array.push(n[t].items[r]),f._groupsByDate[u].groups.push(i));e||f._groupsByDate.push({array:[n[t].items[r]],groups:[i]})}},_renderTaskGroups:function(){return undefined}});t.ui.scheduler.AgendaGroupedView=e;t.ui.scheduler.AgendaGroupedByDateView=o;i.AgendaView=i.SchedulerView.extend({init:function(u,e){i.SchedulerView.fn.init.call(this,u,e);this._groupedView=this._getGroupedView();e=this.options;e.editable&&(e.editable=n.extend({"delete":!0},e.editable,{create:!1,update:!1},{messages:e.messages}));this.title=e.title;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-i-close)","_remove");this._renderLayout(e.date)},name:"agenda",_getGroupedView:function(){return this._isGroupedByDate()?new t.ui.scheduler.AgendaGroupedByDateView(this):new t.ui.scheduler.AgendaGroupedView(this)},_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=this._groupedView._getColumns(i,n)}return{columns:n}},_tasks:function(n){for(var i,o,s=[],h=0;h<n.length;h++){var r=n[h],u=r.start,f=r.isAllDay?t.date.getDate(r.end):r.end,e=Math.ceil((f-t.date.getDate(u))/t.date.MS_PER_DAY);if(r.isAllDay&&(e+=1),i=r.clone(),i.startDate=t.date.getDate(u),i.startDate>=this.startDate()&&s.push(i),e>1)for(i.end=t.date.nextDay(u),i.head=!0,o=1;o<e;o++)u=i.end,i=r.clone(),i.start=i.startDate=t.date.getDate(u),i.end=t.date.nextDay(u),o==e-1?(i.end=new Date(i.start.getFullYear(),i.start.getMonth(),i.start.getDate(),f.getHours(),f.getMinutes(),f.getSeconds(),f.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())&&s.push(i)}return new t.data.Query(s).sort([{field:"start",dir:"asc"},{field:"end",dir:"asc"}]).groupBy({field:"startDate"}).toArray()},_renderTaskGroups:function(n,i){for(var f,s=[],l=this.options.editable,p=l&&l.destroy!==!1&&!this._isMobile(),a=this._isMobilePhoneView(),w=this._groupedView._getSumOfItemsForDate(n),b=this._groupedView._getGroupsInDay(n,i),v=0,u=0;u<n.length;u++){var e=n[u].value,h=n[u].items,y=t.date.isToday(e);for(f=0;f<h.length;f++){var r=h[f],o=[],c=a?[]:o;this._groupedView._renderTaskGroupsCells(c,i,u,f,b,w,e,v);v++;f===0&&(a?(c.push(t.format('<td class="k-scheduler-datecolumn" colspan="2">{0}<\/td>',this._dateTemplate({date:e}))),s.push('<tr role="row" aria-selected="false"'+(y?' class="k-today">':">")+c.join("")+"<\/tr>")):this._groupedView._renderDateCell(o,i,h,e,u,n));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-60-left"><\/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-60-right"><\/span>':"",this._eventTemplate(r.clone({showDelete:p,messages:this.options.messages}))));s.push('<tr role="row" aria-selected="false"'+(y?' class="k-today">':">")+o.join("")+"<\/tr>")}}return s.join("")},_renderTaskGroupsCells:function(n,i){for(var r=0;r<i.length;r++)n.push(t.format('<td class="k-scheduler-groupcolumn{2}" rowspan="{0}">{1}<\/td>',i[r].rowSpan,this._groupTemplate({value:i[r].text}),i[r].className))},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._groupsByDate=[],this._renderGroups(t,i,[]),this._groupedView._renderDates(i)):(t=this._tasks(n),i.append(this._renderTaskGroups(t,[]))));u=this._eventsList=c(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=this._groupedView._getParents(i),u.push(n[r]),this._groupedView._getGroupsByDate(n,r,u),n[r].groups?this._renderGroups(n[r].groups,t,u):this._groupedView._renderTaskGroups(t,n[r].items,u)},_createGroupConfiguration:function(n,r,u){for(var v,l,w,y,f,a,o=r[0],p=[],c=o.dataSource.view(),b=this._isMobilePhoneView(),e=0;e<c.length;e++)v=h(o,c[e]),l=new t.data.Query(n).filter({field:o.field,operator:i.SchedulerView.groupEqFilter(v)}).toArray(),l.length&&(w=this._tasks(l),y=u?"":" k-first",e===c.length-1&&(!u||u.className.indexOf("k-last")>-1)&&(y+=" k-last"),f={text:t.getter(o.dataTextField)(c[e]),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=s(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),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.scheduler.monthview",["kendo.scheduler.view"],n)}(function(){return function(n){function b(n,t){return n.slice(t).concat(n.slice(0,t))}function k(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 e(n,t,i){var u=t,f=i,r;return r=n,r>=u&&r<=f}var t=window.kendo,s=t.ui,r=s.SchedulerView,f=".kendoMonthView",o=n.extend,h=t.date.getDate,c=t.date.MS_PER_DAY,u=6,i=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-60-left"><\/span>#}## if(data.isException()) {#<span class="k-icon k-i-non-recurrence"><\/span># } else if(data.isRecurring()) {#<span class="k-icon k-i-reload"><\/span>#}#<\/span>{0}<span class="k-event-actions">#if (showDelete) {#<a href="\\#" class="k-link k-event-delete" title="${data.messages.destroy}" aria-label="${data.messages.destroy}"><span class="k-icon k-i-close"><\/span><\/a>#}## if(data.head || data.middle) {#<span class="k-icon k-i-arrow-60-right"><\/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>'),p=t.Class.extend({init:function(n){this._view=n},_verticalRowCountForLevel:function(n){var t=this._view;return t._rowCountForLevel(n)},_horizontalGroupCountForLevel:function(n){var t=this._view;return t._columnCountForLevel(n)},_getCalendarRowsLength:function(n,t){return t/n},_createRows:function(n,t,r,u){for(var e=this._view,s=i,h=e._isVerticallyGrouped(),o="",f=0;f<r;f++)o+=e._createRow(n,t,s,h?u:f);return o},_adjustStartDate:function(n){return t.date.addDays(n,i)},_getContent:function(n,t,i){return n({date:t,resources:i})},_getTimeSlotByPosition:function(n,t,i){var r=this._view.groups[i];return r.daySlotByPosition(n,t)},_nextSlotStartDate:function(n){return t.date.nextDay(n)},_createRowsLayout:function(n,t,i){var r=this._view;return r._createRowsLayout(n,t,i)},_createVerticalColumnsLayout:function(n,t,i,r){return r},_createColumnsLayout:function(n,t,i){var r=this._view;return r._createColumnsLayout(n,t,i)},_verticalGroupCount:function(n){var t=this._view;return t._rowCountForLevel(n)},_horizontalGroupCount:function(n){var t=this._view;return t._columnCountForLevel(n)/t._columnOffsetForResource(n)},_positionEvent:function(n,t,i,r,u,f,e){var o=this._view,h=o._isMobilePhoneView(),s;r>1&&(e===0?f=i.end.endDate():e==r-1?u=i.start.startDate():(u=i.start.startDate(),f=i.end.endDate()));s=n.clone({start:u,end:f,head:i.head,tail:i.tail});h?o._positionMobileEvent(i,o._createEventElement(s),t):o._positionEvent(i,o._createEventElement(s),t)},_addDaySlotCollections:function(n,r,f){for(var o,h,c,l,w,s=this._view,a=i,y=u,e=0;e<n;e++)for(o=0,h=0,s._isVerticallyGrouped()&&(h=e),c=h*y;c<(h+1)*y;c++){var b=s.groups[e],k=b.addDaySlotCollection(t.date.addDays(f,o),t.date.addDays(f,o+a)),p=r[c],d=p.children,v=0;for(p.setAttribute("role","row"),s._isVerticallyGrouped()||(v=e),l=v*a;l<(v+1)*a;l++)w=d[l],s.addDaySlot(k,w,f,o),o++}},_changePeriodGroupIndex:function(n){var t=this._view;return n?t.groups.length-1:0},_createResizeHint:function(n){var t=this._view,i=n.startSlot().offsetLeft,u=n.start.offsetTop,f=n.innerWidth(),e=n.start.clientHeight-2,o=r.fn._createResizeHint.call(t,i,u,f,e);t._appendResizeHint(o)},_createMoveHint:function(n,t){var r=this._view,i=n.startSlot(),f=n.endSlot(),u=r._createEventElement(t.clone({head:n.head,tail:n.tail}));u.css({left:i.offsetLeft+2,top:i.offsetTop+i.firstChildHeight,height:r.options.eventHeight,width:n.innerWidth()-(i.index!==f.index?5:4)});u.addClass("k-event-drag-hint");r._appendMoveHint(u)}}),w=t.Class.extend({init:function(n){this._view=n},_verticalRowCountForLevel:function(){return 1},_horizontalGroupCountForLevel:function(n){var t=this._view;return t._columnCountForLevel(n+1)/i},_createRows:function(n,r,f){var o=this._view,h=i,a=o._isVerticallyGrouped(),c="",e=0,s,l;if(a){for(s=new Date(n),l=o._groupCount(),e;e<u;e++)c+=o._createRow(s,r,l,e),s=t.date.addDays(s,h);n=t.date.nextDay(n)}else{for(e;e<h;e++)c+=o._createRow(n,r,f,e),n=t.date.nextDay(n);n=t.date.addDays(n,h)}return c},_adjustStartDate:function(n,r){var f=this._view,e=f._isVerticallyGrouped();return e?r?t.date.addDays(n,i*(u-1)+1):t.date.nextDay(n):t.date.addDays(n,i)},_getContent:function(n,t,i,r){return r===0?n({date:t,resources:i}):""},_getTimeSlotByPosition:function(n,t,i){var r=this._view.groups[i];return r.daySlotByPosition(n,t,!0)},_nextSlotStartDate:function(n){return n},_getCalendarRowsLength:function(){var n=this._view,t=n._isVerticallyGrouped();return t?i:u},_createRowsLayout:function(n,t,i,r){var u=this._view;return u._createDateLayout(r,null,!1)},_createVerticalColumnsLayout:function(n,i,r){for(var s,c=this._view,f=n[0],h=[],e=f.dataSource.view(),o=0;o<e.length*u;o++)s={text:r({text:t.htmlEncode(t.getter(f.dataTextField)(e[o%e.length])),color:t.getter(f.dataColorField)(e[o%e.length]),field:f.field,title:f.title,name:f.name,value:t.getter(f.dataValueField)(e[o%e.length])}),className:"k-slot-cell"},s.columns=c._createColumnsLayout(n.slice(1),null,r),h.push(s);return h},_createColumnsLayout:function(n,t,i,r){var u=this._view;return u._createColumnsLayout(n,t,i,r,!0)},_verticalGroupCount:function(n){var t=this._view;return t._columnCountForLevel(n)/u},_horizontalGroupCount:function(n){var t=this._view;return t._columnCountForLevel(n)/i},_positionEvent:function(n,t,i,r,u,f){for(var o=this._view,h=i.start.index,c=i.end.index,v=o._isMobilePhoneView(),e=i.start.index;e<=i.end.index;e++){var s=i.collection._slots[e],l=t.daySlotRanges(s.start,s.start,!0)[0],a=n.clone({start:e===h?s.start:u,end:e===c?s.end:f,head:e!==c||i.head,tail:e!==h||i.tail});v?o._positionMobileEvent(l,o._createEventElement(a),t):o._positionEvent(l,o._createEventElement(a),t)}},_addDaySlotCollections:function(n,r,f){for(var e,s,h=this._view,c=i,k=u,l=h._isVerticallyGrouped(),o=0;o<c;o++)for(e=0;e<k;e++){var y=0,d=l?o:e,p=r[d],g=p.children,a=0;for(p.setAttribute("role","row"),h._isVerticallyGrouped()||(a=o),s=a*n;s<(a+1)*n;s++){var v=e*c+o,nt=l?s+e*n:s,tt=g[nt],it=l?s:y,w=h.groups[it],b;b=o===0?w.addDaySlotCollection(t.date.addDays(f,v),t.date.addDays(f,v+c)):w._daySlotCollections[e];h.addDaySlot(b,tt,f,v);y++}}},_changePeriodGroupIndex:function(n,t,i){var r=this._view;return t&&r._isVerticallyGrouped()?n?r.groups.length-1:0:i},_createResizeHint:function(n){var t=this._view,u,f,e,o,s,h,i;if(t._isVerticallyGrouped())u=n.startSlot().offsetLeft,f=n.start.offsetTop,e=n.startSlot().offsetWidth,o=n.endSlot().offsetTop+n.startSlot().offsetHeight-n.startSlot().offsetTop-2,s=r.fn._createResizeHint.call(t,u,f,e,o),t._appendResizeHint(s);else for(h=n.startSlot().index;h<=n.endSlot().index;h++)i=n.collection._slots[h],u=i.offsetLeft,f=i.offsetTop,e=i.offsetWidth,o=i.offsetHeight-2,s=r.fn._createResizeHint.call(t,u,f,e,o),t._appendResizeHint(s)},_createMoveHint:function(n,t){for(var i,r,u=this._view,e=n.startSlot(),o=n.endSlot(),f=e.index;f<=o.index;f++)i=n.collection._slots[f],r=u._createEventElement(t.clone({head:n.head,tail:n.tail})),r.css({left:i.offsetLeft,top:i.offsetTop+i.firstChildHeight,height:u.options.eventHeight,width:i.offsetWidth-2}),r.addClass("k-event-drag-hint"),u._appendMoveHint(r)}});t.ui.scheduler.MonthGroupedView=p;t.ui.scheduler.MonthGroupedByDateView=w;s.MonthView=r.extend({init:function(n,t){var i=this;r.fn.init.call(i,n,t);i._groupedView=i._getGroupedView();i.title=i.options.title;i._templates();i._editable();i._renderLayout(i.options.date);i._groups()},name:"month",_getGroupedView:function(){return this._isGroupedByDate()?new t.ui.scheduler.MonthGroupedByDateView(this):new t.ui.scheduler.MonthGroupedView(this)},_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)}},_changeDate:function(n,t,i){var f=this.groups[n.groupIndex],u,r,e;if(i){if(u=f._getCollections(f.daySlotCollectionCount()),r=t.collectionIndex-1,r>=0)return u[r]._slots[u[r]._slots.length-1]}else if(u=f._getCollections(f.daySlotCollectionCount()),r=t.collectionIndex+1,e=0,u[r]&&u[r]._slots[e])return u[r]._slots[e]},_getNextHorizontalRange:function(n,t,i){var r=this._isVerticallyGrouped();return i.startSlot=n[t](i.startSlot,r),i.endSlot=n[t](i.endSlot,r),i},_getNextVerticalRange:function(n,t,i,r){var u=this._isVerticallyGrouped()&&this._isGroupedByDate();return i.startSlot=n[t](i.startSlot,r,u),i.endSlot=n[t](i.endSlot,r,u),i},_changeViewPeriod:function(n,i,r){var u=r?7:1,f,e;return(i&&(u*=-1),f=t.date.addDays(n.start,u),e=t.date.addDays(n.end,u),this._isInRange(f,e))?!1:(n.start=f,n.end=e,(!r||r&&this._isVerticallyGrouped())&&(n.groupIndex=this._groupedView._changePeriodGroupIndex(i,r,n.groupIndex)),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=o({},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 r=this;this._firstDayOfMonth=t.date.firstDayOfMonth(i);this._lastDayOfMonth=t.date.lastDayOfMonth(i);this._startDate=k(i,this.calendarInfo());this.createLayout(this._layout());this._content();this.refreshLayout();this.content.on("click"+f,".k-nav-day,.k-more-events",function(t){var i=n(t.currentTarget).offset(),u=r._slotByPosition(i.left,i.top);t.preventDefault();r.trigger("navigate",{view:"day",date:u.startDate()})})},_editable:function(){this.options.editable&&!this._isMobilePhoneView()&&(this._isMobile()?this._touchEditable():this._mouseEditable())},_mouseEditable:function(){var i=this;i.element.on("click"+f,".k-scheduler-monthview .k-event a:has(.k-i-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"+f,".k-scheduler-monthview .k-scheduler-content td",function(t){var u=n(t.currentTarget).offset(),r=i._slotByPosition(u.left,u.top),f;r&&(f=i._resourceBySlot(r),i.trigger("add",{eventInfo:o({isAllDay:!0,start:r.startDate(),end:r.startDate()},f)}));t.preventDefault()});if(i.options.editable.update!==!1)i.element.on("dblclick"+f,".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),f;r&&(f=i._resourceBySlot(r),i.trigger("add",{eventInfo:o({isAllDay:!0,start:r.startDate(),end:r.startDate()},f)}));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-i-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,u=this._groupedView,r=this.groupedResources,n;for(r.length&&this._isVerticallyGrouped()&&(i=u._verticalRowCountForLevel(r.length-1)),n=0;n<i;n++)t+=this._createCalendar(n);t+="<\/tbody>";this.content.find("table").html(t)},_createCalendar:function(n){var r=this.startDate(),y=i*u,h=i,c=[r],e="",l=1,p=this._isVerticallyGrouped(),o=this._groupedView,a=this.groupedResources,s,f,v;for(a.length&&(p||(l=o._horizontalGroupCountForLevel(a.length-1))),this._slotIndices={},s=o._getCalendarRowsLength(h,y),f=0;f<s;f++)e+="<tr>",c.push(r),v=f*h,e+=o._createRows(r,v,l,n),r=o._adjustStartDate(r,f===s-1),e+="<\/tr>";return this._weekStartDates=c,this._endDate=t.date.previousDay(r),e},_createRow:function(n,i,r,u){for(var e=this,l=e._firstDayOfMonth,a=e._lastDayOfMonth,v=e.dayTemplate,o="",f="",c=this._groupedView,y=function(){return e._resourceBySlot({groupIndex:u})},s=0;s<r;s++)o="",t.date.isToday(n)&&(o+="k-today"),t.date.isInDateRange(n,l,a)||(o+=" k-other-month"),f+="<td ",o!==""&&(f+='class="'+o+'"'),f+=">",f+=c._getContent(v,n,y,s),f+="<\/td>",e._slotIndices[h(n).getTime()]=i+s,n=c._nextSlotStartDate(n);return f},_layout:function(){var u=this.calendarInfo(),s=this._isMobile()?u.days.namesShort:u.days.names,h=b(s,u.firstDay),t=n.map(h,function(n){return{text:n}}),i=this.groupedResources,o,f=this._groupedView,r,e;if(i.length)if(this._isVerticallyGrouped()){for(r=[],e=0;e<6;e++)r.push({text:"<div>&nbsp;<\/div>",className:"k-hidden k-slot-cell"});o=f._createRowsLayout(i,r,this.groupHeaderTemplate,t);t=f._createVerticalColumnsLayout(i,r,this.groupHeaderTemplate,t)}else t=f._createColumnsLayout(i,t,this.groupHeaderTemplate,t);return{columns:t,rows:o}},_createEventElement:function(i){var f=this.options,r=f.editable,e=this._isMobile(),u;return i.showDelete=r&&r.destroy!==!1&&!e,i.resizable=r&&r.resize!==!1&&!e,i.ns=t.ns,i.resources=this.eventResources(i),i.inverseColor=i.resources&&i.resources[0]?this._shouldInverseResourceColor(i.resources[0]):!1,i.messages=f.messages||{destroy:"Delete"},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,f=o.lastSlot().end-1,r=t.date.toUtcTime(n.start),u=t.date.toUtcTime(n.end);return(e(r,i,f)||e(u,i,f)||e(i,r,u)||e(f,r,u))&&(!e(u,i,i)||e(u,r,r)||n.isAllDay)},_slotIndex:function(n){return this._slotIndices[h(n).getTime()]},_positionMobileEvent:function(i,u,f){var e=i.start;i.start.offsetLeft>i.end.offsetLeft&&(e=i.end);var o=i.start.index,h=o,c=r.collidingEvents(i.events(),o,h);c.push({element:u,start:o,end:h});var a=r.createRows(c),l=i.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&&(i.addEvent({element:u,start:o,end:h,groupIndex:e.groupIndex}),f._continuousEvents.push({element:u,uid:u.attr(t.attr("uid")),start:i.start,end:i.end}),s[0].appendChild(u[0]))},_positionEvent:function(i,u,f){var w=this.options.eventHeight,o=i.start,v,s,d,b,g,p,nt,h,tt,e;i.start.offsetLeft>i.end.offsetLeft&&(o=i.end);var c=i.start.index,l=i.end.index,a=o.eventCount,k=r.collidingEvents(i.events(),c,l),it=c!==l?5:4;for(k.push({element:u,start:c,end:l}),v=r.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=i.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 i.addEvent({element:u,start:c,end:l,groupIndex:o.groupIndex}),u[0].style.width=i.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:i.start,end:i.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._groupedView._getTimeSlotByPosition(n,t,i),r)return r;return null},_appendResizeHint:function(n){n.appendTo(this.content);this._resizeHint=this._resizeHint.add(n)},_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._groupedView._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 f=t.date.toUtcTime(n.start)+r,o=f+n.duration(),s=this.groups[i],e=s.ranges(f,o,!0,n.isAllDay),u;for(this._removeMoveHint(),u=0;u<e.length;u++)this._groupedView._createMoveHint(e[u],n)},_appendMoveHint:function(n){n.appendTo(this.content);this._moveHint=this._moveHint.add(n)},_groups:function(){var t=this._groupCount(),i=this.content[0].getElementsByTagName("tr"),r=this.startDate(),n;for(this.groups=[],n=0;n<t;n++)this._addResourceView(n);this._groupedView._addDaySlotCollections(t,i,r)},addDaySlot:function(n,i,r,u){var s=i.clientHeight,h=i.children.length?i.children[0].offsetHeight+3:0,f=t.date.addDays(r,u),e=t.date.MS_PER_DAY,o;r.getHours()!==f.getHours()&&(e+=(r.getHours()-f.getHours())*t.date.MS_PER_HOUR);f=t.date.toUtcTime(f);e+=f;o=Math.floor((s-h-this.options.moreButtonHeight)/(this.options.eventHeight+3));i.setAttribute("role","gridcell");i.setAttribute("aria-selected",!1);n.addDaySlot(i,f,e,o)},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 i,r,e,o,u,f=0,s=n.length;f<s;f++)if(i=n[f],this._isInDateSlot(i))for(r=this.groups[t],r._continuousEvents||(r._continuousEvents=[]),e=r.slotRanges(i,!0),o=e.length,u=0;u<o;u++){var h=e[u],c=i.start,l=i.end;this._groupedView._positionEvent(i,r,h,o,c,l,u)}},_renderGroups:function(n,i,u,f){var e=i[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:r.groupEqFilter(c)}).toArray(),i.length>1?u=this._renderGroups(h,i.slice(1),u++,f+1):this._renderEvents(h,u++);return u},_groupCount:function(){var n=this.groupedResources,t=this._groupedView;return n.length?this._isVerticallyGrouped()?t._verticalGroupCount(n.length-1):t._horizontalGroupCount(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(f);this.element&&this.element.off(f);r.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),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.scheduler.recurrence",["kendo.dropdownlist","kendo.datepicker","kendo.numerictextbox"],n)}(function(){return function(n,t){function w(n,t){var i;return n!==0&&n<t?i=t-n:(i=n%t,i&&(i=t-i)),i}function yt(n){var t=n.getMonth(),i=kt(n)?ui[t]:fi[t];return i+n.getDate()}function pt(n,i){var u,f;return n=new Date(n.getFullYear(),n.getMonth(),n.getDate()),r(n,0),u=n.getFullYear(),i!==t?(h(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 c(n,t){var r=ri(n).getDay(),i=7-(r+7-(t||7))||7;return i<0&&(i+=7),Math.ceil((n.getDate()-i)/7)+1}function l(n,t){return n+(n<t?7:0)}function wt(n,t,i){var r=t.offset;if(!r)return c(n,i);var f=new Date(n.getFullYear(),n.getMonth()+1,0),u=c(f,i),e=l(t.day,i),o=e<l(new Date(n.getFullYear(),n.getMonth(),1).getDay(),i),s=e>l(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 bt(n,t){return c(new Date(n.getFullYear(),n.getMonth()+1,0),t)}function yi(n,t,i){return c(n,i)===wt(n,t,i)}function pi(n,t,i){for(var h=l(t.getDay(),i),a=n.length,u,r,f,e,o=[],s=0;s<a;s++)if(r=n[s],e=c(t,i),u=wt(t,r,i),u!==null)if(e<u)o.push(r);else if(e===u)if(f=l(r.day,i),h<f)o.push(r);else if(h===f)return null;return o}function a(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 wi(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=ht[i],i===t)return null;n[r]={offset:parseInt(u.substring(0,f-2),10)||0,day:i}}return n}function bi(n){for(var r=0,f=n.length,t,i,u=[];r<f;r++)t=n[r],typeof t=="string"?i=t:(i=""+st[t.day],t.offset&&(i=t.offset+i)),u.push(i);return u.toString()}function ki(n){var t=n.getMonth();return t===1?new Date(n.getFullYear(),1,29).getMonth()===1?29:28:ei[t]}function kt(n){return n=n.getFullYear(),n%4==0&&n%100!=0||n%400==0}function k(n,t){return n-t}function dt(n,t){var i=0,u,r,f=[];if(n)for(n=n.split(n.indexOf(";")!==-1?";":","),u=n.length;i<u;i++)r=it(n[i],t),r&&f.push(r);return f}function nt(t,i,r){for(var f=n.isArray(t)?t:dt(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 gt(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,si);return f.join(",")}function di(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":h(i,t.weekStart,-1)}return t.hours&&i.setHours(0),t.minutes&&i.setMinutes(0),t.seconds&&i.setSeconds(0),i}function tt(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":h(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 gi(n,t,i){for(var o=n.length,e=[],r,u,f=0,s=i.length;f<s;f++)r=i[f],r<0?r=o+r:r-=1,u=n[r],u&&u.start>=t&&e.push(u);return e}function nr(n,t,i){for(var f=[],r,u=0;u<n.length;u++)r=n[u],nt(t,r.start,i)||f.push(r);return f}function tr(n,i,r,f){var e=d(n.recurrenceRule,f),c,rt,l,y,st,ht,ct,lt,ni,ut,ft,ti,g,w,ri,et,o,b,h,k,a,ot,v=[],at,vt,yt,pt,ui,it,wt,bt,kt,hi;if(!e)return[n];for(k=e.positions,a=k?0:1,ut=e.start,ft=e.end,(ut||ft)&&(n=n.clone({start:ut?new Date(ut.value[0]):t,end:ft?new Date(ft.value[0]):t})),o=n.start,et=o.getTime(),ri=p(o),w=dt(n.recurrenceException,f),!w[0]&&e.exdates&&(w=e.exdates.value,n.set("recurrenceException",gt(w,f))),lt=i=new Date(i),r=new Date(r),g=e.freq,h=vi[g],b=e.count,e.until&&e.until<r&&(r=new Date(e.until)),ti=g==="yearly"||g==="monthly"||g==="weekly",i<et||b||e.interval>1||ti?i=new Date(et):(y=i.getHours(),st=i.getMinutes(),ht=i.getSeconds(),e.hours||(y=o.getHours()),e.minutes||(st=o.getMinutes()),e.seconds||(ht=o.getSeconds()),i.setHours(y,st,ht,o.getMilliseconds())),e._startPeriod=new Date(i),k&&(i=di(i,e),r=tt(r,e),ui=p(r)-p(i),ui<0&&(y=i.getHours(),r.setHours(y,i.getMinutes(),i.getSeconds(),i.getMilliseconds()),u.adjustDST(r,y)),e._startPeriod=new Date(i),e._endPeriod=tt(i,e)),ct=n.duration(),e._startTime=c=u.toInvariantTime(i),h.setup&&h.setup(e,o,i),h.limit(i,r,e);i<=r;){if(l=new Date(i),ii(l,ct),ni=i>=lt||l>lt,ni&&!nt(w,i,f)||k)if(c=u.toUtcTime(u.getDate(i))+p(e._startTime),rt=c+ct,et!==i.getTime()||ri!==p(e._startTime)){if(!n.isAllDay&&(it=n.startTimezone||n.endTimezone,wt=n.endTimezone||n.startTimezone,f&&it||!f&&!it)){var fi=s(i,f)-s(n.start,f),ei=s(l,f)-s(n.end,f),oi=s(i,it)-s(n.start,it),si=s(l,wt)-s(n.end,wt);fi!==oi&&(bt=(fi-oi)*6e4,at=new Date(i.getTime()-bt),yt=c-bt);ei!==si&&(kt=(ei-si)*6e4,vt=new Date(l.getTime()-kt),pt=rt-kt)}v.push(n.toOccurrence({start:at||new Date(i),end:vt||l,_startTime:yt||c,_endTime:pt||rt}));at=vt=yt=pt=null}else n._startTime=c,n._endTime=rt,v.push(n);if(k){if(h.next(i,e),h.limit(i,r,e),i>e._endPeriod&&(ot=gi(v.slice(a),o,k),ot=nr(ot,w,f),v=v.slice(0,a).concat(ot),e._endPeriod=tt(i,e),a=v.length),b&&b===a)break}else{if(b&&b===a)break;a+=1;hi=ir(i);h.next(i,e);hi&&e.freq!=="hourly"&&u.toInvariantTime(n.start).getTime()!==u.toInvariantTime(i).getTime()&&(e._startTime=c=new Date(i.getTime()-36e5));h.limit(i,r,e)}}return v}function ir(n){var t=n.getTimezoneOffset(),i=new Date(n.getTime()-36e5),r=i.getTimezoneOffset();return t<r}function s(n,t){return t?i.timezone.offset(n,t):n.getTimezoneOffset()}function it(n,t){return n=i.parseDate(n,oi),n&&t&&(n=g.apply(n,t)),n}function rt(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]=it(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=rt(s,u):s.indexOf("DTEND")!==-1?f.end=rt(s,u):s.indexOf("EXDATE")!==-1?f.exdates=rt(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=it(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=wi(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=ht[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 ut(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 ft(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="+bi(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="+st[h]),e&&(e="DTSTART"+ut(e,r)),o&&(o="DTEND"+ut(o,r)),f&&(f="EXDATE"+ut(f,r)),(e||o||f)&&(u=e+o+f+"RRULE:"+u),u}var i=window.kendo,g=i.timezone,ti=i.Class,b=i.ui,ot=b.Widget,y=b.DropDownList,u=i.date,ii=u.setTime,h=u.setDayOfWeek,r=u.adjustDST,ri=u.firstDayOfMonth,p=u.getMilliseconds,ui=[0,31,60,91,121,152,182,213,244,274,305,335,366],fi=[0,31,59,90,120,151,181,212,243,273,304,334,365],ei=[31,28,31,30,31,30,31,31,30,31,30,31],st={0:"SU",1:"MO",2:"TU",3:"WE",4:"TH",5:"FR",6:"SA"},ht={SU:0,MO:1,TU:2,WE:3,TH:4,FR:5,SA:6},oi=["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"],ct=["months","weeks","yearDays","monthDays","weekDays","hours","minutes","seconds"],lt=ct.length,si="yyyyMMddTHHmmssZ",hi={months:function(n,t,i){var u=i.months,r=a(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+1),n};n<=t;){if(u=n.getMonth(),o=ki(n),f=a(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=kt(n)?366:365,f=a(i.yearDays,yt(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,s,e=!1,c=n.getHours(),l=function(n){return n<0&&(n=53+n),n};n<t;){if(u=a(i.weeks,pt(n,o),l),u===null)return e;if(e=!0,f=n.getFullYear(),u.length){s=u.sort(k)[0]*7-1;n.setFullYear(f,0,s);h(n,o,-1);r(n,c);break}else n.setFullYear(f+1,0,1)}return e},weekDays:function(n,t,i){var o=i.weekDays,u=i.weekStart,s=pi(o,n,u),l=n.getHours(),f,e;if(s===null)return!1;if(f=s[0],f||(f=o[0],h(n,u)),e=f.day,f.offset)while(n<=t&&!yi(n,f,u))c(n,u)===bt(n,u)?(n.setMonth(n.getMonth()+1,1),r(n,l)):(n.setDate(n.getDate()+7),r(n,l),h(n,u,-1));return n.getDay()!==e&&h(n,e),!0},hours:function(n,t,i){var e=i.hours,o=i._startTime,f=o.getHours(),u=a(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=a(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=a(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=ti.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<lt;u++){if(e=ct[u],r[e])if(f=hi[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===lt)break}},interval:function(n,t){var o=new Date(n._startPeriod),e=new Date(t),h=t.getHours(),p=n.weekStart,c=n.interval,a=n.freq,s=!1,i=0,b=0,v=1,f,y,k,d;return a==="hourly"?(f=e.getTimezoneOffset()-o.getTimezoneOffset(),y=n._startTime.getHours(),e=e.getTime(),h!==y&&(e+=(y-h)*u.MS_PER_HOUR),e-=o,f&&(e-=f*u.MS_PER_MINUTE),f=Math.floor(e/u.MS_PER_HOUR),i=w(f,c),i!==0&&(this._hour(t,n,i),s=!0)):a==="daily"?(u.setTime(e,-o,!0),f=Math.round(e/u.MS_PER_DAY),i=w(f,c),i!==0&&(this._date(t,n,i),s=!0)):a==="weekly"?(i=this._getNumberOfWeeksBetweenDates(o,t),k=l(t.getDay(),p),d=l(o.getDay(),p),k<d&&(i+=1),i=w(i,c),i!==0&&(u.setDayOfWeek(t,n.weekStart,-1),t.setDate(t.getDate()+i*7),r(t,h),s=!0)):a==="monthly"?(f=t.getFullYear()-o.getFullYear(),f=t.getMonth()-o.getMonth()+f*12,i=w(f,c),i!==0&&(v=n._hasRuleValue?1:t.getDate(),t.setFullYear(t.getFullYear(),t.getMonth()+i,v),r(t,h),s=!0)):a==="yearly"&&(f=t.getFullYear()-o.getFullYear(),i=w(f,c),n.months||(b=t.getMonth()),n.yearDays||n.monthDays||n.weekDays||(v=t.getDate()),i!==0&&(t.setFullYear(t.getFullYear()+i,b,v),r(t,h),s=!0)),s},_getNumberOfWeeksBetweenDates:function(n,t){var i=(t-n)/6048e5,r=Math.floor(i);return i-r>.99&&(r=Math.round(i)),r},_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)}}),ci=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))}}),at=e.extend({next:function(n,t){e.fn.next(n,t)||this[t.hours?"_hour":"_date"](n,t,1)}}),li=at.extend({setup:function(n,t){n.weekDays||(n.weekDays=[{day:t.getDay(),offset:0}])}}),vt=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())}}),ai=vt.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(){}}),vi={hourly:new ci,daily:new at,weekly:new li,monthly:new vt,yearly:new ai},f="click";i.recurrence={rule:{parse:d,serialize:ft},expand:tr,dayInYear:yt,weekInYear:pt,weekInMonth:c,numberOfWeeks:bt,isException:nt,toExceptionString:gt};var ni=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},rr=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" title="#:messages.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" title="#:messages.day#" />#:messages.day#<\/label><input class="k-recur-monthday" title="#:messages.day#" /><\/li><li><input class="k-recur-month-radio" type="radio" name="month" value="weekday" title="#:messages.repeatOn#" /><input class="k-recur-weekday-offset" title="#:messages.repeatOn#" /><input class="k-recur-weekday" title="#:messages.day#" /><\/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" title="#:messages.repeatOn#" /><input class="k-recur-month" title="#:messages.repeatOn#" /><input class="k-recur-monthday" title="#:messages.day#" /><\/li><li><input class="k-recur-year-radio" type="radio" name="year" value="weekday" title="#:messages.repeatOn#" /><input class="k-recur-weekday-offset" title="#:messages.repeatOn#" /><input class="k-recur-weekday" title="#:messages.day#"  />#:messages.of#<input class="k-recur-month" title="#:messages.of#"/><\/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" title="#:end.occurrence#" />#: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" title="#:end.on#" /><\/li><\/ul><\/div># } #'),ur=[{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}],fr=[{day:1,offset:0},{day:2,offset:0},{day:3,offset:0},{day:4,offset:0},{day:5,offset:0}],er=[{day:0,offset:0},{day:6,offset:0}],v=ot.extend({init:function(n,t){var f,r=this,e=t&&t.frequencies;ot.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:{recurrenceEditorTitle:"Recurrence editor",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=ur,f=u):r==="weekday"?(i=fr,f=u):r==="weekend"?(i=er,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 y(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 y(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")}}),or=v.extend({init:function(n,t){var i=this;v.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);v.fn.destroy.call(n)},value:function(n){var i=this,u=i.options.timezone,r;if(n===t)return i._value.freq?ft(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 />").attr({title:u.messages.recurrenceEditorTitle}),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 y(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:ni,firstWeekDay:r.firstWeekDay,messages:r.messages[n],end:r.messages.end};if(i.destroy(t._container),t._container.html(rr(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 y(u[0],f),t._month2=new y(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&&t._count.enable(u);t._until&&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)}});b.plugin(or);var sr=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>'),hr=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" title="#:messages.day#" 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" title="#:messages.every#"><\/select><\/div><div class="k-edit-label"><label>#:messages.day#<\/label><\/div><div class="k-edit-field"><select class="k-recur-weekday" title="#:messages.day#"><\/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" title="#:messages.day#" 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" title="#:messages.every#"><\/select><\/div><div class="k-edit-label"><label>#:messages.day#<\/label><\/div><div class="k-edit-field"><select class="k-recur-weekday" title="#:messages.day#"><\/select><\/div><\/div><div class="k-edit-label"><label>#:messages.month#<\/label><\/div><div class="k-edit-field"><select class="k-recur-month" title="#:messages.month#"><\/select><\/div># } #'),cr=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># } #'),et=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>'),lr=v.extend({init:function(n,t){var r=this;v.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?ft(i._value,r):"";i._value=d(n,r)||{}},destroy:function(){this._destroyView();i.destroy(this._endFields);this._repeatButton.off(f+this._namespace);v.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=et({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=et({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+sr({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:ni,firstWeekDay:n.options.firstWeekDay,messages:n.options.messages[t]},r=hr(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(cr(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=et({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}});b.plugin(lr)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.scheduler.timelineview",["kendo.scheduler.view"],n)}(function(){return function(n,t){function d(n){var t=new Date(1980,1,1,0,0,0);return r(t,u(n)),t}function ut(n){var i=[],t=n.workWeekStart;for(i.push(t);n.workWeekEnd!=t;)t>6?t-=7:t++,i.push(t);return i}function g(n){var i=0,t;if(n.columns){for(t=0;t<n.columns.length;t++)i+=g(n.columns[t]);return n.colspan=i,i}return n.colspan=1,1}function ft(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 et(n,t,i)}function et(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,w=i.ui,r=i.date.setTime,o=w.SchedulerView,v=i._outerWidth,b=i._outerHeight,c=n.extend,nt=n.proxy,f=i.date.getDate,u=i.date.getMilliseconds,e=i.date.MS_PER_DAY,y=i.date.MS_PER_MINUTE,s="k-current-time",a="k-current-time-arrow",k="k-scheduler-header-wrap",p=.8666,h=".kendoTimelineView",tt=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>'),it=i.template("<span class='k-link k-nav-day'>#=kendo.format('{0:m}', date)#<\/span>"),rt='<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-60-left"><\/span>#}## if(data.isException()) {#<span class="k-icon k-i-non-recurrence"><\/span># } else if(data.isRecurring()) {#<span class="k-icon k-i-reload"><\/span># } #<\/span>{0}<span class="k-event-actions">#if (showDelete) {#<a href="\\#" class="k-link k-event-delete" title="${data.messages.destroy}" aria-label="${data.messages.destroy}"><span class="k-icon k-i-close"><\/span><\/a>#}## if(data.head) {#<span class="k-icon k-i-arrow-60-right"><\/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>',ot=i.Class.extend({init:function(n){this._view=n},_getTimeSlotByPosition:function(n,t,i){var r=this._view.groups[i];return r.timeSlotByPosition(n,t)},_hideHeaders:function(){var n=this._view;n.timesHeader.find("table tr:last").hide();n.datesHeader.find("table tr:last").hide()},_setColspan:function(n){g(n)},_createRowsLayout:function(n,t,i){var r=this._view;return r._createRowsLayout(n,t,i)},_createVerticalColumnsLayout:function(n,t,i,r){return r},_createColumnsLayout:function(n,t,i){var r=this._view;return r._createColumnsLayout(n,t,i)},_getRowCount:function(){var n=this._view;return n._groupCount()},_getGroupsCount:function(){return 1},_addContent:function(n,t,r,u,f,e,o,s){for(var a,h,p,c=this._view,l="",y=c.options,w=function(t){var u="",r="",f,e=function(n){return function(){return c._resourceBySlot({groupIndex:n})}};return i.date.isToday(n[h])&&(r+="k-today"),(i.date.getMilliseconds(t)<i.date.getMilliseconds(y.workDayStart)||i.date.getMilliseconds(t)>=i.date.getMilliseconds(y.workDayEnd)||!c._isWorkDay(n[h]))&&(r+=" k-nonwork-hour"),u+="<td"+(r!==""?' class="'+r+'"':"")+">",f=i.date.getDate(n[h]),i.date.setTime(f,i.date.getMilliseconds(t)),u+=o({date:f,resources:e(s?v:a)}),u+"<\/td>"},v=0;v<u;v++){for(l+="<tr>",a=0;a<r;a++)for(h=0,p=t;h<p;h++)l+=c._forTimeRange(f,e,w);l+="<\/tr>"}return l},_addTimeSlotsCollections:function(n,t,i,r,f){var h=this._view,c=i.length,e,l,y,a,p,v,o,d,s;for(f&&(c=Math.floor(c/n)),e=0;e<n;e++){l=0;y=h.groups[e];f&&(l=e);p=l*c;v=0;f||(v=e);var w=i[p].children,b=w.length/(f?1:n),k=b/t;for(o=0;o<t;o++)for(d=o*k+b*v,a=u(new Date(+h.startTime())),s=0;s<k;s++)h._addTimeSlotToCollection(y,w,s,d,o,a,r),a+=r}},_getVerticalGroupCount:function(n){return n},_getVerticalRowCount:function(n,t,i){var r=this._view;return r._isVerticallyGrouped()?n[t].maxRowCount:i},_renderEvent:function(n,t,i,r,u,f){var e=this._view,o,s;o=e._createEventElement(i.occurrence,t,u.head||i.head,u.tail||i.tail);o.appendTo(f).css({top:0,height:e.options.eventHeight});s={start:i.occurrence._startTime||i.occurrence.start,end:i.occurrence._endTime||i.occurrence.end,element:o,uid:t.uid,slotRange:u,rowIndex:0,offsetTop:0};n.events[t.uid]=s;e.addContinuousEvent(r,u,o,t.isAllDay);e._arrangeRows(s,u,n)},_verticalCountForLevel:function(n){var t=this._view;return t._rowCountForLevel(n)},_horizontalCountForLevel:function(n){var t=this._view;return t._columnCountForLevel(n)},_updateCurrentVerticalTimeMarker:function(t,i){var r=this._view,u="<div class='"+s+"'><\/div>",f=r.datesHeader.find("."+k),e=Math.round(t[0].innerRect(i,new Date(i.getTime()+1),!1).left),o=n(u).prependTo(f).addClass(a+"-down");o.css({left:r._adjustLeftPosition(e-v(o)*p/2),top:f.find("tr:last").prev().position().top});n(u).prependTo(r.content).css({left:r._adjustLeftPosition(e),width:"1px",height:r.content[0].scrollHeight-1,top:0})},_changeGroup:function(){return t},_prevGroupSlot:function(n,t,i){var u=this._view,r;return u._isVerticallyGrouped()?n:(r=t._collection(0,i),r.last())},_nextGroupSlot:function(n,t,i){var u=this._view,r;return u._isVerticallyGrouped()?n:(r=t._collection(0,i),r.first())},_verticalSlots:function(n,t){var i=this._view;return i._changeGroup(n,t)},_verticalMethod:function(n){return n?"leftSlot":"rightSlot"},_normalizeVerticalSelection:function(){return t},_horizontalSlots:function(n,t,i,r,u,f,e){var s=this._view,o={};return o.startSlot=t[i](r),o.endSlot=t[i](u),f||!s._isHorizontallyGrouped()||o.startSlot&&o.endSlot||(o.startSlot=o.endSlot=s._changeGroup(n,e)),o},_changeVerticalViewPeriod:function(){return!1},_changeHorizontalViewPeriod:function(n,t,i,r){var u=this._view;return(!n.startSlot||!n.endSlot)&&!t&&u._changeViewPeriod(i,r,!1)?!0:!1},_updateDirection:function(n,t,i,r){var u=this._view;u._updateDirection(n,t,i,r,!0)},_createMoveHint:function(n,t){var i=this._view,e=n.start,f=i._createEventElement(t.occurrence,t.occurrence,!1,!1),r,u,o,s;f.addClass("k-event-drag-hint");r=n.innerRect(t.occurrence.start,t.occurrence.end,i.options.snap);u=r.right-r.left-2;u<0&&(u=0);o=i._adjustLeftPosition(r.left);s={left:o,top:e.offsetTop,height:e.offsetHeight-2,width:u};f.css(s);i._moveHint=i._moveHint.add(f)},_adjustLeftPosition:function(n){var t=this._view;return t._isRtl&&(n-=t.content[0].scrollWidth-t.content[0].offsetWidth),n}}),st=i.Class.extend({init:function(n){this._view=n},_getTimeSlotByPosition:function(n,t,i){var r=this._view.groups[i];return r.timeSlotByPosition(n,t,!0)},_hideHeaders:function(){var n=this._view;n._isVerticallyGrouped()?n.times.find(".k-last").hide():(n.timesHeader.find("table tr").eq(2).hide(),n.datesHeader.find("table tr").eq(2).hide())},_setColspan:function(){},_createRowsLayout:function(n,t,i,r){var u=this._view;return u._createDateLayout(r,null,!0)},_createVerticalColumnsLayout:function(n,t,i){var r=this._view;return r._createColumnsLayout(n,null,i)},_createColumnsLayout:function(n,t,i,r){var u=this._view;return u._createColumnsLayout(n,t,i,r,!0)},_getRowCount:function(n){var t=this._view;return t._rowCountForLevel(n)},_getGroupsCount:function(){var n=this._view;return n._groupCount()},_addContent:function(n,t,u,f,e,o,s,h){for(var l,k,c=this._view,a="",b=c.options,d=function(t,r,u,f,e,o){var a="",h="",v,y=c._isVerticallyGrouped()?w:l,p=function(n){return function(){return c._resourceBySlot({groupIndex:n})}};return i.date.isToday(n[l])&&(h+="k-today"),(i.date.getMilliseconds(t)<i.date.getMilliseconds(b.workDayStart)||i.date.getMilliseconds(t)>=i.date.getMilliseconds(b.workDayEnd)||!c._isWorkDay(n[y]))&&(h+=" k-nonwork-hour"),a+="<td"+(h!==""?' class="'+h+'"':"")+">",v=i.date.getDate(n[l]),i.date.setTime(v,i.date.getMilliseconds(t)),a+=s({date:v,resources:p(o)}),a+"<\/td>"},v=new Date(e),g=c.options.minorTickCount,nt=c.options.majorTick*y,tt=nt/g||1,w,p=0;p<f;p++){for(a+="<tr>",p%(f/c._dates.length)==0&&(w=p/(f/c._dates.length),v=new Date(c._dates[w]),i.date.setTime(v,i.date.getMilliseconds(e))),l=0,k=t;l<k;l++)if(a+=c._forTimeRange(v,o,d,h,u),h){r(v,tt,!1);break}a+="<\/tr>"}return a},_addTimeSlotsCollections:function(n,t,i,r,f){var l=this._view,h=i.length,e,a,v,o,s,w;for(f&&(h=h/t),e=0;e<t;e++){a=0;f&&(a=e);var b=a*h,k=0,c=i[b].children,p=f?h:c.length/(t*n),d=c.length/t,y;for(v=u(new Date(+l.startTime())),o=0;o<p;o++){for(f?(y=0,c=i[o+p*e].children):(y=e*d+n*o,k++),s=0;s<n;s++)w=l.groups[s],l._addTimeSlotToCollection(w,c,s,y,e,v,r);v+=r}}},_getVerticalGroupCount:function(){var n=this._view;return n.content.find("tr").length},_getVerticalRowCount:function(n,t,i){return i},_renderEvent:function(n,t,i,r,u,f,e,o){for(var h=this._view,c,y=[],s=u.start.index;s<=u.end.index;s++){c=h._createEventElement(i.occurrence,t,s!==o,s!==e);c.appendTo(f).css({top:0,height:h.options.eventHeight});var l=r._timeSlotCollections[0]._slots[s],a=r.timeSlotRanges(l.start,l.end,!1)[0],v={start:s===e?i.occurrence._startTime||i.occurrence.start:l.start,end:s===o?i.occurrence._endTime||i.occurrence.end:l.end,element:c,uid:t.uid,slotRange:a,rowIndex:0,offsetTop:0};n.events[t.uid]=v;y.push(v);h.addContinuousEvent(r,a,c,t.isAllDay);h._arrangeRows(v,a,n)}n.events[t.uid]=y},_verticalCountForLevel:function(n){var t=this._view;return t._columnCountForLevel(n)},_horizontalCountForLevel:function(n,t){var i=this._view;return i._columnCountForLevel(t)/i._columnCountForLevel(2)},_updateCurrentVerticalTimeMarker:function(t,i){var r=this._view,e=r.times.find("tr:first th:first"),o=r.times.find("tr:first th:last"),h="<div class='"+s+"'><\/div>",u=n(h).prependTo(r.times),c=Math.round(t[0].innerRect(i,new Date(i.getTime()+1),!1).top),f={};this._isRtl?(f.right=e.position().left+b(e)-b(o),u.addClass(a+"-left")):(f.left=o.position().left,u.addClass(a+"-right"));f.top=c-v(u)*p/2;u.css(f);n(h).prependTo(r.content).css({top:c,height:"1px",right:"1px",width:r.content[0].scrollWidth,left:0})},_changeGroup:function(n,t,i){var r=this._view;i||(n.groupIndex=t?r.groups.length-1:0)},_prevGroupSlot:function(n){return n},_nextGroupSlot:function(n){return n},_changeDate:function(n,t,i){var e=this._view,f=e.groups[n.groupIndex],r,u;if(t){if(r=f._getCollections(!1),u=i.index-1,u>=0)return r[0]._slots[u]}else if(r=f._getCollections(!1),u=i.index+1,r[0]&&r[0]._slots[u])return r[0]._slots[u]},_verticalSlots:function(n,t,i){return this._changeDate(n,t,i)},_verticalMethod:function(n,t){return t?n?"upSlot":"downSlot":n?"leftSlot":"rightSlot"},_normalizeVerticalSelection:function(n,i,r,u){var f=this._view;return u?t:f._normalizeVerticalSelection(n,i,r)},_horizontalSlots:function(n,t,i,r,u,f,e){var s=this._view,h=s._changeGroup(n,e),o={};return h?o.startSlot=o.endSlot=h:s._isVerticallyGrouped()||(o.startSlot=t[i](r),o.endSlot=t[i](u)),o},_changeVerticalViewPeriod:function(n,t,i,r){var u=this._view;return(!n.startSlot||!n.endSlot)&&!t&&u._changeViewPeriod(i,r,u._isVerticallyGrouped())?!0:!1},_changeHorizontalViewPeriod:function(n,t,i,r){var u=this._view;return u._isVerticallyGrouped()?!1:(!n.startSlot||!n.endSlot)&&!t&&u._changeViewPeriod(i,r,!1)?!0:!1},_updateDirection:function(n,t,i,r){var u=this._view;u._updateDirection(n,t,i,r,!u._isVerticallyGrouped())},_createMoveHint:function(n,t){for(var r,u,e,i=this._view,o=n.start,s=n.end,f=o.index;f<=s.index;f++)r=n.collection._slots[f],u=i._createEventElement(t.occurrence,t.occurrence,!1,!1),u.addClass("k-event-drag-hint"),e={left:r.offsetLeft+2,top:r.offsetTop,height:i.options.eventHeight,width:r.offsetWidth},u.css(e),i._moveHint=i._moveHint.add(u)},_adjustLeftPosition:function(n){var t=this._view;return t._isRtl&&!t._isVerticallyGrouped()&&(n-=t.content[0].scrollWidth-t.content[0].offsetWidth),n}}),l;i.ui.scheduler.TimelineGroupedView=ot;i.ui.scheduler.TimelineGroupedByDateView=st;l=o.extend({init:function(n,t){var i=this;o.fn.init.call(i,n,t);i._groupedView=i._getGroupedView();i.title=i.options.title||i.options.name;i._workDays=ut(i.options);i._templates();i._editable();i.calculateDateRange();i._groups();i._currentTime(!0)},name:"timeline",_getGroupedView:function(){return this._isGroupedByDate()?new i.ui.scheduler.TimelineGroupedByDateView(this):new i.ui.scheduler.TimelineGroupedView(this)},_getNextEventIndexBySlot:function(n,t,r){var f,u;if(this._isVerticallyGrouped())return i.ui.SchedulerView.fn._getNextEventIndexBySlot.call(this,n,t,r);for(f=0,u=0;u<t.length;u++){if(n.startDate()>t[u].start.startDate()){f++;continue}if(n.startDate().getTime()===t[u].start.startDate().getTime()&&r>t[u].start.groupIndex){f++;continue}break}return f},_getSelectedSlot:function(n,t,r,u,f,e){return this._isVerticallyGrouped()?i.ui.SchedulerView.fn._getSelectedSlot.call(this,n,t,r,u,f,e):n},_getSortedEvents:function(t){return this._isVerticallyGrouped()?i.ui.SchedulerView.fn._getSortedEvents.call(this,t):t.sort(function(t,i){var r=t.start.startDate().getTime()-i.start.startDate().getTime();return r===0&&(t.start.isDaySlot&&!i.start.isDaySlot&&(r=-1),!t.start.isDaySlot&&i.start.isDaySlot&&(r=1)),r===0&&(r=t.start.groupIndex-i.start.groupIndex),r===0&&(r=n(t.element).index()-n(i.element).index()),r})},_currentTimeMarkerUpdater:function(){this._updateCurrentTimeMarker(new Date)},_updateCurrentTimeMarker:function(t){var r=this.options,e,c,l,f,o,h,u,y,w;if(this.datesHeader.find("."+s).remove(),this.times.find("."+s).remove(),this.content.find("."+s).remove(),this._isInDateSlot({start:t,end:t}))for(r.currentTimeMarker.useLocalTimezone===!1&&(e=r.dataSource.options.schema.timezone,r.dataSource&&e&&(c=i.timezone.offset(t,e),t=i.timezone.convert(t,t.getTimezoneOffset(),c))),l=!r.group||r.group.orientation=="vertical"?1:this.groups.length,f=0;f<l;f++){if(o=this.groups[f],!o)return;if(h=i.date.toUtcTime(t),u=o.timeSlotRanges(h,h+1),u.length===0)return;if(y=u[0].collection,w=y.slotByStartDate(t),w)if(this._isVerticallyGrouped())this._groupedView._updateCurrentVerticalTimeMarker(u,t);else{var b="<div class='"+s+"'><\/div>",d=this.datesHeader.find("."+k),g=Math.round(u[0].innerRect(t,new Date(t.getTime()+1),!1).left),nt=n(b).prependTo(d).addClass(a+"-down");nt.css({left:this._adjustLeftPosition(g-v(nt)*p/2),top:d.find("tr:last").prev().position().top});n(b).prependTo(this.content).css({left:this._adjustLeftPosition(g),width:"1px",height:this.content[0].scrollHeight-1,top:0})}}},_adjustLeftPosition:function(n){return this._groupedView._adjustLeftPosition(n)},_currentTime:function(n){var i=this,r=i.options.currentTimeMarker;r!==!1&&r.updateInterval!==t&&(i._currentTimeMarkerUpdater(),n&&(i._currentTimeUpdateTimer=setInterval(nt(this._currentTimeMarkerUpdater,i),r.updateInterval)))},_editable:function(){this.options.editable&&(this._isMobile()?this._touchEditable():this._mouseEditable())},_mouseEditable:function(){var t=this;t.element.on("click"+h,".k-event a:has(.k-i-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"+h,".k-scheduler-content td",function(n){var i=t._slotByPosition(n.pageX,n.pageY),r;i&&(r=t._resourceBySlot(i),t.trigger("add",{eventInfo:c({start:i.startDate(),end:i.endDate()},r)}));n.preventDefault()});if(t.options.editable.update!==!1)t.element.on("dblclick"+h,".k-event",function(r){t.trigger("edit",{uid:n(this).closest(".k-event").attr(i.attr("uid"))});r.preventDefault()})},_touchEditable:function(){var r=this,u=0;i.support.mobileOS.android&&(u=5);r.options.editable.create!==!1&&(r._addUserEvents=new i.UserEvents(r.element,{threshold:u,filter:".k-scheduler-content td",tap:function(n){var f=n.x.location!==t?n.x.location:n.x,e=n.y.location!==t?n.y.location:n.y,i=r._slotByPosition(f,e),u;i&&(u=r._resourceBySlot(i),r.trigger("add",{eventInfo:c({start:i.startDate(),end:i.endDate()},u)}));n.preventDefault()}}));r.options.editable.update!==!1&&(r._editUserEvents=new i.UserEvents(r.element,{threshold:u,filter:".k-event",tap:function(t){var u=n(t.target).closest(".k-event");u.hasClass("k-event-active")||r.trigger("edit",{uid:u.attr(i.attr("uid"))});t.preventDefault()}}))},_slotByPosition:function(n,t){var e,r=this.content,o=r.offset(),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(e=this._groupedView._getTimeSlotByPosition(n,t,u),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:tt,dateHeaderTemplate:it,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=c({},i.Template,n.templateSettings);this.eventTemplate=this._eventTmpl(n.eventTemplate,rt);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"+h,".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._groupedView._hideHeaders()},_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 s=this._dates,t=this.startTime(),n=this.endTime(),h,o,c,l;for(n=u(n),t=u(t),n===t?n+=e-1:n<t&&(n+=e),h=[],o=0;o<s.length;o++)c=f(s[o]),r(c,t),l=f(s[o]),r(l,n),h.push({start:i.date.toUtcTime(c),end:i.date.toUtcTime(l)});this._slotRanges=h},_forTimeRange:function(n,t,i,f,o){var it;n=d(n);t=d(t);var b=this,v=u(n),a=u(t),h=b.options.minorTickCount,k=b.options.majorTick*y,l=k/h||1,p=new Date(+n),c=0,s,g="";for(s=e/l,v!=a&&(v>a&&(a+=e),s=(a-v)/l),s=f?1:Math.round(s),o&&(s=s*o);c<s;c++){var w=c%(k/l),nt=w===0,rt=w<h-1,ut=w===h-1,tt=h;s%h!=0&&(it=s-(c+1)<h,nt&&it&&(tt=s%h));g+=i(p,nt,rt,ut,tt,c%o);f||(o?c%o==o-1&&r(p,l,!1):r(p,l,!1))}return g},_layout:function(n){for(var f,r,e=[],t=[],i=this,o=[{text:i.options.messages.defaultRowText}],u=i._groupedView,s=[],h=0;h<i.options.minorTickCount;h++)s.push({text:"&#8203;",className:"k-last",minorTicks:!0});for(this._forTimeRange(i.startTime(),i.endTime(),function(n,t,r,f,o){var c=i.majorTimeHeaderTemplate,h;t&&(h={text:c({date:n}),className:f?"k-slot-cell":"",columns:s.slice(0,o)},u._setColspan(h),e.push(h))}),f=0;f<n.length;f++)t.push({text:i.dateHeaderTemplate({date:n[f]}),className:"k-slot-cell",columns:e.slice(0)});return r=this.groupedResources,r.length&&(this._groupOrientation()==="vertical"?(o=u._createRowsLayout(r,null,this.groupHeaderTemplate,t),t=u._createVerticalColumnsLayout(r,null,this.groupHeaderTemplate,t)):t=u._createColumnsLayout(r,t,this.groupHeaderTemplate,t)),{columns:t,rows:o}},_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"+h,".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,e=t.startTime(),o=this.endTime(),r=1,f=1,s=n.length,i="",h=this.groupedResources,c=this.slotTemplate,u=!1;h.length&&(u=t._groupOrientation()==="vertical",u?(f=t._groupedView._getRowCount(this.rowLevels.length-1),r=t._groupedView._getGroupsCount()):r=t._groupCount());i+="<tbody>";i+=t._groupedView._addContent(n,s,r,f,e,o,c,u);i+="<\/tbody>";this.content.find("table").append(i)},_groups:function(){var h=this._groupCount(),n=this._dates,l=n.length,t;for(this.groups=[],t=0;t<h;t++){var a=this._addResourceView(t),e=n[0],o=n[n.length-1||0],s=u(this.startTime()),c=u(this.endTime());s!==0&&c<=s&&(e=f(e),r(e,s),o=f(o),r(o,c));a.addTimeSlotCollection(e,i.date.addDays(o,1))}this._timeSlotGroups(h,l)},_isHorizontallyGrouped:function(){return this.groupedResources.length&&this._groupOrientation()==="horizontal"},_timeSlotGroups:function(n,t){var r=this._timeSlotInterval(),u=this._isVerticallyGrouped(),i=this.content.find("tr");i.attr("role","row");this._groupedView._addTimeSlotsCollections(n,t,i,r,u)},_addTimeSlotToCollection:function(n,t,i,r,u,f,e){var o=t[i+r],c=n.getTimeSlotCollection(0),s=this._dates[u],l=Date.UTC(s.getFullYear(),s.getMonth(),s.getDate()),h=l+f,a=h+e;o.setAttribute("role","gridcell");o.setAttribute("aria-selected",!1);c.addTimeSlot(o,h,a,!0)},startDate:function(){return this._startDate},endDate:function(){return this._endDate},visibleEndDate:function(){var t=u(this.startTime()),r=u(this.endTime()),n=this.endDate();return t!==0&&r<=t&&(n=i.date.addDays(n,1)),n},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*y},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._currentTime(!1);this.trigger("activate")},_positionEvents:function(t,i){for(var e,o,r,f,u=0;u<i;u++){e=t[u].events;for(o in e)if(r=e[o],n.isArray(r))for(f=0;f<r.length;f++)this._positionEvent(r[f]);else this._positionEvent(r)}},_setRowsHeight:function(t,i,r){var s=this.options.eventHeight+2,h=this._getBottomRowOffset(),e=this._groupedView,c=e._getVerticalGroupCount(i),u,f;for(i=this._isVerticallyGrouped()?c:1,u=0;u<i;u++){f=e._getVerticalRowCount(t,u,r);f=f?f:1;var o=(s+2)*f+h,l=n(this.times.find("tr")[u]),a=n(this.content.find("tr")[u]);l.height(o);a.height(o)}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.visibleEndDate()),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 l=n.start,c=n.end,a=n._time("start"),v=n._time("end"),h=u(this.startTime()),s=u(this.endTime()),o=null,t=null,w,y=!1,p=!1;return n.isAllDay&&(l=f(l),a=0,c=f(c),v=e,t=i.date.addDays(c,1)),s===0&&(s=e),s<=h?(a<h&&a>=s&&(o=f(l),r(o,h),p=!0),v>s&&v<=h&&(t=f(c),r(t,s),y=!0)):(h>a?(o=f(l),r(o,h),p=!0):s<a&&(o=f(l),o=i.date.addDays(o,1),r(o,h),p=!0),s<v?(t=f(c),r(t,s),y=!0):h>v&&(t=f(c),t=i.date.addDays(t,-1),r(t,s),y=!0)),w=n.clone({start:o?o:l,end:t?t:c,_startTime:o?i.date.toUtcTime(o):n._startTime,_endTime:t?i.date.toUtcTime(t):n._endTime,isAllDay:!1}),{occurrence:w,head:y,tail:p}},_renderEvents:function(n,t,i){for(var r,c,l,o,u,f=0,h=n.length;f<h;f++)if(r=n[f],this._isInDateSlot(r)&&(c=r.isAllDay||r.duration()>=e,l=this.content,c||this._isInTimeSlot(r))){o=this._adjustEvent(r);u=this.groups[t];u._continuousEvents||(u._continuousEvents=[]);var a=u.slotRanges(o.occurrence,!1),s=a[0],v=s.start.index,y=s.end.index;this._isInTimeSlot(o.occurrence)&&this._groupedView._renderEvent(i,r,o,u,s,l,v,y)}},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,h=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=c({},{ns:i.ns,resizable:k,showDelete:b,head:u,tail:f,singleDay:this._dates.length==1,resources:h,inverseColor:h&&h[0]?this._shouldInverseResourceColor(h[0]):!1,messages:this.options.messages},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=ft(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,t=this._groupedView;return n.length?this._groupOrientation()==="vertical"?t._verticalCountForLevel(n.length-1):t._horizontalCountForLevel(n.length-1,this.columnLevels.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 s=this.groups[t],r=n.clone({start:n.start,end:n.end}),h=r.duration(),f,e,u,o;for(r.start=new Date(r.start.getTime()+i),r.end=new Date(+r.start+h),f=this._adjustEvent(r),e=s.slotRanges(f.occurrence,!1),this._removeMoveHint(),u=0;u<e.length;u++)this._groupedView._createMoveHint(e[u],f);o=this.content;this._moveHint.appendTo(o)},_updateResizeHint:function(n,t,r,u){var v=this.groups[t],c=v.ranges(r,u,!1,!1),e,h,a;for(this._removeResizeHint(),e=0;e<c.length;e++){var s=c[e],l=s.startSlot(),f=s.innerRect(r,u,!1);f.top=l.offsetTop;var y=f.right-f.left,p=s.endSlot().offsetTop+l.offsetHeight-f.top,w=this._adjustLeftPosition(f.left),b=o.fn._createResizeHint.call(this,w,f.top,y,p);this._resizeHint=this._resizeHint.add(b)}h="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),h));this._resizeHint.last().addClass("k-last").find(".k-label-bottom").text(i.toString(i.timezone.toLocalDate(u),h))},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),this._groupedView._changeGroup(n,t,i),i},prevGroupSlot:function(n,t,i){var r=this.groups[t],u=r.ranges(n,n,i,!1)[0].start;if(!(t<=0))return this._groupedView._prevGroupSlot(u,r,i)},nextGroupSlot:function(n,t,i){var r=this.groups[t],u=r.ranges(n,n,i,!1)[0].start;if(!(t>=this.groups.length-1))return this._groupedView._nextGroupSlot(u,r,i)},_verticalSlots:function(n,t,i,r){var e=this._groupedView,s=e._verticalMethod(r,i),u=t[0].start,f=t[t.length-1].end,h=this.groups[n.groupIndex],o=e._normalizeVerticalSelection(n,t,r,i);return o&&(u=f=o),u=h[s](u),f=h[s](f),i||!this._isVerticallyGrouped()||u&&f||(u=f=e._verticalSlots(n,r,o)),{startSlot:u,endSlot:f}},_horizontalSlots:function(n,t,i,r){var f=r?"upSlot":"downSlot",e=t[0].start,o=t[t.length-1].end,s=this.groups[n.groupIndex],u={};return i?(u.startSlot=s[f](e),u.endSlot=s[f](o),i||!this._isHorizontallyGrouped()||e&&o||(u.startSlot=u.endSlot=this._changeGroup(n,r))):u=this._groupedView._horizontalSlots(n,s,f,e,o,i,r),u},_changeViewPeriod:function(n,t){var c=t?this.previousDate():this.nextDate(),f=n.start,i=n.end,o,s,h;return(o=new Date(c),s=new Date(c),this._isInRange(o,s))?!1:(n.start=o,n.end=s,this._isHorizontallyGrouped()&&(n.groupIndex=t?this.groups.length-1:0),h=i-f,t?(i=u(this.endTime()),i=i===0?e:i,r(n.start,i-h),r(n.end,i)):(f=u(this.startTime()),r(n.start,f),r(n.end,f+h)),n.events=[],!0)},move:function(n,t,r){var f=!1,v=this.groups[n.groupIndex],e=i.keys,l=this._groupedView,c=v.ranges(n.start,n.end,!1,!1),s,h,u,o,a;if(t===e.DOWN||t===e.UP){if(f=!0,u=t===e.UP,l._updateDirection(n,c,r,u),o=this._verticalSlots(n,c,r,u),l._changeVerticalViewPeriod(o,r,n,u))return f}else if((t===e.LEFT||t===e.RIGHT)&&(f=!0,u=t===e.LEFT,this._updateDirection(n,c,r,u,!1),o=this._horizontalSlots(n,c,r,u),l._changeHorizontalViewPeriod(o,r,n,u)))return f;return f&&(s=o.startSlot,h=o.endSlot,r?(a=n.backward,a&&s?n.start=s.startDate():!a&&h&&(n.end=h.endDate())):s&&h&&(n.start=s.startDate(),n.end=h.endDate()),n.events=[]),f},destroy:function(){var n=this;n.element&&n.element.off(h);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())}});c(!0,w,{TimelineView:l,TimelineWeekView:l.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:l.extend({options:{name:"TimelineWorkWeekView",title:"Timeline Work Week",selectedDateFormat:"{0:D} - {1:D}",selectedShortDateFormat:"{0:d} - {1:d}",majorTick:120},name:"timelineWorkWeek",nextDate:function(){var n=i.date.dayOfWeek(i.date.nextDay(this.endDate()),this.calendarInfo().firstDay,1);return i.date.addDays(n,this._workDays[0])},previousDate:function(){var t=i.date.dayOfWeek(this.startDate(),this.calendarInfo().firstDay,-1),n=this._workDays;return i.date.addDays(t,n[n.length-1]-7)},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:l.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),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.scheduler",["kendo.dropdownlist","kendo.editable","kendo.multiselect","kendo.window","kendo.datetimepicker","kendo.scheduler.recurrence","kendo.scheduler.view","kendo.scheduler.dayview","kendo.scheduler.agendaview","kendo.scheduler.monthview","kendo.scheduler.timelineview","kendo.mobile.actionsheet","kendo.mobile.pane","kendo.pdf"],n)}(function(){return function(n,t){function kt(n,t){return t=t||"",n.startTimezone&&(t=n.startTimezone,n.endTimezone&&(t+=" | "+n.endTimezone)),t}function dt(n,t){var r=t.timezone;r&&(n[i.attr("timezone")]=r)}function gt(n,t){var u=t.model.fields[t.field].validation,r;u&&(r=u.dateCompare,r&&h(r)&&r.message&&(n[i.attr("dateCompare-msg")]=r.message))}function lr(n,t){return function(i){return i=n(i),ni(i,"apply",t),i||[]}}function ar(n,t){return function(r){return r&&(vi.call(r)==="[object Array]"||r instanceof i.data.ObservableArray||(r=[r])),ni(r,"remove",t,!0),r=n(r),r||[]}}function ni(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 ti(n,t){for(var u=n.length,i=0,r;i<u;i++)if(r=n[i],r.uid===t)return r}function ri(n,t,r){return r?i.timezone.convert(n,t,r):i.timezone.remove(n,t)}function vr(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=ri(t,u,v),r=ri(r,e,v))}return t<=r}}}return!0}function yr(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 pr(n){return delete n.name,delete n.prefix,delete n.remove,delete n.edit,delete n.add,delete n.navigate,n}function ft(t,r){var o=(t.fields||t)[r],c=["url","email","number","date","boolean"],s=o?o.validation:{},l=i.attr("type"),a=n.inArray,u,f,e={};for(u in s)f=s[u],a(u,c)>=0?e[l]=u:i.isFunction(f)||(e[u]=h(f)?f.value||u:f),e[i.attr(u+"-msg")]=f.message;return e}function ui(t,r){var u=ft(r,t.field);return function(f){n(i.format('<select data-{0}bind="value:{1}" title="'+r.title+'">',i.ns,t.field)).appendTo(f).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 fi(t){var i=ft(t.model,t.field);return function(t,r){n('<textarea name="description" class="k-textbox" title="'+r.title+'"/>').attr(i).appendTo(t)}}function wr(t,r){var u=ft(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 br(t,r){var u=ft(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 ei(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,vt=i.date,hi=i.support.input,tt=vt.MS_PER_DAY,s=vt.getDate,et=i.date.getMilliseconds,v=i.recurrence,f=n.extend({F10:121},i.keys),y=i.ui,a=y.Widget,ci=y.DataBoundWidget,k="string",li=y.Popup,ai=y.Calendar,p=i.data.DataSource,h=n.isPlainObject,e=n.extend,w=n.proxy,vi=Object.prototype.toString,yt=n.isArray,u=".kendoScheduler",c="click",yi="mousedown",ot="change",it="cancel",d="remove",st="save",pt="add",g="edit",r="k-state-focused",o="k-state-expanded",l=".k-scheduler-views",pi=/(?:value:start|value:end)(?:,|$)/,wi=s(new Date),nt=",",wt=/\;/g,rt="recurrenceException",bi="Do you want to delete only this event occurrence or the whole series?",bt="Do you want to edit only this event occurrence or the whole series?",ki="Are you sure you want to delete this event occurrence?",di="Are you sure you want to delete the whole series?",gi='<a class="k-button #=className#" #=attr# href="\\#">#=text#<\/a>',nr=i.template('<li class="k-current-view" data-#=ns#name="#=view#"><a role="button" href="\\#" class="k-link">${views[view].title}<\/a><\/li>'),tr=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-file-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" title="${messages.today}">${messages.today}<\/a><\/li><li class="k-state-default k-header k-nav-prev"><a role="button" href="\\#" class="k-link" title="${messages.previous}" aria-label="${messages.previous}"><span class="k-icon k-i-arrow-60-left" style="pointer-events: none"><\/span><\/a><\/li><li class="k-state-default k-header k-nav-next"><a role="button" href="\\#" class="k-link" title="${messages.next}" aria-label="${messages.next}"><span class="k-icon k-i-arrow-60-right" style="pointer-events: none"><\/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-reload"><\/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>'),ir=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-file-pdf"><\/span>${messages.pdf}<\/a><\/li><\/ul># } #<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-reload"><\/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-60-left"><\/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-60-right"><\/span><\/a><\/li><\/ul><\/div>'),rr=function(t,r){var u={name:r.field,title:r.title},e=hi.date?"":i.attr("role")+'="datepicker" ',o=i.attr("role")+'="datetimepicker" ',f=r.model.isAllDay,s=i.attr("validate")+"='"+!f+"'",h=i.attr("validate")+"='"+f+"'";dt(u,r);gt(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)},ur=function(t,r){var u={name:r.field,title:r.title},f=r.model.isAllDay,e=i.attr("validate")+"='"+!f+"' ",o=i.attr("validate")+"='"+f+"' ";dt(u,r);gt(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)},fr=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})},er=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]})},or=function(t,i){var r=kt(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)},sr=function(t,i){n('<a href="#" class="k-button" data-bind="invisible:isAllDay">'+i.messages.timezoneEditorButton+"<\/a>").click(i.click).appendTo(t)},hr=function(t,r){n("<div "+i.attr("bind")+'="value:'+r.field+'" />').attr({name:r.field}).toggle(r.visible).appendTo(t).kendoMobileTimezoneEditor({optionLabel:r.noTimezone})},cr=function(r,u){var f=u.visible||u.visible===t;n("<div "+i.attr("bind")+'="value:'+u.field+'" />').attr({name:u.field}).toggle(f).appendTo(r).kendoTimezoneEditor({optionLabel:u.noTimezone,title:u.title})},ii=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=lr(n.proxy(this.data,this),r);this.serialize=ar(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)}}),ut=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)):et(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=tt);this.set("start",f);t===!0?(i.date.setTime(r,-u),r<f&&(r=f)):i.date.setTime(r,tt-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:vr}}},endTimezone:{type:"string"},recurrenceRule:{defaultValue:"",type:"string"},recurrenceException:{defaultValue:"",type:"string"},isAllDay:{type:"boolean",defaultValue:!1},description:{type:"string"}}}),b=p.extend({init:function(n){p.fn.init.call(this,e(!0,{},{schema:{modelBase:ut,model:ut}},n));this.reader=new ii(this.options.schema,this.reader)},expand:function(n,t){var r=this.view(),f={},u;return n&&t&&(u=t.getTimezoneOffset(),t=new Date(t.getTime()+tt-1),t.getTimezoneOffset()!==u&&(t=i.timezone.apply(t,u)),f={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()+tt-1)},{field:"end",operator:"gte",value:n}]}]},r=new i.data.Query(yr(r,n,t,this.reader.timezone)).filter(f).toArray()),r},cancelChanges:function(n){n&&n.isOccurrence()&&this._removeExceptionDate(n);p.fn.cancelChanges.call(this,n)},insert:function(n,t){if(t){if(!(t instanceof ut)){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)),p.fn.insert.call(this,n,t)}},pushCreate:function(n){this._pushCreated=!0;p.fn.pushCreate.call(this,n);this._pushCreated=!1},remove:function(n){return n.isRecurrenceHead()?this._removeExceptions(n):n.isRecurring()&&this._addExceptionDate(n),p.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&&p.fn.remove.call(this,t),t=i.shift();n.set(rt,"")},_removeExceptionDate:function(n){var t;if(n.recurrenceId&&(t=this.get(n.recurrenceId),t)){var r=n.defaults.start,i=new RegExp("(\\"+nt+"?)"+v.toExceptionString(r,this.reader.timezone)),u=(t.recurrenceException||"").replace(wt,nt).replace(/\,$/,"");i.test(u)?t.set(rt,u.replace(i,"")):(r=n.start,i=new RegExp("(\\"+nt+"?)"+v.toExceptionString(r,this.reader.timezone)),t.set(rt,u.replace(i,"")))}},_addExceptionDate:function(n){var t=n.start,u=this.reader.timezone,f=this.get(n.recurrenceId),i=(f.recurrenceException||"").replace(wt,nt).replace(/\,$/,""),r;v.isException(i,t,u)||(r=v.toExceptionString(t,u),n.defaults.start=t,f.set(rt,i+(i&&r?nt:"")+r))}}),ht,at,si;b.create=function(n){(yt(n)||n instanceof i.data.ObservableArray)&&(n={data:n});var t=n||{},r=t.data;if(t.data=r,!(t instanceof b)&&t instanceof i.data.DataSource)throw new Error("Incorrect DataSource type. Only SchedulerDataSource instances are supported");return t instanceof b?t:new b(t)};e(!0,i.data,{SchedulerDataSource:b,SchedulerDataReader:ii,SchedulerEvent:ut});ht={update:{text:"Save",className:"k-primary k-scheduler-update"},canceledit:{text:"Cancel",className:"k-scheduler-cancel"},destroy:{text:"Delete",imageClass:"k-i-close",className:"k-primary k-scheduler-delete",iconClass:"k-icon"}};var oi={mobile:{dateRange:rr,timezonePopUp:or,timezone:hr,recurrence:er,description:fi,multipleResources:br,resources:ui},desktop:{dateRange:ur,timezonePopUp:sr,timezone:cr,recurrence:fr,description:fi,multipleResources:wr,resources:ui}},ct=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;this.toggleDateValidationHandler=w(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);pi.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=e({},i.Template,this.options.templateSettings),v=c.paramName,s=this.options.editable.template,f="",h,l,u,o;if(s)typeof s===k&&(s=window.unescape(s)),f+=i.template(s,c)(n);else for(h=0,l=t.length;h<l;h++)u=t[h],u.field==="startTimezone"&&(f+='<div class="k-popup-edit-form k-scheduler-edit-form k-scheduler-timezones" style="display:none">',f+='<div class="k-edit-form-container">',f+='<div class="k-edit-label"><\/div>',f+='<div class="k-edit-field"><label class="k-check"><input class="k-timezone-toggle" type="checkbox" />'+a.editor.separateTimezones+"<\/label><\/div>"),f+='<div class="k-edit-label"><label for="'+u.field+'">'+(u.title||u.field||"")+"<\/label><\/div>",!n.editable||n.editable(u.field)?(r.push(u),f+="<div "+i.attr("container-for")+'="'+u.field+'" class="k-edit-field"><\/div>'):(o="#:",u.field?(u=i.expr(u.field,v),o+=u+"==null?'':"+u):o+="''",o+="#",o=i.template(o,c),f+='<div class="k-edit-field">'+o(n)+"<\/div>"),u.field==="endTimezone"&&(f+=this._createEndTimezoneButton());return f},_createEndTimezoneButton:function(){return"<\/div><\/div>"},_revertTimezones:function(n){n.set("startTimezone",this._startTimezone);n.set("endTimezone",this._endTimezone);delete this._startTimezone;delete this._endTimezone}}),kr=ct.extend({init:function(){ct.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,o=i.options.messages,r=i.timezoneView,s=i.container.find(".k-scheduler-timezones"),f=s.find(".k-timezone-toggle"),h=s.find(".k-edit-label:last").add(s.find(".k-edit-field:last")),l=function(n){if(n.field==="startTimezone"){var i=t.startTimezone;f.prop("disabled",!i);i||(h.hide(),t.set("endTimezone",""),f.prop("checked",!1))}},a;if(i._startTimezone=t.startTimezone||"",i._endTimezone=t.endTimezone||"",!r){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">'+o.cancel+"<\/a>"+o.editor.timezoneTitle+'<a href="#" class="k-button k-scheduler-update">'+o.save+"<\/a><\/div><\/div>";this.timezoneView=r=e.append(a);r.contentElement().append(s.show());r.element.on(c+u,".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=kt(t,o.editor.noTimezone);u.contentElement().find(".k-timezone-button").text(f);e.navigate(u,i.options.animations.right)});f.click(function(){h.toggle(f.prop("checked"));t.set("endTimezone","")});t.bind("change",l)}f.prop("checked",t.endTimezone).prop("disabled",!t.startTimezone);t.endTimezone?h.show():h.hide();e.navigate(r,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 s=this.pane,f="",o=this.options.messages,a=o.save,v=o.destroy,y=o.cancel,p=o.editor.editorTitle,h,r;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(oi.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>",h=s.append(f),r=this.container=h.element,this.editable=r.kendoEditable({fields:l,model:t,clearContainer:!1,target:e.options.target,validateOnBlur:!0}).data("kendoEditable"),r.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:r,model:t}))this.trigger("cancel",{container:r,model:t});else{r.on(c+u,"a.k-scheduler-edit, a.k-scheduler-cancel, a.k-scheduler-update, a.k-scheduler-delete",function(i){var u,f;i.preventDefault();i.stopPropagation();u=n(this);u.hasClass("k-scheduler-edit")?s.navigate("#edit",e.options.animations.right):(f="cancel",u.hasClass("k-scheduler-update")?f="save":u.hasClass("k-scheduler-delete")&&(f="remove"),e.trigger(f,{container:r,model:t}))});s.navigate(h,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}}}),dr=ct.extend({destroy:function(){this.close();this.unbind()},editEvent:function(t){var r=this,l=r.options.editable,o="<div "+i.attr("uid")+'="'+t.uid+'" class="k-popup-edit-form k-scheduler-edit-form"><div class="k-edit-form-container">',s=r.options.messages,p=s.save,w=s.cancel,b=s.destroy,k=this.fields(oi.desktop,t),v=[],a,y,f;if(o+=this._buildEditTemplate(t,k,v),y=h(l)?l.window:{},o+='<div class="k-edit-buttons k-state-default">',o+=this.createButton({name:"update",text:p,attr:a})+this.createButton({name:"canceledit",text:w,attr:a}),t.isNew()||l.destroy===!1||(o+=this.createButton({name:"delete",text:b,attr:a})),o+="<\/div><\/div><\/div>",f=this.container=n(o).appendTo(r.element).eq(0).kendoWindow(e({modal:!0,resizable:!1,draggable:!0,title:s.editor.editorTitle,visible:!1,close:function(n){n.userTriggered&&r.trigger(it,{container:f,model:t})&&n.preventDefault()}},y)),r.editable=f.kendoEditable({fields:v,model:t,clearContainer:!1,validateOnBlur:!0,target:r.options.target}).data("kendoEditable"),r.trigger(g,{container:f,model:t}))r.trigger(it,{container:f,model:t});else{f.data("kendoWindow").center().open();f.on(c+u,"a.k-scheduler-cancel",function(n){n.preventDefault();n.stopPropagation();r.trigger(it,{container:f,model:t})});f.on(c+u,"a.k-scheduler-update",function(n){n.preventDefault();n.stopPropagation();r.trigger("save",{container:f,model:t})});f.on(c+u,"a.k-scheduler-delete",function(n){n.preventDefault();n.stopPropagation();r.trigger(d,{container:f,model:t})});i.cycleForm(f);t.bind("change",r.toggleDateValidationHandler)}return r.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()}}),lt=ci.extend({init:function(t,r){var f=this;a.fn.init.call(f,t,r);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"+u+" selectstart"+u,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"+u,this._resizeHandler)},_unbindResize:function(){n(window).off("resize"+u,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,f=u.view(),o=u._selection,c=f.groups,h,y,p,l,a,v,w,b,k,e;if(r===t)return(p=f._selectedSlots,!o)?[]:(o&&o.events&&(y=u._selectedEvents()),{start:o.start,end:o.end,events:y,slots:p,resources:f._resourceBySlot(o)});if(!r){u._selection=null;u._old=null;f.clearSelection();return}if(n.isArray(r)&&(r={events:r.splice(0)}),r.resources){a=[];v=[];f.groupedResources&&u._groupsByResource(f.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=s(f._startDate),b=i.date.addDays(s(f._endDate),1),r.start<b&&w<=r.end&&(k=h&&h.length?c[h[0].groupIndex]:c[0],e=k.ranges(r.start,r.end,r.isAllDay,!1),e.length&&(u._selection={start:i.timezone.toLocalDate(e[0].start.start),end:i.timezone.toLocalDate(e[e.length-1].end.end),groupIndex:e[0].start.groupIndex,index:e[0].start.index,isAllDay:e[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,f=t.wrapper,s=i.support.mobileOS?"touchend":"mousedown",e;if(t.options.selectable){t._tabindex();f.on(s+u,".k-scheduler-header-all-day td, .k-scheduler-content td, .k-event",function(n){var u=n.which,e=n.button,o=i.support.browser,s=u&&u===3||e&&e==2;i.support.mobileOS&&n.isDefaultPrevented()||(s||(n.ctrlKey&&(t._ctrlKey=n.ctrlKey),n.shiftKey&&(t._shiftKey=n.shiftKey),t._createSelection(n.currentTarget)),f.focus(),o.msie&&o.version<9&&setTimeout(function(){f.focus()}),t.toolbar.find("ul > li").removeClass(r))});e=n.proxy(t._mouseMove,t);f.on("mousedown"+u,".k-scheduler-header-all-day td, .k-scheduler-content td",function(n){var t=n.which,i=n.button,r=t&&t===3||i&&i==2;if(!r)f.on("mousemove"+u,".k-scheduler-header-all-day td, .k-scheduler-content td",e)});f.on("mouseup"+u+" mouseleave"+u,function(){f.off("mousemove"+u,".k-scheduler-header-all-day td, .k-scheduler-content td",e)});f.on("focus"+u,function(){t._selection||t._selectFirstSlot();t._select()});f.on("focusout"+u,function(i){t._ctrlKey=t._shiftKey=!1;t.toolbar.find("ul > li").removeClass(r);n(i.relatedTarget).closest(l).length||t.toolbar.find(l).removeClass(o)});f.on("keydown"+u,w(t._keydown,t));f.on("keyup"+u,function(n){t._ctrlKey=n.ctrlKey;t._shiftKey=n.shiftKey})}},_selectFirstSlot:function(){this._createSelection(this.wrapper.find(".k-scheduler-content").find("td:first"))},_select:function(){var t=this,e=t.view(),c=t.wrapper,r=e.current(),u=t._selection,o;if(u&&(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 u=this,s=t.keyCode,w=u.view(),v=w.options.editable,c=u._selection,rt=n.extend(c),ft=s===16||s===18||s===17||s===91||s===92,k=u.toolbar.find(".k-scheduler-tools > li,.k-scheduler-navigation > li,.k-scheduler-views > li.k-state-selected:visible, .k-scheduler-views > li.k-current-view:visible"),h=u.toolbar.find(l),g=n(t.target).closest(l).length||u.toolbar.find(".k-scheduler-views .k-state-focused").length,a=h.children().index(u.toolbar.find("."+r)),y,nt=i.support.isRtl(u.element),p=nt?-1:1,b,tt,it,d,ut;if(a==-1&&(a=h.children().index(u.toolbar.find(".k-state-selected"))),u._ctrlKey=t.ctrlKey,u._shiftKey=t.shiftKey,s===f.F10){u.toolbar.find("ul > li:first").focus().addClass(r);t.preventDefault();return}if(s===f.TAB){if(u.toolbar.find("."+r).length){if(b=k.index(u.toolbar.find("."+r)),b===-1&&u._focusedView&&(b=k.index(u.toolbar.find(".k-scheduler-views > .k-state-selected"))),tt=t.shiftKey?k[b-1]:k[b+1],u.toolbar.find("."+r).removeClass(r),tt){n(tt).addClass(r).focus();u._focusedView=null;t.preventDefault();return}u.element.focus();t.preventDefault();return}}else if(s===f.ENTER||s===f.SPACEBAR){if(g&&u._focusedView&&!u._focusedView.hasClass("k-state-selected")){it=u._focusedView.data().name;u.trigger("navigate",{view:it,action:"changeView",date:u.date()})||(u.view(it),h.removeClass(o),u.toolbar.find(".k-current-view:visible").length&&(n(document.activeElement).blur(),u.toolbar.find(".k-current-view:visible").addClass(r).find(".k-link").focus()));t.preventDefault();return}if(u.toolbar.find("."+r+":visible").length){u.toolbar.find("."+r+":visible").click();t.preventDefault();return}}else if(t.altKey&&s===f.DOWN){if(u.toolbar.find("."+r+":visible").length){u.toolbar.find("."+r+":visible").click();t.preventDefault();return}}else{if(s===f.RIGHT&&g){n(u.toolbar.find("."+r)).removeClass(r);u._focusedView=nt?a-1==0?n(h.children(":not(.k-current-view):last")):n(h.children()[a+1*p]):a+1===h.children().length?n(h.children(":not(.k-current-view):first")):n(h.children()[a+1*p]);u._focusedView.focus().addClass(r);t.preventDefault();return}if(s===f.LEFT&&g){n(u.toolbar.find("."+r)).removeClass(r);u._focusedView=nt?a+1===h.children().length?n(h.children(":not(.k-current-view):first")):n(h.children()[a-1*p]):a-1==0?n(h.children(":not(.k-current-view):last")):n(h.children()[a-1*p]);u._focusedView.focus().addClass(r);t.preventDefault();return}if(s===f.DOWN&&u.toolbar.find(l).hasClass(o)){u.toolbar.find("."+r).removeClass(r);y=u._focusedView?h.find(u._focusedView).index():h.children(".k-scheduler-views > .k-state-selected").index();u._focusedView=y+1===h.children().length?n(h.children(":not(.k-current-view):first")):n(h.children()[y+1*p]);u._focusedView.focus().addClass(r);t.preventDefault();return}if(s===f.UP&&u.toolbar.find(l).hasClass(o)){u.toolbar.find("."+r).removeClass(r);y=u._focusedView?h.find(u._focusedView).index():h.children(".k-scheduler-views > .k-state-selected").index();u._focusedView=y-1==0?n(h.children(":not(.k-current-view):last")):n(h.children()[y-1*p]);u._focusedView.focus().addClass(r);t.preventDefault();return}if(t.altKey&&s===f.DOWN&&u.toolbar.find(".k-nav-current").hasClass(r)){u._showCalendar();t.preventDefault();return}if(s===f.ESC&&u.popup&&u.popup.visible()){u.popup.close();t.preventDefault();return}if(s===f.ESC&&u.toolbar.find(l).hasClass(o)){u.toolbar.find(l).removeClass(o);u.toolbar.find(l).children().removeClass(r);u._focusedView=null;u.toolbar.find(".k-current-view").focus().addClass(r);t.preventDefault();return}}if(!ft){if(!c){u._selectFirstSlot();u._select();u.element.focus();return}s===f.TAB?w.moveToEvent(c,t.shiftKey)&&(u._select(),u.element.focus(),t.preventDefault()):s===f.ENTER||s===f.SPACEBAR?c.events.length&&v?v.update!==!1&&u.editEvent(c.events[0]):v&&v.create!==!1&&(c.isAllDay&&(c=n.extend({},c,{end:i.date.addDays(c.end,-1)})),u.addEvent(e({},c,w._resourceBySlot(c)))):s===f.DELETE&&v!==!1&&v.destroy!==!1?u.removeEvent(c.events[0]):s>=49&&s<=57?(d=u._viewByIndex(s-49),d&&!u.trigger("navigate",{view:d,action:"changeView",date:u.date()})&&u.view(d)):w.move(c,s,t.shiftKey)&&(w.inRange(c)?u._select():(ut=u.date().getTime()>c.start.getTime()?"previous":"next",u.trigger("navigate",{view:u._selectedViewName,action:ut,date:c.start})?(c.start=rt.start,c.end=rt.end):u.date(c.start)),u.toolbar.find("ul > li").removeClass(r),t.preventDefault());u._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=ti(this._data,u));r&&r.uid&&(u=[r.uid]);this._updateSelection(r,u);this._adjustSelectedDate()},_updateSelection:function(n,r,u){var f=this._selection,e,s,o;n&&f&&(e=this.view(),n.uid&&(n=e._updateEventForSelection(n)),this._shiftKey&&f.start&&f.end?(s=n.end<f.end,f.end=n.endDate?n.endDate():n.end,s&&e._timeSlotInterval&&i.date.setTime(f.end,-e._timeSlotInterval())):(f.start=n.startDate?n.startDate():n.start,f.end=n.endDate?n.endDate():n.end),f.isAllDay="isDaySlot"in n?n.isDaySlot:n.isAllDay,u!==null&&u!==t&&(f.groupIndex=u),f.index=n.index,this._ctrlKey?(o=r&&r.length?f.events.indexOf(r[0]):-1,o>-1?f.events.splice(o,1):f.events=f.events.concat(r||[])):f.events=r||[])},options:{name:"Scheduler",date:wi,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,footer:{},messages:{today:"Today",pdf:"Export to PDF",save:"Save",cancel:"Cancel",destroy:"Delete",deleteWindowTitle:"Delete event",next:"Next",previous:"Previous",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:"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:[],orientation:"horizontal"},views:[],selectable:!1},events:[d,g,it,st,"add","dataBinding","dataBound","moveStart","move","moveEnd","resizeStart","resize","resizeEnd","navigate","change"],destroy:function(){var t=this,r;a.fn.destroy.call(t);t.dataSource&&(t.dataSource.unbind(ot,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();r=t.element.add(t.wrapper).add(t.toolbar).add(t.popup);r.off(u);clearTimeout(t._moveTimer);t._model=null;t.toolbar=null;t.element=null;n(window).off("resize"+u,t._resizeHandler);i.destroy(t.wrapper)},setDataSource:function(n){this.options.dataSource=n;this._dataSource();this.options.autoBind&&n.fetch()},items:function(){var n=this.wrapper.find(".k-scheduler-content"),t=this.view();return t&&t.options.name==="agenda"?n.find(".k-task"):n.find(".k-event").add(this.wrapper.find(".k-scheduler-header-wrap").find(".k-scheduler-header-all-day").siblings())},_movable:function(){var u,f,o,h,e,r,t=this,c,l,a,v,y=0,s=t._isMobile(),p=t.options.editable&&t.options.editable.move!==!1,w=t.options.editable&&t.options.editable.resize!==!1;(p||w&&s)&&(s&&i.support.mobileOS.android&&(y=5),t._moveDraggable=new i.ui.Draggable(t.element,{distance:y,filter:".k-event",ignore:".k-resize-handle",holdToDrag:s,autoScroll:!0}),p&&t._moveDraggable.bind("dragstart",function(n){var h=t.view(),y=n.currentTarget;if(!h.options.editable||h.options.editable.move===!1){n.preventDefault();return}if(s&&!y.hasClass("k-event-active")){t.element.find(".k-event-active").removeClass("k-event-active");n.preventDefault();return}e=t.occurrenceByUid(y.attr(i.attr("uid")));r=e.clone();a=r.start;v=r.end;r.update(h._eventOptionsForMove(r));u=h._slotByPosition(n.x.startLocation,n.y.startLocation);o=u.startOffset(n.x.startLocation,n.y.startLocation,t.options.snap);f=u;l={x:n.x.startLocation,y:n.y.startLocation};c=u;(!u||t.trigger("moveStart",{event:e}))&&n.preventDefault()}).bind("drag",function(s){var p=t.view(),y=p._slotByPosition(s.x.location,s.y.location),w,b;y&&(h=y.startOffset(s.x.location,s.y.location,t.options.snap),y.isDaySlot!==u.isDaySlot&&(r.isAllDay=y.isDaySlot,y.isDaySlot!==c.isDaySlot?(u=p._slotByPosition(s.x.location,s.y.location),o=u.startOffset(s.x.location,s.y.location,t.options.snap),r.start=i.timezone.toLocalDate(o),r.end=y.isDaySlot?i.timezone.toLocalDate(h):i.timezone.toLocalDate(y.endOffset(s.x.location,s.y.location,t.options.snap))):(u=n.extend(!0,{},c),o=u.startOffset(l.x,l.y,t.options.snap),r.start=a,r.end=v)),w=h-o,p._updateMoveHint(r,y.groupIndex,w),b=ei(r,w),t.trigger("move",{event:e,slot:{element:y.element,start:y.startDate(),end:y.endDate(),isDaySlot:y.isDaySlot},resources:p._resourceBySlot(y),start:b.start,end:b.end})?p._updateMoveHint(r,y.groupIndex,w):f=y)}).bind("dragend",function(s){var p,w;t.view()._removeMoveHint();var b=h-o,y=ei(r,b),l=y.start,a=y.end,v=t.view()._resourceBySlot(f),k=t.view()._resourceBySlot(u),d=t.trigger("moveEnd",{event:e,slot:{element:f.element,start:f.startDate(),end:f.endDate()},start:l,end:a,resources:v});d||e.start.getTime()===l.getTime()&&e.end.getTime()===a.getTime()&&c.isDaySlot===f.isDaySlot&&i.stringify(v)===i.stringify(k)||(p=t.view()._eventOptionsForMove(e),w=n.extend({isAllDay:f.isDaySlot,start:l,end:a},p,v),t._updateEvent(null,e,w,f.groupIndex));s.currentTarget.removeClass("k-event-active");this.cancelHold()}).bind("dragcancel",function(){t.view()._removeMoveHint();this.cancelHold()}),s&&(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")}),i.support.mobileOS.android||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",autoScroll:!0,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,u){var f=this,o=function(n,t){try{f._preventRefresh=!0;n.update(r);f._convertDates(n)}finally{f._preventRefresh=!1}f.trigger(st,{event:n})||(t&&t(),f._updateSelection(n,[n.uid],u),f.dataSource.sync())},s=function(n){return n.recurrenceRule?f.dataSource.getByUid(n.uid):f.dataSource.get(n.recurrenceId)},h=function(){var u=s(t),e,h;(n=="south"||n=="north")&&(r.start&&(e=i.date.getDate(u.start),i.date.setTime(e,et(r.start)),r.start=e),r.end&&(h=i.date.getDate(u.end),i.date.setTime(h,et(r.end)),r.end=h));f.dataSource._removeExceptions(u);o(u)},c=function(){var n=s(t),i=function(){f._convertDates(n)},r=n.toOccurrence({start:t.start,end:t.end});o(f.dataSource.add(r),i)},e;t.recurrenceRule||t.isOccurrence()?(e=f.options.messages.recurrenceMessages,f._showRecurringDialog(t,c,h,{title:e.editWindowTitle,text:e.editRecurring?e.editRecurring:bt,occurrenceText:e.editWindowOccurrence,seriesText:e.editWindowSeries})):o(f.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===k?u.confirmation:f.editable.confirmation;this._isEditorOpened()&&t.isRecurring()&&(r=this.options.messages.recurrenceMessages,o=r.deleteWindowTitle,s=t.isException()?r.deleteRecurringConfirmation?r.deleteRecurringConfirmation:ki:r.deleteSeriesConfirmation?r.deleteSeriesConfirmation:di);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(st,{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:bt,occurrenceText:i.editWindowOccurrence,seriesText:i.editWindowSeries})},_showRecurringDialog:function(n,t,i,r){var u=this,f=u.options.editable,e=h(f)?f.editRecurringMode:"dialog";e==="series"?i():e==="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 u=n.template||gi,t=typeof n===k?n:n.name||n.text,r={className:"k-scheduler-"+(t||"").replace(/\s/g,""),text:t,attr:""};if(!t&&!(h(n)&&n.template))throw new Error("Custom commands should have name specified");return h(n)?(n.className&&(n.className+=" "+r.className),t==="edit"&&h(n.text)&&(n=e(!0,{},n),n.text=n.text.edit),r=e(!0,r,ht[t],n)):r=e(!0,r,ht[t]),i.template(u)(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 kr(this.wrapper,e({},this.options,{target:this,timezone:n.dataSource.reader.timezone,resources:n.resources,createButton:w(this._createButton,this)})):n._editor=new dr(this.wrapper,e({},this.options,{target:this,createButton:w(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(g,{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=ti(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(d,{event:n})||this.dataSource.remove(n)&&this.dataSource.sync()},_deleteRecurringDialog:function(n){var t=this,i=n,s=t.options.editable,u,f,c,l,a=h(s)?s.editRecurringMode:"dialog",e,o,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)});e=l||f;o=c||u;t._isEditorOpened()?n.isException()?o():e():(r=t.options.messages.recurrenceMessages,t._showRecurringDialog(n,o,e,{title:r.deleteWindowTitle,text:r.deleteRecurring?r.deleteRecurring:bi,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(d,t._viewRemoveHandler),t._viewRemoveHandler=function(n){t.removeEvent(n.uid)},n.bind(d,t._viewRemoveHandler),t._viewAddHandler&&n.unbind(pt,t._viewAddHandler),t._viewAddHandler=function(n){t.addEvent(n.eventInfo)},n.bind(pt,this._viewAddHandler),t._viewEditHandler&&n.unbind(g,t._viewEditHandler),t._viewEditHandler=function(n){t.editEvent(n.uid)},n.bind(g,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=nr({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,s(n),s(r.end))&&t.setFullYear(n.getFullYear(),n.getMonth(),n.getDate())},_initializeView:function(n){var t=this.views[n],u,r;if(t)if(u=h(t),r=t.type,typeof r===k&&(r=i.getter(t.type)(window)),r)t=new r(this.wrapper,pr(e(!0,{},this.options,u?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,f,i,o,u,l,s;for(this.views={},this._viewsCount=0,u=0,l=c.length;u<l;u++)s=!1,n=c[u],f=h(n),f?(o=i=n.type?n.type:n,typeof o!==k&&(i=n.name||n.title,s=!0)):o=i=n,t=gr[i],t&&!s&&(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=e({title:i},t,f?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=yt(t)?{data:t}:t;!r.timezone||t instanceof b?t instanceof b&&(r.timezone=t.options.schema?t.options.schema.timezone:""):t=e(!0,t,{schema:{timezone:r.timezone}});n.dataSource&&n._refreshHandler?n.dataSource.unbind(ot,n._refreshHandler).unbind("progress",n._progressHandler).unbind("error",n._errorHandler):(n._refreshHandler=w(n.refresh,n),n._progressHandler=w(n._requestStart,n),n._errorHandler=w(n._error,n));n.dataSource=i.data.SchedulerDataSource.create(t).bind(ot,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&&s(n)>=s(this.options.min)&&s(n)<=s(this.options.max)&&this._model.set("selectedDate",n),s(this._model.get("selectedDate"))},_toolbar:function(){var t=this,f=t.options,e=[],s,r;f.toolbar&&(e=n.isArray(f.toolbar)?f.toolbar:[f.toolbar]);s=this._isMobilePhoneView()?ir:tr;r=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(r);t.toolbar=r;i.bind(t.toolbar,t._model);r.on(c+u,".k-pdf",function(n){n.preventDefault();t.saveAsPDF()});r.on(c+u,".k-scheduler-navigation li",function(r){var f=n(this),u=new Date(t.date()),e="",o=new Date,s=t.options.timezone,h;if(r.preventDefault(),f.hasClass("k-nav-today"))e="today",s?(h=i.timezone.offset(o,s),u=i.timezone.convert(o,o.getTimezoneOffset(),h)):u=o;else if(f.hasClass("k-nav-next"))e="next",u=t.view().nextDate();else if(f.hasClass("k-nav-prev"))e="previous",u=t.view().previousDate();else if(f.hasClass("k-nav-current")&&!t._isMobilePhoneView()){t._showCalendar();return}t.trigger("navigate",{view:t._selectedViewName,action:e,date:u})||t.date(u)});r.on(c+u,".k-scheduler-views li:not(.k-current-view), .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("."+o).removeClass(o))});r.on(c+u,".k-scheduler-views li.k-current-view",function(i){i.preventDefault();t.element.find(".k-scheduler-views").toggleClass(o);n(document).on(yi+u,function(i){n(i.target).closest(".k-scheduler-views").length===0&&(t.element.find("."+o).removeClass(o),n(document).off(c+u))})});r.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"),e=n('<div class="k-calendar-container"><div class="k-scheduler-calendar"/><\/div>');t.popup||(t.popup=new li(e,{anchor:i,open:function(){t.calendar||(t.calendar=new ai(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());t._selectedView.element.focus();t.toolbar.find(".k-nav-current").focus().addClass(r)},min:t.options.min,max:t.options.max}));t.calendar.element.on("keydown"+u,function(n){(n.keyCode===f.ESC||n.keyCode===f.TAB)&&(t.popup.close(),t._selectedView.element.focus(),t.toolbar.find(".k-nav-current").focus().addClass(r))});t.calendar.value(t.date())},copyAnchorStyles:!1}));t.popup.open();t.calendar.element.find("table").focus()},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.visibleEndDate()),t.refreshLayout(),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)}}),gr={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"}};y.plugin(lt);i.PDFMixin&&(i.PDFMixin.extend(lt.prototype),at="k-scheduler-pdf-export",lt.fn._drawPDF=function(t){var i=this.wrapper,f=i[0].style.cssText;i.css({width:i.width(),height:i.height()});i.addClass(at);var r=this,u=new n.Deferred,e=i.find(".k-scheduler-content").find("table").css("table-layout","auto");return setTimeout(function(){e.css("table-layout","fixed");r.resize(!0);r._drawPDFShadow({},{avoidLinks:r.options.pdf.avoidLinks}).done(function(n){var i={page:n,pageNumber:1,progress:1,totalPages:1};t.notify(i);u.resolve(i.page)}).fail(function(n){u.reject(n)}).always(function(){i[0].style.cssText=f;i.removeClass(at);r.resize(!0);r.resize(!0)})}),u});si=a.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.");a.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+'" aria-label="'+t.options.title+'"/>').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 aria-label="'+t.options.title+'"/>').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(){a.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)}});y.plugin(si);var nu=i.template('<option value="#=other_zone#">#=name#<\/option>'),tu=i.template('<option value="#=zone#">#=territory#<\/option>'),iu=a.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.");a.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,tu))},_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,nu,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(){a.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}});y.plugin(iu)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.touch",["kendo.core","kendo.userevents"],n)}(function(){return 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,fastTap:r.fastTap,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,fastTap:!1,filter:null,multiTouch:!1,enableSwipe:!1,minXDelta:30,maxYDelta:20,maxDuration:1e3,minHold:800,doubleTapTimeout:800},cancel:function(){this.events.cancel()},destroy:function(){this.events.destroy()},_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),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.gantt.list",["kendo.dom","kendo.touch","kendo.draganddrop","kendo.columnsorter","kendo.datetimepicker","kendo.editable"],n)}(function(){return function(n){function rt(n){for(var t=[],u=n.className,r=0,f=n.level;r<f;r++)t.push(i("span",{className:u}));return t}function k(){var i=t._activeElement();i&&i.nodeName.toLowerCase()!=="body"&&n(i).blur()}var t=window.kendo,o=t.dom,i=o.element,y=o.text,p=t.support.browser,w=t.support.mobileOS,s=t.ui,h=s.Widget,c=n.extend,e=t._outerWidth,l=t._outerHeight,d=n.map,g=n.isFunction,nt=p.msie&&p.version<9,a=t.keys,tt={title:"Title",start:"Start Time",end:"End Time",percentComplete:"% Done",parentId:"Predecessor ID",id:"ID",orderId:"Order ID"},v="string",u=".kendoGanttList",b="click",f=".",it="<table style='visibility: hidden;'><tbody><tr style='height:{0}'><td>&nbsp;<\/td><\/tr><\/tbody><\/table>",r=s.GanttList=h.extend({init:function(t,i){h.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=e(n(this));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&&this.content.height(this.element.height()-l(this.header.parent()))},destroy:function(){h.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(b+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 o.Tree(this.header[0]);this.contentTree=new o.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=d(n,function(n){return n=typeof n===v?{field:n,title:tt[n]}:n,c(new t,n)})},_layout:function(){var o=this,u=this.options,e=this.element,i=r.styles,s=function(){var f=typeof u.rowHeight===v?u.rowHeight:u.rowHeight+"px",i=n(t.format(it,f)),r;return o.content.append(i),r=l(i.find("tr")),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,[y(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===v?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=[],a=this.options.resourcesField,e=r.styles,c=n.task,o=n.column,u=c.get(o.field),f,l,s;if(o.field==a){for(u=u||[],f=[],s=0;s<u.length;s++)f.push(t.format("{0} [{1}]",u[s].get("name"),u[s].get("formatedValue")));f=f.join(", ")}else f=o.format?t.format(o.format,u):u;return o.field==="title"&&(h=rt({level:n.level,className:e.iconPlaceHolder}),h.push(i("span",{className:e.icon+" "+(c.summary?c.expanded?e.iconCollapse:e.iconExpand:e.iconHidden)})),l=t.format("{0}, {1:P0}",f,c.percentComplete)),h.push(i("span",{"aria-label":l},[y(f)])),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 r=this,o=this.options.resourcesField,s=this.columns,n,u,f=this.header.find("th["+t.attr("field")+"]"),e,h=function(n){(r.dataSource.total()===0||r.editable&&r.editable.trigger("validate"))&&n.preventDefault()},i=0,c=f.length;i<c;i++)n=s[i],n.sortable&&n.field!==o&&(e=f.eq(i),u=e.data("kendoColumnSorter"),u&&u.destroy(),e.attr("data-"+t.ns+"field",n.field).kendoColumnSorter({dataSource:this.dataSource,change:h}));f=null},_selectable:function(){var t=this,i=this.options.selectable;if(i)this.content.on(b+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;this._sortable()},_editable:function(){var t=this,f=this.options.editable,i=r.styles,e="span."+i.icon+":not("+i.iconHidden+")",o=function(){var n=t.editable;n&&(n.end()?t._closeCell():n.trigger("validate"))},s=function(t){var r=n(t.currentTarget);r.hasClass(i.editCell)||k()};if(f&&f.update!==!1){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(o,1)}).on("keydown"+u,function(n){n.keyCode===a.ENTER&&n.preventDefault()}).on("keyup"+u,function(n){var u=n.keyCode,i,r;switch(u){case a.ENTER:k();o();break;case a.ESC:t.editable&&(i=t._editableContainer,r=t._modelFromElement(i),t.trigger("cancel",{model:r,cell:i})||t._closeCell(!0))}});if(w)t.touch=t.content.kendoTouch({filter:"td",touchstart:function(n){s(n.touch)},doubletap:function(i){n(i.touch.initialTouch).is(e)||t._startEditHandler(i.touch)}}).data("kendoTouch");else t.content.on("mousedown"+u,"td",function(n){s(n)}).on("dblclick"+u,"td",function(i){n(i.target).is(e)||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&&g(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.editable.bind("validate",function(n){var t=this.element.find(":kendoFocusable:first").focus();nt&&t.focus();n.preventDefault()});this.trigger("edit",{model:c,cell:f})&&this._closeCell(!0)},_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 o=this,e=null,s=!0,u,i=r.styles,y=t.support.isRtl(this.element),p="tr["+t.attr("level")+" = 0]:last",h={},l=this.options.editable,v=function(){e=null;u=null;s=!0;h={}},b=function(n){for(var t=n;t;){if(e.get("id")===t.get("id")){s=!1;break}t=o.dataSource.taskParent(t)}},k=function(){var i=n(u).height(),r=t.getOffset(u).top;c(u,{beforeLimit:r+i*.25,afterLimit:r+i*.75})},d=function(n){if(u){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);h.className=r;h.command=e}},a=function(){return o._reorderDraggable.hint.children(f+i.dragStatus).removeClass(i.dropPositions)};l&&l.reorder!==!1&&l.update!==!1&&(this._reorderDraggable=this.content.kendoDraggable({distance:10,holdToDrag:w,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){var t=o.editable;if(t&&t.reorder!==!1&&t.trigger("validate")){n.preventDefault();return}e=o._modelFromElement(n.currentTarget);this.hint.children(f+i.dragClueText).text(e.get("title"));y&&this.hint.addClass(i.rtl)},drag:function(n){s&&(d(n.y),a().addClass(h.className))},dragend:function(){v()},dragcancel:function(){v()}}).data("kendoDraggable"),this._tableDropArea=this.content.kendoDropTargetArea({distance:0,group:"listGroup",filter:"tr[data-uid]",dragenter:function(n){u=n.dropTarget;b(o._modelFromElement(u));k();a().toggleClass(i.dropDenied,!s)},dragleave:function(){s=!0;a()},drop:function(){var n=o._modelFromElement(u),t=n.orderId,i={parentId:n.parentId};if(s){switch(h.command){case"add":i.parentId=n.id;break;case"insert-before":i.orderId=n.parentId===e.parentId&&n.orderId>e.orderId?t-1:t;break;case"insert-after":i.orderId=n.parentId===e.parentId&&n.orderId>e.orderId?t:t+1}o.trigger("update",{task:e,updateInfo:i})}}}).data("kendoDropTargetArea"),this._contentDropArea=this.element.kendoDropTargetArea({distance:0,group:"listGroup",filter:f+i.gridContent,drop:function(){var t=o._modelFromElement(o.content.find(p)),n=t.orderId,i={parentId:null,orderId:e.parentId!==null?n+1:n};o.trigger("update",{task:e,updateInfo:i})}}).data("kendoDropTargetArea"))},_resizable:function(){var t=this,i=r.styles,o=function(r){var u=n(r.currentTarget),f=t.resizeHandle,h=u.position(),c=h.left,a=e(u),v=u.closest("div"),y=r.clientX+n(window).scrollLeft(),o=t.options.columnResizeHandleWidth,s,p;if(c+=v.scrollLeft(),f||(f=t.resizeHandle=n('<div class="'+i.resizeHandle+'"><div class="'+i.resizeHandleInner+'" /><\/div>')),s=u.offset().left+a,p=y>s-o&&y<s+o,!p){f.hide();return}v.append(f);f.show().css({top:h.top,left:c+a-o-1,height:l(u),width:o*3}).data("th",u)};if(this.options.resizable){this._columnResizable&&this._columnResizable.destroy();this.header.find("thead").on("mousemove"+u,"th",o);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"),o=t.content.find("table");t.element.addClass("k-grid-column-resizing");this.col=o.children("colgroup").find(f).add(u.find(f));this.th=r;this.startLocation=i.x.location;this.columnWidth=e(r);this.table=u.add(o);this.totalWidth=this.table.width()-e(u.find("th:last"))},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(e(this.th)),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]}});c(!0,s.GanttList,{styles:{wrapper:"k-treelist k-grid k-widget",header:"k-header",alt:"k-alt",rtl:"k-rtl",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-i-insert-up k-i-insert-down k-i-plus k-i-insert-middle",dropTop:"k-i-insert-up",dropBottom:"k-i-insert-down",dropAdd:"k-i-plus",dropMiddle:"k-i-insert-middle",dropDenied:"k-i-cancel",dragStatus:"k-drag-status",dragClue:"k-drag-clue",dragClueText:"k-clue-text"}})}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.gantt.timeline",["kendo.dom","kendo.touch","kendo.draganddrop"],n)}(function(){return function(n){function bt(n){return delete n.name,delete n.prefix,delete n.views,n}function kt(n){var i=[],t=n.workWeekStart;for(i.push(t);n.workWeekEnd!=t;)t>6?t-=7:t++,i.push(t);return i}function v(){var t=kendo._activeElement();t&&t.nodeName.toLowerCase()!=="body"&&n(t).blur()}var s=kendo.ui.Widget,r=kendo.dom.element,a=kendo.dom.text,y=kendo.dom.html,rt=n.isPlainObject,h=kendo._outerWidth,o=kendo._outerHeight,c=n.extend,ut=n.proxy,p=kendo.support.browser,u=!1,ft=kendo.keys,w=kendo.data.Query,et="string",e=".kendoGanttTimeline",l="click",ot="dblclick",b="mousemove",st="mouseenter",k="mouseleave",ht="keydown",t=".",ct=kendo.template("#=kendo.toString(start, 't')#"),d=kendo.template("#=kendo.toString(start, 'ddd M/dd')#"),g=kendo.template("#=kendo.toString(start, 'ddd M/dd')# - #=kendo.toString(kendo.date.addDays(end, -1), 'ddd M/dd')#"),nt=kendo.template("#=kendo.toString(start, 'MMM')#"),lt=kendo.template("#=kendo.toString(start, 'yyyy')#"),at=kendo.template('<div class="#=styles.marquee#"><div class="#=styles.marqueeColor#"><\/div><\/div>'),tt=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>'),vt=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>'),yt=kendo.template('<div class="#=kendo.htmlEncode(styles.taskDetails)#"><strong>#=kendo.htmlEncode(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>'),pt="<table style='visibility: hidden;'><tbody><tr style='height:{0}'><td>&nbsp;<\/td><\/tr><\/tbody><\/table>",wt={day:{type:"kendo.ui.GanttDayView"},week:{type:"kendo.ui.GanttWeekView"},month:{type:"kendo.ui.GanttMonthView"},year:{type:"kendo.ui.GanttYearView"}},i=kendo.ui.GanttView=s.extend({init:function(n,r){s.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=kt(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(){s.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&&this.content.height(this.element.height()-o(this.header))},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,[a(" ")])]),u.push(f);return this._createTable(1,u,{className:e.rowsTable})},_columnsTable:function(){for(var e=[],o,s=i.styles,h=this._timeSlots(),l=h.length,u,n,c=0,t,f=0;f<l;f++)u=h[f],t={},n=u.span,c+=n,n!==1&&(t.colspan=n),u.isNonWorking&&(t.className=s.nonWorking),e.push(r("td",t,[a(" ")]));return o=r("tr",null,e),this._createTable(c,[o],{className:s.columnsTable})},_tasksTable:function(n){for(var v=[],h,o,f,t,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(),s,nt=function(n){var i,r;i=f.left;r=i+f.width;t.isMilestone()&&(i-=p/2,r=i+p);b[t.id]={start:i,end:r,rowIndex:n}},e=0,tt=n.length;e<tt;e++)t=n[e],f=this._taskPosition(t),f.borderWidth=g,h=r("tr",null),o=r("td"),t.start<=this.end&&t.end>=this.start&&(o.children.push(this._renderTask(n[e],f)),t[l]&&t[l].length&&(a=u?this._tableWidth-f.left:Math.max(f.width||y.clientWidth,0)+f.left,s={width:this._tableWidth-(a+d)+"px"},s[u?"right":"left"]=a+"px",w&&(s.height=w.cell+"px"),o.children.push(r("div",{className:c.resourcesWrap,style:s},this._renderResources(t[l],k[e%2])))),nt(e)),h.children.push(o),v.push(h);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,s,o=this.options.editable,c,v=t.left,f=i.styles,y=f.taskWrap,l=this.options.calculatedSize,a={},h={className:y,style:{left:v+"px"}};return l&&(h.style.height=l.cell+"px"),n.summary?s=this._renderSummary(n,t):n.isMilestone()?(s=this._renderMilestone(n,t),h.className+=" "+f.taskMilestoneWrap):s=this._renderSingleTask(n,t),e=r("div",h,[s]),o&&o.dependencyCreate!==!1&&(e.children.push(r("div",{className:f.taskDot+" "+f.taskDotStart})),e.children.push(r("div",{className:f.taskDot+" "+f.taskDotEnd}))),n.summary||n.isMilestone()||!o||o.dragPercentComplete===!1||o.update===!1||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,h=Math.round(t.width*n.percentComplete),o=[],s,e=this.options.editable,f;return this._taskTemplate!==null?s=y(this._taskTemplate(n)):(s=a(n.title),o.push(r("div",{className:u.taskComplete,style:{width:h+"px"}}))),f=r("div",{className:u.taskContent},[r("div",{className:u.taskTemplate},[s])]),o.push(f),e&&(e.destroy!==!1&&f.children.push(r("span",{className:u.taskActions},[r("a",{className:u.link+" "+u.taskDelete,href:"#","aria-label":"Delete"},[r("span",{className:u.icon+" "+u.iconDelete})])])),e.resize!==!1&&e.update!==!1&&(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"}},o)},_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")}},[a(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,s=this.options,c=s.messages;this._resizeHint=n(at({styles:u})).css({top:0,height:this._contentHeight});this.content.append(this._resizeHint);this._resizeTooltip=n(tt({styles:u,start:t.start,end:t.end,messages:c.views,format:s.resizeTooltipFormat})).css({top:0,left:0});this.content.append(this._resizeTooltip);this._resizeTooltipWidth=h(this._resizeTooltip);e=o(this._resizeTooltip);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(tt({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(vt({styles:i.styles,text:f})).appendTo(this.element),s=Math.round(h(e)/2),c=e.find(t+i.styles.callout),l=Math.round(h(c)/2);e.css({top:r-(o(e)+l),left:u-s});c.css("left",s-l)},_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 y=i.styles,p=this.options,s=this.content,a=s.offset(),k=s.width(),v=kendo.scrollLeft(s),d=n(f).parents("tr").first(),b=d.offset(),g=p.tooltip&&p.tooltip.template?kendo.template(p.tooltip.template):yt,c=u?e-(a.left+v+kendo.support.scrollbar()):e-(a.left-v),nt=b.top+o(d)-a.top+s.scrollTop(),l=this._taskTooltip=n('<div style="z-index: 100002;" class="'+y.tooltipWrapper+'" ><div class="'+y.taskContent+'"><\/div><\/div>'),w;l.css({left:c,top:nt}).appendTo(s).find(t+y.taskContent).append(g({styles:y,task:r,messages:p.messages.views}));o(l)<b.top-a.top&&l.css("top",b.top-a.top-o(l)+s.scrollTop());w=h(l);w+c-v>k&&(c-=w,c<v&&(c=v+k-(w+17)),l.css("left",c))},_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))},_scrollToDate:function(n){var i=this.start,r=this.end,t;n>=i&&n<r&&(t=this._offset(n),kendo.support.isRtl(this.element)&&(t=this._tableWidth-t),kendo.scrollLeft(this.content,t))},_timeSlots:function(){return!this._slots||!this._slots.length?[]:this._slots[this._slots.length-1]},_headers:function(n){for(var u,l,s=[],f,e,t,h,c=i.styles,o=0,a=n.length;o<a;o++){for(f=n[o],e=[],u=0,l=f.length;u<l;u++)t=f[u],h=y(t.text),e.push(r("th",{colspan:t.span,className:c.header+(t.isNonWorking?" "+c.nonWorking:"")},[h]));s.push(r("tr",null,e))}return s},_hours:function(n,t){var i,e=[],r=this.options,o=r.workDayStart.getHours(),h=r.workDayEnd.getHours(),f,u,s=r.hourSpan;for(n=new Date(n),t=new Date(t),r.showWorkHours&&n.setHours(o);n<t;)i=new Date(n),u=i.getHours(),f=u>=o&&u<h,i.setHours(i.getHours()+s),u==i.getHours()&&i.setHours(i.getHours()+2*s),(!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=t<kendo.date.nextDay(n)?t: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,e=[],r,u;for(n=new Date(n),t=new Date(t);n<t;)i=new Date(n),f=kendo.date.firstDayOfMonth(new Date(i.setMonth(i.getMonth()+1))),i=t<f?t:f,r=this._days(n,i),u=r.length,u>0&&e.push({start:r[0].start,end:r[u-1].end,span:u}),n=i;return e},_years:function(n,t){var i,r,u,f=[];for(n=new Date(n),t=new Date(t);n<t;)i=new Date(n),i=kendo.date.firstDayOfMonth(new Date(i.setMonth(12))),i>=t&&(i=t),u=i.getMonth()||12,r=u-n.getMonth(),f.push({start:n,end:i,span:r}),n=i;return f},_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(ut(this._renderCurrentTime,this),n.updateInterval))}}),it,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-i-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:ct,dayHeaderTemplate:d,resizeTooltipFormat:"h:mm tt ddd, MMM d"},range:function(n){var t=this.options.range;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));t&&t.start&&(this.start=kendo.date.getDate(t.start),this.start.setHours(t.start.getHours()));t&&t.end&&(this.end=kendo.date.getDate(t.end),this.end.setHours(t.end.getHours()))},_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:d,weekHeaderTemplate:g,resizeTooltipFormat:"h:mm tt ddd, MMM d"},range:function(n){var t=this.options.range,f=this.calendarInfo(),u=f.firstDay,r=n.end,i;u===r.getDay()&&r.setDate(r.getDate()+7);this.start=kendo.date.getDate(kendo.date.dayOfWeek(n.start,u,-1));this.end=kendo.date.getDate(kendo.date.dayOfWeek(r,u,1));t&&t.start&&(this.start=kendo.date.getDate(t.start));t&&t.end&&(i=new Date(t.end),this.end=kendo.date.getDate(i)<t.end?kendo.date.getDate(new Date(i.setDate(i.getDate()+1))):kendo.date.getDate(i))},_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:g,monthHeaderTemplate:nt,resizeTooltipFormat:"dddd, MMM d, yyyy"},range:function(n){var t=this.options.range,i;this.start=kendo.date.firstDayOfMonth(n.start);this.end=kendo.date.addDays(kendo.date.getDate(kendo.date.lastDayOfMonth(n.end)),1);t&&t.start&&(this.start=kendo.date.getDate(t.start));t&&t.end&&(i=new Date(t.end),this.end=kendo.date.getDate(i)<t.end?kendo.date.getDate(new Date(i.setDate(i.getDate()+1))):kendo.date.getDate(i))},_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:lt,monthHeaderTemplate:nt,resizeTooltipFormat:"dddd, MMM d, yyyy"},range:function(n){var t=this.options.range,i;this.start=kendo.date.firstDayOfMonth(new Date(n.start.setMonth(0)));this.end=kendo.date.firstDayOfMonth(new Date(n.end.setMonth(12)));t&&t.start&&(this.start=kendo.date.firstDayOfMonth(t.start));t&&t.end&&(i=kendo.date.firstDayOfMonth(t.end),this.end=kendo.date.getDate(new Date(i.setMonth(i.getMonth()+1))))},_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}});it={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=s.extend({init:function(n,t){s.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(){s.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 h=typeof r.rowHeight===et?r.rowHeight:r.rowHeight+"px",f=n(kendo.format(pt,h)),e,s,c=u.wrapper.find(t+i.tasksWrapper);return c.append(f),e=o(f.find("tr")),s=f.find("td").height(),f.remove(),{row:e,cell:s}};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=rt(n),i&&n.selectable===!1)||(t=i?typeof n.type!="string"?n.title:n.type:n,r=wt[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,r,u;if(t)if(i=t.type,typeof i=="string"&&(i=kendo.getter(t.type)(window)),i)r={},c(r,this.options.range,t.range),u=t.date||this.options.date,t=new i(this.wrapper,bt(c(!0,{headerTree:this._headerTree,taskTree:this._taskTree,dependencyTree:this._dependencyTree,calculatedSize:this._calculatedSize},t,this.options,{date:u,range:r})));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 w(n).sort({field:"start",dir:"asc"}).toArray()[0].start||new Date,i=new w(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(),r=this._range(n),i=t.options.date;this._tasks=n;t.range(r);t.renderLayout();t.render(n);i&&t._scrollToDate(i)},_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,s,h=this.options.snap,c=f.styles,o=this.options.editable,l=function(){n.view()._removeDragHint();r&&r.css("opacity",1);r=null;i=null;n.dragInProgress=!1};o&&o.move!==!1&&o.update!==!1&&(this._moveDraggable=new kendo.ui.Draggable(this.wrapper,{distance:0,filter:t+c.task,holdToDrag:kendo.support.mobileOS,ignore:t+c.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;s=u._timeByPosition(t.x.location,h)-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,h)-s),o=r;n.trigger("move",{task:i,start:r})||(e=r,u&&(o=new Date(e.getTime()+i.duration())),f._updateDragHint(o))}},15)).bind("dragend",function(){n.trigger("moveEnd",{task:i,start:e});l()}).bind("dragcancel",function(){l()}).userEvents.bind("select",function(){v()}))},_resizable:function(){var n=this,s,i,r,e,o,a=this.options.snap,h=f.styles,c=this.options.editable,l=function(){n.view()._removeResizeHint();s=null;i=null;n.dragInProgress=!1};c&&c.resize!==!1&&c.update!==!1&&(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});l()}).bind("dragcancel",function(){l()}).userEvents.bind("select",function(){v()}))},_percentResizeDraggable:function(){var n=this,e,i,c,l,a,o,s,w,y,r=f.styles,b,p=this.options.editable,k=function(){n.view()._removePercentCompleteTooltip();i=null;e=null;n.dragInProgress=!1},d=function(n){i.find(t+r.taskComplete).width(n).end().siblings(t+r.taskDragHandle).css(u?"right":"left",n)};p&&p.dragPercentComplete!==!1&&p.update!==!1&&(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;c=i.offset();l=this.element.offset();a=i.find(t+r.taskComplete).width();o=h(i);clearTimeout(n._tooltipTimeout);n.dragInProgress=!0}).bind("drag",kendo.throttle(function(t){if(n.dragInProgress){b=u?-t.x.initialDelta:t.x.initialDelta;var i=Math.max(0,Math.min(o,a+b));s=Math.round(i/o*100);d(i);w=c.top-l.top;y=c.left+i-l.left;u&&(y+=o-2*i);n.view()._updatePercentCompleteTooltip(w,y,s)}},15)).bind("dragend",function(){n.trigger("percentResizeEnd",{task:e,percentComplete:s/100});k()}).bind("dragcancel",function(){d(a);k()}).userEvents.bind("select",function(){v()}))},_createDependencyDraggable:function(){var r=this,u,e=n(),s=n(),l,a,y=p.msie&&p.version<9,i=f.styles,w=this.options.editable,b=function(){u.css("display","").removeClass(i.hovered);u.parent().removeClass(i.origin);u=null;c(!1);s=n();e=n();r.view()._removeDependencyDragHint();r.dragInProgress=!1},c=function(n){s.hasClass(i.origin)||(s.find(t+i.taskDot).css("display",n?"block":""),e.toggleClass(i.hovered,n))};w&&w.dependencyCreate!==!1&&(y&&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(n){if(r.trigger("dependencyDragStart")){n.preventDefault();return}u=n.currentTarget.css("display","block").addClass(i.hovered);u.parent().addClass(i.origin);var f=u.offset(),e=r.wrapper.find(t+i.tasksWrapper).offset();l=Math.round(f.left-e.left+o(u)/2);a=Math.round(f.top-e.top+h(u)/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)),o=r.wrapper.find(t+i.tasksWrapper).offset(),h=u.x.location-o.left,v=u.y.location-o.top;r.view()._updateDependencyDragHint({x:l,y:a},{x:h,y:v},y);c(!1);e=f.hasClass(i.taskDot)?f:n();s=f.closest(t+i.taskWrap);c(!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})}b()}).bind("dragcancel",function(){b()}).userEvents.bind("select",function(){v()}))},_selectable:function(){var i=this,r=f.styles;if(this.options.selectable)this.wrapper.on(l+e,t+r.task,function(t){t.stopPropagation();t.ctrlKey?i.trigger("clear"):i.trigger("select",{uid:n(this).attr("data-uid")})}).on(l+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(l+e,t+r.tasksWrapper,function(){i.selectDependency().length>0?i.clearSelection():i.trigger("clear")}).on(l+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,u=this.options.editable;if(u){this._tabindex();this.wrapper.on(l+e,t+r.taskDelete,function(u){i.trigger("removeTask",{uid:n(this).closest(t+r.task).attr("data-uid")});u.stopPropagation();u.preventDefault()}).on(ht+e,function(n){var t,r=i.options.editable;n.keyCode===ft.DELETE&&r&&r.dependencyDestroy!==!1&&(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.options.editable.update!==!1&&i.trigger("editTask",{uid:n(t.touch.currentTarget).attr("data-uid")})}}).data("kendoTouch");else this.wrapper.on(ot+e,t+r.task,function(t){i.options.editable.update!==!1&&(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,s=function(n){o=n.clientX};if(!u||u.visible!==!1)if(kendo.support.mobileOS){this.wrapper.on(l+e,t+r.taskDelete,function(n){n.stopPropagation();i.view()._removeTaskTooltip()}).on(k+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&&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(st+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(b,s)}}).on(k+e,t+r.task,function(){clearTimeout(i._tooltipTimeout);i.view()._removeTaskTooltip();n(this).off(b,s)})}});c(!0,f,{styles:it})}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.gantt",["kendo.data","kendo.popup","kendo.window","kendo.resizable","kendo.gantt.list","kendo.gantt.timeline","kendo.grid","kendo.pdf"],n)}(function(){return function(n,t){function l(n){return"["+i.attr("uid")+(n?"='"+n+"']":"]")}function ci(n){return delete n.name,delete n.prefix,delete n.remove,delete n.edit,delete n.add,delete n.navigate,n}function li(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 nt(t,r){var e=t.parents("["+i.attr("role")+'="gantt"]'),u=[],f=ai(e);t.attr(rt,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 ai(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,e=n.extend({F10:121},i.keys),ot="matchMedia"in window,st=i.support.browser,kt=i.support.mobileOS,ht=i.Observable,a=i.ui.Widget,v=i.data.DataSource,ct=i.data.ObservableObject,dt=i.data.ObservableArray,c=i.data.Query,w=n.isArray,gt=n.inArray,ni=i.isFunction,s=n.proxy,o=n.extend,y=n.isPlainObject,ti=n.map,p=i._outerWidth,lt=i._outerHeight,f=".kendoGantt",it="p0",rt="tabIndex",h="click",at="width",ut="string",ii={down:{origin:"bottom left",position:"top left"},up:{origin:"top left",position:"bottom left"}},d="aria-activedescendant",vt="gantt_active_cell",g="action-option-focused",r=".",ri=i.template('<button class="#=styles.buttonToggle#" type="button" aria-label="Toggle"><span class="#=styles.iconToggle#"><\/span><\/button>'),yt='<button class="#=styles.button# #=className#" type="button" #if (action) {#data-action="#=action#"#}#><span class="#=iconClass#"><\/span><span>#=text#<\/span><\/button>',ui='<a class="#=className#" #=attr# href="\\#">#=text#<\/a>',fi=i.template('<li class="#=styles.currentView# #=styles.viewButtonDefault#"><a href="\\#" class="#=styles.link#">&nbps;<\/a><\/li>'),ei=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>'),oi=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>'),si=function(t,r){var f={name:r.field,title:r.title},u=r.model.fields[r.field].validation;u&&y(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)},hi=function(t,i){n('<a href="#" class="'+i.styles.button+'">'+i.messages.assignButton+"<\/a>").click(i.click).appendTo(t)},b,pt=ht.extend({init:function(n,t){ht.fn.init.call(this);this.element=n;this.options=o(!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",g),this.list.find("ul").removeAttr(d).attr(d,g))},_popup:function(){var t=this,s=u.styles,c="li"+r+s.item,a=r+s.toolbar.appendButton,l=this.options.messages.actions,v=this.options.navigatable;this.list=n(oi({styles:s,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,o({anchor:this.element.find(a),open:function(){t._adjustListWidth()},animation:this.options.animation},ii[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(s.focused).attr("id",g).end().find("ul").attr({TABINDEX:0,"aria-activedescendant":g}).focus())});this.list.find(c).hover(function(){n(this).addClass(s.hovered)},function(){n(this).removeClass(s.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(s.focused).end().find("ul").attr(rt,0);t.element.parents("["+i.attr("role")+'="gantt"]').find(r+s.gridContent+" > table:first").focus()});this.list.find("ul").on("keydown"+f,function(n){var i=n.keyCode;switch(i){case e.UP:n.preventDefault();t._current("prev");break;case e.DOWN:n.preventDefault();t._current("next");break;case e.ENTER:t.list.find(r+s.focused).click();break;case e.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=p(t),n,f;(t.data(at)||!i)&&(n=window.getComputedStyle?window.getComputedStyle(e[0],null):0,f=n?parseFloat(n.width):p(e),n&&(st.mozilla||st.msie)&&(f+=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight)+parseFloat(n.borderLeftWidth)+parseFloat(n.borderRightWidth)),i=t.css("box-sizing")!=="border-box"?f-(p(t)-t.width()):f,o>i&&(i=o),t.css({fontFamily:e.css("font-family"),width:i}).data(at,i))},destroy:function(){clearTimeout(this._focusTimeout);this.popup.destroy();this.element.off(f);this.list.off(f);this.unbind()}}),wt=function(n,t){return function(i){i=w(i)?{data:i}:i;var r=i||{},u=r.data;if(r.data=u,!(r instanceof n)&&r instanceof v)throw new Error("Incorrect DataSource type. Only "+t+" instances are supported");return r instanceof n?r:new n(r)}},ft=i.data.Model.define({id:"id",fields:{id:{type:"number"},predecessorId:{type:"number"},successorId:{type:"number"},type:{type:"number"}}}),et=v.extend({init:function(n){v.fn.init.call(this,o(!0,{},{schema:{modelBase:ft,model:ft}},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()}}),k,tt;et.create=wt(et,"GanttDependencyDataSource");k=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:li,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}}});tt=v.extend({init:function(n){v.fn.init.call(this,o(!0,{},{schema:{modelBase:k,model:k}},n))},remove:function(n){var t=n.get("parentId"),i=this.taskAllChildren(n);return this._removeItems(i),n=v.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=v.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&&this._sort.length?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);ti(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 k)){var t=n;n=this._createNewModel();n.accept(t)}return n}});tt.create=wt(tt,"GanttDataSource");o(!0,i.data,{GanttDataSource:tt,GanttTask:k,GanttDependencyDataSource:et,GanttDependency:ft});var bt={desktop:{dateRange:si,resources:hi}},vi=i.Observable.extend({init:function(n,t){i.Observable.fn.init.call(this);this.element=n;this.options=o(!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:it}],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=o({},i.Template,this.options.templateSettings),p=a.paramName,c=u.styles.popup,s="",l,v,f,e;if(h)typeof h===ut&&(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>'):(e="#:",f.field?(f=i.expr(f.field,p),e+=f+"==null?'':"+f):e+="''",e+="#",e=i.template(e,a),s+='<div class="'+c.editField+'">'+e(n)+"<\/div>");return s}}),yi=vi.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")?(n.trigger("close",{window:n.container}),this.container.data("kendoWindow").bind("deactivate",t).close()):t()},showDialog:function(t){for(var c,e,o=t.buttons,f=u.styles.popup,s=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),h=0,l=o.length;h<l;h++)s+=this.createButton(o[h]);s+="<\/div><\/div><\/div>";c=this.element;this.popup&&this.popup.destroy();e=this.popup=n(s).appendTo(c).eq(0).on("click",r+f.button,function(t){t.preventDefault();e.close();var i=n(t.currentTarget).index();o[i].click()}).kendoWindow({modal:!0,autoFocus:!1,resizable:!1,draggable:!1,title:t.title,visible:!1,deactivate:function(){this.destroy();c.focus()}}).getKendoWindow();e.center().open();e.element.find(".k-primary").focus()},_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(bt.desktop,t),y=[],e,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}),s.options.editable.destroy!==!1&&(c+=this.createButton({name:"delete",text:l.destroy})),c+="<\/div><\/div><\/div>",e=this.container=n(c).appendTo(this.element).eq(0).kendoWindow(o({modal:!0,resizable:!1,draggable:!0,title:l.editor.editorTitle,visible:!1,close:function(n){n.userTriggered&&s.trigger("cancel",{container:e,model:t})&&n.preventDefault()}},{})),p=e.kendoEditable({fields:y,model:t,clearContainer:!1,validateOnBlur:!0,target:s.options.target}).data("kendoEditable"),i.cycleForm(e),this.trigger("edit",{container:e,model:t}))s.trigger("cancel",{container:e,model:t});else{e.data("kendoWindow").center().open();e.on(h+f,r+a.buttonCancel,function(n){n.preventDefault();n.stopPropagation();s.trigger("cancel",{container:e,model:t})});e.on(h+f,r+a.buttonSave,function(n){var r,u,f,i,o;for(n.preventDefault(),n.stopPropagation(),r=s.fields(bt.desktop,t),u={},i=0,o=r.length;i<o;i++)f=r[i].field,u[f]=t.get(f);s.trigger("save",{container:e,model:t,updateInfo:u})});e.on(h+f,r+a.buttonDelete,function(n){n.preventDefault();n.stopPropagation();s.trigger("remove",{container:e,model:t})})}return p}}),pi=a.extend({init:function(n,t){a.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()},close:function(){this.window.bind("deactivate",s(this.destroy,this)).close()},destroy:function(){this._dettachHandlers();this.grid.destroy();this.grid=null;this.window.destroy();this.window=null;a.fn.destroy.call(this);i.destroy(this.wrapper);this.element=this.wrapper=null},_attachHandlers:function(){var t=u.styles,e=this.grid,o=this._cancelProxy=s(this._cancel,this);this.container.on(h+f,r+t.buttonCancel,this._cancelProxy);this._saveProxy=s(this._save,this);this.container.on(h+f,r+t.buttonSave,this._saveProxy);this.window.bind("close",function(n){n.userTriggered&&o(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 e=this,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,open:function(){e.grid.resize(!0)}}).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=a.extend({init:function(n,t,r){w(t)&&(t={dataSource:t});b={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}};a.fn.init.call(this,n,t);r&&(this._events=r);this._wrapper();this._resources();this.options.views&&this.options.views.length||(this.options.views=["day","week","month"]);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);this.list.element.find("table[role=treegrid]").focus();return},clearSelection:function(){this.list.clearSelection()},destroy:function(){a.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);ot&&(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},setOptions:function(t){var r=i.deepExtend({},this.options,t),f=this._events,u;t.views||(u=this.view().name,r.views=n.map(this.options.views,function(n){var t=y(n),i=t?typeof n.type!="string"?n.title:n.type:n;return u===i?t?n.selected=!0:n={type:i,selected:!0}:t&&(n.selected=!1),n}));t.dataSource||(r.dataSource=this.dataSource);t.dependencies||(r.dependencies=this.dependencies);t.resources||(r.resources=this.resources);t.assignments||(r.assignments=this.assignments);this.destroy();this.element.empty();this.options=null;this.init(this.element,r,f);a.fn._setEvents.call(this,r)},_attachEvents:function(){this._resizeHandler=s(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 o=this,t=u.styles,w=r+t.toolbar.views+" > li",g=r+t.toolbar.pdfButton,nt=r+t.buttonToggle,p=r+t.gridContent,l=n(r+t.list),a=n(r+t.timeline),b=t.hovered,c=this.options.toolbar,k=n("<div class='"+t.toolbar.actions+"'>"),y,v,d,tt=function(n){n.matches?l.css({display:"none","max-width":0}):(l.css({display:"inline-block",width:"30%","max-width":"none"}),a.css("display","inline-block"),o.refresh(),a.find(p).scrollTop(o.scrollTop));o._resize()};ni(c)||(c=typeof c===ut?c:this._actions(c),c=s(i.template(c),this));d=n(ri({styles:t.toolbar}));v=n(ei({ns:i.ns,views:this.timeline.views,styles:t.toolbar}));k.append(c({}));y=n("<div class='"+t.toolbar.headerWrapper+"'>").append(d).append(v).append(k);v.find("li").length>1&&v.prepend(fi({styles:t.toolbar}));this.wrapper.prepend(y);this.toolbar=y;ot&&(this._mediaQueryHandler=s(tt,this),this._mediaQuery=window.matchMedia("(max-width: 480px)"),this._mediaQuery.addListener(this._mediaQueryHandler));y.on(h+f,w,function(u){u.preventDefault();var f=o.list,e=n(this).attr(i.attr("name")),s=v.find(r+t.toolbar.currentView);(s.is(":visible")&&s.parent().toggleClass(t.toolbar.expanded),f.editable&&f.editable.trigger("validate"))||(o.trigger("navigate",{view:e})||o.view(e),o.toolbar.find(r+t.focused).removeClass(t.focused))}).on("keydown"+f,w,function(i){var u=n(r+t.toolbar.views).children(":not(.k-current-view)"),f=u.index(o._focusedView&&o._focusedView[0]||u.closest(r+t.selected)[0]);i.keyCode===e.RIGHT?(n(o.toolbar.find(r+t.focused)).removeClass(t.focused),o._focusedView=f+1===u.length?n(u[0]):n(u[f+1]),o._focusedView.focus().addClass(t.focused),i.preventDefault()):i.keyCode===e.LEFT?(n(o.toolbar.find(r+t.focused)).removeClass(t.focused),o._focusedView=f===0?n(u[u.length-1]):n(u[f-1]),o._focusedView.focus().addClass(t.focused),i.preventDefault()):i.keyCode===e.DOWN&&o.toolbar.find(r+t.toolbar.currentView).parent().hasClass(t.toolbar.expanded)?(n(o.toolbar.find(r+t.focused)).removeClass(t.focused),o._focusedView=f+1===u.length?n(u[0]):n(u[f+1]),o._focusedView.focus().addClass(t.focused),i.preventDefault()):i.keyCode===e.UP&&o.toolbar.find(r+t.toolbar.currentView).parent().hasClass(t.toolbar.expanded)?(n(o.toolbar.find(r+t.focused)).removeClass(t.focused),o._focusedView=f===0?n(u[u.length-1]):n(u[f-1]),o._focusedView.focus().addClass(t.focused),i.preventDefault()):(i.keyCode===e.ENTER||i.keyCode===e.SPACEBAR)&&o._focusedView?(o.view(o._focusedView.text().toLowerCase()),i.preventDefault()):(i.keyCode===e.SPACEBAR||i.keyCode===e.ENTER||i.keyCode===e.DOWN&&i.altKey)&&o.toolbar.find(r+t.toolbar.currentView+" > a").hasClass(t.focused)?(o.toolbar.find(r+t.toolbar.currentView).parent().toggleClass(t.toolbar.expanded),i.preventDefault()):i.keyCode===e.ESC&&o.toolbar.find(r+t.toolbar.currentView).parent().hasClass(t.toolbar.expanded)?(o.toolbar.find(r+t.toolbar.currentView).parent().toggleClass(t.toolbar.expanded).blur(),o._focusedView=null,o.toolbar.find(r+t.toolbar.currentView+" > a").addClass(t.focused).focus(),i.preventDefault()):i.keyCode>=49&&i.keyCode<=57&&o.view(o.timeline._viewByIndex(i.keyCode-49))}).on(h+f,g,function(n){n.preventDefault();o.saveAsPDF()}).on(h+f,nt,function(n){n.preventDefault();l.is(":visible")?(l.css({display:"none",width:"0"}),a.css({display:"inline-block",width:"100%"}),o.refresh(),a.find(p).scrollTop(o.scrollTop)):(a.css({display:"none",width:0}),l.css({display:"inline-block",width:"100%","max-width":"none"}).find(p).scrollTop(o.scrollTop));o._resize()});this.wrapper.on("focusout"+f,function(i){n(i.relatedTarget).closest(r+t.toolbar.toolbar).length||o.toolbar.find(r+t.focused).removeClass(t.focused);n(i.relatedTarget).closest(r+t.toolbar.views).length||o.toolbar.find(r+t.toolbar.views).removeClass(t.toolbar.expanded)}).find(r+t.toolbar.toolbar+" li").hover(function(){n(this).addClass(b)},function(){n(this).removeClass(b)})},_actions:function(){var r=this.options,u=r.editable,n=r.toolbar,i="",t,f;if(!w(n))if(u&&u.create!==!1)n=["append"];else return i;for(t=0,f=n.length;t<f;t++)i+=this._createButton(n[t]);return i},_footer:function(){var r=this.options.editable;if(r&&r.create!==!1){var t=u.styles.toolbar,e=this.options.messages.actions,s=n(i.template(yt)(o(!0,{styles:t},b.append,{text:e.append}))),h=n("<div class='"+t.actions+"'>").append(s),f=n("<div class='"+t.footerWrapper+"'>").append(h);this.wrapper.append(f);this.footer=f}},_createButton:function(n){var f=n.template||yt,e=this.options.messages.actions,t=typeof n===ut?n:n.name||n.text,s=b[t]?b[t].className:"k-gantt-"+(t||"").replace(/\s/g,""),r={iconClass:"",action:"",text:t,className:s,styles:u.styles.toolbar};if(!t&&!(y(n)&&n.template))throw new Error("Custom commands should have name specified");return r=o(!0,r,b[t],{text:e[t]}),y(n)&&(n.className&&gt(r.className,n.className.split(" "))<0&&(n.className+=" "+r.className),r=o(!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=lt(this.toolbar),l=this.footer?lt(this.footer):0,a=n.height(),f=n.width(),e=p(n.find(s)),h=p(n.find(i));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,o=this.timeline,f=this.options.editable,e=function(t){var f=t.type,r,s=n.dataSource,i=s._createNewModel(),e=n.dataItem(n.select()),l=s.taskParent(e),h=o.view()._timeSlots()[0],u=f==="add"?e: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=e.get("orderId"),r=f==="insert-before"?r:r+1),n._createTask(i,r))};f&&f.create!==!1&&(this.footerDropDown=new pt(this.footer.children(t).eq(0),{messages:{actions:i},direction:"up",animation:{open:{effects:"slideIn:up"}},navigatable:n.options.navigatable}),this.headerDropDown=new pt(this.toolbar.children(t).eq(0),{messages:{actions:i},navigatable:n.options.navigatable}),this.footerDropDown.bind("command",e),this.headerDropDown.bind("command",e))},_list:function(){for(var n=this,v=n.options.navigatable,e=u.styles,o=this.wrapper.find(r+e.list),y=o.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:p(o),resourcesField:this.resources.field,rowHeight:this.options.rowHeight},l=c.columns,t,a=function(){v&&(n._current(n._cachedCurrent),nt(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=s(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=ci(o(!0,{resourcesField:this.resources.field},this.options)),e=this.wrapper.find(r+t.timeline+" > div"),s=r+t.toolbar.currentView+" > "+r+t.toolbar.link;this.timeline=new i.ui.GanttTimeline(e,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=w(n)?{data:n}:n;this.dataSource&&this._refreshHandler?this.dataSource.unbind("change",this._refreshHandler).unbind("progress",this._progressHandler).unbind("error",this._errorHandler):(this._refreshHandler=s(this.refresh,this),this._progressHandler=s(this._requestStart,this),this._errorHandler=s(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=w(n)?{data:n}:n;this.dependencies&&this._dependencyRefreshHandler?this.dependencies.unbind("change",this._dependencyRefreshHandler).unbind("error",this._dependencyErrorHandler):(this._dependencyRefreshHandler=s(this.refreshDependencies,this),this._dependencyErrorHandler=s(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"};o(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=s(this.refresh,this);this.assignments={dataTaskIdField:"taskId",dataResourceIdField:"resourceId",dataValueField:"value"};o(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 yi(this.wrapper,o({},this.options,{target:this,resources:{field:this.resources.field,editor:s(this._createResourceEditor,this)},createButton:s(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)}).bind("close",n._onDialogClose)},_onDialogClose:function(){},_createResourceEditor:function(n,t){var r=this,f=t instanceof ct?t:t.model,h=f.get("id"),i=this.options.messages,e=r.resources.field,c=this._resourceEditor=new pi(n,{resourcesField:e,data:this._wrapResourceData(h),model:f,messages:o({},i.editor),buttons:[{name:"update",text:i.save,className:u.styles.primary},{name:"cancel",text:i.cancel}],createButton:s(this._createPopupButton,this),save:function(n){r._updateAssignments(n.model.get("id"),n.model.get(e))}});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&&!(y(n)&&n.template))throw new Error("Custom commands should have name specified");return y(n)&&(n.className&&(n.className+=" "+t.className),t=o(!0,t,n)),i.template(ui)(t)},view:function(n){return this.timeline.view(n)},range:function(n){var r=this.dataSource,t=this.view(),i=this.timeline;return n&&(t.options.range={start:n.start,end:n.end},i._render(r.taskTree()),i._renderDependencies(this.dependencies.view())),{start:t.start,end:t.end}},date:function(n){var t=this.view();return n&&(t.options.date=n,t._scrollToDate(n)),t.options.date},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(o(!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 dt([])),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)||it,a=i.toString(h,l);n[t.field].push(new ct({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)||it,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 c=this,o=u.styles,s=r+o.gridContent,h=r+o.gridHeaderWrap,l=this.timeline.element.find(h),t=this.timeline.element.find(s),a=this.list.element.find(h),e=this.list.element.find(s);kt&&e.css("overflow-y","auto");t.on("scroll",function(){c.scrollTop=this.scrollTop;l.scrollLeft(this.scrollLeft);e.scrollTop(this.scrollTop)});e.on("scroll",function(){a.scrollLeft(this.scrollLeft)}).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,v=this.options.navigatable,ut=this.options.editable,y=this.list.header.find("table"),s=this.list.content.find("table"),o=u.styles,h=i.support.isRtl(this.wrapper),c=this.timeline.element.find(r+o.gridContent),ft=y.add(s),p=l(),w,a={collapse:!1,expand:!0},b=function(n){var i=t.timeline.view()._timeSlots()[0].offsetWidth;c.scrollLeft(c.scrollLeft()+(n?-i:i))},k=function(n){var i=t.timeline.view()._rowHeight;c.scrollTop(c.scrollTop()+(n?-i:i))},d=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"?nt(y):t.current.is("th")&&n=="next"&&nt(s)},g=function(n){var i=t.current[n]();i.length!==0&&(t._current(i),w=t.current.index())},tt=function(n){var i=t.dataItem(t.current);i.summary&&i.expanded!==n&&i.set("expanded",n)},it=function(){var r=t.options.editable,n,u;r&&r.destroy!==!1&&!t.list.editable&&(n=t.select(),u=i.attr("uid"),n.length&&t.removeTask(n.attr(u)))};n(this.wrapper).on("mousedown"+f,"tr"+p+", div"+p+":not("+r+o.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||(v&&(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)),(v||ut)&&!e&&(t._focusTimeout=setTimeout(function(){nt(t.list.content.find("table"),!0)},2)))}).on("keydown"+f,function(t){var h=t.keyCode,i=this,u=n(i._getToolbarItems()),f=u.index(i.toolbar.find(r+o.focused)[0]),s;if(f===-1&&n(t.target).closest(r+o.toolbar.views).length&&(f=u.index(i.toolbar.find(".k-gantt-views > .k-state-selected:visible > a, .k-current-view:visible > a")[0])),s=t.shiftKey?u[f-1]:u[f+1],h===e.F10)i.toolbar.find(".k-button:visible:first").addClass(o.focused).focus(),t.preventDefault();else if(h==e.TAB&&n(t.target).closest(r+o.toolbar.toolbar).length){if(i.toolbar.find(r+o.focused).removeClass(o.focused).blur(),s){n(s).addClass(o.focused).focus();t.preventDefault();return}this.list.element.is(":visible")?this.list.element.find("table[role=treegrid]").focus():this.element.find(r+o.tasks)[0].focus();t.preventDefault()}}.bind(this));if(v!==!0){s.on("keydown"+f,function(n){n.keyCode==e.DELETE&&it()});return}ft.on("focus"+f,function(){var u=this===s.get(0)?"td":"th",i=t.select(),f=t.current||n(i.length?i:this).find(u+":eq("+(w||0)+")");t._current(f);n(t.toolbar.find(r+o.focused)).removeClass(o.focused);n(t.toolbar.find(r+o.toolbar.currentView)).parent().removeClass(o.toolbar.expanded)}).on("blur"+f,function(){t._current();this==y&&n(this).attr(rt,-1)}).on("keydown"+f,function(i){var r=i.keyCode,u;if(t.current){u=t.current.is("td");switch(r){case e.RIGHT:i.preventDefault();i.altKey?b():i.ctrlKey?tt(h?a.collapse:a.expand):g(h?"prev":"next");break;case e.LEFT:i.preventDefault();i.altKey?b(!0):i.ctrlKey?tt(h?a.expand:a.collapse):g(h?"next":"prev");break;case e.UP:i.preventDefault();i.altKey?k(!0):d("prev");break;case e.DOWN:i.preventDefault();i.altKey?k():d("next");break;case e.SPACEBAR:i.preventDefault();u&&t.select(t.current.closest("tr"));break;case e.ENTER:if(i.preventDefault(),u){if(t.options.editable&&t.options.editable.update!==!1){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 e.ESC:break;case e.DELETE:u&&it();break;default:r>=49&&r<=57&&t.view(t.timeline._viewByIndex(r-49))}}})},_getToolbarItems:function(){return this.toolbar.find(".k-gantt-toggle:visible").toArray().concat(this.toolbar.find(".k-gantt-actions > .k-button:visible").toArray(),this.toolbar.find(".k-gantt-views > .k-state-selected:visible > a, .k-current-view:visible > a").toArray())},_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",vt),r=n(i._activeElement()),r.is("table")&&this.wrapper.find(r).length>0&&r.removeAttr(d).attr(d,vt)):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 i=u.styles,n="."+i.list,r=this.wrapper.find(n).width(),t=this.wrapper.clone();return t.find(n).css("width",r),this._drawPDFShadow({content:t},{avoidLinks:this.options.pdf.avoidLinks})});i.ui.plugin(u);o(!0,u,{styles:{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",tasks:"k-gantt-tasks",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-file-pdf",iconToggle:"k-icon k-i-layout-1-by-4",viewButtonDefault:"k-state-default",viewButton:"k-view",currentView:"k-current-view",link:"k-link",pdfButton:"k-gantt-pdf",appendButton:"k-gantt-create"}}})}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.treelist",["kendo.dom","kendo.data","kendo.columnsorter","kendo.editable","kendo.window","kendo.filtermenu","kendo.selectable","kendo.resizable","kendo.treeview.draganddrop"],n)}(function(){return function(n,t){function rt(n){return function(t){return t[n]}}function rr(n){return function(t){return!n(t)}}function lr(){return this.style.display!=="none"}function ar(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 ur(n){for(var t=[],r=n.className,i=0,u=n.level;i<u;i++)t.push(s("span",{className:r}));return t}function fr(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 vr(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"}}function er(t){return n(t).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")}function l(t,i){var f=y.msie||y.edge,r,u;if(i===!0){if(t=n(t),r=t.parent().scrollTop(),u=t.parent().scrollLeft(),f)try{t[0].setActive()}catch(e){t[0].focus()}else t[0].focus();t.parent().scrollTop(r).scrollLeft(u)}else n(t).one("focusin",function(n){n.preventDefault()}).focus()}var ft=kendo.data,e=n.extend,o=kendo.dom,s=o.element,pt=o.text,d=o.html,w=kendo._outerWidth,f=kendo.keys,wt=kendo._outerHeight,g=kendo.ui,bt=g.DataBoundWidget,v=ft.DataSource,ri=ft.ObservableArray,it=ft.Query,b=ft.Model,y=kendo.support.browser,r=n.proxy,kt=n.map,h=n.grep,et=n.inArray,ui=n.isPlainObject,fi=Array.prototype.push,ei="string",k="change",dt="error",gt="progress",p=".",u=".kendoTreeList",ot="click",or="mousedown",oi="edit",st="save",si="expand",hi="collapse",ci="remove",li="dataBinding",ai="dataBound",ht="cancel",ni="tabIndex",vi="filterMenuInit",yi="columnHide",pi="columnShow",sr="th.k-header",wi="columnReorder",ti="columnResize",bi="columnMenuInit",ki="columnLock",di="columnUnlock",nt="parentId",gi="dragstart",nr="drag",tr="drop",ir="dragend",ct="tr:visible",c="td:visible",lt="th:visible",at=ct+" > td:first:visible",hr="tr:not(.k-footer-template):visible:last",cr="th:visible",vt=!1,i={wrapper:"k-treelist k-grid k-widget k-display-block",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",focused:"k-state-focused",loading:"k-i-loading",refresh:"k-i-reload",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-i-filter",iconCollapse:"k-i-collapse",iconExpand:"k-i-expand",iconHidden:"k-i-none",iconPlaceHolder:"k-icon k-i-none",input:"k-input",dropPositions:"k-i-insert-up k-i-insert-down k-i-plus k-i-insert-middle",dropTop:"k-i-insert-up",dropBottom:"k-i-insert-down",dropAdd:"k-i-plus",dropMiddle:"k-i-insert-middle",dropDenied:"k-i-cancel",dragStatus:"k-drag-status",dragClue:"k-drag-clue",dragClueText:"k-clue-text"},ii={create:{imageClass:"k-i-plus",className:"k-grid-add",methodName:"addRow"},createchild:{imageClass:"k-i-plus",className:"k-grid-add",methodName:"addRow"},destroy:{imageClass:"k-i-close",className:"k-grid-delete",methodName:"removeRow"},edit:{imageClass:"k-i-edit",className:"k-grid-edit",methodName:"editRow"},update:{imageClass:"k-i-check",className:"k-primary k-grid-update",methodName:"saveRow"},canceledit:{imageClass:"k-i-cancel",className:"k-grid-cancel",methodName:"_cancelEdit"},excel:{imageClass:"k-i-file-excel",className:"k-grid-excel",methodName:"saveAsExcel"},pdf:{imageClass:"k-i-file-pdf",className:"k-grid-pdf",methodName:"saveAsPDF"}},a=b.define({id:"id",parentId:nt,fields:{id:{type:"number"},parentId:{type:"number",nullable:!0}},init:function(n){b.fn.init.call(this,n);this._loaded=!1;this.parentIdField||(this.parentIdField=nt);this.parentId=this.get(this.parentIdField)},accept:function(n){b.fn.accept.call(this,n);this.parentId=this.get(this.parentIdField)},set:function(n,t,i){n==nt&&this.parentIdField!=nt&&(this[this.parentIdField]=t);b.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 b.fn.shouldSerialize.call(this,n)&&n!=="_loaded"&&n!="_error"&&n!="_edit"&&!(this.parentIdField!=="parentId"&&n==="parentId")}}),tt;a.parentIdField=nt;a.define=function(n,i){var r,u;return i===t&&(i=n,n=a),r=i.parentId||nt,i.parentIdField=r,u=b.define(n,i),r&&(u.parentIdField=r),u};tt=v.extend({init:function(n){v.fn.init.call(this,e(!0,{},{schema:{modelBase:a,model:a}},n))},_createNewModel:function(n){var t={},i=n instanceof b;return i&&(t=n),t=v.fn._createNewModel.call(this,t),i||(n.parentId&&(n[t.parentIdField]=n.parentId),t.accept(n)),t},_shouldWrap:function(){return!0},_push:function(n,t){var i=v.fn._readData.call(this,n);i||(i=n);this[t](i)},_readData:function(n,t){var i=this.data(),u=i,r,f;return(n=v.fn._readData.call(this,n),r=i.toJSON().concat(n),t&&t.id&&(f=this.get(t.id),this.childNodes(f).length>0&&(r=n,u=this._subtree(this._childrenMap(this.data()),t.id))),this._replaceData(r,u),n instanceof ri)?n:i},_replaceData:function(n,t){for(var r=n.length,i=0;i<r;i++)t[i]=n[i];t.length=r},_readAggregates:function(n){var t=e(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);v.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 it(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 i,f,s,u,e,o;for(t=t||{},i={},e=t.filter,e&&(n=it.process(n,{filter:e,filterCallback:r(this._filterCallback,this)}).data),o=this._childrenMap(n),i[this._defaultParentId()]=new it(this._subtree(o,this._defaultParentId())).aggregate(t.aggregate),u=0;u<n.length;u++)f=n[u],s=this._subtree(o,f.id),i[f.id]=new it(s).aggregate(t.aggregate);return i},_queryProcess:function(n,t){t=t||{};t.filterCallback=r(this._filterCallback,this);var s=this._defaultParentId(),o=it.process(n,t),h=this._childrenMap(o.data),f,u,i,e;for(n=h[s]||[],u=0;u<n.length;u++)(i=n[u],i.id!==s)&&(e=h[i.id],f=!!(e&&e.length),i.loaded()||i.loaded(f||!i.hasChildren),(i.loaded()||i.hasChildren!==!0)&&(i.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&&typeof t.id!="undefined"||(this._data=this._observe([])),v.fn.success.call(this,n,t)},load:function(t){var i="_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&&(i="read");return this[i]({id:t.id}).done(r(this._modelLoaded,this,t.id)).fail(r(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 a||(n=this.get(n));do n=this.parentNode(n),t++;while(n);return t},filter:function(n){var i=v.fn.filter;if(n===t)return i.call(this,n);i.call(this,n)}});tt.create=function(t){return n.isArray(t)?t={data:t}:t instanceof ri&&(t={data:t.toJSON()}),t instanceof tt?t:new tt(t)};var yt=kendo.Observable.extend({init:function(n,t){kendo.Observable.fn.init.call(this);t=this.options=e(!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 g.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}}),yr=yt.extend({init:function(n,t){yt.fn.init.call(this,n,t);this._attachHandlers();kendo.cycleForm(this.wrapper);this.open()},events:[ht,st],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 o.Tree(this.wrapper.children()[0]).render(t);this.wrapper.appendTo(i.appendTo);this.window=new g.Window(this.wrapper,i.window)},_appendTemplate:function(n){var t=this.options.template;typeof t===ei&&(t=window.unescape(t));t=kendo.template(t)(this.model);n.push(d(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(d('<div class="k-edit-label"><label for="'+t.field+'">'+(t.title||t.field||"")+"<\/label><\/div>")),this._isEditable(t)?n.push(d("<div "+kendo.attr("container-for")+'="'+t.field+'" class="k-edit-field"><\/div>')):n.push(s("div",{"class":"k-edit-field"},[this.options.fieldRenderer(t,this.model)])))},_appendButtons:function(n){n.push(s("div",{"class":"k-edit-buttons k-state-default"},this.options.commandRenderer()))},_attachHandlers:function(){var n=this._cancelProxy=r(this._cancel,this);this.wrapper.on(ot+u,".k-grid-cancel",this._cancelProxy);this._saveProxy=r(this._save,this);this.wrapper.on(ot+u,".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(u)},_cancel:function(n){this.trigger(ht,n)},_save:function(){this.trigger(st)},open:function(){this.window.center().open()},close:function(){this.window.bind("deactivate",r(this.destroy,this)).close()},destroy:function(){this.window.destroy();this.window=null;this._dettachHandlers();yt.fn.destroy.call(this)}}),ut=bt.extend({init:function(t,i){if(bt.fn.init.call(this,t,i),vt=kendo.support.isRtl(t),this._dataSource(this.options.dataSource),this._aria(),this._columns(),this._layout(),this._navigatable(),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"+u,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:r(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:r(function(n){this.wrapper.addClass("k-treelist-dragging");var t=this.dataItem(n);return this.trigger(gi,{source:t})},this),drag:r(function(n){n.source=this.dataItem(n.source);this.trigger(nr,n)},this),drop:r(function(n){return n.source=this.dataItem(n.source),n.destination=this.dataItem(n.destination),this.wrapper.removeClass("k-treelist-dragging"),this.trigger(tr,n)},this),dragend:r(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(ir,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 f,i,t;this.options.scrollable&&(f=this.thead.closest(".k-grid-header-wrap"),i=n(this.lockedContent).bind("DOMMouseScroll"+u+" mousewheel"+u,r(this._wheelScroll,this)),this.content.bind("scroll"+u,function(){f.scrollLeft(this.scrollLeft);i.scrollTop(this.scrollTop)}),t=kendo.touchScroller(this.content),t&&t.movable&&(this._touchScroller=t,t.movable.bind("change",function(n){f.scrollLeft(-n.sender.x);i&&i.scrollTop(-n.sender.y)})))},_wheelScroll:function(t){if(!t.ctrlKey){var r=kendo.wheelDeltaY(t),i=n(t.currentTarget);if(r){i[0].scrollHeight>i[0].clientHeight&&(i[0].scrollTop<i[0].scrollHeight-i[0].clientHeight&&r<0||i[0].scrollTop>0&&r>0)&&t.preventDefault();i.one("wheel"+u,!1);this.content.scrollTop(this.content.scrollTop()+-r)}}},_progress:function(){var n=this.options.messages;this.tbody.find("tr").length||this._showStatus(kendo.template("<span class='#= className #' /> #: messages.loading #")({className:i.icon+" "+i.loading,messages:n}))},_error:function(n){this.dataSource.rootNodes().length||this._render({error:n})},refresh:function(t){if((t=t||{},t.action!="itemchange"||!this.editor)&&!this.trigger(li)){var i=n(this.current()),r=!1,u;this._cancelEditor();this._render();this._adjustHeight();this.options.navigatable&&((this._isActiveInTable()||this.editor)&&(r=i.is("th"),u=Math.max(this.cellIndex(i),0)),this._restoreCurrent(u,r));this.trigger(ai)}},_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:kt(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(i.footerTemplate)})},_footerItems:function(){var t=this.tbody;return this._hasLockedColumns&&(t=t.add(this.lockedTable)),t.find("tr").filter(function(){return n(this).hasClass(i.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(p+i.gridContentWrap),e=n.find(p+i.gridHeader),o=n.find(p+i.gridToolbar),t,r=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()-wt(e)-wt(o),f.height(t),this._hasLockedColumns&&(r=this.table[0].offsetWidth>this.table.parent()[0].clientWidth?r:0,this.lockedContent.height(t-r)))},_resize:function(){this._applyLockedContainersWidth();this._adjustHeight()},_minScreenSupport:function(){var t=this.hideMinScreenCols();if(t){this.minScreenResizeHandler=r(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(){bt.fn.destroy.call(this);var t=this.dataSource;t.unbind(k,this._refreshHandler);t.unbind(dt,this._errorHandler);t.unbind(gt,this._progressHandler);this._navigatableTables=null;this._current=null;this._resizeHandler&&n(window).off("resize"+u,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(u);this._touchScroller&&this._touchScroller.destroy();this._autoExpandable=null;this._refreshHandler=this._errorHandler=this._progressHandler=this._dataSourceFetchProxy=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:[k,oi,st,ci,si,hi,li,ai,ht,gi,nr,tr,ir,vi,yi,pi,wi,ti,bi,ki,di],_toggle:function(i,u){var f=n.Deferred().resolve().promise(),e=i.loaded();return(i._error&&(i.expanded=!1,i._error=t),!e&&i.expanded)?f:(typeof u=="undefined"&&(u=!i.expanded),i.expanded=u,e||(f=this.dataSource.load(i).always(r(function(){this._render();this._syncLockedContentHeight()},this))),this._render(),this._syncLockedContentHeight(),f)},expand:function(n){return this._toggle(this.dataItem(n),!0)},collapse:function(n){return this._toggle(this.dataItem(n),!1)},_toggleChildren:function(t){var r=n(t.currentTarget),i=this.dataItem(r),u=i.expanded?hi:si;this.trigger(u,{model:i})||this._toggle(i);t.preventDefault()},_navigatable:function(){var t=this,i,f;if(t.options.navigatable){i=t.table.add(t.lockedTable);f=t.thead.parent().add(n(">table",t.lockedHeader));t.options.scrollable&&(i=i.add(f),f.attr(ni,-1));this._navigatableTables=i;i.on(kendo.support.touch?"touchstart"+u:"mousedown"+u,ct+">:visible",r(t._tableClick,t)).on("focus"+u,r(t._tableFocus,t)).on("focusout"+u,r(t._tableBlur,t)).on("keydown"+u,r(t._tableKeyDown,t))}},cellIndex:function(t){var i=0;return this.lockedTable&&!n.contains(this.lockedTable[0],t[0])&&(i=this.lockedColumns(this.columns).length),n(t).parent().children("td:visible").index(t)+i},_isActiveInTable:function(){var t=kendo._activeElement();return t?this.table[0]===t||n.contains(this.table[0],t)||this.lockedTable&&(this.lockedTable[0]===t||n.contains(this.lockedTable[0],t)):!1},_restoreCurrent:function(i,r){var f,u,e;i===t||i<0||(this._current&&this._current.removeClass("k-state-focused"),r?this.current(this.thead.find("th").eq(i)):(f=0,i=0,u=n(),this.lockedTable&&(u=this.lockedTable.find(">tbody>tr:visible").eq(f)),u=u.add(this.tbody.children().eq(f)),e=u.find(">td:visible").eq(i),this.current(e)),this._current&&l(this._current.closest("table")[0],!0))},current:function(t){var i=this._current;return t=n(t),t.length&&(!i||i[0]!==t[0])&&(this._updateCurrentAttr(i,t),this._scrollCurrent()),this._current},_scrollCurrent:function(){var t=this._current,f=this.options.scrollable;if(t&&f){var r=t.parent(),u=r.closest("table").parent(),e=u.is(".k-grid-content-locked,.k-grid-header-locked"),o=u.is(".k-grid-content-locked,.k-grid-content"),i=n(this.content)[0];o&&this._scrollTo(this._relatedRow(r)[0],i);this.lockedContent&&(this.lockedContent[0].scrollTop=i.scrollTop);e||this._scrollTo(t[0],i)}},_scrollTo:function(t,i){var l=t.tagName.toLowerCase(),r=l==="td"||l==="th",f=t[r?"offsetLeft":"offsetTop"],a=t[r?"offsetWidth":"offsetHeight"],u=i[r?"scrollLeft":"scrollTop"],o=i[r?"clientWidth":"clientHeight"],v=f+a,e=0,s=0,h=0,c;vt&&r&&(c=n(t).closest("table")[0],y.msie?s=c.offsetLeft:y.mozilla&&(h=c.offsetLeft-kendo.support.scrollbar()));u=Math.abs(u+s-h);e=u>f?f:v>u+o?a<=o?v-o:f:u;e=Math.abs(e+s)+h;i[r?"scrollLeft":"scrollTop"]=e},_aria:function(){var n=this.element.attr("id")||"aria";n&&(this._elementId=n+"_active_element")},_verticalContainer:function(n,t){var r=this._navigatableTables.length,u=Math.floor(r/2),i=et(n[0],this._navigatableTables);return t&&(u*=-1),i+=u,(i>=0||i<r)&&(n=this._navigatableTables.eq(i)),n.find(t?"thead":"tbody")},_updateCurrentAttr:function(t,r){var u=n(t).data("headerId");n(t).removeClass(i.focused).closest("table").removeAttr("aria-activedescendant");u?(u=u.replace(this._elementId,""),n(t).attr("id",u)):n(t).removeAttr("id");r.data("headerId",r.attr("id")).attr("id",this._elementId).addClass(i.focused).closest("table").attr("aria-activedescendant",this._elementId);this._current=r},_tableKeyDown:function(t){var r=!1,i=this.current(),e=n(t.target),u=!t.isDefaultPrevented()&&!e.is(":button,a,:input,a>.k-icon");i=i?i:n(this.lockedTable).add(this.table).find(at);u&&t.keyCode==f.UP&&(r=this._moveUp(i));u&&t.keyCode==f.DOWN&&(r=this._moveDown(i));u&&t.keyCode==(vt?f.LEFT:f.RIGHT)&&(r=t.altKey?this._handleExpand(i):this._moveRight(i));u&&t.keyCode==(vt?f.RIGHT:f.LEFT)&&(r=t.altKey?this._handleCollapse(i):this._moveLeft(i));(t.keyCode==f.ENTER||t.keyCode==f.F2)&&(r=this._handleEnterKey(i,t.currentTarget,e));t.keyCode==f.ESC&&(r=this._handleEscKey(i,t.currentTarget));u&&t.keyCode==f.HOME&&(r=this._handleHome(i,t.ctrlKey));u&&t.keyCode==f.END&&(r=this._handleEnd(i,t.ctrlKey));r&&(t.preventDefault(),t.stopPropagation())},_handleExpand:function(n){var t=n.parent();return n.hasClass("k-header")?!1:(this.expand(t),!0)},_handleCollapse:function(n){var t=n.parent();return n.hasClass("k-header")?!1:(this.collapse(t),!0)},_handleHome:function(n,t){var r=n.parent(),u=r.parent(),e=this.lockedTable&&this.lockedTable.children("tbody")[0]===u[0],f=u[0]===this.tbody[0],i;return t?i=this.lockedTable?this.lockedTable.find(at):this.table.find(at):(f||e)&&(f&&this.lockedTable&&(r=this._relatedRow(r)),i=r.children(c+":first")),i&&i.length?(this.current(i),!0):void 0},_handleEnd:function(n,t){var r=n.parent(),u=r.parent(),e=this.lockedTable&&this.lockedTable.children("tbody")[0]===u[0],f=u[0]===this.tbody[0],i;return t?i=this.table.find(hr+">"+c+":last"):(f||e)&&(!f&&this.lockedTable&&(r=this._relatedRow(r)),i=r.children(c+":last")),i&&i.length?(this.current(i),!0):void 0},_handleEscKey:function(t,i){var r=kendo._activeElement(),u;return!t||!t.parent().hasClass("k-grid-edit-row")?t.has(r).length?(l(i,!0),!0):!1:(u=n(t).parent().index(),r&&r.blur(),this.cancelRow(),u>=0&&this.current(this.items().eq(u).children(c).first()),y.msie&&y.version<9&&document.body.focus(),l(i,!0),!0)},_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):(f=t.find(":kendoFocusable:first"),f[0]&&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},_handleEditing:function(t,i,r){var u=this,e=n(kendo._activeElement()),a=y.msie,f,o,s,h;if(r=n(r),s=t.parent().hasClass("k-grid-edit-row"),u.editor){if(f=u.editor.wrapper,f&&n.contains(f[0],e[0])&&(y.opera?e.blur().change().triggerHandler("blur"):(e.blur(),a&&e.blur())),!u.editor){l(r);return}if(u.editor.end())u.saveRow(),s=!0;else{u.current(f.children().filter(c).first());o=f.find(":kendoFocusable:first")[0];o&&o.focus();return}}(i&&u.current(i),l(r,!0),u.options.editable)&&((s||i)&&!i||(h=u.current().index(),u.editRow(u.current().parent()),u.current(u.editor.wrapper.children().eq(h)),u.current().removeClass("k-state-focused")))},_moveRight:function(n){var t=n.nextAll(c).first(),i=n.parent();return n.hasClass("k-header")&&(t=n.next(lt),!t[0]&&this.lockedTable&&n.closest("table")[0]===this.lockedHeader.find("table")[0]&&(t=this.thead.find(lt+":first"))),!t[0]&&this.lockedTable&&n.closest("table")[0]===this.lockedTable[0]&&(t=this._relatedRow(i).children(c).first()),t[0]&&t[0]!==n[0]&&l(t.closest("table"),!0),this.current(t),!0},_moveLeft:function(n){var t=n.prevAll(c).first(),i=n.parent();return n.hasClass("k-header")&&(t=n.prev(lt),!t[0]&&this.lockedTable&&n.closest("table")[0]===this.thead.parent()[0]&&(t=this.lockedHeader.find(">table>thead>tr>"+lt+":last"))),!t[0]&&this.lockedTable&&n.closest("table")[0]===this.table[0]&&(t=this._relatedRow(i).children(c).last()),t[0]&&t[0]!==n[0]&&l(t.closest("table"),!0),this.current(t),!0},_moveUp:function(n){var u=n.parent(),i=u.prevAll(ct+":first"),t,r;return i[0]?t=i.children().eq(n.index()):(r=this._verticalContainer(n.closest("table"),!0),t=r.find(cr).eq(n.siblings(":visible").addBack().index(n)),t[0]&&l(t.closest("table"),!0)),this.current(t),!0},_moveDown:function(n){var u=n.parent(),i=u.nextAll(ct+":first"),t,r;return i[0]?t=i.children().eq(n.index()):(r=this._verticalContainer(n.closest("table")),t=r.find(c).eq(n.siblings(":visible").addBack().index(n)),t[0]&&l(t.closest("table"),!0)),this.current(t),!0},_tableClick:function(t){var r=n(t.currentTarget),u=r.is("th"),f=this.table.add(this.lockedTable),e=this.thead.parent().add(n(">table",this.lockedHeader)),o=er(t.target),i=r.closest("table")[0];kendo.support.touch||(i===f[0]||i===f[1]||i===e[0]||i===e[1])&&(this.options.navigatable&&this.current(r),(u||!o)&&setTimeout(function(){er(kendo._activeElement())&&n.contains(i,kendo._activeElement())||l(i,!0)}),u&&t.preventDefault())},_setTabIndex:function(n){this._navigatableTables.attr(ni,-1);n.attr(ni,0)},_tableFocus:function(t){var r=this.current(),u=n(t.currentTarget);r&&r.is(":visible")?r.addClass(i.focused):this.current(u.find(at));this._setTabIndex(u)},_tableBlur:function(){var n=this.current();n&&n.removeClass(i.focused)},_attachEvents:function(){var n=p+i.iconCollapse+", ."+i.iconExpand+", ."+i.refresh,t=p+i.retry;this.element.on(or+u,n,r(this._toggleChildren,this)).on(ot+u,t,this._dataSourceFetchProxy).on(ot+u,".k-button[data-command]",r(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(),ii[t])return ii[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=h(this.columns,rr(rt("hidden"))),t=h(n,rt("expandable"));this.columns.length&&!t.length&&(this._autoExpandable=n[0],n[0].expandable=!0)},_columns:function(){var t=this.options.columns||[],n;this.columns=kt(t,function(n){return n=typeof n=="string"?{field:n}:n,e({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 e=this.columns,n=this.element,t="",u,f,r;this.wrapper=n.addClass(i.wrapper);t="<div class='#= gridHeader #'>";this._hasLockedColumns&&(t+="<div class='k-grid-header-locked'><table role='grid'><colgroup><\/colgroup><thead role='rowgroup' /><\/table><\/div>");t+="<div class='#= gridHeaderWrap #'><table role='grid'><colgroup><\/colgroup><thead role='rowgroup' /><\/table><\/div><\/div>";this._hasLockedColumns&&(t+="<div class='k-grid-content-locked'><table role='treegrid' tabindex='0'><colgroup><\/colgroup><tbody /><\/table><\/div>");t+="<div class='#= gridContentWrap # k-auto-scrollable'><table role='treegrid' tabindex='0'><colgroup><\/colgroup><tbody /><\/table><\/div>";this.options.scrollable||(t="<table role='treegrid' tabindex='0'><colgroup><\/colgroup><thead class='#= gridHeader #' role='rowgroup' /><tbody /><\/table>");this.options.toolbar&&(t="<div class='#= header # #= gridToolbar #' />"+t);n.append(kendo.template(t)(i)+"<div class='k-status' />");this.toolbar=n.find(p+i.gridToolbar);u=n.find(p+i.gridHeader).find("thead").addBack().filter("thead");this.thead=u.last();this.options.scrollable&&(f=kendo.support.isRtl(n),n.find("div."+i.gridHeader).css(f?"padding-left":"padding-right",kendo.support.scrollbar()));r=n.find(p+i.gridContentWrap);r.length?this.content=r:r=n;this.table=r.find(">table");this.tbody=this.table.find(">tbody");this._hasLockedColumns&&(this.lockedHeader=u.first().closest(".k-grid-header-locked"),this.lockedContent=n.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:kt(e,function(n){return{column:n}})}})},_initVirtualTrees:function(){this._headerColsTree=new o.Tree(this.thead.prev()[0]);this._contentColsTree=new o.Tree(this.tbody.prev()[0]);this._headerTree=new o.Tree(this.thead[0]);this._contentTree=new o.Tree(this.tbody[0]);this._statusTree=new o.Tree(this.element.children(".k-status")[0]);this.lockedHeader&&(this._lockedHeaderColsTree=new o.Tree(this.lockedHeader.find("colgroup")[0]),this._lockedContentColsTree=new o.Tree(this.lockedTable.find(">colgroup")[0]),this._lockedHeaderTree=new o.Tree(this.lockedHeader.find("thead")[0]),this._lockedContentTree=new o.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 o.Tree(i[0]).render(r)):i.append(kendo.template(t)({})),this.angular("compile",function(){return{elements:i.get()}}))},_lockedColumns:function(){return h(this.columns,rt("locked"))},_nonLockedColumns:function(){return h(this.columns,rr(rt("locked")))},_templateColumns:function(){return h(this.columns,rt("template"))},_flushCache:function(){this.options.$angular&&this._templateColumns().length&&(this._contentTree.render([]),this._hasLockedColumns&&this._lockedContentTree.render([]))},_render:function(t){t=t||{};var f=this.options.messages,r=this.dataSource.rootNodes(),e=kendo.attr("uid"),u=this.select().removeClass("k-state-selected").map(function(t,i){return n(i).attr(e)});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:[i.button,i.retry].join(" "),messages:f})):r.length?(this._hideStatus(),this._contentTree.render(this._trs({columns:this._nonLockedColumns(),aggregates:t.aggregates,selected:u,data:r,visible:!0,level:0})),this._hasLockedColumns&&(this._absoluteIndex=0,this._lockedContentTree.render(this._trs({columns:this._lockedColumns(),aggregates:t.aggregates,selected:u,data:r,visible:!0,level:0})))):this._showStatus(kendo.htmlEncode(f.noRows));this._touchScroller&&this._touchScroller.contentResized();this._muteAngularRebind(function(){this._angularItems("compile");this._angularFooters("compile")});this.items().filter(function(){return n.inArray(n(this).attr(e),u)>=0}).addClass("k-state-selected");this._adjustRowsHeight()},_adjustRowsHeight:function(){if(this._hasLockedColumns){var h=this.table,c=this.lockedTable,t=h[0].rows,r=t.length,n,i=c[0].rows,u=h.add(c),l=u.length,f=[],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<r;n++){if(!i[n])break;t[n].style.height&&(t[n].style.height=i[n].style.height="")}for(n=0;n<r;n++){if(!i[n])break;var e=t[n].offsetHeight,o=i[n].offsetHeight,s=0;e>o?s=e:e<o&&(s=o);f.push(s)}for(n=0;n<l;n++)u[n].style.display="none";for(n=0;n<r;n++)f[n]&&(t[n].style.height=i[n].style.height=f[n]+1+"px");for(n=0;n<l;n++)u[n].style.display=""}},_ths:function(n){for(var c=[],t,f,r,l,u,o,h=0,a=n.length;h<a;h++)t=n[h],r=[],l=[i.header],f=t.headerTemplate?t.headerTemplate({}):t.title||t.field||"",o=t.headerTemplate?d(f):pt(f),t.sortable?r.push(s("a",{href:"#",className:i.link},[o])):r.push(o),u={"data-field":t.field,"data-title":t.title,style:t.hidden===!0?{display:"none"}:{},className:l.join(" "),role:"columnheader"},u=e(!0,{},u,t.headerAttributes),c.push(s("th",u,r));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(s("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([s("tr",{role:"row"},this._ths(n))]);this._hasLockedColumns&&(n=this._lockedColumns(),this._lockedHeaderTree.render([s("tr",{role:"row"},this._ths(n))]),this._applyLockedContainersWidth())},_applyLockedContainersWidth:function(){var r;if(this._hasLockedColumns){var n=fr(this.lockedHeader.find(">table>colgroup>col")),t=this.thead.parent(),f=fr(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(i.alt),this._absoluteIndex++):f.style={display:"none"},n.inArray(u.uid,t.selected)>=0&&e.push(i.selected),s&&e.push(i.group),u._edit&&e.push("k-grid-edit-row"),f.className=e.join(" "),o.push(this._tds({model:u,attr:f,level:l},a,r(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:i.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 u=[],r=t.column,o=t.column.footerTemplate||n.noop,h=t.model[r.field]||{},f={role:"gridcell",style:r.hidden===!0?{display:"none"}:{}};return r.expandable&&(u=u.concat(ur({level:t.level+1,className:i.iconPlaceHolder}))),r.attributes&&e(f,r.attributes),u.push(d(o(h)||"")),s("td",f,u)},_hasFooterTemplate:function(){return!!h(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 s("tr",n.attr,u)},_td:function(n){var o=[],r=n.model,t=n.column,f,u={role:"gridcell",style:t.hidden===!0?{display:"none"}:{}};return t.attributes&&e(!0,u,t.attributes),r._edit&&t.field&&r.editable(t.field)?u[kendo.attr("container-for")]=t.field:(t.expandable&&(o=ur({level:n.level,className:i.iconPlaceHolder}),f=[i.icon],r.hasChildren?f.push(r.expanded?i.iconCollapse:i.iconExpand):f.push(i.iconHidden),r._error?f.push(i.refresh):!r.loaded()&&r.expanded&&f.push(i.loading),o.push(s("span",{className:f.join(" ")})),u.style["white-space"]="nowrap"),t.command?(u.className&&u.className.indexOf("k-command-cell")!==-1?u.className+=" k-command-cell":u.className||(u.className="k-command-cell"),o=r._edit?this._buildCommands(["update","canceledit"]):this._buildCommands(t.command)):o.push(this._cellContent(t,r))),s("td",u,o)},_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?d(i):pt(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=e({},ii[t],{text:r},n),n.imageClass&&i.push(s("span",{className:["k-icon",n.imageClass].join(" ")})),s("button",{type:"button","data-command":t,className:["k-button","k-button-icontext",n.className].join(" ")},i.concat([pt(n.text||n.name)]))},_positionResizeHandle:function(t){var i=n(t.currentTarget),r=this.resizeHandle,s=i.position(),c=s.left,l=w(i),a=i.closest("div"),v=t.clientX+n(window).scrollLeft(),f=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-f&&v<o+f,!y){r.hide();return}a.append(r);r.show().css({top:s.top,left:c+l-f-1,height:wt(i),width:f*3}).data("th",i);e=this;r.off("dblclick"+u).on("dblclick"+u,function(){var t=i.index();n.contains(e.thead[0],i[0])&&(t+=h(e.columns,function(n){return n.locked&&!n.hidden}).length);e.autoFitColumn(t)})},autoFitColumn:function(t){var i=this,nt=i.options,f=i.columns,r,tt=kendo.support.browser,k,e,o,it=i.lockedHeader?ar(i.lockedHeader.find(">table>thead")).filter(lr).length:0,a,s,d,v,c,u,rt,y,g,p,l,b,ut;if(t=typeof t=="number"?f[t]:ui(t)?h(f,function(n){return n===t})[0]:h(f,function(n){return n.field===t})[0],t&&!t.hidden){for(r=et(t,f),o=t.locked,e=o?i.lockedHeader.children("table"):i.thead.parent(),k=e.find("[data-index='"+r+"']"),s=o?i.lockedTable:i.table,d=i.footer||n(),i.footer&&i.lockedContent&&(d=o?i.footer.children(".k-grid-footer-locked"):i.footer.children(".k-grid-footer-wrap")),v=d.find("table").first(),i.lockedHeader&&it>=r&&!o&&(r-=it),c=0;c<f.length;c++)if(f[c]===t)break;else f[c].hidden&&r--;if(a=nt.scrollable?e.find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+r+")").add(s.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+")")):s.children("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+r+")"),u=e.add(s).add(v),rt=w(k),a.width(""),u.css("table-layout","fixed"),a.width("auto"),u.addClass("k-autofitting"),u.css("table-layout",""),y=Math.ceil(Math.max(w(k),w(s.find("tr").eq(0).children("td:visible").eq(r)),w(v.find("tr").eq(0).children("td:visible").eq(r)))),a.width(y),t.width=y,nt.scrollable){for(g=e.find("col"),l=0,b=0,ut=g.length;b<ut;b+=1)if(p=g[b].style.width,p&&p.indexOf("%")==-1)l+=parseInt(p,10);else{l=0;break}l&&u.each(function(){this.style.width=l+"px"})}tt.msie&&tt.version==8&&(u.css("display","inline-table"),setTimeout(function(){u.css("display","table")},1));u.removeClass("k-autofitting");i.trigger(ti,{column:t,oldWidth:rt,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);vr(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"+u,"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=w(r);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=h(t.columns,function(n){return n.field==r}),i=Math.floor(w(this.th));n[0].width=i;t._resize();t._adjustRowsHeight();t.trigger(ti,{column:n,oldWidth:this.columnWidth,newWidth:i});this.table=this.col=this.th=null}})}},_sortable:function(){var h=this.columns,t,r,f=n(this.lockedHeader).add(this.thead).find("th"),u,i,o,c=kendo.attr("field"),s=this.options.sortable;if(s)for(i=0,o=f.length;i<o;i++)t=h[i],t.sortable!==!1&&!t.command&&t.field&&(u=f.eq(i),r=u.data("kendoColumnSorter"),r&&r.destroy(),u.attr(c,t.field).kendoColumnSorter(e({},s,t.sortable,{dataSource:this.dataSource})))},_filterable:function(){var o=n(this.lockedHeader).add(this.thead).find("th"),s=this.options.filterable,t,h,i,u,f,c;if(s&&!this.options.columnMenu)for(c=r(function(n){this.trigger(vi,{field:n.field,container:n.container})},this),t=0,h=o.length;t<h;t++)(i=this.columns[t],u=o.eq(t),f=u.data("kendoFilterMenu"),f&&f.destroy(),i.command||i.filterable===!1)||u.kendoFilterMenu(e(!0,{},s,i.filterable,{dataSource:this.dataSource,init:c}))},_change:function(){this.trigger(k)},_isLocked:function(){return this.lockedHeader!==null},_selectable:function(){var e=this,o=this.options.selectable,s,h=this.table,a,v=e._isLocked(),l,c;if(o&&(o=kendo.ui.Selectable.parseOptions(o),this._hasLockedColumns&&(h=h.add(this.lockedTable),a=o.multiple&&o.cell),s=">tbody>tr:not(.k-footer-template)",o.cell&&(s=s+">td"),this.selectable=new kendo.ui.Selectable(h,{filter:s,aria:!0,multiple:o.multiple,change:r(this._change,this),useAllItems:a,continuousItems:r(this._continuousItems,this,s,o.cell),relatedTarget:!o.cell&&this._hasLockedColumns?r(this._selectableTarget,this):t}),e.options.navigatable)){l=o.multiple;c=o.cell;h.on("keydown"+u,function(t){var r=e.current(),u=t.target;if(t.keyCode===f.SPACEBAR&&!t.shiftKey&&n.inArray(u,h)>-1&&!r.is(".k-header")){if(t.preventDefault(),t.stopPropagation(),r=c?r:r.parent(),v&&!c&&(r=r.add(e._relatedRow(r))),l)if(t.ctrlKey){if(r.hasClass(i.selected)){r.removeClass(i.selected);e.trigger(k);return}}else e.selectable.clear();else e.selectable.clear();c||(e.selectable._lastActive=r);e.selectable.value(r)}else!c&&(t.shiftKey&&t.keyCode==f.LEFT||t.shiftKey&&t.keyCode==f.RIGHT||t.shiftKey&&t.keyCode==f.UP||t.shiftKey&&t.keyCode==f.DOWN||t.keyCode===f.SPACEBAR&&t.shiftKey)&&(t.preventDefault(),t.stopPropagation(),r=r.parent(),v&&(r=r.add(e._relatedRow(r))),l?(e.selectable._lastActive||(e.selectable._lastActive=r),e.selectable.selectRange(e.selectable._firstSelectee(),r)):(e.selectable.clear(),e.selectable.value(r)))})}},_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)fi.apply(f,e.slice(r,r+u)),fi.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]),et(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 i=this.selectable;return i?(typeof t!="undefined"&&(i.options.multiple||(i.clear(),t=t.first()),this._hasLockedColumns&&(t=t.add(n.map(t,r(this._relatedRow,this))))),i.value(t)):n()},clearSelection:function(){var n=this.select();n.length&&(this.selectable.clear(),this.trigger(k))},_dataSource:function(n){var t=this.dataSource;t&&(t.unbind(k,this._refreshHandler),t.unbind(dt,this._errorHandler),t.unbind(gt,this._progressHandler));this._refreshHandler=r(this.refresh,this);this._errorHandler=r(this._error,this);this._progressHandler=r(this._progress,this);t=this.dataSource=tt.create(n);t.bind(k,this._refreshHandler);t.bind(dt,this._errorHandler);t.bind(gt,this._progressHandler);this._dataSourceFetchProxy=r(function(){this.dataSource.fetch()},this)},setDataSource:function(n){this._dataSource(n);this._sortable();this._filterable();this._contentTree.render([]);this.options.autoBind&&this.dataSource.fetch()},dataItem:function(t){if(t instanceof a)return t;var i=n(t).closest("tr");return this.dataSource.getByUid(i.attr(kendo.attr("uid")))},editRow:function(n){var t;(typeof n===ei&&(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(oi,{container:this.editor.wrapper,model:t}))},_cancelEdit:function(t){if(this.editor){var i;(t=e(t,{container:this.editor.wrapper,model:this.editor.model}),this.trigger(ht,t))||(this.options.navigatable&&(i=this.items().index(n(this.current()).parent())),this.cancelRow(),this.options.navigatable&&(this.current(this.items().eq(i).children().filter(c).first()),l(this.table,!0)))}},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(st,t)&&this.dataSource.sync())},addRow:function(n){var u=this.editor,t=0,i={};if(!u||u.end()){if(n){n instanceof a||(n=this.dataItem(n));i[n.parentIdField]=n.id;t=this.dataSource.indexOf(n)+1;this.expand(n).then(r(this._insertAt,this,i,t));return}this._insertAt(i,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(ci,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),u,i;t=t.add(this._relatedRow(t));u=this._editMode();i={columns:this.columns,model:n,target:this,clearContainer:!1,template:this.options.editable.template};u=="inline"?this.editor=new yt(t,i):(e(i,{window:this.options.editable.window,commandRenderer:r(function(){return this._buildCommands(["update","canceledit"])},this),fieldRenderer:this._cellContent,save:r(this.saveRow,this),cancel:r(this._cancelEdit,this),appendTo:this.wrapper}),this.editor=new yr(t,i))},_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?yi:pi,{column:n}),t||n.width||this.table.add(this.thead.closest("table")).width(""))},_findColumn:function(n){return n=typeof n=="number"?this.columns[n]:ui(n)?h(this.columns,function(t){return t===n})[0]:h(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 i=this.options.scrollable===!0,u=(i?".k-grid-header:first ":"table:first>.k-grid-header ")+sr,t=this;this._draggableInstance=new g.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-i-cancel" />')}});this.reorderable=new g.Reorderable(this.wrapper,{draggable:this._draggableInstance,dragOverContainers:r(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(wi,{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=et(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(ki,{column:r}):this.trigger(di,{column:r}))},lockColumn:function(n){var t=this.columns,i;(n=typeof n=="number"?t[n]:h(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]:h(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,i=this.options,u=i.columnMenu,t,s,h,c,l,v=r(this._columnMenuInit,this),y=this._lockedColumns().length,f;if(u)for(typeof u=="boolean"&&(u={}),f=0;f<o.length;f++)(t=a[f],t.field)&&(s=o.eq(f).data("kendoColumnMenu"),s&&s.destroy(),c=!1,t.sortable!==!1&&u.sortable!==!1&&i.sortable!==!1&&(c=e({},i.sortable,{compare:(t.sortable||{}).compare})),l=!1,i.filterable&&t.filterable!==!1&&u.filterable!==!1&&(l=e({pane:this.pane},t.filterable,i.filterable)),h={dataSource:this.dataSource,values:t.values,columns:u.columns,sortable:c,filterable:l,messages:u.messages,owner:this,closeCallback:n.noop,init:v,pane:this.pane,lockedColumns:t.lockable!==!1&&y>0},i.$angular&&(h.$angular=i.$angular),o.eq(f).kendoColumnMenu(h))},_columnMenuInit:function(n){this.trigger(bi,{field:n.field,container:n.container})}});kendo.ExcelMixin&&kendo.ExcelMixin.extend(ut.prototype);kendo.PDFMixin&&(kendo.PDFMixin.extend(ut.prototype),ut.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});e(!0,kendo.data,{TreeListDataSource:tt,TreeListModel:a});e(!0,kendo.ui,{TreeList:ut});g.plugin(ut)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("util/main",["kendo.core"],n)}(function(){return function(){function u(n){return n*n}function f(n){return typeof n!="string"&&(n+="px"),n}function e(t){var u=[],r,i;if(t)for(r=n.toHyphens(t).split("-"),i=0;i<r.length;i++)u.push("k-pos-"+r[i]);return u.join(" ")}function o(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 s(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 h(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]:t[i]=n.apply(this,arguments)}}function c(n){return i.test(n)}var n=window.kendo,r=n.deepExtend,t=Date.now,i;t||(t=function(){return(new Date).getTime()});r(n,{util:{now:t,renderPos:e,renderSize:f,sqr:u,romanToArabic:s,arabicToRoman:o,memoize:h,isUnicodeLetter:c}});i=new RegExp("[\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]")}(),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("util/parse-xml",["kendo.core","util/main"],n)}(function(){"use strict";function n(n){for(var i=[],t=0;t<n.length;++t)i.push(n.charCodeAt(t));return i}function i(n,t){t>65535?(t-=65536,n.push(t>>>10&1023|55296,56320|t&1023)):n.push(t)}function it(n,it){function ht(t){var r=n[rt++];r&240^240?r&224^224?r&192^192?t.push(r):i(t,(r&31)<<6|n[rt++]&63):i(t,(r&15)<<12|(n[rt++]&63)<<6|n[rt++]&63):i(t,(r&3)<<18|(n[rt++]&63)<<12|(n[rt++]&63)<<6|n[rt++]&63)}function ft(n){throw new Error(n+", at "+rt);}function vt(t){for(var i=[];rt<n.length&&t(n[rt]);)i.push(n[rt++]);return i}function at(n){return t.apply(0,vt(n))}function lt(){vt(ni)}function ut(t){for(var r=rt,i=0;i<t.length;++i)if(n[rt++]!=t[i])return rt=r,!1;return t}function st(n){ut(n)||ft("Expecting "+n.join(", "))}function ni(n){return n==9||n==10||n==13||n==32}function yt(n){return n>=48&&n<=57}function ti(n){return n>=48&&n<=57||(n|=32)>=97&&n<=102}function pt(n){return n==58||n==95||(n|=32)>=97&&n<=122}function ii(n){return n==45||yt(n)||pt(n)}function ri(){for(var i=[];rt<n.length;){if(ut(c))return ot("comment",t.apply(0,i));ht(i)}}function wt(){var n,t;ut(p)?ei():ut(l)?ri():(n=ct(),t=kt(n),et.push(t),ut(a)?ot("enter",n,t,!0):(st(u),ot("enter",n,t),ui(n),n!=ct()&&ft("Bad closing tag"),ot("leave",n,t),lt(),st(u)),et.pop())}function ui(i){for(var u=[];rt<n.length;){if(ut(v))return u.length&&ot("text",t.apply(0,u));if(ut(s))while(rt<n.length&&!ut(h))ht(u);else ut(r)?(u.length&&ot("text",t.apply(0,u)),wt(),u=[]):ut(f)?bt(u):ht(u)}ft("Unclosed tag "+i)}function ct(){return pt(n[rt])||ft("Expecting XML name"),at(ii)}function fi(){var r=ut(k)||ut(d),i;for(r||ft("Expecting string"),i=[];rt<n.length;){if(ut(r))return t.apply(0,i);ut(f)?bt(i):ht(i)}ft("Unfinished string")}function bt(n){var t,r;ut(g)?(t=ut(nt)||ut(tt)?parseInt(at(ti),16):parseInt(at(yt),10),isNaN(t)&&ft("Bad numeric entity")):(r=ct(),t=o[r],t===undefined&&ft("Unknown entity "+r));i(n,t);st(w)}function ei(){ot("decl",ct(),kt());st(y)}function kt(t){for(var r={$tag:t},i;rt<n.length;){if(lt(),i=n[rt],i==63||i==62||i==47)break;r[ct()]=(st(b),fi())}return r}function ot(n,t,i,r){var u=it&&it[n];u&&u.call(gt,t,i,r)}var rt=0,et=[],gt={is:function(n){for(var i=et.length,t=n.length;--i>=0&&--t>=0;)if(et[i].$tag!=n[t]&&n[t]!="*")return!1;return t<0?et[et.length-1]:null},exit:function(){throw e;},stack:et},dt=[];for(ht(dt),dt[0]!=65279&&(rt=0);rt<n.length;)lt(),st(r),wt(),lt()}var t=String.fromCharCode,o={amp:38,lt:60,gt:62,quot:34,apos:39,nbsp:160},s=n("<![CDATA["),h=n("]\]>"),c=n("-->"),l=n("!--"),a=n("/>"),v=n("<\/"),y=n("?>"),p=n("?"),r=n("<"),u=n(">"),w=n(";"),b=n("="),f=n("&"),k=n('"'),d=n("'"),g=n("#"),nt=n("x"),tt=n("X"),e={};kendo.util.parseXML=function(){try{return it.apply(this,arguments)}catch(n){if(n!==e)throw n;}}},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("spreadsheet/commands",["kendo.core","kendo.binder","kendo.window","kendo.list","kendo.tabstrip"],n)}(function(){(function(n){function s(n){var t=document.createElement("textarea");i(t).addClass("k-spreadsheet-clipboard").val(n).appendTo(document.body).focus().select();document.execCommand("copy");i(t).remove()}var r,h,f,e,o;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._setRange(n),this._range},_setRange:function(n){this._range=n},redo:function(){this.range().select();this.exec()},undo:function(){this.setState(this._state)},getState:function(){this._state=this.range().getState(this._property)},setState:function(n){this.range().setState(n)},_forEachCell:function(n){var t=this.range(),i=t._ref;i.forEach(function(i){t.sheet().forEach(i.toRangeRef(),n.bind(this))}.bind(this))}}),u=t.extend({init:function(n){t.fn.init.call(this,n);this._target=n.target;this._value=n.value},exec:function(){this.getState();this.setState(this._value)}});n.spreadsheet.ColumnWidthCommand=u.extend({getState:function(){this._state=this.range().sheet().columnWidth(this._target)},setState:function(n){this.range().sheet().columnWidth(this._target,n)}});n.spreadsheet.RowHeightCommand=u.extend({getState:function(){this._state=this.range().sheet().rowHeight(this._target)},setState:function(n){this.range().sheet().rowHeight(this._target,n)}});n.spreadsheet.HyperlinkCommand=t.extend({init:function(n){t.fn.init.call(this,n);this._link=n.link},exec:function(){var n=this.range();this._prevLink=n.link();this._prevUnderline=n.underline();n.link(this._link);n.underline(!0);n.value()==null&&(this._hasSetValue=!0,n.value(this._link))},undo:function(){var n=this.range();n.link(this._prevLink);n.underline(this._prevUnderline);this._hasSetValue&&n.value(null)}});n.spreadsheet.GridLinesChangeCommand=u.extend({getState:function(){this._state=this._range.sheet().showGridLines()},setState:function(n){this._range.sheet().showGridLines(n)}});r=n.spreadsheet.PropertyChangeCommand=t.extend({_setRange:function(n){t.prototype._setRange.call(this,n.skipHiddenCells())},init:function(n){t.fn.init.call(this,n);this._value=n.value},exec:function(){var n=this.range();n.enable()&&(this.getState(),this.options.property==="format"&&this._workbook.trigger("changeFormat",{range:n}),n[this._property](this._value))}});n.spreadsheet.ClearContentCommand=t.extend({exec:function(){if(!this.range().enable())return{reason:"error",type:"cannotModifyDisabled"};this.getState();this.range().skipHiddenCells().clearContent()}});n.spreadsheet.EditCommand=r.extend({init:function(n){n.property=n.property||"input";r.fn.init.call(this,n)},rejectState:function(n){return this.undo(),{title:n.title,body:n.message,reason:"error",type:"validationError"}},getState:function(){this._state=this.range().getState()},exec:function(){var t=this.range(),i,r;if(!t.enable())return{reason:"error",type:"rangeDisabled"};if(i=this._value,this.getState(),this._property=="value"){t.value(i);return}try{if(t.link(null),i===""?t.value(null):(t.input(i),/\n/.test(t.value())&&t.wrap(!0)),t._adjustRowHeight(),r=t._getValidationState(),r)return this.rejectState(r)}catch(u){if(u instanceof n.spreadsheet.calc.ParseError)return{title:"Error in formula",body:u+"",reason:"error"};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.value;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},_batch:function(n){return this.range().sheet().batch(n,{})},exec:function(){var n=this;n.getState();n._batch(function(){n[n._type](n._style)})},noBorders:function(){this.range().insideBorders(null);this.outsideBorders(null)},allBorders:function(n){this.range().insideBorders(n);this.outsideBorders(n)},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.leftColumn().borderLeft(n);t.topRow().borderTop(n);t.rightColumn().borderRight(n);t.bottomRow().borderBottom(n)},insideBorders:function(n){this.range().insideBorders(n);this.outsideBorders(null)},insideHorizontalBorders:function(n){this.range().insideHorizontalBorders(n)},insideVerticalBorders:function(n){this.range().insideVerticalBorders(n)}});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=n.workbook.clipboard();this._event=n.event},getState:function(){this._range=this._workbook.activeSheet().range(this._clipboard.pasteRef());this._state=this._range.getState()},exec:function(){var n,t,i;if(this.getState(),this._clipboard.parse(),n=this._clipboard.canPaste(),!n.canPaste)return n.menuInvoked?{reason:"error",type:"useKeyboard"}:n.pasteOnMerged?{reason:"error",type:"modifyMerged"}:n.overflow?{reason:"error",type:"overflow"}:n.pasteOnDisabled?(this._event.preventDefault(),{reason:"error",type:"cannotModifyDisabled"}):{reason:"error"};t=this._workbook.activeSheet().selection();i=this._workbook.trigger("paste",{range:t});i?this._event.preventDefault():(this._clipboard.paste(),t._adjustRowHeight())}});n.spreadsheet.AdjustRowHeightCommand=t.extend({exec:function(){var n=this.options,t=this._workbook.activeSheet(),i=n.range||t.range(n.rowIndex);i._adjustRowHeight()}});n.spreadsheet.ToolbarPasteCommand=t.extend({exec:function(){if(n.support.clipboard.paste)this._workbook._view.clipboard.focus().select(),document.execCommand("paste");else return{reason:"error",type:"useKeyboard"}}});n.spreadsheet.CopyCommand=t.extend({init:function(n){t.fn.init.call(this,n);this._clipboard=n.workbook.clipboard();this._event=n.event},undo:i.noop,exec:function(){var n=this._clipboard.canCopy(),t,i;if(this._clipboard.menuInvoked=!0,!n.canCopy)return n.menuInvoked?{reason:"error",type:"useKeyboard"}:n.multiSelection?{reason:"error",type:"unsupportedSelection"}:void 0;t=this._workbook.activeSheet().selection();i=this._workbook.trigger("copy",{range:t});i?this._event.preventDefault():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;s(t.html());t.trigger("copy")}else return{reason:"error",type:"useKeyboard"}}});n.spreadsheet.CutCommand=t.extend({init:function(n){t.fn.init.call(this,n);this._clipboard=n.workbook.clipboard();this._event=n.event},exec:function(){if(!(this.range().enable()&&this._clipboard.canCopy()))return this._event.preventDefault(),{reason:"error",type:"cannotModifyDisabled"};this.getState();var n=this._workbook.activeSheet().selection(),t=this._workbook.trigger("cut",{range:n});if(t){this._event.preventDefault();return}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(){var i=this.range();if(!i.enable())return{reason:"error",type:"rangeDisabled"};this.getState();try{i.fillFrom(this._origin)}catch(t){if(t instanceof n.spreadsheet.Range.FillError)return{reason:"error",type:t.code};throw t;}}});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;s(t.html());t.trigger("cut")}else return{reason:"error",type:"useKeyboard"}}});n.spreadsheet.FilterCommand=t.extend({undo:function(){this.range().filter(this._state)},exec:function(){var n=this.range();this._state=n.hasFilter();n.filter(!this._state)}});n.spreadsheet.SortCommand=t.extend({undo:function(){var n=this.range().sheet();n.setState(this._state)},exec:function(){var n=this.range(),i=n.sheet(),r=i.activeCell(),u=this.options.sheet?r.topLeft.col:this.options.column||0,f=this.options.value==="asc"?!0:!1,t;if(this._state=i.getState(),this.options.sheet&&(n=this.expandRange()),t=n.cantSort(),t)return{reason:"error",type:t.code};n.sort({column:u,ascending:f})},expandRange:function(){var t=this.range().sheet();return new n.spreadsheet.Range(t._sheetRef,t)}});h=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 f=this.range(),r=this.column(),t=f.sheet().filter(),u,i,e=!1;this.options.valueFilter?i={column:r,filter:new n.spreadsheet.ValueFilter(this.options.valueFilter)}:this.options.customFilter&&(i={column:r,filter:new n.spreadsheet.CustomFilter(this.options.customFilter)});this.getState();t&&t.ref.eq(f._ref)&&t.columns.length?(t.columns.forEach(function(n){n.index===r&&(e=!0)}),u=t.columns.map(function(n){return n.index===r?i:{column:n.index,filter:n.filter}}),e||u.push(i)):u=i;f.filter(u)}});n.spreadsheet.ClearFilterCommand=h.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()}});f=t.extend({exec:function(){this._expandedRange=this._expand(this.range());this._state=this._expandedRange.getState();this._indexes=this._exec(this._expandedRange.sheet())},undo:function(){var n=this,i=n._expandedRange,t=i.sheet();t.batch(function(){n._indexes.forEach(function(i){n._undoOne(t,i);t._restoreModifiedFormulas(i.formulas)});i.setState(n._state)},{layout:!0,recalc:!0})}});n.spreadsheet.DeleteRowCommand=f.extend({_expand:function(n){return n.resize({left:-Infinity,right:+Infinity})},_exec:function(n){return n.axisManager().deleteSelectedRows()},_undoOne:function(n,t){n.insertRow(t.index);n.rowHeight(t.index,t.height)}});n.spreadsheet.DeleteColumnCommand=f.extend({_expand:function(n){return n.resize({top:-Infinity,bottom:+Infinity})},_exec:function(n){return n.axisManager().deleteSelectedColumns()},_undoOne:function(n,t){n.insertColumn(t.index);n.columnWidth(t.index,t.width)}});e=t.extend({init:function(n){t.fn.init.call(this,n);this._value=n.value},undo:function(){var n=this,t=n.range().sheet();t.batch(function(){for(var i=n._pos.count;--i>=0;)n._undoOne(t,n._pos.base)},{layout:!0,recalc:!0})}});n.spreadsheet.AddColumnCommand=e.extend({exec:function(){var n=this.range().sheet(),t=n.axisManager().preventAddColumn();if(t)return t;this._pos=this._value==="left"?n.axisManager().addColumnLeft():n.axisManager().addColumnRight()},_undoOne:function(n,t){n.deleteColumn(t)}});n.spreadsheet.AddRowCommand=e.extend({exec:function(){var n=this.range().sheet(),t=n.axisManager().preventAddRow();if(t)return t;this._pos=this._value==="above"?n.axisManager().addRowAbove():n.axisManager().addRowBelow()},_undoOne:function(n,t){n.deleteRow(t)}});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.OpenCommand=t.extend({cannotUndo:!0,exec:function(){var t=this.options.file,n;if(t.name.match(/.xlsx$/i)===null)return{reason:"error",type:"openUnsupported"};n=this.options.workbook;n.fromFile(this.options.file).then(function(){var t=n.excelImportErrors;t&&t.length&&n._view.openDialog("importError",{errors:t})})}});n.spreadsheet.SaveAsCommand=t.extend({exec:function(){var n=this.options.name+this.options.extension;this.options.extension===".xlsx"?this.options.workbook.saveAsExcel({fileName:n}):this.options.extension===".pdf"&&this.options.workbook.saveAsPDF(i.extend(this.options.pdf,{workbook:this.options.workbook,fileName:n}))}});o=t.extend({init:function(n){t.fn.init.call(this,n);this._name=n.name;this._value=n.value},getState:function(){this._state=this._workbook.nameDefinition(this._name)},setState:function(){this._workbook.nameDefinition(this._name,this._state);this._workbook.trigger("change",{recalc:!0})}});n.spreadsheet.DefineNameCommand=o.extend({exec:function(){this.getState();try{this._workbook.defineName(this._name,this._value);this._workbook.trigger("change",{recalc:!0})}catch(n){return{title:"Error",body:n+"",reason:"error"}}}});n.spreadsheet.DeleteNameCommand=o.extend({exec:function(){this.getState();this._workbook.undefineName(this._name);this._workbook.trigger("change",{recalc:!0})}})}})(kendo)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("spreadsheet/formulabar",["kendo.core"],n)}(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)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("spreadsheet/formulainput",["kendo.core"],n)}(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).css("white-space","pre"),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)).on("paste",this._paste.bind(this))},options:{name:"FormulaInput",autoScale:!1,filterOperator:"startswith",scalePadding:30,minLength:1},events:["keyup","focus"],enable:function(n){if(n===undefined)return this.element.attr("contenteditable")==="true";n?this.element.attr("contenteditable",n):this.element.removeAttr("contenteditable");this.element.toggleClass("k-state-disabled",!n)},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 s(n,t){return n.startOffset!=t.startOffset||n.endOffset!=t.endOffset||n.startContainer!=t.endContainer||n.endContainer!=t.endContainer}function o(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,e;n=o(f,n);i=i!=null?o(f,i):n;n&&i&&(r=document.createRange(),r.setStart(n.node,n.pos),r.setEnd(i.node,i.pos),u=t.getSelection(),e=u.getRangeAt(0),s(r,e)&&(u.removeAllRanges(),u.addRange(r)))},end:function(){this.setPos(this.length())},home:function(){this.setPos(0)},select:function(){this.setPos(0,this.length())},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);this.trigger("blur")},_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));this.trigger("focus")},_paste:function(i){var u,f,r;i.preventDefault();u=this.getPos();f=n.support.browser.msie?t.clipboardData.getData("Text"):i.originalEvent.clipboardData.getData("text/plain");r=this.value();r=r.substr(0,u.begin)+f+r.substr(u.end);this.value(r);this.setPos(u.begin+f.length);this.scale()},_move:function(n){var t=this.list,r=this.popup;if(r.visible()){if(n===i.DOWN)return t.focusNext(),t.focus()||t.focusFirst(),!0;if(n===i.UP)return t.focusPrev(),t.focus()||t.focusLast(),!0;if(n===i.ENTER||n===i.TAB)return t.select(t.focus()),r.close(),!0;if(n===i.PAGEUP)return t.focusFirst(),!0;if(n===i.PAGEDOWN)return t.focusLast(),!0}return n===i.ENTER||n===i.TAB},_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,this.row(),this.col()),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.whiteSpace="pre";t.top=-3333;t.left=-3333;this._span=u("<span style='white-space: pre'/>").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.enable(!1);this.element.hide();this._cellTooltip.hide()},show:function(){this.enable(!0);this.element.show()},row:function(){if(this.activeCell)return this.activeCell.row},col:function(){if(this.activeCell)return this.activeCell.col},position:function(n){n&&(this.show(),this.element.css({top:n.top+1+"px",left:n.left+1+"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(),this.row(),this.col()),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 i=this._canInsertRef(),t;i&&(t=n.selection()._ref.simplify().clone().relative(0,0,3),n!==this.activeSheet&&(t=t.setSheet(n.name(),!0)),this._replaceAt(i,t.print(0,0)))},_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(t){var i=this,r="input"+o,u=i._sync.bind(i),f;n.support.browser.msie&&(r="keydown"+o,f=function(){setTimeout(u)});i._editorToSync=t;i.element.off(r).on(r,f||u)},scale:function(){var n=this.element,t,i;this._span||this._textContainer();this._span.html(n.html());t=this._span.width()+this.options.scalePadding;i=this._span.height();t>n.width()&&n.width(t);i>n.height()&&n.height(i)},_value:function(n){this.element.text(n)},value:function(n){if(n===undefined){var t=this.element[0].innerText;return t.replace(/\n$/,"")}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;if(!t||t.collapsed){if(/^=/.test(i))u=n.spreadsheet.calc.tokenize(i,this.row(),this.col()),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);else{(this._staticTokens.length||this._highlightedRefs.length)&&(this._staticTokens=[],this._highlightedRefs=[],this.element.text(i));this.popup&&this.popup.close();return}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)},insertNewline:function(){var n=this.value(),t=this.getPos(),i=t.end==n.length;n=n.substr(0,t.begin)+(i?"\n\n":"\n"+n.substr(t.end));this.value(n);this.setPos(t.begin+1)}});n.spreadsheet.FormulaInput=f;u.extend(!0,f,{classNames:{wrapper:"k-spreadsheet-formula-input",listWrapper:"k-spreadsheet-formula-list"}})}})(kendo,window)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("spreadsheet/eventlistener",["kendo.core"],n)}(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 r=n.keyCode,t=i[r];return!t&&u(r)&&(t=":alphanum"),!t&&n.key&&n.key.length==1&&(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.originalEvent))},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.altKey;n.altKey&&(i+="alt+");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)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("spreadsheet/rangelist",["kendo.core"],n)}(function(){(function(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?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},clone:function(){return new i(this.start,this.end,this.value)}});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(function(n){return n.clone()})},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 v(n,t,this.intersecting(n,t))},getState:function(){return this.tree.clone()},setState:function(n){this.tree=n.clone()}}),v=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}}),y=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=y;n.spreadsheet.ValueRange=i}})(kendo)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("spreadsheet/propertybag",["kendo.core"],n)}(function(){(function(n){function f(n){return n.replace(/M/g,"m").replace(/'/g,'"').replace(/tt/,"am/pm")}function e(n){return n=n.clone(),n.value=n.value.deepClone(),n}function i(){var n=this.map(e);return n.clone=i,n}if(!n.support.browser.msie||!(n.support.browser.version<9)){var 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)}}),r=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){t.prototype.init.call(this,n);this.formats=i},set:function(t,i,r){r instanceof Date&&(r=n.spreadsheet.dateToNumber(r),this.formats.value(t,i)||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:t,name:"format",value:null,sortable:!0,serializable:!0},{property:u,name:"value",value:null,sortable:!0,serializable:!0,depends:"format"},{property:t,name:"formula",value:null,sortable:!0,serializable:!0},{property:t,name:"background",value:null,sortable:!0,serializable:!0},{property:r,name:"vBorders",value:null,sortable:!1,serializable:!1},{property:r,name:"hBorders",value:null,sortable:!1,serializable:!1},{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},{property:t,name:"enable",value:null,sortable:!1,serializable:!0},{property:t,name:"link",value:null,sortable:!1,serializable:!0},{property:t,name:"editor",value:null,sortable:!1,serializable:!0}],init:function(t,r,u){u=u||{};var f=t*r-1;this.rowCount=t;this.columnCount=r;this.cellCount=f;this.properties={};this.lists={};this.specs.forEach(function(t){var i=t.name,r=u[i],e;r===undefined&&(r=t.value);this.lists[i]=new n.spreadsheet.SparseRangeList(0,f,r);e=this.properties[i]=new t.property(this.lists[i],this.lists[t.depends]);e.spec=t},this);this.lists.formula.tree.clone=i;this.lists.validation.tree.clone=i},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){if(t===undefined)return this.lists[n];switch(n){case"borderRight":t+=this.rowCount;case"borderLeft":n="vBorders";break;case"borderBottom":t++;case"borderTop":n="hBorders"}return t>this.cellCount?null:this.properties[n].get(t)},set:function(n,t,i,r){switch(n){case"borderRight":t+=this.rowCount;i+=this.rowCount;case"borderLeft":n="vBorders";break;case"borderBottom":t++;i++;case"borderTop":n="hBorders"}t<=i&&i<=this.cellCount&&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);["borderLeft","borderRight","borderTop","borderBottom"].forEach(function(i){t[i]!==undefined&&this.set(i,n,n,t[i])},this)},copy:function(n,t,i){this.specs.forEach(function(r){this.properties[r.name].copy(n,t,i)},this)},iterator:function(n,t,i){var u=this.properties[n],r=u.iterator(t,i),f=r.at,e=this.cellCount;return r.at=function(n){return n>e?null:u.parse(f.call(r,n))},r.name=n,r.value=u.spec.value,r},sortable:function(){return this.specs.filter(function(n){return n.sortable}).map(function(n){return this.lists[n.name]},this)},iterators:function(n,t){return this.specs.reduce(function(i,r){return r.serializable&&i.push(this.iterator(r.name,n,t)),i}.bind(this),[])},forEach:function(n,t,i){function f(n,t,i){var r=t.at(i);r!==t.value&&(u[n]=r)}for(var h=this.iterators(n,t),c=this.iterator("hBorders",n,t+1),l=this.iterator("vBorders",n,t),a=this.iterator("vBorders",n+this.rowCount,t+this.rowCount),u,e,o,s,r=n;r<=t;r++){for(u={},e=0;e<h.length;e++)o=h[e],s=o.at(r),s!==o.value&&(u[o.name]=s);f("borderLeft",l,r);f("borderRight",a,r+this.rowCount);f("borderTop",c,r);(r+1)%this.rowCount&&f("borderBottom",c,r+1);i(u)}},forEachProperty:function(n){for(var t in this.properties)n(this.properties[t])}});n.spreadsheet.ALL_PROPERTIES=n.spreadsheet.PropertyBag.prototype.specs.reduce(function(n,t){return t.serializable&&n.push(t.name),n},["borderTop","borderRight","borderBottom","borderLeft"])}})(window.kendo)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("spreadsheet/references",["kendo.core"],n)}(function(){"use strict";function h(n){var t=Math.floor(n/26)-1;return(t>=0?h(t):"")+String.fromCharCode(65+n%26)}function e(n){return/^[a-z0-9_]*$/i.test(n)?n:"'"+n.replace(/\x27/g,"\\'")+"'"}function o(n,t,i,r){var u="";return++t,isFinite(t)?r==null||r&2||(t="$"+t):t="",isFinite(i)?(u=h(i),r==null||r&1||(u="$"+u)):i="",n?e(n)+"!"+u+t:u+t}var u,s,f;if(!kendo.support.browser.msie||!(kendo.support.browser.version<9)){u=kendo.spreadsheet;s=kendo.Class;f=s.extend({type:"ref",sheet:"",clone:function(){return this},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},toRow:function(){return this},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)},valid:function(){return!1},renameSheet:function(n,t){if(this.sheet&&this.sheet.toLowerCase()==n.toLowerCase())return this.sheet=t,!0}});f.display=o;var i=new(f.extend({init:function(){},print:function(){return"#NULL!"},eq:function(n){return n===this},forEach:function(){}})),c=f.extend({ref:"name",init:function(n){this.name=n},clone:function(){return new c(this.name).setSheet(this.sheet,this.hasSheet())},print:function(){var n=e(this.name);return this.hasSheet()&&(n=e(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,i){var r=this.col,u=this.row,s=this.rel,f,h;return n==null&&s?(h=this.hasSheet()?e(this.sheet)+"!":"",r=isFinite(r)?s&1?"C["+r+"]":"C"+(r+1):"",u=isFinite(u)?s&2?"R["+u+"]":"R"+(u+1):"",h+u+r):(f=this.absolute(n,t),i)?(u=f.row%1048576,r=f.col%16384,u<0&&(u+=1048576),r<0&&(r+=16384),o(this._hasSheet&&this.sheet,u,r,s)):f.valid()?o(this._hasSheet&&this.sheet,f.row,f.col,s):"#REF!"},absolute:function(n,t){var i=this.clone();return i.rel&!1?i:(i.rel&1&&(i.col=(i.col+t)%16384),i.rel&2&&(i.row=(i.row+n)%1048576),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 o(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},valid:function(){if(this.rel)throw new Error("valid() called on relative reference");var n=this.col,t=this.row;return!(isFinite(n)&&n<0||isFinite(t)&&t<0)}}),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){return u instanceof n?this._containsCell(u)?u:i:u instanceof t?this._intersectRange(u).simplify():u instanceof r?u.intersect(this):i},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,i){if(i||this.absolute(n,t).valid()){var r=this.topLeft.print(n,t,i)+":"+this.bottomRight.print(n,t,i);return this.hasSheet()&&(r=e(this.sheet)+(this.endSheet?":"+e(this.endSheet):"")+"!"+r),r}return"#REF!"},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},toRow:function(i){return i+=Math.max(0,this.topLeft.row),new t(new n(i,this.topLeft.col),new n(i,this.bottomRight.col)).setSheet(this.sheet,this.hasSheet())},toColumn:function(i){return i+=Math.max(0,this.topLeft.col),new t(new n(this.topLeft.row,i),new n(this.bottomRight.row,i)).setSheet(this.sheet,this.hasSheet())},toCell:function(t,i){return t+=Math.max(0,this.topLeft.row),i+=Math.max(0,this.topLeft.col),new n(t,i,0).setSheet(this.sheet,this.hasSheet())},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())},valid:function(){return this.topLeft.valid()&&this.bottomRight.valid()}}),r=f.extend({init:function(n){this.refs=n;this.length=n.length},clone:function(){return new r(this.refs.slice())},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(function(i){i instanceof r?i.forEach(n,t):n.call(t,i)},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){var i=[];return this.forEach(function(r){i.push(n.call(t,r))}),new r(i)},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(n,t,i){return this.refs.map(function(r){return r.print(n,t,i)}).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(", ")},valid:function(){for(var n=this.refs.length;--n>=0;)if(this.refs[n].valid())return!1;return!0},renameSheet:function(n,t){this.refs.forEach(function(i){i.renameSheet(n,t)})}});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=c;u.CellRef=n;u.RangeRef=t;u.UnionRef=r;u.SHEETREF.print=function(){return"#SHEET"}}},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("spreadsheet/autofillcalculator",["kendo.core"],n)}(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)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("spreadsheet/navigator",["kendo.core","spreadsheet/autofillcalculator"],n)}(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,r,u){if(t=="autofill")this._sheet.startAutoFill();else if(u&&t=="range"){var f=new i(this._sheet.activeCell().first(),n);this._sheet.select(f,!1,!1);this._sheet.startSelection()}else this._sheet.startSelection(),this.select(n,t,r)},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)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("spreadsheet/axismanager",["kendo.core"],n)}(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(){var n=[];return this.forEachSelectedColumn(function(t,i,r){i-=r;var u=[];n.unshift({index:i,formulas:u,width:t.columnWidth(i)});t._saveModifiedFormulas(u,function(){t.deleteColumn(i)})}),n},deleteSelectedRows:function(){var n=[];return this.forEachSelectedRow(function(t,i,r){i-=r;var u=[];n.unshift({index:i,formulas:u,height:t.rowHeight(i)});t._saveModifiedFormulas(u,function(){t.deleteRow(i)})}),n},hideSelectedColumns:function(){var e,o;this.forEachSelectedColumn(function(n,t){n.hideColumn(t)});for(var t=this._sheet,r=t.select().toRangeRef(),u=r.topLeft.col,f=r.bottomRight.col,i=null;;){if(e=f<t._columns._count,o=u>=0,!o&&!e)break;if(e&&!t.isHiddenColumn(f)){i=f;break}if(o&&!t.isHiddenColumn(u)){i=u;break}u--;f++}i!==null&&(r=new n.spreadsheet.RangeRef(new n.spreadsheet.CellRef(0,i),new n.spreadsheet.CellRef(t._rows._count-1,i)),t.range(r).select())},hideSelectedRows:function(){var e,o;this.forEachSelectedRow(function(n,t){n.hideRow(t)});for(var t=this._sheet,r=t.select().toRangeRef(),u=r.topLeft.row,f=r.bottomRight.row,i=null;;){if(e=f<t._rows._count,o=u>=0,!o&&!e)break;if(e&&!t.isHiddenRow(f)){i=f;break}if(o&&!t.isHiddenRow(u)){i=u;break}u--;f++}i!==null&&(r=new n.spreadsheet.RangeRef(new n.spreadsheet.CellRef(i,0),new n.spreadsheet.CellRef(i,t._columns._count-1)),t.range(r).select())},unhideSelectedColumns:function(){this.forEachSelectedColumn(function(n,t){n.unhideColumn(t)})},unhideSelectedRows:function(){this.forEachSelectedRow(function(n,t){n.unhideRow(t)})},preventAddRow:function(){var n=this._sheet.select().toRangeRef(),t=n.height();return this._sheet.preventInsertRow(0,t)},preventAddColumn:function(){var n=this._sheet.select().toRangeRef(),t=n.width();return this._sheet.preventInsertColumn(0,t)},addColumnLeft:function(){var t=this._sheet,n,i=0;return t.batch(function(){t.select().forEachColumnIndex(function(r){n||(n=r);t.insertColumn(n);++i})},{recalc:!0,layout:!0}),{base:n,count:i}},addColumnRight:function(){var n=this._sheet,t,i=0;return n.batch(function(){n.select().forEachColumnIndex(function(n){t=n+1;++i});for(var r=0;r<i;++r)n.insertColumn(t)},{recalc:!0,layout:!0}),{base:t,count:i}},addRowAbove:function(){var t=this._sheet,n,i=0;return t.batch(function(){t.select().forEachRowIndex(function(r){n||(n=r);t.insertRow(n);++i})},{recalc:!0,layout:!0}),{base:n,count:i}},addRowBelow:function(){var n=this._sheet,t,i=0;return n.batch(function(){n.select().forEachRowIndex(function(n){t=n+1;++i});for(var r=0;r<i;++r)n.insertRow(t)},{recalc:!0,layout:!0}),{base:t,count:i}}});n.spreadsheet.AxisManager=t}})(kendo)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("spreadsheet/clipboard",["kendo.core"],n)}(function(){(function(n){function r(){var n=new i(0,0,0);return{ref:n,mergedCells:[],data:[],foreign:!0,origRef:n.toRangeRef()}}function t(n,t,i,r){var f=n.data||(n.data=[]),u;f[t]||(f[t]=[]);f[t][i]=r;u=n.origRef.bottomRight;u.row=Math.max(u.row,t);u.col=Math.max(u.col,i)}function f(n){return n.replace(/^-(?:ms|moz|webkit)-/,"")}function s(n){var t={};return["borderBottom","borderRight","borderLeft","borderTop"].forEach(function(i){t[i]=n[i+"Style"]=="none"?null:{size:1,color:n[i+"Color"]}}),t}function h(n){var t=window.getComputedStyle(n),u=n.innerText,r=s(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),f(t["text-align"])!=="right"&&(i.textAlign=f(t["text-align"])),t["vertical-align"]!=="middle"&&(i.verticalAlign=t["vertical-align"]),t["word-wrap"]!=="normal"&&(i.wrap=!0),i}function c(u){for(var a,y,v,o,s,c=r(),l=[],e=0,f=0,k=0;k<u.rows.length;++k)l.push([]);for(a=0;a<u.rows.length;++a,++e)for(y=u.rows[a],f=0,v=0;v<y.cells.length;++v){for(var p=y.cells[v],w=p.rowSpan,b=p.colSpan;l[e][f];)f++;for(t(c,e,f,h(p)),(w>1||b>1)&&c.mergedCells.push(new n.spreadsheet.RangeRef(new i(e,f),new i(e+w-1,f+b-1)).toString()),o=e+w;--o>=e;)for(s=f+b;--s>=f;)o<l.length&&(l[o][s]=!0,o==e&&s==f||t(c,o,s,{}))}return c}function e(n){var f=r(),e,i,o,u;if(n.indexOf("\t")===-1&&n.indexOf("\n")==-1)t(f,0,0,{value:n});else for(e=n.split("\n"),i=0;i<e.length;i++)for(o=e[i].split("\t"),u=0;u<o.length;u++)t(f,i,u,{value:o[u]});return f}if(!n.support.browser.msie||!(n.support.browser.version<9)){var u=n.jQuery,i=n.spreadsheet.CellRef,o=n.Class.extend({init:function(t){this._content={};this._externalContent={};this._internalContent={};this.workbook=t;this.origin=n.spreadsheet.NULLREF;this.iframe=document.createElement("iframe");this.iframe.className="k-spreadsheet-clipboard-paste";this.menuInvoked=!0;this._uid=n.guid();document.body.appendChild(this.iframe)},destroy:function(){document.body.removeChild(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 i=this.workbook.activeSheet(),t=this.pasteRef(),r=i.range(t),n={canPaste:!0,pasteOnMerged:!1,pasteOnDisabled:!1};return r.enable()||(n.canPaste=!1,n.pasteOnDisabled=!0),t.eq(i.unionWithMerged(t))||(n.canPaste=!1,n.pasteOnMerged=!0),this.menuInvoked&&(n.canPaste=!1,n.menuInvoked=!0),(t.bottomRight.row>=i._rows._count||t.bottomRight.col>=i._columns._count)&&(n.canPaste=!1,n.overflow=!0),n},intersectsMerged:function(){var t=this.workbook.activeSheet(),n;return this.parse(),this.origin=this._content.origRef,n=this.pasteRef(),!n.eq(t.unionWithMerged(n))},copy:function(){var n=this.workbook.activeSheet();this.origin=n.select();this._internalContent=n.selection().getState();delete this._externalContent.html;delete this._externalContent.plain},cut:function(){var n=this.workbook.activeSheet();this.copy();n.range(n.select()).clear()},pasteRef:function(){var t=this.workbook.activeSheet();if(this.origin===n.spreadsheet.NULLREF)return t.select();var i=t.activeCell().first(),r=this.origin.first(),u=r.row-i.row,f=r.col-i.col;return this.origin.relative(u,f,3)},paste:function(){var n=this.workbook.activeSheet(),t=this.pasteRef();n.range(t).setState(this._content,this);n.triggerChange({recalc:!0,ref:t})},external:function(n){if(n&&(n.html||n.plain))this._externalContent=n;else return this._externalContent},isExternal:function(){return!this._isInternal()},parse:function(){var n=r(),t,i,u;this._isInternal()?n=this._internalContent:(t=this._externalContent,t.html?(i=this.iframe.contentWindow.document,i.open(),i.write(t.html),i.close(),u=i.querySelector("table"),n=u?c(u):e(t.plain)):n=e(t.plain),this.origin=n.origRef);this._content=n},_isInternal:function(){if(this._externalContent.html===undefined)return!0;var n=u("<div/>").html(this._externalContent.html).find("table.kendo-clipboard-"+this._uid).length?!0:!1,t=u("<div/>").html(this._externalContent.plain).find("table.kendo-clipboard-"+this._uid).length?!0:!1;return n||t}});n.spreadsheet.Clipboard=o}})(kendo)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("spreadsheet/range",["kendo.core","util/text-metrics"],n)}(function(){(function(n){function f(n,t,i){while(n<=t&&i(n))n++;if(n>t)return[];for(var r=n+1;r<=t;++r)if(i(r))return[{begin:n,end:r-1}].concat(f(r+1,t,i));return[{begin:n,end:t}]}function h(n){return n.replace(/M/g,"m").replace(/'/g,'"').replace(/tt/,"am/pm")}function c(t){return!/^=/.test(t)&&/number|percent/.test(n.spreadsheet.calc.parse(null,0,0,t).type)}function l(t,i,r,u){var f={baselineMarkerSize:0,width:u===!0?i+"px":"auto","font-size":(r||12)+"px","word-break":u===!0?"break-all":"normal","white-space":u===!0?"pre-wrap":"pre"};return n.util.measureText(t,f,{box:s,normalizeText:!1}).height}var s;if(!n.support.browser.msie||!(n.support.browser.version<9)){var e=n.jQuery,i=n.spreadsheet.UnionRef,r=n.spreadsheet.CellRef,u=n.spreadsheet.RangeRef,o=["color","fontFamily","underline","italic","bold","textAlign","verticalAlign","background","format","link","editor","borderTop","borderRight","borderBottom","borderLeft"],t=n.Class.extend({init:function(n,t){this._sheet=t;this._ref=n},clone:function(){return new t(this._ref.clone(),this._sheet)},skipHiddenCells:function(){var t=[],e=this,n=e._sheet,o=n.isHiddenRow.bind(n),s=n.isHiddenColumn.bind(n);return e._ref.forEach(function(n){var i,h;n=e._normalize(n.toRangeRef());var a=n.topLeft,v=n.bottomRight,c=f(a.row,v.row,o),l=f(a.col,v.col,s);for(i=0;i<c.length;++i)for(h=0;h<l.length;++h)t.push(new u(new r(c[i].begin,l[h].begin),new r(c[i].end,l[h].end)))}),n.range(t.length>1?new i(t):t[0])},_normalize:function(n){return this._sheet._grid.normalize(n)},_set:function(n,t,i){var r=this,u=r._sheet;return r._ref.forEach(function(i){u._set(i.toRangeRef(),n,t)}),i||u.triggerChange({recalc:n=="formula"||n=="value"||n=="validation",value:t,range:r,ref:r._ref}),r},_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)})},input:function(t){var r=this._get("format"),i,o,u,f,e,s;if(t!==undefined)return o=this._ref.toRangeRef().topLeft,i=n.spreadsheet.calc.parse(this._sheet.name(),o.row,o.col,t,r),this._sheet.batch(function(){var f=null,u;i.type=="exp"?f=n.spreadsheet.calc.compile(i):r!="@"?(u=r&&n.spreadsheet.formatting.type(i.value,r),i.type=="date"&&u!="date"?this.format(i.format||h(n.culture().calendar.patterns.d)):i.type=="percent"&&u!="percent"?this.format(i.value*100==(i.value*100|0)?"0%":"0.00%"):i.format&&(!r||i.currency||u=="number"&&i.type=="number"&&i.format.length>r.length)&&this.format(i.format)):i.type!="string"&&(i.value=t);this.formula(f);f||this.value(i.value)}.bind(this),{recalc:!0,value:t,ref:this._ref,editorChange:this._sheet.isInEditMode()}),this;if(t=this._get("value"),u=this._get("formula"),f=r&&!u&&n.spreadsheet.formatting.type(t,r),u)t="="+u;else n:{if(r&&f=="date"&&(e=n.spreadsheet.formatting.text(t,r),i=n.spreadsheet.calc.parse(null,null,null,e,r),s=n.spreadsheet.formatting.text(i.value,r),e==s))for(t=e;;)break n;f==="date"?t=n.toString(n.spreadsheet.numberToDate(t),n.culture().calendar.patterns.d):f==="percent"?t=t*100+"%":typeof t=="string"&&(/^[=']/.test(t)||/^(?:true|false)$/i.test(t)||c(t))&&(t="'"+t)}return t},enable:function(n){return n===undefined?(n=!0,this._sheet.forEach(this._ref.toRangeRef(),function(t,i,r){r.enable===!1&&(n=!1)}),n):this._property("enable",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(this._sheet._set(f,"formula",null),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,ref:f}),this},_properties:function(t){var o,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(),s=r.topLeft.row,h=r.topLeft.col,a=r.bottomRight.row,v=r.bottomRight.col,u,f,e=this._sheet;if(t===undefined)return t=new Array(r.height()),e.forEach(r,function(n,i,r){n-=s;i-=h;var u=t[n]||(t[n]=[]);u[i]=r}),t;for(r=r.clone(),l=function(n){var t=o[n];r.topLeft.row=r.bottomRight.row=f;r.topLeft.col=r.bottomRight.col=u;n=="value"&&e._set(r,"formula",null);e._set(r,n,t)},u=h;u<=v;u++)if(!e.isHiddenColumn(u))for(f=s;f<=a;f++)c=t[f-s],c&&!e.isHiddenRow(f)&&(o=c[u-h],o&&Object.keys(o).forEach(l));return e.triggerChange({recalc:!0,ref:this._ref}),this},clear:function(n){n=n||{};var t=n.clearAll||!Object.keys(n).length,r=this._sheet,i={recalc:t||n.contentsOnly,ref:this._ref};return r.batch(function(){i.recalc&&this.formula(null);t&&this.validation(null);(t||n.formatOnly)&&(o.forEach(function(t){n.keepBorders&&/^border/i.test(t)||this[t](null)}.bind(this)),this.unmerge())}.bind(this),i),this},clearContent:function(){return this.clear({contentsOnly:!0})},clearFormat:function(){return this.clear({formatOnly:!0})},isSortable:function(){return!this.cantSort()},cantSort:function(){if(this._ref instanceof i)return{code:"cantSortMultipleSelection",message:"Unsupported for multiple ranges."};if(this._ref===n.spreadsheet.NULLREF)return{code:"cantSortNullRef",message:"Unsupported for NULLREF."};var t=this._sheet._getMergedCells(this._ref.toRangeRef()),s=t.primary,h=t.secondary,u=null,e=null,f={};try{this._sheet.forEach(this,function(n,i){var c=new r(n,i).print(),o=s[c];if(o){if(u===null)u=o.width(),e=o.height();else if(!(u==o.width()&&e==o.height()))throw f;}else if(!h[c]&&t.hasMerged)throw f;})}catch(o){if(o!==f)throw o;return{code:"cantSortMixedCells",message:"Unsupported for range containing cells of different shapes."}}return!1},sort:function(n){var t=this.cantSort();if(t)throw new Error(t.message);return n===undefined&&(n={column:0}),n=n instanceof Array?n:[n],this._sheet._sortBy(this._ref.toRangeRef(),n.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)},row:function(n){return new t(this._ref.toRow(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 r=this._ref.first(),u={ref:r,data:[],origRef:this._ref},f,i;return t?f=t==="input"?["value","formula"]:t==="border"?["borderLeft","borderTop","borderRight","borderBottom"]:[t]:(f=n.spreadsheet.ALL_PROPERTIES,u.mergedCells=this.intersectingMerged()),i=u.data,this.forEachCell(function(t,u,e){var s={},o=t-r.row,h=u-r.col;i[o]||(i[o]=[]);i[o][h]=s;f.forEach(function(t){var i=typeof e[t]=="undefined"?null:e[t];(i instanceof n.spreadsheet.calc.runtime.Formula||i instanceof n.spreadsheet.validation.Validation)&&(i=i.deepClone());s[t]=i})}),u},setState:function(n,t){var i=this._sheet,r=this._ref.first(),f=n.ref.row-r.row,e=n.ref.col-r.col,u=t&&!t.isExternal(),o=t&&!u;i.batch(function(){n.mergedCells&&this.unmerge();var s=r.row,h=this.hasFilter();n.data.forEach(function(f,e){if(!h||!u||!i.isHiddenRow(n.ref.row+e)){var c=r.col;f.forEach(function(f,l){var a,v;if(!h||!u||!i.isHiddenColumn(n.ref.col+l)){if(a=t?i.range(s,c):i.range(r.row+e,r.col+l),a.enable()){for(v in f)v!="value"&&(t&&v=="enable"||a._set(v,f[v]));if(!f.formula)if(o)try{f.value==null?a._set("value",null):a.input(f.value)}catch(y){a._set("value",f.value)}else a._set("value",f.value)}c++}});s++}});n.mergedCells&&n.mergedCells.forEach(function(n){n=i._ref(n).relative(f,e,3);i.range(n).merge()},this)}.bind(this),{recalc:!0,ref:this._ref})},_adjustRowHeight:function(){for(var t=this._sheet,u=this.getState(),i=[],r=0;r<u.mergedCells.length;r++)i.push(t.range(u.mergedCells[r]));this.forEachRow(function(r){if(!(r.topLeft().row>=r.sheet()._rows._count)){var u=r.sheet().rowHeight(r.topLeft().row);r.forEachCell(function(r,f,e){for(var h,c=t.range(r,f),s=0,o=0;o<i.length;o++)if(c._ref.intersects(i[o]._ref)){s+=e.width;break}h=Math.max(t.columnWidth(f),s);u=Math.max(u,n.spreadsheet.util.getTextHeight(e.value,h,e.fontSize,e.wrap))});t.rowHeight(r.topLeft().row,Math.max(t.rowHeight(r.topLeft().row),u))}})},forEachCell:function(n){this._ref.forEach(function(t){this._sheet.forEach(t.toRangeRef(),n.bind(this))}.bind(this))},hasValue:function(){var n={},i=this._sheet._defaultCellStyle;try{this.forEachCell(function(t,r,u){var e,f;for(e in u)if(f=u[e],f!==undefined&&f!==null&&f!==i[e])throw n;})}catch(t){if(t===n)return!0;throw t;}return!1},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);u.value!==null&&u.value!==undefined&&(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);f.value!==null&&f.value!==undefined&&(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)},draw:function(n,t){this._sheet.draw(this,n,t)},insideBorders:function(n){return this.insideVerticalBorders(n).insideHorizontalBorders(n)},insideVerticalBorders:function(n){return this._ref.forEach(function(t){t instanceof u&&t.width()>1&&(t=t.clone(),t.topLeft.col++,this._sheet.range(t)._set("vBorders",n))},this),this},insideHorizontalBorders:function(n){return this._ref.forEach(function(t){t instanceof u&&t.height()>1&&(t=t.clone(),t.topLeft.row++,this._sheet.range(t)._set("hBorders",n))},this),this}});e.each(o,function(n,i){t.prototype[i]=function(n){return this._property(i,n)}});s=e('<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: pre-wrap; word-break: break-all;" />')[0];n.spreadsheet.util={getTextHeight:l};n.spreadsheet.Range=t}})(window.kendo)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("spreadsheet/runtime",["spreadsheet/references"],n)}(function(){"use strict";function t(n){if(n instanceof t)return n;this.code=n}function vt(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 l(n,t){if(n.constructor!==t.constructor)return!1;if(n instanceof b)return n.sheet==t.sheet&&n.row==t.row&&n.col==t.col&&n.rel==t.rel;if(n instanceof c)return l(n.topLeft,t.topLeft)&&l(n.bottomRight,t.bottomRight)&&n.endSheet==t.endSheet;if(n instanceof nt){var i=n.refs.length;if(i!=t.refs.length)return!1;while(--i>=0)if(!l(n.refs[i],t.refs[i]))return!1}return!0}function it(n,i){function a(n){var t,i,o,h;return r=n[0],t="{ ",Array.isArray(r)?(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(a).join(""),t+="} ",t+="xargs = stack.pop(); ",f+="} ",e+="} "):r=="+"?(e+="while (i < args.length) { ",f+="while (i < args.length) { ",t+="if (i >= args.length) return new CalcError('N/A'); ",t+="xargs.push(tmp = []); stack.push(xargs); xargs = tmp; ",t+="do { ",t+=n.slice(1).map(a).join(""),t+="} while (i < args.length); ",t+="xargs = stack.pop(); ",f+="} ",e+="} "):r=="?"?t+="if (!("+s(n[1])+")) return new CalcError(err); ":(i=n[1],Array.isArray(i)&&/^#?collect/.test(i[0])?(o=i[2],u(),t+="try {var $"+r+" = this.cellValues(args.slice(i",o&&(t+=", i + "+o),t+=")).filter(function($"+r+"){ ",i[0]=="collect"&&(t+="if ($"+r+" instanceof CalcError) throw $"+r+"; "),t+="return "+s(i[1])+"; }, this); ",t+=o?"i += "+o+"; ":"i = args.length; ",t+="xargs.push($"+r+")} catch(ex) { if (ex instanceof CalcError) return ex; throw ex; } ",f+="toResolve.push(args.slice(i)); "):i=="rest"?t+="xargs.push(args.slice(i)); i = args.length; ":((y=/^\*/.test(r))&&(p=!0,r=r.substr(1)),t+="var $"+r+" = args[i++]; ",h=!1,/!$/.test(i)?(i=i.substr(0,i.length-1),h=!0):t+="if ($"+r+" instanceof CalcError) return $"+r+"; ",t+=w(i,h)+"xargs.push($"+r+"); ")),t+"} "}function u(){return c?"$"+r+"":(v=!0,c=!0,f+="toResolve.push(args[i++]); ","($"+r+" = this.force($"+r+"))")}function o(n){return"("+(n?"(typeof "+u()+" == 'number' ? ($"+r+" = round($"+r+"), true) : false) || ":"(typeof "+u()+" == 'number') || ")+"(typeof $"+r+" == 'boolean') || (typeof $"+r+" == 'string' && !/^(?:=|true|false)/i.test($"+r+") ? (tmp = kendo.spreadsheet.calc.parse(0, 0, 0, $"+r+"), /^date|number|percent$/.test(tmp.type) ? ($"+r+" = +tmp.value, true) : false) : false))"}function w(n,t){c=!1;var i="if (!("+s(n)+")) { ";return c&&!t&&(i+=" if ($"+r+" instanceof CalcError) return $"+r+"; "),i+="return new CalcError(err); } ",c||(f+="i++; "),e+=y?"var $"+r+" = this.asMatrix(args[i]); if ($"+r+") { xargs.push($"+r+"); width = Math.max(width, $"+r+".width); height = Math.max(height, $"+r+".height); arrays.push(true) } else { xargs.push(args[i]); arrays.push(false); } i++; ":"xargs.push(args[i++]); arrays.push(false); ",i}function s(n){if(Array.isArray(n)){if(n[0]=="or")return"("+n.slice(1).map(s).join(") || (")+")";if(n[0]=="and")return"("+n.slice(1).map(s).join(") && (")+")";if(n[0]=="values")return"("+n.slice(1).map(function(n){return u()+" === "+n}).join(") || (")+")";if(n[0]=="null")return"("+s("null")+" ? (($"+r+" = "+n[1]+"), true) : false)";if(n[0]=="between"||n[0]=="[between]")return"("+u()+" >= "+n[1]+" && $"+r+" <= "+n[2]+" ? true : ((err = 'NUM'), false))";if(n[0]=="(between)")return"("+u()+" > "+n[1]+" && $"+r+" < "+n[2]+" ? true : ((err = 'NUM'), false))";if(n[0]=="(between]")return"("+u()+" > "+n[1]+" && $"+r+" <= "+n[2]+" ? true : ((err = 'NUM'), false))";if(n[0]=="[between)")return"("+u()+" >= "+n[1]+" && $"+r+" < "+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"!("+s(n[1])+")";throw new Error("Unknown array type condition: "+n[0]);}if(n=="number"||n=="datetime")return o(!0);if(n=="integer"||n=="date")return"("+o()+" && (($"+r+" |= 0), true))";if(n=="divisor")return"("+o(!0)+" && ($"+r+" == 0 ? ((err = 'DIV/0'), false) : true))";if(n=="number+")return"("+o(!0)+" && ($"+r+" >= 0 ? true : ((err = 'NUM'), false)))";if(n=="integer+")return"("+o()+" && (($"+r+" |= 0) >= 0 ? true : ((err = 'NUM'), false)))";if(n=="number++")return"("+o(!0)+" && ($"+r+" > 0 ? true : ((err = 'NUM'), false)))";if(n=="integer++")return"("+o()+" && (($"+r+" |= 0) > 0 ? true : ((err = 'NUM'), false)))";if(n=="string")return"((typeof "+u()+" == 'string' || typeof $"+r+" == 'boolean' || typeof $"+r+" == 'number') ? ($"+r+" += '', true) : ($"+r+" === undefined ? (($"+r+" = ''), true) : false))";if(n=="boolean")return"(typeof "+u()+" == 'boolean')";if(n=="logical")return"(typeof "+u()+" == 'boolean' || (typeof $"+r+" == 'number' ? ($"+r+" = !!$"+r+", true) : false))";if(n=="matrix")return u(),"((m = this.asMatrix($"+r+")) ? ($"+r+" = m) : false)";if(n=="#matrix")return"((m = this.asMatrix($"+r+")) ? ($"+r+" = m) : false)";if(n=="ref")return"($"+r+" instanceof kendo.spreadsheet.Ref)";if(n=="area")return"($"+r+" instanceof kendo.spreadsheet.CellRef || $"+r+" instanceof kendo.spreadsheet.RangeRef)";if(n=="cell")return"($"+r+" 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 || $"+r+" === '')";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; ",r,c,l="'use strict'; function check(args) { var stack = [], tmp, xargs = [], i = 0, m, err = 'VALUE'; ",v=!1,y=!1,p=!1,h;return l+=i.map(a).join(""),l+="if (i < args.length) return new CalcError('N/A'); ",l+="return xargs; } ",e+="return { args: xargs, width: width, height: height, arrays: arrays }; } ",v?(f+="this.resolveCells(toResolve, callback); } ",h=new Function("CalcError","round",l+f+e+" return { resolve: resolve, check: check, arrayArgs: arrayArgs };")):h=new Function("CalcError","round",l+" return { check: check };"),h=h(t,k),p||delete h.arrayArgs,h}function k(n){var t=n<0?Math.ceil(n):Math.floor(n),i=n-t;return t+Math.round(i*1e14)/1e14}function yt(n){return typeof n=="number"?k(n):n}function rt(n,i,r){if(r instanceof t)return r;try{return i.apply(n,r)}catch(u){if(u instanceof t)return u;throw u;}}function pt(n,t,r,u){return function(f,e){function o(){var s,a,h,c,o,l,t;if(u&&(s=u.call(this,e),e=s.args,s.width>0&&s.height>0)){for(a=new i(this),h=0;h<s.height;++h)for(c=0;c<s.width;++c){for(t=[],o=0;o<e.length;++o)s.arrays[o]?(l=e[o],t[o]=l.get(h%l.height,c%l.width)):t[o]=e[o];t=r.call(this,t);a.set(h,c,rt(this,n,t))}return f(a)}t=r.call(this,e);f(rt(this,n,t))}t?t.call(this,e,o):o.call(this)}}function wt(n,r,u,f){return function(e,o){function s(){var l,a,s,h,y,r;if(f&&(r=f.call(this,o),o=r.args,r.width>0&&r.height>0)){var v=new i(this),c=r.width*r.height,p=function(n,t){return function(i){return v.set(n,t,i),--c,c===0?e(v):void 0}};for(l=0;l<r.height&&c>0;++l)for(a=0;a<r.width&&c>0;++a){for(s=[],h=0;h<o.length;++h)r.arrays[h]?(y=o[h],s[h]=y.get(l%y.height,a%y.width)):s[h]=o[h];if(s=u.call(this,s),s instanceof t){if(v.set(l,a,s),--c,c===0)return e(v)}else s.unshift(p(l,a)),n.apply(this,s)}return}r=u.call(this,o);r instanceof t?e(r):(r.unshift(e),n.apply(this,r))}r?r.call(this,o,s):s.call(this)}}function n(n,t){return n=n.toLowerCase(),f[n]=t,{args:function(i,r){var u=it(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]=pt(t,u.resolve,u.check,u.arrayArgs),e.kendoSpreadsheetArgs=i,this},argsAsync:function(i,r){var u=it(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]=wt(t,u.resolve,u.check,u.arrayArgs),e.kendoSpreadsheetArgs=i,this}}}function ut(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 bt(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:dt[a(o)][r]+e}}function a(n){return n%4?0:n%100?1:n%400?0:1}function gt(n){return a(n)?366:365}function ni(n,t){return a(n)&&t==1?29:kt[t]}function et(n){return bt((n|0)+ft)}function ot(n,t,i){return ut(n,t,i)-ft}function st(n){var i=n-(n|0),t,r,u,f;return i<0&&i++,t=Math.round(ti*i),r=Math.floor(t/g),t-=r*g,u=Math.floor(t/d),t-=u*d,f=Math.floor(t/1e3),t-=f*1e3,{hours:r,minutes:u,seconds:f,milliseconds:t}}function ht(n){var i=et(n),t=st(n);return new Date(i.year,i.month,i.date,t.hours,t.minutes,t.seconds,t.milliseconds)}function ct(n,t,i,r){return(n+(t+(i+r/1e3)/60)/60)/24}function lt(n){var t=ct(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds());return n=ot(n.getFullYear(),n.getMonth(),n.getDate()),n<0?n-1+t:n+t}function ii(n,t){return t?kendo.parseExactDate(n,t)||kendo.parseExactDate(n,t.replace(/h/g,"H"))||kendo.parseExactDate(n):kendo.parseExactDate(n)||kendo.parseExactDate(n,["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"])}function y(n){return function(i,r){return typeof i=="string"&&typeof r!="string"&&(r=r==null?"":r+""),typeof i!="string"&&typeof r=="string"&&(i=i==null?"":i+""),typeof i=="number"&&r==null&&(r=0),typeof r=="number"&&i==null&&(i=0),typeof i=="string"&&typeof r=="string"&&(i=i.toLowerCase(),r=r.toLowerCase()),typeof r==typeof i?n(i,r):new t("VALUE")}}var p,u,tt,i,o,f;if(!kendo.support.browser.msie||!(kendo.support.browser.version<9)){p={};u=kendo.spreadsheet;u.calc=p;var r=p.runtime={},w=kendo.Class,e=u.Ref,b=u.CellRef,c=u.RangeRef,nt=u.UnionRef,at=u.NULLREF;t.prototype.toString=function(){return"#"+this.code+(this.code=="NAME"?"?":"!")};tt=w.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(){t._resolve(n)}):t._resolve(n)},error:function(n){return new t(n)},_resolve:function(n){n=n===undefined?null:Array.isArray(n)?this.asMatrix(n):yt(n);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.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.formula);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,t){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 i?u=u.concat(this.cellValues(r.data)):u.push(r);return t?t.apply(this,u):u},fetchName:function(n,i){var f=this.formula,r=this.ss.nameValue(n,f.sheet,f.row,f.col),s;r instanceof o?(r=r.clone(f.sheet,f.row,f.col,!0),s=new u.ValidationFormulaContext(this.ss.workbook),r.exec(s,i,this)):(r instanceof e&&(r=r.absolute(f.row,f.col),r.sheet||(r.sheet=f.sheet)),i(r==null?new t("NAME"):r))},force:function(n){return n instanceof e?this.getRefData(n):n},func:function(n,i,r){n=n.toLowerCase();var u=f[n];if(u)return u.call(this,i,r);i(new t("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,t,u;if(n instanceof i)return n;if(r=this,n instanceof c){var s=n.topLeft,f=s.row,o=s.col,h=r.getRefCells(n),t=new i(r);return isFinite(n.width())&&(t.width=n.width()),isFinite(n.height())&&(t.height=n.height()),isFinite(f)||(f=0),isFinite(o)||(o=0),h.forEach(function(n){t.set(n.row-f,n.col-o,n.value)}),t}if(Array.isArray(n)&&n.length>0)return t=new i(r),u=0,n.forEach(function(n){var f=0,o=1;n.forEach(function(n){var s=n instanceof c;n instanceof e&&!s&&(n=r.getRefData(n));(s||Array.isArray(n))&&(n=r.asMatrix(n));n instanceof i?(n.each(function(n,i,r){t.set(u+i,f+r,n)}),o=Math.max(o,n.height),f+=n.width):t.set(u,f++,n)});u+=o}),t},getRefCells:function(n,t){var i=this.formula;return this.ss.getRefCells(n,t,i.sheet,i.row,i.col)},getRefData:function(n){var t=this.formula;return this.ss.getData(n,t.sheet,t.row,t.col)},workbook:function(){return this.ss.workbook}});i=w.extend({init:function(n){this.context=n;this.height=0;this.width=0;this.data=[]},clone:function(){var n=new i(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,t){var r=new i(this.context);return this.each(function(t,i,u){r.set(i,u,n.call(this,t,i,u))},t),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 t=new i(this.context);return this.eachRow(function(i){t.set(i,0,n.call(this.context,i))}),t},mapCol:function(n){var t=new i(this.context);return this.eachCol(function(i){t.set(0,i,n.call(this.context,i))}),t},toString:function(){return JSON.stringify(this.data)},transpose:function(){var n=new i(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 r,o,u,s,h,f=this,c=new i(f.context),e=0;e<f.height;++e)for(r=0;r<n.width;++r){for(o=0,u=0;u<f.width;++u){if(s=f.get(e,u),h=n.get(u,r),typeof s!="number"||typeof h!="number")throw new t("VALUE");o+=s*h}c.set(e,r,o)}return c},adds:function(n,t){for(var r,o,s,f=this,e=new i(f.context),h=t?-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 i(this.context).unit(u)),t=o.data,s,n=0;n<u;++n){if(e=vt(n,u,function(i){return t[i][n]}),!t[e][n])return null;for(n!=e&&(s=t[n],t[n]=t[e],t[e]=s),r=n+1;r<u;++r){for(f=n+1;f<2*u;++f)t[r][f]-=t[n][f]*t[r][n]/t[n][n];t[r][n]=0}}for(r=0;r<u;++r)for(h=t[r][r],f=0;f<2*u;++f)t[r][f]/=h;for(n=u;--n>=0;)for(r=n;--r>=0;)if(t[r][n])for(f=2*u;--f>=u;)t[r][f]-=t[n][f]*t[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,t,r,u){for(var f,o=new i(this.context),e=0;e<r;++e)for(f=0;f<u;++f)o.set(e,f,this.get(n+e,t+f));return o}});o=w.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,r){var f=n.toLowerCase(),u=this.refs;return(r||f!=this.sheet.toLowerCase())&&(u=u.map(function(t){return t.hasSheet()||t.sheet&&t.sheet.toLowerCase()==f||(t=t.clone().setSheet(n)),t})),new o(u,this.handler,this.print,n,t,i)},deepClone:function(){var n=this.refs.map(function(n){return n.clone()});return new o(n,this.handler,this.print,this.sheet,this.row,this.col)},resolve:function(n){this.pending=!1;this.onReady.forEach(function(t){t(n)})},exec:function(n,i,r){var u,f,e;if("value"in this)i&&i(this.value);else{for(i&&this.onReady.push(i),u=new tt(this.resolve,this,n,r),f=0;r;){if(r.formula===this){this.pending=!1;u.resolve(new t("CIRCULAR"));return}r=r.parent;++f}if(this.pending)return;this.pending=!0;e=function(){this.absrefs||(this.absrefs=this.refs.map(function(n){return n.absolute(this.row,this.col)},this));this.handler.call(u)}.bind(this);f<20?e():setTimeout(e,0)}},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.renameSheet(n,t)})},adjust:function(n,t,i,r){function y(o){return o===at?o:o.sheet.toLowerCase()!=n?(e&&(t=="row"&&u>=i&&(o=o.relative(r,0)),t=="col"&&f>=i&&(o=o.relative(0,r))),o):o.adjust(u,f,c,a,t=="row",i,r)}var c,a,h,s;n=n.toLowerCase();var u=this.row,f=this.col,v=this.sheet.toLowerCase(),e=!1;return v==n&&(t=="row"&&u>=i&&(this.row+=r,e=!0),t=="col"&&f>=i&&(this.col+=r,e=!0)),c=this.row,a=this.col,this.absrefs=null,h=this.refs,s=e,this.refs=h.map(function(n){var t=y(n);return s||l(t,n)||(s=!0),t}),s?new o(h,this.handler,this.print,this.sheet,u,f):void 0},toString:function(){return this.print(this.row,this.col)}});f=Object.create(null);f["if"]=function(n,i){var u=this,r=i[0],f=i[1],e=i[2];this.resolveCells([r],function(){var i=u.asMatrix(r);i?f(function(r){e(function(f){var e=u.asMatrix(r),o=u.asMatrix(f);n(i.map(function(n,i,s){return n instanceof t?n:u.bool(n)?e?e.get(i,s):r:o?o.get(i,s):f}))})}):(r=this.force(r),r instanceof t?n(r):u.bool(r)?f(n):e(n))})};f["φ"]=function(n){n((1+Math.sqrt(5))/2)};var ft=ut(1900,0,-1),kt=[31,28,31,30,31,30,31,31,30,31,30,31],dt=[[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 d=6e4,g=60*d,ti=24*g;r.CalcError=t;r.Formula=o;r.Matrix=i;r.packDate=ot;r.unpackDate=et;r.packTime=ct;r.unpackTime=st;r.serialToDate=ht;r.dateToSerial=lt;r.daysInMonth=ni;r.isLeapYear=a;r.daysInYear=gt;r.parseDate=ii;r.limitPrecision=k;u.dateToNumber=lt;u.numberToDate=ht;u.defineFunction=n;u.CalcError=t;r.defineFunction=n;r.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};r.FUNCS=f;var s=["or","number",["null",0]],v=[["*a",s],["*b",s]],h=[["*a",["or","anyvalue",["null",0]]],["*b",["or","anyvalue",["null",0]]]];n("binary+",function(n,t){return n+t}).args(v);n("binary-",function(n,t){return n-t}).args(v);n("binary*",function(n,t){return n*t}).args(v);n("binary/",function(n,t){return n/t}).args([["*a",s],["*b","divisor"]]);n("binary^",function(n,t){return Math.pow(n,t)}).args(v);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(h);n("binary<>",function(n,t){return n!==t}).args(h);n("binary<",y(function(n,t){return n<t})).args(h);n("binary<=",y(function(n,t){return n<=t})).args(h);n("binary>",y(function(n,t){return n>t})).args(h);n("binary>=",y(function(n,t){return n>=t})).args(h);n("unary+",function(n){return n}).args([["*a",s]]);n("unary-",function(n){return-n}).args([["*a",s]]);n("unary%",function(n){return n/100}).args([["*a",s]]);n("binary:",function(n,t){return new c(n,t).setSheet(n.sheet||this.formula.sheet,n.hasSheet())}).args([["a","cell"],["b","cell"]]);n("binary,",function(n,t){return new nt([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",["or","anyvalue",["null",0]]]]);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 t}).args([["*value","forced!"]]);n("iserr",function(n){return n instanceof t&&n.code!="N/A"}).args([["*value","forced!"]]);n("isna",function(n){return n instanceof t&&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 c}).args([["*value","anything!"]]);f[",getname"]=function(n,t){this.fetchName(t[0],n)}}},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("spreadsheet/validation",["spreadsheet/runtime"],n)}(function(){"use strict";function s(i,r,e,s){var c,h,l,a;if(typeof s=="string"&&(s=JSON.parse(s)),s.from&&(s.dataType!=="list"||s.fromIsListValue||(s.from=kendo.format(o,s.from),s.fromIsListValue=!0),s.dataType==="date"&&(l=t.runtime.parseDate(s.from),l&&(s.from=kendo.format(f,s.from),s.fromIsDateValue=!0)),s.from=t.compile(t.parseFormula(i,r,e,s.from))),s.to&&(s.dataType==="date"&&(a=t.runtime.parseDate(s.to),a&&(s.to=kendo.format(f,s.to),s.toIsDateValue=!0)),s.to=t.compile(t.parseFormula(i,r,e,s.to))),h=s.dataType=="custom"?n.validationComparers.custom:s.dataType=="list"?n.validationComparers.list:n.validationComparers[s.comparerType],!h)throw kendo.format("'{0}' comparer is not implemented.",s.comparerType);return c=function(n){var t=this.to&&this.to_value?this.to_value:undefined,i;return n===null||n===""?this.value=this.allowNulls?!0:!1:this.dataType=="custom"?this.value=h(n,this.from_value,t):this.dataType=="list"?(i=this._getListData(),this.value=h(n,i,t)):this.value=h(n,this.from_value,t),this.value},new kendo.spreadsheet.validation.Validation(u.extend(s,{handler:c,sheet:i,row:r,col:e}))}var u=kendo.jQuery,r,n,i;if(!kendo.support.browser.msie||!(kendo.support.browser.version<9)){r=kendo.spreadsheet;n={};r.validation=n;var t=r.calc,e=kendo.Class,o="_matrix({0})",f='DATEVALUE("{0}")';t.runtime.defineFunction("_matrix",function(n){return typeof n=="string"&&(n=this.asMatrix([n.split(/\s*,\s*/)])),n}).args([["m",["or","matrix","string"]]]);i=e.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.fromIsDateValue=n.fromIsDateValue?!0:!1;this.toIsDateValue=n.toIsDateValue?!0:!1;this.showButton=n.showButton;this.fromIsListValue=n.fromIsListValue?!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,r){var f=this._getOptions();return f.from&&(f.from=f.from.clone(n,t,r)),f.to&&(f.to=f.to.clone(n,t,r)),new i(u.extend(f,{handler:this.handler},{sheet:n,row:t,col:r}))},deepClone:function(){var n=new i(this);return n.from=n.from.deepClone(),n.to&&(n.to=n.to.deepClone()),n},exec:function(n,t,i,r){function f(t){return t instanceof kendo.spreadsheet.Ref&&(t=n.getData(t),Array.isArray(t)&&(t=t[0])),t}var u=this,e=function(n){u.from_value=f(n);u.value=u.handler.call(u,t,i);u._setMessages();r&&r(u.value)};u.to?u.to.exec(n,function(t){u.to_value=f(t);u.from.exec(n,e)}):u.from.exec(n,e)},reset:function(){this.from&&this.from.reset();this.to&&this.to.reset();delete this.value},adjust:function(n,t,r,u){var e,o,s,h=this.row,c=this.col,f;if(this.from&&(e=this.from.adjust(n,t,r,u)),this.to&&(o=this.to.adjust(n,t,r,u)),this.sheet.toLowerCase()==n.toLowerCase())switch(t){case"row":h>=r&&(s=!0,this.row+=u);break;case"col":c>=r&&(s=!0,this.col+=u)}if(s||e||o)return f=new i(this),f.from=e,f.to=o,f.row=h,f.col=c,f},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"),delete n.fromIsListValue),n.dataType==="date"&&this.fromIsDateValue&&(n.from=n.from.replace(/^DATEVALUE\("(.*)"\)$/i,"$1"),delete n.fromIsDateValue)),n.to&&(n.to=n.to.toString(),n.dataType==="date"&&this.toIsDateValue&&(n.to=n.to.replace(/^DATEVALUE\("(.*)"\)$/i,"$1"),delete n.toIsDateValue)),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,fromIsListValue:this.fromIsListValue,fromIsDateValue:this.fromIsDateValue,toIsDateValue:this.toIsDateValue,tooltipMessageTemplate:this.tooltipMessageTemplate,tooltipTitleTemplate:this.tooltipTitleTemplate,messageTemplate:this.messageTemplate,titleTemplate:this.titleTemplate,showButton:this.showButton}}});n.compile=s;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=i}},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("spreadsheet/sheet",["kendo.core","kendo.color","spreadsheet/runtime","spreadsheet/validation","spreadsheet/references"],n)}(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,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.first(),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._sheet.triggerSelect(new r(n,this._sheet));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(){n.Observable.prototype.init.call(this);this._reinit.apply(this,arguments)},events:["commandRequest","afterInsertRow","afterDeleteRow","insertRow","insertColumn","deleteRow","deleteColumn","hideRow","hideColumn","unhideRow","unhideColumn","select"],_reinit:function(t,i,r,u,e,o,s){s=s||{};this._defaultCellStyle={background:s.background,color:s.color,fontFamily:s.fontFamily,fontSize:s.fontSize,italic:s.italic,bold:s.bold,underline:s.underline,wrap:s.wrap};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._showGridLines=!0;this._gridLinesColor=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(t,i,this._defaultCellStyle);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._sheetName=n,this):this._sheetName},name:function(){return 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},triggerSelect:function(n){this.trigger("select",{range:n})},setDataSource:function(t,i){this.dataSourceBinder&&this.dataSourceBinder.destroy();this.dataSourceBinder=new n.spreadsheet.SheetDataSourceBinder({dataSource:t,sheet:this,columns:i});this.dataSource=this.dataSourceBinder.dataSource},hideColumn:function(n){if(!this.trigger("hideColumn",{index:n}))return this._property(this._columns.hide.bind(this._columns),n,{layout:!0})},unhideColumn:function(n){if(!this.trigger("unhideColumn",{index: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)},_saveModifiedFormulas:function(n,t){var r=u,i;return u=n,i=t(),u=r,i},_restoreModifiedFormulas:function(t){var i=this._workbook;t.forEach(function(t){var u=i.sheetByName(t.sheet),r;t instanceof n.spreadsheet.calc.runtime.Formula&&(r=u._grid.cellRefIndex(t),u._properties.set("formula",r,r,t));t instanceof n.spreadsheet.validation.Validation&&(r=u._grid.cellRefIndex(t),u._properties.set("validation",r,r,t))})},_adjustReferences:function(t,r,f,e){var s,o,h;this._mergedCells=e.reduce(function(n,u){return u=u.adjust(null,null,null,null,t=="row",r,f),u instanceof i&&n.push(u),n},[]);this._workbook&&(s=this._name(),this._workbook._sheets.forEach(function(n){n._forFormulas(function(n){var i=n.adjust(s,t,r,f);i&&u&&u.push(i)});n._forValidations(function(n){var i=n.adjust(s,t,r,f);i&&u&&u.push(i)})}),this._workbook.adjustNames(s,t=="row",r,f));o=this.select();o=o.adjust(null,null,null,null,t=="row",r,f);o!==n.spreadsheet.NULLREF&&this.select(o);h=t=="col"?this._columns:this._rows;h.adjust(r,f)},_forFormulas:function(n){var i=this._properties,t=i.get("formula").values(),r=t.length;t.forEach(function(t,i){n.call(this,t.value,i,r)},this)},_forValidations:function(n){var t=this._properties;t.get("validation").values().forEach(function(t){n.call(this,t.value)},this)},preventInsertRow:function(n,t){if(this.selectedHeaders().allRows)return{reason:"error",type:"insertRowWhenColumnIsSelected"};t=t||1;var i=this._grid,r=this.range(i.rowCount-t,0,t,i.columnCount);return r.hasValue()?{reason:"error",type:"shiftingNonblankCells"}:!1},preventInsertColumn:function(n,t){if(this.selectedHeaders().allCols)return{reason:"error",type:"insertColumnWhenRowIsSelected"};t=t||1;var i=this._grid,r=this.range(0,i.columnCount-t,i.rowCount,t);return r.hasValue()?{reason:"error",type:"shiftingNonblankCells"}:!1},insertRow:function(n){var u=this.preventInsertRow(n);if(u)throw new Error("Shifting nonblank cells off the worksheet is not supported!");if(!this.trigger("insertRow",{index:n}))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({clearAll:!0,keepBorders:!0})}this._adjustReferences("row",n,1,h)},{recalc:!0,layout:!0,insertRow:{index:n},ref:new i(new t(n,0),new t(Infinity,Infinity))}),this.trigger("afterInsertRow",{index:n}),this},isEnabledRow:function(n){var u=new i(new t(n,0),new t(n,this._grid.columnCount));return new r(u,this).enable()},deleteRow:function(n){return this.isEnabledRow(n)?this.trigger("deleteRow",{index:n})?void 0:(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({clearAll:!0,keepBorders:!0});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,deleteRow:{index:n},ref:new i(new t(n,0),new t(Infinity,Infinity))}),this.trigger("afterDeleteRow",{index:n}),this):this},insertColumn:function(n){if(!this.trigger("insertColumn",{index: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({clearAll:!0,keepBorders:!0}),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,insertColumn:{index:n},ref:new i(new t(0,n),new t(Infinity,Infinity))}),this},isEnabledColumn:function(n){var u=new i(new t(0,n),new t(Infinity,n));return new r(u,this).enable()},deleteColumn:function(n){return this.isEnabledColumn(n)?this.trigger("deleteColumn",{index:n})?void 0:(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({clearAll:!0,keepBorders:!0}),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,deleteColumn:{index:n},ref:new i(new t(0,n),new t(Infinity,Infinity))}),this):this},hideRow:function(n){if(!this.trigger("hideRow",{index:n}))return this._property(this._rows.hide.bind(this._rows),n,{layout:!0})},unhideRow:function(n){if(!this.trigger("unhideRow",{index: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})},showGridLines:function(n){return this._field("_showGridLines",n,{layout:!0})},gridLinesColor:function(n){return this._field("_gridLinesColor",n,{layout:!0})},_ref:function(r,u,f,e){var o=null;return r instanceof n.spreadsheet.Ref?r:r instanceof n.spreadsheet.Range?r._ref.toRangeRef():(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)},_getMergedCells:function(n){var u=this._grid,i={},r={},t=!1;return this.forEachMergedCell(n,function(f){var e=f.topLeft;u.forEach(f,function(u){e.eq(u)?(i[u.print()]=f,t=!0):n.contains(u)&&(r[u.print()]=e,t=!0)})}),{primary:i,secondary:r,hasMerged:t}},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){function o(n){t(e++,r,n)}var u,f,r;for(n instanceof i||(n=this._ref(n)),u=this._grid.normalize(n.topLeft),f=this._grid.normalize(n.bottomRight),r=u.col;r<=f.col;r++){var e=u.row,s=this._grid.index(e,r),h=this._grid.index(f.row,r);this._properties.forEach(s,h,o)}},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.trigger("commandRequest",{command:"ColumnWidthCommand",options:{target:n.col,value:this.columnWidth(n.col)-(this._initialPosition.x-t.x)}}):this.trigger("commandRequest",{command:"RowHeightCommand",options:{target:n.row,value: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.trigger("commandRequest",{command:"ClearContentCommand",options:{operatingRange:this.range(this._autoFillPunch)}}):n.eq(t)?this.triggerChange({selection:!0}):this.trigger("commandRequest",{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),n=this._grid.normalize(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,f=this._grid.rowCount-1,e=this._grid.columnCount-1;return u.forEach(function(u){var o,c="partial",l="partial";u=u.toRangeRef();var s=u.bottomRight,h=u.topLeft,a=h.col<=0&&s.col>=e,v=h.row<=0&&s.row>=f;if(v&&(r=!0,l="full"),a&&(i=!0,c="full"),!v)for(o=h.row;o<=s.row;o++)n[o]!=="full"&&(n[o]=c);if(!a)for(o=h.col;o<=s.col;o++)t[o]!=="full"&&(t[o]=l)}),{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(){function s(n){Object.keys(u).forEach(function(t){n[t]===u[t]&&delete n[t]})}var r={},t=this._rows.toJSON("height",r),o=this._columns.toJSON("width",{}),f=this._viewSelection,e=[],u=this._defaultCellStyle||{},i;return this.forEach(n.spreadsheet.SHEETREF,function(i,u,f){if(s(f),Object.keys(f).length!==0){f.link&&e.push({ref:n.spreadsheet.Ref.display(null,i,u),target:f.link});var o=r[i];o===undefined&&(o=t.length,t.push({index:i}),r[i]=o);i=t[o];f.index=u;i.cells===undefined&&(i.cells=[]);f.formula&&(f.formula=f.formula.toString());f.validation&&(f.validation=f.validation.toJSON());f.color&&(f.color=n.parseColor(f.color).toCss());f.background&&(f.background=n.parseColor(f.background).toCss());f.borderTop&&f.borderTop.color&&(f.borderTop.color=n.parseColor(f.borderTop.color).toCss());f.borderBottom&&f.borderBottom.color&&(f.borderBottom.color=n.parseColor(f.borderBottom.color).toCss());f.borderRight&&f.borderRight.color&&(f.borderRight.color=n.parseColor(f.borderRight.color).toCss());f.borderLeft&&f.borderLeft.color&&(f.borderLeft.color=n.parseColor(f.borderLeft.color).toCss());i.cells.push(f)}}),i={name:this._name(),rows:t,columns:o,selection:f.selection.toString(),activeCell:f.activeCell().toString(),frozenRows:this.frozenRows(),frozenColumns:this.frozenColumns(),showGridLines:this.showGridLines(),gridLinesColor:this.gridLinesColor(),mergedCells:this._mergedCells.map(function(n){return n.toString()}),hyperlinks:e,defaultCellStyle:u},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,c;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,c=t.filter.columns===undefined?[]:t.filter.columns,h?(this._filter={ref:this._ref(h),columns:c.map(function(t){return{index:t.index,filter:n.spreadsheet.Filter.create(t)}})},this._refreshFilter()):n.logToConsole("Dropping filter for sheet '"+t.name+"' due to missing ref"));t.showGridLines!==undefined&&(this._showGridLines=t.showGridLines);this._gridLinesColor=t.gridLinesColor});this._rows._refresh();this._columns._refresh()},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,t){function e(){r--;u!=i||r||t()}var f=this._properties.get("formula").values(),i=f.length,r=0,u=0;if(!i&&t)return t();while(u<i)r++,f[u++].value.exec(n,t?e:null)},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 instanceof n.spreadsheet.validation.Validation?r.clone(this._name(),t,i):(r.from!=null&&(r.from=(r.from+"").replace(/^=/,"")),r.to!=null&&(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(t,i,r){var u=this._grid.normalize(t.topLeft),e=this._grid.normalize(t.bottomRight),f,o,s;if(typeof r=="number"&&(r=n.spreadsheet.calc.runtime.limitPrecision(r)),r&&i=="formula")typeof r=="string"&&(r=this._compileFormula(u.row,u.col,r)),r=this._copyValuesInRange(u,e,r,"formula");else if(r&&i=="validation")r=this._compileValidation(u.row,u.col,r),r=this._copyValuesInRange(u,e,r,"validation");else for(f=u.col;f<=e.col;f++)o=this._grid.index(u.row,f),s=this._grid.index(e.row,f),this._properties.set(i,o,s,r),i=="formula"&&this._properties.set("value",o,s,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||{recalc:!0})},_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.forEach(n,function(n,t,i){var r=i.formula,u,f;r&&(u=n-r.row,u!==0&&(f=u>0?r.row:r.row+u,r.adjust(this.name(),"row",f,u)))}.bind(this));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}},{recalc:!0,layout:!0,filter:!0})},filterColumn:function(n){var t=this.filter().ref;return n.toRangeRef().topLeft.col-t.topLeft.col},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()},{recalc:!0,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 e;if(t instanceof n.spreadsheet.CellRef)return t;var o=t.toRangeRef().union(u,function(n){u.splice(u.indexOf(n),1)}),f=new r(o,i),s=f._get("formula"),h=f.value(),c=f.format(),l=f.background();return f.value(null),f.format(null),f.background(null),e=new r(o.collapse(),i),s?e._set("formula",s):e.value(h),e.format(c),e.background(l),u.push(o),o});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)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("spreadsheet/sheetsbar",["kendo.core","kendo.sortable"],n)}(function(){(function(n){if(!n.support.browser.msie||!(n.support.browser.version<9)){var u=n.jQuery,f=n._outerWidth,t=".",i=" ",r=n.ui.Widget.extend({init:function(i,u){var f=r.classNames;n.ui.Widget.call(this,i,u);i=this.element;i.addClass(f.sheetsBarWrapper);this._openDialog=u.openDialog;this._tree=new n.dom.Tree(i[0]);this._tree.render([this._addButton(),this._createSheetsWrapper([])]);this._toggleScrollEvents(!0);this._createSortable();this._sortable.bind("start",this._onSheetReorderStart.bind(this));this._sortable.bind("end",this._onSheetReorderEnd.bind(this));i.on("click",t+f.sheetsBarRemove,this._onSheetRemove.bind(this));i.on("click","li",this._onSheetSelect.bind(this));i.on("dblclick","li"+t+f.sheetsBarActive,this._createEditor.bind(this));i.on("click",t+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}",t,r.classNames.sheetsBarEditor)).focus().on("keydown",this._onEditorKeydown.bind(this)).on("blur",this._onEditorBlur.bind(this)))},_destroyEditor:function(n){var t=n?null:this._editor.val();this._editor.off();this._editor=null;this._renderSheets(this._sheets,this._selectedIndex,!1);this._onSheetRename(t)},renderSheets:function(n,t){!n||t<0||this._renderSheets(n,t,!1)},_renderSheets:function(u,e,o){var s=this,v,y,c=r.classNames,d;if(s._isRtl=n.support.isRtl(s.element),s._sheets=u,s._selectedIndex=e,s._renderHtml(o,!0),s._scrollableAllowed()){var a=s._sheetsWrapper(),w=a.children(t+c.sheetsBarPrev),b=a.children(t+c.sheetsBarNext),p=2,k=s.element.find(t+c.sheetsBarAdd),h=f(k)+k.position().left+p,g=f(w)+p,l=s._sheetsGroup();w.css({left:h});a.addClass(c.sheetsBarScrollable+i+c.sheetsBarSheetsWrapper);l.css({marginLeft:h});v=a[0].offsetWidth;y=l[0].scrollWidth;y+h>v?(d=Math.ceil(n.parseFloat(b.css("right"))),s._scrollableModeActive||(s._nowScrollingSheets=!1,s._scrollableModeActive=!0),l.css({marginLeft:g+h,marginRight:f(b)+d+p})):s._scrollableModeActive&&y<=v?(s._scrollableModeActive=!1,l.css({marginLeft:h,marginRight:""})):l.css({marginLeft:h});s._toggleScrollButtons()}},_toggleScrollButtons:function(n){var u=this,i=u._sheetsGroup(),e=u._sheetsWrapper(),f=i.scrollLeft(),o=e.find(t+r.classNames.sheetsBarPrev),s=e.find(t+r.classNames.sheetsBarNext);n===!1?(o.toggle(!1),s.toggle(!1)):(o.toggle(u._isRtl?f<i[0].scrollWidth-i[0].offsetWidth-1:f!==0),s.toggle(u._isRtl?f!==0:f<i[0].scrollWidth-i[0].offsetWidth-1))},_toggleScrollEvents:function(n){var i=this,e=r.classNames,o=i.options,u,f,s=i._sheetsWrapper();if(u=s.children(t+e.sheetsBarPrev),f=s.children(t+e.sheetsBarNext),n){u.on("mousedown",function(){i._nowScrollingSheets=!0;i._scrollSheetsByDelta(o.scrollable.distance*(i._isRtl?1:-1))});f.on("mousedown",function(){i._nowScrollingSheets=!0;i._scrollSheetsByDelta(o.scrollable.distance*(i._isRtl?-1:1))});u.add(f).on("mouseup",function(){i._nowScrollingSheets=!1})}else u.off(),f.off()},_renderHtml:function(t,u){for(var l=[],a=n.dom,o=a.element,h=this._sheets,w=this._selectedIndex,f=r.classNames,p,e=0;e<h.length;e++){var c=h[e],v=e===w,y={className:f.sheetsBarKItem+i},s=[];y.className+=v?f.sheetsBarKActive+i+f.sheetsBarActive:f.sheetsBarInactive;v&&t?s.push(o("input",{type:"text",value:c.name(),className:f.sheetsBarKTextbox+i+f.sheetsBarEditor,maxlength:50},[])):(s.push(o("span",{className:f.sheetsBarKLink,title:c.name()},[a.text(c.name())])),h.length>1&&(p=o("span",{className:f.sheetsBarKIcon+i+f.sheetsBarKFontIcon+i+f.sheetsBarKIconX},[]),s.push(o("span",{className:f.sheetsBarKLink+i+f.sheetsBarRemove},[p]))));l.push(o("li",y,s))}this._tree.render([this._addButton(),this._createSheetsWrapper(l,u)])},_createSheetsWrapper:function(t,u){var e=n.dom.element,f=r.classNames,o=[e("ul",{className:f.sheetsBarKReset},t)],s;return u=!0,u&&(s=f.sheetsBarKButton+i+f.sheetsBarKButtonBare+i,o.push(e("span",{className:s+f.sheetsBarPrev},[e("span",{className:f.sheetsBarKIcon+i+f.sheetsBarKArrowW},[])])),o.push(e("span",{className:s+f.sheetsBarNext},[e("span",{className:f.sheetsBarKIcon+i+f.sheetsBarKArrowE},[])]))),e("div",{className:f.sheetsBarItems},o)},_createSortable:function(){var i=r.classNames;this._sortable=new n.ui.Sortable(this.element,{filter:n.format("ul li.{0},ul li.{1}",i.sheetsBarActive,i.sheetsBarInactive),container:t+i.sheetsBarItems,axis:"x",animation:!1,ignore:"input",end:function(){this.draggable.hint&&this.draggable.hint.remove()},hint:function(n){var t=u(n).clone();return t.wrap("<div class='"+i.sheetsBarHintWrapper+"'><ul class='"+i.sheetsBarKResetItems+"'><\/ul><\/div>").closest("div")}})},_onEditorKeydown:function(n){this._editor&&(n.which===13&&this._destroyEditor(),n.which===27&&this._destroyEditor(!0))},_onEditorBlur:function(){this._editor&&this._destroyEditor()},_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 i=u(n.target).closest("li").text(),t;this._editor&&this._destroyEditor();t=function(n){var t=n.sender;t.isConfirmed()&&this.trigger("remove",{name:i,confirmation:!0})}.bind(this);this._openDialog("confirmation",{close:t})},_onSheetSelect:function(n){var i=u(n.target).text();if(u(n.target).is(t+r.classNames.sheetsBarEditor)||!i){n.preventDefault();return}this._editor&&this._destroyEditor();this._scrollSheetsToItem(u(n.target).closest("li"));this.trigger("select",{name:i,isAddButton:!1})},_onSheetRename:function(n){this._sheets[this._selectedIndex].name()!==n&&n!==null&&this.trigger("rename",{name:n,sheetIndex:this._selectedIndex})},_onAddSelect:function(){this.trigger("select",{isAddButton:!0})},_addButton:function(){var u=n.dom.element,t=r.classNames;return u("a",{className:t.sheetsBarAdd+i+t.sheetsBarKButton},[u("span",{className:t.sheetsBarKIcon+i+t.sheetsBarKFontIcon+i+t.sheetsBarKIconPlus},[])])},destroy:function(){this._sortable.destroy()},_scrollableAllowed:function(){var n=this.options;return n.scrollable&&!isNaN(n.scrollable.distance)},_scrollSheetsToItem:function(n){var i=this;if(i._scrollableModeActive){var r=i._sheetsGroup(),u=r.scrollLeft(),o=f(n),t=i._isRtl?n.position().left:n.position().left-r.children().first().position().left,s=r[0].offsetWidth,h=Math.ceil(parseFloat(r.css("padding-left"))),e;i._isRtl?t<0?e=u+t-(s-u)-h:t+o>s&&(e=u+t-o+h*2):u+s<t+o?e=t+o-s+h*2:u>t&&(e=t-h);r.finish().animate({scrollLeft:e},"fast","linear",function(){i._toggleScrollButtons()})}},_sheetsGroup:function(){return this._sheetsWrapper().children("ul")},_sheetsWrapper:function(){return this.element.find(t+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()})}});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-tabstrip-scrollable",sheetsBarNext:"k-tabstrip-next",sheetsBarPrev:"k-tabstrip-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-icon",sheetsBarKButton:"k-button k-button-icon",sheetsBarKButtonBare:"k-bare",sheetsBarKArrowW:"k-i-arrow-60-left",sheetsBarKArrowE:"k-i-arrow-60-right",sheetsBarKReset:"k-reset k-tabstrip-items",sheetsBarKIconX:"k-i-close",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)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("spreadsheet/calc",["spreadsheet/runtime"],n)}(function(){"use strict";function s(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 f(n){return parseInt(n,10)-1}function ft(n,t){var e,o,c,l,a,i;if(n.toLowerCase()=="#sheet")return r.SHEETREF;n:{for(e=v(n,{}),o=[];;){if(c=/^(\$)?([a-z]+)(\$)?(\d+)$/i.exec(n)){if(l=f(c[4]),a=s(c[2]),l<1048576&&a<16384)return new u(f(c[4]),s(c[2]));break n}if(i=e.next(),i instanceof u)i.rel=0;else if(i instanceof h)i.topLeft.rel=0,i.bottomRight.rel=0;else break n;if(o.push(i),e.eof())break;if(!e.is("op",","))break n;e.next()}return o.length==1?o[0]:new r.UnionRef(o)}if(!t)throw new Error("Cannot parse reference: "+n);}function a(n,i,r,u){function p(n){return n.index=l.length,l.push(n),n}function s(n,t,i){if(f(n,t))return u.next();var r=u.peek();r?u.croak("Expected "+n+" «"+t+"» but found "+r.type+" «"+r.value+"»"):i||u.croak("Expected "+n+" «"+t+"»")}function h(n){return y(nt(a(n)),0,n)}function b(n){return n.upper=="TRUE"||n.upper=="FALSE"?n.upper=="TRUE"?e:o:p(new c(n.value))}function k(){var t=u.next(),n;for(t=t.value,s("punc","("),n=[];;){if(f("punc",")"))break;if(f("op",",")){n.push({type:"null"});u.next();continue}if(n.push(h(!1)),u.eof()||f("punc",")"))break;s("op",",")}return s("punc",")",!0),{type:"func",func:t,args:n}}function d(t){return t.hasSheet()||t.setSheet(n),p(t)}function a(n){var t;return f("ref")?t=d(u.next()):f("func")?t=k():f("punc","(")?(u.next(),t=h(!0),s("punc",")",!0)):f("punc","{")?(u.next(),t=g(),s("punc","}",!0)):f("num")||f("str")||f("error")?t=u.next():f("sym")?t=b(u.next()):f("op","+")||f("op","-")?t={type:"prefix",op:u.next().value,exp:a(n)}:u.peek()?f("punc","[")?u.croak("External reference not supported"):u.croak("Parse error"):u.croak("Incomplete expression"),w(t)}function g(){for(var n=[],t=[n],i=!0;!u.eof()&&!f("punc","}");)i?i=!1:f("punc",";")?(t.push(n=[]),u.next()):s("op",","),n.push(h(!1));return{type:"matrix",value:t}}function nt(n){return f("punc","(")||f("ref")||f("num")||f("func")?{type:"binary",op:" ",left:n,right:h(!1)}:n}function w(n){return f("op","%")?(u.next(),w({type:"postfix",op:"%",exp:n})):n}function y(n,i,r){var e=f("op"),o,s;return e&&(r||e.value!=",")&&(o=t[e.value],o>i)?(u.next(),s=y(a(r),o,r),y({type:"binary",op:e.value,left:n,right:s},i,r)):n}var l=[],f;return u=v(u,{row:i,col:r}),f=u.is,{type:"exp",ast:h(!0),refs:l,sheet:n,row:i,col:r}}function et(n,t){var r=a(null,0,0,n),i;if(!(r.ast instanceof c))throw new l("Invalid name: "+n);return r=r.ast,t instanceof g||(i=a(r.sheet,0,0,t),t=i.ast instanceof g?i.ast:/^(?:str|num|bool|error)$/.test(i.ast.type)?i.ast.value:nt(i)),{name:r,value:t}}function ot(n){function i(n,u,f){function e(i){var e=n.op,o=t[e]<f||!f&&e==","||u.type=="prefix"&&f==t[e]&&u.op=="-"||u.type=="binary"&&f==t[e]&&n===u.right;return r(i(),o)}switch(n.type){case"num":case"bool":return JSON.stringify(n.value);case"error":return JSON.stringify("#"+n.value);case"str":return JSON.stringify(JSON.stringify(n.value));case"ref":return"this.refs["+n.index+"].print(row, col, mod)";case"prefix":return e(function(){return JSON.stringify(n.op)+" + "+i(n.exp,n,t[n.op])});case"postfix":return e(function(){return i(n.exp,n,t[n.op])+" + "+JSON.stringify(n.op)});case"binary":return e(function(){var u=r(i(n.left,n,t[n.op]),n.left instanceof c&&n.op==":"),f=r(i(n.right,n,t[n.op]),n.right instanceof c&&n.op==":");return u+" + "+JSON.stringify(n.op)+" + "+f});case"func":return JSON.stringify(n.func+"(")+" + "+(n.args.length>0?n.args.map(function(t){return i(t,n,0)}).join(" + ', ' + "):"''")+" + ')'";case"matrix":return"'{ ' + "+n.value.map(function(t){return t.map(function(t){return i(t,n,0)}).join(" + ', ' + ")}).join(" + '; ' + ")+"+ ' }'";case"null":return"''"}throw new Error("Cannot make printer for node "+n.type);}function r(n,t){return t?"'(' + "+n+" + ')'":n}return p("function(row, col, mod){return("+i(n.ast,n,0)+")}")}function st(n,t){function i(n,t){switch(n.type){case"ref":return c(n,t);case"num":case"str":case"null":case"error":case"bool":return r(n,t);case"prefix":case"postfix":return a(n,t);case"binary":return v(n,t);case"func":return b(n,t);case"lambda":return k(n,t);case"matrix":return s(n.value,t,!0)}throw new Error("Cannot CPS "+n.type);}function c(n,t){return n.ref=="name"?l(n,t):r(n,t)}function r(n,t){return t(n)}function l(n,t){return{type:"func",func:",getname",args:[f(t),n]}}function a(n,t){return i({type:"func",func:"unary"+n.op,args:[n.exp]},t)}function v(n,t){return i({type:"func",func:"binary"+n.op,args:[n.left,n.right]},t)}function y(n,t,r,s){return i(n,function(n){var l=f(s),h=u("T"),c=u("E");return{type:"func",func:"if",args:[l,n,{type:"lambda",vars:[h],body:i(t||e,function(n){return{type:"call",func:{type:"var",name:h},args:[n]}})},{type:"lambda",vars:[c],body:i(r||o,function(n){return{type:"call",func:{type:"var",name:c},args:[n]}})}]}})}function p(n,t){return n.length===0?r(e,t):i({type:"func",func:"IF",args:[n[0],{type:"func",func:"AND",args:n.slice(1)},o]},t)}function w(n,t){return n.length===0?r(o,t):i({type:"func",func:"IF",args:[n[0],e,{type:"func",func:"OR",args:n.slice(1)}]},t)}function b(n,t){switch(n.func.toLowerCase()){case"if":return y(n.args[0],n.args[1],n.args[2],t);case"and":return p(n.args,t);case"or":return w(n.args,t);case"true":return t(e);case"false":return t(o)}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)})}([f(t)],0)}function k(n,t){var r=u("K"),f=i(n.body,function(n){return{type:"call",func:{type:"var",value:r},args:[n]}});return t({type:"lambda",vars:[r].concat(n.vars),body:f})}function s(n,t,r){var u=[];return function f(e){return e==n.length?t({type:"matrix",value:u}):(r?s:i)(n[e],function(n){return u[e]=n,f(e+1)})}(0)}function f(n){var t=u("R");return{type:"lambda",vars:[t],body:n({type:"var",name:t})}}function u(n){return n||(n=""),n="_"+n,n+ ++h}var h=0;return i(n,t)}function nt(n){function t(n){var i=n.type;if(i=="num")return n.value+"";if(i=="str")return JSON.stringify(n.value);if(i=="error")return"context.error("+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])+", "+o(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 o(n.value);if(i=="null")return"null";throw new Error("Cannot compile expression "+i);}function o(n){return"[ "+n.map(t).join(", ")+" ]"}var f=ot(n),e=f.call(n),r=w[e],u;return r?r.clone(n.sheet,n.row,n.col):(u=t(st(n.ast,function(n){return{type:"return",value:n}})),u=["function(){","var context = this, refs = context.formula.absrefs",u,"}"].join(";\n"),r=new i.Formula(n.refs,p(u),f,n.sheet,n.row,n.col),w[e]=r.clone(n.sheet,n.row,n.col),r)}function tt(n){return n}function v(n,t){function p(n,t){var i=v();return i!=null&&(n==null||i.type===n)&&(t==null||i.value===t)?i:null}function v(){return o==null&&(o=y()),o}function w(){if(o!=null){var n=o;return o=null,n}return y()}function y(){var t,i=n.peek();return i&&((i.type=="sym"||i.type=="rc"||i.type=="num")&&(t=r(8,k)||r(6,d)||r(6,g)||r(4,nt)||r(4,it)||r(2,rt)||r(2,ut)),t||(t=n.next())),t}function i(i,r){var e,o,l,h,c;if(i.type=="rc")return i.rel&&!t.forEditor&&(t.row==null||t.col==null)&&n.croak("Cannot read relative cell in RC notation"),new u(i.row,i.col,i.rel);if(i.type=="num")return i.value<=1048577?a(new u(f(i.value),r?-Infinity:+Infinity,2)):null;if(e=i.value,o=/^(\$)?([a-z]+)(\$)?(\d+)$/i.exec(e),o)return h=f(o[4]),c=s(o[2]),h<=1048576&&c<=16383?a(new u(f(o[4]),s(o[2]),(o[1]?0:1)|(o[3]?0:2))):null;if(l=e.charAt(0)=="$",l&&(e=e.substr(1)),/^\d+$/.test(e)){if(h=f(e),h<=1048576)return a(new u(f(e),r?-Infinity:+Infinity,l?0:2))}else if(c=s(e),c<=16383)return a(new u(r?-Infinity:+Infinity,s(e),l?0:1))}function k(n,t,r,u,f,o,s,c){if(n.type=="sym"&&t.type=="op"&&t.value==":"&&r.type=="sym"&&u.type=="punc"&&u.value=="!"&&(f.type=="sym"||f.type=="rc"||f.type=="num"&&f.value==f.value|0)&&o.type=="op"&&o.value==":"&&(s.type=="sym"||s.type=="rc"||s.type=="num"&&s.value==s.value|0)&&s.type==f.type&&!(c.type=="punc"&&c.value=="("&&!s.space)){var a=i(f,!0),v=i(s,!1);if(a&&v)return e(7),l(new h(a.setSheet(n.value,!0),v.setSheet(r.value,!0)).setSheet(n.value,!0),n,s)}}function d(n,t,r,u,f,o){var s,c;if(n.type=="sym"&&t.type=="op"&&t.value==":"&&r.type=="sym"&&u.type=="punc"&&u.value=="!"&&(f.type=="sym"||f.type=="rc"||f.type=="num"&&f.value==f.value|0)&&!(o.type=="punc"&&o.value=="("&&!f.space)&&(s=i(f),s))return e(5),c=s.clone(),l(new h(s.setSheet(n.value,!0),c.setSheet(r.value,!0)).setSheet(n.value,!0),n,f)}function g(n,t,r,u,f,o){if(n.type=="sym"&&t.type=="punc"&&t.value=="!"&&(r.type=="sym"||r.type=="rc"||r.type=="num"&&r.value==r.value|0)&&u.type=="op"&&u.value==":"&&(f.type=="sym"||f.type=="rc"||f.type=="num"&&f.value==f.value|0)&&!(o.type=="punc"&&o.value=="("&&!f.space)){var s=i(r,!0),c=i(f,!1);if(s&&c)return e(5),l(new h(s,c).setSheet(n.value,!0),n,f)}}function nt(n,t,r,u){if(n.type=="sym"&&t.type=="punc"&&t.value=="!"&&(r.type=="sym"||r.type=="rc"||r.type=="num"&&r.value==r.value|0)&&!(u.type=="punc"&&u.value=="("&&!r.space)){e(3);var f=i(r);return f&&isFinite(f.row)||(f=new c(r.value)),l(f.setSheet(n.value,!0),n,r)}}function it(n,t,r,u){if((n.type=="sym"||n.type=="rc"||n.type=="num"&&n.value==n.value|0)&&t.type=="op"&&t.value==":"&&(r.type=="sym"||r.type=="rc"||r.type=="num"&&r.value==r.value|0)&&!(u.type=="punc"&&u.value=="("&&!r.space)){var f=i(n,!0),o=i(r,!1);if(f&&o)return e(3),l(new h(f,o),n,r)}}function rt(n,t){if((n.type=="sym"||n.type=="rc")&&!(t.type=="punc"&&t.value=="("&&!n.space)){var r=i(n);if(r&&isFinite(r.row)&&isFinite(r.col))return e(1),l(r,n,n)}}function ut(n,t){if(n.type=="sym"&&t.type=="punc"&&t.value=="("&&!n.space)return n.type="func",e(1),n}n=ht(b(n),t);var r=n.ahead,e=n.skip,o=null,a=t.row!=null&&t.col!=null?function(n){return n.rel&1&&(n.col-=t.col),n.rel&2&&(n.row-=t.row),n}:tt,l=t.forEditor?function(n,t,i){return n.begin=t.begin,n.end=i.end,n}:tt;return{peek:v,next:w,croak:n.croak,eof:n.eof,is:p}}function it(n){return" \t\n ​".indexOf(n)>=0}function ht(n,i){function e(n){return/[0-9]/i.test(n)}function s(n){return/[a-z$_]/i.test(n)||ut.isUnicodeLetter(n)}function a(n){return s(n)||e(n)||n=="."}function v(n){return n in t}function y(n){return"!;(){}[]".indexOf(n)>=0}function p(){var n=!1,t=u(function(t){return t=="."?n?!1:(n=!0,!0):e(t)});return{type:"num",value:parseFloat(t)}}function h(t,i){return{type:"sym",value:t,upper:t.toUpperCase(),space:it(n.peek()),quote:i}}function c(n,t,i){if(!n&&!t&&!i)return null;if(!n&&!i||n&&i){var r=t?parseInt(t,10):0;return n?r:r-1}}function w(){var t=n.lookingAt(/^R(\[)?(-?[0-9]+)?(\])?C(\[)?(-?[0-9]+)?(\])?/i),i,r;return t&&(i=c(t[1],t[2],t[3]),r=c(t[4],t[5],t[6]),i!=null&&r!=null)?(n.skip(t),{type:"rc",row:i,col:r,rel:(t[4]||!(t[4]||t[5]||t[6])?1:0)|(t[1]||!(t[1]||t[2]||t[3])?2:0)}):h(u(a))}function b(){return n.next(),{type:"str",value:n.readEscaped('"')}}function k(){return n.next(),h(n.readEscaped("'"),!0)}function d(){return{type:"op",value:u(function(n,i){return i+n in t})}}function g(){return{type:"punc",value:n.next()}}function nt(){if(n.eof())return null;var t=n.peek(),r;return t=='"'?b():t=="'"?k():e(t)||t=="."?p():s(t)?w():v(t)?d():y(t)?g():(r=n.lookingAt(/^#([a-z\/]+)[?!]?/i))?(n.skip(r),{type:"error",value:r[1]}):(i.forEditor||n.croak("Can't handle character: "+t),{type:"error",value:n.next()})}function o(){while(f.length<=r){u(it);var e=n.pos(),t=nt();i.forEditor&&t&&(t.begin=e,t.end=n.pos());f.push(t)}return f[r]}function l(){var n=o();return n&&r++,n}function tt(n,t){for(var u=r,i=[];n-->0;)i.push(l()||rt);return r=u,t.apply(i,i)}function ft(n){r+=n}function et(){return o()==null}var f=[],r=0,u=n.readWhile;return{next:l,peek:o,eof:et,croak:n.croak,ahead:tt,skip:ft}}function b(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(i){throw new l(i+" (input: "+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 a(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:a,lookingAt:y,skip:c,forward:r,pos:h}}function ct(n,t,i){function f(){var r=n.next();return r.type=="sym"?r.upper=="TRUE"?(r.type="bool",r.value=!0):r.upper=="FALSE"&&(r.type="bool",r.value=!1):r.type=="ref"&&(r={type:"ref",ref:t!=null&&i!=null?r.absolute(t,i):r,begin:r.begin,end:r.end}),r}var u=[],r;for(n=v(n,{forEditor:!0,row:t,col:i});!n.eof();)u.push(f());return r=u[0],r.type=="op"&&r.value=="="&&(r.type="startexp"),u}function lt(n,t,i){var u,r;for(t=t||0,i=i||0,n=v(n,{row:t,col:i}),u=[];!n.eof();){if(r=n.next(),r.type!="ref")throw new l("Expecting a reference but got: "+JSON.stringify(r));u.push(r.absolute(t,i))}return u}function at(n,t){var r=n+t,i=d[r];return i||(i="^(\\d+(COM\\d{3})*(DOT\\d+)?)",i=i.replace(/DOT/g,"\\"+t).replace(/COM/g,"\\"+n),i=new RegExp(i),d[r]=i),i}function vt(n,t){for(var i="";t-->0;)i+=n;return i}var e,o,p,w,rt,y,k,d;if(!kendo.support.browser.msie||!(kendo.support.browser.version<9)){var ut=kendo.util,r=kendo.spreadsheet,g=r.Ref,h=r.RangeRef,u=r.CellRef,c=r.NameRef,n=r.calc,i=n.runtime,t=Object.create(null),l=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})})})([[":"],[" "],[","],["%"],["^"],["*","/"],["+","-"],["&"],["=","<",">","<=",">=","<>"]]);e={type:"bool",value:!0};o={type:"bool",value:!1};p=function(n){return function(t){var i=n[t];return i||(i=n[t]=new Function("'use strict';return("+t+")")()),i}}(Object.create(null));w=Object.create(null);rt={type:"eof"};y=[];k=n.registerFormatParser=function(n){y.push(n)};n.parse=function(n,t,r,u,f){var s,o,h,c,e;if(u instanceof Date)return{type:"date",value:i.dateToSerial(u)};if(typeof u=="number")return{type:"number",value:u};if(typeof u=="boolean")return{type:"boolean",value:u};if(u+="",/^'/.test(u))return{type:"string",value:u.substr(1)};if(/^[0-9.]+%$/.test(u)&&(s=u.substr(0,u.length-1),e=parseFloat(s),!isNaN(e)&&e==s))return{type:"percent",value:e/100};if(/^=/.test(u))return u=u.substr(1),/\S/.test(u)?a(n,t,r,u):{type:"string",value:"="+u};for(o=0;o<y.length;++o)if(h=y[o](u),h)return h;return u.toLowerCase()=="true"?{type:"boolean",value:!0}:u.toLowerCase()=="false"?{type:"boolean",value:!1}:(c=i.parseDate(u,f),c)?{type:"date",value:i.dateToSerial(c)}:(e=parseFloat(u),!isNaN(e)&&u.length>0&&e==u)?{type:"number",value:e}:{type:"string",value:u}};n.parseNameDefinition=et;n.parseFormula=a;n.parseReference=ft;n.compile=nt;n.parseSqref=lt;n.InputStream=b;n.ParseError=l;n.tokenize=ct;k(function(n){var t,u,r;if(t=/^(\d+):(\d+)$/.exec(n))return u=parseInt(t[1],10),r=parseInt(t[2],10),{type:"date",format:"hh:mm",value:i.packTime(u,r,0,0)};if(t=/^(\d+):(\d+)(\.\d+)$/.exec(n)){var r=parseInt(t[1],10),f=parseInt(t[2],10),e=parseFloat(t[3])*1e3;return{type:"date",format:"mm:ss.00",value:i.packTime(0,r,f,e)}}if(t=/^(\d+):(\d+):(\d+)$/.exec(n)){var u=parseInt(t[1],10),r=parseInt(t[2],10),f=parseInt(t[3],10);return{type:"date",format:"hh:mm:ss",value:i.packTime(u,r,f,0)}}if(t=/^(\d+):(\d+):(\d+)(\.\d+)$/.exec(n)){var u=parseInt(t[1],10),r=parseInt(t[2],10),f=parseInt(t[3],10),e=parseFloat(t[4])*1e3;return{type:"date",format:"hh:mm:ss.00",value:i.packTime(u,r,f,e)}}});k(function(n){var u,r,e=kendo.culture(),o=e.numberFormat[","],s=e.numberFormat["."],a=e.numberFormat.currency.symbol,v=at(o,s),h=new RegExp("^\\s*\\"+a+"\\s*"),f=1,t="",c="",i=!1,l;if(n=b(n.replace(/^\s+|\s+$/g,"")),n.skip(/^-\s*/)&&(f=-1),(u=n.skip(h))&&(i=!0,t+='"'+u[0]+'"'),n.skip(/^-\s*/)){if(f<0)return null;f=-1}if(!(r=n.skip(v)))return null;if(t+="#",u=n.skip(h)){if(i)return null;i=!0;c='"'+u[0]+'"'}return n.eof()?((r[2]||i)&&(t+=",#"),r[3]&&(t+="."+vt("0",r[3].length-1)),l=r[0].replace(new RegExp("\\"+o,"g"),"").replace(new RegExp("\\"+s,"g"),"."),t+=c,i&&(t+=";-"+t),{type:"number",currency:i,format:t,value:f*parseFloat(l)}):null});d={}}},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("spreadsheet/excel-reader",["kendo.core","kendo.color","util/parse-xml","spreadsheet/calc"],n)}(function(){"use strict";function ct(n,t,i){var r=new FileReader;r.onload=function(n){var r=new JSZip(n.target.result);a(r,t,i)};r.readAsArrayBuffer(n)}function u(n){return/^\//.test(n)?n.substr(1):"xl/"+n}function a(n,u,e){var c;o=u.excelImportErrors=[];var v=d(n),l=g(n,"_rels/workbook.xml"),y=ot(n,l.byType.theme[0]),p=ut(n,y),s=[],a=0;r(n,"xl/workbook.xml",{enter:function(t,r){if(this.is(bt)){var o=r["r:id"],e=l.byId[o],h=r.name,f=ci(n,e);s.push({workbook:u,zip:n,strings:v,styles:p,file:e,options:{name:h,rows:Math.max(u.options.rows||0,f.rows),columns:Math.max(u.options.columns||0,f.cols),columnWidth:f.columnWidth,rowHeight:f.rowHeight}})}else this.is(ti)&&r.activeTab&&(a=i(r.activeTab))},text:function(n){var i=this.is(at),e,r,f;!i||t(i["function"])||t(i.vbProcedure)||(e=i.localSheetId,r=null,e!=null&&(r=s[e].options.name),f=i.name,r&&(f="'"+r.replace(/\'/g,"\\'")+"'!"+f),h(r,null,function(){u.defineName(f,n,t(i.hidden))},"reading user-defined name: "+f))}});c=new f.Deferred;c.progress(function(n){e&&e.notify(n)}).then(function(){var n=u.sheets();hi(n);u.activeSheet(n[a]);e&&e.resolve()});oi(s,u,c)}function oi(n,t,i){for(var u=(new f.Deferred).resolve(),r=0;r<n.length;r++)(function(r,f){u=u.then(function(){var u=t.insertSheet(r.options),e,o;return u.suspendChanges(!0),e=si(u,r),o={sheet:u,progress:f/(n.length-1)},e.then(function(){i.notify(o)}),e})})(n[r],r);u.then(function(){i.resolve()})}function si(n,t){var i=new f.Deferred;return setTimeout(function(){p(t.zip,t.file,n,t.strings,t.styles);i.resolve()},0),i}function hi(n){for(var t=0;t<n.length;t++)n[t].suspendChanges(!1).triggerChange({recalc:!0})}function ci(n,t){var i={rows:0,cols:0};return r(n,u(t),{enter:function(n,t){if(n=="dimension"){var r=e(t.ref);r.bottomRight&&(i.cols=r.bottomRight.col+1,i.rows=r.bottomRight.row+1)}else n==="sheetFormatPr"?(t.defaultColWidth&&(i.columnWidth=v(parseFloat(t.defaultColWidth))),t.defaultRowHeight&&(i.rowHeight=y(parseFloat(t.defaultRowHeight)))):this.is(l)&&this.exit()}}),i}function v(n){var t=7,i=(256*n+Math.floor(128/t))/256;return Math.floor(i)*t}function y(n){return n*1.5625}function p(n,f,a,p,w){var d,nt,b,tt,it,gt=a._columns._count,st=null,ti=f.replace(/worksheets\//,"worksheets/_rels/"),oi=g(n,ti),ct,at,rt,ut,bt,et,dt,ot,ft=[];o=a._workbook.excelImportErrors;r(n,u(f),{enter:function(n,r){var u,ct,f,o,h,p,g,ht,vt,kt,at;if(this.is(c))b=null,tt=null,it=null,d=r.r,d==null&&(d=e(st),d.col++,d=d.toString()),st=d,nt=r.t,ct=r.s,ct!=null&&k(a,d,w,ct);else if(this.is(yt))a.range(r.ref).merge();else if(this.is(lt)){if(f=i(r.min)-1,o=Math.min(gt,i(r.max))-1,r.width&&(h=v(parseFloat(r.width)),h!==0&&a._columns.values.value(f,o,h)),r.hidden==="1"||h===0)for(p=f;p<=o;p++)a.hideColumn(p);r.style!=null&&k(a,new kendo.spreadsheet.RangeRef(new kendo.spreadsheet.CellRef(-Infinity,f),new kendo.spreadsheet.CellRef(+Infinity,o)),w,r.style)}else this.is(l)?(g=i(r.r)-1,r.ht&&(ht=y(parseFloat(r.ht)),ht!==0&&a._rows.values.value(g,g,ht)),(r.hidden==="1"||ht===0)&&a.hideRow(g)):this.is(wt)?r.activeCell&&(vt=e(r.activeCell),a.select(vt,!0)):this.is(pt)?r.state=="frozen"&&(r.xSplit&&a.frozenColumns(i(r.xSplit)),r.ySplit&&a.frozenRows(i(r.ySplit))):this.is(ii)?a.showGridLines(t(r.showGridLines,!0)):this.is(ri)?(kt=r["r:id"],at=oi.byId[kt],at&&a.range(r.ref).link(at)):this.is(["autoFilter"])?rt=r.ref:rt&&(this.is(["filterColumn"])?ut=parseInt(r.colId,10):this.is(["customFilters"])?(bt=t(r.and)?"and":"or",et=[]):this.is(["customFilter"])?(u=li(r.operator,r.val),u&&et.push({operator:u.operator,value:u.value})):this.is(["dynamicFilter"])?ft.push({column:ut,filter:new kendo.spreadsheet.DynamicFilter({type:ai(r.type)})}):this.is(["top10"])?ft.push({column:ut,filter:new kendo.spreadsheet.TopFilter({value:s(r.val),type:function(n,t){return n&&t?"topPercent":t?"topNumber":n?"bottomPercent":"bottomNumber"}(t(r.percent),t(r.top))})}):this.is(["filters"])?(dt=t(r.blank),ot=[]):this.is(["filter"])&&ot.push(s(r.val)))},leave:function(n,r){var f,u;this.is(c)?tt!=null?(f=h(a,it||d,function(){a.range(it||d).formula(tt)},"parsing formula"),f&&a.range(it||d).value(tt).background("#ffaaaa")):b!=null&&(u=a.range(d),u._get("formula")||(nt&&nt!="n"?nt=="s"?b=p[i(b)]:nt=="b"?b=b==="1":nt=="d"&&(b=kendo.parseDate(b)):b=parseFloat(b),b!=null&&u.value(b))):this.is(ui)?function(){var u=kendo.spreadsheet.calc.parseSqref(r.sqref),n=r.type.toLowerCase(),i=r.operator;/^(?:whole|decimal)$/.test(n)?n="number":n=="list"&&(i="list");!i&&/^(?:number|date)$/.test(n)&&(i="between");u.forEach(function(u){h(a,u,function(){a.range(u).validation({type:t(r.showErrorMessage,!0)?"reject":"warning",from:ct,to:at,dataType:n,comparerType:ht[i]||i,allowNulls:t(r.allowBlank),showButton:t(r.showDropDown)||n=="date"||n=="list",messageTemplate:r.error,titleTemplate:r.errorTitle})},"parsing validation")})}():n=="cols"?a._columns._refresh():n=="sheetData"?a._rows._refresh():n=="autoFilter"?(a.range(rt).filter(ft),rt=null):rt&&(n=="customFilters"?ft.push({column:ut,filter:new kendo.spreadsheet.CustomFilter({logic:bt,criteria:et})}):n=="filters"&&ft.push({column:ut,filter:new kendo.spreadsheet.ValueFilter({values:ot,blanks:dt})}))},text:function(n){var t;this.is(ni)||this.is(kt)?b=n:(t=this.is(vt))?(tt=n,t.t=="shared"&&(it=t.ref)):this.is(fi)?ct=n:this.is(ei)&&(at=n)}})}function li(n,t){var i={equal:"eq",notEqual:"ne",greaterThan:"gt",greaterThanOrEqual:"gte",lessThan:"lt",lessThanOrEqual:"lte"}[n];return(t=s(t),i&&typeof t=="number")?{operator:i,value:t}:(n=="notEqual"||!n)&&typeof t=="string"?{operator:n?"doesnotmatch":"matches",value:t}:void 0}function ai(n){return{Q1:"quarter1",Q2:"quarter2",Q3:"quarter3",Q4:"quarter4",M1:"january",M2:"february",M3:"march",M4:"april",M5:"may",M6:"june",M7:"july",M8:"august",M9:"september",M10:"october",M11:"november",M12:"december"}[n.toUpperCase()]||n}function s(n){var t=parseFloat(n);return!isNaN(t)&&t==n?t:n}function h(n,t,i,r){try{return i(),!1}catch(f){var u={context:r,error:String(f)};return n&&(u.sheet=n.name()),t&&(u.location=String(t)),o.push(u),!0}}function k(n,t,i,r){function h(n){var t=typeof n=="string"?n:n.formatCode;t==null||/^general$/i.test(t)||(t=t.replace(/^\[\$-[0-9]+\]/,""),f.format(t))}function c(n){n.type=="solid"&&f.background(n.color)}function l(n){f.fontFamily(n.name);f._property("fontSize",n.size);n.bold&&f.bold(!0);n.italic&&f.italic(!0)}function a(n){function t(t,i){var u=n[t],e,r;u&&(e=w[u.style],e!==0)&&(r=u.color,r==null&&(r="#000"),f._property(i,{size:e,color:r}))}t("left","borderLeft");t("top","borderTop");t("right","borderRight");t("bottom","borderBottom")}function e(n,t){var i=o[n];if(i!=null&&!i)return!1;if(u=o[t],s&&u==null){if(i=s[n],i!=null&&!i)return!1;u=s[t]}return u!=null}var f=n.range(t),o=i.inlineStyles[r],s,u;o.xfId&&(s=i.namedStyles[o.xfId]);e("applyBorder","borderId")&&a(i.borders[u]);e("applyFont","fontId")&&l(i.fonts[u]);e("applyAlignment","textAlign")&&f.textAlign(u);e("applyAlignment","verticalAlign")&&f.verticalAlign(u);e("applyAlignment","wrapText")&&f._property("wrap",u);e("applyFill","fillId")&&c(i.fills[u]);e("applyNumberFormat","numFmtId")&&h(i.numFmts[u]||b[u])}function r(n,t,i){var r=n.files[t];r&&st(r.asUint8Array(),i)}function d(n){var i=[],t=null;return r(n,"xl/sharedStrings.xml",{leave:function(){this.is(gt)&&(i.push(t),t=null)},text:function(n){this.is(dt)&&(t==null&&(t=""),t+=n)}}),i}function g(n,t){var i={byId:{},byType:{theme:[]}};return r(n,u(t)+".rels",{enter:function(n,t){if(n=="Relationship"){i.byId[t.Id]=t.Target;var r=t.Type.match(/\w+$/)[0],u=i.byType[r]||[];u.push(t.Target);i.byType[r]=u}}}),i}function ut(u,f){function a(n){function r(i){n[i]!=null&&(u[i]=t(n[i]))}var u={borderId:i(n.borderId),fillId:i(n.fillId),fontId:i(n.fontId),numFmtId:i(n.numFmtId),pivotButton:t(n.pivotButton),quotePrefix:t(n.quotePrefix),xfId:i(n.xfId)};return r("applyAlignment"),r("applyBorder"),r("applyFill"),r("applyFont"),r("applyNumberFormat"),r("applyProtection"),u}function l(t){var e,r,u;return t.rgb?n(t.rgb):t.indexed?rt[i(t.indexed)]:t.theme?(e=f.colorScheme[i(t.theme)],!e)?rt[0]:(r=kendo.parseColor(e),t.tint&&(r=r.toHSL(),u=parseFloat(t.tint),r.l=u<0?r.l*(1+u):r.l*(1-u)+(100-100*(1-u))),r.toCssRgba()):void 0}var s={fonts:[],numFmts:{},fills:[],borders:[],namedStyles:[],inlineStyles:[]},h=null,o=null,c=null,e=null;return r(u,"xl/styles.xml",{enter:function(n,i,r){if(this.is(pi))s.numFmts[i.numFmtId]=i;else if(this.is(it))s.fonts.push(h={});else if(h)n=="sz"?h.size=parseFloat(i.val):n=="name"?h.name=i.val:n=="b"?h.bold=t(i.val,!0):n=="i"&&(h.italic=t(i.val,!0));else if(this.is(tt))s.fills.push(o={});else if(o)n=="patternFill"?o.type=i.patternType:n=="fgColor"&&o.type==="solid"?o.color=l(i):n=="bgColor"&&o.type!=="solid"&&(o.color=l(i));else if(this.is(nt))s.borders.push(c={});else if(c){if(/^(?:left|top|right|bottom)$/.test(n)&&i.style&&(c[n]={style:i.style}),n=="color"){var u=this.stack[this.stack.length-2].$tag;c[u].color=l(i)}}else this.is(yi)?(e=a(i),s.namedStyles.push(e),r&&(e=null)):this.is(vi)?(e=a(i),s.inlineStyles.push(e),r&&(e=null)):e&&n=="alignment"&&(/^(?:left|center|right|justify)$/.test(i.horizontal)&&(e.textAlign=i.horizontal),/^(?:top|center|bottom)$/.test(i.vertical)&&(e.verticalAlign=i.vertical),i.wrapText!=null&&(e.wrapText=t(i.wrapText)))},leave:function(n){this.is(it)?h=null:this.is(tt)?o=null:this.is(nt)?c=null:n=="xf"&&(e=null)}}),s}function ot(t,i){function o(n,t,i){var r=n[t];n[t]=n[i];n[i]=r}var f=[],s={colorScheme:f},e=u(i);return t.files[e]&&(r(t,e,{enter:function(t,i){this.is(et)?f.push(n(i.val=="window"?"FFFFFFFF":"FF000000")):this.is(ft)&&f.push(n("FF"+i.val))}}),f.length>3&&(o(f,0,1),o(f,2,3))),s}function i(n){return n==null?null:parseInt(n,10)}function t(n,t){return n==null?t:n=="true"||n===!0||n==1}function n(n){var t=/^([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(n);return"rgba("+parseInt(t[2],16)+", "+parseInt(t[3],16)+", "+parseInt(t[4],16)+", "+parseInt(t[1],16)/255+")"}var w,b,ft,et;if(!kendo.support.browser.msie||!(kendo.support.browser.version<9)){var f=kendo.jQuery,st=kendo.util.parseXML,e=kendo.spreadsheet.calc.parseReference,ht={greaterThanOrEqual:"greaterThanOrEqualTo",lessThanOrEqual:"lessThanOrEqualTo"},o=null;var c=["sheetData","row","c"],lt=["cols","col"],at=["definedNames","definedName"],vt=["sheetData","row","c","f"],yt=["mergeCells","mergeCell"],pt=["sheetViews","sheetView","pane"],l=["sheetData","row"],wt=["sheetViews","sheetView","selection"],bt=["sheets","sheet"],kt=["sheetData","row","c","is"],dt=["t"],gt=["si"],ni=["sheetData","row","c","v"],ti=["bookViews","workbookView"],ii=["sheetViews","sheetView"],ri=["hyperlinks","hyperlink"],ui=["dataValidations","dataValidation"],fi=["dataValidations","dataValidation","formula1"],ei=["dataValidations","dataValidation","formula2"];w={none:0,thin:1,medium:2,dashed:1,dotted:1,thick:3,double:3,hair:1,mediumDashed:2,dashDot:1,mediumDashDot:2,dashDotDot:1,mediumDashDotDot:2,slantDashDot:1};b={0:"General",1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",9:"0%",10:"0.00%",11:"0.00E+00",12:"# ?/?",13:"# ??/??",14:"mm-dd-yy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"m/d/yy h:mm",37:"#,##0 ;(#,##0)",38:"#,##0 ;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mmss.0",48:"##0.0E+0",49:"@"};var nt=["borders","border"],tt=["fills","fill"],it=["fonts","font"],vi=["cellXfs","xf"],yi=["cellStyleXfs","xf"],pi=["numFmts","numFmt"],rt=[n("FF000000"),n("FFFFFFFF"),n("FFFF0000"),n("FF00FF00"),n("FF0000FF"),n("FFFFFF00"),n("FFFF00FF"),n("FF00FFFF"),n("FF000000"),n("FFFFFFFF"),n("FFFF0000"),n("FF00FF00"),n("FF0000FF"),n("FFFFFF00"),n("FFFF00FF"),n("FF00FFFF"),n("FF800000"),n("FF008000"),n("FF000080"),n("FF808000"),n("FF800080"),n("FF008080"),n("FFC0C0C0"),n("FF808080"),n("FF9999FF"),n("FF993366"),n("FFFFFFCC"),n("FFCCFFFF"),n("FF660066"),n("FFFF8080"),n("FF0066CC"),n("FFCCCCFF"),n("FF000080"),n("FFFF00FF"),n("FFFFFF00"),n("FF00FFFF"),n("FF800080"),n("FF800000"),n("FF008080"),n("FF0000FF"),n("FF00CCFF"),n("FFCCFFFF"),n("FFCCFFCC"),n("FFFFFF99"),n("FF99CCFF"),n("FFFF99CC"),n("FFCC99FF"),n("FFFFCC99"),n("FF3366FF"),n("FF33CCCC"),n("FF99CC00"),n("FFFFCC00"),n("FFFF9900"),n("FFFF6600"),n("FF666699"),n("FF969696"),n("FF003366"),n("FF339966"),n("FF003300"),n("FF333300"),n("FF993300"),n("FF993366"),n("FF333399"),n("FF333333"),n("FF000000"),n("FFFFFFFF")];ft=["a:clrScheme","*","a:srgbClr"];et=["a:clrScheme","*","a:sysClr"];kendo.spreadsheet.readExcel=ct;kendo.spreadsheet._readSheet=p;kendo.spreadsheet._readStrings=d;kendo.spreadsheet._readStyles=ut;kendo.spreadsheet._readTheme=ot;kendo.spreadsheet._readWorkbook=a}},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("spreadsheet/workbook",["kendo.core","spreadsheet/runtime","spreadsheet/references","spreadsheet/excel-reader"],n)}(function(){(function(n){function e(n,t){function i(n,t,i){return n!==undefined?n:t!==undefined?t:i}var e=i(n.rowCount,t.rows,200),o=i(n.columnCount,t.columns,50),l=i(n.rowHeight,t.rowHeight,20),a=i(n.columnWidth,t.columnWidth,64),v=i(n.headerHeight,t.headerHeight,20),y=i(n.headerWidth,t.headerWidth,32),r,u,s,f,c,h;if(n.rows!==undefined)for(r=0;r<n.rows.length;++r)if(u=n.rows[r],s=i(u.index,r),s>=e&&(e=s+1),u.cells)for(f=0;f<u.cells.length;++f)c=u.cells[f],h=i(c.index,f),h>=o&&(o=h+1);return{rowCount:e,columnCount:o,rowHeight:l,columnWidth:a,headerHeight:v,headerWidth:y}}if(!n.support.browser.msie||!(n.support.browser.version<9)){var t=n.jQuery,u=n.spreadsheet.calc.runtime.Formula,i=n.spreadsheet.Ref,f=n.spreadsheet.CalcError,r=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._names=Object.create(null);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:["cut","copy","paste","change","excelImport","excelExport","insertSheet","removeSheet","selectSheet","renameSheet","insertRow","insertColumn","deleteRow","deleteColumn","hideRow","hideColumn","unhideRow","unhideColumn","select","changeFormat"],_sheetChange:function(n){this.trigger("change",n)},_sheetInsertRow:function(n){this.trigger("insertRow",{sheet:n.sender,index:n.index})&&n.preventDefault()},_sheetInsertColumn:function(n){this.trigger("insertColumn",{sheet:n.sender,index:n.index})&&n.preventDefault()},_sheetDeleteRow:function(n){this.trigger("deleteRow",{sheet:n.sender,index:n.index})&&n.preventDefault()},_sheetDeleteColumn:function(n){this.trigger("deleteColumn",{sheet:n.sender,index:n.index})&&n.preventDefault()},_sheetHideRow:function(n){this.trigger("hideRow",{sheet:n.sender,index:n.index})&&n.preventDefault()},_sheetHideColumn:function(n){this.trigger("hideColumn",{sheet:n.sender,index:n.index})&&n.preventDefault()},_sheetUnhideRow:function(n){this.trigger("unhideRow",{sheet:n.sender,index:n.index})&&n.preventDefault()},_sheetUnhideColumn:function(n){this.trigger("unhideColumn",{sheet:n.sender,index:n.index})&&n.preventDefault()},_sheetSelect:function(n){this.trigger("select",n)},_sheetCommandRequest:function(n){this.trigger("commandRequest",n)},_inputForRef:function(t){return new n.spreadsheet.Range(t,this._sheet).input()},_onUndoRedo:function(n){n.command.range().select()},execute:function(i){var u=t.extend({workbook:this},i.options),r=new n.spreadsheet[i.command](u),e=this.activeSheet(),f;return u.origin&&r.origin(u.origin),u.operatingRange?r.range(u.operatingRange):u.editActiveCell?r.range(e.activeCellSelection()):r.range(e.selection()),f=r.exec(),f&&f.reason==="error"||(r.cannotUndo?this.undoRedoStack.clear():this.undoRedoStack.push(r)),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,t.defaultCellStyle||this.options.defaultCellStyle),i._workbook=this,i._name(u),this._bindSheetEvents(i),o.splice(e,0,i),t.data&&i.fromJSON(t.data),t.dataSource&&i.setDataSource(t.dataSource),this.trigger("change",{sheetSelection:!0}),i},_bindSheetEvents:function(n){n.bind("change",this._sheetChange.bind(this));n.bind("insertRow",this._sheetInsertRow.bind(this));n.bind("insertColumn",this._sheetInsertColumn.bind(this));n.bind("deleteRow",this._sheetDeleteRow.bind(this));n.bind("deleteColumn",this._sheetDeleteColumn.bind(this));n.bind("hideRow",this._sheetHideRow.bind(this));n.bind("hideColumn",this._sheetHideColumn.bind(this));n.bind("unhideRow",this._sheetUnhideRow.bind(this));n.bind("unhideColumn",this._sheetUnhideColumn.bind(this));n.bind("select",this._sheetSelect.bind(this));n.bind("commandRequest",this._sheetCommandRequest.bind(this))},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 r=n.name().toLowerCase();if(t&&r!==t.toLowerCase()&&!this.sheetByName(t))return(n=this.sheetByName(r),!n)?void 0:(this._sheetsSearchCache={},this.trigger("renameSheet",{sheet:n,newSheetName:t}))?void 0:(this._sheets.forEach(function(n){n._forFormulas(function(n){n.renameSheet(r,t)})}),this.forEachName(function(n,f){n.nameref.renameSheet(r,t)&&(this.undefineName(f),n.name=n.nameref.print(),this.nameDefinition(n.name,n));(n.value instanceof i||n.value instanceof u)&&n.value.renameSheet(r,t)}.bind(this)),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.trigger("removeSheet",{sheet:n})||(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}))))},_clearSheets:function(){for(var n=0;n<this._sheets.length;n++)this._sheets[n].unbind();this._sheets=[];this._sheetsSearchCache={};this._names={}},fromJSON:function(n){var i;if(n.sheets)for(this._clearSheets(),i=0;i<n.sheets.length;i++){var r=n.sheets[i],t=e(r,this.options),u=this.insertSheet({rows:t.rowCount,columns:t.columnCount,rowHeight:t.rowHeight,columnWidth:t.columnWidth,headerHeight:t.headerHeight,headerWidth:t.headerWidth,data:r});r.dataSource&&u.setDataSource(r.dataSource)}n.activeSheet?this.activeSheet(this.sheetByName(n.activeSheet)):this.activeSheet(this._sheets[0]);n.names&&n.names.forEach(function(n){this.defineName(n.name,n.value,n.hidden)},this)},toJSON:function(){this.resetFormulas();this.resetValidations();var n=Object.keys(this._names).map(function(n){var r=this._names[n],t=r.value;return t=t instanceof i||t instanceof u?t.print(0,0,!0):t instanceof f?t+"":JSON.stringify(t),{value:t,hidden:r.hidden,name:r.name,sheet:r.nameref.sheet,localName:r.nameref.name}},this);return{activeSheet:this.activeSheet().name(),sheets:this._sheets.map(function(n){return n.recalc(this._context),n.revalidate(this._validationContext),n.toJSON()},this),names:n,columnWidth:this.options.columnWidth,rowHeight:this.options.rowHeight}},fromFile:function(i){var r=new t.Deferred,u=r.promise(),f={file:i,promise:u};return i&&!this.trigger("excelImport",f)?(this._clearSheets(),n.spreadsheet.readExcel(i,this,r)):r.reject(),u},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}))},draw:function(t,i){typeof t!="function"||i||(i=t,t={});var r=[],u=this._sheets;(function f(e){if(e<u.length)u[e].draw(n.spreadsheet.SHEETREF,t,function(n){r.push(n);f(e+1)});else{var o=r[0];for(e=1;e<r.length;++e)o.children=o.children.concat(r[e].children);i(o)}})(0)},nameForRef:function(n,t){var u,e,f,r;t===undefined&&(t=n.sheet);t=t.toLowerCase();u=n+"";for(e in this._names)if(f=this._names[e],r=f.value,r instanceof i&&(!r.sheet||r.sheet&&t==r.sheet.toLowerCase())&&r+""==u)return f;return{name:u}},defineName:function(t,i,r){var u=n.spreadsheet.calc.parseNameDefinition(t,i);t=u.name.print();this._names[t.toLowerCase()]={value:u.value,hidden:r,name:t,nameref:u.name}},undefineName:function(n){delete this._names[n.toLowerCase()]},nameValue:function(n){return(n=n.toLowerCase(),n in this._names)?this._names[n].value:null},nameDefinition:function(n,t){return n=n.toLowerCase(),arguments.length>1&&(t===undefined?delete this._names[n]:this._names[n]=t),this._names[n]},forEachName:function(n){Object.keys(this._names).forEach(function(t){n(this._names[t],t)},this)},adjustNames:function(n,t,r,f){n=n.toLowerCase();Object.keys(this._names).forEach(function(e){var s=this._names[e],o=s.value;o instanceof i&&o.sheet.toLowerCase()==n?s.value=o.adjust(null,null,null,null,t,r,f):o instanceof u&&o.adjust(n,t?"row":"col",r,f)},this)},options:{}});n.spreadsheet.Workbook=r;n.PDFMixin&&(n.PDFMixin.extend(r.prototype),r.prototype.saveAsPDF=function(i){var r=new t.Deferred,u=r.promise(),f={promise:u};if(!this.trigger("pdfExport",f))return this._drawPDF(i,r).then(function(t){return n.drawing.exportPDF(t)}).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},r.prototype._drawPDF=function(n){var r=new t.Deferred,i=function(n){r.resolve(n)};switch(n.area){case"workbook":n.workbook.draw(n,i);break;case"sheet":n.workbook.activeSheet().draw(n,i);break;case"selection":n.workbook.activeSheet().selection().draw(n,i)}return r.promise()})}})(kendo)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("spreadsheet/formulacontext",["kendo.core"],n)}(function(){if(!kendo.support.browser.msie||!(kendo.support.browser.version<9)){var n=kendo.spreadsheet,t=n.CellRef,f=n.RangeRef,e=n.UnionRef,r=n.NameRef,i=n.Ref,u=kendo.Class.extend({init:function(n){this.workbook=n},getRefCells:function(n,u,o,s,h){var c,v,y,l,d,a,it,p,w,tt,k,b;if(n instanceof t)return(c=this.workbook.sheetByName(n.sheet),!c||!n.valid())?[{value:new kendo.spreadsheet.calc.runtime.CalcError("REF")}]:(v=c.formula(n),y=c.range(n.row,n.col).value(),v!=null||y!=null?[{formula:v,value:y,row:n.row,col:n.col,sheet:n.sheet,hidden:u?c.columnWidth(n.col)===0||c.rowHeight(n.row)===0:!1}]:[]);if(n instanceof f){if(l=this.workbook.sheetIndex(n.sheet),d=[],a=l,n.endSheet&&(a=this.workbook.sheetIndex(n.endSheet),l>a&&(it=l,l=a,a=it)),l<0||a<0||!n.valid())return[{value:new kendo.spreadsheet.calc.runtime.CalcError("REF")}];while(l<=a){c=this.workbook.sheetByIndex(l++);var g=c._grid.normalize(n.topLeft),nt=c._grid.normalize(n.bottomRight),rt=c._grid.cellRefIndex(g),ut=c._grid.cellRefIndex(nt),ft=c._properties.iterator("value",rt,ut);for(p=g.col;p<=nt.col;++p)for(w=g.row;w<=nt.row;++w)tt=c._grid.index(w,p),v=c._properties.get("formula",tt),y=ft.at(tt),(v!=null||y!=null)&&d.push({formula:v,value:y,row:w,col:p,sheet:c.name(),hidden:u?c.columnWidth(p)===0||c.rowHeight(w)===0:!1})}return d}if(n instanceof e){for(k=[],l=0;l<n.refs.length;++l)k=k.concat(this.getRefCells(n.refs[l],u,o,s,h));return k}return n instanceof r?(b=this.nameValue(n,o,s,h),b instanceof i)?this.getRefCells(b,u,o,s,h):[{value:b==null?new kendo.spreadsheet.calc.runtime.CalcError("NAME"):b}]:[]},nameValue:function(n,t,r,u){var f;return n.hasSheet()?f=this.workbook.nameValue(n.print()):(n=n.clone().setSheet(t,!0),f=this.workbook.nameValue(n.print()),f==null&&(f=this.workbook.nameValue(n.name))),f instanceof i&&(f=f.absolute(r,u)),f},getData:function(n,i,u,f){var o=n instanceof t,e;return n instanceof r&&(o=this.workbook.nameValue(n.name)instanceof t),e=this.getRefCells(n,!1,i,u,f).map(function(n){var t=n.value;return t instanceof kendo.spreadsheet.calc.runtime.Formula&&(t=t.value),t}),o?e[0]:e},onFormula:function(n){var r=this.workbook.sheetByName(n.sheet),u=n.row,f=n.col,t=n.value,e=r.formula({row:u,col:f});return e!==n?!1:(t instanceof i&&(t=this.getData(t,n.sheet,u,f),Array.isArray(t)&&(t=t[0]),t===undefined&&(t=null)),t instanceof kendo.spreadsheet.calc.runtime.Matrix?t.each(function(n,t,i){r._value(u+t,f+i,n)}):r._value(u,f,t),clearTimeout(r._formulaContextRefresh),r._formulaContextRefresh=setTimeout(function(){r.batch(function(){},{layout:!0})},50),!0)}}),o=u.extend({onFormula:function(){return!0}});n.FormulaContext=u;n.ValidationFormulaContext=o}},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("spreadsheet/controller",["kendo.core"],n)}(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","alt+ctrl+:alphanum":"edit",":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","alt+enter":"insertNewline","shift+enter":"onEditorBlur",tab:"onEditorBlur","shift+tab":"onEditorBlur"},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;i.nameEditor.bind("enter",this.onNameEditorEnter.bind(this));i.nameEditor.bind("cancel",this.onNameEditorCancel.bind(this));i.nameEditor.bind("select",this.onNameEditorSelect.bind(this));i.nameEditor.bind("delete",this.onNameEditorDelete.bind(this));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._enableEditorEvents();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)))},_enableEditorEvents:function(t){t===undefined||t?(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.keyListener.destroy(),this.barKeyListener.destroy(),this.inputKeyListener.destroy())},_execute:function(n){var t=this._workbook.execute(n);return n.command!=="EditCommand"||t||this._workbook.trigger("change",{editorClose:!0}),t&&(this._preventNavigation=!0,t.reason==="error"?this.view.showError(t,function(){this.activateEditor();this.editor.value(this._lastEditorValue);this.editor._value=this._workbook._inputForRef(this._workbook.activeSheet()._viewActiveCell());this.editor.select()}.bind(this)):this.view.openDialog(t.reason)),t},_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._enableEditorEvents(!1);this.keyListener.destroy();this.inputKeyListener.destroy()},onSheetBarSelect:function(n){var t,i=this._workbook;if(n.isAddButton){if(this._workbook.trigger("insertSheet"))return;t=i.insertSheet()}else t=i.sheetByName(n.name);if(i.activeSheet().name()!==t.name()){if(this._workbook.trigger("selectSheet",{sheet:t}))return;i.activeSheet(t)}},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);if(this._workbook.sheetByName(n.name)){this.view.showError({reason:"error",type:"duplicateSheetName"});return}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();n.bind("commandRequest",this.onCommandRequest.bind(this))},refresh:function(){var t=this.editor,i=this._workbook,n=i.activeSheet(),r,u;this._viewPortHeight=this.view.scroller.clientHeight;this.navigator.height(this._viewPortHeight);t.isActive()||this.isEditorDisabled||(t.enable(n.selection().enable()!==!1),t.value(i._inputForRef(n.activeCell())));r=n.selection()._ref.simplify();u=this._workbook.nameForRef(r,n.name());this.view.nameEditor.value(u.name)},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){var i,u,r;if(n.mod){i=!0;u=String.fromCharCode(n.keyCode);switch(u){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 if(r=this._workbook.activeSheet().selection().enable()===!1,t=="delete"||t=="backspace")r||this._execute({command:"ClearContentCommand"}),n.preventDefault();else if(y.test(t)||t===":edit"){if(r){n.preventDefault();return}t!==":edit"&&this.editor.value("");this.activateEditor()}else 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),t.type==="editor"){this.onEditorEsc();this.openCustomEditor();n.preventDefault();return}if(this.editor.canInsertRef(!1)&&t.ref){this._workbook.activeSheet()._setFormulaSelections(this.editor.highlightedRefs());this.navigator.startSelection(t.ref,this._selectionMode,this.appendSelection,n.shiftKey);n.preventDefault();return}if(this._preventNavigation=!1,this.editor.deactivate(),!this._preventNavigation){if(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);n.preventDefault();return}this._selectionMode=c[t.type];this.appendSelection=n.mod;this.navigator.startSelection(t.ref,this._selectionMode,this.appendSelection,n.shiftKey)}},onContextMenu:function(t){var o=this._workbook.activeSheet(),i,r;if(!o.resizingInProgress()&&(t.preventDefault(),this.cellContextMenu.close(),this.colHeaderContextMenu.close(),this.rowHeaderContextMenu.close(),r=this.objectAt(t),r.type!=="columnresizehandle"&&r.type!=="rowresizehandle")){this.navigator.selectForContextMenu(r.ref,c[r.type]);var u=this.navigator._sheet.select()instanceof n.spreadsheet.UnionRef,f=!1,e=!1;r.type=="columnheader"?(i=this.colHeaderContextMenu,f=!u&&this.axisManager.selectionIncludesHiddenColumns()):r.type=="rowheader"?(i=this.rowHeaderContextMenu,f=!u&&this.axisManager.selectionIncludesHiddenRows()):(i=this.cellContextMenu,e=this.navigator.selectionIncludesMergedCells());i.element.find(b).toggle(!u);i.element.find(k).toggle(f);i.element.find("[data-action=unmerge]").toggle(e);setTimeout(function(){i.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={clientX:n.clientX,clientY:n.clientY},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),r._setFormulaSelections(t.highlightedRefs()))}},onDblClick:function(n){var t=this.objectAt(n),i=this._workbook.activeSheet().selection().enable()===!1;t.type!=="cell"||i||(this.editor.activate({range:this._workbook.activeSheet().selection(),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,event:n.originalEvent||n}})},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(){var n=this.clipboardElement.html(),i=window.clipboardData.getData("Text").trim();(n||i)&&(this.clipboard.external({html:n,plain:i}),this.clipboardElement.empty().append(e),this._execute({command:"PasteCommand",options:{workbook:this.view._workbook,event:t.originalEvent||t}}),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}(u||f)&&(this.clipboard.external({html:u,plain:f}),this._execute({command:"PasteCommand",options:{workbook:this.view._workbook,event:t.originalEvent||t}}))},onCopy:function(n){this.clipboard.menuInvoked=n===undefined;this._execute({command:"CopyCommand",options:{workbook:this.view._workbook,event:n.originalEvent||n}})},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){if(n){var t=this.container[0].getBoundingClientRect();return this.view.objectAt(n.clientX-t.left,n.clientY-t.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},openCustomEditor:function(){this.view.openCustomEditor()},openFilterMenu:function(n){var i=this.objectAt(n),r=this._workbook.activeSheet(),u=r.filterColumn(i.ref),t=this.view.createFilterMenu(u);t.bind("action",this.onCommandRequest.bind(this));t.bind("action",t.close.bind(t));t.openFor(n.target)},onEditorChange:function(n){var t=n.range._sheet;this._workbook.activeSheet()!==t&&(this._workbook.activeSheet()._setFormulaSelections(),this._workbook.activeSheet(t));t.isInEditMode(!1);this._lastEditorValue=n.value;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(){var n=this._workbook.activeSheet().selection().enable()===!1;n||this.editor.activate({range:this._workbook.activeSheet().selection(),rect:this.view.activeCellRectangle(),tooltip:this._activeTooltip()})},onEditorCellFocus:function(){this.editor.scale()},onEditorEsc:function(){this.resetEditorValue();this.editor.deactivate();this.clipboardElement.focus()},insertNewline:function(n){n.preventDefault();this.editor.insertNewline()},onEditorBlur:function(n,t){this.editor.isFiltered()||(this._preventNavigation=!1,this.editor.deactivate(),this._preventNavigation||(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),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),u._setFormulaSelections(r.highlightedRefs()),n.preventDefault())},resetEditorValue:function(){this.editor.value(this._workbook._inputForRef(this._workbook.activeSheet()._viewActiveCell()))},activateEditor:function(){this.editor.activate({range:this._workbook.activeSheet().selection(),rect:this.view.activeCellRectangle(),tooltip:this._activeTooltip()}).focus()},deactivateEditor:function(){this.view.editor.deactivate()},onCommandRequest:function(n){n.command?this._execute(n):this._workbook.undoRedoStack[n.action]()},onDialogRequest:function(n){var i={pdfExport:this._workbook.options.pdf,excelExport:this._workbook.options.excel};n.options?t.extend(!0,n.options,i):n.options=i;this.view.openDialog(n.name,n.options)},onNameEditorEnter:function(){var t,r=this._workbook,i=r.activeSheet(),f=this.view.nameEditor.value(),u;if(t=n.spreadsheet.calc.parseReference(f,!0)||r.nameValue(f),t instanceof n.spreadsheet.Ref){t.sheet&&t.sheet.toLowerCase()!=i.name().toLowerCase()&&(u=r.sheetByName(t.sheet),u&&(r.activeSheet(u),i=u));i.range(t).select();return}t=i.selection()._ref.clone().simplify().setSheet(i.name(),!0);this._execute({command:"DefineNameCommand",options:{name:f,value:t}});this.clipboardElement.focus()},onNameEditorCancel:function(){this.clipboardElement.focus()},onNameEditorSelect:function(t){var e=t.name,r=this._workbook,f=r.activeSheet(),i=r.nameValue(e),u;if(i instanceof n.spreadsheet.Ref){i.sheet&&i.sheet.toLowerCase()!=f.name().toLowerCase()&&(u=r.sheetByName(i.sheet),u&&(r.activeSheet(u),f=u));f.range(i).select();return}this.clipboardElement.focus()},onNameEditorDelete:function(n){this._execute({command:"DeleteNameCommand",options:{name:n.name}});this.clipboardElement.focus()}});n.spreadsheet.Controller=v}})(window.kendo)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("spreadsheet/view",["kendo.core","kendo.menu","spreadsheet/sheetsbar"],n)}(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 h(n){return(n.size||1)+"px solid "+(n.color||"#000")}function w(n){return/:\/\//.test(n)||(n="http://"+n),n}function c(t,i,r,u){function k(t){var r=i.link,u;return(r||typeof i.value=="object"&&(r=i.value.link),r)?(u={textDecoration:"none"},i.color&&(u.color=i.color),i.underline&&(u.textDecoration="underline"),n.dom.element("a",{href:w(r),style:u,target:"_blank"},t?[t]:[])):t}var g=i.value!=null||i.validation!=null&&!i.validation.value||i.background||i.merged,f,l,o,e,a,c,v,b;if(r||g){if(f={},l=i.background,l&&(o=l,u&&(o=n.parseColor(o).toHSV(),o.v*=.9,o=o.toCssRgba()),o=h({color:o}),f.outline=o),l&&(f.backgroundColor=l),i.color&&(f.color=i.color),i.fontFamily&&(f.fontFamily=i.fontFamily),i.underline&&(f.textDecoration="underline"),i.italic&&(f.fontStyle="italic"),i.textAlign&&(f.textAlign=i.textAlign),i.bold&&(f.fontWeight="bold"),i.fontSize&&(f.fontSize=i.fontSize+"px"),i.wrap===!0&&(f.whiteSpace="pre-wrap",f.overflowWrap="break-word",f.wordWrap="break-word"),f.left=i.left+1+"px",f.top=i.top+1+"px",f.width=i.width-1+"px",f.height=i.height-1+"px",e=i.value,a=typeof e,i.format&&e!=null?(e=n.spreadsheet.formatting.format(e,i.format),e.__dataType&&(a=e.__dataType)):e!==null&&e!==undefined&&(e=n.dom.text(e)),!f.textAlign)switch(a){case"number":case"date":case"percent":case"currency":f.textAlign="right";break;case"boolean":f.textAlign="center"}c=[s.cell];r&&c.push(r);i.enable===!1&&c.push("k-state-disabled");i.merged&&c.push("k-spreadsheet-merged-cell");v=i.verticalAlign||"bottom";e=v&&e?n.dom.element("div",{className:"k-vertical-align-"+v},[k(e)]):k(e);var d=e?[e]:[],y={style:f},p=i.validation;return p&&!p.value&&(d.push(n.dom.element("span",{className:"k-dirty"})),c.push("k-dirty-cell"),y.title=p.message),y.className=c.join(" "),b=n.dom.element("div",y,d),t.push(b),b}}function b(t,i,r){var u={},f,s,c,l,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==="center"?"middle":r.verticalAlign),r.bold&&(u.fontWeight="bold"),r.fontSize&&(u.fontSize=r.fontSize+"px"),r.wrap===!0&&(u.whiteSpace="pre-wrap",u.wordBreak="break-all"),r.borderRight?u.borderRight=h(r.borderRight):r.background&&(u.borderRightColor=r.background),r.borderBottom?u.borderBottom=h(r.borderBottom):r.background&&(u.borderBottomColor=r.background),f=r.value,s=typeof f,r.format&&f!=null&&(f=n.spreadsheet.formatting.format(f,r.format),f.__dataType&&(s=f.__dataType)),!u.textAlign)switch(s){case"number":case"date":case"percent":case"currency":u.textAlign="right";break;case"boolean":u.textAlign="center"}return c=null,r.enable===!1&&(c="k-state-disabled"),l=t.addCell(i,f,u,c,r.validation),r.borderLeft?(o=y(t,i),e=h(r.borderLeft),o&&e&&(o.attr.style.borderRight=e)):r.background&&(u.borderLeftColor=r.background),r.borderTop?(o=p(t,i),e=h(r.borderTop),o&&e&&(o.attr.style.borderBottom=e)):r.background&&(u.borderTopColor=r.background),l}function a(n,t,i){return n>=t&&n<=i}var l;if(!n.support.browser.msie||!(n.support.browser.version<9)){var t=n.jQuery,e=n.spreadsheet.CellRef,r=".",u=7,o={view:"k-spreadsheet-view",fixedContainer:"k-spreadsheet-fixed-container",editContainer:"k-spreadsheet-edit-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",horizontalResize:"k-horizontal-resize",verticalResize:"k-vertical-resize",icon:"k-icon",iconFilterDefault:"k-i-arrow-60-down",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"};n.spreadsheet.messages.view={nameBox:"Name Box",errors:{openUnsupported:"Unsupported format. Please select an .xlsx file.",shiftingNonblankCells:"Cannot insert cells due to data loss possibility. Select another insert location or delete the data from the end of your worksheet.",insertColumnWhenRowIsSelected:"Cannot insert column when all columns are selected.",insertRowWhenColumnIsSelected:"Cannot insert row when all rows are selected.",filterRangeContainingMerges:"Cannot create a filter within a range containing merges",sortRangeContainingMerges:"Cannot sort a range containing merges",cantSortMultipleSelection:"Cannot sort multiple selection",cantSortNullRef:"Cannot sort empty selection",cantSortMixedCells:"Cannot sort range containing cells of mixed shapes",validationError:"The value that you entered violates the validation rules set on the cell.",cannotModifyDisabled:"Cannot modify disabled cells."},tabs:{home:"Home",insert:"Insert",data:"Data"}};var k=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.message),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(i,u){var e=f.classNames,o,s;this.element=i;this.options=t.extend(!0,{messages:n.spreadsheet.messages.view},this.options,u);this._chrome();this._dialogs=[];i.append(l({classNames:e}));this._formulaInput();this.wrapper=i.find(r+e.view);this.container=i.find(r+e.fixedContainer)[0];this.scroller=i.find(r+e.scroller)[0];this.clipboard=i.find(r+e.clipboard);this.viewSize=t(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:i,animation:!1,showOn:"never"};this.cellContextMenu=new n.spreadsheet.ContextMenu(i.find(r+e.cellContextMenu),o);this.colHeaderContextMenu=new n.spreadsheet.ContextMenu(i.find(r+e.colHeaderContextMenu),o);this.rowHeaderContextMenu=new n.spreadsheet.ContextMenu(i.find(r+e.rowHeaderContextMenu),o);s=n.support.scrollbar();t(this.container).css({width:this.wrapper[0].clientWidth-s,height:this.wrapper[0].clientHeight-s})},enableClipboard:function(n){this.isClipboardDeactivated=!n;n?this.clipboard.attr("contenteditable",n):this.clipboard.removeAttr("contenteditable")},_resize:function(){var t=n._outerHeight,i=this.tabstrip?t(this.tabstrip.element):0,r=this.formulaBar?t(this.formulaBar.element):0,u=this.sheetsbar?t(this.sheetsbar.element):0;this.wrapper.height(this.element.height()-(i+r+u));this.tabstrip&&this.tabstrip.quickAccessAdjust()},_chrome:function(){var i=t("<div class='k-spreadsheet-action-bar' />").prependTo(this.element),u=t("<div class='k-spreadsheet-name-editor' />").appendTo(i),r;this.nameEditor=new n.spreadsheet.NameEditor(u,this.options);r=t("<div />").appendTo(i);this.formulaBar=new n.spreadsheet.FormulaBar(r);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(){if(this.options.sheetsbar){var i=t.extend(!0,{openDialog:this.openDialog.bind(this)},this.options.sheetsbar);this.sheetsbar=new n.spreadsheet.SheetsBar(this.element.find(r+f.classNames.sheetsBar),i)}},_tabstrip:function(){var f=this.options.messages.tabs,r=t.extend(!0,{home:!0,insert:!0,data:!0},this.options.toolbar),u=[],i;this.tabstrip&&(this.tabstrip.destroy(),this.element.children(".k-tabstrip").remove());for(i in r)(r[i]===!0||r[i]instanceof Array)&&u.push({id:i,text:f[i],content:""});this.tabstrip=new n.spreadsheet.TabStrip(t("<div />").prependTo(this.element),{animation:!1,dataTextField:"text",dataContentField:"content",dataSource:u,toolbarOptions:r,view:this});this.tabstrip.select(0)},_executeCommand:function(n){this._sheet.trigger("commandRequest",n)},workbook:function(n){this._workbook=n;this.nameEditor._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 f=i._grid,e=f.rows.frozen?0:this.scroller.scrollTop,o=f.columns.frozen?0:this.scroller.scrollLeft,u;return n-=this._sheet._grid._headerWidth-o,t-=this._sheet._grid._headerHeight-e,u=!1,this._sheet.forEachFilterHeader(r,function(r){if(!u){var f=this._rectangle(i,r);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)},isEditButton:function(n,t,i,r){var e=this._sheet.activeCellCustomEditor(),f,u;if(e&&(f=i==r-2,u=this.activeCellRectangle(),t>=u.top&&t<=u.bottom))return f?n<u.left&&n>=u.left-20:n>u.right&&n<=u.right+20},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 if(i=this.paneAt(n,t),i){var h=i._grid.rows.indexVisible(t,this.scroller.scrollTop),s=i._grid.columns.indexVisible(n,this.scroller.scrollLeft),u="cell",f=new e(h,s),c=this._sheet.selectionInProgress();this.isAutoFill(n,t,i)?u="autofill":this.isFilterIcon(n,t,i,f)?u="filtericon":!c&&n<o._headerWidth?(f=new e(h,-Infinity),u=this.isRowResizer(t,i,f)?"rowresizehandle":"rowheader"):!c&&t<o._headerHeight?(f=new e(-Infinity,s),u=this.isColumnResizer(n,i,f)?"columnresizehandle":"columnheader"):this.isEditButton(n,t,s,o.columnCount)&&(u="editor");r={type:u,ref:f}}else r={type:"outside"};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-(t.columns.frozen?0:this.scroller.scrollLeft),t.headerHeight-(t.rows.frozen?0: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(i){if(this._filterMenu&&this._filterMenu.options.column==i)return this._filterMenu;this._destroyFilterMenu();var r=this._sheet,f=r.filter().ref,e=new n.spreadsheet.Range(f,r),o=t("<div />").appendTo(this.element),s={column:i,range:e},u=new n.spreadsheet.FilterMenu(o,s);return this._filterMenu=u,u},selectClipBoardContents:function(){this.isClipboardDeactivated||(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},_destroyDialog:function(){this._dialogs.pop()},openCustomEditor:function(){var n=this,t=n._sheet.activeCell().first(),r=n._sheet.activeCellCustomEditor(),i=n._sheet.range(t);r.edit({range:i,rect:n.activeCellRectangle(),view:this,validation:this._sheet.validation(t),callback:function(t,r){n._executeCommand({command:"EditCommand",options:{operatingRange:i,property:r?"input":"value",value:t}})}})},openDialog:function(t,i){var r=n.spreadsheet.dialogs.create(t,i);if(r){r.bind("action",this._executeCommand.bind(this));r.bind("deactivate",this._destroyDialog.bind(this));this._dialogs.push(r);var u=this._sheet,f=u.activeCell(),e=new n.spreadsheet.Range(f,u);return r.open(e),r}},showError:function(i,r){var f=this.options.messages.errors,e=function(t){var i=t.sender.dialog().element;i.find(".k-button:first").focus();i.find(".k-button, input").on("keydown",function(i){i.keyCode==n.keys.ESC&&t.sender.close()})},o=function(n){var t=n.sender;this.selectClipBoardContents();t._retry&&r&&r()}.bind(this),u;n.spreadsheet.dialogs.registered(i.type)?(u={close:o},i.type==="validationError"&&(u=t.extend(u,{title:i.title||"Error",text:i.body?i.body:f[i.type],activate:e})),this.openDialog(i.type,u)):this.openDialog("message",{title:i.title||"Error",text:i.body?i.body:f[i.type],activate:e,close:o})},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,u,i,c;if(this.element.is(":visible")&&(t=this._sheet,r=t.focus(),!r||!this.scrollIntoView(r))){u=t.resizingInProgress()?t.resizeHandlePosition().col===-Infinity?"column":"row":"none";this.wrapper.toggleClass(o.editContainer,this.editor.isActive()).toggleClass(o.horizontalResize,u=="row").toggleClass(o.verticalResize,u=="column");var h=t._grid,e=this.scroller.scrollTop,s=this.scroller.scrollLeft;e<0&&(e=0);s<0&&(s=0);i=this.panes.map(function(n){return n.render(s,e)});c=n.dom.element("div",{style:{width:h._headerWidth+"px",height:h._headerHeight+"px"},className:f.classNames.topCorner});i.push(c);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,t;return e=f?{height:this.scroller.clientHeight+"px",width:u+"px",left:r.resizeHintPosition().x+"px",top:"0px"}:{height:u+"px",width:this.scroller.clientWidth+"px",top:r.resizeHintPosition().y+"px",left:"0px"},t=i.classNames,n.dom.element("div",{className:t.resizeHint+(f?"":" "+t.resizeHintVertical),style:e},[n.dom.element("div",{className:t.resizeHintHandle}),n.dom.element("div",{className:t.resizeHintMarker})])},renderClipboardContents:function(){var t=this._sheet,o=t._grid,n=t.select().toRangeRef(),u=this._workbook.clipboard().canCopy(),i,r;if(u.canCopy===!1&&u.multiSelection){this.clipboardContents.render([]);this.selectClipBoardContents();return}n=t.trim(n);i=new k;r=o.rangeDimensions(n);r.rows.forEach(function(n){i.addRow(n)});r.columns.forEach(function(n){i.addColumn(n)});var f=t._getMergedCells(n),s=f.primary,h=f.secondary;t.forEach(n,function(t,r,u){var c=new e(t,r).print(),o,f;h[c]||(o=b(i,t-n.topLeft.row,u),f=s[c],f&&(o.attr.colspan=f.width(),o.attr.rowspan=f.height()))});this.clipboardContents.render([i.toDomTree(0,0,"kendo-clipboard-"+this._workbook.clipboard()._uid)]);this.selectClipBoardContents()},_pane:function(n,t,r,u){var f=new i(this._sheet,this._sheet._grid.pane({row:n,column:t,rowCount:r,columnCount:u}));return f.refresh(this.scroller.clientWidth,this.scroller.clientHeight),f}}),s={cell:"k-spreadsheet-cell",vaxis:"k-spreadsheet-vaxis",haxis:"k-spreadsheet-haxis",vborder:"k-spreadsheet-vborder",hborder:"k-spreadsheet-hborder",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",columnResizeHandle:"k-column-resize-handle",rowResizeHandle:"k-row-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"]},i=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(t,r){var s=i.classNames,f=this._sheet,u=this._grid,o=u.view(t,r),e,c,l,a,v,h;return this._currentView=o,this._currentRect=this._rectangle(o.ref),this._selectedHeaders=f.selectedHeaders(),e=[],e.push(this.renderData()),e.push(this.renderSelection()),e.push(this.renderAutoFill()),e.push(this.renderEditorSelection()),e.push(this.renderFilterHeaders()),u.hasRowHeader&&(c=n.dom.element("div",{className:s.rowHeader,style:{width:u.headerWidth+"px",top:o.rowOffset+"px"}}),e.push(c),f.forEach(o.ref.leftColumn(),function(t){if(!f.isHiddenRow(t)){var i=t+1,r=f.rowHeight(t);c.children.push(n.dom.element("div",{className:this.headerClassName(t,"row"),style:{width:u.headerWidth+"px",height:r+"px"}},[n.dom.element("div",{className:"k-vertical-align-center"},[n.dom.text(i+"")])]))}}.bind(this))),u.hasColumnHeader&&(l=n.dom.element("div",{className:s.columnHeader,style:{top:"0px",left:o.columnOffset+"px",width:this._currentRect.width+"px",height:u.headerHeight+"px"}}),e.push(l),a=0,f.forEach(o.ref.topRow(),function(t,i){if(!f.isHiddenColumn(i)){var e=n.spreadsheet.Ref.display(null,Infinity,i),r=f.columnWidth(i);l.children.push(n.dom.element("div",{className:this.headerClassName(i,"col"),style:{position:"absolute",left:a+"px",width:r+"px",height:u.headerHeight+"px"}},[n.dom.element("div",{className:"k-vertical-align-center"},[n.dom.text(e+"")])]));a+=r}}.bind(this))),f.resizeHandlePosition()&&(u.hasColumnHeader||u.hasRowHeader)&&(v=f._grid.normalize(f.resizeHandlePosition()),o.ref.intersects(v)&&(f.resizeHintPosition()||e.push(this.renderResizeHandle()))),h=[s.pane],u.hasColumnHeader&&h.push(s.top),u.hasRowHeader&&h.push(s.left),n.dom.element("div",{style:u.style,className:h.join(" ")},e)},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 u=this._sheet,e=this._currentView,t=n.dom.element("div",{className:i.classNames.data,style:{position:"relative",left:e.columnOffset+"px",top:e.rowOffset+"px"}}),h=this._currentRect,o=n.spreadsheet.draw.doLayout(u,e.ref,{forScreen:!0}),r,l=u._showGridLines,f;return l&&(r=null,o.xCoords.forEach(function(i){i!==r&&(r=i,t.children.push(n.dom.element("div",{className:s.vaxis,style:{left:i+"px",height:h.height+"px",borderColor:u.gridLinesColor()}})))}),r=null,o.yCoords.forEach(function(i){i!==r&&(r=i,t.children.push(n.dom.element("div",{className:s.haxis,style:{top:i+"px",width:h.width+"px",borderColor:u.gridLinesColor()}})))})),f=n.spreadsheet.draw.Borders(),o.cells.forEach(function(n){f.add(n);c(t.children,n,null,l)}),f.vert.forEach(function(i){i.forEach(function(i){if(!i.rendered){i.rendered=!0;var r={left:i.x+"px",top:i.top+"px",height:i.bottom-i.top+1+"px",borderWidth:i.size+"px",borderColor:i.color};i.size!=1&&(r.transform="translateX(-"+(i.size-1)/2+"px)");t.children.push(n.dom.element("div",{className:s.vborder,style:r}))}})}),f.horiz.forEach(function(i){i.forEach(function(i){if(!i.rendered){i.rendered=!0;var r={top:i.y+"px",left:i.left+"px",width:i.right-i.left+"px",borderWidth:i.size+"px",borderColor:i.color};i.size!=1&&(r.transform="translateY(-"+(i.size-1)/2+"px)");t.children.push(n.dom.element("div",{className:s.hborder,style:r}))}})}),t},renderResizeHandle:function(){var s=this._sheet,f=s.resizeHandlePosition(),e=this._rectangle(f),t=[i.classNames.resizeHandle],r;return f.col!==-Infinity?(r={height:this._grid.headerHeight+"px",width:u+"px",left:e.right-u/2+"px",top:"0px"},t.push(o.horizontalResize)):(r={height:u+"px",width:this._grid.headerWidth+"px",top:e.bottom-u/2+"px",left:"0px"},t.push(o.verticalResize)),n.dom.element("div",{className:t.join(" "),style:r})},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 e(i){return n.dom.element("span",{className:t.icon+" "+i})}function o(t,r,u){var o={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:o},[e(t.iconFilterDefault)])}var u=this._sheet,r=[],t=f.classNames,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=this._sheet.filterColumn(n),e=o(t,u,f);r.push(e)}.bind(this)),n.dom.element("div",{className:t.filterHeadersWrapper},r)},renderEditorSelection:function(){var t=i.classNames,u=this._sheet,r=[];return u._formulaSelections.forEach(function(i){var u=i.ref;u!==n.spreadsheet.NULLREF&&this._addDiv(r,u,t.selectionHighlight+" "+i.colorClass)}.bind(this)),n.dom.element("div",{className:t.selectionWrapper},r)},renderSelection:function(){var r=i.classNames,f=[],u=[r.activeCell],t=[r.selection],e=this._sheet,o=e.activeCell().toRangeRef(),s=this._activeFormulaColor(),h=e.select();return u=u.concat(s,this._directionClasses(o)),t=t.concat(s),e.singleCellSelection()&&u.push(r.single),h.size()===1&&t.push("k-single-selection"),this._sheet.autoFillPunch()&&t.push("k-dim-auto-fill-handle"),h.forEach(function(i){i!==n.spreadsheet.NULLREF&&this._addDiv(f,i,t.join(" "))}.bind(this)),this._addTable(f,o,u.join(" ")),n.dom.element("div",{className:r.selectionWrapper},f)},renderAutoFill:function(){var f=[],r,u,c,o;if(this._sheet.autoFillInProgress()){var t=this._sheet.autoFillRef(),s=this._sheet.autoFillPunch(),h=this._sheet._autoFillDirection;if(this._addDiv(f,t,"k-auto-fill"),s)this._addDiv(f,s,"k-auto-fill-punch");else if(h!==undefined){switch(h){case 0:r=t.bottomRight;u="k-auto-fill-br-hint";break;case 1:r=t.bottomRight;u="k-auto-fill-br-hint";break;case 2:r=new e(t.topLeft.row,t.bottomRight.col);u="k-auto-fill-tr-hint";break;case 3:r=new e(t.bottomRight.row,t.topLeft.col);u="k-auto-fill-bl-hint"}c=n.dom.element("span",{className:"k-tooltip"},[n.dom.text(this._sheet._autoFillHint)]);o=this._addDiv(f,r,u);o&&o.children.push(c)}}return n.dom.element("div",{className:i.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(t,i,r){var u=this,o=u._sheet,s=u._currentView,h=u._grid.columns._axis._count,f,e;s.ref.intersects(i)&&(f=u._rectangle(i),e=u._sheet.activeCellCustomEditor(),o.forEach(i.collapse(),function(i,u,o){var s,l,a;o.left=f.left;o.top=f.top;o.width=f.width;o.height=f.height;c(t,o,r,!0);e&&(s="k-button k-spreadsheet-editor-button",l=u==h-1,l&&(s+=" k-spreadsheet-last-column"),a=n.dom.element("div",{className:s,style:{left:o.left+(l?0:o.width)+"px",top:o.top+"px",height:o.height+"px"}}),e.icon&&a.children.push(n.dom.element("span",{className:"k-icon "+e.icon})),t.push(a))}))},_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 t=[],r=i.classNames,u=this._currentView.ref;return n.move(0,-1).intersects(u)||t.push(r.left),n.move(-1,0).intersects(u)||t.push(r.top),n.move(0,1).intersects(u)||t.push(r.right),n.move(1,0).intersects(u)||t.push(r.bottom),t},_rectangle:function(n){return this._grid.boundingRectangle(n.toRangeRef()).offset(-this._currentView.mergedCellLeft,-this._currentView.mergedCellTop)}});n.spreadsheet.View=f;n.spreadsheet.Pane=i;n.spreadsheet.drawCell=c;t.extend(!0,f,{classNames:o});t.extend(!0,i,{classNames:s})}})(window.kendo)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("spreadsheet/customeditors",["kendo.core","kendo.popup","kendo.calendar","kendo.listview","spreadsheet/sheet"],n)}(function(){(function(n){"use strict";if(!n.support.browser.msie||!(n.support.browser.version<9)){var t={},i=n.spreadsheet.registerEditor=function(n,i){t[n]=i};n.spreadsheet.Sheet.prototype.activeCellCustomEditor=function(){var u=this.activeCell().first(),r,n,i;if(this.range(u).enable())return r=this.validation(u),n=this._properties.get("editor",this._grid.cellRefIndex(u)),n!=null?i=t[n]:r&&r.showButton&&(n="_validation_"+r.dataType,i=t[n]),typeof i=="function"&&(i=t[n]=i()),i};i("_validation_date",function(){function u(){t||(t=$("<div>").kendoCalendar(),r=$("<div>").kendoPopup(),t.appendTo(r),t=t.getKendoCalendar(),r=r.getKendoPopup(),t.bind("change",function(){r.close();var u=t.value();i.range.format()||i.range.format("yyyy-mm-dd");i.callback(n.spreadsheet.dateToNumber(u))}));r.setOptions({anchor:i.view.element.find(".k-spreadsheet-editor-button")})}function f(){var o,f,s,e;u();o=i.range.value();o!=null?t.value(n.spreadsheet.numberToDate(o)):t.value(null);f=i.validation;f?(s=n.ui.Calendar.fn.options.min,e=n.ui.Calendar.fn.options.max,/^(?:greaterThan|between)/.test(f.comparerType)&&(s=n.spreadsheet.numberToDate(f.from.value)),f.comparerType=="between"&&(e=n.spreadsheet.numberToDate(f.to.value)),f.comparerType=="lessThan"&&(e=n.spreadsheet.numberToDate(f.from.value)),t.setOptions({disableDates:function(t){var i=f.from?f.from.value|0:0,r=f.to?f.to.value|0:0;return t=n.spreadsheet.dateToNumber(t)|0,!n.spreadsheet.validation.validationComparers[f.comparerType](t,i,r)},min:s,max:e})):t.setOptions({disableDates:null,min:null,max:null});r.open()}var i,t,r;return{edit:function(n){i=n;f()},icon:"k-i-calendar"}});i("_validation_list",function(){function u(){t||(t=$("<ul class='k-list k-reset'/>").kendoStaticList({template:"#:value#",selectable:!0,autoBind:!1}),i=$("<div>").kendoPopup(),t.appendTo(i),i=i.getKendoPopup(),t=t.getKendoStaticList(),t.bind("change",function(){i.close();var n=t.value()[0];n&&r.callback(n.value)}));i.setOptions({anchor:r.view.element.find(".k-spreadsheet-editor-button")})}function f(){var f,e,o;u();f=r.validation.from.value;e=[];f&&f.each(function(n){e.push({value:n})});o=new n.data.DataSource({data:e});t.setDataSource(o);o.read();i.open()}var r,t,i;return{edit:function(n){r=n;f()},icon:"k-i-arrow-60-down"}})}})(window.kendo)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("spreadsheet/grid",["kendo.core","spreadsheet/references"],n)}(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){return n instanceof i?new i(this.normalize(n.topLeft),this.normalize(n.bottomRight)).setSheet(n.sheet,n.hasSheet()):n instanceof f?n.map(function(n){return this.normalize(n)},this):(n instanceof t&&(n=n.clone(),n.col=Math.max(0,Math.min(this.columnCount-1,n.col)),n.row=Math.max(0,Math.min(this.rowCount-1,n.row))),n)},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)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("spreadsheet/axis",["kendo.core"],n)}(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()},adjust:function(n,t){t<0?(this.values.copy(n-t,this._count-1,n),this._hidden.copy(n-t,this._count-1,n)):(this.values.copy(n,this._count,n+t),this._hidden.copy(n,this._count,n+t),this.values.value(n,n+t-1,this._value),this._hidden.value(n,n+t-1,0));this._refresh()},toJSON:function(n,t){for(var o,r,u,f,e=[],s=this.values.iterator(0,this._count-1),i=0;i<this._count;i++)(o=s.at(i),r=this._hidden.value(i,i),o!==this._value||r)&&(u=t[i],u===undefined&&(u=e.length,f={index:i},f[n]=o,r&&(f.hidden=r),e.push(f),t[i]=u));return e},fromJSON:function(n,t){for(var i=0;i<t.length;i++){var u=t[i],f=u[n]||u.hidden,r=u.index;r===undefined&&(r=i);this.value(r,r,f);u.hidden&&this.hide(r)}},hide:function(n){if(!this.hidden(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;if(n===r)return t?n+1:n;for(i=n+1;i<=r;++i)if(!this.hidden(i))return i;return 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;for(var i=n-1;i>=0;--i)if(!this.hidden(i))return i;return 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;if(t>=this.total+this.scrollBarSize&&(o=!0),u=this._pixelValues.intersecting(n,t),r=u[0],i=u[u.length-1],!r)return{values:this.values.iterator(0,0),offset:0};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},indexVisible:function(n){var t=this.index(n);return this.hidden(t)&&(t=this.prevVisible(t)),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)},indexVisible:function(n,t){return this._axis.indexVisible(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)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("spreadsheet/filter",["kendo.core","kendo.data"],n)}(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",blanks:this._blanks,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].value,f=u instanceof Date?"date":typeof u,r=typeof i;return t.format&&(r=n.spreadsheet.formatting.type(i,t.format)),r!=f?f=="string"&&(t.format&&(i=n.spreadsheet.formatting.text(i,t.format)),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)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("spreadsheet/sorter",["kendo.core"],n)}(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)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("spreadsheet/numformat",["spreadsheet/calc","kendo.dom"],n)}(function(){"use strict";function f(n){function o(){var t=n.skip(c);if(t)return t[1].toLowerCase()}function s(){var t=n.skip(l),i;if(t&&(i=parseFloat(t[2]),!isNaN(i)))return{op:t[1],value:i}}function h(){for(var r=[],t,i=null;!n.eof()&&(t=a());)t.type=="date"?i&&/^(el)?time$/.test(i.type)&&i.part=="h"&&t.part=="m"&&t.format<3&&(t.type="time"):/^(el)?time$/.test(t.type)&&t.part=="s"&&i&&i.type=="date"&&i.part=="m"&&i.format<3&&(i.type="time"),/^(?:str|space|fill)$/.test(t.type)||(i=t),r.push(t);return r}function e(t){if(t.type!="date"||t.part=="m"&&t.format<3){var i=n.skip(/^\.(0+)/);i&&(t.fraction=i[1].length,t.type=="date"&&(t.type="time"))}return t}function a(){var r,t;if(t=n.skip(/^([#0?]+)(?:,([#0?]+))+/))return{type:"digit",sep:!0,format:t[1]+t[2],decimal:i};if(t=n.skip(/^[#0?]+/))return{type:"digit",sep:!1,format:t[0],decimal:i};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 t=t[1].toLowerCase(),e({type:"date",part:t.charAt(0),format:t.length});if(t=n.skip(/^(hh?|ss?)/i))return t=t[1],e({type:"time",part:t.toLowerCase().charAt(0),format:t.length,ampm:t=="hh"});if(t=n.skip(/^\[(hh?|mm?|ss?)\]/i))return t=t[1].toLowerCase(),e({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(r=n.next()){case";":return null;case"\\":return{type:"str",value:n.next()};case'"':return{type:"str",value:n.readEscaped(r)};case"@":return{type:"text"};case"_":return{type:"space",value:n.next()};case"*":return{type:"fill",value:n.next()};case".":return n.lookingAt(/^\s*[#0?]/)?(i=!0,{type:"dec"}):{type:"str",value:"."};case"%":return{type:"percent"};case",":return{type:"comma"}}return{type:"str",value:r}}function v(){i=!1;var n=o(),t=s();return!n&&t&&(n=o()),{color:n,cond:t,body:h()}}var t,r,i,f;for(n=u.InputStream(n),t=[],r=!1;!n.eof();)f=v(),t.push(f),f.cond&&(r=!0);return r||(t.length==1?t[0].cond="num":t.length==2?(t[0].cond={op:">=",value:0},t[1].cond={op:"<",value:0}):t.length>=3&&(t[0].cond={op:">",value:0},t[1].cond={op:"<",value:0},t[2].cond={op:"=",value:0},t.length>3&&(t[3].cond="text",t=t.slice(0,4)))),t}function a(t){function r(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(u).join("")}function i(t,i){return i.fraction&&(t+="."+n("",i.fraction,"0")),t}function u(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"?i(n("",t.format,t.part),t):t.type=="eltime"?i("["+n("",t.format,t.part)+"]",t):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(r).join(";")}function v(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 y(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 o(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=y(n.body),h=!1,e=!1,c=!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' || value instanceof kendo.spreadsheet.CalcError) { ":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+="result.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"?(c=c||!!t.ampm,e=!0):t.type=="date"?h=!0:t.type=="ampm"&&(c=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+"); ",i+="var isNegative = parseInt(intPart[0]) < 0;"),s.length&&(i+="var decPart = runtime.formatDec(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(),i+="var matchedCurrency = false;";!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"?(/[\$\xA2-\xA5\u058F\u060B\u09F2\u09F3\u09FB\u0AF1\u0BF9\u0E3F\u17DB\u20A0-\u20BD\uA838\uFDFC\uFE69\uFF04\uFFE0\uFFE1\uFFE5\uFFE6]/.test(t.value)&&(i+="type = 'currency'; ",i+="if (isNegative) { output += '-'; matchedCurrency = true; }"),i+="output += "+JSON.stringify(t.value)+"; "):t.type=="text"?(i+="type = 'text'; ",i+="output += value; "):t.type=="space"?(i+="if (output) result.body.push(output); ",i+="output = ''; ",i+="result.body.push({ type: 'space', value: "+JSON.stringify(t.value)+" }); "):t.type=="fill"?i+="output += runtime.fill("+JSON.stringify(t.value)+"); ":t.type=="digit"?(i+="if (isNegative && intPart[0] && matchedCurrency) {intPart[0] = intPart[0].replace('-', '');}",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(time, "+JSON.stringify(t.part)+", "+t.format+", "+c+", "+t.fraction+"); ":t.type=="eltime"?i+="output += runtime.eltime(value, "+JSON.stringify(t.part)+", "+t.format+", "+t.fraction+"); ":t.type=="ampm"&&(i+="output += time.hours < 12 ? "+JSON.stringify(t.am)+" : "+JSON.stringify(t.pm)+"; "):i+="output += ','; ";return i+="if (output) result.body.push(output); ",i+="result.type = type; ",i+="return result; ",r&&(i=r+i+"}"),i}function i(n){var r=e[n],u,i;return r||(u=f(n),i=u.map(o),i.push(s),i=i.join("\n"),i="'use strict'; return function(value, culture){ if (!culture) culture = kendo.culture(); var output = '', type = null, result = { body: [] }; "+i+"; return result; };",r=e[n]=new Function("runtime",i)(t)),r}function n(n,t,i){for(n+="";n.length<t;)n=i+n;return n}function h(n){for(var t,u=n.body,i="",r=0;r<u.length;++r)t=u[r],typeof t=="string"?i+=t:t.type=="space"&&(i+=" ");return i}var e,s,t;if(!kendo.support.browser.msie||!(kendo.support.browser.version<9)){var u=kendo.spreadsheet.calc,r=kendo.dom,c=/^\[(black|green|white|blue|magenta|yellow|cyan|red)\]/i,l=/^\[(<=|>=|<>|<|>|=)(-?[0-9.]+)\]/;e=Object.create(null);s=o({cond:"text",body:[{type:"text"}]});t={unpackDate:u.runtime.unpackDate,unpackTime:u.runtime.unpackTime,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(i,r,u,f,e){var o,s;switch(r){case"h":o=n(f?i.hours%12||12:i.hours,u,"0");e&&(s=(i.minutes+(i.seconds+i.milliseconds/1e3)/60)/60);break;case"m":o=n(i.minutes,u,"0");e&&(s=(i.seconds+i.milliseconds/1e3)/60);break;case"s":o=n(i.seconds,u,"0");e&&(s=i.milliseconds/1e3)}return s&&(o+=t.toFixed(s,e).replace(/^0+/,"")),o},eltime:function(i,r,u,f){var e,o;switch(r){case"h":e=i*24;break;case"m":e=i*1440;break;case"s":e=i*86400}return f&&(o=e-(e|0)),e=n(e|0,u,"0"),o&&(e+=t.toFixed(o,f).replace(/^0+/,"")),e},fill:function(n){return n},formatInt:function(n,i,r,u,f){function s(t){f&&l&&l%3==0&&/^[0-9]$/.test(t)&&(e=n.numberFormat[","]+e);e=t+e;l++}var h,a,v,c;i=t.toFixed(i,u).replace(/\..*$/,"");u>0&&(i==="0"?i="":i==="-0"&&(i="-"));var o=i.length-1,y=[],l=0,e;for(h=r.length;--h>=0;){for(a=r[h],e="",v=a.length;--v>=0;)c=a.charAt(v),o<0?c=="0"?s("0"):c=="?"&&s(" "):(i=="0"&&c=="?"?s(" "):s(i.charAt(o)),o--);if(h===0)while(o>=0)s(i.charAt(o--));y.unshift(e)}return y},formatDec:function(n,i,r){var o,s,h,f,c,u,e,l;for(n=t.toFixed(n,r),o=n.indexOf("."),n=o>=0?n.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<n.length?u+=n.charAt(s++):l=="0"?u+="0":l=="?"&&(u+=" ");h.push(u)}return h},toFixed:function(n,t){var r=String(n),u=r.indexOf("."),f,i;if(u>=0){if(f=r.substr(0,u)||0,i=r.substr(u+1),i.length>14&&(i=String(Math.round(i/Math.pow(10,i.length-14)))),i.length<t){while(i.length<t)i+="0";return f+"."+i}n=parseFloat(f+"."+i)}return n.toFixed(t)}};kendo.spreadsheet.formatting={compile:i,parse:f,format:function(n,t,u){var o=i(t)(n,u),f=r.element("span"),h,s,e;for(f.__dataType=o.type,h=o.body,o.color&&(f.attr.style={color:o.color}),s=0;s<h.length;++s)e=h[s],typeof e=="string"?f.children.push(r.text(e)):e.type=="space"&&f.children.push(r.element("span",{style:{visibility:"hidden"}},[r.text(e.value)]));return f},text:function(n,t,r){var u=i(t)(n,r);return h(u)},textAndColor:function(n,t,r){var u=i(t)(n,r);return{text:h(u),color:u.color,type:u.type}},type:function(n,t){return i(t)(n).type},adjustDecimals:function(n,t){var i=f(n);return v(i,t),a(i)}}}},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("spreadsheet/runtime.functions",["spreadsheet/runtime","util/main"],n)}(function(){"use strict";function tt(n){return(Math.exp(n)+Math.exp(-n))/2}function it(n){return(Math.exp(n)-Math.exp(-n))/2}function vt(n){return it(n)/tt(n)}function yt(n,t){while(t){var i=n%t;n=t;t=i}return n}function ui(n,t){return Math.abs(n*t)/yt(n,t)}function rt(n,t){for(var f=[],i=0,o=n[0],r,u,e;i<n.length;)f.push({matrix:n[i++],pred:h(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 pt(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 wt(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 bt(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 kt(n,t){var i=t*(n.length-1)+1;return bt(n,i)}function dt(n,t){var i=t*(n.length+1);return bt(n,i)}function ht(n,i,r){var u=[],o=1,f=2,s=4;return function e(i){if(i instanceof y)n.getRefCells(i,!0).forEach(function(n){var i=n.value,e;if(!(r&o)||!n.hidden){if(n.formula){if(e=n.formula.print(n.row,n.col),/^\s*(?:aggregate|subtotal)\s*\(/i.test(e)&&!(r&s))return;"value"in n.formula&&(i=n.formula.value)}r&f&&i instanceof t||(typeof i=="number"||i instanceof t)&&u.push(i)}});else if(Array.isArray(i))for(var h=0;h<i.length;++h)e(i[h]);else i instanceof c?i.each(e):typeof i=="number"?u.push(i):i instanceof t&&!(r&f)&&u.push(i)}(i),u}function gt(n,t,i,r){var f,u;if(r){for(f=0,u=0;u<=n;++u)f+=s(t,u)*Math.pow(i,u)*Math.pow(1-i,t-u);return f}return s(t,n)*Math.pow(i,n)*Math.pow(1-i,t-n)}function ni(n){var t=r(a(n,0,1));return t.day==4||t.day==3&&i.isLeapYear(n)?53:52}function d(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)):u.date==30&&f.date==31&&(f.date=30)),360*(f.year-u.year)+30*(f.month-u.month)+(f.date-u.date)}function ii(n,t){this.link=n;this.text=t}function g(n){return typeof n=="number"||typeof n=="boolean"||n==null||n===""}function f(n,t){return n===t?0:n<t?-1:1}function ct(n,t){return n===t?0:n<t?1:-1}var ut,ft,et,ot,k,s,st,ti,h;if(!kendo.support.browser.msie||!(kendo.support.browser.version<9)){var v=kendo.util,e=kendo.spreadsheet,lt=e.calc,i=lt.runtime,n=i.defineFunction,u=i.defineAlias,t=i.CalcError,nt=e.RangeRef,o=e.CellRef,at=e.UnionRef,c=i.Matrix,y=e.Ref,l=i.daysInMonth,a=i.packDate,r=i.unpackDate,ri=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",tt).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",it).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/tt(n)}).args([["*num","number"]]);n("csc",function(n){return 1/Math.sin(n)}).args([["*num","number"]]);n("csch",function(n){return 1/it(n)}).args([["*num","number"]]);n("atan2",function(n,t){return Math.atan(t/n)}).args([["*x","divisor"],["*y","number"]]);n("tanh",vt).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/vt(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("round",function(n,t){var i=n<0?-1:1;return i<0&&(n=-n),t=Math.pow(10,t),n*=t,n=Math.round(n),i*n/t}).args([["*number","number"],["*digits","number"]]);n("roundup",function(n,t){return t=Math.pow(10,t),n*=t,n=n<0?Math.floor(n):Math.ceil(n),n/t}).args([["*number","number"],["*digits","number"]]);n("rounddown",function(n,t){return t=Math.pow(10,t),n*=t,n=n<0?Math.ceil(n):Math.floor(n),n/t}).args([["*number","number"],["*digits","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=yt(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=ui(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,t){var i=0;return n.each(function(n,r,u){var f,e;if(typeof n=="number"){for(f=0;f<t.length;++f){if(e=t[f].get(r,u),typeof e!="number")return;n*=e}i+=n}}),i}).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 n.length?Math.min.apply(Math,n):0}).args([["numbers",["collect","number"]]]);n("max",function(n){return n.length?Math.max.apply(Math,n):0}).args([["numbers",["collect","number"]]]);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([]);ut=[["m1","matrix"],["c1","anyvalue"],[["m2","matrix"],["c2","anyvalue"]]];n("countifs",function(n,t,i){var r=0;return i.unshift(n,t),rt(i,function(){r++}),r}).args(ut);ft=[["range","matrix"]].concat(ut);n("sumifs",function(n,t,i,r){r.unshift(n,g,t,i);var u=0;return rt(r,function(t,i){var r=n.get(t,i);r&&(u+=r)}),u}).args(ft);n("averageifs",function(n,i,r,u){u.unshift(n,g,i,r);var e=0,f=0;return rt(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(ft);n("countif",function(n,t){t=h(t);var i=0;return n.each(function(n){t(n)&&i++}),i}).args([["range","matrix"],["*criteria","anyvalue"]]);et=[["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=h(t),n.each(function(n,u,f){if(t(n)){var e=i.get(u,f);g(e)&&(r+=e||0)}}),r}).args(et);n("averageif",function(n,i,r){var f=0,u=0;return i=h(i),n.each(function(n,t,e){if(i(n)){var o=r.get(t,e);g(o)&&(f+=o||0,u++)}}),u?f/u:new t("DIV/0")}).args(et),function(n){n("large",function(n,t){return n.sort(ct)[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 pt(n,n.length-1)}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length >= 2","NUM"]]]);n("stdev.p",function(n){return pt(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:ct);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:ct),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"]]]);ot=[["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(ot);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(ot);u("percentrank","percentrank.inc");n("covariance.p",function(n,t){return wt(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 wt(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"]]]);s=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",s).args([["*n","integer++"],["*k",["and","integer",["[between]",0,"$n"]]]]);n("combina",function(n,t){return s(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",kt).args([["numbers",["collect","number",1]],["p",["and","number",["[between]",0,1]]]]);n("percentile.exc",dt).args([["numbers",["collect","number",1]],["p",["and","number",["(between)",0,1]]]]);n("quartile.inc",function(n,t){return kt(n,t/4)}).args([["numbers",["collect","number",1]],["quarter",["values",0,1,2,3,4]]]);n("quartile.exc",function(n,t){return dt(n,t/4)}).args([["numbers",["collect","number",1]],["quarter",["values",0,1,2,3,4]]]);u("quartile","quartile.inc");u("percentile","percentile.inc");st=["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"];n("aggregate",function(n,i,r,u){var f=this;f.resolveCells(u,function(){var s,e;if(i>12){if(s=ht(f,u[0],r),e=u[1],e instanceof o&&(e=f.getRefData(e)),typeof e!="number")return n(new t("VALUE"))}else s=ht(f,u,r);f.func(st[i-1],n,s)})}).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("subtotal",function(n,t){var u=this,f=t>100,i,r;for(f&&(t-=100),i=[],r=2;r<arguments.length;++r)i.push(arguments[r]);u.resolveCells(i,function(){var r=ht(u,i,f?1:0);u.func(st[t-1],n,r)})}).argsAsync([["funcId",["values",1,2,3,4,5,6,7,8,9,10,11,101,102,103,104,105,106,107,108,109,110,111]],["+",["ref",["or","ref","#matrix"]]]]);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",gt).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(gt(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+=s(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+=s(n+t-1,n)*Math.pow(i,t)*Math.pow(1-i,n),n--;return u}return s(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 o(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 o||n instanceof nt?t++:n instanceof at&&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 o?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,u,f){var e=this,s,h,l;if(i instanceof at&&(i=i.refs[f-1]),!r&&!u||!i)return n(new t("N/A"));if(i instanceof o&&(i=i.toRangeRef()),i instanceof nt){if(r&&u){if(u>i.width()||r>i.height())return n(new t("REF"));s=i.toCell(r-1,u-1);e.resolveCells([s],function(){n(e.getRefData(s))});return}if(!r){h=i.toColumn(u-1);e.resolveCells([h],function(){n(e.asMatrix(h))});return}if(!u){l=i.toRow(r-1);e.resolveCells([l],function(){n(e.asMatrix(l))});return}}else if(i instanceof c){if(i.width>1&&i.height>1){if(r&&u)return n(i.get(r-1,u-1));if(!r)return n(i.mapRow(function(n){return i.get(n,u-1)}));if(!u)return n(i.mapCol(function(n){return i.get(r-1,n)}))}if(i.width==1)return n(i.get(r-1,0));if(i.height==1)return n(i.get(0,u-1))}else n(new t("REF"))}).argsAsync([["range",["or","ref","matrix"]],["row",["or","integer+","null"]],["col",["or","integer+","null"]],["areanum",["or","integer++",["null",1]]]]);n("indirect",function(n){try{var i=this.formula,r=lt.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=h(n):r===-1?f=h("<="+n):r===1&&(f=h(">="+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 o?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 nt(e,new o(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 o?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(typeof n!="number"&&(u=!1),typeof n=="string"&&(n=n.toLowerCase()),i.eachRow(function(t){var r=i.get(t,0);if(u){if(r>n)return!0;f=t}else if(typeof r=="string"&&(r=r.toLowerCase()),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?ni(t.year-1):i==53&&i>ni(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"]]);i._days_360=d;n("days360",d).args([["*start_date","date"],["*end_date","date"],["*method",["or","logical",["null",!1]]]]);n("yearfrac",function(n,t,i){switch(i){case 0:return d(n,t,!1)/360;case 1:return(t-n)/ri(r(n).year);case 2:return(t-n)/360;case 3:return(t-n)/365;case 4:return d(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+"]]);ti=/[\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(ti,"")}).args([["*text","string"]]);n("code",function(n){return n.charAt(0)}).args([["*text","string"]]);u("unichar","char");u("unicode","code");n("concatenate",function(n){for(var i="",t=0;t<n.length;++t)i+=n[t];return i}).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.text(n,i)}).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){var u=Math.pow(10,t),r;if(n=Math.round(n*u)/u,r=i?"0":"#,##0",t>0)for(r+=".";t-->0;)r+="0";return e.formatting.text(n,r)}).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.text(n,t)}).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"]]);ii.prototype.toString=function(){return this.text};n("hyperlink",function(n,t){return new ii(n,t)}).args([["*link","string"],["*text",["or","string",["null","$link"]]]]);n("iferror",function(n,i){return n instanceof t?i:n}).args([["*value","forced!"],["*value_if_error","anyvalue!"]]);h=function(){function t(n,t){if(typeof t=="string"){var i=parseFloat(t);isNaN(i)||i!=t||(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){var t,i;return typeof n=="string"&&(n=n.toLowerCase()),/^[0-9.]+%$/.test(n)?(i=n.substr(0,n.length-1),t=parseFloat(i),isNaN(t)||t!=i||(n=t/100)):/^[0-9.]+$/.test(n)&&(t=parseFloat(n),isNaN(t)||t!=n||(n=t)),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(n,t){return!i(n,t)}function i(t,i){return i instanceof RegExp?i.test(t):((typeof t=="string"||typeof i=="string")&&(t=String(t),i=String(i)),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)}}()}},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("spreadsheet/runtime.functions.2",["spreadsheet/runtime"],n)}(function(){"use strict";function c(n){var r,u,f,t;if(i(n)>=3.3)return 1-lt(n);for(r=n>0?1:-1,r==-1&&(n=-n),u=0,f=1,t=1;t<100;t++)u+=f,f*=2*n*n/(2*t+1);return r*2/Math.sqrt(Math.PI)*n*Math.exp(-n*n)*u}function lt(n){var u,t,r;if(i(n)<3.3)return 1-c(n);for(u=1,n<0&&(u=-1,n=-n),t=n,r=8;r>=1;r-=.5)t=n+r/t;return t=1/(n+t),u==1?Math.exp(-n*n)/Math.sqrt(Math.PI)*t:2-Math.exp(-n*n)/Math.sqrt(Math.PI)*t}function h(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 g(n){if(n>0)return Math.exp(h(n));var i=Math.PI,t=-n;return-i/(t*g(t)*Math.sin(i*t))}function nt(n,t){return h(n)+h(t)-h(n+t)}function at(n,t){return Math.exp(nt(n,t))}function li(n,t){return t<n+1?ai(n,t):1-vi(n,t)}function ai(n,t){for(var r=1/n,u=r,e=n,o=h(n),f=1;f<=a;f++)if(e++,u*=t/e,r+=u,i(u)<i(r)*w)break;return r*Math.exp(-t+n*Math.log(t)-o)}function vi(n,t){for(var l,o=r,f=o,u=0,s=1,c=t+1-n,v=h(n),e=1;e<=a;e++){if(u=c+s*u,i(u)<r&&(u=r),f=c+s/f,i(f)<r&&(f=r),u=1/u,l=f*u,o*=l,i(l-1)<w)break;c+=2;s=-e*(e-n)}return o*Math.exp(-t-v+n*Math.log(t))}function tt(n,t,i,r){return r?li(t,n/i):Math.pow(n/i,t-1)*Math.exp(-n/i)/(i*g(t))}function vt(n,t,r){var e,o;if(n===0)return 0;if(n==1)return Infinity;var s=0,f=10,u=0,h=t*r;for(h>1&&(f*=h),e=0;e<a;e++){if(u=.5*(s+f),o=tt(u,t,r,!0),i(n-o)<1e-16)break;o>n?f=u:s=u}return u}function b(n,t){return t?.5+.5*c(n/Math.sqrt(2)):Math.exp(-n*n/2)/Math.sqrt(2*Math.PI)}function it(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 yi(n,t,i,r){return r?b((n-t)/i,!0):Math.exp(-(n-t)*(n-t)/(2*i*i))/(i*Math.sqrt(2*Math.PI))}function yt(n,t,i){return t+i*it(n)}function pi(n,t,i){return Math.exp((t-1)*Math.log(n)+(i-1)*Math.log(1-n)-nt(t,i))}function v(n,t,i){var r=Math.exp(t*Math.log(n)+i*Math.log(1-n)-nt(t,i));return n<(t+1)/(t+i+2)?r*pt(t,i,n)/t:1-r*pt(i,t,1-n)/i}function pt(n,t,u){var o,h,s,e,f,l,c,v,p,y;for(v=n+t,y=n+1,p=n-1,e=1,f=1-v*u/y,i(f)<r&&(f=r),f=1/f,c=f,o=1;o<=a;o++)if(h=2*o,s=o*(t-o)*u/((p+h)*(n+h)),f=1+s*f,i(f)<r&&(f=r),e=1+s/e,i(e)<r&&(e=r),f=1/f,c*=f*e,s=-(n+o)*(v+o)*u/((n+h)*(y+h)),f=1+s*f,i(f)<r&&(f=r),e=1+s/e,i(e)<r&&(e=r),f=1/f,l=f*e,c*=l,i(l-1)<w)break;return c}function wt(n,t,r){for(var f,e=0,o=1,u=0,s=0;s<a;s++){if(u=.5*(e+o),f=v(u,t,r),i(n-f)<w)break;f>n?o=u:e=u}return u}function wi(n,t,i,r,u){return v((n-r)/(u-r),t,i)}function bi(n,t,i,r,u,f){return r?v((n-u)/(f-u),t,i):pi((n-u)/(f-u),t,i)/(f-u)}function rt(n,t,i,r,u){return r+(u-r)*wt(n,t,i)}function ut(n,t,i){return tt(n,t/2,2,i)}function bt(n,t){return 1-ut(n,t,!0)}function kt(n,t){return vt(n,t/2,2)}function ki(n,t){return kt(1-n,t)}function di(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),bt(s,h)}function gi(n,t,i){return i?1-Math.exp(-t*n):t*Math.exp(-t*n)}function nr(n,t,i){var u,r;if(i)return 1-ut(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 ft(n,t,i,r){if(r)return v(t*n/(i+t*n),t/2,i/2);var u=t/i;return t/=2,i/=2,u/at(t,i)*Math.pow(u*n,t-1)/Math.pow(1+u*n,t+i)}function tr(n,t,i){return 1-ft(n,t,i,!0)}function ir(n,t,i){return i/t*(1/rt(n,i/2,t/2,0,1)-1)}function rr(n,t,i){return i/t*(1/rt(1-n,i/2,t/2,0,1)-1)}function u(n){for(var i=0,r=n.length,t=0;t<r;t++)i+=n[t];return i/r}function k(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 ur(n,t){var f=n.length-1,e=t.length-1,i=k(n,u(n)),r=k(t,u(t));if(!i||!r)throw new l("DIV/0");return 2*ft(i/r,f,e,!0)}function fr(n){return.5*Math.log((1+n)/(1-n))}function er(n){var t=Math.exp(2*n);return(t-1)/(t+1)}function dt(n,t,i){return i?1-.5*v(t/(n*n+t),t/2,.5):1/(Math.sqrt(t)*at(.5,t/2))*Math.pow(1+n*n/t,-(t+1)/2)}function y(n,t){return 1-dt(n,t,!0)}function d(n,t){return n<0&&(n=-n),2*y(n,t)}function et(n,t){var i=wt(2*Math.min(n,1-n),t/2,.5);return i=Math.sqrt(t*(1-i)/i),n>.5?i:-i}function or(n,t){return et(1-n/2,t)}function sr(n,t,r,f){var e=n.length,h=t.length,o,s,l,v,c,a,p;if(f==1){for(l=0,v=0,c=0;c<e;c++)a=n[c]-t[c],l+=a,v+=a*a;return p=l/e,o=p/Math.sqrt((v-l*p)/(e*(e-1))),r==1?y(o,e-1):d(o,e-1)}var w=u(n),b=u(t),nt=k(n,w),tt=k(t,b);if(f==3){var it=nt/e,rt=tt/h,g=it+rt,ut=it/g,ft=rt/g;return s=1/(ut*ut/(e-1)+ft*ft/(h-1)),o=i(w-b)/Math.sqrt(g),r==1?y(o,s):d(o,s)}return s=e+h-2,o=i(w-b)*Math.sqrt(s*e*h/((e+h)*((e-1)*nt+(h-1)*tt))),r==1?y(o,s):d(o,s)}function hr(n,t,i){return-et(n/2,i-1)*t/Math.sqrt(i)}function cr(n,t,i){return-it(n/2)*t/Math.sqrt(i)}function lr(n){return b(n,!0)-.5}function ar(n){return b(n)}function vr(n,t,i,r){if(r)return.5+.5*c((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 yr(n,t,i){return Math.exp(yt(n,t,i))}function pr(n,t,i,r){for(var o=n.length,s=0,f,e,u=0;u<o;u++){if(t[u]<=0||t[u]>1)throw new l("NUM");s+=t[u]}if(s!=1)throw new l("NUM");for(f=0,u=0;u<o;u++)e=n[u],e>=i&&e<=r&&(f+=t[u]);return f}function wr(n,t){for(var r,o=u(t),s=u(n),f=0,e=0,i=0,h=n.length;i<h;i++)r=t[i]-o,f+=r*(n[i]-s),e+=r*r;return f/e}function br(n,t){for(var r,f=u(t),e=u(n),o=0,s=0,i=0,h=n.length;i<h;i++)r=t[i]-f,o+=r*(n[i]-e),s+=r*r;return e-o*f/s}function gt(n,t){for(var r,f,h=u(n),c=u(t),e=0,o=0,s=0,i=0,l=n.length;i<l;i++)r=n[i]-h,f=t[i]-c,e+=r*f,o+=r*r,s+=f*f;return e/Math.sqrt(o*s)}function kr(n,t){var i=gt(n,t);return i*i}function dr(n,t){for(var r,f,o=t.length,c=u(t),l=u(n),s=0,e=0,h=0,i=0;i<o;i++)r=t[i]-c,f=n[i]-l,s+=f*f,e+=r*f,h+=r*r;return Math.sqrt((s-e*e/h)/(o-2))}function gr(n,t,i){for(var f,a,o,v,s=u(i),h=u(t),c=0,e=0,r=0,y=i.length;r<y;r++)f=i[r]-s,a=t[r]-h,c+=f*a,e+=f*f;if(e===0)throw new l("N/A");return o=c/e,v=h-o*s,v+o*n}function ni(n){for(var i=n.height,r=0,t=0;t<i;t++)r+=n.data[t][0];return r/i}function ti(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 ii(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?ni(l):0,s=ti(l,g),nt=i?ni(w):0,f=ti(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 nu(n,t,i,r){return ii.call(this,n.map(Math.log),t,i,r).map(Math.exp)}function ri(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 tu(n,t,i,r){return ri.call(this,n.map(Math.log),t,i,r).map(Math.exp)}function ot(n,t,i,r){for(var s=i||20,h=r||1e-7,u=t,f=1;f<=s;f++){var e=n(u),c=e[0],a=e[1],o=c/a;if(u-=o,Math.abs(o)<h)return u}return new l("NUM")}function ui(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 iu(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 st(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 ru(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 uu(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 ot(e,f)}function ht(n,t,i,r,u,f){if(f==1&&t==1)return 0;var o=st(n,i,r,u,f),e=ui(n,t-1,o,r,f)*n;return f?e/(1+n):e}function fu(n,t,i,r,u,f){var e=st(n,i,r,u,f);return e-ht(n,t,i,r,u,f)}function eu(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 ou(n,t,i,r,u,f){for(var o=0,e=r;e<=u;e++)o+=ht(n,e,t,i,0,f);return o}function su(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 hu(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 ot(i,t)}function cu(n,t){return Math.pow(1+n/t,t)-1}function lu(n,t){return t*(Math.pow(n+1,1/t)-1)}function au(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 vu(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 ot(r,i)}function yu(n,t,i,r){var u=-r*n;return u*(1-t/i)}function pu(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 wu(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 bu(n,t,i){return(n-t)/i}function ku(n,t,i,r){return(n-t)*(i-r+1)*2/(i*(i+1))}function du(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}function ct(n,t){var r=f(n),i=r.month+t,u=r.year+Math.floor(i/12);return i%=12,i<0&&(i+=12),r=Math.min(r.date,hi(u,i)),si(u,i,r)}function t(n,t,i){return i==1||i==2||i==3?t-n:ci(n,t,i)}function e(n,t,i){var s=f(n),h=f(t),r=h.year-s.year,u,o,e;r>0&&(r=(r-1)*i);e=12/i;do r++,u=ct(t,-r*e);while(n<u);return r--,o=ct(t,-r*e),[u,o]}function gu(n,t,i){var s=f(t),h=f(n),r=s.year-h.year,u,e,o;for(r>0&&(r=(r-1)*i),u=n,o=12/i;t>u;)e=u,r++,u=ct(n,r*o);return[e,u]}function nf(n,i,r,u){var f=e(n,i,r)[0];return t(f,n,u)}function tf(n,i,r,u){if(u==1){var f=e(n,i,r);return t(f[0],f[1],1)}return u==3?365/r:360/r}function rf(n,i,r,u){var f=e(n,i,r)[1];return t(n,f,u)}function uf(n,t,i){return e(n,t,i)[0]}function ff(n,t,i){return e(n,t,i)[1]}function ef(n,t,i){var r=f(n),u=f(t),e=12*(u.year-r.year)+u.month-r.month;return 1+(e*i/12|0)}function fi(n,t){return t==3?365:t==1?p(n)?366:365:360}function of(n,i,r,u,e){var o=fi(f(i).year,e);return r*u*t(n,i,e)/o}function sf(n,i,r,u,f,o,s,h){function b(n,t){return(t-n)*o/d|0}var w=0,y=f*u/o,c,l,a,k,p,v,d=s%2==0?360:365;return r<=i?(c=e(r,i,o),l=c[0],a=c[1],l<=n)?y*t(n,r,s)/t(l,a,s):(c=e(n,l,o),k=c[0],p=c[1],v=b(p,r),y*(v+t(n,p,s)/t(k,p,s)+(r<a?t(l,r,s)/t(l,a,s):0))):(c=gu(i,r,o),l=c[0],a=c[1],v=b(i,r),w=a==r?y*v:y*(v+t(l,r,s)/t(l,a,s)),!h)?w:(c=e(n,i,o),l=c[0],a=c[1],v=b(n,i),w+y*(v+t(n,a,s)/t(l,a,s)))}function hf(n,i,r,u,e){var o=e%2==0?360:p(f(n).year)?366:365;return(u-r)/u*o/t(n,i,e)}function cf(n,i,r,u,e){var o=e%2==0?360:p(f(n).year)?366:365;return(u-r)/r*o/t(n,i,e)}function lf(n,i,r,u,e){var o=e%2==0?360:p(f(n).year)?366:365;return r/(1-u*t(n,i,e)/o)}function af(n,i,r,u,f,o,s){var c=1+((i-n)*o/(s%2==0?360:365)|0),y=e(n,i,o),p=y[0],w=y[1],b=t(p,n,s),k=t(n,w,s),a=t(p,w,s),l=100*r/o,h=u/o,v=k/a;return c==1?(f+l)/(1+v*h)-b/a*l:f/Math.pow(1+h,c-1+v)+l*Math.pow(1+h,1-c-v)*(Math.pow(1+h,c)-1)/h-b/a*l}function vf(n,i,r,u,e){var o=t(n,i,e),s=fi(f(i).year,e);return u-r*u*o/s}var s;if(!kendo.support.browser.msie||!(kendo.support.browser.version<9)){var ei=kendo.spreadsheet,oi=ei.calc,o=oi.runtime,n=o.defineFunction,l=o.CalcError,si=o.packDate,f=o.unpackDate,p=o.isLeapYear,hi=o.daysInMonth,ci=o._days_360;n("ERF",function(n,t){return t==null?c(n):c(t)-c(n)}).args([["lower_limit","number"],["upper_limit",["or","number","null"]]]);n("ERFC",lt).args([["x","number"]]);n("GAMMALN",h).args([["x","number++"]]);n("GAMMA",g).args([["x","number"]]);n("GAMMA.DIST",tt).args([["x","number+"],["alpha","number++"],["beta","number++"],["cumulative","logical"]]);n("GAMMA.INV",vt).args([["p",["and","number",["[between]",0,1]]],["alpha","number++"],["beta","number++"]]);n("NORM.S.DIST",b).args([["z","number"],["cumulative","logical"]]);n("NORM.S.INV",it).args([["p",["and","number",["[between]",0,1]]]]);n("NORM.DIST",yi).args([["x","number"],["mean","number"],["stddev","number++"],["cumulative","logical"]]);n("NORM.INV",yt).args([["p",["and","number",["[between]",0,1]]],["mean","number"],["stddev","number++"]]);n("BETADIST",wi).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",bi).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",rt).args([["p",["and","number",["[between]",0,1]]],["alpha","number++"],["beta","number++"],["A",["or","number",["null",0]]],["B",["or","number",["null",1]]]]);n("CHISQ.DIST",ut).args([["x","number+"],["deg_freedom","integer++"],["cumulative","logical"]]);n("CHISQ.DIST.RT",bt).args([["x","number+"],["deg_freedom","integer++"]]);n("CHISQ.INV",kt).args([["p",["and","number",["[between]",0,1]]],["deg_freedom","integer++"]]);n("CHISQ.INV.RT",ki).args([["p",["and","number",["[between]",0,1]]],["deg_freedom","integer++"]]);n("CHISQ.TEST",function(n,t){return di(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",gi).args([["x","number+"],["lambda","number++"],["cumulative","logical"]]);n("POISSON.DIST",nr).args([["x","integer+"],["mean","number+"],["cumulative","logical"]]);n("F.DIST",ft).args([["x","number+"],["deg_freedom1","integer++"],["deg_freedom2","integer++"],["cumulative","logical"]]);n("F.DIST.RT",tr).args([["x","number+"],["deg_freedom1","integer++"],["deg_freedom2","integer++"]]);n("F.INV",rr).args([["p",["and","number",["[between]",0,1]]],["deg_freedom1","integer++"],["deg_freedom2","integer++"]]);n("F.INV.RT",ir).args([["p",["and","number",["[between]",0,1]]],["deg_freedom1","integer++"],["deg_freedom2","integer++"]]);n("F.TEST",ur).args([["array1",["collect","number",1]],["array2",["collect","number",1]],["?",["assert","$array1.length >= 2","DIV/0"]],["?",["assert","$array2.length >= 2","DIV/0"]]]);n("FISHER",fr).args([["x",["and","number",["(between)",-1,1]]]]);n("FISHERINV",er).args([["y","number"]]);n("T.DIST",dt).args([["x","number"],["deg_freedom","integer++"],["cumulative","logical"]]);n("T.DIST.RT",y).args([["x","number"],["deg_freedom","integer++"]]);n("T.DIST.2T",d).args([["x","number+"],["deg_freedom","integer++"]]);n("T.INV",et).args([["p",["and","number",["(between]",0,1]]],["deg_freedom","integer++"]]);n("T.INV.2T",or).args([["p",["and","number",["(between]",0,1]]],["deg_freedom","integer++"]]);n("T.TEST",sr).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",hr).args([["alpha",["and","number",["(between)",0,1]]],["standard_dev","number++"],["size",["and","integer++",["assert","$size != 1","DIV/0"]]]]);n("CONFIDENCE.NORM",cr).args([["alpha",["and","number",["(between)",0,1]]],["standard_dev","number++"],["size",["and","integer++"]]]);n("GAUSS",lr).args([["z","number"]]);n("PHI",ar).args([["x","number"]]);n("LOGNORM.DIST",vr).args([["x","number++"],["mean","number"],["standard_dev","number++"],["cumulative","logical"]]);n("LOGNORM.INV",yr).args([["probability",["and","number",["(between)",0,1]]],["mean","number"],["standard_dev","number++"]]);n("PROB",pr).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",wr).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",br).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",gt).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",kr).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",dr).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",gr).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",ii).args([["known_y","matrix"],["known_x",["or","matrix","null"]],["const",["or","logical",["null",!0]]],["stats",["or","logical",["null",!1]]]]);n("LOGEST",nu).args([["known_y","matrix"],["known_x",["or","matrix","null"]],["const",["or","logical",["null",!0]]],["stats",["or","logical",["null",!1]]]]);n("TREND",ri).args([["known_y","matrix"],["known_x",["or","matrix","null"]],["new_x",["or","matrix","null"]],["const",["or","logical",["null",!0]]]]);n("GROWTH",tu).args([["known_y","matrix"],["known_x",["or","matrix","null"]],["new_x",["or","matrix","null"]],["const",["or","logical",["null",!0]]]]);n("FV",ui).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",iu).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",st).args([["rate","number"],["nper","number"],["pmt","number"],["fv",["or","number",["null",0]]],["type",["or",["values",0,1],["null",0]]]]);n("NPER",ru).args([["rate","number"],["pmt","number"],["pv","number"],["fv",["or","number",["null",0]]],["type",["or",["values",0,1],["null",0]]]]);n("RATE",uu).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",ht).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",fu).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",eu).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",ou).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",su).args([["rate","number"],["values",["collect","number"]],["?",["assert","$values.length > 0","N/A"]]]);n("IRR",hu).args([["values",["collect","number",1]],["guess",["or","number",["null",.1]]]]);n("EFFECT",cu).args([["nominal_rate","number++"],["npery","integer++"]]);n("NOMINAL",lu).args([["effect_rate","number++"],["npery","integer++"]]);n("XNPV",au).args([["rate","number"],["values",["collect","number",1]],["dates",["collect","date",1]],["?",["assert","$values.length == $dates.length","NUM"]]]);n("XIRR",vu).args([["values",["collect","number",1]],["dates",["collect","date",1]],["guess",["or","number",["null",.1]]],["?",["assert","$values.length == $dates.length","NUM"]]]);n("ISPMT",yu).args([["rate","number"],["per","number++"],["nper","number++"],["pv","number"],["?",["assert","$per >= 1 && $per <= $nper"]]]);n("DB",pu).args([["cost","number"],["salvage","number"],["life","number++"],["period","number++"],["month",["or","number",["null",12]]]]);n("DDB",wu).args([["cost","number"],["salvage","number"],["life","number++"],["period","number++"],["factor",["or","number",["null",2]]]]);n("SLN",bu).args([["cost","number"],["salvage","number"],["life","number++"]]);n("SYD",ku).args([["cost","number"],["salvage","number"],["life","number++"],["per","number++"]]);n("VDB",du).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"]]]);s=[["settlement","date"],["maturity","date"],["frequency",["and","integer",["values",1,2,4]]],["basis",["or",["null",0],["and","integer",["values",0,1,2,3,4]]]],["?",["assert","$settlement < $maturity","NUM"]]];n("COUPDAYBS",nf).args(s);n("COUPDAYS",tf).args(s);n("COUPDAYSNC",rf).args(s);n("COUPPCD",uf).args(s);n("COUPNCD",ff).args(s);n("COUPNUM",ef).args(s);n("ACCRINTM",of).args([["issue","date"],["settlement","date"],["rate","number++"],["par",["or",["null",1e3],"number++"]],["basis",["or",["null",0],["and","integer",["values",0,1,2,3,4]]]],["?",["assert","$issue < $settlement","NUM"]]]);n("ACCRINT",sf).args([["issue","date"],["first_interest","date"],["settlement","date"],["rate","number++"],["par",["or",["null",1e3],"number++"]],["frequency",["and","integer",["values",1,2,4]]],["basis",["or",["null",0],["and","integer",["values",0,1,2,3,4]]]],["calc_method",["or","logical",["null",!0]]],["?",["assert","$issue < $settlement","NUM"]]]);n("DISC",hf).args([["settlement","date"],["maturity","date"],["pr","number++"],["redemption","number++"],["basis",["or",["null",0],["and","integer",["values",0,1,2,3,4]]]],["?",["assert","$settlement < $maturity","NUM"]]]);n("INTRATE",cf).args([["settlement","date"],["maturity","date"],["investment","number++"],["redemption","number++"],["basis",["or",["null",0],["and","integer",["values",0,1,2,3,4]]]],["?",["assert","$settlement < $maturity","NUM"]]]);n("RECEIVED",lf).args([["settlement","date"],["maturity","date"],["investment","number++"],["discount","number++"],["basis",["or",["null",0],["and","integer",["values",0,1,2,3,4]]]],["?",["assert","$settlement < $maturity","NUM"]]]);n("PRICE",af).args([["settlement","date"],["maturity","date"],["rate","number++"],["yld","number++"],["redemption","number++"],["frequency",["and","integer",["values",1,2,4]]],["basis",["or",["null",0],["and","integer",["values",0,1,2,3,4]]]],["?",["assert","$settlement < $maturity","NUM"]]]);n("PRICEDISC",vf).args([["settlement","date"],["maturity","date"],["discount","number++"],["redemption","number++"],["basis",["or",["null",0],["and","integer",["values",0,1,2,3,4]]]],["?",["assert","$settlement < $maturity","NUM"]]]);var a=300,w=22204e-20,r=1e-30,i=Math.abs}},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("spreadsheet/borderpalette",["kendo.core","kendo.colorpicker","kendo.popup"],n)}(function(){(function(n){function r(n){return function(t){return t.preventDefault(),n.apply(this,arguments)}}var u,f;if(!n.support.browser.msie||!(n.support.browser.version<9)){var t=n.jQuery,e=["allBorders","insideBorders","insideHorizontalBorders","insideVerticalBorders","outsideBorders","leftBorder","topBorder","rightBorder","bottomBorder","noBorders"],o=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"},i=n.spreadsheet.messages.colorPicker={reset:"Reset color",customColor:"Custom color...",apply:"Apply",cancel:"Cancel"};u=n.ui.Widget.extend({init:function(t,i){n.ui.Widget.call(this,t,i);this.element=t;this.color=i.color;this._resetButton();this._colorPalette();this._customColorPalette();this._customColorButton();this.resetButton.on("click",r(this.resetColor.bind(this)));this.customColorButton.on("click",r(this.customColor.bind(this)))},options:{name:"ColorChooser"},events:["change"],destroy:function(){n.unbind(this.dialog.element.find(".k-action-buttons"));this.dialog.destroy();this.colorPalette.destroy();this.resetButton.off("click");this.customColorButton.off("click")},value:function(n){if(n!==undefined)this.color=n,this.customColorButton.find(".k-icon").css("background-color",this.color),this.colorPalette.value(null),this.flatColorPicker.value(this.color);else return this.color},_change:function(n){this.color=n;this.trigger("change",{value:n})},_colorPalette:function(){var n=t("<div />",{"class":"k-spreadsheet-color-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:function(n){this.customColorButton.find(".k-icon").css("background-color","transparent");this.flatColorPicker.value(null);this._change(n.value)}.bind(this)}).data("kendoColorPalette");n.append(i.wrapper).appendTo(this.element)},_customColorPalette:function(){var e=t("<div />",{"class":"k-spreadsheet-window",html:"<div><\/div><div class='k-action-buttons'><button class='k-button k-primary' data-bind='click: apply'>"+i.apply+"<\/button><button class='k-button' data-bind='click: close'>"+i.cancel+"<\/button><\/div>"}),r=this.dialog=e.appendTo(document.body).kendoWindow({animation:!1,scrollable:!1,resizable:!1,maximizable:!1,modal:!0,visible:!1,width:268,open:function(){this.center()}}).data("kendoWindow"),u,f;r.one("activate",function(){this.element.find("[data-role=flatcolorpicker]").data("kendoFlatColorPicker")._hueSlider.resize()});u=this.flatColorPicker=r.element.children().first().kendoFlatColorPicker().data("kendoFlatColorPicker");f=n.observable({apply:function(){this.customColorButton.find(".k-icon").css("background-color",u.value());this.colorPalette.value(null);this._change(u.value());r.close()}.bind(this),close:function(){u.value(null);r.close()}});n.bind(r.element.find(".k-action-buttons"),f)},_resetButton:function(){this.resetButton=t("<a class='k-button k-reset-color' href='#'><span class='k-icon k-i-reset-color'><\/span>"+i.reset+"<\/a>").appendTo(this.element)},_customColorButton:function(){this.customColorButton=t("<a class='k-button k-custom-color' href='#'><span class='k-icon'><\/span>"+i.customColor+"<\/a>").appendTo(this.element)},resetColor:function(){this.colorPalette.value(null);this.flatColorPicker.value(null);this._change(null)},customColor:function(){this.dialog.open()}});f=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",r(this._click.bind(this)))},options:{name:"BorderPalette"},events:["change"],destroy:function(){this.colorChooser.destroy();this.element.off("click")},_borderTypePalette:function(){var i=o,r=e.map(function(t){return'<a title="'+i[t]+'" aria-label="'+i[t]+'" href="#" data-border-type="'+t+'" class="k-button k-button-icon"><span class="k-icon k-i-'+n.toHyphens(t)+'"><\/span><\/a>'}).join(""),u=t("<div />",{"class":"k-spreadsheet-border-type-palette",html:r});u.appendTo(this.element)},_borderColorPalette:function(){var n=t("<div />",{"class":"k-spreadsheet-border-color-palette"});n.appendTo(this.element);this.colorChooser=new u(n,{color:this.color,change:this._colorChange.bind(this)})},_click:function(n){this.type=t(n.currentTarget).data("borderType");this.trigger("change",{type:this.type,color:this.color})},_colorChange:function(n){this.color=n.value;this.type&&this.trigger("change",{type:this.type,color:this.color})}});n.spreadsheet.ColorChooser=u;n.spreadsheet.BorderPalette=f}})(window.kendo)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("spreadsheet/toolbar",["kendo.toolbar","kendo.colorpicker","kendo.combobox","kendo.dropdownlist","kendo.popup","spreadsheet/borderpalette"],n)}(function(){(function(n){var e,r,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,h=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",filter:"Filter",fontFamily:"Font",fontSize:"Font size",format:"Custom format...",formatTypes:{automatic:"Automatic",text:"Text",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"},open:"Open...",paste:"Paste",quickAccess:{redo:"Redo",undo:"Undo"},exportAs:"Export...",toggleGridlines:"Toggle gridlines",sort:"Sort",sortButtons:{sortRangeAsc:"Sort range A to Z",sortRangeDesc:"Sort range Z to A"},textColor:"Text Color",textWrap:"Wrap text",underline:"Underline",validation:"Data validation...",hyperlink:"Link"},c={open:{type:"open",overflow:"never",iconClass:"file-excel"},exportAs:{type:"exportAsDialog",dialogName:"exportAs",overflow:"never",text:"",iconClass:"file-excel"},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:"decimal-decrease"},formatIncreaseDecimal:{type:"button",command:"AdjustDecimalsCommand",value:1,iconClass:"decimal-increase"},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:"align-left"},backgroundColor:{type:"colorPicker",property:"background",iconClass:"paint"},textColor:{type:"colorPicker",property:"color",iconClass:"foreground-color"},fontFamily:{type:"fontFamily",property:"fontFamily",iconClass:"font-family"},fontSize:{type:"fontSize",property:"fontSize",iconClass:"font-size"},format:{type:"format",property:"format",iconClass:"custom-format"},filter:{type:"filter",property:"hasFilter",iconClass:"filter"},merge:{type:"merge",iconClass:"cells-merge"},freeze:{type:"freeze",iconClass:"pane-freeze"},borders:{type:"borders",iconClass:"borders-all"},formatCells:{type:"dialog",dialogName:"formatCells",overflow:"never"},hyperlink:{type:"dialog",dialogName:"hyperlink",iconClass:"link-horizontal",overflow:"never",text:""},toggleGridlines:{type:"button",command:"GridLinesChangeCommand",property:"gridLines",value:!0,iconClass:"border-no",togglable:!0},addColumnLeft:{type:"button",command:"AddColumnCommand",value:"left",iconClass:"table-column-insert-left"},addColumnRight:{type:"button",command:"AddColumnCommand",value:"right",iconClass:"table-column-insert-right"},addRowBelow:{type:"button",command:"AddRowCommand",value:"below",iconClass:"table-row-insert-below"},addRowAbove:{type:"button",command:"AddRowCommand",value:"above",iconClass:"table-row-insert-above"},deleteColumn:{type:"button",command:"DeleteColumnCommand",iconClass:"table-column-delete"},deleteRow:{type:"button",command:"DeleteRowCommand",iconClass:"table-row-delete"},sort:{type:"sort",iconClass:"sort-desc"},validation:{type:"dialog",dialogName:"validation",iconClass:"exception",overflow:"never"}},l=h.extend({init:function(n,t){var r,u;t.items=this._expandTools(t.tools||l.prototype.options.tools[t.toolbarName]);h.fn.init.call(this,n,t);r=this._click.bind(this);this.element.addClass("k-spreadsheet-toolbar");this._addSeparators(this.element);u=this;this.element.on("keydown",function(n){var t;n.keyCode===9&&(t=u._nextTool(n.shiftKey?-1:1),t&&(document.activeElement.blur(),i(t).is(".k-upload-button")&&i(t).addClass("k-state-focused"),i(t).find("input").length?i(t).find("input").focus():t.focus(),n.preventDefault()))});this.element.on("focusout",function(){i(this).find(".k-toolbar-first-visible").removeClass("k-state-focused")});this.bind({click:r,toggle:r})},_nextTool:function(n){var r=this,t=r.element.find(".k-widget, .k-button, .k-button-group > a"),i=t.index(document.activeElement.closest(".k-widget, .k-button, .k-button-group > a"));if(i>0)return t[i+n]},_addSeparators:function(n){var t=n.children(".k-widget, a.k-button, .k-button-group");t.before("<span class='k-separator' />")},_expandTools:function(n){function r(n){var u=i.isPlainObject(n)?n:c[n]||{},f="k-icon k-i-"+u.iconClass,o=u.type,s={button:{showText:"overflow"},colorPicker:{toolIcon:f,spriteCssClass:f},borders:{spriteCssClass:f},alignment:{spriteCssClass:f},merge:{spriteCssClass:f},freeze:{spriteCssClass:f}},e=i.extend({name:u.name||n,text:t[u.name||n],icon:u.iconClass,attributes:{title:t[u.name||n],"aria-label":t[u.name||n]}},s[o],u);return o=="splitButton"&&(e.menuButtons=e.menuButtons.map(r)),e.attributes["data-tool"]=n,u.property&&(e.attributes["data-property"]=u.property),e}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=c[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:["open","exportAs",["cut","copy","paste"],["bold","italic","underline"],"hyperlink","backgroundColor","textColor","borders","fontSize","fontFamily","alignment","textWrap",["formatDecreaseDecimal","formatIncreaseDecimal"],"format","merge","freeze","filter","toggleGridlines"],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 i=t,u=this._tools(),r=0;r<u.length;r++){var f=u[r].property,e=u[r].tool,o=n.isFunction(i[f])?i[f]():i;f=="gridLines"&&(o=i.sheet().showGridLines());e.type==="button"?s(e,o):h(e,o)}this.resize()},_tools:function(){return this.element.find("[data-property]").toArray().map(function(n){return n=i(n),{property:n.attr("data-property"),tool:this._getItem(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()});h.fn.destroy.call(this)}});n.spreadsheet.ToolBar=l;e=n.toolbar.Item.extend({init:function(n,t){var r=i("<select />").attr("title",n.attributes.title).attr("aria-label",n.attributes.title).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-60-down'><\/span><\/a>");this.element.on("click touchend",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(n){n.preventDefault();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 touchend",this.open.bind(this)).data("instance",this)},open:function(){this.toolbar.dialog({name:this._dialogName})}}));n.toolbar.registerComponent("exportAsDialog",n.toolbar.Item.extend({init:function(n,t){this._dialogName=n.dialogName;this.toolbar=t;this._title=n.attributes.title;this.element=i("<button class='k-button k-button-icon'><span class='k-icon k-i-download' /><\/button>").attr("title",this._title).attr("aria-label",this._title).data("instance",this);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 touchend",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(t,i){r.fn.init.call(this,t,i);this.popup.element.addClass("k-spreadsheet-colorpicker");this.colorChooser=new n.spreadsheet.ColorChooser(this.popup.element,{change:this._colorChange.bind(this)});this.element.attr({"data-property":t.property});this.element.data({type:"colorPicker",colorPicker:this,instance:this})},destroy:function(){this.colorChooser.destroy();r.fn.destroy.call(this)},update:function(n){this.value(n)},value:function(n){this.colorChooser.value(n)},_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 a=[8,9,10,11,12,13,14,16,18,20,22,24,26,28,36,48,72],o=12,st=n.toolbar.Item.extend({init:function(n,t){var r=i("<input />").attr("aria-label",n.attributes.title).kendoComboBox({change:this._valueChange.bind(this),clearButton:!1,dataSource:n.fontSizes||a,value:o}).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)||o)},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:a,defaultSize:o}})},update:function(n){this._value=n||o;this.element.find(".k-text").text(this.message+" ("+this._value+") ...")}});n.toolbar.registerComponent("fontSize",st,ht);var v=["Arial","Courier New","Georgia","Times New Roman","Trebuchet MS","Verdana"],s="Arial",ct=e.extend({init:function(n,t){e.fn.init.call(this,n,t);var i=this.dropDownList;i.setDataSource(n.fontFamilies||v);i.value(s);this.element.data({type:"fontFamily",fontFamily:this})},update:function(n){this.value(n||s)}}),lt=u.extend({_click:function(){this.toolbar.dialog({name:"fontFamily",options:{fonts:v,defaultFont:s}})},update:function(n){this._value=n||s;this.element.find(".k-text").text(this.message+" ("+this._value+") ...")}});n.toolbar.registerComponent("fontFamily",ct,lt);var f=n.spreadsheet.formats={automatic:null,text:"@",number:"#,0.00",percent:"0.00%",financial:'_("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(@_)',currency:"$#,##0.00;[Red]$#,##0.00",date:"m/d/yyyy",time:"h:mm:ss AM/PM",dateTime:"m/d/yyyy h:mm",duration:"[h]:mm:ss"},at=e.extend({_revertTitle:function(n){n.sender.value("");n.sender.wrapper.width("auto")},init:function(n,i){e.fn.init.call(this,n,i);var r=this.dropDownList,u="<span class='k-icon k-i-"+n.iconClass+"' style='line-height: 1em; width: 1.35em;'><\/span>";r.bind("change",this._revertTitle.bind(this));r.bind("dataBound",this._revertTitle.bind(this));r.setOptions({dataValueField:"format",dataTextField:"name",dataValuePrimitive:!0,valueTemplate:u,template:"# if (data.sample) { #<span class='k-spreadsheet-sample'>#: data.sample #<\/span># } ##: data.name #"});r.text(u);r.setDataSource([{format:f.automatic,name:t.formatTypes.automatic},{format:f.text,name:t.formatTypes.text},{format:f.number,name:t.formatTypes.number,sample:"1,499.99"},{format:f.percent,name:t.formatTypes.percent,sample:"14.50%"},{format:f.financial,name:t.formatTypes.financial,sample:"(1,000.12)"},{format:f.currency,name:t.formatTypes.currency,sample:"$1,499.99"},{format:f.date,name:t.formatTypes.date,sample:"4/21/2012"},{format:f.time,name:t.formatTypes.time,sample:"5:49:00 PM"},{format:f.dateTime,name:t.formatTypes.dateTime,sample:"4/21/2012 5:49:00"},{format:f.duration,name:t.formatTypes.duration,sample:"168:05:00"},{popup:"formatCells",name:t.formatTypes.moreFormats}]);this.element.data({type:"format",format:this})}}),vt=u.extend({_click:function(){this.toolbar.dialog({name:"formatCells"})}});n.toolbar.registerComponent("format",at,vt);y=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}}})}});p=u.extend({_click:function(){this.toolbar.dialog({name:"borders"})}});n.toolbar.registerComponent("borders",y,p);w=r.extend({init:function(n,t){r.fn.init.call(this,n,t);this.element.attr({"data-property":"alignment"});this._defineButtons();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})},_defineButtons:function(){this.buttons=[{property:"textAlign",value:"left",iconClass:"align-left",text:t.alignmentButtons.justtifyLeft},{property:"textAlign",value:"center",iconClass:"align-center",text:t.alignmentButtons.justifyCenter},{property:"textAlign",value:"right",iconClass:"align-right",text:t.alignmentButtons.justifyRight},{property:"textAlign",value:"justify",iconClass:"align-justify",text:t.alignmentButtons.justifyFull},{property:"verticalAlign",value:"top",iconClass:"align-top",text:t.alignmentButtons.alignTop},{property:"verticalAlign",value:"center",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 i=n.textAlign(),r=n.verticalAlign(),t=this.popup.element;t.find(".k-button").removeClass("k-state-active");i&&t.find("[data-property=textAlign][data-value="+i+"]").addClass("k-state-active");r&&t.find("[data-property=verticalAlign][data-value="+r+"]").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-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}})}});b=u.extend({_click:function(){this.toolbar.dialog({name:"alignment"})}});n.toolbar.registerComponent("alignment",w,b);k=r.extend({init:function(n,t){r.fn.init.call(this,n,t);this._defineButtons();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})},_defineButtons:function(){this.buttons=[{value:"cells",iconClass:"cells-merge",text:t.mergeButtons.mergeCells},{value:"horizontally",iconClass:"cells-merge-horizontally",text:t.mergeButtons.mergeHorizontally},{value:"vertically",iconClass:"cells-merge-vertically",text:t.mergeButtons.mergeVertically},{value:"unmerge",iconClass:"table-unmerge",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-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}})}});d=u.extend({_click:function(){this.toolbar.dialog({name:"merge"})}});n.toolbar.registerComponent("merge",k,d);g=r.extend({init:function(n,t){r.fn.init.call(this,n,t);this._defineButtons();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})},_defineButtons:function(){this.buttons=[{value:"panes",iconClass:"pane-freeze",text:t.freezeButtons.freezePanes},{value:"rows",iconClass:"row-freeze",text:t.freezeButtons.freezeRows},{value:"columns",iconClass:"column-freeze",text:t.freezeButtons.freezeColumns},{value:"unfreeze",iconClass:"table-unmerge",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-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}})}});nt=u.extend({_click:function(){this.toolbar.dialog({name:"freeze"})}});n.toolbar.registerComponent("freeze",g,nt);tt=e.extend({_revertTitle:function(n){n.sender.value("");n.sender.wrapper.width("auto")},init:function(n,i){e.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-i-"+n.iconClass+"' style='line-height: 1em; width: 1.35em;'><\/span>",template:"<span class='k-icon k-i-#= iconClass #' style='line-height: 1em; width: 1.35em;'><\/span>#=text#",dataTextField:"text",dataValueField:"value"});r.setDataSource([{value:"asc",sheet:!1,text:t.sortButtons.sortRangeAsc,iconClass:"sort-asc"},{value:"desc",sheet:!1,text:t.sortButtons.sortRangeDesc,iconClass:"sort-desc"}]);r.select(0);this.element.data({type:"sort",sort:this})},_change:function(n){var i=n.sender,t=i.dataItem();t&&this.toolbar.action({command:"SortCommand",options:{value:t.value,sheet:t.sheet}})},value:i.noop});it=u.extend({_click:function(){this.toolbar.dialog({name:"sort"})}});n.toolbar.registerComponent("sort",tt,it);rt=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)}});ut=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",rt,ut);ft=n.toolbar.Item.extend({init:function(n,t){this.toolbar=t;this.element=i("<div class='k-button k-upload-button k-button-icon'><span class='k-icon k-i-folder-open' /><\/div>").data("instance",this);this._title=n.attributes.title;this._reset()},_reset:function(){this.element.remove("input");i("<input type='file' autocomplete='off' accept='.xlsx'/>").attr("title",this._title).attr("aria-label",this._title).one("change",this._change.bind(this)).appendTo(this.element)},_change:function(n){this.toolbar.action({command:"OpenCommand",options:{file:n.target.files[0]}});this._reset()}});n.toolbar.registerComponent("open",ft);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.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",action:"undo"},{title:t.quickAccess.redo,iconClass:"redo",action:"redo"}],u=n.template("<a href='\\#' title='#= title #' data-action='#= action #' class='k-button k-button-icon' aria-label='#= title #'><span class='k-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){n.preventDefault();var t=i(n.currentTarget).attr("data-action");this.action({action:t})}.bind(this));this.quickAccessAdjust()},quickAccessAdjust:function(){this.tabGroup.css("padding-left",n._outerWidth(this.quickAccessToolBar))},_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)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("spreadsheet/dialogs",["kendo.core","kendo.binder","kendo.validator"],n)}(function(){(function(n){function l(t,i){return n.spreadsheet.formatting.text(t,i)}function v(n,t){for(var u=[],f=[],r=0;r<t.length;r++)i.inArray(t[r][n],f)==-1&&(u.push(t[r]),f.push(t[r][n]));return u}function u(t,i){n.spreadsheet.dialogs.register(t,o.extend({options:{messageId:i}}))}var t,f,e,o,y,p,w,b,k,s,d,g,nt,tt,it,rt,a,ut,ft,et,ot;if(!n.support.browser.msie||!(n.support.browser.version<9)){var i=n.jQuery,h=n.data.ObservableObject,r=n.spreadsheet.messages.dialogs={apply:"Apply",save:"Save",cancel:"Cancel",remove:"Remove",retry:"Retry",revert:"Revert",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"}},confirmationDialog:{text:"Are you sure you want to remove this sheet?",title:"Sheet remove"},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",ignoreBlank:"Ignore blank",showListButton:"Display button to show list",showCalendarButton:"Display button to show calendar"},placeholders:{typeTitle:"Type title",typeMessage:"Type message"}},exportAsDialog:{title:"Export...",labels:{scale:"Scale",fit:"Fit to page",fileName:"File name",saveAsType:"Save as type",exportArea:"Export",paperSize:"Paper size",margins:"Margins",orientation:"Orientation",print:"Print",guidelines:"Guidelines",center:"Center",horizontally:"Horizontally",vertically:"Vertically"}},modifyMergedDialog:{errorMessage:"Cannot change part of a merged cell."},rangeDisabledDialog:{errorMessage:"Destination range contains disabled cells."},incompatibleRangesDialog:{errorMessage:"Incompatible ranges"},noFillDirectionDialog:{errorMessage:"Cannot determine fill direction"},duplicateSheetNameDialog:{errorMessage:"Duplicate sheet name"},overflowDialog:{errorMessage:"Cannot paste, because the copy area and the paste area are not the same size and shape."},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."},linkDialog:{title:"Hyperlink",labels:{text:"Text",url:"Address",removeLink:"Remove link"}}},c={};n.spreadsheet.dialogs={register:function(n,t){c[n]=t},registered:function(n){return!!c[n]},create:function(n,t){var i=c[n];if(i)return new i(t)}};t=n.spreadsheet.SpreadsheetDialog=n.Observable.extend({init:function(t){n.Observable.fn.init.call(this,t);this.options=i.extend(!0,{},this.options,t);this.bind(this.events,t)},events:["close","activate"],options:{autoFocus:!0},dialog:function(){return this._dialog||(this._dialog=i("<div class='k-spreadsheet-window k-action-window k-popup-edit-form' />").addClass(this.options.className||"").append(n.template(this.options.template)({messages:n.spreadsheet.messages.dialogs||r,errors:this.options.errors})).appendTo(document.body).kendoWindow({autoFocus:!1,scrollable:!1,resizable:!1,modal:!0,visible:!1,width:this.options.width||320,title:this.options.title,open:function(){this.center()},close:this._onDialogClose.bind(this),activate:this._onDialogActivate.bind(this),deactivate:this._onDialogDeactivate.bind(this)}).data("kendoWindow")),this._dialog},_onDialogClose:function(){this.trigger("close",{action:this._action})},_onDialogActivate:function(){this.trigger("activate")},_onDialogDeactivate:function(){this.trigger("deactivate");this.destroy()},destroy:function(){this._dialog&&(this._dialog.destroy(),this._dialog=null)},open:function(){this.dialog().open();this.dialog().element.find(".k-primary").focus()},apply:function(){this.close()},close:function(){this._action="close";this.dialog().close()}});f=n.spreadsheet.FormatCellsViewModel=h.extend({init:function(n){h.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=f.convert.currency(n),{value:n,name:l(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?l(t,n):t}});f.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,'"')}};e=t.extend({init:function(u){var f=n.spreadsheet.messages.dialogs.formatCellsDialog||r,e={title:f.title,categories:[{type:"number",name:f.categories.number},{type:"currency",name:f.categories.currency},{type:"date",name:f.categories.date}]};t.fn.init.call(this,i.extend(e,u));this._generateFormats()},options:{className:"k-spreadsheet-format-cells",template:"<div class='k-edit-form-container'><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'>#: messages.apply #<\/button><button class='k-button' data-bind='click: close'>#: messages.cancel #<\/button><\/div><\/div>"},_generateFormats:function(){var t=this.options,r;t.currencies||(t.currencies=e.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||(r=n.cultures.current.calendars.standard.patterns,t.dateFormats=v("value",i.map(r,function(n){if(n=f.convert.date(n),n)return{value:n,name:l(34567.7678,n)}})))},open:function(i){var r=this.options,o=i.value(),e=r.categories.slice(0),u,s;this.viewModel=new f({currencies:r.currencies.slice(0),allFormats:{numberFormats:r.numberFormats.slice(0),dateFormats:r.dateFormats.slice(0)},categories:e,format:i.format(),category:o instanceof Date?e[2]:e[0],apply:this.apply.bind(this),close:this.close.bind(this),value:o});t.fn.open.call(this);u=this.dialog().element;n.bind(u,this.viewModel);s=u.find("select.k-format-filter").data("kendoDropDownList");r.currencies.length>10&&s.setOptions({filter:"contains"});u.find(n.roleSelector("staticlist")).parent().addClass("k-list-wrapper")},apply:function(){var n=this.viewModel.format;t.fn.apply.call(this);this.trigger("action",{command:"PropertyChangeCommand",options:{property:"format",value:n}})}});e.currenciesFrom=function(t){return v("description",i.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",e);n.spreadsheet.dialogs.FormatCellsDialog=e;o=t.extend({options:{className:"k-spreadsheet-message",title:"",messageId:"",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'>#= messages.okText #<\/button><\/div>"},open:function(){t.fn.open.call(this);var i=this.options,r=i.text;i.messageId&&(r=n.getter(i.messageId,!0)(n.spreadsheet.messages.dialogs));n.bind(this.dialog().element,{text:r,close:this.close.bind(this)})}});n.spreadsheet.dialogs.register("message",o);y=t.extend({init:function(u){var f=n.spreadsheet.messages.dialogs.confirmationDialog||r,e={title:f.title,text:f.text};t.fn.init.call(this,i.extend(e,u))},options:{className:"k-spreadsheet-message",messageId:"",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: confirm'>#= messages.okText #<\/button><button class='k-button' data-bind='click: cancel'>#= messages.cancel #<\/button><\/div>"},open:function(){t.fn.open.call(this);var i=this.options,r=i.text;i.messageId&&(r=n.getter(i.messageId,!0)(n.spreadsheet.messages.dialogs));n.bind(this.dialog().element,{text:r,confirm:this.confirm.bind(this),cancel:this.close.bind(this)})},isConfirmed:function(){return this._confirmed},confirm:function(){this._confirmed=!0;this.close()}});n.spreadsheet.dialogs.register("confirmation",y);p=t.extend({options:{className:"k-spreadsheet-message",title:"",messageId:"",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: retry'>#= messages.retry #<\/button><button class='k-button' data-bind='click: cancel'>#= messages.cancel #<\/button><\/div>"},open:function(){t.fn.open.call(this);var i=this.options,r=i.text;i.messageId&&(r=n.getter(i.messageId,!0)(n.spreadsheet.messages.dialogs));n.bind(this.dialog().element,{text:r,retry:this.retry.bind(this),cancel:this.close.bind(this)})},retry:function(){this._retry=!0;this.close()}});n.spreadsheet.dialogs.register("validationError",p);w=t.extend({init:function(u){var f=n.spreadsheet.messages.dialogs.fontFamilyDialog||r;t.fn.init.call(this,i.extend({title:f.title},u));this._list()},options:{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){t.fn.apply.call(this);this.trigger("action",{command:"PropertyChangeCommand",options:{property:"fontFamily",value:n.sender.value()[0]}})}});n.spreadsheet.dialogs.register("fontFamily",w);b=t.extend({init:function(u){var f=n.spreadsheet.messages.dialogs.fontSizeDialog||r;t.fn.init.call(this,i.extend({title:f.title},u));this._list()},options:{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(i){t.fn.apply.call(this);this.trigger("action",{command:"PropertyChangeCommand",options:{property:"fontSize",value:n.parseInt(i.sender.value()[0])}})}});n.spreadsheet.dialogs.register("fontSize",b);k=t.extend({init:function(u){var f=n.spreadsheet.messages.dialogs.bordersDialog||r;t.fn.init.call(this,i.extend({title:f.title},u));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:{width:177,template:"<div><\/div><div class='k-action-buttons'><button class='k-button k-primary' data-bind='click: apply'>#: messages.apply #<\/button><button class='k-button' data-bind='click: close'>#: messages.cancel #<\/button><\/div>"},apply:function(){t.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",k);s=t.extend({init:function(i){t.fn.init.call(this,i);this.element=this.dialog().element;this.property=i.property;this.options.title=i.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:{template:"<div><\/div><div class='k-action-buttons'><button class='k-button k-primary' data-bind='click: apply'>#: messages.apply #<\/button><button class='k-button' data-bind='click: close'>#: messages.cancel #<\/button><\/div>"},apply:function(){t.fn.apply.call(this);this.trigger("action",{command:"PropertyChangeCommand",options:{property:this.property,value:this.value()}})},value:function(n){if(n===undefined)return this._value;this._value=n.value}});d=s.extend({init:function(n){n.width=177;s.fn.init.call(this,n);this._colorPalette()},_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")}});n.spreadsheet.dialogs.register("colorPicker",d);g=s.extend({init:function(n){n.width=268;s.fn.init.call(this,n);this.dialog().setOptions({animation:!1});this.dialog().one("activate",this._colorPicker.bind(this))},_colorPicker:function(){var n=this.dialog().element.find("div:first");this.colorPicker=n.kendoFlatColorPicker({change:this.value.bind(this)}).data("kendoFlatColorPicker")}});n.spreadsheet.dialogs.register("customColor",g);nt=t.extend({init:function(u){var f=n.spreadsheet.messages.dialogs.alignmentDialog||r,e={title:f.title,buttons:[{property:"textAlign",value:"left",iconClass:"align-left",text:f.buttons.justtifyLeft},{property:"textAlign",value:"center",iconClass:"align-center",text:f.buttons.justifyCenter},{property:"textAlign",value:"right",iconClass:"align-right",text:f.buttons.justifyRight},{property:"textAlign",value:"justify",iconClass:"align-justify",text:f.buttons.justifyFull},{property:"verticalAlign",value:"top",iconClass:"align-top",text:f.buttons.alignTop},{property:"verticalAlign",value:"center",iconClass:"align-middle",text:f.buttons.alignMiddle},{property:"verticalAlign",value:"bottom",iconClass:"align-bottom",text:f.buttons.alignBottom}]};t.fn.init.call(this,i.extend(e,u));this._list()},options:{template:"<ul class='k-list k-reset'><\/ul>"},_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-i-#=iconClass#'><\/span>#=text#<\/a>",change:this.apply.bind(this)});this.list.dataSource.fetch()},apply:function(n){var i=n.sender.value()[0];t.fn.apply.call(this);this.trigger("action",{command:"PropertyChangeCommand",options:{property:i.property,value:i.value}})}});n.spreadsheet.dialogs.register("alignment",nt);tt=t.extend({init:function(u){var f=n.spreadsheet.messages.dialogs.mergeDialog||r,e={title:f.title,buttons:[{value:"cells",iconClass:"cells-merge",text:f.buttons.mergeCells},{value:"horizontally",iconClass:"cells-merge-horizontally",text:f.buttons.mergeHorizontally},{value:"vertically",iconClass:"cells-merge-vertically",text:f.buttons.mergeVertically},{value:"unmerge",iconClass:"table-unmerge",text:f.buttons.unmerge}]};t.fn.init.call(this,i.extend(e,u));this._list()},options:{template:"<ul class='k-list k-reset'><\/ul>"},_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-icon k-i-#=iconClass#'><\/span>#=text#<\/a>",change:this.apply.bind(this)});this.list.dataSource.fetch()},apply:function(n){var i=n.sender.value()[0];t.fn.apply.call(this);this.trigger("action",{command:"MergeCellCommand",options:{value:i.value}})}});n.spreadsheet.dialogs.register("merge",tt);it=t.extend({init:function(u){var f=n.spreadsheet.messages.dialogs.freezeDialog||r,e={title:f.title,buttons:[{value:"panes",iconClass:"pane-freeze",text:f.buttons.freezePanes},{value:"rows",iconClass:"row-freeze",text:f.buttons.freezeRows},{value:"columns",iconClass:"column-freeze",text:f.buttons.freezeColumns},{value:"unfreeze",iconClass:"table-unmerge",text:f.buttons.unfreeze}]};t.fn.init.call(this,i.extend(e,u));this._list()},options:{template:"<ul class='k-list k-reset'><\/ul>"},_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-icon k-i-#=iconClass#'><\/span>#=text#<\/a>",change:this.apply.bind(this)});this.list.dataSource.fetch()},apply:function(n){var i=n.sender.value()[0];t.fn.apply.call(this);this.trigger("action",{command:"FreezePanesCommand",options:{value:i.value}})}});n.spreadsheet.dialogs.register("freeze",it);rt=n.spreadsheet.ValidationCellsViewModel=h.extend({init:function(n){h.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"},showToForNumber:function(){return this.showTo()&&this.isNumber()},showToForDate:function(){return this.showTo()&&this.isDate()},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);this.set("ignoreBlank",n.allowNulls);this.set("showButton",n.showButton);n.messageTemplate||n.titleTemplate?(this.hintMessageTemplate=n.messageTemplate,this.hintMessage=n.messageTemplate,this.hintTitleTemplate=n.titleTemplate,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,allowNulls:this.ignoreBlank,showButton:this.showButton};return this.useCustomMessages&&(n.messageTemplate=this.shouldBuild?this.hintMessageTemplate:this.hintMessage,n.titleTemplate=this.hintTitle),n}});a=t.extend({init:function(u){var f=n.spreadsheet.messages.dialogs.validationDialog||r,e={title:f.title,hintMessage:f.hintMessage,hintTitle:f.hintTitle,criteria:[{type:"any",name:f.criteria.any},{type:"number",name:f.criteria.number},{type:"text",name:f.criteria.text},{type:"date",name:f.criteria.date},{type:"custom",name:f.criteria.custom},{type:"list",name:f.criteria.list}],comparers:[{type:"greaterThan",name:f.comparers.greaterThan},{type:"lessThan",name:f.comparers.lessThan},{type:"between",name:f.comparers.between},{type:"notBetween",name:f.comparers.notBetween},{type:"equalTo",name:f.comparers.equalTo},{type:"notEqualTo",name:f.comparers.notEqualTo},{type:"greaterThanOrEqualTo",name:f.comparers.greaterThanOrEqualTo},{type:"lessThanOrEqualTo",name:f.comparers.lessThanOrEqualTo}],comparerMessages:f.comparerMessages};t.fn.init.call(this,i.extend(e,u))},options:{width:450,criterion:"any",type:"reject",ignoreBlank:!0,showButton:!0,useCustomMessages:!1,errorTemplate:'<div class="k-widget k-tooltip k-tooltip-validation" style="margin:0.5em"><span class="k-icon k-i-warning"> <\/span>#= message #<div class="k-callout k-callout-n"><\/div><\/div>',template:'<div class="k-edit-form-container"><div class="k-edit-label"><label>#: messages.validationDialog.labels.criteria #:<\/label><\/div><div class="k-edit-field"><select data-role="dropdownlist" title="#: messages.validationDialog.labels.criteria #"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>#: messages.validationDialog.labels.comparer #:<\/label><\/div><div class="k-edit-field"><select data-role="dropdownlist" title="#: messages.validationDialog.labels.comparer #"data-text-field="name" data-value-field="type" data-bind="value: comparer, source: comparers" /><\/div><div class="k-edit-label"><label>#: messages.validationDialog.labels.min #:<\/label><\/div><div class="k-edit-field"><input name="#: messages.validationDialog.labels.min #" title="#: messages.validationDialog.labels.min #" placeholder="e.g. 10" class="k-textbox" data-bind="value: from, enabled: isNumber" required="required" /><\/div><div data-bind="visible: showTo"><div class="k-edit-label"><label>#: messages.validationDialog.labels.max #:<\/label><\/div><div class="k-edit-field"><input name="#: messages.validationDialog.labels.max #" title="#: messages.validationDialog.labels.max #" placeholder="e.g. 100" class="k-textbox" data-bind="value: to, enabled: showToForNumber" required="required" /><\/div><\/div><\/div><div data-bind="visible: isText"><div class="k-edit-label"><label>#: messages.validationDialog.labels.comparer #:<\/label><\/div><div class="k-edit-field"><select data-role="dropdownlist" title="#: messages.validationDialog.labels.comparer #"data-text-field="name" data-value-field="type" data-bind="value: comparer, source: comparers" /><\/div><div class="k-edit-label"><label>#: messages.validationDialog.labels.value #:<\/label><\/div><div class="k-edit-field"><input name="#: messages.validationDialog.labels.value #" title="#: messages.validationDialog.labels.value #" class="k-textbox" data-bind="value: from, enabled: isText" required="required" /><\/div><\/div><div data-bind="visible: isDate"><div class="k-edit-label"><label>#: messages.validationDialog.labels.comparer #:<\/label><\/div><div class="k-edit-field"><select data-role="dropdownlist" title="#: messages.validationDialog.labels.comparer #"data-text-field="name" data-value-field="type" data-bind="value: comparer, source: comparers" /><\/div><div class="k-edit-label"><label>#: messages.validationDialog.labels.start #:<\/label><\/div><div class="k-edit-field"><input name="#: messages.validationDialog.labels.start #" title="#: messages.validationDialog.labels.start #" class="k-textbox" data-bind="value: from, enabled: isDate" required="required" /><\/div><div data-bind="visible: showTo"><div class="k-edit-label"><label>#: messages.validationDialog.labels.end #:<\/label><\/div><div class="k-edit-field"><input name="#: messages.validationDialog.labels.end #" title="#: messages.validationDialog.labels.end #" class="k-textbox" data-bind="value: to, enabled: showToForDate" required="required" /><\/div><\/div><\/div><div data-bind="visible: isCustom"><div class="k-edit-label"><label>#: messages.validationDialog.labels.value #:<\/label><\/div><div class="k-edit-field"><input name="#: messages.validationDialog.labels.value #" title="#: messages.validationDialog.labels.value #" class="k-textbox" data-bind="value: from, enabled: isCustom" required="required" /><\/div><\/div><div data-bind="visible: isList"><div class="k-edit-label"><label>#: messages.validationDialog.labels.value #:<\/label><\/div><div class="k-edit-field"><input name="#: messages.validationDialog.labels.value #" title="#: messages.validationDialog.labels.value #" class="k-textbox" data-bind="value: from, enabled: isList" required="required" /><\/div><\/div><div data-bind="visible: isList"><div class="k-edit-field"><input type="checkbox" name="showButton" id="listShowButton" class="k-checkbox" data-bind="checked: showButton"/><label for="listShowButton" class="k-checkbox-label"> #: messages.validationDialog.labels.showListButton #<\/label><\/div><\/div><div data-bind="visible: isDate"><div class="k-edit-field"><input type="checkbox" name="showButton" id="dateShowButton" class="k-checkbox" data-bind="checked: showButton"/><label for="dateShowButton" class="k-checkbox-label"> #: messages.validationDialog.labels.showCalendarButton #<\/label><\/div><\/div><div data-bind="invisible: isAny"><div class="k-edit-field"><input type="checkbox" title="#: messages.validationDialog.labels.ignoreBlank #" name="ignoreBlank" id="ignoreBlank" class="k-checkbox" data-bind="checked: ignoreBlank"/><label for="ignoreBlank" class="k-checkbox-label"> #: messages.validationDialog.labels.ignoreBlank #<\/label><\/div><\/div><div data-bind="invisible: isAny"><div class="k-hr"><\/div><div class="k-edit-label"><label>#: messages.validationDialog.labels.onInvalidData #:<\/label><\/div><div class="k-edit-field"><input type="radio" title="#: messages.validationDialog.labels.rejectInput #" id="validationTypeReject" name="validationType" value="reject" data-bind="checked: type" class="k-radio" /><label for="validationTypeReject" class="k-radio-label">#: messages.validationDialog.labels.rejectInput #<\/label> <input type="radio" title="#: messages.validationDialog.labels.showWarning #" id="validationTypeWarning"  name="validationType" value="warning" data-bind="checked: type" class="k-radio" /><label for="validationTypeWarning" class="k-radio-label">#: messages.validationDialog.labels.showWarning #<\/label><\/div><\/div><div data-bind="invisible: isAny" class="hint-wrapper"><div class="k-edit-field"><input type="checkbox" title="#: messages.validationDialog.labels.showHint #" name="useCustomMessages" id="useCustomMessages" class="k-checkbox" data-bind="checked: useCustomMessages" /><label class="k-checkbox-label" for="useCustomMessages"> #: messages.validationDialog.labels.showHint #<\/label><\/div><div data-bind="visible: useCustomMessages"><div class="k-edit-label"><label>#: messages.validationDialog.labels.hintTitle #:<\/label><\/div><div class="k-edit-field"><input class="k-textbox" title="#: messages.validationDialog.labels.hintTitle #" placeholder="#: messages.validationDialog.placeholders.typeTitle #" data-bind="value: hintTitle" /><\/div><div class="k-edit-label"><label>#: messages.validationDialog.labels.hintMessage #:<\/label><\/div><div class="k-edit-field"><input class="k-textbox" title="#: messages.validationDialog.labels.hintMessage #" placeholder="#: messages.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">#: messages.remove #<\/button><button class="k-button k-primary" data-bind="click: apply">#: messages.apply #<\/button><button class="k-button" data-bind="click: close">#: messages.cancel #<\/button><\/div><\/div>'},open:function(i){var r=this.options,u;this.viewModel=new rt({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,ignoreBlank:r.ignoreBlank,showButton:r.showButton,apply:this.apply.bind(this),close:this.close.bind(this),remove:this.remove.bind(this)});this.viewModel.update(i.validation());t.fn.open.call(this);u=this.dialog().element;this.validatable&&this.validatable.destroy();n.bind(u,this.viewModel);this.validatable=new n.ui.Validator(u.find(".k-edit-form-container"),{validateOnBlur:!1,errorTemplate:this.options.errorTemplate||undefined})},apply:function(){this.validatable.validate()&&(t.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",a);n.spreadsheet.dialogs.ValidationDialog=a;ut=t.extend({init:function(u){var e=n.spreadsheet.messages.dialogs.exportAsDialog||r,f;t.fn.init.call(this,i.extend({title:e.title},u));this.viewModel=n.observable({title:this.options.title,name:this.options.name,extension:this.options.extension,fileFormats:this.options.fileFormats,excel:u.excelExport,pdf:{proxyURL:u.pdfExport.proxyURL,forceProxy:u.pdfExport.forceProxy,title:u.pdfExport.title,author:u.pdfExport.author,subject:u.pdfExport.subject,keywords:u.pdfExport.keywords,creator:u.pdfExport.creator,date:u.pdfExport.date,fitWidth:this.options.pdf.fitWidth,area:this.options.pdf.area,areas:this.options.pdf.areas,paperSize:this.options.pdf.paperSize,paperSizes:this.options.pdf.paperSizes,margin:this.options.pdf.margin,margins:this.options.pdf.margins,landscape:this.options.pdf.landscape,guidelines:this.options.pdf.guidelines,hCenter:this.options.pdf.hCenter,vCenter:this.options.pdf.vCenter},apply:this.apply.bind(this),close:this.close.bind(this)});f=this.dialog();this.viewModel.bind("change",function(n){n.field==="extension"&&(this.set("showPdfOptions",this.extension===".pdf"?!0:!1),f.center())});n.bind(f.element,this.viewModel)},options:{name:"Workbook",extension:".xlsx",fileFormats:[{description:"Excel Workbook (.xlsx)",extension:".xlsx"},{description:"Portable Document Format(.pdf)",extension:".pdf"}],pdf:{fitWidth:!0,area:"workbook",areas:[{area:"workbook",text:"Entire Workbook"},{area:"sheet",text:"Active Sheet"},{area:"selection",text:"Selection"}],paperSize:"a4",paperSizes:[{value:"a2",text:"A2 (420 mm × 594 mm)     "},{value:"a3",text:"A3 (297 mm x 420 mm)     "},{value:"a4",text:"A4 (210 mm x 297 mm)     "},{value:"a5",text:"A5 (148 mm x 210 mm)     "},{value:"b3",text:"B3 (353 mm × 500 mm)     "},{value:"b4",text:"B4 (250 mm x 353 mm)     "},{value:"b5",text:"B5 (176 mm x 250 mm)     "},{value:"folio",text:'Folio (8.5" x 13")       '},{value:"legal",text:'Legal (8.5" x 14")       '},{value:"letter",text:'Letter (8.5" x 11")      '},{value:"tabloid",text:'Tabloid (11" x 17")      '},{value:"executive",text:'Executive (7.25" x 10.5")'}],margin:{bottom:"0.75in",left:"0.7in",right:"0.7in",top:"0.75in"},margins:[{value:{bottom:"0.75in",left:"0.7in",right:"0.7in",top:"0.75in"},text:"Normal"},{value:{bottom:"0.75in",left:"0.25in",right:"0.25in",top:"0.75in"},text:"Narrow"},{value:{bottom:"1in",left:"1in",right:"1in",top:"1in"},text:"Wide"}],landscape:!0,guidelines:!0,hCenter:!0,vCenter:!0},width:520,template:"<div class='k-edit-label'><label>#: messages.exportAsDialog.labels.fileName #:<\/label><\/div><div class='k-edit-field'><input class='k-textbox' data-bind='value: name' /><\/div><div ><div class='k-edit-label'><label>#: messages.exportAsDialog.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-export-config' data-bind='visible: showPdfOptions'><hr class='k-hr' /><div class='k-edit-label'><label>#: messages.exportAsDialog.labels.exportArea #:<\/label><\/div><div class='k-edit-field'><select data-role='dropdownlist' class='k-file-format' data-text-field='text' data-value-field='area' data-bind='value: pdf.area, source: pdf.areas' /><\/div><div class='k-edit-label'><label>#: messages.exportAsDialog.labels.paperSize#:<\/label><\/div><div class='k-edit-field'><select data-role='dropdownlist' class='k-file-format' data-text-field='text' data-value-field='value' data-bind='value: pdf.paperSize, source: pdf.paperSizes' /><\/div><div class='k-edit-label'><label>#: messages.exportAsDialog.labels.margins #:<\/label><\/div><div class='k-edit-field'><select data-role='dropdownlist' class='k-file-format' data-value-primitive='true'data-text-field='text' data-value-field='value' data-bind='value: pdf.margin, source: pdf.margins' /><\/div><div class='k-edit-label'><label>#: messages.exportAsDialog.labels.orientation #:<\/label><\/div><div class='k-edit-field'><div class='k-button-group'><input type='radio' id='k-orientation-portrait' name='orientation' data-type='boolean' data-bind='checked: pdf.landscape' value='false' /><label class='k-button k-button-icon k-group-start k-orientation-button' for='k-orientation-portrait'><span class='k-icon k-i-page-portrait'><\/span><\/label><input type='radio' id='k-orientation-landscape' name='orientation' data-type='boolean' data-bind='checked: pdf.landscape' value='true' /><label class='k-button k-button-icon k-group-end k-orientation-button' for='k-orientation-landscape'><span class='k-icon k-i-page-landscape'><\/span><\/label><\/div><\/div><div class='k-edit-label'><label>#: messages.exportAsDialog.labels.print #:<\/label><\/div><div class='k-edit-field'><input class='k-checkbox' id='guidelines' type='checkbox' data-bind='checked: pdf.guidelines'/><label class='k-checkbox-label' for='guidelines'>#: messages.exportAsDialog.labels.guidelines#<\/label><\/div><div class='k-edit-label'><label>#: messages.exportAsDialog.labels.scale #:<\/label><\/div><div class='k-edit-field'><input class='k-checkbox' id='fitWidth' type='checkbox' data-bind='checked: pdf.fitWidth'/><label class='k-checkbox-label' for='fitWidth'>#: messages.exportAsDialog.labels.fit #<\/label><\/div><div class='k-edit-label'><label>#: messages.exportAsDialog.labels.center #:<\/label><\/div><div class='k-edit-field'><input class='k-checkbox' id='hCenter' type='checkbox' data-bind='checked: pdf.hCenter'/><label class='k-checkbox-label' for='hCenter'>#: messages.exportAsDialog.labels.horizontally #<\/label><input class='k-checkbox' id='vCenter' type='checkbox' data-bind='checked: pdf.vCenter'/><label class='k-checkbox-label' for='vCenter'>#: messages.exportAsDialog.labels.vertically #<\/label><\/div><div class='k-page-orientation'><span class='k-icon k-i-page-portrait' data-bind='invisible: pdf.landscape'><\/span><span class='k-icon k-i-page-landscape' data-bind='visible: pdf.landscape'><\/span><\/div><\/div><div class='k-action-buttons'><button class='k-button k-primary' data-bind='click: apply'>#: messages.save #<\/button><button class='k-button' data-bind='click: close'>#: messages.cancel #<\/button><\/div>"},apply:function(){t.fn.apply.call(this);this.trigger("action",{command:"SaveAsCommand",options:this.viewModel})}});n.spreadsheet.dialogs.register("exportAs",ut);u("modifyMerged","modifyMergedDialog.errorMessage");u("rangeDisabled","rangeDisabledDialog.errorMessage");u("overflow","overflowDialog.errorMessage");u("unsupportedSelection","unsupportedSelectionDialog.errorMessage");u("incompatibleRanges","incompatibleRangesDialog.errorMessage");u("noFillDirection","noFillDirectionDialog.errorMessage");u("duplicateSheetName","duplicateSheetNameDialog.errorMessage");ft=o.extend({options:{width:640,title:"Errors in import",template:"<div class='k-spreadsheet-message-content k-spreadsheet-import-errors'><div class='k--header-message'>We encountered #= errors.length # errors while reading this file.  Please be aware that some formulas might be missing, or contain invalid results.<\/div><div class='k--errors'><table><thead><tr><th>Context<\/th><th>Error message<\/th><\/tr><\/thead># for (var i = 0; i < errors.length; ++i) { ## var err = errors[i]; #<tr><td>#: err.context #<\/td><td>#: err.error #<\/td><\/tr># } #<\/table><\/div><\/div><div class='k-action-buttons'><button class='k-button k-primary' data-bind='click: close'>#: messages.okText #<\/button><\/div>"}});n.spreadsheet.dialogs.register("importError",ft);et=o.extend({init:function(u){var f=n.spreadsheet.messages.dialogs.useKeyboardDialog||r;t.fn.init.call(this,i.extend({title:f.title},u))},options:{template:"#: messages.useKeyboardDialog.errorMessage #<div>Ctrl+C #: messages.useKeyboardDialog.labels.forCopy #<\/div><div>Ctrl+X #: messages.useKeyboardDialog.labels.forCut #<\/div><div>Ctrl+V #: messages.useKeyboardDialog.labels.forPaste #<\/div><div class=\"k-action-buttons\"><button class='k-button k-primary' data-bind='click: close'>#= messages.okText #<\/button><\/div>"}});n.spreadsheet.dialogs.register("useKeyboard",et);ot=t.extend({options:{template:"<div class='k-edit-label'><label>#: messages.linkDialog.labels.url #:<\/label><\/div><div class='k-edit-field'><input class='k-textbox' data-bind='value: url' title='#: messages.linkDialog.labels.url #' /><\/div><div class='k-action-buttons'><button class='k-button k-left' data-bind='click: remove'>#= messages.linkDialog.labels.removeLink #<\/button><button class='k-button k-primary' data-bind='click: apply'>#= messages.okText #<\/button><button class='k-button' data-bind='click: cancel'>#= messages.cancel #<\/button><\/div>",title:r.linkDialog.title,autoFocus:!1},open:function(r){var f=this,e,u;t.fn.open.apply(f,arguments);e=f.dialog().element;u=n.observable({url:r.link(),apply:function(){/\S/.test(u.url)||(u.url=null);f.trigger("action",{command:"HyperlinkCommand",options:{link:u.url}});f.close()},remove:function(){u.url=null;u.apply()},cancel:f.close.bind(f)});n.bind(e,u);e.find("input").focus().on("keydown",function(n){n.keyCode==13?(u.url=i(this).val(),n.stopPropagation(),n.preventDefault(),u.apply()):n.keyCode==27&&(n.stopPropagation(),n.preventDefault(),u.cancel())})}});n.spreadsheet.dialogs.register("hyperlink",ot)}})(window.kendo)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("spreadsheet/sheetbinder",["kendo.core","kendo.data","spreadsheet/sheet"],n)}(function(){(function(n){if(!n.support.browser.msie||!(n.support.browser.version<9)){var t=function(n){return n},i=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._boundRowsCount=0;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("afterDeleteRow",this._sheetDeleteRowHandler).bind("afterInsertRow",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(i){var s,o,h;if(!i.insertRow&&!i.deleteRow&&i.recalc&&i.ref){var r=this.dataSource,f=r.view(),u=this.columns,e;r.reader.model&&(e=r.reader.model.fields);!u.length&&f.length&&(u=Object.keys(f[0].toJSON()));s=u.map(function(i){var r=i.field;return r&&e&&e[r]&&e[r].type=="date"?n.spreadsheet.numberToDate:t});this._skipRebind=!0;o=this.sheet._grid.normalize(i.ref);h=this.sheet.range(o).values();o.forEach(function(n){var e,o,i,c,t;for(n=n.toRangeRef(),o=0,i=n.topLeft.row;i<=n.bottomRight.row;i++){for(e=f[i-1],e||(e=r.insert(i-1,{}),f=r.view()),c=0,t=n.topLeft.col;t<=n.bottomRight.col&&t<u.length;t++)e.set(u[t].field,s[t](h[o][c++]));o++}});this._boundRowsCount=r.view().length;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,u,f=Math.max(t.length,this._boundRowsCount),n=0;n<f;n++)for(i=0;i<r.length;i++)u=t[n]?r[i](t[n]):null,this.sheet.range(n+1,i).value(u)}.bind(this)),this._boundRowsCount=t.length)},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=i}})(kendo)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("spreadsheet/filtermenu",["kendo.core","kendo.popup","kendo.treeview","kendo.numerictextbox","kendo.datepicker","kendo.datetimepicker"],n)}(function(){(function(n){function a(n){for(var i={},r=[],t=0;t<n.length;t++)i[n[t].value]?!i[n[t].value].checked&&n[t].checked&&(i[n[t].value].checked=!0):(i[n[t].value]=n[t],r.push(n[t]));return r}function s(t,i){for(var f=!1,e=t instanceof n.data.HierarchicalDataSource&&t.data(),l=this,u=this.values,o=0;o<e.length;o++){var r=e[o],a=r.text.toString().toLowerCase(),h=i===!0||i===""||a.indexOf(i)>=0,v=s.bind(l),c=v(r.children,i);f=f||c||h;r.hidden=!h&&!c;i.length||u&&!u.length?r.checked=!r.hidden:u&&u.indexOf(r.text)!=-1&&(r.checked=!0)}return e&&t.filter({field:"hidden",operator:"neq",value:!0}),f}function h(t){for(var i,u=t instanceof n.data.HierarchicalDataSource&&t.data(),r=0;r<u.length;r++)i=u[r],i.checked=!1,i.hasChildren&&h(i.children)}function v(n){var u=f.operators,r=[],t,i;for(t in n)if(n.hasOwnProperty(t))for(i in n[t])n[t].hasOwnProperty(i)&&r.push({text:u[t][i],value:i,unique:t+"_"+i,type:t});return r}var o,c,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",iconCollapse:"k-i-arrow-45-down-right",iconExpand:"k-i-arrow-60-right",iconSearch:"k-i-zoom",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"},l=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",addToCurrent:"Add to current selection",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",matches:"Text matches",doesnotmatch:"Text does not match"},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"}}};n.data.binders.spreadsheetFilterValue=n.data.Binder.extend({init:function(t,r,u){n.data.Binder.fn.init.call(this,t,r,u);this._change=i.proxy(this.change,this);i(this.element).on("change",this._change)},refresh:function(){var n=this,t=n.bindings.spreadsheetFilterValue.get();i(n.element).val(t instanceof Date?"":t)},change:function(){var n=this.element.value;this.bindings.spreadsheetFilterValue.set(n)}});n.data.binders.widget.spreadsheetFilterValue=n.data.Binder.extend({init:function(t,r,u){n.data.Binder.fn.init.call(this,t.element[0],r,u);this.widget=t;this._change=i.proxy(this.change,this);this.widget.first("change",this._change)},refresh:function(){var r=this.bindings.spreadsheetFilterValue,n=r.get(),t=i(this.widget.element).data("filterType");t==="date"&&n instanceof Date||t==="number"&&!isNaN(n)?this.widget.value(n):this.widget.value(null)},change:function(){var n=this.widget.value(),t=this.bindings.spreadsheetFilterValue;t.set(n)}});o={filterByValue:"<div class='"+r.detailsSummary+"'>#= messages.filterByValue #<\/div><div class='"+r.detailsContent+"'><div class='k-textbox k-space-right'><input placeholder='#= messages.search #' data-#=ns#bind='events: { input: filterValues }' /><span class='k-icon k-i-zoom' /><\/div><div data-#=ns#bind='visible: hasActiveSearch'><input class='k-checkbox' type='checkbox' data-#=ns#bind='checked: appendToSearch' id='_#=guid#' /><label class='k-checkbox-label' for='_#=guid#'>#= messages.addToCurrent #<\/label><\/div><div class='"+r.valuesTreeViewWrapper+"'><div data-#=ns#role='treeview' data-#=ns#checkboxes='{ checkChildren: true }' data-#=ns#bind='source: valuesDataSource, events: { check: valuesChange, select: valueSelect }' /><\/div><\/div>",filterByCondition:"<div class='"+r.detailsSummary+"'>#= messages.filterByCondition #<\/div><div class='"+r.detailsContent+'\'><div><select data-#=ns#role="dropdownlist"data-#=ns#bind="value: operator, source: operators, events: { change: operatorChange } "data-value-primitive="false"data-option-label="#=messages.operatorNone#"data-height="auto"data-text-field="text"data-value-field="unique"><\/select><\/div><div data-#=ns#bind="visible: isString"><input data-filter-type="string" data-#=ns#bind="spreadsheetFilterValue: customFilter.criteria[0].value" class="k-textbox" /><\/div><div data-#=ns#bind="visible: isNumber"><input data-filter-type="number" data-#=ns#role="numerictextbox" data-#=ns#bind="spreadsheetFilterValue: customFilter.criteria[0].value" /><\/div><div data-#=ns#bind="visible: isDate"><input data-filter-type="date" data-#=ns#role="datepicker" data-#=ns#bind="spreadsheetFilterValue: customFilter.criteria[0].value" /><\/div><\/div>',menuItem:"<li data-command='#=command#' data-dir='#=dir#'><span class='k-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>"};c=n.spreadsheet.FilterMenuViewModel=n.data.ObservableObject.extend({valuesChange:function(t){var u=t?t.sender.dataSource:this.valuesDataSource,f=function(n){return n.checked},e=function(t){return t.dataType==="date"?n.spreadsheet.dateToNumber(t.value):t.value},o=function(n,t,i){return i.lastIndexOf(n)===t},s=u.data(),i=s[0].children.data().toJSON(),r=i.filter(function(n){return n.dataType==="blank"});r=r.length?r[0].checked:!1;i=i.filter(f).map(e);this.appendToSearch&&this.valueFilter&&this.valueFilter.values.length&&(i=i.concat(this.valueFilter.values.toJSON()).sort().filter(o));this.set("valueFilter",{values:i,blanks:r})},valueSelect:function(n){n.preventDefault();var t=n.sender.dataItem(n.node);t.set("checked",!t.checked)},hasActiveSearch:!1,appendToSearch:!1,filterValues:function(n){var t=typeof n=="string"?n:i(n.target).val().toLowerCase(),r=this.valuesDataSource,u;this.set("hasActiveSearch",!!t);u=s.bind(this.valueFilter);h(r);u(r,t)},reset:function(){this.set("customFilter",{logic:"and",criteria:[{operator:null,value:null}]});this.set("valueFilter",{values:[]})},operatorChange:function(n){var t=n.sender.dataItem();this.set("operatorType",t.type);this.get("customFilter")||this.reset();this.set("customFilter.criteria[0].operator",t.value)},isNone:function(){return this.get("operatorType")===undefined},isString:function(){return this.get("operatorType")==="string"},isNumber:function(){return this.get("operatorType")==="number"},isDate:function(){return this.get("operatorType")==="date"}});e=n.spreadsheet.FilterMenuController={valuesTree:function(n,t){return[{text:"All",expanded:!0,checked:!1,items:this.values(n.resize({top:1}),t)}]},values:function(t,i){var r=[],u=f,e=t.column(i),o=t.sheet();return e.forEachCell(function(t,i,f){var h=!0;o.isHiddenRow(t)&&(h=!1);var e=f.value,s=f.dataType,c=f.text;s=e===undefined?"blank":f.format?n.spreadsheet.formatting.type(e,f.format):typeof e;c=e!==null&&f.format?n.spreadsheet.formatting.text(e,f.format):s=="blank"?u.blanks:e;(s==="percent"||s==="currency")&&(s="number");s==="date"&&(e=n.spreadsheet.numberToDate(e));r.push({dataType:s,value:e,text:c,checked:h})}),r=a(r),r.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}),r},filterType:function(n,t){var e=n.sheet(),r=this.filterForColumn(t,e),i,u,f;return r=r&&r.filter.toJSON(),r&&r.filter=="custom"&&(u=r.criteria[0].value,u instanceof Date?i="date":typeof u=="string"?i="string":typeof u=="number"&&(i="number")),i||(f=this.values(n.row(1),t)[0],i=f&&f.dataType,i=="blank"&&(i=null)),i},filterForColumn:function(n,t){var i=t.filter(),r;return i&&(r=i.columns.filter(function(t){return t.index===n})[0]),r},filter:function(n,t){var f=this.filterForColumn(n,t),i,e,u,r;if(f)return i=f.filter.toJSON(),e=i.filter,delete i.filter,u={type:e,options:i},r=i.criteria,r&&r.length&&(u.operator=r[0].operator),u}};t=u.extend({init:function(n,i){u.call(this,n,i);this.element.addClass(t.classNames.wrapper);this.viewModel=new c({active:"value",operator:null,operators:v(this.options.operators),clear:this.clear.bind(this),apply:this.apply.bind(this)});this._filterInit();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",matches:"Text matches",doesnotmatch:"Text does not match"},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 n={operatingRange:this.options.range,column:this.options.column},t,i;this.viewModel.active==="value"?(this.viewModel.valuesChange({sender:this.valuesTreeView}),t=this.viewModel.valueFilter.toJSON(),(t.blanks||t.values&&t.values.length)&&(n.valueFilter=t)):this.viewModel.active==="custom"&&(i=this.viewModel.customFilter.toJSON(),i.criteria.length&&i.criteria[0].value!==null&&(n.customFilter=i));(n.valueFilter||n.customFilter)&&this.action({command:"ApplyFilterCommand",options:n})},action:function(n){this.trigger("action",i.extend({},n))},_filterInit:function(){var i=this.options.column,r=this.options.range,u=r.sheet(),n=e.filter(i,u),t;n?(t=e.filterType(r,i),this.viewModel.set("active",n.type),this.viewModel.set(n.type+"Filter",n.options),n.type=="custom"&&(this.viewModel.set("operator",t+"_"+n.operator),this.viewModel.set("operatorType",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"),t=this.options.range.resize({top:1}),u={value:r,sheet:!1,operatingRange:t,column:this.options.column};t.isSortable()?this.action({command:"SortCommand",options:u}):this.close()}.bind(this)}).data("kendoMenu")},_appendTemplate:function(t,r,u,e){var s=n.template(t),o=i("<div class='"+r+"'/>").html(s({messages:f,guid:n.guid(),ns:n.ns}));return this.element.append(o),u&&(u=new l(o,{expanded:e,toggle:this._detailToggle.bind(this)})),n.bind(o,this.viewModel),o},_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 r=this.viewModel.active==="value",u=this._appendTemplate(t.templates.filterByValue,t.classNames.filterByValue,!0,r),i;this.valuesTreeView=u.find("[data-role=treeview]").data("kendoTreeView");i=e.valuesTree(this.options.range,this.options.column);this.viewModel.set("valuesDataSource",new n.data.HierarchicalDataSource({data:i}))},_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:o})}})(window.kendo)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("spreadsheet/editor",["kendo.core"],n)}(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._active=!1;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));this.barInput.bind("blur",this._blur.bind(this));this.cellInput.bind("blur",this._blur.bind(this))},events:["activate","deactivate","change","update"],_blur:function(){this.deactivate()},_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._range=n.range,this.cellInput.position(n.rect),this.cellInput.resize(n.rect),this.cellInput.tooltip(n.tooltip),this.cellInput.activeCell=this.barInput.activeCell=this._range.topLeft(),this.cellInput.activeSheet=this.barInput.activeSheet=this._range._sheet,this.trigger("activate"),this},deactivate:function(){var n=this.cellInput;this._active&&(n.value()!=this._value&&this.trigger("change",{value:n.value(),range:this._range}),this._active=!1,this._rect=null,n.hide(),this.trigger("deactivate"))},enable:function(n){this.barInput.enable(n);this.cellInput.enable(n)},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)},insertNewline:function(){this.activeEditor().insertNewline();this.scale()},select:function(){this.activeEditor().select()}});n.spreadsheet.SheetEditor=t}})(kendo)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("spreadsheet/autofill",["spreadsheet/runtime","spreadsheet/range"],n)}(function(){"use strict";function f(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 h(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 r=[],t=n.map(function(n){return n.formula||n.value});return l(t,function(n,u,o,s){var c,h,a,v,l;for(o=="number"?(h=i(s),c=f(h)):o=="string"||o=="formula"||o=="boolean"?c=function(n,i){return t[i]}:Array.isArray(o)?s.length==1?c=function(n){return o[(s[0].number+n)%o.length]}:(a=e(i(s)),c=a==null?function(n){return s[n%s.length].value}:function(n){var t=s[0].number+a*n;return o[t%o.length]}):o!="null"?(h=i(s),h.length==1&&h.push(h[0]+1),h=f(h),c=function(n,i){return t[i].replace(/^(.*\D)\d+/,"$1"+h(n,i))}):c=function(){return null},v={f:c,begin:n,end:u,len:u-n},l=n;l<u;++l)r[l]=v}),function(i,f){var o=r[f],h=i/t.length|0,l=i%t.length,a=h*o.len+l-o.begin,s=o.f(a,f),e=c(n[f]);return delete e.enable,s instanceof u?e.formula=s:e.value=s,e}}function c(n){var t={};return Object.keys(n||{}).forEach(function(i){t[i]=n[i]}),t}function l(n,t){for(var r=null,u=0,e=[],f,i=0;i<n.length;++i)f=a(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 a(n){var i,t;if(typeof n=="number")return{type:"number",number:n};if(typeof n=="string")return(i=y(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 u)return{type:"formula"};window.console.error(n);throw new Error("Cannot fill data");}function v(){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 y(n){for(var t,i,f,e=n.toLowerCase(),u=v(),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 e(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 r=kendo.spreadsheet,i=r.Range,o=r.calc.runtime,u=o.Formula,t="incompatibleRanges",s="noFillDirection",n=i.FillError=function(n){this.code=n};i.prototype._previewFillFrom=function(i,r){var b=this,k=b._sheet,f,u,l,w,c,a,v,y,o,d,g;if(typeof i=="string"&&(i=k.range(i)),f=i._ref.toRangeRef(),u=b._ref.toRangeRef(),f.intersects(u)){if(f.eq(u))return null;if(u=u.clone(),f.topLeft.eq(u.topLeft))if(f.width()==u.width())u.topLeft.row+=f.height(),r=0;else if(f.height()==u.height())u.topLeft.col+=f.width(),r=1;else throw new n(t);else if(f.bottomRight.eq(u.bottomRight))if(f.width()==u.width())u.bottomRight.row-=f.height(),r=2;else if(f.height()==u.height())u.bottomRight.col-=f.width(),r=3;else throw new n(t);else throw new n(t);return k.range(u)._previewFillFrom(i,r)}if(r==null)if(f.topLeft.col==u.topLeft.col)r=f.topLeft.row<u.topLeft.row?0:2;else if(f.topLeft.row==u.topLeft.row)r=f.topLeft.col<u.topLeft.col?1:3;else throw new n(s);if(l=r&1,w=r&2,l&&f.height()!=u.height()||!l&&f.width()!=u.width())throw new n(t);for(c=i._properties(),l?a=u.width():(c=e(c),a=u.height()),v=new Array(c.length),y=0;y<c.length;++y){var p=c[y],nt=h(p),tt=v[y]=new Array(a);for(o=0;o<a;++o)d=w?-o-1:p.length+o,g=w?p.length-o%p.length-1:o%p.length,tt[w?a-o-1:o]=nt(d,g)}return l||(v=e(v)),{props:v,direction:r,dest:b}};i.prototype.fillFrom=function(n,t){var i=this._previewFillFrom(n,t);return i.dest._properties(i.props),i.dest}}},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("spreadsheet/nameeditor",["kendo.core"],n)}(function(){(function(n){if(!n.support.browser.msie||!(n.support.browser.version<9)){var t=n.jQuery,i={input:"k-spreadsheet-name-editor",list:"k-spreadsheet-name-list"},r=n.ui.Widget.extend({init:function(r,u){n.ui.Widget.call(this,r,u);r.addClass(i.input);var f=u.messages.nameBox||"Name Box",e=new n.data.DataSource({transport:{read:function(t){var i=[];this._workbook.forEachName(function(t){!t.hidden&&t.value instanceof n.spreadsheet.Ref&&i.push({name:t.name})});t.success(i)}.bind(this),cache:!1}}),o=t("<input />").attr("title",f).attr("aria-label",f);this.combo=o.appendTo(r).kendoComboBox({clearButton:!1,dataTextField:"name",dataValueField:"name",template:"#:data.name#<a class='k-button-delete' href='\\#'><span class='k-icon k-i-close'><\/span><\/a>",dataSource:e,autoBind:!1,ignoreCase:!0,change:this._on_listChange.bind(this),noDataTemplate:"<div><\/div>",open:function(){e.read()}}).getKendoComboBox();this.combo.input.on("keydown",this._on_keyDown.bind(this)).on("focus",this._on_focus.bind(this));this.combo.popup.element.addClass("k-spreadsheet-names-popup").on("mousemove",function(n){n.stopPropagation()}).on("click",".k-button-delete",function(n){n.preventDefault();n.stopPropagation();var i=t(n.target).closest(".k-item");i=this.combo.dataItem(i);this._deleteItem(i.name)}.bind(this))},value:function(n){if(n===undefined)return this.combo.value();this.combo.value(n)},_deleteItem:function(n){this.trigger("delete",{name:n})},_on_keyDown:function(n){switch(n.keyCode){case 27:this.combo.value(this._prevValue);this.trigger("cancel");break;case 13:this.trigger("enter")}},_on_focus:function(){this._prevValue=this.combo.value()},_on_listChange:function(){var n=this.combo.value();n&&this.trigger("select",{name:n})}});n.spreadsheet.NameEditor=r}})(window.kendo)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("spreadsheet/print",["kendo.pdf","spreadsheet/sheet","spreadsheet/range","spreadsheet/references","spreadsheet/numformat","util/text-metrics"],n)}(function(){"use strict";function e(n,t){var i=0,r=[],f=.2*t,u=t;return n.forEach(function(n){t&&i+n>u&&(u-i<f&&(i=t*Math.ceil(i/t)),u+=t*Math.ceil(n/t));r.push(i);i+=n}),r.push(i),r}function o(n,t,i){var it=n._grid,d;t=it.normalize(t);var u=[],f=[],r=[],o=n._getMergedCells(t),s=-1,c=-1;n.forEach(t,function(e,h,l){var w=e-t.topLeft.row,b=h-t.topLeft.col,d=n.rowHeight(e),g=n.columnWidth(h),k,y,v;(b||f.push(d),w||r.push(g),!n.isHiddenColumn(h)&&!n.isHiddenRow(e)&&d&&g)&&(k=i.forScreen||p(l),i.emptyCells||k)&&((y=new a(e,h).print(),o.secondary[y])||(k?(s=Math.max(s,w),c=Math.max(c,b)):l.empty=!0,l.row=w,l.col=b,v=o.primary[y],v?(delete o.primary[y],l.merged=!0,l.rowspan=v.height(),l.colspan=v.width(),i.forScreen&&(l.width=n._columns.sum(v.topLeft.col,v.bottomRight.col),l.height=n._rows.sum(v.topLeft.row,v.bottomRight.row))):(l.rowspan=1,l.colspan=1),u.push(l)))});f=f.slice(0,s+1);r=r.slice(0,c+1);var l=Math.floor(i.pageWidth),tt=Math.floor(i.pageHeight),v=1;i.fitWidth&&(d=r.reduce(y,0),d>l&&(v=l/d,l/=v,tt/=v));var b=e(f,tt||0),k=e(r,l||0),g=0,nt=0;return u=u.filter(function(n){return n.empty&&(n.row>s||n.col>c)?!1:(n.left=k[n.col],n.top=b[n.row],n.merged?i.forScreen?(n.right=n.left+n.width,n.bottom=n.top+n.height):(n.right=h(k,n.col+n.colspan),n.bottom=h(b,n.row+n.rowspan),n.width=n.right-n.left,n.height=n.bottom-n.top):(n.width=r[n.col],n.height=f[n.row],n.bottom=n.top+n.height,n.right=n.left+n.width),g=Math.max(g,n.right),nt=Math.max(nt,n.bottom),!0)}),Object.keys(o.primary).forEach(function(i){var r=o.primary[i];n.forEach(r.topLeft.toRangeRef(),function(i,f,e){var o=i-t.topLeft.row,s=f-t.topLeft.col;e.merged=!0;e.colspan=r.width();e.rowspan=r.height();e.top=o<0?-n._rows.sum(i,i-o-1):b[o];e.left=s<0?-n._columns.sum(f,f-s-1):k[s];e.height=n._rows.sum(r.topLeft.row,r.bottomRight.row);e.width=n._columns.sum(r.topLeft.col,r.bottomRight.col);e.height>0&&e.width>0&&(e.right=e.left+e.width,e.bottom=e.top+e.height,e.row=o,e.col=s,u.push(e))})}),{width:g,height:nt,cells:u.sort(w),scale:v,xCoords:k,yCoords:b}}function s(n,t){return n.size===t.size&&n.color===t.color}function y(n,t){return n+t}function h(n,t){return t<n.length?n[t]:n[n.length-1]}function p(n){return n.value!=null||n.merged||n.background!=null||n.borderRight!=null||n.borderBottom!=null||n.validation!=null&&!n.validation.value}function w(n,t){return n.top<t.top?-1:n.top==t.top?n.left<t.left?-1:n.left==t.left?0:1:1}function b(n,i,f,e){function y(o,s){var p=s*h,d=p+h,w=o*c,g=w+c,a=0,v=0,ut=i.cells.filter(function(n){return n.right<=p||n.left>=d||n.bottom<=w||n.top>=g?!1:(a=Math.max(n.bottom,a),v=Math.max(n.right,v),!0)}),nt,y,tt,b,it,rt;a=Math.min(a,g);v=Math.min(v,d);ut.length>0&&(nt=new t.Group,f.append(nt),nt.clip(t.Path.fromRect(new r.Rect([0,0],[e.pageWidth,e.pageHeight]))),y=new t.Group,nt.append(y),y.clip(t.Path.fromRect(new r.Rect([p,w],[v,a]))),tt=r.Matrix.scale(i.scale,i.scale).multiplyCopy(r.Matrix.translate(-p,-w)),(e.hCenter||e.vCenter)&&(tt=tt.multiplyCopy(r.Matrix.translate(e.hCenter?(d-v)/2:0,e.vCenter?(g-a)/2:0))),y.transform(tt),e.guidelines&&(b=null,i.xCoords.forEach(function(n){n=Math.min(n,v);n!==b&&n>=p&&n<=d&&(b=n,y.append((new t.Path).moveTo(n,w).lineTo(n,a).close().stroke("#aaa",u)))}),b=null,i.yCoords.forEach(function(n){n=Math.min(n,a);n!==b&&n>=w&&n<=g&&(b=n,y.append((new t.Path).moveTo(p,n).lineTo(v,n).close().stroke("#aaa",u)))})),it=l(),ut.forEach(function(t){k(t,y,e);it.add(t,n)}),rt=new t.Group,it.vert.forEach(function(n){n.forEach(function(n){n.rendered||(n.rendered=!0,rt.append((new t.Path).moveTo(n.x,n.top).lineTo(n.x,n.bottom).close().stroke(n.color,n.size)))})}),it.horiz.forEach(function(n){n.forEach(function(n){n.rendered||(n.rendered=!0,rt.append((new t.Path).moveTo(n.left,n.y).lineTo(n.right,n.y).close().stroke(n.color,n.size)))})}),y.append(rt))}for(var o,a=Math.ceil(i.width/e.pageWidth),v=Math.ceil(i.height/e.pageHeight),h=e.pageWidth/i.scale,c=e.pageHeight/i.scale,s=0;s<a;++s)for(o=0;o<v;++o)y(o,s)}function k(n,i,f){var l=new t.Group,h,e,o,a,c,s;if(i.append(l),h=new r.Rect([n.left,n.top],[n.width,n.height]),(n.background||n.merged)&&(e=h,f.guidelines&&(e=h.clone(),e.origin.x+=u/2,e.origin.y+=u/2,e.size.width-=u,e.size.height-=u),l.append(new t.Rect(e).fill(n.background||"#fff").stroke(null))),o=n.value,o!=null){if(a=typeof o=="number"?"number":null,c=new t.Group,c.clip(t.Path.fromRect(h)),l.append(c),n.format?(s=v.textAndColor(o,n.format),o=s.text,s.type&&(a=s.type)):o+="",!n.textAlign)switch(a){case"number":case"date":case"percent":case"currency":n.textAlign="right";break;case"boolean":n.textAlign="center"}d(o,s&&s.color||n.color||"#000",n,c)}}function d(t,i,u,f){var e,o;n||(n=document.createElement("div"),n.style.position="fixed",n.style.left="-10000px",n.style.top="-10000px",n.style.overflow="hidden",n.style.boxSizing="border-box",n.style.padding="2px 4px",n.style.lineHeight="normal",document.body.appendChild(n));n.style.color=i;n.style.font=g(u);n.style.width=u.width+"px";n.style.textAlign=u.textAlign||"left";n.style.textDecoration=u.underline?"underline":"none";u.wrap?(n.style.whiteSpace="pre-wrap",n.style.overflowWrap=n.style.wordWrap="break-word"):(n.style.whiteSpace="pre",n.style.overflowWrap=n.style.wordWrap="normal");n.firstChild&&n.removeChild(n.firstChild);n.appendChild(document.createTextNode(t));e=0;switch(u.verticalAlign){case"center":e=u.height-n.offsetHeight>>1;break;case undefined:case null:case"bottom":e=u.height-n.offsetHeight}e<0&&(e=0);o=kendo.drawing.drawDOM.drawText(n);o.transform(r.Matrix.translate(1e4+u.left,1e4+u.top+e));f.append(o)}function g(n){var t=[];return n.italic&&t.push("italic"),n.bold&&t.push("bold"),t.push((n.fontSize||12)+"px"),t.push(n.fontFamily||"Arial"),t.join(" ")}function c(n,r,u,f){var s,e,h,c,l;u==null&&f==null&&(f=r,u={},r=i.SHEETREF);f==null&&(f=u,r instanceof i.Range||r instanceof i.Ref||typeof r=="string"?u={}:(u=r,r=i.SHEETREF));u=kendo.jQuery.extend({paperSize:"A4",landscape:!0,margin:"1cm",guidelines:!0,emptyCells:!0,fitWidth:!1,center:!1},u);s=new t.Group;e=kendo.pdf.getPaperOptions(u);s.options.set("pdf",{author:u.author,creator:u.creator,date:u.date,keywords:u.keywords,margin:e.margin,multiPage:!0,paperSize:e.paperSize,subject:u.subject,title:u.title});h=e.paperSize[0];c=e.paperSize[1];e.margin&&(h-=e.margin.left+e.margin.right+1,c-=e.margin.top+e.margin.bottom+1);u.pageWidth=h;u.pageHeight=c;l=o(n,n._ref(r),u);b(n,l,s,u);f(s)}function f(){}function l(){function u(n,t){if(t){var u=t._properties,f=t._grid;n.borderLeft=u.get("vBorders",f.index(n.row,n.col));n.borderRight=u.get("vBorders",f.index(n.row,n.col+n.colspan));n.borderTop=u.get("hBorders",f.index(n.row,n.col));n.borderBottom=u.get("hBorders",f.index(n.row+n.rowspan,n.col))}n.borderLeft&&i(n.row,n.col,n.borderLeft,n.left,n.top,n.bottom);n.borderRight&&i(n.row,n.col+n.colspan,n.borderRight,n.right,n.top,n.bottom);n.borderTop&&r(n.row,n.col,n.borderTop,n.top,n.left,n.right);n.borderBottom&&r(n.row+n.rowspan,n.col,n.borderBottom,n.bottom,n.left,n.right)}function i(n,i,r,u,e,o){var c=t[i]||(t[i]=new f),h=n>0&&c[n-1];h&&s(h,r)?(c[n]=h,h.bottom=o):c[n]={size:r.size,color:r.color,x:u,top:e,bottom:o}}function r(t,i,r,u,e,o){var c=n[t]||(n[t]=new f),h=i>0&&c[i-1];h&&s(h,r)?(c[i]=h,h.right=o):c[i]={size:r.size,color:r.color,y:u,left:e,right:o}}var n=new f,t=new f;return{add:u,horiz:n,vert:t}}var n;if(!kendo.support.browser.msie||!(kendo.support.browser.version<9)){var i=kendo.spreadsheet,a=i.CellRef,t=kendo.drawing,v=i.formatting,r=kendo.geometry,u=.8;i.Sheet.prototype.draw=function(n,t,i){var r=this;r._workbook?r.recalc(r._workbook._context,function(){c(r,n,t,i)}):c(r,n,t,i)};f.prototype={forEach:function(n){Object.keys(this).forEach(function(t){n(this[t],t,this)},this)}};i.draw={Borders:l,doLayout:o}}},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.spreadsheet",["util/undoredostack","util/text-metrics","util/parse-xml","kendo.excel","kendo.progressbar","kendo.pdf","spreadsheet/commands","spreadsheet/formulabar","spreadsheet/formulainput","spreadsheet/eventlistener","spreadsheet/rangelist","spreadsheet/propertybag","spreadsheet/references","spreadsheet/navigator","spreadsheet/axismanager","spreadsheet/clipboard","spreadsheet/range","spreadsheet/sheet","spreadsheet/sheetsbar","spreadsheet/excel-reader","spreadsheet/workbook","spreadsheet/formulacontext","spreadsheet/controller","spreadsheet/view","spreadsheet/customeditors","spreadsheet/grid","spreadsheet/axis","spreadsheet/filter","spreadsheet/sorter","spreadsheet/runtime","spreadsheet/calc","spreadsheet/numformat","spreadsheet/runtime.functions","spreadsheet/runtime.functions.2","spreadsheet/toolbar","spreadsheet/dialogs","spreadsheet/sheetbinder","spreadsheet/filtermenu","spreadsheet/editor","spreadsheet/autofill","spreadsheet/nameeditor","spreadsheet/print"],n)}(function(){return function(n,t){if(!n.support.browser.msie||!(n.support.browser.version<9)){var r=n.jQuery,i=r.extend({F10:121,F11:122,B:66,I:73,U:85,N:78,H:72,A:65,PAGEDOWN:34,PAGEUP:33,DELETE:46,R:82},n.keys),s=n.ui.Widget,e=n.spreadsheet.Workbook,h=n.spreadsheet.Controller,c=n.spreadsheet.View,u=".kendoSpreadsheet",o={recalc:!0,selection:!0,activeCell:!0,layout:!0,sheetSelection:!0,resize:!0,editorChange:!1,editorClose:!1},f=n.ui.Widget.extend({init:function(n,t){s.fn.init.call(this,n,t);this.element.addClass(f.classNames.wrapper);this._view=new c(this.element,{messages:this.options.messages.view,toolbar:this.options.toolbar,sheetsbar:this.options.sheetsbar});this._workbook=new e(this.options,this._view);this._controller=new h(this._view,this._workbook);this._autoRefresh=!0;this._bindWorkbookEvents();this._view.workbook(this._workbook);this._view.enableClipboard(!1);this.refresh();this._view.enableClipboard(!0);this._resizeHandler=function(){this.resize()}.bind(this);r(window).on("resize"+u,this._resizeHandler);this.element.on("keydown"+u,this._keyDown.bind(this))},_keyDown:function(n){var t=n.keyCode,u;if(t===i.F11&&n.shiftKey){this._view.sheetsbar._onAddSelect();n.preventDefault();return}if(n.altKey&&t===i.PAGEDOWN)this._view.sheetsbar.trigger("select",{name:this._view.sheetsbar._sheets[this._view.sheetsbar._selectedIndex+1].name(),isAddButton:!1});else if(n.altKey&&t===i.PAGEUP)this._view.sheetsbar.trigger("select",{name:this._view.sheetsbar._sheets[this._view.sheetsbar._selectedIndex-1].name(),isAddButton:!1});else{if(n.altKey&&t===i.DELETE){u=function(n){var t=n.sender;t.isConfirmed()&&this._view.sheetsbar.trigger("remove",{name:this.activeSheet()._name(),confirmation:!0})}.bind(this);this._view.sheetsbar._openDialog("confirmation",{close:u});n.preventDefault();return}if(n.altKey&&t===i.R){this._view.sheetsbar._createEditor();n.preventDefault();return}if(t===i.F10&&this._view.tabstrip){this._view.tabstrip.toolbars[this._view.tabstrip.element.find("li.k-state-active").text().toLowerCase()].element.find(":not(.k-overflow-anchor):kendoFocusable:first").focus();this._view.tabstrip.toolbars[this._view.tabstrip.element.find("li.k-state-active").text().toLowerCase()].element.find(".k-toolbar-first-visible").addClass("k-state-focused");n.preventDefault();return}if(n.ctrlKey&&t===i.B)r("[data-tool=bold]")[0].click();else if(n.ctrlKey&&t===i.I)r("[data-tool=italic]")[0].click();else if(n.ctrlKey&&t===i.U)r("[data-tool=underline]")[0].click();else{if(n.altKey&&t===i.H){this._view.tabstrip.select(0);n.preventDefault();return}if(n.altKey&&t===i.N){this._view.tabstrip.select(1);n.preventDefault();return}if(n.altKey&&t===i.A){this._view.tabstrip.select(2);n.preventDefault();return}}}},_resize:function(){this.refresh({layout:!0})},_workbookChange:function(t){if(this._autoRefresh&&this.refresh(t),t.recalc&&t.ref){var i=t.range||new n.spreadsheet.Range(t.ref,this.activeSheet());this.trigger("change",{range:i})}},_workbookCut:function(n){this.trigger("cut",n)},_workbookCopy:function(n){this.trigger("copy",n)},_workbookPaste:function(n){this.trigger("paste",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=o),n.editorClose||(this._view.sheet(this._workbook.activeSheet()),this._controller.sheet(this._workbook.activeSheet()),this._workbook.refresh(n)),n.editorChange||(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 e(r.extend({},this.options,n)),this._bindWorkbookEvents(),this._view.workbook(this._workbook),this._controller.workbook(this._workbook),this.activeSheet(this.activeSheet())):this.refresh()},fromFile:function(n,t){return this._workbook.fromFile(n,t)},saveAsPDF:function(n){this._workbook.saveAsPDF(r.extend({},this.options.pdf,n,{workbook:this._workbook}))},saveAsExcel:function(n){this._workbook.saveAsExcel(n)},draw:function(n,t){this._workbook.draw(n,t)},_workbookExcelExport:function(n){this.trigger("excelExport",n)&&n.preventDefault()},_workbookExcelImport:function(n){this.trigger("excelImport",n)?n.preventDefault():this._initProgress(n.promise)},_initProgress:function(t){var i=r("<div class='k-loading-mask' style='width: 100%; height: 100%; top: 0;'><div class='k-loading-color'/><\/div>").appendTo(this.element),u=r("<div class='k-loading-progress'>").appendTo(i).kendoProgressBar({type:"chunk",chunkCount:10,min:0,max:1,value:0}).data("kendoProgressBar");t.progress(function(n){u.value(n.progress)}).always(function(){n.destroy(i);i.remove()})},_workbookPdfExport:function(n){this.trigger("pdfExport",n)&&n.preventDefault()},_workbookInsertSheet:function(n){this.trigger("insertSheet",n)&&n.preventDefault()},_workbookRemoveSheet:function(n){this.trigger("removeSheet",n)&&n.preventDefault()},_workbookSelectSheet:function(n){this.trigger("selectSheet",n)&&n.preventDefault()},_workbookRenameSheet:function(n){this.trigger("renameSheet",n)&&n.preventDefault()},_workbookInsertRow:function(n){this.trigger("insertRow",n)&&n.preventDefault()},_workbookInsertColumn:function(n){this.trigger("insertColumn",n)&&n.preventDefault()},_workbookDeleteRow:function(n){this.trigger("deleteRow",n)&&n.preventDefault()},_workbookDeleteColumn:function(n){this.trigger("deleteColumn",n)&&n.preventDefault()},_workbookHideRow:function(n){this.trigger("hideRow",n)&&n.preventDefault()},_workbookHideColumn:function(n){this.trigger("hideColumn",n)&&n.preventDefault()},_workbookUnhideRow:function(n){this.trigger("unhideRow",n)&&n.preventDefault()},_workbookUnhideColumn:function(n){this.trigger("unhideColumn",n)&&n.preventDefault()},_workbookSelect:function(n){this.trigger("select",n)},_workbookChangeFormat:function(n){this.trigger("changeFormat",n)},_bindWorkbookEvents:function(){this._workbook.bind("cut",this._workbookCut.bind(this));this._workbook.bind("copy",this._workbookCopy.bind(this));this._workbook.bind("paste",this._workbookPaste.bind(this));this._workbook.bind("change",this._workbookChange.bind(this));this._workbook.bind("excelExport",this._workbookExcelExport.bind(this));this._workbook.bind("excelImport",this._workbookExcelImport.bind(this));this._workbook.bind("pdfExport",this._workbookPdfExport.bind(this));this._workbook.bind("insertSheet",this._workbookInsertSheet.bind(this));this._workbook.bind("removeSheet",this._workbookRemoveSheet.bind(this));this._workbook.bind("selectSheet",this._workbookSelectSheet.bind(this));this._workbook.bind("renameSheet",this._workbookRenameSheet.bind(this));this._workbook.bind("insertRow",this._workbookInsertRow.bind(this));this._workbook.bind("insertColumn",this._workbookInsertColumn.bind(this));this._workbook.bind("deleteRow",this._workbookDeleteRow.bind(this));this._workbook.bind("deleteColumn",this._workbookDeleteColumn.bind(this));this._workbook.bind("hideRow",this._workbookHideRow.bind(this));this._workbook.bind("hideColumn",this._workbookHideColumn.bind(this));this._workbook.bind("unhideRow",this._workbookUnhideRow.bind(this));this._workbook.bind("unhideColumn",this._workbookUnhideColumn.bind(this));this._workbook.bind("select",this._workbookSelect.bind(this));this._workbook.bind("changeFormat",this._workbookChangeFormat.bind(this))},destroy:function(){n.ui.Widget.fn.destroy.call(this);this._workbook.destroy();this._controller.destroy();this._view.destroy();this._resizeHandler&&r(window).off("resize"+u,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"},messages:{},pdf:{area:"workbook",fileName:"Workbook.pdf",proxyURL:"",paperSize:"a4",landscape:!0,margin:null,title:null,author:null,subject:null,keywords:null,creator:"Kendo UI PDF Generator v."+n.version,date:null},defaultCellStyle:{fontFamily:"Arial",fontSize:"12"}},defineName:function(n,t,i){return this._workbook.defineName(n,t,i)},undefineName:function(n){return this._workbook.undefineName(n)},nameValue:function(n){return this._workbook.nameValue(n)},forEachName:function(n){return this._workbook.forEachName(n)},cellContextMenu:function(){return this._view.cellContextMenu},rowHeaderContextMenu:function(){return this._view.rowHeaderContextMenu},colHeaderContextMenu:function(){return this._view.colHeaderContextMenu},events:["cut","copy","paste","pdfExport","excelExport","excelImport","change","render","removeSheet","selectSheet","renameSheet","insertRow","insertColumn","deleteRow","insertSheet","deleteColumn","hideRow","hideColumn","unhideRow","unhideColumn","select","changeFormat"]});n.spreadsheet.ALL_REASONS=o;n.ui.plugin(f);r.extend(!0,f,{classNames:{wrapper:"k-widget k-spreadsheet"}})}}(window.kendo),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.pivot.configurator",["kendo.dom"],n)}(function(){return 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-arrows-dimensions"><\/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-i-cancel",i=s(n.dropTarget);i&&i.validate(this.dataItem(n.sourceNode))&&(t="k-i-plus");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}-sm"><\/span>',u+="#}#"),(r.filterable||e)&&(u+='<span class="k-icon k-i-more-vertical k-setting-fieldmenu"><\/span>'),u+='<span class="k-icon k-i-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-columns"})).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-rows"})).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,sortable:t.sortable,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 i=this.element,n=this.options.height,u,r,f=t._outerHeight;n&&(i.height(n),i.is(":visible")&&(r=i.children(".k-columns").children("div.k-state-default"),n=i.innerHeight(),u=(f(i)-n)/2,n=n-(f(r,!0)-r.height())-u,r.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),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.angular",["kendo.core"],n)}(function(){return 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 l,s,h,c,o;if(n.value){if(s=!1,l=b(r)?function(){return et(r)}:function(){return n.value()},h=function(){var r=u.$viewValue;r===i&&(r=u.$modelValue);r===i&&(r=null);s=!0;setTimeout(function(){if(s=!1,n){var i=t[n.element.attr("k-ng-model")];i&&(r=i);n.options.autoBind!==!1||n.listView.bound()?n.value(r):r&&n.value(r)}},0)},u.$render=h,setTimeout(function(){u.$render!==h&&(u.$render=h,u.$render())}),b(r))r.on("change",function(){s=!0});c=function(n){return function(){var i;(!s||r.is("select"))&&(n&&f&&(i=f.$pristine),u.$setViewValue(l()),n&&(u.$setPristine(),i&&f.$setPristine()),e(t))}};n.first("change",c(!1));n.first("spin",c(!1));kendo.ui.AutoComplete&&n instanceof kendo.ui.AutoComplete||n.first("dataBound",c(!0));o=l();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 v,y;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 w=n(t.element).parents("form"),c=kendo.getter(w.attr("name"),!0)(r),f=o(u),b=f.assign,l=!1,p=kendo.ui.MultiSelect&&t instanceof kendo.ui.MultiSelect,s=function(n){return n&&p?n.length:0},a=s(f(r));t.$angular_setLogicValue(f(r));v=function(n,r){(n===i&&(n=null),l||n==r&&s(n)==a)||(a=s(n),t.$angular_setLogicValue(n))};p?r.$watchCollection(u,v):r.$watch(u,v);y=function(){l=!0;c&&c.$pristine&&c.$setDirty();e(r,function(){b(r,t.$angular_getLogicValue());a=s(f(r))});l=!1};t.first("change",y);t.first("spin",y)}function ht(n,t){var i=n.$on("$destroy",function(){i();t&&(kendo.destroy(t.element),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,y;if(!t._muteRebind&&f!==e){h();s._cleanUp&&s._cleanUp();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],p=t.options.name==="Upload";p&&(r=n(a));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 k(n,t){return function(i,r){return n.call(t,i,r)}}function at(n,t){this[n]=kendo.stringify(t)}function pt(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"),yt.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=vt[o]||"div",r=t.kScopeField||t.scopeField;return"<"+i+" "+s+(r?'="'+r+'"':"")+">"+n.html()+"<\/"+i+">"}}})})),d.indexOf(r.replace("kendo",""))>-1)||(e(r,r),u!=r&&e(u,r))}function wt(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 bt(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",PivotGrid:"PivotDataSource",PivotConfigurator:"PivotDataSource",PanelBar:"HierarchicalDataSource",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=wt(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){this.template=k(at,t);t._cleanUp=k(function(){this.template=null;t._cleanUp=null},this)}],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 vt={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",PanelBar:"ul",TreeView:"ul",Menu:"ul",ContextMenu:"ul",ActionSheet:"ul"},yt=["MobileView","MobileDrawer","MobileLayout","MobileSplitView","MobilePane","MobileModalView"],d=["MobileApplication","MobileView","MobileModalView","MobileLayout","MobileActionSheet","MobileDrawer","MobileSplitView","MobilePane","MobileScrollView","MobilePopOver"];t.forEach(["MobileNavBar","MobileButton","MobileBackButton","MobileDetailButton","MobileTabStrip","MobileScrollView","MobileScroller"],function(n){d.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)});pt(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&&bt(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.bound()?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.bound()?i.value(t):i._preselect(f,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","ui.PanelBar"],"$angular_makeEventHandler",function(n,i,r){return n!="change"?this.next():(r=o(r),function(n){var c=n.sender,l=c.options,a,v,u={kendoEvent:n},f,s,y,p,o,w,h;for(t.isString(l.selectable)&&(a=l.selectable.indexOf("cell")!==-1,v=l.selectable.indexOf("multiple")!==-1),c._checkBoxSelection&&(v=!0),f=u.selected=this.select(),s=u.data=[],y=u.columns=[],o=0;o<f.length;o++)w=a?f[o].parentNode:f[o],h=c.dataItem(w),a?(t.element.inArray(h,s)<0&&s.push(h),p=t.element(f[o]).index(),t.element.inArray(p,y)<0&&y.push(p)):s.push(h);v||(u.dataItem=u.data=s[0],u.angularDataItem=kendo.proxyModelSetters(u.dataItem),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"],PanelBar:["Template"],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(t,u,e,o){for(var s;!s&&o.length;)s=o.shift();s?(s.template(i,f),u.remove()):h.warn(r+" without a matching parent widget found. It can be one of the following: "+n.join(", "))}}}}})})}()}}(window.kendo.jQuery,window.angular),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.web",["kendo.core","kendo.router","kendo.view","kendo.fx","kendo.dom","kendo.data.odata","kendo.data.xml","kendo.data","kendo.ooxml","kendo.excel","kendo.data.signalr","kendo.binder","kendo.drawing","kendo.validator","kendo.userevents","kendo.draganddrop","kendo.mobile.scroller","kendo.groupable","kendo.reorderable","kendo.resizable","kendo.sortable","kendo.selectable","kendo.button","kendo.pager","kendo.popup","kendo.notification","kendo.tooltip","kendo.list","kendo.calendar","kendo.datepicker","kendo.dateinput","kendo.autocomplete","kendo.dropdownlist","kendo.combobox","kendo.multiselect","kendo.colorpicker","kendo.columnmenu","kendo.columnsorter","kendo.grid","kendo.listview","kendo.listbox","kendo.filebrowser","kendo.imagebrowser","kendo.editor","kendo.numerictextbox","kendo.maskedtextbox","kendo.mediaplayer","kendo.menu","kendo.editable","kendo.pivot.fieldmenu","kendo.filtercell","kendo.panelbar","kendo.progressbar","kendo.responsivepanel","kendo.tabstrip","kendo.timepicker","kendo.toolbar","kendo.datetimepicker","kendo.treeview.draganddrop","kendo.treeview","kendo.slider","kendo.splitter","kendo.upload","kendo.dialog","kendo.window","kendo.virtuallist","kendo.scheduler.view","kendo.scheduler.dayview","kendo.scheduler.agendaview","kendo.scheduler.monthview","kendo.scheduler.recurrence","kendo.scheduler","kendo.gantt.list","kendo.gantt.timeline","kendo.gantt","kendo.treelist","kendo.pivotgrid","kendo.spreadsheet","kendo.pivot.configurator","kendo.angular"],n)}(function(){"bundle all";return window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("dataviz/core/kendo-core",["kendo.core","kendo.drawing"],n)}(function(){(function(n){function yi(n){return Array.isArray(n)}function ss(n,t){for(var r,u=yi(t)?t:[t],i=0;i<u.length;i++)r=u[i],n.className.indexOf(r)===-1&&(n.className+=" "+r)}function hs(n,t){n&&n.className&&(n.className=n.className.replace(t,"").replace(de," "))}function fr(n){var i=.5,t;for(n.options.stroke&&kendo.drawing.util.defined(n.options.stroke.width)&&n.options.stroke.width%2==0&&(i=0),t=0;t<n.segments.length;t++)n.segments[t].anchor().round(0).translate(i,i);return n}function nf(n,t){return-n.x*t.y+n.y*t.x<0}function pt(n){return typeof n=="number"&&!isNaN(n)}function pi(n){return typeof n===ke}function cs(n){return pt(n)||pi(n)&&isFinite(n)}function tf(n){return typeof n=="object"}function ge(n){return pt(n)?n+"px":n}function ls(n){return no.test(n)}function as(n,t){var u=pi(t)?[t]:t,f,e,r,i,o;if(yi(u)){for(f={},e=window.getComputedStyle(n),r=0;r<u.length;r++)i=u[r],f[i]=ls(i)?parseFloat(e[i]):e[i];return f}if(tf(t))for(o in t)n.style[o]=ge(t[o])}function lt(n,t){t===void 0&&(t=0);var i={top:0,right:0,bottom:0,left:0};return typeof n=="number"?i[v]=i[ut]=i[g]=i[nt]=n:(i[v]=n[v]||t,i[ut]=n[ut]||t,i[g]=n[g]||t,i[nt]=n[nt]||t),i}function ff(n){n===void 0&&(n={});var t;return n.template?n.template=t=or.compile(n.template):he(n.content)&&(t=n.content),t}function iu(n,t){for(var u=n.length,r=[],i=0;i<u;i++)t(n[i])&&r.push(n[i]);return r}function ys(n,t){var r,i;if(n.className)for(r=t.split(" "),i=0;i<r.length;i++)if(n.className.indexOf(r[i])!==-1)return!0}function ct(n,t){if(t)return t.indexOf(n)!==-1}function ps(n,t,i){return kendo.drawing.util.round(n+(t-n)*i,rt)}function of(n,t){for(var r,f=n.length,u=[],i=0;i<f;i++)r=t(n[i]),kendo.drawing.util.defined(r)&&u.push(r);return u}function ws(n){var t=0;return n.wheelDelta&&(t=-n.wheelDelta/120,t=t>0?Math.ceil(t):Math.floor(t)),n.detail&&(t=kendo.drawing.util.round(n.detail/3)),t}function w(n,t){var i=n.prototype;i.options=i.options?c({},i.options,t):t}function lf(n){for(var t,i=vi,r=tr,u=0,f=n.length;u<f;u++)t=n[u],t!==null&&isFinite(t)&&(i=Math.min(i,t),r=Math.max(r,t));return{min:i===vi?undefined:i,max:r===tr?undefined:r}}function ru(n,t,i,r,u){var f=wt(u);return new k(i+(n-i)*Math.cos(f)+(t-r)*Math.sin(f),r-(n-i)*Math.sin(f)+(t-r)*Math.cos(f))}function th(n,t){return n-t}function rh(n,t){if(n.x1===t.x1&&n.y1===t.y1&&n.x2===t.x2&&n.y2===t.y2)return t;var r=Math.min(n.x1,t.x1),u=Math.max(n.x1,t.x1),e=Math.min(n.x2,t.x2),c=Math.max(n.x2,t.x2),o=Math.min(n.y1,t.y1),s=Math.max(n.y1,t.y1),h=Math.min(n.y2,t.y2),l=Math.max(n.y2,t.y2),i=[];return i[0]=new f(u,o,e,s),i[1]=new f(r,s,u,h),i[2]=new f(e,s,c,h),i[3]=new f(u,h,e,l),n.x1===r&&n.y1===o||t.x1===r&&t.y1===o?(i[4]=new f(r,o,u,s),i[5]=new f(e,h,c,l)):(i[4]=new f(e,o,c,s),i[5]=new f(r,h,u,l)),iu(i,function(n){return n.height()>0&&n.width()>0})[0]}function uh(t){for(var i,u=t.stops,f=t.innerRadius/t.radius*100,o=u.length,e=[],r=0;r<o;r++)i=n.extend({},u[r]),i.offset=(i.offset*(100-f)+f)/100,e.push(i);return e}function vf(n){var t=n.origin,i=n.bottomRight();return new f(t.x,t.y,i.x,i.y)}function co(n,t){var u=n.tickX,f=n.tickY,i=n.position,r=new b({stroke:{width:t.width,color:t.color}});return n.vertical?r.moveTo(u,i).lineTo(u+t.size,i):r.moveTo(i,f).lineTo(i,f+t.size),fr(r),r}function lo(n,t){var u=n.lineStart,f=n.lineEnd,i=n.position,r=new b({stroke:{width:t.width,color:t.color,dashType:t.dashType}});return n.vertical?r.moveTo(u,i).lineTo(f,i):r.moveTo(i,u).lineTo(i,f),fr(r),r}function cu(n,t){var i=n.getTime()-t,r=n.getTimezoneOffset()-t.getTimezoneOffset();return i-r*wi}function s(n,t){return new Date(n.getTime()+t)}function i(n){var t;return n instanceof Date?t=n:n&&(t=new Date(n)),t}function ao(n,t){t===void 0&&(t=0);var r=0,i=n.getDay();if(!isNaN(i))while(i!==t)i===0?i=6:i--,r++;return s(n,-r*ri)}function lu(n,t){return t===0&&n.getHours()===23?(n.setHours(n.getHours()+2),!0):!1}function oh(n,t){var i=new Date(n),r;return i.setMinutes(0,0,0),r=(n.getTimezoneOffset()-i.getTimezoneOffset())*wi,s(i,r+t*hu)}function y(n,t,r,u){var f=n,e,o;return n&&(e=i(n),o=e.getHours(),r===ii?(f=new Date(e.getFullYear()+t,0,1),lu(f,0)):r===ci?(f=new Date(e.getFullYear(),e.getMonth()+t,1),lu(f,o)):r===lr?(f=y(ao(e,u),t*7,bt),lu(f,o)):r===bt?(f=new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),lu(f,o)):r===cr?f=oh(e,t):r===wf?(f=s(e,t*wi),f.getSeconds()>0&&f.setSeconds(0)):r===pf?f=s(e,t*bf):r===su&&(f=s(e,t)),r!==su&&f.getMilliseconds()>0&&f.setMilliseconds(0)),f}function ar(n,t,r){return y(i(n),0,t,r)}function ne(n,t,r){var u=i(n);return u&&ar(u,t,r).getTime()===u.getTime()?u:y(u,1,t,r)}function vr(n,t){return n&&t?n.getTime()-t.getTime():-1}function ot(n,t){return n.getTime()-t}function p(n){var r,t;if(yi(n)){for(r=[],t=0;t<n.length;t++)r.push(p(n[t]));return r}if(n)return i(n).getTime()}function li(n,t){return n&&t?p(n)===p(t):n===t}function vo(n,t,i){return cu(n,t)/kt[i]}function bi(n,t,r,u){var f=i(n),e=i(t),o;return o=r===ci?f.getMonth()-e.getMonth()+(f.getFullYear()-e.getFullYear())*12+vo(f,new Date(f.getFullYear(),f.getMonth()),bt)/new Date(f.getFullYear(),f.getMonth()+1,0).getDate():r===ii?f.getFullYear()-e.getFullYear()+bi(f,new Date(f.getFullYear(),0),ci,1)/12:r===bt||r===lr?vo(f,e,r):ot(f,t)/kt[r],o/u}function au(n,t,i){return i===ii?t.getFullYear()-n.getFullYear():i===ci?au(n,t,ii)*12+t.getMonth()-n.getMonth():i===bt?Math.floor(ot(t,n)/ri):Math.floor(ot(t,n)/kt[i])}function sh(n,t){for(var r=0,u=t.length-1,i,f;r<=u;){if(i=Math.floor((r+u)/2),f=t[i],f<n){r=i+1;continue}if(f>n){u=i-1;continue}while(li(t[i-1],n))i--;return i}return t[i]<=n?i:i-1}function oi(n,t){return pi(t)?n.parseDate(t)||i(t):i(t)}function te(n,t){var r,i;if(yi(t)){for(r=[],i=0;i<t.length;i++)r.push(oi(n,t[i]));return r}return oi(n,t)}function hh(n,t){var r,i;if(n instanceof Date){for(r=t.length,i=0;i<r;i++)if(li(t[i],n))return i;return-1}return t.indexOf(n)}function vu(n,i){var r=t(i-n,o-1);if(r===0){if(i===0)return.1;r=Math.abs(i)}var f=Math.pow(10,Math.floor(Math.log(r)/Math.log(10))),u=t(r/f,o),e=1;return e=u<1.904762?.2:u<4.761904?.5:u<9.523809?1:2,t(f*e,o)}function lh(n,t,i){var u,r,f;if(!n&&!t)return 0;if(n>=0&&t>=0){if(r=n===t?0:n,f=(t-r)/t,i===!1||!i&&f>bo)return 0;u=Math.max(0,r-(t-r)/2)}else u=n;return u}function ah(n,t,i){var u,r,f;if(!n&&!t)return 1;if(n<=0&&t<=0){if(r=n===t?0:t,f=Math.abs((r-n)/r),i===!1||!i&&f>bo)return 0;u=Math.min(0,r-(n-r)/2)}else u=t;return u}function go(n,i){return t(Math.floor(n/i)*i,o)}function yu(n,i){return t(Math.ceil(n/i)*i,o)}function pu(n){return Math.max(Math.min(n,po),-po)}function vh(n,t,i){var o=i.narrowRange,u=lh(n,t,o),f=ah(n,t,o),r=vu(u,f),e={majorUnit:r};return i.roundToMajorUnit!==!1&&(u<0&&ts(u,r,1/3)&&(u-=r),f>0&&ts(f,r,1/3)&&(f+=r)),e.min=go(u,r),e.max=yu(f,r),e}function yh(n,t){return{min:e(t.min)?Math.min(n.min,t.min):n.min,max:e(t.max)?Math.max(n.max,t.max):n.max,majorUnit:n.majorUnit}}function ph(n,t){var r=t,u,f,o,i;return t&&(u=e(t.min),f=e(t.max),o=u||f,o&&t.min===t.max&&(t.min>0?t.min=0:t.max=1),t.majorUnit?(n.min=go(n.min,t.majorUnit),n.max=yu(n.max,t.majorUnit)):o&&(r=c(n,t),n.majorUnit=vu(r.min,r.max))),n.minorUnit=(r.majorUnit||n.majorUnit)/5,i=c(n,r),i.min>=i.max&&(u&&!f?i.max=i.min+i.majorUnit:!u&&f&&(i.min=i.max-i.majorUnit)),i}function ts(n,i,r){var u=t(Math.abs(n%i),o),f=i*(1-r);return u===0||u>f}function wh(n){var t=cr;return n>=gf?t=ii:n>=df?t=ci:n>=kf?t=lr:n>=ri&&(t=bt),t}function bh(n,t,r){var e=r.min||n,f=r.max||t,u=r.baseUnit||(f&&e?wh(cu(f,e)):cr),c=kt[u],o=ar(p(e)-1,u)||i(f),s=ne(p(f)+1,u),w=r.majorUnit?r.majorUnit:undefined,h=w||yu(vu(o.getTime(),s.getTime()),c)/c,l=au(o,s,u),b=yu(l,h),a=b-l,v=Math.floor(a/2),k=a-v;return r.baseUnit||delete r.baseUnit,r.baseUnit=r.baseUnit||u,r.min=r.min||y(o,-v,u),r.max=r.max||y(s,k,u),r.minorUnit=r.minorUnit||h/5,r.majorUnit=h,r}function kh(n,t,i,r){var u=i.min,f=i.max;return e(i.axisCrossingValue)&&i.axisCrossingValue<=0&&ue(),e(r.max)?r.max<=0&&ue():f=t,e(r.min)?r.min<=0&&ue():u=n,{min:u,max:f}}function dh(n,t,i){var r=i.majorUnit,u=n;return n<=0?u=t<=1?Math.pow(r,-2):1:i.narrowRange||(u=Math.pow(r,Math.floor(st(n,r)))),u}function gh(n,i){var r=t(st(n,i),o)%1;return n<=0?i:r!==0&&(r<.3||r>.9)?Math.pow(i,st(n,i)+.2):Math.pow(i,Math.ceil(st(n,i)))}function ue(){throw new Error("Non positive values cannot be used for a logarithmic axis");}function st(n,t){return Math.log(n)/Math.log(t)}function bu(n,t){return 180-Math.abs(Math.abs(n-t)-180)}function rs(n){return n<=0?-1:1}var de,no,io,gr,nu,rf,tu,uf,or,ro,ef,uo,k,f,gt,a,et,uu,af,fu,so,eu,ti,d,yo,si,ns,vt,ie,re,pr,fe,ki,wu,ee,oe,se;window.kendo.dataviz=window.kendo.dataviz||{};var yt=kendo.drawing,us=yt.util,b=yt.Path,fi=yt.Group,it=kendo.Class,dt=kendo.geometry,wr=dt.Rect,di=dt.Circle,br=dt.transform,ai=dt.Segment,fs=kendo.dataviz,c=kendo.deepExtend,he=kendo.isFunction,es=kendo.getter,r="x",u="y",v="top",g="bottom",nt="left",ut="right",ft="center",gi="width",nr="height",rt=3,vi=Number.MAX_VALUE,tr=-Number.MAX_VALUE,ce=600,le=400,l="#fff",ht="#000",ae="12px sans-serif",o=10,ve="axisLabelClick",ye="noteClick",pe="noteHover",ir="outside",kr="none",rr="circle",we="triangle",be="cross",ur="arc",dr="inside",ke="string",ku="object",du="date",gu=/\{\d+:?/,os={X:r,Y:u,WIDTH:gi,HEIGHT:nr,DEFAULT_HEIGHT:le,DEFAULT_WIDTH:ce,TOP:v,LEFT:nt,BOTTOM:g,RIGHT:ut,CENTER:ft,COORD_PRECISION:rt,DEFAULT_PRECISION:o,CIRCLE:rr,TRIANGLE:we,CROSS:be,MAX_VALUE:vi,MIN_VALUE:tr,WHITE:l,BLACK:ht,DEFAULT_FONT:ae,AXIS_LABEL_CLICK:ve,OUTSIDE:ir,INSIDE:dr,NONE:kr,NOTE_CLICK:ye,NOTE_HOVER:pe,VALUE:"value",STRING:ke,OBJECT:ku,DATE:du,ARC:ur,FORMAT_REGEX:gu,HIGHLIGHT_ZINDEX:100};de=/\s+/g;no=/width|height|top|left|bottom|right/i;var vs={format:function(n,t){return t},toString:function(n){return n},parseDate:function(n){return new Date(n)}},to=vs,er=it.extend({});er.register=function(n){to=n};Object.defineProperties&&Object.defineProperties(er,{implementation:{get:function(){return to}}});io=/\{(\d+)(:[^\}]+)?\}/g;gr=it.extend({init:function(n){this._intlService=n},auto:function(n){for(var i=[],r=arguments.length-1,t;r-->0;)i[r]=arguments[r+1];return(t=this.intlService,pi(n)&&n.match(gu))?t.format.apply(t,[n].concat(i)):t.toString(i[0],n)},localeAuto:function(n,t,i){var r=this.intlService;return pi(n)&&n.match(gu)?n.replace(io,function(n,u,f){var e=t[parseInt(u,10)];return r.toString(e,f?f.substring(1):"",i)}):r.toString(t[0],n,i)}});Object.defineProperties&&Object.defineProperties(gr.fn,{intlService:{get:function(){return this._intlService||er.implementation}}});nu=it.extend({init:function(n,t){t===void 0&&(t={});this._intlService=t.intlService;this.sender=t.sender||n;this.format=new gr(t.intlService);this.chart=n;this.rtl=t.rtl},notify:function(n,t){this.chart.trigger(n,t)}});Object.defineProperties&&Object.defineProperties(nu.fn,{intl:{get:function(){return this._intlService||er.implementation}}});tu=it.extend({});tu.register=function(n){rf=n};tu.create=function(n,t){if(rf)return rf.create(n,t)};uf={compile:function(n){return n}};or=it.extend({});or.register=function(n){uf=n};or.compile=function(n){return uf.compile(n)};ro={ChartService:nu,DomEventsBuilder:tu,FormatService:gr,IntlService:er,TemplateService:or};ef="trigger";uo=it.extend({init:function(n,t){this.observer=n;this.handlerMap=c({},this.handlerMap,t)},trigger:function(n,t){var r=this,f=r.observer,u=r.handlerMap,i;return u[n]?i=this.callObserver(u[n],t):f[ef]&&(i=this.callObserver(ef,n,t)),i},callObserver:function(n){for(var i=[],t=arguments.length-1;t-->0;)i[t]=arguments[t+1];return this.observer[n].apply(this.observer,i)},requiresHandlers:function(n){var i=this,t;if(this.observer.requiresHandlers)return this.observer.requiresHandlers(n);for(t=0;t<n.length;t++)if(i.handlerMap[n[t]])return!0}});var tt=kendo.drawing.util,sf=tt.append,bs=tt.bindEvents,e=tt.defined,hf=tt.deg,ks=tt.elementOffset,ds=tt.elementSize,cf=tt.eventElement,gs=tt.eventCoordinates,at=tt.last,h=tt.limitValue,fo=tt.objectKey,wt=tt.rad,t=tt.round,nh=tt.unbindEvents,ei=tt.valueOrDefault,hi=it.extend({});hi.fetchFonts=function(n,t,i){i===void 0&&(i={depth:0});!n||i.depth>5||!document.fonts||Object.keys(n).forEach(function(r){var u=n[r];r!=="dataSource"&&r[0]!=="$"&&u&&(r==="font"?t.push(u):typeof u=="object"&&(i.depth++,hi.fetchFonts(u,t,i),i.depth--))})};hi.loadFonts=function(n,t){var i=[];if(n.length>0&&document.fonts){try{i=n.map(function(n){return document.fonts.load(n)})}catch(r){kendo.logToConsole(r)}Promise.all(i).then(t,t)}else t()};hi.preloadFonts=function(n,t){var i=[];hi.fetchFonts(n,i);hi.loadFonts(i,t)};k=it.extend({init:function(n,t){this.x=n||0;this.y=t||0},clone:function(){return new k(this.x,this.y)},equals:function(n){return n&&this.x===n.x&&this.y===n.y},rotate:function(n,i){var f=wt(i),e=Math.cos(f),o=Math.sin(f),r=n.x,u=n.y,s=this,h=s.x,c=s.y;return this.x=t(r+(h-r)*e+(c-u)*o,rt),this.y=t(u+(c-u)*e-(h-r)*o,rt),this},multiply:function(n){return this.x*=n,this.y*=n,this},distanceTo:function(n){var t=this.x-n.x,i=this.y-n.y;return Math.sqrt(t*t+i*i)}});k.onCircle=function(n,t,i){var r=wt(t);return new k(n.x-i*Math.cos(r),n.y-i*Math.sin(r))};f=it.extend({init:function(n,t,i,r){this.x1=n||0;this.y1=t||0;this.x2=i||0;this.y2=r||0},equals:function(n){return this.x1===n.x1&&this.x2===n.x2&&this.y1===n.y1&&this.y2===n.y2},width:function(){return this.x2-this.x1},height:function(){return this.y2-this.y1},translate:function(n,t){return this.x1+=n,this.x2+=n,this.y1+=t,this.y2+=t,this},move:function(n,t){var i=this.height(),r=this.width();return e(n)&&(this.x1=n,this.x2=this.x1+r),e(t)&&(this.y1=t,this.y2=this.y1+i),this},wrap:function(n){return this.x1=Math.min(this.x1,n.x1),this.y1=Math.min(this.y1,n.y1),this.x2=Math.max(this.x2,n.x2),this.y2=Math.max(this.y2,n.y2),this},wrapPoint:function(n){var t=yi(n),i=t?n[0]:n.x,r=t?n[1]:n.y;return this.wrap(new f(i,r,i,r)),this},snapTo:function(n,t){return t!==r&&t||(this.x1=n.x1,this.x2=n.x2),t!==u&&t||(this.y1=n.y1,this.y2=n.y2),this},alignTo:function(n,t){var o=this.height(),s=this.width(),i=t===v||t===g?u:r,h=i===u?o:s,f,e;return t===ft?(f=n.center(),e=this.center(),this.x1+=f.x-e.x,this.y1+=f.y-e.y):this[i+1]=t===v||t===nt?n[i+1]-h:n[i+2],this.x2=this.x1+s,this.y2=this.y1+o,this},shrink:function(n,t){return this.x2-=n,this.y2-=t,this},expand:function(n,t){return this.shrink(-n,-t),this},pad:function(n){var t=lt(n);return this.x1-=t.left,this.x2+=t.right,this.y1-=t.top,this.y2+=t.bottom,this},unpad:function(n){var t=lt(n);return t.left=-t.left,t.top=-t.top,t.right=-t.right,t.bottom=-t.bottom,this.pad(t)},clone:function(){return new f(this.x1,this.y1,this.x2,this.y2)},center:function(){return new k(this.x1+this.width()/2,this.y1+this.height()/2)},containsPoint:function(n){return n.x>=this.x1&&n.x<=this.x2&&n.y>=this.y1&&n.y<=this.y2},points:function(){return[new k(this.x1,this.y1),new k(this.x2,this.y1),new k(this.x2,this.y2),new k(this.x1,this.y2)]},getHash:function(){return[this.x1,this.y1,this.x2,this.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 t=this.width(),i=this.height(),h=this.center(),r=h.x,u=h.y,f=ru(0,0,r,u,n),e=ru(t,0,r,u,n),o=ru(t,i,r,u,n),s=ru(0,i,r,u,n);return t=Math.max(f.x,e.x,o.x,s.x)-Math.min(f.x,e.x,o.x,s.x),i=Math.max(f.y,e.y,o.y,s.y)-Math.min(f.y,e.y,o.y,s.y),this.x2=this.x1+t,this.y2=this.y1+i,this},toRect:function(){return new wr([this.x1,this.y1],[this.width(),this.height()])},hasSize:function(){return this.width()!==0&&this.height()!==0},align:function(n,t,i){var u=t+1,f=t+2,o=t===r?gi:nr,e=this[o]();ct(i,[nt,v])?(this[u]=n[u],this[f]=this[u]+e):ct(i,[ut,g])?(this[f]=n[f],this[u]=this[f]-e):i===ft&&(this[u]=n[u]+(n[o]()-e)/2,this[f]=this[u]+e)}});gt=it.extend({init:function(n,t,i,r,u){this.center=n;this.innerRadius=t;this.radius=i;this.startAngle=r;this.angle=u},clone:function(){return new gt(this.center,this.innerRadius,this.radius,this.startAngle,this.angle)},middle:function(){return this.startAngle+this.angle/2},setRadius:function(n,t){return t?this.innerRadius=n:this.radius=n,this},point:function(n,i){var r=wt(n),f=Math.cos(r),e=Math.sin(r),u=i?this.innerRadius:this.radius,o=t(this.center.x-f*u,rt),s=t(this.center.y-e*u,rt);return new k(o,s)},adjacentBox:function(n,t,i){var h=this.clone().expand(n),r=h.middle(),c=h.point(r),l=t/2,a=i/2,u=Math.sin(wt(r)),e=Math.cos(wt(r)),o=c.x-l,s=c.y-a;return Math.abs(u)<.9&&(o+=l*-e/Math.abs(e)),Math.abs(e)<.9&&(s+=a*-u/Math.abs(u)),new f(o,s,o+t,s+i)},containsPoint:function(n){var i=this.center,e=this.innerRadius,o=this.radius,a=this.startAngle,v=this.startAngle+this.angle,r=n.x-i.x,u=n.y-i.y,f=new k(r,u),s=this.point(a),h=new k(s.x-i.x,s.y-i.y),c=this.point(v),y=new k(c.x-i.x,c.y-i.y),l=t(r*r+u*u,rt);return(h.equals(f)||nf(h,f))&&!nf(y,f)&&l>=e*e&&l<=o*o},getBBox:function(){for(var a=this,i=new f(vi,vi,tr,tr),r=t(this.startAngle%360),e=t((r+this.angle)%360),l=this.innerRadius,n=[0,90,180,270,r,e].sort(th),o=n.indexOf(r),s=n.indexOf(e),c,h=r===e?n:o<s?n.slice(o,s+1):[].concat(n.slice(0,s+1),n.slice(o,n.length)),u=0;u<h.length;u++)c=a.point(h[u]),i.wrapPoint(c),i.wrapPoint(c,l);return l||i.wrapPoint(this.center),i},expand:function(n){return this.radius+=n,this}});var eo=gt.extend({init:function(n,t,i,r){gt.fn.init.call(this,n,0,t,i,r)},expand:function(n){return gt.fn.expand.call(this,n)},clone:function(){return new eo(this.center,this.radius,this.startAngle,this.angle)},setRadius:function(n){return this.radius=n,this}}),ih=.001,sr=it.extend({createRing:function(n,t){var r=n.startAngle+180,i=n.angle+r,s;n.angle>0&&r===i&&(i+=ih);var o=new dt.Point(n.center.x,n.center.y),h=Math.max(n.radius,0),u=Math.max(n.innerRadius,0),f=new dt.Arc(o,{startAngle:r,endAngle:i,radiusX:h,radiusY:h}),e=b.fromArc(f,t).close();return u?(f.radiusX=f.radiusY=u,s=f.pointAt(i),e.lineTo(s.x,s.y),e.arc(i,r,u,u,!0)):e.lineTo(o.x,o.y),e}});sr.current=new sr;a=it.extend({init:function(n){this.children=[];this.options=c({},this.options,n)},reflow:function(n){for(var i,u=this.children,t,r=0;r<u.length;r++)i=u[r],i.reflow(n),t=t?t.wrap(i.box):i.box.clone();this.box=t||n},destroy:function(){var t=this.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},getSender:function(){var n=this.getService();if(n)return n.sender},getService:function(){for(var n=this;n;){if(n.chartService)return n.chartService;n=n.parent}},translateChildren:function(n,t){for(var r=this.children,u=r.length,i=0;i<u;i++)r[i].box.translate(n,t)},append:function(){for(var t,r=arguments,i=this,n=0;n<arguments.length;n++)t=r[n],i.children.push(t),t.parent=i},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,i=t.length,n=0;n<i;n++)t[n].renderVisual()},createVisual:function(){this.visual=new fi({zIndex:this.options.zIndex,visible:ei(this.options.visible,!0)})},createAnimation:function(){this.visual&&(this.animation=yt.Animation.create(this.visual,this.options.animation))},appendVisual:function(n){n.chartElement||(n.chartElement=this);n.options.noclip?this.clipRoot().visual.append(n):e(n.options.zIndex)?this.stackRoot().stackVisual(n):this.isStackRoot?this.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 f=n.options.zIndex||0,i=this.visual.children,e=i.length,r,u,t=0;t<e;t++)if(r=i[t],u=ei(r.options.zIndex,0),u>f)break;this.visual.insert(t,n)},traverse:function(n){for(var t,r=this.children,u=r.length,i=0;i<u;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:function(){},hasHighlight:function(){var n=(this.options||{}).highlight;return!(!this.createHighlight||n&&n.visible===!1)},toggleHighlight:function(t){var o=this,u=(this.options||{}).highlight||{},f=u.visual,i=this._highlight,r;if(!i){if(r={fill:{color:l,opacity:.2},stroke:{color:l,width:1,opacity:.2}},f){if(i=this._highlight=f(n.extend(this.highlightVisualArgs(),{createVisual:function(){return o.createHighlight(r)},sender:this.getSender(),series:this.series,dataItem:this.dataItem,category:this.category,value:this.value,percentage:this.percentage,runningTotal:this.runningTotal,total:this.total})),!i)return}else i=this._highlight=this.createHighlight(r);e(i.options.zIndex)||(i.options.zIndex=ei(u.zIndex,this.options.zIndex));this.appendVisual(i)}i.visible(t)},createGradientOverlay:function(t,i,r){var u=new b(n.extend({stroke:{color:"none"},fill:this.createGradient(r),closed:t.options.closed},i));return u.segments.elements(t.segments.elements()),u},createGradient:function(n){if(this.parent)return this.parent.createGradient(n)}});a.prototype.options={};et=a.extend({init:function(n){a.fn.init.call(this,n);this.options.margin=lt(this.options.margin);this.options.padding=lt(this.options.padding)},reflow:function(n){var l=this,i=this.options,v=i.width,y=i.height,k=i.shrinkToFit,p=v&&y,o=i.margin,s=i.padding,h=i.border.width,e,d=function(){l.align(n,r,i.align);l.align(n,u,i.vAlign);l.paddingBox=e.clone().unpad(o).unpad(h)},t=n.clone(),w,c,b;for(p&&(t.x2=t.x1+v,t.y2=t.y1+y),k&&t.unpad(o).unpad(h).unpad(s),a.fn.reflow.call(this,t),e=p?this.box=new f(0,0,v,y):this.box,k&&p?(d(),t=this.contentBox=this.paddingBox.clone().unpad(s)):(t=this.contentBox=e.clone(),e.pad(s).pad(h).pad(o),d()),this.translateChildren(e.x1-t.x1+o.left+h+s.left,e.y1-t.y1+o.top+h+s.top),w=this.children,c=0;c<w.length;c++)b=w[c],b.reflow(b.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(){a.fn.createVisual.call(this);var n=this.options;n.visible&&this.hasBox()&&this.visual.append(b.fromRect(this.paddingBox.toRect(),this.visualStyle()))},visualStyle:function(){var n=this.options,t=n.border||{};return{stroke:{width:t.width,color:t.color,opacity:ei(t.opacity,n.opacity),dashType:t.dashType},fill:{color:n.background,opacity:n.opacity},cursor:n.cursor}}});w(et,{align:nt,vAlign:v,margin:{},padding:{},border:{color:ht,width:0},background:"",shrinkToFit:!1,width:0,height:0,visible:!0});uu=et.extend({init:function(n,t){et.fn.init.call(this,n);this.pointData=t},getElement:function(){var o=this,u=o.options,n=o.paddingBox,f=u.type,s=u.rotation,h=n.center(),e=n.width()/2,r,i;return!u.visible||!this.hasBox()?null:(r=this.visualStyle(),f===rr?i=new yt.Circle(new di([t(n.x1+e,rt),t(n.y1+n.height()/2,rt)],e),r):f===we?i=b.fromPoints([[n.x1+e,n.y1],[n.x1,n.y2],[n.x2,n.y2]],r).close():f===be?(i=new yt.MultiPath(r),i.moveTo(n.x1,n.y1).lineTo(n.x2,n.y2),i.moveTo(n.x1,n.y2).lineTo(n.x2,n.y1)):i=b.fromRect(n.toRect(),r),s&&i.transform(br().rotate(-s,[h.x,h.y])),i.options.zIndex=u.zIndex,i)},createElement:function(){var i=this,t=this.options.visual,n=this.pointData||{};return t?t({value:n.value,dataItem:n.dataItem,sender:this.getSender(),series:n.series,category:n.category,rect:this.paddingBox.toRect(),options:this.visualOptions(),createVisual:function(){return i.getElement()}}):this.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()}});w(uu,{type:rr,align:ft,vAlign:ft});var hr="radial",oo={glass:{type:"linear",rotation:0,stops:[{offset:0,color:l,opacity:0},{offset:.25,color:l,opacity:.3},{offset:1,color:l,opacity:0}]},sharpBevel:{type:hr,stops:[{offset:0,color:l,opacity:.55},{offset:.65,color:l,opacity:0},{offset:.95,color:l,opacity:.25}]},roundedBevel:{type:hr,stops:[{offset:.33,color:l,opacity:.06},{offset:.83,color:l,opacity:.2},{offset:.95,color:l,opacity:0}]},roundedGlass:{type:hr,supportVML:!1,stops:[{offset:0,color:l,opacity:0},{offset:.5,color:l,opacity:.3},{offset:.99,color:l,opacity:0}]},sharpGlass:{type:hr,supportVML:!1,stops:[{offset:0,color:l,opacity:.2},{offset:.15,color:l,opacity:.15},{offset:.17,color:l,opacity:.35},{offset:.85,color:l,opacity:.05},{offset:.87,color:l,opacity:.15},{offset:.99,color:l,opacity:0}]},bubbleShadow:{type:hr,center:[.5,.5],radius:.5}};af=a.extend({init:function(n){a.fn.init.call(this,n);var t=this.options;t.width=parseInt(t.width,10);t.height=parseInt(t.height,10);this.gradients={}},reflow:function(){var u=this,i=u.options,r=u.children,t=new f(0,0,i.width,i.height),n;for(this.box=t.unpad(i.margin),n=0;n<r.length;n++)r[n].reflow(t),t=rh(t,r[n].box)||new f},createVisual:function(){this.visual=new fi;this.createBackground()},createBackground:function(){var t=this.options,n=t.border||{},i=this.box.clone().pad(t.margin).unpad(n.width),r=b.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(r)},getRoot:function(){return this},createGradient:function(t){var u=this.gradients,f=fo(t),e=oo[t.gradient],i,r;return u[f]?i=u[f]:(r=n.extend({},e,t),e.type==="linear"?i=new yt.LinearGradient(r):(t.innerRadius&&(r.stops=uh(r)),i=new yt.RadialGradient(r),i.supportVML=e.supportVML!==!1),u[f]=i),i}});w(af,{width:ce,height:le,background:l,border:{color:ht,width:0},margin:lt(5),zIndex:-2});fu=a.extend({init:function(n){a.fn.init.call(this,n);this._initDirection()},_initDirection:function(){var n=this.options;n.vertical?(this.groupAxis=r,this.elementAxis=u,this.groupSizeField=gi,this.elementSizeField=nr,this.groupSpacing=n.spacing,this.elementSpacing=n.vSpacing):(this.groupAxis=u,this.elementAxis=r,this.groupSizeField=nr,this.elementSizeField=gi,this.groupSpacing=n.vSpacing,this.elementSpacing=n.spacing)},reflow:function(n){this.box=n.clone();this.reflowChildren()},reflowChildren:function(){var e=this,t=this,n=t.box,i=t.elementAxis,r=t.groupAxis,w=t.elementSizeField,c=t.groupSizeField,l=this.groupOptions(),b=l.groups,k=l.groupsSize,it=l.maxGroupElementsSize,d=b.length,a=n[r+1]+this.alignStart(k,n[c]()),v,o,s;if(d){for(v=a,o=0;o<d;o++){var y=b[o],g=y.groupElements,p=n[i+1],rt=g.length;for(s=0;s<rt;s++){var nt=g[s],h=e.elementSize(nt),tt=v+e.alignStart(h[c],y.groupSize),u=new f;u[r+1]=tt;u[r+2]=tt+h[c];u[i+1]=p;u[i+2]=p+h[w];nt.reflow(u);p+=h[w]+e.elementSpacing}v+=y.groupSize+e.groupSpacing}n[r+1]=a;n[r+2]=a+k;n[i+2]=n[i+1]+it}},alignStart:function(n,t){var i=0,r=this.options.align;return r===ut||r===g?i=t-n:r===ft&&(i=(t-n)/2),i},groupOptions:function(){for(var f,o,a=this,r=this,v=r.box,y=r.children,s=r.elementSizeField,w=r.groupSizeField,p=r.elementSpacing,b=r.groupSpacing,k=t(v[s]()),d=y.length,h=[],i=0,n=0,c=0,u=0,e=[],l=0;l<d;l++)f=y[l],f.box||f.reflow(v),o=a.elementSize(f),a.options.wrap&&t(n+p+o[s])>k&&(h.push({groupElements:e,groupSize:i,groupElementsSize:n}),u=Math.max(u,n),c+=b+i,i=0,n=0,e=[]),i=Math.max(i,o[w]),n>0&&(n+=p),n+=o[s],e.push(f);return h.push({groupElements:e,groupSize:i,groupElementsSize:n}),u=Math.max(u,n),c+=i,{groups:h,groupsSize:c,maxGroupElementsSize:u}},elementSize:function(n){return{width:n.box.width(),height:n.box.height()}},createVisual:function(){}});w(fu,{vertical:!0,wrap:!0,vSpacing:0,spacing:0});so=yt.Text;eu=a.extend({init:function(n,t){a.fn.init.call(this,t);this.content=n;this.reflow(new f)},reflow:function(n){var i=this.options,t=i.size=us.measureText(this.content,{font:i.font});this.baseline=t.baseline;this.box=new f(n.x1,n.y1,n.x1+t.width,n.y1+t.height)},createVisual:function(){var n=this.options,t=n.font,i=n.color,r=n.opacity,u=n.cursor;this.visual=new so(this.content,this.box.toRect().topLeft(),{font:t,fill:{color:i,opacity:r},cursor:u})}});w(eu,{font:ae,color:ht});var fh=/\n/m,ni=et.extend({init:function(n,t){et.fn.init.call(this,t);this.content=n;this._initContainer();this.options._autoReflow!==!1&&this.reflow(new f)},_initContainer:function(){var i=this.options,r=String(this.content).split(fh),t=new fu({vertical:!0,align:i.align,wrap:!1}),f=c({},i,{opacity:1,animation:null}),n,u;for(this.container=t,this.append(t),n=0;n<r.length;n++)u=new eu(r[n].trim(),f),t.append(u)},reflow:function(n){var u=this.options,e=u.visual,t,f,i,r;this.container.options.align=u.align;e&&!this._boxReflow?(t=n,t.hasSize()||(this._boxReflow=!0,this.reflow(t),this._boxReflow=!1,t=this.box),f=this.visual=e(this.visualContext(t)),f&&(t=vf(f.clippedBBox()||new wr),f.options.zIndex=u.zIndex),this.box=this.contentBox=this.paddingBox=t):(et.fn.reflow.call(this,n),u.rotation&&(i=lt(u.margin),r=this.box.unpad(i),this.targetBox=n,this.normalBox=r.clone(),r=this.rotate(),r.translate(i.left-i.right,i.top-i.bottom),this.rotatedBox=r.clone(),r.pad(i)))},createVisual:function(){var n=this.options,t;n.visible&&(this.visual=new fi({transform:this.rotationTransform(),zIndex:n.zIndex,noclip:n.noclip}),this.hasBox()&&(t=b.fromRect(this.paddingBox.toRect(),this.visualStyle()),this.visual.append(t)))},renderVisual:function(){if(this.options.visual){var n=this.visual;n&&!e(n.options.noclip)&&(n.options.noclip=this.options.noclip);this.addVisual();this.createAnimation()}else et.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:this.content,rect:n.toRect(),sender:this.getSender(),options:this.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,r,n.align),this.align(this.targetBox,u,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 br().translate(u.x-i,u.y-r).rotate(n,[i,r])}}),ou=a.extend({init:function(t){a.fn.init.call(this,t);this.append(new ni(this.options.text,n.extend({},this.options,{vAlign:this.options.position})))},reflow:function(n){a.fn.reflow.call(this,n);this.box.snapTo(n,r)}});ou.buildTitle=function(t,i,r){var u=t,f;return typeof t=="string"&&(u={text:t}),u=n.extend({visible:!0},r,u),u&&u.visible&&u.text&&(f=new ou(u),i.append(f)),f};w(ou,{color:ht,position:v,align:ft,margin:lt(5),padding:lt(5)});ti=ni.extend({init:function(n,t,i,r,u){ni.fn.init.call(this,t,u);this.text=t;this.value=n;this.index=i;this.dataItem=r;this.reflow(new f)},visualContext:function(n){var t=ni.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(n,t){n.trigger(ve,{element:cf(t),value:this.value,text:this.text,index:this.index,dataItem:this.dataItem,axis:this.parent.options})},rotate:function(){if(this.options.alignRotation!==ft){var n=this.normalBox.toRect(),t=this.rotationTransform();this.box=vf(n.bbox(t.matrix()))}else ni.fn.rotate.call(this);return this.box},rotationTransform:function(){var w=this.options,b=w.rotation,k,d,s,p,ut;if(!b)return null;if(w.alignRotation===ft)return ni.fn.rotationTransform.call(this);var h=br().rotate(b).matrix(),c=this.normalBox.toRect(),l=this.targetBox.toRect(),i=w.rotationOrigin||v,e=i===v||i===g?r:u,n=i===v||i===g?u:r,tt=i===v||i===nt?l.origin:l.bottomRight(),a=c.topLeft().transformCopy(h),y=c.topRight().transformCopy(h),it=c.bottomRight().transformCopy(h),rt=c.bottomLeft().transformCopy(h),et=wr.fromPoints(a,y,it,rt),f={};return f[n]=l.origin[n]-et.origin[n],k=Math.abs(a[n]+f[n]-tt[n]),d=Math.abs(y[n]+f[n]-tt[n]),t(k,o)===t(d,o)?(s=a,p=y):d<k?(s=y,p=it):(s=a,p=rt),ut=s[e]+(p[e]-s[e])/2,f[e]=l.center()[e]-ut,br().translate(f.x,f.y).rotate(b)}});w(ti,{_autoReflow:!1});var ho=7,eh="#fff",yf=et.extend({init:function(n,t,i){et.fn.init.call(this,t);this.fields=n;this.chartService=i;this.render()},hide:function(){this.options.visible=!1},show:function(){this.options.visible=!0},render:function(){var o=this.options,s,i;if(o.visible){var n=o.label,t=o.icon,h=new f,r=t.size,u=this.fields.text,l,a;e(n)&&n.visible&&(s=ff(n),s?u=s(this.fields):n.format&&(u=this.chartService.format.auto(n.format,u)),n.color||(n.color=n.position===dr?eh:t.background),this.label=new ni(u,c({},n)),n.position!==dr||e(r)||(t.type===rr?r=Math.max(this.label.box.width(),this.label.box.height()):(l=this.label.box.width(),a=this.label.box.height()),h.wrap(this.label.box)));t.width=l||r||ho;t.height=a||r||ho;i=new uu(c({},t));this.marker=i;this.append(i);this.label&&this.append(this.label);i.reflow(new f);this.wrapperBox=h.wrap(i.box)}},reflow:function(n){var h=this,r=h.options,o=h.label,c=h.marker,u=h.wrapperBox,f=n.center(),l=r.line.length,e=r.position,i,s,t;r.visible&&(ct(e,[nt,ut])?e===nt?(t=u.alignTo(n,e).translate(-l,n.center().y-u.center().y),r.line.visible&&(i=[n.x1,f.y],this.linePoints=[i,[t.x2,f.y]],s=t.clone().wrapPoint(i))):(t=u.alignTo(n,e).translate(l,n.center().y-u.center().y),r.line.visible&&(i=[n.x2,f.y],this.linePoints=[i,[t.x1,f.y]],s=t.clone().wrapPoint(i))):e===g?(t=u.alignTo(n,e).translate(n.center().x-u.center().x,l),r.line.visible&&(i=[f.x,n.y2],this.linePoints=[i,[f.x,t.y1]],s=t.clone().wrapPoint(i))):(t=u.alignTo(n,e).translate(n.center().x-u.center().x,-l),r.line.visible&&(i=[f.x,n.y1],this.linePoints=[i,[f.x,t.y2]],s=t.clone().wrapPoint(i))),c&&c.reflow(t),o&&(o.reflow(t),c&&(r.label.position===ir&&o.box.alignTo(c.box,e),o.reflow(o.box))),this.contentBox=t,this.targetBox=n,this.box=s||t)},createVisual:function(){et.fn.createVisual.call(this);this.visual.options.noclip=this.options.noclip;this.options.visible&&this.createLine()},renderVisual:function(){var i=this,t=this.options,r=t.visual;t.visible&&r?(this.visual=r(n.extend(this.fields,{sender:this.getSender(),rect:this.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(){i.createVisual();i.renderChildren();var n=i.visual;return delete i.visual,n}})),this.addVisual()):et.fn.renderVisual.call(this)},createLine:function(){var n=this.options.line,t;this.linePoints&&(t=b.fromPoints(this.linePoints,{stroke:{color:n.color,width:n.width,dashType:n.dashType}}),fr(t),this.visual.append(t))},click:function(n,t){var i=this.eventArgs(t);n.trigger(ye,i)||t.preventDefault()},hover:function(n,t){var i=this.eventArgs(t);n.trigger(pe,i)||t.preventDefault()},leave:function(n){n._unsetActivePoint()},eventArgs:function(t){var i=this.options;return n.extend(this.fields,{element:cf(t),text:e(i.label)?i.label.text:"",visual:this.visual})}});w(yf,{icon:{visible:!0,type:rr},label:{position:dr,visible:!0,align:ft,vAlign:ft},line:{visible:!0},visible:!0,position:v,zIndex:2});d=a.extend({init:function(n,t){t===void 0&&(t=new nu);a.fn.init.call(this,n);this.chartService=t;this.options.visible||(this.options=c({},this.options,{labels:{visible:!1},line:{visible:!1},margin:0,majorTickSize:0,minorTickSize:0}));this.options.minorTicks=c({},{color:this.options.line.color,width:this.options.line.width,visible:this.options.minorTickType!==kr},this.options.minorTicks,{size:this.options.minorTickSize,align:this.options.minorTickType});this.options.majorTicks=c({},{color:this.options.line.color,width:this.options.line.width,visible:this.options.majorTickType!==kr},this.options.majorTicks,{size:this.options.majorTickSize,align:this.options.majorTickType});this.options._deferLabels||this.createLabels();this.createTitle();this.createNotes()},labelsRange:function(){return{min:this.options.labels.skip,max:this.labelsCount()}},createLabels:function(){var f=this,t=this.options,o=t.vertical?ut:ft,n=c({},t.labels,{align:o,zIndex:t.zIndex}),s=Math.max(1,n.step),e,i,r,u;if(this.children=iu(this.children,function(n){return!(n instanceof ti)}),this.labels=[],n.visible)for(e=this.labelsRange(),i=n.rotation,tf(i)&&(n.alignRotation=i.align,n.rotation=i.angle),n.rotation==="auto"&&(n.rotation=0,t.autoRotateLabels=!0),r=e.min;r<e.max;r+=s)u=f.createAxisLabel(r,n),u&&(f.append(u),f.labels.push(u))},lineBox:function(){var i=this,t=i.options,n=i.box,s=t.vertical,r=t.labels.mirror,u=r?n.x1:n.x2,e=r?n.y2:n.y1,o=t.line.width||0;return s?new f(u,n.y1,u,n.y2-o):new f(n.x1,e,n.x2-o,e)},createTitle:function(){var i=this.options,n=c({rotation:i.vertical?-90:0,text:"",zIndex:1,visualSize:!0},i.title),t;n.visible&&n.text&&(t=new ni(n.text,n),this.append(t),this.title=t)},createNotes:function(){var r=this,t=this.options,f=t.notes,o=f.data||[],u,i,n;for(this.notes=[],u=0;u<o.length;u++)i=c({},f,o[u]),i.value=r.parseNoteValue(i.value),n=new yf({value:i.value,text:i.label.text,dataItem:i},i,r.chartService),n.options.visible&&(e(n.options.position)?t.vertical&&!ct(n.options.position,[nt,ut])?n.options.position=t.reverse?nt:ut:t.vertical||ct(n.options.position,[v,g])||(n.options.position=t.reverse?g:v):n.options.position=t.vertical?t.reverse?nt:ut:t.reverse?g:v,r.append(n),r.notes.push(n))},parseNoteValue:function(n){return n},renderVisual:function(){a.fn.renderVisual.call(this);this.createPlotBands()},createVisual:function(){a.fn.createVisual.call(this);this.createBackground();this.createLine()},gridLinesVisual:function(){var n=this._gridLines;return n||(n=this._gridLines=new fi({zIndex:-2}),this.appendVisual(this._gridLines)),n},createTicks:function(n){function f(t,f,o){var h=t.length,c=Math.max(1,f.step),s;if(f.visible)for(s=f.skip;s<h;s+=c)e(o)&&s%o==0||(r.tickX=u?i.x2:i.x2-f.size,r.tickY=u?i.y1-f.size:i.y1,r.position=t[s],n.append(co(r,f)))}var t=this.options,i=this.lineBox(),u=t.labels.mirror,o=t.majorTicks.visible?t.majorUnit:0,r={vertical:t.vertical};f(this.getMajorTickPositions(),t.majorTicks);f(this.getMinorTickPositions(),t.minorTicks,o/t.minorUnit)},createLine:function(){var u=this.options,n=u.line,t=this.lineBox(),i,r;n.width>0&&n.visible&&(i=new b({stroke:{width:n.width,color:n.color,dashType:n.dashType}}),i.moveTo(t.x1,t.y1).lineTo(t.x2,t.y2),u._alignLines&&fr(i),r=this._lineGroup=new fi,r.append(i),this.visual.append(r),this.createTicks(r))},getActualTickSize:function(){var n=this.options,t=0;return n.majorTicks.visible&&n.minorTicks.visible?t=Math.max(n.majorTicks.size,n.minorTicks.size):n.majorTicks.visible?t=n.majorTicks.size:n.minorTicks.visible&&(t=n.minorTicks.size),t},createBackground:function(){var n=this,i=n.options,r=n.box,t=i.background;t&&(this._backgroundPath=b.fromRect(r.toRect(),{fill:{color:t},stroke:null}),this.visual.append(this._backgroundPath))},createPlotBands:function(){var u=this,s=this.options,f=s.plotBands||[],a=s.vertical,h=this.plotArea,e,o,r,c,l;if(f.length!==0){for(e=this._plotbandGroup=new fi({zIndex:-1}),o=iu(this.pane.axes,function(n){return n.options.vertical!==u.options.vertical})[0],r=0;r<f.length;r++){var n=f[r],t=void 0,i=void 0;a?(t=(o||h.axisX).lineBox(),i=u.getSlot(n.from,n.to,!0)):(t=u.getSlot(n.from,n.to,!0),i=(o||h.axisY).lineBox());t.width()!==0&&i.height()!==0&&(c=new wr([t.x1,i.y1],[t.width(),i.height()]),l=b.fromRect(c,{fill:{color:n.color,opacity:n.opacity},stroke:null}),e.append(l))}this.appendVisual(e)}},createGridLines:function(n){function h(n,i,r){var h=n.length,c=Math.max(1,i.step),u,f;if(i.visible)for(u=i.skip;u<h;u+=c)f=t(n[u]),ct(f,o)||u%r==0||a&&y===f||(e.position=f,s.append(lo(e,i)),o.push(f))}var i=this.options,c=i.minorGridLines,f=i.majorGridLines,l=i.minorUnit,r=i.vertical,a=n.options.line.visible,v=f.visible?i.majorUnit:0,u=n.lineBox(),y=u[r?"y1":"x1"],e={lineStart:u[r?"x1":"y1"],lineEnd:u[r?"x2":"y2"],vertical:r},o=[],s=this.gridLinesVisual();return h(this.getMajorTickPositions(),f),h(this.getMinorTickPositions(),c,v/l),s.children},reflow:function(n){for(var o,i=this,s=i.options,h=i.labels,c=i.title,l=s.vertical,a=h.length,r=l?gi:nr,v=c?c.box[r]():0,u=this.getActualTickSize()+s.margin+v,y=(this.getRoot()||{}).box||n,p=y[r](),t=0,e=0;e<a;e++)o=h[e].box[r](),o+u<=p&&(t=Math.max(t,o));this.box=l?new f(n.x1,n.y1,n.x1+t+u,n.y2):new f(n.x1,n.y1,n.x2,n.y1+t+u);this.arrangeTitle();this.arrangeLabels();this.arrangeNotes()},getLabelsTickPositions:function(){return this.getMajorTickPositions()},labelTickIndex:function(n){return n.index},arrangeLabels:function(){for(var it,c,e,rt=this,p=this,o=p.options,w=p.labels,b=!o.justified,k=o.vertical,d=this.lineBox(),tt=o.labels.mirror,i=this.getLabelsTickPositions(),s=this.getActualTickSize()+o.margin,l=0;l<w.length;l++){var n=w[l],r=rt.labelTickIndex(n),a=k?n.box.height():n.box.width(),h=i[r]-a/2,y=void 0,t=void 0,u=void 0;k?(b&&(t=i[r],u=i[r+1],it=t+(u-t)/2,h=it-a/2),c=d.x2,tt?(c+=s,n.options.rotationOrigin=nt):(c-=s+n.box.width(),n.options.rotationOrigin=ut),y=n.box.move(c,h)):(b?(t=i[r],u=i[r+1]):(t=h,u=h+a),e=d.y1,tt?(e-=s+n.box.height(),n.options.rotationOrigin=g):(e+=s,n.options.rotationOrigin=v),y=new f(t,e,u,e+n.box.height()));n.reflow(y)}},autoRotateLabels:function(){var u,n,r,t,e,o,i;if(this.options.autoRotateLabels&&!this.options.vertical){for(u=this.getMajorTickPositions(),n=this.labels,t=0;t<n.length;t++)if(e=Math.abs(u[t+1]-u[t]),o=n[t].box,o.width()>e){if(o.height()>e){r=-90;break}r=-45}if(r){for(i=0;i<n.length;i++)n[i].options.rotation=r,n[i].reflow(new f);return!0}}},arrangeTitle:function(){var t=this,i=t.options,n=t.title,r=i.labels.mirror,u=i.vertical;n&&(u?(n.options.align=r?ut:nt,n.options.vAlign=n.options.position):(n.options.align=n.options.position,n.options.vAlign=r?v:g),n.reflow(this.box))},arrangeNotes:function(){for(var t=this,i=0;i<this.notes.length;i++){var n=t.notes[i],r=n.options.value,u=void 0;e(r)?(t.shouldRenderNote(r)?n.show():n.hide(),u=t.noteSlot(r)):n.hide();n.reflow(u||t.lineBox())}},noteSlot:function(n){return this.getSlot(n)},alignTo:function(n){var i=n.lineBox(),f=this.options.vertical,t=f?u:r;this.box.snapTo(i,t);f?this.box.shrink(0,this.lineBox().height()-i.height()):this.box.shrink(this.lineBox().width()-i.width(),0);this.box[t+1]-=this.lineBox()[t+1]-i[t+1];this.box[t+2]-=this.lineBox()[t+2]-i[t+2]},axisLabelText:function(n,t,i){var u=ff(i),r=n;return u?r=u({value:n,dataItem:t,format:i.format,culture:i.culture}):i.format&&(r=this.chartService.format.localeAuto(i.format,[n],i.culture)),r},slot:function(n,t,i){var r=this.getSlot(n,t,i);if(r)return r.toRect()},contentBox:function(){var t=this.box.clone(),n=this.labels,i;return n.length&&(n[0].options.visible&&t.wrap(n[0].box),i=n[n.length-1],i.options.visible&&t.wrap(i.box)),t},limitRange:function(n,t,i,r,u){var f=this.options;if(n<i&&u<0&&(!e(f.min)||f.min<=i)||r<t&&u>0&&(!e(f.max)||r<=f.max))return null;if(t<i&&u>0||r<n&&u<0)return{min:n,max:t};var o=t-n,s=n,c=t;return n<i?(s=h(n,i,r),c=h(n+o,i+o,r)):t>r&&(c=h(t,i,r),s=h(t-o,i,r-o)),{min:s,max:c}},valueRange:function(){return{min:this.seriesMin,max:this.seriesMax}}});w(d,{labels:{visible:!0,rotation:0,mirror:!1,step:1,skip:0},line:{width:1,color:ht,visible:!0},title:{visible:!0,position:ft},majorTicks:{align:ir,size:4,skip:0,step:1},minorTicks:{align:ir,size:3,skip:0,step:1},axisCrossingValue:0,majorTickType:ir,minorTickType:kr,majorGridLines:{skip:0,step:1},minorGridLines:{visible:!1,width:1,color:ht,skip:0,step:1},margin:5,visible:!0,reverse:!1,justified:!0,notes:{label:{text:""}},_alignLines:!0,_deferLabels:!1});var su="milliseconds",pf="seconds",wf="minutes",cr="hours",bt="days",lr="weeks",ci="months",ii="years",bf=1e3,wi=60*bf,hu=60*wi,ri=24*hu,kf=7*ri,df=31*ri,gf=365*ri,kt={years:gf,months:df,weeks:kf,days:ri,hours:hu,minutes:wi,seconds:bf,milliseconds:1};yo=.01;si=d.extend({init:function(n,t){d.fn.init.call(this,n,t);this._ticks={};this._initCategories(this.options)},_initCategories:function(n){var t=(n.categories||[]).slice(0),i=e(n.min),r=e(n.max),u,f;n.categories=t;(i||r)&&t.length&&(n.srcCategories=n.categories,u=i?Math.floor(n.min):0,f=r?n.justified?Math.floor(n.max)+1:Math.ceil(n.max):t.length,n.categories=n.categories.slice(u,f))},rangeIndices:function(){var n=this.options,t=n.categories.length||1,r=pt(n.min)?n.min%1:0,i;return i=pt(n.max)&&n.max%1!=0&&n.max<this.totalRange().max?t-(1-n.max%1):t-(n.justified?1:0),{min:r,max:i}},totalRangeIndices:function(n){var t=this.options,i=pt(t.min)?t.min:0,r,u;return r=pt(t.max)?t.max:pt(t.min)?i+t.categories.length:(t.srcCategories||t.categories).length-(t.justified?1:0)||1,n&&(u=this.totalRange(),i=h(i,0,u.max),r=h(r,0,u.max)),{min:i,max:r}},range:function(){var n=this.options;return{min:pt(n.min)?n.min:0,max:pt(n.max)?n.max:n.categories.length}},totalRange:function(){var n=this.options;return{min:0,max:Math.max(this._seriesMax||0,(n.srcCategories||n.categories).length)-(n.justified?1:0)}},getScale:function(){var n=this.rangeIndices(),i=n.min,r=n.max,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 e=this.options,h=e.vertical,c=e.reverse,o=this.rangeIndices(),i=o.min,l=o.max,a=this.lineBox(),v=this.getScale(),y=a[(h?u:r)+(c?2:1)],s=[],f=i%1!=0?Math.floor(i/1)+n:i;f<=l;)s.push(y+t(v*(f-i),rt)),f+=n;return s},getLabelsTickPositions:function(){var t=this.getMajorTickPositions().slice(0),n=this.rangeIndices(),f=this.getScale(),e=this.lineBox(),i=this.options,o=i.vertical?u:r,s=i.reverse?2:1,h=i.reverse?1:2;return n.min%1!=0&&t.unshift(e[o+s]-f*(n.min%1)),n.max%1!=0&&t.push(e[o+h]+f*(1-n.max%1)),t},labelTickIndex:function(n){var i=this.rangeIndices(),t=n.index;return i.min>0&&(t=t-Math.floor(i.min)),t},arrangeLabels:function(){d.fn.arrangeLabels.call(this);this.hideOutOfRangeLabels()},hideOutOfRangeLabels:function(){var e=this,o=e.box,t=e.labels;if(t.length){var n=this.options.vertical?u:r,s=o[n+1],h=o[n+2],i=t[0],f=at(t);(i.box[n+1]>h||i.box[n+2]<s)&&(i.options.visible=!1);(f.box[n+1]>h||f.box[n+2]<s)&&(f.options.visible=!1)}},getMajorTickPositions:function(){return this.getTicks().majorTicks},getMinorTickPositions:function(){return this.getTicks().minorTicks},getTicks:function(){var t=this.options,u=t.reverse,f=t.justified,n=this._ticks,i=this.rangeIndices(),e=this.lineBox(),r=e.getHash()+i.min+","+i.max+u+f;return n._hash!==r&&(n._hash=r,n.majorTicks=this.getTickPositions(1),n.minorTicks=this.getTickPositions(.5)),n},getSlot:function(n,t,i){var v=this.options,y=v.reverse,d=v.justified,g=v.vertical,nt=this.rangeIndices(),w=nt.min,f=g?u:r,o=this.lineBox(),b=this.getScale(),k=o[f+(y?2:1)],p=o.clone(),tt=!e(t),a=ei(n,0),l=ei(t,a),s,c;return l=Math.max(l-1,a),l=Math.max(a,l),s=k+(a-w)*b,c=k+(l+1-w)*b,tt&&d&&(c=s),i&&(s=h(s,o[f+1],o[f+2]),c=h(c,o[f+1],o[f+2])),p[f+1]=y?c:s,p[f+2]=y?s:c,p},limitSlot:function(n){var e=this.options.vertical,t=e?u:r,i=this.lineBox(),f=n.clone();return f[t+1]=h(n[t+1],i[t+1],i[t+2]),f[t+2]=h(n[t+2],i[t+1],i[t+2]),f},slot:function(n,t,i){var r=n,u=t;return typeof r=="string"&&(r=this.categoryIndex(r)),typeof u=="string"&&(u=this.categoryIndex(u)),d.fn.slot.call(this,r,u,i)},pointCategoryIndex:function(n){var i=this.options,l=i.reverse,a=i.justified,v=i.vertical,f=v?u:r,o=this.lineBox(),s=this.rangeIndices(),y=l?s.max:s.min,p=this.getScale(),h=o[f+1],w=o[f+2],e=n[f],t,c;return e<h||e>w?null:(t=y+(e-h)/p,c=t%1,a?t=Math.round(t):c===0&&t>0&&t--,Math.floor(t))},getCategory:function(n){var t=this.pointCategoryIndex(n);return t===null?null:this.options.categories[t]},categoryIndex:function(n){var t=this.options,i=hh(n,t.srcCategories||t.categories);return i-Math.floor(t.min||0)},translateRange:function(n){var i=this.options,r=this.lineBox(),e=i.vertical?r.height():r.width(),u=i.categories.length,s=e/u,f=t(n/s,o);return{min:f,max:u+f}},zoomRange:function(n){var t=this.totalRangeIndices(),i=this.totalRange(),r=i.min,u=i.max,f=h(t.min+n,r,u),e=h(t.max-n,r,u);if(e-f>0)return{min:f,max:e}},scaleRange:function(n){var t=this.options.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 r=this.options,u=r.justified,t=r.labels,f=this.totalRangeIndices(!0),n=f.min,i=f.max,e=Math.floor(n),o;return u?(n=Math.ceil(n),i=Math.floor(i)):(n=Math.floor(n),i=Math.ceil(i)),o=n>t.skip?t.skip+t.step*Math.ceil((n-t.skip)/t.step):t.skip,{min:o-e,max:(r.categories.length?i+(u?1:0):0)-e}},createAxisLabel:function(n,t){var i=this.options,r=i.dataItems?i.dataItems[n]:null,u=ei(i.categories[n],""),f=this.axisLabelText(u,r,t);return new ti(u,f,n,r,t)},shouldRenderNote:function(n){var t=this.totalRangeIndices();return Math.floor(t.min)<=n&&n<=Math.ceil(t.max)},noteSlot:function(n){var t=this.options,i=n-Math.floor(t.min||0);return this.getSlot(i)},arrangeNotes:function(){d.fn.arrangeNotes.call(this);this.hideOutOfRangeNotes()},hideOutOfRangeNotes:function(){var e=this,t=e.notes,o=e.box,f,n;if(t&&t.length){var i=this.options.vertical?u:r,s=o[i+1],h=o[i+2];for(f=0;f<t.length;f++)n=t[f],n.box&&(h<n.box[i+1]||n.box[i+2]<s)&&n.hide()}},pan:function(n){var r=this.totalRangeIndices(!0),u=this.getScale(),i=t(n/u,o),f=this.totalRange(),e=r.min+i,s=r.max+i;return this.limitRange(e,s,0,f.max,i)},pointsRange:function(n,t){var f=this.options,v=f.reverse,y=f.vertical,i=y?u:r,p=this.lineBox(),e=this.totalRangeIndices(!0),o=this.getScale(),s=p[i+(v?2:1)],w=n[i]-s,b=t[i]-s,h=e.min+w/o,c=e.min+b/o,l=Math.min(h,c),a=Math.max(h,c);if(a-l>=yo)return{min:l,max:a}},valueRange:function(){return this.range()}});w(si,{type:"category",categories:[],vertical:!1,majorGridLines:{visible:!1,width:1,color:ht},labels:{zIndex:1},justified:!1,_deferLabels:!0});var po=3e5,wo={milliseconds:"HH:mm:ss.fff",seconds:"HH:mm:ss",minutes:"HH:mm",hours:"HH:mm",days:"M/d",weeks:"M/d",months:"MMM 'yy",years:"yyyy"},bo=.2,ch="auto",ui=[su,pf,wf,cr,bt,lr,ci,ii],yr="fit",ko=si.extend({init:function(n,t){var r,i,u,f;si.fn.init.call(this,n,t);r=t.intl;i=this.options;i=c({roundToBaseUnit:!0},i,{categories:te(r,i.categories),min:oi(r,i.min),max:oi(r,i.max)});i.userSetBaseUnit=i.userSetBaseUnit||i.baseUnit;i.userSetBaseUnitStep=i.userSetBaseUnitStep||i.baseUnitStep;i.categories&&i.categories.length>0?(u=(i.baseUnit||"").toLowerCase(),f=u!==yr&&!ct(u,ui),f&&(i.baseUnit=this.defaultBaseUnit(i)),(u===yr||i.baseUnitStep===ch)&&this.autoBaseUnit(i),this._groupsStart=y(i.categories[0],0,i.baseUnit,i.weekStartDay),this.groupCategories(i)):i.baseUnit=i.baseUnit||bt;this.options=i},_initCategories:function(){},shouldRenderNote:function(n){var t=this.range(),i=this.options.categories||[];return vr(n,t.min)>=0&&vr(n,t.max)<=0&&i.length},parseNoteValue:function(n){return oi(this.chartService.intl,n)},noteSlot:function(n){return this.getSlot(n)},translateRange:function(n){var r=this.options,u=r.baseUnit,f=r.weekStartDay,a=r.vertical,e=this.lineBox(),v=a?e.height():e.width(),i=this.range(),p=v/(i.max-i.min),h=t(n/p,o),c,l;return i.min&&i.max&&(c=s(r.min||i.min,h),l=s(r.max||i.max,h),i={min:y(c,0,u,f),max:y(l,0,u,f)}),i},scaleRange:function(n){var e=Math.abs(n),u=this.range(),t=u.min,i=u.max,f,r;if(t&&i){while(e--)f=ot(t,i),r=Math.round(f*.1),n<0?(t=s(t,r),i=s(i,-r)):(t=s(t,-r),i=s(i,r));u={min:t,max:i}}return u},defaultBaseUnit:function(n){for(var i,o,r=n.categories,h=e(r)?r.length:0,t=vi,u,s,f=0;f<h;f++)i=r[f],i&&u&&(o=cu(i,u),o>0&&(t=Math.min(t,o),s=t>=gf?ii:t>=df-ri*3?ci:t>=kf?lr:t>=ri?bt:t>=hu?cr:t>=wi?wf:pf)),u=i;return s||bt},_categoryRange:function(n){var t=n._range;return t||(t=n._range=lf(n)),t},totalRange:function(){return{min:0,max:this.options.categories.length}},rangeIndices:function(){var n=this.options,u=n.categories,f=n.baseUnit,e=n.baseUnitStep||1,o=this.categoriesRange(),s=i(n.min||o.min),h=i(n.max||o.max),r=0,t=0;return u.length&&(r=bi(s,u[0],f,e),t=bi(h,u[0],f,e),n.roundToBaseUnit&&(r=Math.floor(r),t=n.justified?Math.floor(t):Math.ceil(t))),{min:r,max:t}},labelsRange:function(){var n=this.options,i=n.labels,t=this.rangeIndices(),r=Math.floor(t.min),u=Math.ceil(t.max);return{min:r+i.skip,max:n.categories.length?u+(n.justified?1:0):0}},categoriesRange:function(){var n=this.options,r=this._categoryRange(n.srcCategories||n.categories),t=i(r.max);return!n.justified&&li(t,this._roundToTotalStep(t,n,!1))&&(t=this._roundToTotalStep(t,n,!0,!0)),{min:i(r.min),max:t}},currentRange:function(){var n=this.options,u=n.roundToBaseUnit!==!1,t=this.categoriesRange(),i=n.min,r=n.max;return i||(i=u?this._roundToTotalStep(t.min,n,!1):t.min),r||(r=u?this._roundToTotalStep(t.max,n,!n.justified):t.max),{min:i,max:r}},datesRange:function(){var n=this._categoryRange(this.options.srcCategories||this.options.categories);return{min:i(n.min),max:i(n.max)}},pan:function(n){var u=this.options,e=this.lineBox(),v=u.vertical?e.height():e.width(),h=this.currentRange(),c=h.min,l=h.max,a=this.totalLimits(),y=v/(l-c),f=t(n/y,o),w=s(c,f),b=s(l,f),r=this.limitRange(p(w),p(b),p(a.min),p(a.max),f);if(r)return r.min=i(r.min),r.max=i(r.max),r.baseUnit=u.baseUnit,r.baseUnitStep=u.baseUnitStep||1,r.userSetBaseUnit=u.userSetBaseUnit,r.userSetBaseUnitStep=u.userSetBaseUnitStep,r},pointsRange:function(n,t){var r=si.fn.pointsRange.call(this,n,t),i=this.currentRange(),u=this.rangeIndices(),f=ot(i.max,i.min)/(u.max-u.min),e=this.options,o=s(i.min,r.min*f),h=s(i.min,r.max*f);return{min:o,max:h,baseUnit:e.userSetBaseUnit,baseUnitStep:e.userSetBaseUnitStep}},zoomRange:function(n){var e=this.options,o=this.totalLimits(),k=e.weekStartDay,t=e.baseUnit,d=e.baseUnitStep||1,g=this.currentRange(),a=g.min,v=g.max,r=y(a,n*d,t,k),u=y(v,-n*d,t,k),l;if(e.userSetBaseUnit===yr){var p=e.autoBaseUnitSteps,nt=e.maxDateGroups,it=at(p[t])*nt*kt[t],w=ot(v,a),tt=ot(u,r),b=ui.indexOf(t),c,f;if(tt<kt[t]&&t!==su)t=ui[b-1],c=at(p[t]),f=(w-(nt-1)*c*kt[t])/2,r=s(a,f),u=s(v,-f);else if(tt>it&&t!==ii){l=0;do{b++;t=ui[b];l=0;f=2*kt[t];do c=p[t][l],l++;while(l<p[t].length&&f*c<w)}while(t!==ii&&f*c<w);f=(f*c-w)/2;f>0&&(r=s(a,-f),u=s(v,f),r=s(r,h(u,o.min,o.max)-u),u=s(u,h(r,o.min,o.max)-r))}}return r=i(h(r,o.min,o.max)),u=i(h(u,o.min,o.max)),r&&u&&ot(u,r)>0?{min:r,max:u,baseUnit:e.userSetBaseUnit,baseUnitStep:e.userSetBaseUnitStep}:void 0},totalLimits:function(){var t=this.options,r=this.datesRange(),u=this._roundToTotalStep(i(r.min),t,!1),n=r.max;return t.justified||(n=this._roundToTotalStep(n,t,!0,li(n,this._roundToTotalStep(n,t,!1)))),{min:u,max:n}},range:function(n){var t=n||this.options,f=t.categories,e=t.baseUnit===yr,o=e?ui[0]:t.baseUnit,s=t.baseUnitStep||1,r={baseUnit:o,baseUnitStep:s,weekStartDay:t.weekStartDay},u=this._categoryRange(f),h=i(t.min||u.min),c=i(t.max||u.max);return{min:this._roundToTotalStep(h,r,!1),max:this._roundToTotalStep(c,r,!0,!0)}},autoBaseUnit:function(n){for(var h=this._categoryRange(n.categories),l=i(n.max||h.max)-i(n.min||h.min),u=n.maxDateGroups||this.options.maxDateGroups,a=n.baseUnit===yr,v=0,t=a?ui[v++]:n.baseUnit,f=l/kt[t],e=f,y=c({},this.options.autoBaseUnitSteps,n.autoBaseUnitSteps),o,r,s;!r||f>=u;)if(o=o||y[t].slice(0),s=o.shift(),s)r=s,f=e/r;else if(t===at(ui)){r=Math.ceil(e/u);break}else if(a)t=ui[v++]||at(ui),e=l/kt[t],o=null;else{f>u&&(r=Math.ceil(e/u));break}n.baseUnitStep=r;n.baseUnit=t},groupCategories:function(n){for(var u=n.categories,o=n.baseUnit,s=n.baseUnitStep||1,h=i(lf(u).max),f=this.range(n),c=f.min,l=f.max,e=[],r,t=c;t<l;t=r)if(e.push(t),r=y(t,s,o,n.weekStartDay),r>h&&!n.max)break;n.srcCategories=u;n.categories=e},_roundToTotalStep:function(n,t,i,r){var u=t||this.options,f=u.baseUnit,e=u.baseUnitStep||1,o=this._groupsStart,s,h;return o?(s=bi(n,o,f,e),h=i?Math.ceil(s):Math.floor(s),r&&h++,y(o,h*e,f,u.weekStartDay)):y(n,i?e:0,f,u.weekStartDay)},createAxisLabel:function(n,t){var i=this.options,e=i.dataItems?i.dataItems[n]:null,r=i.categories[n],o=i.baseUnit,h=t.dateFormats[o],u=!0,s,f;return i.justified?(s=ar(r,o,i.weekStartDay),u=li(s,r)):i.roundToBaseUnit||(u=!li(this.range().max,r)),u&&(t.format=t.format||h,f=this.axisLabelText(r,e,t),f)?new ti(r,f,n,e,t):void 0},categoryIndex:function(n){var t=this.options,r=t.categories,u=-1;return r.length&&(u=Math.floor(bi(i(n),r[0],t.baseUnit,t.baseUnitStep||1))),u},getSlot:function(n,t,i){var r=n,u=t;return typeof r===ku&&(r=this.categoryIndex(r)),typeof u===ku&&(u=this.categoryIndex(u)),si.fn.getSlot.call(this,r,u,i)},valueRange:function(){var n=this.options,t=this._categoryRange(n.srcCategories||n.categories);return{min:i(t.min),max:i(t.max)}}});w(ko,{type:du,labels:{dateFormats:wo},autoBaseUnitSteps:{milliseconds:[1,10,100],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});ns=Math.pow(10,-o+1);vt=d.extend({init:function(n,t,i,r){var f=vh(n,t,i),u=yh(f,i);d.fn.init.call(this,ph(f,i),r);this.totalMin=u.min;this.totalMax=u.max;this.totalMajorUnit=u.majorUnit;this.seriesMin=n;this.seriesMax=t},startValue:function(){return 0},range:function(){var n=this.options;return{min:n.min,max:n.max}},getDivisions:function(n){if(n===0)return 1;var i=this.options,r=i.max-i.min;return Math.floor(t(r/n,rt))+1},getTickPositions:function(n,i){var f=this.options,o=f.vertical,v=f.reverse,s=this.lineBox(),y=o?s.height():s.width(),p=f.max-f.min,w=y/p,b=n*w,k=this.getDivisions(n),c=(o?-1:1)*(v?-1:1),d=c===1?1:2,l=[],h=s[(o?u:r)+d],a=0,e;for(i&&(a=i/n),e=0;e<k;e++)e%a!=0&&l.push(t(h,rt)),h=h+b*c;return l},getMajorTickPositions:function(){return this.getTickPositions(this.options.majorUnit)},getMinorTickPositions:function(){return this.getTickPositions(this.options.minorUnit)},getSlot:function(n,t,i){var a,v;i===void 0&&(i=!1);var o=this.options,y=o.vertical,l=o.reverse,p=y?u:r,c=this.lineBox(),b=c[p+(l?2:1)],d=y?c.height():c.width(),g=l?-1:1,k=g*(d/(o.max-o.min)),w=new f(c.x1,c.y1,c.x1,c.y1),s=n,h=t;return e(s)||(s=h||0),e(h)||(h=s||0),i&&(s=Math.max(Math.min(s,o.max),o.min),h=Math.max(Math.min(h,o.max),o.min)),y?(a=o.max-Math.max(s,h),v=o.max-Math.min(s,h)):(a=Math.min(s,h)-o.min,v=Math.max(s,h)-o.min),w[p+1]=pu(b+k*(l?v:a)),w[p+2]=pu(b+k*(l?a:v)),w},getValue:function(n){var i=this.options,f=i.vertical,h=i.reverse,c=Number(i.max),l=Number(i.min),a=f?u:r,e=this.lineBox(),w=e[a+(h?2:1)],v=f?e.height():e.width(),b=h?-1:1,s=b*(n[a]-w),k=(c-l)/v,y=s*k,p;return s<0||s>v?null:(p=f?c-y:l+y,t(p,o))},translateRange:function(n){var i=this.options,u=i.vertical,f=i.reverse,e=i.max,s=i.min,h=this.lineBox(),c=u?h.height():h.width(),l=e-s,a=c/l,r=t(n/a,o);return!(u||f)||u&&f||(r=-r),{min:s+r,max:e+r}},scaleRange:function(n){var t=this.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,i){var r=this.options,u=t(r.min+n*r.majorUnit,o),f=this.axisLabelText(u,null,i);return new ti(u,f,n,null,i)},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,t){var i=this.getValue(n),r=this.getValue(t),u=Math.min(i,r),f=Math.max(i,r);if(this.isValidRange(u,f))return{min:u,max:f}},zoomRange:function(n){var t=this,i=t.totalMin,r=t.totalMax,u=this.scaleRange(n),f=h(u.min,i,r),e=h(u.max,i,r);if(this.isValidRange(f,e))return{min:f,max:e}},isValidRange:function(n,t){return t-n>ns}});w(vt,{type:"numeric",min:0,max:1,vertical:!0,majorGridLines:{visible:!0,width:1,color:ht},labels:{format:"#.####################"},zIndex:1});ie=d.extend({init:function(n,t,r,u){var e=i(n),o=i(t),s=u.intl,f=r||{};f=c(f||{},{min:oi(s,f.min),max:oi(s,f.max),axisCrossingValue:te(s,f.axisCrossingValues||f.axisCrossingValue)});f=bh(e,o,f);d.fn.init.call(this,f,u);this.seriesMin=e;this.seriesMax=o;this.totalMin=p(ar(p(e)-1,f.baseUnit));this.totalMax=p(ne(p(o)+1,f.baseUnit))},range:function(){var n=this.options;return{min:n.min,max:n.max}},getDivisions:function(n){var t=this.options;return Math.floor(au(t.min,t.max,t.baseUnit)/n+1)},getTickPositions:function(n){for(var l,a,i=this.options,f=i.vertical,e=this.lineBox(),s=(f?-1:1)*(i.reverse?-1:1),v=s===1?1:2,h=e[(f?u:r)+v],p=this.getDivisions(n),w=ot(i.max,i.min),b=f?e.height():e.width(),k=b/w,c=[h],o=1;o<p;o++)l=y(i.min,o*n,i.baseUnit),a=h+ot(l,i.min)*k*s,c.push(t(a,rt));return c},getMajorTickPositions:function(){return this.getTickPositions(this.options.majorUnit)},getMinorTickPositions:function(){return this.getTickPositions(this.options.minorUnit)},getSlot:function(n,t,r){return vt.prototype.getSlot.call(this,i(n),i(t),r)},getValue:function(n){var t=vt.prototype.getValue.call(this,n);return t!==null?i(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=y(r,u,i.baseUnit)),f=t.dateFormats[i.baseUnit],t.format=t.format||f,e=this.axisLabelText(r,null,t),new ti(r,e,n,null,t)},translateRange:function(n,i){var r=this.options,e=r.baseUnit,h=r.weekStartDay,c=this.lineBox(),v=r.vertical?c.height():c.width(),l=this.range(),p=v/ot(l.max,l.min),a=t(n/p,o),u=s(r.min,a),f=s(r.max,a);return i||(u=y(u,0,e,h),f=y(f,0,e,h)),{min:u,max:f}},scaleRange:function(n){for(var u=this.options,t=u.min,i=u.max,e=Math.abs(n),f,r;e--;)f=ot(t,i),r=Math.round(f*.1),n<0?(t=s(t,r),i=s(i,-r)):(t=s(t,-r),i=s(i,r));return{min:t,max:i}},shouldRenderNote:function(n){var t=this.range();return vr(n,t.min)>=0&&vr(n,t.max)<=0},pan:function(n){var r=this.translateRange(n,!0),t=this.limitRange(p(r.min),p(r.max),this.totalMin,this.totalMax);if(t)return{min:i(t.min),max:i(t.max)}},pointsRange:function(n,t){var r=this.getValue(n),u=this.getValue(t),f=Math.min(r,u),e=Math.max(r,u);return{min:i(f),max:i(e)}},zoomRange:function(n){var t=this.scaleRange(n),r=i(h(p(t.min),this.totalMin,this.totalMax)),u=i(h(p(t.max),this.totalMin,this.totalMax));return{min:r,max:u}}});w(ie,{type:du,majorGridLines:{visible:!0,width:1,color:ht},labels:{dateFormats:wo}});re=10;pr=d.extend({init:function(n,i,r,u){var f=c({majorUnit:re,min:n,max:i},r),s=f.majorUnit,l=gh(i,s),a=dh(n,i,f),h=kh(a,l,f,r);f.max=h.max;f.min=h.min;f.minorUnit=r.minorUnit||t(s-1,o);d.fn.init.call(this,f,u);this.totalMin=e(r.min)?Math.min(a,r.min):a;this.totalMax=e(r.max)?Math.max(l,r.max):l;this.logMin=t(st(h.min,s),o);this.logMax=t(st(h.max,s),o);this.seriesMin=n;this.seriesMax=i;this.createLabels()},startValue:function(){return this.options.min},getSlot:function(n,t,i){var y=this,h=y.options,p=y.logMin,w=y.logMax,l=h.reverse,b=h.vertical,g=h.majorUnit,k=b?u:r,c=this.lineBox(),nt=c[k+(l?2:1)],it=b?c.height():c.width(),rt=l?-1:1,tt=rt*(it/(w-p)),d=new f(c.x1,c.y1,c.x1,c.y1),o=n,s=t,a,v;return(e(o)||(o=s||1),e(s)||(s=o||1),o<=0||s<=0)?null:(i&&(o=Math.max(Math.min(o,h.max),h.min),s=Math.max(Math.min(s,h.max),h.min)),o=st(o,g),s=st(s,g),b?(a=w-Math.max(o,s),v=w-Math.min(o,s)):(a=Math.min(o,s)-p,v=Math.max(o,s)-p),d[k+1]=pu(nt+tt*(l?v:a)),d[k+2]=pu(nt+tt*(l?a:v)),d)},getValue:function(n){var i=this,f=i.options,c=i.logMin,p=i.logMax,w=f.reverse,e=f.vertical,b=f.majorUnit,s=this.lineBox(),l=e===w?1:-1,k=l===1?1:2,a=e?s.height():s.width(),d=(p-c)/a,v=e?u:r,g=s[v+k],h=l*(n[v]-g),nt=h*d,y;return h<0||h>a?null:(y=c+nt,t(Math.pow(b,y),o))},range:function(){var n=this.options;return{min:n.min,max:n.max}},scaleRange:function(n){var t=this.options.majorUnit,i=-n;return{min:Math.pow(t,this.logMin-i),max:Math.pow(t,this.logMax+i)}},translateRange:function(n){var r=this,u=r.options,e=r.logMin,s=r.logMax,h=u.reverse,f=u.vertical,c=u.majorUnit,l=this.lineBox(),a=f?l.height():l.width(),v=a/(s-e),i=t(n/v,o);return!(f||h)||f&&h||(i=-i),{min:Math.pow(c,e+i),max:Math.pow(c,s+i)}},labelsCount:function(){var n=Math.floor(this.logMax);return Math.floor(n-this.logMin)+1},getMajorTickPositions:function(){var n=[];return this.traverseMajorTicksPositions(function(t){n.push(t)},{step:1,skip:0}),n},createTicks:function(n){function o(t,u){r.tickX=e?i.x2:i.x2-u.size;r.tickY=e?i.y1-u.size:i.y1;r.position=t;n.append(co(r,u))}var t=this.options,u=t.majorTicks,f=t.minorTicks,s=t.vertical,e=t.labels.mirror,i=this.lineBox(),r={vertical:s};return u.visible&&this.traverseMajorTicksPositions(o,u),f.visible&&this.traverseMinorTicksPositions(o,f),[]},createGridLines:function(n){function h(n,t){ct(n,o)||(e.position=n,s.append(lo(e,t)),o.push(n))}var t=this.options,r=t.minorGridLines,u=t.majorGridLines,i=t.vertical,f=n.lineBox(),e={lineStart:f[i?"x1":"y1"],lineEnd:f[i?"x2":"y2"],vertical:i},o=[],s=this.gridLinesVisual();return u.visible&&this.traverseMajorTicksPositions(h,u),r.visible&&this.traverseMinorTicksPositions(h,r),s.children},traverseMajorTicksPositions:function(n,i){for(var s,u=this._lineOptions(),h=u.lineStart,c=u.step,f=this,e=f.logMin,l=f.logMax,r=Math.ceil(e)+i.skip;r<=l;r+=i.step)s=t(h+c*(r-e),o),n(s,i)},traverseMinorTicksPositions:function(n,i){for(var s,u,f,a,v=this,r=this.options,y=r.min,p=r.max,w=r.minorUnit,b=r.majorUnit,h=this._lineOptions(),k=h.lineStart,d=h.step,c=this,l=c.logMin,g=c.logMax,nt=Math.floor(l),e=nt;e<g;e++)for(s=v._minorIntervalOptions(e),u=i.skip;u<w;u+=i.step){if(f=s.value+u*s.minorStep,f>p)break;f>=y&&(a=t(k+d*(st(f,b)-l),o),n(a,i))}},createAxisLabel:function(n,t){var r=Math.ceil(this.logMin+n),i=Math.pow(this.options.majorUnit,r),u=this.axisLabelText(i,null,t);return new ti(i,u,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,-n)},pointsRange:function(n,t){var i=this.getValue(n),r=this.getValue(t),u=Math.min(i,r),f=Math.max(i,r);return{min:u,max:f}},zoomRange:function(n){var u=this,i=u.options,f=u.totalMin,e=u.totalMax,l=this.scaleRange(n),s=h(l.min,f,e),c=h(l.max,f,e),r=i.majorUnit,a=c>s&&i.min&&i.max&&t(st(i.max,r)-st(i.min,r),o)<1,v=!(i.min===f&&i.max===e)&&t(st(c,r)-st(s,r),o)>=1;if(a||v)return{min:s,max:c}},_minorIntervalOptions:function(n){var t=this.options,u=t.minorUnit,i=t.majorUnit,r=Math.pow(i,n),f=Math.pow(i,n+1),e=f-r,o=e/u;return{value:r,minorStep:o}},_lineOptions:function(){var i=this.options,e=i.reverse,t=i.vertical,o=t?u:r,n=this.lineBox(),f=t===e?1:-1,s=f===1?1:2,h=t?n.height():n.width(),c=f*(h/(this.logMax-this.logMin)),l=n[o+s];return{step:c,lineStart:l,lineBox:n}}});w(pr,{type:"log",majorUnit:re,minorUnit:1,axisCrossingValue:1,vertical:!0,majorGridLines:{visible:!0,width:1,color:ht},zIndex:1,_deferLabels:!0});fe={createGridLines:function(n){var t=this.options,u=Math.abs(this.box.center().y-n.lineBox().y1),i=[],r=!1,f,e;return t.majorGridLines.visible&&(f=this.majorGridLineAngles(n),r=!0,i=this.renderMajorGridLines(f,u,t.majorGridLines)),t.minorGridLines.visible&&(e=this.minorGridLineAngles(n,r),sf(i,this.renderMinorGridLines(e,u,t.minorGridLines,n,r))),i},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 e,h={stroke:{width:i.width,color:i.color,dashType:i.dashType}},o=this.box.center(),f=new di([o.x,o.y],t),s=this.gridLinesVisual(),u=0;u<n.length;u++)e=new b(h),r&&(f.radius=r(n[u])),e.moveTo(f.center).lineTo(f.pointAt(n[u]+180)),s.append(e);return s.children},gridLineAngles:function(n,t,i,r,u){var e=this,o=this.intervals(t,i,r,u),f=n.options,s=f.visible&&(f.line||{}).visible!==!1;return of(o,function(n){var t=e.intervalAngle(n);if(!s||t!==90)return t})}};ki=si.extend({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,e=this,r=this,t=r.labels,u=r.options.labels,o=u.skip||0,s=u.step||1,h=new f,n=0;n<t.length;n++)t[n].reflow(h),i=t[n].box,t[n].reflow(e.getSlot(o+n*s).adjacentBox(0,i.width(),i.height()))},intervals:function(n,i,r,u){var e;u===void 0&&(u=!1);var o=this.options,l=o.categories.length,s=l/n||1,h=360/s,a=i||0,v=r||1,c=[],f=0;for(e=a;e<s;e+=v)f=o.reverse?360-e*h:e*h,f=t(f,rt)%360,u&&ct(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(){var n=this;return of(this.majorIntervals(),function(t){return n.intervalAngle(t)})},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,t,i){if(t.options.type!==ur){var r=wt(180/this.options.categories.length),u=Math.cos(r)*n,f=this.majorAngles();return function(t){return!i&&ct(t,f)?n:u}}},createPlotBands:function(){for(var s,h,r=this,u=this.options.plotBands||[],f=this._plotbandGroup=new fi({zIndex:-1}),t=0;t<u.length;t++){var n=u[t],i=r.plotBandSlot(n),e=r.getSlot(n.from),o=n.from-Math.floor(n.from);i.startAngle+=o*e.angle;s=Math.ceil(n.to)-n.to;i.angle-=(s+o)*e.angle;h=sr.current.createRing(i,{fill:{color:n.color,opacity:n.opacity},stroke:{opacity:n.opacity}});f.append(h)}this.appendVisual(f)},plotBandSlot:function(n){return this.getSlot(n.from,n.to-1)},getSlot:function(n,t){var f=this.options,e=f.justified,o=this.box,s=this.majorAngles(),u=s.length,c=360/u,i=n,r;f.reverse&&!e&&(i=(i+1)%u);i=h(Math.floor(i),0,u-1);r=s[i];e&&(r=r-c/2,r<0&&(r+=360));var l=h(Math.ceil(t||i),i,u-1),a=l-i+1,v=c*a;return new gt(o.center(),0,o.height()/2,r,v)},slot:function(n,t){var i=this.getSlot(n,t),r=i.startAngle+180,u=r+i.angle;return new dt.Arc([i.center.x,i.center.y],{startAngle:r,endAngle:u,radiusX:i.radius,radiusY:i.radius})},pointCategoryIndex:function(n){for(var r,u=this,f=this.options.categories.length,i=null,t=0;t<f;t++)if(r=u.getSlot(t),r.containsPoint(n)){i=t;break}return i}});w(ki,{startAngle:90,labels:{margin:lt(10)},majorGridLines:{visible:!0},justified:!0});c(ki.prototype,fe);wu=d.extend({init:function(n,t){d.fn.init.call(this,n,t);var i=this.options;i.minorUnit=i.minorUnit||i.majorUnit/2},getDivisions:function(n){return vt.prototype.getDivisions.call(this,n)-1},reflow:function(n){this.box=n;this.reflowLabels()},reflowLabels:function(){for(var r,e=this,i=this,o=i.options,t=i.labels,u=i.options.labels,s=u.skip||0,h=u.step||1,c=new f,l=this.intervals(o.majorUnit,s,h),n=0;n<t.length;n++)t[n].reflow(c),r=t[n].box,t[n].reflow(e.getSlot(l[n]).adjacentBox(0,r.width(),r.height()))},lineBox:function(){return this.box},intervals:function(n,t,i,r){var u,f;r===void 0&&(r=!1);var o=this.options.min,s=this.getDivisions(n),e=[],h=t||0,c=i||1;for(u=h;u<s;u+=c)f=(360+o+u*n)%360,r&&ct(f,r)||e.push(f);return e},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},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,i.minorUnit,r.skip,r.step,f)},plotBandSlot:function(n){return this.getSlot(n.from,n.to)},getSlot:function(n,t){var f=this,u=f.options,e=f.box,o=u.startAngle,i=h(n,u.min,u.max),r=h(t||i,i,u.max),s;return u.reverse&&(i*=-1,r*=-1),i=(540-i-o)%360,r=(540-r-o)%360,r<i&&(s=i,i=r,r=s),new gt(e.center(),0,e.height()/2,i,r-i)},slot:function(n,t){t===void 0&&(t=n);var f=this.options,e=360-f.startAngle,u=this.getSlot(n,t),o=Math.min(n,t),s=Math.max(n,t),i,r;return f.reverse?(i=o,r=s):(i=360-s,r=360-o),i=(i+e)%360,r=(r+e)%360,new dt.Arc([u.center.x,u.center.y],{startAngle:i,endAngle:r,radiusX:u.radius,radiusY:u.radius})},getValue:function(n){var t=this.options,i=this.box.center(),f=n.x-i.x,e=n.y-i.y,r=Math.round(hf(Math.atan2(e,f))),u=t.startAngle;return t.reverse||(r*=-1,u*=-1),(r+u+360)%360},valueRange:function(){return{min:0,max:Math.PI*2}}});w(wu,{type:"polar",startAngle:0,reverse:!1,majorUnit:60,min:0,max:360,labels:{margin:lt(10)},majorGridLines:{color:ht,visible:!0,width:1},minorGridLines:{color:"#aaa"}});c(wu.prototype,fe,{createPlotBands:ki.prototype.createPlotBands,majorAngles:ki.prototype.majorAngles,range:vt.prototype.range,labelsCount:vt.prototype.labelsCount,createAxisLabel:vt.prototype.createAxisLabel});ee={options:{majorGridLines:{visible:!0}},createPlotBands:function(){var u=this,f=this.options,a=f.majorGridLines.type,t=f.plotBands,i;t===void 0&&(t=[]);var e=this.plotArea.polarAxis,v=e.majorAngles(),r=e.box.center(),o=this._plotbandGroup=new fi({zIndex:-1});for(i=0;i<t.length;i++){var n=t[i],s={fill:{color:n.color,opacity:n.opacity},stroke:{opacity:n.opacity}},h=u.getSlot(n.from,n.to,!0),c=new gt(r,r.y-h.y2,r.y-h.y1,0,360),l=void 0;l=a===ur?sr.current.createRing(c,s):b.fromPoints(u.plotBandPoints(c,v),s).close();o.append(l)}this.appendVisual(o)},plotBandPoints:function(n,t){for(var i=[],r=[],f=[n.center.x,n.center.y],e=new di(f,n.innerRadius),o=new di(f,n.radius),u=0;u<t.length;u++)i.push(e.pointAt(t[u]+180)),r.push(o.pointAt(t[u]+180));return i.reverse(),i.push(i[0]),r.push(r[0]),r.concat(i)},createGridLines:function(n){var t=this.options,e=this.radarMajorGridLinePositions(),r=n.majorAngles(),u=n.box.center(),i=[],f;return t.majorGridLines.visible&&(i=this.renderGridLines(u,e,r,t.majorGridLines)),t.minorGridLines.visible&&(f=this.radarMinorGridLinePositions(),sf(i,this.renderGridLines(u,f,r,t.minorGridLines))),i},renderGridLines:function(n,t,i,r){var a={stroke:{width:r.width,color:r.color,dashType:r.dashType}},h=r.skip,u,f,e,c,l,o,s;for(h===void 0&&(h=0),u=r.step,u===void 0&&(u=0),f=this.gridLinesVisual(),e=h;e<t.length;e+=u)if(c=n.y-t[e],c>0)if(l=new di([n.x,n.y],c),r.type===ur)f.append(new yt.Circle(l,a));else{for(o=new b(a),s=0;s<i.length;s++)o.lineTo(l.pointAt(i[s]+180));o.close();f.append(o)}return f.children},getValue:function(n){var u=this.lineBox(),f=this.plotArea.polarAxis,t=f.majorAngles(),i=f.box.center(),e=n.distanceTo(i),o=e;if(this.options.majorGridLines.type!==ur&&t.length>1){var h=n.x-i.x,c=n.y-i.y,r=(hf(Math.atan2(c,h))+540)%360;t.sort(function(n,t){return bu(n,r)-bu(t,r)});var l=bu(t[0],t[1])/2,a=bu(r,t[0]),s=90-l,v=180-a-s;o=e*(Math.sin(wt(v))/Math.sin(wt(s)))}return this.axisType().prototype.getValue.call(this,new k(u.x1,u.y2-o))}};oe=vt.extend({radarMajorGridLinePositions:function(){return this.getTickPositions(this.options.majorUnit)},radarMinorGridLinePositions:function(){var n=this.options,t=0;return n.majorGridLines.visible&&(t=n.majorUnit),this.getTickPositions(n.minorUnit,t)},axisType:function(){return vt}});c(oe.prototype,ee);se=pr.extend({radarMajorGridLinePositions:function(){var n=[];return this.traverseMajorTicksPositions(function(t){n.push(t)},this.options.majorGridLines),n},radarMinorGridLinePositions:function(){var n=[];return this.traverseMinorTicksPositions(function(t){n.push(t)},this.options.minorGridLines),n},axisType:function(){return pr}});c(se.prototype,ee);var is=.333,nc=.01,tc=it.extend({init:function(n){this.closed=n},process:function(n){var b=this,t=n.slice(0),f=[],l=this.closed,e=t.length,a,v,k,y,d,c,h,p,g,w,nt;if(e>2&&(this.removeDuplicates(0,t),e=t.length),e<2||e===2&&t[0].equals(t[1]))return f;var o=t[0],i=t[1],s=t[2];for(f.push(new ai(o));o.equals(t[e-1]);)l=!0,t.pop(),e--;if(e===2)return a=this.tangent(o,i,r,u),at(f).controlOut(this.firstControlPoint(a,o,i,r,u)),f.push(new ai(i,this.secondControlPoint(a,o,i,r,u))),f;for(l?(o=t[e-1],i=t[0],s=t[1],y=this.controlPoints(o,i,s),v=y[1],k=y[0]):(d=this.tangent(o,i,r,u),v=this.firstControlPoint(d,o,i,r,u)),c=v,h=0;h<=e-3;h++)b.removeDuplicates(h,t),e=t.length,h+3<=e&&(o=t[h],i=t[h+1],s=t[h+2],p=b.controlPoints(o,i,s),at(f).controlOut(c),c=p[1],g=p[0],f.push(new ai(i,g)));return l?(o=t[e-2],i=t[e-1],s=t[0],w=this.controlPoints(o,i,s),at(f).controlOut(c),f.push(new ai(i,w[0])),at(f).controlOut(w[1]),f.push(new ai(s,k))):(nt=this.tangent(i,s,r,u),at(f).controlOut(c),f.push(new ai(s,this.secondControlPoint(nt,i,s,r,u)))),f},removeDuplicates:function(n,t){while(t[n+1]&&(t[n].equals(t[n+1])||t[n+1].equals(t[n+2])))t.splice(n+1,1)},invertAxis:function(n,t,i){var r=!1,f,u;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):(f=this.lineFunction(n,t),u=this.calculateFunction(f,i.x),n.y<=t.y&&i.y<=u||t.y<=n.y&&i.y>=u||(r=!0)),r},isLine:function(n,i,r){var u=this.lineFunction(n,i),f=this.calculateFunction(u,r.x);return n.x===i.x&&i.x===r.x||t(f,1)===t(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 e=r,f=u,l=!1,a=!1,o,s,v,h,y,c;return this.isLine(n,t,i)?o=this.tangent(n,t,r,u):(s={x:this.isMonotonicByField(n,t,i,r),y:this.isMonotonicByField(n,t,i,u)},s.x&&s.y?(o=this.tangent(n,i,r,u),l=!0):(this.invertAxis(n,t,i)&&(e=u,f=r),s[e]?o=0:(v=i[f]<n[f]&&n[f]<=t[f]||n[f]<i[f]&&t[f]<=n[f]?rs((i[f]-n[f])*(t[e]-n[e])):-rs((i[e]-n[e])*(t[f]-n[f])),o=nc*v,a=!0))),h=this.secondControlPoint(o,n,t,e,f),a&&(y=e,e=f,f=y),c=this.firstControlPoint(o,t,i,e,f),l&&(this.restrictControlPoint(n,t,h,o),this.restrictControlPoint(t,i,c,o)),[h,c]},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=t[r],o=i[r],e=(o-f)*is;return this.point(f+e,t[u]+e*n,r,u)},secondControlPoint:function(n,t,i,r,u){var o=t[r],f=i[r],e=(f-o)*is;return this.point(f-e,i[u]-e*n,r,u)},point:function(n,t,i,r){var u=new dt.Point;return u[i]=n,u[r]=t,u},calculateFunction:function(n,t){for(var u=n.length,r=0,i=0;i<u;i++)r+=Math.pow(t,i)*n[i];return r}});fs.Gradients=oo;kendo.deepExtend(kendo.dataviz,{constants:os,services:ro,autoMajorUnit:vu,Point:k,Box:f,Ring:gt,Sector:eo,ShapeBuilder:sr,ShapeElement:uu,ChartElement:a,BoxElement:et,RootElement:af,FloatElement:fu,Text:eu,TextBox:ni,Title:ou,AxisLabel:ti,Axis:d,Note:yf,CategoryAxis:si,DateCategoryAxis:ko,DateValueAxis:ie,NumericAxis:vt,LogarithmicAxis:pr,PolarAxis:wu,RadarCategoryAxis:ki,RadarNumericAxis:oe,RadarLogarithmicAxis:se,CurveProcessor:tc,rectToBox:vf,addClass:ss,removeClass:hs,alignPathToPixel:fr,clockwise:nf,convertableToNumber:cs,deepExtend:c,elementStyles:as,getSpacing:lt,getTemplate:ff,getter:es,grep:iu,hasClasses:ys,inArray:ct,interpolateValue:ps,InstanceObserver:uo,isArray:yi,isFunction:he,isNumber:pt,isObject:tf,isString:pi,map:of,mousewheelDelta:ws,FontLoader:hi,setDefaultOptions:w,sparseArrayLimits:lf,styleValue:ge,append:sf,bindEvents:bs,Class:it,defined:e,deg:hf,elementOffset:ks,elementSize:ds,eventElement:cf,eventCoordinates:gs,last:at,limitValue:h,logToConsole:kendo.logToConsole,objectKey:fo,rad:wt,round:t,unbindEvents:nh,valueOrDefault:ei,absoluteDateDiff:cu,addDuration:y,addTicks:s,ceilDate:ne,dateComparer:vr,dateDiff:ot,dateEquals:li,dateIndex:bi,duration:au,floorDate:ar,lteDateIndex:sh,startOfWeek:ao,toDate:i,parseDate:oi,parseDates:te,toTime:p})})(window.kendo.jQuery)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("dataviz/core/core",["dataviz/core/kendo-core"],n)}(function(){(function(n){var t=kendo.dataviz,r=t.services,i=kendo.drawing;t.ExportMixin={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 i.exportSVG(this.exportVisual(),n)},exportImage:function(n){return i.exportImage(this.exportVisual(n),n)},exportPDF:function(n){return i.exportPDF(this.exportVisual(),n)},svg:function(){if(i.svg.Surface)return i.svg.exportGroup(this.exportVisual());throw new Error("SVG Export failed. Unable to export instantiate kendo.drawing.svg.Surface");},imageDataURL:function(){var r,t,u;if(!kendo.support.canvas)return null;if(i.canvas.Surface)return r=n("<div />").css({display:"none",width:this.element.width(),height:this.element.height()}).appendTo(document.body),t=new i.canvas.Surface(r[0]),t.draw(this.exportVisual()),u=t._rootElement.toDataURL(),t.destroy(),r.remove(),u;throw new Error("Image Export failed. Unable to export instantiate kendo.drawing.canvas.Surface");}};r.IntlService.register({format:function(n){return kendo.format.apply(null,[n].concat(Array.prototype.slice.call(arguments,1)))},toString:kendo.toString,parseDate:kendo.parseDate});r.TemplateService.register({compile:kendo.template});t.Point2D=t.Point;t.Box2D=t.Box;t.mwDelta=function(n){return t.mousewheelDelta(n.originalEvent)}})(window.kendo.jQuery)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.dataviz.core",["dataviz/core/kendo-core","dataviz/core/core"],n)}(function(){},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("dataviz/themes/chart-base-theme",["kendo.dataviz.core"],n)}(function(){(function(){window.kendo.dataviz=window.kendo.dataviz||{};var t=1.5,n=.4,u="#000",i="Arial, Helvetica, sans-serif",w="11px "+i,r="12px "+i,f="16px "+i,b="transparent",e="#fff",o=function(){return{icon:{border:{width:1}},label:{font:r,padding:3},line:{length:10,width:2},visible:!0}},k=function(){return{labels:{font:r},notes:o(),title:{font:f,margin:5}}},s=function(){return{highlight:{markers:{border:{}}},line:{opacity:1,width:0},markers:{size:6,visible:!1},opacity:.4}},h=function(){return{highlight:{markers:{border:{}}},line:{opacity:1,width:0},markers:{size:6,visible:!1},opacity:.4}},d=function(){return{gap:t,spacing:n}},c=function(){return{outliersField:"",meanField:"",border:{_brightness:.8,width:1},downColor:e,gap:1,highlight:{border:{opacity:1,width:2},whiskers:{width:3},mean:{width:2},median:{width:2}},mean:{width:2},median:{width:2},spacing:.3,whiskers:{width:2}}},g=function(){return{border:{width:0},labels:{background:b},opacity:.6}},l=function(){return{gap:t,spacing:n,target:{color:"#ff0000"}}},nt=function(){return{border:{_brightness:.8,width:1},downColor:e,gap:1,highlight:{border:{opacity:1,width:2},line:{width:2}},line:{color:u,width:1},spacing:.3}},tt=function(){return{gap:t,spacing:n}},it=function(){return{margin:1}},a=function(){return{width:2}},rt=function(){return{gap:1,highlight:{line:{opacity:1,width:3}},line:{width:1},spacing:.3}},v=function(){return{line:{opacity:1,width:0},markers:{size:6,visible:!1},opacity:.5}},y=function(){return{markers:{visible:!1},width:2}},ut=function(){return{gap:t,spacing:n}},ft=function(){return{gap:t,spacing:n}},et=function(){return{width:1}},p=function(){return{gap:.5,line:{color:u,width:1},spacing:n}},ot=function(){return{labels:{background:"",color:"",padding:{top:5,bottom:5,left:7,right:7}}}},st=function(){return{labels:{background:"",color:"",padding:{top:5,bottom:5,left:7,right:7}}}},ht=function(n){return{visible:!0,labels:{font:w},overlay:n.gradients?{}:{gradient:"none"},area:s(),rangeArea:h(),verticalRangeArea:h(),bar:d(),boxPlot:c(),bubble:g(),bullet:l(),candlestick:nt(),column:tt(),pie:ot(),donut:it(),funnel:st(),horizontalWaterfall:p(),line:a(),notes:o(),ohlc:rt(),radarArea:v(),radarLine:y(),polarArea:v(),polarLine:y(),rangeBar:ut(),rangeColumn:ft(),scatterLine:et(),verticalArea:s(),verticalBoxPlot:c(),verticalBullet:l(),verticalLine:a(),waterfall:p()}},ct=function(){return{font:f}},lt=function(){return{labels:{font:r}}},at=function(n){return n===void 0&&(n={}),{axisDefaults:k(),categoryAxis:{majorGridLines:{visible:!0}},navigator:{pane:{height:90,margin:{top:10}}},seriesDefaults:ht(n),title:ct(),legend:lt()}};kendo.deepExtend(kendo.dataviz,{chartBaseTheme:at})})()},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("dataviz/themes/auto-theme",["kendo.dataviz.core"],n)}(function(){function t(t){function i(n,t){r(n,u(t,"backgroundColor"))}function u(n,t){return e.find(".k-var--"+n).css(t)}function r(n,t){for(var i=f,u=n.split("."),r=u.shift();u.length>0;)i=i[r]=i[r]||{},r=u.shift();i[r]=t}if(!t&&n)return n;var f={chart:kendo.dataviz.chartBaseTheme()},e=$('<div style="display: none">  <div class="k-var--accent"><\/div>  <div class="k-var--accent-contrast"><\/div>  <div class="k-var--base"><\/div>  <div class="k-var--background"><\/div>  <div class="k-var--normal-background"><\/div>  <div class="k-var--normal-text-color"><\/div>  <div class="k-var--hover-background"><\/div>  <div class="k-var--hover-text-color"><\/div>  <div class="k-var--selected-background"><\/div>  <div class="k-var--selected-text-color"><\/div>  <div class="k-var--chart-error-bars-background"><\/div>  <div class="k-var--chart-notes-background"><\/div>  <div class="k-var--chart-notes-border"><\/div>  <div class="k-var--chart-notes-lines"><\/div>  <div class="k-var--chart-crosshair-background"><\/div>  <div class="k-var--chart-inactive"><\/div>  <div class="k-var--chart-major-lines"><\/div>  <div class="k-var--chart-minor-lines"><\/div>  <div class="k-var--chart-area-opacity"><\/div>  <div class="k-widget">      <div class="k-var--chart-font"><\/div>      <div class="k-var--chart-title-font"><\/div>      <div class="k-var--chart-label-font"><\/div>  <\/div>  <div class="k-var--series">    <div class="k-var--series-a"><\/div>    <div class="k-var--series-b"><\/div>    <div class="k-var--series-c"><\/div>    <div class="k-var--series-d"><\/div>    <div class="k-var--series-e"><\/div>    <div class="k-var--series-f"><\/div>  <\/div><\/div>').appendTo(document.body);return function(){i("chart.axisDefaults.crosshair.color","chart-crosshair-background");i("chart.axisDefaults.labels.color","normal-text-color");i("chart.axisDefaults.line.color","chart-major-lines");i("chart.axisDefaults.majorGridLines.color","chart-major-lines");i("chart.axisDefaults.minorGridLines.color","chart-minor-lines");i("chart.axisDefaults.notes.icon.background","chart-notes-background");i("chart.axisDefaults.notes.icon.border.color","chart-notes-border");i("chart.axisDefaults.notes.line.color","chart-notes-lines");i("chart.axisDefaults.title.color","normal-text-color");i("chart.chartArea.background","background");i("chart.legend.inactiveItems.labels.color","chart-inactive");i("chart.legend.inactiveItems.markers.color","chart-inactive");i("chart.legend.labels.color","normal-text-color");i("chart.seriesDefaults.boxPlot.downColor","chart-major-lines");i("chart.seriesDefaults.boxPlot.mean.color","base");i("chart.seriesDefaults.boxPlot.median.color","base");i("chart.seriesDefaults.boxPlot.whiskers.color","accent");i("chart.seriesDefaults.bullet.target.color","accent");i("chart.seriesDefaults.candlestick.downColor","normal-text-color");i("chart.seriesDefaults.candlestick.line.color","normal-text-color");i("chart.seriesDefaults.errorBars.color","chart-error-bars-background");i("chart.seriesDefaults.horizontalWaterfall.line.color","chart-major-lines");i("chart.seriesDefaults.icon.border.color","chart-major-lines");i("chart.seriesDefaults.labels.background","background");i("chart.seriesDefaults.labels.color","normal-text-color");i("chart.seriesDefaults.notes.icon.background","chart-notes-background");i("chart.seriesDefaults.notes.icon.border.color","chart-notes-border");i("chart.seriesDefaults.notes.line.color","chart-notes-lines");i("chart.seriesDefaults.verticalBoxPlot.downColor","chart-major-lines");i("chart.seriesDefaults.verticalBoxPlot.mean.color","base");i("chart.seriesDefaults.verticalBoxPlot.median.color","base");i("chart.seriesDefaults.verticalBoxPlot.whiskers.color","accent");i("chart.seriesDefaults.verticalBullet.target.color","accent");i("chart.seriesDefaults.waterfall.line.color","chart-major-lines");i("chart.title.color","normal-text-color");r("chart.seriesDefaults.labels.opacity",u("chart-area-opacity","opacity"));i("diagram.shapeDefaults.fill.color","accent");i("diagram.shapeDefaults.content.color","accent-contrast");i("diagram.shapeDefaults.connectorDefaults.fill.color","normal-text-color");i("diagram.shapeDefaults.connectorDefaults.stroke.color","accent-contrast");i("diagram.shapeDefaults.connectorDefaults.hover.fill.color","accent-contrast");i("diagram.shapeDefaults.connectorDefaults.hover.stroke.color","normal-text-color");i("diagram.editable.resize.handles.stroke.color","normal-text-color");i("diagram.editable.resize.handles.fill.color","normal-background");i("diagram.editable.resize.handles.hover.stroke.color","normal-text-color");i("diagram.editable.resize.handles.hover.fill.color","normal-text-color");i("diagram.selectable.stroke.color","normal-text-color");i("diagram.connectionDefaults.stroke.color","normal-text-color");i("diagram.connectionDefaults.content.color","normal-text-color");i("diagram.connectionDefaults.selection.handles.fill.color","accent-contrast");i("diagram.connectionDefaults.selection.handles.stroke.color","normal-text-color");i("diagram.connectionDefaults.selection.stroke.color","normal-text-color")}(),function(){function t(n){return u(n,"fontSize")+" "+u(n,"fontFamily")}var n=t("chart-font"),f=t("chart-title-font"),i=t("chart-label-font");r("chart.axisDefaults.labels.font",i);r("chart.axisDefaults.notes.label.font",n);r("chart.axisDefaults.title.font",n);r("chart.legend.labels.font",n);r("chart.seriesDefaults.labels.font",i);r("chart.seriesDefaults.notes.label.font",n);r("chart.title.font",f)}(),function(){function n(n){return n.toLowerCase().charCodeAt(0)-"a".charCodeAt(0)}function t(t){return n(t.match(/series-([a-z])$/)[1])}var i=$(".k-var--series div").toArray(),u=i.reduce(function(n,i){var r=t(i.className);return n[r]=$(i).css("backgroundColor"),n},[]);r("chart.seriesColors",u)}(),e.remove(),n=f,f}var n;kendo.dataviz.autoTheme=t},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("dataviz/themes/themes",["dataviz/themes/chart-base-theme"],n)}(function(){return function(n){function f(t,i){return n.map(t,function(n,t){return[[n,i[t]]]})}var e=window.kendo,s=e.dataviz.ui,r=e.deepExtend,u="#000",t="#fff",h=e.dataviz.chartBaseTheme({gradients:!0}),c={scale:{labels:{font:"12px Arial,Helvetica,sans-serif"}}},l={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"]}}},o=s.themes,i=s.registerTheme=function(n,t){var u={},i;u.chart=r({},h,t.chart);u.gauge=r({},c,t.gauge);u.diagram=r({},l,t.diagram);u.treeMap=r({},t.treeMap);i=u.chart.seriesDefaults;i.verticalLine=r({},i.line);i.verticalArea=r({},i.area);i.rangeArea=r({},i.area);i.verticalRangeArea=r({},i.rangeArea);i.verticalBoxPlot=r({},i.boxPlot);i.polarArea=r({},i.radarArea);i.polarLine=r({},i.radarLine);o[n]=u};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:u,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:u,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:u},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:u},stroke:{color:t},hover:{fill:{color:t},stroke:{color:u}}},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",o="#7f7f7f",r="#bdbdbd",u="#c8c8c8",s=["#008fd3","#99d101","#f39b02","#f05662","#c03c53","#acacac"],h=s[0],e=t;i("fiori",{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:s,axisDefaults:{line:{color:u},labels:{color:n},minorGridLines:{color:"#dddddd"},majorGridLines:{color:u},title:{color:n},crosshair:{color:o},notes:c()}},gauge:{pointer:{color:h},scale:{rangePlaceholderColor:u,labels:{color:n},minorTicks:{color:n},majorTicks:{color:n},line:{color:n}}},diagram:{shapeDefaults:{fill:{color:h},connectorDefaults:{fill:{color:n},stroke:{color:e},hover:{fill:{color:e},stroke:{color:n}}},content:{color:n}},editable:{resize:{handles:{fill:{color:e},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:e},stroke:{color:r}},stroke:{color:r}}}},treeMap:{colors:f(s,["#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",o="#7f7f7f",r="#bdbdbd",u="#c8c8c8",s=["#0072c6","#5db2ff","#008a17","#82ba00","#ff8f32","#ac193d"],h=s[0],e=t;i("office365",{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:s,axisDefaults:{line:{color:u},labels:{color:n},minorGridLines:{color:"#e5e5e5"},majorGridLines:{color:u},title:{color:n},crosshair:{color:o},notes:c()}},gauge:{pointer:{color:h},scale:{rangePlaceholderColor:u,labels:{color:n},minorTicks:{color:n},majorTicks:{color:n},line:{color:n}}},diagram:{shapeDefaults:{fill:{color:h},connectorDefaults:{fill:{color:n},stroke:{color:e},hover:{fill:{color:e},stroke:{color:n}}},content:{color:n}},editable:{resize:{handles:{fill:{color:e},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:e},stroke:{color:r}},stroke:{color:r}}}},treeMap:{colors:f(s,["#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",s="#7f7f7f",r="#bdbdbd",u="#dfe0e1",o=["#ff4350","#ff9ea5","#00acc1","#80deea","#ffbf46","#ffd78c"],h=o[0],e=t;i("nova",{chart:{title:{color:n},legend:{labels:{color:n},inactiveItems:{labels:{color:s},markers:{color:s}}},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:"#dfe0e1"},majorGridLines:{color:u},title:{color:n},crosshair:{color:n},notes:c()}},gauge:{pointer:{color:h},scale:{rangePlaceholderColor:u,labels:{color:n},minorTicks:{color:n},majorTicks:{color:n},line:{color:n}}},diagram:{shapeDefaults:{fill:{color:h},connectorDefaults:{fill:{color:n},stroke:{color:e},hover:{fill:{color:e},stroke:{color:n}}},content:{color:n}},editable:{resize:{handles:{fill:{color:e},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:e},stroke:{color:r}},stroke:{color:r}}}},treeMap:{colors:f(o,["#ffd9dc","#ffeced","#cceef3","#e6f8fb","#fff2da","#fff7e8"])}})}(),function(){var n="#656565",t=["#ff6358","#ffd246","#78d237","#28b4c8","#2d73f5","#aa46be"],r=t[0];i("default-v2",{chart:{},gauge:{pointer:{color:r},scale:{rangePlaceholderColor:"rgba(0, 0, 0, .04)",labels:{color:n},minorTicks:{color:n},majorTicks:{color:n},line:{color:n}}},diagram:{},treeMap:{colors:f(t,["#ffd9dc","#ffeced","#cceef3","#e6f8fb","#fff2da","#fff7e8"])}});o.sass=o["default-v2"]}(),function(){var n="#292b2c",t=["#0275d8","#5bc0de","#5cb85c","#f0ad4e","#e67d4a","#d9534f"],r=t[0];i("bootstrap-v4",{chart:{},gauge:{pointer:{color:r},scale:{rangePlaceholderColor:"rgba(0, 0, 0, .04)",labels:{color:n},minorTicks:{color:n},majorTicks:{color:n},line:{color:n}}},diagram:{},treeMap:{colors:f(t,["#ffd9dc","#ffeced","#cceef3","#e6f8fb","#fff2da","#fff7e8"])}})}()}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.dataviz.themes",["kendo.dataviz.core","dataviz/themes/chart-base-theme","dataviz/themes/auto-theme","dataviz/themes/themes"],n)}(function(){},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("dataviz/chart/kendo-chart",["kendo.core","kendo.color","kendo.drawing","kendo.dataviz.core"],n)}(function(){(function(n){function vo(n){for(var r,u=n.length,i=0,t=0;t<u;t++)r=n[t],s(r)&&i++;return i}function ie(n,t){if(t===null)return t;var i=vf(n,!0);return i(t)}function ur(n,t,i,r){var u,f;i===void 0&&(i={});r===void 0&&(r=!1);var o=i.defaults=i.defaults||{},s=i.depth=i.depth||0,e=!1;if(i.excluded=i.excluded||[],s>ea)return null;for(u in n)!d(u,i.excluded)&&n.hasOwnProperty(u)&&(f=n[u],rt(f)?(e=!0,r||(n[u]=g(f(t),o[u]))):ki(f)&&(r||(i.defaults=o[u]),i.depth++,e=ur(f,t,i,r)||e,i.depth--));return e}function es(n){for(var r=n.length,t=0,i=0;i<r;i++)t=Math.max(t,n[i].data.length);return t}function uc(n,t,i,r,u){var e=n.box,f=new nt;return f[t]=e[t+i],f[r]=e[r+u],f}function oc(n){for(var t=0;t<n.length;t++)if(u(n[t].zIndex))return!0}function as(n){var t=n.overlay;return t&&t.gradient&&t.gradient!=="none"}function ha(n,t){n.forEach(t)}function ca(n,t){for(var r=n.length,i=r-1;i>=0;i--)t(n[i],i-r-1)}function ys(n){return vo(n)===n.length}function at(n){return u(n)&&n!==null}function ey(n){for(var r,t,u=n.series,i=0;i<u.length;i++)r=u[i],t=r.data,!t||so(t[0])||ki(t[0])||(r.data=[t])}function oy(){return"pane"+va++}function ya(n,t,i){var f=t.visible,r;return u(f)?f:(r=n.pointVisibility,r?r[i]:void 0)}function cc(n){for(var t,i,o=n.data,u=[],f=0,e=0,r=0;r<o.length;r++)t=p.current.bindPoint(n,r),i=t.valueFields.value,co(i)&&(i=parseFloat(i)),s(i)?(t.visible=ya(n,t.fields,r)!==!1,t.value=Math.abs(i),u.push(t),t.visible&&(f+=t.value),i!==0&&e++):u.push(null);return{total:f,points:u,count:e}}function or(n,t){return n&&t?n.toLowerCase()===t.toLowerCase():n===t}function b(n,t){for(var r,u=[],f=[].concat(t),i=0;i<n.length;i++)r=n[i],d(r.type,f)&&u.push(r);return u}function lc(n,t,i){if(t===null)return t;var u="_date_"+n,r=t[u];return r||(r=lr(i,vf(n,!0)(t)),t[u]=r),r}function ac(n,t){var i=n.type,r=t instanceof Date;return!i&&r||or(i,af)}function no(n){return n.length===1?n[0]:n}function vc(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||new o}function pa(n,t){for(var r,i=0;i<n.length;i++)if(r=n[i],r&&r.pane===t)return r}function sy(n){return n===""||n===null||n==="none"||n==="transparent"||!u(n)}function hy(n,t,i){var f=t,r=n,e;if(n.indexOf(".")>-1){for(e=n.split(".");e.length>1;)r=e.shift(),u(f[r])||(f[r]={}),f=f[r];r=e.shift()}f[r]=i}function kc(n,t){t!==null&&n.push(t)}function tv(n,i,r){var u=i instanceof hu?[].concat(n.categoryAxis):[].concat(n.valueAxis);t(u[i.axisIndex],r)}function vy(n,t,i){return kf(n,function(n){return i===0&&!n.categoryAxis||n.categoryAxis===t})}function yy(){this._defaultPrevented=!0}function iv(n,t){var r=(t||"").toLowerCase(),i=n.event;return r==="none"&&!(i.ctrlKey||i.shiftKey||i.altKey)||i[r+"Key"]}function nl(n){for(var t,r={},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 bi(n){var t=document.createElement("div");return n&&(t.className=n),t}function hv(n){for(var t=n;t&&!ao(t,"k-handle");)t=t.parentNode;return t}function py(n){n.stopPropagation()}function cv(n,i,r,u){var f=[].concat(r?n.yAxis:n.xAxis)[i];t(f,u)}function ky(n){var r=i.rad(n),t=k(Math.sin(r),eo),e=k(Math.cos(r),eo),u,f;return u=Math.abs(t)>by?h:e<0?w:y,f=Math.abs(t)<wy?h:t<0?ht:ft,{horizontal:u,vertical:f}}function lv(n,t,i,r){var s=(r.x-i.x)*(n.y-i.y)-(r.y-i.y)*(n.x-i.x),f=(r.y-i.y)*(t.x-n.x)-(r.x-i.x)*(t.y-n.y),o,u;return f!==0&&(u=s/f,o=new e(n.x+u*(t.x-n.x),n.y+u*(t.y-n.y))),o}function rp(n,t){return n.value.x-t.value.x}function hp(n){for(var i,r=ll,t=0;t<r.length;t++)i=r[t]+"Axes",n[i]&&(n[r[t]+"Axis"]=n[i],delete n[i])}function kv(n,t){if(n)for(var i=0;i<n.length;i++)if(n[i].category===t)return[n[i]]}function cp(n,i){function s(n){var i=(n||{}).color||f.color,u=t({},o,o[r],f,f[r],{line:{color:i},labels:{color:i},title:{color:i}},n);return delete u[r],u}for(var o=(i||{}).axisDefaults||{},r,f,u,e=0;e<ll.length;e++)r=ll[e]+"Axis",f=n.axisDefaults||{},u=[].concat(n[r]),u=u.map(s),n[r]=u.length>1?u:u[0]}function lp(n,i){var u=n.series,c=u.length,l=n.seriesDefaults,o=t({},n.seriesDefaults),s=i?t({},i.seriesDefaults):{},h=t({},s),r,f,e;for(dv(o),dv(h),r=0;r<c;r++)f=u[r].type||n.seriesDefaults.type,e=t({data:[]},h,s[f],{tooltip:n.tooltip},o,l[f]),u[r]._defaults=e,u[r]=t({},e,u[r])}function dv(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 fo(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 ap(n,t){t===void 0&&(t=i.dateComparer);for(var r=1,u=n.length;r<u;r++)if(t(n[r],n[r-1])<0){n.sort(t);break}return n}function vp(n,t){var r;t===void 0&&(t=i.dateComparer);var u=ap(n,t),e=u.length,f=e>0?[u[0]]:[];for(r=1;r<e;r++)t(u[r],di(f))!==0&&f.push(u[r]);return f}function yp(n){for(var u,f,t,e=n.length,i=[],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 al(n,t){var i,r,f,e;for(i in t)r=t[i],f=n[i],u(f)&&(e=r===null,e||!u(r)?(delete n[i],e&&delete t[i]):f&&ki(r)&&ki(f)&&al(f,r))}var te,p,rc,ea,tt,hi,os,fc,ke,ru,fr,sc,sa,er,uu,vs,ui,fi,uf,ff,yt,ef,ps,hc,fu,ge,pi,ws,bs,ks,of,va,ot,sf,yc,ei,to,ds,gs,bc,gc,nh,th,dt,ov,sv,rh,il,uh,rl,ul,fl,fh,io,ro,eh,eu,av,oh,uo,sh,hh,hl,pv,ch,lh,ah,vh;window.kendo.dataviz=window.kendo.dataviz||{};var i=kendo.dataviz,st=i.Class,s=i.isNumber,c=i.constants,it=c.MAX_VALUE,ut=c.MIN_VALUE,wt=c.VALUE,h=c.CENTER,ft=c.TOP,ht=c.BOTTOM,y=c.LEFT,lt=c.WHITE,hr=c.CIRCLE,a=c.X,l=c.Y,w=c.RIGHT,su=c.BLACK,af=c.DATE,eo=c.DEFAULT_PRECISION,oo=c.ARC,u=i.defined,vf=i.getter,so=i.isArray,r=i.ChartElement,e=i.Point,o=i.Box,cr=i.alignPathToPixel,f=i.setDefaultOptions,d=i.inArray,rt=i.isFunction,g=i.valueOrDefault,ki=i.isObject,t=i.deepExtend,di=i.last,gi=i.eventElement,ni=i.getTemplate,yf=i.TextBox,pf=i.ShapeElement,bt=i.getSpacing,ho=i.CurveProcessor,wf=i.append,co=i.isString,lr=i.parseDate,bf=i.styleValue,hu=i.CategoryAxis,ci=i.BoxElement,k=i.round,kf=i.grep,lo=i.DateCategoryAxis,et=i.elementStyles,ao=i.hasClasses,df=i.bindEvents,yh=i.services,gf=i.unbindEvents,nr=i.limitValue,gv=kendo.support,oi=kendo.drawing,v=oi.Path,ar=oi.Animation,ne=oi.AnimationFactory,vr=oi.Group,tr=kendo.Color,li=kendo.geometry,nt=li.Point,cu=li.transform,vl=st.extend({init:function(n){this._axis=n;this.options=n.options},value:function(n){var t=this._axis;return t.getCategory?t.getCategory(n):t.getValue(n)},slot:function(n,t,i){return i===void 0&&(i=!0),this._axis.slot(n,t,i)},range:function(){return this._axis.range()},valueRange:function(){return this._axis.valueRange()}}),ph=kendo.Class.extend({init:function(n){this.visual=n.visual;this.chartsVisual=n.chartContainer.visual}}),yl=st.extend({init:function(n){this._plotArea=n;this.visual=n.visual;this.backgroundVisual=n._bgVisual}});te={min:function(n){for(var r,u=n.length,t=it,i=0;i<u;i++)r=n[i],s(r)&&(t=Math.min(t,r));return t===it?n[0]:t},max:function(n){for(var r,u=n.length,t=ut,i=0;i<u;i++)r=n[i],s(r)&&(t=Math.max(t,r));return t===ut?n[0]:t},sum:function(n){for(var i,u=n.length,r=0,t=0;t<u;t++)i=n[t],s(i)&&(r+=i);return r},sumOrNull:function(n){var t=null;return vo(n)&&(t=te.sum(n)),t},count:function(n){for(var i,f=n.length,r=0,t=0;t<f;t++)i=n[t],i!==null&&u(i)&&r++;return r},avg:function(n){var t=vo(n),i=n[0];return t>0&&(i=te.sum(n)/t),i},first:function(n){for(var t,r=n.length,i=0;i<r;i++)if(t=n[i],t!==null&&u(t))return t;return n[0]}};p=st.extend({init:function(){this._valueFields={};this._otherFields={};this._nullValue={};this._undefinedValue={}},register:function(n,t,i){var r=this,f,u;for(t===void 0&&(t=[wt]),i===void 0&&(i={}),f=0;f<n.length;f++)u=n[f],r._valueFields[u]=t,r._otherFields[u]=i,r._nullValue[u]=r._makeValue(t,null),r._undefinedValue[u]=r._makeValue(t,undefined)},canonicalFields:function(n){return this.valueFields(n).concat(this.otherFields(n))},valueFields:function(n){return this._valueFields[n.type]||[wt]},otherFields:function(n){return this._otherFields[n.type]||[wt]},bindPoint:function(n,t,i){var v=n.data,r=u(i)?i:v[t],o={valueFields:{value:r}},e=this.valueFields(n),s=this._otherFields[n.type],h,f,c,l,a;return r===null?f=this._nullValue[n.type]:u(r)?Array.isArray(r)?(c=r.slice(e.length),f=this._bindFromArray(r,e),h=this._bindFromArray(c,s)):typeof r=="object"&&(l=this.sourceFields(n,e),a=this.sourceFields(n,s),f=this._bindFromObject(r,e,l),h=this._bindFromObject(r,s,a)):f=this._undefinedValue[n.type],u(f)&&(e.length===1?o.valueFields.value=f[e[0]]:o.valueFields=f),o.fields=h||{},o},_makeValue:function(n,t){for(var u,r={},f=n.length,i=0;i<f;i++)u=n[i],r[u]=t;return r},_bindFromArray:function(n,t){var r={},u,i;if(t)for(u=Math.min(t.length,n.length),i=0;i<u;i++)r[t[i]]=n[i];return r},_bindFromObject:function(n,t,i){var u,f,r,e,o;if(i===void 0&&(i=t),u={},t)for(f=t.length,r=0;r<f;r++)e=t[r],o=i[r],u[e]=ie(o,n);return u},sourceFields:function(n,t){var u=[],f,i,r,e;if(t)for(f=t.length,i=0;i<f;i++)r=t[i],e=r===wt?"field":r+"Field",u.push(n[e]||r);return u}});p.current=new p;var ny="stderr",ty=/percent(?:\w*)\((\d+)\)/,iy=new RegExp("^stddev(?:\\((\\d+(?:\\.\\d+)?)\\))?$"),wh=st.extend({init:function(n,t,i){this.initGlobalRanges(n,t,i)},initGlobalRanges:function(n,t,i){var r=t.data,u=iy.exec(n),e;if(u){this.valueGetter=this.createValueGetter(t,i);var f=this.getAverage(r),o=this.getStandardDeviation(r,f,!1),s=u[1]?parseFloat(u[1]):1,h={low:f.value-o*s,high:f.value+o*s};this.globalRange=function(){return h}}else n.indexOf&&n.indexOf(ny)>=0&&(this.valueGetter=this.createValueGetter(t,i),e=this.getStandardError(r,this.getAverage(r)),this.globalRange=function(n){return{low:n-e,high:n+e}})},createValueGetter:function(n,t){var e=n.data,o=p.current,r=o.valueFields(n),f=u(e[0])?e[0]:{},i,h,l;return so(f)?(h=t?r.indexOf(t):0,i=vf("["+h+"]")):s(f)?i=vf():typeof f===c.OBJECT&&(l=o.sourceFields(n,r),i=vf(l[r.indexOf(t)])),i},getErrorRange:function(n,t){var r,f,i,e;if(!u(t))return null;if(this.globalRange)return this.globalRange(n);if(so(t))r=n-t[0],f=n+t[1];else if(s(i=parseFloat(t)))r=n-i,f=n+i;else if(i=ty.exec(t))e=n*(parseFloat(i[1])/100),r=n-Math.abs(e),f=n+Math.abs(e);else throw new Error("Invalid ErrorBar value: "+t);return{low:r,high:f}},getStandardError:function(n,t){return this.getStandardDeviation(n,t,!0)/Math.sqrt(t.count)},getStandardDeviation:function(n,t,i){for(var u,e=this,o=n.length,h=i?t.count-1:t.count,f=0,r=0;r<o;r++)u=e.valueGetter(n[r]),s(u)&&(f+=Math.pow(u-t.value,2));return Math.sqrt(f/h)},getAverage:function(n){for(var r,f=this,e=n.length,u=0,t=0,i=0;i<e;i++)r=f.valueGetter(n[i]),s(r)&&(u+=r,t++);return{value:u/t,count:t}}}),ry=gv.browser||{},vt=600,ai="fadeIn",re=.8,ti=5,lu=ry.msie?.001:0,bh="errorLow",kh="errorHigh",pl="xErrorLow",wl="xErrorHigh",bl="yErrorLow",kl="yErrorHigh",ue=8,vi="zero",yo="interpolate",dh="gap",fe="above",po="below",yr="smooth",au="step",vu="area",si="bar",yu="boxPlot",pr="bubble",wr="bullet",br="candlestick",yi="column",ee="donut",oe="funnel",kr="horizontalWaterfall",pu="line",wu="ohlc",ir="pie",wo="polarArea",bo="polarLine",ko="polarScatter",se="radarArea",he="radarColumn",ce="radarLine",bu="rangeArea",dr="rangeBar",ku="rangeColumn",go="scatter",ns="scatterLine",gr="verticalArea",nu="verticalBoxPlot",le="verticalBullet",tu="verticalLine",iu="verticalRangeArea",du="waterfall",dl=[si,yi,wu,br,yu,nu,wr,ku,dr,du,kr],gl="legendItemClick",na="legendItemHover",ta="seriesClick",gh="seriesHover",ia="plotAreaClick",nc="plotAreaHover",ae="drag",ve="dragEnd",ts="dragStart",gu="zoomStart",nf="zoom",tf="zoomEnd",is="selectStart",rf="select",rs="selectEnd",ra="render",tc="showTooltip",ic="hideTooltip",ye="log",ii="category",pe="insideEnd",ua="insideBase",rr="outsideEnd",we="DOMMouseScroll mousewheel",us=150,uy={INITIAL_ANIMATION_DURATION:vt,FADEIN:ai,LEGEND_ITEM_CLICK:gl,LEGEND_ITEM_HOVER:na,SERIES_CLICK:ta,SERIES_HOVER:gh,GLASS:"glass",BORDER_BRIGHTNESS:re,TOOLTIP_OFFSET:ti,START_SCALE:lu,ERROR_LOW_FIELD:bh,ERROR_HIGH_FIELD:kh,X_ERROR_LOW_FIELD:pl,X_ERROR_HIGH_FIELD:wl,Y_ERROR_LOW_FIELD:bl,Y_ERROR_HIGH_FIELD:kl,LINE_MARKER_SIZE:ue,INTERPOLATE:yo,ZERO:vi,SMOOTH:yr,STEP:au,CATEGORY:ii,FUNNEL:oe,BAR:si,CANDLESTICK:br,PIE:ir,COLUMN:yi,AREA:vu,VERTICAL_BULLET:le,BOX_PLOT:yu,OHLC:wu,WATERFALL:du,LINE:pu,BULLET:wr,VERTICAL_LINE:tu,VERTICAL_AREA:gr,RANGE_AREA:bu,VERTICAL_RANGE_AREA:iu,RANGE_COLUMN:ku,VERTICAL_BOX_PLOT:nu,RANGE_BAR:dr,HORIZONTAL_WATERFALL:kr,SCATTER:go,SCATTER_LINE:ns,BUBBLE:pr,RADAR_AREA:se,RADAR_LINE:ce,RADAR_COLUMN:he,POLAR_LINE:bo,POLAR_AREA:wo,POLAR_SCATTER:ko,RENDER:ra,PLOT_AREA_CLICK:ia,PLOT_AREA_HOVER:nc,LOGARITHMIC:ye,DRAG:ae,DRAG_START:ts,DRAG_END:ve,ZOOM_START:gu,ZOOM:nf,ZOOM_END:tf,SELECT_START:is,SELECT:rf,SELECT_END:rs,GAP:dh,DONUT:ee,INSIDE_END:pe,INSIDE_BASE:ua,OUTSIDE_END:rr,MOUSEWHEEL:we,MOUSEWHEEL_DELAY:us,SHOW_TOOLTIP:tc,HIDE_TOOLTIP:ic,EQUALLY_SPACED_SERIES:dl,ABOVE:fe,BELOW:po},fa=4,fs=r.extend({init:function(n,t,i,u,f,e){r.fn.init.call(this,e);this.low=n;this.high=t;this.isVertical=i;this.chart=u;this.series=f},reflow:function(n){var h=this.options.endCaps,s=this.isVertical,a=this.getAxis(),t=a.getSlot(this.low,this.high),i=n.center(),c=this.getCapsWidth(n,s),l=s?i.x:i.y,r=l-c,u=l+c,f;s?(f=[new e(i.x,t.y1),new e(i.x,t.y2)],h&&f.push(new e(r,t.y1),new e(u,t.y1),new e(r,t.y2),new e(u,t.y2)),this.box=new o(r,t.y1,u,t.y2)):(f=[new e(t.x1,i.y),new e(t.x2,i.y)],h&&f.push(new e(t.x1,r),new e(t.x1,u),new e(t.x2,r),new e(t.x2,u)),this.box=new o(t.x1,r,t.x2,u));this.linePoints=f},getCapsWidth:function(n,t){var i=t?n.width():n.height();return Math.min(Math.floor(i/2),fa)||fa},createVisual:function(){var t=this,n=this.options,i=n.visual;i?this.visual=i({low:this.low,high:this.high,rect:this.box.toRect(),sender:this.getSender(),options:{endCaps:n.endCaps,color:n.color,line:n.line},createVisual:function(){t.createDefaultVisual();var n=t.visual;return delete t.visual,n}}):this.createDefaultVisual()},createDefaultVisual:function(){var e=this,f=this,i=f.options,t=f.linePoints,o={stroke:{color:i.color,width:i.line.width,dashType:i.line.dashType}},n,u;for(r.fn.createVisual.call(this),n=0;n<t.length;n+=2)u=new v(o).moveTo(t[n].x,t[n].y).lineTo(t[n+1].x,t[n+1].y),cr(u),e.visual.append(u)}});f(fs,{animation:{type:ai,delay:vt},endCaps:!0,line:{width:2},zIndex:1});rc=fs.extend({getAxis:function(){return this.chart.seriesValueAxis(this.series)}});ea=5;tt=r.extend({init:function(n,t){r.fn.init.call(this,t);this.plotArea=n;this.chartService=n.chartService;this.categoryAxis=n.seriesCategoryAxis(t.series[0]);this.valueAxisRanges={};this.points=[];this.categoryPoints=[];this.seriesPoints=[];this.seriesOptions=[];this._evalSeries=[];this.render()},render:function(){this.traverseDataPoints(this.addValue.bind(this))},pointOptions:function(n,i){var r=this.seriesOptions[i],u;return r||(u=this.pointType().prototype.defaults,this.seriesOptions[i]=r=t({},u,{vertical:!this.options.invertAxes},n)),r},plotValue:function(n){var i,t,u,f;if(!n)return 0;if(this.options.isStacked100&&s(n.value)){var o=n.categoryIx,e=this.categoryPoints[o],h=[],r=0;for(i=0;i<e.length;i++)if(t=e[i],t){if(u=n.series.stack,f=t.series.stack,u&&f&&u.group!==f.group)continue;s(t.value)&&(r+=Math.abs(t.value),h.push(Math.abs(t.value)))}if(r>0)return n.value/r}return n.value},plotRange:function(n,t){var a=this,h,e,o,r,s,f;if(t===void 0&&(t=0),h=this.categoryPoints[n.categoryIx],this.options.isStacked){var u=this.plotValue(n),v=u>=0,l=t,y=!1;for(e=0;e<h.length;e++){if(o=h[e],n===o)break;if(r=n.series.stack,s=o.series.stack,r&&s){if(typeof r===c.STRING&&r!==s)continue;if(r.group&&r.group!==s.group)continue}f=a.plotValue(o);(f>=0&&v||f<0&&!v)&&(l+=f,u+=f,y=!0,a.options.isStacked100&&(u=Math.min(u,1)))}return y&&(l-=t),[l,u]}var w=n.series,b=this.seriesValueAxis(w),p=this.categoryAxisCrossingValue(b);return[p,i.convertableToNumber(n.value)?n.value:p]},stackLimits:function(n,t){for(var f,e,i,r,c=this,o=it,s=ut,h=0;h<this.categoryPoints.length;h++)if(f=c.categoryPoints[h],f)for(e=0;e<f.length;e++)i=f[e],i&&(i.series.stack===t||i.series.axis===n)&&(r=c.plotRange(i,0)[1],u(r)&&isFinite(r)&&(s=Math.max(s,r),o=Math.min(o,r)));return{min:o,max:s}},updateStackRange:function(){var u=this,o=this.options,l=o.isStacked,s=o.series,h={},r,t;if(l)for(r=0;r<s.length;r++){var f=s[r],e=f.axis,c=e+f.stack,n=h[c];n||(n=u.stackLimits(e,f.stack),t=u.errorTotals,t&&(t.negative.length&&(n.min=Math.min(n.min,i.sparseArrayLimits(t.negative).min)),t.positive.length&&(n.max=Math.max(n.max,i.sparseArrayLimits(t.positive).max))),n.min!==it||n.max!==ut?h[c]=n:n=null);n&&(u.valueAxisRanges[e]=n)}},addErrorBar:function(n,t,i){var c=n.value,l=n.series,e=n.seriesIx,f=n.options.errorBars,o=t.fields[bh],h=t.fields[kh],r;s(o)&&s(h)?r={low:o,high:h}:f&&u(f.value)&&(this.seriesErrorRanges=this.seriesErrorRanges||[],this.seriesErrorRanges[e]=this.seriesErrorRanges[e]||new wh(f.value,l,wt),r=this.seriesErrorRanges[e].getErrorRange(c,f.value));r&&(n.low=r.low,n.high=r.high,this.addPointErrorBar(n,i))},addPointErrorBar:function(n,t){var s=!this.options.invertAxes,h=n.options.errorBars,o=n.series,i=n.low,r=n.high,u,f,e;this.options.isStacked?(u=this.stackedErrorRange(n,t),i=u.low,r=u.high):(f={categoryIx:t,series:o},this.updateRange({value:i},f),this.updateRange({value:r},f));e=new rc(i,r,s,this,o,h);n.errorBars=[e];n.append(e)},stackedErrorRange:function(n,t){var u=this.plotRange(n,0)[1]-n.value,i=n.low+u,r=n.high+u;return this.errorTotals=this.errorTotals||{positive:[],negative:[]},i<0&&(this.errorTotals.negative[t]=Math.min(this.errorTotals.negative[t]||0,i)),r>0&&(this.errorTotals.positive[t]=Math.max(this.errorTotals.positive[t]||0,r)),{low:i,high:r}},addValue:function(t,i){var f=i.categoryIx,h=i.series,s=i.seriesIx,o=this.categoryPoints[f],e,r;o||(this.categoryPoints[f]=o=[]);e=this.seriesPoints[s];e||(this.seriesPoints[s]=e=[]);r=this.createPoint(t,i);r&&(n.extend(r,i),r.owner=this,r.noteText=t.fields.noteText,u(r.dataItem)||(r.dataItem=h.data[f]),this.addErrorBar(r,t,f));this.points.push(r);e.push(r);o.push(r);this.updateRange(t.valueFields,i)},evalPointOptions:function(n,i,r,f,e,o){var c={defaults:e._defaults,excluded:["data","aggregate","_events","tooltip","content","template","visual","toggle","_outOfRangeMinPoint","_outOfRangeMaxPoint"]},h=this._evalSeries[o],s;return u(h)||(this._evalSeries[o]=h=ur(n,{},c,!0)),s=n,h&&(s=t({},s),ur(s,{value:i,category:r,index:f,series:e,dataItem:e.data[f]},c)),s},updateRange:function(n,t){var u=t.series.axis,r=n.value,i=this.valueAxisRanges[u];isFinite(r)&&r!==null&&(i=this.valueAxisRanges[u]=i||{min:it,max:ut},i.min=Math.min(i.min,r),i.max=Math.max(i.max,r))},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,i=this.categorySlots=[],r=this.points,u=this.categoryAxis,f=0;this.traverseDataPoints(function(n,e){var h=e.categoryIx,y=e.series,s=t.seriesValueAxis(y),o=r[f++],c=i[h],l,a,v;c||(i[h]=c=t.categorySlot(u,h,s));o&&(l=t.plotRange(o,s.startValue()),a=t.valueSlot(s,l),a?(v=t.pointSlot(c,a),o.aboveAxis=t.aboveAxis(o,s),o.stackValue=l[1],t.options.isStacked100&&(o.percentage=t.plotValue(o)),t.reflowPoint(o,v)):o.visible=!1)});this.reflowCategories(i);!this.options.clip&&this.options.limitPoints&&this.points.length&&this.limitPoints();this.box=n},valueSlot:function(n,t){return n.getSlot(t[0],t[1],!this.options.clip)},limitPoints:function(){for(var r=this,i=this.categoryPoints,t=i[0].concat(di(i)),n=0;n<t.length;n++)t[n]&&r.limitPoint(t[n])},limitPoint:function(n){var t=this.categoryAxis.limitSlot(n.box);t.equals(n.box)||n.reflow(t)},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.options,i=f.invertAxes,r=i?t:n,u=i?n:t;return new o(r.x1,u.y1,r.x2,u.y2)},categorySlot:function(n,t){return n.getSlot(t)},traverseDataPoints:function(n){for(var t,i,u,e=this,r=this.options.series,h=this.categoryAxis.options.categories||[],c=es(r),o=r.length,f=0;f<o;f++)e._outOfRangeCallback(r[f],"_outOfRangeMinPoint",f,n);for(t=0;t<c;t++)for(i=0;i<o;i++){var s=r[i],l=h[t],a=e._bindPoint(s,i,t);n(a,{category:l,categoryIx:t,series:s,seriesIx:i})}for(u=0;u<o;u++)e._outOfRangeCallback(r[u],"_outOfRangeMaxPoint",u,n)},_outOfRangeCallback:function(n,t,i,r){var u=n[t],f,e;u&&(f=u.categoryIx,e=this._bindPoint(n,i,f,u.item),r(e,{category:u.category,categoryIx:f,series:n,seriesIx:i,dataItem:u.item}))},_bindPoint:function(n,t,i,r){var u,f;return this._bindCache||(this._bindCache=[]),u=this._bindCache[t],u||(u=this._bindCache[t]=[]),f=u[i],f||(f=u[i]=p.current.bindPoint(n,i,r)),f},formatPointValue:function(n,t){return n.value===null?"":this.chartService.format.auto(t,n.value)},pointValue:function(n){return n.valueFields.value}});f(tt,{series:[],invertAxes:!1,isStacked:!1,clip:!0,limitPoints:!0});var ri={click:function(n,t){return n.trigger(ta,this.eventArgs(t))},hover:function(n,t){return n.trigger(gh,this.eventArgs(t))},eventArgs:function(n){return{value:this.value,percentage:this.percentage,stackValue:this.stackValue,category:this.category,series:this.series,dataItem:this.dataItem,runningTotal:this.runningTotal,total:this.total,element:gi(n),originalEvent:n,point:this}}},be={createNote:function(){var t=this.options.notes,n=this.noteText||t.label.text;t.visible!==!1&&u(n)&&n!==null&&(this.note=new i.Note({value:this.value,text:n,dataItem:this.dataItem,category:this.category,series:this.series},this.options.notes,this.owner.chartService),this.append(this.note))}},kt=r.extend({init:function(n,t){r.fn.init.call(this);this.value=n;this.options=t;this.aboveAxis=g(this.options.aboveAxis,!0);this.tooltipTracking=!0},render:function(){var u=this.options,f=u.markers,n=u.labels,r,i;this._rendered||(this._rendered=!0,f.visible&&f.size&&(this.marker=this.createMarker(),this.append(this.marker)),n.visible&&(r=ni(n),i=this.value,r?i=r({dataItem:this.dataItem,category:this.category,value:this.value,percentage:this.percentage,stackValue:this.stackValue,series:this.series}):n.format&&(i=this.formatValue(n.format)),this.label=new yf(i,t({align:h,vAlign:h,margin:{left:5,right:5},zIndex:g(n.zIndex,this.series.zIndex)},n)),this.append(this.label)),this.createNote(),this.errorBar&&this.append(this.errorBar))},markerBorder:function(){var i=this.options.markers,r=i.background,n=t({color:this.color},i.border);return u(n.color)||(n.color=new tr(r).brightness(re).toHex()),n},createVisual:function(){},createMarker:function(){var n=this.options.markers;return new pf({type:n.type,width:n.size,height:n.size,rotation:n.rotation,background:n.background,border:this.markerBorder(),opacity:n.opacity,zIndex:g(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 h=this,e=this,f=e.options,s=e.aboveAxis,c=f.vertical,t,r,u,i;if(this.render(),this.box=n,t=n.clone(),c?s?t.y1-=t.height():t.y2+=t.height():s?t.x1+=t.width():t.x2-=t.width(),this._childBox=t,this.marker&&this.marker.reflow(t),this.reflowLabel(t),this.errorBars)for(r=0;r<this.errorBars.length;r++)h.errorBars[r].reflow(t);this.note&&(u=this.markerBox(),f.markers.visible&&f.markers.size||(i=u.center(),u=new o(i.x,i.y,i.x,i.y)),this.note.reflow(u))},reflowLabel:function(n){var r=this,u=r.options,i=r.label,t=u.labels.position;i&&(t=t===fe?ft:t,t=t===po?ht:t,i.reflow(n),i.box.alignTo(this.markerBox(),t),i.reflow(i.box))},createHighlight:function(){var n=this.options.highlight.markers,u=this.markerBorder().color,t=this.options.markers,i=t.size+(t.border.width||0)+(n.border.width||0),r=new pf({type:t.type,width:i,height:i,rotation:t.rotation,background:n.color||u,border:{color:n.border.color,width:n.border.width,opacity:g(n.border.opacity,1)},opacity:g(n.opacity,1)});return r.reflow(this._childBox),r.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 li.Rect([f.x-u,f.y-u],[i,i])}return{options:this.options,rect:t,visual:r}},tooltipAnchor:function(){var n=this.markerBox(),r=this.owner.pane.clipBox(),o=!r||r.overlaps(n),u,f,t,i;if(o)return u=n.x2+ti,f=y,this.aboveAxis?(t=n.y1,i=ht):(t=n.y2,i=ft),{point:new e(u,t),align:{horizontal:f,vertical:i}}},formatValue:function(n){return this.owner.formatPointValue(this,n)},overlapsBox:function(n){var t=this.markerBox();return t.overlaps(n)},unclipElements:function(){this.label&&(this.label.options.noclip=!0);this.note&&(this.note.options.noclip=!0)}});kt.prototype.defaults={vertical:!0,markers:{visible:!0,background:lt,size:ue,type:hr,border:{width:2},opacity:1},labels:{visible:!1,position:fe,margin:bt(3),padding:bt(4),animation:{type:ai,delay:vt}},notes:{label:{}},highlight:{markers:{border:{color:"#fff",width:2}},zIndex:c.HIGHLIGHT_ZINDEX},errorBars:{line:{width:1}}};t(kt.prototype,ri);t(kt.prototype,be);hi=r.extend({init:function(n,t,i){r.fn.init.call(this);this.linePoints=n;this.series=t;this.seriesIx=i},points:function(){return this.toGeometryPoints(this.linePoints)},toGeometryPoints:function(n){for(var i=[],t=0,r=n.length;t<r;t++)n[t]&&n[t].visible!==!1&&i.push(n[t]._childBox.toRect().center());return i},createVisual:function(){var r=this,f=r.options,n=r.series,t=n.color,u=n._defaults,i;rt(t)&&u&&(t=u.color);i=v.fromPoints(this.points(),{stroke:{color:t,width:n.width,opacity:n.opacity,dashType:n.dashType},zIndex:n.zIndex});f.closed&&i.close();this.visual=i},aliasFor:function(n,t){return this.parent.getNearestPoint(t.x,t.y,this.seriesIx)}});f(hi,{closed:!1});os={calculateStepPoints:function(n){for(var f,o,p=this.parent.plotArea.seriesCategoryAxis(this.series),s=p.options,w=s.justified,c=s.vertical,v=s.reverse,t=c?a:l,r=c?l:a,e=v?2:1,y=e,i=uc(n[0],t,e,r,y),u=[i],h=1;h<n.length;h++)f=uc(n[h],t,e,r,y),i[t]!==f[t]&&(o=new nt,o[t]=i[t],o[r]=f[r],u.push(o,f)),i=f;return w?i!==di(u)&&u.push(i):u.push(uc(di(n),t,e,r,v?1:2)),u}};fc=hi.extend({points:function(){return this.calculateStepPoints(this.linePoints)}});t(fc.prototype,os);var ss=hi.extend({createVisual:function(){var n=this.series,r=n._defaults,t=n.color;rt(t)&&r&&(t=r.color);var u=new ho(this.options.closed),f=u.process(this.points()),i=new v({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}}),ec={renderSegments:function(){var t=this,o=this,c=o.options,s=o.seriesPoints,l=c.series,a=s.length,i,n,u,e;for(this._segments=[],n=0;n<a;n++){var f=l[n],h=t.sortPoints(s[n]),v=h.length,r=[];for(u=0;u<v;u++)e=h[u],e?r.push(e):t.seriesMissingValues(f)!==yo&&(r.length>1&&(i=t.createSegment(r,f,n,i),t._addSegment(i)),r=[]);r.length>1&&(i=t.createSegment(r,f,n,i),t._addSegment(i))}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?vi:t||yo},getNearestPoint:function(n,t,i){for(var r,l,o,a=new e(n,t),s=this.seriesPoints[i],h=it,c,f=0;f<s.length;f++)r=s[f],r&&u(r.value)&&r.value!==null&&r.visible!==!1&&(l=r.box,o=l.center().distanceTo(a),o<h&&(c=r,h=o));return c}},hs=ar.extend({setup:function(){this._setEnd(this.options.box.x1)},step:function(n){var t=this.options.box;this._setEnd(i.interpolateValue(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)}});f(hs,{duration:vt});ne.current.register("clip",hs);ke={createAnimation:function(){var t=this.getRoot(),i,n;t&&(t.options||{}).transitions!==!1&&(i=t.box,n=v.fromRect(i.toRect()),this.visual.clip(n),this.animation=new hs(n,{box:i}),oc(this.options.series)&&this._setChildrenAnimation(n))},_setChildrenAnimation:function(n){for(var t,r=this.animationPoints(),i=0;i<r.length;i++)t=r[i],t&&t.visual&&u(t.visual.options.zIndex)&&t.visual.clip(n)}};ru=tt.extend({render:function(){tt.fn.render.call(this);this.updateStackRange();this.renderSegments()},pointType:function(){return kt},createPoint:function(n,t){var h=t.categoryIx,c=t.category,i=t.series,s=t.seriesIx,l=this.seriesMissingValues(i),r=n.valueFields.value,f,o,e;if(!u(r)||r===null)if(l===vi)r=0;else return null;return f=this.pointOptions(i,s),f=this.evalPointOptions(f,r,c,h,i,s),o=n.fields.color||i.color,rt(i.color)&&(o=f.color),e=new kt(r,f),e.color=o,this.append(e),e},plotRange:function(n){var f=this,t=this.plotValue(n),e,r,i,u;if(this.options.isStacked)for(e=n.categoryIx,r=this.categoryPoints[e],i=0;i<r.length;i++){if(u=r[i],n===u)break;t+=f.plotValue(u);f.options.isStacked100&&(t=Math.min(t,1))}return[t,t]},createSegment:function(n,t,i){var r=t.style,u;return u=r===au?fc:r===yr?ss:hi,new u(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)}});t(ru.prototype,ec,ke);fr=hi.extend({init:function(n,t,i,r,u){hi.fn.init.call(this,n,t,i);this.prevSegment=r;this.stackPoints=u},createVisual:function(){var n=this.series,u=n._defaults,r=n.line||{},i=n.color;rt(i)&&u&&(i=u.color);this.visual=new vr({zIndex:n.zIndex});this.createFill({fill:{color:i,opacity:n.opacity},stroke:null});r.width>0&&r.visible!==!1&&this.createStroke({stroke:t({color:i,opacity:n.opacity,lineCap:"butt"},r)})},strokeSegments:function(){var n=this._strokeSegments;return n||(n=this._strokeSegments=this.createStrokeSegments()),n},createStrokeSegments:function(){return this.segmentsFromPoints(this.points())},stackSegments:function(){return this.prevSegment?this.prevSegment.createStackSegments(this.stackPoints):this.createStackSegments(this.stackPoints)},createStackSegments:function(n){return this.segmentsFromPoints(this.toGeometryPoints(n)).reverse()},segmentsFromPoints:function(n){return n.map(function(n){return new li.Segment(n)})},createStroke:function(n){var t=new v(n);t.segments.push.apply(t.segments,this.strokeSegments());this.visual.append(t)},hasStackSegment:function(){return this.prevSegment||this.stackPoints&&this.stackPoints.length},createFill:function(n){var i=this.strokeSegments(),r=i.slice(0),u=this.hasStackSegment(),f,t;u&&(f=this.stackSegments(),wf(r,f));t=new v(n);t.segments.push.apply(t.segments,r);!u&&i.length>1&&this.fillToAxes(t);this.visual.append(t)},fillToAxes:function(n){var i=this.parent,r=i.options.invertAxes,u=i.seriesValueAxis(this.series),f=i.categoryAxisCrossingValue(u),e=u.getSlot(f,f,!0),o=this.strokeSegments(),s=o[0].anchor(),h=di(o).anchor(),t=r?e.x1:e.y1;r?n.lineTo(t,h.y).lineTo(t,s.y):n.lineTo(h.x,t).lineTo(s.x,t)}});sc=fr.extend({createStrokeSegments:function(){return this.segmentsFromPoints(this.calculateStepPoints(this.linePoints))},createStackSegments:function(n){return this.segmentsFromPoints(this.calculateStepPoints(n)).reverse()}});t(sc.prototype,os);var cs=fr.extend({createStrokeSegments:function(){var n=new ho(this.options.closed),t=this.points();return n.process(t)},createStackSegments:function(){for(var n,i=this.strokeSegments(),r=[],t=i.length-1;t>=0;t--)n=i[t],r.push(new li.Segment(n.anchor(),n.controlOut(),n.controlIn()));return r}}),oa=ru.extend({createSegment:function(n,t,i,r){var h=this.options.isStacked,u=(t.line||{}).style,e,f,o,s;return h&&i>0&&r&&(o=this.seriesMissingValues(t),o!=="gap"?(f=r.linePoints,e=r):f=this._gapStackPoints(n,i,u)),s=u===au?sc:u===yr?cs:fr,new s(n,t,i,e,f)},reflow:function(n){var f=this,t,i,r,u;if(ru.fn.reflow.call(this,n),t=this._stackPoints,t)for(i=0;i<t.length;i++)r=t[i],u=f.categoryAxis.getSlot(r.categoryIx),r.reflow(u)},_gapStackPoints:function(n,t,i){var s=this,c=this.seriesPoints,e=n[0].categoryIx,a=n.length,r,l;e<0&&(e=0,a--);var v=e+a,y=this.seriesOptions[0]._outOfRangeMinPoint?1:0,o=[];for(this._stackPoints=this._stackPoints||[],r=e;r<v;r++){var u=r+y,f=t,h=void 0;do f--,h=c[f][u];while(f>0&&!h);h?(i!==au&&r>e&&!c[f][u-1]&&o.push(s._previousSegmentPoint(r,u,u-1,f)),o.push(h),i!==au&&r+1<v&&!c[f][u+1]&&o.push(s._previousSegmentPoint(r,u,u+1,f))):(l=s._createGapStackPoint(r),s._stackPoints.push(l),o.push(l))}return o},_previousSegmentPoint:function(n,t,i,r){for(var e=this.seriesPoints,f=r,u;f>0&&!u;)f--,u=e[f][i];return u?u=e[f][t]:(u=this._createGapStackPoint(n),this._stackPoints.push(u)),u},_createGapStackPoint:function(n){var i=this.pointOptions({},0),t=new kt(0,i);return t.categoryIx=n,t.series={},t},seriesMissingValues:function(n){return n.missingValues||vi}}),de=st.extend({init:function(){this.axisRanges={}},update:function(n){var u=this.axisRanges,i,r,t;for(i in n)r=n[i],t=u[i],u[i]=t=t||{min:it,max:ut},t.min=Math.min(t.min,r.min),t.max=Math.max(t.max,r.max)},reset:function(n){this.axisRanges[n]=undefined},query:function(n){return this.axisRanges[n]}}),ls=r.extend({init:function(n,t){r.fn.init.call(this,t);this.textBox=new yf(n,this.options);this.append(this.textBox)},createVisual:function(){this.textBox.options.noclip=this.options.noclip},reflow:function(n){var i=this.options,r=i.vertical,u=i.aboveAxis,f=this.children[0],t=f.options,e=f.box,c=f.options.padding,s=n;t.align=r?h:y;t.vAlign=r?ft:h;i.position===pe?r?(t.vAlign=ft,!u&&e.height()<n.height()&&(t.vAlign=ht)):t.align=u?w:y:i.position===h?(t.vAlign=h,t.align=h):i.position===ua?r?t.vAlign=u?ht:ft:t.align=u?y:w:i.position===rr&&(r?s=u?new o(n.x1,n.y1-e.height(),n.x2,n.y1):new o(n.x1,n.y2,n.x2,n.y2+e.height()):(t.align=h,s=u?new o(n.x2,n.y1,n.x2+e.width(),n.y2):new o(n.x1-e.width(),n.y1,n.x1,n.y2)));i.rotation||(r?c.left=c.right=(s.width()-f.contentBox.width())/2:c.top=c.bottom=(s.height()-f.contentBox.height())/2);f.reflow(s)},alignToClipBox:function(n){var e=this.options.vertical,f=e?l:a,t=f+"1",i=f+"2",o=this.children[0],r=this.parent.box,u;(r[t]<n[t]||n[i]<r[i])&&(u=o.paddingBox.clone(),u[t]=Math.max(r[t],n[t]),u[i]=Math.min(r[i],n[i]),this.reflow(u))}});f(ls,{position:rr,margin:bt(3),padding:bt(4),color:su,background:"",border:{width:1,color:""},aboveAxis:!0,vertical:!1,animation:{type:ai,delay:vt},zIndex:2});sa=6;er=r.extend({init:function(n,t){r.fn.init.call(this);this.options=t;this.color=t.color||lt;this.aboveAxis=g(this.options.aboveAxis,!0);this.value=n},render:function(){this._rendered||(this._rendered=!0,this.createLabel(),this.createNote(),this.errorBar&&this.append(this.errorBar))},createLabel:function(){var r=this.options,n=r.labels,i,u;n.visible&&(i=ni(n),u=i?i({dataItem:this.dataItem,category:this.category,value:this.value,percentage:this.percentage,stackValue:this.stackValue,runningTotal:this.runningTotal,total:this.total,series:this.series}):this.formatValue(n.format),this.label=new ls(u,t({vertical:r.vertical},n)),this.append(this.label))},formatValue:function(n){return this.owner.formatPointValue(this,n)},reflow:function(n){var r=this,t,i;if(this.render(),t=this.label,this.box=n,t&&(t.options.aboveAxis=this.aboveAxis,t.reflow(n)),this.note&&this.note.reflow(n),this.errorBars)for(i=0;i<this.errorBars.length;i++)r.errorBars[i].reflow(n)},createVisual:function(){var e=this,i=this,n=i.box,u=i.options,f=u.visual,t;this.visible!==!1&&(r.fn.createVisual.call(this),f?(t=this.rectVisual=f({category:this.category,dataItem:this.dataItem,value:this.value,sender:this.getSender(),series:this.series,percentage:this.percentage,stackValue:this.stackValue,runningTotal:this.runningTotal,total:this.total,rect:n.toRect(),createVisual:function(){var n=new vr;return e.createRect(n),n},options:u}),t&&this.visual.append(t)):n.width()>0&&n.height()>0&&this.createRect(this.visual))},createRect:function(n){var i=this.options,r=i.border,c=u(r.opacity)?r.opacity:i.opacity,e=this.box.toRect(),h;e.size.width=Math.round(e.size.width);var f=this.rectVisual=v.fromRect(e,{fill:{color:this.color,opacity:i.opacity},stroke:{color:this.getBorderColor(),width:r.width,opacity:c,dashType:r.dashType}}),o=this.box.width(),s=this.box.height(),l=i.vertical?o:s;l>sa&&(cr(f),(o<1||s<1)&&(f.options.stroke.lineJoin="round"));n.append(f);as(i)&&(h=this.createGradientOverlay(f,{baseColor:this.color},t({end:i.vertical?undefined:[0,1]},i.overlay)),n.append(h))},createHighlight:function(n){var t=v.fromRect(this.box.toRect(),n);return cr(t)},highlightVisual:function(){return this.rectVisual},highlightVisualArgs:function(){return{options:this.options,rect:this.box.toRect(),visual:this.rectVisual}},getBorderColor:function(){var i=this.color,t=this.options.border,r=t._brightness||re,n=t.color;return u(n)||(n=new tr(i).brightness(r).toHex()),n},tooltipAnchor:function(){var u=this,l=u.options,n=u.box,f=u.aboveAxis,t=this.owner.pane.clipBox()||n,o=y,s=ft,i,r,h,c;return l.vertical?(i=Math.min(n.x2,t.x2)+ti,f?r=Math.max(n.y1,t.y1):(r=Math.min(n.y2,t.y2),s=ht)):(h=Math.max(n.x1,t.x1),c=Math.min(n.x2,t.x2),l.isStacked?(s=ht,f?(o=w,i=c):i=h,r=Math.max(n.y1,t.y1)-ti):(f?i=c+ti:(i=h-ti,o=w),r=Math.max(n.y1,t.y1))),{point:new e(i,r),align:{horizontal:o,vertical:s}}},overlapsBox:function(n){return this.box.overlaps(n)}});t(er.prototype,ri);t(er.prototype,be);er.prototype.defaults={border:{width:1},vertical:!0,overlay:{gradient:"glass"},labels:{visible:!1,format:"{0}"},opacity:1,notes:{label:{}}};uu=r.extend({init:function(n){r.fn.init.call(this,n);this.forEach=n.rtl?ca:ha},reflow:function(n){var r=this.options,e=r.vertical,o=r.gap,s=r.spacing,h=this.children,u=h.length,f=e?l:a,c=u+o+s*(u-1),t=(e?n.height():n.width())/c,i=n[f+1]+t*(o/2);this.forEach(h,function(r,e){var o=(r.box||n).clone();o[f+1]=i;o[f+2]=i+t;r.reflow(o);e<u-1&&(i+=t*s);i+=t})}});f(uu,{vertical:!1,gap:0,spacing:0});vs=r.extend({reflow:function(n){for(var r,t,e=this,s=this.options.vertical?a:l,u=this.children,h=u.length,f=this.box=new o,i=0;i<h;i++)r=u[i],r.visible!==!1&&(t=r.box.clone(),t.snapTo(n,s),i===0&&(f=e.box=t.clone()),r.reflow(t),f.wrap(t))}});f(vs,{vertical:!0});ui=tt.extend({render:function(){tt.fn.render.call(this);this.updateStackRange()},pointType:function(){return er},clusterType:function(){return uu},stackType:function(){return vs},stackLimits:function(n,t){return tt.fn.stackLimits.call(this,n,t)},createPoint:function(n,t){var c=t.categoryIx,b=t.category,u=t.series,l=t.seriesIx,a=this,f=a.options,k=a.children,s=f.isStacked,h=this.pointValue(n),i=this.pointOptions(u,l),v=i.labels,o,y,e,r,p,w;return s&&v.position===rr&&(v.position=pe),i.isStacked=s,o=n.fields.color||u.color,h<0&&i.negativeColor&&(o=i.negativeColor),i=this.evalPointOptions(i,h,b,c,u,l),rt(u.color)&&(o=i.color),y=this.pointType(),e=new y(h,i),e.color=o,r=k[c],r||(p=this.clusterType(),r=new p({vertical:f.invertAxes,gap:f.gap,spacing:f.spacing,rtl:!f.invertAxes&&(this.chartService||{}).rtl}),this.append(r)),s?(w=this.getStackWrap(u,r),w.append(e)):r.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===c.STRING){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 f=this.options,u=n.getSlot(t),e=i.startValue(),o,r;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 i=this.children,r=i.length,t=0;t<r;t++)i[t].reflow(n[t])},createAnimation:function(){this._setAnimationOptions();tt.fn.createAnimation.call(this);oc(this.options.series)&&this._setChildrenAnimation()},_setChildrenAnimation:function(){for(var n,i,f=this,r=this.points,t=0;t<r.length;t++)n=r[t],i=n.visual,i&&u(i.options.zIndex)&&(n.options.animation=f.options.animation,n.createAnimation())},_setAnimationOptions:function(){var n=this.options,r=n.animation||{},t,i;n.isStacked?(i=this.seriesValueAxis(n.series[0]),t=i.getSlot(i.startValue())):t=this.categoryAxis.getSlot(0);r.origin=new nt(t.x1,t.y1);r.vertical=!n.invertAxes}});f(ui,{animation:{type:si}});fi=r.extend({init:function(n,t){r.fn.init.call(this,t);this.value=n},reflow:function(n){var e=this,s=e.options,u=e.value,h=e.owner,o=h.seriesValueAxis(s),t=o.getSlot(u.open,u.close),i=o.getSlot(u.low,u.high),r,f;t.x1=i.x1=n.x1;t.x2=i.x2=n.x2;this.realBody=t;r=i.center().x;f=[];f.push([[r,i.y1],[r,t.y1]]);f.push([[r,t.y2],[r,i.y2]]);this.lines=f;this.box=i.clone().wrap(t);this._rendered||(this._rendered=!0,this.createNote());this.reflowNote()},reflowNote:function(){this.note&&this.note.reflow(this.box)},createVisual:function(){r.fn.createVisual.call(this);this._mainVisual=this.mainVisual(this.options);this.visual.append(this._mainVisual);this.createOverlay()},mainVisual:function(n){var t=new vr;return this.createBody(t,n),this.createLines(t,n),t},createBody:function(n,i){var r=v.fromRect(this.realBody.toRect(),{fill:{color:this.color,opacity:i.opacity},stroke:null});i.border.width>0&&r.options.set("stroke",{color:this.getBorderColor(),width:i.border.width,dashType:i.border.dashType,opacity:g(i.border.opacity,i.opacity)});cr(r);n.append(r);as(i)&&n.append(this.createGradientOverlay(r,{baseColor:this.color},t({end:i.vertical?undefined:[0,1]},i.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:g(r.opacity,t.opacity),width:r.width,dashType:r.dashType,lineCap:"butt"}},u=0;u<i.length;u++)f=v.fromPoints(i[u],e),cr(f),n.append(f)},getBorderColor:function(){var t=this.options.border,n=t.color;return u(n)||(n=new tr(this.color).brightness(t._brightness).toHex()),n},createOverlay:function(){var n=v.fromRect(this.box.toRect(),{fill:{color:lt,opacity:0},stroke:null});this.visual.append(n)},createHighlight:function(){var n=this.options.highlight,r=this.color,i;return this.color=n.color||this.color,i=this.mainVisual(t({},this.options,{line:{color:this.getBorderColor()}},n)),this.color=r,i},highlightVisual:function(){return this._mainVisual},highlightVisualArgs:function(){return{options:this.options,rect:this.box.toRect(),visual:this._mainVisual}},tooltipAnchor:function(){var n=this.box,t=this.owner.pane.clipBox()||n;return{point:new e(n.x2+ti,Math.max(n.y1,t.y1)+ti),align:{horizontal:y,vertical:ft}}},formatValue:function(n){return this.owner.formatPointValue(this,n)},overlapsBox:function(n){return this.box.overlaps(n)}});f(fi,{vertical:!0,border:{_brightness:.8},line:{width:2},overlay:{gradient:"glass"},tooltip:{format:"<table><tr><th colspan='2'>{4:d}<\/th><\/tr><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:{}}});t(fi.prototype,ri);t(fi.prototype,be);uf=tt.extend({reflowCategories:function(n){for(var i=this.children,r=i.length,t=0;t<r;t++)i[t].reflow(n[t])},addValue:function(n,t){var r=t.categoryIx,c=t.category,o=t.series,l=t.seriesIx,s=this,a=s.children,f=s.options,h=n.valueFields,v=this.splitValue(h),y=ys(v),p=o.data[r],e=this.categoryPoints[r],i,u;e||(this.categoryPoints[r]=e=[]);y&&(i=this.createPoint(n,t));u=a[r];u||(u=new uu({vertical:f.invertAxes,gap:f.gap,spacing:f.spacing,rtl:!f.invertAxes&&(this.chartService||{}).rtl}),this.append(u));i&&(this.updateRange(h,t),u.append(i),i.categoryIx=r,i.category=c,i.series=o,i.seriesIx=l,i.owner=this,i.dataItem=p,i.noteText=n.fields.noteText);this.points.push(i);e.push(i)},pointType:function(){return fi},createPoint:function(n,i){var s=i.categoryIx,h=i.category,r=i.series,c=i.seriesIx,l=this.pointType(),f=n.valueFields,u=t({},r),e=n.fields.color||r.color,o;return u=this.evalPointOptions(u,f,h,s,r,c),r.type===br&&f.open>f.close&&(e=n.fields.downColor||r.downColor||r.color),rt(r.color)&&(e=u.color),u.vertical=!this.options.invertAxes,o=new l(f,u),o.color=e,o},splitValue:function(n){return[n.low,n.open,n.close,n.high]},updateRange:function(n,t){var r=t.series.axis,u=this.splitValue(n),i=this.valueAxisRanges[r];i=this.valueAxisRanges[r]=i||{min:it,max:ut};i=this.valueAxisRanges[r]={min:Math.min.apply(Math,u.concat([i.min])),max:Math.max.apply(Math,u.concat([i.max]))}},formatPointValue:function(n,t){var i=n.value;return this.chartService.format.auto(t,i.open,i.high,i.low,i.close,n.category)},animationPoints:function(){return this.points}});t(uf.prototype,ke);ff=fi.extend({init:function(n,t){fi.fn.init.call(this,n,t);this.createNote()},reflow:function(n){var u=this,s=u.options,t=u.value,h=u.owner,i=h.seriesValueAxis(s),f,r,e,o;this.boxSlot=r=i.getSlot(t.q1,t.q3);this.realBody=r;this.reflowBoxSlot(n);this.whiskerSlot=f=i.getSlot(t.lower,t.upper);this.reflowWhiskerSlot(n);e=i.getSlot(t.median);t.mean&&(o=i.getSlot(t.mean),this.meanPoints=this.calcMeanPoints(n,o));this.whiskerPoints=this.calcWhiskerPoints(r,f);this.medianPoints=this.calcMedianPoints(n,e);this.box=f.clone().wrap(r);this.reflowNote()},reflowBoxSlot:function(n){this.boxSlot.x1=n.x1;this.boxSlot.x2=n.x2},reflowWhiskerSlot:function(n){this.whiskerSlot.x1=n.x1;this.whiskerSlot.x2=n.x2},calcMeanPoints:function(n,t){return[[[n.x1,t.y1],[n.x2,t.y1]]]},calcWhiskerPoints:function(n,t){var i=t.center().x;return[[[i-5,t.y1],[i+5,t.y1],[i,t.y1],[i,n.y1]],[[i-5,t.y2],[i+5,t.y2],[i,t.y2],[i,n.y2]]]},calcMedianPoints:function(n,t){return[[[n.x1,t.y1],[n.x2,t.y1]]]},renderOutliers:function(n){for(var f,e,h,c=this,r=this.value,l=r.outliers||[],a=Math.abs(r.q3-r.q1)*3,o=[],i=n.markers||{},s=0;s<l.length;s++)f=l[s],i=f<r.q3+a&&f>r.q1-a?n.outliers:n.extremes,e=t({},i.border),u(e.color)||(e.color=u(c.color)?c.color:new tr(i.background).brightness(re).toHex()),h=new pf({type:i.type,width:i.size,height:i.size,rotation:i.rotation,background:i.background,border:e,opacity:i.opacity}),h.value=f,o.push(h);return this.reflowOutliers(o),o},reflowOutliers:function(n){for(var f,t,r=this,e=this.owner.seriesValueAxis(this.options),u=this.box.center(),i=0;i<n.length;i++)f=n[i].value,t=e.getSlot(f),r.options.vertical?t.move(u.x):t.move(undefined,u.y),r.box=r.box.wrap(t),n[i].reflow(t)},mainVisual:function(n){for(var i,r=fi.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.whiskers);this.drawLines(n,t,this.medianPoints,t.median);this.drawLines(n,t,this.meanPoints,t.mean)},getBorderColor:function(){return this.color?this.color:fi.fn.getBorderColor.call(this)}});f(ff,{border:{_brightness:.8},line:{width:2},median:{color:"#f6f6f6"},mean:{width:2,dashType:"dash",color:"#f6f6f6"},overlay:{gradient:"glass"},tooltip:{format:"<table><tr><th colspan='2'>{6:d}<\/th><\/tr><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:ue,type:c.CROSS,background:lt,border:{width:2,opacity:1},opacity:0},extremes:{visible:!0,size:ue,type:hr,background:lt,border:{width:2,opacity:1},opacity:0}});t(ff.prototype,ri);var fy=ff.extend({reflowBoxSlot:function(n){this.boxSlot.y1=n.y1;this.boxSlot.y2=n.y2},reflowWhiskerSlot:function(n){this.whiskerSlot.y1=n.y1;this.whiskerSlot.y2=n.y2},calcMeanPoints:function(n,t){return[[[t.x1,n.y1],[t.x1,n.y2]]]},calcWhiskerPoints:function(n,t){var i=t.center().y;return[[[t.x1,i-5],[t.x1,i+5],[t.x1,i],[n.x1,i]],[[t.x2,i-5],[t.x2,i+5],[t.x2,i],[n.x2,i]]]},calcMedianPoints:function(n,t){return[[[t.x1,n.y1],[t.x1,n.y2]]]}}),la=uf.extend({addValue:function(n,t){var r=t.categoryIx,c=t.category,o=t.series,l=t.seriesIx,s=this,a=s.children,f=s.options,h=n.valueFields,v=this.splitValue(h),y=ys(v),p=o.data[r],e=this.categoryPoints[r],i,u;e||(this.categoryPoints[r]=e=[]);y&&(i=this.createPoint(n,t));u=a[r];u||(u=new uu({vertical:f.invertAxes,gap:f.gap,spacing:f.spacing,rtl:!f.invertAxes&&(this.chartService||{}).rtl}),this.append(u));i&&(this.updateRange(h,t),u.append(i),i.categoryIx=r,i.category=c,i.series=o,i.seriesIx=l,i.owner=this,i.dataItem=p);this.points.push(i);e.push(i)},pointType:function(){return this.options.invertAxes?fy:ff},splitValue:function(n){return[n.lower,n.q1,n.median,n.q3,n.upper]},updateRange:function(n,t){var f=t.series.axis,i=this.valueAxisRanges[f],r=this.splitValue(n).concat(this.filterOutliers(n.outliers));u(n.mean)&&(r=r.concat(n.mean));i=this.valueAxisRanges[f]=i||{min:it,max:ut};i=this.valueAxisRanges[f]={min:Math.min.apply(Math,r.concat([i.min])),max:Math.max.apply(Math,r.concat([i.max]))}},formatPointValue:function(n,t){var i=n.value;return this.chartService.format.auto(t,i.lower,i.q1,i.median,i.q3,i.upper,i.mean,n.category)},filterOutliers:function(n){for(var t,f=(n||[]).length,r=[],i=0;i<f;i++)t=n[i],u(t)&&t!==null&&r.push(t);return r}}),aa=fs.extend({getAxis:function(){var n=this.chart.seriesAxes(this.series);return this.isVertical?n.y:n.x}});yt=r.extend({init:function(n,t){r.fn.init.call(this,t);this.plotArea=n;this.chartService=n.chartService;this._initFields();this.render()},_initFields:function(){this.xAxisRanges={};this.yAxisRanges={};this.points=[];this.seriesPoints=[];this.seriesOptions=[];this._evalSeries=[]},render:function(){this.traverseDataPoints(this.addValue.bind(this))},addErrorBar:function(n,t,i){var h=n.value[t],e=t+"Value",a=t+"ErrorLow",v=t+"ErrorHigh",o=i.seriesIx,y=i.series,r=n.options.errorBars,c=i[a],l=i[v],f;s(h)&&(s(c)&&s(l)&&(f={low:c,high:l}),r&&u(r[e])&&(this.seriesErrorRanges=this.seriesErrorRanges||{x:[],y:[]},this.seriesErrorRanges[t][o]=this.seriesErrorRanges[t][o]||new wh(r[e],y,t),f=this.seriesErrorRanges[t][o].getErrorRange(h,r[e])),f&&this.addPointErrorBar(f,n,t))},addPointErrorBar:function(n,t,i){var u=n.low,f=n.high,e=t.series,s=t.options.errorBars,h=i===l,r={},o;t[i+"Low"]=u;t[i+"High"]=f;t.errorBars=t.errorBars||[];o=new aa(u,f,h,this,e,s);t.errorBars.push(o);t.append(o);r[i]=u;this.updateRange(r,e);r[i]=f;this.updateRange(r,e)},addValue:function(t,i){var e=t.x,o=t.y,f=i.seriesIx,s=this.options.series[f],h=this.seriesMissingValues(s),c=this.seriesPoints[f],u=t,r;at(e)&&at(o)||(u=this.createMissingValue(u,h));u&&(r=this.createPoint(u,i),r&&(n.extend(r,i),this.addErrorBar(r,a,i),this.addErrorBar(r,l,i)),this.updateRange(u,i.series));this.points.push(r);c.push(r)},seriesMissingValues:function(n){return n.missingValues},createMissingValue:function(){},updateRange:function(n,t){var e=this.chartService.intl,o=t.xAxis,s=t.yAxis,i=n.x,r=n.y,u=this.xAxisRanges[o],f=this.yAxisRanges[s];at(i)&&(u=this.xAxisRanges[o]=u||{min:it,max:ut},co(i)&&(i=lr(e,i)),u.min=Math.min(u.min,i),u.max=Math.max(u.max,i));at(r)&&(f=this.yAxisRanges[s]=f||{min:it,max:ut},co(r)&&(r=lr(e,r)),f.min=Math.min(f.min,r),f.max=Math.max(f.max,r))},evalPointOptions:function(n,i,r){var o=r.series,s=r.seriesIx,h={defaults:o._defaults,excluded:["data","tooltip","content","template","visual","toggle","_outOfRangeMinPoint","_outOfRangeMaxPoint"]},e=this._evalSeries[s],f;return u(e)||(this._evalSeries[s]=e=ur(n,{},h,!0)),f=n,e&&(f=t({},n),ur(f,{value:i,series:o,dataItem:r.dataItem},h)),f},pointType:function(){return kt},pointOptions:function(n,i){var r=this.seriesOptions[i],u;return r||(u=this.pointType().prototype.defaults,this.seriesOptions[i]=r=t({},u,{markers:{opacity:n.opacity},tooltip:{format:this.options.tooltip.format},labels:{format:this.options.labels.format}},n)),r},createPoint:function(n,t){var u=t.series,i=this.pointOptions(u,t.seriesIx),f=t.color||u.color,r;return i=this.evalPointOptions(i,n,t),rt(u.color)&&(f=i.color),r=new kt(n,i),r.color=f,this.append(r),r},seriesAxes:function(n){var i=n.xAxis,r=n.yAxis,t=this.plotArea,u=i?t.namedXAxes[i]:t.axisX,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,r=this.points,i=!this.options.clip,u=0;this.traverseDataPoints(function(n,f){var e=r[u++],o=t.seriesAxes(f.series),s=o.x.getSlot(n.x,n.x,i),h=o.y.getSlot(n.y,n.y,i),c;e&&(s&&h?(c=t.pointSlot(s,h),e.reflow(c)):e.visible=!1)});this.box=n},pointSlot:function(n,t){return new o(n.x1,t.y1,n.x2,t.y2)},traverseDataPoints:function(n){for(var u,h,r,f=this,e=this,o=e.options.series,s=e.seriesPoints,i=0;i<o.length;i++)for(u=o[i],h=s[i],h||(s[i]=[]),r=0;r<u.data.length;r++){var c=f._bindPoint(u,i,r),l=c.valueFields,a=c.fields;n(l,t({pointIx:r,series:u,seriesIx:i,dataItem:u.data[r],owner:f},a))}},formatPointValue:function(n,t){var i=n.value;return this.chartService.format.auto(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}});f(yt,{series:[],tooltip:{format:"{0}, {1}"},labels:{format:"{0}, {1}"},clip:!0});t(yt.prototype,ke,{_bindPoint:tt.prototype._bindPoint});ef=kt.extend({init:function(n,t){kt.fn.init.call(this,n,t);this.category=n.category},createHighlight:function(){var u=this.options.highlight,t=u.border,n=this.options.markers,i=this.box.center(),r=(n.size+n.border.width+t.width)/2,f=new vr,e=new oi.Circle(new li.Circle([i.x,i.y+r/5+t.width/2],r+t.width/2),{stroke:{color:"none"},fill:this.createGradient({gradient:"bubbleShadow",color:n.background,stops:[{offset:0,color:n.background,opacity:.3},{offset:1,color:n.background,opacity:0}]})}),o=new oi.Circle(new li.Circle([i.x,i.y],r),{stroke:{color:t.color||new tr(n.background).brightness(re).toHex(),width:t.width,opacity:t.opacity},fill:{color:n.background,opacity:u.opacity}});return f.append(e,o),f}});ef.prototype.defaults=t({},ef.prototype.defaults,{labels:{position:h},highlight:{opacity:1,border:{color:"#fff",width:2,opacity:1}}});ef.prototype.defaults.highlight.zIndex=undefined;ps=yt.extend({_initFields:function(){this._maxSize=ut;yt.fn._initFields.call(this)},addValue:function(n,t){n.size!==null&&(n.size>0||n.size<0&&t.series.negativeValues.visible)?(this._maxSize=Math.max(this._maxSize,Math.abs(n.size)),yt.fn.addValue.call(this,n,t)):(this.points.push(null),this.seriesPoints[t.seriesIx].push(null))},reflow:function(n){this.updateBubblesSize(n);yt.fn.reflow.call(this,n)},pointType:function(){return ef},createPoint:function(n,i){var r=i.series,s=r.data.length,e=i.pointIx*(vt/s),h={delay:e,duration:vt-e,type:pr},f=i.color||r.color,u,o;return n.size<0&&r.negativeValues.visible&&(f=g(r.negativeValues.color,f)),u=t({labels:{animation:{delay:e,duration:vt-e}}},this.pointOptions(r,i.seriesIx),{markers:{type:hr,border:r.border,opacity:r.opacity,animation:h}}),u=this.evalPointOptions(u,n,i),rt(r.color)&&(f=u.color),u.markers.background=f,o=new ef(n,u),o.color=f,this.append(o),o},updateBubblesSize:function(n){for(var u,i,o=this,p=this,s=p.options.series,h=Math.min(n.width(),n.height()),r=0;r<s.length;r++){var c=s[r],l=o.seriesPoints[r],w=c.minSize||Math.max(h*.02,10),b=c.maxSize||h*.2,a=w/2,f=b/2,v=Math.PI*a*a,k=Math.PI*f*f,d=k-v,nt=d/o._maxSize;for(u=0;u<l.length;u++)if(i=l[u],i){var tt=Math.abs(i.value.size)*nt,y=Math.sqrt((v+tt)/Math.PI),it=g(i.options.zIndex,0),e=it+(1-y/f);t(i.options,{zIndex:e,markers:{size:y*2,zIndex:e},labels:{zIndex:e+1}})}}},formatPointValue:function(n,t){var i=n.value;return this.chartService.format.auto(t,i.x,i.y,i.size,n.category)},createAnimation:function(){},createVisual:function(){}});f(ps,{tooltip:{format:"{3}"},labels:{format:"{3}"}});hc=pf.extend({});t(hc.prototype,ri);fu=r.extend({init:function(n,t){r.fn.init.call(this,t);this.aboveAxis=this.options.aboveAxis;this.color=t.color||lt;this.value=n},render:function(){var n=this.options;this._rendered||(this._rendered=!0,u(this.value.target)&&(this.target=new hc({type:n.target.shape,background:n.target.color||this.color,opacity:n.opacity,zIndex:n.zIndex,border:n.target.border,vAlign:ft,align:w}),this.target.value=this.value,this.target.dataItem=this.dataItem,this.target.series=this.series,this.append(this.target)),this.createNote())},reflow:function(n){var u;this.render();var f=this,t=f.options,i=f.target,e=f.owner,r=t.invertAxes,s=e.seriesValueAxis(this.options),h=e.categorySlot(e.categoryAxis,t.categoryIx,s),c=s.getSlot(this.value.target),l=r?c:h,a=r?h:c;i&&(u=new o(l.x1,a.y1,l.x2,a.y2),i.options.height=r?u.height():t.target.line.width,i.options.width=r?t.target.line.width:u.width(),i.reflow(u));this.note&&this.note.reflow(n);this.box=n},createVisual:function(){r.fn.createVisual.call(this);var n=this.options,t=v.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:g(n.border.opacity,n.opacity)});this.bodyVisual=t;cr(t);this.visual.append(t)},createAnimation:function(){this.bodyVisual&&(this.animation=ar.create(this.bodyVisual,this.options.animation))},createHighlight:function(n){return v.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){return this.owner.formatPointValue(this,n)}});fu.prototype.tooltipAnchor=er.prototype.tooltipAnchor;f(fu,{border:{width:1},vertical:!1,opacity:1,target:{shape:"",border:{width:0,color:"green"},line:{width:2}},tooltip:{format:"Current: {0}<br />Target: {1}"}});t(fu.prototype,ri);t(fu.prototype,be);ge=tt.extend({init:function(n,t){ey(t);tt.fn.init.call(this,n,t)},reflowCategories:function(n){for(var i=this.children,r=i.length,t=0;t<r;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,i){var s=i.categoryIx,a=i.category,u=i.series,v=i.seriesIx,h=this,r=h.options,y=h.children,c=n.valueFields,e=t({vertical:!r.invertAxes,overlay:u.overlay,categoryIx:s,invertAxes:r.invertAxes},u),l=n.fields.color||u.color,o,f;return e=this.evalPointOptions(e,c,a,s,u,v),rt(u.color)&&(l=e.color),o=new fu(c,e),o.color=l,f=y[s],f||(f=new uu({vertical:r.invertAxes,gap:r.gap,spacing:r.spacing,rtl:!r.invertAxes&&(this.chartService||{}).rtl}),this.append(f)),f.append(o),o},updateRange:function(n,t){var r=n.current,f=n.target,e=t.series.axis,i=this.valueAxisRanges[e];u(r)&&!isNaN(r)&&u(f&&!isNaN(f))&&(i=this.valueAxisRanges[e]=i||{min:it,max:ut},i.min=Math.min(i.min,r,f),i.max=Math.max(i.max,r,f))},formatPointValue:function(n,t){return this.chartService.format.auto(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 r=this,i=this.points,n,t;for(this._setAnimationOptions(),n=0;n<i.length;n++)t=i[n],t.options.animation=r.options.animation,t.createAnimation()}});ge.prototype._setAnimationOptions=ui.prototype._setAnimationOptions;f(ge,{animation:{type:si}});pi=st.extend({init:function(n,i){this.chartService=n;this.options=t({},this.options,i)},getStyle:function(n,t){var r=n.background,u=n.border.color,f,i;return t&&(f=t.color||t.options.color,r=g(r,f),u=g(u,f)),i=bt(n.padding||{},"auto"),{backgroundColor:r,borderColor:u,font:n.font,color:n.color,opacity:n.opacity,borderWidth:bf(n.border.width),paddingTop:bf(i.top),paddingBottom:bf(i.bottom),paddingLeft:bf(i.left),paddingRight:bf(i.right)}},show:function(n,t,i){n.format=t.format;var r=this.getStyle(t,i);n.style=r;!u(t.color)&&new tr(r.backgroundColor).percBrightness()>180&&(n.className="k-chart-tooltip-inverse");this.chartService.notify(tc,n)},hide:function(){this.chartService&&this.chartService.notify(ic)},destroy:function(){delete this.chartService}});f(pi,{border:{width:1},opacity:1});ws=pi.extend({init:function(n,t,i){pi.fn.init.call(this,n,i);this.crosshair=t;this.formatService=n.format;this.initAxisName()},initAxisName:function(){var n=this.crosshair.axis,i=n.plotArea,t;t=i.categoryAxis?n.getCategory?"categoryAxis":"valueAxis":n.options.vertical?"yAxis":"xAxis";this.axisName=t},showAt:function(n){var f=this,t=f.crosshair.axis,i=f.options,r=t[i.stickyMode?"getCategory":"getValue"](n),u=r;i.format?u=this.formatService.auto(i.format,r):t.options.type===af&&(u=this.formatService.auto(t.options.labels.dateFormats[t.options.baseUnit],r));this.show({point:n,anchor:this.getAnchor(),crosshair:this.crosshair,value:u,axisName:this.axisName,axisIndex:this.crosshair.axis.axisIndex},this.options)},hide:function(){this.chartService.notify(ic,{crosshair:this.crosshair,axisName:this.axisName,axisIndex:this.crosshair.axis.axisIndex})},getAnchor:function(){var f=this,e=f.crosshair,o=f.options,s=o.position,t=o.padding,c=!e.axis.options.vertical,i=e.line.bbox(),r,u,n;return c?(r=h,s===ht?(u=ft,n=i.bottomLeft().translate(0,t)):(u=ht,n=i.topLeft().translate(0,-t))):(u=h,s===y?(r=w,n=i.topLeft().translate(-t,0)):(r=y,n=i.topRight().translate(t,0))),{point:n,align:{horizontal:r,vertical:u}}}});f(ws,{padding:10});bs=r.extend({init:function(n,i,u){r.fn.init.call(this,u);this.axis=i;this.stickyMode=i instanceof hu;var f=this.options.tooltip;f.visible&&(this.tooltip=new ws(n,this,t({},f,{stickyMode:this.stickyMode})))},showAt:function(n){this.point=n;this.moveLine();this.line.visible(!0);this.tooltip&&this.tooltip.showAt(n)},hide:function(){this.line.visible(!1);this.tooltip&&this.tooltip.hide()},moveLine:function(){var e=this,r=e.axis,u=e.point,o=r.options.vertical,n=this.getBox(),t=o?l:a,f=new nt(n.x1,n.y1),i,s;i=o?new nt(n.x2,n.y1):new nt(n.x1,n.y2);u&&(this.stickyMode?(s=r.getSlot(r.pointCategoryIndex(u)),f[t]=i[t]=s.center()[t]):f[t]=i[t]=u[t]);this.box=n;this.line.moveTo(f).lineTo(i)},getBox:function(){for(var i,r=this.axis,e=r.pane.axes,s=e.length,o=r.options.vertical,u=r.lineBox().clone(),t=o?a:l,n,f=0;f<s;f++)i=e[f],i.options.vertical!==o&&(n?n.wrap(i.lineBox()):n=i.lineBox().clone());return u[t+1]=n[t+1],u[t+2]=n[t+2],u},createVisual:function(){r.fn.createVisual.call(this);var n=this.options;this.line=new v({stroke:{color:n.color,width:n.width,opacity:n.opacity,dashType:n.dashType},visible:!1});this.moveLine();this.visual.append(this.line)},destroy:function(){this.tooltip&&this.tooltip.destroy();r.fn.destroy.call(this)}});f(bs,{color:su,width:2,zIndex:-1,tooltip:{visible:!1}});ks=r.extend({init:function(n,t){r.fn.init.call(this,n);this.pane=t},shouldClip:function(){for(var t=this.children,i=t.length,n=0;n<i;n++)if(t[n].options.clip===!0)return!0;return!1},_clipBox:function(){return this.pane.chartsBox()},createVisual:function(){if(this.visual=new vr({zIndex:0}),this.shouldClip()){var n=this.clipBox=this._clipBox(),t=n.toRect(),i=v.fromRect(t);this.visual.clip(i);this.unclipLabels()}},stackRoot:function(){return this},unclipLabels:function(){for(var f,h,i,n,t,r,e=this,o=e.children,s=e.clipBox,u=0;u<o.length;u++)for(f=o[u].points||{},h=f.length,i=0;i<h;i++)n=f[i],n&&n.visible!==!1&&n.overlapsBox&&n.overlapsBox(s)&&(n.unclipElements?n.unclipElements():(t=n.label,r=n.note,t&&t.options.visible&&(t.alignToClipBox&&t.alignToClipBox(s),t.options.noclip=!0),r&&r.options.visible&&(r.options.noclip=!0)))},destroy:function(){r.fn.destroy.call(this);delete this.parent}});ks.prototype.isStackRoot=!0;of=ci.extend({init:function(n){ci.fn.init.call(this,n);this.id=oy();this.createTitle();this.content=new r;this.chartContainer=new ks({},this);this.append(this.content);this.axes=[];this.charts=[]},createTitle:function(){var n=this.options.title;ki(n)&&(n=t({},n,{align:n.position,position:ft}));this.title=i.Title.buildTitle(n,this,of.prototype.options.title)},appendAxis:function(n){this.content.append(n);this.axes.push(n);n.pane=this},appendChart:function(n){this.chartContainer.parent!==this.content&&this.content.append(this.chartContainer);this.charts.push(n);this.chartContainer.append(n);n.pane=this},empty:function(){var r=this,i=this.parent,n,t;if(i){for(n=0;n<this.axes.length;n++)i.removeAxis(r.axes[n]);for(t=0;t<this.charts.length;t++)i.removeChart(r.charts[t])}this.axes=[];this.charts=[];this.content.destroy();this.content.children=[];this.chartContainer.children=[]},reflow:function(n){var t;di(this.children)===this.content&&(t=this.children.pop());ci.fn.reflow.call(this,n);t&&this.children.push(t);this.title&&(this.contentBox.y1+=this.title.box.height())},visualStyle:function(){var n=ci.fn.visualStyle.call(this);return n.zIndex=-10,n},renderComplete:function(){this.options.visible&&this.createGridLines()},stackRoot:function(){return this},clipRoot:function(){return this},createGridLines:function(){for(var n,r,t=this.axes,u=t.concat(this.parent.axes),s=[],h=[],i=0;i<t.length;i++){var f=t[i],e=f.options.vertical,o=e?s:h;for(n=0;n<u.length;n++)o.length===0&&(r=u[n],e!==r.options.vertical&&wf(o,f.createGridLines(r)))}},refresh:function(){this.visual.clear();this.content.parent=null;this.content.createGradient=this.createGradient.bind(this);this.content.renderVisual();this.content.parent=this;this.title&&this.visual.append(this.title.visual);this.visual.append(this.content.visual);this.renderComplete()},chartsBox:function(){for(var u,v,i,f,e,s=this.axes,y=s.length,n=new o,r=0;r<y;r++){var h=s[r],t=h.options.vertical?l:a,c=h.lineBox();n[t+1]=c[t+1];n[t+2]=c[t+2]}if(n.x2===0)for(u=this.parent.axes,v=u.length,i=0;i<v;i++)f=u[i],f.options.vertical||(e=f.lineBox(),n.x1=e.x1,n.x2=e.x2);return n},clipBox:function(){return this.chartContainer.clipBox}});va=1;of.prototype.isStackRoot=!0;f(of,{zIndex:-1,shrinkToFit:!0,title:{align:y},visible:!0});ot=r.extend({init:function(n,t,i){r.fn.init.call(this,t);this.initFields(n,t);this.series=n;this.initSeries();this.charts=[];this.options.legend.items=[];this.axes=[];this.crosshairs=[];this.chartService=i;this.originalOptions=t;this.createPanes();this.render();this.createCrosshairs()},initFields:function(){},initSeries:function(){for(var t=this.series,n=0;n<t.length;n++)t[n].index=n},createPanes:function(){function h(n,i){co(n.title)&&(n.title={text:n.title});n.title=t({},i.title,n.title)}for(var r,i,e=this,o={title:{color:(this.options.title||{}).color}},u=[],f=this.options.panes||[],s=Math.max(f.length,1),n=0;n<s;n++)r=f[n]||{},h(r,o),i=new of(r),i.paneIndex=n,u.push(i),e.append(i);this.panes=u},createCrosshairs:function(n){var e=this,i,r,u,t,f;for(n===void 0&&(n=this.panes),i=0;i<n.length;i++)for(r=n[i],u=0;u<r.axes.length;u++)t=r.axes[u],t.options.crosshair&&t.options.crosshair.visible&&(f=new bs(e.chartService,t,t.options.crosshair),e.crosshairs.push(f),r.content.append(f))},removeCrosshairs:function(n){for(var i,r=this.crosshairs,u=n.axes,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 t=this.panes,r,i=0;i<t.length;i++)if(t[i].options.name===n){r=t[i];break}return r||t[0]},findPointPane:function(n){for(var i=this.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.findPane(n.options.pane);t.appendAxis(n);this.axes.push(n);n.plotArea=this},removeAxis:function(n){for(var t,u=this,r=[],i=0;i<this.axes.length;i++)t=u.axes[i],n!==t?r.push(t):t.destroy();this.axes=r},appendChart:function(n,t){this.charts.push(n);t?t.appendChart(n):this.append(n)},removeChart:function(n){for(var t,u=this,r=[],i=0;i<this.charts.length;i++)t=u.charts[i],t!==n?r.push(t):t.destroy();this.charts=r},addToLegend:function(n){for(var t,r,i,c,l,u,f,e,p=n.length,o=this.options.legend,a=o.labels||{},v=o.inactiveItems||{},s=v.labels||{},y=[],h=0;h<p;h++)(t=n[h],r=t.visible!==!1,t.visibleInLegend!==!1)&&(i=t.name,c=r?ni(a):ni(s)||ni(a),c&&(i=c({text:at(i)?i:"",series:t})),l=t._defaults,u=t.color,rt(u)&&l&&(u=l.color),f=void 0,e=void 0,r?(f={},e=u):(f={color:s.color,font:s.font},e=v.markers.color),at(i)&&i!==""&&y.push({text:i,labels:f,markerColor:e,series:t,active:r}));wf(o.items,y)},groupAxes:function(n){for(var e,t,i,r=[],u=[],f=0;f<n.length;f++)for(e=n[f].axes,t=0;t<e.length;t++)i=e[t],i.options.vertical?u.push(i):r.push(i);return{x:r,y:u,any:r.concat(u)}},groupSeriesByPane:function(){for(var t,i,f=this,u=this.series,n={},r=0;r<u.length;r++)t=u[r],i=f.seriesPaneName(t),n[i]?n[i].push(t):n[i]=[t];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 i=this.options.plotArea,t=this.panes,r=bt(i.margin);this.box=n.clone().unpad(r);this.reflowPanes();this.reflowAxes(t);this.reflowCharts(t)},redraw:function(n){var u=this,t=[].concat(n),i,r;for(this.initSeries(),i=0;i<t.length;i++)u.removeCrosshairs(t[i]),t[i].empty();for(this.render(t),this.reflowAxes(this.panes),this.reflowCharts(t),this.createCrosshairs(t),r=0;r<t.length;r++)t[r].refresh()},axisCrossingValues:function(n,t){for(var r=n.options,i=[].concat(r.axisCrossingValues||r.axisCrossingValue),f=t.length-i.length,e=i[0]||0,u=0;u<f;u++)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 u,e=this,v=n[0],a=t[0],p=this.axisCrossingValues(v,t),b=this.axisCrossingValues(a,n),d={},g={},nt={},tt={},f=0;f<t.length;f++){var i=t[f],ut=i.pane,o=ut.id,et=i.options.visible!==!1,s=pa(n,ut)||v,it=p;(s!==v&&(it=e.axisCrossingValues(s,t)),e.alignAxisTo(i,s,b[f],it[f]),i.options._overlap)||(k(i.lineBox().x1)===k(s.lineBox().x1)&&(d[o]&&i.reflow(i.box.alignTo(d[o].box,y).translate(-i.options.margin,0)),et&&(d[o]=i)),k(i.lineBox().x2)===k(s.lineBox().x2)&&(i._mirrored||(i.options.labels.mirror=!i.options.labels.mirror,i._mirrored=!0),e.alignAxisTo(i,s,b[f],it[f]),g[o]&&i.reflow(i.box.alignTo(g[o].box,w).translate(i.options.margin,0)),et&&(g[o]=i)),f!==0&&a.pane===i.pane&&(i.alignTo(a),i.reflow(i.box)))}for(u=0;u<n.length;u++){var r=n[u],ot=r.pane,h=ot.id,st=r.options.visible!==!1,l=pa(t,ot)||a,rt=b;(l!==a&&(rt=e.axisCrossingValues(l,n)),e.alignAxisTo(r,l,p[u],rt[u]),r.options._overlap)||(k(r.lineBox().y1)===k(l.lineBox().y1)&&(r._mirrored||(r.options.labels.mirror=!r.options.labels.mirror,r._mirrored=!0),e.alignAxisTo(r,l,p[u],rt[u]),nt[h]&&r.reflow(r.box.alignTo(nt[h].box,ft).translate(0,-r.options.margin)),st&&(nt[h]=r)),k(r.lineBox().y2,c.COORD_PRECISION)===k(l.lineBox().y2,c.COORD_PRECISION)&&(tt[h]&&r.reflow(r.box.alignTo(tt[h].box,ht).translate(0,r.options.margin)),st&&(tt[h]=r)),u!==0&&(r.alignTo(v),r.reflow(r.box)))}},shrinkAxisWidth:function(n){for(var e,i,r,u=this.groupAxes(n).any,o=vc(u),t=0,f=0;f<n.length;f++)e=n[f],e.axes.length>0&&(t=Math.max(t,o.width()-e.contentBox.width()));if(t!==0)for(i=0;i<u.length;i++)r=u[i],r.options.vertical||r.reflow(r.box.shrink(t,0))},shrinkAxisHeight:function(n){for(var t,i,f,r=0;r<n.length;r++){var e=n[r],u=e.axes,o=Math.max(0,vc(u).height()-e.contentBox.height());if(o!==0){for(t=0;t<u.length;t++)i=u[t],i.options.vertical&&i.reflow(i.box.shrink(0,o));f=!0}}return f},fitAxes:function(n){for(var i,a,r,s,u,h,c=this.groupAxes(n).any,f=0,e=0;e<n.length;e++){var l=n[e],t=l.axes,o=l.contentBox;if(t.length>0)for(i=vc(t),a=Math.max(o.y1-i.y1,o.y2-i.y2),f=Math.max(f,o.x1-i.x1),r=0;r<t.length;r++)s=t[r],s.reflow(s.box.translate(0,a))}for(u=0;u<c.length;u++)h=c[u],h.reflow(h.box.translate(f,0))},reflowAxes:function(n){for(var r=this,t=this.groupAxes(n),i=0;i<n.length;i++)r.reflowPaneAxes(n[i]);t.x.length>0&&t.y.length>0&&(this.alignAxes(t.x,t.y),this.shrinkAxisWidth(n),this.autoRotateAxisLabels(t),this.alignAxes(t.x,t.y),this.shrinkAxisWidth(n)&&this.alignAxes(t.x,t.y),this.shrinkAxisHeight(n),this.alignAxes(t.x,t.y),this.shrinkAxisHeight(n)&&this.alignAxes(t.x,t.y),this.fitAxes(n))},autoRotateAxisLabels:function(n){for(var o,t,s=this,u=this,f=u.axes,i=u.panes,e,r=0;r<f.length;r++)o=f[r],o.autoRotateLabels()&&(e=!0);if(e){for(t=0;t<i.length;t++)s.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,r=i.length,t;if(r>0)for(t=0;t<r;t++)i[t].reflow(n.contentBox)},reflowCharts:function(n){for(var r,i=this.charts,u=i.length,f=this.box,t=0;t<u;t++)r=i[t].pane,(!r||d(r,n))&&i[t].reflow(f)},reflowPanes:function(){for(var t,u,y,f,s,e,h,p,c=this,n=c.box,i=c.panes,r=i.length,l=n.height(),w=r,a=0,v=n.y1,o=0;o<r;o++)t=i[o],u=t.options.height,t.options.width=n.width(),t.options.height?(u.indexOf&&u.indexOf("%")&&(y=parseInt(u,10)/100,t.options.height=y*n.height()),t.reflow(n.clone()),l-=t.options.height):a++;for(f=0;f<r;f++)s=i[f],s.options.height||(s.options.height=l/a);for(e=0;e<r;e++)h=i[e],p=n.clone().move(n.x1,v),h.reflow(p),w--,v+=h.options.height},backgroundBox:function(){for(var u,t,f,e,i=this.axes,o=i.length,n,r=0;r<o;r++)for(u=i[r],t=0;t<o;t++)f=i[t],u.options.vertical!==f.options.vertical&&(e=u.lineBox().clone().wrap(f.lineBox()),n=n?n.wrap(e):e);return n||this.box},chartsBoxes:function(){for(var t=this.panes,i=[],n=0;n<t.length;n++)i.push(t[n].chartsBox());return i},addBackgroundPaths:function(n){for(var i=this.chartsBoxes(),t=0;t<i.length;t++)n.paths.push(v.fromRect(i[t].toRect()))},backgroundContainsPoint:function(n){for(var i=this.chartsBoxes(),t=0;t<i.length;t++)if(i[t].containsPoint(n))return!0},createVisual:function(){var u;r.fn.createVisual.call(this);var t=this.options.plotArea,f=t.opacity,i=t.background,n=t.border;n===void 0&&(n={});sy(i)&&(i=lt,f=0);u=this._bgVisual=new oi.MultiPath({fill:{color:i,opacity:f},stroke:{color:n.width?n.color:"",width:n.width,dashType:n.dashType},zIndex:-1});this.addBackgroundPaths(u);this.appendVisual(u)},pointsByCategoryIndex:function(n){var e=this.charts,o=[],t,s,i,f,r;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){return this.filterPoints(function(t){return t.series.index===n})},pointsBySeriesName:function(n){return this.filterPoints(function(t){return t.series.name===n})},filterPoints:function(n){for(var o,u,t,i,f=this.charts,e=[],r=0;r<f.length;r++)for(o=f[r],u=o.points,t=0;t<u.length;t++)i=u[t],i&&n(i)&&e.push(i);return e},findPoint:function(n){for(var e,u,t,i,f=this.charts,r=0;r<f.length;r++)for(e=f[r],u=e.points,t=0;t<u.length;t++)if(i=u[t],i&&n(i))return i},paneByPoint:function(n){for(var i,r=this.panes,t=0;t<r.length;t++)if(i=r[t],i.box.containsPoint(n))return i}});f(ot,{series:[],plotArea:{margin:{}},background:"",border:{color:su,width:0},legend:{inactiveItems:{labels:{color:"#919191"},markers:{color:"#919191"}}}});sf={hover:function(n,t){this._dispatchEvent(n,t,nc)},click:function(n,t){this._dispatchEvent(n,t,ia)}};yc=st.extend({init:function(n,t,i){var e=t.canonicalFields(n),s=t.valueFields(n),h=t.sourceFields(n,e),c=this._seriesFields=[],l=i.query(n.type),o=n.aggregate||l,u,f,r;for(this._series=n,this._binder=t,u=0;u<e.length;u++){if(f=e[u],r=void 0,ki(o))r=o[f];else if(u===0||d(f,s))r=o;else break;r&&c.push({canonicalName:f,name:h[u],transform:rt(r)?r:te[r]})}},aggregatePoints:function(n,t){var v=this,l=this,y=l._series,a=l._seriesFields,o=this._bindPoints(n||[]),r=o.dataItems[0],f={},h,e;for(!r||s(r)||so(r)||(h=function(){},h.prototype=r,f=new h),e=0;e<a.length;e++){var c=a[e],p=v._bindField(o.values,c.canonicalName),i=c.transform(p,y,o.dataItems,t);if(i===null||!ki(i)||u(i.length)||i instanceof Date)u(i)&&hy(c.name,f,i);else{f=i;break}}return f},_bindPoints:function(n){for(var i,r=this,o=r._binder,u=r._series,f=[],e=[],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 r=[],s=n.length,i=0;i<s;i++){var f=n[i],e=f.valueFields,o=void 0;o=u(e[t])?e[t]:f.fields[t];r.push(o)}return r}});ei=st.extend({init:function(){this._defaults={}},register:function(n,t){for(var r=this,i=0;i<n.length;i++)r._defaults[n[i]]=t},query:function(n){return this._defaults[n]}});ei.current=new ei;to=er.extend({createLabel:function(){var n=this.options.labels,i=t({},n,n.from),r=t({},n,n.to);i.visible&&(this.labelFrom=this._createLabel(i),this.append(this.labelFrom));r.visible&&(this.labelTo=this._createLabel(r),this.append(this.labelTo))},_createLabel:function(n){var i=ni(n),r;return r=i?i({dataItem:this.dataItem,category:this.category,value:this.value,percentage:this.percentage,runningTotal:this.runningTotal,total:this.total,series:this.series}):this.formatValue(n.format),new ls(r,t({vertical:this.options.vertical},n))},reflow:function(n){this.render();var i=this,r=i.labelFrom,u=i.labelTo,t=i.value;this.box=n;r&&(r.options.aboveAxis=t.from>t.to,r.reflow(n));u&&(u.options.aboveAxis=t.to>t.from,u.reflow(n));this.note&&this.note.reflow(n)}});to.prototype.defaults=t({},to.prototype.defaults,{labels:{format:"{0} - {1}"},tooltip:{format:"{1}"}});ds=ui.extend({pointType:function(){return to},pointValue:function(n){return n.valueFields},formatPointValue:function(n,t){return n.value.from===null&&n.value.to===null?"":this.chartService.format.auto(t,n.value.from,n.value.to)},plotRange:function(n){return n?[n.value.from,n.value.to]:0},updateRange:function(n,t){var f=t.series.axis,r=n.from,u=n.to,i=this.valueAxisRanges[f];n!==null&&s(r)&&s(u)&&(i=this.valueAxisRanges[f]=i||{min:it,max:ut},i.min=Math.min(i.min,r),i.max=Math.max(i.max,r),i.min=Math.min(i.min,u),i.max=Math.max(i.max,u))},aboveAxis:function(n){var t=n.value;return t.from<t.to}});ds.prototype.plotLimits=tt.prototype.plotLimits;var wa=kt.extend({aliasFor:function(){return this.parent}}),ba="auto",cy="{0}",ly="{1}",hf=r.extend({init:function(n,t){r.fn.init.call(this);this.value=n;this.options=t;this.aboveAxis=g(this.options.aboveAxis,!0);this.tooltipTracking=!0;this.initLabelsFormat()},render:function(){if(!this._rendered){this._rendered=!0;var n=this.options,i=n.markers,r=n.labels,u=this.value,f=this.fromPoint=new wa(u,t({},this.options,{labels:r.from,markers:i.from})),e=this.toPoint=new wa(u,t({},this.options,{labels:r.to,markers:i.to}));this.copyFields(f);this.copyFields(e);this.append(f);this.append(e)}},reflow:function(n){this.render();var t=n.from,i=n.to;this.positionLabels(t,i);this.fromPoint.reflow(t);this.toPoint.reflow(i);this.box=this.fromPoint.markerBox().clone().wrap(this.toPoint.markerBox())},createHighlight:function(){var n=new vr;return n.append(this.fromPoint.createHighlight()),n.append(this.toPoint.createHighlight()),n},highlightVisual:function(){return this.visual},highlightVisualArgs:function(){return{options:this.options,from:this.fromPoint.highlightVisualArgs(),to:this.toPoint.highlightVisualArgs()}},tooltipAnchor:function(){var u=this.owner.pane.clipBox(),o=!u||u.overlaps(this.box);if(o){var n=this.box,f=n.center(),s=y,t,i,r;return this.options.vertical?(t=f.x,i=n.y1-ti,r=ht):(t=n.x2+ti,i=f.y,r=h),{point:new e(t,i),align:{horizontal:s,vertical:r}}}},formatValue:function(n){return this.owner.formatPointValue(this,n)},overlapsBox:function(n){return this.box.overlaps(n)},unclipElements:function(){this.fromPoint.unclipElements();this.toPoint.unclipElements()},initLabelsFormat:function(){var t=this.options.labels;t.format||(t.from&&t.from.format||(t.from=n.extend({},t.from,{format:cy})),t.to&&t.to.format||(t.to=n.extend({},t.to,{format:ly})))},positionLabels:function(n,t){var f=this.options,i=f.labels,e=f.vertical,r,u;i.position===ba&&(e?t.y1<=n.y1?(u=fe,r=po):(u=po,r=fe):t.x1<=n.x1?(u=y,r=w):(u=w,r=y),i.from&&i.from.position||(this.fromPoint.options.labels.position=r),i.to&&i.to.position||(this.toPoint.options.labels.position=u))},copyFields:function(n){n.dataItem=this.dataItem;n.category=this.category;n.series=this.series;n.color=this.color;n.owner=this.owner}});t(hf.prototype,ri);t(hf.prototype,be);hf.prototype.defaults={markers:{visible:!1,background:lt,size:ue,type:hr,border:{width:2},opacity:1},labels:{visible:!1,margin:bt(3),padding:bt(4),animation:{type:ai,delay:vt},position:ba},notes:{label:{}},highlight:{markers:{border:{color:lt,width:2}},zIndex:c.HIGHLIGHT_ZINDEX},tooltip:{format:"{0} - {1}"}};var pc=fr.extend({createStrokeSegments:function(){return this.segmentsFromPoints(this.toGeometryPoints(this.toPoints()))},stackSegments:function(){var n=this.fromSegments;return this.fromSegments||(n=this.fromSegments=this.segmentsFromPoints(this.toGeometryPoints(this.fromPoints().reverse()))),n},createStroke:function(n){var t=new v(n),i=new v(n);t.segments.push.apply(t.segments,this.strokeSegments());i.segments.push.apply(i.segments,this.stackSegments());this.visual.append(t);this.visual.append(i)},hasStackSegment:function(){return!0},fromPoints:function(){return this.linePoints.map(function(n){return n.fromPoint})},toPoints:function(){return this.linePoints.map(function(n){return n.toPoint})}}),ay=pc.extend({createStrokeSegments:function(){return this.createCurveSegments(this.toPoints())},stackSegments:function(){var n=this.fromSegments;return this.fromSegments||(n=this.fromSegments=this.createCurveSegments(this.fromPoints().reverse())),n},createCurveSegments:function(n){var t=new ho;return t.process(this.toGeometryPoints(n))}}),ka=pc.extend({createStrokeSegments:function(){return this.segmentsFromPoints(this.calculateStepPoints(this.toPoints()))},stackSegments:function(){var n=this.fromSegments;return this.fromSegments||(n=this.fromSegments=this.segmentsFromPoints(this.calculateStepPoints(this.fromPoints())),n.reverse()),n}});t(ka.prototype,os);gs=tt.extend({render:function(){tt.fn.render.call(this);this.renderSegments()},pointType:function(){return hf},createPoint:function(n,t){var s=t.categoryIx,h=t.category,i=t.series,o=t.seriesIx,r=n.valueFields,u,e,f;if(!at(r.from)&&!at(r.to))if(this.seriesMissingValues(i)===vi)r={from:0,to:0};else return null;return u=this.pointOptions(i,o),u=this.evalPointOptions(u,r,h,s,i,o),e=n.fields.color||i.color,rt(i.color)&&(e=u.color),f=new hf(r,u),f.color=e,this.append(f),f},createSegment:function(n,t,i){var r=(t.line||{}).style,u;return u=r==="smooth"?ay:r==="step"?ka:pc,new u(n,t,i)},plotRange:function(n,t){return n?[n.value.from,n.value.to]:[t,t]},valueSlot:function(n,t){var i=n.getSlot(t[0],t[0],!this.options.clip),r=n.getSlot(t[1],t[1],!this.options.clip);if(i&&r)return{from:i,to:r}},pointSlot:function(n,t){var i=t.from,r=t.to,u,f;return this.options.invertAxes?(u=new o(i.x1,n.y1,i.x2,n.y2),f=new o(r.x1,n.y1,r.x2,n.y2)):(u=new o(n.x1,i.y1,n.x2,i.y2),f=new o(n.x1,r.y1,n.x2,r.y2)),{from:u,to:f}},addValue:function(n,t){var i=n.valueFields;s(i.from)||(i.from=i.to);s(i.to)||(i.to=i.from);tt.fn.addValue.call(this,n,t)},updateRange:function(n,t){if(n!==null&&s(n.from)&&s(n.to)){var r=t.series.axis,i=this.valueAxisRanges[r]=this.valueAxisRanges[r]||{min:it,max:ut},u=n.from,f=n.to;i.min=Math.min(i.min,u,f);i.max=Math.max(i.max,u,f)}},formatPointValue:function(n,t){var i=n.value;return this.chartService.format.auto(t,i.from,i.to)},animationPoints:function(){for(var n,r=this.points,t=[],i=0;i<r.length;i++)n=r[i],n&&(t.push((n.fromPoint||{}).marker),t.push((n.toPoint||{}).marker));return t.concat(this._segments)}});t(gs.prototype,ec,ke);var da=fi.extend({reflow:function(n){var e=this,l=e.options,t=e.value,a=e.owner,o=a.seriesValueAxis(l),s=[],h=[],c=[],i=o.getSlot(t.low,t.high),r=o.getSlot(t.open,t.open),u=o.getSlot(t.close,t.close),f;r.x1=u.x1=i.x1=n.x1;r.x2=u.x2=i.x2=n.x2;f=i.center().x;s.push([r.x1,r.y1]);s.push([f,r.y1]);h.push([f,u.y1]);h.push([u.x2,u.y1]);c.push([f,i.y1]);c.push([f,i.y2]);this.lines=[s,h,c];this.box=i.clone().wrap(r.clone().wrap(u));this.reflowNote()},createBody:function(){}}),ga=uf.extend({pointType:function(){return da}}),wc=r.extend({init:function(n,t,i){r.fn.init.call(this);this.from=n;this.to=t;this.series=i},linePoints:function(){var t=this.from,f=this,n=f.from.box,e=f.to.box,i=[],r,u;return t.isVertical?(r=t.aboveAxis?n.y1:n.y2,i.push([n.x1,r],[e.x2,r])):(u=t.aboveAxis?n.x2:n.x1,i.push([u,n.y1],[u,e.y2])),i},createVisual:function(){r.fn.createVisual.call(this);var n=this.series.line||{},t=v.fromPoints(this.linePoints(),{stroke:{color:n.color,width:n.width,opacity:n.opacity,dashType:n.dashType}});cr(t);this.visual.append(t)}});f(wc,{animation:{type:ai,delay:vt}});bc=ui.extend({render:function(){ui.fn.render.call(this);this.createSegments()},traverseDataPoints:function(n){for(var i,o=this.options.series,v=this.categoryAxis.options.categories||[],y=es(o),w=!this.options.invertAxes,f=0;f<o.length;f++){var l=o[f],t=0,r=0;for(i=0;i<y;i++){var u=p.current.bindPoint(l,i),h=u.valueFields.value,a=u.fields.summary,c=t,e=void 0;a?a.toLowerCase()==="total"?(u.valueFields.value=t,c=0,e=t):(u.valueFields.value=r,e=c-r,r=0):s(h)&&(r+=h,t+=h,e=t);n(u,{category:v[i],categoryIx:i,series:l,seriesIx:f,total:t,runningTotal:r,from:c,to:e,isVertical:w})}}},updateRange:function(n,t){ui.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,i,r,u,f,s=this,e=this.options.series,h=this.seriesPoints,c=this.segments=[],n=0;n<e.length;n++)if(o=e[n],t=h[n],t)for(i=void 0,r=0;r<t.length;r++)u=t[r],u&&i&&(f=new wc(i,u,o),c.push(f),s.append(f)),i=u}});var dc=[vu,gr,bu,iu],nv=[pu,tu].concat(dc),wi=ot.extend({initFields:function(n){var r=this,t,i;if(this.namedCategoryAxes={},this.namedValueAxes={},this.valueAxisRangeTracker=new de,n.length>0)for(this.invertAxes=d(n[0].type,[si,wr,tu,gr,iu,dr,kr,nu]),t=0;t<n.length;t++)if(i=n[t].stack,i&&i.type==="100%"){r.stack100=!0;break}},render:function(n){n===void 0&&(n=this.panes);this.createCategoryAxes(n);this.aggregateCategories(n);this.createCategoryAxesLabels(n);this.createCharts(n);this.createValueAxes(n)},removeAxis:function(n){var t=n.options.name;ot.fn.removeAxis.call(this,n);n instanceof hu?delete this.namedCategoryAxes[t]:(this.valueAxisRangeTracker.reset(t),delete this.namedValueAxes[t]);n===this.categoryAxis&&delete this.categoryAxis;n===this.valueAxis&&delete this.valueAxis},createCharts:function(n){for(var u,f,e,o,i,t=this,s=this.groupSeriesByPane(),r=0;r<n.length;r++)if(u=n[r],f=s[u.options.name||"default"]||[],t.addToLegend(f),e=t.filterVisibleSeries(f),e)for(o=t.groupSeriesByCategoryAxis(e),i=0;i<o.length;i++)t.createChartGroup(o[i],u)},createChartGroup:function(n,t){this.createAreaChart(b(n,[vu,gr]),t);this.createRangeAreaChart(b(n,[bu,iu]),t);this.createBarChart(b(n,[yi,si]),t);this.createRangeBarChart(b(n,[ku,dr]),t);this.createBulletChart(b(n,[wr,le]),t);this.createCandlestickChart(b(n,br),t);this.createBoxPlotChart(b(n,[yu,nu]),t);this.createOHLCChart(b(n,wu),t);this.createWaterfallChart(b(n,[du,kr]),t);this.createLineChart(b(n,[pu,tu]),t)},aggregateCategories:function(n){for(var r=this,u=this.srcSeries||this.series,e=[],f=0;f<u.length;f++){var t=u[f],i=r.seriesCategoryAxis(t),o=r.findPane(i.options.pane),h=or(i.options.type,af);(h||t.categoryField)&&d(o,n)?t=r.aggregateSeries(t,i):(s(i.options.min)||s(i.options.max))&&(t=r.filterSeries(t,i));e.push(t)}this.srcSeries=u;this.series=e},filterSeries:function(n,i){var r=i.totalRangeIndices(),o=i.options.justified,h=d(n.type,nv),u,f,e;return r.min=s(i.options.min)?Math.floor(r.min):0,r.max=s(i.options.max)?o?Math.floor(r.max)+1:Math.ceil(r.max):n.data.length,u=t({},n),h&&(f=r.min-1,e=i.options.srcCategories||[],f>=0&&f<u.data.length&&(u._outOfRangeMinPoint={item:u.data[f],category:e[f],categoryIx:-1}),r.max<u.data.length&&(u._outOfRangeMaxPoint={item:u.data[r.max],category:e[r.max],categoryIx:r.max-r.min})),i._seriesMax=Math.max(i._seriesMax||0,u.data.length),u.data=(u.data||[]).slice(r.min,r.max),u},aggregateSeries:function(n,i){var ft=this,et=d(n.type,nv),g=i.options,c=g.categories,nt=g.srcCategories,l,f,h,r,k,v,e;nt===void 0&&(nt=c);l=g.dataItems;l===void 0&&(l=[]);var ot=or(i.options.type,af),st=t({},n),y=t({},n),tt=n.data,a=[],w=ut,b=it,rt=ie,o,s;for(ot&&(rt=lc),f=0;f<tt.length;f++)h=void 0,h=n.categoryField?rt(n.categoryField,tt[f],ft.chartService.intl):nt[f],u(h)&&(r=i.categoryIndex(h),0<=r&&r<c.length?(a[r]=a[r]||[],a[r].push(f)):et&&(r<0?r===w?o.points.push(f):r>w&&(w=r,o={category:h,points:[f]}):r>=c.length&&(r===b?s.points.push(f):r<b&&(b=r,s={category:h,points:[f]}))));for(k=new yc(st,p.current,ei.current),v=y.data=[],e=0;e<c.length;e++)v[e]=k.aggregatePoints(a[e],c[e]),a[e]&&(l[e]=v[e]);return o&&v.length&&(y._outOfRangeMinPoint={item:k.aggregatePoints(o.points,o.category),categoryIx:w,category:o.category}),s&&v.length&&(y._outOfRangeMaxPoint={item:k.aggregatePoints(s.points,s.category),categoryIx:b,category:s.category}),i.options.dataItems=l,y},appendChart:function(n,t){for(var i=n.options.series,u=this.seriesCategoryAxis(i[0]),r=u.options.categories,f=Math.max(0,es(i)-r.length);f--;)r.push("");this.valueAxisRangeTracker.update(n.valueAxisRanges);ot.fn.appendChart.call(this,n,t)},seriesPaneName:function(n){var t=this.options,i=n.axis,r=[].concat(t.valueAxis),u=kf(r,function(n){return n.name===i})[0],f=t.panes||[{}],e=(f[0]||{}).name||"default";return(u||{}).pane||e},seriesCategoryAxis:function(n){var t=n.categoryAxis,i=t?this.namedCategoryAxes[t]:this.categoryAxis;if(!i)throw new Error("Unable to locate category axis with name "+t);return i},stackableChartOptions:function(n,t){var i=n.stack,r=i&&i.type==="100%",u=t.options.clip;return{isStacked:i,isStacked100:r,clip:u}},groupSeriesByCategoryAxis:function(n){for(var i,f,t,s,e,r=[],o={},u=0;u<n.length;u++)i=n[u].categoryAxis||"$$default$$",o.hasOwnProperty(i)||(o[i]=!0,r.push(i));for(f=[],t=0;t<r.length;t++)(s=r[t],e=vy(n,s,t),e.length!==0)&&f.push(e);return f},createBarChart:function(t,i){if(t.length!==0){var r=t[0],u=new ui(this,n.extend({series:t,invertAxes:this.invertAxes,gap:r.gap,spacing:r.spacing},this.stackableChartOptions(r,i)));this.appendChart(u,i)}},createRangeBarChart:function(n,t){if(n.length!==0){var i=n[0],r=new ds(this,{series:n,invertAxes:this.invertAxes,gap:i.gap,spacing:i.spacing});this.appendChart(r,t)}},createBulletChart:function(n,t){if(n.length!==0){var i=n[0],r=new ge(this,{series:n,invertAxes:this.invertAxes,gap:i.gap,spacing:i.spacing,clip:t.options.clip});this.appendChart(r,t)}},createLineChart:function(t,i){if(t.length!==0){var r=t[0],u=new ru(this,n.extend({invertAxes:this.invertAxes,series:t},this.stackableChartOptions(r,i)));this.appendChart(u,i)}},createAreaChart:function(t,i){if(t.length!==0){var r=t[0],u=new oa(this,n.extend({invertAxes:this.invertAxes,series:t},this.stackableChartOptions(r,i)));this.appendChart(u,i)}},createRangeAreaChart:function(n,t){if(n.length!==0){var i=new gs(this,{invertAxes:this.invertAxes,series:n,clip:t.options.clip});this.appendChart(i,t)}},createOHLCChart:function(n,t){if(n.length!==0){var i=n[0],r=new ga(this,{invertAxes:this.invertAxes,gap:i.gap,series:n,spacing:i.spacing,clip:t.options.clip});this.appendChart(r,t)}},createCandlestickChart:function(n,t){if(n.length!==0){var i=n[0],r=new uf(this,{invertAxes:this.invertAxes,gap:i.gap,series:n,spacing:i.spacing,clip:t.options.clip});this.appendChart(r,t)}},createBoxPlotChart:function(n,t){if(n.length!==0){var i=n[0],r=new la(this,{invertAxes:this.invertAxes,gap:i.gap,series:n,spacing:i.spacing,clip:t.options.clip});this.appendChart(r,t)}},createWaterfallChart:function(n,t){if(n.length!==0){var i=n[0],r=new bc(this,{series:n,invertAxes:this.invertAxes,gap:i.gap,spacing:i.spacing});this.appendChart(r,t)}},axisRequiresRounding:function(n,t){for(var i,e,r,o,s=this,u=b(this.series,dl),f=0;f<this.series.length;f++)i=s.series[f],d(i.type,dc)&&(e=i.line,e&&e.style===au&&u.push(i));for(r=0;r<u.length;r++)if(o=u[r].categoryAxis||"",o===n||!o&&t===0)return!0},aggregatedAxis:function(n,t){for(var u,r=this.series,i=0;i<r.length;i++)if(u=r[i].categoryAxis||"",(u===n||!u&&t===0)&&r[i].categoryField)return!0},createCategoryAxesLabels:function(){for(var t=this.axes,n=0;n<t.length;n++)t[n]instanceof hu&&t[n].createLabels()},createCategoryAxes:function(n){for(var i,v,f,h,e,c,r=this,s=this.invertAxes,l=[].concat(this.options.categoryAxis),a=[],o=0;o<l.length;o++)if(i=l[o],v=r.findPane(i.pane),d(v,n)){if(f=i.name,h=i.categories,h===void 0&&(h=[]),i=t({vertical:s,reverse:!s&&r.chartService.rtl,axisCrossingValue:s?it:0},i),u(i.justified)||(i.justified=r.isJustified()),r.axisRequiresRounding(f,o)&&(i.justified=!1),e=void 0,e=ac(i,h[0])?new lo(i,r.chartService):new hu(i,r.chartService),f){if(r.namedCategoryAxes[f])throw new Error("Category axis with name "+f+" is already defined");r.namedCategoryAxes[f]=e}e.axisIndex=o;a.push(e);r.appendAxis(e)}c=this.categoryAxis||a[0];this.categoryAxis=c;s?this.axisY=c:this.axisX=c},isJustified:function(){for(var i,t=this.series,n=0;n<t.length;n++)if(i=t[n],!d(i.type,dc))return!1;return!0},createValueAxes:function(n){var e=this,y=this.valueAxisRangeTracker,h=y.query(),p=[].concat(this.options.valueAxis),l=this.invertAxes,a={vertical:!l,reverse:l&&this.chartService.rtl},w=[],u,f,b,v,s,c;for(this.stack100&&(a.roundToMajorUnit=!1,a.labels={format:"P0"}),u=0;u<p.length;u++)if(f=p[u],b=e.findPane(f.pane),d(b,n)){var o=f.name,k=or(f.type,ye)?{min:.1,max:1}:{min:0,max:1},r=y.query(o)||h||k;if(u===0&&r&&h&&(r.min=Math.min(r.min,h.min),r.max=Math.max(r.max,h.max)),v=void 0,v=or(f.type,ye)?i.LogarithmicAxis:i.NumericAxis,s=new v(r.min,r.max,t({},a,f),e.chartService),o){if(e.namedValueAxes[o])throw new Error("Value axis with name "+o+" is already defined");e.namedValueAxes[o]=s}s.axisIndex=u;w.push(s);e.appendAxis(s)}c=this.valueAxis||w[0];this.valueAxis=c;l?this.axisX=c:this.axisY=c},_dispatchEvent:function(n,t,i){var c=n._eventCoordinates(t),u=new e(c.x,c.y),l=this.pointPane(u),r=[],s=[],h,f,o;if(l){for(h=l.axes,f=0;f<h.length;f++)o=h[f],o.getValue?kc(s,o.getValue(u)):kc(r,o.getCategory(u));r.length===0&&kc(r,this.categoryAxis.getCategory(u));r.length>0&&s.length>0&&n.trigger(i,{element:gi(t),originalEvent:t,category:no(r),value:no(s)})}},pointPane:function(n){for(var i,r=this.panes,t=0;t<r.length;t++)if(i=r[t],i.contentBox.containsPoint(n))return i},updateAxisOptions:function(n,t){tv(this.options,n,t);tv(this.originalOptions,n,t)}});f(wi,{categoryAxis:{categories:[]},valueAxis:{}});t(wi.prototype,sf);gc=st.extend({init:function(){this._points=[]},destroy:function(){this._points=[]},show:function(n){var r=this,u=[].concat(n),i,t;for(this.hide(),i=0;i<u.length;i++)t=u[i],t&&t.toggleHighlight&&t.hasHighlight()&&(r.togglePointHighlight(t,!0),r._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,stackValue:n.stackValue,preventDefault:yy,visual:n.highlightVisual(),show:t},r(i),i._defaultPrevented||n.toggleHighlight(t)):n.toggleHighlight(t)},hide:function(){for(var t=this,n=this._points;n.length;)t.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}});nh=st.extend({init:function(n,i){this.plotArea=n;this.options=t({},this.options,i)},start:function(n){return this._active=iv(n,this.options.key),this._active},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,nl(t)}},end:function(){var n=this._active;return this._active=!1,n},pan:function(){var u=this,t=u.plotArea,i=u.axisRanges,n,r;if(i.length){for(n=0;n<i.length;n++)r=i[n],t.updateAxisOptions(r.axis,r.range);t.redraw(t.panes)}},destroy:function(){delete this.plotArea},_panAxes:function(n,t){var s=this.plotArea,e=-n[t].delta,h=(this.options.lock||"").toLowerCase(),o=[],f,r,i,u;if(e!==0&&(h||"").toLowerCase()!==t)for(f=s.axes,r=0;r<f.length;r++)i=f[r],(t===a&&!i.options.vertical||t===l&&i.options.vertical)&&(u=i.pan(e),u&&(u.limitRange=!0,o.push({axis:i,range:u})));return o}});nh.prototype.options={key:"none",lock:"none"};th=st.extend({init:function(n,i){this.chart=n;this.options=t({},this.options,i);this.createElement()},createElement:function(){var t=this._marquee=document.createElement("div"),n;t.className="k-marquee";n=document.createElement("div");n.className="k-marquee-color";t.appendChild(n)},removeElement:function(){this._marquee.parentNode&&this._marquee.parentNode.removeChild(this._marquee)},setStyles:function(n){et(this._marquee,n)},start:function(n){var i,r;if(iv(n,this.options.key)){var u=this.chart,f=u._eventCoordinates(n),t=this._zoomPane=u._plotArea.paneByPoint(f);if(t&&t.clipBox())return i=t.clipBox().clone(),r=this._elementOffset(),i.translate(r.left,r.top),this._zoomPaneClipBox=i,document.body.appendChild(this._marquee),this.setStyles({left:n.pageX+1,top:n.pageY+1,width:0,height:0}),!0}return!1},_elementOffset:function(){var n=this.chart.element,t=et(n,["paddingLeft","paddingTop"]),u=t.paddingLeft,f=t.paddingTop,r=i.elementOffset(n);return{left:u+r.left,top:f+r.top}},move:function(n){var t=this._zoomPane;t&&this.setStyles(this._selectionPosition(n))},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.removeElement(),delete this._zoomPane,nl(this.axisRanges)},zoom:function(){var n=this.axisRanges,t,i,r;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.removeElement();delete this._marquee;delete this.chart},_updateAxisRanges:function(n,t){for(var i,u,f,e=(this.options.lock||"").toLowerCase(),o=[],s=this._zoomPane.axes,r=0;r<s.length;r++)i=s[r],u=i.options.vertical,e===a&&!u||e===l&&u||(f=i.pointsRange(n,t),f&&o.push({axis:i,range:f}));this.axisRanges=o},_selectionPosition:function(n){var t=this._zoomPaneClipBox,i={x:n.x.startLocation,y:n.y.startLocation},r=n.x.location,u=n.y.location,o=(this.options.lock||"").toLowerCase(),s=Math.min(i.x,r),h=Math.min(i.y,u),f=Math.abs(i.x-r),e=Math.abs(i.y-u);return o===a&&(s=t.x1,f=t.width()),o===l&&(h=t.y1,e=t.height()),r>t.x2&&(f=t.x2-i.x),r<t.x1&&(f=i.x-t.x1),u>t.y2&&(e=t.y2-i.y),u<t.y1&&(e=i.y-t.y1),{left:Math.max(s,t.x1),top:Math.max(h,t.y1),width:f,height:e}}});th.prototype.options={key:"shift",lock:"none"};var rv=st.extend({init:function(n,i){this.chart=n;this.options=t({},this.options,i)},updateRanges:function(n){for(var t,u,f,e=(this.options.lock||"").toLowerCase(),i=[],o=this.chart._plotArea.axes,r=0;r<o.length;r++)t=o[r],u=t.options.vertical,e===a&&!u||e===l&&u||(f=t.zoomRange(-n),f&&i.push({axis:t,range:f}));return this.axisRanges=i,nl(i)},zoom:function(){var n=this.axisRanges,t,i,r;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(){delete this.chart}}),uv=r.extend({init:function(n,t){r.fn.init.call(this,n);this.chartService=t},render:function(){var u=this,f=u.children,n=u.options,t=n.vertical,i,r;for(this.visual=new oi.Layout(null,{spacing:t?0:n.spacing,lineSpacing:t?n.spacing:0,orientation:t?"vertical":"horizontal",reverse:n.rtl,alignItems:t?"start":"center"}),i=0;i<f.length;i++)r=f[i],r.reflow(new o),r.renderVisual()},reflow:function(n){this.visual.rect(n.toRect());this.visual.reflow();var t=this.visual.clippedBBox();this.box=t?i.rectToBox(t):new o},renderVisual:function(){this.addVisual()},createVisual:function(){}}),fv=ci.extend({init:function(n){ci.fn.init.call(this,n);this.createContainer();n.rtl?(this.createLabel(),this.createMarker()):(this.createMarker(),this.createLabel())},createContainer:function(){this.container=new i.FloatElement({vertical:!1,wrap:!1,align:h,spacing:this.options.spacing});this.append(this.container)},createMarker:function(){this.container.append(new pf(this.markerOptions()))},markerOptions:function(){var n=this.options,i=n.markerColor;return t({},n.markers,{background:i,border:{color:i}})},createLabel:function(){var n=this.options,i=t({},n.labels);this.container.append(new yf(n.text,i))},renderComplete:function(){ci.fn.renderComplete.call(this);var n=this.options.cursor||{},t=this._itemOverlay=v.fromRect(this.container.box.toRect(),{fill:{color:lt,opacity:0},stroke:null,cursor:n.style||n});this.appendVisual(t)},click:function(n,t){var i=this.eventArgs(t);n.trigger(gl,i)||t.preventDefault()},hover:function(n,t){var i=this.eventArgs(t);return n.trigger(na,i)||(t.preventDefault(),n._legendItemHover(i.seriesIndex,i.pointIndex)),!0},leave:function(n){n._unsetActivePoint()},eventArgs:function(n){var t=this.options;return{element:gi(n),text:t.text,series:t.series,seriesIndex:t.series.index,pointIndex:t.pointIndex}},renderVisual:function(){var n=this,t=this.options,i=t.visual;i?(this.visual=i({active:t.active,series:t.series,sender:this.getSender(),pointIndex:t.pointIndex,options:{markers:this.markerOptions(),labels:t.labels},createVisual:function(){n.createVisual();n.renderChildren();n.renderComplete();var t=n.visual;return delete n.visual,t}}),this.addVisual()):ci.fn.renderVisual.call(this)}}),ev="horizontal",ih="custom",tl=r.extend({init:function(n,t){t===void 0&&(t={});r.fn.init.call(this,n);this.chartService=t;d(this.options.position,[ft,w,ht,y,ih])||(this.options.position=w);this.createContainer();this.createItems()},createContainer:function(){var n=this.options,i=n.position,t=n.align,u=i,r=h;i===ih?u=y:d(i,[ft,ht])?(u=t==="start"?y:t==="end"?w:h,r=i):t&&(t==="start"?r=ft:t==="end"&&(r=ht));this.container=new ci({margin:n.margin,padding:n.padding,background:n.background,border:n.border,vAlign:r,align:u,zIndex:n.zIndex,shrinkToFit:!0});this.append(this.container)},createItems:function(){var u=this.getService(),n=this.options,s=this.isVertical(),f=new uv({vertical:s,spacing:n.spacing,rtl:u.rtl},u),i=n.items,e,r,o;for(n.reverse&&(i=i.slice(0).reverse()),e=i.length,r=0;r<e;r++)o=i[r],f.append(new fv(t({},{markers:n.markers,labels:n.labels,rtl:u.rtl},n.item,o)));f.render();this.container.append(f)},isVertical:function(){var t=this.options,n=t.orientation,i=t.position;return i===ih&&n!==ev||(u(n)?n!==ev:d(i,[y,w]))},hasItems:function(){return this.container.children[0].children.length>0},reflow:function(n){var i=this.options,t=n.clone();if(!this.hasItems()){this.box=t;return}i.position===ih?(this.containerCustomReflow(t),this.box=t):this.containerReflow(t)},containerReflow:function(n){var s=this,i=s.options,r=s.container,u=i.position,h=i.width,c=i.height,f=u===ft||u===ht?a:l,v=this.isVertical(),o=n.clone(),t=n.clone(),e;(u===y||u===w)&&(t.y1=o.y1=0);v&&c?(t.y2=t.y1+c,t.align(o,l,r.options.vAlign)):!v&&h&&(t.x2=t.x1+h,t.align(o,a,r.options.align));r.reflow(t);t=r.box;e=t.clone();(i.offsetX||i.offsetY)&&(t.translate(i.offsetX,i.offsetY),this.container.reflow(t));e[f+1]=n[f+1];e[f+2]=n[f+2];this.box=e},containerCustomReflow:function(n){var u=this,i=u.options,r=u.container,f=i.offsetX,e=i.offsetY,s=i.width,h=i.height,c=this.isVertical(),t=n.clone();c&&h?t.y2=t.y1+h:!c&&s&&(t.x2=t.x1+s);r.reflow(t);t=r.box;r.reflow(new o(f,e,f+t.width(),e+t.height()))},renderVisual:function(){this.hasItems()&&r.fn.renderVisual.call(this)}});f(tl,{position:w,items:[],offsetX:0,offsetY:0,margin:bt(5),padding:bt(5),border:{color:su,width:0},item:{cursor:"pointer",spacing:6},spacing:6,background:"",zIndex:1,markers:{border:{width:0},width:15,height:3,type:"rect",align:y,vAlign:h}});dt=st.extend({init:function(){this._registry=[]},register:function(n,t){this._registry.push({type:n,seriesTypes:t})},create:function(n,t,i){for(var e,r=this._registry,o=r[0],u,f=0;f<r.length;f++)if(e=r[f],u=b(n,e.seriesTypes),u.length>0){o=e;break}return new o.type(u,t,i)}});dt.current=new dt;ov=3;sv=.1;rh=st.extend({init:function(n,i,r,u){var f=n.element;this.options=t({},this.options,r);this.chart=n;this.observer=u;this.chartElement=f;this.categoryAxis=i;this._dateAxis=this.categoryAxis instanceof lo;this.initOptions();this.options.visible&&(this.createElements(),this.set(this._index(this.options.from),this._index(this.options.to)),this.bindEvents())},createElements:function(){var i=this.options,n=this.wrapper=bi("k-selector"),t,r,u;et(n,{top:i.offset.top,left:i.offset.left,width:i.width,height:i.height,direction:"ltr"});t=this.selection=bi("k-selection");this.leftMask=bi("k-mask");this.rightMask=bi("k-mask");n.appendChild(this.leftMask);n.appendChild(this.rightMask);n.appendChild(t);t.appendChild(bi("k-selection-bg"));r=this.leftHandle=bi("k-handle k-left-handle");u=this.rightHandle=bi("k-handle k-right-handle");r.appendChild(bi());u.appendChild(bi());t.appendChild(r);t.appendChild(u);this.chartElement.appendChild(n);var f=et(t,["borderLeftWidth","borderRightWidth","height"]),e=et(r,"height").height,o=et(u,"height").height;i.selection={border:{left:f.borderLeftWidth,right:f.borderRightWidth}};et(r,{top:(f.height-e)/2});et(u,{top:(f.height-o)/2});n.style.cssText=n.style.cssText},bindEvents:function(){this._mousewheelHandler=this.options.mousewheel!==!1?this._mousewheel.bind(this):py;var n;df(this.wrapper,(n={},n[we]=this._mousewheelHandler,n));this._domEvents=yh.DomEventsBuilder.create(this.wrapper,{start:this._start.bind(this),move:this._move.bind(this),end:this._end.bind(this),tap:this._tap.bind(this),press:this._press.bind(this),gesturestart:this._gesturestart.bind(this),gesturechange:this._gesturechange.bind(this),gestureend:this._gestureend.bind(this)})},initOptions:function(){var u=this,n=u.options,s=u.categoryAxis,i=s.pane.chartsBox(),r=this.chart.chartService.intl;this._dateAxis&&t(n,{min:lr(r,n.min),max:lr(r,n.max),from:lr(r,n.from),to:lr(r,n.to)});var f=et(this.chartElement,["paddingLeft","paddingTop"]),e=f.paddingLeft,o=f.paddingTop;this.options=t({},{width:i.width(),height:i.height()+sv,padding:{left:e,top:o},offset:{left:i.x1+e,top:i.y1+o},from:n.min,to:n.max},n)},destroy:function(){if(this._domEvents&&(this._domEvents.destroy(),delete this._domEvents),clearTimeout(this._mwTimeout),this._state=null,this.wrapper){var n;gf(this.wrapper,(n={},n[we]=this._mousewheelHandler,n));this.chartElement.removeChild(this.wrapper)}},_rangeEventArgs:function(n){return{axis:this.categoryAxis.options,from:this._value(n.from),to:this._value(n.to)}},_start:function(n){var t=this.options,i=gi(n),r;!this._state&&i&&(this.chart._unsetActivePoint(),this._state={moveTarget:hv(i)||i,startLocation:n.x?n.x.location:0,range:{from:this._index(t.from),to:this._index(t.to)}},r=this._rangeEventArgs({from:this._index(t.from),to:this._index(t.to)}),this.trigger(is,r)&&(this._state=null))},_press:function(n){var t;t=this._state?this._state.moveTarget:hv(gi(n));t&&i.addClass(t,"k-handle-active")},_move:function(n){var c,l;if(this._state){var e=this,o=e._state,r=e.options,a=e.categoryAxis.options,t=o.range,u=o.moveTarget,i=a.reverse,v=this._index(r.from),w=this._index(r.to),s=this._index(r.min),f=this._index(r.max),b=o.startLocation-n.x.location,y={from:t.from,to:t.to},p=t.to-t.from,k=et(this.wrapper,"width").width/(a.categories.length-1),h=Math.round(b/k)*(i?-1:1);u&&(c=ao(u,"k-left-handle"),l=ao(u,"k-right-handle"),ao(u,"k-selection k-selection-bg")?(t.from=Math.min(Math.max(s,v-h),f-p),t.to=Math.min(t.from+p,f)):c&&!i||l&&i?(t.from=Math.min(Math.max(s,v-h),f-1),t.to=Math.max(t.from+1,t.to)):(c&&i||l&&!i)&&(t.to=Math.min(Math.max(s+1,w-h),f),t.from=Math.min(t.to-1,t.from)),(t.from!==y.from||t.to!==y.to)&&(this.move(t.from,t.to),this.trigger(rf,this._rangeEventArgs(t))))}},_end:function(){var t,n;this._state&&(t=this._state.moveTarget,t&&i.removeClass(t,"k-handle-active"),n=this._state.range,this.set(n.from,n.to),this.trigger(rs,this._rangeEventArgs(n)),delete this._state)},_tap:function(n){var o=this,i=o.options,r=o.categoryAxis,c=this.chart._eventCoordinates(n),l=r.pointCategoryIndex(new e(c.x,r.box.y1)),u=this._index(i.from),a=this._index(i.to),v=this._index(i.min),s=this._index(i.max),f=a-u,y=u+f/2,t={},p=n.event.which===3,h=Math.round(y-l);this._state||p||(this.chart._unsetActivePoint(),r.options.justified||h--,t.from=Math.min(Math.max(v,u-h),s-f),t.to=Math.min(t.from+f,s),this._start(n),this._state&&(this._state.range=t,this.trigger(rf,this._rangeEventArgs(t)),this._end()))},_mousewheel:function(n){var u=this,t=i.mousewheelDelta(n),r;this._start({target:this.selection});this._state&&(r=this._state.range,n.preventDefault(),n.stopPropagation(),Math.abs(t)>1&&(t*=ov),this.options.mousewheel.reverse&&(t*=-1),this.expand(t)&&this.trigger(rf,{axis:this.categoryAxis.options,delta:t,originalEvent:n,from:this._value(r.from),to:this._value(r.to)}),this._mwTimeout&&clearTimeout(this._mwTimeout),this._mwTimeout=setTimeout(function(){u._end()},us))},_gesturestart:function(n){var t=this.options,i;this._state={range:{from:this._index(t.from),to:this._index(t.to)}};i=this._rangeEventArgs(this._state.range);this.trigger(is,i)?this._state=null:n.preventDefault()},_gestureend:function(){this._state&&(this.trigger(rs,this._rangeEventArgs(this._state.range)),delete this._state)},_gesturechange:function(n){var i=this,r=i.chart,h=i._state,u=i.options,f=i.categoryAxis,t=h.range,o=r._toModelCoordinates(n.touches[0].x.location).x,s=r._toModelCoordinates(n.touches[1].x.location).x,c=Math.min(o,s),l=Math.max(o,s);n.preventDefault();t.from=f.pointCategoryIndex(new e(c))||u.min;t.to=f.pointCategoryIndex(new e(l))||u.max;this.move(t.from,t.to);this.trigger(rf,this._rangeEventArgs(t))},_index:function(n){var t=n;return n instanceof Date&&(t=this.categoryAxis.categoryIndex(n)),t},_value:function(n){var t=this.categoryAxis.options.categories,i=n;return this._dateAxis&&(i=n>t.length-1?this.options.max:t[Math.ceil(n)]),i},_slot:function(n){var i=this.categoryAxis,t=this._index(n);return i.getSlot(t,t,!0)},move:function(n,t){var i=this.options,f=this.categoryAxis.options.reverse,s=i.offset,h=i.padding,c=i.selection.border,a=f?t:n,v=f?n:t,l="x"+(f?2:1),e=this._slot(a),o=k(e[l]-s.left+h.left),r,u;et(this.leftMask,{width:o});et(this.selection,{left:o});e=this._slot(v);r=k(i.width-(e[l]-s.left+h.left));et(this.rightMask,{width:r});u=i.width-r;u!==i.width&&(u+=c.right);et(this.rightMask,{left:u});et(this.selection,{width:Math.max(i.width-(o+r)-c.right,0)})},set:function(n,t){var i=this.options,e=this._index(i.min),u=this._index(i.max),r=nr(this._index(n),e,u),f=nr(this._index(t),r+1,u);i.visible&&this.move(r,f);i.from=this._value(r);i.to=this._value(f)},expand:function(n){var r=this.options,e=this._index(r.min),u=this._index(r.max),o=r.mousewheel.zoom,s=this._index(r.from),f=this._index(r.to),i={from:s,to:f},h=t({},i);return this._state&&(i=this._state.range),o!==w&&(i.from=nr(nr(s-n,0,f-1),e,u)),o!==y&&(i.to=nr(nr(f+n,i.from+1,u),e,u)),i.from!==h.from||i.to!==h.to?(this.set(i.from,i.to),!0):void 0},trigger:function(n,t){return(this.observer||this.chart).trigger(n,t)}});f(rh,{visible:!0,mousewheel:{zoom:"both"},min:ut,max:it});il=pi.extend({show:function(n){if(n&&n.tooltipAnchor&&(!this._current||this._current!==n)){var r=t({},this.options,n.options.tooltip),i=n.tooltipAnchor();i?(this._current=n,pi.fn.show.call(this,{point:n,anchor:i},r,n)):this.hide()}},hide:function(){delete this._current;pi.fn.hide.call(this)}});uh=pi.extend({init:function(n,t){pi.fn.init.call(this,n.chartService,t);this.plotArea=n;this.formatService=n.chartService.format},showAt:function(n,t){var r=kf(n,function(n){var t=n.series.tooltip,i=t&&t.visible===!1;return!i});if(r.length>0){var i=r[0],u=this.plotArea.categoryAxis.getSlot(i.categoryIx),f=t?this._slotAnchor(t,u):this._defaultAnchor(i,u);this.show({anchor:f,shared:!0,points:n,category:i.category,categoryText:this.formatService.auto(this.options.categoryFormat,i.category),series:this.plotArea.series},this.options)}},_slotAnchor:function(n,t){var i=this.plotArea.categoryAxis;return i.options.vertical||(n.x=t.center().x),{point:n,align:{horizontal:"left",vertical:"center"}}},_defaultAnchor:function(n,t){var f=n.owner.pane.chartsBox(),o=this.plotArea.categoryAxis.options.vertical,i=f.center(),r=t.center(),u;return u=o?new e(i.x,r.y):new e(r.x,i.y),{point:u,align:{horizontal:"center",vertical:"center"}}}});f(uh,{categoryFormat:"{0:d}"});rl=ar.extend({setup:function(){var t=this,i=t.element,r=t.options,f=i.bbox(),u,n;f?(this.origin=r.origin,u=r.vertical?l:a,n=this.fromScale=new nt(1,1),n[u]=lu,i.transform(cu().scale(n.x,n.y))):this.abort()},step:function(n){var t=i.interpolateValue(this.fromScale.x,1,n),r=i.interpolateValue(this.fromScale.y,1,n);this.element.transform(cu().scale(t,r,this.origin))},abort:function(){ar.fn.abort.call(this);this.element.transform(null)}});f(rl,{duration:vt});ne.current.register(si,rl);ul=ar.extend({setup:function(){var n=this.center=this.element.bbox().center();this.element.transform(cu().scale(lu,lu,n))},step:function(n){this.element.transform(cu().scale(n,n,this.center))}});f(ul,{easing:"easeOutElastic"});ne.current.register(pr,ul);fl=ar.extend({setup:function(){this.fadeTo=this.element.opacity();this.element.opacity(0)},step:function(n){this.element.opacity(n*this.fadeTo)}});f(fl,{duration:200,easing:"linear"});ne.current.register(ai,fl);fh=ar.extend({setup:function(){this.element.transform(cu().scale(lu,lu,this.options.center))},step:function(n){this.element.transform(cu().scale(n,n,this.options.center))}});f(fh,{easing:"easeOutElastic",duration:vt});ne.current.register(ir,fh);io=yt.extend({render:function(){yt.fn.render.call(this);this.renderSegments()},createSegment:function(n,t,i){var u=t.style,r;return r=u===yr?ss:hi,new r(n,t,i)},animationPoints:function(){var n=yt.fn.animationPoints.call(this);return n.concat(this._segments)},createMissingValue:function(n,t){if(t===vi){var i={x:n.x,y:n.y};return at(i.x)||(i.x=0),at(i.y)||(i.y=0),i}}});t(io.prototype,ec);ro=ot.extend({initFields:function(){this.namedXAxes={};this.namedYAxes={};this.xAxisRangeTracker=new de;this.yAxisRangeTracker=new de},render:function(n){var t=this,e,u,i,f,r;for(n===void 0&&(n=this.panes),e=this.groupSeriesByPane(),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(b(r,go),i),t.createScatterLineChart(b(r,ns),i),t.createBubbleChart(b(r,pr),i));this.createAxes(n)},appendChart:function(n,t){this.xAxisRangeTracker.update(n.xAxisRanges);this.yAxisRangeTracker.update(n.yAxisRanges);ot.fn.appendChart.call(this,n,t)},removeAxis:function(n){var t=n.options.name;ot.fn.removeAxis.call(this,n);n.options.vertical?(this.yAxisRangeTracker.reset(t),delete this.namedYAxes[t]):(this.xAxisRangeTracker.reset(t),delete this.namedXAxes[t]);n===this.axisX&&delete this.axisX;n===this.axisY&&delete this.axisY},seriesPaneName:function(n){var t=this.options,i=n.xAxis,r=[].concat(t.xAxis),u=kf(r,function(n){return n.name===i})[0],f=n.yAxis,e=[].concat(t.yAxis),o=kf(e,function(n){return n.name===f})[0],s=t.panes||[{}],h=s[0].name||"default";return(u||{}).pane||(o||{}).pane||h},createScatterChart:function(n,t){n.length>0&&this.appendChart(new yt(this,{series:n,clip:t.options.clip}),t)},createScatterLineChart:function(n,t){n.length>0&&this.appendChart(new io(this,{series:n,clip:t.options.clip}),t)},createBubbleChart:function(n,t){n.length>0&&this.appendChart(new ps(this,{series:n,clip:t.options.clip}),t)},createXYAxis:function(n,r,u){for(var v,y,g,nt,c,tt,s,o=n.name,w=r?this.namedYAxes:this.namedXAxes,b=r?this.yAxisRangeTracker:this.xAxisRangeTracker,f=t({reverse:!r&&this.chartService.rtl},n,{vertical:r}),k=or(f.type,ye),h=b.query(),it=k?{min:.1,max:1}:{min:0,max:1},e=b.query(o)||h||it,l=[f.min,f.max],d=this.series,a=0;a<d.length;a++)if(v=d[a],y=v[r?"yAxis":"xAxis"],y===f.name||u===0&&!y){g=p.current.bindPoint(v,0).valueFields;l.push(g[r?"y":"x"]);break}for(u===0&&h&&(e.min=Math.min(e.min,h.min),e.max=Math.max(e.max,h.max)),c=0;c<l.length;c++)if(l[c]instanceof Date){nt=!0;break}if(tt=or(f.type,af)||!f.type&&nt?i.DateValueAxis:k?i.LogarithmicAxis:i.NumericAxis,s=new tt(e.min,e.max,f,this.chartService),s.axisIndex=u,o){if(w[o])throw new Error((r?"Y":"X")+" axis with name "+o+" is already defined");w[o]=s}return this.appendAxis(s),s},createAxes:function(n){for(var h,t,c,r=this,e=this.options,u=[].concat(e.xAxis),o=[],f=[].concat(e.yAxis),s=[],i=0;i<u.length;i++)h=r.findPane(u[i].pane),d(h,n)&&o.push(r.createXYAxis(u[i],!1,i));for(t=0;t<f.length;t++)c=r.findPane(f[t].pane),d(c,n)&&s.push(r.createXYAxis(f[t],!0,t));this.axisX=this.axisX||o[0];this.axisY=this.axisY||s[0]},_dispatchEvent:function(n,t,i){for(var o=n._eventCoordinates(t),l=new e(o.x,o.y),s=this.axes,a=s.length,r=[],u=[],f=0;f<a;f++){var h=s[f],v=h.options.vertical?u:r,c=h.getValue(l);c!==null&&v.push(c)}r.length>0&&u.length>0&&n.trigger(i,{element:gi(t),originalEvent:t,x:no(r),y:no(u)})},updateAxisOptions:function(n,t){var i=n.options.vertical,r=this.groupAxes(this.panes),u=(i?r.y:r.x).indexOf(n);cv(this.options,u,i,t);cv(this.originalOptions,u,i,t)}});f(ro,{xAxis:{},yAxis:{}});t(ro.prototype,sf);var cf=r.extend({init:function(n,t,i){r.fn.init.call(this,i);this.value=n;this.sector=t},render:function(){var n=this.options.labels,f=this.owner.chartService,i=this.value,r,e,u;this._rendered||this.visible===!1||(this._rendered=!0,r=ni(n),r?i=r({dataItem:this.dataItem,category:this.category,value:this.value,series:this.series,percentage:this.percentage}):n.format&&(i=f.format.auto(n.format,i)),n.visible&&(i||i===0)&&(n.position===h||n.position===pe?(n.color||(e=new tr(this.options.color).percBrightness(),n.color=e>180?su:lt),n.background||(n.background=this.options.color)):(u=f.theme.seriesDefaults.labels,n.color=n.color||u.color,n.background=n.background||u.background),this.label=new yf(i,t({},n,{align:h,vAlign:"",animation:{type:ai,delay:this.animationDelay}})),this.append(this.label)))},reflow:function(n){this.render();this.box=n;this.reflowLabel()},reflowLabel:function(){var c=this,u=c.options.labels,i=c.label,t=this.sector.clone(),l=u.distance,f=t.middle(),r,e,n,s;i&&(r=i.box.height(),e=i.box.width(),u.position===h?(t.radius=Math.abs((t.radius-r)/2)+r,n=t.point(f),i.reflow(new o(n.x,n.y-r/2,n.x,n.y))):u.position===pe?(t.radius=t.radius-r/2,n=t.point(f),i.reflow(new o(n.x,n.y-r/2,n.x,n.y))):(n=t.clone().expand(l).point(f),n.x>=t.center.x?(s=n.x+e,i.orientation=w):(s=n.x-e,i.orientation=y),i.reflow(new o(s,n.y-r,n.x,n.y))))},createVisual:function(){var e=this,f=this,n=f.sector,t=f.options,i,u;r.fn.createVisual.call(this);this.value&&(t.visual?(i=(n.startAngle+180)%360,u=t.visual({category:this.category,dataItem:this.dataItem,value:this.value,series:this.series,percentage:this.percentage,center:new nt(n.center.x,n.center.y),radius:n.radius,innerRadius:n.innerRadius,startAngle:i,endAngle:i+n.angle,options:t,sender:this.getSender(),createVisual:function(){var n=new vr;return e.createSegmentVisual(n),n}}),u&&this.visual.append(u)):this.createSegmentVisual(this.visual))},createSegmentVisual:function(n){var f=this,r=f.sector,i=f.options,u=i.border||{},h=u.width>0?{stroke:{color:u.color,width:u.width,opacity:u.opacity,dashType:u.dashType}}:{},e=i.color,o={color:e,opacity:i.opacity},s=this.createSegment(r,t({fill:o,stroke:{opacity:i.opacity},zIndex:i.zIndex},h));n.append(s);as(i)&&n.append(this.createGradientOverlay(s,{baseColor:e,fallbackFill:o},t({center:[r.center.x,r.center.y],innerRadius:r.innerRadius,radius:r.radius,userSpace:!0},i.overlay)))},createSegment:function(n,t){return t.singleSegment?new oi.Circle(new li.Circle(new nt(n.center.x,n.center.y),n.radius),t):i.ShapeBuilder.current.createRing(n,t)},createAnimation:function(){var n=this,u=n.options,i=n.sector.center;t(u,{animation:{center:[i.x,i.y],delay:this.animationDelay}});r.fn.createAnimation.call(this)},createHighlight:function(n){var i=this.options.highlight||{},r=i.border||{};return this.createSegment(this.sector,t({},n,{fill:{color:i.color,opacity:i.opacity},stroke:{opacity:r.opacity,width:r.width,color:r.color}}))},highlightVisual:function(){return this.visual.children[0]},highlightVisualArgs:function(){var n=this.sector;return{options:this.options,radius:n.radius,innerRadius:n.innerRadius,center:new nt(n.center.x,n.center.y),startAngle:n.startAngle,endAngle:n.angle+n.startAngle,visual:this.visual}},tooltipAnchor:function(){var n=this.sector.clone().expand(ti),t=n.middle(),i=n.point(t);return{point:i,align:ky(t+180)}},formatValue:function(n){return this.owner.formatPointValue(this,n)}}),wy=k(i.rad(30),eo),by=k(i.rad(60),eo);f(cf,{color:lt,overlay:{gradient:"roundedBevel"},border:{width:.5},labels:{visible:!1,distance:35,font:c.DEFAULT_FONT,margin:bt(.5),align:hr,zIndex:1,position:rr},animation:{type:ir},highlight:{visible:!0,border:{width:1}},visible:!0});t(cf.prototype,ri);var el={createLegendItem:function(n,t,i){var o=this.options.legend||{},s=o.labels||{},h=o.inactiveItems||{},u=h.labels||{},f,e;if(i&&i.visibleInLegend!==!1){var c=i.visible!==!1,l=c?ni(s):ni(u)||ni(s),r=i.category;l&&(r=l({text:r,series:i.series,dataItem:i.dataItem,percentage:i.percentage,value:n}));c?(f={},e=t.color):(f={color:u.color,font:u.font},e=(h.markers||{}).color);at(r)&&r!==""&&this.legendItems.push({pointIndex:i.index,text:r,series:i.series,markerColor:e,labels:f})}}},dy=70,lf=r.extend({init:function(n,t){r.fn.init.call(this,t);this.plotArea=n;this.chartService=n.chartService;this.points=[];this.legendItems=[];this.render()},render:function(){this.traverseDataPoints(this.addValue.bind(this))},traverseDataPoints:function(n){var p=this,w=this,b=w.options,s=w.plotArea.options.seriesColors,r,l,f,e;s===void 0&&(s=[]);var ft=s.length,k=b.series,c=k.length;for(r=0;r<c;r++){var t=k[r],d=t.data,a=cc(t),v=a.total,g=a.points,et=a.count,nt=360/v,tt=void 0;for(isFinite(nt)||(tt=360/et),l=void 0,l=u(t.startAngle)?t.startAngle:b.startAngle,r!==c-1&&t.labels.position===rr&&(t.labels.position=h),f=0;f<g.length;f++)if(e=g[f],e){var o=e.fields,y=e.value,it=e.visible,ut=y!==0?tt||y*nt:0,ot=d.length!==1&&Boolean(o.explode);rt(t.color)||(t.color=o.color||s[f%ft]);n(e.valueFields.value,new i.Ring(null,0,0,l,ut),{owner:p,category:u(o.category)?o.category:"",index:f,series:t,seriesIx:r,dataItem:d[f],percentage:v!==0?y/v:0,explode:ot,visibleInLegend:o.visibleInLegend,visible:it,zIndex:c-r,animationDelay:p.animationDelay(f,r,c)});it!==!1&&(l+=ut)}}},evalSegmentOptions:function(n,t,i){var r=i.series;ur(n,{value:t,series:r,dataItem:i.dataItem,category:i.category,percentage:i.percentage},{defaults:r._defaults,excluded:["data","content","template","visual","toggle"]})},addValue:function(i,r,u){var e=t({},u.series,{index:u.index}),f;(this.evalSegmentOptions(e,i,u),this.createLegendItem(i,e,u),u.visible!==!1)&&(f=new cf(i,r,e),n.extend(f,u),this.append(f),this.points.push(f))},reflow:function(n){var p=this,nt=p.options,tt=p.points,c=p.seriesConfigs,v,et,y,d,f;c===void 0&&(c=[]);var ot=tt.length,i=n.clone(),it=5,s=Math.min(i.width(),i.height()),b=s/2,st=s-s*.85,r=new o(i.x1,i.y1,i.x1+s,i.y1+s),rt=r.center(),ut=i.center(),ft=nt.series.length,l=[],a=[],u=g(nt.padding,st);for(u=u>b-it?b-it:u,r.translate(ut.x-rt.x,ut.y-rt.y),v=b-u,et=new e(v+r.x1+u,v+r.y1+u),y=0;y<ot;y++){var h=tt[y],t=h.sector,k=h.seriesIx;t.radius=v;t.center=et;c.length&&(d=c[k],t.innerRadius=d.innerRadius,t.radius=d.radius);k===ft-1&&h.explode&&(t.center=t.clone().setRadius(t.radius*.15).point(t.middle()));h.reflow(r);f=h.label;f&&f.options.position===rr&&k===ft-1&&(f.orientation===w?a.push(f):l.push(f))}l.length>0&&(l.sort(this.labelComparator(!0)),this.leftLabelsReflow(l));a.length>0&&(a.sort(this.labelComparator(!1)),this.rightLabelsReflow(a));this.box=r},leftLabelsReflow:function(n){var t=this.distanceBetweenLabels(n);this.distributeLabels(t,n)},rightLabelsReflow:function(n){var t=this.distanceBetweenLabels(n);this.distributeLabels(t,n)},distanceBetweenLabels:function(n){var o=di(this.points),f=o.sector,e=n.length-1,s=f.radius+o.options.labels.distance,u=[],t=n[0].box,i=k(t.y1-(f.center.y-s-t.height()-t.height()/2)),r,h;for(u.push(i),r=0;r<e;r++)h=n[r+1].box,t=n[r].box,i=k(h.y1-t.y2),u.push(i);return i=k(f.center.y+s-n[e].box.y2-n[e].box.height()/2),u.push(i),u},distributeLabels:function(n,t){for(var e=this,o=n.length,u,f,i,r=0;r<o;r++)for(i=-n[r],u=f=r;i>0&&(u>=0||f<o);)i=e._takeDistance(n,r,--u,i),i=e._takeDistance(n,r,++f,i);this.reflowLabels(n,t)},_takeDistance:function(n,t,i,r){var f=r,u;return n[i]>0&&(u=Math.min(n[i],f),f-=u,n[i]-=u,n[t]+=u),f},reflowLabels:function(n,t){var a=this,l=di(this.points),r=l.sector,c=l.options.labels,v=t.length,h=c.distance,i=r.center.y-(r.radius+h)-t[0].box.height(),u,s,f,e;for(n[0]+=2,s=0;s<v;s++)f=t[s],e=f.box,i+=n[s],u=a.hAlignLabel(e.x2,r.clone().expand(h),i,i+e.height(),f.orientation===w),f.orientation===w?(c.align!==hr&&(u=r.radius+r.center.x+h),f.reflow(new o(u+e.width(),i,u,i))):(c.align!==hr&&(u=r.center.x-r.radius-h),f.reflow(new o(u-e.width(),i,u,i))),i+=e.height()},createVisual:function(){var y=this,k=this,a=k.options.connectors,d=k.points,tt=d.length,s=4,p,t;for(r.fn.createVisual.call(this),this._connectorLines=[],p=0;p<tt;p++){var c=d[p],i=c.sector,b=c.label,g=i.middle(),it=(c.options.connectors||{}).color||a.color;if(b&&(t=new v({stroke:{color:it,width:a.width},animation:{type:ai,delay:c.animationDelay}}),b.options.position===rr)){var l=b.box,nt=i.center,f=i.point(g),o=new e(l.x1,l.center().y),h=void 0,u=void 0,n=void 0;f=i.clone().expand(a.padding).point(g);t.moveTo(f.x,f.y);b.orientation===w?(u=new e(l.x1-a.padding,l.center().y),n=lv(nt,f,o,u),o=new e(u.x-s,u.y),n=n||o,n.x=Math.min(n.x,o.x),y.pointInCircle(n,i.center,i.radius+s)||n.x<i.center.x?(h=i.center.x+i.radius+s,c.options.labels.align!==yi?h<o.x?t.lineTo(h,f.y):t.lineTo(f.x+s*2,f.y):t.lineTo(h,f.y),t.lineTo(o.x,u.y)):(n.y=u.y,t.lineTo(n.x,n.y))):(u=new e(l.x2+a.padding,l.center().y),n=lv(nt,f,o,u),o=new e(u.x+s,u.y),n=n||o,n.x=Math.max(n.x,o.x),y.pointInCircle(n,i.center,i.radius+s)||n.x>i.center.x?(h=i.center.x-i.radius-s,c.options.labels.align!==yi?h>o.x?t.lineTo(h,f.y):t.lineTo(f.x-s*2,f.y):t.lineTo(h,f.y),t.lineTo(o.x,u.y)):(n.y=u.y,t.lineTo(n.x,n.y)));t.lineTo(u.x,u.y);y._connectorLines.push(t);y.visual.append(t)}}},labelComparator:function(n){var t=n?-1:1;return function(n,i){var r=(n.parent.sector.middle()+270)%360,u=(i.parent.sector.middle()+270)%360;return(r-u)*t}},hAlignLabel:function(n,t,i,r,u){var f=t.radius,o=t.center,h=o.x,s=o.y,e=Math.min(Math.abs(s-i),Math.abs(s-r));return e>f?n:h+Math.sqrt(f*f-e*e)*(u?1:-1)},pointInCircle:function(n,t,i){return Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2)<Math.pow(i,2)},formatPointValue:function(n,t){return this.chartService.format.auto(t,n.value)},animationDelay:function(n){return n*dy}});f(lf,{startAngle:90,connectors:{width:2,color:"#939393",padding:8},inactiveItems:{markers:{},labels:{}}});t(lf.prototype,el);eh=ot.extend({render:function(){this.createPieChart(this.series)},createPieChart:function(n){var t=n[0],i=new lf(this,{series:n,padding:t.padding,startAngle:t.startAngle,connectors:t.connectors,legend:this.options.legend});this.appendChart(i)},appendChart:function(n,t){ot.fn.appendChart.call(this,n,t);wf(this.options.legend.items,n.legendItems)}});eu=cf.extend({reflowLabel:function(){var r=this,f=r.options.labels,i=r.label,n=this.sector.clone(),e=n.middle(),u,t;i&&(u=i.box.height(),f.position===h?(n.radius-=(n.radius-n.innerRadius)/2,t=n.point(e),i.reflow(new o(t.x,t.y-u/2,t.x,t.y))):cf.fn.reflowLabel.call(this))},createSegment:function(n,t){return i.ShapeBuilder.current.createRing(n,t)}});f(eu,{overlay:{gradient:"roundedGlass"},labels:{position:h},animation:{type:ir}});t(eu.prototype,ri);av=50;oh=lf.extend({addValue:function(i,r,u){var e=t({},u.series,{index:u.index}),f;(this.evalSegmentOptions(e,i,u),this.createLegendItem(i,e,u),i&&u.visible!==!1)&&(f=new eu(i,r,e),n.extend(f,u),this.append(f),this.points.push(f))},reflow:function(n){var it=this,b=this.options,k=n.clone(),d=5,l=Math.min(k.width(),k.height()),s=l/2,rt=l-l*.85,a=b.series,h=a.length,f=g(b.padding,rt),i,v,e,r,t,nt,o,y,tt,p,c,w;for(f=f>s-d?s-d:f,i=s-f,v=0,r=0;r<h;r++)t=a[r],r===0&&u(t.holeSize)&&(e=t.holeSize,i-=t.holeSize),u(t.size)?i-=t.size:v++,u(t.margin)&&r!==h-1&&(i-=t.margin);for(u(e)||(nt=(s-f)/(h+.75),e=nt*.75,i-=e),o=e,y=0,this.seriesConfigs=[],c=0;c<h;c++)w=a[c],tt=g(w.size,i/v),o+=y,p=o+tt,it.seriesConfigs.push({innerRadius:o,radius:p}),y=w.margin||0,o=p;lf.fn.reflow.call(this,n)},animationDelay:function(n,t,i){return n*av+vt*(t+1)/(i+1)}});f(oh,{startAngle:90,connectors:{width:2,color:"#939393",padding:8}});var vv=eh.extend({render:function(){this.createDonutChart(this.series)},createDonutChart:function(n){var t=n[0],i=new oh(this,{series:n,padding:t.padding,connectors:t.connectors,legend:this.options.legend});this.appendChart(i)}}),gy=.15,ol=ot.extend({initFields:function(){this.valueAxisRangeTracker=new de},render:function(){this.addToLegend(this.series);this.createPolarAxis();this.createCharts();this.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).center,f=n.box.translate(r.x-i.x1,r.y-i.y1);n.reflow(f)},createValueAxis:function(){var e=this.valueAxisRangeTracker,t=e.query(),o=this.valueAxisOptions({roundToMajorUnit:!1,zIndex:-1}),r,u,n,f;o.type===ye?(r=i.RadarLogarithmicAxis,u={min:.1,max:1}):(r=i.RadarNumericAxis,u={min:0,max:1});n=e.query(name)||t||u;n&&t&&(n.min=Math.min(n.min,t.min),n.max=Math.max(n.max,t.max));f=new r(n.min,n.max,o,this.chartService);this.valueAxis=f;this.appendAxis(f)},reflowAxes:function(){var i=this,o=i.options.plotArea,t=i.valueAxis,s=i.polarAxis,r=i.box,c=Math.min(r.width(),r.height())*gy,a=bt(o.padding||{},c),u=r.clone().unpad(a),n=u.clone(),f,e;n.y2=n.y1+Math.min(n.width(),n.height());n.align(u,l,h);f=n.clone().shrink(0,n.height()/2);s.reflow(n);t.reflow(f);e=t.lineBox().height()-t.box.height();t.reflow(t.box.unpad({top:e}));this.axisBox=n;this.alignAxes(n)},backgroundBox:function(){return this.box}}),sl=yt.extend({pointSlot:function(n,t){var r=n.center.y-t.y1,i=e.onCircle(n.center,n.startAngle,r);return new o(i.x,i.y,i.x,i.y)}});f(sl,{clip:!1});uo=io.extend({});uo.prototype.pointSlot=sl.prototype.pointSlot;f(uo,{clip:!1});var np=cs.extend({fillToAxes:function(n){var t=this._polarAxisCenter();n.lineTo(t.x,t.y)},_polarAxisCenter:function(){var n=this.parent.plotArea.polarAxis;return n.box.center()},strokeSegments:function(){var n=this._strokeSegments;if(!n){var i=this._polarAxisCenter(),r=new ho(!1),t=this.points();t.push(i);n=this._strokeSegments=r.process(t);n.pop()}return n}}),tp=fr.extend({fillToAxes:function(n){var r=this.parent.plotArea.polarAxis,t=r.box.center(),i=new li.Segment([t.x,t.y]);n.segments.unshift(i);n.segments.push(i)}}),ip=uo.extend({createSegment:function(n,t,i){var r=(t.line||{}).style;return r===yr?new np(n,t,i):new tp(n,t,i)},createMissingValue:function(n,t){var i;return at(n.x)&&t!==yo&&(i={x:n.x,y:n.y},t===vi&&(i.y=0)),i},seriesMissingValues:function(n){return n.missingValues||vi},_hasMissingValuesGap:function(){for(var i=this,t=this.options.series,n=0;n<t.length;n++)if(i.seriesMissingValues(t[n])===dh)return!0},sortPoints:function(n){var u=this,t,i,r;if(n.sort(rp),this._hasMissingValuesGap())for(t=0;t<n.length;t++)i=n[t],i&&(r=i.value,at(r.y)||u.seriesMissingValues(i.series)!==dh||delete n[t]);return n}});sh=ol.extend({createPolarAxis:function(){var n=new i.PolarAxis(this.options.xAxis,this.chartService);this.polarAxis=n;this.axisX=n;this.appendAxis(n)},valueAxisOptions:function(n){return t(n,{majorGridLines:{type:oo},minorGridLines:{type:oo}},this.options.yAxis)},createValueAxis:function(){ol.fn.createValueAxis.call(this);this.axisY=this.valueAxis},appendChart:function(n,t){this.valueAxisRangeTracker.update(n.yAxisRanges);ot.prototype.appendChart.call(this,n,t)},createCharts:function(){var n=this.filterVisibleSeries(this.series),t=this.panes[0];this.createLineChart(b(n,[bo]),t);this.createScatterChart(b(n,[ko]),t);this.createAreaChart(b(n,[wo]),t)},createLineChart:function(n,t){if(n.length!==0){var i=new uo(this,{series:n});this.appendChart(i,t)}},createScatterChart:function(n,t){if(n.length!==0){var i=new sl(this,{series:n});this.appendChart(i,t)}},createAreaChart:function(n,t){if(n.length!==0){var i=new ip(this,{series:n});this.appendChart(i,t)}},_dispatchEvent:function(n,t,i){var r=n._eventCoordinates(t),u=new e(r.x,r.y),f=this.axisX.getValue(u),o=this.axisY.getValue(u);f!==null&&o!==null&&n.trigger(i,{element:gi(t),x:f,y:o})},createCrosshairs:function(){}});f(sh,{xAxis:{},yAxis:{}});t(sh.prototype,sf);hh=ru.extend({pointSlot:function(n,t){var r=n.center.y-t.y1,i=e.onCircle(n.center,n.middle(),r);return new o(i.x,i.y,i.x,i.y)},createSegment:function(n,t,i){var f=t.style,u,r;return u=f===yr?ss:hi,r=new u(n,t,i),n.length===t.data.length&&(r.options.closed=!0),r}});f(hh,{clip:!1,limitPoints:!1});var up=cs.extend({fillToAxes:function(){}}),fp=fr.extend({fillToAxes:function(){}}),ep=hh.extend({createSegment:function(n,t,i,r){var o=this.options.isStacked,s=(t.line||{}).style,f,e,u;return o&&i>0&&r&&(e=r.linePoints.slice(0),f=r),s===yr?(u=new up(n,t,i,f,e),u.options.closed=!0):(n.push(n[0]),u=new fp(n,t,i,f,e)),u},seriesMissingValues:function(n){return n.missingValues||vi}}),yv=eu.extend({init:function(n,t){eu.fn.init.call(this,n,null,t)}});f(yv,{overlay:{gradient:"none"},labels:{distance:10}});hl=r.extend({init:function(n){r.fn.init.call(this,n);this.forEach=n.rtl?ca:ha},reflow:function(n){var i=this,r=i.options,u=i.children,f=r.gap,e=r.spacing,o=u.length,h=o+f+e*(o-1),t=n.angle/h,s=n.startAngle+t*(f/2);this.forEach(u,function(i){var r=n.clone();r.startAngle=s;r.angle=t;i.sector&&(r.radius=i.sector.radius);i.reflow(r);i.sector=r;s+=t+t*e})}});f(hl,{gap:1,spacing:0});pv=r.extend({reflow:function(n){var r=this,u=r.options.reverse,f=r.children,e=f.length,s=u?e-1:0,h=u?-1:1,t,i;for(this.box=new o,t=s;t>=0&&t<e;t+=h)i=f[t].sector,i.startAngle=n.startAngle,i.angle=n.angle}});ch=ui.extend({pointType:function(){return yv},clusterType:function(){return hl},stackType:function(){return pv},categorySlot:function(n,t){return n.getSlot(t)},pointSlot:function(n,t){var i=n.clone(),r=n.center.y;return i.radius=r-t.y1,i.innerRadius=r-t.y2,i},reflowPoint:function(n,t){n.sector=t;n.reflow()},createAnimation:function(){this.options.animation.center=this.box.toRect().center();ui.fn.createAnimation.call(this)}});ch.prototype.reflow=tt.prototype.reflow;f(ch,{clip:!1,limitPoints:!1,animation:{type:"pie"}});lh=ol.extend({createPolarAxis:function(){var n=new i.RadarCategoryAxis(this.options.categoryAxis,this.chartService);this.polarAxis=n;this.categoryAxis=n;this.appendAxis(n);this.aggregateCategories();this.createCategoryAxesLabels()},valueAxisOptions:function(n){return this._hasBarCharts&&t(n,{majorGridLines:{type:oo},minorGridLines:{type:oo}}),this._isStacked100&&t(n,{roundToMajorUnit:!1,labels:{format:"P0"}}),t(n,this.options.valueAxis)},aggregateCategories:function(){wi.prototype.aggregateCategories.call(this,this.panes)},createCategoryAxesLabels:function(){wi.prototype.createCategoryAxesLabels.call(this,this.panes)},filterSeries:function(n){return n},createCharts:function(){var n=this.filterVisibleSeries(this.series),t=this.panes[0];this.createAreaChart(b(n,[se]),t);this.createLineChart(b(n,[ce]),t);this.createBarChart(b(n,[he]),t)},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 ep(this,this.chartOptions(n));this.appendChart(i,t)}},createLineChart:function(n,t){if(n.length!==0){var i=new hh(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 ch(this,i),this.appendChart(u,t),this._hasBarCharts=!0)},seriesCategoryAxis:function(){return this.categoryAxis},_dispatchEvent:function(n,t,i){var r=n._eventCoordinates(t),u=new e(r.x,r.y),f=this.categoryAxis.getCategory(u),o=this.valueAxis.getValue(u);f!==null&&o!==null&&n.trigger(i,{element:gi(t),category:f,value:o})},createCrosshairs:function(){}});t(lh.prototype,sf,{appendChart:wi.prototype.appendChart,aggregateSeries:wi.prototype.aggregateSeries});f(lh,{categoryAxis:{categories:[]},valueAxis:{}});ah=r.extend({init:function(n,t,i){r.fn.init.call(this,t);this.value=n;this.options.index=i.index},reflow:function(n){var t=this.points,i=this.children[0];this.box=new o(t[0].x,t[0].y,t[1].x,t[2].y);i&&i.reflow(new o(n.x1,t[0].y,n.x2,t[2].y))},createVisual:function(){var i=this,n=this.options,t;r.fn.createVisual.call(this);t=n.visual?n.visual({category:this.category,dataItem:this.dataItem,value:this.value,series:this.series,percentage:this.percentage,points:this.points,options:n,sender:this.getSender(),createVisual:function(){return i.createPath()}}):this.createPath();t&&this.visual.append(t)},createPath:function(){var n=this.options,t=n.border;return v.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 v.fromPoints(this.points,n)},highlightVisual:function(){return this.visual.children[0]},highlightVisualArgs:function(){var n=v.fromPoints(this.points).close();return{options:this.options,path:n}},tooltipAnchor:function(){var n=this.box;return{point:new e(n.center().x,n.y1),align:{horizontal:"center",vertical:"top"}}},formatValue:function(n){var t=this;return t.owner.formatPointValue(t,n)}});f(ah,{color:lt,border:{width:1}});t(ah.prototype,ri);vh=r.extend({init:function(n,t){r.fn.init.call(this,t);this.plotArea=n;this.points=[];this.labels=[];this.legendItems=[];this.render()},formatPointValue:function(n,t){return this.chartService.format.auto(t,n.value)},render:function(){var e=this,s=this,y=s.options,f=s.plotArea.options.seriesColors,i,o,n,r,u;if(f===void 0&&(f=[]),i=y.series[0],o=i.data,o){var h=cc(i),p=h.total,c=h.points;for(n=0;n<c.length;n++)if(r=c[n],r){u=r.fields;rt(i.color)||(i.color=u.color||f[n%f.length]);u=t({index:n,owner:e,series:i,dataItem:o[n],percentage:r.value/p},u,{visible:r.visible});var l=r.valueFields.value,a=e.createSegment(l,u),v=e.createLabel(l,u);a&&v&&a.append(v)}}},evalSegmentOptions:function(n,t,i){var r=i.series;ur(n,{value:t,series:r,dataItem:i.dataItem,index:i.index},{defaults:r._defaults,excluded:["data","content","template","toggle","visual"]})},createSegment:function(i,r){var f=t({},r.series),u;return this.evalSegmentOptions(f,i,r),this.createLegendItem(i,f,r),r.visible!==!1?(u=new ah(i,f,r),n.extend(u,r),this.append(u),this.points.push(u),u):void 0},createLabel:function(n,i){var u=i.series,h=i.dataItem,r=t({},this.options.labels,u.labels),f=n,e,s,o;if(r.visible)return e=ni(r),e?f=e({dataItem:h,value:n,percentage:i.percentage,category:i.category,series:u}):r.format&&(f=this.plotArea.chartService.format.auto(r.format,f)),r.color||(s=new tr(u.color).percBrightness(),r.color=s>180?su:lt,r.background||(r.background=u.color)),this.evalSegmentOptions(r,n,i),o=new yf(f,t({vAlign:r.position},r)),this.labels.push(o),o},labelPadding:function(){for(var f,r,u,i=this.labels,n={left:0,right:0},t=0;t<i.length;t++)f=i[t],r=f.options.align,r!==h&&(u=i[t].box.width(),r===y?n.left=Math.max(n.left,u):n.right=Math.max(n.right,u));return n},dynamicSlopeReflow:function(n,t,i){for(var f,y=this,p=y.options,r=y.points,w=r.length,b=r[0],c=b,o=0;o<r.length;o++)r[o].percentage>c.percentage&&(c=r[o]);var l=b.percentage/c.percentage*t,a=(t-l)/2,e=0;for(f=0;f<w;f++){var s=r[f].percentage,k=r[f+1],d=k?k.percentage:s,h=r[f].points=[],v=p.dynamicHeight?i*s:i/w,u=void 0;u=s?(t-l*(d/s))/2:d?0:t/2;u=nr(u,0,t);h.push(new nt(n.x1+a,n.y1+e));h.push(new nt(n.x1+t-a,n.y1+e));h.push(new nt(n.x1+t-u,n.y1+v+e));h.push(new nt(n.x1+u,n.y1+v+e));a=u;e+=v+p.segmentSpacing;l=nr(t-2*u,0,t)}},constantSlopeReflow:function(n,t,i){for(var v=this,r=v.options,s=v.points,h=s.length,c=r.neckRatio<=1,w=c?r.neckRatio*t:t,u=c?0:(t-t/r.neckRatio)/2,b=c?t:t-u*2,y=(b-w)/2,f=0,e=0;e<h;e++){var o=s[e].points=[],p=s[e].percentage,l=r.dynamicHeight?y*p:y/h,a=r.dynamicHeight?i*p:i/h;o.push(new nt(n.x1+u,n.y1+f));o.push(new nt(n.x1+t-u,n.y1+f));o.push(new nt(n.x1+t-u-l,n.y1+a+f));o.push(new nt(n.x1+u+l,n.y1+a+f));u+=l;f+=a+r.segmentSpacing}},reflow:function(n){var u=this.points,r=u.length,i;if(r){var f=this.options,t=n.clone().unpad(this.labelPadding()),e=t.height()-f.segmentSpacing*(r-1),o=t.width();for(f.dynamicSlope?this.dynamicSlopeReflow(t,o,e):this.constantSlopeReflow(t,o,e),i=0;i<r;i++)u[i].reflow(n)}}});f(vh,{neckRatio:.3,width:300,dynamicSlope:!1,dynamicHeight:!0,segmentSpacing:0,labels:{visible:!1,align:h,position:h,zIndex:1}});t(vh.prototype,el);var op=ot.extend({render:function(){this.createFunnelChart(this.series)},createFunnelChart:function(n){var t=n[0],i=new vh(this,{series:n,legend:this.options.legend,neckRatio:t.neckRatio,dynamicHeight:t.dynamicHeight,dynamicSlope:t.dynamicSlope,segmentSpacing:t.segmentSpacing,highlight:t.highlight});this.appendChart(i)},appendChart:function(n,t){ot.fn.appendChart.call(this,n,t);wf(this.options.legend.items,n.legendItems)}}),gt="color",pt="first",ct="max",cl="min",sr="noteText";dt.current.register(wi,[si,yi,pu,tu,vu,gr,br,wu,wr,le,yu,nu,ku,dr,du,kr,bu,iu]);dt.current.register(ro,[go,ns,pr]);dt.current.register(eh,[ir]);dt.current.register(vv,[ee]);dt.current.register(op,[oe]);dt.current.register(sh,[wo,bo,ko]);dt.current.register(lh,[se,he,ce]);p.current.register([si,yi,pu,tu,vu,gr],[wt],[ii,gt,sr,bh,kh]);p.current.register([ku,dr,bu,iu],["from","to"],[ii,gt,sr]);p.current.register([du,kr],[wt],[ii,gt,sr,"summary"]);p.current.register([wo,bo,ko],[a,l],[gt]);p.current.register([se,he,ce],[wt],[gt]);p.current.register([oe],[wt],[ii,gt,"visibleInLegend","visible"]);ei.current.register([si,yi,pu,tu,vu,gr,du,kr],{value:ct,color:pt,noteText:pt,errorLow:cl,errorHigh:ct});ei.current.register([ku,dr,bu,iu],{from:cl,to:ct,color:pt,noteText:pt});ei.current.register([se,he,ce],{value:ct,color:pt});p.current.register([go,ns,pr],[a,l],[gt,sr,pl,wl,bl,kl]);p.current.register([pr],[a,l,"size"],[gt,ii,sr]);p.current.register([br,wu],["open","high","low","close"],[ii,gt,"downColor",sr]);ei.current.register([br,wu],{open:ct,high:ct,low:cl,close:ct,color:pt,downColor:pt,noteText:pt});p.current.register([yu,nu],["lower","q1","median","q3","upper","mean","outliers"],[ii,gt,sr]);ei.current.register([yu,nu],{lower:ct,q1:ct,median:ct,q3:ct,upper:ct,mean:ct,outliers:pt,color:pt,noteText:pt});p.current.register([wr,le],["current","target"],[ii,gt,"visibleInLegend",sr]);ei.current.register([wr,le],{current:ct,target:ct,color:pt,noteText:pt});p.current.register([ir,ee],[wt],[ii,gt,"explode","visibleInLegend","visible"]);var ll=[ii,wt,a,l],ou="mousemove",wv="contextmenu",sp=20,bv=st.extend({init:function(n,r,u,f){var e=this,o;f===void 0&&(f={});this.observers=[];this.addObserver(f.observer);this.chartService=new yh.ChartService(this,f);this.chartService.theme=u;this._initElement(n);o=t({},this.options,r);this._originalOptions=t({},o);this._theme=u;this._initTheme(o,u);this._initSurface();this._initHandlers();this.bindCategories();i.FontLoader.preloadFonts(r,function(){e._destroyed||(e.trigger("init"),e._redraw(),e._attachEvents())})},_initElement:function(n){for(this._setElementClass(n),n.style.position="relative";n.firstChild;)n.removeChild(n.firstChild);this.element=n},_setElementClass:function(n){i.addClass(n,"k-chart")},_initTheme:function(i,r){for(var f=[],e=i.series||[],u=0;u<e.length;u++)f.push(n.extend({},e[u]));i.series=f;hp(i);this.applyDefaults(i,r);i.seriesColors===null&&delete i.seriesColors;this.options=t({},r,i);this.applySeriesColors()},getSize:function(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}},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))},_resize:function(){this._noTransitionsRedraw()},redraw:function(n){if(this.applyDefaults(this.options),this.applySeriesColors(),n){var t=this._model._plotArea,i=t.findPane(n);t.redraw(i)}else this._redraw()},getAxis:function(n){for(var i=this._plotArea.axes,t=0;t<i.length;t++)if(i[t].options.name===n)return new vl(i[t])},findAxisByName:function(n){return this.getAxis(n)},findPaneByName:function(n){for(var i=this._plotArea.panes,t=0;t<i.length;t++)if(i[t].options.name===n)return new ph(i[t])},findPaneByIndex:function(n){var t=this._plotArea.panes;if(t[n])return new ph(t[n])},plotArea:function(){return new yl(this._plotArea)},toggleHighlight:function(n,t){var i=this._plotArea,e=(i.srcSeries||i.series||[])[0],r,u,f;rt(t)?r=i.filterPoints(t):(ki(t)?(u=t.series,f=t.category):u=f=t,r=e.type===ee?kv(i.pointsBySeriesName(u),f):e.type===ir||e.type===oe?kv((i.charts[0]||{}).points,f):i.pointsBySeriesName(u));r&&this.togglePointsHighlight(n,r)},togglePointsHighlight:function(n,t){for(var r=this._highlight,i=0;i<t.length;i++)r.togglePointHighlight(t[i],n)},showTooltip:function(n){var r=this._sharedTooltip(),f=this,e=f._tooltip,o=f._plotArea,t,i,s;rt(n)?(t=o.findPoint(n),t&&r&&(i=t.categoryIx)):r&&u(n)&&(i=o.categoryAxis.categoryIndex(n));r?i>=0&&(s=this._plotArea.pointsByCategoryIndex(i),e.showAt(s)):t&&e.show(t)},hideTooltip:function(){this._tooltip.hide()},_initSurface:function(){var n=this.surface,r=this._surfaceWrap(),t=this.options.chartArea;t.width&&i.elementSize(r,{width:t.width});t.height&&i.elementSize(r,{height:t.height});n&&n.options.type===this.options.renderAs?(this.surface.clear(),this.surface.resize()):(n&&n.destroy(),this.surface=oi.Surface.create(r,{type:this.options.renderAs}))},_surfaceWrap:function(){return this.element},_redraw:function(){var n=this._getModel();this._destroyView();this._model=n;this._plotArea=n._plotArea;n.renderVisual();this.options.transitions!==!1&&n.traverse(function(n){n.animation&&n.animation.setup()});this._initSurface();this.surface.draw(n.visual);this.options.transitions!==!1&&n.traverse(function(n){n.animation&&n.animation.play()});this._tooltip=this._createTooltip();this._highlight=new gc;this._setupSelection();this._createPannable();this._createZoomSelection();this._createMousewheelZoom();this.trigger(ra);this._navState||this._cancelDomEvents()},exportVisual:function(n){var i,f,r,u;return n&&(n.width||n.height||n.options)?(f=this.options,r=t({},n.options,{chartArea:{width:n.width,height:n.height}}),al(this._originalOptions,r),this.options=t({},this._originalOptions,r),this._initTheme(this.options,this._theme),this.bindCategories(),u=this._getModel(),u.renderVisual(),i=u.visual,this.options=f):i=this.surface.exportVisual(),i},_sharedTooltip:function(){return this._plotArea instanceof wi&&this.options.tooltip.shared},_createPannable:function(){var n=this.options;n.pannable!==!1&&(this._pannable=new nh(this._plotArea,n.pannable))},_createZoomSelection:function(){var n=this.options.zoomable,t=(n||{}).selection;n!==!1&&t!==!1&&(this._zoomSelection=new th(this,t))},_toggleDomDrag:function(){if(this.domEvents&&this.domEvents.toggleDrag){var t=this.options.pannable,n=this.options.zoomable,i=(n||{}).selection;t||n!==!1&&i!==!1||this.requiresHandlers([ts,ae,ve])?this.domEvents.toggleDrag(!0):this.domEvents.toggleDrag(!1)}},_createMousewheelZoom:function(){var n=this.options.zoomable,t=(n||{}).mousewheel;n!==!1&&t!==!1&&(this._mousewheelZoom=new rv(this,t))},_toggleDomZoom:function(){if(this.domEvents&&this.domEvents.toggleZoom){var n=this.options.zoomable,t=(n||{}).mousewheel;n!==!1&&t!==!1||this.requiresHandlers([gu,nf,tf])?this.domEvents.toggleZoom(!0):this.domEvents.toggleZoom(!1)}},_createTooltip:function(){var t=this,n=t.options.tooltip;return this._sharedTooltip()?this._createSharedTooltip(n):new il(this.chartService,n)},_createSharedTooltip:function(n){return new uh(this._plotArea,n)},applyDefaults:function(n,t){cp(n,t);lp(n,t)},applySeriesColors:function(){for(var r=this.options,u=r.series,f=r.seriesColors||[],n=0;n<u.length;n++){var t=u[n],e=f[n%f.length],i=t._defaults;t.color=t.color||e;i&&(i.color=i.color||e)}},_getModel:function(){var r=this.options,t=this._createPlotArea(),n=new i.RootElement(this._modelOptions());return n.chart=this,n._plotArea=t,i.Title.buildTitle(r.title,n),r.legend.visible&&n.append(new tl(t.options.legend,this.chartService)),n.append(t),n.reflow(),n},_modelOptions:function(){var n=this,r=n.options,f=n.element,u=i.elementSize(f);return this._size=null,t({width:Math.floor(u.width)||c.DEFAULT_WIDTH,height:Math.floor(u.height)||c.DEFAULT_HEIGHT,transitions:r.transitions},r.chartArea)},_createPlotArea:function(n){var t=this.options;return dt.current.create(n?[]:t.series,t,this.chartService)},_hasSelection:function(){return this._selections&&this._selections.length},_setupSelection:function(){for(var u,n,f,r,s,h=this,c=this,o=c._plotArea.axes,l=this._selections=[],e=0;e<o.length;e++)u=o[e],n=u.options,u instanceof hu&&n.select&&!n.vertical&&(f=0,r=n.categories.length-1,u instanceof lo&&(f=n.categories[f],r=n.categories[r]),n.justified||(u instanceof lo?r=i.addDuration(r,1,n.baseUnit,n.weekStartDay):r++),s=new rh(h,u,t({min:f,max:r},n.select)),l.push(s))},_selectStart:function(n){return this.trigger(is,n)},_select:function(n){return this.trigger(rf,n)},_selectEnd:function(n){return this.trigger(rs,n)},_initHandlers:function(){this._clickHandler=this._click.bind(this);this._mousewheelHandler=this._mousewheel.bind(this);this._surfaceMouseenterHandler=this._mouseover.bind(this);this._surfaceMouseleaveHandler=this._mouseout.bind(this);this._mousemove=kendo.throttle(this._mousemove.bind(this),sp)},addObserver:function(n){n&&this.observers.push(n)},removeObserver:function(n){var t=this.observers.indexOf(n);t>=0&&this.observers.splice(t,1)},requiresHandlers:function(n){for(var i=this.observers,t=0;t<i.length;t++)if(i[t].requiresHandlers(n))return!0},trigger:function(n,t){var r,u,i;for(t===void 0&&(t={}),n===tc&&(t.anchor.point=this._toDocumentCoordinates(t.anchor.point)),t.sender=this,r=this.observers,u=!1,i=0;i<r.length;i++)r[i].trigger(n,t)&&(u=!0);return u},_attachEvents:function(){var i=this,r=i.element,u=i.surface,n,t;u.bind("mouseenter",this._surfaceMouseenterHandler);u.bind("mouseleave",this._surfaceMouseleaveHandler);df(r,(n={},n[wv]=this._clickHandler,n[we]=this._mousewheelHandler,n));this._shouldAttachMouseMove()&&df(r,(t={},t[ou]=this._mousemove,t));this.domEvents=yh.DomEventsBuilder.create(this.element,{start:this._start.bind(this),move:this._move.bind(this),end:this._end.bind(this),tap:this._tap.bind(this),gesturestart:this._gesturestart.bind(this),gesturechange:this._gesturechange.bind(this),gestureend:this._gestureend.bind(this)});this._toggleDomDrag();this._toggleDomZoom()},_cancelDomEvents:function(){this.domEvents&&this.domEvents.cancel&&this.domEvents.cancel()},_gesturestart:function(n){this._mousewheelZoom&&!this._stopDragEvent(n)&&(this._gestureDistance=n.distance,this._unsetActivePoint(),this.surface.suspendTracking())},_gestureend:function(n){this._zooming&&!this._stopDragEvent(n)&&(this.surface&&this.surface.resumeTracking(),this._zooming=!1,this.trigger(tf,{}))},_gesturechange:function(n){var r=this._mousewheelZoom,u,t,i,f;r&&!this._stopDragEvent(n)&&(n.preventDefault(),u=this._gestureDistance,t=-n.distance/u+1,Math.abs(t)>=.1&&(t=Math.round(t*10),this._gestureDistance=n.distance,i={delta:t,axisRanges:fo(this._plotArea.axes),originalEvent:n},(this._zooming||!this.trigger(gu,i))&&(this._zooming||(this._zooming=!0),f=i.axisRanges=r.updateRanges(t),f&&!this.trigger(nf,i)&&r.zoom())))},_mouseout:function(n){if(n.element){var t=this._drawingChartElement(n.element,n);t&&t.leave&&t.leave(this,n.originalEvent)}},_start:function(n){var t=this._eventCoordinates(n);!this._stopDragEvent(n)&&this._plotArea.backgroundContainsPoint(t)&&(this.requiresHandlers([ts,ae,ve])&&this._startNavigation(n,t,ts),this._pannable&&this._pannable.start(n)&&(this.surface.suspendTracking(),this._unsetActivePoint(),this._suppressHover=!0),this._zoomSelection&&this._zoomSelection.start(n)&&this.trigger(gu,{axisRanges:fo(this._plotArea.axes),originalEvent:n}))},_move:function(n){var c=this,u=c._navState,f=c._pannable,e,i,o,r,t,l,s,h;if(!this._stopDragEvent(n)){if(f)e=f.move(n),e&&!this.trigger(ae,{axisRanges:e,originalEvent:n})&&f.pan();else if(u){for(i={},o=u.axes,r=0;r<o.length;r++)t=o[r],l=t.options.name,l&&(s=t.options.vertical?n.y:n.x,h=s.startLocation-s.location,h!==0&&(i[t.options.name]=t.translateRange(h)));u.axisRanges=i;this.trigger(ae,{axisRanges:i,originalEvent:n})}this._zoomSelection&&this._zoomSelection.move(n)}},_end:function(n){var i,t;this._stopDragEvent(n)||(i=this._pannable,i&&i.end(n)?(this.surface.resumeTracking(),this.trigger(ve,{axisRanges:fo(this._plotArea.axes),originalEvent:n}),this._suppressHover=!1):this._endNavigation(n,ve),this._zoomSelection&&(t=this._zoomSelection.end(n),t&&!this.trigger(nf,{axisRanges:t,originalEvent:n})&&(this._zoomSelection.zoom(),this.trigger(tf,{axisRanges:t,originalEvent:n}))))},_stopDragEvent:function(){return this._hasSelection()},_mousewheel:function(n){var u=this,f=i.mousewheelDelta(n),o=this._mousewheelZoom,v=this._eventCoordinates(n),t,r,y,s,h,c,e,l,a;if(this._plotArea.backgroundContainsPoint(v))if(o)t={delta:f,axisRanges:fo(this._plotArea.axes),originalEvent:n},(this._zooming||!this.trigger(gu,t))&&(n.preventDefault(),this._zooming||(this._unsetActivePoint(),this.surface.suspendTracking(),this._zooming=!0),this._mwTimeout&&clearTimeout(this._mwTimeout),t.axisRanges=o.updateRanges(f),t.axisRanges&&!this.trigger(nf,t)&&o.zoom(),this._mwTimeout=setTimeout(function(){u.trigger(tf,t);u._zooming=!1;u.surface&&u.surface.resumeTracking()},us));else if(r=this._navState,r||(y=this._startNavigation(n,v,gu),y||(r=this._navState)),r){for(s=r.totalDelta||f,r.totalDelta=s+f,h=this._navState.axes,c={},e=0;e<h.length;e++)l=h[e],a=l.options.name,a&&(c[a]=l.scaleRange(-s));this.trigger(nf,{delta:f,axisRanges:c,originalEvent:n});this._mwTimeout&&clearTimeout(this._mwTimeout);this._mwTimeout=setTimeout(function(){u._endNavigation(n,tf)},us)}},_startNavigation:function(n,t,i){var u=this._model._plotArea,f=u.findPointPane(t),e=u.axes.slice(0),r,o;f&&(r=fo(e),o=this.trigger(i,{axisRanges:r,originalEvent:n}),o?this._cancelDomEvents():(this._suppressHover=!0,this._unsetActivePoint(),this._navState={axisRanges:r,pane:f,axes:e}))},_endNavigation:function(n,t){this._navState&&(this.trigger(t,{axisRanges:this._navState.axisRanges,originalEvent:n}),this._suppressHover=!1,this._navState=null)},_getChartElement:function(n,t){var i=this.surface.eventTarget(n);if(i)return this._drawingChartElement(i,n,t)},_drawingChartElement:function(n,t,i){for(var u=n,r;u&&!r;)r=u.chartElement,u=u.parent;if(r)return r.aliasFor&&(r=r.aliasFor(t,this._eventCoordinates(t))),i&&(r=r.closest(i),r&&r.aliasFor&&(r=r.aliasFor())),r},_eventCoordinates:function(n){var t=i.eventCoordinates(n);return this._toModelCoordinates(t.x,t.y)},_elementPadding:function(){if(!this._padding){var n=et(this.element,["paddingLeft","paddingTop"]),t=n.paddingLeft,i=n.paddingTop;this._padding={top:i,left:t}}return this._padding},_toDocumentCoordinates:function(n){var t=this._elementPadding(),r=i.elementOffset(this.element);return{left:k(n.x+t.left+r.left),top:k(n.y+t.top+r.top)}},_toModelCoordinates:function(n,t){var f=this.element,r=i.elementOffset(f),u=this._elementPadding();return new e(n-r.left-u.left,t-r.top-u.top)},_tap:function(n){var r=this,i=this.surface.eventTarget(n),t=this._drawingChartElement(i,n);this._activePoint===t?this._propagateClick(t,n):(this._startHover(i,n)||this._unsetActivePoint(),this._propagateClick(t,n));this.handlingTap=!0;setTimeout(function(){r.handlingTap=!1},0)},_click:function(n){var t=this._getChartElement(n);this._propagateClick(t,n)},_propagateClick:function(n,t){for(var r=this,i=n;i;)i.click&&i.click(r,t),i=i.parent},_startHover:function(n,i){var o=this._drawingChartElement(n,i),e=this,s=e._tooltip,u=e._highlight,r,f;return this._suppressHover||!u||u.isHighlighted(o)||this._sharedTooltip()?!1:(r=this._drawingChartElement(n,i,function(n){return n.hover&&!(n instanceof ot)}),r&&!r.hover(this,i)?(this._activePoint=r,f=t({},f,r.options.tooltip),f.visible&&s.show(r),u.show(r),r):void 0)},_mouseover:function(n){var i=this._startHover(n.element,n.originalEvent),t;i&&i.tooltipTracking&&(this._mouseMoveTrackHandler=this._mouseMoveTrackHandler||this._mouseMoveTracking.bind(this),df(document,(t={},t[ou]=this._mouseMoveTrackHandler,t)))},_mouseMoveTracking:function(n){var u=this,s=u.options,h=u._tooltip,c=u._highlight,i=u._activePoint,f=this._eventCoordinates(n),r,o,e;this._plotArea.box.containsPoint(f)?i&&i.tooltipTracking&&i.series&&i.parent.getNearestPoint&&(r=i.parent.getNearestPoint(f.x,f.y,i.seriesIx),r&&r!==i&&(r.hover(this,n),this._activePoint=r,o=t({},s.tooltip,i.options.tooltip),o.visible&&h.show(r),c.show(r))):(gf(document,(e={},e[ou]=this._mouseMoveTrackHandler,e)),this._unsetActivePoint())},_mousemove:function(n){var t=this._eventCoordinates(n);this._trackCrosshairs(t);this._plotArea.hover&&this._plotArea.hover(this,n);this._sharedTooltip()&&this._trackSharedTooltip(t,n)},_trackCrosshairs:function(n){for(var t,r=this._plotArea.crosshairs,i=0;i<r.length;i++)t=r[i],t.box.containsPoint(n)?t.showAt(n):t.hide()},_trackSharedTooltip:function(n,t){var i=this,h=i.options.tooltip,f=i._plotArea,c=i._plotArea.categoryAxis,e=i._tooltip,l=i._highlight,r;if(f.box.containsPoint(n)&&(r=c.pointCategoryIndex(n),r!==this._tooltipCategoryIx)){var u=f.pointsByCategoryIndex(r),o=u.map(function(n){return n.eventArgs(t)}),s=o[0]||{};s.categoryPoints=o;u.length>0&&!this.trigger(gh,s)?(h.visible&&e.showAt(u,n),l.show(u)):e.hide();this._tooltipCategoryIx=r}},hideElements:function(){var n=this,t=n._plotArea,i=n._tooltip,r=n._highlight;this._mousemove.cancel();t.hideCrosshairs();r.hide();i.hide();delete this._tooltipCategoryIx},_unsetActivePoint:function(){var n=this,t=n._tooltip,i=n._highlight;this._activePoint=null;t&&t.hide();i&&i.hide()},_deferRedraw:function(){this._redraw()},_clearRedrawTimeout:function(){this._redrawTimeout&&(clearInterval(this._redrawTimeout),this._redrawTimeout=null)},bindCategories:function(){for(var t,r=this,u=this.options,i=[].concat(u.categoryAxis),n=0;n<i.length;n++)t=i[n],t.autoBind!==!1&&r.bindCategoryAxisFromSeries(t,n)},bindCategoryAxisFromSeries:function(n,t){for(var y,e,c,o,p,w=this,l=this.options.series,b=l.length,a={},u=[],f,s=0;s<b;s++){var r=l[s],k=r.categoryAxis===n.name||!r.categoryAxis&&t===0,h=r.data,v=h.length;if(r.categoryField&&k&&v>0)for(f=ac(n,ie(r.categoryField,h[0])),y=f?lc:ie,e=0;e<v;e++)c=h[e],o=y(r.categoryField,c,w.chartService.intl),(f||!a[o])&&(u.push([o,c]),f||(a[o]=!0))}u.length>0&&(f&&(u=vp(u,function(n,t){return i.dateComparer(n[0],t[0])})),p=yp(u),n.categories=p[0])},_isBindable:function(n){for(var t,r=p.current.valueFields(n),f=!0,i=0;i<r.length;i++)if(t=r[i],t=t===wt?"field":t+"Field",!u(n[t])){f=!1;break}return f},_noTransitionsRedraw:function(){var n=this.options,t;n.transitions&&(n.transitions=!1,t=!0);this._redraw();t&&(n.transitions=!0)},_legendItemHover:function(n,t){var r=this,i=r._plotArea,f=r._highlight,e=(i.srcSeries||i.series)[n],u;u=d(e.type,[ir,ee,oe])?i.findPoint(function(i){return i.series.index===n&&i.index===t}):i.pointsBySeriesIndex(n);f.show(u)},_shouldAttachMouseMove:function(){return this._plotArea.crosshairs.length||this._tooltip&&this._sharedTooltip()||this.requiresHandlers([nc])},updateMouseMoveHandler:function(){var n,t;gf(this.element,(n={},n[ou]=this._mousemove,n));this._shouldAttachMouseMove()&&df(this.element,(t={},t[ou]=this._mousemove,t))},applyOptions:function(n,i){al(this._originalOptions,n);this._originalOptions=t(this._originalOptions,n);this.options=t({},this._originalOptions);i&&(this._theme=i,this.chartService.theme=i);this._initTheme(this.options,this._theme)},setOptions:function(n,t){this.applyOptions(n,t);this.bindCategories();this.redraw();this.updateMouseMoveHandler();this._toggleDomDrag();this._toggleDomZoom()},destroy:function(){var n,t;this._destroyed=!0;gf(this.element,(n={},n[wv]=this._clickHandler,n[we]=this._mousewheelHandler,n[ou]=this._mousemove,n));this.domEvents&&(this.domEvents.destroy(),delete this.domEvents);gf(document,(t={},t[ou]=this._mouseMoveTrackHandler,t));this._destroyView();this.surface&&(this.surface.destroy(),this.surface=null);this._clearRedrawTimeout()},_destroyView:function(){var t=this,i=t._model,n=t._selections;if(i&&(i.destroy(),this._model=null),n)while(n.length>0)n.shift().destroy();this._unsetActivePoint();this._tooltip&&this._tooltip.destroy();this._highlight&&this._highlight.destroy();this._zoomSelection&&(this._zoomSelection.destroy(),delete this._zoomSelection);this._pannable&&(this._pannable.destroy(),delete this._pannable);this._mousewheelZoom&&(this._mousewheelZoom.destroy(),delete this._mousewheelZoom)}});f(bv,{renderAs:"",chartArea:{},legend:{visible:!0,labels:{}},categoryAxis:{},seriesDefaults:{type:yi,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});kendo.deepExtend(kendo.dataviz,{constants:uy,Aggregates:te,AreaChart:oa,AreaSegment:fr,AxisGroupRangeTracker:de,Bar:er,BarChart:ui,BarLabel:ls,BoxPlotChart:la,BoxPlot:ff,BubbleChart:ps,Bullet:fu,BulletChart:ge,CandlestickChart:uf,Candlestick:fi,CategoricalChart:tt,CategoricalErrorBar:rc,CategoricalPlotArea:wi,Chart:bv,ChartContainer:ks,ClipAnimation:hs,ClusterLayout:uu,Crosshair:bs,CrosshairTooltip:ws,DefaultAggregates:ei,DonutChart:oh,DonutPlotArea:vv,DonutSegment:eu,ErrorBarBase:fs,ErrorRangeCalculator:wh,Highlight:gc,SharedTooltip:uh,Legend:tl,LegendItem:fv,LegendLayout:uv,LineChart:ru,LinePoint:kt,LineSegment:hi,Pane:of,PieAnimation:fh,PieChart:lf,PieChartMixin:el,PiePlotArea:eh,PieSegment:cf,PlotAreaBase:ot,PlotAreaEventsMixin:sf,PlotAreaFactory:dt,PointEventsMixin:ri,RangeBar:to,RangeBarChart:ds,RangeAreaPoint:hf,RangeAreaChart:gs,ScatterChart:yt,ScatterErrorBar:aa,ScatterLineChart:io,Selection:rh,SeriesAggregator:yc,SeriesBinder:p,SplineSegment:ss,SplineAreaSegment:cs,StackWrap:vs,Tooltip:il,OHLCChart:ga,OHLCPoint:da,WaterfallChart:bc,WaterfallSegment:wc,XYPlotArea:ro,MousewheelZoom:rv,ZoomSelection:th,Pannable:nh,ChartAxis:vl,ChartPane:ph,ChartPlotArea:yl,anyHasZIndex:oc,appendIfNotNull:ys,areNumbers:ys,bindSegments:cc,categoriesCount:es,countNumbers:vo,equalsIgnoreCase:or,evalOptions:ur,filterSeriesByType:b,getDateField:lc,getField:ie,hasGradientOverlay:as,hasValue:at,isDateAxis:ac,segmentVisible:ya,singleItemOrArray:no})})(window.kendo.jQuery)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("dataviz/chart/chart",["dataviz/chart/kendo-chart","kendo.data","kendo.dataviz.core","kendo.dataviz.themes","kendo.drawing","kendo.userevents"],n)}(function(){return function(n,t){function ir(n){a.fn[n]=function(){var t=this._instance;if(t)return t[n].apply(t,arguments)}}function rr(n,r){var l=[],o,c=n.groupNameTemplate,s,a=r.length,u;if(a===0)return u=e({},n),u.visibleInLegend=!1,[u];for(f(c)?(i.logToConsole("'groupNameTemplate' is obsolete and will be removed in future versions. Specify the group name template as 'series.name'"),c&&(o=h(c))):(o=h(n.name||""),o._slotCount===0&&(o=h(f(n.name)?"#= group.value #: #= series.name #":"#= group.value #"))),s=0;s<a;s++)u=e({},n),i.isFunction(u.color)||(u.color=t),u._groupIx=s,u._groupValue=r[s].value,l.push(u),o&&(u.name=o({series:u,group:r[s]}));return l}function ur(n){for(var i in n)n[i]===t&&(n[i]="");return n}var g=".kendoChart",i=window.kendo,p=i.Class,nt=i._outerWidth,tt=i._outerHeight,u=i.dataviz,r=u.constants,pt=u.Chart,wt=u.SeriesBinder,c=i.ui.Widget,it=i.data.DataSource,e=i.deepExtend,f=u.defined,bt=u.getField,kt=u.InstanceObserver,dt=u.inArray,gt=u.services,s=n.proxy,ni=n.isArray,rt=n.extend,h=i.template,l="mouseleave"+g,ti=r.AXIS_LABEL_CLICK,ut=r.LEGEND_ITEM_CLICK,ii=r.LEGEND_ITEM_HOVER,ri=r.SERIES_CLICK,ui=r.SERIES_HOVER,fi=r.PLOT_AREA_CLICK,ei=r.PLOT_AREA_HOVER,oi=r.DRAG,si=r.DRAG_END,hi=r.DRAG_START,ci=r.ZOOM_START,li=r.ZOOM,ai=r.ZOOM_END,vi=r.SELECT_START,yi=r.SELECT,pi=r.SELECT_END,ft=r.RENDER,wi=r.NOTE_CLICK,bi=r.NOTE_HOVER,w="change",b="dataBound",et="leave",ki=r.VALUE,ot=r.PIE,st=r.DONUT,ht=r.FUNNEL,ct=i.Observable,di=100,gi="k-chart-tooltip-inverse",nr="k-chart-shared-tooltip",tr="rtl",v,vt,k;gt.DomEventsBuilder.register({create:function(n,t){return new i.UserEvents(n,e({global:!0,multiTouch:!0,fastTap:!0},t))}});var lt=kt.extend({handlerMap:{showTooltip:"_showTooltip",hideTooltip:"_hideTooltip",legendItemClick:"_onLegendItemClick",render:"_onRender",init:"_onInit"}}),a=c.extend({init:function(n,t){var r;i.destroy(n);c.fn.init.call(this,n);t&&(r=t.dataSource,delete t.dataSource);this.options=e({},this.options,t);this.wrapper=this.element;this._attachEvents();t&&(t.dataSource=r);this._seriesVisibility=new vt;this.bind(this.events,this.options);this._initDataSource(t);i.notify(this,u.ui)},events:[b,ri,ui,ti,ut,ii,fi,ei,hi,oi,si,ci,li,ai,vi,yi,pi,wi,bi,ft],options:{name:"Chart",renderAs:"",theme:"default",axisDefaults:{},chartArea:{},legend:{},categoryAxis:{},autoBind:!0,seriesDefaults:{},series:[],seriesColors:null,tooltip:{},transitions:!0,valueAxis:{},plotArea:{},title:{},xAxis:{},yAxis:{},panes:[{}],pannable:!1,zoomable:!1},items:function(){return n()},refresh:function(){var n=this,t=n._instance;t.applyDefaults(n.options);t.applySeriesColors();n._bindSeries();n._bindCategories();n.trigger(b);n._redraw()},getSize:function(){return i.dimensions(this.element)},redraw:function(n){this._size=null;this._instance.redraw(n)},setOptions:function(n){var t=this,i=n.dataSource;delete n.dataSource;c.fn._setEvents.call(t,n);this._instance.applyOptions(n,this._getThemeOptions(n));this.options=this._instance.options;this._tooltip.setOptions(this.options.tooltip);this._sourceSeries=null;i&&t.setDataSource(i);t._hasDataSource?t._onDataChanged():(t._bindCategories(),t.redraw());t._instance.updateMouseMoveHandler()},setDataSource:function(n){var t=this;t.dataSource.unbind(w,t._dataChangeHandler);t.dataSource=n=it.create(n);t._hasDataSource=!0;t._hasData=!1;n.bind(w,t._dataChangeHandler);t.options.autoBind&&n.fetch()},destroy:function(){var n=this,t=n.dataSource;n.element.off(g);t&&t.unbind(w,n._dataChangeHandler);n._instance&&(n._instance.destroy(),delete this._instance);this._tooltip&&(this._tooltip.destroy(),delete this._tooltip);this._destroyCrosshairTooltips();c.fn.destroy.call(n)},findPaneByName:function(n){for(var i=this._plotArea.panes,t=0;t<i.length;t++)if(i[t].options.name===n)return new d(this,i[t])},findPaneByIndex:function(n){var t=this._plotArea.panes;if(t[n])return new d(this,t[n])},findSeries:function(n){for(var r=this._plotArea,i=r.srcSeries||r.series,t=0;t<i.length;t++)if(n(i[t]))return new y(this,i[t])},findSeriesByName:function(n){return this._createSeries({name:n})},findSeriesByIndex:function(n){return this._createSeries({index:n})},_createSeries:function(n){var t=this._seriesOptions(n);if(t)return new y(this,t)},_seriesOptions:function(n){var u=this._plotArea,i=u.srcSeries||u.series,r,t;if(f(n.index))r=i[n.index];else if(f(n.name))for(t=0;t<i.length;t++)if(i[t].name===n.name){r=i[t];break}return r},_attachEvents:function(){this.element.on(l,s(this._mouseleave,this))},_mouseleave:function(t){var i=this._instance,u=this._tooltip,r=t.relatedTarget;r&&n(r).closest(u.element).length||!i||i.handlingTap||i.hideElements()},_getThemeOptions:function(n){var t=(n||{}).theme,i,r;return t==="sass"||t==="default-v2"||t==="bootstrap-v4"?u.autoTheme().chart:f(t)?(i=u.ui.themes||{},r=i[t]||i[t.toLowerCase()]||{},r.chart||{}):void 0},_initChart:function(){this._createChart(this.options,this._getThemeOptions(this.options));this.options=this._instance.options},_createChart:function(n,t){this._instance=new pt(this.element[0],n,t,{observer:new lt(this),sender:this,rtl:this._isRtl()})},_onInit:function(n){this._instance=n.sender},_initDataSource:function(n){var t=this,i=(n||{}).dataSource;t._dataChangeHandler=s(t._onDataChanged,t);t.dataSource=it.create(i).bind("change",t._dataChangeHandler);t._bindCategories();i&&(t._hasDataSource=!0);this._initChart();this._initTooltip();i&&t.options.autoBind&&t.dataSource.fetch()},_destroyCrosshairTooltips:function(){var n=this._crosshairTooltips,t;if(n)for(t in n)n[t].destroy();this._crosshairTooltips={}},_getCrosshairTooltip:function(n,t){var r=this._crosshairTooltips=this._crosshairTooltips||{},u=n+t,i=r[u];return i||(i=r[u]=new yt(this.element)),i},_showTooltip:function(n){if(n.crosshair){var t=this._getCrosshairTooltip(n.axisName,n.axisIndex);t.show(n)}else this._tooltip&&this._tooltip.show(n)},_hideTooltip:function(n){if(n.crosshair){var t=this._getCrosshairTooltip(n.axisName,n.axisIndex);t.hide()}else this._tooltip&&this._tooltip.hide(n)},_onRender:function(n){this._destroyCrosshairTooltips();this._copyMembers(n.sender);this._hasDataSource&&!this._hasData&&this.options.autoBind||this.trigger(ft)},_copyMembers:function(n){this.options=n.options;this._originalOptions=n._originalOptions;this.surface=n.surface;this._plotArea=n._plotArea;this._model=n._model;this._highlight=n._highlight;this._selections=n._selections;this._pannable=n._pannable;this._zoomSelection=n._zoomSelection;this._mousewheelZoom=n._mousewheelZoom},requiresHandlers:function(n){for(var i=this._events,t=0;t<n.length;t++)if(f(i[n[t]]))return!0},_initTooltip:function(){this._tooltip=this._createTooltip();this._tooltip.bind(et,s(this._tooltipleave,this))},_onLegendItemClick:function(n){this.trigger(ut,n)||this._legendItemClick(n.seriesIndex,n.pointIndex)},_legendItemClick:function(t,i){var s=this._instance,h=s._plotArea,r=(h.srcSeries||h.series)[t],u,e,o;n.inArray(r.type,[ot,st,ht])>=0?(u=r.data[i],u&&f(u.visible)?u.visible=!u.visible:(e=r.pointVisibility=r.pointVisibility||{},o=e[i],e[i]=f(o)?!o:!1)):(r.visible=!r.visible,this._seriesVisibility.save(r));s._noTransitionsRedraw()},_createTooltip:function(){return new o(this.element,rt({},this.options.tooltip,{rtl:this._isRtl()}))},_tooltipleave:function(){this._instance&&this._instance.hideElements()},_bindData:function(n){for(var t=this,o=t.options,f=t._sourceSeries||o.series,h=f.length,c=t.dataSource.view(),l=(t.dataSource.group()||[]).length>0,u=[],s=this._seriesVisibility,i,e,r=0;r<h;r++)i=f[r],t._isBindable(i)&&l?(e=rr(i,c),u=u.concat(e),s.applyByGroup(e,n)):(i=rt({},i),u.push(i),s.applyByIndex(i,n));t._sourceSeries=f;o.series=u;this._instance.applySeriesColors();t._bindSeries();t._bindCategories();this._hasData=!0},_onDataChanged:function(n){this._bindData(n);this.trigger(b);this._redraw()},_bindSeries:function(){for(var i=this,u=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=f(r)?(u[r]||{}).items:u,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=bt(n.field,u),r===0?(n.categories=[f],n.dataItems=[u]):(n.categories.push(f),n.dataItems.push(u));else this._instance&&this._instance.bindCategoryAxisFromSeries(n,i)},_isBindable:function(n){for(var r=wt.current.valueFields(n),u=!0,t,i=0;i<r.length;i++)if(t=r[i],t=t===ki?"field":t+"Field",!f(n[t])){u=!1;break}return u},_isRtl:function(){return i.support.isRtl(this.element)&&this.element.css("direction")===tr}}),at=["getAxis","findAxisByName","plotArea","toggleHighlight","showTooltip","hideTooltip","exportVisual","_resize","_redraw","_noTransitionsRedraw","_legendItemHover","_eventCoordinates"];for(v=0;v<at.length;v++)ir(at[v]);u.ExportMixin.extend(a.fn);i.PDFMixin&&i.PDFMixin.extend(a.fn);u.ui.plugin(a);vt=p.extend({init:function(){this.groups={};this.index={}},applyByGroup:function(n,t){if(t&&t.action)for(var i=0;i<n.length;i++)this.groups[n[i]._groupValue]===!1&&(n[i].visible=!1);else this.groups={}},applyByIndex:function(n,t){t&&t.action?this.index[n.index]===!1&&(n.visible=!1):this.index={}},save:function(n){n&&(f(n._groupValue)?this.groups[n._groupValue]=n.visible:this.index[n.index]=n.visible)}});k=i.geometry;var o=ct.extend({init:function(t,r){var u=this,f;ct.fn.init.call(u);this.setOptions(r);u.chartElement=t;u.template=o.template;u.template||(u.template=o.template=i.template("<div class='k-tooltip k-chart-tooltip#= d.rtl ? \" k-rtl\" : \"\"#' style='display:none; position: absolute; font: #= d.font #;#if (d.border) {# border: #= d.border.width #px solid; #}#opacity: #= d.opacity #; filter: alpha(opacity=#= d.opacity * 100 #);'><\/div>",{useWithBlock:!1,paramName:"d"}));u.element=n(u.template(u.options));u.move=s(u.move,u);u._mouseleave=s(u._mouseleave,u);f=i.format("[{0}='content'],[{0}='scroller']",i.attr("role"));u._mobileScroller=t.closest(f).data("kendoMobileScroller")},destroy:function(){this._clearShowTimeout();this.element&&(this.element.off(l).remove(),this.element=null)},setOptions:function(n){this.options=e({},this.options,n)},options:{opacity:1,animation:{duration:150},sharedTemplate:"<table><th colspan='#= colspan #'>#= categoryText #<\/th># for(var i = 0; i < points.length; i++) { ## var point = points[i]; #<tr># if(colorMarker) { # <td><span class='k-chart-shared-tooltip-marker' style='background-color:#:point.series.color#'><\/span><\/td># } ## if(nameColumn) { # <td> #if (point.series.name) {# #: point.series.name #: #} else {# &nbsp; #}#<\/td># } #<td>#= content(point) #<\/td><\/tr># } #<\/table>",categoryFormat:"{0:d}"},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)},getAnchor:function(n){var u=this.anchor,f=u.point,t=u.align,i=f.left,r=f.top;return t.horizontal==="center"?i-=n.width/2:t.horizontal==="right"&&(i-=n.width),t.vertical==="center"?r-=n.height/2:t.vertical==="bottom"&&(r-=n.height),{x:i,y:r}},_offset:function(){var f=this,e=f._measure(),s=f.getAnchor(e),r=s.y,u=s.x,h=i.support.zoomLevel(),c=n(window),a=window.pageYOffset||document.documentElement.scrollTop||0,v=window.pageXOffset||document.documentElement.scrollLeft||0,t=(this._mobileScroller||{}).movable,l,o;return t&&t.scale!==1?(l=k.transform().scale(t.scale,t.scale,[t.x,t.y]),o=new k.Point(u,r).transform(l),u=o.x,r=o.y):(r+=f._fit(r-a,e.height,tt(c)/h),u+=f._fit(u-v,e.width,nt(c)/h)),{top:r,left:u}},show:function(n){this.anchor=n.anchor;this.element.css(ur(n.style));this.element.toggleClass(gi,!!n.className);this.element.toggleClass(nr,!!n.shared);var t=n.shared?this._sharedContent(n):this._pointContent(n.point);this.element.html(t);this._clearShowTimeout();this.showTimeout=setTimeout(this.move,di)},hide:function(){var n=this;clearTimeout(n.showTimeout);n._hideElement();n.visible&&(n.point=null,n.visible=!1,n.index=null)},_sharedContent:function(n){var r=n.points,e=u.grep(r,function(n){return f(n.series.name)}).length,o=n.series.length>1,t=1,s,h;return e&&t++,o&&t++,s=i.template(this.options.sharedTemplate),h=s({points:r,category:n.category,categoryText:n.categoryText,content:this._pointContent,colorMarker:o,nameColumn:e,colspan:t}),h},_measure:function(){this._ensureElement();return{width:nt(this.element),height:tt(this.element)}},_ensureElement:function(){if(this.element)this.element.appendTo(document.body).on(l,this._mouseleave)},_mouseleave:function(t){var i=t.relatedTarget,r=this.chartElement[0];i&&i!==r&&!n.contains(r,i)&&this.trigger(et)},_hideElement:function(){var t=this,n=this.element;n&&n.fadeOut({always:function(){t.visible||n.off(l).remove()}})},_pointContent:function(n){var u=this,t=e({},u.options,n.options.tooltip),i,r;return f(n.value)&&(i=n.value.toString()),t.template?(r=h(t.template),i=r({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},_fit:function(n,t,i){var r=0;return n+t>i&&(r=i-(n+t)),n<0&&(r=-n),r}}),yt=o.extend({init:function(n,t){o.fn.init.call(this,n,t);this.element.addClass("k-chart-crosshair-tooltip")},show:function(n){var t=this.element;t&&(this.anchor=n.anchor,this.element.css(n.style),this.element.html(this.content(n)),this.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 t=n.value,i=n.crosshair.options.tooltip;return i.template&&(t=h(i.template)({value:t})),t},hide:function(){this.element.hide()}}),d=p.extend({init:function(n,t){this._chart=n;this._pane=t;this.visual=t.visual;this.chartsVisual=t.chartContainer.visual;this.name=t.options.name},series:function(){var i=this._chart,u=i._plotArea.groupSeriesByPane(),t=u[this.name||"default"],r=[],n;if(t)for(n=0;n<t.length;n++)r.push(new y(i,t[n]));return r}}),y=p.extend({init:function(n,t){this._chart=n;this._options=t},points:function(n){var t=this._points,r,u;return t||(r=this._seriesOptions(),u=this._chart._plotArea,this._points=t=u.pointsBySeriesIndex(r.index)),i.isFunction(n)&&(t=this._filterPoints(t,n)),t},data:function(n){var i=this._seriesOptions(),t,u,r,f;return n&&(t=this._chart,u=t._plotArea,i.data=n,i.categoryField&&(r=u.seriesCategoryAxis(i),f=[].concat(t.options.categoryAxis),t._instance.bindCategoryAxisFromSeries(f[r.axisIndex],r.axisIndex)),t._noTransitionsRedraw(),this._clearFields()),i.data},findPoint:function(n){for(var i=this.points(),t=0;t<i.length;t++)if(n(i[t]))return i[t]},toggleHighlight:function(n,t){t=t?i.isFunction(t)?this.points(t):ni(t)?t:[t]:this.points();this._chart._instance.togglePointsHighlight(n,t)},toggleVisibility:function(n,t){var e=this._chart,r=this._seriesOptions(),o=i.isFunction(t),f,u;if(o)if(dt(r.type,[ot,st,ht]))for(f=this._filterData(t),u=0;u<f.length;u++)f[u].visible=n;else r.visible=function(i){return t(i.dataItem)?n:!0};else r.visible=n,e._seriesVisibility.save(r);e._noTransitionsRedraw();this._clearFields()},_filterData:function(n){for(var i=this._seriesOptions().data,u=i.length,r=[],t=0;t<u;t++)n(i[t])&&r.push(i[t]);return r},_filterPoints:function(n,t){for(var r=[],u=n.length,i=0;i<u;i++)t(n[i])&&r.push(n[i]);return r},_seriesOptions:function(){var n=this._series;return n||(n=this._series=this._chart._seriesOptions(this._options)),n},_clearFields:function(){delete this._points;delete this._series}});u.Tooltip=o;u.CrosshairTooltip=yt;u.ChartInstanceObserver=lt;u.ChartPane=d;u.ChartSeries=y}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.dataviz.chart",["dataviz/chart/kendo-chart","dataviz/chart/chart"],n)}(function(){},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.dataviz.gauge",["kendo.dataviz.core","kendo.drawing","kendo.dataviz.themes"],n)}(function(){return function(n,t){function ci(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 bi(n.text,new u(s.x1,s.y1),{font:t.font,fill:{color:t.color}}),a=ai(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 li(n,t,i){var u=b(n.from)?n.from:gi,f=b(n.to)?n.to:di;return n.from=r.max(r.min(f,u),t),n.to=r.min(r.max(f,u),i),n}function ai(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 vi(n,t){var i=k(t);return i.left=-i.left,i.top=-i.top,i.right=-i.right,i.bottom=-i.bottom,ai(n,i)}var r=Math,v=window.kendo,ut=v.ui.Widget,f=v.deepExtend,i=v.dataviz,at=i.autoMajorUnit,yi=i.ChartElement,vt=i.NumericAxis,yt=i.Axis,a=i.Box2D,pi=v.Class,b=i.defined,wi=i.isNumber,tt=i.interpolateValue,k=i.getSpacing,d=i.round,s=i.geometry,o=i.drawing,u=s.Point,e=o.Group,h=o.Path,c=s.Rect,bi=o.Text,pt=150,wt=250,ki="arrow",bt="arrowPointer",g="barPointer",y="#000",it=i.COORD_PRECISION,di=Number.MAX_VALUE,gi=-Number.MAX_VALUE,kt=200,p=.5,dt=200,nr=60,tr=60,ir=5,gt=r.PI/180,rt=180,l="inside",ft="linear",ni="needle",et="outside",ti="radialPointer",ot="x",st="y",ht=pi.extend({init:function(n,t){var i=this,u=n.options;yi.fn.init.call(i,t);t=i.options;t.fill=t.color;i.scale=n;t.value=b(t.value)?r.min(r.max(t.value,u.min),u.max):u.min},options:{color:y},value:function(n){var u=this,i=u.options,e=i.value,f=u.scale.options;if(arguments.length===0)return e;i._oldValue=i._oldValue!==t?i.value:f.min;i.value=r.min(r.max(n,f.min),f.max);u.elements&&u.repaint()}}),ii=ht.extend({options:{shape:ni,cap:{size:.05},arrow:{width:16,height:14},animation:{type:ti,duration:pt}},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 hi(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===ni?t.append(n._renderNeedle(),n._renderCap()):t.append(n._renderArrow()),n.elements=t,n.setAngle(gt),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}})}}),ri=vt.extend({init:function(n){var t=this;t.options=f({},t.options,n);t.options.majorUnit=t.options.majorUnit||at(t.options.min,t.options.max);t.options.minorUnit=t.options.minorUnit||t.options.majorUnit/10;yt.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 i=this,u=n.center(),f=r.min(n.height(),n.width())/2;if(i.bbox!==t)i.bbox=i.arc.bbox(),i.radius(i.arc.getRadiusX()),i.repositionRanges(),i.renderLabels();else return i.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)*gt,ut=b.position===l,nt=y.pointAt(g),tt=nt.x+r.cos(d)*(p+ht)*(ut?1:-1),it=nt.y+r.sin(d)*(w+ht)*(ut?1:-1),o.reflow(new i.Box2D(tt-p,it-w,tt+p,it+w)),ft=new u(o.box.x1,o.box.y1),n.labelElements===t?(h=ci(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=li(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,r){var u=this,e,h,s,l=i.ui.themes||{},c,o;if(v.destroy(t),n(t).empty(),ut.fn.init.call(u,t),u.wrapper=u.element,u._originalOptions=f({},r),e=f({},u.options,r),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++)wi(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=vi(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||ir,n.width>0&&(r=vi(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=dt),t||(t=kt),{width:n,height:t}}}),ui=w.extend({init:function(n,t){var r=this;w.fn.init.call(r,n,t);v.notify(r,i.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 i=this,v=i.scale,h=v.arc,y=i._initialPlotArea,l=r.abs(i.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=i.getPlotBox(o,n,h),0<=u&&u<=2))break;if(s!=e&&(t=i.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=i.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 r.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 ri(u.scale),e,r;for(i.pointers=[],t=n.isArray(t)?t:[t],r=0;r<t.length;r++)e=new ii(o,f({},t[r],{animation:{transitions:u.transitions}})),i.pointers.push(e)}}),fi=w.extend({init:function(n,t){var r=this;w.fn.init.call(r,n,t);v.notify(r,i.ui)},options:{name:"LinearGauge",transitions:!0,gaugeArea:{background:""},scale:{vertical:!0}},reflow:function(n){var t=this,u=t.pointers,f=n.origin.x,e=n.origin.y,o=new i.Box2D(f,e,f+n.width(),e+n.height()),r;for(t.scale.reflow(o),r=0;r<u.length;r++)u[r].reflow();t.bbox=t._getBox(o);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 ei(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===ki?new oi(o,r):new si(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?nr:dt),t||(t=u?kt:tr),{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 a(r.x-i,n.y1,r.x+i,n.y2)):(i=t.height()/2,t=new a(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 a(e.x1+i,t.y1,e.x2+i,t.y2))):(i=t.center().y-o.center().y,r.reflow(new a(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,i=f.pointers,u=e.box.clone(),t=e.options.vertical?"y":"x",o=i[0].box,n=0;n<i.length;n++)o.wrap(i[n].box.clone());for(u[t+1]+=r.max(u[t+1]-o[t+1],0),u[t+2]-=r.max(o[t+2]-u[t+2],0),e.reflow(u),n=0;n<i.length;n++)i[n].reflow(f.bbox)}}),ei=vt.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||at(t.options.min,t.options.max);yt.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=li(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(ci(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),v=h.options.vertical,t=v?l[f?"left":"right"]:l[f?"bottom":"top"],c,e,i;t=f?-t:t;v?(i=new a(n.x1+t,n.y1,n.x1+t,n.y2),f?i.x1-=o:i.x2+=o,r.shape!==g&&(e=new a(n.x2+t,n.y1-s,n.x2+t,n.y2+s),c=e)):(i=new a(n.x1,n.y1-t,n.x2,n.y1-t),f?i.y2+=o:i.y1-=o,r.shape!==g&&(e=new a(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"]}}),oi=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=bt,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}}),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*.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}}),hi=o.Animation.extend({init:function(n,t){o.Animation.fn.init.call(this,n,t);t=this.options;t.duration=r.max(r.abs(t.newAngle-t.oldAngle)/t.duration*1e3,1)},options:{easing:ft,duration:pt},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(ti,hi);ct=o.Animation.extend({options:{easing:ft,duration:wt},setup:function(){var n=this.options,t=n.margin,i=n.from,f=n.to,e=n.vertical?"x1":"y1",o,s;n.mirror==n.vertical?(i[e]-=t,f[e]-=t):(i[e]+=t,f[e]+=t);o=this.fromScale=new u(i.x1,i.y1);s=this.toScale=new u(f.x1,f.y1);n.duration!==0&&(n.duration=r.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(bt,ct);lt=o.Animation.extend({options:{easing:ft,speed:wt},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],i=this.from=f[0][t];n.duration!==0&&(n.duration=r.max(r.abs(e-i)/n.speed*1e3,1));this._set(i)},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);i.ui.plugin(ui);i.ui.plugin(fi);i.ExportMixin.extend(w.fn);f(i,{Gauge:w,RadialPointer:ii,LinearPointer:nt,ArrowLinearPointer:oi,BarLinearPointer:si,LinearScale:ei,RadialScale:ri,LinearGauge:fi,RadialGauge:ui})}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.dataviz.barcode",["kendo.dataviz.core","kendo.drawing"],n)}(function(){return 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.drawing.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);i&&l(i.value)&&r.redraw()},setOptions:function(n){this._setOptions(n);this.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=new 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=new 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},_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)},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),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.dataviz.qrcode",["kendo.dataviz.core","kendo.drawing"],n)}(function(){return 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=new 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),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("dataviz/stock/kendo-stock-chart",["kendo.dataviz.chart"],n)}(function(){(function(){function l(n,t){var i=document.createElement("div");return i.className=n,t&&(i.style.cssText=t),i}function v(){}function k(n){return v.prototype=n,new v}var h,y,a;window.kendo.dataviz=window.kendo.dataviz||{};var n=kendo.dataviz,i=n.elementStyles,t=n.deepExtend,r=n.toTime,s=n.constants,e=n.Chart,c=kendo.drawing,p=c.Animation.extend({setup:function(){this._initialOpacity=parseFloat(i(this.element,"opacity").opacity)},step:function(t){i(this.element,{opacity:String(n.interpolateValue(this._initialOpacity,0,t))})},abort:function(){c.Animation.fn.abort.call(this);i(this.element,{display:"none",opacity:String(this._initialOpacity)})},cancel:function(){c.Animation.fn.abort.call(this);i(this.element,{opacity:String(this._initialOpacity)})}});h=n.Class.extend({init:function(n,r,u){this.options=t({},this.options,u);this.container=n;this.chartService=r;var f=i(n,["paddingLeft","paddingTop"]);this.chartPadding={top:f.paddingTop,left:f.paddingLeft};this.createElements();n.appendChild(this.element)},createElements:function(){var n=this.element=l("k-navigator-hint","display: none; position: absolute; top: 1px; left: 1px;"),t=this.tooltip=l("k-tooltip k-chart-tooltip"),i=this.scroll=l("k-scroll");t.innerHTML="&nbsp;";n.appendChild(t);n.appendChild(i)},show:function(t,u,f){var o=this,c=o.element,e=o.options,p=o.scroll,s=o.tooltip,w=n.toDate(r(t)+r(u-t)/2),l=f.width()*.4,a=f.center().x-l,b=f.center().x,k=b-a,d=e.max-e.min,g=k/d,nt=w-e.min,v=this.chartService.intl.format(e.format,t,u),y=n.getTemplate(e),h;this.clearHideTimeout();this._visible||(i(c,{visibility:"hidden",display:"block"}),this._visible=!0);y&&(v=y({from:t,to:u}));s.innerHTML=v;i(s,{left:f.center().x-s.offsetWidth/2,top:f.y1});h=i(s,["marginTop","borderTopWidth","height"]);i(p,{width:l,left:a+nt*g,top:f.y1+h.marginTop+h.borderTopWidth+h.height/2});i(c,{visibility:"visible"})},clearHideTimeout:function(){this._hideTimeout&&clearTimeout(this._hideTimeout);this._hideAnimation&&this._hideAnimation.cancel()},hide:function(){var n=this;this.clearHideTimeout();this._hideTimeout=setTimeout(function(){n._visible=!1;n._hideAnimation=new p(n.element);n._hideAnimation.setup();n._hideAnimation.play()},this.options.hideDelay)},destroy:function(){this.clearHideTimeout();this.container&&this.container.removeChild(this.element);delete this.container;delete this.chartService;delete this.element;delete this.tooltip;delete this.scroll}});n.setDefaultOptions(h,{format:"{0:d} - {1:d}",hideDelay:500});var f="_navigator",u=f,w={NAVIGATOR_AXIS:u,NAVIGATOR_PANE:f},b=3,o=n.Class.extend({init:function(i){var f,r,u;this.chart=i;f=this.options=t({},this.options,i.options.navigator);r=f.select;r&&(r.from=this.parseDate(r.from),r.to=this.parseDate(r.to));n.defined(f.hint.visible)||(f.hint.visible=f.visible);this.chartObserver=new n.InstanceObserver(this,(u={},u[s.DRAG]="_drag",u[s.DRAG_END]="_dragEnd",u[s.ZOOM]="_zoom",u[s.ZOOM_END]="_zoomEnd",u));i.addObserver(this.chartObserver)},parseDate:function(t){return n.parseDate(this.chart.chartService.intl,t)},destroy:function(){this.chart&&(this.chart.removeObserver(this.chartObserver),delete this.chart);this.selection&&(this.selection.destroy(),delete this.selection);this.hint&&(this.hint.destroy(),delete this.hint)},redraw:function(){this._redrawSelf();this.initSelection()},initSelection:function(){var s=this,r=s.chart,t=s.options,i=this.mainAxis(),c=i.range(),u=c.min,f=c.max,e=t.select,a=e.from,v=e.to,y=e.mousewheel,l=k(i),p=i.options.categories,o=this.selection;p.length!==0&&(o&&o.destroy(),l.box=i.box,o=this.selection=new n.Selection(r,l,{min:u,max:f,from:a||u,to:v||f,mousewheel:n.valueOrDefault(y,{zoom:"left"}),visible:t.visible},new n.InstanceObserver(this,{selectStart:"_selectStart",select:"_select",selectEnd:"_selectEnd"})),this.hint&&this.hint.destroy(),t.hint.visible&&(this.hint=new h(r.element,r.chartService,{min:u,max:f,template:n.getTemplate(t.hint),format:t.hint.format})))},setRange:function(){var s=this.chart._createPlotArea(!0),h=s.namedCategoryAxes[u],o=h.range(),i=o.min,r=o.max,f=this.options.select||{},e=f.from||i,n;e<i&&(e=i);n=f.to||r;n>r&&(n=r);this.options.select=t({},f,{from:e,to:n});this.filterAxes()},_redrawSelf:function(t){var i=this.chart._plotArea;i&&i.redraw(n.last(i.panes),t)},redrawSlaves:function(){var t=this.chart,n=t._plotArea,i=n.panes.slice(0,-1);n.srcSeries=t.options.series;n.options.categoryAxis=t.options.categoryAxis;n.redraw(i)},_drag:function(t){var h=this,c=h.chart,u=h.selection,v=c._eventCoordinates(t.originalEvent),l=this.mainAxis(),f=l.datesRange(),y=l.pane.box.containsPoint(v),p=c._plotArea.categoryAxis,a=t.axisRanges[p.options.name],e=this.options.select,o,i,s;a&&!y&&u&&(o=e.from&&e.to?r(e.to)-r(e.from):r(u.options.to)-r(u.options.from),i=n.toDate(n.limitValue(r(a.min),f.min,r(f.max)-o)),s=n.toDate(n.limitValue(r(i)+o,r(f.min)+o,f.max)),this.options.select={from:i,to:s},this.options.liveDrag&&(this.filterAxes(),this.redrawSlaves()),u.set(i,s),this.showHint(i,s))},_dragEnd:function(){this.filterAxes();this.filter();this.redrawSlaves();this.hint&&this.hint.hide()},readSelection:function(){var n=this,t=n.selection.options,r=t.from,u=t.to,i=n.options.select;i.from=r;i.to=u},filterAxes:function(){var r=this,n=r.options.select,t,i;n===void 0&&(n={});var e=r.chart,u=e.options.categoryAxis,o=n.from,s=n.to;for(t=0;t<u.length;t++)i=u[t],i.pane!==f&&(i.min=o,i.max=s)},filter:function(){var u=this,r=u.chart,f=u.options.select,i;r.requiresHandlers(["navigatorFilter"])&&(i=new n.DateCategoryAxis(t({baseUnit:"fit"},r.options.categoryAxis[0],{categories:[f.from,f.to]}),r.chartService).options,this.chart.trigger("navigatorFilter",{from:n.addDuration(i.min,-i.baseUnitStep,i.baseUnit),to:n.addDuration(i.max,i.baseUnitStep,i.baseUnit)}))},_zoom:function(t){var u=this,e=u.chart._plotArea.categoryAxis,i=u.selection,o=u.options,r=o.select,l=o.liveDrag,s=this.mainAxis().options.categories,f=t.delta,h,c;i&&(h=n.lteDateIndex(i.options.from,s),c=n.lteDateIndex(i.options.to,s),t.originalEvent.preventDefault(),Math.abs(f)>1&&(f*=b),c-h>1?(i.expand(f),this.readSelection()):(e.options.min=r.from,r.from=e.scaleRange(-t.delta).min),l&&(this.filterAxes(),this.redrawSlaves()),i.set(r.from,r.to),this.showHint(this.options.select.from,this.options.select.to))},_zoomEnd:function(n){this._dragEnd(n)},showHint:function(n,t){var i=this.chart._plotArea;this.hint&&this.hint.show(n,t,i.backgroundBox())},_selectStart:function(n){return this.chart._selectStart(n)},_select:function(n){return this.showHint(n.from,n.to),this.chart._select(n)},_selectEnd:function(n){return this.hint&&this.hint.hide(),this.readSelection(),this.filterAxes(),this.filter(),this.redrawSlaves(),this.chart._selectEnd(n)},mainAxis:function(){var n=this.chart._plotArea;if(n)return n.namedCategoryAxes[u]},select:function(n,t){var i=this.options.select;return n&&t&&(i.from=this.parseDate(n),i.to=this.parseDate(t),this.filterAxes(),this.filter(),this.redrawSlaves(),this.selection.set(n,t)),{from:i.from,to:i.to}}});o.setup=function(n,i){if(n===void 0&&(n={}),i===void 0&&(i={}),!n.__navi){n.__navi=!0;var r=t({},i.navigator,n.navigator),e=n.panes=[].concat(n.panes),u=t({},r.pane,{name:f});r.visible||(u.visible=!1,u.height=.1);e.push(u);o.attachAxes(n,r);o.attachSeries(n,r,i)}};o.attachAxes=function(i,r){var c=r.series||[],l=i.categoryAxis=[].concat(i.categoryAxis),a=i.valueAxis=[].concat(i.valueAxis),v=n.filterSeriesByType(c,s.EQUALLY_SPACED_SERIES),h=v.length===0,e=t({type:"date",pane:f,roundToBaseUnit:!h,justified:h,_collapse:!1,majorTicks:{visible:!0},tooltip:{visible:!1},labels:{step:1},autoBind:r.autoBindElements,autoBaseUnitSteps:{minutes:[1],hours:[1,2],days:[1,2],weeks:[],months:[1],years:[1]}}),o=r.categoryAxis;l.push(t({},e,{maxDateGroups:200},o,{name:u,title:null,baseUnit:"fit",baseUnitStep:"auto",labels:{visible:!1},majorTicks:{visible:!1}}),t({},e,o,{name:u+"_labels",maxDateGroups:20,baseUnitStep:"auto",plotBands:[],autoBaseUnitSteps:{minutes:[]},_overlap:!0}),t({},e,o,{name:u+"_ticks",maxDateGroups:200,majorTicks:{width:.5},plotBands:[],title:null,labels:{visible:!1,mirror:!0},_overlap:!0}));a.push(t({name:u,pane:f,majorGridLines:{visible:!1},visible:!1},r.valueAxis))};o.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.autoBindElements}))};y=28;a=e.extend({applyDefaults:function(i,r){var f=n.elementSize(this.element).width||s.DEFAULT_WIDTH,u=r,h={seriesDefaults:{categoryField:i.dateField},axisDefaults:{categoryAxis:{name:"default",majorGridLines:{visible:!1},labels:{step:2},majorTicks:{visible:!1},maxDateGroups:Math.floor(f/y)}}};u&&(u=t({},u,h));o.setup(i,u);e.fn.applyDefaults.call(this,i,u)},_setElementClass:function(t){n.addClass(t,"k-chart k-stockchart")},setOptions:function(n){this.destroyNavigator();e.fn.setOptions.call(this,n)},_resize:function(){var n=this.options.transitions;this.options.transitions=!1;this._fullRedraw();this.options.transitions=n},_redraw:function(){var n=this.navigator;!this._dirty()&&n&&n.options.partialRedraw?n.redrawSlaves():this._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.navigator;n||(n=this.navigator=new o(this),this.trigger("navigatorCreated",{navigator:n}));n.setRange();e.fn._redraw.call(this);n.initSelection()},_trackSharedTooltip:function(n){var i=this._plotArea,t=i.paneByPoint(n);t&&t.options.name===f?this._unsetActivePoint():e.fn._trackSharedTooltip.call(this,n)},bindCategories:function(){e.fn.bindCategories.call(this);this.copyNavigatorCategories()},copyNavigatorCategories:function(){for(var n,r=[].concat(this.options.categoryAxis),t,i=0;i<r.length;i++)n=r[i],n.name===u?t=n.categories:t&&n.pane===f&&(n.categories=t)},destroyNavigator:function(){this.navigator&&(this.navigator.destroy(),this.navigator=null)},destroy:function(){this.destroyNavigator();e.fn.destroy.call(this)},_stopDragEvent:function(n){var i=this._eventCoordinates(n),t=this._plotArea.paneByPoint(i);return e.fn._stopDragEvent.call(this,n)||t&&t.options.name===f}});n.setDefaultOptions(a,{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},line:{width:2}},hint:{},visible:!0},tooltip:{visible:!0},legend:{visible:!1}});kendo.deepExtend(kendo.dataviz,{constants:w,Navigator:o,NavigatorHint:h,StockChart:a})})()},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("dataviz/stock/stock-chart",["dataviz/stock/kendo-stock-chart"],n)}(function(){(function(n){function s(n,t){return[{field:"Date",operator:"gte",value:n},{field:"Date",operator:"lt",value:t}]}var i=window.kendo,t=i.dataviz,h=t.ChartInstanceObserver,r=t.ui.Chart,c=t.StockChart,u=t.constants,f=u.NAVIGATOR_AXIS,l=u.NAVIGATOR_PANE,e=i.deepExtend,a=t.defined,v=n.proxy,o="change",y=h.extend({handlerMap:{navigatorFilter:"_onNavigatorFilter",navigatorCreated:"_onNavigatorCreated"}}),p=r.extend({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}},_createChart:function(n,t){this._initNavigatorOptions(n);this._instance=new c(this.element[0],n,t,{observer:new y(this),sender:this,rtl:this._isRtl()})},_initNavigatorOptions:function(n){var t=n.navigator||{},r=i.support,u=r.touch,f=r.browser.mozilla;e(t,{autoBindElements:!t.dataSource,partialRedraw:t.dataSource,liveDrag:!u&&!f})},_initDataSource:function(n){var o=n||{},f=o.dataSource,c=f&&f.serverFiltering,l=[].concat(o.categoryAxis)[0],a=o.navigator||{},u=a.select,v=u&&u.from&&u.to;if(c&&v){var y=[].concat(f.filter||[]),p=i.parseDate(u.from),h=i.parseDate(u.to),w=new t.DateCategoryAxis(e({baseUnit:"fit"},l,{categories:[p,h]}),i);f.filter=s(w.range().min,h).concat(y)}r.fn._initDataSource.call(this,n)},_onNavigatorCreated:function(n){this._instance=n.sender;this.options=n.sender.options;this._navigator=this.navigator=n.navigator;this._initNavigatorDataSource()},_initNavigatorDataSource:function(){var t=this.options.navigator,n=t.autoBind,r=t.dataSource;r&&(this._navigatorDataChangedHandler=this._navigatorDataChangedHandler||v(this._onNavigatorDataChanged,this),this._navigatorDataSource=i.data.DataSource.create(r).bind(o,this._navigatorDataChangedHandler),a(n)||(n=this.options.autoBind),n&&this._navigatorDataSource.fetch())},_onNavigatorDataChanged:function(){for(var n=this,a=n._instance,o=n.options.series,v=o.length,s=n.options.categoryAxis,i,y=s.length,h=n._navigatorDataSource.view(),u,t,c,e,r=0;r<v;r++)u=o[r],u.axis==f&&n._isBindable(u)&&(u.data=h);for(i=0;i<y;i++)t=s[i],t.pane==l&&(t.name==f?(n._bindCategoryAxis(t,h,i),c=t.categories):t.categories=c);a._model&&(e=this.navigator,e.redraw(),e.setRange(),(!n.options.dataSource||n.options.dataSource&&n._dataBound)&&e.redrawSlaves())},_bindCategories:function(){r.fn._bindCategories.call(this);this._instance&&this._instance.copyNavigatorCategories()},_onDataChanged:function(){r.fn._onDataChanged.call(this);this._dataBound=!0},setOptions:function(n){this._removeNavigatorDataSource();this._initNavigatorOptions(n);this._instance.destroyNavigator();r.fn.setOptions.call(this,n)},_onNavigatorFilter:function(n){this.dataSource.filter(s(n.from,n.to))},requiresHandlers:function(n){if(t.inArray("navigatorFilter",n)){var i=this.dataSource,u=i&&i.options.serverFiltering;return u&&this.options.navigator.dataSource}return r.fn.requiresHandlers.call(this,n)},_removeNavigatorDataSource:function(){var n=this._navigatorDataSource;n&&(n.unbind(o,this._navigatorDataChangedHandler),delete this._navigatorDataSource)},destroy:function(){r.fn.destroy.call(this);this._removeNavigatorDataSource()}});t.ui.plugin(p)})(window.kendo.jQuery)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.dataviz.stock",["dataviz/stock/kendo-stock-chart","dataviz/stock/stock-chart"],n)}(function(){},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("dataviz/sparkline/kendo-sparkline",["kendo.dataviz.chart"],n)}(function(){(function(){function o(n){for(var i,r=[],t=0;t<n.length;t++)i=n[t],r[t]=i.style.display,i.style.display="none";return r}function s(n,t){for(var i=0;i<n.length;i++)n[i].style.display=t[i]}function h(t){return n.isNumber(t)?[t]:t}var f;window.kendo.dataviz=window.kendo.dataviz||{};var n=kendo.dataviz,t=n.constants,r=n.Chart,i=n.elementSize,u=n.deepExtend,c=-2,l=n.SharedTooltip.extend({_slotAnchor:function(t,i){var f=this.plotArea.categoryAxis,r=f.options.vertical,e=r?{horizontal:"left",vertical:"center"}:{horizontal:"center",vertical:"bottom"},u;return u=r?new n.Point(this.plotArea.box.x2,i.center().y):new n.Point(i.center().x,c),{point:u,align:e}},_defaultAnchor:function(n,t){return this._slotAnchor({},t)}}),a=150,v=150,e=[t.BAR,t.BULLET];f=r.extend({_setElementClass:function(t){n.addClass(t,"k-sparkline")},_initElement:function(n){r.fn._initElement.call(this,n);this._initialWidth=Math.floor(i(n).width)},_resize:function(){var n=this.element,t=o(n.childNodes);this._initialWidth=Math.floor(i(n).width);s(n.childNodes,t);r.fn._resize.call(this)},_modelOptions:function(){var f=this.options,n=this._surfaceWrap(),e=o(n.childNodes),r=document.createElement("span"),t;return r.innerHTML="&nbsp;",n.appendChild(r),t=u({width:this._autoWidth,height:i(n).height,transitions:f.transitions},f.chartArea,{inline:!0,align:!1}),i(n,{width:t.width,height:t.height}),n.removeChild(r),s(n.childNodes,e),this.surface.resize(),t},_surfaceWrap:function(){if(!this.stage){var n=this.stage=document.createElement("span");this.element.appendChild(n)}return this.stage},_createPlotArea:function(n){var t=r.fn._createPlotArea.call(this,n);return this._autoWidth=this._initialWidth||this._calculateWidth(t),t},_calculateWidth:function(r){for(var f,u,h,p,e,c=this.options,l=n.getSpacing(c.chartArea.margin),y=r.charts,w=this._surfaceWrap(),o=0,s=0;s<y.length;s++)if(f=y[s],u=(f.options.series||[])[0],u){if(u.type===t.BAR)return a;if(u.type===t.BULLET)return v;if(u.type===t.PIE)return i(w).height;h=f.categoryAxis;h&&(p=h.options.categories.length*(!f.options.isStacked&&n.inArray(u.type,[t.COLUMN,t.VERTICAL_BULLET])?f.seriesOptions.length:1),o=Math.max(o,p))}return e=o*c.pointWidth,e>0&&(e+=l.left+l.right),e},_createSharedTooltip:function(n){return new l(this._plotArea,n)}});f.normalizeOptions=function(t){var i=h(t);return i=n.isArray(i)?{seriesDefaults:{data:i}}:u({},i),i.series||(i.series=[{data:h(i.data)}]),u(i,{seriesDefaults:{type:i.type}}),(n.inArray(i.series[0].type,e)||n.inArray(i.seriesDefaults.type,e))&&(i=u({},{categoryAxis:{crosshair:{visible:!1}}},i)),i};n.setDefaultOptions(f,{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}]});kendo.deepExtend(kendo.dataviz,{Sparkline:f})})()},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("dataviz/sparkline/sparkline",["dataviz/sparkline/kendo-sparkline"],n)}(function(){(function(n){var t=kendo.dataviz,r=t.ui.Chart,u=t.Sparkline,f=t.ChartInstanceObserver,e=n.extend,o=r.extend({init:function(n,t){var i=t;i instanceof kendo.data.ObservableArray&&(i={seriesDefaults:{data:i}});r.fn.init.call(this,n,u.normalizeOptions(i))},_createChart:function(n,t){this._instance=new u(this.element[0],n,t,{observer:new f(this),sender:this,rtl:this._isRtl()})},_createTooltip:function(){return new i(this.element,e({},this.options.tooltip,{rtl:this._isRtl()}))},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}]}}),i;t.ui.plugin(o);i=t.Tooltip.extend({options:{animation:{duration:0}},_hideElement:function(){this.element&&this.element.hide().remove()}});t.SparklineTooltip=i})(window.kendo.jQuery)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.dataviz.sparkline",["dataviz/sparkline/kendo-sparkline","dataviz/sparkline/sparkline"],n)}(function(){},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("dataviz/map/location",["kendo.drawing","util/main"],n)}(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,s=e.drawing.util,nt=s.defined,c=s.deg,o=s.rad,v=s.round,l=s.valueOrDefault,i=e.util.sqr,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,s){f=o(f);s=s||a.map.datums.WGS84;var l=o(this.lat),p=o(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=o(f.lng-this.lng),vt=y((1-nt)*b(o(this.lat))),tt=r(vt),w=u(vt),yt=y((1-nt)*b(o(f.lat))),it=r(yt),p=u(yt),rt=at,pt,kt=this.DISTANCE_ITERATIONS,wt=!1,ut,ft,k,g,et,s,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),s=0,g!==0&&(s=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*(s+ot*et*(-1+2*i(s)))),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*(s+lt/4*(et*(-1+2*i(s))-lt/6*s*(-3+4*i(k))*(-3+4*i(s)))),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)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("dataviz/map/attribution",["kendo.drawing"],n)}(function(){(function(){var n=window.kendo,t=n.ui.Widget,u=n.template,i=n.drawing.util,r=i.valueOrDefault,f=i.defined,e=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){f(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 r,i,n=[],f=u(this.options.itemTemplate),t=0;t<this.items.length;t++)r=this.items[t],i=this._itemText(r),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=r(n,-Number.MAX_VALUE),t=r(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(e)})(window.kendo.jQuery)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("dataviz/map/navigator",["kendo.core"],n)}(function(){(function(n){function r(n){return t.format('<button class="k-button k-navigator-{0}" aria-label="move {0}"><span class="k-icon k-i-arrow-60-{0}"/><\/button>',n)}var t=window.kendo,u=t.ui.Widget,i=t.keys,f=n.proxy,e=".kendoNavigator",o=r("up")+r("right")+r("down")+r("left"),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-up")?u=1:i.is(".k-navigator-down")?u=-1:i.is(".k-navigator-right")?r=1:i.is(".k-navigator-left")&&(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)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("dataviz/map/zoom",["kendo.core"],n)}(function(){(function(n){function f(n,i){return t.format('<button class="k-button k-zoom-{0}" title="zoom-{0}" aria-label="zoom-{0}"><span class="k-icon {1}"><\/span><\/button>',n,i)}var t=window.kendo,i=t.ui.Widget,r=t.keys,u=n.proxy,e=".kendoZoomControl",o=f("in","k-i-plus")+f("out","k-i-minus"),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 k-button-group k-group-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)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("dataviz/map/crs",["dataviz/map/location","kendo.drawing"],n)}(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.drawing.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)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("dataviz/map/layers/base",["kendo.core","dataviz/map/location"],n)}(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.drawing.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)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("dataviz/map/layers/shape",["dataviz/map/layers/base","dataviz/map/location"],n)}(function(){(function(n){var f=n.proxy,t=window.kendo,a=t.Class,v=t.data.DataSource,e=t.dataviz,o=t.deepExtend,y=t.geometry,i=t.drawing,u=i.Group,p=i.util.last,w=i.util.defined,s=e.map,h=s.Location,r=s.layers.Layer,c=r.extend({init:function(n,u){this._pan=f(this._pan,this);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=f(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 l(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=w(this._createMarker(n))),t||(r={layer:this,shape:n},t=this.map.trigger("shapeCreated",r)),t},featureCreated:function(n){n.layer=this;this.map.trigger("shapeFeatureCreated",n)},_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=[]},_pan:function(){this._panning||(this._panning=!0,this.surface.suspendTracking())},_panEnd:function(n){r.fn._panEnd.call(this,n);this._translateSurface();this.surface.resumeTracking();this._panning=!1},_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)}}},_activate:function(){r.fn._activate.call(this);this.map.bind("pan",this._pan)},_deactivate:function(){r.fn._deactivate.call(this);this.map.unbind("pan",this._pan)}}),l=a.extend({init:function(n,t,i){this.observer=i;this.locator=n;this.style=t},parse:function(n){var t=new u,i=!0;return n.type==="Feature"?(i=!1,this._loadGeometryTo(t,n.geometry,n),this._featureCreated(t,n)):this._loadGeometryTo(t,n,n),i&&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},_featureCreated:function(n,t){this.observer&&this.observer.featureCreated&&this.observer.featureCreated({group:n,dataItem:t,properties:t.properties})},_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(p(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(h.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=h.fromLngLat(t),e=this.locator.locationToView(f),o=new y.Circle(e,10),u=new i.Circle(o,this.style);return u.dataItem=r,u.location=f,this._loadShape(n,u)}});o(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"}}}});o(e,{map:{layers:{shape:c,ShapeLayer:c},GeoJSONLoader:l}})})(window.kendo.jQuery)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("dataviz/map/layers/bubble",["dataviz/map/layers/shape"],n)}(function(){(function(){var n=window.kendo,i=n.getter,t=n.dataviz,o=n.deepExtend,s=n.geometry,r=n.drawing,h=r.util,u=h.defined,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],r=i(t.locationField)(e),o=i(t.valueField)(e);if(u(r)&&u(o)){l||(l=new a([0,o],[t.minSize,t.maxSize]));r=c.create(r);var v=this.map.locationToView(r),y=l.map(o),s=this._createSymbol({center:v,size:y,style:t.style,dataItem:e,location:r});s.dataItem=e;s.location=r;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 s.Circle(n.center,n.size/2);return new r.Circle(t,n.style)},square:function(n){var u=new r.Path(n.style),t=n.size/2,i=n.center;return u.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(),u}};o(t,{map:{layers:{bubble:e,BubbleLayer:e},scales:{sqrt:a},symbols:v}})})(window.kendo.jQuery)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("dataviz/map/layers/tile",["dataviz/map/layers/base","dataviz/map/location"],n)}(function(){(function(n){function g(n){return new f(a(n.x),a(n.y))}var i=Math,e=n.proxy,t=window.kendo,u=t.Class,o=t.template,s=t.dataviz,b=t.deepExtend,k=t.geometry,f=k.Point,r=s.map.layers.Layer,h=t.util,c=h.renderSize,l=t.drawing.util,a=l.round,d=l.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},_beforeReset:function(){var n=this.map,t=n.locationToLayer(n.extent().nw).round();this._view.viewOrigin(t)},_reset:function(){r.fn._reset.call(this);this._updateView();this._view.reset()},_viewType:function(){return y},_activate:function(){r.fn._activate.call(this);t.support.mobileOS||(this._pan||(this._pan=t.throttle(e(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=u.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},viewOrigin:function(n){this._viewOrigin=n},zoom:function(n){this._zoom=n},pointToTileIndex:function(n){return new f(i.floor(n.x/this.options.tileSize),i.floor(n.y/this.options.tileSize))},tileCount:function(){var n=this.size(),u=this.pointToTileIndex(this._extent.nw),t=this._extent.nw,r=this.indexToPoint(u).translate(-t.x,-t.y);return{x:i.ceil((i.abs(r.x)+n.width)/this.options.tileSize),y:i.ceil((i.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 f(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.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._viewOrigin,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 t=i.pow(2,this._zoom);return{x:this.wrapValue(n.x,t),y:d(n.y,0,t-1)}},wrapValue:function(n,t){var r=i.abs(n)%t;return n>=0?r:t-(r===0?t:r)}}),p=u.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;' alt='' />").css({width:this.options.size,height:this.options.size}).on("error",e(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=c(this.options.offset.y);n.style.left=c(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=o(this.options.urlTemplate);return n(this.urlOptions())},errorUrl:function(){var n=o(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=u.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,u=h.hashKey(n.point.toString()+n.offset.toString()+n.zoom+n.urlTemplate),i=0;i<r.length;i++)if(r[i].id===u){t=r[i];break}return t?t.show():(t=new p(u,n),this._items.push(t)),t},_remove:function(n){for(var u,t=this._items,f=-1,r=-1,i=0;i<t.length;i++)u=t[i].options.point.distanceTo(n),u>f&&!t[i].visible&&(r=i,f=u);r!==-1&&(t[r].destroy(),t.splice(r,1))}});b(s,{map:{layers:{tile:v,TileLayer:v,ImageTile:p,TilePool:w,TileView:y}}})})(window.kendo.jQuery)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("dataviz/map/layers/bing",["dataviz/map/layers/tile"],n)}(function(){(function(n){var i=window.kendo,t=i.dataviz,r=i.deepExtend,u=i.drawing.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){this.options.baseUrl=this._scheme()+"://dev.virtualearth.net/REST/v1/Imagery/Metadata/";e.fn.init.call(this,t,i);this._onMetadata=n.proxy(this._onMetadata,this);this._fetchMetadata()},options:{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()},type:"get",dataType:"jsonp",jsonp:"jsonp",success:this._onMetadata})},_scheme:function(n){return n=n||window.location.protocol,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();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)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("dataviz/map/layers/marker",["dataviz/map/layers/base","dataviz/map/location","kendo.data","kendo.tooltip"],n)}(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-icon k-i-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)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("dataviz/map/main",["dataviz/map/crs","dataviz/map/location"],n)}(function(){(function(n){var d=document,r=Math,p=r.min,l=r.pow,i=n.proxy,t=window.kendo,o=t.ui.Widget,w=t.deepExtend,u=t.dataviz,f=u.ui,s=t.geometry,b=s.Point,h=u.map,a=h.Extent,e=h.Location,g=h.crs.EPSG3857,nt=t.util,k=nt.renderPos,v=t.drawing.util,tt=v.defined,c=v.limitValue,y=v.valueOrDefault,it="k-",rt=.9,ut=.93,ft="DOMMouseScroll mousewheel",et=5,ot=o.extend({init:function(n,r){t.destroy(n);o.fn.init.call(this,n);this._initOptions(r);this.bind(this.events,r);this.crs=new g;this.element.addClass(it+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=i(this._mousewheel,this);this.element.bind("click",i(this._click,this));this.element.bind(ft,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","markerActivate","markerClick","markerCreated","pan","panEnd","reset","shapeClick","shapeCreated","shapeFeatureCreated","shapeMouseEnter","shapeMouseLeave","zoomEnd","zoomStart"],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 tt(n)?(n=r.round(c(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=b.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=b.create(n),n=n.clone().translateWith(i),this.layerToLocation(n,t)},eventOffset:function(n){var i=this.element.offset(),t=n.originalEvent||n,r=y(t.pageX,t.clientX)-i.left,u=y(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=p(i,n)),{width:n,height:p(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 u=a.create(n),i=u.se.clone(),f,e,t;for(this.options.wraparound&&i.lng<0&&n.nw.lng>0&&(i.lng=180+(180+i.lng)),n=new a(u.nw,i),this.center(n.center()),f=this.element.width(),e=this.element.height(),t=this.options.maxZoom;t>=this.options.minZoom;t--){var o=this.locationToLayer(n.nw,t),s=this.locationToLayer(n.se,t),h=r.abs(s.x-o.x),c=r.abs(s.y-o.y);if(h<=f&&c<=e)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 a(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);t.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"),t=this.navigator=new f.Navigator(r,n);this._navigatorPan=i(this._navigatorPan,this);t.bind("pan",this._navigatorPan);this._navigatorCenter=i(this._navigatorCenter,this);t.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=c(r,i.x.min,i.x.max-o);u=c(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 t=this._createControlElement(n,"topLeft"),r=this.zoomControl=new f.ZoomControl(t,n);this._zoomControlChange=i(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=t.support.mobileOS?ut:rt,u=this.options.zoomable!==!1,n=this.scroller=new t.mobile.ui.Scroller(this.element.children(0),{friction:r,velocityMultiplier:et,zoom:u,mousewheelScrolling:!1});n.bind("scroll",i(this._scroll,this));n.bind("scrollEnd",i(this._scrollEnd,this));n.userEvents.bind("gesturestart",i(this._scaleStart,this));n.userEvents.bind("gestureend",i(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,w({},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=l(2,this.options.minZoom-f);t.dimensions.maxScale=l(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,w({},o,i)))}},_layerSize:function(n){return n=y(n,this.options.zoom),this.options.minSize*l(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=c(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(ot)})(window.kendo.jQuery)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.dataviz.map",["kendo.data","kendo.userevents","kendo.tooltip","kendo.mobile.scroller","kendo.draganddrop","kendo.dataviz.core","dataviz/map/location","dataviz/map/attribution","dataviz/map/navigator","dataviz/map/zoom","dataviz/map/crs","dataviz/map/layers/base","dataviz/map/layers/shape","dataviz/map/layers/bubble","dataviz/map/layers/tile","dataviz/map/layers/bing","dataviz/map/layers/marker","dataviz/map/main"],n)}(function(){return window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("dataviz/diagram/utils",["kendo.core"],n)}(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)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("dataviz/diagram/math",["dataviz/diagram/utils","kendo.dataviz.core"],n)}(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)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("dataviz/diagram/svg",["kendo.drawing","dataviz/diagram/math"],n)}(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],k(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 g(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 r=t.x-n.x,u=t.y-n.y;return i.util.deg(Math.atan2(u,r))}function a(n,t){return new i.Segment(new e.Point(n,t))}function oi(n){if(n)return new e.Rect([n.x,n.y],[n.width,n.height])}var o=window.kendo,c=o.dataviz.diagram,v=o.Class,f=o.deepExtend,y=c.Point,b=c.Rect,p=c.Matrix,kt=c.Utils,k=kt.isNumber,ut=kt.isString,si=c.MatrixVector,e=o.geometry,i=o.drawing,u=i.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,d,ui,wt,fi;c.Markers=nt;var it=v.extend({init:function(n,t){this.x=n;this.y=t},toMatrix:function(){return p.scaling(this.x,this.y)},toString:function(){return o.format("scale({0},{1})",this.x,this.y)},invert:function(){return new it(1/this.x,1/this.y)}}),w=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 p.translation(this.x,this.y)},toString:function(){return o.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 w(-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?o.format("rotate({0},{1},{2})",this.angle,this.x,this.y):o.format("rotate({0})",this.angle)},toMatrix:function(){return p.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 w(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=p.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():p.unit(),u=this.scale?this.scale.invert():t,o=u?u.toMatrix():p.unit(),i=new y(-this.translate.x,-this.translate.y),f,n;return i=e.times(o).apply(i),f=new w(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;k(n)||(n=1);k(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 w(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=f({},t.options,n);t.id=t.options.id;t._originSize=b.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 w(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 e.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 e.Rect,r=i.topLeft(),t=new b(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=g(n.fill);n.stroke=g(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(g(t));i&&this._fill(g(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?g(t.fill):r.fill,u.fill(i.color,i.opacity))},_stroke:function(n){var i=this.options,t;f(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,e;f(u,{fill:n||{}});t=u.fill;t.gradient?(r=t.gradient,e=r.type==="radial"?i.RadialGradient:i.LinearGradient,this.drawingElement.fill(new e(r))):this.drawingElement.fill(t.color,t.opacity)}}),ni=r.extend({init:function(n){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 e.Point,{font:n.font});this._fill();this._stroke()},_textColor:function(n){return n&&n.color&&(n=f({},n,{fill:{color:n.color}})),n},_font:function(){var n=this.options,t;n.fontFamily&&u(n.fontSize)?(t=[],n.fontStyle&&t.push(n.fontStyle),n.fontWeight&&t.push(n.fontWeight),t.push(n.fontSize+(k(n.fontSize)?"px":"")),t.push(n.fontFamily),n.font=t.join(" ")):delete n.font},content:function(n){return this.drawingElement.content(n)},redraw:function(n){if(n){var t=!1,i=this.options;n=this._textColor(n);r.fn.redraw.call(this,n);(n.fontFamily||u(n.fontSize)||n.fontStyle||n.fontWeight)&&(f(i,{fontFamily:n.fontFamily,fontSize:n.fontSize,fontStyle:n.fontStyle,fontWeight:n.fontWeight}),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()}}});f(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 e.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 e.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(e.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),o=f.start,t=f.end,i=e.transform(),r,u;o&&i.rotate(li(o,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,e=this._getPath(t),i,r;if(!e){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(f({},n,{position:t})),r.positionMarker(e),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,e=i[r],o=!1;return e?(u[r]=f({},u[r],e),e.type&&s!=e.type?(this._removeMarker(t),this._markers[t]=this._createMarker(u[r],t),o=!0):this._markers[t]&&this._markers[t].redraw(e)):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)}});f(vt.fn,rt);f(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)])}});f(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:[]}});f(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 e.Point(n.x,n.y),i=new e.Size(n.width,n.height);return new e.Rect(t,i)}});d=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=k(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?e.Rect.union(n,i):i));return n}});f(d.fn,rt);ui=d.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 b(t.origin.x,t.origin.y,t.size.width,t.size.height)}},reflow:function(){this.drawingElement.reflow()},redraw:function(n){o.deepExtend(this.drawingElement.options,n);d.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&&(f(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,o;u(t)||(u(r)||(r=f),u(f)||(f=r),n.radius=t=Math.min(r,f)/2);o=n.center||{x:t,y:t};this._center=new e.Point(o.x,o.y);this._circle=new e.Circle(this._center,t);this.drawingElement=new i.Circle(this._circle,{stroke:n.stroke});this._fill()}});f(wt.fn,rt);fi=v.extend({init:function(n,t){t=t||{};this.element=n;this.surface=i.Surface.create(n,t);o.isFunction(this.surface.translate)&&(this.translate=this._translate);this.drawingElement=new i.Group;this._viewBox=new b(0,0,t.width,t.height);this.size(this._viewBox)},bounds:function(){var n=this.drawingElement.clippedBBox();return new b(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()}});o.deepExtend(c,{init:function(n){o.init(n,c.ui)},diffNumericOptions:gt,Element:h,Scale:it,Translation:w,Rotation:s,Circle:wt,Group:d,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)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("dataviz/diagram/services",["kendo.drawing","dataviz/diagram/svg"],n)}(function(){(function(n,t){function c(n,t){return t.charCodeAt(0)==n||t.toUpperCase().charCodeAt(0)==n}function nu(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 y(n){var t=n.options.editable;return t&&t.drag!==!1}function ru(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(a,a),u.contains(t))return i}function ri(n){return n.ctrlKey===!1&&n.altKey===!1&&n.shiftKey===!1}var e=window.kendo,ui=e.dataviz,u=ui.diagram,r=e.Class,fi=u.Group,o=u.Rect,b=u.Rectangle,l=u.Utils,ei=l.isUndefined,i=u.Point,k=u.Circle,oi=u.Ticker,f=e.deepExtend,si=e.ui.Movable,et=e.support.browser,ot=e.drawing.util,h=ot.defined,d=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"},a=10,ht="Auto",g="Top",ct="Right",nt="Left",lt="Bottom",hi=10,ci=10,tt="dragStart",it="drag",rt="dragEnd",li="itemRotate",ut="itemBoundsChange",ai=5,vi=5,yi="mouseEnter",pi="mouseLeave",wi="zoomStart",bi="zoomEnd",ki=-2e4,di=2e4,gi=.9,nr=.93,tr=5,at="transparent",ir="pan",vt="rotated",p="target",rr={"-1":"source","1":p};u.Cursors=s;var ur=e.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))}}),fr=r.extend({init:function(n,t,i){this.animate=ei(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 oi;i.addAdapter(new ur(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()}}),er=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()}}),or=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()}}),sr=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)}}),hr=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())}}),cr=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)}}),lr=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)}}),ar=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())}}),vr=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)}}),yr=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)}}),pr=e.Observable.extend({init:function(n){e.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}}),kt=bt.extend({init:function(t){var i=this,s=e.support.mobileOS?nr:gi,f;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:tr,mousewheelScrolling:!1,zoom:!1,scroll:st(i._move,i)}).data("kendoMobileScroller");o.translate&&(i.movableCanvas=new si(o.element));f=function(n,t,i){n.makeVirtual();n.virtualSize(t||ki,i||di)};f(u.dimensions.x);f(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"]:ri(t)&&!h(r.hoveredItem)),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(ir,{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,u=i.diagram,r=i.hoveredItem;r&&(i.selectSingle(r,t),r.adorner&&(this.adorner=r.adorner,this.handle=this.adorner._hitTest(n)));this.handle||(this.handle=u._resizingAdorner._hitTest(n),this.handle&&(this.adorner=u._resizingAdorner));this.adorner&&(this.adorner.isDragHandle(this.handle)&&u.trigger(tt,{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(it,{shapes:this.adorner.shapes,connections:[]}))},end:function(){var r=this.toolService.diagram,n=this.adorner,i;n&&(n.isDragHandle(this.handle)&&r.trigger(rt,{shapes:n.shapes,connections:[]})?n.cancel():(i=n.stop(),i&&r.undoRedoService.add(i,!1)));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 r=this.toolService,i=r.diagram.options.selectable,u=i&&i.multiple!==!1;return u&&(u=i.key&&i.key!="none"?t[i.key+"Key"]:ri(t)),u&&!h(r.hoveredItem)&&!h(r.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 i=this.toolService,u=i.diagram,f=i._hoveredConnector,r=u._createConnection({},f._c,n);y(r)&&!u.trigger(tt,{shapes:[],connections:[r],connectionHandle:p})&&u._addConnection(r)?(i._connectionManipulation(r,f._c.shape,!0),i._removeHover(),i.selectSingle(i.activeConnection,t),t.type=="touchmove"&&(u._cachedTouchTarget=f.visual)):(r.source(null),i.end(n))},move:function(n){var t=this.toolService,i=t.activeConnection;return i.target(n),t.diagram.trigger(it,{shapes:[],connections:[i],connectionHandle:p}),!0},end:function(n){var r=this.toolService,t=r.diagram,i=r.activeConnection,f=r.hoveredItem,e=r._hoveredConnector,o,s=t._cachedTouchTarget;i&&(o=e&&e._c!=i.sourceConnector?e._c:f&&f instanceof u.Shape?f.getConnector(ht)||f.getConnector(n):n,i.target(o),t.trigger(rt,{shapes:[],connections:[i],connectionHandle:p})?(t.remove(i,!1),t.undoRedoService.pop()):(i.updateModel(),t._syncConnectionChanges()),r._connectionManipulation(),s&&(t._connectorsAdorner.visual.remove(s),t._cachedTouchTarget=null))},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=e!==!1&&i&&i.path&&!(i.isSelected&&t.ctrlKey);return u&&(this._c=i),u},start:function(n,t){var r=this.toolService,u=this._c,i,f,e;r.selectSingle(u,t);i=u.adorner;i&&(f=i._hitTest(n),e=rr[f]);y(u)&&i&&!r.diagram.trigger(tt,{shapes:[],connections:[u],connectionHandle:e})?(this.handle=f,this.handleName=e,i.start(n)):(r.startPoint=n,r.end(n))},move:function(n){var t=this._c.adorner;if(y(this._c)&&t)return t.move(this.handle,n),this.toolService.diagram.trigger(it,{shapes:[],connections:[this._c],connectionHandle:this.handleName}),!0},end:function(n){var t=this._c,u=t.adorner,f=this.toolService,i=f.diagram,r;u&&y(t)&&(r=u.stop(n),i.trigger(rt,{shapes:[],connections:[t],connectionHandle:this.handleName})?r.undo():(i.undoRedoService.add(r,!1),t.updateModel(),i._syncConnectionChanges()))},getCursor:function(){return s.move}});var wr=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=f({},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.diagram.canvas.surface.suspendTracking(),this.startPoint=n,!0},move:function(n,t){t=f({},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=f({},i),this.activeTool&&this.activeTool.end(n,i),this.diagram.canvas.surface.resumeTracking(),this.activeTool=t,this._updateCursor(n),!0},keyDown:function(n,t){var i=this.diagram,r;if(t=f({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(),f=r.options,o=f.zoomRate,u={point:n,meta:t,zoom:i};if(!r.trigger(wi,u))return s<0?i+=o:i-=o,i=e.dataviz.round(Math.max(f.zoomMin,Math.min(f.zoomMax,i)),2),u.zoom=i,r.zoom(i,u),r.trigger(bi,u),!0},setTool:function(n,t){n.toolService=this;this.tools[t]=n},selectSingle:function(n,t){var i=this.diagram,r=i.options.selectable,u;r&&!n.isSelected&&n.options.selectable!==!1&&(u=t.ctrlKey&&r.multiple!==!1,i.select(n,{addToSelection:u}))},_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(pi,{item:this.hoveredItem}),this.hoveredItem._hover(!1)),i&&i.options.enable?(r.trigger(yi,{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&&!ru(t,n)){var f=r.mainLayer,e=d(t.visual,f.children),o=d(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=e.Class.extend({init:function(){}}),w=ft.extend({init:function(n){var t=this;ft.fn.init.call(t);this.connection=n},hitTest:function(n){var t=this.getBounds().inflate(a);return t.contains(n)?u.Geometry.distanceToPolyline(n,this.connection.allPoints())<a:!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)}}),br=w.extend({init:function(n){var t=this;w.fn.init.call(t);this.connection=n},route:function(){}}),kr=w.extend({SAME_SIDE_DISTANCE_RATIO:5,init:function(n){var t=this;w.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 e=n.position(),h=n.shape.bounds(vt),l={topLeft:h.topLeft(),bottomRight:h.bottomRight()},c=this._connectorSides,o=ot.MAX_NUM,f,i,u,r,s=0;s<c.length;s++)r=c[s],u=r.axis,f=Math.round(Math.abs(e[u]-l[r.boundsPoint][u])),f<o?(o=f,i=r):f===o&&(e[u]-t[u])*r.secondarySign>(e[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===g||e==lt?o==g||o==lt?e==o?(l=e==g?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==nt||o==ct?e==o?(c=e==nt?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===nt)?!0:Math.abs(n.x-t.x)>Math.abs(n.y-t.y)}}),v=r.extend({init:function(n,t){var i=this;i.diagram=n;i.options=f({},i.options,t);i.visual=new fi;i.diagram._adorners.push(i)},refresh:function(){}}),dr=v.extend({init:function(n,t){var i=this,r,u,e;i.connection=n;r=i.connection.diagram;i._ts=r.toolService;v.fn.init.call(i,r,t);u=i.connection.sourcePoint();e=i.connection.targetPoint();i.spVisual=new k(f(i.options.handles,{center:u}));i.epVisual=new k(f(i.options.handles,{center:e}));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 or(this.connection,this._initialSource,this._initialTarget)},_hitTest:function(n){var t=this.connection.sourcePoint(),i=this.connection.targetPoint(),u=this.options.handles.width/2+a,f=this.options.handles.height/2+a,e=t.distanceTo(n),s=i.distanceTo(n),h=new o(t.x,t.y).inflate(u,f).contains(n),c=new o(i.x,i.y).inflate(u,f).contains(n),r=0;return h&&(!c||e<s)?r=-1:c&&(!h||s<e)&&(r=1),r},refresh:function(){this.spVisual.redraw({center:this.diagram.modelToLayer(this.connection.sourcePoint())});this.epVisual.redraw({center:this.diagram.modelToLayer(this.connection.targetPoint())})}}),gr=v.extend({init:function(n,t){var i=this;v.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(ut,t._refreshHandler),u=n.connectors.length,t.connectors=[],t._clearVisual(),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()},_clearVisual:function(){var n=this;n.diagram._cachedTouchTarget?n._keepCachedTouchTarget():n.visual.clear()},_keepCachedTouchTarget:function(){for(var t=this,i=t.visual.children,r=i.length,u=d(t.diagram._cachedTouchTarget,i),n=r-1;n>=0;n--)n!=u&&t.visual.remove(i[n])},destroy:function(){var n=this;n.diagram.unbind(ut,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 tu=v.extend({init:function(n,t){var i=this;v.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(ut,i._refreshHandler).bind(li,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=f({},n.options.selectable,i);n.rect=new b(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 b(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,e=u.fill;n&&l.isDefined(r.stroke)&&(i=f({},i,r.stroke));n&&l.isDefined(r.fill)&&(e=r.fill);t.stroke(i.color,i.width,i.opacity);t.fill(e.color,e.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,v,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=nu(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],v=r.bounds(),h){if(!y(r))continue;u=this._displaceBounds(v,c,a,h)}else u=v.clone(),u.scale(nt,tt,g,this._innerBounds.center(),r.rotate().angle),p=u.center(),p.rotate(v.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=v,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||ci,vi);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||hi,ai);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)}}),iu=r.extend({init:function(n){var t=n.options.selectable;this.options=f({},this.options,t);this.visual=new b(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=f({},n.options);this._c=n;this.visual=new k(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=f({},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)}});f(u,{CompositeUnit:yt,TransformUnit:pt,PanUndoUnit:ar,AddShapeUnit:lr,AddConnectionUnit:cr,DeleteShapeUnit:hr,DeleteConnectionUnit:sr,ConnectionEditAdorner:dr,ConnectionTool:ni,ConnectorVisual:ii,UndoRedoService:pr,ResizingAdorner:tu,Selector:iu,ToolService:wr,ConnectorsAdorner:gr,LayoutUndoUnit:fr,ConnectionEditUnit:er,ToFrontUnit:vr,ToBackUnit:yr,ConnectionRouterBase:ft,PolylineRouter:br,CascadingRouter:kr,SelectionTool:gt,ScrollerTool:kt,PointerTool:dt,ConnectionEditTool:ti,RotateUnit:wt})})(window.kendo.jQuery)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("dataviz/diagram/layout",["dataviz/diagram/math"],n)}(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)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("dataviz/diagram/dom",["kendo.data","kendo.draganddrop","kendo.toolbar","kendo.editable","kendo.window","kendo.dropdownlist","kendo.dataviz.core","kendo.dataviz.themes","dataviz/diagram/svg","dataviz/diagram/services","dataviz/diagram/layout"],n)}(function(){(function(n,t){function ff(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 ft(n){return n.options.name.toLowerCase()===g.toLowerCase()}function ii(n,t){for(var u,f=dt,e,i,r=0;r<t.length;r++)i=t[r],ft(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 ef(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 of(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 ei(n){this.dataItem=n;this.callbacks=[]}function oi(){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 h?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 b(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 sf(n){var t=n.drawingContainer().clippedBBox(null);(t.origin.x!==0||t.origin.y!==0)&&n.position(-t.origin.x,-t.origin.y)}function hf(n){n.preventDefault()}var p=kendo.dataviz,nt=kendo.drawing,lt=kendo.geometry,i=p.diagram,at=kendo.ui.Widget,vt=kendo.Class,f=n.proxy,e=kendo.deepExtend,fr=kendo._outerWidth,yt=kendo._outerHeight,er=n.extend,or=kendo.data.HierarchicalDataSource,sr=i.Canvas,pt=i.Group,hr=i.Rectangle,cr=i.Circle,wt=i.CompositeTransform,c=i.Rect,si=i.Path,lr=i.DeleteShapeUnit,ar=i.DeleteConnectionUnit,bt=i.TextBlock,vr=i.Image,u=i.Point,hi=i.Intersect,yr=i.ConnectionEditAdorner,pr=i.UndoRedoService,wr=i.ToolService,br=i.Selector,kr=i.ResizingAdorner,dr=i.ConnectorsAdorner,gr=i.Cursors,s=i.Utils,ci=kendo.Observable,nu=i.ToBackUnit,tu=i.ToFrontUnit,iu=i.PolylineRouter,li=i.CascadingRouter,k=s.isUndefined,y=s.isDefined,r=nt.util.defined,d=n.isArray,ot=kendo.isFunction,st=s.isString,ru=n.isPlainObject,o=Math,uu=["sass","default-v2","bootstrap-v4"],l=".kendoDiagram",ai="cascading",kt="itemBoundsChange",tt="change",rt="click",vi="error",g="Auto",dt=9007199254740992,yi="select",gt="itemRotate",ni="pan",ti="zoomStart",pi="zoomEnd",wi="none",fu=600,eu=600,ou="rectangle",su=100,hu=100,cu=20,lu=20,bi=0,au=Number.MAX_VALUE,vu=-Number.MAX_VALUE,yu="absolute",ki="transformed",ut="rotated",pu="transparent",wu="width",bu="height",ku="x",du="y",gu="DOMMouseScroll"+l+" mousewheel"+l,nf=.05,tf=5,rf='<a class="k-button k-button-icontext #=className#" href="\\#"><span class="#=iconClass# #=imageClass#"><\/span>#=text#<\/a>',uf=5,di,w,a;i.DefaultConnectors=[{name:"Top"},{name:"Bottom"},{name:"Left"},{name:"Right"},{name:g,position:function(n){return n.getPosition("center")}}];di={cancel:{text:"Cancel",imageClass:"k-i-cancel",className:"k-diagram-cancel",iconClass:"k-icon"},update:{text:"Update",imageClass:"k-i-checkmark",className:"k-diagram-update",iconClass:"k-icon"}};i.shapeDefaults=function(n){var t={type:ou,path:"",autoSize:!0,visual:null,x:bi,y:bi,minWidth:cu,minHeight:lu,width:su,height:hu,hover:{},editable:{connect:!0,tools:[]},connectors:i.DefaultConnectors,rotation:{angle:0}};return s.simpleExtend(t,n),t};w=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 pt({id:t.options.id,autoSize:t.options.autoSize});t.id=t.options.id;t._template()},options:{hover:{},cursor:gr.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(k(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 bt(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]||g,i=0;i<n.shapes.length;i++)if(r=n.shapes[i],r.options.id==f)return r.getConnector(e.trim())};var h=w.extend({init:function(n,t){var i=this;w.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()},updateOptionsFromModel:function(n,t){var i,r;this.diagram&&this.diagram._isEditable&&(i=nr(n||this.dataItem),n&&t?p.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()},redrawVisual:function(){this._redrawVisual();this.options.content&&(this._template(),this.content(this.options.content))},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 yu:t=this._transformedBounds();i=this.diagram._pan;t.x+=i.x;t.y+=i.y;break;case ut: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 h(n.options)},select:function(n){var t=this.diagram,i,r;return k(n)&&(n=!0),this._canSelect()&&this.isSelected!=n?(i=[],r=[],this.isSelected=n,this.isSelected?(t._selectedItems.push(this),i.push(this)):(s.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(gt,{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?ii(n,this.connectors):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,[wu,bu,ku,du])&&(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(kt,{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 hi.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 si(n),sf(i)):i=r=="rectangle"?new hr(n):r=="circle"?new cr(n):r=="text"?new bt(n):r=="image"?new vr(n):new si(n);this.shapeVisual=i;this.visual.append(this.shapeVisual)}}),v=w.extend({init:function(n,t,f){var e=this;w.fn.init.call(e,f);this.updateOptionsFromModel();this._initRouter();e.path=new i.Polyline(e.options);e.path.fill(pu);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:g,toConnector:g},_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=ef(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?(b("from",t),b("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),b("fromX",t),b("fromY",t)),r(this.options.toX)&&this.options.toX!==null?(b("to",t),b("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),b("toX",t),b("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 h,f=this.options.fromConnector||g,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 h,f=this.options.toConnector||g,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 bt(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=uf,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=nt.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 yr(this,this.options.selection),i._adorn(this.adorner,!0),i._selectedItems.push(this),r.push(this)):this.adorner&&(i._adorn(this.adorner,!1),s.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 iu(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 r=this,e,o,f,i,n=r.source(),t=r.target();n instanceof u?e=n:n instanceof a&&(f=ft(n)?n.shape.connectors:[n]);t instanceof u?o=t:t instanceof a&&(i=ft(t)?t.shape.connectors:[t]);e?i&&(r._resolvedTargetConnector=ii(e,i)):f&&(o?r._resolvedSourceConnector=ii(o,f):i&&this._resolveAutoConnectors(f,i))},_resolveAutoConnectors:function(n,t){for(var v=dt,y=dt,s,p,h,c,l,a,i,r,e,u,f=0;f<n.length;f++)if(i=n[f],!ft(i))for(h=i.position(),e=0;e<t.length;e++)r=t[e],ft(r)||(c=r.position(),u=o.round(h.distanceTo(c)),u<v&&this.diagram&&this._testRoutePoints(h,c,i,r)&&(v=u,s=i,p=r),u<y&&(l=i,a=r,y=u));s&&(l=s,a=p);this._resolvedSourceConnector=l;this._resolvedTargetConnector=a},_testRoutePoints:function(n,t,i,r){var l=this._router,a=!0,f,e,s,u,v,h;if(l instanceof li)for(f=l.routePoints(n,t,i,r),v=this._getRouteExclude(n,t,i.shape,r.shape),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,v)){a=!1;break}return a},_getRouteExclude:function(n,t,i,r){var u=[];return this._isPointInsideShape(n,i)&&u.push(i),this._isPointInsideShape(t,r)&&u.push(r),u},_isPointInsideShape:function(n,t){var i=t.bounds(),r,s=t.rotate().angle,u,f,e=i.x,o=i.y;return r=n.clone().rotate(i.center(),s),u=r.x,f=r.y,u>e&&u<e+i.width&&f>o&&f<o+i.height},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&&s.remove(this.sourceConnector.connections,this)},_removeFromTargetConnector:function(){this.targetConnector&&s.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}}}),ri=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._interactionDefaults();i._initCanvas();i.mainLayer=new pt({id:"main-layer"});i.canvas.append(i.mainLayer);i._shapesQuadTree=new ir(i);i._pan=new u;i._adorners=[];i.adornerLayer=new pt({id:"adorner-layer"});i.canvas.append(i.adornerLayer);i._createHandlers();i._initialize();i._resizingAdorner=new kr(i,{editable:i.options.editable});i._connectorsAdorner=new dr(i);i._adorn(i._resizingAdorner,!0);i._adorn(i._connectorsAdorner,!0);i.selector=new br(i);i._clipboard=[];i.pauseMouseHandlers=!1;i._fetchFreshData();i._createGlobalToolBar();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:{},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,ti,ni,yi,gt,kt,tt,rt,"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 ui(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 h(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(of,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 h?"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)},_interactionDefaults:function(){var n=this.options,t=n.selectable,i=n.pannable,u=kendo.support.mobileOS;t&&!r(t.multiple)&&(n.selectable=e({multiple:u?!1:!0},n.selectable));i&&!r(i.key)&&(n.pannable=e({key:u?"none":"ctrl"},n.pannable))},_initCanvas:function(){var i=n("<div class='k-layer'><\/div>").appendTo(this.scrollable)[0],t=this.viewport();this.canvas=new sr(i,{width:t.width||fu,height:t.height||eu})},_createHandlers:function(){var n=this,t=n.element;t.on(gu,f(n._wheel,n)).on("keydown"+l,f(n._keydown,n));n._userEvents=new kendo.UserEvents(this.scrollable,{multiTouch:!0,fastTap:!0,tap:f(n._tap,n),start:f(n._dragStart,n),move:f(n._drag,n),end:f(n._dragEnd,n),gesturestart:f(n._gestureStart,n),gesturechange:f(n._gestureChange,n),gestureend:f(n._gestureEnd,n)});n.toolService=new wr(n);this.scrollable.on("mouseover"+l,f(n._mouseover,n)).on("mouseout"+l,f(n._mouseout,n)).on("mousemove"+l,f(n._mouseMove,n)).on("mousedown"+l,f(n._mouseDown,n)).on("mouseup"+l,f(n._mouseUp,n));this._syncHandler=f(n._syncChanges,n);n._resizeHandler=f(n.resize,n,!1);kendo.onResize(n._resizeHandler);this.bind(ti,f(n._destroyToolBar,n));this.bind(ni,f(n._destroyToolBar,n))},_dragStart:function(n){this._pauseMouseHandlers=!0;var i=this._eventPositions(n,!0),t=n.event;this.toolService.start(i,this._meta(t))&&(this._destroyToolBar(),t.preventDefault())},_drag:function(n){var i=this._eventPositions(n),t=n.event;this.toolService.move(i,this._meta(t))&&t.preventDefault()},_dragEnd:function(n){this._pauseMouseHandlers=!1;var i=this._eventPositions(n),t=n.event;this.toolService.end(i,this._meta(t))&&(this._createToolBar(),t.preventDefault())},_mouseMove:function(n){if(!this._pauseMouseHandlers){var t=this._eventPositions(n);this.toolService._updateHoveredItem(t);this.toolService._updateCursor(t)}},_mouseDown:function(){this._pauseMouseHandlers=!0},_mouseUp:function(){this._pauseMouseHandlers=!1},_tap:function(n){var i=this.toolService,r=this.options.selectable,f=this._eventPositions(n),e=this.focus(),t,o,u;i._updateHoveredItem(f);i.hoveredItem?(t=i.hoveredItem,this.trigger("click",{item:t,point:f}),r&&t.options.selectable!==!1&&(o=r.multiple!==!1,u=kendo.support.mobileOS||this._meta(n.event).ctrlKey,t.isSelected?u?(this._destroyToolBar(),t.select(!1)):this._createToolBar(e):(this._destroyToolBar(),this.select(t,{addToSelection:o&&u}),this._createToolBar(e)))):r&&(this._destroyToolBar(),this.deselect())},_keydown:function(n){this.toolService.keyDown(n.keyCode,this._meta(n))&&n.preventDefault()},_wheel:function(n){var t=ff(n),i=this._eventPositions(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,type:n.type}},_eventPositions:function(n,t){var i,r,f;return n.touch?(r=t?"startLocation":"location",i=new u(n.x[r],n.y[r])):(f=n.originalEvent,i=new u(f.pageX,f.pageY)),this.documentToModel(i)},_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(ti,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)>=nf&&(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)>=tf)&&(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=((n.options||{}).theme||"").toLowerCase(),r=p.ui.themes||{},t;t=uu.indexOf(i)!=-1?p.autoTheme().diagram:(r[i]||{}).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){n=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];return!0}},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(tt,{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 h)r=n;else{if(n instanceof kendo.Class)return;u=e({},u,n||{});r=new h(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(tt,{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=d(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(tt,{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 h?{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 w&&(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 w?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 tu(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 nu(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 w?r=n.bounds(ki):d(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,s,c,l;if(k(n)&&(n="Left"),e=this.select(),e.length!==0){switch(n.toLowerCase()){case"left":case"top":r=au;break;case"right":case"bottom":r=vu}for(f=0;f<e.length;f++)if(t=e[f],t instanceof h)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(s=[],c=[],f=0;f<e.length;f++)if(t=e[f],t instanceof h){c.push(t);s.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,s);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),!k(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.canvas.surface.hideTooltip();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())}else return this._pan.times(-1)},viewport:function(){var n=this.element,i=n.width(),t=n.height();return this.toolBar&&(t-=yt(this.toolBar.element)),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(ut),e=1;e<f.shapes.length;e++)i=f.shapes[e],u=i.bounds(ut),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+=yt(this.toolBar.element)),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;k(n)&&(n=this.options.layout);r=k(n)||k(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=s.first(this.shapes,function(t){return t.visual.id===n}),t)?t:s.first(this.connections,function(t){return t.visual.id===n})},getShapeByModelId:function(n){return this._isEditable?this._dataMap[n]:s.first(this.shapes,function(t){return(t.dataItem||{}).id===n})},getShapeByModelUid:function(n){return this._isEditable?s.first(this.shapes,function(t){return(t.dataItem||{}).uid===n}):this._dataMap[n]},getConnectionByModelId:function(n){var t;return this.connectionsDataSource&&(t=s.first(this.connections,function(t){return(t.dataItem||{}).id===n})),t},getConnectionByModelUid:function(n){var t;return this.connectionsDataSource&&(t=this._connectionsDataMap[n]),t},_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(ni,{total:this._pan,delta:Number.NaN})},_storePan:function(n){this._pan=n;this._storeViewMatrix()},_zoomMainLayer:function(){var n=this._zoom,t=new wt(0,0,n,n);t.render(this.mainLayer);this._storeLayerMatrix(t);this._storeViewMatrix()},_transformMainLayer:function(){var n=this._pan,t=this._zoom,i=new wt(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 wt(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],s.remove(this.shapes,r),s.insert(this.shapes,r,u);for(i=0;i<n.cons.length;i++)r=n.cons[i],s.remove(this.connections,r),s.insert(this.connections,r,f)},_getDiagramItems:function(n){var r,t={},u=n,i;for(t.visuals=[],t.shapes=[],t.cons=[],n?d(n)||(u=[n]):u=this._selectedItems.slice(),r=0;r<u.length;r++)i=u[r],i instanceof h?(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 h?(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=[],h;for(this.toolService._removeHover(),t&&this.undoRedoService.addCompositeItem(new lr(n)),s.remove(this.shapes,n),this._shapesQuadTree.remove(n),r=0;r<n.connectors.length;r++)for(f=n.connectors[r],h=0;h<f.connections.length;h++)u=f.connections[h],i&&p.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&&s.remove(n.sourceConnector.connections,n);n.targetConnector&&s.remove(n.targetConnector.connections,n);t&&this.undoRedoService.addCompositeItem(new ar(n));s.remove(this.connections,n)},_removeDataItems:function(n,t){var i,f,r,u;for(n=d(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 h(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 h(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 u=this,e=n.node,i=n.action,r=n.items,o=u.options,t,f;if(n.field){for(t=0;t<r.length;t++)this._dataMap[r[t].uid]&&this._dataMap[r[t].uid].redrawVisual();return}if(i=="remove")this._removeDataItems(n.items,!0);else for(i&&i!=="itemloaded"||this._bindingRoots||(this._bindingRoots=!0,f=!0),i||e||u.clear(),this._addDataItems(r,e),t=0;t<r.length;t++)r[t].load();o.layout&&(f||i=="remove"||i=="add")&&u.layout(o.layout);f&&(this.trigger("dataBound"),this._bindingRoots=!1)},_addItem:function(n){n instanceof h?this.addShape(n):n instanceof v&&this.addConnection(n)},_createToolBar:function(n){var e=this.toolService.diagram,i,s,r,a,t,y,p,c,l;if(!this.singleToolBar&&e.select().length===1&&(i=e.select()[0],i&&i.options.editable!==!1&&(s=i.options.editable,r=s.tools,this._isEditable&&r.length===0&&(i instanceof h?r=["edit","rotateClockwise","rotateAnticlockwise"]:i instanceof v&&(r=["edit"]),s&&s.remove!==!1&&r.push("delete")),r&&r.length)))if(a=20,this.singleToolBar=new ui(e,{tools:r,click:f(this._toolBarClick,this),modal:!0,popupZIndex:parseInt(e.element.closest(".k-window").css("zIndex"),10)+10}),y=fr(this.singleToolBar._popup.element),p=yt(this.singleToolBar._popup.element),i instanceof h?(c=this.modelToView(i.bounds(ut)),t=new u(c.x,c.y).minus(new u((y-c.width)/2,p+a))):i instanceof v&&(l=this.modelToView(i.bounds()),t=new u(l.x,l.y).minus(new u((y-l.width-20)/2,p+a))),t){if(this.canvas.translate||(t=t.minus(new u(this.scroller.scrollLeft,this.scroller.scrollTop))),t=this.viewToDocument(t),t=new u(o.max(t.x,0),o.max(t.y,0)),this.singleToolBar.showAt(t),n)this.singleToolBar._popup.one("close",hf)}else this._destroyToolBar()},_toolBarClick:function(n){this.trigger("toolBarClick",n);this._destroyToolBar()},_normalizePointZoom:function(n){return n.times(1/this.zoom())},_initialize:function(){this.shapes=[];this._selectedItems=[];this.connections=[];this._dataMap={};this._connectionsDataMap={};this._inactiveShapeItems=new oi;this._deferredConnectionUpdates=[];this.undoRedoService=new pr({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=d(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=d(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;if(t=d(t)?{data:t}:t,t instanceof kendo.data.DataSource&&!(t instanceof kendo.data.HierarchicalDataSource))throw new Error("Incorrect DataSource type. If a single dataSource instance is set to the diagram then it should be a HierarchicalDataSource. You should set only the options instead of an instance or a HierarchicalDataSource instance or supply connectionsDataSource as well.");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=or.create(t).bind(tt,n._refreshHandler).bind(vi,n._errorHandler)},_unbindDataSource:function(){var n=this;n.dataSource.unbind(tt,n._refreshHandler).unbind(vi,n._errorHandler)},_adorn:function(n,i){i!==t&&n&&(i?(this._adorners.push(n),this.adornerLayer.append(n.visual)):(s.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=nt.Path.fromRect(u),t=new nt.Group({transform:r}),i=new nt.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 nt.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=[])}});p.ExportMixin.extend(ri.fn,!0);kendo.PDFMixin&&kendo.PDFMixin.extend(ri.fn);var ui=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){ru(n)||(n={name:n});var t=n.name+"Tool";this[t]?this[t](n):this._tools.push(e({},n,{attributes:this._setAttributes({action:n.name})}))},showAt:function(n){var t=parseInt(this.options.popupZIndex,10);this._popup&&(this._popup.open(n.x,n.y),t&&this._popup.wrapper.css("zIndex",t))},hide:function(){this._popup&&this._popup.close()},newGroup:function(){return{type:"buttonGroup",buttons:[]}},editTool:function(){this._tools.push({icon:"edit",showText:"overflow",type:"button",text:"Edit",attributes:this._setAttributes({action:"edit"})})},deleteTool:function(){this._tools.push({icon:"close",showText:"overflow",type:"button",text:"Delete",attributes:this._setAttributes({action:"delete"})})},rotateAnticlockwiseTool:function(n){this._appendGroup("rotate");this._rotateGroup.buttons.push({icon:"rotate-left",showText:"overflow",text:"RotateAnticlockwise",group:"rotate",attributes:this._setAttributes({action:"rotateAnticlockwise",step:n.step})})},rotateClockwiseTool:function(n){this._appendGroup("rotate");this._rotateGroup.buttons.push({icon:"rotate-right",attributes:this._setAttributes({action:"rotateClockwise",step:n.step}),showText:"overflow",text:"RotateClockwise",group:"rotate"})},createShapeTool:function(){this._appendGroup("create");this._createGroup.buttons.push({icon:"shape",showText:"overflow",text:"CreateShape",group:"create",attributes:this._setAttributes({action:"createShape"})})},createConnectionTool:function(){this._appendGroup("create");this._createGroup.buttons.push({icon:"connector",showText:"overflow",text:"CreateConnection",group:"create",attributes:this._setAttributes({action:"createConnection"})})},undoTool:function(){this._appendGroup("history");this._historyGroup.buttons.push({icon:"undo",showText:"overflow",text:"Undo",group:"history",attributes:this._setAttributes({action:"undo"})})},redoTool:function(){this._appendGroup("history");this._historyGroup.buttons.push({icon:"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]&&this[i](r);this.trigger("click",this.eventData(i,t.target))},eventData:function(n,t){for(var u=this.selectedElements(),o=u.length,f=[],e=[],i,r=0;r<o;r++)i=u[r],i instanceof h?f.push(i):e.push(i);return{shapes:f,connections:e,action:n,target:t}},"delete":function(){var t=this.diagram,n=t._triggerRemove(this.selectedElements());n.length&&(this.diagram.remove(n,!0),this.diagram._syncChanges())},edit:function(){var n=this.selectedElements();n.length===1&&this.diagram.edit(n[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()}}),fi=kendo.Observable.extend({init:function(n,t){kendo.Observable.fn.init.call(this);this.options=er(!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=fi.extend({init:function(n,t){fi.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(rf)(di[n])},_attachButtonEvents:function(){this._cancelClickHandler=f(this._cancelClick,this);this.window.element.on(rt+l,"a.k-diagram-cancel",this._cancelClickHandler);this._updateClickHandler=f(this._updateClick,this);this.window.element.on(rt+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(rt+l,"a.k-diagram-cancel",this._cancelClickHandler);this.window.element.off(rt+l,"a.k-diagram-update",this._updateClickHandler);this._cancelClickHandler=null;this._editUpdateClickHandler=null;this.window=null;fi.fn.destroy.call(this)}});ei.fn=ei.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=[]}};oi.fn=oi.prototype={add:function(n){for(var t=0;t<n.length;t++)this.items[n[t].uid]=new ei(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 et=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,t){for(var r=this.shapes,u=r.length,i=0;i<u;i++)if(this._testRect(r[i].shape,n)&&!p.inArray(r[i].shape,t))return!0},_testRect:function(n,t){var i=n.rotate().angle,r=n.bounds();return i?hi.rects(t,r,-i):r.overlaps(t)}}),it=et.extend({init:function(n){et.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 it(new c(n.x,n.y,u,f)),new it(new c(r.x,n.y,u,f)),new it(new c(n.x,r.y,u,f)),new it(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,t){var i,u=this.children,f=u.length,r=!1;if(this.overlapsBounds(n))if(et.fn.hitTestRect.call(this,n,t))r=!0;else for(i=0;i<f;i++)if(u[i].hitTestRect(n,t)){r=!0;break}return r}}),ir=vt.extend({ROOT_SIZE:1e3,init:function(n){var t=f(this._boundsChange,this);n.bind(kt,t);n.bind(gt,t);this.initRoots()},initRoots:function(){this.rootMap={};this.root=new et},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(ut),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 it(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,t){var i=this.getSectors(n),r,u,e,o,f;if(this.root.hitTestRect(n,t))return!0;for(r=0;r<i[0].length;r++)for(e=i[0][r],u=0;u<i[1].length;u++)if(o=i[1][u],f=(this.rootMap[e]||{})[o],f&&f.hitTestRect(n,t))return!0;return!1}});p.ui.plugin(ri);e(i,{Shape:h,Connection:v,Connector:a,DiagramToolBar:ui,QuadNode:it,QuadRoot:et,ShapesQuadTree:ir,PopupEditor:tr})})(window.kendo.jQuery)},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.dataviz.diagram",["kendo.data","kendo.draganddrop","kendo.userevents","kendo.mobile.scroller","kendo.drawing","dataviz/diagram/utils","dataviz/diagram/math","dataviz/diagram/svg","dataviz/diagram/services","dataviz/diagram/layout","dataviz/diagram/dom"],n)}(function(){return window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.dataviz.treemap",["kendo.data","kendo.userevents","kendo.dataviz.themes"],n)}(function(){return function(n,t){function p(n,t){if(t===null)return t;var i=ht(n,!0);return i(t)}function u(n){return typeof n!==at}function pt(n,t,i){var f=b(n),e=b(t),o=g(n)-g(t)<0,u=[],r,s;for(u.push(n),r=0;r<i;r++)s={r:w(f.r,e.r,r,i,o),g:w(f.g,e.g,r,i,o),b:w(f.b,e.b,r,i,o)},u.push(wt(s));return u.push(t),u}function w(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 wt(n){return"#"+k(n.r)+k(n.g)+k(n.b)}function b(n){n=n.replace("#","");var t=bt(n);return{r:d(t.r),g:d(t.g),b:d(t.b)}}function k(n){var t=r.round(n).toString(16).toUpperCase();return t.length===1&&(t="0"+t),t}function bt(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 d(n){return parseInt(n.toString(16),16)}function g(n){var t=0;return n&&(n=b(n),t=r.sqrt(.241*n.r*n.r+.691*n.g*n.g+.068*n.b*n.b)),t}function c(n){var t=r.pow(10,4);return r.round(n*t)/t}var r=Math,e=n.proxy,ot=n.isArray,i=window.kendo,nt=i._outerHeight,o=i._outerWidth,l=i.Class,s=i.ui.Widget,st=i.template,f=i.deepExtend,tt=i.data.HierarchicalDataSource,ht=i.getter,a=i.dataviz,v=".kendoTreeMap",h="change",it="dataBound",y="itemCreated",rt=Number.MAX_VALUE,ct="mouseover"+v,lt="mouseleave"+v,at="undefined",vt=s.extend({init:function(t,r){i.destroy(t);n(t).empty();s.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,a.ui)},options:{name:"TreeMap",theme:"default",autoBind:!0,textField:"text",valueField:"value",colorField:"color"},events:[it,y],_initTheme:function(n){var t=this,i=a.ui.themes||{},r=((n||{}).theme||"").toLowerCase(),u=(i[r]||{}).treeMap;t.options=f({},u,n)},_attachEvents:function(){this.element.on(ct,e(this._mouseover,this)).on(lt,e(this._mouseleave,this));this._resizeHandler=e(this.resize,this,!1);i.onResize(this._resizeHandler)},_setLayout:function(){this.options.type==="horizontal"?(this._layout=new ft(!1),this._view=new et(this,this.options)):this.options.type==="vertical"?(this._layout=new ft(!0),this._view=new et(this,this.options)):(this._layout=new yt,this._view=new ut(this,this.options))},_initDataSource:function(){var n=this,i=n.options,t=i.dataSource;n._dataChangeHandler=e(n._onDataChange,n);n.dataSource=tt.create(t).bind(h,n._dataChangeHandler);t&&n.options.autoBind&&n.dataSource.fetch()},setDataSource:function(n){var t=this;t.dataSource.unbind(h,t._dataChangeHandler);t.dataSource=n.bind(h,t._dataChangeHandler);n&&t.options.autoBind&&t.dataSource.fetch()},_onDataChange:function(n){var e=n.node,t=n.items,h=this.options,f,r,u,s;if(e){if(t.length){for(u=this._getByUid(e.uid),u.children=[],t=new i.data.Query(t)._sortForGrouping(h.valueField,"desc"),r=0;r<t.length;r++)f=t[r],u.children.push(this._wrapItem(f));s=this._view.htmlSize(u);this._layout.compute(u.children,u.coord,s);this._setColors(u.children);this._view.render(u)}}else this._cleanItems(),this.element.empty(),f=this._wrapItem(t[0]),this._layout.createRoot(f,o(this.element),nt(this.element),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(it,{node:e})},_cleanItems:function(){var n=this;n.angular("cleanup",function(){return{elements:n.element.find(".k-leaf div,.k-treemap-title,.k-treemap-title-vertical")}})},_setColors:function(n){var o=this.options.colors,s=this._colorIdx,i=o[s%o.length],f,r,e,t;for(ot(i)&&(f=pt(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=p(this.options.valueField,n)),u(this.options.colorField)&&(t.color=p(this.options.colorField,n)),u(this.options.textField)&&(t.text=p(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(){s.fn.destroy.call(this);this.element.off(v);this.dataSource&&this.dataSource.unbind(h,this._dataChangeHandler);this._root=null;i.unbindResize(this._resizeHandler);i.destroy(this.element)},items:function(){return n()},getSize:function(){return i.dimensions(this.element)},_resize:function(){var n=this._root,t,i;n&&(t=this.element,i=t.children(),n.coord.width=o(t),n.coord.height=nt(t),i.css({width:n.coord.width,height:n.coord.height}),this._resizeItems(n,i))},_resizeItems:function(n,t){var e,r,f,u;if(n.children&&n.children.length)for(e=t.children(".k-treemap-wrap").children(),this._layout.compute(n.children,n.coord,{text:this._view.titleSize(n,t)}),u=0;u<n.children.length;u++)r=n.children[u],f=e.filter("["+i.attr("uid")+"='"+r.dataItem.uid+"']"),this._view.setItemSize(r,f),this._resizeItems(r,f)},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);s.fn._setEvents.call(this,n);i&&this.setDataSource(tt.create(i));this.options.autoBind&&this.dataSource.fetch()}}),yt=l.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 rt;var u=0,f=0,e=rt;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 s=this._totalArea(n),o=0,f,e,u;for(t=c(s/t),f=0;f<n.length;f++)e=c(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,s=this._totalArea(n),e=c(s/t),h=i.top,o=0,f=0;f<n.length;f++)n[f].coord={height:e,width:c(n[f].area/e),top:h,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}}),ut=l.extend({init:function(t,i){this.options=f({},this.options,i);this.treeMap=t;this.element=n(t.element);this.offset=0},titleSize:function(n,t){var i=t.children(".k-treemap-title");return i.height()||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),this._compile(i,n.dataItem),r.text=i.height()),t.append(this._createWrap()),this.offset=(o(t)-t.innerWidth())/2),r},_compile:function(n,t){this.treeMap.angular("compile",function(){return{elements:n,data:[{dataItem:t}]}})},_getByUid:function(n){return this.element.find(".k-treemap-tile["+i.attr("uid")+"='"+n+"']")},render:function(n){var e=this._getByUid(n.dataItem.uid),r=n.children,f,t,u,i;if(r)for(f=e.find(".k-treemap-wrap"),t=0;t<r.length;t++)u=r[t],i=this._createLeaf(u),f.append(i),this._compile(i.children(),u.dataItem),this.treeMap.trigger(y,{element:i})},createRoot:function(n){var t=this._createLeaf(n);this.element.append(t);this._compile(t.children(),n.dataItem);this.treeMap.trigger(y,{element:t})},_clean:function(n){this.treeMap.angular("cleanup",function(){return{elements:n.children(":not(.k-treemap-wrap)")}});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=n("<div class='k-treemap-tile'><\/div>");return this.setItemSize(t,r),u(t.dataItem)&&u(t.dataItem.uid)&&r.attr(i.attr("uid"),t.dataItem.uid),r},_itemCoordinates:function(n){var t={width:n.coord.width,height:n.coord.height,left:n.coord.left,top:n.coord.top};return t.width+=t.left&&this.offset?this.offset*2:this.offset,t.height+=t.top?this.offset*2:this.offset,t},setItemSize:function(n,t){var i=this._itemCoordinates(n);t.css({width:i.width,height:i.height,left:i.left,top:i.top})},_getText:function(n){var t=n.text;return this.options.template&&(t=this._renderTemplate(n)),t},_renderTemplate:function(n){var t=st(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 g(n.color)}}),ft=l.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}}),et=ut.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),this._compile(i,n.dataItem),r.text=n.vertical?i.height():i.width()),t.append(this._createWrap()),this.offset=(o(t)-t.innerWidth())/2),r},titleSize:function(n,t){var i;return i=n.vertical?t.children(".k-treemap-title").height():t.children(".k-treemap-title-vertical").width(),i||0},_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)))}});a.ui.plugin(vt)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.dataviz",["kendo.core","kendo.fx","kendo.router","kendo.view","kendo.data.odata","kendo.data.xml","kendo.data","kendo.data.signalr","kendo.binder","kendo.userevents","kendo.draganddrop","kendo.mobile.scroller","kendo.popup","kendo.tooltip","kendo.drawing","kendo.dataviz.core","kendo.dataviz.themes","kendo.dataviz.chart","kendo.dataviz.gauge","kendo.dataviz.barcode","kendo.dataviz.qrcode","kendo.dataviz.stock","kendo.dataviz.sparkline","kendo.dataviz.map","kendo.dataviz.diagram","kendo.dataviz.treemap","kendo.angular"],n)}(function(){"bundle all";return window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.mobile.modalview",["kendo.mobile.shim","kendo.mobile.view"],n)}(function(){return 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),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.mobile.drawer",["kendo.mobile.view","kendo.userevents"],n)}(function(){return 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,{fastTap:!0,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,{fastTap:!0,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),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.mobile.splitview",["kendo.mobile.pane"],n)}(function(){return 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,{fastTap:!0,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),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.mobile.application",["kendo.mobile.pane","kendo.router"],n)}(function(){return 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.options.browserHistory&&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),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.mobile.button",["kendo.userevents"],n)}(function(){return 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,fastTap:!0,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),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.mobile.buttongroup",["kendo.core"],n)}(function(){return function(n,t){function i(n){return"k-"+n+" km-"+n}function h(t){return n('<span class="'+i("badge")+'">'+t+"<\/span>")}var u=window.kendo,e=u.mobile.ui,o=e.Widget,r="state-active",f="state-disabled",s="select",c="li:not(.km-"+r+")",l=o.extend({init:function(n,t){var r=this;o.fn.init.call(r,n,t);r.element.addClass("km-buttongroup k-widget k-button-group").find("li").each(r._button);r.element.on(r.options.selectOn,c,"_select");r._enable=!0;r.select(r.options.index);r.options.enable||(r._enable=!1,r.wrapper.addClass(i(f)))},events:[s],options:{name:"ButtonGroup",selectOn:"down",index:-1,enable:!0},current:function(){return this.element.find(".km-"+r)},select:function(u){var e=this,o=-1;u!==t&&u!==-1&&e._enable&&!n(u).is(".km-"+f)&&(e.current().removeClass(i(r)),typeof u=="number"?(o=u,u=n(e.element[0].children[u])):u.nodeType&&(u=n(u),o=u.index()),u.addClass(i(r)),e.selectedIndex=o)},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]||h(i).appendTo(t)),i||i===0)?(r.html(i),this):i===!1?(r.empty().remove(),this):r.html()},enable:function(n){typeof n=="undefined"&&(n=!0);this.wrapper.toggleClass(i(f),!n);this._enable=this.options.enable=n},_button:function(){var t=n(this).addClass(i("button")),e=u.attrValue(t,"icon"),r=u.attrValue(t,"badge"),f=t.children("span"),o=t.find("img").addClass(i("image"));f[0]||(f=t.wrapInner("<span/>").children("span"));f.addClass(i("text"));!o[0]&&e&&t.prepend(n('<span class="'+i("icon")+" "+i(e)+'"/>'));(r||r===0)&&h(r).appendTo(t)},_select:function(n){n.which>1||n.isDefaultPrevented()||!this._enable||(this.select(n.currentTarget),this.trigger(s,{index:this.selectedIndex}))}});e.plugin(l)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.mobile.collapsible",["kendo.core"],n)}(function(){return 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,{fastTap:!0,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),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.mobile.listview",["kendo.data","kendo.userevents","kendo.mobile.button"],n)}(function(){return function(n){function yt(){return this.nodeType===rt.TEXT_NODE&&this.nodeValue.match(at)}function o(n,t){t&&!n[0].querySelector(".km-icon")&&n.prepend('<span class="km-icon km-'+t+'"/>')}function pt(n){o(n,r(n,"icon"));o(n,r(n.children(et),"icon"))}function wt(n){var i=n.parent(),u=n.add(i.children(t.roleSelector("detailbutton"))),f=i.contents().not(u).not(yt);f.length||(n.addClass("km-listview-link").attr(t.attr("role"),"listview-link"),o(n,r(i,"icon")),o(n,r(n,"icon")))}function bt(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 y(t,i){n(t).css("transform","translate3d(0px, "+i+"px, 0px)")}var t=window.kendo,rt=window.Node,s=t.mobile,i=s.ui,h=t._outerHeight,ut=t.data.DataSource,c=i.DataBoundWidget,ft=".km-list > li, > li:not(.km-group-container)",p=".km-listview-link, .km-listview-label",et="["+t.attr("icon")+"]",u=n.proxy,r=t.attrValue,f="km-group-title",ot="km-state-active",st='<div class="'+f+'"><div class="km-text"><\/div><\/div>',ht=t.template('<li><div class="'+f+'"><div class="km-text">#= this.headerTemplate(data) #<\/div><\/div><ul>#= kendo.render(this.template, data.items)#<\/ul><\/li>'),ct='<div class="km-listview-wrapper" />',lt=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",w="styled",l="dataBound",b="dataBinding",a="itemChange",v="click",k="change",d="progress",g="function",at=/^\s+$/,vt=/button/,kt=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(w,t),n.bind(l,t),this._scrollHandler=function(n){i._fixHeader(n)},r.bind("scroll",this._scrollHandler))},destroy:function(){var n=this;n.scroller&&n.scroller.unbind("scroll",n._scrollHandler)},_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})}}}),dt=function(){return{page:1}},gt=t.Class.extend({init:function(n){var t=this,i=n.options,r=n.scroller(),u=i.pullParameters||dt;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}}),nt=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=nt;var ni=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,y(this.element,this.top))},below:function(n){n&&(this.height=this.element.offsetHeight,this.top=n.bottom,this.bottom=this.top+this.height,y(this.element,this.top))},destroy:function(){t.destroy(this.element);n(this.element).remove()}}),tt='<div><span class="km-icon"><\/span><span class="km-loading-left"><\/span><span class="km-loading-right"><\/span><\/div>',it=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(tt).appendTo(this.element)},enable:function(){this.element.show();this.height=h(this.element,!0)},disable:function(){this.element.hide();this.height=0},below:function(n){n&&(this.top=n.bottom,this.bottom=this.height+this.top,y(this.element,this.top))}}),ti=it.extend({init:function(t,i){this._loadIcon=n(tt).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=h(this.element,!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()}}),ii=t.Class.extend({init:function(n){var t=this;this.chromeHeight=h(n.wrapper.children().not(n.element));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._scroll=function(n){t.list.update(n.scrollTop)};this.scroller.bind("scroll",this._scroll);this._scrollEnd=function(n){t.list.batchUpdate(n.scrollTop)};this.scroller.bind("scrollEnd",this._scrollEnd)},destroy:function(){this.list.unbind();this.buffer.unbind();this.scroller.unbind("scroll",this._scroll);this.scroller.unbind("scrollEnd",this._scrollEnd)},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 ti(f,e):new it(f);this.list&&this.list.destroy();u=new nt({buffer:e,footer:o,item:function(n){return new ni(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()}}),ri=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,c,w,k,a;if(u==="itemchange"){t._hasBindingTarget()||(s=t.findByDataItem(r)[0],s&&t.setDataItem(s,r[0]));return}if(w=u==="add"&&!e||y&&!t._filter,k=u==="remove"&&!e,w?h=[]:k&&(h=t.findByDataItem(r)),t.trigger(b,{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),c=f):t.replace(f):(o=[],t.remove(r)):(a=f.indexOf(r[0]),a>-1&&(o=t.insertAt(r,a),c=r));this._shouldShowLoading()&&t.hideLoading();t.trigger(l,{ns:i,addedItems:o,addedDataItems:c})},setDataSource:function(n){this.dataSource&&this._unbindDataSource();this.dataSource=n;n.bind(k,this._refreshHandler);this._shouldShowLoading()&&this.dataSource.bind(d,this._progressHandler)},_unbindDataSource:function(){this.dataSource.unbind(k,this._refreshHandler).unbind(d,this._progressHandler)},_shouldShowLoading:function(){var n=this.options;return!n.pullToRefresh&&!n.loadMore&&!n.endlessScroll}}),ui=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(lt({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(v,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()}}),fi=c.extend({init:function(i,r){var u=this;c.fn.init.call(this,i,r);i=this.element;r=this.options;r.scrollTreshold&&(r.scrollThreshold=r.scrollTreshold);i.on("down",p,"_highlight").on("move up cancel",p,"_dim");this._userEvents=new t.UserEvents(i,{fastTap:!0,filter:ft,allowSelection:!0,tap:function(n){u._click(n)}});i.css("-ms-touch-action","auto");i.wrap(ct);this.wrapper=this.element.parent();this._headerFixer=new kt(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 ui(this));this._itemBinder=this.virtual?new ii(this):new ri(this);this.options.pullToRefresh&&(this._pullToRefreshHandler=new gt(this));this.setDataSource(n.dataSource);this._enhanceItems(this.items());t.notify(this,i)},events:[v,b,l,a],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=ut.create(n);this.trigger("_dataSource",{dataSource:this.dataSource,empty:t});this.options.autoBind&&!t&&(this.items().remove(),this.dataSource.fetch())},destroy:function(){c.fn.destroy.call(this);t.destroy(this.element);this._userEvents.destroy();this._itemBinder&&this._itemBinder.destroy();this._headerFixer&&this._headerFixer.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(a,{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"),t.destroy(this.element.children()),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(a,{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(vt),s=t.isDefaultPrevented();o&&f.toggleClass(ot,i&&!s)}},_templates:function(){var n=this.options.template,i=this.options.headerTemplate,f={},r={};typeof n===g&&(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===g&&(r._headerTemplate=i,i="#=this._headerTemplate(data)#");r.headerTemplate=t.template(i);this.groupTemplate=u(ht,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(v,{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(st)})},_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(w)},_enhanceItems:function(t){t.each(function(){var r=n(this),t,i=!1;r.children().each(function(){t=n(this);t.is("a")?(wt(t),i=!0):t.is("label")&&(bt(t),i=!0)});i||pt(r)})}});i.plugin(fi)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.mobile.navbar",["kendo.core"],n)}(function(){return 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),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.mobile.scrollview",["kendo.fx","kendo.data","kendo.draganddrop"],n)}(function(){return function(n,t){function e(n){return"k-"+n+" km-"+n}var i=window.kendo,at=i.mobile,g=at.ui,r=n.proxy,h=i.effects.Transition,vt=i.ui.Pane,yt=i.ui.PaneDimensions,p=g.DataBoundWidget,nt=i.data.DataSource,pt=i.data.Buffer,wt=i.data.BatchBuffer,o=Math,c=o.abs,l=o.ceil,tt=o.round,bt=o.max,kt=o.min,it=o.floor,u="change",a="changing",f="refresh",w="current-page",rt="virtual-page",ut="function",b="itemChange",ft="cleanup",dt=3,gt=-1,ni=0,ti=1,v=-1,ii=0,y=1,et=i.Class.extend({init:function(t){var i=this,o=n("<ol class='"+e("pages")+"'/>");t.element.append(o);this._changeProxy=r(i,"_change");this._refreshProxy=r(i,"_refresh");t.bind(u,this._changeProxy);t.bind(f,this._refreshProxy);n.extend(i,{element:o,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(e(w))},_change:function(n){this.items().removeClass(e(w)).eq(n.page).addClass(e(w))},destroy:function(){this.scrollView.unbind(u,this._changeProxy);this.scrollView.unbind(f,this._refreshProxy);this.element.remove()}}),k,s,d,lt;i.mobile.ui.ScrollViewPager=et;var ot="transitionEnd",st="dragStart",ht="dragEnd",ct=i.Observable.extend({init:function(t,r){var f=this,o,l,e,s,a,v;i.Observable.fn.init.call(this);this.element=t;this.container=t.parent();o=new i.ui.Movable(f.element);l=new h({axis:"x",movable:o,onEnd:function(){f.trigger(ot)}});e=new i.UserEvents(t,{fastTap:!0,start:function(n){c(n.x.velocity)*2>=c(n.y.velocity)?e.capture():e.cancel();f.trigger(st,n);l.cancel()},allowSelection:!0,end:function(n){f.trigger(ht,n)}});s=new yt({element:f.element,container:f.container});a=s.x;a.bind(u,function(){f.trigger(u)});v=new vt({dimensions:s,userEvents:e,movable:o,elastic:!0});n.extend(f,{duration:r&&r.duration||1,movable:o,transition:l,userEvents:e,dimensions:s,dimension:a,pane:v});this.bind([ot,st,ht,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=ct;k=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,h.easeOutExpo,t)},paneMoved:function(n,t,i,r){var u=this,f=u.pane,c=f.size().width*u.pageSize,o=tt,a=t?h.easeOutBack:h.easeOutExpo,s,e;n===v?o=l:n===y&&(o=it);e=o(f.offset()/c);s=bt(u.minSnap,kt(-e*c,u.maxSnap));e!=u.page&&i&&i({currentPage:u.page,nextPage:e})&&(s=-u.page*f.size().width);f.transitionTo(s,a,r)},updatePage:function(){var n=this.pane,t=tt(n.offset()/n.size().width);return t!=this.page?(this.page=t,!0):!1},forcePageUpdate:function(){return this.updatePage()},resizeTo:function(n){var u=this.pane,t=n.width,r,f;this.pageElements.width(t);this.contentHeight==="100%"&&(r=this.element.parent().height(),this.enablePager===!0&&(f=this.element.parent().find("ol.km-pages"),!this.pagerOverlay&&f.length&&(r-=i._outerHeight(f,!0))),this.element.css("height",r),this.pageElements.css("height",r));u.updateDimension();this._paged||(this.page=it(u.offset()/t));this.scrollTo(this.page,!0);this.pageCount=l(u.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=k;s=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=nt.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 wt(this.dataSource,n):new pt(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===ut&&(u.template=n,n="#=this.template(data)#");this.template=r(i.template(n),u);typeof t===ut&&(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<dt;t++)n=new d(r),i.push(n);this.pane.updateDimension()},resizeTo:function(n){for(var t,f,r=this.pages,e=this.pane,u=0;u<r.length;u++)r[u].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&&(f=this.element.parent().find("ol.km-pages"),!this.options.pagerOverlay&&f.length&&(t-=i._outerHeight(f,!0))),this.element.css("height",t),r[0].element.css("height",t),r[1].element.css("height",t),r[2].element.css("height",t));e.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,a=h.size().width,s=h.offset(),c=Math.abs(s)>=a/3,p=t?i.effects.Transition.easeOutBack:i.effects.Transition.easeOutExpo,l=f.page+2>f.buffer.total(),o,e=0;n===y?f.page!==0&&(e=-1):n!==v||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 c(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=l(this.dataSource.total()/this.options.itemsPerPage);this._pendingPageRefresh&&(this._updatePagesContent(this.page),this._pendingPageRefresh=!1);this.trigger("resize")},_onReset:function(){this.pageCount=l(this.dataSource.total()/this.options.itemsPerPage);this._resetPages()},_onEndReached:function(){this._pendingPageRefresh=!0},_repositionPages:function(){var n=this.pages;n[0].position(gt);n[1].position(ni);n[2].position(ti)},_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(ft,{item:t.element});u!==null?t.content(e(u)):t.content(o({}));i.mobile.init(t.element);this.trigger(b,{item:t.element,data:u,ns:i.mobile.ui})}});i.mobile.ui.VirtualScrollViewContent=s;d=i.Class.extend({init:function(t){this.element=n("<div class='"+e(rt)+"'><\/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=d;lt=p.extend({init:function(n,t){var u=this,c,o,h;p.fn.init.call(u,n,t);t=u.options;n=u.element;i.stripWhitespace(n[0]);n.wrapInner("<div/>").addClass("k-widget "+e("scrollview"));this.options.enablePager&&(this.pager=new et(this),this.options.pagerOverlay&&n.addClass(e("scrollview-overlay")));u.inner=n.children().first();u.page=0;u.inner.css("height",t.contentHeight);u.pane=new ct(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;c=this.inner.children().length===0;o=c?new s(u.inner,u.pane,t):new k(u.inner,u.pane,t);o.page=u.page;o.bind("reset",function(){this._pendingPageRefresh=!1;u._syncWithContent();u.trigger(f,{pageCount:o.pageCount,page:o.page})});o.bind("resize",function(){u.trigger(f,{pageCount:o.pageCount,page:o.page})});o.bind(b,function(n){u.trigger(b,n);u.angular("compile",function(){return{elements:n.item,data:[{dataItem:n.data}]}})});o.bind(ft,function(n){u.angular("cleanup",function(){return{elements:n.item}})});u._content=o;u.setDataSource(t.dataSource);h=u.container();h.nullObject?(u.viewInit(),u.viewShow()):h.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:[a,u,f],destroy:function(){p.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 s?n._content.paneMoved(y,t,function(t){return n.trigger(a,t)}):i>-1&&n.scrollTo(i)},next:function(){var n=this,i=n.page+1;n._content instanceof s?n._content.paneMoved(v,t,function(t){return n.trigger(a,t)}):i<n._content.pageCount&&n.scrollTo(i)},setDataSource:function(n){if(this._content instanceof s){var t=!n;this.dataSource=nt.create(n);this._content.setDataSource(this.dataSource);this.options.autoBind&&!t&&this.dataSource.fetch()}},items:function(){return this.element.find(".km-"+rt)},_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=ii,f=c(t)>this.options.bounceVelocityThreshold;t>r?i=y:t<-r&&(i=v);this._content.paneMoved(i,f,function(n){return u.trigger(a,n)})},_transitionEnd:function(){this._content.updatePage()&&this._syncWithContent()}});g.plugin(lt)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.mobile.switch",["kendo.fx","kendo.userevents"],n)}(function(){return function(n,t){function i(n){return"k-"+n+" km-"+n}function k(n,t,i){return Math.max(t,Math.min(i,n))}var r=window.kendo,s=r.mobile.ui,h=r._outerWidth,f=s.Widget,c=r.support,l="change",a="switch-on",v="switch-off",e="margin-left",y="state-active",p="state-disabled",u="disabled",w=c.transitions.css===t?"":c.transitions.css,b=w+"transform",o=n.proxy,d='<span class="'+i("switch")+" "+i("widget")+'">        <span class="'+i("switch-wrapper")+'">            <span class="'+i("switch-background")+'"><\/span>        <\/span>         <span class="'+i("switch-container")+'">            <span class="'+i("switch-handle")+'">                 <span class="'+i("switch-label-on")+'">{0}<\/span>                 <span class="'+i("switch-label-off")+'">{1}<\/span>             <\/span>         <\/span>    <\/span>',g=f.extend({init:function(t,i){var o=this,s;f.fn.init.call(o,t,i);i=o.options;o.wrapper=n(r.format(d,i.onLabel,i.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(e),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(u);o.enable(o.options.enable);o.refresh();r.notify(o,r.mobile.ui)},refresh:function(){var n=this,t=h(n.handle,!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(e),10));n.background.data("origin",n.origin);n.check(n.element[0].checked)},events:[l],options:{name:"Switch",onLabel:"on",offLabel:"off",checked:null,enable:!0},check:function(n){var r=this,u=r.element[0];if(n===t)return u.checked;r._position(n?r.constrain:0);u.checked=n;r.wrapper.toggleClass(i(a),n).toggleClass(i(v),!n)},value:function(){return this.check.apply(this,arguments)},destroy:function(){f.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,r=this.wrapper;typeof n=="undefined"&&(n=!0);this.options.enable=n;n?t.removeAttr(u):t.attr(u,u);r.toggleClass(i(p),!n)},_resize:function(){this.refresh()},_move:function(n){var t=this;n.preventDefault();t._position(k(t.position+n.x.delta,0,t.width-h(t.handle,!0)))},_position:function(n){var t=this;t.position=n;t.handle.css(b,"translatex("+n+"px)");t._animateBackground&&t.background.css(e,t.origin+n)},_start:function(){this.options.enable?(this.userEvents.capture(),this.handle.addClass(i(y))):this.userEvents.cancel()},_stop:function(){var n=this;n.handle.removeClass(i(y));n._toggle(n.position>n.snapPoint)},_toggle:function(n){var t=this,o=t.handle,f=t.element[0],s=f.checked,e=r.mobile.application&&r.mobile.application.os.wp?100:200,u;t.wrapper.toggleClass(i(a),n).toggleClass(i(v),!n);t.position=u=n*t.constrain;t._animateBackground&&t.background.kendoStop(!0,!0).kendoAnimate({effects:"slideMargin",offset:u,reset:!0,reverse:!n,axis:"left",duration:e});o.kendoStop(!0,!0).kendoAnimate({effects:"slideTo",duration:e,offset:u+"px,0",reset:!0,complete:function(){s!==n&&(f.checked=n,t.trigger(l,{checked:n}))}})},_drag:function(){var n=this;n.userEvents=new r.UserEvents(n.wrapper,{fastTap:!0,tap:function(){n.options.enable&&n._toggle(!n.element[0].checked)},start:o(n._start,n),move:o(n._move,n),end:o(n._stop,n)})}});s.plugin(g)}(window.kendo.jQuery),window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.mobile.tabstrip",["kendo.core"],n)}(function(){return 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,i){(i||t)()}),function(n,t){t("kendo.mobile",["kendo.core","kendo.fx","kendo.data.odata","kendo.data.xml","kendo.data","kendo.data.signalr","kendo.binder","kendo.validator","kendo.router","kendo.view","kendo.userevents","kendo.draganddrop","kendo.popup","kendo.touch","kendo.mobile.popover","kendo.mobile.loader","kendo.mobile.scroller","kendo.mobile.shim","kendo.mobile.view","kendo.mobile.modalview","kendo.mobile.drawer","kendo.mobile.splitview","kendo.mobile.pane","kendo.mobile.application","kendo.mobile.actionsheet","kendo.mobile.button","kendo.mobile.buttongroup","kendo.mobile.collapsible","kendo.mobile.listview","kendo.mobile.navbar","kendo.mobile.scrollview","kendo.mobile.switch","kendo.mobile.tabstrip","kendo.angular"],n)}(function(){"bundle all";return window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()}),function(n,t){t("kendo.all",["kendo.web","kendo.dataviz","kendo.mobile","kendo.drawing","kendo.dom"],n)}(function(){"bundle all";return window.kendo},typeof define=="function"&&define.amd?define:function(n,t,i){(i||t)()})