UNPKG

@progress/kendo-ui

Version:

This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.

2 lines 159 kB
module.exports=function(e){function t(o){if(r[o])return r[o].exports;var l=r[o]={exports:{},id:o,loaded:!1};return e[o].call(l.exports,l,l.exports,t),l.loaded=!0,l.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}({0:function(e,t,r){e.exports=r(1229)},3:function(e,t){e.exports=function(){throw Error("define cannot be used indirect")}},1017:function(e,t){e.exports=require("jquery")},1027:function(e,t){e.exports=require("./kendo.data")},1046:function(e,t){e.exports=require("./kendo.selectable")},1059:function(e,t){e.exports=require("./kendo.filtermenu")},1158:function(e,t){e.exports=require("./kendo.resizable")},1159:function(e,t){e.exports=require("./kendo.window")},1209:function(e,t){e.exports=require("./kendo.dialog")},1217:function(e,t){e.exports=require("./kendo.editable")},1223:function(e,t){e.exports=require("./kendo.pdf")},1226:function(e,t){e.exports=require("./kendo.columnsorter")},1229:function(e,t,r){var o,l,a;(function(n){!function(n,define){l=[r(1027),r(1226),r(1217),r(1159),r(1059),r(1231),r(1232),r(1233),r(1046),r(1234),r(1230),r(1158),r(1235),r(1236),r(1237),r(1238),r(1223),r(1209),r(1237),r(1239)],o=n,a="function"==typeof o?o.apply(t,l):o,!(void 0!==a&&(e.exports=a))}(function(){return function(e,t){function r(e,t){return"["+De.attr(e)+"="+t+"]"}function o(e){return Array(e+1).join('<td class="k-group-cell">&nbsp;</td>')}function l(e){var t,r=" ";if(e){if(typeof e===ir)return e;for(t in e)""!==e[t]&&(r+=t+'="'+e[t]+'"')}return r}function a(t,r){e("th, th .k-grid-filter, th .k-link",t).add(document.body).css("cursor",r)}function i(t,r,o,l,a){var n,i=r;for(r=e(),a=a||1,n=0;n<a;n++)r=r.add(t.eq(i+n));"number"==typeof o?r[l?"insertBefore":"insertAfter"](t.eq(o)):r.appendTo(o)}function s(t,r,o){return e(t).add(r).find(o)}function d(e,t,r){var o,l,a,n;for(r=je(r)?r:[r],o=0,l=r.length;o<l;o++)a=r[o],Ge(a)&&a.click&&(n=a.name||a.text,t.on(rr+ft,"a.k-grid-"+(n||"").replace(/\s/g,""),{commandName:n},Je(a.click,e)))}function c(e,t,r,o){return Ue(e,function(e){var l,a;return e=typeof e===ir?{field:e}:e,e.parentIds=o,v(e)&&!r||(e.attributes=re(e.attributes),e.footerAttributes=re(e.footerAttributes),e.headerAttributes=re(e.headerAttributes),l=!0),a=De.guid(),e.headerAttributes=Ne({headers:o},e.headerAttributes),e.headerAttributes.id?a=e.headerAttributes.id:e.headerAttributes=Ne({id:a},e.headerAttributes),e.columns&&(e.columns=c(e.columns,t,l,o?o+" "+a:a)),Ne({encoded:t,hidden:l},e)})}function u(e,t){var r=[];return p(e,t,r),r[r.length-1]}function p(e,t,r){var o,l;for(r=r||[],o=0;o<t.length;o++){if(e===t[o])return!0;if(t[o].columns){if(l=r.length,r.push(t[o]),p(e,t[o].columns,r))return!0;r.splice(l,r.length-l)}}return!1}function h(e,t){f(e,t,t)}function f(e,t,r){var o=r?le:re;e.hidden=!t,e.attributes=o(e.attributes),e.footerAttributes=o(e.footerAttributes),e.headerAttributes=o(e.headerAttributes)}function g(e,t){m(e);var r=e._hideByMedia;f(e,t,r?e.matchesMedia:t)}function m(e){e.matchesMedia=k(e)}function k(e){return e&&(y(e.media)||!y(e.media)&&De.matchesMedia(e.media))}function _(){return"none"!==this.style.display}function b(t){return"none"!==e(t)[0].style.display}function v(e){return w([e]).length>0}function w(e){return Ke(e,function(e){var t=!e.hidden&&e.matchesMedia!==!1;return t&&e.columns&&(t=w(e.columns).length>0),t})}function C(e){var t,r,o=[];for(r=0;r<e.length;r++){if(t=e[r],!y(t.media)){if(!y(t.minScreenWidth))throw Error("Using 'media' and 'minScreenWidth' options at the same time is not supported.");o.push(t)}t.columns&&(o=o.concat(C(t.columns)))}return o}function y(e){return t===e}function S(t){return e(t).map(function(){return this.toArray()})}function T(e,t,r){var o=R(N(t)),l=R(U(t)),a=e.rowSpan;e.rowSpan=r?o>l?a-(o-l)||1:a+(l-o):o>l?a+(o-l):a-(l-o)||1}function x(t,r,o,l,a,n,i,s){var d,c,u=R(t),p=R([r]);u>p&&(d=Array(i+1).join('<th class="k-group-cell k-header" scope="col">&nbsp;</th>'),c=n.children(":not(.k-filter-row)"),e(Array(u-p+1).join("<tr>"+d+"</tr>")).insertAfter(c.last())),B(n,u-p),I(o,l,a,n,s)}function H(t,r,o){var l,a,n,i,s,d,c,u;for(o=o||0,n=r,r=J(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;c<u;c++)l=E(r[c],n),i[l.row]||(i[l.row]=s.eq(l.row).find(".k-header").filter(d)),a=i[l.row].eq(l.cell),a.attr(De.attr("index"),o+c);return r.length}function R(e){var t,r,o=1,l=0;for(t=0;t<e.length;t++)e[t].columns&&(r=R(e[t].columns),r>l&&(l=r));return o+l}function I(t,r,o,l,a){var n,i,s=D(t[0],r),d=o.find(">tr:not(.k-filter-row):eq("+s.row+")>th.k-header"),c=e(),u=s.cell;for(n=0;n<t.length;n++)c=c.add(d.eq(u+n));for(l.find(">tr:not(.k-filter-row)").eq(s.row)[a](c),i=[],n=0;n<t.length;n++)t[n].columns&&(i=i.concat(t[n].columns));i.length&&I(i,r,o,l,a)}function E(e,t,r,o){var l,a;for(r=r||0,o=o||{},o[r]=o[r]||0,a=0;a<t.length;a++){if(t[a]==e){l={cell:o[r],row:r};break}if(t[a].columns&&(l=E(e,t[a].columns,r+1,o)))break;o[r]++}return l}function z(e,t,r,o){var l,a,n=!!r.locked;do l=e[t],t+=o?1:-1,a=!!l.locked;while(l&&t>-1&&t<e.length&&l!=r&&!l.columns&&a===n);return l}function L(e,t,r,o,l){var a,n,i,s,d;return t.columns?(t=t.columns,t[o?0:t.length-1]):(a=u(t,e),n=a?a.columns:e,i=$e(t,n),0===i&&o?i++:i==n.length-1&&!o||!r.locked&&!t.columns&&!o?i--:(i>0||0===i&&!o)&&i++,s=$e(r,n),t=z(n,i,r,s>i),d=$e(t,l),(!t.columns||d&&d!==n.length-1)&&t&&t!=r&&t.columns?L(e,t,r,o,l):null)}function D(e,t,r,o){var l,a;for(r=r||0,o=o||{},o[r]=o[r]||0,a=0;a<t.length;a++){if(t[a]==e){l={cell:o[r],row:r};break}if(t[a].columns&&(l=D(e,t[a].columns,r+1,o)))break;t[a].hidden||o[r]++}return l}function M(e){var t=q(N(e));return t.concat(q(U(e)))}function F(e,t,r,o){var l=e[r],a=e[o],n=u(l,t);return t=n?n.columns:t,$e(a,t)}function q(e){var t,r=[],o=[];for(t=0;t<e.length;t++)r.push(e[t]),e[t].columns&&(o=o.concat(e[t].columns));return o.length&&(r=r.concat(q(o))),r}function A(e){var t,r,o=0;for(r=0;r<e.length;r++)t=e[r],t.columns?o+=A(t.columns):t.hidden&&o++;return o}function P(e){var t,r,o=0;for(t=0,r=e.length;t<r;t++)e[t].hidden||(o+=parseInt(e[t].width,10));return o}function W(e){var t,r,o,l=0;for(r=0,o=e.length;r<o;r++)t=e[r].style.width,t&&t.indexOf("%")==-1&&(l+=parseInt(t,10));return l}function V(e,t){var r,o,l=e.find("tr:not(.k-filter-row) th:not(.k-group-cell,.k-hierarchy-cell)");for(o=0;o<l.length;o++)r=l[o].rowSpan,r>1&&(l[o].rowSpan=r-t||1)}function B(e,t){var r,o=e.find("tr:not(.k-filter-row) th:not(.k-group-cell,.k-hierarchy-cell)");for(r=0;r<o.length;r++)o[r].rowSpan+=t}function O(t){var r,o=t.find("tr:not(.k-filter-row)"),l=o.filter(function(){return!e(this).children().length}).remove().length,a=o.find("th:not(.k-group-cell,.k-hierarchy-cell)");for(r=0;r<a.length;r++)a[r].rowSpan>1&&(a[r].rowSpan-=l);return o.length-l}function G(e,t,r,o,l){var a,n,i,s=[];for(a=0,i=e.length;a<i;a++)n=r[o]||[],n.push(t.eq(l+a)),r[o]=n,e[a].columns&&(s=s.concat(e[a].columns));s.length&&G(s,t,r,o+1,l+e.length)}function N(e){return Ke(e,function(e){return e.locked})}function U(e){return Ke(e,function(e){return!e.locked})}function K(e){return Ke(e,function(e){return!e.locked&&v(e)})}function j(e){return Ke(e,function(e){return e.locked&&v(e)})}function $(e){var t,r=[];for(t=0;t<e.length;t++)e[t].hidden||(e[t].columns?r=r.concat($(e[t].columns)):r.push(e[t]));return r}function Q(e){var t,r=[];for(t=0;t<e.length;t++)e[t].columns&&(r=r.concat(e[t].columns));return r}function J(e){var t,r=[];for(t=0;t<e.length;t++)e[t].columns?r=r.concat(J(e[t].columns)):r.push(e[t]);return r}function Y(e){var t,r=[];for(e=J(e),t=0;t<e.length;t++)"string"==typeof e[t]?r.push(e[t]):e[t].field&&r.push(e[t].field);return r}function X(r){var o,l=r.find(">tr:not(.k-filter-row)"),a=function(){var t=e(this);return!t.hasClass("k-group-cell")&&!t.hasClass("k-hierarchy-cell")},n=e();return l.length>1&&(n=l.find("th").filter(a).filter(function(){return this.rowSpan>1})),n=n.add(l.last().find("th").filter(a)),o=De.attr("index"),n.sort(function(r,l){var a,n;return r=e(r),l=e(l),a=r.attr(o),n=l.attr(o),a===t&&(a=e(r).index()),n===t&&(n=e(l).index()),a=parseInt(a,10),n=parseInt(n,10),a>n?1:a<n?-1:0}),n}function Z(t){var r,o,l,a,n,i,s,d=t.closest("table"),c=e().add(t),u=t.closest("tr"),p=d.find("tr:not(.k-filter-row)"),h=p.index(u);if(h>0){for(r=p.eq(h-1),o=r.find("th:not(.k-group-cell,.k-hierarchy-cell)").filter(function(){return!e(this).attr("rowspan")}),l=0,a=u.find("th:not(.k-group-cell,.k-hierarchy-cell)").index(t),n=t.prevAll(":not(.k-group-cell,.k-hierarchy-cell)").filter(function(){return this.colSpan>1}),i=0;i<n.length;i++)l+=n[i].colSpan||1;for(a+=Math.max(l-1,0),l=0,i=0;i<o.length;i++)if(s=o.eq(i),l+=s.attr("data-colspan")?s[0].getAttribute("data-colspan"):1,a>=i&&a<l){c=Z(s).add(c);break}}return c}function ee(t){var r,o,l,a,n,i,s,d=t.closest("thead"),c=e().add(t),u=t.closest("tr"),p=d.find("tr:not(.k-filter-row)"),h=p.index(u)+t[0].rowSpan,f=De.attr("colspan");if(h<=p.length-1){for(r=u.next(),o=t.prevAll(":not(.k-group-cell,.k-hierarchy-cell)"),o=o.filter(function(){return!this.rowSpan||1===this.rowSpan}),a=0,l=0;l<o.length;l++)a+=parseInt(o.eq(l).attr(f),10)||1;for(n=r.find("th:not(.k-group-cell,.k-hierarchy-cell)"),i=parseInt(t.attr(f),10)||1,l=0;l<i;)r=n.eq(l+a),c=c.add(ee(r)),s=parseInt(r.attr(f),10),s>1&&(i-=s-1),l++}return c}function te(t,r,o,l){var a,n=t;return l&&t.empty(),Ae?t[0].innerHTML=o:(a=document.createElement("div"),a.innerHTML="<table><tbody>"+o+"</tbody></table>",t=a.firstChild.firstChild,r[0].replaceChild(t,n[0]),t=e(t)),t}function re(e){e=e||{};var t=e.style;return t?(t=t.replace(/display:[^;]*/i,"display:none"),t.match(/display:/i)||(t=t.replace(/(.*)?/i,"display:none;$1"))):t="display:none",Ne({},e,{style:t})}function oe(e){e=e||{};var t=e.style||"";return t.indexOf("display:none")!==-1}function le(e){e=e||{};var t=e.style;return t&&(e.style=t.replace(/(display\s*:\s*none\s*;?)*/gi,"")),e}function ae(t,r,o,l){var a,n=t.find(">colgroup"),i=Ue(r,function(e){return a=e.width,a&&0!==parseInt(a,10)?De.format('<col style="width:{0}"/>',typeof a===ir?a:a+"px"):"<col />"});(o||n.find(".k-hierarchy-col").length)&&i.splice(0,0,'<col class="k-hierarchy-col" />'),n.length&&n.remove(),n=e(Array(l+1).join('<col class="k-group-col">')+i.join("")),n.is("colgroup")||(n=e("<colgroup/>").append(n)),t.prepend(n),Ar.msie&&8==Ar.version&&(t.css("display","inline-table"),window.setTimeout(function(){t.css("display","")},1))}function ne(e,t){var r,o,l=0,a=e.find("th:not(.k-group-cell)");for(r=0,o=t.length;r<o;r++)t[r].locked&&(a.eq(r).insertBefore(a.eq(l)),a=e.find("th:not(.k-group-cell)"),l++)}function ie(e){var t,r,o,l={};for(r=0,o=e.length;r<o;r++)t=e[r],l[t.value]=t.text;return l}function se(e,t,r,o){var l=r&&r.length&&Ge(r[0])&&"value"in r[0],a=l?ie(r)[e]:e;return a=null!=a?a:"",t?De.format(t,a):o===!1?a:De.htmlEncode(a)}function de(e,t,r){for(var o,l=0,a=e[l];a;){if(o=!!r||"none"!==a.style.display,o&&!zr.test(a.className)&&--t<0){a.style.display=r?"":"none";break}a=e[++l]}}function ce(t,r){for(var o,l,a=0,n=t.length;a<n;a+=1)l=t.eq(a),l.is(".k-grouping-row,.k-detail-row")?(o=l.children(":not(.k-group-cell):first,.k-detail-cell").last(),o.attr("colspan",parseInt(o.attr("colspan"),10)-1)):(l.hasClass("k-grid-edit-row")&&(o=l.children(".k-edit-container")[0])&&(o=e(o),o.attr("colspan",parseInt(o.attr("colspan"),10)-1),o.find("col").eq(r).remove(),l=o.find("tr:first")),de(l[0].cells,r,!1))}function ue(e){var t,r,o=[];for(r=0;r<e.length&&(t=e[r],"field"in t&&"value"in t&&"items"in t);r++)o.push(t),t.hasSubgroups&&(o=o.concat(ue(t.items)));return o}function pe(e){var t,r,o=[];for(r=0;r<e.length&&(t=e[r],"field"in t&&"value"in t&&"items"in t);r++)t.hasSubgroups&&(o=o.concat(pe(t.items))),o.push(t.aggregates);return o}function he(t,r){for(var o,l,a,n=0,i=t.length;n<i;n+=1)l=t.eq(n),l.is(".k-grouping-row,.k-detail-row")?(o=l.children(":not(.k-group-cell):first,.k-detail-cell").last(),o.attr("colspan",parseInt(o.attr("colspan"),10)+1)):(l.hasClass("k-grid-edit-row")&&(o=l.children(".k-edit-container")[0])&&(o=e(o),o.attr("colspan",parseInt(o.attr("colspan"),10)+1),ae(o.find(">form>table"),w(a),!1,0),l=o.find("tr:first")),de(l[0].cells,r,!0))}function fe(e,t,r){r=r||1;var o,l,a;for(l=0,a=e.length;l<a;l++)o=e.eq(l).children().last(),o.attr("colspan",parseInt(o.attr("colspan"),10)+r),o=t.eq(l).children().last(),o.attr("colspan",parseInt(o.attr("colspan"),10)-r)}function ge(e){var t,r,o=0,l=e.find(">colgroup>col");for(t=0,r=l.length;t<r;t+=1)o+=parseInt(l[t].style.width,10);return o}function me(e,t){var r,o,l,a;e=e[0],t=t[0],e.rows.length!==t.rows.length&&(r=e.offsetHeight,o=t.offsetHeight,r>o?(l=t.rows[t.rows.length-1],Lr.test(l.className)&&(l=t.rows[t.rows.length-2]),a=r-o):(l=e.rows[e.rows.length-1],Lr.test(l.className)&&(l=e.rows[e.rows.length-2]),a=o-r),l.style.height=l.offsetHeight+a+"px")}function ke(e,t){var r,o=e.offsetHeight,l=t.offsetHeight;o>l?r=o+"px":o<l&&(r=l+"px"),r&&(e.style.height=t.style.height=r)}function _e(e,t){var r,o,l;if(typeof e===ir&&e===t)return e;if(Ge(e)&&e.name===t)return e;if(je(e))for(r=0,o=e.length;r<o;r++)if(l=e[r],typeof l===ir&&l===t||l.name===t)return l;return null}function be(t,r){if(r===!0){t=e(t);var o=t.parent().scrollLeft();De.focusElement(t),t.parent().scrollLeft(o)}else e(t).one("focusin",function(e){e.preventDefault()}).focus()}function ve(e,r){return e.options.groupable&&(r.groupable||r.groupable===t)}function we(t,r){return!!e.grep(t,function(e){return e.field===r}).length}function Ce(e,t){return!(!e.field||e.selectable)&&(!(t.editable&&!t.editable(e.field))&&!(e.editable&&!e.editable(t)))}function ye(t){return e(t).is(":button,a,:input,a>.k-icon,textarea,span.k-select,span.k-icon,span.k-link,label.k-checkbox-label,.k-input,.k-multiselect-wrap,.k-picker-wrap,.k-picker-wrap>.k-selected-color,.k-tool-icon,.k-dropdown")}function Se(r){var o=e(r.currentTarget),l=o.is("th"),a=this.table.add(this.lockedTable),n=this.thead.parent().add(e(">table",this.lockedHeader)),i=ye(r.target),s=e(r.target).is(".k-checkbox"),d=e(r.target),c=o.closest("table")[0];return i&&o.find(De.roleSelector("filtercell")).length?(this._setCurrent(o),t):(c!==a[0]&&c!==a[1]&&c!==n[0]&&c!==n[1]||d.is("a.k-i-expand, a.k-i-collapse")||(this.options.navigatable&&this._setCurrent(o,!1,s),!l&&i||setTimeout(function(){Wr&&e(De._activeElement()).hasClass("k-widget")||!e(De._activeElement()).is(Gt)&&ye(De._activeElement())&&e.contains(c,De._activeElement())||be(c,!0)}),l&&!De.support.touch&&r.preventDefault()),t)}function Te(e,t){if(!t)return 0;var r=0;return De.support.browser.webkit&&(r=e.width()),r}function xe(e){var r;return"string"==typeof e?(r=e.toLowerCase(),"true"===r?{rows:!0}:{rows:r.indexOf("rows")>-1,columns:r.indexOf("columns")>-1}):e===!0?{rows:!0}:t}function He(t,r){var o,l;return!!t&&(r=e(r),!!(r[0]&&Ze(t[0],r[0])&&(o=r.offset().top-t.offset().top,l=r.outerHeight()/2,(o>=0||et.abs(o)<=l)&&et.floor(o+l)<=t.height())))}function Re(e){return e&&(e.hasClass("k-edit-cell")||e.parent().hasClass("k-grid-edit-row"))}function Ie(e){return'<td colspan="#=data.colspan +'+e+'#"><p class="k-reset"><a class="k-icon k-i-collapse" href="\\#" tabindex="-1" '+Hr+'="'+Tr+'"></a>#=data.text#</p></td>'}function Ee(e){return'<td colspan="'+e+'"><p class="k-reset">&nbsp;</p></td>'}function ze(e,t,r,l,a,n){return'<tr role="row"'+(n?'data-group-uid="'+a+'"':"")+'class="k-grouping-row">'+o(t)+'<td colspan="'+e+'" aria-expanded="'+!!l+'"><p class="k-reset"><a class="k-icon '+(l?"k-i-collapse":"k-i-expand")+'" href="#" tabindex="-1" '+Hr+'="'+(l?Tr:xr)+'"></a>'+r+"</p></td></tr>"}function Le(e){return'<tr role="row" class="k-grouping-row"><td colspan="'+e+'" aria-expanded="true"><p class="k-reset">&nbsp;</p></td></tr>'}var De=window.kendo,Me=De.ui,Fe=De.data.DataSource,qe=De.data.ObservableObject,Ae=De.support.tbodyInnerHtml,Pe=De._activeElement,We=Me.Widget,Ve=De._outerWidth,Be=De._outerHeight,Oe=De.keys,Ge=e.isPlainObject,Ne=e.extend,Ue=e.map,Ke=e.grep,je=e.isArray,$e=e.inArray,Qe=Array.prototype.push,Je=e.proxy,Ye=De.isFunction,Xe=e.isEmptyObject,Ze=e.contains,et=Math,tt=".",rt="progress",ot="error",lt="k-hierarchy-cell",at=":not(.k-group-cell):not(["+De.attr("virtual")+"]):not(.k-hierarchy-cell:not(:has(.k-icon.k-i-collapse,.k-icon.k-i-expand))):visible",nt="tbody>tr:not(.k-grouping-row):not(.k-detail-row):not(.k-group-footer) > td:not(.k-group-cell):not(.k-hierarchy-cell)",it="tr:not(.k-footer-template):visible",st=":not(.k-group-cell):not(.k-detail-cell):not(.k-hierarchy-cell):visible",dt="tr:not(.k-grouping-row):not(.k-detail-row):not(.k-footer-template):not(.k-group-footer):visible",ct=dt+":first",ut=dt+":last",pt=it+":first>"+st+":first",ht="th.k-header:not(.k-group-cell):not(.k-hierarchy-cell)",ft=".kendoGrid",gt="k-grid-content-locked",mt="k-group-cell",kt="edit",_t="beforeEdit",bt="save",vt="remove",wt="detailInit",Ct="filterMenuInit",yt="columnMenuInit",St="filterMenuOpen",Tt="columnMenuOpen",xt="cellClose",Ht="change",Rt="columnHide",It="columnShow",Et="saveChanges",zt="dataBound",Lt="detailExpand",Dt="detailCollapse",Mt="itemchange",Ft="page",qt="paging",At="scroll",Pt="sync",Wt="k-state-focused",Vt=":kendoFocusable",Bt="k-state-selected",Ot="k-checkbox",Gt="input[data-role='checkbox']."+Ot,Nt="k-grid-norecords",Ut="k-link",Kt="k-icon",jt="k-sort-order",$t="k-header-column-menu",Qt="k-grid-filter",Jt="resize",Yt="columnResize",Xt="columnReorder",Zt="columnLock",er="columnUnlock",tr="navigate",rr="click",or="mousedown",lr="height",ar="tabIndex",nr="function",ir="string",sr="bottom",dr="container-for",cr="field",ur="input",pr="incell",hr="inline",fr="uid",gr=1,mr="colSpan",kr="overflow",_r="hidden",br="sort",vr="group-sort",wr="Are you sure you want to delete this record?",Cr="No records available.",yr="Delete",Sr="Cancel",Tr="Collapse",xr="Expand",Hr="aria-label",Rr=/(\}|\#)/gi,Ir=/#/gi,Er="[\\x20\\t\\r\\n\\f]",zr=RegExp("(^|"+Er+")(k-group-cell|k-hierarchy-cell)("+Er+"|$)"),Lr=RegExp("(^|"+Er+")(k-filter-row)("+Er+"|$)"),Dr='# if (iconClass) {#<a role="button" class="k-button k-button-icontext #=className#" #=attr# href="\\#"><span class="#=iconClass#"></span>#=text#</a># } else { #<a role="button" class="k-button k-button-icontext #=className#" #=attr# href="\\#">#=text#</a># } #',Mr='<input class="'+Ot+'" data-role="checkbox" aria-label="Select row" aria-checked="false" type="checkbox">',Fr='<input class="'+Ot+'" data-role="checkbox" aria-label="Select all rows" aria-checked="false" type="checkbox">',qr=!1,Ar=De.support.browser,Pr=Ar.msie&&7==Ar.version,Wr=Ar.msie&&8==Ar.version,Vr=Ar.msie&&11===Ar.version,Br=/Mac OS/.test(navigator.userAgent),Or={content:"k-content",widget:"k-widget",scrollContainer:"k-scroll-container"},Gr=Me.Pager.extend({init:function(e,t){Me.Pager.fn.init.call(this,e,Ne(!0,{},t)),this.dataSource.options.useRanges=!0,this.dataSource._omitPrefetch=!0},options:{name:"GroupsPager"},totalPages:function(){var e=this;return Math.ceil((e._collapsedTotal()||0)/(e.pageSize()||1))},_collapsedTotal:function(){var e=this.dataSource;return e?e.groupsTotal(!0)||0:0}}),Nr=We.extend({init:function(e,t){var r=this;We.fn.init.call(r,e,t),r._refreshHandler=Je(r.refresh,r),r.setDataSource(t.dataSource),r.wrap()},setDataSource:function(e){var t=this;t.dataSource&&t.dataSource.unbind(Ht,t._refreshHandler),t.dataSource=e,t.dataSource.bind(Ht,t._refreshHandler),t.dataSource.options.useRanges=!0},options:{name:"VirtualScrollable",itemHeight:e.noop,prefetch:!0,maxScrollHeight:25e4},events:[qt,Ft,At],destroy:function(){var e=this;We.fn.destroy.call(e),e.dataSource.unbind(Ht,e._refreshHandler),e.wrapper.add(e.verticalScrollbar).off(ft),clearTimeout(e._timeout),e._scrollingTimeout&&clearTimeout(e._scrollingTimeout),e.drag&&(e.drag.destroy(),e.drag=null),e.wrapper=e.element=e.verticalScrollbar=null,e._refreshHandler=null},wrap:function(){var t,r=this,o=De.support.scrollbar()+1,l=r.element;l.css({width:"auto",overflow:"hidden"}).css(qr?"padding-left":"padding-right",o),r.content=l.children().first(),t=r.wrapper=r.content.wrap('<div class="k-virtual-scrollable-wrap"/>').parent().bind("DOMMouseScroll"+ft+" mousewheel"+ft,Je(r._wheelScroll,r)),r._wrapper(),(De.support.kineticScrollNeeded||De.support.touch)&&(r.wrapper.css("touch-action","none"),r.drag=new De.UserEvents(r.wrapper,{global:!0,allowSelection:!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('<div class="k-scrollbar k-scrollbar-vertical" />').css({width:o}).appendTo(l).bind("scroll"+ft,Je(r._scroll,r))},_wrapper:function(){var e=this;Vr&&(e.wrapper.css({"overflow-y":At}),e.element.css(qr?"padding-left":"padding-right",0))},_wheelScroll:function(e){if(!e.ctrlKey){var t=this.verticalScrollbar,r=t.scrollTop(),o=De.wheelDeltaY(e);!o||o>0&&0===r||o<0&&r+t[0].clientHeight==t[0].scrollHeight||(e.preventDefault(),this.verticalScrollbar.scrollTop(r+-o))}},_scroll:function(e){var r=this,o=!r.options.prefetch,l=e.currentTarget.scrollTop,a=r.dataSource,n=r.itemHeight,i=a.skip()||0,s=r._rangeStart||i,d=r.element.innerHeight(),c=!!(r._scrollbarTop&&r._scrollbarTop>l),u=et.max(et.floor(l/n),0),p=c?et.ceil(d/n):et.floor(d/n),h=et.max(u+p,0);return r._preventScroll?(r._preventScroll=!1,t):(r._prevScrollTop=r._scrollTop,r._scrollTop=l-s*n,r._scrollbarTop=l,r._scrolling=o,r._fetch(u,h,c)||(r.wrapper[0].scrollTop=r._scrollTop),r.trigger(At),o&&(r._scrollingTimeout&&clearTimeout(r._scrollingTimeout),r._scrollingTimeout=setTimeout(function(){r._scrolling=!1,r._page(r._rangeStart,r.dataSource.take())},100)),t)},scrollToTop:function(){this._scrollTo(0)},scrollToBottom:function(){var e=this.verticalScrollbar;this._scrollTo(e[0].scrollHeight-e.height())},_scrollWrapperToTop:function(){this.wrapper.scrollTop(0)},_scrollWrapperToBottom:function(){this.wrapper.scrollTop(this.wrapper[0].scrollHeight)},_scrollWrapperOnColumnResize:function(){var e=this,t=this.wrapper,r=t.scrollTop();t[0].scrollWidth>t[0].clientWidth?(!e._wrapperScrolled&&r||e._isScrolledToBottom())&&(t.scrollTop(r+De.support.scrollbar()),e._scrollTop=t.scrollTop(),e._wrapperScrolled=!0):e._wrapperScrolled&&(e._isWrapperScrolledToBottom()||(t.scrollTop(r-De.support.scrollbar()),e._scrollTop=t.scrollTop()),e._wrapperScrolled=!1)},_scrollTo:function(e){var t=this,r=t.verticalScrollbar;r.scrollTop()!==e&&(t._preventScroll=!0),t.wrapper.scrollTop(e),t._scrollTop=t.wrapper.scrollTop(),r.scrollTop(e),t._scrollbarTop=r.scrollTop()},_isScrolledToTop:function(){return 0===this.verticalScrollbar.scrollTop()},_isScrolledToBottom:function(){var e=this.verticalScrollbar,t=e.scrollTop();return t>0&&t>=parseInt(e[0].scrollHeight-e.height(),10)},_isWrapperScrolledToBottom:function(){var e=this.wrapper;return e.scrollTop()>=parseInt(e[0].scrollHeight-e.height(),10)},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,o=this.dataSource.pageSize();return t=e>r?e-r:r-e-1,t>o?o:t},scrollIntoView:function(e){var t=this.wrapper[0],r=t.clientHeight,o=this._isScrolledToBottom()?t.scrollTop:this._scrollTop||t.scrollTop,l=e[0].offsetTop,a=e[0].offsetHeight;o>l?this.verticalScrollbar[0].scrollTop-=r/2:l+a>=o+r&&(this.verticalScrollbar[0].scrollTop+=r/2)},_fetch:function(t,r,o){var l=this,a=l.dataSource,n=l.itemHeight,i=a.take(),s=l._rangeStart||a.skip()||0,d=et.floor(t/i)*i,c=!1,u=.33,p=l.verticalScrollbar,h=Ar.webkit?1:0,f=a._isGroupPaged()?a.groupsTotal(!0):a.total();return t<s?(c=!0,s=et.max(0,r-i),l._scrollTop=p.scrollTop()-s*n,l._page(s,i)):r>=s+i&&!o?(c=!0,s=et.min(t,f-i),l._scrollTop=p.scrollTop()>=p[0].scrollHeight-p[0].offsetHeight-h?l.wrapper[0].scrollHeight-l.wrapper[0].offsetHeight:l.dataSource._isGroupPaged()&&t>=f-i?l.wrapper[0].scrollHeight-l.wrapper[0].offsetHeight-(l._scrollTop-l._prevScrollTop):n,l._page(s,i)):!l._fetching&&l.options.prefetch&&(t<d+i-i*u&&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(t,r,o){var l=this,a=!l.options.prefetch,n=l.dataSource,i=n._isGroupPaged();o=Ye(o)?o:e.noop,l.trigger(qt,{skip:t,take:r})||(clearTimeout(l._timeout),l._fetching=!0,l._rangeStart=t,i&&n._groupRangeExists()||!i&&n.inRange(t,r)?(De.ui.progress(e(l.wrapper).parent(),!0),n.range(t,r,function(){De.ui.progress(e(l.wrapper).parent(),!1),o(),l.trigger(Ft)},"page")):(a||De.ui.progress(l.wrapper.parent(),!0),l._timeout=setTimeout(function(){l._scrolling||(a&&De.ui.progress(l.wrapper.parent(),!0),n.range(t,r,function(){De.ui.progress(l.wrapper.parent(),!1),o(),l.trigger(Ft)}))},100)))},repaintScrollbar:function(e){var r,o=this,l="",a=o.options.maxScrollHeight,n=o.dataSource,i=De.support.kineticScrollNeeded?0:De.support.scrollbar(),s=o.wrapper[0],d=o._isScrolledToBottom(),c=o.itemHeight=o.options.itemHeight()||0,u=s.scrollWidth>s.offsetWidth?i:0,p=(n._isGroupPaged()?n.groupsTotal(!0):n.total())*c+u;for(r=0;r<et.floor(p/a);r++)l+='<div style="width:1px;height:'+a+'px"></div>';p%a&&(l+='<div style="width:1px;height:'+p%a+'px"></div>'),o.verticalScrollbar.html(l),!d||o._isScrolledToBottom()||o.dataSource._isGroupPaged()||o.scrollToBottom(),t!==o._scrollTop&&e&&(s.scrollTop=o._scrollTop,o._scrollWrapperOnColumnResize())},refresh:function(e){var r=this,o=r.dataSource,l=r._rangeStart,a=(e||{}).action,n=r._isScrolledToBottom()||!a||a!==Mt&&a!==vt&&a!==Pt;De.ui.progress(r.wrapper.parent(),!1),clearTimeout(r._timeout),r.repaintScrollbar(n),r.drag&&r.drag.cancel(),t===l||r._fetching||((!a||a!==Pt&&a!==Mt&&"expandGroup"!==a)&&(r._rangeStart=o.skip()),1!==o.page()||a&&(a===Pt||a===Mt||"expandGroup"===a||"collapseGroup"===a)||(r.verticalScrollbar[0].scrollTop=0)),r._fetching=!1}}),Ur={create:{text:"Add new record",className:"k-grid-add",iconClass:"k-icon k-i-plus"},cancel:{text:"Cancel changes",className:"k-grid-cancel-changes",iconClass:"k-icon k-i-cancel"},save:{text:"Save changes",className:"k-grid-save-changes",iconClass:"k-icon k-i-check"},destroy:{text:"Delete",className:"k-grid-delete",iconClass:"k-icon k-i-close"},edit:{text:"Edit",className:"k-grid-edit",iconClass:"k-icon k-i-edit"},update:{text:"Update",className:"k-primary k-grid-update",iconClass:"k-icon k-i-check"},canceledit:{text:"Cancel",className:"k-grid-cancel",iconClass:"k-icon k-i-cancel"},excel:{text:"Export to Excel",className:"k-grid-excel",iconClass:"k-icon k-i-file-excel"},pdf:{text:"Export to PDF",className:"k-grid-pdf",iconClass:"k-icon k-i-file-pdf"},search:{text:"Search...",className:"k-grid-search"}},Kr=De.ui.DataBoundWidget.extend({init:function(t,r,o){var l=this;r=je(r)?{dataSource:r}:r,We.fn.init.call(l,t,r),o&&(l._events=o),qr=De.support.isRtl(t),l._element(),l._aria(),l._columns(e.extend(!0,[],l.options.columns)),l._dataSource(),l._tbody(),l._thead(),l._groupable(),l._toolbar(),l._pageable(),l._setContentHeight(),l._templates(),l._navigatable(),l._selectable(),l._clipboard(),l._details(),l._editable(),l._attachCustomCommandsEvent(),l._adaptiveColumns(),l._minScreenSupport(),l.options.autoBind?l.dataSource.fetch():(l._group=l._groups()>0,l._footer()),l.lockedContent&&(l.wrapper.addClass("k-grid-lockedcolumns"),l._resizeHandler=function(){l.resize()},e(window).on("resize"+ft,l._resizeHandler)),De.notify(l)},events:[Ht,"dataBinding","cancel",zt,Lt,Dt,wt,Ct,St,yt,Tt,kt,_t,bt,vt,Et,xt,Yt,Xt,It,Rt,Zt,er,tr,"page","sort","filter","group","groupExpand","groupCollapse","kendoKeydown"],setDataSource:function(e){var t,r=this,o=r.options.scrollable;r.options.dataSource=e,r._dataSource(),r._pageable(),r._thead(),o&&(o.virtual?(t=r.content.find(">.k-virtual-scrollable-wrap"),t.scrollLeft(Te(t,qr))):(t=r.tbody,r.content.scrollLeft(Te(t,qr)))),r.options.groupable&&r._groupable(),r.virtualScrollable&&r.virtualScrollable.setDataSource(r.options.dataSource),r.options.navigatable&&r._navigatable(),r.options.selectable&&r._selectable(),r.options.autoBind&&r.dataSource.fetch()},options:{name:"Grid",columns:[],toolbar:null,autoBind:!0,filterable:!1,scrollable:!0,sortable:!1,selectable:!1,allowCopy:!1,navigatable:!1,pageable:!1,persistSelection:!1,editable:!1,groupable:!1,rowTemplate:"",altRowTemplate:"",search:!1,noRecords:!1,dataSource:{},height:null,resizable:!1,reorderable:!1,columnMenu:!1,detailTemplate:null,columnResizeHandleWidth:3,mobile:"",messages:{editable:{cancelDelete:Sr,confirmation:wr,confirmDelete:yr},commands:{create:Ur.create.text,cancel:Ur.cancel.text,save:Ur.save.text,destroy:Ur.destroy.text,edit:Ur.edit.text,update:Ur.update.text,canceledit:Ur.canceledit.text,excel:Ur.excel.text,pdf:Ur.pdf.text,search:Ur.search.text},noRecords:Cr,expandCollapseColumnHeader:"",groupHeader:"Press ctrl + space to group",ungroupHeader:"Press ctrl + space to ungroup"},width:null},destroy:function(){var t,r=this;r._angularItems("cleanup"),r._destroyColumnAttachments(),We.fn.destroy.call(r),this._navigatableTables&&(this._navigatableTables.off(ft),this._navigatableTables=null),r._resizeHandler&&e(window).off("resize"+ft,r._resizeHandler),r.pager&&r.pager.element&&r.pager.destroy(),r.timer&&clearTimeout(r.timer),r._progressTimeOut&&clearTimeout(r._progressTimeOut),r._collapseGroupsTimeOut&&clearTimeout(r._collapseGroupsTimeOut),r._endlessFetchTimeOut&&clearTimeout(r._endlessFetchTimeOut),r.pager=null,r._destroyGroupable(),r.options.reorderable&&r.wrapper.data("kendoReorderable").destroy(),r.selectable&&r.selectable.element&&(r.selectable.destroy(),r.clearArea(),r._selectedIds=null,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._destroyVirtualScrollable(),r.editableUserEvents&&(r.editableUserEvents.destroy(),r.editableUserEvents=null),r._lockedContentUserEvents&&(r._lockedContentUserEvents.destroy(),r._lockedContentUserEvents=null),r._destroyEditable(),r.dataSource&&(r.dataSource.unbind(Ht,r._refreshHandler).unbind(rt,r._progressHandler).unbind(ot,r._errorHandler).unbind(br,r._clearSortClasses),r._refreshHandler=r._progressHandler=r._errorHandler=r._clearSortClasses=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._isMobile&&(r.wrapper.off("transitionend"+ft),r.wrapper.off("contextmenu"+ft)),r.minScreenResizeHandler&&e(window).off("resize",r.minScreenResizeHandler),r._detachColumnMediaResizeHandler(),r._draggableInstance&&r._draggableInstance.element&&r._draggableInstance.destroy(),r._draggableInstance=null,t.off(ft),De.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._groupRows=r._setContentWidthHandler=null},getOptions:function(){var r,o,l,a=this.options;return a.dataSource=null,r=Ne(!0,{},this.options),r.columns=De.deepExtend([],this.columns),o=this.dataSource,l=o.options.data&&o._data,o.options.data=null,r.dataSource=e.extend(!0,{},o.options),o.options.data=l,r.dataSource.data=l,r.dataSource.page=o.page(),r.dataSource.filter=e.extend(!0,{},o.filter()),r.dataSource.pageSize=o.pageSize(),r.dataSource.sort=o.sort(),r.dataSource.group=o.group(),r.dataSource.aggregate=o.aggregate(),r.dataSource.transport&&(r.dataSource.transport.dataSource=null),r.pageable&&r.pageable.pageSize&&(r.pageable.pageSize=o.pageSize()),r.$angular=t,r},setOptions:function(e){ var t,r,o,l,a=this.getOptions();De.deepExtend(a,e),e.dataSource||(a.dataSource=this.dataSource),t=this.wrapper,r=this._events,o=this.element,this.destroy(),this.options=null,this._isMobile&&(l=t.closest(De.roleSelector("pane")).parent(),l.after(t),l.remove(),t.removeClass("k-grid-mobile")),t[0]!==o[0]&&(t.before(o),t.remove()),o.empty(),this.init(o,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){var r=this;return t.children().filter(function(){var t=e(this);return!(!r.dataSource._isGroupPaged()&&t.hasClass("k-grouping-row")||t.hasClass("k-detail-row")||t.hasClass("k-group-footer"))})},dataItems:function(){var e,t,r,o=De.ui.DataBoundWidget.fn.dataItems.call(this);if(this.lockedContent){for(e=o.length,t=Array(2*e),r=e;--r>=0;)t[r]=t[r+e]=o[r];o=t}return o},_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"),o=t.data("kendoColumnSorter"),l=t.data("kendoColumnMenu");r&&r.destroy(),o&&o.destroy(),l&&l.destroy()}))},_attachCustomCommandsEvent:function(){var e,t,r,o=this,l=J(o.columns||[]);for(t=0,r=l.length;t<r;t++)e=l[t].command,e&&d(o,o.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("<table />").appendTo(t.element))),Pr&&r.attr("cellspacing",0),t.table=r.attr("role",t._hasDetails()?"treegrid":"grid"),t._wrapper()},_createResizeHandle:function(t,r){var o,l,a,n,i,s,d,c,u,p,h=this,f=h.options.columnResizeHandleWidth,g=h.options.scrollable,m=h.resizeHandle,k=3*f/2,_=0;m&&h.lockedContent&&m.data("th")[0]!==r[0]&&(m.off(ft).remove(),m=null),m||(m=h.resizeHandle=e('<div class="k-resize-handle"><div class="k-resize-handle-inner"></div></div>'),t.append(m)),c=t.scrollLeft(),d=parseFloat(t.css("borderLeftWidth")),u=r.offset().left+c-parseFloat(r.css("marginLeft"))-(t.offset().left+d),qr?g&&(_=u<=c?k:0,o=r.closest(".k-grid-header-wrap, .k-grid-header-locked"),s=o[0].scrollWidth-o[0].offsetWidth,i=parseFloat(o.css("marginLeft")),l=Ar.msie?2*o.scrollLeft()+d-i-_:0,a=Ar.webkit?s-_-i+d:0,n=Ar.mozilla?d-i-_:0,u-=a+n+l):u+=r[0].offsetWidth,p=r.offset().top-parseFloat(r.css("marginTop"))-(t.offset().top+parseFloat(t.css("borderTopWidth"))),m.css({top:p,left:u-k,height:Be(r),width:3*f-_}).data("th",r).show(),m.off("dblclick"+ft).on("dblclick"+ft,function(){h._autoFitLeafColumn(parseInt(r.attr(De.attr("index")),10))})},_positionColumnResizeHandle:function(){var r=this,o=r.lockedHeader?r.lockedHeader.find("thead:first"):e();r.thead.add(o).on("mousemove"+ft,"tr:not(.k-filter-row) > th",function(o){var l=t!==o.buttons?o.buttons:o.which||o.button,a=e(this);a.hasClass("k-group-cell")||a.hasClass("k-hierarchy-cell")||t!==l&&0!==l||a[0].hasAttribute(De.attr(mr))||r._createResizeHandle(a.closest("div"),a)})},_resizeHandleDocumentClick:function(t){e(t.target).closest(".k-column-active").length||(e(document).off(t),this._resetResizeHandleHeader(),this._hideResizeHandle())},_resetResizeHandleHeader:function(){var t;this.resizeHandle&&(t=e(this.resizeHandle).data("th"),t&&(t.find(tt+Ut).find(tt+Kt).show(),t.find(tt+jt).show(),t.find(tt+$t).show(),t.find(tt+Qt).show()))},_hideResizeHandle:function(){this.resizeHandle&&(this.resizeHandle.data("th").removeClass("k-column-active"),this.lockedContent&&!this._isMobile?(this.resizeHandle.off(ft).remove(),this.resizeHandle=null):this.resizeHandle.hide())},_positionColumnResizeHandleTouch:function(){var t=this,r=t.lockedHeader?t.lockedHeader.find("thead:first"):e();t._resizeUserEvents=new De.UserEvents(r.add(t.thead),{filter:"th:not(.k-group-cell):not(.k-hierarchy-cell)",threshold:10,minHold:500,hold:function(r){var o=e(r.target);r.preventDefault(),t.resizeHandle&&(t.resizeHandle.data("th").removeClass("k-column-active"),t._resetResizeHandleHeader()),o.addClass("k-column-active"),o.find(tt+Ut).find(tt+Kt).hide(),o.find(tt+jt).hide(),o.find(tt+$t).hide(),o.find(tt+Qt).hide(),t._createResizeHandle(o.closest("div"),o),t._resizeHandleDocumentClickHandler||(t._resizeHandleDocumentClickHandler=Je(t._resizeHandleDocumentClick,t)),e(document).on("click",t._resizeHandleDocumentClickHandler)}})},resizeColumn:function(r,o){var l,a,n,i,s=this,d=!!r.locked,c=!!r.hidden,u=this.options,p=De.support.mobileOS?0:De.support.scrollbar(),h=d?$e(r,j(s.columns)):$e(r,K(s.columns)),f=d?s.lockedTable:s.table,g=s.footer||e(),m=d?s.lockedHeader.find("table"):s.thead.closest("table"),k=r.minResizableWidth||10,_=Ve(d?f.find("tbody"):s.tbody);return c?(r.width=o>k?o:k,t):(s.footer&&s.lockedContent&&(g=s.footer.children(d?".k-grid-footer-locked":".k-grid-footer-wrap")),l=u.scrollable?m.find("col:not(.k-group-col,.k-hierarchy-col):eq("+h+")").add(f.children("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+h+")")).add(g.find("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+h+")")):f.find("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+h+")"),u.scrollable?(a=!1,n=s.wrapper.width()-p,i=o=o>k?o:k,d&&_-o+i>n&&(i=o+(n-_-2*p),i<0&&(i=o),a=!0),i>10&&i>=k&&(l.css("width",i),_&&(i=a?n-2*p:_+(o-r.width),f.add(m).add(g).css("width",i),d||(s._footerWidth=i))),s._scrollVirtualWrapperOnColumnResize()):o>10&&o>=k&&l.css("width",o),r.width=o,s._applyLockedContainersWidth(),s._syncLockedContentHeight(),s._syncLockedHeaderHeight(),t)},_resizable:function(){var t,r,o,l,n,i,s,d,c=this,u=c.options,p=this._isMobile,h=De.support.mobileOS?0:De.support.scrollbar();u.resizable&&(t=u.scrollable?c.wrapper.find(".k-grid-header-wrap:first"):c.wrapper,p?c._positionColumnResizeHandleTouch(t):c._positionColumnResizeHandle(t),c.resizable&&c.resizable.destroy(),c.resizable=new Me.Resizable(t.add(c.lockedHeader),{handle:(u.scrollable?"":">")+".k-resize-handle",hint:function(t){return e('<div class="k-grid-resize-indicator" />').css({height:Be(t.data("th"))+c.tbody.attr("clientHeight")})},start:function(t){var h,f,g,m,k;d=e(t.currentTarget).data("th"),p&&c._hideResizeHandle(),h=d.closest("table"),f=e.inArray(d[0],X(d.closest("thead")).filter(":visible")),i=h.parent().hasClass("k-grid-header-locked"),g=i?c.lockedTable:c.table,m=c.footer||e(),c.footer&&c.lockedContent&&(m=c.footer.children(i?".k-grid-footer-locked":".k-grid-footer-wrap")),a(c.wrapper,"col-resize"),s=u.scrollable?h.find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+f+")").add(g.children("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+f+")")).add(m.find("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+f+")")):g.children("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+f+")"),k=e.map(c.columns,function(e){return!e.hidden&&(i&&e.locked||!i&&!e.locked)?e:null}),r=t.x.location,o=Ve(d),l=J(k)[f].minResizableWidth||10,n=Ve(i?g.children("tbody"):c.tbody),Ar.webkit&&c.wrapper.addClass("k-grid-column-resizing")},resize:function(t){var a,p,f,g,m,k,_=qr?-1:1,b=o+t.x.location*_-r*_;u.scrollable?(i&&c.lockedFooter?a=c.lockedFooter.children("table"):c.footer&&(a=c.footer.find(">.k-grid-footer-wrap>table")),a&&a[0]||(a=e()),p=d.closest("table"),f=i?c.lockedTable:c.table,g=!1,m=c.wrapper.width()-h,k=b,i&&n-o+k>m&&(k=o+(m-n-2*h),k<0&&(k=b),g=!0),k>10&&k>=l&&(s.css("width",k),n&&(k=g?m-2*h:n+t.x.location*_-r*_,f.add(p).add(a).css("width",k),i||(c._footerWidth=k))),c._scrollVirtualWrapperOnColumnResize()):b>10&&b>=l&&s.css("width",b)},resizeend:function(){var e,t,r,l=Ve(d);a(c.wrapper,""),Ar.webkit&&c.wrapper.removeClass("k-grid-column-resizing"),o!=l&&(t=c.lockedHeader?c.lockedHeader.find("thead:first tr:first").add(c.thead.find("tr:first")):d.parent(),r=d.attr(De.attr("index")),r||(r=t.find("th:not(.k-group-cell):not(.k-hierarchy-cell)").index(d)),e=J(c.columns)[r],e.width=l,c.trigger(Yt,{column:e,oldWidth:o,newWidth:l}),c._applyLockedContainersWidth(),c._syncLockedContentHeight(),c._syncLockedHeaderHeight()),c._resetResizeHandleHeader(),c._hideResizeHandle(),d=null}}))},_draggable:function(){var t,r=this;r.options.reorderable&&(r._draggableInstance&&r._draggableInstance.destroy(),t=r.wrapper.children(".k-grid-header"),r._draggableInstance=r.wrapper.kendoDraggable({group:De.guid(),autoScroll:!0,filter:r.content?".k-grid-header:first "+ht:"table:first>.k-grid-header "+ht,dragstart:function(){t.children(".k-grid-header-wrap").unbind("scroll"+ft+"scrolling").bind("scroll"+ft+"scrolling",function(e){r.virtualScrollable?r.content.find(">.k-virtual-scrollable-wrap").scrollLeft(this.scrollLeft):r.scrollables.not(e.currentTarget).scrollLeft(this.scrollLeft)})},dragend:function(){r._resetResizeHandleHeader(),t.children(".k-grid-header-wrap").unbind("scroll"+ft+"scrolling")},drag:function(){r._hideResizeHandle()},hint:function(t){var r=t.attr(De.attr("title"));return r&&(r=De.htmlEncode(r)),e('<div class="k-header k-reorder-clue k-drag-clue" />').html(r||t.attr(De.attr("field"))||t.text()).prepend('<span class="k-icon k-drag-status k-i-cancel"></span>')}}).data("kendoDraggable"))},_reorderable:function(){var t=this;t.options.reorderable&&(t.wrapper.data("kendoReorderable")&&t.wrapper.data("kendoReorderable").destroy(),t.wrapper.kendoReorderable({draggable:t._draggableInstance,dragOverContainers:function(e,r){var o=M(t.columns);return o[e].lockable!==!1&&F(o,t.columns,e,r)>-1},inSameContainer:function(r){return e(r.source).parent()[0]===e(r.target).parent()[0]&&F(M(t.columns),t.columns,r.sourceIndex,r.targetIndex)>-1},change:function(e){var r=M(t.columns),o=r[e.oldIndex],l=F(r,t.columns,e.oldIndex,e.newIndex);t.trigger(Xt,{newIndex:l,oldIndex:$e(o,r),column:o}),t.reorderColumn(l,o,"before"===e.position)}}))},_reorderHeader:function(e,t,r,o){var l,a,n,d,c,u=this,p=E(e[0],u.columns),h=E(t,u.columns),f=[];for(n=0;n<e.length;n++)e[n].columns&&(f=f.concat(e[n].columns));a=o?s(o,o,"tr:eq("+p.row+")>th.k-header:not(.k-group-cell,.k-hierarchy-cell)"):s(u.lockedHeader,u.thead,"tr:eq("+p.row+")>th.k-header:not(.k-group-cell,.k-hierarchy-cell)"),d=N(e).length,c=N([t]).length,f.length?(d>0&&0===c?(l="prepend",x(e,t,f,u.columns,u.lockedHeader.find("thead"),u.thead,this._groups(),l)):0===d&&c>0&&(l=0!==h.cell||!e[0].columns||t.columns||u._group?"append":"prepend",x(e,t,f,U(u.columns),u.thead,u.lockedHeader.find("thead"),this._groups(),l)),(t.columns||p.cell-h.cell>1||h.cell-p.cell>1)&&(t=L(u.columns,t,e[0],r,u.columns),t&&(d>0&&0===c?u._reorderHeader(f,t,r,u.thead):0===d&&c>0?u._reorderHeader(f,t,r,u.lockedHead):u._reorderHeader(f,t,r)))):d!==c&&T(a[p.cell],u.columns,d),i(a,p.cell,h.cell,r,e.length)},_reorderContent:function(t,r,o){var l,a,n,d,c,u,p=this,h=e(),f=t[0],g=w(t),m=$e(f,J(p.columns)),k=$e(r,J(p.columns)),_=$e(g[0],$(p.columns)),b=$e(r,$(p.columns)),v=N(p.columns).length,C=!!r.locked,y=p.footer||p.wrapper.find(".k-grid-footer"),S=l=b;for(r.hidden&&(n=C?N(p.columns):U(p.columns),w(n).length>0?(S=l=b=this._findClosestVisibleColumnIndex(n,k),a=w(n.slice(k)).length>0):C?(b=p.lockedTable.find("colgroup"),S=p.lockedHeader.find("colgroup"),l=e(p.lockedFooter).find(">table>colgroup")):(b=p.tbody.prev(),S=p.thead.prev(),l=y.find(".k-grid-footer-wrap").find(">table>colgroup"))),p._hasFilterRow()&&i(p.wrapper.find(".k-filter-row th:not(.k-group-cell,.k-hierarchy-cell)"),m,k,o,t.length),_>=0&&i(s(p.lockedHeader,p.thead.prev(),"col:not(.k-group-col,.k-hierarchy-col)"),_,S,a?a:o,g.length),p.options.scrollable&&_>=0&&!p._hasVirtualColumns()&&i(s(p.lockedTable,p.tbody.prev(),"col:not(.k-group-col,.k-hierarchy-col)"),_,b,a?a:o,g.length),y&&y.length&&(_>=0&&i(s(p.lockedFooter,y.find(".k-grid-footer-wrap"),">table>colgroup>col:not(.k-group-col,.k-hierarchy-col)"),_,l,a?a:o,g.length),i(y.find(".k-footer-template>td:not(.k-group-cell,.k-hierarchy-cell)"),m,k,o,t.length)),d=p.tbody.children(":not(.k-grouping-row,.k-detail-row)"),p.lockedTable&&(v>k?v<=m&&fe(p.lockedTable.find(">tbody>tr.k-grouping-row"),p.table.find(">tbody>tr.k-grouping-row"),t.length):v>m&&fe(p.table.find(">tbody>tr.k-grouping-row"),p.lockedTable.find(">tbody>tr.k-grouping-row"),t.length),h=p.lockedTable.find(">tbody>tr:not(.k-grouping-row,.k-detail-row)")),c=0,u=d.length;c<u;c+=1)i(s(h[c],d[c],">td:not(.k-group-cell,.k-hierarchy-cell)"),m,k,o,t.length)},_findClosestVisibleColumnIndex:function(e,t){var r=w(e.slice(t)).length>0?e.slice(t):e.slice(0,t+1).reverse(),o=w(r)[0];return $e(o,w(this.columns))},_autoFitLeafColumn:function(e){this.autoFitColumn(J(this.columns)[e])},autoFitColumn:function(t){var r,o,l,a,n,i,s,d,c,u,p,h,f,g,m,k,b,w,C,y,S=this,T=S.options,x=S.columns,H=S.lockedHeader?X(S.lockedHeader.find(">table>thead")).filter(_).length:0,R="col:not(.k-group-col):not(.k-hierarchy-col)",I="td:visible:not(.k-group-cell):not(.k-hierarchy-cell)";if(t="number"==typeof t?x[t]:Ge(t)?Ke(q(x),function(e){return e===t})[0]:Ke(q(x),function(e){return e.field===t})[0],t&&v(t)){for(i=t.minResizableWidth,r=$e(t,J(x)),a=t.locked,l=a?S.lockedHeader.children("table"):S.thead.parent(),o=l.find("[data-index='"+r+"']"),c=a?S.lockedTable:S.table,u=S.footer||e(),S.footer&&S.lockedContent&&(u=S.footer.children(a?".k-grid-footer-locked":".k-grid-footer-wrap")),p=u.find("table").first(),S.lockedHeader&&!a&&(r-=H),h=0;h<x.length&&x[h]!==t;h++)x[h].hidden&&r--;if(T.scrollable?(n=l.find(R).eq(r).add(c.children("colgroup").find(R).eq(r)).add(p.find("colgroup").find(R).eq(r)),a||(s=c.parent(),d=s.scrollLeft())):n=c.children("colgroup").find(R).eq(r),f=l.add(c).add(p),Ar.safari&&o.css("white-space","initial"),g=Ve(o),n.width(""),f.css("table-layout","fixed"),n.width("auto"),f.addClass("k-autofitting"),f.css("table-layout",""),m=Math.ceil(Math.max(Ve(o),Ve(c.find("tr:not(.k-grouping-row)").eq(0).children(I).eq(r)),Ve(p.find("tr").eq(0).children(I).eq(r))))+1,i&&i>m&&(m=i),n.width(m),t.width=m,Ar.safari&&o.css("white-space",""),T.scrollable){for(k=l.find("col"),w=0,C=0,y=k.length;C<y;C+=1)if(b=k[C].style.width,b&&b.indexOf("%")==-1)w+=parseInt(b,10);else{if(!k.eq(C).hasClass("k-group-col")){w=0;break}w+=parseInt(k.eq(C).width(),10)}w&&f.each(function(){this.style.width=w+"px"})}Ar.msie&&8==Ar.version&&(f.css("display","inline-table"),setTimeout(function(){f.css("display","table")},1)),f.removeClass("k-autofitting"),d&&s.scrollLeft(d),S.trigger(Yt,{column:t,oldWidth:g,newWidth:m}),S._applyLockedContainersWidth(),S._syncLockedContentHeight(),S._syncLockedHeaderHeight()}},reorderColumn:function(e,r,o){var l,a,n=this,i=u(r,n.columns),s=i?i.columns:n.columns,d=$e(r,s),c=s[e],p=n.virtualScroll||{},h=!!c.locked,f=N(n.columns).length,g=Ke(J(n.columns),function(e){return e.groupHeaderColumnTemplate});d!==e&&(!r.locked&&h&&1==U(n.columns).length||r.locked&&!h&&1==f||(n._hideResizeHandle(),o===t&&(o=e<d),a=[r],n._reorderHeader(a,c,o),n.lockedHeader&&(O(n.thead),O(n.lockedHeader)),c.columns&&(c=J(c.columns),c=c[o?0:c.length-1]),r.columns&&(a=J(r.columns)),n._reorderContent(a,c,o),l=!!r.locked,l=l!=h,r.locked=h,s.splice(o?e:e+1,0,r),s.splice(d<e?d:d+1,1),n._updateLockedCols(),n._updateCols(),n._templates(),n._updateColumnCellIndex(),n._updateColumnSorters(),g.length>0&&n._renderGroupRows(),n._updateTablesWidth(),n._applyLockedContainersWidth(),n._syncLockedHeaderHeight(),n._syncLockedContentHeight(),n._updateFirstColumnClass(),p.columns&&n.refresh(),l&&(h?n.trigger(Zt,{column:r}):n.trigger(er,{column:r}))))},_updateColumnCellIndex:function(){var e,t=0;this.lockedHeader&&(e=this.lockedHeader.find("thead"),t=H(e,N(this.columns))),H(this.thead,U(this.columns),t)},lockColumn:function(e){var t,r=this.columns;e="number"==typeof e?r[e]:Ke(r,function(t){return t.field===e})[0],!e||e.locked||e.hidden||(t=N(r).length-1,this.reorderColumn(t,e,!1))},unlockColumn:function(e){var t,r=this.columns;e="number"==typeof e?r[e]:Ke(r,function(t){return t.field===e})[0],e&&e.locked&&!e.hidden&&(t=N(r).length,this.reorderColumn(t,e,!0))},cellIndex:function(t){var r=0;return this.lockedTable&&!e.contains(this.lockedTable[0],t[0])&&(r=J(N(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(De.attr("uid"));return this.dataSource.getByUid(r)},_editable:function(){var t,r=this,o=r.options.editable,l=function(){var t=Pe(),o=r._editContainer;o&&o[0]&&!e.contains(o[0],t)&&o[0]!==t&&!e(t).closest(".k-animation-container").length&&(r.editable.end()?r.closeCell():r._scrollVirtualWrapper())};o&&(this.wrapper.addClass("k-editable"),t=r._editMode(),"incell"===t?(r.table.add(r.lockedTable).on("mousedown"+ft,it+">"+st,function(t){var o=e(t.target);"incell"===r._editMode()&&o.hasClass("k-checkbox")&&o.prev().attr(De.attr("bind"))&&t.preventDefault()}),o.update!==!1&&(Br&&r.wrapper.on(rr+ft,".k-edit-cell > input[type='checkbox']",function(t){e(t.target).focus()}).on(rr+ft,".k-edit-cell",function(t){e(t.target).is("input")||e(t.currentTarget).find("input[type='checkbox']").focus()}).on(or+ft,"tr:not(.k-grouping-row) > td",function(t){var o=r._editContainer;r._mousedownOnEditCell=!(!o||!o[0]||!e.contains(o[0],t.target)&&o[0]!==t.target)}),r.editableUserEvents=new De.UserEvents(r.wrapper,{filter:"tr:not(.k-grouping-row) > td",allowSelection:!0,tap:function(t){var o=e(t.target),l=r.lockedTable&&o.closest("table")[0]===r.lockedTable[0];r._mousedownOnEditCell=!1,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]&&!l||e(t.target).is(":input")||(r.editable?r.editable.end()?(e(Pe()).blur(),r.closeCell(),r.editCell(o)):r._scrollVirtualWrapper():r.editCell(o))}}),r.wrapper.on("focusin"+ft,function(){e.contains(this,Pe())||(clearTi