/*! kendo.core.min.js */ /** * Kendo UI v2016.2.504 (http://www.telerik.com/kendo-ui) * Copyright 2016 Telerik AD. All rights reserved. * * Kendo UI commercial licenses may be obtained at * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete * If you do not own a commercial license, this file shall be governed by the trial license terms. */ !function(e,define){define("kendo.core.min",["jquery"],e)}(function(){return function(e,t,n){function r(){}function o(e,t){if(t)return"'"+e.split("'").join("\\'").split('\\"').join('\\\\\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")+"'";var n=e.charAt(0),r=e.substring(1);return"="===n?"+("+r+")+":":"===n?"+$kendoHtmlEncode("+r+")+":";"+e+";$kendoOutput+="}function i(e,t,n){return e+="",t=t||2,n=t-e.length,n?W[t].substring(0,n)+e:e}function a(e){var t=e.css(ye.support.transitions.css+"box-shadow")||e.css("box-shadow"),n=t?t.match(De)||[0,0,0,0,0]:[0,0,0,0,0],r=Te.max(+n[3],+(n[4]||0));return{left:-n[1]+r,right:+n[1]+r,bottom:+n[2]+r}}function s(t,n){var r,o,i,s,u,l,c,d,f=ke.browser,m="rtl"==t.css("direction");return t.parent().hasClass("k-animation-container")?(c=t.parent(".k-animation-container"),d=c[0].style,c.is(":hidden")&&c.show(),r=Oe.test(d.width)||Oe.test(d.height),r||c.css({width:t.outerWidth(),height:t.outerHeight(),boxSizing:"content-box",mozBoxSizing:"content-box",webkitBoxSizing:"content-box"})):(o=a(t),i=t[0].style.width,s=t[0].style.height,u=Oe.test(i),l=Oe.test(s),f.opera&&(o.left=o.right=o.bottom=5),r=u||l,!u&&(!n||n&&i)&&(i=t.outerWidth()),!l&&(!n||n&&s)&&(s=t.outerHeight()),t.wrap(e("
").addClass("k-animation-container").css({width:i,height:s,marginLeft:o.left*(m?1:-1),paddingLeft:o.left,paddingRight:o.right,paddingBottom:o.bottom})),r&&t.css({width:"100%",height:"100%",boxSizing:"border-box",mozBoxSizing:"border-box",webkitBoxSizing:"border-box"})),f.msie&&Te.floor(f.version)<=7&&(t.css({zoom:1}),t.children(".k-menu").width(t.width())),t.parent()}function u(e){var t=1,n=arguments.length;for(t=1;n>t;t++)l(e,arguments[t]);return e}function l(e,t){var n,r,o,i,a,s=ye.data.ObservableArray,u=ye.data.LazyObservableArray,c=ye.data.DataSource,d=ye.data.HierarchicalDataSource;for(n in t)r=t[n],o=typeof r,i=o===_e&&null!==r?r.constructor:null,i&&i!==Array&&i!==s&&i!==u&&i!==c&&i!==d?r instanceof Date?e[n]=new Date(r.getTime()):A(r.clone)?e[n]=r.clone():(a=e[n],e[n]=typeof a===_e?a||{}:{},l(e[n],r)):o!==Fe&&(e[n]=r);return e}function c(e,t,r){for(var o in t)if(t.hasOwnProperty(o)&&t[o].test(e))return o;return r!==n?r:e}function d(e){return e.replace(/([a-z][A-Z])/g,function(e){return e.charAt(0)+"-"+e.charAt(1).toLowerCase()})}function f(e){return e.replace(/\-(\w)/g,function(e,t){return t.toUpperCase()})}function m(t,n){var r,o={};return document.defaultView&&document.defaultView.getComputedStyle?(r=document.defaultView.getComputedStyle(t,""),n&&e.each(n,function(e,t){o[t]=r.getPropertyValue(t)})):(r=t.currentStyle,n&&e.each(n,function(e,t){o[t]=r[f(t)]})),ye.size(o)||(o=r),o}function p(e){if(e&&e.className&&"string"==typeof e.className&&e.className.indexOf("k-auto-scrollable")>-1)return!0;var t=m(e,["overflow"]).overflow;return"auto"==t||"scroll"==t}function h(t,r){var o,i=ke.browser.webkit,a=ke.browser.mozilla,s=t instanceof e?t[0]:t;if(t)return o=ke.isRtl(t),r===n?o&&i?s.scrollWidth-s.clientWidth-s.scrollLeft:Math.abs(s.scrollLeft):(s.scrollLeft=o&&i?s.scrollWidth-s.clientWidth-r:o&&a?-r:r,n)}function g(e){var t,n=0;for(t in e)e.hasOwnProperty(t)&&"toJSON"!=t&&n++;return n}function y(e,n,r){n||(n="offset");var o=e[n]();return ke.browser.msie&&(ke.pointers||ke.msPointers)&&!r&&(o.top-=t.pageYOffset-document.documentElement.scrollTop,o.left-=t.pageXOffset-document.documentElement.scrollLeft),o}function v(e){var t={};return be("string"==typeof e?e.split(" "):e,function(e){t[e]=this}),t}function b(e){return new ye.effects.Element(e)}function w(e,t,n,r){return typeof e===He&&(A(t)&&(r=t,t=400,n=!1),A(n)&&(r=n,n=!1),typeof t===Pe&&(n=t,t=400),e={effects:e,duration:t,reverse:n,complete:r}),ve({effects:{},duration:400,reverse:!1,init:Se,teardown:Se,hide:!1},e,{completeCallback:e.complete,complete:Se})}function M(t,n,r,o,i){for(var a,s=0,u=t.length;u>s;s++)a=e(t[s]),a.queue(function(){B.promise(a,w(n,r,o,i))});return t}function S(e,t,n,r){return t&&(t=t.split(" "),be(t,function(t,n){e.toggleClass(n,r)})),e}function T(e){return(""+e).replace(J,"&").replace(Y,"<").replace(G,">").replace(q,""").replace(V,"'")}function x(e,t){var r;return 0===t.indexOf("data")&&(t=t.substring(4),t=t.charAt(0).toLowerCase()+t.substring(1)),t=t.replace(oe,"-$1"),r=e.getAttribute("data-"+ye.ns+t),null===r?r=n:"null"===r?r=null:"true"===r?r=!0:"false"===r?r=!1:Ce.test(r)?r=parseFloat(r):ne.test(r)&&!re.test(r)&&(r=Function("return ("+r+")")()),r}function k(t,r){var o,i,a={};for(o in r)i=x(t,o),i!==n&&(te.test(o)&&(i=ye.template(e("#"+i).html())),a[o]=i);return a}function O(t,n){return e.contains(t,n)?-1:1}function z(){var t=e(this);return e.inArray(t.attr("data-"+ye.ns+"role"),["slider","rangeslider"])>-1||t.is(":visible")}function D(e,t){var n=e.nodeName.toLowerCase();return(/input|select|textarea|button|object/.test(n)?!e.disabled:"a"===n?e.href||t:t)&&C(e)}function C(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}function E(e,t){return new E.fn.init(e,t)}var H,A,_,N,P,F,R,U,I,$,L,W,j,B,J,Y,q,V,G,K,Q,Z,X,ee,te,ne,re,oe,ie,ae,se,ue,le,ce,de,fe,me,pe,he,ge,ye=t.kendo=t.kendo||{cultures:{}},ve=e.extend,be=e.each,we=e.isArray,Me=e.proxy,Se=e.noop,Te=Math,xe=t.JSON||{},ke={},Oe=/%/,ze=/\{(\d+)(:[^\}]+)?\}/g,De=/(\d+(?:\.?)\d*)px\s*(\d+(?:\.?)\d*)px\s*(\d+(?:\.?)\d*)px\s*(\d+)?/i,Ce=/^(\+|-?)\d+(\.?)\d*$/,Ee="function",He="string",Ae="number",_e="object",Ne="null",Pe="boolean",Fe="undefined",Re={},Ue={},Ie=[].slice;ye.version="2016.2.504".replace(/^\s+|\s+$/g,""),r.extend=function(e){var t,n,r=function(){},o=this,i=e&&e.init?e.init:function(){o.apply(this,arguments)};r.prototype=o.prototype,n=i.fn=i.prototype=new r;for(t in e)n[t]=null!=e[t]&&e[t].constructor===Object?ve(!0,{},r.prototype[t],e[t]):e[t];return n.constructor=i,i.extend=o.extend,i},r.prototype._initOptions=function(e){this.options=u({},this.options,e)},A=ye.isFunction=function(e){return"function"==typeof e},_=function(){this._defaultPrevented=!0},N=function(){return this._defaultPrevented===!0},P=r.extend({init:function(){this._events={}},bind:function(e,t,r){var o,i,a,s,u,l=this,c=typeof e===He?[e]:e,d=typeof t===Ee;if(t===n){for(o in e)l.bind(o,e[o]);return l}for(o=0,i=c.length;i>o;o++)e=c[o],s=d?t:t[e],s&&(r&&(a=s,s=function(){l.unbind(e,s),a.apply(l,arguments)},s.original=a),u=l._events[e]=l._events[e]||[],u.push(s));return l},one:function(e,t){return this.bind(e,t,!0)},first:function(e,t){var n,r,o,i,a=this,s=typeof e===He?[e]:e,u=typeof t===Ee;for(n=0,r=s.length;r>n;n++)e=s[n],o=u?t:t[e],o&&(i=a._events[e]=a._events[e]||[],i.unshift(o));return a},trigger:function(e,t){var n,r,o=this,i=o._events[e];if(i){for(t=t||{},t.sender=o,t._defaultPrevented=!1,t.preventDefault=_,t.isDefaultPrevented=N,i=i.slice(),n=0,r=i.length;r>n;n++)i[n].call(o,t);return t._defaultPrevented===!0}return!1},unbind:function(e,t){var r,o=this,i=o._events[e];if(e===n)o._events={};else if(i)if(t)for(r=i.length-1;r>=0;r--)(i[r]===t||i[r].original===t)&&i.splice(r,1);else o._events[e]=[];return o}}),F=/^\w+/,R=/\$\{([^}]*)\}/g,U=/\\\}/g,I=/__CURLY__/g,$=/\\#/g,L=/__SHARP__/g,W=["","0","00","000","0000"],H={paramName:"data",useWithBlock:!0,render:function(e,t){var n,r,o="";for(n=0,r=t.length;r>n;n++)o+=e(t[n]);return o},compile:function(e,t){var n,r,i,a=ve({},this,t),s=a.paramName,u=s.match(F)[0],l=a.useWithBlock,c="var $kendoOutput, $kendoHtmlEncode = kendo.htmlEncode;";if(A(e))return e;for(c+=l?"with("+s+"){":"",c+="$kendoOutput=",r=e.replace(U,"__CURLY__").replace(R,"#=$kendoHtmlEncode($1)#").replace(I,"}").replace($,"__SHARP__").split("#"),i=0;r.length>i;i++)c+=o(r[i],i%2===0);c+=l?";}":";",c+="return $kendoOutput;",c=c.replace(L,"#");try{return n=Function(u,c),n._slotCount=Math.floor(r.length/2),n}catch(d){throw Error(ye.format("Invalid template:'{0}' Generated code:'{1}'",e,c))}}},function(){function e(e){return a.lastIndex=0,a.test(e)?'"'+e.replace(a,function(e){var t=s[e];return typeof t===He?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function t(i,a){var s,l,c,d,f,m,p=n,h=a[i];if(h&&typeof h===_e&&typeof h.toJSON===Ee&&(h=h.toJSON(i)),typeof o===Ee&&(h=o.call(a,i,h)),m=typeof h,m===He)return e(h);if(m===Ae)return isFinite(h)?h+"":Ne;if(m===Pe||m===Ne)return h+"";if(m===_e){if(!h)return Ne;if(n+=r,f=[],"[object Array]"===u.apply(h)){for(d=h.length,s=0;d>s;s++)f[s]=t(s,h)||Ne;return c=0===f.length?"[]":n?"[\n"+n+f.join(",\n"+n)+"\n"+p+"]":"["+f.join(",")+"]",n=p,c}if(o&&typeof o===_e)for(d=o.length,s=0;d>s;s++)typeof o[s]===He&&(l=o[s],c=t(l,h),c&&f.push(e(l)+(n?": ":":")+c));else for(l in h)Object.hasOwnProperty.call(h,l)&&(c=t(l,h),c&&f.push(e(l)+(n?": ":":")+c));return c=0===f.length?"{}":n?"{\n"+n+f.join(",\n"+n)+"\n"+p+"}":"{"+f.join(",")+"}",n=p,c}}var n,r,o,a=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,s={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},u={}.toString;typeof Date.prototype.toJSON!==Ee&&(Date.prototype.toJSON=function(){var e=this;return isFinite(e.valueOf())?i(e.getUTCFullYear(),4)+"-"+i(e.getUTCMonth()+1)+"-"+i(e.getUTCDate())+"T"+i(e.getUTCHours())+":"+i(e.getUTCMinutes())+":"+i(e.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()}),typeof xe.stringify!==Ee&&(xe.stringify=function(e,i,a){var s;if(n="",r="",typeof a===Ae)for(s=0;a>s;s+=1)r+=" ";else typeof a===He&&(r=a);if(o=i,i&&typeof i!==Ee&&(typeof i!==_e||typeof i.length!==Ae))throw Error("JSON.stringify");return t("",{"":e})})}(),function(){function e(e){if(e){if(e.numberFormat)return e;if(typeof e===He){var t=ye.cultures;return t[e]||t[e.split("-")[0]]||null}return null}return null}function t(t){return t&&(t=e(t)),t||ye.cultures.current}function r(e,r,o){o=t(o);var a=o.calendars.standard,s=a.days,u=a.months;return r=a.patterns[r]||r,r.replace(l,function(t){var r,o,l;return"d"===t?o=e.getDate():"dd"===t?o=i(e.getDate()):"ddd"===t?o=s.namesAbbr[e.getDay()]:"dddd"===t?o=s.names[e.getDay()]:"M"===t?o=e.getMonth()+1:"MM"===t?o=i(e.getMonth()+1):"MMM"===t?o=u.namesAbbr[e.getMonth()]:"MMMM"===t?o=u.names[e.getMonth()]:"yy"===t?o=i(e.getFullYear()%100):"yyyy"===t?o=i(e.getFullYear(),4):"h"===t?o=e.getHours()%12||12:"hh"===t?o=i(e.getHours()%12||12):"H"===t?o=e.getHours():"HH"===t?o=i(e.getHours()):"m"===t?o=e.getMinutes():"mm"===t?o=i(e.getMinutes()):"s"===t?o=e.getSeconds():"ss"===t?o=i(e.getSeconds()):"f"===t?o=Te.floor(e.getMilliseconds()/100):"ff"===t?(o=e.getMilliseconds(),o>99&&(o=Te.floor(o/10)),o=i(o)):"fff"===t?o=i(e.getMilliseconds(),3):"tt"===t?o=e.getHours()<12?a.AM[0]:a.PM[0]:"zzz"===t?(r=e.getTimezoneOffset(),l=0>r,o=(""+Te.abs(r/60)).split(".")[0],r=Te.abs(r)-60*o,o=(l?"+":"-")+i(o),o+=":"+i(r)):("zz"===t||"z"===t)&&(o=e.getTimezoneOffset()/60,l=0>o,o=(""+Te.abs(o)).split(".")[0],o=(l?"+":"-")+("zz"===t?i(o):o)),o!==n?o:t.slice(1,t.length-1)})}function o(e,r,o){o=t(o);var i,u,l,b,w,M,S,T,x,k,O,z,D,C,E,H,A,_,N,P,F,R,U,I=o.numberFormat,$=I[p],L=I.decimals,W=I.pattern[0],j=[],B=0>e,J=m,Y=m,q=-1;if(e===n)return m;if(!isFinite(e))return e;if(!r)return o.name.length?e.toLocaleString():""+e;if(w=c.exec(r)){if(r=w[1].toLowerCase(),u="c"===r,l="p"===r,(u||l)&&(I=u?I.currency:I.percent,$=I[p],L=I.decimals,i=I.symbol,W=I.pattern[B?0:1]),b=w[2],b&&(L=+b),"e"===r)return b?e.toExponential(L):e.toExponential();if(l&&(e*=100),e=s(e,L),B=0>e,e=e.split(p),M=e[0],S=e[1],B&&(M=M.substring(1)),Y=a(M,0,M.length,I),S&&(Y+=$+S),"n"===r&&!B)return Y;for(e=m,k=0,O=W.length;O>k;k++)z=W.charAt(k),e+="n"===z?Y:"$"===z||"%"===z?i:z;return e}if(B&&(e=-e),(r.indexOf("'")>-1||r.indexOf('"')>-1||r.indexOf("\\")>-1)&&(r=r.replace(d,function(e){var t=e.charAt(0).replace("\\",""),n=e.slice(1).replace(t,"");return j.push(n),v})),r=r.split(";"),B&&r[1])r=r[1],C=!0;else if(0===e){if(r=r[2]||r[0],-1==r.indexOf(g)&&-1==r.indexOf(y))return r}else r=r[0];if(P=r.indexOf("%"),F=r.indexOf("$"),l=-1!=P,u=-1!=F,l&&(e*=100),u&&"\\"===r[F-1]&&(r=r.split("\\").join(""),u=!1),(u||l)&&(I=u?I.currency:I.percent,$=I[p],L=I.decimals,i=I.symbol),D=r.indexOf(h)>-1,D&&(r=r.replace(f,m)),E=r.indexOf(p),O=r.length,-1!=E?(S=(""+e).split("e"),S=S[1]?s(e,Math.abs(S[1])):S[0],S=S.split(p)[1]||m,A=r.lastIndexOf(y)-E,H=r.lastIndexOf(g)-E,_=A>-1,N=H>-1,k=S.length,_||N||(r=r.substring(0,E)+r.substring(E+1),O=r.length,E=-1,k=0),_&&A>H?k=A:H>A&&(N&&k>H?k=H:_&&A>k&&(k=A)),k>-1&&(e=s(e,k))):e=s(e),H=r.indexOf(g),R=A=r.indexOf(y),q=-1==H&&-1!=A?A:-1!=H&&-1==A?H:H>A?A:H,H=r.lastIndexOf(g),A=r.lastIndexOf(y),U=-1==H&&-1!=A?A:-1!=H&&-1==A?H:H>A?H:A,q==O&&(U=q),-1!=q){for(Y=(""+e).split(p),M=Y[0],S=Y[1]||m,T=M.length,x=S.length,B&&-1*e>=0&&(B=!1),e=r.substring(0,q),B&&!C&&(e+="-"),k=q;O>k;k++){if(z=r.charAt(k),-1==E){if(T>U-k){e+=M;break}}else if(-1!=A&&k>A&&(J=m),T>=E-k&&E-k>-1&&(e+=M,k=E),E===k){e+=(S?$:m)+S,k+=U-E+1;continue}z===y?(e+=z,J=z):z===g&&(e+=J)}if(D&&(e=a(e,q,Math.max(U,T+q-1),I)),U>=q&&(e+=r.substring(U+1)),u||l){for(Y=m,k=0,O=e.length;O>k;k++)z=e.charAt(k),Y+="$"===z||"%"===z?i:z;e=Y}if(O=j.length)for(k=0;O>k;k++)e=e.replace(v,j[k])}return e}var a,s,u,l=/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,c=/^(n|c|p|e)(\d*)$/i,d=/(\\.)|(['][^']*[']?)|(["][^"]*["]?)/g,f=/\,/g,m="",p=".",h=",",g="#",y="0",v="??",b="en-US",w={}.toString;ye.cultures["en-US"]={name:b,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}}},ye.culture=function(t){var r,o=ye.cultures;return t===n?o.current:(r=e(t)||o[b],r.calendar=r.calendars.standard,o.current=r,n)},ye.findCulture=e,ye.getCulture=t,ye.culture(b),a=function(e,t,r,o){var i,a,s,u,l,c,d=e.indexOf(o[p]),f=o.groupSize.slice(),m=f.shift();if(r=-1!==d?d:r+1,i=e.substring(t,r),a=i.length,a>=m){for(s=a,u=[];s>-1;)if(l=i.substring(s-m,s),l&&u.push(l),s-=m,c=f.shift(),m=c!==n?c:m,0===m){u.push(i.substring(0,s));break}i=u.reverse().join(o[h]),e=e.substring(0,t)+i+e.substring(r)}return e},s=function(e,t){return t=t||0,e=(""+e).split("e"),e=Math.round(+(e[0]+"e"+(e[1]?+e[1]+t:t))),e=(""+e).split("e"),e=+(e[0]+"e"+(e[1]?+e[1]-t:-t)),e.toFixed(t)},u=function(e,t,i){if(t){if("[object Date]"===w.call(e))return r(e,t,i);if(typeof e===Ae)return o(e,t,i)}return e!==n?e:""},ye.format=function(e){var t=arguments;return e.replace(ze,function(e,n,r){var o=t[parseInt(n,10)+1];return u(o,r?r.substring(1):"")})},ye._extractFormat=function(e){return"{0:"===e.slice(0,3)&&(e=e.slice(3,e.length-1)),e},ye._activeElement=function(){try{return document.activeElement}catch(e){return document.documentElement.activeElement}},ye._round=s,ye.toString=u}(),function(){function t(e,t,n){return!(e>=t&&n>=e)}function r(e){return e.charAt(0)}function o(t){return e.map(t,r)}function i(e,t){t||23!==e.getHours()||e.setHours(e.getHours()+2)}function a(e){for(var t=0,n=e.length,r=[];n>t;t++)r[t]=(e[t]+"").toLowerCase();return r}function s(e){var t,n={};for(t in e)n[t]=a(e[t]);return n}function u(e,r,a){if(!e)return null;var u,l,c,d,p,h,g,v,b,w,M,S,T,x=function(e){for(var t=0;r[F]===e;)t++,F++;return t>0&&(F-=1),t},k=function(t){var n=y[t]||RegExp("^\\d{1,"+t+"}"),r=e.substr(R,t).match(n);return r?(r=r[0],R+=r.length,parseInt(r,10)):null},O=function(t,n){for(var r,o,i,a=0,s=t.length,u=0,l=0;s>a;a++)r=t[a],o=r.length,i=e.substr(R,o),n&&(i=i.toLowerCase()),i==r&&o>u&&(u=o,l=a);return u?(R+=u,l+1):null},z=function(){var t=!1;return e.charAt(R)===r[F]&&(R++,t=!0),t},D=a.calendars.standard,C=null,E=null,H=null,A=null,_=null,N=null,P=null,F=0,R=0,U=!1,I=new Date,$=D.twoDigitYearMax||2029,L=I.getFullYear();for(r||(r="d"),d=D.patterns[r],d&&(r=d),r=r.split(""),c=r.length;c>F;F++)if(u=r[F],U)"'"===u?U=!1:z();else if("d"===u){if(l=x("d"),D._lowerDays||(D._lowerDays=s(D.days)),null!==H&&l>2)continue;if(H=3>l?k(2):O(D._lowerDays[3==l?"namesAbbr":"names"],!0),null===H||t(H,1,31))return null}else if("M"===u){if(l=x("M"),D._lowerMonths||(D._lowerMonths=s(D.months)),E=3>l?k(2):O(D._lowerMonths[3==l?"namesAbbr":"names"],!0),null===E||t(E,1,12))return null;E-=1}else if("y"===u){if(l=x("y"),C=k(l),null===C)return null;2==l&&("string"==typeof $&&($=L+parseInt($,10)),C=L-L%100+C,C>$&&(C-=100))}else if("h"===u){if(x("h"),A=k(2),12==A&&(A=0),null===A||t(A,0,11))return null}else if("H"===u){if(x("H"),A=k(2),null===A||t(A,0,23))return null}else if("m"===u){if(x("m"),_=k(2),null===_||t(_,0,59))return null}else if("s"===u){if(x("s"),N=k(2),null===N||t(N,0,59))return null}else if("f"===u){if(l=x("f"),T=e.substr(R,l).match(y[3]),P=k(l),null!==P&&(P=parseFloat("0."+T[0],10),P=ye._round(P,3),P*=1e3),null===P||t(P,0,999))return null}else if("t"===u){if(l=x("t"),v=D.AM,b=D.PM,1===l&&(v=o(v),b=o(b)),p=O(b),!p&&!O(v))return null}else if("z"===u){if(h=!0,l=x("z"),"Z"===e.substr(R,1)){z();continue}if(g=e.substr(R,6).match(l>2?m:f),!g)return null;if(g=g[0].split(":"),w=g[0],M=g[1],!M&&w.length>3&&(R=w.length-2,M=w.substring(R),w=w.substring(0,R)),w=parseInt(w,10),t(w,-12,13))return null;if(l>2&&(M=parseInt(M,10),isNaN(M)||t(M,0,59)))return null}else if("'"===u)U=!0,z();else if(!z())return null;return S=null!==A||null!==_||N||null,null===C&&null===E&&null===H&&S?(C=L,E=I.getMonth(),H=I.getDate()):(null===C&&(C=L),null===H&&(H=1)),p&&12>A&&(A+=12),h?(w&&(A+=-w),M&&(_+=-M),e=new Date(Date.UTC(C,E,H,A,_,N,P))):(e=new Date(C,E,H,A,_,N,P),i(e,A)),100>C&&e.setFullYear(C),e.getDate()!==H&&h===n?null:e}function l(e){var t="-"===e.substr(0,1)?-1:1;return e=e.substring(1),e=60*parseInt(e.substr(0,2),10)+parseInt(e.substring(2),10),t*e}var c=/\u00A0/g,d=/[eE][\-+]?[0-9]+/,f=/[+|\-]\d{1,2}/,m=/[+|\-]\d{1,2}:?\d{2}/,p=/^\/Date\((.*?)\)\/$/,h=/[+-]\d*/,g=["G","g","d","F","D","y","m","T","t"],y={2:/^\d{1,2}/,3:/^\d{1,3}/,4:/^\d{4}/},v={}.toString;ye.parseDate=function(e,t,n){var r,o,i,a,s;if("[object Date]"===v.call(e))return e;if(r=0,o=null,e&&0===e.indexOf("/D")&&(o=p.exec(e)))return o=o[1],s=h.exec(o.substring(1)),o=new Date(parseInt(o,10)),s&&(s=l(s[0]),o=ye.timezone.apply(o,0),o=ye.timezone.convert(o,0,-1*s)),o;if(n=ye.getCulture(n),!t){for(t=[],a=n.calendar.patterns,i=g.length;i>r;r++)t[r]=a[g[r]];r=0,t=["yyyy/MM/dd HH:mm:ss","yyyy/MM/dd HH:mm","yyyy/MM/dd","ddd MMM dd yyyy HH:mm:ss","yyyy-MM-ddTHH:mm:ss.fffffffzzz","yyyy-MM-ddTHH:mm:ss.fffzzz","yyyy-MM-ddTHH:mm:sszzz","yyyy-MM-ddTHH:mm:ss.fffffff","yyyy-MM-ddTHH:mm:ss.fff","yyyy-MM-ddTHH:mmzzz","yyyy-MM-ddTHH:mmzz","yyyy-MM-ddTHH:mm:ss","yyyy-MM-ddTHH:mm","yyyy-MM-dd HH:mm:ss","yyyy-MM-dd HH:mm","yyyy-MM-dd","HH:mm:ss","HH:mm"].concat(t)}for(t=we(t)?t:[t],i=t.length;i>r;r++)if(o=u(e,t[r],n))return o;return o},ye.parseInt=function(e,t){var n=ye.parseFloat(e,t);return n&&(n=0|n),n},ye.parseFloat=function(e,t,n){if(!e&&0!==e)return null;if(typeof e===Ae)return e;e=""+e,t=ye.getCulture(t);var r,o,i=t.numberFormat,a=i.percent,s=i.currency,u=s.symbol,l=a.symbol,f=e.indexOf("-");return d.test(e)?(e=parseFloat(e.replace(i["."],".")),isNaN(e)&&(e=null),e):f>0?null:(f=f>-1,e.indexOf(u)>-1||n&&n.toLowerCase().indexOf("c")>-1?(i=s,r=i.pattern[0].replace("$",u).split("n"),e.indexOf(r[0])>-1&&e.indexOf(r[1])>-1&&(e=e.replace(r[0],"").replace(r[1],""),f=!0)):e.indexOf(l)>-1&&(o=!0,i=a,u=l),e=e.replace("-","").replace(u,"").replace(c," ").split(i[","].replace(c," ")).join("").replace(i["."],"."),e=parseFloat(e),isNaN(e)?e=null:f&&(e*=-1),e&&o&&(e/=100),e)}}(),function(){var r,o,i,a,s,u,l;ke._scrollbar=n,ke.scrollbar=function(e){if(isNaN(ke._scrollbar)||e){var t,n=document.createElement("div");return n.style.cssText="overflow:scroll;overflow-x:hidden;zoom:1;clear:both;display:block",n.innerHTML=" ",document.body.appendChild(n),ke._scrollbar=t=n.offsetWidth-n.scrollWidth,document.body.removeChild(n),t}return ke._scrollbar},ke.isRtl=function(t){return e(t).closest(".k-rtl").length>0},r=document.createElement("table");try{r.innerHTML="",ke.tbodyInnerHtml=!0}catch(d){ke.tbodyInnerHtml=!1}ke.touch="ontouchstart"in t,ke.msPointers=t.MSPointerEvent,ke.pointers=t.PointerEvent,o=ke.transitions=!1,i=ke.transforms=!1,a="HTMLElement"in t?HTMLElement.prototype:[],ke.hasHW3D="WebKitCSSMatrix"in t&&"m11"in new t.WebKitCSSMatrix||"MozPerspective"in document.documentElement.style||"msPerspective"in document.documentElement.style,be(["Moz","webkit","O","ms"],function(){var e,t=""+this,a=typeof r.style[t+"Transition"]===He;return a||typeof r.style[t+"Transform"]===He?(e=t.toLowerCase(),i={css:"ms"!=e?"-"+e+"-":"",prefix:t,event:"o"===e||"webkit"===e?e:""},a&&(o=i,o.event=o.event?o.event+"TransitionEnd":"transitionend"),!1):n}),r=null,ke.transforms=i,ke.transitions=o,ke.devicePixelRatio=t.devicePixelRatio===n?1:t.devicePixelRatio;try{ke.screenWidth=t.outerWidth||t.screen?t.screen.availWidth:t.innerWidth,ke.screenHeight=t.outerHeight||t.screen?t.screen.availHeight:t.innerHeight}catch(d){ke.screenWidth=t.screen.availWidth,ke.screenHeight=t.screen.availHeight}ke.detectOS=function(e){var n,r,o=!1,i=[],a=!/mobile safari/i.test(e),s={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/},u={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/},l={tablet:/playbook|ipad|fire/i},d={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(r in s)if(s.hasOwnProperty(r)&&(i=e.match(s[r]))){if("windows"==r&&"plugins"in navigator)return!1;o={},o.device=r,o.tablet=c(r,l,!1),o.browser=c(e,d,"default"),o.name=c(r,u),o[o.name]=!0,o.majorVersion=i[2],o.minorVersion=i[3].replace("_","."),n=o.minorVersion.replace(".","").substr(0,2),o.flatVersion=o.majorVersion+n+Array(3-(3>n.length?n.length:2)).join("0"),o.cordova=typeof t.PhoneGap!==Fe||typeof t.cordova!==Fe,o.appMode=t.navigator.standalone||/file|local|wmapp/.test(t.location.protocol)||o.cordova,o.android&&(1.5>ke.devicePixelRatio&&400>o.flatVersion||a)&&(ke.screenWidth>800||ke.screenHeight>800)&&(o.tablet=r);break}return o},s=ke.mobileOS=ke.detectOS(navigator.userAgent),ke.wpDevicePixelRatio=s.wp?screen.width/320:0,ke.kineticScrollNeeded=s&&(ke.touch||ke.msPointers||ke.pointers),ke.hasNativeScrolling=!1,(s.ios||s.android&&s.majorVersion>2||s.wp)&&(ke.hasNativeScrolling=s),ke.delayedClick=function(){if(ke.touch){if(s.ios)return!0;if(s.android)return ke.browser.chrome?32>ke.browser.version?!1:!(e("meta[name=viewport]").attr("content")||"").match(/user-scalable=no/i):!0}return!1},ke.mouseAndTouchPresent=ke.touch&&!(ke.mobileOS.ios||ke.mobileOS.android),ke.detectBrowser=function(e){var t,n=!1,r=[],o={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(t in o)if(o.hasOwnProperty(t)&&(r=e.match(o[t]))){n={},n[t]=!0,n[r[1].toLowerCase().split(" ")[0].split("/")[0]]=!0,n.version=parseInt(document.documentMode||r[2],10);break}return n},ke.browser=ke.detectBrowser(navigator.userAgent),ke.detectClipboardAccess=function(){var e={copy:document.queryCommandSupported?document.queryCommandSupported("copy"):!1,cut:document.queryCommandSupported?document.queryCommandSupported("cut"):!1,paste:document.queryCommandSupported?document.queryCommandSupported("paste"):!1};return ke.browser.chrome&&(e.paste=!1,ke.browser.version>=43&&(e.copy=!0,e.cut=!0)),e},ke.clipboard=ke.detectClipboardAccess(),ke.zoomLevel=function(){var e,n,r;try{return e=ke.browser,n=0,r=document.documentElement,e.msie&&11==e.version&&r.scrollHeight>r.clientHeight&&!ke.touch&&(n=ke.scrollbar()),ke.touch?r.clientWidth/t.innerWidth:e.msie&&e.version>=10?((top||t).document.documentElement.offsetWidth+n)/(top||t).innerWidth:1}catch(o){return 1}},ke.cssBorderSpacing=n!==document.documentElement.style.borderSpacing&&!(ke.browser.msie&&8>ke.browser.version),function(t){var n="",r=e(document.documentElement),o=parseInt(t.version,10);t.msie?n="ie":t.mozilla?n="ff":t.safari?n="safari":t.webkit?n="webkit":t.opera?n="opera":t.edge&&(n="edge"),n&&(n="k-"+n+" k-"+n+o),ke.mobileOS&&(n+=" k-mobile"),r.addClass(n)}(ke.browser),ke.eventCapture=document.documentElement.addEventListener,u=document.createElement("input"),ke.placeholder="placeholder"in u,ke.propertyChangeEvent="onpropertychange"in u,ke.input=function(){for(var e,t=["number","date","time","month","week","datetime","datetime-local"],n=t.length,r="test",o={},i=0;n>i;i++)e=t[i],u.setAttribute("type",e),u.value=r,o[e.replace("-","")]="text"!==u.type&&u.value!==r;return o}(),u.style.cssText="float:left;",ke.cssFloat=!!u.style.cssFloat,u=null,ke.stableSort=function(){var e,t=513,n=[{index:0,field:"b"}];for(e=1;t>e;e++)n.push({index:e,field:"a"});return n.sort(function(e,t){return e.field>t.field?1:t.field>e.field?-1:0}),1===n[0].index}(),ke.matchesSelector=a.webkitMatchesSelector||a.mozMatchesSelector||a.msMatchesSelector||a.oMatchesSelector||a.matchesSelector||a.matches||function(t){for(var n=document.querySelectorAll?(this.parentNode||document).querySelectorAll(t)||[]:e(t),r=n.length;r--;)if(n[r]==this)return!0;return!1},ke.pushState=t.history&&t.history.pushState,l=document.documentMode,ke.hashChange="onhashchange"in t&&!(ke.browser.msie&&(!l||8>=l)),ke.customElements="registerElement"in t.document}(),j={left:{reverse:"right"},right:{reverse:"left"},down:{reverse:"up"},up:{reverse:"down"},top:{reverse:"bottom"},bottom:{reverse:"top"},"in":{reverse:"out"},out:{reverse:"in"}},B={},e.extend(B,{enabled:!0,Element:function(t){this.element=e(t)},promise:function(e,t){e.is(":visible")||e.css({display:e.data("olddisplay")||"block"}).css("display"),t.hide&&e.data("olddisplay",e.css("display")).hide(),t.init&&t.init(),t.completeCallback&&t.completeCallback(e),e.dequeue()},disable:function(){this.enabled=!1,this.promise=this.promiseShim},enable:function(){this.enabled=!0,this.promise=this.animatedPromise}}),B.promiseShim=B.promise,"kendoAnimate"in e.fn||ve(e.fn,{kendoStop:function(e,t){return this.stop(e,t)},kendoAnimate:function(e,t,n,r){return M(this,e,t,n,r)},kendoAddClass:function(e,t){return ye.toggleClass(this,e,t,!0)},kendoRemoveClass:function(e,t){return ye.toggleClass(this,e,t,!1)},kendoToggleClass:function(e,t,n){return ye.toggleClass(this,e,t,n)}}),J=/&/g,Y=//g,K=function(e){return e.target},ke.touch&&(K=function(e){var t="originalEvent"in e?e.originalEvent.changedTouches:"changedTouches"in e?e.changedTouches:null;return t?document.elementFromPoint(t[0].clientX,t[0].clientY):e.target},be(["swipe","swipeLeft","swipeRight","swipeUp","swipeDown","doubleTap","tap"],function(t,n){e.fn[n]=function(e){return this.bind(n,e)}})),ke.touch?ke.mobileOS?(ke.mousedown="touchstart",ke.mouseup="touchend",ke.mousemove="touchmove",ke.mousecancel="touchcancel",ke.click="touchend",ke.resize="orientationchange"):(ke.mousedown="mousedown touchstart",ke.mouseup="mouseup touchend",ke.mousemove="mousemove touchmove",ke.mousecancel="mouseleave touchcancel",ke.click="click",ke.resize="resize"):ke.pointers?(ke.mousemove="pointermove",ke.mousedown="pointerdown",ke.mouseup="pointerup",ke.mousecancel="pointercancel",ke.click="pointerup",ke.resize="orientationchange resize"):ke.msPointers?(ke.mousemove="MSPointerMove",ke.mousedown="MSPointerDown",ke.mouseup="MSPointerUp",ke.mousecancel="MSPointerCancel",ke.click="MSPointerUp",ke.resize="orientationchange resize"):(ke.mousemove="mousemove",ke.mousedown="mousedown",ke.mouseup="mouseup",ke.mousecancel="mouseleave",ke.click="click",ke.resize="resize"),Q=function(e,t){var n,r,o,i,a=t||"d",s=1;for(r=0,o=e.length;o>r;r++)i=e[r],""!==i&&(n=i.indexOf("["),0!==n&&(-1==n?i="."+i:(s++,i="."+i.substring(0,n)+" || {})"+i.substring(n))),s++,a+=i+(o-1>r?" || {})":")"));return Array(s).join("(")+a},Z=/^([a-z]+:)?\/\//i,ve(ye,{widgets:[],_widgetRegisteredCallbacks:[],ui:ye.ui||{},fx:ye.fx||b,effects:ye.effects||B,mobile:ye.mobile||{},data:ye.data||{},dataviz:ye.dataviz||{},drawing:ye.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:ye.support||ke,animate:ye.animate||M,ns:"",attr:function(e){return"data-"+ye.ns+e},getShadows:a,wrap:s,deepExtend:u,getComputedStyles:m,webComponents:ye.webComponents||[],isScrollable:p,scrollLeft:h,size:g,toCamelCase:f,toHyphens:d,getOffset:ye.getOffset||y,parseEffects:ye.parseEffects||v,toggleClass:ye.toggleClass||S,directions:ye.directions||j,Observable:P,Class:r,Template:H,template:Me(H.compile,H),render:Me(H.render,H),stringify:Me(xe.stringify,xe),eventTarget:K,htmlEncode:T,isLocalUrl:function(e){return e&&!Z.test(e)},expr:function(e,t,n){return e=e||"",typeof t==He&&(n=t,t=!1),n=n||"d",e&&"["!==e.charAt(0)&&(e="."+e),t?(e=e.replace(/"([^.]*)\.([^"]*)"/g,'"$1_$DOT$_$2"'),e=e.replace(/'([^.]*)\.([^']*)'/g,"'$1_$DOT$_$2'"),e=Q(e.split("."),n),e=e.replace(/_\$DOT\$_/g,".")):e=n+e,e},getter:function(e,t){var n=e+t;return Re[n]=Re[n]||Function("d","return "+ye.expr(e,t))},setter:function(e){return Ue[e]=Ue[e]||Function("d,value",ye.expr(e)+"=value")},accessor:function(e){return{get:ye.getter(e),set:ye.setter(e)}},guid:function(){var e,t,n="";for(e=0;32>e;e++)t=16*Te.random()|0,(8==e||12==e||16==e||20==e)&&(n+="-"),n+=(12==e?4:16==e?3&t|8:t).toString(16);return n},roleSelector:function(e){return e.replace(/(\S+)/g,"["+ye.attr("role")+"=$1],").slice(0,-1)},directiveSelector:function(e){var t,n=e.split(" ");if(n)for(t=0;n.length>t;t++)"view"!=n[t]&&(n[t]=n[t].replace(/(\w*)(view|bar|strip|over)$/,"$1-$2"));return n.join(" ").replace(/(\S+)/g,"kendo-mobile-$1,").slice(0,-1)},triggeredByInput:function(e){return/^(label|input|textarea|select)$/i.test(e.target.tagName)},onWidgetRegistered:function(e){for(var t=0,n=ye.widgets.length;n>t;t++)e(ye.widgets[t]);ye._widgetRegisteredCallbacks.push(e)},logToConsole:function(e,r){var o=t.console;!ye.suppressLog&&n!==o&&o.log&&o[r||"log"](e)}}),X=P.extend({init:function(e,t){var n,r=this;r.element=ye.jQuery(e).handler(r),r.angular("init",t),P.fn.init.call(r),n=t?t.dataSource:null,n&&(t=ve({},t,{dataSource:{}})),t=r.options=ve(!0,{},r.options,t),n&&(t.dataSource=n),r.element.attr(ye.attr("role"))||r.element.attr(ye.attr("role"),(t.name||"").toLowerCase()),r.element.data("kendo"+t.prefix+t.name,r),r.bind(r.events,t); },events:[],options:{prefix:""},_hasBindingTarget:function(){return!!this.element[0].kendoBindingTarget},_tabindex:function(e){e=e||this.wrapper;var t=this.element,n="tabindex",r=e.attr(n)||t.attr(n);t.removeAttr(n),e.attr(n,isNaN(r)?0:r)},setOptions:function(t){this._setEvents(t),e.extend(this.options,t)},_setEvents:function(e){for(var t,n=this,r=0,o=n.events.length;o>r;r++)t=n.events[r],n.options[t]&&e[t]&&n.unbind(t,n.options[t]);n.bind(n.events,e)},resize:function(e){var t=this.getSize(),n=this._size;(e||(t.width>0||t.height>0)&&(!n||t.width!==n.width||t.height!==n.height))&&(this._size=t,this._resize(t,e),this.trigger("resize",t))},getSize:function(){return ye.dimensions(this.element)},size:function(e){return e?(this.setSize(e),n):this.getSize()},setSize:e.noop,_resize:e.noop,destroy:function(){var e=this;e.element.removeData("kendo"+e.options.prefix+e.options.name),e.element.removeData("handler"),e.unbind()},_destroy:function(){this.destroy()},angular:function(){},_muteAngularRebind:function(e){this._muteRebind=!0,e.call(this),this._muteRebind=!1}}),ee=X.extend({dataItems:function(){return this.dataSource.flatView()},_angularItems:function(t){var n=this;n.angular(t,function(){return{elements:n.items(),data:e.map(n.dataItems(),function(e){return{dataItem:e}})}})}}),ye.dimensions=function(e,t){var n=e[0];return t&&e.css(t),{width:n.offsetWidth,height:n.offsetHeight}},ye.notify=Se,te=/template$/i,ne=/^\s*(?:\{(?:.|\r\n|\n)*\}|\[(?:.|\r\n|\n)*\])\s*$/,re=/^\{(\d+)(:[^\}]+)?\}|^\[[A-Za-z_]*\]$/,oe=/([A-Z])/g,ye.initWidget=function(r,o,i){var a,s,u,l,c,d,f,m,p,h,g,y,v;if(i?i.roles&&(i=i.roles):i=ye.ui.roles,r=r.nodeType?r:r[0],d=r.getAttribute("data-"+ye.ns+"role")){p=-1===d.indexOf("."),u=p?i[d]:ye.getter(d)(t),g=e(r).data(),y=u?"kendo"+u.fn.options.prefix+u.fn.options.name:"",h=p?RegExp("^kendo.*"+d+"$","i"):RegExp("^"+y+"$","i");for(v in g)if(v.match(h)){if(v!==y)return g[v];a=g[v]}if(u){for(m=x(r,"dataSource"),o=e.extend({},k(r,u.fn.options),o),m&&(o.dataSource=typeof m===He?ye.getter(m)(t):m),l=0,c=u.fn.events.length;c>l;l++)s=u.fn.events[l],f=x(r,s),f!==n&&(o[s]=ye.getter(f)(t));return a?e.isEmptyObject(o)||a.setOptions(o):a=new u(r,o),a}}},ye.rolesFromNamespaces=function(e){var t,n,r=[];for(e[0]||(e=[ye.ui,ye.dataviz.ui]),t=0,n=e.length;n>t;t++)r[t]=e[t].roles;return ve.apply(null,[{}].concat(r.reverse()))},ye.init=function(t){var n=ye.rolesFromNamespaces(Ie.call(arguments,1));e(t).find("[data-"+ye.ns+"role]").addBack().each(function(){ye.initWidget(this,{},n)})},ye.destroy=function(t){e(t).find("[data-"+ye.ns+"role]").addBack().each(function(){var t,n=e(this).data();for(t in n)0===t.indexOf("kendo")&&typeof n[t].destroy===Ee&&n[t].destroy()})},ye.resize=function(t,n){var r,o=e(t).find("[data-"+ye.ns+"role]").addBack().filter(z);o.length&&(r=e.makeArray(o),r.sort(O),e.each(r,function(){var t=ye.widgetInstance(e(this));t&&t.resize(n)}))},ye.parseOptions=k,ve(ye.ui,{Widget:X,DataBoundWidget:ee,roles:{},progress:function(t,n){var r,o,i,a,s=t.find(".k-loading-mask"),u=ye.support,l=u.browser;n?s.length||(r=u.isRtl(t),o=r?"right":"left",a=t.scrollLeft(),i=l.webkit&&r?t[0].scrollWidth-t.width()-2*a:0,s=e("
Loading...
").width("100%").height("100%").css("top",t.scrollTop()).css(o,Math.abs(a)+i).prependTo(t)):s&&s.remove()},plugin:function(t,r,o){var i,a,s,u,l=t.fn.options.name;for(r=r||ye.ui,o=o||"",r[l]=t,r.roles[l.toLowerCase()]=t,i="getKendo"+o+l,l="kendo"+o+l,a={name:l,widget:t,prefix:o||""},ye.widgets.push(a),s=0,u=ye._widgetRegisteredCallbacks.length;u>s;s++)ye._widgetRegisteredCallbacks[s](a);e.fn[l]=function(r){var o,i=this;return typeof r===He?(o=Ie.call(arguments,1),this.each(function(){var t,a,s=e.data(this,l);if(!s)throw Error(ye.format("Cannot call method '{0}' of {1} before it is initialized",r,l));if(t=s[r],typeof t!==Ee)throw Error(ye.format("Cannot find method '{0}' of {1}",r,l));return a=t.apply(s,o),a!==n?(i=a,!1):n})):this.each(function(){return new t(this,r)}),i},e.fn[l].widget=t,e.fn[i]=function(){return this.data(l)}}}),ie={bind:function(){return this},nullObject:!0,options:{}},ae=X.extend({init:function(e,t){X.fn.init.call(this,e,t),this.element.autoApplyNS(),this.wrapper=this.element,this.element.addClass("km-widget")},destroy:function(){X.fn.destroy.call(this),this.element.kendoDestroy()},options:{prefix:"Mobile"},events:[],view:function(){var e=this.element.closest(ye.roleSelector("view splitview modalview drawer"));return ye.widgetInstance(e,ye.mobile.ui)||ie},viewHasNativeScrolling:function(){var e=this.view();return e&&e.options.useNativeScrolling},container:function(){var e=this.element.closest(ye.roleSelector("view layout modalview drawer splitview"));return ye.widgetInstance(e.eq(0),ye.mobile.ui)||ie}}),ve(ye.mobile,{init:function(e){ye.init(e,ye.mobile.ui,ye.ui,ye.dataviz.ui)},appLevelNativeScrolling:function(){return ye.mobile.application&&ye.mobile.application.options&&ye.mobile.application.options.useNativeScrolling},roles:{},ui:{Widget:ae,DataBoundWidget:ee.extend(ae.prototype),roles:{},plugin:function(e){ye.ui.plugin(e,ye.mobile.ui,"Mobile")}}}),u(ye.dataviz,{init:function(e){ye.init(e,ye.dataviz.ui)},ui:{roles:{},themes:{},views:[],plugin:function(e){ye.ui.plugin(e,ye.dataviz.ui)}},roles:{}}),ye.touchScroller=function(t,n){return n||(n={}),n.useNative=!0,e(t).map(function(t,r){return r=e(r),ke.kineticScrollNeeded&&ye.mobile.ui.Scroller&&!r.data("kendoMobileScroller")?(r.kendoMobileScroller(n),r.data("kendoMobileScroller")):!1})[0]},ye.preventDefault=function(e){e.preventDefault()},ye.widgetInstance=function(e,n){var r,o,i,a,s=e.data(ye.ns+"role"),u=[];if(s){if("content"===s&&(s="scroller"),n)if(n[0])for(r=0,o=n.length;o>r;r++)u.push(n[r].roles[s]);else u.push(n.roles[s]);else u=[ye.ui.roles[s],ye.dataviz.ui.roles[s],ye.mobile.ui.roles[s]];for(s.indexOf(".")>=0&&(u=[ye.getter(s)(t)]),r=0,o=u.length;o>r;r++)if(i=u[r],i&&(a=e.data("kendo"+i.fn.options.prefix+i.fn.options.name)))return a}},ye.onResize=function(n){var r=n;return ke.mobileOS.android&&(r=function(){setTimeout(n,600)}),e(t).on(ke.resize,r),r},ye.unbindResize=function(n){e(t).off(ke.resize,n)},ye.attrValue=function(e,t){return e.data(ye.ns+t)},ye.days={Sunday:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6},e.extend(e.expr[":"],{kendoFocusable:function(t){var n=e.attr(t,"tabindex");return D(t,!isNaN(n)&&n>-1)}}),se=["mousedown","mousemove","mouseenter","mouseleave","mouseover","mouseout","mouseup","click"],ue="label, input, [data-rel=external]",le={setupMouseMute:function(){var t,n=0,r=se.length,o=document.documentElement;if(!le.mouseTrap&&ke.eventCapture)for(le.mouseTrap=!0,le.bustClick=!1,le.captureMouse=!1,t=function(t){le.captureMouse&&("click"===t.type?le.bustClick&&!e(t.target).is(ue)&&(t.preventDefault(),t.stopPropagation()):t.stopPropagation())};r>n;n++)o.addEventListener(se[n],t,!0)},muteMouse:function(e){le.captureMouse=!0,e.data.bustClick&&(le.bustClick=!0),clearTimeout(le.mouseTrapTimeoutID)},unMuteMouse:function(){clearTimeout(le.mouseTrapTimeoutID),le.mouseTrapTimeoutID=setTimeout(function(){le.captureMouse=!1,le.bustClick=!1},400)}},ce={down:"touchstart mousedown",move:"mousemove touchmove",up:"mouseup touchend touchcancel",cancel:"mouseleave touchcancel"},ke.touch&&(ke.mobileOS.ios||ke.mobileOS.android)?ce={down:"touchstart",move:"touchmove",up:"touchend touchcancel",cancel:"touchcancel"}:ke.pointers?ce={down:"pointerdown",move:"pointermove",up:"pointerup",cancel:"pointercancel pointerleave"}:ke.msPointers&&(ce={down:"MSPointerDown",move:"MSPointerMove",up:"MSPointerUp",cancel:"MSPointerCancel MSPointerLeave"}),!ke.msPointers||"onmspointerenter"in t||e.each({MSPointerEnter:"MSPointerOver",MSPointerLeave:"MSPointerOut"},function(t,n){e.event.special[t]={delegateType:n,bindType:n,handle:function(t){var r,o=this,i=t.relatedTarget,a=t.handleObj;return(!i||i!==o&&!e.contains(o,i))&&(t.type=a.origType,r=a.handler.apply(this,arguments),t.type=n),r}}}),de=function(e){return ce[e]||e},fe=/([^ ]+)/g,ye.applyEventMap=function(e,t){return e=e.replace(fe,de),t&&(e=e.replace(fe,"$1."+t)),e},me=e.fn.on,ve(!0,E,e),E.fn=E.prototype=new e,E.fn.constructor=E,E.fn.init=function(t,n){return n&&n instanceof e&&!(n instanceof E)&&(n=E(n)),e.fn.init.call(this,t,n,pe)},E.fn.init.prototype=E.fn,pe=E(document),ve(E.fn,{handler:function(e){return this.data("handler",e),this},autoApplyNS:function(e){return this.data("kendoNS",e||ye.guid()),this},on:function(){var e,t,n,r,o,i,a=this,s=a.data("kendoNS");return 1===arguments.length?me.call(a,arguments[0]):(e=a,t=Ie.call(arguments),typeof t[t.length-1]===Fe&&t.pop(),n=t[t.length-1],r=ye.applyEventMap(t[0],s),ke.mouseAndTouchPresent&&r.search(/mouse|click/)>-1&&this[0]!==document.documentElement&&(le.setupMouseMute(),o=2===t.length?null:t[1],i=r.indexOf("click")>-1&&r.indexOf("touchend")>-1,me.call(this,{touchstart:le.muteMouse,touchend:le.unMuteMouse},o,{bustClick:i})),typeof n===He&&(e=a.data("handler"),n=e[n],t[t.length-1]=function(t){n.call(e,t)}),t[0]=r,me.apply(a,t),a)},kendoDestroy:function(e){return e=e||this.data("kendoNS"),e&&this.off("."+e),this}}),ye.jQuery=E,ye.eventMap=ce,ye.timezone=function(){function e(e,t){var n,r,o,i=t[3],a=t[4],s=t[5],u=t[8];return u||(t[8]=u={}),u[e]?u[e]:(isNaN(a)?0===a.indexOf("last")?(n=new Date(Date.UTC(e,c[i]+1,1,s[0]-24,s[1],s[2],0)),r=d[a.substr(4,3)],o=n.getUTCDay(),n.setUTCDate(n.getUTCDate()+r-o-(r>o?7:0))):a.indexOf(">=")>=0&&(n=new Date(Date.UTC(e,c[i],a.substr(5),s[0],s[1],s[2],0)),r=d[a.substr(0,3)],o=n.getUTCDay(),n.setUTCDate(n.getUTCDate()+r-o+(o>r?7:0))):n=new Date(Date.UTC(e,c[i],a,s[0],s[1],s[2],0)),u[e]=n)}function t(t,n,r){var o,i,a,s;return(n=n[r])?(a=new Date(t).getUTCFullYear(),n=jQuery.grep(n,function(e){var t=e[0],n=e[1];return a>=t&&(n>=a||t==a&&"only"==n||"max"==n)}),n.push(t),n.sort(function(t,n){return"number"!=typeof t&&(t=+e(a,t)),"number"!=typeof n&&(n=+e(a,n)),t-n}),s=n[jQuery.inArray(t,n)-1]||n[n.length-1],isNaN(s)?s:null):(o=r.split(":"),i=0,o.length>1&&(i=60*o[0]+ +o[1]),[-1e6,"max","-","Jan",1,[0,0,0],i,"-"])}function n(e,t,n){var r,o,i,a=t[n];if("string"==typeof a&&(a=t[a]),!a)throw Error('Timezone "'+n+'" is either incorrect, or kendo.timezones.min.js is not included.');for(r=a.length-1;r>=0&&(o=a[r][3],!(o&&e>o));r--);if(i=a[r+1],!i)throw Error('Timezone "'+n+'" not found on '+e+".");return i}function r(e,r,o,i){typeof e!=Ae&&(e=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));var a=n(e,r,i);return{zone:a,rule:t(e,o,a[1])}}function o(e,t){var n,o,i;return"Etc/UTC"==t||"Etc/GMT"==t?0:(n=r(e,this.zones,this.rules,t),o=n.zone,i=n.rule,ye.parseFloat(i?o[0]-i[6]:o[0]))}function i(e,t){var n=r(e,this.zones,this.rules,t),o=n.zone,i=n.rule,a=o[2];return a.indexOf("/")>=0?a.split("/")[i&&+i[6]?1:0]:a.indexOf("%s")>=0?a.replace("%s",i&&"-"!=i[7]?i[7]:""):a}function a(e,t,n){var r,o;return typeof t==He&&(t=this.offset(e,t)),typeof n==He&&(n=this.offset(e,n)),r=e.getTimezoneOffset(),e=new Date(e.getTime()+6e4*(t-n)),o=e.getTimezoneOffset(),new Date(e.getTime()+6e4*(o-r))}function s(e,t){return this.convert(e,e.getTimezoneOffset(),t)}function u(e,t){return this.convert(e,t,e.getTimezoneOffset())}function l(e){return this.apply(new Date(e),"Etc/UTC")}var c={Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11},d={Sun:0,Mon:1,Tue:2,Wed:3,Thu:4,Fri:5,Sat:6};return{zones:{},rules:{},offset:o,convert:a,apply:s,remove:u,abbr:i,toLocalDate:l}}(),ye.date=function(){function e(e,t){return 0===t&&23===e.getHours()?(e.setHours(e.getHours()+2),!0):!1}function t(t,n,r){var o=t.getHours();r=r||1,n=(n-t.getDay()+7*r)%7,t.setDate(t.getDate()+n),e(t,o)}function n(e,n,r){return e=new Date(e),t(e,n,r),e}function r(e){return new Date(e.getFullYear(),e.getMonth(),1)}function o(e){var t=new Date(e.getFullYear(),e.getMonth()+1,0),n=r(e),o=Math.abs(t.getTimezoneOffset()-n.getTimezoneOffset());return o&&t.setHours(n.getHours()+o/60),t}function i(t){return t=new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0),e(t,0),t}function a(e){return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function s(e){return e.getTime()-i(e)}function u(e,t,n){var r,o=s(t),i=s(n);return e&&o!=i?(t>=n&&(n+=y),r=s(e),o>r&&(r+=y),o>i&&(i+=y),r>=o&&i>=r):!0}function l(e,t,n){var r,o=t.getTime(),i=n.getTime();return o>=i&&(i+=y),r=e.getTime(),r>=o&&i>=r}function c(t,n){var r=t.getHours();return t=new Date(t),d(t,n*y),e(t,r),t}function d(e,t,n){var r,o=e.getTimezoneOffset();e.setTime(e.getTime()+t),n||(r=e.getTimezoneOffset()-o,e.setTime(e.getTime()+r*g))}function f(t,n){return t=new Date(ye.date.getDate(t).getTime()+ye.date.getMilliseconds(n)),e(t,n.getHours()),t}function m(){return i(new Date)}function p(e){return i(e).getTime()==m().getTime()}function h(e){var t=new Date(1980,1,1,0,0,0);return e&&t.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),t}var g=6e4,y=864e5;return{adjustDST:e,dayOfWeek:n,setDayOfWeek:t,getDate:i,isInDateRange:l,isInTimeRange:u,isToday:p,nextDay:function(e){return c(e,1)},previousDay:function(e){return c(e,-1)},toUtcTime:a,MS_PER_DAY:y,MS_PER_HOUR:60*g,MS_PER_MINUTE:g,setTime:d,setHours:f,addDays:c,today:m,toInvariantTime:h,firstDayOfMonth:r,lastDayOfMonth:o,getMilliseconds:s}}(),ye.stripWhitespace=function(e){var t,n,r;if(document.createNodeIterator)for(t=document.createNodeIterator(e,NodeFilter.SHOW_TEXT,function(t){return t.parentNode==e?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT},!1);t.nextNode();)t.referenceNode&&!t.referenceNode.textContent.trim()&&t.referenceNode.parentNode.removeChild(t.referenceNode);else for(n=0;e.childNodes.length>n;n++)r=e.childNodes[n],3!=r.nodeType||/\S/.test(r.nodeValue)||(e.removeChild(r),n--),1==r.nodeType&&ye.stripWhitespace(r)},he=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,1e3/60)},ye.animationFrame=function(e){he.call(t,e)},ge=[],ye.queueAnimation=function(e){ge[ge.length]=e,1===ge.length&&ye.runNextAnimation()},ye.runNextAnimation=function(){ye.animationFrame(function(){ge[0]&&(ge.shift()(),ge[0]&&ye.runNextAnimation())})},ye.parseQueryStringParams=function(e){for(var t=e.split("?")[1]||"",n={},r=t.split(/&|=/),o=r.length,i=0;o>i;i+=2)""!==r[i]&&(n[decodeURIComponent(r[i])]=decodeURIComponent(r[i+1]));return n},ye.elementUnderCursor=function(e){return n!==e.x.client?document.elementFromPoint(e.x.client,e.y.client):n},ye.wheelDeltaY=function(e){var t,r=e.originalEvent,o=r.wheelDeltaY;return r.wheelDelta?(o===n||o)&&(t=r.wheelDelta):r.detail&&r.axis===r.VERTICAL_AXIS&&(t=10*-r.detail),t},ye.throttle=function(e,t){var r,o,i=0;return!t||0>=t?e:(o=function(){function o(){e.apply(a,u),i=+new Date}var a=this,s=+new Date-i,u=arguments;return i?(r&&clearTimeout(r),s>t?o():r=setTimeout(o,t-s),n):o()},o.cancel=function(){clearTimeout(r)},o)},ye.caret=function(t,r,o){var i,a,s,u,l=r!==n;if(o===n&&(o=r),t[0]&&(t=t[0]),!l||!t.disabled){try{t.selectionStart!==n?l?(t.focus(),t.setSelectionRange(r,o)):r=[t.selectionStart,t.selectionEnd]:document.selection&&(e(t).is(":visible")&&t.focus(),i=t.createTextRange(),l?(i.collapse(!0),i.moveStart("character",r),i.moveEnd("character",o-r),i.select()):(a=i.duplicate(),i.moveToBookmark(document.selection.createRange().getBookmark()),a.setEndPoint("EndToStart",i),s=a.text.length,u=s+i.text.length,r=[s,u]))}catch(c){r=[]}return r}},ye.compileMobileDirective=function(e,n){var r=t.angular;return e.attr("data-"+ye.ns+"role",e[0].tagName.toLowerCase().replace("kendo-mobile-","").replace("-","")),r.element(e).injector().invoke(["$compile",function(t){t(e)(n),/^\$(digest|apply)$/.test(n.$$phase)||n.$digest()}]),ye.widgetInstance(e,ye.mobile.ui)},ye.antiForgeryTokens=function(){var t={},r=e("meta[name=csrf-token],meta[name=_csrf]").attr("content"),o=e("meta[name=csrf-param],meta[name=_csrf_header]").attr("content");return e("input[name^='__RequestVerificationToken']").each(function(){t[this.name]=this.value}),o!==n&&r!==n&&(t[o]=r),t},ye.cycleForm=function(e){function t(e){var t=ye.widgetInstance(e);t&&t.focus?t.focus():e.focus()}var n=e.find("input, .k-widget").first(),r=e.find("button, .k-button").last();r.on("keydown",function(e){e.keyCode!=ye.keys.TAB||e.shiftKey||(e.preventDefault(),t(n))}),n.on("keydown",function(e){e.keyCode==ye.keys.TAB&&e.shiftKey&&(e.preventDefault(),t(r))})},function(){function n(t,n,r,o){var i,a,s=e("
").attr({action:r,method:"POST",target:o}),u=ye.antiForgeryTokens();u.fileName=n,i=t.split(";base64,"),u.contentType=i[0].replace("data:",""),u.base64=i[1];for(a in u)u.hasOwnProperty(a)&&e("").attr({value:u[a],name:a,type:"hidden"}).appendTo(s);s.appendTo("body").submit().remove()}function r(e,t){var n,r,o,i,a,s=e;if("string"==typeof e){for(n=e.split(";base64,"),r=n[0],o=atob(n[1]),i=new Uint8Array(o.length),a=0;o.length>a;a++)i[a]=o.charCodeAt(a);s=new Blob([i.buffer],{type:r})}navigator.msSaveBlob(s,t)}function o(e,n){t.Blob&&e instanceof Blob&&(e=URL.createObjectURL(e)),i.download=n,i.href=e;var r=document.createEvent("MouseEvents");r.initMouseEvent("click",!0,!1,t,0,0,0,0,0,!1,!1,!1,!1,0,null),i.dispatchEvent(r),URL.revokeObjectURL(e)}var i=document.createElement("a"),a="download"in i&&!ye.support.browser.edge;ye.saveAs=function(e){var t=n;e.forceProxy||(a?t=o:navigator.msSaveBlob&&(t=r)),t(e.dataURI,e.fileName,e.proxyURL,e.proxyTarget)}}(),ye.proxyModelSetters=function(e){var t={};return Object.keys(e||{}).forEach(function(n){Object.defineProperty(t,n,{get:function(){return e[n]},set:function(t){e[n]=t,e.dirty=!0}})}),t}}(jQuery,window),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}); /*! kendo.data.min.js */ /** * Kendo UI v2016.2.504 (http://www.telerik.com/kendo-ui) * Copyright 2016 Telerik AD. All rights reserved. * * Kendo UI commercial licenses may be obtained at * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete * If you do not own a commercial license, this file shall be governed by the trial license terms. */ !function(e,define){define("kendo.data.min",["kendo.core.min","kendo.data.odata.min","kendo.data.xml.min"],e)}(function(){return function(e,t){function r(e,t,r,n){return function(i){var a,s={};for(a in i)s[a]=i[a];s.field=n?r+"."+i.field:r,t==ke&&e._notifyChange&&e._notifyChange(s),e.trigger(t,s)}}function n(t,r){if(t===r)return!0;var i,a=e.type(t),s=e.type(r);if(a!==s)return!1;if("date"===a)return t.getTime()===r.getTime();if("object"!==a&&"array"!==a)return!1;for(i in t)if(!n(t[i],r[i]))return!1;return!0}function i(e,t){var r,n;for(n in e){if(r=e[n],se(r)&&r.field&&r.field===t)return r;if(r===t)return r}return null}function a(e){this.data=e||[]}function s(e,r){if(e){var n=typeof e===ve?{field:e,dir:r}:e,i=ue(n)?n:n!==t?[n]:[];return le(i,function(e){return!!e.dir})}}function o(e){var t,r,n,i,a=e.filters;if(a)for(t=0,r=a.length;r>t;t++)n=a[t],i=n.operator,i&&typeof i===ve&&(n.operator=V[i.toLowerCase()]||i),o(n)}function u(e){return e&&!oe(e)?((ue(e)||!e.filters)&&(e={logic:"and",filters:ue(e)?e:[e]}),o(e),e):t}function l(e,t){return e.logic||t.logic?!1:e.field===t.field&&e.value===t.value&&e.operator===t.operator}function d(e){return e=e||{},oe(e)?{logic:"and",filters:[]}:u(e)}function h(e,t){return t.logic||e.field>t.field?1:t.field>e.field?-1:0}function f(e,t){var r,n,i,a,s;if(e=d(e),t=d(t),e.logic!==t.logic)return!1;if(i=(e.filters||[]).slice(),a=(t.filters||[]).slice(),i.length!==a.length)return!1;for(i=i.sort(h),a=a.sort(h),s=0;i.length>s;s++)if(r=i[s],n=a[s],r.logic&&n.logic){if(!f(r,n))return!1}else if(!l(r,n))return!1;return!0}function c(e){return ue(e)?e:[e]}function g(e,r){var n=typeof e===ve?{field:e,dir:r}:e,i=ue(n)?n:n!==t?[n]:[];return B(i,function(e){return{field:e.field,dir:e.dir||"asc",aggregates:e.aggregates}})}function p(e,t){return e&&e.getTime&&t&&t.getTime?e.getTime()===t.getTime():e===t}function _(e,t,r,n,i,a){var s,o,u,l,d;for(t=t||[],l=t.length,s=0;l>s;s++)o=t[s],u=o.aggregate,d=o.field,e[d]=e[d]||{},a[d]=a[d]||{},a[d][u]=a[d][u]||{},e[d][u]=W[u.toLowerCase()](e[d][u],r,ce.accessor(d),n,i,a[d][u])}function v(e){return"number"==typeof e&&!isNaN(e)}function m(e){return e&&e.getTime}function y(e){var t,r=e.length,n=Array(r);for(t=0;r>t;t++)n[t]=e[t].toJSON();return n}function S(e,t,r,n,i){var a,s,o,u,l,d={};for(u=0,l=e.length;l>u;u++){a=e[u];for(s in t)o=i[s],o&&o!==s&&(d[o]||(d[o]=ce.setter(o)),d[o](a,t[s](a)),delete a[s])}}function b(e,t,r,n,i){var a,s,o,u,l;for(u=0,l=e.length;l>u;u++){a=e[u];for(s in t)a[s]=r._parse(s,t[s](a)),o=i[s],o&&o!==s&&delete a[o]}}function w(e,t,r,n,i){var a,s,o,u;for(s=0,u=e.length;u>s;s++)a=e[s],o=n[a.field],o&&o!=a.field&&(a.field=o),a.value=r._parse(a.field,a.value),a.hasSubgroups?w(a.items,t,r,n,i):b(a.items,t,r,n,i)}function k(e,t,r,n,i,a){return function(s){return s=e(s),s&&!oe(n)&&("[object Array]"===Be.call(s)||s instanceof We||(s=[s]),r(s,n,new t,i,a)),s||[]}}function x(e,t,r,n){for(var i,a,s,o=0;t.length&&n&&(i=t[o],a=i.items,s=a.length,e&&e.field===i.field&&e.value===i.value?(e.hasSubgroups&&e.items.length?x(e.items[e.items.length-1],i.items,r,n):(a=a.slice(r,r+n),e.items=e.items.concat(a)),t.splice(o--,1)):i.hasSubgroups&&a.length?(x(i,a,r,n),i.items.length||t.splice(o--,1)):(a=a.slice(r,r+n),i.items=a,i.items.length||t.splice(o--,1)),0===a.length?r-=s:(r=0,n-=a.length),!(++o>=t.length)););t.length>o&&t.splice(o,t.length-o)}function q(e){var t,r,n,i,a,s=[];for(t=0,r=e.length;r>t;t++)if(a=e.at(t),a.hasSubgroups)s=s.concat(q(a.items));else for(n=a.items,i=0;n.length>i;i++)s.push(n.at(i));return s}function D(e,t){var r,n,i;if(t)for(r=0,n=e.length;n>r;r++)i=e.at(r),i.hasSubgroups?D(i.items,t):i.items=new Qe(i.items,t)}function C(e,t){for(var r=0,n=e.length;n>r;r++)if(e[r].hasSubgroups){if(C(e[r].items,t))return!0}else if(t(e[r].items,e[r]))return!0}function O(e,t,r,n){for(var i=0;e.length>i&&e[i].data!==t&&!z(e[i].data,r,n);i++);}function z(e,t,r){for(var n=0,i=e.length;i>n;n++){if(e[n]&&e[n].hasSubgroups)return z(e[n].items,t,r);if(e[n]===t||e[n]===r)return e[n]=r,!0}}function R(e,r,n,i,a){var s,o,u,l;for(s=0,o=e.length;o>s;s++)if(u=e[s],u&&!(u instanceof i))if(u.hasSubgroups===t||a){for(l=0;r.length>l;l++)if(r[l]===u){e[s]=r.at(l),O(n,r,u,e[s]);break}}else R(u.items,r,n,i,a)}function P(e,t){var r,n,i;for(r=0,n=e.length;n>r;r++)if(i=e.at(r),i.uid==t.uid)return e.splice(r,1),i}function T(e,t){return t?A(e,function(e){return e.uid&&e.uid==t.uid||e[t.idField]===t.id&&t.id!==t._defaultId}):-1}function F(e,t){return t?A(e,function(e){return e.uid==t.uid}):-1}function A(e,t){var r,n;for(r=0,n=e.length;n>r;r++)if(t(e[r]))return r;return-1}function I(e,t){var r,n;return e&&!oe(e)?(r=e[t],n=se(r)?r.from||r.field||t:e[t]||t,ge(n)?t:n):t}function N(e,t){var r,n,i,a={};for(i in e)"filters"!==i&&(a[i]=e[i]);if(e.filters)for(a.filters=[],r=0,n=e.filters.length;n>r;r++)a.filters[r]=N(e.filters[r],t);else a.field=I(t.fields,a.field);return a}function M(e,t){var r,n,i,a,s,o=[];for(r=0,n=e.length;n>r;r++){i={},a=e[r];for(s in a)i[s]=a[s];i.field=I(t.fields,i.field),i.aggregates&&ue(i.aggregates)&&(i.aggregates=M(i.aggregates,t)),o.push(i)}return o}function j(t,r){var n,i,a,s,o,u,l,d,h,f;for(t=e(t)[0],n=t.options,i=r[0],a=r[1],s=[],o=0,u=n.length;u>o;o++)h={},d=n[o],l=d.parentNode,l===t&&(l=null),d.disabled||l&&l.disabled||(l&&(h.optgroup=l.label),h[i.field]=d.text,f=d.attributes.value,f=f&&f.specified?d.value:d.text,h[a.field]=f,s.push(h));return s}function L(t,r){var n,i,a,s,o,u,l,d=e(t)[0].tBodies[0],h=d?d.rows:[],f=r.length,c=[];for(n=0,i=h.length;i>n;n++){for(o={},l=!0,s=h[n].cells,a=0;f>a;a++)u=s[a],"th"!==u.nodeName.toLowerCase()&&(l=!1,o[r[a].field]=u.innerHTML);l||c.push(o)}return c}function G(e){return function(){var t=this._data,r=Y.fn[e].apply(this,Ge.call(arguments));return this._data!=t&&this._attachBubbleHandlers(),r}}function E(t,r){function n(e,t){return e.filter(t).add(e.find(t))}var i,a,s,o,u,l,d,h,f=e(t).children(),c=[],g=r[0].field,p=r[1]&&r[1].field,_=r[2]&&r[2].field,v=r[3]&&r[3].field;for(i=0,a=f.length;a>i;i++)s={_loaded:!0},o=f.eq(i),l=o[0].firstChild,h=o.children(),t=h.filter("ul"),h=h.filter(":not(ul)"),u=o.attr("data-id"),u&&(s.id=u),l&&(s[g]=3==l.nodeType?l.nodeValue:h.text()),p&&(s[p]=n(h,"a").attr("href")),v&&(s[v]=n(h,"img").attr("src")),_&&(d=n(h,".k-sprite").prop("className"),s[_]=d&&e.trim(d.replace("k-sprite",""))),t.length&&(s.items=E(t.eq(0),r)),"true"==o.attr("data-hasChildren")&&(s.hasChildren=!0),c.push(s);return c}var B,U,H,J,V,W,Q,K,$,X,Y,Z,ee,te,re,ne,ie=e.extend,ae=e.proxy,se=e.isPlainObject,oe=e.isEmptyObject,ue=e.isArray,le=e.grep,de=e.ajax,he=e.each,fe=e.noop,ce=window.kendo,ge=ce.isFunction,pe=ce.Observable,_e=ce.Class,ve="string",me="function",ye="create",Se="read",be="update",we="destroy",ke="change",xe="sync",qe="get",De="error",Ce="requestStart",Oe="progress",ze="requestEnd",Re=[ye,Se,be,we],Pe=function(e){return e},Te=ce.getter,Fe=ce.stringify,Ae=Math,Ie=[].push,Ne=[].join,Me=[].pop,je=[].splice,Le=[].shift,Ge=[].slice,Ee=[].unshift,Be={}.toString,Ue=ce.support.stableSort,He=/^\/Date\((.*?)\)\/$/,Je=/(\r+|\n+)/g,Ve=/(?=['\\])/g,We=pe.extend({init:function(e,t){var r=this;r.type=t||Ke,pe.fn.init.call(r),r.length=e.length,r.wrapAll(e,r)},at:function(e){return this[e]},toJSON:function(){var e,t,r=this.length,n=Array(r);for(e=0;r>e;e++)t=this[e],t instanceof Ke&&(t=t.toJSON()),n[e]=t;return n},parent:fe,wrapAll:function(e,t){var r,n,i=this,a=function(){return i};for(t=t||[],r=0,n=e.length;n>r;r++)t[r]=i.wrap(e[r],a);return t},wrap:function(e,t){var r,n=this;return null!==e&&"[object Object]"===Be.call(e)&&(r=e instanceof n.type||e instanceof Ye,r||(e=e instanceof Ke?e.toJSON():e,e=new n.type(e)),e.parent=t,e.bind(ke,function(e){n.trigger(ke,{field:e.field,node:e.node,index:e.index,items:e.items||[this],action:e.node?e.action||"itemloaded":"itemchange"})})),e},push:function(){var e,t=this.length,r=this.wrapAll(arguments);return e=Ie.apply(this,r),this.trigger(ke,{action:"add",index:t,items:r}),e},slice:Ge,sort:[].sort,join:Ne,pop:function(){var e=this.length,t=Me.apply(this);return e&&this.trigger(ke,{action:"remove",index:e-1,items:[t]}),t},splice:function(e,t,r){var n,i,a,s=this.wrapAll(Ge.call(arguments,2));if(n=je.apply(this,[e,t].concat(s)),n.length)for(this.trigger(ke,{action:"remove",index:e,items:n}),i=0,a=n.length;a>i;i++)n[i]&&n[i].children&&n[i].unbind(ke);return r&&this.trigger(ke,{action:"add",index:e,items:s}),n},shift:function(){var e=this.length,t=Le.apply(this);return e&&this.trigger(ke,{action:"remove",index:0,items:[t]}),t},unshift:function(){var e,t=this.wrapAll(arguments);return e=Ee.apply(this,t),this.trigger(ke,{action:"add",index:0,items:t}),e},indexOf:function(e){var t,r,n=this;for(t=0,r=n.length;r>t;t++)if(n[t]===e)return t;return-1},forEach:function(e){for(var t=0,r=this.length;r>t;t++)e(this[t],t,this)},map:function(e){for(var t=0,r=[],n=this.length;n>t;t++)r[t]=e(this[t],t,this);return r},reduce:function(e){var t,r=0,n=this.length;for(2==arguments.length?t=arguments[1]:n>r&&(t=this[r++]);n>r;r++)t=e(t,this[r],r,this);return t},reduceRight:function(e){var t,r=this.length-1;for(2==arguments.length?t=arguments[1]:r>0&&(t=this[r--]);r>=0;r--)t=e(t,this[r],r,this);return t},filter:function(e){for(var t,r=0,n=[],i=this.length;i>r;r++)t=this[r],e(t,r,this)&&(n[n.length]=t);return n},find:function(e){for(var t,r=0,n=this.length;n>r;r++)if(t=this[r],e(t,r,this))return t},every:function(e){for(var t,r=0,n=this.length;n>r;r++)if(t=this[r],!e(t,r,this))return!1;return!0},some:function(e){for(var t,r=0,n=this.length;n>r;r++)if(t=this[r],e(t,r,this))return!0;return!1},remove:function(e){var t=this.indexOf(e);-1!==t&&this.splice(t,1)},empty:function(){this.splice(0,this.length)}}),Qe=We.extend({init:function(e,t){pe.fn.init.call(this),this.type=t||Ke;for(var r=0;e.length>r;r++)this[r]=e[r];this.length=r,this._parent=ae(function(){return this},this)},at:function(e){var t=this[e];return t instanceof this.type?t.parent=this._parent:t=this[e]=this.wrap(t,this._parent),t}}),Ke=pe.extend({init:function(e){var t,r,n=this,i=function(){return n};pe.fn.init.call(this),this._handlers={};for(r in e)t=e[r],"object"==typeof t&&t&&!t.getTime&&"_"!=r.charAt(0)&&(t=n.wrap(t,r,i)),n[r]=t;n.uid=ce.guid()},shouldSerialize:function(e){return this.hasOwnProperty(e)&&"_handlers"!==e&&"_events"!==e&&typeof this[e]!==me&&"uid"!==e},forEach:function(e){for(var t in this)this.shouldSerialize(t)&&e(this[t],t)},toJSON:function(){var e,t,r={};for(t in this)this.shouldSerialize(t)&&(e=this[t],(e instanceof Ke||e instanceof We)&&(e=e.toJSON()),r[t]=e);return r},get:function(e){var t,r=this;return r.trigger(qe,{field:e}),t="this"===e?r:ce.getter(e,!0)(r)},_set:function(e,t){var r,n,i,a=this,s=e.indexOf(".")>=0;if(s)for(r=e.split("."),n="";r.length>1;){if(n+=r.shift(),i=ce.getter(n,!0)(a),i instanceof Ke)return i.set(r.join("."),t),s;n+="."}return ce.setter(e)(a,t),s},set:function(e,t){var r=this,n=!1,i=e.indexOf(".")>=0,a=ce.getter(e,!0)(r);return a!==t&&(a instanceof pe&&this._handlers[e]&&(this._handlers[e].get&&a.unbind(qe,this._handlers[e].get),a.unbind(ke,this._handlers[e].change)),n=r.trigger("set",{field:e,value:t}),n||(i||(t=r.wrap(t,e,function(){return r})),(!r._set(e,t)||e.indexOf("(")>=0||e.indexOf("[")>=0)&&r.trigger(ke,{field:e}))),n},parent:fe,wrap:function(e,t,n){var i,a,s,o,u=this,l=Be.call(e);return null==e||"[object Object]"!==l&&"[object Array]"!==l||(s=e instanceof We,o=e instanceof Y,"[object Object]"!==l||o||s?("[object Array]"===l||s||o)&&(s||o||(e=new We(e)),a=r(u,ke,t,!1),e.bind(ke,a),u._handlers[t]={change:a}):(e instanceof Ke||(e=new Ke(e)),i=r(u,qe,t,!0),e.bind(qe,i),a=r(u,ke,t,!0),e.bind(ke,a),u._handlers[t]={get:i,change:a}),e.parent=n),e}}),$e={number:function(e){return ce.parseFloat(e)},date:function(e){return ce.parseDate(e)},"boolean":function(e){return typeof e===ve?"true"===e.toLowerCase():null!=e?!!e:e},string:function(e){return null!=e?e+"":e},"default":function(e){return e}},Xe={string:"",number:0,date:new Date,"boolean":!1,"default":""},Ye=Ke.extend({init:function(r){var n,i,a=this;if((!r||e.isEmptyObject(r))&&(r=e.extend({},a.defaults,r),a._initializers))for(n=0;a._initializers.length>n;n++)i=a._initializers[n],r[i]=a.defaults[i]();Ke.fn.init.call(a,r),a.dirty=!1,a.idField&&(a.id=a.get(a.idField),a.id===t&&(a.id=a._defaultId))},shouldSerialize:function(e){return Ke.fn.shouldSerialize.call(this,e)&&"uid"!==e&&!("id"!==this.idField&&"id"===e)&&"dirty"!==e&&"_accessors"!==e},_parse:function(e,t){var r,n=this,a=e,s=n.fields||{};return e=s[e],e||(e=i(s,a)),e&&(r=e.parse,!r&&e.type&&(r=$e[e.type.toLowerCase()])),r?r(t):t},_notifyChange:function(e){var t=e.action;("add"==t||"remove"==t)&&(this.dirty=!0)},editable:function(e){return e=(this.fields||{})[e],e?e.editable!==!1:!0},set:function(e,t,r){var i=this,a=i.dirty;i.editable(e)&&(t=i._parse(e,t),n(t,i.get(e))||(i.dirty=!0,Ke.fn.set.call(i,e,t,r)&&!a&&(i.dirty=a)))},accept:function(e){var t,r,n=this,i=function(){return n};for(t in e)r=e[t],"_"!=t.charAt(0)&&(r=n.wrap(e[t],t,i)),n._set(t,r);n.idField&&(n.id=n.get(n.idField)),n.dirty=!1},isNew:function(){return this.id===this._defaultId}});Ye.define=function(e,r){r===t&&(r=e,e=Ye);var n,i,a,s,o,u,l,d,h=ie({defaults:{}},r),f={},c=h.id,g=[];if(c&&(h.idField=c),h.id&&delete h.id,c&&(h.defaults[c]=h._defaultId=""),"[object Array]"===Be.call(h.fields)){for(u=0,l=h.fields.length;l>u;u++)a=h.fields[u],typeof a===ve?f[a]={}:a.field&&(f[a.field]=a);h.fields=f}for(i in h.fields)a=h.fields[i],s=a.type||"default",o=null,d=i,i=typeof a.field===ve?a.field:i,a.nullable||(o=h.defaults[d!==i?d:i]=a.defaultValue!==t?a.defaultValue:Xe[s.toLowerCase()],"function"==typeof o&&g.push(i)),r.id===i&&(h._defaultId=o),h.defaults[d!==i?d:i]=o,a.parse=a.parse||$e[s];return g.length>0&&(h._initializers=g),n=e.extend(h),n.define=function(e){return Ye.define(n,e)},h.fields&&(n.fields=h.fields,n.idField=h.idField),n},U={selector:function(e){return ge(e)?e:Te(e)},compare:function(e){var t=this.selector(e);return function(e,r){return e=t(e),r=t(r),null==e&&null==r?0:null==e?-1:null==r?1:e.localeCompare?e.localeCompare(r):e>r?1:r>e?-1:0}},create:function(e){var t=e.compare||this.compare(e.field);return"desc"==e.dir?function(e,r){return t(r,e,!0)}:t},combine:function(e){return function(t,r){var n,i,a=e[0](t,r);for(n=1,i=e.length;i>n;n++)a=a||e[n](t,r);return a}}},H=ie({},U,{asc:function(e){var t=this.selector(e);return function(e,r){var n=t(e),i=t(r);return n&&n.getTime&&i&&i.getTime&&(n=n.getTime(),i=i.getTime()),n===i?e.__position-r.__position:null==n?-1:null==i?1:n.localeCompare?n.localeCompare(i):n>i?1:-1}},desc:function(e){var t=this.selector(e);return function(e,r){var n=t(e),i=t(r);return n&&n.getTime&&i&&i.getTime&&(n=n.getTime(),i=i.getTime()),n===i?e.__position-r.__position:null==n?1:null==i?-1:i.localeCompare?i.localeCompare(n):i>n?1:-1}},create:function(e){return this[e.dir](e.field)}}),B=function(e,t){var r,n=e.length,i=Array(n);for(r=0;n>r;r++)i[r]=t(e[r],r,e);return i},J=function(){function e(e){return e.replace(Ve,"\\").replace(Je,"")}function t(t,r,n,i){var a;return null!=n&&(typeof n===ve&&(n=e(n),a=He.exec(n),a?n=new Date(+a[1]):i?(n="'"+n.toLowerCase()+"'",r="(("+r+" || '')+'').toLowerCase()"):n="'"+n+"'"),n.getTime&&(r="("+r+"&&"+r+".getTime?"+r+".getTime():"+r+")",n=n.getTime())),r+" "+t+" "+n}return{quote:function(t){return t&&t.getTime?"new Date("+t.getTime()+")":"string"==typeof t?"'"+e(t)+"'":""+t},eq:function(e,r,n){return t("==",e,r,n)},neq:function(e,r,n){return t("!=",e,r,n)},gt:function(e,r,n){return t(">",e,r,n)},gte:function(e,r,n){return t(">=",e,r,n)},lt:function(e,r,n){return t("<",e,r,n)},lte:function(e,r,n){return t("<=",e,r,n)},startswith:function(t,r,n){return n&&(t="("+t+" || '').toLowerCase()",r&&(r=r.toLowerCase())),r&&(r=e(r)),t+".lastIndexOf('"+r+"', 0) == 0"},doesnotstartwith:function(t,r,n){return n&&(t="("+t+" || '').toLowerCase()",r&&(r=r.toLowerCase())),r&&(r=e(r)),t+".lastIndexOf('"+r+"', 0) == -1"},endswith:function(t,r,n){return n&&(t="("+t+" || '').toLowerCase()",r&&(r=r.toLowerCase())),r&&(r=e(r)),t+".indexOf('"+r+"', "+t+".length - "+(r||"").length+") >= 0"},doesnotendwith:function(t,r,n){return n&&(t="("+t+" || '').toLowerCase()",r&&(r=r.toLowerCase())),r&&(r=e(r)),t+".indexOf('"+r+"', "+t+".length - "+(r||"").length+") < 0"},contains:function(t,r,n){return n&&(t="("+t+" || '').toLowerCase()",r&&(r=r.toLowerCase())),r&&(r=e(r)),t+".indexOf('"+r+"') >= 0"},doesnotcontain:function(t,r,n){return n&&(t="("+t+" || '').toLowerCase()",r&&(r=r.toLowerCase())),r&&(r=e(r)),t+".indexOf('"+r+"') == -1"},isempty:function(e){return e+" === ''"},isnotempty:function(e){return e+" !== ''"},isnull:function(e){return"("+e+" === null || "+e+" === undefined)"},isnotnull:function(e){return"("+e+" !== null && "+e+" !== undefined)"}}}(),a.filterExpr=function(e){var r,n,i,s,o,u,l=[],d={and:" && ",or:" || "},h=[],f=[],c=e.filters;for(r=0,n=c.length;n>r;r++)i=c[r],o=i.field,u=i.operator,i.filters?(s=a.filterExpr(i),i=s.expression.replace(/__o\[(\d+)\]/g,function(e,t){return t=+t,"__o["+(f.length+t)+"]"}).replace(/__f\[(\d+)\]/g,function(e,t){return t=+t,"__f["+(h.length+t)+"]"}),f.push.apply(f,s.operators),h.push.apply(h,s.fields)):(typeof o===me?(s="__f["+h.length+"](d)",h.push(o)):s=ce.expr(o),typeof u===me?(i="__o["+f.length+"]("+s+", "+J.quote(i.value)+")",f.push(u)):i=J[(u||"eq").toLowerCase()](s,i.value,i.ignoreCase!==t?i.ignoreCase:!0)),l.push(i);return{expression:"("+l.join(d[e.logic])+")",fields:h,operators:f}},V={"==":"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"},a.normalizeFilter=u,a.compareFilters=f,a.prototype={toArray:function(){return this.data},range:function(e,t){return new a(this.data.slice(e,e+t))},skip:function(e){return new a(this.data.slice(e))},take:function(e){return new a(this.data.slice(0,e))},select:function(e){return new a(B(this.data,e))},order:function(e,t){var r={dir:t};return e&&(e.compare?r.compare=e.compare:r.field=e),new a(this.data.slice(0).sort(U.create(r)))},orderBy:function(e){return this.order(e,"asc")},orderByDescending:function(e){return this.order(e,"desc")},sort:function(e,t,r){var n,i,a=s(e,t),o=[];if(r=r||U,a.length){for(n=0,i=a.length;i>n;n++)o.push(r.create(a[n]));return this.orderBy({compare:r.combine(o)})}return this},filter:function(e){var t,r,n,i,s,o,l,d,h=this.data,f=[];if(e=u(e),!e||0===e.filters.length)return this;for(i=a.filterExpr(e),o=i.fields,l=i.operators,s=d=Function("d, __f, __o","return "+i.expression),(o.length||l.length)&&(d=function(e){return s(e,o,l)}),t=0,n=h.length;n>t;t++)r=h[t],d(r)&&f.push(r);return new a(f)},group:function(e,t){e=g(e||[]),t=t||this.data;var r,n=this,i=new a(n.data);return e.length>0&&(r=e[0],i=i.groupBy(r).select(function(n){var i=new a(t).filter([{field:n.field,operator:"eq",value:n.value,ignoreCase:!1}]);return{field:n.field,value:n.value,items:e.length>1?new a(n.items).group(e.slice(1),i.toArray()).toArray():n.items,hasSubgroups:e.length>1,aggregates:i.aggregate(r.aggregates)}})),i},groupBy:function(e){if(oe(e)||!this.data.length)return new a([]);var t,r,n,i,s=e.field,o=this._sortForGrouping(s,e.dir||"asc"),u=ce.accessor(s),l=u.get(o[0],s),d={field:s,value:l,items:[]},h=[d];for(n=0,i=o.length;i>n;n++)t=o[n],r=u.get(t,s),p(l,r)||(l=r,d={field:s,value:l,items:[]},h.push(d)),d.items.push(t);return new a(h)},_sortForGrouping:function(e,t){var r,n,i=this.data;if(!Ue){for(r=0,n=i.length;n>r;r++)i[r].__position=r;for(i=new a(i).sort(e,t,H).toArray(),r=0,n=i.length;n>r;r++)delete i[r].__position;return i}return this.sort(e,t).toArray()},aggregate:function(e){var t,r,n={},i={};if(e&&e.length)for(t=0,r=this.data.length;r>t;t++)_(n,e,this.data[t],t,r,i);return n}},W={sum:function(e,t,r){var n=r.get(t);return v(e)?v(n)&&(e+=n):e=n,e},count:function(e){return(e||0)+1},average:function(e,r,n,i,a,s){var o=n.get(r);return s.count===t&&(s.count=0),v(e)?v(o)&&(e+=o):e=o,v(o)&&s.count++,i==a-1&&v(e)&&(e/=s.count),e},max:function(e,t,r){var n=r.get(t);return v(e)||m(e)||(e=n),n>e&&(v(n)||m(n))&&(e=n),e},min:function(e,t,r){var n=r.get(t);return v(e)||m(e)||(e=n),e>n&&(v(n)||m(n))&&(e=n),e}},a.process=function(e,r){r=r||{};var n,i=new a(e),o=r.group,u=g(o||[]).concat(s(r.sort||[])),l=r.filterCallback,d=r.filter,h=r.skip,f=r.take;return d&&(i=i.filter(d),l&&(i=l(i)),n=i.toArray().length),u&&(i=i.sort(u),o&&(e=i.toArray())),h!==t&&f!==t&&(i=i.range(h,f)),o&&(i=i.group(o,e)),{total:n,data:i.toArray()}},Q=_e.extend({init:function(e){this.data=e.data},read:function(e){e.success(this.data)},update:function(e){e.success(e.data)},create:function(e){e.success(e.data)},destroy:function(e){e.success(e.data)}}),K=_e.extend({init:function(e){var t,r=this;e=r.options=ie({},r.options,e),he(Re,function(t,r){typeof e[r]===ve&&(e[r]={url:e[r]})}),r.cache=e.cache?$.create(e.cache):{find:fe,add:fe},t=e.parameterMap,ge(e.push)&&(r.push=e.push),r.push||(r.push=Pe),r.parameterMap=ge(t)?t:function(e){var r={};return he(e,function(e,n){e in t&&(e=t[e],se(e)&&(n=e.value(n),e=e.key)),r[e]=n}),r}},options:{parameterMap:Pe},create:function(e){return de(this.setup(e,ye))},read:function(r){var n,i,a,s=this,o=s.cache;r=s.setup(r,Se),n=r.success||fe,i=r.error||fe,a=o.find(r.data),a!==t?n(a):(r.success=function(e){o.add(r.data,e),n(e)},e.ajax(r))},update:function(e){return de(this.setup(e,be))},destroy:function(e){return de(this.setup(e,we))},setup:function(e,t){e=e||{};var r,n=this,i=n.options[t],a=ge(i.data)?i.data(e.data):i.data;return e=ie(!0,{},i,e),r=ie(!0,{},a,e.data),e.data=n.parameterMap(r,t),ge(e.url)&&(e.url=e.url(r)),e}}),$=_e.extend({init:function(){this._store={}},add:function(e,r){e!==t&&(this._store[Fe(e)]=r)},find:function(e){return this._store[Fe(e)]},clear:function(){this._store={}},remove:function(e){delete this._store[Fe(e)]}}),$.create=function(e){var t={inmemory:function(){return new $}};return se(e)&&ge(e.find)?e:e===!0?new $:t[e]()},X=_e.extend({init:function(e){var t,r,n,i,a,s,o,u,l,d,h,f,c,g=this;e=e||{};for(t in e)r=e[t],g[t]=typeof r===ve?Te(r):r;i=e.modelBase||Ye,se(g.model)&&(g.model=n=i.define(g.model)),a=ae(g.data,g),g._dataAccessFunction=a,g.model&&(s=ae(g.groups,g),o=ae(g.serialize,g),u={},l={},d={},h={},f=!1,n=g.model,n.fields&&(he(n.fields,function(e,t){var r;c=e,se(t)&&t.field?c=t.field:typeof t===ve&&(c=t),se(t)&&t.from&&(r=t.from),f=f||r&&r!==e||c!==e,l[e]=Te(r||c),d[e]=Te(e),u[r||c]=e,h[e]=r||c}),!e.serialize&&f&&(g.serialize=k(o,n,S,d,u,h))),g._dataAccessFunction=a,g.data=k(a,n,b,l,u,h),g.groups=k(s,n,w,l,u,h))},errors:function(e){return e?e.errors:null},parse:Pe,data:Pe,total:function(e){return e.length},groups:Pe,aggregates:function(){return{}},serialize:function(e){return e}}),Y=pe.extend({init:function(e){var r,n,i,a=this;e&&(n=e.data),e=a.options=ie({},a.options,e),a._map={},a._prefetch={},a._data=[],a._pristineData=[],a._ranges=[],a._view=[],a._pristineTotal=0,a._destroyed=[],a._pageSize=e.pageSize,a._page=e.page||(e.pageSize?1:t),a._sort=s(e.sort),a._filter=u(e.filter),a._group=g(e.group),a._aggregate=e.aggregate,a._total=e.total,a._shouldDetachObservableParents=!0,pe.fn.init.call(a),a.transport=Z.create(e,n,a),ge(a.transport.push)&&a.transport.push({pushCreate:ae(a._pushCreate,a),pushUpdate:ae(a._pushUpdate,a),pushDestroy:ae(a._pushDestroy,a)}),null!=e.offlineStorage&&("string"==typeof e.offlineStorage?(i=e.offlineStorage,a._storage={getItem:function(){return JSON.parse(localStorage.getItem(i))},setItem:function(e){localStorage.setItem(i,Fe(a.reader.serialize(e)))}}):a._storage=e.offlineStorage),a.reader=new ce.data.readers[e.schema.type||"json"](e.schema),r=a.reader.model||{},a._detachObservableParents(),a._data=a._observe(a._data),a._online=!0,a.bind(["push",De,ke,Ce,xe,ze,Oe],e)},options:{data:null,schema:{modelBase:Ye},offlineStorage:null,serverSorting:!1,serverPaging:!1,serverFiltering:!1,serverGrouping:!1,serverAggregates:!1,batch:!1},clone:function(){return this},online:function(r){return r!==t?this._online!=r&&(this._online=r,r)?this.sync():e.Deferred().resolve().promise():this._online},offlineData:function(e){return null==this.options.offlineStorage?null:e!==t?this._storage.setItem(e):this._storage.getItem()||[]},_isServerGrouped:function(){var e=this.group()||[];return this.options.serverGrouping&&e.length},_pushCreate:function(e){this._push(e,"pushCreate")},_pushUpdate:function(e){this._push(e,"pushUpdate")},_pushDestroy:function(e){this._push(e,"pushDestroy")},_push:function(e,t){var r=this._readData(e);r||(r=e),this[t](r)},_flatData:function(e,t){if(e){if(this._isServerGrouped())return q(e);if(!t)for(var r=0;e.length>r;r++)e.at(r)}return e},parent:fe,get:function(e){var t,r,n=this._flatData(this._data);for(t=0,r=n.length;r>t;t++)if(n[t].id==e)return n[t]},getByUid:function(e){var t,r,n=this._flatData(this._data);if(n)for(t=0,r=n.length;r>t;t++)if(n[t].uid==e)return n[t]},indexOf:function(e){return F(this._data,e)},at:function(e){return this._data.at(e)},data:function(e){var r,n=this;if(e===t){if(n._data)for(r=0;n._data.length>r;r++)n._data.at(r);return n._data}n._detachObservableParents(),n._data=this._observe(e),n._pristineData=e.slice(0),n._storeData(),n._ranges=[],n.trigger("reset"),n._addRange(n._data),n._total=n._data.length,n._pristineTotal=n._total,n._process(n._data)},view:function(e){return e===t?this._view:(this._view=this._observeView(e),t)},_observeView:function(e){var t,r=this;return R(e,r._data,r._ranges,r.reader.model||Ke,r._isServerGrouped()),t=new Qe(e,r.reader.model),t.parent=function(){return r.parent()},t},flatView:function(){var e=this.group()||[];return e.length?q(this._view):this._view},add:function(e){return this.insert(this._data.length,e)},_createNewModel:function(e){return this.reader.model?new this.reader.model(e):e instanceof Ke?e:new Ke(e)},insert:function(e,t){return t||(t=e,e=0),t instanceof Ye||(t=this._createNewModel(t)),this._isServerGrouped()?this._data.splice(e,0,this._wrapInEmptyGroup(t)):this._data.splice(e,0,t),t},pushCreate:function(e){var t,r,n,i,a,s;ue(e)||(e=[e]),t=[],r=this.options.autoSync,this.options.autoSync=!1;try{for(n=0;e.length>n;n++)i=e[n],a=this.add(i),t.push(a),s=a.toJSON(),this._isServerGrouped()&&(s=this._wrapInEmptyGroup(s)),this._pristineData.push(s)}finally{this.options.autoSync=r}t.length&&this.trigger("push",{type:"create",items:t})},pushUpdate:function(e){var t,r,n,i,a;for(ue(e)||(e=[e]),t=[],r=0;e.length>r;r++)n=e[r],i=this._createNewModel(n),a=this.get(i.id),a?(t.push(a),a.accept(n),a.trigger(ke),this._updatePristineForModel(a,n)):this.pushCreate(n);t.length&&this.trigger("push",{type:"update",items:t})},pushDestroy:function(e){var t=this._removeItems(e);t.length&&this.trigger("push",{type:"destroy",items:t})},_removeItems:function(e){var t,r,n,i,a,s;ue(e)||(e=[e]),t=[],r=this.options.autoSync,this.options.autoSync=!1;try{for(n=0;e.length>n;n++)i=e[n],a=this._createNewModel(i),s=!1,this._eachItem(this._data,function(e){var r,n;for(r=0;e.length>r;r++)if(n=e.at(r),n.id===a.id){t.push(n),e.splice(r,1),s=!0;break}}),s&&(this._removePristineForModel(a),this._destroyed.pop())}finally{this.options.autoSync=r}return t},remove:function(e){var r,n=this,i=n._isServerGrouped();return this._eachItem(n._data,function(a){return r=P(a,e),r&&i?(r.isNew&&r.isNew()||n._destroyed.push(r),!0):t}),this._removeModelFromRanges(e),this._updateRangesLength(),e},destroyed:function(){return this._destroyed},created:function(){var e,t,r=[],n=this._flatData(this._data);for(e=0,t=n.length;t>e;e++)n[e].isNew&&n[e].isNew()&&r.push(n[e]);return r},updated:function(){var e,t,r=[],n=this._flatData(this._data);for(e=0,t=n.length;t>e;e++)n[e].isNew&&!n[e].isNew()&&n[e].dirty&&r.push(n[e]);return r},sync:function(){var t,r=this,n=[],i=[],a=r._destroyed,s=e.Deferred().resolve().promise();if(r.online()){if(!r.reader.model)return s;n=r.created(),i=r.updated(),t=[],r.options.batch&&r.transport.submit?t=r._sendSubmit(n,i,a):(t.push.apply(t,r._send("create",n)),t.push.apply(t,r._send("update",i)),t.push.apply(t,r._send("destroy",a))),s=e.when.apply(null,t).then(function(){var e,t;for(e=0,t=arguments.length;t>e;e++)r._accept(arguments[e]);r._storeData(!0),r._change({action:"sync"}),r.trigger(xe)})}else r._storeData(!0),r._change({action:"sync"});return s},cancelChanges:function(e){var t=this;e instanceof ce.data.Model?t._cancelModel(e):(t._destroyed=[],t._detachObservableParents(),t._data=t._observe(t._pristineData),t.options.serverPaging&&(t._total=t._pristineTotal),t._ranges=[],t._addRange(t._data),t._change(),t._markOfflineUpdatesAsDirty())},_markOfflineUpdatesAsDirty:function(){var e=this;null!=e.options.offlineStorage&&e._eachItem(e._data,function(e){var t,r;for(t=0;e.length>t;t++)r=e.at(t),"update"==r.__state__&&(r.dirty=!0)})},hasChanges:function(){var e,t,r=this._flatData(this._data);if(this._destroyed.length)return!0;for(e=0,t=r.length;t>e;e++)if(r[e].isNew&&r[e].isNew()||r[e].dirty)return!0;return!1},_accept:function(t){var r,n=this,i=t.models,a=t.response,s=0,o=n._isServerGrouped(),u=n._pristineData,l=t.type;if(n.trigger(ze,{response:a,type:l}),a&&!oe(a)){if(a=n.reader.parse(a),n._handleCustomErrors(a))return;a=n.reader.data(a),ue(a)||(a=[a])}else a=e.map(i,function(e){return e.toJSON()});for("destroy"===l&&(n._destroyed=[]),s=0,r=i.length;r>s;s++)"destroy"!==l?(i[s].accept(a[s]),"create"===l?u.push(o?n._wrapInEmptyGroup(i[s]):a[s]):"update"===l&&n._updatePristineForModel(i[s],a[s])):n._removePristineForModel(i[s])},_updatePristineForModel:function(e,t){this._executeOnPristineForModel(e,function(e,r){ce.deepExtend(r[e],t)})},_executeOnPristineForModel:function(e,r){this._eachPristineItem(function(n){var i=T(n,e);return i>-1?(r(i,n),!0):t})},_removePristineForModel:function(e){this._executeOnPristineForModel(e,function(e,t){t.splice(e,1)})},_readData:function(e){var t=this._isServerGrouped()?this.reader.groups:this.reader.data;return t.call(this.reader,e)},_eachPristineItem:function(e){this._eachItem(this._pristineData,e)},_eachItem:function(e,t){e&&e.length&&(this._isServerGrouped()?C(e,t):t(e))},_pristineForModel:function(e){var r,n,i=function(i){return n=T(i,e),n>-1?(r=i[n],!0):t};return this._eachPristineItem(i),r},_cancelModel:function(e){var t=this._pristineForModel(e);this._eachItem(this._data,function(r){var n=F(r,e);n>=0&&(!t||e.isNew()&&!t.__state__?r.splice(n,1):(r[n].accept(t),"update"==t.__state__&&(r[n].dirty=!0)))})},_submit:function(t,r){var n=this;n.trigger(Ce,{type:"submit"}),n.transport.submit(ie({success:function(r,n){var i=e.grep(t,function(e){return e.type==n})[0];i&&i.resolve({response:r,models:i.models,type:n})},error:function(e,r,i){for(var a=0;t.length>a;a++)t[a].reject(e);n.error(e,r,i)}},r))},_sendSubmit:function(t,r,n){var i=this,a=[];return i.options.batch&&(t.length&&a.push(e.Deferred(function(e){e.type="create",e.models=t})),r.length&&a.push(e.Deferred(function(e){e.type="update",e.models=r})),n.length&&a.push(e.Deferred(function(e){e.type="destroy",e.models=n})),i._submit(a,{data:{created:i.reader.serialize(y(t)),updated:i.reader.serialize(y(r)),destroyed:i.reader.serialize(y(n))}})),a},_promise:function(t,r,n){var i=this;return e.Deferred(function(e){i.trigger(Ce,{type:n}),i.transport[n].call(i.transport,ie({success:function(t){e.resolve({response:t,models:r,type:n})},error:function(t,r,n){e.reject(t),i.error(t,r,n)}},t))}).promise()},_send:function(e,t){var r,n,i=this,a=[],s=i.reader.serialize(y(t));if(i.options.batch)t.length&&a.push(i._promise({data:{models:s}},t,e));else for(r=0,n=t.length;n>r;r++)a.push(i._promise({data:s[r]},[t[r]],e));return a},read:function(t){var r=this,n=r._params(t),i=e.Deferred();return r._queueRequest(n,function(){var e=r.trigger(Ce,{type:"read"});e?(r._dequeueRequest(),i.resolve(e)):(r.trigger(Oe), r._ranges=[],r.trigger("reset"),r.online()?r.transport.read({data:n,success:function(e){r.success(e,n),i.resolve()},error:function(){var e=Ge.call(arguments);r.error.apply(r,e),i.reject.apply(i,e)}}):null!=r.options.offlineStorage&&(r.success(r.offlineData(),n),i.resolve()))}),i.promise()},_readAggregates:function(e){return this.reader.aggregates(e)},success:function(e){var r,n,i,a,s,o,u,l,d=this,h=d.options;if(d.trigger(ze,{response:e,type:"read"}),d.online()){if(e=d.reader.parse(e),d._handleCustomErrors(e))return d._dequeueRequest(),t;d._total=d.reader.total(e),d._aggregate&&h.serverAggregates&&(d._aggregateResult=d._readAggregates(e)),e=d._readData(e)}else{for(e=d._readData(e),r=[],n={},i=d.reader.model,a=i?i.idField:"id",s=0;this._destroyed.length>s;s++)o=this._destroyed[s][a],n[o]=o;for(s=0;e.length>s;s++)u=e[s],l=u.__state__,"destroy"==l?n[u[a]]||this._destroyed.push(this._createNewModel(u)):r.push(u);e=r,d._total=e.length}d._pristineTotal=d._total,d._pristineData=e.slice(0),d._detachObservableParents(),d._data=d._observe(e),d._markOfflineUpdatesAsDirty(),d._storeData(),d._addRange(d._data),d._process(d._data),d._dequeueRequest()},_detachObservableParents:function(){if(this._data&&this._shouldDetachObservableParents)for(var e=0;this._data.length>e;e++)this._data[e].parent&&(this._data[e].parent=fe)},_storeData:function(e){function t(e){var r,n,i,a=[];for(r=0;e.length>r;r++)n=e.at(r),i=n.toJSON(),s&&n.items?i.items=t(n.items):(i.uid=n.uid,o&&(n.isNew()?i.__state__="create":n.dirty&&(i.__state__="update"))),a.push(i);return a}var r,n,i,a,s=this._isServerGrouped(),o=this.reader.model;if(null!=this.options.offlineStorage){for(r=t(this._data),n=[],i=0;this._destroyed.length>i;i++)a=this._destroyed[i].toJSON(),a.__state__="destroy",n.push(a);this.offlineData(r.concat(n)),e&&(this._pristineData=this._readData(r))}},_addRange:function(e){var t=this,r=t._skip||0,n=r+t._flatData(e,!0).length;t._ranges.push({start:r,end:n,data:e,timestamp:(new Date).getTime()}),t._ranges.sort(function(e,t){return e.start-t.start})},error:function(e,t,r){this._dequeueRequest(),this.trigger(ze,{}),this.trigger(De,{xhr:e,status:t,errorThrown:r})},_params:function(e){var t=this,r=ie({take:t.take(),skip:t.skip(),page:t.page(),pageSize:t.pageSize(),sort:t._sort,filter:t._filter,group:t._group,aggregate:t._aggregate},e);return t.options.serverPaging||(delete r.take,delete r.skip,delete r.page,delete r.pageSize),t.options.serverGrouping?t.reader.model&&r.group&&(r.group=M(r.group,t.reader.model)):delete r.group,t.options.serverFiltering?t.reader.model&&r.filter&&(r.filter=N(r.filter,t.reader.model)):delete r.filter,t.options.serverSorting?t.reader.model&&r.sort&&(r.sort=M(r.sort,t.reader.model)):delete r.sort,t.options.serverAggregates?t.reader.model&&r.aggregate&&(r.aggregate=M(r.aggregate,t.reader.model)):delete r.aggregate,r},_queueRequest:function(e,r){var n=this;n._requestInProgress?n._pending={callback:ae(r,n),options:e}:(n._requestInProgress=!0,n._pending=t,r())},_dequeueRequest:function(){var e=this;e._requestInProgress=!1,e._pending&&e._queueRequest(e._pending.options,e._pending.callback)},_handleCustomErrors:function(e){if(this.reader.errors){var t=this.reader.errors(e);if(t)return this.trigger(De,{xhr:null,status:"customerror",errorThrown:"custom error",errors:t}),!0}return!1},_shouldWrap:function(e){var t=this.reader.model;return t&&e.length?!(e[0]instanceof t):!1},_observe:function(e){var t,r=this,n=r.reader.model;return r._shouldDetachObservableParents=!0,e instanceof We?(r._shouldDetachObservableParents=!1,r._shouldWrap(e)&&(e.type=r.reader.model,e.wrapAll(e,e))):(t=r.pageSize()&&!r.options.serverPaging?Qe:We,e=new t(e,r.reader.model),e.parent=function(){return r.parent()}),r._isServerGrouped()&&D(e,n),r._changeHandler&&r._data&&r._data instanceof We?r._data.unbind(ke,r._changeHandler):r._changeHandler=ae(r._change,r),e.bind(ke,r._changeHandler)},_updateTotalForAction:function(e,t){var r=this,n=parseInt(r._total,10);v(r._total)||(n=parseInt(r._pristineTotal,10)),"add"===e?n+=t.length:"remove"===e?n-=t.length:"itemchange"===e||"sync"===e||r.options.serverPaging?"sync"===e&&(n=r._pristineTotal=parseInt(r._total,10)):n=r._pristineTotal,r._total=n},_change:function(e){var t,r,n,i=this,a=e?e.action:"";if("remove"===a)for(t=0,r=e.items.length;r>t;t++)e.items[t].isNew&&e.items[t].isNew()||i._destroyed.push(e.items[t]);!i.options.autoSync||"add"!==a&&"remove"!==a&&"itemchange"!==a?(i._updateTotalForAction(a,e?e.items:[]),i._process(i._data,e)):(n=function(t){"sync"===t.action&&(i.unbind("change",n),i._updateTotalForAction(a,e.items))},i.first("change",n),i.sync())},_calculateAggregates:function(e,t){t=t||{};var r=new a(e),n=t.aggregate,i=t.filter;return i&&(r=r.filter(i)),r.aggregate(n)},_process:function(e,r){var n,i=this,a={};i.options.serverPaging!==!0&&(a.skip=i._skip,a.take=i._take||i._pageSize,a.skip===t&&i._page!==t&&i._pageSize!==t&&(a.skip=(i._page-1)*i._pageSize)),i.options.serverSorting!==!0&&(a.sort=i._sort),i.options.serverFiltering!==!0&&(a.filter=i._filter),i.options.serverGrouping!==!0&&(a.group=i._group),i.options.serverAggregates!==!0&&(a.aggregate=i._aggregate,i._aggregateResult=i._calculateAggregates(e,a)),n=i._queryProcess(e,a),i.view(n.data),n.total===t||i.options.serverFiltering||(i._total=n.total),r=r||{},r.items=r.items||i._view,i.trigger(ke,r)},_queryProcess:function(e,t){return a.process(e,t)},_mergeState:function(e){var r=this;return e!==t&&(r._pageSize=e.pageSize,r._page=e.page,r._sort=e.sort,r._filter=e.filter,r._group=e.group,r._aggregate=e.aggregate,r._skip=r._currentRangeStart=e.skip,r._take=e.take,r._skip===t&&(r._skip=r._currentRangeStart=r.skip(),e.skip=r.skip()),r._take===t&&r._pageSize!==t&&(r._take=r._pageSize,e.take=r._take),e.sort&&(r._sort=e.sort=s(e.sort)),e.filter&&(r._filter=e.filter=u(e.filter)),e.group&&(r._group=e.group=g(e.group)),e.aggregate&&(r._aggregate=e.aggregate=c(e.aggregate))),e},query:function(r){var n,i,a=this.options.serverSorting||this.options.serverPaging||this.options.serverFiltering||this.options.serverGrouping||this.options.serverAggregates;return a||(this._data===t||0===this._data.length)&&!this._destroyed.length?this.read(this._mergeState(r)):(i=this.trigger(Ce,{type:"read"}),i||(this.trigger(Oe),n=this._queryProcess(this._data,this._mergeState(r)),this.options.serverFiltering||(this._total=n.total!==t?n.total:this._data.length),this._aggregateResult=this._calculateAggregates(this._data,r),this.view(n.data),this.trigger(ze,{type:"read"}),this.trigger(ke,{items:n.data})),e.Deferred().resolve(i).promise())},fetch:function(e){var t=this,r=function(r){r!==!0&&ge(e)&&e.call(t)};return this._query().then(r)},_query:function(e){var t=this;return t.query(ie({},{page:t.page(),pageSize:t.pageSize(),sort:t.sort(),filter:t.filter(),group:t.group(),aggregate:t.aggregate()},e))},next:function(e){var r=this,n=r.page(),i=r.total();return e=e||{},!n||i&&n+1>r.totalPages()?t:(r._skip=r._currentRangeStart=n*r.take(),n+=1,e.page=n,r._query(e),n)},prev:function(e){var r=this,n=r.page();return e=e||{},n&&1!==n?(r._skip=r._currentRangeStart=r._skip-r.take(),n-=1,e.page=n,r._query(e),n):t},page:function(e){var r,n=this;return e!==t?(e=Ae.max(Ae.min(Ae.max(e,1),n.totalPages()),1),n._query({page:e}),t):(r=n.skip(),r!==t?Ae.round((r||0)/(n.take()||1))+1:t)},pageSize:function(e){var r=this;return e!==t?(r._query({pageSize:e,page:1}),t):r.take()},sort:function(e){var r=this;return e!==t?(r._query({sort:e}),t):r._sort},filter:function(e){var r=this;return e===t?r._filter:(r.trigger("reset"),r._query({filter:e,page:1}),t)},group:function(e){var r=this;return e!==t?(r._query({group:e}),t):r._group},total:function(){return parseInt(this._total||0,10)},aggregate:function(e){var r=this;return e!==t?(r._query({aggregate:e}),t):r._aggregate},aggregates:function(){var e=this._aggregateResult;return oe(e)&&(e=this._emptyAggregates(this.aggregate())),e},_emptyAggregates:function(e){var t,r,n={};if(!oe(e))for(t={},ue(e)||(e=[e]),r=0;e.length>r;r++)t[e[r].aggregate]=0,n[e[r].field]=t;return n},_wrapInEmptyGroup:function(e){var t,r,n,i,a=this.group();for(n=a.length-1,i=0;n>=i;n--)r=a[n],t={value:e.get(r.field),field:r.field,items:t?[t]:[e],hasSubgroups:!!t,aggregates:this._emptyAggregates(r.aggregates)};return t},totalPages:function(){var e=this,t=e.pageSize()||e.total();return Ae.ceil((e.total()||0)/t)},inRange:function(e,t){var r=this,n=Ae.min(e+t,r.total());return!r.options.serverPaging&&r._data.length>0?!0:r._findRange(e,n).length>0},lastRange:function(){var e=this._ranges;return e[e.length-1]||{start:0,end:0,data:[]}},firstItemUid:function(){var e=this._ranges;return e.length&&e[0].data.length&&e[0].data[0].uid},enableRequestsInProgress:function(){this._skipRequestsInProgress=!1},_timeStamp:function(){return(new Date).getTime()},range:function(e,r){var n,i,a,s,o,u,l,d;if(this._currentRequestTimeStamp=this._timeStamp(),this._skipRequestsInProgress=!0,e=Ae.min(e||0,this.total()),n=this,i=Ae.max(Ae.floor(e/r),0)*r,a=Ae.min(i+r,n.total()),s=n._findRange(e,Ae.min(e+r,n.total())),s.length){n._pending=t,n._skip=e>n.skip()?Ae.min(a,(n.totalPages()-1)*n.take()):i,n._currentRangeStart=e,n._take=r,o=n.options.serverPaging,u=n.options.serverSorting,l=n.options.serverFiltering,d=n.options.serverAggregates;try{n.options.serverPaging=!0,n._isServerGrouped()||n.group()&&n.group().length||(n.options.serverSorting=!0),n.options.serverFiltering=!0,n.options.serverPaging=!0,n.options.serverAggregates=!0,o&&(n._detachObservableParents(),n._data=s=n._observe(s)),n._process(s)}finally{n.options.serverPaging=o,n.options.serverSorting=u,n.options.serverFiltering=l,n.options.serverAggregates=d}}else r!==t&&(n._rangeExists(i,a)?e>i&&n.prefetch(a,r,function(){n.range(e,r)}):n.prefetch(i,r,function(){e>i&&ai;i++)if(n=m[i],e>=n.start&&n.end>=e){for(c=0,a=i;p>a;a++)if(n=m[a],f=v._flatData(n.data,!0),f.length&&e+c>=n.start&&(l=n.data,d=n.end,b||(_=g(v.group()||[]).concat(s(v.sort()||[])),h=v._queryProcess(n.data,{sort:_,filter:v.filter()}),f=l=h.data,h.total!==t&&(d=h.total)),o=0,e+c>n.start&&(o=e+c-n.start),u=f.length,d>r&&(u-=d-r),c+=u-o,y=v._mergeGroups(y,l,o,u),n.end>=r&&c==r-e))return y;break}return[]},_mergeGroups:function(e,t,r,n){if(this._isServerGrouped()){var i,a=t.toJSON();return e.length&&(i=e[e.length-1]),x(i,a,r,n),e.concat(a)}return e.concat(t.slice(r,n))},skip:function(){var e=this;return e._skip===t?e._page!==t?(e._page-1)*(e.take()||1):t:e._skip},currentRangeStart:function(){return this._currentRangeStart||0},take:function(){return this._take||this._pageSize},_prefetchSuccessHandler:function(e,t,r,n){var i=this,a=i._timeStamp();return function(s){var o,u,l,d=!1,h={start:e,end:t,data:[],timestamp:i._timeStamp()};if(i._dequeueRequest(),i.trigger(ze,{response:s,type:"read"}),s=i.reader.parse(s),l=i._readData(s),l.length){for(o=0,u=i._ranges.length;u>o;o++)if(i._ranges[o].start===e){d=!0,h=i._ranges[o];break}d||i._ranges.push(h)}h.data=i._observe(l),h.end=h.start+i._flatData(h.data,!0).length,i._ranges.sort(function(e,t){return e.start-t.start}),i._total=i.reader.total(s),(n||a>=i._currentRequestTimeStamp||!i._skipRequestsInProgress)&&(r&&l.length?r():i.trigger(ke,{}))}},prefetch:function(e,t,r){var n=this,i=Ae.min(e+t,n.total()),a={take:t,skip:e,page:e/t+1,pageSize:t,sort:n._sort,filter:n._filter,group:n._group,aggregate:n._aggregate};n._rangeExists(e,i)?r&&r():(clearTimeout(n._timeout),n._timeout=setTimeout(function(){n._queueRequest(a,function(){n.trigger(Ce,{type:"read"})?n._dequeueRequest():n.transport.read({data:n._params(a),success:n._prefetchSuccessHandler(e,i,r),error:function(){var e=Ge.call(arguments);n.error.apply(n,e)}})})},100))},_multiplePrefetch:function(e,t,r){var n=this,i=Ae.min(e+t,n.total()),a={take:t,skip:e,page:e/t+1,pageSize:t,sort:n._sort,filter:n._filter,group:n._group,aggregate:n._aggregate};n._rangeExists(e,i)?r&&r():n.trigger(Ce,{type:"read"})||n.transport.read({data:n._params(a),success:n._prefetchSuccessHandler(e,i,r,!0)})},_rangeExists:function(e,t){var r,n,i=this,a=i._ranges;for(r=0,n=a.length;n>r;r++)if(e>=a[r].start&&a[r].end>=t)return!0;return!1},_removeModelFromRanges:function(e){var t,r,n,i,a;for(i=0,a=this._ranges.length;a>i&&(n=this._ranges[i],this._eachItem(n.data,function(n){t=P(n,e),t&&(r=!0)}),!r);i++);},_updateRangesLength:function(){var e,t,r,n,i=0;for(r=0,n=this._ranges.length;n>r;r++)e=this._ranges[r],e.start=e.start-i,t=this._flatData(e.data,!0).length,i=e.end-t,e.end=e.start+t}}),Z={},Z.create=function(t,r,n){var i,a=t.transport?e.extend({},t.transport):null;return a?(a.read=typeof a.read===ve?{url:a.read}:a.read,"jsdo"===t.type&&(a.dataSource=n),t.type&&(ce.data.transports=ce.data.transports||{},ce.data.schemas=ce.data.schemas||{},ce.data.transports[t.type]?se(ce.data.transports[t.type])?a=ie(!0,{},ce.data.transports[t.type],a):i=new ce.data.transports[t.type](ie(a,{data:r})):ce.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=ie(!0,{},ce.data.schemas[t.type],t.schema)),i||(i=ge(a.read)?a:new K(a))):i=new Q({data:t.data||[]}),i},Y.create=function(e){(ue(e)||e instanceof We)&&(e={data:e});var r,n,i,a=e||{},s=a.data,o=a.fields,u=a.table,l=a.select,d={};if(s||!o||a.transport||(u?s=L(u,o):l&&(s=j(l,o),a.group===t&&s[0]&&s[0].optgroup!==t&&(a.group="optgroup"))),ce.data.Model&&o&&(!a.schema||!a.schema.model)){for(r=0,n=o.length;n>r;r++)i=o[r],i.type&&(d[i.field]=i);oe(d)||(a.schema=ie(!0,a.schema,{model:{fields:d}}))}return a.data=s,l=null,a.select=null,u=null,a.table=null,a instanceof Y?a:new Y(a)},ee=Ye.define({idField:"id",init:function(e){var t=this,r=t.hasChildren||e&&e.hasChildren,n="items",i={};ce.data.Model.fn.init.call(t,e),typeof t.children===ve&&(n=t.children),i={schema:{data:n,model:{hasChildren:r,id:t.idField,fields:t.fields}}},typeof t.children!==ve&&ie(i,t.children),i.data=e,r||(r=i.schema.data),typeof r===ve&&(r=ce.getter(r)),ge(r)&&(t.hasChildren=!!r.call(t,t)),t._childrenOptions=i,t.hasChildren&&t._initChildren(),t._loaded=!(!e||!e._loaded)},_initChildren:function(){var e,t,r,n=this;n.children instanceof te||(e=n.children=new te(n._childrenOptions),t=e.transport,r=t.parameterMap,t.parameterMap=function(e,t){return e[n.idField||"id"]=n.id,r&&(e=r(e,t)),e},e.parent=function(){return n},e.bind(ke,function(e){e.node=e.node||n,n.trigger(ke,e)}),e.bind(De,function(e){var t=n.parent();t&&(e.node=e.node||n,t.trigger(De,e))}),n._updateChildrenField())},append:function(e){this._initChildren(),this.loaded(!0),this.children.add(e)},hasChildren:!1,level:function(){for(var e=this.parentNode(),t=0;e&&e.parentNode;)t++,e=e.parentNode?e.parentNode():null;return t},_updateChildrenField:function(){var e=this._childrenOptions.schema.data;this[e||"items"]=this.children.data()},_childrenLoaded:function(){this._loaded=!0,this._updateChildrenField()},load:function(){var r,n,i={},a="_query";return this.hasChildren?(this._initChildren(),r=this.children,i[this.idField||"id"]=this.id,this._loaded||(r._data=t,a="read"),r.one(ke,ae(this._childrenLoaded,this)),n=r[a](i)):this.loaded(!0),n||e.Deferred().resolve().promise()},parentNode:function(){var e=this.parent();return e.parent()},loaded:function(e){return e===t?this._loaded:(this._loaded=e,t)},shouldSerialize:function(e){return Ye.fn.shouldSerialize.call(this,e)&&"children"!==e&&"_loaded"!==e&&"hasChildren"!==e&&"_childrenOptions"!==e}}),te=Y.extend({init:function(e){var t=ee.define({children:e});Y.fn.init.call(this,ie(!0,{},{schema:{modelBase:t,model:t}},e)),this._attachBubbleHandlers()},_attachBubbleHandlers:function(){var e=this;e._data.bind(De,function(t){e.trigger(De,t)})},remove:function(e){var t,r=e.parentNode(),n=this;return r&&r._initChildren&&(n=r.children),t=Y.fn.remove.call(n,e),r&&!n.data().length&&(r.hasChildren=!1),t},success:G("success"),data:G("data"),insert:function(e,t){var r=this.parent();return r&&r._initChildren&&(r.hasChildren=!0,r._initChildren()),Y.fn.insert.call(this,e,t)},_find:function(e,t){var r,n,i,a,s=this._data;if(s){if(i=Y.fn[e].call(this,t))return i;for(s=this._flatData(this._data),r=0,n=s.length;n>r;r++)if(a=s[r].children,a instanceof te&&(i=a[e](t)))return i}},get:function(e){return this._find("get",e)},getByUid:function(e){return this._find("getByUid",e)}}),te.create=function(e){e=e&&e.push?{data:e}:e;var t=e||{},r=t.data,n=t.fields,i=t.list;return r&&r._dataSource?r._dataSource:(r||!n||t.transport||i&&(r=E(i,n)),t.data=r,t instanceof te?t:new te(t))},re=ce.Observable.extend({init:function(e,t,r){ce.Observable.fn.init.call(this),this._prefetching=!1,this.dataSource=e,this.prefetch=!r;var n=this;e.bind("change",function(){n._change()}),e.bind("reset",function(){n._reset()}),this._syncWithDataSource(),this.setViewSize(t)},setViewSize:function(e){this.viewSize=e,this._recalculate()},at:function(e){var r=this.pageSize,n=!0;return e>=this.total()?(this.trigger("endreached",{index:e}),null):this.useRanges?this.useRanges?((this.dataOffset>e||e>=this.skip+r)&&(n=this.range(Math.floor(e/r)*r)),e===this.prefetchThreshold&&this._prefetch(),e===this.midPageThreshold?this.range(this.nextMidRange,!0):e===this.nextPageThreshold?this.range(this.nextFullRange):e===this.pullBackThreshold&&this.range(this.offset===this.skip?this.previousMidRange:this.previousFullRange),n?this.dataSource.at(e-this.dataOffset):(this.trigger("endreached",{index:e}),null)):t:this.dataSource.view()[e]},indexOf:function(e){return this.dataSource.data().indexOf(e)+this.dataOffset},total:function(){return parseInt(this.dataSource.total(),10)},next:function(){var e=this,t=e.pageSize,r=e.skip-e.viewSize+t,n=Ae.max(Ae.floor(r/t),0)*t;this.offset=r,this.dataSource.prefetch(n,t,function(){e._goToRange(r,!0)})},range:function(e,t){if(this.offset===e)return!0;var r=this,n=this.pageSize,i=Ae.max(Ae.floor(e/n),0)*n,a=this.dataSource;return t&&(i+=n),a.inRange(e,n)?(this.offset=e,this._recalculate(),this._goToRange(e),!0):this.prefetch?(a.prefetch(i,n,function(){r.offset=e,r._recalculate(),r._goToRange(e,!0)}),!1):!0},syncDataSource:function(){var e=this.offset;this.offset=null,this.range(e)},destroy:function(){this.unbind()},_prefetch:function(){var e=this,t=this.pageSize,r=this.skip+t,n=this.dataSource;n.inRange(r,t)||this._prefetching||!this.prefetch||(this._prefetching=!0,this.trigger("prefetching",{skip:r,take:t}),n.prefetch(r,t,function(){e._prefetching=!1,e.trigger("prefetched",{skip:r,take:t})}))},_goToRange:function(e,t){this.offset===e&&(this.dataOffset=e,this._expanding=t,this.dataSource.range(e,this.pageSize),this.dataSource.enableRequestsInProgress())},_reset:function(){this._syncPending=!0},_change:function(){var e=this.dataSource;this.length=this.useRanges?e.lastRange().end:e.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 e=this.dataSource;this._firstItemUid=e.firstItemUid(),this.dataOffset=this.offset=e.skip()||0,this.pageSize=e.pageSize(),this.useRanges=e.options.serverPaging},_recalculate:function(){var e=this.pageSize,t=this.offset,r=this.viewSize,n=Math.ceil(t/e)*e;this.skip=n,this.midPageThreshold=n+e-1,this.nextPageThreshold=n+r-1,this.prefetchThreshold=n+Math.floor(e/3*2),this.pullBackThreshold=this.offset-1,this.nextMidRange=n+e-r,this.nextFullRange=n,this.previousMidRange=t-r,this.previousFullRange=n-e}}),ne=ce.Observable.extend({init:function(e,t){var r=this;ce.Observable.fn.init.call(r),this.dataSource=e,this.batchSize=t,this._total=0,this.buffer=new re(e,3*t),this.buffer.bind({endreached:function(e){r.trigger("endreached",{index:e.index})},prefetching:function(e){r.trigger("prefetching",{skip:e.skip,take:e.take})},prefetched:function(e){r.trigger("prefetched",{skip:e.skip,take:e.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(e){var t,r,n=this.buffer,i=e*this.batchSize,a=this.batchSize,s=[];for(n.offset>i&&n.at(n.offset-1),r=0;a>r&&(t=n.at(i+r),null!==t);r++)s.push(t);return s},total:function(){return this._total},destroy:function(){this.buffer.destroy(),this.unbind()}}),ie(!0,ce.data,{readers:{json:X},Query:a,DataSource:Y,HierarchicalDataSource:te,Node:ee,ObservableObject:Ke,ObservableArray:We,LazyObservableArray:Qe,LocalTransport:Q,RemoteTransport:K,Cache:$,DataReader:X,Model:Ye,Buffer:re,BatchBuffer:ne})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,r){(r||t)()}); /*! kendo.columnsorter.min.js */ /** * Kendo UI v2016.2.504 (http://www.telerik.com/kendo-ui) * Copyright 2016 Telerik AD. All rights reserved. * * Kendo UI commercial licenses may be obtained at * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete * If you do not own a commercial license, this file shall be governed by the trial license terms. */ !function(e,define){define("kendo.columnsorter.min",["kendo.core.min"],e)}(function(){return function(e,n){var r=window.kendo,t=r.ui,o=t.Widget,i="dir",a="asc",l="single",d="field",s="desc",c=".kendoColumnSorter",f=".k-link",u="aria-sort",k=e.proxy,m=o.extend({init:function(e,n){var r,t=this;o.fn.init.call(t,e,n),t._refreshHandler=k(t.refresh,t),t.dataSource=t.options.dataSource.bind("change",t._refreshHandler),r=t.element.find(f),r[0]||(r=t.element.wrapInner('').find(f)),t.link=r,t.element.on("click"+c,k(t._click,t))},options:{name:"ColumnSorter",mode:l,allowUnsort:!0,compare:null,filter:""},destroy:function(){var e=this;o.fn.destroy.call(e),e.element.off(c),e.dataSource.unbind("change",e._refreshHandler),e._refreshHandler=e.element=e.link=e.dataSource=null},refresh:function(){var n,t,o,l,c=this,f=c.dataSource.sort()||[],k=c.element,m=k.attr(r.attr(d));for(k.removeAttr(r.attr(i)),k.removeAttr(u),n=0,t=f.length;t>n;n++)o=f[n],m==o.field&&k.attr(r.attr(i),o.dir);l=k.attr(r.attr(i)),k.find(".k-i-arrow-n,.k-i-arrow-s").remove(),l===a?(e('').appendTo(c.link),k.attr(u,"ascending")):l===s&&(e('').appendTo(c.link),k.attr(u,"descending"))},_click:function(e){var t,o,c=this,f=c.element,u=f.attr(r.attr(d)),k=f.attr(r.attr(i)),m=c.options,p=null===c.options.compare?n:c.options.compare,h=c.dataSource.sort()||[];if(e.preventDefault(),!m.filter||f.is(m.filter)){if(k=k===a?s:k===s&&m.allowUnsort?n:a,m.mode===l)h=[{field:u,dir:k,compare:p}];else if("multiple"===m.mode){for(t=0,o=h.length;o>t;t++)if(h[t].field===u){h.splice(t,1);break}h.push({field:u,dir:k,compare:p})}this.dataSource.sort(h)}}});t.plugin(m)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,n,r){(r||n)()}); /*! kendo.userevents.min.js */ /** * Kendo UI v2016.2.504 (http://www.telerik.com/kendo-ui) * Copyright 2016 Telerik AD. All rights reserved. * * Kendo UI commercial licenses may be obtained at * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete * If you do not own a commercial license, this file shall be governed by the trial license terms. */ !function(e,define){define("kendo.userevents.min",["kendo.core.min"],e)}(function(){return function(e,t){function n(e,t){var n=e.x.location,i=e.y.location,o=t.x.location,r=t.y.location,s=n-o,a=i-r;return{center:{x:(n+o)/2,y:(i+r)/2},distance:Math.sqrt(s*s+a*a)}}function i(e){var t,n,i,o=[],r=e.originalEvent,a=e.currentTarget,c=0;if(e.api)o.push({id:2,event:e,target:e.target,currentTarget:e.target,location:e,type:"api"});else if(e.type.match(/touch/))for(n=r?r.changedTouches:[],t=n.length;t>c;c++)i=n[c],o.push({location:i,event:e,target:i.target,currentTarget:a,id:i.identifier,type:"touch"});else o.push(s.pointers||s.msPointers?{location:r,event:e,target:e.target,currentTarget:a,id:r.pointerId,type:"pointer"}:{id:1,event:e,target:e.target,currentTarget:a,location:e,type:"mouse"});return o}function o(e){for(var t=r.eventMap.up.split(" "),n=0,i=t.length;i>n;n++)e(t[n])}var r=window.kendo,s=r.support,a=window.document,c=r.Class,u=r.Observable,h=e.now,l=e.extend,p=s.mobileOS,d=p&&p.android,f=800,v=s.browser.msie?5:0,g="press",m="hold",_="select",T="start",y="move",x="end",w="cancel",M="tap",E="release",k="gesturestart",D="gesturechange",C="gestureend",b="gesturetap",A={api:0,touch:0,mouse:9,pointer:9},I=!s.touch||s.mouseAndTouchPresent,S=c.extend({init:function(e,t){var n=this;n.axis=e,n._updateLocationData(t),n.startLocation=n.location,n.velocity=n.delta=0,n.timeStamp=h()},move:function(e){var t=this,n=e["page"+t.axis],i=h(),o=i-t.timeStamp||1;(n||!d)&&(t.delta=n-t.location,t._updateLocationData(e),t.initialDelta=n-t.startLocation,t.velocity=t.delta/o,t.timeStamp=i)},_updateLocationData:function(e){var t=this,n=t.axis;t.location=e["page"+n],t.client=e["client"+n],t.screen=e["screen"+n]}}),P=c.extend({init:function(e,t,n){l(this,{x:new S("X",n.location),y:new S("Y",n.location),type:n.type,useClickAsTap:e.useClickAsTap,threshold:e.threshold||A[n.type],userEvents:e,target:t,currentTarget:n.currentTarget,initialTouch:n.target,id:n.id,pressEvent:n,_moved:!1,_finished:!1})},press:function(){this._holdTimeout=setTimeout(e.proxy(this,"_hold"),this.userEvents.minHold),this._trigger(g,this.pressEvent)},_hold:function(){this._trigger(m,this.pressEvent)},move:function(e){var t=this;if(!t._finished){if(t.x.move(e.location),t.y.move(e.location),!t._moved){if(t._withinIgnoreThreshold())return;if(L.current&&L.current!==t.userEvents)return t.dispose();t._start(e)}t._finished||t._trigger(y,e)}},end:function(e){this.endTime=h(),this._finished||(this._finished=!0,this._trigger(E,e),this._moved?this._trigger(x,e):this.useClickAsTap||this._trigger(M,e),clearTimeout(this._holdTimeout),this.dispose())},dispose:function(){var t=this.userEvents,n=t.touches;this._finished=!0,this.pressEvent=null,clearTimeout(this._holdTimeout),n.splice(e.inArray(this,n),1)},skip:function(){this.dispose()},cancel:function(){this.dispose()},isMoved:function(){return this._moved},_start:function(e){clearTimeout(this._holdTimeout),this.startTime=h(),this._moved=!0,this._trigger(T,e)},_trigger:function(e,t){var n=this,i=t.event,o={touch:n,x:n.x,y:n.y,target:n.target,event:i};n.userEvents.notify(e,o)&&i.preventDefault()},_withinIgnoreThreshold:function(){var e=this.x.initialDelta,t=this.y.initialDelta;return Math.sqrt(e*e+t*t)<=this.threshold}}),L=u.extend({init:function(t,n){var i,c,h,p=this,d=r.guid();n=n||{},i=p.filter=n.filter,p.threshold=n.threshold||v,p.minHold=n.minHold||f,p.touches=[],p._maxTouches=n.multiTouch?2:1,p.allowSelection=n.allowSelection,p.captureUpIfMoved=n.captureUpIfMoved,p.useClickAsTap=!n.fastTap&&!s.delayedClick(),p.eventNS=d,t=e(t).handler(p),u.fn.init.call(p),l(p,{element:t,surface:e(n.global&&I?a.documentElement:n.surface||t),stopPropagation:n.stopPropagation,pressed:!1}),p.surface.handler(p).on(r.applyEventMap("move",d),"_move").on(r.applyEventMap("up cancel",d),"_end"),t.on(r.applyEventMap("down",d),i,"_start"),p.useClickAsTap&&t.on(r.applyEventMap("click",d),i,"_click"),(s.pointers||s.msPointers)&&(11>s.browser.version?t.css("-ms-touch-action","pinch-zoom double-tap-zoom"):t.css("touch-action","pan-y")),n.preventDragEvent&&t.on(r.applyEventMap("dragstart",d),r.preventDefault),t.on(r.applyEventMap("mousedown",d),i,{root:t},"_select"),p.captureUpIfMoved&&s.eventCapture&&(c=p.surface[0],h=e.proxy(p.preventIfMoving,p),o(function(e){c.addEventListener(e,h,!0)})),p.bind([g,m,M,T,y,x,E,w,k,D,C,b,_],n)},preventIfMoving:function(e){this._isMoved()&&e.preventDefault()},destroy:function(){var e,t=this;t._destroyed||(t._destroyed=!0,t.captureUpIfMoved&&s.eventCapture&&(e=t.surface[0],o(function(n){e.removeEventListener(n,t.preventIfMoving)})),t.element.kendoDestroy(t.eventNS),t.surface.kendoDestroy(t.eventNS),t.element.removeData("handler"),t.surface.removeData("handler"),t._disposeAll(),t.unbind(),delete t.surface,delete t.element,delete t.currentTarget)},capture:function(){L.current=this},cancel:function(){this._disposeAll(),this.trigger(w)},notify:function(e,t){var i=this,o=i.touches;if(this._isMultiTouch()){switch(e){case y:e=D;break;case x:e=C;break;case M:e=b}l(t,{touches:o},n(o[0],o[1]))}return this.trigger(e,l(t,{type:e}))},press:function(e,t,n){this._apiCall("_start",e,t,n)},move:function(e,t){this._apiCall("_move",e,t)},end:function(e,t){this._apiCall("_end",e,t)},_isMultiTouch:function(){return this.touches.length>1},_maxTouchesReached:function(){return this.touches.length>=this._maxTouches},_disposeAll:function(){for(var e=this.touches;e.length>0;)e.pop().dispose()},_isMoved:function(){return e.grep(this.touches,function(e){return e.isMoved()}).length},_select:function(e){(!this.allowSelection||this.trigger(_,{event:e}))&&e.preventDefault()},_start:function(t){var n,o,r=this,s=0,a=r.filter,c=i(t),u=c.length,h=t.which;if(!(h&&h>1||r._maxTouchesReached()))for(L.current=null,r.currentTarget=t.currentTarget,r.stopPropagation&&t.stopPropagation();u>s&&!r._maxTouchesReached();s++)o=c[s],n=a?e(o.currentTarget):r.element,n.length&&(o=new P(r,n,o),r.touches.push(o),o.press(),r._isMultiTouch()&&r.notify("gesturestart",{}))},_move:function(e){this._eachTouch("move",e)},_end:function(e){this._eachTouch("end",e)},_click:function(t){var n={touch:{initialTouch:t.target,target:e(t.currentTarget),endTime:h(),x:{location:t.pageX,client:t.clientX},y:{location:t.pageY,client:t.clientY}},x:t.pageX,y:t.pageY,target:e(t.currentTarget),event:t,type:"tap"};this.trigger("tap",n)&&t.preventDefault()},_eachTouch:function(e,t){var n,o,r,s,a=this,c={},u=i(t),h=a.touches;for(n=0;h.length>n;n++)o=h[n],c[o.id]=o;for(n=0;u.length>n;n++)r=u[n],s=c[r.id],s&&s[e](r)},_apiCall:function(t,n,i,o){this[t]({api:!0,pageX:n,pageY:i,clientX:n,clientY:i,target:e(o||this.element)[0],stopPropagation:e.noop,preventDefault:e.noop})}});L.defaultThreshold=function(e){v=e},L.minHold=function(e){f=e},r.getTouches=i,r.touchDelta=n,r.UserEvents=L}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}); /*! kendo.draganddrop.min.js */ /** * Kendo UI v2016.2.504 (http://www.telerik.com/kendo-ui) * Copyright 2016 Telerik AD. All rights reserved. * * Kendo UI commercial licenses may be obtained at * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete * If you do not own a commercial license, this file shall be governed by the trial license terms. */ !function(t,define){define("kendo.draganddrop.min",["kendo.core.min","kendo.userevents.min"],t)}(function(){return function(t,e){function n(e,n){try{return t.contains(e,n)||e==n}catch(r){return!1}}function r(t,e){return parseInt(t.css(e),10)||0}function i(t,e){return Math.min(Math.max(t,e.min),e.max)}function o(t,e){var n=D(t),i=n.left+r(t,"borderLeftWidth")+r(t,"paddingLeft"),o=n.top+r(t,"borderTopWidth")+r(t,"paddingTop"),a=i+t.width()-e.outerWidth(!0),s=o+t.height()-e.outerHeight(!0);return{x:{min:i,max:a},y:{min:o,max:s}}}function a(n,r,i){for(var o,a,s=0,l=r&&r.length,c=i&&i.length;n&&n.parentNode;){for(s=0;l>s;s++)if(o=r[s],o.element[0]===n)return{target:o,targetElement:n};for(s=0;c>s;s++)if(a=i[s],t.contains(a.element[0],n)&&x.matchesSelector.call(n,a.options.filter))return{target:a,targetElement:n};n=n.parentNode}return e}function s(t,e){var n,r=e.options.group,i=t[r];if(T.fn.destroy.call(e),i.length>1){for(n=0;i.length>n;n++)if(i[n]==e){i.splice(n,1);break}}else i.length=0,delete t[r]}function l(t){var e,n,r,i=c()[0];return t[0]===i?(n=i.scrollTop,r=i.scrollLeft,{top:n,left:r,bottom:n+b.height(),right:r+b.width()}):(e=t.offset(),e.bottom=e.top+t.height(),e.right=e.left+t.width(),e)}function c(){return t(_.support.browser.chrome?y.body:y.documentElement)}function u(e){var n,r=c();if(!e||e===y.body||e===y.documentElement)return r;for(n=t(e)[0];n&&!_.isScrollable(n)&&n!==y.body;)n=n.parentNode;return n===y.body?r:t(n)}function h(t,e,n){var r={x:0,y:0},i=50;return i>t-n.left?r.x=-(i-(t-n.left)):i>n.right-t&&(r.x=i-(n.right-t)),i>e-n.top?r.y=-(i-(e-n.top)):i>n.bottom-e&&(r.y=i-(n.bottom-e)),r}var d,f,p,g,v,m,_=window.kendo,x=_.support,y=window.document,b=t(window),E=_.Class,T=_.ui.Widget,M=_.Observable,S=_.UserEvents,w=t.proxy,C=t.extend,D=_.getOffset,O={},k={},I={},H=_.elementUnderCursor,W="keyup",z="change",P="dragstart",U="hold",L="drag",A="dragend",N="dragcancel",V="hintDestroyed",B="dragenter",$="dragleave",F="drop",j=M.extend({init:function(e,n){var r=this,i=e[0];r.capture=!1,i.addEventListener?(t.each(_.eventMap.down.split(" "),function(){i.addEventListener(this,w(r._press,r),!0)}),t.each(_.eventMap.up.split(" "),function(){i.addEventListener(this,w(r._release,r),!0)})):(t.each(_.eventMap.down.split(" "),function(){i.attachEvent(this,w(r._press,r))}),t.each(_.eventMap.up.split(" "),function(){i.attachEvent(this,w(r._release,r))})),M.fn.init.call(r),r.bind(["press","release"],n||{})},captureNext:function(){this.capture=!0},cancelCapture:function(){this.capture=!1},_press:function(t){var e=this;e.trigger("press"),e.capture&&t.preventDefault()},_release:function(t){var e=this;e.trigger("release"),e.capture&&(t.preventDefault(),e.cancelCapture())}}),G=M.extend({init:function(e){var n=this;M.fn.init.call(n),n.forcedEnabled=!1,t.extend(n,e),n.scale=1,n.horizontal?(n.measure="offsetWidth",n.scrollSize="scrollWidth",n.axis="x"):(n.measure="offsetHeight",n.scrollSize="scrollHeight",n.axis="y")},makeVirtual:function(){t.extend(this,{virtual:!0,forcedEnabled:!0,_virtualMin:0,_virtualMax:0})},virtualSize:function(t,e){(this._virtualMin!==t||this._virtualMax!==e)&&(this._virtualMin=t,this._virtualMax=e,this.update())},outOfBounds:function(t){return t>this.max||this.min>t},forceEnabled:function(){this.forcedEnabled=!0},getSize:function(){return this.container[0][this.measure]},getTotal:function(){return this.element[0][this.scrollSize]},rescale:function(t){this.scale=t},update:function(t){var e=this,n=e.virtual?e._virtualMax:e.getTotal(),r=n*e.scale,i=e.getSize();(0!==n||e.forcedEnabled)&&(e.max=e.virtual?-e._virtualMin:0,e.size=i,e.total=r,e.min=Math.min(e.max,i-r),e.minScale=i/n,e.centerOffset=(r-i)/2,e.enabled=e.forcedEnabled||r>i,t||e.trigger(z,e))}}),Q=M.extend({init:function(t){var e=this;M.fn.init.call(e),e.x=new G(C({horizontal:!0},t)),e.y=new G(C({horizontal:!1},t)),e.container=t.container,e.forcedMinScale=t.minScale,e.maxScale=t.maxScale||100,e.bind(z,t)},rescale:function(t){this.x.rescale(t),this.y.rescale(t),this.refresh()},centerCoordinates:function(){return{x:Math.min(0,-this.x.centerOffset),y:Math.min(0,-this.y.centerOffset)}},refresh:function(){var t=this;t.x.update(),t.y.update(),t.enabled=t.x.enabled||t.y.enabled,t.minScale=t.forcedMinScale||Math.min(t.x.minScale,t.y.minScale),t.fitScale=Math.max(t.x.minScale,t.y.minScale),t.trigger(z)}}),q=M.extend({init:function(t){var e=this;C(e,t),M.fn.init.call(e)},outOfBounds:function(){return this.dimension.outOfBounds(this.movable[this.axis])},dragMove:function(t){var e=this,n=e.dimension,r=e.axis,i=e.movable,o=i[r]+t;n.enabled&&((n.min>o&&0>t||o>n.max&&t>0)&&(t*=e.resistance),i.translateAxis(r,t),e.trigger(z,e))}}),J=E.extend({init:function(e){var n,r,i,o,a=this;C(a,{elastic:!0},e),i=a.elastic?.5:0,o=a.movable,a.x=n=new q({axis:"x",dimension:a.dimensions.x,resistance:i,movable:o}),a.y=r=new q({axis:"y",dimension:a.dimensions.y,resistance:i,movable:o}),a.userEvents.bind(["press","move","end","gesturestart","gesturechange"],{gesturestart:function(t){a.gesture=t,a.offset=a.dimensions.container.offset()},press:function(e){t(e.event.target).closest("a").is("[data-navigate-on-press=true]")&&e.sender.cancel()},gesturechange:function(t){var e,i,s,l=a.gesture,c=l.center,u=t.center,h=t.distance/l.distance,d=a.dimensions.minScale,f=a.dimensions.maxScale;d>=o.scale&&1>h&&(h+=.8*(1-h)),o.scale*h>=f&&(h=f/o.scale),i=o.x+a.offset.left,s=o.y+a.offset.top,e={x:(i-c.x)*h+u.x-i,y:(s-c.y)*h+u.y-s},o.scaleWith(h),n.dragMove(e.x),r.dragMove(e.y),a.dimensions.rescale(o.scale),a.gesture=t,t.preventDefault()},move:function(t){t.event.target.tagName.match(/textarea|input/i)||(n.dimension.enabled||r.dimension.enabled?(n.dragMove(t.x.delta),r.dragMove(t.y.delta),t.preventDefault()):t.touch.skip())},end:function(t){t.preventDefault()}})}}),K=x.transitions.prefix+"Transform";f=x.hasHW3D?function(t,e,n){return"translate3d("+t+"px,"+e+"px,0) scale("+n+")"}:function(t,e,n){return"translate("+t+"px,"+e+"px) scale("+n+")"},p=M.extend({init:function(e){var n=this;M.fn.init.call(n),n.element=t(e),n.element[0].style.webkitTransformOrigin="left top",n.x=0,n.y=0,n.scale=1,n._saveCoordinates(f(n.x,n.y,n.scale))},translateAxis:function(t,e){this[t]+=e,this.refresh()},scaleTo:function(t){this.scale=t,this.refresh()},scaleWith:function(t){this.scale*=t,this.refresh()},translate:function(t){this.x+=t.x,this.y+=t.y,this.refresh()},moveAxis:function(t,e){this[t]=e,this.refresh()},moveTo:function(t){C(this,t),this.refresh()},refresh:function(){var t,e=this,n=e.x,r=e.y;e.round&&(n=Math.round(n),r=Math.round(r)),t=f(n,r,e.scale),t!=e.coordinates&&(_.support.browser.msie&&10>_.support.browser.version?(e.element[0].style.position="absolute",e.element[0].style.left=e.x+"px",e.element[0].style.top=e.y+"px"):e.element[0].style[K]=t,e._saveCoordinates(t),e.trigger(z))},_saveCoordinates:function(t){this.coordinates=t}}),g=T.extend({init:function(t,e){var n,r=this;T.fn.init.call(r,t,e),n=r.options.group,n in k?k[n].push(r):k[n]=[r]},events:[B,$,F],options:{name:"DropTarget",group:"default"},destroy:function(){s(k,this)},_trigger:function(t,n){var r=this,i=O[r.options.group];return i?r.trigger(t,C({},n.event,{draggable:i,dropTarget:n.dropTarget})):e},_over:function(t){this._trigger(B,t)},_out:function(t){this._trigger($,t)},_drop:function(t){var e=this,n=O[e.options.group];n&&(n.dropped=!e._trigger(F,t))}}),g.destroyGroup=function(t){var e,n=k[t]||I[t];if(n){for(e=0;n.length>e;e++)T.fn.destroy.call(n[e]);n.length=0,delete k[t],delete I[t]}},g._cache=k,v=g.extend({init:function(t,e){var n,r=this;T.fn.init.call(r,t,e),n=r.options.group,n in I?I[n].push(r):I[n]=[r]},destroy:function(){s(I,this)},options:{name:"DropTargetArea",group:"default",filter:null}}),m=T.extend({init:function(t,e){var n=this;T.fn.init.call(n,t,e),n._activated=!1,n.userEvents=new S(n.element,{global:!0,allowSelection:!0,filter:n.options.filter,threshold:n.options.distance,start:w(n._start,n),hold:w(n._hold,n),move:w(n._drag,n),end:w(n._end,n),cancel:w(n._cancel,n),select:w(n._select,n)}),n._afterEndHandler=w(n._afterEnd,n),n._captureEscape=w(n._captureEscape,n)},events:[U,P,L,A,N,V],options:{name:"Draggable",distance:_.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(t){var e=this;t.keyCode===_.keys.ESC&&(e._trigger(N,{event:t}),e.userEvents.cancel())},_updateHint:function(e){var n,r=this,o=r.options,a=r.boundaries,s=o.axis,l=r.options.cursorOffset;l?n={left:e.x.location+l.left,top:e.y.location+l.top}:(r.hintOffset.left+=e.x.delta,r.hintOffset.top+=e.y.delta,n=t.extend({},r.hintOffset)),a&&(n.top=i(n.top,a.y),n.left=i(n.left,a.x)),"x"===s?delete n.top:"y"===s&&delete n.left,r.hint.css(n)},_shouldIgnoreTarget:function(e){var n=this.options.ignore;return n&&t(e).is(n)},_select:function(t){this._shouldIgnoreTarget(t.event.target)||t.preventDefault()},_start:function(n){var r,i=this,a=i.options,s=a.container,l=a.hint;return this._shouldIgnoreTarget(n.touch.initialTouch)||a.holdToDrag&&!i._activated?(i.userEvents.cancel(),e):(i.currentTarget=n.target,i.currentTargetOffset=D(i.currentTarget),l&&(i.hint&&i.hint.stop(!0,!0).remove(),i.hint=_.isFunction(l)?t(l.call(i,i.currentTarget)):l,r=D(i.currentTarget),i.hintOffset=r,i.hint.css({position:"absolute",zIndex:2e4,left:r.left,top:r.top}).appendTo(y.body),i.angular("compile",function(){i.hint.removeAttr("ng-repeat");for(var e=t(n.target);!e.data("$$kendoScope")&&e.length;)e=e.parent();return{elements:i.hint.get(),scopeFrom:e.data("$$kendoScope")}})),O[a.group]=i,i.dropped=!1,s&&(i.boundaries=o(s,i.hint)),t(y).on(W,i._captureEscape),i._trigger(P,n)&&(i.userEvents.cancel(),i._afterEnd()),i.userEvents.capture(),e)},_hold:function(t){this.currentTarget=t.target,this._trigger(U,t)?this.userEvents.cancel():this._activated=!0},_drag:function(e){var n,r;e.preventDefault(),n=this._elementUnderCursor(e),this._lastEvent=e,this._processMovement(e,n),this.options.autoScroll&&(this._cursorElement!==n&&(this._scrollableParent=u(n),this._cursorElement=n),this._scrollableParent[0]&&(r=h(e.x.location,e.y.location,l(this._scrollableParent)),this._scrollCompenstation=t.extend({},this.hintOffset),this._scrollVelocity=r,0===r.y&&0===r.x?(clearInterval(this._scrollInterval),this._scrollInterval=null):this._scrollInterval||(this._scrollInterval=setInterval(t.proxy(this,"_autoScroll"),50)))),this.hint&&this._updateHint(e)},_processMovement:function(n,r){this._withDropTarget(r,function(r,i){if(!r)return d&&(d._trigger($,C(n,{dropTarget:t(d.targetElement)})),d=null),e;if(d){if(i===d.targetElement)return;d._trigger($,C(n,{dropTarget:t(d.targetElement)}))}r._trigger(B,C(n,{dropTarget:t(i)})),d=C(r,{targetElement:i})}),this._trigger(L,C(n,{dropTarget:d,elementUnderCursor:r}))},_autoScroll:function(){var t,e,n,r,i,o,a,s,l=this._scrollableParent[0],u=this._scrollVelocity,h=this._scrollCompenstation;l&&(t=this._elementUnderCursor(this._lastEvent),this._processMovement(this._lastEvent,t),r=l===c()[0],r?(e=y.body.scrollHeight>b.height(),n=y.body.scrollWidth>b.width()):(e=l.scrollHeight>=l.offsetHeight,n=l.scrollWidth>=l.offsetWidth),i=l.scrollTop+u.y,o=e&&i>0&&l.scrollHeight>i,a=l.scrollLeft+u.x,s=n&&a>0&&l.scrollWidth>a,o&&(l.scrollTop+=u.y),s&&(l.scrollLeft+=u.x),r&&(s||o)&&(o&&(h.top+=u.y),s&&(h.left+=u.x),this.hint.css(h)))},_end:function(e){this._withDropTarget(this._elementUnderCursor(e),function(n,r){n&&(n._drop(C({},e,{dropTarget:t(r)})),d=null)}),this._cancel(this._trigger(A,e))},_cancel:function(t){var e=this;e._scrollableParent=null,this._cursorElement=null,clearInterval(this._scrollInterval),e._activated=!1,e.hint&&!e.dropped?setTimeout(function(){e.hint.stop(!0,!0),t?e._afterEndHandler():e.hint.animate(e.currentTargetOffset,"fast",e._afterEndHandler)},0):e._afterEnd()},_trigger:function(t,e){var n=this;return n.trigger(t,C({},e.event,{x:e.x,y:e.y,currentTarget:n.currentTarget,initialTarget:e.touch?e.touch.initialTouch:null,dropTarget:e.dropTarget,elementUnderCursor:e.elementUnderCursor}))},_elementUnderCursor:function(t){var e=H(t),r=this.hint;return r&&n(r[0],e)&&(r.hide(),e=H(t),e||(e=H(t)),r.show()),e},_withDropTarget:function(t,e){var n,r=this.options.group,i=k[r],o=I[r];(i&&i.length||o&&o.length)&&(n=a(t,i,o),n?e(n.target,n.targetElement):e())},destroy:function(){var t=this;T.fn.destroy.call(t),t._afterEnd(),t.userEvents.destroy(),this._scrollableParent=null,this._cursorElement=null,clearInterval(this._scrollInterval),t.currentTarget=null},_afterEnd:function(){var e=this;e.hint&&e.hint.remove(),delete O[e.options.group],e.trigger("destroy"),e.trigger(V),t(y).off(W,e._captureEscape)}}),_.ui.plugin(g),_.ui.plugin(v),_.ui.plugin(m),_.TapCapture=j,_.containerBoundaries=o,C(_.ui,{Pane:J,PaneDimensions:Q,Movable:p}),_.ui.Draggable.utils={autoScrollVelocity:h,scrollableViewPort:l,findScrollableParent:u}}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(t,e,n){(n||e)()}); /*! kendo.sortable.min.js */ /** * Kendo UI v2016.2.504 (http://www.telerik.com/kendo-ui) * Copyright 2016 Telerik AD. All rights reserved. * * Kendo UI commercial licenses may be obtained at * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete * If you do not own a commercial license, this file shall be governed by the trial license terms. */ !function(e,define){define("kendo.sortable.min",["kendo.draganddrop.min"],e)}(function(){return function(e,t){function n(t,n){try{return e.contains(t,n)||t==n}catch(r){return!1}}function r(e){return e.clone()}function i(e){return e.clone().removeAttr("id").css("visibility","hidden")}var o=window.kendo,s=o.ui.Widget,l="start",a="beforeMove",h="move",d="end",c="change",u="cancel",g="sort",f="remove",p="receive",m=">*",_=-1,v=s.extend({init:function(e,t){var n=this;s.fn.init.call(n,e,t),n.options.placeholder||(n.options.placeholder=i),n.options.hint||(n.options.hint=r),n.draggable=n._createDraggable()},events:[l,a,h,d,c,u],options:{name:"Sortable",hint:null,placeholder:null,filter:m,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(),s.fn.destroy.call(this)},_createDraggable:function(){var t=this,n=t.element,r=t.options;return new o.ui.Draggable(n,{filter:r.filter,hint:o.isFunction(r.hint)?r.hint:e(r.hint),holdToDrag:r.holdToDrag,container:r.container?e(r.container):null,cursorOffset:r.cursorOffset,axis:r.axis,ignore:r.ignore,autoScroll:r.autoScroll,dragstart:e.proxy(t._dragstart,t),dragcancel:e.proxy(t._dragcancel,t),drag:e.proxy(t._drag,t),dragend:e.proxy(t._dragend,t)})},_dragstart:function(t){var n=this.draggedElement=t.currentTarget,r=this.options.disabled,i=this.options.handler,s=this.options.placeholder,a=this.placeholder=e(o.isFunction(s)?s.call(this,n):s);r&&n.is(r)?t.preventDefault():i&&!e(t.initialTarget).is(i)?t.preventDefault():this.trigger(l,{item:n,draggableEvent:t})?t.preventDefault():(n.css("display","none"),n.before(a),this._setCursor())},_dragcancel:function(){this._cancel(),this.trigger(u,{item:this.draggedElement}),this._resetCursor()},_drag:function(n){var r,i,o,s,l,a=this.draggedElement,h=this._findTarget(n),d={left:n.x.location,top:n.y.location},c={x:n.x.delta,y:n.y.delta},u=this.options.axis,g=this.options.moveOnDragEnter,f={item:a,list:this,draggableEvent:n};if("x"===u||"y"===u)return this._movementByAxis(u,d,c[u],f),t;if(h){if(r=this._getElementCenter(h.element),i={left:Math.round(d.left-r.left),top:Math.round(d.top-r.top)},e.extend(f,{target:h.element}),h.appendToBottom)return this._movePlaceholder(h,null,f),t;if(h.appendAfterHidden&&this._movePlaceholder(h,"next",f),this._isFloating(h.element)?0>c.x&&(g||0>i.left)?o="prev":c.x>0&&(g||i.left>0)&&(o="next"):0>c.y&&(g||0>i.top)?o="prev":c.y>0&&(g||i.top>0)&&(o="next"),o){for(l="prev"===o?jQuery.fn.prev:jQuery.fn.next,s=l.call(h.element);s.length&&!s.is(":visible");)s=l.call(s);s[0]!=this.placeholder[0]&&this._movePlaceholder(h,o,f)}}},_dragend:function(n){var r,i,o,s,l=this.placeholder,a=this.draggedElement,h=this.indexOf(a),u=this.indexOf(l),m=this.options.connectWith;return this._resetCursor(),o={action:g,item:a,oldIndex:h,newIndex:u,draggableEvent:n},u>=0?i=this.trigger(d,o):(r=l.parents(m).getKendoSortable(),o.action=f,s=e.extend({},o,{action:p,oldIndex:_,newIndex:r.indexOf(l)}),i=!(!this.trigger(d,o)&&!r.trigger(d,s))),i||u===h?(this._cancel(),t):(l.replaceWith(a),a.show(),this.draggable.dropped=!0,o={action:this.indexOf(a)!=_?g:f,item:a,oldIndex:h,newIndex:this.indexOf(a),draggableEvent:n},this.trigger(c,o),r&&(s=e.extend({},o,{action:p,oldIndex:_,newIndex:r.indexOf(a)}),r.trigger(c,s)),t)},_findTarget:function(n){var r,i,o=this._findElementUnderCursor(n),s=this.options.connectWith;return e.contains(this.element[0],o)?(r=this.items(),i=r.filter(o)[0]||r.has(o)[0],i?{element:e(i),sortable:this}:null):this.element[0]==o&&this._isEmpty()?{element:this.element,sortable:this,appendToBottom:!0}:this.element[0]==o&&this._isLastHidden()?(i=this.items().eq(0),{element:i,sortable:this,appendAfterHidden:!0}):s?this._searchConnectedTargets(o,n):t},_findElementUnderCursor:function(e){var t=o.elementUnderCursor(e),r=e.sender;return n(r.hint[0],t)&&(r.hint.hide(),t=o.elementUnderCursor(e),t||(t=o.elementUnderCursor(e)),r.hint.show()),t},_searchConnectedTargets:function(t,n){var r,i,o,s,l=e(this.options.connectWith);for(s=0;l.length>s;s++)if(r=l.eq(s).getKendoSortable(),e.contains(l[s],t)){if(r)return i=r.items(),o=i.filter(t)[0]||i.has(t)[0],o?(r.placeholder=this.placeholder,{element:e(o),sortable:r}):null}else if(l[s]==t){if(r&&r._isEmpty())return{element:l.eq(s),sortable:r,appendToBottom:!0};if(this._isCursorAfterLast(r,n))return o=r.items().last(),{element:o,sortable:r}}},_isCursorAfterLast:function(e,t){var n,r,i=e.items().last(),s={left:t.x.location,top:t.y.location};return n=o.getOffset(i),n.top+=i.outerHeight(),n.left+=i.outerWidth(),r=this._isFloating(i)?n.left-s.left:n.top-s.top,0>r?!0:!1},_movementByAxis:function(t,n,r,i){var o,s="x"===t?n.left:n.top,l=0>r?this.placeholder.prev():this.placeholder.next();l.length&&!l.is(":visible")&&(l=0>r?l.prev():l.next()),e.extend(i,{target:l}),o=this._getElementCenter(l),o&&(o="x"===t?o.left:o.top),l.length&&0>r&&0>s-o?this._movePlaceholder({element:l,sortable:this},"prev",i):l.length&&r>0&&s-o>0&&this._movePlaceholder({element:l,sortable:this},"next",i)},_movePlaceholder:function(e,t,n){var r=this.placeholder;e.sortable.trigger(a,n)||(t?"prev"===t?e.element.before(r):"next"===t&&e.element.after(r):e.element.append(r),e.sortable.trigger(h,n))},_setCursor:function(){var t,n=this.options.cursor;n&&"auto"!==n&&(t=e(document.body),this._originalCursorType=t.css("cursor"),t.css({cursor:n}),this._cursorStylesheet||(this._cursorStylesheet=e("")),this._cursorStylesheet.appendTo(t))},_resetCursor:function(){this._originalCursorType&&(e(document.body).css("cursor",this._originalCursorType),this._originalCursorType=null,this._cursorStylesheet.remove())},_getElementCenter:function(e){var t=e.length?o.getOffset(e):null;return t&&(t.top+=e.outerHeight()/2,t.left+=e.outerWidth()/2),t},_isFloating:function(e){return/left|right/.test(e.css("float"))||/inline|table-cell/.test(e.css("display"))},_cancel:function(){this.draggedElement.show(),this.placeholder.remove()},_items:function(){var e,t=this.options.filter;return e=t?this.element.find(t):this.element.children()},indexOf:function(e){var t=this._items(),n=this.placeholder,r=this.draggedElement;return n&&e[0]==n[0]?t.not(r).index(e):t.not(n).index(e)},items:function(){var e=this.placeholder,t=this._items();return e&&(t=t.not(e)),t},_isEmpty:function(){return!this.items().length},_isLastHidden:function(){return 1===this.items().length&&this.items().is(":hidden")}});o.ui.plugin(v)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}); /*! kendo.grid.min.js */ /** * Kendo UI v2016.2.504 (http://www.telerik.com/kendo-ui) * Copyright 2016 Telerik AD. All rights reserved. * * Kendo UI commercial licenses may be obtained at * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete * If you do not own a commercial license, this file shall be governed by the trial license terms. */ !function(e,define){define("util/main.min",["kendo.core.min"],e)}(function(){return function(){function e(e){return typeof e!==E}function t(e,t){var n=r(t);return L.round(e*n)/n}function r(e){return e?L.pow(10,e):1}function n(e,t,r){return L.max(L.min(e,r),t)}function o(e){return e*q}function a(e){return e/q}function l(e){return"number"==typeof e&&!isNaN(e)}function i(t,r){return e(t)?t:r}function s(e){return e*e}function d(e){var t,r=[];for(t in e)r.push(t+e[t]);return r.sort().join("")}function c(e){var t,r=2166136261;for(t=0;e.length>t;++t)r+=(r<<1)+(r<<4)+(r<<7)+(r<<8)+(r<<24),r^=e.charCodeAt(t);return r>>>0}function u(e){return c(d(e))}function h(e){var t,r=e.length,n=M,o=W;for(t=0;r>t;t++)o=L.max(o,e[t]),n=L.min(n,e[t]);return{min:n,max:o}}function p(e){return h(e).min}function f(e){return h(e).max}function g(e){return k(e).min}function m(e){return k(e).max}function k(e){var t,r,n,o=M,a=W;for(t=0,r=e.length;r>t;t++)n=e[t],null!==n&&isFinite(n)&&(o=L.min(o,n),a=L.max(a,n));return{min:o===M?void 0:o,max:a===W?void 0:a}}function b(e){return e?e[e.length-1]:void 0}function _(e,t){return e.push.apply(e,t),e}function v(e){return D.template(e,{useWithBlock:!1,paramName:"d"})}function w(t,r){return e(r)&&null!==r?" "+t+"='"+r+"' ":""}function C(e){var t,r="";for(t=0;e.length>t;t++)r+=w(e[t][0],e[t][1]);return r}function y(t){var r,n,o="";for(r=0;t.length>r;r++)n=t[r][1],e(n)&&(o+=t[r][0]+":"+n+";");return""!==o?o:void 0}function T(e){return"string"!=typeof e&&(e+="px"),e}function x(e){var t,r,n=[];if(e)for(t=D.toHyphens(e).split("-"),r=0;t.length>r;r++)n.push("k-pos-"+t[r]);return n.join(" ")}function S(t){return""===t||null===t||"none"===t||"transparent"===t||!e(t)}function H(e){for(var t={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"},r=[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],n="";e>0;)r[0]>e?r.shift():(n+=t[r[0]],e-=r[0]);return n}function R(e){var t,r,n,o,a;for(e=e.toLowerCase(),t={i:1,v:5,x:10,l:50,c:100,d:500,m:1e3},r=0,n=0,o=0;e.length>o;++o){if(a=t[e.charAt(o)],!a)return null;r+=a,a>n&&(r-=2*n),n=a}return r}function z(e){var t=Object.create(null);return function(){var r,n="";for(r=arguments.length;--r>=0;)n+=":"+arguments[r];return n in t?t[n]:e.apply(this,arguments)}}function I(e){for(var t,r,n=[],o=0,a=e.length;a>o;)t=e.charCodeAt(o++),t>=55296&&56319>=t&&a>o?(r=e.charCodeAt(o++),56320==(64512&r)?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),o--)):n.push(t);return n}function A(e){return e.map(function(e){var t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),t+=String.fromCharCode(e)}).join("")}var L=Math,D=window.kendo,F=D.deepExtend,q=L.PI/180,M=Number.MAX_VALUE,W=-Number.MAX_VALUE,E="undefined",N=Date.now;N||(N=function(){return(new Date).getTime()}),F(D,{util:{MAX_NUM:M,MIN_NUM:W,append:_,arrayLimits:h,arrayMin:p,arrayMax:f,defined:e,deg:a,hashKey:c,hashObject:u,isNumber:l,isTransparent:S,last:b,limitValue:n,now:N,objectKey:d,round:t,rad:o,renderAttr:w,renderAllAttr:C,renderPos:x,renderSize:T,renderStyle:y,renderTemplate:v,sparseArrayLimits:k,sparseArrayMin:g,sparseArrayMax:m,sqr:s,valueOrDefault:i,romanToArabic:R,arabicToRoman:H,memoize:z,ucs2encode:A,ucs2decode:I}}),D.drawing.util=D.util,D.dataviz.util=D.util}(),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,r){(r||t)()}),function(e,define){define("util/text-metrics.min",["kendo.core.min","util/main.min"],e)}(function(){!function(e){function t(){return{width:0,height:0,baseline:0}}function r(e,t,r){return u.current.measure(e,t,r)}function n(e,t){var r=[];if(e.length>0&&document.fonts){try{r=e.map(function(e){return document.fonts.load(e)})}catch(n){a.logToConsole(n)}Promise.all(r).then(t,t)}else t()}var o=document,a=window.kendo,l=a.Class,i=a.util,s=i.defined,d=l.extend({init:function(e){this._size=e,this._length=0,this._map={}},put:function(e,t){var r=this,n=r._map,o={key:e,value:t};n[e]=o,r._head?(r._tail.newer=o,o.older=r._tail,r._tail=o):r._head=r._tail=o,r._length>=r._size?(n[r._head.key]=null,r._head=r._head.newer,r._head.older=null):r._length++},get:function(e){var t=this,r=t._map[e];return r?(r===t._head&&r!==t._tail&&(t._head=r.newer,t._head.older=null),r!==t._tail&&(r.older&&(r.older.newer=r.newer,r.newer.older=r.older),r.older=t._tail,r.newer=null,t._tail.newer=r,t._tail=r),r.value):void 0}}),c=e("
")[0],u=l.extend({init:function(e){this._cache=new d(1e3),this._initOptions(e)},options:{baselineMarkerSize:1},measure:function(r,n,a){var l,d,u,h,p,f,g,m;if(!r)return t();if(l=i.objectKey(n),d=i.hashKey(r+l),u=this._cache.get(d),u)return u;h=t(),p=a?a:c,f=this._baselineMarker().cloneNode(!1);for(g in n)m=n[g],s(m)&&(p.style[g]=m);return e(p).text(r),p.appendChild(f),o.body.appendChild(p),(r+"").length&&(h.width=p.offsetWidth-this.options.baselineMarkerSize,h.height=p.offsetHeight,h.baseline=f.offsetTop+this.options.baselineMarkerSize),h.width>0&&h.height>0&&this._cache.put(d,h),p.parentNode.removeChild(p),h},_baselineMarker:function(){return e("
")[0]}});u.current=new u,a.util.TextMetrics=u,a.util.LRUCache=d,a.util.loadFonts=n,a.util.measureText=r}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,r){(r||t)()}),function(e,define){define("util/base64.min",["util/main.min"],e)}(function(){return function(){function e(e){var r,n,o,l,i,s,d,c="",u=0;for(e=t(e);e.length>u;)r=e.charCodeAt(u++),n=e.charCodeAt(u++),o=e.charCodeAt(u++),l=r>>2,i=(3&r)<<4|n>>4,s=(15&n)<<2|o>>6,d=63&o,isNaN(n)?s=d=64:isNaN(o)&&(d=64),c=c+a.charAt(l)+a.charAt(i)+a.charAt(s)+a.charAt(d);return c}function t(e){var t,r,n="";for(t=0;e.length>t;t++)r=e.charCodeAt(t),128>r?n+=o(r):2048>r?(n+=o(192|r>>>6),n+=o(128|63&r)):65536>r&&(n+=o(224|r>>>12),n+=o(128|r>>>6&63),n+=o(128|63&r));return n}var r=window.kendo,n=r.deepExtend,o=String.fromCharCode,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n(r.util,{encodeBase64:e,encodeUTF8:t})}(),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,r){(r||t)()}),function(e,define){define("mixins/observers.min",["kendo.core.min"],e)}(function(){return function(e){var t=Math,r=window.kendo,n=r.deepExtend,o=e.inArray,a={observers:function(){return this._observers=this._observers||[]},addObserver:function(e){return this._observers?this._observers.push(e):this._observers=[e],this},removeObserver:function(e){var t=this.observers(),r=o(e,t);return-1!=r&&t.splice(r,1),this},trigger:function(e,t){var r,n,o=this._observers;if(o&&!this._suspended)for(n=0;o.length>n;n++)r=o[n],r[e]&&r[e](t);return this},optionsChange:function(e){e=e||{},e.element=this,this.trigger("optionsChange",e)},geometryChange:function(){this.trigger("geometryChange",{element:this})},suspend:function(){return this._suspended=(this._suspended||0)+1,this},resume:function(){return this._suspended=t.max((this._suspended||0)-1,0),this},_observerField:function(e,t){this[e]&&this[e].removeObserver(this),this[e]=t,t.addObserver(this)}};n(r,{mixins:{ObserversMixin:a}})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,r){(r||t)()}),function(e,define){define("kendo.grid.min",["kendo.data.min","kendo.columnsorter.min","kendo.editable.min","kendo.window.min","kendo.filtermenu.min","kendo.columnmenu.min","kendo.groupable.min","kendo.pager.min","kendo.selectable.min","kendo.sortable.min","kendo.reorderable.min","kendo.resizable.min","kendo.mobile.actionsheet.min","kendo.mobile.pane.min","kendo.ooxml.min","kendo.excel.min","kendo.progressbar.min","kendo.pdf.min"],e)}(function(){return function(e,t){function r(e){return Array(e+1).join(' ')}function n(e){var t,r=" ";if(e){if(typeof e===dt)return e;for(t in e)r+=t+'="'+e[t]+'"'}return r}function o(t,r){e("th, th .k-grid-filter, th .k-link",t).add(document.body).css("cursor",r)}function a(t,r,n,o,a){var l,i=r;for(r=e(),a=a||1,l=0;a>l;l++)r=r.add(t.eq(i+l));"number"==typeof n?r[o?"insertBefore":"insertAfter"](t.eq(n)):r.appendTo(n)}function l(t,r,n){return e(t).add(r).find(n)}function i(e,t,r){var n,o,a,l;for(r=Ce(r)?r:[r],n=0,o=r.length;o>n;n++)a=r[n],be(a)&&a.click&&(l=a.name||a.text,t.on(at+We,"a.k-grid-"+(l||"").replace(/\s/g,""),{commandName:l},xe(a.click,e)))}function s(e,t,r){return ve(e,function(e){var n,o;return e=typeof e===dt?{field:e}:e,(!p(e)||r)&&(e.attributes=j(e.attributes),e.footerAttributes=j(e.footerAttributes),e.headerAttributes=j(e.headerAttributes),n=!0),e.columns&&(e.columns=s(e.columns,t,n)),o=ue.guid(),e.headerAttributes=_e({id:o},e.headerAttributes),_e({encoded:t,hidden:n},e)})}function d(e,t){var r=[];return c(e,t,r),r[r.length-1]}function c(e,t,r){var n,o;for(r=r||[],n=0;t.length>n;n++){if(e===t[n])return!0;if(t[n].columns){if(o=r.length,r.push(t[n]),c(e,t[n].columns,r))return!0;r.splice(o,r.length-o)}}return!1}function u(e,t){var r=t?V:j;e.hidden=!t,e.attributes=r(e.attributes),e.footerAttributes=r(e.footerAttributes),e.headerAttributes=r(e.headerAttributes)}function h(){return"none"!==this.style.display}function p(e){return f([e]).length>0}function f(e){return we(e,function(e){var t=!e.hidden;return t&&e.columns&&(t=f(e.columns).length>0),t})}function g(t){return e(t).map(function(){return this.toArray()})}function m(e,t,r){var n=_(D(t)),o=_(F(t)),a=e.rowSpan;e.rowSpan=r?n>o?a-(n-o)||1:a+(o-n):n>o?a+(n-o):a-(o-n)||1}function k(t,r,n,o,a,l,i){var s,d,c=_(t),u=_([r]);c>u&&(s=Array(i+1).join(' '),d=l.children(":not(.k-filter-row)"),e(Array(c-u+1).join(""+s+"")).insertAfter(d.last())),I(l,c-u),v(n,o,a,l)}function b(t,r,n){var o,a,l,i,s,d,c,u;for(n=n||0,l=r,r=E(r),i={},s=t.find(">tr:not(.k-filter-row)"),d=function(){var t=e(this);return!t.hasClass("k-group-cell")&&!t.hasClass("k-hierarchy-cell")},c=0,u=r.length;u>c;c++)o=w(r[c],l),i[o.row]||(i[o.row]=s.eq(o.row).find(".k-header").filter(d)),a=i[o.row].eq(o.cell),a.attr(ue.attr("index"),n+c);return r.length}function _(e){var t,r,n=1,o=0;for(t=0;e.length>t;t++)e[t].columns&&(r=_(e[t].columns),r>o&&(o=r));return n+o}function v(t,r,n,o){var a,l,i=T(t[0],r),s=n.find(">tr:not(.k-filter-row):eq("+i.row+")>th.k-header"),d=e(),c=i.cell;for(a=0;t.length>a;a++)d=d.add(s.eq(c+a));for(o.find(">tr:not(.k-filter-row)").eq(i.row).append(d),l=[],a=0;t.length>a;a++)t[a].columns&&(l=l.concat(t[a].columns));l.length&&v(l,r,n,o)}function w(e,t,r,n){var o,a;for(r=r||0,n=n||{},n[r]=n[r]||0,a=0;t.length>a;a++){if(t[a]==e){o={cell:n[r],row:r};break}if(t[a].columns&&(o=w(e,t[a].columns,r+1,n)))break;n[r]++}return o}function C(e,t,r,n){var o,a=r.locked;do o=e[t],t+=n?1:-1;while(o&&t>-1&&e.length>t&&o!=r&&!o.columns&&o.locked==a);return o}function y(e,t,r,n){var o,a,l,i;return t.columns?(t=t.columns,t[n?0:t.length-1]):(o=d(t,e),a=o?o.columns:e,l=ye(t,a),0===l&&n?l++:l!=a.length-1||n?(l>0||0===l&&!n)&&(l+=n?-1:1):l--,i=ye(r,a),t=C(a,l,r,i>l),t&&t!=r&&t.columns?y(e,t,r,n):null)}function T(e,t,r,n){var o,a;for(r=r||0,n=n||{},n[r]=n[r]||0,a=0;t.length>a;a++){if(t[a]==e){o={cell:n[r],row:r};break}if(t[a].columns&&(o=T(e,t[a].columns,r+1,n)))break;t[a].hidden||n[r]++}return o}function x(e){var t=S(D(e));return t.concat(S(F(e)))}function S(e){var t,r=[],n=[];for(t=0;e.length>t;t++)r.push(e[t]),e[t].columns&&(n=n.concat(e[t].columns));return n.length&&(r=r.concat(S(n))),r}function H(e){var t,r,n=0;for(r=0;e.length>r;r++)t=e[r],t.columns?n+=H(t.columns):t.hidden&&n++;return n}function R(e){var t,r,n,o=0;for(r=0,n=e.length;n>r;r++)t=e[r].style.width,t&&-1==t.indexOf("%")&&(o+=parseInt(t,10));return o}function z(e,t){var r,n,o=e.find("tr:not(.k-filter-row) th:not(.k-group-cell,.k-hierarchy-cell)");for(n=0;o.length>n;n++)r=o[n].rowSpan,r>1&&(o[n].rowSpan=r-t||1)}function I(e,t){var r,n=e.find("tr:not(.k-filter-row) th:not(.k-group-cell,.k-hierarchy-cell)");for(r=0;n.length>r;r++)n[r].rowSpan+=t}function A(t){var r,n=t.find("tr:not(.k-filter-row)"),o=n.filter(function(){return!e(this).children().length}).remove().length,a=n.find("th:not(.k-group-cell,.k-hierarchy-cell)");for(r=0;a.length>r;r++)a[r].rowSpan>1&&(a[r].rowSpan-=o);return n.length-o}function L(e,t,r,n,o){var a,l,i,s=[];for(a=0,i=e.length;i>a;a++)l=r[n]||[],l.push(t.eq(o+a)),r[n]=l,e[a].columns&&(s=s.concat(e[a].columns));s.length&&L(s,t,r,n+1,o+e.length)}function D(e){return we(e,function(e){return e.locked})}function F(e){return we(e,function(e){return!e.locked})}function q(e){return we(e,function(e){return!e.locked&&p(e)})}function M(e){return we(e,function(e){return e.locked&&p(e)})}function W(e){var t,r=[];for(t=0;e.length>t;t++)e[t].hidden||(e[t].columns?r=r.concat(W(e[t].columns)):r.push(e[t]));return r}function E(e){var t,r=[];for(t=0;e.length>t;t++)e[t].columns?r=r.concat(E(e[t].columns)):r.push(e[t]);return r}function N(r){var n,o=r.find(">tr:not(.k-filter-row)"),a=function(){var t=e(this);return!t.hasClass("k-group-cell")&&!t.hasClass("k-hierarchy-cell")},l=e();return o.length>1&&(l=o.find("th").filter(a).filter(function(){return this.rowSpan>1})),l=l.add(o.last().find("th").filter(a)),n=ue.attr("index"),l.sort(function(r,o){var a,l;return r=e(r),o=e(o),a=r.attr(n),l=o.attr(n),a===t&&(a=e(r).index()),l===t&&(l=e(o).index()),a=parseInt(a,10),l=parseInt(l,10),a>l?1:l>a?-1:0}),l}function P(t){var r,n,o,a,l,i,s,d=t.closest("table"),c=e().add(t),u=t.closest("tr"),h=d.find("tr:not(.k-filter-row)"),p=h.index(u);if(p>0){for(r=h.eq(p-1),n=r.find("th:not(.k-group-cell,.k-hierarchy-cell)").filter(function(){return!e(this).attr("rowspan")}),o=0,a=u.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}),i=0;l.length>i;i++)o+=l[i].colSpan||1;for(a+=Math.max(o-1,0),o=0,i=0;n.length>i;i++)if(s=n.eq(i),o+=s.attr("colSpan")?s[0].colSpan:1,a>=i&&o>a){c=P(s).add(c);break}}return c}function B(t){var r,n,o,a,l,i,s,d=t.closest("thead"),c=e().add(t),u=t.closest("tr"),h=d.find("tr:not(.k-filter-row)"),p=h.index(u)+t[0].rowSpan,f=ue.attr("colspan");if(h.length-1>=p){for(r=u.next(),n=t.prevAll(":not(.k-group-cell,.k-hierarchy-cell)"),n=n.filter(function(){return!this.rowSpan||1===this.rowSpan}),a=0,o=0;n.length>o;o++)a+=parseInt(n.eq(o).attr(f),10)||1;for(l=r.find("th:not(.k-group-cell,.k-hierarchy-cell)"),i=parseInt(t.attr(f),10)||1,o=0;i>o;)r=l.eq(o+a),c=c.add(B(r)),s=parseInt(r.attr(f),10),s>1&&(i-=s-1),o++}return c}function O(t,r,n,o){var a,l=t;return o&&t.empty(),fe?t[0].innerHTML=n:(a=document.createElement("div"),a.innerHTML=""+n+"
",t=a.firstChild.firstChild,r[0].replaceChild(t,l[0]),t=e(t)),t}function j(e){e=e||{};var t=e.style;return t?(t=t.replace(/((.*)?display)(.*)?:([^;]*)/i,"$1:none"),t===e.style&&(t=t.replace(/(.*)?/i,"display:none;$1"))):t="display:none",_e({},e,{style:t})}function V(e){e=e||{};var t=e.style;return t&&(e.style=t.replace(/(display\s*:\s*none\s*;?)*/gi,"")),e}function U(t,r,n,o){var a,l=t.find(">colgroup"),i=ve(r,function(e){return a=e.width,a&&0!==parseInt(a,10)?ue.format('',typeof a===dt?a:a+"px"):""});(n||l.find(".k-hierarchy-col").length)&&i.splice(0,0,''),l.length&&l.remove(),l=e(Array(o+1).join('')+i.join("")),l.is("colgroup")||(l=e("").append(l)),t.prepend(l),wt.msie&&8==wt.version&&(t.css("display","inline-table"),window.setTimeout(function(){t.css("display","")},1))}function G(e,t){var r,n,o=0,a=e.find("th:not(.k-group-cell)");for(r=0,n=t.length;n>r;r++)t[r].locked&&(a.eq(r).insertBefore(a.eq(o)),a=e.find("th:not(.k-group-cell)"),o++)}function K(e){var t,r,n,o={};for(r=0,n=e.length;n>r;r++)t=e[r],o[t.value]=t.text;return o}function $(e,t,r,n){var o=r&&r.length&&be(r[0])&&"value"in r[0],a=o?K(r)[e]:e;return a=null!=a?a:"",t?ue.format(t,a):n===!1?a:ue.htmlEncode(a)}function Q(e,t,r){for(var n,o=0,a=e[o];a;){if(n=r?!0:"none"!==a.style.display,n&&!kt.test(a.className)&&--t<0){a.style.display=r?"":"none";break}a=e[++o]}}function X(t,r){for(var n,o,a=0,l=t.length;l>a;a+=1)o=t.eq(a),o.is(".k-grouping-row,.k-detail-row")?(n=o.children(":not(.k-group-cell):first,.k-detail-cell").last(),n.attr("colspan",parseInt(n.attr("colspan"),10)-1)):(o.hasClass("k-grid-edit-row")&&(n=o.children(".k-edit-container")[0])&&(n=e(n),n.attr("colspan",parseInt(n.attr("colspan"),10)-1),n.find("col").eq(r).remove(),o=n.find("tr:first")),Q(o[0].cells,r,!1))}function J(e){var t,r,n=[];for(r=0;e.length>r&&(t=e[r],"field"in t&&"value"in t&&"items"in t);r++)n.push(t),t.hasSubgroups&&(n=n.concat(J(t.items)));return n}function Y(e){var t,r,n=[];for(r=0;e.length>r&&(t=e[r],"field"in t&&"value"in t&&"items"in t);r++)t.hasSubgroups&&(n=n.concat(Y(t.items))),n.push(t.aggregates);return n}function Z(t,r){for(var n,o,a,l=0,i=t.length;i>l;l+=1)o=t.eq(l),o.is(".k-grouping-row,.k-detail-row")?(n=o.children(":not(.k-group-cell):first,.k-detail-cell").last(),n.attr("colspan",parseInt(n.attr("colspan"),10)+1)):(o.hasClass("k-grid-edit-row")&&(n=o.children(".k-edit-container")[0])&&(n=e(n),n.attr("colspan",parseInt(n.attr("colspan"),10)+1),U(n.find(">form>table"),f(a),!1,0),o=n.find("tr:first")),Q(o[0].cells,r,!0))}function ee(e,t,r){r=r||1;var n,o,a;for(o=0,a=e.length;a>o;o++)n=e.eq(o).children().last(),n.attr("colspan",parseInt(n.attr("colspan"),10)+r),n=t.eq(o).children().last(),n.attr("colspan",parseInt(n.attr("colspan"),10)-r)}function te(e){var t,r,n=0,o=e.find(">colgroup>col");for(t=0,r=o.length;r>t;t+=1)n+=parseInt(o[t].style.width,10);return n}function re(e,t){var r,n,o,a;e=e[0],t=t[0],e.rows.length!==t.rows.length&&(r=e.offsetHeight,n=t.offsetHeight,r>n?(o=t.rows[t.rows.length-1],bt.test(o.className)&&(o=t.rows[t.rows.length-2]),a=r-n):(o=e.rows[e.rows.length-1],bt.test(o.className)&&(o=e.rows[e.rows.length-2]),a=n-r),o.style.height=o.offsetHeight+a+"px")}function ne(e,t){var r,n=e.offsetHeight,o=t.offsetHeight;n>o?r=n+"px":o>n&&(r=o+"px"),r&&(e.style.height=t.style.height=r)}function oe(e,t){var r,n,o;if(typeof e===dt&&e===t)return e;if(be(e)&&e.name===t)return e;if(Ce(e))for(r=0,n=e.length;n>r;r++)if(o=e[r],typeof o===dt&&o===t||o.name===t)return o;return null}function ae(t,r){var n,o,a=wt.msie||wt.edge;if(r===!0){if(t=e(t),n=t.parent().scrollTop(),o=t.parent().scrollLeft(),a)try{t[0].setActive()}catch(l){t[0].focus()}else t[0].focus();t.parent().scrollTop(n).scrollLeft(o)}else e(t).one("focusin",function(e){e.preventDefault()}).focus()}function le(t){return e(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 ie(r){var n=e(r.currentTarget),o=n.is("th"),a=this.table.add(this.lockedTable),l=this.thead.parent().add(e(">table",this.lockedHeader)),i=le(r.target),s=n.closest("table")[0];if(!ue.support.touch)return i&&n.find(ue.roleSelector("filtercell")).length?(this._setCurrent(n),t):((s===a[0]||s===a[1]||s===l[0]||s===l[1])&&(e(r.target).is("a.k-i-collapse, a.k-i-expand")||(this.options.navigatable&&this._setCurrent(n),(o||!i)&&setTimeout(function(){yt&&e(ue._activeElement()).hasClass("k-widget")||le(ue._activeElement())||ae(s,!0)}),o&&r.preventDefault())),t)}function se(e){return e&&(e.hasClass("k-edit-cell")||e.parent().hasClass("k-grid-edit-row"))}function de(e,t,n){return''+r(t)+'

'+n+"

"}function ce(e){return'

 

'}var ue=window.kendo,he=ue.ui,pe=ue.data.DataSource,fe=ue.support.tbodyInnerHtml,ge=ue._activeElement,me=he.Widget,ke=ue.keys,be=e.isPlainObject,_e=e.extend,ve=e.map,we=e.grep,Ce=e.isArray,ye=e.inArray,Te=Array.prototype.push,xe=e.proxy,Se=ue.isFunction,He=e.isEmptyObject,Re=Math,ze="progress",Ie="error",Ae=":not(.k-group-cell):not(.k-hierarchy-cell):visible",Le="tbody>tr:not(.k-grouping-row):not(.k-detail-row):not(.k-group-footer) > td:not(.k-group-cell):not(.k-hierarchy-cell)",De="tr:not(.k-footer-template):visible",Fe=":not(.k-group-cell):not(.k-hierarchy-cell):visible",qe=De+":first>"+Fe+":first",Me="th.k-header:not(.k-group-cell):not(.k-hierarchy-cell)",We=".kendoGrid",Ee="edit",Ne="save",Pe="remove",Be="detailInit",Oe="filterMenuInit",je="columnMenuInit",Ve="change",Ue="columnHide",Ge="columnShow",Ke="saveChanges",$e="dataBound",Qe="detailExpand",Xe="detailCollapse",Je="k-state-focused",Ye="k-state-selected",Ze="k-grid-norecords",et="columnResize",tt="columnReorder",rt="columnLock",nt="columnUnlock",ot="navigate",at="click",lt="height",it="tabIndex",st="function",dt="string",ct="Are you sure you want to delete this record?",ut="No records available.",ht="Delete",pt="Cancel",ft=/(\}|\#)/gi,gt=/#/gi,mt="[\\x20\\t\\r\\n\\f]",kt=RegExp("(^|"+mt+")(k-group-cell|k-hierarchy-cell)("+mt+"|$)"),bt=RegExp("(^|"+mt+")(k-filter-row)("+mt+"|$)"),_t='#=text#',vt=!1,wt=ue.support.browser,Ct=wt.msie&&7==wt.version,yt=wt.msie&&8==wt.version,Tt=me.extend({init:function(e,t){var r=this;me.fn.init.call(r,e,t),r._refreshHandler=xe(r.refresh,r),r.setDataSource(t.dataSource),r.wrap()},setDataSource:function(e){var t=this;t.dataSource&&t.dataSource.unbind(Ve,t._refreshHandler),t.dataSource=e,t.dataSource.bind(Ve,t._refreshHandler)},options:{name:"VirtualScrollable",itemHeight:e.noop,prefetch:!0},destroy:function(){var e=this;me.fn.destroy.call(e),e.dataSource.unbind(Ve,e._refreshHandler),e.wrapper.add(e.verticalScrollbar).off(We),e.drag&&(e.drag.destroy(),e.drag=null),e.wrapper=e.element=e.verticalScrollbar=null,e._refreshHandler=null},wrap:function(){var t,r=this,n=ue.support.scrollbar()+1,o=r.element;o.css({width:"auto",overflow:"hidden"}).css(vt?"padding-left":"padding-right",n),r.content=o.children().first(),t=r.wrapper=r.content.wrap('
').parent().bind("DOMMouseScroll"+We+" mousewheel"+We,xe(r._wheelScroll,r)),ue.support.kineticScrollNeeded&&(r.drag=new ue.UserEvents(r.wrapper,{global:!0,start:function(e){e.sender.capture()},move:function(e){r.verticalScrollbar.scrollTop(r.verticalScrollbar.scrollTop()-e.y.delta),t.scrollLeft(t.scrollLeft()-e.x.delta),e.preventDefault()}})),r.verticalScrollbar=e('
').css({width:n}).appendTo(o).bind("scroll"+We,xe(r._scroll,r))},_wheelScroll:function(t){if(!t.ctrlKey){var r=this.verticalScrollbar,n=r.scrollTop(),o=ue.wheelDeltaY(t);!o||o>0&&0===n||0>o&&n+r[0].clientHeight==r[0].scrollHeight||(t.preventDefault(),e(t.currentTarget).one("wheel"+We,!1),this.verticalScrollbar.scrollTop(n+-o))}},_scroll:function(e){var t=this,r=!t.options.prefetch,n=e.currentTarget.scrollTop,o=t.dataSource,a=t.itemHeight,l=o.skip()||0,i=t._rangeStart||l,s=t.element.innerHeight(),d=!!(t._scrollbarTop&&t._scrollbarTop>n),c=Re.max(Re.floor(n/a),0),u=Re.max(c+Re.floor(s/a),0);t._scrollTop=n-i*a,t._scrollbarTop=n,t._scrolling=r,t._fetch(c,u,d)||(t.wrapper[0].scrollTop=t._scrollTop),r&&(t._scrollingTimeout&&clearTimeout(t._scrollingTimeout),t._scrollingTimeout=setTimeout(function(){t._scrolling=!1,t._page(t._rangeStart,t.dataSource.take())},100))},itemIndex:function(e){var t=this._rangeStart||this.dataSource.skip()||0;return t+e},position:function(e){var t,r=this._rangeStart||this.dataSource.skip()||0,n=this.dataSource.pageSize();return t=e>r?e-r+1:r-e-1,t>n?n:t},scrollIntoView:function(e){var t=this.wrapper[0],r=t.clientHeight,n=this._scrollTop||t.scrollTop,o=e[0].offsetTop,a=e[0].offsetHeight;n>o?this.verticalScrollbar[0].scrollTop-=r/2:o+a>=n+r&&(this.verticalScrollbar[0].scrollTop+=r/2)},_fetch:function(t,r,n){var o=this,a=o.dataSource,l=o.itemHeight,i=a.take(),s=o._rangeStart||a.skip()||0,d=Re.floor(t/i)*i,c=!1,u=.33;return s>t?(c=!0,s=Re.max(0,r-i),o._scrollTop=(t-s)*l,o._page(s,i)):r>=s+i&&!n?(c=!0,s=t,o._scrollTop=l,o._page(s,i)):!o._fetching&&o.options.prefetch&&(d+i-i*u>t&&t>i&&a.prefetch(d-i,i,e.noop),r>d+i*u&&a.prefetch(d+i,i,e.noop)),c},fetching:function(){return this._fetching},_page:function(e,t){var r=this,n=!r.options.prefetch,o=r.dataSource;clearTimeout(r._timeout),r._fetching=!0,r._rangeStart=e,o.inRange(e,t)?o.range(e,t):(n||ue.ui.progress(r.wrapper.parent(),!0),r._timeout=setTimeout(function(){r._scrolling||(n&&ue.ui.progress(r.wrapper.parent(),!0),o.range(e,t))},100))},repaintScrollbar:function(){var e,t=this,r="",n=25e4,o=t.dataSource,a=ue.support.kineticScrollNeeded?0:ue.support.scrollbar(),l=t.wrapper[0],i=t.itemHeight=t.options.itemHeight()||0,s=l.scrollWidth>l.offsetWidth?a:0,d=o.total()*i+s;for(e=0;e
';d%n&&(r+='
'),t.verticalScrollbar.html(r),l.scrollTop=t._scrollTop},refresh:function(){var e=this,t=e.dataSource,r=e._rangeStart;ue.ui.progress(e.wrapper.parent(),!1),clearTimeout(e._timeout),e.repaintScrollbar(),e.drag&&e.drag.cancel(),r&&!e._fetching&&(e._rangeStart=t.skip(),1===t.page()&&(e.verticalScrollbar[0].scrollTop=0)),e._fetching=!1}}),xt={create:{text:"Add new record",imageClass:"k-add",className:"k-grid-add",iconClass:"k-icon"},cancel:{text:"Cancel changes",imageClass:"k-cancel",className:"k-grid-cancel-changes",iconClass:"k-icon"},save:{text:"Save changes",imageClass:"k-update",className:"k-grid-save-changes",iconClass:"k-icon"},destroy:{text:"Delete",imageClass:"k-delete",className:"k-grid-delete",iconClass:"k-icon"},edit:{text:"Edit",imageClass:"k-edit",className:"k-grid-edit",iconClass:"k-icon"},update:{text:"Update",imageClass:"k-update",className:"k-primary k-grid-update",iconClass:"k-icon"},canceledit:{text:"Cancel",imageClass:"k-cancel",className:"k-grid-cancel",iconClass:"k-icon"},excel:{text:"Export to Excel",imageClass:"k-i-excel",className:"k-grid-excel",iconClass:"k-icon"},pdf:{text:"Export to PDF",imageClass:"k-i-pdf",className:"k-grid-pdf",iconClass:"k-icon"}},St=ue.ui.DataBoundWidget.extend({init:function(t,r,n){var o=this;r=Ce(r)?{dataSource:r}:r,me.fn.init.call(o,t,r),n&&(o._events=n),vt=ue.support.isRtl(t),o._element(),o._aria(),o._columns(o.options.columns),o._dataSource(),o._tbody(),o._pageable(),o._thead(),o._groupable(),o._toolbar(),o._setContentHeight(),o._templates(),o._navigatable(),o._selectable(),o._clipboard(),o._details(),o._editable(),o._attachCustomCommandsEvent(),o._minScreenSupport(),o.options.autoBind?o.dataSource.fetch():(o._group=o._groups()>0,o._footer()),o.lockedContent&&(o.wrapper.addClass("k-grid-lockedcolumns"),o._resizeHandler=function(){o.resize()},e(window).on("resize"+We,o._resizeHandler)),ue.notify(o)},events:[Ve,"dataBinding","cancel",$e,Qe,Xe,Be,Oe,je,Ee,Ne,Pe,Ke,et,tt,Ge,Ue,rt,nt,ot],setDataSource:function(e){var t=this,r=t.options.scrollable;t.options.dataSource=e,t._dataSource(),t._pageable(),t._thead(),r&&(r.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&&e.fetch()},options:{name:"Grid",columns:[],toolbar:null,autoBind:!0,filterable:!1,scrollable:!0,sortable:!1,selectable:!1,allowCopy:!1,navigatable:!1,pageable:!1,editable:!1,groupable:!1,rowTemplate:"",altRowTemplate:"",noRecords:!1,dataSource:{},height:null,resizable:!1,reorderable:!1,columnMenu:!1,detailTemplate:null,columnResizeHandleWidth:3,mobile:"",messages:{editable:{cancelDelete:pt,confirmation:ct,confirmDelete:ht},commands:{create:xt.create.text,cancel:xt.cancel.text,save:xt.save.text,destroy:xt.destroy.text,edit:xt.edit.text,update:xt.update.text,canceledit:xt.canceledit.text,excel:xt.excel.text,pdf:xt.pdf.text},noRecords:ut}},destroy:function(){var t,r=this;r._angularItems("cleanup"),r._destroyColumnAttachments(),me.fn.destroy.call(r),this._navigatableTables=null,r._resizeHandler&&e(window).off("resize"+We,r._resizeHandler),r.pager&&r.pager.element&&r.pager.destroy(),r.pager=null,r.groupable&&r.groupable.element&&r.groupable.element.kendoGroupable("destroy"),r.groupable=null,r.options.reorderable&&r.wrapper.data("kendoReorderable").destroy(),r.selectable&&r.selectable.element&&(r.selectable.destroy(),r.clearArea(),r.copyHandler&&(r.wrapper.off("keydown",r.copyHandler),r.unbind(r.copyHandler)),r.updateClipBoardState&&(r.unbind(r.updateClipBoardState),r.updateClipBoardState=null),r.clearAreaHandler&&r.wrapper.off("keyup",r.clearAreaHandler)),r.selectable=null,r.resizable&&(r.resizable.destroy(),r._resizeUserEvents&&(r._resizeHandleDocumentClickHandler&&e(document).off("click",r._resizeHandleDocumentClickHandler),r._resizeUserEvents.destroy(),r._resizeUserEvents=null),r.resizable=null),r.virtualScrollable&&r.virtualScrollable.element&&r.virtualScrollable.destroy(),r.virtualScrollable=null,r._destroyEditable(),r.dataSource&&(r.dataSource.unbind(Ve,r._refreshHandler).unbind(ze,r._progressHandler).unbind(Ie,r._errorHandler),r._refreshHandler=r._progressHandler=r._errorHandler=null),t=r.element.add(r.wrapper).add(r.table).add(r.thead).add(r.wrapper.find(">.k-grid-toolbar")),r.content&&(t=t.add(r.content).add(r.content.find(">.k-virtual-scrollable-wrap"))),r.lockedHeader&&r._removeLockedContainers(),r.pane&&r.pane.destroy(),r.minScreenResizeHandler&&e(window).off("resize",r.minScreenResizeHandler),r._draggableInstance&&r._draggableInstance.element&&r._draggableInstance.destroy(),r._draggableInstance=null,t.off(We),ue.destroy(r.wrapper),r.rowTemplate=r.altRowTemplate=r.lockedRowTemplate=r.lockedAltRowTemplate=r.detailTemplate=r.footerTemplate=r.groupFooterTemplate=r.lockedGroupFooterTemplate=r.noRecordsTemplate=null,r.scrollables=r.thead=r.tbody=r.element=r.table=r.content=r.footer=r.wrapper=r.lockedTable=r.lockedContent=r.lockedHeader=r.lockedFooter=r._groupableClickHandler=r._setContentWidthHandler=null},getOptions:function(){var r,n,o,a=this.options;return a.dataSource=null,r=_e(!0,{},this.options),r.columns=ue.deepExtend([],this.columns),n=this.dataSource,o=n.options.data&&n._data,n.options.data=null,r.dataSource=e.extend(!0,{},n.options),n.options.data=o,r.dataSource.data=o,r.dataSource.page=n.page(),r.dataSource.filter=n.filter(),r.dataSource.pageSize=n.pageSize(),r.dataSource.sort=n.sort(),r.dataSource.group=n.group(),r.dataSource.aggregate=n.aggregate(),r.dataSource.transport&&(r.dataSource.transport.dataSource=null),r.pageable&&r.pageable.pageSize&&(r.pageable.pageSize=n.pageSize()),r.$angular=t,r},setOptions:function(e){var t,r,n,o,a=this.getOptions();ue.deepExtend(a,e),e.dataSource||(a.dataSource=this.dataSource),t=this.wrapper,r=this._events,n=this.element,this.destroy(),this.options=null,this._isMobile&&(o=t.closest(ue.roleSelector("pane")).parent(),o.after(t),o.remove(),t.removeClass("k-grid-mobile")),t[0]!==n[0]&&(t.before(n),t.remove()),n.empty(),this.init(n,a,r),this._setEvents(a)},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=e(this);return!t.hasClass("k-grouping-row")&&!t.hasClass("k-detail-row")&&!t.hasClass("k-group-footer")})},dataItems:function(){var e,t,r,n=ue.ui.DataBoundWidget.fn.dataItems.call(this);if(this.lockedContent){for(e=n.length,t=Array(2*e),r=e;--r>=0;)t[r]=t[r+e]=n[r];n=t}return n},_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=e(this),r=t.data("kendoFilterMenu"),n=t.data("kendoColumnSorter"),o=t.data("kendoColumnMenu");r&&r.destroy(),n&&n.destroy(),o&&o.destroy()}))},_attachCustomCommandsEvent:function(){var e,t,r,n=this,o=E(n.columns||[]);for(t=0,r=o.length;r>t;t++)e=o[t].command,e&&i(n,n.wrapper,e)},_aria:function(){var e=this.element.attr("id")||"aria";e&&(this._cellId=e+"_active_cell")},_element:function(){var t=this,r=t.element;r.is("table")||(r=t.options.scrollable?t.element.find("> .k-grid-content > table"):t.element.children("table"),r.length||(r=e("").appendTo(t.element))),Ct&&r.attr("cellspacing",0),t.table=r.attr("role",t._hasDetails()?"treegrid":"grid"),t._wrapper()},_createResizeHandle:function(t,r){var n,o,a,l,i,s,d,c=this,u=c.options.columnResizeHandleWidth,h=c.options.scrollable,p=c.resizeHandle,f=this._groups();if(p&&c.lockedContent&&p.data("th")[0]!==r[0]&&(p.off(We).remove(),p=null),p||(p=c.resizeHandle=e('
'),t.append(p)),vt)n=r.position().left,h&&(l=r.closest(".k-grid-header-wrap, .k-grid-header-locked"),i=wt.msie?l.scrollLeft():0,s=wt.webkit?l[0].scrollWidth-l[0].offsetWidth-l.scrollLeft():0,d=wt.mozilla?l[0].scrollWidth-l[0].offsetWidth-(l[0].scrollWidth-l[0].offsetWidth-l.scrollLeft()):0,n-=s-d+i);else{for(n=r[0].offsetWidth,o=N(r.closest("thead")).filter(":visible"),a=0;o.length>a&&o[a]!=r[0];a++)n+=o[a].offsetWidth;f>0&&(n+=t.find(".k-group-cell:first").outerWidth()*f),c._hasDetails()&&(n+=t.find(".k-hierarchy-cell:first").outerWidth())}p.css({top:r.position().top,left:n-u,height:r.outerHeight(),width:3*u}).data("th",r).show(),p.off("dblclick"+We).on("dblclick"+We,function(){c._autoFitLeafColumn(r.data("index"))})},_positionColumnResizeHandle:function(){var t=this,r=t.options.columnResizeHandleWidth,n=t.lockedHeader?t.lockedHeader.find("thead:first"):e();t.thead.add(n).on("mousemove"+We,"th",function(n){var a,l,i,s=e(this);s.hasClass("k-group-cell")||s.hasClass("k-hierarchy-cell")||(a=n.clientX/parseFloat(document.documentElement.style.zoom||document.body.style.zoom||1),l=e(window).scrollLeft(),i=s.offset().left+(vt?0:this.offsetWidth),a+l>i-r&&i+r>a+l?t._createResizeHandle(s.closest("div"),s):t.resizeHandle?t.resizeHandle.hide():o(t.wrapper,""))})},_resizeHandleDocumentClick:function(t){e(t.target).closest(".k-column-active").length||(e(document).off(t),this._hideResizeHandle())},_hideResizeHandle:function(){this.resizeHandle&&(this.resizeHandle.data("th").removeClass("k-column-active"),this.lockedContent&&!this._isMobile?(this.resizeHandle.off(We).remove(),this.resizeHandle=null):this.resizeHandle.hide())},_positionColumnResizeHandleTouch:function(){var t=this,r=t.lockedHeader?t.lockedHeader.find("thead:first"):e();t._resizeUserEvents=new ue.UserEvents(r.add(t.thead),{filter:"th:not(.k-group-cell):not(.k-hierarchy-cell)",threshold:10,hold:function(r){var n=e(r.target);r.preventDefault(),n.addClass("k-column-active"),t._createResizeHandle(n.closest("div"),n),t._resizeHandleDocumentClickHandler||(t._resizeHandleDocumentClickHandler=xe(t._resizeHandleDocumentClick,t)),e(document).on("click",t._resizeHandleDocumentClickHandler)}})},_resizable:function(){var t,r,n,a,l,i,s,d=this,c=d.options,u=this._isMobile,h=ue.support.mobileOS?0:ue.support.scrollbar();c.resizable&&(t=c.scrollable?d.wrapper.find(".k-grid-header-wrap:first"):d.wrapper,u?d._positionColumnResizeHandleTouch(t):d._positionColumnResizeHandle(t),d.resizable&&d.resizable.destroy(),d.resizable=new he.Resizable(t.add(d.lockedHeader),{handle:(c.scrollable?"":">")+".k-resize-handle",hint:function(t){return e('
').css({height:t.data("th").outerHeight()+d.tbody.attr("clientHeight")})},start:function(t){var h,p,f,g;s=e(t.currentTarget).data("th"),u&&d._hideResizeHandle(),h=s.closest("table"),p=e.inArray(s[0],N(s.closest("thead")).filter(":visible")),l=h.parent().hasClass("k-grid-header-locked"),f=l?d.lockedTable:d.table,g=d.footer||e(),d.footer&&d.lockedContent&&(g=d.footer.children(l?".k-grid-footer-locked":".k-grid-footer-wrap")),o(d.wrapper,"col-resize"),i=c.scrollable?h.find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+p+")").add(f.children("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+p+")")).add(g.find("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+p+")")):f.children("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+p+")"),r=t.x.location,n=s.outerWidth(),a=l?f.children("tbody").outerWidth():d.tbody.outerWidth(),wt.webkit&&d.wrapper.addClass("k-grid-column-resizing")},resize:function(t){var o,u,p,f,g,m,k=vt?-1:1,b=n+t.x.location*k-r*k;c.scrollable?(l&&d.lockedFooter?o=d.lockedFooter.children("table"):d.footer&&(o=d.footer.find(">.k-grid-footer-wrap>table")),o&&o[0]||(o=e()),u=s.closest("table"),p=l?d.lockedTable:d.table,f=!1,g=d.wrapper.width()-h,m=b,l&&a-n+m>g&&(m=n+(g-a-2*h),0>m&&(m=b),f=!0),m>10&&(i.css("width",m),a&&(m=f?g-2*h:a+t.x.location*k-r*k,p.add(u).add(o).css("width",m),l||(d._footerWidth=m)))):b>10&&i.css("width",b)},resizeend:function(){var e,t,r,a=s.outerWidth();o(d.wrapper,""),wt.webkit&&d.wrapper.removeClass("k-grid-column-resizing"),n!=a&&(t=d.lockedHeader?d.lockedHeader.find("thead:first tr:first").add(d.thead.find("tr:first")):s.parent(),r=s.attr(ue.attr("index")),r||(r=t.find("th:not(.k-group-cell):not(.k-hierarchy-cell)").index(s)),e=E(d.columns)[r],e.width=a,d.trigger(et,{column:e,oldWidth:n,newWidth:a}),d._applyLockedContainersWidth(),d._syncLockedContentHeight(),d._syncLockedHeaderHeight()),d._hideResizeHandle(),s=null}}))},_draggable:function(){var t=this;t.options.reorderable&&(t._draggableInstance&&t._draggableInstance.destroy(),t._draggableInstance=t.wrapper.kendoDraggable({group:ue.guid(),autoScroll:!0,filter:t.content?".k-grid-header:first "+Me:"table:first>.k-grid-header "+Me,drag:function(){t._hideResizeHandle()},hint:function(t){var r=t.attr(ue.attr("title"));return r&&(r=ue.htmlEncode(r)),e('
').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(ue.attr("field"))||t.text()).prepend('')}}).data("kendoDraggable"))},_reorderable:function(){var t,r=this;r.options.reorderable&&(r.wrapper.data("kendoReorderable")&&r.wrapper.data("kendoReorderable").destroy(),t=function(e,t,n){var o=e[t],a=e[n],l=d(o,r.columns);return e=l?l.columns:r.columns,ye(a,e)},r.wrapper.kendoReorderable({draggable:r._draggableInstance,dragOverContainers:function(e,n){var o=x(r.columns);return o[e].lockable!==!1&&t(o,e,n)>-1},inSameContainer:function(n){return e(n.source).parent()[0]===e(n.target).parent()[0]&&t(x(r.columns),n.sourceIndex,n.targetIndex)>-1},change:function(e){var n=x(r.columns),o=n[e.oldIndex],a=t(n,e.oldIndex,e.newIndex);r.trigger(tt,{newIndex:a,oldIndex:ye(o,n),column:o}),r.reorderColumn(a,o,"before"===e.position)}}))},_reorderHeader:function(e,t,r){var n,o,i,s,d=this,c=w(e[0],d.columns),u=w(t,d.columns),h=[];for(n=0;e.length>n;n++)e[n].columns&&(h=h.concat(e[n].columns));o=l(d.lockedHeader,d.thead,"tr:eq("+c.row+")>th.k-header:not(.k-group-cell,.k-hierarchy-cell)"),i=D(e).length,s=D([t]).length,h.length?(i>0&&0===s?k(e,t,h,d.columns,d.lockedHeader.find("thead"),d.thead,this._groups()):0===i&&s>0&&k(e,t,h,d.columns,d.thead,d.lockedHeader.find("thead"),this._groups()),(t.columns||c.cell-u.cell>1||u.cell-c.cell>1)&&(t=y(d.columns,t,e[0],r),t&&d._reorderHeader(h,t,r))):i!==s&&m(o[c.cell],d.columns,i),a(o,c.cell,u.cell,r,e.length)},_reorderContent:function(t,r,n){var o,i,s,d,c=this,u=e(),h=t[0],p=f(t),g=ye(h,E(c.columns)),m=ye(r,E(c.columns)),k=ye(h,W(c.columns)),b=ye(r,W(c.columns)),_=D(c.columns).length,v=!!r.locked,w=c.footer||c.wrapper.find(".k-grid-footer"),C=o=b;for(r.hidden&&(v?(b=c.lockedTable.find("colgroup"),C=c.lockedHeader.find("colgroup"),o=e(c.lockedFooter).find(">table>colgroup")):(b=c.tbody.prev(),C=c.thead.prev(),o=w.find(".k-grid-footer-wrap").find(">table>colgroup"))),c._hasFilterRow()&&a(c.wrapper.find(".k-filter-row th:not(.k-group-cell,.k-hierarchy-cell)"),g,m,n,t.length),a(l(c.lockedHeader,c.thead.prev(),"col:not(.k-group-col,.k-hierarchy-col)"),k,C,n,p.length),c.options.scrollable&&a(l(c.lockedTable,c.tbody.prev(),"col:not(.k-group-col,.k-hierarchy-col)"),k,b,n,p.length),w&&w.length&&(a(l(c.lockedFooter,w.find(".k-grid-footer-wrap"),">table>colgroup>col:not(.k-group-col,.k-hierarchy-col)"),k,o,n,p.length),a(w.find(".k-footer-template>td:not(.k-group-cell,.k-hierarchy-cell)"),g,m,n,t.length)),i=c.tbody.children(":not(.k-grouping-row,.k-detail-row)"),c.lockedTable&&(_>m?g>=_&&ee(c.lockedTable.find(">tbody>tr.k-grouping-row"),c.table.find(">tbody>tr.k-grouping-row"),t.length):_>g&&ee(c.table.find(">tbody>tr.k-grouping-row"),c.lockedTable.find(">tbody>tr.k-grouping-row"),t.length),u=c.lockedTable.find(">tbody>tr:not(.k-grouping-row,.k-detail-row)")),s=0,d=i.length;d>s;s+=1)a(l(u[s],i[s],">td:not(.k-group-cell,.k-hierarchy-cell)"),g,m,n,t.length)},_autoFitLeafColumn:function(e){this.autoFitColumn(E(this.columns)[e])},autoFitColumn:function(t){var r,n,o,a,l,i,s,d,c,u,f,g,m,k,b,_,v,w=this,C=w.options,y=w.columns,T=w.lockedHeader?N(w.lockedHeader.find(">table>thead")).filter(h).length:0,x="col:not(.k-group-col):not(.k-hierarchy-col)",H="td:visible:not(.k-group-cell):not(.k-hierarchy-cell)";if(t="number"==typeof t?y[t]:be(t)?we(S(y),function(e){return e===t})[0]:we(S(y),function(e){return e.field===t})[0],t&&p(t)){for(r=ye(t,E(y)),a=t.locked,o=a?w.lockedHeader.children("table"):w.thead.parent(),n=o.find("[data-index='"+r+"']"),i=a?w.lockedTable:w.table,s=w.footer||e(),w.footer&&w.lockedContent&&(s=w.footer.children(a?".k-grid-footer-locked":".k-grid-footer-wrap")),d=s.find("table").first(),w.lockedHeader&&!a&&(r-=T),c=0;y.length>c&&y[c]!==t;c++)y[c].hidden&&r--;if(l=C.scrollable?o.find(x).eq(r).add(i.children("colgroup").find(x).eq(r)).add(d.find("colgroup").find(x).eq(r)):i.children("colgroup").find(x).eq(r),u=o.add(i).add(d),f=n.outerWidth(),l.width(""),u.css("table-layout","fixed"),l.width("auto"),u.addClass("k-autofitting"),u.css("table-layout",""),g=Math.ceil(Math.max(n.outerWidth(),i.find("tr:not(.k-grouping-row)").eq(0).children(H).eq(r).outerWidth(),d.find("tr").eq(0).children(H).eq(r).outerWidth()))+1,l.width(g),t.width=g,C.scrollable){for(m=o.find("col"),b=0,_=0,v=m.length;v>_;_+=1){if(k=m[_].style.width,!k||-1!=k.indexOf("%")){b=0;break}b+=parseInt(k,10)}b&&u.each(function(){this.style.width=b+"px"})}wt.msie&&8==wt.version&&(u.css("display","inline-table"),setTimeout(function(){u.css("display","table")},1)),u.removeClass("k-autofitting"),w.trigger(et,{column:t,oldWidth:f,newWidth:g}),w._applyLockedContainersWidth(),w._syncLockedContentHeight(),w._syncLockedHeaderHeight()}},reorderColumn:function(e,r,n){var o,a,l=this,i=d(r,l.columns),s=i?i.columns:l.columns,c=ye(r,s),u=s[e],h=!!u.locked,p=D(l.columns).length;c!==e&&(r.locked||!h||1!=F(l.columns).length)&&(!r.locked||h||1!=p)&&(l._hideResizeHandle(),n===t&&(n=c>e),a=[r],l._reorderHeader(a,u,n),l.lockedHeader&&(A(l.thead),A(l.lockedHeader)),u.columns&&(u=E(u.columns),u=u[n?0:u.length-1]),r.columns&&(a=E(r.columns)),l._reorderContent(a,u,n),o=!!r.locked,o=o!=h,r.locked=h,s.splice(n?e:e+1,0,r),s.splice(e>c?c:c+1,1),l._templates(),l._updateColumnCellIndex(),l._updateTablesWidth(),l._applyLockedContainersWidth(),l._syncLockedHeaderHeight(),l._syncLockedContentHeight(),l._updateFirstColumnClass(),o&&(h?l.trigger(rt,{column:r}):l.trigger(nt,{column:r})))},_updateColumnCellIndex:function(){var e,t=0;this.lockedHeader&&(e=this.lockedHeader.find("thead"),t=b(e,D(this.columns))),b(this.thead,F(this.columns),t)},lockColumn:function(e){var t,r=this.columns;e="number"==typeof e?r[e]:we(r,function(t){return t.field===e})[0],!e||e.locked||e.hidden||(t=D(r).length-1,this.reorderColumn(t,e,!1))},unlockColumn:function(e){var t,r=this.columns;e="number"==typeof e?r[e]:we(r,function(t){return t.field===e})[0],e&&e.locked&&!e.hidden&&(t=D(r).length,this.reorderColumn(t,e,!0))},cellIndex:function(t){var r=0;return this.lockedTable&&!e.contains(this.lockedTable[0],t[0])&&(r=E(D(this.columns)).length),e(t).parent().children("td:not(.k-group-cell,.k-hierarchy-cell)").index(t)+r},_modelForContainer:function(t){t=e(t),t.is("tr")||"popup"===this._editMode()||(t=t.closest("tr"));var r=t.attr(ue.attr("uid"));return this.dataSource.getByUid(r)},_editable:function(){var t,r=this,n=r.selectable&&r.selectable.options.multiple,o=r.options.editable,a=function(){var t=ge(),n=r._editContainer;!n||e.contains(n[0],t)||n[0]===t||e(t).closest(".k-animation-container").length||r.editable.end()&&r.closeCell()};o&&(this.wrapper.addClass("k-editable"),t=r._editMode(),"incell"===t?o.update!==!1&&r.wrapper.on(at+We,"tr:not(.k-grouping-row) > td",function(t){var o=e(this),a=r.lockedTable&&o.closest("table")[0]===r.lockedTable[0];o.hasClass("k-hierarchy-cell")||o.hasClass("k-detail-cell")||o.hasClass("k-group-cell")||o.hasClass("k-edit-cell")||o.has("a.k-grid-delete").length||o.has("button.k-grid-delete").length||o.closest("tbody")[0]!==r.tbody[0]&&!a||e(t.target).is(":input")||(r.editable?r.editable.end()&&(n&&e(ge()).blur(),r.closeCell(),r.editCell(o)):r.editCell(o))}).on("focusin"+We,function(){e.contains(this,ge())||(clearTimeout(r.timer),r.timer=null)}).on("focusout"+We,function(){r.timer=setTimeout(a,1)}):o.update!==!1&&r.wrapper.on(at+We,"tbody>tr:not(.k-detail-row,.k-grouping-row):visible a.k-grid-edit",function(t){t.preventDefault(),r.editRow(e(this).closest("tr"))}),o.destroy!==!1?r.wrapper.on(at+We,"tbody>tr:not(.k-detail-row,.k-grouping-row):visible .k-grid-delete",function(t){t.preventDefault(),t.stopPropagation(),r.removeRow(e(this).closest("tr"))}):r.wrapper.on(at+We,"tbody>tr:not(.k-detail-row,.k-grouping-row):visible button.k-grid-delete",function(e){e.stopPropagation(),r._confirmation()||e.preventDefault()}))},editCell:function(t){var r,n,o,a;t=e(t),r=this,n=E(r.columns)[r.cellIndex(t)],o=r._modelForContainer(t),r.closeCell(),!o||o.editable&&!o.editable(n.field)||n.command||!n.field||(r._attachModelChange(o),r._editContainer=t,r.editable=t.addClass("k-edit-cell").kendoEditable({fields:{field:n.field,format:n.format,editor:n.editor,values:n.values},model:o,target:r,change:function(e){r.trigger(Ne,{values:e.values,container:t,model:o})&&e.preventDefault()}}).data("kendoEditable"),a=t.parent().addClass("k-grid-edit-row"),r.lockedContent&&ne(a[0],r._relatedRow(a).addClass("k-grid-edit-row")[0]),r.trigger(Ee,{container:t,model:o}))},_adjustLockedHorizontalScrollBar:function(){var e=this.table,t=e.parent(),r=e[0].offsetWidth>t[0].clientWidth?ue.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(){var e,t;this.lockedHeader&&(e=this.lockedHeader.children("table"),t=this.thead.parent(),this._adjustRowsHeight(e,t),re(e,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 e=this,t=function(){if(e.editable){var t=e.editView?e.editView.element:e._editContainer;t&&(t.off(at+We,"a.k-grid-cancel",e._editCancelClickHandler),t.off(at+We,"a.k-grid-update",e._editUpdateClickHandler)),e._detachModelChange(),e.editable.destroy(),e.editable=null,e._editContainer=null,e._destroyEditView()}};e.editable&&("popup"!==e._editMode()||e._isMobile?t():e._editContainer.data("kendoWindow").bind("deactivate",t).close()),e._actionSheet&&(e._actionSheet.destroy(),e._actionSheet=null)},_destroyEditView:function(){this.editView&&(this.editView.purge(),this.editView=null,this.pane.navigate(""))},_attachModelChange:function(e){var t=this;t._modelChangeHandler=function(e){t._modelChange({field:e.field,model:this})},e.bind("change",t._modelChangeHandler)},_detachModelChange:function(){var e=this,t=e._editContainer,r=e._modelForContainer(t);r&&r.unbind(Ve,e._modelChangeHandler)},closeCell:function(t){var r,n,o,a,l=this,i=l._editContainer;i&&(r=i.closest("tr").attr(ue.attr("uid")),a=l.dataSource.getByUid(r),t&&l.trigger("cancel",{container:i,model:a})||(i.removeClass("k-edit-cell"),n=E(l.columns)[l.cellIndex(i)],o=i.parent().removeClass("k-grid-edit-row"),l._destroyEditable(),l._displayCell(i,n,a),i.hasClass("k-dirty-cell")&&e('').prependTo(i),l.trigger("itemChange",{item:o,data:a,ns:he}),l.lockedContent&&ne(o.css("height","")[0],l._relatedRow(o).css("height","")[0])))},_displayCell:function(e,t,r){var n=this,o={storage:{},count:0},a=_e({},ue.Template,n.options.templateSettings),l=ue.template(n._cellTmpl(t,o),a);o.count>0&&(l=xe(l,o.storage)),e.empty().html(l(r)),n.angular("compile",function(){return{elements:e,data:[{dataItem:r}]}})},removeRow:function(e){this._confirmation(e)&&this._removeRow(e)},_removeRow:function(t){var r,n=this,o=n._editMode();"incell"!==o&&n.cancelRow(),t=e(t),n.lockedContent&&(t=t.add(n._relatedRow(t))),t=t.hide(),r=n._modelForContainer(t),r&&!n.trigger(Pe,{row:t,model:r})?(n.dataSource.remove(r),("inline"===o||"popup"===o)&&n.dataSource.sync()):"incell"===o&&n._destroyEditable()},_editMode:function(){var e="incell",t=this.options.editable;return t!==!0&&(e="string"==typeof t?t:t.mode||e),e},editRow:function(r){var n,o,a,l=this;r instanceof ue.data.ObservableObject?n=r:(r=e(r),n=l._modelForContainer(r)),o=l._editMode(),l.cancelRow(),n&&(r=l.tbody.children("["+ue.attr("uid")+"="+n.uid+"]"),l._attachModelChange(n),"popup"===o?l._createPopupEditor(n):"inline"===o?l._createInlineEditor(r,n):"incell"===o&&e(r).children(Ae).each(function(){var r=e(this),o=E(l.columns)[l.cellIndex(r)];return n=l._modelForContainer(r),n&&(!n.editable||n.editable(o.field))&&o.field?(l.editCell(r),!1):t}),a=l.editView?l.editView.element:l._editContainer,a&&(this._editCancelClickHandler||(this._editCancelClickHandler=xe(this._editCancelClick,this)),a.on(at+We,"a.k-grid-cancel",this._editCancelClickHandler),this._editUpdateClickHandler||(this._editUpdateClickHandler=xe(this._editUpdateClick,this)),a.on(at+We,"a.k-grid-update",this._editUpdateClickHandler)))},_editUpdateClick:function(e){e.preventDefault(),e.stopPropagation(),this.saveRow()},_editCancelClick:function(t){var r,n=this,o=n.options.navigatable,a=n.editable.options.model,l=n.editView?n.editView.element:n._editContainer;t.preventDefault(),t.stopPropagation(),n.trigger("cancel",{container:l,model:a})||(r=n.items().index(e(n.current()).parent()),n.cancelRow(),o&&(n._setCurrent(n.items().eq(r).children().filter(Fe).first()),ae(n.table,!0)))},_createPopupEditor:function(r){var n,o,a,l,i,s,d,c,u,h,p,f=this,g="
',m=[],k=E(f.columns),b=f.options.editable,_=b.template,v=be(b)?b.window:{},w=_e({},ue.Template,f.options.templateSettings);if(v=v||{},_)for(typeof _===dt&&(_=window.unescape(_)),g+=ue.template(_,w)(r),a=0,l=k.length;l>a;a++)n=k[a],n.command&&(c=oe(n.command,"edit"),c&&(o=c));else for(a=0,l=k.length;l>a;a++)n=k[a],n.command?n.command&&(c=oe(n.command,"edit"),c&&(o=c)):(g+='
",r.editable&&!r.editable(n.field)||!n.field?(h={storage:{},count:0},i=ue.template(f._cellTmpl(n,h),w),h.count>0&&(i=xe(i,h.storage)),g+='
'+i(r)+"
"):(m.push({field:n.field,format:n.format,editor:n.editor,values:n.values}),g+="
'));o&&be(o)&&(o.text&&be(o.text)&&(s=o.text.update,d=o.text.cancel),o.attr&&(u=o.attr)),f._isMobile?(g+="
",f.editView=f.pane.append("
'+f._createButton({name:"update",text:s,attr:u})+(v.title||"Edit")+f._createButton({name:"canceledit",text:d,attr:u})+"
"+g+"
"),p=f._editContainer=f.editView.element.find(".k-popup-edit-form")):(g+='
',g+=f._createButton({name:"update",text:s,attr:u})+f._createButton({name:"canceledit",text:d,attr:u}),g+="
",p=f._editContainer=e(g).appendTo(f.wrapper).eq(0).kendoWindow(_e({modal:!0,resizable:!1,draggable:!0,title:"Edit",visible:!1,close:function(n){if(n.userTriggered){if(n.sender.element.focus(),f.trigger("cancel",{container:p,model:r}))return n.preventDefault(),t;var o=f.items().index(e(f.current()).parent());f.cancelRow(),f.options.navigatable&&(f._setCurrent(f.items().eq(o).children().filter(Fe).first()),ae(f.table,!0))}}},v))),f.editable=f._editContainer.kendoEditable({fields:m,model:r,clearContainer:!1,target:f}).data("kendoEditable"),f._isMobile&&p.find("input[type=checkbox],input[type=radio]").parent(".k-edit-field").addClass("k-check").prev(".k-edit-label").addClass("k-check").click(function(){e(this).next().children("input").click()}),f._openPopUpEditor(),f.trigger(Ee,{container:p,model:r})},_openPopUpEditor:function(){this._isMobile?this.pane.navigate(this.editView,this._editAnimation):this._editContainer.data("kendoWindow").center().open()},_createInlineEditor:function(t,r){var n,o,a,l=this,i=[];l.lockedContent&&(t=t.add(l._relatedRow(t))),t.children(":not(.k-group-cell,.k-hierarchy-cell)").each(function(){if(o=e(this),n=E(l.columns)[l.cellIndex(o)],n.command||!n.field||r.editable&&!r.editable(n.field)){if(n.command&&(a=oe(n.command,"edit"))){o.empty();var t,s,d;be(a)&&(a.text&&be(a.text)&&(t=a.text.update,s=a.text.cancel),a.attr&&(d=a.attr)),e(l._createButton({name:"update",text:t,attr:d})+l._createButton({name:"canceledit",text:s,attr:d})).appendTo(o)}}else i.push({field:n.field,format:n.format,editor:n.editor,values:n.values}),o.attr(ue.attr("container-for"),n.field),o.empty()}),l._editContainer=t,l.editable=new ue.ui.Editable(t.addClass("k-grid-edit-row"),{target:l,fields:i,model:r,clearContainer:!1}),t.length>1&&(ne(t[0],t[1]),l._applyLockedContainersWidth()),l.trigger(Ee,{container:t,model:r})},cancelRow:function(e){var t,r=this,n=r._editContainer;if(n){if(t=r._modelForContainer(n),e&&r.trigger("cancel",{container:n,model:t}))return;r._destroyEditable(),r.dataSource.cancelChanges(t),r._displayRow("popup"!==r._editMode()?n:r.tbody.find("["+ue.attr("uid")+"="+t.uid+"]"))}},saveRow:function(){var e=this,t=e._editContainer,r=e._modelForContainer(t),n=e.editable;t&&n&&n.end()&&!e.trigger(Ne,{container:t,model:r})&&e.dataSource.sync()},_displayRow:function(t){var r,n,o,a,l,i=this,s=i._modelForContainer(t),d=t.hasClass("k-state-selected"),c=t.hasClass("k-alt");s&&(i.lockedContent&&(r=e((c?i.lockedAltRowTemplate:i.lockedRowTemplate)(s)),i._relatedRow(t.last()).replaceWith(r)),i.angular("cleanup",function(){return{elements:t.get()}}),n=e((c?i.altRowTemplate:i.rowTemplate)(s)),t.replaceWith(n),i.trigger("itemChange",{item:n,data:s,ns:he}),r&&r.length&&i.trigger("itemChange",{item:r,data:s,ns:he}),a=n,l=[{dataItem:s}],r&&r.length&&(a=n.add(r),l.push({dataItem:s})),i.angular("compile",function(){return{elements:a.get(),data:l}}),d&&i.options.selectable&&i.select(n.add(r)),r&&ne(n[0],r[0]),o=n.next(),o.hasClass("k-detail-row")&&o.is(":visible")&&n.find(".k-hierarchy-cell .k-icon").removeClass("k-plus").addClass("k-minus"))},_showMessage:function(t,r){var n,o,a,l=this;return l._isMobile?(n=ue.template(''),o=e(n(t)).appendTo(l.view.element),a=l._actionSheet=new ue.mobile.ui.ActionSheet(o,{cancel:t.cancelDelete,cancelTemplate:'
  • #:cancel#
  • ',close:function(){this.destroy()},command:function(t){var n=e(t.currentTarget).parent();n.hasClass("km-actionsheet-cancel")||l._removeRow(r)},popup:l._actionSheetPopupOptions}),a.open(r),!1):window.confirm(t.title)},_confirmation:function(e){var t=this,r=t.options.editable,n=r===!0||typeof r===dt?t.options.messages.editable.confirmation:r.confirmation;return n!==!1&&null!=n?(typeof n===st&&(n=n(t._modelForContainer(e))),t._showMessage({confirmDelete:r.confirmDelete||t.options.messages.editable.confirmDelete,cancelDelete:r.cancelDelete||t.options.messages.editable.cancelDelete,title:n===!0?t.options.messages.editable.confirmation:n},e)):!0},cancelChanges:function(){this.dataSource.cancelChanges()},saveChanges:function(){var e=this;(e.editable&&e.editable.end()||!e.editable)&&!e.trigger(Ke)&&e.dataSource.sync()},addRow:function(){var e,t,r,n,o,a,l=this,i=l.dataSource,s=l._editMode(),d=l.options.editable.createAt||"",c=i.pageSize(),u=i.view()||[];(l.editable&&l.editable.end()||!l.editable)&&("incell"!=s&&l.cancelRow(),e=i.indexOf(u[0]),"bottom"==d.toLowerCase()&&(e+=u.length,c&&!i.options.serverPaging&&u.length>=c&&(e-=1)),0>e&&(e=i.page()>i.totalPages()?(i.page()-1)*c:0),t=i.insert(e,{}),r=t.uid,n=l.lockedContent?l.lockedTable:l.table,o=n.find("tr["+ue.attr("uid")+"="+r+"]"),a=o.children("td:not(.k-group-cell,.k-hierarchy-cell)").eq(l._firstEditableColumnIndex(o)),"inline"===s&&o.length?l.editRow(o):"popup"===s?l.editRow(t):a.length&&l.editCell(a),"bottom"==d.toLowerCase()&&l.lockedContent&&(l.lockedContent[0].scrollTop=l.content[0].scrollTop=l.table[0].offsetHeight))},_firstEditableColumnIndex:function(e){var t,r,n,o=this,a=E(o.columns),l=o._modelForContainer(e);for(r=0,n=a.length;n>r;r++)if(t=a[r],l&&(!l.editable||l.editable(t.field))&&!t.command&&t.field&&t.hidden!==!0)return r;return-1},_toolbar:function(){var t,r=this,n=r.wrapper,o=r.options.toolbar,a=r.options.editable;o&&(t=r.wrapper.find(".k-grid-toolbar"),t.length||(Se(o)||(o=typeof o===dt?o:r._toolbarTmpl(o).replace(gt,"\\#"),o=xe(ue.template(o),r)),t=e('
    ').html(o({})).prependTo(n),r.angular("compile",function(){return{elements:t.get()}})),a&&a.create!==!1&&t.on(at+We,".k-grid-add",function(e){e.preventDefault(),r.addRow()}).on(at+We,".k-grid-cancel-changes",function(e){e.preventDefault(),r.cancelChanges()}).on(at+We,".k-grid-save-changes",function(e){e.preventDefault(),r.saveChanges()}),t.on(at+We,".k-grid-excel",function(e){e.preventDefault(),r.saveAsExcel()}),t.on(at+We,".k-grid-pdf",function(e){e.preventDefault(),r.saveAsPDF()}))},_toolbarTmpl:function(e){var t,r,n=this,o="";if(Ce(e))for(t=0,r=e.length;r>t;t++)o+=n._createButton(e[t]);return o},_createButton:function(e){var r,o=e.template||_t,a=typeof e===dt?e:e.name||e.text,l=xt[a]?xt[a].className:"k-grid-"+(a||"").replace(/\s/g,""),i={className:l,text:a,imageClass:"",attr:"",iconClass:""},s=this.options.messages.commands;if(!(a||be(e)&&e.template))throw Error("Custom commands should have name specified");return be(e)?(e=_e(!0,{},e),e.className&&ye(i.className,e.className.split(" "))<0?e.className+=" "+i.className:e.className===t&&(e.className=i.className),"edit"===a&&be(e.text)&&(e=_e(!0,{},e),e.text=e.text.edit),e.attr&&(be(e.attr)&&(e.attr=n(e.attr)),typeof e.attr===dt&&(r=e.attr.match(/class="(.+?)"/),r&&ye(r[1],e.className.split(" "))<0&&(e.className+=" "+r[1]))),i=_e(!0,i,xt[a],{text:s[a]},e)):i=_e(!0,i,xt[a],{text:s[a]}),ue.template(o)(i)},_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;t._groupableClickHandler?t.table.add(t.lockedTable).off(at+We,t._groupableClickHandler):t._groupableClickHandler=function(r){var n=e(this),o=n.closest("tr");n.hasClass("k-i-collapse")?t.collapseGroup(o):t.expandGroup(o),r.preventDefault(),r.stopPropagation()},t._isLocked()?t.lockedTable.on(at+We,".k-grouping-row .k-i-collapse, .k-grouping-row .k-i-expand",t._groupableClickHandler):t.table.on(at+We,".k-grouping-row .k-i-collapse, .k-grouping-row .k-i-expand",t._groupableClickHandler),t._attachGroupable()},_attachGroupable:function(){var t=this,r=t.wrapper,n=t.options.groupable,o=Me+"["+ue.attr("field")+"]",a=t.content?".k-grid-header:first "+o:"table:first>.k-grid-header "+o;n&&n.enabled!==!1&&(r.has("div.k-grouping-header")[0]||e("
     
    ").addClass("k-grouping-header").prependTo(r),t.groupable&&t.groupable.destroy(),t.groupable=new he.Groupable(r,_e({},n,{draggable:t._draggableInstance,groupContainer:">div.k-grouping-header",dataSource:t.dataSource,draggableElements:a,filter:a,allowDrag:t.options.reorderable})))},_continuousItems:function(t,r){var n,o,a,l,i,s,d,c;if(this.lockedContent){for(n=this,o=n.table.add(n.lockedTable),a=e(t,o[0]),l=e(t,o[1]),i=r?D(n.columns).length:1,s=r?n.columns.length-i:1,d=[],c=0;a.length>c;c+=i)Te.apply(d,a.slice(c,c+i)),Te.apply(d,l.splice(0,s));return d}},_selectable:function(){var r,n,o,a,l=this,i=[],s=l._isLocked(),d=l.options.selectable;d&&(l.selectable&&l.selectable.destroy(),d=ue.ui.Selectable.parseOptions(d),r=d.multiple,n=d.cell,l._hasDetails()&&(i[i.length]=".k-detail-row"),(l.options.groupable||l._hasFooters())&&(i[i.length]=".k-grouping-row,.k-group-footer"),i=i.join(","),""!==i&&(i=":not("+i+")"),o=l.table,s&&(o=o.add(l.lockedTable)),a=">"+(n?Le:"tbody>tr"+i),l.selectable=new ue.ui.Selectable(o,{filter:a,aria:!0,multiple:r,change:function(){l.trigger(Ve)},useAllItems:s&&r&&n,relatedTarget:function(t){var r,o,a,i;if(!n&&s){for(o=e(),a=0,i=t.length;i>a;a++)r=l._relatedRow(t[a]),ye(r[0],t)<0&&(o=o.add(r));return o}},continuousItems:function(){return l._continuousItems(a,n)}}),l.options.navigatable&&o.on("keydown"+We,function(a){var i=l.current(),d=a.target;if(a.keyCode===ke.SPACEBAR&&e.inArray(d,o)>-1&&!i.is(".k-edit-cell,.k-header")&&i.parent().is(":not(.k-grouping-row,.k-detail-row,.k-group-footer)")){if(a.preventDefault(),a.stopPropagation(),i=n?i:i.parent(),s&&!n&&(i=i.add(l._relatedRow(i))),r)if(a.ctrlKey){if(i.hasClass(Ye))return i.removeClass(Ye),l.trigger(Ve),t}else l.selectable.clear();else l.selectable.clear();l.selectable.value(i)}}))},_clipboard:function(){var e,t=this.options,r=t.selectable;r&&t.allowCopy&&(e=this,t.navigatable||e.table.add(e.lockedTable).attr("tabindex",0).on("mousedown"+We+" keydown"+We,".k-detail-cell",function(e){e.target!==e.currentTarget&&e.stopImmediatePropagation()}).on("mousedown"+We,De+">"+Fe,xe(ie,e)),e.copyHandler=xe(e.copySelection,e),e.updateClipBoardState=function(){e.areaClipBoard&&e.areaClipBoard.val(e.getTSV()).focus().select()},e.bind("change",e.updateClipBoardState),e.wrapper.on("keydown",e.copyHandler),e.clearAreaHandler=xe(e.clearArea,e),e.wrapper.on("keyup",e.clearAreaHandler))},copySelection:function(t){t instanceof jQuery.Event&&!t.ctrlKey&&!t.metaKey||e(t.target).is("input:visible,textarea:visible")||window.getSelection&&""+window.getSelection()||document.selection&&document.selection.createRange().text||(this.areaClipBoard||(this.areaClipBoard=e("