@easyquery/enterprise 7.2.2 → 7.2.3-beta2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * EasyQuery.JS Enterprise 7.2.2 (https://korzh.com/easyquery/javascript)
2
+ * EasyQuery.JS Enterprise 7.2.3-beta2 (https://korzh.com/easyquery/javascript)
3
3
  * Copyright 2022 Korzh.com. All rights reserved.
4
4
  *
5
5
  * EasyQuery.JS commercial licenses may be obtained at
@@ -7,5 +7,5 @@
7
7
  * ASP.NET Core or ASP.NET editions (https://korzh.com/easyquery#EDITIONS)
8
8
  * If you do not own a commercial license, this file shall be governed by the trial license terms.
9
9
  */
10
- window.easyquery=function(t){var e={};function n(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=112)}([function(t,e,n){"use strict";n.r(e),n.d(e,"DataType",(function(){return i.a})),n.d(e,"EntityAttrKind",(function(){return o})),n.d(e,"EditorTag",(function(){return s})),n.d(e,"HttpMethod",(function(){return a.a})),n.d(e,"HttpRequest",(function(){return l.a})),n.d(e,"HttpResponseError",(function(){return u.b})),n.d(e,"HttpClient",(function(){return u.a})),n.d(e,"MetaData",(function(){return g})),n.d(e,"MetaEntity",(function(){return h})),n.d(e,"MetaEntityAttr",(function(){return p})),n.d(e,"ValueEditor",(function(){return f})),n.d(e,"AggregationSettings",(function(){return m})),n.d(e,"ColumnAlignment",(function(){return v.a})),n.d(e,"DataColumn",(function(){return v.b})),n.d(e,"DataColumnList",(function(){return v.c})),n.d(e,"DataRow",(function(){return b.a})),n.d(e,"EasyDataTable",(function(){return C.a})),n.d(e,"EventEmitter",(function(){return w})),n.d(e,"i18n",(function(){return c.a})),n.d(e,"EasyGuid",(function(){return x})),n.d(e,"repeatString",(function(){return T.b})),n.d(e,"reverseString",(function(){return T.c})),n.d(e,"strEndsWith",(function(){return T.d})),n.d(e,"combinePath",(function(){return T.a})),n.d(e,"utils",(function(){return d.a})),n.d(e,"liquid",(function(){return r}));var o,i=n(7);!function(t){t[t.Data=0]="Data",t[t.Virtual=1]="Virtual",t[t.Lookup=2]="Lookup"}(o||(o={}));var r,s={Unknown:"Unknown",Edit:"EDIT",DateTime:"DATETIME",List:"LIST",CustomList:"CUSTOMLIST",File:"FILE"},a=n(36),l=n(57),u=n(101),c=n(17),d=n(11),h=function(){function t(t){this.isEditable=!0,this.name="",this.caption="",this.description="",this.parent=t,this.attributes=new Array,this.subEntities=new Array}return t.prototype.loadFromData=function(t,e){if(e){if(this.id=e.id,this.name=e.name,this.captionPlural=e.namePlur,this.caption=e.name,this.description=e.desc,void 0!==e.ied&&(this.isEditable=e.ied),this.subEntities=new Array,e.ents)for(var n=0;n<e.ents.length;n++){var o=t.createEntity(this);o.loadFromData(t,e.ents[n]),this.subEntities.push(o)}if(this.attributes=new Array,e.attrs)for(n=0;n<e.attrs.length;n++){var i=t.createEntityAttr(this);i.loadFromData(t,e.attrs[n]),this.attributes.push(i)}}},t.prototype.scan=function(t,e){var n={stop:!1},o=function(i){if(e&&e(i,n),i.attributes)for(var r=i.attributes.length,s=0;s<r&&!n.stop;s++){var a=i.attributes[s];if(t&&t(a,n),n.stop)return}if(i.subEntities){var l=i.subEntities.length;for(s=0;s<l&&!n.stop;s++)o(i.subEntities[s])}};o(this)},t.prototype.getFirstPrimaryAttr=function(){return this.getPrimaryAttrs()[0]},t.prototype.getPrimaryAttrs=function(){return this.attributes.filter((function(t){return t.isPrimaryKey}))},t}(),p=function(){function t(t){this.id="",this.caption="{Unrecognized attribute}",this.dataType=i.a.String,this.size=0,this.isPrimaryKey=!1,this.isForeignKey=!1,this.isNullable=!0,this.showOnView=!0,this.isEditable=!0,this.showOnCreate=!0,this.showOnEdit=!0,this.showInLookup=!1,this.lookupAttr="",this.expr="",this.entity=t,this.kind=o.Data}return t.prototype.loadFromData=function(t,e){if(e){this.id=e.id,this.description=e.desc,this.caption=e.cptn,this.dataType=e.dtype,this.isPrimaryKey=e.ipk,this.isForeignKey=e.ifk,this.size=e.size,this.lookupAttr=e.lattr,this.lookupEntity=e.lent,this.dataAttr=e.dattr,this.lookupDataAttr=e.ldattr;var n=d.a.getDateDataTypes().indexOf(this.dataType);this.defaultValue=e.defVal&&n?new Date(e.defVal):e.defVal,this.isNullable=d.a.getIfDefined(e.nul,this.isNullable),this.isEditable=d.a.getIfDefined(e.ied,this.isEditable),this.showOnView=d.a.getIfDefined(e.ivis||e.sov,this.showOnView),this.showOnCreate=d.a.getIfDefined(e.soc,this.showOnCreate),this.showOnEdit=d.a.getIfDefined(e.soe,this.showOnEdit),this.showInLookup=d.a.getIfDefined(e.sil,this.showInLookup),this.kind=e.kind,this.displayFormat=e.dfmt,e.udata&&(this.userData=e.udata),e.edtr&&(this.defaultEditor=t.getEditorById(e.edtr)||t.createValueEditor())}},t}(),f=function(){function t(){this.id="",this.tag=s.Unknown,this.resType=i.a.Unknown,this.defValue=""}return t.prototype.loadFromData=function(t){t&&(this.id=t.id,this.tag=t.tag,this.defValue=t.defval,this.resType=t.rtype,this.accept=t.accept,this.multiline=t.multiline,t.subType&&(this.resType=t.subType),t.name&&(this.name=t.name),t.values&&(this.values=t.values))},t.prototype.getValueText=function(t){var e="";if(!this.values)return e;if(Array.isArray(t))for(var n=0,o=this.values;n<o.length;n++){var i=o[n];t.indexOf(i.id)>=0&&(e+=i.text+",")}else for(var r=0,s=this.values;r<s.length;r++){(i=s[r]).id===t&&(e+=i.text+",")}return e&&(e=e.substring(0,e.length-1)),e},t}(),g=function(){function t(){this.mainEntity=null,this.id="__none",this.name="Empty model",this.rootEntity=this.createEntity(),this.displayFormats=new Map}return t.prototype.getMainEntity=function(){return this.mainEntity},t.prototype.createEntity=function(t){return new h(t)},t.prototype.createEntityAttr=function(t){return new p(t)},t.prototype.createValueEditor=function(){return new f},t.prototype.loadFromJSON=function(t){var e=JSON.parse(t);this.loadFromData(e)},t.prototype.loadFromData=function(t){if(this.id=t.id,this.name=t.name,this.version=t.vers,this.editors=new Array,t.editors)for(var e=0;e<t.editors.length;e++){var n=this.createValueEditor();n.loadFromData(t.editors[e]),this.editors.push(n)}if(this.rootEntity.loadFromData(this,t.entroot),this.displayFormats=new Map,t.displayFormats)for(var o in t.displayFormats){var r=i.a[o],s=t.displayFormats[o]||new Array;this.displayFormats.set(r,s)}},t.prototype.getDisplayFormats=function(){return this.displayFormats},t.prototype.getDisplayFormatsForType=function(t){return this.displayFormats.has(t)?this.displayFormats.get(t):[]},t.prototype.getDefaultFormat=function(t){return this.displayFormats.has(t)?this.displayFormats.get(t).filter((function(t){return t.isdef}))[0]:null},t.prototype.setData=function(t){"string"==typeof t?this.loadFromJSON(t):this.loadFromData(t)},t.prototype.isEmpty=function(){return 0===this.rootEntity.subEntities.length&&0===this.rootEntity.attributes.length},t.prototype.getId=function(){return this.id},t.prototype.getName=function(){return this.name},t.prototype.getRootEntity=function(){return this.rootEntity},t.prototype.getEditorById=function(t){for(var e=0,n=this.editors;e<n.length;e++){var o=n[e];if(o.id===t)return o}return null},t.prototype.getAttributeById=function(t){var e=this.getEntityAttrById(this.getRootEntity(),t);return e||null},t.prototype.checkAttrProperty=function(t,e){var n=this.getAttributeById(t);if(n){if(void 0===n[e])throw"No such property: "+e;return!!n[e]||!!n.lookupAttr&&(t=n.lookupAttr,(n=this.getAttributeById(t))&&n[e])}return!1},t.prototype.getEntityAttrById=function(t,e){var n,o;if(t.attributes){var i=t.attributes.length;for(n=0;n<i;n++)if(t.attributes[n].id==e)return t.attributes[n]}if(t.subEntities){var r=t.subEntities.length;for(n=0;n<r;n++)if(o=this.getEntityAttrById(t.subEntities[n],e))return o}return null},t.prototype.listByEntityWithFilter=function(t,e){var n,o=new Array,i=null;if(t.subEntities)for(var r=t.subEntities.length,s=0;s<r;s++){if(i=t.subEntities[s],!e||e(i,null))(n=c.a.getText("Entities",i.name))||(n=i.caption),(h=d.a.assign(this.createEntity(),{id:i.name,text:n,items:[],isEntity:!0})).items=this.listByEntityWithFilter(i,e),h.items.length>0&&o.push(h)}var a=null;if(t.attributes)for(var l=t.attributes.length,u=0;u<l;u++)if(a=t.attributes[u],!e||e(t,a)){(n=c.a.getText("Attributes",a.id))||(n=a.caption);var h=d.a.assign(this.createEntity(),{id:a.id,text:n,dataType:a.dataType});o.push(h)}return o},t.prototype.listByEntity=function(t,e,n){e=e||{};var o,i=[],r=[],s=null;if(t.subEntities)for(var a=t.subEntities.length,l=0;l<a;l++)if(s=t.subEntities[l],!n||n(s,null)){o=c.a.getText("Entities",s.name)||s.caption;var u=d.a.assign(this.createEntity(),{id:s.name,text:o,items:[],isEntity:!0,description:s.description}),h=d.a.assign({},e);h.includeRootData=!1,u.items=this.listByEntity(s,h,n),u.items.length>0&&i.push(u)}var p=null;if(t.attributes)for(var f=t.attributes.length,g=0;g<f;g++)p=t.attributes[g],n&&!n(t,p)||(o=c.a.getText("Attributes",p.id)||p.caption,r.push(d.a.assign(this.createEntityAttr(t),{id:p.id,text:o,dataType:p.dataType,lookupAttr:p.lookupAttr,description:p.description})));var y,m=function(t,e){return t.text.toLowerCase()==e.text.toLowerCase()?0:t.text.toLowerCase()>e.text.toLowerCase()?1:-1};return e.sortEntities&&(i.sort(m),r.sort(m)),y=e.attrPlacement&&0!=e.attrPlacement?r.concat(i):i.concat(r),2==e.attrPlacement&&y.sort(m),e.includeRootData?((o=c.a.getText("Entities",t.name))||(o=t.caption),{id:t.name,text:o,items:y}):y},t.prototype.clear=function(){this.rootEntity=this.createEntity(),this.editors=[],this.version=""},t.prototype.addDefaultValueEditors=function(){this.addOrUpdateValueEditor("_DTE",s.Edit,i.a.String).defValue="",this.addOrUpdateValueEditor("_DPDE",s.DateTime,i.a.DateTime),this.addOrUpdateValueEditor("_DPTE",s.DateTime,i.a.DateTime)},t.prototype.addOrUpdateValueEditor=function(t,e,n){var o=d.a.findItemById(this.editors,t);return o||((o=this.createValueEditor()).id=t,this.editors.push(o)),o.tag=e,o.resType=n,o},t.prototype.getEntitiesTree=function(t,e){return this.listByEntity(this.getRootEntity(),t,e)},t.prototype.getEntitiesTreeWithFilter=function(t){return this.listByEntityWithFilter(this.getRootEntity(),t)},t.prototype.getFullEntityPathByAttr=function(t,e){return e=e||" ",this.getEntityPathByAttr(this.getRootEntity(),t,e,!0)},t.prototype.getEntityPathByAttr=function(t,e,n,o){if(!t)return"";n=n||" ";var i="";if(t.caption&&!o){var r=c.a.getText("Entities",t.caption);i=r||t.caption}if(t.attributes)for(var s=t.attributes.length,a=0;a<s;a++)if(t.attributes[a].id==e)return i;if(t.subEntities){var l=t.subEntities.length;for(a=0;a<l;a++){var u=t.subEntities[a],d=this.getEntityPathByAttr(u,e,n,!1);if(""!==d)return""!==i&&(d=i+n+d),d}}return""},t.prototype.getAttributeText=function(t,e){var n=c.a.getText("Attributes",t.id);if(n||(n=t.caption),!e)return n;var o=this.getFullEntityPathByAttr(t.id," ");return(o?e.replace(new RegExp("{attr}","g"),n).replace(new RegExp("{entity}","g"),o):n).trim()},t.prototype.runThroughEntities=function(t,e){this.getRootEntity().scan(t,e)},t.prototype.getFirstAttributeByFilter=function(t){var e=null;return this.runThroughEntities((function(n,o){t(n)&&(o.stop=!0,e=n)}),null),e},t}(),y=function(){return y=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},y.apply(this,arguments)},m=function(){function t(t){this.colStore=t,this.aggregates=[],this.groups=[],this.useGrandTotals=!1,this.useRecordCount=!1,this._caseSensitiveGroups=!1,this.COUNT_FIELD_NAME="GRPRECCNT"}return Object.defineProperty(t.prototype,"caseSensitiveGroups",{get:function(){return this._caseSensitiveGroups},set:function(t){this._caseSensitiveGroups=t,this.updateCompareProc()},enumerable:!0,configurable:!0}),t.prototype.updateCompareProc=function(){this.compareValues=this._caseSensitiveGroups?this.strictCompare:this.caseInsensitiveCompare},t.prototype.addGroup=function(t){var e=t.columns||this.colStore.getColumnIds(t.from,t.to);if(!this.colStore.validateColumns(e))throw"Invalid columns: "+e;if(this.hasColumnsInUse(e))throw"Can't add same columns to different groups/aggregates";return this.groups.push(y({columns:e},t)),this},t.prototype.addAggregateColumn=function(t,e){var n="string"==typeof t?t:this.colStore.getColumnIds(t,t)[0];if(this.hasColumnsInUse([n])||!this.colStore.validateAggregate(n,e))throw"Invalid aggregation function for the column: "+n;return this.aggregates.push({colId:n,funcId:e}),this},t.prototype.addGrandTotals=function(){return this.useGrandTotals=!0,this},t.prototype.addCounts=function(){return this.useRecordCount=!0,this},t.prototype.getGroups=function(){var t=this,e=[];return this.groups.map((function(n){return e=e.concat(n.columns),y(y({},n),{columns:Array.from(e),aggregates:Array.from(t.aggregates)})}))},t.prototype.getInternalGroups=function(){return this.groups},t.prototype.lastGroup=function(){var t=this.getGroups();return t[t.length-1]},t.prototype.getAggregates=function(){return this.aggregates},t.prototype.hasAggregates=function(){return this.aggregates.length>0},t.prototype.hasGroups=function(){return this.groups.length>0},t.prototype.hasGrandTotals=function(){return this.useGrandTotals},t.prototype.hasRecordCount=function(){return this.useRecordCount},t.prototype.isEmpty=function(){return!(this.hasAggregates()||this.hasGroups()||this.hasAggregates()||this.hasRecordCount())},t.prototype.drop=function(){console.warn('"drop()" method is obsolete. Use "clear()" instead'),this.clear()},t.prototype.clear=function(){return this.groups=[],this.aggregates=[],this.useGrandTotals=!1,this.useRecordCount=!1,this.caseSensitiveGroups=!1,this},t.prototype.hasColumnsInUse=function(t){for(var e=0,n=this.groups;e<n.length;e++){if(n[e].columns.filter((function(e){return t.indexOf(e)>=0})).length>0)return!0}for(var o=0,i=this.aggregates;o<i.length;o++){var r=i[o];if(t.indexOf(r.colId)>=0)return!0}return!1},t.prototype.needAggrCalculation=function(){return(this.hasAggregates()||this.hasRecordCount())&&(this.hasGrandTotals()||this.hasGroups())},t.prototype.saveToData=function(){return{groups:Array.from(this.groups),ugt:this.useGrandTotals,urc:this.useRecordCount,csg:this.caseSensitiveGroups,aggregates:Array.from(this.aggregates)}},t.prototype.loadFromData=function(t){t&&(void 0!==t.ugt&&(this.useGrandTotals=t.ugt),void 0!==t.urc&&(this.useRecordCount=t.urc),void 0!==t.csg&&(this.caseSensitiveGroups=t.csg),t.groups&&(this.groups=Array.from(t.groups)),t.aggregates&&(this.aggregates=Array.from(t.aggregates)))},t.prototype.buildGroupKey=function(t,e){var n=!this.caseSensitiveGroups,o={};if(t)for(var i=0,r=t.columns;i<r.length;i++){var s=r[i],a=e.getValue(s);n&&"string"==typeof a&&(a=a.toLowerCase()),o[s]=a}return o},t.prototype.strictCompare=function(t,e){return t===e},t.prototype.caseInsensitiveCompare=function(t,e){return("string"==typeof t?t.toLowerCase():t)===("string"==typeof e?e.toLowerCase():e)},t}(),v=n(58),b=n(49),C=n(103),x=function(){function t(){}return t.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))},t}(),w=function(){function t(t){this.silentMode=0,this.events=new Array,this.source=t}return t.prototype.subscribe=function(t,e){var n=this.getEventRecByType(t),o={id:x.newGuid(),callback:e};return n?n.eventCallbacks.push(o):(n={type:t,eventCallbacks:new Array(o)},this.events.push(n)),o.id},t.prototype.unsubscribe=function(t,e){var n=this.getEventRecByType(t);if(n){var o=-1;for(o=0;o<n.eventCallbacks.length&&n.eventCallbacks[o].id!==e;o++);o>=0&&n.eventCallbacks.splice(o,1)}},t.prototype.fire=function(t,e,n,o){if(void 0===n&&(n=0),void 0===o&&(o=!1),!this.silentMode||o){var i=this.getEventRecByType(t);if(i){var r={type:t,source:this.source,data:e},s=function(){for(var t=0,e=i.eventCallbacks;t<e.length;t++){e[t].callback(r)}};n>0?setTimeout(s,n):s()}}},t.prototype.enterSilentMode=function(){this.silentMode++},t.prototype.exitSilentMode=function(){this.silentMode&&this.silentMode--},t.prototype.isSilent=function(){return this.silentMode>0},t.prototype.getEventRecByType=function(t){for(var e=0,n=this.events;e<n.length;e++){var o=n[e];if(o.type==t)return o}return null},t}(),T=n(48);!function(t){t.renderLiquidTemplate=function(t,e){var n=t;if(e)for(var o in e){var i=new RegExp("{{"+o+"}}","g");n=n.replace(i,e[o])}return n}}(r||(r={})),c.a.resetLocales(),"function"!=typeof Object.values&&(Object.values=function(t){return Object.keys(t).map((function(e){return t[e]}))}),"function"!=typeof Math.trunc&&(Math.trunc=function(t){return isNaN(t)?NaN:t>0?Math.floor(t):Math.ceil(t)})},function(t,e,n){"use strict";n.r(e),n.d(e,"EasyGrid",(function(){return i.a})),n.d(e,"AutoResizeColumns",(function(){return r.a})),n.d(e,"GridColumnAlign",(function(){return s.b})),n.d(e,"GridColumn",(function(){return s.a})),n.d(e,"GridColumnList",(function(){return s.c})),n.d(e,"DFMT_REGEX",(function(){return a.b})),n.d(e,"CellRendererType",(function(){return a.a})),n.d(e,"GridCellRendererStore",(function(){return a.c})),n.d(e,"Calendar",(function(){return l})),n.d(e,"DateTimePicker",(function(){return c})),n.d(e,"DefaultCalendar",(function(){return f})),n.d(e,"DefaultDateTimePicker",(function(){return b})),n.d(e,"DefaultTimePicker",(function(){return m})),n.d(e,"TimePicker",(function(){return g})),n.d(e,"browserUtils",(function(){return C.a})),n.d(e,"DomElementBuilder",(function(){return h.a})),n.d(e,"DomTextAreaElementBuilder",(function(){return h.d})),n.d(e,"DomInputElementBuilder",(function(){return h.b})),n.d(e,"DomSelectElementBuilder",(function(){return h.c})),n.d(e,"domel",(function(){return h.e})),n.d(e,"DropEffect",(function(){return x.b})),n.d(e,"EqDragEvent",(function(){return x.c})),n.d(e,"DragManager",(function(){return x.a})),n.d(e,"eqDragManager",(function(){return x.d})),n.d(e,"mask",(function(){return w.a})),n.d(e,"wrapInner",(function(){return u.q})),n.d(e,"addElement",(function(){return u.b})),n.d(e,"addCssClass",(function(){return u.a})),n.d(e,"hideElement",(function(){return u.k})),n.d(e,"showElement",(function(){return u.m})),n.d(e,"toggleVisibility",(function(){return u.p})),n.d(e,"isVisible",(function(){return u.l})),n.d(e,"createBrowserEvent",(function(){return u.c})),n.d(e,"getViewportSize",(function(){return u.i})),n.d(e,"getDocSize",(function(){return u.f})),n.d(e,"getScrollPos",(function(){return u.h})),n.d(e,"getElementAbsolutePos",(function(){return u.g})),n.d(e,"getWinSize",(function(){return u.j})),n.d(e,"slideDown",(function(){return u.n})),n.d(e,"slideUp",(function(){return u.o})),n.d(e,"eqCssPrefix",(function(){return u.e})),n.d(e,"eqCssMobile",(function(){return u.d})),n.d(e,"DefaultDialogService",(function(){return T.b})),n.d(e,"DefaultDialog",(function(){return T.a})),n.d(e,"DefaultProgressDialog",(function(){return T.d})),n.d(e,"DefaultDialogSet",(function(){return T.c})),n.d(e,"DialogFooterAlignment",(function(){return E.a})),n.d(e,"dialogs",(function(){return D}));var o,i=n(106),r=n(34),s=n(22),a=n(39),l=function(){function t(t,e){this.slot=t,this.options=e||{},this.options.yearRange||(this.options.yearRange="c-10:c+10")}return Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"kdtp-cal"},enumerable:!0,configurable:!0}),t.prototype.setDate=function(t){this.currentDate=new Date(t)},t.prototype.getDate=function(){return new Date(this.currentDate)},t.prototype.dateChanged=function(t){this.options.onDateChanged&&this.options.onDateChanged(this.currentDate,t)},t}(),u=n(18),c=function(){function t(t){this.calendar=null,this.timePicker=null,this.options=t,this.render()}return Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"kdtp"},enumerable:!0,configurable:!0}),t.prototype.setDateTime=function(t){this.currentDateTime=new Date(t),this.calendar&&this.calendar.setDate(this.currentDateTime),this.timePicker&&this.timePicker.setTime(this.currentDateTime)},t.prototype.getDateTime=function(){return new Date(this.currentDateTime)},t.prototype.render=function(){var t=this;this.options.showCalendar&&(this.calendar=this.createCalendar({yearRange:this.options.yearRange,showDateTimeInput:this.options.showDateTimeInput,timePickerIsUsed:this.options.showTimePicker,oneClickDateSelection:this.options.oneClickDateSelection,onDateChanged:function(e,n){t.currentDateTime=e,t.timePicker&&t.timePicker.setTime(t.currentDateTime),t.options.showTimePicker&&t.dateTimeChanged(),n&&t.apply(t.currentDateTime)}}),this.calendar&&this.calendar.render()),this.options.showTimePicker&&(this.timePicker=this.createTimePicker({onTimeChanged:function(e){t.currentDateTime.setHours(e.getHours()),t.currentDateTime.setMinutes(e.getMinutes()),t.calendar&&t.calendar.setDate(t.currentDateTime),t.dateTimeChanged()}}),this.timePicker&&this.timePicker.render()),this.setDateTime(new Date)},t.prototype.createCalendar=function(t){return null},t.prototype.createTimePicker=function(t){return null},t.prototype.show=function(t){this.options.beforeShow&&this.options.beforeShow();var e=Object(u.g)(t||document.body);this.slot.style.top=e.y+t.clientHeight+"px",this.slot.style.left=e.x+"px"},t.prototype.apply=function(t){this.options.onApply&&this.options.onApply(t),this.destroy()},t.prototype.cancel=function(){this.options.onCancel&&this.options.onCancel(),this.destroy()},t.prototype.destroy=function(){this.slot&&this.slot.parentElement&&this.slot.parentElement.removeChild(this.slot)},t.prototype.dateTimeChanged=function(){this.options.onDateTimeChanged&&this.options.onDateTimeChanged(this.currentDateTime)},t}(),d=n(0),h=n(6),p=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),f=function(t){function e(e,n){var o=t.call(this,e,n)||this;o.daysOfWeek=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],o.months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],o.calendarBody=null,o.isManualInputChanging=!1;for(var i=0;i<o.daysOfWeek.length;i++)o.daysOfWeek[i]=d.i18n.getShortWeekDayName(i+1);for(i=0;i<o.months.length;i++)o.months[i]=d.i18n.getLongMonthName(i+1);return o}return p(e,t),e.prototype.setDate=function(e){t.prototype.setDate.call(this,e),this.selectedMonth=this.currentDate.getMonth(),this.selectedYear=this.currentDate.getFullYear(),this.rerenderMonth()},e.prototype.render=function(){var t=this,e=Object(h.e)("div",this.slot).addClass(this.cssPrefix+"-header");this.options.showDateTimeInput?e.addChildElement(this.renderManualDateInput()):e.addChild("span",(function(e){return t.headerTextElem=e.toDOM()})),Object(h.e)(this.slot).addChildElement(this.renderCalendarButtons()),this.calendarBody=Object(h.e)("div",this.slot).addClass(this.cssPrefix+"-body").toDOM()},e.prototype.getInputDateFormat=function(){var t=d.i18n.getLocaleSettings();return this.options.timePickerIsUsed?t.editDateFormat+" "+t.editTimeFormat:t.editDateFormat},e.prototype.renderManualDateInput=function(){var t=this,e=this.getInputDateFormat(),n=Object(h.e)("input").attr("placeholder",e).addClass(this.cssPrefix+"-header-input");return n.mask(e.replace("yyyy","9999").replace("MM","99").replace("dd","99").replace("HH","99").replace("mm","99").replace("ss","99")).on("input",(function(o){n.removeClass("error");try{t.isManualInputChanging=!0;var i=d.utils.strToDateTime(t.manualInputElem.value,e);t.currentDate=i,t.jump(t.currentDate.getFullYear(),t.currentDate.getMonth()),t.dateChanged(!1)}catch(t){n.addClass("error")}finally{t.isManualInputChanging=!1}})).on("keydown",(function(e){13===e.keyCode&&(e.preventDefault(),e.stopPropagation(),t.manualInputElem.className.indexOf("error")<0&&!t.isManualInputChanging&&t.dateChanged(!0))})).on("focus",(function(){setTimeout((function(){t.manualInputElem.selectionStart=0,t.manualInputElem.selectionEnd=0}),50)})),this.manualInputElem=n.toDOM(),this.manualInputElem},e.prototype.updateDisplayedDateValue=function(){if(this.manualInputElem){if(!this.isManualInputChanging){var t=this.getInputDateFormat();this.manualInputElem.value=d.utils.dateTimeToStr(this.currentDate,t),this.manualInputElem.focus()}}else if(this.headerTextElem){var e=d.i18n.getCurrentLocale();this.headerTextElem.innerText=this.currentDate.toLocaleString("en"==e?void 0:e,{year:"numeric",month:"long",day:"numeric"})}},e.prototype.renderCalendarButtons=function(){var t=this;return Object(h.e)("nav").addClass(this.cssPrefix+"-nav").addChild("div",(function(e){return e.addClass(t.cssPrefix+"-nav-prev").on("click",(function(){t.prev()})).addChild("span",(function(t){return t.html("&lsaquo;")}))})).addChild("div",(function(e){return e.addClass(t.cssPrefix+"-nav-selectors").addChild("div",(function(e){return e.addClass(t.cssPrefix+"-nav-month").addChild("select",(function(e){e.on("change",(function(){t.jump(t.selectedYear,parseInt(t.selectMonthElem.value))}));for(var n=function(n){e.addChild("option",(function(e){return e.attr("value",n.toString()).text(t.months[n])}))},o=0;o<t.months.length;o++)n(o);t.selectMonthElem=e.toDOM()}))})).addChild("div",(function(e){return e.addClass(t.cssPrefix+"-nav-year").addChild("select",(function(e){return t.selectYearElem=e.on("change",(function(){t.jump(parseInt(t.selectYearElem.value),t.selectedMonth)})).toDOM()}))}))})).addChild("div",(function(e){return e.addClass(t.cssPrefix+"-nav-next").on("click",(function(){t.next()})).addChild("span",(function(t){return t.html("&rsaquo;")}))})).toDOM()},e.prototype.prev=function(){this.selectedYear=0===this.selectedMonth?this.selectedYear-1:this.selectedYear,this.selectedMonth=0===this.selectedMonth?11:this.selectedMonth-1,this.rerenderMonth()},e.prototype.next=function(){this.selectedYear=11===this.selectedMonth?this.selectedYear+1:this.selectedYear,this.selectedMonth=(this.selectedMonth+1)%12,this.rerenderMonth()},e.prototype.rerenderSelectYear=function(){var t=/c-(\d*):c\+(\d*)/g.exec(this.options.yearRange),e=0,n=1;null!==t&&(e=parseInt(t[1]),n=parseInt(t[2])),this.selectYearElem.innerHTML="";for(var o=0;o<=e+n;o++){var i=document.createElement("option"),r=this.selectedYear-e+o;i.value=r.toString(),i.innerText=r.toString(),this.selectYearElem.appendChild(i)}},e.prototype.jump=function(t,e){this.selectedYear=t,this.selectedMonth=e,this.rerenderMonth()},e.prototype.rerenderMonth=function(){var t=this;this.updateDisplayedDateValue(),this.rerenderSelectYear();var e=new Date(this.selectedYear,this.selectedMonth).getDay(),n=new Date(this.selectedYear,this.selectedMonth+1,0).getDate();this.calendarBody.innerHTML="",this.selectYearElem.value=this.selectedYear.toString(),this.selectMonthElem.value=this.selectedMonth.toString(),this.daysOfWeek.forEach((function(e,n){Object(h.e)("div",t.calendarBody).addClass(t.cssPrefix+"-weekday").addClass(0==n||6==n?t.cssPrefix+"-weekend":"").text(e)}));for(var o=0;o<e;o++)Object(h.e)("div",this.calendarBody).addClass(this.cssPrefix+"-day-empty");for(var i=new Date,r=1;r<=n;r++){var s=Object(h.e)("div",this.calendarBody).addClass(this.cssPrefix+"-day").attr("data-date",r.toString()).text(r.toString()).on("click",(function(e){t.currentDate.setFullYear(t.selectedYear),t.currentDate.setMonth(t.selectedMonth),t.currentDate.setDate(parseInt(e.target.getAttribute("data-date"))),t.dateChanged(t.options.oneClickDateSelection)}));r===i.getDate()&&this.selectedYear===i.getFullYear()&&this.selectedMonth===i.getMonth()&&s.addClass(this.cssPrefix+"-day-current"),r===this.currentDate.getDate()&&this.selectedYear===this.currentDate.getFullYear()&&this.selectedMonth===this.currentDate.getMonth()&&s.addClass(this.cssPrefix+"-day-selected");var a=(e+r-1)%7;0!=a&&6!=a||s.addClass(this.cssPrefix+"-weekend")}var l=(e+n)%7,u=0==l?0:7-l;for(o=0;o<u;o++)Object(h.e)("div",this.calendarBody).addClass(this.cssPrefix+"-day-empty")},e.prototype.dateChanged=function(e){t.prototype.dateChanged.call(this,e),this.rerenderMonth()},e}(l),g=function(){function t(t,e){this.slot=t,this.options=e||{}}return Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"kdtp-tp"},enumerable:!0,configurable:!0}),t.prototype.setTime=function(t){this.currentTime=new Date(t)},t.prototype.getTime=function(){return new Date(this.currentTime)},t.prototype.timeChanged=function(){this.options.onTimeChanged&&this.options.onTimeChanged(this.currentTime)},t}(),y=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return y(e,t),e.prototype.setTime=function(e){t.prototype.setTime.call(this,e),this.updateDisplayedTime(),this.hoursInput.valueAsNumber=e.getHours(),this.minutesInput.valueAsNumber=e.getMinutes()},e.prototype.render=function(){var t=this;Object(h.e)("div",this.slot).addClass(this.cssPrefix+"-time").addChild("span",(function(e){return t.timeText=e.toDOM()})).toDOM();var e=Object(h.e)("div",this.slot).addClass(this.cssPrefix+"-sliders");return e.addChild("div",(function(e){return e.addClass(t.cssPrefix+"-time-row").title("Hours").addChild("input",(function(e){return t.hoursInput=e.addClass(t.cssPrefix+"-input-hours").type("range").attr("min","0").attr("max","23").attr("step","1").on("input",(function(e){t.currentTime.setHours(t.hoursInput.valueAsNumber),t.updateDisplayedTime(),t.timeChanged()})).toDOM()}))})),e.addChild("div",(function(e){return e.addClass(t.cssPrefix+"-time-row").title("Minutes").addChild("input",(function(e){return t.minutesInput=e.addClass(t.cssPrefix+"-input-minutes").type("range").attr("min","0").attr("max","59").attr("step","1").on("input",(function(e){t.currentTime.setMinutes(t.minutesInput.valueAsNumber),t.updateDisplayedTime(),t.timeChanged()})).toDOM()}))})),this.slot},e.prototype.updateDisplayedTime=function(){var t=d.i18n.getCurrentLocale(),e=this.currentTime.toLocaleString("en"==t?void 0:t,{hour:"numeric",minute:"numeric"});this.timeText.innerText=e},e}(g),v=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),b=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v(e,t),e.prototype.render=function(){var e=this,n=Object(h.e)("div",document.body).addClass(""+this.cssPrefix).attr("tabIndex","0").setStyle("position","absolute").setStyle("top","-1000px").setStyle("left","-1000px").on("keydown",(function(t){return 27===t.keyCode?e.cancel():13===t.keyCode&&e.apply(e.getDateTime()),!1}));this.options.zIndex&&n.setStyle("z-index",""+this.options.zIndex),this.slot=n.toDOM(),t.prototype.render.call(this),this.renderButtons(),this.globalMouseDownHandler=function(t){var n=window.event||t;n.srcElement||n.target;return!e.slot.contains(n.target)&&(document.removeEventListener("mousedown",e.globalMouseDownHandler,!0),e.cancel()),!0}},e.prototype.renderButtons=function(){var t=this,e=Object(h.e)("div",this.slot).addClass(this.cssPrefix+"-buttons").addChild("button",(function(e){return t.nowButton=e.addClass(t.cssPrefix+"-button "+t.cssPrefix+"-button-now").text(d.i18n.getText("ButtonNow")).on("click",(function(){return t.setDateTime(new Date),t.dateTimeChanged(),!1})).toDOM()}));!this.options.showTimePicker&&this.options.oneClickDateSelection||e.addChild("button",(function(e){return t.submitButton=e.addClass(t.cssPrefix+"-button "+t.cssPrefix+"-button-apply").text(d.i18n.getText("ButtonApply")).on("click",(function(){return t.apply(t.getDateTime()),!1})).toDOM()})),e.addChild("button",(function(e){return t.submitButton=e.addClass(t.cssPrefix+"-button "+t.cssPrefix+"-button-cancel").text(d.i18n.getText("ButtonCancel")).on("click",(function(){return t.cancel(),!1})).toDOM()}))},e.prototype.createCalendar=function(t){return this.calendarSlot=Object(h.e)("div",this.slot).addClass(this.cssPrefix+"-cal").toDOM(),new f(this.calendarSlot,t)},e.prototype.createTimePicker=function(t){return this.timePickerSlot=Object(h.e)("div",this.slot).addClass(this.cssPrefix+"-tp").toDOM(),new m(this.timePickerSlot,t)},e.prototype.show=function(e){var n=this;if(this.options.showDateTimeInput){this.options.beforeShow&&this.options.beforeShow();var o=Object(u.g)(e||document.body),i=Object(u.g)(e?e.parentElement||e:document.body);this.slot.style.top=i.y+"px",this.slot.style.left=o.x+"px"}else t.prototype.show.call(this,e),this.slot.focus();setTimeout((function(){document.addEventListener("mousedown",n.globalMouseDownHandler,!0)}),1)},e}(c),C=n(68),x=n(37),w=n(69),T=n(70),E=n(71);d.i18n.updateDefaultTexts({GridPageInfo:"{FirstPageRecordNum} - {LastPageRecordNum} of {Total} records",GridItemsPerPage:"items per page",ButtonOK:"OK",ButtonCancel:"Cancel",ButtonApply:"Apply",ButtonNow:"Now",LblTotal:"Total"});var D=new T.b},function(t,e,n){"use strict";n.r(e),n.d(e,"equtils",(function(){return i.a})),n.d(e,"eqconsts",(function(){return o})),n.d(e,"EqServiceProvider",(function(){return b})),n.d(e,"Tree",(function(){return C.a})),n.d(e,"EasyQueryDataLoader",(function(){return x.a})),n.d(e,"GoogleDataConverter",(function(){return w.a})),n.d(e,"EqAggregatesContainer",(function(){return v.b})),n.d(e,"DefaultAggregatesCalculator",(function(){return v.a})),n.d(e,"DataKind",(function(){return T.a})),n.d(e,"LinkType",(function(){return E.a})),n.d(e,"CondTag",(function(){return D.a})),n.d(e,"ConditionPart",(function(){return S.a})),n.d(e,"ExprTag",(function(){return k.a})),n.d(e,"EqEditorTag",(function(){return M.a})),n.d(e,"WidgetGroup",(function(){return s})),n.d(e,"AggrFunction",(function(){return O.a})),n.d(e,"DataModel",(function(){return u.a})),n.d(e,"Entity",(function(){return A.a})),n.d(e,"EntityAttr",(function(){return A.b})),n.d(e,"Operator",(function(){return P.b})),n.d(e,"Operand",(function(){return P.a})),n.d(e,"EqValueEditor",(function(){return B.a})),n.d(e,"EqAction",(function(){return I})),n.d(e,"EqModelLoader",(function(){return d.a})),n.d(e,"InMemoryModelStorage",(function(){return L.a})),n.d(e,"BrowserQueryStorage",(function(){return c.a})),n.d(e,"EqContext",(function(){return j})),n.d(e,"Widget",(function(){return q})),n.d(e,"EqActionResult",(function(){return _})),n.d(e,"SortDirection",(function(){return N.b})),n.d(e,"QueryColumn",(function(){return N.a})),n.d(e,"Condition",(function(){return H.a})),n.d(e,"Expression",(function(){return W.a})),n.d(e,"InvalidQueryError",(function(){return l.a})),n.d(e,"Query",(function(){return l.b})),n.d(e,"QueryChangePart",(function(){return R.b})),n.d(e,"QueryChangeAction",(function(){return R.a})),n.d(e,"EqServerExporter",(function(){return F})),n.d(e,"EqServerModelLoader",(function(){return p})),n.d(e,"EqServerDataFetcher",(function(){return f})),n.d(e,"EqServerQuerySynchronizer",(function(){return g})),n.d(e,"EqServerValueListResolver",(function(){return y})),n.d(e,"EqQueryFileLoader",(function(){return m})),n.d(e,"FormatParser",(function(){return G.a})),n.d(e,"versionInfo",(function(){return V})),n.d(e,"i18n",(function(){return a.i18n}));var o,i=n(14);!function(t){var e=function(){this.SpecDateValues=[{id:"${Today}",key:"Today",isDefault:!0},{id:"${Yesterday}",key:"Yesterday"},{id:"${Tomorrow}",key:"Tomorrow"},{id:"${FirstDayOfMonth}",key:"FirstDayOfMonth"},{id:"${FirstDayOfYear}",key:"FirstDayOfYear"}],this.SpecTimeValues=[{id:"${Now}",key:"Now",isDefault:!0},{id:"${HourStart}",key:"HourStart"},{id:"${Midnight}",key:"Midnight"},{id:"${Noon}",key:"Noon"}],this.BooleanValues=[{id:"${false}",key:"False"},{id:"${true}",key:"True",isDefault:!0}]};t.constLists=new e,t.predicateLinkTypeList=[{id:"All",key:"LinkTypeAll"},{id:"Any",key:"LinkTypeAny"},{id:"None",key:"LinkTypeNone"},{id:"NotAll",key:"LinkTypeNotAll"}]}(o||(o={}));var r,s,a=n(0),l=n(29),u=n(38),c=n(63),d=n(64),h=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),p=function(t){function e(e){return t.call(this,e)||this}return h(e,t),e.prototype.init=function(){},e.prototype.sendLoadModelRequest=function(t){var e=this,n=this.getContext(),o=n.getServices().getHttpClient(),i=n.resolveEndpoint("GetModel",{modelId:t.modelId});o.get(i).then((function(t){t.model||e.modelLoadingRejectFunc(new Error('Wrong response format for "GetModel" request')),e.modelLoadingResolveFunc(t.model)})).catch((function(t){e.modelLoadingRejectFunc(t)}))},e}(d.a),f=function(){function t(t){this.context=t}return t.prototype.fetchData=function(t){var e=t.query||this.context.getQuery(),n=e.getId(),o={options:t.options};void 0!==t.queryId?o.queryId=t.queryId:o.query=e.toJSONData(),t.debug&&(o.debug=t.debug),t.chunk&&(o.chunk=t.chunk),t.data&&(o.data=t.data),void 0!==t.aux&&(o.aux=t.aux);var i=this.context.resolveEndpoint("FetchData",{modelId:e.getModel().getId(),queryId:n});return this.context.getServices().getHttpClient().post(i,o).then((function(t){return t}))},t}(),g=function(){function t(t){this.context=t}return t.prototype.syncQuery=function(t){var e=(t=t||{}).query||this.context.getQuery(),n=t.options||{},o={query:e.toJSONData(),options:n};t.data&&(o.data=t.data);var i=this.context.resolveEndpoint("SyncQuery",{modelId:e.getModel().getId(),queryId:e.getId()});return this.context.getServices().getHttpClient().post(i,o).then((function(t){return t}))},t}(),y=function(){function t(t){this.context=t}return t.prototype.loadValueList=function(t){var e=t.modelId||this.context.getModel().getId(),n=a.utils.assign({modelId:e},t.params).editorId,o=this.context.getServices().getHttpClient(),i=this.context.resolveEndpoint("GetValueList",{modelId:e,listId:n}),r={};return t&&t.params&&t.params.queryParams&&(r=t.params.queryParams),o.get(i,{queryParams:r}).then((function(t){if(t&&t.values)return t.values;throw new Error('Wrong response format. No "values" property')}))},t}(),m=function(){function t(t){this.context=t}return t.prototype.getQueryFile=function(t){var e=t.query||this.context.getQuery(),n=this.context.resolveEndpoint("GetQueryFile",{modelId:e.getModel().getId(),format:t.format||"xml"}),o=this.context.getServices().getHttpClient().post(n,{query:e.toJSONData()}),i=o.getRequest();return o.then((function(e){var n=new Blob([e]),o=i.getXMLHttpRequest().getResponseHeader("Content-Disposition"),r=o?o.match(/filename="(.*)"/)[1]:"query.json";if(t.fileName&&(r=t.fileName+r.substring(r.lastIndexOf("."))),window.navigator.msSaveOrOpenBlob)window.navigator.msSaveOrOpenBlob(n,r);else{var s=document.createElement("a");document.body.appendChild(s),s.style.display="none",s.href=window.URL.createObjectURL(n),s.download=r,s.click(),window.URL.revokeObjectURL(s.href),document.body.removeChild(s)}}))},t.prototype.uploadQueryFile=function(t){var e=(t=t||{}).query||this.context.getQuery(),n=this.context.resolveEndpoint("UploadQueryFile",{modelId:e.getModel().getId()});return this.context.getServices().getHttpClient().post(n,t.data,{dataType:"form-data"}).then((function(t){return t.query}))},t}(),v=n(65),b=function(){function t(t){this.context=t,this.modelLoader=null,this.queryStorage=null,this.querySynchronizer=null,this.dataFetcher=null,this.valueListResolver=null,this.queryFileLoader=null,this.aggrCalculator=null,this.httpClient=new a.HttpClient,this.httpClient.defaultHeaders["x-eqjs-version"]="7.2.0",this.modelResolver=function(t){return new u.a},this.modelStorageResolver=null,this.queryResolver=function(t){return new l.b(t.getModel())},this.modelLoaderResolver=function(t){return new p(t)},this.queryStorageResolver=function(t){return new c.a(t)},this.querySynchronizerResolver=function(t){return new g(t)},this.vlrResolver=function(t){return new y(t)},this.dataFetcherResolver=function(t){return new f(t)},this.queryFileLoaderResolver=function(t){return new m(t)},this.aggrCalculatoResolver=function(t){return new v.a(t)}}return t.prototype.reset=function(){this.modelStorage=null,this.modelLoader=null,this.queryStorage=null,this.querySynchronizer=null},t.prototype.getHttpClient=function(){return this.httpClient},t.prototype.createDataModel=function(){if(!this.modelResolver)throw"Model resolver is not defined";return this.modelResolver(this.context)},t.prototype.createQuery=function(){if(!this.queryResolver)throw"Query resolver is not defined";return this.queryResolver(this.context)},t.prototype.getModelLoader=function(){if(!this.modelLoader){if(!this.modelLoaderResolver)throw"ModelLoaderResolver is not defined";this.modelLoader=this.modelLoaderResolver(this.context)}return this.modelLoader},t.prototype.getModelStorage=function(){if(!this.modelStorage){if(!this.modelStorageResolver)throw"ModelStorageResolver is not defined";this.modelStorage=this.modelStorageResolver(this.context)}return this.modelStorage},t.prototype.getQueryStorage=function(){if(!this.queryStorage){if(!this.queryStorageResolver)throw"QueryStorageResolver is not defined";this.queryStorage=this.queryStorageResolver(this.context)}return this.queryStorage},t.prototype.getQuerySynchronizer=function(){if(!this.querySynchronizer){if(!this.querySynchronizerResolver)throw"QuerySynchronizerResolver is not defined";this.querySynchronizer=this.querySynchronizerResolver(this.context)}return this.querySynchronizer},t.prototype.getDataFetcher=function(){if(!this.dataFetcher){if(!this.dataFetcherResolver)throw"DataFetcherResolver is not defined";this.dataFetcher=this.dataFetcherResolver(this.context)}return this.dataFetcher},t.prototype.getValueListResolver=function(){if(!this.valueListResolver){if(!this.vlrResolver)throw"Resolver for ValueListResolver is not defined";this.valueListResolver=this.vlrResolver(this.context)}return this.valueListResolver},t.prototype.getQueryFileLoader=function(){if(!this.queryFileLoader){if(!this.queryFileLoaderResolver)throw"Resolver for QueryFileLoader is not defined";this.queryFileLoader=this.queryFileLoaderResolver(this.context)}return this.queryFileLoader},t.prototype.getAggregatesCalculator=function(){if(!this.aggrCalculator){if(!this.aggrCalculatoResolver)throw"Resolver for AggregatesCalculator is not defined";this.aggrCalculator=this.aggrCalculatoResolver(this.context)}return this.aggrCalculator},t.prototype.registerDataModelResolver=function(t){this.modelResolver=t},t.prototype.registerQueryResolver=function(t){this.queryResolver=t},t.prototype.registerModelLoaderResolver=function(t){this.modelLoaderResolver=t},t.prototype.registerModelStorageResolver=function(t){this.modelStorageResolver=t},t.prototype.registerQueryStorageResolver=function(t){this.queryStorageResolver=t},t.prototype.registerDataFetcherResolver=function(t){this.dataFetcherResolver=t},t.prototype.registerQuerySyncronizerResolver=function(t){this.querySynchronizerResolver=t},t.prototype.registerValueListResolver=function(t){this.vlrResolver=t},t.prototype.registerQueryFileLoaderResolver=function(t){this.queryFileLoaderResolver=t},t.prototype.registerAggregatesCalculator=function(t){this.aggrCalculatoResolver=t},t}(),C=n(61),x=n(66),w=n(104),T=n(12),E=n(16),D=n(19),S=n(62),k=n(8),M=n(27);!function(t){t[t.None=0]="None",t[t.Model=1]="Model",t[t.Query=2]="Query",t[t.Result=4]="Result",t[t.Statement=8]="Statement",t[t.QueryStatus=16]="QueryStatus",t[t.All=65535]="All"}(s||(s={}));var I,O=n(60),A=n(23),P=n(33),B=n(21);!function(t){t.LoadModel="LoadModel",t.LoadQuery="LoadQuery",t.LoadQueryList="LoadQueryList",t.NewQuery="NewQuery",t.SaveQuery="SaveQuery",t.RemoveQuery="RemoveQuery",t.SyncQuery="SyncQuery",t.FetchData="FetchData",t.GetValueList="GetValueList",t.ExportResult="ExportResult",t.GetQueryFile="GetQueryFile",t.UploadQueryFile="UploadQueryFile"}(I||(I={}));var _,L=n(105),R=n(13);!function(t){t[t.Error=0]="Error",t[t.Success=1]="Success"}(_||(_={}));var F=function(){function t(t){this.context=t}return t.prototype.setFormat=function(t,e){this.format=t,this.responseType=e},t.prototype.export=function(t){t=t||{};var e=this.context.getServices().getHttpClient(),n=this.format||"csv",o=t.query||this.context.getQuery(),i=o.getModel().getId(),r={settings:t.settings};void 0!==t.queryId?r.queryId=t.queryId:r.query=o.toJSONData(),t.data&&(r.data=t.data);var s=this.context.resolveEndpoint("ExportResult",{modelId:i,format:n}),a=e.post(s,r,{responseType:this.responseType}),l=a.getRequest();return a.then((function(t){var e=new Blob([t]),o=l.getXMLHttpRequest().getResponseHeader("Content-Disposition"),i=o?o.match(/filename="(.*)"/)[1]:"export-data."+n;if(window.navigator.msSaveOrOpenBlob)window.navigator.msSaveOrOpenBlob(e,i);else{var r=document.createElement("a");document.body.appendChild(r),r.style.display="none",r.href=window.URL.createObjectURL(e),r.download=i,r.click(),window.URL.revokeObjectURL(r.href),document.body.removeChild(r)}}))},t}(),Q=function(){return Q=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Q.apply(this,arguments)},j=function(){function t(){var t=this;this.servicesInitialized=!1,this.internalListCache={},this.loadModelOnStart=!0,this.loadQueryOnStart=!1,this.useStoredQueryOnFetch=!1,this.debugMode=!1,this._backendInfo={type:"EQN-ANC",subType:"asp-net-core-razor"},this.endpointVarsRegex=/\{.*?\}/g,this.elasticPaging=!1,this._predefinedListRequestHandlers={_DSDE:function(e,n){return n(t.getModel().getAllDateMacros().map((function(t){return{id:"${{"+t+"}}",text:a.i18n.getText(t)}}))),!0},_DSTE:function(e,n){return n(t.getModel().getAllTimeMacros().map((function(t){return{id:"${{"+t+"}}",text:a.i18n.getText(t)}}))),!0}},this._listRequestHandler=function(e,n){if(null!=e&&e.listName){var o=t.getQuery(),i=a.utils.assign({listName:e.listName},e.editorParams),r={},s=/@{{(.+?)}}/;for(var l in i)if(i[l]){var u=i[l].match(s);if(u){var c=o.getOneValueForAttr(u[1]);c||(c=""),r[l]=i[l].replace(s,c)}}var d={listName:r.listName,editorId:e.editorId,queryParams:r},h=t.getListFromCache(e);if(h&&h.length>0)n(h);else{var p=!1,f=t._predefinedListRequestHandlers[e.editorId];f&&(p=f(e,n)),!p&&t.clientListRequestHandler&&(p=t.clientListRequestHandler(e,n)),p||t.loadValueList({params:d,success:function(o){o&&t.addListToCache(e,o),n(o)},error:function(t){n(null)}})}}},this.baseEndpoint="api/easyquery",this.eqServices=new b(this),this.widgets=new Array,this.eventEmitter=new a.EventEmitter(this),this.exporters=new Map,this.endpoints=new Map,this.dataLoader=new x.a(this),this.resultTable=new a.EasyDataTable({loader:this.dataLoader,onUpdate:this.onResultTableUpdate.bind(this)}),this.resultTable.id="ResultTable",this.errorHandlerId=this.addEventListener("error",(function(t,e){e.result=_.Error;var n=e.action?e.action+" error":"Error",o=e.text?e.text:"";e.sourceError&&e.sourceError.message!==o&&(o+="\n"+e.sourceError),console.error(n+": "+o)}))}return t.prototype.getServices=function(){return this.eqServices},t.prototype.registerExporter=function(t,e){this.exporters.set(t,e)},t.prototype.registerServerExporter=function(t,e){this.registerExporter(t,(function(n){var o=new F(n);return o.setFormat(t,e),o}))},t.prototype.getExporter=function(t){var e=this.exporters.get(t);return e?e(this):null},t.prototype.getExportFormats=function(){return Array.from(this.exporters.keys())},t.prototype.addDefaultExporters=function(){this.registerServerExporter("csv",""),this.registerServerExporter("excel-html","")},t.prototype.resolveEndpoint=function(t,e){e=e||{};var n=this.endpoints.get(t);if(!n)throw t+" endpoint is not defined";var o=n.match(this.endpointVarsRegex);if(o)for(var i=0,r=o;i<r.length;i++){var s=r[i],a=s.substring(1,s.length-1),l=e[a];if(!l)if("modelId"==a)l=this.getModel().getId();else{if("queryId"!=a)throw"Parameter ["+a+"] is not defined";l=this.getQuery().getId()}n=n.replace(s,l)}return n},t.prototype.setEndpoint=function(t,e){this.endpoints.set(t,e)},t.prototype.setEnpointIfNotExist=function(t,e){this.endpoints.has(t)||this.endpoints.set(t,e)},t.prototype.setDefaultEndpoints=function(t){this.setEnpointIfNotExist("GetModel",i.a.combinePath(t,"models/{modelId}")),this.setEnpointIfNotExist("GetQuery",i.a.combinePath(t,"models/{modelId}/queries/{queryId}")),this.setEnpointIfNotExist("SaveQuery",i.a.combinePath(t,"models/{modelId}/queries/{queryId}")),this.setEnpointIfNotExist("SyncQuery",i.a.combinePath(t,"models/{modelId}/queries/{queryId}/sync")),this.setEnpointIfNotExist("NewQuery",i.a.combinePath(t,"models/{modelId}/queries")),this.setEnpointIfNotExist("RemoveQuery",i.a.combinePath(t,"models/{modelId}/queries/{queryId}")),this.setEnpointIfNotExist("GetQueryList",i.a.combinePath(t,"models/{modelId}/queries")),this.setEnpointIfNotExist("FetchData",i.a.combinePath(t,"models/{modelId}/fetch")),this.setEnpointIfNotExist("GetValueList",i.a.combinePath(t,"models/{modelId}/valuelists/{listId}")),this.setEnpointIfNotExist("ExportResult",i.a.combinePath(t,"models/{modelId}/export/{format}")),this.setEnpointIfNotExist("GetQueryFile",i.a.combinePath(t,"models/{modelId}/getqueryfile/{format}")),this.setEnpointIfNotExist("UploadQueryFile",i.a.combinePath(t,"models/{modelId}/uploadqueryfile"))},t.prototype.initStart=function(){this.servicesInitialized=!0},t.prototype.init=function(t){var e=this;(this.servicesInitialized||this.initStart(),void 0!==(t=t||{}).debugMode&&(this.debugMode=t.debugMode),void 0!==t.chunkSize&&(this.resultTable.chunkSize=t.chunkSize),void 0!==t.elasticPaging&&(this.elasticPaging=t.elasticPaging),t.listCache&&this.setExternalListCache(t.listCache),t.locale&&a.i18n.setCurrentLocale(t.locale),t.localeSettings&&a.i18n.updateLocaleSettings(t.localeSettings),t.endpoint&&(this.baseEndpoint=t.endpoint,console.warn("The `endpoint` option is deprecated.\nPlease use `context.useEndpoint(endpointURL)` function instead.")),this.setDefaultEndpoints(this.baseEndpoint),t.modelStorageResolver)&&this.getServices().registerModelStorageResolver(t.modelStorageResolver);if(this.loadQueryOnStart=!1,t.loadQueryOnStart&&(this.loadQueryOnStart=t.loadQueryOnStart),this.loadModelOnStart=!0,void 0!==t.loadModelOnStart&&(this.loadModelOnStart=t.loadModelOnStart),t.handlers&&(t.handlers.onInit&&this.addEventListener("ready",t.handlers.onInit),t.handlers.afterLoadModel&&this.addEventListener("loadModel",t.handlers.afterLoadModel),t.handlers.afterLoadQuery&&this.addEventListener("loadQuery",t.handlers.afterLoadQuery),t.handlers.afterSyncQuery&&this.addEventListener("syncQuery",t.handlers.afterSyncQuery),t.handlers.afterFetchData&&this.addEventListener("fetchData",t.handlers.afterFetchData),t.handlers.afterExportResult&&this.addEventListener("exportResult",t.handlers.afterExportResult),t.handlers.onProcessStart&&this.addEventListener("processStart",t.handlers.onProcessStart),t.handlers.onProcessEnd&&this.addEventListener("processEnd",t.handlers.onProcessEnd),t.handlers.onError&&(this.removeEventListener("error",this.errorHandlerId),this.addEventListener("error",t.handlers.onError)),t.handlers.onListRequest&&(this.clientListRequestHandler=t.handlers.onListRequest),t.handlers.beforeLoadModel&&(this.beforeLoadModel=t.handlers.beforeLoadModel),t.handlers.beforeLoadQuery&&(this.beforeLoadQuery=t.handlers.beforeLoadQuery),t.handlers.beforeSyncQuery&&(this.beforeSyncQuery=t.handlers.beforeSyncQuery),t.handlers.beforeFetchData&&(this.beforeFetchData=t.handlers.beforeFetchData),t.handlers.beforeExportResult&&(this.beforeExportResult=t.handlers.beforeExportResult)),this.initialQuery=t.initialQuery,this.defaultQueryId=t.defaultQueryId||"",this.defaultModelId=t.defaultModelId||"__default",this.eqServices.getModelLoader().init(t),this.eqServices.getQueryStorage().init(t),!1!==t.useDefaultExporters&&this.addDefaultExporters(),t.serverExporters)for(var n=0,o=t.serverExporters;n<o.length;n++){var i=o[n],r="csv"==i||"excel-html"==i?"":"arraybuffer";this.registerServerExporter(i,r)}var s=this.getQuery();t.defaultQueryId&&s.setId(t.defaultQueryId),this.widgets.forEach((function(n){var o={};t.widgets&&t.widgets[n.getWidgetType()]&&(o=t.widgets[n.getWidgetType()]),n.init(e,o)})),this.loadModelOnStart?this.loadDefaultModel():this.fireEvent("ready")},Object.defineProperty(t.prototype,"backendInfo",{get:function(){return this._backendInfo},enumerable:!0,configurable:!0}),t.prototype.useEndpoint=function(t){return this.baseEndpoint=t,this},t.prototype.useBackend=function(t){if(t.type&&(this._backendInfo.type=t.type),t.subType)this._backendInfo.subType=t.subType;else switch(this._backendInfo.type){case"EQN-ANC":this._backendInfo.subType="asp-net-core-razor";break;case"EQN-ASP":this._backendInfo.subType="asp-net-4-mvc";break;default:this._backendInfo.subType="other"}return this},t.prototype.addWidget=function(t){this.widgets.push(t)},t.prototype.getAllWidgetsByType=function(t){return this.widgets.filter((function(e){return e.getWidgetType()===t}))},t.prototype.getWidgetByType=function(t){var e=this.getAllWidgetsByType(t);return e.length>0?e[0]:null},t.prototype.refreshWidgets=function(t){void 0===t&&(t=s.All),this.widgets.forEach((function(e){e.belongsToGroup(t)&&e.refresh()}))},t.prototype.addQueryChangedCallback=function(t){this.getQuery().addChangedCallback(t)},t.prototype.removeQueryChangedCallback=function(t){this.getQuery().removeChangedCallback(t)},t.prototype.createQuery=function(){return this.eqServices.createQuery()},t.prototype.getQuery=function(){if(!this.query){if(!this.servicesInitialized)throw new Error("Can't create query until the context is initialized");this.query=this.createQuery()}return this.query},t.prototype.getModel=function(){return this.dataModel||(this.dataModel=this.eqServices.createDataModel()),this.dataModel},t.prototype.loadModelFromData=function(t){this.getQuery().loadModelData(t),this.dataModel=this.getQuery().getModel()},t.prototype.setDefaultModelId=function(t){this.defaultModelId=t},t.prototype.startProcess=function(t,e){this.eventEmitter.fire("processStart",t),this.widgets.forEach((function(t){t.belongsToGroup(e)&&t.onProcessStart()}))},t.prototype.endProcess=function(t,e){this.eventEmitter.fire("processEnd",t),t.result===_.Error&&this.throwError(t),this.widgets.forEach((function(t){t.belongsToGroup(e)&&t.onProcessEnd()}))},t.prototype.throwError=function(t){t.result=_.Error,this.eventEmitter.fire("error",t)},t.prototype.loadDefaultModel=function(){var t=this;this.loadModel({modelId:this.defaultModelId,silent:!0,success:function(){t.refreshWidgets(s.Model);var e=t.getQuery();t.fireEvent("initialModelLoad"),t.initialQuery&&e.loadFromData(t.initialQuery,{changeStatus:!1}),t.loadQueryOnStart?t.loadQuery({queryId:t.defaultQueryId,modelId:t.defaultModelId,success:function(){t.refreshWidgets(s.Query),t.fireEvent("ready")}}):(t.refreshWidgets(s.Query),t.fireEvent("ready"))}})},t.prototype.clearQuery=function(){var t=this.getQuery();t.clear(),t.fireChangedEvent({part:R.b.All})},t.prototype.clearResult=function(){this.resultTable.clear(),this.resultStatement=null,this.resultContent=null},t.prototype.setExternalListCache=function(t){this.externalListCache=t},t.prototype.getListFromCache=function(t){var e=this.getListCacheKey(t);return this.externalListCache?this.externalListCache.get(e):this.internalListCache[e]},t.prototype.getListCacheKey=function(t){var e="SQL"==t.listName?"SQL_"+t.editorId:t.listName;return t.queryParams&&(e+="_"+Object.keys(t.queryParams).filter((function(t){return"listName"!=t})).map((function(e){return t.queryParams[e]})).join("_")),e},t.prototype.addListToCache=function(t,e){var n=this.getListCacheKey(t);this.externalListCache?this.externalListCache.set(n,e):this.internalListCache[n]=e},t.prototype.resetListCache=function(){this.externalListCache?this.externalListCache.clear():this.internalListCache={}},t.prototype.getListRequestHandler=function(){return this._listRequestHandler},t.prototype.addLocale=function(t,e){a.i18n.addLocale(t,e)},t.prototype.addEventListener=function(t,e){var n=this;return this.eventEmitter.subscribe(t,(function(t){return e(n,t.data)}))},t.prototype.removeEventListener=function(t,e){this.eventEmitter.unsubscribe(t,e)},t.prototype.fireEvent=function(t,e){this.eventEmitter.fire(t,e)},t.prototype.getBaseEndpoint=function(){return this.baseEndpoint},t.prototype.loadValueList=function(t){var e=this;t=t||{},this.startProcess({action:I.GetValueList,text:"Loading values"},s.Result),this.eqServices.getValueListResolver().loadValueList(t).then((function(n){e.endProcess({result:_.Success,action:I.GetValueList,text:"Values loaded"},s.Result),t.success&&t.success(n)})).catch((function(n){var o="Can't load the value list for editor "+(t&&t.params?t.params.editorId:"undefined")+".\n "+n.message;e.endProcess({result:_.Error,action:I.GetValueList,text:o,sourceError:n},s.Result),t.error&&t.error(o,"GetValueList")}))},t.prototype.loadModel=function(t){var e=this;this.beforeLoadModel&&this.beforeLoadModel(this,t);var n=t.modelId||"__default",o=t.silent||!1;return this.startProcess({action:I.LoadModel,text:"Loading model: "+n},s.Model),this.eqServices.getModelLoader().startModelLoading(t).then((function(i){return i?(e.loadModelFromData(i),e.dataModel.isEmpty()&&console.warn("Empty model has been loaded. Model ID: "+e.dataModel.getId())):console.warn("Model has not been changed."),e.fireEvent("loadModel"),e.endProcess({result:_.Success,action:I.LoadModel,text:"Model loaded: "+n},s.Model),o||(e.clearQuery(),e.clearResult(),e.refreshWidgets()),t.success&&t.success(e.getModel()),e.getModel()})).catch((function(o){var i="Can't load model "+n+".\n "+o.message;return e.endProcess({result:_.Error,action:I.LoadModel,text:i,sourceError:o},s.Model),t.error&&t.error(i,"LoadModel"),e.getModel()}))},t.prototype.callWhenModelLoaded=function(t){this.eqServices.getModelLoader().getModelPromise().then((function(){t()}))},t.prototype.loadQuery=function(t){var e=this;t=t||{};var n=this.eqServices.getModelLoader();this.clearResult(),n.getModelPromise().then((function(){var n=(t=t||{}).queryId,o=t.silent||!1;e.beforeLoadQuery&&e.beforeLoadQuery(e,t),e.startProcess({action:I.LoadQuery,text:"Query loading: "+n},s.Query),e.eqServices.getQueryStorage().loadQuery(t).then((function(i){i&&e.query.loadFromData(i,{validate:!1}),e.fireEvent("loadQuery"),e.endProcess({result:_.Success,action:I.LoadQuery,text:"Query loaded: "+n},s.Query),e.query.resetModified(),o||(e.query.fireChangedEvent({part:R.b.Properties,wasModified:e.query.isModified()}),e.refreshWidgets()),t.success&&t.success(e.query)})).catch((function(n){var o=e.getQuery();n.message="Can't load query ["+o.getId()+"]\n"+(n.message||""),t.error&&t.error(n.message,I.LoadQuery),e.endProcess({result:_.Error,action:I.LoadQuery,text:n.message,sourceError:n},s.Query)}))})).catch((function(t){console.error(t)}))},t.prototype.loadQueryList=function(t){var e=this;this.eqServices.getModelLoader().getModelPromise().then((function(){e.startQueryListLoading(t)})).catch((function(t){var n="Can't load the list of available queries.\n "+t.message;e.throwError({action:I.LoadQueryList,text:n,sourceError:t})}))},t.prototype.startQueryListLoading=function(t){var e=this;t=t||{},this.eqServices.getQueryStorage().getQueryList(t).then((function(e){t.success&&t.success(e)})).catch((function(n){var o="Can't load the list of available queries.\n "+n.message;t.error?t.error(o,"LoadQueryList"):e.throwError({action:I.LoadQueryList,text:o,sourceError:n})}))},t.prototype.newQuery=function(t){var e=this,n=void 0===(t=t||{}).clearQuery||t.clearQuery;this.query.reset(n),t.queryId&&this.query.setId(t.queryId),t.name&&this.query.setName(t.name),t.description&&this.query.setDescription(t.description);var o=t.silent||!1,i=!0;void 0!==t.useStorage&&(i=t.useStorage);var r=function(){var t=e.getQuery();t.isNewbie=!0,o||t.fireChangedEvent({part:R.b.All,wasModified:t.isModified()})};i?(this.startProcess({action:I.NewQuery,text:"New query creation..."},s.Query),this.eqServices.getQueryStorage().newQuery(t).then((function(n){n&&e.query.loadFromData(n),e.endProcess({result:_.Success,action:I.NewQuery,text:"A new query has been created"},s.Query),r(),t.success&&t.success()})).catch((function(n){var o="Can't create a new query.\n"+n.message;e.endProcess({result:_.Error,action:I.NewQuery,text:o,sourceError:n},s.Query),t.error&&t.error(o,"NewQuery")}))):r();return this.query},t.prototype.saveQuery=function(t){var e=this;t=t||{};var n=this.getQuery();this.startProcess({action:I.SaveQuery,text:"Query saving: "+n.getId()},s.Query),this.eqServices.getQueryStorage().saveQuery(t).then((function(o){e.endProcess({action:I.SaveQuery,result:_.Success,text:"Query saved: "+n.getId()},s.Query),o&&n.loadFromData(o),n.resetModified(),n.isNewbie=!1,t.success&&t.success()})).catch((function(o){var i="Can't save query "+n.getId()+".\n "+o.message;e.endProcess({action:I.SaveQuery,result:_.Error,text:i,sourceError:o},s.Query),t.error&&t.error(i,I.SaveQuery)}))},t.prototype.removeQuery=function(t){var e=this;t=t||{};var n=this.getQuery();this.startProcess({action:I.RemoveQuery,text:"Query deleting: "+n.getId()},s.Query),this.eqServices.getQueryStorage().removeQuery(t).then((function(){n.reset(),e.endProcess({action:I.RemoveQuery,result:_.Success,text:"Query deleted: "+n.getId()},s.Query),t.success&&t.success()})).catch((function(o){var i="Can't remove query "+n.getId()+".\n "+o.message;e.endProcess({action:I.RemoveQuery,result:_.Error,text:i,sourceError:o},s.Query),t.error&&t.error(i,"RemoveQuery")}))},t.prototype.syncQuery=function(t){var e=this;t=t||{};var n=this.getQuery();this.beforeSyncQuery&&this.beforeSyncQuery(this,t),this.startProcess({action:I.SyncQuery,text:"Query syncing: "+n.getId()},s.Query),this.eqServices.getQuerySynchronizer().syncQuery(t).then((function(o){if(e.resultStatement=o&&o.statement?o.statement:"",e.fireEvent("syncQuery"),e.refreshWidgets(s.Statement),e.endProcess({result:_.Success,action:I.SyncQuery,text:"Query synced: "+n.getId()},s.Query),o){if(o.querySaved){var i=o.query;i&&(n.setId(i.id),n.setName(i.name),n.setDescription(i.desc),n.extraData=i.extraData),n.resetModified(),e.refreshWidgets(s.QueryStatus)}t.success&&t.success(o)}})).catch((function(o){var i="Can't synchronize query "+n.getId()+".\n "+o.message;e.endProcess({result:_.Error,action:I.SyncQuery,text:i,sourceError:o},s.Query),t.error&&t.error(i,"SyncQuery")}))},t.prototype.fetchData=function(t){var e=this,n=void 0!==(t=t||{}).elasticPaging?t.elasticPaging:this.elasticPaging;this.resultTable.elasticChunks=n,t.chunk=t.chunk||{offset:0,limit:this.resultTable.chunkSize,needTotal:!n},this.debugMode&&(t.debug="Fetching the result set. Initial chunk"),this.query.tryValidate({checkExpressions:!0})&&(t.groupFetchSuccess&&(this.afterGroupFetch=t.groupFetchSuccess),this.resultTable.elasticChunks&&t.chunk.limit++,this.fetchDataChunk(Q(Q({},t),{success:function(n){if(n.statement&&(e.resultStatement=n.statement,e.refreshWidgets(s.Statement)),e.getServices().getAggregatesCalculator().reset(),e.resultContent=n,n.resultSet){e.resultTable.clear(),e.resultTable.id=e.query.getId();for(var o=n.resultSet,i=0,r=o.cols;i<r.length;i++){var a=r[i];e.resultTable.columns.add(a)}n.meta&&void 0!==n.meta.totalRecords&&e.resultTable.setTotal(n.meta.totalRecords);var l=o.rows.length;e.resultTable.elasticChunks&&l===t.chunk.limit&&o.rows.splice(o.rows.length-1,1);for(var u=0,c=o.rows;u<c.length;u++){var d=c[u];e.resultTable.addRow(d)}e.resultTable.elasticChunks&&(e.resultTable.total=l<t.chunk.limit?o.rows.length:0),e.resultTable.fireUpdated()}t.success&&t.success(n)}})))},t.prototype.getQueryFile=function(t){var e=this,n=this.getQuery();this.startProcess({action:I.GetQueryFile,text:"Getting query file: "+n.getId()},s.Query),this.getServices().getQueryFileLoader().getQueryFile(t).then((function(){e.endProcess({result:_.Success,action:I.GetQueryFile,text:"Getting query file: "+n.getId()},s.Result),t.success&&t.success()})).catch((function(o){var i="Can't get file for query "+n.getId()+".\n "+o.message;e.endProcess({result:_.Error,action:I.GetQueryFile,text:i,sourceError:o},s.Query),t.error&&t.error(i,"GetQueryFile")}))},t.prototype.uploadQueryFile=function(t){var e=this,n=this.getQuery();this.startProcess({action:I.UploadQueryFile,text:"Uploading query file: "+n.getId()},s.Query),this.getServices().getQueryFileLoader().uploadQueryFile(t).then((function(o){n.loadFromData(o),e.fireEvent("loadQuery"),e.refreshWidgets(),e.endProcess({result:_.Success,action:I.UploadQueryFile,text:"Uploading query file: "+n.getId()},s.Result),t.success&&t.success()})).catch((function(o){var i="Can't upload a file for query "+n.getId()+".\n "+o.message;e.endProcess({result:_.Error,action:I.UploadQueryFile,text:i,sourceError:o},s.Query),t.error&&t.error(i,"UploadQueryFile")}))},t.prototype.fetchDataChunk=function(t){var e=this,n=this.getQuery().getId(),o=t||{};this.useStoredQueryOnFetch&&(o.queryId=this.query.getId()),this.beforeFetchData&&this.beforeFetchData(this,o),this.startProcess({action:I.FetchData,text:"Fetching data for the query: "+n},s.Result),this.eqServices.getDataFetcher().fetchData(o).then((function(t){t.statement&&(e.resultStatement=t.statement),e.resultContent=t,o.success&&o.success(t),e.fireEvent("fetchData"),e.endProcess({result:_.Success,action:I.FetchData,text:"Data fetching is finished for the query: "+n},s.Result)})).catch((function(t){var i="Data fetching error for the query "+n+". \n"+t.message;e.endProcess({result:_.Error,action:I.FetchData,text:i,sourceError:t},s.Result),o.error&&o.error(i,I.FetchData)}))},t.prototype.onResultTableUpdate=function(){var t=this,e=this.query.getAggregationSettings(),n=this.getServices().getAggregatesCalculator();e.needAggrCalculation()&&n.needRecalculation()&&n.calculate({maxLevel:e.getGroups().length+1,resultObtained:function(e,n){t.afterGroupFetch&&t.afterGroupFetch(e)},errorOccurred:function(e){var n="Data fetching error on group level "+e.level+" query. \n"+e.message;t.throwError({action:I.FetchData,text:n,sourceError:e})}})},t.prototype.fetchDrillDownData=function(t){var e=this;(t=t||{}).chunk=t.chunk||{offset:0,limit:this.resultTable.chunkSize,needTotal:!0};var n=t.query.getId();this.startProcess({action:I.FetchData,text:"DrillDown executing: "+n},s.Result),this.eqServices.getDataFetcher().fetchData(t).then((function(o){e.endProcess({result:_.Success,action:I.FetchData,text:"DrillDown execution error: "+n},s.Result),t.success&&t.success(o)})).catch((function(o){var i="Drill-down data fetching error for query "+n+". \n"+o.message;e.endProcess({result:_.Error,action:I.FetchData,text:i},s.Result),t.error?t.error(i,"DrillDown"):e.throwError({action:I.FetchData,text:i})}))},t.prototype.exportResult=function(t){var e=this;t=t||{},this.beforeExportResult&&this.beforeExportResult(this,t);var n=t.format;if(n){var o=this.getExporter(n);if(o){var i=this.getQuery().getId();this.useStoredQueryOnFetch&&(t.queryId=i),this.startProcess({action:I.ExportResult,text:"Exporting result for query: "+i},s.Result);var r=a.i18n.getLocaleSettings();t.settings=r;var l=this.query.getAggregationSettings();l.hasAggregates()&&(l.hasGrandTotals()||l.hasGroups())&&(t.aggregates=l.saveToData()),o.export(t).then((function(n){e.fireEvent("exportResult"),e.endProcess({result:_.Success,action:I.ExportResult,text:"The result set for query ["+i+"] has been successfully exported"},s.Result),t.success&&t.success()})).catch((function(n){var o="Error on exporting data for query "+i+". \n"+n.message;e.endProcess({result:_.Error,action:I.ExportResult,text:o,sourceError:n},s.Result),t.error&&t.error(o,"ExportResult")}))}}},t}(),q=function(){function t(t){this.slot=t,this._id=a.utils.generateId(this.getWidgetType())}return Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),t.prototype.init=function(t,e){this.context=t},t.prototype.getContext=function(){return this.context},t.prototype.refresh=function(){this.refreshCore()},t.prototype.refreshCore=function(){},t.prototype.onProcessStart=function(){this.onProcessStartCore()},t.prototype.onProcessStartCore=function(){},t.prototype.onProcessEnd=function(){this.onProcessEndCore()},t.prototype.onProcessEndCore=function(){},t.prototype.belongsToGroup=function(t){return void 0===t||null==t||0!=(t&this.group)},t.prototype.destroy=function(){this.destroyCore()},t.prototype.destroyCore=function(){},t}(),N=n(28),H=n(50),W=n(20),G=n(59),V=new(function(){function t(t,e,n){this.major=t,this.minor=e,this.update=n}return t.prototype.toString=function(){return this.major+"."+this.minor+"."+this.update},t}())(6,2,0);a.i18n.updateDefaultTexts({NewQueryName:"[New query]",Today:"Today",Yesterday:"Yesterday",Tomorrow:"Tomorrow",FirstDayOfMonth:"First day of the month",LastDayOfMonth:"Last day of the month",FirstDayOfWeek:"First day of the week",FirstDayOfYear:"First day of the year",FirstDayOfNextWeek:"First day of the next week",FirstDayOfNextMonth:"First day of the next month",FirstDayOfNextYear:"First day of the next year",Now:"Now",HourStart:"This hour start",Midnight:"Midnight",Noon:"Noon",Entities:{},Attributes:{},Operators:{},AggreateFunctions:{}})},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return browserUtils}));var _utils__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(4),browserUtils;(function(browserUtils){var _isFirefox=null,_isIE=null;function isIE(){return eval("/*@cc_on!@*/false || !!document.documentMode")}function isFirefox(){if(null===_isFirefox){var t=navigator.userAgent;_isFirefox=t.toLowerCase().indexOf("firefox")>-1}return _isFirefox}browserUtils.isIE=isIE,browserUtils.isFirefox=isFirefox;var _detectedIsMobileMode=!1,_isMobileMode=void 0,detectIsMobileMode=function(){var t=isMobileMode();_detectedIsMobileMode=window.matchMedia("only screen and (max-width: 840px)").matches||window.matchMedia("only screen and (max-height: 420px)").matches;var e=isMobileMode();e!==t&&mobileModeChangeHandler&&mobileModeChangeHandler(e)},mobileModeChangeHandler;function isMobileMode(){return void 0!==_isMobileMode?_isMobileMode:_detectedIsMobileMode}function setIsMobileMode(t){var e=isMobileMode();_isMobileMode=t;var n=isMobileMode();n!==e&&mobileModeChangeHandler&&mobileModeChangeHandler(n)}function onMobileModeChanged(t){mobileModeChangeHandler=t}function getMobileCssClass(){return isMobileMode()?_utils__WEBPACK_IMPORTED_MODULE_0__.a:null}detectIsMobileMode(),window.addEventListener("resize",(function(){return detectIsMobileMode()})),browserUtils.isMobileMode=isMobileMode,browserUtils.setIsMobileMode=setIsMobileMode,browserUtils.onMobileModeChanged=onMobileModeChanged,browserUtils.getMobileCssClass=getMobileCssClass})(browserUtils||(browserUtils={}))},function(t,e,n){"use strict";n.d(e,"c",(function(){return o})),n.d(e,"d",(function(){return i})),n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return s}));n(1);function o(t){for(var e=0;null!==t;){var n=document.defaultView.getComputedStyle(t,null).getPropertyValue("z-index");if("auto"!=n){var o=parseInt(n);o>e&&(e=o)}t=t.parentElement}return e}function i(t){setTimeout((function(e){t&&t.focus()}),100)}var r="eqjs",s="eqjs-mobile"},function(t,e,n){"use strict";var o;n.d(e,"a",(function(){return o})),function(t){t[t.Column=3]="Column",t[t.Histogram=4]="Histogram",t[t.Bar=5]="Bar",t[t.Combo=6]="Combo",t[t.Area=7]="Area",t[t.Line=9]="Line",t[t.Pie=10]="Pie",t[t.Polar=11]="Polar",t[t.Doughnut=12]="Doughnut",t[t.Radar=13]="Radar",t[t.SteppedLine=14]="SteppedLine"}(o||(o={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"d",(function(){return l})),n.d(e,"b",(function(){return u})),n.d(e,"c",(function(){return c})),n.d(e,"e",(function(){return d}));var o,i=n(69),r=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var o=Array(t),i=0;for(e=0;e<n;e++)for(var r=arguments[e],s=0,a=r.length;s<a;s++,i++)o[i]=r[s];return o},a=function(){function t(t,e){this.element="string"==typeof t?document.createElement(t):t,e&&this.element.parentElement!==e&&e.appendChild(this.element)}return t.prototype.addChild=function(t,e){var n=d(t,this.element);return e&&e(n),this},t.prototype.addChildElement=function(t){return t&&this.element.appendChild(t),this},t.prototype.attr=function(t,e){return this.element.setAttribute(t,e),this},t.prototype.id=function(t){return this.attr("id",t)},t.prototype.focus=function(){return this.element.focus(),this},t.prototype.title=function(t){return this.attr("title",t)},t.prototype.data=function(t,e){return void 0===e&&(e=null),null===e?(this.element.removeAttribute("data-"+t),this):this.attr("data-"+t,e)},t.prototype.show=function(){return this.removeStyle("display")},t.prototype.hide=function(t){return void 0===t&&(t=!0),t?this.setStyle("display","none"):this},t.prototype.visible=function(t){return void 0===t&&(t=!0),t?this.setStyle("visibility","visible"):this.setStyle("visibility","hidden")},t.prototype.isVisible=function(){return!!(this.element.offsetWidth||this.element.offsetHeight||this.element.getClientRects().length)},t.prototype.addClass=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(t)for(var o=s(t.trim().split(" "),e),i=0;i<o.length;i++)this.element.classList.add(o[i]);return this},t.prototype.removeClass=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(t)for(var o=s(t.trim().split(" "),e),i=0;i<o.length;i++)this.element.classList.remove(o[i]);return this},t.prototype.toggleClass=function(t,e){return void 0===e&&(e=void 0),t&&this.element.classList.toggle(t,e),this},t.prototype.on=function(t,e){for(var n=t.split(" "),o=0;o<n.length;o++)this.element.addEventListener(n[o],e);return this},t.prototype.off=function(t,e){for(var n=t.split(" "),o=0;o<n.length;o++)this.element.removeEventListener(n[o],e);return this},t.prototype.setStyle=function(t,e){return this.element.style.setProperty(t,e),this},t.prototype.removeStyle=function(t){return this.element.style.removeProperty(t),this},t.prototype.text=function(t){return this.element.innerText=t,this},t.prototype.html=function(t){return this.element.innerHTML=t,this},t.prototype.clear=function(){var t=this.element;this.element=document.createElement(this.element.tagName),t.replaceWith(this.element)},t.prototype.addText=function(t){var e=document.createTextNode(t);return this.element.appendChild(e),this},t.prototype.addHtml=function(t){return this.element.innerHTML+=t,this},t.prototype.toDOM=function(){return this.element},t.prototype.appendTo=function(t){return t&&t.appendChild(this.element),this},t}(),l=function(t){function e(e,n){return e?t.call(this,e,n)||this:t.call(this,"textarea",n)||this}return r(e,t),e.prototype.name=function(t){return this.element.name=t,this},e.prototype.rows=function(t){return this.element.rows=t,this},e.prototype.cols=function(t){return this.element.cols=t,this},e.prototype.value=function(t){return this.element.value=t,this},e}(a),u=function(t){function e(e,n){return e?t.call(this,e,n)||this:t.call(this,"input",n)||this}return r(e,t),e.prototype.name=function(t){return this.element.name=t,this},e.prototype.type=function(t){return this.element.type=t,this},e.prototype.size=function(t){return this.element.size=t,this},e.prototype.value=function(t){return t instanceof Date?this.element.valueAsDate=t:"number"==typeof t?this.element.valueAsNumber=t:this.element.value=t,this},e.prototype.mask=function(t){return Object(i.a)(this.element,t),this},e}(a),c=function(t){function e(e,n){return e?t.call(this,e,n)||this:t.call(this,"select",n)||this}return r(e,t),e.prototype.addOption=function(t){var e=document.createElement("option");return"string"==typeof t?(e.value=t,e.innerHTML=t):(e.value=t.value,e.innerHTML=t.title||t.value,e.selected=t.selected||!1),this.element.appendChild(e),this},e.prototype.value=function(t){return this.element.value=t,this},e}(a);function d(t,e){return"div"===t||t instanceof HTMLDivElement||"span"===t||t instanceof HTMLSpanElement||"a"===t||t instanceof HTMLAnchorElement||"button"===t||t instanceof HTMLButtonElement||"img"===t||t instanceof HTMLImageElement?new a(t,e):"input"===t||t instanceof HTMLInputElement?new u(t instanceof HTMLInputElement?t:null,e):"textarea"===t||t instanceof HTMLTextAreaElement?new l(t instanceof HTMLTextAreaElement?t:null,e):"select"===t||t instanceof HTMLSelectElement?new c(t instanceof HTMLSelectElement?t:null,e):new a(t,e)}},function(t,e,n){"use strict";var o;n.d(e,"a",(function(){return o})),function(t){t[t.Unknown=0]="Unknown",t[t.String=1]="String",t[t.Byte=2]="Byte",t[t.Word=3]="Word",t[t.Int32=4]="Int32",t[t.Int64=5]="Int64",t[t.Bool=6]="Bool",t[t.Float=7]="Float",t[t.Currency=8]="Currency",t[t.BCD=9]="BCD",t[t.Date=10]="Date",t[t.Time=11]="Time",t[t.DateTime=12]="DateTime",t[t.Autoinc=13]="Autoinc",t[t.Memo=14]="Memo",t[t.Blob=15]="Blob",t[t.FixedChar=16]="FixedChar",t[t.Guid=17]="Guid",t[t.Geometry=18]="Geometry",t[t.Geography=19]="Geography"}(o||(o={}))},function(t,e,n){"use strict";var o;n.d(e,"a",(function(){return o})),function(t){t[t.Unknown=0]="Unknown",t[t.Constant=1]="Constant",t[t.EntityAttribute=2]="EntityAttribute",t[t.ParentEntityAttribute=3]="ParentEntityAttribute",t[t.AggregateFunction=4]="AggregateFunction",t[t.ParentColumn=5]="ParentColumn",t[t.Query=11]="Query",t[t.CustomSql=21]="CustomSql"}(o||(o={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var o=n(0),i=n(1),r=n(3),s=n(4),a=function(){function t(t){this.isFilteringMode=!1,this.showSelected=!1,this.parentMenu=t.menu||null,this.parentLevel=t.parent||null,this.parentElement=t.container||document.body,this.levelIndex=t.levelIndex||0,this.levelDiv=null,this.domWriteItemsId=t.domWriteItemsId||!1,this.menuId=t.menuId||"",this.itemRenderedCallback=t.itemRenderedCallback||null,this._applyItem={id:null,text:null,itemDiv:null},this.items=t.items||[],this.activeItem=null,this.selectedItem=null,this.initialized=!1,this.showSelected=t.showSelected,this.updated=0,this.renderContent()}return Object.defineProperty(t.prototype,"applyItem",{get:function(){return this._applyItem},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"eqjs-menu"},enumerable:!0,configurable:!0}),t.prototype.getItems=function(){return this.items},t.prototype.setItems=function(t){this.items=t},t.prototype.renderContent=function(){var t=this;if(this.items){var e=this.parentMenu.style.colors.bgON||"white",n=this.parentMenu.style.colors.fgON||"black",s=(this.parentMenu.style.colors.bgOVER,this.parentMenu.style.itemStyle.fontFamily||""),a=this.parentMenu.style.itemStyle.fontSize||"14px",l=this.parentMenu.options.multiselect,u=this.parentMenu.options.isSubQuery,c=Object(i.domel)("div").addClass(r.a.getMobileCssClass());this.parentMenu.options.useDefaultStyles&&c.setStyle("backgroundColor",e).setStyle("border","1px solid").setStyle("borderColor",e).setStyle("backgroundColor",this.parentMenu.style.colors.border).setStyle("margin","-2px 2px 2px -2px").setStyle("width","auto").setStyle("height","auto"),c.setStyle("z-index",this.parentMenu.zIndex).setStyle("position","absolute").setStyle("display","none");var d=c.toDOM();d.menuLevel=this;var h=this._applyItem;if(l&&0===this.levelIndex&&!0!==this.parentMenu.options.hideButtons){var p=document.createElement("div");p.classList.add(this.cssPrefix+"-applyDiv"),p.menuItem=h,this.applyBtn=document.createElement("button"),this.parentMenu.options.useDefaultStyles&&(p.style.borderBottom="1px solid",p.style.padding="5px",p.style.marginBottom="5px",this.applyBtn.style.padding="0 5px",this.applyBtn.style.cursor="pointer");var f=document.createTextNode(this.parentMenu.options.buttons.submit);this.applyBtn.appendChild(f),p.appendChild(this.applyBtn);var g=document.createElement("button");g.classList.add(this.cssPrefix+"-cancel"),this.parentMenu.options.useDefaultStyles&&(g.style.padding="0 5px",g.style.cursor="pointer",g.style.marginLeft="15px");var y=document.createTextNode(this.parentMenu.options.buttons.cancel);g.appendChild(y),p.appendChild(g),d.appendChild(p),h.itemDiv=p,this.applyBtn.addEventListener("click",(function(){t.submit(t._applyItem)})),g.addEventListener("click",(function(){t.parentMenu.hideMenu()}))}if(null==this.parentLevel&&(this.parentMenu.options.searchBoxAlwaysShown||this.items.length>=this.parentMenu.options.showSearchBoxAfter)){var m=Object(i.domel)("div").addClass(this.cssPrefix+"-searchDiv");this.parentMenu.options.useDefaultStyles&&(m.setStyle("border-bottom","1px solid #666").setStyle("background-color",e).setStyle("border-color",this.parentMenu.style.colors.border),""!=s&&m.setStyle("font-family",s),m.setStyle("font-size",a).setStyle("color",n).setStyle("cursor","pointer").setStyle("text-align","left").setStyle("padding","5px"));var v=Object(i.domel)("input").id("searchBox").name("searchBox").type("text").size(16).addClass(this.cssPrefix+"-searchBox").on("input",(function(e){t.deactivateItem(t.activeItem),t.renderItems(t.searchBox.value)})).on("keydown",(function(e){switch(e.keyCode){case 13:t.activeItem&&t.activeItem.itemDiv.click();break;case 38:t.moveActiveItemUp();break;case 40:t.moveActiveItemDown();break;case 39:t.searchBox.value||t.openSubLevel(t.activeItem)}}));this.parentMenu.options.useDefaultStyles&&v.setStyle("font-family","monospace").setStyle("font-size","8pt").setStyle("width","100%"),u&&v.addClass("eqjs-dialog"),this.searchBox=v.toDOM(),this.searchDiv=m.toDOM(),this.searchDiv.appendChild(this.searchBox),d.appendChild(this.searchDiv)}var b=document.createElement("div");b.tabIndex=1,Object(i.domel)(b).addClass(this.cssPrefix+"-scrollDiv").addClass(r.a.getMobileCssClass()),b.style.overflowX="hidden",b.style.overflowY="auto",b.style.position="relative",d.appendChild(b),this.levelDiv=d,this.scrollDiv=b,this.menuId&&(this.levelDiv.id=this.menuId),this.parentLevel&&(this.levelDiv.style.zIndex=this.parentLevel.levelDiv.style.zIndex),this.renderItems();b.addEventListener("keydown",(function(e){switch(e.which){case 13:t.parentMenu.options.multiselect?t.parentMenu.getRootLevel().applyBtn.click():t.activeItem&&t.activeItem.itemDiv.click();break;case 32:t.activeItem&&t.activeItem.itemDiv.click();break;case 37:t.parentLevel&&!t.isFilteringMode&&(t.deactivateItem(t.activeItem),t.parentLevel.focus());break;case 39:t.openSubLevel(t.activeItem);break;case 38:t.moveActiveItemUp();break;case 40:t.moveActiveItemDown();break;default:return}e.preventDefault()})),r.a.isMobileMode()&&(this.closeDiv=Object(i.domel)("div",d).addClass("eqjs-menu-close-btn").addText(o.i18n.getText("ButtonClose")).on("click",(function(){t.parentMenu.hideMenu()})).toDOM())}},t.prototype.moveActiveItemDown=function(){var t=this.isFilteringMode?this.filteredItems:this.items;if(this.activeItem){var e=t.indexOf(this.activeItem);e<t.length-1&&this.activateItem(t[e+1],!1)}else this.activateItem(t[0],!1)},t.prototype.moveActiveItemUp=function(){var t=this.isFilteringMode?this.filteredItems:this.items;if(this.activeItem){var e=t.indexOf(this.activeItem);e>0&&this.activateItem(t[e-1],!1)}else this.activateItem(t[t.length-1],!1)},t.prototype.openSubLevel=function(t){t&&t.items&&!this.isFilteringMode&&(this.showSubLevel(t),t.subLevel.activateItem(t.subLevel.items[0]))},t.prototype.focusScrollDiv=function(){this.scrollDiv.focus()},t.prototype.turnCheckboxes=function(t){for(var e=0;e<t.length;e++){var n=t[e];n.itemCheckbox&&(n.itemCheckbox.checked=this.isItemSelected(n)),n.items&&this.turnCheckboxes(n.items)}},t.prototype.isItemSelected=function(t){if(t.items){for(var e=0;e<t.items.length;e++)if(this.isItemSelected(t.items[e]))return!0;return!1}return t.selected},t.prototype.setItemSelected=function(t,e){if(t.items)for(var n=0;n<t.items.length;n++)this.setItemSelected(t.items[n],e);else t.selected=e},t.prototype.submitItems=function(t,e){for(var n=0;n<t.length;n++)t[n].items?this.submitItems(t[n].items,e):t[n].selected&&e.push(t[n])},t.prototype.allSubitemsAreFiltered=function(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return!1;return!0},t.prototype.isItemDiv=function(t){return!!t.menuItem},t.prototype.isLevelDiv=function(t){return!!t.menuLevel},t.prototype.getMenuItem=function(t){for(var e=t;!this.isItemDiv(e);){if(this.isLevelDiv(e))throw"Can't get menu item";e=e.parentElement}return e.menuItem},t.prototype.renderItemsWithoutFilter=function(){var t=this;this.isFilteringMode=!1;var e=this.scrollDiv,n=this.parentMenu.options.multiselect,o=this.parentMenu.options.activateOnMouseOver,s=this.parentMenu.style.colors.fgON||"black",a=(this.parentMenu.style.colors.bgOVER,this.parentMenu.style.itemStyle.fontSize||"14px"),l=this.parentMenu.getItemFilterCallback();e.innerHTML="";for(var u=0;u<this.items.length;u++){var c=this.items[u];if(c&&c.text){if(l){if(!l(c))continue;if(c.items&&this.allSubitemsAreFiltered(c.items,l))continue}c.data=function(e){return t[e]},void 0===c.selected&&(c.selected=!1),c.selected&&null==this.selectedItem&&(this.selectedItem=c);var d=document.createElement("div");if(Object(i.domel)(d).addClass(this.cssPrefix+"-itemDiv").addClass(r.a.getMobileCssClass()),c.selected&&this.showSelected&&!n&&d.classList.add(this.cssPrefix+"-selected"),this.domWriteItemsId&&this.menuId&&(d.id="item-"+this.menuId+"-"+c.id),e.appendChild(d),d.menuItem=c,d.menuLevel=this,c.itemDiv=d,this.parentMenu.options.useDefaultStyles&&(d.style.fontSize=a,d.style.color=s,d.style.paddingLeft="15px",d.style.paddingRight="6px",d.style.cursor="pointer"),"---"==c.text)d.appendChild(document.createElement("hr"));else{if(n){var h=document.createElement("input");h.type="checkbox",h.id="cb"+c.id,h.checked=this.isItemSelected(c),h.defaultChecked=this.isItemSelected(c),d.appendChild(h),c.itemCheckbox=h,this.parentMenu.options.useDefaultStyles&&(h.style.margin="4px 10px 0 0",h.style.verticalAlign="top")}var p=c.text;this.parentMenu.options.showItemIds&&(p=c.id+":"+p);var f=document.createTextNode(p);if(d.appendChild(f),c.items&&c.items.length>0){d.classList.add(this.cssPrefix+"-itemDiv-hasChildren");var g=document.createElement("span");g.classList.add(this.cssPrefix+"-itemDiv-arrow"),d.appendChild(g);var y=document.createTextNode(">");g.appendChild(y)}var m=function(e){var o=t.getMenuItem(e.target);if(n)if(o.items&&e.target!=o.itemCheckbox)t.activateItem(o);else{var i=t.isItemSelected(o);t.setItemSelected(o,!i),o.itemCheckbox.checked=!i,t.parentMenu.refreshCheckboxes()}else t.activateItem(o),t.submit(o);return!1};d.removeEventListener("click",m),d.addEventListener("click",m),d.addEventListener("mouseenter",(function(e){var n=t.getMenuItem(e.target);t.parentMenu.isCursorInside=!0,o&&t.activateItem(n)})),d.addEventListener("mouseleave",(function(e){var n=t.getMenuItem(e.target);t.parentMenu.isCursorInside=!1,setTimeout((function(){t.parentMenu.isCursorInside||o&&n==t.activeItem&&!n.subLevel&&t.deactivateItem(n)}),200)}))}this.itemRenderedCallback&&this.itemRenderedCallback(this.menuId,d)}}},t.prototype.renderItemsWithFilter=function(t){this.isFilteringMode=!0,this.scrollDiv.innerHTML="";var e=t.split(">"),n=e.map((function(t){return t.replace(/\*/g,"")})),o=this.filterItems(this.items,e);this.filteredItems=[];for(var i=0;i<o.length;i++)this.renderItemWithFilter(o[i],n,0)},t.prototype.matchesFilter=function(t,e){return!t||!e||e.test(t)},t.prototype.filterItems=function(t,e){for(var n=[],i=e.length>0?e[0]:"",r=e.length>1?e.slice(1):e,s=i?new RegExp(i.replace(/\*/g,".+?"),"i"):null,a=0;a<t.length;a++){var l=t[a];if(l.items){var u=o.utils.assign({},l),c=this.matchesFilter(l.text,s);e.length<2?c&&e.length<2?u.items=o.utils.createArrayFrom(l.items):u.items=this.filterItems(l.items,r):u.items=c?this.filterItems(l.items,r):[],u.items.length>0&&n.push(u)}else this.matchesFilter(l.text,s)&&n.push(l)}return n},t.prototype.renderItemWithFilter=function(t,e,n){var o=this,s=this.scrollDiv,a=n<e.length?e[n]:e[e.length-1],l=this.parentMenu.options.multiselect,u=this.parentMenu.options.activateOnMouseOver,c=this.parentMenu.style.colors.fgON||"black",d=(this.parentMenu.style.colors.bgOVER,this.parentMenu.style.itemStyle.fontSize||"14px"),h=this.parentMenu.getItemFilterCallback();if(t&&t.text){if(h){if(!h(t))return;if(t.items&&this.allSubitemsAreFiltered(t.items,h))return}t.data=function(t){return this[t]},void 0===t.selected&&(t.selected=!1),t.selected&&null==this.selectedItem&&(this.selectedItem=t);var p=document.createElement("div");if(Object(i.domel)(p).addClass(this.cssPrefix+"-itemDiv").addClass(r.a.getMobileCssClass()),p.style.marginLeft=10*n+"px",t.selected&&!l&&p.classList.add(this.cssPrefix+"-selected"),this.domWriteItemsId&&this.menuId&&(p.id="item-"+this.menuId+"-"+t.id),s.appendChild(p),p.menuItem=t,p.menuLevel=this,t.itemDiv=p,this.parentMenu.options.useDefaultStyles&&(p.style.fontSize=d,p.style.color=c,p.style.paddingLeft="15px",p.style.paddingRight="6px",p.style.cursor="pointer"),"---"==t.text)p.appendChild(document.createElement("hr"));else{if(l){var f=document.createElement("input");f.type="checkbox",f.id="cb"+t.id,f.checked=this.isItemSelected(t),f.defaultChecked=this.isItemSelected(t),p.appendChild(f),t.itemCheckbox=f,this.parentMenu.options.useDefaultStyles&&(f.style.margin="4px 10px 0 0",f.style.verticalAlign="top")}var g=document.createElement("span");if(g.innerHTML=this.highlightText(t.text,a),p.appendChild(g),t.items&&t.items.length>0)p.classList.add(this.cssPrefix+"-itemDiv-filter-hasChildren");else{this.filteredItems.push(t);var y=function(e){if(l)if(t.items&&e.target!=t.itemCheckbox)o.activateItem(t);else{var n=o.isItemSelected(t);o.setItemSelected(t,!n),t.itemCheckbox.checked=!n,o.parentMenu.refreshCheckboxes()}else o.activateItem(t),o.submit(t);return!1};p.removeEventListener("click",y),p.addEventListener("click",y),p.addEventListener("mouseenter",(function(e){o.parentMenu.isCursorInside=!0,u&&o.activateItem(t)})),p.addEventListener("mouseleave",(function(e){o.parentMenu.isCursorInside=!1,setTimeout((function(){o.parentMenu.isCursorInside||u&&t==o.activeItem&&!t.subLevel&&o.deactivateItem(t)}),200)}))}}if(t.items)for(var m=0;m<t.items.length;m++)this.renderItemWithFilter(t.items[m],e,n+1);this.itemRenderedCallback&&this.itemRenderedCallback(this.menuId,p)}},t.prototype.highlightText=function(t,e){if(e&&e.length>0){var n=e.toLowerCase(),o=t.toLowerCase();if(o.indexOf(n)>=0){for(var i=0,r=t,s=[];;){var a=o.indexOf(n,i);if(a>=0?(s.push(a),i=a+e.length):i++,i>=r.length-1)break}if(s.length>0){t="";for(var l=0;l<s.length;l++)0===l&&(t+=r.substring(0,s[l])),t+="<span class='eqjs-menu-itemDiv-highlight'>"+r.substring(s[l],s[l]+e.length)+"</span>",l<s.length-1?t+=r.substring(s[l]+e.length,s[l+1]):t+=r.substring(s[l]+e.length)}}}return t},t.prototype.renderItems=function(t){t||r.a.isMobileMode()?(t=t||"",this.renderItemsWithFilter(t.toLowerCase())):this.renderItemsWithoutFilter()},t.prototype.activateItem=function(t,e){void 0===e&&(e=!0),null!=this.activeItem&&this.deactivateItem(this.activeItem),this.activeItem=t;var n=t.itemDiv;if(n.classList.add("active"),this.parentMenu.options.useDefaultStyles){this.parentMenu.style.colors.bgON,this.parentMenu.style.colors.fgON;var o=this.parentMenu.style.colors.bgOVER,i=this.parentMenu.style.colors.fgOVER||"";this.parentMenu.style.itemClass;""!=(this.parentMenu.style.itemClassOver||"")?(n.style.backgroundColor="",n.style.color=""):(n.style.backgroundColor=o,n.style.color=i)}t.items&&!this.isFilteringMode&&e&&this.showSubLevel(t)},t.prototype.deactivateItem=function(t){if(t){var e=t.itemDiv;if(e.classList.remove("active"),this.parentMenu.options.useDefaultStyles){var n=this.parentMenu.style.colors.bgON,o=this.parentMenu.style.colors.fgON;""!=(this.parentMenu.style.itemClass||"")?(e.style.backgroundColor="",e.style.color=""):(e.style.backgroundColor=n,e.style.color=o)}t.subLevel&&t.subLevel.hide(),this.activeItem=null}},t.prototype.showSubLevel=function(e){if(!e.subLevel){var n="";this.menuId&&(n=this.menuId+"-"+e.id),e.subLevel=new t({showSelected:this.showSelected,menu:this.parentMenu,parent:this,container:this.parentElement,items:e.items,levelIndex:this.levelIndex+1,domWriteItemsId:this.domWriteItemsId,menuId:n,itemRenderedCallback:this.itemRenderedCallback})}var o=Object(i.getElementAbsolutePos)(e.itemDiv),r=Object(i.getScrollPos)(),s=Object(i.getWinSize)(),a=o.x-r.left,l=s.width-a-e.itemDiv.offsetWidth;o.x+=e.itemDiv.offsetParent.offsetWidth,o.y+=1,e.subLevel.showAt(o.x,o.y,!0,!0),e.subLevel.levelDiv.style.width="",e.subLevel.levelDiv.style.right="",l>=e.subLevel.levelDiv.offsetWidth||l>=a?l<e.subLevel.levelDiv.offsetWidth&&(e.subLevel.levelDiv.style.right=-r.left+"px"):(a<e.subLevel.levelDiv.offsetWidth?e.subLevel.levelDiv.style.left=r.left+4+"px":e.subLevel.levelDiv.style.left="",e.subLevel.levelDiv.style.right=Object(i.getViewportSize)().width-o.x+e.itemDiv.offsetWidth-6+"px"),e.subLevel.levelDiv.style.visibility="visible",e.subLevel.focus()},t.prototype.adjustTopPos=function(t){var e=Object(i.getWinSize)(),n=t-Object(i.getScrollPos)().top+this.levelDiv.offsetHeight,o=t;return n>e.height-5&&(o-=n-e.height+5)<Object(i.getScrollPos)().top&&(o=Object(i.getScrollPos)().top+10),o},t.prototype.showAt=function(t,e,n,o){if(this.items){this.initLevelDiv(),this.turnCheckboxes(this.items),this.renderItems();var r=this.levelDiv.style;o&&(this.levelDiv.style.visibility="hidden"),r.display="block",r.left=t+"px",r.top=e+"px",this.scrollDiv.style.width="auto",this.scrollDiv.style.height="auto",n&&(e=this.adjustTopPos(e),r.top=e+"px");var s=this.parentMenu.minItemWidth;if(s>0&&this.scrollDiv.offsetWidth<s)for(var a=0;a<this.items.length;a++)this.items[a].itemDiv.style.width=s+"px";var l=this.parentMenu.maxItemWidth;if(l>0&&this.scrollDiv.offsetWidth>l)for(a=0;a<this.items.length;a++)this.items[a].itemDiv.style.width=l+"px",this.items[a].itemDiv.style.overflowX="hidden";var u=Object(i.getWinSize)().height-(e-Object(i.getScrollPos)().top)-15;if(this.parentMenu.maxHeight>0&&u>this.parentMenu.maxHeight&&(u=this.parentMenu.maxHeight),null!=this._applyItem&&null!=this._applyItem.itemDiv&&(u-=this._applyItem.itemDiv.offsetHeight+5),null!=this.searchDiv&&(u-=this.searchDiv.offsetHeight),null!=this.closeDiv&&(u-=this.closeDiv.offsetHeight),this.levelDiv.offsetHeight>u){var c=u;c<50&&(c=50),this.scrollDiv.style.height=c+"px"}else this.scrollDiv.style.height="auto";this.activeItem=null}},t.prototype.focus=function(){var t=this;window.setTimeout((function(){t.scrollDiv.focus(),null!=t.searchBox&&(t.parentMenu.options.searchBoxAutoFocus&&t.searchBox.focus(),t.searchBox.value="")}),100)},t.prototype.hide=function(){(null!==this.activeItem&&this.activeItem.subLevel&&this.activeItem.subLevel.hide(),this.levelDiv)&&(this.levelDiv.style.display="none",this.initialized&&(this.parentElement.removeChild(this.levelDiv),this.initialized=!1))},t.prototype.initLevelDiv=function(){this.initialized||(this.parentElement.appendChild(this.levelDiv),Object(i.domel)(this.levelDiv).addClass(this.cssPrefix+"-levelDiv").addClass(r.a.getMobileCssClass()),this.initialized=!0)},t.prototype.submit=function(t){if(null!=t&&!t.items){this.parentMenu.hideMenu();var e=[];t==this._applyItem&&this.submitItems(this.items,e),this.parentMenu.submitMenu(t,e)}},t.prototype.remove=function(){for(var t=0;t<this.items.length;t++){var e=this.items[t];e.subLevel&&e.subLevel.remove()}if(this.levelDiv){this.levelDiv.innerHTML="";var n=this.levelDiv.parentNode;null!=n&&n.removeChild(this.levelDiv)}this.levelDiv=null},t.prototype.update=function(t){this.remove(),this.items=t,this.activeItem=null,this.selectedItem=null,this._applyItem.itemDiv=null,this.initialized=!1,this.updated++,this.renderContent()},t.prototype.refreshCheckboxes=function(){for(var t=0;t<this.items.length;t++){var e=this.items[t];e.itemCheckbox&&(e.itemCheckbox.checked=this.isItemSelected(e)),e.subLevel&&e.subLevel.refreshCheckboxes()}},t.prototype.refreshItems=function(){for(var t=0;t<this.items.length;t++){var e=this.items[t];e.itemDiv&&(e.hidden?e.itemDiv.style.display="none":e.itemDiv.style.display="block"),e.subLevel&&e.subLevel.refreshItems()}},t.prototype.findItem=function(t){for(var e=t.toLowerCase(),n=0;n<this.items.length;n++){var o=this.items[n];if(0==o.text.toLowerCase().indexOf(e))return o}return null},t}(),l=function(){function t(e){var n=this;this.isCursorInside=!1,this.mouseIsOverBlock=!1,this.mouseIsOverLink=!1,this.toId=null,this.active=!1,this.ancorFocused=null,this.options={items:[],buttons:{submit:o.i18n.getText("ButtonApply"),cancel:o.i18n.getText("ButtonCancel")},itemFilterCallback:null,useDefaultStyles:!1,multiselect:!1,adjustHeight:!0,showSearchBoxAfter:30,activateOnMouseOver:!0,container:document.body,domWriteItemsId:!1,itemRenderedCallback:null,showItemIds:!1},e&&o.utils.assignDeep(this.options,e),this.options.hideButtons&&(this.options.submitOnBlur=!0),this.menuId=t.lastMenuID++,this.updateProps(),this.rootLevel=new a({menu:this,items:this.options.items,levelIndex:0,container:this.options.container,domWriteItemsId:this.options.domWriteItemsId,menuId:this.options.id,itemRenderedCallback:this.options.itemRenderedCallback,showSelected:this.options.showSelected}),this.rootLevel.levelDiv.classList.add(this.cssPrefix+"-rootLevel"),this.options.zIndex&&(this.rootLevel.levelDiv.style.zIndex=""+this.options.zIndex),this.menuKeyUpHandler=function(t){27==t.which&&(n.hideMenu(),t.stopImmediatePropagation())},this.globalMouseDownHandler=function(t){if(!n.active)return!0;for(var e=window.event||t,o=e.srcElement||e.target,i=!0;o;){if(o.tagName&&"div"==o.tagName.toLowerCase()&&o.menuLevel&&o.menuLevel.parentMenu==n){i=!1;break}o=o.parentNode||o.parentElement}return i&&(n.options.submitOnBlur&&n.rootLevel.submit(n.rootLevel.applyItem),n.hideMenu()),!0},this.render()}return Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"eqjs-menu"},enumerable:!0,configurable:!0}),t.prototype.getItems=function(){return this.rootLevel.getItems()},t.prototype.updateProps=function(){this.style={},this.style.colors={border:"#666666",shadow:"#888888",bgON:"white",fgON:"black",bgOVER:"#B6BDD2",fgOVER:"black"},this.style.itemStyle={fontSize:"14px"},this.minItemWidth=0,this.maxItemWidth=0,this.maxHeight=0,this.zIndex=""+this.options.zIndex,this.commandTemplate="",this.args=[],this.active=!1},t.prototype.render=function(){},t.prototype.clearItemsMenuProps=function(t){if(t)for(var e=0;e<t.length;e++)this.clearItemMenuProps(t[e])},t.prototype.clearItemMenuProps=function(t){t.subLevel&&t.subLevel.parentMenu==this||(t.subLevel&&(t.subLevel.remove(),t.subLevel=null),t.itemDiv&&(t.itemDiv=null),t.items&&this.clearItemsMenuProps(t.items))},t.prototype.setSelectedItems=function(t,e){for(var n=t?t.length:0,o=0;o<n;o++){var i=t[o];i.items?this.setSelectedItems(i.items,e):i.selected=e.indexOf(i.id)>=0}},t.prototype.getRootLevel=function(){return this.rootLevel},t.prototype.getItemFilterCallback=function(){return this.itemFilterCallback},t.prototype.showMenu=function(t){this.ancorFocused=t.anchor==document.activeElement?t.anchor:null,this.clearItemsMenuProps(this.options.items),this.itemSelectedCallback=t.itemSelectedCallback||null,this.menuClosedCallback=t.menuClosedCallback||null,this.itemFilterCallback=t.itemFilterCallback||null,t.items&&(this.options.items=t.items,this.rootLevel.setItems(t.items)),t.onMenuItemSelected&&(this.options.onMenuItemSelected=t.onMenuItemSelected);var e=t.selectedIds||null;if(e?"string"==typeof e&&(e=e.split(",")):e=[],this.active=!0,this.setSelectedItems(this.options.items,e),r.a.isMobileMode())this.rootLevel.showAt(0,0,!0,!0),this.rootLevel.levelDiv.style.top="0px",this.rootLevel.levelDiv.style.bottom="0px",this.rootLevel.levelDiv.style.right="0px",this.rootLevel.levelDiv.style.position="fixed",this.rootLevel.levelDiv.style.fontSize="20px";else{var n=t.anchor||document.documentElement,o=Object(i.getElementAbsolutePos)(n),a=n.offsetHeight,l=n.offsetHeight,u={x:o.x,y:o.y+a+2},c=Object(i.getScrollPos)(),d=Object(i.getWinSize)(),h=u.x+l-c.left,p=d.width-h+l;u.x+=2,this.rootLevel.showAt(u.x,u.y,!0,!0),this.rootLevel.levelDiv.style.width="",this.rootLevel.levelDiv.style.right="",this.rootLevel.levelDiv.style.zIndex||(this.rootLevel.levelDiv.style.zIndex=""+Math.max(1e4,Object(s.c)(n)+1)),p>=this.rootLevel.levelDiv.offsetWidth||p>=h?p<this.rootLevel.levelDiv.offsetWidth&&(this.rootLevel.levelDiv.style.right=-c.left+"px"):(h<this.rootLevel.levelDiv.offsetWidth?this.rootLevel.levelDiv.style.left=c.left+4+"px":this.rootLevel.levelDiv.style.left="",this.rootLevel.levelDiv.style.right=Object(i.getViewportSize)().width-u.x-l+"px"),this.rootLevel.levelDiv.style.fontSize="14px"}this.rootLevel.levelDiv.style.visibility="visible",this.rootLevel.focus(),document.addEventListener("keyup",this.menuKeyUpHandler),document.addEventListener("mousedown",this.globalMouseDownHandler,!0)},t.prototype.hideMenu=function(){document.removeEventListener("mousedown",this.globalMouseDownHandler,!0),document.removeEventListener("keyup",this.menuKeyUpHandler),this.rootLevel.hide(),this.ancorFocused&&this.ancorFocused.focus(),this.menuClosedCallback&&this.menuClosedCallback()},t.prototype.submitMenu=function(t,e){this.itemSelectedCallback&&this.itemSelectedCallback(t,e)},t.prototype.knockMenuStyle=function(t){t.removeAttribute("style");var e=t.querySelectorAll("ul").item(0);!1!==!(!e||!e.style)&&e.setAttribute("style","")},t.prototype.refreshItems=function(){this.rootLevel.refreshItems()},t.prototype.refreshCheckboxes=function(){this.rootLevel.refreshCheckboxes()},t.lastMenuID=0,t}()},function(t,e,n){"use strict";var o;n.d(e,"a",(function(){return o})),function(t){t[t.None=0]="None",t[t.Value=1]="Value",t[t.Attribute=2]="Attribute",t[t.Operator=4]="Operator",t[t.Addition=8]="Addition",t[t.Removal=16]="Removal",t[t.All=255]="All",t[t.NoAddition=-9]="NoAddition",t[t.NoRemoval=-17]="NoRemoval",t[t.FixedConditionList=5]="FixedConditionList"}(o||(o={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var o,i=n(48),r=n(7),s=n(17);!function(t){t.getAllDataTypes=function(){return Object.values(r.a).filter((function(t){return"number"==typeof t}))},t.getDateDataTypes=function(){return[r.a.Time,r.a.Date,r.a.DateTime]},t.getStringDataTypes=function(){return[r.a.String,r.a.Memo,r.a.FixedChar]};var e=[r.a.Byte,r.a.Word,r.a.Int32,r.a.Int64,r.a.Float,r.a.Currency,r.a.Autoinc];t.getNumericDataTypes=function(){return e};var n=[r.a.Byte,r.a.Word,r.a.Int32,r.a.Int64,r.a.Autoinc];function o(t,e,n){e||(e={});for(var i=0,r=n;i<r.length;i++){var s=r[i];if(s)for(var l in s)if(s.hasOwnProperty(l)){var u=s[l];null!==u&&"object"==typeof u?t.has(u)?e[l]=t.get(u):Array.isArray(u)?(e[l]=a(u),t.set(u,e[l])):(void 0!==e[l]&&null!=e[l]||(e[l]=Object.create(Object.getPrototypeOf(u))),t.set(u,e[l]),o(t,e[l],[u])):e[l]=u}}return e}function a(t){for(var e=[],n=0,o=t;n<o.length;n++){var i=o[n];e.push(i)}return e}t.assign=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var o=0;o<e.length;o++){var i=e[o];if(i)for(var r in i)i.hasOwnProperty(r)&&(t[r]=i[r])}return t},t.assignDeep=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return o(new WeakMap,t,e)},t.getIfDefined=function(t,e){return void 0!==t?t:e},t.IsDefinedAndNotNull=function(t){return null!=t},t.copyArrayTo=function(t,e){for(var n=t.length,o=e.length,i=0;i<n&&i<o;i++)e[i]=t[i]},t.createArrayFrom=a,t.findItemById=function(t,e){for(var n=t.length,o=0;o<n;o++)if(t[o].id===e)return t[o];return null},t.findItemIndexById=function(t,e){for(var n=t.length,o=0;o<n;o++)if(t[o].id===e)return o;return-1},t.indexOfArrayItem=function(t,e){if(t.indexOf)return t.indexOf(e);for(var n=t.length,o=0;o<n;o++)if(e==t[o])return o;return-1},t.moveArrayItem=function(t,e,n){if(e>=t.length)throw"Index out of bounds: "+e;n>=t.length&&(n=t.length-1);var o=t.splice(e,1)[0];t.splice(n,0,o)},t.removeArrayItem=function(t,e){var n=t.indexOf(e);if(-1!=n)return t.splice(n,1)[0]},t.insertArrayItem=function(t,e,n){t.splice(e,0,n)},t.fillArray=function(t,e,n,o){void 0===n&&(n=0);for(var i=t.length>>>0,r=n>>0,s=r<0?Math.max(i+r,0):Math.min(r,i),a=void 0===o?i:o>>0,l=a<0?Math.max(i+a,0):Math.min(a,i);s<l;)t[s]=e,s++;return t},t.shiftToFitWindow=function(t,e){var n=document.getElementsByTagName("body")[0],o=window.innerWidth||document.documentElement.clientWidth||n.clientWidth,i=t+e,r=0;return i>o&&t+(r=o-i-10)<0&&(r=10-t),r},t.isObject=function(t){return null!==t&&("function"==typeof t||"object"==typeof t)},t.isNumericType=function(t){return e.indexOf(t)>=0},t.isIntType=function(t){return n.indexOf(t)>=0},t.isNumeric=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},t.areCompatibleDataTypes=function(t,e){return void 0===t||void 0===e||t==r.a.Unknown||e==r.a.Unknown||t==e||t==r.a.Date&&e==r.a.DateTime||t==r.a.DateTime&&e==r.a.Date},t.isPropSet=function(t,e){return t[e]||t[e.toLowerCase()]||t[e.toUpperCase()]};var l="0123456789abcdefghijklmnopqrstuvwxyz";function u(t,e){var n=t.length;if(n>e){var o=n/e,i="";i+=t[0];for(var r=o,s=void 0,a=1;a<n;a++)s=t[a],a+1>r&&(i+=s,r+=o);return i}return t}function c(t,e,n){return t.substr(0,e)+n+t.substr(e+n.length)}function d(t,e){return Math.floor(Math.random()*(e-t))+t}function h(t){var e=parseInt(t);if(isNaN(e))throw'"'+t+'" is not a valid number';return e}t.generateId=function(t){t||(t="easy");var e=t.length>4?function(t,e){var n=t.split("-"),o=1,i=e;n.length<e&&(o=e/n.length,i=n.length);for(var r="",s=0;s<i;s++)r+=u(n[s],o);return r}(t,4):t;e&&e.length>0&&(e+="-");var n=i.b("",2),o=l.length-1;return n=c(n,0,l[d(0,o)]),e+(n=c(n,1,l[d(0,o)]))+function(t){var e=36,n=14,o=i.b("",n),r=t;do{o=c(o,n--,l[r%e]),r=Math.floor(r/=e)}while(r>0);return i.c(o.trim())}(621355968e9+1e4*(new Date).getTime()-0x8d60e562e627800)},t.strToDateTime=function(t,e){if(!t||0==t.length)return new Date;var n=t.replace(/[^a-zA-Z0-9_]/g,"-"),o=e.replace(/[^a-zA-Z0-9_]/g,"-").split("-"),i=n.split("-"),r=o.indexOf("MM"),s=o.indexOf("dd"),a=o.indexOf("yyyy"),l=o.indexOf("HH"),u=o.indexOf("mm"),c=o.indexOf("ss"),d=new Date;try{var p=a>-1&&a<i.length?h(i[a]):d.getFullYear(),f=r>-1&&r<i.length?h(i[r])-1:d.getMonth()-1;if(f>11)throw"";var g=s>-1&&s<i.length?h(i[s]):d.getDate();if(g>function(t,e){return new Date(e,t+1,0).getDate()}(f,p))throw"";var y=l>-1&&l<i.length?h(i[l]):0;if(y>23)throw"";var m=u>-1&&u<i.length?h(i[u]):0;if(m>59)throw"";var v=c>-1&&c<i.length?h(i[c]):0;if(v>59)throw"";return new Date(p,f,g,y,m,v)}catch(e){throw t+" is not a valid date."}},t.strToTime=function(t){var e=t.split(":");try{var n=e.length>0?h(e[0]):0;if(n>23)throw"";var o=e.length>1?h(e[1]):0;if(o>59)throw"";var i=e.length>1?h(e[1]):0;if(i>59)throw"";return new Date(0,0,0,n,o,i)}catch(e){throw t+" is not a valid time."}};var p=/\[([^\]]+)]|y{4}|M{1,4}|d{1,2}|H{1,2}|h{1,2}|m{2}|s{2}|t{2}/g;t.dateTimeToStr=function(t,e){var n=t.getFullYear(),o=t.getMonth()+1,i=t.getDate(),r=t.getHours(),a=t.getMinutes(),l=t.getSeconds(),u=r%12||12,c=r>11,d={yyyy:n.toString(),MMMM:s.a.getLongMonthName(o),MMM:s.a.getShortMonthName(o),MM:o<10?"0"+o:o.toString(),M:o.toString(),dd:i<10?"0"+i:i.toString(),d:i.toString(),HH:r<10?"0"+r:r.toString(),H:r.toString(),hh:u<10?"0"+u:u.toString(),h:u.toString(),tt:c?"PM":"AM",mm:a<10?"0"+a:a.toString(),ss:l<10?"0"+l:l.toString()};return e.replace(p,(function(t,e){return e||d[t]}))},t.numberToStr=function(t,e){return e=e||s.a.getLocaleSettings().decimalSeparator,t.toString().replace(".",e)}}(o||(o={}))},function(t,e,n){"use strict";var o;n.d(e,"a",(function(){return o})),function(t){t[t.Scalar=0]="Scalar",t[t.Const=1]="Const",t[t.Attribute=2]="Attribute",t[t.List=4]="List",t[t.Query=5]="Query",t[t.ParentColumn=6]="ParentColumn"}(o||(o={}))},function(t,e,n){"use strict";var o,i;n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return i})),function(t){t[t.Conditions=1]="Conditions",t[t.Columns=2]="Columns",t[t.SortingColumns=4]="SortingColumns",t[t.Properties=32]="Properties",t[t.ExtraData=64]="ExtraData",t[t.Facets=128]="Facets",t[t.Aggregation=256]="Aggregation",t[t.All=511]="All"}(o||(o={})),function(t){t[t.Add=1]="Add",t[t.Modify=2]="Modify",t[t.Delete=4]="Delete",t[t.Activate=8]="Activate",t[t.All=127]="All"}(i||(i={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var o,i=n(0),r=n(59),s=n(16);!function(t){t.combinePath=function(t,e){var n=t;return null!=n&&n.length>0?("/"!=n.charAt(n.length-1)&&(n+="/"),n+=e):n=e,n},t.strToLinkType=function(t){return"All"==t?s.a.All:"NotAll"==t?s.a.NotAll:"Any"==t?s.a.Any:s.a.None},t.linkTypeToStr=function(t){return t===s.a.All?"All":t===s.a.NotAll?"NotAll":t==s.a.Any?"Any":"None"},t.parseOperatorFormat=function(t){var e=i.i18n.getText("Operators",t.id,"format");return e||(e=i.i18n.getText("Operators",t.id,"displayFormat")),e||(e=t.displayFormat),new r.a(e).parse()},t.convertValue=function(t,e,n){switch(n){case i.DataType.String:return t;case i.DataType.Autoinc,i.DataType.Byte,i.DataType.Int32,i.DataType.Int64,i.DataType.Word:var o=parseInt(t);return isNaN(o)?"":o.toString();case i.DataType.Currency,i.DataType.Float:var r=parseFloat(t);return isNaN(r)?"":r.toString();default:return""}}}(o||(o={}))},function(t,e,n){"use strict";var o;n.d(e,"a",(function(){return o})),function(t){t.DataGrid="DATA_GRID",t.Chart="CHART",t.PivotTable="PIVOT_TABLE"}(o||(o={}))},function(t,e,n){"use strict";var o;n.d(e,"a",(function(){return o})),function(t){t[t.None=0]="None",t[t.Any=1]="Any",t[t.NotAll=2]="NotAll",t[t.All=3]="All"}(o||(o={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var o,i=n(7),r=n(11);!function(t){var e,n={shortDateFormat:"MM/dd/yyyy",longDateFormat:"dd MMM, yyyy",editDateFormat:"MM/dd/yyyy",shortTimeFormat:"HH:mm",editTimeFormat:"HH:mm",longTimeFormat:"HH:mm:ss",shortMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longMonthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],shortWeekDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longWeekDayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],decimalSeparator:".",currency:"USD"},o={localeId:"en-US",englishName:"English",displayName:"English",texts:{ButtonOK:"OK",ButtonCancel:"Cancel",Yes:"Yes",No:"No",True:"True",False:"False"},settings:n},s={"en-US":o},a=[];function l(t){for(var e=0,n=a;e<n.length;e++){(0,n[e])(t)}}function u(){return e.localeId}function c(t){var n=s[t];n?r.a.assignDeep(e,n):(e.englishName=t,e.displayName=t,e.texts=r.a.assignDeep({},o.texts)),e.localeId=t}function d(){return e.settings}function h(t){e.settings||(e.settings=r.a.assignDeep({},n)),e.settings=r.a.assignDeep(e.settings,t)}function p(t,n){l(n);var i=e;t&&(n.localeId||(n.localeId=t),(i=s[t])||(i=r.a.assignDeep({},o),s[t]=i)),r.a.assignDeep(i,n)}function f(){var t,n,o,i,r,s,a="object"==typeof navigator?navigator.language:void 0;t=a,n=new Date(2020,5,7,19,34,56,88),o=n.toLocaleDateString(t,{year:"numeric",month:"numeric",day:"numeric"}),i=n.toLocaleTimeString(t,{hour:"numeric",minute:"numeric",second:"numeric"}),r=o.replace("07","dd").replace("7","d").replace("06","MM").replace("6","M").replace("2020","yyyy").replace("20","yy"),s=i.replace("19","HH").replace("07","hh").replace("7","h").replace("34","mm").replace("56","ss").replace("PM","tt"),e.settings||(e.settings={}),h({shortDateFormat:r,shortTimeFormat:s})}function g(t){var e,n=d();switch(t){case i.a.Date:e=n.shortDateFormat;break;case i.a.Time:e=n.shortTimeFormat;break;default:e=n.shortDateFormat+" "+n.shortTimeFormat}return e}function y(t){var e,n=d();switch(t){case i.a.Date:e=n.longDateFormat;break;case i.a.Time:e=n.longTimeFormat;break;default:e=n.longDateFormat+" "+n.longTimeFormat}return e}t.addMapper=function(t){a.push(t)},t.getLocales=function(){var t=[];for(var e in s)t.push({locale:e,englishName:s[e].englishName,displayName:s[e].displayName});return t.sort((function(t,e){return t.englishName>e.englishName?1:t.englishName===e.englishName?0:-1}))},t.getCurrentLocale=u,t.setLocale=function(t){console.warn("This method is deprecated. Use setCurrentLocale instead"),c(t)},t.setCurrentLocale=c,t.getText=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=e.texts,i="";if(t&&t.length)for(var r=t.length,s=0;s<r&&"object"==typeof(i=o[t[s]]);s++)o=i;return i},t.getLocaleSettings=d,t.getOneLocaleSetting=function(t){return e.settings[t]},t.getShortMonthName=function(t){var e=d();if(t>0&&t<13)return e.shortMonthNames[t-1];throw"Wrong month number: "+t},t.getLongMonthName=function(t){var e=d();if(t>0&&t<13)return e.longMonthNames[t-1];throw"Wrong month number: "+t},t.getShortWeekDayName=function(t){var e=d();if(t>0&&t<8)return e.shortWeekDayNames.length>=t?e.shortWeekDayNames[t-1]:t.toString();throw"Wrong month number: "+t},t.getLongWeekDayName=function(t){var e=d();if(t>0&&t<8)return e.longWeekDayNames.length>=t?e.longWeekDayNames[t-1]:t.toString();throw"Wrong month number: "+t},t.updateLocaleSettings=h,t.updateLocaleTexts=function(t){"object"==typeof t?(l({localeId:e.localeId,texts:t}),r.a.assignDeep(e.texts,t)):console.error("Wrong parameter type in updateLocaleTexts function call.The first parameter (localeId) is not necessary. Use updateLocaleTexts(texts) instead")},t.updateDefaultTexts=function(t){for(var n in s){var o=s[n];o.texts=r.a.assignDeep({},t,o.texts)}e.texts=r.a.assignDeep({},t,e.texts)},t.updateLocaleInfo=p,t.addLocale=function(t,e){p(t,e)},t.resetLocales=function(){e||(e=r.a.assignDeep({},o),f())},t.dateTimeToStr=function(t,e,n){return n?"d"==n?n=g(i.a.Date):"D"==n?n=y(i.a.Date):"f"==n?n=g(i.a.DateTime):"F"==n&&(n=y(i.a.DateTime)):n=g(e),r.a.dateTimeToStr(t,n)},t.numberToStr=function(e,n){if(n&&n.length>0){var o=n.charAt(0).toUpperCase();if("S"===o)return function(e,n){if(!m[n]){var o=n.split("|").filter((function(t){return t.length>0})).map((function(t){return t.split("=")}));if(m[n]={},o.length>0)if(o[0].length>1)for(var i=0,r=o;i<r.length;i++){var s=r[i];m[n][Number.parseInt(s[1])]=s[0]}else o.forEach((function(t,e){m[n][e]=t[0]}))}var a=m[n];if(void 0!==a[e]){s=a[e];return t.getText(s)||s}return e.toString()}(e,n.slice(1));if(["D","F","C"].indexOf(o)>=0){var i=u();return e.toLocaleString(i,function(t){var e=d(),n=t[0].toUpperCase(),o=t.length>1?Number.parseInt(t.slice(1)):"D"==n?1:2;switch(n){case"D":return{style:"decimal",useGrouping:!1,minimumIntegerDigits:o};case"C":return{style:"currency",currency:e.currency,minimumFractionDigits:o};default:return{style:"decimal",minimumFractionDigits:o,maximumFractionDigits:o}}}(n))}return function(t,e){for(var n=t.toString(),o="",i=n.length-1,r=e.length-1;r>=0;r--){var s=e.charAt(r);"#"===s||"0"===s?i>=0?(o+=n.charAt(i),i--):"0"===s&&(o+=0):o+=s}return o.split("").reverse().join("")}(Math.trunc(e),n)}var s=d();return r.a.numberToStr(e,s.decimalSeparator)},t.booleanToStr=function(e,n){if(n&&n.length>0&&"S"===n.charAt(0).toUpperCase()){var o=n.slice(1).split("|");if(o.length>1){var i=o[e?1:0];return t.getText(i)||i}}return""+e};var m={}}(o||(o={}))},function(t,e,n){"use strict";n.d(e,"q",(function(){return i})),n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return s})),n.d(e,"k",(function(){return a})),n.d(e,"m",(function(){return l})),n.d(e,"p",(function(){return u})),n.d(e,"l",(function(){return c})),n.d(e,"c",(function(){return d})),n.d(e,"i",(function(){return h})),n.d(e,"f",(function(){return p})),n.d(e,"h",(function(){return f})),n.d(e,"g",(function(){return g})),n.d(e,"j",(function(){return y})),n.d(e,"n",(function(){return m})),n.d(e,"o",(function(){return v})),n.d(e,"e",(function(){return b})),n.d(e,"d",(function(){return C}));var o=n(68);function i(t,e){for(t.appendChild(e);t.firstChild!==e;)e.appendChild(t.firstChild)}function r(t,e,n){var o=document.createElement(e),i=n||{};return i.cssClass&&(o.className=i.cssClass),t.appendChild(o),o}function s(t,e){t.className=t.className?t.className+" "+e:e}function a(t){t.style.display="none"}function l(t,e){e||(e=""),t.style.display=e}function u(t,e,n){n||(n={}),n.display||(n.display=""),n.duration||(n.duration=200),a(t),l(e,n.display),n.complete&&n.complete()}function c(t){return"none"!=t.style.display&&0!=t.offsetWidth&&0!=t.offsetHeight}function d(t){var e;return"function"==typeof Event?e=new Event(t):(e=document.createEvent("Event")).initEvent(t,!0,!0),e}function h(){return{width:Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),height:Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)}}function p(){return o.a.IsIE()?y():{width:Math.max(document.documentElement.clientWidth,document.body.clientWidth||0),height:Math.max(document.documentElement.clientHeight,document.body.clientHeight||0)}}function f(){var t=document.body,e=document.documentElement;return{top:window.pageYOffset||e.scrollTop||t.scrollTop,left:window.pageXOffset||e.scrollLeft||t.scrollLeft}}function g(t){var e={x:0,y:0};if(null!==t){var n=function(t){var e,n={top:0,right:0,bottom:0,left:0,width:0,height:0};try{e=t.getBoundingClientRect()}catch(t){e=n}var o=document.body,i=document.documentElement,r=f(),s=r.top,a=r.left,l=i.clientTop||o.clientTop||0,u=i.clientLeft||o.clientLeft||0,c=e.top+s-l,d=e.left+a-u;return{top:Math.round(c),left:Math.round(d)}}(t);e={x:n.left,y:n.top}}return e}function y(){return{width:window.innerWidth,height:window.innerHeight}}function m(t,e,n){t.style.removeProperty("display");var o=window.getComputedStyle(t).display;"none"===o&&(o="block"),t.style.display=o;var i=t.offsetHeight;t.style.overflow="hidden",t.style.height="0px",t.style.paddingTop="0px",t.style.paddingBottom="0px",t.style.marginTop="0px",t.style.marginBottom="0px",t.offsetHeight,t.style.boxSizing="border-box",t.style.transitionProperty="height, margin, padding",t.style.transitionDuration=e+"ms",t.style.height=i+"px",t.style.removeProperty("padding-top"),t.style.removeProperty("padding-bottom"),t.style.removeProperty("margin-top"),t.style.removeProperty("margin-bottom"),window.setTimeout((function(){t.style.removeProperty("height"),t.style.removeProperty("overflow"),t.style.removeProperty("transition-duration"),t.style.removeProperty("transition-property"),t.style.removeProperty("box-sizing"),n&&n()}),e)}function v(t,e,n){t.style.transitionProperty="height, margin, padding",t.style.transitionDuration=e+"ms",t.style.boxSizing="border-box",t.style.height=t.offsetHeight+"px",t.offsetHeight,t.style.overflow="hidden",t.style.height="0px",t.style.paddingTop="0px",t.style.paddingBottom="0px",t.style.marginTop="0px",t.style.marginBottom="0px",window.setTimeout((function(){t.style.display="none",t.style.removeProperty("height"),t.style.removeProperty("padding-top"),t.style.removeProperty("padding-bottom"),t.style.removeProperty("margin-top"),t.style.removeProperty("margin-bottom"),t.style.removeProperty("overflow"),t.style.removeProperty("transition-duration"),t.style.removeProperty("transition-property"),t.style.removeProperty("box-sizing"),n&&n()}),e)}var b="eqjs",C="eqjs-mobile"},function(t,e,n){"use strict";var o;n.d(e,"a",(function(){return o})),function(t){t[t.Unknown=0]="Unknown",t[t.Simple=1]="Simple",t[t.Group=51]="Group"}(o||(o={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var o=n(0),i=n(14),r=n(12),s=n(8),a=function(){function t(t){var e=this;this.parent=t,this.tag=s.a.Constant,this.kind=r.a.Scalar,this.dataType=o.DataType.Unknown,this._value="",this.distinct=!1,this._isDefaultValue=!1,this.getText=function(){return e.text||e._value},this.args=new Array}return t.prototype.getParent=function(){return this.parent},t.prototype.getModel=function(){return this.parent.getQuery().getModel()},t.prototype.loadFromData=function(e,n){if(n)if(this.tag=n.tag,n.val?(this._value=n.val,this.text=n.txt):n.id&&(this.kind=r.a.Attribute,this._value=n.id,this.text=n.txt),void 0!==n.dtype&&(this.dataType=n.dtype),this.tag==s.a.EntityAttribute||this.tag==s.a.ParentEntityAttribute)this.kind=r.a.Attribute;else{if(void 0!==n.kind&&(this.kind=n.kind),n.query&&(this.subQuery=this.parent.getQuery().createSubQuery(),this.subQuery.loadFromDataOrJson(n.query)),void 0!==n.distinct&&(this.distinct=n.distinct),n.func&&(this.func=n.func,n.args))for(var o=0;o<n.args.length;o++){var i=new t(this.parent);i.loadFromData(e,n.args[o]),this.args.push(i)}n.sql&&(this.sql=n.sql,this.baseAttrId=n.baseAttrId)}},t.prototype.saveToData=function(){var t={tag:this.tag};if(t.dtype=this.dataType,this.tag==s.a.EntityAttribute||this.tag==s.a.ParentEntityAttribute)this._value&&(t.id=this._value,t.val=this._value),this.text&&(t.txt=this.text);else{if(this.subQuery&&(t.query=this.subQuery.toJSONData()),void 0!==this.kind&&(t.kind=this.kind),this._value&&(t.val=this._value),this.text&&(t.txt=this.text),this.distinct&&(t.distinct=this.distinct),this.func){t.func=this.func,t.args=[];for(var e=0;e<this.args.length;e++)t.args.push(this.args[e].saveToData())}this.sql&&(t.sql=this.sql,t.baseAttrId=this.baseAttrId)}return t},t.prototype.getIndex=function(){return this.parent.getExpressionIndex(this)},Object.defineProperty(t.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),t.prototype.setValue=function(t,e){void 0===e&&(e=!1),this.setContent(t,void 0,e)},t.prototype.setContent=function(t,e,n){void 0===n&&(n=!1);var o=this.value;if(this.kind==r.a.Attribute&&t){var i=this.getModel().getAttributeById(t);if(!i)throw"No such entity attribute:"+t;this.dataType=i.dataType}this._value=t,void 0!==e?this.text=e:void 0!==this.text&&(this.text=t),this._isDefaultValue=!1,n||this.parent.expressionChanged(this,o)},t.prototype.isEmpty=function(){return!(this.text||this._value)},t.prototype.hasText=function(){return this.text&&this.text.length>0},t.prototype.tryCopyValueFrom=function(t){if(this.kind==t.kind){if(this.dataType==t.dataType)this.setContent(t.value.length?t.value:this._value,t.text&&t.text.length?t.text:this.text,!0);else{var e=i.a.convertValue(t.value,t.dataType,this.dataType);this.setContent(e.length?e:this._value,t.text&&t.text.length?t.text:this.text,!0)}this.subQuery=t.subQuery,this.sql=t.sql,this.baseAttrId=t.baseAttrId}else this._isDefaultValue||(this.setContent("","",!0),this.subQuery=null,this.sql=null,this.baseAttrId=null)},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var o,i=n(0),r=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t){function e(){return t.call(this)||this}return r(e,t),e.prototype.loadFromData=function(e){t.prototype.loadFromData.call(this,e),e&&(e.sql&&(this.statement=e.sql),e.extraParams&&(this.extraParams=e.extraParams))},e}(i.ValueEditor)},function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return s})),n.d(e,"c",(function(){return a}));var o,i=n(0),r=n(39);!function(t){t[t.NONE=1]="NONE",t[t.LEFT=2]="LEFT",t[t.CENTER=3]="CENTER",t[t.RIGHT=4]="RIGHT"}(o||(o={}));var s=function(){function t(t,e,n){void 0===n&&(n=!1),this._label=null,this._description=null,this.align=o.NONE,this.isVisible=!0,this.isRowNum=!1,this.dataColumn=t,this.grid=e;var s=e.options.columnWidths||{};t?(t.style.alignment&&(this.align=function(t){switch(t){case i.ColumnAlignment.Left:return o.LEFT;case i.ColumnAlignment.Center:return o.CENTER;case i.ColumnAlignment.Right:return o.RIGHT;default:return o.NONE}}(t.style.alignment)),this.width=s&&s[this.type]?s[this.type].default:250,this.cellRenderer=this.grid.cellRendererStore.getDefaultRenderer(t.type),this._description=t.description):n&&(this.isRowNum=!0,this.width=s&&s.rowNumColumn?s.rowNumColumn.default:60,this._label="",this.cellRenderer=this.grid.cellRendererStore.getDefaultRendererByType(r.a.NUMBER)),e&&e.options&&e.options.onGetCellRenderer&&(this.cellRenderer=e.options.onGetCellRenderer(this,this.cellRenderer)||this.cellRenderer)}return Object.defineProperty(t.prototype,"label",{get:function(){return this._label?this._label:this.isRowNum?"":this.dataColumn.label},set:function(t){this._label=this.label},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"description",{get:function(){return this._description},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return this.dataColumn?this.dataColumn.type:null},enumerable:!0,configurable:!0}),t}(),a=function(){function t(t,e){this.items=[],this.grid=e,this.sync(t)}return t.prototype.sync=function(t,e){void 0===e&&(e=!0),this.clear();var n=new s(null,this.grid,!0);if(this.add(n),e||(n.isVisible=!1),t)for(var o=0,i=t.getItems();o<i.length;o++){var r=i[o],a=new s(r,this.grid);this.grid.options.onSyncGridColumn&&this.grid.options.onSyncGridColumn(a),this.add(a)}},Object.defineProperty(t.prototype,"count",{get:function(){return this.items.length},enumerable:!0,configurable:!0}),t.prototype.add=function(t){var e=this.items.length;return this.items.push(t),e},t.prototype.put=function(t,e){t>=0&&t<this.items.length&&(this.items[t]=e)},t.prototype.move=function(t,e){var n=this.items.indexOf(t);n>=0&&n!=e&&i.utils.moveArrayItem(this.items,n,e)},t.prototype.get=function(t){return t>=0&&t<this.items.length?this.items[t]:null},t.prototype.getItems=function(){return this.items},t.prototype.removeAt=function(t){this.get(t);this.items.splice(t,1)},t.prototype.clear=function(){this.items=[]},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return a}));var o,i=n(0),r=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t){function e(e){var n=t.call(this,e)||this;return n.useInConditions=!1,n.useInResult=!1,n.useInSorting=!1,n}return r(e,t),e.prototype.loadFromData=function(e,n){t.prototype.loadFromData.call(this,e,n),n&&(this.useInConditions=n.uic,this.useInResult=n.uir,this.useInSorting=n.uis)},e.prototype.scan=function(e,n){t.prototype.scan.call(this,(function(t,n){return e&&e(t,n)}),(function(t,e){return n&&n(t,e)}))},e}(i.MetaEntity),a=function(t){function e(e){var n=t.call(this,e)||this;return n.params=[],n.useInConditions=!0,n.useInResult=!0,n.useInSorting=!0,n.defaultOperator="",n.operators=new Array,n.lookupAttr="",n.expr="",n}return r(e,t),e.prototype.loadFromData=function(e,n){t.prototype.loadFromData.call(this,e,n),n&&(this.useInConditions=n.uic,this.useInResult=n.uir,this.useInSorting=n.uis,this.expr=n.sql,this.defaultOperator=n.defOperator,this.operators=n.ops,n.udata&&(this.userData=n.udata))},e}(i.MetaEntityAttr)},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var o,i=n(0),r=n(2),s=n(42),a=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(e,n,o,i){var r=t.call(this,i)||this;return r.panel=e,r.expression=n,r.valueEditor=o,r}return a(e,t),Object.defineProperty(e.prototype,"cssPrefix",{get:function(){return"eqjs-qp"},enumerable:!0,configurable:!0}),e.prototype.render=function(e){return void 0===e&&(e=!1),t.prototype.render.call(this,e),this.panel.options.onExpressionRendered&&this.panel.options.onExpressionRendered(this.expression,this.element),this.element},e.prototype.getContext=function(){return this.panel.getContext()},e.prototype.isReadOnly=function(){var t=this.expression.getParent();return!t.enabled||t.isReadOnly()},e.prototype.isEditable=function(){return!this.isReadOnly()},e.prototype.getClassesToAdd=function(){return this.cssPrefix+"-condelement "+this.cssPrefix+"-valueelement"},e.prototype.getLabelText=function(){return this.expression.isEmpty()?this.getEmptyText():this.expression.value},e.prototype.getEmptyText=function(){return this.panel.options.emptyTextValue||i.i18n.getText("MsgEmptyScalarValue")},e.prototype.setValue=function(t,e){this.expression.setValue(t),e||this.expression.getParent().fireChangedEvent(r.ConditionPart.Value)},e.prototype.getValue=function(){return this.expression.value},e.prototype.validateInput=function(t){return{success:!0,value:t}},e.prototype.showValidationError=function(t,e){this.getContext().throwError({action:"ui.validation",text:t})},e.prototype.isEmptyValue=function(){var t=this.getValue();return null==t||!t},e.prototype.adjustWidth=function(){},e}(s.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return T}));var o,i=n(0),r=n(2),s=n(1),a=n(10),l=n(9),u=n(35),c=n(78),d=n(80),h=n(52),p=n(81),f=n(26),g=n(82),y=n(83),m=n(84),v=n(4),b=n(3),C=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),x=function(t){function e(e,n,o,i){var s=t.call(this,e,n,o,i)||this;return s.expression.tag=r.ExprTag.ParentColumn,s}return C(e,t),e.prototype.fillMenuItemsList=function(t){var e=this.panel.getQuery().getParentQuery(),n=this.expression.getParent().expressions[0].dataType;this.menuItemsList=e.getColumns().filter((function(t){return t.expr.dataType==n})).map((function(t){return{id:t.id,text:t.caption}})),t&&t()},e}(f.a),w=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),T=function(t){function e(e,n){var o=t.call(this,e)||this;return o.options={editableParts:a.a.All,isSubQuery:!1,activeCondition:null,entitiesPopupHandler:null,entitiesListFilter:null,menuContainer:document.body,showRootRow:!0,showAddRow:!0,showCheckboxes:!1,allowParameterization:!1,allowInJoinConditions:!1,showPoweredBy:!1,buttons:{condition:null,group:null},alwaysShowButtonsInGroups:!1,alwaysShowButtonsInConditions:!1,showConjunctions:!0,accentActiveCondition:!0,activateRootOnStart:!0,yearRange:"c-10:c+10",oneClickDateSelection:!0,showDateTimeInput:!1,attrElementFormat:"{entity} {attr}",menuOptions:{showSearchBoxAfter:30,searchBoxAutoFocus:!0,activateOnMouseOver:!0,itemRenderedCallback:null},allowDragDrop:!0,attrPlacement:0,sortEntities:!1,subQueryDialogWidth:600,subQueryDialogHeight:300,dialogZIndex:1e5,numberListSeparators:[",",";"],autoEditNewCondition:!1,onConditionRendered:null,onGetConditionRenderer:null,onGetExpressionRenderer:null,onGetOperatorRenderer:null,onOperatorRendered:null,onGetAddRowRenderer:null,defaultQuery:null},o.customQuery=null,o.landingSlot=Object(s.domel)("div").addClass(o.cssPrefix+"-cond-landing-slot").addChildElement(Object(s.domel)("div").toDOM()).toDOM(),o.slot.classList.contains(o.cssPrefix+"-panel")||o.slot.classList.add(o.cssPrefix+"-panel"),o.group=r.WidgetGroup.Query,n&&(o.customQuery=n),o}return w(e,t),Object.defineProperty(e.prototype,"cssPrefix",{get:function(){return"eqjs-qp"},enumerable:!0,configurable:!0}),e.prototype.getWidgetType=function(){return"queryPanel"},e.prototype.init=function(e,n){var o=this;if(t.prototype.init.call(this,e,n),this.setOptions(n),this.detachQueryObserver(),this.attachQueryObserver(),s.eqDragManager.removeDropContainer(this.slot),this.options.allowDragDrop){var i=this.getContext().getModel();s.eqDragManager.registerDropContainer({element:this.slot,scopes:["entityAttr"],onDragEnter:function(t,e){o.slot.classList.add(v.b+"-drophover"),e.dragImage.classList.add("eqjs-sortable-helper"),o.showLandingSlot();var n=e.data.attrId;i.checkAttrProperty(n,"useInConditions")||(e.dropEffect=s.DropEffect.Forbid)},onDragOver:function(t,e){},onDragLeave:function(t,e){e.dragImage.classList.remove("eqjs-sortable-helper"),e.dragImage.style.removeProperty("width"),o.slot.classList.remove(v.b+"-drophover"),o.hideLangindSlot()},onDrop:function(t,e){var n=o.getQuery(),i={parent:n.getRootCondition(),attributeId:e.data.attrId},s=n.addSimpleCondition(i);s&&n.fireConditionsChangedEvent(r.QueryChangeAction.Add,s)}})}},e.prototype.destroyCore=function(){s.eqDragManager.removeDropContainer(this.slot),this.detachQueryObserver(),this.slot.innerHTML=""},e.prototype.getEntitiesMenu=function(){return this.entitiesMenu},e.prototype.getConditionMenu=function(){return this.conditionMenu},e.prototype.getLinkTypeMenu=function(){return this.linkTypeMenu},e.prototype.getConditionGroupMenu=function(t){return void 0===t&&(t=!1),t?this.rootGroupMenu:this.groupMenu},e.prototype.attachQueryObserver=function(){var t=this,e=this.getQuery();this.queryEventCallbackId=e.addChangedCallback((function(e){var n=e.data;if(n&&(n.part==r.QueryChangePart.Conditions||n.part==r.QueryChangePart.All)){var o=document.activeElement,i=t.slot.contains(o)||o==document.body;switch(n.action){case r.QueryChangeAction.Modify:var s=n.changee,a=function(e,o){var s=t.slot.querySelector("div[data-id="+e.id+"]");if(s){o=o&&(n.condPart&r.ConditionPart.Operator)===r.ConditionPart.Operator&&e.expressions.length>1&&(e.expressions[1]._isDefaultValue||""==e.expressions[1].value||null==e.expressions[1].value);var a=s.classList.contains("active"),l=t.getConditionRenderer(e,s);if(l){var u=l.render(o);if(a&&t.toggleConditionPicked(e),i&&!o){var c=u.querySelector("a")||u.querySelector(".eqjs-qp-condition-button");c&&Object(v.d)(c)}}}},l=t.options.autoEditNewCondition;Array.isArray(s)?(s.forEach((function(t){return a(t,l)})),l=!1):a(s,l);break;case r.QueryChangeAction.Add:s=n.changee;var u=function(e){var n=t.getConditionRenderer(e);if(n){var o=e.getParent(),r=t.slot.querySelector("div[data-id="+o.id+"]");if(r){var s=r.lastChild;if(s){var a=n.render(t.options.autoEditNewCondition);s.appendChild(a),a.scrollIntoView(!1),i&&!t.options.autoEditNewCondition&&a.querySelector("a").focus()}}}};Array.isArray(s)?s.forEach((function(t){return u(t)})):u(s);break;case r.QueryChangeAction.Delete:s=n.changee;var c=function(e){var n=t.slot.querySelector("div[data-id="+e.id+"]");if(n){var o=t.slot.querySelector("div[data-id="+e.getParent().id+"] > .eqjs-qp-row-group"),r=n.nextSibling,s=n.previousSibling;if(n.parentElement.removeChild(n),i){var a=r||s||o,l=a.querySelector("a")||a.querySelector(".eqjs-qp-condition-button");l&&l.focus()}}};Array.isArray(s)?s.forEach((function(t){return c(t)})):c(s);break;default:t.refresh()}}}))},e.prototype.detachQueryObserver=function(){this.queryEventCallbackId&&this.getQuery().removeChangedCallback(this.queryEventCallbackId)},e.prototype.getQuery=function(){return this.customQuery?this.customQuery:this.context.getQuery()},e.prototype.refreshCore=function(){this.clear(),this.render()},e.prototype.setOptions=function(t){i.utils.assignDeep(this.options,t),this.options.dateFormatValue&&i.i18n.updateLocaleSettings({editDateFormat:this.options.dateFormatValue}),this.options.dateFormatDisplay&&i.i18n.updateLocaleSettings({shortDateFormat:this.options.dateFormatDisplay}),void 0===this.options.editableParts&&(this.options.editableParts=a.a.All),b.a.isMobileMode()&&(this.options.buttons=this.options.buttons||{},this.options.buttons.condition=["menu"],this.options.buttons.group=["menu"])},e.prototype.clear=function(){this.slot.innerHTML=""},e.prototype.render=function(){try{this.entitiesMenu=this.createEntitiesMenu(),this.createConditionMenus(),this.createLinkTypeMenu(),this.rootContainer=Object(s.domel)("div",this.slot).toDOM(),Object(s.domel)(this.slot).removeClass(v.a).addClass(b.a.getMobileCssClass());var t=this.getQuery().getRootCondition(),e=this.getConditionRenderer(t,this.rootContainer);if(e&&e.render(),this.options.showAddRow){this.addRowElement=Object(s.domel)("div",this.slot).toDOM();var n=this.getAddRowRenderer(this.addRowElement);n&&n.render()}}catch(t){var o=t;this.context.throwError({action:"QueryPanel rendering",text:o.message,sourceError:o})}},e.prototype.getConditionRenderer=function(t,e){var n;if(this.options.onGetConditionRenderer&&(n=this.options.onGetConditionRenderer(t,e)))return n;switch(t.tag){case r.CondTag.Simple:return new u.c(this,t,e);case r.CondTag.Group:return new c.a(this,t,e)}return null},e.prototype.getExpressionRenderer=function(t,e){if(!t)throw"Expression is not defined in the condition";var n,o,s=this.getContext().getModel(),a=t.getParent(),l=s.getOperatorById(a.getOperatorId()),u=s.getAttributeByIdSafe(a.expressions[0].value),c=s.getOperand(u,l,t.getIndex());o=(n=c&&c.editor&&c.editor.tag!==r.EqEditorTag.Unknown?c.editor:u&&u.defaultEditor?u.defaultEditor:new r.EqValueEditor).tag;var p=t.dataType;if(p==i.DataType.Unknown&&(p=u.dataType),t.kind===r.DataKind.Attribute){if(0===t.getIndex())return new h.a(this,t,this.entitiesMenu,e);var g=this.createEntitiesMenu((function(t,e){return!e||e.useInConditions&&e.dataType===p}));return new h.a(this,t,g,e)}if(t.kind===r.DataKind.Query?o=r.EqEditorTag.SubQuery:t.kind===r.DataKind.Scalar?o!=r.EqEditorTag.Unknown||t.dataType!==i.DataType.Date&&t.dataType!==i.DataType.DateTime&&t.dataType!==i.DataType.Time||(o=r.EqEditorTag.DateTime):t.kind==r.DataKind.ParentColumn&&(o=r.EqEditorTag.BindToParentColumn),this.options.onGetExpressionRenderer){var v=this.options.onGetExpressionRenderer(this,t,n,e);if(v)return v}switch(o){case r.EqEditorTag.List:return new f.b(this,t,n,e);case r.EqEditorTag.SqlList:return new f.c(this,t,n,e);case r.EqEditorTag.CustomList:return new f.a(this,t,n,e);case r.EqEditorTag.DateTime:return new y.a(this,t,n,e);case r.EqEditorTag.SubQuery:return new m.a(this,t,n,e);case r.EqEditorTag.BindToParentColumn:return new x(this,t,n,e);default:return new d.a(this,t,n,e)}},e.prototype.getOperatorRenderer=function(t,e,n){var o;return this.options.onGetOperatorRenderer&&(o=this.options.onGetOperatorRenderer(t,e,n)),o||new g.a(this,t,e,n)},e.prototype.getAddRowRenderer=function(t){var e;return this.options.onGetAddRowRenderer&&(e=this.options.onGetAddRowRenderer(t)),e||new p.a(this,this.entitiesMenu,t)},e.prototype.createEntitiesMenu=function(t){var e=this.getContext().getModel();if(!e||e.isEmpty())return null;var n=this.slot.id||"eq-querypanel";n+="-EntitiesMenu";var o={items:e.getEntitiesTree({addUIC:!0,addUIR:!1,addUIS:!1,attrPlacement:this.options.attrPlacement,sortEntities:this.options.sortEntities},t),adjustHeight:this.options.adjustEntitiesMenuHeight,id:n,domWriteItemsId:this.options.domWriteItemsId};return i.utils.assign(o,this.options.menuOptions),new l.a(o)},e.prototype.showEntitiesMenu=function(t){this.entitiesMenu.showMenu(t)},e.prototype.createConditionMenus=function(){var t=this.getQuery(),e=this.slot.id||"eq-querypanel";e+="-ConditionMenu";var n=[{id:"enable",text:i.i18n.getText("MenuEnable")},{id:"delete",text:i.i18n.getText("CmdDelete")}];t.isEx()&&((this.options.allowParameterization||this.options.allowInJoinConditions)&&n.push({id:"delimiter",text:"---"}),this.options.allowParameterization&&n.push({id:"param",text:i.i18n.getText("MenuParameterization")}),this.options.allowInJoinConditions&&n.push({id:"inJoin",text:i.i18n.getText("MenuJoinCond")}));var o={items:n,adjustHeight:this.options.adjustEntitiesMenuHeight,id:e,domWriteItemsId:this.options.domWriteItemsId,showSearchBoxAfter:100,showSelected:!0};i.utils.assign(o,this.options.menuOptions),this.conditionMenu=new l.a(o);e=this.slot.id||"eq-querypanel";e+="-GroupMenu";o={items:n=[{id:"enable",text:i.i18n.getText("MenuEnable")},{id:"delete",text:i.i18n.getText("CmdDelete")},{id:"delimiter",text:"---"},{id:"addCondition",text:i.i18n.getText("CmdAddCondition")},{id:"addGroup",text:i.i18n.getText("CmdAddCondGroup")}],adjustHeight:this.options.adjustEntitiesMenuHeight,id:e,domWriteItemsId:this.options.domWriteItemsId,showSearchBoxAfter:100,showSelected:!0};i.utils.assign(o,this.options.menuOptions),this.groupMenu=new l.a(o);e=this.slot.id||"eq-querypanel";e+="-RootGroupMenu";o={items:n=[{id:"addCondition",text:i.i18n.getText("CmdAddCondition")},{id:"addGroup",text:i.i18n.getText("CmdAddCondGroup")}],adjustHeight:this.options.adjustEntitiesMenuHeight,id:e,domWriteItemsId:this.options.domWriteItemsId,showSearchBoxAfter:100,showSelected:!0};i.utils.assign(o,this.options.menuOptions),this.rootGroupMenu=new l.a(o)},e.prototype.createLinkTypeMenu=function(){var t=this.slot.id;t&&(t+="-LinkTypeMenu");var e={items:r.eqconsts.predicateLinkTypeList.map((function(t){return{id:t.id,text:i.i18n.getText(t.key)}})),adjustHeight:this.options.adjustEntitiesMenuHeight,id:t,domWriteItemsId:this.options.domWriteItemsId};i.utils.assign(e,this.options.menuOptions),this.linkTypeMenu=new l.a(e)},e.prototype.toggleConditionPicked=function(t,e){var n,o;void 0===e&&(e=void 0),t&&(n=this.slot.querySelector("div[data-id="+t.id+"][data-condrow], div[data-id="+t.id+"] > div[data-group-row]"))&&(o=n.classList.contains("active"));for(var i=this.slot.querySelectorAll("."+this.cssPrefix+"-row"),r=0;r<i.length;r++){var a=i[r];a.hasAttribute("data-group-row")?this.options.alwaysShowButtonsInGroups||Object(s.domel)(a).data("show-buttons",null):this.options.alwaysShowButtonsInConditions||Object(s.domel)(a).data("show-buttons",null),Object(s.domel)(a).removeClass("active")}n&&!o&&Object(s.domel)(n).addClass("active").data("show-buttons","")},e.prototype.showLandingSlot=function(){var t=this.slot.querySelector(".eqjs-qp-conditions-root");t&&(t.appendChild(this.landingSlot),this.landingSlot.scrollIntoView({block:"center",behavior:"smooth"}))},e.prototype.hideLangindSlot=function(){this.landingSlot.parentElement&&this.landingSlot.parentElement.removeChild(this.landingSlot)},e}(r.Widget)},function(t,e,n){"use strict";n.d(e,"b",(function(){return d})),n.d(e,"a",(function(){return h})),n.d(e,"c",(function(){return p}));var o,i=n(0),r=n(2),s=n(1),a=n(24),l=n(9),u=n(10),c=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.menuItemsList=[],e.showWhenReady=!1,e}return c(e,t),e.prototype.isEditable=function(){return!this.isReadOnly()&&(this.panel.options.editableParts&u.a.Value)===u.a.Value},e.prototype.setValue=function(t,e){void 0===e&&(e=!1);var n=this.adjustNewValue(t);if(t!==this.expression.value){var o=this.getValueText(t);this.expression.setContent(n,o),e||this.expression.getParent().fireChangedEvent(r.ConditionPart.Value)}return!0},e.prototype.getValueText=function(t){var e="";if(Array.isArray(t))for(var n=0,o=this.menuItemsList;n<o.length;n++){var i=o[n];t.indexOf(i.id)>=0&&(e+=i.text+",")}else for(var r=0,s=this.menuItemsList;r<s.length;r++){(i=s[r]).id===t&&(e+=i.text+",")}return e&&(e=e.substring(0,e.length-1)),e},e.prototype.getEmptyText=function(){return this.panel.options.emptyTextList||i.i18n.getText("MsgEmptyListValue")},e.prototype.getListName=function(){return this.valueEditor.name},e.prototype.renderEditor=function(){var t=this;this.fillMenuItemsList((function(){t.renderMenuBlock()}))},e.prototype.getLabelText=function(){return this.expression.isEmpty()?this.getEmptyText():this.expression.getText()},e.prototype.showLoader=function(){},e.prototype.hideLoader=function(){},e.prototype.showEditor=function(){var t=this;this.menu?this.menu.showMenu({anchor:this.labelElement,selectedIds:this.getValuesAsArray(),itemSelectedCallback:function(e,n){if(t.menu.options.multiselect){if(n){for(var o=[],i=n.length,r=0;r<i;r++)o.push(n[r].id);t.setValue(o)}}else t.setValue(e.id);return!1}}):(this.showWhenReady=!0,this.showLoader())},e.prototype.closeEditor=function(){this.menu.hideMenu()},e.prototype.renderMenuBlock=function(){var t=!1;this.expression&&(t=this.expression.kind===r.DataKind.List);var e=this.panel,n={items:this.menuItemsList,multiselect:t,container:e?e.options.menuContainer:null,showSelected:!0,showItemIds:!!e&&e.options.showIdsForListItems};e&&i.utils.assignDeep(n,e.options.menuOptions);var o=this.element.id;o&&(n.id=o+"-EditorMenu"),e&&(n.domWriteItemsId=e.options.domWriteItemsId),n.buttons={submit:i.i18n.getText("ButtonApply"),cancel:i.i18n.getText("ButtonCancel")},this.menu=new l.a(n)},e.prototype.getValuesAsArray=function(){if(this.expression.kind!==r.DataKind.List)return[this.expression.value];if(this.expression.value){var t=this.expression.value.match(/"[^"\\]*(?:\\.[^"\\]*)*"|[^,]+/g);return t?t.map((function(t){return'"'==t.charAt(0)&&'"'==t.charAt(t.length-1)?(t=t.substring(1,t.length-1)).replace(/\"/g,'"'):t})):[]}return[]},e.prototype.adjustNewValue=function(t){return Array.isArray(t)?t.map((function(t){return t.indexOf(",")>=0?'"'+(t=t.replace(/"/g,'"'))+'"':t})).join(","):t},e.prototype.fillMenuItemsList=function(t){this.menuItemsList=this.valueEditor.values,t&&t()},e.prototype.takeDefaultValue=function(){if(this.menuItemsList)for(var t=this.menuItemsList.length,e=0;e<t;e++){var n=this.menuItemsList[e];if(n.isDefault){this.setValue(n.id,!0);break}}},e}(a.a),h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.isLoading=!1,e.onClickTemp=null,e}return c(e,t),e.prototype.renderEditor=function(){var t=this;this.isLoading||(this.isLoading=!0,this.fillMenuItemsList((function(){if(t.isLoading=!1,t.isEmptyValue()&&t.takeDefaultValue(),!t.expression.isEmpty()&&t.expression._isDefaultValue){var e=t.getValueText(t.expression.value);t.expression.setContent(t.expression.value,e),t.expression.getParent().fireChangedEvent()}t.renderMenuBlock(),t.showWhenReady&&(t.showWhenReady=!1,t.hideLoader(),t.showEditor())})))},e.prototype.showLoader=function(){this.labelElement.style.display="none",this.loaderElement||(this.loaderElement=Object(s.domel)("div",this.element).addClass(this.cssPrefix+"-ve-loader").toDOM()),this.loaderElement.style.display="block"},e.prototype.hideLoader=function(){this.loaderElement.style.display="none",this.labelElement.removeAttribute("style")},e.prototype.fillMenuItemsList=function(t){var e=this,n=this.getListName(),o=this.panel.getContext().getListRequestHandler();r.eqconsts.constLists[n]?(this.menuItemsList=r.eqconsts.constLists[n],t&&t()):o&&o({listName:n,editorId:this.valueEditor.id,editorParams:this.valueEditor.extraParams,value:this.getValue()},(function(n){e.menuItemsList=n,t&&t()}))},e}(d),p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.fillMenuItemsList=function(t){var e=this,n=this.panel.getContext(),o=(this.valueEditor,n.getListRequestHandler());o&&o({listName:"SQL",editorId:this.valueEditor.id,editorParams:this.valueEditor.extraParams,value:this.getValue()},(function(n){e.menuItemsList=n,t&&t()}))},e}(h)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var o=n(0),i=function(){return i=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},i.apply(this,arguments)},r=i(i({},o.EditorTag),{SqlList:"SQLLIST",SubQuery:"SUBQUERY",BindToParentColumn:"BINDTOPARENTCOLUMN"})},function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return a}));var o,i=n(0),r=n(20),s=n(13);!function(t){t[t.None=0]="None",t[t.Ascending=1]="Ascending",t[t.Descending=2]="Descending"}(o||(o={}));var a=function(){function t(t,e){void 0===e&&(e=!1),this.query=t,this.justsorted=e,this.enabled=!0,this.params=[],this._isHidden=!1,this._id=i.utils.generateId("col"),this.caption="",this.sorting=o.None,this.sortIndex=-1,this.expr=new r.a(this),this.blockId=""}return Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),t.prototype.getModel=function(){return this.query.getModel()},t.prototype.getQuery=function(){return this.query},t.prototype.isReadOnly=function(){return!1},t.prototype.isJustSorted=function(){return this.justsorted},t.prototype.setReadOnly=function(t){},t.prototype.isHidden=function(){return this._isHidden},t.prototype.setHidden=function(t){this._isHidden=t},t.prototype.getDataType=function(){if(this.expr.dataType===i.DataType.Unknown){var t=null;if(this.expr.func){if("COUNT"==this.expr.func||"CNTDST"==this.expr.func)return i.DataType.Int64;t=this.expr.args[0].value}else t=this.expr.value;var e=this.query.getModel().getAttributeById(t);if(e)return e.dataType}return this.expr.dataType},t.prototype.loadFromData=function(t,e){e&&(e.id&&(this._id=e.id),this.caption=e.cptn,void 0!==e.srt&&(this.sorting=e.srt,this.sortIndex=void 0!==e.srtidx?e.srtidx:-1),!1===e.enabled&&(this.enabled=e.enabled),this.expr.loadFromData(t,e.expr),this.blockId=e.blockId,this.displayFormat=e.dfmt,this.groupFooterColumnTemlate=e.gfct,e.hidden&&this.setHidden(!0))},t.prototype.saveToData=function(){var t={};return t.id=this._id,void 0!==this.caption&&(t.cptn=this.caption),void 0!==this.sorting&&this.sorting!=o.None&&(t.srt=this.sorting,t.srtidx=this.sortIndex),t.expr=this.expr.saveToData(),this.blockId&&(t.blockId=this.blockId),!1===this.enabled&&(t.enabled=this.enabled),t.dfmt=this.displayFormat,t.gfct=this.groupFooterColumnTemlate,this.isHidden()&&(t.hidden=!0),t},t.prototype.fireChangedEvent=function(){this.query.fireChangedEvent({part:this.justsorted?s.b.SortingColumns:s.b.Columns,action:s.a.Modify,changee:this})},t.prototype.getExpressionIndex=function(t){return 0},t.prototype.expressionChanged=function(t,e){},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return y})),n.d(e,"b",(function(){return m}));var o,i=n(0),r=n(14),s=n(38),a=n(20),l=n(28),u=n(50),c=n(12),d=n(16),h=n(8),p=n(19),f=n(13),g=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),y=function(t){function e(n){var o=t.call(this,n)||this;return Error.captureStackTrace&&Error.captureStackTrace(o,e),o.name="InvalidQueryError",o}return g(e,t),e}(Error),m=function(){function t(t,e,n){var o=this;this.extraData={},this.innerData={},this.isNewbie=!0,this._isModified=!1,this._enableAggregation=!1,this.parentQuery=null,this.drillDowns=[],this.eventEmitter=new i.EventEmitter(this),this.root=new u.a(this,p.a.Group),this.extraConditions=new u.a(this,p.a.Group),this.columns=new Array,this.justsorted=new Array,this.id||this.regenerateId(),this.setDefaultName(),this.description="",this.model=t||new s.a,e&&this.loadFromData(e),this.attributeExprTag=n&&n.attrTag||h.a.EntityAttribute,this.clientListRequestHandler=n?n.clientListRequestHandler:new Array,this.serverListRequestHandler=n?n.serverListRequestHandler:new Array,this.timezoneOffset=(new Date).getTimezoneOffset(),this.aggrSettings=new i.AggregationSettings(this),n&&(this.parentQuery=n.parent),this.addChangedCallback((function(t){t.data&&(t.data.part&f.b.Columns)>0&&!t.data.aggregation&&o._enableAggregation&&o.updateAggregationSettings()&&o.fireChangedEvent({part:f.b.Aggregation})}))}return t.prototype.isModified=function(){return this._isModified},t.prototype.resetModified=function(){this._isModified=!1},Object.defineProperty(t.prototype,"enableAggregation",{get:function(){return this._enableAggregation},set:function(t){var e=this._enableAggregation;if(this._enableAggregation=t,!e&&t){this.processQueryForAggregation();this.columns.filter((function(t){return t.enabled&&t.expr.tag==h.a.AggregateFunction}))}this._enableAggregation||this.aggrSettings.clear()},enumerable:!0,configurable:!0}),t.prototype.updateAggregationSettings=function(){for(var t=!1,e=this.getAggregationSettings(),n=e.groups.length-1;n>=0;n--){for(var o=e.groups[n],i=function(e){var n=o.columns[e];r.columns.find((function(t){return t.id===n}))||(o.columns.splice(e,1),t=!0)},r=this,s=o.columns.length-1;s>=0;s--)i(s);0==o.columns.length&&e.groups.slice(n,1)}var a=e.getAggregates(),l=function(e){var n=a[e];u.columns.find((function(t){return t.id===n.colId}))||(a.splice(e,1),t=!0)},u=this;for(n=a.length-1;n>=0;n--)l(n);return t},t.prototype.createSubQuery=function(){return new t(this.model)},t.prototype.useAggregation=function(t,e){if(void 0===e&&(e=!1),this.aggrSettings.clear(),t(this.aggrSettings),this.enableAggregation)this.processQueryForAggregation(e);else if(!e)return void console.warn("Aggregation is turned off. Turn it on with query.enableAggregation = true")},t.prototype.useDefaultAggregation=function(){var t=this;this._enableAggregation=!0,this.useAggregation((function(e){var n=t.columns.filter((function(t){return t.enabled&&t.expr.tag==h.a.AggregateFunction}));if(n.length){for(var o=t.columns.filter((function(t){return t.enabled&&t.expr.tag==h.a.EntityAttribute})),r=[],s=0,a=n;s<a.length;s++){var l=a[s];r.push({id:l.id,func:l.expr.func}),t.changeColumnType(l,h.a.EntityAttribute)}for(var u=0,c=r;u<c.length;u++){var d=c[u];e.addAggregateColumn(d.id,d.func)}for(var p=0,g=o;p<g.length;p++){l=g[p];e.addGroup({columns:[l.id],name:l.caption})}e.addGrandTotals(),t.fireChangedEvent({part:f.b.Columns,wasModified:!1})}else{var y=t.getColumns().filter((function(e){return e.enabled&&e.expr.tag==h.a.EntityAttribute&&t.model.getAttributeById(e.expr.value).dataType===i.DataType.Currency}))[0],m=t.getColumns().filter((function(e){return e.enabled&&e.expr.tag==h.a.EntityAttribute&&t.model.getAttributeById(e.expr.value).dataType===i.DataType.String}))[0];if(!y&&!e.hasAggregates()||!m)return;e.addGrandTotals().addAggregateColumn(y.id,"SUM").addGroup({columns:[m.id],name:"Default"})}}))},t.prototype.processQueryForAggregation=function(t){void 0===t&&(t=!1);var e=this.getAggregationSettings().getGroups();if(e.length>0){for(var n=e[e.length-1].columns,o=[],i=[],r=0,s=this.getColumns();r<s.length;r++){var a=s[r];n.indexOf(a.id)>=0?o.push(a):a.sorting!=l.b.None&&i.push(a)}var u=0;o.forEach((function(t){t.sorting==l.b.None&&(t.sorting=l.b.Ascending),t.sortIndex=u++})),i.forEach((function(t){t.sortIndex=u++})),t||this.fireChangedEvent({part:f.b.Columns,aggregation:!0,wasModified:!1})}},t.prototype.getAggregationSettings=function(){return this.aggrSettings},t.prototype.getColumnIds=function(t,e){return e=e||t,this.columns.slice(t,e-t+1).map((function(t){return t.id}))},t.prototype.validateColumns=function(t){for(var e=this.columns.filter((function(t){return t.enabled})).map((function(t){return t.id})),n=-1,o=0,i=t;o<i.length;o++){var r=i[o],s=e.indexOf(r);if(s<0)return!1;if(n>s)return!1;n=s}return!0},t.prototype.validateAggregate=function(t,e){var n=this.columns.filter((function(e){return e.enabled&&e.id===t}))[0],o=this.model.findAggrFunctionById(e);return!(!o||!n||o.appliedTypes.indexOf(n.expr.dataType)<0)},t.prototype.isEx=function(){return!1},t.prototype.reset=function(t){void 0===t&&(t=!0),t&&this.clear(),this.regenerateId(),this.setDefaultName(),this._isModified=!1,this.isNewbie=!0},t.prototype.hasEnabledAggrColumns=function(){return this.columns.filter((function(t){return t.enabled&&t.expr.tag===h.a.AggregateFunction})).length>0},t.prototype.setDefaultName=function(){return this.setName(i.i18n.getText("NewQueryName")),this.getName()},t.prototype.validate=function(t){t=t||{};var e="EntityAttribute isn't declared in the model: ";if(!this.model)throw new y("Model is not declared");if(this.columns)for(var n=0,o=this.columns;n<o.length;n++){var i=o[n];if(i.expr.tag==h.a.EntityAttribute||i.expr.tag===h.a.ParentEntityAttribute){if(!this.model.getAttributeById(i.expr.value))throw new y(e+i.expr.value)}else if(i.expr.tag===h.a.AggregateFunction){if(!this.model.getAttributeById(i.expr.args[0].value))throw new y(e+i.expr.args[0].value)}else if(i.expr.tag!==h.a.CustomSql)throw new y("The expression has wrond tag: "+i.expr.tag)}this.root&&this.root.getConditions()&&this.validateConditionGroup(this.root,t)},t.prototype.getAggregatedColumns=function(){return this.getColumns().filter((function(t){return t.enabled&&t.expr.tag===h.a.AggregateFunction}))},t.prototype.tryValidate=function(t){try{return this.validate(t),!0}catch(t){if(t instanceof y)return!1;throw t}},t.prototype.validateConditionGroup=function(t,e){if(t.isGroup())for(var n=0,o=t.getConditions();n<o.length;n++){var r=o[n];r.enabled&&this.validateConditionGroup(r,e)}else if(t.expressions[0].tag===h.a.EntityAttribute){var s=t.expressions[0].value;if(!this.model.getAttributeById(s))throw new y("EntityAttribute isn't declared in the model: "+s);if(!e.checkExpressions)return;for(var a=1;a<t.expressions.length;a++){var l=t.expressions[a];if(l.tag===h.a.Constant&&i.utils.isNumericType(l.dataType)){if(!l.value)continue;for(var u=0,d=l.kind===c.a.List?l.value.split(/\s*,\s*/):[l.value];u<d.length;u++){var p=d[u],f=+p;if(isNaN(f))throw new y("Expression constant is NaN in condition:"+t.id);if(i.utils.isIntType(l.dataType)&&f!=parseInt(p,10))throw new y("Expression constant is wrong interger in condition: "+t.id)}}}}},t.prototype.loadFromDataOrJson=function(t,e){t&&("string"==typeof t?this.loadFromJson(t,e):this.loadFromData(t,e))},t.prototype.loadFromJson=function(t,e){var n=JSON.parse(t);this.loadFromData(n,e)},t.prototype.loadFromData=function(t,e){var n=this;e=i.utils.assign({changeStatus:!0,validate:!0},e||{});if(this.clear(),this.clearDrillDowns(),t){if(this.id=t.id,this.root.loadFromData(this.model,t.root),t.root&&t.root.conds)for(var o=0;o<t.root.conds.length;o++){var r=t.root.conds[o];if(!r.conds||this.isEx()){var s=this.createCondition();s.loadFromData(this.model,r),this.root.addCondition(s)}else console.error("Community version doesn't support working with groups.")}if(this.name=t.name,this.description=t.desc,this.justsorted=[],t.justsortcols)for(o=0;o<t.justsortcols.length;o++){(a=this.createColumn(!0)).loadFromData(this.model,t.justsortcols[o]),this.justsorted.push(a)}if(t.cols)for(o=0;o<t.cols.length;o++){var a;(a=this.createColumn()).loadFromData(this.model,t.cols[o]),this.columns.push(a)}if(t.extraData&&(this.extraData=t.extraData),this.innerData=t.innerData||this.innerData,this.innerData&&this.innerData.aggr&&(this._enableAggregation=this.innerData.aggr.enabled||!1,this.useAggregation((function(t){t.loadFromData(n.innerData.aggr)}),!0)),t.dds&&t.dds.length)for(var l=0,u=t.dds;l<u.length;l++){var c=u[l];this.addDrillDown().loadFromData(c)}}e.changeStatus&&(this.isNewbie=!1,this._isModified=!1),e.validate&&this.validate()},t.prototype.addDrillDown=function(){var t=this.model.createQuery();return t.parentQuery=this,this.drillDowns.push(t),t},t.prototype.getDrillDowns=function(){return this.drillDowns},t.prototype.getParentQuery=function(){return this.parentQuery},t.prototype.findColumnById=function(t){for(var e=0,n=this.columns;e<n.length;e++){var o=n[e];if(o.id===t)return o}return null},t.prototype.getModel=function(){return this.model},t.prototype.setModel=function(t){this.model=t},t.prototype.loadModelData=function(t){this.model.setData(t)},t.prototype.toJSON=function(){return JSON.stringify(this.toJSONData())},t.prototype.toJSONData=function(){var t=this,e={modelId:this.model?this.model.getId():null,modelName:this.model?this.model.getName():null};e.id=this.id,e.name=this.name,this.description&&(e.desc=this.description),e.cols=[];for(var n=0;n<this.columns.length;n++)e.cols.push(this.columns[n].saveToData());e.justsortcols=[];for(n=0;n<this.justsorted.length;n++)e.justsortcols.push(this.justsorted[n].saveToData());this.extraData&&(e.extraData=this.extraData),this.innerData&&(e.innerData=this.innerData,e.innerData.aggr=this.aggrSettings.saveToData(),e.innerData.aggr.enabled=this._enableAggregation);var o=function(e){var n=e.saveToData();n.conds=[];for(var o=e.getConditions(),i=0;i<o.length;i++)!o[i].isGroup()||t.isEx()?n.conds.push(o[i].saveToData()):console.error("Community version doesn't support working with groups.");return n};if(e.root=o(this.root),e.extraConds=o(this.extraConditions),this.drillDowns.length>0){e.dds=[];for(var r=0,s=this.drillDowns;r<s.length;r++){var a=s[r];e.dds.push(a.toJSONData())}}return e.timezoneOffset=this.timezoneOffset,e.locale=i.i18n.getCurrentLocale(),e},t.prototype.isEmptyConditions=function(){return this.root.isEmpty()},t.prototype.isEmptyColumns=function(){return!this.columns||0===this.columns.length},t.prototype.isEmpty=function(){return this.isEmptyColumns()&&this.isEmptyConditions()},t.prototype.clear=function(){this._enableAggregation=!1,this.aggrSettings.clear(),this.clearColumns(),this.clearConditions(),this.clearExtraConditions(),this.innerData={},this.extraData={}},t.prototype.clearColumns=function(){this.columns=[],this.justsorted=[]},t.prototype.clearConditions=function(){this.root.clearConditions(),this.root.linkType=d.a.All,this.root.enabled=!0},t.prototype.clearExtraConditions=function(){this.extraConditions.clearConditions()},t.prototype.clearDrillDowns=function(){this.drillDowns=[]},t.prototype.getId=function(){return this.id},t.prototype.setId=function(t){this.id=t},t.prototype.regenerateId=function(){this.id=i.utils.generateId("quer")},t.prototype.getName=function(){return this.name},t.prototype.setName=function(t){this.name=t},t.prototype.getDescription=function(){return this.description},t.prototype.setDescription=function(t){this.description=t},t.prototype.getColumns=function(){return this.columns},t.prototype.getUsedInTotalsColumns=function(){if(0===this.getAggregatedColumns().length)return[];var t=this.getColumns().filter((function(t){return t.enabled&&t.expr.tag===h.a.EntityAttribute}));return t.length&&t.pop(),t},t.prototype.getJustSortedColumns=function(){return this.justsorted},t.prototype.getSortedColumns=function(){for(var t=new Array,e=this.getColumns().concat(this.getJustSortedColumns()),n=0;n<e.length;n++){var o=e[n];o.sortIndex>=0&&t.push(o)}return t.sort((function(t,e){return t.sortIndex-e.sortIndex})),t},t.prototype.getColumnSortIndex=function(t){if(t.sorting!=l.b.None){if(t.sortIndex<0){var e=this.getColumns().concat(this.getJustSortedColumns());return i.utils.indexOfArrayItem(e,t)}return t.sortIndex}return-1},t.prototype.createColumn=function(t){return void 0===t&&(t=!1),new l.a(this,t)},t.prototype.getColumnById=function(t){return i.utils.findItemById(this.columns,t)},t.prototype.addColumn=function(t,e){var n,o=t.justsorted?this.justsorted:this.columns;if(t.column)n=t.column;else{n=this.createColumn(t.justsorted);var r=void 0;if(t.attribute)r=t.attribute;else{if(!t.attributeId)throw new Error("Not enought data: addColumn");if(!(r=this.model.getAttributeById(t.attributeId)))throw new Error("Incorrect attribute id ("+t.attributeId+"): addColumn")}if(t.aggrFuncId&&t.cusomtSql&&console.warn("Column cannot be created using aggrFuncId and customSql at the same time. cusomSql will be used."),t.cusomtSql)n.caption="Custom SQL Column",n.expr.tag=h.a.CustomSql,n.expr.baseAttrId=r.id,n.expr.sql=t.cusomtSql,n.expr.kind=c.a.Query,n.expr.dataType=i.DataType.Unknown;else if(t.aggrFuncId){var s=t.aggrFuncId;n.caption=r.caption+" "+this.model.getAggrFunctionCaption(t.aggrFuncId),n.expr.tag=h.a.AggregateFunction,n.expr.func=t.aggrFuncId,n.expr.kind=c.a.Scalar,n.expr.dataType="COUNT"==s||"CNTDST"==s?4:r.dataType,n.expr.distinct=!1;var u=new a.a(n);u.setValue(r.id,!0),u.tag=h.a.EntityAttribute,u.dataType=r.dataType,n.expr.args.push(u)}else n.caption=r.caption,n.expr.setValue(r.id,!0),n.expr.tag=h.a.EntityAttribute,n.expr.dataType=r.dataType;n.caption=t.caption||n.caption,n.sorting=t.sorting||l.b.None,n.sortIndex=t.sortIndex||-1,n.enabled=i.utils.getIfDefined(t.enabled,!0),n.setReadOnly(i.utils.getIfDefined(t.readonly,!1))}return t.index&&t.index>=0&&t.index<o.length?o.splice(t.index,0,n):o.push(n),n},t.prototype.addColumnObj=function(t,e,n){var o=this.columns;void 0===t.length?"number"==typeof e?o.splice(e,0,t):o.push(t):"number"==typeof e?o.push.apply(o,[e,0].concat(t)):o.push.apply(o,[].concat(t))},t.prototype.changeColumnType=function(t,e,n){if(!t.isJustSorted())if(n=n||{},t.caption=void 0!==n.caption?n.caption:"",e===h.a.AggregateFunction){if(!n.funcId)throw Error('"funcId" argument is not defined');if(t.expr.tag==h.a.AggregateFunction)return void(t.expr.func=n.funcId);(u=new a.a(t)).tag=h.a.AggregateFunction,u.func=n.funcId,u.distinct=!1,u.dataType="COUNT"==n.funcId||"CNTDST"==n.funcId?4:t.expr.dataType;var o=new a.a(t);o.loadFromData(this.model,t.expr.saveToData()),u.args.push(o),t.expr=u}else if(e===h.a.CustomSql){var r=t.expr.tag==h.a.AggregateFunction?t.expr.args[0].value:t.expr.value,s="";this.model&&(s=this.model.getAttributeById(r).expr);var l=new a.a(t);l.tag=h.a.CustomSql,l.dataType=i.DataType.String,l.sql=s,l.baseAttrId=r,t.expr=l}else if(e===h.a.EntityAttribute){if(t.expr.tag===h.a.EntityAttribute||t.expr.tag===h.a.ParentEntityAttribute)return;var u,c=t.expr.tag===h.a.CustomSql?t.expr.baseAttrId:t.expr.args[0].value,d=this.model.getAttributeById(c);(u=new a.a(t)).tag=h.a.EntityAttribute,u.dataType=null!=d?d.dataType:i.DataType.Unknown,u.setValue(c,!0),t.expr=u}},t.prototype.moveColumn=function(t,e){var n=this.getColumns();i.utils.moveArrayItem(n,t,e)},t.prototype.removeColumn=function(t,e){var n=t.isJustSorted()?this.getJustSortedColumns():this.getColumns();i.utils.removeArrayItem(n,t)},t.prototype.addConditionGroup=function(t,e){return void 0===e&&(e=!0),console.error("Community version doesn't support working with groups."),null},t.prototype.addExtraConditionGroup=function(t,e){return void 0===e&&(e=!0),console.error("Community version doesn't support working with groups."),null},t.prototype.createCondition=function(t){return void 0===t&&(t=p.a.Simple),new u.a(this,t)},t.prototype.addSimpleCondition=function(t){var e=t.parent||this.getRootCondition(),n=this.getModel();if(!n)return null;if(!t.attribute&&!t.attributeId)throw new Error("Either `attribute` or `attributeId` parameter must have a value");if(!t.attribute&&(t.attribute=n.getAttributeById(t.attributeId),!t.attribute))throw new Error("Could not find this attribute: "+t.attributeId);!t.operator&&t.operatorId&&(t.operator=n.getOperatorById(t.operatorId)),t.operator||(t.operator=n.getDefaultOperatorForAttr(t.attribute));var o=this.createSimpleConditionObject(t.attribute,t.operator,t.value);return e.addCondition(o),o.enabled=i.utils.getIfDefined(t.enabled,!0),o.setReadOnly(i.utils.getIfDefined(t.readonly,!1)),o},t.prototype.addSimpleExtraCondition=function(t){return t.parent=t.parent||this.extraConditions,this.addSimpleCondition(t)},t.prototype.createSimpleConditionObject=function(t,e,n){if(!t||!t.useInConditions)throw"Can't add a condition with such attribute: "+(t?t.caption:"NULL");var o=this.createCondition(p.a.Simple);o.setOperatorId(e.id,!0);var r=new a.a(o);r.setValue(t.id,!0),r.tag=this.attributeExprTag,r.kind=c.a.Attribute,r.dataType=t.dataType,o.expressions.push(r);var s=this.getModel(),l=e.paramCount,u=i.utils.fillArray(new Array(l-1),null);null!=n&&(Array.isArray(n)?i.utils.copyArrayTo(n,u):l>0&&(u[0]=n));for(var d=u.length,h=0;h<d;h++){var f=s.getOperand(t,e,h+1);o.addExpressionByOperand(f,u[h])}return o},t.prototype.removeColumns=function(t,e){var n=t.filter((function(t){return t.isJustSorted()})),o=t.filter((function(t){return!t.isJustSorted()}));function i(t,e){for(var n=e.length,o=0;o<n;o++){var i=t.indexOf(e[o]);i>=0&&t.splice(i,1)}}o.length>0&&i(this.getColumns(),o),n.length>0&&i(this.getJustSortedColumns(),n)},t.prototype.fireProcessEvent=function(t){this.eventEmitter.fire("query.process",t)},t.prototype.fireChangedEvent=function(t,e,n){t=t||{part:f.b.All},void 0===e&&void 0===n||(t.postpone=e||0,t.wasModified=n,console.warn("Method with 'postpone' and 'wasModified' args is deprecated. Pass params in data object")),this._isModified=void 0===t.wasModified||t.wasModified;var o=t||{part:f.b.All};this.eventEmitter.fire("query.change",o,t.postpone||0)},t.prototype.fireColumnsChangedEvent=function(t,e,n){void 0===n&&(n=!1),this.fireChangedEvent({part:n?f.b.SortingColumns:f.b.Columns,action:t,changee:e})},t.prototype.fireConditionsChangedEvent=function(t,e){this.fireChangedEvent({part:f.b.Conditions,action:t,changee:e})},t.prototype.runThroughConditions=function(t){var e=function(n){for(var o=0;o<n.getConditions().length;o++){var i=n.getConditions()[o];i.isGroup()?e(i):t&&t(i)}};e(this.getRootCondition())},t.prototype.getOneValueForAttr=function(t){var e=null;return this.runThroughConditions((function(n){if(n.enabled){var o=n.expressions[0],i=n.getOperatorId();o.value!=t||!n.expressions[1]||"Equal"!=i&&"InList"!=i&&"StartsWith"!=i||(e=n.expressions[1].value)}})),e},t.prototype.getRootCondition=function(){return this.root},t.prototype.addProcessCallback=function(t){return this.eventEmitter.subscribe("query.process",t)},t.prototype.removeProcessCallback=function(t){this.eventEmitter.unsubscribe("query.process",t)},t.prototype.addChangedCallback=function(t){return this.eventEmitter.subscribe("query.change",t)},t.prototype.removeChangedCallback=function(t){this.eventEmitter.unsubscribe("query.change",t)},t.prototype.getConditionsText=function(){var t=this,e=this.getModel();if(!e)return"";var n=function(o){var s,a,l="",u="Conj"+r.a.linkTypeToStr(o.linkType),p=i.i18n.getText(u);for(a=0;a<o.getConditions().length;a++){s="";var f=o.getConditions()[a];if(f.enabled||void 0===f.enabled)if(f.isGroup())(s=n(f))&&(s="("+s+")");else for(var g=f.getOperatorId(),y=e.getOperatorById(g),m=r.a.parseOperatorFormat(y),v=m.length,b=0;b<v;b++){var C=m[b],x=C.text;if("expression"==C.type){var w=f.expressions[C.index];if(w.kind==c.a.Attribute||w.tag==h.a.EntityAttribute){var T=e.getAttributeById(w.value);x=e.getAttributeText(T,"{entity} {attr}")}else if(x=w.getText(),t.model.isDateMacro(x)||t.model.isTimeMacro(x)){var E=x.substring(3,x.length-2);x=i.i18n.getText(E)||x}}b>0&&(s+=" "),s+=x}s&&(a>0&&l&&(l+=" "+p+" "),l+=s)}return o.linkType!=d.a.None&&o.linkType!=d.a.NotAll||(l="not ( "+l+" )"),l};return n(this.getRootCondition())},t.prototype.getConditionsTextAsHtml=function(){var t=this,e=this.getModel();if(!e)return'<div class="eqjs-query-text"></div>';var n=function(e){if(e.kind==c.a.Query)return"&lt;"+e.getText()+"&gt;";if(e.kind==c.a.List)return"["+e.getText()+"]";if(e.dataType==i.DataType.String||e.dataType==i.DataType.Memo||e.dataType==i.DataType.FixedChar)return"&quot;"+e.getText()+"&quot;";var n=e.getText();if(t.model.isDateMacro(n)||t.model.isTimeMacro(n)){var o=n.substring(3,n.length-2);n=i.i18n.getText(o)||n}return n},o=function(t){var s,a,l="",u="Conj"+r.a.linkTypeToStr(t.linkType),p='<span class="eqjs-query-text-conj">'+i.i18n.getText(u)+"</span>";for(a=0;a<t.getConditions().length;a++){s="";var f=t.getConditions()[a];if(f.enabled||void 0===f.enabled)if(f.isGroup())(s=o(f))&&(s="("+s+")");else for(var g=f.getOperatorId(),y=e.getOperatorById(g),m=r.a.parseOperatorFormat(y),v=m.length,b=0;b<v;b++){var C=m[b],x=C.text;if("expression"==C.type){var w=f.expressions[C.index];if(w.kind==c.a.Attribute||w.tag==h.a.EntityAttribute){var T=e.getAttributeById(w.value);x='<span class="eqjs-query-text-attr">'+e.getAttributeText(T,"{entity} {attr}")+"</span>"}else x='<span class="eqjs-query-text-expr">'+n(w)+"</span>"}else"operator"==C.type&&(x='<span class="eqjs-query-text-op">'+x+"</span>");b>0&&(s+=" "),s+=x}s&&(a>0&&l&&(l+=" "+p+" "),l+=s)}return t.linkType!=d.a.None&&t.linkType!=d.a.NotAll||(l='<span class="eqjs-query-text-conj">not</span> ( '+l+" )"),l};return'<div class="eqjs-query-text">'+o(this.getRootCondition())+"</div>"},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var o,i=n(0),r=n(2),s=n(1),a=n(73),l=n(3),u=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return u(e,t),e.prototype.getClassesToAdd=function(){return t.prototype.getClassesToAdd.call(this)+" "+this.cssPrefix+"-row "+this.cssPrefix+"-row-column-entattr"},e.prototype.renderExpressionBlock=function(){var t=this;return Object(s.domel)("div").addClass(this.cssPrefix+"-expr-block").addClass(l.a.getMobileCssClass()).addChild("div",(function(e){return e.addClass(t.cssPrefix+"-colelement",t.cssPrefix+"-attrelement").addClass(l.a.getMobileCssClass()).addChildElement(t.renderBaseExpression())})).toDOM()},e.prototype.renderBaseExpression=function(){var t=this,e=this.getAttributeCaption(this.baseAttr);return this.isEditable()?Object(s.domel)("a").attr("href","javascript:void(0)").title(e).text(e).on("click",(function(e){return e.stopPropagation(),t.panel.showEntitiesMenu({anchor:e.target,selectedIds:null,itemSelectedCallback:t.baseExpressionItemSelectedCallback.bind(t),itemFilterCallback:function(t){return"__AddAll__"!==t.id}}),!1})).toDOM():Object(s.domel)("span").text(e).title(e).toDOM()},e.prototype.baseExpressionItemSelectedCallback=function(t,e){var n=t.id;return this.column.expr.setValue(n,!0),this.column.caption="",this.fireColumnChanged(),!1},e.prototype.getUIS=function(){var t=this.column.expr.args[0];return!t||this.panel.getContext().getModel().checkAttrProperty(t.value,"useInSorting")},e.prototype.changeTypeHandler=function(t){var e=this;this.keepShowingButtons=!0,this.functionMenu.showMenu({anchor:t.target,selectedIds:null,itemSelectedCallback:function(t,n){return e.processExtraButtonMenuItems(t.id,null),!1},menuClosedCallback:function(){e.keepShowingButtons=!1,e.isMouseOverBlock||e.element.dispatchEvent(Object(s.createBrowserEvent)("mouseleave"))}})},e.prototype.changeTypeToCustomSql=function(){var t=this;this.column.getQuery().changeColumnType(this.column,r.ExprTag.CustomSql);var e=this.element.parentElement;setTimeout((function(){var n=e.querySelector("div[data-id='"+t.column.id+"'] div[class*='"+t.cssPrefix+"-expr-block'] div[class*='"+t.cssPrefix+"-colelement'] a");n&&n.click()}),500),this.fireColumnChanged()},e.prototype.changeTypeToAggr=function(t){this.column.getQuery().changeColumnType(this.column,r.ExprTag.AggregateFunction,{funcId:t}),this.fireColumnChanged()},e.prototype.processExtraButtonMenuItems=function(t,e){return"CUSTOMSQL"===t?this.changeTypeToCustomSql():this.changeTypeToAggr(t),!0},e.prototype.getExtraButtonMenuItems=function(){for(var t,e=[],n=this.panel.getContext().getModel().getAggrFunctions(),o=!0,r=!0,s=null,a=this.getAttribute(),l=0,u=n;l<u.length;l++){var c=u[l];o=c.getAppliedTypesOrDefault().indexOf(a.dataType)>=0,this.column.expr.func!==c.id||o||(r=!1),o&&(t=this.panel.getContext().getModel().getAggrFunctionCaption(c.id),s={id:c.id,text:t},e.push(s))}for(var d=0;d<n.length;d++)n[d];return r||(this.column.expr.func=e[0].id),this.panel.areCustomExpressionsAllowed()&&(s={id:"CustomSqlDivider",text:"---"},e.push(s),s={id:"CUSTOMSQL",text:t=i.i18n.getText("CustomExpression")},e.push(s)),[{id:"__group",text:i.i18n.getText("ColTypeGroup"),items:e}]},e}(a.b)},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return l}));var o=n(0),i=n(1),r=n(3),s=function(e,n,o,i){return new(o||(o=t))((function(t,r){function s(t){try{l(i.next(t))}catch(t){r(t)}}function a(t){try{l(i.throw(t))}catch(t){r(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof o?n:new o((function(t){t(n)}))).then(s,a)}l((i=i.apply(e,n||[])).next())}))},a=function(t,e){var n,o,i,r,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,o&&(i=2&r[0]?o.return:r[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,r[1])).done)return i;switch(o=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,o=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){s.label=r[1];break}if(6===r[0]&&s.label<i[1]){s.label=i[1],i=r;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(r);break}i[2]&&s.ops.pop(),s.trys.pop();continue}r=e.call(t,s)}catch(t){r=[6,t],o=0}finally{n=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}},l=function(){function e(t,e){var n=this;this.container=t,this.title=o.i18n.getText("Facets","DefaultFacetTitle"),this.cssPrefix="eqjs-facet",this.dialogTitle=o.i18n.getText("Facets","DefaultDlgTitle"),this.options={},this.canDisplayFlag=!0,this.downloadAllClickHandler=function(){var t=n.getContext().resultTable;if(t.elasticChunks){var e=n.getDialogService().openProgress({title:o.i18n.getText("Facets","LoadDataDlgTitle"),onSubmit:function(){return n.refresh()},determinated:!1});n.loadElasticChunk().then((function(t){e.submit()})).catch((function(t){e.submit(),n.getContext().throwError(t)}))}else{var i=t.getCachedRows().length,r=t.getTotal()-t.getCachedCount(),s=n.getDialogService().openProgress({title:o.i18n.getText("Facets","LoadDataDlgTitle"),content:o.i18n.getText("Facets","LoadDataDlgContent").replace("{loadedRecs}","0").replace("{totalRecs}",""+r),onSubmit:function(){return n.refresh()},determinated:!0}),a=0;setTimeout((function(){t.getRows({offset:i,limit:r}).then((function(t){var e=(a+=t.length)/r;s.updateContent(o.i18n.getText("Facets","LoadDataDlgContent").replace("{loadedRecs}",""+a).replace("{totalRecs}",""+r)),s.updateProgress(e)})).catch((function(t){s.submit(),n.getContext().throwError(t)}))}),10)}},o.utils.assignDeep(this.options,e)}return e.prototype.init=function(t){this.slot=t,this.contentDiv=Object(i.domel)("div",this.slot).addClass(this.cssPrefix+"-content").toDOM(),this.displayMessageDiv=Object(i.domel)("div",this.slot).hide().toDOM()},e.prototype.showSettingsDialog=function(){var e=this;return new t((function(t){var n=e.getDialogService(),o=e.renderDialogContent(),i=n.open({title:e.dialogTitle,body:o,cancelable:!0,closable:!1,onSubmit:function(){var n=e.submitSettingsDialog();return n&&t(!0),n},onCancel:function(){t(!1)}});e.afterDialogOpened(i)}))},e.prototype.afterDialogOpened=function(t){},e.prototype.renderDialogContent=function(){var t,e=Object(i.domel)("div").addClass("kfrm-form").addChild("div",(function(e){return t=e.addClass(r.a.isIE()?"kfrm-fields-ie col-ie-1-4 label-align-right":"kfrm-fields col-a-1 label-align-right").toDOM()}));return this.renderFormFields(e.toDOM(),t),e.toDOM()},e.prototype.renderFormFields=function(t,e){var n=this,s=e;r.a.isIE()&&(s=Object(i.domel)("div",e).addClass("kfrm-field-ie").toDOM()),Object(i.domel)(s).addChild("label",(function(t){return t.attr("for","tab_name").addText(o.i18n.getText("Facets","TabNameLabel"))})).addChild("input",(function(t){return t.id("facetTabName").name("tab_name").type("text").attr("value",n.title)}))},e.prototype.submitSettingsDialog=function(){var t=document.querySelector("#facetTabName");return 0!=t.value.length&&(this.title=t.value,!0)},e.prototype.getDialogService=function(){return this.getContext().getServices().getDialogService()},e.prototype.canDisplay=function(){var t=this.getContext().resultTable;return t.getCachedCount()==t.getTotal()},e.prototype.showErrorMessage=function(t){this.displayMessageDiv.innerHTML=t,this.displayMessageDiv.classList.add(this.cssPrefix+"-error-message"),Object(i.domel)(this.displayMessageDiv).show()},e.prototype.showUnableDisplayMessage=function(t){var e=this.getContext().resultTable;this.displayMessageDiv.innerHTML=t||o.i18n.getText("Facets","ErrNotEnoughData").replace("{totalRecs}",""+e.getTotal()).replace("{cachedRecs}",""+e.getCachedCount()).replace(/\[(.*)\]/g,"<a href='javascript:void(0)' class=\""+this.cssPrefix+'-download-all-link">$1</a>');var n=this.displayMessageDiv.querySelector("a."+this.cssPrefix+"-download-all-link");n&&n.addEventListener("click",this.downloadAllClickHandler),Object(i.domel)(this.contentDiv).hide(),Object(i.domel)(this.displayMessageDiv).show()},e.prototype.hideUnableDisplayMessage=function(){Object(i.domel)(this.displayMessageDiv).hide(),Object(i.domel)(this.contentDiv).show()},e.prototype.getContext=function(){return this.container.getContext()},e.prototype.getQuery=function(){return this.getContext().getQuery()},e.prototype.saveToData=function(){return{title:this.title,type:this.getType()}},e.prototype.loadFromData=function(t){t&&(this.title=t.title)},e.prototype.refresh=function(){this.hideUnableDisplayMessage(),this.canDisplay()?this.refreshCore():this.showUnableDisplayMessage()},e.prototype.loadElasticChunk=function(){return s(this,void 0,void 0,(function(){var e,n,o=this;return a(this,(function(i){return e=this.getContext().resultTable,n=e.getCachedRows().length,[2,e.getRows({offset:n,limit:e.chunkSize}).then((function(n){return e.totalIsKnown()?t.resolve():o.loadElasticChunk()}))]}))}))},e.prototype.onResize=function(){},e}()}).call(this,n(56))},function(t,e,n){"use strict";n.d(e,"a",(function(){return S}));var o,i=n(0),r=n(2),s=n(1),a=n(44),l=n(46),u=n(67),c=n(72),d=n(40),h=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),p=function(t){function e(e){var n=t.call(this,e)||this;return n.changeLocale=function(){var t=n.selectEl.value;i.i18n.setCurrentLocale(t),n.context.refreshWidgets(r.WidgetGroup.All)},n.group=r.WidgetGroup.None,n}return h(e,t),e.prototype.init=function(e,n){t.prototype.init.call(this,e,n),this.clear(),this.render()},e.prototype.getWidgetType=function(){return"changeLocale"},e.prototype.render=function(){var t=i.i18n.getLocales();if(t.length>1){this.selectEl=document.createElement("select");for(var e=0,n=t;e<n.length;e++){var o=n[e],r=document.createElement("option");r.value=o.locale,r.innerHTML=this.displayLocaleName(o),this.selectEl.appendChild(r)}this.selectEl.value=i.i18n.getCurrentLocale(),this.selectEl.classList.add("eqv-select"),this.selectEl.addEventListener("change",this.changeLocale),this.slot.appendChild(this.selectEl)}},e.prototype.displayLocaleName=function(t){return t.englishName&&t.displayName?t.englishName+" - "+t.displayName:t.englishName?t.englishName:t.displayName?t.displayName:t.locale},e.prototype.clear=function(){this.slot.innerHTML=""},e.prototype.destroyCore=function(){this.clear()},e}(r.Widget),f=n(25),g=n(88),y=n(85),m=n(98),v=n(3),b=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),C=function(t){function e(e){var n=t.call(this,e)||this;return n.queryEventCallbackId=null,n.group=r.WidgetGroup.Query|r.WidgetGroup.QueryStatus,n}return b(e,t),e.prototype.init=function(e,n){t.prototype.init.call(this,e,n),this.destroyCore(),this.attachQueryObserver()},Object.defineProperty(e.prototype,"cssPrefix",{get:function(){return"eqjs-query-name"},enumerable:!0,configurable:!0}),e.prototype.getWidgetType=function(){return"queryName"},e.prototype.refreshCore=function(){this.render()},e.prototype.render=function(){this.slot.classList.add(""+this.cssPrefix);var t=v.a.getMobileCssClass();t&&this.slot.classList.add(t),this.nameSlot||(this.nameSlot=document.createElement("div"),this.nameSlot.classList.add(this.cssPrefix+"-text"),this.nameSlot.classList.add(this.cssPrefix+"-theme"),this.slot.appendChild(this.nameSlot)),this.asteriskSlot||(this.asteriskSlot=document.createElement("span"),this.asteriskSlot.innerHTML="*",this.asteriskSlot.classList.add(this.cssPrefix+"-asterisk"),this.slot.appendChild(this.asteriskSlot)),this.tooltipSlot||(this.tooltipSlot=document.createElement("span"),this.tooltipSlot.classList.add(this.cssPrefix+"-tooltip"),this.tooltipSlot.classList.add(this.cssPrefix+"-theme"),this.slot.appendChild(this.tooltipSlot));var e=this.context.getQuery().getName();this.nameSlot.textContent=e,this.tooltipSlot.textContent=e,this.asteriskSlot.style.visibility=this.context.getQuery().isModified()?"visible":"hidden"},e.prototype.clear=function(){this.slot.innerHTML="",this.nameSlot=null,this.tooltipSlot=null,this.asteriskSlot=null},e.prototype.attachQueryObserver=function(){var t=this,e=this.context.getQuery();this.queryEventCallbackId=e.addChangedCallback((function(e){t.refreshCore()}))},e.prototype.detachQueryObserver=function(){this.queryEventCallbackId&&this.context.getQuery().removeChangedCallback(this.queryEventCallbackId)},e.prototype.destroyCore=function(){this.clear(),this.detachQueryObserver()},e}(r.Widget),x=n(87),w=n(99),T=n(4),E=n(92),D=n(93),S=function(){function t(){this.domRoots=[document],this.defaultViewOptions={enableExport:!0,disableConfirmationOnQueryChange:!1,queryFileExtensions:"text/xml,application/json",result:{clearResultOnQueryChange:!0,showChart:!0,showProcessIndicator:!0},widgets:{resultGrid:{addColumns:!1}},handlers:{}},this.viewOptions={},this.resultOptions={},this.enableExport=!1,this.resetContext(),this.renderSpinner()}return t.prototype.resetContext=function(){this.context=new r.EqContext,this.context.getServices().registerDialogServiceResolver((function(){return new s.DefaultDialogService}))},t.prototype.init=function(t){try{this.context.initStart(),t&&t.shadowRoots&&(this.domRoots=this.domRoots.concat(t.shadowRoots)),this.viewOptions=this.initOptions(t),this.resultOptions=i.utils.assignDeep(this.defaultViewOptions.result,this.viewOptions.result),this.initWidgets(this.viewOptions),this.context.init(this.viewOptions),this.initDone()}catch(t){this.context.throwError({action:"Init",sourceError:t})}},t.prototype.initOptions=function(t){return(t=i.utils.assignDeep(this.defaultViewOptions,t)).widgets.easyGrid||(t.widgets.easyGrid=t.widgets.resultGrid||{}),t.columnTitleFormat&&(t.widgets.entitiesPanel=t.widgets.entitiesPanel||{},t.widgets.entitiesPanel.columnTitleFormat=t.widgets.entitiesPanel.columnTitleFormat||t.columnTitleFormat,t.widgets.columnsBar=t.widgets.columnsBar||{},t.widgets.columnsBar.titleElementFormat=t.widgets.columnsBar.titleElementFormat||t.columnTitleFormat,t.widgets.columnsPanel=t.widgets.columnsPanel||{},t.widgets.columnsPanel.titleElementFormat=t.widgets.columnsPanel.titleElementFormat||t.columnTitleFormat),t.widgets.easyGrid.paging=i.utils.assignDeep({},t.result.paging,t.widgets.easyGrid.paging),this.enableExport=t.enableExport||!1,t.widgets.exportWidget||(t.widgets.exportWidget={}),t.widgets.exportWidget.enableExport=this.enableExport,t},t.prototype.initWidgets=function(t){var e="QueryPanel",n="ColumnsPanel",o="EntitiesPanel",i="ResultPanel",r="ColumnsBar",a="FilterBar",l="ProcessBar",u="StatementPanel",c="ChangeLocale",d="QueryNameLabel",h="ResultFacetsPanel",p="ResultCount",f="ExportButton",g="AggregationBar";t.slots&&(d=t.slots.queryNameLabel||d,e=t.slots.queryPanel||e,n=t.slots.columnsPanel||n,r=t.slots.columnsBar||r,o=t.slots.entitiesPanel||o,i=t.slots.resultPanel||i,u=t.slots.statementPanel||u,l=t.slots.processBar||l,c=t.slots.changeLocale||c,h=t.slots.facetsPanel||h,p=t.slots.resultCountSpan||p,a=t.slots.filterBar||a,f=t.slots.exportButtons||f,g=t.slots.aggregationBar||g);var y=this.resolveElement(o);y&&!this.entitiesPanelWidget&&(this.entitiesPanelWidget=this.createEntitiesPanelWidget(y),this.context.addWidget(this.entitiesPanelWidget));var m=this.resolveElement(n);m&&!this.columnsPanelWidget&&(this.columnsPanelWidget=this.createColumnsPanelWidget(m),this.context.addWidget(this.columnsPanelWidget));var v=this.resolveElement(r);v&&!this.columnsBarWidget&&(this.columnsBarWidget=this.createColumnsBarWidget(v),this.context.addWidget(this.columnsBarWidget));var b=this.resolveElement(e);if(b&&!this.queryPanelWidget&&(this.queryPanelWidget=this.createQueryPanelWidget(b),this.context.addWidget(this.queryPanelWidget)),this.resultPanelSlot=this.resolveElement(i),this.resultPanelSlot){if(!this.resultGridWidget){var C=Object(s.addElement)(this.resultPanelSlot,"div",{cssClass:"eqv-result-grid"});this.resultGridWidget=this.createResultGridWidget(C),this.context.addWidget(this.resultGridWidget)}if(this.resultOptions.showChart&&!this.chartWidget){var x=Object(s.addElement)(this.resultPanelSlot,"div",{cssClass:"eqv-chart-panel"});x.style.display="none",this.chartWidget=this.createChartWidget(x),this.context.addWidget(this.chartWidget)}}var w=this.resolveElement(d);w&&!this.queryNameWidget&&(this.queryNameWidget=this.createQueryNameWidget(w),this.context.addWidget(this.queryNameWidget));var T=this.resolveElement(a);T&&!this.filterBarWidget&&(this.filterBarWidget=this.createFilterBarWidget(T),this.context.addWidget(this.filterBarWidget));var E=this.resolveElement("SortingBar");E&&!this.sortingBarWidget&&(this.sortingBarWidget=this.createSortingBarWidget(E),this.context.addWidget(this.sortingBarWidget));var D=this.resolveElement(l);D&&!this.processWidget&&(this.processWidget=this.createProcessWidget(D),this.context.addWidget(this.processWidget));var S=this.resolveElement(u);S&&!this.statementPanelWidget&&(this.statementPanelWidget=this.createStatementPanelWidget(S),this.context.addWidget(this.statementPanelWidget));var k=this.resolveElement(c);if(k){var M=this.createLocaleWidget(k);this.context.addWidget(M)}var I=this.resolveElement(h);I&&!this.resultFacetPanelWidget&&(this.resultFacetPanelWidget=this.createResultFacetsPanel(I),this.context.addWidget(this.resultFacetPanelWidget));var O=this.resolveElement(f);O&&!this.exportWidget&&(this.exportWidget=this.createExportWidget(O),this.context.addWidget(this.exportWidget)),this.resultCountSlot=this.resolveElement(p);var A=this.resolveElement(g);A&&!this.aggregationBarWidget&&(this.aggregationBarWidget=this.createAggregationBarWidget(A),this.context.addWidget(this.aggregationBarWidget))},t.prototype.initDone=function(){},t.prototype.resolveElement=function(t){if("string"==typeof t){for(var e=0,n=this.domRoots;e<n.length;e++){var o=n[e].getElementById(t);if(o)return o}return null}return t},t.prototype.resolveElementsByClassName=function(t){for(var e=[],n=0,o=this.domRoots;n<o.length;n++)for(var i=o[n].querySelectorAll("."+t),r=0;r<i.length;r++)e.push(i[r]);return e},t.prototype.displayRecordsCount=function(t){this.resultCountSlot&&void 0!==t&&(this.resultCountSlot.style.display="inline",this.resultCountSlot.innerHTML=i.i18n.getText("MsgResultCount").replace("{0}",t.toString()))},t.prototype.getContext=function(){return this.context},t.prototype.setDialogService=function(t){this.context.getServices().registerDialogServiceResolver((function(){return t}))},t.prototype.executeQuery=function(t){console.warn("`executeQuery` is deprecated. Use `fetchData` instead"),this.fetchData(t)},t.prototype.fetchData=function(t){var e=this;t=t||{refresh:!0},this.context.clearResult(),this.context.getQuery().isEmpty()&&!this.resultOptions.fetchEmptyQueries||(this.showResultSpinner(),this.context.fetchData({elasticPaging:t.elasticPaging,success:function(n){e.hideResultSpinner(),e.toggleExportButtons(),e.displayRecordsCount(e.context.resultTable.getTotal()),!0===t.refresh&&e.context.refreshWidgets(r.WidgetGroup.Result),t.callback&&t.callback(),t.success&&t.success()},error:function(){e.hideResultSpinner()}}))},t.prototype.toggleExportButtons=function(){this.enableExport&&this.context.resultTable&&this.context.resultTable.getCachedCount()>0?this.enableExportButtons():this.disableExportButtons()},t.prototype.enableExportButtons=function(){},t.prototype.disableExportButtons=function(){},t.prototype.renderSpinner=function(){this._spinnerDiv=Object(s.domel)("div").addClass("eqjs-result-spinner").addChild("div",(function(t){return t.addClass(T.b+"-progress-win8",v.a.getMobileCssClass()).addHtml('<div class="wBall" id="wBall_1"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_2"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_3"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_4"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_5"><div class="wInnerBall"></div></div>')})).toDOM()},t.prototype.showResultSpinner=function(){if(this.resultOptions.showProcessIndicator&&this.resultPanelSlot&&!this._spinnerDiv.parentNode){for(var t=0;t<this.resultPanelSlot.children.length;t++){var e=this.resultPanelSlot.children[t];Object(s.domel)(e).hide()}this.resultPanelSlot.appendChild(this._spinnerDiv)}},t.prototype.hideResultSpinner=function(){if(this.resultOptions.showProcessIndicator&&this.resultPanelSlot&&this._spinnerDiv.parentNode){this._spinnerDiv.parentNode.removeChild(this._spinnerDiv);for(var t=0;t<this.resultPanelSlot.children.length;t++){var e=this.resultPanelSlot.children[t];Object(s.domel)(e).show()}}},t.prototype.createChartWidget=function(t){return this.resultOptions.chartWidgetResolver?this.resultOptions.chartWidgetResolver(t):new l.a(t)},t.prototype.createResultGridWidget=function(t){return this.resultOptions.resultGridResolver?this.resultOptions.resultGridResolver(t):new a.a(t)},t.prototype.createEntitiesPanelWidget=function(t){return new u.a(t)},t.prototype.createColumnsPanelWidget=function(t){return new c.a(t)},t.prototype.createQueryPanelWidget=function(t){return new f.a(t)},t.prototype.createLocaleWidget=function(t){return new p(t)},t.prototype.createProcessWidget=function(t){return new g.a(t)},t.prototype.createColumnsBarWidget=function(t){return new d.a(t)},t.prototype.createFilterBarWidget=function(t){return new y.a(t)},t.prototype.createSortingBarWidget=function(t){return new m.a(t)},t.prototype.createQueryNameWidget=function(t){return new C(t)},t.prototype.createStatementPanelWidget=function(t){return new x.a(t)},t.prototype.createResultFacetsPanel=function(t){return new w.a(t)},t.prototype.createExportWidget=function(t){return new E.a(t)},t.prototype.createAggregationBarWidget=function(t){return new D.a(t)},t.prototype.detach=function(){this.entitiesPanelWidget&&(this.entitiesPanelWidget.destroy(),this.entitiesPanelWidget=null),this.columnsPanelWidget&&(this.columnsPanelWidget.destroy(),this.columnsPanelWidget=null),this.queryPanelWidget&&(this.queryPanelWidget.destroy(),this.queryPanelWidget=null),this.columnsBarWidget&&(this.columnsBarWidget.destroy(),this.columnsBarWidget=null),this.resultGridWidget&&(this.resultGridWidget.destroy(),this.resultGridWidget=null),this.chartWidget&&(this.chartWidget.destroy(),this.chartWidget=null),this.queryNameWidget&&(this.queryNameWidget.destroy(),this.queryNameWidget=null),this.processWidget&&(this.processWidget.destroy(),this.processWidget=null),this.localeWidget&&(this.localeWidget.destroy(),this.localeWidget=null),this.statementPanelWidget&&(this.statementPanelWidget.destroy(),this.statementPanelWidget=null),this.filterBarWidget&&(this.filterBarWidget.destroy(),this.filterBarWidget=null),this.sortingBarWidget&&(this.sortingBarWidget.destroy(),this.sortingBarWidget=null),this.statementWidget&&(this.statementWidget.destroy(),this.statementWidget=null),this.exportWidget&&(this.exportWidget.destroy(),this.exportWidget=null),this.resultFacetPanelWidget&&(this.resultFacetPanelWidget.destroy(),this.resultFacetPanelWidget=null),this.resultCountSlot&&(this.resultCountSlot.innerHTML="",this.resultCountSlot=null),this.resultPanelSlot&&(this.resultPanelSlot.innerHTML="",this.resultPanelSlot=null),this.domRoots=[document],this.resetContext()},t}()},function(t,e,n){"use strict";n.d(e,"b",(function(){return s})),n.d(e,"a",(function(){return a}));var o=n(0),i=n(21),r=n(12),s=function(){function t(){this.id="",this.expr="",this.constValueFormat="{const}",this.caption="{Unrecognized operator}",this.displayFormat="{expr1} [[{unrecognized operator}]] {expr2}",this.isRange=!1,this.caseIns=!1,this.paramCount=2,this.defaultOperand=new a,this.appliedTypes=[],this.operands=new Array}return t.prototype.loadFromData=function(t,e){if(e&&(this.id=e.id,this.caption=e.cptn,this.caseIns=e.caseIns,this.isRange=e.isRange,this.displayFormat=e.fmt,this.paramCount=e.pcnt,this.expr=e.expr,this.appliedTypes=e.dtypes||this.appliedTypes,e.defOperand&&this.defaultOperand.loadFromData(t,e.defOperand),e.editor&&(this.defaultOperand.editor=t.getEditorById(e.editor)||new i.a),e.operands))for(var n=0;n<e.operands.length;n++){var o=new a;o.loadFromData(t,e.operands[n]),e.editor&&(o.editor=t.getEditorById(e.editor)||new i.a),this.operands.push(o)}},t}(),a=function(){function t(){this.kind=r.a.Scalar,this.dataType=o.DataType.Unknown,this.editor=new i.a,this.defValue=""}return t.prototype.loadFromData=function(t,e){this.kind=e.kind,this.dataType=e.dtype,this.defValue=e.val,this.defText=e.txt,e.editor&&(this.editor=t.getEditorById(e.editor)||new i.a)},t.prototype.copyFrom=function(t){o.utils.assign(this,t)},t}()},function(t,e,n){"use strict";var o;n.d(e,"a",(function(){return o})),function(t){t[t.Always=0]="Always",t[t.Once=1]="Once",t[t.Never=2]="Never"}(o||(o={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return h})),n.d(e,"c",(function(){return p}));var o,i,r=n(0),s=n(2),a=n(1),l=n(77),u=n(3),c=n(10),d=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});!function(t){t[t.AddCondition=0]="AddCondition",t[t.AddGroup=1]="AddGroup",t[t.Enable=2]="Enable",t[t.Delete=4]="Delete",t[t.Menu=5]="Menu",t[t.Parameterized=6]="Parameterized",t[t.InJoin=7]="InJoin"}(i||(i={}));var h=function(){function t(t,e,n){this.panel=t,this.condition=e,this.element=n||Object(a.domel)("div").toDOM()}return Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"eqjs-qp"},enumerable:!0,configurable:!0}),t.prototype.refresh=function(){this.render()},t.prototype.clear=function(){this.element&&(this.element.className="",this.element.removeAttribute("data-id"),this.element.removeAttribute("style"),Object(a.domel)(this.element).html(""))},t.prototype.render=function(t){return this.clear(),this.coreRender(t),this.panel.options.onConditionRendered&&this.panel.options.onConditionRendered(this.condition,this.element),this.element},t.prototype.isEditable=function(){return this.condition.enabled&&!this.condition.isReadOnly()},t}(),p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return d(e,t),e.prototype.getClassesToAdd=function(){var t=this.cssPrefix+"-row "+this.cssPrefix+"-row-condition";if(t+=this.condition.isInJoin()?" "+this.cssPrefix+"-condition-injoin":"",t+=this.condition.isParameterized()?" "+this.cssPrefix+"-condition-parameterized":"",!u.a.isMobileMode()){var e=this.condition.getLevel();e>0&&(t+=" "+this.cssPrefix+"-level-"+e)}return t+=this.condition.enabled?"":" "+this.cssPrefix+"-disabled",this.condition.enabled&&(t+=this.condition.isReadOnly()?" "+this.cssPrefix+"-readonly":""),t},e.prototype.coreRender=function(t){var e=this,n=this.panel.getContext().getModel(),o=n.getOperatorById(this.condition.getOperatorId()),i=s.equtils.parseOperatorFormat(o),r=null,c=i.length,d=Object(a.domel)("div");this.element&&this.element.parentNode&&this.element.parentNode.replaceChild(d.toDOM(),this.element),this.element=d.toDOM(),d.addClass(this.getClassesToAdd()).addClass(u.a.getMobileCssClass()).data("id",this.condition.id).data("condrow","").addChildElement(this.renderCheckbox()).addChildElement(this.renderConjunction());for(var h=t,p=o==n.nullOperator?Math.min(c,this.condition.expressions.length+1):c,f=function(t){if("operator"===(r=i[t]).type){var e=g.panel.getOperatorRenderer(g.condition,r.text);e&&d.addChildElement(e.render())}else if("expression"===r.type){var n=h&&r.index>0,o=g.panel.getExpressionRenderer(g.condition.expressions[r.index]);if(o){var s=o.render(n);d.addChildElement(s),setTimeout((function(){o.adjustWidth()}),100)}h=h&&!n}else"text"===r.type&&d.addChildElement(new l.a(g.panel,r.text).render())},g=this,y=0;y<p;y++)f(y);(this.panel.options.accentActiveCondition||u.a.isMobileMode())&&d.on("click",(function(t){return t.stopPropagation(),e.panel.toggleConditionPicked(e.condition),e.adjustButtonsVisibility(),u.a.isMobileMode()||e.element.dispatchEvent(Object(a.createBrowserEvent)("mouseenter")),!1})),d.addChildElement(this.renderButtonsBlock()),u.a.isMobileMode()||d.on("mouseenter",(function(t){return e.isMouseOverBlock=!0,e.enterButtonBlock(),t.stopPropagation(),!1})).on("mouseleave",(function(t){return e.isMouseOverBlock=!1,!e.keepShowingButtons&&Object(a.domel)(e.buttonsBlock).isVisible()&&e.leaveButtonBlock(),t.stopPropagation(),!1}))},e.prototype.setConditionParameterized=function(t){this.condition.setParameterized(t),this.condition.fireChangedEvent()},e.prototype.setConditionInJoin=function(t){this.condition.setInJoin(t),this.condition.fireChangedEvent()},e.prototype.getConditionMenu=function(){return this.panel.getConditionMenu()},e.prototype.renderConjunction=function(){var t=this.condition.getParent();if(!t)return null;var e=0==r.utils.findItemIndexById(t.getConditions(),this.condition.id);if(this.panel.options.showConjunctions&&!e){var n=s.equtils.linkTypeToStr(this.condition.getParent().linkType),o=r.i18n.getText("Conj"+n);return Object(a.domel)("span").text(o).title(o).addClass(this.cssPrefix+"-condelement "+this.cssPrefix+"-condition-conjuction").toDOM()}return null},e.prototype.renderCheckbox=function(){var t=this;return this.panel.options.showCheckboxes&&!this.condition.isReadOnly()?Object(a.domel)("div").title(r.i18n.getText("CmdToggleEnable")).attr("tabIndex","0").addClass(this.cssPrefix+"-condelement "+this.cssPrefix+"-condition-checkbox").addClass(this.condition.enabled?"enabled":"").on("click",(function(){return t.condition.enabled=!t.condition.enabled,t.condition.fireChangedEvent(),!1})).on("keypress",(function(t){[13,32].includes(t.keyCode)&&t.target.click()})).toDOM():null},e.prototype.isConditionActive=function(){return this.element.classList.contains("active")},e.prototype.hideButtons=function(){Object(a.domel)(this.element).data("show-buttons",null)},e.prototype.showButtons=function(){Object(a.domel)(this.element).data("show-buttons","")},e.prototype.adjustButtonsVisibility=function(){(this.panel.options.alwaysShowButtonsInConditions||this.panel.options.accentActiveCondition&&this.isConditionActive())&&this.showButtons()},e.prototype.enterButtonBlock=function(){this.showButtons()},e.prototype.leaveButtonBlock=function(){this.panel.options.alwaysShowButtonsInConditions||this.isConditionActive()&&this.panel.options.accentActiveCondition||this.hideButtons()},e.prototype.conditionMenuHandler=function(t,e){var n=this;switch(t){case i.AddCondition:if(!this.condition.isGroup())return;var o=this.panel.getEntitiesMenu();o&&o.showMenu({anchor:e.target,itemSelectedCallback:function(t){var e=n.panel.getQuery(),o={parent:n.condition,attributeId:t.id},i=e.addSimpleCondition(o);return i&&e.fireConditionsChangedEvent(s.QueryChangeAction.Add,i),!1}});break;case i.AddGroup:if(!this.condition.isGroup())return;var r=this.panel.getQuery(),a={parent:this.condition},l=this.panel.getQuery().addConditionGroup(a);l&&r.fireConditionsChangedEvent(s.QueryChangeAction.Add,l);break;case i.Enable:this.condition.enabled=!this.condition.enabled,this.condition.fireChangedEvent();break;case i.Delete:var u=this.condition.getParent();if(!u)return;var d=u.getConditions(),h=d.indexOf(this.condition);h>=0&&(d.splice(h,1),this.condition.getQuery().fireConditionsChangedEvent(s.QueryChangeAction.Delete,this.condition));break;case i.Menu:var p=this.getConditionMenu();this.keepShowingButtons=!0,p.showMenu({anchor:e.target,selectedIds:this.getConditionMenuSelectedItems(),itemSelectedCallback:function(t){var o;switch(t.id){case"enable":o=i.Enable;break;case"delete":o=i.Delete;break;case"param":o=i.Parameterized;break;case"inJoin":o=i.InJoin;break;case"addCondition":o=i.AddCondition;break;case"addGroup":o=i.AddGroup}n.conditionMenuHandler(o,e)},itemFilterCallback:function(t){var e=n.condition.enabled||"enable"===t.id||"delete"===t.id;if("enable"===t.id){var o=n.condition.getParent();e=e&&o&&o.enabled}else"delete"===t.id?e=e&&(n.panel.options.editableParts&c.a.Removal)===c.a.Removal:"addGroup"!==t.id&&"addCondition"!==t.id||(e=e&&(n.panel.options.editableParts&c.a.Addition)===c.a.Addition);return e},menuClosedCallback:function(){n.keepShowingButtons=!1,n.isMouseOverBlock||n.leaveButtonBlock()}});break;case i.Parameterized:this.condition.setParameterized(!this.condition.isParameterized()),this.condition.fireChangedEvent();break;case i.InJoin:this.condition.setInJoin(!this.condition.isInJoin()),this.condition.fireChangedEvent()}return e.stopPropagation(),!1},e.prototype.getConditionMenuSelectedItems=function(){var t=[];return this.condition.enabled&&t.push("enable"),this.condition.isParameterized()&&t.push("param"),this.condition.isInJoin()&&t.push("inJoin"),t},e.prototype.renderButtonsBlock=function(){var t=this,e=function(e){Object(a.domel)(e.target).addClass(t.cssPrefix+"-condition-button-active")},n=function(e){Object(a.domel)(e.target).removeClass(t.cssPrefix+"-condition-button-active")},o=Object(a.domel)("div").addClass(this.cssPrefix+"-condition-buttonsBlock").addClass(u.a.getMobileCssClass());if(this.buttonsBlock=o.toDOM(),this.condition.isReadOnly())return this.buttonsBlock;var s=this.getButtonsToShow();return s.indexOf("addCondition")>=0&&this.condition.enabled&&(this.panel.options.editableParts&c.a.Addition)==c.a.Addition&&o.addChild("div",(function(o){o.addClass(t.cssPrefix+"-button-placeholder").data("btnplaceholder","").addChild("div",(function(o){o.addClass(t.cssPrefix+"-condition-button "+t.cssPrefix+"-condition-button-addCondition").attr("tabIndex","0").data("button","").title(r.i18n.getText("CmdAddCondition")).on("click",(function(e){return t.conditionMenuHandler(i.AddCondition,e)})).on("keypress",(function(t){13==t.keyCode&&t.target.click()})).on("mouseenter",e).on("mouseleave",n)}))})),(s.indexOf("addGroup")>=0||s.indexOf("addPredicate")>=0)&&this.condition.enabled&&(this.panel.options.editableParts&c.a.Addition)==c.a.Addition&&o.addChild("div",(function(o){o.addClass(t.cssPrefix+"-button-placeholder").data("btnplaceholder","").addChild("div",(function(o){o.addClass(t.cssPrefix+"-condition-button "+t.cssPrefix+"-condition-button-addPredicate").attr("tabIndex","0").data("button","").title(r.i18n.getText("CmdAddCondGroup")).on("click",(function(e){return t.conditionMenuHandler(i.AddGroup,e)})).on("keypress",(function(t){13==t.keyCode&&t.target.click()})).on("mouseenter",e).on("mouseleave",n)}))})),this.getButtonsToShow().indexOf("enable")>=0&&this.condition.getParent()&&this.condition.getParent().enabled&&o.addChild("div",(function(o){o.addClass(t.cssPrefix+"-button-placeholder").data("btnplaceholder","").addChild("div",(function(o){o.addClass(t.cssPrefix+"-condition-button "+t.cssPrefix+"-condition-button-enable").attr("tabIndex","0").data("button","").title(r.i18n.getText("CmdToggleEnable")).addClass(t.condition.enabled?"enabled":"").on("click",(function(e){return t.conditionMenuHandler(i.Enable,e)})).on("keypress",(function(t){13==t.keyCode&&t.target.click()})).on("mouseenter",e).on("mouseleave",n)}))})),this.getButtonsToShow().indexOf("delete")>=0&&this.condition.getParent()&&(this.panel.options.editableParts&c.a.Removal)==c.a.Removal&&o.addChild("div",(function(o){o.addClass(t.cssPrefix+"-button-placeholder").data("btnplaceholder","").addChild("div",(function(o){o.addClass(t.cssPrefix+"-condition-button "+t.cssPrefix+"-condition-button-delete").attr("tabIndex","0").data("button","").title(r.i18n.getText("CmdDelete")).on("click",(function(e){return t.conditionMenuHandler(i.Delete,e)})).on("keypress",(function(t){13==t.keyCode&&t.target.click()})).on("mouseenter",e).on("mouseleave",n)}))})),this.getButtonsToShow().indexOf("menu")>=0&&o.addChild("div",(function(o){o.addClass(t.cssPrefix+"-button-placeholder").data("btnplaceholder","").addChild("div",(function(o){o.addClass(t.cssPrefix+"-condition-button "+t.cssPrefix+"-condition-button-menu").attr("tabIndex","0").data("button","").title(r.i18n.getText("ButtonMenu")).on("click",(function(e){return t.conditionMenuHandler(i.Menu,e)})),u.a.isMobileMode()||o.on("keypress",(function(t){13==t.keyCode&&t.target.click()})).on("mouseenter",e).on("mouseleave",n)}))})),this.adjustButtonsVisibility(),this.buttonsBlock},e.prototype.getButtonsToShow=function(){return this.panel.options.buttons&&this.panel.options.buttons.condition&&Array.isArray(this.panel.options.buttons.condition)?this.panel.options.buttons.condition:["enable","delete"]},e}(h)},function(t,e,n){"use strict";var o;n.d(e,"a",(function(){return o})),function(t){t.Trace="TRACE",t.Options="OPTIONS",t.Get="GET",t.Put="PUT",t.Post="POST",t.Delete="DELETE"}(o||(o={}))},function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return l})),n.d(e,"a",(function(){return c})),n.d(e,"d",(function(){return d}));var o,i=n(0),r=n(18),s=n(6),a="undefined"!=typeof TouchEvent;!function(t){t.None="none",t.Allow="allow",t.Forbid="forbid"}(o||(o={}));var l=function(t,e,n){this.dropEffect=o.Allow,this.pageX=0,this.pageY=0,this.item=t,this.dragImage=e,this.data=t.data,this.sourceEvent=n,n&&n instanceof MouseEvent&&(this.pageX=n.pageX,this.pageY=n.pageY),n&&a&&n instanceof TouchEvent&&n.touches[0]&&(this.pageX=n.touches[0].pageX,this.pageY=n.touches[0].pageY)},u=function(t){t&&t instanceof MouseEvent&&(this.x=t.pageX,this.y=t.pageY),t&&a&&t instanceof TouchEvent&&t.touches[0]&&(this.x=t.touches[0].pageX,this.y=t.touches[0].pageY)},c=function(){function t(){this.delta=5,this.draggableItem=null,this.dragImage=null,this.finishedSuccessfully=!1,this.mouseDownPosition=null,this.containerDescriptors=[],this.containerDescriptorIndex=-1,this.dropEffect=o.None,this.classPrefix="eqjs-drop",this.DRAG_DISABLED_ATTR="drag-disabled"}return t.prototype.registerDraggableItem=function(t){var e=this,n=t.element;if(!n)throw Error("Element in draggle item is null or undefined");n.ondragstart=function(){return!1};var i=function(t){if(!n.hasAttribute(e.DRAG_DISABLED_ATTR)){t.preventDefault(),t instanceof MouseEvent&&t.stopPropagation();var o=new u(t);(Math.abs(o.x-e.mouseDownPosition.x)>e.delta||Math.abs(o.y-e.mouseDownPosition.y)>e.delta)&&c(t)}},r=function(t){e.mouseMoveDragListener(t)},c=function(a){a.preventDefault(),a.stopPropagation(),n.removeEventListener("mousemove",i),n.removeEventListener("touchmove",i),e.finishedSuccessfully=!1,t.beforeDragStart&&t.beforeDragStart(),e.dragImage=Object(s.e)("div").setStyle("position","absolute").setStyle("z-index","65530").toDOM(),document.body.appendChild(e.dragImage),e.dragImage.appendChild(n.cloneNode(!0)),t.renderer&&t.renderer(e.dragImage),e.dropEffect=o.None,e.updateCusror(e.dropEffect),e.updateImageClass(e.dropEffect),e.draggableItem={element:n,scope:t.scope,data:t.data},e.updateDragItemPosition(a);var u=new l(e.draggableItem,e.dragImage,a);u.dropEffect=e.dropEffect,t.onDragStart&&t.onDragStart(u),e.dropEffect!==u.dropEffect&&(e.dropEffect=u.dropEffect,e.updateImageClass(e.dropEffect)),document.addEventListener("mousemove",r,!0),document.addEventListener("touchmove",r,!0)},d=function(t){a&&t instanceof TouchEvent&&t.preventDefault(),e.mouseDownPosition=new u(t),n.addEventListener("mousemove",i),n.addEventListener("touchmove",i),document.addEventListener("mouseup",h),document.addEventListener("touchend",h)};n.addEventListener("mousedown",d),n.addEventListener("touchstart",d);var h=function(t){e.mouseDownPosition=null,n.removeEventListener("mousemove",i),n.removeEventListener("touchmove",i),document.removeEventListener("mousemove",r,!0),document.removeEventListener("touchmove",r,!0),e.draggableItem&&p(t)},p=function(n){try{if(e.containerDescriptorIndex>=0){var i=e.containerDescriptors[e.containerDescriptorIndex],r={element:i.element,scopes:i.scopes,data:i.data},s=new l(e.draggableItem,e.dragImage,n);try{r.scopes.indexOf(e.draggableItem.scope)>=0&&e.dropEffect===o.Allow&&(e.finishedSuccessfully=!0,i.onDrop&&i.onDrop(r,s))}finally{i.onDragLeave&&i.onDragLeave(r,s)}}}finally{try{var a=new l(e.draggableItem,e.dragImage,n);a.data.finishedSuccessfully=e.finishedSuccessfully,t.onDragEnd&&t.onDragEnd(a)}finally{e.draggableItem=null,e.dragImage&&e.dragImage.parentElement&&e.dragImage.parentElement.removeChild(e.dragImage),e.dragImage=null,e.finishedSuccessfully=!1,document.removeEventListener("mouseup",h),document.removeEventListener("touchend",h)}}}},t.prototype.registerDropContainer=function(t){if(!t.element)throw Error("Element in drop container is null or undefined");this.containerDescriptors.push(t)},t.prototype.removeDropContainer=function(t){var e=this.containerDescriptors.filter((function(e){return e===t||e.element==t}));if(e)for(var n=0,o=e;n<o.length;n++){var r=o[n];i.utils.removeArrayItem(this.containerDescriptors,r)}},t.prototype.mouseMoveDragListener=function(t){if(t instanceof MouseEvent&&t.preventDefault(),t.stopPropagation(),this.updateDragItemPosition(t),-1==this.containerDescriptorIndex){for(var e=0;e<this.containerDescriptors.length;e++){var n=this.containerDescriptors[e];if(this.detectDragEnterEvent(n.element,t)){this.containerDescriptorIndex=e;break}}this.containerDescriptorIndex>=0&&this.dragEnterEvent(t)}else{n=this.containerDescriptors[this.containerDescriptorIndex];this.detectDragLeaveEvent(n.element,t)&&(this.dragLeaveEvent(t),this.containerDescriptorIndex=-1)}if(this.containerDescriptorIndex>=0){var o={element:(n=this.containerDescriptors[this.containerDescriptorIndex]).element,scopes:n.scopes,data:n.data};if(o.scopes.indexOf(this.draggableItem.scope)>=0){var i=new l(this.draggableItem,this.dragImage,t);i.dropEffect=this.dropEffect,n.onDragOver&&n.onDragOver(o,i)}}},t.prototype.updateCusror=function(t){switch(t){case o.Allow:this.setCursorStyle(this.dragImage,"grabbing");break;case o.Forbid:this.setCursorStyle(this.dragImage,"no-drop");break;default:this.setCursorStyle(this.dragImage,"grabbing")}},t.prototype.updateImageClass=function(t){switch(this.dragImage.classList.remove(this.classPrefix+"-allow"),this.dragImage.classList.remove(this.classPrefix+"-forbid"),this.dragImage.classList.remove(this.classPrefix+"-none"),t){case o.Allow:this.dragImage.classList.add(this.classPrefix+"-allow");break;case o.None:this.dragImage.classList.add(this.classPrefix+"-none");break;case o.Forbid:this.dragImage.classList.add(this.classPrefix+"-forbid");break;default:this.dragImage.classList.add(this.classPrefix+"-none")}},t.prototype.setCursorStyle=function(t,e){if(t){t.style.cursor=e;for(var n=0;n<t.children.length;n++)this.setCursorStyle(t.children[n],e)}},t.prototype.updateDragItemPosition=function(t){if(this.dragImage){var e=new u(t);this.dragImage.style.top=e.y-this.dragImage.offsetHeight/2+"px",this.dragImage.style.left=e.x-this.dragImage.offsetWidth/2+"px"}},t.prototype.dragEnterEvent=function(t){var e=this.containerDescriptors[this.containerDescriptorIndex],n={element:e.element,scopes:e.scopes,data:e.data};if(n.scopes.indexOf(this.draggableItem.scope)>=0){var i=new l(this.draggableItem,this.dragImage,t);i.dropEffect=o.Allow,e.onDragEnter&&e.onDragEnter(n,i),this.dropEffect=i.dropEffect,this.updateCusror(this.dropEffect),this.updateImageClass(this.dropEffect)}else this.dropEffect!==o.Forbid&&(this.dropEffect=o.None,this.updateCusror(this.dropEffect),this.updateImageClass(this.dropEffect))},t.prototype.dragLeaveEvent=function(t){var e=this.containerDescriptors[this.containerDescriptorIndex],n={element:e.element,scopes:e.scopes,data:e.data};if(n.scopes.indexOf(this.draggableItem.scope)>=0){var i=new l(this.draggableItem,this.dragImage,t);i.dropEffect=o.None,e.onDragLeave&&e.onDragLeave(n,i),this.dropEffect=i.dropEffect,this.updateCusror(this.dropEffect),this.updateImageClass(this.dropEffect)}},t.prototype.detectDragEnterEvent=function(t,e){var n=Object(r.g)(t),o=new u(e);return!(o.y<n.y||o.y>n.y+t.offsetHeight)&&!(o.x<n.x||o.x>n.x+t.offsetWidth)},t.prototype.detectDragLeaveEvent=function(t,e){var n=Object(r.g)(t),o=new u(e);return!(o.y>n.y&&o.y<n.y+t.offsetHeight&&o.x>n.x&&o.x<n.x+t.offsetWidth)},t}(),d=new c},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var o,i=n(0),r=n(60),s=n(33),a=n(23),l=n(21),u=n(12),c=n(27),d=n(29),h=n(8),p=n(61),f=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),g=function(t){function e(){var e=t.call(this)||this;return e.mainEntity=null,e.nullAttribute=new a.b(null),e.nullOperator=new s.b,e.operators=new Array,e.rootEntity=new a.a,e.aggrFunctions=new Array,e.dateMacros=["Today","Yesterday","Tomorrow","FirstDayOfMonth","LastDayOfMonth","FirstDayOfWeek","FirstDayOfYear","FirstDayOfNextWeek","FirstDayOfPrevMonth","FirstDayOfNextMonth","FirstDayOfNextYear","FirstDayOfPrevYear","FirstDayOfPrevWeek"],e.timeMacros=["Now","HourStart","Midnight","Noon"],e.links=[],e}return f(e,t),e.prototype.getMainEntity=function(){return this.mainEntity},e.prototype.loadFromJSON=function(t){var e=JSON.parse(t);this.loadFromData(e)},e.prototype.loadFromData=function(e){if(t.prototype.loadFromData.call(this,e),this.operators=new Array,e.operators)for(var n=0;n<e.operators.length;n++){var o=new s.b;o.loadFromData(this,e.operators[n]),this.operators.push(o)}if(this.rootEntity.loadFromData(this,e.entroot),this.aggrFunctions=new Array,e.aggrfuncs)for(n=0;n<e.aggrfuncs.length;n++){var i=new r.a;i.loadFromData(e.aggrfuncs[n]),this.aggrFunctions.push(i)}},e.prototype.getObject=function(){return this},e.prototype.setData=function(t){"string"==typeof t?this.loadFromJSON(t):this.loadFromData(t)},e.prototype.createEntity=function(t){return new a.a(t)},e.prototype.createEntityAttr=function(t){return new a.b(t)},e.prototype.createValueEditor=function(){return new l.a},e.prototype.createQuery=function(){return new d.b(this)},e.prototype.getRootEntity=function(){return this.rootEntity},e.prototype.getEditorById=function(e){return t.prototype.getEditorById.call(this,e)},e.prototype.getAttributeById=function(t){var e=this.getEntityAttrById(this.getRootEntity(),t);return e||null},e.prototype.getAttributeByIdSafe=function(t){var e=this.getAttributeById(t);return e||this.nullAttribute},e.prototype.checkAttrProperty=function(t,e){var n=this.getAttributeById(t);if(n){if(void 0===n[e])throw"No such property: "+e;return!!n[e]||!!n.lookupAttr&&(t=n.lookupAttr,(n=this.getAttributeById(t))&&n[e])}return!1},e.prototype.getEntityAttrById=function(e,n){return t.prototype.getEntityAttrById.call(this,e,n)},e.prototype._listByEntityWithFilter=function(t,e){var n,o=new Array,r=null;if(t.subEntities)for(var s=t.subEntities.length,l=0;l<s;l++){if(r=t.subEntities[l],!e||e(r,null))(n=i.i18n.getText("Entities",r.name))||(n=r.caption),(h=i.utils.assign(new a.a,{id:r.name,text:n,items:[],isEntity:!0})).items=this._listByEntityWithFilter(r,e),h.items.length>0&&o.push(h)}var u=null;if(t.attributes)for(var c=t.attributes.length,d=0;d<c;d++)if(u=t.attributes[d],!e||e(t,u)){(n=i.i18n.getText("Attributes",u.id))||(n=u.caption);var h=i.utils.assign(new a.a,{id:u.id,text:n,dataType:u.dataType});o.push(h)}return o},e.prototype._listByEntity=function(t,e,n){e=e||{};var o,r=[],s=[],l=null;if(t.subEntities)for(var u=t.subEntities.length,c=0;c<u;c++)if(l=t.subEntities[c],(!n||n(l,null))&&(!1!==e.addUIC&&!1!==l.useInConditions||!1!==e.addUIR&&!1!==l.useInResult||!1!==e.addUIS&&!1!==l.useInSorting)){o=i.i18n.getText("Entities",l.name)||l.caption;var d=i.utils.assign(new a.a,{id:l.name,text:o,items:[],isEntity:!0,description:l.description}),h=i.utils.assign({},e);h.includeRootData=!1,d.items=this._listByEntity(l,h,n),d.items.length>0&&r.push(d)}var p=null;if(t.attributes)for(var f=t.attributes.length,g=0;g<f;g++)p=t.attributes[g],n&&!n(t,p)||(!1!==e.addUIC&&!1!==p.useInConditions||!1!==e.addUIR&&!1!==p.useInResult||!1!==e.addUIS&&!1!==p.useInSorting)&&(o=i.i18n.getText("Attributes",p.id)||p.caption,s.push(i.utils.assign(new a.b(t),{id:p.id,text:o,dataType:p.dataType,lookupAttr:p.lookupAttr,description:p.description})));var y,m=function(t,e){return t.text.toLowerCase()==e.text.toLowerCase()?0:t.text.toLowerCase()>e.text.toLowerCase()?1:-1};return e.sortEntities&&(r.sort(m),s.sort(m)),y=e.attrPlacement&&0!=e.attrPlacement?s.concat(r):r.concat(s),2==e.attrPlacement&&y.sort(m),e.includeRootData?((o=i.i18n.getText("Entities",t.name))||(o=t.caption),{id:t.name,text:o,items:y}):y},e.prototype.clear=function(){t.prototype.clear.call(this),this.operators=[],this.aggrFunctions=[]},e.prototype.addOrUpdateOperator=function(t){var e=i.utils.findItemById(this.operators,t.id);return e||((e=new s.b).id=t.id,this.operators.push(e)),e.caption=t.caption,e.expr=t.expr||"",e.displayFormat=t.format,e.defaultOperand=new s.a,e.defaultOperand.kind=t.kind||u.a.Scalar,t.appliedTypes&&(e.appliedTypes=t.appliedTypes),t.paramCount>0&&(e.paramCount=t.paramCount),this.runThroughEntities((function(t,n){t.operators.indexOf(e.id)<0&&e.appliedTypes.indexOf(t.dataType)>=0&&t.operators.push(e.id)})),e},e.prototype.removeOperator=function(t,e){void 0===e&&(e=!1);var n=i.utils.findItemById(this.operators,t);n&&(e||i.utils.removeArrayItem(this.operators,n),this.runThroughEntities((function(t,e){i.utils.removeArrayItem(t.operators,n.id)})))},e.prototype.getOperatorIdsByDataType=function(t){switch(t){case i.DataType.String:case i.DataType.Memo:return"StartsWith,EndsWith,Contains,Equal,InList,NotStartsWith,NotEndsWith,NotContains,NotEqual,NotInList,IsNull,IsNotNull".split(",");case i.DataType.Guid:return"Equal,NotEqual".split(",");case i.DataType.Date:case i.DataType.DateTime:return"DateWithinToday,DateWithinThisWeek,DateWithinPrevWeek,DateWithinThisMonth,DateWithinPrevMonth,DateWithinThisYear,DateWithinPrevYear,DateBeforePrecise,DateAfterPrecise,DatePeriodPrecise,IsNull,IsNotNull".split(",");case i.DataType.Time:return"TimeBeforePrecise,TimeAfterPrecise,TimePeriodPrecise,IsNull,IsNotNull".split(",");case i.DataType.Byte:case i.DataType.Word:case i.DataType.Int32:case i.DataType.Int64:case i.DataType.Float:case i.DataType.Currency:case i.DataType.BCD:case i.DataType.Autoinc:case i.DataType.Unknown:return"Equal,Between,LessThan,LessOrEqual,GreaterThan,GreaterOrEqual,InList,NotEqual,NotBetween,NotInList,IsNull,IsNotNull".split(",");case i.DataType.Bool:return"IsTrue,NotTrue".split(",");default:for(var e=[],n=0,o=this.operators;n<o.length;n++){var r=o[n];r.appliedTypes.indexOf(t)>=0&&e.push(r.id)}return e}},e.prototype.buildQueryPath=function(t){var e=this.mainEntity||this.rootEntity,n=this.createTreeNodeFromEntity(e);return n.setParents(),n},e.prototype.createTreeNodeFromEntity=function(t){for(var e=new p.a(t),n=0,o=t.subEntities;n<o.length;n++){var i=o[n];e.addChild(this.createTreeNodeFromEntity(i))}return e},e.prototype.getEntitiesInQuery=function(t){if(t.model.id!==this.id)throw Error("Model mithmatch");for(var e=[],n=0,o=t.getColumns();n<o.length;n++){var i=o[n];i.enabled&&this.addEntityByExpression(e,i.expr)}var r=t.getRootCondition();return this.fillEntitiesByCondtionGroup(e,r),e},e.prototype.findAggrFunctionById=function(t){for(var e=0,n=this.aggrFunctions;e<n.length;e++){var o=n[e];if(o.id===t)return o}return null},e.prototype.fillEntitiesByCondtionGroup=function(t,e){for(var n=0,o=e.getConditions();n<o.length;n++){var i=o[n];if(i.isGroup())this.fillEntitiesByCondtionGroup(t,i);else for(var r=0,s=i.expressions;r<s.length;r++){var a=s[r];if(this.addEntityByExpression(t,a),a.args)for(var l=0,u=a.args;l<u.length;l++){var c=u[l];this.addEntityByExpression(t,c)}}}},e.prototype.addEntityByExpression=function(t,e){if(e.tag===h.a.EntityAttribute){var n=e.baseAttrId||e.value;if(n){var o=this.getAttributeById(n);o&&o.entity&&i.utils.indexOfArrayItem(t,o.entity)<0&&t.push(o.entity)}}},e.prototype.findLink=function(t,e){for(var n=0,o=this.links;n<o.length;n++){var i=o[n];if(i.entityFrom==t&&i.entityTo==e)return i}return null},e.prototype.getLinksByEntity=function(t){for(var e=[],n=0,o=this.links;n<o.length;n++){var i=o[n];i.entityFrom!=t&&i.entityTo!=t||e.push(i)}return e},e.prototype.getEntitiesTree=function(t,e){return this._listByEntity(this.getRootEntity(),t,e)},e.prototype.getEntitiesTreeWithFilter=function(t){return this._listByEntityWithFilter(this.getRootEntity(),t)},e.prototype.getFullEntityPathByAttr=function(t,e){return e=e||" ",this.getEntityPathByAttr(this.getRootEntity(),t,e,!0)},e.prototype.getEntityPathByAttr=function(e,n,o,i){return t.prototype.getEntityPathByAttr.call(this,e,n,o,i)},e.prototype.getAttributeText=function(e,n){return t.prototype.getAttributeText.call(this,e,n)},e.prototype.getFirstUICAttr=function(){return this.getFirstUICAttrInEntity(this.getRootEntity())},e.prototype.getFirstUICAttrInEntity=function(t){if(!1!==t.useInConditions){if(t.attributes)for(var e=t.attributes.length,n=0;n<e;n++)if(t.attributes[n].useInConditions)return t.attributes[n];if(t.subEntities){var o=t.subEntities.length;for(n=0;n<o;n++){var i=this.getFirstUICAttrInEntity(t.subEntities[n]);if(i)return i}}}return null},e.prototype.runThroughEntities=function(t,e){this.getRootEntity().scan(t,e)},e.prototype.getFirstAttributeByFilter=function(t){var e=null;return this.runThroughEntities((function(n,o){t(n)&&(o.stop=!0,e=n)}),null),e},e.prototype.findOperatorById=function(t){if(this.operators.length>0)for(var e=this.operators.length,n=0;n<e;n++)if(this.operators[n].id==t)return this.operators[n];return null},e.prototype.getOperatorById=function(t){var e=this.findOperatorById(t);return e||this.nullOperator},e.prototype.getDefaultOperatorIdForAttr=function(t){return t.defaultOperator?t.defaultOperator:t.operators.length>0?t.operators[0]:this.nullOperator.id},e.prototype.getAggrFunctionCaption=function(t){var e=i.i18n.getText("AggregateFunctions",t),n=e?e.caption:i.i18n.getText("Aggr"+t.replace(" ","")+"_Caption");if(n)return n;var o=i.utils.findItemById(this.aggrFunctions,t);return o&&o.caption?o.caption:t},e.prototype.getAggrFunctionFormat=function(t){var e=i.i18n.getText("AggregateFunctions",t),n=e?e.displayFormat:i.i18n.getText("Aggr"+t.replace(" ","")+"_Format");if(n)return n;var o=i.utils.findItemById(this.aggrFunctions,t);return o&&o.displayFormat?o.displayFormat:""},e.prototype.getDefaultOperatorForAttr=function(t){var e=this.getDefaultOperatorIdForAttr(t);return this.getOperatorById(e)},e.prototype.getOperand=function(t,e,n){var o=new s.a;e&&e.defaultOperand?(o.copyFrom(e.defaultOperand),o.defValue||(o.defValue=""),o.defText||(o.defText="")):(o.kind=u.a.Scalar,o.dataType=t.dataType,o.defValue="",o.defText="",o.editor=null);var r=o;return r.dataType===i.DataType.Unknown&&t&&(r.dataType=t.dataType),e&&n>=0&&e.operands&&e.operands[n-1]&&(r=i.utils.assign(r,e.operands[n-1])),r.editor||(o.editor?r.editor=o.editor:o.kind===u.a.Query?r.editor.tag=c.a.SubQuery:t&&t.defaultEditor?r.editor=t.defaultEditor:r.dataType===i.DataType.Date||r.dataType===i.DataType.DateTime||r.dataType===i.DataType.Time?r.editor.tag=c.a.DateTime:r.editor.tag=c.a.Edit),r},e.prototype.getAggrFunctions=function(){return this.aggrFunctions},e.prototype.isDateMacro=function(t,e){var n=t.match(/\${{?(.*?)}?}/);if(null!=n){var o=n[1];if(i.utils.indexOfArrayItem(this.dateMacros,o)>=0)return e&&e(o),!0}return!1},e.prototype.isTimeMacro=function(t,e){var n=t.match(/\${{?(.*?)}?}/);if(null!=n){var o=n[1];if(i.utils.indexOfArrayItem(this.timeMacros,o)>=0)return e&&e(o),!0}return!1},e.prototype.getDateMacroValue=function(t){var e=new Date;return this.isDateMacro(t,(function(t){switch(t){case"Today":break;case"Yesterday":e.setDate(e.getDate()-1);break;case"Tomorrow":e.setDate(e.getDate()+1);break;case"FirstDayOfMonth":e.setDate(1);break;case"LastDayOfMonth":e.setMonth(e.getMonth()+1,0);break;case"FirstDayOfPrevWeek":n=0==(n=e.getDay())?1:8-n,e.setDate(e.getDate()-n);break;case"FirstDayOfWeek":n=0==(n=e.getDay())?6:n-1,e.setDate(e.getDate()-n);break;case"FirstDayOfYear":e.setMonth(0,1);break;case"FirstDayOfNextWeek":var n;n=0==(n=e.getDay())?1:8-n,e.setDate(e.getDate()+n);break;case"FirstDayOfNextMonth":e.setMonth(e.getMonth()+1,1);break;case"FirstDayOfPrevMonth":e.setMonth(e.getMonth()-1,1);break;case"FirstDayOfPrevYear":e.setFullYear(e.getFullYear()-1,0,1);break;case"FirstDayOfNextYear":e.setFullYear(e.getFullYear()+1,0,1)}}))?e:null},e.prototype.getDateOrMacroValue=function(t){var e=this.getDateMacroValue(t);return e||t},e.prototype.getTimeMacroValue=function(t){var e=new Date;return this.isDateMacro(t,(function(t){switch(t){case"Now":break;case"HourStart":e.setMinutes(0,0,0);break;case"Midnight":e.setHours(0,0,0,0);break;case"Noon":e.setHours(12,0,0,0)}}))?e:null},e.prototype.getTimeOrMacroValue=function(t){var e=this.getTimeMacroValue(t);return e||t},e.prototype.getAllDateMacros=function(){return this.dateMacros},e.prototype.getAllTimeMacros=function(){return this.timeMacros},e}(i.MetaData)},function(t,e,n){"use strict";n.d(e,"b",(function(){return s})),n.d(e,"a",(function(){return o})),n.d(e,"c",(function(){return d}));var o,i=n(0),r=n(22),s=/{0:(.*?)}/g;!function(t){t[t.STRING=1]="STRING",t[t.NUMBER=2]="NUMBER",t[t.DATETIME=3]="DATETIME",t[t.BOOL=4]="BOOL"}(o||(o={}));var a=function(t,e,n,o){var i=t?t.toString().replace(/\n/g,"↵ "):"";n.innerText=i,n.title=i,e.align==r.b.NONE&&n.classList.add("keg-cell-value-align-left")},l=function(t,e,n,o){var a=(t||"").toString();"number"==typeof t&&(a=e.dataColumn&&e.dataColumn.displayFormat&&s.test(e.dataColumn.displayFormat)?e.dataColumn.displayFormat.replace(s,(function(e,n){return i.i18n.numberToStr(t,n)})):t.toLocaleString()),n.innerText=a,n.title=a,e.align==r.b.NONE&&n.classList.add("keg-cell-value-align-right")},u=function(t,e,n,o){var a="[object Date]"===Object.prototype.toString.call(t),l=(t||"").toString();if(a)if(e.dataColumn&&e.dataColumn.displayFormat&&s.test(e.dataColumn.displayFormat))l=e.dataColumn.displayFormat.replace(s,(function(n,o){return i.i18n.dateTimeToStr(t,e.type,o)}));else{var u=i.i18n.getCurrentLocale(),c={hour:"numeric",minute:"numeric",second:"numeric"};switch(e.type){case i.DataType.Date:l=t.toLocaleDateString(u);break;case i.DataType.Time:l=t.toLocaleTimeString(u,c);break;case i.DataType.DateTime:l=t.toLocaleDateString(u)+" "+t.toLocaleTimeString(u,c)}}n.innerText=l,n.title=l,e.align==r.b.NONE&&n.classList.add("keg-cell-value-align-right")},c=function(t,e,n,o){if(e.dataColumn&&e.dataColumn.displayFormat&&s.test(e.dataColumn.displayFormat)){var r=e.dataColumn.displayFormat.replace(s,(function(e,n){return i.i18n.booleanToStr(t,n)}));return a(r,e,n)}n.classList.add("keg-cell-value-bool"),n.classList.add("keg-"+(t?"cell-value-true":"cell-value-false"))},d=function(){function t(t){this.renderers={},this.defaultRenderers={},this.registerRenderer("StringDefault",a),this.setDefaultRenderer(o.STRING,a),this.registerRenderer("NumberDefault",l),this.setDefaultRenderer(o.NUMBER,l),this.registerRenderer("DateTimeDefault",u),this.setDefaultRenderer(o.DATETIME,u),this.registerRenderer("BoolDefault",c),this.setDefaultRenderer(o.BOOL,c)}return t.prototype.getDefaultRenderer=function(t){var e=this.getCellType(t);return this.defaultRenderers[o[e]]},t.prototype.getDefaultRendererByType=function(t){return this.defaultRenderers[o[t]]},t.prototype.setDefaultRenderer=function(t,e){e&&(this.defaultRenderers[o[t]]=e)},t.prototype.getRenderer=function(t){return this.renderers[t]},t.prototype.registerRenderer=function(t,e){this.renderers[t]=e},t.prototype.getCellType=function(t){switch(t){case i.DataType.Autoinc:case i.DataType.Byte:case i.DataType.Word:case i.DataType.Currency:case i.DataType.Float:case i.DataType.Int32:case i.DataType.Int64:return o.NUMBER;case i.DataType.Date:case i.DataType.DateTime:case i.DataType.Time:return o.DATETIME;case i.DataType.Bool:return o.BOOL;default:return o.STRING}},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var o,i=n(0),r=n(2),s=n(1),a=n(9),l=n(4),u=n(3),c=n(75),d=n(41),h=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),p=function(t){function e(e,n){var o=t.call(this,e)||this;return o.options={isSubQuery:!1,activeColumn:null,showAddRow:!0,showHeader:!0,showColumnTitles:!0,allowAggrColumns:!0,allowDuplicates:!0,allowCustomExpressions:!1,allowSorting:!0,attrElementFormat:"{entity} {attr}",titleElementFormat:null,alwaysShowButtons:!1,accentActiveColumn:!0,allowDragDrop:!0,menuOptions:{showSearchBoxAfter:30,searchBoxAutoFocus:!0,activateOnMouseOver:!0,adjustHeight:!0,itemRenderedCallback:null},attrPlacement:0,sortEntities:!1,columnRenderedCallback:null,customExpressionText:0},o.landingSlot=Object(s.domel)("div").addClass(l.b+"-highlight").toDOM(),o.landingIndex=-1,o.sortMenuList=[{id:"None",text:i.i18n.getText("CmdNotSorted")},{id:"Ascending",text:i.i18n.getText("CmdAscending")},{id:"Descending",text:i.i18n.getText("CmdDescending")},{id:"---",text:"---"}],o.moveMenuList=[{id:"MoveTop",text:i.i18n.getText("CmdMoveToFirst")},{id:"MoveUp",text:i.i18n.getText("CmdMoveToPrev")},{id:"MoveDown",text:i.i18n.getText("CmdMoveToNext")},{id:"MoveBottom",text:i.i18n.getText("CmdMoveToLast")}],Object(s.domel)(o.slot).addClass(o.cssPrefix+"-panel").addClass(u.a.getMobileCssClass()),o.group=r.WidgetGroup.Query,o.customQuery=n,o}return h(e,t),Object.defineProperty(e.prototype,"cssPrefix",{get:function(){return"eqjs-cb"},enumerable:!0,configurable:!0}),e.prototype.getWidgetType=function(){return"columnsBar"},e.prototype.init=function(e,n){var o=this;t.prototype.init.call(this,e,n),this.setOptions(n),this.detachQueryObserver(),this.attachQueryObserver(),s.eqDragManager.removeDropContainer(this.slot),this.options.allowDragDrop&&s.eqDragManager.registerDropContainer({element:this.slot,scopes:["entityAttrSort"],onDragEnter:function(t,e){o.showLandingSlot(e.pageX,e.pageY)},onDragOver:function(t,e){o.showLandingSlot(e.pageX,e.pageY)},onDragLeave:function(t,e){e.dropEffect=s.DropEffect.Forbid,o.hideLandingSlot()},onDrop:function(t,e){var n=o.getQuery().getColumns().indexOf(e.data.column);o.moveColumnCore(n,o.landingIndex)}})},e.prototype.attachQueryObserver=function(){var t=this,e=this.getQuery();this.queryEventCallbackId=e.addChangedCallback((function(n){var o=n.data;if(o&&(o.part==r.QueryChangePart.Columns||o.part==r.QueryChangePart.Aggregation||o.part==r.QueryChangePart.All)){var i=document.activeElement,s=t.slot.contains(i)||i==document.body;switch(o.action){case r.QueryChangeAction.Modify:var a=o.changee,l=function(e){var n=t.columnsBlock.querySelector("div[data-id='"+e.id+"']");if(n){var o=t.renderColumn(e,n);if(s){var i=o.querySelector("a");i&&i.focus()}}};Array.isArray(a)?a.forEach((function(t){return l(t)})):l(a);break;case r.QueryChangeAction.Add:a=o.changee;var u=function(n){var o=e.getColumns().indexOf(n);t.addColumnElement(n,o)};Array.isArray(a)?a.forEach((function(t){return u(t)})):u(a);break;case r.QueryChangeAction.Delete:a=o.changee;var c=function(e){var n=t.columnsBlock.querySelector("div[data-id='"+e.id+"']");if(n){var o=n.nextSibling,i=n.previousSibling;if(t.columnsBlock.removeChild(n),s){var r=(o||i||t.addRowButton).querySelector("a");r&&r.focus()}}};Array.isArray(a)?a.forEach((function(t){return c(t)})):c(a);break;default:t.refresh()}}}))},e.prototype.getQuery=function(){return this.customQuery?this.customQuery:this.getContext().getQuery()},e.prototype.destroyCore=function(){s.eqDragManager.removeDropContainer(this.slot),this.detachQueryObserver(),this.slot.innerHTML=""},e.prototype.detachQueryObserver=function(){this.queryEventCallbackId&&this.getQuery().removeChangedCallback(this.queryEventCallbackId)},e.prototype.setOptions=function(t){this.options=i.utils.assignDeep(this.options,t)},e.prototype.showLandingSlot=function(t,e){for(var n=this.columnsBlock.querySelectorAll("[class*="+this.cssPrefix+"-row]"),o=[],i=0;i<n.length;i++)"none"!==n[i].style.display&&o.push(n[i]);if(0!==o.length){var r=Object(s.getElementAbsolutePos)(this.landingSlot);if(!(t>=r.x&&t<=r.x+this.landingSlot.offsetWidth&&e>=r.y&&e<=r.y+this.landingSlot.offsetHeight)){var a=this.landingIndex;for(i=0;i<o.length;i++){var l=o[i],u=Object(s.getElementAbsolutePos)(l),c=l.offsetWidth,d=l.offsetHeight,h=.2*c;if(t>=u.x+h&&t<=u.x+c-h&&e>=u.y+2&&e<=u.y+d-2){a=t>r.x?i+1:i;break}}(a!=this.landingIndex||this.landingSlot.parentElement)&&(this.landingIndex=a,this.landingIndex<=0&&this.columnsBlock.insertBefore(this.landingSlot,o[0]),this.landingIndex<o.length?this.columnsBlock.insertBefore(this.landingSlot,o[this.landingIndex]):this.columnsBlock.appendChild(this.landingSlot))}}else this.landingIndex=0},e.prototype.hideLandingSlot=function(){this.landingIndex=-1,this.landingSlot.parentElement&&this.landingSlot.parentElement.removeChild(this.landingSlot)},e.prototype.onProcessStartCore=function(){},e.prototype.onProcessEndCore=function(){},e.prototype.refreshCore=function(){this.clear(),this.render()},e.prototype.clear=function(){this.slot.innerHTML=""},e.prototype.renderAddRowButton=function(){var t=this;Object(s.domel)(this.addRowButton).addClass(l.b+"-addrow",this.cssPrefix+"-addrow",l.b+"-addrow-empty").addClass(u.a.getMobileCssClass()).title(i.i18n.getText("CmdClickToAddColumn")).addChild("a",(function(e){return e.attr("href","javascript:void(0)").on("click",(function(e){e.preventDefault(),t.showEntitiesMenu({anchor:e.target,selectedIds:null,itemSelectedCallback:function(e,n){var o=e.id;return t.addNewColumn(o),!1}})}))})),u.a.isMobileMode()&&Object(s.domel)(this.columnsBlock).addChildElement(this.addRowButton)},e.prototype.render=function(){var t=this;this.createEntitiesMenu(),this.options.allowSorting&&this.createSortMenu(),this.createMoveMenu(),this.columnsBlock=Object(s.domel)("div").addClass(this.cssPrefix+"-columns").addClass(u.a.getMobileCssClass()).toDOM(),this.options.showAddRow&&(this.addRowButton=Object(s.domel)("div").toDOM(),u.a.isMobileMode()?Object(s.domel)(this.columnsBlock).addChildElement(this.addRowButton):Object(s.domel)(this.slot).addChildElement(this.addRowButton),this.renderAddRowButton()),Object(s.domel)(this.slot).addChildElement(this.columnsBlock).addChildElement(this.renderColumnButtonsBlockMobile()),this.getQuery().getColumns().forEach((function(e,n){var o=t.renderColumn(e);t.columnsBlock.appendChild(o)}))},e.prototype.renderColumnButtonsBlockMobile=function(){var t=this;return this.columnButtonsBlockMobileArrow=Object(s.domel)("i").toDOM(),this.columnButtonsBlockMobile=Object(s.domel)("div").addClass(this.cssPrefix+"-column-buttonsBlock").addClass(u.a.getMobileCssClass()).addChildElement(this.columnButtonsBlockMobileArrow).hide().toDOM(),this.buttonsBlockSortingButton=Object(s.domel)("div",this.columnButtonsBlockMobile).addClass(this.cssPrefix+"-column-button",this.cssPrefix+"-column-sortbutton-none").toDOM(),Object(s.domel)(this.buttonsBlockSortingButton).on("touchstart click",(function(e){return e.stopPropagation(),t.currentColumnRenderer.buttonSortingClickHandler.call(t.currentColumnRenderer,e,t.buttonsBlockSortingButton),t.toggleColumnPicked(null),t.hideColumnButtonsMobile(),!1})),this.buttonsBlockTypeButton=Object(s.domel)("div",this.columnButtonsBlockMobile).addClass(this.cssPrefix+"-column-button",this.cssPrefix+"-column-button-type").on("touchstart click",(function(e){return e.stopPropagation(),t.currentColumnRenderer.buttonTypeClickHandler.call(t.currentColumnRenderer,e),t.toggleColumnPicked(null),t.hideColumnButtonsMobile(),!1})).toDOM(),this.buttonsBlockFormatButton=Object(s.domel)("div",this.columnButtonsBlockMobile).addClass(this.cssPrefix+"-column-button",this.cssPrefix+"-column-button-format").on("touchstart click",(function(e){return e.stopPropagation(),t.currentColumnRenderer.buttonFormatClickHandler.call(t.currentColumnRenderer,e),t.toggleColumnPicked(null),t.hideColumnButtonsMobile(),!1})).toDOM(),this.buttonsBlockDeleteButton=Object(s.domel)("div",this.columnButtonsBlockMobile).addClass(this.cssPrefix+"-column-button",this.cssPrefix+"-column-button-delete").on("touchstart click",(function(e){return e.stopPropagation(),t.currentColumnRenderer.buttonDeleteClickHandler.call(t.currentColumnRenderer,e),t.toggleColumnPicked(null),t.hideColumnButtonsMobile(),!1})).toDOM(),Object(s.domel)("div",this.columnButtonsBlockMobile).addClass(this.cssPrefix+"-column-button-close-block").on("touchstart click",(function(){t.toggleColumnPicked(null),t.hideColumnButtonsMobile()})),this.columnButtonsBlockMobile},e.prototype.showColumnButtonsMobile=function(t,e,n){this.currentActiveColumn=t,this.currentColumnRenderer=e;var o=n.getBoundingClientRect(),i=n.offsetTop,r=n.offsetLeft;Object(s.domel)(this.columnButtonsBlockMobileArrow).setStyle("left",(r+o.width/2).toString()+"px"),o.top>100?Object(s.domel)(this.columnButtonsBlockMobile).removeClass("show-below").setStyle("top",(i-o.height).toString()+"px"):Object(s.domel)(this.columnButtonsBlockMobile).addClass("show-below").setStyle("top",(i+o.height).toString()+"px"),t.enabled&&!t.isReadOnly()?(Object(s.domel)(this.buttonsBlockSortingButton).show(),Object(s.domel)(this.buttonsBlockTypeButton).show(),e.formatButtonIsShown()?Object(s.domel)(this.buttonsBlockFormatButton).show():Object(s.domel)(this.buttonsBlockFormatButton).hide()):(Object(s.domel)(this.buttonsBlockSortingButton).hide(),Object(s.domel)(this.buttonsBlockTypeButton).hide()),t.isReadOnly()?Object(s.domel)(this.columnButtonsBlockMobile).hide():Object(s.domel)(this.columnButtonsBlockMobile).show()},e.prototype.hideColumnButtonsMobile=function(){Object(s.domel)(this.columnButtonsBlockMobile).hide()},e.prototype.renderColumn=function(t,e){var n=this,o=this.getColumnRenderer(t,e);if(o){var i=o.render();return o.onShowButtonsMobile=function(){n.showColumnButtonsMobile(t,o,i)},o.onHideButtonsMobile=function(){n.hideColumnButtonsMobile()},i}return null},e.prototype.getColumnRenderer=function(t,e){switch(t.expr.tag){case r.ExprTag.AggregateFunction:return new c.a(this,t,e);case r.ExprTag.CustomSql:case r.ExprTag.EntityAttribute:case r.ExprTag.ParentEntityAttribute:return new d.a(this,t,e)}return null},e.prototype.addNewColumn=function(t,e){var n=this,o=this.getContext().getModel(),i=this.getQuery(),s=function(t){var e=o.getAttributeById(t);if(!e)return null;if(!e.useInResult){if(!e.lookupAttr)return null;if(t=e.lookupAttr,!(e=o.getAttributeById(t))||!e.useInResult)return null}var s=i.createColumn();return s.caption=n.getDefaultColumnCaption(e),s.sorting=r.SortDirection.None,s.sortIndex=-1,s.expr.tag=r.ExprTag.EntityAttribute,s.expr.kind=r.DataKind.Attribute,s.expr.dataType=e.dataType,s.expr.setValue(t,!0),s.params.concat(e.params),s};if(this.getQuery()){var a,l;if(Array.isArray(t)){a=[];for(var u=0;u<t.length;u++)(l=s(t[u]))&&a.push(l)}else a=s(t);return this.addColumn(a,e),a}},e.prototype.toggleColumnPicked=function(t){var e,n;t&&(e=this.columnsBlock.querySelector("div[data-id="+t.id+"]"))&&(n=e.classList.contains("active"));for(var o=this.columnsBlock.querySelectorAll("."+this.cssPrefix+"-row"),i=0;i<o.length;i++){var r=o[i];Object(s.domel)(r).removeClass("active").data("show-buttons",null)}e&&!n&&Object(s.domel)(e).addClass("active").data("show-buttons","")},e.prototype.addColumn=function(t,e){var n=this.getQuery();n&&(!(t=Array.isArray(t)?this.checkColumnsArray(t):this.checkColumn(t))||Array.isArray(t)&&0==t.length||(n.addColumnObj(t,e,self),n.fireChangedEvent({part:r.QueryChangePart.Columns,action:r.QueryChangeAction.Add,changee:t})))},e.prototype.addColumnElement=function(t,e){var n=this.columnsBlock.querySelectorAll("[class*="+this.cssPrefix+"-row]"),o=this.renderColumn(t);n.length>0&&e<n.length-1?this.columnsBlock.insertBefore(o,n[e]):this.columnsBlock.appendChild(o),this.options.columnRenderedCallback&&this.options.columnRenderedCallback(o)},e.prototype.checkColumnsArray=function(t){for(var e=t.length,n=[],o=0;o<e;o++)this.checkColumn(t[o])&&n.push(t[o]);return n},e.prototype.checkColumn=function(t){if(!this.options.allowDuplicates)for(var e=this.getQuery().getColumns(),n=JSON.stringify(t.expr),o=0;o<e.length;o++){if(JSON.stringify(e[o].expr)===n)return null}return t},e.prototype.getDefaultColumnCaption=function(t){var e=this.options.titleElementFormat||this.options.attrElementFormat;return this.getContext().getModel().getAttributeText(t,e)},e.prototype.getColumnsBlock=function(){return this.columnsBlock},e.prototype.showEntitiesMenu=function(t){this.entitiesMenu&&this.entitiesMenu.showMenu(t)},e.prototype.createEntitiesMenu=function(){var t=this.getContext().getModel();if(!t||t.isEmpty())return null;var e=this.slot.id;e&&(e+="-EntitiesMenu");var n={items:t.getEntitiesTree({addUIC:!1,addUIR:!0,addUIS:!1,attrPlacement:this.options.attrPlacement,sortEntities:this.options.sortEntities}),adjustHeight:this.options.adjustEntitiesMenuHeight,id:e,domWriteItemsId:this.options.domWriteItemsId};i.utils.assign(n,this.options.menuOptions),this.entitiesMenu=new a.a(n)},e.prototype.createSortMenu=function(){var t=this.getContext().getModel();if(!t||t.isEmpty())return null;var e=this.slot.id;e&&(e+="-SortMenu");var n={items:this.sortMenuList.concat(this.moveMenuList),id:e,domWriteItemsId:this.options.domWriteItemsId};i.utils.assign(n,this.options.menuOptions),n.searchBoxAlwaysShown=!1,this.sortMenu=new a.a(n)},e.prototype.createMoveMenu=function(){var t=this.getContext().getModel();if(!t||t.isEmpty())return null;var e=this.slot.id;e&&(e+="-MoveMenu");var n={items:this.moveMenuList,id:e,domWriteItemsId:this.options.domWriteItemsId};i.utils.assign(n,this.options.menuOptions),this.moveMenu=new a.a(n),n.searchBoxAlwaysShown=!1},e.prototype.moveColumn=function(t,e){var n=this.getQuery().getColumns(),o=n.indexOf(t);if(o>=0)switch(e){case"MoveTop":if(0==o)return;this.moveColumnCore(o,0);break;case"MoveUp":if(0==o)return;this.moveColumnCore(o,o-1);break;case"MoveDown":if(o==n.length-1)return;this.moveColumnCore(o,o+1);break;case"MoveBottom":if(o==n.length-1)return;this.moveColumnCore(o,n.length-1)}},e.prototype.moveColumnCore=function(t,e){var n=this.getQuery();if(n){var o=this.columnsBlock.querySelectorAll("[class*="+this.cssPrefix+"-row]"),i=o[t];e<=0?this.columnsBlock.insertBefore(i,this.columnsBlock[0]):e<o.length?this.columnsBlock.insertBefore(i,o[e]):this.columnsBlock.appendChild(i),n.moveColumn(t,e),n.fireColumnsChangedEvent(r.QueryChangeAction.All)}},e.prototype.areCustomExpressionsAllowed=function(){return this.getQuery().isEx()&&this.options.allowCustomExpressions},e.globalCounter=0,e}(r.Widget)},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var o,i=n(2),r=n(1),s=n(76),a=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.getClassesToAdd=function(){return t.prototype.getClassesToAdd.call(this)+" "+this.cssPrefix+"-row "+this.cssPrefix+"-row-column-entattr"},e.prototype.baseExpressionItemSelectedCallback=function(t,e){var n=t.id;this.column.expr.setValue(n,!0),this.column.caption="",this.refresh(),this.fireColumnChanged()},e.prototype.getUIS=function(){var t=this.column.expr.args[0];return!t||this.bar.getContext().getModel().checkAttrProperty(t.value,"useInSorting")},e.prototype.changeTypeToCustomSql=function(){this.column.getQuery().changeColumnType(this.column,i.ExprTag.CustomSql),this.fireColumnChanged()},e.prototype.changeTypeToAggr=function(t){this.column.getQuery().changeColumnType(this.column,i.ExprTag.AggregateFunction,{funcId:t}),this.fireColumnChanged()},e.prototype.changeColumnTypeHandler=function(t){var e=this;this.functionMenu.showMenu({anchor:t.target,selectedIds:null,itemSelectedCallback:function(t,n){return"CUSTOMSQL"==t.id?e.changeTypeToCustomSql():e.changeTypeToAggr(t.id),!1},menuClosedCallback:function(){e.keepShowingButtons=!1,e.isMouseOverBlock||e.element.dispatchEvent(Object(r.createBrowserEvent)("mouseleave"))}})},e}(s.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var o=n(1),i=n(3),r=function(){function t(t){this.element=t||Object(o.domel)("div").toDOM()}return t.prototype.refresh=function(){this.render()},t.prototype.render=function(t){var e=this;return void 0===t&&(t=!1),this.labelElement=this.renderLabelElement(),Object(o.domel)(this.element).html("").addClass(this.getClassesToAdd()).addClass(i.a.getMobileCssClass()).addChildElement(this.labelElement),this.isEditable()&&(this.renderEditor(),t&&setTimeout((function(){return e.showEditor()}),50)),this.element},t.prototype.isEditable=function(){return!0},t.prototype.renderLabelElement=function(){var t=this,e=this.getLabelText();return this.isEditable()?Object(o.domel)("a").attr("href","javascript:void(0)").title(e).text(e).on("click",(function(e){return e.preventDefault(),t.showEditor(),!1})).toDOM():Object(o.domel)("span").title(e).text(e).toDOM()},t.prototype.getClassesToAdd=function(){return""},t.prototype.getLabelText=function(){return this.getEmptyText()},t.prototype.getEmptyText=function(){return"<empty>"},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var o,i=n(42),r=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t){function e(e){return t.call(this,e)||this}return r(e,t),e.prototype.showEditor=function(){var t=this,e=this.getMenu();e&&e.showMenu({anchor:this.labelElement,itemSelectedCallback:function(e){return t.itemSelected(e.id),!1}})},e.prototype.closeEditor=function(){var t=this.getMenu();t&&t.hideMenu()},e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var o,i=n(2),r=n(0),s=n(1),a=n(86),l=n(9),u=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c=function(){return c=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},c.apply(this,arguments)},d=function(t){function e(e){var n=t.call(this,e)||this;return n.hasCustomTotalsSettings=!1,n.options={autoRefresh:!0},n.group=i.WidgetGroup.Result,n}return u(e,t),e.prototype.getWidgetType=function(){return"easyGrid"},e.prototype.init=function(e,n){var o=this;t.prototype.init.call(this,e,n);var i=c(c({},n),{slot:this.slot,dataTable:e.resultTable});this.options=r.utils.assign(this.options,n),i.onPlusButtonClick=function(t){return o.addColumnClickHandler(t)},i.onColumnMoved=function(t){return o.columnMovedHandler(t)},i.aggregates?this.hasCustomTotalsSettings=!0:i.aggregates={settings:e.getQuery().getAggregationSettings(),calculator:null},i.aggregates.calculator=this.context.getServices().getAggregatesCalculator(),this.destroy(),this.grid=new s.EasyGrid(i),this.options.autoRefresh&&this.attachQueryObserver()},e.prototype.refreshCore=function(){this.clear(),this.updateTotalsSettings(),this.render()},e.prototype.render=function(){this.createEntitiesMenu(),this.grid.refresh()},e.prototype.attachQueryObserver=function(){},e.prototype.destroyCore=function(){this.detachQueryObserver(),this.grid&&this.grid.destroy(),this.slot.innerHTML=""},e.prototype.detachQueryObserver=function(){this.queryEventCallbackId&&this.getContext().getQuery().removeChangedCallback(this.queryEventCallbackId)},e.prototype.updateTotalsSettings=function(){var t=this.getContext();if(!this.hasCustomTotalsSettings){var e=t.getQuery().getAggregationSettings();this.grid.options.aggregates.settings=e}},e.prototype.createEntitiesMenu=function(){var t=this.getContext().getModel();if(t&&!t.isEmpty()){var e=this.slot.id;e&&(e+="-EntitiesMenu");var n={items:t.getEntitiesTree({addUIC:!1,addUIR:!0,addUIS:!1}),id:e};r.utils.assign(n,this.options.menuOptions),this.entitiesMenu=new l.a(n)}},e.prototype.getModel=function(){return this.context.getModel()},e.prototype.getQuery=function(){return this.context.getQuery()},e.prototype.clear=function(){this.grid&&this.grid.clear()},e.prototype.addColumnClickHandler=function(t){var e=this;this.entitiesMenu.showMenu({anchor:t.sourceEvent.target,selectedIds:null,itemSelectedCallback:function(t,n){var o=t.id;return e.addNewColumn(o),!1}})},e.prototype.columnMovedHandler=function(t){var e=this.getQuery(),n=r.utils.findItemIndexById(e.getColumns(),t.columnId);n>=0&&(e.moveColumn(n,t.newIndex),e.fireChangedEvent({part:i.QueryChangePart.Columns,action:i.QueryChangeAction.All,source:this}))},e.prototype.addNewColumn=function(t){var e=this,n=this.getContext().getModel(),o=this.getContext().getQuery();if(this.getContext().getQuery())return this.addColumn(function(t){var r=n.getAttributeById(t);if(!r)return null;if(!r.useInSorting){if(!r.lookupAttr)return null;if(t=r.lookupAttr,!(r=n.getAttributeById(t))||!r.useInSorting)return null}var s=o.createColumn();return s.caption=e.getDefaultColumnCaption(r),s.sorting=i.SortDirection.None,s.sortIndex=-1,s.expr.tag=i.ExprTag.EntityAttribute,s.expr.setValue(t,!0),s.params.concat(r.params),s}(t))},e.prototype.getDefaultColumnCaption=function(t){var e=this.options.titleElementFormat||this.options.attrElementFormat;return this.getContext().getModel().getAttributeText(t,e)},e.prototype.addColumn=function(t){var e=this.getContext().getQuery();if(e&&(t=this.checkColumn(t)))return t=e.addColumn({caption:t.caption,attributeId:t.expr.value,sorting:t.sorting,sortIndex:t.sortIndex}),e.fireChangedEvent({part:i.QueryChangePart.Columns,action:i.QueryChangeAction.Add,changee:t,source:this}),t},e.prototype.checkColumn=function(t){for(var e=this.getContext().getQuery().getColumns(),n=JSON.stringify(t.expr.saveToData()),o=0;o<e.length;o++){if(JSON.stringify(e[o].expr.saveToData())===n)return null}return t},e}(a.a)},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return r}));var o=n(1),i=n(2),r=function(){function e(t){this.context=t,this.promise=null}return e.prototype.show=function(e){var n=this;if(void 0===e&&(e=null),!this.promise){var r=this.context.getExportFormats();if(0==r.length)throw Error("No exporter has been registered.");e=e||r[0],this.promise=new t((function(t,r){var s=n.context.getServices().getDialogService(),a=Object(o.domel)("div").addClass("kdlg-form-section").addChild("div",(function(t){return t.addClass("kfrm-form").addChild("div",(function(t){return t.addClass("kfrm-fields col-a-1 label-align-right").addChild("label",(function(t){return t.addClass("kdlg-form-label","kflex-20").attr("for","export_format").addText(i.i18n.getText("ExportDlgFmtLabel"))})).addChild("div",(function(t){return t.addClass("kfrm-select").addChild("select",(function(t){t.attr("name","export_format").id("exportFormat");for(var o=0,r=n.context.getExportFormats();o<r.length;o++){var s=r[o];t.addOption({value:s,title:i.i18n.getText(s)||s,selected:e==s})}}))}))}))})).toDOM();s.open({title:i.i18n.getText("ExportDlgTitle"),body:a,onSubmit:function(){var e=a.querySelector("#exportFormat").value;return n.context.exportResult({format:e,success:t,error:r}),!0}})}))}return this.promise.finally((function(){return n.promise=null}))},e}()}).call(this,n(56))},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var o,i=n(1),r=n(47),s=n(5),a=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(e){var n=t.call(this,e)||this;return n.colors=["#4dc9f6","#f67019","#f53794","#537bc4","#acc236","#166a8f","#00a950","#58595b","#8549ba"],n.chartLabels=[],n.chartColumns=[],n.hasChartTypes=[s.a.Column,s.a.Bar,s.a.Area,s.a.Line,s.a.SteppedLine,s.a.Doughnut,s.a.Polar,s.a.Radar,s.a.Pie],n.options.legend={show:!1,position:"bottom"},n}return a(e,t),e.prototype.getWidgetType=function(){return"chartChartJs"},e.hasChartJs=function(){return"undefined"!=typeof Chart},e.prototype.canDraw=function(){return e.hasChartJs()},e.prototype.initChart=function(){e.hasChartJs()&&this.labelColumn>=0&&this.dataColumns&&this.dataColumns.length>0&&this.updateChartColumns()},e.prototype.drawCore=function(){if(e.hasChartJs()&&this.dataTable&&this.dataTable.getCachedCount()>0){var t=this.generateConfig(),n=this.getChartCanvas(this.chartDiv).getContext("2d");new Chart(n,t)}},e.prototype.updateChartColumns=function(){if(this.dataTable){this.chartLabels=[],this.chartColumns=[];for(var t=this.dataTable.getCachedRows(),e=0;e<t.length;e++)this.chartLabels.push(t[e].getValue(this.labelColumn)),this.chartColumns.push(t[e].getValue(this.dataColumns[0]))}},e.prototype.getChartCanvas=function(t){var e=t.getElementsByTagName("canvas");return e&&e.length>0?e[0]:Object(i.addElement)(t,"canvas")},e.prototype.generateConfig=function(){var t,e=[],n=this.dataTable.columns.get(this.dataColumns[0]).label,o=!0;if(this.chartType==s.a.Pie||this.chartType==s.a.Doughnut||this.chartType==s.a.Polar||this.chartType==s.a.Bar||this.chartType==s.a.Column)for(var i=0;i<this.chartLabels.length;i++)e.push(this.colors[i%this.colors.length]);else e=[this.colors[3]];this.chartType!=s.a.Line&&this.chartType!=s.a.SteppedLine||(o=!1,t=this.colors[3]),this.options.legend=this.options.legend||{};var r={data:this.chartColumns,backgroundColor:e,borderColor:t,label:n,fill:o};this.chartType==s.a.SteppedLine&&(r.stepped=this.chartType===s.a.SteppedLine,r.steppedLine=this.chartType===s.a.SteppedLine);var a=this.options.legend.show&&(this.chartType==s.a.Pie||this.chartType==s.a.Radar||this.chartType==s.a.Polar||this.chartType==s.a.Doughnut);return{type:this.getChartType(),data:{datasets:[r],labels:this.chartLabels},options:{legend:{display:a,position:this.options.legend.position||"bottom"},title:{display:!0,text:n}}}},e.prototype.getChartType=function(){switch(this.chartType){case s.a.Column:return"bar";case s.a.Bar:return"horizontalBar";case s.a.Area:case s.a.SteppedLine:case s.a.Line:return"line";case s.a.Doughnut:return"doughnut";case s.a.Polar:return"polarArea";case s.a.Radar:return"radar";case s.a.Pie:default:return"pie"}},e}(r.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var o,i=n(2),r=n(0),s=n(1),a=n(5),l=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=function(t){function e(e){var n=t.call(this,e)||this;return n.chartType=a.a.Pie,n.supportedChartTypes=[],n.dataTable=null,n.potentialLabelColumns=[],n.potentialDataColumns=[],n.labelColumn=-1,n.dataColumns=[],n.options={chartType:a.a.Pie,showOnPaging:!1,hideSettings:!1,legend:{show:!1,position:"right"}},n.element=e,n.group=i.WidgetGroup.Result,n}return l(e,t),Object.defineProperty(e.prototype,"cssPrefix",{get:function(){return"eqjs-chart"},enumerable:!0,configurable:!0}),e.prototype.init=function(e,n){t.prototype.init.call(this,e,n),this.dataTable=e.resultTable,this.setOptions(n)},e.prototype.hasData=function(){var t=null!=this.dataTable;return t&&(t=this.dataTable.getCachedCount()>0),t},e.prototype.hasColumnsForChart=function(){return this.potentialLabelColumns.length>0&&this.potentialDataColumns.length>0},e.prototype.refreshCore=function(){this.prepareChartData(),this.render()},e.prototype.setOptions=function(t){if(r.utils.assignDeep(this.options,t),this.supportedChartTypes=this.getSupportedChartTypes(),0==this.supportedChartTypes.length)throw Error("Chart widget should support at least one chart type");t.chartType&&this.supportedChartTypes.indexOf(t.chartType)>=0?this.chartType=t.chartType:this.chartType=this.supportedChartTypes[0]},e.prototype.getOptions=function(){return this.options},e.prototype.getChartTypeName=function(t){switch(t){case a.a.Area:return r.i18n.getText("ChartType","Area");case a.a.Bar:return r.i18n.getText("ChartType","Bar");case a.a.Column:return r.i18n.getText("ChartType","Column");case a.a.Combo:return r.i18n.getText("ChartType","Combo");case a.a.Doughnut:return r.i18n.getText("ChartType","Doughnut");case a.a.Polar:return r.i18n.getText("ChartType","Polar");case a.a.Radar:return r.i18n.getText("ChartType","Radar");case a.a.Histogram:return r.i18n.getText("ChartType","Histogram");case a.a.Line:return r.i18n.getText("ChartType","Line");case a.a.SteppedLine:return r.i18n.getText("ChartType","SteppedLine");default:return r.i18n.getText("ChartType","Pie")}},e.prototype.updateSettings=function(t,e){void 0===e&&(e=!0),void 0!==t.showLegend&&(this.options.legend=this.options.legend||{},this.options.legend.show=t.showLegend),this.chartType=t.type,this.labelColumn=t.labelColumn,this.dataColumns[0]=t.dataColumn,e&&this.updateChartColumns()},e.prototype.prepareChartData=function(){var t=this;if(this.dataTable){this.potentialLabelColumns=[],this.potentialDataColumns=[];for(var e=this.dataTable.columns.count,n=0;n<e;n++){var o=this.dataTable.columns.get(n),i=o.type,s=o.label;this.potentialLabelColumns.push({idx:n,label:s}),r.utils.isNumericType(i)&&this.potentialDataColumns.push({idx:n,label:s})}if(-1!=this.labelColumn?this.potentialLabelColumns.filter((function(e){return e.idx==t.labelColumn})).length||(this.labelColumn=-1):this.labelColumn=this.potentialLabelColumns.length>0?this.potentialLabelColumns[0].idx:-1,this.dataColumns.length){var a=this.potentialDataColumns.map((function(t){return t.idx}));this.dataColumns=this.dataColumns.filter((function(t){return a.indexOf(t)>=0})),this.dataColumns.length||(this.dataColumns=this.potentialDataColumns.length>0?[].concat(this.potentialDataColumns[0].idx):[])}else this.dataColumns=this.potentialDataColumns.length>0?[].concat(this.potentialDataColumns[0].idx):[];this.initChart()}},e.prototype.getSupportedChartTypes=function(){var t=this;return(this.options.supportedChartTypes?this.options.supportedChartTypes:Object.keys(a.a).map((function(t){return a.a[t]}))).filter((function(e){return t.hasChartTypes.indexOf(e)>=0}))},e.prototype.getCurrentChartType=function(){return this.chartType},e.prototype.render=function(){var t=this;if(this.clear(),this.hasData()&&this.hasColumnsForChart()&&this.context.resultTable.getTotal()==this.context.resultTable.getCachedCount()){var e=document.createElement("div");Object(s.addCssClass)(e,this.cssPrefix+"-header");var n=document.createElement("div");if(Object(s.addCssClass)(n,this.cssPrefix+"-main"),this.canDraw()){for(var o=document.createElement("select"),i=0,r=this.supportedChartTypes;i<r.length;i++){var a=r[i],l=document.createElement("option");l.value=a.toString(),l.text=this.getChartTypeName(a),o.appendChild(l)}o.value=this.chartType.toString(),e.appendChild(o),o.addEventListener("change",(function(e){var n=e.target.value;t.chartType=parseInt(n),t.refresh()})),this.settingsDiv=document.createElement("div"),Object(s.addCssClass)(this.settingsDiv,this.cssPrefix+"-settings"),Object(s.hideElement)(this.settingsDiv),n.appendChild(this.settingsDiv),this.chartDiv=document.createElement("div"),Object(s.addCssClass)(this.chartDiv,this.cssPrefix+"-content"),Object(s.hideElement)(this.chartDiv),n.appendChild(this.chartDiv),this.initSettingsDiv();var u=document.createElement("div");Object(s.addCssClass)(u,this.cssPrefix+"-settings-icon"),u.title="Settings",e.appendChild(u),u.addEventListener("click",(function(e){t.toggleSettings()})),this.drawChart(100)}else this.addContentDiv(n,"Unable to render the chart. None of the supported chart libraries (ChartJS, Google Charts, etc) is found.");this.options.hideSettings||this.element.appendChild(e),this.element.appendChild(n),this.element.style.display=""}else this.element.style.display="none"},e.prototype.addContentDiv=function(t,e){var n=document.createElement("div");Object(s.addCssClass)(n,this.cssPrefix+"-no-data"),n.innerText=e,t.appendChild(n)},e.prototype.clear=function(){this.element.innerHTML=""},e.prototype.drawChart=function(t){var e=this;Object(s.showElement)(this.chartDiv),t>0?setTimeout((function(){return e.drawCore()}),t):this.drawCore()},e.prototype.initSettingsDiv=function(){var t=this,e=document.createElement("div");e.textContent="SETTINGS",Object(s.addCssClass)(e,this.cssPrefix+"-settings-header"),this.settingsDiv.appendChild(e);var n=document.createElement("div");Object(s.addCssClass)(n,this.cssPrefix+"-settings-single"),this.settingsDiv.appendChild(n);var o=document.createElement("span");Object(s.showElement)(o),o.textContent="Label column",n.appendChild(o);var i=document.createElement("select");Object(s.showElement)(i),n.appendChild(i);for(var r=0,a=this.potentialLabelColumns;r<a.length;r++){var l=a[r];(f=document.createElement("option")).value=l.idx.toString(),f.text=l.label,i.appendChild(f)}this.labelColumn>=0&&(i.value=this.labelColumn.toString()),i.addEventListener("change",(function(e){t.labelColumn=parseInt(e.target.value),t.updateChartColumns(),t.toggleSettings((function(){t.drawChart(100)}))}));var u=document.createElement("div");Object(s.addCssClass)(u,this.cssPrefix+"-settings-single"),this.settingsDiv.appendChild(u);var c=document.createElement("span");Object(s.showElement)(c),c.textContent="Data column",u.appendChild(c);var d=document.createElement("select");Object(s.showElement)(d),u.appendChild(d);for(var h=0,p=this.potentialDataColumns;h<p.length;h++){var f;l=p[h];(f=document.createElement("option")).value=l.idx.toString(),f.text=l.label,d.appendChild(f)}this.dataColumns.length>0&&this.dataColumns[0]>=0&&(d.value=this.dataColumns[0].toString()),d.addEventListener("change",(function(e){t.dataColumns[0]=parseInt(e.target.value),t.updateChartColumns(),t.toggleSettings((function(){t.drawChart(100)}))}))},e.prototype.getPotentialLabelColumns=function(){return this.potentialLabelColumns},e.prototype.getPotentialDataColumns=function(){return this.potentialDataColumns},e.prototype.getLabelColumnIndex=function(){return this.labelColumn},e.prototype.getDataColumnIndex=function(){return this.dataColumns[0]},e.prototype.toggleSettings=function(t){var e,n;Object(s.isVisible)(this.chartDiv)?(e=this.chartDiv,n=this.settingsDiv):(e=this.settingsDiv,n=this.chartDiv),Object(s.toggleVisibility)(e,n,{complete:t})},e}(i.Widget)},function(t,e,n){"use strict";function o(t,e){for(var n="",o=0;o<e;o++)n+=t;return n}function i(t){return t.split("").reverse().join("")}function r(t,e){return t&&t.lastIndexOf(e)==t.length-e.length}function s(t,e){var n=t;return null!=n&&n.length>0?("/"!=n.charAt(n.length-1)&&(n+="/"),n+=e):n=e,n}n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return i})),n.d(e,"d",(function(){return r})),n.d(e,"a",(function(){return s}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var o=function(){function t(t,e){this.columns=t,this.values=e}return t.prototype.toArray=function(){return Array.from(this.values)},t.prototype.size=function(){return this.values.length},t.prototype.getValue=function(t){var e;if("string"==typeof t){if(void 0===(e=this.columns.getIndex(t)))throw new RangeError("No column with id '"+t+"'")}else e=t;if(e>=this.values.length)throw new RangeError("Out of range: "+e);return this.values[e]},t.prototype.setValue=function(t,e){var n;if("string"==typeof t){if(void 0===(n=this.columns.getIndex(t)))throw new RangeError("No column with id '"+t+"'")}else n=t;if(n>=this.values.length)throw new RangeError("Out of range: "+n);this.values[n]=e},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var o=n(0),i=n(20),r=n(12),s=n(16),a=n(19),l=n(8),u=n(13),c=n(21),d=n(27),h=n(62),p=function(){function t(t,e){this.query=t,this.linkType=s.a.All,this.parent=null,this._id=o.utils.generateId("cond"),this.justAdded=!1,this.tag=e||a.a.Unknown,this.enabled=!0,this.operatorId="",this.blockId="",this.expressions=new Array,this.conditions=new Array}return Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"enabled",{get:function(){return this._enabled&&(!this.getParent()||this.getParent().enabled)},set:function(t){this._enabled=t&&(!this.getParent()||this.getParent().enabled),this.conditions&&this.conditions.forEach((function(e){e.enabled=t}))},enumerable:!0,configurable:!0}),t.prototype.getQuery=function(){return this.query},t.prototype.getModel=function(){return this.query.getModel()},t.prototype.getParent=function(){return this.parent},t.prototype.setParent=function(t){this.parent=t},t.prototype.getConditions=function(){return this.conditions},t.prototype.isEmpty=function(){return 0===this.conditions.length},t.prototype.isGroup=function(){return this.tag==a.a.Group||null==this.parent},t.prototype.getLevel=function(){var t=this.getParent();return t?t.getLevel()+1:0},t.prototype.isReadOnly=function(){return!1},t.prototype.setReadOnly=function(t){},t.prototype.isParameterized=function(){return!1},t.prototype.setParameterized=function(t){},t.prototype.isInJoin=function(){return!1},t.prototype.setInJoin=function(t){},t.prototype.clearConditions=function(){this.conditions=[]},t.prototype.addCondition=function(t){return t.setParent(this),this.conditions.push(t)},t.prototype.removeConditionAt=function(t){this.conditions.splice(t,1)},t.prototype.loadFromData=function(t,e){if(e){if(this.tag=e.tag,this.tag||(this.tag=!this.parent||this.conditions.length>0?a.a.Group:a.a.Simple),void 0!==e.enabled&&(this.enabled=e.enabled),void 0!==e.disabled&&(this.enabled=!e.disabled),this.tag==a.a.Simple&&(this.operatorId=e.op,e.exprs))for(var n=0;n<e.exprs.length;n++){var o=new i.a(this);o.loadFromData(t,e.exprs[n]),this.expressions.push(o)}this.linkType=e.linking}},t.prototype.saveToData=function(){var t={};if(t.tag=this.tag,this.enabled||(t.enabled=this.enabled),this.tag==a.a.Simple){t.op=this.operatorId,t.exprs=[];for(var e=0;e<this.expressions.length;e++)t.exprs.push(this.expressions[e].saveToData())}return this.tag==a.a.Group&&(t.linking=this.linkType),t},t.prototype.fireChangedEvent=function(t){void 0===t&&(t=h.a.All),this.query.fireChangedEvent({part:u.b.Conditions,action:u.a.Modify,changee:this,condPart:t})},t.prototype.getExpressionIndex=function(t){return this.expressions.indexOf(t,0)},t.prototype.expressionChanged=function(t,e){0==t.getIndex()&&t.tag==l.a.EntityAttribute&&this.tuneOperatorForAttr(t.value)},t.prototype.getOperatorId=function(){return this.operatorId},t.prototype.setOperatorId=function(t,e){void 0===e&&(e=!1);var n=this.operatorId;if(this.operatorId=t,!e){var o=this.getModel(),i=o.getOperatorById(t),r=this.expressions[0].value,s=o.getAttributeById(r);this.tuneValueExpressions(s,i,s.id,n)}},t.prototype.tuneOperatorForAttr=function(t){var e=this.getModel(),n=this.expressions[0].value,o=e.getAttributeById(n);if(null!=o){var i=this.getModel().getDefaultOperatorForAttr(o),r=this.operatorId;this.operatorId=i.id,this.tuneValueExpressions(o,i,t,r)}},t.prototype.tuneValueExpressions=function(t,e,n,i){var r=this.getModel();if(e){var s=this.expressions.length,a=(n&&r.getAttributeById(n),null);if(i&&(a=r.getOperatorById(i)),a&&a.paramCount==e.paramCount){for(var l=1;l<e.paramCount;){var u=r.getOperand(t,a,l);(g=r.getOperand(t,e,l)).dataType==o.DataType.Unknown&&(g.dataType=t.dataType);var d=g.editor&&g.editor.tag!==o.EditorTag.Unknown?g.editor:t.defaultEditor&&t.defaultEditor.tag!==o.EditorTag.Unknown?t.defaultEditor:new c.a;if(l>=s){var h=this.createValueExpr(g);this.expressions.push(h)}else{var p=this.expressions[l],f=this.createValueExpr(g);this.areCompitableEditors(u.editor,d)&&f.tryCopyValueFrom(p),this.expressions[l]=f}l++}s>l&&this.expressions.splice(l,s-l)}else{this.expressions.splice(1,this.expressions.length-1);for(l=1;l<e.paramCount;l++){var g;(g=r.getOperand(t,e,l)).dataType==o.DataType.Unknown&&(g.dataType=t.dataType);h=this.createValueExpr(g);this.expressions.push(h)}}}},t.prototype.areCompitableEditors=function(t,e){return e.tag!=d.a.CustomList&&e.tag!=d.a.List&&e.tag!=d.a.SqlList&&e.tag!=o.EditorTag.Unknown},t.prototype.addExpressionByOperand=function(t,e){void 0===e&&(e=null);var n=this.createValueExpr(t,e);return this.expressions.push(n),n},t.prototype.createValueExpr=function(t,e){void 0===e&&(e=null);var n=null==e,o=e||t.defValue,s=e||t.defText,a=new i.a(this);if(t.kind===r.a.Query)a.tag=l.a.Query,a.dataType=t.dataType,a.kind=t.kind,a.setContent(o,s,!0);else if(t.kind===r.a.Attribute){if(!n){var u=this.getModel().getFirstAttributeByFilter((function(e){return 1==e.useInConditions&&(!t.dataType||e.dataType==t.dataType)}));o=u?u.id:null}a.tag=l.a.EntityAttribute,a.kind=t.kind,a.dataType=t.dataType,a.setContent(o,s,!0)}else n&&(o=t.defValue&&""!=t.defValue?t.defValue:t.editor&&t.editor.defValue?t.editor.defValue:"",t.editor&&(s=t.editor.getValueText(o))),a.tag=l.a.Constant,a.dataType=t.dataType,a.kind=t.kind,a.setContent(o,s,!0),a._isDefaultValue=n;return a},t}()},function(t,e,n){(function(e,n){var o;o=function(){"use strict";function t(t){return"function"==typeof t}var o=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},i=0,r=void 0,s=void 0,a=function(t,e){f[i]=t,f[i+1]=e,2===(i+=2)&&(s?s(g):C())},l="undefined"!=typeof window?window:void 0,u=l||{},c=u.MutationObserver||u.WebKitMutationObserver,d="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function p(){var t=setTimeout;return function(){return t(g,1)}}var f=new Array(1e3);function g(){for(var t=0;t<i;t+=2)(0,f[t])(f[t+1]),f[t]=void 0,f[t+1]=void 0;i=0}var y,m,v,b,C=void 0;function x(t,e){var n=this,o=new this.constructor(E);void 0===o[T]&&L(o);var i=n._state;if(i){var r=arguments[i-1];a((function(){return B(i,o,r,n._result)}))}else A(n,o,t,e);return o}function w(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(E);return k(e,t),e}d?C=function(){return e.nextTick(g)}:c?(m=0,v=new c(g),b=document.createTextNode(""),v.observe(b,{characterData:!0}),C=function(){b.data=m=++m%2}):h?((y=new MessageChannel).port1.onmessage=g,C=function(){return y.port2.postMessage(0)}):C=void 0===l?function(){try{var t=Function("return this")().require("vertx");return void 0!==(r=t.runOnLoop||t.runOnContext)?function(){r(g)}:p()}catch(t){return p()}}():p();var T=Math.random().toString(36).substring(2);function E(){}var D=void 0;function S(e,n,o){n.constructor===e.constructor&&o===x&&n.constructor.resolve===w?function(t,e){1===e._state?I(t,e._result):2===e._state?O(t,e._result):A(e,void 0,(function(e){return k(t,e)}),(function(e){return O(t,e)}))}(e,n):void 0===o?I(e,n):t(o)?function(t,e,n){a((function(t){var o=!1,i=function(t,e,n,o){try{t.call(e,n,o)}catch(t){return t}}(n,e,(function(n){o||(o=!0,e!==n?k(t,n):I(t,n))}),(function(e){o||(o=!0,O(t,e))}),t._label);!o&&i&&(o=!0,O(t,i))}),t)}(e,n,o):I(e,n)}function k(t,e){if(t===e)O(t,new TypeError("You cannot resolve a promise with itself"));else if(i=typeof(o=e),null===o||"object"!==i&&"function"!==i)I(t,e);else{var n=void 0;try{n=e.then}catch(e){return void O(t,e)}S(t,e,n)}var o,i}function M(t){t._onerror&&t._onerror(t._result),P(t)}function I(t,e){t._state===D&&(t._result=e,t._state=1,0!==t._subscribers.length&&a(P,t))}function O(t,e){t._state===D&&(t._state=2,t._result=e,a(M,t))}function A(t,e,n,o){var i=t._subscribers,r=i.length;t._onerror=null,i[r]=e,i[r+1]=n,i[r+2]=o,0===r&&t._state&&a(P,t)}function P(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var o=void 0,i=void 0,r=t._result,s=0;s<e.length;s+=3)o=e[s],i=e[s+n],o?B(n,o,i,r):i(r);t._subscribers.length=0}}function B(e,n,o,i){var r=t(o),s=void 0,a=void 0,l=!0;if(r){try{s=o(i)}catch(t){l=!1,a=t}if(n===s)return void O(n,new TypeError("A promises callback cannot return that same promise."))}else s=i;n._state!==D||(r&&l?k(n,s):!1===l?O(n,a):1===e?I(n,s):2===e&&O(n,s))}var _=0;function L(t){t[T]=_++,t._state=void 0,t._result=void 0,t._subscribers=[]}var R=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(E),this.promise[T]||L(this.promise),o(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?I(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&I(this.promise,this._result))):O(this.promise,new Error("Array Methods must be provided an Array"))}return t.prototype._enumerate=function(t){for(var e=0;this._state===D&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,o=n.resolve;if(o===w){var i=void 0,r=void 0,s=!1;try{i=t.then}catch(t){s=!0,r=t}if(i===x&&t._state!==D)this._settledAt(t._state,e,t._result);else if("function"!=typeof i)this._remaining--,this._result[e]=t;else if(n===F){var a=new n(E);s?O(a,r):S(a,t,i),this._willSettleAt(a,e)}else this._willSettleAt(new n((function(e){return e(t)})),e)}else this._willSettleAt(o(t),e)},t.prototype._settledAt=function(t,e,n){var o=this.promise;o._state===D&&(this._remaining--,2===t?O(o,n):this._result[e]=n),0===this._remaining&&I(o,this._result)},t.prototype._willSettleAt=function(t,e){var n=this;A(t,void 0,(function(t){return n._settledAt(1,e,t)}),(function(t){return n._settledAt(2,e,t)}))},t}(),F=function(){function e(t){this[T]=_++,this._result=this._state=void 0,this._subscribers=[],E!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof e?function(t,e){try{e((function(e){k(t,e)}),(function(e){O(t,e)}))}catch(e){O(t,e)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(t){return this.then(null,t)},e.prototype.finally=function(e){var n=this,o=n.constructor;return t(e)?n.then((function(t){return o.resolve(e()).then((function(){return t}))}),(function(t){return o.resolve(e()).then((function(){throw t}))})):n.then(e,e)},e}();return F.prototype.then=x,F.all=function(t){return new R(this,t).promise},F.race=function(t){var e=this;return o(t)?new e((function(n,o){for(var i=t.length,r=0;r<i;r++)e.resolve(t[r]).then(n,o)})):new e((function(t,e){return e(new TypeError("You must pass an array to race."))}))},F.resolve=w,F.reject=function(t){var e=new this(E);return O(e,t),e},F._setScheduler=function(t){s=t},F._setAsap=function(t){a=t},F._asap=a,F.polyfill=function(){var t=void 0;if(void 0!==n)t=n;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var o=null;try{o=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===o&&!e.cast)return}t.Promise=F},F.Promise=F,F},t.exports=o()}).call(this,n(54),n(55))},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var o,i=n(0),r=n(2),s=n(1),a=n(26),l=n(3),u=n(10),c=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=function(t){function e(e,n,o,i){var r=t.call(this,e,n,null,i)||this;return r.menu=o,r}return c(e,t),e.prototype.renderEditor=function(){},e.prototype.getLabelText=function(){var t=this.panel.getContext().getModel(),e=this.expression.value,n=e?t.getAttributeByIdSafe(e):null,o=this.panel.options.attrElementFormat;return n?t.getAttributeText(n,o):this.getEmptyText()},e.prototype.setValue=function(e,n){void 0===n&&(n=!1),n=n&&e!==this.expression.value;var o=t.prototype.setValue.call(this,e,!0);return n||this.expression.getParent().fireChangedEvent(r.ConditionPart.EntityAttr|r.ConditionPart.Operator),o},e.prototype.isEditable=function(){return!this.isReadOnly()&&(this.panel.options.editableParts&u.a.Attribute)===u.a.Attribute},e.prototype.getEmptyText=function(){return this.panel.options.emptyTextAttribute||i.i18n.getText("MsgEmptyAttrValue")},e.prototype.getClassesToAdd=function(){return this.cssPrefix+"-condelement "+this.cssPrefix+"-attrelement"},e.prototype.adjustWidth=function(){l.a.isMobileMode()||this.element.clientWidth>this.element.parentElement.clientWidth/2&&Object(s.domel)(this.element).addClass(this.cssPrefix+"-attrelement-wide")},e}(a.b)},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var o,i=n(0),r=n(47),s=n(5),a=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(e){var n=t.call(this,e)||this;return n.hasChartTypes=[s.a.Column,s.a.Bar,s.a.Histogram,s.a.Combo,s.a.Area,s.a.Line,s.a.SteppedLine,s.a.Pie,s.a.Doughnut],n.options.legend={show:!0,position:"right"},n}return a(e,t),e.prototype.getWidgetType=function(){return"chartGoogle"},e.prototype.canDraw=function(){return e.hasGoogleCharts()},e.hasGoogleCharts=function(){return"undefined"!=typeof google&&void 0!==google.charts},e.prototype.initChart=function(){e.hasGoogleCharts()&&this.labelColumn>=0&&this.dataColumns&&this.dataColumns.length>0&&(this.googleDataView=new google.visualization.DataView(this.convertToGoogleFormat()),this.updateChartColumns())},e.prototype.convertToGoogleType=function(t){switch(t){case i.DataType.Date:return"date";case i.DataType.DateTime:return"datetime";case i.DataType.Time:return"timeofday";case i.DataType.Byte:case i.DataType.Word:case i.DataType.Int32:case i.DataType.Int64:case i.DataType.Currency:case i.DataType.Float:return"number";default:return"string"}},e.prototype.convertToGoogleValue=function(t,e){return e===i.DataType.Bool?t?t.toString():null:t},e.prototype.convertToGoogleFormat=function(){for(var t=new google.visualization.DataTable,e=this.dataTable.columns,n=0;n<e.count;n++){var o=e.get(n);t.addColumn(this.convertToGoogleType(o.type),o.label,o.id)}var i=this.dataTable.getCachedRows();t.addRows(i.length);for(n=0;n<i.length;n++)for(var r=i[n],s=0;s<e.count;s++)t.setCell(n,s,this.convertToGoogleValue(r.getValue(s),e.get(s).type));return t},e.prototype.drawCore=function(){if(null!=this.googleDataView){this.options.legend=this.options.legend||{};var t={width:"100%",height:"100%",chartArea:{width:this.getChartAreaWidth}};this.chartType==s.a.Doughnut&&(t.pieHole=.4),this.options.legend.show?t.legend={position:this.options.legend.position}:t.legend="none",this.createChart(this.chartDiv).draw(this.googleDataView,t)}},e.prototype.getChartAreaWidth=function(t){return t==s.a.Pie?"100%":"50%"},e.prototype.updateChartColumns=function(){this.googleDataView&&this.googleDataView.setColumns([].concat(this.labelColumn).concat(this.dataColumns))},e.prototype.createChart=function(t){switch(this.chartType){case s.a.Column:return new google.visualization.ColumnChart(t);case s.a.Histogram:return new google.visualization.Histogram(t);case s.a.Bar:return new google.visualization.BarChart(t);case s.a.Combo:return new google.visualization.ComboChart(t);case s.a.Area:return new google.visualization.AreaChart(t);case s.a.Line:return new google.visualization.LineChart(t);case s.a.SteppedLine:return new google.visualization.SteppedAreaChart(t);case s.a.Pie:case s.a.Doughnut:default:return new google.visualization.PieChart(t)}},e}(r.a)},function(t,e){var n,o,i=t.exports={};function r(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===r||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:r}catch(t){n=r}try{o="function"==typeof clearTimeout?clearTimeout:s}catch(t){o=s}}();var l,u=[],c=!1,d=-1;function h(){c&&l&&(c=!1,l.length?u=l.concat(u):d=-1,u.length&&p())}function p(){if(!c){var t=a(h);c=!0;for(var e=u.length;e;){for(l=u,u=[];++d<e;)l&&l[d].run();d=-1,e=u.length}l=null,c=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===s||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(t)}}function f(t,e){this.fun=t,this.array=e}function g(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];u.push(new f(t,e)),1!==u.length||c||a(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){(function(e,n){var o;o=function(){"use strict";function t(t){return"function"==typeof t}var o=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},i=0,r=void 0,s=void 0,a=function(t,e){f[i]=t,f[i+1]=e,2===(i+=2)&&(s?s(g):C())},l="undefined"!=typeof window?window:void 0,u=l||{},c=u.MutationObserver||u.WebKitMutationObserver,d="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function p(){var t=setTimeout;return function(){return t(g,1)}}var f=new Array(1e3);function g(){for(var t=0;t<i;t+=2)(0,f[t])(f[t+1]),f[t]=void 0,f[t+1]=void 0;i=0}var y,m,v,b,C=void 0;function x(t,e){var n=this,o=new this.constructor(E);void 0===o[T]&&L(o);var i=n._state;if(i){var r=arguments[i-1];a((function(){return B(i,o,r,n._result)}))}else A(n,o,t,e);return o}function w(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(E);return k(e,t),e}d?C=function(){return e.nextTick(g)}:c?(m=0,v=new c(g),b=document.createTextNode(""),v.observe(b,{characterData:!0}),C=function(){b.data=m=++m%2}):h?((y=new MessageChannel).port1.onmessage=g,C=function(){return y.port2.postMessage(0)}):C=void 0===l?function(){try{var t=Function("return this")().require("vertx");return void 0!==(r=t.runOnLoop||t.runOnContext)?function(){r(g)}:p()}catch(t){return p()}}():p();var T=Math.random().toString(36).substring(2);function E(){}var D=void 0;function S(e,n,o){n.constructor===e.constructor&&o===x&&n.constructor.resolve===w?function(t,e){1===e._state?I(t,e._result):2===e._state?O(t,e._result):A(e,void 0,(function(e){return k(t,e)}),(function(e){return O(t,e)}))}(e,n):void 0===o?I(e,n):t(o)?function(t,e,n){a((function(t){var o=!1,i=function(t,e,n,o){try{t.call(e,n,o)}catch(t){return t}}(n,e,(function(n){o||(o=!0,e!==n?k(t,n):I(t,n))}),(function(e){o||(o=!0,O(t,e))}),t._label);!o&&i&&(o=!0,O(t,i))}),t)}(e,n,o):I(e,n)}function k(t,e){if(t===e)O(t,new TypeError("You cannot resolve a promise with itself"));else if(i=typeof(o=e),null===o||"object"!==i&&"function"!==i)I(t,e);else{var n=void 0;try{n=e.then}catch(e){return void O(t,e)}S(t,e,n)}var o,i}function M(t){t._onerror&&t._onerror(t._result),P(t)}function I(t,e){t._state===D&&(t._result=e,t._state=1,0!==t._subscribers.length&&a(P,t))}function O(t,e){t._state===D&&(t._state=2,t._result=e,a(M,t))}function A(t,e,n,o){var i=t._subscribers,r=i.length;t._onerror=null,i[r]=e,i[r+1]=n,i[r+2]=o,0===r&&t._state&&a(P,t)}function P(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var o=void 0,i=void 0,r=t._result,s=0;s<e.length;s+=3)o=e[s],i=e[s+n],o?B(n,o,i,r):i(r);t._subscribers.length=0}}function B(e,n,o,i){var r=t(o),s=void 0,a=void 0,l=!0;if(r){try{s=o(i)}catch(t){l=!1,a=t}if(n===s)return void O(n,new TypeError("A promises callback cannot return that same promise."))}else s=i;n._state!==D||(r&&l?k(n,s):!1===l?O(n,a):1===e?I(n,s):2===e&&O(n,s))}var _=0;function L(t){t[T]=_++,t._state=void 0,t._result=void 0,t._subscribers=[]}var R=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(E),this.promise[T]||L(this.promise),o(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?I(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&I(this.promise,this._result))):O(this.promise,new Error("Array Methods must be provided an Array"))}return t.prototype._enumerate=function(t){for(var e=0;this._state===D&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,o=n.resolve;if(o===w){var i=void 0,r=void 0,s=!1;try{i=t.then}catch(t){s=!0,r=t}if(i===x&&t._state!==D)this._settledAt(t._state,e,t._result);else if("function"!=typeof i)this._remaining--,this._result[e]=t;else if(n===F){var a=new n(E);s?O(a,r):S(a,t,i),this._willSettleAt(a,e)}else this._willSettleAt(new n((function(e){return e(t)})),e)}else this._willSettleAt(o(t),e)},t.prototype._settledAt=function(t,e,n){var o=this.promise;o._state===D&&(this._remaining--,2===t?O(o,n):this._result[e]=n),0===this._remaining&&I(o,this._result)},t.prototype._willSettleAt=function(t,e){var n=this;A(t,void 0,(function(t){return n._settledAt(1,e,t)}),(function(t){return n._settledAt(2,e,t)}))},t}(),F=function(){function e(t){this[T]=_++,this._result=this._state=void 0,this._subscribers=[],E!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof e?function(t,e){try{e((function(e){k(t,e)}),(function(e){O(t,e)}))}catch(e){O(t,e)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(t){return this.then(null,t)},e.prototype.finally=function(e){var n=this,o=n.constructor;return t(e)?n.then((function(t){return o.resolve(e()).then((function(){return t}))}),(function(t){return o.resolve(e()).then((function(){throw t}))})):n.then(e,e)},e}();return F.prototype.then=x,F.all=function(t){return new R(this,t).promise},F.race=function(t){var e=this;return o(t)?new e((function(n,o){for(var i=t.length,r=0;r<i;r++)e.resolve(t[r]).then(n,o)})):new e((function(t,e){return e(new TypeError("You must pass an array to race."))}))},F.resolve=w,F.reject=function(t){var e=new this(E);return O(e,t),e},F._setScheduler=function(t){s=t},F._setAsap=function(t){a=t},F._asap=a,F.polyfill=function(){var t=void 0;if(void 0!==n)t=n;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var o=null;try{o=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===o&&!e.cast)return}t.Promise=F},F.Promise=F,F},t.exports=o()}).call(this,n(54),n(55))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var o=function(){function t(t,e){this.xhr=t,this.method=e.method,this.url=e.url,this.headers=e.headers,this.queryParams=e.queryParams,this.data=e.data}return t.prototype.setHeader=function(t,e){this.headers[t]=e},t.prototype.setQueryParam=function(t,e){this.queryParams[t]=e},t.prototype.getXMLHttpRequest=function(){return this.xhr},t.prototype.getResponseHeaders=function(){if(this.xhr.readyState==this.xhr.HEADERS_RECEIVED){for(var t={},e=0,n=this.xhr.getAllResponseHeaders().trim().split(/[\r\n]+/);e<n.length;e++){var o=n[e].split(": "),i=o.shift(),r=o.join(": ");t[i]=r}return t}return{}},t.prototype.open=function(){var t=this;if(this.xhr.readyState===this.xhr.UNSENT){var e=this.url;for(var n in this.queryParams&&Object.keys(this.queryParams).length>0&&(e+=encodeURI("?"+Object.keys(this.queryParams).map((function(e){return e+"="+t.queryParams[e]})).join("&"))),this.xhr.open(this.method,e,!0),this.xhr.setRequestHeader("X-Requested-With","XMLHttpRequest"),this.headers)this.xhr.setRequestHeader(n,this.headers[n])}},t.prototype.abort=function(){this.xhr.abort()},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return s})),n.d(e,"c",(function(){return a}));var o,i=n(7),r=n(11);!function(t){t[t.None=0]="None",t[t.Left=1]="Left",t[t.Center=2]="Center",t[t.Right=3]="Right"}(o||(o={}));var s=function(t){if(!t)throw Error("Options are required");if(!t.id)throw Error("Field Id is required");if(!t.label)throw Error("Label is required");this.id=t.id,this.type=r.a.getIfDefined(t.type,i.a.String),this.label=t.label,this.originAttrId=t.originAttrId,this.isAggr=t.isAggr||!1,this.displayFormat=t.dfmt,this.groupFooterColumnTemplate=t.gfct,this.style=t.style||{},this.description=t.description,this.calculatedWidth=0},a=function(){function t(){this.items=[],this.mapper={},this._dateColumnIdx=[]}return Object.defineProperty(t.prototype,"count",{get:function(){return this.items.length},enumerable:!0,configurable:!0}),t.prototype.add=function(t){var e;e=t instanceof s?t:new s(t);var n=this.items.length;return this.items.push(e),this.mapper[e.id]=n,[i.a.Date,i.a.DateTime,i.a.Time].indexOf(e.type)>=0&&this._dateColumnIdx.push(n),n},t.prototype.updateDateColumnIdx=function(){this._dateColumnIdx=this.getItems().filter((function(t){return[i.a.Date,i.a.DateTime,i.a.Time].indexOf(t.type)>=0})).map((function(t,e){return e}))},t.prototype.put=function(t,e){t>=0&&t<this.count&&(this.items[t]=e,this.updateDateColumnIdx())},t.prototype.move=function(t,e){var n=this.items.indexOf(t);n>=0&&n!=e&&(r.a.moveArrayItem(this.items,n,e),this.updateDateColumnIdx())},t.prototype.get=function(t){return t>=0&&t<this.count?this.items[t]:null},t.prototype.getIndex=function(t){return this.mapper[t]},t.prototype.getItems=function(){return this.items},t.prototype.getDateColumnIndexes=function(){return this._dateColumnIdx},t.prototype.removeAt=function(t){var e=this.get(t);this.items.splice(t,1);var n=this._dateColumnIdx.indexOf(t);n>=0&&this._dateColumnIdx.splice(n,1),delete this.mapper[e.id]},t.prototype.clear=function(){this.items=[],this._dateColumnIdx=[],this.mapper={}},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var o=function(){function t(t){this.start(t)}return t.prototype.start=function(t){this.formatStr=t,this.pos=0,this.exprNum=0,this.tokenText=""},t.prototype.skipSpaces=function(){for(;this.pos<this.formatStr.length&&" "===this.formatStr.charAt(this.pos);)this.pos++},t.prototype.next=function(){if(this.skipSpaces(),this.pos>=this.formatStr.length)return!1;var t=0;if("{"===this.formatStr.charAt(this.pos)){if((t=this.formatStr.indexOf("}",this.pos))<0)return!1;this.tokenText=this.formatStr.substring(this.pos,t+1),0===this.tokenText.indexOf("{expr")&&(this.token="expression",this.exprNum=parseInt(this.tokenText.substring(5,this.tokenText.length))),this.pos=t+1}else if("["===this.formatStr.charAt(this.pos)&&this.pos<this.formatStr.length-1&&"["===this.formatStr.charAt(this.pos+1))this.pos+=2,t=this.formatStr.indexOf("]]",this.pos),this.token="operator",this.tokenText=this.formatStr.substring(this.pos,t),this.pos=t+2;else{this.token="text";var e=this.formatStr.indexOf("{",this.pos);e<0&&(e=this.formatStr.length);var n=this.formatStr.indexOf("[[",this.pos);n<0&&(n=this.formatStr.length),t=Math.min(e,n),this.tokenText=this.formatStr.substring(this.pos,t).trim(),this.pos=t}return!0},t.prototype.getToken=function(){return{type:this.token,text:this.tokenText,index:this.exprNum-1}},t.prototype.parse=function(){for(var t=[];this.next();)t.push(this.getToken());return t},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var o=n(0),i=function(){function t(){this.id="",this.caption="",this.sqlExpr="",this.displayFormat="",this.appliedTypes=[]}return t.prototype.loadFromData=function(t){t&&(this.id=t.id,this.caption=t.cptn,this.displayFormat=t.fmt,this.sqlExpr=t.expr,this.appliedTypes=t.dtypes||this.appliedTypes)},t.prototype.getAppliedTypesOrDefault=function(){return this.appliedTypes.length>0?this.appliedTypes:"SUM"===this.id||"AVG"===this.id?[o.DataType.Autoinc,o.DataType.Byte,o.DataType.Currency,o.DataType.Float,o.DataType.Int32,o.DataType.Int64,o.DataType.Word]:"MIN"===this.id||"MAX"===this.id?[o.DataType.Autoinc,o.DataType.BCD,o.DataType.Byte,o.DataType.Currency,o.DataType.Date,o.DataType.DateTime,o.DataType.Time,o.DataType.Float,o.DataType.Int32,o.DataType.Int64,o.DataType.Word]:o.utils.getAllDataTypes()},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var o=function(){function t(e){void 0===e&&(e=null),this.childs=[],this.value=null,this.parent=null,e&&(Array.isArray(e)?(this.value=e[0],e.length>1&&this.addChild(new t(e.slice(1)))):e instanceof t?(this.value=e.value,this.childs=e.childs):this.value=e)}return t.prototype.contains=function(t){if(this.value===t)return!0;for(var e=0,n=this.childs;e<n.length;e++){if(n[e].contains(t))return!0}return!1},t.prototype.findNode=function(t){if(this.value===t)return this;for(var e=0,n=this.childs;e<n.length;e++){var o=n[e].findNode(t);if(o)return o}return null},t.prototype.addChild=function(t){t.parent=this,this.childs.push(t)},t.prototype.setParents=function(){for(var t=0,e=this.childs;t<e.length;t++){var n=e[t];n.parent=this,n.setParents()}},t}()},function(t,e,n){"use strict";var o;n.d(e,"a",(function(){return o})),function(t){t[t.EntityAttr=2]="EntityAttr",t[t.Operator=4]="Operator",t[t.Value=8]="Value",t[t.All=14]="All"}(o||(o={}))},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return r}));var o=n(0),i=n(29),r=function(){function e(t){this.context=t,console.warn("BrowserQueryStorage is used for managing queries")}return e.prototype.init=function(t){var e="eq";t&&t.keyPrefix&&(e=t.keyPrefix),this.queryListKey=e+"-querylist",this.queryKeyPrefix=e},e.prototype.getQueryList=function(e){var n=this;return new t((function(t,e){try{var o=localStorage.getItem(n.queryListKey);o&&t(JSON.parse(o)),t([])}catch(t){e(t)}}))},e.prototype.newQuery=function(e){var n=this;return new t((function(t,o){var r=new i.b(n.context.getModel());r.reset(),r.setDefaultName(),e&&(e.query&&r.loadFromData(e.query.toJSONData()),e.queryId&&r.setId(e.queryId),e.name&&r.setName(e.name),e.description&&r.setDescription(e.description)),n._saveQuery(r),t(r.toJSONData())}))},e.prototype.loadQuery=function(e){var n=this;return new t((function(t,o){try{var i=localStorage.getItem(n.queryKeyPrefix+"-"+e.queryId);throw i&&t(JSON.parse(i)),new Error("Query is not found: "+e.queryId)}catch(t){o(t)}}))},e.prototype.saveQuery=function(e){var n=this;return new t((function(t,o){try{e.modelId||n.context.getModel().getId();var i=e.query||n.context.getQuery();n._saveQuery(i),t(null)}catch(t){o(t)}}))},e.prototype._saveQuery=function(t){var e=[],n=localStorage.getItem(this.queryListKey);n&&(e=JSON.parse(n));var i=o.utils.findItemById(e,t.getId());i||(i={id:t.getId(),name:t.getName(),text:t.getDescription()},e.push(i)),i.name=t.getName(),i.text=t.getDescription(),localStorage.setItem(this.queryListKey,JSON.stringify(e)),localStorage.setItem(this.queryKeyPrefix+"-"+t.getId(),t.toJSON())},e.prototype.removeQuery=function(e){var n=this;return new t((function(t,o){try{e.modelId||n.context.getModel().getId();var i=e.queryId||n.context.getQuery().getId(),r=[],s=localStorage.getItem(n.queryListKey);s&&(r=JSON.parse(s)),r=r.filter((function(t){return t.id!=i})),localStorage.setItem(n.queryListKey,JSON.stringify(r)),localStorage.removeItem(n.queryKeyPrefix+"-"+i),t()}catch(t){o(t)}}))},e}()}).call(this,n(51))},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return o}));var o=function(){function e(t){this.context=t,this.modelPromise=null}return e.prototype.init=function(t){},e.prototype.getContext=function(){return this.context},e.prototype.createModelLoadingPromise=function(){var e=this;this.modelPromise=new t((function(t,n){e.modelLoadingResolveFunc=t,e.modelLoadingRejectFunc=n}))},e.prototype.getModelPromise=function(){return this.modelPromise||t.reject(new Error("Model has been never loaded."))},e.prototype.startModelLoading=function(t){return this.createModelLoadingPromise(),this.sendLoadModelRequest(t),this.modelPromise},e}()}).call(this,n(51))},function(t,e,n){"use strict";(function(t){n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return i}));var o=function(){function e(t){this.context=t,this.levels={}}return e.prototype.getAggregateData=function(e,n){var o=this;return new t((function(t,i){var r=function(e){var r=o.groupKeyToStr(n),s=e.get(r);s?t(s):i("Can't find data for "+r)},s=o.getLevelDesc(e,!1);s&&s.data?r(s.data):s.receivedCallbacks.push(r)}))},e.prototype.setAggregateData=function(t,e){var n=this.getLevelDesc(t,!0);if(n.data=e,n.receivedCallbacks)for(var o=0,i=n.receivedCallbacks;o<i.length;o++){(0,i[o])(n.data)}n.receivedCallbacks=[]},e.prototype.updateAggregateData=function(t,e,n){var o=this.getLevelDesc(t,!0),i=this.groupKeyToStr(e);o.data.set(i,n)},e.prototype.groupKeyToStr=function(t){return JSON.stringify(t)},e.prototype.getLevelDesc=function(t,e){var n=this.levels[t];return!n&&e&&(n={receivedCallbacks:[],data:new Map},this.levels[t]=n),n},e.prototype.clear=function(){this.levels=[]},e}(),i=function(){function e(t){this.context=t,this.aggrs=null}return e.prototype.getAggrContainer=function(){return this.aggrs},e.prototype.calculate=function(e){console.warn("Grand totals and sub totals aggregation calculation can be used in Enterprise version only"),(e=e||{}).maxLevel=e.maxLevel>=0?e.maxLevel:0,this.aggrs=new o(this.context);var n=this.context.createQuery();n.loadFromData(this.context.getQuery().toJSONData());for(var i=this.context.getQuery().getAggregationSettings(),r=i.getAggregates().map((function(t){return t.colId})),s=n.getColumns().filter((function(t){return r.indexOf(t.id)<0})),a=0;a<s.length;a++)s[a].enabled=!1;i.hasGrandTotals()&&(this.aggrs.setAggregateData(0,new Map),e.resultObtained&&e.resultObtained({},0));for(var l=i.getGroups(),u=1;u<=l.length&&u<=e.maxLevel;u++)this.aggrs.setAggregateData(u,new Map),e.resultObtained&&e.resultObtained({},u);return t.resolve()},e.prototype.needRecalculation=function(){return!0},e.prototype.reset=function(){},e}()}).call(this,n(51))},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return i}));var o=n(0),i=function(){function e(t){this.context=t}return e.prototype.loadChunk=function(e){var n=this;return this.dataLoadPromise=new t((function(t,i){var r={chunk:e,success:function(i){for(var r=new o.EasyDataTable({loader:n.context.dataLoader,chunkSize:n.context.resultTable.chunkSize}),s=i.resultSet,a=0,l=s.cols;a<l.length;a++){var u=l[a];r.columns.add(u)}r.setTotal(i.meta.totalRecords);for(var c=0,d=s.rows;c<d.length;c++){var h=d[c];r.addRow(h)}var p=0;i.meta&&i.meta.totalRecords&&(p=i.meta.totalRecords),t({table:r,total:p,hasNext:!e.needTotal||e.offset+e.limit<p})},error:function(t){return i(t)}};n.context.debugMode&&(r.debug="Data Chunk. Offset: "+e.offset),n.context.fetchDataChunk(r)})),this.dataLoadPromise},e}()}).call(this,n(51))},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var o,i=n(0),r=n(2),s=n(1),a=n(4),l=n(3),u=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c=function(t){function e(e){var n=t.call(this,e)||this;return n.queryChangedCallbackId=null,n.group=r.WidgetGroup.Model|r.WidgetGroup.Query,n.panel=e,n}return u(e,t),Object.defineProperty(e.prototype,"cssPrefix",{get:function(){return"eqjs-ep"},enumerable:!0,configurable:!0}),e.prototype.getWidgetType=function(){return"entitiesPanel"},e.prototype.init=function(e,n){t.prototype.init.call(this,e,n),this.setOptions(n),this.renderProgressBlock()},e.prototype.refreshCore=function(){this.render(),this.options.syncWithColumns&&this.refreshCheckedStateByColumns()},e.prototype.onProcessStartCore=function(){this.options.showIndicatorOnLoad&&(this.progressBlock.parentNode||this.panel.appendChild(this.progressBlock))},e.prototype.onProcessEndCore=function(){this.options.showIndicatorOnLoad&&this.progressBlock.parentNode&&this.panel.removeChild(this.progressBlock)},e.prototype.destroyCore=function(){this.slot.innerHTML=""},e.prototype.setOptions=function(t){var e=this;(this.options={showToolbar:!0,syncWithColumns:!1,showSelectAllButton:!1,showClearSelectionButton:!0,showAddColumnButton:!0,showAddConditionButton:!0,showCheckboxes:!0,showTooltips:!0,draggableAttributes:!0,showAttributes:{useInConditions:!0,useInResult:!0,useInSorting:!1},showFilterBox:!1,filterBoxMode:0,showIndicatorOnLoad:!0,attrPlacement:0,sortEntities:!1,autoClearSelection:!0,entityRenderedCallback:null,attributeRenderedCallback:null,columnTitleFormat:"{attr}"},t&&i.utils.assignDeep(this.options,t),this.queryChangedCallbackId)&&(n=this.context.getQuery()).removeChangedCallback(this.queryChangedCallbackId);if(this.options.syncWithColumns){var n=this.context.getQuery();this.queryChangedCallbackId=n.addChangedCallback((function(t){var n=t.data;!n||n.part!=r.QueryChangePart.Columns&&n.part!=r.QueryChangePart.All||e.refreshCheckedStateByColumns()}))}},e.prototype.render=function(){var t=this.context.getModel();if(this.clear(),this.panel.classList.add(this.cssPrefix+"-panel"),this.panel.classList.add(l.a.getMobileCssClass()),this.rootEntityBlock=document.createElement("div"),null!=t&&!t.isEmpty()){var e=t.getEntitiesTree({addUIC:this.options.showAttributes.useInConditions,addUIR:this.options.showAttributes.useInResult,addUIS:this.options.showAttributes.useInSorting,attrPlacement:this.options.attrPlacement,sortEntities:this.options.sortEntities,includeRootData:!0});this.entityTreeBlock=this.renderEntity(e,this.rootEntityBlock,0),this.panel.appendChild(this.entityTreeBlock)}this.options.showFilterBox?this.createFilterBox():this.rootEntityBlock.style.top="0",this.options.showToolbar&&!this.options.syncWithColumns?this.createToolPanel():this.rootEntityBlock.style.bottom="0"},e.prototype.renderEntity=function(t,e,n){var o,a=this,u=document.createElement("div");u.classList.add(this.cssPrefix+"-entity-node"),u.classList.add(l.a.getMobileCssClass());var c=document.createElement("div");c.classList.add(this.cssPrefix+"-entity-children"),c.classList.add(l.a.getMobileCssClass());var d=document.createElement("label");d.classList.add(this.cssPrefix+"-entity-node-label");var h=document.createElement("input");h.type="checkbox",h.title=t.text;var p,f,g,y=document.createElement("a");y.href="javascript:void(0)",y.title=i.i18n.getText("EntityToggle")+" "+t.text,y.classList.add(this.cssPrefix+"-entity-node-button");var m=n;if(e?(o=e).innerHTML="":o=document.createElement("div"),o.classList.add(this.cssPrefix+"-entity"),o.classList.add(l.a.getMobileCssClass()),t.id&&""!=t.id){d.innerText=t.text,u.appendChild(d),this.options.showCheckboxes&&d.insertBefore(h,d.firstChild),u.insertBefore(y,u.firstChild),this.options.showTooltips&&t.description&&d.setAttribute("title",t.description);for(var v=0;v<m;v++){var b=document.createElement("div");b.classList.add(this.cssPrefix+"-entity-offset"),u.insertBefore(b,u.firstChild)}o.appendChild(u),c.hidden=!0,m++}var C=t.items?t.items.length:0,x=function(e){var n=t.items[e];if(n.isEntity)c.appendChild(w.renderEntity(n,null,m));else if(!n.lookupAttr||!function(t,e){return e.querySelectorAll("."+a.cssPrefix+'-entity-attr[data-id="'+t+'"]').length>0}(n.lookupAttr,c)){(f=document.createElement("label")).innerText=n.text,f.classList.add(w.cssPrefix+"-entity-attr-label"),w.options.showCheckboxes&&((g=document.createElement("input")).type="checkbox",g.title=n.text,f.insertBefore(g,f.firstChild),w.options.syncWithColumns&&g.addEventListener("change",(function(t){var e=a.context.getModel(),n=a.context.getQuery(),o=t.currentTarget,i=o.parentElement.parentElement.getAttribute("data-id");if(e.checkAttrProperty(i,"useInResult"))if(o.checked){var s=e.getAttributeById(i),l=e.getAttributeText(s,a.options.columnTitleFormat),u=n.addColumn({attribute:s,caption:l});n.fireColumnsChangedEvent(r.QueryChangeAction.Add,u)}else{var c=n.getColumns().filter((function(t){return t.expr.tag===r.ExprTag.EntityAttribute&&t.expr.value===i}));c.length>0&&(n.removeColumn(c[0],null),n.fireColumnsChangedEvent(r.QueryChangeAction.Delete,c[0]))}}))),w.options.showTooltips&&n.description&&f.setAttribute("title",n.description);for(var o=0;o<m+1;o++){var i=document.createElement("div");i.classList.add(w.cssPrefix+"-entity-offset"),f.insertBefore(i,f.firstChild)}(p=document.createElement("div")).classList.add(w.cssPrefix+"-entity-attr"),0==u.innerHTML.length&&p.classList.add(w.cssPrefix+"-entity-attr-root"),p.innerHTML="",p.appendChild(f),p.setAttribute("data-id",n.id),w.options.draggableAttributes&&s.eqDragManager.registerDraggableItem({element:p,scope:"entityAttr",data:{attrId:n.id},renderer:function(t){t.innerHTML="";var e=document.createElement("span");e.innerText=n.text,t.appendChild(e)}}),w.options.attributeRenderedCallback&&w.options.attributeRenderedCallback(p),c.appendChild(p)}},w=this;for(v=0;v<C;v++)x(v);if(c.innerHTML.length&&(o.appendChild(c),y.addEventListener("click",(function(t){c.hidden=!c.hidden;var e=t.target,n=a.cssPrefix+"-entity-node-button-open";e.classList.contains(n)?e.classList.remove(n):e.classList.add(n),t.preventDefault()}))),c){var T=c.querySelectorAll("."+this.cssPrefix+"-entity-attr > label > input");for(v=0;v<T.length;v++){T[v].addEventListener("click",(function(t){t.target.checked&&!h.checked?h.checked=!0:0===c.querySelectorAll("input:checked").length&&(h.checked=!1),t.stopPropagation()}))}}return h.addEventListener("click",(function(t){for(var e=t.target,n=c.querySelectorAll("label input"),o=0;o<n.length;o++){n[o].checked=e.checked}if(a.options.syncWithColumns){for(var i=a.context.getQuery(),s=a.context.getModel(),l=[],u=0,d=Array.from(c.querySelectorAll("."+a.cssPrefix+"-entity-attr"));u<d.length;u++){var h=d[u].getAttribute("data-id");s.checkAttrProperty(h,"useInResult")&&l.push(h)}if(e.checked)for(var p=0,f=l;p<f.length;p++){h=f[p];i.addColumn({attributeId:h})}else{var g=i.getColumns().filter((function(t){return t.expr.tag===r.ExprTag.EntityAttribute&&l.indexOf(t.expr.value)>=0}));i.removeColumns(g,null)}i.fireColumnsChangedEvent()}t.stopPropagation()})),e!=this.rootEntityBlock&&this.options.entityRenderedCallback&&this.options.entityRenderedCallback(o),o},e.prototype.createFilterBox=function(){var t=this;this.filterBoxBlock=document.createElement("div"),this.filterBoxBlock.classList.add(this.cssPrefix+"-filter-box"),this.filterBoxBlock.classList.add(l.a.getMobileCssClass()),this.filterBoxInput=document.createElement("input"),this.filterBoxInput.classList.add(this.cssPrefix+"-filter-box-input"),this.filterBoxInput.addEventListener("input",(function(e){for(var n=t.panel.querySelectorAll("."+t.cssPrefix+"-entity-attr"),o=0;o<n.length;o++){var i=n[o];i.hidden=!t.checkFilterAttribute(i)}var r=t.panel.querySelectorAll(":scope > ."+t.cssPrefix+"-entity");for(o=0;o<r.length;o++){for(var s=r[o],a=s.querySelectorAll("."+t.cssPrefix+"-entity-attr"),l=0,u=0;u<a.length;u++)"None"!==a[u].style.display&&l++;s.hidden=0===l}""===t.filterBoxInput.value?t.collapseAll():t.expandAll()})),this.filterBoxBlock.appendChild(this.filterBoxInput),this.panel.insertBefore(this.filterBoxBlock,this.panel.firstChild)},e.prototype.createToolPanel=function(){var t=this,e=this.cssPrefix+"-tool-panel",n=document.createElement("div");n.classList.add(e),n.classList.add(l.a.getMobileCssClass());var o=document.createElement("div");o.classList.add(e+"-select-all"),o.title="Select all";var r=document.createElement("div");r.classList.add(e+"-deselect-all"),r.title="Clear selection";var s=document.createElement("div");s.classList.add(e+"-add-columns"),s.title="Add column";var a=document.createElement("div");a.classList.add(e+"-add-cond"),a.title="Add condition";var u=document.createElement("div");u.classList.add(e+"-left-side");var c=document.createElement("div");c.classList.add(e+"-right-side");var d=this.context.getModel();this.options.showSelectAllButton&&(o.title=i.i18n.getText("ButtonSelectAll"),u.appendChild(o),o.addEventListener("click",(function(){t.selectAll()}))),this.options.showClearSelectionButton&&(r.title=i.i18n.getText("ButtonDeselectAll"),u.appendChild(r),r.addEventListener("click",(function(){t.deselectAll()}))),this.options.showAddColumnButton&&(s.title=i.i18n.getText("ButtonAddColumns"),c.appendChild(s),s.addEventListener("click",(function(){var e,n=t.panel.querySelectorAll("."+t.cssPrefix+"-entity-attr"),o=[],i=t.context.getQuery();i.fireProcessEvent({source:self,status:"start"});for(var r=0;r<n.length;r++){var s=n[r];s.getElementsByTagName("input")[0].checked&&(e=s.getAttribute("data-id"),d.checkAttrProperty(e,"useInResult")&&o.push(e))}for(var a=0,l=o;a<l.length;a++){var u=l[a],c=d.getAttributeById(u),h=d.getAttributeText(c,t.options.columnTitleFormat);i.addColumn({attribute:c,caption:h})}i.fireChangedEvent(),t.options.autoClearSelection&&t.deselectAll(),i.fireProcessEvent({source:self,status:"finish"})}))),this.options.showAddConditionButton&&(a.title=i.i18n.getText("ButtonAddConditions"),c.appendChild(a),a.addEventListener("click",(function(){var e,n=t.panel.querySelectorAll("."+t.cssPrefix+"-entity-attr"),o=[],i=t.context.getQuery();i.fireProcessEvent({source:self,status:"start"});for(var r=0;r<n.length;r++){var s=n[r];s.getElementsByTagName("input")[0].checked&&(e=s.getAttribute("data-id"),d.checkAttrProperty(e,"useInConditions")&&o.push(e))}for(var a=0,l=o;a<l.length;a++){var u=l[a];i.addSimpleCondition({attributeId:u})}i.fireChangedEvent(),t.options.autoClearSelection&&t.deselectAll(),i.fireProcessEvent({source:self,status:"finish"})}))),n.appendChild(u),n.appendChild(c),this.panel.appendChild(n)},e.prototype.checkFilterAttribute=function(t){if(t.querySelector("label input").checked)return!0;var e=t.querySelector("label").textContent;if(this.checkFilterText(e))return!0;var n=t.parentElement.parentElement.querySelector("."+this.cssPrefix+"-entity-node").querySelector("label").textContent;return!!this.checkFilterText(n)},e.prototype.checkFilterText=function(t){var e=this.filterBoxInput.value;return""==e||(0==this.options.filterBoxMode&&t.toLowerCase().indexOf(e.toLowerCase())>=0||1==this.options.filterBoxMode&&0==t.toLowerCase().indexOf(e.toLowerCase()))},e.prototype.refreshCheckedStateByColumns=function(){this.deselectAll();for(var t=0,e=this.context.getQuery().getColumns().filter((function(t){return t.expr.tag===r.ExprTag.EntityAttribute}));t<e.length;t++){var n=e[t],o=this.rootEntityBlock.querySelector("."+this.cssPrefix+'-entity-attr[data-id="'+n.expr.value+'"]'),i=o.querySelector("label > input");i.checked=!0;for(var s=o.parentElement;s&&s.classList.contains(this.cssPrefix+"-entity-children");){s.hidden=!1;var a=s.parentElement;if(!a||s===a.firstElementChild)break;(i=a.firstElementChild.querySelector("label > input")).checked=!0,s=a.parentElement}}},e.prototype.expandAll=function(){for(var t=0;t<this.rootEntityBlock.childNodes.length;t++)for(var e=this.rootEntityBlock.childNodes[0].querySelectorAll("."+this.cssPrefix+"-entity-children"),n=0;n<e.length;n++){e[n].hidden=!1}var o=this.rootEntityBlock.querySelectorAll("."+this.cssPrefix+"-entity-node-button");for(t=0;t<o.length;t++){o[t].classList.add(this.cssPrefix+"-entity-node-button-open")}},e.prototype.collapseAll=function(){for(var t=0;t<this.rootEntityBlock.childNodes.length;t++)for(var e=this.rootEntityBlock.childNodes[0].querySelectorAll("."+this.cssPrefix+"-entity-children"),n=0;n<e.length;n++){e[n].hidden=!0}var o=this.rootEntityBlock.querySelectorAll("."+this.cssPrefix+"-entity-node-button");for(t=0;t<o.length;t++){o[t].classList.remove(this.cssPrefix+"-entity-node-button-open")}},e.prototype.selectAll=function(){for(var t=this.entityTreeBlock.querySelectorAll("input"),e=0;e<t.length;e++){t[e].checked=!0}},e.prototype.deselectAll=function(){for(var t=this.entityTreeBlock.querySelectorAll("input"),e=0;e<t.length;e++){t[e].checked=!1}},e.prototype.renderProgressBlock=function(){this.progressBlock=document.createElement("div"),this.progressBlock.classList.add(a.b+"-progress-win8"),this.progressBlock.classList.add(l.a.getMobileCssClass()),this.progressBlock.innerHTML='<div class="wBall" id="wBall_1"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_2"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_3"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_4"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_5"><div class="wInnerBall"></div></div>'},e.prototype.clear=function(){this.panel.innerHTML=""},e}(r.Widget)},function(module,__webpack_exports__,__webpack_require__){"use strict";var browserUtils;__webpack_require__.d(__webpack_exports__,"a",(function(){return browserUtils})),function(browserUtils){var _isFirefox=null,_isIE=null;function IsIE(){if(null===_isIE){var t=navigator.userAgent;_isIE=t.indexOf("MSIE ")>-1||t.indexOf("Trident/")>-1}return _isIE}function IsEdge(){return!IsIE()&&eval("!!window.StyleMedia")}function IsFirefox(){if(null===_isFirefox){var t=navigator.userAgent;_isFirefox=t.toLowerCase().indexOf("firefox")>-1}return _isFirefox}browserUtils.IsIE=IsIE,browserUtils.IsEdge=IsEdge,browserUtils.IsFirefox=IsFirefox;var _detectedIsMobileMode=!1,_isMobileMode=void 0,detectIsMobileMode=function(){var t=isMobileMode();_detectedIsMobileMode=window.matchMedia("only screen and (max-width: 840px)").matches||window.matchMedia("only screen and (max-height: 420px)").matches;var e=isMobileMode();e!==t&&mobileModeChangeHandler&&mobileModeChangeHandler(e)},mobileModeChangeHandler;function isMobileMode(){return void 0!==_isMobileMode?_isMobileMode:_detectedIsMobileMode}function setIsMobileMode(t){var e=isMobileMode();_isMobileMode=t;var n=isMobileMode();n!==e&&mobileModeChangeHandler&&mobileModeChangeHandler(n)}function onMobileModeChanged(t){mobileModeChangeHandler=t}function getMobileCssClass(){return isMobileMode()?"k-mobile":null}detectIsMobileMode(),window.addEventListener("resize",(function(){return detectIsMobileMode()})),browserUtils.isMobileMode=isMobileMode,browserUtils.setIsMobileMode=setIsMobileMode,browserUtils.onMobileModeChanged=onMobileModeChanged,browserUtils.getMobileCssClass=getMobileCssClass}(browserUtils||(browserUtils={}))},function(t,e,n){"use strict";function o(t,e){var n={9:"[0-9]",a:"[a-z]"},o=e.split(""),i=function(e){if("focus"!==e.type||""===t.value){var i=[],r=t.selectionStart;o.forEach((function(e,o){if(n[e]){var r=new RegExp(n[e],"i").test(t.value.charAt(o));i.push(r?t.value.charAt(o):"_")}else i.push(e)})),t.value=i.join(""),t.selectionStart=t.selectionEnd=r}};t.addEventListener("keydown",(function(e){if(8===e.keyCode||46===e.keyCode){e.preventDefault();var i=[],r=t.selectionStart;if(0==r)return;for(var s=r,a=!0,l=o.length-1;l>=0;l--){var u=o[l];if(n[u]){var c=new RegExp(n[u],"i").test(t.value.charAt(l));c&&l!=r-1&&(a=!1),l===r-1&&s--,i.push(c&&l!=r-1?t.value.charAt(l):"_")}else l===s-1&&s--,r-1===l&&r--,i.push(u)}t.value=a?"":i.reverse().join(""),t.selectionStart=t.selectionEnd=s<0?0:s;var d=document.createEvent("Event");d.initEvent("input",!0,!0),t.dispatchEvent(d)}})),t.addEventListener("keypress",(function(e){var i=String.fromCharCode(e.charCode);if(i){e.preventDefault();var r=[],s=t.selectionStart,a=s;o.forEach((function(e,o){if(n[e]){var l=o!=s?t.value.charAt(o):i,u=new RegExp(n[e],"i").test(l);r.push(u?l:"_"),u&&s===o&&a++}else r.push(e),a===o&&a++,s===o&&s++})),t.value=r.join(""),t.selectionStart=t.selectionEnd=a;var l=document.createEvent("Event");l.initEvent("input",!0,!0),t.dispatchEvent(l)}})),t.addEventListener("input",i),t.addEventListener("focus",i)}n.d(e,"a",(function(){return o}))},function(t,e,n){"use strict";(function(t){n.d(e,"b",(function(){return l})),n.d(e,"a",(function(){return u})),n.d(e,"d",(function(){return c})),n.d(e,"c",(function(){return d}));var o,i=n(0),r=n(71),s=n(6),a=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(){function e(){}return e.prototype.openConfirm=function(e,n,o){var i=this,r={title:e,closable:!1,submitable:!0,cancelable:!0,body:'<div id="kdlg-dialog-confirm">'+n+"</div>"};return o?(r.onSubmit=function(){o(!0)},r.onCancel=function(){o(!1)},void this.open(r)):new t((function(t){r.onSubmit=function(){t(!0)},r.onCancel=function(){t(!1)},i.open(r)}))},e.prototype.openPrompt=function(e,n,o,i){var r=this,s={title:e,submitable:!0,closable:!0,cancelable:!0,submitOnEnter:!0,body:'<div id="kdlg-dialog-form" class="kfrm-form">\n <div class="kfrm-fields label-above">\n <label for="kdlg-dialog-form-input" id="kdlg-dialog-form-content">'+n+'</label>\n <input type="text" name="'+'kdlg-dialog-form-input" id="'+'kdlg-dialog-form-input" />\n </div>\n </div>',arrangeParents:!1,beforeOpen:function(){var t=document.getElementById("kdlg-dialog-form-input");o&&(t.value=o),t.focus()}},a=function(t){var e=document.getElementById("kdlg-dialog-form-input"),n=e.value;return n&&n.replace(/\s/g,"").length>0?(t(n),!0):(e.classList.add("eqjs-invalid"),!1)};return i?(s.onSubmit=function(){return a(i)},s.onCancel=function(){i("")},void this.open(s)):new t((function(t){s.onSubmit=function(){return a(t)},s.onCancel=function(){t("")},r.open(s)}))},e.prototype.open=function(t,e){var n=this,o=new u(t,e),i=t.onDestroy;return t.onDestroy=function(t){n.untrack(t),i&&i(t)},o.open(),this.track(o),o},e.prototype.createSet=function(t){return new d(t,this)},e.prototype.untrack=function(t){var n=e.openDialogs.indexOf(t);n>=0&&e.openDialogs.splice(n,1)},e.prototype.track=function(t){e.openDialogs.push(t)},e.prototype.openProgress=function(t){var e=this,n=new c(t),o=t.onDestroy;return t.onDestroy=function(t){e.untrack(t),o&&o(t)},n.open(),this.track(n),n},e.prototype.getAllDialogs=function(){return Array.from(e.openDialogs)},e.prototype.closeAllDialogs=function(){for(var t=0,n=Array.from(e.openDialogs);t<n.length;t++){n[t].close()}},e.openDialogs=[],e}(),u=function(){function t(t,e){var n=this;this.options=t,this.submitHandler=function(t){return(!n.options.onSubmit||!1!==n.options.onSubmit(n,t))&&(n.destroy(),!0)},this.cancelHandler=function(){n.options.onCancel&&n.options.onCancel(n),n.destroy()},this.keydownHandler=function(t){return 13!=t.keyCode||!n.isActiveDialog()||(t.preventDefault(),t.stopPropagation(),!n.submitHandler())||(window.removeEventListener("keydown",n.keydownHandler,!1),!1)},this.dialogId=i.utils.generateId("dlg"),this.data=e,this.slot=Object(s.e)("div",document.body).attr("tab-index","-1").data("dialog-id",this.dialogId).addClass("kdlg-modal","is-active").focus().addChild("div",(function(t){return t.addClass("kdlg-modal-background")})).addChild("div",(function(o){return n.windowElement=o.addClass("kdlg-modal-window").addChild("header",(function(e){n.headerElement=e.addClass("kdlg-header").addChild("p",(function(e){return e.addClass("kdlg-header-title").addText(t.title)})).toDOM(),!1!==t.closable&&e.addChild("button",(function(t){return t.addClass("kdlg-modal-close").on("click",(function(){n.cancelHandler()})).focus()}))})).addChild("div",(function(t){t.addClass("kdlg-alert-container"),n.alertElement=t.toDOM()})).addChild("section",(function(o){if(n.bodyElement=o.addClass("kdlg-body").toDOM(),"string"==typeof t.body){var r=i.liquid.renderLiquidTemplate(t.body,e);o.addHtml(r)}else o.addChildElement(t.body)})).addChild("footer",(function(e){var o=null;o=t.footerAlignment&&t.footerAlignment==r.a.Center?"align-center":"align-right",n.footerElement=e.addClass("kdlg-footer").toDOM(),e.addClass(o),!1!==t.submitable&&(e.addChild("button",(function(e){e.id(n.dialogId+"-btn-submit").addClass("kfrm-button","is-info").addText(t.submitButtonText||i.i18n.getText("ButtonOK")),t.recaptchaSiteKey?(e.data("sitekey",t.recaptchaSiteKey),e.addClass("g-recaptcha"),e.on("click",(function(e){grecaptcha?grecaptcha.ready((function(){grecaptcha.execute(t.recaptchaSiteKey,{action:"submit"}).then((function(t){n.submitHandler(t)}))})):n.submitHandler()}))):e.on("click",(function(t){n.submitHandler()})),e.focus()})),!1!==t.cancelable&&e.addChild("button",(function(e){return e.id(n.dialogId+"-btn-cancel").addClass("kfrm-button").addText(t.cancelButtonText||i.i18n.getText("ButtonCancel")).on("click",(function(t){n.cancelHandler()}))})))})).toDOM()})).toDOM()}return t.prototype.getData=function(){return this.data},t.prototype.getRootElement=function(){return this.slot},t.prototype.getSubmitButtonElement=function(){return document.getElementById(this.dialogId+"-btn-submit")},t.prototype.getCancelButtonElement=function(){return document.getElementById(this.dialogId+"-btn-cancel")},t.prototype.open=function(){var t=this;this.options.beforeOpen&&this.options.beforeOpen(this),Object(s.e)(this.slot).show(),this.options.arrangeParents&&this.arrangeParents(!0);var e=this.slot.querySelector(".kdlg-modal-window");this.options.height&&(e.style.height="string"==typeof this.options.height?this.options.height:this.options.height+"px"),this.options.width&&(e.style.width="string"==typeof this.options.width?this.options.width:this.options.width+"px"),this.options.submitOnEnter&&window.addEventListener("keydown",this.keydownHandler,!1),this.slot.querySelectorAll("input").forEach((function(e){return e.addEventListener("input",(function(){t.clearAlert(),t.options.onInput&&t.options.onInput(t)}))})),this.options.onShow&&this.options.onShow(this)},t.prototype.submit=function(){this.submitHandler()},t.prototype.cancel=function(){this.cancelHandler()},t.prototype.close=function(){this.destroy()},t.prototype.disableButtons=function(){this.slot.querySelectorAll("button").forEach((function(t){return t.disabled=!0}))},t.prototype.enableButtons=function(){this.slot.querySelectorAll("button").forEach((function(t){return t.disabled=!1}))},t.prototype.showAlert=function(t,e,n){var o=Object(s.e)("div").addClass("kdlg-alert "+(e||"")).addChild("span",(function(t){return t.addClass("kdlg-alert-closebtn").text("×").on("click",(function(t){var e=t.target.parentElement;e.parentElement.removeChild(e)}))})).addText(t).toDOM();!0===n&&this.clearAlert(),this.alertElement.appendChild(o)},t.prototype.clearAlert=function(){this.alertElement.innerHTML=""},t.prototype.destroy=function(){document.querySelectorAll('[data-dialog-id="'+this.dialogId+'"]').length<=0||(this.options.arrangeParents&&this.arrangeParents(!1),document.body.removeChild(this.slot),this.options.submitOnEnter&&window.removeEventListener("keydown",this.keydownHandler,!1),this.options.onDestroy&&this.options.onDestroy(this))},t.prototype.isActiveDialog=function(){var t=document.documentElement.querySelectorAll(".kdlg-modal");return t[t.length-1]===this.slot},t.prototype.arrangeParents=function(t){for(var e=document.documentElement.querySelectorAll(".kdlg-modal-window"),n=0;n<e.length-1;n++)if(t){var o=0==n?20:40*n+20;Object(s.e)(e[n]).setStyle("margin-top",o+"px").setStyle("margin-left",o+"px")}else Object(s.e)(e[n]).removeStyle("margin-top").removeStyle("margin-left")},t}(),c=function(t){function e(e,n){var o,i,r=this,a=Object(s.e)("div").addChild("div",(function(t){return o=t.text(e.content||"").toDOM()})).addChild("div",(function(t){t.addClass("kdlg-progress-line").addChild("div",(function(t){i=t.addClass("fill").toDOM(),e.determinated?t.setStyle("width","0%"):t.addClass("indeterminate")}))})).toDOM();return(r=t.call(this,{title:e.title,body:a,beforeOpen:e.beforeOpen,onSubmit:e.onSubmit,width:e.width,height:e.height,submitable:!1,cancelable:!1,closable:!1,onDestroy:e.onDestroy},n)||this).contentElement=o,r.progressElement=i,r}return a(e,t),e.prototype.updateContent=function(t){this.contentElement.innerText=t},e.prototype.updateProgress=function(t){var e=this;t=this.in01(t),this.progressElement.style.width=100*t+"%",1===t&&setTimeout((function(){e.submit()}),500)},e.prototype.in01=function(t){return t>1?1:t<0?0:t},e}(u),d=function(){function t(t,e){this.options=t,this.dialogService=e,this.currentDialog=null,this.currentIndex=0,this.options=t,this.dialogService=e}return t.prototype.getCurrent=function(){return this.currentDialog},t.prototype.openNext=function(t){return this.open(this.currentIndex+1,t)},t.prototype.openPrev=function(t){return this.open(this.currentIndex-1,t)},t.prototype.open=function(t,e){if(t<0?this.currentIndex=0:t>=this.options.length?this.currentIndex=this.options.length-1:this.currentIndex=t,this.currentDialog)try{this.currentDialog.close()}catch(t){}var n=this.options[this.currentIndex];return this.currentDialog=this.dialogService.open(n,e),this.currentDialog},t.prototype.close=function(){this.currentDialog&&(this.currentDialog.close(),this.currentDialog=null)},t}()}).call(this,n(107))},function(t,e,n){"use strict";var o;n.d(e,"a",(function(){return o})),function(t){t[t.Left=1]="Left",t[t.Center=2]="Center",t[t.Right=3]="Right"}(o||(o={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var o,i=n(0),r=n(2),s=n(1),a=n(9),l=n(4),u=n(3),c=n(97),d=n(74),h=n(30),p=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),f=function(t){function e(e){var n=t.call(this,e)||this;return n.options={isSubQuery:!1,activeColumn:null,showAddRow:!0,showHeader:!0,showColumnTitles:!0,allowAggrColumns:!0,allowDuplicates:!0,allowCustomExpressions:!1,allowSorting:!0,attrElementFormat:"{entity} {attr}",titleElementFormat:null,buttons:null,alwaysShowButtons:!1,accentActiveColumn:!0,allowDragDrop:!0,menuOptions:{showSearchBoxAfter:30,searchBoxAutoFocus:!0,activateOnMouseOver:!0,adjustHeight:!0,itemRenderedCallback:null},attrPlacement:0,sortEntities:!1,columnRenderedCallback:null,customExpressionText:0,allowHiddenColumns:!1,showAddAllForEntity:!1},n.landingSlot=Object(s.domel)("div").addClass(n.cssPrefix+"-col-landing-slot").addChildElement(Object(s.domel)("div").toDOM()).toDOM(),n.landingIndex=-1,n.slot.classList.add(n.cssPrefix+"-panel"),n.group=r.WidgetGroup.Query,n}return p(e,t),Object.defineProperty(e.prototype,"cssPrefix",{get:function(){return"eqjs-qc"},enumerable:!0,configurable:!0}),e.prototype.getWidgetType=function(){return"columnsPanel"},e.prototype.init=function(e,n){var o=this;t.prototype.init.call(this,e,n),this.setOptions(n);var i=e.getModel();this.detachQueryObserver(),this.attachQueryObserver(),s.eqDragManager.removeDropContainer(this.slot),this.options.allowDragDrop&&s.eqDragManager.registerDropContainer({element:this.slot,scopes:["entityAttr","entityAttrSort"],onDragEnter:function(t,e){if(o.slot.classList.add(l.b+"-drophover"),"entityAttrSort"===e.item.scope)o.showLandingSlot(e.pageX,e.pageY);else{var n=e.data.attrId;i.checkAttrProperty(n,"useInResult")||(e.dropEffect=s.DropEffect.Forbid),e.dragImage.classList.add("eqjs-sortable-helper")}},onDragOver:function(t,e){var n=e.data.attrId;("entityAttrSort"===e.item.scope||i.checkAttrProperty(n,"useInResult"))&&o.showLandingSlot(e.pageX,e.pageY)},onDragLeave:function(t,e){"entityAttrSort"===e.item.scope?e.dropEffect=s.DropEffect.Forbid:(e.dragImage.classList.remove("eqjs-sortable-helper"),e.dragImage.style.removeProperty("width")),o.slot.classList.remove(l.b+"-drophover"),o.hideLandingSlot()},onDrop:function(t,e){if("entityAttrSort"==e.item.scope){var n=o.getQuery().getColumns().indexOf(e.data.column);o.moveColumnCore(n,o.landingIndex)}else{var i=e.data.attrId;o.addNewColumn(i,o.landingIndex)}}})},e.prototype.renderBaseElements=function(){var t=this,e=0;if(this.options.showHeader){var n=Object(s.domel)("div",this.slot).hide().addClass(this.cssPrefix+"-header").addClass(u.a.getMobileCssClass()).addChild("div",(function(e){return e.addClass(t.cssPrefix+"-header-expression").text(i.i18n.getText("HeaderExpression"))}));!1!==this.options.showColumnTitles&&n.addChild("div",(function(e){return e.addClass(t.cssPrefix+"-header-title").text(i.i18n.getText("HeaderTitle"))})),this.headerElement=n.toDOM(),e+=this.headerElement.offsetHeight}this.columnsBlock=Object(s.domel)("div",this.slot).addClass(this.cssPrefix+"-columns").addClass(u.a.getMobileCssClass()).toDOM(),this.options.showAddRow&&(this.addRowElement=Object(s.domel)("div",this.slot).addClass(l.b+"-addrow",this.cssPrefix+"-addrow",l.b+"-addrow-empty").addClass(u.a.getMobileCssClass()).addChild("a",(function(e){return e.attr("href","javascript:void(0)").text(i.i18n.getText("CmdClickToAddColumn")).on("click",(function(e){e.preventDefault(),t.showEntitiesMenu({anchor:e.target,selectedIds:null,itemSelectedCallback:function(e,n){if("__AddAll__"===e.id&&e.extra&&Array.isArray(e.extra.ids))e.extra.ids.forEach((function(e){return t.addNewColumn(e)}));else{var o=e.id;t.addNewColumn(o)}return!1}})}))})).toDOM(),e+=this.addRowElement.offsetHeight),this.columnsBlock.style.maxHeight=this.slot.offsetHeight-e-25+"px"},e.prototype.destroyCore=function(){s.eqDragManager.removeDropContainer(this.slot),this.detachQueryObserver(),this.slot.innerHTML=""},e.prototype.attachQueryObserver=function(){var t=this,e=this.getQuery();this.queryEventCallbackId=e.addChangedCallback((function(n){var o=n.data;if(o&&(o.part==r.QueryChangePart.Columns||o.part==r.QueryChangePart.Aggregation||o.part==r.QueryChangePart.All)){var i=document.activeElement,s=t.slot.contains(i)||i==document.body;switch(o.action){case r.QueryChangeAction.Modify:var a=o.changee,l=function(e){var n=t.columnsBlock.querySelector("div[data-id='"+e.id+"']");if(n){var o=t.getColumnRenderer(e,n);if(o){var i=o.render();if(s){var r=i.querySelector("a")||i.querySelector(".eqjs-column-button");r&&r.focus()}}}};Array.isArray(a)?a.forEach((function(t){return l(t)})):l(a),t.agjustHeaderVisibility();break;case r.QueryChangeAction.Add:a=o.changee;var u=function(n){var o=e.getColumns().indexOf(n),i=t.addColumnElement(n,o);s&&i.querySelector("a").focus()};Array.isArray(a)?a.forEach((function(t){return u(t)})):u(a),t.agjustHeaderVisibility();break;case r.QueryChangeAction.Delete:a=o.changee;var c=function(e){var n=t.columnsBlock.querySelector("div[data-id='"+e.id+"']");if(n){var o=n.nextSibling,i=n.previousSibling;if(t.columnsBlock.removeChild(n),s){var r=o||i||t.addRowElement,a=r.querySelector("a")||r.querySelector(".eqjs-column-button");a&&a.focus()}}};t.agjustHeaderVisibility(),Array.isArray(a)?a.forEach((function(t){return c(t)})):c(a);break;default:t.refresh()}}}))},e.prototype.detachQueryObserver=function(){this.queryEventCallbackId&&this.getQuery().removeChangedCallback(this.queryEventCallbackId)},e.prototype.getQuery=function(){return this.getContext().getQuery()},e.prototype.showLandingSlot=function(t,e){for(var n=this.columnsBlock.querySelectorAll("[class*="+this.cssPrefix+"-row]"),o=[],i=0;i<n.length;i++){var r=n[i];"none"!==r.style.display&&o.push(r)}if(0===o.length)return this.landingIndex=0,void this.columnsBlock.appendChild(this.landingSlot);var a=Object(s.getElementAbsolutePos)(this.landingSlot);if(!(e>=a.y&&e<=a.y+this.landingSlot.offsetHeight)){var l=o[0],u=l.offsetHeight,c=Object(s.getElementAbsolutePos)(l),d=e>c.y+u/2?Math.round((e-c.y+u/2)/u):0;d>o.length&&(d=o.length),d!=this.landingIndex&&(this.landingIndex=d,this.landingIndex<o.length?this.columnsBlock.insertBefore(this.landingSlot,o[this.landingIndex]):this.columnsBlock.appendChild(this.landingSlot),this.landingSlot.scrollIntoView({block:"center",behavior:"smooth"}))}},e.prototype.hideLandingSlot=function(){var t=this;this.landingIndex=-1,setTimeout((function(){t.landingSlot.parentElement&&t.landingSlot.parentElement.removeChild(t.landingSlot)}),10)},e.prototype.setOptions=function(t){i.utils.assignDeep(this.options,t),u.a.isMobileMode()&&(this.options.buttons=["menu"],this.options.showHeader=!1)},e.prototype.onProcessStartCore=function(){},e.prototype.onProcessEndCore=function(){},e.prototype.refreshCore=function(){this.clear(),this.render()},e.prototype.clear=function(){this.slot.innerHTML=""},e.prototype.render=function(){try{this.renderBaseElements(),this.createEntitiesMenu(),this.createColumnMenus(),this.agjustHeaderVisibility(),Object(s.domel)(this.slot).removeClass(l.a).addClass(u.a.getMobileCssClass());for(var t=this.context.getQuery().getColumns(),e=0,n=t;e<n.length;e++){var o=n[e];this.columnsBlock.appendChild(this.renderColumn(o))}}catch(t){var i=t;this.context.throwError({action:"ColumnsPanel rendering",text:i.message,sourceError:i})}},e.prototype.agjustHeaderVisibility=function(){if(this.headerElement){var t=this.context.getQuery().getColumns();this.headerElement.style.display=t.length?"":"none"}},e.prototype.renderColumn=function(t){var e=this.getColumnRenderer(t);return e?e.render():null},e.prototype.toggleColumnPicked=function(t){var e,n;t&&(e=this.columnsBlock.querySelector("div[data-id="+t.id+"]"))&&(n=e.classList.contains("active"));for(var o=this.columnsBlock.querySelectorAll("."+this.cssPrefix+"-row"),i=0;i<o.length;i++){var r=o[i];Object(s.domel)(r).removeClass("active"),this.options.alwaysShowButtons||Object(s.domel)(r).data("show-buttons",null)}e&&!n&&Object(s.domel)(e).addClass("active").data("show-buttons","")},e.prototype.addNewColumn=function(t,e){var n,o,i=this,s=this.getContext().getModel(),a=this.getQuery(),l=function(t){var e=s.getAttributeById(t);if(!e)return null;if(!e.useInResult){if(!e.lookupAttr)return null;if(t=e.lookupAttr,!(e=s.getAttributeById(t))||!e.useInResult)return null}var n=a.createColumn();return n.caption=i.getDefaultColumnCaption(e),n.sorting=r.SortDirection.None,n.sortIndex=-1,n.expr.tag=r.ExprTag.EntityAttribute,n.expr.kind=r.DataKind.Attribute,n.expr.dataType=e.dataType,n.expr.setValue(t,!0),n.params.concat(e.params),n};if(Array.isArray(t)){n=[];for(var u=0;u<t.length;u++)(o=l(t[u]))&&n.push(o)}else n=l(t);return this.addColumn(n,e),n},e.prototype.addColumn=function(t,e){var n=this.getQuery();n&&(!(t=Array.isArray(t)?this.checkColumnsArray(t):this.checkColumn(t))||Array.isArray(t)&&0==t.length||(n.addColumnObj(t,e,self),n.fireColumnsChangedEvent(r.QueryChangeAction.Add,t)))},e.prototype.addColumnElement=function(t,e){var n=this.columnsBlock.querySelectorAll("[class*="+this.cssPrefix+"-row]"),o=this.renderColumn(t);return n.length>0&&e<n.length?this.columnsBlock.insertBefore(o,n[e]):(this.columnsBlock.appendChild(o),this.scrollToBottom()),this.options.columnRenderedCallback&&this.options.columnRenderedCallback(o),o},e.prototype.scrollToBottom=function(){this.columnsBlock.scrollTop=this.columnsBlock.scrollHeight-this.columnsBlock.clientHeight},e.prototype.checkColumnsArray=function(t){for(var e=t.length,n=[],o=0;o<e;o++)this.checkColumn(t[o])&&n.push(t[o]);return n},e.prototype.checkColumn=function(t){if(!this.options.allowDuplicates)for(var e=this.getQuery().getColumns(),n=0;n<e.length;n++)if((t.expr.tag===r.ExprTag.EntityAttribute&&e[n].expr.tag===r.ExprTag.EntityAttribute||t.expr.tag===r.ExprTag.ParentEntityAttribute&&e[n].expr.tag===r.ExprTag.ParentEntityAttribute)&&t.expr.value===e[n].expr.value)return null;return t},e.prototype.getDefaultColumnCaption=function(t){var e=this.options.titleElementFormat||this.options.attrElementFormat;return this.getContext().getModel().getAttributeText(t,e)},e.prototype.getColumnsBlock=function(){return this.columnsBlock},e.prototype.getColumnRenderer=function(t,e){switch(t.expr.tag){case r.ExprTag.AggregateFunction:return new c.a(this,t,e);case r.ExprTag.CustomSql:return new d.a(this,t,e);case r.ExprTag.EntityAttribute:case r.ExprTag.ParentEntityAttribute:return new h.a(this,t,e)}return null},e.prototype.areCustomExpressionsAllowed=function(){return this.getQuery().isEx()&&this.options.allowCustomExpressions},e.prototype.addAllColumnsToEntitiesList=function(t){var e=this,n=t.filter((function(t){return!t.isEntity})).map((function(t){return t.id}));n.length>0&&t.unshift({id:"__AddAll__",text:i.i18n.getText("AddAllForEntityText"),extra:{ids:n}}),t.forEach((function(t){t.items&&e.addAllColumnsToEntitiesList(t.items)}))},e.prototype.createEntitiesMenu=function(){var t=this.getContext().getModel();if(!t||t.isEmpty())return null;var e=this.slot.id;e&&(e+="-EntitiesMenu");var n=t.getEntitiesTree({addUIC:!1,addUIR:!0,addUIS:!1,attrPlacement:this.options.attrPlacement,sortEntities:this.options.sortEntities});this.options.showAddAllForEntity&&this.addAllColumnsToEntitiesList(n);var o={id:e,items:n,adjustHeight:this.options.adjustEntitiesMenuHeight,domWriteItemsId:this.options.domWriteItemsId};i.utils.assign(o,this.options.menuOptions),this.entitiesMenu=new a.a(o)},e.prototype.getSortMenuList=function(){return[{id:"None",text:i.i18n.getText("CmdNotSorted")},{id:"Ascending",text:i.i18n.getText("CmdAscending")},{id:"Descending",text:i.i18n.getText("CmdDescending")},{id:"---",text:"---"}]},e.prototype.getMoveMenuList=function(){return[{id:"MoveTop",text:i.i18n.getText("CmdMoveToFirst")},{id:"MoveUp",text:i.i18n.getText("CmdMoveToPrev")},{id:"MoveDown",text:i.i18n.getText("CmdMoveToNext")},{id:"MoveBottom",text:i.i18n.getText("CmdMoveToLast")}]},e.prototype.createSortMenu=function(){var t=this.getContext().getModel();if(!t||t.isEmpty())return null;var e=this.slot.id;e&&(e+="-SortMenu");var n={id:e,items:this.getSortMenuList().concat(this.moveMenu.getItems()),domWriteItemsId:this.options.domWriteItemsId,showSelected:!0};i.utils.assign(n,this.options.menuOptions),n.searchBoxAlwaysShown=!1,this.sortMenu=new a.a(n)},e.prototype.createMoveMenu=function(){var t=this.getContext().getModel();if(!t||t.isEmpty())return null;var e=this.slot.id;e&&(e+="-MoveMenu");var n=i.utils.createArrayFrom(this.getMoveMenuList());this.options.allowHiddenColumns&&(n.push({id:"---",text:"---"}),n.push({id:"IsHidden",text:i.i18n.getText("CmdHiddenColumn")}));var o={items:n,id:e,domWriteItemsId:this.options.domWriteItemsId,showSelected:!0};i.utils.assign(o,this.options.menuOptions),this.moveMenu=new a.a(o),o.searchBoxAlwaysShown=!1},e.prototype.showEntitiesMenu=function(t){this.entitiesMenu.showMenu(t)},e.prototype.moveColumn=function(t,e){var n=this.getQuery().getColumns(),o=n.indexOf(t);if(o>=0)switch(e){case"MoveTop":if(0==o)return;this.moveColumnCore(o,0);break;case"MoveUp":if(0==o)return;this.moveColumnCore(o,o-1);break;case"MoveDown":if(o==n.length-1)return;this.moveColumnCore(o,o+1);break;case"MoveBottom":if(o==n.length-1)return;this.moveColumnCore(o,n.length-1)}},e.prototype.moveColumnCore=function(t,e){var n=this.getQuery();if(n){var o=this.columnsBlock.querySelectorAll("[class*="+this.cssPrefix+"-row]"),i=o[t];0==e?this.columnsBlock.insertBefore(i,this.columnsBlock[0]):e>0&&e<o.length-1?t<e?this.columnsBlock.insertBefore(i,o[e+1]):this.columnsBlock.insertBefore(i,o[e]):this.columnsBlock.appendChild(i),n.moveColumn(t,e),n.fireColumnsChangedEvent()}},e.prototype.createColumnMenus=function(){this.createMoveMenu(),this.options.allowSorting&&this.createSortMenu()},e}(r.Widget)},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return c}));var o,i=n(2),r=n(1),s=n(4),a=n(9),l=n(3),u=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var o=Array(t),i=0;for(e=0;e<n;e++)for(var r=arguments[e],s=0,a=r.length;s<a;s++,i++)o[i]=r[s];return o};!function(t){t[t.Enable=0]="Enable",t[t.Delete=1]="Delete",t[t.Hidden=2]="Hidden",t[t.SortingNone=3]="SortingNone",t[t.SortingAsc=4]="SortingAsc",t[t.SortingDesc=5]="SortingDesc",t[t.MoveTop=6]="MoveTop",t[t.MoveUp=7]="MoveUp",t[t.MoveDown=8]="MoveDown",t[t.MoveBottom=9]="MoveBottom",t[t.Menu=10]="Menu",t[t.Type=11]="Type",t[t.Format=12]="Format"}(o||(o={}));var c=function(){function t(t,e,n){this.functionMenu=null,this.formatsMenu=null,this.buttonMenu=null,this.isMouseOverBlock=!1,this.keepShowingButtons=!1,this.panel=t,this.column=e,this.element=n}return Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"eqjs-qc"},enumerable:!0,configurable:!0}),t.prototype.render=function(){var t=this;this.baseAttr=this.getAttribute(),this.getButtonsToShow().indexOf("sorting")>=0&&this.column.enabled&&(this.sortingButton=this.renderSoringButton(this.column.sorting),this.column.sorting!==i.SortDirection.None&&(this.sortingButton.style.display="block"));var e=Object(r.domel)("div");return e.data("id",this.column.id),this.element&&this.element.parentNode.replaceChild(e.toDOM(),this.element),this.element=e.toDOM(),this.panel.options.allowDragDrop&&!l.a.isMobileMode()&&r.eqDragManager.registerDraggableItem({element:this.element,scope:"entityAttrSort",data:{column:this.column},beforeDragStart:function(){t.hideButtons()},renderer:function(e){e.innerHTML="";var n=document.createElement("span");n.innerText=t.column.caption,e.classList.add("eqjs-sortable-helper"),e.appendChild(n)},onDragStart:function(e){t.element.style.display="none",e.dropEffect=r.DropEffect.Allow},onDragEnd:function(e){e.data.finishedSuccessfully||t.element.style.removeProperty("display")}}),this.isEditable()&&(this.createFunctionMenu(),this.createFormatsMenu()),this.createButtonMenu(),e.addClass(this.getClassesToAdd()).addClass(l.a.getMobileCssClass()).addChildElement(this.renderCheckbox()).addChild("div",(function(e){return e.addClass(s.b+"-button-placeholder",t.cssPrefix+"-button-placeholder",t.cssPrefix+"-colelement",t.cssPrefix+"-sortbutton-placeholder").addChildElement(t.sortingButton)})).addChildElement(this.renderExpressionBlock()),!1===this.panel.options.showColumnTitles||l.a.isMobileMode()||e.addChildElement(this.renderCaptionBlock()),e.addChild("div",(function(e){e.addClass(s.b+"-column-buttonsBlock",t.cssPrefix+"-buttonsBlock").addClass(l.a.getMobileCssClass()),t.getButtonsToShow().indexOf("enable")>=0&&!t.column.isReadOnly()&&e.addChildElement(t.renderEnabledButton()),t.getButtonsToShow().indexOf("type")>=0&&t.column.enabled&&e.addChildElement(t.renderColumnTypeButton()),t.getButtonsToShow().indexOf("format")>=0&&t.column.enabled&&e.addChildElement(t.renderColumnFormatButton()),t.getButtonsToShow().indexOf("delete")>=0&&!t.column.isReadOnly()&&e.addChildElement(t.renderDeleteButton()),t.getButtonsToShow().indexOf("menu")>=0&&!t.column.isReadOnly()&&e.addChildElement(t.renderMenuButton())})),l.a.isMobileMode()||e.on("mouseenter",this.onMouseEnter.bind(this)).on("mouseleave",this.onMouseLeave.bind(this)),(this.panel.options.accentActiveColumn||l.a.isMobileMode())&&e.on("click",this.onMouseClick.bind(this)),this.panel.options.alwaysShowButtons&&this.showButtons(),this.element},t.prototype.onMouseClick=function(t){return t.stopPropagation(),this.panel.toggleColumnPicked(this.column),this.adjustButtonsVisibility(),l.a.isMobileMode()||this.element.dispatchEvent(Object(r.createBrowserEvent)("mouseenter")),!1},t.prototype.fireColumnChanged=function(){this.column.fireChangedEvent()},t.prototype.refresh=function(){this.render()},t.prototype.getAttribute=function(){return this.panel.getContext().getModel().getAttributeByIdSafe(this.column.expr.value)},t.prototype.renderCaptionBlock=function(){var t=this;this.column.caption&&""!=this.column.caption||(this.column.caption=this.getDefaultColumnCaption());var e=Object(r.domel)("div").addClass(this.cssPrefix+"-colelement",this.cssPrefix+"-captionelement").addClass(l.a.getMobileCssClass());return this.isEditable()?e.addChild("a",(function(e){return e.attr("href","javascript:void(0)").title(t.column.caption).text(t.column.caption).on("click",(function(e){e.stopPropagation();var n=e.target,o=n.parentElement.querySelector("input");return o&&(n.style.display="none",o.style.removeProperty("display"),o.style.minWidth=""+n.clientWidth,o.focus(),t.element.setAttribute(r.eqDragManager.DRAG_DISABLED_ATTR,"")),!1}))})).addChild("input",(function(e){return e.hide().value(t.column.caption).on("blur keydown",(function(e){var n=!1,o=!0;if(e instanceof KeyboardEvent?13===e.keyCode?n=!0:27===e.keyCode&&(n=!0,o=!1):e instanceof FocusEvent&&(n=!0),n){var i=e.target,a=i.parentElement.querySelector("a");a&&(a.style.removeProperty("display"),i.style.display="none"),o&&t.column.caption!==i.value?(t.column.caption=i.value,t.fireColumnChanged()):(i.value=t.column.caption,Object(s.d)(a)),t.element.removeAttribute(r.eqDragManager.DRAG_DISABLED_ATTR)}return!0}))})):e.addChild("span",(function(e){e.text(t.column.caption).title(t.column.caption)})),e.toDOM()},t.prototype.renderSoringButton=function(t){var e,n=this,a=s.b+"-column-sortbutton";switch(t){case i.SortDirection.Ascending:e=a+"-asc";break;case i.SortDirection.Descending:e=a+"-desc";break;default:e=a+"-none"}return this.isEditable()?Object(r.domel)("div").addClass(a,s.b+"-button",e).data("btnplaceholder","").title(i.i18n.getText("ButtonSorting")).attr("tabIndex","0").on("click",(function(t){t.stopPropagation(),n.keepShowingButtons=!0,(n.getUIS()&&n.panel.sortMenu||n.panel.moveMenu).showMenu({anchor:n.sortingButton,selectedIds:n.column.isHidden()?["IsHidden"]:null,itemSelectedCallback:function(t,e){var i;switch(t.id){case"IsHidden":i=o.Hidden;break;case"MoveTop":i=o.MoveTop;break;case"MoveDown":i=o.MoveDown;break;case"MoveUp":i=o.MoveUp;break;case"MoveBottom":i=o.MoveBottom;break;case"None":i=o.SortingNone;break;case"Ascending":i=o.SortingAsc;break;case"Descending":i=o.SortingDesc}n.buttonMenuHandler(i,null)},menuClosedCallback:function(){n.keepShowingButtons=!1,n.isMouseOverBlock||n.leaveButtonBlock()}})})).on("keypress",(function(t){13==t.keyCode&&t.target.click()})).toDOM():t===i.SortDirection.Ascending||t===i.SortDirection.Descending?Object(r.domel)("div").addClass(a,s.b+"-button",e).title(i.i18n.getText("ButtonSorting")).toDOM():null},t.prototype.renderCheckbox=function(){var t=this;return this.panel.options.showCheckboxes&&!this.column.isReadOnly()?Object(r.domel)("div").title(i.i18n.getText("CmdToggleEnable")).attr("tabIndex","0").addClass(this.cssPrefix+"-colelement "+this.cssPrefix+"-column-checkbox").addClass(this.column.enabled?"enabled":"").on("click",(function(){return t.column.enabled=!t.column.enabled,t.column.fireChangedEvent(),!1})).on("keypress",(function(t){[13,32].includes(t.keyCode)&&t.target.click()})).toDOM():null},t.prototype.renderDeleteButton=function(){var t=this;return Object(r.domel)("div").addClass(s.b+"-button-placeholder",this.cssPrefix+"-button-placeholder",this.cssPrefix+"-deletebutton-placeholder").data("btnplaceholder","").addChild("div",(function(e){return e.addClass(s.b+"-button",s.b+"-column-button",s.b+"-column-button-delete").title(i.i18n.getText("CmdDelete")).attr("tabIndex","0").on("click",(function(e){return t.buttonMenuHandler(o.Delete,e)})).on("keypress",(function(t){13==t.keyCode&&t.target.click()}))})).toDOM()},t.prototype.renderMenuButton=function(){var t=this;return Object(r.domel)("div").addClass(s.b+"-button-placeholder",this.cssPrefix+"-button-placeholder",this.cssPrefix+"-menubutton-placeholder").data("btnplaceholder","").addChild("div",(function(e){return e.addClass(s.b+"-button",s.b+"-column-button",s.b+"-column-button-menu").title(i.i18n.getText("ButtonMenu")).attr("tabIndex","0").on("click",(function(e){return t.buttonMenuHandler(o.Menu,e)})).on("keypress",(function(t){13==t.keyCode&&t.target.click()}))})).toDOM()},t.prototype.getDefaultColumnCaption=function(){return this.getDefaultTitleText(this.baseAttr)},t.prototype.getDefaultTitleText=function(t){return this.getAttributeCaption(t,this.panel.options.titleElementFormat)},t.prototype.getAttributeCaption=function(t,e){return e=e||this.panel.options.attrElementFormat,this.panel.getContext().getModel().getAttributeText(t,e)},t.prototype.getClassesToAdd=function(){var t="";return t+=this.column.enabled?"":" "+this.cssPrefix+"-disabled",this.column.enabled&&(t+=this.column.isReadOnly()?" "+this.cssPrefix+"-readonly":""),t+=this.column.isHidden()?" "+this.cssPrefix+"-hidden":""},t.prototype.renderColumnTypeButton=function(){var t=this;return this.isEditable()&&!1!==this.panel.options.allowAggrColumns?Object(r.domel)("div").addClass(s.b+"-button-placeholder",this.cssPrefix+"-button-placeholder",this.cssPrefix+"-typebutton-placeholder",this.cssPrefix+"-button-active").data("btnplaceholder","").addChild("div",(function(e){return e.addClass(s.b+"-button",s.b+"-column-button",s.b+"-column-button-type").title(i.i18n.getText("ButtonToAggr")).attr("tabIndex","0").on("click",(function(e){e.stopPropagation(),t.keepShowingButtons=!0,t.changeTypeHandler(e)})).on("keypress",(function(t){13==t.keyCode&&t.target.click()}))})).toDOM():null},t.prototype.renderColumnFormatButton=function(){var t=this,e=this.getFormatsMenuItems();return this.isEditable()&&!1!==this.panel.options.allowDisplayFormatChange&&e.length>1?Object(r.domel)("div").addClass(s.b+"-button-placeholder",this.cssPrefix+"-button-placeholder",this.cssPrefix+"-formatbutton-placeholder",this.cssPrefix+"-button-active").data("btnplaceholder","").addChild("div",(function(e){return e.addClass(s.b+"-button",s.b+"-column-button",s.b+"-column-button-format").title(i.i18n.getText("ButtonFormat")).attr("tabIndex","0").on("click",(function(e){e.stopPropagation(),t.keepShowingButtons=!0,t.changeFormatHandler(e)})).on("keypress",(function(t){13==t.keyCode&&t.target.click()}))})).toDOM():null},t.prototype.renderEnabledButton=function(){var t=this;return Object(r.domel)("div").addClass(s.b+"-button-placeholder",this.cssPrefix+"-button-placeholder",this.cssPrefix+"-enablebutton-placeholder",this.cssPrefix+"-button-active").data("btnplaceholder","").addChild("div",(function(e){return e.addClass(s.b+"-button",s.b+"-column-button",s.b+"-column-button-enable").title(i.i18n.getText("CmdToggleEnable")).addClass(t.column.enabled?"enabled":"").attr("tabIndex","0").on("click",(function(e){return t.buttonMenuHandler(o.Enable,e)})).on("keypress",(function(t){13==t.keyCode&&t.target.click()}))})).toDOM()},t.prototype.isEditable=function(){return this.column.enabled&&!this.column.isReadOnly()},t.prototype.changeFormatHandler=function(t){var e=this,n=this.panel.getContext().getModel().getDisplayFormatsForType(this.column.getDataType()),o="{0:__default}";n.filter((function(t){return t.format==e.column.displayFormat})).length>0&&(o=this.column.displayFormat),this.formatsMenu.showMenu({anchor:t.target,selectedIds:o,itemSelectedCallback:function(t,n){return t.id!=o&&("{0:__default}"==t.id?e.column.displayFormat="":e.column.displayFormat=t.id,e.column.fireChangedEvent()),!1},menuClosedCallback:function(){e.keepShowingButtons=!1,e.isMouseOverBlock||e.element.dispatchEvent(Object(r.createBrowserEvent)("mouseleave"))}})},t.prototype.getUIS=function(){return this.panel.getContext().getModel().checkAttrProperty(this.column.expr.value,"useInSorting")},t.prototype.onMouseEnter=function(t){return this.isMouseOverBlock=!0,this.enterButtonBlock(),t.stopPropagation(),!1},t.prototype.onMouseLeave=function(t){return this.isMouseOverBlock=!1,this.leaveButtonBlock(),t.stopPropagation(),!1},t.prototype.isColumnActive=function(){return this.element.classList.contains("active")},t.prototype.hideButtons=function(){Object(r.domel)(this.element).data("show-buttons",null)},t.prototype.showButtons=function(){Object(r.domel)(this.element).data("show-buttons","")},t.prototype.adjustButtonsVisibility=function(){(this.panel.options.alwaysShowButtons||(this.panel.options.accentActiveColumn||l.a.isMobileMode())&&this.isColumnActive())&&this.showButtons()},t.prototype.enterButtonBlock=function(){this.showButtons()},t.prototype.leaveButtonBlock=function(){this.keepShowingButtons||!0===this.panel.options.alwaysShowButtons||this.isColumnActive()&&1==this.panel.options.accentActiveColumn||this.hideButtons()},t.prototype.createFunctionMenu=function(){for(var t,e=[],n=this.panel.getContext().getModel().getAggrFunctions(),o=!0,r=null,s=this.column.getDataType(),l=0,u=n;l<u.length;l++){var c=u[l];if(c){var d=c.getAppliedTypesOrDefault().indexOf(s)>=0;this.column.expr.func!==c.id||d||(o=!1),d&&(t=this.panel.getContext().getModel().getAggrFunctionCaption(c.id),r={id:c.id,text:t},e.push(r))}}o||(this.column.expr.func=e[0].id),this.panel.areCustomExpressionsAllowed()&&(r={id:"CustomSqlDivider",text:"---"},e.push(r),r={id:"CUSTOMSQL",text:t=i.i18n.getText("CustomExpression")},e.push(r));var h=this.column.id;h&&(h+="-FunctionsMenu");var p={items:e,id:h,searchBoxAlwaysShown:!1,domWriteItemsId:!0};this.functionMenu=new a.a(p)},t.prototype.createFormatsMenu=function(){if(0!=this.panel.options.allowDisplayFormatChange){var t=this.column.id;t&&(t+="-FormatsMenu");var e={items:this.getFormatsMenuItems(),id:t,searchBoxAlwaysShown:!1,showSelected:!0,domWriteItemsId:!0};this.formatsMenu=new a.a(e)}},t.prototype.getFormatsMenuItems=function(){var t=this.panel.getContext().getModel().getDisplayFormatsForType(this.column.getDataType());return[{id:"{0:__default}",text:"Default"}].concat(t.map((function(t){return{id:t.format,text:i.i18n.getText("DisplayFormats",t.name)||t.name}})))},t.prototype.getButtonsToShow=function(){return this.panel.options.buttons&&Array.isArray(this.panel.options.buttons)?this.panel.options.buttons:["enable","delete","type","sorting","format"]},t.prototype.buttonMenuHandler=function(t,e){var n=this;switch(t){case o.Delete:var r=this.column.getQuery();r.removeColumn(this.column,this.panel),r.fireColumnsChangedEvent(i.QueryChangeAction.Delete,this.column);break;case o.Enable:this.column.enabled=!this.column.enabled,this.fireColumnChanged();break;case o.Hidden:this.column.setHidden(!this.column.isHidden()),this.fireColumnChanged();break;case o.MoveTop:this.panel.moveColumn(this.column,"MoveTop");break;case o.MoveBottom:this.panel.moveColumn(this.column,"MoveBottom");break;case o.MoveUp:this.panel.moveColumn(this.column,"MoveUp");break;case o.MoveDown:this.panel.moveColumn(this.column,"MoveDown");break;case o.SortingAsc:this.column.sorting=i.SortDirection.Ascending,this.column.fireChangedEvent();break;case o.SortingDesc:this.column.sorting=i.SortDirection.Descending,this.column.fireChangedEvent();break;case o.SortingNone:this.column.sorting=i.SortDirection.None,this.column.fireChangedEvent();break;case o.Menu:var s=this.buttonMenu;this.keepShowingButtons=!0,s.showMenu({anchor:e?e.target:null,selectedIds:this.getButtonMenuSelectedItems(),itemSelectedCallback:function(t){var i=t.id;switch(t.id){case"enable":i=o.Enable;break;case"delete":i=o.Delete;break;case"hidden":i=o.Hidden;break;case"MoveTop":i=o.MoveTop;break;case"MoveBottom":i=o.MoveBottom;break;case"MoveUp":i=o.MoveUp;break;case"MoveDown":i=o.MoveDown;break;case"None":i=o.SortingNone;break;case"Ascending":case"Descending":i=o.SortingAsc}n.buttonMenuHandler(i,e)},itemFilterCallback:function(t){return n.column.enabled||"__group"===t.id||"enable"===t.id||"delete"===t.id},menuClosedCallback:function(){n.keepShowingButtons=!1,n.isMouseOverBlock||n.leaveButtonBlock()}});break;default:this.processFormatsButtonMenuItems(t,e)||this.processExtraButtonMenuItems(t,e)}return e&&e.stopPropagation(),!1},t.prototype.createButtonMenu=function(){if(!this.buttonMenu){var t=this.column.id;t&&(t+="-ButtonMenu");var e=[];e.push({id:"enable",text:i.i18n.getText("MenuEnable")}),this.panel.options.allowHiddenColumns&&e.push({id:"hidden",text:i.i18n.getText("CmdHiddenColumn")}),e.push({id:"delete",text:i.i18n.getText("CmdDelete")});var n=[];n.push({id:"__group",text:" ",items:e});var o=this.panel.options.allowSorting?u(this.panel.getSortMenuList(),this.panel.getMoveMenuList()):this.panel.getMoveMenuList();n.push({id:"__group",text:i.i18n.getText("CmdGroupSort"),items:o});var r=this.getExtraButtonMenuItems();r&&Array.isArray(r)&&(n=u(n,r));var s=this.getFormatsMenuItems();s.length>1&&n.push({id:"__group",text:i.i18n.getText("CmdGroupFormat"),items:s});var l={items:n,id:t,searchBoxAlwaysShown:!1,domWriteItemsId:!0,showSelected:!0};this.buttonMenu=new a.a(l)}},t.prototype.processFormatsButtonMenuItems=function(t,e){var n=this.panel.getContext().getModel().getDisplayFormatsForType(this.column.getDataType());if("{0:__default}"==t)this.column.displayFormat="";else{if(!(n.filter((function(e){return e.format==t})).length>0))return!1;this.column.displayFormat=t}return this.column.fireChangedEvent(),!0},t.prototype.getButtonMenuSelectedItems=function(){var t=this,e=[];this.column.enabled&&e.push("enable"),this.column.isHidden()&&e.push("hidden");var n="{0:__default}";return this.panel.getContext().getModel().getDisplayFormatsForType(this.column.getDataType()).filter((function(e){return e.format==t.column.displayFormat})).length>0&&(n=this.column.displayFormat),e.push(n),e},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var o,i=n(0),r=n(2),s=n(1),a=n(30),l=n(3),u=n(9),c=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.dataTypeMenu=null,e}return c(e,t),e.prototype.getClassesToAdd=function(){return this.cssPrefix+"-row "+this.cssPrefix+"-row-column-entattr"+t.prototype.getClassesToAdd.call(this)},e.prototype.renderColumnTypeButton=function(){var e=t.prototype.renderColumnTypeButton.call(this);return e&&(e.firstElementChild.classList.add("aggregated"),e.firstElementChild.setAttribute("title",i.i18n.getText("ButtonToSimple"))),e},e.prototype.renderExpressionBlock=function(){var t=this;this.column.caption&&""!=this.column.caption||(this.column.caption=this.getDefaultColumnCaption());var e=Object(s.domel)("div").addClass(this.cssPrefix+"-expr-block").addClass(l.a.getMobileCssClass()).toDOM(),n=Object(s.domel)("div",e).addClass(this.cssPrefix+"-colelement",this.cssPrefix+"-attrelement").addClass(l.a.getMobileCssClass());return this.isEditable()?n.addChild("a",(function(e){return e.attr("href","javascript:void(0)").title(t.column.caption).text(t.column.caption).on("touchstart click",(function(e){e.stopPropagation();var n=e.target,o=n.parentElement.querySelector("input");o&&(n.style.display="none",o.style.removeProperty("display"),o.style.width="100%",o.focus(),t.element.setAttribute(s.eqDragManager.DRAG_DISABLED_ATTR,""))}))})).addChild("input",(function(e){return e.hide().value(t.column.expr.sql).on("blur keydown",(function(e){var n=!1,o=!0;if(e instanceof KeyboardEvent?13===e.keyCode?n=!0:27===e.keyCode&&(n=!0,o=!1):e instanceof FocusEvent&&(n=!0),n){var i=e.target,r=i.parentElement.querySelector("a");r&&(r.style.removeProperty("display"),i.style.display="none"),o&&t.column.expr.sql!==i.value?(t.column.expr.sql=i.value,t.fireColumnChanged()):i.value=t.column.expr.sql,t.element.removeAttribute(s.eqDragManager.DRAG_DISABLED_ATTR)}}))})):n.addChild("span",(function(e){e.text(t.column.caption).title(t.column.caption)})),n=Object(s.domel)("div",e).addClass(this.cssPrefix+"-colelement").addChild("span",(function(t){t.text(":").title(":")})),n=Object(s.domel)("div",e).addClass(this.cssPrefix+"-colelement",this.cssPrefix+"-attrelement").addClass(l.a.getMobileCssClass()),this.isEditable()?(this.createDataTypeMenu(),n.addChild("a",(function(e){return e.attr("href","javascript:void(0)").title(i.DataType[t.column.expr.dataType]).text(i.DataType[t.column.expr.dataType]).on("touchstart click",(function(n){n.stopPropagation(),t.dataTypeMenu.showMenu({anchor:e.toDOM(),selectedIds:null,itemSelectedCallback:function(e,n){t.column.expr.dataType=e.id,t.fireColumnChanged()}})}))}))):(this.column.expr.dataType,n.addChild("span",(function(e){e.text(i.DataType[t.column.expr.dataType]).title(i.DataType[t.column.expr.dataType])}))),e},e.prototype.changeTypeToSimple=function(){this.column.getQuery().changeColumnType(this.column,r.ExprTag.EntityAttribute),this.fireColumnChanged()},e.prototype.getDefaultColumnCaption=function(){return"Custom SQL Column"},e.prototype.getDefaultValue=function(){return this.column.expr.sql},e.prototype.getUIS=function(){return!0},e.prototype.changeTypeHandler=function(t){this.changeTypeToSimple()},e.prototype.processExtraButtonMenuItems=function(t,e){return this.changeTypeToSimple(),!0},e.prototype.createFunctionMenu=function(){},e.prototype.getExtraButtonMenuItems=function(){return[{id:"__group",text:i.i18n.getText("ColTypeGroup"),items:[{id:"type",text:i.i18n.getText("ColTypeSimple")}]}]},e.prototype.createDataTypeMenu=function(){var t=[];for(var e in i.DataType)if(!isNaN(Number(e))){var n={id:e,text:i.DataType[e]};t.push(n)}var o=this.column.id;o&&(o+="-DataTypeMenu");var r={items:t,id:o,searchBoxAlwaysShown:!1,domWriteItemsId:!0};this.dataTypeMenu=new u.a(r)},e}(a.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var o,i=n(0),r=n(2),s=n(41),a=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.getClassesToAdd=function(){return t.prototype.getClassesToAdd.call(this)+" "+this.cssPrefix+"-row "+this.cssPrefix+"-row-column-aggr"},e.prototype.getAttribute=function(){return this.bar.getContext().getModel().getAttributeByIdSafe(this.column.expr.args[0].value)},e.prototype.getDefaultCaption=function(){return this.getDefaultTitleText(this.baseAttr)+" "+this.bar.getContext().getModel().getAggrFunctionCaption(this.column.expr.func)},e.prototype.renderColumnTypeButton=function(){var e=t.prototype.renderColumnTypeButton.call(this);return e&&(e.classList.add("aggregated"),e.title=i.i18n.getText("ButtonToSimple")),e},e.prototype.baseExpressionItemSelectedCallback=function(t,e){var n=t.id;this.column.expr.args[0].setValue(n,!0),this.column.caption="",this.fireColumnChanged()},e.prototype.changeTypeToSimple=function(){this.column.getQuery().changeColumnType(this.column,r.ExprTag.EntityAttribute),this.fireColumnChanged()},e.prototype.changeColumnTypeHandler=function(t){this.changeTypeToSimple()},e}(s.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var o=n(0),i=n(2),r=n(1),s=n(4),a=n(3),l=n(9),u=function(){function t(t,e,n){this.functionMenu=null,this.formatsMenu=null,this.isMouseOverBlock=!1,this.keepShowingButtons=!1,this.tapedTwice=!1,this.bar=t,this.column=e,this.element=n}return Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"eqjs-cb"},enumerable:!0,configurable:!0}),t.prototype.render=function(){var t=this;this.baseAttr=this.getAttribute();var e=Object(r.domel)("div");return e.data("id",this.column.id),this.element&&this.element.parentNode.replaceChild(e.toDOM(),this.element),this.element=e.toDOM(),this.bar.options.allowDragDrop&&r.eqDragManager.registerDraggableItem({element:this.element,scope:"entityAttrSort",beforeDragStart:function(){return t.element.dispatchEvent(Object(r.createBrowserEvent)("mouseleave"))},onDragStart:function(e){t.hideButtons(),t.element.style.display="none",e.dropEffect=r.DropEffect.Allow},onDragEnd:function(e){e.data.finishedSuccessfully||t.element.removeAttribute("style")},data:{column:this.column}}),this.column.isReadOnly()||(this.createFunctionMenu(),this.createFormatsMenu()),e.addClass(this.getClassesToAdd()).addClass(a.a.getMobileCssClass()).addChildElement(this.renderCaptionBlock()).addChildElement(this.renderSortingImage()),a.a.isMobileMode()||e.addChildElement(this.renderButtonsBlock()),e.on("mouseenter",this.onMouseEnter.bind(this)).on("mouseleave",this.onMouseLeave.bind(this)),(this.bar.options.accentActiveColumn||a.a.isMobileMode())&&e.on("touchstart click",this.onMouseClick.bind(this)),this.element},t.prototype.fireColumnChanged=function(){this.column.fireChangedEvent()},t.prototype.refresh=function(){this.render()},t.prototype.getAttribute=function(){return this.bar.getContext().getModel().getAttributeByIdSafe(this.column.expr.value)},t.prototype.isEditable=function(){return this.column.enabled&&!this.column.isReadOnly()},t.prototype.renderButtonsBlock=function(){return Object(r.domel)("div",this.element).addClass(s.b+"-column-buttonsBlock",this.cssPrefix+"-buttonsBlock").addChildElement(this.renderSortingButton()).addChildElement(this.renderColumnTypeButton()).addChildElement(this.renderColumnFormatButton()).addChildElement(this.renderDeleteButton()).toDOM()},t.prototype.renderCaptionBlock=function(){var t=this;this.column.caption&&""!=this.column.caption||(this.column.caption=this.getDefaultCaption());var e=this.column.getModel(),n=this.baseAttr!==e.nullAttribute?this.column.caption:e.getAttributeText(e.nullAttribute,"{attr}");if(!this.isEditable())return Object(r.domel)("div").addClass(this.cssPrefix+"-colelement",this.cssPrefix+"-captionelement").addClass(a.a.getMobileCssClass()).addChild("div",(function(e){return e.title(t.column.caption).text(n).attr("tabIndex","0")})).toDOM();var o=!1;return Object(r.domel)(this.element).on("touchstart dblclick",(function(e){if(e instanceof TouchEvent&&!t.tapedTwice)return t.tapedTwice||(t.tapedTwice=!0,setTimeout((function(){t.tapedTwice=!1}),300)),!0;e.stopPropagation(),o=t.element.querySelector("a")==document.activeElement;var n=t.element.querySelector("."+t.cssPrefix+"-captionelement input"),i=t.element.querySelector("."+t.cssPrefix+"-captionelement a");return n&&(n.style.width=t.element.clientWidth+"px",i.style.display="none",n.style.removeProperty("display"),n.focus(),t.element.setAttribute(r.eqDragManager.DRAG_DISABLED_ATTR,"")),!1})),Object(r.domel)("div").addClass(this.cssPrefix+"-colelement",this.cssPrefix+"-captionelement").addClass(a.a.getMobileCssClass()).addChild("a",(function(e){return e.attr("href","javascript:void(0)").title(t.column.caption).text(n).on("keydown",(function(e){var n=e;if((n.ctrlKey||n.metaKey)&&(13==n.keyCode||10==n.keyCode)&&t.isColumnActive()){var o=document.createEvent("MouseEvents");return o.initEvent("dblclick",!0,!0),t.element.dispatchEvent(o),n.stopPropagation(),!1}return!0}))})).addChild("input",(function(e){return e.hide().value(t.column.caption).on("blur keydown",(function(e){var n=!1,i=!0;if(e instanceof KeyboardEvent?13===e.keyCode?n=!0:27===e.keyCode&&(n=!0,i=!1):e instanceof FocusEvent&&(n=!0),n){var s=e.target,a=s.parentElement.querySelector("a");a&&(a.style.removeProperty("display"),s.style.display="none"),i&&t.column.caption!==s.value?(t.column.caption=s.value,t.fireColumnChanged()):s.value=t.column.caption,t.element.removeAttribute(r.eqDragManager.DRAG_DISABLED_ATTR),o&&t.element.querySelector("a").focus()}}))})).toDOM()},t.prototype.renderSortingImage=function(){var t=this,e=s.b+"-column-sortbutton",n=e;switch(this.column.sorting){case i.SortDirection.Ascending:n=e+"-asc";break;case i.SortDirection.Descending:n=e+"-desc"}return this.column.sorting==i.SortDirection.None?null:Object(r.domel)("div").addClass(this.cssPrefix+"-colelement",this.cssPrefix+"-sortimage-placeholder").addClass(a.a.getMobileCssClass()).addChild("div",(function(e){return e.addClass(t.cssPrefix+"-img-sorting",n).title(o.i18n.getText("ButtonSorting"))})).toDOM()},t.prototype.buttonSortingClickHandler=function(t,e){var n=this;return t.stopPropagation(),this.keepShowingButtons=!0,(this.getUIS()&&this.bar.sortMenu||this.bar.moveMenu).showMenu({anchor:e,selectedIds:null,itemSelectedCallback:function(t,e){var o;if("None"==t.id||"Ascending"==t.id||"Descending"==t.id){var r=n.bar.getQuery();n.column.sorting="None"==(o=t.id)?i.SortDirection.None:"Ascending"==o?i.SortDirection.Ascending:"Descending"==o?i.SortDirection.Descending:void 0,n.column.sortIndex=r.getColumnSortIndex(n.column),n.fireColumnChanged()}else n.bar.moveColumn(n.column,t.id)},menuClosedCallback:function(){n.keepShowingButtons=!1,n.isMouseOverBlock||n.leaveButtonBlock()}}),!1},t.prototype.renderSortingButton=function(){var t=this;if(!this.isEditable())return null;var e=Object(r.domel)("div").addClass(s.b+"-column-button",s.b+"-column-sortbutton",s.b+"-column-sortbutton-none").title(o.i18n.getText("ButtonSorting")).attr("tabIndex","0").on("touchstart click",(function(n){return t.buttonSortingClickHandler(n,e.toDOM())})).on("keypress",(function(t){13==t.keyCode&&t.target.click()}));return e.toDOM()},t.prototype.buttonDeleteClickHandler=function(t){t.stopPropagation();var e=this.bar.getQuery();return e.removeColumn(this.column,this.bar),e.fireColumnsChangedEvent(i.QueryChangeAction.Delete,this.column),!1},t.prototype.renderDeleteButton=function(){var t=this;return this.column.isReadOnly()?null:Object(r.domel)("div").addClass(s.b+"-column-button",s.b+"-column-button-delete").title(o.i18n.getText("CmdDelete")).attr("tabIndex","0").on("touchstart click",(function(e){return t.buttonDeleteClickHandler(e)})).on("keypress",(function(t){13==t.keyCode&&t.target.click()})).toDOM()},t.prototype.getDefaultCaption=function(){return this.getDefaultTitleText(this.baseAttr)},t.prototype.getDefaultTitleText=function(t){var e=this.bar.options.titleElementFormat||this.bar.options.attrElementFormat;return this.bar.getContext().getModel().getAttributeText(t,e)},t.prototype.getClassesToAdd=function(){var t="";return t+=this.column.enabled?"":" "+this.cssPrefix+"-disabled",this.column.enabled&&(t+=this.column.isReadOnly()?" "+this.cssPrefix+"-readonly":""),t},t.prototype.buttonTypeClickHandler=function(t){return t.stopPropagation(),this.keepShowingButtons=!0,this.changeColumnTypeHandler(t),!1},t.prototype.buttonFormatClickHandler=function(t){return t.stopPropagation(),this.keepShowingButtons=!0,this.changeFormatHandler(t),!1},t.prototype.formatButtonIsShown=function(){return!1!==this.bar.options.allowDisplayFormatChange&&this.bar.getContext().getModel().getDisplayFormatsForType(this.column.getDataType()).length>0},t.prototype.changeFormatHandler=function(t){var e=this,n=this.bar.getContext().getModel().getDisplayFormatsForType(this.column.getDataType()),o="{0:__default}";n.filter((function(t){return t.format==e.column.displayFormat})).length>0&&(o=this.column.displayFormat),this.formatsMenu.showMenu({anchor:t.target,selectedIds:o,itemSelectedCallback:function(t,n){return t.id!=o&&("{0:__default}"==t.id?e.column.displayFormat="":e.column.displayFormat=t.id,e.column.fireChangedEvent()),!1},menuClosedCallback:function(){e.keepShowingButtons=!1,e.isMouseOverBlock||e.element.dispatchEvent(Object(r.createBrowserEvent)("mouseleave"))}})},t.prototype.renderColumnTypeButton=function(){var t=this;return this.isEditable()&&!1!==this.bar.options.allowAggrColumns?Object(r.domel)("div").addClass(s.b+"-column-button",s.b+"-column-button-type").title(o.i18n.getText("ButtonToAggr")).attr("tabIndex","0").on("touchstart click",(function(e){return t.buttonTypeClickHandler(e)})).on("keypress",(function(t){13==t.keyCode&&t.target.click()})).toDOM():null},t.prototype.renderColumnFormatButton=function(){var t=this;return this.isEditable()&&this.formatButtonIsShown()?Object(r.domel)("div").addClass(s.b+"-column-button",s.b+"-column-button-format").title(o.i18n.getText("ButtonFormat")).attr("tabIndex","0").on("touchstart click",(function(e){return t.buttonFormatClickHandler(e)})).on("keypress",(function(t){13==t.keyCode&&t.target.click()})).toDOM():null},t.prototype.getUIS=function(){return this.bar.getContext().getModel().checkAttrProperty(this.column.expr.value,"useInSorting")},t.prototype.onMouseClick=function(t){this.bar.toggleColumnPicked(this.column),this.adjustButtonsVisibility()},t.prototype.onMouseEnter=function(t){if(!a.a.isMobileMode())return this.isMouseOverBlock=!0,this.enterButtonBlock(),t.stopPropagation(),!1},t.prototype.onMouseLeave=function(t){if(!a.a.isMobileMode())return this.isMouseOverBlock=!1,this.leaveButtonBlock(),t.stopPropagation(),!1},t.prototype.isColumnActive=function(){return this.element.classList.contains("active")},t.prototype.hideButtons=function(){a.a.isMobileMode()?this.onHideButtonsMobile&&this.onHideButtonsMobile():Object(r.domel)(this.element).data("show-buttons",null)},t.prototype.showButtons=function(){a.a.isMobileMode()?this.onShowButtonsMobile&&this.onShowButtonsMobile():Object(r.domel)(this.element).data("show-buttons","")},t.prototype.adjustButtonsVisibility=function(){this.bar.options.alwaysShowButtons||(this.bar.options.accentActiveColumn||a.a.isMobileMode())&&this.isColumnActive()?this.showButtons():this.hideButtons()},t.prototype.enterButtonBlock=function(){this.showButtons()},t.prototype.leaveButtonBlock=function(){1==this.bar.options.alwaysShowButtons||this.isColumnActive()&&1==this.bar.options.accentActiveColumn||this.hideButtons()},t.prototype.createFunctionMenu=function(){for(var t,e=[],n=this.bar.getContext().getModel().getAggrFunctions(),i=!0,r=null,s=this.column.getDataType(),a=0,u=n;a<u.length;a++){var c=u[a];if(c){var d=c.getAppliedTypesOrDefault().indexOf(s)>=0;this.column.expr.func!==c.id||d||(i=!1),d&&(t=this.bar.getContext().getModel().getAggrFunctionCaption(c.id),r={id:c.id,text:t},e.push(r))}}i||(this.column.expr.func=e[0].id),this.bar.areCustomExpressionsAllowed()&&(r={id:"CustomSqlDivider",text:"---"},e.push(r),r={id:"CUSTOMSQL",text:t=o.i18n.getText("CustomExpression")},e.push(r));var h=this.element.id;h&&(h+="-FunctionsMenu");var p={items:e,id:h,searchBoxAlwaysShown:!1,domWriteItemsId:!0};this.functionMenu=new l.a(p)},t.prototype.createFormatsMenu=function(){if(0!=this.bar.options.allowDisplayFormatChange){var t=this.column.id;t&&(t+="-FormatsMenu");var e={items:this.getFormatsMenuItems(),id:t,searchBoxAlwaysShown:!1,showSelected:!0,domWriteItemsId:!0};this.formatsMenu=new l.a(e)}},t.prototype.getFormatsMenuItems=function(){var t=this.bar.getContext().getModel().getDisplayFormatsForType(this.column.getDataType());return[{id:"{0:__default}",text:"Default"}].concat(t.map((function(t){return{id:t.format,text:o.i18n.getText("DisplayFormats",t.name)||t.name}})))},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var o=n(1),i=n(3),r=function(){function t(t,e,n){this.panel=t,this.text=e,this.element=n||Object(o.domel)("div").toDOM()}return Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"eqjs-qp"},enumerable:!0,configurable:!0}),t.prototype.refresh=function(){this.render()},t.prototype.render=function(){var t=this;return Object(o.domel)(this.element).html("").addClass(this.getClassesToAdd()).addClass(i.a.getMobileCssClass()).addChild("span",(function(e){return e.text(t.text).title(t.text)})).toDOM(),this.element},t.prototype.getClassesToAdd=function(){return this.cssPrefix+"-condelement"},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return d})),n.d(e,"b",(function(){return h}));var o,i=n(0),r=n(2),s=n(1),a=n(35),l=n(3),u=n(79),c=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=function(t){function e(e,n,o){var i=t.call(this,e,n,o)||this;return i.isRoot=!n.getParent(),i}return c(e,t),e.prototype.getClassesToAdd=function(){var t=this.cssPrefix+"-group";return this.isRoot&&(t+=" "+this.cssPrefix+"-group-root"),t},e.prototype.coreRender=function(t){Object(s.domel)(this.element).addClass(this.getClassesToAdd()).addClass(l.a.getMobileCssClass()).addChildElement(this.renderGroupRow()).addChildElement(this.renderConditions(t)).data("id",this.condition.id).data("group","")},e.prototype.renderGroupRow=function(){return this.isRoot&&!this.panel.options.showRootRow?null:new h(this.panel,this.condition).render()},e.prototype.renderConditions=function(t){var e=this,n=Object(s.domel)("div");return n.addClass(this.cssPrefix+"-conditions").addClass(""+l.a.getMobileCssClass()).data("conditions",""),this.isRoot&&n.addClass(this.cssPrefix+"-conditions-root"),this.condition.getConditions().forEach((function(o,i,r){var s=e.panel.getConditionRenderer(o);s&&n.addChildElement(s.render(t&&i==r.length-1))})),n.toDOM()},e}(a.b),h=function(t){function e(e,n,o){var i=t.call(this,e,n,o)||this;return i.isRoot=!i.condition.getParent(),i}return c(e,t),e.prototype.getButtonsToShow=function(){return this.panel.options.buttons&&this.panel.options.buttons.group&&Array.isArray(this.panel.options.buttons.group)?this.panel.options.buttons.group:["addCondition","addGroup","enable","delete"]},e.prototype.getClassesToAdd=function(){var t;if(this.isRoot)t=this.cssPrefix+"-row "+this.cssPrefix+"-row-group "+this.cssPrefix+"-row-group-root";else{t=this.cssPrefix+"-row "+this.cssPrefix+"-row-group";var e=this.condition.getLevel();e>0&&(t+=" "+this.cssPrefix+"-level-"+e),t+=this.condition.enabled?"":" "+this.cssPrefix+"-disabled",this.condition.enabled&&(t+=this.condition.isReadOnly()?" "+this.cssPrefix+"-readonly":"")}return t},e.prototype.coreRender=function(t){var e=this,n=Object(s.domel)(this.element).addClass(this.getClassesToAdd()).addClass(l.a.getMobileCssClass()).data("group-row","").addChildElement(this.renderCheckbox()).addChildElement(this.renderConjunction()),o=this.condition.getLevel();o>0&&n.addClass(this.cssPrefix+"-level-"+o),this.buildGroupElements(n,this.getGroupTitle()),this.panel.options.accentActiveCondition&&n.on("click",(function(t){e.panel.toggleConditionPicked(e.condition),e.adjustButtonsVisibility(),l.a.isMobileMode()||n.toDOM().dispatchEvent(Object(s.createBrowserEvent)("mouseenter"))})),n.addChildElement(this.renderButtonsBlock()),l.a.isMobileMode()||n.on("mouseenter",(function(t){return e.isMouseOverBlock=!0,e.enterButtonBlock(),t.stopPropagation(),!1})).on("mouseleave",(function(t){return e.isMouseOverBlock=!1,!e.keepShowingButtons&&Object(s.domel)(e.buttonsBlock).isVisible()&&e.leaveButtonBlock(),t.stopPropagation(),!1}))},e.prototype.getGroupTitle=function(){var t;return this.isRoot&&!l.a.isMobileMode()?(t=i.i18n.getText("RootConditionGroupTitle"))||(t=i.i18n.getText("RootPredicateTitle")):(t=i.i18n.getText("ConditionGroupTitle"))||(t=i.i18n.getText("PredicateTitle")),t},e.prototype.buildGroupElements=function(t,e){var n=this,o=e.indexOf("{lt}");if(o<0)t.addText(i.i18n.getText("ErrIncorrectGroupTitleFormat")),t.addClass(this.cssPrefix+"-error");else{o>0&&t.addChild("span",(function(t){t.addClass(n.cssPrefix+"-grelement").addText(e.substring(0,o))}));var s=r.equtils.linkTypeToStr(this.condition.linkType),a=i.utils.findItemById(r.eqconsts.predicateLinkTypeList,s);a||(a=r.eqconsts.predicateLinkTypeList[0]),this.isEditable()?Object(u.b)(t.toDOM()).onGetMenu((function(){return n.getLinkTypeMenu()})).onItemSelected((function(t){n.condition.linkType=r.equtils.strToLinkType(t),n.condition.fireChangedEvent()})).addText(i.i18n.getText(a.key)).title(i.i18n.getText(a.key)).addClass(this.cssPrefix+"-grelement"):t.addChild("span",(function(t){t.text(i.i18n.getText(a.key)).title(i.i18n.getText(a.key)).addClass(n.cssPrefix+"-grelement")})),t.addChild("span",(function(t){t.addClass(n.cssPrefix+"-grelement").addText(e.substring(o+4))}))}},e.prototype.getConditionMenu=function(){return this.panel.getConditionGroupMenu(null==this.condition.getParent())},e.prototype.getLinkTypeMenu=function(){return this.panel.getLinkTypeMenu()},e.prototype.renderConjunction=function(){return this.isRoot?null:t.prototype.renderConjunction.call(this)},e.prototype.renderCheckbox=function(){return this.isRoot?null:t.prototype.renderCheckbox.call(this)},e.prototype.leaveButtonBlock=function(){this.panel.options.alwaysShowButtonsInGroups||this.isConditionActive()&&this.panel.options.accentActiveCondition||this.hideButtons()},e.prototype.adjustButtonsVisibility=function(){(this.panel.options.alwaysShowButtonsInGroups||this.panel.options.accentActiveCondition&&this.isConditionActive())&&this.showButtons()},e}(a.c)},function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return a}));var o,i=n(1),r=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t){function e(e){var n=t.call(this,"a",e)||this;return n.attr("href","javascript:void(0)"),n.on("click",(function(t){return t.preventDefault(),n.appear(),!1})),n}return r(e,t),e.prototype.onGetMenu=function(t){return this._onGetMenu=t,this},e.prototype.onItemSelected=function(t){return this._onItemSelected=t,this},e.prototype.appear=function(){var t=this,e=this._onGetMenu?this._onGetMenu():null;e&&e.showMenu({anchor:this.element,itemSelectedCallback:function(e){return t._onItemSelected&&t._onItemSelected(e.id),!1}})},e}(i.DomElementBuilder);function a(t){return new s(t)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var o,i=n(0),r=n(2),s=n(1),a=n(24),l=n(10),u=n(3),c=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.renderEditor=function(){var t=this;this.inputBuilder=Object(s.domel)("input").hide().addClass(this.cssPrefix+"-ve-editbox").type("text").on("blur",(function(e){if(t.inputBuilder.isVisible()&&!t.dontProcessBlur){var n=t.validateInput(t.inputElement.value);return n.success?(t.setValue(t.inputElement.value),t.closeEditor()):(t.dontProcessBlur=!0,t.inputElement.focus(),setTimeout((function(){t.dontProcessBlur=!1}),200),t.showValidationError(n.message,e.target)),e.stopPropagation(),!1}})).on("keydown",(function(e){return 27===e.keyCode?(t.closeEditor(),e.stopPropagation(),!1):13===e.keyCode&&t.inputBuilder.isVisible()?(t.dontProcessBlur=!0,t.validateInput(t.inputElement.value).success?(t.setValue(t.inputElement.value),t.closeEditor(),t.dontProcessBlur=!1):(t.inputElement.focus(),setTimeout((function(){t.dontProcessBlur=!1}),200)),e.stopPropagation(),!1):void 0})),this.inputElement=this.inputBuilder.toDOM(),Object(s.domel)(this.element).addChildElement(this.inputElement)},e.prototype.showEditor=function(){var t=200;if(!u.a.isMobileMode()){var e=this.element.offsetLeft,n=this.element.offsetWidth>t?this.element.offsetWidth:t,o=this.element.parentElement.clientWidth-e-55;this.inputBuilder.removeStyle("left").removeStyle("right"),o<t?this.inputBuilder.setStyle("right","55px").setStyle("width","200px"):o<n?this.inputBuilder.setStyle("left",e+"px").setStyle("width",o+"px"):this.inputBuilder.setStyle("left",e+"px").setStyle("width",n+"px")}Object(s.domel)(this.labelElement).hide(),this.inputBuilder.value(this.getValue()).show(),this.inputElement.focus()},e.prototype.closeEditor=function(){this.inputBuilder.hide(),Object(s.domel)(this.labelElement).show(),this.labelElement.focus()},e.prototype.validateInput=function(t){this.inputBuilder.removeClass("eqjs-invalid");var e={success:!0,value:t};return this.expression.kind==r.DataKind.List?this.validateListInput(t,e):this.validateScalarInput(t,e),e},e.prototype.validateListInput=function(t,e){for(var n=0,o=t.split(/\s*,\s*/);n<o.length;n++){var i=o[n];if(this.validateScalarInput(i,e),!e.success)return}},e.prototype.validateScalarInput=function(t,e){if(t&&i.utils.isNumericType(this.expression.dataType)){var n=+t;isNaN(n)&&(e.success=!1,e.message='"'+t+'" '+i.i18n.getText("ErrNotNumber")),i.utils.isIntType(this.expression.dataType)&&n!=parseInt(t,10)&&(e.success=!1,e.message='"'+t+'" '+i.i18n.getText("ErrIncorrectInteger"))}},e.prototype.showValidationError=function(e,n){t.prototype.showValidationError.call(this,e,n),this.inputBuilder.addClass("eqjs-invalid")},e.prototype.isEditable=function(){return t.prototype.isEditable.call(this)&&(this.panel.options.editableParts&l.a.Value)===l.a.Value},e}(a.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var o,i=n(0),r=n(2),s=n(1),a=n(43),l=n(4),u=n(10),c=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=function(t){function e(e,n,o){var i=t.call(this,o)||this;return i.panel=e,i.menu=n,i}return c(e,t),Object.defineProperty(e.prototype,"cssPrefix",{get:function(){return"eqjs-qp"},enumerable:!0,configurable:!0}),e.prototype.getLabelText=function(){return i.i18n.getText("CmdClickToAddCondition")},e.prototype.getClassesToAdd=function(){return l.b+"-addrow "+this.cssPrefix+"-addrow"},e.prototype.isEditable=function(){return t.prototype.isEditable.call(this)&&(this.panel.options.editableParts&u.a.Addition)===u.a.Addition},e.prototype.renderLabelElement=function(){var t=this,e=this.getLabelText();return this.isEditable()?this.labelElement=Object(s.domel)("a").attr("href","javascript:void(0)").title(e).text(e).on("click",(function(e){return e.preventDefault(),t.showEditor(),!1})).toDOM():this.labelElement=Object(s.domel)("div").toDOM(),this.labelElement},e.prototype.renderEditor=function(){},e.prototype.itemSelected=function(t){var e=this.panel.getQuery(),n={parent:e.getRootCondition(),attributeId:t},o=e.addSimpleCondition(n);o&&e.fireConditionsChangedEvent(r.QueryChangeAction.Add,o)},e.prototype.getMenu=function(){return this.menu},e}(a.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var o,i=n(0),r=n(2),s=n(43),a=n(9),l=n(10),u=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c=function(t){function e(e,n,o,i){var r=t.call(this,i)||this;return r.panel=e,r.condition=n,r.displayedText=o,r}return u(e,t),Object.defineProperty(e.prototype,"cssPrefix",{get:function(){return"eqjs-qp"},enumerable:!0,configurable:!0}),e.prototype.renderEditor=function(){var t=this,e=this.panel.getContext().getModel(),n=this.panel.getQuery(),o=[],s=(this.condition&&this.condition.expressions&&this.condition.expressions[0]?this.condition.expressions[0].value:null)?e.getAttributeById(this.condition.expressions[0].value):null;s&&s.operators&&s.operators.forEach((function(s){var a=e.getOperatorById(s),l=function(t){return t.defaultOperand.kind==r.DataKind.Query}(a);!n.isEx()&&l||!a||t.panel.options.isSubQuery&&l||o.push({id:s,text:i.i18n.getText("Operators",s,"caption")||a.caption})}));var l={items:o,adjustHeight:this.panel.options.adjustEntitiesMenuHeight,id:i.utils.generateId("opmn"),domWriteItemsId:this.panel.options.domWriteItemsId};i.utils.assign(l,this.panel.options.menuOptions),this.menu=new a.a(l)},e.prototype.getLabelText=function(){return this.displayedText},e.prototype.getEmptyText=function(){return this.panel.options.emptyTextOperator||i.i18n.getText("MsgEmptyOperator")},e.prototype.getClassesToAdd=function(){return this.cssPrefix+"-condelement "+this.cssPrefix+"-operelement"},e.prototype.isEditable=function(){return this.condition.enabled&&!this.condition.isReadOnly()&&(this.panel.options.editableParts&l.a.Operator)===l.a.Operator},e.prototype.itemSelected=function(t){this.condition.setOperatorId(t),this.condition.fireChangedEvent(r.ConditionPart.Operator)},e.prototype.getMenu=function(){return this.menu},e}(s.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var o,i=n(0),r=n(1),s=n(24),a=n(10),l=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.dtp=null,e.internalDateFormat="yyyy-MM-dd",e.internalTimeFormat="HH:mm",e}return l(e,t),e.prototype.renderEditor=function(){},e.prototype.showEditor=function(){var t=this;if(!this.dtp){var e={yearRange:this.panel.options.yearRange,showCalendar:this.expression.dataType!==i.DataType.Time,showTimePicker:this.expression.dataType!==i.DataType.Date,oneClickDateSelection:this.panel.options.oneClickDateSelection,showDateTimeInput:this.panel.options.showDateTimeInput,onApply:function(e){var n=t.convertToInternalFormat(e);t.setValue(n),t.dtp=null,setTimeout((function(){return t.labelElement.focus()}),100)},onCancel:function(){t.labelElement.innerText=t.getLabelText(),t.dtp=null,setTimeout((function(){return t.labelElement.focus()}),100)},onDateTimeChanged:function(e){var n=i.i18n.dateTimeToStr(e,t.expression.dataType);t.labelElement.innerText=n}};this.dtp=this.panel.options.dateTimePickerResolver?this.panel.options.dateTimePickerResolver(e):new r.DefaultDateTimePicker(e);var n=this.expression.getModel(),o=this.expression.value,s=new Date;s=this.expression.dataType!=i.DataType.Time&&n.isDateMacro(o)?n.getDateMacroValue(o):this.expression.dataType==i.DataType.Time&&n.isTimeMacro(o)?n.getTimeMacroValue(o):this.convertFromInternalFormat(o),this.dtp.setDateTime(s),this.dtp.show(this.element)}},e.prototype.closeEditor=function(){this.dtp.cancel(),this.dtp=null},e.prototype.getLabelText=function(){if(!this.expression.value)return this.getEmptyText();var t=this.expression.value,e=this.expression.getModel();if(!e)throw new Error("DataModel is not defined for "+this.expression.value);if(e.isDateMacro(t)||e.isTimeMacro(t)){var n=t.substring(3,t.length-2),o=i.i18n.getText(n);return o||"${{Today}}"}return i.i18n.dateTimeToStr(this.convertFromInternalFormat(t),this.expression.dataType)},e.prototype.isEditable=function(){return t.prototype.isEditable.call(this)&&(this.panel.options.editableParts&a.a.Value)===a.a.Value},e.prototype.convertFromInternalFormat=function(t){return i.utils.strToDateTime(t,this.internalDateFormat+" "+this.internalTimeFormat)},e.prototype.convertToInternalFormat=function(t){return i.utils.dateTimeToStr(t,this.internalDateFormat+" "+this.internalTimeFormat)},e}(s.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var o,i=n(0),r=n(2),s=n(1),a=n(24),l=n(9),u=n(25),c=n(10),d=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return d(e,t),e.prototype.renderEditor=function(){this.dialogBlockBody=Object(s.domel)("div").addClass("kfrm-form").toDOM(),this.createEntitiesMenu(),this.renderColumnBlock(),this.renderQueryPanelBlock()},e.prototype.isEditable=function(){return t.prototype.isEditable.call(this)&&(this.panel.options.editableParts&c.a.Value)===c.a.Value},e.prototype.setValue=function(t,e){t instanceof r.Query&&(this.expression.subQuery=t,e||this.expression.getParent().fireChangedEvent(r.ConditionPart.Value))},e.prototype.createEntitiesMenu=function(){var t=this.getContext().getModel(),e=this.expression.dataType;if(this.colEntitiesList=t.getEntitiesTreeWithFilter((function(t,n){return n?n.useInConditions&&n.dataType===e:t.attributes&&t.useInConditions})),!t||t.isEmpty())return null;var n=this.element.getAttribute("data-id");n&&(n+="-SubColumnMenu");var o={items:this.colEntitiesList,adjustHeight:this.panel.options.adjustEntitiesMenuHeight,id:n,isSubQuery:!0,domWriteItemsId:this.panel.options.domWriteItemsId};i.utils.assign(o,this.panel.options.menuOptions),this.colEntitiesMenu=new l.a(o)},e.prototype.renderColumnBlock=function(){var t=this;this.columnBlock=Object(s.domel)("div",this.dialogBlockBody).addClass("kfrm-field").addChild("label",(function(t){return t.addText(i.i18n.getText("SubQueryColumnTitle"))})).addChild("a",(function(e){return t.columnElement=e.attr("href","javascript:void(0)").on("click",(function(e){t.colEntitiesMenu.showMenu({anchor:t.columnElement,selectedIds:null,itemSelectedCallback:function(e,n){var o=e.id;return t.setResultAttributeId(o),!1}})})).toDOM()})).toDOM()},e.prototype.getEmptyText=function(){return this.panel.options.emptyTextValue||i.i18n.getText("MsgSubQueryValue")},e.prototype.renderQueryPanelBlock=function(){var t=Object(s.domel)("div",this.dialogBlockBody).addClass("kfrm-field").addChild("label",(function(t){return t.addText(i.i18n.getText("SubQueryQueryPanelCaption"))})).toDOM();this.queryPanelBlock=Object(s.domel)("div",t).toDOM();var e=this.element.getAttribute("data-id");e&&(this.queryPanelBlock.id=e+"-SubQueryPanel")},e.prototype.setResultAttributeId=function(t){var e=this.getContext().getModel().getAttributeById(t);if(e){var n=this.getSubQuery(),o=n.getColumns(),i=void 0;if(o.length>0)(i=o[0]).expr.setValue(t),i.expr.dataType=e.dataType,i.fireChangedEvent();else{(i=n.createColumn()).sorting=r.SortDirection.None,i.sortIndex=-1;var s=new r.Expression(i);s.setValue(t),s.tag=r.ExprTag.EntityAttribute,s.kind=r.DataKind.Attribute,s.dataType=e.dataType,i.expr=s,o.push(i),n.fireColumnsChangedEvent(r.QueryChangeAction.Add,i)}this.columnElement.innerText=this.getAttributeText(e)}},e.prototype.getSubQuery=function(){return this.queryPanel.getQuery()},e.prototype.getAttributeText=function(t){if(!t)return i.i18n.getText("SubQueryEmptyColumn");var e=i.i18n.getText("Attributes",t.id);e||(e=t.caption);var n=this.panel.options.attrElementFormat;if(!n)return e;var o=n.replace(new RegExp("{attr}","g"),e),r=this.getContext().getModel().getFullEntityPathByAttr(t.id,".");return o.replace(new RegExp("{entity}","g"),r)},e.prototype.showEditor=function(){var t=this,e=this.panel,n=this.getContext();this.queryPanelBlock.innerHTML="";var o=n.createQuery();this.expression.subQuery&&o.loadFromData(this.expression.subQuery.toJSONData());var s=i.utils.assign({},e.options);s.isSubQuery=!0,s.showAddRow=!0,s.menuContainer=document.body,s.menuOptions.isSubQuery=!0,s.entitiesListFilter=function(t,n){if(e.options.entitiesListFilter){var o=n||{};o.isSubQuery=!0,e.options.entitiesListFilter(t,o)}},this.queryPanel=new u.a(this.queryPanelBlock,o),this.queryPanel.init(this.panel.getContext(),s);var a=null,l=o.getColumns();if(0==l.length){var c=this.expression.getParent();if(c.expressions.length>0){var d=c.expressions[0];a=d.tag==r.ExprTag.EntityAttribute||d.kind==r.DataKind.Attribute?d.value:null}}else a=l[0].expr.value;a?this.setResultAttributeId(a):this.columnElement.innerText=i.i18n.getText("SubQueryEmptyColumn"),this.queryPanel.refresh();var h=this.queryPanelBlock.querySelector(".eqjs-qp-conditions-root");h&&(h.style.minHeight="100px"),this.panel.getContext().getServices().getDialogService().open({title:i.i18n.getText("SubQueryDialogTitle"),body:this.dialogBlockBody,width:this.panel.options.subQueryDialogWidth,closable:!0,cancelable:!0,onSubmit:function(){var e=t.queryPanel.getQuery();return!!e.tryValidate({checkExpressions:!0})&&(t.setValue(e),!0)}})},e.prototype.closeEditor=function(){},e}(a.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var o,i=n(0),r=n(2),s=n(1),a=n(25),l=n(3),u=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c=function(t){function e(e){var n=t.call(this,e)||this;return n.options={applyOnClose:!0,showApplyButton:!0,showClearButton:!0,queryPanel:{showAddRow:!0,showCheckboxes:!0,alwaysShowButtonsInGroups:!0}},n.headerClickListener=n.headerClickHandler.bind(n),n.group=r.WidgetGroup.Query,n}return u(e,t),e.prototype.getWidgetType=function(){return"filterBar"},Object.defineProperty(e.prototype,"cssPrefix",{get:function(){return"eqjs-fb"},enumerable:!0,configurable:!0}),e.prototype.init=function(e,n){t.prototype.init.call(this,e,n),this.setOptions(n),this.destroyCore(),this.qpElement=Object(s.domel)("div").addClass(this.cssPrefix+"-querypanel").toDOM(),this.queryPanel=new a.a(this.qpElement),this.queryPanel.init(e,this.options.queryPanel||{}),this.attachQueryObserver()},e.prototype.setOptions=function(t){this.options=i.utils.assignDeep(this.options,t)},e.prototype.applyBtnClick=function(t){this.applyFilter()},e.prototype.clearBtnClick=function(t){this.clearFilter()},e.prototype.showQueryPanel=function(t){var e=this;Object(s.slideDown)(this.qpBlock,200,(function(){e.updateHeader(),t&&t()}))},e.prototype.hideQueryPanel=function(){var t=this;Object(s.slideUp)(this.qpBlock,200,(function(){t.updateHeader(),t.options.applyOnClose&&t.applyFilter()}))},e.prototype.headerClickHandler=function(t){t.preventDefault(),Object(s.domel)(this.qpBlock).isVisible()?this.hideQueryPanel():this.showQueryPanel()},e.prototype.updateHeader=function(){if(this.headerTextElement){var t="",e=this.getContext().getQuery();e&&(t=e.getConditionsText()),""==t&&(t=i.i18n.getText("StrNoFilterDefined")),Object(s.domel)(this.headerTextElement).text(t).attr("title",t),!e||e.isEmptyConditions()?(Object(s.domel)(this.headerTextElement).hide(),Object(s.domel)(this.headerLinkElement).show(),Object(s.domel)(this.qpBlock).isVisible()||(Object(s.domel)(this.headerArrowBlock).hide(),this.headerElement.style.cursor="",this.headerElement.removeEventListener("click",this.headerClickListener))):(this.headerElement.style.cursor="pointer",this.headerElement.removeEventListener("click",this.headerClickListener),this.headerElement.addEventListener("click",this.headerClickListener),Object(s.domel)(this.headerTextElement).show(),Object(s.domel)(this.headerLinkElement).hide(),Object(s.domel)(this.headerArrowBlock).show()),Object(s.domel)(this.qpBlock).isVisible()?this.headerArrowElement.classList.add(this.cssPrefix+"-header-arrowUp"):this.headerArrowElement.classList.remove(this.cssPrefix+"-header-arrowUp"),this.textResize()}},e.prototype.render=function(){var t=this;Object(s.domel)(this.slot).addClass(this.cssPrefix+"-container").addClass(l.a.getMobileCssClass()).addChild("div",(function(e){return t.headerElement=e.addClass(t.cssPrefix+"-header").addChild("div",(function(e){return t.headerIconElement=e.addClass(t.cssPrefix+"-header-icon").toDOM()})).addChild("div",(function(e){return t.headerTextBlock=e.addClass(t.cssPrefix+"-header-textblock").addChild("div",(function(e){return t.headerTextElement=e.addClass(t.cssPrefix+"-header-text").toDOM()})).addChild("div",(function(e){return t.headerLinkElement=e.addClass(t.cssPrefix+"-header-text "+t.cssPrefix+"-header-link").text(i.i18n.getText("StrNoFilterClickToAdd")).hide().on("click",(function(){t.queryPanel.showEntitiesMenu({anchor:t.headerLinkElement,selectedIds:null,itemSelectedCallback:function(e,n){var o=e.id;t.showQueryPanel((function(){var e=t.getContext().getQuery(),n={parent:e.getRootCondition(),attributeId:o},i=e.addSimpleCondition(n);i&&e.fireConditionsChangedEvent(r.QueryChangeAction.Add,i)}))}})})).toDOM()})).toDOM()})).addChild("div",(function(e){return t.headerArrowBlock=e.addClass(t.cssPrefix+"-header-arrowblock").addChild("div",(function(e){return t.headerArrowElement=e.addClass(t.cssPrefix+"-header-arrow").toDOM()})).toDOM()})).toDOM()})).addChild("div",(function(e){return t.qpBlock=e.addClass(t.cssPrefix+"-querypanelblock").addClass(l.a.getMobileCssClass()).hide().addChildElement(t.qpElement).toDOM()})),(this.options.showApplyButton||this.options.showClearButton)&&(this.buttonsBlock=Object(s.domel)("div",this.qpBlock).addClass(this.cssPrefix+"-buttonsblock").addClass(l.a.getMobileCssClass()).toDOM()),this.options.showApplyButton&&Object(s.domel)("a",this.buttonsBlock).attr("href","javascript:void(0)").addClass(this.cssPrefix+"-button "+this.cssPrefix+"-button-apply").text(i.i18n.getText("ButtonApply")).on("click",this.applyBtnClick.bind(this)),this.options.showClearButton&&Object(s.domel)("a",this.buttonsBlock).attr("href","javascript:void(0)").addClass(this.cssPrefix+"-button "+this.cssPrefix+"-button-clear").text(i.i18n.getText("CmdClear")).on("click",this.clearBtnClick.bind(this)),window.addEventListener("resize",(function(){t.textResize()})),this.updateHeader(),this.queryPanel.refresh(),setTimeout((function(){return t.textResize()}),500)},e.prototype.refreshCore=function(){this.clear(),this.render()},e.prototype.clear=function(){this.slot.innerHTML=""},e.prototype.applyFilter=function(){this.options.applyFilterCallback&&this.options.applyFilterCallback()},e.prototype.clearFilter=function(){var t=this.getContext().getQuery();t&&(t.clearConditions(),t.fireConditionsChangedEvent(r.QueryChangeAction.All))},e.prototype.textResize=function(){this.headerTextBlock.style.width=this.slot.clientWidth-this.headerIconElement.offsetWidth-(Object(s.domel)(this.headerArrowBlock).isVisible()?this.headerArrowBlock.offsetWidth:0)+"px"},e.prototype.destroyCore=function(){this.queryPanel&&this.queryPanel.destroy(),this.detachQueryObserver(),this.slot.innerHTML=""},e.prototype.attachQueryObserver=function(){var t=this,e=this.getContext().getQuery();this.queryEventCallbackId=e.addChangedCallback((function(e){t.updateHeader()}))},e.prototype.detachQueryObserver=function(){var t=this.getContext().getQuery();t&&t.removeChangedCallback(this.queryEventCallbackId)},e}(r.Widget)},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var o,i=n(0),r=n(2),s=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=function(t){function e(e){var n=t.call(this,e)||this;return n.options={useCustomLocaleSettings:!1},n.slot=e,n.group=r.WidgetGroup.Result,n}return s(e,t),e.prototype.getWidgetType=function(){return"grid"},e.prototype.init=function(e,n){t.prototype.init.call(this,e,n),n&&i.utils.assignDeep(this.options,n)},e.prototype.refreshCore=function(){this.clear(),this.context.resultTable&&this.render()},e.prototype.render=function(){this.options.beforeTableRendering&&this.options.beforeTableRendering(this.context.resultTable),this.applyDisplayFormats()},e.prototype.applyDisplayFormats=function(){},e.prototype.clear=function(){this.slot.innerHTML=""},e}(r.Widget)},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var o,i=n(2),r=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t){function e(e){var n=t.call(this,e)||this;return n.panel=e,n.group=i.WidgetGroup.Statement,"TEXTAREA"!==n.panel.tagName&&(n.panel.innerHTML='<div class="eqv-sql-panel-result"></div>',n.panel=n.panel.querySelector("div")),n}return r(e,t),e.prototype.getWidgetType=function(){return"statementPanel"},e.prototype.refreshCore=function(){this.clear(),this.render()},e.prototype.render=function(){this.panel.textContent=this.context.resultStatement?this.context.resultStatement:"";var t=this.panel.innerHTML.replace(/\r\n/g,"<br />").replace(/ /g,"&nbsp;&nbsp;");this.panel.innerHTML=t},e.prototype.destroyCore=function(){this.clear()},e.prototype.clear=function(){this.panel.innerHTML=""},e}(i.Widget)},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var o,i=n(2),r=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t){function e(e){var n=t.call(this,e)||this;return n.element=e,n.element.style.display="none",n.group=i.WidgetGroup.All,n}return r(e,t),e.prototype.getWidgetType=function(){return"processIndicator"},e.prototype.onProcessStartCore=function(){this.element.style.display=""},e.prototype.onProcessEndCore=function(){this.element.style.display="none"},e}(i.Widget)},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var o,i=n(0),r=n(1),s=n(15),a=n(31),l=n(46),u=n(53),c=n(3),d=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.title=i.i18n.getText("Facets","Chart","FacetTitle"),e.dialogTitle=i.i18n.getText("Facets","Chart","DlgTitle"),e}return d(e,t),e.prototype.init=function(e){t.prototype.init.call(this,e),u.a.hasGoogleCharts()?this.chart=new u.a(this.contentDiv):this.chart=new l.a(this.contentDiv);var n=this.container.options?this.container.options.supportedChartTypes:null;this.chart.init(this.getContext(),{legend:{show:!1},showOnPaging:!0,hideSettings:!0,supportedChartTypes:n}),Object(r.domel)(this.slot).hide()},e.prototype.destroy=function(){this.chart&&this.chart.destroy()},e.prototype.getType=function(){return s.a.Chart},e.prototype.renderFormFields=function(e,n){var o=this;t.prototype.renderFormFields.call(this,e,n);var s=c.a.isIE(),a=s?"kfrm-fields-ie is-horizontal":"kfrm-fields is-horizontal",l=document.createElement("select");l.id="chart_type_selector",l.name="chart_type_selector";for(var u=0,d=this.chart.getSupportedChartTypes();u<d.length;u++){var h=d[u];(C=document.createElement("option")).value=h.toString(),C.text=this.chart.getChartTypeName(h),l.appendChild(C)}l.value=this.chart.getCurrentChartType().toString(),this.settings||(this.chart.prepareChartData(),this.settings={type:this.chart.getCurrentChartType().toString(),labelColumn:""+(this.chart.getLabelColumnIndex()>=0?this.chart.getLabelColumnIndex():""),dataColumn:""+(this.chart.getDataColumnIndex()>=0?this.chart.getDataColumnIndex():""),showLegend:!1});var p=document.createElement("select");p.name="label_column_selector",p.id="label_column_selector";for(var f=0,g=this.chart.getPotentialLabelColumns();f<g.length;f++){var y=g[f];(C=document.createElement("option")).value=y.idx.toString(),C.text=y.label,p.appendChild(C)}p.value=this.settings.labelColumn;var m=document.createElement("select");m.id="data_column_selector",m.name="data_column_selector";for(var v=0,b=this.chart.getPotentialDataColumns();v<b.length;v++){var C;y=b[v];(C=document.createElement("option")).value=y.idx.toString(),C.text=y.label,m.appendChild(C)}m.value=this.settings.dataColumn.toString();var x=n,w=function(){return s?Object(r.domel)("div",n).addClass("kfrm-field-ie").toDOM():n};s?Object(r.domel)(e).addChildElement(w()):Object(r.domel)(n).addChild("div").addChild("div"),x=w(),Object(r.domel)(x).addChild("label",(function(t){return t.attr("for","chart_type_selector").text(i.i18n.getText("Facets","Chart","ChartTypeSelectorLabel"))})).addChild("div",(function(t){return t.addClass("kfrm-select").addChildElement(l)})),x=w(),Object(r.domel)(x).addChild("label",(function(t){return t.attr("for","label_column_selector").text(i.i18n.getText("Facets","Chart","LabelColumnSelectorLabel"))})).addChild("div",(function(t){return t.addClass("kfrm-select").addChildElement(p)})),x=w(),Object(r.domel)(x).addChild("label",(function(t){return t.attr("for","data_column_selector").text(i.i18n.getText("Facets","Chart","DataColumnSelectorLabel"))})).addChild("div",(function(t){return t.addClass("kfrm-select").addChildElement(m)})),x=w(),Object(r.domel)(x).addChild("div").addChild("div",(function(t){return t.addClass(a).addChild("label",(function(t){return t.addClass("checkbox").addChild("input",(function(t){t.id("show_legend").type("checkbox"),o.settings.showLegend&&t.attr("checked","")})).addText(" "+i.i18n.getText("Facets","Chart","ShowLegendLabel"))}))}))},e.prototype.afterDialogOpened=function(t){this.getContext().resultTable.columns.getItems().filter((function(t){return i.utils.isNumericType(t.type)})).length<=0&&(t.showAlert("The dataset should contain at least one numeric column to build a chart","error"),t.getSubmitButtonElement().disabled=!0)},e.prototype.submitSettingsDialog=function(){var e=t.prototype.submitSettingsDialog.call(this),n=document.getElementById("chart_type_selector"),o=parseInt(n.value),i=document.getElementById("label_column_selector"),r=parseInt(i.value),s=document.getElementById("data_column_selector"),a=parseInt(s.value),l=document.getElementById("show_legend").checked;return e&&(this.settings={type:o,labelColumn:r,dataColumn:a,showLegend:l},this.canDisplay()&&this.refresh()),e},e.prototype.getSettings=function(){return this.settings},e.prototype.saveToData=function(){var e=t.prototype.saveToData.call(this);return this.settings&&(e.chartType=this.settings.type,e.labelCol=this.settings.labelColumn,e.dataCol=this.settings.dataColumn,e.showLeg=this.settings.showLegend),e},e.prototype.loadFromData=function(e){t.prototype.loadFromData.call(this,e),e&&(this.settings={type:e.chartType,dataColumn:e.dataCol,labelColumn:e.labelCol,showLegend:e.showLeg})},e.prototype.refreshCore=function(){this.chart&&(this.settings&&this.chart.updateSettings(this.settings),this.chart.prepareChartData(),this.chart.refresh())},e.prototype.onResize=function(){this.refresh()},e}(a.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var o,i,r,s=n(1),a=n(0),l=n(15),u=n(31),c=n(3),d=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});!function(t){t.Sum="SUM",t.Average="AVG",t.Min="MIN",t.Max="MAX",t.Count="COUNT"}(i||(i={})),function(t){t[t.ColumnField=0]="ColumnField",t[t.RowField=1]="RowField",t[t.CellData=2]="CellData"}(r||(r={}));var h=/{0:(.*?)}/g,p=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.title=a.i18n.getText("Facets","Pivot","FacetTitle"),e.dialogTitle=a.i18n.getText("Facets","Pivot","DlgTitle"),e.pivotTable=new a.EasyDataTable,e}return d(e,t),e.prototype.init=function(e){var n=this;t.prototype.init.call(this,e),this.options.maxRowCount=this.options.maxRowCount||500,this.options.viewportRowsCount=this.options.viewportRowsCount||50,this.grid=new s.EasyGrid({slot:this.contentDiv,dataTable:this.pivotTable,paging:{enabled:!1,pageSize:this.options.maxRowCount},viewportRowsCount:this.options.viewportRowsCount,useRowNumeration:!1,showPlusButton:!1,allowDragDrop:!1,onGetCellRenderer:function(t,e){if(t.dataColumn){if("total"==t.dataColumn.id)return function(t,n,o,i){e(t,n,o,i),o.classList.add("pivot-cell-total")};if(n.settings.totalsRow)if(0===n.pivotTable.columns.getIndex(t.dataColumn.id))return function(t,o,i,r){Number.parseInt(r.getAttribute("data-row-idx"))===n.pivotTable.getCachedCount()-1&&(t=a.i18n.getText("Facets","Pivot","TotalGridLabel")),e(t,o,i,r)}}}})},e.prototype.getType=function(){return l.a.PivotTable},e.prototype.destroy=function(){this.grid&&this.grid.destroy()},e.prototype.createAggrFuncSelectBuilder=function(t){for(var e=this.getContext().getModel(),n=Object(s.domel)("select"),o=function(t){n.addChild("option",(function(n){n.attr("value",t).text(e.getAggrFunctionCaption(t))}))},r=0,a=Object.keys(i).map((function(t){return i[t]}));r<a.length;r++){o(a[r])}var l=n.toDOM().querySelectorAll("option");return null!=t?l.forEach((function(e){e.value==t&&(e.selected=!0)})):l[0].selected=!0,n},e.prototype.createColumnsSelectBuilder=function(t,e,n){for(var o=this.getContextDataTable(),i=Object(s.domel)("select"),l=null,u=0,c=function(e){var n=o.columns.get(e),r=n.label,s=n.type,c=n.id;if(t&&t.indexOf(s)<0)return"continue";null===l&&a.utils.isNumericType(s)&&(l=u),i.addChild("option",(function(t){t.attr("value",c).text(r)})),u++},d=0;d<o.columns.count;d++)c(d);var h=Array.from(i.toDOM().querySelectorAll("option"));if(h.length>0)if(null!=e)for(var p=0,f=h;p<f.length;p++){var g=f[p];if(g.value==e){i.toDOM().value=g.value;break}}else switch(n){case r.ColumnField:i.toDOM().value=h[0].value;break;case r.RowField:i.toDOM().value=h.length>1?h[1].value:h[0].value;break;case r.CellData:i.toDOM().value=null===l?h[0].value:h[l].value}return i},e.prototype.renderFormFields=function(e,n){var o=this;t.prototype.renderFormFields.call(this,e,n);var i=this.settings||{totalsRow:!0,totalsCol:!0},l=[a.DataType.String,a.DataType.Date,a.DataType.DateTime,a.DataType.Int32,a.DataType.Int64,a.DataType.Word,a.DataType.Byte],u=[a.DataType.String,a.DataType.Float,a.DataType.Int32,a.DataType.Int64,a.DataType.Word,a.DataType.Byte,a.DataType.Currency],d=c.a.isIE(),h=n,p=d?"kfrm-fields-ie is-horizontal":"kfrm-fields is-horizontal",f=function(){return d?Object(s.domel)("div",n).addClass("kfrm-field-ie").toDOM():n};d?Object(s.domel)(n).addChildElement(f()):Object(s.domel)(n).addChild("div").addChild("div"),h=f(),Object(s.domel)(h).addChild("label",(function(t){return t.attr("for","column_field").text(a.i18n.getText("Facets","Pivot","ColumnFieldSelectorLabel"))})).addChild("div",(function(t){return t.addClass(p).addChild("div",(function(t){return t.addClass("kfrm-select").attr("name","column_field").addChildElement(o.createColumnsSelectBuilder(l,i.colName,r.ColumnField).id("pivotTableColFieldSelector").toDOM())})).addChild("button",(function(t){return t.addClass("kfrm-button").addClass("eqjs-facets-button-swap").attr("title",a.i18n.getText("Facets","Pivot","SwapBtnTitle")).on("click",(function(){var t=document.getElementById("pivotTableColFieldSelector"),e=document.getElementById("pivotTableRowFieldSelector"),n=t.value;t.value=e.value,e.value=n}))}))})),h=f(),Object(s.domel)(h).addChild("label",(function(t){return t.attr("for","row_field").text(a.i18n.getText("Facets","Pivot","RowFieldSelectorLabel"))})).addChild("div",(function(t){return t.addClass("kfrm-select").attr("name","row_field").addChildElement(o.createColumnsSelectBuilder(l,i.rowName,r.RowField).id("pivotTableRowFieldSelector").toDOM())})),h=f(),Object(s.domel)(h).addChild("label",(function(t){return t.attr("for","data_function").text(a.i18n.getText("Facets","Pivot","CellDataSelectorLabel"))})).addChild("div",(function(t){return t.addClass(p).addChild("div",(function(t){return t.addClass("kfrm-select").attr("name","data_function").addChildElement(o.createAggrFuncSelectBuilder(i.aggrFunc).id("pivotTableAggrFuncSelector").toDOM())})).addChild("label",(function(t){return t.addText("of ")})).addChild("div",(function(t){return t.addClass("kfrm-select").attr("name","data_column").addChildElement(o.createColumnsSelectBuilder(u,i.fieldName,r.CellData).on("change",(function(t){var e=t.target.value;o.validateSelectedField(e)})).id("pivotTableCellFieldSelector").toDOM())}))})),h=f(),Object(s.domel)(h).addChild("div").addChild("div",(function(t){return t.addClass(p).addChild("label",(function(t){return t.addClass("checkbox").addChild("input",(function(t){t.id("pivotTableHasTotalsRow").type("checkbox"),i.totalsRow&&t.attr("checked","")})).addText(" "+a.i18n.getText("Facets","Pivot","TotalsRowLabel"))})).addChild("label",(function(t){return t.addClass("checkbox").addChild("input",(function(t){t.id("pivotTableHasTotalsCol").type("checkbox"),i.totalsCol&&t.attr("checked","")})).addText(" "+a.i18n.getText("Facets","Pivot","TotalsColLabel"))}))}))},e.prototype.afterDialogOpened=function(t){var e=document.getElementById("pivotTableCellFieldSelector").value;e&&this.validateSelectedField(e),this.getQuery().getColumns().length<=2&&(t.showAlert("The dataset should contain at least three columns to build a pivot table","error"),t.getSubmitButtonElement().disabled=!0)},e.prototype.validateSelectedField=function(t){var e=this.getContextDataTable(),n=e.columns.getIndex(t),o=e.columns.get(n),r=document.getElementById("pivotTableAggrFuncSelector");o.type==a.DataType.String?(r.disabled=!0,r.value=i.Count):r.disabled=!1},e.prototype.submitSettingsDialog=function(){var e=t.prototype.submitSettingsDialog.call(this);return e&&(this.settings={colName:document.getElementById("pivotTableColFieldSelector").value,rowName:document.getElementById("pivotTableRowFieldSelector").value,aggrFunc:document.getElementById("pivotTableAggrFuncSelector").value,fieldName:document.getElementById("pivotTableCellFieldSelector").value,totalsRow:document.getElementById("pivotTableHasTotalsRow").checked,totalsCol:document.getElementById("pivotTableHasTotalsCol").checked},this.refresh()),e},e.prototype.saveToData=function(){var e=t.prototype.saveToData.call(this);return this.settings&&a.utils.assignDeep(e,this.settings),e},e.prototype.loadFromData=function(e){t.prototype.loadFromData.call(this,e),e&&(this.settings=a.utils.assignDeep(this.settings,e),"AVERAGE"==this.settings.aggrFunc&&(this.settings.aggrFunc=i.Average))},e.prototype.refreshCore=function(){if(this.updatePivotData(),this.grid){var t=this.pivotTable.getTotal();t>this.grid.options.paging.pageSize&&(this.contentDiv.classList.remove("pivot-grid-with-totals"),this.showErrorMessage(a.i18n.getText("Facets","ErrTooMuchData"))),this.options.viewportRowsCount>t?this.grid.options.viewportRowsCount=t:this.grid.options.viewportRowsCount=this.options.viewportRowsCount,this.grid.refresh()}},e.prototype.getContextDataTable=function(){return this.getContext().resultTable},e.prototype.updatePivotData=function(){this.pivotTable.clear();var t=this.getContextDataTable();if(t&&0!=t.getTotal()&&this.settings){var e=this.settings.colName,n=this.settings.rowName,o=this.settings.fieldName,r=t.columns.getIndex(e),s=t.columns.getIndex(n),l=t.columns.getIndex(o);if(null!=r&&null!=s&&null!=l){for(var u=t.columns.get(l),c=t.columns.get(r),d=t.columns.get(s),h=d.label,p=d.type,f=c.label,g=[],y=[],m=t.getCachedRows(),v=0;v<m.length;v++){var b=m[v].getValue(r);g.indexOf(b)<0&&g.push(b);var C=m[v].getValue(s);y.indexOf(C)<0&&y.push(C)}this.pivotTable.columns.add({id:h+"\\"+f,label:h+"\\"+f,description:"",type:p,dfmt:d.displayFormat,style:d.style});var x=[],w=null;a.utils.isNumericType(c.type)?w=this.formatNumber:a.utils.getDateDataTypes().indexOf(c.type)>=0&&(w=this.formatDate);for(v=0;v<g.length;v++){if(b=g[v]){var T=w?w(c,b):b;this.pivotTable.columns.add({id:b,label:T,description:"",dfmt:u.displayFormat,type:this.settings.aggrFunc!==i.Count?u.type:a.DataType.Int64,style:u.style})}else x.push(v)}var E=[];for(v=0;v<y.length;v++)E.push([]),E[v].push(y[v]);for(v=0;v<y.length;v++)for(var D=0;D<g.length;D++)x.indexOf(D)>=0||E[v].push(this.calcAggrFunc(this.settings.aggrFunc,{colName:this.settings.colName,rowName:this.settings.rowName,fieldName:this.settings.fieldName,rowValue:y[v],colValue:g[D]}));if(this.settings.totalsCol){this.pivotTable.columns.add({id:"total",label:a.i18n.getText("Facets","Pivot","TotalGridLabel"),description:"",dfmt:u.displayFormat,type:this.settings.aggrFunc!==i.Count?u.type:a.DataType.Int64});for(v=0;v<E.length;v++){var S=E[v],k=0;this.settings.aggrFunc!=i.Min&&this.settings.aggrFunc!=i.Max||(k=S[1]);for(D=1;D<S.length;D++){null!==(B=S[D])&&(this.settings.aggrFunc===i.Min?B<k&&(k=B):this.settings.aggrFunc===i.Max?B>k&&(k=B):k+=B)}this.settings.aggrFunc===i.Average&&(k/=S.length-1),S.push(k)}}for(var M=0,I=E;M<I.length;M++){S=I[M];this.pivotTable.addRow(S)}if(this.settings.totalsRow){var O=[];O.push(null);for(v=1;v<this.pivotTable.columns.count;v++){var A=this.pivotTable.getCachedRows(),P=0;this.settings.aggrFunc!=i.Min&&this.settings.aggrFunc!=i.Max||(P=A[0].getValue(v));for(D=0;D<A.length;D++){var B;null!==(B=A[D].getValue(v))&&(this.settings.aggrFunc===i.Min?B<P&&(P=B):this.settings.aggrFunc===i.Max?B>P&&(P=B):P+=B)}this.settings.aggrFunc===i.Average&&(P/=A.length),O.push(P)}this.pivotTable.addRow(O),this.contentDiv.classList.add("pivot-grid-with-totals")}else this.contentDiv.classList.remove("pivot-grid-with-totals")}else this.showUnableDisplayMessage(a.i18n.getText("Facets","ErrQueryChanged"))}},e.prototype.calcAggrFunc=function(t,e){switch(t){case i.Sum:return this.sum(e);case i.Average:return this.average(e);case i.Min:return this.min(e);case i.Max:return this.max(e);case i.Count:return this.count(e);default:return 0}},e.prototype.getSettings=function(){return this.settings},e.prototype.formatDate=function(t,e){var n="[object Date]"===Object.prototype.toString.call(e),o=(e||"").toString();if(n)if(t&&t.displayFormat&&h.test(t.displayFormat))o=t.displayFormat.replace(h,(function(n,o){return a.i18n.dateTimeToStr(e,t.type,o)}));else{var i=a.i18n.getCurrentLocale(),r={hour:"numeric",minute:"numeric",second:"numeric"};switch(t.type){case a.DataType.Date:o=e.toLocaleDateString(i);break;case a.DataType.Time:o=e.toLocaleTimeString(i,r);break;case a.DataType.DateTime:o=e.toLocaleDateString(i)+" "+e.toLocaleTimeString(i,r)}}return o},e.prototype.formatNumber=function(t,e){var n=(e||"").toString();return"number"==typeof e&&(n=t&&t.displayFormat&&h.test(t.displayFormat)?t.displayFormat.replace(h,(function(t,n){return a.i18n.numberToStr(e,n)})):e.toLocaleString()),n},e.prototype.sum=function(t){for(var e=0,n=this.getContextDataTable().getCachedRows(),o=0;o<n.length;o++){var i=n[o].getValue(t.rowName),r=n[o].getValue(t.colName);if(i===t.rowValue&&r===t.colValue)e+=n[o].getValue(t.fieldName)}return e},e.prototype.average=function(t){for(var e=0,n=0,o=this.getContextDataTable().getCachedRows(),i=0;i<o.length;i++){var r=o[i].getValue(t.rowName),s=o[i].getValue(t.colName);if(r===t.rowValue&&s===t.colValue)e+=o[i].getValue(t.fieldName),n++}return 0!=n&&(e/=n),e},e.prototype.min=function(t){for(var e=Number.MAX_SAFE_INTEGER,n=this.getContextDataTable().getCachedRows(),o=0;o<n.length;o++){var i=n[o].getValue(t.rowName),r=n[o].getValue(t.colName);if(i===t.rowValue&&r===t.colValue){var s=n[o].getValue(t.fieldName);s<e&&(e=s)}}return e==Number.MAX_SAFE_INTEGER?null:e},e.prototype.max=function(t){for(var e=Number.MIN_SAFE_INTEGER,n=this.getContextDataTable().getCachedRows(),o=0;o<n.length;o++){var i=n[o].getValue(t.rowName),r=n[o].getValue(t.colName);if(i===t.rowValue&&r===t.colValue){var s=n[o].getValue(t.fieldName);s>e&&(e=s)}}return e==Number.MIN_SAFE_INTEGER?null:e},e.prototype.count=function(t){for(var e=0,n=this.getContextDataTable().getCachedRows(),o=0;o<n.length;o++){var i=n[o].getValue(t.rowName),r=n[o].getValue(t.colName);i===t.rowValue&&r===t.colValue&&e++}return e},e}(u.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var o,i=n(2),r=n(31),s=n(15),a=n(44),l=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.grid=null,e.title=i.i18n.getText("Facets","DataTable","FacetTitle"),e.dialogTitle=i.i18n.getText("Facets","DataTable","DlgTitle"),e}return l(e,t),e.prototype.init=function(e){t.prototype.init.call(this,e),this.reinitGrid()},e.prototype.getSettings=function(){return this.settings},e.prototype.reinitGrid=function(){this.grid&&this.grid.destroy();var t=this.container.options||{};t.gridResolver&&(this.grid=t.gridResolver(this.contentDiv,this.getType())),null==this.grid&&(this.grid=new a.a(this.contentDiv)),t.grid=t.grid||{},t.grid.autoRefresh=!1,t.grid.addColumns=!1;var e=this.getContext();t.grid.totals=this.settings,this.grid.init(e,t.grid)},e.prototype.getType=function(){return s.a.DataGrid},e.prototype.canDisplay=function(){return!0},e.prototype.refreshCore=function(){this.grid&&this.grid.refresh()},e.prototype.destroy=function(){this.grid&&this.grid.destroy()},e}(r.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var o,i=n(0),r=n(2),s=n(45),a=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(e){var n=t.call(this,e)||this;return n.options={defFormat:"csv",enableExport:!0},n.clickHandler=function(t){n.slot.hasAttribute("disabled")||new s.a(n.context).show(n.options.defFormat)},n.group=r.WidgetGroup.All,n}return a(e,t),e.prototype.getWidgetType=function(){return"exportWidget"},e.prototype.init=function(e,n){t.prototype.init.call(this,e,n),this.options=i.utils.assignDeep(this.options,n),this.slot.addEventListener("click",this.clickHandler)},e.prototype.refreshCore=function(){this.options.enableExport&&this.context.resultTable&&this.context.resultTable.getCachedCount()>0?this.slot.removeAttribute("disabled"):this.slot.setAttribute("disabled","")},e.prototype.destroyCore=function(){this.slot.removeAttribute("disabled"),this.slot.removeEventListener("click",this.clickHandler)},e}(r.Widget)},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var o,i=n(2),r=n(3),s=n(94),a=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(e,n){var o=t.call(this,e)||this;return o.linkClickCallback=function(){new s.a(o.context).show(o.getQuery())},o.queryEventCallbackId=null,o.customQuery=n,o.group=i.WidgetGroup.Query|i.WidgetGroup.QueryStatus,o}return a(e,t),e.prototype.init=function(e,n){t.prototype.init.call(this,e,n),this.destroyCore(),this.attachQueryObserver()},Object.defineProperty(e.prototype,"cssPrefix",{get:function(){return"eqjs-aggrb"},enumerable:!0,configurable:!0}),e.prototype.getWidgetType=function(){return"aggregationBar"},e.prototype.refreshCore=function(){this.render()},e.prototype.getLinkText=function(){var t=this.getQuery();if(t.enableAggregation){for(var e=t.getAggregationSettings(),n=e.getInternalGroups(),o=e.getAggregates(),r=[],s=t.getColumns(),a=0,l=n;a<l.length;a++){var u=l[a].columns.map((function(t){var e=s.find((function(e){return e.id==t}));return e?e.caption:""}));r.push("["+u.join(", ")+"]")}for(var c=r.join(", "),d=[],h=t.getModel().getAggrFunctions(),p=function(t){var e=s.find((function(e){return e.id==t.colId})),n=h.find((function(e){return e.id==t.funcId}));e&&n&&d.push(e.caption+" ("+n.caption+")")},f=0,g=o;f<g.length;f++){p(g[f])}var y=d.join(", ");return(c||i.i18n.getText("AggrSettings","NoGroupsLabel"))+" ::: "+(y?"<"+y+">":i.i18n.getText("AggrSettings","NoAggrsLabel"))}return i.i18n.getText("AggrSettings","EmptySettingsLabel")},e.prototype.render=function(){this.slot.classList.add(this.cssPrefix+"-panel");var t=r.a.getMobileCssClass();t&&this.slot.classList.add(t),this.dialogLink||(this.dialogLink=document.createElement("a"),this.dialogLink.setAttribute("href","javascript:void(0)"),this.slot.appendChild(this.dialogLink)),this.dialogLink.textContent=this.getLinkText(),this.dialogLink.removeEventListener("click",this.linkClickCallback),this.dialogLink.addEventListener("click",this.linkClickCallback)},e.prototype.clear=function(){this.slot.innerHTML="",this.dialogLink=null},e.prototype.attachQueryObserver=function(){var t=this,e=this.getQuery();this.queryEventCallbackId=e.addChangedCallback((function(e){t.refreshCore()}))},e.prototype.detachQueryObserver=function(){this.queryEventCallbackId&&this.getQuery().removeChangedCallback(this.queryEventCallbackId)},e.prototype.destroyCore=function(){this.clear(),this.detachQueryObserver()},e.prototype.getQuery=function(){return this.customQuery||this.context.getQuery()},e}(i.Widget)},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return s}));var o=n(1),i=n(2),r=n(95),s=function(){function e(t){this.context=t,this.promise=null}return e.prototype.show=function(e){var n=this,o=e||this.context.getQuery();return this.query=this.context.createQuery(),this.query.loadFromData(o.toJSONData()),this.promise||(this.promise=new t((function(t,e){var s=n.context.getServices().getDialogService();n.body=n.renderBody();var a=s.open({title:i.i18n.getText("AggrSettings","AggrDialogTitle"),body:n.body,onSubmit:function(){return!(n.query.enableAggregation&&!n.renderer.isValid())&&(o.enableAggregation=n.query.enableAggregation,o.enableAggregation&&o.useAggregation((function(t){var e=n.renderer.getSettings();t.loadFromData(e.saveToData())})),o.fireChangedEvent({part:i.QueryChangePart.Aggregation,wasModified:!1}),t(),!0)},onCancel:function(){t()}});n.renderer=new r.a({slot:n.body.querySelector("#AggrSettingsComponent"),query:n.query,onChanged:function(){a.clearAlert();var t=n.renderer.isValid();if(!t){var e=n.renderer.getValidationMessage();a.showAlert(e,"warning")}a.getRootElement().querySelector(".kfrm-button.is-info").disabled=!t&&n.query.enableAggregation}}),n.query.enableAggregation&&n.renderer.render()}))),this.promise.catch((function(t){return console.error(t)})).finally((function(){return n.promise=null}))},e.prototype.renderBody=function(){var t=this;return Object(o.domel)("div").addChild("div",(function(e){return e.addClass("eqjs-as-enableaggr").addChild("label",(function(e){return e.addClass("eqjs-ctrl-switch").addChild("input",(function(e){e.attr("type","checkbox"),t.query.enableAggregation&&e.attr("checked",""),e.on("change",t.enableAggrCheckBoxChangeHandler.bind(t))})).addChild("span",(function(t){return t.addClass("slider round")})).addChild("span",(function(t){return t.addClass("switch-text").addText(i.i18n.getText("AggrSettings","EnableAggrLabel"))}))}))})).addChild("div",(function(t){return t.id("AggrSettingsComponent")})).toDOM()},e.prototype.enableAggrCheckBoxChangeHandler=function(t){if(this.query.enableAggregation=!this.query.enableAggregation,this.body.querySelector("#AggrSettingsComponent").innerHTML="",this.query.enableAggregation)this.renderer.render();else{var e=this.body?this.body.closest(".kdlg-modal").querySelector("footer .kfrm-button.is-info"):null;e&&(e.disabled=!1)}},e}()}).call(this,n(56))},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var o=n(0),i=n(1),r=n(9),s=n(2),a=function(){function t(t){if(this.selectState={columns:[]},this.funcMap={},!t||!t.slot)throw new Error("slot is required");if(!t||!t.query)throw new Error("query is required");this.slot=t.slot,this.query=t.query,this.onChanged=t.onChanged,this.dropSelectState(),this.dropState()}return Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"eqjs-as"},enumerable:!0,configurable:!0}),t.prototype.render=function(){this.createFunctionMenu(),this.setInitialState(),this.changed()},t.prototype.setInitialState=function(){for(var t=this.query.getAggregationSettings(),e=t.getInternalGroups(),n=t.getAggregates(),o=0,i=e;o<i.length;o++){var r=i[o];this.state.groups.push({columns:r.columns})}for(var s=0,a=n;s<a.length;s++){var l=a[s];this.state.aggregates.push({colId:l.colId,funcId:l.funcId})}this.state.grandTotals=t.hasGrandTotals(),this.state.recordCount=t.hasRecordCount()},t.prototype.getAvailableColumns=function(){return this.query.getColumns().filter((function(t){return t.enabled}))},t.prototype.renderCore=function(){var t=this;this.slot.innerHTML="";for(var e=this.getAvailableColumns(),n=Object(i.domel)(this.slot),o=null,r=null,a=null,l=this.state.aggregates,u=-1,c=function(e){if(o&&o.columns.indexOf(e.id)>=0)return d.renderColumn(r,e,!0),"continue";if(null!=(o=d.getGroupForColumn(e.id))){u++;var c=Object(i.domel)("div",d.slot).addClass(d.cssPrefix+"-group").data("gindex",""+u);return r=Object(i.domel)("div",c.toDOM()).addClass(d.cssPrefix+"-columns"),d.renderColumn(r,e,!0),"continue"}var h=l.filter((function(t){return t.colId==e.id}))[0];if(h){var p=Object(i.domel)("div",d.slot).addClass(d.cssPrefix+"-aggr");return d.renderColumn(p,e,!0,h.funcId),p.addChild("div",(function(e){return e.addClass(t.cssPrefix+"-buttons").addChild("button",(function(e){return e.addClass(t.cssPrefix+"-unaggr-btn").title(s.i18n.getText("AggrSettings","UnaggrBtn")).on("click",t.removeAggrBtnClickHandler.bind(t))}))})),"continue"}if(d.selectState.columns.indexOf(e.id)>=0){if(null==a){var f=Object(i.domel)("div",d.slot).addClass(d.cssPrefix+"-selected");a=Object(i.domel)("div",f.toDOM()).addClass(d.cssPrefix+"-columns")}return d.renderColumn(a,e,!1),"continue"}d.renderColumn(n,e,!1)},d=this,h=0,p=e;h<p.length;h++){c(p[h])}if(a){var f=Object(i.domel)("div",a.toDOM().parentElement).addClass(this.cssPrefix+"-buttons");f.addChild("button",(function(e){return e.addClass(t.cssPrefix+"-group-btn").title(s.i18n.getText("AggrSettings","GroupBtn")).on("click",t.groupBtnClickHandler.bind(t))})),1==this.selectState.columns.length&&f.addChild("button",(function(e){return e.addClass(t.cssPrefix+"-aggr-btn").title(s.i18n.getText("AggrSettings","AggrBtn")).on("click",t.aggrBtnClickHandler.bind(t))}))}Object(i.domel)(this.slot).addChild("div",(function(e){return e.addClass(t.cssPrefix+"-counts").addChild("label",(function(e){return e.addClass("eqjs-ctrl-switch").addChild("input",(function(e){e.attr("type","checkbox"),t.state.recordCount&&e.attr("checked",""),e.on("change",t.countsCheckboxChangeHandler.bind(t))})).addChild("span",(function(t){return t.addClass("slider round")})).addChild("span",(function(t){return t.addClass("switch-text").addText(s.i18n.getText("AggrSettings","GroupCountsLabel"))}))}))})).addChild("div",(function(e){return e.addClass(t.cssPrefix+"-grandtotals").addChild("label",(function(e){return e.addClass("eqjs-ctrl-switch").addChild("input",(function(e){e.attr("type","checkbox"),t.state.grandTotals&&e.attr("checked",""),e.on("change",t.grandCheckboxChangeHandler.bind(t))})).addChild("span",(function(t){return t.addClass("slider round")})).addChild("span",(function(t){return t.addClass("switch-text").addText(s.i18n.getText("AggrSettings","GrandTotalsLabel"))}))}))})),this.slot.querySelectorAll("."+this.cssPrefix+"-group").forEach((function(e){Object(i.domel)(e).addChild("div",(function(e){return e.addClass(t.cssPrefix+"-buttons").addChild("button",(function(e){return e.addClass(t.cssPrefix+"-ungroup-btn").title(s.i18n.getText("AggrSettings","UngroupBtn")).on("click",t.removeGroupBtnClickHandler.bind(t))}))}))})),this.validateCheckboxes()},t.prototype.validateCheckboxes=function(){if(0!==this.selectState.columns.length){for(var t,e,n=null,o=0;o<this.slot.childNodes.length;o++){(s=this.slot.childNodes[o]).classList.contains(this.cssPrefix+"-selected")?t&&t.classList.contains(this.cssPrefix+"-column")&&(e=t):s.classList.contains(this.cssPrefix+"-column")&&t&&t.classList.contains(this.cssPrefix+"-selected")&&(n=s),t=s}for(o=0;o<this.slot.childNodes.length;o++){(s=this.slot.childNodes[o]).classList.contains(this.cssPrefix+"-column")&&s!=e&&s!=n&&s.firstElementChild.firstElementChild.setAttribute("disabled","")}var i="."+this.cssPrefix+"-selected>."+this.cssPrefix+"-columns>."+this.cssPrefix+"-column",r=this.slot.querySelectorAll(i);for(o=1;o<r.length-1;o++){var s;(s=r[o]).firstElementChild.firstElementChild.setAttribute("disabled","")}}},t.prototype.isValid=function(){var t=this.selectState.columns.length,e=this.state.aggregates.length>0,n=this.state.groups.length>0,o=this.state.grandTotals,i=this.state.recordCount;return!t&&(n?e||i:!!e&&(n||o))},t.prototype.getValidationMessage=function(){var t=this.selectState.columns.length,e=this.state.aggregates.length>0,n=this.state.groups.length>0,o=this.state.grandTotals,i=this.state.recordCount;return t?s.i18n.getText("AggrSettings","SelectedError")+" ":!n||e||i?!e||n||o?s.i18n.getText("AggrSettings","NoGroupsOrAggrError")+" ":s.i18n.getText("AggrSettings","NoGroupsOrGrandError")+" ":s.i18n.getText("AggrSettings","NoAggrOrCountError")+" "},t.prototype.getSettings=function(){for(var t=new o.AggregationSettings(this.query),e=0,n=this.state.groups;e<n.length;e++){var i=n[e];t.addGroup({columns:i.columns})}for(var r=0,s=this.state.aggregates;r<s.length;r++){var a=s[r];t.addAggregateColumn(a.colId,a.funcId)}return this.state.grandTotals&&t.addGrandTotals(),this.state.recordCount&&t.addCounts(),t},t.prototype.renderColumn=function(t,e,n,o){var i=this;void 0===o&&(o=null),t.addChild("div",(function(t){t.data("colid",e.id);var r=o?e.caption+" ("+i.funcMap[o].caption+")":e.caption;n?t.addClass(i.cssPrefix+"-column-used").addText(r):t.addClass(i.cssPrefix+"-column").addChild("label",(function(t){return t.addClass("checkbox").addChild("input",(function(t){t.attr("type","checkbox"),i.selectState.columns.indexOf(e.id)>=0&&t.attr("checked",""),t.on("change",i.colCheckboxChangeHandler.bind(i))})).addText(r)}))}))},t.prototype.getGroupForColumn=function(t){var e=this.getGroupIndexForColumn(t);return e>=0?this.state.groups[e]:null},t.prototype.getGroupIndexForColumn=function(t){for(var e=0;e<this.state.groups.length;e++){if(this.state.groups[e].columns.indexOf(t)>=0)return e}return-1},t.prototype.grandCheckboxChangeHandler=function(t){this.state.grandTotals=!this.state.grandTotals,this.onChanged&&this.onChanged()},t.prototype.countsCheckboxChangeHandler=function(t){this.state.recordCount=!this.state.recordCount,this.onChanged&&this.onChanged()},t.prototype.colCheckboxChangeHandler=function(t){var e=t.target.parentElement.parentElement.getAttribute("data-colid"),n=this.selectState.columns.indexOf(e);if(n>=0)this.selectState.columns.splice(n,1);else{this.selectState.columns.push(e);var o=this.getAvailableColumns();this.selectState.columns=this.selectState.columns.sort((function(t,e){return o.findIndex((function(e){return e.id==t}))-o.findIndex((function(t){return t.id==e}))}))}this.changed()},t.prototype.groupBtnClickHandler=function(){this.state.groups.push({columns:this.selectState.columns});var t=this.getAvailableColumns();this.state.groups=this.state.groups.sort((function(e,n){return t.findIndex((function(t){return t.id==e.columns[0]}))-t.findIndex((function(t){return t.id==n.columns[0]}))})),this.dropSelectState(),this.changed()},t.prototype.removeGroupBtnClickHandler=function(t){var e=t.target,n=Number.parseInt(e.parentElement.parentElement.getAttribute("data-gindex"));this.state.groups.splice(n,1),this.changed()},t.prototype.removeAggrBtnClickHandler=function(t){var e=t.target.parentElement.parentElement.querySelector("."+this.cssPrefix+"-column-used").getAttribute("data-colid"),n=this.state.aggregates.findIndex((function(t){return t.colId==e}));n>=0&&(this.state.aggregates.splice(n,1),this.changed())},t.prototype.aggrBtnClickHandler=function(t){var e=this,n=(this.query.getModel(),this.selectState.columns[0]),o=this.getAvailableColumns().filter((function(t){return t.id==n}))[0];this.functionMenu.showMenu({anchor:t.target,itemFilterCallback:function(t){return e.funcMap[t.id].appliedTypes.indexOf(o.expr.dataType)>=0},itemSelectedCallback:function(t){e.state.aggregates.push({colId:n,funcId:t.id}),e.dropSelectState(),e.changed()}})},t.prototype.clear=function(){this.dropSelectState(),this.dropState(),this.changed()},t.prototype.dropSelectState=function(){this.selectState={columns:[]}},t.prototype.dropState=function(){this.state={groups:[],aggregates:[],recordCount:!0,grandTotals:!1}},t.prototype.changed=function(){this.onChanged&&this.onChanged(),this.renderCore()},t.prototype.createFunctionMenu=function(){for(var t=this.query.getModel(),e=[],n=0,o=this.query.getModel().getAggrFunctions();n<o.length;n++){var i=o[n];if(i){this.funcMap[i.id]=i;var s=t.getAggrFunctionCaption(i.id),a={id:i.id,text:s};e.push(a)}}var l=this.slot.id;l&&(l+="-FunctionsMenu");var u={items:e,id:l,searchBoxAlwaysShown:!1,domWriteItemsId:!0};this.functionMenu=new r.a(u)},t}()},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return o}));var o=function(){function e(t){this.context=t}return e.prototype.init=function(){},e.prototype.newQuery=function(t){var e=(t=t||{}).query||this.context.getQuery(),n=this.context.getModel(),o=t.modelId||(n?n.getId():"");t.queryId&&e.setId(t.queryId),t.name&&e.setName(t.name),t.description&&e.setDescription(t.description);var i={query:e.toJSONData()};t.data&&(i.data=t.data);var r=this.context.resolveEndpoint("NewQuery",{modelId:o});return this.context.getServices().getHttpClient().post(r,i).then((function(t){return t.query}))},e.prototype.getQueryList=function(e){var n=(e=e||{}).modelId||this.context.getModel().getId(),o=this.context.resolveEndpoint("GetQueryList",{modelId:n});return this.context.getServices().getHttpClient().get(o).then((function(e){return e.queries?e.queries:t.reject({message:"Wrong response format"})}))},e.prototype.loadQuery=function(t){t=t||{};var e=this.context.getModel(),n=this.context.getQuery(),o=t.modelId||e.getId(),i=t.queryId||n.getId(),r=this.context.resolveEndpoint("GetQuery",{modelId:o,queryId:i});return this.context.getServices().getHttpClient().get(r).then((function(t){return t.query}))},e.prototype.saveQuery=function(t){var e=(t=t||{}).query||this.context.getQuery(),n=t.queryId||e.getId();t.queryId&&e.setId(t.queryId);var o=t.modelId||e.getModel().getId();t.queryId&&e.setId(t.queryId);var i={query:e.toJSONData()};t.data&&(i.data=t.data);var r=this.context.resolveEndpoint("SaveQuery",{modelId:o,queryId:n});return this.context.getServices().getHttpClient().put(r,i).then((function(t){return t.query}))},e.prototype.removeQuery=function(t){t=t||{};var e=this.context.getQuery(),n=t.modelId||e.getModel().getId(),o=t.queryId||e.getId(),i={modelId:n,queryId:o};t.data&&(i.data=t.data);var r=this.context.resolveEndpoint("RemoveQuery",{modelId:n,queryId:o});return this.context.getServices().getHttpClient().delete(r,i).getPromise()},e}()}).call(this,n(100))},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var o,i=n(0),r=n(2),s=n(1),a=function(){function t(){this.formatStr="",this.pos=0,this.token="text",this.tokenText=""}return t.prototype.start=function(t){this.formatStr=t,this.pos=0,this.tokenText=""},t.prototype.skipSpaces=function(){for(;this.pos<this.formatStr.length&&" "===this.formatStr.charAt(this.pos);)this.pos++},t.prototype.getToken=function(){return this.token},t.prototype.getTokenText=function(){return this.tokenText},t.prototype.next=function(){if(this.skipSpaces(),this.pos>=this.formatStr.length)return!1;var t=0;if("{"===this.formatStr.charAt(this.pos)){if((t=this.formatStr.indexOf("}",this.pos))<0)return!1;this.tokenText=this.formatStr.substring(this.pos,t+1),0!==this.tokenText.indexOf("{expr")&&0!==this.tokenText.indexOf("{attr")||(this.token="expression"),this.pos=t+1}else if("["===this.formatStr.charAt(this.pos)&&this.pos<this.formatStr.length-1&&"["===this.formatStr.charAt(this.pos+1))this.pos+=2,t=this.formatStr.indexOf("]]",this.pos),this.token="function",this.tokenText=this.formatStr.substring(this.pos,t),this.pos=t+2;else{this.token="text";var e=this.formatStr.indexOf("{",this.pos);e<0&&(e=this.formatStr.length);var n=this.formatStr.indexOf("[[",this.pos);n<0&&(n=this.formatStr.length),t=Math.min(e,n),this.tokenText=this.formatStr.substring(this.pos,t).trim(),this.pos=t}return!0},t}(),l=n(30),u=n(3),c=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.displayFormatParser=new a,e}return c(e,t),e.prototype.getClassesToAdd=function(){return t.prototype.getClassesToAdd.call(this)+" "+this.cssPrefix+"-row "+this.cssPrefix+"-row-column-aggr"},e.prototype.getAttribute=function(){return this.panel.getContext().getModel().getAttributeByIdSafe(this.column.expr.args[0].value)},e.prototype.getDefaultColumnCaption=function(){return this.getDefaultTitleText(this.baseAttr)+" "+this.panel.getContext().getModel().getAggrFunctionCaption(this.column.expr.func)},e.prototype.renderExpressionBlock=function(){var t=this,e=this.panel.getContext().getModel(),n=Object(s.domel)("div").addClass(this.cssPrefix+"-expr-block",this.cssPrefix+"-expr-block-aggr").addClass(u.a.getMobileCssClass()),o=e.getAggrFunctionFormat(this.column.expr.func);if(o&&""!==o){var i=this.parseDisplayFormat(o);if(0!==i.length){for(var r=null,a=i.length,l=function(e){if(1===(r=i[e]).type)if(c.isEditable()){var o=Object(s.domel)("a").attr("href","javascript:void(0)").text(r.text).on("click",(function(e){e.stopPropagation(),t.functionMenu.showMenu({anchor:o.toDOM(),selectedIds:null,itemSelectedCallback:function(e,n){"CUSTOMSQL"===e.id?t.changeTypeToCustomSql():(t.column.expr.func=e.id,t.column.caption="",t.fireColumnChanged())}})}));n.addChild("div",(function(e){return e.addClass(t.cssPrefix+"-colelement",t.cssPrefix+"-aggrfuncelement").addClass(u.a.getMobileCssClass()).addChildElement(o.toDOM())}))}else n.addChild("div",(function(e){return e.addClass(t.cssPrefix+"-colelement",t.cssPrefix+"-aggrfuncelement").addClass(u.a.getMobileCssClass()).addChild("span",(function(t){return t.text(r.text).title(r.text)}))}));else 2===r.type?n.addChild("div",(function(e){return e.addClass(t.cssPrefix+"-colelement",t.cssPrefix+"-attrelement").addClass(u.a.getMobileCssClass()).addChildElement(t.renderBaseExpression())})):3===r.type&&n.addChild("span",(function(e){return e.addClass(t.cssPrefix+"-colelement").addClass(u.a.getMobileCssClass()).text(r.text).title(r.text)}))},c=this,d=0;d<a;d++)l(d);return n.toDOM()}}},e.prototype.renderColumnTypeButton=function(){var e=t.prototype.renderColumnTypeButton.call(this);return e&&(e.firstElementChild.classList.add("aggregated"),e.firstElementChild.setAttribute("title",i.i18n.getText("ButtonToSimple"))),e},e.prototype.baseExpressionItemSelectedCallback=function(t,e){var n=t.id;return this.column.expr.args[0].setValue(n,!0),this.column.caption="",this.fireColumnChanged(),!1},e.prototype.changeTypeToSimple=function(){this.column.getQuery().changeColumnType(this.column,r.ExprTag.EntityAttribute),this.fireColumnChanged()},e.prototype.parseDisplayFormat=function(t){if(!t)return[];var e=[],n=this.displayFormatParser;for(n.start(t);n.next();){var o=n.getToken(),i=n.getTokenText();"function"===o?e.push({type:1,text:i}):"expression"===o?e.push({type:2}):"text"===o&&e.push({type:3,text:i})}return e},e.prototype.changeTypeHandler=function(t){this.changeTypeToSimple()},e.prototype.processExtraButtonMenuItems=function(t,e){return this.changeTypeToSimple(),!0},e.prototype.getExtraButtonMenuItems=function(){return[{id:"__group",text:i.i18n.getText("ColTypeGroup"),items:[{id:"type",text:i.i18n.getText("ColTypeSimple")}]}]},e}(l.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var o,i=n(0),r=n(2),s=n(1),a=n(4),l=n(3),u=n(9),c=function(){function t(t,e,n){this.functionMenu=null,this.isMouseOverBlock=!1,this.keepShowingButtons=!1,this.bar=t,this.column=e,this.element=n}return Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"eqjs-sb"},enumerable:!0,configurable:!0}),t.prototype.render=function(){this.baseAttr=this.getAttribute();var t=Object(s.domel)("div");return t.data("id",this.column.id),this.element&&this.element.parentNode.replaceChild(t.toDOM(),this.element),this.element=t.toDOM(),t.addClass(this.getClassesToAdd()).addClass(l.a.getMobileCssClass()).addChildElement(this.renderCaptionBlock()),this.isEditable()&&t.addChildElement(this.renderSortingButton()),this.element},t.prototype.fireColumnChanged=function(){this.column.fireChangedEvent()},t.prototype.refresh=function(){this.render()},t.prototype.getAttribute=function(){return this.bar.getContext().getModel().getAttributeById(this.column.expr.value)},t.prototype.isEditable=function(){return this.column.enabled&&!this.column.isReadOnly()},t.prototype.renderCaptionBlock=function(){var t=this;this.column.caption&&""!=this.column.caption||(this.column.caption=this.getDefaultCaption());var e=this.column.caption;return this.isEditable()||(e+=function(t){switch(t){case r.SortDirection.Ascending:return" ↑";case r.SortDirection.Descending:return" ↓";default:return""}}(this.column.sorting)),Object(s.domel)("div").addClass(this.cssPrefix+"-colelement",this.cssPrefix+"-captionelement").addClass(l.a.getMobileCssClass()).addChild("div",(function(n){return n.title(t.column.caption).text(e)})).toDOM()},t.prototype.renderSortingButton=function(){var t=this,e=a.b+"-column-sortbutton",n=e;switch(this.column.sorting){case r.SortDirection.None:n=e+"-none";break;case r.SortDirection.Ascending:n=e+"-asc";break;case r.SortDirection.Descending:n=e+"-desc"}var o=Object(s.domel)("div").addClass(this.cssPrefix+"-colelement",this.cssPrefix+"-sortimage-placeholder").addClass(l.a.getMobileCssClass()).addChild("div",(function(e){return e.addClass(t.cssPrefix+"-img-sorting",n).title(i.i18n.getText("ButtonSorting"))})).on("touchstart click",(function(e){return t.buttonSortingClickHandler(e,o.toDOM())}));return o.toDOM()},t.prototype.buttonSortingClickHandler=function(t,e){var n=this;return t.stopPropagation(),this.keepShowingButtons=!0,this.bar.sortMenu.showMenu({anchor:e,selectedIds:null,itemSelectedCallback:function(t,e){var o;if("None"==t.id||"Ascending"==t.id||"Descending"==t.id){var i=n.bar.getContext().getQuery();n.column.isJustSorted()&&"None"==t.id?(i.removeColumn(n.column,n.bar),i.fireColumnsChangedEvent(r.QueryChangeAction.Delete,n.column,!0)):(n.column.sorting="None"==(o=t.id)?r.SortDirection.None:"Ascending"==o?r.SortDirection.Ascending:"Descending"==o?r.SortDirection.Descending:void 0,n.column.sortIndex=i.getColumnSortIndex(n.column),n.fireColumnChanged())}},menuClosedCallback:function(){n.keepShowingButtons=!1}}),!1},t.prototype.getDefaultCaption=function(){return this.getDefaultTitleText(this.baseAttr)},t.prototype.getDefaultTitleText=function(t){var e=this.bar.options.titleElementFormat||this.bar.options.attrElementFormat;return this.bar.getContext().getModel().getAttributeText(t,e)},t.prototype.getClassesToAdd=function(){return this.cssPrefix+"-row "+this.cssPrefix+"-row-column-entattr"},t.prototype.getUIS=function(){return this.bar.getContext().getModel().checkAttrProperty(this.column.expr.value,"useInSorting")},t}(),d=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),h=function(t){function e(e){var n=t.call(this,e)||this;return n.options={showAddRow:!0,attrElementFormat:"{entity} {attr}",titleElementFormat:null,menuOptions:{showSearchBoxAfter:30,searchBoxAutoFocus:!0,activateOnMouseOver:!0,adjustHeight:!0,itemRenderedCallback:null}},n.sortMenuList=[{id:"None",text:i.i18n.getText("CmdNotSorted")},{id:"Ascending",text:i.i18n.getText("CmdAscending")},{id:"Descending",text:i.i18n.getText("CmdDescending")}],Object(s.domel)(n.slot).addClass(n.cssPrefix+"-panel").addClass(l.a.getMobileCssClass()),n.group=r.WidgetGroup.Query,n}return d(e,t),Object.defineProperty(e.prototype,"cssPrefix",{get:function(){return"eqjs-sb"},enumerable:!0,configurable:!0}),e.prototype.getWidgetType=function(){return"sortingBar"},e.prototype.init=function(e,n){t.prototype.init.call(this,e,n),this.setOptions(n),this.destroyCore(),this.attachQueryObserver()},e.prototype.setOptions=function(t){i.utils.assignDeep(this.options,t)},e.prototype.attachQueryObserver=function(){var t=this,e=this.getQuery();this.queryEventCallbackId=e.addChangedCallback((function(e){var n=e.data;if(n&&(n.part==r.QueryChangePart.SortingColumns||n.part==r.QueryChangePart.Columns||n.part==r.QueryChangePart.All))switch(n.action){case r.QueryChangeAction.Modify:var o=n.changee,i=function(e){var n=t.columnsBlock.querySelector("div[data-id='"+e.id+"']");n&&t.renderColumn(e,n)};Array.isArray(o)?o.forEach((function(t){return i(t)})):i(o);break;case r.QueryChangeAction.Add:o=n.changee;var s=function(e){t.addColumnElement(e)};Array.isArray(o)?o.forEach((function(t){return s(t)})):s(o);break;case r.QueryChangeAction.Delete:o=n.changee;var a=function(e){var n=t.columnsBlock.querySelector("div[data-id='"+e.id+"']");n&&t.columnsBlock.removeChild(n)};Array.isArray(o)?o.forEach((function(t){return a(t)})):a(o);break;default:t.refresh()}}))},e.prototype.detachQueryObserver=function(){this.queryEventCallbackId&&this.getContext().getQuery().removeChangedCallback(this.queryEventCallbackId)},e.prototype.getQuery=function(){return this.getContext().getQuery()},e.prototype.destroyCore=function(){this.detachQueryObserver(),this.clear()},e.prototype.refreshCore=function(){this.clear(),this.render()},e.prototype.renderAddRowButton=function(){var t=this;Object(s.domel)(this.addRowButton).addClass(a.b+"-addrow",this.cssPrefix+"-addrow",a.b+"-addrow-empty").addClass(l.a.getMobileCssClass()).title(i.i18n.getText("CmdClickToAddColumn")).addChild("a",(function(e){return e.attr("href","javascript:void(0)").on("click",(function(e){e.preventDefault(),t.showEntitiesMenu({anchor:e.target,selectedIds:null,itemSelectedCallback:function(e,n){var o=e.id;return t.addNewColumn(o),!1}})}))})),l.a.isMobileMode()&&Object(s.domel)(this.columnsBlock).addChildElement(this.addRowButton)},e.prototype.showEntitiesMenu=function(t){this.entitiesMenu.showMenu(t)},e.prototype.createEntitiesMenu=function(){var t=this.getContext().getModel();if(!t||t.isEmpty())return null;var e=this.slot.id;e&&(e+="-EntitiesMenu");var n={items:t.getEntitiesTree({addUIC:!1,addUIR:!1,addUIS:!0}),adjustHeight:this.options.adjustEntitiesMenuHeight,id:e,domWriteItemsId:this.options.domWriteItemsId};this.entitiesMenu=new u.a(n)},e.prototype.createSortMenu=function(){var t=this.getContext().getModel();if(!t||t.isEmpty())return null;var e=this.slot.id;e&&(e+="-SortMenu");var n={items:this.sortMenuList,id:e,searchBoxAlwaysShown:!1};this.sortMenu=new u.a(n)},e.prototype.render=function(){var t=this;this.createEntitiesMenu(),this.createSortMenu(),this.columnsBlock=Object(s.domel)("div").addClass(this.cssPrefix+"-columns").addClass(l.a.getMobileCssClass()).toDOM(),this.options.showAddRow&&(this.addRowButton=Object(s.domel)("div").toDOM(),l.a.isMobileMode()?Object(s.domel)(this.columnsBlock).addChildElement(this.addRowButton):Object(s.domel)(this.slot).addChildElement(this.addRowButton),this.renderAddRowButton()),Object(s.domel)(this.slot).addChildElement(this.columnsBlock);var e=this.context.getQuery();e.getColumns().concat(e.getJustSortedColumns()).forEach((function(e,n){var o=t.renderColumn(e);t.columnsBlock.appendChild(o)}))},e.prototype.addNewColumn=function(t){var e=this,n=this.getContext().getModel(),o=this.getContext().getQuery();if(this.getContext().getQuery())return this.addColumn(function(t){var i=n.getAttributeById(t);if(!i)return null;if(!i.useInSorting){if(!i.lookupAttr)return null;if(t=i.lookupAttr,!(i=n.getAttributeById(t))||!i.useInSorting)return null}var s=o.createColumn(!0);return s.caption=e.getDefaultColumnCaption(i),s.sorting=r.SortDirection.Ascending,s.sortIndex=e.getQuery().getColumnSortIndex(s),s.expr.tag=r.ExprTag.EntityAttribute,s.expr.setValue(t,!0),s.params.concat(i.params),s}(t))},e.prototype.getDefaultColumnCaption=function(t){var e=this.options.titleElementFormat||this.options.attrElementFormat;return this.getContext().getModel().getAttributeText(t,e)},e.prototype.addColumn=function(t){var e=this.getContext().getQuery();if(e&&(t=this.checkColumn(t)))return t=e.addColumn({caption:t.caption,attributeId:t.expr.value,sorting:t.sorting,sortIndex:t.sortIndex,justsorted:!0}),e.fireChangedEvent({part:r.QueryChangePart.SortingColumns,action:r.QueryChangeAction.Add,changee:t}),t},e.prototype.checkColumn=function(t){for(var e=this.getContext().getQuery(),n=e.getColumns().concat(e.getJustSortedColumns()),o=JSON.stringify(t.expr.saveToData()),i=0;i<n.length;i++){if(JSON.stringify(n[i].expr.saveToData())===o)return null}return t},e.prototype.renderColumn=function(t,e){var n=new c(this,t,e);return n?n.render():null},e.prototype.addColumnElement=function(t){var e=this.renderColumn(t);this.columnsBlock.appendChild(e),this.options.columnRenderedCallback&&this.options.columnRenderedCallback(e)},e.prototype.clear=function(){this.slot.innerHTML=""},e}(r.Widget)},function(t,e,n){"use strict";n.d(e,"a",(function(){return v}));var o,i=n(2),r=n(0),s=n(1),a=n(15),l=n(3),u=n(9),c=n(4),d=n(45),h=n(89),p=n(90),f=n(91),g=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),y=function(t){function e(e){var n=t.call(this,e)||this;return n.facets=[],n.options={},n.group=i.WidgetGroup.Result,n}return g(e,t),e.prototype.destroyCore=function(){for(var t=0,e=this.facets;t<e.length;t++){e[t].destroy()}this.clear()},e.prototype.createFacetTab=function(t){var e=this.options[t];switch(t){case a.a.Chart:return new h.a(this,e);case a.a.PivotTable:return new p.a(this,e);default:return new f.a(this,e)}},e.prototype.getQuery=function(){return this.getContext().getQuery()},e}(i.Widget),m=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),v=function(t){function e(e){var n=t.call(this,e)||this;return n.activeFacetIndex=-1,n.firstRender=!0,n.options={showExportButton:!0,showRefreshButton:!0,showMaximizeButton:!0,maximize2Window:!1,showProcessIndicator:!0,facetTypes:[a.a.DataGrid,a.a.Chart,a.a.PivotTable]},n.menuItems=[{id:a.a.DataGrid,text:r.i18n.getText("Facets","AddMenuItems","DataTable")},{id:a.a.Chart,text:r.i18n.getText("Facets","AddMenuItems","Chart")},{id:a.a.PivotTable,text:r.i18n.getText("Facets","AddMenuItems","Pivot")}],n.menuItemsFilter=function(t){return!(n.options.facetTypes.indexOf(t.id)<0)&&(t.id!==a.a.DataGrid||0===n.facets.filter((function(t){return t.getType()==a.a.DataGrid})).length)},n.slot.classList.contains(n.cssPrefix+"-panel")||n.slot.classList.add(n.cssPrefix+"-panel"),n.renderProcessBlock(),n}return m(e,t),Object.defineProperty(e.prototype,"cssPrefix",{get:function(){return"eqjs-facets"},enumerable:!0,configurable:!0}),e.prototype.getWidgetType=function(){return"facetsPanel"},e.prototype.init=function(e,n){t.prototype.init.call(this,e,n),this.setOptions(n),this.destroyCore(),this.attachQueryObserver(),this.loadFacets()},e.prototype.attachQueryObserver=function(){var t=this,e=this.getQuery();this.queryEventCallbackId&&e.removeChangedCallback(this.queryEventCallbackId),this.queryEventCallbackId=e.addChangedCallback((function(e){var n=e.data;n.part==i.QueryChangePart.All&&n.source!=t&&(t.reloadFacets(),t.refreshCore(!0))}))},e.prototype.refreshCore=function(t){void 0===t&&(t=!1),(this.firstRender||t)&&(this.clear(),this.createAddMenu(),this.render()),this.validateAddFacetButton(),this.renderActiveFacet(),this.updateTotalRecords()},e.prototype.createAddMenu=function(){this.addMenu=new u.a({items:this.menuItems,id:"FacetType-List"})},e.prototype.updateTotalRecords=function(){var t=this.getContext().resultTable.getTotal();this.recordsDiv.innerHTML=r.i18n.getText("Facets","TotalRecordsLabel")+" "+t,0==t?Object(s.domel)(this.exportDiv).hide():Object(s.domel)(this.exportDiv).show()},e.prototype.renderProcessBlock=function(){this._processBlock=Object(s.domel)("div").addClass(this.cssPrefix+"-spinner").addChild("div",(function(t){return t.addClass(c.b+"-progress-win8",l.a.getMobileCssClass()).addHtml('<div class="wBall" id="wBall_1"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_2"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_3"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_4"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_5"><div class="wInnerBall"></div></div>')})).toDOM()},e.prototype.onProcessStartCore=function(){this.options.showProcessIndicator&&!this._processBlock.parentNode&&this.bodyDiv&&(this.bodyDiv.childNodes.forEach((function(t){Object(s.domel)(t).hide()})),this.bodyDiv.appendChild(this._processBlock))},e.prototype.onProcessEndCore=function(){if(this.options.showProcessIndicator&&this._processBlock.parentNode)try{this._processBlock.parentNode.removeChild(this._processBlock)}catch(t){}finally{this.renderActiveFacet(!1)}},e.prototype.render=function(){var t=this;this.firstRender=!1,this.headerDiv=Object(s.domel)("div",this.slot).addClass(this.cssPrefix+"-header").toDOM(),this.tabsDiv=Object(s.domel)("div",this.headerDiv).addClass(this.cssPrefix+"-tabs").toDOM(),this.tabsUl=Object(s.domel)("ul",this.tabsDiv).addClass(this.cssPrefix+"-nav-tabs").toDOM(),this.bodyDiv=Object(s.domel)("div",this.slot).addClass(this.cssPrefix+"-body").toDOM();for(var e=0,n=this.facets;e<n.length;e++){var o=n[e];this.renderFacet(o)}Object(s.domel)(this.tabsDiv).addChild("div",(function(e){return t.addFacetButton=e.addClass(t.cssPrefix+"-add-button").title(r.i18n.getText("Facets","NewFacetTitle")).addChild("a",(function(t){return t.attr("href","javascript:void(0)")})).on("click",(function(e){return t.addClickHandler(e)})).toDOM()}));var i=Object(s.domel)("div",this.headerDiv).addClass(this.cssPrefix+"-manage").toDOM();if(this.recordsDiv=Object(s.domel)("div",i).addClass(this.cssPrefix+"-total-recs").toDOM(),this.options.showRefreshButton||this.options.showExportButton||this.options.showMaximizeButton){var a=Object(s.domel)("div",i).addClass(this.cssPrefix+"-total-buttons").toDOM();this.options.showExportButton&&(this.exportDiv=Object(s.domel)("button",a).on("click",(function(){return t.exportHandler()})).addClass(this.cssPrefix+"-button").addClass(this.cssPrefix+"-button-export").title(r.i18n.getText("Facets","ExportBtnTitle")).toDOM()),this.options.showRefreshButton&&Object(s.domel)("button",a).on("click",(function(){return t.refreshHandler()})).addClass(this.cssPrefix+"-button").addClass(this.cssPrefix+"-button-refresh").title(r.i18n.getText("Facets","RefreshBtnTitle")),this.options.showMaximizeButton&&(this.maximizeButton=Object(s.domel)("button",a).on("click",(function(){return t.options.maximize2Window?t.maximizeHandler(!0):t.maximizeHandler()})).addClass(this.cssPrefix+"-button").addClass(this.cssPrefix+"-button-maximize").title(r.i18n.getText("Facets","MaximizeBtnTitle")).toDOM())}},e.prototype.refreshHandler=function(){var t=this.getContext();t.fetchData({success:function(){t.refreshWidgets(i.WidgetGroup.Result)}})},e.prototype.exportHandler=function(){var t=this.getContext();new d.a(t).show()},e.prototype.maximizeHandler=function(t){var e=Object(s.domel)(this.slot);if(t)e.toggleClass(c.b+"-maximized-2window"),this.slot.classList.contains(c.b+"-maximized-2window")?(this.maximizeButton.title=r.i18n.getText("Facets","RestoreBtnTitle"),this.maximizeButton.classList.toggle(this.cssPrefix+"-button-maximize",!1),this.maximizeButton.classList.toggle(this.cssPrefix+"-button-restore",!0)):(this.maximizeButton.title=r.i18n.getText("Facets","MaximizeBtnTitle"),this.maximizeButton.classList.toggle(this.cssPrefix+"-button-restore",!1),this.maximizeButton.classList.toggle(this.cssPrefix+"-button-maximize",!0));else{var n=!this.slot.hasAttribute("data-is-maximized");n?(this.slot.setAttribute("data-is-maximized",""),this.maximizeButton.title=r.i18n.getText("Facets","RestoreBtnTitle"),this.maximizeButton.classList.toggle(this.cssPrefix+"-button-maximize",!1),this.maximizeButton.classList.toggle(this.cssPrefix+"-button-restore",!0)):(this.slot.removeAttribute("data-is-maximized"),this.maximizeButton.title=r.i18n.getText("Facets","MaximizeBtnTitle"),this.maximizeButton.classList.toggle(this.cssPrefix+"-button-restore",!1),this.maximizeButton.classList.toggle(this.cssPrefix+"-button-maximize",!0)),document.querySelectorAll("[data-hide-on-max]").forEach((function(t){n?t.setAttribute("style","display: none;"):t.removeAttribute("style")}))}this.facets.forEach((function(t){return t.onResize()}))},e.prototype.renderActiveFacet=function(t){var e=this;void 0===t&&(t=!0),this.tabsUl.querySelectorAll("li").forEach((function(t,n){t.classList.contains("active")&&t.classList.remove("active"),e.activeFacetIndex===n&&t.classList.add("active")})),this.bodyDiv.querySelectorAll("."+c.b+"-facet").forEach((function(n,o){Object(s.domel)(n).hide(),e.activeFacetIndex===o&&(Object(s.domel)(n).show(),t&&e.facets[o].refresh())}))},e.prototype.renderFacet=function(t){this.renderFacetTab(t);var e=this.renderFacetSlot(t);t.init(e)},e.prototype.renderFacetTab=function(t){var e=this;return Object(s.domel)("li",this.tabsUl).addChild("span",(function(n){return n.addClass(c.b+"-facet-settings").on("click",(function(n){n.stopPropagation(),e.settingsClickHandler(t)}))})).addChild("a",(function(e){return e.addText(t.title).attr("href","javascript:void(0)")})).addChild("span",(function(n){return n.addClass(c.b+"-facet-close").on("click",(function(n){n.stopPropagation(),e.closeClickHandler(t)}))})).on("click",(function(n){return e.selectClickHandler(t)})).toDOM()},e.prototype.renderFacetSlot=function(t){return Object(s.domel)("div",this.bodyDiv).addClass(c.b+"-facet").hide().toDOM()},e.prototype.refreshFacetTabs=function(){var t=this;this.tabsUl.querySelectorAll("li").forEach((function(e){t.tabsUl.removeChild(e)}));for(var e=0,n=this.facets;e<n.length;e++){var o=n[e];this.renderFacetTab(o)}},e.prototype.removeFacet=function(t){var e=this.facets.indexOf(t);if(e>=0){this.facets.splice(e,1);var n=this.tabsUl.childNodes[e];this.tabsUl.removeChild(n);var o=this.bodyDiv.childNodes[e];this.bodyDiv.removeChild(o),this.facets.length>0?this.activeFacetIndex=e<this.facets.length?e:this.facets.length-1:this.activeFacetIndex=-1,this.renderActiveFacet(),this.validateAddFacetButton()}},e.prototype.addClickHandler=function(t){var e=this;this.addMenu.showMenu({anchor:t.target,itemFilterCallback:this.menuItemsFilter,itemSelectedCallback:function(t){var n=e.createFacetTab(t.id),o=e.renderFacetSlot(n);n.init(o),n.showSettingsDialog().then((function(t){t?(e.facets.push(n),e.activeFacetIndex=e.facets.length-1,e.renderFacetTab(n),e.renderActiveFacet(),e.saveFacets()):e.bodyDiv.removeChild(o)})).catch((function(t){return console.error(t)}))}})},e.prototype.selectClickHandler=function(t){var e=this.facets.indexOf(t);this.setActiveFacet(e)},e.prototype.settingsClickHandler=function(t){var e=this;t.showSettingsDialog().then((function(t){t&&(e.refreshFacetTabs(),e.renderActiveFacet(),e.saveFacets())})).catch((function(t){return console.error(t)}))},e.prototype.closeClickHandler=function(t){var e=this;this.getDialogService().openConfirm(r.i18n.getText("Facets","RemoveFacetDlgTitle"),r.i18n.getText("Facets","RemoveFacetDlgContent").replace("{facetTitle}",t.title)).then((function(n){n&&(e.removeFacet(t),e.saveFacets())})).catch((function(t){return console.error(t)}))},e.prototype.clear=function(){this.firstRender=!0,this.slot.innerHTML=""},e.prototype.createDefaultFacetIfNotExist=function(){if(0===this.facets.length){var t=this.createFacetTab(a.a.DataGrid);this.facets.push(t),this.activeFacetIndex=0}},e.prototype.validateAddFacetButton=function(){this.addFacetButton.hidden=0==this.addMenu.getItems().filter(this.menuItemsFilter).length},e.prototype.setActiveFacet=function(t){this.activeFacetIndex!=t&&(this.activeFacetIndex=t,this.renderActiveFacet(),this.saveFacets(!0))},e.prototype.setOptions=function(t){r.utils.assignDeep(this.options,t)},e.prototype.getDialogService=function(){return this.getContext().getServices().getDialogService()},e.prototype.saveFacets=function(t){void 0===t&&(t=!1);var e=this.getQuery();e.innerData=e.innerData||{},e.innerData.facets={active:this.activeFacetIndex,items:this.facets.map((function(t){return t.saveToData()}))},e.fireChangedEvent({part:i.QueryChangePart.Facets,action:t?i.QueryChangeAction.Activate:i.QueryChangeAction.All,source:this})},e.prototype.reloadFacets=function(){for(var t=0,e=this.facets;t<e.length;t++){e[t].destroy()}this.loadFacets()},e.prototype.loadFacets=function(){var t=this.getQuery();if(this.facets=[],t.innerData&&t.innerData.facets){for(var e=0,n=t.innerData.facets.items;e<n.length;e++){var o=n[e],i=this.createFacetTab(o.type);i.loadFromData(o),this.facets.push(i)}var r=t.innerData.facets.active;this.activeFacetIndex=r>=0?r:this.facets.length-1}else this.createDefaultFacetIfNotExist()},e}(y)},function(t,e,n){(function(e,n){var o;o=function(){"use strict";function t(t){return"function"==typeof t}var o=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},i=0,r=void 0,s=void 0,a=function(t,e){f[i]=t,f[i+1]=e,2===(i+=2)&&(s?s(g):C())},l="undefined"!=typeof window?window:void 0,u=l||{},c=u.MutationObserver||u.WebKitMutationObserver,d="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function p(){var t=setTimeout;return function(){return t(g,1)}}var f=new Array(1e3);function g(){for(var t=0;t<i;t+=2)(0,f[t])(f[t+1]),f[t]=void 0,f[t+1]=void 0;i=0}var y,m,v,b,C=void 0;function x(t,e){var n=this,o=new this.constructor(E);void 0===o[T]&&L(o);var i=n._state;if(i){var r=arguments[i-1];a((function(){return B(i,o,r,n._result)}))}else A(n,o,t,e);return o}function w(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(E);return k(e,t),e}d?C=function(){return e.nextTick(g)}:c?(m=0,v=new c(g),b=document.createTextNode(""),v.observe(b,{characterData:!0}),C=function(){b.data=m=++m%2}):h?((y=new MessageChannel).port1.onmessage=g,C=function(){return y.port2.postMessage(0)}):C=void 0===l?function(){try{var t=Function("return this")().require("vertx");return void 0!==(r=t.runOnLoop||t.runOnContext)?function(){r(g)}:p()}catch(t){return p()}}():p();var T=Math.random().toString(36).substring(2);function E(){}var D=void 0;function S(e,n,o){n.constructor===e.constructor&&o===x&&n.constructor.resolve===w?function(t,e){1===e._state?I(t,e._result):2===e._state?O(t,e._result):A(e,void 0,(function(e){return k(t,e)}),(function(e){return O(t,e)}))}(e,n):void 0===o?I(e,n):t(o)?function(t,e,n){a((function(t){var o=!1,i=function(t,e,n,o){try{t.call(e,n,o)}catch(t){return t}}(n,e,(function(n){o||(o=!0,e!==n?k(t,n):I(t,n))}),(function(e){o||(o=!0,O(t,e))}),t._label);!o&&i&&(o=!0,O(t,i))}),t)}(e,n,o):I(e,n)}function k(t,e){if(t===e)O(t,new TypeError("You cannot resolve a promise with itself"));else if(i=typeof(o=e),null===o||"object"!==i&&"function"!==i)I(t,e);else{var n=void 0;try{n=e.then}catch(e){return void O(t,e)}S(t,e,n)}var o,i}function M(t){t._onerror&&t._onerror(t._result),P(t)}function I(t,e){t._state===D&&(t._result=e,t._state=1,0!==t._subscribers.length&&a(P,t))}function O(t,e){t._state===D&&(t._state=2,t._result=e,a(M,t))}function A(t,e,n,o){var i=t._subscribers,r=i.length;t._onerror=null,i[r]=e,i[r+1]=n,i[r+2]=o,0===r&&t._state&&a(P,t)}function P(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var o=void 0,i=void 0,r=t._result,s=0;s<e.length;s+=3)o=e[s],i=e[s+n],o?B(n,o,i,r):i(r);t._subscribers.length=0}}function B(e,n,o,i){var r=t(o),s=void 0,a=void 0,l=!0;if(r){try{s=o(i)}catch(t){l=!1,a=t}if(n===s)return void O(n,new TypeError("A promises callback cannot return that same promise."))}else s=i;n._state!==D||(r&&l?k(n,s):!1===l?O(n,a):1===e?I(n,s):2===e&&O(n,s))}var _=0;function L(t){t[T]=_++,t._state=void 0,t._result=void 0,t._subscribers=[]}var R=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(E),this.promise[T]||L(this.promise),o(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?I(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&I(this.promise,this._result))):O(this.promise,new Error("Array Methods must be provided an Array"))}return t.prototype._enumerate=function(t){for(var e=0;this._state===D&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,o=n.resolve;if(o===w){var i=void 0,r=void 0,s=!1;try{i=t.then}catch(t){s=!0,r=t}if(i===x&&t._state!==D)this._settledAt(t._state,e,t._result);else if("function"!=typeof i)this._remaining--,this._result[e]=t;else if(n===F){var a=new n(E);s?O(a,r):S(a,t,i),this._willSettleAt(a,e)}else this._willSettleAt(new n((function(e){return e(t)})),e)}else this._willSettleAt(o(t),e)},t.prototype._settledAt=function(t,e,n){var o=this.promise;o._state===D&&(this._remaining--,2===t?O(o,n):this._result[e]=n),0===this._remaining&&I(o,this._result)},t.prototype._willSettleAt=function(t,e){var n=this;A(t,void 0,(function(t){return n._settledAt(1,e,t)}),(function(t){return n._settledAt(2,e,t)}))},t}(),F=function(){function e(t){this[T]=_++,this._result=this._state=void 0,this._subscribers=[],E!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof e?function(t,e){try{e((function(e){k(t,e)}),(function(e){O(t,e)}))}catch(e){O(t,e)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(t){return this.then(null,t)},e.prototype.finally=function(e){var n=this,o=n.constructor;return t(e)?n.then((function(t){return o.resolve(e()).then((function(){return t}))}),(function(t){return o.resolve(e()).then((function(){throw t}))})):n.then(e,e)},e}();return F.prototype.then=x,F.all=function(t){return new R(this,t).promise},F.race=function(t){var e=this;return o(t)?new e((function(n,o){for(var i=t.length,r=0;r<i;r++)e.resolve(t[r]).then(n,o)})):new e((function(t,e){return e(new TypeError("You must pass an array to race."))}))},F.resolve=w,F.reject=function(t){var e=new this(E);return O(e,t),e},F._setScheduler=function(t){s=t},F._setAsap=function(t){a=t},F._asap=a,F.polyfill=function(){var t=void 0;if(void 0!==n)t=n;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var o=null;try{o=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===o&&!e.cast)return}t.Promise=F},F.Promise=F,F},t.exports=o()}).call(this,n(113),n(114))},function(t,e,n){"use strict";(function(t){n.d(e,"b",(function(){return c})),n.d(e,"a",(function(){return d}));var o,i=n(11),r=n(110),s=n(36),a=n(57),l=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=function(){return u=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},u.apply(this,arguments)},c=function(t){function e(e,n){var o=t.call(this,n)||this;return o.status=e,o}return l(e,t),e}(Error),d=function(){function e(){this.defaultHeaders={},this.customPayload=void 0}return Object.defineProperty(e.prototype,"responseBody",{get:function(){return this._responseBody},enumerable:!0,configurable:!0}),e.prototype.get=function(t,e){return this.send(s.a.Get,t,null,e)},e.prototype.post=function(t,e,n){return this.send(s.a.Post,t,e,n)},e.prototype.put=function(t,e,n){return this.send(s.a.Put,t,e,n)},e.prototype.delete=function(t,e,n){return this.send(s.a.Delete,t,e,n)},e.prototype.send=function(n,o,s,l){var d=this,h=(l=l||{}).dataType||"json",p=l.contentType||"form-data"!==h?"application/json":null;s&&"form-data"!=h&&this.customPayload&&(s.data=i.a.assignDeep(s.data||{},this.customPayload));var f=new("onload"in new XMLHttpRequest?XMLHttpRequest:window.XDomainRequest),g={method:n,url:o,headers:u(u({},this.defaultHeaders),l.headers||{}),queryParams:l.queryParams||{},data:s};p&&(g.headers["Content-Type"]=p);var y=new a.a(f,g);this.beforeEachRequest&&(console.warn("HttpClient: 'beforeEachRequest' is deprecated and will be removed in future updates.\n Use 'onRequest' instead"),this.beforeEachRequest(y)),this.onRequest&&this.onRequest(y);var m=y.data&&"string"!=typeof y.data&&"json"==h?JSON.stringify(y.data):y.data;return y.open(),new r.a(y,new t((function(n,i){l.responseType&&(f.responseType=l.responseType),f.onerror=function(t){i(new c(f.status,f.responseText))},f.onreadystatechange=function(){if(4==f.readyState){var r=f.getResponseHeader("Content-Type")||"",s=f.status;if(0===s)i(new c(s,"Network error or the request was aborted"));else if(s>=200&&s<400){var a="arraybuffer"===f.responseType||"blob"===f.responseType?f.response:0==r.indexOf("application/json")?JSON.parse(f.responseText):f.responseText;d._responseBody=a,d.onResponse&&d.onResponse(f),n(a)}else{("arraybuffer"===f.responseType||"blob"===f.responseType?e.decodeArrayBuffer(f.response):t.resolve(f.responseText)).then((function(t){var e=0==r.indexOf("application/json")?JSON.parse(t):t;d._responseBody=e;var n=e.message||(404==s?"No such endpoint: "+o:e);i(new c(s,n))}))}}},f.send(m)})))},e.decodeArrayBuffer=function(e){var n=new FileReader;return new t((function(t){n.onloadend=function(){n.readyState==FileReader.DONE&&t(n.result)},n.readAsText(new Blob([e]))}))},e}()}).call(this,n(102))},function(t,e,n){(function(e,n){var o;o=function(){"use strict";function t(t){return"function"==typeof t}var o=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},i=0,r=void 0,s=void 0,a=function(t,e){f[i]=t,f[i+1]=e,2===(i+=2)&&(s?s(g):C())},l="undefined"!=typeof window?window:void 0,u=l||{},c=u.MutationObserver||u.WebKitMutationObserver,d="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function p(){var t=setTimeout;return function(){return t(g,1)}}var f=new Array(1e3);function g(){for(var t=0;t<i;t+=2)(0,f[t])(f[t+1]),f[t]=void 0,f[t+1]=void 0;i=0}var y,m,v,b,C=void 0;function x(t,e){var n=this,o=new this.constructor(E);void 0===o[T]&&L(o);var i=n._state;if(i){var r=arguments[i-1];a((function(){return B(i,o,r,n._result)}))}else A(n,o,t,e);return o}function w(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(E);return k(e,t),e}d?C=function(){return e.nextTick(g)}:c?(m=0,v=new c(g),b=document.createTextNode(""),v.observe(b,{characterData:!0}),C=function(){b.data=m=++m%2}):h?((y=new MessageChannel).port1.onmessage=g,C=function(){return y.port2.postMessage(0)}):C=void 0===l?function(){try{var t=Function("return this")().require("vertx");return void 0!==(r=t.runOnLoop||t.runOnContext)?function(){r(g)}:p()}catch(t){return p()}}():p();var T=Math.random().toString(36).substring(2);function E(){}var D=void 0;function S(e,n,o){n.constructor===e.constructor&&o===x&&n.constructor.resolve===w?function(t,e){1===e._state?I(t,e._result):2===e._state?O(t,e._result):A(e,void 0,(function(e){return k(t,e)}),(function(e){return O(t,e)}))}(e,n):void 0===o?I(e,n):t(o)?function(t,e,n){a((function(t){var o=!1,i=function(t,e,n,o){try{t.call(e,n,o)}catch(t){return t}}(n,e,(function(n){o||(o=!0,e!==n?k(t,n):I(t,n))}),(function(e){o||(o=!0,O(t,e))}),t._label);!o&&i&&(o=!0,O(t,i))}),t)}(e,n,o):I(e,n)}function k(t,e){if(t===e)O(t,new TypeError("You cannot resolve a promise with itself"));else if(i=typeof(o=e),null===o||"object"!==i&&"function"!==i)I(t,e);else{var n=void 0;try{n=e.then}catch(e){return void O(t,e)}S(t,e,n)}var o,i}function M(t){t._onerror&&t._onerror(t._result),P(t)}function I(t,e){t._state===D&&(t._result=e,t._state=1,0!==t._subscribers.length&&a(P,t))}function O(t,e){t._state===D&&(t._state=2,t._result=e,a(M,t))}function A(t,e,n,o){var i=t._subscribers,r=i.length;t._onerror=null,i[r]=e,i[r+1]=n,i[r+2]=o,0===r&&t._state&&a(P,t)}function P(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var o=void 0,i=void 0,r=t._result,s=0;s<e.length;s+=3)o=e[s],i=e[s+n],o?B(n,o,i,r):i(r);t._subscribers.length=0}}function B(e,n,o,i){var r=t(o),s=void 0,a=void 0,l=!0;if(r){try{s=o(i)}catch(t){l=!1,a=t}if(n===s)return void O(n,new TypeError("A promises callback cannot return that same promise."))}else s=i;n._state!==D||(r&&l?k(n,s):!1===l?O(n,a):1===e?I(n,s):2===e&&O(n,s))}var _=0;function L(t){t[T]=_++,t._state=void 0,t._result=void 0,t._subscribers=[]}var R=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(E),this.promise[T]||L(this.promise),o(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?I(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&I(this.promise,this._result))):O(this.promise,new Error("Array Methods must be provided an Array"))}return t.prototype._enumerate=function(t){for(var e=0;this._state===D&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,o=n.resolve;if(o===w){var i=void 0,r=void 0,s=!1;try{i=t.then}catch(t){s=!0,r=t}if(i===x&&t._state!==D)this._settledAt(t._state,e,t._result);else if("function"!=typeof i)this._remaining--,this._result[e]=t;else if(n===F){var a=new n(E);s?O(a,r):S(a,t,i),this._willSettleAt(a,e)}else this._willSettleAt(new n((function(e){return e(t)})),e)}else this._willSettleAt(o(t),e)},t.prototype._settledAt=function(t,e,n){var o=this.promise;o._state===D&&(this._remaining--,2===t?O(o,n):this._result[e]=n),0===this._remaining&&I(o,this._result)},t.prototype._willSettleAt=function(t,e){var n=this;A(t,void 0,(function(t){return n._settledAt(1,e,t)}),(function(t){return n._settledAt(2,e,t)}))},t}(),F=function(){function e(t){this[T]=_++,this._result=this._state=void 0,this._subscribers=[],E!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof e?function(t,e){try{e((function(e){k(t,e)}),(function(e){O(t,e)}))}catch(e){O(t,e)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(t){return this.then(null,t)},e.prototype.finally=function(e){var n=this,o=n.constructor;return t(e)?n.then((function(t){return o.resolve(e()).then((function(){return t}))}),(function(t){return o.resolve(e()).then((function(){throw t}))})):n.then(e,e)},e}();return F.prototype.then=x,F.all=function(t){return new R(this,t).promise},F.race=function(t){var e=this;return o(t)?new e((function(n,o){for(var i=t.length,r=0;r<i;r++)e.resolve(t[r]).then(n,o)})):new e((function(t,e){return e(new TypeError("You must pass an array to race."))}))},F.resolve=w,F.reject=function(t){var e=new this(E);return O(e,t),e},F._setScheduler=function(t){s=t},F._setAsap=function(t){a=t},F._asap=a,F.polyfill=function(){var t=void 0;if(void 0!==n)t=n;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var o=null;try{o=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===o&&!e.cast)return}t.Promise=F},F.Promise=F,F},t.exports=o()}).call(this,n(54),n(55))},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return a}));var o=n(58),i=n(49),r=n(7),s=n(11),a=function(){function e(t){if(this._chunkSize=1e3,this._elasticChunks=!1,this.cachedRows=[],this.total=0,this.loader=null,this.needTotal=!0,this.isInMemory=!1,t=t||{},this._chunkSize=t.chunkSize||this._chunkSize,this._elasticChunks=t.elasticChunks||this._elasticChunks,this.loader=t.loader,void 0!==t.inMemory&&(this.isInMemory=t.inMemory),this.isInMemory&&(this.needTotal=!1),this._columns=new o.c,this.onUpdate=t.onUpdate,t.columns)for(var e=0,n=t.columns;e<n.length;e++){var i=n[e];this._columns.add(i)}if(t.rows)for(var r=0,s=t.rows;r<s.length;r++){var a=s[r],l=this.createRow(a);this.addRow(l)}this.needTotal=!this._elasticChunks}return Object.defineProperty(e.prototype,"columns",{get:function(){return this._columns},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"chunkSize",{get:function(){return this._chunkSize},set:function(t){this._chunkSize=t,this.total=0,this.needTotal=!this.elasticChunks,this.cachedRows=[]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"elasticChunks",{get:function(){return this._elasticChunks},set:function(t){this._elasticChunks=t,this.total=0,this.needTotal=!this.elasticChunks,this.cachedRows=[]},enumerable:!0,configurable:!0}),e.prototype.getRows=function(e){var n=this,o=0,i=this._chunkSize;e&&("page"in e?(o=e.pageSize*(e.page-1),i=e.pageSize):(o=e.offset,i=e.limit));var r=o+i;if(!this.needTotal&&!this.elasticChunks){if(o>=this.total)return t.resolve([]);r>this.total&&(r=this.total)}if(this.isInMemory&&r>this.cachedRows.length&&(r=this.cachedRows.length),r<=this.cachedRows.length)return t.resolve(this.cachedRows.slice(o,r));if(!this.loader)throw"Loader is not defined. Can't get the rows from "+o+" to "+r;var s=this.needTotal;this.needTotal&&(this.needTotal=!1);var a=this.cachedRows.length,l=r-a;return l<this._chunkSize&&(l=this._chunkSize),this.loader.loadChunk({offset:a,limit:l,needTotal:s}).then((function(t){(s&&(n.total=t.total),Array.prototype.push.apply(n.cachedRows,t.table.getCachedRows()),r>n.cachedRows.length&&(r=n.cachedRows.length),n.elasticChunks)&&(t.table.getCachedCount()<l&&(n.total=n.cachedRows.length));return n.fireUpdated(),n.cachedRows.slice(o,r)}))},e.prototype.getRow=function(t){return this.getRows({offset:t,limit:1}).then((function(t){return t.length>0?t[0]:null}))},e.prototype.getTotal=function(){return this.total},e.prototype.setTotal=function(t){this.total=t,this.needTotal=!1},e.prototype.getCachedCount=function(){return this.cachedRows.length},e.prototype.clear=function(){this.columns.clear(),this.cachedRows=[],this.total=0,this.needTotal=!this._elasticChunks,this.fireUpdated()},e.prototype.createRow=function(t){var e=this,n=this._columns.getDateColumnIndexes(),o=new Array(this._columns.count),r=t instanceof i.a?function(e){return t.getValue(e)}:function(e){return t[e]};return t&&this.columns.getItems().forEach((function(t){var i=r(t.id),s=e.columns.getIndex(t.id);o[s]=n.indexOf(s)>=0?e.mapDate(i,t.type):i})),new i.a(this._columns,o)},e.prototype.mapDate=function(t,e){if(t){var n=new Date(t);return isNaN(n.getTime())&&e==r.a.Time&&(n=s.a.strToTime(t)),n}return null},e.prototype.addRow=function(t){var e;if(Array.isArray(t)){var n=t,o=this._columns.getDateColumnIndexes();if(o.length>0)for(var r=0,s=o;r<s.length;r++){var a=s[r];n[a]&&(n[a]=this.mapDate(n[a],this._columns.get(a).type))}e=new i.a(this._columns,n)}else e=this.createRow(t);this.cachedRows.push(e);var l=this.getCachedCount();return l>this.total&&(this.total=l),e},e.prototype.getCachedRows=function(){return this.cachedRows},e.prototype.totalIsKnown=function(){return this.elasticChunks?this.getCachedCount()===this.total:!this.needTotal},e.prototype.fireUpdated=function(){this.onUpdate&&this.onUpdate(this)},e}()}).call(this,n(102))},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return GoogleDataConverter}));var _easydata_core__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(0),GoogleDataConverter=function(){function GoogleDataConverter(t){t||(t={cols:[],rows:[]}),"string"==typeof t?this.loadFromJSON(t):this.tableObj=t}return GoogleDataConverter.prototype.loadFromJSON=function(t){this.tableObj=JSON.parse(t)},GoogleDataConverter.prototype.toJSON=function(){return JSON.stringify(this.tableObj)},GoogleDataConverter.prototype.getObject=function(){return this.tableObj},GoogleDataConverter.prototype.isEmpty=function(){return 0==this.getNumberOfColumns()||0==this.getNumberOfRows()},GoogleDataConverter.prototype.getNumberOfColumns=function(){return this.tableObj.cols.length},GoogleDataConverter.prototype.getColumnObject=function(t){return t<this.tableObj.cols.length?this.tableObj.cols[t]:null},GoogleDataConverter.prototype.getColumnId=function(t){var e=this.getColumnObject(t);return e?e.id:null},GoogleDataConverter.prototype.getColumnLabel=function(t){var e=this.getColumnObject(t);return e?e.label:null},GoogleDataConverter.prototype.getColumnType=function(t){var e=this.getColumnObject(t);return e?e.type:null},GoogleDataConverter.prototype.getColumnProperties=function(t){var e=this.getColumnObject(t);return e?e.p:null},GoogleDataConverter.prototype.getNumberOfRows=function(){return this.tableObj.rows.length},GoogleDataConverter.prototype.convertValue=function(value,colIndex){var colType=this.googleDataTypeToDataType(this.getColumnType(colIndex));return[_easydata_core__WEBPACK_IMPORTED_MODULE_0__.DataType.Date,_easydata_core__WEBPACK_IMPORTED_MODULE_0__.DataType.DateTime,_easydata_core__WEBPACK_IMPORTED_MODULE_0__.DataType.Time].includes(colType)?eval("new "+value):value},GoogleDataConverter.prototype.getValue=function(t,e){var n=t<this.tableObj.rows.length?this.tableObj.rows[t]:null;if(n){var o=e<this.tableObj.cols.length?n.c[e]:null;if(o)return this.convertValue(o.v,e)}return null},GoogleDataConverter.prototype.getRow=function(t){var e=this;return(t<this.tableObj.rows.length?this.tableObj.rows[t]:null).c.map((function(t,n){return e.convertValue(t.v,n)}),this)},GoogleDataConverter.prototype.convertTo=function(t){for(var e=this.getNumberOfColumns(),n=0;n<e;n++)t.columns.add({id:this.getColumnId(n),label:this.getColumnLabel(n),type:this.googleDataTypeToDataType(this.getColumnType(n))});var o=this.getNumberOfRows();for(n=0;n<o;n++)t.addRow(this.getRow(n))},GoogleDataConverter.prototype.googleDataTypeToDataType=function(t){switch(t){case"string":default:return _easydata_core__WEBPACK_IMPORTED_MODULE_0__.DataType.String;case"number":return _easydata_core__WEBPACK_IMPORTED_MODULE_0__.DataType.Float;case"boolean":return _easydata_core__WEBPACK_IMPORTED_MODULE_0__.DataType.Bool;case"date":return _easydata_core__WEBPACK_IMPORTED_MODULE_0__.DataType.Date;case"datetime":return _easydata_core__WEBPACK_IMPORTED_MODULE_0__.DataType.DateTime;case"timeofday":return _easydata_core__WEBPACK_IMPORTED_MODULE_0__.DataType.Time}},GoogleDataConverter}()},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return i}));var o=n(0),i=function(){function e(t){this.models=[],t&&o.utils.assign(this.models,[],t)}return e.prototype.getModels=function(){var e=this;return new t((function(t,n){t(e.models)}))},e}()}).call(this,n(51))},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return h}));var o=n(0),i=n(37),r=n(6),s=n(18),a=n(34),l=n(22),u=n(39),c=function(){return c=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},c.apply(this,arguments)},d=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var o=Array(t),i=0;for(e=0;e<n;e++)for(var r=arguments[e],s=0,a=r.length;s<a;s++,i++)o[i]=r[s];return o},h=function(){function e(t){if(this.cssPrefix="keg",this.pagination={page:1,pageSize:30,total:0},this.paginationOptions={maxButtonCount:10,useBootstrap:!1},this.defaultDataGridOptions={slot:null,dataTable:null,fixHeightOnFirstRender:!1,syncGridColumns:!0,useRowNumeration:!0,allowDragDrop:!1,aggregates:{settings:null,calculator:null},paging:{enabled:!0,pageSize:30,pageSizeItems:[20,30,50,100,200]},columnWidths:{autoResize:a.a.Always,stringColumns:{min:100,max:500,default:250},numberColumns:{min:60,default:120},boolColumns:{min:50,default:80},dateColumns:{min:80,default:200},otherColumns:{min:100,max:500,default:250},rowNumColumn:{min:40,default:60}},showPlusButton:!1,viewportRowsCount:null,showActiveRow:!0},this.rowsOnPagePromise=null,this.containerInitialHeight=0,this.firstRender=!0,this.prevRowTotals=null,this.landingIndex=-1,this.landingSlot=Object(r.e)("div").addClass(this.cssPrefix+"-col-landing-slot").addChildElement(Object(r.e)("div").toDOM()).toDOM(),this._activeRowIndex=-1,t&&t.paging&&(t.paging=o.utils.assign(this.defaultDataGridOptions.paging,t.paging)),this.options=this.mergeOptions(t),this.processColumnWidthsOptions(),!this.options.slot)throw Error('"slot" parameter is required to initialize EasyDataGrid');if(!this.options.dataTable)throw Error('"dataTable" parameter is required to initialize EasyDataGrid');this.dataTable=t.dataTable,this.eventEmitter=new o.EventEmitter(this),this.cellRendererStore=new u.c(t),this.columns=new l.c(this.dataTable.columns,this),this.setSlot(this.options.slot),this.init(this.options)}return e.prototype.mergeOptions=function(t){var e=o.utils.assignDeep({},this.defaultDataGridOptions.columnWidths,t.columnWidths),n=o.utils.assignDeep({},this.defaultDataGridOptions.paging,t.paging),i=o.utils.assign({},this.defaultDataGridOptions,t);return i.columnWidths=e,i.paging=n,i},e.prototype.processColumnWidthsOptions=function(){var t=this.options.columnWidths;if(t){o.utils.getStringDataTypes().forEach((function(e){t[e]=c(c({},t.stringColumns),t[e])})),o.utils.getNumericDataTypes().forEach((function(e){t[e]=c(c({},t.numberColumns),t[e])})),t[o.DataType.Bool]=c(c({},t.boolColumns),t[o.DataType.Bool]),o.utils.getDateDataTypes().forEach((function(e){t[e]=c(c({},t.dateColumns),t[e])}));var e=d(o.utils.getStringDataTypes(),o.utils.getNumericDataTypes(),o.utils.getDateDataTypes(),[o.DataType.Bool]);o.utils.getAllDataTypes().forEach((function(n){n in e||(t[n]=c(c({},t.otherColumns),t[n]))})),t[o.DataType.Unknown]=t.otherColumns}},e.prototype.setSlot=function(t){if("string"==typeof t){if(t.length)if("#"===t[0])this.slot=document.getElementById(t.substring(1));else{if("."!==t[0])throw Error("Unrecognized slot parameter (Must be id, class or HTMLElement): "+t);var e=document.getElementsByClassName(t.substring(1));e.length&&(this.slot=e[0])}}else this.slot=t},e.prototype.init=function(t){var e=this;t.onInit&&this.addEventListener("init",t.onInit),t.onRowClick&&this.addEventListener("rowClick",t.onRowClick),t.onRowDbClick&&this.addEventListener("rowDbClick",t.onRowDbClick),t.onPlusButtonClick&&this.addEventListener("plusButtonClick",t.onPlusButtonClick),t.onColumnChanged&&this.addEventListener("columnChanged",t.onColumnChanged),t.onColumnDeleted&&this.addEventListener("columnDeleted",t.onColumnDeleted),t.onColumnMoved&&this.addEventListener("columnMoved",t.onColumnMoved),t.onPageChanged&&this.addEventListener("pageChanged",t.onPageChanged),t.onActiveRowChanged&&this.addEventListener("activeRowChanged",t.onActiveRowChanged),this.addEventListener("pageChanged",(function(t){return e.activeRowIndex=-1})),o.utils.assignDeep(this.paginationOptions,t.pagination),this.pagination.pageSize=this.options.paging.pageSize||this.pagination.pageSize,this.options.allowDragDrop&&i.d.registerDropContainer({element:this.slot,scopes:["gridColumnMove"],onDragEnter:function(t,n){e.slot.classList.add(s.e+"-drophover"),e.showLandingSlot(n.pageX,n.pageY)},onDragOver:function(t,n){e.showLandingSlot(n.pageX,n.pageY)},onDragLeave:function(t,n){n.dropEffect=i.b.Forbid,e.slot.classList.remove(s.e+"-drophover"),e.hideLandingSlot()},onDrop:function(t,n){e.dataTable.columns.move(n.data.column,e.landingIndex),e.refresh(),e.fireEvent({type:"columnMoved",columnId:n.data.column.id,newIndex:e.landingIndex})}}),this.refresh(),this.fireEvent("init")},e.prototype.fireEvent=function(t){"string"==typeof t?this.eventEmitter.fire(t):this.eventEmitter.fire(t.type,t)},e.prototype.setData=function(t){this.dataTable=t,this.clear(),this.refresh()},e.prototype.getData=function(){return this.dataTable},e.prototype.getColumns=function(){return this.columns},e.prototype.destroy=function(){this.slot.innerHTML=""},e.prototype.refresh=function(){this.clearDOM(),this.render()},e.prototype.clearDOM=function(){this.slot.innerHTML=""},e.prototype.clear=function(){this.pagination.page=1,this.clearDOM()},e.prototype.render=function(){var t=this;if(this.hasData()||this.options.showPlusButton){this.containerInitialHeight=this.slot.clientHeight,this.rootDiv=document.createElement("div"),this.rootDiv.style.width="100%",this.rootDiv.classList.add(this.cssPrefix+"-root"),this.columns.sync(this.dataTable.columns,this.options.useRowNumeration),this.renderHeader(),this.rootDiv.appendChild(this.headerDiv),this.renderBody(),this.rootDiv.appendChild(this.bodyDiv),this.renderFooter(),this.rootDiv.appendChild(this.footerDiv);var e=document.createElement("div");e.classList.add(this.cssPrefix+"-container"),e.appendChild(this.rootDiv),this.slot.appendChild(e);var n=this.options.columnWidths.autoResize!==a.a.Never;this.rowsOnPagePromise?this.rowsOnPagePromise.then((function(){return t.updateHeight()})).then((function(){t.firstRender=!1,t.rowsOnPagePromise=null})):setTimeout((function(){t.updateHeight().then((function(){t.firstRender=!1,n&&t.resizeColumns()}))}),100)}},e.prototype.updateHeight=function(){var e=this;return new t((function(t){if(e.options.viewportRowsCount){var n=e.bodyCellContainerDiv.firstElementChild,o=(n?n.offsetHeight:36)*e.options.viewportRowsCount;return Object(r.e)(e.bodyViewportDiv).setStyle("height",o+"px"),void setTimeout((function(){var n=e.bodyViewportDiv.offsetHeight-e.bodyViewportDiv.clientHeight;o+=n,Object(r.e)(e.bodyViewportDiv).setStyle("height",o+"px"),t()}),100)}e.containerInitialHeight,t()})).then((function(){e.options.fixHeightOnFirstRender&&e.firstRender&&(e.slot.style.height=e.slot.offsetHeight+"px")}))},e.prototype.getContainerWidth=function(){return this.columns.getItems().filter((function(t){return t.isVisible})).map((function(t){return t.width})).reduce((function(t,e){return t+e}))},e.prototype.renderHeader=function(){var t=this;this.headerDiv=Object(r.e)("div").addClass(this.cssPrefix+"-header").toDOM(),this.headerViewportDiv=Object(r.e)("div",this.headerDiv).addClass(this.cssPrefix+"-header-viewport").toDOM(),this.headerCellContainerDiv=Object(r.e)("div",this.headerViewportDiv).addClass(this.cssPrefix+"-header-cell-container").toDOM(),this.headerRowDiv=Object(r.e)("div",this.headerCellContainerDiv).addClass(this.cssPrefix+"-header-row").toDOM(),this.columns.getItems().forEach((function(e,n){if(e.isVisible){var o=t.renderColumnHeader(e,n);t.headerRowDiv.appendChild(o),e.isRowNum&&Object(r.e)(o).addChildElement(t.renderHeaderButtons())}}));var e=this.getContainerWidth();Object(r.e)(this.headerCellContainerDiv).setStyle("width",e+"px")},e.prototype.hasData=function(){return this.dataTable.columns.count>0},e.prototype.renderColumnHeader=function(t,e){var n=this,o=Object(r.e)("div").addClass(this.cssPrefix+"-header-cell").data("col-idx",""+e).setStyle("width",t.width+"px");t.dataColumn&&o.data("col-id",""+t.dataColumn.id);var s=o.toDOM();return Object(r.e)("div",s).addClass(this.cssPrefix+"-header-cell-resize"),t.isRowNum||Object(r.e)("div",s).addClass(this.cssPrefix+"-header-cell-label").text(t.label),t.description&&Object(r.e)("div",s).addClass("question-mark").title(t.description),this.options.allowDragDrop&&i.d.registerDraggableItem({element:s,scope:"gridColumnMove",data:{column:t},renderer:function(e){e.innerHTML="";var o=document.createElement("div");o.innerText=t.label,e.classList.add(n.cssPrefix+"-sortable-helper"),e.appendChild(o)},onDragStart:function(t){t.dropEffect=i.b.Allow}}),s},e.prototype.renderBody=function(){var t=this;this.bodyDiv=Object(r.e)("div").addClass(this.cssPrefix+"-body").toDOM(),this.bodyViewportDiv=Object(r.e)("div",this.bodyDiv).addClass(this.cssPrefix+"-body-viewport").attr("tabIndex","0").toDOM(),this.bodyCellContainerDiv=Object(r.e)("div",this.bodyViewportDiv).addClass(this.cssPrefix+"-cell-container").toDOM();var e=this.canShowAggregates();this.dataTable&&(this.showProgress(),this.rowsOnPagePromise=this.getRowsToRender().then((function(n){t.pagination.total=t.dataTable.getTotal(),t.hideProgress(),t.bodyCellContainerDiv.innerHTML="",t.prevRowTotals=null;var i=0;if(n.length){var s=e?t.options.aggregates.settings.getGroups():[];i=n.length<t.pagination.pageSize?n.length:t.pagination.pageSize,n.forEach((function(n,o){if(e&&t.updateTotalsState(s,n),o<i){var r=t.renderRow(n,o);t.bodyCellContainerDiv.appendChild(r)}}));var l=t.options.aggregates&&t.options.aggregates.showGrandTotalsOnEachPage;if(e&&(t.isLastPage()||l)){var u=new o.DataRow(t.dataTable.columns,new Array(t.dataTable.columns.count));t.updateTotalsState(s,u,!0)}}if(t.options.columnWidths.autoResize!==a.a.Never)t.resizeColumns();else{var c=t.getContainerWidth();Object(r.e)(t.bodyCellContainerDiv).setStyle("width",c+"px")}return i})).catch((function(t){return console.error(t),0}))),this.bodyViewportDiv.addEventListener("scroll",(function(e){Object(r.e)(t.headerViewportDiv).setStyle("margin-left","-"+t.bodyViewportDiv.scrollLeft+"px")})),this.bodyViewportDiv.addEventListener("keydown",this.onViewportKeydown.bind(this))},e.prototype.isLastPage=function(){return this.dataTable.elasticChunks?this.dataTable.totalIsKnown()&&this.pagination.page*this.pagination.pageSize>=this.pagination.total:this.pagination.page*this.pagination.pageSize>=this.pagination.total},e.prototype.canShowAggregates=function(){if(!this.options||!this.options.aggregates||!this.options.aggregates.settings)return!1;var t=this.options.aggregates.settings;return(t.hasAggregates()||t.hasRecordCount())&&(t.hasGroups()||t.hasGrandTotals())},e.prototype.updateTotalsState=function(t,e,n){void 0===n&&(n=!1);var i=this.options.aggregates.settings;if(this.prevRowTotals&&i.hasGroups()){for(var r=-1,s=1;s<=t.length;s++){for(var a=0,l=t[s-1].columns;a<l.length;a++){var u=l[a];if(!i.compareValues(this.prevRowTotals.getValue(u),e.getValue(u))){r=s;break}}if(-1!==r)break}if(-1!==r)for(s=t.length;s>=r;s--){var c=new o.DataRow(this.dataTable.columns,this.prevRowTotals.toArray()),d=this.renderTotalsRow(s,c);this.bodyCellContainerDiv.appendChild(d)}}if(n&&i.hasGrandTotals()&&i.hasAggregates()){d=this.renderTotalsRow(0,e);this.bodyCellContainerDiv.appendChild(d)}this.prevRowTotals=e},e.prototype.applyGroupColumnTemplate=function(t,e,n){var o=t.replace(/{{\s*GroupValue\s*}}/g,e?"<span>"+e+"</span>":"-");return o=o.replace(/{{\s*GroupCount\s*}}/g,n?"<span>"+n+"</span>":"-")},e.prototype.renderTotalsRow=function(t,e){var n=this,o=this.options.aggregates.settings,i=t>0?o.getGroups()[t-1]:{columns:[],aggregates:o.getAggregates()},s=Object(r.e)("div").addClass(this.cssPrefix+"-row").addClass(this.cssPrefix+"-row-totals").addClass(this.cssPrefix+"-totals-lv"+t).data("totals-level",""+t).attr("tabindex","-1").toDOM();this.columns.getItems().forEach((function(t,o){if(t.isVisible){var r="",a=t.isRowNum?-1:n.dataTable.columns.getIndex(t.dataColumn.id);!t.isRowNum&&t.dataColumn&&i.columns.indexOf(t.dataColumn.id)>=0&&(r=e.getValue(a)),a==n.dataTable.columns.count-1&&(r=". . . . . ."),s.appendChild(n.renderCell(t,o,r,s))}}));var a=this.options.aggregates.calculator.getAggrContainer(),l=o.getAggregates().map((function(t){return t.colId})),u=o.buildGroupKey(i,e);return a.getAggregateData(t,u).then((function(r){for(var a=0,u=l;a<u.length;a++){var c=u[a];e.setValue(c,r[c])}s.innerHTML="",n.columns.getItems().forEach((function(a,u){if(a.isVisible){var c="",d=a.isRowNum?-1:n.dataTable.columns.getIndex(a.dataColumn.id);if(!a.isRowNum){var h=!1;if(a.dataColumn){var p=i.columns.indexOf(a.dataColumn.id),f=l.indexOf(a.dataColumn.id);h=t>0?p==i.columns.length-1:0==d,(p>=0||f>=0)&&(c=e.getValue(d))}var g="";if(t>0&&!(g=a.dataColumn.groupFooterColumnTemplate)&&o.hasRecordCount()&&h&&(g="{{GroupValue}} ({{GroupCount}})"),g)c=n.renderCell(a,u,c,s).firstChild.innerHTML,c=n.applyGroupColumnTemplate(g,c,r[o.COUNT_FIELD_NAME])}var y=n.renderCell(a,u,c,s);s.appendChild(y)}}))})).catch((function(t){return console.error(t)})),s},e.prototype.onViewportKeydown=function(t){if(this.options.showActiveRow){var e=this.bodyCellContainerDiv.querySelectorAll("."+this.cssPrefix+"-row").length,n=void 0;switch(t.key){case"ArrowLeft":case"ArrowRight":break;case"ArrowUp":t.preventDefault(),n=this.activeRowIndex<0||this.activeRowIndex>=e?e-1:this.activeRowIndex-1,this.activeRowIndex=n>=0?n:0;break;case"ArrowDown":t.preventDefault(),n=this.activeRowIndex<0||this.activeRowIndex>=e?0:this.activeRowIndex+1,this.activeRowIndex=n<e?n:e-1}}},e.prototype.ensureRowVisibility=function(t){var e="number"==typeof t?this.getDataRow(t):t;if(e){var n=e.getBoundingClientRect(),o=this.bodyViewportDiv.getBoundingClientRect(),i=n.top-o.top,r=n.bottom-o.top,s=this.bodyViewportDiv.clientHeight,a=window.innerHeight||document.documentElement.clientHeight;if(i>0&&r<=s&&n.top>0&&n.bottom<a)return;i<0?this.bodyViewportDiv.scrollTop=this.bodyViewportDiv.scrollTop+i:r>s&&(this.bodyViewportDiv.scrollTop=this.bodyViewportDiv.scrollTop+r-s),(n=e.getBoundingClientRect()).top<0?document.documentElement.scrollTop=document.documentElement.scrollTop+n.top:n.bottom>a&&(document.documentElement.scrollTop=document.documentElement.scrollTop+n.bottom-a)}},e.prototype.getRowsToRender=function(){return!1===this.options.paging.enabled?t.resolve(this.dataTable.getCachedRows()):this.dataTable.getRows({offset:(this.pagination.page-1)*this.pagination.pageSize,limit:this.pagination.pageSize+1}).catch((function(t){return console.error(t),[]}))},e.prototype.renderFooter=function(){var t=this;this.footerDiv=Object(r.e)("div").addClass(this.cssPrefix+"-footer").toDOM(),this.rowsOnPagePromise&&this.rowsOnPagePromise.then((function(e){t.footerDiv.innerHTML="",t.footerPaginateDiv=t.renderPageNavigator(),t.footerDiv.appendChild(t.footerPaginateDiv);var n=t.renderPageInfoBlock(e);t.footerDiv.appendChild(n)}))},e.prototype.renderPageInfoBlock=function(t){var e=Object(r.e)("div").addClass(this.cssPrefix+"-page-info").toDOM();if(this.dataTable.getTotal()>0){var n=t?(this.pagination.page-1)*this.pagination.pageSize+1:0,i=t?n+t-1:0,s=this.dataTable.getTotal().toString();if(this.dataTable.elasticChunks)this.dataTable.getCachedCount()!==this.dataTable.getTotal()&&(s="?");e.innerHTML=o.i18n.getText("GridPageInfo").replace("{FirstPageRecordNum}","<span>"+n.toString()+"</span>").replace("{LastPageRecordNum}","<span>"+i.toString()+"</span>").replace("{Total}","<span>"+s+"</span>")}return e},e.prototype.showProgress=function(){},e.prototype.hideProgress=function(){},e.prototype.getLocalIndexByGlobal=function(t){return this.pagination?t%this.pagination.pageSize:t},e.prototype.getGlobalIndexByLocal=function(t){return this.pagination?(this.pagination.page-1)*this.pagination.pageSize+t:t},e.prototype.renderRow=function(t,e){var n=this,o=this.getGlobalIndexByLocal(e),i=Object(r.e)("div").addClass(this.cssPrefix+"-row").addClass(this.cssPrefix+"-row-"+(e%2==1?"odd":"even")).data("row-idx",""+o).attr("tabindex","-1").on("click",(function(o){n.activeRowIndex=e,n.fireEvent({type:"rowClick",row:t,rowIndex:e,sourceEvent:o})})).on("dblclick",(function(o){n.fireEvent({type:"rowDbClick",row:t,rowIndex:e,sourceEvent:o})}));0==e&&i.addClass(this.cssPrefix+"-row-first");var s=i.toDOM();return this.options.showActiveRow&&e==this.activeRowIndex&&i.addClass(this.cssPrefix+"-row-active"),this.columns.getItems().forEach((function(e,i){if(e.isVisible){var r=e.isRowNum?-1:n.dataTable.columns.getIndex(e.dataColumn.id),a=e.isRowNum?o+1:t.getValue(r);s.appendChild(n.renderCell(e,i,a,s))}})),s},e.prototype.renderCell=function(t,e,n,o){var i=Object(r.e)("div").addClass(this.cssPrefix+"-cell").data("col-idx",""+e).attr("tabindex","-1").setStyle("width",t.width+"px");t.align==l.b.LEFT?i.addClass(this.cssPrefix+"-cell-align-left"):t.align==l.b.RIGHT?i.addClass(this.cssPrefix+"-cell-align-right"):t.align==l.b.CENTER&&i.addClass(this.cssPrefix+"-cell-align-center");var s=i.toDOM(),a=s.appendChild(Object(r.e)("div").addClass(this.cssPrefix+"-cell-value").toDOM());return t.cellRenderer&&t.cellRenderer(n,t,a,o),s},e.prototype.setPage=function(t){this.pagination.page=t,this.fireEvent({type:"pageChanged",page:t}),this.refresh(),this.bodyViewportDiv.focus()},e.prototype.renderPageNavigator=function(){var t=this,e=document.createElement("div");e.className=this.cssPrefix+"-pagination-wrapper";var n=this.dataTable.getTotal();if(this.options.paging&&this.options.paging.enabled&&n>0){var i=this.paginationOptions.useBootstrap?"":this.cssPrefix+"-",r=function(e){var n=e.target;if(n.hasAttribute("data-page")){var o=parseInt(n.getAttribute("data-page"));t.setPage(o)}},s=function(e,n,o,s,a){var l=document.createElement("li");if(l.className=i+"page-item",!s){a&&(l.className+=" active");var u=document.createElement("a");return u.setAttribute("href","javascript:void(0)"),u.innerHTML=n||e.toString(),u.setAttribute("data-page",""+e),u.className=i+"page-link",u.addEventListener("click",r),l.appendChild(u),l}var c=document.createElement("span");if(c.setAttribute("aria-hidden","true"),c.className=i+"page-link",o)l.className+=" disabled";else{if(t.paginationOptions.useBootstrap)(c=document.createElement("a")).setAttribute("href","javascript:void(0)"),c.setAttribute("data-page",""+e);else{var d=document.createElement("a");d.setAttribute("href","javascript:void(0)"),d.setAttribute("data-page",""+e),c=d}c.className=i+"page-link",c.addEventListener("click",r)}return c.innerHTML=n,l.appendChild(c),l};if(this.dataTable.elasticChunks){var a=this.pagination.page||1;(u=document.createElement("ul")).className=i+"pagination";var l=s(a-1,"&laquo;",1==a,!0,!1);u.appendChild(l),l=s(a+1,"&raquo;",this.isLastPage(),!0,!1),u.appendChild(l),e.appendChild(u)}else if(this.pagination.total>this.pagination.pageSize){a=this.pagination.page||1;var u,c=Math.ceil(this.pagination.total/this.pagination.pageSize)||1,d=this.paginationOptions.maxButtonCount||10,h=a-1,p=h-h%d+1,f=p+d-1;f>c&&(f=c),(u=document.createElement("ul")).className=i+"pagination";l=s(p-1,"&laquo;",1==p,!0,!1);u.appendChild(l);for(var g=p;g<=f;g++)l=s(g,g.toString(),!1,!1,g==a),u.appendChild(l);l=s(f+1,"&raquo;",f==c,!0,!1),u.appendChild(l),e.appendChild(u)}if(this.options.paging.allowPageSizeChange){var y=document.createElement("div");y.className=this.cssPrefix+"-page-sizes";var m=document.createElement("div");m.className="kfrm-select "+this.cssPrefix+"-page-sizes-select",y.appendChild(m);var v=document.createElement("select"),b=this.options.paging.pageSizeItems||[],C=new Set(b);C.add(this.options.paging.pageSize||20),Array.from(C).forEach((function(t){var e=document.createElement("option");e.value=t.toString(),e.text=t.toString(),v.appendChild(e)})),v.value=(this.pagination.pageSize||20).toString(),m.appendChild(v),v.addEventListener("change",(function(e){var n=parseInt(e.target.value);t.pagination.pageSize=n,t.pagination.page=1,t.refresh()}));var x=document.createElement("div");x.className=this.cssPrefix+"-page-sizes-label",y.appendChild(x);var w=document.createElement("span");w.innerText=o.i18n.getText("GridItemsPerPage"),x.appendChild(w),e.appendChild(y)}}return e},e.prototype.addEventListener=function(t,e){return this.eventEmitter.subscribe(t,(function(t){return e(t.data)}))},e.prototype.removeEventListener=function(t,e){this.eventEmitter.unsubscribe(t,e)},e.prototype.renderHeaderButtons=function(){var t=this;return this.options.showPlusButton?Object(r.e)("div").addClass(this.cssPrefix+"-header-btn-plus").title(this.options.plusButtonTitle||"Add").addChild("a",(function(e){return e.attr("href","javascript:void(0)").on("click",(function(e){e.preventDefault(),t.fireEvent({type:"plusButtonClick",sourceEvent:e})}))})).toDOM():Object(r.e)("span").addText("#").toDOM()},e.prototype.showLandingSlot=function(t,e){for(var n=this.headerRowDiv.querySelectorAll("[class*="+this.cssPrefix+"-table-col]"),o=[],i=1;i<n.length;i++){var r=n[i];"none"!==r.style.display&&o.push(r)}if(0===o.length)return this.landingIndex=0,void this.headerRowDiv.appendChild(this.landingSlot);var a=Object(s.g)(this.landingSlot);if(!(t>=a.x&&t<=a.x+this.landingSlot.offsetWidth)){for(var l=this.landingIndex,u=0,c=o;u<c.length;u++){var d=c[u],h=Object(s.g)(d),p=d.offsetWidth;t>h.x&&t<h.x+p&&(l=parseInt(d.getAttribute("data-col-idx"))-1)}l!=this.landingIndex&&(this.landingIndex=l,this.landingIndex<o.length?this.headerRowDiv.insertBefore(this.landingSlot,o[this.landingIndex]):this.headerRowDiv.appendChild(this.landingSlot))}},e.prototype.hideLandingSlot=function(){var t=this;this.landingIndex=-1,setTimeout((function(){t.landingSlot.parentElement&&t.landingSlot.parentElement.removeChild(t.landingSlot)}),10)},Object.defineProperty(e.prototype,"activeRowIndex",{get:function(){return this._activeRowIndex},set:function(t){if(t!==this._activeRowIndex){var e=this._activeRowIndex;this._activeRowIndex=t,this.updateActiveRow(),this.fireEvent({type:"activeRowChanged",oldValue:e,newValue:this.activeRowIndex,rowIndex:this.getGlobalIndexByLocal(this.activeRowIndex)})}},enumerable:!0,configurable:!0}),e.prototype.updateActiveRow=function(){var t=this;if(this.options.showActiveRow){this.bodyCellContainerDiv.querySelectorAll("[class*="+this.cssPrefix+"-row-active]").forEach((function(e){e.classList.remove(t.cssPrefix+"-row-active")}));var e=this.getActiveRow();e&&(e.classList.add(this.cssPrefix+"-row-active"),this.ensureRowVisibility(this.activeRowIndex))}},e.prototype.getActiveRow=function(){return this.getDataRow(this.activeRowIndex)},e.prototype.getDataRow=function(t){var e=Array.from(this.bodyCellContainerDiv.querySelectorAll("."+this.cssPrefix+"-row:not(."+this.cssPrefix+"-row-totals)"));return t>=0&&t<e.length?e[t]:null},e.prototype.focus=function(){this.bodyViewportDiv.focus()},e.prototype.resizeColumns=function(){if(this.options.columnWidths.autoResize!==a.a.Never){var t=this.bodyCellContainerDiv.style.width;this.bodyCellContainerDiv.style.visibility="hidden",this.bodyCellContainerDiv.style.width="1px",this.headerRowDiv.style.width="1px";for(var e=0,n=this.columns.getItems(),i=this.headerCellContainerDiv.querySelectorAll("."+this.cssPrefix+"-header-cell"),r=0,s=function(t){var s=n[t];if(!s.isVisible)return"continue";var u=l.options.columnWidths.autoResize!==a.a.Always&&s.dataColumn?s.dataColumn.calculatedWidth:0,c=l.bodyCellContainerDiv.querySelectorAll("."+l.cssPrefix+'-cell[data-col-idx="'+t+'"] > .'+l.cssPrefix+"-cell-value"),d=0;if(u>0)e+=u,s.width=u,c.forEach((function(t){t.parentElement.style.width=u+"px"})),i[r].style.width=u+"px";else if(0==c.length&&(i[r].style.width=null,i[r].style.whiteSpace="nowrap"),d=i[r].offsetWidth,c.length>0){c.forEach((function(t){t.parentElement.style.width=null;var e=t.parentElement.offsetWidth;e>d&&(d=e)})),d+=3;var h=s.isRowNum?l.options.columnWidths.rowNumColumn.max||500:l.options.columnWidths[s.dataColumn.type].max||2e3,p=s.isRowNum?l.options.columnWidths.rowNumColumn.min||0:l.options.columnWidths[s.dataColumn.type].min||20;d>h&&(d=h),d<p&&(d=p),o.utils.isNumericType(s.type)&&(d=Math.round(1.3*d)),e+=d,s.width=d,c.forEach((function(t){t.parentElement.style.width=d+"px"})),i[r].style.width=d+"px",s.dataColumn&&(s.dataColumn.calculatedWidth=d)}else e+=d;r++},l=this,u=0;u<this.columns.count;u++)s(u);e>0?(this.bodyCellContainerDiv.style.width=e+"px",this.headerCellContainerDiv.style.width=e+"px"):(this.bodyCellContainerDiv.style.width=t,this.headerCellContainerDiv.style.width=t),this.bodyCellContainerDiv.style.visibility=null,this.headerRowDiv.removeAttribute("style")}},e}()}).call(this,n(107))},function(t,e,n){(function(e,n){var o;o=function(){"use strict";function t(t){return"function"==typeof t}var o=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},i=0,r=void 0,s=void 0,a=function(t,e){f[i]=t,f[i+1]=e,2===(i+=2)&&(s?s(g):C())},l="undefined"!=typeof window?window:void 0,u=l||{},c=u.MutationObserver||u.WebKitMutationObserver,d="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function p(){var t=setTimeout;return function(){return t(g,1)}}var f=new Array(1e3);function g(){for(var t=0;t<i;t+=2)(0,f[t])(f[t+1]),f[t]=void 0,f[t+1]=void 0;i=0}var y,m,v,b,C=void 0;function x(t,e){var n=this,o=new this.constructor(E);void 0===o[T]&&L(o);var i=n._state;if(i){var r=arguments[i-1];a((function(){return B(i,o,r,n._result)}))}else A(n,o,t,e);return o}function w(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(E);return k(e,t),e}d?C=function(){return e.nextTick(g)}:c?(m=0,v=new c(g),b=document.createTextNode(""),v.observe(b,{characterData:!0}),C=function(){b.data=m=++m%2}):h?((y=new MessageChannel).port1.onmessage=g,C=function(){return y.port2.postMessage(0)}):C=void 0===l?function(){try{var t=Function("return this")().require("vertx");return void 0!==(r=t.runOnLoop||t.runOnContext)?function(){r(g)}:p()}catch(t){return p()}}():p();var T=Math.random().toString(36).substring(2);function E(){}var D=void 0;function S(e,n,o){n.constructor===e.constructor&&o===x&&n.constructor.resolve===w?function(t,e){1===e._state?I(t,e._result):2===e._state?O(t,e._result):A(e,void 0,(function(e){return k(t,e)}),(function(e){return O(t,e)}))}(e,n):void 0===o?I(e,n):t(o)?function(t,e,n){a((function(t){var o=!1,i=function(t,e,n,o){try{t.call(e,n,o)}catch(t){return t}}(n,e,(function(n){o||(o=!0,e!==n?k(t,n):I(t,n))}),(function(e){o||(o=!0,O(t,e))}),t._label);!o&&i&&(o=!0,O(t,i))}),t)}(e,n,o):I(e,n)}function k(t,e){if(t===e)O(t,new TypeError("You cannot resolve a promise with itself"));else if(i=typeof(o=e),null===o||"object"!==i&&"function"!==i)I(t,e);else{var n=void 0;try{n=e.then}catch(e){return void O(t,e)}S(t,e,n)}var o,i}function M(t){t._onerror&&t._onerror(t._result),P(t)}function I(t,e){t._state===D&&(t._result=e,t._state=1,0!==t._subscribers.length&&a(P,t))}function O(t,e){t._state===D&&(t._state=2,t._result=e,a(M,t))}function A(t,e,n,o){var i=t._subscribers,r=i.length;t._onerror=null,i[r]=e,i[r+1]=n,i[r+2]=o,0===r&&t._state&&a(P,t)}function P(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var o=void 0,i=void 0,r=t._result,s=0;s<e.length;s+=3)o=e[s],i=e[s+n],o?B(n,o,i,r):i(r);t._subscribers.length=0}}function B(e,n,o,i){var r=t(o),s=void 0,a=void 0,l=!0;if(r){try{s=o(i)}catch(t){l=!1,a=t}if(n===s)return void O(n,new TypeError("A promises callback cannot return that same promise."))}else s=i;n._state!==D||(r&&l?k(n,s):!1===l?O(n,a):1===e?I(n,s):2===e&&O(n,s))}var _=0;function L(t){t[T]=_++,t._state=void 0,t._result=void 0,t._subscribers=[]}var R=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(E),this.promise[T]||L(this.promise),o(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?I(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&I(this.promise,this._result))):O(this.promise,new Error("Array Methods must be provided an Array"))}return t.prototype._enumerate=function(t){for(var e=0;this._state===D&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,o=n.resolve;if(o===w){var i=void 0,r=void 0,s=!1;try{i=t.then}catch(t){s=!0,r=t}if(i===x&&t._state!==D)this._settledAt(t._state,e,t._result);else if("function"!=typeof i)this._remaining--,this._result[e]=t;else if(n===F){var a=new n(E);s?O(a,r):S(a,t,i),this._willSettleAt(a,e)}else this._willSettleAt(new n((function(e){return e(t)})),e)}else this._willSettleAt(o(t),e)},t.prototype._settledAt=function(t,e,n){var o=this.promise;o._state===D&&(this._remaining--,2===t?O(o,n):this._result[e]=n),0===this._remaining&&I(o,this._result)},t.prototype._willSettleAt=function(t,e){var n=this;A(t,void 0,(function(t){return n._settledAt(1,e,t)}),(function(t){return n._settledAt(2,e,t)}))},t}(),F=function(){function e(t){this[T]=_++,this._result=this._state=void 0,this._subscribers=[],E!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof e?function(t,e){try{e((function(e){k(t,e)}),(function(e){O(t,e)}))}catch(e){O(t,e)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(t){return this.then(null,t)},e.prototype.finally=function(e){var n=this,o=n.constructor;return t(e)?n.then((function(t){return o.resolve(e()).then((function(){return t}))}),(function(t){return o.resolve(e()).then((function(){throw t}))})):n.then(e,e)},e}();return F.prototype.then=x,F.all=function(t){return new R(this,t).promise},F.race=function(t){var e=this;return o(t)?new e((function(n,o){for(var i=t.length,r=0;r<i;r++)e.resolve(t[r]).then(n,o)})):new e((function(t,e){return e(new TypeError("You must pass an array to race."))}))},F.resolve=w,F.reject=function(t){var e=new this(E);return O(e,t),e},F._setScheduler=function(t){s=t},F._setAsap=function(t){a=t},F._asap=a,F.polyfill=function(){var t=void 0;if(void 0!==n)t=n;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var o=null;try{o=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===o&&!e.cast)return}t.Promise=F},F.Promise=F,F},t.exports=o()}).call(this,n(54),n(55))},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return d}));var o,i=n(0),r=n(2),s=n(1),a=n(9),l=n(3),u=n(32),c=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=function(e){function n(){var t=e.call(this)||this;t.exportButtons=[],t.disabledClass="eqjs-disabled",t.dropdownContainerClass="eqv-dropdown-container",t.dropdownButtonClass="eqv-drop-button",t.dropdownContentClass="eqv-dropdown-content",t.dropdownShowClass="eqv-dropdown-show",t._querySaveTemplate='<div id="kdlg-dialog-form" class="kfrm-form">\n <div class="kfrm-fields label-above">\n <label for="kdlg-dialog-form-input" id="kdlg-dialog-form-content"></label>\n <input type="text" name="kdlg-dialog-form-input" id="kdlg-dialog-form-input" />\n </div>\n </div>',t.queryListMenu=null,t.fetchDataButtonClickHandler=t.fetchDataButtonClick.bind(t),t.clearQueryButtonClickHandler=t.clearQueryButtonClick.bind(t),t.newQueryButtonClickHandler=t.newQueryButtonClick.bind(t),t.loadQueryButtonClickHandler=t.loadQueryButtonClick.bind(t),t.saveQueryButtonClickHandler=t.saveQueryButtonClick.bind(t),t.copyQueryButtonClickHandler=t.copyQueryButtonClick.bind(t),t.removeQueryButtonClickHandler=t.removeQueryButtonClick.bind(t),t.storageButtonClickHandler=t.storageDropButtonClick.bind(t),t.saveQueryToFileButtonClickHandler=t.saveQueryToFileButtonClick.bind(t),t.loadQueryFromFileButtonClickHandler=t.loadQueryFromFileButtonClick.bind(t);var n=t;return t.exportButtonClickHandler=function(t){if(!this.classList.contains(n.disabledClass)){var e=this.getAttribute("data-format");n.getContext().exportResult({format:e})}},t.queryChangedHandler=function(e){var n=e.data;t.resultOptions.clearResultOnQueryChange&&(t.context.clearResult(),t.context.refreshWidgets(r.WidgetGroup.Result)),t.disableExportButtons(),t.resultCountSlot&&(t.resultCountSlot.style.display="none"),t.viewOptions.syncQueryOnChange&&t.syncQuery(),t.viewOptions.fetchDataOnChange&&(!n||n.part!=r.QueryChangePart.ExtraData&&n.part!=r.QueryChangePart.Facets)&&t.fetchData()},t.outsideClickHandler=function(e){var n=null;e.target.matches("."+t.dropdownButtonClass)?n=e.target.parentElement.querySelector("."+t.dropdownContentClass):e.target.matches("."+t.dropdownButtonClass+" > span")&&(n=e.target.parentElement.parentElement.querySelector("."+t.dropdownContentClass));for(var o=t.resolveElementsByClassName(t.dropdownContentClass),i=0;i<o.length;i++){var r=o[i];n!=r&&r.classList.contains(t.dropdownShowClass)&&r.classList.remove(t.dropdownShowClass)}},t}return c(n,e),n.prototype.refreshQueryList=function(){var t=this;this.queryListPanel&&(this.queryListPanel.innerHTML="",this.context.loadQueryList({success:function(e){var n=Object(s.domel)("ul",t.queryListPanel).addClass("list-group list-group-flush");e.map((function(e){n.addChild("li",(function(n){n.addClass("list-group-item").setStyle("cursor","pointer").data("id",e.id).text(e.name).on("click",(function(){t.checkIfQueryModified((function(){return t.loadQuery(e.id)}))}))}))}))}}))},n.prototype.initOptions=function(t){return void 0===(t=e.prototype.initOptions.call(this,t)).syncQueryOnChange&&(t.syncQueryOnChange=!0),t},n.prototype.initWidgets=function(t){var n=this;e.prototype.initWidgets.call(this,t);var o="eqjs-export",i="QueryContentJson",r="ClearQueryButton",s="NewQueryButton",a="LoadQueryButton",l="SaveQueryButton",u="CopyQueryButton",c="RemoveQueryButton",d="StorageDropButton",h="FetchDataButton",p="LoadQueryFromFileButton",f="SaveQueryToFileButton",g="QueryListPanel";t.slots&&(i=t.slots.queryContentInput||i,h=t.slots.fetchDataButton||h,r=t.slots.clearQueryButton||r,s=t.slots.newQueryButton||s,a=t.slots.loadQueryButton||a,l=t.slots.saveQueryButton||l,u=t.slots.copyQueryButton||u,c=t.slots.removeQueryButton||c,d=t.slots.storageButton||d,o=t.slots.exportClass||o,p=t.slots.loadQueryFromFileButton||p,f=t.slots.saveQueryToFileButton||f,g=t.slots.queryListPanel||g),this.exportButtons=this.domRoots.reduce((function(t,e){return t.concat(Array.from(e.querySelectorAll("."+o)))}),[]),t.enableExport||this.hideExportButtons(),this.disableExportButtons();this.exportButtons.forEach((function(t){t.addEventListener("click",n.exportButtonClickHandler)})),this.fetchDataButton||(this.fetchDataButton=this.resolveElement(h),this.fetchDataButton||(this.fetchDataButton=this.resolveElement("ExecuteQueryButton")),this.fetchDataButton&&this.fetchDataButton.addEventListener("click",this.fetchDataButtonClickHandler)),this.clearQueryButton||(this.clearQueryButton=this.resolveElement(r),this.clearQueryButton&&this.clearQueryButton.addEventListener("click",this.clearQueryButtonClickHandler)),this.newQueryButton||(this.newQueryButton=this.resolveElement(s),this.newQueryButton&&this.newQueryButton.addEventListener("click",this.newQueryButtonClickHandler)),this.loadQueryButton||(this.loadQueryButton=this.resolveElement(a),this.loadQueryButton&&this.loadQueryButton.addEventListener("click",this.loadQueryButtonClickHandler)),this.saveQueryButton||(this.saveQueryButton=this.resolveElement(l),this.saveQueryButton&&this.saveQueryButton.addEventListener("click",this.saveQueryButtonClickHandler)),this.copyQueryButton||(this.copyQueryButton=this.resolveElement(u),this.copyQueryButton&&this.copyQueryButton.addEventListener("click",this.copyQueryButtonClickHandler)),this.removeQueryButton||(this.removeQueryButton=this.resolveElement(c),this.removeQueryButton&&this.removeQueryButton.addEventListener("click",this.removeQueryButtonClickHandler)),this.storageDropButton||(this.storageDropButton=this.resolveElement(d),this.storageDropButton&&this.storageDropButton.addEventListener("click",this.storageButtonClickHandler)),this.saveQueryToFileButton||(this.saveQueryToFileButton=this.resolveElement(f),this.saveQueryToFileButton&&this.saveQueryToFileButton.addEventListener("click",this.saveQueryToFileButtonClickHandler)),this.queryListPanel||(this.queryListPanel=this.resolveElement(g),this.queryListPanel||(this.queryListPanel=this.resolveElement("QueryListSlot")),this.queryListPanel&&this.context.addEventListener("ready",(function(){n.refreshQueryList()}))),this.loadQueryFromFileButton||(this.loadQueryFromFileButton=this.resolveElement(p),this.loadQueryFromFileButton&&(this.loadQueryFromFileInput=document.createElement("input"),this.loadQueryFromFileInput.type="file",this.loadQueryFromFileInput.accept=t.queryFileExtensions,this.loadQueryFromFileInput.style.display="none",document.body.appendChild(this.loadQueryFromFileInput),this.loadQueryFromFileInput.addEventListener("change",this.loadQueryFromFileInputSelect.bind(this)),this.loadQueryFromFileButton.addEventListener("click",this.loadQueryFromFileButtonClickHandler))),window.addEventListener("click",this.outsideClickHandler)},n.prototype.initDone=function(){e.prototype.initDone.call(this),this.context.getQuery().addChangedCallback(this.queryChangedHandler)},n.prototype.syncQuery=function(){var t=this;this.context.syncQuery({success:function(e){e.statement&&t.context.refreshWidgets(r.WidgetGroup.Statement)}})},n.prototype.disableExportButtons=function(){var t=this;this.exportButtons.forEach((function(e){e.disabled=!0,e.classList.contains(t.disabledClass)||e.classList.add(t.disabledClass)}))},n.prototype.enableExportButtons=function(){var t=this;this.exportButtons.forEach((function(e){e.disabled=!1,e.classList.contains(t.disabledClass)&&e.classList.remove(t.disabledClass)}))},n.prototype.hideExportButtons=function(){this.exportButtons.forEach((function(t){t.style.display="none"}))},n.prototype.clearQueryButtonClick=function(){this.context.clearQuery(),this.context.refreshWidgets(r.WidgetGroup.Statement)},n.prototype.createNewQuery=function(t){return this.context.newQuery(t)},n.prototype.loadQuery=function(t){t&&this.context.loadQuery({queryId:t,silent:!1})},n.prototype.saveQuery=function(t,e){var n=this;this.context.saveQuery({success:function(){t&&t(),n.context.getQuery().fireChangedEvent({part:r.QueryChangePart.Properties,wasModified:!1}),n.refreshQueryList()},error:e})},n.prototype.saveCurrentQuery=function(e,n){var o=this;void 0===e&&(e=!1);var i=this.context.getQuery();i.isNewbie||e?this.showSaveQueryDialog((function(e){return new t((function(t){e&&(i.regenerateId(),i.setName(e),i.fireChangedEvent({part:r.QueryChangePart.Properties,wasModified:!0}),o.saveQuery((function(){t({success:!0})}),(function(e){return t({success:!1,message:e})})))}))})):this.saveQuery(n)},n.prototype.checkIfQueryModified=function(t){var e=this;this.context.getQuery().isModified()&&!this.viewOptions.disableConfirmationOnQueryChange?this.showQueryChangedDialog((function(n){n?e.saveCurrentQuery(!1,t):t()})):t()},n.prototype.removeCurrentQuery=function(){var t=this;this.context.removeQuery({success:function(){t.createNewQuery({useStorage:!1}),t.resultCountSlot&&(t.resultCountSlot.style.display="none"),t.context.clearResult(),t.refreshQueryList()}})},n.prototype.showNewQueryDialog=function(t){var e=this.context.getServices().getDialogService(),n=i.i18n.getText("NewQueryDefName"),o=e.open({title:i.i18n.getText("NewQueryTitle"),body:this._querySaveTemplate,submitable:!0,closable:!0,cancelable:!0,submitOnEnter:!0,arrangeParents:!1,beforeOpen:function(){var t=document.getElementById("kdlg-dialog-form-input");n&&(t.value=n),document.getElementById("kdlg-dialog-form-content").innerHTML=i.i18n.getText("NewQueryContent"),t.focus()},onSubmit:function(){var e=document.getElementById("kdlg-dialog-form-input").value;if(e&&e.replace(/\s/g,"").length>0){if(!t)return!0;o.disableButtons();var n=o.getRootElement().querySelector("header"),i=Object(s.domel)("div",n).addClass("eqjs-process-bar local").toDOM();t(e).then((function(t){n.removeChild(i),o.enableButtons(),t.success?o.close():o.showAlert(t.message,"error")}))}return!1}})},n.prototype.showQueryChangedDialog=function(t){this.context.getServices().getDialogService().openConfirm(i.i18n.getText("QueryChangedTitle"),i.i18n.getText("QueryChangedContent"),t)},n.prototype.showSaveQueryDialog=function(t){var e=this.context.getServices().getDialogService(),n=this.context.getQuery(),o=n.isNewbie?n.getName():i.i18n.getText("SaveQueryDefName").replace("{queryName}",n.getName()),r=e.open({title:i.i18n.getText("SaveQueryTitle"),body:this._querySaveTemplate,submitable:!0,closable:!0,cancelable:!0,submitOnEnter:!0,arrangeParents:!1,beforeOpen:function(){var t=document.getElementById("kdlg-dialog-form-input");t.value=o,document.getElementById("kdlg-dialog-form-content").innerHTML=i.i18n.getText("SaveQueryContent"),t.focus()},onSubmit:function(){var e=document.getElementById("kdlg-dialog-form-input").value;if(e&&e.replace(/\s/g,"").length>0){if(!t)return!0;r.disableButtons();var n=r.getRootElement().querySelector("header"),o=Object(s.domel)("div",n).addClass("eqjs-process-bar local").toDOM();t(e).then((function(t){r.enableButtons(),n.removeChild(o),t.success?r.close():r.showAlert(t.message,"error")}))}return!1}})},n.prototype.showRemoveQueryDialog=function(t){var e=this.context.getServices().getDialogService(),n=this.context.getQuery();e.openConfirm(i.i18n.getText("RemoveQueryTitle"),i.i18n.getText("RemoveQueryContent").replace("{queryName}",n.getName()),t)},n.prototype.showSaveQueryToFileDialog=function(t){var e=this.getContext().getServices().getDialogService(),n=this.context.getQuery(),o=this.renderSaveToFileDialogBody(n.getName()),r=e.open({title:i.i18n.getText("SaveQueryToFileDlgTitle"),body:o,onSubmit:function(){var e=o.querySelector("#kdlgFileNameInput"),n=e?e.value:"Query",i=o.querySelector("#kdlgFileFormatSelector"),a=i?i.value:"json";if(t){r.disableButtons();var l=r.getRootElement().querySelector("header"),u=Object(s.domel)("div",l).addClass("eqjs-process-bar local").toDOM();return t(n,a).then((function(t){r.enableButtons(),l.removeChild(u),t.success?r.close():r.showAlert(t.message,"error")})),!1}return!0}})},n.prototype.renderSaveToFileDialogBody=function(t,e){void 0===e&&(e="json");var n=l.a.isIE(),o=n?"kfrm-fields-ie col-ie-1-4 label-align-right":"kfrm-fields col-a-1 label-align-right",r=n?"kfrm-fields-ie is-horizontal":"kfrm-fields is-horizontal";return Object(s.domel)("div").addClass("kfrm-form").addChild("div",(function(n){n.addClass(o).addChild("label",(function(t){return t.attr("for","file_name").addText(i.i18n.getText("FileNameLabel"))})).addChild("div",(function(n){return n.addClass(r).addChild("input",(function(e){return e.id("kdlgFileNameInput").name("file_name").type("text").attr("value",t)})).addChild("label",(function(t){return t.addText(".")})).addChild("div",(function(t){return t.addClass("kfrm-select").addChild("select",(function(t){return t.id("kdlgFileFormatSelector").addClass("kdlg-form-control").addOption({value:"xml",selected:"xml"===e}).addOption({value:"json",selected:"json"===e})}))}))}))})).toDOM()},n.prototype.newQueryButtonClick=function(){var t=this;this.checkIfQueryModified((function(){t.createNewQuery()}))},n.prototype.saveQueryToFileButtonClick=function(){var e=this;this.showSaveQueryToFileDialog((function(n,o){return new t((function(t){e.context.getQueryFile({fileName:n,format:o,success:function(){return t({success:!0})},error:function(e){return t({success:!1,message:e})}})}))}))},n.prototype.loadQueryFromFileButtonClick=function(){var t=this;this.checkIfQueryModified((function(){t.showLoadQueryFromFileDialog()}))},n.prototype.showLoadQueryFromFileDialog=function(){this.loadQueryFromFileInput.click()},n.prototype.loadQueryFromFileInputSelect=function(){var t=this,e=this.loadQueryFromFileInput.files.item(0),n=new FormData;n.append(e.name,e),this.loadQueryFromFileInput.value="",this.context.uploadQueryFile({data:n,success:function(){t.syncQuery(),t.refreshQueryList()}})},n.prototype.loadQueryButtonClick=function(){var t=this;this.context.loadQueryList({success:function(e){t.fillLoadQueryButtonMenu(e),t.queryListMenu.showMenu({anchor:t.loadQueryButton,adjustHeight:!1,itemSelectedCallback:function(e){t.checkIfQueryModified((function(){return t.loadQuery(e.id)}))}})}})},n.prototype.fillLoadQueryButtonMenu=function(t){var e=this.getContext().getQuery();this.queryListMenu=new a.a({items:t.map((function(t){return{id:t.id,text:t.name}})),selectedIds:e.getId()})},n.prototype.saveQueryButtonClick=function(){this.saveCurrentQuery()},n.prototype.copyQueryButtonClick=function(){this.saveCurrentQuery(!0)},n.prototype.removeQueryButtonClick=function(){var t=this;this.showRemoveQueryDialog((function(e){e&&t.removeCurrentQuery()}))},n.prototype.storageDropButtonClick=function(){var t=this,e=this.storageDropButton.parentElement.querySelector("."+this.dropdownContentClass);e&&window.setTimeout((function(){return e.classList.toggle(t.dropdownShowClass)}),100)},n.prototype.fetchDataButtonClick=function(){this.fetchData()},n.prototype.detach=function(){var t=this;this.enableExportButtons(),this.exportButtons.forEach((function(e){e.removeEventListener("click",t.exportButtonClickHandler)})),this.exportButtons=[],this.fetchDataButton&&(this.fetchDataButton.removeEventListener("click",this.fetchDataButtonClickHandler),this.fetchDataButton=null),this.clearQueryButton&&(this.clearQueryButton.removeEventListener("click",this.clearQueryButtonClickHandler),this.clearQueryButton=null),this.newQueryButton&&(this.newQueryButton.removeEventListener("click",this.newQueryButtonClickHandler),this.newQueryButton=null),this.loadQueryButton&&(this.loadQueryButton.removeEventListener("click",this.loadQueryButtonClickHandler),this.loadQueryButton=null),this.saveQueryButton&&(this.saveQueryButton.removeEventListener("click",this.saveQueryButtonClickHandler),this.saveQueryButton=null),this.copyQueryButton&&(this.copyQueryButton.removeEventListener("click",this.copyQueryButtonClickHandler),this.copyQueryButton=null),this.removeQueryButton&&(this.removeQueryButton.removeEventListener("click",this.removeQueryButtonClickHandler),this.removeQueryButton=null),this.storageDropButton&&(this.storageDropButton.removeEventListener("click",this.storageButtonClickHandler),this.storageDropButton=null),this.saveQueryToFileButton&&(this.saveQueryToFileButton.removeEventListener("click",this.saveQueryToFileButtonClickHandler),this.saveQueryToFileButton=null),this.queryListPanel&&(this.queryListPanel=null),this.loadQueryFromFileButton&&(this.loadQueryFromFileInput&&document.body.removeChild(this.loadQueryFromFileInput),this.loadQueryFromFileButton.removeEventListener("click",this.loadQueryFromFileButtonClickHandler),this.loadQueryFromFileButton=null),e.prototype.detach.call(this)},n}(u.a)}).call(this,n(56))},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return s}));var o=n(0),i=n(2),r=function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},r.apply(this,arguments)},s=function(){function e(t){this.context=t,this._needRecalculation=!0,this.aggrContainer=new i.EqAggregatesContainer(t)}return e.prototype.getAggrContainer=function(){return this.aggrContainer},e.prototype.calculate=function(e){this._needRecalculation=!1,this.aggrContainer.clear(),(e=e||{}).maxLevel=e.maxLevel>=0?e.maxLevel:0;var n=[],o=this.context.createQuery();o.loadFromData(this.context.getQuery().toJSONData());for(var r=this.context.getQuery().getAggregationSettings(),s=r.getAggregates(),a=r.getAggregates().map((function(t){return t.colId})),l=o.getColumns().filter((function(t){return a.indexOf(t.id)>=0})),u=function(t){o.changeColumnType(t,i.ExprTag.AggregateFunction,{funcId:s.filter((function(e){return e.colId==t.id}))[0].funcId})},c=0,d=l;c<d.length;c++){u(x=d[c])}for(var h=o.getColumns().filter((function(t){return t.expr.tag!==i.ExprTag.AggregateFunction})),p=0,f=h;p<f.length;p++){(x=f[p]).setHidden(!0)}if(r.hasRecordCount()){(x=o.createColumn()).caption=r.COUNT_FIELD_NAME,x._id=r.COUNT_FIELD_NAME;var g=new i.Expression(x);g.tag=i.ExprTag.CustomSql,g.sql="COUNT(*)",g.baseAttrId=null,x.expr=g,o.getColumns().push(x)}r.hasGrandTotals()&&n.push(this.processLevel({query:o,level:0,groupName:"Grand Totals",resultObtainedCallback:e.resultObtained,errorOccurredCallback:e.errorOccurred}));for(var y=r.getGroups(),m=1;m<=y.length;m++){for(var v=y[m-1],b=0,C=h;b<C.length;b++){var x;(x=C[b]).setHidden(v.columns.indexOf(x.id)<0)}n.push(this.processLevel({query:o,level:m,groupName:v.name,resultObtainedCallback:e.resultObtained,errorOccurredCallback:e.errorOccurred}))}return t.all(n).then((function(){})).catch((function(t){return console.error(t)}))},e.prototype.processLevel=function(t){var e=this,n=this.context.getServices().getDataFetcher(),i={aux:!0,query:t.query};return this.context.debugMode&&(i.debug="Fetching group data. Group: '"+t.groupName+"', level: "+t.level),n.fetchData(i).then((function(n){for(var i=new o.EasyDataTable({elasticChunks:!0}),r=n.resultSet,s=0,a=r.cols;s<a.length;s++){var l=a[s];i.columns.add(l)}for(var u=0,c=r.rows;u<c.length;u++){var d=c[u];i.addRow(d)}var h=e.buildLevelData(t.level,i);e.aggrContainer.setAggregateData(t.level,h),t.resultObtainedCallback&&t.resultObtainedCallback(n,t.level)})).catch((function(e){t.errorOccurredCallback&&t.errorOccurredCallback(r(r({},e),{level:t.level}))}))},e.prototype.buildLevelData=function(t,e){var n=this.context.getQuery().getAggregationSettings(),o=t>0?n.getGroups()[t-1].columns:[],i=n.getAggregates().map((function(t){return t.colId}));n.hasRecordCount()&&i.push(n.COUNT_FIELD_NAME);for(var r=new Map,s=0,a=e.getCachedRows();s<a.length;s++){for(var l=a[s],u={},c={},d=0,h=o;d<h.length;d++){var p=h[d];if(e.columns.getIndex(p)>=0){var f=l.getValue(p);n.caseSensitiveGroups||"string"!=typeof f||(f=f.toLowerCase()),u[p]=f}}for(var g=0,y=i;g<y.length;g++){var m=y[g];c[m]=l.getValue(m)}r.set(JSON.stringify(u),c)}return r},e.prototype.needRecalculation=function(){return this._needRecalculation},e.prototype.reset=function(){this._needRecalculation=!0},e}()}).call(this,n(100))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var o=function(){function t(t,e){this.request=t,this.promise=e}return t.prototype.getPromise=function(){return this.promise},t.prototype.getRequest=function(){return this.request},t.prototype.then=function(t,e){return this.promise.then(t,e)},t.prototype.catch=function(t){return this.promise.catch(t)},t.prototype.finally=function(t){return this.promise.finally(t)},t}()},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return i}));var o=n(2),i=function(){function e(t){this.context=t,this.levelsTotals=[],this.prevRow=null,this.aggrContainer=new o.EqAggregatesContainer(t)}return e.prototype.getAggrContainer=function(){return this.aggrContainer},e.prototype.initObjects=function(){var t=this;this.aggrSettings=this.context.getQuery().getAggregationSettings(),this.groups=this.aggrSettings.getGroups(),this.aggregates=this.aggrSettings.getAggregates(),this.aggrColIds=this.aggrSettings.getAggregates().map((function(t){return t.colId})),this.aggrCols=this.context.resultTable.columns.getItems().filter((function(e){return t.aggrColIds.indexOf(e.id)>=0})),this.levelsTotals=[],this.prevRow=null},e.prototype.createColumnAggregatesObject=function(){return{sum:0,min:Number.MAX_VALUE,max:Number.MIN_VALUE}},e.prototype.calculate=function(e){this.initObjects(),this.aggrContainer.clear(),(e=e||{}).maxLevel=e.maxLevel>=0?e.maxLevel:0;for(var n=this.groups.length+1,o=0;o<n;o++){var i={count:0,columns:{}};this.resetLevelTotals(i),this.levelsTotals.push(i)}var r=this.context.resultTable.getCachedRows();if(r.length>0){for(var s=0,a=r;s<a.length;s++){var l=a[s];this.processDataRow(l)}for(o=1;o<n;o++)this.flushLevelTotals(o);this.aggrSettings.hasGrandTotals()&&this.flushLevelTotals(0)}return t.resolve()},e.prototype.resetLevelTotals=function(t){for(var e=0,n=this.aggrCols;e<n.length;e++){var o=n[e];t.columns[o.id]=this.createColumnAggregatesObject()}t.count=0},e.prototype.processDataRow=function(t){var e=this.checkLevelChange(t);if(e>=0)for(var n=e;n<this.levelsTotals.length;n++)this.flushLevelTotals(n);this.aggrSettings.hasGrandTotals()&&this.updateLevelTotals(0,t);for(var o=1,i=0,r=this.groups;i<r.length;i++){r[i];this.updateLevelTotals(o,t),o++}this.prevRow=t},e.prototype.checkLevelChange=function(t){if(null==this.prevRow)return-1;for(var e=0;e<this.groups.length;e++)for(var n=0,o=this.groups[e].columns;n<o.length;n++){var i=o[n],r=t.getValue(i),s=this.prevRow.getValue(i);if(!this.aggrSettings.compareValues(s,r))return e+1}return-1},e.prototype.flushLevelTotals=function(t){for(var e=this.levelsTotals[t],n=t>0?this.groups[t-1]:null,o=this.aggrSettings.buildGroupKey(n,this.prevRow),i={},r=0,s=this.aggregates;r<s.length;r++){var a=s[r],l=e.columns[a.colId];switch(a.funcId){case"SUM":i[a.colId]=l.sum;break;case"AVG":i[a.colId]=l.sum/e.count;break;case"COUNT":case"CNTDST":i[a.colId]=e.count;break;case"MIN":i[a.colId]=l.min;break;case"MAX":i[a.colId]=l.max}}this.aggrSettings.hasRecordCount()&&(i[this.aggrSettings.COUNT_FIELD_NAME]=e.count),this.aggrContainer.updateAggregateData(t,o,i),this.resetLevelTotals(e)},e.prototype.updateLevelTotals=function(t,e){var n=this.levelsTotals[t];n.count+=1;for(var o=0,i=this.aggregates;o<i.length;o++){var r=i[o],s=e.getValue(r.colId),a=n.columns[r.colId];a.sum+=s,s<a.min&&(a.min=s),s>a.max&&(a.max=s)}},e.prototype.needRecalculation=function(){return!0},e.prototype.reset=function(){},e}()}).call(this,n(100))},function(t,e,n){t.exports=n(115)},function(t,e){var n,o,i=t.exports={};function r(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===r||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:r}catch(t){n=r}try{o="function"==typeof clearTimeout?clearTimeout:s}catch(t){o=s}}();var l,u=[],c=!1,d=-1;function h(){c&&l&&(c=!1,l.length?u=l.concat(u):d=-1,u.length&&p())}function p(){if(!c){var t=a(h);c=!0;for(var e=u.length;e;){for(l=u,u=[];++d<e;)l&&l[d].run();d=-1,e=u.length}l=null,c=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===s||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(t)}}function f(t,e){this.fun=t,this.array=e}function g(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];u.push(new f(t,e)),1!==u.length||c||a(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";n.r(e),n.d(e,"core",(function(){return s})),n.d(e,"ui",(function(){return o})),n.d(e,"enterprise",(function(){return i}));var o={};n.r(o),n.d(o,"EntitiesPanel",(function(){return a.a})),n.d(o,"ColumnsPanel",(function(){return l.a})),n.d(o,"ColumnsBar",(function(){return u.a})),n.d(o,"SortingBar",(function(){return c.a})),n.d(o,"QueryPanel",(function(){return d.a})),n.d(o,"FilterBar",(function(){return h.a})),n.d(o,"HtmlContentWidget",(function(){return f})),n.d(o,"EqHtmlGrid",(function(){return m})),n.d(o,"Grid",(function(){return v.a})),n.d(o,"EasyGridWidget",(function(){return b.a})),n.d(o,"StatementPanel",(function(){return C.a})),n.d(o,"ProcessWidget",(function(){return x.a})),n.d(o,"ManageDrillDownWidget",(function(){return D})),n.d(o,"ResultFacetsPanel",(function(){return S.a})),n.d(o,"ExportWidget",(function(){return k.a})),n.d(o,"AggregationBar",(function(){return M.a})),n.d(o,"ChartType",(function(){return I.a})),n.d(o,"ChartWidget",(function(){return O.a})),n.d(o,"GoogleChartWidget",(function(){return A.a})),n.d(o,"ChartJsWidget",(function(){return P.a})),n.d(o,"BaseElementRenderer",(function(){return B.a})),n.d(o,"DropDownRenderer",(function(){return _.a})),n.d(o,"AggrSettingsRenderer",(function(){return L.a})),n.d(o,"AggrFuncColumnRendererCB",(function(){return R.a})),n.d(o,"SimpleColumnRendererCB",(function(){return F.a})),n.d(o,"ColumnRendererCB",(function(){return Q.a})),n.d(o,"AggrFuncColumnRendererCP",(function(){return j.a})),n.d(o,"SimpleColumnRendererCP",(function(){return q.a})),n.d(o,"ColumnAction",(function(){return N.a})),n.d(o,"ColumnRendererCP",(function(){return N.b})),n.d(o,"CustomSqlColumnRendererCP",(function(){return H.a})),n.d(o,"InputExpressionRenderer",(function(){return W.a})),n.d(o,"DateTimeExpressionRenderer",(function(){return G.a})),n.d(o,"ConditionAction",(function(){return V.a})),n.d(o,"ConditionRenderer",(function(){return V.b})),n.d(o,"SimpleConditionRenderer",(function(){return V.c})),n.d(o,"ConditionGroupRenderer",(function(){return z.a})),n.d(o,"ConditionGroupRowRenderer",(function(){return z.b})),n.d(o,"AttributeExpressionRenderer",(function(){return U.a})),n.d(o,"ExpressionRenderer",(function(){return J.a})),n.d(o,"OperatorRenderer",(function(){return Y.a})),n.d(o,"SubQueryExpressionRenderer",(function(){return K.a})),n.d(o,"ListExpressionRenderer",(function(){return X.b})),n.d(o,"CustomListExpressionRenderer",(function(){return X.a})),n.d(o,"SqlListExpressionRenderer",(function(){return X.c})),n.d(o,"TextRenderer",(function(){return $.a})),n.d(o,"AddRowRenderer",(function(){return Z.a})),n.d(o,"ResultFacet",(function(){return tt.a})),n.d(o,"DataTableFacet",(function(){return et.a})),n.d(o,"ChartFacet",(function(){return nt.a})),n.d(o,"PivotTableFacet",(function(){return ot.a})),n.d(o,"View",(function(){return it.a})),n.d(o,"AdvancedSearchView",(function(){return rt.a})),n.d(o,"DataFilterView",(function(){return at})),n.d(o,"HtmlDataFilterView",(function(){return ut})),n.d(o,"ReportView",(function(){return ht})),n.d(o,"DomDropDownElementBuilder",(function(){return pt.a})),n.d(o,"dropdown",(function(){return pt.b})),n.d(o,"PopupMenu",(function(){return ft.a})),n.d(o,"browserUtils",(function(){return ct.a})),n.d(o,"QPEditablePart",(function(){return gt.a})),n.d(o,"FacetType",(function(){return yt.a})),n.d(o,"ExportDialog",(function(){return mt.a})),n.d(o,"AggrSettingsDialog",(function(){return vt.a}));var i={};n.r(i),n.d(i,"EqServerAggregatesCalculator",(function(){return jt.a})),n.d(i,"QueryEx",(function(){return It})),n.d(i,"QueryColumnEx",(function(){return kt})),n.d(i,"ConditionEx",(function(){return Dt})),n.d(i,"DataModelEx",(function(){return Pt})),n.d(i,"EqServerQueryStorage",(function(){return Ot.a}));var r,s=n(2),a=n(67),l=n(72),u=n(40),c=n(98),d=n(25),h=n(85),p=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),f=function(t){function e(e){var n=t.call(this,e)||this;return n.contentElement=e,n.group=s.WidgetGroup.Result,n}return p(e,t),e.prototype.getWidgetType=function(){return"htmlContent"},e.prototype.init=function(e,n){t.prototype.init.call(this,e,n)},e.prototype.refreshCore=function(){this.clear(),this.context.resultContent&&this.render()},e.prototype.render=function(){this.context.resultContent&&(this.contentElement.innerHTML+=this.context.resultContent)},e.prototype.clear=function(){this.contentElement.innerHTML=""},e.prototype.destroyCore=function(){this.clear()},e}(s.Widget),g=n(0),y=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),m=function(t){function e(e){var n=t.call(this,e)||this;return n.options={maxButtonCount:10,useBootstrap:!1},n}return y(e,t),e.prototype.getWidgetType=function(){return"eqHtmlGrid"},e.prototype.init=function(e,n){t.prototype.init.call(this,e,n),this.setOptions(n)},e.prototype.setOptions=function(t){g.utils.assignDeep(this.options,t)},e.prototype.refreshCore=function(){t.prototype.refreshCore.call(this),this.renderPageNavigator()},e.prototype.destroyCore=function(){this.slot.innerHTML=""},e.prototype.renderPageNavigator=function(){var t=this,e=document.getElementById("PageNavigator");if(e){var n=parseInt(e.getAttribute("data-pagecount")),o=parseInt(e.getAttribute("data-pageindex"));if(n>1){var i=function(e){var n=e.target;if(n.hasAttribute("data-page")){var o=parseInt(n.getAttribute("data-page"));t.context.fetchDataChunk({chunk:{page:o},success:function(){t.context.refreshWidgets(s.WidgetGroup.Result)}})}},r=this.options.maxButtonCount||10,a=o-1,l=a-a%r+1,u=l+r-1;u>n&&(u=n);var c=document.createElement("ul");this.options.useBootstrap?c.className="pagination":c.className="eqv-pagination",this.options.pageItemCssClass&&(c.className+=" "+this.options.pageItemCssClass);var d=document.createElement("li");this.options.useBootstrap&&(d.className="page-item");var h=document.createElement("span");if(h.setAttribute("aria-hidden","true"),this.options.useBootstrap&&(h.className="page-link"),1==l)d.className+=" disabled";else{if(this.options.useBootstrap)(h=document.createElement("a")).setAttribute("href","javascript:void(0)"),h.setAttribute("data-page",""+(l-1)),h.className="page-link";else(f=document.createElement("a")).setAttribute("href","javascript:void(0)"),f.setAttribute("data-page",""+(l-1)),h=f;h.addEventListener("click",i)}h.innerHTML="&laquo;",d.appendChild(h),c.appendChild(d);for(var p=l;p<=u;p++)d=document.createElement("li"),this.options.useBootstrap&&(d.className="page-item"),p==o&&(d.className+=" active"),(h=document.createElement("a")).setAttribute("href","javascript:void(0)"),h.innerHTML=p.toString(),h.setAttribute("data-page",p.toString()),h.className="page-link",h.addEventListener("click",i),d.appendChild(h),c.appendChild(d);if(d=document.createElement("li"),this.options.useBootstrap&&(d.className="page-item"),(h=document.createElement("span")).setAttribute("aria-hidden","true"),this.options.useBootstrap&&(h.className="page-link"),u==n)d.className+="disabled";else{var f;if(this.options.useBootstrap)(h=document.createElement("a")).setAttribute("href","javascript:void(0)"),h.setAttribute("data-page",""+(u+1)),h.className+=" page-link";else(f=document.createElement("a")).setAttribute("href","javascript:void(0)"),f.setAttribute("data-page",""+(u+1)),h=f;h.addEventListener("click",i)}h.innerHTML="&raquo;",d.appendChild(h),c.appendChild(d),e.appendChild(c)}}},e}(f),v=n(86),b=n(44),C=n(87),x=n(88),w=n(1),T=n(4),E=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),D=function(t){function e(e){var n=t.call(this,e)||this;return n.clickHandler=function(){return n.openDialog()},n.columnsBar=null,n.queryPanel=null,n.ddQuery=null,n.cssPrefix=T.b,n.group=s.WidgetGroup.None,n}return E(e,t),e.prototype.getWidgetType=function(){return"manageDrillDown"},e.prototype.init=function(e,n){t.prototype.init.call(this,e,n),this.options=n,this.refresh(),this.slot.addEventListener("click",this.clickHandler)},e.prototype.destroyCore=function(){this.slot.removeEventListener("click",this.clickHandler)},e.prototype.openDialog=function(){var t=this,e=this.context.getServices().getDialogService(),n=this.context.getQuery(),o=this.context.getModel(),i=Object(w.domel)("div").addClass(this.cssPrefix+"-manage-drilldown").addChildElement(this.renderColumnsBarBlock()).addChildElement(this.renderQueryPanelBlock()).toDOM(),r=o.addOrUpdateOperator({id:"BindToParentColumn",caption:"is bound to",format:"{expr1} [[is bound to]] {expr2}",paramCount:2,kind:s.DataKind.ParentColumn,appliedTypes:[g.DataType.String,g.DataType.Bool,g.DataType.Float,g.DataType.Int32,g.DataType.Int64,g.DataType.Word]});r.defaultOperand.dataType=g.DataType.String,r.defaultOperand.kind=s.DataKind.ParentColumn,o.runThroughEntities((function(t){var e=t.operators.indexOf(r.id);e>0&&g.utils.moveArrayItem(t.operators,e,0)}),null),this.ddQuery=new s.Query(o,null,{parent:n});var a=this.context.getQuery().getDrillDowns();if(a.length){var l=a[0];this.ddQuery.loadFromData(l.toJSONData())}e.open({title:"Manage Drill Down",body:i,cancelable:!0,closable:!1,beforeOpen:function(){var e=i.getElementsByClassName(t.cssPrefix+"-columnsbar-slot")[0];t.columnsBar=new u.a(e,t.ddQuery),t.columnsBar.init(t.context,t.options.columnsBar);var n=i.getElementsByClassName(t.cssPrefix+"-querypanel-slot")[0];t.queryPanel=new d.a(n,t.ddQuery),t.queryPanel.init(t.context,t.options.queryPanel),t.columnsBar.refresh(),t.queryPanel.refresh()},onSubmit:function(){return t.submitDialog()},onDestroy:function(){t.destroyDialog()}})},e.prototype.renderQueryPanelBlock=function(){var t=this;return Object(w.domel)("div").addClass(this.cssPrefix+"-querypanel-block").addChild("div",(function(e){return e.addClass(t.cssPrefix+"-querypanel-caption")})).addChild("div",(function(e){return e.addClass(t.cssPrefix+"-querypanel-slot")})).toDOM()},e.prototype.renderColumnsBarBlock=function(){var t=this;return Object(w.domel)("div").addClass(this.cssPrefix+"-columnsbar-block").addChild("div",(function(e){return e.addClass(t.cssPrefix+"-columnsbar-caption")})).addChild("div",(function(e){return e.addClass(t.cssPrefix+"-columnsbar-slot")})).toDOM()},e.prototype.submitDialog=function(){if(this.ddQuery.tryValidate({checkExpressions:!0})){var t=this.context.getQuery().getDrillDowns();if(t.length)t[0].loadFromData(this.ddQuery.toJSONData()),this.context.getQuery().fireChangedEvent();else if(!this.ddQuery.isEmpty())this.context.getQuery().addDrillDown().loadFromData(this.ddQuery.toJSONData()),this.context.getQuery().fireChangedEvent();return!0}return!1},e.prototype.destroyDialog=function(){this.context.getModel().removeOperator("BindToParentColumn",!0),this.ddQuery=null,this.columnsBar&&this.columnsBar.destroy(),this.columnsBar=null,this.queryPanel&&this.queryPanel.destroy(),this.queryPanel=null},e}(s.Widget),S=n(99),k=n(92),M=n(93),I=n(5),O=n(47),A=n(53),P=n(46),B=n(42),_=n(43),L=n(95),R=n(75),F=n(41),Q=n(76),j=n(97),q=n(30),N=n(73),H=n(74),W=n(80),G=n(83),V=n(35),z=n(78),U=n(52),J=n(24),Y=n(82),K=n(84),X=n(26),$=n(77),Z=n(81),tt=n(31),et=n(91),nt=n(89),ot=n(90),it=n(32),rt=n(108),st=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),at=function(t){function e(){return t.call(this)||this}return st(e,t),e.prototype.initOptions=function(e){var n=this;return(e=t.prototype.initOptions.call(this,e)).result.fetchEmptyQueries=!0,this.context.getQuery().addChangedCallback((function(){n.resultOptions.clearResultOnQueryChange&&n.context.clearResult(),e.syncQueryOnChange&&n.context.syncQuery()})),this.context.addEventListener("ready",this.fetchData.bind(this)),e},e.prototype.initWidgets=function(e){var n=this;if(t.prototype.initWidgets.call(this,e),this.sortingBarWidget&&this.context.getQuery().addChangedCallback((function(t){var e=t.data;!e||e.part!=s.QueryChangePart.SortingColumns&&e.part!=s.QueryChangePart.Columns&&e.part!=s.QueryChangePart.All||n.fetchData()})),this.filterBarWidget){var o=this.filterBarWidget.getWidgetType();e.widgets[o]=e.widgets[o]||{},e.widgets[o].applyFilterCallback||(e.widgets[o].applyFilterCallback=function(){n.fetchData()})}},e.prototype.applyQueryFilter=function(){console.warn("applyQueryFilter is obsolete. Use fetchData instead"),this.fetchData()},e.prototype.fetchData=function(){t.prototype.fetchData.call(this,{refresh:!0})},e}(it.a),lt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ut=function(t){function e(){return t.call(this)||this}return lt(e,t),e.prototype.createResultGridWidget=function(t){return new m(t)},e.prototype.applyQueryFilter=function(){console.warn("applyQueryFilter is obsolete. Use fetchData instead"),this.fetchData()},e}(at),ct=n(3),dt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ht=function(t){function e(){var e=t.call(this)||this;return e.reports=[],e.reportCache=[],e.exportButtons=[],e.exportClass="eqjs-export",e.disabledClass="eqjs-disabled",e.enableExport=!1,e.useReportCache=!0,e.syncReportOnChange=!0,e._reportSaveTemplate='<div id="kdlg-dialog-form" class="kfrm-form">\n <div class="kfrm-fields label-above">\n <label for="kdlg-dialog-form-input" id="kdlg-dialog-form-content"></label>\n <input type="text" name="kdlg-dialog-form-input" id="kdlg-dialog-form-input" />\n <label for="kdlg-dialog-form-textarea" id="kdlg-dialog-form-desc-label"></label>\n <textarea type="text" name="kdlg-dialog-form-textarea" id="kdlg-dialog-form-textarea"></textarea>\n </div>\n </div>',e.context.useStoredQueryOnFetch=!0,e.exportButtonClickHandler=function(t,n){if(!t.classList.contains(e.disabledClass)){var o=t.getAttribute("data-format");e.context.exportResult({format:o})}},e.clearReportButtonClickHandler=e.clearReportButtonClick.bind(e),e.newReportButtonClickHandler=e.newReportButtonClick.bind(e),e.loadReportButtonClickHandler=e.loadReportButtonClick.bind(e),e.saveReportButtonClickHandler=e.saveReportButtonClick.bind(e),e.removeReportButtonClickHandler=e.removeReportButtonClick.bind(e),e.reloadReportDataButtonClickHandler=e.reloadReportDataButtonClick.bind(e),ct.a.onMobileModeChanged((function(t){document.location.reload()})),e}return dt(e,t),e.prototype.initOptions=function(e){return void 0!==(e=t.prototype.initOptions.call(this,e)).syncQueryOnChange&&(this.syncReportOnChange=e.syncQueryOnChange),void 0!==e.syncReportOnChange&&(this.syncReportOnChange=e.syncReportOnChange),e.syncQueryOnChange=this.syncReportOnChange,void 0!==e.useReportCache&&(this.useReportCache=e.useReportCache),this.defaultReportId=e.defaultReportId,e},e.prototype.initDone=function(){var e=this;t.prototype.initDone.call(this),this.context.getQuery().addChangedCallback((function(t){var n=t.data;n&&("query.switched"==n.changeType?(e.context.clearResult(),e.context.refreshWidgets(s.WidgetGroup.Result),e.context.refreshWidgets(s.WidgetGroup.Query)):(e.disableExportButtons(),e.resultCountSlot&&(e.resultCountSlot.style.display="none")));var o=!n||"query.switched"==n.changeType||n.part==s.QueryChangePart.ExtraData||n.part==s.QueryChangePart.Facets,i=!1;e.syncReportOnChange&&(n&&"query.switched"!=n.changeType&&!n.noSync&&(i=!0,e.syncReport({success:function(){!o&&e.viewOptions.fetchDataOnChange&&e.fetchData()}})));!o&&e.resultOptions.clearResultOnQueryChange&&(e.context.clearResult(),e.context.refreshWidgets(s.WidgetGroup.Result)),o||i||!e.viewOptions.fetchDataOnChange||e.fetchData()})),window.setTimeout((function(){e.context.loadQueryList({success:function(t){Array.isArray(t)&&(e.reports=t,e.reports.filter((function(t){return t.id==e.defaultReportId})).length>0?e.renderReportList({reportId:e.defaultReportId}):e.renderReportList())}})}),100)},e.prototype.initWidgets=function(e){var n=this;t.prototype.initWidgets.call(this,e);var o="ClearReportButton",i="NewReportButton",r="LoadReportButton",s="SaveReportButton",a="RemoveReportButton",l="ReloadReportDataButton",u="ResultCount",c="ResultExportButtons",d=this.exportClass;e.slots&&(u=e.slots.resultCountSpan||u,c=e.slots.exportButtons||c,o=e.slots.clearReportButton||o,i=e.slots.newReportButton||i,r=e.slots.loadReportButton||r,s=e.slots.saveReportButton||s,a=e.slots.removeReportButton||a,l=e.slots.reloadReportDataButton||l,d=e.slots.exportClass||d),this.exportButtons=this.domRoots.reduce((function(t,e){return t.concat(Array.from(e.querySelectorAll("."+d)))}),[]),this.enableExport=e.enableExport,this.enableExport?this.exportButtons.forEach((function(t){t.addEventListener("click",n.exportButtonClickHandler)})):this.hideExportButtons(),this.exportButtonsContainer=this.resolveElement(c),this.clearReportButton||(this.clearReportButton=this.resolveElement(o),this.clearReportButton&&this.clearReportButton.addEventListener("click",this.clearReportButtonClickHandler)),this.newReportButton||(this.newReportButton=this.resolveElement(i),this.newReportButton&&this.newReportButton.addEventListener("click",this.newReportButtonClickHandler)),this.loadReportButton||(this.loadReportButton=this.resolveElement(r),this.loadReportButton&&this.loadReportButton.addEventListener("click",this.loadReportButtonClickHandler)),this.saveReportButton||(this.saveReportButton=this.resolveElement(s),this.saveReportButton&&this.saveReportButton.addEventListener("click",this.saveReportButtonClickHandler)),this.removeReportButton||(this.removeReportButton=this.resolveElement(a),this.removeReportButton&&this.removeReportButton.addEventListener("click",this.removeReportButtonClickHandler)),this.reloadReportDataButton||(this.reloadReportDataButton=this.resolveElement(l),this.reloadReportDataButton||(this.reloadReportDataButton=this.resolveElement("UpdateReportButton")),this.reloadReportDataButton&&this.reloadReportDataButton.addEventListener("click",this.reloadReportDataButtonClickHandler)),this.reportListSlot=document.getElementById("ReportList"),this.resultCountSlot=this.resolveElement(u)},e.prototype.newReport=function(){var t=this,e=this.context.getServices().getDialogService().open({title:g.i18n.getText("NewReportDlgTitle"),body:this._reportSaveTemplate,submitable:!0,closable:!0,cancelable:!0,submitOnEnter:!0,arrangeParents:!1,beforeOpen:function(){var t=document.getElementById("kdlg-dialog-form-input");t.value=g.i18n.getText("NewReportDefName"),document.getElementById("kdlg-dialog-form-content").innerHTML=g.i18n.getText("SaveReportDlgLabel"),document.getElementById("kdlg-dialog-form-desc-label").innerHTML=g.i18n.getText("ReportDescLabel"),t.focus()},onSubmit:function(){var n=document.getElementById("kdlg-dialog-form-input").value;if(n&&n.replace(/\s/g,"").length>0){e.clearAlert(),e.disableButtons();var o=e.getRootElement().querySelector("header"),i=Object(w.domel)("div",o).addClass("eqjs-process-bar local").toDOM(),r=document.getElementById("kdlg-dialog-form-textarea").value;t.context.newQuery({name:n,description:r,success:function(){e.close();var n=t.context.getQuery(),o=n.getId();t.insertIntoReportList({id:o,name:n.getName(),description:n.getDescription()}),t.renderReportList({reportId:o})},error:function(t){o.removeChild(i),e.enableButtons(),e.showAlert(t,"error")}})}return!1}})},e.prototype.loadReport=function(t){var e=this;if(!t)throw"Empty report ID!";var n=this.findReportById(t);if(n){var o=this.context.getQuery(),i=function(){e.renderReportProps(),e.context.resultTable.clear(),o.fireChangedEvent({part:s.QueryChangePart.All,noSync:!0,changeType:"query.switched"}),e.fetchData()},r=this.useReportCache?this.getReportContentFromCache(n):null;r?(o.clear(),o.loadFromJson(r,{validate:!1}),i()):this.context.loadQuery({queryId:t,silent:!0,success:function(){e.saveReportContentInCache(n,o.toJSON()),i()}}),this.setActiveReport(t)}},e.prototype.saveCurrentReportAs=function(){var t=this,e=this.context.getQuery(),n=this.context.getServices().getDialogService().open({title:g.i18n.getText("SaveReportDlgTitle"),body:this._reportSaveTemplate,submitable:!0,closable:!0,cancelable:!0,submitOnEnter:!0,arrangeParents:!1,beforeOpen:function(){var t=document.getElementById("kdlg-dialog-form-input");t.value=e.getName(),document.getElementById("kdlg-dialog-form-content").innerHTML=g.i18n.getText("SaveReportDlgLabel"),document.getElementById("kdlg-dialog-form-desc-label").innerHTML=g.i18n.getText("ReportDescLabel"),document.getElementById("kdlg-dialog-form-textarea").value=e.getDescription(),t.focus()},onSubmit:function(){var o=document.getElementById("kdlg-dialog-form-input").value;if(o&&o.replace(/\s/g,"").length>0){e.setId(g.utils.generateId(o.replace(/\s/g,""))),n.clearAlert(),n.disableButtons();var i=n.getRootElement().querySelector("header"),r=Object(w.domel)("div",i).addClass("eqjs-process-bar local").toDOM(),a=document.getElementById("kdlg-dialog-form-textarea").value;e.setDescription(a),t.context.newQuery({clearQuery:!1,name:o,success:function(){n.close(),t.context.refreshWidgets(s.WidgetGroup.Query);var o=t.context.getQuery().getId();t.fetchData(),t.insertIntoReportList({id:o,name:e.getName(),description:e.getDescription()}),t.renderReportList({reportId:o}),t.setActiveReport(o),t.renderReportProps()},error:function(t){i.removeChild(r),n.enableButtons(),n.showAlert(t,"error")}})}return!1}})},e.prototype.removeCurrentReport=function(){var t=this,e=this.context.getQuery();this.context.getServices().getDialogService().openConfirm(g.i18n.getText("RemoveReportDlgTitle"),g.i18n.getText("RemoveReportContent").replace("{reportName}",e.getName())).then((function(n){if(n){var o=e.getId();t.context.removeQuery({queryId:o,success:function(){var e=t.removeFromReportList(o);t.renderReportList({reportIndex:e})}})}}))},e.prototype.syncReport=function(t){var e=this;if(this.useReportCache){var n=this.context.getQuery(),o=this.findReportById(n.getId());o&&(o.lastUpdated=Date.now(),this.saveReportContentInCache(o,n.toJSON()))}this.context.syncQuery({success:function(n){n.query&&e.context.refreshWidgets(s.WidgetGroup.Query),n.statement&&e.context.refreshWidgets(s.WidgetGroup.Statement),t&&t.success&&t.success(n)}})},e.prototype.setActiveReport=function(t){for(var e=this.reportListSlot.querySelectorAll("li"),n=0;n<e.length;n++){var o=e[n];o.classList.remove("active"),o.getAttribute("data-rid")===t&&o.classList.add("active")}},e.prototype.renderReportProps=function(){var t=this.context.getQuery();document.getElementById("ReportTitle").innerHTML=t.getName();var e=document.querySelector(".columns-bar");if(e){e.innerHTML="<strong>Columns:</strong>";for(var n=0,o=t.getColumns();n<o.length;n++){var i=o[n];e.innerHTML+='<span class="label label-default">'+i.caption+"</span> "}}},e.prototype.renderReportList=function(t){if(this.renderReportPanels(),!this.reportListSlot.matches("li")){this.reportListSlot.innerHTML="",t=t||{reportId:this.reports.length>0?this.reports[0].id:null};var e=document.createElement("ul");e.className="list-group list-group-flush",this.reportListSlot.appendChild(e);for(var n=0,o=this.reports;n<o.length;n++){var i=o[n];this.renderReportItemInList(i,e)}if(t.reportId&&this.loadReport(t.reportId),void 0!==t.reportIndex){var r=t.reportIndex;r>=this.reports.length&&(r=this.reports.length-1),r<0&&this.reports.length>0&&(r=0),r>=0&&this.loadReport(this.reports[r].id)}}},e.prototype.detach=function(){var e=this;this.exportButtonsContainer&&(this.showExportButtons(),this.exportButtons.forEach((function(t){t.removeEventListener("click",e.exportButtonClickHandler)})),this.exportButtons=[],this.exportButtonsContainer=null),this.clearReportButton&&(this.clearReportButton.removeEventListener("click",this.clearReportButtonClickHandler),this.clearReportButton=null),this.newReportButton&&(this.newReportButton.removeEventListener("click",this.newReportButtonClickHandler),this.newReportButton=null),this.loadReportButton&&(this.loadReportButton.removeEventListener("click",this.loadReportButtonClickHandler),this.loadReportButton=null),this.saveReportButton&&(this.saveReportButton.addEventListener("click",this.saveReportButtonClickHandler),this.saveReportButton=null),this.removeReportButton&&(this.removeReportButton.removeEventListener("click",this.removeReportButtonClickHandler),this.removeReportButton=null),this.reloadReportDataButton&&(this.reloadReportDataButton.removeEventListener("click",this.reloadReportDataButtonClickHandler),this.removeReportButton=null),this.reportListSlot&&(this.reportListSlot.innerHTML="",this.reportListSlot=null),this.resultCountSlot&&(this.resultCountSlot.innerHTML="",this.resultCountSlot=null),t.prototype.detach.call(this)},e.prototype.renderReportItemInList=function(t,e){var n=this;e||(e=this.reportListSlot.querySelector("ul"));var o=t.name||t.description||"",i=document.createElement("li");i.className="list-group-item",i.style.cursor="pointer",i.setAttribute("data-rid",t.id),i.innerText=o,t.description&&(i.title=t.description),i.addEventListener("click",(function(t){var e=t.target.getAttribute("data-rid");n.loadReport(e),n.setActiveReport(e)})),e.appendChild(i)},e.prototype.renderReportPanels=function(){var t=document.getElementById("ReportsContainer"),e=document.getElementById("NoReportPanel");this.reports.length>0?(this.hideElement(e),this.showElement(t)):(this.hideElement(t),this.showElement(e))},e.prototype.hideElement=function(t){t&&(t.style.visibility="hidden")},e.prototype.showElement=function(t){t&&t.style.removeProperty("visibility")},e.prototype.insertIntoReportList=function(t){this.reports.push(t)},e.prototype.removeFromReportList=function(t){var e=this.indexOfReportById(t);return e>=0&&this.reports.splice(e,1),e},e.prototype.indexOfReportById=function(t){for(var e=0;e<this.reports.length;e++)if(this.reports[e].id===t)return e;return-1},e.prototype.clearReportButtonClick=function(){this.clearErrors(),this.context.clearQuery()},e.prototype.reloadReportDataButtonClick=function(){this.fetchData()},e.prototype.saveReportButtonClick=function(){this.saveCurrentReportAs()},e.prototype.loadReportButtonClick=function(){this.loadReport("LastQuery")},e.prototype.removeReportButtonClick=function(){this.removeCurrentReport()},e.prototype.newReportButtonClick=function(){this.newReport()},e.prototype.errorHandler=function(t){},e.prototype.clearErrors=function(){},e.prototype.disableExportButtons=function(){this.hideExportButtons()},e.prototype.enableExportButtons=function(){this.showExportButtons()},e.prototype.hideExportButtons=function(){this.exportButtonsContainer&&(this.exportButtonsContainer.style.display="none")},e.prototype.showExportButtons=function(){this.exportButtonsContainer&&(this.exportButtonsContainer.style.display="initial")},e.prototype.saveReportContentInCache=function(t,e){var n=this.findReportCacheItem(t.id);n||(n={id:t.id},this.reportCache.push(n)),n.lastUpdated=t.lastUpdated,n.content=e},e.prototype.getReportContentFromCache=function(t){var e=this.findReportCacheItem(t.id);return e&&e.lastUpdated===t.lastUpdated?e.content:null},e.prototype.findReportById=function(t){for(var e=0,n=this.reports;e<n.length;e++){var o=n[e];if(o.id===t)return o}return null},e.prototype.findReportCacheItem=function(t){for(var e=0,n=this.reportCache;e<n.length;e++){var o=n[e];if(o.id===t)return o}return null},e}(it.a),pt=n(79),ft=n(9),gt=n(10),yt=n(15),mt=n(45),vt=n(94);g.i18n.addMapper((function(t){if(t||t.texts)for(var e in t.texts)switch(e){case"PredicateTitle":t.texts.ConditionGroupTitle=t.texts[e];break;case"RootPredicateTitle":t.texts.RootConditionGroupTitle=t.texts[e];break;case"ErrIncorrectPredicateTitleFormat":t.texts.ErrIncorrectGroupTitleFormat=t.texts[e];break;case"ButtonAddPredicate":t.texts.ButtonAddGroup=t.texts[e];break;case"ButtonDelete":t.texts.CmdDelete=t.texts[e];break;case"ButtonClear":t.texts.CmdClear=t.texts[e];break;case"ButtonEnable":t.texts.CmdToggleEnable=t.texts[e];break;case"ButtonAddCondition":t.texts.CmdAddCondition=t.texts[e];break;case"ButtonAddGroup":t.texts.CmdAddCondGroup=t.texts[e]}})),g.i18n.updateDefaultTexts({AltMenuAttribute:"Attribute",AltMenuConstantExpression:"Constant expression",ButtonApply:"Apply",ButtonCancel:"Cancel",ButtonClose:"Close",ButtonNext:"Next",ButtonPrev:"Prev",ButtonNow:"Now",ButtonOK:"OK",MenuEnable:"Enabled",MenuParameterization:"Parameterized",MenuJoinCond:"Use in JOIN",CmdClear:"Clear",CmdDelete:"Delete",CmdToggleEnable:"Toggle enable",CmdAddCondition:"Add condition",CmdAddCondGroup:"Add group of conditions",ButtonSelectAll:"Select all",ButtonDeselectAll:"Clear selection",ButtonAddColumns:"Add column(s)",ButtonAddConditions:"Add condition(s)",CmdClickToAddCondition:"[Add new condition]",CmdDeleteRow:"Delete this row",ErrIncorrectGroupTitleFormat:"Incorrect condition group title format",ErrNotNumber:" is not a number",ErrIncorrectInteger:"Incorrect integer value",ErrIncorrectNumberList:"Incorrect list format",False:"False",LinkTypeAll:"all",LinkTypeAny:"any",LinkTypeNone:"none",LinkTypeNotAll:"not all",ConjAll:"and",ConjAny:"or",ConjNotAll:"and",ConjNone:"or",MsgApplySelection:"[Apply selection]",MsgAs:"as",MsgEmptyList:"(empty list)",MsgEmptyListValue:"[select value]",MsgEmptyScalarValue:"[enter value]",MsgSubQueryValue:"[edit sub-query]",MsgEmptyAttrValue:"[select attribute]",MsgEmptyOperator:"[Unrecognized operator]",MsgEmptyCustomSql:"[enter SQL expression]",MsgCustomSql:"[Custom SQL]",MsgNoResult:"No result",MsgResultCount:"{0} records found",MsgOf:"of",ConditionGroupTitle:"{lt} of the following apply",RootConditionGroupTitle:"Select records where {lt} of the following apply",StrAddConditions:"Add conditions",SubQueryDialogTitle:"Edit sub-query",SubQueryColumnTitle:"Column:",SubQueryEmptyColumn:"[select column]",SubQueryQueryPanelCaption:"Conditions",True:"True",ButtonSorting:"Sorting",ButtonToAggr:"Change to aggregate column",ButtonToSimple:"Change to simple column",ButtonFormat:"Display format",CmdAscending:"Ascending",CmdClickToAddColumn:"[Add new column]",CmdDeleteColumn:"Delete column",CmdDeleteSorting:"Delete sorting",CmdDescending:"Descending",CmdGroupSort:"Sorting",CmdGroupFormat:"Display format",CmdNotSorted:"Not sorted",ColTypeAggrFunc:"Aggregate function",ColTypeCompound:"Calculated",ColTypeGroup:"Column type",ColTypeSimple:"Simple column",HeaderExpression:"Expression",HeaderSorting:"Sorting",HeaderTitle:"Title",SortHeaderColumn:"Column",SortHeaderSorting:"Sorting",StrAddColumns:"Add columns",CustomExpression:"Custom Expression",AddAllForEntityText:"[Add all attributes]",CmdMoveToStart:"Move to start",CmdMoveRight:"Move right",CmdMoveLeft:"Move left",CmdMoveToEnd:"Move to the end",CmdMoveUp:"Move up",CmdMoveDown:"Move down",ButtonMenu:"Show menu",CmdToSimple:"Not aggregated",CmdMoveToFirst:"Move to the first",CmdMoveToPrev:"Move to the previous",CmdMoveToNext:"Move to the next",CmdMoveToLast:"Move to the last",CmdHiddenColumn:"Hidden",RowButtonTitle:"Click to see the available options",EntityToggle:"Toggle entity",StrNoFilterDefined:"No filter defined",StrNoFilterClickToAdd:"No filter defined. Click to add a new condition",HintHours:"Hours",HintMinutes:"Minutes",RemoveQueryTitle:"Confirmation",RemoveQueryContent:"Remove query [{queryName}]?",NewQueryTitle:"New query",NewQueryContent:"New query name: ",NewQueryDefName:"New query",SaveQueryTitle:"Save query",SaveQueryContent:"Query name: ",SaveQueryDefName:"{queryName} copy",QueryChangedTitle:"Confirmation",QueryChangedContent:"The query was changed. Do you want to save it first?",UpdateQuerySelector:"[click here to load the query]",FileNameLabel:"File name: ",SaveQueryToFileDlgTitle:"Save query to file",NewReportDefName:"New report",NewReportDlgTitle:"New report",SaveReportDlgTitle:"Save report",SaveReportDlgLabel:"Report name:",ReportDescLabel:"Description: ",RemoveReportDlgTitle:"Remove report",RemoveReportContent:"Are you sure you want to remove '{reportName}'?",Facets:{TotalRecordsLabel:"Total records:",AddMenuItems:{Chart:"Chart",Pivot:"Pivot table",DataTable:"Data table"},LoadDataDlgTitle:"Downloading data",LoadDataDlgContent:"Records loaded: {loadedRecs}/{totalRecs}",RefreshBtnTitle:"Refresh",ExportBtnTitle:"Export",MaximizeBtnTitle:"Maximize",RestoreBtnTitle:"Restore Down",RemoveFacetDlgTitle:"Remove facet",RemoveFacetDlgContent:"Are you sure, that you want to delete {facetTitle} tab?",DefaultDlgTitle:"Setup facet",DefaultFacetTitle:"",NewFacetTitle:"New Facet",TabNameLabel:"Tab name",ErrQueryChanged:"FAILED TO DISPLAY. QUERY WAS CHANGED",ErrNotEnoughData:"We can't display the graph because not all data for this query is loaded. \n The total number of records: {totalRecs}, currently loaded: {cachedRecs}. \n You can [download the result]. Please note: this may take some time and consume a lot of memory.",ErrTooMuchData:"Too much data. The grid is not able to display it",Chart:{FacetTitle:"Chart",DlgTitle:"Chart settings",DataColumnSelectorLabel:"Data column",LabelColumnSelectorLabel:"Label column",ChartTypeSelectorLabel:"Chart type",ShowLegendLabel:"Show legend (if available)"},Pivot:{FacetTitle:"Pivot table",DlgTitle:"Pivot settings",SwapBtnTitle:"Swap column and row fields",ColumnFieldSelectorLabel:"Column field",RowFieldSelectorLabel:"Row field",CellDataSelectorLabel:"Cell data",TotalsRowLabel:"Totals row",TotalsColLabel:"Totals column",TotalGridLabel:"Total"},DataTable:{FacetTitle:"Result table",DlgTitle:"Table facet settings"}},TotalsDlgLabel:"Totals",GrandTotalsLabel:"Grand totals",TotalsDlgTitle:"Select totals",ExportDlgTitle:"Export result",ExportDlgFmtLabel:"Format",csv:"CSV",excel:"Excel",pdf:"PDF","excel-html":"HTML (Excel-compatible)",AggrSettings:{GroupBtn:"Group selected column(s)",UngroupBtn:"Ungroup columns",AggrBtn:"Aggregate selected column",UnaggrBtn:"Remove column aggregation",GrandTotalsLabel:"Show grand totals",GroupCountsLabel:"Show record count for groups",AggrDialogTitle:"Aggregation/grouping",EnableAggrLabel:"Enable aggregation",SelectedError:"Complete the action with selected column(s)",NoGroupsOrAggrError:"Add at least one group or aggregation",NoGroupsOrGrandError:"Add at least one group, or enable grand totals",NoAggrOrCountError:"Add at least one aggregation, or enable records count",NoGroupsLabel:"No groups",NoAggrsLabel:"No aggregations",EmptySettingsLabel:"[ Click to setup ]"},ChartType:{Area:"Area chart",Bar:"Bar chart",Column:"Column chart",Combo:"Combo chart",Doughnut:"Doughnut chart",Polar:"Polar chart",Radar:"Radar chart",Histogram:"Histogram chart",Line:"Line chart",SteppedLine:"Stepped line chart",Pie:"Pie chart"}}),s.EqServiceProvider.prototype.registerDialogServiceResolver=function(t){this.dialogServiceResolver=t},s.EqServiceProvider.prototype.getDialogService=function(){if(!this.dialogService){if(!this.dialogServiceResolver)throw"DialogServiceResolver is not defined";this.dialogService=this.dialogServiceResolver()}return this.dialogService},Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),window.NodeList&&!window.NodeList.prototype.forEach&&(window.NodeList.prototype.forEach=Array.prototype.forEach),Array.prototype.findIndex||(Array.prototype.findIndex=function(t){if(null==this)throw new TypeError("Array.prototype.findIndex called on null or undefined");if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var e,n=Object(this),o=n.length>>>0,i=arguments[1],r=0;r<o;r++)if(e=n[r],t.call(i,e,r,n))return r;return-1});var bt=[45,128,231];Math.trunc=Math.trunc||function(t){return isNaN(t)?NaN:t>0?Math.floor(t):Math.ceil(t)};var Ct={__kt:0,ck:function(t){if(t&&t.length)try{for(var e=function(t){for(var e=function(t){var e=t;switch((e=(e=e.replace(/-/g,"+")).replace(/_/g,"/")).length%4){case 0:break;case 2:e+="==";break;case 3:e+="="}return window.atob(e)}(t),n=e.length,o=new Uint8Array(n),i=0;i<n;i++)o[i]=e.charCodeAt(i);return o}(t.slice(0,t.length-12)),n=t.slice(t.length-12),o=!1,i=0,r=bt;i<r.length;i++){var s=Tt(r[i]);if(n[0]===s[0]&&n[2]===s[1]){o=!0;break}}o||(Ct.__kt=-1);if(n[8]!=xt(9,19))return void(Ct.__kt=-2);if(n[1]!=xt(e[3]))return;if(Ct.__kt=n[3]!=xt(e[5])?2:3,2===Ct.__kt){var a=""+function(t){for(var e=0,n=0;n<t.length;++n)e+=wt.indexOf(t[n])*Math.pow(wt.length,t.length-n-1);return e}(n.substring(4,6)+n.substring(10)),l=new Date(2e3+Number.parseInt(a.substring(0,2)),Number.parseInt(a.substring(2,4))-1,Number.parseInt(a.substring(4)),0,0,0,0);Date.now()>l.getTime()&&(Ct.__kt=1)}}catch(t){}else this.__kt=-3}};function xt(t,e){return void 0===e&&(e=20),String.fromCharCode(65+t%e)}var wt="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";function Tt(t){for(var e="";t>0;)e=wt[t%wt.length]+e,t/=wt.length;return e}var Et=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Dt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.readOnly=!1,e.parameterized=!1,e.inJoin=!1,e}return Et(e,t),e.prototype.isReadOnly=function(){return this.readOnly||this.getParent()&&this.getParent().isReadOnly()},e.prototype.setReadOnly=function(t){this.readOnly=t||this.getParent()&&this.getParent().isReadOnly(),this.conditions&&this.conditions.forEach((function(e){e.setReadOnly(t)}))},e.prototype.isParameterized=function(){return this.parameterized},e.prototype.setParameterized=function(t){this.parameterized=t},e.prototype.isInJoin=function(){return this.inJoin},e.prototype.setInJoin=function(t){this.inJoin=t},e.prototype.loadFromData=function(e,n){if(t.prototype.loadFromData.call(this,e,n),!(Ct.__kt<=1)&&(void 0!==n.readOnly&&this.setReadOnly(n.readOnly),void 0!==n.inJoin&&this.setInJoin(n.inJoin),void 0!==n.parameterized&&this.setParameterized(n.parameterized),n.conds))for(var o=0;o<n.conds.length;o++){var i=this.query.createCondition();i.loadFromData(e,n.conds[o]),this.conditions.push(i),i.setParent(this)}},e.prototype.saveToData=function(){var e=t.prototype.saveToData.call(this);if(Ct.__kt<=1)return e;if(this.isReadOnly()&&(e.readOnly=this.isReadOnly()),this.isParameterized()&&(e.parameterized=this.isParameterized()),this.isInJoin()&&(e.inJoin=this.isInJoin()),this.tag==s.CondTag.Group){e.conds=[];for(var n=0;n<this.conditions.length;n++)e.conds.push(this.conditions[n].saveToData())}return e},e}(s.Condition),St=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),kt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.readOnly=!1,e}return St(e,t),e.prototype.isReadOnly=function(){return this.readOnly},e.prototype.setReadOnly=function(t){this.readOnly=t},e.prototype.loadFromData=function(e,n){t.prototype.loadFromData.call(this,e,n),Ct.__kt<=2||n&&void 0!==n.readOnly&&(this.readOnly=n.readOnly)},e.prototype.saveToData=function(){var e=t.prototype.saveToData.call(this);return Ct.__kt<=2||this.isReadOnly()&&(e.readOnly=this.isReadOnly()),e},e}(s.QueryColumn),Mt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),It=function(t){function e(e){return t.call(this,e)||this}return Mt(e,t),e.prototype.isEx=function(){return Ct.__kt>1},e.prototype.createSubQuery=function(){return new e(this.model)},e.prototype.createCondition=function(e){return void 0===e&&(e=s.CondTag.Simple),Ct.__kt<=1?t.prototype.createCondition.call(this,e):new Dt(this,e)},e.prototype.createColumn=function(e){return void 0===e&&(e=!1),Ct.__kt<=1?t.prototype.createColumn.call(this,e):new kt(this,e)},e.prototype.addConditionGroup=function(e,n){if(void 0===n&&(n=!0),Ct.__kt<=1)return t.prototype.addConditionGroup.call(this,e,n);var o=e.parent||this.getRootCondition(),i=e.linking||(o.linkType===s.LinkType.All?s.LinkType.Any:s.LinkType.All),r=this.createCondition(s.CondTag.Group);if(r.linkType=i,n){var a=this.getModel(),l=a.getFirstUICAttr(),u=a.getDefaultOperatorForAttr(l),c=this.createSimpleConditionObject(l,u,"");r.addCondition(c)}return o.addCondition(r),r},e.prototype.addExtraConditionGroup=function(e,n){return void 0===n&&(n=!0),e.parent=e.parent||this.extraConditions,Ct.__kt<=1?t.prototype.addExtraConditionGroup.call(this,e,n):this.addConditionGroup(e)},e}(s.Query),Ot=n(96),At=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Pt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return At(e,t),e.prototype.buildQueryPath=function(e){if(Ct.__kt<=1)return t.prototype.buildQueryPath.call(this,e);if(this.mainEntity)return t.prototype.buildQueryPath.call(this,e);var n=this.getEntitiesInQuery(e);if(0==n.length)throw Error("Cannon build path. Path is empty");for(var o=new s.Tree(n[0]),i=1;i<n.length;i++){var r=n[i];if(!o.contains(r)){var a=this.findPath(o.value,r);if(null==a)throw Error("Unable to build query. Cannot build path.");o=this.addPathToTree(o,a[0]===o.value?a.slice(1):a)}}return o.setParents(),o},e.prototype.addPathToTree=function(t,e){if(0!=e.length){for(var n=!1,o=0,i=t.childs;o<i.length;o++){var r=i[o];if(r.value===e[0]){n=!0,e.length>1&&(r=this.addPathToTree(r,e.slice(1)));break}}if(!n)if(this.findLink(t.value,e[0])){var a=new s.Tree(e[0]);t.addChild(a),e.length>1&&(a=this.addPathToTree(a,e.slice(1)))}else{if(t.parent)throw Error("Unable to build query. Cannot build path.");var l=new s.Tree(t);(t=new s.Tree(e[0])).addChild(l),e.length>1&&(t=this.addPathToTree(t,e.slice(1)))}return t}},e.prototype.findPath=function(t,e){var n=[],o=[],i=[],r=[],s=!1;for(n.push(t),o.push(n),r.push(t);!s;){i=[];for(var a=0,l=o;a<l.length;a++){var u=l[a];if(s=this.checkPath(u,e,i,r)){u.push(e),n=u;break}}if(o=[],!s){if(0==i.length)return null;for(var c=0,d=i;c<d.length;c++){u=d[c];o.push(u)}}}return n},e.prototype.checkPath=function(t,e,n,o){for(var i=t[t.length-1],r=0,s=this.getLinksByEntity(i);r<s.length;r++){var a=s[r],l=null;if((l=a.entityFrom==i?a.entityTo:a.entityFrom)==e)return n=[],!0;if(t.indexOf(l)<0&&o.indexOf(l)<0){o.push(l);var u=new Array;(u=u.concat(t)).push(l),n.push(u)}}return!1},e.prototype.createQuery=function(){return new It(this)},e}(s.DataModel),Bt=n(111);function _t(t){return!t||""===t.trim()}var Lt,Rt="https://korzh.com/api/license",Ft=function(){function t(t){this.http=new g.HttpClient,this.context=t}return t.prototype.show=function(){var t=this,e=new w.DefaultDialogService;this.dialogSet=e.createSet([{closable:!1,cancelable:!1,submitOnEnter:!0,title:"No license key for EasyQuery",body:this.buildStartPage(),submitButtonText:"Submit",onInput:this.validateForm.bind(this),onSubmit:this.startPageOnSubmit.bind(this)},{closable:!1,cancelable:!1,submitOnEnter:!0,title:"Please check your inbox",body:this.buildCodePage(),submitButtonText:"Get License Key",onInput:this.validateForm.bind(this),onSubmit:this.codePageOnSubmit.bind(this)},{closable:!1,cancelable:!1,submitable:!1,title:"Success",body:this.buildSuccessPage()},{closable:!1,cancelable:!1,submitable:!1,title:"Failure",body:this.buildFailurePage()}]);var n=this.dialogSet.open(0);setTimeout((function(){t.validateForm(n);var e=document.getElementById("eqAuthEmail");e&&e.focus()}),200)},t.prototype.isValidForm=function(t){var e=t.querySelector("#eqAuthEmail");if(e)return!_t(e.value)&&e.value.toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/);var n=t.querySelector("#eqAuthCode");return!n||!_t(n.value)&&!isNaN(+n.value)&&n.value==n.value.trim()&&6===n.value.length},t.prototype.validateForm=function(t){t.getSubmitButtonElement().disabled=!this.isValidForm(t.getRootElement())},t.prototype.addInputField=function(t,e){t.addChild("label",(function(t){return t.attr("for",e.id).addHtml(e.label+" "+(e.required?'<sup style="color: red">*</sup>':"")+": ")})).addChild("input",(function(t){t.id(e.id),t.name(e.name||e.id),t.type(e.type||"text"),void 0!==e.value&&t.value(e.value),e.onInput&&t.on("input",e.onInput)}))},t.prototype.buildStartPage=function(){var t,e=Object(w.domel)("div");return e.addChild("div",(function(t){return t.html('<div style="font-size:1.2em">The EasyQuery license key is either absent, invalid or was issued for a different version of the library.</div><div style="font-size:1.2em">Please fill out the form to obtain a valid trial license key.</div>')})),e.addClass("kfrm-form").addChild("div",(function(e){t=e,e.addClass("kfrm-fields label-above"),e.addClass("kfrm-break-20")})),this.addInputField(t,{id:"eqAuthEmail",name:"email",label:"Email",required:!0}),this.addInputField(t,{id:"eqAuthName",name:"contactName",label:"Name (optional)",required:!1}),e.addChild("div",(function(t){return t.html('<div style="margin-top:20px;font-size:0.9em">* By clicking Submit, you agree with Korzh.com <a href="https://korzh.com/terms-of-use">Terms of use</a> and <a href="https://korzh.com/privacy">Privacy policy</a>.</div><div style="font-size:0.9em">You also agree to receive email messages from Korzh.com. This consent may be revoked at any time.</div>')})),e.toDOM()},t.prototype.buildCodePage=function(){var t,e=Object(w.domel)("div");return e.addChild("div",(function(t){return t.html('<div style="font-size:1.2em">We sent a confirmation code to <strong>{{email}}</strong>.</div><div style="font-size:1.2em">Please find it in the email and enter to the text box below</div>')})),e.addClass("kfrm-form").addChild("div",(function(e){t=e,e.addClass("kfrm-fields label-above"),e.addClass("kfrm-break-20")})),this.addInputField(t,{id:"eqAuthCode",name:"code",label:"Confirmation code",required:!0}),e.addChild("div",(function(t){return t.html('<div style="margin-top:20px;font-size:0.9em">NB: Don\'t forget to check your SPAM folder if the message does not arrive within the next 5 minutes, and mark it as "Not Spam" if it\'s found there.</div>')})),e.toDOM().outerHTML},t.prototype.buildSuccessPage=function(){var t=Object(w.domel)("div");return t.addChild("div",(function(t){return t.html('<div style="font-size:1.2em">You have successfully completed the registration process.</div><div style="font-size:1.2em">Please restart your web application to get the key applied.</div>')})),t.toDOM()},t.prototype.buildFailurePage=function(){var t=Object(w.domel)("div");return t.addChild("div",(function(t){return t.html("{{message}}")})),t.toDOM().outerHTML},t.prototype.startPageOnSubmit=function(t){var e=this,n=document.getElementById("eqAuthEmail"),o=document.getElementById("eqAuthName"),i=n.value,r=o.value;return t.disableButtons(),this.http.post(s.equtils.combinePath(Rt,"get-code"),{email:i,name:r,data:{ptag:this.context.backendInfo.type,apptype:this.context.backendInfo.subType}},{dataType:"json"}).then((function(t){if(0!==t.status)throw new Error(t.message);var n=e.dialogSet.openNext({email:i});setTimeout((function(){e.validateForm(n);var t=document.getElementById("eqAuthCode");t&&t.focus()}),200)})).catch((function(e){t.showAlert(e.message,"error",!0),t.enableButtons()})),!1},t.prototype.codePageOnSubmit=function(t){var e=this,n=document.getElementById("eqAuthCode").value;return t.disableButtons(),this.http.post(s.equtils.combinePath(Rt,"get-key"),{token:n,ptag:this.context.backendInfo.type,version:"7.2"},{dataType:"json"}).then((function(t){switch(t.status){case 0:var n=s.equtils.combinePath(e.context.getBaseEndpoint(),"lck");e.http.post(n,{version:"7.2",key:t.key},{dataType:"json"}).then((function(t){return e.dialogSet.openNext()}));break;case 2:e.dialogSet.open(3,{message:'<div style="font-size:1.2em">Your trial license for EasyQuery has expired.</div><div style="font-size:1.2em">Please <a href="https://korzh.com/support">contact us</a> if you want to extend the trial period.</div>'});break;case 3:e.dialogSet.open(3,{message:'<div style="font-size:1.2em">Your purchased license for EasyQuery has expired.</div><div style="font-size:1.2em">You need to <a href="https://korzh.com/account">renew the subscription</a> to get a valid license.</div>'});break;default:throw new Error(t.message)}})).catch((function(e){t.showAlert(e.message,"error",!0),t.enableButtons()})),!1},t}();function Qt(){Lt&&(Lt.style.right="-400px",setTimeout((function(){Lt.parentNode.removeChild(Lt)}),5e3))}s.EqContext.prototype.setLicenseKeyEndpoint=function(t){console.warn("This method is deprecated and will be ignored.\n The main EasyQuery endpoint (set via useEndpoint() function) is used to get the license since version 7.0.\n So, you can simply remove this function call")},s.EqContext.prototype.useEnterprise=function(t){var e=this,n=function(t,n){if(Ct.ck(t),Ct.__kt>1){var o=e.getServices();o.registerDataModelResolver((function(t){return new Pt})),o.registerQueryResolver((function(t){return new It(t.getModel())})),o.registerQueryStorageResolver((function(t){return new Ot.a(t)})),o.registerAggregatesCalculator((function(t){return new Bt.a(t)})),2===Ct.__kt&&(console.warn("EasyQuery.JS is working in the TRIAL MODE!\nPlease order a license (https://korzh.com/eq) to get a proper product key."),function(){(Lt=document.createElement("div")).style.position="fixed",Lt.style.bottom="0",Lt.style.right="-400px",Lt.style.width="400px",Lt.style.height="100px",Lt.style.color="grey",Lt.style.textAlign="center",Lt.style.opacity="0.7",Lt.style.font="bold 1em Trebuchet MS, Tahoma, Verdana, Geneva, Arial, Helvetica, sans-serif",Lt.style.transition="right 3s ease-out";var t=document.createElement("div"),e=document.createElement("span");e.innerText="EasyQuery",e.style.color="#3A94D4",e.style.lineHeight="50px",t.appendChild(e);var n=document.createElement("span");n.innerText="by Korzh.com",n.style.marginLeft="10px",t.appendChild(n),Lt.appendChild(t);var o=document.createElement("div");o.innerText="FOR TRIAL USE ONLY",o.style.fontSize="1.2em",o.style.fontWeight="1000",Lt.appendChild(o),document.body.appendChild(Lt)}(),setTimeout((function(){Lt&&(Lt.style.right="0"),setTimeout(Qt,6e3)}),3e3))}else{if(n)!function(t){var e,n,o,i;switch(t.__kt){case 1:e="EasyQuery trial has expired",n='Your trial period for EasyQuery has expired. \n\tYou can send a request to <a href="https://korzh.com/account">extend your trial</a> or <a href="https://korzh.com/easyquery/licensing">buy a license</a> to get rid of all limitations.',o="Buy a license",i="https://korzh.com/easyquery/licensing";break;case-3:e="No license key for EasyQuery",n='Please <a href="https://korzh.com/easyquery#get-started">register for a trial</a> \n\tor <a href="https://korzh.com/easyquery/licensing">purchase a license</a> to get a proper product key. <br />\n\tIf you already have a key, please follow <a href="https://korzh.com/easyquery/docs/getting-started/product-key">this guide</a> to apply it.',o="Register trial",i="https://korzh.com/easyquery#get-started";break;default:e="Invalid key for EasyQuery!",n='The EasyQuery product key is either invalid or was issued for a different version of the library.\n The version you are using now is 7.2,\n\tso please <a href="https://korzh.com/account">login to your account</a> to get a proper key for version 7.2.',o="Get key",i="https://korzh.com/account"}var r=(new w.DefaultDialogService).open({closable:!1,cancelable:!1,submitable:!1,title:e,body:n}).getRootElement().querySelector("footer");Object(w.domel)(r).removeClass("align-right").setStyle("justify-content","center").addChild("button",(function(t){return t.addClass("kfrm-button","is-info").addText(o).on("click",(function(t){window.location.href=i}))})),1==t.__kt&&Object(w.domel)(r).addChild("button",(function(t){return t.addClass("kfrm-button").addText("Extend trial").on("click",(function(t){window.location.href="https://korzh.com/account"}))}))}(Ct);else new Ft(e).show()}};if("string"==typeof t)n(t,!0);else{if("function"!=typeof t)throw new Error("Wrong type of 'keyOrInitCallback' parameter. It must be a string with a license key or a callback function.");var o=this.getServices().getHttpClient(),i=s.equtils.combinePath(this.getBaseEndpoint(),"lck2");o.get(i).then((function(o){n(o.key.split("").reverse().join(""),!1),e.useBackend({type:o.backendType,subType:o.appType}),t()})).catch((function(r){i=s.equtils.combinePath(e.getBaseEndpoint(),"lck"),o.get(i).then((function(e){n(e.split("").reverse().join(""),!1),t()})).catch((function(t){return e.throwError({action:"LCK",sourceError:t})}))}))}};var jt=n(109),qt={core:g,ui:w};window.easydata=qt}]);
10
+ window.easyquery=function(t){var e={};function n(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=112)}([function(t,e,n){"use strict";n.r(e),n.d(e,"DataType",(function(){return i.a})),n.d(e,"EntityAttrKind",(function(){return o})),n.d(e,"EditorTag",(function(){return s})),n.d(e,"HttpMethod",(function(){return a.a})),n.d(e,"HttpRequest",(function(){return l.a})),n.d(e,"HttpResponseError",(function(){return u.b})),n.d(e,"HttpClient",(function(){return u.a})),n.d(e,"MetaData",(function(){return g})),n.d(e,"MetaEntity",(function(){return h})),n.d(e,"MetaEntityAttr",(function(){return p})),n.d(e,"ValueEditor",(function(){return f})),n.d(e,"AggregationSettings",(function(){return m})),n.d(e,"ColumnAlignment",(function(){return v.a})),n.d(e,"DataColumn",(function(){return v.b})),n.d(e,"DataColumnList",(function(){return v.c})),n.d(e,"DataRow",(function(){return b.a})),n.d(e,"EasyDataTable",(function(){return C.a})),n.d(e,"EventEmitter",(function(){return w})),n.d(e,"i18n",(function(){return c.a})),n.d(e,"EasyGuid",(function(){return x})),n.d(e,"repeatString",(function(){return T.b})),n.d(e,"reverseString",(function(){return T.c})),n.d(e,"strEndsWith",(function(){return T.d})),n.d(e,"combinePath",(function(){return T.a})),n.d(e,"utils",(function(){return d.a})),n.d(e,"liquid",(function(){return r}));var o,i=n(7);!function(t){t[t.Data=0]="Data",t[t.Virtual=1]="Virtual",t[t.Lookup=2]="Lookup"}(o||(o={}));var r,s={Unknown:"Unknown",Edit:"EDIT",DateTime:"DATETIME",List:"LIST",CustomList:"CUSTOMLIST",File:"FILE"},a=n(36),l=n(57),u=n(101),c=n(17),d=n(11),h=function(){function t(t){this.isEditable=!0,this.name="",this.caption="",this.description="",this.parent=t,this.attributes=new Array,this.subEntities=new Array}return t.prototype.loadFromData=function(t,e){if(e){if(this.id=e.id,this.name=e.name,this.captionPlural=e.namePlur,this.caption=e.name,this.description=e.desc,void 0!==e.ied&&(this.isEditable=e.ied),this.subEntities=new Array,e.ents)for(var n=0;n<e.ents.length;n++){var o=t.createEntity(this);o.loadFromData(t,e.ents[n]),this.subEntities.push(o)}if(this.attributes=new Array,e.attrs)for(n=0;n<e.attrs.length;n++){var i=t.createEntityAttr(this);i.loadFromData(t,e.attrs[n]),this.attributes.push(i)}}},t.prototype.scan=function(t,e){var n={stop:!1},o=function(i){if(e&&e(i,n),i.attributes)for(var r=i.attributes.length,s=0;s<r&&!n.stop;s++){var a=i.attributes[s];if(t&&t(a,n),n.stop)return}if(i.subEntities){var l=i.subEntities.length;for(s=0;s<l&&!n.stop;s++)o(i.subEntities[s])}};o(this)},t.prototype.getFirstPrimaryAttr=function(){return this.getPrimaryAttrs()[0]},t.prototype.getPrimaryAttrs=function(){return this.attributes.filter((function(t){return t.isPrimaryKey}))},t}(),p=function(){function t(t){this.id="",this.caption="{Unrecognized attribute}",this.dataType=i.a.String,this.size=0,this.isPrimaryKey=!1,this.isForeignKey=!1,this.isNullable=!0,this.showOnView=!0,this.isEditable=!0,this.showOnCreate=!0,this.showOnEdit=!0,this.showInLookup=!1,this.lookupAttr="",this.expr="",this.entity=t,this.kind=o.Data}return t.prototype.loadFromData=function(t,e){if(e){this.id=e.id,this.description=e.desc,this.caption=e.cptn,this.dataType=e.dtype,this.isPrimaryKey=e.ipk,this.isForeignKey=e.ifk,this.size=e.size,this.lookupAttr=e.lattr,this.lookupEntity=e.lent,this.dataAttr=e.dattr,this.lookupDataAttr=e.ldattr;var n=d.a.getDateDataTypes().indexOf(this.dataType);this.defaultValue=e.defVal&&n?new Date(e.defVal):e.defVal,this.isNullable=d.a.getIfDefined(e.nul,this.isNullable),this.isEditable=d.a.getIfDefined(e.ied,this.isEditable),this.showOnView=d.a.getIfDefined(e.ivis||e.sov,this.showOnView),this.showOnCreate=d.a.getIfDefined(e.soc,this.showOnCreate),this.showOnEdit=d.a.getIfDefined(e.soe,this.showOnEdit),this.showInLookup=d.a.getIfDefined(e.sil,this.showInLookup),this.kind=e.kind,this.displayFormat=e.dfmt,e.udata&&(this.userData=e.udata),e.edtr&&(this.defaultEditor=t.getEditorById(e.edtr)||t.createValueEditor())}},t}(),f=function(){function t(){this.id="",this.tag=s.Unknown,this.resType=i.a.Unknown,this.defValue=""}return t.prototype.loadFromData=function(t){t&&(this.id=t.id,this.tag=t.tag,this.defValue=t.defval,this.resType=t.rtype,this.accept=t.accept,this.multiline=t.multiline,t.subType&&(this.resType=t.subType),t.name&&(this.name=t.name),t.values&&(this.values=t.values))},t.prototype.getValueText=function(t){var e="";if(!this.values)return e;if(Array.isArray(t))for(var n=0,o=this.values;n<o.length;n++){var i=o[n];t.indexOf(i.id)>=0&&(e+=i.text+",")}else for(var r=0,s=this.values;r<s.length;r++){(i=s[r]).id===t&&(e+=i.text+",")}return e&&(e=e.substring(0,e.length-1)),e},t}(),g=function(){function t(){this.mainEntity=null,this.id="__none",this.name="Empty model",this.rootEntity=this.createEntity(),this.displayFormats=new Map}return t.prototype.getMainEntity=function(){return this.mainEntity},t.prototype.createEntity=function(t){return new h(t)},t.prototype.createEntityAttr=function(t){return new p(t)},t.prototype.createValueEditor=function(){return new f},t.prototype.loadFromJSON=function(t){var e=JSON.parse(t);this.loadFromData(e)},t.prototype.loadFromData=function(t){if(this.id=t.id,this.name=t.name,this.version=t.vers,this.editors=new Array,t.editors)for(var e=0;e<t.editors.length;e++){var n=this.createValueEditor();n.loadFromData(t.editors[e]),this.editors.push(n)}if(this.rootEntity.loadFromData(this,t.entroot),this.displayFormats=new Map,t.displayFormats)for(var o in t.displayFormats){var r=i.a[o],s=t.displayFormats[o]||new Array;this.displayFormats.set(r,s)}},t.prototype.getDisplayFormats=function(){return this.displayFormats},t.prototype.getDisplayFormatsForType=function(t){return this.displayFormats.has(t)?this.displayFormats.get(t):[]},t.prototype.getDefaultFormat=function(t){return this.displayFormats.has(t)?this.displayFormats.get(t).filter((function(t){return t.isdef}))[0]:null},t.prototype.setData=function(t){"string"==typeof t?this.loadFromJSON(t):this.loadFromData(t)},t.prototype.isEmpty=function(){return 0===this.rootEntity.subEntities.length&&0===this.rootEntity.attributes.length},t.prototype.getId=function(){return this.id},t.prototype.getName=function(){return this.name},t.prototype.getRootEntity=function(){return this.rootEntity},t.prototype.getEditorById=function(t){for(var e=0,n=this.editors;e<n.length;e++){var o=n[e];if(o.id===t)return o}return null},t.prototype.getAttributeById=function(t){var e=this.getEntityAttrById(this.getRootEntity(),t);return e||null},t.prototype.checkAttrProperty=function(t,e){var n=this.getAttributeById(t);if(n){if(void 0===n[e])throw"No such property: "+e;return!!n[e]||!!n.lookupAttr&&(t=n.lookupAttr,(n=this.getAttributeById(t))&&n[e])}return!1},t.prototype.getEntityAttrById=function(t,e){var n,o;if(t.attributes){var i=t.attributes.length;for(n=0;n<i;n++)if(t.attributes[n].id==e)return t.attributes[n]}if(t.subEntities){var r=t.subEntities.length;for(n=0;n<r;n++)if(o=this.getEntityAttrById(t.subEntities[n],e))return o}return null},t.prototype.listByEntityWithFilter=function(t,e){var n,o=new Array,i=null;if(t.subEntities)for(var r=t.subEntities.length,s=0;s<r;s++){if(i=t.subEntities[s],!e||e(i,null))(n=c.a.getText("Entities",i.name))||(n=i.caption),(h=d.a.assign(this.createEntity(),{id:i.name,text:n,items:[],isEntity:!0})).items=this.listByEntityWithFilter(i,e),h.items.length>0&&o.push(h)}var a=null;if(t.attributes)for(var l=t.attributes.length,u=0;u<l;u++)if(a=t.attributes[u],!e||e(t,a)){(n=c.a.getText("Attributes",a.id))||(n=a.caption);var h=d.a.assign(this.createEntity(),{id:a.id,text:n,dataType:a.dataType});o.push(h)}return o},t.prototype.listByEntity=function(t,e,n){e=e||{};var o,i=[],r=[],s=null;if(t.subEntities)for(var a=t.subEntities.length,l=0;l<a;l++)if(s=t.subEntities[l],!n||n(s,null)){o=c.a.getText("Entities",s.name)||s.caption;var u=d.a.assign(this.createEntity(),{id:s.name,text:o,items:[],isEntity:!0,description:s.description}),h=d.a.assign({},e);h.includeRootData=!1,u.items=this.listByEntity(s,h,n),u.items.length>0&&i.push(u)}var p=null;if(t.attributes)for(var f=t.attributes.length,g=0;g<f;g++)p=t.attributes[g],n&&!n(t,p)||(o=c.a.getText("Attributes",p.id)||p.caption,r.push(d.a.assign(this.createEntityAttr(t),{id:p.id,text:o,dataType:p.dataType,lookupAttr:p.lookupAttr,description:p.description})));var y,m=function(t,e){return t.text.toLowerCase()==e.text.toLowerCase()?0:t.text.toLowerCase()>e.text.toLowerCase()?1:-1};return e.sortEntities&&(i.sort(m),r.sort(m)),y=e.attrPlacement&&0!=e.attrPlacement?r.concat(i):i.concat(r),2==e.attrPlacement&&y.sort(m),e.includeRootData?((o=c.a.getText("Entities",t.name))||(o=t.caption),{id:t.name,text:o,items:y}):y},t.prototype.clear=function(){this.rootEntity=this.createEntity(),this.editors=[],this.version=""},t.prototype.addDefaultValueEditors=function(){this.addOrUpdateValueEditor("_DTE",s.Edit,i.a.String).defValue="",this.addOrUpdateValueEditor("_DPDE",s.DateTime,i.a.DateTime),this.addOrUpdateValueEditor("_DPTE",s.DateTime,i.a.DateTime)},t.prototype.addOrUpdateValueEditor=function(t,e,n){var o=d.a.findItemById(this.editors,t);return o||((o=this.createValueEditor()).id=t,this.editors.push(o)),o.tag=e,o.resType=n,o},t.prototype.getEntitiesTree=function(t,e){return this.listByEntity(this.getRootEntity(),t,e)},t.prototype.getEntitiesTreeWithFilter=function(t){return this.listByEntityWithFilter(this.getRootEntity(),t)},t.prototype.getFullEntityPathByAttr=function(t,e){return e=e||" ",this.getEntityPathByAttr(this.getRootEntity(),t,e,!0)},t.prototype.getEntityPathByAttr=function(t,e,n,o){if(!t)return"";n=n||" ";var i="";if(t.caption&&!o){var r=c.a.getText("Entities",t.caption);i=r||t.caption}if(t.attributes)for(var s=t.attributes.length,a=0;a<s;a++)if(t.attributes[a].id==e)return i;if(t.subEntities){var l=t.subEntities.length;for(a=0;a<l;a++){var u=t.subEntities[a],d=this.getEntityPathByAttr(u,e,n,!1);if(""!==d)return""!==i&&(d=i+n+d),d}}return""},t.prototype.getAttributeText=function(t,e){var n=c.a.getText("Attributes",t.id);if(n||(n=t.caption),!e)return n;var o=this.getFullEntityPathByAttr(t.id," ");return(o?e.replace(new RegExp("{attr}","g"),n).replace(new RegExp("{entity}","g"),o):n).trim()},t.prototype.runThroughEntities=function(t,e){this.getRootEntity().scan(t,e)},t.prototype.getFirstAttributeByFilter=function(t){var e=null;return this.runThroughEntities((function(n,o){t(n)&&(o.stop=!0,e=n)}),null),e},t}(),y=function(){return y=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},y.apply(this,arguments)},m=function(){function t(t){this.colStore=t,this.aggregates=[],this.groups=[],this.useGrandTotals=!1,this.useRecordCount=!1,this._caseSensitiveGroups=!1,this.COUNT_FIELD_NAME="GRPRECCNT"}return Object.defineProperty(t.prototype,"caseSensitiveGroups",{get:function(){return this._caseSensitiveGroups},set:function(t){this._caseSensitiveGroups=t,this.updateCompareProc()},enumerable:!0,configurable:!0}),t.prototype.updateCompareProc=function(){this.compareValues=this._caseSensitiveGroups?this.strictCompare:this.caseInsensitiveCompare},t.prototype.addGroup=function(t){var e=t.columns||this.colStore.getColumnIds(t.from,t.to);if(!this.colStore.validateColumns(e))throw"Invalid columns: "+e;if(this.hasColumnsInUse(e))throw"Can't add same columns to different groups/aggregates";return this.groups.push(y({columns:e},t)),this},t.prototype.addAggregateColumn=function(t,e){var n="string"==typeof t?t:this.colStore.getColumnIds(t,t)[0];if(this.hasColumnsInUse([n])||!this.colStore.validateAggregate(n,e))throw"Invalid aggregation function for the column: "+n;return this.aggregates.push({colId:n,funcId:e}),this},t.prototype.addGrandTotals=function(){return this.useGrandTotals=!0,this},t.prototype.addCounts=function(){return this.useRecordCount=!0,this},t.prototype.getGroups=function(){var t=this,e=[];return this.groups.map((function(n){return e=e.concat(n.columns),y(y({},n),{columns:Array.from(e),aggregates:Array.from(t.aggregates)})}))},t.prototype.getInternalGroups=function(){return this.groups},t.prototype.lastGroup=function(){var t=this.getGroups();return t[t.length-1]},t.prototype.getAggregates=function(){return this.aggregates},t.prototype.hasAggregates=function(){return this.aggregates.length>0},t.prototype.hasGroups=function(){return this.groups.length>0},t.prototype.hasGrandTotals=function(){return this.useGrandTotals},t.prototype.hasRecordCount=function(){return this.useRecordCount},t.prototype.isEmpty=function(){return!(this.hasAggregates()||this.hasGroups()||this.hasAggregates()||this.hasRecordCount())},t.prototype.drop=function(){console.warn('"drop()" method is obsolete. Use "clear()" instead'),this.clear()},t.prototype.clear=function(){return this.groups=[],this.aggregates=[],this.useGrandTotals=!1,this.useRecordCount=!1,this.caseSensitiveGroups=!1,this},t.prototype.hasColumnsInUse=function(t){for(var e=0,n=this.groups;e<n.length;e++){if(n[e].columns.filter((function(e){return t.indexOf(e)>=0})).length>0)return!0}for(var o=0,i=this.aggregates;o<i.length;o++){var r=i[o];if(t.indexOf(r.colId)>=0)return!0}return!1},t.prototype.needAggrCalculation=function(){return(this.hasAggregates()||this.hasRecordCount())&&(this.hasGrandTotals()||this.hasGroups())},t.prototype.saveToData=function(){return{groups:Array.from(this.groups),ugt:this.useGrandTotals,urc:this.useRecordCount,csg:this.caseSensitiveGroups,aggregates:Array.from(this.aggregates)}},t.prototype.loadFromData=function(t){t&&(void 0!==t.ugt&&(this.useGrandTotals=t.ugt),void 0!==t.urc&&(this.useRecordCount=t.urc),void 0!==t.csg&&(this.caseSensitiveGroups=t.csg),t.groups&&(this.groups=Array.from(t.groups)),t.aggregates&&(this.aggregates=Array.from(t.aggregates)))},t.prototype.buildGroupKey=function(t,e){var n=!this.caseSensitiveGroups,o={};if(t)for(var i=0,r=t.columns;i<r.length;i++){var s=r[i],a=e.getValue(s);n&&"string"==typeof a&&(a=a.toLowerCase()),o[s]=a}return o},t.prototype.strictCompare=function(t,e){return t===e},t.prototype.caseInsensitiveCompare=function(t,e){return("string"==typeof t?t.toLowerCase():t)===("string"==typeof e?e.toLowerCase():e)},t}(),v=n(58),b=n(49),C=n(103),x=function(){function t(){}return t.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))},t}(),w=function(){function t(t){this.silentMode=0,this.events=new Array,this.source=t}return t.prototype.subscribe=function(t,e){var n=this.getEventRecByType(t),o={id:x.newGuid(),callback:e};return n?n.eventCallbacks.push(o):(n={type:t,eventCallbacks:new Array(o)},this.events.push(n)),o.id},t.prototype.unsubscribe=function(t,e){var n=this.getEventRecByType(t);if(n){var o=-1;for(o=0;o<n.eventCallbacks.length&&n.eventCallbacks[o].id!==e;o++);o>=0&&n.eventCallbacks.splice(o,1)}},t.prototype.fire=function(t,e,n,o){if(void 0===n&&(n=0),void 0===o&&(o=!1),!this.silentMode||o){var i=this.getEventRecByType(t);if(i){var r={type:t,source:this.source,data:e},s=function(){for(var t=0,e=i.eventCallbacks;t<e.length;t++){e[t].callback(r)}};n>0?setTimeout(s,n):s()}}},t.prototype.enterSilentMode=function(){this.silentMode++},t.prototype.exitSilentMode=function(){this.silentMode&&this.silentMode--},t.prototype.isSilent=function(){return this.silentMode>0},t.prototype.getEventRecByType=function(t){for(var e=0,n=this.events;e<n.length;e++){var o=n[e];if(o.type==t)return o}return null},t}(),T=n(48);!function(t){t.renderLiquidTemplate=function(t,e){var n=t;if(e)for(var o in e){var i=new RegExp("{{"+o+"}}","g");n=n.replace(i,e[o])}return n}}(r||(r={})),c.a.resetLocales(),"function"!=typeof Object.values&&(Object.values=function(t){return Object.keys(t).map((function(e){return t[e]}))}),"function"!=typeof Math.trunc&&(Math.trunc=function(t){return isNaN(t)?NaN:t>0?Math.floor(t):Math.ceil(t)})},function(t,e,n){"use strict";n.r(e),n.d(e,"EasyGrid",(function(){return i.a})),n.d(e,"AutoResizeColumns",(function(){return r.a})),n.d(e,"GridColumnAlign",(function(){return s.b})),n.d(e,"GridColumn",(function(){return s.a})),n.d(e,"GridColumnList",(function(){return s.c})),n.d(e,"DFMT_REGEX",(function(){return a.b})),n.d(e,"CellRendererType",(function(){return a.a})),n.d(e,"GridCellRendererStore",(function(){return a.c})),n.d(e,"Calendar",(function(){return l})),n.d(e,"DateTimePicker",(function(){return c})),n.d(e,"DefaultCalendar",(function(){return f})),n.d(e,"DefaultDateTimePicker",(function(){return b})),n.d(e,"DefaultTimePicker",(function(){return m})),n.d(e,"TimePicker",(function(){return g})),n.d(e,"browserUtils",(function(){return C.a})),n.d(e,"DomElementBuilder",(function(){return h.a})),n.d(e,"DomTextAreaElementBuilder",(function(){return h.d})),n.d(e,"DomInputElementBuilder",(function(){return h.b})),n.d(e,"DomSelectElementBuilder",(function(){return h.c})),n.d(e,"domel",(function(){return h.e})),n.d(e,"DropEffect",(function(){return x.b})),n.d(e,"EqDragEvent",(function(){return x.c})),n.d(e,"DragManager",(function(){return x.a})),n.d(e,"eqDragManager",(function(){return x.d})),n.d(e,"mask",(function(){return w.a})),n.d(e,"wrapInner",(function(){return u.q})),n.d(e,"addElement",(function(){return u.b})),n.d(e,"addCssClass",(function(){return u.a})),n.d(e,"hideElement",(function(){return u.k})),n.d(e,"showElement",(function(){return u.m})),n.d(e,"toggleVisibility",(function(){return u.p})),n.d(e,"isVisible",(function(){return u.l})),n.d(e,"createBrowserEvent",(function(){return u.c})),n.d(e,"getViewportSize",(function(){return u.i})),n.d(e,"getDocSize",(function(){return u.f})),n.d(e,"getScrollPos",(function(){return u.h})),n.d(e,"getElementAbsolutePos",(function(){return u.g})),n.d(e,"getWinSize",(function(){return u.j})),n.d(e,"slideDown",(function(){return u.n})),n.d(e,"slideUp",(function(){return u.o})),n.d(e,"eqCssPrefix",(function(){return u.e})),n.d(e,"eqCssMobile",(function(){return u.d})),n.d(e,"DefaultDialogService",(function(){return T.b})),n.d(e,"DefaultDialog",(function(){return T.a})),n.d(e,"DefaultProgressDialog",(function(){return T.d})),n.d(e,"DefaultDialogSet",(function(){return T.c})),n.d(e,"DialogFooterAlignment",(function(){return E.a})),n.d(e,"dialogs",(function(){return D}));var o,i=n(106),r=n(34),s=n(22),a=n(39),l=function(){function t(t,e){this.slot=t,this.options=e||{},this.options.yearRange||(this.options.yearRange="c-10:c+10")}return Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"kdtp-cal"},enumerable:!0,configurable:!0}),t.prototype.setDate=function(t){this.currentDate=new Date(t)},t.prototype.getDate=function(){return new Date(this.currentDate)},t.prototype.dateChanged=function(t){this.options.onDateChanged&&this.options.onDateChanged(this.currentDate,t)},t}(),u=n(18),c=function(){function t(t){this.calendar=null,this.timePicker=null,this.options=t,this.render()}return Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"kdtp"},enumerable:!0,configurable:!0}),t.prototype.setDateTime=function(t){this.currentDateTime=new Date(t),this.calendar&&this.calendar.setDate(this.currentDateTime),this.timePicker&&this.timePicker.setTime(this.currentDateTime)},t.prototype.getDateTime=function(){return new Date(this.currentDateTime)},t.prototype.render=function(){var t=this;this.options.showCalendar&&(this.calendar=this.createCalendar({yearRange:this.options.yearRange,showDateTimeInput:this.options.showDateTimeInput,timePickerIsUsed:this.options.showTimePicker,oneClickDateSelection:this.options.oneClickDateSelection,onDateChanged:function(e,n){t.currentDateTime=e,t.timePicker&&t.timePicker.setTime(t.currentDateTime),t.options.showTimePicker&&t.dateTimeChanged(),n&&t.apply(t.currentDateTime)}}),this.calendar&&this.calendar.render()),this.options.showTimePicker&&(this.timePicker=this.createTimePicker({onTimeChanged:function(e){t.currentDateTime.setHours(e.getHours()),t.currentDateTime.setMinutes(e.getMinutes()),t.calendar&&t.calendar.setDate(t.currentDateTime),t.dateTimeChanged()}}),this.timePicker&&this.timePicker.render()),this.setDateTime(new Date)},t.prototype.createCalendar=function(t){return null},t.prototype.createTimePicker=function(t){return null},t.prototype.show=function(t){this.options.beforeShow&&this.options.beforeShow();var e=Object(u.g)(t||document.body);this.slot.style.top=e.y+t.clientHeight+"px",this.slot.style.left=e.x+"px"},t.prototype.apply=function(t){this.options.onApply&&this.options.onApply(t),this.destroy()},t.prototype.cancel=function(){this.options.onCancel&&this.options.onCancel(),this.destroy()},t.prototype.destroy=function(){this.slot&&this.slot.parentElement&&this.slot.parentElement.removeChild(this.slot)},t.prototype.dateTimeChanged=function(){this.options.onDateTimeChanged&&this.options.onDateTimeChanged(this.currentDateTime)},t}(),d=n(0),h=n(6),p=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),f=function(t){function e(e,n){var o=t.call(this,e,n)||this;o.daysOfWeek=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],o.months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],o.calendarBody=null,o.isManualInputChanging=!1;for(var i=0;i<o.daysOfWeek.length;i++)o.daysOfWeek[i]=d.i18n.getShortWeekDayName(i+1);for(i=0;i<o.months.length;i++)o.months[i]=d.i18n.getLongMonthName(i+1);return o}return p(e,t),e.prototype.setDate=function(e){t.prototype.setDate.call(this,e),this.selectedMonth=this.currentDate.getMonth(),this.selectedYear=this.currentDate.getFullYear(),this.rerenderMonth()},e.prototype.render=function(){var t=this,e=Object(h.e)("div",this.slot).addClass(this.cssPrefix+"-header");this.options.showDateTimeInput?e.addChildElement(this.renderManualDateInput()):e.addChild("span",(function(e){return t.headerTextElem=e.toDOM()})),Object(h.e)(this.slot).addChildElement(this.renderCalendarButtons()),this.calendarBody=Object(h.e)("div",this.slot).addClass(this.cssPrefix+"-body").toDOM()},e.prototype.getInputDateFormat=function(){var t=d.i18n.getLocaleSettings();return this.options.timePickerIsUsed?t.editDateFormat+" "+t.editTimeFormat:t.editDateFormat},e.prototype.renderManualDateInput=function(){var t=this,e=this.getInputDateFormat(),n=Object(h.e)("input").attr("placeholder",e).addClass(this.cssPrefix+"-header-input");return n.mask(e.replace("yyyy","9999").replace("MM","99").replace("dd","99").replace("HH","99").replace("mm","99").replace("ss","99")).on("input",(function(o){n.removeClass("error");try{t.isManualInputChanging=!0;var i=d.utils.strToDateTime(t.manualInputElem.value,e);t.currentDate=i,t.jump(t.currentDate.getFullYear(),t.currentDate.getMonth()),t.dateChanged(!1)}catch(t){n.addClass("error")}finally{t.isManualInputChanging=!1}})).on("keydown",(function(e){13===e.keyCode&&(e.preventDefault(),e.stopPropagation(),t.manualInputElem.className.indexOf("error")<0&&!t.isManualInputChanging&&t.dateChanged(!0))})).on("focus",(function(){setTimeout((function(){t.manualInputElem.selectionStart=0,t.manualInputElem.selectionEnd=0}),50)})),this.manualInputElem=n.toDOM(),this.manualInputElem},e.prototype.updateDisplayedDateValue=function(){if(this.manualInputElem){if(!this.isManualInputChanging){var t=this.getInputDateFormat();this.manualInputElem.value=d.utils.dateTimeToStr(this.currentDate,t),this.manualInputElem.focus()}}else if(this.headerTextElem){var e=d.i18n.getCurrentLocale();this.headerTextElem.innerText=this.currentDate.toLocaleString("en"==e?void 0:e,{year:"numeric",month:"long",day:"numeric"})}},e.prototype.renderCalendarButtons=function(){var t=this;return Object(h.e)("nav").addClass(this.cssPrefix+"-nav").addChild("div",(function(e){return e.addClass(t.cssPrefix+"-nav-prev").on("click",(function(){t.prev()})).addChild("span",(function(t){return t.html("&lsaquo;")}))})).addChild("div",(function(e){return e.addClass(t.cssPrefix+"-nav-selectors").addChild("div",(function(e){return e.addClass(t.cssPrefix+"-nav-month").addChild("select",(function(e){e.on("change",(function(){t.jump(t.selectedYear,parseInt(t.selectMonthElem.value))}));for(var n=function(n){e.addChild("option",(function(e){return e.attr("value",n.toString()).text(t.months[n])}))},o=0;o<t.months.length;o++)n(o);t.selectMonthElem=e.toDOM()}))})).addChild("div",(function(e){return e.addClass(t.cssPrefix+"-nav-year").addChild("select",(function(e){return t.selectYearElem=e.on("change",(function(){t.jump(parseInt(t.selectYearElem.value),t.selectedMonth)})).toDOM()}))}))})).addChild("div",(function(e){return e.addClass(t.cssPrefix+"-nav-next").on("click",(function(){t.next()})).addChild("span",(function(t){return t.html("&rsaquo;")}))})).toDOM()},e.prototype.prev=function(){this.selectedYear=0===this.selectedMonth?this.selectedYear-1:this.selectedYear,this.selectedMonth=0===this.selectedMonth?11:this.selectedMonth-1,this.rerenderMonth()},e.prototype.next=function(){this.selectedYear=11===this.selectedMonth?this.selectedYear+1:this.selectedYear,this.selectedMonth=(this.selectedMonth+1)%12,this.rerenderMonth()},e.prototype.rerenderSelectYear=function(){var t=/c-(\d*):c\+(\d*)/g.exec(this.options.yearRange),e=0,n=1;null!==t&&(e=parseInt(t[1]),n=parseInt(t[2])),this.selectYearElem.innerHTML="";for(var o=0;o<=e+n;o++){var i=document.createElement("option"),r=this.selectedYear-e+o;i.value=r.toString(),i.innerText=r.toString(),this.selectYearElem.appendChild(i)}},e.prototype.jump=function(t,e){this.selectedYear=t,this.selectedMonth=e,this.rerenderMonth()},e.prototype.rerenderMonth=function(){var t=this;this.updateDisplayedDateValue(),this.rerenderSelectYear();var e=new Date(this.selectedYear,this.selectedMonth).getDay(),n=new Date(this.selectedYear,this.selectedMonth+1,0).getDate();this.calendarBody.innerHTML="",this.selectYearElem.value=this.selectedYear.toString(),this.selectMonthElem.value=this.selectedMonth.toString(),this.daysOfWeek.forEach((function(e,n){Object(h.e)("div",t.calendarBody).addClass(t.cssPrefix+"-weekday").addClass(0==n||6==n?t.cssPrefix+"-weekend":"").text(e)}));for(var o=0;o<e;o++)Object(h.e)("div",this.calendarBody).addClass(this.cssPrefix+"-day-empty");for(var i=new Date,r=1;r<=n;r++){var s=Object(h.e)("div",this.calendarBody).addClass(this.cssPrefix+"-day").attr("data-date",r.toString()).text(r.toString()).on("click",(function(e){t.currentDate.setFullYear(t.selectedYear),t.currentDate.setMonth(t.selectedMonth),t.currentDate.setDate(parseInt(e.target.getAttribute("data-date"))),t.dateChanged(t.options.oneClickDateSelection)}));r===i.getDate()&&this.selectedYear===i.getFullYear()&&this.selectedMonth===i.getMonth()&&s.addClass(this.cssPrefix+"-day-current"),r===this.currentDate.getDate()&&this.selectedYear===this.currentDate.getFullYear()&&this.selectedMonth===this.currentDate.getMonth()&&s.addClass(this.cssPrefix+"-day-selected");var a=(e+r-1)%7;0!=a&&6!=a||s.addClass(this.cssPrefix+"-weekend")}var l=(e+n)%7,u=0==l?0:7-l;for(o=0;o<u;o++)Object(h.e)("div",this.calendarBody).addClass(this.cssPrefix+"-day-empty")},e.prototype.dateChanged=function(e){t.prototype.dateChanged.call(this,e),this.rerenderMonth()},e}(l),g=function(){function t(t,e){this.slot=t,this.options=e||{}}return Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"kdtp-tp"},enumerable:!0,configurable:!0}),t.prototype.setTime=function(t){this.currentTime=new Date(t)},t.prototype.getTime=function(){return new Date(this.currentTime)},t.prototype.timeChanged=function(){this.options.onTimeChanged&&this.options.onTimeChanged(this.currentTime)},t}(),y=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return y(e,t),e.prototype.setTime=function(e){t.prototype.setTime.call(this,e),this.updateDisplayedTime(),this.hoursInput.valueAsNumber=e.getHours(),this.minutesInput.valueAsNumber=e.getMinutes()},e.prototype.render=function(){var t=this;Object(h.e)("div",this.slot).addClass(this.cssPrefix+"-time").addChild("span",(function(e){return t.timeText=e.toDOM()})).toDOM();var e=Object(h.e)("div",this.slot).addClass(this.cssPrefix+"-sliders");return e.addChild("div",(function(e){return e.addClass(t.cssPrefix+"-time-row").title("Hours").addChild("input",(function(e){return t.hoursInput=e.addClass(t.cssPrefix+"-input-hours").type("range").attr("min","0").attr("max","23").attr("step","1").on("input",(function(e){t.currentTime.setHours(t.hoursInput.valueAsNumber),t.updateDisplayedTime(),t.timeChanged()})).toDOM()}))})),e.addChild("div",(function(e){return e.addClass(t.cssPrefix+"-time-row").title("Minutes").addChild("input",(function(e){return t.minutesInput=e.addClass(t.cssPrefix+"-input-minutes").type("range").attr("min","0").attr("max","59").attr("step","1").on("input",(function(e){t.currentTime.setMinutes(t.minutesInput.valueAsNumber),t.updateDisplayedTime(),t.timeChanged()})).toDOM()}))})),this.slot},e.prototype.updateDisplayedTime=function(){var t=d.i18n.getCurrentLocale(),e=this.currentTime.toLocaleString("en"==t?void 0:t,{hour:"numeric",minute:"numeric"});this.timeText.innerText=e},e}(g),v=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),b=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v(e,t),e.prototype.render=function(){var e=this,n=Object(h.e)("div",document.body).addClass(""+this.cssPrefix).attr("tabIndex","0").setStyle("position","absolute").setStyle("top","-1000px").setStyle("left","-1000px").on("keydown",(function(t){return 27===t.keyCode?e.cancel():13===t.keyCode&&e.apply(e.getDateTime()),!1}));this.options.zIndex&&n.setStyle("z-index",""+this.options.zIndex),this.slot=n.toDOM(),t.prototype.render.call(this),this.renderButtons(),this.globalMouseDownHandler=function(t){var n=window.event||t;n.srcElement||n.target;return!e.slot.contains(n.target)&&(document.removeEventListener("mousedown",e.globalMouseDownHandler,!0),e.cancel()),!0}},e.prototype.renderButtons=function(){var t=this,e=Object(h.e)("div",this.slot).addClass(this.cssPrefix+"-buttons").addChild("button",(function(e){return t.nowButton=e.addClass(t.cssPrefix+"-button "+t.cssPrefix+"-button-now").text(d.i18n.getText("ButtonNow")).on("click",(function(){return t.setDateTime(new Date),t.dateTimeChanged(),!1})).toDOM()}));!this.options.showTimePicker&&this.options.oneClickDateSelection||e.addChild("button",(function(e){return t.submitButton=e.addClass(t.cssPrefix+"-button "+t.cssPrefix+"-button-apply").text(d.i18n.getText("ButtonApply")).on("click",(function(){return t.apply(t.getDateTime()),!1})).toDOM()})),e.addChild("button",(function(e){return t.submitButton=e.addClass(t.cssPrefix+"-button "+t.cssPrefix+"-button-cancel").text(d.i18n.getText("ButtonCancel")).on("click",(function(){return t.cancel(),!1})).toDOM()}))},e.prototype.createCalendar=function(t){return this.calendarSlot=Object(h.e)("div",this.slot).addClass(this.cssPrefix+"-cal").toDOM(),new f(this.calendarSlot,t)},e.prototype.createTimePicker=function(t){return this.timePickerSlot=Object(h.e)("div",this.slot).addClass(this.cssPrefix+"-tp").toDOM(),new m(this.timePickerSlot,t)},e.prototype.show=function(e){var n=this;if(this.options.showDateTimeInput){this.options.beforeShow&&this.options.beforeShow();var o=Object(u.g)(e||document.body),i=Object(u.g)(e?e.parentElement||e:document.body);this.slot.style.top=i.y+"px",this.slot.style.left=o.x+"px"}else t.prototype.show.call(this,e),this.slot.focus();setTimeout((function(){document.addEventListener("mousedown",n.globalMouseDownHandler,!0)}),1)},e}(c),C=n(68),x=n(37),w=n(69),T=n(70),E=n(71);d.i18n.updateDefaultTexts({GridPageInfo:"{FirstPageRecordNum} - {LastPageRecordNum} of {Total} records",GridItemsPerPage:"items per page",ButtonOK:"OK",ButtonCancel:"Cancel",ButtonApply:"Apply",ButtonNow:"Now",LblTotal:"Total"});var D=new T.b},function(t,e,n){"use strict";n.r(e),n.d(e,"equtils",(function(){return i.a})),n.d(e,"eqconsts",(function(){return o})),n.d(e,"EqServiceProvider",(function(){return b})),n.d(e,"Tree",(function(){return C.a})),n.d(e,"EasyQueryDataLoader",(function(){return x.a})),n.d(e,"GoogleDataConverter",(function(){return w.a})),n.d(e,"EqAggregatesContainer",(function(){return v.b})),n.d(e,"DefaultAggregatesCalculator",(function(){return v.a})),n.d(e,"DataKind",(function(){return T.a})),n.d(e,"LinkType",(function(){return E.a})),n.d(e,"CondTag",(function(){return D.a})),n.d(e,"ConditionPart",(function(){return S.a})),n.d(e,"ExprTag",(function(){return k.a})),n.d(e,"EqEditorTag",(function(){return M.a})),n.d(e,"WidgetGroup",(function(){return s})),n.d(e,"AggrFunction",(function(){return O.a})),n.d(e,"DataModel",(function(){return u.a})),n.d(e,"Entity",(function(){return A.a})),n.d(e,"EntityAttr",(function(){return A.b})),n.d(e,"Operator",(function(){return P.b})),n.d(e,"Operand",(function(){return P.a})),n.d(e,"EqValueEditor",(function(){return B.a})),n.d(e,"EqAction",(function(){return I})),n.d(e,"EqModelLoader",(function(){return d.a})),n.d(e,"InMemoryModelStorage",(function(){return L.a})),n.d(e,"BrowserQueryStorage",(function(){return c.a})),n.d(e,"EqContext",(function(){return j})),n.d(e,"Widget",(function(){return q})),n.d(e,"EqActionResult",(function(){return _})),n.d(e,"SortDirection",(function(){return N.b})),n.d(e,"QueryColumn",(function(){return N.a})),n.d(e,"Condition",(function(){return H.a})),n.d(e,"Expression",(function(){return W.a})),n.d(e,"InvalidQueryError",(function(){return l.a})),n.d(e,"Query",(function(){return l.b})),n.d(e,"QueryChangePart",(function(){return R.b})),n.d(e,"QueryChangeAction",(function(){return R.a})),n.d(e,"EqServerExporter",(function(){return F})),n.d(e,"EqServerModelLoader",(function(){return p})),n.d(e,"EqServerDataFetcher",(function(){return f})),n.d(e,"EqServerQuerySynchronizer",(function(){return g})),n.d(e,"EqServerValueListResolver",(function(){return y})),n.d(e,"EqQueryFileLoader",(function(){return m})),n.d(e,"FormatParser",(function(){return G.a})),n.d(e,"versionInfo",(function(){return V})),n.d(e,"i18n",(function(){return a.i18n}));var o,i=n(14);!function(t){var e=function(){this.SpecDateValues=[{id:"${Today}",key:"Today",isDefault:!0},{id:"${Yesterday}",key:"Yesterday"},{id:"${Tomorrow}",key:"Tomorrow"},{id:"${FirstDayOfMonth}",key:"FirstDayOfMonth"},{id:"${FirstDayOfYear}",key:"FirstDayOfYear"}],this.SpecTimeValues=[{id:"${Now}",key:"Now",isDefault:!0},{id:"${HourStart}",key:"HourStart"},{id:"${Midnight}",key:"Midnight"},{id:"${Noon}",key:"Noon"}],this.BooleanValues=[{id:"${false}",key:"False"},{id:"${true}",key:"True",isDefault:!0}]};t.constLists=new e,t.predicateLinkTypeList=[{id:"All",key:"LinkTypeAll"},{id:"Any",key:"LinkTypeAny"},{id:"None",key:"LinkTypeNone"},{id:"NotAll",key:"LinkTypeNotAll"}]}(o||(o={}));var r,s,a=n(0),l=n(29),u=n(38),c=n(63),d=n(64),h=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),p=function(t){function e(e){return t.call(this,e)||this}return h(e,t),e.prototype.init=function(){},e.prototype.sendLoadModelRequest=function(t){var e=this,n=this.getContext(),o=n.getServices().getHttpClient(),i=n.resolveEndpoint("GetModel",{modelId:t.modelId});o.get(i).then((function(t){t.model||e.modelLoadingRejectFunc(new Error('Wrong response format for "GetModel" request')),e.modelLoadingResolveFunc(t.model)})).catch((function(t){e.modelLoadingRejectFunc(t)}))},e}(d.a),f=function(){function t(t){this.context=t}return t.prototype.fetchData=function(t){var e=t.query||this.context.getQuery(),n=e.getId(),o={options:t.options};void 0!==t.queryId?o.queryId=t.queryId:o.query=e.toJSONData(),t.debug&&(o.debug=t.debug),t.chunk&&(o.chunk=t.chunk),t.data&&(o.data=t.data),void 0!==t.aux&&(o.aux=t.aux);var i=this.context.resolveEndpoint("FetchData",{modelId:e.getModel().getId(),queryId:n});return this.context.getServices().getHttpClient().post(i,o).then((function(t){return t}))},t}(),g=function(){function t(t){this.context=t}return t.prototype.syncQuery=function(t){var e=(t=t||{}).query||this.context.getQuery(),n=t.options||{},o={query:e.toJSONData(),options:n};t.data&&(o.data=t.data);var i=this.context.resolveEndpoint("SyncQuery",{modelId:e.getModel().getId(),queryId:e.getId()});return this.context.getServices().getHttpClient().post(i,o).then((function(t){return t}))},t}(),y=function(){function t(t){this.context=t}return t.prototype.loadValueList=function(t){var e=t.modelId||this.context.getModel().getId(),n=a.utils.assign({modelId:e},t.params).editorId,o=this.context.getServices().getHttpClient(),i=this.context.resolveEndpoint("GetValueList",{modelId:e,listId:n}),r={};return t&&t.params&&t.params.queryParams&&(r=t.params.queryParams),o.get(i,{queryParams:r}).then((function(t){if(t&&t.values)return t.values;throw new Error('Wrong response format. No "values" property')}))},t}(),m=function(){function t(t){this.context=t}return t.prototype.getQueryFile=function(t){var e=t.query||this.context.getQuery(),n=this.context.resolveEndpoint("GetQueryFile",{modelId:e.getModel().getId(),format:t.format||"xml"}),o=this.context.getServices().getHttpClient().post(n,{query:e.toJSONData()}),i=o.getRequest();return o.then((function(e){var n=new Blob([e]),o=i.getXMLHttpRequest().getResponseHeader("Content-Disposition"),r=o?o.match(/filename="(.*)"/)[1]:"query.json";if(t.fileName&&(r=t.fileName+r.substring(r.lastIndexOf("."))),window.navigator.msSaveOrOpenBlob)window.navigator.msSaveOrOpenBlob(n,r);else{var s=document.createElement("a");document.body.appendChild(s),s.style.display="none",s.href=window.URL.createObjectURL(n),s.download=r,s.click(),window.URL.revokeObjectURL(s.href),document.body.removeChild(s)}}))},t.prototype.uploadQueryFile=function(t){var e=(t=t||{}).query||this.context.getQuery(),n=this.context.resolveEndpoint("UploadQueryFile",{modelId:e.getModel().getId()});return this.context.getServices().getHttpClient().post(n,t.data,{dataType:"form-data"}).then((function(t){return t.query}))},t}(),v=n(65),b=function(){function t(t){this.context=t,this.modelLoader=null,this.queryStorage=null,this.querySynchronizer=null,this.dataFetcher=null,this.valueListResolver=null,this.queryFileLoader=null,this.aggrCalculator=null,this.httpClient=new a.HttpClient,this.httpClient.defaultHeaders["x-eqjs-version"]="7.2.0",this.modelResolver=function(t){return new u.a},this.modelStorageResolver=null,this.queryResolver=function(t){return new l.b(t.getModel())},this.modelLoaderResolver=function(t){return new p(t)},this.queryStorageResolver=function(t){return new c.a(t)},this.querySynchronizerResolver=function(t){return new g(t)},this.vlrResolver=function(t){return new y(t)},this.dataFetcherResolver=function(t){return new f(t)},this.queryFileLoaderResolver=function(t){return new m(t)},this.aggrCalculatoResolver=function(t){return new v.a(t)}}return t.prototype.reset=function(){this.modelStorage=null,this.modelLoader=null,this.queryStorage=null,this.querySynchronizer=null},t.prototype.getHttpClient=function(){return this.httpClient},t.prototype.createDataModel=function(){if(!this.modelResolver)throw"Model resolver is not defined";return this.modelResolver(this.context)},t.prototype.createQuery=function(){if(!this.queryResolver)throw"Query resolver is not defined";return this.queryResolver(this.context)},t.prototype.getModelLoader=function(){if(!this.modelLoader){if(!this.modelLoaderResolver)throw"ModelLoaderResolver is not defined";this.modelLoader=this.modelLoaderResolver(this.context)}return this.modelLoader},t.prototype.getModelStorage=function(){if(!this.modelStorage){if(!this.modelStorageResolver)throw"ModelStorageResolver is not defined";this.modelStorage=this.modelStorageResolver(this.context)}return this.modelStorage},t.prototype.getQueryStorage=function(){if(!this.queryStorage){if(!this.queryStorageResolver)throw"QueryStorageResolver is not defined";this.queryStorage=this.queryStorageResolver(this.context)}return this.queryStorage},t.prototype.getQuerySynchronizer=function(){if(!this.querySynchronizer){if(!this.querySynchronizerResolver)throw"QuerySynchronizerResolver is not defined";this.querySynchronizer=this.querySynchronizerResolver(this.context)}return this.querySynchronizer},t.prototype.getDataFetcher=function(){if(!this.dataFetcher){if(!this.dataFetcherResolver)throw"DataFetcherResolver is not defined";this.dataFetcher=this.dataFetcherResolver(this.context)}return this.dataFetcher},t.prototype.getValueListResolver=function(){if(!this.valueListResolver){if(!this.vlrResolver)throw"Resolver for ValueListResolver is not defined";this.valueListResolver=this.vlrResolver(this.context)}return this.valueListResolver},t.prototype.getQueryFileLoader=function(){if(!this.queryFileLoader){if(!this.queryFileLoaderResolver)throw"Resolver for QueryFileLoader is not defined";this.queryFileLoader=this.queryFileLoaderResolver(this.context)}return this.queryFileLoader},t.prototype.getAggregatesCalculator=function(){if(!this.aggrCalculator){if(!this.aggrCalculatoResolver)throw"Resolver for AggregatesCalculator is not defined";this.aggrCalculator=this.aggrCalculatoResolver(this.context)}return this.aggrCalculator},t.prototype.registerDataModelResolver=function(t){this.modelResolver=t},t.prototype.registerQueryResolver=function(t){this.queryResolver=t},t.prototype.registerModelLoaderResolver=function(t){this.modelLoaderResolver=t},t.prototype.registerModelStorageResolver=function(t){this.modelStorageResolver=t},t.prototype.registerQueryStorageResolver=function(t){this.queryStorageResolver=t},t.prototype.registerDataFetcherResolver=function(t){this.dataFetcherResolver=t},t.prototype.registerQuerySyncronizerResolver=function(t){this.querySynchronizerResolver=t},t.prototype.registerValueListResolver=function(t){this.vlrResolver=t},t.prototype.registerQueryFileLoaderResolver=function(t){this.queryFileLoaderResolver=t},t.prototype.registerAggregatesCalculator=function(t){this.aggrCalculatoResolver=t},t}(),C=n(61),x=n(66),w=n(104),T=n(12),E=n(16),D=n(19),S=n(62),k=n(8),M=n(27);!function(t){t[t.None=0]="None",t[t.Model=1]="Model",t[t.Query=2]="Query",t[t.Result=4]="Result",t[t.Statement=8]="Statement",t[t.QueryStatus=16]="QueryStatus",t[t.All=65535]="All"}(s||(s={}));var I,O=n(60),A=n(23),P=n(33),B=n(21);!function(t){t.LoadModel="LoadModel",t.LoadQuery="LoadQuery",t.LoadQueryList="LoadQueryList",t.NewQuery="NewQuery",t.SaveQuery="SaveQuery",t.RemoveQuery="RemoveQuery",t.SyncQuery="SyncQuery",t.FetchData="FetchData",t.GetValueList="GetValueList",t.ExportResult="ExportResult",t.GetQueryFile="GetQueryFile",t.UploadQueryFile="UploadQueryFile"}(I||(I={}));var _,L=n(105),R=n(13);!function(t){t[t.Error=0]="Error",t[t.Success=1]="Success"}(_||(_={}));var F=function(){function t(t){this.context=t}return t.prototype.setFormat=function(t,e){this.format=t,this.responseType=e},t.prototype.export=function(t){t=t||{};var e=this.context.getServices().getHttpClient(),n=this.format||"csv",o=t.query||this.context.getQuery(),i=o.getModel().getId(),r={settings:t.settings};void 0!==t.queryId?r.queryId=t.queryId:r.query=o.toJSONData(),t.data&&(r.data=t.data);var s=this.context.resolveEndpoint("ExportResult",{modelId:i,format:n}),a=e.post(s,r,{responseType:this.responseType}),l=a.getRequest();return a.then((function(t){var e=new Blob([t]),o=l.getXMLHttpRequest().getResponseHeader("Content-Disposition"),i=o?o.match(/filename="(.*)"/)[1]:"export-data."+n;if(window.navigator.msSaveOrOpenBlob)window.navigator.msSaveOrOpenBlob(e,i);else{var r=document.createElement("a");document.body.appendChild(r),r.style.display="none",r.href=window.URL.createObjectURL(e),r.download=i,r.click(),window.URL.revokeObjectURL(r.href),document.body.removeChild(r)}}))},t}(),Q=function(){return Q=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Q.apply(this,arguments)},j=function(){function t(){var t=this;this.servicesInitialized=!1,this.internalListCache={},this.loadModelOnStart=!0,this.loadQueryOnStart=!1,this.useStoredQueryOnFetch=!1,this.debugMode=!1,this._backendInfo={type:"EQN-ANC",subType:"asp-net-core-razor"},this.endpointVarsRegex=/\{.*?\}/g,this.elasticPaging=!1,this._predefinedListRequestHandlers={_DSDE:function(e,n){return n(t.getModel().getAllDateMacros().map((function(t){return{id:"${{"+t+"}}",text:a.i18n.getText(t)}}))),!0},_DSTE:function(e,n){return n(t.getModel().getAllTimeMacros().map((function(t){return{id:"${{"+t+"}}",text:a.i18n.getText(t)}}))),!0}},this._listRequestHandler=function(e,n){if(null!=e&&e.listName){var o=t.getQuery(),i=a.utils.assign({listName:e.listName},e.editorParams),r={},s=/@{{(.+?)}}/;for(var l in i)if(i[l]){var u=i[l].match(s);if(u){var c=o.getOneValueForAttr(u[1]);c||(c=""),r[l]=i[l].replace(s,c)}}var d={listName:r.listName,editorId:e.editorId,queryParams:r},h=t.getListFromCache(e);if(h&&h.length>0)n(h);else{var p=!1,f=t._predefinedListRequestHandlers[e.editorId];f&&(p=f(e,n)),!p&&t.clientListRequestHandler&&(p=t.clientListRequestHandler(e,n)),p||t.loadValueList({params:d,success:function(o){o&&t.addListToCache(e,o),n(o)},error:function(t){n(null)}})}}},this.baseEndpoint="api/easyquery",this.eqServices=new b(this),this.widgets=new Array,this.eventEmitter=new a.EventEmitter(this),this.exporters=new Map,this.endpoints=new Map,this.dataLoader=new x.a(this),this.resultTable=new a.EasyDataTable({loader:this.dataLoader,onUpdate:this.onResultTableUpdate.bind(this)}),this.resultTable.id="ResultTable",this.errorHandlerId=this.addEventListener("error",(function(t,e){e.result=_.Error;var n=e.action?e.action+" error":"Error",o=e.text?e.text:"";e.sourceError&&e.sourceError.message!==o&&(o+="\n"+e.sourceError),console.error(n+": "+o)}))}return t.prototype.getServices=function(){return this.eqServices},t.prototype.registerExporter=function(t,e){this.exporters.set(t,e)},t.prototype.registerServerExporter=function(t,e){this.registerExporter(t,(function(n){var o=new F(n);return o.setFormat(t,e),o}))},t.prototype.getExporter=function(t){var e=this.exporters.get(t);return e?e(this):null},t.prototype.getExportFormats=function(){return Array.from(this.exporters.keys())},t.prototype.addDefaultExporters=function(){this.registerServerExporter("csv",""),this.registerServerExporter("excel-html","")},t.prototype.resolveEndpoint=function(t,e){e=e||{};var n=this.endpoints.get(t);if(!n)throw t+" endpoint is not defined";var o=n.match(this.endpointVarsRegex);if(o)for(var i=0,r=o;i<r.length;i++){var s=r[i],a=s.substring(1,s.length-1),l=e[a];if(!l)if("modelId"==a)l=this.getModel().getId();else{if("queryId"!=a)throw"Parameter ["+a+"] is not defined";l=this.getQuery().getId()}n=n.replace(s,l)}return n},t.prototype.setEndpoint=function(t,e){this.endpoints.set(t,e)},t.prototype.setEnpointIfNotExist=function(t,e){this.endpoints.has(t)||this.endpoints.set(t,e)},t.prototype.setDefaultEndpoints=function(t){this.setEnpointIfNotExist("GetModel",i.a.combinePath(t,"models/{modelId}")),this.setEnpointIfNotExist("GetQuery",i.a.combinePath(t,"models/{modelId}/queries/{queryId}")),this.setEnpointIfNotExist("SaveQuery",i.a.combinePath(t,"models/{modelId}/queries/{queryId}")),this.setEnpointIfNotExist("SyncQuery",i.a.combinePath(t,"models/{modelId}/queries/{queryId}/sync")),this.setEnpointIfNotExist("NewQuery",i.a.combinePath(t,"models/{modelId}/queries")),this.setEnpointIfNotExist("RemoveQuery",i.a.combinePath(t,"models/{modelId}/queries/{queryId}")),this.setEnpointIfNotExist("GetQueryList",i.a.combinePath(t,"models/{modelId}/queries")),this.setEnpointIfNotExist("FetchData",i.a.combinePath(t,"models/{modelId}/fetch")),this.setEnpointIfNotExist("GetValueList",i.a.combinePath(t,"models/{modelId}/valuelists/{listId}")),this.setEnpointIfNotExist("ExportResult",i.a.combinePath(t,"models/{modelId}/export/{format}")),this.setEnpointIfNotExist("GetQueryFile",i.a.combinePath(t,"models/{modelId}/getqueryfile/{format}")),this.setEnpointIfNotExist("UploadQueryFile",i.a.combinePath(t,"models/{modelId}/uploadqueryfile"))},t.prototype.initStart=function(){this.servicesInitialized=!0},t.prototype.init=function(t){var e=this;(this.servicesInitialized||this.initStart(),void 0!==(t=t||{}).debugMode&&(this.debugMode=t.debugMode),void 0!==t.chunkSize&&(this.resultTable.chunkSize=t.chunkSize),void 0!==t.elasticPaging&&(this.elasticPaging=t.elasticPaging),t.listCache&&this.setExternalListCache(t.listCache),t.locale&&a.i18n.setCurrentLocale(t.locale),t.localeSettings&&a.i18n.updateLocaleSettings(t.localeSettings),t.endpoint&&(this.baseEndpoint=t.endpoint,console.warn("The `endpoint` option is deprecated.\nPlease use `context.useEndpoint(endpointURL)` function instead.")),this.setDefaultEndpoints(this.baseEndpoint),t.modelStorageResolver)&&this.getServices().registerModelStorageResolver(t.modelStorageResolver);if(this.loadQueryOnStart=!1,t.loadQueryOnStart&&(this.loadQueryOnStart=t.loadQueryOnStart),this.loadModelOnStart=!0,void 0!==t.loadModelOnStart&&(this.loadModelOnStart=t.loadModelOnStart),t.handlers&&(t.handlers.onInit&&this.addEventListener("ready",t.handlers.onInit),t.handlers.afterLoadModel&&this.addEventListener("loadModel",t.handlers.afterLoadModel),t.handlers.afterLoadQuery&&this.addEventListener("loadQuery",t.handlers.afterLoadQuery),t.handlers.afterSyncQuery&&this.addEventListener("syncQuery",t.handlers.afterSyncQuery),t.handlers.afterFetchData&&this.addEventListener("fetchData",t.handlers.afterFetchData),t.handlers.afterExportResult&&this.addEventListener("exportResult",t.handlers.afterExportResult),t.handlers.onProcessStart&&this.addEventListener("processStart",t.handlers.onProcessStart),t.handlers.onProcessEnd&&this.addEventListener("processEnd",t.handlers.onProcessEnd),t.handlers.onError&&(this.removeEventListener("error",this.errorHandlerId),this.addEventListener("error",t.handlers.onError)),t.handlers.onListRequest&&(this.clientListRequestHandler=t.handlers.onListRequest),t.handlers.beforeLoadModel&&(this.beforeLoadModel=t.handlers.beforeLoadModel),t.handlers.beforeLoadQuery&&(this.beforeLoadQuery=t.handlers.beforeLoadQuery),t.handlers.beforeSyncQuery&&(this.beforeSyncQuery=t.handlers.beforeSyncQuery),t.handlers.beforeFetchData&&(this.beforeFetchData=t.handlers.beforeFetchData),t.handlers.beforeExportResult&&(this.beforeExportResult=t.handlers.beforeExportResult)),this.initialQuery=t.initialQuery,this.defaultQueryId=t.defaultQueryId||"",this.defaultModelId=t.defaultModelId||"__default",this.eqServices.getModelLoader().init(t),this.eqServices.getQueryStorage().init(t),!1!==t.useDefaultExporters&&this.addDefaultExporters(),t.serverExporters)for(var n=0,o=t.serverExporters;n<o.length;n++){var i=o[n],r="csv"==i||"excel-html"==i?"":"arraybuffer";this.registerServerExporter(i,r)}var s=this.getQuery();t.defaultQueryId&&s.setId(t.defaultQueryId),this.widgets.forEach((function(n){var o={};t.widgets&&t.widgets[n.getWidgetType()]&&(o=t.widgets[n.getWidgetType()]),n.init(e,o)})),this.loadModelOnStart?this.loadDefaultModel():this.fireEvent("ready")},Object.defineProperty(t.prototype,"backendInfo",{get:function(){return this._backendInfo},enumerable:!0,configurable:!0}),t.prototype.useEndpoint=function(t){return this.baseEndpoint=t,this},t.prototype.useBackend=function(t){if(t.type&&(this._backendInfo.type=t.type),t.subType)this._backendInfo.subType=t.subType;else switch(this._backendInfo.type){case"EQN-ANC":this._backendInfo.subType="asp-net-core-razor";break;case"EQN-ASP":this._backendInfo.subType="asp-net-4-mvc";break;default:this._backendInfo.subType="other"}return this},t.prototype.addWidget=function(t){this.widgets.push(t)},t.prototype.getAllWidgetsByType=function(t){return this.widgets.filter((function(e){return e.getWidgetType()===t}))},t.prototype.getWidgetByType=function(t){var e=this.getAllWidgetsByType(t);return e.length>0?e[0]:null},t.prototype.refreshWidgets=function(t){void 0===t&&(t=s.All),this.widgets.forEach((function(e){e.belongsToGroup(t)&&e.refresh()}))},t.prototype.addQueryChangedCallback=function(t){this.getQuery().addChangedCallback(t)},t.prototype.removeQueryChangedCallback=function(t){this.getQuery().removeChangedCallback(t)},t.prototype.createQuery=function(){return this.eqServices.createQuery()},t.prototype.getQuery=function(){if(!this.query){if(!this.servicesInitialized)throw new Error("Can't create query until the context is initialized");this.query=this.createQuery()}return this.query},t.prototype.getModel=function(){return this.dataModel||(this.dataModel=this.eqServices.createDataModel()),this.dataModel},t.prototype.loadModelFromData=function(t){this.getQuery().loadModelData(t),this.dataModel=this.getQuery().getModel()},t.prototype.setDefaultModelId=function(t){this.defaultModelId=t},t.prototype.startProcess=function(t,e){this.eventEmitter.fire("processStart",t),this.widgets.forEach((function(t){t.belongsToGroup(e)&&t.onProcessStart()}))},t.prototype.endProcess=function(t,e){this.eventEmitter.fire("processEnd",t),t.result===_.Error&&this.throwError(t),this.widgets.forEach((function(t){t.belongsToGroup(e)&&t.onProcessEnd()}))},t.prototype.throwError=function(t){t.result=_.Error,this.eventEmitter.fire("error",t)},t.prototype.loadDefaultModel=function(){var t=this;this.loadModel({modelId:this.defaultModelId,silent:!0,success:function(){t.refreshWidgets(s.Model);var e=t.getQuery();t.fireEvent("initialModelLoad"),t.initialQuery&&e.loadFromData(t.initialQuery,{changeStatus:!1}),t.loadQueryOnStart?t.loadQuery({queryId:t.defaultQueryId,modelId:t.defaultModelId,success:function(){t.refreshWidgets(s.Query),t.fireEvent("ready")}}):(t.refreshWidgets(s.Query),t.fireEvent("ready"))}})},t.prototype.clearQuery=function(){var t=this.getQuery();t.clear(),t.fireChangedEvent({part:R.b.All})},t.prototype.clearResult=function(){this.resultTable.clear(),this.resultStatement=null,this.resultContent=null},t.prototype.setExternalListCache=function(t){this.externalListCache=t},t.prototype.getListFromCache=function(t){var e=this.getListCacheKey(t);return this.externalListCache?this.externalListCache.get(e):this.internalListCache[e]},t.prototype.getListCacheKey=function(t){var e="SQL"==t.listName?"SQL_"+t.editorId:t.listName;return t.queryParams&&(e+="_"+Object.keys(t.queryParams).filter((function(t){return"listName"!=t})).map((function(e){return t.queryParams[e]})).join("_")),e},t.prototype.addListToCache=function(t,e){var n=this.getListCacheKey(t);this.externalListCache?this.externalListCache.set(n,e):this.internalListCache[n]=e},t.prototype.resetListCache=function(){this.externalListCache?this.externalListCache.clear():this.internalListCache={}},t.prototype.getListRequestHandler=function(){return this._listRequestHandler},t.prototype.addLocale=function(t,e){a.i18n.addLocale(t,e)},t.prototype.addEventListener=function(t,e){var n=this;return this.eventEmitter.subscribe(t,(function(t){return e(n,t.data)}))},t.prototype.removeEventListener=function(t,e){this.eventEmitter.unsubscribe(t,e)},t.prototype.fireEvent=function(t,e){this.eventEmitter.fire(t,e)},t.prototype.getBaseEndpoint=function(){return this.baseEndpoint},t.prototype.loadValueList=function(t){var e=this;t=t||{},this.startProcess({action:I.GetValueList,text:"Loading values"},s.Result),this.eqServices.getValueListResolver().loadValueList(t).then((function(n){e.endProcess({result:_.Success,action:I.GetValueList,text:"Values loaded"},s.Result),t.success&&t.success(n)})).catch((function(n){var o="Can't load the value list for editor "+(t&&t.params?t.params.editorId:"undefined")+".\n "+n.message;e.endProcess({result:_.Error,action:I.GetValueList,text:o,sourceError:n},s.Result),t.error&&t.error(o,"GetValueList")}))},t.prototype.loadModel=function(t){var e=this;this.beforeLoadModel&&this.beforeLoadModel(this,t);var n=t.modelId||"__default",o=t.silent||!1;return this.startProcess({action:I.LoadModel,text:"Loading model: "+n},s.Model),this.eqServices.getModelLoader().startModelLoading(t).then((function(i){return i?(e.loadModelFromData(i),e.dataModel.isEmpty()&&console.warn("Empty model has been loaded. Model ID: "+e.dataModel.getId())):console.warn("Model has not been changed."),e.fireEvent("loadModel"),e.endProcess({result:_.Success,action:I.LoadModel,text:"Model loaded: "+n},s.Model),o||(e.clearQuery(),e.clearResult(),e.refreshWidgets()),t.success&&t.success(e.getModel()),e.getModel()})).catch((function(o){var i="Can't load model "+n+".\n "+o.message;return e.endProcess({result:_.Error,action:I.LoadModel,text:i,sourceError:o},s.Model),t.error&&t.error(i,"LoadModel"),e.getModel()}))},t.prototype.callWhenModelLoaded=function(t){this.eqServices.getModelLoader().getModelPromise().then((function(){t()}))},t.prototype.loadQuery=function(t){var e=this;t=t||{};var n=this.eqServices.getModelLoader();this.clearResult(),n.getModelPromise().then((function(){var n=(t=t||{}).queryId,o=t.silent||!1;e.beforeLoadQuery&&e.beforeLoadQuery(e,t),e.startProcess({action:I.LoadQuery,text:"Query loading: "+n},s.Query),e.eqServices.getQueryStorage().loadQuery(t).then((function(i){i&&e.query.loadFromData(i,{validate:!1}),e.fireEvent("loadQuery"),e.endProcess({result:_.Success,action:I.LoadQuery,text:"Query loaded: "+n},s.Query),e.query.resetModified(),o||(e.query.fireChangedEvent({part:R.b.Properties,wasModified:e.query.isModified()}),e.refreshWidgets()),t.success&&t.success(e.query)})).catch((function(n){var o=e.getQuery();n.message="Can't load query ["+o.getId()+"]\n"+(n.message||""),t.error&&t.error(n.message,I.LoadQuery),e.endProcess({result:_.Error,action:I.LoadQuery,text:n.message,sourceError:n},s.Query)}))})).catch((function(t){console.error(t)}))},t.prototype.loadQueryList=function(t){var e=this;this.eqServices.getModelLoader().getModelPromise().then((function(){e.startQueryListLoading(t)})).catch((function(t){var n="Can't load the list of available queries.\n "+t.message;e.throwError({action:I.LoadQueryList,text:n,sourceError:t})}))},t.prototype.startQueryListLoading=function(t){var e=this;t=t||{},this.eqServices.getQueryStorage().getQueryList(t).then((function(e){t.success&&t.success(e)})).catch((function(n){var o="Can't load the list of available queries.\n "+n.message;t.error?t.error(o,"LoadQueryList"):e.throwError({action:I.LoadQueryList,text:o,sourceError:n})}))},t.prototype.newQuery=function(t){var e=this,n=void 0===(t=t||{}).clearQuery||t.clearQuery;this.query.reset(n),t.queryId&&this.query.setId(t.queryId),t.name&&this.query.setName(t.name),t.description&&this.query.setDescription(t.description);var o=t.silent||!1,i=!0;void 0!==t.useStorage&&(i=t.useStorage);var r=function(){var t=e.getQuery();t.isNewbie=!0,o||t.fireChangedEvent({part:R.b.All,wasModified:t.isModified()})};i?(this.startProcess({action:I.NewQuery,text:"New query creation..."},s.Query),this.eqServices.getQueryStorage().newQuery(t).then((function(n){n&&e.query.loadFromData(n),e.endProcess({result:_.Success,action:I.NewQuery,text:"A new query has been created"},s.Query),r(),t.success&&t.success()})).catch((function(n){var o="Can't create a new query.\n"+n.message;e.endProcess({result:_.Error,action:I.NewQuery,text:o,sourceError:n},s.Query),t.error&&t.error(o,"NewQuery")}))):r();return this.query},t.prototype.saveQuery=function(t){var e=this;t=t||{};var n=this.getQuery();this.startProcess({action:I.SaveQuery,text:"Query saving: "+n.getId()},s.Query),this.eqServices.getQueryStorage().saveQuery(t).then((function(o){e.endProcess({action:I.SaveQuery,result:_.Success,text:"Query saved: "+n.getId()},s.Query),o&&n.loadFromData(o),n.resetModified(),n.isNewbie=!1,t.success&&t.success()})).catch((function(o){var i="Can't save query "+n.getId()+".\n "+o.message;e.endProcess({action:I.SaveQuery,result:_.Error,text:i,sourceError:o},s.Query),t.error&&t.error(i,I.SaveQuery)}))},t.prototype.removeQuery=function(t){var e=this;t=t||{};var n=this.getQuery();this.startProcess({action:I.RemoveQuery,text:"Query deleting: "+n.getId()},s.Query),this.eqServices.getQueryStorage().removeQuery(t).then((function(){n.reset(),e.endProcess({action:I.RemoveQuery,result:_.Success,text:"Query deleted: "+n.getId()},s.Query),t.success&&t.success()})).catch((function(o){var i="Can't remove query "+n.getId()+".\n "+o.message;e.endProcess({action:I.RemoveQuery,result:_.Error,text:i,sourceError:o},s.Query),t.error&&t.error(i,"RemoveQuery")}))},t.prototype.syncQuery=function(t){var e=this;t=t||{};var n=this.getQuery();this.beforeSyncQuery&&this.beforeSyncQuery(this,t),this.startProcess({action:I.SyncQuery,text:"Query syncing: "+n.getId()},s.Query),this.eqServices.getQuerySynchronizer().syncQuery(t).then((function(o){if(e.resultStatement=o&&o.statement?o.statement:"",e.fireEvent("syncQuery"),e.refreshWidgets(s.Statement),e.endProcess({result:_.Success,action:I.SyncQuery,text:"Query synced: "+n.getId()},s.Query),o){if(o.querySaved){var i=o.query;i&&(n.setId(i.id),n.setName(i.name),n.setDescription(i.desc),n.extraData=i.extraData),n.resetModified(),e.refreshWidgets(s.QueryStatus)}t.success&&t.success(o)}})).catch((function(o){var i="Can't synchronize query "+n.getId()+".\n "+o.message;e.endProcess({result:_.Error,action:I.SyncQuery,text:i,sourceError:o},s.Query),t.error&&t.error(i,"SyncQuery")}))},t.prototype.fetchData=function(t){var e=this,n=void 0!==(t=t||{}).elasticPaging?t.elasticPaging:this.elasticPaging;this.resultTable.elasticChunks=n,t.chunk=t.chunk||{offset:0,limit:this.resultTable.chunkSize,needTotal:!n},this.debugMode&&(t.debug="Fetching the result set. Initial chunk"),this.query.tryValidate({checkExpressions:!0})&&(t.groupFetchSuccess&&(this.afterGroupFetch=t.groupFetchSuccess),this.resultTable.elasticChunks&&t.chunk.limit++,this.fetchDataChunk(Q(Q({},t),{success:function(n){if(n.statement&&(e.resultStatement=n.statement,e.refreshWidgets(s.Statement)),e.getServices().getAggregatesCalculator().reset(),e.resultContent=n,n.resultSet){e.resultTable.clear(),e.resultTable.id=e.query.getId();for(var o=n.resultSet,i=0,r=o.cols;i<r.length;i++){var a=r[i];e.resultTable.columns.add(a)}n.meta&&void 0!==n.meta.totalRecords&&e.resultTable.setTotal(n.meta.totalRecords);var l=o.rows.length;e.resultTable.elasticChunks&&l===t.chunk.limit&&o.rows.splice(o.rows.length-1,1);for(var u=0,c=o.rows;u<c.length;u++){var d=c[u];e.resultTable.addRow(d)}e.resultTable.elasticChunks&&(e.resultTable.total=l<t.chunk.limit?o.rows.length:0),e.resultTable.fireUpdated()}t.success&&t.success(n)}})))},t.prototype.getQueryFile=function(t){var e=this,n=this.getQuery();this.startProcess({action:I.GetQueryFile,text:"Getting query file: "+n.getId()},s.Query),this.getServices().getQueryFileLoader().getQueryFile(t).then((function(){e.endProcess({result:_.Success,action:I.GetQueryFile,text:"Getting query file: "+n.getId()},s.Result),t.success&&t.success()})).catch((function(o){var i="Can't get file for query "+n.getId()+".\n "+o.message;e.endProcess({result:_.Error,action:I.GetQueryFile,text:i,sourceError:o},s.Query),t.error&&t.error(i,"GetQueryFile")}))},t.prototype.uploadQueryFile=function(t){var e=this,n=this.getQuery();this.startProcess({action:I.UploadQueryFile,text:"Uploading query file: "+n.getId()},s.Query),this.getServices().getQueryFileLoader().uploadQueryFile(t).then((function(o){n.loadFromData(o),e.fireEvent("loadQuery"),e.refreshWidgets(),e.endProcess({result:_.Success,action:I.UploadQueryFile,text:"Uploading query file: "+n.getId()},s.Result),t.success&&t.success()})).catch((function(o){var i="Can't upload a file for query "+n.getId()+".\n "+o.message;e.endProcess({result:_.Error,action:I.UploadQueryFile,text:i,sourceError:o},s.Query),t.error&&t.error(i,"UploadQueryFile")}))},t.prototype.fetchDataChunk=function(t){var e=this,n=this.getQuery().getId(),o=t||{};this.useStoredQueryOnFetch&&(o.queryId=this.query.getId()),this.beforeFetchData&&this.beforeFetchData(this,o),this.startProcess({action:I.FetchData,text:"Fetching data for the query: "+n},s.Result),this.eqServices.getDataFetcher().fetchData(o).then((function(t){t.statement&&(e.resultStatement=t.statement),e.resultContent=t,o.success&&o.success(t),e.fireEvent("fetchData"),e.endProcess({result:_.Success,action:I.FetchData,text:"Data fetching is finished for the query: "+n},s.Result)})).catch((function(t){var i="Data fetching error for the query "+n+". \n"+t.message;e.endProcess({result:_.Error,action:I.FetchData,text:i,sourceError:t},s.Result),o.error&&o.error(i,I.FetchData)}))},t.prototype.onResultTableUpdate=function(){var t=this,e=this.query.getAggregationSettings(),n=this.getServices().getAggregatesCalculator();e.needAggrCalculation()&&n.needRecalculation()&&n.calculate({maxLevel:e.getGroups().length+1,resultObtained:function(e,n){t.afterGroupFetch&&t.afterGroupFetch(e)},errorOccurred:function(e){var n="Data fetching error on group level "+e.level+" query. \n"+e.message;t.throwError({action:I.FetchData,text:n,sourceError:e})}})},t.prototype.fetchDrillDownData=function(t){var e=this;(t=t||{}).chunk=t.chunk||{offset:0,limit:this.resultTable.chunkSize,needTotal:!0};var n=t.query.getId();this.startProcess({action:I.FetchData,text:"DrillDown executing: "+n},s.Result),this.eqServices.getDataFetcher().fetchData(t).then((function(o){e.endProcess({result:_.Success,action:I.FetchData,text:"DrillDown execution error: "+n},s.Result),t.success&&t.success(o)})).catch((function(o){var i="Drill-down data fetching error for query "+n+". \n"+o.message;e.endProcess({result:_.Error,action:I.FetchData,text:i},s.Result),t.error?t.error(i,"DrillDown"):e.throwError({action:I.FetchData,text:i})}))},t.prototype.exportResult=function(t){var e=this;t=t||{},this.beforeExportResult&&this.beforeExportResult(this,t);var n=t.format;if(n){var o=this.getExporter(n);if(o){var i=this.getQuery().getId();this.useStoredQueryOnFetch&&(t.queryId=i),this.startProcess({action:I.ExportResult,text:"Exporting result for query: "+i},s.Result);var r=a.i18n.getLocaleSettings();t.settings=r;var l=this.query.getAggregationSettings();l.hasAggregates()&&(l.hasGrandTotals()||l.hasGroups())&&(t.aggregates=l.saveToData()),o.export(t).then((function(n){e.fireEvent("exportResult"),e.endProcess({result:_.Success,action:I.ExportResult,text:"The result set for query ["+i+"] has been successfully exported"},s.Result),t.success&&t.success()})).catch((function(n){var o="Error on exporting data for query "+i+". \n"+n.message;e.endProcess({result:_.Error,action:I.ExportResult,text:o,sourceError:n},s.Result),t.error&&t.error(o,"ExportResult")}))}}},t}(),q=function(){function t(t){this.slot=t,this._id=a.utils.generateId(this.getWidgetType())}return Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),t.prototype.init=function(t,e){this.context=t},t.prototype.getContext=function(){return this.context},t.prototype.refresh=function(){this.refreshCore()},t.prototype.refreshCore=function(){},t.prototype.onProcessStart=function(){this.onProcessStartCore()},t.prototype.onProcessStartCore=function(){},t.prototype.onProcessEnd=function(){this.onProcessEndCore()},t.prototype.onProcessEndCore=function(){},t.prototype.belongsToGroup=function(t){return void 0===t||null==t||0!=(t&this.group)},t.prototype.destroy=function(){this.destroyCore()},t.prototype.destroyCore=function(){},t}(),N=n(28),H=n(50),W=n(20),G=n(59),V=new(function(){function t(t,e,n){this.major=t,this.minor=e,this.update=n}return t.prototype.toString=function(){return this.major+"."+this.minor+"."+this.update},t}())(6,2,0);a.i18n.updateDefaultTexts({NewQueryName:"[New query]",Today:"Today",Yesterday:"Yesterday",Tomorrow:"Tomorrow",FirstDayOfMonth:"First day of the month",LastDayOfMonth:"Last day of the month",FirstDayOfWeek:"First day of the week",FirstDayOfYear:"First day of the year",FirstDayOfNextWeek:"First day of the next week",FirstDayOfNextMonth:"First day of the next month",FirstDayOfNextYear:"First day of the next year",Now:"Now",HourStart:"This hour start",Midnight:"Midnight",Noon:"Noon",Entities:{},Attributes:{},Operators:{},AggreateFunctions:{}})},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return browserUtils}));var _utils__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(4),browserUtils;(function(browserUtils){var _isFirefox=null,_isIE=null;function isIE(){return eval("/*@cc_on!@*/false || !!document.documentMode")}function isFirefox(){if(null===_isFirefox){var t=navigator.userAgent;_isFirefox=t.toLowerCase().indexOf("firefox")>-1}return _isFirefox}browserUtils.isIE=isIE,browserUtils.isFirefox=isFirefox;var _detectedIsMobileMode=!1,_isMobileMode=void 0,detectIsMobileMode=function(){var t=isMobileMode();_detectedIsMobileMode=window.matchMedia("only screen and (max-width: 840px)").matches||window.matchMedia("only screen and (max-height: 420px)").matches;var e=isMobileMode();e!==t&&mobileModeChangeHandler&&mobileModeChangeHandler(e)},mobileModeChangeHandler;function isMobileMode(){return void 0!==_isMobileMode?_isMobileMode:_detectedIsMobileMode}function setIsMobileMode(t){var e=isMobileMode();_isMobileMode=t;var n=isMobileMode();n!==e&&mobileModeChangeHandler&&mobileModeChangeHandler(n)}function onMobileModeChanged(t){mobileModeChangeHandler=t}function getMobileCssClass(){return isMobileMode()?_utils__WEBPACK_IMPORTED_MODULE_0__.a:null}detectIsMobileMode(),window.addEventListener("resize",(function(){return detectIsMobileMode()})),browserUtils.isMobileMode=isMobileMode,browserUtils.setIsMobileMode=setIsMobileMode,browserUtils.onMobileModeChanged=onMobileModeChanged,browserUtils.getMobileCssClass=getMobileCssClass})(browserUtils||(browserUtils={}))},function(t,e,n){"use strict";n.d(e,"c",(function(){return o})),n.d(e,"d",(function(){return i})),n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return s}));n(1);function o(t){for(var e=0;null!==t;){var n=document.defaultView.getComputedStyle(t,null).getPropertyValue("z-index");if("auto"!=n){var o=parseInt(n);o>e&&(e=o)}t=t.parentElement}return e}function i(t){setTimeout((function(e){t&&t.focus()}),100)}var r="eqjs",s="eqjs-mobile"},function(t,e,n){"use strict";var o;n.d(e,"a",(function(){return o})),function(t){t[t.Column=3]="Column",t[t.Histogram=4]="Histogram",t[t.Bar=5]="Bar",t[t.Combo=6]="Combo",t[t.Area=7]="Area",t[t.Line=9]="Line",t[t.Pie=10]="Pie",t[t.Polar=11]="Polar",t[t.Doughnut=12]="Doughnut",t[t.Radar=13]="Radar",t[t.SteppedLine=14]="SteppedLine"}(o||(o={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"d",(function(){return l})),n.d(e,"b",(function(){return u})),n.d(e,"c",(function(){return c})),n.d(e,"e",(function(){return d}));var o,i=n(69),r=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var o=Array(t),i=0;for(e=0;e<n;e++)for(var r=arguments[e],s=0,a=r.length;s<a;s++,i++)o[i]=r[s];return o},a=function(){function t(t,e){this.element="string"==typeof t?document.createElement(t):t,e&&this.element.parentElement!==e&&e.appendChild(this.element)}return t.prototype.addChild=function(t,e){var n=d(t,this.element);return e&&e(n),this},t.prototype.addChildElement=function(t){return t&&this.element.appendChild(t),this},t.prototype.attr=function(t,e){return this.element.setAttribute(t,e),this},t.prototype.id=function(t){return this.attr("id",t)},t.prototype.focus=function(){return this.element.focus(),this},t.prototype.title=function(t){return this.attr("title",t)},t.prototype.data=function(t,e){return void 0===e&&(e=null),null===e?(this.element.removeAttribute("data-"+t),this):this.attr("data-"+t,e)},t.prototype.show=function(){return this.removeStyle("display")},t.prototype.hide=function(t){return void 0===t&&(t=!0),t?this.setStyle("display","none"):this},t.prototype.visible=function(t){return void 0===t&&(t=!0),t?this.setStyle("visibility","visible"):this.setStyle("visibility","hidden")},t.prototype.isVisible=function(){return!!(this.element.offsetWidth||this.element.offsetHeight||this.element.getClientRects().length)},t.prototype.addClass=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(t)for(var o=s(t.trim().split(" "),e),i=0;i<o.length;i++)this.element.classList.add(o[i]);return this},t.prototype.removeClass=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(t)for(var o=s(t.trim().split(" "),e),i=0;i<o.length;i++)this.element.classList.remove(o[i]);return this},t.prototype.toggleClass=function(t,e){return void 0===e&&(e=void 0),t&&this.element.classList.toggle(t,e),this},t.prototype.on=function(t,e){for(var n=t.split(" "),o=0;o<n.length;o++)this.element.addEventListener(n[o],e);return this},t.prototype.off=function(t,e){for(var n=t.split(" "),o=0;o<n.length;o++)this.element.removeEventListener(n[o],e);return this},t.prototype.setStyle=function(t,e){return this.element.style.setProperty(t,e),this},t.prototype.removeStyle=function(t){return this.element.style.removeProperty(t),this},t.prototype.text=function(t){return this.element.innerText=t,this},t.prototype.html=function(t){return this.element.innerHTML=t,this},t.prototype.clear=function(){var t=this.element;this.element=document.createElement(this.element.tagName),t.replaceWith(this.element)},t.prototype.addText=function(t){var e=document.createTextNode(t);return this.element.appendChild(e),this},t.prototype.addHtml=function(t){return this.element.innerHTML+=t,this},t.prototype.toDOM=function(){return this.element},t.prototype.appendTo=function(t){return t&&t.appendChild(this.element),this},t}(),l=function(t){function e(e,n){return e?t.call(this,e,n)||this:t.call(this,"textarea",n)||this}return r(e,t),e.prototype.name=function(t){return this.element.name=t,this},e.prototype.rows=function(t){return this.element.rows=t,this},e.prototype.cols=function(t){return this.element.cols=t,this},e.prototype.value=function(t){return this.element.value=t,this},e}(a),u=function(t){function e(e,n){return e?t.call(this,e,n)||this:t.call(this,"input",n)||this}return r(e,t),e.prototype.name=function(t){return this.element.name=t,this},e.prototype.type=function(t){return this.element.type=t,this},e.prototype.size=function(t){return this.element.size=t,this},e.prototype.value=function(t){return t instanceof Date?this.element.valueAsDate=t:"number"==typeof t?this.element.valueAsNumber=t:this.element.value=t,this},e.prototype.mask=function(t){return Object(i.a)(this.element,t),this},e}(a),c=function(t){function e(e,n){return e?t.call(this,e,n)||this:t.call(this,"select",n)||this}return r(e,t),e.prototype.addOption=function(t){var e=document.createElement("option");return"string"==typeof t?(e.value=t,e.innerHTML=t):(e.value=t.value,e.innerHTML=t.title||t.value,e.selected=t.selected||!1),this.element.appendChild(e),this},e.prototype.value=function(t){return this.element.value=t,this},e}(a);function d(t,e){return"div"===t||t instanceof HTMLDivElement||"span"===t||t instanceof HTMLSpanElement||"a"===t||t instanceof HTMLAnchorElement||"button"===t||t instanceof HTMLButtonElement||"img"===t||t instanceof HTMLImageElement?new a(t,e):"input"===t||t instanceof HTMLInputElement?new u(t instanceof HTMLInputElement?t:null,e):"textarea"===t||t instanceof HTMLTextAreaElement?new l(t instanceof HTMLTextAreaElement?t:null,e):"select"===t||t instanceof HTMLSelectElement?new c(t instanceof HTMLSelectElement?t:null,e):new a(t,e)}},function(t,e,n){"use strict";var o;n.d(e,"a",(function(){return o})),function(t){t[t.Unknown=0]="Unknown",t[t.String=1]="String",t[t.Byte=2]="Byte",t[t.Word=3]="Word",t[t.Int32=4]="Int32",t[t.Int64=5]="Int64",t[t.Bool=6]="Bool",t[t.Float=7]="Float",t[t.Currency=8]="Currency",t[t.BCD=9]="BCD",t[t.Date=10]="Date",t[t.Time=11]="Time",t[t.DateTime=12]="DateTime",t[t.Autoinc=13]="Autoinc",t[t.Memo=14]="Memo",t[t.Blob=15]="Blob",t[t.FixedChar=16]="FixedChar",t[t.Guid=17]="Guid",t[t.Geometry=18]="Geometry",t[t.Geography=19]="Geography"}(o||(o={}))},function(t,e,n){"use strict";var o;n.d(e,"a",(function(){return o})),function(t){t[t.Unknown=0]="Unknown",t[t.Constant=1]="Constant",t[t.EntityAttribute=2]="EntityAttribute",t[t.ParentEntityAttribute=3]="ParentEntityAttribute",t[t.AggregateFunction=4]="AggregateFunction",t[t.ParentColumn=5]="ParentColumn",t[t.Query=11]="Query",t[t.CustomSql=21]="CustomSql"}(o||(o={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var o=n(0),i=n(1),r=n(3),s=n(4),a=function(){function t(t){this.isFilteringMode=!1,this.showSelected=!1,this.parentMenu=t.menu||null,this.parentLevel=t.parent||null,this.parentElement=t.container||document.body,this.levelIndex=t.levelIndex||0,this.levelDiv=null,this.domWriteItemsId=t.domWriteItemsId||!1,this.menuId=t.menuId||"",this.itemRenderedCallback=t.itemRenderedCallback||null,this._applyItem={id:null,text:null,itemDiv:null},this.items=t.items||[],this.activeItem=null,this.selectedItem=null,this.initialized=!1,this.showSelected=t.showSelected,this.updated=0,this.renderContent()}return Object.defineProperty(t.prototype,"applyItem",{get:function(){return this._applyItem},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"eqjs-menu"},enumerable:!0,configurable:!0}),t.prototype.getItems=function(){return this.items},t.prototype.setItems=function(t){this.items=t},t.prototype.renderContent=function(){var t=this;if(this.items){var e=this.parentMenu.style.colors.bgON||"white",n=this.parentMenu.style.colors.fgON||"black",s=(this.parentMenu.style.colors.bgOVER,this.parentMenu.style.itemStyle.fontFamily||""),a=this.parentMenu.style.itemStyle.fontSize||"14px",l=this.parentMenu.options.multiselect,u=this.parentMenu.options.isSubQuery,c=Object(i.domel)("div").addClass(r.a.getMobileCssClass());this.parentMenu.options.useDefaultStyles&&c.setStyle("backgroundColor",e).setStyle("border","1px solid").setStyle("borderColor",e).setStyle("backgroundColor",this.parentMenu.style.colors.border).setStyle("margin","-2px 2px 2px -2px").setStyle("width","auto").setStyle("height","auto"),c.setStyle("z-index",this.parentMenu.zIndex).setStyle("position","absolute").setStyle("display","none");var d=c.toDOM();d.menuLevel=this;var h=this._applyItem;if(l&&0===this.levelIndex&&!0!==this.parentMenu.options.hideButtons){var p=document.createElement("div");p.classList.add(this.cssPrefix+"-applyDiv"),p.menuItem=h,this.applyBtn=document.createElement("button"),this.parentMenu.options.useDefaultStyles&&(p.style.borderBottom="1px solid",p.style.padding="5px",p.style.marginBottom="5px",this.applyBtn.style.padding="0 5px",this.applyBtn.style.cursor="pointer");var f=document.createTextNode(this.parentMenu.options.buttons.submit);this.applyBtn.appendChild(f),p.appendChild(this.applyBtn);var g=document.createElement("button");g.classList.add(this.cssPrefix+"-cancel"),this.parentMenu.options.useDefaultStyles&&(g.style.padding="0 5px",g.style.cursor="pointer",g.style.marginLeft="15px");var y=document.createTextNode(this.parentMenu.options.buttons.cancel);g.appendChild(y),p.appendChild(g),d.appendChild(p),h.itemDiv=p,this.applyBtn.addEventListener("click",(function(){t.submit(t._applyItem)})),g.addEventListener("click",(function(){t.parentMenu.hideMenu()}))}if(null==this.parentLevel&&(this.parentMenu.options.searchBoxAlwaysShown||this.items.length>=this.parentMenu.options.showSearchBoxAfter)){var m=Object(i.domel)("div").addClass(this.cssPrefix+"-searchDiv");this.parentMenu.options.useDefaultStyles&&(m.setStyle("border-bottom","1px solid #666").setStyle("background-color",e).setStyle("border-color",this.parentMenu.style.colors.border),""!=s&&m.setStyle("font-family",s),m.setStyle("font-size",a).setStyle("color",n).setStyle("cursor","pointer").setStyle("text-align","left").setStyle("padding","5px"));var v=Object(i.domel)("input").id("searchBox").name("searchBox").type("text").size(16).addClass(this.cssPrefix+"-searchBox").on("input",(function(e){t.deactivateItem(t.activeItem),t.renderItems(t.searchBox.value)})).on("keydown",(function(e){switch(e.keyCode){case 13:t.activeItem&&t.activeItem.itemDiv.click();break;case 38:t.moveActiveItemUp();break;case 40:t.moveActiveItemDown();break;case 39:t.searchBox.value||t.openSubLevel(t.activeItem)}}));this.parentMenu.options.useDefaultStyles&&v.setStyle("font-family","monospace").setStyle("font-size","8pt").setStyle("width","100%"),u&&v.addClass("eqjs-dialog"),this.searchBox=v.toDOM(),this.searchDiv=m.toDOM(),this.searchDiv.appendChild(this.searchBox),d.appendChild(this.searchDiv)}var b=document.createElement("div");b.tabIndex=1,Object(i.domel)(b).addClass(this.cssPrefix+"-scrollDiv").addClass(r.a.getMobileCssClass()),b.style.overflowX="hidden",b.style.overflowY="auto",b.style.position="relative",d.appendChild(b),this.levelDiv=d,this.scrollDiv=b,this.menuId&&(this.levelDiv.id=this.menuId),this.parentLevel&&(this.levelDiv.style.zIndex=this.parentLevel.levelDiv.style.zIndex),this.renderItems();b.addEventListener("keydown",(function(e){switch(e.which){case 13:t.parentMenu.options.multiselect?t.parentMenu.getRootLevel().applyBtn.click():t.activeItem&&t.activeItem.itemDiv.click();break;case 32:t.activeItem&&t.activeItem.itemDiv.click();break;case 37:t.parentLevel&&!t.isFilteringMode&&(t.deactivateItem(t.activeItem),t.parentLevel.focus());break;case 39:t.openSubLevel(t.activeItem);break;case 38:t.moveActiveItemUp();break;case 40:t.moveActiveItemDown();break;default:return}e.preventDefault()})),r.a.isMobileMode()&&(this.closeDiv=Object(i.domel)("div",d).addClass("eqjs-menu-close-btn").addText(o.i18n.getText("ButtonClose")).on("click",(function(){t.parentMenu.hideMenu()})).toDOM())}},t.prototype.moveActiveItemDown=function(){var t=this.isFilteringMode?this.filteredItems:this.items;if(this.activeItem){var e=t.indexOf(this.activeItem);e<t.length-1&&this.activateItem(t[e+1],!1)}else this.activateItem(t[0],!1)},t.prototype.moveActiveItemUp=function(){var t=this.isFilteringMode?this.filteredItems:this.items;if(this.activeItem){var e=t.indexOf(this.activeItem);e>0&&this.activateItem(t[e-1],!1)}else this.activateItem(t[t.length-1],!1)},t.prototype.openSubLevel=function(t){t&&t.items&&!this.isFilteringMode&&(this.showSubLevel(t),t.subLevel.activateItem(t.subLevel.items[0]))},t.prototype.focusScrollDiv=function(){this.scrollDiv.focus()},t.prototype.turnCheckboxes=function(t){for(var e=0;e<t.length;e++){var n=t[e];n.itemCheckbox&&(n.itemCheckbox.checked=this.isItemSelected(n)),n.items&&this.turnCheckboxes(n.items)}},t.prototype.isItemSelected=function(t){if(t.items){for(var e=0;e<t.items.length;e++)if(this.isItemSelected(t.items[e]))return!0;return!1}return t.selected},t.prototype.setItemSelected=function(t,e){if(t.items)for(var n=0;n<t.items.length;n++)this.setItemSelected(t.items[n],e);else t.selected=e},t.prototype.submitItems=function(t,e){for(var n=0;n<t.length;n++)t[n].items?this.submitItems(t[n].items,e):t[n].selected&&e.push(t[n])},t.prototype.allSubitemsAreFiltered=function(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return!1;return!0},t.prototype.isItemDiv=function(t){return!!t.menuItem},t.prototype.isLevelDiv=function(t){return!!t.menuLevel},t.prototype.getMenuItem=function(t){for(var e=t;!this.isItemDiv(e);){if(this.isLevelDiv(e))throw"Can't get menu item";e=e.parentElement}return e.menuItem},t.prototype.renderItemsWithoutFilter=function(){var t=this;this.isFilteringMode=!1;var e=this.scrollDiv,n=this.parentMenu.options.multiselect,o=this.parentMenu.options.activateOnMouseOver,s=this.parentMenu.style.colors.fgON||"black",a=(this.parentMenu.style.colors.bgOVER,this.parentMenu.style.itemStyle.fontSize||"14px"),l=this.parentMenu.getItemFilterCallback();e.innerHTML="";for(var u=0;u<this.items.length;u++){var c=this.items[u];if(c&&c.text){if(l){if(!l(c))continue;if(c.items&&this.allSubitemsAreFiltered(c.items,l))continue}c.data=function(e){return t[e]},void 0===c.selected&&(c.selected=!1),c.selected&&null==this.selectedItem&&(this.selectedItem=c);var d=document.createElement("div");if(Object(i.domel)(d).addClass(this.cssPrefix+"-itemDiv").addClass(r.a.getMobileCssClass()),c.selected&&this.showSelected&&!n&&d.classList.add(this.cssPrefix+"-selected"),this.domWriteItemsId&&this.menuId&&(d.id="item-"+this.menuId+"-"+c.id),e.appendChild(d),d.menuItem=c,d.menuLevel=this,c.itemDiv=d,this.parentMenu.options.useDefaultStyles&&(d.style.fontSize=a,d.style.color=s,d.style.paddingLeft="15px",d.style.paddingRight="6px",d.style.cursor="pointer"),"---"==c.text)d.appendChild(document.createElement("hr"));else{if(n){var h=document.createElement("input");h.type="checkbox",h.id="cb"+c.id,h.checked=this.isItemSelected(c),h.defaultChecked=this.isItemSelected(c),d.appendChild(h),c.itemCheckbox=h,this.parentMenu.options.useDefaultStyles&&(h.style.margin="4px 10px 0 0",h.style.verticalAlign="top")}var p=c.text;this.parentMenu.options.showItemIds&&(p=c.id+":"+p);var f=document.createTextNode(p);if(d.appendChild(f),c.items&&c.items.length>0){d.classList.add(this.cssPrefix+"-itemDiv-hasChildren");var g=document.createElement("span");g.classList.add(this.cssPrefix+"-itemDiv-arrow"),d.appendChild(g);var y=document.createTextNode(">");g.appendChild(y)}var m=function(e){var o=t.getMenuItem(e.target);if(n)if(o.items&&e.target!=o.itemCheckbox)t.activateItem(o);else{var i=t.isItemSelected(o);t.setItemSelected(o,!i),o.itemCheckbox.checked=!i,t.parentMenu.refreshCheckboxes()}else t.activateItem(o),t.submit(o);return!1};d.removeEventListener("click",m),d.addEventListener("click",m),d.addEventListener("mouseenter",(function(e){var n=t.getMenuItem(e.target);t.parentMenu.isCursorInside=!0,o&&t.activateItem(n)})),d.addEventListener("mouseleave",(function(e){var n=t.getMenuItem(e.target);t.parentMenu.isCursorInside=!1,setTimeout((function(){t.parentMenu.isCursorInside||o&&n==t.activeItem&&!n.subLevel&&t.deactivateItem(n)}),200)}))}this.itemRenderedCallback&&this.itemRenderedCallback(this.menuId,d)}}},t.prototype.renderItemsWithFilter=function(t){this.isFilteringMode=!0,this.scrollDiv.innerHTML="";var e=t.split(">"),n=e.map((function(t){return t.replace(/\*/g,"")})),o=this.filterItems(this.items,e);this.filteredItems=[];for(var i=0;i<o.length;i++)this.renderItemWithFilter(o[i],n,0)},t.prototype.matchesFilter=function(t,e){return!t||!e||e.test(t)},t.prototype.filterItems=function(t,e){for(var n=[],i=e.length>0?e[0]:"",r=e.length>1?e.slice(1):e,s=i?new RegExp(i.replace(/\*/g,".+?"),"i"):null,a=0;a<t.length;a++){var l=t[a];if(l.items){var u=o.utils.assign({},l),c=this.matchesFilter(l.text,s);e.length<2?c&&e.length<2?u.items=o.utils.createArrayFrom(l.items):u.items=this.filterItems(l.items,r):u.items=c?this.filterItems(l.items,r):[],u.items.length>0&&n.push(u)}else this.matchesFilter(l.text,s)&&n.push(l)}return n},t.prototype.renderItemWithFilter=function(t,e,n){var o=this,s=this.scrollDiv,a=n<e.length?e[n]:e[e.length-1],l=this.parentMenu.options.multiselect,u=this.parentMenu.options.activateOnMouseOver,c=this.parentMenu.style.colors.fgON||"black",d=(this.parentMenu.style.colors.bgOVER,this.parentMenu.style.itemStyle.fontSize||"14px"),h=this.parentMenu.getItemFilterCallback();if(t&&t.text){if(h){if(!h(t))return;if(t.items&&this.allSubitemsAreFiltered(t.items,h))return}t.data=function(t){return this[t]},void 0===t.selected&&(t.selected=!1),t.selected&&null==this.selectedItem&&(this.selectedItem=t);var p=document.createElement("div");if(Object(i.domel)(p).addClass(this.cssPrefix+"-itemDiv").addClass(r.a.getMobileCssClass()),p.style.marginLeft=10*n+"px",t.selected&&!l&&p.classList.add(this.cssPrefix+"-selected"),this.domWriteItemsId&&this.menuId&&(p.id="item-"+this.menuId+"-"+t.id),s.appendChild(p),p.menuItem=t,p.menuLevel=this,t.itemDiv=p,this.parentMenu.options.useDefaultStyles&&(p.style.fontSize=d,p.style.color=c,p.style.paddingLeft="15px",p.style.paddingRight="6px",p.style.cursor="pointer"),"---"==t.text)p.appendChild(document.createElement("hr"));else{if(l){var f=document.createElement("input");f.type="checkbox",f.id="cb"+t.id,f.checked=this.isItemSelected(t),f.defaultChecked=this.isItemSelected(t),p.appendChild(f),t.itemCheckbox=f,this.parentMenu.options.useDefaultStyles&&(f.style.margin="4px 10px 0 0",f.style.verticalAlign="top")}var g=document.createElement("span");if(g.innerHTML=this.highlightText(t.text,a),p.appendChild(g),t.items&&t.items.length>0)p.classList.add(this.cssPrefix+"-itemDiv-filter-hasChildren");else{this.filteredItems.push(t);var y=function(e){if(l)if(t.items&&e.target!=t.itemCheckbox)o.activateItem(t);else{var n=o.isItemSelected(t);o.setItemSelected(t,!n),t.itemCheckbox.checked=!n,o.parentMenu.refreshCheckboxes()}else o.activateItem(t),o.submit(t);return!1};p.removeEventListener("click",y),p.addEventListener("click",y),p.addEventListener("mouseenter",(function(e){o.parentMenu.isCursorInside=!0,u&&o.activateItem(t)})),p.addEventListener("mouseleave",(function(e){o.parentMenu.isCursorInside=!1,setTimeout((function(){o.parentMenu.isCursorInside||u&&t==o.activeItem&&!t.subLevel&&o.deactivateItem(t)}),200)}))}}if(t.items)for(var m=0;m<t.items.length;m++)this.renderItemWithFilter(t.items[m],e,n+1);this.itemRenderedCallback&&this.itemRenderedCallback(this.menuId,p)}},t.prototype.highlightText=function(t,e){if(e&&e.length>0){var n=e.toLowerCase(),o=t.toLowerCase();if(o.indexOf(n)>=0){for(var i=0,r=t,s=[];;){var a=o.indexOf(n,i);if(a>=0?(s.push(a),i=a+e.length):i++,i>=r.length-1)break}if(s.length>0){t="";for(var l=0;l<s.length;l++)0===l&&(t+=r.substring(0,s[l])),t+="<span class='eqjs-menu-itemDiv-highlight'>"+r.substring(s[l],s[l]+e.length)+"</span>",l<s.length-1?t+=r.substring(s[l]+e.length,s[l+1]):t+=r.substring(s[l]+e.length)}}}return t},t.prototype.renderItems=function(t){t||r.a.isMobileMode()?(t=t||"",this.renderItemsWithFilter(t.toLowerCase())):this.renderItemsWithoutFilter()},t.prototype.activateItem=function(t,e){void 0===e&&(e=!0),null!=this.activeItem&&this.deactivateItem(this.activeItem),this.activeItem=t;var n=t.itemDiv;if(n.classList.add("active"),this.parentMenu.options.useDefaultStyles){this.parentMenu.style.colors.bgON,this.parentMenu.style.colors.fgON;var o=this.parentMenu.style.colors.bgOVER,i=this.parentMenu.style.colors.fgOVER||"";this.parentMenu.style.itemClass;""!=(this.parentMenu.style.itemClassOver||"")?(n.style.backgroundColor="",n.style.color=""):(n.style.backgroundColor=o,n.style.color=i)}t.items&&!this.isFilteringMode&&e&&this.showSubLevel(t)},t.prototype.deactivateItem=function(t){if(t){var e=t.itemDiv;if(e.classList.remove("active"),this.parentMenu.options.useDefaultStyles){var n=this.parentMenu.style.colors.bgON,o=this.parentMenu.style.colors.fgON;""!=(this.parentMenu.style.itemClass||"")?(e.style.backgroundColor="",e.style.color=""):(e.style.backgroundColor=n,e.style.color=o)}t.subLevel&&t.subLevel.hide(),this.activeItem=null}},t.prototype.showSubLevel=function(e){if(!e.subLevel){var n="";this.menuId&&(n=this.menuId+"-"+e.id),e.subLevel=new t({showSelected:this.showSelected,menu:this.parentMenu,parent:this,container:this.parentElement,items:e.items,levelIndex:this.levelIndex+1,domWriteItemsId:this.domWriteItemsId,menuId:n,itemRenderedCallback:this.itemRenderedCallback})}var o=Object(i.getElementAbsolutePos)(e.itemDiv),r=Object(i.getScrollPos)(),s=Object(i.getWinSize)(),a=o.x-r.left,l=s.width-a-e.itemDiv.offsetWidth;o.x+=e.itemDiv.offsetParent.offsetWidth,o.y+=1,e.subLevel.showAt(o.x,o.y,!0,!0),e.subLevel.levelDiv.style.width="",e.subLevel.levelDiv.style.right="",l>=e.subLevel.levelDiv.offsetWidth||l>=a?l<e.subLevel.levelDiv.offsetWidth&&(e.subLevel.levelDiv.style.right=-r.left+"px"):(a<e.subLevel.levelDiv.offsetWidth?e.subLevel.levelDiv.style.left=r.left+4+"px":e.subLevel.levelDiv.style.left="",e.subLevel.levelDiv.style.right=Object(i.getViewportSize)().width-o.x+e.itemDiv.offsetWidth-6+"px"),e.subLevel.levelDiv.style.visibility="visible",e.subLevel.focus()},t.prototype.adjustTopPos=function(t){var e=Object(i.getWinSize)(),n=t-Object(i.getScrollPos)().top+this.levelDiv.offsetHeight,o=t;return n>e.height-5&&(o-=n-e.height+5)<Object(i.getScrollPos)().top&&(o=Object(i.getScrollPos)().top+10),o},t.prototype.showAt=function(t,e,n,o){if(this.items){this.initLevelDiv(),this.turnCheckboxes(this.items),this.renderItems();var r=this.levelDiv.style;o&&(this.levelDiv.style.visibility="hidden"),r.display="block",r.left=t+"px",r.top=e+"px",this.scrollDiv.style.width="auto",this.scrollDiv.style.height="auto",n&&(e=this.adjustTopPos(e),r.top=e+"px");var s=this.parentMenu.minItemWidth;if(s>0&&this.scrollDiv.offsetWidth<s)for(var a=0;a<this.items.length;a++)this.items[a].itemDiv.style.width=s+"px";var l=this.parentMenu.maxItemWidth;if(l>0&&this.scrollDiv.offsetWidth>l)for(a=0;a<this.items.length;a++)this.items[a].itemDiv.style.width=l+"px",this.items[a].itemDiv.style.overflowX="hidden";var u=Object(i.getWinSize)().height-(e-Object(i.getScrollPos)().top)-15;if(this.parentMenu.maxHeight>0&&u>this.parentMenu.maxHeight&&(u=this.parentMenu.maxHeight),null!=this._applyItem&&null!=this._applyItem.itemDiv&&(u-=this._applyItem.itemDiv.offsetHeight+5),null!=this.searchDiv&&(u-=this.searchDiv.offsetHeight),null!=this.closeDiv&&(u-=this.closeDiv.offsetHeight),this.levelDiv.offsetHeight>u){var c=u;c<50&&(c=50),this.scrollDiv.style.height=c+"px"}else this.scrollDiv.style.height="auto";this.activeItem=null}},t.prototype.focus=function(){var t=this;window.setTimeout((function(){t.scrollDiv.focus(),null!=t.searchBox&&(t.parentMenu.options.searchBoxAutoFocus&&t.searchBox.focus(),t.searchBox.value="")}),100)},t.prototype.hide=function(){(null!==this.activeItem&&this.activeItem.subLevel&&this.activeItem.subLevel.hide(),this.levelDiv)&&(this.levelDiv.style.display="none",this.initialized&&(this.parentElement.removeChild(this.levelDiv),this.initialized=!1))},t.prototype.initLevelDiv=function(){this.initialized||(this.parentElement.appendChild(this.levelDiv),Object(i.domel)(this.levelDiv).addClass(this.cssPrefix+"-levelDiv").addClass(r.a.getMobileCssClass()),this.initialized=!0)},t.prototype.submit=function(t){if(null!=t&&!t.items){this.parentMenu.hideMenu();var e=[];t==this._applyItem&&this.submitItems(this.items,e),this.parentMenu.submitMenu(t,e)}},t.prototype.remove=function(){for(var t=0;t<this.items.length;t++){var e=this.items[t];e.subLevel&&e.subLevel.remove()}if(this.levelDiv){this.levelDiv.innerHTML="";var n=this.levelDiv.parentNode;null!=n&&n.removeChild(this.levelDiv)}this.levelDiv=null},t.prototype.update=function(t){this.remove(),this.items=t,this.activeItem=null,this.selectedItem=null,this._applyItem.itemDiv=null,this.initialized=!1,this.updated++,this.renderContent()},t.prototype.refreshCheckboxes=function(){for(var t=0;t<this.items.length;t++){var e=this.items[t];e.itemCheckbox&&(e.itemCheckbox.checked=this.isItemSelected(e)),e.subLevel&&e.subLevel.refreshCheckboxes()}},t.prototype.refreshItems=function(){for(var t=0;t<this.items.length;t++){var e=this.items[t];e.itemDiv&&(e.hidden?e.itemDiv.style.display="none":e.itemDiv.style.display="block"),e.subLevel&&e.subLevel.refreshItems()}},t.prototype.findItem=function(t){for(var e=t.toLowerCase(),n=0;n<this.items.length;n++){var o=this.items[n];if(0==o.text.toLowerCase().indexOf(e))return o}return null},t}(),l=function(){function t(e){var n=this;this.isCursorInside=!1,this.mouseIsOverBlock=!1,this.mouseIsOverLink=!1,this.toId=null,this.active=!1,this.ancorFocused=null,this.options={items:[],buttons:{submit:o.i18n.getText("ButtonApply"),cancel:o.i18n.getText("ButtonCancel")},itemFilterCallback:null,useDefaultStyles:!1,multiselect:!1,adjustHeight:!0,showSearchBoxAfter:30,activateOnMouseOver:!0,container:document.body,domWriteItemsId:!1,itemRenderedCallback:null,showItemIds:!1},e&&o.utils.assignDeep(this.options,e),this.options.hideButtons&&(this.options.submitOnBlur=!0),this.menuId=t.lastMenuID++,this.updateProps(),this.rootLevel=new a({menu:this,items:this.options.items,levelIndex:0,container:this.options.container,domWriteItemsId:this.options.domWriteItemsId,menuId:this.options.id,itemRenderedCallback:this.options.itemRenderedCallback,showSelected:this.options.showSelected}),this.rootLevel.levelDiv.classList.add(this.cssPrefix+"-rootLevel"),this.options.zIndex&&(this.rootLevel.levelDiv.style.zIndex=""+this.options.zIndex),this.menuKeyUpHandler=function(t){27==t.which&&(n.hideMenu(),t.stopImmediatePropagation())},this.globalMouseDownHandler=function(t){if(!n.active)return!0;for(var e=window.event||t,o=e.srcElement||e.target,i=!0;o;){if(o.tagName&&"div"==o.tagName.toLowerCase()&&o.menuLevel&&o.menuLevel.parentMenu==n){i=!1;break}o=o.parentNode||o.parentElement}return i&&(n.options.submitOnBlur&&n.rootLevel.submit(n.rootLevel.applyItem),n.hideMenu()),!0},this.render()}return Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"eqjs-menu"},enumerable:!0,configurable:!0}),t.prototype.getItems=function(){return this.rootLevel.getItems()},t.prototype.updateProps=function(){this.style={},this.style.colors={border:"#666666",shadow:"#888888",bgON:"white",fgON:"black",bgOVER:"#B6BDD2",fgOVER:"black"},this.style.itemStyle={fontSize:"14px"},this.minItemWidth=0,this.maxItemWidth=0,this.maxHeight=0,this.zIndex=""+this.options.zIndex,this.commandTemplate="",this.args=[],this.active=!1},t.prototype.render=function(){},t.prototype.clearItemsMenuProps=function(t){if(t)for(var e=0;e<t.length;e++)this.clearItemMenuProps(t[e])},t.prototype.clearItemMenuProps=function(t){t.subLevel&&t.subLevel.parentMenu==this||(t.subLevel&&(t.subLevel.remove(),t.subLevel=null),t.itemDiv&&(t.itemDiv=null),t.items&&this.clearItemsMenuProps(t.items))},t.prototype.setSelectedItems=function(t,e){for(var n=t?t.length:0,o=0;o<n;o++){var i=t[o];i.items?this.setSelectedItems(i.items,e):i.selected=e.indexOf(i.id)>=0}},t.prototype.getRootLevel=function(){return this.rootLevel},t.prototype.getItemFilterCallback=function(){return this.itemFilterCallback},t.prototype.showMenu=function(t){this.ancorFocused=t.anchor==document.activeElement?t.anchor:null,this.clearItemsMenuProps(this.options.items),this.itemSelectedCallback=t.itemSelectedCallback||null,this.menuClosedCallback=t.menuClosedCallback||null,this.itemFilterCallback=t.itemFilterCallback||null,t.items&&(this.options.items=t.items,this.rootLevel.setItems(t.items)),t.onMenuItemSelected&&(this.options.onMenuItemSelected=t.onMenuItemSelected);var e=t.selectedIds||null;if(e?"string"==typeof e&&(e=e.split(",")):e=[],this.active=!0,this.setSelectedItems(this.options.items,e),r.a.isMobileMode())this.rootLevel.showAt(0,0,!0,!0),this.rootLevel.levelDiv.style.top="0px",this.rootLevel.levelDiv.style.bottom="0px",this.rootLevel.levelDiv.style.right="0px",this.rootLevel.levelDiv.style.position="fixed",this.rootLevel.levelDiv.style.fontSize="20px";else{var n=t.anchor||document.documentElement,o=Object(i.getElementAbsolutePos)(n),a=n.offsetHeight,l=n.offsetHeight,u={x:o.x,y:o.y+a+2},c=Object(i.getScrollPos)(),d=Object(i.getWinSize)(),h=u.x+l-c.left,p=d.width-h+l;u.x+=2,this.rootLevel.showAt(u.x,u.y,!0,!0),this.rootLevel.levelDiv.style.width="",this.rootLevel.levelDiv.style.right="",this.rootLevel.levelDiv.style.zIndex||(this.rootLevel.levelDiv.style.zIndex=""+Math.max(1e4,Object(s.c)(n)+1)),p>=this.rootLevel.levelDiv.offsetWidth||p>=h?p<this.rootLevel.levelDiv.offsetWidth&&(this.rootLevel.levelDiv.style.right=-c.left+"px"):(h<this.rootLevel.levelDiv.offsetWidth?this.rootLevel.levelDiv.style.left=c.left+4+"px":this.rootLevel.levelDiv.style.left="",this.rootLevel.levelDiv.style.right=Object(i.getViewportSize)().width-u.x-l+"px"),this.rootLevel.levelDiv.style.fontSize="14px"}this.rootLevel.levelDiv.style.visibility="visible",this.rootLevel.focus(),document.addEventListener("keyup",this.menuKeyUpHandler),document.addEventListener("mousedown",this.globalMouseDownHandler,!0)},t.prototype.hideMenu=function(){document.removeEventListener("mousedown",this.globalMouseDownHandler,!0),document.removeEventListener("keyup",this.menuKeyUpHandler),this.rootLevel.hide(),this.ancorFocused&&this.ancorFocused.focus(),this.menuClosedCallback&&this.menuClosedCallback()},t.prototype.submitMenu=function(t,e){this.itemSelectedCallback&&this.itemSelectedCallback(t,e)},t.prototype.knockMenuStyle=function(t){t.removeAttribute("style");var e=t.querySelectorAll("ul").item(0);!1!==!(!e||!e.style)&&e.setAttribute("style","")},t.prototype.refreshItems=function(){this.rootLevel.refreshItems()},t.prototype.refreshCheckboxes=function(){this.rootLevel.refreshCheckboxes()},t.lastMenuID=0,t}()},function(t,e,n){"use strict";var o;n.d(e,"a",(function(){return o})),function(t){t[t.None=0]="None",t[t.Value=1]="Value",t[t.Attribute=2]="Attribute",t[t.Operator=4]="Operator",t[t.Addition=8]="Addition",t[t.Removal=16]="Removal",t[t.All=255]="All",t[t.NoAddition=-9]="NoAddition",t[t.NoRemoval=-17]="NoRemoval",t[t.FixedConditionList=5]="FixedConditionList"}(o||(o={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var o,i=n(48),r=n(7),s=n(17);!function(t){t.getAllDataTypes=function(){return Object.values(r.a).filter((function(t){return"number"==typeof t}))},t.getDateDataTypes=function(){return[r.a.Time,r.a.Date,r.a.DateTime]},t.getStringDataTypes=function(){return[r.a.String,r.a.Memo,r.a.FixedChar]};var e=[r.a.Byte,r.a.Word,r.a.Int32,r.a.Int64,r.a.Float,r.a.Currency,r.a.Autoinc];t.getNumericDataTypes=function(){return e};var n=[r.a.Byte,r.a.Word,r.a.Int32,r.a.Int64,r.a.Autoinc];function o(t,e,n){e||(e={});for(var i=0,r=n;i<r.length;i++){var s=r[i];if(s)for(var l in s)if(s.hasOwnProperty(l)){var u=s[l];null!==u&&"object"==typeof u?t.has(u)?e[l]=t.get(u):Array.isArray(u)?(e[l]=a(u),t.set(u,e[l])):(void 0!==e[l]&&null!=e[l]||(e[l]=Object.create(Object.getPrototypeOf(u))),t.set(u,e[l]),o(t,e[l],[u])):e[l]=u}}return e}function a(t){for(var e=[],n=0,o=t;n<o.length;n++){var i=o[n];e.push(i)}return e}t.assign=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var o=0;o<e.length;o++){var i=e[o];if(i)for(var r in i)i.hasOwnProperty(r)&&(t[r]=i[r])}return t},t.assignDeep=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return o(new WeakMap,t,e)},t.getIfDefined=function(t,e){return void 0!==t?t:e},t.IsDefinedAndNotNull=function(t){return null!=t},t.copyArrayTo=function(t,e){for(var n=t.length,o=e.length,i=0;i<n&&i<o;i++)e[i]=t[i]},t.createArrayFrom=a,t.findItemById=function(t,e){for(var n=t.length,o=0;o<n;o++)if(t[o].id===e)return t[o];return null},t.findItemIndexById=function(t,e){for(var n=t.length,o=0;o<n;o++)if(t[o].id===e)return o;return-1},t.indexOfArrayItem=function(t,e){if(t.indexOf)return t.indexOf(e);for(var n=t.length,o=0;o<n;o++)if(e==t[o])return o;return-1},t.moveArrayItem=function(t,e,n){if(e>=t.length)throw"Index out of bounds: "+e;n>=t.length&&(n=t.length-1);var o=t.splice(e,1)[0];t.splice(n,0,o)},t.removeArrayItem=function(t,e){var n=t.indexOf(e);if(-1!=n)return t.splice(n,1)[0]},t.insertArrayItem=function(t,e,n){t.splice(e,0,n)},t.fillArray=function(t,e,n,o){void 0===n&&(n=0);for(var i=t.length>>>0,r=n>>0,s=r<0?Math.max(i+r,0):Math.min(r,i),a=void 0===o?i:o>>0,l=a<0?Math.max(i+a,0):Math.min(a,i);s<l;)t[s]=e,s++;return t},t.shiftToFitWindow=function(t,e){var n=document.getElementsByTagName("body")[0],o=window.innerWidth||document.documentElement.clientWidth||n.clientWidth,i=t+e,r=0;return i>o&&t+(r=o-i-10)<0&&(r=10-t),r},t.isObject=function(t){return null!==t&&("function"==typeof t||"object"==typeof t)},t.isNumericType=function(t){return e.indexOf(t)>=0},t.isIntType=function(t){return n.indexOf(t)>=0},t.isNumeric=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},t.areCompatibleDataTypes=function(t,e){return void 0===t||void 0===e||t==r.a.Unknown||e==r.a.Unknown||t==e||t==r.a.Date&&e==r.a.DateTime||t==r.a.DateTime&&e==r.a.Date},t.isPropSet=function(t,e){return t[e]||t[e.toLowerCase()]||t[e.toUpperCase()]};var l="0123456789abcdefghijklmnopqrstuvwxyz";function u(t,e){var n=t.length;if(n>e){var o=n/e,i="";i+=t[0];for(var r=o,s=void 0,a=1;a<n;a++)s=t[a],a+1>r&&(i+=s,r+=o);return i}return t}function c(t,e,n){return t.substr(0,e)+n+t.substr(e+n.length)}function d(t,e){return Math.floor(Math.random()*(e-t))+t}function h(t){var e=parseInt(t);if(isNaN(e))throw'"'+t+'" is not a valid number';return e}t.generateId=function(t){t||(t="easy");var e=t.length>4?function(t,e){var n=t.split("-"),o=1,i=e;n.length<e&&(o=e/n.length,i=n.length);for(var r="",s=0;s<i;s++)r+=u(n[s],o);return r}(t,4):t;e&&e.length>0&&(e+="-");var n=i.b("",2),o=l.length-1;return n=c(n,0,l[d(0,o)]),e+(n=c(n,1,l[d(0,o)]))+function(t){var e=36,n=14,o=i.b("",n),r=t;do{o=c(o,n--,l[r%e]),r=Math.floor(r/=e)}while(r>0);return i.c(o.trim())}(621355968e9+1e4*(new Date).getTime()-0x8d60e562e627800)},t.strToDateTime=function(t,e){if(!t||0==t.length)return new Date;var n=t.replace(/[^a-zA-Z0-9_]/g,"-"),o=e.replace(/[^a-zA-Z0-9_]/g,"-").split("-"),i=n.split("-"),r=o.indexOf("MM"),s=o.indexOf("dd"),a=o.indexOf("yyyy"),l=o.indexOf("HH"),u=o.indexOf("mm"),c=o.indexOf("ss"),d=new Date;try{var p=a>-1&&a<i.length?h(i[a]):d.getFullYear(),f=r>-1&&r<i.length?h(i[r])-1:d.getMonth()-1;if(f>11)throw"";var g=s>-1&&s<i.length?h(i[s]):d.getDate();if(g>function(t,e){return new Date(e,t+1,0).getDate()}(f,p))throw"";var y=l>-1&&l<i.length?h(i[l]):0;if(y>23)throw"";var m=u>-1&&u<i.length?h(i[u]):0;if(m>59)throw"";var v=c>-1&&c<i.length?h(i[c]):0;if(v>59)throw"";return new Date(p,f,g,y,m,v)}catch(e){throw t+" is not a valid date."}},t.strToTime=function(t){var e=t.split(":");try{var n=e.length>0?h(e[0]):0;if(n>23)throw"";var o=e.length>1?h(e[1]):0;if(o>59)throw"";var i=e.length>1?h(e[1]):0;if(i>59)throw"";return new Date(0,0,0,n,o,i)}catch(e){throw t+" is not a valid time."}};var p=/\[([^\]]+)]|y{4}|M{1,4}|d{1,2}|H{1,2}|h{1,2}|m{2}|s{2}|t{2}/g;t.dateTimeToStr=function(t,e){var n=t.getFullYear(),o=t.getMonth()+1,i=t.getDate(),r=t.getHours(),a=t.getMinutes(),l=t.getSeconds(),u=r%12||12,c=r>11,d={yyyy:n.toString(),MMMM:s.a.getLongMonthName(o),MMM:s.a.getShortMonthName(o),MM:o<10?"0"+o:o.toString(),M:o.toString(),dd:i<10?"0"+i:i.toString(),d:i.toString(),HH:r<10?"0"+r:r.toString(),H:r.toString(),hh:u<10?"0"+u:u.toString(),h:u.toString(),tt:c?"PM":"AM",mm:a<10?"0"+a:a.toString(),ss:l<10?"0"+l:l.toString()};return e.replace(p,(function(t,e){return e||d[t]}))},t.numberToStr=function(t,e){return e=e||s.a.getLocaleSettings().decimalSeparator,t.toString().replace(".",e)}}(o||(o={}))},function(t,e,n){"use strict";var o;n.d(e,"a",(function(){return o})),function(t){t[t.Scalar=0]="Scalar",t[t.Const=1]="Const",t[t.Attribute=2]="Attribute",t[t.List=4]="List",t[t.Query=5]="Query",t[t.ParentColumn=6]="ParentColumn"}(o||(o={}))},function(t,e,n){"use strict";var o,i;n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return i})),function(t){t[t.Conditions=1]="Conditions",t[t.Columns=2]="Columns",t[t.SortingColumns=4]="SortingColumns",t[t.Properties=32]="Properties",t[t.ExtraData=64]="ExtraData",t[t.Facets=128]="Facets",t[t.Aggregation=256]="Aggregation",t[t.All=511]="All"}(o||(o={})),function(t){t[t.Add=1]="Add",t[t.Modify=2]="Modify",t[t.Delete=4]="Delete",t[t.Activate=8]="Activate",t[t.All=127]="All"}(i||(i={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var o,i=n(0),r=n(59),s=n(16);!function(t){t.combinePath=function(t,e){var n=t;return null!=n&&n.length>0?("/"!=n.charAt(n.length-1)&&(n+="/"),n+=e):n=e,n},t.strToLinkType=function(t){return"All"==t?s.a.All:"NotAll"==t?s.a.NotAll:"Any"==t?s.a.Any:s.a.None},t.linkTypeToStr=function(t){return t===s.a.All?"All":t===s.a.NotAll?"NotAll":t==s.a.Any?"Any":"None"},t.parseOperatorFormat=function(t){var e=i.i18n.getText("Operators",t.id,"format");return e||(e=i.i18n.getText("Operators",t.id,"displayFormat")),e||(e=t.displayFormat),new r.a(e).parse()},t.convertValue=function(t,e,n){switch(n){case i.DataType.String:return t;case i.DataType.Autoinc,i.DataType.Byte,i.DataType.Int32,i.DataType.Int64,i.DataType.Word:var o=parseInt(t);return isNaN(o)?"":o.toString();case i.DataType.Currency,i.DataType.Float:var r=parseFloat(t);return isNaN(r)?"":r.toString();default:return""}}}(o||(o={}))},function(t,e,n){"use strict";var o;n.d(e,"a",(function(){return o})),function(t){t.DataGrid="DATA_GRID",t.Chart="CHART",t.PivotTable="PIVOT_TABLE"}(o||(o={}))},function(t,e,n){"use strict";var o;n.d(e,"a",(function(){return o})),function(t){t[t.None=0]="None",t[t.Any=1]="Any",t[t.NotAll=2]="NotAll",t[t.All=3]="All"}(o||(o={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var o,i=n(7),r=n(11);!function(t){var e,n={shortDateFormat:"MM/dd/yyyy",longDateFormat:"dd MMM, yyyy",editDateFormat:"MM/dd/yyyy",shortTimeFormat:"HH:mm",editTimeFormat:"HH:mm",longTimeFormat:"HH:mm:ss",shortMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longMonthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],shortWeekDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longWeekDayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],decimalSeparator:".",currency:"USD"},o={localeId:"en-US",englishName:"English",displayName:"English",texts:{ButtonOK:"OK",ButtonCancel:"Cancel",Yes:"Yes",No:"No",True:"True",False:"False"},settings:n},s={"en-US":o},a=[];function l(t){for(var e=0,n=a;e<n.length;e++){(0,n[e])(t)}}function u(){return e.localeId}function c(t){var n=s[t];n?r.a.assignDeep(e,n):(e.englishName=t,e.displayName=t,e.texts=r.a.assignDeep({},o.texts)),e.localeId=t}function d(){return e.settings}function h(t){e.settings||(e.settings=r.a.assignDeep({},n)),e.settings=r.a.assignDeep(e.settings,t)}function p(t,n){l(n);var i=e;t&&(n.localeId||(n.localeId=t),(i=s[t])||(i=r.a.assignDeep({},o),s[t]=i)),r.a.assignDeep(i,n)}function f(){var t,n,o,i,r,s,a="object"==typeof navigator?navigator.language:void 0;t=a,n=new Date(2020,5,7,19,34,56,88),o=n.toLocaleDateString(t,{year:"numeric",month:"numeric",day:"numeric"}),i=n.toLocaleTimeString(t,{hour:"numeric",minute:"numeric",second:"numeric"}),r=o.replace("07","dd").replace("7","d").replace("06","MM").replace("6","M").replace("2020","yyyy").replace("20","yy"),s=i.replace("19","HH").replace("07","hh").replace("7","h").replace("34","mm").replace("56","ss").replace("PM","tt"),e.settings||(e.settings={}),h({shortDateFormat:r,shortTimeFormat:s})}function g(t){var e,n=d();switch(t){case i.a.Date:e=n.shortDateFormat;break;case i.a.Time:e=n.shortTimeFormat;break;default:e=n.shortDateFormat+" "+n.shortTimeFormat}return e}function y(t){var e,n=d();switch(t){case i.a.Date:e=n.longDateFormat;break;case i.a.Time:e=n.longTimeFormat;break;default:e=n.longDateFormat+" "+n.longTimeFormat}return e}t.addMapper=function(t){a.push(t)},t.getLocales=function(){var t=[];for(var e in s)t.push({locale:e,englishName:s[e].englishName,displayName:s[e].displayName});return t.sort((function(t,e){return t.englishName>e.englishName?1:t.englishName===e.englishName?0:-1}))},t.getCurrentLocale=u,t.setLocale=function(t){console.warn("This method is deprecated. Use setCurrentLocale instead"),c(t)},t.setCurrentLocale=c,t.getText=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=e.texts,i="";if(t&&t.length)for(var r=t.length,s=0;s<r&&"object"==typeof(i=o[t[s]]);s++)o=i;return i},t.getLocaleSettings=d,t.getOneLocaleSetting=function(t){return e.settings[t]},t.getShortMonthName=function(t){var e=d();if(t>0&&t<13)return e.shortMonthNames[t-1];throw"Wrong month number: "+t},t.getLongMonthName=function(t){var e=d();if(t>0&&t<13)return e.longMonthNames[t-1];throw"Wrong month number: "+t},t.getShortWeekDayName=function(t){var e=d();if(t>0&&t<8)return e.shortWeekDayNames.length>=t?e.shortWeekDayNames[t-1]:t.toString();throw"Wrong month number: "+t},t.getLongWeekDayName=function(t){var e=d();if(t>0&&t<8)return e.longWeekDayNames.length>=t?e.longWeekDayNames[t-1]:t.toString();throw"Wrong month number: "+t},t.updateLocaleSettings=h,t.updateLocaleTexts=function(t){"object"==typeof t?(l({localeId:e.localeId,texts:t}),r.a.assignDeep(e.texts,t)):console.error("Wrong parameter type in updateLocaleTexts function call.The first parameter (localeId) is not necessary. Use updateLocaleTexts(texts) instead")},t.updateDefaultTexts=function(t){for(var n in s){var o=s[n];o.texts=r.a.assignDeep({},t,o.texts)}e.texts=r.a.assignDeep({},t,e.texts)},t.updateLocaleInfo=p,t.addLocale=function(t,e){p(t,e)},t.resetLocales=function(){e||(e=r.a.assignDeep({},o),f())},t.dateTimeToStr=function(t,e,n){return n?"d"==n?n=g(i.a.Date):"D"==n?n=y(i.a.Date):"f"==n?n=g(i.a.DateTime):"F"==n&&(n=y(i.a.DateTime)):n=g(e),r.a.dateTimeToStr(t,n)},t.numberToStr=function(e,n){if(n&&n.length>0){var o=n.charAt(0).toUpperCase();if("S"===o)return function(e,n){if(!m[n]){var o=n.split("|").filter((function(t){return t.length>0})).map((function(t){return t.split("=")}));if(m[n]={},o.length>0)if(o[0].length>1)for(var i=0,r=o;i<r.length;i++){var s=r[i];m[n][Number.parseInt(s[1])]=s[0]}else o.forEach((function(t,e){m[n][e]=t[0]}))}var a=m[n];if(void 0!==a[e]){s=a[e];return t.getText(s)||s}return e.toString()}(e,n.slice(1));if(["D","F","C"].indexOf(o)>=0){var i=u();return e.toLocaleString(i,function(t){var e=d(),n=t[0].toUpperCase(),o=t.length>1?Number.parseInt(t.slice(1)):"D"==n?1:2;switch(n){case"D":return{style:"decimal",useGrouping:!1,minimumIntegerDigits:o};case"C":return{style:"currency",currency:e.currency,minimumFractionDigits:o};default:return{style:"decimal",minimumFractionDigits:o,maximumFractionDigits:o}}}(n))}return function(t,e){for(var n=t.toString(),o="",i=n.length-1,r=e.length-1;r>=0;r--){var s=e.charAt(r);"#"===s||"0"===s?i>=0?(o+=n.charAt(i),i--):"0"===s&&(o+=0):o+=s}return o.split("").reverse().join("")}(Math.trunc(e),n)}var s=d();return r.a.numberToStr(e,s.decimalSeparator)},t.booleanToStr=function(e,n){if(n&&n.length>0&&"S"===n.charAt(0).toUpperCase()){var o=n.slice(1).split("|");if(o.length>1){var i=o[e?1:0];return t.getText(i)||i}}return""+e};var m={}}(o||(o={}))},function(t,e,n){"use strict";n.d(e,"q",(function(){return i})),n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return s})),n.d(e,"k",(function(){return a})),n.d(e,"m",(function(){return l})),n.d(e,"p",(function(){return u})),n.d(e,"l",(function(){return c})),n.d(e,"c",(function(){return d})),n.d(e,"i",(function(){return h})),n.d(e,"f",(function(){return p})),n.d(e,"h",(function(){return f})),n.d(e,"g",(function(){return g})),n.d(e,"j",(function(){return y})),n.d(e,"n",(function(){return m})),n.d(e,"o",(function(){return v})),n.d(e,"e",(function(){return b})),n.d(e,"d",(function(){return C}));var o=n(68);function i(t,e){for(t.appendChild(e);t.firstChild!==e;)e.appendChild(t.firstChild)}function r(t,e,n){var o=document.createElement(e),i=n||{};return i.cssClass&&(o.className=i.cssClass),t.appendChild(o),o}function s(t,e){t.className=t.className?t.className+" "+e:e}function a(t){t.style.display="none"}function l(t,e){e||(e=""),t.style.display=e}function u(t,e,n){n||(n={}),n.display||(n.display=""),n.duration||(n.duration=200),a(t),l(e,n.display),n.complete&&n.complete()}function c(t){return"none"!=t.style.display&&0!=t.offsetWidth&&0!=t.offsetHeight}function d(t){var e;return"function"==typeof Event?e=new Event(t):(e=document.createEvent("Event")).initEvent(t,!0,!0),e}function h(){return{width:Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),height:Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)}}function p(){return o.a.IsIE()?y():{width:Math.max(document.documentElement.clientWidth,document.body.clientWidth||0),height:Math.max(document.documentElement.clientHeight,document.body.clientHeight||0)}}function f(){var t=document.body,e=document.documentElement;return{top:window.pageYOffset||e.scrollTop||t.scrollTop,left:window.pageXOffset||e.scrollLeft||t.scrollLeft}}function g(t){var e={x:0,y:0};if(null!==t){var n=function(t){var e,n={top:0,right:0,bottom:0,left:0,width:0,height:0};try{e=t.getBoundingClientRect()}catch(t){e=n}var o=document.body,i=document.documentElement,r=f(),s=r.top,a=r.left,l=i.clientTop||o.clientTop||0,u=i.clientLeft||o.clientLeft||0,c=e.top+s-l,d=e.left+a-u;return{top:Math.round(c),left:Math.round(d)}}(t);e={x:n.left,y:n.top}}return e}function y(){return{width:window.innerWidth,height:window.innerHeight}}function m(t,e,n){t.style.removeProperty("display");var o=window.getComputedStyle(t).display;"none"===o&&(o="block"),t.style.display=o;var i=t.offsetHeight;t.style.overflow="hidden",t.style.height="0px",t.style.paddingTop="0px",t.style.paddingBottom="0px",t.style.marginTop="0px",t.style.marginBottom="0px",t.offsetHeight,t.style.boxSizing="border-box",t.style.transitionProperty="height, margin, padding",t.style.transitionDuration=e+"ms",t.style.height=i+"px",t.style.removeProperty("padding-top"),t.style.removeProperty("padding-bottom"),t.style.removeProperty("margin-top"),t.style.removeProperty("margin-bottom"),window.setTimeout((function(){t.style.removeProperty("height"),t.style.removeProperty("overflow"),t.style.removeProperty("transition-duration"),t.style.removeProperty("transition-property"),t.style.removeProperty("box-sizing"),n&&n()}),e)}function v(t,e,n){t.style.transitionProperty="height, margin, padding",t.style.transitionDuration=e+"ms",t.style.boxSizing="border-box",t.style.height=t.offsetHeight+"px",t.offsetHeight,t.style.overflow="hidden",t.style.height="0px",t.style.paddingTop="0px",t.style.paddingBottom="0px",t.style.marginTop="0px",t.style.marginBottom="0px",window.setTimeout((function(){t.style.display="none",t.style.removeProperty("height"),t.style.removeProperty("padding-top"),t.style.removeProperty("padding-bottom"),t.style.removeProperty("margin-top"),t.style.removeProperty("margin-bottom"),t.style.removeProperty("overflow"),t.style.removeProperty("transition-duration"),t.style.removeProperty("transition-property"),t.style.removeProperty("box-sizing"),n&&n()}),e)}var b="eqjs",C="eqjs-mobile"},function(t,e,n){"use strict";var o;n.d(e,"a",(function(){return o})),function(t){t[t.Unknown=0]="Unknown",t[t.Simple=1]="Simple",t[t.Group=51]="Group"}(o||(o={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var o=n(0),i=n(14),r=n(12),s=n(8),a=function(){function t(t){var e=this;this.parent=t,this.tag=s.a.Constant,this.kind=r.a.Scalar,this.dataType=o.DataType.Unknown,this._value="",this.distinct=!1,this._isDefaultValue=!1,this.getText=function(){return e.text||e._value},this.args=new Array}return t.prototype.getParent=function(){return this.parent},t.prototype.getModel=function(){return this.parent.getQuery().getModel()},t.prototype.loadFromData=function(e,n){if(n)if(this.tag=n.tag,n.val?(this._value=n.val,this.text=n.txt):n.id&&(this.kind=r.a.Attribute,this._value=n.id,this.text=n.txt),void 0!==n.dtype&&(this.dataType=n.dtype),this.tag==s.a.EntityAttribute||this.tag==s.a.ParentEntityAttribute)this.kind=r.a.Attribute;else{if(void 0!==n.kind&&(this.kind=n.kind),n.query&&(this.subQuery=this.parent.getQuery().createSubQuery(),this.subQuery.loadFromDataOrJson(n.query)),void 0!==n.distinct&&(this.distinct=n.distinct),n.func&&(this.func=n.func,n.args))for(var o=0;o<n.args.length;o++){var i=new t(this.parent);i.loadFromData(e,n.args[o]),this.args.push(i)}n.sql&&(this.sql=n.sql,this.baseAttrId=n.baseAttrId)}},t.prototype.saveToData=function(){var t={tag:this.tag};if(t.dtype=this.dataType,this.tag==s.a.EntityAttribute||this.tag==s.a.ParentEntityAttribute)this._value&&(t.id=this._value,t.val=this._value),this.text&&(t.txt=this.text);else{if(this.subQuery&&(t.query=this.subQuery.toJSONData()),void 0!==this.kind&&(t.kind=this.kind),this._value&&(t.val=this._value),this.text&&(t.txt=this.text),this.distinct&&(t.distinct=this.distinct),this.func){t.func=this.func,t.args=[];for(var e=0;e<this.args.length;e++)t.args.push(this.args[e].saveToData())}this.sql&&(t.sql=this.sql,t.baseAttrId=this.baseAttrId)}return t},t.prototype.getIndex=function(){return this.parent.getExpressionIndex(this)},Object.defineProperty(t.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),t.prototype.setValue=function(t,e){void 0===e&&(e=!1),this.setContent(t,void 0,e)},t.prototype.setContent=function(t,e,n){void 0===n&&(n=!1);var o=this.value;if(this.kind==r.a.Attribute&&t){var i=this.getModel().getAttributeById(t);if(!i)throw"No such entity attribute:"+t;this.dataType=i.dataType}this._value=t,void 0!==e?this.text=e:void 0!==this.text&&(this.text=t),this._isDefaultValue=!1,n||this.parent.expressionChanged(this,o)},t.prototype.isEmpty=function(){return!(this.text||this._value)},t.prototype.hasText=function(){return this.text&&this.text.length>0},t.prototype.tryCopyValueFrom=function(t){if(this.kind==t.kind){if(this.dataType==t.dataType)this.setContent(t.value.length?t.value:this._value,t.text&&t.text.length?t.text:this.text,!0);else{var e=i.a.convertValue(t.value,t.dataType,this.dataType);this.setContent(e.length?e:this._value,t.text&&t.text.length?t.text:this.text,!0)}this.subQuery=t.subQuery,this.sql=t.sql,this.baseAttrId=t.baseAttrId}else this._isDefaultValue||(this.setContent("","",!0),this.subQuery=null,this.sql=null,this.baseAttrId=null)},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var o,i=n(0),r=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t){function e(){return t.call(this)||this}return r(e,t),e.prototype.loadFromData=function(e){t.prototype.loadFromData.call(this,e),e&&(e.sql&&(this.statement=e.sql),e.extraParams&&(this.extraParams=e.extraParams))},e}(i.ValueEditor)},function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return s})),n.d(e,"c",(function(){return a}));var o,i=n(0),r=n(39);!function(t){t[t.NONE=1]="NONE",t[t.LEFT=2]="LEFT",t[t.CENTER=3]="CENTER",t[t.RIGHT=4]="RIGHT"}(o||(o={}));var s=function(){function t(t,e,n){void 0===n&&(n=!1),this._label=null,this._description=null,this.align=o.NONE,this.isVisible=!0,this.isRowNum=!1,this.dataColumn=t,this.grid=e;var s=e.options.columnWidths||{};t?(t.style.alignment&&(this.align=function(t){switch(t){case i.ColumnAlignment.Left:return o.LEFT;case i.ColumnAlignment.Center:return o.CENTER;case i.ColumnAlignment.Right:return o.RIGHT;default:return o.NONE}}(t.style.alignment)),this.width=s&&s[this.type]?s[this.type].default:250,this.cellRenderer=this.grid.cellRendererStore.getDefaultRenderer(t.type),this._description=t.description):n&&(this.isRowNum=!0,this.width=s&&s.rowNumColumn?s.rowNumColumn.default:60,this._label="",this.cellRenderer=this.grid.cellRendererStore.getDefaultRendererByType(r.a.NUMBER)),e&&e.options&&e.options.onGetCellRenderer&&(this.cellRenderer=e.options.onGetCellRenderer(this,this.cellRenderer)||this.cellRenderer)}return Object.defineProperty(t.prototype,"label",{get:function(){return this._label?this._label:this.isRowNum?"":this.dataColumn.label},set:function(t){this._label=this.label},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"description",{get:function(){return this._description},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return this.dataColumn?this.dataColumn.type:null},enumerable:!0,configurable:!0}),t}(),a=function(){function t(t,e){this.items=[],this.grid=e,this.sync(t)}return t.prototype.sync=function(t,e){void 0===e&&(e=!0),this.clear();var n=new s(null,this.grid,!0);if(this.add(n),e||(n.isVisible=!1),t)for(var o=0,i=t.getItems();o<i.length;o++){var r=i[o],a=new s(r,this.grid);this.grid.options.onSyncGridColumn&&this.grid.options.onSyncGridColumn(a),this.add(a)}},Object.defineProperty(t.prototype,"count",{get:function(){return this.items.length},enumerable:!0,configurable:!0}),t.prototype.add=function(t){var e=this.items.length;return this.items.push(t),e},t.prototype.put=function(t,e){t>=0&&t<this.items.length&&(this.items[t]=e)},t.prototype.move=function(t,e){var n=this.items.indexOf(t);n>=0&&n!=e&&i.utils.moveArrayItem(this.items,n,e)},t.prototype.get=function(t){return t>=0&&t<this.items.length?this.items[t]:null},t.prototype.getItems=function(){return this.items},t.prototype.removeAt=function(t){this.get(t);this.items.splice(t,1)},t.prototype.clear=function(){this.items=[]},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return a}));var o,i=n(0),r=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t){function e(e){var n=t.call(this,e)||this;return n.useInConditions=!1,n.useInResult=!1,n.useInSorting=!1,n}return r(e,t),e.prototype.loadFromData=function(e,n){t.prototype.loadFromData.call(this,e,n),n&&(this.useInConditions=n.uic,this.useInResult=n.uir,this.useInSorting=n.uis)},e.prototype.scan=function(e,n){t.prototype.scan.call(this,(function(t,n){return e&&e(t,n)}),(function(t,e){return n&&n(t,e)}))},e}(i.MetaEntity),a=function(t){function e(e){var n=t.call(this,e)||this;return n.params=[],n.useInConditions=!0,n.useInResult=!0,n.useInSorting=!0,n.defaultOperator="",n.operators=new Array,n.lookupAttr="",n.expr="",n}return r(e,t),e.prototype.loadFromData=function(e,n){t.prototype.loadFromData.call(this,e,n),n&&(this.useInConditions=n.uic,this.useInResult=n.uir,this.useInSorting=n.uis,this.expr=n.sql,this.defaultOperator=n.defOperator,this.operators=n.ops,n.udata&&(this.userData=n.udata))},e}(i.MetaEntityAttr)},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var o,i=n(0),r=n(2),s=n(42),a=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(e,n,o,i){var r=t.call(this,i)||this;return r.panel=e,r.expression=n,r.valueEditor=o,r}return a(e,t),Object.defineProperty(e.prototype,"cssPrefix",{get:function(){return"eqjs-qp"},enumerable:!0,configurable:!0}),e.prototype.render=function(e){return void 0===e&&(e=!1),t.prototype.render.call(this,e),this.panel.options.onExpressionRendered&&this.panel.options.onExpressionRendered(this.expression,this.element),this.element},e.prototype.getContext=function(){return this.panel.getContext()},e.prototype.isReadOnly=function(){var t=this.expression.getParent();return!t.enabled||t.isReadOnly()},e.prototype.isEditable=function(){return!this.isReadOnly()},e.prototype.getClassesToAdd=function(){return this.cssPrefix+"-condelement "+this.cssPrefix+"-valueelement"},e.prototype.getLabelText=function(){return this.expression.isEmpty()?this.getEmptyText():this.expression.value},e.prototype.getEmptyText=function(){return this.panel.options.emptyTextValue||i.i18n.getText("MsgEmptyScalarValue")},e.prototype.setValue=function(t,e){this.expression.setValue(t),e||this.expression.getParent().fireChangedEvent(r.ConditionPart.Value)},e.prototype.getValue=function(){return this.expression.value},e.prototype.validateInput=function(t){return{success:!0,value:t}},e.prototype.showValidationError=function(t,e){this.getContext().throwError({action:"ui.validation",text:t})},e.prototype.isEmptyValue=function(){var t=this.getValue();return null==t||!t},e.prototype.adjustWidth=function(){},e}(s.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return T}));var o,i=n(0),r=n(2),s=n(1),a=n(10),l=n(9),u=n(35),c=n(78),d=n(80),h=n(52),p=n(81),f=n(26),g=n(82),y=n(83),m=n(84),v=n(4),b=n(3),C=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),x=function(t){function e(e,n,o,i){var s=t.call(this,e,n,o,i)||this;return s.expression.tag=r.ExprTag.ParentColumn,s}return C(e,t),e.prototype.fillMenuItemsList=function(t){var e=this.panel.getQuery().getParentQuery(),n=this.expression.getParent().expressions[0].dataType;this.menuItemsList=e.getColumns().filter((function(t){return t.expr.dataType==n})).map((function(t){return{id:t.id,text:t.caption}})),t&&t()},e}(f.a),w=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),T=function(t){function e(e,n){var o=t.call(this,e)||this;return o.options={editableParts:a.a.All,isSubQuery:!1,activeCondition:null,entitiesPopupHandler:null,entitiesListFilter:null,menuContainer:document.body,showRootRow:!0,showAddRow:!0,showCheckboxes:!1,allowParameterization:!1,allowInJoinConditions:!1,showPoweredBy:!1,buttons:{condition:null,group:null},alwaysShowButtonsInGroups:!1,alwaysShowButtonsInConditions:!1,showConjunctions:!0,accentActiveCondition:!0,activateRootOnStart:!0,yearRange:"c-10:c+10",oneClickDateSelection:!0,showDateTimeInput:!1,attrElementFormat:"{entity} {attr}",menuOptions:{showSearchBoxAfter:30,searchBoxAutoFocus:!0,activateOnMouseOver:!0,itemRenderedCallback:null},allowDragDrop:!0,attrPlacement:0,sortEntities:!1,subQueryDialogWidth:600,subQueryDialogHeight:300,dialogZIndex:1e5,numberListSeparators:[",",";"],autoEditNewCondition:!1,onConditionRendered:null,onGetConditionRenderer:null,onGetExpressionRenderer:null,onGetOperatorRenderer:null,onOperatorRendered:null,onGetAddRowRenderer:null,defaultQuery:null},o.customQuery=null,o.landingSlot=Object(s.domel)("div").addClass(o.cssPrefix+"-cond-landing-slot").addChildElement(Object(s.domel)("div").toDOM()).toDOM(),o.slot.classList.contains(o.cssPrefix+"-panel")||o.slot.classList.add(o.cssPrefix+"-panel"),o.group=r.WidgetGroup.Query,n&&(o.customQuery=n),o}return w(e,t),Object.defineProperty(e.prototype,"cssPrefix",{get:function(){return"eqjs-qp"},enumerable:!0,configurable:!0}),e.prototype.getWidgetType=function(){return"queryPanel"},e.prototype.init=function(e,n){var o=this;if(t.prototype.init.call(this,e,n),this.setOptions(n),this.detachQueryObserver(),this.attachQueryObserver(),s.eqDragManager.removeDropContainer(this.slot),this.options.allowDragDrop){var i=this.getContext().getModel();s.eqDragManager.registerDropContainer({element:this.slot,scopes:["entityAttr"],onDragEnter:function(t,e){o.slot.classList.add(v.b+"-drophover"),e.dragImage.classList.add("eqjs-sortable-helper"),o.showLandingSlot();var n=e.data.attrId;i.checkAttrProperty(n,"useInConditions")||(e.dropEffect=s.DropEffect.Forbid)},onDragOver:function(t,e){},onDragLeave:function(t,e){e.dragImage.classList.remove("eqjs-sortable-helper"),e.dragImage.style.removeProperty("width"),o.slot.classList.remove(v.b+"-drophover"),o.hideLangindSlot()},onDrop:function(t,e){var n=o.getQuery(),i={parent:n.getRootCondition(),attributeId:e.data.attrId},s=n.addSimpleCondition(i);s&&n.fireConditionsChangedEvent(r.QueryChangeAction.Add,s)}})}},e.prototype.destroyCore=function(){s.eqDragManager.removeDropContainer(this.slot),this.detachQueryObserver(),this.slot.innerHTML=""},e.prototype.getEntitiesMenu=function(){return this.entitiesMenu},e.prototype.getConditionMenu=function(){return this.conditionMenu},e.prototype.getLinkTypeMenu=function(){return this.linkTypeMenu},e.prototype.getConditionGroupMenu=function(t){return void 0===t&&(t=!1),t?this.rootGroupMenu:this.groupMenu},e.prototype.attachQueryObserver=function(){var t=this,e=this.getQuery();this.queryEventCallbackId=e.addChangedCallback((function(e){var n=e.data;if(n&&(n.part==r.QueryChangePart.Conditions||n.part==r.QueryChangePart.All)){var o=document.activeElement,i=t.slot.contains(o)||o==document.body;switch(n.action){case r.QueryChangeAction.Modify:var s=n.changee,a=function(e,o){var s=t.slot.querySelector("div[data-id="+e.id+"]");if(s){o=o&&(n.condPart&r.ConditionPart.Operator)===r.ConditionPart.Operator&&e.expressions.length>1&&(e.expressions[1]._isDefaultValue||""==e.expressions[1].value||null==e.expressions[1].value);var a=s.classList.contains("active"),l=t.getConditionRenderer(e,s);if(l){var u=l.render(o);if(a&&t.toggleConditionPicked(e),i&&!o){var c=u.querySelector("a")||u.querySelector(".eqjs-qp-condition-button");c&&Object(v.d)(c)}}}},l=t.options.autoEditNewCondition;Array.isArray(s)?(s.forEach((function(t){return a(t,l)})),l=!1):a(s,l);break;case r.QueryChangeAction.Add:s=n.changee;var u=function(e){var n=t.getConditionRenderer(e);if(n){var o=e.getParent(),r=t.slot.querySelector("div[data-id="+o.id+"]");if(r){var s=r.lastChild;if(s){var a=n.render(t.options.autoEditNewCondition);s.appendChild(a),a.scrollIntoView(!1),i&&!t.options.autoEditNewCondition&&a.querySelector("a").focus()}}}};Array.isArray(s)?s.forEach((function(t){return u(t)})):u(s);break;case r.QueryChangeAction.Delete:s=n.changee;var c=function(e){var n=t.slot.querySelector("div[data-id="+e.id+"]");if(n){var o=t.slot.querySelector("div[data-id="+e.getParent().id+"] > .eqjs-qp-row-group"),r=n.nextSibling,s=n.previousSibling;if(n.parentElement.removeChild(n),i){var a=r||s||o,l=a.querySelector("a")||a.querySelector(".eqjs-qp-condition-button");l&&l.focus()}}};Array.isArray(s)?s.forEach((function(t){return c(t)})):c(s);break;default:t.refresh()}}}))},e.prototype.detachQueryObserver=function(){this.queryEventCallbackId&&this.getQuery().removeChangedCallback(this.queryEventCallbackId)},e.prototype.getQuery=function(){return this.customQuery?this.customQuery:this.context.getQuery()},e.prototype.refreshCore=function(){this.clear(),this.render()},e.prototype.setOptions=function(t){i.utils.assignDeep(this.options,t),this.options.dateFormatValue&&i.i18n.updateLocaleSettings({editDateFormat:this.options.dateFormatValue}),this.options.dateFormatDisplay&&i.i18n.updateLocaleSettings({shortDateFormat:this.options.dateFormatDisplay}),void 0===this.options.editableParts&&(this.options.editableParts=a.a.All),b.a.isMobileMode()&&(this.options.buttons=this.options.buttons||{},this.options.buttons.condition=["menu"],this.options.buttons.group=["menu"])},e.prototype.clear=function(){this.slot.innerHTML=""},e.prototype.render=function(){try{this.entitiesMenu=this.createEntitiesMenu(),this.createConditionMenus(),this.createLinkTypeMenu(),this.rootContainer=Object(s.domel)("div",this.slot).toDOM(),Object(s.domel)(this.slot).removeClass(v.a).addClass(b.a.getMobileCssClass());var t=this.getQuery().getRootCondition(),e=this.getConditionRenderer(t,this.rootContainer);if(e&&e.render(),this.options.showAddRow){this.addRowElement=Object(s.domel)("div",this.slot).toDOM();var n=this.getAddRowRenderer(this.addRowElement);n&&n.render()}}catch(t){var o=t;this.context.throwError({action:"QueryPanel rendering",text:o.message,sourceError:o})}},e.prototype.getConditionRenderer=function(t,e){var n;if(this.options.onGetConditionRenderer&&(n=this.options.onGetConditionRenderer(t,e)))return n;switch(t.tag){case r.CondTag.Simple:return new u.c(this,t,e);case r.CondTag.Group:return new c.a(this,t,e)}return null},e.prototype.getExpressionRenderer=function(t,e){if(!t)throw"Expression is not defined in the condition";var n,o,s=this.getContext().getModel(),a=t.getParent(),l=s.getOperatorById(a.getOperatorId()),u=s.getAttributeByIdSafe(a.expressions[0].value),c=s.getOperand(u,l,t.getIndex());o=(n=c&&c.editor&&c.editor.tag!==r.EqEditorTag.Unknown?c.editor:u&&u.defaultEditor?u.defaultEditor:new r.EqValueEditor).tag;var p=t.dataType;if(p==i.DataType.Unknown&&(p=u.dataType),t.kind===r.DataKind.Attribute){if(0===t.getIndex())return new h.a(this,t,this.entitiesMenu,e);var g=this.createEntitiesMenu((function(t,e){return!e||e.useInConditions&&e.dataType===p}));return new h.a(this,t,g,e)}if(t.kind===r.DataKind.Query?o=r.EqEditorTag.SubQuery:t.kind===r.DataKind.Scalar?o!=r.EqEditorTag.Unknown||t.dataType!==i.DataType.Date&&t.dataType!==i.DataType.DateTime&&t.dataType!==i.DataType.Time||(o=r.EqEditorTag.DateTime):t.kind==r.DataKind.ParentColumn&&(o=r.EqEditorTag.BindToParentColumn),this.options.onGetExpressionRenderer){var v=this.options.onGetExpressionRenderer(this,t,n,e);if(v)return v}switch(o){case r.EqEditorTag.List:return new f.b(this,t,n,e);case r.EqEditorTag.SqlList:return new f.c(this,t,n,e);case r.EqEditorTag.CustomList:return new f.a(this,t,n,e);case r.EqEditorTag.DateTime:return new y.a(this,t,n,e);case r.EqEditorTag.SubQuery:return new m.a(this,t,n,e);case r.EqEditorTag.BindToParentColumn:return new x(this,t,n,e);default:return new d.a(this,t,n,e)}},e.prototype.getOperatorRenderer=function(t,e,n){var o;return this.options.onGetOperatorRenderer&&(o=this.options.onGetOperatorRenderer(t,e,n)),o||new g.a(this,t,e,n)},e.prototype.getAddRowRenderer=function(t){var e;return this.options.onGetAddRowRenderer&&(e=this.options.onGetAddRowRenderer(t)),e||new p.a(this,this.entitiesMenu,t)},e.prototype.createEntitiesMenu=function(t){var e=this.getContext().getModel();if(!e||e.isEmpty())return null;var n=this.slot.id||"eq-querypanel";n+="-EntitiesMenu";var o={items:e.getEntitiesTree({addUIC:!0,addUIR:!1,addUIS:!1,attrPlacement:this.options.attrPlacement,sortEntities:this.options.sortEntities},t),adjustHeight:this.options.adjustEntitiesMenuHeight,id:n,domWriteItemsId:this.options.domWriteItemsId};return i.utils.assign(o,this.options.menuOptions),new l.a(o)},e.prototype.showEntitiesMenu=function(t){this.entitiesMenu.showMenu(t)},e.prototype.createConditionMenus=function(){var t=this.getQuery(),e=this.slot.id||"eq-querypanel";e+="-ConditionMenu";var n=[{id:"enable",text:i.i18n.getText("MenuEnable")},{id:"delete",text:i.i18n.getText("CmdDelete")}];t.isEx()&&((this.options.allowParameterization||this.options.allowInJoinConditions)&&n.push({id:"delimiter",text:"---"}),this.options.allowParameterization&&n.push({id:"param",text:i.i18n.getText("MenuParameterization")}),this.options.allowInJoinConditions&&n.push({id:"inJoin",text:i.i18n.getText("MenuJoinCond")}));var o={items:n,adjustHeight:this.options.adjustEntitiesMenuHeight,id:e,domWriteItemsId:this.options.domWriteItemsId,showSearchBoxAfter:100,showSelected:!0};i.utils.assign(o,this.options.menuOptions),this.conditionMenu=new l.a(o);e=this.slot.id||"eq-querypanel";e+="-GroupMenu";o={items:n=[{id:"enable",text:i.i18n.getText("MenuEnable")},{id:"delete",text:i.i18n.getText("CmdDelete")},{id:"delimiter",text:"---"},{id:"addCondition",text:i.i18n.getText("CmdAddCondition")},{id:"addGroup",text:i.i18n.getText("CmdAddCondGroup")}],adjustHeight:this.options.adjustEntitiesMenuHeight,id:e,domWriteItemsId:this.options.domWriteItemsId,showSearchBoxAfter:100,showSelected:!0};i.utils.assign(o,this.options.menuOptions),this.groupMenu=new l.a(o);e=this.slot.id||"eq-querypanel";e+="-RootGroupMenu";o={items:n=[{id:"addCondition",text:i.i18n.getText("CmdAddCondition")},{id:"addGroup",text:i.i18n.getText("CmdAddCondGroup")}],adjustHeight:this.options.adjustEntitiesMenuHeight,id:e,domWriteItemsId:this.options.domWriteItemsId,showSearchBoxAfter:100,showSelected:!0};i.utils.assign(o,this.options.menuOptions),this.rootGroupMenu=new l.a(o)},e.prototype.createLinkTypeMenu=function(){var t=this.slot.id;t&&(t+="-LinkTypeMenu");var e={items:r.eqconsts.predicateLinkTypeList.map((function(t){return{id:t.id,text:i.i18n.getText(t.key)}})),adjustHeight:this.options.adjustEntitiesMenuHeight,id:t,domWriteItemsId:this.options.domWriteItemsId};i.utils.assign(e,this.options.menuOptions),this.linkTypeMenu=new l.a(e)},e.prototype.toggleConditionPicked=function(t,e){var n,o;void 0===e&&(e=void 0),t&&(n=this.slot.querySelector("div[data-id="+t.id+"][data-condrow], div[data-id="+t.id+"] > div[data-group-row]"))&&(o=n.classList.contains("active"));for(var i=this.slot.querySelectorAll("."+this.cssPrefix+"-row"),r=0;r<i.length;r++){var a=i[r];a.hasAttribute("data-group-row")?this.options.alwaysShowButtonsInGroups||Object(s.domel)(a).data("show-buttons",null):this.options.alwaysShowButtonsInConditions||Object(s.domel)(a).data("show-buttons",null),Object(s.domel)(a).removeClass("active")}n&&!o&&Object(s.domel)(n).addClass("active").data("show-buttons","")},e.prototype.showLandingSlot=function(){var t=this.slot.querySelector(".eqjs-qp-conditions-root");t&&(t.appendChild(this.landingSlot),this.landingSlot.scrollIntoView({block:"center",behavior:"smooth"}))},e.prototype.hideLangindSlot=function(){this.landingSlot.parentElement&&this.landingSlot.parentElement.removeChild(this.landingSlot)},e}(r.Widget)},function(t,e,n){"use strict";n.d(e,"b",(function(){return d})),n.d(e,"a",(function(){return h})),n.d(e,"c",(function(){return p}));var o,i=n(0),r=n(2),s=n(1),a=n(24),l=n(9),u=n(10),c=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.menuItemsList=[],e.showWhenReady=!1,e}return c(e,t),e.prototype.isEditable=function(){return!this.isReadOnly()&&(this.panel.options.editableParts&u.a.Value)===u.a.Value},e.prototype.setValue=function(t,e){void 0===e&&(e=!1);var n=this.adjustNewValue(t);if(t!==this.expression.value){var o=this.getValueText(t);this.expression.setContent(n,o),e||this.expression.getParent().fireChangedEvent(r.ConditionPart.Value)}return!0},e.prototype.getValueText=function(t){var e="";if(Array.isArray(t))for(var n=0,o=this.menuItemsList;n<o.length;n++){var i=o[n];t.indexOf(i.id)>=0&&(e+=i.text+",")}else for(var r=0,s=this.menuItemsList;r<s.length;r++){(i=s[r]).id===t&&(e+=i.text+",")}return e&&(e=e.substring(0,e.length-1)),e},e.prototype.getEmptyText=function(){return this.panel.options.emptyTextList||i.i18n.getText("MsgEmptyListValue")},e.prototype.getListName=function(){return this.valueEditor.name},e.prototype.renderEditor=function(){var t=this;this.fillMenuItemsList((function(){t.renderMenuBlock()}))},e.prototype.getLabelText=function(){return this.expression.isEmpty()?this.getEmptyText():this.expression.getText()},e.prototype.showLoader=function(){},e.prototype.hideLoader=function(){},e.prototype.showEditor=function(){var t=this;this.menu?this.menu.showMenu({anchor:this.labelElement,selectedIds:this.getValuesAsArray(),itemSelectedCallback:function(e,n){if(t.menu.options.multiselect){if(n){for(var o=[],i=n.length,r=0;r<i;r++)o.push(n[r].id);t.setValue(o)}}else t.setValue(e.id);return!1}}):(this.showWhenReady=!0,this.showLoader())},e.prototype.closeEditor=function(){this.menu.hideMenu()},e.prototype.renderMenuBlock=function(){var t=!1;this.expression&&(t=this.expression.kind===r.DataKind.List);var e=this.panel,n={items:this.menuItemsList,multiselect:t,container:e?e.options.menuContainer:null,showSelected:!0,showItemIds:!!e&&e.options.showIdsForListItems};e&&i.utils.assignDeep(n,e.options.menuOptions);var o=this.element.id;o&&(n.id=o+"-EditorMenu"),e&&(n.domWriteItemsId=e.options.domWriteItemsId),n.buttons={submit:i.i18n.getText("ButtonApply"),cancel:i.i18n.getText("ButtonCancel")},this.menu=new l.a(n)},e.prototype.getValuesAsArray=function(){if(this.expression.kind!==r.DataKind.List)return[this.expression.value];if(this.expression.value){var t=this.expression.value.match(/"[^"\\]*(?:\\.[^"\\]*)*"|[^,]+/g);return t?t.map((function(t){return'"'==t.charAt(0)&&'"'==t.charAt(t.length-1)?(t=t.substring(1,t.length-1)).replace(/\"/g,'"'):t})):[]}return[]},e.prototype.adjustNewValue=function(t){return Array.isArray(t)?t.map((function(t){return t.indexOf(",")>=0?'"'+(t=t.replace(/"/g,'"'))+'"':t})).join(","):t},e.prototype.fillMenuItemsList=function(t){this.menuItemsList=this.valueEditor.values,t&&t()},e.prototype.takeDefaultValue=function(){if(this.menuItemsList)for(var t=this.menuItemsList.length,e=this.valueEditor.defValue,n=0;n<t;n++){var o=this.menuItemsList[n];if(o.isDefault||e==o.id){this.setValue(o.id,!0);break}}},e}(a.a),h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.isLoading=!1,e.onClickTemp=null,e}return c(e,t),e.prototype.renderEditor=function(){var t=this;this.isLoading||(this.isLoading=!0,this.fillMenuItemsList((function(){if(t.isLoading=!1,t.isEmptyValue()&&t.takeDefaultValue(),!t.expression.isEmpty()&&t.expression._isDefaultValue){var e=t.getValueText(t.expression.value);t.expression.setContent(t.expression.value,e),t.expression.getParent().fireChangedEvent()}t.renderMenuBlock(),t.showWhenReady&&(t.showWhenReady=!1,t.hideLoader(),t.showEditor())})))},e.prototype.showLoader=function(){this.labelElement.style.display="none",this.loaderElement||(this.loaderElement=Object(s.domel)("div",this.element).addClass(this.cssPrefix+"-ve-loader").toDOM()),this.loaderElement.style.display="block"},e.prototype.hideLoader=function(){this.loaderElement.style.display="none",this.labelElement.removeAttribute("style")},e.prototype.fillMenuItemsList=function(t){var e=this,n=this.getListName(),o=this.panel.getContext().getListRequestHandler();r.eqconsts.constLists[n]?(this.menuItemsList=r.eqconsts.constLists[n],t&&t()):o&&o({listName:n,editorId:this.valueEditor.id,editorParams:this.valueEditor.extraParams,value:this.getValue()},(function(n){e.menuItemsList=n,t&&t()}))},e}(d),p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.fillMenuItemsList=function(t){var e=this,n=this.panel.getContext(),o=(this.valueEditor,n.getListRequestHandler());o&&o({listName:"SQL",editorId:this.valueEditor.id,editorParams:this.valueEditor.extraParams,value:this.getValue()},(function(n){e.menuItemsList=n,t&&t()}))},e}(h)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var o=n(0),i=function(){return i=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},i.apply(this,arguments)},r=i(i({},o.EditorTag),{SqlList:"SQLLIST",SubQuery:"SUBQUERY",BindToParentColumn:"BINDTOPARENTCOLUMN"})},function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return a}));var o,i=n(0),r=n(20),s=n(13);!function(t){t[t.None=0]="None",t[t.Ascending=1]="Ascending",t[t.Descending=2]="Descending"}(o||(o={}));var a=function(){function t(t,e){void 0===e&&(e=!1),this.query=t,this.justsorted=e,this.enabled=!0,this.params=[],this._isHidden=!1,this._id=i.utils.generateId("col"),this.caption="",this.sorting=o.None,this.sortIndex=-1,this.expr=new r.a(this),this.blockId=""}return Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),t.prototype.getModel=function(){return this.query.getModel()},t.prototype.getQuery=function(){return this.query},t.prototype.isReadOnly=function(){return!1},t.prototype.isJustSorted=function(){return this.justsorted},t.prototype.setReadOnly=function(t){},t.prototype.isHidden=function(){return this._isHidden},t.prototype.setHidden=function(t){this._isHidden=t},t.prototype.getDataType=function(){if(this.expr.dataType===i.DataType.Unknown){var t=null;if(this.expr.func){if("COUNT"==this.expr.func||"CNTDST"==this.expr.func)return i.DataType.Int64;t=this.expr.args[0].value}else t=this.expr.value;var e=this.query.getModel().getAttributeById(t);if(e)return e.dataType}return this.expr.dataType},t.prototype.loadFromData=function(t,e){e&&(e.id&&(this._id=e.id),this.caption=e.cptn,void 0!==e.srt&&(this.sorting=e.srt,this.sortIndex=void 0!==e.srtidx?e.srtidx:-1),!1===e.enabled&&(this.enabled=e.enabled),this.expr.loadFromData(t,e.expr),this.blockId=e.blockId,this.displayFormat=e.dfmt,this.groupFooterColumnTemlate=e.gfct,e.hidden&&this.setHidden(!0))},t.prototype.saveToData=function(){var t={};return t.id=this._id,void 0!==this.caption&&(t.cptn=this.caption),void 0!==this.sorting&&this.sorting!=o.None&&(t.srt=this.sorting,t.srtidx=this.sortIndex),t.expr=this.expr.saveToData(),this.blockId&&(t.blockId=this.blockId),!1===this.enabled&&(t.enabled=this.enabled),t.dfmt=this.displayFormat,t.gfct=this.groupFooterColumnTemlate,this.isHidden()&&(t.hidden=!0),t},t.prototype.fireChangedEvent=function(){this.query.fireChangedEvent({part:this.justsorted?s.b.SortingColumns:s.b.Columns,action:s.a.Modify,changee:this})},t.prototype.getExpressionIndex=function(t){return 0},t.prototype.expressionChanged=function(t,e){},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return y})),n.d(e,"b",(function(){return m}));var o,i=n(0),r=n(14),s=n(38),a=n(20),l=n(28),u=n(50),c=n(12),d=n(16),h=n(8),p=n(19),f=n(13),g=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),y=function(t){function e(n){var o=t.call(this,n)||this;return Error.captureStackTrace&&Error.captureStackTrace(o,e),o.name="InvalidQueryError",o}return g(e,t),e}(Error),m=function(){function t(t,e,n){var o=this;this.extraData={},this.innerData={},this.isNewbie=!0,this._isModified=!1,this._enableAggregation=!1,this.parentQuery=null,this.drillDowns=[],this.eventEmitter=new i.EventEmitter(this),this.root=new u.a(this,p.a.Group),this.extraConditions=new u.a(this,p.a.Group),this.columns=new Array,this.justsorted=new Array,this.id||this.regenerateId(),this.setDefaultName(),this.description="",this.model=t||new s.a,e&&this.loadFromData(e),this.attributeExprTag=n&&n.attrTag||h.a.EntityAttribute,this.clientListRequestHandler=n?n.clientListRequestHandler:new Array,this.serverListRequestHandler=n?n.serverListRequestHandler:new Array,this.timezoneOffset=(new Date).getTimezoneOffset(),this.aggrSettings=new i.AggregationSettings(this),n&&(this.parentQuery=n.parent),this.addChangedCallback((function(t){t.data&&(t.data.part&f.b.Columns)>0&&!t.data.aggregation&&o._enableAggregation&&o.updateAggregationSettings()&&o.fireChangedEvent({part:f.b.Aggregation})}))}return t.prototype.isModified=function(){return this._isModified},t.prototype.resetModified=function(){this._isModified=!1},Object.defineProperty(t.prototype,"enableAggregation",{get:function(){return this._enableAggregation},set:function(t){var e=this._enableAggregation;if(this._enableAggregation=t,!e&&t){this.processQueryForAggregation();this.columns.filter((function(t){return t.enabled&&t.expr.tag==h.a.AggregateFunction}))}this._enableAggregation||this.aggrSettings.clear()},enumerable:!0,configurable:!0}),t.prototype.updateAggregationSettings=function(){for(var t=!1,e=this.getAggregationSettings(),n=e.groups.length-1;n>=0;n--){for(var o=e.groups[n],i=function(e){var n=o.columns[e];r.columns.find((function(t){return t.id===n}))||(o.columns.splice(e,1),t=!0)},r=this,s=o.columns.length-1;s>=0;s--)i(s);0==o.columns.length&&e.groups.slice(n,1)}var a=e.getAggregates(),l=function(e){var n=a[e];u.columns.find((function(t){return t.id===n.colId}))||(a.splice(e,1),t=!0)},u=this;for(n=a.length-1;n>=0;n--)l(n);return t},t.prototype.createSubQuery=function(){return new t(this.model)},t.prototype.useAggregation=function(t,e){if(void 0===e&&(e=!1),this.aggrSettings.clear(),t(this.aggrSettings),this.enableAggregation)this.processQueryForAggregation(e);else if(!e)return void console.warn("Aggregation is turned off. Turn it on with query.enableAggregation = true")},t.prototype.useDefaultAggregation=function(){var t=this;this._enableAggregation=!0,this.useAggregation((function(e){var n=t.columns.filter((function(t){return t.enabled&&t.expr.tag==h.a.AggregateFunction}));if(n.length){for(var o=t.columns.filter((function(t){return t.enabled&&t.expr.tag==h.a.EntityAttribute})),r=[],s=0,a=n;s<a.length;s++){var l=a[s];r.push({id:l.id,func:l.expr.func}),t.changeColumnType(l,h.a.EntityAttribute)}for(var u=0,c=r;u<c.length;u++){var d=c[u];e.addAggregateColumn(d.id,d.func)}for(var p=0,g=o;p<g.length;p++){l=g[p];e.addGroup({columns:[l.id],name:l.caption})}e.addGrandTotals(),t.fireChangedEvent({part:f.b.Columns,wasModified:!1})}else{var y=t.getColumns().filter((function(e){return e.enabled&&e.expr.tag==h.a.EntityAttribute&&t.model.getAttributeById(e.expr.value).dataType===i.DataType.Currency}))[0],m=t.getColumns().filter((function(e){return e.enabled&&e.expr.tag==h.a.EntityAttribute&&t.model.getAttributeById(e.expr.value).dataType===i.DataType.String}))[0];if(!y&&!e.hasAggregates()||!m)return;e.addGrandTotals().addAggregateColumn(y.id,"SUM").addGroup({columns:[m.id],name:"Default"})}}))},t.prototype.processQueryForAggregation=function(t){void 0===t&&(t=!1);var e=this.getAggregationSettings().getGroups();if(e.length>0){for(var n=e[e.length-1].columns,o=[],i=[],r=0,s=this.getColumns();r<s.length;r++){var a=s[r];n.indexOf(a.id)>=0?o.push(a):a.sorting!=l.b.None&&i.push(a)}var u=0;o.forEach((function(t){t.sorting==l.b.None&&(t.sorting=l.b.Ascending),t.sortIndex=u++})),i.forEach((function(t){t.sortIndex=u++})),t||this.fireChangedEvent({part:f.b.Columns,aggregation:!0,wasModified:!1})}},t.prototype.getAggregationSettings=function(){return this.aggrSettings},t.prototype.getColumnIds=function(t,e){return e=e||t,this.columns.slice(t,e-t+1).map((function(t){return t.id}))},t.prototype.validateColumns=function(t){for(var e=this.columns.filter((function(t){return t.enabled})).map((function(t){return t.id})),n=-1,o=0,i=t;o<i.length;o++){var r=i[o],s=e.indexOf(r);if(s<0)return!1;if(n>s)return!1;n=s}return!0},t.prototype.validateAggregate=function(t,e){var n=this.columns.filter((function(e){return e.enabled&&e.id===t}))[0],o=this.model.findAggrFunctionById(e);return!(!o||!n||o.appliedTypes.indexOf(n.expr.dataType)<0)},t.prototype.isEx=function(){return!1},t.prototype.reset=function(t){void 0===t&&(t=!0),t&&this.clear(),this.regenerateId(),this.setDefaultName(),this._isModified=!1,this.isNewbie=!0},t.prototype.hasEnabledAggrColumns=function(){return this.columns.filter((function(t){return t.enabled&&t.expr.tag===h.a.AggregateFunction})).length>0},t.prototype.setDefaultName=function(){return this.setName(i.i18n.getText("NewQueryName")),this.getName()},t.prototype.validate=function(t){t=t||{};var e="EntityAttribute isn't declared in the model: ";if(!this.model)throw new y("Model is not declared");if(this.columns)for(var n=0,o=this.columns;n<o.length;n++){var i=o[n];if(i.expr.tag==h.a.EntityAttribute||i.expr.tag===h.a.ParentEntityAttribute){if(!this.model.getAttributeById(i.expr.value))throw new y(e+i.expr.value)}else if(i.expr.tag===h.a.AggregateFunction){if(!this.model.getAttributeById(i.expr.args[0].value))throw new y(e+i.expr.args[0].value)}else if(i.expr.tag!==h.a.CustomSql)throw new y("The expression has wrond tag: "+i.expr.tag)}this.root&&this.root.getConditions()&&this.validateConditionGroup(this.root,t)},t.prototype.getAggregatedColumns=function(){return this.getColumns().filter((function(t){return t.enabled&&t.expr.tag===h.a.AggregateFunction}))},t.prototype.tryValidate=function(t){try{return this.validate(t),!0}catch(t){if(t instanceof y)return!1;throw t}},t.prototype.validateConditionGroup=function(t,e){if(t.isGroup())for(var n=0,o=t.getConditions();n<o.length;n++){var r=o[n];r.enabled&&this.validateConditionGroup(r,e)}else if(t.expressions[0].tag===h.a.EntityAttribute){var s=t.expressions[0].value;if(!this.model.getAttributeById(s))throw new y("EntityAttribute isn't declared in the model: "+s);if(!e.checkExpressions)return;for(var a=1;a<t.expressions.length;a++){var l=t.expressions[a];if(l.tag===h.a.Constant&&i.utils.isNumericType(l.dataType)){if(!l.value)continue;for(var u=0,d=l.kind===c.a.List?l.value.split(/\s*,\s*/):[l.value];u<d.length;u++){var p=d[u],f=+p;if(isNaN(f))throw new y("Expression constant is NaN in condition:"+t.id);if(i.utils.isIntType(l.dataType)&&f!=parseInt(p,10))throw new y("Expression constant is wrong interger in condition: "+t.id)}}}}},t.prototype.loadFromDataOrJson=function(t,e){t&&("string"==typeof t?this.loadFromJson(t,e):this.loadFromData(t,e))},t.prototype.loadFromJson=function(t,e){var n=JSON.parse(t);this.loadFromData(n,e)},t.prototype.loadFromData=function(t,e){var n=this;e=i.utils.assign({changeStatus:!0,validate:!0},e||{});if(this.clear(),this.clearDrillDowns(),t){if(this.id=t.id,this.root.loadFromData(this.model,t.root),t.root&&t.root.conds)for(var o=0;o<t.root.conds.length;o++){var r=t.root.conds[o];if(!r.conds||this.isEx()){var s=this.createCondition();s.loadFromData(this.model,r),this.root.addCondition(s)}else console.error("Community version doesn't support working with groups.")}if(this.name=t.name,this.description=t.desc,this.justsorted=[],t.justsortcols)for(o=0;o<t.justsortcols.length;o++){(a=this.createColumn(!0)).loadFromData(this.model,t.justsortcols[o]),this.justsorted.push(a)}if(t.cols)for(o=0;o<t.cols.length;o++){var a;(a=this.createColumn()).loadFromData(this.model,t.cols[o]),this.columns.push(a)}if(t.extraData&&(this.extraData=t.extraData),this.innerData=t.innerData||this.innerData,this.innerData&&this.innerData.aggr&&(this._enableAggregation=this.innerData.aggr.enabled||!1,this.useAggregation((function(t){t.loadFromData(n.innerData.aggr)}),!0)),t.dds&&t.dds.length)for(var l=0,u=t.dds;l<u.length;l++){var c=u[l];this.addDrillDown().loadFromData(c)}}e.changeStatus&&(this.isNewbie=!1,this._isModified=!1),e.validate&&this.validate()},t.prototype.addDrillDown=function(){var t=this.model.createQuery();return t.parentQuery=this,this.drillDowns.push(t),t},t.prototype.getDrillDowns=function(){return this.drillDowns},t.prototype.getParentQuery=function(){return this.parentQuery},t.prototype.findColumnById=function(t){for(var e=0,n=this.columns;e<n.length;e++){var o=n[e];if(o.id===t)return o}return null},t.prototype.getModel=function(){return this.model},t.prototype.setModel=function(t){this.model=t},t.prototype.loadModelData=function(t){this.model.setData(t)},t.prototype.toJSON=function(){return JSON.stringify(this.toJSONData())},t.prototype.toJSONData=function(){var t=this,e={modelId:this.model?this.model.getId():null,modelName:this.model?this.model.getName():null};e.id=this.id,e.name=this.name,this.description&&(e.desc=this.description),e.cols=[];for(var n=0;n<this.columns.length;n++)e.cols.push(this.columns[n].saveToData());e.justsortcols=[];for(n=0;n<this.justsorted.length;n++)e.justsortcols.push(this.justsorted[n].saveToData());this.extraData&&(e.extraData=this.extraData),this.innerData&&(e.innerData=this.innerData,e.innerData.aggr=this.aggrSettings.saveToData(),e.innerData.aggr.enabled=this._enableAggregation);var o=function(e){var n=e.saveToData();n.conds=[];for(var o=e.getConditions(),i=0;i<o.length;i++)!o[i].isGroup()||t.isEx()?n.conds.push(o[i].saveToData()):console.error("Community version doesn't support working with groups.");return n};if(e.root=o(this.root),e.extraConds=o(this.extraConditions),this.drillDowns.length>0){e.dds=[];for(var r=0,s=this.drillDowns;r<s.length;r++){var a=s[r];e.dds.push(a.toJSONData())}}return e.timezoneOffset=this.timezoneOffset,e.locale=i.i18n.getCurrentLocale(),e},t.prototype.isEmptyConditions=function(){return this.root.isEmpty()},t.prototype.isEmptyColumns=function(){return!this.columns||0===this.columns.length},t.prototype.isEmpty=function(){return this.isEmptyColumns()&&this.isEmptyConditions()},t.prototype.clear=function(){this._enableAggregation=!1,this.aggrSettings.clear(),this.clearColumns(),this.clearConditions(),this.clearExtraConditions(),this.innerData={},this.extraData={}},t.prototype.clearColumns=function(){this.columns=[],this.justsorted=[]},t.prototype.clearConditions=function(){this.root.clearConditions(),this.root.linkType=d.a.All,this.root.enabled=!0},t.prototype.clearExtraConditions=function(){this.extraConditions.clearConditions()},t.prototype.clearDrillDowns=function(){this.drillDowns=[]},t.prototype.getId=function(){return this.id},t.prototype.setId=function(t){this.id=t},t.prototype.regenerateId=function(){this.id=i.utils.generateId("quer")},t.prototype.getName=function(){return this.name},t.prototype.setName=function(t){this.name=t},t.prototype.getDescription=function(){return this.description},t.prototype.setDescription=function(t){this.description=t},t.prototype.getColumns=function(){return this.columns},t.prototype.getUsedInTotalsColumns=function(){if(0===this.getAggregatedColumns().length)return[];var t=this.getColumns().filter((function(t){return t.enabled&&t.expr.tag===h.a.EntityAttribute}));return t.length&&t.pop(),t},t.prototype.getJustSortedColumns=function(){return this.justsorted},t.prototype.getSortedColumns=function(){for(var t=new Array,e=this.getColumns().concat(this.getJustSortedColumns()),n=0;n<e.length;n++){var o=e[n];o.sortIndex>=0&&t.push(o)}return t.sort((function(t,e){return t.sortIndex-e.sortIndex})),t},t.prototype.getColumnSortIndex=function(t){if(t.sorting!=l.b.None){if(t.sortIndex<0){var e=this.getColumns().concat(this.getJustSortedColumns());return i.utils.indexOfArrayItem(e,t)}return t.sortIndex}return-1},t.prototype.createColumn=function(t){return void 0===t&&(t=!1),new l.a(this,t)},t.prototype.getColumnById=function(t){return i.utils.findItemById(this.columns,t)},t.prototype.addColumn=function(t,e){var n,o=t.justsorted?this.justsorted:this.columns;if(t.column)n=t.column;else{n=this.createColumn(t.justsorted);var r=void 0;if(t.attribute)r=t.attribute;else{if(!t.attributeId)throw new Error("Not enought data for addColumn operation. Need attribute or attributeId");if(!(r=this.model.getAttributeById(t.attributeId)))throw new Error("Incorrect attribute id ("+t.attributeId+"): addColumn")}if(!r.useInResult&&(r.lookupAttr&&(r=this.model.getAttributeById(r.lookupAttr)),!r||!r.useInResult))throw new Error("Can't use this attribute for a column");if(t.aggrFuncId&&t.cusomtSql&&console.warn("Column cannot be created using aggrFuncId and customSql at the same time. cusomSql will be used."),t.cusomtSql)n.caption="Custom SQL Column",n.expr.tag=h.a.CustomSql,n.expr.baseAttrId=r.id,n.expr.sql=t.cusomtSql,n.expr.kind=c.a.Query,n.expr.dataType=i.DataType.Unknown;else if(t.aggrFuncId){var s=t.aggrFuncId;n.caption=r.caption+" "+this.model.getAggrFunctionCaption(t.aggrFuncId),n.expr.tag=h.a.AggregateFunction,n.expr.func=t.aggrFuncId,n.expr.kind=c.a.Scalar,n.expr.dataType="COUNT"==s||"CNTDST"==s?4:r.dataType,n.expr.distinct=!1;var u=new a.a(n);u.setValue(r.id,!0),u.tag=h.a.EntityAttribute,u.dataType=r.dataType,n.expr.args.push(u)}else n.caption=r.caption,n.expr.setValue(r.id,!0),n.expr.tag=h.a.EntityAttribute,n.expr.dataType=r.dataType;n.caption=t.caption||n.caption,n.sorting=t.sorting||l.b.None,n.sortIndex=t.sortIndex||-1,n.enabled=i.utils.getIfDefined(t.enabled,!0),n.setReadOnly(i.utils.getIfDefined(t.readonly,!1))}return t.index&&t.index>=0&&t.index<o.length?o.splice(t.index,0,n):o.push(n),n},t.prototype.addColumnObj=function(t,e,n){var o=this.columns;void 0===t.length?"number"==typeof e?o.splice(e,0,t):o.push(t):"number"==typeof e?o.push.apply(o,[e,0].concat(t)):o.push.apply(o,[].concat(t))},t.prototype.changeColumnType=function(t,e,n){if(!t.isJustSorted())if(n=n||{},t.caption=void 0!==n.caption?n.caption:"",e===h.a.AggregateFunction){if(!n.funcId)throw Error('"funcId" argument is not defined');if(t.expr.tag==h.a.AggregateFunction)return void(t.expr.func=n.funcId);(u=new a.a(t)).tag=h.a.AggregateFunction,u.func=n.funcId,u.distinct=!1,u.dataType="COUNT"==n.funcId||"CNTDST"==n.funcId?4:t.expr.dataType;var o=new a.a(t);o.loadFromData(this.model,t.expr.saveToData()),u.args.push(o),t.expr=u}else if(e===h.a.CustomSql){var r=t.expr.tag==h.a.AggregateFunction?t.expr.args[0].value:t.expr.value,s="";this.model&&(s=this.model.getAttributeById(r).expr);var l=new a.a(t);l.tag=h.a.CustomSql,l.dataType=i.DataType.String,l.sql=s,l.baseAttrId=r,t.expr=l}else if(e===h.a.EntityAttribute){if(t.expr.tag===h.a.EntityAttribute||t.expr.tag===h.a.ParentEntityAttribute)return;var u,c=t.expr.tag===h.a.CustomSql?t.expr.baseAttrId:t.expr.args[0].value,d=this.model.getAttributeById(c);(u=new a.a(t)).tag=h.a.EntityAttribute,u.dataType=null!=d?d.dataType:i.DataType.Unknown,u.setValue(c,!0),t.expr=u}},t.prototype.moveColumn=function(t,e){var n=this.getColumns();i.utils.moveArrayItem(n,t,e)},t.prototype.removeColumn=function(t,e){var n=t.isJustSorted()?this.getJustSortedColumns():this.getColumns();i.utils.removeArrayItem(n,t)},t.prototype.addConditionGroup=function(t,e){return void 0===e&&(e=!0),console.error("Community version doesn't support working with groups."),null},t.prototype.addExtraConditionGroup=function(t,e){return void 0===e&&(e=!0),console.error("Community version doesn't support working with groups."),null},t.prototype.createCondition=function(t){return void 0===t&&(t=p.a.Simple),new u.a(this,t)},t.prototype.addSimpleCondition=function(t){var e=t.parent||this.getRootCondition(),n=this.getModel();if(!n)return null;if(!t.attribute&&!t.attributeId)throw new Error("Either `attribute` or `attributeId` parameter must have a value");if(!t.attribute&&(t.attribute=n.getAttributeById(t.attributeId),!t.attribute))throw new Error("Could not find this attribute: "+t.attributeId);!t.operator&&t.operatorId&&(t.operator=n.getOperatorById(t.operatorId)),t.operator||(t.operator=n.getDefaultOperatorForAttr(t.attribute));var o=this.createSimpleConditionObject(t.attribute,t.operator,t.value);return e.addCondition(o),o.enabled=i.utils.getIfDefined(t.enabled,!0),o.setReadOnly(i.utils.getIfDefined(t.readonly,!1)),o},t.prototype.addSimpleExtraCondition=function(t){return t.parent=t.parent||this.extraConditions,this.addSimpleCondition(t)},t.prototype.createSimpleConditionObject=function(t,e,n){if(!t||!t.useInConditions)throw"Can't add a condition with such attribute: "+(t?t.caption:"NULL");var o=this.createCondition(p.a.Simple);o.setOperatorId(e.id,!0);var r=new a.a(o);r.setValue(t.id,!0),r.tag=this.attributeExprTag,r.kind=c.a.Attribute,r.dataType=t.dataType,o.expressions.push(r);var s=this.getModel(),l=e.paramCount,u=i.utils.fillArray(new Array(l-1),null);null!=n&&(Array.isArray(n)?i.utils.copyArrayTo(n,u):l>0&&(u[0]=n));for(var d=u.length,h=0;h<d;h++){var f=s.getOperand(t,e,h+1);o.addExpressionByOperand(f,u[h])}return o},t.prototype.removeColumns=function(t,e){var n=t.filter((function(t){return t.isJustSorted()})),o=t.filter((function(t){return!t.isJustSorted()}));function i(t,e){for(var n=e.length,o=0;o<n;o++){var i=t.indexOf(e[o]);i>=0&&t.splice(i,1)}}o.length>0&&i(this.getColumns(),o),n.length>0&&i(this.getJustSortedColumns(),n)},t.prototype.fireProcessEvent=function(t){this.eventEmitter.fire("query.process",t)},t.prototype.fireChangedEvent=function(t,e,n){t=t||{part:f.b.All},void 0===e&&void 0===n||(t.postpone=e||0,t.wasModified=n,console.warn("Method with 'postpone' and 'wasModified' args is deprecated. Pass params in data object")),this._isModified=void 0===t.wasModified||t.wasModified;var o=t||{part:f.b.All};this.eventEmitter.fire("query.change",o,t.postpone||0)},t.prototype.fireColumnsChangedEvent=function(t,e,n){void 0===n&&(n=!1),this.fireChangedEvent({part:n?f.b.SortingColumns:f.b.Columns,action:t,changee:e})},t.prototype.fireConditionsChangedEvent=function(t,e){this.fireChangedEvent({part:f.b.Conditions,action:t,changee:e})},t.prototype.runThroughConditions=function(t){var e=function(n){for(var o=0;o<n.getConditions().length;o++){var i=n.getConditions()[o];i.isGroup()?e(i):t&&t(i)}};e(this.getRootCondition())},t.prototype.getOneValueForAttr=function(t){var e=null;return this.runThroughConditions((function(n){if(n.enabled){var o=n.expressions[0],i=n.getOperatorId();o.value!=t||!n.expressions[1]||"Equal"!=i&&"InList"!=i&&"StartsWith"!=i||(e=n.expressions[1].value)}})),e},t.prototype.getRootCondition=function(){return this.root},t.prototype.addProcessCallback=function(t){return this.eventEmitter.subscribe("query.process",t)},t.prototype.removeProcessCallback=function(t){this.eventEmitter.unsubscribe("query.process",t)},t.prototype.addChangedCallback=function(t){return this.eventEmitter.subscribe("query.change",t)},t.prototype.removeChangedCallback=function(t){this.eventEmitter.unsubscribe("query.change",t)},t.prototype.getConditionsText=function(){var t=this,e=this.getModel();if(!e)return"";var n=function(o){var s,a,l="",u="Conj"+r.a.linkTypeToStr(o.linkType),p=i.i18n.getText(u);for(a=0;a<o.getConditions().length;a++){s="";var f=o.getConditions()[a];if(f.enabled||void 0===f.enabled)if(f.isGroup())(s=n(f))&&(s="("+s+")");else for(var g=f.getOperatorId(),y=e.getOperatorById(g),m=r.a.parseOperatorFormat(y),v=m.length,b=0;b<v;b++){var C=m[b],x=C.text;if("expression"==C.type){var w=f.expressions[C.index];if(w.kind==c.a.Attribute||w.tag==h.a.EntityAttribute){var T=e.getAttributeById(w.value);x=e.getAttributeText(T,"{entity} {attr}")}else if(x=w.getText(),t.model.isDateMacro(x)||t.model.isTimeMacro(x)){var E=x.substring(3,x.length-2);x=i.i18n.getText(E)||x}}b>0&&(s+=" "),s+=x}s&&(a>0&&l&&(l+=" "+p+" "),l+=s)}return o.linkType!=d.a.None&&o.linkType!=d.a.NotAll||(l="not ( "+l+" )"),l};return n(this.getRootCondition())},t.prototype.getConditionsTextAsHtml=function(){var t=this,e=this.getModel();if(!e)return'<div class="eqjs-query-text"></div>';var n=function(e){if(e.kind==c.a.Query)return"&lt;"+e.getText()+"&gt;";if(e.kind==c.a.List)return"["+e.getText()+"]";if(e.dataType==i.DataType.String||e.dataType==i.DataType.Memo||e.dataType==i.DataType.FixedChar)return"&quot;"+e.getText()+"&quot;";var n=e.getText();if(t.model.isDateMacro(n)||t.model.isTimeMacro(n)){var o=n.substring(3,n.length-2);n=i.i18n.getText(o)||n}return n},o=function(t){var s,a,l="",u="Conj"+r.a.linkTypeToStr(t.linkType),p='<span class="eqjs-query-text-conj">'+i.i18n.getText(u)+"</span>";for(a=0;a<t.getConditions().length;a++){s="";var f=t.getConditions()[a];if(f.enabled||void 0===f.enabled)if(f.isGroup())(s=o(f))&&(s="("+s+")");else for(var g=f.getOperatorId(),y=e.getOperatorById(g),m=r.a.parseOperatorFormat(y),v=m.length,b=0;b<v;b++){var C=m[b],x=C.text;if("expression"==C.type){var w=f.expressions[C.index];if(w.kind==c.a.Attribute||w.tag==h.a.EntityAttribute){var T=e.getAttributeById(w.value);x='<span class="eqjs-query-text-attr">'+e.getAttributeText(T,"{entity} {attr}")+"</span>"}else x='<span class="eqjs-query-text-expr">'+n(w)+"</span>"}else"operator"==C.type&&(x='<span class="eqjs-query-text-op">'+x+"</span>");b>0&&(s+=" "),s+=x}s&&(a>0&&l&&(l+=" "+p+" "),l+=s)}return t.linkType!=d.a.None&&t.linkType!=d.a.NotAll||(l='<span class="eqjs-query-text-conj">not</span> ( '+l+" )"),l};return'<div class="eqjs-query-text">'+o(this.getRootCondition())+"</div>"},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var o,i=n(0),r=n(2),s=n(1),a=n(73),l=n(3),u=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return u(e,t),e.prototype.getClassesToAdd=function(){return t.prototype.getClassesToAdd.call(this)+" "+this.cssPrefix+"-row "+this.cssPrefix+"-row-column-entattr"},e.prototype.renderExpressionBlock=function(){var t=this;return Object(s.domel)("div").addClass(this.cssPrefix+"-expr-block").addClass(l.a.getMobileCssClass()).addChild("div",(function(e){return e.addClass(t.cssPrefix+"-colelement",t.cssPrefix+"-attrelement").addClass(l.a.getMobileCssClass()).addChildElement(t.renderBaseExpression())})).toDOM()},e.prototype.renderBaseExpression=function(){var t=this,e=this.getAttributeCaption(this.baseAttr);return this.isEditable()?Object(s.domel)("a").attr("href","javascript:void(0)").title(e).text(e).on("click",(function(e){return e.stopPropagation(),t.panel.showEntitiesMenu({anchor:e.target,selectedIds:null,itemSelectedCallback:t.baseExpressionItemSelectedCallback.bind(t),itemFilterCallback:function(t){return"__AddAll__"!==t.id}}),!1})).toDOM():Object(s.domel)("span").text(e).title(e).toDOM()},e.prototype.baseExpressionItemSelectedCallback=function(t,e){var n=t.id;return this.column.expr.setValue(n,!0),this.column.caption="",this.fireColumnChanged(),!1},e.prototype.getUIS=function(){var t=this.column.expr.args[0];return!t||this.panel.getContext().getModel().checkAttrProperty(t.value,"useInSorting")},e.prototype.changeTypeHandler=function(t){var e=this;this.keepShowingButtons=!0,this.functionMenu.showMenu({anchor:t.target,selectedIds:null,itemSelectedCallback:function(t,n){return e.processExtraButtonMenuItems(t.id,null),!1},menuClosedCallback:function(){e.keepShowingButtons=!1,e.isMouseOverBlock||e.element.dispatchEvent(Object(s.createBrowserEvent)("mouseleave"))}})},e.prototype.changeTypeToCustomSql=function(){var t=this;this.column.getQuery().changeColumnType(this.column,r.ExprTag.CustomSql);var e=this.element.parentElement;setTimeout((function(){var n=e.querySelector("div[data-id='"+t.column.id+"'] div[class*='"+t.cssPrefix+"-expr-block'] div[class*='"+t.cssPrefix+"-colelement'] a");n&&n.click()}),500),this.fireColumnChanged()},e.prototype.changeTypeToAggr=function(t){this.column.getQuery().changeColumnType(this.column,r.ExprTag.AggregateFunction,{funcId:t}),this.fireColumnChanged()},e.prototype.processExtraButtonMenuItems=function(t,e){return"CUSTOMSQL"===t?this.changeTypeToCustomSql():this.changeTypeToAggr(t),!0},e.prototype.getExtraButtonMenuItems=function(){for(var t,e=[],n=this.panel.getContext().getModel().getAggrFunctions(),o=!0,r=!0,s=null,a=this.getAttribute(),l=0,u=n;l<u.length;l++){var c=u[l];o=c.getAppliedTypesOrDefault().indexOf(a.dataType)>=0,this.column.expr.func!==c.id||o||(r=!1),o&&(t=this.panel.getContext().getModel().getAggrFunctionCaption(c.id),s={id:c.id,text:t},e.push(s))}for(var d=0;d<n.length;d++)n[d];return r||(this.column.expr.func=e[0].id),this.panel.areCustomExpressionsAllowed()&&(s={id:"CustomSqlDivider",text:"---"},e.push(s),s={id:"CUSTOMSQL",text:t=i.i18n.getText("CustomExpression")},e.push(s)),[{id:"__group",text:i.i18n.getText("ColTypeGroup"),items:e}]},e}(a.b)},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return l}));var o=n(0),i=n(1),r=n(3),s=function(e,n,o,i){return new(o||(o=t))((function(t,r){function s(t){try{l(i.next(t))}catch(t){r(t)}}function a(t){try{l(i.throw(t))}catch(t){r(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof o?n:new o((function(t){t(n)}))).then(s,a)}l((i=i.apply(e,n||[])).next())}))},a=function(t,e){var n,o,i,r,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,o&&(i=2&r[0]?o.return:r[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,r[1])).done)return i;switch(o=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,o=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){s.label=r[1];break}if(6===r[0]&&s.label<i[1]){s.label=i[1],i=r;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(r);break}i[2]&&s.ops.pop(),s.trys.pop();continue}r=e.call(t,s)}catch(t){r=[6,t],o=0}finally{n=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}},l=function(){function e(t,e){var n=this;this.container=t,this.title=o.i18n.getText("Facets","DefaultFacetTitle"),this.cssPrefix="eqjs-facet",this.dialogTitle=o.i18n.getText("Facets","DefaultDlgTitle"),this.options={},this.canDisplayFlag=!0,this.downloadAllClickHandler=function(){var t=n.getContext().resultTable;if(t.elasticChunks){var e=n.getDialogService().openProgress({title:o.i18n.getText("Facets","LoadDataDlgTitle"),onSubmit:function(){return n.refresh()},determinated:!1});n.loadElasticChunk().then((function(t){e.submit()})).catch((function(t){e.submit(),n.getContext().throwError(t)}))}else{var i=t.getCachedRows().length,r=t.getTotal()-t.getCachedCount(),s=n.getDialogService().openProgress({title:o.i18n.getText("Facets","LoadDataDlgTitle"),content:o.i18n.getText("Facets","LoadDataDlgContent").replace("{loadedRecs}","0").replace("{totalRecs}",""+r),onSubmit:function(){return n.refresh()},determinated:!0}),a=0;setTimeout((function(){t.getRows({offset:i,limit:r}).then((function(t){var e=(a+=t.length)/r;s.updateContent(o.i18n.getText("Facets","LoadDataDlgContent").replace("{loadedRecs}",""+a).replace("{totalRecs}",""+r)),s.updateProgress(e)})).catch((function(t){s.submit(),n.getContext().throwError(t)}))}),10)}},o.utils.assignDeep(this.options,e)}return e.prototype.init=function(t){this.slot=t,this.contentDiv=Object(i.domel)("div",this.slot).addClass(this.cssPrefix+"-content").toDOM(),this.displayMessageDiv=Object(i.domel)("div",this.slot).hide().toDOM()},e.prototype.showSettingsDialog=function(){var e=this;return new t((function(t){var n=e.getDialogService(),o=e.renderDialogContent(),i=n.open({title:e.dialogTitle,body:o,cancelable:!0,closable:!1,onSubmit:function(){var n=e.submitSettingsDialog();return n&&t(!0),n},onCancel:function(){t(!1)}});e.afterDialogOpened(i)}))},e.prototype.afterDialogOpened=function(t){},e.prototype.renderDialogContent=function(){var t,e=Object(i.domel)("div").addClass("kfrm-form").addChild("div",(function(e){return t=e.addClass(r.a.isIE()?"kfrm-fields-ie col-ie-1-4 label-align-right":"kfrm-fields col-a-1 label-align-right").toDOM()}));return this.renderFormFields(e.toDOM(),t),e.toDOM()},e.prototype.renderFormFields=function(t,e){var n=this,s=e;r.a.isIE()&&(s=Object(i.domel)("div",e).addClass("kfrm-field-ie").toDOM()),Object(i.domel)(s).addChild("label",(function(t){return t.attr("for","tab_name").addText(o.i18n.getText("Facets","TabNameLabel"))})).addChild("input",(function(t){return t.id("facetTabName").name("tab_name").type("text").attr("value",n.title)}))},e.prototype.submitSettingsDialog=function(){var t=document.querySelector("#facetTabName");return 0!=t.value.length&&(this.title=t.value,!0)},e.prototype.getDialogService=function(){return this.getContext().getServices().getDialogService()},e.prototype.canDisplay=function(){var t=this.getContext().resultTable;return t.getCachedCount()==t.getTotal()},e.prototype.showErrorMessage=function(t){this.displayMessageDiv.innerHTML=t,this.displayMessageDiv.classList.add(this.cssPrefix+"-error-message"),Object(i.domel)(this.displayMessageDiv).show()},e.prototype.showUnableDisplayMessage=function(t){var e=this.getContext().resultTable;this.displayMessageDiv.innerHTML=t||o.i18n.getText("Facets","ErrNotEnoughData").replace("{totalRecs}",""+e.getTotal()).replace("{cachedRecs}",""+e.getCachedCount()).replace(/\[(.*)\]/g,"<a href='javascript:void(0)' class=\""+this.cssPrefix+'-download-all-link">$1</a>');var n=this.displayMessageDiv.querySelector("a."+this.cssPrefix+"-download-all-link");n&&n.addEventListener("click",this.downloadAllClickHandler),Object(i.domel)(this.contentDiv).hide(),Object(i.domel)(this.displayMessageDiv).show()},e.prototype.hideUnableDisplayMessage=function(){Object(i.domel)(this.displayMessageDiv).hide(),Object(i.domel)(this.contentDiv).show()},e.prototype.getContext=function(){return this.container.getContext()},e.prototype.getQuery=function(){return this.getContext().getQuery()},e.prototype.saveToData=function(){return{title:this.title,type:this.getType()}},e.prototype.loadFromData=function(t){t&&(this.title=t.title)},e.prototype.refresh=function(){this.hideUnableDisplayMessage(),this.canDisplay()?this.refreshCore():this.showUnableDisplayMessage()},e.prototype.loadElasticChunk=function(){return s(this,void 0,void 0,(function(){var e,n,o=this;return a(this,(function(i){return e=this.getContext().resultTable,n=e.getCachedRows().length,[2,e.getRows({offset:n,limit:e.chunkSize}).then((function(n){return e.totalIsKnown()?t.resolve():o.loadElasticChunk()}))]}))}))},e.prototype.onResize=function(){},e}()}).call(this,n(56))},function(t,e,n){"use strict";n.d(e,"a",(function(){return S}));var o,i=n(0),r=n(2),s=n(1),a=n(44),l=n(46),u=n(67),c=n(72),d=n(40),h=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),p=function(t){function e(e){var n=t.call(this,e)||this;return n.changeLocale=function(){var t=n.selectEl.value;i.i18n.setCurrentLocale(t),n.context.refreshWidgets(r.WidgetGroup.All)},n.group=r.WidgetGroup.None,n}return h(e,t),e.prototype.init=function(e,n){t.prototype.init.call(this,e,n),this.clear(),this.render()},e.prototype.getWidgetType=function(){return"changeLocale"},e.prototype.render=function(){var t=i.i18n.getLocales();if(t.length>1){this.selectEl=document.createElement("select");for(var e=0,n=t;e<n.length;e++){var o=n[e],r=document.createElement("option");r.value=o.locale,r.innerHTML=this.displayLocaleName(o),this.selectEl.appendChild(r)}this.selectEl.value=i.i18n.getCurrentLocale(),this.selectEl.classList.add("eqv-select"),this.selectEl.addEventListener("change",this.changeLocale),this.slot.appendChild(this.selectEl)}},e.prototype.displayLocaleName=function(t){return t.englishName&&t.displayName?t.englishName+" - "+t.displayName:t.englishName?t.englishName:t.displayName?t.displayName:t.locale},e.prototype.clear=function(){this.slot.innerHTML=""},e.prototype.destroyCore=function(){this.clear()},e}(r.Widget),f=n(25),g=n(88),y=n(85),m=n(98),v=n(3),b=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),C=function(t){function e(e){var n=t.call(this,e)||this;return n.queryEventCallbackId=null,n.group=r.WidgetGroup.Query|r.WidgetGroup.QueryStatus,n}return b(e,t),e.prototype.init=function(e,n){t.prototype.init.call(this,e,n),this.destroyCore(),this.attachQueryObserver()},Object.defineProperty(e.prototype,"cssPrefix",{get:function(){return"eqjs-query-name"},enumerable:!0,configurable:!0}),e.prototype.getWidgetType=function(){return"queryName"},e.prototype.refreshCore=function(){this.render()},e.prototype.render=function(){this.slot.classList.add(""+this.cssPrefix);var t=v.a.getMobileCssClass();t&&this.slot.classList.add(t),this.nameSlot||(this.nameSlot=document.createElement("div"),this.nameSlot.classList.add(this.cssPrefix+"-text"),this.nameSlot.classList.add(this.cssPrefix+"-theme"),this.slot.appendChild(this.nameSlot)),this.asteriskSlot||(this.asteriskSlot=document.createElement("span"),this.asteriskSlot.innerHTML="*",this.asteriskSlot.classList.add(this.cssPrefix+"-asterisk"),this.slot.appendChild(this.asteriskSlot)),this.tooltipSlot||(this.tooltipSlot=document.createElement("span"),this.tooltipSlot.classList.add(this.cssPrefix+"-tooltip"),this.tooltipSlot.classList.add(this.cssPrefix+"-theme"),this.slot.appendChild(this.tooltipSlot));var e=this.context.getQuery().getName();this.nameSlot.textContent=e,this.tooltipSlot.textContent=e,this.asteriskSlot.style.visibility=this.context.getQuery().isModified()?"visible":"hidden"},e.prototype.clear=function(){this.slot.innerHTML="",this.nameSlot=null,this.tooltipSlot=null,this.asteriskSlot=null},e.prototype.attachQueryObserver=function(){var t=this,e=this.context.getQuery();this.queryEventCallbackId=e.addChangedCallback((function(e){t.refreshCore()}))},e.prototype.detachQueryObserver=function(){this.queryEventCallbackId&&this.context.getQuery().removeChangedCallback(this.queryEventCallbackId)},e.prototype.destroyCore=function(){this.clear(),this.detachQueryObserver()},e}(r.Widget),x=n(87),w=n(99),T=n(4),E=n(92),D=n(93),S=function(){function t(){this.domRoots=[document],this.defaultViewOptions={enableExport:!0,disableConfirmationOnQueryChange:!1,queryFileExtensions:"text/xml,application/json",result:{clearResultOnQueryChange:!0,showChart:!0,showProcessIndicator:!0},widgets:{resultGrid:{addColumns:!1}},handlers:{}},this.viewOptions={},this.resultOptions={},this.enableExport=!1,this.resetContext(),this.renderSpinner()}return t.prototype.resetContext=function(){this.context=new r.EqContext,this.context.getServices().registerDialogServiceResolver((function(){return new s.DefaultDialogService}))},t.prototype.init=function(t){try{this.context.initStart(),t&&t.shadowRoots&&(this.domRoots=this.domRoots.concat(t.shadowRoots)),this.viewOptions=this.initOptions(t),this.resultOptions=i.utils.assignDeep(this.defaultViewOptions.result,this.viewOptions.result),this.initWidgets(this.viewOptions),this.context.init(this.viewOptions),this.initDone()}catch(t){this.context.throwError({action:"Init",sourceError:t})}},t.prototype.initOptions=function(t){return(t=i.utils.assignDeep(this.defaultViewOptions,t)).widgets.easyGrid||(t.widgets.easyGrid=t.widgets.resultGrid||{}),t.columnTitleFormat&&(t.widgets.entitiesPanel=t.widgets.entitiesPanel||{},t.widgets.entitiesPanel.columnTitleFormat=t.widgets.entitiesPanel.columnTitleFormat||t.columnTitleFormat,t.widgets.columnsBar=t.widgets.columnsBar||{},t.widgets.columnsBar.titleElementFormat=t.widgets.columnsBar.titleElementFormat||t.columnTitleFormat,t.widgets.columnsPanel=t.widgets.columnsPanel||{},t.widgets.columnsPanel.titleElementFormat=t.widgets.columnsPanel.titleElementFormat||t.columnTitleFormat),t.widgets.easyGrid.paging=i.utils.assignDeep({},t.result.paging,t.widgets.easyGrid.paging),this.enableExport=t.enableExport||!1,t.widgets.exportWidget||(t.widgets.exportWidget={}),t.widgets.exportWidget.enableExport=this.enableExport,t},t.prototype.initWidgets=function(t){var e="QueryPanel",n="ColumnsPanel",o="EntitiesPanel",i="ResultPanel",r="ColumnsBar",a="FilterBar",l="ProcessBar",u="StatementPanel",c="ChangeLocale",d="QueryNameLabel",h="ResultFacetsPanel",p="ResultCount",f="ExportButton",g="AggregationBar";t.slots&&(d=t.slots.queryNameLabel||d,e=t.slots.queryPanel||e,n=t.slots.columnsPanel||n,r=t.slots.columnsBar||r,o=t.slots.entitiesPanel||o,i=t.slots.resultPanel||i,u=t.slots.statementPanel||u,l=t.slots.processBar||l,c=t.slots.changeLocale||c,h=t.slots.facetsPanel||h,p=t.slots.resultCountSpan||p,a=t.slots.filterBar||a,f=t.slots.exportButtons||f,g=t.slots.aggregationBar||g);var y=this.resolveElement(o);y&&!this.entitiesPanelWidget&&(this.entitiesPanelWidget=this.createEntitiesPanelWidget(y),this.context.addWidget(this.entitiesPanelWidget));var m=this.resolveElement(n);m&&!this.columnsPanelWidget&&(this.columnsPanelWidget=this.createColumnsPanelWidget(m),this.context.addWidget(this.columnsPanelWidget));var v=this.resolveElement(r);v&&!this.columnsBarWidget&&(this.columnsBarWidget=this.createColumnsBarWidget(v),this.context.addWidget(this.columnsBarWidget));var b=this.resolveElement(e);if(b&&!this.queryPanelWidget&&(this.queryPanelWidget=this.createQueryPanelWidget(b),this.context.addWidget(this.queryPanelWidget)),this.resultPanelSlot=this.resolveElement(i),this.resultPanelSlot){if(!this.resultGridWidget){var C=Object(s.addElement)(this.resultPanelSlot,"div",{cssClass:"eqv-result-grid"});this.resultGridWidget=this.createResultGridWidget(C),this.context.addWidget(this.resultGridWidget)}if(this.resultOptions.showChart&&!this.chartWidget){var x=Object(s.addElement)(this.resultPanelSlot,"div",{cssClass:"eqv-chart-panel"});x.style.display="none",this.chartWidget=this.createChartWidget(x),this.context.addWidget(this.chartWidget)}}var w=this.resolveElement(d);w&&!this.queryNameWidget&&(this.queryNameWidget=this.createQueryNameWidget(w),this.context.addWidget(this.queryNameWidget));var T=this.resolveElement(a);T&&!this.filterBarWidget&&(this.filterBarWidget=this.createFilterBarWidget(T),this.context.addWidget(this.filterBarWidget));var E=this.resolveElement("SortingBar");E&&!this.sortingBarWidget&&(this.sortingBarWidget=this.createSortingBarWidget(E),this.context.addWidget(this.sortingBarWidget));var D=this.resolveElement(l);D&&!this.processWidget&&(this.processWidget=this.createProcessWidget(D),this.context.addWidget(this.processWidget));var S=this.resolveElement(u);S&&!this.statementPanelWidget&&(this.statementPanelWidget=this.createStatementPanelWidget(S),this.context.addWidget(this.statementPanelWidget));var k=this.resolveElement(c);if(k){var M=this.createLocaleWidget(k);this.context.addWidget(M)}var I=this.resolveElement(h);I&&!this.resultFacetPanelWidget&&(this.resultFacetPanelWidget=this.createResultFacetsPanel(I),this.context.addWidget(this.resultFacetPanelWidget));var O=this.resolveElement(f);O&&!this.exportWidget&&(this.exportWidget=this.createExportWidget(O),this.context.addWidget(this.exportWidget)),this.resultCountSlot=this.resolveElement(p);var A=this.resolveElement(g);A&&!this.aggregationBarWidget&&(this.aggregationBarWidget=this.createAggregationBarWidget(A),this.context.addWidget(this.aggregationBarWidget))},t.prototype.initDone=function(){},t.prototype.resolveElement=function(t){if("string"==typeof t){for(var e=0,n=this.domRoots;e<n.length;e++){var o=n[e].getElementById(t);if(o)return o}return null}return t},t.prototype.resolveElementsByClassName=function(t){for(var e=[],n=0,o=this.domRoots;n<o.length;n++)for(var i=o[n].querySelectorAll("."+t),r=0;r<i.length;r++)e.push(i[r]);return e},t.prototype.displayRecordsCount=function(t){this.resultCountSlot&&void 0!==t&&(this.resultCountSlot.style.display="inline",this.resultCountSlot.innerHTML=i.i18n.getText("MsgResultCount").replace("{0}",t.toString()))},t.prototype.getContext=function(){return this.context},t.prototype.setDialogService=function(t){this.context.getServices().registerDialogServiceResolver((function(){return t}))},t.prototype.executeQuery=function(t){console.warn("`executeQuery` is deprecated. Use `fetchData` instead"),this.fetchData(t)},t.prototype.fetchData=function(t){var e=this;t=t||{refresh:!0},this.context.clearResult(),this.context.getQuery().isEmpty()&&!this.resultOptions.fetchEmptyQueries||(this.showResultSpinner(),this.context.fetchData({elasticPaging:t.elasticPaging,success:function(n){e.hideResultSpinner(),e.toggleExportButtons(),e.displayRecordsCount(e.context.resultTable.getTotal()),!0===t.refresh&&e.context.refreshWidgets(r.WidgetGroup.Result),t.callback&&t.callback(),t.success&&t.success()},error:function(){e.hideResultSpinner()}}))},t.prototype.toggleExportButtons=function(){this.enableExport&&this.context.resultTable&&this.context.resultTable.getCachedCount()>0?this.enableExportButtons():this.disableExportButtons()},t.prototype.enableExportButtons=function(){},t.prototype.disableExportButtons=function(){},t.prototype.renderSpinner=function(){this._spinnerDiv=Object(s.domel)("div").addClass("eqjs-result-spinner").addChild("div",(function(t){return t.addClass(T.b+"-progress-win8",v.a.getMobileCssClass()).addHtml('<div class="wBall" id="wBall_1"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_2"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_3"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_4"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_5"><div class="wInnerBall"></div></div>')})).toDOM()},t.prototype.showResultSpinner=function(){if(this.resultOptions.showProcessIndicator&&this.resultPanelSlot&&!this._spinnerDiv.parentNode){for(var t=0;t<this.resultPanelSlot.children.length;t++){var e=this.resultPanelSlot.children[t];Object(s.domel)(e).hide()}this.resultPanelSlot.appendChild(this._spinnerDiv)}},t.prototype.hideResultSpinner=function(){if(this.resultOptions.showProcessIndicator&&this.resultPanelSlot&&this._spinnerDiv.parentNode){this._spinnerDiv.parentNode.removeChild(this._spinnerDiv);for(var t=0;t<this.resultPanelSlot.children.length;t++){var e=this.resultPanelSlot.children[t];Object(s.domel)(e).show()}}},t.prototype.createChartWidget=function(t){return this.resultOptions.chartWidgetResolver?this.resultOptions.chartWidgetResolver(t):new l.a(t)},t.prototype.createResultGridWidget=function(t){return this.resultOptions.resultGridResolver?this.resultOptions.resultGridResolver(t):new a.a(t)},t.prototype.createEntitiesPanelWidget=function(t){return new u.a(t)},t.prototype.createColumnsPanelWidget=function(t){return new c.a(t)},t.prototype.createQueryPanelWidget=function(t){return new f.a(t)},t.prototype.createLocaleWidget=function(t){return new p(t)},t.prototype.createProcessWidget=function(t){return new g.a(t)},t.prototype.createColumnsBarWidget=function(t){return new d.a(t)},t.prototype.createFilterBarWidget=function(t){return new y.a(t)},t.prototype.createSortingBarWidget=function(t){return new m.a(t)},t.prototype.createQueryNameWidget=function(t){return new C(t)},t.prototype.createStatementPanelWidget=function(t){return new x.a(t)},t.prototype.createResultFacetsPanel=function(t){return new w.a(t)},t.prototype.createExportWidget=function(t){return new E.a(t)},t.prototype.createAggregationBarWidget=function(t){return new D.a(t)},t.prototype.detach=function(){this.entitiesPanelWidget&&(this.entitiesPanelWidget.destroy(),this.entitiesPanelWidget=null),this.columnsPanelWidget&&(this.columnsPanelWidget.destroy(),this.columnsPanelWidget=null),this.queryPanelWidget&&(this.queryPanelWidget.destroy(),this.queryPanelWidget=null),this.columnsBarWidget&&(this.columnsBarWidget.destroy(),this.columnsBarWidget=null),this.resultGridWidget&&(this.resultGridWidget.destroy(),this.resultGridWidget=null),this.chartWidget&&(this.chartWidget.destroy(),this.chartWidget=null),this.queryNameWidget&&(this.queryNameWidget.destroy(),this.queryNameWidget=null),this.processWidget&&(this.processWidget.destroy(),this.processWidget=null),this.localeWidget&&(this.localeWidget.destroy(),this.localeWidget=null),this.statementPanelWidget&&(this.statementPanelWidget.destroy(),this.statementPanelWidget=null),this.filterBarWidget&&(this.filterBarWidget.destroy(),this.filterBarWidget=null),this.sortingBarWidget&&(this.sortingBarWidget.destroy(),this.sortingBarWidget=null),this.statementWidget&&(this.statementWidget.destroy(),this.statementWidget=null),this.exportWidget&&(this.exportWidget.destroy(),this.exportWidget=null),this.resultFacetPanelWidget&&(this.resultFacetPanelWidget.destroy(),this.resultFacetPanelWidget=null),this.resultCountSlot&&(this.resultCountSlot.innerHTML="",this.resultCountSlot=null),this.resultPanelSlot&&(this.resultPanelSlot.innerHTML="",this.resultPanelSlot=null),this.domRoots=[document],this.resetContext()},t}()},function(t,e,n){"use strict";n.d(e,"b",(function(){return s})),n.d(e,"a",(function(){return a}));var o=n(0),i=n(21),r=n(12),s=function(){function t(){this.id="",this.expr="",this.constValueFormat="{const}",this.caption="{Unrecognized operator}",this.displayFormat="{expr1} [[{unrecognized operator}]] {expr2}",this.isRange=!1,this.caseIns=!1,this.paramCount=2,this.defaultOperand=new a,this.appliedTypes=[],this.operands=new Array}return t.prototype.loadFromData=function(t,e){if(e&&(this.id=e.id,this.caption=e.cptn,this.caseIns=e.caseIns,this.isRange=e.isRange,this.displayFormat=e.fmt,this.paramCount=e.pcnt,this.expr=e.expr,this.appliedTypes=e.dtypes||this.appliedTypes,e.defOperand&&this.defaultOperand.loadFromData(t,e.defOperand),e.editor&&(this.defaultOperand.editor=t.getEditorById(e.editor)||new i.a),e.operands))for(var n=0;n<e.operands.length;n++){var o=new a;o.loadFromData(t,e.operands[n]),e.editor&&(o.editor=t.getEditorById(e.editor)||new i.a),this.operands.push(o)}},t}(),a=function(){function t(){this.kind=r.a.Scalar,this.dataType=o.DataType.Unknown,this.editor=new i.a,this.defValue=""}return t.prototype.loadFromData=function(t,e){this.kind=e.kind,this.dataType=e.dtype,this.defValue=e.val,this.defText=e.txt,e.editor&&(this.editor=t.getEditorById(e.editor)||new i.a)},t.prototype.copyFrom=function(t){o.utils.assign(this,t)},t}()},function(t,e,n){"use strict";var o;n.d(e,"a",(function(){return o})),function(t){t[t.Always=0]="Always",t[t.Once=1]="Once",t[t.Never=2]="Never"}(o||(o={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return h})),n.d(e,"c",(function(){return p}));var o,i,r=n(0),s=n(2),a=n(1),l=n(77),u=n(3),c=n(10),d=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});!function(t){t[t.AddCondition=0]="AddCondition",t[t.AddGroup=1]="AddGroup",t[t.Enable=2]="Enable",t[t.Delete=4]="Delete",t[t.Menu=5]="Menu",t[t.Parameterized=6]="Parameterized",t[t.InJoin=7]="InJoin"}(i||(i={}));var h=function(){function t(t,e,n){this.panel=t,this.condition=e,this.element=n||Object(a.domel)("div").toDOM()}return Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"eqjs-qp"},enumerable:!0,configurable:!0}),t.prototype.refresh=function(){this.render()},t.prototype.clear=function(){this.element&&(this.element.className="",this.element.removeAttribute("data-id"),this.element.removeAttribute("style"),Object(a.domel)(this.element).html(""))},t.prototype.render=function(t){return this.clear(),this.coreRender(t),this.panel.options.onConditionRendered&&this.panel.options.onConditionRendered(this.condition,this.element),this.element},t.prototype.isEditable=function(){return this.condition.enabled&&!this.condition.isReadOnly()},t}(),p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return d(e,t),e.prototype.getClassesToAdd=function(){var t=this.cssPrefix+"-row "+this.cssPrefix+"-row-condition";if(t+=this.condition.isInJoin()?" "+this.cssPrefix+"-condition-injoin":"",t+=this.condition.isParameterized()?" "+this.cssPrefix+"-condition-parameterized":"",!u.a.isMobileMode()){var e=this.condition.getLevel();e>0&&(t+=" "+this.cssPrefix+"-level-"+e)}return t+=this.condition.enabled?"":" "+this.cssPrefix+"-disabled",this.condition.enabled&&(t+=this.condition.isReadOnly()?" "+this.cssPrefix+"-readonly":""),t},e.prototype.coreRender=function(t){var e=this,n=this.panel.getContext().getModel(),o=n.getOperatorById(this.condition.getOperatorId()),i=s.equtils.parseOperatorFormat(o),r=null,c=i.length,d=Object(a.domel)("div");this.element&&this.element.parentNode&&this.element.parentNode.replaceChild(d.toDOM(),this.element),this.element=d.toDOM(),d.addClass(this.getClassesToAdd()).addClass(u.a.getMobileCssClass()).data("id",this.condition.id).data("condrow","").addChildElement(this.renderCheckbox()).addChildElement(this.renderConjunction());for(var h=t,p=o==n.nullOperator?Math.min(c,this.condition.expressions.length+1):c,f=function(t){if("operator"===(r=i[t]).type){var e=g.panel.getOperatorRenderer(g.condition,r.text);e&&d.addChildElement(e.render())}else if("expression"===r.type){var n=h&&r.index>0,o=g.panel.getExpressionRenderer(g.condition.expressions[r.index]);if(o){var s=o.render(n);d.addChildElement(s),setTimeout((function(){o.adjustWidth()}),100)}h=h&&!n}else"text"===r.type&&d.addChildElement(new l.a(g.panel,r.text).render())},g=this,y=0;y<p;y++)f(y);(this.panel.options.accentActiveCondition||u.a.isMobileMode())&&d.on("click",(function(t){return t.stopPropagation(),e.panel.toggleConditionPicked(e.condition),e.adjustButtonsVisibility(),u.a.isMobileMode()||e.element.dispatchEvent(Object(a.createBrowserEvent)("mouseenter")),!1})),d.addChildElement(this.renderButtonsBlock()),u.a.isMobileMode()||d.on("mouseenter",(function(t){return e.isMouseOverBlock=!0,e.enterButtonBlock(),t.stopPropagation(),!1})).on("mouseleave",(function(t){return e.isMouseOverBlock=!1,!e.keepShowingButtons&&Object(a.domel)(e.buttonsBlock).isVisible()&&e.leaveButtonBlock(),t.stopPropagation(),!1}))},e.prototype.setConditionParameterized=function(t){this.condition.setParameterized(t),this.condition.fireChangedEvent()},e.prototype.setConditionInJoin=function(t){this.condition.setInJoin(t),this.condition.fireChangedEvent()},e.prototype.getConditionMenu=function(){return this.panel.getConditionMenu()},e.prototype.renderConjunction=function(){var t=this.condition.getParent();if(!t)return null;var e=0==r.utils.findItemIndexById(t.getConditions(),this.condition.id);if(this.panel.options.showConjunctions&&!e){var n=s.equtils.linkTypeToStr(this.condition.getParent().linkType),o=r.i18n.getText("Conj"+n);return Object(a.domel)("span").text(o).title(o).addClass(this.cssPrefix+"-condelement "+this.cssPrefix+"-condition-conjuction").toDOM()}return null},e.prototype.renderCheckbox=function(){var t=this;return this.panel.options.showCheckboxes&&!this.condition.isReadOnly()?Object(a.domel)("div").title(r.i18n.getText("CmdToggleEnable")).attr("tabIndex","0").addClass(this.cssPrefix+"-condelement "+this.cssPrefix+"-condition-checkbox").addClass(this.condition.enabled?"enabled":"").on("click",(function(){return t.condition.enabled=!t.condition.enabled,t.condition.fireChangedEvent(),!1})).on("keypress",(function(t){[13,32].includes(t.keyCode)&&t.target.click()})).toDOM():null},e.prototype.isConditionActive=function(){return this.element.classList.contains("active")},e.prototype.hideButtons=function(){Object(a.domel)(this.element).data("show-buttons",null)},e.prototype.showButtons=function(){Object(a.domel)(this.element).data("show-buttons","")},e.prototype.adjustButtonsVisibility=function(){(this.panel.options.alwaysShowButtonsInConditions||this.panel.options.accentActiveCondition&&this.isConditionActive())&&this.showButtons()},e.prototype.enterButtonBlock=function(){this.showButtons()},e.prototype.leaveButtonBlock=function(){this.panel.options.alwaysShowButtonsInConditions||this.isConditionActive()&&this.panel.options.accentActiveCondition||this.hideButtons()},e.prototype.conditionMenuHandler=function(t,e){var n=this;switch(t){case i.AddCondition:if(!this.condition.isGroup())return;var o=this.panel.getEntitiesMenu();o&&o.showMenu({anchor:e.target,itemSelectedCallback:function(t){var e=n.panel.getQuery(),o={parent:n.condition,attributeId:t.id},i=e.addSimpleCondition(o);return i&&e.fireConditionsChangedEvent(s.QueryChangeAction.Add,i),!1}});break;case i.AddGroup:if(!this.condition.isGroup())return;var r=this.panel.getQuery(),a={parent:this.condition},l=this.panel.getQuery().addConditionGroup(a);l&&r.fireConditionsChangedEvent(s.QueryChangeAction.Add,l);break;case i.Enable:this.condition.enabled=!this.condition.enabled,this.condition.fireChangedEvent();break;case i.Delete:var u=this.condition.getParent();if(!u)return;var d=u.getConditions(),h=d.indexOf(this.condition);h>=0&&(d.splice(h,1),this.condition.getQuery().fireConditionsChangedEvent(s.QueryChangeAction.Delete,this.condition));break;case i.Menu:var p=this.getConditionMenu();this.keepShowingButtons=!0,p.showMenu({anchor:e.target,selectedIds:this.getConditionMenuSelectedItems(),itemSelectedCallback:function(t){var o;switch(t.id){case"enable":o=i.Enable;break;case"delete":o=i.Delete;break;case"param":o=i.Parameterized;break;case"inJoin":o=i.InJoin;break;case"addCondition":o=i.AddCondition;break;case"addGroup":o=i.AddGroup}n.conditionMenuHandler(o,e)},itemFilterCallback:function(t){var e=n.condition.enabled||"enable"===t.id||"delete"===t.id;if("enable"===t.id){var o=n.condition.getParent();e=e&&o&&o.enabled}else"delete"===t.id?e=e&&(n.panel.options.editableParts&c.a.Removal)===c.a.Removal:"addGroup"!==t.id&&"addCondition"!==t.id||(e=e&&(n.panel.options.editableParts&c.a.Addition)===c.a.Addition);return e},menuClosedCallback:function(){n.keepShowingButtons=!1,n.isMouseOverBlock||n.leaveButtonBlock()}});break;case i.Parameterized:this.condition.setParameterized(!this.condition.isParameterized()),this.condition.fireChangedEvent();break;case i.InJoin:this.condition.setInJoin(!this.condition.isInJoin()),this.condition.fireChangedEvent()}return e.stopPropagation(),!1},e.prototype.getConditionMenuSelectedItems=function(){var t=[];return this.condition.enabled&&t.push("enable"),this.condition.isParameterized()&&t.push("param"),this.condition.isInJoin()&&t.push("inJoin"),t},e.prototype.renderButtonsBlock=function(){var t=this,e=function(e){Object(a.domel)(e.target).addClass(t.cssPrefix+"-condition-button-active")},n=function(e){Object(a.domel)(e.target).removeClass(t.cssPrefix+"-condition-button-active")},o=Object(a.domel)("div").addClass(this.cssPrefix+"-condition-buttonsBlock").addClass(u.a.getMobileCssClass());if(this.buttonsBlock=o.toDOM(),this.condition.isReadOnly())return this.buttonsBlock;var s=this.getButtonsToShow();return s.indexOf("addCondition")>=0&&this.condition.enabled&&(this.panel.options.editableParts&c.a.Addition)==c.a.Addition&&o.addChild("div",(function(o){o.addClass(t.cssPrefix+"-button-placeholder").data("btnplaceholder","").addChild("div",(function(o){o.addClass(t.cssPrefix+"-condition-button "+t.cssPrefix+"-condition-button-addCondition").attr("tabIndex","0").data("button","").title(r.i18n.getText("CmdAddCondition")).on("click",(function(e){return t.conditionMenuHandler(i.AddCondition,e)})).on("keypress",(function(t){13==t.keyCode&&t.target.click()})).on("mouseenter",e).on("mouseleave",n)}))})),(s.indexOf("addGroup")>=0||s.indexOf("addPredicate")>=0)&&this.condition.enabled&&(this.panel.options.editableParts&c.a.Addition)==c.a.Addition&&o.addChild("div",(function(o){o.addClass(t.cssPrefix+"-button-placeholder").data("btnplaceholder","").addChild("div",(function(o){o.addClass(t.cssPrefix+"-condition-button "+t.cssPrefix+"-condition-button-addPredicate").attr("tabIndex","0").data("button","").title(r.i18n.getText("CmdAddCondGroup")).on("click",(function(e){return t.conditionMenuHandler(i.AddGroup,e)})).on("keypress",(function(t){13==t.keyCode&&t.target.click()})).on("mouseenter",e).on("mouseleave",n)}))})),this.getButtonsToShow().indexOf("enable")>=0&&this.condition.getParent()&&this.condition.getParent().enabled&&o.addChild("div",(function(o){o.addClass(t.cssPrefix+"-button-placeholder").data("btnplaceholder","").addChild("div",(function(o){o.addClass(t.cssPrefix+"-condition-button "+t.cssPrefix+"-condition-button-enable").attr("tabIndex","0").data("button","").title(r.i18n.getText("CmdToggleEnable")).addClass(t.condition.enabled?"enabled":"").on("click",(function(e){return t.conditionMenuHandler(i.Enable,e)})).on("keypress",(function(t){13==t.keyCode&&t.target.click()})).on("mouseenter",e).on("mouseleave",n)}))})),this.getButtonsToShow().indexOf("delete")>=0&&this.condition.getParent()&&(this.panel.options.editableParts&c.a.Removal)==c.a.Removal&&o.addChild("div",(function(o){o.addClass(t.cssPrefix+"-button-placeholder").data("btnplaceholder","").addChild("div",(function(o){o.addClass(t.cssPrefix+"-condition-button "+t.cssPrefix+"-condition-button-delete").attr("tabIndex","0").data("button","").title(r.i18n.getText("CmdDelete")).on("click",(function(e){return t.conditionMenuHandler(i.Delete,e)})).on("keypress",(function(t){13==t.keyCode&&t.target.click()})).on("mouseenter",e).on("mouseleave",n)}))})),this.getButtonsToShow().indexOf("menu")>=0&&o.addChild("div",(function(o){o.addClass(t.cssPrefix+"-button-placeholder").data("btnplaceholder","").addChild("div",(function(o){o.addClass(t.cssPrefix+"-condition-button "+t.cssPrefix+"-condition-button-menu").attr("tabIndex","0").data("button","").title(r.i18n.getText("ButtonMenu")).on("click",(function(e){return t.conditionMenuHandler(i.Menu,e)})),u.a.isMobileMode()||o.on("keypress",(function(t){13==t.keyCode&&t.target.click()})).on("mouseenter",e).on("mouseleave",n)}))})),this.adjustButtonsVisibility(),this.buttonsBlock},e.prototype.getButtonsToShow=function(){return this.panel.options.buttons&&this.panel.options.buttons.condition&&Array.isArray(this.panel.options.buttons.condition)?this.panel.options.buttons.condition:["enable","delete"]},e}(h)},function(t,e,n){"use strict";var o;n.d(e,"a",(function(){return o})),function(t){t.Trace="TRACE",t.Options="OPTIONS",t.Get="GET",t.Put="PUT",t.Post="POST",t.Delete="DELETE"}(o||(o={}))},function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return l})),n.d(e,"a",(function(){return c})),n.d(e,"d",(function(){return d}));var o,i=n(0),r=n(18),s=n(6),a="undefined"!=typeof TouchEvent;!function(t){t.None="none",t.Allow="allow",t.Forbid="forbid"}(o||(o={}));var l=function(t,e,n){this.dropEffect=o.Allow,this.pageX=0,this.pageY=0,this.item=t,this.dragImage=e,this.data=t.data,this.sourceEvent=n,n&&n instanceof MouseEvent&&(this.pageX=n.pageX,this.pageY=n.pageY),n&&a&&n instanceof TouchEvent&&n.touches[0]&&(this.pageX=n.touches[0].pageX,this.pageY=n.touches[0].pageY)},u=function(t){t&&t instanceof MouseEvent&&(this.x=t.pageX,this.y=t.pageY),t&&a&&t instanceof TouchEvent&&t.touches[0]&&(this.x=t.touches[0].pageX,this.y=t.touches[0].pageY)},c=function(){function t(){this.delta=5,this.draggableItem=null,this.dragImage=null,this.finishedSuccessfully=!1,this.mouseDownPosition=null,this.containerDescriptors=[],this.containerDescriptorIndex=-1,this.dropEffect=o.None,this.classPrefix="eqjs-drop",this.DRAG_DISABLED_ATTR="drag-disabled"}return t.prototype.registerDraggableItem=function(t){var e=this,n=t.element;if(!n)throw Error("Element in draggle item is null or undefined");n.ondragstart=function(){return!1};var i=function(t){if(!n.hasAttribute(e.DRAG_DISABLED_ATTR)){t.preventDefault(),t instanceof MouseEvent&&t.stopPropagation();var o=new u(t);(Math.abs(o.x-e.mouseDownPosition.x)>e.delta||Math.abs(o.y-e.mouseDownPosition.y)>e.delta)&&c(t)}},r=function(t){e.mouseMoveDragListener(t)},c=function(a){a.preventDefault(),a.stopPropagation(),n.removeEventListener("mousemove",i),n.removeEventListener("touchmove",i),e.finishedSuccessfully=!1,t.beforeDragStart&&t.beforeDragStart(),e.dragImage=Object(s.e)("div").setStyle("position","absolute").setStyle("z-index","65530").toDOM(),document.body.appendChild(e.dragImage),e.dragImage.appendChild(n.cloneNode(!0)),t.renderer&&t.renderer(e.dragImage),e.dropEffect=o.None,e.updateCusror(e.dropEffect),e.updateImageClass(e.dropEffect),e.draggableItem={element:n,scope:t.scope,data:t.data},e.updateDragItemPosition(a);var u=new l(e.draggableItem,e.dragImage,a);u.dropEffect=e.dropEffect,t.onDragStart&&t.onDragStart(u),e.dropEffect!==u.dropEffect&&(e.dropEffect=u.dropEffect,e.updateImageClass(e.dropEffect)),document.addEventListener("mousemove",r,!0),document.addEventListener("touchmove",r,!0)},d=function(t){a&&t instanceof TouchEvent&&t.preventDefault(),e.mouseDownPosition=new u(t),n.addEventListener("mousemove",i),n.addEventListener("touchmove",i),document.addEventListener("mouseup",h),document.addEventListener("touchend",h)};n.addEventListener("mousedown",d),n.addEventListener("touchstart",d);var h=function(t){e.mouseDownPosition=null,n.removeEventListener("mousemove",i),n.removeEventListener("touchmove",i),document.removeEventListener("mousemove",r,!0),document.removeEventListener("touchmove",r,!0),e.draggableItem&&p(t)},p=function(n){try{if(e.containerDescriptorIndex>=0){var i=e.containerDescriptors[e.containerDescriptorIndex],r={element:i.element,scopes:i.scopes,data:i.data},s=new l(e.draggableItem,e.dragImage,n);try{r.scopes.indexOf(e.draggableItem.scope)>=0&&e.dropEffect===o.Allow&&(e.finishedSuccessfully=!0,i.onDrop&&i.onDrop(r,s))}finally{i.onDragLeave&&i.onDragLeave(r,s)}}}finally{try{var a=new l(e.draggableItem,e.dragImage,n);a.data.finishedSuccessfully=e.finishedSuccessfully,t.onDragEnd&&t.onDragEnd(a)}finally{e.draggableItem=null,e.dragImage&&e.dragImage.parentElement&&e.dragImage.parentElement.removeChild(e.dragImage),e.dragImage=null,e.finishedSuccessfully=!1,document.removeEventListener("mouseup",h),document.removeEventListener("touchend",h)}}}},t.prototype.registerDropContainer=function(t){if(!t.element)throw Error("Element in drop container is null or undefined");this.containerDescriptors.push(t)},t.prototype.removeDropContainer=function(t){var e=this.containerDescriptors.filter((function(e){return e===t||e.element==t}));if(e)for(var n=0,o=e;n<o.length;n++){var r=o[n];i.utils.removeArrayItem(this.containerDescriptors,r)}},t.prototype.mouseMoveDragListener=function(t){if(t instanceof MouseEvent&&t.preventDefault(),t.stopPropagation(),this.updateDragItemPosition(t),-1==this.containerDescriptorIndex){for(var e=0;e<this.containerDescriptors.length;e++){var n=this.containerDescriptors[e];if(this.detectDragEnterEvent(n.element,t)){this.containerDescriptorIndex=e;break}}this.containerDescriptorIndex>=0&&this.dragEnterEvent(t)}else{n=this.containerDescriptors[this.containerDescriptorIndex];this.detectDragLeaveEvent(n.element,t)&&(this.dragLeaveEvent(t),this.containerDescriptorIndex=-1)}if(this.containerDescriptorIndex>=0){var o={element:(n=this.containerDescriptors[this.containerDescriptorIndex]).element,scopes:n.scopes,data:n.data};if(o.scopes.indexOf(this.draggableItem.scope)>=0){var i=new l(this.draggableItem,this.dragImage,t);i.dropEffect=this.dropEffect,n.onDragOver&&n.onDragOver(o,i)}}},t.prototype.updateCusror=function(t){switch(t){case o.Allow:this.setCursorStyle(this.dragImage,"grabbing");break;case o.Forbid:this.setCursorStyle(this.dragImage,"no-drop");break;default:this.setCursorStyle(this.dragImage,"grabbing")}},t.prototype.updateImageClass=function(t){switch(this.dragImage.classList.remove(this.classPrefix+"-allow"),this.dragImage.classList.remove(this.classPrefix+"-forbid"),this.dragImage.classList.remove(this.classPrefix+"-none"),t){case o.Allow:this.dragImage.classList.add(this.classPrefix+"-allow");break;case o.None:this.dragImage.classList.add(this.classPrefix+"-none");break;case o.Forbid:this.dragImage.classList.add(this.classPrefix+"-forbid");break;default:this.dragImage.classList.add(this.classPrefix+"-none")}},t.prototype.setCursorStyle=function(t,e){if(t){t.style.cursor=e;for(var n=0;n<t.children.length;n++)this.setCursorStyle(t.children[n],e)}},t.prototype.updateDragItemPosition=function(t){if(this.dragImage){var e=new u(t);this.dragImage.style.top=e.y-this.dragImage.offsetHeight/2+"px",this.dragImage.style.left=e.x-this.dragImage.offsetWidth/2+"px"}},t.prototype.dragEnterEvent=function(t){var e=this.containerDescriptors[this.containerDescriptorIndex],n={element:e.element,scopes:e.scopes,data:e.data};if(n.scopes.indexOf(this.draggableItem.scope)>=0){var i=new l(this.draggableItem,this.dragImage,t);i.dropEffect=o.Allow,e.onDragEnter&&e.onDragEnter(n,i),this.dropEffect=i.dropEffect,this.updateCusror(this.dropEffect),this.updateImageClass(this.dropEffect)}else this.dropEffect!==o.Forbid&&(this.dropEffect=o.None,this.updateCusror(this.dropEffect),this.updateImageClass(this.dropEffect))},t.prototype.dragLeaveEvent=function(t){var e=this.containerDescriptors[this.containerDescriptorIndex],n={element:e.element,scopes:e.scopes,data:e.data};if(n.scopes.indexOf(this.draggableItem.scope)>=0){var i=new l(this.draggableItem,this.dragImage,t);i.dropEffect=o.None,e.onDragLeave&&e.onDragLeave(n,i),this.dropEffect=i.dropEffect,this.updateCusror(this.dropEffect),this.updateImageClass(this.dropEffect)}},t.prototype.detectDragEnterEvent=function(t,e){var n=Object(r.g)(t),o=new u(e);return!(o.y<n.y||o.y>n.y+t.offsetHeight)&&!(o.x<n.x||o.x>n.x+t.offsetWidth)},t.prototype.detectDragLeaveEvent=function(t,e){var n=Object(r.g)(t),o=new u(e);return!(o.y>n.y&&o.y<n.y+t.offsetHeight&&o.x>n.x&&o.x<n.x+t.offsetWidth)},t}(),d=new c},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var o,i=n(0),r=n(60),s=n(33),a=n(23),l=n(21),u=n(12),c=n(27),d=n(29),h=n(8),p=n(61),f=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),g=function(t){function e(){var e=t.call(this)||this;return e.mainEntity=null,e.nullAttribute=new a.b(null),e.nullOperator=new s.b,e.operators=new Array,e.rootEntity=new a.a,e.aggrFunctions=new Array,e.dateMacros=["Today","Yesterday","Tomorrow","FirstDayOfMonth","LastDayOfMonth","FirstDayOfWeek","FirstDayOfYear","FirstDayOfNextWeek","FirstDayOfPrevMonth","FirstDayOfNextMonth","FirstDayOfNextYear","FirstDayOfPrevYear","FirstDayOfPrevWeek"],e.timeMacros=["Now","HourStart","Midnight","Noon"],e.links=[],e}return f(e,t),e.prototype.getMainEntity=function(){return this.mainEntity},e.prototype.loadFromJSON=function(t){var e=JSON.parse(t);this.loadFromData(e)},e.prototype.loadFromData=function(e){if(t.prototype.loadFromData.call(this,e),this.operators=new Array,e.operators)for(var n=0;n<e.operators.length;n++){var o=new s.b;o.loadFromData(this,e.operators[n]),this.operators.push(o)}if(this.rootEntity.loadFromData(this,e.entroot),this.aggrFunctions=new Array,e.aggrfuncs)for(n=0;n<e.aggrfuncs.length;n++){var i=new r.a;i.loadFromData(e.aggrfuncs[n]),this.aggrFunctions.push(i)}},e.prototype.getObject=function(){return this},e.prototype.setData=function(t){"string"==typeof t?this.loadFromJSON(t):this.loadFromData(t)},e.prototype.createEntity=function(t){return new a.a(t)},e.prototype.createEntityAttr=function(t){return new a.b(t)},e.prototype.createValueEditor=function(){return new l.a},e.prototype.createQuery=function(){return new d.b(this)},e.prototype.getRootEntity=function(){return this.rootEntity},e.prototype.getEditorById=function(e){return t.prototype.getEditorById.call(this,e)},e.prototype.getAttributeById=function(t){var e=this.getEntityAttrById(this.getRootEntity(),t);return e||null},e.prototype.getAttributeByIdSafe=function(t){var e=this.getAttributeById(t);return e||this.nullAttribute},e.prototype.checkAttrProperty=function(t,e){var n=this.getAttributeById(t);if(n){if(void 0===n[e])throw"No such property: "+e;return!!n[e]||!!n.lookupAttr&&(t=n.lookupAttr,(n=this.getAttributeById(t))&&n[e])}return!1},e.prototype.getEntityAttrById=function(e,n){return t.prototype.getEntityAttrById.call(this,e,n)},e.prototype._listByEntityWithFilter=function(t,e){var n,o=new Array,r=null;if(t.subEntities)for(var s=t.subEntities.length,l=0;l<s;l++){if(r=t.subEntities[l],!e||e(r,null))(n=i.i18n.getText("Entities",r.name))||(n=r.caption),(h=i.utils.assign(new a.a,{id:r.name,text:n,items:[],isEntity:!0})).items=this._listByEntityWithFilter(r,e),h.items.length>0&&o.push(h)}var u=null;if(t.attributes)for(var c=t.attributes.length,d=0;d<c;d++)if(u=t.attributes[d],!e||e(t,u)){(n=i.i18n.getText("Attributes",u.id))||(n=u.caption);var h=i.utils.assign(new a.a,{id:u.id,text:n,dataType:u.dataType});o.push(h)}return o},e.prototype._listByEntity=function(t,e,n){e=e||{};var o,r=[],s=[],l=null;if(t.subEntities)for(var u=t.subEntities.length,c=0;c<u;c++)if(l=t.subEntities[c],(!n||n(l,null))&&(!1!==e.addUIC&&!1!==l.useInConditions||!1!==e.addUIR&&!1!==l.useInResult||!1!==e.addUIS&&!1!==l.useInSorting)){o=i.i18n.getText("Entities",l.name)||l.caption;var d=i.utils.assign(new a.a,{id:l.name,text:o,items:[],isEntity:!0,description:l.description}),h=i.utils.assign({},e);h.includeRootData=!1,d.items=this._listByEntity(l,h,n),d.items.length>0&&r.push(d)}var p=null;if(t.attributes)for(var f=t.attributes.length,g=0;g<f;g++)p=t.attributes[g],n&&!n(t,p)||(!1!==e.addUIC&&!1!==p.useInConditions||!1!==e.addUIR&&!1!==p.useInResult||!1!==e.addUIS&&!1!==p.useInSorting)&&(o=i.i18n.getText("Attributes",p.id)||p.caption,s.push(i.utils.assign(new a.b(t),{id:p.id,text:o,dataType:p.dataType,lookupAttr:p.lookupAttr,description:p.description})));var y,m=function(t,e){return t.text.toLowerCase()==e.text.toLowerCase()?0:t.text.toLowerCase()>e.text.toLowerCase()?1:-1};return e.sortEntities&&(r.sort(m),s.sort(m)),y=e.attrPlacement&&0!=e.attrPlacement?s.concat(r):r.concat(s),2==e.attrPlacement&&y.sort(m),e.includeRootData?((o=i.i18n.getText("Entities",t.name))||(o=t.caption),{id:t.name,text:o,items:y}):y},e.prototype.clear=function(){t.prototype.clear.call(this),this.operators=[],this.aggrFunctions=[]},e.prototype.addOrUpdateOperator=function(t){var e=i.utils.findItemById(this.operators,t.id);return e||((e=new s.b).id=t.id,this.operators.push(e)),e.caption=t.caption,e.expr=t.expr||"",e.displayFormat=t.format,e.defaultOperand=new s.a,e.defaultOperand.kind=t.kind||u.a.Scalar,t.appliedTypes&&(e.appliedTypes=t.appliedTypes),t.paramCount>0&&(e.paramCount=t.paramCount),this.runThroughEntities((function(t,n){t.operators.indexOf(e.id)<0&&e.appliedTypes.indexOf(t.dataType)>=0&&t.operators.push(e.id)})),e},e.prototype.removeOperator=function(t,e){void 0===e&&(e=!1);var n=i.utils.findItemById(this.operators,t);n&&(e||i.utils.removeArrayItem(this.operators,n),this.runThroughEntities((function(t,e){i.utils.removeArrayItem(t.operators,n.id)})))},e.prototype.getOperatorIdsByDataType=function(t){switch(t){case i.DataType.String:case i.DataType.Memo:return"StartsWith,EndsWith,Contains,Equal,InList,NotStartsWith,NotEndsWith,NotContains,NotEqual,NotInList,IsNull,IsNotNull".split(",");case i.DataType.Guid:return"Equal,NotEqual".split(",");case i.DataType.Date:case i.DataType.DateTime:return"DateWithinToday,DateWithinThisWeek,DateWithinPrevWeek,DateWithinThisMonth,DateWithinPrevMonth,DateWithinThisYear,DateWithinPrevYear,DateBeforePrecise,DateAfterPrecise,DatePeriodPrecise,IsNull,IsNotNull".split(",");case i.DataType.Time:return"TimeBeforePrecise,TimeAfterPrecise,TimePeriodPrecise,IsNull,IsNotNull".split(",");case i.DataType.Byte:case i.DataType.Word:case i.DataType.Int32:case i.DataType.Int64:case i.DataType.Float:case i.DataType.Currency:case i.DataType.BCD:case i.DataType.Autoinc:case i.DataType.Unknown:return"Equal,Between,LessThan,LessOrEqual,GreaterThan,GreaterOrEqual,InList,NotEqual,NotBetween,NotInList,IsNull,IsNotNull".split(",");case i.DataType.Bool:return"IsTrue,NotTrue".split(",");default:for(var e=[],n=0,o=this.operators;n<o.length;n++){var r=o[n];r.appliedTypes.indexOf(t)>=0&&e.push(r.id)}return e}},e.prototype.buildQueryPath=function(t){var e=this.mainEntity||this.rootEntity,n=this.createTreeNodeFromEntity(e);return n.setParents(),n},e.prototype.createTreeNodeFromEntity=function(t){for(var e=new p.a(t),n=0,o=t.subEntities;n<o.length;n++){var i=o[n];e.addChild(this.createTreeNodeFromEntity(i))}return e},e.prototype.getEntitiesInQuery=function(t){if(t.model.id!==this.id)throw Error("Model mithmatch");for(var e=[],n=0,o=t.getColumns();n<o.length;n++){var i=o[n];i.enabled&&this.addEntityByExpression(e,i.expr)}var r=t.getRootCondition();return this.fillEntitiesByCondtionGroup(e,r),e},e.prototype.findAggrFunctionById=function(t){for(var e=0,n=this.aggrFunctions;e<n.length;e++){var o=n[e];if(o.id===t)return o}return null},e.prototype.fillEntitiesByCondtionGroup=function(t,e){for(var n=0,o=e.getConditions();n<o.length;n++){var i=o[n];if(i.isGroup())this.fillEntitiesByCondtionGroup(t,i);else for(var r=0,s=i.expressions;r<s.length;r++){var a=s[r];if(this.addEntityByExpression(t,a),a.args)for(var l=0,u=a.args;l<u.length;l++){var c=u[l];this.addEntityByExpression(t,c)}}}},e.prototype.addEntityByExpression=function(t,e){if(e.tag===h.a.EntityAttribute){var n=e.baseAttrId||e.value;if(n){var o=this.getAttributeById(n);o&&o.entity&&i.utils.indexOfArrayItem(t,o.entity)<0&&t.push(o.entity)}}},e.prototype.findLink=function(t,e){for(var n=0,o=this.links;n<o.length;n++){var i=o[n];if(i.entityFrom==t&&i.entityTo==e)return i}return null},e.prototype.getLinksByEntity=function(t){for(var e=[],n=0,o=this.links;n<o.length;n++){var i=o[n];i.entityFrom!=t&&i.entityTo!=t||e.push(i)}return e},e.prototype.getEntitiesTree=function(t,e){return this._listByEntity(this.getRootEntity(),t,e)},e.prototype.getEntitiesTreeWithFilter=function(t){return this._listByEntityWithFilter(this.getRootEntity(),t)},e.prototype.getFullEntityPathByAttr=function(t,e){return e=e||" ",this.getEntityPathByAttr(this.getRootEntity(),t,e,!0)},e.prototype.getEntityPathByAttr=function(e,n,o,i){return t.prototype.getEntityPathByAttr.call(this,e,n,o,i)},e.prototype.getAttributeText=function(e,n){return t.prototype.getAttributeText.call(this,e,n)},e.prototype.getFirstUICAttr=function(){return this.getFirstUICAttrInEntity(this.getRootEntity())},e.prototype.getFirstUICAttrInEntity=function(t){if(!1!==t.useInConditions){if(t.attributes)for(var e=t.attributes.length,n=0;n<e;n++)if(t.attributes[n].useInConditions)return t.attributes[n];if(t.subEntities){var o=t.subEntities.length;for(n=0;n<o;n++){var i=this.getFirstUICAttrInEntity(t.subEntities[n]);if(i)return i}}}return null},e.prototype.runThroughEntities=function(t,e){this.getRootEntity().scan(t,e)},e.prototype.getFirstAttributeByFilter=function(t){var e=null;return this.runThroughEntities((function(n,o){t(n)&&(o.stop=!0,e=n)}),null),e},e.prototype.findOperatorById=function(t){if(this.operators.length>0)for(var e=this.operators.length,n=0;n<e;n++)if(this.operators[n].id==t)return this.operators[n];return null},e.prototype.getOperatorById=function(t){var e=this.findOperatorById(t);return e||this.nullOperator},e.prototype.getDefaultOperatorIdForAttr=function(t){return t.defaultOperator?t.defaultOperator:t.operators.length>0?t.operators[0]:this.nullOperator.id},e.prototype.getAggrFunctionCaption=function(t){var e=i.i18n.getText("AggregateFunctions",t),n=e?e.caption:i.i18n.getText("Aggr"+t.replace(" ","")+"_Caption");if(n)return n;var o=i.utils.findItemById(this.aggrFunctions,t);return o&&o.caption?o.caption:t},e.prototype.getAggrFunctionFormat=function(t){var e=i.i18n.getText("AggregateFunctions",t),n=e?e.displayFormat:i.i18n.getText("Aggr"+t.replace(" ","")+"_Format");if(n)return n;var o=i.utils.findItemById(this.aggrFunctions,t);return o&&o.displayFormat?o.displayFormat:""},e.prototype.getDefaultOperatorForAttr=function(t){var e=this.getDefaultOperatorIdForAttr(t);return this.getOperatorById(e)},e.prototype.getOperand=function(t,e,n){var o=new s.a;e&&e.defaultOperand?(o.copyFrom(e.defaultOperand),o.defValue||(o.defValue=""),o.defText||(o.defText="")):(o.kind=u.a.Scalar,o.dataType=t.dataType,o.defValue="",o.defText="",o.editor=null);var r=o;return r.dataType===i.DataType.Unknown&&t&&(r.dataType=t.dataType),e&&n>=0&&e.operands&&e.operands[n-1]&&(r=i.utils.assign(r,e.operands[n-1])),r.editor||(o.editor?r.editor=o.editor:o.kind===u.a.Query?r.editor.tag=c.a.SubQuery:t&&t.defaultEditor?r.editor=t.defaultEditor:r.dataType===i.DataType.Date||r.dataType===i.DataType.DateTime||r.dataType===i.DataType.Time?r.editor.tag=c.a.DateTime:r.editor.tag=c.a.Edit),r},e.prototype.getAggrFunctions=function(){return this.aggrFunctions},e.prototype.isDateMacro=function(t,e){var n=t.match(/\${{?(.*?)}?}/);if(null!=n){var o=n[1];if(i.utils.indexOfArrayItem(this.dateMacros,o)>=0)return e&&e(o),!0}return!1},e.prototype.isTimeMacro=function(t,e){var n=t.match(/\${{?(.*?)}?}/);if(null!=n){var o=n[1];if(i.utils.indexOfArrayItem(this.timeMacros,o)>=0)return e&&e(o),!0}return!1},e.prototype.getDateMacroValue=function(t){var e=new Date;return this.isDateMacro(t,(function(t){switch(t){case"Today":break;case"Yesterday":e.setDate(e.getDate()-1);break;case"Tomorrow":e.setDate(e.getDate()+1);break;case"FirstDayOfMonth":e.setDate(1);break;case"LastDayOfMonth":e.setMonth(e.getMonth()+1,0);break;case"FirstDayOfPrevWeek":n=0==(n=e.getDay())?1:8-n,e.setDate(e.getDate()-n);break;case"FirstDayOfWeek":n=0==(n=e.getDay())?6:n-1,e.setDate(e.getDate()-n);break;case"FirstDayOfYear":e.setMonth(0,1);break;case"FirstDayOfNextWeek":var n;n=0==(n=e.getDay())?1:8-n,e.setDate(e.getDate()+n);break;case"FirstDayOfNextMonth":e.setMonth(e.getMonth()+1,1);break;case"FirstDayOfPrevMonth":e.setMonth(e.getMonth()-1,1);break;case"FirstDayOfPrevYear":e.setFullYear(e.getFullYear()-1,0,1);break;case"FirstDayOfNextYear":e.setFullYear(e.getFullYear()+1,0,1)}}))?e:null},e.prototype.getDateOrMacroValue=function(t){var e=this.getDateMacroValue(t);return e||t},e.prototype.getTimeMacroValue=function(t){var e=new Date;return this.isDateMacro(t,(function(t){switch(t){case"Now":break;case"HourStart":e.setMinutes(0,0,0);break;case"Midnight":e.setHours(0,0,0,0);break;case"Noon":e.setHours(12,0,0,0)}}))?e:null},e.prototype.getTimeOrMacroValue=function(t){var e=this.getTimeMacroValue(t);return e||t},e.prototype.getAllDateMacros=function(){return this.dateMacros},e.prototype.getAllTimeMacros=function(){return this.timeMacros},e}(i.MetaData)},function(t,e,n){"use strict";n.d(e,"b",(function(){return s})),n.d(e,"a",(function(){return o})),n.d(e,"c",(function(){return d}));var o,i=n(0),r=n(22),s=/{0:(.*?)}/g;!function(t){t[t.STRING=1]="STRING",t[t.NUMBER=2]="NUMBER",t[t.DATETIME=3]="DATETIME",t[t.BOOL=4]="BOOL"}(o||(o={}));var a=function(t,e,n,o){var i=t?t.toString().replace(/\n/g,"↵ "):"";n.innerText=i,n.title=i,e.align==r.b.NONE&&n.classList.add("keg-cell-value-align-left")},l=function(t,e,n,o){var a=(t||"").toString();"number"==typeof t&&(a=e.dataColumn&&e.dataColumn.displayFormat&&s.test(e.dataColumn.displayFormat)?e.dataColumn.displayFormat.replace(s,(function(e,n){return i.i18n.numberToStr(t,n)})):t.toLocaleString()),n.innerText=a,n.title=a,e.align==r.b.NONE&&n.classList.add("keg-cell-value-align-right")},u=function(t,e,n,o){var a="[object Date]"===Object.prototype.toString.call(t),l=(t||"").toString();if(a)if(e.dataColumn&&e.dataColumn.displayFormat&&s.test(e.dataColumn.displayFormat))l=e.dataColumn.displayFormat.replace(s,(function(n,o){return i.i18n.dateTimeToStr(t,e.type,o)}));else{var u=i.i18n.getCurrentLocale(),c={hour:"numeric",minute:"numeric",second:"numeric"};switch(e.type){case i.DataType.Date:l=t.toLocaleDateString(u);break;case i.DataType.Time:l=t.toLocaleTimeString(u,c);break;case i.DataType.DateTime:l=t.toLocaleDateString(u)+" "+t.toLocaleTimeString(u,c)}}n.innerText=l,n.title=l,e.align==r.b.NONE&&n.classList.add("keg-cell-value-align-right")},c=function(t,e,n,o){if(e.dataColumn&&e.dataColumn.displayFormat&&s.test(e.dataColumn.displayFormat)){var r=e.dataColumn.displayFormat.replace(s,(function(e,n){return i.i18n.booleanToStr(t,n)}));return a(r,e,n)}n.classList.add("keg-cell-value-bool"),n.classList.add("keg-"+(t?"cell-value-true":"cell-value-false"))},d=function(){function t(t){this.renderers={},this.defaultRenderers={},this.registerRenderer("StringDefault",a),this.setDefaultRenderer(o.STRING,a),this.registerRenderer("NumberDefault",l),this.setDefaultRenderer(o.NUMBER,l),this.registerRenderer("DateTimeDefault",u),this.setDefaultRenderer(o.DATETIME,u),this.registerRenderer("BoolDefault",c),this.setDefaultRenderer(o.BOOL,c)}return t.prototype.getDefaultRenderer=function(t){var e=this.getCellType(t);return this.defaultRenderers[o[e]]},t.prototype.getDefaultRendererByType=function(t){return this.defaultRenderers[o[t]]},t.prototype.setDefaultRenderer=function(t,e){e&&(this.defaultRenderers[o[t]]=e)},t.prototype.getRenderer=function(t){return this.renderers[t]},t.prototype.registerRenderer=function(t,e){this.renderers[t]=e},t.prototype.getCellType=function(t){switch(t){case i.DataType.Autoinc:case i.DataType.Byte:case i.DataType.Word:case i.DataType.Currency:case i.DataType.Float:case i.DataType.Int32:case i.DataType.Int64:return o.NUMBER;case i.DataType.Date:case i.DataType.DateTime:case i.DataType.Time:return o.DATETIME;case i.DataType.Bool:return o.BOOL;default:return o.STRING}},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var o,i=n(0),r=n(2),s=n(1),a=n(9),l=n(4),u=n(3),c=n(75),d=n(41),h=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),p=function(t){function e(e,n){var o=t.call(this,e)||this;return o.options={isSubQuery:!1,activeColumn:null,showAddRow:!0,showHeader:!0,showColumnTitles:!0,allowAggrColumns:!0,allowDuplicates:!0,allowCustomExpressions:!1,allowSorting:!0,attrElementFormat:"{entity} {attr}",titleElementFormat:null,alwaysShowButtons:!1,accentActiveColumn:!0,allowDragDrop:!0,menuOptions:{showSearchBoxAfter:30,searchBoxAutoFocus:!0,activateOnMouseOver:!0,adjustHeight:!0,itemRenderedCallback:null},attrPlacement:0,sortEntities:!1,columnRenderedCallback:null,customExpressionText:0},o.landingSlot=Object(s.domel)("div").addClass(l.b+"-highlight").toDOM(),o.landingIndex=-1,o.sortMenuList=[{id:"None",text:i.i18n.getText("CmdNotSorted")},{id:"Ascending",text:i.i18n.getText("CmdAscending")},{id:"Descending",text:i.i18n.getText("CmdDescending")},{id:"---",text:"---"}],o.moveMenuList=[{id:"MoveTop",text:i.i18n.getText("CmdMoveToFirst")},{id:"MoveUp",text:i.i18n.getText("CmdMoveToPrev")},{id:"MoveDown",text:i.i18n.getText("CmdMoveToNext")},{id:"MoveBottom",text:i.i18n.getText("CmdMoveToLast")}],Object(s.domel)(o.slot).addClass(o.cssPrefix+"-panel").addClass(u.a.getMobileCssClass()),o.group=r.WidgetGroup.Query,o.customQuery=n,o}return h(e,t),Object.defineProperty(e.prototype,"cssPrefix",{get:function(){return"eqjs-cb"},enumerable:!0,configurable:!0}),e.prototype.getWidgetType=function(){return"columnsBar"},e.prototype.init=function(e,n){var o=this;t.prototype.init.call(this,e,n),this.setOptions(n),this.detachQueryObserver(),this.attachQueryObserver(),s.eqDragManager.removeDropContainer(this.slot),this.options.allowDragDrop&&s.eqDragManager.registerDropContainer({element:this.slot,scopes:["entityAttrSort"],onDragEnter:function(t,e){o.showLandingSlot(e.pageX,e.pageY)},onDragOver:function(t,e){o.showLandingSlot(e.pageX,e.pageY)},onDragLeave:function(t,e){e.dropEffect=s.DropEffect.Forbid,o.hideLandingSlot()},onDrop:function(t,e){var n=o.getQuery().getColumns().indexOf(e.data.column);o.moveColumnCore(n,o.landingIndex)}})},e.prototype.attachQueryObserver=function(){var t=this,e=this.getQuery();this.queryEventCallbackId=e.addChangedCallback((function(n){var o=n.data;if(o&&(o.part==r.QueryChangePart.Columns||o.part==r.QueryChangePart.Aggregation||o.part==r.QueryChangePart.All)){var i=document.activeElement,s=t.slot.contains(i)||i==document.body;switch(o.action){case r.QueryChangeAction.Modify:var a=o.changee,l=function(e){var n=t.columnsBlock.querySelector("div[data-id='"+e.id+"']");if(n){var o=t.renderColumn(e,n);if(s){var i=o.querySelector("a");i&&i.focus()}}};Array.isArray(a)?a.forEach((function(t){return l(t)})):l(a);break;case r.QueryChangeAction.Add:a=o.changee;var u=function(n){var o=e.getColumns().indexOf(n);t.addColumnElement(n,o)};Array.isArray(a)?a.forEach((function(t){return u(t)})):u(a);break;case r.QueryChangeAction.Delete:a=o.changee;var c=function(e){var n=t.columnsBlock.querySelector("div[data-id='"+e.id+"']");if(n){var o=n.nextSibling,i=n.previousSibling;if(t.columnsBlock.removeChild(n),s){var r=(o||i||t.addRowButton).querySelector("a");r&&r.focus()}}};Array.isArray(a)?a.forEach((function(t){return c(t)})):c(a);break;default:t.refresh()}}}))},e.prototype.getQuery=function(){return this.customQuery?this.customQuery:this.getContext().getQuery()},e.prototype.destroyCore=function(){s.eqDragManager.removeDropContainer(this.slot),this.detachQueryObserver(),this.slot.innerHTML=""},e.prototype.detachQueryObserver=function(){this.queryEventCallbackId&&this.getQuery().removeChangedCallback(this.queryEventCallbackId)},e.prototype.setOptions=function(t){this.options=i.utils.assignDeep(this.options,t)},e.prototype.showLandingSlot=function(t,e){for(var n=this.columnsBlock.querySelectorAll("[class*="+this.cssPrefix+"-row]"),o=[],i=0;i<n.length;i++)"none"!==n[i].style.display&&o.push(n[i]);if(0!==o.length){var r=Object(s.getElementAbsolutePos)(this.landingSlot);if(!(t>=r.x&&t<=r.x+this.landingSlot.offsetWidth&&e>=r.y&&e<=r.y+this.landingSlot.offsetHeight)){var a=this.landingIndex;for(i=0;i<o.length;i++){var l=o[i],u=Object(s.getElementAbsolutePos)(l),c=l.offsetWidth,d=l.offsetHeight,h=.2*c;if(t>=u.x+h&&t<=u.x+c-h&&e>=u.y+2&&e<=u.y+d-2){a=t>r.x?i+1:i;break}}(a!=this.landingIndex||this.landingSlot.parentElement)&&(this.landingIndex=a,this.landingIndex<=0&&this.columnsBlock.insertBefore(this.landingSlot,o[0]),this.landingIndex<o.length?this.columnsBlock.insertBefore(this.landingSlot,o[this.landingIndex]):this.columnsBlock.appendChild(this.landingSlot))}}else this.landingIndex=0},e.prototype.hideLandingSlot=function(){this.landingIndex=-1,this.landingSlot.parentElement&&this.landingSlot.parentElement.removeChild(this.landingSlot)},e.prototype.onProcessStartCore=function(){},e.prototype.onProcessEndCore=function(){},e.prototype.refreshCore=function(){this.clear(),this.render()},e.prototype.clear=function(){this.slot.innerHTML=""},e.prototype.renderAddRowButton=function(){var t=this;Object(s.domel)(this.addRowButton).addClass(l.b+"-addrow",this.cssPrefix+"-addrow",l.b+"-addrow-empty").addClass(u.a.getMobileCssClass()).title(i.i18n.getText("CmdClickToAddColumn")).addChild("a",(function(e){return e.attr("href","javascript:void(0)").on("click",(function(e){e.preventDefault(),t.showEntitiesMenu({anchor:e.target,selectedIds:null,itemSelectedCallback:function(e,n){var o=e.id;return t.addNewColumn(o),!1}})}))})),u.a.isMobileMode()&&Object(s.domel)(this.columnsBlock).addChildElement(this.addRowButton)},e.prototype.render=function(){var t=this;this.createEntitiesMenu(),this.options.allowSorting&&this.createSortMenu(),this.createMoveMenu(),this.columnsBlock=Object(s.domel)("div").addClass(this.cssPrefix+"-columns").addClass(u.a.getMobileCssClass()).toDOM(),this.options.showAddRow&&(this.addRowButton=Object(s.domel)("div").toDOM(),u.a.isMobileMode()?Object(s.domel)(this.columnsBlock).addChildElement(this.addRowButton):Object(s.domel)(this.slot).addChildElement(this.addRowButton),this.renderAddRowButton()),Object(s.domel)(this.slot).addChildElement(this.columnsBlock).addChildElement(this.renderColumnButtonsBlockMobile()),this.getQuery().getColumns().forEach((function(e,n){var o=t.renderColumn(e);t.columnsBlock.appendChild(o)}))},e.prototype.renderColumnButtonsBlockMobile=function(){var t=this;return this.columnButtonsBlockMobileArrow=Object(s.domel)("i").toDOM(),this.columnButtonsBlockMobile=Object(s.domel)("div").addClass(this.cssPrefix+"-column-buttonsBlock").addClass(u.a.getMobileCssClass()).addChildElement(this.columnButtonsBlockMobileArrow).hide().toDOM(),this.buttonsBlockSortingButton=Object(s.domel)("div",this.columnButtonsBlockMobile).addClass(this.cssPrefix+"-column-button",this.cssPrefix+"-column-sortbutton-none").toDOM(),Object(s.domel)(this.buttonsBlockSortingButton).on("touchstart click",(function(e){return e.stopPropagation(),t.currentColumnRenderer.buttonSortingClickHandler.call(t.currentColumnRenderer,e,t.buttonsBlockSortingButton),t.toggleColumnPicked(null),t.hideColumnButtonsMobile(),!1})),this.buttonsBlockTypeButton=Object(s.domel)("div",this.columnButtonsBlockMobile).addClass(this.cssPrefix+"-column-button",this.cssPrefix+"-column-button-type").on("touchstart click",(function(e){return e.stopPropagation(),t.currentColumnRenderer.buttonTypeClickHandler.call(t.currentColumnRenderer,e),t.toggleColumnPicked(null),t.hideColumnButtonsMobile(),!1})).toDOM(),this.buttonsBlockFormatButton=Object(s.domel)("div",this.columnButtonsBlockMobile).addClass(this.cssPrefix+"-column-button",this.cssPrefix+"-column-button-format").on("touchstart click",(function(e){return e.stopPropagation(),t.currentColumnRenderer.buttonFormatClickHandler.call(t.currentColumnRenderer,e),t.toggleColumnPicked(null),t.hideColumnButtonsMobile(),!1})).toDOM(),this.buttonsBlockDeleteButton=Object(s.domel)("div",this.columnButtonsBlockMobile).addClass(this.cssPrefix+"-column-button",this.cssPrefix+"-column-button-delete").on("touchstart click",(function(e){return e.stopPropagation(),t.currentColumnRenderer.buttonDeleteClickHandler.call(t.currentColumnRenderer,e),t.toggleColumnPicked(null),t.hideColumnButtonsMobile(),!1})).toDOM(),Object(s.domel)("div",this.columnButtonsBlockMobile).addClass(this.cssPrefix+"-column-button-close-block").on("touchstart click",(function(){t.toggleColumnPicked(null),t.hideColumnButtonsMobile()})),this.columnButtonsBlockMobile},e.prototype.showColumnButtonsMobile=function(t,e,n){this.currentActiveColumn=t,this.currentColumnRenderer=e;var o=n.getBoundingClientRect(),i=n.offsetTop,r=n.offsetLeft;Object(s.domel)(this.columnButtonsBlockMobileArrow).setStyle("left",(r+o.width/2).toString()+"px"),o.top>100?Object(s.domel)(this.columnButtonsBlockMobile).removeClass("show-below").setStyle("top",(i-o.height).toString()+"px"):Object(s.domel)(this.columnButtonsBlockMobile).addClass("show-below").setStyle("top",(i+o.height).toString()+"px"),t.enabled&&!t.isReadOnly()?(Object(s.domel)(this.buttonsBlockSortingButton).show(),Object(s.domel)(this.buttonsBlockTypeButton).show(),e.formatButtonIsShown()?Object(s.domel)(this.buttonsBlockFormatButton).show():Object(s.domel)(this.buttonsBlockFormatButton).hide()):(Object(s.domel)(this.buttonsBlockSortingButton).hide(),Object(s.domel)(this.buttonsBlockTypeButton).hide()),t.isReadOnly()?Object(s.domel)(this.columnButtonsBlockMobile).hide():Object(s.domel)(this.columnButtonsBlockMobile).show()},e.prototype.hideColumnButtonsMobile=function(){Object(s.domel)(this.columnButtonsBlockMobile).hide()},e.prototype.renderColumn=function(t,e){var n=this,o=this.getColumnRenderer(t,e);if(o){var i=o.render();return o.onShowButtonsMobile=function(){n.showColumnButtonsMobile(t,o,i)},o.onHideButtonsMobile=function(){n.hideColumnButtonsMobile()},i}return null},e.prototype.getColumnRenderer=function(t,e){switch(t.expr.tag){case r.ExprTag.AggregateFunction:return new c.a(this,t,e);case r.ExprTag.CustomSql:case r.ExprTag.EntityAttribute:case r.ExprTag.ParentEntityAttribute:return new d.a(this,t,e)}return null},e.prototype.addNewColumn=function(t,e){var n=this,o=this.getContext().getModel(),i=this.getQuery(),s=function(t){var e=o.getAttributeById(t);if(!e)return null;if(!e.useInResult){if(!e.lookupAttr)return null;if(t=e.lookupAttr,!(e=o.getAttributeById(t))||!e.useInResult)return null}var s=i.createColumn();return s.caption=n.getDefaultColumnCaption(e),s.sorting=r.SortDirection.None,s.sortIndex=-1,s.expr.tag=r.ExprTag.EntityAttribute,s.expr.kind=r.DataKind.Attribute,s.expr.dataType=e.dataType,s.expr.setValue(t,!0),s.params.concat(e.params),s};if(this.getQuery()){var a,l;if(Array.isArray(t)){a=[];for(var u=0;u<t.length;u++)(l=s(t[u]))&&a.push(l)}else a=s(t);return this.addColumn(a,e),a}},e.prototype.toggleColumnPicked=function(t){var e,n;t&&(e=this.columnsBlock.querySelector("div[data-id="+t.id+"]"))&&(n=e.classList.contains("active"));for(var o=this.columnsBlock.querySelectorAll("."+this.cssPrefix+"-row"),i=0;i<o.length;i++){var r=o[i];Object(s.domel)(r).removeClass("active").data("show-buttons",null)}e&&!n&&Object(s.domel)(e).addClass("active").data("show-buttons","")},e.prototype.addColumn=function(t,e){var n=this.getQuery();n&&(!(t=Array.isArray(t)?this.checkColumnsArray(t):this.checkColumn(t))||Array.isArray(t)&&0==t.length||(n.addColumnObj(t,e,self),n.fireChangedEvent({part:r.QueryChangePart.Columns,action:r.QueryChangeAction.Add,changee:t})))},e.prototype.addColumnElement=function(t,e){var n=this.columnsBlock.querySelectorAll("[class*="+this.cssPrefix+"-row]"),o=this.renderColumn(t);n.length>0&&e<n.length-1?this.columnsBlock.insertBefore(o,n[e]):this.columnsBlock.appendChild(o),this.options.columnRenderedCallback&&this.options.columnRenderedCallback(o)},e.prototype.checkColumnsArray=function(t){for(var e=t.length,n=[],o=0;o<e;o++)this.checkColumn(t[o])&&n.push(t[o]);return n},e.prototype.checkColumn=function(t){if(!this.options.allowDuplicates)for(var e=this.getQuery().getColumns(),n=JSON.stringify(t.expr),o=0;o<e.length;o++){if(JSON.stringify(e[o].expr)===n)return null}return t},e.prototype.getDefaultColumnCaption=function(t){var e=this.options.titleElementFormat||this.options.attrElementFormat;return this.getContext().getModel().getAttributeText(t,e)},e.prototype.getColumnsBlock=function(){return this.columnsBlock},e.prototype.showEntitiesMenu=function(t){this.entitiesMenu&&this.entitiesMenu.showMenu(t)},e.prototype.createEntitiesMenu=function(){var t=this.getContext().getModel();if(!t||t.isEmpty())return null;var e=this.slot.id;e&&(e+="-EntitiesMenu");var n={items:t.getEntitiesTree({addUIC:!1,addUIR:!0,addUIS:!1,attrPlacement:this.options.attrPlacement,sortEntities:this.options.sortEntities}),adjustHeight:this.options.adjustEntitiesMenuHeight,id:e,domWriteItemsId:this.options.domWriteItemsId};i.utils.assign(n,this.options.menuOptions),this.entitiesMenu=new a.a(n)},e.prototype.createSortMenu=function(){var t=this.getContext().getModel();if(!t||t.isEmpty())return null;var e=this.slot.id;e&&(e+="-SortMenu");var n={items:this.sortMenuList.concat(this.moveMenuList),id:e,domWriteItemsId:this.options.domWriteItemsId};i.utils.assign(n,this.options.menuOptions),n.searchBoxAlwaysShown=!1,this.sortMenu=new a.a(n)},e.prototype.createMoveMenu=function(){var t=this.getContext().getModel();if(!t||t.isEmpty())return null;var e=this.slot.id;e&&(e+="-MoveMenu");var n={items:this.moveMenuList,id:e,domWriteItemsId:this.options.domWriteItemsId};i.utils.assign(n,this.options.menuOptions),this.moveMenu=new a.a(n),n.searchBoxAlwaysShown=!1},e.prototype.moveColumn=function(t,e){var n=this.getQuery().getColumns(),o=n.indexOf(t);if(o>=0)switch(e){case"MoveTop":if(0==o)return;this.moveColumnCore(o,0);break;case"MoveUp":if(0==o)return;this.moveColumnCore(o,o-1);break;case"MoveDown":if(o==n.length-1)return;this.moveColumnCore(o,o+1);break;case"MoveBottom":if(o==n.length-1)return;this.moveColumnCore(o,n.length-1)}},e.prototype.moveColumnCore=function(t,e){var n=this.getQuery();if(n){var o=this.columnsBlock.querySelectorAll("[class*="+this.cssPrefix+"-row]"),i=o[t];e<=0?this.columnsBlock.insertBefore(i,this.columnsBlock[0]):e<o.length?this.columnsBlock.insertBefore(i,o[e]):this.columnsBlock.appendChild(i),n.moveColumn(t,e),n.fireColumnsChangedEvent(r.QueryChangeAction.All)}},e.prototype.areCustomExpressionsAllowed=function(){return this.getQuery().isEx()&&this.options.allowCustomExpressions},e.globalCounter=0,e}(r.Widget)},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var o,i=n(2),r=n(1),s=n(76),a=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.getClassesToAdd=function(){return t.prototype.getClassesToAdd.call(this)+" "+this.cssPrefix+"-row "+this.cssPrefix+"-row-column-entattr"},e.prototype.baseExpressionItemSelectedCallback=function(t,e){var n=t.id;this.column.expr.setValue(n,!0),this.column.caption="",this.refresh(),this.fireColumnChanged()},e.prototype.getUIS=function(){var t=this.column.expr.args[0];return!t||this.bar.getContext().getModel().checkAttrProperty(t.value,"useInSorting")},e.prototype.changeTypeToCustomSql=function(){this.column.getQuery().changeColumnType(this.column,i.ExprTag.CustomSql),this.fireColumnChanged()},e.prototype.changeTypeToAggr=function(t){this.column.getQuery().changeColumnType(this.column,i.ExprTag.AggregateFunction,{funcId:t}),this.fireColumnChanged()},e.prototype.changeColumnTypeHandler=function(t){var e=this;this.functionMenu.showMenu({anchor:t.target,selectedIds:null,itemSelectedCallback:function(t,n){return"CUSTOMSQL"==t.id?e.changeTypeToCustomSql():e.changeTypeToAggr(t.id),!1},menuClosedCallback:function(){e.keepShowingButtons=!1,e.isMouseOverBlock||e.element.dispatchEvent(Object(r.createBrowserEvent)("mouseleave"))}})},e}(s.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var o=n(1),i=n(3),r=function(){function t(t){this.element=t||Object(o.domel)("div").toDOM()}return t.prototype.refresh=function(){this.render()},t.prototype.render=function(t){var e=this;return void 0===t&&(t=!1),this.labelElement=this.renderLabelElement(),Object(o.domel)(this.element).html("").addClass(this.getClassesToAdd()).addClass(i.a.getMobileCssClass()).addChildElement(this.labelElement),this.isEditable()&&(this.renderEditor(),t&&setTimeout((function(){return e.showEditor()}),50)),this.element},t.prototype.isEditable=function(){return!0},t.prototype.renderLabelElement=function(){var t=this,e=this.getLabelText();return this.isEditable()?Object(o.domel)("a").attr("href","javascript:void(0)").title(e).text(e).on("click",(function(e){return e.preventDefault(),t.showEditor(),!1})).toDOM():Object(o.domel)("span").title(e).text(e).toDOM()},t.prototype.getClassesToAdd=function(){return""},t.prototype.getLabelText=function(){return this.getEmptyText()},t.prototype.getEmptyText=function(){return"<empty>"},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var o,i=n(42),r=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t){function e(e){return t.call(this,e)||this}return r(e,t),e.prototype.showEditor=function(){var t=this,e=this.getMenu();e&&e.showMenu({anchor:this.labelElement,itemSelectedCallback:function(e){return t.itemSelected(e.id),!1}})},e.prototype.closeEditor=function(){var t=this.getMenu();t&&t.hideMenu()},e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var o,i=n(2),r=n(0),s=n(1),a=n(86),l=n(9),u=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c=function(){return c=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},c.apply(this,arguments)},d=function(t){function e(e){var n=t.call(this,e)||this;return n.hasCustomTotalsSettings=!1,n.options={autoRefresh:!0},n.group=i.WidgetGroup.Result,n}return u(e,t),e.prototype.getWidgetType=function(){return"easyGrid"},e.prototype.init=function(e,n){var o=this;t.prototype.init.call(this,e,n);var i=c(c({},n),{slot:this.slot,dataTable:e.resultTable});this.options=r.utils.assign(this.options,n),i.onPlusButtonClick=function(t){return o.addColumnClickHandler(t)},i.onColumnMoved=function(t){return o.columnMovedHandler(t)},i.aggregates?this.hasCustomTotalsSettings=!0:i.aggregates={settings:e.getQuery().getAggregationSettings(),calculator:null},i.aggregates.calculator=this.context.getServices().getAggregatesCalculator(),this.destroy(),this.grid=new s.EasyGrid(i),this.options.autoRefresh&&this.attachQueryObserver()},e.prototype.refreshCore=function(){this.clear(),this.updateTotalsSettings(),this.render()},e.prototype.render=function(){this.createEntitiesMenu(),this.grid.refresh()},e.prototype.attachQueryObserver=function(){},e.prototype.destroyCore=function(){this.detachQueryObserver(),this.grid&&this.grid.destroy(),this.slot.innerHTML=""},e.prototype.detachQueryObserver=function(){this.queryEventCallbackId&&this.getContext().getQuery().removeChangedCallback(this.queryEventCallbackId)},e.prototype.updateTotalsSettings=function(){var t=this.getContext();if(!this.hasCustomTotalsSettings){var e=t.getQuery().getAggregationSettings();this.grid.options.aggregates.settings=e}},e.prototype.createEntitiesMenu=function(){var t=this.getContext().getModel();if(t&&!t.isEmpty()){var e=this.slot.id;e&&(e+="-EntitiesMenu");var n={items:t.getEntitiesTree({addUIC:!1,addUIR:!0,addUIS:!1}),id:e};r.utils.assign(n,this.options.menuOptions),this.entitiesMenu=new l.a(n)}},e.prototype.getModel=function(){return this.context.getModel()},e.prototype.getQuery=function(){return this.context.getQuery()},e.prototype.clear=function(){this.grid&&this.grid.clear()},e.prototype.addColumnClickHandler=function(t){var e=this;this.entitiesMenu.showMenu({anchor:t.sourceEvent.target,selectedIds:null,itemSelectedCallback:function(t,n){var o=t.id;return e.addNewColumn(o),!1}})},e.prototype.columnMovedHandler=function(t){var e=this.getQuery(),n=r.utils.findItemIndexById(e.getColumns(),t.columnId);n>=0&&(e.moveColumn(n,t.newIndex),e.fireChangedEvent({part:i.QueryChangePart.Columns,action:i.QueryChangeAction.All,source:this}))},e.prototype.addNewColumn=function(t){var e=this,n=this.getContext().getModel(),o=this.getContext().getQuery();if(this.getContext().getQuery())return this.addColumn(function(t){var r=n.getAttributeById(t);if(!r)return null;if(!r.useInSorting){if(!r.lookupAttr)return null;if(t=r.lookupAttr,!(r=n.getAttributeById(t))||!r.useInSorting)return null}var s=o.createColumn();return s.caption=e.getDefaultColumnCaption(r),s.sorting=i.SortDirection.None,s.sortIndex=-1,s.expr.tag=i.ExprTag.EntityAttribute,s.expr.setValue(t,!0),s.params.concat(r.params),s}(t))},e.prototype.getDefaultColumnCaption=function(t){var e=this.options.titleElementFormat||this.options.attrElementFormat;return this.getContext().getModel().getAttributeText(t,e)},e.prototype.addColumn=function(t){var e=this.getContext().getQuery();if(e&&(t=this.checkColumn(t)))return t=e.addColumn({caption:t.caption,attributeId:t.expr.value,sorting:t.sorting,sortIndex:t.sortIndex}),e.fireChangedEvent({part:i.QueryChangePart.Columns,action:i.QueryChangeAction.Add,changee:t,source:this}),t},e.prototype.checkColumn=function(t){for(var e=this.getContext().getQuery().getColumns(),n=JSON.stringify(t.expr.saveToData()),o=0;o<e.length;o++){if(JSON.stringify(e[o].expr.saveToData())===n)return null}return t},e}(a.a)},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return r}));var o=n(1),i=n(2),r=function(){function e(t){this.context=t,this.promise=null}return e.prototype.show=function(e){var n=this;if(void 0===e&&(e=null),!this.promise){var r=this.context.getExportFormats();if(0==r.length)throw Error("No exporter has been registered.");e=e||r[0],this.promise=new t((function(t,r){var s=n.context.getServices().getDialogService(),a=Object(o.domel)("div").addClass("kdlg-form-section").addChild("div",(function(t){return t.addClass("kfrm-form").addChild("div",(function(t){return t.addClass("kfrm-fields col-a-1 label-align-right").addChild("label",(function(t){return t.addClass("kdlg-form-label","kflex-20").attr("for","export_format").addText(i.i18n.getText("ExportDlgFmtLabel"))})).addChild("div",(function(t){return t.addClass("kfrm-select").addChild("select",(function(t){t.attr("name","export_format").id("exportFormat");for(var o=0,r=n.context.getExportFormats();o<r.length;o++){var s=r[o];t.addOption({value:s,title:i.i18n.getText(s)||s,selected:e==s})}}))}))}))})).toDOM();s.open({title:i.i18n.getText("ExportDlgTitle"),body:a,onSubmit:function(){var e=a.querySelector("#exportFormat").value;return n.context.exportResult({format:e,success:t,error:r}),!0}})}))}return this.promise.finally((function(){return n.promise=null}))},e}()}).call(this,n(56))},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var o,i=n(1),r=n(47),s=n(5),a=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(e){var n=t.call(this,e)||this;return n.colors=["#4dc9f6","#f67019","#f53794","#537bc4","#acc236","#166a8f","#00a950","#58595b","#8549ba"],n.chartLabels=[],n.chartColumns=[],n.hasChartTypes=[s.a.Column,s.a.Bar,s.a.Area,s.a.Line,s.a.SteppedLine,s.a.Doughnut,s.a.Polar,s.a.Radar,s.a.Pie],n.options.legend={show:!1,position:"bottom"},n}return a(e,t),e.prototype.getWidgetType=function(){return"chartChartJs"},e.hasChartJs=function(){return"undefined"!=typeof Chart},e.prototype.canDraw=function(){return e.hasChartJs()},e.prototype.initChart=function(){e.hasChartJs()&&this.labelColumn>=0&&this.dataColumns&&this.dataColumns.length>0&&this.updateChartColumns()},e.prototype.drawCore=function(){if(e.hasChartJs()&&this.dataTable&&this.dataTable.getCachedCount()>0){var t=this.generateConfig(),n=this.getChartCanvas(this.chartDiv).getContext("2d");new Chart(n,t)}},e.prototype.updateChartColumns=function(){if(this.dataTable){this.chartLabels=[],this.chartColumns=[];for(var t=this.dataTable.getCachedRows(),e=0;e<t.length;e++)this.chartLabels.push(t[e].getValue(this.labelColumn)),this.chartColumns.push(t[e].getValue(this.dataColumns[0]))}},e.prototype.getChartCanvas=function(t){var e=t.getElementsByTagName("canvas");return e&&e.length>0?e[0]:Object(i.addElement)(t,"canvas")},e.prototype.generateConfig=function(){var t,e=[],n=this.dataTable.columns.get(this.dataColumns[0]).label,o=!0;if(this.chartType==s.a.Pie||this.chartType==s.a.Doughnut||this.chartType==s.a.Polar||this.chartType==s.a.Bar||this.chartType==s.a.Column)for(var i=0;i<this.chartLabels.length;i++)e.push(this.colors[i%this.colors.length]);else e=[this.colors[3]];this.chartType!=s.a.Line&&this.chartType!=s.a.SteppedLine||(o=!1,t=this.colors[3]),this.options.legend=this.options.legend||{};var r={data:this.chartColumns,backgroundColor:e,borderColor:t,label:n,fill:o};this.chartType==s.a.SteppedLine&&(r.stepped=this.chartType===s.a.SteppedLine,r.steppedLine=this.chartType===s.a.SteppedLine);var a=this.options.legend.show&&(this.chartType==s.a.Pie||this.chartType==s.a.Radar||this.chartType==s.a.Polar||this.chartType==s.a.Doughnut);return{type:this.getChartType(),data:{datasets:[r],labels:this.chartLabels},options:{legend:{display:a,position:this.options.legend.position||"bottom"},title:{display:!0,text:n}}}},e.prototype.getChartType=function(){switch(this.chartType){case s.a.Column:return"bar";case s.a.Bar:return"horizontalBar";case s.a.Area:case s.a.SteppedLine:case s.a.Line:return"line";case s.a.Doughnut:return"doughnut";case s.a.Polar:return"polarArea";case s.a.Radar:return"radar";case s.a.Pie:default:return"pie"}},e}(r.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var o,i=n(2),r=n(0),s=n(1),a=n(5),l=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=function(t){function e(e){var n=t.call(this,e)||this;return n.chartType=a.a.Pie,n.supportedChartTypes=[],n.dataTable=null,n.potentialLabelColumns=[],n.potentialDataColumns=[],n.labelColumn=-1,n.dataColumns=[],n.options={chartType:a.a.Pie,showOnPaging:!1,hideSettings:!1,legend:{show:!1,position:"right"}},n.element=e,n.group=i.WidgetGroup.Result,n}return l(e,t),Object.defineProperty(e.prototype,"cssPrefix",{get:function(){return"eqjs-chart"},enumerable:!0,configurable:!0}),e.prototype.init=function(e,n){t.prototype.init.call(this,e,n),this.dataTable=e.resultTable,this.setOptions(n)},e.prototype.hasData=function(){var t=null!=this.dataTable;return t&&(t=this.dataTable.getCachedCount()>0),t},e.prototype.hasColumnsForChart=function(){return this.potentialLabelColumns.length>0&&this.potentialDataColumns.length>0},e.prototype.refreshCore=function(){this.prepareChartData(),this.render()},e.prototype.setOptions=function(t){if(r.utils.assignDeep(this.options,t),this.supportedChartTypes=this.getSupportedChartTypes(),0==this.supportedChartTypes.length)throw Error("Chart widget should support at least one chart type");t.chartType&&this.supportedChartTypes.indexOf(t.chartType)>=0?this.chartType=t.chartType:this.chartType=this.supportedChartTypes[0]},e.prototype.getOptions=function(){return this.options},e.prototype.getChartTypeName=function(t){switch(t){case a.a.Area:return r.i18n.getText("ChartType","Area");case a.a.Bar:return r.i18n.getText("ChartType","Bar");case a.a.Column:return r.i18n.getText("ChartType","Column");case a.a.Combo:return r.i18n.getText("ChartType","Combo");case a.a.Doughnut:return r.i18n.getText("ChartType","Doughnut");case a.a.Polar:return r.i18n.getText("ChartType","Polar");case a.a.Radar:return r.i18n.getText("ChartType","Radar");case a.a.Histogram:return r.i18n.getText("ChartType","Histogram");case a.a.Line:return r.i18n.getText("ChartType","Line");case a.a.SteppedLine:return r.i18n.getText("ChartType","SteppedLine");default:return r.i18n.getText("ChartType","Pie")}},e.prototype.updateSettings=function(t,e){void 0===e&&(e=!0),void 0!==t.showLegend&&(this.options.legend=this.options.legend||{},this.options.legend.show=t.showLegend),this.chartType=t.type,this.labelColumn=t.labelColumn,this.dataColumns[0]=t.dataColumn,e&&this.updateChartColumns()},e.prototype.prepareChartData=function(){var t=this;if(this.dataTable){this.potentialLabelColumns=[],this.potentialDataColumns=[];for(var e=this.dataTable.columns.count,n=0;n<e;n++){var o=this.dataTable.columns.get(n),i=o.type,s=o.label;this.potentialLabelColumns.push({idx:n,label:s}),r.utils.isNumericType(i)&&this.potentialDataColumns.push({idx:n,label:s})}if(-1!=this.labelColumn?this.potentialLabelColumns.filter((function(e){return e.idx==t.labelColumn})).length||(this.labelColumn=-1):this.labelColumn=this.potentialLabelColumns.length>0?this.potentialLabelColumns[0].idx:-1,this.dataColumns.length){var a=this.potentialDataColumns.map((function(t){return t.idx}));this.dataColumns=this.dataColumns.filter((function(t){return a.indexOf(t)>=0})),this.dataColumns.length||(this.dataColumns=this.potentialDataColumns.length>0?[].concat(this.potentialDataColumns[0].idx):[])}else this.dataColumns=this.potentialDataColumns.length>0?[].concat(this.potentialDataColumns[0].idx):[];this.initChart()}},e.prototype.getSupportedChartTypes=function(){var t=this;return(this.options.supportedChartTypes?this.options.supportedChartTypes:Object.keys(a.a).map((function(t){return a.a[t]}))).filter((function(e){return t.hasChartTypes.indexOf(e)>=0}))},e.prototype.getCurrentChartType=function(){return this.chartType},e.prototype.render=function(){var t=this;if(this.clear(),this.hasData()&&this.hasColumnsForChart()&&this.context.resultTable.getTotal()==this.context.resultTable.getCachedCount()){var e=document.createElement("div");Object(s.addCssClass)(e,this.cssPrefix+"-header");var n=document.createElement("div");if(Object(s.addCssClass)(n,this.cssPrefix+"-main"),this.canDraw()){for(var o=document.createElement("select"),i=0,r=this.supportedChartTypes;i<r.length;i++){var a=r[i],l=document.createElement("option");l.value=a.toString(),l.text=this.getChartTypeName(a),o.appendChild(l)}o.value=this.chartType.toString(),e.appendChild(o),o.addEventListener("change",(function(e){var n=e.target.value;t.chartType=parseInt(n),t.refresh()})),this.settingsDiv=document.createElement("div"),Object(s.addCssClass)(this.settingsDiv,this.cssPrefix+"-settings"),Object(s.hideElement)(this.settingsDiv),n.appendChild(this.settingsDiv),this.chartDiv=document.createElement("div"),Object(s.addCssClass)(this.chartDiv,this.cssPrefix+"-content"),Object(s.hideElement)(this.chartDiv),n.appendChild(this.chartDiv),this.initSettingsDiv();var u=document.createElement("div");Object(s.addCssClass)(u,this.cssPrefix+"-settings-icon"),u.title="Settings",e.appendChild(u),u.addEventListener("click",(function(e){t.toggleSettings()})),this.drawChart(100)}else this.addContentDiv(n,"Unable to render the chart. None of the supported chart libraries (ChartJS, Google Charts, etc) is found.");this.options.hideSettings||this.element.appendChild(e),this.element.appendChild(n),this.element.style.display=""}else this.element.style.display="none"},e.prototype.addContentDiv=function(t,e){var n=document.createElement("div");Object(s.addCssClass)(n,this.cssPrefix+"-no-data"),n.innerText=e,t.appendChild(n)},e.prototype.clear=function(){this.element.innerHTML=""},e.prototype.drawChart=function(t){var e=this;Object(s.showElement)(this.chartDiv),t>0?setTimeout((function(){return e.drawCore()}),t):this.drawCore()},e.prototype.initSettingsDiv=function(){var t=this,e=document.createElement("div");e.textContent="SETTINGS",Object(s.addCssClass)(e,this.cssPrefix+"-settings-header"),this.settingsDiv.appendChild(e);var n=document.createElement("div");Object(s.addCssClass)(n,this.cssPrefix+"-settings-single"),this.settingsDiv.appendChild(n);var o=document.createElement("span");Object(s.showElement)(o),o.textContent="Label column",n.appendChild(o);var i=document.createElement("select");Object(s.showElement)(i),n.appendChild(i);for(var r=0,a=this.potentialLabelColumns;r<a.length;r++){var l=a[r];(f=document.createElement("option")).value=l.idx.toString(),f.text=l.label,i.appendChild(f)}this.labelColumn>=0&&(i.value=this.labelColumn.toString()),i.addEventListener("change",(function(e){t.labelColumn=parseInt(e.target.value),t.updateChartColumns(),t.toggleSettings((function(){t.drawChart(100)}))}));var u=document.createElement("div");Object(s.addCssClass)(u,this.cssPrefix+"-settings-single"),this.settingsDiv.appendChild(u);var c=document.createElement("span");Object(s.showElement)(c),c.textContent="Data column",u.appendChild(c);var d=document.createElement("select");Object(s.showElement)(d),u.appendChild(d);for(var h=0,p=this.potentialDataColumns;h<p.length;h++){var f;l=p[h];(f=document.createElement("option")).value=l.idx.toString(),f.text=l.label,d.appendChild(f)}this.dataColumns.length>0&&this.dataColumns[0]>=0&&(d.value=this.dataColumns[0].toString()),d.addEventListener("change",(function(e){t.dataColumns[0]=parseInt(e.target.value),t.updateChartColumns(),t.toggleSettings((function(){t.drawChart(100)}))}))},e.prototype.getPotentialLabelColumns=function(){return this.potentialLabelColumns},e.prototype.getPotentialDataColumns=function(){return this.potentialDataColumns},e.prototype.getLabelColumnIndex=function(){return this.labelColumn},e.prototype.getDataColumnIndex=function(){return this.dataColumns[0]},e.prototype.toggleSettings=function(t){var e,n;Object(s.isVisible)(this.chartDiv)?(e=this.chartDiv,n=this.settingsDiv):(e=this.settingsDiv,n=this.chartDiv),Object(s.toggleVisibility)(e,n,{complete:t})},e}(i.Widget)},function(t,e,n){"use strict";function o(t,e){for(var n="",o=0;o<e;o++)n+=t;return n}function i(t){return t.split("").reverse().join("")}function r(t,e){return t&&t.lastIndexOf(e)==t.length-e.length}function s(t,e){var n=t;return null!=n&&n.length>0?("/"!=n.charAt(n.length-1)&&(n+="/"),n+=e):n=e,n}n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return i})),n.d(e,"d",(function(){return r})),n.d(e,"a",(function(){return s}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var o=function(){function t(t,e){this.columns=t,this.values=e}return t.prototype.toArray=function(){return Array.from(this.values)},t.prototype.size=function(){return this.values.length},t.prototype.getValue=function(t){var e;if("string"==typeof t){if(void 0===(e=this.columns.getIndex(t)))throw new RangeError("No column with id '"+t+"'")}else e=t;if(e>=this.values.length)throw new RangeError("Out of range: "+e);return this.values[e]},t.prototype.setValue=function(t,e){var n;if("string"==typeof t){if(void 0===(n=this.columns.getIndex(t)))throw new RangeError("No column with id '"+t+"'")}else n=t;if(n>=this.values.length)throw new RangeError("Out of range: "+n);this.values[n]=e},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var o=n(0),i=n(20),r=n(12),s=n(16),a=n(19),l=n(8),u=n(13),c=n(21),d=n(27),h=n(62),p=function(){function t(t,e){this.query=t,this.linkType=s.a.All,this.parent=null,this._id=o.utils.generateId("cond"),this.justAdded=!1,this.tag=e||a.a.Unknown,this.enabled=!0,this.operatorId="",this.blockId="",this.expressions=new Array,this.conditions=new Array}return Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"enabled",{get:function(){return this._enabled&&(!this.getParent()||this.getParent().enabled)},set:function(t){this._enabled=t&&(!this.getParent()||this.getParent().enabled),this.conditions&&this.conditions.forEach((function(e){e.enabled=t}))},enumerable:!0,configurable:!0}),t.prototype.getQuery=function(){return this.query},t.prototype.getModel=function(){return this.query.getModel()},t.prototype.getParent=function(){return this.parent},t.prototype.setParent=function(t){this.parent=t},t.prototype.getConditions=function(){return this.conditions},t.prototype.isEmpty=function(){return 0===this.conditions.length},t.prototype.isGroup=function(){return this.tag==a.a.Group||null==this.parent},t.prototype.getLevel=function(){var t=this.getParent();return t?t.getLevel()+1:0},t.prototype.isReadOnly=function(){return!1},t.prototype.setReadOnly=function(t){},t.prototype.isParameterized=function(){return!1},t.prototype.setParameterized=function(t){},t.prototype.isInJoin=function(){return!1},t.prototype.setInJoin=function(t){},t.prototype.clearConditions=function(){this.conditions=[]},t.prototype.addCondition=function(t){return t.setParent(this),this.conditions.push(t)},t.prototype.removeConditionAt=function(t){this.conditions.splice(t,1)},t.prototype.loadFromData=function(t,e){if(e){if(this.tag=e.tag,this.tag||(this.tag=!this.parent||this.conditions.length>0?a.a.Group:a.a.Simple),void 0!==e.enabled&&(this.enabled=e.enabled),void 0!==e.disabled&&(this.enabled=!e.disabled),this.tag==a.a.Simple&&(this.operatorId=e.op,e.exprs))for(var n=0;n<e.exprs.length;n++){var o=new i.a(this);o.loadFromData(t,e.exprs[n]),this.expressions.push(o)}this.linkType=e.linking}},t.prototype.saveToData=function(){var t={};if(t.tag=this.tag,this.enabled||(t.enabled=this.enabled),this.tag==a.a.Simple){t.op=this.operatorId,t.exprs=[];for(var e=0;e<this.expressions.length;e++)t.exprs.push(this.expressions[e].saveToData())}return this.tag==a.a.Group&&(t.linking=this.linkType),t},t.prototype.fireChangedEvent=function(t){void 0===t&&(t=h.a.All),this.query.fireChangedEvent({part:u.b.Conditions,action:u.a.Modify,changee:this,condPart:t})},t.prototype.getExpressionIndex=function(t){return this.expressions.indexOf(t,0)},t.prototype.expressionChanged=function(t,e){0==t.getIndex()&&t.tag==l.a.EntityAttribute&&this.tuneOperatorForAttr(t.value)},t.prototype.getOperatorId=function(){return this.operatorId},t.prototype.setOperatorId=function(t,e){void 0===e&&(e=!1);var n=this.operatorId;if(this.operatorId=t,!e){var o=this.getModel(),i=o.getOperatorById(t),r=this.expressions[0].value,s=o.getAttributeById(r);this.tuneValueExpressions(s,i,s.id,n)}},t.prototype.tuneOperatorForAttr=function(t){var e=this.getModel(),n=this.expressions[0].value,o=e.getAttributeById(n);if(null!=o){var i=this.getModel().getDefaultOperatorForAttr(o),r=this.operatorId;this.operatorId=i.id,this.tuneValueExpressions(o,i,t,r)}},t.prototype.tuneValueExpressions=function(t,e,n,i){var r=this.getModel();if(e){var s=this.expressions.length,a=(n&&r.getAttributeById(n),null);if(i&&(a=r.getOperatorById(i)),a&&a.paramCount==e.paramCount){for(var l=1;l<e.paramCount;){var u=r.getOperand(t,a,l);(g=r.getOperand(t,e,l)).dataType==o.DataType.Unknown&&(g.dataType=t.dataType);var d=g.editor&&g.editor.tag!==o.EditorTag.Unknown?g.editor:t.defaultEditor&&t.defaultEditor.tag!==o.EditorTag.Unknown?t.defaultEditor:new c.a;if(l>=s){var h=this.createValueExpr(g);this.expressions.push(h)}else{var p=this.expressions[l],f=this.createValueExpr(g);this.areCompitableEditors(u.editor,d)&&f.tryCopyValueFrom(p),this.expressions[l]=f}l++}s>l&&this.expressions.splice(l,s-l)}else{this.expressions.splice(1,this.expressions.length-1);for(l=1;l<e.paramCount;l++){var g;(g=r.getOperand(t,e,l)).dataType==o.DataType.Unknown&&(g.dataType=t.dataType);h=this.createValueExpr(g);this.expressions.push(h)}}}},t.prototype.areCompitableEditors=function(t,e){return e.tag!=d.a.CustomList&&e.tag!=d.a.List&&e.tag!=d.a.SqlList&&e.tag!=o.EditorTag.Unknown},t.prototype.addExpressionByOperand=function(t,e){void 0===e&&(e=null);var n=this.createValueExpr(t,e);return this.expressions.push(n),n},t.prototype.createValueExpr=function(t,e){void 0===e&&(e=null);var n=null==e,o=e||t.defValue,s=e||t.defText,a=new i.a(this);if(t.kind===r.a.Query)a.tag=l.a.Query,a.dataType=t.dataType,a.kind=t.kind,a.setContent(o,s,!0);else if(t.kind===r.a.Attribute){if(!n){var u=this.getModel().getFirstAttributeByFilter((function(e){return 1==e.useInConditions&&(!t.dataType||e.dataType==t.dataType)}));o=u?u.id:null}a.tag=l.a.EntityAttribute,a.kind=t.kind,a.dataType=t.dataType,a.setContent(o,s,!0)}else n&&(o=t.defValue&&""!=t.defValue?t.defValue:t.editor&&t.editor.defValue?t.editor.defValue:"",t.editor&&(s=t.editor.getValueText(o))),a.tag=l.a.Constant,a.dataType=t.dataType,a.kind=t.kind,a.setContent(o,s,!0),a._isDefaultValue=n;return a},t}()},function(t,e,n){(function(e,n){var o;o=function(){"use strict";function t(t){return"function"==typeof t}var o=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},i=0,r=void 0,s=void 0,a=function(t,e){f[i]=t,f[i+1]=e,2===(i+=2)&&(s?s(g):C())},l="undefined"!=typeof window?window:void 0,u=l||{},c=u.MutationObserver||u.WebKitMutationObserver,d="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function p(){var t=setTimeout;return function(){return t(g,1)}}var f=new Array(1e3);function g(){for(var t=0;t<i;t+=2)(0,f[t])(f[t+1]),f[t]=void 0,f[t+1]=void 0;i=0}var y,m,v,b,C=void 0;function x(t,e){var n=this,o=new this.constructor(E);void 0===o[T]&&L(o);var i=n._state;if(i){var r=arguments[i-1];a((function(){return B(i,o,r,n._result)}))}else A(n,o,t,e);return o}function w(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(E);return k(e,t),e}d?C=function(){return e.nextTick(g)}:c?(m=0,v=new c(g),b=document.createTextNode(""),v.observe(b,{characterData:!0}),C=function(){b.data=m=++m%2}):h?((y=new MessageChannel).port1.onmessage=g,C=function(){return y.port2.postMessage(0)}):C=void 0===l?function(){try{var t=Function("return this")().require("vertx");return void 0!==(r=t.runOnLoop||t.runOnContext)?function(){r(g)}:p()}catch(t){return p()}}():p();var T=Math.random().toString(36).substring(2);function E(){}var D=void 0;function S(e,n,o){n.constructor===e.constructor&&o===x&&n.constructor.resolve===w?function(t,e){1===e._state?I(t,e._result):2===e._state?O(t,e._result):A(e,void 0,(function(e){return k(t,e)}),(function(e){return O(t,e)}))}(e,n):void 0===o?I(e,n):t(o)?function(t,e,n){a((function(t){var o=!1,i=function(t,e,n,o){try{t.call(e,n,o)}catch(t){return t}}(n,e,(function(n){o||(o=!0,e!==n?k(t,n):I(t,n))}),(function(e){o||(o=!0,O(t,e))}),t._label);!o&&i&&(o=!0,O(t,i))}),t)}(e,n,o):I(e,n)}function k(t,e){if(t===e)O(t,new TypeError("You cannot resolve a promise with itself"));else if(i=typeof(o=e),null===o||"object"!==i&&"function"!==i)I(t,e);else{var n=void 0;try{n=e.then}catch(e){return void O(t,e)}S(t,e,n)}var o,i}function M(t){t._onerror&&t._onerror(t._result),P(t)}function I(t,e){t._state===D&&(t._result=e,t._state=1,0!==t._subscribers.length&&a(P,t))}function O(t,e){t._state===D&&(t._state=2,t._result=e,a(M,t))}function A(t,e,n,o){var i=t._subscribers,r=i.length;t._onerror=null,i[r]=e,i[r+1]=n,i[r+2]=o,0===r&&t._state&&a(P,t)}function P(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var o=void 0,i=void 0,r=t._result,s=0;s<e.length;s+=3)o=e[s],i=e[s+n],o?B(n,o,i,r):i(r);t._subscribers.length=0}}function B(e,n,o,i){var r=t(o),s=void 0,a=void 0,l=!0;if(r){try{s=o(i)}catch(t){l=!1,a=t}if(n===s)return void O(n,new TypeError("A promises callback cannot return that same promise."))}else s=i;n._state!==D||(r&&l?k(n,s):!1===l?O(n,a):1===e?I(n,s):2===e&&O(n,s))}var _=0;function L(t){t[T]=_++,t._state=void 0,t._result=void 0,t._subscribers=[]}var R=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(E),this.promise[T]||L(this.promise),o(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?I(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&I(this.promise,this._result))):O(this.promise,new Error("Array Methods must be provided an Array"))}return t.prototype._enumerate=function(t){for(var e=0;this._state===D&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,o=n.resolve;if(o===w){var i=void 0,r=void 0,s=!1;try{i=t.then}catch(t){s=!0,r=t}if(i===x&&t._state!==D)this._settledAt(t._state,e,t._result);else if("function"!=typeof i)this._remaining--,this._result[e]=t;else if(n===F){var a=new n(E);s?O(a,r):S(a,t,i),this._willSettleAt(a,e)}else this._willSettleAt(new n((function(e){return e(t)})),e)}else this._willSettleAt(o(t),e)},t.prototype._settledAt=function(t,e,n){var o=this.promise;o._state===D&&(this._remaining--,2===t?O(o,n):this._result[e]=n),0===this._remaining&&I(o,this._result)},t.prototype._willSettleAt=function(t,e){var n=this;A(t,void 0,(function(t){return n._settledAt(1,e,t)}),(function(t){return n._settledAt(2,e,t)}))},t}(),F=function(){function e(t){this[T]=_++,this._result=this._state=void 0,this._subscribers=[],E!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof e?function(t,e){try{e((function(e){k(t,e)}),(function(e){O(t,e)}))}catch(e){O(t,e)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(t){return this.then(null,t)},e.prototype.finally=function(e){var n=this,o=n.constructor;return t(e)?n.then((function(t){return o.resolve(e()).then((function(){return t}))}),(function(t){return o.resolve(e()).then((function(){throw t}))})):n.then(e,e)},e}();return F.prototype.then=x,F.all=function(t){return new R(this,t).promise},F.race=function(t){var e=this;return o(t)?new e((function(n,o){for(var i=t.length,r=0;r<i;r++)e.resolve(t[r]).then(n,o)})):new e((function(t,e){return e(new TypeError("You must pass an array to race."))}))},F.resolve=w,F.reject=function(t){var e=new this(E);return O(e,t),e},F._setScheduler=function(t){s=t},F._setAsap=function(t){a=t},F._asap=a,F.polyfill=function(){var t=void 0;if(void 0!==n)t=n;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var o=null;try{o=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===o&&!e.cast)return}t.Promise=F},F.Promise=F,F},t.exports=o()}).call(this,n(54),n(55))},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var o,i=n(0),r=n(2),s=n(1),a=n(26),l=n(3),u=n(10),c=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=function(t){function e(e,n,o,i){var r=t.call(this,e,n,null,i)||this;return r.menu=o,r}return c(e,t),e.prototype.renderEditor=function(){},e.prototype.getLabelText=function(){var t=this.panel.getContext().getModel(),e=this.expression.value,n=e?t.getAttributeByIdSafe(e):null,o=this.panel.options.attrElementFormat;return n?t.getAttributeText(n,o):this.getEmptyText()},e.prototype.setValue=function(e,n){void 0===n&&(n=!1),n=n&&e!==this.expression.value;var o=t.prototype.setValue.call(this,e,!0);return n||this.expression.getParent().fireChangedEvent(r.ConditionPart.EntityAttr|r.ConditionPart.Operator),o},e.prototype.isEditable=function(){return!this.isReadOnly()&&(this.panel.options.editableParts&u.a.Attribute)===u.a.Attribute},e.prototype.getEmptyText=function(){return this.panel.options.emptyTextAttribute||i.i18n.getText("MsgEmptyAttrValue")},e.prototype.getClassesToAdd=function(){return this.cssPrefix+"-condelement "+this.cssPrefix+"-attrelement"},e.prototype.adjustWidth=function(){l.a.isMobileMode()||this.element.clientWidth>this.element.parentElement.clientWidth/2&&Object(s.domel)(this.element).addClass(this.cssPrefix+"-attrelement-wide")},e}(a.b)},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var o,i=n(0),r=n(47),s=n(5),a=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(e){var n=t.call(this,e)||this;return n.hasChartTypes=[s.a.Column,s.a.Bar,s.a.Histogram,s.a.Combo,s.a.Area,s.a.Line,s.a.SteppedLine,s.a.Pie,s.a.Doughnut],n.options.legend={show:!0,position:"right"},n}return a(e,t),e.prototype.getWidgetType=function(){return"chartGoogle"},e.prototype.canDraw=function(){return e.hasGoogleCharts()},e.hasGoogleCharts=function(){return"undefined"!=typeof google&&void 0!==google.charts},e.prototype.initChart=function(){e.hasGoogleCharts()&&this.labelColumn>=0&&this.dataColumns&&this.dataColumns.length>0&&(this.googleDataView=new google.visualization.DataView(this.convertToGoogleFormat()),this.updateChartColumns())},e.prototype.convertToGoogleType=function(t){switch(t){case i.DataType.Date:return"date";case i.DataType.DateTime:return"datetime";case i.DataType.Time:return"timeofday";case i.DataType.Byte:case i.DataType.Word:case i.DataType.Int32:case i.DataType.Int64:case i.DataType.Currency:case i.DataType.Float:return"number";default:return"string"}},e.prototype.convertToGoogleValue=function(t,e){return e===i.DataType.Bool?t?t.toString():null:t},e.prototype.convertToGoogleFormat=function(){for(var t=new google.visualization.DataTable,e=this.dataTable.columns,n=0;n<e.count;n++){var o=e.get(n);t.addColumn(this.convertToGoogleType(o.type),o.label,o.id)}var i=this.dataTable.getCachedRows();t.addRows(i.length);for(n=0;n<i.length;n++)for(var r=i[n],s=0;s<e.count;s++)t.setCell(n,s,this.convertToGoogleValue(r.getValue(s),e.get(s).type));return t},e.prototype.drawCore=function(){if(null!=this.googleDataView){this.options.legend=this.options.legend||{};var t={width:"100%",height:"100%",chartArea:{width:this.getChartAreaWidth}};this.chartType==s.a.Doughnut&&(t.pieHole=.4),this.options.legend.show?t.legend={position:this.options.legend.position}:t.legend="none",this.createChart(this.chartDiv).draw(this.googleDataView,t)}},e.prototype.getChartAreaWidth=function(t){return t==s.a.Pie?"100%":"50%"},e.prototype.updateChartColumns=function(){this.googleDataView&&this.googleDataView.setColumns([].concat(this.labelColumn).concat(this.dataColumns))},e.prototype.createChart=function(t){switch(this.chartType){case s.a.Column:return new google.visualization.ColumnChart(t);case s.a.Histogram:return new google.visualization.Histogram(t);case s.a.Bar:return new google.visualization.BarChart(t);case s.a.Combo:return new google.visualization.ComboChart(t);case s.a.Area:return new google.visualization.AreaChart(t);case s.a.Line:return new google.visualization.LineChart(t);case s.a.SteppedLine:return new google.visualization.SteppedAreaChart(t);case s.a.Pie:case s.a.Doughnut:default:return new google.visualization.PieChart(t)}},e}(r.a)},function(t,e){var n,o,i=t.exports={};function r(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===r||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:r}catch(t){n=r}try{o="function"==typeof clearTimeout?clearTimeout:s}catch(t){o=s}}();var l,u=[],c=!1,d=-1;function h(){c&&l&&(c=!1,l.length?u=l.concat(u):d=-1,u.length&&p())}function p(){if(!c){var t=a(h);c=!0;for(var e=u.length;e;){for(l=u,u=[];++d<e;)l&&l[d].run();d=-1,e=u.length}l=null,c=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===s||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(t)}}function f(t,e){this.fun=t,this.array=e}function g(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];u.push(new f(t,e)),1!==u.length||c||a(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){(function(e,n){var o;o=function(){"use strict";function t(t){return"function"==typeof t}var o=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},i=0,r=void 0,s=void 0,a=function(t,e){f[i]=t,f[i+1]=e,2===(i+=2)&&(s?s(g):C())},l="undefined"!=typeof window?window:void 0,u=l||{},c=u.MutationObserver||u.WebKitMutationObserver,d="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function p(){var t=setTimeout;return function(){return t(g,1)}}var f=new Array(1e3);function g(){for(var t=0;t<i;t+=2)(0,f[t])(f[t+1]),f[t]=void 0,f[t+1]=void 0;i=0}var y,m,v,b,C=void 0;function x(t,e){var n=this,o=new this.constructor(E);void 0===o[T]&&L(o);var i=n._state;if(i){var r=arguments[i-1];a((function(){return B(i,o,r,n._result)}))}else A(n,o,t,e);return o}function w(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(E);return k(e,t),e}d?C=function(){return e.nextTick(g)}:c?(m=0,v=new c(g),b=document.createTextNode(""),v.observe(b,{characterData:!0}),C=function(){b.data=m=++m%2}):h?((y=new MessageChannel).port1.onmessage=g,C=function(){return y.port2.postMessage(0)}):C=void 0===l?function(){try{var t=Function("return this")().require("vertx");return void 0!==(r=t.runOnLoop||t.runOnContext)?function(){r(g)}:p()}catch(t){return p()}}():p();var T=Math.random().toString(36).substring(2);function E(){}var D=void 0;function S(e,n,o){n.constructor===e.constructor&&o===x&&n.constructor.resolve===w?function(t,e){1===e._state?I(t,e._result):2===e._state?O(t,e._result):A(e,void 0,(function(e){return k(t,e)}),(function(e){return O(t,e)}))}(e,n):void 0===o?I(e,n):t(o)?function(t,e,n){a((function(t){var o=!1,i=function(t,e,n,o){try{t.call(e,n,o)}catch(t){return t}}(n,e,(function(n){o||(o=!0,e!==n?k(t,n):I(t,n))}),(function(e){o||(o=!0,O(t,e))}),t._label);!o&&i&&(o=!0,O(t,i))}),t)}(e,n,o):I(e,n)}function k(t,e){if(t===e)O(t,new TypeError("You cannot resolve a promise with itself"));else if(i=typeof(o=e),null===o||"object"!==i&&"function"!==i)I(t,e);else{var n=void 0;try{n=e.then}catch(e){return void O(t,e)}S(t,e,n)}var o,i}function M(t){t._onerror&&t._onerror(t._result),P(t)}function I(t,e){t._state===D&&(t._result=e,t._state=1,0!==t._subscribers.length&&a(P,t))}function O(t,e){t._state===D&&(t._state=2,t._result=e,a(M,t))}function A(t,e,n,o){var i=t._subscribers,r=i.length;t._onerror=null,i[r]=e,i[r+1]=n,i[r+2]=o,0===r&&t._state&&a(P,t)}function P(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var o=void 0,i=void 0,r=t._result,s=0;s<e.length;s+=3)o=e[s],i=e[s+n],o?B(n,o,i,r):i(r);t._subscribers.length=0}}function B(e,n,o,i){var r=t(o),s=void 0,a=void 0,l=!0;if(r){try{s=o(i)}catch(t){l=!1,a=t}if(n===s)return void O(n,new TypeError("A promises callback cannot return that same promise."))}else s=i;n._state!==D||(r&&l?k(n,s):!1===l?O(n,a):1===e?I(n,s):2===e&&O(n,s))}var _=0;function L(t){t[T]=_++,t._state=void 0,t._result=void 0,t._subscribers=[]}var R=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(E),this.promise[T]||L(this.promise),o(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?I(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&I(this.promise,this._result))):O(this.promise,new Error("Array Methods must be provided an Array"))}return t.prototype._enumerate=function(t){for(var e=0;this._state===D&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,o=n.resolve;if(o===w){var i=void 0,r=void 0,s=!1;try{i=t.then}catch(t){s=!0,r=t}if(i===x&&t._state!==D)this._settledAt(t._state,e,t._result);else if("function"!=typeof i)this._remaining--,this._result[e]=t;else if(n===F){var a=new n(E);s?O(a,r):S(a,t,i),this._willSettleAt(a,e)}else this._willSettleAt(new n((function(e){return e(t)})),e)}else this._willSettleAt(o(t),e)},t.prototype._settledAt=function(t,e,n){var o=this.promise;o._state===D&&(this._remaining--,2===t?O(o,n):this._result[e]=n),0===this._remaining&&I(o,this._result)},t.prototype._willSettleAt=function(t,e){var n=this;A(t,void 0,(function(t){return n._settledAt(1,e,t)}),(function(t){return n._settledAt(2,e,t)}))},t}(),F=function(){function e(t){this[T]=_++,this._result=this._state=void 0,this._subscribers=[],E!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof e?function(t,e){try{e((function(e){k(t,e)}),(function(e){O(t,e)}))}catch(e){O(t,e)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(t){return this.then(null,t)},e.prototype.finally=function(e){var n=this,o=n.constructor;return t(e)?n.then((function(t){return o.resolve(e()).then((function(){return t}))}),(function(t){return o.resolve(e()).then((function(){throw t}))})):n.then(e,e)},e}();return F.prototype.then=x,F.all=function(t){return new R(this,t).promise},F.race=function(t){var e=this;return o(t)?new e((function(n,o){for(var i=t.length,r=0;r<i;r++)e.resolve(t[r]).then(n,o)})):new e((function(t,e){return e(new TypeError("You must pass an array to race."))}))},F.resolve=w,F.reject=function(t){var e=new this(E);return O(e,t),e},F._setScheduler=function(t){s=t},F._setAsap=function(t){a=t},F._asap=a,F.polyfill=function(){var t=void 0;if(void 0!==n)t=n;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var o=null;try{o=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===o&&!e.cast)return}t.Promise=F},F.Promise=F,F},t.exports=o()}).call(this,n(54),n(55))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var o=function(){function t(t,e){this.xhr=t,this.method=e.method,this.url=e.url,this.headers=e.headers,this.queryParams=e.queryParams,this.data=e.data}return t.prototype.setHeader=function(t,e){this.headers[t]=e},t.prototype.setQueryParam=function(t,e){this.queryParams[t]=e},t.prototype.getXMLHttpRequest=function(){return this.xhr},t.prototype.getResponseHeaders=function(){if(this.xhr.readyState==this.xhr.HEADERS_RECEIVED){for(var t={},e=0,n=this.xhr.getAllResponseHeaders().trim().split(/[\r\n]+/);e<n.length;e++){var o=n[e].split(": "),i=o.shift(),r=o.join(": ");t[i]=r}return t}return{}},t.prototype.open=function(){var t=this;if(this.xhr.readyState===this.xhr.UNSENT){var e=this.url;for(var n in this.queryParams&&Object.keys(this.queryParams).length>0&&(e+=encodeURI("?"+Object.keys(this.queryParams).map((function(e){return e+"="+t.queryParams[e]})).join("&"))),this.xhr.open(this.method,e,!0),this.xhr.setRequestHeader("X-Requested-With","XMLHttpRequest"),this.headers)this.xhr.setRequestHeader(n,this.headers[n])}},t.prototype.abort=function(){this.xhr.abort()},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return s})),n.d(e,"c",(function(){return a}));var o,i=n(7),r=n(11);!function(t){t[t.None=0]="None",t[t.Left=1]="Left",t[t.Center=2]="Center",t[t.Right=3]="Right"}(o||(o={}));var s=function(t){if(!t)throw Error("Options are required");if(!t.id)throw Error("Field Id is required");if(!t.label)throw Error("Label is required");this.id=t.id,this.type=r.a.getIfDefined(t.type,i.a.String),this.label=t.label,this.originAttrId=t.originAttrId,this.isAggr=t.isAggr||!1,this.displayFormat=t.dfmt,this.groupFooterColumnTemplate=t.gfct,this.style=t.style||{},this.description=t.description,this.calculatedWidth=0},a=function(){function t(){this.items=[],this.mapper={},this._dateColumnIdx=[]}return Object.defineProperty(t.prototype,"count",{get:function(){return this.items.length},enumerable:!0,configurable:!0}),t.prototype.add=function(t){var e;e=t instanceof s?t:new s(t);var n=this.items.length;return this.items.push(e),this.mapper[e.id]=n,[i.a.Date,i.a.DateTime,i.a.Time].indexOf(e.type)>=0&&this._dateColumnIdx.push(n),n},t.prototype.updateDateColumnIdx=function(){this._dateColumnIdx=this.getItems().filter((function(t){return[i.a.Date,i.a.DateTime,i.a.Time].indexOf(t.type)>=0})).map((function(t,e){return e}))},t.prototype.put=function(t,e){t>=0&&t<this.count&&(this.items[t]=e,this.updateDateColumnIdx())},t.prototype.move=function(t,e){var n=this.items.indexOf(t);n>=0&&n!=e&&(r.a.moveArrayItem(this.items,n,e),this.updateDateColumnIdx())},t.prototype.get=function(t){return t>=0&&t<this.count?this.items[t]:null},t.prototype.getIndex=function(t){return this.mapper[t]},t.prototype.getItems=function(){return this.items},t.prototype.getDateColumnIndexes=function(){return this._dateColumnIdx},t.prototype.removeAt=function(t){var e=this.get(t);this.items.splice(t,1);var n=this._dateColumnIdx.indexOf(t);n>=0&&this._dateColumnIdx.splice(n,1),delete this.mapper[e.id]},t.prototype.clear=function(){this.items=[],this._dateColumnIdx=[],this.mapper={}},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var o=function(){function t(t){this.start(t)}return t.prototype.start=function(t){this.formatStr=t,this.pos=0,this.exprNum=0,this.tokenText=""},t.prototype.skipSpaces=function(){for(;this.pos<this.formatStr.length&&" "===this.formatStr.charAt(this.pos);)this.pos++},t.prototype.next=function(){if(this.skipSpaces(),this.pos>=this.formatStr.length)return!1;var t=0;if("{"===this.formatStr.charAt(this.pos)){if((t=this.formatStr.indexOf("}",this.pos))<0)return!1;this.tokenText=this.formatStr.substring(this.pos,t+1),0===this.tokenText.indexOf("{expr")&&(this.token="expression",this.exprNum=parseInt(this.tokenText.substring(5,this.tokenText.length))),this.pos=t+1}else if("["===this.formatStr.charAt(this.pos)&&this.pos<this.formatStr.length-1&&"["===this.formatStr.charAt(this.pos+1))this.pos+=2,t=this.formatStr.indexOf("]]",this.pos),this.token="operator",this.tokenText=this.formatStr.substring(this.pos,t),this.pos=t+2;else{this.token="text";var e=this.formatStr.indexOf("{",this.pos);e<0&&(e=this.formatStr.length);var n=this.formatStr.indexOf("[[",this.pos);n<0&&(n=this.formatStr.length),t=Math.min(e,n),this.tokenText=this.formatStr.substring(this.pos,t).trim(),this.pos=t}return!0},t.prototype.getToken=function(){return{type:this.token,text:this.tokenText,index:this.exprNum-1}},t.prototype.parse=function(){for(var t=[];this.next();)t.push(this.getToken());return t},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var o=n(0),i=function(){function t(){this.id="",this.caption="",this.sqlExpr="",this.displayFormat="",this.appliedTypes=[]}return t.prototype.loadFromData=function(t){t&&(this.id=t.id,this.caption=t.cptn,this.displayFormat=t.fmt,this.sqlExpr=t.expr,this.appliedTypes=t.dtypes||this.appliedTypes)},t.prototype.getAppliedTypesOrDefault=function(){return this.appliedTypes.length>0?this.appliedTypes:"SUM"===this.id||"AVG"===this.id?[o.DataType.Autoinc,o.DataType.Byte,o.DataType.Currency,o.DataType.Float,o.DataType.Int32,o.DataType.Int64,o.DataType.Word]:"MIN"===this.id||"MAX"===this.id?[o.DataType.Autoinc,o.DataType.BCD,o.DataType.Byte,o.DataType.Currency,o.DataType.Date,o.DataType.DateTime,o.DataType.Time,o.DataType.Float,o.DataType.Int32,o.DataType.Int64,o.DataType.Word]:o.utils.getAllDataTypes()},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var o=function(){function t(e){void 0===e&&(e=null),this.childs=[],this.value=null,this.parent=null,e&&(Array.isArray(e)?(this.value=e[0],e.length>1&&this.addChild(new t(e.slice(1)))):e instanceof t?(this.value=e.value,this.childs=e.childs):this.value=e)}return t.prototype.contains=function(t){if(this.value===t)return!0;for(var e=0,n=this.childs;e<n.length;e++){if(n[e].contains(t))return!0}return!1},t.prototype.findNode=function(t){if(this.value===t)return this;for(var e=0,n=this.childs;e<n.length;e++){var o=n[e].findNode(t);if(o)return o}return null},t.prototype.addChild=function(t){t.parent=this,this.childs.push(t)},t.prototype.setParents=function(){for(var t=0,e=this.childs;t<e.length;t++){var n=e[t];n.parent=this,n.setParents()}},t}()},function(t,e,n){"use strict";var o;n.d(e,"a",(function(){return o})),function(t){t[t.EntityAttr=2]="EntityAttr",t[t.Operator=4]="Operator",t[t.Value=8]="Value",t[t.All=14]="All"}(o||(o={}))},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return r}));var o=n(0),i=n(29),r=function(){function e(t){this.context=t,console.warn("BrowserQueryStorage is used for managing queries")}return e.prototype.init=function(t){var e="eq";t&&t.keyPrefix&&(e=t.keyPrefix),this.queryListKey=e+"-querylist",this.queryKeyPrefix=e},e.prototype.getQueryList=function(e){var n=this;return new t((function(t,e){try{var o=localStorage.getItem(n.queryListKey);o&&t(JSON.parse(o)),t([])}catch(t){e(t)}}))},e.prototype.newQuery=function(e){var n=this;return new t((function(t,o){var r=new i.b(n.context.getModel());r.reset(),r.setDefaultName(),e&&(e.query&&r.loadFromData(e.query.toJSONData()),e.queryId&&r.setId(e.queryId),e.name&&r.setName(e.name),e.description&&r.setDescription(e.description)),n._saveQuery(r),t(r.toJSONData())}))},e.prototype.loadQuery=function(e){var n=this;return new t((function(t,o){try{var i=localStorage.getItem(n.queryKeyPrefix+"-"+e.queryId);throw i&&t(JSON.parse(i)),new Error("Query is not found: "+e.queryId)}catch(t){o(t)}}))},e.prototype.saveQuery=function(e){var n=this;return new t((function(t,o){try{e.modelId||n.context.getModel().getId();var i=e.query||n.context.getQuery();n._saveQuery(i),t(null)}catch(t){o(t)}}))},e.prototype._saveQuery=function(t){var e=[],n=localStorage.getItem(this.queryListKey);n&&(e=JSON.parse(n));var i=o.utils.findItemById(e,t.getId());i||(i={id:t.getId(),name:t.getName(),text:t.getDescription()},e.push(i)),i.name=t.getName(),i.text=t.getDescription(),localStorage.setItem(this.queryListKey,JSON.stringify(e)),localStorage.setItem(this.queryKeyPrefix+"-"+t.getId(),t.toJSON())},e.prototype.removeQuery=function(e){var n=this;return new t((function(t,o){try{e.modelId||n.context.getModel().getId();var i=e.queryId||n.context.getQuery().getId(),r=[],s=localStorage.getItem(n.queryListKey);s&&(r=JSON.parse(s)),r=r.filter((function(t){return t.id!=i})),localStorage.setItem(n.queryListKey,JSON.stringify(r)),localStorage.removeItem(n.queryKeyPrefix+"-"+i),t()}catch(t){o(t)}}))},e}()}).call(this,n(51))},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return o}));var o=function(){function e(t){this.context=t,this.modelPromise=null}return e.prototype.init=function(t){},e.prototype.getContext=function(){return this.context},e.prototype.createModelLoadingPromise=function(){var e=this;this.modelPromise=new t((function(t,n){e.modelLoadingResolveFunc=t,e.modelLoadingRejectFunc=n}))},e.prototype.getModelPromise=function(){return this.modelPromise||t.reject(new Error("Model has been never loaded."))},e.prototype.startModelLoading=function(t){return this.createModelLoadingPromise(),this.sendLoadModelRequest(t),this.modelPromise},e}()}).call(this,n(51))},function(t,e,n){"use strict";(function(t){n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return i}));var o=function(){function e(t){this.context=t,this.levels={}}return e.prototype.getAggregateData=function(e,n){var o=this;return new t((function(t,i){var r=function(e){var r=o.groupKeyToStr(n),s=e.get(r);s?t(s):i("Can't find data for "+r)},s=o.getLevelDesc(e,!1);s&&s.data?r(s.data):s.receivedCallbacks.push(r)}))},e.prototype.setAggregateData=function(t,e){var n=this.getLevelDesc(t,!0);if(n.data=e,n.receivedCallbacks)for(var o=0,i=n.receivedCallbacks;o<i.length;o++){(0,i[o])(n.data)}n.receivedCallbacks=[]},e.prototype.updateAggregateData=function(t,e,n){var o=this.getLevelDesc(t,!0),i=this.groupKeyToStr(e);o.data.set(i,n)},e.prototype.groupKeyToStr=function(t){return JSON.stringify(t)},e.prototype.getLevelDesc=function(t,e){var n=this.levels[t];return!n&&e&&(n={receivedCallbacks:[],data:new Map},this.levels[t]=n),n},e.prototype.clear=function(){this.levels=[]},e}(),i=function(){function e(t){this.context=t,this.aggrs=null}return e.prototype.getAggrContainer=function(){return this.aggrs},e.prototype.calculate=function(e){console.warn("Grand totals and sub totals aggregation calculation can be used in Enterprise version only"),(e=e||{}).maxLevel=e.maxLevel>=0?e.maxLevel:0,this.aggrs=new o(this.context);var n=this.context.createQuery();n.loadFromData(this.context.getQuery().toJSONData());for(var i=this.context.getQuery().getAggregationSettings(),r=i.getAggregates().map((function(t){return t.colId})),s=n.getColumns().filter((function(t){return r.indexOf(t.id)<0})),a=0;a<s.length;a++)s[a].enabled=!1;i.hasGrandTotals()&&(this.aggrs.setAggregateData(0,new Map),e.resultObtained&&e.resultObtained({},0));for(var l=i.getGroups(),u=1;u<=l.length&&u<=e.maxLevel;u++)this.aggrs.setAggregateData(u,new Map),e.resultObtained&&e.resultObtained({},u);return t.resolve()},e.prototype.needRecalculation=function(){return!0},e.prototype.reset=function(){},e}()}).call(this,n(51))},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return i}));var o=n(0),i=function(){function e(t){this.context=t}return e.prototype.loadChunk=function(e){var n=this;return this.dataLoadPromise=new t((function(t,i){var r={chunk:e,success:function(i){for(var r=new o.EasyDataTable({loader:n.context.dataLoader,chunkSize:n.context.resultTable.chunkSize}),s=i.resultSet,a=0,l=s.cols;a<l.length;a++){var u=l[a];r.columns.add(u)}r.setTotal(i.meta.totalRecords);for(var c=0,d=s.rows;c<d.length;c++){var h=d[c];r.addRow(h)}var p=0;i.meta&&i.meta.totalRecords&&(p=i.meta.totalRecords),t({table:r,total:p,hasNext:!e.needTotal||e.offset+e.limit<p})},error:function(t){return i(t)}};n.context.debugMode&&(r.debug="Data Chunk. Offset: "+e.offset),n.context.fetchDataChunk(r)})),this.dataLoadPromise},e}()}).call(this,n(51))},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var o,i=n(0),r=n(2),s=n(1),a=n(4),l=n(3),u=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c=function(t){function e(e){var n=t.call(this,e)||this;return n.queryChangedCallbackId=null,n.group=r.WidgetGroup.Model|r.WidgetGroup.Query,n.panel=e,n}return u(e,t),Object.defineProperty(e.prototype,"cssPrefix",{get:function(){return"eqjs-ep"},enumerable:!0,configurable:!0}),e.prototype.getWidgetType=function(){return"entitiesPanel"},e.prototype.init=function(e,n){t.prototype.init.call(this,e,n),this.setOptions(n),this.renderProgressBlock()},e.prototype.refreshCore=function(){this.render(),this.options.syncWithColumns&&this.refreshCheckedStateByColumns()},e.prototype.onProcessStartCore=function(){this.options.showIndicatorOnLoad&&(this.progressBlock.parentNode||this.panel.appendChild(this.progressBlock))},e.prototype.onProcessEndCore=function(){this.options.showIndicatorOnLoad&&this.progressBlock.parentNode&&this.panel.removeChild(this.progressBlock)},e.prototype.destroyCore=function(){this.slot.innerHTML=""},e.prototype.setOptions=function(t){var e=this;(this.options={showToolbar:!0,syncWithColumns:!1,showSelectAllButton:!1,showClearSelectionButton:!0,showAddColumnButton:!0,showAddConditionButton:!0,showCheckboxes:!0,showTooltips:!0,draggableAttributes:!0,showAttributes:{useInConditions:!0,useInResult:!0,useInSorting:!1},showFilterBox:!1,filterBoxMode:0,showIndicatorOnLoad:!0,attrPlacement:0,sortEntities:!1,autoClearSelection:!0,entityRenderedCallback:null,attributeRenderedCallback:null,columnTitleFormat:"{attr}"},t&&i.utils.assignDeep(this.options,t),this.queryChangedCallbackId)&&(n=this.context.getQuery()).removeChangedCallback(this.queryChangedCallbackId);if(this.options.syncWithColumns){var n=this.context.getQuery();this.queryChangedCallbackId=n.addChangedCallback((function(t){var n=t.data;!n||n.part!=r.QueryChangePart.Columns&&n.part!=r.QueryChangePart.All||e.refreshCheckedStateByColumns()}))}},e.prototype.render=function(){var t=this.context.getModel();if(this.clear(),this.panel.classList.add(this.cssPrefix+"-panel"),this.panel.classList.add(l.a.getMobileCssClass()),this.rootEntityBlock=document.createElement("div"),null!=t&&!t.isEmpty()){var e=t.getEntitiesTree({addUIC:this.options.showAttributes.useInConditions,addUIR:this.options.showAttributes.useInResult,addUIS:this.options.showAttributes.useInSorting,attrPlacement:this.options.attrPlacement,sortEntities:this.options.sortEntities,includeRootData:!0});this.entityTreeBlock=this.renderEntity(e,this.rootEntityBlock,0),this.panel.appendChild(this.entityTreeBlock)}this.options.showFilterBox?this.createFilterBox():this.rootEntityBlock.style.top="0",this.options.showToolbar&&!this.options.syncWithColumns?this.createToolPanel():this.rootEntityBlock.style.bottom="0"},e.prototype.renderEntity=function(t,e,n){var o,a=this,u=document.createElement("div");u.classList.add(this.cssPrefix+"-entity-node"),u.classList.add(l.a.getMobileCssClass());var c=document.createElement("div");c.classList.add(this.cssPrefix+"-entity-children"),c.classList.add(l.a.getMobileCssClass());var d=document.createElement("label");d.classList.add(this.cssPrefix+"-entity-node-label");var h=document.createElement("input");h.type="checkbox",h.title=t.text;var p,f,g,y=document.createElement("a");y.href="javascript:void(0)",y.title=i.i18n.getText("EntityToggle")+" "+t.text,y.classList.add(this.cssPrefix+"-entity-node-button");var m=n;if(e?(o=e).innerHTML="":o=document.createElement("div"),o.classList.add(this.cssPrefix+"-entity"),o.classList.add(l.a.getMobileCssClass()),t.id&&""!=t.id){d.innerText=t.text,u.appendChild(d),this.options.showCheckboxes&&d.insertBefore(h,d.firstChild),u.insertBefore(y,u.firstChild),this.options.showTooltips&&t.description&&d.setAttribute("title",t.description);for(var v=0;v<m;v++){var b=document.createElement("div");b.classList.add(this.cssPrefix+"-entity-offset"),u.insertBefore(b,u.firstChild)}o.appendChild(u),c.hidden=!0,m++}var C=t.items?t.items.length:0,x=function(e){var n=t.items[e];if(n.isEntity)c.appendChild(w.renderEntity(n,null,m));else if(!n.lookupAttr||!function(t,e){return e.querySelectorAll("."+a.cssPrefix+'-entity-attr[data-id="'+t+'"]').length>0}(n.lookupAttr,c)){(f=document.createElement("label")).innerText=n.text,f.classList.add(w.cssPrefix+"-entity-attr-label"),w.options.showCheckboxes&&((g=document.createElement("input")).type="checkbox",g.title=n.text,f.insertBefore(g,f.firstChild),w.options.syncWithColumns&&g.addEventListener("change",(function(t){var e=a.context.getModel(),n=a.context.getQuery(),o=t.currentTarget,i=o.parentElement.parentElement.getAttribute("data-id");if(e.checkAttrProperty(i,"useInResult"))if(o.checked){var s=e.getAttributeById(i),l=e.getAttributeText(s,a.options.columnTitleFormat),u=n.addColumn({attribute:s,caption:l});n.fireColumnsChangedEvent(r.QueryChangeAction.Add,u)}else{var c=n.getColumns().filter((function(t){return t.expr.tag===r.ExprTag.EntityAttribute&&t.expr.value===i}));c.length>0&&(n.removeColumn(c[0],null),n.fireColumnsChangedEvent(r.QueryChangeAction.Delete,c[0]))}}))),w.options.showTooltips&&n.description&&f.setAttribute("title",n.description);for(var o=0;o<m+1;o++){var i=document.createElement("div");i.classList.add(w.cssPrefix+"-entity-offset"),f.insertBefore(i,f.firstChild)}(p=document.createElement("div")).classList.add(w.cssPrefix+"-entity-attr"),0==u.innerHTML.length&&p.classList.add(w.cssPrefix+"-entity-attr-root"),p.innerHTML="",p.appendChild(f),p.setAttribute("data-id",n.id),w.options.draggableAttributes&&s.eqDragManager.registerDraggableItem({element:p,scope:"entityAttr",data:{attrId:n.id},renderer:function(t){t.innerHTML="";var e=document.createElement("span");e.innerText=n.text,t.appendChild(e)}}),w.options.attributeRenderedCallback&&w.options.attributeRenderedCallback(p),c.appendChild(p)}},w=this;for(v=0;v<C;v++)x(v);if(c.innerHTML.length&&(o.appendChild(c),y.addEventListener("click",(function(t){c.hidden=!c.hidden;var e=t.target,n=a.cssPrefix+"-entity-node-button-open";e.classList.contains(n)?e.classList.remove(n):e.classList.add(n),t.preventDefault()}))),c){var T=c.querySelectorAll("."+this.cssPrefix+"-entity-attr > label > input");for(v=0;v<T.length;v++){T[v].addEventListener("click",(function(t){t.target.checked&&!h.checked?h.checked=!0:0===c.querySelectorAll("input:checked").length&&(h.checked=!1),t.stopPropagation()}))}}return h.addEventListener("click",(function(t){for(var e=t.target,n=c.querySelectorAll("label input"),o=0;o<n.length;o++){n[o].checked=e.checked}if(a.options.syncWithColumns){for(var i=a.context.getQuery(),s=a.context.getModel(),l=[],u=0,d=Array.from(c.querySelectorAll("."+a.cssPrefix+"-entity-attr"));u<d.length;u++){var h=d[u].getAttribute("data-id");s.checkAttrProperty(h,"useInResult")&&l.push(h)}if(e.checked)for(var p=0,f=l;p<f.length;p++){h=f[p];i.addColumn({attributeId:h})}else{var g=i.getColumns().filter((function(t){return t.expr.tag===r.ExprTag.EntityAttribute&&l.indexOf(t.expr.value)>=0}));i.removeColumns(g,null)}i.fireColumnsChangedEvent()}t.stopPropagation()})),e!=this.rootEntityBlock&&this.options.entityRenderedCallback&&this.options.entityRenderedCallback(o),o},e.prototype.createFilterBox=function(){var t=this;this.filterBoxBlock=document.createElement("div"),this.filterBoxBlock.classList.add(this.cssPrefix+"-filter-box"),this.filterBoxBlock.classList.add(l.a.getMobileCssClass()),this.filterBoxInput=document.createElement("input"),this.filterBoxInput.classList.add(this.cssPrefix+"-filter-box-input"),this.filterBoxInput.addEventListener("input",(function(e){for(var n=t.panel.querySelectorAll("."+t.cssPrefix+"-entity-attr"),o=0;o<n.length;o++){var i=n[o];i.hidden=!t.checkFilterAttribute(i)}var r=t.panel.querySelectorAll(":scope > ."+t.cssPrefix+"-entity");for(o=0;o<r.length;o++){for(var s=r[o],a=s.querySelectorAll("."+t.cssPrefix+"-entity-attr"),l=0,u=0;u<a.length;u++)"None"!==a[u].style.display&&l++;s.hidden=0===l}""===t.filterBoxInput.value?t.collapseAll():t.expandAll()})),this.filterBoxBlock.appendChild(this.filterBoxInput),this.panel.insertBefore(this.filterBoxBlock,this.panel.firstChild)},e.prototype.createToolPanel=function(){var t=this,e=this.cssPrefix+"-tool-panel",n=document.createElement("div");n.classList.add(e),n.classList.add(l.a.getMobileCssClass());var o=document.createElement("div");o.classList.add(e+"-select-all"),o.title="Select all";var r=document.createElement("div");r.classList.add(e+"-deselect-all"),r.title="Clear selection";var s=document.createElement("div");s.classList.add(e+"-add-columns"),s.title="Add column";var a=document.createElement("div");a.classList.add(e+"-add-cond"),a.title="Add condition";var u=document.createElement("div");u.classList.add(e+"-left-side");var c=document.createElement("div");c.classList.add(e+"-right-side");var d=this.context.getModel();this.options.showSelectAllButton&&(o.title=i.i18n.getText("ButtonSelectAll"),u.appendChild(o),o.addEventListener("click",(function(){t.selectAll()}))),this.options.showClearSelectionButton&&(r.title=i.i18n.getText("ButtonDeselectAll"),u.appendChild(r),r.addEventListener("click",(function(){t.deselectAll()}))),this.options.showAddColumnButton&&(s.title=i.i18n.getText("ButtonAddColumns"),c.appendChild(s),s.addEventListener("click",(function(){var e,n=t.panel.querySelectorAll("."+t.cssPrefix+"-entity-attr"),o=[],i=t.context.getQuery();i.fireProcessEvent({source:self,status:"start"});for(var r=0;r<n.length;r++){var s=n[r];s.getElementsByTagName("input")[0].checked&&(e=s.getAttribute("data-id"),d.checkAttrProperty(e,"useInResult")&&o.push(e))}for(var a=0,l=o;a<l.length;a++){var u=l[a],c=d.getAttributeById(u),h=d.getAttributeText(c,t.options.columnTitleFormat);i.addColumn({attribute:c,caption:h})}i.fireChangedEvent(),t.options.autoClearSelection&&t.deselectAll(),i.fireProcessEvent({source:self,status:"finish"})}))),this.options.showAddConditionButton&&(a.title=i.i18n.getText("ButtonAddConditions"),c.appendChild(a),a.addEventListener("click",(function(){var e,n=t.panel.querySelectorAll("."+t.cssPrefix+"-entity-attr"),o=[],i=t.context.getQuery();i.fireProcessEvent({source:self,status:"start"});for(var r=0;r<n.length;r++){var s=n[r];s.getElementsByTagName("input")[0].checked&&(e=s.getAttribute("data-id"),d.checkAttrProperty(e,"useInConditions")&&o.push(e))}for(var a=0,l=o;a<l.length;a++){var u=l[a];i.addSimpleCondition({attributeId:u})}i.fireChangedEvent(),t.options.autoClearSelection&&t.deselectAll(),i.fireProcessEvent({source:self,status:"finish"})}))),n.appendChild(u),n.appendChild(c),this.panel.appendChild(n)},e.prototype.checkFilterAttribute=function(t){if(t.querySelector("label input").checked)return!0;var e=t.querySelector("label").textContent;if(this.checkFilterText(e))return!0;var n=t.parentElement.parentElement.querySelector("."+this.cssPrefix+"-entity-node").querySelector("label").textContent;return!!this.checkFilterText(n)},e.prototype.checkFilterText=function(t){var e=this.filterBoxInput.value;return""==e||(0==this.options.filterBoxMode&&t.toLowerCase().indexOf(e.toLowerCase())>=0||1==this.options.filterBoxMode&&0==t.toLowerCase().indexOf(e.toLowerCase()))},e.prototype.refreshCheckedStateByColumns=function(){this.deselectAll();for(var t=0,e=this.context.getQuery().getColumns().filter((function(t){return t.expr.tag===r.ExprTag.EntityAttribute}));t<e.length;t++){var n=e[t],o=this.rootEntityBlock.querySelector("."+this.cssPrefix+'-entity-attr[data-id="'+n.expr.value+'"]'),i=o.querySelector("label > input");i.checked=!0;for(var s=o.parentElement;s&&s.classList.contains(this.cssPrefix+"-entity-children");){s.hidden=!1;var a=s.parentElement;if(!a||s===a.firstElementChild)break;(i=a.firstElementChild.querySelector("label > input")).checked=!0,s=a.parentElement}}},e.prototype.expandAll=function(){for(var t=0;t<this.rootEntityBlock.childNodes.length;t++)for(var e=this.rootEntityBlock.childNodes[0].querySelectorAll("."+this.cssPrefix+"-entity-children"),n=0;n<e.length;n++){e[n].hidden=!1}var o=this.rootEntityBlock.querySelectorAll("."+this.cssPrefix+"-entity-node-button");for(t=0;t<o.length;t++){o[t].classList.add(this.cssPrefix+"-entity-node-button-open")}},e.prototype.collapseAll=function(){for(var t=0;t<this.rootEntityBlock.childNodes.length;t++)for(var e=this.rootEntityBlock.childNodes[0].querySelectorAll("."+this.cssPrefix+"-entity-children"),n=0;n<e.length;n++){e[n].hidden=!0}var o=this.rootEntityBlock.querySelectorAll("."+this.cssPrefix+"-entity-node-button");for(t=0;t<o.length;t++){o[t].classList.remove(this.cssPrefix+"-entity-node-button-open")}},e.prototype.selectAll=function(){for(var t=this.entityTreeBlock.querySelectorAll("input"),e=0;e<t.length;e++){t[e].checked=!0}},e.prototype.deselectAll=function(){for(var t=this.entityTreeBlock.querySelectorAll("input"),e=0;e<t.length;e++){t[e].checked=!1}},e.prototype.renderProgressBlock=function(){this.progressBlock=document.createElement("div"),this.progressBlock.classList.add(a.b+"-progress-win8"),this.progressBlock.classList.add(l.a.getMobileCssClass()),this.progressBlock.innerHTML='<div class="wBall" id="wBall_1"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_2"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_3"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_4"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_5"><div class="wInnerBall"></div></div>'},e.prototype.clear=function(){this.panel.innerHTML=""},e}(r.Widget)},function(module,__webpack_exports__,__webpack_require__){"use strict";var browserUtils;__webpack_require__.d(__webpack_exports__,"a",(function(){return browserUtils})),function(browserUtils){var _isFirefox=null,_isIE=null;function IsIE(){if(null===_isIE){var t=navigator.userAgent;_isIE=t.indexOf("MSIE ")>-1||t.indexOf("Trident/")>-1}return _isIE}function IsEdge(){return!IsIE()&&eval("!!window.StyleMedia")}function IsFirefox(){if(null===_isFirefox){var t=navigator.userAgent;_isFirefox=t.toLowerCase().indexOf("firefox")>-1}return _isFirefox}browserUtils.IsIE=IsIE,browserUtils.IsEdge=IsEdge,browserUtils.IsFirefox=IsFirefox;var _detectedIsMobileMode=!1,_isMobileMode=void 0,detectIsMobileMode=function(){var t=isMobileMode();_detectedIsMobileMode=window.matchMedia("only screen and (max-width: 840px)").matches||window.matchMedia("only screen and (max-height: 420px)").matches;var e=isMobileMode();e!==t&&mobileModeChangeHandler&&mobileModeChangeHandler(e)},mobileModeChangeHandler;function isMobileMode(){return void 0!==_isMobileMode?_isMobileMode:_detectedIsMobileMode}function setIsMobileMode(t){var e=isMobileMode();_isMobileMode=t;var n=isMobileMode();n!==e&&mobileModeChangeHandler&&mobileModeChangeHandler(n)}function onMobileModeChanged(t){mobileModeChangeHandler=t}function getMobileCssClass(){return isMobileMode()?"k-mobile":null}detectIsMobileMode(),window.addEventListener("resize",(function(){return detectIsMobileMode()})),browserUtils.isMobileMode=isMobileMode,browserUtils.setIsMobileMode=setIsMobileMode,browserUtils.onMobileModeChanged=onMobileModeChanged,browserUtils.getMobileCssClass=getMobileCssClass}(browserUtils||(browserUtils={}))},function(t,e,n){"use strict";function o(t,e){var n={9:"[0-9]",a:"[a-z]"},o=e.split(""),i=function(e){if("focus"!==e.type||""===t.value){var i=[],r=t.selectionStart;o.forEach((function(e,o){if(n[e]){var r=new RegExp(n[e],"i").test(t.value.charAt(o));i.push(r?t.value.charAt(o):"_")}else i.push(e)})),t.value=i.join(""),t.selectionStart=t.selectionEnd=r}};t.addEventListener("keydown",(function(e){if(8===e.keyCode||46===e.keyCode){e.preventDefault();var i=[],r=t.selectionStart;if(0==r)return;for(var s=r,a=!0,l=o.length-1;l>=0;l--){var u=o[l];if(n[u]){var c=new RegExp(n[u],"i").test(t.value.charAt(l));c&&l!=r-1&&(a=!1),l===r-1&&s--,i.push(c&&l!=r-1?t.value.charAt(l):"_")}else l===s-1&&s--,r-1===l&&r--,i.push(u)}t.value=a?"":i.reverse().join(""),t.selectionStart=t.selectionEnd=s<0?0:s;var d=document.createEvent("Event");d.initEvent("input",!0,!0),t.dispatchEvent(d)}})),t.addEventListener("keypress",(function(e){var i=String.fromCharCode(e.charCode);if(i){e.preventDefault();var r=[],s=t.selectionStart,a=s;o.forEach((function(e,o){if(n[e]){var l=o!=s?t.value.charAt(o):i,u=new RegExp(n[e],"i").test(l);r.push(u?l:"_"),u&&s===o&&a++}else r.push(e),a===o&&a++,s===o&&s++})),t.value=r.join(""),t.selectionStart=t.selectionEnd=a;var l=document.createEvent("Event");l.initEvent("input",!0,!0),t.dispatchEvent(l)}})),t.addEventListener("input",i),t.addEventListener("focus",i)}n.d(e,"a",(function(){return o}))},function(t,e,n){"use strict";(function(t){n.d(e,"b",(function(){return l})),n.d(e,"a",(function(){return u})),n.d(e,"d",(function(){return c})),n.d(e,"c",(function(){return d}));var o,i=n(0),r=n(71),s=n(6),a=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(){function e(){}return e.prototype.openConfirm=function(e,n,o){var i=this,r={title:e,closable:!1,submitable:!0,cancelable:!0,body:'<div id="kdlg-dialog-confirm">'+n+"</div>"};return o?(r.onSubmit=function(){o(!0)},r.onCancel=function(){o(!1)},void this.open(r)):new t((function(t){r.onSubmit=function(){t(!0)},r.onCancel=function(){t(!1)},i.open(r)}))},e.prototype.openPrompt=function(e,n,o,i){var r=this,s={title:e,submitable:!0,closable:!0,cancelable:!0,submitOnEnter:!0,body:'<div id="kdlg-dialog-form" class="kfrm-form">\n <div class="kfrm-fields label-above">\n <label for="kdlg-dialog-form-input" id="kdlg-dialog-form-content">'+n+'</label>\n <input type="text" name="'+'kdlg-dialog-form-input" id="'+'kdlg-dialog-form-input" />\n </div>\n </div>',arrangeParents:!1,beforeOpen:function(){var t=document.getElementById("kdlg-dialog-form-input");o&&(t.value=o),t.focus()}},a=function(t){var e=document.getElementById("kdlg-dialog-form-input"),n=e.value;return n&&n.replace(/\s/g,"").length>0?(t(n),!0):(e.classList.add("eqjs-invalid"),!1)};return i?(s.onSubmit=function(){return a(i)},s.onCancel=function(){i("")},void this.open(s)):new t((function(t){s.onSubmit=function(){return a(t)},s.onCancel=function(){t("")},r.open(s)}))},e.prototype.open=function(t,e){var n=this,o=new u(t,e),i=t.onDestroy;return t.onDestroy=function(t){n.untrack(t),i&&i(t)},o.open(),this.track(o),o},e.prototype.createSet=function(t){return new d(t,this)},e.prototype.untrack=function(t){var n=e.openDialogs.indexOf(t);n>=0&&e.openDialogs.splice(n,1)},e.prototype.track=function(t){e.openDialogs.push(t)},e.prototype.openProgress=function(t){var e=this,n=new c(t),o=t.onDestroy;return t.onDestroy=function(t){e.untrack(t),o&&o(t)},n.open(),this.track(n),n},e.prototype.getAllDialogs=function(){return Array.from(e.openDialogs)},e.prototype.closeAllDialogs=function(){for(var t=0,n=Array.from(e.openDialogs);t<n.length;t++){n[t].close()}},e.openDialogs=[],e}(),u=function(){function t(t,e){var n=this;this.options=t,this.submitHandler=function(t){return(!n.options.onSubmit||!1!==n.options.onSubmit(n,t))&&(n.destroy(),!0)},this.cancelHandler=function(){n.options.onCancel&&n.options.onCancel(n),n.destroy()},this.keydownHandler=function(t){return 13!=t.keyCode||!n.isActiveDialog()||(t.preventDefault(),t.stopPropagation(),!n.submitHandler())||(window.removeEventListener("keydown",n.keydownHandler,!1),!1)},this.dialogId=i.utils.generateId("dlg"),this.data=e,this.slot=Object(s.e)("div",document.body).attr("tab-index","-1").data("dialog-id",this.dialogId).addClass("kdlg-modal","is-active").focus().addChild("div",(function(t){return t.addClass("kdlg-modal-background")})).addChild("div",(function(o){return n.windowElement=o.addClass("kdlg-modal-window").addChild("header",(function(e){n.headerElement=e.addClass("kdlg-header").addChild("p",(function(e){return e.addClass("kdlg-header-title").addText(t.title)})).toDOM(),!1!==t.closable&&e.addChild("button",(function(t){return t.addClass("kdlg-modal-close").on("click",(function(){n.cancelHandler()})).focus()}))})).addChild("div",(function(t){t.addClass("kdlg-alert-container"),n.alertElement=t.toDOM()})).addChild("section",(function(o){if(n.bodyElement=o.addClass("kdlg-body").toDOM(),"string"==typeof t.body){var r=i.liquid.renderLiquidTemplate(t.body,e);o.addHtml(r)}else o.addChildElement(t.body)})).addChild("footer",(function(e){var o=null;o=t.footerAlignment&&t.footerAlignment==r.a.Center?"align-center":"align-right",n.footerElement=e.addClass("kdlg-footer").toDOM(),e.addClass(o),!1!==t.submitable&&(e.addChild("button",(function(e){e.id(n.dialogId+"-btn-submit").addClass("kfrm-button","is-info").addText(t.submitButtonText||i.i18n.getText("ButtonOK")),t.recaptchaSiteKey?(e.data("sitekey",t.recaptchaSiteKey),e.addClass("g-recaptcha"),e.on("click",(function(e){grecaptcha?grecaptcha.ready((function(){grecaptcha.execute(t.recaptchaSiteKey,{action:"submit"}).then((function(t){n.submitHandler(t)}))})):n.submitHandler()}))):e.on("click",(function(t){n.submitHandler()})),e.focus()})),!1!==t.cancelable&&e.addChild("button",(function(e){return e.id(n.dialogId+"-btn-cancel").addClass("kfrm-button").addText(t.cancelButtonText||i.i18n.getText("ButtonCancel")).on("click",(function(t){n.cancelHandler()}))})))})).toDOM()})).toDOM()}return t.prototype.getData=function(){return this.data},t.prototype.getRootElement=function(){return this.slot},t.prototype.getSubmitButtonElement=function(){return document.getElementById(this.dialogId+"-btn-submit")},t.prototype.getCancelButtonElement=function(){return document.getElementById(this.dialogId+"-btn-cancel")},t.prototype.open=function(){var t=this;this.options.beforeOpen&&this.options.beforeOpen(this),Object(s.e)(this.slot).show(),this.options.arrangeParents&&this.arrangeParents(!0);var e=this.slot.querySelector(".kdlg-modal-window");this.options.height&&(e.style.height="string"==typeof this.options.height?this.options.height:this.options.height+"px"),this.options.width&&(e.style.width="string"==typeof this.options.width?this.options.width:this.options.width+"px"),this.options.submitOnEnter&&window.addEventListener("keydown",this.keydownHandler,!1),this.slot.querySelectorAll("input").forEach((function(e){return e.addEventListener("input",(function(){t.clearAlert(),t.options.onInput&&t.options.onInput(t)}))})),this.options.onShow&&this.options.onShow(this)},t.prototype.submit=function(){this.submitHandler()},t.prototype.cancel=function(){this.cancelHandler()},t.prototype.close=function(){this.destroy()},t.prototype.disableButtons=function(){this.slot.querySelectorAll("button").forEach((function(t){return t.disabled=!0}))},t.prototype.enableButtons=function(){this.slot.querySelectorAll("button").forEach((function(t){return t.disabled=!1}))},t.prototype.showAlert=function(t,e,n){var o=Object(s.e)("div").addClass("kdlg-alert "+(e||"")).addChild("span",(function(t){return t.addClass("kdlg-alert-closebtn").text("×").on("click",(function(t){var e=t.target.parentElement;e.parentElement.removeChild(e)}))})).addText(t).toDOM();!0===n&&this.clearAlert(),this.alertElement.appendChild(o)},t.prototype.clearAlert=function(){this.alertElement.innerHTML=""},t.prototype.destroy=function(){document.querySelectorAll('[data-dialog-id="'+this.dialogId+'"]').length<=0||(this.options.arrangeParents&&this.arrangeParents(!1),document.body.removeChild(this.slot),this.options.submitOnEnter&&window.removeEventListener("keydown",this.keydownHandler,!1),this.options.onDestroy&&this.options.onDestroy(this))},t.prototype.isActiveDialog=function(){var t=document.documentElement.querySelectorAll(".kdlg-modal");return t[t.length-1]===this.slot},t.prototype.arrangeParents=function(t){for(var e=document.documentElement.querySelectorAll(".kdlg-modal-window"),n=0;n<e.length-1;n++)if(t){var o=0==n?20:40*n+20;Object(s.e)(e[n]).setStyle("margin-top",o+"px").setStyle("margin-left",o+"px")}else Object(s.e)(e[n]).removeStyle("margin-top").removeStyle("margin-left")},t}(),c=function(t){function e(e,n){var o,i,r=this,a=Object(s.e)("div").addChild("div",(function(t){return o=t.text(e.content||"").toDOM()})).addChild("div",(function(t){t.addClass("kdlg-progress-line").addChild("div",(function(t){i=t.addClass("fill").toDOM(),e.determinated?t.setStyle("width","0%"):t.addClass("indeterminate")}))})).toDOM();return(r=t.call(this,{title:e.title,body:a,beforeOpen:e.beforeOpen,onSubmit:e.onSubmit,width:e.width,height:e.height,submitable:!1,cancelable:!1,closable:!1,onDestroy:e.onDestroy},n)||this).contentElement=o,r.progressElement=i,r}return a(e,t),e.prototype.updateContent=function(t){this.contentElement.innerText=t},e.prototype.updateProgress=function(t){var e=this;t=this.in01(t),this.progressElement.style.width=100*t+"%",1===t&&setTimeout((function(){e.submit()}),500)},e.prototype.in01=function(t){return t>1?1:t<0?0:t},e}(u),d=function(){function t(t,e){this.options=t,this.dialogService=e,this.currentDialog=null,this.currentIndex=0,this.options=t,this.dialogService=e}return t.prototype.getCurrent=function(){return this.currentDialog},t.prototype.openNext=function(t){return this.open(this.currentIndex+1,t)},t.prototype.openPrev=function(t){return this.open(this.currentIndex-1,t)},t.prototype.open=function(t,e){if(t<0?this.currentIndex=0:t>=this.options.length?this.currentIndex=this.options.length-1:this.currentIndex=t,this.currentDialog)try{this.currentDialog.close()}catch(t){}var n=this.options[this.currentIndex];return this.currentDialog=this.dialogService.open(n,e),this.currentDialog},t.prototype.close=function(){this.currentDialog&&(this.currentDialog.close(),this.currentDialog=null)},t}()}).call(this,n(107))},function(t,e,n){"use strict";var o;n.d(e,"a",(function(){return o})),function(t){t[t.Left=1]="Left",t[t.Center=2]="Center",t[t.Right=3]="Right"}(o||(o={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var o,i=n(0),r=n(2),s=n(1),a=n(9),l=n(4),u=n(3),c=n(97),d=n(74),h=n(30),p=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),f=function(t){function e(e){var n=t.call(this,e)||this;return n.options={isSubQuery:!1,activeColumn:null,showAddRow:!0,showHeader:!0,showColumnTitles:!0,allowAggrColumns:!0,allowDuplicates:!0,allowCustomExpressions:!1,allowSorting:!0,attrElementFormat:"{entity} {attr}",titleElementFormat:null,buttons:null,alwaysShowButtons:!1,accentActiveColumn:!0,allowDragDrop:!0,menuOptions:{showSearchBoxAfter:30,searchBoxAutoFocus:!0,activateOnMouseOver:!0,adjustHeight:!0,itemRenderedCallback:null},attrPlacement:0,sortEntities:!1,columnRenderedCallback:null,customExpressionText:0,allowHiddenColumns:!1,showAddAllForEntity:!1},n.landingSlot=Object(s.domel)("div").addClass(n.cssPrefix+"-col-landing-slot").addChildElement(Object(s.domel)("div").toDOM()).toDOM(),n.landingIndex=-1,n.slot.classList.add(n.cssPrefix+"-panel"),n.group=r.WidgetGroup.Query,n}return p(e,t),Object.defineProperty(e.prototype,"cssPrefix",{get:function(){return"eqjs-qc"},enumerable:!0,configurable:!0}),e.prototype.getWidgetType=function(){return"columnsPanel"},e.prototype.init=function(e,n){var o=this;t.prototype.init.call(this,e,n),this.setOptions(n);var i=e.getModel();this.detachQueryObserver(),this.attachQueryObserver(),s.eqDragManager.removeDropContainer(this.slot),this.options.allowDragDrop&&s.eqDragManager.registerDropContainer({element:this.slot,scopes:["entityAttr","entityAttrSort"],onDragEnter:function(t,e){if(o.slot.classList.add(l.b+"-drophover"),"entityAttrSort"===e.item.scope)o.showLandingSlot(e.pageX,e.pageY);else{var n=e.data.attrId;i.checkAttrProperty(n,"useInResult")||(e.dropEffect=s.DropEffect.Forbid),e.dragImage.classList.add("eqjs-sortable-helper")}},onDragOver:function(t,e){var n=e.data.attrId;("entityAttrSort"===e.item.scope||i.checkAttrProperty(n,"useInResult"))&&o.showLandingSlot(e.pageX,e.pageY)},onDragLeave:function(t,e){"entityAttrSort"===e.item.scope?e.dropEffect=s.DropEffect.Forbid:(e.dragImage.classList.remove("eqjs-sortable-helper"),e.dragImage.style.removeProperty("width")),o.slot.classList.remove(l.b+"-drophover"),o.hideLandingSlot()},onDrop:function(t,e){if("entityAttrSort"==e.item.scope){var n=o.getQuery().getColumns().indexOf(e.data.column);o.moveColumnCore(n,o.landingIndex)}else{var i=e.data.attrId;o.addNewColumn(i,o.landingIndex)}}})},e.prototype.renderBaseElements=function(){var t=this,e=0;if(this.options.showHeader){var n=Object(s.domel)("div",this.slot).hide().addClass(this.cssPrefix+"-header").addClass(u.a.getMobileCssClass()).addChild("div",(function(e){return e.addClass(t.cssPrefix+"-header-expression").text(i.i18n.getText("HeaderExpression"))}));!1!==this.options.showColumnTitles&&n.addChild("div",(function(e){return e.addClass(t.cssPrefix+"-header-title").text(i.i18n.getText("HeaderTitle"))})),this.headerElement=n.toDOM(),e+=this.headerElement.offsetHeight}this.columnsBlock=Object(s.domel)("div",this.slot).addClass(this.cssPrefix+"-columns").addClass(u.a.getMobileCssClass()).toDOM(),this.options.showAddRow&&(this.addRowElement=Object(s.domel)("div",this.slot).addClass(l.b+"-addrow",this.cssPrefix+"-addrow",l.b+"-addrow-empty").addClass(u.a.getMobileCssClass()).addChild("a",(function(e){return e.attr("href","javascript:void(0)").text(i.i18n.getText("CmdClickToAddColumn")).on("click",(function(e){e.preventDefault(),t.showEntitiesMenu({anchor:e.target,selectedIds:null,itemSelectedCallback:function(e,n){if("__AddAll__"===e.id&&e.extra&&Array.isArray(e.extra.ids))e.extra.ids.forEach((function(e){return t.addNewColumn(e)}));else{var o=e.id;t.addNewColumn(o)}return!1}})}))})).toDOM(),e+=this.addRowElement.offsetHeight),this.columnsBlock.style.maxHeight=this.slot.offsetHeight-e-25+"px"},e.prototype.destroyCore=function(){s.eqDragManager.removeDropContainer(this.slot),this.detachQueryObserver(),this.slot.innerHTML=""},e.prototype.attachQueryObserver=function(){var t=this,e=this.getQuery();this.queryEventCallbackId=e.addChangedCallback((function(n){var o=n.data;if(o&&(o.part==r.QueryChangePart.Columns||o.part==r.QueryChangePart.Aggregation||o.part==r.QueryChangePart.All)){var i=document.activeElement,s=t.slot.contains(i)||i==document.body;switch(o.action){case r.QueryChangeAction.Modify:var a=o.changee,l=function(e){var n=t.columnsBlock.querySelector("div[data-id='"+e.id+"']");if(n){var o=t.getColumnRenderer(e,n);if(o){var i=o.render();if(s){var r=i.querySelector("a")||i.querySelector(".eqjs-column-button");r&&r.focus()}}}};Array.isArray(a)?a.forEach((function(t){return l(t)})):l(a),t.agjustHeaderVisibility();break;case r.QueryChangeAction.Add:a=o.changee;var u=function(n){var o=e.getColumns().indexOf(n),i=t.addColumnElement(n,o);s&&i.querySelector("a").focus()};Array.isArray(a)?a.forEach((function(t){return u(t)})):u(a),t.agjustHeaderVisibility();break;case r.QueryChangeAction.Delete:a=o.changee;var c=function(e){var n=t.columnsBlock.querySelector("div[data-id='"+e.id+"']");if(n){var o=n.nextSibling,i=n.previousSibling;if(t.columnsBlock.removeChild(n),s){var r=o||i||t.addRowElement,a=r.querySelector("a")||r.querySelector(".eqjs-column-button");a&&a.focus()}}};t.agjustHeaderVisibility(),Array.isArray(a)?a.forEach((function(t){return c(t)})):c(a);break;default:t.refresh()}}}))},e.prototype.detachQueryObserver=function(){this.queryEventCallbackId&&this.getQuery().removeChangedCallback(this.queryEventCallbackId)},e.prototype.getQuery=function(){return this.getContext().getQuery()},e.prototype.showLandingSlot=function(t,e){for(var n=this.columnsBlock.querySelectorAll("[class*="+this.cssPrefix+"-row]"),o=[],i=0;i<n.length;i++){var r=n[i];"none"!==r.style.display&&o.push(r)}if(0===o.length)return this.landingIndex=0,void this.columnsBlock.appendChild(this.landingSlot);var a=Object(s.getElementAbsolutePos)(this.landingSlot);if(!(e>=a.y&&e<=a.y+this.landingSlot.offsetHeight)){var l=o[0],u=l.offsetHeight,c=Object(s.getElementAbsolutePos)(l),d=e>c.y+u/2?Math.round((e-c.y+u/2)/u):0;d>o.length&&(d=o.length),d!=this.landingIndex&&(this.landingIndex=d,this.landingIndex<o.length?this.columnsBlock.insertBefore(this.landingSlot,o[this.landingIndex]):this.columnsBlock.appendChild(this.landingSlot),this.landingSlot.scrollIntoView({block:"center",behavior:"smooth"}))}},e.prototype.hideLandingSlot=function(){var t=this;this.landingIndex=-1,setTimeout((function(){t.landingSlot.parentElement&&t.landingSlot.parentElement.removeChild(t.landingSlot)}),10)},e.prototype.setOptions=function(t){i.utils.assignDeep(this.options,t),u.a.isMobileMode()&&(this.options.buttons=["menu"],this.options.showHeader=!1)},e.prototype.onProcessStartCore=function(){},e.prototype.onProcessEndCore=function(){},e.prototype.refreshCore=function(){this.clear(),this.render()},e.prototype.clear=function(){this.slot.innerHTML=""},e.prototype.render=function(){try{this.renderBaseElements(),this.createEntitiesMenu(),this.createColumnMenus(),this.agjustHeaderVisibility(),Object(s.domel)(this.slot).removeClass(l.a).addClass(u.a.getMobileCssClass());for(var t=this.context.getQuery().getColumns(),e=0,n=t;e<n.length;e++){var o=n[e];this.columnsBlock.appendChild(this.renderColumn(o))}}catch(t){var i=t;this.context.throwError({action:"ColumnsPanel rendering",text:i.message,sourceError:i})}},e.prototype.agjustHeaderVisibility=function(){if(this.headerElement){var t=this.context.getQuery().getColumns();this.headerElement.style.display=t.length?"":"none"}},e.prototype.renderColumn=function(t){var e=this.getColumnRenderer(t);return e?e.render():null},e.prototype.toggleColumnPicked=function(t){var e,n;t&&(e=this.columnsBlock.querySelector("div[data-id="+t.id+"]"))&&(n=e.classList.contains("active"));for(var o=this.columnsBlock.querySelectorAll("."+this.cssPrefix+"-row"),i=0;i<o.length;i++){var r=o[i];Object(s.domel)(r).removeClass("active"),this.options.alwaysShowButtons||Object(s.domel)(r).data("show-buttons",null)}e&&!n&&Object(s.domel)(e).addClass("active").data("show-buttons","")},e.prototype.addNewColumn=function(t,e){var n,o,i=this,s=this.getContext().getModel(),a=this.getQuery(),l=function(t){var e=s.getAttributeById(t);if(!e)return null;if(!e.useInResult){if(!e.lookupAttr)return null;if(t=e.lookupAttr,!(e=s.getAttributeById(t))||!e.useInResult)return null}var n=a.createColumn();return n.caption=i.getDefaultColumnCaption(e),n.sorting=r.SortDirection.None,n.sortIndex=-1,n.expr.tag=r.ExprTag.EntityAttribute,n.expr.kind=r.DataKind.Attribute,n.expr.dataType=e.dataType,n.expr.setValue(t,!0),n.params.concat(e.params),n};if(Array.isArray(t)){n=[];for(var u=0;u<t.length;u++)(o=l(t[u]))&&n.push(o)}else n=l(t);return this.addColumn(n,e),n},e.prototype.addColumn=function(t,e){var n=this.getQuery();n&&(!(t=Array.isArray(t)?this.checkColumnsArray(t):this.checkColumn(t))||Array.isArray(t)&&0==t.length||(n.addColumnObj(t,e,self),n.fireColumnsChangedEvent(r.QueryChangeAction.Add,t)))},e.prototype.addColumnElement=function(t,e){var n=this.columnsBlock.querySelectorAll("[class*="+this.cssPrefix+"-row]"),o=this.renderColumn(t);return n.length>0&&e<n.length?this.columnsBlock.insertBefore(o,n[e]):(this.columnsBlock.appendChild(o),this.scrollToBottom()),this.options.columnRenderedCallback&&this.options.columnRenderedCallback(o),o},e.prototype.scrollToBottom=function(){this.columnsBlock.scrollTop=this.columnsBlock.scrollHeight-this.columnsBlock.clientHeight},e.prototype.checkColumnsArray=function(t){for(var e=t.length,n=[],o=0;o<e;o++)this.checkColumn(t[o])&&n.push(t[o]);return n},e.prototype.checkColumn=function(t){if(!this.options.allowDuplicates)for(var e=this.getQuery().getColumns(),n=0;n<e.length;n++)if((t.expr.tag===r.ExprTag.EntityAttribute&&e[n].expr.tag===r.ExprTag.EntityAttribute||t.expr.tag===r.ExprTag.ParentEntityAttribute&&e[n].expr.tag===r.ExprTag.ParentEntityAttribute)&&t.expr.value===e[n].expr.value)return null;return t},e.prototype.getDefaultColumnCaption=function(t){var e=this.options.titleElementFormat||this.options.attrElementFormat;return this.getContext().getModel().getAttributeText(t,e)},e.prototype.getColumnsBlock=function(){return this.columnsBlock},e.prototype.getColumnRenderer=function(t,e){switch(t.expr.tag){case r.ExprTag.AggregateFunction:return new c.a(this,t,e);case r.ExprTag.CustomSql:return new d.a(this,t,e);case r.ExprTag.EntityAttribute:case r.ExprTag.ParentEntityAttribute:return new h.a(this,t,e)}return null},e.prototype.areCustomExpressionsAllowed=function(){return this.getQuery().isEx()&&this.options.allowCustomExpressions},e.prototype.addAllColumnsToEntitiesList=function(t){var e=this,n=t.filter((function(t){return!t.isEntity})).map((function(t){return t.id}));n.length>0&&t.unshift({id:"__AddAll__",text:i.i18n.getText("AddAllForEntityText"),extra:{ids:n}}),t.forEach((function(t){t.items&&e.addAllColumnsToEntitiesList(t.items)}))},e.prototype.createEntitiesMenu=function(){var t=this.getContext().getModel();if(!t||t.isEmpty())return null;var e=this.slot.id;e&&(e+="-EntitiesMenu");var n=t.getEntitiesTree({addUIC:!1,addUIR:!0,addUIS:!1,attrPlacement:this.options.attrPlacement,sortEntities:this.options.sortEntities});this.options.showAddAllForEntity&&this.addAllColumnsToEntitiesList(n);var o={id:e,items:n,adjustHeight:this.options.adjustEntitiesMenuHeight,domWriteItemsId:this.options.domWriteItemsId};i.utils.assign(o,this.options.menuOptions),this.entitiesMenu=new a.a(o)},e.prototype.getSortMenuList=function(){return[{id:"None",text:i.i18n.getText("CmdNotSorted")},{id:"Ascending",text:i.i18n.getText("CmdAscending")},{id:"Descending",text:i.i18n.getText("CmdDescending")},{id:"---",text:"---"}]},e.prototype.getMoveMenuList=function(){return[{id:"MoveTop",text:i.i18n.getText("CmdMoveToFirst")},{id:"MoveUp",text:i.i18n.getText("CmdMoveToPrev")},{id:"MoveDown",text:i.i18n.getText("CmdMoveToNext")},{id:"MoveBottom",text:i.i18n.getText("CmdMoveToLast")}]},e.prototype.createSortMenu=function(){var t=this.getContext().getModel();if(!t||t.isEmpty())return null;var e=this.slot.id;e&&(e+="-SortMenu");var n={id:e,items:this.getSortMenuList().concat(this.moveMenu.getItems()),domWriteItemsId:this.options.domWriteItemsId,showSelected:!0};i.utils.assign(n,this.options.menuOptions),n.searchBoxAlwaysShown=!1,this.sortMenu=new a.a(n)},e.prototype.createMoveMenu=function(){var t=this.getContext().getModel();if(!t||t.isEmpty())return null;var e=this.slot.id;e&&(e+="-MoveMenu");var n=i.utils.createArrayFrom(this.getMoveMenuList());this.options.allowHiddenColumns&&(n.push({id:"---",text:"---"}),n.push({id:"IsHidden",text:i.i18n.getText("CmdHiddenColumn")}));var o={items:n,id:e,domWriteItemsId:this.options.domWriteItemsId,showSelected:!0};i.utils.assign(o,this.options.menuOptions),this.moveMenu=new a.a(o),o.searchBoxAlwaysShown=!1},e.prototype.showEntitiesMenu=function(t){this.entitiesMenu.showMenu(t)},e.prototype.moveColumn=function(t,e){var n=this.getQuery().getColumns(),o=n.indexOf(t);if(o>=0)switch(e){case"MoveTop":if(0==o)return;this.moveColumnCore(o,0);break;case"MoveUp":if(0==o)return;this.moveColumnCore(o,o-1);break;case"MoveDown":if(o==n.length-1)return;this.moveColumnCore(o,o+1);break;case"MoveBottom":if(o==n.length-1)return;this.moveColumnCore(o,n.length-1)}},e.prototype.moveColumnCore=function(t,e){var n=this.getQuery();if(n){var o=this.columnsBlock.querySelectorAll("[class*="+this.cssPrefix+"-row]"),i=o[t];0==e?this.columnsBlock.insertBefore(i,this.columnsBlock[0]):e>0&&e<o.length-1?t<e?this.columnsBlock.insertBefore(i,o[e+1]):this.columnsBlock.insertBefore(i,o[e]):this.columnsBlock.appendChild(i),n.moveColumn(t,e),n.fireColumnsChangedEvent()}},e.prototype.createColumnMenus=function(){this.createMoveMenu(),this.options.allowSorting&&this.createSortMenu()},e}(r.Widget)},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return c}));var o,i=n(2),r=n(1),s=n(4),a=n(9),l=n(3),u=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var o=Array(t),i=0;for(e=0;e<n;e++)for(var r=arguments[e],s=0,a=r.length;s<a;s++,i++)o[i]=r[s];return o};!function(t){t[t.Enable=0]="Enable",t[t.Delete=1]="Delete",t[t.Hidden=2]="Hidden",t[t.SortingNone=3]="SortingNone",t[t.SortingAsc=4]="SortingAsc",t[t.SortingDesc=5]="SortingDesc",t[t.MoveTop=6]="MoveTop",t[t.MoveUp=7]="MoveUp",t[t.MoveDown=8]="MoveDown",t[t.MoveBottom=9]="MoveBottom",t[t.Menu=10]="Menu",t[t.Type=11]="Type",t[t.Format=12]="Format"}(o||(o={}));var c=function(){function t(t,e,n){this.functionMenu=null,this.formatsMenu=null,this.buttonMenu=null,this.isMouseOverBlock=!1,this.keepShowingButtons=!1,this.panel=t,this.column=e,this.element=n}return Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"eqjs-qc"},enumerable:!0,configurable:!0}),t.prototype.render=function(){var t=this;this.baseAttr=this.getAttribute(),this.getButtonsToShow().indexOf("sorting")>=0&&this.column.enabled&&(this.sortingButton=this.renderSoringButton(this.column.sorting),this.column.sorting!==i.SortDirection.None&&(this.sortingButton.style.display="block"));var e=Object(r.domel)("div");return e.data("id",this.column.id),this.element&&this.element.parentNode.replaceChild(e.toDOM(),this.element),this.element=e.toDOM(),this.panel.options.allowDragDrop&&!l.a.isMobileMode()&&r.eqDragManager.registerDraggableItem({element:this.element,scope:"entityAttrSort",data:{column:this.column},beforeDragStart:function(){t.hideButtons()},renderer:function(e){e.innerHTML="";var n=document.createElement("span");n.innerText=t.column.caption,e.classList.add("eqjs-sortable-helper"),e.appendChild(n)},onDragStart:function(e){t.element.style.display="none",e.dropEffect=r.DropEffect.Allow},onDragEnd:function(e){e.data.finishedSuccessfully||t.element.style.removeProperty("display")}}),this.isEditable()&&(this.createFunctionMenu(),this.createFormatsMenu()),this.createButtonMenu(),e.addClass(this.getClassesToAdd()).addClass(l.a.getMobileCssClass()).addChildElement(this.renderCheckbox()).addChild("div",(function(e){return e.addClass(s.b+"-button-placeholder",t.cssPrefix+"-button-placeholder",t.cssPrefix+"-colelement",t.cssPrefix+"-sortbutton-placeholder").addChildElement(t.sortingButton)})).addChildElement(this.renderExpressionBlock()),!1===this.panel.options.showColumnTitles||l.a.isMobileMode()||e.addChildElement(this.renderCaptionBlock()),e.addChild("div",(function(e){e.addClass(s.b+"-column-buttonsBlock",t.cssPrefix+"-buttonsBlock").addClass(l.a.getMobileCssClass()),t.getButtonsToShow().indexOf("enable")>=0&&!t.column.isReadOnly()&&e.addChildElement(t.renderEnabledButton()),t.getButtonsToShow().indexOf("type")>=0&&t.column.enabled&&e.addChildElement(t.renderColumnTypeButton()),t.getButtonsToShow().indexOf("format")>=0&&t.column.enabled&&e.addChildElement(t.renderColumnFormatButton()),t.getButtonsToShow().indexOf("delete")>=0&&!t.column.isReadOnly()&&e.addChildElement(t.renderDeleteButton()),t.getButtonsToShow().indexOf("menu")>=0&&!t.column.isReadOnly()&&e.addChildElement(t.renderMenuButton())})),l.a.isMobileMode()||e.on("mouseenter",this.onMouseEnter.bind(this)).on("mouseleave",this.onMouseLeave.bind(this)),(this.panel.options.accentActiveColumn||l.a.isMobileMode())&&e.on("click",this.onMouseClick.bind(this)),this.panel.options.alwaysShowButtons&&this.showButtons(),this.element},t.prototype.onMouseClick=function(t){return t.stopPropagation(),this.panel.toggleColumnPicked(this.column),this.adjustButtonsVisibility(),l.a.isMobileMode()||this.element.dispatchEvent(Object(r.createBrowserEvent)("mouseenter")),!1},t.prototype.fireColumnChanged=function(){this.column.fireChangedEvent()},t.prototype.refresh=function(){this.render()},t.prototype.getAttribute=function(){return this.panel.getContext().getModel().getAttributeByIdSafe(this.column.expr.value)},t.prototype.renderCaptionBlock=function(){var t=this;this.column.caption&&""!=this.column.caption||(this.column.caption=this.getDefaultColumnCaption());var e=Object(r.domel)("div").addClass(this.cssPrefix+"-colelement",this.cssPrefix+"-captionelement").addClass(l.a.getMobileCssClass());return this.isEditable()?e.addChild("a",(function(e){return e.attr("href","javascript:void(0)").title(t.column.caption).text(t.column.caption).on("click",(function(e){e.stopPropagation();var n=e.target,o=n.parentElement.querySelector("input");return o&&(n.style.display="none",o.style.removeProperty("display"),o.style.minWidth=""+n.clientWidth,o.focus(),t.element.setAttribute(r.eqDragManager.DRAG_DISABLED_ATTR,"")),!1}))})).addChild("input",(function(e){return e.hide().value(t.column.caption).on("blur keydown",(function(e){var n=!1,o=!0;if(e instanceof KeyboardEvent?13===e.keyCode?n=!0:27===e.keyCode&&(n=!0,o=!1):e instanceof FocusEvent&&(n=!0),n){var i=e.target,a=i.parentElement.querySelector("a");a&&(a.style.removeProperty("display"),i.style.display="none"),o&&t.column.caption!==i.value?(t.column.caption=i.value,t.fireColumnChanged()):(i.value=t.column.caption,Object(s.d)(a)),t.element.removeAttribute(r.eqDragManager.DRAG_DISABLED_ATTR)}return!0}))})):e.addChild("span",(function(e){e.text(t.column.caption).title(t.column.caption)})),e.toDOM()},t.prototype.renderSoringButton=function(t){var e,n=this,a=s.b+"-column-sortbutton";switch(t){case i.SortDirection.Ascending:e=a+"-asc";break;case i.SortDirection.Descending:e=a+"-desc";break;default:e=a+"-none"}return this.isEditable()?Object(r.domel)("div").addClass(a,s.b+"-button",e).data("btnplaceholder","").title(i.i18n.getText("ButtonSorting")).attr("tabIndex","0").on("click",(function(t){t.stopPropagation(),n.keepShowingButtons=!0,(n.getUIS()&&n.panel.sortMenu||n.panel.moveMenu).showMenu({anchor:n.sortingButton,selectedIds:n.column.isHidden()?["IsHidden"]:null,itemSelectedCallback:function(t,e){var i;switch(t.id){case"IsHidden":i=o.Hidden;break;case"MoveTop":i=o.MoveTop;break;case"MoveDown":i=o.MoveDown;break;case"MoveUp":i=o.MoveUp;break;case"MoveBottom":i=o.MoveBottom;break;case"None":i=o.SortingNone;break;case"Ascending":i=o.SortingAsc;break;case"Descending":i=o.SortingDesc}n.buttonMenuHandler(i,null)},menuClosedCallback:function(){n.keepShowingButtons=!1,n.isMouseOverBlock||n.leaveButtonBlock()}})})).on("keypress",(function(t){13==t.keyCode&&t.target.click()})).toDOM():t===i.SortDirection.Ascending||t===i.SortDirection.Descending?Object(r.domel)("div").addClass(a,s.b+"-button",e).title(i.i18n.getText("ButtonSorting")).toDOM():null},t.prototype.renderCheckbox=function(){var t=this;return this.panel.options.showCheckboxes&&!this.column.isReadOnly()?Object(r.domel)("div").title(i.i18n.getText("CmdToggleEnable")).attr("tabIndex","0").addClass(this.cssPrefix+"-colelement "+this.cssPrefix+"-column-checkbox").addClass(this.column.enabled?"enabled":"").on("click",(function(){return t.column.enabled=!t.column.enabled,t.column.fireChangedEvent(),!1})).on("keypress",(function(t){[13,32].includes(t.keyCode)&&t.target.click()})).toDOM():null},t.prototype.renderDeleteButton=function(){var t=this;return Object(r.domel)("div").addClass(s.b+"-button-placeholder",this.cssPrefix+"-button-placeholder",this.cssPrefix+"-deletebutton-placeholder").data("btnplaceholder","").addChild("div",(function(e){return e.addClass(s.b+"-button",s.b+"-column-button",s.b+"-column-button-delete").title(i.i18n.getText("CmdDelete")).attr("tabIndex","0").on("click",(function(e){return t.buttonMenuHandler(o.Delete,e)})).on("keypress",(function(t){13==t.keyCode&&t.target.click()}))})).toDOM()},t.prototype.renderMenuButton=function(){var t=this;return Object(r.domel)("div").addClass(s.b+"-button-placeholder",this.cssPrefix+"-button-placeholder",this.cssPrefix+"-menubutton-placeholder").data("btnplaceholder","").addChild("div",(function(e){return e.addClass(s.b+"-button",s.b+"-column-button",s.b+"-column-button-menu").title(i.i18n.getText("ButtonMenu")).attr("tabIndex","0").on("click",(function(e){return t.buttonMenuHandler(o.Menu,e)})).on("keypress",(function(t){13==t.keyCode&&t.target.click()}))})).toDOM()},t.prototype.getDefaultColumnCaption=function(){return this.getDefaultTitleText(this.baseAttr)},t.prototype.getDefaultTitleText=function(t){return this.getAttributeCaption(t,this.panel.options.titleElementFormat)},t.prototype.getAttributeCaption=function(t,e){return e=e||this.panel.options.attrElementFormat,this.panel.getContext().getModel().getAttributeText(t,e)},t.prototype.getClassesToAdd=function(){var t="";return t+=this.column.enabled?"":" "+this.cssPrefix+"-disabled",this.column.enabled&&(t+=this.column.isReadOnly()?" "+this.cssPrefix+"-readonly":""),t+=this.column.isHidden()?" "+this.cssPrefix+"-hidden":""},t.prototype.renderColumnTypeButton=function(){var t=this;return this.isEditable()&&!1!==this.panel.options.allowAggrColumns?Object(r.domel)("div").addClass(s.b+"-button-placeholder",this.cssPrefix+"-button-placeholder",this.cssPrefix+"-typebutton-placeholder",this.cssPrefix+"-button-active").data("btnplaceholder","").addChild("div",(function(e){return e.addClass(s.b+"-button",s.b+"-column-button",s.b+"-column-button-type").title(i.i18n.getText("ButtonToAggr")).attr("tabIndex","0").on("click",(function(e){e.stopPropagation(),t.keepShowingButtons=!0,t.changeTypeHandler(e)})).on("keypress",(function(t){13==t.keyCode&&t.target.click()}))})).toDOM():null},t.prototype.renderColumnFormatButton=function(){var t=this,e=this.getFormatsMenuItems();return this.isEditable()&&!1!==this.panel.options.allowDisplayFormatChange&&e.length>1?Object(r.domel)("div").addClass(s.b+"-button-placeholder",this.cssPrefix+"-button-placeholder",this.cssPrefix+"-formatbutton-placeholder",this.cssPrefix+"-button-active").data("btnplaceholder","").addChild("div",(function(e){return e.addClass(s.b+"-button",s.b+"-column-button",s.b+"-column-button-format").title(i.i18n.getText("ButtonFormat")).attr("tabIndex","0").on("click",(function(e){e.stopPropagation(),t.keepShowingButtons=!0,t.changeFormatHandler(e)})).on("keypress",(function(t){13==t.keyCode&&t.target.click()}))})).toDOM():null},t.prototype.renderEnabledButton=function(){var t=this;return Object(r.domel)("div").addClass(s.b+"-button-placeholder",this.cssPrefix+"-button-placeholder",this.cssPrefix+"-enablebutton-placeholder",this.cssPrefix+"-button-active").data("btnplaceholder","").addChild("div",(function(e){return e.addClass(s.b+"-button",s.b+"-column-button",s.b+"-column-button-enable").title(i.i18n.getText("CmdToggleEnable")).addClass(t.column.enabled?"enabled":"").attr("tabIndex","0").on("click",(function(e){return t.buttonMenuHandler(o.Enable,e)})).on("keypress",(function(t){13==t.keyCode&&t.target.click()}))})).toDOM()},t.prototype.isEditable=function(){return this.column.enabled&&!this.column.isReadOnly()},t.prototype.changeFormatHandler=function(t){var e=this,n=this.panel.getContext().getModel().getDisplayFormatsForType(this.column.getDataType()),o="{0:__default}";n.filter((function(t){return t.format==e.column.displayFormat})).length>0&&(o=this.column.displayFormat),this.formatsMenu.showMenu({anchor:t.target,selectedIds:o,itemSelectedCallback:function(t,n){return t.id!=o&&("{0:__default}"==t.id?e.column.displayFormat="":e.column.displayFormat=t.id,e.column.fireChangedEvent()),!1},menuClosedCallback:function(){e.keepShowingButtons=!1,e.isMouseOverBlock||e.element.dispatchEvent(Object(r.createBrowserEvent)("mouseleave"))}})},t.prototype.getUIS=function(){return this.panel.getContext().getModel().checkAttrProperty(this.column.expr.value,"useInSorting")},t.prototype.onMouseEnter=function(t){return this.isMouseOverBlock=!0,this.enterButtonBlock(),t.stopPropagation(),!1},t.prototype.onMouseLeave=function(t){return this.isMouseOverBlock=!1,this.leaveButtonBlock(),t.stopPropagation(),!1},t.prototype.isColumnActive=function(){return this.element.classList.contains("active")},t.prototype.hideButtons=function(){Object(r.domel)(this.element).data("show-buttons",null)},t.prototype.showButtons=function(){Object(r.domel)(this.element).data("show-buttons","")},t.prototype.adjustButtonsVisibility=function(){(this.panel.options.alwaysShowButtons||(this.panel.options.accentActiveColumn||l.a.isMobileMode())&&this.isColumnActive())&&this.showButtons()},t.prototype.enterButtonBlock=function(){this.showButtons()},t.prototype.leaveButtonBlock=function(){this.keepShowingButtons||!0===this.panel.options.alwaysShowButtons||this.isColumnActive()&&1==this.panel.options.accentActiveColumn||this.hideButtons()},t.prototype.createFunctionMenu=function(){for(var t,e=[],n=this.panel.getContext().getModel().getAggrFunctions(),o=!0,r=null,s=this.column.getDataType(),l=0,u=n;l<u.length;l++){var c=u[l];if(c){var d=c.getAppliedTypesOrDefault().indexOf(s)>=0;this.column.expr.func!==c.id||d||(o=!1),d&&(t=this.panel.getContext().getModel().getAggrFunctionCaption(c.id),r={id:c.id,text:t},e.push(r))}}o||(this.column.expr.func=e[0].id),this.panel.areCustomExpressionsAllowed()&&(r={id:"CustomSqlDivider",text:"---"},e.push(r),r={id:"CUSTOMSQL",text:t=i.i18n.getText("CustomExpression")},e.push(r));var h=this.column.id;h&&(h+="-FunctionsMenu");var p={items:e,id:h,searchBoxAlwaysShown:!1,domWriteItemsId:!0};this.functionMenu=new a.a(p)},t.prototype.createFormatsMenu=function(){if(0!=this.panel.options.allowDisplayFormatChange){var t=this.column.id;t&&(t+="-FormatsMenu");var e={items:this.getFormatsMenuItems(),id:t,searchBoxAlwaysShown:!1,showSelected:!0,domWriteItemsId:!0};this.formatsMenu=new a.a(e)}},t.prototype.getFormatsMenuItems=function(){var t=this.panel.getContext().getModel().getDisplayFormatsForType(this.column.getDataType());return[{id:"{0:__default}",text:"Default"}].concat(t.map((function(t){return{id:t.format,text:i.i18n.getText("DisplayFormats",t.name)||t.name}})))},t.prototype.getButtonsToShow=function(){return this.panel.options.buttons&&Array.isArray(this.panel.options.buttons)?this.panel.options.buttons:["enable","delete","type","sorting","format"]},t.prototype.buttonMenuHandler=function(t,e){var n=this;switch(t){case o.Delete:var r=this.column.getQuery();r.removeColumn(this.column,this.panel),r.fireColumnsChangedEvent(i.QueryChangeAction.Delete,this.column);break;case o.Enable:this.column.enabled=!this.column.enabled,this.fireColumnChanged();break;case o.Hidden:this.column.setHidden(!this.column.isHidden()),this.fireColumnChanged();break;case o.MoveTop:this.panel.moveColumn(this.column,"MoveTop");break;case o.MoveBottom:this.panel.moveColumn(this.column,"MoveBottom");break;case o.MoveUp:this.panel.moveColumn(this.column,"MoveUp");break;case o.MoveDown:this.panel.moveColumn(this.column,"MoveDown");break;case o.SortingAsc:this.column.sorting=i.SortDirection.Ascending,this.column.fireChangedEvent();break;case o.SortingDesc:this.column.sorting=i.SortDirection.Descending,this.column.fireChangedEvent();break;case o.SortingNone:this.column.sorting=i.SortDirection.None,this.column.fireChangedEvent();break;case o.Menu:var s=this.buttonMenu;this.keepShowingButtons=!0,s.showMenu({anchor:e?e.target:null,selectedIds:this.getButtonMenuSelectedItems(),itemSelectedCallback:function(t){var i=t.id;switch(t.id){case"enable":i=o.Enable;break;case"delete":i=o.Delete;break;case"hidden":i=o.Hidden;break;case"MoveTop":i=o.MoveTop;break;case"MoveBottom":i=o.MoveBottom;break;case"MoveUp":i=o.MoveUp;break;case"MoveDown":i=o.MoveDown;break;case"None":i=o.SortingNone;break;case"Ascending":case"Descending":i=o.SortingAsc}n.buttonMenuHandler(i,e)},itemFilterCallback:function(t){return n.column.enabled||"__group"===t.id||"enable"===t.id||"delete"===t.id},menuClosedCallback:function(){n.keepShowingButtons=!1,n.isMouseOverBlock||n.leaveButtonBlock()}});break;default:this.processFormatsButtonMenuItems(t,e)||this.processExtraButtonMenuItems(t,e)}return e&&e.stopPropagation(),!1},t.prototype.createButtonMenu=function(){if(!this.buttonMenu){var t=this.column.id;t&&(t+="-ButtonMenu");var e=[];e.push({id:"enable",text:i.i18n.getText("MenuEnable")}),this.panel.options.allowHiddenColumns&&e.push({id:"hidden",text:i.i18n.getText("CmdHiddenColumn")}),e.push({id:"delete",text:i.i18n.getText("CmdDelete")});var n=[];n.push({id:"__group",text:" ",items:e});var o=this.panel.options.allowSorting?u(this.panel.getSortMenuList(),this.panel.getMoveMenuList()):this.panel.getMoveMenuList();n.push({id:"__group",text:i.i18n.getText("CmdGroupSort"),items:o});var r=this.getExtraButtonMenuItems();r&&Array.isArray(r)&&(n=u(n,r));var s=this.getFormatsMenuItems();s.length>1&&n.push({id:"__group",text:i.i18n.getText("CmdGroupFormat"),items:s});var l={items:n,id:t,searchBoxAlwaysShown:!1,domWriteItemsId:!0,showSelected:!0};this.buttonMenu=new a.a(l)}},t.prototype.processFormatsButtonMenuItems=function(t,e){var n=this.panel.getContext().getModel().getDisplayFormatsForType(this.column.getDataType());if("{0:__default}"==t)this.column.displayFormat="";else{if(!(n.filter((function(e){return e.format==t})).length>0))return!1;this.column.displayFormat=t}return this.column.fireChangedEvent(),!0},t.prototype.getButtonMenuSelectedItems=function(){var t=this,e=[];this.column.enabled&&e.push("enable"),this.column.isHidden()&&e.push("hidden");var n="{0:__default}";return this.panel.getContext().getModel().getDisplayFormatsForType(this.column.getDataType()).filter((function(e){return e.format==t.column.displayFormat})).length>0&&(n=this.column.displayFormat),e.push(n),e},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var o,i=n(0),r=n(2),s=n(1),a=n(30),l=n(3),u=n(9),c=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.dataTypeMenu=null,e}return c(e,t),e.prototype.getClassesToAdd=function(){return this.cssPrefix+"-row "+this.cssPrefix+"-row-column-entattr"+t.prototype.getClassesToAdd.call(this)},e.prototype.renderColumnTypeButton=function(){var e=t.prototype.renderColumnTypeButton.call(this);return e&&(e.firstElementChild.classList.add("aggregated"),e.firstElementChild.setAttribute("title",i.i18n.getText("ButtonToSimple"))),e},e.prototype.renderExpressionBlock=function(){var t=this;this.column.caption&&""!=this.column.caption||(this.column.caption=this.getDefaultColumnCaption());var e=Object(s.domel)("div").addClass(this.cssPrefix+"-expr-block").addClass(l.a.getMobileCssClass()).toDOM(),n=Object(s.domel)("div",e).addClass(this.cssPrefix+"-colelement",this.cssPrefix+"-attrelement").addClass(l.a.getMobileCssClass());return this.isEditable()?n.addChild("a",(function(e){return e.attr("href","javascript:void(0)").title(t.column.caption).text(t.column.caption).on("touchstart click",(function(e){e.stopPropagation();var n=e.target,o=n.parentElement.querySelector("input");o&&(n.style.display="none",o.style.removeProperty("display"),o.style.width="100%",o.focus(),t.element.setAttribute(s.eqDragManager.DRAG_DISABLED_ATTR,""))}))})).addChild("input",(function(e){return e.hide().value(t.column.expr.sql).on("blur keydown",(function(e){var n=!1,o=!0;if(e instanceof KeyboardEvent?13===e.keyCode?n=!0:27===e.keyCode&&(n=!0,o=!1):e instanceof FocusEvent&&(n=!0),n){var i=e.target,r=i.parentElement.querySelector("a");r&&(r.style.removeProperty("display"),i.style.display="none"),o&&t.column.expr.sql!==i.value?(t.column.expr.sql=i.value,t.fireColumnChanged()):i.value=t.column.expr.sql,t.element.removeAttribute(s.eqDragManager.DRAG_DISABLED_ATTR)}}))})):n.addChild("span",(function(e){e.text(t.column.caption).title(t.column.caption)})),n=Object(s.domel)("div",e).addClass(this.cssPrefix+"-colelement").addChild("span",(function(t){t.text(":").title(":")})),n=Object(s.domel)("div",e).addClass(this.cssPrefix+"-colelement",this.cssPrefix+"-attrelement").addClass(l.a.getMobileCssClass()),this.isEditable()?(this.createDataTypeMenu(),n.addChild("a",(function(e){return e.attr("href","javascript:void(0)").title(i.DataType[t.column.expr.dataType]).text(i.DataType[t.column.expr.dataType]).on("touchstart click",(function(n){n.stopPropagation(),t.dataTypeMenu.showMenu({anchor:e.toDOM(),selectedIds:null,itemSelectedCallback:function(e,n){t.column.expr.dataType=e.id,t.fireColumnChanged()}})}))}))):(this.column.expr.dataType,n.addChild("span",(function(e){e.text(i.DataType[t.column.expr.dataType]).title(i.DataType[t.column.expr.dataType])}))),e},e.prototype.changeTypeToSimple=function(){this.column.getQuery().changeColumnType(this.column,r.ExprTag.EntityAttribute),this.fireColumnChanged()},e.prototype.getDefaultColumnCaption=function(){return"Custom SQL Column"},e.prototype.getDefaultValue=function(){return this.column.expr.sql},e.prototype.getUIS=function(){return!0},e.prototype.changeTypeHandler=function(t){this.changeTypeToSimple()},e.prototype.processExtraButtonMenuItems=function(t,e){return this.changeTypeToSimple(),!0},e.prototype.createFunctionMenu=function(){},e.prototype.getExtraButtonMenuItems=function(){return[{id:"__group",text:i.i18n.getText("ColTypeGroup"),items:[{id:"type",text:i.i18n.getText("ColTypeSimple")}]}]},e.prototype.createDataTypeMenu=function(){var t=[];for(var e in i.DataType)if(!isNaN(Number(e))){var n={id:e,text:i.DataType[e]};t.push(n)}var o=this.column.id;o&&(o+="-DataTypeMenu");var r={items:t,id:o,searchBoxAlwaysShown:!1,domWriteItemsId:!0};this.dataTypeMenu=new u.a(r)},e}(a.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var o,i=n(0),r=n(2),s=n(41),a=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.getClassesToAdd=function(){return t.prototype.getClassesToAdd.call(this)+" "+this.cssPrefix+"-row "+this.cssPrefix+"-row-column-aggr"},e.prototype.getAttribute=function(){return this.bar.getContext().getModel().getAttributeByIdSafe(this.column.expr.args[0].value)},e.prototype.getDefaultCaption=function(){return this.getDefaultTitleText(this.baseAttr)+" "+this.bar.getContext().getModel().getAggrFunctionCaption(this.column.expr.func)},e.prototype.renderColumnTypeButton=function(){var e=t.prototype.renderColumnTypeButton.call(this);return e&&(e.classList.add("aggregated"),e.title=i.i18n.getText("ButtonToSimple")),e},e.prototype.baseExpressionItemSelectedCallback=function(t,e){var n=t.id;this.column.expr.args[0].setValue(n,!0),this.column.caption="",this.fireColumnChanged()},e.prototype.changeTypeToSimple=function(){this.column.getQuery().changeColumnType(this.column,r.ExprTag.EntityAttribute),this.fireColumnChanged()},e.prototype.changeColumnTypeHandler=function(t){this.changeTypeToSimple()},e}(s.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var o=n(0),i=n(2),r=n(1),s=n(4),a=n(3),l=n(9),u=function(){function t(t,e,n){this.functionMenu=null,this.formatsMenu=null,this.isMouseOverBlock=!1,this.keepShowingButtons=!1,this.tapedTwice=!1,this.bar=t,this.column=e,this.element=n}return Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"eqjs-cb"},enumerable:!0,configurable:!0}),t.prototype.render=function(){var t=this;this.baseAttr=this.getAttribute();var e=Object(r.domel)("div");return e.data("id",this.column.id),this.element&&this.element.parentNode.replaceChild(e.toDOM(),this.element),this.element=e.toDOM(),this.bar.options.allowDragDrop&&r.eqDragManager.registerDraggableItem({element:this.element,scope:"entityAttrSort",beforeDragStart:function(){return t.element.dispatchEvent(Object(r.createBrowserEvent)("mouseleave"))},onDragStart:function(e){t.hideButtons(),t.element.style.display="none",e.dropEffect=r.DropEffect.Allow},onDragEnd:function(e){e.data.finishedSuccessfully||t.element.removeAttribute("style")},data:{column:this.column}}),this.column.isReadOnly()||(this.createFunctionMenu(),this.createFormatsMenu()),e.addClass(this.getClassesToAdd()).addClass(a.a.getMobileCssClass()).addChildElement(this.renderCaptionBlock()).addChildElement(this.renderSortingImage()),a.a.isMobileMode()||e.addChildElement(this.renderButtonsBlock()),e.on("mouseenter",this.onMouseEnter.bind(this)).on("mouseleave",this.onMouseLeave.bind(this)),(this.bar.options.accentActiveColumn||a.a.isMobileMode())&&e.on("touchstart click",this.onMouseClick.bind(this)),this.element},t.prototype.fireColumnChanged=function(){this.column.fireChangedEvent()},t.prototype.refresh=function(){this.render()},t.prototype.getAttribute=function(){return this.bar.getContext().getModel().getAttributeByIdSafe(this.column.expr.value)},t.prototype.isEditable=function(){return this.column.enabled&&!this.column.isReadOnly()},t.prototype.renderButtonsBlock=function(){return Object(r.domel)("div",this.element).addClass(s.b+"-column-buttonsBlock",this.cssPrefix+"-buttonsBlock").addChildElement(this.renderSortingButton()).addChildElement(this.renderColumnTypeButton()).addChildElement(this.renderColumnFormatButton()).addChildElement(this.renderDeleteButton()).toDOM()},t.prototype.renderCaptionBlock=function(){var t=this;this.column.caption&&""!=this.column.caption||(this.column.caption=this.getDefaultCaption());var e=this.column.getModel(),n=this.baseAttr!==e.nullAttribute?this.column.caption:e.getAttributeText(e.nullAttribute,"{attr}");if(!this.isEditable())return Object(r.domel)("div").addClass(this.cssPrefix+"-colelement",this.cssPrefix+"-captionelement").addClass(a.a.getMobileCssClass()).addChild("div",(function(e){return e.title(t.column.caption).text(n).attr("tabIndex","0")})).toDOM();var o=!1;return Object(r.domel)(this.element).on("touchstart dblclick",(function(e){if(e instanceof TouchEvent&&!t.tapedTwice)return t.tapedTwice||(t.tapedTwice=!0,setTimeout((function(){t.tapedTwice=!1}),300)),!0;e.stopPropagation(),o=t.element.querySelector("a")==document.activeElement;var n=t.element.querySelector("."+t.cssPrefix+"-captionelement input"),i=t.element.querySelector("."+t.cssPrefix+"-captionelement a");return n&&(n.style.width=t.element.clientWidth+"px",i.style.display="none",n.style.removeProperty("display"),n.focus(),t.element.setAttribute(r.eqDragManager.DRAG_DISABLED_ATTR,"")),!1})),Object(r.domel)("div").addClass(this.cssPrefix+"-colelement",this.cssPrefix+"-captionelement").addClass(a.a.getMobileCssClass()).addChild("a",(function(e){return e.attr("href","javascript:void(0)").title(t.column.caption).text(n).on("keydown",(function(e){var n=e;if((n.ctrlKey||n.metaKey)&&(13==n.keyCode||10==n.keyCode)&&t.isColumnActive()){var o=document.createEvent("MouseEvents");return o.initEvent("dblclick",!0,!0),t.element.dispatchEvent(o),n.stopPropagation(),!1}return!0}))})).addChild("input",(function(e){return e.hide().value(t.column.caption).on("blur keydown",(function(e){var n=!1,i=!0;if(e instanceof KeyboardEvent?13===e.keyCode?n=!0:27===e.keyCode&&(n=!0,i=!1):e instanceof FocusEvent&&(n=!0),n){var s=e.target,a=s.parentElement.querySelector("a");a&&(a.style.removeProperty("display"),s.style.display="none"),i&&t.column.caption!==s.value?(t.column.caption=s.value,t.fireColumnChanged()):s.value=t.column.caption,t.element.removeAttribute(r.eqDragManager.DRAG_DISABLED_ATTR),o&&t.element.querySelector("a").focus()}}))})).toDOM()},t.prototype.renderSortingImage=function(){var t=this,e=s.b+"-column-sortbutton",n=e;switch(this.column.sorting){case i.SortDirection.Ascending:n=e+"-asc";break;case i.SortDirection.Descending:n=e+"-desc"}return this.column.sorting==i.SortDirection.None?null:Object(r.domel)("div").addClass(this.cssPrefix+"-colelement",this.cssPrefix+"-sortimage-placeholder").addClass(a.a.getMobileCssClass()).addChild("div",(function(e){return e.addClass(t.cssPrefix+"-img-sorting",n).title(o.i18n.getText("ButtonSorting"))})).toDOM()},t.prototype.buttonSortingClickHandler=function(t,e){var n=this;return t.stopPropagation(),this.keepShowingButtons=!0,(this.getUIS()&&this.bar.sortMenu||this.bar.moveMenu).showMenu({anchor:e,selectedIds:null,itemSelectedCallback:function(t,e){var o;if("None"==t.id||"Ascending"==t.id||"Descending"==t.id){var r=n.bar.getQuery();n.column.sorting="None"==(o=t.id)?i.SortDirection.None:"Ascending"==o?i.SortDirection.Ascending:"Descending"==o?i.SortDirection.Descending:void 0,n.column.sortIndex=r.getColumnSortIndex(n.column),n.fireColumnChanged()}else n.bar.moveColumn(n.column,t.id)},menuClosedCallback:function(){n.keepShowingButtons=!1,n.isMouseOverBlock||n.leaveButtonBlock()}}),!1},t.prototype.renderSortingButton=function(){var t=this;if(!this.isEditable())return null;var e=Object(r.domel)("div").addClass(s.b+"-column-button",s.b+"-column-sortbutton",s.b+"-column-sortbutton-none").title(o.i18n.getText("ButtonSorting")).attr("tabIndex","0").on("touchstart click",(function(n){return t.buttonSortingClickHandler(n,e.toDOM())})).on("keypress",(function(t){13==t.keyCode&&t.target.click()}));return e.toDOM()},t.prototype.buttonDeleteClickHandler=function(t){t.stopPropagation();var e=this.bar.getQuery();return e.removeColumn(this.column,this.bar),e.fireColumnsChangedEvent(i.QueryChangeAction.Delete,this.column),!1},t.prototype.renderDeleteButton=function(){var t=this;return this.column.isReadOnly()?null:Object(r.domel)("div").addClass(s.b+"-column-button",s.b+"-column-button-delete").title(o.i18n.getText("CmdDelete")).attr("tabIndex","0").on("touchstart click",(function(e){return t.buttonDeleteClickHandler(e)})).on("keypress",(function(t){13==t.keyCode&&t.target.click()})).toDOM()},t.prototype.getDefaultCaption=function(){return this.getDefaultTitleText(this.baseAttr)},t.prototype.getDefaultTitleText=function(t){var e=this.bar.options.titleElementFormat||this.bar.options.attrElementFormat;return this.bar.getContext().getModel().getAttributeText(t,e)},t.prototype.getClassesToAdd=function(){var t="";return t+=this.column.enabled?"":" "+this.cssPrefix+"-disabled",this.column.enabled&&(t+=this.column.isReadOnly()?" "+this.cssPrefix+"-readonly":""),t},t.prototype.buttonTypeClickHandler=function(t){return t.stopPropagation(),this.keepShowingButtons=!0,this.changeColumnTypeHandler(t),!1},t.prototype.buttonFormatClickHandler=function(t){return t.stopPropagation(),this.keepShowingButtons=!0,this.changeFormatHandler(t),!1},t.prototype.formatButtonIsShown=function(){return!1!==this.bar.options.allowDisplayFormatChange&&this.bar.getContext().getModel().getDisplayFormatsForType(this.column.getDataType()).length>0},t.prototype.changeFormatHandler=function(t){var e=this,n=this.bar.getContext().getModel().getDisplayFormatsForType(this.column.getDataType()),o="{0:__default}";n.filter((function(t){return t.format==e.column.displayFormat})).length>0&&(o=this.column.displayFormat),this.formatsMenu.showMenu({anchor:t.target,selectedIds:o,itemSelectedCallback:function(t,n){return t.id!=o&&("{0:__default}"==t.id?e.column.displayFormat="":e.column.displayFormat=t.id,e.column.fireChangedEvent()),!1},menuClosedCallback:function(){e.keepShowingButtons=!1,e.isMouseOverBlock||e.element.dispatchEvent(Object(r.createBrowserEvent)("mouseleave"))}})},t.prototype.renderColumnTypeButton=function(){var t=this;return this.isEditable()&&!1!==this.bar.options.allowAggrColumns?Object(r.domel)("div").addClass(s.b+"-column-button",s.b+"-column-button-type").title(o.i18n.getText("ButtonToAggr")).attr("tabIndex","0").on("touchstart click",(function(e){return t.buttonTypeClickHandler(e)})).on("keypress",(function(t){13==t.keyCode&&t.target.click()})).toDOM():null},t.prototype.renderColumnFormatButton=function(){var t=this;return this.isEditable()&&this.formatButtonIsShown()?Object(r.domel)("div").addClass(s.b+"-column-button",s.b+"-column-button-format").title(o.i18n.getText("ButtonFormat")).attr("tabIndex","0").on("touchstart click",(function(e){return t.buttonFormatClickHandler(e)})).on("keypress",(function(t){13==t.keyCode&&t.target.click()})).toDOM():null},t.prototype.getUIS=function(){return this.bar.getContext().getModel().checkAttrProperty(this.column.expr.value,"useInSorting")},t.prototype.onMouseClick=function(t){this.bar.toggleColumnPicked(this.column),this.adjustButtonsVisibility()},t.prototype.onMouseEnter=function(t){if(!a.a.isMobileMode())return this.isMouseOverBlock=!0,this.enterButtonBlock(),t.stopPropagation(),!1},t.prototype.onMouseLeave=function(t){if(!a.a.isMobileMode())return this.isMouseOverBlock=!1,this.leaveButtonBlock(),t.stopPropagation(),!1},t.prototype.isColumnActive=function(){return this.element.classList.contains("active")},t.prototype.hideButtons=function(){a.a.isMobileMode()?this.onHideButtonsMobile&&this.onHideButtonsMobile():Object(r.domel)(this.element).data("show-buttons",null)},t.prototype.showButtons=function(){a.a.isMobileMode()?this.onShowButtonsMobile&&this.onShowButtonsMobile():Object(r.domel)(this.element).data("show-buttons","")},t.prototype.adjustButtonsVisibility=function(){this.bar.options.alwaysShowButtons||(this.bar.options.accentActiveColumn||a.a.isMobileMode())&&this.isColumnActive()?this.showButtons():this.hideButtons()},t.prototype.enterButtonBlock=function(){this.showButtons()},t.prototype.leaveButtonBlock=function(){1==this.bar.options.alwaysShowButtons||this.isColumnActive()&&1==this.bar.options.accentActiveColumn||this.hideButtons()},t.prototype.createFunctionMenu=function(){for(var t,e=[],n=this.bar.getContext().getModel().getAggrFunctions(),i=!0,r=null,s=this.column.getDataType(),a=0,u=n;a<u.length;a++){var c=u[a];if(c){var d=c.getAppliedTypesOrDefault().indexOf(s)>=0;this.column.expr.func!==c.id||d||(i=!1),d&&(t=this.bar.getContext().getModel().getAggrFunctionCaption(c.id),r={id:c.id,text:t},e.push(r))}}i||(this.column.expr.func=e[0].id),this.bar.areCustomExpressionsAllowed()&&(r={id:"CustomSqlDivider",text:"---"},e.push(r),r={id:"CUSTOMSQL",text:t=o.i18n.getText("CustomExpression")},e.push(r));var h=this.element.id;h&&(h+="-FunctionsMenu");var p={items:e,id:h,searchBoxAlwaysShown:!1,domWriteItemsId:!0};this.functionMenu=new l.a(p)},t.prototype.createFormatsMenu=function(){if(0!=this.bar.options.allowDisplayFormatChange){var t=this.column.id;t&&(t+="-FormatsMenu");var e={items:this.getFormatsMenuItems(),id:t,searchBoxAlwaysShown:!1,showSelected:!0,domWriteItemsId:!0};this.formatsMenu=new l.a(e)}},t.prototype.getFormatsMenuItems=function(){var t=this.bar.getContext().getModel().getDisplayFormatsForType(this.column.getDataType());return[{id:"{0:__default}",text:"Default"}].concat(t.map((function(t){return{id:t.format,text:o.i18n.getText("DisplayFormats",t.name)||t.name}})))},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var o=n(1),i=n(3),r=function(){function t(t,e,n){this.panel=t,this.text=e,this.element=n||Object(o.domel)("div").toDOM()}return Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"eqjs-qp"},enumerable:!0,configurable:!0}),t.prototype.refresh=function(){this.render()},t.prototype.render=function(){var t=this;return Object(o.domel)(this.element).html("").addClass(this.getClassesToAdd()).addClass(i.a.getMobileCssClass()).addChild("span",(function(e){return e.text(t.text).title(t.text)})).toDOM(),this.element},t.prototype.getClassesToAdd=function(){return this.cssPrefix+"-condelement"},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return d})),n.d(e,"b",(function(){return h}));var o,i=n(0),r=n(2),s=n(1),a=n(35),l=n(3),u=n(79),c=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=function(t){function e(e,n,o){var i=t.call(this,e,n,o)||this;return i.isRoot=!n.getParent(),i}return c(e,t),e.prototype.getClassesToAdd=function(){var t=this.cssPrefix+"-group";return this.isRoot&&(t+=" "+this.cssPrefix+"-group-root"),t},e.prototype.coreRender=function(t){Object(s.domel)(this.element).addClass(this.getClassesToAdd()).addClass(l.a.getMobileCssClass()).addChildElement(this.renderGroupRow()).addChildElement(this.renderConditions(t)).data("id",this.condition.id).data("group","")},e.prototype.renderGroupRow=function(){return this.isRoot&&!this.panel.options.showRootRow?null:new h(this.panel,this.condition).render()},e.prototype.renderConditions=function(t){var e=this,n=Object(s.domel)("div");return n.addClass(this.cssPrefix+"-conditions").addClass(""+l.a.getMobileCssClass()).data("conditions",""),this.isRoot&&n.addClass(this.cssPrefix+"-conditions-root"),this.condition.getConditions().forEach((function(o,i,r){var s=e.panel.getConditionRenderer(o);s&&n.addChildElement(s.render(t&&i==r.length-1))})),n.toDOM()},e}(a.b),h=function(t){function e(e,n,o){var i=t.call(this,e,n,o)||this;return i.isRoot=!i.condition.getParent(),i}return c(e,t),e.prototype.getButtonsToShow=function(){return this.panel.options.buttons&&this.panel.options.buttons.group&&Array.isArray(this.panel.options.buttons.group)?this.panel.options.buttons.group:["addCondition","addGroup","enable","delete"]},e.prototype.getClassesToAdd=function(){var t;if(this.isRoot)t=this.cssPrefix+"-row "+this.cssPrefix+"-row-group "+this.cssPrefix+"-row-group-root";else{t=this.cssPrefix+"-row "+this.cssPrefix+"-row-group";var e=this.condition.getLevel();e>0&&(t+=" "+this.cssPrefix+"-level-"+e),t+=this.condition.enabled?"":" "+this.cssPrefix+"-disabled",this.condition.enabled&&(t+=this.condition.isReadOnly()?" "+this.cssPrefix+"-readonly":"")}return t},e.prototype.coreRender=function(t){var e=this,n=Object(s.domel)(this.element).addClass(this.getClassesToAdd()).addClass(l.a.getMobileCssClass()).data("group-row","").addChildElement(this.renderCheckbox()).addChildElement(this.renderConjunction()),o=this.condition.getLevel();o>0&&n.addClass(this.cssPrefix+"-level-"+o),this.buildGroupElements(n,this.getGroupTitle()),this.panel.options.accentActiveCondition&&n.on("click",(function(t){e.panel.toggleConditionPicked(e.condition),e.adjustButtonsVisibility(),l.a.isMobileMode()||n.toDOM().dispatchEvent(Object(s.createBrowserEvent)("mouseenter"))})),n.addChildElement(this.renderButtonsBlock()),l.a.isMobileMode()||n.on("mouseenter",(function(t){return e.isMouseOverBlock=!0,e.enterButtonBlock(),t.stopPropagation(),!1})).on("mouseleave",(function(t){return e.isMouseOverBlock=!1,!e.keepShowingButtons&&Object(s.domel)(e.buttonsBlock).isVisible()&&e.leaveButtonBlock(),t.stopPropagation(),!1}))},e.prototype.getGroupTitle=function(){var t;return this.isRoot&&!l.a.isMobileMode()?(t=i.i18n.getText("RootConditionGroupTitle"))||(t=i.i18n.getText("RootPredicateTitle")):(t=i.i18n.getText("ConditionGroupTitle"))||(t=i.i18n.getText("PredicateTitle")),t},e.prototype.buildGroupElements=function(t,e){var n=this,o=e.indexOf("{lt}");if(o<0)t.addText(i.i18n.getText("ErrIncorrectGroupTitleFormat")),t.addClass(this.cssPrefix+"-error");else{o>0&&t.addChild("span",(function(t){t.addClass(n.cssPrefix+"-grelement").addText(e.substring(0,o))}));var s=r.equtils.linkTypeToStr(this.condition.linkType),a=i.utils.findItemById(r.eqconsts.predicateLinkTypeList,s);a||(a=r.eqconsts.predicateLinkTypeList[0]),this.isEditable()?Object(u.b)(t.toDOM()).onGetMenu((function(){return n.getLinkTypeMenu()})).onItemSelected((function(t){n.condition.linkType=r.equtils.strToLinkType(t),n.condition.fireChangedEvent()})).addText(i.i18n.getText(a.key)).title(i.i18n.getText(a.key)).addClass(this.cssPrefix+"-grelement"):t.addChild("span",(function(t){t.text(i.i18n.getText(a.key)).title(i.i18n.getText(a.key)).addClass(n.cssPrefix+"-grelement")})),t.addChild("span",(function(t){t.addClass(n.cssPrefix+"-grelement").addText(e.substring(o+4))}))}},e.prototype.getConditionMenu=function(){return this.panel.getConditionGroupMenu(null==this.condition.getParent())},e.prototype.getLinkTypeMenu=function(){return this.panel.getLinkTypeMenu()},e.prototype.renderConjunction=function(){return this.isRoot?null:t.prototype.renderConjunction.call(this)},e.prototype.renderCheckbox=function(){return this.isRoot?null:t.prototype.renderCheckbox.call(this)},e.prototype.leaveButtonBlock=function(){this.panel.options.alwaysShowButtonsInGroups||this.isConditionActive()&&this.panel.options.accentActiveCondition||this.hideButtons()},e.prototype.adjustButtonsVisibility=function(){(this.panel.options.alwaysShowButtonsInGroups||this.panel.options.accentActiveCondition&&this.isConditionActive())&&this.showButtons()},e}(a.c)},function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return a}));var o,i=n(1),r=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t){function e(e){var n=t.call(this,"a",e)||this;return n.attr("href","javascript:void(0)"),n.on("click",(function(t){return t.preventDefault(),n.appear(),!1})),n}return r(e,t),e.prototype.onGetMenu=function(t){return this._onGetMenu=t,this},e.prototype.onItemSelected=function(t){return this._onItemSelected=t,this},e.prototype.appear=function(){var t=this,e=this._onGetMenu?this._onGetMenu():null;e&&e.showMenu({anchor:this.element,itemSelectedCallback:function(e){return t._onItemSelected&&t._onItemSelected(e.id),!1}})},e}(i.DomElementBuilder);function a(t){return new s(t)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var o,i=n(0),r=n(2),s=n(1),a=n(24),l=n(10),u=n(3),c=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.renderEditor=function(){var t=this;this.inputBuilder=Object(s.domel)("input").hide().addClass(this.cssPrefix+"-ve-editbox").type("text").on("blur",(function(e){if(t.inputBuilder.isVisible()&&!t.dontProcessBlur){var n=t.validateInput(t.inputElement.value);return n.success?(t.setValue(t.inputElement.value),t.closeEditor()):(t.dontProcessBlur=!0,t.inputElement.focus(),setTimeout((function(){t.dontProcessBlur=!1}),200),t.showValidationError(n.message,e.target)),e.stopPropagation(),!1}})).on("keydown",(function(e){if(27===e.keyCode)return t.closeEditor(),e.stopPropagation(),!1;if(13===e.keyCode&&t.inputBuilder.isVisible()){t.dontProcessBlur=!0;var n=t.validateInput(t.inputElement.value);return n.success?(t.setValue(t.inputElement.value),t.closeEditor(),t.dontProcessBlur=!1):(t.inputElement.focus(),t.showValidationError(n.message,e.target),setTimeout((function(){t.dontProcessBlur=!1}),200)),e.stopPropagation(),!1}})),this.inputElement=this.inputBuilder.toDOM(),Object(s.domel)(this.element).addChildElement(this.inputElement)},e.prototype.showEditor=function(){var t=200;if(!u.a.isMobileMode()){var e=this.element.offsetLeft,n=this.element.offsetWidth>t?this.element.offsetWidth:t,o=this.element.parentElement.clientWidth-e-55;this.inputBuilder.removeStyle("left").removeStyle("right"),o<t?this.inputBuilder.setStyle("right","55px").setStyle("width","200px"):o<n?this.inputBuilder.setStyle("left",e+"px").setStyle("width",o+"px"):this.inputBuilder.setStyle("left",e+"px").setStyle("width",n+"px")}Object(s.domel)(this.labelElement).hide(),this.inputBuilder.value(this.getValue()).show(),this.inputElement.focus()},e.prototype.closeEditor=function(){this.inputBuilder.hide(),Object(s.domel)(this.labelElement).show(),this.labelElement.focus()},e.prototype.validateInput=function(t){this.inputBuilder.removeClass("eqjs-invalid");var e={success:!0,value:t};return this.expression.kind==r.DataKind.List?this.validateListInput(t,e):this.validateScalarInput(t,e),e},e.prototype.validateListInput=function(t,e){for(var n=0,o=t.split(/\s*,\s*/);n<o.length;n++){var i=o[n];if(this.validateScalarInput(i,e),!e.success)return}},e.prototype.validateScalarInput=function(t,e){if(t&&i.utils.isNumericType(this.expression.dataType)){var n=+t;isNaN(n)&&(e.success=!1,e.message='"'+t+'" '+i.i18n.getText("ErrNotNumber")),i.utils.isIntType(this.expression.dataType)&&n!=parseInt(t,10)&&(e.success=!1,e.message='"'+t+'" '+i.i18n.getText("ErrIncorrectInteger"))}},e.prototype.showValidationError=function(e,n){t.prototype.showValidationError.call(this,e,n),this.inputBuilder.addClass("eqjs-invalid")},e.prototype.isEditable=function(){return t.prototype.isEditable.call(this)&&(this.panel.options.editableParts&l.a.Value)===l.a.Value},e}(a.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var o,i=n(0),r=n(2),s=n(1),a=n(43),l=n(4),u=n(10),c=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=function(t){function e(e,n,o){var i=t.call(this,o)||this;return i.panel=e,i.menu=n,i}return c(e,t),Object.defineProperty(e.prototype,"cssPrefix",{get:function(){return"eqjs-qp"},enumerable:!0,configurable:!0}),e.prototype.getLabelText=function(){return i.i18n.getText("CmdClickToAddCondition")},e.prototype.getClassesToAdd=function(){return l.b+"-addrow "+this.cssPrefix+"-addrow"},e.prototype.isEditable=function(){return t.prototype.isEditable.call(this)&&(this.panel.options.editableParts&u.a.Addition)===u.a.Addition},e.prototype.renderLabelElement=function(){var t=this,e=this.getLabelText();return this.isEditable()?this.labelElement=Object(s.domel)("a").attr("href","javascript:void(0)").title(e).text(e).on("click",(function(e){return e.preventDefault(),t.showEditor(),!1})).toDOM():this.labelElement=Object(s.domel)("div").toDOM(),this.labelElement},e.prototype.renderEditor=function(){},e.prototype.itemSelected=function(t){var e=this.panel.getQuery(),n={parent:e.getRootCondition(),attributeId:t},o=e.addSimpleCondition(n);o&&e.fireConditionsChangedEvent(r.QueryChangeAction.Add,o)},e.prototype.getMenu=function(){return this.menu},e}(a.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var o,i=n(0),r=n(2),s=n(43),a=n(9),l=n(10),u=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c=function(t){function e(e,n,o,i){var r=t.call(this,i)||this;return r.panel=e,r.condition=n,r.displayedText=o,r}return u(e,t),Object.defineProperty(e.prototype,"cssPrefix",{get:function(){return"eqjs-qp"},enumerable:!0,configurable:!0}),e.prototype.renderEditor=function(){var t=this,e=this.panel.getContext().getModel(),n=this.panel.getQuery(),o=[],s=(this.condition&&this.condition.expressions&&this.condition.expressions[0]?this.condition.expressions[0].value:null)?e.getAttributeById(this.condition.expressions[0].value):null;s&&s.operators&&s.operators.forEach((function(s){var a=e.getOperatorById(s),l=function(t){return t.defaultOperand.kind==r.DataKind.Query}(a);!n.isEx()&&l||!a||t.panel.options.isSubQuery&&l||o.push({id:s,text:i.i18n.getText("Operators",s,"caption")||a.caption})}));var l={items:o,adjustHeight:this.panel.options.adjustEntitiesMenuHeight,id:i.utils.generateId("opmn"),domWriteItemsId:this.panel.options.domWriteItemsId};i.utils.assign(l,this.panel.options.menuOptions),this.menu=new a.a(l)},e.prototype.getLabelText=function(){return this.displayedText},e.prototype.getEmptyText=function(){return this.panel.options.emptyTextOperator||i.i18n.getText("MsgEmptyOperator")},e.prototype.getClassesToAdd=function(){return this.cssPrefix+"-condelement "+this.cssPrefix+"-operelement"},e.prototype.isEditable=function(){return this.condition.enabled&&!this.condition.isReadOnly()&&(this.panel.options.editableParts&l.a.Operator)===l.a.Operator},e.prototype.itemSelected=function(t){this.condition.setOperatorId(t),this.condition.fireChangedEvent(r.ConditionPart.Operator)},e.prototype.getMenu=function(){return this.menu},e}(s.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var o,i=n(0),r=n(1),s=n(24),a=n(10),l=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.dtp=null,e.internalDateFormat="yyyy-MM-dd",e.internalTimeFormat="HH:mm",e}return l(e,t),e.prototype.renderEditor=function(){},e.prototype.showEditor=function(){var t=this;if(!this.dtp){var e={yearRange:this.panel.options.yearRange,showCalendar:this.expression.dataType!==i.DataType.Time,showTimePicker:this.expression.dataType!==i.DataType.Date,oneClickDateSelection:this.panel.options.oneClickDateSelection,showDateTimeInput:this.panel.options.showDateTimeInput,onApply:function(e){var n=t.convertToInternalFormat(e);t.setValue(n),t.dtp=null,setTimeout((function(){return t.labelElement.focus()}),100)},onCancel:function(){t.labelElement.innerText=t.getLabelText(),t.dtp=null,setTimeout((function(){return t.labelElement.focus()}),100)},onDateTimeChanged:function(e){var n=i.i18n.dateTimeToStr(e,t.expression.dataType);t.labelElement.innerText=n}};this.dtp=this.panel.options.dateTimePickerResolver?this.panel.options.dateTimePickerResolver(e):new r.DefaultDateTimePicker(e);var n=this.expression.getModel(),o=this.expression.value,s=new Date;s=this.expression.dataType!=i.DataType.Time&&n.isDateMacro(o)?n.getDateMacroValue(o):this.expression.dataType==i.DataType.Time&&n.isTimeMacro(o)?n.getTimeMacroValue(o):this.convertFromInternalFormat(o),this.dtp.setDateTime(s),this.dtp.show(this.element)}},e.prototype.closeEditor=function(){this.dtp.cancel(),this.dtp=null},e.prototype.getLabelText=function(){if(!this.expression.value)return this.getEmptyText();var t=this.expression.value,e=this.expression.getModel();if(!e)throw new Error("DataModel is not defined for "+this.expression.value);if(e.isDateMacro(t)||e.isTimeMacro(t)){var n=t.substring(3,t.length-2),o=i.i18n.getText(n);return o||"${{Today}}"}return i.i18n.dateTimeToStr(this.convertFromInternalFormat(t),this.expression.dataType)},e.prototype.isEditable=function(){return t.prototype.isEditable.call(this)&&(this.panel.options.editableParts&a.a.Value)===a.a.Value},e.prototype.convertFromInternalFormat=function(t){return i.utils.strToDateTime(t,this.internalDateFormat+" "+this.internalTimeFormat)},e.prototype.convertToInternalFormat=function(t){return i.utils.dateTimeToStr(t,this.internalDateFormat+" "+this.internalTimeFormat)},e}(s.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var o,i=n(0),r=n(2),s=n(1),a=n(24),l=n(9),u=n(25),c=n(10),d=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return d(e,t),e.prototype.renderEditor=function(){this.dialogBlockBody=Object(s.domel)("div").addClass("kfrm-form").toDOM(),this.createEntitiesMenu(),this.renderColumnBlock(),this.renderQueryPanelBlock()},e.prototype.isEditable=function(){return t.prototype.isEditable.call(this)&&(this.panel.options.editableParts&c.a.Value)===c.a.Value},e.prototype.setValue=function(t,e){t instanceof r.Query&&(this.expression.subQuery=t,e||this.expression.getParent().fireChangedEvent(r.ConditionPart.Value))},e.prototype.createEntitiesMenu=function(){var t=this.getContext().getModel(),e=this.expression.dataType;if(this.colEntitiesList=t.getEntitiesTreeWithFilter((function(t,n){return n?n.useInConditions&&n.dataType===e:t.attributes&&t.useInConditions})),!t||t.isEmpty())return null;var n=this.element.getAttribute("data-id");n&&(n+="-SubColumnMenu");var o={items:this.colEntitiesList,adjustHeight:this.panel.options.adjustEntitiesMenuHeight,id:n,isSubQuery:!0,domWriteItemsId:this.panel.options.domWriteItemsId};i.utils.assign(o,this.panel.options.menuOptions),this.colEntitiesMenu=new l.a(o)},e.prototype.renderColumnBlock=function(){var t=this;this.columnBlock=Object(s.domel)("div",this.dialogBlockBody).addClass("kfrm-field").addChild("label",(function(t){return t.addText(i.i18n.getText("SubQueryColumnTitle"))})).addChild("a",(function(e){return t.columnElement=e.attr("href","javascript:void(0)").on("click",(function(e){t.colEntitiesMenu.showMenu({anchor:t.columnElement,selectedIds:null,itemSelectedCallback:function(e,n){var o=e.id;return t.setResultAttributeId(o),!1}})})).toDOM()})).toDOM()},e.prototype.getEmptyText=function(){return this.panel.options.emptyTextValue||i.i18n.getText("MsgSubQueryValue")},e.prototype.renderQueryPanelBlock=function(){var t=Object(s.domel)("div",this.dialogBlockBody).addClass("kfrm-field").addChild("label",(function(t){return t.addText(i.i18n.getText("SubQueryQueryPanelCaption"))})).toDOM();this.queryPanelBlock=Object(s.domel)("div",t).toDOM();var e=this.element.getAttribute("data-id");e&&(this.queryPanelBlock.id=e+"-SubQueryPanel")},e.prototype.setResultAttributeId=function(t){var e=this.getContext().getModel().getAttributeById(t);if(e){var n=this.getSubQuery(),o=n.getColumns(),i=void 0;if(o.length>0)(i=o[0]).expr.setValue(t),i.expr.dataType=e.dataType,i.fireChangedEvent();else{(i=n.createColumn()).sorting=r.SortDirection.None,i.sortIndex=-1;var s=new r.Expression(i);s.setValue(t),s.tag=r.ExprTag.EntityAttribute,s.kind=r.DataKind.Attribute,s.dataType=e.dataType,i.expr=s,o.push(i),n.fireColumnsChangedEvent(r.QueryChangeAction.Add,i)}this.columnElement.innerText=this.getAttributeText(e)}},e.prototype.getSubQuery=function(){return this.queryPanel.getQuery()},e.prototype.getAttributeText=function(t){if(!t)return i.i18n.getText("SubQueryEmptyColumn");var e=i.i18n.getText("Attributes",t.id);e||(e=t.caption);var n=this.panel.options.attrElementFormat;if(!n)return e;var o=n.replace(new RegExp("{attr}","g"),e),r=this.getContext().getModel().getFullEntityPathByAttr(t.id,".");return o.replace(new RegExp("{entity}","g"),r)},e.prototype.showEditor=function(){var t=this,e=this.panel,n=this.getContext();this.queryPanelBlock.innerHTML="";var o=n.createQuery();this.expression.subQuery&&o.loadFromData(this.expression.subQuery.toJSONData());var s=i.utils.assign({},e.options);s.isSubQuery=!0,s.showAddRow=!0,s.menuContainer=document.body,s.menuOptions.isSubQuery=!0,s.entitiesListFilter=function(t,n){if(e.options.entitiesListFilter){var o=n||{};o.isSubQuery=!0,e.options.entitiesListFilter(t,o)}},this.queryPanel=new u.a(this.queryPanelBlock,o),this.queryPanel.init(this.panel.getContext(),s);var a=null,l=o.getColumns();if(0==l.length){var c=this.expression.getParent();if(c.expressions.length>0){var d=c.expressions[0];a=d.tag==r.ExprTag.EntityAttribute||d.kind==r.DataKind.Attribute?d.value:null}}else a=l[0].expr.value;a?this.setResultAttributeId(a):this.columnElement.innerText=i.i18n.getText("SubQueryEmptyColumn"),this.queryPanel.refresh();var h=this.queryPanelBlock.querySelector(".eqjs-qp-conditions-root");h&&(h.style.minHeight="100px"),this.panel.getContext().getServices().getDialogService().open({title:i.i18n.getText("SubQueryDialogTitle"),body:this.dialogBlockBody,width:this.panel.options.subQueryDialogWidth,closable:!0,cancelable:!0,onSubmit:function(){var e=t.queryPanel.getQuery();return!!e.tryValidate({checkExpressions:!0})&&(t.setValue(e),!0)}})},e.prototype.closeEditor=function(){},e}(a.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var o,i=n(0),r=n(2),s=n(1),a=n(25),l=n(3),u=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c=function(t){function e(e){var n=t.call(this,e)||this;return n.options={applyOnClose:!0,showApplyButton:!0,showClearButton:!0,queryPanel:{showAddRow:!0,showCheckboxes:!0,alwaysShowButtonsInGroups:!0}},n.headerClickListener=n.headerClickHandler.bind(n),n.group=r.WidgetGroup.Query,n}return u(e,t),e.prototype.getWidgetType=function(){return"filterBar"},Object.defineProperty(e.prototype,"cssPrefix",{get:function(){return"eqjs-fb"},enumerable:!0,configurable:!0}),e.prototype.init=function(e,n){t.prototype.init.call(this,e,n),this.setOptions(n),this.destroyCore(),this.qpElement=Object(s.domel)("div").addClass(this.cssPrefix+"-querypanel").toDOM(),this.queryPanel=new a.a(this.qpElement),this.queryPanel.init(e,this.options.queryPanel||{}),this.attachQueryObserver()},e.prototype.setOptions=function(t){this.options=i.utils.assignDeep(this.options,t)},e.prototype.applyBtnClick=function(t){this.applyFilter()},e.prototype.clearBtnClick=function(t){this.clearFilter()},e.prototype.showQueryPanel=function(t){var e=this;Object(s.slideDown)(this.qpBlock,200,(function(){e.updateHeader(),t&&t()}))},e.prototype.hideQueryPanel=function(){var t=this;Object(s.slideUp)(this.qpBlock,200,(function(){t.updateHeader(),t.options.applyOnClose&&t.applyFilter()}))},e.prototype.headerClickHandler=function(t){t.preventDefault(),Object(s.domel)(this.qpBlock).isVisible()?this.hideQueryPanel():this.showQueryPanel()},e.prototype.updateHeader=function(){if(this.headerTextElement){var t="",e=this.getContext().getQuery();e&&(t=e.getConditionsText()),""==t&&(t=i.i18n.getText("StrNoFilterDefined")),Object(s.domel)(this.headerTextElement).text(t).attr("title",t),!e||e.isEmptyConditions()?(Object(s.domel)(this.headerTextElement).hide(),Object(s.domel)(this.headerLinkElement).show(),Object(s.domel)(this.qpBlock).isVisible()||(Object(s.domel)(this.headerArrowBlock).hide(),this.headerElement.style.cursor="",this.headerElement.removeEventListener("click",this.headerClickListener))):(this.headerElement.style.cursor="pointer",this.headerElement.removeEventListener("click",this.headerClickListener),this.headerElement.addEventListener("click",this.headerClickListener),Object(s.domel)(this.headerTextElement).show(),Object(s.domel)(this.headerLinkElement).hide(),Object(s.domel)(this.headerArrowBlock).show()),Object(s.domel)(this.qpBlock).isVisible()?this.headerArrowElement.classList.add(this.cssPrefix+"-header-arrowUp"):this.headerArrowElement.classList.remove(this.cssPrefix+"-header-arrowUp"),this.textResize()}},e.prototype.render=function(){var t=this;Object(s.domel)(this.slot).addClass(this.cssPrefix+"-container").addClass(l.a.getMobileCssClass()).addChild("div",(function(e){return t.headerElement=e.addClass(t.cssPrefix+"-header").addChild("div",(function(e){return t.headerIconElement=e.addClass(t.cssPrefix+"-header-icon").toDOM()})).addChild("div",(function(e){return t.headerTextBlock=e.addClass(t.cssPrefix+"-header-textblock").addChild("div",(function(e){return t.headerTextElement=e.addClass(t.cssPrefix+"-header-text").toDOM()})).addChild("div",(function(e){return t.headerLinkElement=e.addClass(t.cssPrefix+"-header-text "+t.cssPrefix+"-header-link").text(i.i18n.getText("StrNoFilterClickToAdd")).hide().on("click",(function(){t.queryPanel.showEntitiesMenu({anchor:t.headerLinkElement,selectedIds:null,itemSelectedCallback:function(e,n){var o=e.id;t.showQueryPanel((function(){var e=t.getContext().getQuery(),n={parent:e.getRootCondition(),attributeId:o},i=e.addSimpleCondition(n);i&&e.fireConditionsChangedEvent(r.QueryChangeAction.Add,i)}))}})})).toDOM()})).toDOM()})).addChild("div",(function(e){return t.headerArrowBlock=e.addClass(t.cssPrefix+"-header-arrowblock").addChild("div",(function(e){return t.headerArrowElement=e.addClass(t.cssPrefix+"-header-arrow").toDOM()})).toDOM()})).toDOM()})).addChild("div",(function(e){return t.qpBlock=e.addClass(t.cssPrefix+"-querypanelblock").addClass(l.a.getMobileCssClass()).hide().addChildElement(t.qpElement).toDOM()})),(this.options.showApplyButton||this.options.showClearButton)&&(this.buttonsBlock=Object(s.domel)("div",this.qpBlock).addClass(this.cssPrefix+"-buttonsblock").addClass(l.a.getMobileCssClass()).toDOM()),this.options.showApplyButton&&Object(s.domel)("a",this.buttonsBlock).attr("href","javascript:void(0)").addClass(this.cssPrefix+"-button "+this.cssPrefix+"-button-apply").text(i.i18n.getText("ButtonApply")).on("click",this.applyBtnClick.bind(this)),this.options.showClearButton&&Object(s.domel)("a",this.buttonsBlock).attr("href","javascript:void(0)").addClass(this.cssPrefix+"-button "+this.cssPrefix+"-button-clear").text(i.i18n.getText("CmdClear")).on("click",this.clearBtnClick.bind(this)),window.addEventListener("resize",(function(){t.textResize()})),this.updateHeader(),this.queryPanel.refresh(),setTimeout((function(){return t.textResize()}),500)},e.prototype.refreshCore=function(){this.clear(),this.render()},e.prototype.clear=function(){this.slot.innerHTML=""},e.prototype.applyFilter=function(){this.options.applyFilterCallback&&this.options.applyFilterCallback()},e.prototype.clearFilter=function(){var t=this.getContext().getQuery();t&&(t.clearConditions(),t.fireConditionsChangedEvent(r.QueryChangeAction.All))},e.prototype.textResize=function(){this.headerTextBlock.style.width=this.slot.clientWidth-this.headerIconElement.offsetWidth-(Object(s.domel)(this.headerArrowBlock).isVisible()?this.headerArrowBlock.offsetWidth:0)+"px"},e.prototype.destroyCore=function(){this.queryPanel&&this.queryPanel.destroy(),this.detachQueryObserver(),this.slot.innerHTML=""},e.prototype.attachQueryObserver=function(){var t=this,e=this.getContext().getQuery();this.queryEventCallbackId=e.addChangedCallback((function(e){t.updateHeader()}))},e.prototype.detachQueryObserver=function(){var t=this.getContext().getQuery();t&&t.removeChangedCallback(this.queryEventCallbackId)},e}(r.Widget)},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var o,i=n(0),r=n(2),s=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=function(t){function e(e){var n=t.call(this,e)||this;return n.options={useCustomLocaleSettings:!1},n.slot=e,n.group=r.WidgetGroup.Result,n}return s(e,t),e.prototype.getWidgetType=function(){return"grid"},e.prototype.init=function(e,n){t.prototype.init.call(this,e,n),n&&i.utils.assignDeep(this.options,n)},e.prototype.refreshCore=function(){this.clear(),this.context.resultTable&&this.render()},e.prototype.render=function(){this.options.beforeTableRendering&&this.options.beforeTableRendering(this.context.resultTable),this.applyDisplayFormats()},e.prototype.applyDisplayFormats=function(){},e.prototype.clear=function(){this.slot.innerHTML=""},e}(r.Widget)},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var o,i=n(2),r=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t){function e(e){var n=t.call(this,e)||this;return n.panel=e,n.group=i.WidgetGroup.Statement,"TEXTAREA"!==n.panel.tagName&&(n.panel.innerHTML='<div class="eqv-sql-panel-result"></div>',n.panel=n.panel.querySelector("div")),n}return r(e,t),e.prototype.getWidgetType=function(){return"statementPanel"},e.prototype.refreshCore=function(){this.clear(),this.render()},e.prototype.render=function(){this.panel.textContent=this.context.resultStatement?this.context.resultStatement:"";var t=this.panel.innerHTML.replace(/\r\n/g,"<br />").replace(/ /g,"&nbsp;&nbsp;");this.panel.innerHTML=t},e.prototype.destroyCore=function(){this.clear()},e.prototype.clear=function(){this.panel.innerHTML=""},e}(i.Widget)},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var o,i=n(2),r=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t){function e(e){var n=t.call(this,e)||this;return n.element=e,n.element.style.display="none",n.group=i.WidgetGroup.All,n}return r(e,t),e.prototype.getWidgetType=function(){return"processIndicator"},e.prototype.onProcessStartCore=function(){this.element.style.display=""},e.prototype.onProcessEndCore=function(){this.element.style.display="none"},e}(i.Widget)},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var o,i=n(0),r=n(1),s=n(15),a=n(31),l=n(46),u=n(53),c=n(3),d=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.title=i.i18n.getText("Facets","Chart","FacetTitle"),e.dialogTitle=i.i18n.getText("Facets","Chart","DlgTitle"),e}return d(e,t),e.prototype.init=function(e){t.prototype.init.call(this,e),u.a.hasGoogleCharts()?this.chart=new u.a(this.contentDiv):this.chart=new l.a(this.contentDiv);var n=this.container.options?this.container.options.supportedChartTypes:null;this.chart.init(this.getContext(),{legend:{show:!1},showOnPaging:!0,hideSettings:!0,supportedChartTypes:n}),Object(r.domel)(this.slot).hide()},e.prototype.destroy=function(){this.chart&&this.chart.destroy()},e.prototype.getType=function(){return s.a.Chart},e.prototype.renderFormFields=function(e,n){var o=this;t.prototype.renderFormFields.call(this,e,n);var s=c.a.isIE(),a=s?"kfrm-fields-ie is-horizontal":"kfrm-fields is-horizontal",l=document.createElement("select");l.id="chart_type_selector",l.name="chart_type_selector";for(var u=0,d=this.chart.getSupportedChartTypes();u<d.length;u++){var h=d[u];(C=document.createElement("option")).value=h.toString(),C.text=this.chart.getChartTypeName(h),l.appendChild(C)}l.value=this.chart.getCurrentChartType().toString(),this.settings||(this.chart.prepareChartData(),this.settings={type:this.chart.getCurrentChartType().toString(),labelColumn:""+(this.chart.getLabelColumnIndex()>=0?this.chart.getLabelColumnIndex():""),dataColumn:""+(this.chart.getDataColumnIndex()>=0?this.chart.getDataColumnIndex():""),showLegend:!1});var p=document.createElement("select");p.name="label_column_selector",p.id="label_column_selector";for(var f=0,g=this.chart.getPotentialLabelColumns();f<g.length;f++){var y=g[f];(C=document.createElement("option")).value=y.idx.toString(),C.text=y.label,p.appendChild(C)}p.value=this.settings.labelColumn;var m=document.createElement("select");m.id="data_column_selector",m.name="data_column_selector";for(var v=0,b=this.chart.getPotentialDataColumns();v<b.length;v++){var C;y=b[v];(C=document.createElement("option")).value=y.idx.toString(),C.text=y.label,m.appendChild(C)}m.value=this.settings.dataColumn.toString();var x=n,w=function(){return s?Object(r.domel)("div",n).addClass("kfrm-field-ie").toDOM():n};s?Object(r.domel)(e).addChildElement(w()):Object(r.domel)(n).addChild("div").addChild("div"),x=w(),Object(r.domel)(x).addChild("label",(function(t){return t.attr("for","chart_type_selector").text(i.i18n.getText("Facets","Chart","ChartTypeSelectorLabel"))})).addChild("div",(function(t){return t.addClass("kfrm-select").addChildElement(l)})),x=w(),Object(r.domel)(x).addChild("label",(function(t){return t.attr("for","label_column_selector").text(i.i18n.getText("Facets","Chart","LabelColumnSelectorLabel"))})).addChild("div",(function(t){return t.addClass("kfrm-select").addChildElement(p)})),x=w(),Object(r.domel)(x).addChild("label",(function(t){return t.attr("for","data_column_selector").text(i.i18n.getText("Facets","Chart","DataColumnSelectorLabel"))})).addChild("div",(function(t){return t.addClass("kfrm-select").addChildElement(m)})),x=w(),Object(r.domel)(x).addChild("div").addChild("div",(function(t){return t.addClass(a).addChild("label",(function(t){return t.addClass("checkbox").addChild("input",(function(t){t.id("show_legend").type("checkbox"),o.settings.showLegend&&t.attr("checked","")})).addText(" "+i.i18n.getText("Facets","Chart","ShowLegendLabel"))}))}))},e.prototype.afterDialogOpened=function(t){this.getContext().resultTable.columns.getItems().filter((function(t){return i.utils.isNumericType(t.type)})).length<=0&&(t.showAlert("The dataset should contain at least one numeric column to build a chart","error"),t.getSubmitButtonElement().disabled=!0)},e.prototype.submitSettingsDialog=function(){var e=t.prototype.submitSettingsDialog.call(this),n=document.getElementById("chart_type_selector"),o=parseInt(n.value),i=document.getElementById("label_column_selector"),r=parseInt(i.value),s=document.getElementById("data_column_selector"),a=parseInt(s.value),l=document.getElementById("show_legend").checked;return e&&(this.settings={type:o,labelColumn:r,dataColumn:a,showLegend:l},this.canDisplay()&&this.refresh()),e},e.prototype.getSettings=function(){return this.settings},e.prototype.saveToData=function(){var e=t.prototype.saveToData.call(this);return this.settings&&(e.chartType=this.settings.type,e.labelCol=this.settings.labelColumn,e.dataCol=this.settings.dataColumn,e.showLeg=this.settings.showLegend),e},e.prototype.loadFromData=function(e){t.prototype.loadFromData.call(this,e),e&&(this.settings={type:e.chartType,dataColumn:e.dataCol,labelColumn:e.labelCol,showLegend:e.showLeg})},e.prototype.refreshCore=function(){this.chart&&(this.settings&&this.chart.updateSettings(this.settings),this.chart.prepareChartData(),this.chart.refresh())},e.prototype.onResize=function(){this.refresh()},e}(a.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var o,i,r,s=n(1),a=n(0),l=n(15),u=n(31),c=n(3),d=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});!function(t){t.Sum="SUM",t.Average="AVG",t.Min="MIN",t.Max="MAX",t.Count="COUNT"}(i||(i={})),function(t){t[t.ColumnField=0]="ColumnField",t[t.RowField=1]="RowField",t[t.CellData=2]="CellData"}(r||(r={}));var h=/{0:(.*?)}/g,p=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.title=a.i18n.getText("Facets","Pivot","FacetTitle"),e.dialogTitle=a.i18n.getText("Facets","Pivot","DlgTitle"),e.pivotTable=new a.EasyDataTable,e}return d(e,t),e.prototype.init=function(e){var n=this;t.prototype.init.call(this,e),this.options.maxRowCount=this.options.maxRowCount||500,this.options.viewportRowsCount=this.options.viewportRowsCount||50,this.grid=new s.EasyGrid({slot:this.contentDiv,dataTable:this.pivotTable,paging:{enabled:!1,pageSize:this.options.maxRowCount},viewportRowsCount:this.options.viewportRowsCount,useRowNumeration:!1,showPlusButton:!1,allowDragDrop:!1,onGetCellRenderer:function(t,e){if(t.dataColumn){if("total"==t.dataColumn.id)return function(t,n,o,i){e(t,n,o,i),o.classList.add("pivot-cell-total")};if(n.settings.totalsRow)if(0===n.pivotTable.columns.getIndex(t.dataColumn.id))return function(t,o,i,r){Number.parseInt(r.getAttribute("data-row-idx"))===n.pivotTable.getCachedCount()-1&&(t=a.i18n.getText("Facets","Pivot","TotalGridLabel")),e(t,o,i,r)}}}})},e.prototype.getType=function(){return l.a.PivotTable},e.prototype.destroy=function(){this.grid&&this.grid.destroy()},e.prototype.createAggrFuncSelectBuilder=function(t){for(var e=this.getContext().getModel(),n=Object(s.domel)("select"),o=function(t){n.addChild("option",(function(n){n.attr("value",t).text(e.getAggrFunctionCaption(t))}))},r=0,a=Object.keys(i).map((function(t){return i[t]}));r<a.length;r++){o(a[r])}var l=n.toDOM().querySelectorAll("option");return null!=t?l.forEach((function(e){e.value==t&&(e.selected=!0)})):l[0].selected=!0,n},e.prototype.createColumnsSelectBuilder=function(t,e,n){for(var o=this.getContextDataTable(),i=Object(s.domel)("select"),l=null,u=0,c=function(e){var n=o.columns.get(e),r=n.label,s=n.type,c=n.id;if(t&&t.indexOf(s)<0)return"continue";null===l&&a.utils.isNumericType(s)&&(l=u),i.addChild("option",(function(t){t.attr("value",c).text(r)})),u++},d=0;d<o.columns.count;d++)c(d);var h=Array.from(i.toDOM().querySelectorAll("option"));if(h.length>0)if(null!=e)for(var p=0,f=h;p<f.length;p++){var g=f[p];if(g.value==e){i.toDOM().value=g.value;break}}else switch(n){case r.ColumnField:i.toDOM().value=h[0].value;break;case r.RowField:i.toDOM().value=h.length>1?h[1].value:h[0].value;break;case r.CellData:i.toDOM().value=null===l?h[0].value:h[l].value}return i},e.prototype.renderFormFields=function(e,n){var o=this;t.prototype.renderFormFields.call(this,e,n);var i=this.settings||{totalsRow:!0,totalsCol:!0},l=[a.DataType.String,a.DataType.Date,a.DataType.DateTime,a.DataType.Int32,a.DataType.Int64,a.DataType.Word,a.DataType.Byte],u=[a.DataType.String,a.DataType.Float,a.DataType.Int32,a.DataType.Int64,a.DataType.Word,a.DataType.Byte,a.DataType.Currency],d=c.a.isIE(),h=n,p=d?"kfrm-fields-ie is-horizontal":"kfrm-fields is-horizontal",f=function(){return d?Object(s.domel)("div",n).addClass("kfrm-field-ie").toDOM():n};d?Object(s.domel)(n).addChildElement(f()):Object(s.domel)(n).addChild("div").addChild("div"),h=f(),Object(s.domel)(h).addChild("label",(function(t){return t.attr("for","column_field").text(a.i18n.getText("Facets","Pivot","ColumnFieldSelectorLabel"))})).addChild("div",(function(t){return t.addClass(p).addChild("div",(function(t){return t.addClass("kfrm-select").attr("name","column_field").addChildElement(o.createColumnsSelectBuilder(l,i.colName,r.ColumnField).id("pivotTableColFieldSelector").toDOM())})).addChild("button",(function(t){return t.addClass("kfrm-button").addClass("eqjs-facets-button-swap").attr("title",a.i18n.getText("Facets","Pivot","SwapBtnTitle")).on("click",(function(){var t=document.getElementById("pivotTableColFieldSelector"),e=document.getElementById("pivotTableRowFieldSelector"),n=t.value;t.value=e.value,e.value=n}))}))})),h=f(),Object(s.domel)(h).addChild("label",(function(t){return t.attr("for","row_field").text(a.i18n.getText("Facets","Pivot","RowFieldSelectorLabel"))})).addChild("div",(function(t){return t.addClass("kfrm-select").attr("name","row_field").addChildElement(o.createColumnsSelectBuilder(l,i.rowName,r.RowField).id("pivotTableRowFieldSelector").toDOM())})),h=f(),Object(s.domel)(h).addChild("label",(function(t){return t.attr("for","data_function").text(a.i18n.getText("Facets","Pivot","CellDataSelectorLabel"))})).addChild("div",(function(t){return t.addClass(p).addChild("div",(function(t){return t.addClass("kfrm-select").attr("name","data_function").addChildElement(o.createAggrFuncSelectBuilder(i.aggrFunc).id("pivotTableAggrFuncSelector").toDOM())})).addChild("label",(function(t){return t.addText("of ")})).addChild("div",(function(t){return t.addClass("kfrm-select").attr("name","data_column").addChildElement(o.createColumnsSelectBuilder(u,i.fieldName,r.CellData).on("change",(function(t){var e=t.target.value;o.validateSelectedField(e)})).id("pivotTableCellFieldSelector").toDOM())}))})),h=f(),Object(s.domel)(h).addChild("div").addChild("div",(function(t){return t.addClass(p).addChild("label",(function(t){return t.addClass("checkbox").addChild("input",(function(t){t.id("pivotTableHasTotalsRow").type("checkbox"),i.totalsRow&&t.attr("checked","")})).addText(" "+a.i18n.getText("Facets","Pivot","TotalsRowLabel"))})).addChild("label",(function(t){return t.addClass("checkbox").addChild("input",(function(t){t.id("pivotTableHasTotalsCol").type("checkbox"),i.totalsCol&&t.attr("checked","")})).addText(" "+a.i18n.getText("Facets","Pivot","TotalsColLabel"))}))}))},e.prototype.afterDialogOpened=function(t){var e=document.getElementById("pivotTableCellFieldSelector").value;e&&this.validateSelectedField(e),this.getQuery().getColumns().length<=2&&(t.showAlert("The dataset should contain at least three columns to build a pivot table","error"),t.getSubmitButtonElement().disabled=!0)},e.prototype.validateSelectedField=function(t){var e=this.getContextDataTable(),n=e.columns.getIndex(t),o=e.columns.get(n),r=document.getElementById("pivotTableAggrFuncSelector");o.type==a.DataType.String?(r.disabled=!0,r.value=i.Count):r.disabled=!1},e.prototype.submitSettingsDialog=function(){var e=t.prototype.submitSettingsDialog.call(this);return e&&(this.settings={colName:document.getElementById("pivotTableColFieldSelector").value,rowName:document.getElementById("pivotTableRowFieldSelector").value,aggrFunc:document.getElementById("pivotTableAggrFuncSelector").value,fieldName:document.getElementById("pivotTableCellFieldSelector").value,totalsRow:document.getElementById("pivotTableHasTotalsRow").checked,totalsCol:document.getElementById("pivotTableHasTotalsCol").checked},this.refresh()),e},e.prototype.saveToData=function(){var e=t.prototype.saveToData.call(this);return this.settings&&a.utils.assignDeep(e,this.settings),e},e.prototype.loadFromData=function(e){t.prototype.loadFromData.call(this,e),e&&(this.settings=a.utils.assignDeep(this.settings,e),"AVERAGE"==this.settings.aggrFunc&&(this.settings.aggrFunc=i.Average))},e.prototype.refreshCore=function(){if(this.updatePivotData(),this.grid){var t=this.pivotTable.getTotal();t>this.grid.options.paging.pageSize&&(this.contentDiv.classList.remove("pivot-grid-with-totals"),this.showErrorMessage(a.i18n.getText("Facets","ErrTooMuchData"))),this.options.viewportRowsCount>t?this.grid.options.viewportRowsCount=t:this.grid.options.viewportRowsCount=this.options.viewportRowsCount,this.grid.refresh()}},e.prototype.getContextDataTable=function(){return this.getContext().resultTable},e.prototype.updatePivotData=function(){this.pivotTable.clear();var t=this.getContextDataTable();if(t&&0!=t.getTotal()&&this.settings){var e=this.settings.colName,n=this.settings.rowName,o=this.settings.fieldName,r=t.columns.getIndex(e),s=t.columns.getIndex(n),l=t.columns.getIndex(o);if(null!=r&&null!=s&&null!=l){for(var u=t.columns.get(l),c=t.columns.get(r),d=t.columns.get(s),h=d.label,p=d.type,f=c.label,g=[],y=[],m=t.getCachedRows(),v=0;v<m.length;v++){var b=m[v].getValue(r);g.indexOf(b)<0&&g.push(b);var C=m[v].getValue(s);y.indexOf(C)<0&&y.push(C)}this.pivotTable.columns.add({id:h+"\\"+f,label:h+"\\"+f,description:"",type:p,dfmt:d.displayFormat,style:d.style});var x=[],w=null;a.utils.isNumericType(c.type)?w=this.formatNumber:a.utils.getDateDataTypes().indexOf(c.type)>=0&&(w=this.formatDate);for(v=0;v<g.length;v++){if(b=g[v]){var T=w?w(c,b):b;this.pivotTable.columns.add({id:b,label:T,description:"",dfmt:u.displayFormat,type:this.settings.aggrFunc!==i.Count?u.type:a.DataType.Int64,style:u.style})}else x.push(v)}var E=[];for(v=0;v<y.length;v++)E.push([]),E[v].push(y[v]);for(v=0;v<y.length;v++)for(var D=0;D<g.length;D++)x.indexOf(D)>=0||E[v].push(this.calcAggrFunc(this.settings.aggrFunc,{colName:this.settings.colName,rowName:this.settings.rowName,fieldName:this.settings.fieldName,rowValue:y[v],colValue:g[D]}));if(this.settings.totalsCol){this.pivotTable.columns.add({id:"total",label:a.i18n.getText("Facets","Pivot","TotalGridLabel"),description:"",dfmt:u.displayFormat,type:this.settings.aggrFunc!==i.Count?u.type:a.DataType.Int64});for(v=0;v<E.length;v++){var S=E[v],k=0;this.settings.aggrFunc!=i.Min&&this.settings.aggrFunc!=i.Max||(k=S[1]);for(D=1;D<S.length;D++){null!==(B=S[D])&&(this.settings.aggrFunc===i.Min?B<k&&(k=B):this.settings.aggrFunc===i.Max?B>k&&(k=B):k+=B)}this.settings.aggrFunc===i.Average&&(k/=S.length-1),S.push(k)}}for(var M=0,I=E;M<I.length;M++){S=I[M];this.pivotTable.addRow(S)}if(this.settings.totalsRow){var O=[];O.push(null);for(v=1;v<this.pivotTable.columns.count;v++){var A=this.pivotTable.getCachedRows(),P=0;this.settings.aggrFunc!=i.Min&&this.settings.aggrFunc!=i.Max||(P=A[0].getValue(v));for(D=0;D<A.length;D++){var B;null!==(B=A[D].getValue(v))&&(this.settings.aggrFunc===i.Min?B<P&&(P=B):this.settings.aggrFunc===i.Max?B>P&&(P=B):P+=B)}this.settings.aggrFunc===i.Average&&(P/=A.length),O.push(P)}this.pivotTable.addRow(O),this.contentDiv.classList.add("pivot-grid-with-totals")}else this.contentDiv.classList.remove("pivot-grid-with-totals")}else this.showUnableDisplayMessage(a.i18n.getText("Facets","ErrQueryChanged"))}},e.prototype.calcAggrFunc=function(t,e){switch(t){case i.Sum:return this.sum(e);case i.Average:return this.average(e);case i.Min:return this.min(e);case i.Max:return this.max(e);case i.Count:return this.count(e);default:return 0}},e.prototype.getSettings=function(){return this.settings},e.prototype.formatDate=function(t,e){var n="[object Date]"===Object.prototype.toString.call(e),o=(e||"").toString();if(n)if(t&&t.displayFormat&&h.test(t.displayFormat))o=t.displayFormat.replace(h,(function(n,o){return a.i18n.dateTimeToStr(e,t.type,o)}));else{var i=a.i18n.getCurrentLocale(),r={hour:"numeric",minute:"numeric",second:"numeric"};switch(t.type){case a.DataType.Date:o=e.toLocaleDateString(i);break;case a.DataType.Time:o=e.toLocaleTimeString(i,r);break;case a.DataType.DateTime:o=e.toLocaleDateString(i)+" "+e.toLocaleTimeString(i,r)}}return o},e.prototype.formatNumber=function(t,e){var n=(e||"").toString();return"number"==typeof e&&(n=t&&t.displayFormat&&h.test(t.displayFormat)?t.displayFormat.replace(h,(function(t,n){return a.i18n.numberToStr(e,n)})):e.toLocaleString()),n},e.prototype.sum=function(t){for(var e=0,n=this.getContextDataTable().getCachedRows(),o=0;o<n.length;o++){var i=n[o].getValue(t.rowName),r=n[o].getValue(t.colName);if(i===t.rowValue&&r===t.colValue)e+=n[o].getValue(t.fieldName)}return e},e.prototype.average=function(t){for(var e=0,n=0,o=this.getContextDataTable().getCachedRows(),i=0;i<o.length;i++){var r=o[i].getValue(t.rowName),s=o[i].getValue(t.colName);if(r===t.rowValue&&s===t.colValue)e+=o[i].getValue(t.fieldName),n++}return 0!=n&&(e/=n),e},e.prototype.min=function(t){for(var e=Number.MAX_SAFE_INTEGER,n=this.getContextDataTable().getCachedRows(),o=0;o<n.length;o++){var i=n[o].getValue(t.rowName),r=n[o].getValue(t.colName);if(i===t.rowValue&&r===t.colValue){var s=n[o].getValue(t.fieldName);s<e&&(e=s)}}return e==Number.MAX_SAFE_INTEGER?null:e},e.prototype.max=function(t){for(var e=Number.MIN_SAFE_INTEGER,n=this.getContextDataTable().getCachedRows(),o=0;o<n.length;o++){var i=n[o].getValue(t.rowName),r=n[o].getValue(t.colName);if(i===t.rowValue&&r===t.colValue){var s=n[o].getValue(t.fieldName);s>e&&(e=s)}}return e==Number.MIN_SAFE_INTEGER?null:e},e.prototype.count=function(t){for(var e=0,n=this.getContextDataTable().getCachedRows(),o=0;o<n.length;o++){var i=n[o].getValue(t.rowName),r=n[o].getValue(t.colName);i===t.rowValue&&r===t.colValue&&e++}return e},e}(u.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var o,i=n(2),r=n(31),s=n(15),a=n(44),l=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.grid=null,e.title=i.i18n.getText("Facets","DataTable","FacetTitle"),e.dialogTitle=i.i18n.getText("Facets","DataTable","DlgTitle"),e}return l(e,t),e.prototype.init=function(e){t.prototype.init.call(this,e),this.reinitGrid()},e.prototype.getSettings=function(){return this.settings},e.prototype.reinitGrid=function(){this.grid&&this.grid.destroy();var t=this.container.options||{};t.gridResolver&&(this.grid=t.gridResolver(this.contentDiv,this.getType())),null==this.grid&&(this.grid=new a.a(this.contentDiv)),t.grid=t.grid||{},t.grid.autoRefresh=!1,t.grid.addColumns=!1;var e=this.getContext();t.grid.totals=this.settings,this.grid.init(e,t.grid)},e.prototype.getType=function(){return s.a.DataGrid},e.prototype.canDisplay=function(){return!0},e.prototype.refreshCore=function(){this.grid&&this.grid.refresh()},e.prototype.destroy=function(){this.grid&&this.grid.destroy()},e}(r.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var o,i=n(0),r=n(2),s=n(45),a=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(e){var n=t.call(this,e)||this;return n.options={defFormat:"csv",enableExport:!0},n.clickHandler=function(t){n.slot.hasAttribute("disabled")||new s.a(n.context).show(n.options.defFormat)},n.group=r.WidgetGroup.All,n}return a(e,t),e.prototype.getWidgetType=function(){return"exportWidget"},e.prototype.init=function(e,n){t.prototype.init.call(this,e,n),this.options=i.utils.assignDeep(this.options,n),this.slot.addEventListener("click",this.clickHandler)},e.prototype.refreshCore=function(){this.options.enableExport&&this.context.resultTable&&this.context.resultTable.getCachedCount()>0?this.slot.removeAttribute("disabled"):this.slot.setAttribute("disabled","")},e.prototype.destroyCore=function(){this.slot.removeAttribute("disabled"),this.slot.removeEventListener("click",this.clickHandler)},e}(r.Widget)},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var o,i=n(2),r=n(3),s=n(94),a=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(e,n){var o=t.call(this,e)||this;return o.linkClickCallback=function(){new s.a(o.context).show(o.getQuery())},o.queryEventCallbackId=null,o.customQuery=n,o.group=i.WidgetGroup.Query|i.WidgetGroup.QueryStatus,o}return a(e,t),e.prototype.init=function(e,n){t.prototype.init.call(this,e,n),this.destroyCore(),this.attachQueryObserver()},Object.defineProperty(e.prototype,"cssPrefix",{get:function(){return"eqjs-aggrb"},enumerable:!0,configurable:!0}),e.prototype.getWidgetType=function(){return"aggregationBar"},e.prototype.refreshCore=function(){this.render()},e.prototype.getLinkText=function(){var t=this.getQuery();if(t.enableAggregation){for(var e=t.getAggregationSettings(),n=e.getInternalGroups(),o=e.getAggregates(),r=[],s=t.getColumns(),a=0,l=n;a<l.length;a++){var u=l[a].columns.map((function(t){var e=s.find((function(e){return e.id==t}));return e?e.caption:""}));r.push("["+u.join(", ")+"]")}for(var c=r.join(", "),d=[],h=t.getModel().getAggrFunctions(),p=function(t){var e=s.find((function(e){return e.id==t.colId})),n=h.find((function(e){return e.id==t.funcId}));e&&n&&d.push(e.caption+" ("+n.caption+")")},f=0,g=o;f<g.length;f++){p(g[f])}var y=d.join(", ");return(c||i.i18n.getText("AggrSettings","NoGroupsLabel"))+" ::: "+(y?"<"+y+">":i.i18n.getText("AggrSettings","NoAggrsLabel"))}return i.i18n.getText("AggrSettings","EmptySettingsLabel")},e.prototype.render=function(){this.slot.classList.add(this.cssPrefix+"-panel");var t=r.a.getMobileCssClass();t&&this.slot.classList.add(t),this.dialogLink||(this.dialogLink=document.createElement("a"),this.dialogLink.setAttribute("href","javascript:void(0)"),this.slot.appendChild(this.dialogLink)),this.dialogLink.textContent=this.getLinkText(),this.dialogLink.removeEventListener("click",this.linkClickCallback),this.dialogLink.addEventListener("click",this.linkClickCallback)},e.prototype.clear=function(){this.slot.innerHTML="",this.dialogLink=null},e.prototype.attachQueryObserver=function(){var t=this,e=this.getQuery();this.queryEventCallbackId=e.addChangedCallback((function(e){t.refreshCore()}))},e.prototype.detachQueryObserver=function(){this.queryEventCallbackId&&this.getQuery().removeChangedCallback(this.queryEventCallbackId)},e.prototype.destroyCore=function(){this.clear(),this.detachQueryObserver()},e.prototype.getQuery=function(){return this.customQuery||this.context.getQuery()},e}(i.Widget)},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return s}));var o=n(1),i=n(2),r=n(95),s=function(){function e(t){this.context=t,this.promise=null}return e.prototype.show=function(e){var n=this,o=e||this.context.getQuery();return this.query=this.context.createQuery(),this.query.loadFromData(o.toJSONData()),this.promise||(this.promise=new t((function(t,e){var s=n.context.getServices().getDialogService();n.body=n.renderBody();var a=s.open({title:i.i18n.getText("AggrSettings","AggrDialogTitle"),body:n.body,onSubmit:function(){return!(n.query.enableAggregation&&!n.renderer.isValid())&&(o.enableAggregation=n.query.enableAggregation,o.enableAggregation&&o.useAggregation((function(t){var e=n.renderer.getSettings();t.loadFromData(e.saveToData())})),o.fireChangedEvent({part:i.QueryChangePart.Aggregation,wasModified:!1}),t(),!0)},onCancel:function(){t()}});n.renderer=new r.a({slot:n.body.querySelector("#AggrSettingsComponent"),query:n.query,onChanged:function(){a.clearAlert();var t=n.renderer.isValid();if(!t){var e=n.renderer.getValidationMessage();a.showAlert(e,"warning")}a.getRootElement().querySelector(".kfrm-button.is-info").disabled=!t&&n.query.enableAggregation}}),n.query.enableAggregation&&n.renderer.render()}))),this.promise.catch((function(t){return console.error(t)})).finally((function(){return n.promise=null}))},e.prototype.renderBody=function(){var t=this;return Object(o.domel)("div").addChild("div",(function(e){return e.addClass("eqjs-as-enableaggr").addChild("label",(function(e){return e.addClass("eqjs-ctrl-switch").addChild("input",(function(e){e.attr("type","checkbox"),t.query.enableAggregation&&e.attr("checked",""),e.on("change",t.enableAggrCheckBoxChangeHandler.bind(t))})).addChild("span",(function(t){return t.addClass("slider round")})).addChild("span",(function(t){return t.addClass("switch-text").addText(i.i18n.getText("AggrSettings","EnableAggrLabel"))}))}))})).addChild("div",(function(t){return t.id("AggrSettingsComponent")})).toDOM()},e.prototype.enableAggrCheckBoxChangeHandler=function(t){if(this.query.enableAggregation=!this.query.enableAggregation,this.body.querySelector("#AggrSettingsComponent").innerHTML="",this.query.enableAggregation)this.renderer.render();else{var e=this.body?this.body.closest(".kdlg-modal").querySelector("footer .kfrm-button.is-info"):null;e&&(e.disabled=!1)}},e}()}).call(this,n(56))},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var o=n(0),i=n(1),r=n(9),s=n(2),a=function(){function t(t){if(this.selectState={columns:[]},this.funcMap={},!t||!t.slot)throw new Error("slot is required");if(!t||!t.query)throw new Error("query is required");this.slot=t.slot,this.query=t.query,this.onChanged=t.onChanged,this.dropSelectState(),this.dropState()}return Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"eqjs-as"},enumerable:!0,configurable:!0}),t.prototype.render=function(){this.createFunctionMenu(),this.setInitialState(),this.changed()},t.prototype.setInitialState=function(){for(var t=this.query.getAggregationSettings(),e=t.getInternalGroups(),n=t.getAggregates(),o=0,i=e;o<i.length;o++){var r=i[o];this.state.groups.push({columns:r.columns})}for(var s=0,a=n;s<a.length;s++){var l=a[s];this.state.aggregates.push({colId:l.colId,funcId:l.funcId})}this.state.grandTotals=t.hasGrandTotals(),this.state.recordCount=t.hasRecordCount()},t.prototype.getAvailableColumns=function(){return this.query.getColumns().filter((function(t){return t.enabled}))},t.prototype.renderCore=function(){var t=this;this.slot.innerHTML="";for(var e=this.getAvailableColumns(),n=Object(i.domel)(this.slot),o=null,r=null,a=null,l=this.state.aggregates,u=-1,c=function(e){if(o&&o.columns.indexOf(e.id)>=0)return d.renderColumn(r,e,!0),"continue";if(null!=(o=d.getGroupForColumn(e.id))){u++;var c=Object(i.domel)("div",d.slot).addClass(d.cssPrefix+"-group").data("gindex",""+u);return r=Object(i.domel)("div",c.toDOM()).addClass(d.cssPrefix+"-columns"),d.renderColumn(r,e,!0),"continue"}var h=l.filter((function(t){return t.colId==e.id}))[0];if(h){var p=Object(i.domel)("div",d.slot).addClass(d.cssPrefix+"-aggr");return d.renderColumn(p,e,!0,h.funcId),p.addChild("div",(function(e){return e.addClass(t.cssPrefix+"-buttons").addChild("button",(function(e){return e.addClass(t.cssPrefix+"-unaggr-btn").title(s.i18n.getText("AggrSettings","UnaggrBtn")).on("click",t.removeAggrBtnClickHandler.bind(t))}))})),"continue"}if(d.selectState.columns.indexOf(e.id)>=0){if(null==a){var f=Object(i.domel)("div",d.slot).addClass(d.cssPrefix+"-selected");a=Object(i.domel)("div",f.toDOM()).addClass(d.cssPrefix+"-columns")}return d.renderColumn(a,e,!1),"continue"}d.renderColumn(n,e,!1)},d=this,h=0,p=e;h<p.length;h++){c(p[h])}if(a){var f=Object(i.domel)("div",a.toDOM().parentElement).addClass(this.cssPrefix+"-buttons");f.addChild("button",(function(e){return e.addClass(t.cssPrefix+"-group-btn").title(s.i18n.getText("AggrSettings","GroupBtn")).on("click",t.groupBtnClickHandler.bind(t))})),1==this.selectState.columns.length&&f.addChild("button",(function(e){return e.addClass(t.cssPrefix+"-aggr-btn").title(s.i18n.getText("AggrSettings","AggrBtn")).on("click",t.aggrBtnClickHandler.bind(t))}))}Object(i.domel)(this.slot).addChild("div",(function(e){return e.addClass(t.cssPrefix+"-counts").addChild("label",(function(e){return e.addClass("eqjs-ctrl-switch").addChild("input",(function(e){e.attr("type","checkbox"),t.state.recordCount&&e.attr("checked",""),e.on("change",t.countsCheckboxChangeHandler.bind(t))})).addChild("span",(function(t){return t.addClass("slider round")})).addChild("span",(function(t){return t.addClass("switch-text").addText(s.i18n.getText("AggrSettings","GroupCountsLabel"))}))}))})).addChild("div",(function(e){return e.addClass(t.cssPrefix+"-grandtotals").addChild("label",(function(e){return e.addClass("eqjs-ctrl-switch").addChild("input",(function(e){e.attr("type","checkbox"),t.state.grandTotals&&e.attr("checked",""),e.on("change",t.grandCheckboxChangeHandler.bind(t))})).addChild("span",(function(t){return t.addClass("slider round")})).addChild("span",(function(t){return t.addClass("switch-text").addText(s.i18n.getText("AggrSettings","GrandTotalsLabel"))}))}))})),this.slot.querySelectorAll("."+this.cssPrefix+"-group").forEach((function(e){Object(i.domel)(e).addChild("div",(function(e){return e.addClass(t.cssPrefix+"-buttons").addChild("button",(function(e){return e.addClass(t.cssPrefix+"-ungroup-btn").title(s.i18n.getText("AggrSettings","UngroupBtn")).on("click",t.removeGroupBtnClickHandler.bind(t))}))}))})),this.validateCheckboxes()},t.prototype.validateCheckboxes=function(){if(0!==this.selectState.columns.length){for(var t,e,n=null,o=0;o<this.slot.childNodes.length;o++){(s=this.slot.childNodes[o]).classList.contains(this.cssPrefix+"-selected")?t&&t.classList.contains(this.cssPrefix+"-column")&&(e=t):s.classList.contains(this.cssPrefix+"-column")&&t&&t.classList.contains(this.cssPrefix+"-selected")&&(n=s),t=s}for(o=0;o<this.slot.childNodes.length;o++){(s=this.slot.childNodes[o]).classList.contains(this.cssPrefix+"-column")&&s!=e&&s!=n&&s.firstElementChild.firstElementChild.setAttribute("disabled","")}var i="."+this.cssPrefix+"-selected>."+this.cssPrefix+"-columns>."+this.cssPrefix+"-column",r=this.slot.querySelectorAll(i);for(o=1;o<r.length-1;o++){var s;(s=r[o]).firstElementChild.firstElementChild.setAttribute("disabled","")}}},t.prototype.isValid=function(){var t=this.selectState.columns.length,e=this.state.aggregates.length>0,n=this.state.groups.length>0,o=this.state.grandTotals,i=this.state.recordCount;return!t&&(n?e||i:!!e&&(n||o))},t.prototype.getValidationMessage=function(){var t=this.selectState.columns.length,e=this.state.aggregates.length>0,n=this.state.groups.length>0,o=this.state.grandTotals,i=this.state.recordCount;return t?s.i18n.getText("AggrSettings","SelectedError")+" ":!n||e||i?!e||n||o?s.i18n.getText("AggrSettings","NoGroupsOrAggrError")+" ":s.i18n.getText("AggrSettings","NoGroupsOrGrandError")+" ":s.i18n.getText("AggrSettings","NoAggrOrCountError")+" "},t.prototype.getSettings=function(){for(var t=new o.AggregationSettings(this.query),e=0,n=this.state.groups;e<n.length;e++){var i=n[e];t.addGroup({columns:i.columns})}for(var r=0,s=this.state.aggregates;r<s.length;r++){var a=s[r];t.addAggregateColumn(a.colId,a.funcId)}return this.state.grandTotals&&t.addGrandTotals(),this.state.recordCount&&t.addCounts(),t},t.prototype.renderColumn=function(t,e,n,o){var i=this;void 0===o&&(o=null),t.addChild("div",(function(t){t.data("colid",e.id);var r=o?e.caption+" ("+i.funcMap[o].caption+")":e.caption;n?t.addClass(i.cssPrefix+"-column-used").addText(r):t.addClass(i.cssPrefix+"-column").addChild("label",(function(t){return t.addClass("checkbox").addChild("input",(function(t){t.attr("type","checkbox"),i.selectState.columns.indexOf(e.id)>=0&&t.attr("checked",""),t.on("change",i.colCheckboxChangeHandler.bind(i))})).addText(r)}))}))},t.prototype.getGroupForColumn=function(t){var e=this.getGroupIndexForColumn(t);return e>=0?this.state.groups[e]:null},t.prototype.getGroupIndexForColumn=function(t){for(var e=0;e<this.state.groups.length;e++){if(this.state.groups[e].columns.indexOf(t)>=0)return e}return-1},t.prototype.grandCheckboxChangeHandler=function(t){this.state.grandTotals=!this.state.grandTotals,this.onChanged&&this.onChanged()},t.prototype.countsCheckboxChangeHandler=function(t){this.state.recordCount=!this.state.recordCount,this.onChanged&&this.onChanged()},t.prototype.colCheckboxChangeHandler=function(t){var e=t.target.parentElement.parentElement.getAttribute("data-colid"),n=this.selectState.columns.indexOf(e);if(n>=0)this.selectState.columns.splice(n,1);else{this.selectState.columns.push(e);var o=this.getAvailableColumns();this.selectState.columns=this.selectState.columns.sort((function(t,e){return o.findIndex((function(e){return e.id==t}))-o.findIndex((function(t){return t.id==e}))}))}this.changed()},t.prototype.groupBtnClickHandler=function(){this.state.groups.push({columns:this.selectState.columns});var t=this.getAvailableColumns();this.state.groups=this.state.groups.sort((function(e,n){return t.findIndex((function(t){return t.id==e.columns[0]}))-t.findIndex((function(t){return t.id==n.columns[0]}))})),this.dropSelectState(),this.changed()},t.prototype.removeGroupBtnClickHandler=function(t){var e=t.target,n=Number.parseInt(e.parentElement.parentElement.getAttribute("data-gindex"));this.state.groups.splice(n,1),this.changed()},t.prototype.removeAggrBtnClickHandler=function(t){var e=t.target.parentElement.parentElement.querySelector("."+this.cssPrefix+"-column-used").getAttribute("data-colid"),n=this.state.aggregates.findIndex((function(t){return t.colId==e}));n>=0&&(this.state.aggregates.splice(n,1),this.changed())},t.prototype.aggrBtnClickHandler=function(t){var e=this,n=(this.query.getModel(),this.selectState.columns[0]),o=this.getAvailableColumns().filter((function(t){return t.id==n}))[0];this.functionMenu.showMenu({anchor:t.target,itemFilterCallback:function(t){return e.funcMap[t.id].appliedTypes.indexOf(o.expr.dataType)>=0},itemSelectedCallback:function(t){e.state.aggregates.push({colId:n,funcId:t.id}),e.dropSelectState(),e.changed()}})},t.prototype.clear=function(){this.dropSelectState(),this.dropState(),this.changed()},t.prototype.dropSelectState=function(){this.selectState={columns:[]}},t.prototype.dropState=function(){this.state={groups:[],aggregates:[],recordCount:!0,grandTotals:!1}},t.prototype.changed=function(){this.onChanged&&this.onChanged(),this.renderCore()},t.prototype.createFunctionMenu=function(){for(var t=this.query.getModel(),e=[],n=0,o=this.query.getModel().getAggrFunctions();n<o.length;n++){var i=o[n];if(i){this.funcMap[i.id]=i;var s=t.getAggrFunctionCaption(i.id),a={id:i.id,text:s};e.push(a)}}var l=this.slot.id;l&&(l+="-FunctionsMenu");var u={items:e,id:l,searchBoxAlwaysShown:!1,domWriteItemsId:!0};this.functionMenu=new r.a(u)},t}()},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return o}));var o=function(){function e(t){this.context=t}return e.prototype.init=function(){},e.prototype.newQuery=function(t){var e=(t=t||{}).query||this.context.getQuery(),n=this.context.getModel(),o=t.modelId||(n?n.getId():"");t.queryId&&e.setId(t.queryId),t.name&&e.setName(t.name),t.description&&e.setDescription(t.description);var i={query:e.toJSONData()};t.data&&(i.data=t.data);var r=this.context.resolveEndpoint("NewQuery",{modelId:o});return this.context.getServices().getHttpClient().post(r,i).then((function(t){return t.query}))},e.prototype.getQueryList=function(e){var n=(e=e||{}).modelId||this.context.getModel().getId(),o=this.context.resolveEndpoint("GetQueryList",{modelId:n});return this.context.getServices().getHttpClient().get(o).then((function(e){return e.queries?e.queries:t.reject({message:"Wrong response format"})}))},e.prototype.loadQuery=function(t){t=t||{};var e=this.context.getModel(),n=this.context.getQuery(),o=t.modelId||e.getId(),i=t.queryId||n.getId(),r=this.context.resolveEndpoint("GetQuery",{modelId:o,queryId:i});return this.context.getServices().getHttpClient().get(r).then((function(t){return t.query}))},e.prototype.saveQuery=function(t){var e=(t=t||{}).query||this.context.getQuery(),n=t.queryId||e.getId();t.queryId&&e.setId(t.queryId);var o=t.modelId||e.getModel().getId();t.queryId&&e.setId(t.queryId);var i={query:e.toJSONData()};t.data&&(i.data=t.data);var r=this.context.resolveEndpoint("SaveQuery",{modelId:o,queryId:n});return this.context.getServices().getHttpClient().put(r,i).then((function(t){return t.query}))},e.prototype.removeQuery=function(t){t=t||{};var e=this.context.getQuery(),n=t.modelId||e.getModel().getId(),o=t.queryId||e.getId(),i={modelId:n,queryId:o};t.data&&(i.data=t.data);var r=this.context.resolveEndpoint("RemoveQuery",{modelId:n,queryId:o});return this.context.getServices().getHttpClient().delete(r,i).getPromise()},e}()}).call(this,n(100))},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var o,i=n(0),r=n(2),s=n(1),a=function(){function t(){this.formatStr="",this.pos=0,this.token="text",this.tokenText=""}return t.prototype.start=function(t){this.formatStr=t,this.pos=0,this.tokenText=""},t.prototype.skipSpaces=function(){for(;this.pos<this.formatStr.length&&" "===this.formatStr.charAt(this.pos);)this.pos++},t.prototype.getToken=function(){return this.token},t.prototype.getTokenText=function(){return this.tokenText},t.prototype.next=function(){if(this.skipSpaces(),this.pos>=this.formatStr.length)return!1;var t=0;if("{"===this.formatStr.charAt(this.pos)){if((t=this.formatStr.indexOf("}",this.pos))<0)return!1;this.tokenText=this.formatStr.substring(this.pos,t+1),0!==this.tokenText.indexOf("{expr")&&0!==this.tokenText.indexOf("{attr")||(this.token="expression"),this.pos=t+1}else if("["===this.formatStr.charAt(this.pos)&&this.pos<this.formatStr.length-1&&"["===this.formatStr.charAt(this.pos+1))this.pos+=2,t=this.formatStr.indexOf("]]",this.pos),this.token="function",this.tokenText=this.formatStr.substring(this.pos,t),this.pos=t+2;else{this.token="text";var e=this.formatStr.indexOf("{",this.pos);e<0&&(e=this.formatStr.length);var n=this.formatStr.indexOf("[[",this.pos);n<0&&(n=this.formatStr.length),t=Math.min(e,n),this.tokenText=this.formatStr.substring(this.pos,t).trim(),this.pos=t}return!0},t}(),l=n(30),u=n(3),c=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.displayFormatParser=new a,e}return c(e,t),e.prototype.getClassesToAdd=function(){return t.prototype.getClassesToAdd.call(this)+" "+this.cssPrefix+"-row "+this.cssPrefix+"-row-column-aggr"},e.prototype.getAttribute=function(){return this.panel.getContext().getModel().getAttributeByIdSafe(this.column.expr.args[0].value)},e.prototype.getDefaultColumnCaption=function(){return this.getDefaultTitleText(this.baseAttr)+" "+this.panel.getContext().getModel().getAggrFunctionCaption(this.column.expr.func)},e.prototype.renderExpressionBlock=function(){var t=this,e=this.panel.getContext().getModel(),n=Object(s.domel)("div").addClass(this.cssPrefix+"-expr-block",this.cssPrefix+"-expr-block-aggr").addClass(u.a.getMobileCssClass()),o=e.getAggrFunctionFormat(this.column.expr.func);if(o&&""!==o){var i=this.parseDisplayFormat(o);if(0!==i.length){for(var r=null,a=i.length,l=function(e){if(1===(r=i[e]).type)if(c.isEditable()){var o=Object(s.domel)("a").attr("href","javascript:void(0)").text(r.text).on("click",(function(e){e.stopPropagation(),t.functionMenu.showMenu({anchor:o.toDOM(),selectedIds:null,itemSelectedCallback:function(e,n){"CUSTOMSQL"===e.id?t.changeTypeToCustomSql():(t.column.expr.func=e.id,t.column.caption="",t.fireColumnChanged())}})}));n.addChild("div",(function(e){return e.addClass(t.cssPrefix+"-colelement",t.cssPrefix+"-aggrfuncelement").addClass(u.a.getMobileCssClass()).addChildElement(o.toDOM())}))}else n.addChild("div",(function(e){return e.addClass(t.cssPrefix+"-colelement",t.cssPrefix+"-aggrfuncelement").addClass(u.a.getMobileCssClass()).addChild("span",(function(t){return t.text(r.text).title(r.text)}))}));else 2===r.type?n.addChild("div",(function(e){return e.addClass(t.cssPrefix+"-colelement",t.cssPrefix+"-attrelement").addClass(u.a.getMobileCssClass()).addChildElement(t.renderBaseExpression())})):3===r.type&&n.addChild("span",(function(e){return e.addClass(t.cssPrefix+"-colelement").addClass(u.a.getMobileCssClass()).text(r.text).title(r.text)}))},c=this,d=0;d<a;d++)l(d);return n.toDOM()}}},e.prototype.renderColumnTypeButton=function(){var e=t.prototype.renderColumnTypeButton.call(this);return e&&(e.firstElementChild.classList.add("aggregated"),e.firstElementChild.setAttribute("title",i.i18n.getText("ButtonToSimple"))),e},e.prototype.baseExpressionItemSelectedCallback=function(t,e){var n=t.id;return this.column.expr.args[0].setValue(n,!0),this.column.caption="",this.fireColumnChanged(),!1},e.prototype.changeTypeToSimple=function(){this.column.getQuery().changeColumnType(this.column,r.ExprTag.EntityAttribute),this.fireColumnChanged()},e.prototype.parseDisplayFormat=function(t){if(!t)return[];var e=[],n=this.displayFormatParser;for(n.start(t);n.next();){var o=n.getToken(),i=n.getTokenText();"function"===o?e.push({type:1,text:i}):"expression"===o?e.push({type:2}):"text"===o&&e.push({type:3,text:i})}return e},e.prototype.changeTypeHandler=function(t){this.changeTypeToSimple()},e.prototype.processExtraButtonMenuItems=function(t,e){return this.changeTypeToSimple(),!0},e.prototype.getExtraButtonMenuItems=function(){return[{id:"__group",text:i.i18n.getText("ColTypeGroup"),items:[{id:"type",text:i.i18n.getText("ColTypeSimple")}]}]},e}(l.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var o,i=n(0),r=n(2),s=n(1),a=n(4),l=n(3),u=n(9),c=function(){function t(t,e,n){this.functionMenu=null,this.isMouseOverBlock=!1,this.keepShowingButtons=!1,this.bar=t,this.column=e,this.element=n}return Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"eqjs-sb"},enumerable:!0,configurable:!0}),t.prototype.render=function(){this.baseAttr=this.getAttribute();var t=Object(s.domel)("div");return t.data("id",this.column.id),this.element&&this.element.parentNode.replaceChild(t.toDOM(),this.element),this.element=t.toDOM(),t.addClass(this.getClassesToAdd()).addClass(l.a.getMobileCssClass()).addChildElement(this.renderCaptionBlock()),this.isEditable()&&t.addChildElement(this.renderSortingButton()),this.element},t.prototype.fireColumnChanged=function(){this.column.fireChangedEvent()},t.prototype.refresh=function(){this.render()},t.prototype.getAttribute=function(){return this.bar.getContext().getModel().getAttributeById(this.column.expr.value)},t.prototype.isEditable=function(){return this.column.enabled&&!this.column.isReadOnly()},t.prototype.renderCaptionBlock=function(){var t=this;this.column.caption&&""!=this.column.caption||(this.column.caption=this.getDefaultCaption());var e=this.column.caption;return this.isEditable()||(e+=function(t){switch(t){case r.SortDirection.Ascending:return" ↑";case r.SortDirection.Descending:return" ↓";default:return""}}(this.column.sorting)),Object(s.domel)("div").addClass(this.cssPrefix+"-colelement",this.cssPrefix+"-captionelement").addClass(l.a.getMobileCssClass()).addChild("div",(function(n){return n.title(t.column.caption).text(e)})).toDOM()},t.prototype.renderSortingButton=function(){var t=this,e=a.b+"-column-sortbutton",n=e;switch(this.column.sorting){case r.SortDirection.None:n=e+"-none";break;case r.SortDirection.Ascending:n=e+"-asc";break;case r.SortDirection.Descending:n=e+"-desc"}var o=Object(s.domel)("div").addClass(this.cssPrefix+"-colelement",this.cssPrefix+"-sortimage-placeholder").addClass(l.a.getMobileCssClass()).addChild("div",(function(e){return e.addClass(t.cssPrefix+"-img-sorting",n).title(i.i18n.getText("ButtonSorting"))})).on("touchstart click",(function(e){return t.buttonSortingClickHandler(e,o.toDOM())}));return o.toDOM()},t.prototype.buttonSortingClickHandler=function(t,e){var n=this;return t.stopPropagation(),this.keepShowingButtons=!0,this.bar.sortMenu.showMenu({anchor:e,selectedIds:null,itemSelectedCallback:function(t,e){var o;if("None"==t.id||"Ascending"==t.id||"Descending"==t.id){var i=n.bar.getContext().getQuery();n.column.isJustSorted()&&"None"==t.id?(i.removeColumn(n.column,n.bar),i.fireColumnsChangedEvent(r.QueryChangeAction.Delete,n.column,!0)):(n.column.sorting="None"==(o=t.id)?r.SortDirection.None:"Ascending"==o?r.SortDirection.Ascending:"Descending"==o?r.SortDirection.Descending:void 0,n.column.sortIndex=i.getColumnSortIndex(n.column),n.fireColumnChanged())}},menuClosedCallback:function(){n.keepShowingButtons=!1}}),!1},t.prototype.getDefaultCaption=function(){return this.getDefaultTitleText(this.baseAttr)},t.prototype.getDefaultTitleText=function(t){var e=this.bar.options.titleElementFormat||this.bar.options.attrElementFormat;return this.bar.getContext().getModel().getAttributeText(t,e)},t.prototype.getClassesToAdd=function(){return this.cssPrefix+"-row "+this.cssPrefix+"-row-column-entattr"},t.prototype.getUIS=function(){return this.bar.getContext().getModel().checkAttrProperty(this.column.expr.value,"useInSorting")},t}(),d=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),h=function(t){function e(e){var n=t.call(this,e)||this;return n.options={showAddRow:!0,attrElementFormat:"{entity} {attr}",titleElementFormat:null,menuOptions:{showSearchBoxAfter:30,searchBoxAutoFocus:!0,activateOnMouseOver:!0,adjustHeight:!0,itemRenderedCallback:null}},n.sortMenuList=[{id:"None",text:i.i18n.getText("CmdNotSorted")},{id:"Ascending",text:i.i18n.getText("CmdAscending")},{id:"Descending",text:i.i18n.getText("CmdDescending")}],Object(s.domel)(n.slot).addClass(n.cssPrefix+"-panel").addClass(l.a.getMobileCssClass()),n.group=r.WidgetGroup.Query,n}return d(e,t),Object.defineProperty(e.prototype,"cssPrefix",{get:function(){return"eqjs-sb"},enumerable:!0,configurable:!0}),e.prototype.getWidgetType=function(){return"sortingBar"},e.prototype.init=function(e,n){t.prototype.init.call(this,e,n),this.setOptions(n),this.destroyCore(),this.attachQueryObserver()},e.prototype.setOptions=function(t){i.utils.assignDeep(this.options,t)},e.prototype.attachQueryObserver=function(){var t=this,e=this.getQuery();this.queryEventCallbackId=e.addChangedCallback((function(e){var n=e.data;if(n&&(n.part==r.QueryChangePart.SortingColumns||n.part==r.QueryChangePart.Columns||n.part==r.QueryChangePart.All))switch(n.action){case r.QueryChangeAction.Modify:var o=n.changee,i=function(e){var n=t.columnsBlock.querySelector("div[data-id='"+e.id+"']");n&&t.renderColumn(e,n)};Array.isArray(o)?o.forEach((function(t){return i(t)})):i(o);break;case r.QueryChangeAction.Add:o=n.changee;var s=function(e){t.addColumnElement(e)};Array.isArray(o)?o.forEach((function(t){return s(t)})):s(o);break;case r.QueryChangeAction.Delete:o=n.changee;var a=function(e){var n=t.columnsBlock.querySelector("div[data-id='"+e.id+"']");n&&t.columnsBlock.removeChild(n)};Array.isArray(o)?o.forEach((function(t){return a(t)})):a(o);break;default:t.refresh()}}))},e.prototype.detachQueryObserver=function(){this.queryEventCallbackId&&this.getContext().getQuery().removeChangedCallback(this.queryEventCallbackId)},e.prototype.getQuery=function(){return this.getContext().getQuery()},e.prototype.destroyCore=function(){this.detachQueryObserver(),this.clear()},e.prototype.refreshCore=function(){this.clear(),this.render()},e.prototype.renderAddRowButton=function(){var t=this;Object(s.domel)(this.addRowButton).addClass(a.b+"-addrow",this.cssPrefix+"-addrow",a.b+"-addrow-empty").addClass(l.a.getMobileCssClass()).title(i.i18n.getText("CmdClickToAddColumn")).addChild("a",(function(e){return e.attr("href","javascript:void(0)").on("click",(function(e){e.preventDefault(),t.showEntitiesMenu({anchor:e.target,selectedIds:null,itemSelectedCallback:function(e,n){var o=e.id;return t.addNewColumn(o),!1}})}))})),l.a.isMobileMode()&&Object(s.domel)(this.columnsBlock).addChildElement(this.addRowButton)},e.prototype.showEntitiesMenu=function(t){this.entitiesMenu.showMenu(t)},e.prototype.createEntitiesMenu=function(){var t=this.getContext().getModel();if(!t||t.isEmpty())return null;var e=this.slot.id;e&&(e+="-EntitiesMenu");var n={items:t.getEntitiesTree({addUIC:!1,addUIR:!1,addUIS:!0}),adjustHeight:this.options.adjustEntitiesMenuHeight,id:e,domWriteItemsId:this.options.domWriteItemsId};this.entitiesMenu=new u.a(n)},e.prototype.createSortMenu=function(){var t=this.getContext().getModel();if(!t||t.isEmpty())return null;var e=this.slot.id;e&&(e+="-SortMenu");var n={items:this.sortMenuList,id:e,searchBoxAlwaysShown:!1};this.sortMenu=new u.a(n)},e.prototype.render=function(){var t=this;this.createEntitiesMenu(),this.createSortMenu(),this.columnsBlock=Object(s.domel)("div").addClass(this.cssPrefix+"-columns").addClass(l.a.getMobileCssClass()).toDOM(),this.options.showAddRow&&(this.addRowButton=Object(s.domel)("div").toDOM(),l.a.isMobileMode()?Object(s.domel)(this.columnsBlock).addChildElement(this.addRowButton):Object(s.domel)(this.slot).addChildElement(this.addRowButton),this.renderAddRowButton()),Object(s.domel)(this.slot).addChildElement(this.columnsBlock);var e=this.context.getQuery();e.getColumns().concat(e.getJustSortedColumns()).forEach((function(e,n){var o=t.renderColumn(e);t.columnsBlock.appendChild(o)}))},e.prototype.addNewColumn=function(t){var e=this,n=this.getContext().getModel(),o=this.getContext().getQuery();if(this.getContext().getQuery())return this.addColumn(function(t){var i=n.getAttributeById(t);if(!i)return null;if(!i.useInSorting){if(!i.lookupAttr)return null;if(t=i.lookupAttr,!(i=n.getAttributeById(t))||!i.useInSorting)return null}var s=o.createColumn(!0);return s.caption=e.getDefaultColumnCaption(i),s.sorting=r.SortDirection.Ascending,s.sortIndex=e.getQuery().getColumnSortIndex(s),s.expr.tag=r.ExprTag.EntityAttribute,s.expr.setValue(t,!0),s.params.concat(i.params),s}(t))},e.prototype.getDefaultColumnCaption=function(t){var e=this.options.titleElementFormat||this.options.attrElementFormat;return this.getContext().getModel().getAttributeText(t,e)},e.prototype.addColumn=function(t){var e=this.getContext().getQuery();if(e&&(t=this.checkColumn(t)))return t=e.addColumn({caption:t.caption,attributeId:t.expr.value,sorting:t.sorting,sortIndex:t.sortIndex,justsorted:!0}),e.fireChangedEvent({part:r.QueryChangePart.SortingColumns,action:r.QueryChangeAction.Add,changee:t}),t},e.prototype.checkColumn=function(t){for(var e=this.getContext().getQuery(),n=e.getColumns().concat(e.getJustSortedColumns()),o=JSON.stringify(t.expr.saveToData()),i=0;i<n.length;i++){if(JSON.stringify(n[i].expr.saveToData())===o)return null}return t},e.prototype.renderColumn=function(t,e){var n=new c(this,t,e);return n?n.render():null},e.prototype.addColumnElement=function(t){var e=this.renderColumn(t);this.columnsBlock.appendChild(e),this.options.columnRenderedCallback&&this.options.columnRenderedCallback(e)},e.prototype.clear=function(){this.slot.innerHTML=""},e}(r.Widget)},function(t,e,n){"use strict";n.d(e,"a",(function(){return v}));var o,i=n(2),r=n(0),s=n(1),a=n(15),l=n(3),u=n(9),c=n(4),d=n(45),h=n(89),p=n(90),f=n(91),g=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),y=function(t){function e(e){var n=t.call(this,e)||this;return n.facets=[],n.options={},n.group=i.WidgetGroup.Result,n}return g(e,t),e.prototype.destroyCore=function(){for(var t=0,e=this.facets;t<e.length;t++){e[t].destroy()}this.clear()},e.prototype.createFacetTab=function(t){var e=this.options[t];switch(t){case a.a.Chart:return new h.a(this,e);case a.a.PivotTable:return new p.a(this,e);default:return new f.a(this,e)}},e.prototype.getQuery=function(){return this.getContext().getQuery()},e}(i.Widget),m=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),v=function(t){function e(e){var n=t.call(this,e)||this;return n.activeFacetIndex=-1,n.firstRender=!0,n.options={showExportButton:!0,showRefreshButton:!0,showMaximizeButton:!0,maximize2Window:!1,showProcessIndicator:!0,facetTypes:[a.a.DataGrid,a.a.Chart,a.a.PivotTable]},n.menuItems=[{id:a.a.DataGrid,text:r.i18n.getText("Facets","AddMenuItems","DataTable")},{id:a.a.Chart,text:r.i18n.getText("Facets","AddMenuItems","Chart")},{id:a.a.PivotTable,text:r.i18n.getText("Facets","AddMenuItems","Pivot")}],n.menuItemsFilter=function(t){return!(n.options.facetTypes.indexOf(t.id)<0)&&(t.id!==a.a.DataGrid||0===n.facets.filter((function(t){return t.getType()==a.a.DataGrid})).length)},n.slot.classList.contains(n.cssPrefix+"-panel")||n.slot.classList.add(n.cssPrefix+"-panel"),n.renderProcessBlock(),n}return m(e,t),Object.defineProperty(e.prototype,"cssPrefix",{get:function(){return"eqjs-facets"},enumerable:!0,configurable:!0}),e.prototype.getWidgetType=function(){return"facetsPanel"},e.prototype.init=function(e,n){t.prototype.init.call(this,e,n),this.setOptions(n),this.destroyCore(),this.attachQueryObserver(),this.loadFacets()},e.prototype.attachQueryObserver=function(){var t=this,e=this.getQuery();this.queryEventCallbackId&&e.removeChangedCallback(this.queryEventCallbackId),this.queryEventCallbackId=e.addChangedCallback((function(e){var n=e.data;n.part==i.QueryChangePart.All&&n.source!=t&&(t.reloadFacets(),t.refreshCore(!0))}))},e.prototype.refreshCore=function(t){void 0===t&&(t=!1),(this.firstRender||t)&&(this.clear(),this.createAddMenu(),this.render()),this.validateAddFacetButton(),this.renderActiveFacet(),this.updateTotalRecords()},e.prototype.createAddMenu=function(){this.addMenu=new u.a({items:this.menuItems,id:"FacetType-List"})},e.prototype.updateTotalRecords=function(){var t=this.getContext().resultTable.getTotal();this.recordsDiv.innerHTML=r.i18n.getText("Facets","TotalRecordsLabel")+" "+t,0==t?Object(s.domel)(this.exportDiv).hide():Object(s.domel)(this.exportDiv).show()},e.prototype.renderProcessBlock=function(){this._processBlock=Object(s.domel)("div").addClass(this.cssPrefix+"-spinner").addChild("div",(function(t){return t.addClass(c.b+"-progress-win8",l.a.getMobileCssClass()).addHtml('<div class="wBall" id="wBall_1"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_2"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_3"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_4"><div class="wInnerBall"></div></div><div class="wBall" id="wBall_5"><div class="wInnerBall"></div></div>')})).toDOM()},e.prototype.onProcessStartCore=function(){this.options.showProcessIndicator&&!this._processBlock.parentNode&&this.bodyDiv&&(this.bodyDiv.childNodes.forEach((function(t){Object(s.domel)(t).hide()})),this.bodyDiv.appendChild(this._processBlock))},e.prototype.onProcessEndCore=function(){if(this.options.showProcessIndicator&&this._processBlock.parentNode)try{this._processBlock.parentNode.removeChild(this._processBlock)}catch(t){}finally{this.renderActiveFacet(!1)}},e.prototype.render=function(){var t=this;this.firstRender=!1,this.headerDiv=Object(s.domel)("div",this.slot).addClass(this.cssPrefix+"-header").toDOM(),this.tabsDiv=Object(s.domel)("div",this.headerDiv).addClass(this.cssPrefix+"-tabs").toDOM(),this.tabsUl=Object(s.domel)("ul",this.tabsDiv).addClass(this.cssPrefix+"-nav-tabs").toDOM(),this.bodyDiv=Object(s.domel)("div",this.slot).addClass(this.cssPrefix+"-body").toDOM();for(var e=0,n=this.facets;e<n.length;e++){var o=n[e];this.renderFacet(o)}Object(s.domel)(this.tabsDiv).addChild("div",(function(e){return t.addFacetButton=e.addClass(t.cssPrefix+"-add-button").title(r.i18n.getText("Facets","NewFacetTitle")).addChild("a",(function(t){return t.attr("href","javascript:void(0)")})).on("click",(function(e){return t.addClickHandler(e)})).toDOM()}));var i=Object(s.domel)("div",this.headerDiv).addClass(this.cssPrefix+"-manage").toDOM();if(this.recordsDiv=Object(s.domel)("div",i).addClass(this.cssPrefix+"-total-recs").toDOM(),this.options.showRefreshButton||this.options.showExportButton||this.options.showMaximizeButton){var a=Object(s.domel)("div",i).addClass(this.cssPrefix+"-total-buttons").toDOM();this.options.showExportButton&&(this.exportDiv=Object(s.domel)("button",a).on("click",(function(){return t.exportHandler()})).addClass(this.cssPrefix+"-button").addClass(this.cssPrefix+"-button-export").title(r.i18n.getText("Facets","ExportBtnTitle")).toDOM()),this.options.showRefreshButton&&Object(s.domel)("button",a).on("click",(function(){return t.refreshHandler()})).addClass(this.cssPrefix+"-button").addClass(this.cssPrefix+"-button-refresh").title(r.i18n.getText("Facets","RefreshBtnTitle")),this.options.showMaximizeButton&&(this.maximizeButton=Object(s.domel)("button",a).on("click",(function(){return t.options.maximize2Window?t.maximizeHandler(!0):t.maximizeHandler()})).addClass(this.cssPrefix+"-button").addClass(this.cssPrefix+"-button-maximize").title(r.i18n.getText("Facets","MaximizeBtnTitle")).toDOM())}},e.prototype.refreshHandler=function(){var t=this.getContext();t.fetchData({success:function(){t.refreshWidgets(i.WidgetGroup.Result)}})},e.prototype.exportHandler=function(){var t=this.getContext();new d.a(t).show()},e.prototype.maximizeHandler=function(t){var e=Object(s.domel)(this.slot);if(t)e.toggleClass(c.b+"-maximized-2window"),this.slot.classList.contains(c.b+"-maximized-2window")?(this.maximizeButton.title=r.i18n.getText("Facets","RestoreBtnTitle"),this.maximizeButton.classList.toggle(this.cssPrefix+"-button-maximize",!1),this.maximizeButton.classList.toggle(this.cssPrefix+"-button-restore",!0)):(this.maximizeButton.title=r.i18n.getText("Facets","MaximizeBtnTitle"),this.maximizeButton.classList.toggle(this.cssPrefix+"-button-restore",!1),this.maximizeButton.classList.toggle(this.cssPrefix+"-button-maximize",!0));else{var n=!this.slot.hasAttribute("data-is-maximized");n?(this.slot.setAttribute("data-is-maximized",""),this.maximizeButton.title=r.i18n.getText("Facets","RestoreBtnTitle"),this.maximizeButton.classList.toggle(this.cssPrefix+"-button-maximize",!1),this.maximizeButton.classList.toggle(this.cssPrefix+"-button-restore",!0)):(this.slot.removeAttribute("data-is-maximized"),this.maximizeButton.title=r.i18n.getText("Facets","MaximizeBtnTitle"),this.maximizeButton.classList.toggle(this.cssPrefix+"-button-restore",!1),this.maximizeButton.classList.toggle(this.cssPrefix+"-button-maximize",!0)),document.querySelectorAll("[data-hide-on-max]").forEach((function(t){n?t.setAttribute("style","display: none;"):t.removeAttribute("style")}))}this.facets.forEach((function(t){return t.onResize()}))},e.prototype.renderActiveFacet=function(t){var e=this;void 0===t&&(t=!0),this.tabsUl.querySelectorAll("li").forEach((function(t,n){t.classList.contains("active")&&t.classList.remove("active"),e.activeFacetIndex===n&&t.classList.add("active")})),this.bodyDiv.querySelectorAll("."+c.b+"-facet").forEach((function(n,o){Object(s.domel)(n).hide(),e.activeFacetIndex===o&&(Object(s.domel)(n).show(),t&&e.facets[o].refresh())}))},e.prototype.renderFacet=function(t){this.renderFacetTab(t);var e=this.renderFacetSlot(t);t.init(e)},e.prototype.renderFacetTab=function(t){var e=this;return Object(s.domel)("li",this.tabsUl).addChild("span",(function(n){return n.addClass(c.b+"-facet-settings").on("click",(function(n){n.stopPropagation(),e.settingsClickHandler(t)}))})).addChild("a",(function(e){return e.addText(t.title).attr("href","javascript:void(0)")})).addChild("span",(function(n){return n.addClass(c.b+"-facet-close").on("click",(function(n){n.stopPropagation(),e.closeClickHandler(t)}))})).on("click",(function(n){return e.selectClickHandler(t)})).toDOM()},e.prototype.renderFacetSlot=function(t){return Object(s.domel)("div",this.bodyDiv).addClass(c.b+"-facet").hide().toDOM()},e.prototype.refreshFacetTabs=function(){var t=this;this.tabsUl.querySelectorAll("li").forEach((function(e){t.tabsUl.removeChild(e)}));for(var e=0,n=this.facets;e<n.length;e++){var o=n[e];this.renderFacetTab(o)}},e.prototype.removeFacet=function(t){var e=this.facets.indexOf(t);if(e>=0){this.facets.splice(e,1);var n=this.tabsUl.childNodes[e];this.tabsUl.removeChild(n);var o=this.bodyDiv.childNodes[e];this.bodyDiv.removeChild(o),this.facets.length>0?this.activeFacetIndex=e<this.facets.length?e:this.facets.length-1:this.activeFacetIndex=-1,this.renderActiveFacet(),this.validateAddFacetButton()}},e.prototype.addClickHandler=function(t){var e=this;this.addMenu.showMenu({anchor:t.target,itemFilterCallback:this.menuItemsFilter,itemSelectedCallback:function(t){var n=e.createFacetTab(t.id),o=e.renderFacetSlot(n);n.init(o),n.showSettingsDialog().then((function(t){t?(e.facets.push(n),e.activeFacetIndex=e.facets.length-1,e.renderFacetTab(n),e.renderActiveFacet(),e.saveFacets()):e.bodyDiv.removeChild(o)})).catch((function(t){return console.error(t)}))}})},e.prototype.selectClickHandler=function(t){var e=this.facets.indexOf(t);this.setActiveFacet(e)},e.prototype.settingsClickHandler=function(t){var e=this;t.showSettingsDialog().then((function(t){t&&(e.refreshFacetTabs(),e.renderActiveFacet(),e.saveFacets())})).catch((function(t){return console.error(t)}))},e.prototype.closeClickHandler=function(t){var e=this;this.getDialogService().openConfirm(r.i18n.getText("Facets","RemoveFacetDlgTitle"),r.i18n.getText("Facets","RemoveFacetDlgContent").replace("{facetTitle}",t.title)).then((function(n){n&&(e.removeFacet(t),e.saveFacets())})).catch((function(t){return console.error(t)}))},e.prototype.clear=function(){this.firstRender=!0,this.slot.innerHTML=""},e.prototype.createDefaultFacetIfNotExist=function(){if(0===this.facets.length){var t=this.createFacetTab(a.a.DataGrid);this.facets.push(t),this.activeFacetIndex=0}},e.prototype.validateAddFacetButton=function(){this.addFacetButton.hidden=0==this.addMenu.getItems().filter(this.menuItemsFilter).length},e.prototype.setActiveFacet=function(t){this.activeFacetIndex!=t&&(this.activeFacetIndex=t,this.renderActiveFacet(),this.saveFacets(!0))},e.prototype.setOptions=function(t){r.utils.assignDeep(this.options,t)},e.prototype.getDialogService=function(){return this.getContext().getServices().getDialogService()},e.prototype.saveFacets=function(t){void 0===t&&(t=!1);var e=this.getQuery();e.innerData=e.innerData||{},e.innerData.facets={active:this.activeFacetIndex,items:this.facets.map((function(t){return t.saveToData()}))},e.fireChangedEvent({part:i.QueryChangePart.Facets,action:t?i.QueryChangeAction.Activate:i.QueryChangeAction.All,source:this})},e.prototype.reloadFacets=function(){for(var t=0,e=this.facets;t<e.length;t++){e[t].destroy()}this.loadFacets()},e.prototype.loadFacets=function(){var t=this.getQuery();if(this.facets=[],t.innerData&&t.innerData.facets){for(var e=0,n=t.innerData.facets.items;e<n.length;e++){var o=n[e],i=this.createFacetTab(o.type);i.loadFromData(o),this.facets.push(i)}var r=t.innerData.facets.active;this.activeFacetIndex=r>=0?r:this.facets.length-1}else this.createDefaultFacetIfNotExist()},e}(y)},function(t,e,n){(function(e,n){var o;o=function(){"use strict";function t(t){return"function"==typeof t}var o=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},i=0,r=void 0,s=void 0,a=function(t,e){f[i]=t,f[i+1]=e,2===(i+=2)&&(s?s(g):C())},l="undefined"!=typeof window?window:void 0,u=l||{},c=u.MutationObserver||u.WebKitMutationObserver,d="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function p(){var t=setTimeout;return function(){return t(g,1)}}var f=new Array(1e3);function g(){for(var t=0;t<i;t+=2)(0,f[t])(f[t+1]),f[t]=void 0,f[t+1]=void 0;i=0}var y,m,v,b,C=void 0;function x(t,e){var n=this,o=new this.constructor(E);void 0===o[T]&&L(o);var i=n._state;if(i){var r=arguments[i-1];a((function(){return B(i,o,r,n._result)}))}else A(n,o,t,e);return o}function w(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(E);return k(e,t),e}d?C=function(){return e.nextTick(g)}:c?(m=0,v=new c(g),b=document.createTextNode(""),v.observe(b,{characterData:!0}),C=function(){b.data=m=++m%2}):h?((y=new MessageChannel).port1.onmessage=g,C=function(){return y.port2.postMessage(0)}):C=void 0===l?function(){try{var t=Function("return this")().require("vertx");return void 0!==(r=t.runOnLoop||t.runOnContext)?function(){r(g)}:p()}catch(t){return p()}}():p();var T=Math.random().toString(36).substring(2);function E(){}var D=void 0;function S(e,n,o){n.constructor===e.constructor&&o===x&&n.constructor.resolve===w?function(t,e){1===e._state?I(t,e._result):2===e._state?O(t,e._result):A(e,void 0,(function(e){return k(t,e)}),(function(e){return O(t,e)}))}(e,n):void 0===o?I(e,n):t(o)?function(t,e,n){a((function(t){var o=!1,i=function(t,e,n,o){try{t.call(e,n,o)}catch(t){return t}}(n,e,(function(n){o||(o=!0,e!==n?k(t,n):I(t,n))}),(function(e){o||(o=!0,O(t,e))}),t._label);!o&&i&&(o=!0,O(t,i))}),t)}(e,n,o):I(e,n)}function k(t,e){if(t===e)O(t,new TypeError("You cannot resolve a promise with itself"));else if(i=typeof(o=e),null===o||"object"!==i&&"function"!==i)I(t,e);else{var n=void 0;try{n=e.then}catch(e){return void O(t,e)}S(t,e,n)}var o,i}function M(t){t._onerror&&t._onerror(t._result),P(t)}function I(t,e){t._state===D&&(t._result=e,t._state=1,0!==t._subscribers.length&&a(P,t))}function O(t,e){t._state===D&&(t._state=2,t._result=e,a(M,t))}function A(t,e,n,o){var i=t._subscribers,r=i.length;t._onerror=null,i[r]=e,i[r+1]=n,i[r+2]=o,0===r&&t._state&&a(P,t)}function P(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var o=void 0,i=void 0,r=t._result,s=0;s<e.length;s+=3)o=e[s],i=e[s+n],o?B(n,o,i,r):i(r);t._subscribers.length=0}}function B(e,n,o,i){var r=t(o),s=void 0,a=void 0,l=!0;if(r){try{s=o(i)}catch(t){l=!1,a=t}if(n===s)return void O(n,new TypeError("A promises callback cannot return that same promise."))}else s=i;n._state!==D||(r&&l?k(n,s):!1===l?O(n,a):1===e?I(n,s):2===e&&O(n,s))}var _=0;function L(t){t[T]=_++,t._state=void 0,t._result=void 0,t._subscribers=[]}var R=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(E),this.promise[T]||L(this.promise),o(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?I(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&I(this.promise,this._result))):O(this.promise,new Error("Array Methods must be provided an Array"))}return t.prototype._enumerate=function(t){for(var e=0;this._state===D&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,o=n.resolve;if(o===w){var i=void 0,r=void 0,s=!1;try{i=t.then}catch(t){s=!0,r=t}if(i===x&&t._state!==D)this._settledAt(t._state,e,t._result);else if("function"!=typeof i)this._remaining--,this._result[e]=t;else if(n===F){var a=new n(E);s?O(a,r):S(a,t,i),this._willSettleAt(a,e)}else this._willSettleAt(new n((function(e){return e(t)})),e)}else this._willSettleAt(o(t),e)},t.prototype._settledAt=function(t,e,n){var o=this.promise;o._state===D&&(this._remaining--,2===t?O(o,n):this._result[e]=n),0===this._remaining&&I(o,this._result)},t.prototype._willSettleAt=function(t,e){var n=this;A(t,void 0,(function(t){return n._settledAt(1,e,t)}),(function(t){return n._settledAt(2,e,t)}))},t}(),F=function(){function e(t){this[T]=_++,this._result=this._state=void 0,this._subscribers=[],E!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof e?function(t,e){try{e((function(e){k(t,e)}),(function(e){O(t,e)}))}catch(e){O(t,e)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(t){return this.then(null,t)},e.prototype.finally=function(e){var n=this,o=n.constructor;return t(e)?n.then((function(t){return o.resolve(e()).then((function(){return t}))}),(function(t){return o.resolve(e()).then((function(){throw t}))})):n.then(e,e)},e}();return F.prototype.then=x,F.all=function(t){return new R(this,t).promise},F.race=function(t){var e=this;return o(t)?new e((function(n,o){for(var i=t.length,r=0;r<i;r++)e.resolve(t[r]).then(n,o)})):new e((function(t,e){return e(new TypeError("You must pass an array to race."))}))},F.resolve=w,F.reject=function(t){var e=new this(E);return O(e,t),e},F._setScheduler=function(t){s=t},F._setAsap=function(t){a=t},F._asap=a,F.polyfill=function(){var t=void 0;if(void 0!==n)t=n;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var o=null;try{o=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===o&&!e.cast)return}t.Promise=F},F.Promise=F,F},t.exports=o()}).call(this,n(113),n(114))},function(t,e,n){"use strict";(function(t){n.d(e,"b",(function(){return c})),n.d(e,"a",(function(){return d}));var o,i=n(11),r=n(110),s=n(36),a=n(57),l=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=function(){return u=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},u.apply(this,arguments)},c=function(t){function e(e,n){var o=t.call(this,n)||this;return o.status=e,o}return l(e,t),e}(Error),d=function(){function e(){this.defaultHeaders={},this.customPayload=void 0}return Object.defineProperty(e.prototype,"responseBody",{get:function(){return this._responseBody},enumerable:!0,configurable:!0}),e.prototype.get=function(t,e){return this.send(s.a.Get,t,null,e)},e.prototype.post=function(t,e,n){return this.send(s.a.Post,t,e,n)},e.prototype.put=function(t,e,n){return this.send(s.a.Put,t,e,n)},e.prototype.delete=function(t,e,n){return this.send(s.a.Delete,t,e,n)},e.prototype.send=function(n,o,s,l){var d=this,h=(l=l||{}).dataType||"json",p=l.contentType||"form-data"!==h?"application/json":null;s&&"form-data"!=h&&this.customPayload&&(s.data=i.a.assignDeep(s.data||{},this.customPayload));var f=new("onload"in new XMLHttpRequest?XMLHttpRequest:window.XDomainRequest),g={method:n,url:o,headers:u(u({},this.defaultHeaders),l.headers||{}),queryParams:l.queryParams||{},data:s};p&&(g.headers["Content-Type"]=p);var y=new a.a(f,g);this.beforeEachRequest&&(console.warn("HttpClient: 'beforeEachRequest' is deprecated and will be removed in future updates.\n Use 'onRequest' instead"),this.beforeEachRequest(y)),this.onRequest&&this.onRequest(y);var m=y.data&&"string"!=typeof y.data&&"json"==h?JSON.stringify(y.data):y.data;return y.open(),new r.a(y,new t((function(n,i){l.responseType&&(f.responseType=l.responseType),f.onerror=function(t){i(new c(f.status,f.responseText))},f.onreadystatechange=function(){if(4==f.readyState){var r=f.getResponseHeader("Content-Type")||"",s=f.status;if(0===s)i(new c(s,"Network error or the request was aborted"));else if(s>=200&&s<400){var a="arraybuffer"===f.responseType||"blob"===f.responseType?f.response:0==r.indexOf("application/json")?JSON.parse(f.responseText):f.responseText;d._responseBody=a,d.onResponse&&d.onResponse(f),n(a)}else{("arraybuffer"===f.responseType||"blob"===f.responseType?e.decodeArrayBuffer(f.response):t.resolve(f.responseText)).then((function(t){var e=0==r.indexOf("application/json")?JSON.parse(t):t;d._responseBody=e;var n=e.message||(404==s?"No such endpoint: "+o:e);i(new c(s,n))}))}}},f.send(m)})))},e.decodeArrayBuffer=function(e){var n=new FileReader;return new t((function(t){n.onloadend=function(){n.readyState==FileReader.DONE&&t(n.result)},n.readAsText(new Blob([e]))}))},e}()}).call(this,n(102))},function(t,e,n){(function(e,n){var o;o=function(){"use strict";function t(t){return"function"==typeof t}var o=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},i=0,r=void 0,s=void 0,a=function(t,e){f[i]=t,f[i+1]=e,2===(i+=2)&&(s?s(g):C())},l="undefined"!=typeof window?window:void 0,u=l||{},c=u.MutationObserver||u.WebKitMutationObserver,d="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function p(){var t=setTimeout;return function(){return t(g,1)}}var f=new Array(1e3);function g(){for(var t=0;t<i;t+=2)(0,f[t])(f[t+1]),f[t]=void 0,f[t+1]=void 0;i=0}var y,m,v,b,C=void 0;function x(t,e){var n=this,o=new this.constructor(E);void 0===o[T]&&L(o);var i=n._state;if(i){var r=arguments[i-1];a((function(){return B(i,o,r,n._result)}))}else A(n,o,t,e);return o}function w(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(E);return k(e,t),e}d?C=function(){return e.nextTick(g)}:c?(m=0,v=new c(g),b=document.createTextNode(""),v.observe(b,{characterData:!0}),C=function(){b.data=m=++m%2}):h?((y=new MessageChannel).port1.onmessage=g,C=function(){return y.port2.postMessage(0)}):C=void 0===l?function(){try{var t=Function("return this")().require("vertx");return void 0!==(r=t.runOnLoop||t.runOnContext)?function(){r(g)}:p()}catch(t){return p()}}():p();var T=Math.random().toString(36).substring(2);function E(){}var D=void 0;function S(e,n,o){n.constructor===e.constructor&&o===x&&n.constructor.resolve===w?function(t,e){1===e._state?I(t,e._result):2===e._state?O(t,e._result):A(e,void 0,(function(e){return k(t,e)}),(function(e){return O(t,e)}))}(e,n):void 0===o?I(e,n):t(o)?function(t,e,n){a((function(t){var o=!1,i=function(t,e,n,o){try{t.call(e,n,o)}catch(t){return t}}(n,e,(function(n){o||(o=!0,e!==n?k(t,n):I(t,n))}),(function(e){o||(o=!0,O(t,e))}),t._label);!o&&i&&(o=!0,O(t,i))}),t)}(e,n,o):I(e,n)}function k(t,e){if(t===e)O(t,new TypeError("You cannot resolve a promise with itself"));else if(i=typeof(o=e),null===o||"object"!==i&&"function"!==i)I(t,e);else{var n=void 0;try{n=e.then}catch(e){return void O(t,e)}S(t,e,n)}var o,i}function M(t){t._onerror&&t._onerror(t._result),P(t)}function I(t,e){t._state===D&&(t._result=e,t._state=1,0!==t._subscribers.length&&a(P,t))}function O(t,e){t._state===D&&(t._state=2,t._result=e,a(M,t))}function A(t,e,n,o){var i=t._subscribers,r=i.length;t._onerror=null,i[r]=e,i[r+1]=n,i[r+2]=o,0===r&&t._state&&a(P,t)}function P(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var o=void 0,i=void 0,r=t._result,s=0;s<e.length;s+=3)o=e[s],i=e[s+n],o?B(n,o,i,r):i(r);t._subscribers.length=0}}function B(e,n,o,i){var r=t(o),s=void 0,a=void 0,l=!0;if(r){try{s=o(i)}catch(t){l=!1,a=t}if(n===s)return void O(n,new TypeError("A promises callback cannot return that same promise."))}else s=i;n._state!==D||(r&&l?k(n,s):!1===l?O(n,a):1===e?I(n,s):2===e&&O(n,s))}var _=0;function L(t){t[T]=_++,t._state=void 0,t._result=void 0,t._subscribers=[]}var R=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(E),this.promise[T]||L(this.promise),o(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?I(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&I(this.promise,this._result))):O(this.promise,new Error("Array Methods must be provided an Array"))}return t.prototype._enumerate=function(t){for(var e=0;this._state===D&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,o=n.resolve;if(o===w){var i=void 0,r=void 0,s=!1;try{i=t.then}catch(t){s=!0,r=t}if(i===x&&t._state!==D)this._settledAt(t._state,e,t._result);else if("function"!=typeof i)this._remaining--,this._result[e]=t;else if(n===F){var a=new n(E);s?O(a,r):S(a,t,i),this._willSettleAt(a,e)}else this._willSettleAt(new n((function(e){return e(t)})),e)}else this._willSettleAt(o(t),e)},t.prototype._settledAt=function(t,e,n){var o=this.promise;o._state===D&&(this._remaining--,2===t?O(o,n):this._result[e]=n),0===this._remaining&&I(o,this._result)},t.prototype._willSettleAt=function(t,e){var n=this;A(t,void 0,(function(t){return n._settledAt(1,e,t)}),(function(t){return n._settledAt(2,e,t)}))},t}(),F=function(){function e(t){this[T]=_++,this._result=this._state=void 0,this._subscribers=[],E!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof e?function(t,e){try{e((function(e){k(t,e)}),(function(e){O(t,e)}))}catch(e){O(t,e)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(t){return this.then(null,t)},e.prototype.finally=function(e){var n=this,o=n.constructor;return t(e)?n.then((function(t){return o.resolve(e()).then((function(){return t}))}),(function(t){return o.resolve(e()).then((function(){throw t}))})):n.then(e,e)},e}();return F.prototype.then=x,F.all=function(t){return new R(this,t).promise},F.race=function(t){var e=this;return o(t)?new e((function(n,o){for(var i=t.length,r=0;r<i;r++)e.resolve(t[r]).then(n,o)})):new e((function(t,e){return e(new TypeError("You must pass an array to race."))}))},F.resolve=w,F.reject=function(t){var e=new this(E);return O(e,t),e},F._setScheduler=function(t){s=t},F._setAsap=function(t){a=t},F._asap=a,F.polyfill=function(){var t=void 0;if(void 0!==n)t=n;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var o=null;try{o=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===o&&!e.cast)return}t.Promise=F},F.Promise=F,F},t.exports=o()}).call(this,n(54),n(55))},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return a}));var o=n(58),i=n(49),r=n(7),s=n(11),a=function(){function e(t){if(this._chunkSize=1e3,this._elasticChunks=!1,this.cachedRows=[],this.total=0,this.loader=null,this.needTotal=!0,this.isInMemory=!1,t=t||{},this._chunkSize=t.chunkSize||this._chunkSize,this._elasticChunks=t.elasticChunks||this._elasticChunks,this.loader=t.loader,void 0!==t.inMemory&&(this.isInMemory=t.inMemory),this.isInMemory&&(this.needTotal=!1),this._columns=new o.c,this.onUpdate=t.onUpdate,t.columns)for(var e=0,n=t.columns;e<n.length;e++){var i=n[e];this._columns.add(i)}if(t.rows)for(var r=0,s=t.rows;r<s.length;r++){var a=s[r],l=this.createRow(a);this.addRow(l)}this.needTotal=!this._elasticChunks}return Object.defineProperty(e.prototype,"columns",{get:function(){return this._columns},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"chunkSize",{get:function(){return this._chunkSize},set:function(t){this._chunkSize=t,this.total=0,this.needTotal=!this.elasticChunks,this.cachedRows=[]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"elasticChunks",{get:function(){return this._elasticChunks},set:function(t){this._elasticChunks=t,this.total=0,this.needTotal=!this.elasticChunks,this.cachedRows=[]},enumerable:!0,configurable:!0}),e.prototype.getRows=function(e){var n=this,o=0,i=this._chunkSize;e&&("page"in e?(o=e.pageSize*(e.page-1),i=e.pageSize):(o=e.offset,i=e.limit));var r=o+i;if(!this.needTotal&&!this.elasticChunks){if(o>=this.total)return t.resolve([]);r>this.total&&(r=this.total)}if(this.isInMemory&&r>this.cachedRows.length&&(r=this.cachedRows.length),r<=this.cachedRows.length)return t.resolve(this.cachedRows.slice(o,r));if(!this.loader)throw"Loader is not defined. Can't get the rows from "+o+" to "+r;var s=this.needTotal;this.needTotal&&(this.needTotal=!1);var a=this.cachedRows.length,l=r-a;return l<this._chunkSize&&(l=this._chunkSize),this.loader.loadChunk({offset:a,limit:l,needTotal:s}).then((function(t){(s&&(n.total=t.total),Array.prototype.push.apply(n.cachedRows,t.table.getCachedRows()),r>n.cachedRows.length&&(r=n.cachedRows.length),n.elasticChunks)&&(t.table.getCachedCount()<l&&(n.total=n.cachedRows.length));return n.fireUpdated(),n.cachedRows.slice(o,r)}))},e.prototype.getRow=function(t){return this.getRows({offset:t,limit:1}).then((function(t){return t.length>0?t[0]:null}))},e.prototype.getTotal=function(){return this.total},e.prototype.setTotal=function(t){this.total=t,this.needTotal=!1},e.prototype.getCachedCount=function(){return this.cachedRows.length},e.prototype.clear=function(){this.columns.clear(),this.cachedRows=[],this.total=0,this.needTotal=!this._elasticChunks,this.fireUpdated()},e.prototype.createRow=function(t){var e=this,n=this._columns.getDateColumnIndexes(),o=new Array(this._columns.count),r=t instanceof i.a?function(e){return t.getValue(e)}:function(e){return t[e]};return t&&this.columns.getItems().forEach((function(t){var i=r(t.id),s=e.columns.getIndex(t.id);o[s]=n.indexOf(s)>=0?e.mapDate(i,t.type):i})),new i.a(this._columns,o)},e.prototype.mapDate=function(t,e){if(t){var n=new Date(t);return isNaN(n.getTime())&&e==r.a.Time&&(n=s.a.strToTime(t)),n}return null},e.prototype.addRow=function(t){var e;if(Array.isArray(t)){var n=t,o=this._columns.getDateColumnIndexes();if(o.length>0)for(var r=0,s=o;r<s.length;r++){var a=s[r];n[a]&&(n[a]=this.mapDate(n[a],this._columns.get(a).type))}e=new i.a(this._columns,n)}else e=this.createRow(t);this.cachedRows.push(e);var l=this.getCachedCount();return l>this.total&&(this.total=l),e},e.prototype.getCachedRows=function(){return this.cachedRows},e.prototype.totalIsKnown=function(){return this.elasticChunks?this.getCachedCount()===this.total:!this.needTotal},e.prototype.fireUpdated=function(){this.onUpdate&&this.onUpdate(this)},e}()}).call(this,n(102))},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return GoogleDataConverter}));var _easydata_core__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(0),GoogleDataConverter=function(){function GoogleDataConverter(t){t||(t={cols:[],rows:[]}),"string"==typeof t?this.loadFromJSON(t):this.tableObj=t}return GoogleDataConverter.prototype.loadFromJSON=function(t){this.tableObj=JSON.parse(t)},GoogleDataConverter.prototype.toJSON=function(){return JSON.stringify(this.tableObj)},GoogleDataConverter.prototype.getObject=function(){return this.tableObj},GoogleDataConverter.prototype.isEmpty=function(){return 0==this.getNumberOfColumns()||0==this.getNumberOfRows()},GoogleDataConverter.prototype.getNumberOfColumns=function(){return this.tableObj.cols.length},GoogleDataConverter.prototype.getColumnObject=function(t){return t<this.tableObj.cols.length?this.tableObj.cols[t]:null},GoogleDataConverter.prototype.getColumnId=function(t){var e=this.getColumnObject(t);return e?e.id:null},GoogleDataConverter.prototype.getColumnLabel=function(t){var e=this.getColumnObject(t);return e?e.label:null},GoogleDataConverter.prototype.getColumnType=function(t){var e=this.getColumnObject(t);return e?e.type:null},GoogleDataConverter.prototype.getColumnProperties=function(t){var e=this.getColumnObject(t);return e?e.p:null},GoogleDataConverter.prototype.getNumberOfRows=function(){return this.tableObj.rows.length},GoogleDataConverter.prototype.convertValue=function(value,colIndex){var colType=this.googleDataTypeToDataType(this.getColumnType(colIndex));return[_easydata_core__WEBPACK_IMPORTED_MODULE_0__.DataType.Date,_easydata_core__WEBPACK_IMPORTED_MODULE_0__.DataType.DateTime,_easydata_core__WEBPACK_IMPORTED_MODULE_0__.DataType.Time].includes(colType)?eval("new "+value):value},GoogleDataConverter.prototype.getValue=function(t,e){var n=t<this.tableObj.rows.length?this.tableObj.rows[t]:null;if(n){var o=e<this.tableObj.cols.length?n.c[e]:null;if(o)return this.convertValue(o.v,e)}return null},GoogleDataConverter.prototype.getRow=function(t){var e=this;return(t<this.tableObj.rows.length?this.tableObj.rows[t]:null).c.map((function(t,n){return e.convertValue(t.v,n)}),this)},GoogleDataConverter.prototype.convertTo=function(t){for(var e=this.getNumberOfColumns(),n=0;n<e;n++)t.columns.add({id:this.getColumnId(n),label:this.getColumnLabel(n),type:this.googleDataTypeToDataType(this.getColumnType(n))});var o=this.getNumberOfRows();for(n=0;n<o;n++)t.addRow(this.getRow(n))},GoogleDataConverter.prototype.googleDataTypeToDataType=function(t){switch(t){case"string":default:return _easydata_core__WEBPACK_IMPORTED_MODULE_0__.DataType.String;case"number":return _easydata_core__WEBPACK_IMPORTED_MODULE_0__.DataType.Float;case"boolean":return _easydata_core__WEBPACK_IMPORTED_MODULE_0__.DataType.Bool;case"date":return _easydata_core__WEBPACK_IMPORTED_MODULE_0__.DataType.Date;case"datetime":return _easydata_core__WEBPACK_IMPORTED_MODULE_0__.DataType.DateTime;case"timeofday":return _easydata_core__WEBPACK_IMPORTED_MODULE_0__.DataType.Time}},GoogleDataConverter}()},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return i}));var o=n(0),i=function(){function e(t){this.models=[],t&&o.utils.assign(this.models,[],t)}return e.prototype.getModels=function(){var e=this;return new t((function(t,n){t(e.models)}))},e}()}).call(this,n(51))},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return h}));var o=n(0),i=n(37),r=n(6),s=n(18),a=n(34),l=n(22),u=n(39),c=function(){return c=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},c.apply(this,arguments)},d=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var o=Array(t),i=0;for(e=0;e<n;e++)for(var r=arguments[e],s=0,a=r.length;s<a;s++,i++)o[i]=r[s];return o},h=function(){function e(t){if(this.cssPrefix="keg",this.pagination={page:1,pageSize:30,total:0},this.paginationOptions={maxButtonCount:10,useBootstrap:!1},this.defaultDataGridOptions={slot:null,dataTable:null,fixHeightOnFirstRender:!1,syncGridColumns:!0,useRowNumeration:!0,allowDragDrop:!1,aggregates:{settings:null,calculator:null},paging:{enabled:!0,pageSize:30,pageSizeItems:[20,30,50,100,200]},columnWidths:{autoResize:a.a.Always,stringColumns:{min:100,max:500,default:250},numberColumns:{min:60,default:120},boolColumns:{min:50,default:80},dateColumns:{min:80,default:200},otherColumns:{min:100,max:500,default:250},rowNumColumn:{min:40,default:60}},showPlusButton:!1,viewportRowsCount:null,showActiveRow:!0},this.rowsOnPagePromise=null,this.containerInitialHeight=0,this.firstRender=!0,this.prevRowTotals=null,this.landingIndex=-1,this.landingSlot=Object(r.e)("div").addClass(this.cssPrefix+"-col-landing-slot").addChildElement(Object(r.e)("div").toDOM()).toDOM(),this._activeRowIndex=-1,t&&t.paging&&(t.paging=o.utils.assign(this.defaultDataGridOptions.paging,t.paging)),this.options=this.mergeOptions(t),this.processColumnWidthsOptions(),!this.options.slot)throw Error('"slot" parameter is required to initialize EasyDataGrid');if(!this.options.dataTable)throw Error('"dataTable" parameter is required to initialize EasyDataGrid');this.dataTable=t.dataTable,this.eventEmitter=new o.EventEmitter(this),this.cellRendererStore=new u.c(t),this.columns=new l.c(this.dataTable.columns,this),this.setSlot(this.options.slot),this.init(this.options)}return e.prototype.mergeOptions=function(t){var e=o.utils.assignDeep({},this.defaultDataGridOptions.columnWidths,t.columnWidths),n=o.utils.assignDeep({},this.defaultDataGridOptions.paging,t.paging),i=o.utils.assign({},this.defaultDataGridOptions,t);return i.columnWidths=e,i.paging=n,i},e.prototype.processColumnWidthsOptions=function(){var t=this.options.columnWidths;if(t){o.utils.getStringDataTypes().forEach((function(e){t[e]=c(c({},t.stringColumns),t[e])})),o.utils.getNumericDataTypes().forEach((function(e){t[e]=c(c({},t.numberColumns),t[e])})),t[o.DataType.Bool]=c(c({},t.boolColumns),t[o.DataType.Bool]),o.utils.getDateDataTypes().forEach((function(e){t[e]=c(c({},t.dateColumns),t[e])}));var e=d(o.utils.getStringDataTypes(),o.utils.getNumericDataTypes(),o.utils.getDateDataTypes(),[o.DataType.Bool]);o.utils.getAllDataTypes().forEach((function(n){n in e||(t[n]=c(c({},t.otherColumns),t[n]))})),t[o.DataType.Unknown]=t.otherColumns}},e.prototype.setSlot=function(t){if("string"==typeof t){if(t.length)if("#"===t[0])this.slot=document.getElementById(t.substring(1));else{if("."!==t[0])throw Error("Unrecognized slot parameter (Must be id, class or HTMLElement): "+t);var e=document.getElementsByClassName(t.substring(1));e.length&&(this.slot=e[0])}}else this.slot=t},e.prototype.init=function(t){var e=this;t.onInit&&this.addEventListener("init",t.onInit),t.onRowClick&&this.addEventListener("rowClick",t.onRowClick),t.onRowDbClick&&this.addEventListener("rowDbClick",t.onRowDbClick),t.onPlusButtonClick&&this.addEventListener("plusButtonClick",t.onPlusButtonClick),t.onColumnChanged&&this.addEventListener("columnChanged",t.onColumnChanged),t.onColumnDeleted&&this.addEventListener("columnDeleted",t.onColumnDeleted),t.onColumnMoved&&this.addEventListener("columnMoved",t.onColumnMoved),t.onPageChanged&&this.addEventListener("pageChanged",t.onPageChanged),t.onActiveRowChanged&&this.addEventListener("activeRowChanged",t.onActiveRowChanged),this.addEventListener("pageChanged",(function(t){return e.activeRowIndex=-1})),o.utils.assignDeep(this.paginationOptions,t.pagination),this.pagination.pageSize=this.options.paging.pageSize||this.pagination.pageSize,this.options.allowDragDrop&&i.d.registerDropContainer({element:this.slot,scopes:["gridColumnMove"],onDragEnter:function(t,n){e.slot.classList.add(s.e+"-drophover"),e.showLandingSlot(n.pageX,n.pageY)},onDragOver:function(t,n){e.showLandingSlot(n.pageX,n.pageY)},onDragLeave:function(t,n){n.dropEffect=i.b.Forbid,e.slot.classList.remove(s.e+"-drophover"),e.hideLandingSlot()},onDrop:function(t,n){e.dataTable.columns.move(n.data.column,e.landingIndex),e.refresh(),e.fireEvent({type:"columnMoved",columnId:n.data.column.id,newIndex:e.landingIndex})}}),this.refresh(),this.fireEvent("init")},e.prototype.fireEvent=function(t){"string"==typeof t?this.eventEmitter.fire(t):this.eventEmitter.fire(t.type,t)},e.prototype.setData=function(t){this.dataTable=t,this.clear(),this.refresh()},e.prototype.getData=function(){return this.dataTable},e.prototype.getColumns=function(){return this.columns},e.prototype.destroy=function(){this.slot.innerHTML=""},e.prototype.refresh=function(){this.clearDOM(),this.render()},e.prototype.clearDOM=function(){this.slot.innerHTML=""},e.prototype.clear=function(){this.pagination.page=1,this.clearDOM()},e.prototype.render=function(){var t=this;if(this.hasData()||this.options.showPlusButton){this.containerInitialHeight=this.slot.clientHeight,this.rootDiv=document.createElement("div"),this.rootDiv.style.width="100%",this.rootDiv.classList.add(this.cssPrefix+"-root"),this.columns.sync(this.dataTable.columns,this.options.useRowNumeration),this.renderHeader(),this.rootDiv.appendChild(this.headerDiv),this.renderBody(),this.rootDiv.appendChild(this.bodyDiv),this.renderFooter(),this.rootDiv.appendChild(this.footerDiv);var e=document.createElement("div");e.classList.add(this.cssPrefix+"-container"),e.appendChild(this.rootDiv),this.slot.appendChild(e);var n=this.options.columnWidths.autoResize!==a.a.Never;this.rowsOnPagePromise?this.rowsOnPagePromise.then((function(){return t.updateHeight()})).then((function(){t.firstRender=!1,t.rowsOnPagePromise=null})):setTimeout((function(){t.updateHeight().then((function(){t.firstRender=!1,n&&t.resizeColumns()}))}),100)}},e.prototype.updateHeight=function(){var e=this;return new t((function(t){if(e.options.viewportRowsCount){var n=e.bodyCellContainerDiv.firstElementChild,o=(n?n.offsetHeight:36)*e.options.viewportRowsCount;return Object(r.e)(e.bodyViewportDiv).setStyle("height",o+"px"),void setTimeout((function(){var n=e.bodyViewportDiv.offsetHeight-e.bodyViewportDiv.clientHeight;o+=n,Object(r.e)(e.bodyViewportDiv).setStyle("height",o+"px"),t()}),100)}e.containerInitialHeight,t()})).then((function(){e.options.fixHeightOnFirstRender&&e.firstRender&&(e.slot.style.height=e.slot.offsetHeight+"px")}))},e.prototype.getContainerWidth=function(){return this.columns.getItems().filter((function(t){return t.isVisible})).map((function(t){return t.width})).reduce((function(t,e){return t+e}))},e.prototype.renderHeader=function(){var t=this;this.headerDiv=Object(r.e)("div").addClass(this.cssPrefix+"-header").toDOM(),this.headerViewportDiv=Object(r.e)("div",this.headerDiv).addClass(this.cssPrefix+"-header-viewport").toDOM(),this.headerCellContainerDiv=Object(r.e)("div",this.headerViewportDiv).addClass(this.cssPrefix+"-header-cell-container").toDOM(),this.headerRowDiv=Object(r.e)("div",this.headerCellContainerDiv).addClass(this.cssPrefix+"-header-row").toDOM(),this.columns.getItems().forEach((function(e,n){if(e.isVisible){var o=t.renderColumnHeader(e,n);t.headerRowDiv.appendChild(o),e.isRowNum&&Object(r.e)(o).addChildElement(t.renderHeaderButtons())}}));var e=this.getContainerWidth();Object(r.e)(this.headerCellContainerDiv).setStyle("width",e+"px")},e.prototype.hasData=function(){return this.dataTable.columns.count>0},e.prototype.renderColumnHeader=function(t,e){var n=this,o=Object(r.e)("div").addClass(this.cssPrefix+"-header-cell").data("col-idx",""+e).setStyle("width",t.width+"px");t.dataColumn&&o.data("col-id",""+t.dataColumn.id);var s=o.toDOM();return Object(r.e)("div",s).addClass(this.cssPrefix+"-header-cell-resize"),t.isRowNum||Object(r.e)("div",s).addClass(this.cssPrefix+"-header-cell-label").text(t.label),t.description&&Object(r.e)("div",s).addClass("question-mark").title(t.description),this.options.allowDragDrop&&i.d.registerDraggableItem({element:s,scope:"gridColumnMove",data:{column:t},renderer:function(e){e.innerHTML="";var o=document.createElement("div");o.innerText=t.label,e.classList.add(n.cssPrefix+"-sortable-helper"),e.appendChild(o)},onDragStart:function(t){t.dropEffect=i.b.Allow}}),s},e.prototype.renderBody=function(){var t=this;this.bodyDiv=Object(r.e)("div").addClass(this.cssPrefix+"-body").toDOM(),this.bodyViewportDiv=Object(r.e)("div",this.bodyDiv).addClass(this.cssPrefix+"-body-viewport").attr("tabIndex","0").toDOM(),this.bodyCellContainerDiv=Object(r.e)("div",this.bodyViewportDiv).addClass(this.cssPrefix+"-cell-container").toDOM();var e=this.canShowAggregates();this.dataTable&&(this.showProgress(),this.rowsOnPagePromise=this.getRowsToRender().then((function(n){t.pagination.total=t.dataTable.getTotal(),t.hideProgress(),t.bodyCellContainerDiv.innerHTML="",t.prevRowTotals=null;var i=0;if(n.length){var s=e?t.options.aggregates.settings.getGroups():[];i=n.length<t.pagination.pageSize?n.length:t.pagination.pageSize,n.forEach((function(n,o){if(e&&t.updateTotalsState(s,n),o<i){var r=t.renderRow(n,o);t.bodyCellContainerDiv.appendChild(r)}}));var l=t.options.aggregates&&t.options.aggregates.showGrandTotalsOnEachPage;if(e&&(t.isLastPage()||l)){var u=new o.DataRow(t.dataTable.columns,new Array(t.dataTable.columns.count));t.updateTotalsState(s,u,!0)}}if(t.options.columnWidths.autoResize!==a.a.Never)t.resizeColumns();else{var c=t.getContainerWidth();Object(r.e)(t.bodyCellContainerDiv).setStyle("width",c+"px")}return i})).catch((function(t){return console.error(t),0}))),this.bodyViewportDiv.addEventListener("scroll",(function(e){Object(r.e)(t.headerViewportDiv).setStyle("margin-left","-"+t.bodyViewportDiv.scrollLeft+"px")})),this.bodyViewportDiv.addEventListener("keydown",this.onViewportKeydown.bind(this))},e.prototype.isLastPage=function(){return this.dataTable.elasticChunks?this.dataTable.totalIsKnown()&&this.pagination.page*this.pagination.pageSize>=this.pagination.total:this.pagination.page*this.pagination.pageSize>=this.pagination.total},e.prototype.canShowAggregates=function(){if(!this.options||!this.options.aggregates||!this.options.aggregates.settings)return!1;var t=this.options.aggregates.settings;return(t.hasAggregates()||t.hasRecordCount())&&(t.hasGroups()||t.hasGrandTotals())},e.prototype.updateTotalsState=function(t,e,n){void 0===n&&(n=!1);var i=this.options.aggregates.settings;if(this.prevRowTotals&&i.hasGroups()){for(var r=-1,s=1;s<=t.length;s++){for(var a=0,l=t[s-1].columns;a<l.length;a++){var u=l[a];if(!i.compareValues(this.prevRowTotals.getValue(u),e.getValue(u))){r=s;break}}if(-1!==r)break}if(-1!==r)for(s=t.length;s>=r;s--){var c=new o.DataRow(this.dataTable.columns,this.prevRowTotals.toArray()),d=this.renderTotalsRow(s,c);this.bodyCellContainerDiv.appendChild(d)}}if(n&&i.hasGrandTotals()&&i.hasAggregates()){d=this.renderTotalsRow(0,e);this.bodyCellContainerDiv.appendChild(d)}this.prevRowTotals=e},e.prototype.applyGroupColumnTemplate=function(t,e,n){var o=t.replace(/{{\s*GroupValue\s*}}/g,e?"<span>"+e+"</span>":"-");return o=o.replace(/{{\s*GroupCount\s*}}/g,n?"<span>"+n+"</span>":"-")},e.prototype.renderTotalsRow=function(t,e){var n=this,o=this.options.aggregates.settings,i=t>0?o.getGroups()[t-1]:{columns:[],aggregates:o.getAggregates()},s=Object(r.e)("div").addClass(this.cssPrefix+"-row").addClass(this.cssPrefix+"-row-totals").addClass(this.cssPrefix+"-totals-lv"+t).data("totals-level",""+t).attr("tabindex","-1").toDOM();this.columns.getItems().forEach((function(t,o){if(t.isVisible){var r="",a=t.isRowNum?-1:n.dataTable.columns.getIndex(t.dataColumn.id);!t.isRowNum&&t.dataColumn&&i.columns.indexOf(t.dataColumn.id)>=0&&(r=e.getValue(a)),a==n.dataTable.columns.count-1&&(r=". . . . . ."),s.appendChild(n.renderCell(t,o,r,s))}}));var a=this.options.aggregates.calculator.getAggrContainer(),l=o.getAggregates().map((function(t){return t.colId})),u=o.buildGroupKey(i,e);return a.getAggregateData(t,u).then((function(r){for(var a=0,u=l;a<u.length;a++){var c=u[a];e.setValue(c,r[c])}s.innerHTML="",n.columns.getItems().forEach((function(a,u){if(a.isVisible){var c="",d=a.isRowNum?-1:n.dataTable.columns.getIndex(a.dataColumn.id);if(!a.isRowNum){var h=!1;if(a.dataColumn){var p=i.columns.indexOf(a.dataColumn.id),f=l.indexOf(a.dataColumn.id);h=t>0?p==i.columns.length-1:0==d,(p>=0||f>=0)&&(c=e.getValue(d))}var g="";if(t>0&&!(g=a.dataColumn.groupFooterColumnTemplate)&&o.hasRecordCount()&&h&&(g="{{GroupValue}} ({{GroupCount}})"),g)c=n.renderCell(a,u,c,s).firstChild.innerHTML,c=n.applyGroupColumnTemplate(g,c,r[o.COUNT_FIELD_NAME])}var y=n.renderCell(a,u,c,s);s.appendChild(y)}}))})).catch((function(t){return console.error(t)})),s},e.prototype.onViewportKeydown=function(t){if(this.options.showActiveRow){var e=this.bodyCellContainerDiv.querySelectorAll("."+this.cssPrefix+"-row").length,n=void 0;switch(t.key){case"ArrowLeft":case"ArrowRight":break;case"ArrowUp":t.preventDefault(),n=this.activeRowIndex<0||this.activeRowIndex>=e?e-1:this.activeRowIndex-1,this.activeRowIndex=n>=0?n:0;break;case"ArrowDown":t.preventDefault(),n=this.activeRowIndex<0||this.activeRowIndex>=e?0:this.activeRowIndex+1,this.activeRowIndex=n<e?n:e-1}}},e.prototype.ensureRowVisibility=function(t){var e="number"==typeof t?this.getDataRow(t):t;if(e){var n=e.getBoundingClientRect(),o=this.bodyViewportDiv.getBoundingClientRect(),i=n.top-o.top,r=n.bottom-o.top,s=this.bodyViewportDiv.clientHeight,a=window.innerHeight||document.documentElement.clientHeight;if(i>0&&r<=s&&n.top>0&&n.bottom<a)return;i<0?this.bodyViewportDiv.scrollTop=this.bodyViewportDiv.scrollTop+i:r>s&&(this.bodyViewportDiv.scrollTop=this.bodyViewportDiv.scrollTop+r-s),(n=e.getBoundingClientRect()).top<0?document.documentElement.scrollTop=document.documentElement.scrollTop+n.top:n.bottom>a&&(document.documentElement.scrollTop=document.documentElement.scrollTop+n.bottom-a)}},e.prototype.getRowsToRender=function(){return!1===this.options.paging.enabled?t.resolve(this.dataTable.getCachedRows()):this.dataTable.getRows({offset:(this.pagination.page-1)*this.pagination.pageSize,limit:this.pagination.pageSize+1}).catch((function(t){return console.error(t),[]}))},e.prototype.renderFooter=function(){var t=this;this.footerDiv=Object(r.e)("div").addClass(this.cssPrefix+"-footer").toDOM(),this.rowsOnPagePromise&&this.rowsOnPagePromise.then((function(e){t.footerDiv.innerHTML="",t.footerPaginateDiv=t.renderPageNavigator(),t.footerDiv.appendChild(t.footerPaginateDiv);var n=t.renderPageInfoBlock(e);t.footerDiv.appendChild(n)}))},e.prototype.renderPageInfoBlock=function(t){var e=Object(r.e)("div").addClass(this.cssPrefix+"-page-info").toDOM();if(this.dataTable.getTotal()>0){var n=t?(this.pagination.page-1)*this.pagination.pageSize+1:0,i=t?n+t-1:0,s=this.dataTable.getTotal().toString();if(this.dataTable.elasticChunks)this.dataTable.getCachedCount()!==this.dataTable.getTotal()&&(s="?");e.innerHTML=o.i18n.getText("GridPageInfo").replace("{FirstPageRecordNum}","<span>"+n.toString()+"</span>").replace("{LastPageRecordNum}","<span>"+i.toString()+"</span>").replace("{Total}","<span>"+s+"</span>")}return e},e.prototype.showProgress=function(){},e.prototype.hideProgress=function(){},e.prototype.getLocalIndexByGlobal=function(t){return this.pagination?t%this.pagination.pageSize:t},e.prototype.getGlobalIndexByLocal=function(t){return this.pagination?(this.pagination.page-1)*this.pagination.pageSize+t:t},e.prototype.renderRow=function(t,e){var n=this,o=this.getGlobalIndexByLocal(e),i=Object(r.e)("div").addClass(this.cssPrefix+"-row").addClass(this.cssPrefix+"-row-"+(e%2==1?"odd":"even")).data("row-idx",""+o).attr("tabindex","-1").on("click",(function(o){n.activeRowIndex=e,n.fireEvent({type:"rowClick",row:t,rowIndex:e,sourceEvent:o})})).on("dblclick",(function(o){n.fireEvent({type:"rowDbClick",row:t,rowIndex:e,sourceEvent:o})}));0==e&&i.addClass(this.cssPrefix+"-row-first");var s=i.toDOM();return this.options.showActiveRow&&e==this.activeRowIndex&&i.addClass(this.cssPrefix+"-row-active"),this.columns.getItems().forEach((function(e,i){if(e.isVisible){var r=e.isRowNum?-1:n.dataTable.columns.getIndex(e.dataColumn.id),a=e.isRowNum?o+1:t.getValue(r);s.appendChild(n.renderCell(e,i,a,s))}})),s},e.prototype.renderCell=function(t,e,n,o){var i=Object(r.e)("div").addClass(this.cssPrefix+"-cell").data("col-idx",""+e).attr("tabindex","-1").setStyle("width",t.width+"px");t.align==l.b.LEFT?i.addClass(this.cssPrefix+"-cell-align-left"):t.align==l.b.RIGHT?i.addClass(this.cssPrefix+"-cell-align-right"):t.align==l.b.CENTER&&i.addClass(this.cssPrefix+"-cell-align-center");var s=i.toDOM(),a=s.appendChild(Object(r.e)("div").addClass(this.cssPrefix+"-cell-value").toDOM());return t.cellRenderer&&t.cellRenderer(n,t,a,o),s},e.prototype.setPage=function(t){this.pagination.page=t,this.fireEvent({type:"pageChanged",page:t}),this.refresh(),this.bodyViewportDiv.focus()},e.prototype.renderPageNavigator=function(){var t=this,e=document.createElement("div");e.className=this.cssPrefix+"-pagination-wrapper";var n=this.dataTable.getTotal();if(this.options.paging&&this.options.paging.enabled&&n>0){var i=this.paginationOptions.useBootstrap?"":this.cssPrefix+"-",r=function(e){var n=e.target;if(n.hasAttribute("data-page")){var o=parseInt(n.getAttribute("data-page"));t.setPage(o)}},s=function(e,n,o,s,a){var l=document.createElement("li");if(l.className=i+"page-item",!s){a&&(l.className+=" active");var u=document.createElement("a");return u.setAttribute("href","javascript:void(0)"),u.innerHTML=n||e.toString(),u.setAttribute("data-page",""+e),u.className=i+"page-link",u.addEventListener("click",r),l.appendChild(u),l}var c=document.createElement("span");if(c.setAttribute("aria-hidden","true"),c.className=i+"page-link",o)l.className+=" disabled";else{if(t.paginationOptions.useBootstrap)(c=document.createElement("a")).setAttribute("href","javascript:void(0)"),c.setAttribute("data-page",""+e);else{var d=document.createElement("a");d.setAttribute("href","javascript:void(0)"),d.setAttribute("data-page",""+e),c=d}c.className=i+"page-link",c.addEventListener("click",r)}return c.innerHTML=n,l.appendChild(c),l};if(this.dataTable.elasticChunks){var a=this.pagination.page||1;(u=document.createElement("ul")).className=i+"pagination";var l=s(a-1,"&laquo;",1==a,!0,!1);u.appendChild(l),l=s(a+1,"&raquo;",this.isLastPage(),!0,!1),u.appendChild(l),e.appendChild(u)}else if(this.pagination.total>this.pagination.pageSize){a=this.pagination.page||1;var u,c=Math.ceil(this.pagination.total/this.pagination.pageSize)||1,d=this.paginationOptions.maxButtonCount||10,h=a-1,p=h-h%d+1,f=p+d-1;f>c&&(f=c),(u=document.createElement("ul")).className=i+"pagination";l=s(p-1,"&laquo;",1==p,!0,!1);u.appendChild(l);for(var g=p;g<=f;g++)l=s(g,g.toString(),!1,!1,g==a),u.appendChild(l);l=s(f+1,"&raquo;",f==c,!0,!1),u.appendChild(l),e.appendChild(u)}if(this.options.paging.allowPageSizeChange){var y=document.createElement("div");y.className=this.cssPrefix+"-page-sizes";var m=document.createElement("div");m.className="kfrm-select "+this.cssPrefix+"-page-sizes-select",y.appendChild(m);var v=document.createElement("select"),b=this.options.paging.pageSizeItems||[],C=new Set(b);C.add(this.options.paging.pageSize||20),Array.from(C).forEach((function(t){var e=document.createElement("option");e.value=t.toString(),e.text=t.toString(),v.appendChild(e)})),v.value=(this.pagination.pageSize||20).toString(),m.appendChild(v),v.addEventListener("change",(function(e){var n=parseInt(e.target.value);t.pagination.pageSize=n,t.pagination.page=1,t.refresh()}));var x=document.createElement("div");x.className=this.cssPrefix+"-page-sizes-label",y.appendChild(x);var w=document.createElement("span");w.innerText=o.i18n.getText("GridItemsPerPage"),x.appendChild(w),e.appendChild(y)}}return e},e.prototype.addEventListener=function(t,e){return this.eventEmitter.subscribe(t,(function(t){return e(t.data)}))},e.prototype.removeEventListener=function(t,e){this.eventEmitter.unsubscribe(t,e)},e.prototype.renderHeaderButtons=function(){var t=this;return this.options.showPlusButton?Object(r.e)("div").addClass(this.cssPrefix+"-header-btn-plus").title(this.options.plusButtonTitle||"Add").addChild("a",(function(e){return e.attr("href","javascript:void(0)").on("click",(function(e){e.preventDefault(),t.fireEvent({type:"plusButtonClick",sourceEvent:e})}))})).toDOM():Object(r.e)("span").addText("#").toDOM()},e.prototype.showLandingSlot=function(t,e){for(var n=this.headerRowDiv.querySelectorAll("[class*="+this.cssPrefix+"-table-col]"),o=[],i=1;i<n.length;i++){var r=n[i];"none"!==r.style.display&&o.push(r)}if(0===o.length)return this.landingIndex=0,void this.headerRowDiv.appendChild(this.landingSlot);var a=Object(s.g)(this.landingSlot);if(!(t>=a.x&&t<=a.x+this.landingSlot.offsetWidth)){for(var l=this.landingIndex,u=0,c=o;u<c.length;u++){var d=c[u],h=Object(s.g)(d),p=d.offsetWidth;t>h.x&&t<h.x+p&&(l=parseInt(d.getAttribute("data-col-idx"))-1)}l!=this.landingIndex&&(this.landingIndex=l,this.landingIndex<o.length?this.headerRowDiv.insertBefore(this.landingSlot,o[this.landingIndex]):this.headerRowDiv.appendChild(this.landingSlot))}},e.prototype.hideLandingSlot=function(){var t=this;this.landingIndex=-1,setTimeout((function(){t.landingSlot.parentElement&&t.landingSlot.parentElement.removeChild(t.landingSlot)}),10)},Object.defineProperty(e.prototype,"activeRowIndex",{get:function(){return this._activeRowIndex},set:function(t){if(t!==this._activeRowIndex){var e=this._activeRowIndex;this._activeRowIndex=t,this.updateActiveRow(),this.fireEvent({type:"activeRowChanged",oldValue:e,newValue:this.activeRowIndex,rowIndex:this.getGlobalIndexByLocal(this.activeRowIndex)})}},enumerable:!0,configurable:!0}),e.prototype.updateActiveRow=function(){var t=this;if(this.options.showActiveRow){this.bodyCellContainerDiv.querySelectorAll("[class*="+this.cssPrefix+"-row-active]").forEach((function(e){e.classList.remove(t.cssPrefix+"-row-active")}));var e=this.getActiveRow();e&&(e.classList.add(this.cssPrefix+"-row-active"),this.ensureRowVisibility(this.activeRowIndex))}},e.prototype.getActiveRow=function(){return this.getDataRow(this.activeRowIndex)},e.prototype.getDataRow=function(t){var e=Array.from(this.bodyCellContainerDiv.querySelectorAll("."+this.cssPrefix+"-row:not(."+this.cssPrefix+"-row-totals)"));return t>=0&&t<e.length?e[t]:null},e.prototype.focus=function(){this.bodyViewportDiv.focus()},e.prototype.resizeColumns=function(){if(this.options.columnWidths.autoResize!==a.a.Never){var t=this.bodyCellContainerDiv.style.width;this.bodyCellContainerDiv.style.visibility="hidden",this.bodyCellContainerDiv.style.width="1px",this.headerRowDiv.style.width="1px";for(var e=0,n=this.columns.getItems(),i=this.headerCellContainerDiv.querySelectorAll("."+this.cssPrefix+"-header-cell"),r=0,s=function(t){var s=n[t];if(!s.isVisible)return"continue";var u=l.options.columnWidths.autoResize!==a.a.Always&&s.dataColumn?s.dataColumn.calculatedWidth:0,c=l.bodyCellContainerDiv.querySelectorAll("."+l.cssPrefix+'-cell[data-col-idx="'+t+'"] > .'+l.cssPrefix+"-cell-value"),d=0;if(u>0)e+=u,s.width=u,c.forEach((function(t){t.parentElement.style.width=u+"px"})),i[r].style.width=u+"px";else if(0==c.length&&(i[r].style.width=null,i[r].style.whiteSpace="nowrap"),d=i[r].offsetWidth,c.length>0){c.forEach((function(t){t.parentElement.style.width=null;var e=t.parentElement.offsetWidth;e>d&&(d=e)})),d+=3;var h=s.isRowNum?l.options.columnWidths.rowNumColumn.max||500:l.options.columnWidths[s.dataColumn.type].max||2e3,p=s.isRowNum?l.options.columnWidths.rowNumColumn.min||0:l.options.columnWidths[s.dataColumn.type].min||20;d>h&&(d=h),d<p&&(d=p),o.utils.isNumericType(s.type)&&(d=Math.round(1.3*d)),e+=d,s.width=d,c.forEach((function(t){t.parentElement.style.width=d+"px"})),i[r].style.width=d+"px",s.dataColumn&&(s.dataColumn.calculatedWidth=d)}else e+=d;r++},l=this,u=0;u<this.columns.count;u++)s(u);e>0?(this.bodyCellContainerDiv.style.width=e+"px",this.headerCellContainerDiv.style.width=e+"px"):(this.bodyCellContainerDiv.style.width=t,this.headerCellContainerDiv.style.width=t),this.bodyCellContainerDiv.style.visibility=null,this.headerRowDiv.removeAttribute("style")}},e}()}).call(this,n(107))},function(t,e,n){(function(e,n){var o;o=function(){"use strict";function t(t){return"function"==typeof t}var o=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},i=0,r=void 0,s=void 0,a=function(t,e){f[i]=t,f[i+1]=e,2===(i+=2)&&(s?s(g):C())},l="undefined"!=typeof window?window:void 0,u=l||{},c=u.MutationObserver||u.WebKitMutationObserver,d="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function p(){var t=setTimeout;return function(){return t(g,1)}}var f=new Array(1e3);function g(){for(var t=0;t<i;t+=2)(0,f[t])(f[t+1]),f[t]=void 0,f[t+1]=void 0;i=0}var y,m,v,b,C=void 0;function x(t,e){var n=this,o=new this.constructor(E);void 0===o[T]&&L(o);var i=n._state;if(i){var r=arguments[i-1];a((function(){return B(i,o,r,n._result)}))}else A(n,o,t,e);return o}function w(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(E);return k(e,t),e}d?C=function(){return e.nextTick(g)}:c?(m=0,v=new c(g),b=document.createTextNode(""),v.observe(b,{characterData:!0}),C=function(){b.data=m=++m%2}):h?((y=new MessageChannel).port1.onmessage=g,C=function(){return y.port2.postMessage(0)}):C=void 0===l?function(){try{var t=Function("return this")().require("vertx");return void 0!==(r=t.runOnLoop||t.runOnContext)?function(){r(g)}:p()}catch(t){return p()}}():p();var T=Math.random().toString(36).substring(2);function E(){}var D=void 0;function S(e,n,o){n.constructor===e.constructor&&o===x&&n.constructor.resolve===w?function(t,e){1===e._state?I(t,e._result):2===e._state?O(t,e._result):A(e,void 0,(function(e){return k(t,e)}),(function(e){return O(t,e)}))}(e,n):void 0===o?I(e,n):t(o)?function(t,e,n){a((function(t){var o=!1,i=function(t,e,n,o){try{t.call(e,n,o)}catch(t){return t}}(n,e,(function(n){o||(o=!0,e!==n?k(t,n):I(t,n))}),(function(e){o||(o=!0,O(t,e))}),t._label);!o&&i&&(o=!0,O(t,i))}),t)}(e,n,o):I(e,n)}function k(t,e){if(t===e)O(t,new TypeError("You cannot resolve a promise with itself"));else if(i=typeof(o=e),null===o||"object"!==i&&"function"!==i)I(t,e);else{var n=void 0;try{n=e.then}catch(e){return void O(t,e)}S(t,e,n)}var o,i}function M(t){t._onerror&&t._onerror(t._result),P(t)}function I(t,e){t._state===D&&(t._result=e,t._state=1,0!==t._subscribers.length&&a(P,t))}function O(t,e){t._state===D&&(t._state=2,t._result=e,a(M,t))}function A(t,e,n,o){var i=t._subscribers,r=i.length;t._onerror=null,i[r]=e,i[r+1]=n,i[r+2]=o,0===r&&t._state&&a(P,t)}function P(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var o=void 0,i=void 0,r=t._result,s=0;s<e.length;s+=3)o=e[s],i=e[s+n],o?B(n,o,i,r):i(r);t._subscribers.length=0}}function B(e,n,o,i){var r=t(o),s=void 0,a=void 0,l=!0;if(r){try{s=o(i)}catch(t){l=!1,a=t}if(n===s)return void O(n,new TypeError("A promises callback cannot return that same promise."))}else s=i;n._state!==D||(r&&l?k(n,s):!1===l?O(n,a):1===e?I(n,s):2===e&&O(n,s))}var _=0;function L(t){t[T]=_++,t._state=void 0,t._result=void 0,t._subscribers=[]}var R=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(E),this.promise[T]||L(this.promise),o(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?I(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&I(this.promise,this._result))):O(this.promise,new Error("Array Methods must be provided an Array"))}return t.prototype._enumerate=function(t){for(var e=0;this._state===D&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,o=n.resolve;if(o===w){var i=void 0,r=void 0,s=!1;try{i=t.then}catch(t){s=!0,r=t}if(i===x&&t._state!==D)this._settledAt(t._state,e,t._result);else if("function"!=typeof i)this._remaining--,this._result[e]=t;else if(n===F){var a=new n(E);s?O(a,r):S(a,t,i),this._willSettleAt(a,e)}else this._willSettleAt(new n((function(e){return e(t)})),e)}else this._willSettleAt(o(t),e)},t.prototype._settledAt=function(t,e,n){var o=this.promise;o._state===D&&(this._remaining--,2===t?O(o,n):this._result[e]=n),0===this._remaining&&I(o,this._result)},t.prototype._willSettleAt=function(t,e){var n=this;A(t,void 0,(function(t){return n._settledAt(1,e,t)}),(function(t){return n._settledAt(2,e,t)}))},t}(),F=function(){function e(t){this[T]=_++,this._result=this._state=void 0,this._subscribers=[],E!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof e?function(t,e){try{e((function(e){k(t,e)}),(function(e){O(t,e)}))}catch(e){O(t,e)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(t){return this.then(null,t)},e.prototype.finally=function(e){var n=this,o=n.constructor;return t(e)?n.then((function(t){return o.resolve(e()).then((function(){return t}))}),(function(t){return o.resolve(e()).then((function(){throw t}))})):n.then(e,e)},e}();return F.prototype.then=x,F.all=function(t){return new R(this,t).promise},F.race=function(t){var e=this;return o(t)?new e((function(n,o){for(var i=t.length,r=0;r<i;r++)e.resolve(t[r]).then(n,o)})):new e((function(t,e){return e(new TypeError("You must pass an array to race."))}))},F.resolve=w,F.reject=function(t){var e=new this(E);return O(e,t),e},F._setScheduler=function(t){s=t},F._setAsap=function(t){a=t},F._asap=a,F.polyfill=function(){var t=void 0;if(void 0!==n)t=n;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var o=null;try{o=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===o&&!e.cast)return}t.Promise=F},F.Promise=F,F},t.exports=o()}).call(this,n(54),n(55))},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return d}));var o,i=n(0),r=n(2),s=n(1),a=n(9),l=n(3),u=n(32),c=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},o(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=function(e){function n(){var t=e.call(this)||this;t.exportButtons=[],t.disabledClass="eqjs-disabled",t.dropdownContainerClass="eqv-dropdown-container",t.dropdownButtonClass="eqv-drop-button",t.dropdownContentClass="eqv-dropdown-content",t.dropdownShowClass="eqv-dropdown-show",t._querySaveTemplate='<div id="kdlg-dialog-form" class="kfrm-form">\n <div class="kfrm-fields label-above">\n <label for="kdlg-dialog-form-input" id="kdlg-dialog-form-content"></label>\n <input type="text" name="kdlg-dialog-form-input" id="kdlg-dialog-form-input" />\n </div>\n </div>',t.queryListMenu=null,t.fetchDataButtonClickHandler=t.fetchDataButtonClick.bind(t),t.clearQueryButtonClickHandler=t.clearQueryButtonClick.bind(t),t.newQueryButtonClickHandler=t.newQueryButtonClick.bind(t),t.loadQueryButtonClickHandler=t.loadQueryButtonClick.bind(t),t.saveQueryButtonClickHandler=t.saveQueryButtonClick.bind(t),t.copyQueryButtonClickHandler=t.copyQueryButtonClick.bind(t),t.removeQueryButtonClickHandler=t.removeQueryButtonClick.bind(t),t.storageButtonClickHandler=t.storageDropButtonClick.bind(t),t.saveQueryToFileButtonClickHandler=t.saveQueryToFileButtonClick.bind(t),t.loadQueryFromFileButtonClickHandler=t.loadQueryFromFileButtonClick.bind(t);var n=t;return t.exportButtonClickHandler=function(t){if(!this.classList.contains(n.disabledClass)){var e=this.getAttribute("data-format");n.getContext().exportResult({format:e})}},t.queryChangedHandler=function(e){var n=e.data;t.resultOptions.clearResultOnQueryChange&&(t.context.clearResult(),t.context.refreshWidgets(r.WidgetGroup.Result)),t.disableExportButtons(),t.resultCountSlot&&(t.resultCountSlot.style.display="none"),t.viewOptions.syncQueryOnChange&&t.syncQuery(),t.viewOptions.fetchDataOnChange&&(!n||n.part!=r.QueryChangePart.ExtraData&&n.part!=r.QueryChangePart.Facets)&&t.fetchData()},t.outsideClickHandler=function(e){var n=null;e.target.matches("."+t.dropdownButtonClass)?n=e.target.parentElement.querySelector("."+t.dropdownContentClass):e.target.matches("."+t.dropdownButtonClass+" > span")&&(n=e.target.parentElement.parentElement.querySelector("."+t.dropdownContentClass));for(var o=t.resolveElementsByClassName(t.dropdownContentClass),i=0;i<o.length;i++){var r=o[i];n!=r&&r.classList.contains(t.dropdownShowClass)&&r.classList.remove(t.dropdownShowClass)}},t}return c(n,e),n.prototype.refreshQueryList=function(){var t=this;this.queryListPanel&&(this.queryListPanel.innerHTML="",this.context.loadQueryList({success:function(e){var n=Object(s.domel)("ul",t.queryListPanel).addClass("list-group list-group-flush");e.map((function(e){n.addChild("li",(function(n){n.addClass("list-group-item").setStyle("cursor","pointer").data("id",e.id).text(e.name).on("click",(function(){t.checkIfQueryModified((function(){return t.loadQuery(e.id)}))}))}))}))}}))},n.prototype.initOptions=function(t){return void 0===(t=e.prototype.initOptions.call(this,t)).syncQueryOnChange&&(t.syncQueryOnChange=!0),t},n.prototype.initWidgets=function(t){var n=this;e.prototype.initWidgets.call(this,t);var o="eqjs-export",i="QueryContentJson",r="ClearQueryButton",s="NewQueryButton",a="LoadQueryButton",l="SaveQueryButton",u="CopyQueryButton",c="RemoveQueryButton",d="StorageDropButton",h="FetchDataButton",p="LoadQueryFromFileButton",f="SaveQueryToFileButton",g="QueryListPanel";t.slots&&(i=t.slots.queryContentInput||i,h=t.slots.fetchDataButton||h,r=t.slots.clearQueryButton||r,s=t.slots.newQueryButton||s,a=t.slots.loadQueryButton||a,l=t.slots.saveQueryButton||l,u=t.slots.copyQueryButton||u,c=t.slots.removeQueryButton||c,d=t.slots.storageButton||d,o=t.slots.exportClass||o,p=t.slots.loadQueryFromFileButton||p,f=t.slots.saveQueryToFileButton||f,g=t.slots.queryListPanel||g),this.exportButtons=this.domRoots.reduce((function(t,e){return t.concat(Array.from(e.querySelectorAll("."+o)))}),[]),t.enableExport||this.hideExportButtons(),this.disableExportButtons();this.exportButtons.forEach((function(t){t.addEventListener("click",n.exportButtonClickHandler)})),this.fetchDataButton||(this.fetchDataButton=this.resolveElement(h),this.fetchDataButton||(this.fetchDataButton=this.resolveElement("ExecuteQueryButton")),this.fetchDataButton&&this.fetchDataButton.addEventListener("click",this.fetchDataButtonClickHandler)),this.clearQueryButton||(this.clearQueryButton=this.resolveElement(r),this.clearQueryButton&&this.clearQueryButton.addEventListener("click",this.clearQueryButtonClickHandler)),this.newQueryButton||(this.newQueryButton=this.resolveElement(s),this.newQueryButton&&this.newQueryButton.addEventListener("click",this.newQueryButtonClickHandler)),this.loadQueryButton||(this.loadQueryButton=this.resolveElement(a),this.loadQueryButton&&this.loadQueryButton.addEventListener("click",this.loadQueryButtonClickHandler)),this.saveQueryButton||(this.saveQueryButton=this.resolveElement(l),this.saveQueryButton&&this.saveQueryButton.addEventListener("click",this.saveQueryButtonClickHandler)),this.copyQueryButton||(this.copyQueryButton=this.resolveElement(u),this.copyQueryButton&&this.copyQueryButton.addEventListener("click",this.copyQueryButtonClickHandler)),this.removeQueryButton||(this.removeQueryButton=this.resolveElement(c),this.removeQueryButton&&this.removeQueryButton.addEventListener("click",this.removeQueryButtonClickHandler)),this.storageDropButton||(this.storageDropButton=this.resolveElement(d),this.storageDropButton&&this.storageDropButton.addEventListener("click",this.storageButtonClickHandler)),this.saveQueryToFileButton||(this.saveQueryToFileButton=this.resolveElement(f),this.saveQueryToFileButton&&this.saveQueryToFileButton.addEventListener("click",this.saveQueryToFileButtonClickHandler)),this.queryListPanel||(this.queryListPanel=this.resolveElement(g),this.queryListPanel||(this.queryListPanel=this.resolveElement("QueryListSlot")),this.queryListPanel&&this.context.addEventListener("ready",(function(){n.refreshQueryList()}))),this.loadQueryFromFileButton||(this.loadQueryFromFileButton=this.resolveElement(p),this.loadQueryFromFileButton&&(this.loadQueryFromFileInput=document.createElement("input"),this.loadQueryFromFileInput.type="file",this.loadQueryFromFileInput.accept=t.queryFileExtensions,this.loadQueryFromFileInput.style.display="none",document.body.appendChild(this.loadQueryFromFileInput),this.loadQueryFromFileInput.addEventListener("change",this.loadQueryFromFileInputSelect.bind(this)),this.loadQueryFromFileButton.addEventListener("click",this.loadQueryFromFileButtonClickHandler))),window.addEventListener("click",this.outsideClickHandler)},n.prototype.initDone=function(){e.prototype.initDone.call(this),this.context.getQuery().addChangedCallback(this.queryChangedHandler)},n.prototype.syncQuery=function(){var t=this;this.context.syncQuery({success:function(e){e.statement&&t.context.refreshWidgets(r.WidgetGroup.Statement)}})},n.prototype.disableExportButtons=function(){var t=this;this.exportButtons.forEach((function(e){e.disabled=!0,e.classList.contains(t.disabledClass)||e.classList.add(t.disabledClass)}))},n.prototype.enableExportButtons=function(){var t=this;this.exportButtons.forEach((function(e){e.disabled=!1,e.classList.contains(t.disabledClass)&&e.classList.remove(t.disabledClass)}))},n.prototype.hideExportButtons=function(){this.exportButtons.forEach((function(t){t.style.display="none"}))},n.prototype.clearQueryButtonClick=function(){this.context.clearQuery(),this.context.refreshWidgets(r.WidgetGroup.Statement)},n.prototype.createNewQuery=function(t){return this.context.newQuery(t)},n.prototype.loadQuery=function(t){t&&this.context.loadQuery({queryId:t,silent:!1})},n.prototype.saveQuery=function(t,e){var n=this;this.context.saveQuery({success:function(){t&&t(),n.context.getQuery().fireChangedEvent({part:r.QueryChangePart.Properties,wasModified:!1}),n.refreshQueryList()},error:e})},n.prototype.saveCurrentQuery=function(e,n){var o=this;void 0===e&&(e=!1);var i=this.context.getQuery();i.isNewbie||e?this.showSaveQueryDialog((function(e){return new t((function(t){e&&(i.regenerateId(),i.setName(e),i.fireChangedEvent({part:r.QueryChangePart.Properties,wasModified:!0}),o.saveQuery((function(){t({success:!0})}),(function(e){return t({success:!1,message:e})})))}))})):this.saveQuery(n)},n.prototype.checkIfQueryModified=function(t){var e=this;this.context.getQuery().isModified()&&!this.viewOptions.disableConfirmationOnQueryChange?this.showQueryChangedDialog((function(n){n?e.saveCurrentQuery(!1,t):t()})):t()},n.prototype.removeCurrentQuery=function(){var t=this;this.context.removeQuery({success:function(){t.createNewQuery({useStorage:!1}),t.resultCountSlot&&(t.resultCountSlot.style.display="none"),t.context.clearResult(),t.refreshQueryList()}})},n.prototype.showNewQueryDialog=function(t){var e=this.context.getServices().getDialogService(),n=i.i18n.getText("NewQueryDefName"),o=e.open({title:i.i18n.getText("NewQueryTitle"),body:this._querySaveTemplate,submitable:!0,closable:!0,cancelable:!0,submitOnEnter:!0,arrangeParents:!1,beforeOpen:function(){var t=document.getElementById("kdlg-dialog-form-input");n&&(t.value=n),document.getElementById("kdlg-dialog-form-content").innerHTML=i.i18n.getText("NewQueryContent"),t.focus()},onSubmit:function(){var e=document.getElementById("kdlg-dialog-form-input").value;if(e&&e.replace(/\s/g,"").length>0){if(!t)return!0;o.disableButtons();var n=o.getRootElement().querySelector("header"),i=Object(s.domel)("div",n).addClass("eqjs-process-bar local").toDOM();t(e).then((function(t){n.removeChild(i),o.enableButtons(),t.success?o.close():o.showAlert(t.message,"error")}))}return!1}})},n.prototype.showQueryChangedDialog=function(t){this.context.getServices().getDialogService().openConfirm(i.i18n.getText("QueryChangedTitle"),i.i18n.getText("QueryChangedContent"),t)},n.prototype.showSaveQueryDialog=function(t){var e=this.context.getServices().getDialogService(),n=this.context.getQuery(),o=n.isNewbie?n.getName():i.i18n.getText("SaveQueryDefName").replace("{queryName}",n.getName()),r=e.open({title:i.i18n.getText("SaveQueryTitle"),body:this._querySaveTemplate,submitable:!0,closable:!0,cancelable:!0,submitOnEnter:!0,arrangeParents:!1,beforeOpen:function(){var t=document.getElementById("kdlg-dialog-form-input");t.value=o,document.getElementById("kdlg-dialog-form-content").innerHTML=i.i18n.getText("SaveQueryContent"),t.focus()},onSubmit:function(){var e=document.getElementById("kdlg-dialog-form-input").value;if(e&&e.replace(/\s/g,"").length>0){if(!t)return!0;r.disableButtons();var n=r.getRootElement().querySelector("header"),o=Object(s.domel)("div",n).addClass("eqjs-process-bar local").toDOM();t(e).then((function(t){r.enableButtons(),n.removeChild(o),t.success?r.close():r.showAlert(t.message,"error")}))}return!1}})},n.prototype.showRemoveQueryDialog=function(t){var e=this.context.getServices().getDialogService(),n=this.context.getQuery();e.openConfirm(i.i18n.getText("RemoveQueryTitle"),i.i18n.getText("RemoveQueryContent").replace("{queryName}",n.getName()),t)},n.prototype.showSaveQueryToFileDialog=function(t){var e=this.getContext().getServices().getDialogService(),n=this.context.getQuery(),o=this.renderSaveToFileDialogBody(n.getName()),r=e.open({title:i.i18n.getText("SaveQueryToFileDlgTitle"),body:o,onSubmit:function(){var e=o.querySelector("#kdlgFileNameInput"),n=e?e.value:"Query",i=o.querySelector("#kdlgFileFormatSelector"),a=i?i.value:"json";if(t){r.disableButtons();var l=r.getRootElement().querySelector("header"),u=Object(s.domel)("div",l).addClass("eqjs-process-bar local").toDOM();return t(n,a).then((function(t){r.enableButtons(),l.removeChild(u),t.success?r.close():r.showAlert(t.message,"error")})),!1}return!0}})},n.prototype.renderSaveToFileDialogBody=function(t,e){void 0===e&&(e="json");var n=l.a.isIE(),o=n?"kfrm-fields-ie col-ie-1-4 label-align-right":"kfrm-fields col-a-1 label-align-right",r=n?"kfrm-fields-ie is-horizontal":"kfrm-fields is-horizontal";return Object(s.domel)("div").addClass("kfrm-form").addChild("div",(function(n){n.addClass(o).addChild("label",(function(t){return t.attr("for","file_name").addText(i.i18n.getText("FileNameLabel"))})).addChild("div",(function(n){return n.addClass(r).addChild("input",(function(e){return e.id("kdlgFileNameInput").name("file_name").type("text").attr("value",t)})).addChild("label",(function(t){return t.addText(".")})).addChild("div",(function(t){return t.addClass("kfrm-select").addChild("select",(function(t){return t.id("kdlgFileFormatSelector").addClass("kdlg-form-control").addOption({value:"xml",selected:"xml"===e}).addOption({value:"json",selected:"json"===e})}))}))}))})).toDOM()},n.prototype.newQueryButtonClick=function(){var t=this;this.checkIfQueryModified((function(){t.createNewQuery()}))},n.prototype.saveQueryToFileButtonClick=function(){var e=this;this.showSaveQueryToFileDialog((function(n,o){return new t((function(t){e.context.getQueryFile({fileName:n,format:o,success:function(){return t({success:!0})},error:function(e){return t({success:!1,message:e})}})}))}))},n.prototype.loadQueryFromFileButtonClick=function(){var t=this;this.checkIfQueryModified((function(){t.showLoadQueryFromFileDialog()}))},n.prototype.showLoadQueryFromFileDialog=function(){this.loadQueryFromFileInput.click()},n.prototype.loadQueryFromFileInputSelect=function(){var t=this,e=this.loadQueryFromFileInput.files.item(0),n=new FormData;n.append(e.name,e),this.loadQueryFromFileInput.value="",this.context.uploadQueryFile({data:n,success:function(){t.syncQuery(),t.refreshQueryList()}})},n.prototype.loadQueryButtonClick=function(){var t=this;this.context.loadQueryList({success:function(e){t.fillLoadQueryButtonMenu(e),t.queryListMenu.showMenu({anchor:t.loadQueryButton,adjustHeight:!1,itemSelectedCallback:function(e){t.checkIfQueryModified((function(){return t.loadQuery(e.id)}))}})}})},n.prototype.fillLoadQueryButtonMenu=function(t){var e=this.getContext().getQuery();this.queryListMenu=new a.a({items:t.map((function(t){return{id:t.id,text:t.name}})),selectedIds:e.getId()})},n.prototype.saveQueryButtonClick=function(){this.saveCurrentQuery()},n.prototype.copyQueryButtonClick=function(){this.saveCurrentQuery(!0)},n.prototype.removeQueryButtonClick=function(){var t=this;this.showRemoveQueryDialog((function(e){e&&t.removeCurrentQuery()}))},n.prototype.storageDropButtonClick=function(){var t=this,e=this.storageDropButton.parentElement.querySelector("."+this.dropdownContentClass);e&&window.setTimeout((function(){return e.classList.toggle(t.dropdownShowClass)}),100)},n.prototype.fetchDataButtonClick=function(){this.fetchData()},n.prototype.detach=function(){var t=this;this.enableExportButtons(),this.exportButtons.forEach((function(e){e.removeEventListener("click",t.exportButtonClickHandler)})),this.exportButtons=[],this.fetchDataButton&&(this.fetchDataButton.removeEventListener("click",this.fetchDataButtonClickHandler),this.fetchDataButton=null),this.clearQueryButton&&(this.clearQueryButton.removeEventListener("click",this.clearQueryButtonClickHandler),this.clearQueryButton=null),this.newQueryButton&&(this.newQueryButton.removeEventListener("click",this.newQueryButtonClickHandler),this.newQueryButton=null),this.loadQueryButton&&(this.loadQueryButton.removeEventListener("click",this.loadQueryButtonClickHandler),this.loadQueryButton=null),this.saveQueryButton&&(this.saveQueryButton.removeEventListener("click",this.saveQueryButtonClickHandler),this.saveQueryButton=null),this.copyQueryButton&&(this.copyQueryButton.removeEventListener("click",this.copyQueryButtonClickHandler),this.copyQueryButton=null),this.removeQueryButton&&(this.removeQueryButton.removeEventListener("click",this.removeQueryButtonClickHandler),this.removeQueryButton=null),this.storageDropButton&&(this.storageDropButton.removeEventListener("click",this.storageButtonClickHandler),this.storageDropButton=null),this.saveQueryToFileButton&&(this.saveQueryToFileButton.removeEventListener("click",this.saveQueryToFileButtonClickHandler),this.saveQueryToFileButton=null),this.queryListPanel&&(this.queryListPanel=null),this.loadQueryFromFileButton&&(this.loadQueryFromFileInput&&document.body.removeChild(this.loadQueryFromFileInput),this.loadQueryFromFileButton.removeEventListener("click",this.loadQueryFromFileButtonClickHandler),this.loadQueryFromFileButton=null),e.prototype.detach.call(this)},n}(u.a)}).call(this,n(56))},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return s}));var o=n(0),i=n(2),r=function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},r.apply(this,arguments)},s=function(){function e(t){this.context=t,this._needRecalculation=!0,this.aggrContainer=new i.EqAggregatesContainer(t)}return e.prototype.getAggrContainer=function(){return this.aggrContainer},e.prototype.calculate=function(e){this._needRecalculation=!1,this.aggrContainer.clear(),(e=e||{}).maxLevel=e.maxLevel>=0?e.maxLevel:0;var n=[],o=this.context.createQuery();o.loadFromData(this.context.getQuery().toJSONData());for(var r=this.context.getQuery().getAggregationSettings(),s=r.getAggregates(),a=r.getAggregates().map((function(t){return t.colId})),l=o.getColumns().filter((function(t){return a.indexOf(t.id)>=0})),u=function(t){o.changeColumnType(t,i.ExprTag.AggregateFunction,{funcId:s.filter((function(e){return e.colId==t.id}))[0].funcId})},c=0,d=l;c<d.length;c++){u(x=d[c])}for(var h=o.getColumns().filter((function(t){return t.expr.tag!==i.ExprTag.AggregateFunction})),p=0,f=h;p<f.length;p++){(x=f[p]).setHidden(!0)}if(r.hasRecordCount()){(x=o.createColumn()).caption=r.COUNT_FIELD_NAME,x._id=r.COUNT_FIELD_NAME;var g=new i.Expression(x);g.tag=i.ExprTag.CustomSql,g.sql="COUNT(*)",g.baseAttrId=null,x.expr=g,o.getColumns().push(x)}r.hasGrandTotals()&&n.push(this.processLevel({query:o,level:0,groupName:"Grand Totals",resultObtainedCallback:e.resultObtained,errorOccurredCallback:e.errorOccurred}));for(var y=r.getGroups(),m=1;m<=y.length;m++){for(var v=y[m-1],b=0,C=h;b<C.length;b++){var x;(x=C[b]).setHidden(v.columns.indexOf(x.id)<0)}n.push(this.processLevel({query:o,level:m,groupName:v.name,resultObtainedCallback:e.resultObtained,errorOccurredCallback:e.errorOccurred}))}return t.all(n).then((function(){})).catch((function(t){return console.error(t)}))},e.prototype.processLevel=function(t){var e=this,n=this.context.getServices().getDataFetcher(),i={aux:!0,query:t.query};return this.context.debugMode&&(i.debug="Fetching group data. Group: '"+t.groupName+"', level: "+t.level),n.fetchData(i).then((function(n){for(var i=new o.EasyDataTable({elasticChunks:!0}),r=n.resultSet,s=0,a=r.cols;s<a.length;s++){var l=a[s];i.columns.add(l)}for(var u=0,c=r.rows;u<c.length;u++){var d=c[u];i.addRow(d)}var h=e.buildLevelData(t.level,i);e.aggrContainer.setAggregateData(t.level,h),t.resultObtainedCallback&&t.resultObtainedCallback(n,t.level)})).catch((function(e){t.errorOccurredCallback&&t.errorOccurredCallback(r(r({},e),{level:t.level}))}))},e.prototype.buildLevelData=function(t,e){var n=this.context.getQuery().getAggregationSettings(),o=t>0?n.getGroups()[t-1].columns:[],i=n.getAggregates().map((function(t){return t.colId}));n.hasRecordCount()&&i.push(n.COUNT_FIELD_NAME);for(var r=new Map,s=0,a=e.getCachedRows();s<a.length;s++){for(var l=a[s],u={},c={},d=0,h=o;d<h.length;d++){var p=h[d];if(e.columns.getIndex(p)>=0){var f=l.getValue(p);n.caseSensitiveGroups||"string"!=typeof f||(f=f.toLowerCase()),u[p]=f}}for(var g=0,y=i;g<y.length;g++){var m=y[g];c[m]=l.getValue(m)}r.set(JSON.stringify(u),c)}return r},e.prototype.needRecalculation=function(){return this._needRecalculation},e.prototype.reset=function(){this._needRecalculation=!0},e}()}).call(this,n(100))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var o=function(){function t(t,e){this.request=t,this.promise=e}return t.prototype.getPromise=function(){return this.promise},t.prototype.getRequest=function(){return this.request},t.prototype.then=function(t,e){return this.promise.then(t,e)},t.prototype.catch=function(t){return this.promise.catch(t)},t.prototype.finally=function(t){return this.promise.finally(t)},t}()},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return i}));var o=n(2),i=function(){function e(t){this.context=t,this.levelsTotals=[],this.prevRow=null,this.aggrContainer=new o.EqAggregatesContainer(t)}return e.prototype.getAggrContainer=function(){return this.aggrContainer},e.prototype.initObjects=function(){var t=this;this.aggrSettings=this.context.getQuery().getAggregationSettings(),this.groups=this.aggrSettings.getGroups(),this.aggregates=this.aggrSettings.getAggregates(),this.aggrColIds=this.aggrSettings.getAggregates().map((function(t){return t.colId})),this.aggrCols=this.context.resultTable.columns.getItems().filter((function(e){return t.aggrColIds.indexOf(e.id)>=0})),this.levelsTotals=[],this.prevRow=null},e.prototype.createColumnAggregatesObject=function(){return{sum:0,min:Number.MAX_VALUE,max:Number.MIN_VALUE}},e.prototype.calculate=function(e){this.initObjects(),this.aggrContainer.clear(),(e=e||{}).maxLevel=e.maxLevel>=0?e.maxLevel:0;for(var n=this.groups.length+1,o=0;o<n;o++){var i={count:0,columns:{}};this.resetLevelTotals(i),this.levelsTotals.push(i)}var r=this.context.resultTable.getCachedRows();if(r.length>0){for(var s=0,a=r;s<a.length;s++){var l=a[s];this.processDataRow(l)}for(o=1;o<n;o++)this.flushLevelTotals(o);this.aggrSettings.hasGrandTotals()&&this.flushLevelTotals(0)}return t.resolve()},e.prototype.resetLevelTotals=function(t){for(var e=0,n=this.aggrCols;e<n.length;e++){var o=n[e];t.columns[o.id]=this.createColumnAggregatesObject()}t.count=0},e.prototype.processDataRow=function(t){var e=this.checkLevelChange(t);if(e>=0)for(var n=e;n<this.levelsTotals.length;n++)this.flushLevelTotals(n);this.aggrSettings.hasGrandTotals()&&this.updateLevelTotals(0,t);for(var o=1,i=0,r=this.groups;i<r.length;i++){r[i];this.updateLevelTotals(o,t),o++}this.prevRow=t},e.prototype.checkLevelChange=function(t){if(null==this.prevRow)return-1;for(var e=0;e<this.groups.length;e++)for(var n=0,o=this.groups[e].columns;n<o.length;n++){var i=o[n],r=t.getValue(i),s=this.prevRow.getValue(i);if(!this.aggrSettings.compareValues(s,r))return e+1}return-1},e.prototype.flushLevelTotals=function(t){for(var e=this.levelsTotals[t],n=t>0?this.groups[t-1]:null,o=this.aggrSettings.buildGroupKey(n,this.prevRow),i={},r=0,s=this.aggregates;r<s.length;r++){var a=s[r],l=e.columns[a.colId];switch(a.funcId){case"SUM":i[a.colId]=l.sum;break;case"AVG":i[a.colId]=l.sum/e.count;break;case"COUNT":case"CNTDST":i[a.colId]=e.count;break;case"MIN":i[a.colId]=l.min;break;case"MAX":i[a.colId]=l.max}}this.aggrSettings.hasRecordCount()&&(i[this.aggrSettings.COUNT_FIELD_NAME]=e.count),this.aggrContainer.updateAggregateData(t,o,i),this.resetLevelTotals(e)},e.prototype.updateLevelTotals=function(t,e){var n=this.levelsTotals[t];n.count+=1;for(var o=0,i=this.aggregates;o<i.length;o++){var r=i[o],s=e.getValue(r.colId),a=n.columns[r.colId];a.sum+=s,s<a.min&&(a.min=s),s>a.max&&(a.max=s)}},e.prototype.needRecalculation=function(){return!0},e.prototype.reset=function(){},e}()}).call(this,n(100))},function(t,e,n){t.exports=n(115)},function(t,e){var n,o,i=t.exports={};function r(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===r||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:r}catch(t){n=r}try{o="function"==typeof clearTimeout?clearTimeout:s}catch(t){o=s}}();var l,u=[],c=!1,d=-1;function h(){c&&l&&(c=!1,l.length?u=l.concat(u):d=-1,u.length&&p())}function p(){if(!c){var t=a(h);c=!0;for(var e=u.length;e;){for(l=u,u=[];++d<e;)l&&l[d].run();d=-1,e=u.length}l=null,c=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===s||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(t)}}function f(t,e){this.fun=t,this.array=e}function g(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];u.push(new f(t,e)),1!==u.length||c||a(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";n.r(e),n.d(e,"core",(function(){return s})),n.d(e,"ui",(function(){return o})),n.d(e,"enterprise",(function(){return i}));var o={};n.r(o),n.d(o,"EntitiesPanel",(function(){return a.a})),n.d(o,"ColumnsPanel",(function(){return l.a})),n.d(o,"ColumnsBar",(function(){return u.a})),n.d(o,"SortingBar",(function(){return c.a})),n.d(o,"QueryPanel",(function(){return d.a})),n.d(o,"FilterBar",(function(){return h.a})),n.d(o,"HtmlContentWidget",(function(){return f})),n.d(o,"EqHtmlGrid",(function(){return m})),n.d(o,"Grid",(function(){return v.a})),n.d(o,"EasyGridWidget",(function(){return b.a})),n.d(o,"StatementPanel",(function(){return C.a})),n.d(o,"ProcessWidget",(function(){return x.a})),n.d(o,"ManageDrillDownWidget",(function(){return D})),n.d(o,"ResultFacetsPanel",(function(){return S.a})),n.d(o,"ExportWidget",(function(){return k.a})),n.d(o,"AggregationBar",(function(){return M.a})),n.d(o,"ChartType",(function(){return I.a})),n.d(o,"ChartWidget",(function(){return O.a})),n.d(o,"GoogleChartWidget",(function(){return A.a})),n.d(o,"ChartJsWidget",(function(){return P.a})),n.d(o,"BaseElementRenderer",(function(){return B.a})),n.d(o,"DropDownRenderer",(function(){return _.a})),n.d(o,"AggrSettingsRenderer",(function(){return L.a})),n.d(o,"AggrFuncColumnRendererCB",(function(){return R.a})),n.d(o,"SimpleColumnRendererCB",(function(){return F.a})),n.d(o,"ColumnRendererCB",(function(){return Q.a})),n.d(o,"AggrFuncColumnRendererCP",(function(){return j.a})),n.d(o,"SimpleColumnRendererCP",(function(){return q.a})),n.d(o,"ColumnAction",(function(){return N.a})),n.d(o,"ColumnRendererCP",(function(){return N.b})),n.d(o,"CustomSqlColumnRendererCP",(function(){return H.a})),n.d(o,"InputExpressionRenderer",(function(){return W.a})),n.d(o,"DateTimeExpressionRenderer",(function(){return G.a})),n.d(o,"ConditionAction",(function(){return V.a})),n.d(o,"ConditionRenderer",(function(){return V.b})),n.d(o,"SimpleConditionRenderer",(function(){return V.c})),n.d(o,"ConditionGroupRenderer",(function(){return z.a})),n.d(o,"ConditionGroupRowRenderer",(function(){return z.b})),n.d(o,"AttributeExpressionRenderer",(function(){return U.a})),n.d(o,"ExpressionRenderer",(function(){return J.a})),n.d(o,"OperatorRenderer",(function(){return Y.a})),n.d(o,"SubQueryExpressionRenderer",(function(){return K.a})),n.d(o,"ListExpressionRenderer",(function(){return X.b})),n.d(o,"CustomListExpressionRenderer",(function(){return X.a})),n.d(o,"SqlListExpressionRenderer",(function(){return X.c})),n.d(o,"TextRenderer",(function(){return $.a})),n.d(o,"AddRowRenderer",(function(){return Z.a})),n.d(o,"ResultFacet",(function(){return tt.a})),n.d(o,"DataTableFacet",(function(){return et.a})),n.d(o,"ChartFacet",(function(){return nt.a})),n.d(o,"PivotTableFacet",(function(){return ot.a})),n.d(o,"View",(function(){return it.a})),n.d(o,"AdvancedSearchView",(function(){return rt.a})),n.d(o,"DataFilterView",(function(){return at})),n.d(o,"HtmlDataFilterView",(function(){return ut})),n.d(o,"ReportView",(function(){return ht})),n.d(o,"DomDropDownElementBuilder",(function(){return pt.a})),n.d(o,"dropdown",(function(){return pt.b})),n.d(o,"PopupMenu",(function(){return ft.a})),n.d(o,"browserUtils",(function(){return ct.a})),n.d(o,"QPEditablePart",(function(){return gt.a})),n.d(o,"FacetType",(function(){return yt.a})),n.d(o,"ExportDialog",(function(){return mt.a})),n.d(o,"AggrSettingsDialog",(function(){return vt.a}));var i={};n.r(i),n.d(i,"EqServerAggregatesCalculator",(function(){return jt.a})),n.d(i,"QueryEx",(function(){return It})),n.d(i,"QueryColumnEx",(function(){return kt})),n.d(i,"ConditionEx",(function(){return Dt})),n.d(i,"DataModelEx",(function(){return Pt})),n.d(i,"EqServerQueryStorage",(function(){return Ot.a}));var r,s=n(2),a=n(67),l=n(72),u=n(40),c=n(98),d=n(25),h=n(85),p=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),f=function(t){function e(e){var n=t.call(this,e)||this;return n.contentElement=e,n.group=s.WidgetGroup.Result,n}return p(e,t),e.prototype.getWidgetType=function(){return"htmlContent"},e.prototype.init=function(e,n){t.prototype.init.call(this,e,n)},e.prototype.refreshCore=function(){this.clear(),this.context.resultContent&&this.render()},e.prototype.render=function(){this.context.resultContent&&(this.contentElement.innerHTML+=this.context.resultContent)},e.prototype.clear=function(){this.contentElement.innerHTML=""},e.prototype.destroyCore=function(){this.clear()},e}(s.Widget),g=n(0),y=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),m=function(t){function e(e){var n=t.call(this,e)||this;return n.options={maxButtonCount:10,useBootstrap:!1},n}return y(e,t),e.prototype.getWidgetType=function(){return"eqHtmlGrid"},e.prototype.init=function(e,n){t.prototype.init.call(this,e,n),this.setOptions(n)},e.prototype.setOptions=function(t){g.utils.assignDeep(this.options,t)},e.prototype.refreshCore=function(){t.prototype.refreshCore.call(this),this.renderPageNavigator()},e.prototype.destroyCore=function(){this.slot.innerHTML=""},e.prototype.renderPageNavigator=function(){var t=this,e=document.getElementById("PageNavigator");if(e){var n=parseInt(e.getAttribute("data-pagecount")),o=parseInt(e.getAttribute("data-pageindex"));if(n>1){var i=function(e){var n=e.target;if(n.hasAttribute("data-page")){var o=parseInt(n.getAttribute("data-page"));t.context.fetchDataChunk({chunk:{page:o},success:function(){t.context.refreshWidgets(s.WidgetGroup.Result)}})}},r=this.options.maxButtonCount||10,a=o-1,l=a-a%r+1,u=l+r-1;u>n&&(u=n);var c=document.createElement("ul");this.options.useBootstrap?c.className="pagination":c.className="eqv-pagination",this.options.pageItemCssClass&&(c.className+=" "+this.options.pageItemCssClass);var d=document.createElement("li");this.options.useBootstrap&&(d.className="page-item");var h=document.createElement("span");if(h.setAttribute("aria-hidden","true"),this.options.useBootstrap&&(h.className="page-link"),1==l)d.className+=" disabled";else{if(this.options.useBootstrap)(h=document.createElement("a")).setAttribute("href","javascript:void(0)"),h.setAttribute("data-page",""+(l-1)),h.className="page-link";else(f=document.createElement("a")).setAttribute("href","javascript:void(0)"),f.setAttribute("data-page",""+(l-1)),h=f;h.addEventListener("click",i)}h.innerHTML="&laquo;",d.appendChild(h),c.appendChild(d);for(var p=l;p<=u;p++)d=document.createElement("li"),this.options.useBootstrap&&(d.className="page-item"),p==o&&(d.className+=" active"),(h=document.createElement("a")).setAttribute("href","javascript:void(0)"),h.innerHTML=p.toString(),h.setAttribute("data-page",p.toString()),h.className="page-link",h.addEventListener("click",i),d.appendChild(h),c.appendChild(d);if(d=document.createElement("li"),this.options.useBootstrap&&(d.className="page-item"),(h=document.createElement("span")).setAttribute("aria-hidden","true"),this.options.useBootstrap&&(h.className="page-link"),u==n)d.className+="disabled";else{var f;if(this.options.useBootstrap)(h=document.createElement("a")).setAttribute("href","javascript:void(0)"),h.setAttribute("data-page",""+(u+1)),h.className+=" page-link";else(f=document.createElement("a")).setAttribute("href","javascript:void(0)"),f.setAttribute("data-page",""+(u+1)),h=f;h.addEventListener("click",i)}h.innerHTML="&raquo;",d.appendChild(h),c.appendChild(d),e.appendChild(c)}}},e}(f),v=n(86),b=n(44),C=n(87),x=n(88),w=n(1),T=n(4),E=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),D=function(t){function e(e){var n=t.call(this,e)||this;return n.clickHandler=function(){return n.openDialog()},n.columnsBar=null,n.queryPanel=null,n.ddQuery=null,n.cssPrefix=T.b,n.group=s.WidgetGroup.None,n}return E(e,t),e.prototype.getWidgetType=function(){return"manageDrillDown"},e.prototype.init=function(e,n){t.prototype.init.call(this,e,n),this.options=n,this.refresh(),this.slot.addEventListener("click",this.clickHandler)},e.prototype.destroyCore=function(){this.slot.removeEventListener("click",this.clickHandler)},e.prototype.openDialog=function(){var t=this,e=this.context.getServices().getDialogService(),n=this.context.getQuery(),o=this.context.getModel(),i=Object(w.domel)("div").addClass(this.cssPrefix+"-manage-drilldown").addChildElement(this.renderColumnsBarBlock()).addChildElement(this.renderQueryPanelBlock()).toDOM(),r=o.addOrUpdateOperator({id:"BindToParentColumn",caption:"is bound to",format:"{expr1} [[is bound to]] {expr2}",paramCount:2,kind:s.DataKind.ParentColumn,appliedTypes:[g.DataType.String,g.DataType.Bool,g.DataType.Float,g.DataType.Int32,g.DataType.Int64,g.DataType.Word]});r.defaultOperand.dataType=g.DataType.String,r.defaultOperand.kind=s.DataKind.ParentColumn,o.runThroughEntities((function(t){var e=t.operators.indexOf(r.id);e>0&&g.utils.moveArrayItem(t.operators,e,0)}),null),this.ddQuery=new s.Query(o,null,{parent:n});var a=this.context.getQuery().getDrillDowns();if(a.length){var l=a[0];this.ddQuery.loadFromData(l.toJSONData())}e.open({title:"Manage Drill Down",body:i,cancelable:!0,closable:!1,beforeOpen:function(){var e=i.getElementsByClassName(t.cssPrefix+"-columnsbar-slot")[0];t.columnsBar=new u.a(e,t.ddQuery),t.columnsBar.init(t.context,t.options.columnsBar);var n=i.getElementsByClassName(t.cssPrefix+"-querypanel-slot")[0];t.queryPanel=new d.a(n,t.ddQuery),t.queryPanel.init(t.context,t.options.queryPanel),t.columnsBar.refresh(),t.queryPanel.refresh()},onSubmit:function(){return t.submitDialog()},onDestroy:function(){t.destroyDialog()}})},e.prototype.renderQueryPanelBlock=function(){var t=this;return Object(w.domel)("div").addClass(this.cssPrefix+"-querypanel-block").addChild("div",(function(e){return e.addClass(t.cssPrefix+"-querypanel-caption")})).addChild("div",(function(e){return e.addClass(t.cssPrefix+"-querypanel-slot")})).toDOM()},e.prototype.renderColumnsBarBlock=function(){var t=this;return Object(w.domel)("div").addClass(this.cssPrefix+"-columnsbar-block").addChild("div",(function(e){return e.addClass(t.cssPrefix+"-columnsbar-caption")})).addChild("div",(function(e){return e.addClass(t.cssPrefix+"-columnsbar-slot")})).toDOM()},e.prototype.submitDialog=function(){if(this.ddQuery.tryValidate({checkExpressions:!0})){var t=this.context.getQuery().getDrillDowns();if(t.length)t[0].loadFromData(this.ddQuery.toJSONData()),this.context.getQuery().fireChangedEvent();else if(!this.ddQuery.isEmpty())this.context.getQuery().addDrillDown().loadFromData(this.ddQuery.toJSONData()),this.context.getQuery().fireChangedEvent();return!0}return!1},e.prototype.destroyDialog=function(){this.context.getModel().removeOperator("BindToParentColumn",!0),this.ddQuery=null,this.columnsBar&&this.columnsBar.destroy(),this.columnsBar=null,this.queryPanel&&this.queryPanel.destroy(),this.queryPanel=null},e}(s.Widget),S=n(99),k=n(92),M=n(93),I=n(5),O=n(47),A=n(53),P=n(46),B=n(42),_=n(43),L=n(95),R=n(75),F=n(41),Q=n(76),j=n(97),q=n(30),N=n(73),H=n(74),W=n(80),G=n(83),V=n(35),z=n(78),U=n(52),J=n(24),Y=n(82),K=n(84),X=n(26),$=n(77),Z=n(81),tt=n(31),et=n(91),nt=n(89),ot=n(90),it=n(32),rt=n(108),st=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),at=function(t){function e(){return t.call(this)||this}return st(e,t),e.prototype.initOptions=function(e){var n=this;return(e=t.prototype.initOptions.call(this,e)).result.fetchEmptyQueries=!0,this.context.getQuery().addChangedCallback((function(){n.resultOptions.clearResultOnQueryChange&&n.context.clearResult(),e.syncQueryOnChange&&n.context.syncQuery()})),this.context.addEventListener("ready",this.fetchData.bind(this)),e},e.prototype.initWidgets=function(e){var n=this;if(t.prototype.initWidgets.call(this,e),this.sortingBarWidget&&this.context.getQuery().addChangedCallback((function(t){var e=t.data;!e||e.part!=s.QueryChangePart.SortingColumns&&e.part!=s.QueryChangePart.Columns&&e.part!=s.QueryChangePart.All||n.fetchData()})),this.filterBarWidget){var o=this.filterBarWidget.getWidgetType();e.widgets[o]=e.widgets[o]||{},e.widgets[o].applyFilterCallback||(e.widgets[o].applyFilterCallback=function(){n.fetchData()})}},e.prototype.applyQueryFilter=function(){console.warn("applyQueryFilter is obsolete. Use fetchData instead"),this.fetchData()},e.prototype.fetchData=function(){t.prototype.fetchData.call(this,{refresh:!0})},e}(it.a),lt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ut=function(t){function e(){return t.call(this)||this}return lt(e,t),e.prototype.createResultGridWidget=function(t){return new m(t)},e.prototype.applyQueryFilter=function(){console.warn("applyQueryFilter is obsolete. Use fetchData instead"),this.fetchData()},e}(at),ct=n(3),dt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ht=function(t){function e(){var e=t.call(this)||this;return e.reports=[],e.reportCache=[],e.exportButtons=[],e.exportClass="eqjs-export",e.disabledClass="eqjs-disabled",e.enableExport=!1,e.useReportCache=!0,e.syncReportOnChange=!0,e._reportSaveTemplate='<div id="kdlg-dialog-form" class="kfrm-form">\n <div class="kfrm-fields label-above">\n <label for="kdlg-dialog-form-input" id="kdlg-dialog-form-content"></label>\n <input type="text" name="kdlg-dialog-form-input" id="kdlg-dialog-form-input" />\n <label for="kdlg-dialog-form-textarea" id="kdlg-dialog-form-desc-label"></label>\n <textarea type="text" name="kdlg-dialog-form-textarea" id="kdlg-dialog-form-textarea"></textarea>\n </div>\n </div>',e.context.useStoredQueryOnFetch=!0,e.exportButtonClickHandler=function(t,n){if(!t.classList.contains(e.disabledClass)){var o=t.getAttribute("data-format");e.context.exportResult({format:o})}},e.clearReportButtonClickHandler=e.clearReportButtonClick.bind(e),e.newReportButtonClickHandler=e.newReportButtonClick.bind(e),e.loadReportButtonClickHandler=e.loadReportButtonClick.bind(e),e.saveReportButtonClickHandler=e.saveReportButtonClick.bind(e),e.removeReportButtonClickHandler=e.removeReportButtonClick.bind(e),e.reloadReportDataButtonClickHandler=e.reloadReportDataButtonClick.bind(e),ct.a.onMobileModeChanged((function(t){document.location.reload()})),e}return dt(e,t),e.prototype.initOptions=function(e){return void 0!==(e=t.prototype.initOptions.call(this,e)).syncQueryOnChange&&(this.syncReportOnChange=e.syncQueryOnChange),void 0!==e.syncReportOnChange&&(this.syncReportOnChange=e.syncReportOnChange),e.syncQueryOnChange=this.syncReportOnChange,void 0!==e.useReportCache&&(this.useReportCache=e.useReportCache),this.defaultReportId=e.defaultReportId,e},e.prototype.initDone=function(){var e=this;t.prototype.initDone.call(this),this.context.getQuery().addChangedCallback((function(t){var n=t.data;n&&("query.switched"==n.changeType?(e.context.clearResult(),e.context.refreshWidgets(s.WidgetGroup.Result),e.context.refreshWidgets(s.WidgetGroup.Query)):(e.disableExportButtons(),e.resultCountSlot&&(e.resultCountSlot.style.display="none")));var o=!n||"query.switched"==n.changeType||n.part==s.QueryChangePart.ExtraData||n.part==s.QueryChangePart.Facets,i=!1;e.syncReportOnChange&&(n&&"query.switched"!=n.changeType&&!n.noSync&&(i=!0,e.syncReport({success:function(){!o&&e.viewOptions.fetchDataOnChange&&e.fetchData()}})));!o&&e.resultOptions.clearResultOnQueryChange&&(e.context.clearResult(),e.context.refreshWidgets(s.WidgetGroup.Result)),o||i||!e.viewOptions.fetchDataOnChange||e.fetchData()})),window.setTimeout((function(){e.context.loadQueryList({success:function(t){Array.isArray(t)&&(e.reports=t,e.reports.filter((function(t){return t.id==e.defaultReportId})).length>0?e.renderReportList({reportId:e.defaultReportId}):e.renderReportList())}})}),100)},e.prototype.initWidgets=function(e){var n=this;t.prototype.initWidgets.call(this,e);var o="ClearReportButton",i="NewReportButton",r="LoadReportButton",s="SaveReportButton",a="RemoveReportButton",l="ReloadReportDataButton",u="ResultCount",c="ResultExportButtons",d=this.exportClass;e.slots&&(u=e.slots.resultCountSpan||u,c=e.slots.exportButtons||c,o=e.slots.clearReportButton||o,i=e.slots.newReportButton||i,r=e.slots.loadReportButton||r,s=e.slots.saveReportButton||s,a=e.slots.removeReportButton||a,l=e.slots.reloadReportDataButton||l,d=e.slots.exportClass||d),this.exportButtons=this.domRoots.reduce((function(t,e){return t.concat(Array.from(e.querySelectorAll("."+d)))}),[]),this.enableExport=e.enableExport,this.enableExport?this.exportButtons.forEach((function(t){t.addEventListener("click",n.exportButtonClickHandler)})):this.hideExportButtons(),this.exportButtonsContainer=this.resolveElement(c),this.clearReportButton||(this.clearReportButton=this.resolveElement(o),this.clearReportButton&&this.clearReportButton.addEventListener("click",this.clearReportButtonClickHandler)),this.newReportButton||(this.newReportButton=this.resolveElement(i),this.newReportButton&&this.newReportButton.addEventListener("click",this.newReportButtonClickHandler)),this.loadReportButton||(this.loadReportButton=this.resolveElement(r),this.loadReportButton&&this.loadReportButton.addEventListener("click",this.loadReportButtonClickHandler)),this.saveReportButton||(this.saveReportButton=this.resolveElement(s),this.saveReportButton&&this.saveReportButton.addEventListener("click",this.saveReportButtonClickHandler)),this.removeReportButton||(this.removeReportButton=this.resolveElement(a),this.removeReportButton&&this.removeReportButton.addEventListener("click",this.removeReportButtonClickHandler)),this.reloadReportDataButton||(this.reloadReportDataButton=this.resolveElement(l),this.reloadReportDataButton||(this.reloadReportDataButton=this.resolveElement("UpdateReportButton")),this.reloadReportDataButton&&this.reloadReportDataButton.addEventListener("click",this.reloadReportDataButtonClickHandler)),this.reportListSlot=document.getElementById("ReportList"),this.resultCountSlot=this.resolveElement(u)},e.prototype.newReport=function(){var t=this,e=this.context.getServices().getDialogService().open({title:g.i18n.getText("NewReportDlgTitle"),body:this._reportSaveTemplate,submitable:!0,closable:!0,cancelable:!0,submitOnEnter:!0,arrangeParents:!1,beforeOpen:function(){var t=document.getElementById("kdlg-dialog-form-input");t.value=g.i18n.getText("NewReportDefName"),document.getElementById("kdlg-dialog-form-content").innerHTML=g.i18n.getText("SaveReportDlgLabel"),document.getElementById("kdlg-dialog-form-desc-label").innerHTML=g.i18n.getText("ReportDescLabel"),t.focus()},onSubmit:function(){var n=document.getElementById("kdlg-dialog-form-input").value;if(n&&n.replace(/\s/g,"").length>0){e.clearAlert(),e.disableButtons();var o=e.getRootElement().querySelector("header"),i=Object(w.domel)("div",o).addClass("eqjs-process-bar local").toDOM(),r=document.getElementById("kdlg-dialog-form-textarea").value;t.context.newQuery({name:n,description:r,success:function(){e.close();var n=t.context.getQuery(),o=n.getId();t.insertIntoReportList({id:o,name:n.getName(),description:n.getDescription()}),t.renderReportList({reportId:o})},error:function(t){o.removeChild(i),e.enableButtons(),e.showAlert(t,"error")}})}return!1}})},e.prototype.loadReport=function(t){var e=this;if(!t)throw"Empty report ID!";var n=this.findReportById(t);if(n){var o=this.context.getQuery(),i=function(){e.renderReportProps(),e.context.resultTable.clear(),o.fireChangedEvent({part:s.QueryChangePart.All,noSync:!0,changeType:"query.switched"}),e.fetchData()},r=this.useReportCache?this.getReportContentFromCache(n):null;r?(o.clear(),o.loadFromJson(r,{validate:!1}),i()):this.context.loadQuery({queryId:t,silent:!0,success:function(){e.saveReportContentInCache(n,o.toJSON()),i()}}),this.setActiveReport(t)}},e.prototype.saveCurrentReportAs=function(){var t=this,e=this.context.getQuery(),n=this.context.getServices().getDialogService().open({title:g.i18n.getText("SaveReportDlgTitle"),body:this._reportSaveTemplate,submitable:!0,closable:!0,cancelable:!0,submitOnEnter:!0,arrangeParents:!1,beforeOpen:function(){var t=document.getElementById("kdlg-dialog-form-input");t.value=e.getName(),document.getElementById("kdlg-dialog-form-content").innerHTML=g.i18n.getText("SaveReportDlgLabel"),document.getElementById("kdlg-dialog-form-desc-label").innerHTML=g.i18n.getText("ReportDescLabel"),document.getElementById("kdlg-dialog-form-textarea").value=e.getDescription(),t.focus()},onSubmit:function(){var o=document.getElementById("kdlg-dialog-form-input").value;if(o&&o.replace(/\s/g,"").length>0){e.setId(g.utils.generateId(o.replace(/\s/g,""))),n.clearAlert(),n.disableButtons();var i=n.getRootElement().querySelector("header"),r=Object(w.domel)("div",i).addClass("eqjs-process-bar local").toDOM(),a=document.getElementById("kdlg-dialog-form-textarea").value;e.setDescription(a),t.context.newQuery({clearQuery:!1,name:o,success:function(){n.close(),t.context.refreshWidgets(s.WidgetGroup.Query);var o=t.context.getQuery().getId();t.fetchData(),t.insertIntoReportList({id:o,name:e.getName(),description:e.getDescription()}),t.renderReportList({reportId:o}),t.setActiveReport(o),t.renderReportProps()},error:function(t){i.removeChild(r),n.enableButtons(),n.showAlert(t,"error")}})}return!1}})},e.prototype.removeCurrentReport=function(){var t=this,e=this.context.getQuery();this.context.getServices().getDialogService().openConfirm(g.i18n.getText("RemoveReportDlgTitle"),g.i18n.getText("RemoveReportContent").replace("{reportName}",e.getName())).then((function(n){if(n){var o=e.getId();t.context.removeQuery({queryId:o,success:function(){var e=t.removeFromReportList(o);t.renderReportList({reportIndex:e})}})}}))},e.prototype.syncReport=function(t){var e=this;if(this.useReportCache){var n=this.context.getQuery(),o=this.findReportById(n.getId());o&&(o.lastUpdated=Date.now(),this.saveReportContentInCache(o,n.toJSON()))}this.context.syncQuery({success:function(n){n.query&&e.context.refreshWidgets(s.WidgetGroup.Query),n.statement&&e.context.refreshWidgets(s.WidgetGroup.Statement),t&&t.success&&t.success(n)}})},e.prototype.setActiveReport=function(t){for(var e=this.reportListSlot.querySelectorAll("li"),n=0;n<e.length;n++){var o=e[n];o.classList.remove("active"),o.getAttribute("data-rid")===t&&o.classList.add("active")}},e.prototype.renderReportProps=function(){var t=this.context.getQuery();document.getElementById("ReportTitle").innerHTML=t.getName();var e=document.querySelector(".columns-bar");if(e){e.innerHTML="<strong>Columns:</strong>";for(var n=0,o=t.getColumns();n<o.length;n++){var i=o[n];e.innerHTML+='<span class="label label-default">'+i.caption+"</span> "}}},e.prototype.renderReportList=function(t){if(this.renderReportPanels(),!this.reportListSlot.matches("li")){this.reportListSlot.innerHTML="",t=t||{reportId:this.reports.length>0?this.reports[0].id:null};var e=document.createElement("ul");e.className="list-group list-group-flush",this.reportListSlot.appendChild(e);for(var n=0,o=this.reports;n<o.length;n++){var i=o[n];this.renderReportItemInList(i,e)}if(t.reportId&&this.loadReport(t.reportId),void 0!==t.reportIndex){var r=t.reportIndex;r>=this.reports.length&&(r=this.reports.length-1),r<0&&this.reports.length>0&&(r=0),r>=0&&this.loadReport(this.reports[r].id)}}},e.prototype.detach=function(){var e=this;this.exportButtonsContainer&&(this.showExportButtons(),this.exportButtons.forEach((function(t){t.removeEventListener("click",e.exportButtonClickHandler)})),this.exportButtons=[],this.exportButtonsContainer=null),this.clearReportButton&&(this.clearReportButton.removeEventListener("click",this.clearReportButtonClickHandler),this.clearReportButton=null),this.newReportButton&&(this.newReportButton.removeEventListener("click",this.newReportButtonClickHandler),this.newReportButton=null),this.loadReportButton&&(this.loadReportButton.removeEventListener("click",this.loadReportButtonClickHandler),this.loadReportButton=null),this.saveReportButton&&(this.saveReportButton.addEventListener("click",this.saveReportButtonClickHandler),this.saveReportButton=null),this.removeReportButton&&(this.removeReportButton.removeEventListener("click",this.removeReportButtonClickHandler),this.removeReportButton=null),this.reloadReportDataButton&&(this.reloadReportDataButton.removeEventListener("click",this.reloadReportDataButtonClickHandler),this.removeReportButton=null),this.reportListSlot&&(this.reportListSlot.innerHTML="",this.reportListSlot=null),this.resultCountSlot&&(this.resultCountSlot.innerHTML="",this.resultCountSlot=null),t.prototype.detach.call(this)},e.prototype.renderReportItemInList=function(t,e){var n=this;e||(e=this.reportListSlot.querySelector("ul"));var o=t.name||t.description||"",i=document.createElement("li");i.className="list-group-item",i.style.cursor="pointer",i.setAttribute("data-rid",t.id),i.innerText=o,t.description&&(i.title=t.description),i.addEventListener("click",(function(t){var e=t.target.getAttribute("data-rid");n.loadReport(e),n.setActiveReport(e)})),e.appendChild(i)},e.prototype.renderReportPanels=function(){var t=document.getElementById("ReportsContainer"),e=document.getElementById("NoReportPanel");this.reports.length>0?(this.hideElement(e),this.showElement(t)):(this.hideElement(t),this.showElement(e))},e.prototype.hideElement=function(t){t&&(t.style.visibility="hidden")},e.prototype.showElement=function(t){t&&t.style.removeProperty("visibility")},e.prototype.insertIntoReportList=function(t){this.reports.push(t)},e.prototype.removeFromReportList=function(t){var e=this.indexOfReportById(t);return e>=0&&this.reports.splice(e,1),e},e.prototype.indexOfReportById=function(t){for(var e=0;e<this.reports.length;e++)if(this.reports[e].id===t)return e;return-1},e.prototype.clearReportButtonClick=function(){this.clearErrors(),this.context.clearQuery()},e.prototype.reloadReportDataButtonClick=function(){this.fetchData()},e.prototype.saveReportButtonClick=function(){this.saveCurrentReportAs()},e.prototype.loadReportButtonClick=function(){this.loadReport("LastQuery")},e.prototype.removeReportButtonClick=function(){this.removeCurrentReport()},e.prototype.newReportButtonClick=function(){this.newReport()},e.prototype.errorHandler=function(t){},e.prototype.clearErrors=function(){},e.prototype.disableExportButtons=function(){this.hideExportButtons()},e.prototype.enableExportButtons=function(){this.showExportButtons()},e.prototype.hideExportButtons=function(){this.exportButtonsContainer&&(this.exportButtonsContainer.style.display="none")},e.prototype.showExportButtons=function(){this.exportButtonsContainer&&(this.exportButtonsContainer.style.display="initial")},e.prototype.saveReportContentInCache=function(t,e){var n=this.findReportCacheItem(t.id);n||(n={id:t.id},this.reportCache.push(n)),n.lastUpdated=t.lastUpdated,n.content=e},e.prototype.getReportContentFromCache=function(t){var e=this.findReportCacheItem(t.id);return e&&e.lastUpdated===t.lastUpdated?e.content:null},e.prototype.findReportById=function(t){for(var e=0,n=this.reports;e<n.length;e++){var o=n[e];if(o.id===t)return o}return null},e.prototype.findReportCacheItem=function(t){for(var e=0,n=this.reportCache;e<n.length;e++){var o=n[e];if(o.id===t)return o}return null},e}(it.a),pt=n(79),ft=n(9),gt=n(10),yt=n(15),mt=n(45),vt=n(94);g.i18n.addMapper((function(t){if(t||t.texts)for(var e in t.texts)switch(e){case"PredicateTitle":t.texts.ConditionGroupTitle=t.texts[e];break;case"RootPredicateTitle":t.texts.RootConditionGroupTitle=t.texts[e];break;case"ErrIncorrectPredicateTitleFormat":t.texts.ErrIncorrectGroupTitleFormat=t.texts[e];break;case"ButtonAddPredicate":t.texts.ButtonAddGroup=t.texts[e];break;case"ButtonDelete":t.texts.CmdDelete=t.texts[e];break;case"ButtonClear":t.texts.CmdClear=t.texts[e];break;case"ButtonEnable":t.texts.CmdToggleEnable=t.texts[e];break;case"ButtonAddCondition":t.texts.CmdAddCondition=t.texts[e];break;case"ButtonAddGroup":t.texts.CmdAddCondGroup=t.texts[e]}})),g.i18n.updateDefaultTexts({AltMenuAttribute:"Attribute",AltMenuConstantExpression:"Constant expression",ButtonApply:"Apply",ButtonCancel:"Cancel",ButtonClose:"Close",ButtonNext:"Next",ButtonPrev:"Prev",ButtonNow:"Now",ButtonOK:"OK",MenuEnable:"Enabled",MenuParameterization:"Parameterized",MenuJoinCond:"Use in JOIN",CmdClear:"Clear",CmdDelete:"Delete",CmdToggleEnable:"Toggle enable",CmdAddCondition:"Add condition",CmdAddCondGroup:"Add group of conditions",ButtonSelectAll:"Select all",ButtonDeselectAll:"Clear selection",ButtonAddColumns:"Add column(s)",ButtonAddConditions:"Add condition(s)",CmdClickToAddCondition:"[Add new condition]",CmdDeleteRow:"Delete this row",ErrIncorrectGroupTitleFormat:"Incorrect condition group title format",ErrNotNumber:" is not a number",ErrIncorrectInteger:"Incorrect integer value",ErrIncorrectNumberList:"Incorrect list format",False:"False",LinkTypeAll:"all",LinkTypeAny:"any",LinkTypeNone:"none",LinkTypeNotAll:"not all",ConjAll:"and",ConjAny:"or",ConjNotAll:"and",ConjNone:"or",MsgApplySelection:"[Apply selection]",MsgAs:"as",MsgEmptyList:"(empty list)",MsgEmptyListValue:"[select value]",MsgEmptyScalarValue:"[enter value]",MsgSubQueryValue:"[edit sub-query]",MsgEmptyAttrValue:"[select attribute]",MsgEmptyOperator:"[Unrecognized operator]",MsgEmptyCustomSql:"[enter SQL expression]",MsgCustomSql:"[Custom SQL]",MsgNoResult:"No result",MsgResultCount:"{0} records found",MsgOf:"of",ConditionGroupTitle:"{lt} of the following apply",RootConditionGroupTitle:"Select records where {lt} of the following apply",StrAddConditions:"Add conditions",SubQueryDialogTitle:"Edit sub-query",SubQueryColumnTitle:"Column:",SubQueryEmptyColumn:"[select column]",SubQueryQueryPanelCaption:"Conditions",True:"True",ButtonSorting:"Sorting",ButtonToAggr:"Change to aggregate column",ButtonToSimple:"Change to simple column",ButtonFormat:"Display format",CmdAscending:"Ascending",CmdClickToAddColumn:"[Add new column]",CmdDeleteColumn:"Delete column",CmdDeleteSorting:"Delete sorting",CmdDescending:"Descending",CmdGroupSort:"Sorting",CmdGroupFormat:"Display format",CmdNotSorted:"Not sorted",ColTypeAggrFunc:"Aggregate function",ColTypeCompound:"Calculated",ColTypeGroup:"Column type",ColTypeSimple:"Simple column",HeaderExpression:"Expression",HeaderSorting:"Sorting",HeaderTitle:"Title",SortHeaderColumn:"Column",SortHeaderSorting:"Sorting",StrAddColumns:"Add columns",CustomExpression:"Custom Expression",AddAllForEntityText:"[Add all attributes]",CmdMoveToStart:"Move to start",CmdMoveRight:"Move right",CmdMoveLeft:"Move left",CmdMoveToEnd:"Move to the end",CmdMoveUp:"Move up",CmdMoveDown:"Move down",ButtonMenu:"Show menu",CmdToSimple:"Not aggregated",CmdMoveToFirst:"Move to the first",CmdMoveToPrev:"Move to the previous",CmdMoveToNext:"Move to the next",CmdMoveToLast:"Move to the last",CmdHiddenColumn:"Hidden",RowButtonTitle:"Click to see the available options",EntityToggle:"Toggle entity",StrNoFilterDefined:"No filter defined",StrNoFilterClickToAdd:"No filter defined. Click to add a new condition",HintHours:"Hours",HintMinutes:"Minutes",RemoveQueryTitle:"Confirmation",RemoveQueryContent:"Remove query [{queryName}]?",NewQueryTitle:"New query",NewQueryContent:"New query name: ",NewQueryDefName:"New query",SaveQueryTitle:"Save query",SaveQueryContent:"Query name: ",SaveQueryDefName:"{queryName} copy",QueryChangedTitle:"Confirmation",QueryChangedContent:"The query was changed. Do you want to save it first?",UpdateQuerySelector:"[click here to load the query]",FileNameLabel:"File name: ",SaveQueryToFileDlgTitle:"Save query to file",NewReportDefName:"New report",NewReportDlgTitle:"New report",SaveReportDlgTitle:"Save report",SaveReportDlgLabel:"Report name:",ReportDescLabel:"Description: ",RemoveReportDlgTitle:"Remove report",RemoveReportContent:"Are you sure you want to remove '{reportName}'?",Facets:{TotalRecordsLabel:"Total records:",AddMenuItems:{Chart:"Chart",Pivot:"Pivot table",DataTable:"Data table"},LoadDataDlgTitle:"Downloading data",LoadDataDlgContent:"Records loaded: {loadedRecs}/{totalRecs}",RefreshBtnTitle:"Refresh",ExportBtnTitle:"Export",MaximizeBtnTitle:"Maximize",RestoreBtnTitle:"Restore Down",RemoveFacetDlgTitle:"Remove facet",RemoveFacetDlgContent:"Are you sure, that you want to delete {facetTitle} tab?",DefaultDlgTitle:"Setup facet",DefaultFacetTitle:"",NewFacetTitle:"New Facet",TabNameLabel:"Tab name",ErrQueryChanged:"FAILED TO DISPLAY. QUERY WAS CHANGED",ErrNotEnoughData:"We can't display the graph because not all data for this query is loaded. \n The total number of records: {totalRecs}, currently loaded: {cachedRecs}. \n You can [download the result]. Please note: this may take some time and consume a lot of memory.",ErrTooMuchData:"Too much data. The grid is not able to display it",Chart:{FacetTitle:"Chart",DlgTitle:"Chart settings",DataColumnSelectorLabel:"Data column",LabelColumnSelectorLabel:"Label column",ChartTypeSelectorLabel:"Chart type",ShowLegendLabel:"Show legend (if available)"},Pivot:{FacetTitle:"Pivot table",DlgTitle:"Pivot settings",SwapBtnTitle:"Swap column and row fields",ColumnFieldSelectorLabel:"Column field",RowFieldSelectorLabel:"Row field",CellDataSelectorLabel:"Cell data",TotalsRowLabel:"Totals row",TotalsColLabel:"Totals column",TotalGridLabel:"Total"},DataTable:{FacetTitle:"Result table",DlgTitle:"Table facet settings"}},TotalsDlgLabel:"Totals",GrandTotalsLabel:"Grand totals",TotalsDlgTitle:"Select totals",ExportDlgTitle:"Export result",ExportDlgFmtLabel:"Format",csv:"CSV",excel:"Excel",pdf:"PDF","excel-html":"HTML (Excel-compatible)",AggrSettings:{GroupBtn:"Group selected column(s)",UngroupBtn:"Ungroup columns",AggrBtn:"Aggregate selected column",UnaggrBtn:"Remove column aggregation",GrandTotalsLabel:"Show grand totals",GroupCountsLabel:"Show record count for groups",AggrDialogTitle:"Aggregation/grouping",EnableAggrLabel:"Enable aggregation",SelectedError:"Complete the action with selected column(s)",NoGroupsOrAggrError:"Add at least one group or aggregation",NoGroupsOrGrandError:"Add at least one group, or enable grand totals",NoAggrOrCountError:"Add at least one aggregation, or enable records count",NoGroupsLabel:"No groups",NoAggrsLabel:"No aggregations",EmptySettingsLabel:"[ Click to setup ]"},ChartType:{Area:"Area chart",Bar:"Bar chart",Column:"Column chart",Combo:"Combo chart",Doughnut:"Doughnut chart",Polar:"Polar chart",Radar:"Radar chart",Histogram:"Histogram chart",Line:"Line chart",SteppedLine:"Stepped line chart",Pie:"Pie chart"}}),s.EqServiceProvider.prototype.registerDialogServiceResolver=function(t){this.dialogServiceResolver=t},s.EqServiceProvider.prototype.getDialogService=function(){if(!this.dialogService){if(!this.dialogServiceResolver)throw"DialogServiceResolver is not defined";this.dialogService=this.dialogServiceResolver()}return this.dialogService},Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),window.NodeList&&!window.NodeList.prototype.forEach&&(window.NodeList.prototype.forEach=Array.prototype.forEach),Array.prototype.findIndex||(Array.prototype.findIndex=function(t){if(null==this)throw new TypeError("Array.prototype.findIndex called on null or undefined");if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var e,n=Object(this),o=n.length>>>0,i=arguments[1],r=0;r<o;r++)if(e=n[r],t.call(i,e,r,n))return r;return-1});var bt=[45,128,231];Math.trunc=Math.trunc||function(t){return isNaN(t)?NaN:t>0?Math.floor(t):Math.ceil(t)};var Ct={__kt:0,ck:function(t){if(t&&t.length)try{for(var e=function(t){for(var e=function(t){var e=t;switch((e=(e=e.replace(/-/g,"+")).replace(/_/g,"/")).length%4){case 0:break;case 2:e+="==";break;case 3:e+="="}return window.atob(e)}(t),n=e.length,o=new Uint8Array(n),i=0;i<n;i++)o[i]=e.charCodeAt(i);return o}(t.slice(0,t.length-12)),n=t.slice(t.length-12),o=!1,i=0,r=bt;i<r.length;i++){var s=Tt(r[i]);if(n[0]===s[0]&&n[2]===s[1]){o=!0;break}}o||(Ct.__kt=-1);if(n[8]!=xt(9,19))return void(Ct.__kt=-2);if(n[1]!=xt(e[3]))return;if(Ct.__kt=n[3]!=xt(e[5])?2:3,2===Ct.__kt){var a=""+function(t){for(var e=0,n=0;n<t.length;++n)e+=wt.indexOf(t[n])*Math.pow(wt.length,t.length-n-1);return e}(n.substring(4,6)+n.substring(10)),l=new Date(2e3+Number.parseInt(a.substring(0,2)),Number.parseInt(a.substring(2,4))-1,Number.parseInt(a.substring(4)),0,0,0,0);Date.now()>l.getTime()&&(Ct.__kt=1)}}catch(t){}else this.__kt=-3}};function xt(t,e){return void 0===e&&(e=20),String.fromCharCode(65+t%e)}var wt="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";function Tt(t){for(var e="";t>0;)e=wt[t%wt.length]+e,t/=wt.length;return e}var Et=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Dt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.readOnly=!1,e.parameterized=!1,e.inJoin=!1,e}return Et(e,t),e.prototype.isReadOnly=function(){return this.readOnly||this.getParent()&&this.getParent().isReadOnly()},e.prototype.setReadOnly=function(t){this.readOnly=t||this.getParent()&&this.getParent().isReadOnly(),this.conditions&&this.conditions.forEach((function(e){e.setReadOnly(t)}))},e.prototype.isParameterized=function(){return this.parameterized},e.prototype.setParameterized=function(t){this.parameterized=t},e.prototype.isInJoin=function(){return this.inJoin},e.prototype.setInJoin=function(t){this.inJoin=t},e.prototype.loadFromData=function(e,n){if(t.prototype.loadFromData.call(this,e,n),!(Ct.__kt<=1)&&(void 0!==n.readOnly&&this.setReadOnly(n.readOnly),void 0!==n.inJoin&&this.setInJoin(n.inJoin),void 0!==n.parameterized&&this.setParameterized(n.parameterized),n.conds))for(var o=0;o<n.conds.length;o++){var i=this.query.createCondition();i.loadFromData(e,n.conds[o]),this.conditions.push(i),i.setParent(this)}},e.prototype.saveToData=function(){var e=t.prototype.saveToData.call(this);if(Ct.__kt<=1)return e;if(this.isReadOnly()&&(e.readOnly=this.isReadOnly()),this.isParameterized()&&(e.parameterized=this.isParameterized()),this.isInJoin()&&(e.inJoin=this.isInJoin()),this.tag==s.CondTag.Group){e.conds=[];for(var n=0;n<this.conditions.length;n++)e.conds.push(this.conditions[n].saveToData())}return e},e}(s.Condition),St=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),kt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.readOnly=!1,e}return St(e,t),e.prototype.isReadOnly=function(){return this.readOnly},e.prototype.setReadOnly=function(t){this.readOnly=t},e.prototype.loadFromData=function(e,n){t.prototype.loadFromData.call(this,e,n),Ct.__kt<=2||n&&void 0!==n.readOnly&&(this.readOnly=n.readOnly)},e.prototype.saveToData=function(){var e=t.prototype.saveToData.call(this);return Ct.__kt<=2||this.isReadOnly()&&(e.readOnly=this.isReadOnly()),e},e}(s.QueryColumn),Mt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),It=function(t){function e(e){return t.call(this,e)||this}return Mt(e,t),e.prototype.isEx=function(){return Ct.__kt>1},e.prototype.createSubQuery=function(){return new e(this.model)},e.prototype.createCondition=function(e){return void 0===e&&(e=s.CondTag.Simple),Ct.__kt<=1?t.prototype.createCondition.call(this,e):new Dt(this,e)},e.prototype.createColumn=function(e){return void 0===e&&(e=!1),Ct.__kt<=1?t.prototype.createColumn.call(this,e):new kt(this,e)},e.prototype.addConditionGroup=function(e,n){if(void 0===n&&(n=!0),Ct.__kt<=1)return t.prototype.addConditionGroup.call(this,e,n);var o=e.parent||this.getRootCondition(),i=e.linking||(o.linkType===s.LinkType.All?s.LinkType.Any:s.LinkType.All),r=this.createCondition(s.CondTag.Group);if(r.linkType=i,n){var a=this.getModel(),l=a.getFirstUICAttr(),u=a.getDefaultOperatorForAttr(l),c=this.createSimpleConditionObject(l,u,"");r.addCondition(c)}return o.addCondition(r),r},e.prototype.addExtraConditionGroup=function(e,n){return void 0===n&&(n=!0),e.parent=e.parent||this.extraConditions,Ct.__kt<=1?t.prototype.addExtraConditionGroup.call(this,e,n):this.addConditionGroup(e)},e}(s.Query),Ot=n(96),At=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Pt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return At(e,t),e.prototype.buildQueryPath=function(e){if(Ct.__kt<=1)return t.prototype.buildQueryPath.call(this,e);if(this.mainEntity)return t.prototype.buildQueryPath.call(this,e);var n=this.getEntitiesInQuery(e);if(0==n.length)throw Error("Cannon build path. Path is empty");for(var o=new s.Tree(n[0]),i=1;i<n.length;i++){var r=n[i];if(!o.contains(r)){var a=this.findPath(o.value,r);if(null==a)throw Error("Unable to build query. Cannot build path.");o=this.addPathToTree(o,a[0]===o.value?a.slice(1):a)}}return o.setParents(),o},e.prototype.addPathToTree=function(t,e){if(0!=e.length){for(var n=!1,o=0,i=t.childs;o<i.length;o++){var r=i[o];if(r.value===e[0]){n=!0,e.length>1&&(r=this.addPathToTree(r,e.slice(1)));break}}if(!n)if(this.findLink(t.value,e[0])){var a=new s.Tree(e[0]);t.addChild(a),e.length>1&&(a=this.addPathToTree(a,e.slice(1)))}else{if(t.parent)throw Error("Unable to build query. Cannot build path.");var l=new s.Tree(t);(t=new s.Tree(e[0])).addChild(l),e.length>1&&(t=this.addPathToTree(t,e.slice(1)))}return t}},e.prototype.findPath=function(t,e){var n=[],o=[],i=[],r=[],s=!1;for(n.push(t),o.push(n),r.push(t);!s;){i=[];for(var a=0,l=o;a<l.length;a++){var u=l[a];if(s=this.checkPath(u,e,i,r)){u.push(e),n=u;break}}if(o=[],!s){if(0==i.length)return null;for(var c=0,d=i;c<d.length;c++){u=d[c];o.push(u)}}}return n},e.prototype.checkPath=function(t,e,n,o){for(var i=t[t.length-1],r=0,s=this.getLinksByEntity(i);r<s.length;r++){var a=s[r],l=null;if((l=a.entityFrom==i?a.entityTo:a.entityFrom)==e)return n=[],!0;if(t.indexOf(l)<0&&o.indexOf(l)<0){o.push(l);var u=new Array;(u=u.concat(t)).push(l),n.push(u)}}return!1},e.prototype.createQuery=function(){return new It(this)},e}(s.DataModel),Bt=n(111);function _t(t){return!t||""===t.trim()}var Lt,Rt="https://korzh.com/api/license",Ft=function(){function t(t){this.http=new g.HttpClient,this.context=t}return t.prototype.show=function(){var t=this,e=new w.DefaultDialogService;this.dialogSet=e.createSet([{closable:!1,cancelable:!1,submitOnEnter:!0,title:"No license key for EasyQuery",body:this.buildStartPage(),submitButtonText:"Submit",onInput:this.validateForm.bind(this),onSubmit:this.startPageOnSubmit.bind(this)},{closable:!1,cancelable:!1,submitOnEnter:!0,title:"Please check your inbox",body:this.buildCodePage(),submitButtonText:"Get License Key",onInput:this.validateForm.bind(this),onSubmit:this.codePageOnSubmit.bind(this)},{closable:!1,cancelable:!1,submitable:!1,title:"Success",body:this.buildSuccessPage()},{closable:!1,cancelable:!1,submitable:!1,title:"Failure",body:this.buildFailurePage()}]);var n=this.dialogSet.open(0);setTimeout((function(){t.validateForm(n);var e=document.getElementById("eqAuthEmail");e&&e.focus()}),200)},t.prototype.isValidForm=function(t){var e=t.querySelector("#eqAuthEmail");if(e)return!_t(e.value)&&e.value.toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/);var n=t.querySelector("#eqAuthCode");return!n||!_t(n.value)&&!isNaN(+n.value)&&n.value==n.value.trim()&&6===n.value.length},t.prototype.validateForm=function(t){t.getSubmitButtonElement().disabled=!this.isValidForm(t.getRootElement())},t.prototype.addInputField=function(t,e){t.addChild("label",(function(t){return t.attr("for",e.id).addHtml(e.label+" "+(e.required?'<sup style="color: red">*</sup>':"")+": ")})).addChild("input",(function(t){t.id(e.id),t.name(e.name||e.id),t.type(e.type||"text"),void 0!==e.value&&t.value(e.value),e.onInput&&t.on("input",e.onInput)}))},t.prototype.buildStartPage=function(){var t,e=Object(w.domel)("div");return e.addChild("div",(function(t){return t.html('<div style="font-size:1.2em">The EasyQuery license key is either absent, invalid or was issued for a different version of the library.</div><div style="font-size:1.2em">Please fill out the form to obtain a valid trial license key.</div>')})),e.addClass("kfrm-form").addChild("div",(function(e){t=e,e.addClass("kfrm-fields label-above"),e.addClass("kfrm-break-20")})),this.addInputField(t,{id:"eqAuthEmail",name:"email",label:"Email",required:!0}),this.addInputField(t,{id:"eqAuthName",name:"contactName",label:"Name (optional)",required:!1}),e.addChild("div",(function(t){return t.html('<div style="margin-top:20px;font-size:0.9em">* By clicking Submit, you agree with Korzh.com <a href="https://korzh.com/terms-of-use">Terms of use</a> and <a href="https://korzh.com/privacy">Privacy policy</a>.</div><div style="font-size:0.9em">You also agree to receive email messages from Korzh.com. This consent may be revoked at any time.</div>')})),e.toDOM()},t.prototype.buildCodePage=function(){var t,e=Object(w.domel)("div");return e.addChild("div",(function(t){return t.html('<div style="font-size:1.2em">We sent a confirmation code to <strong>{{email}}</strong>.</div><div style="font-size:1.2em">Please find it in the email and enter to the text box below</div>')})),e.addClass("kfrm-form").addChild("div",(function(e){t=e,e.addClass("kfrm-fields label-above"),e.addClass("kfrm-break-20")})),this.addInputField(t,{id:"eqAuthCode",name:"code",label:"Confirmation code",required:!0}),e.addChild("div",(function(t){return t.html('<div style="margin-top:20px;font-size:0.9em">NB: Don\'t forget to check your SPAM folder if the message does not arrive within the next 5 minutes, and mark it as "Not Spam" if it\'s found there.</div>')})),e.toDOM().outerHTML},t.prototype.buildSuccessPage=function(){var t=Object(w.domel)("div");return t.addChild("div",(function(t){return t.html('<div style="font-size:1.2em">You have successfully completed the registration process.</div><div style="font-size:1.2em">Please restart your web application to get the key applied.</div>')})),t.toDOM()},t.prototype.buildFailurePage=function(){var t=Object(w.domel)("div");return t.addChild("div",(function(t){return t.html("{{message}}")})),t.toDOM().outerHTML},t.prototype.startPageOnSubmit=function(t){var e=this,n=document.getElementById("eqAuthEmail"),o=document.getElementById("eqAuthName"),i=n.value,r=o.value;return t.disableButtons(),this.http.post(s.equtils.combinePath(Rt,"get-code"),{email:i,name:r,data:{ptag:this.context.backendInfo.type,apptype:this.context.backendInfo.subType}},{dataType:"json"}).then((function(t){if(0!==t.status)throw new Error(t.message);var n=e.dialogSet.openNext({email:i});setTimeout((function(){e.validateForm(n);var t=document.getElementById("eqAuthCode");t&&t.focus()}),200)})).catch((function(e){t.showAlert(e.message,"error",!0),t.enableButtons()})),!1},t.prototype.codePageOnSubmit=function(t){var e=this,n=document.getElementById("eqAuthCode").value;return t.disableButtons(),this.http.post(s.equtils.combinePath(Rt,"get-key"),{token:n,ptag:this.context.backendInfo.type,version:"7.2"},{dataType:"json"}).then((function(t){switch(t.status){case 0:var n=s.equtils.combinePath(e.context.getBaseEndpoint(),"lck");e.http.post(n,{version:"7.2",key:t.key},{dataType:"json"}).then((function(t){return e.dialogSet.openNext()}));break;case 2:e.dialogSet.open(3,{message:'<div style="font-size:1.2em">Your trial license for EasyQuery has expired.</div><div style="font-size:1.2em">Please <a href="https://korzh.com/support">contact us</a> if you want to extend the trial period.</div>'});break;case 3:e.dialogSet.open(3,{message:'<div style="font-size:1.2em">Your purchased license for EasyQuery has expired.</div><div style="font-size:1.2em">You need to <a href="https://korzh.com/account">renew the subscription</a> to get a valid license.</div>'});break;default:throw new Error(t.message)}})).catch((function(e){t.showAlert(e.message,"error",!0),t.enableButtons()})),!1},t}();function Qt(){Lt&&(Lt.style.right="-400px",setTimeout((function(){Lt.parentNode.removeChild(Lt)}),5e3))}s.EqContext.prototype.setLicenseKeyEndpoint=function(t){console.warn("This method is deprecated and will be ignored.\n The main EasyQuery endpoint (set via useEndpoint() function) is used to get the license since version 7.0.\n So, you can simply remove this function call")},s.EqContext.prototype.useEnterprise=function(t){var e=this,n=function(t,n){if(Ct.ck(t),Ct.__kt>1){var o=e.getServices();o.registerDataModelResolver((function(t){return new Pt})),o.registerQueryResolver((function(t){return new It(t.getModel())})),o.registerQueryStorageResolver((function(t){return new Ot.a(t)})),o.registerAggregatesCalculator((function(t){return new Bt.a(t)})),2===Ct.__kt&&(console.warn("EasyQuery.JS is working in the TRIAL MODE!\nPlease order a license (https://korzh.com/eq) to get a proper product key."),function(){(Lt=document.createElement("div")).style.position="fixed",Lt.style.bottom="0",Lt.style.right="-400px",Lt.style.width="400px",Lt.style.height="100px",Lt.style.color="grey",Lt.style.textAlign="center",Lt.style.opacity="0.7",Lt.style.font="bold 1em Trebuchet MS, Tahoma, Verdana, Geneva, Arial, Helvetica, sans-serif",Lt.style.transition="right 3s ease-out";var t=document.createElement("div"),e=document.createElement("span");e.innerText="EasyQuery",e.style.color="#3A94D4",e.style.lineHeight="50px",t.appendChild(e);var n=document.createElement("span");n.innerText="by Korzh.com",n.style.marginLeft="10px",t.appendChild(n),Lt.appendChild(t);var o=document.createElement("div");o.innerText="FOR TRIAL USE ONLY",o.style.fontSize="1.2em",o.style.fontWeight="1000",Lt.appendChild(o),document.body.appendChild(Lt)}(),setTimeout((function(){Lt&&(Lt.style.right="0"),setTimeout(Qt,6e3)}),3e3))}else{if(n)!function(t){var e,n,o,i;switch(t.__kt){case 1:e="EasyQuery trial has expired",n='Your trial period for EasyQuery has expired. \n\tYou can send a request to <a href="https://korzh.com/account">extend your trial</a> or <a href="https://korzh.com/easyquery/licensing">buy a license</a> to get rid of all limitations.',o="Buy a license",i="https://korzh.com/easyquery/licensing";break;case-3:e="No license key for EasyQuery",n='Please <a href="https://korzh.com/easyquery#get-started">register for a trial</a> \n\tor <a href="https://korzh.com/easyquery/licensing">purchase a license</a> to get a proper product key. <br />\n\tIf you already have a key, please follow <a href="https://korzh.com/easyquery/docs/getting-started/product-key">this guide</a> to apply it.',o="Register trial",i="https://korzh.com/easyquery#get-started";break;default:e="Invalid key for EasyQuery!",n='The EasyQuery product key is either invalid or was issued for a different version of the library.\n The version you are using now is 7.2,\n\tso please <a href="https://korzh.com/account">login to your account</a> to get a proper key for version 7.2.',o="Get key",i="https://korzh.com/account"}var r=(new w.DefaultDialogService).open({closable:!1,cancelable:!1,submitable:!1,title:e,body:n}).getRootElement().querySelector("footer");Object(w.domel)(r).removeClass("align-right").setStyle("justify-content","center").addChild("button",(function(t){return t.addClass("kfrm-button","is-info").addText(o).on("click",(function(t){window.location.href=i}))})),1==t.__kt&&Object(w.domel)(r).addChild("button",(function(t){return t.addClass("kfrm-button").addText("Extend trial").on("click",(function(t){window.location.href="https://korzh.com/account"}))}))}(Ct);else new Ft(e).show()}};if("string"==typeof t)n(t,!0);else{if("function"!=typeof t)throw new Error("Wrong type of 'keyOrInitCallback' parameter. It must be a string with a license key or a callback function.");var o=this.getServices().getHttpClient(),i=s.equtils.combinePath(this.getBaseEndpoint(),"lck2");o.get(i).then((function(o){n(o.key.split("").reverse().join(""),!1),e.useBackend({type:o.backendType,subType:o.appType}),t()})).catch((function(r){i=s.equtils.combinePath(e.getBaseEndpoint(),"lck"),o.get(i).then((function(e){n(e.split("").reverse().join(""),!1),t()})).catch((function(t){return e.throwError({action:"LCK",sourceError:t})}))}))}};var jt=n(109),qt={core:g,ui:w};window.easydata=qt}]);
11
11
  //# sourceMappingURL=eq.enterprise.min.js.map