@progress/kendo-ui
Version:
This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.
2 lines • 149 kB
JavaScript
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(1200)},3:function(e,t){e.exports=function(){throw Error("define cannot be used indirect")}},1005:function(e,t){e.exports=require("jquery")},1015:function(e,t){e.exports=require("./kendo.data")},1030:function(e,t){e.exports=require("./kendo.selectable")},1043:function(e,t){e.exports=require("./kendo.filtermenu")},1142:function(e,t){e.exports=require("./kendo.resizable")},1143:function(e,t){e.exports=require("./kendo.window")},1193:function(e,t){e.exports=require("./kendo.pdf")},1196:function(e,t){e.exports=require("./kendo.columnsorter")},1198:function(e,t){e.exports=require("./kendo.editable")},1200:function(e,t,r){var o,l,a;(function(n){!function(n,define){l=[r(1015),r(1196),r(1198),r(1143),r(1043),r(1201),r(1202),r(1203),r(1030),r(1204),r(1205),r(1142),r(1206),r(1207),r(1208),r(1209),r(1193)],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"["+xe.attr(e)+"="+t+"]"}function o(e){return Array(e+1).join('<td class="k-group-cell"> </td>')}function l(e){var t,r=" ";if(e){if(typeof e===tr)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=Ve(r)?r:[r],o=0,l=r.length;o<l;o++)a=r[o],Ae(a)&&a.click&&(n=a.name||a.text,t.on(Jt+st,"a.k-grid-"+(n||"").replace(/\s/g,""),{commandName:n},Ge(a.click,e)))}function c(e,t,r){return Pe(e,function(e){var o,l;return e=typeof e===tr?{field:e}:e,v(e)&&!r||(e.attributes=Z(e.attributes),e.footerAttributes=Z(e.footerAttributes),e.headerAttributes=Z(e.headerAttributes),o=!0),e.columns&&(e.columns=c(e.columns,t,o)),l=xe.guid(),e.headerAttributes=We({id:l},e.headerAttributes),We({encoded:t,hidden:o},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?ee:Z;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)&&xe.matchesMedia(e.media))}function b(){return"none"!==this.style.display}function _(t){return"none"!==e(t)[0].style.display}function v(e){return w([e]).length>0}function w(e){return Be(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(G(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 H(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"> </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 x(t,r,o){var l,a,n,i,s,d,c,u;for(o=o||0,n=r,r=$(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=z(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(xe.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=F(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 z(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=z(e,t[a].columns,r+1,o)))break;o[r]++}return l}function E(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 D(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=Oe(t,n),0===i&&o?i++:i==n.length-1&&!o||!r.locked&&!t.columns&&!o?i--:(i>0||0===i&&!o)&&i++,s=Oe(r,n),t=E(n,i,r,s>i),d=Oe(t,l),(!t.columns||d&&d!==n.length-1)&&t&&t!=r&&t.columns?D(e,t,r,o,l):null)}function F(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=F(e,t[a].columns,r+1,o)))break;t[a].hidden||o[r]++}return l}function M(e){var t=L(N(e));return t.concat(L(G(e)))}function q(e,t,r,o){var l=e[r],a=e[o],n=u(l,t);return t=n?n.columns:t,Oe(a,t)}function L(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(L(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 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 P(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 V(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 O(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&&O(s,t,r,o+1,l+e.length)}function N(e){return Be(e,function(e){return e.locked})}function G(e){return Be(e,function(e){return!e.locked})}function K(e){return Be(e,function(e){return!e.locked&&v(e)})}function j(e){return Be(e,function(e){return e.locked&&v(e)})}function U(e){var t,r=[];for(t=0;t<e.length;t++)e[t].hidden||(e[t].columns?r=r.concat(U(e[t].columns)):r.push(e[t]));return r}function $(e){var t,r=[];for(t=0;t<e.length;t++)e[t].columns?r=r.concat($(e[t].columns)):r.push(e[t]);return r}function Q(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=xe.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 J(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=J(s).add(c);break}}return c}function Y(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=xe.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(Y(r)),s=parseInt(r.attr(f),10),s>1&&(i-=s-1),l++}return c}function X(t,r,o,l){var a,n=t;return l&&t.empty(),Ee?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 Z(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",We({},e,{style:t})}function ee(e){e=e||{};var t=e.style;return t&&(e.style=t.replace(/(display\s*:\s*none\s*;?)*/gi,"")),e}function te(t,r,o,l){var a,n=t.find(">colgroup"),i=Pe(r,function(e){return a=e.width,a&&0!==parseInt(a,10)?xe.format('<col style="width:{0}"/>',typeof a===tr?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),zr.msie&&8==zr.version&&(t.css("display","inline-table"),window.setTimeout(function(){t.css("display","")},1))}function re(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 oe(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 le(e,t,r,o){var l=r&&r.length&&Ae(r[0])&&"value"in r[0],a=l?oe(r)[e]:e;return a=null!=a?a:"",t?xe.format(t,a):o===!1?a:xe.htmlEncode(a)}function ae(e,t,r){for(var o,l=0,a=e[l];a;){if(o=!!r||"none"!==a.style.display,o&&!Sr.test(a.className)&&--t<0){a.style.display=r?"":"none";break}a=e[++l]}}function ne(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")),ae(l[0].cells,r,!1))}function ie(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(ie(t.items)));return o}function se(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(se(t.items))),o.push(t.aggregates);return o}function de(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),te(o.find(">form>table"),w(a),!1,0),l=o.find("tr:first")),ae(l[0].cells,r,!0))}function ce(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 ue(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 pe(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],Tr.test(l.className)&&(l=t.rows[t.rows.length-2]),a=r-o):(l=e.rows[e.rows.length-1],Tr.test(l.className)&&(l=e.rows[e.rows.length-2]),a=o-r),l.style.height=l.offsetHeight+a+"px")}function he(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 fe(e,t){var r,o,l;if(typeof e===tr&&e===t)return e;if(Ae(e)&&e.name===t)return e;if(Ve(e))for(r=0,o=e.length;r<o;r++)if(l=e[r],typeof l===tr&&l===t||l.name===t)return l;return null}function ge(t,r){if(r===!0){t=e(t);var o=t.parent().scrollLeft();xe.focusElement(t),t.parent().scrollLeft(o)}else e(t).one("focusin",function(e){e.preventDefault()}).focus()}function me(e,r){return e.options.groupable&&(r.groupable||r.groupable===t)}function ke(t,r){return!!e.grep(t,function(e){return e.field===r}).length}function be(e,t){return!(!e.field||e.selectable)&&(!(t.editable&&!t.editable(e.field))&&!(e.editable&&!e.editable(t)))}function _e(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 ve(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=_e(r.target),s=e(r.target).is(".k-checkbox-label, .k-checkbox"),d=e(r.target),c=o.closest("table")[0];return i&&o.find(xe.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(){Dr&&e(xe._activeElement()).hasClass("k-widget")||!e(xe._activeElement()).is(At)&&_e(xe._activeElement())&&e.contains(c,xe._activeElement())||ge(c,!0)}),l&&!xe.support.touch&&r.preventDefault()),t)}function we(e,t){if(!t)return 0;var r=0;return xe.support.browser.webkit&&(r=e.width()),r}function Ce(e){return e&&(e.hasClass("k-edit-cell")||e.parent().hasClass("k-grid-edit-row"))}function ye(e){return'<td colspan="#=data.colspan +'+e+'#"><p class="k-reset"><a class="k-icon k-i-collapse" href="\\#" tabindex="-1" '+vr+'="'+br+'"></a>#=data.text#</p></td>'}function Se(e){return'<td colspan="'+e+'"><p class="k-reset"> </p></td>'}function Te(e,t,r){return'<tr role="row" class="k-grouping-row">'+o(t)+'<td colspan="'+e+'" aria-expanded="true"><p class="k-reset"><a class="k-icon k-i-collapse" href="#" tabindex="-1" '+vr+'="'+br+'"></a>'+r+"</p></td></tr>"}function He(e){return'<tr role="row" class="k-grouping-row"><td colspan="'+e+'" aria-expanded="true"><p class="k-reset"> </p></td></tr>'}var xe=window.kendo,Re=xe.ui,Ie=xe.data.DataSource,ze=xe.data.ObservableObject,Ee=xe.support.tbodyInnerHtml,De=xe._activeElement,Fe=Re.Widget,Me=xe._outerWidth,qe=xe._outerHeight,Le=xe.keys,Ae=e.isPlainObject,We=e.extend,Pe=e.map,Be=e.grep,Ve=e.isArray,Oe=e.inArray,Ne=Array.prototype.push,Ge=e.proxy,Ke=xe.isFunction,je=e.isEmptyObject,Ue=e.contains,$e=Math,Qe=".",Je="progress",Ye="error",Xe="k-hierarchy-cell",Ze=":not(.k-group-cell):not(.k-hierarchy-cell:not(:has(.k-icon.k-i-collapse,.k-icon.k-i-expand))):visible",et="tbody>tr:not(.k-grouping-row):not(.k-detail-row):not(.k-group-footer) > td:not(.k-group-cell):not(.k-hierarchy-cell)",tt="tr:not(.k-footer-template):visible",rt=":not(.k-group-cell):not(.k-detail-cell):not(.k-hierarchy-cell):visible",ot="tr:not(.k-grouping-row):not(.k-detail-row):not(.k-footer-template):not(.k-group-footer):visible",lt=ot+":first",at=ot+":last",nt=tt+":first>"+rt+":first",it="th.k-header:not(.k-group-cell):not(.k-hierarchy-cell)",st=".kendoGrid",dt="k-grid-content-locked",ct="k-group-cell",ut="edit",pt="beforeEdit",ht="save",ft="remove",gt="detailInit",mt="filterMenuInit",kt="columnMenuInit",bt="filterMenuOpen",_t="columnMenuOpen",vt="cellClose",wt="change",Ct="columnHide",yt="columnShow",St="saveChanges",Tt="dataBound",Ht="detailExpand",xt="detailCollapse",Rt="itemchange",It="page",zt="paging",Et="scroll",Dt="sync",Ft="k-state-focused",Mt=":kendoFocusable",qt="k-state-selected",Lt="k-checkbox",At="input[data-role='checkbox']."+Lt,Wt="k-grid-norecords",Pt="k-link",Bt="k-icon",Vt="k-sort-order",Ot="k-header-column-menu",Nt="k-grid-filter",Gt="resize",Kt="columnResize",jt="columnReorder",Ut="columnLock",$t="columnUnlock",Qt="navigate",Jt="click",Yt="mousedown",Xt="height",Zt="tabIndex",er="function",tr="string",rr="bottom",or="container-for",lr="field",ar="input",nr="incell",ir="inline",sr="uid",dr=1,cr="colSpan",ur="overflow",pr="hidden",hr="group-sort",fr="Are you sure you want to delete this record?",gr="No records available.",mr="Delete",kr="Cancel",br="Collapse",_r="Expand",vr="aria-label",wr=/(\}|\#)/gi,Cr=/#/gi,yr="[\\x20\\t\\r\\n\\f]",Sr=RegExp("(^|"+yr+")(k-group-cell|k-hierarchy-cell)("+yr+"|$)"),Tr=RegExp("(^|"+yr+")(k-filter-row)("+yr+"|$)"),Hr='# 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># } #',xr='# var checkboxGuid = kendo.guid(); #<input class="'+Lt+'" data-role="checkbox" id="#= checkboxGuid #" aria-label="Select row" aria-checked="false" type="checkbox"><label for="#= checkboxGuid #" class="k-checkbox-label k-no-text">&\\#8203;</label>',Rr='# var checkboxGuid = kendo.guid(); #<input class="'+Lt+'" data-role="checkbox" aria-label="Select all rows" aria-checked="false" type="checkbox" id="#= checkboxGuid #"><label for="#= checkboxGuid #" class="k-checkbox-label k-no-text">##&\\#8203;##</label>',Ir=!1,zr=xe.support.browser,Er=zr.msie&&7==zr.version,Dr=zr.msie&&8==zr.version,Fr=zr.msie&&11===zr.version,Mr=/Mac OS/.test(navigator.userAgent),qr={content:"k-content",widget:"k-widget",scrollContainer:"k-scroll-container"},Lr=Fe.extend({init:function(e,t){var r=this;Fe.fn.init.call(r,e,t),r._refreshHandler=Ge(r.refresh,r),r.setDataSource(t.dataSource),r.wrap()},setDataSource:function(e){var t=this;t.dataSource&&t.dataSource.unbind(wt,t._refreshHandler),t.dataSource=e,t.dataSource.bind(wt,t._refreshHandler),t.dataSource.options.useRanges=!0},options:{name:"VirtualScrollable",itemHeight:e.noop,prefetch:!0,maxScrollHeight:25e4},events:[zt,It,Et],destroy:function(){var e=this;Fe.fn.destroy.call(e),e.dataSource.unbind(wt,e._refreshHandler),e.wrapper.add(e.verticalScrollbar).off(st),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=xe.support.scrollbar()+1,l=r.element;l.css({width:"auto",overflow:"hidden"}).css(Ir?"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"+st+" mousewheel"+st,Ge(r._wheelScroll,r)),r._wrapper(),xe.support.kineticScrollNeeded&&(r.drag=new xe.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"+st,Ge(r._scroll,r))},_wrapper:function(){var e=this;Fr&&(e.wrapper.css({"overflow-y":Et}),e.element.css(Ir?"padding-left":"padding-right",0))},_wheelScroll:function(e){if(!e.ctrlKey){var t=this.verticalScrollbar,r=t.scrollTop(),o=xe.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=$e.max($e.floor(l/n),0),p=c?$e.ceil(d/n):$e.floor(d/n),h=$e.max(u+p,0);return r._preventScroll?(r._preventScroll=!1,t):(r._scrollTop=l-s*n,r._scrollbarTop=l,r._scrolling=o,r._fetch(u,h,c)||(r.wrapper[0].scrollTop=r._scrollTop),r.trigger(Et),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+xe.support.scrollbar()),e._scrollTop=t.scrollTop(),e._wrapperScrolled=!0):e._wrapperScrolled&&(e._isWrapperScrolledToBottom()||(t.scrollTop(r-xe.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},_isElementVisible:function(e){return this._isElementVisibleInWrapper(e)},_isElementVisibleInWrapper:function(t){var r,o,l=this,a=l.wrapper;return t=e(t),!!(t[0]&&Ue(a[0],t[0])&&(r=t.offset().top-a.offset().top,o=t.outerHeight()/2,(r>=0||$e.abs(r)<=o)&&$e.floor(r+o)<=a.height()))},position:function(e){var t,r=this._rangeStart||this.dataSource.skip()||0,o=this.dataSource.pageSize();return t=e>r?e-r+1: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=$e.floor(t/i)*i,c=!1,u=.33,p=l.verticalScrollbar,h=zr.webkit?1:0;return t<s?(c=!0,s=$e.max(0,r-i),l._scrollTop=p.scrollTop()-s*n,l._page(s,i)):r>=s+i&&!o?(c=!0,s=$e.min(t,a.total()-i),l._scrollTop=p.scrollTop()>=p[0].scrollHeight-p[0].offsetHeight-h?l.wrapper[0].scrollHeight-l.wrapper[0].offsetHeight: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;o=Ke(o)?o:e.noop,l.trigger(zt,{skip:t,take:r})||(clearTimeout(l._timeout),l._fetching=!0,l._rangeStart=t,n.inRange(t,r)?(xe.ui.progress(e(l.wrapper).parent(),!0),n.range(t,r,function(){xe.ui.progress(e(l.wrapper).parent(),!1),o(),l.trigger(It)})):(a||xe.ui.progress(l.wrapper.parent(),!0),l._timeout=setTimeout(function(){l._scrolling||(a&&xe.ui.progress(l.wrapper.parent(),!0),n.range(t,r,function(){xe.ui.progress(l.wrapper.parent(),!1),o(),l.trigger(It)}))},100)))},repaintScrollbar:function(e){var r,o=this,l="",a=o.options.maxScrollHeight,n=o.dataSource,i=xe.support.kineticScrollNeeded?0:xe.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.total()*c+u;for(r=0;r<$e.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.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!==Rt&&a!==ft&&a!==Dt;xe.ui.progress(r.wrapper.parent(),!1),clearTimeout(r._timeout),r.repaintScrollbar(n),r.drag&&r.drag.cancel(),t===l||r._fetching||((!a||a!==Dt&&a!==Rt)&&(r._rangeStart=o.skip()),1!==o.page()||a&&(a===Dt||a===Rt)||(r.verticalScrollbar[0].scrollTop=0)),r._fetching=!1}}),Ar={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"}},Wr=xe.ui.DataBoundWidget.extend({init:function(t,r,o){var l=this;r=Ve(r)?{dataSource:r}:r,Fe.fn.init.call(l,t,r),o&&(l._events=o),Ir=xe.support.isRtl(t),l._element(),l._aria(),l._columns(e.extend(!0,[],l.options.columns)),l._dataSource(),l._tbody(),l._pageable(),l._thead(),l._groupable(),l._toolbar(),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"+st,l._resizeHandler)),xe.notify(l)},events:[wt,"dataBinding","cancel",Tt,Ht,xt,gt,mt,bt,kt,_t,ut,pt,ht,ft,St,vt,Kt,jt,yt,Ct,Ut,$t,Qt,"page","sort","filter","group","groupExpand","groupCollapse"],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(we(t,Ir))):(t=r.tbody,r.content.scrollLeft(we(t,Ir)))),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:"",noRecords:!1,dataSource:{},height:null,resizable:!1,reorderable:!1,columnMenu:!1,detailTemplate:null,columnResizeHandleWidth:3,mobile:"",messages:{editable:{cancelDelete:kr,confirmation:fr,confirmDelete:mr},commands:{create:Ar.create.text,cancel:Ar.cancel.text,save:Ar.save.text,destroy:Ar.destroy.text,edit:Ar.edit.text,update:Ar.update.text,canceledit:Ar.canceledit.text,excel:Ar.excel.text,pdf:Ar.pdf.text},noRecords:gr,expandCollapseColumnHeader:"",groupHeader:"Press ctrl + space to group",ungroupHeader:"Press ctrl + space to ungroup"}},destroy:function(){var t,r=this;r._angularItems("cleanup"),r._destroyColumnAttachments(),Fe.fn.destroy.call(r),this._navigatableTables&&(this._navigatableTables.off(st),this._navigatableTables=null),r._resizeHandler&&e(window).off("resize"+st,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._destroyEditable(),r.dataSource&&(r.dataSource.unbind(wt,r._refreshHandler).unbind(Je,r._progressHandler).unbind(Ye,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._isMobile&&(r.wrapper.off("transitionend"+st),r.wrapper.off("contextmenu"+st)),r.minScreenResizeHandler&&e(window).off("resize",r.minScreenResizeHandler),r._detachColumnMediaResizeHandler(),r._draggableInstance&&r._draggableInstance.element&&r._draggableInstance.destroy(),r._draggableInstance=null,t.off(st),xe.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=We(!0,{},this.options),r.columns=xe.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();xe.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(xe.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){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,o=xe.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=$(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))),
Er&&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=this,c=d.options.columnResizeHandleWidth,u=d.options.scrollable,p=d.resizeHandle;p&&d.lockedContent&&p.data("th")[0]!==r[0]&&(p.off(st).remove(),p=null),p||(p=d.resizeHandle=e('<div class="k-resize-handle"><div class="k-resize-handle-inner"></div></div>'),t.append(p)),o=r.offset().left-parseFloat(r.css("marginLeft"))-(t.offset().left+parseFloat(t.css("borderLeftWidth"))),Ir?u&&(a=r.closest(".k-grid-header-wrap, .k-grid-header-locked"),n=zr.msie?a.scrollLeft():0,i=zr.webkit?a[0].scrollWidth-a[0].offsetWidth-a.scrollLeft():0,s=zr.mozilla?a[0].scrollWidth-a[0].offsetWidth-(a[0].scrollWidth-a[0].offsetWidth-a.scrollLeft()):0,o-=i-s+n):o+=r[0].offsetWidth,l=r.offset().top-parseFloat(r.css("marginTop"))-(t.offset().top+parseFloat(t.css("borderTopWidth"))),p.css({top:l,left:o-3*c/2,height:qe(r),width:3*c}).data("th",r).show(),p.off("dblclick"+st).on("dblclick"+st,function(){d._autoFitLeafColumn(r.data("index"))})},_positionColumnResizeHandle:function(){var r=this,o=r.lockedHeader?r.lockedHeader.find("thead:first"):e();r.thead.add(o).on("mousemove"+st,"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(xe.attr(cr))||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(Qe+Pt).find(Qe+Bt).show(),t.find(Qe+Vt).show(),t.find(Qe+Ot).show(),t.find(Qe+Nt).show()))},_hideResizeHandle:function(){this.resizeHandle&&(this.resizeHandle.data("th").removeClass("k-column-active"),this.lockedContent&&!this._isMobile?(this.resizeHandle.off(st).remove(),this.resizeHandle=null):this.resizeHandle.hide())},_positionColumnResizeHandleTouch:function(){var t=this,r=t.lockedHeader?t.lockedHeader.find("thead:first"):e();t._resizeUserEvents=new xe.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(Qe+Pt).find(Qe+Bt).hide(),o.find(Qe+Vt).hide(),o.find(Qe+Ot).hide(),o.find(Qe+Nt).hide(),t._createResizeHandle(o.closest("div"),o),t._resizeHandleDocumentClickHandler||(t._resizeHandleDocumentClickHandler=Ge(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=xe.support.mobileOS?0:xe.support.scrollbar(),h=d?Oe(r,j(s.columns)):Oe(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,b=Me(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&&b-o+i>n&&(i=o+(n-b-2*p),i<0&&(i=o),a=!0),i>10&&i>=k&&(l.css("width",i),b&&(i=a?n-2*p:b+(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=xe.support.mobileOS?0:xe.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 Re.Resizable(t.add(c.lockedHeader),{handle:(u.scrollable?"":">")+".k-resize-handle",hint:function(t){return e('<div class="k-grid-resize-indicator" />').css({height:qe(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],Q(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=Me(d),l=$(k)[f].minResizableWidth||10,n=Me(i?g.children("tbody"):c.tbody),zr.webkit&&c.wrapper.addClass("k-grid-column-resizing")},resize:function(t){var a,p,f,g,m,k,b=Ir?-1:1,_=o+t.x.location*b-r*b;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=_,i&&n-o+k>m&&(k=o+(m-n-2*h),k<0&&(k=_),g=!0),k>10&&k>=l&&(s.css("width",k),n&&(k=g?m-2*h:n+t.x.location*b-r*b,f.add(p).add(a).css("width",k),i||(c._footerWidth=k))),c._scrollVirtualWrapperOnColumnResize()):_>10&&_>=l&&s.css("width",_)},resizeend:function(){var e,t,r,l=Me(d);a(c.wrapper,""),zr.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(xe.attr("index")),r||(r=t.find("th:not(.k-group-cell):not(.k-hierarchy-cell)").index(d)),e=$(c.columns)[r],e.width=l,c.trigger(Kt,{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:xe.guid(),autoScroll:!0,filter:r.content?".k-grid-header:first "+it:"table:first>.k-grid-header "+it,dragstart:function(){t.children(".k-grid-header-wrap").unbind("scroll"+st+"scrolling").bind("scroll"+st+"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"+st+"scrolling")},drag:function(){r._hideResizeHandle()},hint:function(t){var r=t.attr(xe.attr("title"));return r&&(r=xe.htmlEncode(r)),e('<div class="k-header k-reorder-clue k-drag-clue" />').html(r||t.attr(xe.attr("field"))||t.text()).prepend('<span class="k-icon k-drag-status k-i-cancel" />')}}).data("kendoDraggable"))},_reorderable:function(){var t=this;t.options.reorderable&&(t.wrapper.data("kendoReorderable")&&t.wrapper.data("kendoReorderable").destroy(),t.wrapper.kendoReorderable({draggable:t._draggableInstance,dragOverContainers:function(e,r){var o=M(t.columns);return o[e].lockable!==!1&&q(o,t.columns,e,r)>-1},inSameContainer:function(r){return e(r.source).parent()[0]===e(r.target).parent()[0]&&q(M(t.columns),t.columns,r.sourceIndex,r.targetIndex)>-1},change:function(e){var r=M(t.columns),o=r[e.oldIndex],l=q(r,t.columns,e.oldIndex,e.newIndex);t.trigger(jt,{newIndex:l,oldIndex:Oe(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=z(e[0],u.columns),h=z(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",H(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",H(e,t,f,G(u.columns),u.thead,u.lockedHeader.find("thead"),this._groups(),l)),(t.columns||p.cell-h.cell>1||h.cell-p.cell>1)&&(t=D(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=Oe(f,$(p.columns)),k=Oe(r,$(p.columns)),b=Oe(g[0],U(p.columns)),_=Oe(r,U(p.columns)),v=N(p.columns).length,C=!!r.locked,y=p.footer||p.wrapper.find(".k-grid-footer"),S=l=_;for(r.hidden&&(n=C?N(p.columns):G(p.columns),w(n).length>0?(S=l=_=this._findClosestVisibleColumnIndex(n,k),a=w(n.slice(k)).length>0):C?(_=p.lockedTable.find("colgroup"),S=p.lockedHeader.find("colgroup"),l=e(p.lockedFooter).find(">table>colgroup")):(_=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),b>=0&&i(s(p.lockedHeader,p.thead.prev(),"col:not(.k-group-col,.k-hierarchy-col)"),b,S,a?a:o,g.length),p.options.scrollable&&b>=0&&i(s(p.lockedTable,p.tbody.prev(),"col:not(.k-group-col,.k-hierarchy-col)"),b,_,a?a:o,g.length),y&&y.length&&(b>=0&&i(s(p.lockedFooter,y.find(".k-grid-footer-wrap"),">table>colgroup>col:not(.k-group-col,.k-hierarchy-col)"),b,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&&ce(p.lockedTable.find(">tbody>tr.k-grouping-row"),p.table.find(">tbody>tr.k-grouping-row"),t.length):v>m&&ce(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 Oe(o,w(this.columns))},_autoFitLeafColumn:function(e){this.autoFitColumn($(this.columns)[e])},autoFitColumn:function(t){var r,o,l,a,n,i,s,d,c,u,p,h,f,g,m,k,_,w,C,y,S=this,T=S.options,H=S.columns,x=S.lockedHeader?Q(S.lockedHeader.find(">table>thead")).filter(b).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?H[t]:Ae(t)?Be(L(H),function(e){return e===t})[0]:Be(L(H),function(e){return e.field===t})[0],t&&v(t)){for(i=t.minResizableWidth,r=Oe(t,$(H)),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-=x),h=0;h<H.length&&H[h]!==t;h++)H[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),g=Me(o),n.width(""),f.css("table-layout","fixed"),n.width("auto"),f.addClass("k-autofitting"),f.css("table-layout",""),m=Math.ceil(Math.max(Me(o),Me(c.find("tr:not(.k-grouping-row)").eq(0).children(I).eq(r)),Me(p.find("tr").eq(0).children(I).eq(r))))+1,i&&i>m&&(m=i),n.width(m),t.width=m,T.scrollable){for(k=l.find("col"),w=0,C=0,y=k.length;C<y;C+=1)if(_=k[C].style.width,_&&_.indexOf("%")==-1)w+=parseInt(_,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"})}zr.msie&&8==zr.version&&(f.css("display","inline-table"),setTimeout(function(){f.css("display","table")},1)),f.removeClass("k-autofitting"),d&&s.scrollLeft(d),S.trigger(Kt,{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=Oe(r,s),c=s[e],p=!!c.locked,h=N(n.columns).length,f=Be($(n.columns),function(e){return e.groupHeaderColumnTemplate});d!==e&&(!r.locked&&p&&1==G(n.columns).length||r.locked&&!p&&1==h||(n._hideResizeHandle(),o===t&&(o=e<d),a=[r],n._reorderHeader(a,c,o),n.lockedHeader&&(V(n.thead),V(n.lockedHeader)),c.columns&&(c=$(c.columns),c=c[o?0:c.length-1]),r.columns&&(a=$(r.columns)),n._reorderContent(a,c,o),l=!!r.locked,l=l!=p,r.locked=p,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(),f.length>0&&n._renderGroupRows(),n._updateTablesWidth(),n._applyLockedContainersWidth(),n._syncLockedHeaderHeight(),n._syncLockedContentHeight(),n._updateFirstColumnClass(),l&&(p?n.trigger(Ut,{column:r}):n.trigger($t,{column:r}))))},_updateColumnCellIndex:function(){var e,t=0;this.lockedHeader&&(e=this.lockedHeader.find("thead"),t=x(e,N(this.columns))),x(this.thead,G(this.columns),t)},lockColumn:function(e){var t,r=this.columns;e="number"==typeof e?r[e]:Be(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]:Be(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=$(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(xe.attr("uid"));return this.dataSource.getByUid(r)},_editable:function(){var t,r=this,o=r.selectable&&r.selectable.options.multiple,l=r.options.editable,a=function(){var t=De(),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())};l&&(this.wrapper.addClass("k-editable"),t=r._editMode(),"incell"===t?(r.table.add(r.lockedTable).on("mousedown"+st,tt+">"+rt,function(t){var o=e(t.target);"incell"===r._editMode()&&o.hasClass("k-checkbox-label")&&o.prev().attr(xe.attr("bind"))&&t.preventDefault()}),l.update!==!1&&(Mr&&r.wrapper.on(Jt+st,".k-edit-cell > input[type='checkbox']",function(t){e(t.target).focus()}).on(Jt+st,".k-edit-cell",function(t){e(t.target).is("input")||e(t.currentTarget).find("input[type='checkbox']").focus()}).on(Yt+st,"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.wrapper.on(xe.support.touch?"touchstart"+st:Jt+st,"tr:not(.k-grouping-row) > td",function(t){var l=e(this),a=r.lockedTable&&l.closest("table")[0]===r.lockedTable[0];r._mousedownOnEditCell=!1,l.hasClass("k-hierarchy-cell")||l.hasClass("k-detail-cell")||l.hasClass("k-group-cell")||l.hasClass("k-edit-cell")||l.has("a.k-grid-delete").length||l.has("button.k-grid-delete").length||l.closest("tbody")[0]!==r.tbody[0]&&!a||e(t.target).is(":input")||(r.editable?r.editable.end()?(o&&e(De()).blur(),r.closeCell(),r.editCell(l)):r._scrollVirtualWrapper():r.editCell(l))}).on("focusin"+st,function(){e.contains(this,De())||(clearTimeout(r.timer),r.timer=null)}).on("focusout"+st,function(e){var t=!0;Mr&&r._mousedownOnEditCell&&(t=!1),r._mousedownOnEditCell=!1,t&&(r.timer=setTimeout(function(){a(e)},1))}))):l.update!==!1&&(r.wrapper.on(Jt+st,"tbody>tr:not(.k-detail-row,.k-grouping-row):visible a.k-grid-edit",function(t){t.preventDefault(),r.editRow(e(this).closest("tr"))}),r._isVirtualInlineEditable()&&r.wrapper.on("focusout"+st,"tr:not(.k-grouping-row) > td",function(){r.editable&&!r.editable.end()&&r._scrollVirtualWrapper()})),l.destroy!==!1?r.wrapper.on(Jt+st,"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(Jt+st,"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,o,l,a;if(t=e(t),r=this,o=$(r.columns)[r.cellIndex(t)],l=r._modelForContainer(t),r.closeCell(),l&&be(o,l)&&!o.command){if(r.trigger(pt,{model:l}))return;r._attachModelChange(l),r._editContainer=t,r._shouldClearEditableState&&r._clearEditableState(),r.editable=t.addClass("k-edit-cell").kendoEditable({fields:{field:o.field,format:o.format,editor:o.editor,values:o.values},model:l,target:r,change:function(e){r.trigger(ht,{values:e.values,container:t,model:l})&&e.preventDefault()},skipFocus:!(!r._isVirtualIncellEditable()||!r._editableState)}).data("kendoEditable"),a=t.parent().addClass("k-grid-edit-row"),r.lockedContent&&he(a[0],r._relatedRow(a).addClass("k-grid-edit-row")[0]),r.trigger(ut,{container:t,model:l})}},_adjustLockedHorizontalScrollBar:function(){var e=this.table,t=e.parent(),r=e[0].offsetWidth>t[0].clientWidth?xe.support.scrollbar():0;this.lockedContent.height(t[0].offsetHeight-r)},_syncLockedContentHeight:function(){this