@wavemaker/app-runtime-wm-build 11.3.4-rc.5323 → 11.3.4-rc.5326

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.
@@ -517,7 +517,7 @@ var c=function(e,t){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Arr
517
517
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
518
518
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
519
519
  PERFORMANCE OF THIS SOFTWARE.
520
- ***************************************************************************** */var f=function(e,t){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function g(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}f(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function v(e,t,n,i){return new(n||(n=Promise))((function(o,a){function r(e){try{l(i.next(e))}catch(e){a(e)}}function s(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}))}function y(e,t){var n,i,o,a,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],i=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}Object.create;function b(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,a=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return r}function w(e,t,n){if(n||2===arguments.length)for(var i,o=0,a=t.length;o<a;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var P=function(){r.register("wm-table",new Map([["boundarylinks",Object.assign({value:!1},r.PROP_BOOLEAN)],["class",r.PROP_STRING],["confirmdelete",Object.assign({value:"Are you sure you want to delete this?"},r.PROP_STRING)],["datasource",r.PROP_STRING],["dataset",r.PROP_ANY],["deletecanceltext",r.PROP_STRING],["deleteoktext",r.PROP_STRING],["deletemessage",Object.assign({value:"Record deleted successfully"},r.PROP_STRING)],["directionlinks",Object.assign({value:!0},r.PROP_BOOLEAN)],["editmode",r.PROP_STRING],["errorstyle",Object.assign({value:"hover"},r.PROP_STRING)],["enablecolumnselection",Object.assign({value:!1},r.PROP_BOOLEAN)],["enablesort",Object.assign({value:!0},r.PROP_BOOLEAN)],["errormessage",r.PROP_STRING],["exportformat",r.PROP_STRING],["exportdatasize",Object.assign({value:100},r.PROP_NUMBER)],["filtermode",r.PROP_STRING],["filternullrecords",Object.assign({value:!0},r.PROP_BOOLEAN)],["forceellipses",Object.assign({value:!0},r.PROP_BOOLEAN)],["formposition",r.PROP_STRING],["gridclass",Object.assign({value:"table-hover"},r.PROP_STRING)],["gridfirstrowselect",r.PROP_BOOLEAN],["iconclass",r.PROP_STRING],["insertmessage",Object.assign({value:"Record added successfully"},r.PROP_STRING)],["isdynamictable",r.PROP_BOOLEAN],["isrowexpansionenabled",r.PROP_BOOLEAN],["loadingdatamsg",Object.assign({value:"Loading..."},r.PROP_STRING)],["loadingicon",Object.assign({value:"fa fa-circle-o-notch fa-spin"},r.PROP_STRING)],["maxsize",Object.assign({value:5},r.PROP_NUMBER)],["multiselect",r.PROP_BOOLEAN],["name",r.PROP_STRING],["navigation",Object.assign({value:"Basic"},r.PROP_STRING)],["navigationalign",Object.assign({value:"left"},r.PROP_STRING)],["nodatamessage",Object.assign({value:"No data found."},r.PROP_STRING)],["ondemandmessage",Object.assign({value:"Load More"},r.PROP_STRING)],["pagesize",r.PROP_NUMBER],["radioselect",r.PROP_BOOLEAN],["rowclass",r.PROP_STRING],["rowngclass",r.PROP_STRING],["searchlabel",Object.assign({value:"Search"},r.PROP_STRING)],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["showheader",Object.assign({value:!0},r.PROP_BOOLEAN)],["shownewrow",Object.assign({value:!0},r.PROP_BOOLEAN)],["showrecordcount",r.PROP_BOOLEAN],["showrowindex",r.PROP_BOOLEAN],["spacing",Object.assign({value:"normal"},r.PROP_STRING)],["statehandler",Object.assign({value:"none"},r.PROP_STRING)],["subheading",r.PROP_STRING],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["title",r.PROP_STRING],["updatemessage",Object.assign({value:"Record updated successfully"},r.PROP_STRING)]]))},O={widgetType:"wm-table",hostClass:"app-grid app-panel panel"},E={EXCEL:"fa fa-file-excel-o",CSV:"fa fa-file-text-o"},R="rowOperations",A=function(){},T=function(e){var t=!1;[".dropdown-menu",".uib-typeahead-match",".modal-dialog",".toast"].forEach((function(n){if(e.closest(n).length)return t=!0,!1}));return t||["bsdatepickerdaydecorator"].forEach((function(n){if(e[0].hasAttribute(n))return t=!0,!1})),t},S=function(e){function t(t,n,i,o,a,s,l,c,p,d,f,g,v){var y=e.call(this,t,O)||this;return y.inj=t,y.fb=n,y.app=i,y.dynamicComponentProvider=o,y.statePersistence=a,y.paginationService=s,y.viewport=l,y.parentList=c,y.binddataset=p,y.binddatasource=d,y.readonlygrid=f,y.ngZone=g,y.trustAsPipe=v,y.rowActionsCompiledTl={},y.rowFilterCompliedTl={},y.inlineCompliedTl={},y.inlineNewCompliedTl={},y.customExprCompiledTl={},y.customExprCompiledSummaryTl={},y.rowDefInstances={},y.rowDefMap={},y.rowExpansionActionTl={},y.columns={},y.formfields={},y.enablesort=!0,y.primaryKey=[],y.selectedItems=[],y.selectedItemChange=new h.Subject,y.selectedItemChange$=y.selectedItemChange.asObservable(),y.actions=[],y._actions={header:[],footer:[]},y.exportOptions=[],y.headerConfig=[],y.items=[],y.rowActions=[],y.shownavigation=!1,y.documentClickBind=A,y.prevFilterExpression=[],y.fieldDefs=[],y.rowDef={},y.rowInstance={},y.fullFieldDefs=[],y.variableInflight=!0,y.applyProps=new Map,y.redraw=_.debounce(y._redraw,150),y.debouncedHandleLoading=_.debounce(y.handleLoading,350),y.rowFilter={},y._searchSortHandler=A,y.searchSortHandler=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];y._searchSortHandler.apply(y,e)},y.onRowFilterChange=A,y.onFilterConditionSelect=A,y.showClearIcon=A,y.clearRowFilter=A,y.adjustContainer=A,y._pageLoad=!0,y.gridOptions={data:[],colDefs:[],startRowIndex:1,sortInfo:{field:"",direction:""},filtermode:"",searchLabel:"",rowActions:[],headerConfig:[],rowClass:"",editmode:"",formPosition:"",isMobile:!1,rowExpansionEnabled:!1,rowDef:{position:"0"},name:"",messages:{selectField:"Select Field"},securityUtils:{pipeTransform:{}},navigation:"",isdynamictable:"",deletedRowIndex:-1,lastActionPerformed:"scroll",isSearchTrigerred:!1,isDatasetUpdated:!1,isDataUpdatedByUser:!1,isNextPageData:void 0,ACTIONS:{DELETE:"delete",EDIT:"edit",SEARCH_OR_SORT:"search_or_sort",DEFAULT:"scroll",FILTER_CRITERIA:"filter",DATASET_UPDATE:"dataset_update"},actionRowIndex:void 0,actionRowPage:void 0,isLastPage:!1,getCurrentPage:function(){return _.get(y.dataNavigator,"dn.currentPage")||1},setCurrentPage:function(e){_.set(y.dataNavigator,"dn.currentPage",e||1)},getDataSource:function(){return y.datasource},getPageSize:function(){return y.pagesize},setDeletedRowIndex:function(e){y.setDataGridOption("deletedRowIndex",e)},setLastActionPerformed:function(e){y.setDataGridOption("lastActionPerformed",e||y.gridOptions.lastActionPerformed)},isNavTypeScrollOrOndemand:function(){return"Scroll"===y.gridOptions.navigation||"On-Demand"===y.gridOptions.navigation},setIsSearchTrigerred:function(e){y.setDataGridOption("isSearchTrigerred",e)},setIsDatasetUpdated:function(e){y.setDataGridOption("isDatasetUpdated",e)},setIsNextPageData:function(e){y.setDataGridOption("isNextPageData",e)},setIsDataUpdatedByUser:function(e){y.setDataGridOption("isDataUpdatedByUser",e)},onDataRender:function(){y.ngZone.run((function(){y.gridData.length&&y.invokeEventCallback("datarender",{$data:y.gridData,data:y.gridData}),y.multiselect||(y.items.length=0),y.callDataGridMethod("selectRows",y.items),y.selectedItems=y.callDataGridMethod("getSelectedRows"),y.selectedItemChange.next(y.selectedItems),y._isPageSearch&&y.filterInfo&&y.searchSortHandler(y.filterInfo,void 0,"search")}))},onRowSelect:function(e,t){y.ngZone.run((function(){y.selectedItems=y.callDataGridMethod("getSelectedRows"),y.selectedItemChange.next(y.selectedItems);var n=y.addRowIndex(e);if(n.$index&&"none"!==y.getConfiguredState()&&y.dataNavigator&&r.unsupportedStatePersistenceTypes.indexOf(y.navigation)<0){var i={page:y.dataNavigator.dn.currentPage,index:n.$index-1},o=y.statePersistence.getWidgetState(y);_.get(o,"selectedItem")&&y.multiselect?(_.some(o.selectedItem,i)||o.selectedItem.push(i),y.statePersistence.setWidgetState(y,{selectedItem:o.selectedItem})):y.statePersistence.setWidgetState(y,{selectedItem:[i]})}else console.warn("Retain State handling on Widget "+y.name+" is not supported for current pagination type.");y.invokeEventCallback("rowselect",{$data:n,$event:t,row:n})}))},assignSelectedItems:function(e,t){y.ngZone.run((function(){y.multiselect?-1===_.findIndex(y.items,e)&&y.items.push(e):(y.items.length=0,y.items.push(e))}))},onRowDblClick:function(e,t){var n=y.addRowIndex(e);y.invokeEventCallback("rowdblclick",{$data:n,$event:t,row:n})},onRowDeselect:function(e,t){y.multiselect&&y.ngZone.run((function(){y.items=_.pullAllWith(y.items,[e],_.isEqual),y.selectedItems=y.callDataGridMethod("getSelectedRows"),y.invokeEventCallback("rowdeselect",{$data:e,$event:t,row:e});var n=y.addRowIndex(e);if("none"!==y.getConfiguredState()&&r.unsupportedStatePersistenceTypes.indexOf(y.navigation)<0){var i={page:y.dataNavigator.dn.currentPage,index:n.$index-1},o=y.statePersistence.getWidgetState(y);_.get(o,"selectedItem")&&(_.remove(o.selectedItem,(function(e){return _.isEqual(e,i)})),y.statePersistence.removeWidgetState(y,"selectedItem"),o.selectedItem.length>0&&y.statePersistence.setWidgetState(y,{selectedItem:o.selectedItem}))}else console.warn("Retain State handling on Widget "+y.name+" is not supported for current pagination type.")}))},callOnRowDeselectEvent:function(e,t){y.items=y.selectedItems=y.callDataGridMethod("getSelectedRows"),y.invokeEventCallback("rowdeselect",{$data:e,$event:t,row:e})},callOnRowClickEvent:function(e,t){y.ngZone.run((function(){if(t&&t.hasOwnProperty("originalEvent")){var n=y.addRowIndex(e);y.invokeEventCallback("rowclick",{$data:n,$event:t,row:n})}}))},closePopover:u.closePopover,onColumnSelect:function(e,t){y.selectedColumns=y.callDataGridMethod("getSelectedColumns"),y.invokeEventCallback("columnselect",{$data:e,$event:t})},onColumnDeselect:function(e,t){y.selectedColumns=y.callDataGridMethod("getSelectedColumns"),y.invokeEventCallback("columndeselect",{$data:e,$event:t})},onHeaderClick:function(e,t){y.invokeEventCallback("headerclick",{$event:t,$data:e,column:e})},onRowDelete:function(e,t,n,i,o){y.ngZone.run((function(){y.deleteRecord(_.extend({},o,{row:e,cancelRowDeleteCallback:t,evt:n,callBack:i}))}))},onRowInsert:function(e,t,n,i){y.insertRecord(_.extend({},i,{row:e,event:t,callBack:n}))},beforeRowUpdate:function(e,t){y._liveTableParent&&y._liveTableParent.updateRow(e,t),y.prevData=u.getClonedObject(e)},afterRowUpdate:function(e,t,n,i){y.updateRecord(_.extend({},i,{row:e,prevData:y.prevData,event:t,callBack:n}))},onBeforeRowUpdate:function(e,t,n){return y.invokeEventCallback("beforerowupdate",{$event:t,$data:e,row:e,options:n})},onBeforeRowInsert:function(e,t,n){return y.invokeEventCallback("beforerowinsert",{$event:t,$data:e,row:e,options:n})},onBeforeRowDelete:function(e,t,n){var i=y.addRowIndex(e);return y.invokeEventCallback("beforerowdelete",{$event:t,row:i,options:n})},onFormRender:function(e,t,n,i){var o=i?"inlineInstanceNew":"inlineInstance";setTimeout((function(){y.formWidgets={},y.fieldDefs.forEach((function(e){e[o]&&(y.formWidgets[e.field]=e[o],e[o].context&&(e[o].context.formWidgets=y.formWidgets),y.setDisabledOnField(n,e,o))})),y.invokeEventCallback("formrender",{$event:t,formWidgets:y.formWidgets,$operation:n})}),250)},onBeforeFormRender:function(e,t,n){return y.invokeEventCallback("beforeformrender",{$event:t,row:e,$operation:n})},registerRowNgClassWatcher:function(e,t){if(y.rowngclass){var n=y.getClonedRowObject(e),i=y.widgetId+"_rowNgClass_"+t;u.$unwatch(i),y.registerDestroyListener(u.$watch(y.rowngclass,y.viewParent,{row:n},(function(e,n){y.callDataGridMethod("applyRowNgClass",r.getConditionalClasses(e,n),t)}),i))}},registerColNgClassWatcher:function(e,t,n,i){if(t["col-ng-class"]){var o=y.getClonedRowObject(e),a=y.widgetId+"_colNgClass_"+n+"_"+i;u.$unwatch(a),y.registerDestroyListener(u.$watch(t["col-ng-class"],y.viewParent,{row:o},(function(e,t){y.callDataGridMethod("applyColNgClass",r.getConditionalClasses(e,t),n,i)}),a))}},clearCustomExpression:function(){y.customExprViewRef.clear(),y.customExprCompiledTl={},y.customExprCompiledSummaryTl={}},clearRowDetailExpression:function(){y.rowDetailViewRef.clear(),y.rowDefMap={},y.rowDefInstances={}},generateCustomExpressions:function(e,t,n){var i=y.getClonedRowObject(e),o=function(e){if(e){var o={},a={row:i,colDef:o};y.addEventsToContext(a);var r=y.customExprViewRef.createEmbeddedView(e,a).rootNodes[0],s=r.getAttribute("data-col-identifier");_.extend(o,y.columns[s]),n?y.customExprCompiledSummaryTl[s+t]=r:y.customExprCompiledTl[s+t]=r}};y.isdynamictable?y.fieldDefs.forEach((function(e){o(e.customExprTmpl)})):y.customExprTmpl.forEach(o.bind(y))},generateRowExpansionCell:function(e,t){var n=y.getClonedRowObject(e);y.rowExpansionActionTmpl.forEach((function(e){y.rowExpansionActionTl[t]=y.rowExpansionActionViewRef.createEmbeddedView(e,{row:n}).rootNodes}))},getRowExpansionAction:function(e){return y.rowExpansionActionTl[e]},generateRowDetailView:function(e,t,n,i,o,a){var r=y.getClonedRowObject(t),s=u.getClonedObject(y.rowDef);if(!1!==y.rowInstance.invokeEventCallback("beforerowexpand",{$event:e,$data:s,row:r})&&s.content)if(a(),y.rowDefMap[n]&&y.rowDefMap[n].content===s.content)y.rowInstance.invokeEventCallback("rowexpand",{$event:e,row:r,$data:y.rowDefInstances[n]});else{y.rowDefMap[n]=s,i.empty(),i.hide(),o.show();var l={row:r,rowDef:s,containerLoad:function(t){setTimeout((function(){o.hide(),i.show(),y.rowDefInstances[n]=t,y.rowInstance.invokeEventCallback("rowexpand",{$event:e,row:r,$data:t})}),500)}},c=y.rowDetailViewRef.createEmbeddedView(y.rowExpansionTmpl,l).rootNodes[0];i[0].appendChild(c),u.$appDigest()}},onBeforeRowCollapse:function(e,t,n){return y.rowInstance.invokeEventCallback("beforerowcollapse",{$event:e,row:t,$data:y.rowDefInstances[n]})},onRowCollapse:function(e,t){y.rowInstance.invokeEventCallback("rowcollapse",{$event:e,row:t})},getCustomExpression:function(e,t,n){return(n?y.customExprCompiledSummaryTl[e+t]:y.customExprCompiledTl[e+t])||""},clearRowActions:function(){y.rowActionsViewRef.clear(),y.rowActionsCompiledTl={},y.rowExpansionActionViewRef.clear(),y.rowExpansionActionTl={}},generateRowActions:function(e,t){var n=y.getClonedRowObject(e);y.rowActionsCompiledTl[t]=[],y.rowActionTmpl.forEach((function(e){var i;(i=y.rowActionsCompiledTl[t]).push.apply(i,w([],b(y.rowActionsViewRef.createEmbeddedView(e,{row:n}).rootNodes)))}))},getRowAction:function(e){return y.rowActionsCompiledTl[e]},generateInlineEditRow:function(e,t){var n=y.getClonedRowObject(e);if(t)return y.inlineEditNewViewRef.clear(),y.inlineNewCompliedTl={},y.inlineWidgetNewTmpl.forEach((function(e){var t,i={row:n,getControl:function(){return y.ngform.controls[t+"_new"]||{}},getValidationMessage:function(){return y.columns[t]&&y.columns[t].validationmessage},getPendingSpinnerStatusNew:function(){return y.columns[t]&&y.columns[t].showPendingSpinnerNew}},o=y.inlineEditNewViewRef.createEmbeddedView(e,i).rootNodes[0];t=o.getAttribute("data-col-identifier"),y.inlineNewCompliedTl[t]=o})),void y.clearForm(!0);y.inlineEditViewRef.clear(),y.inlineCompliedTl={},y.clearForm(),y.inlineWidgetTmpl.forEach((function(e){var t,i={row:n,getControl:function(){return y.ngform.controls[t]||{}},getValidationMessage:function(){return y.columns[t]&&y.columns[t].validationmessage},getPendingSpinnerStatus:function(){return y.columns[t]&&y.columns[t].showPendingSpinner}},o=y.inlineEditViewRef.createEmbeddedView(e,i).rootNodes[0];t=o.getAttribute("data-col-identifier"),y.inlineCompliedTl[t]=o}))},getInlineEditWidget:function(e,t,n){return n?(y.gridOptions.setFieldValue(e+"_new",t),y.inlineNewCompliedTl[e]):(y.gridOptions.setFieldValue(e,t),y.inlineCompliedTl[e])},setFieldValue:function(e,t){var n=y.ngform.controls&&y.ngform.controls[e];n&&n.setValue(t)},getFieldValue:function(e){var t=y.ngform.controls&&y.ngform.controls[e];return t&&t.value},addLoadMoreBtn:function(){y.callDataGridMethod("addLoadMoreBtn",y.ondemandmessage,y.loadingdatamsg,(function(e){y.gridOptions.setIsNextPageData(!0),y.gridOptions.setIsDataUpdatedByUser(!1),y.dataNavigator.navigatePage("next",e),y.isDataLoading=!0}))},bindScrollEvt:function(){y._gridData&&y._gridData.length&&y.infScroll&&setTimeout((function(){y.paginationService.bindScrollEvt(y,"tbody",r.DEBOUNCE_TIMES.PAGINATION_DEBOUNCE_TIME)}),0)},generateFilterRow:function(){y.filterViewRef.clear(),y.rowFilterCompliedTl={},y.filterTmpl.forEach((function(e){var t=y.filterViewRef.createEmbeddedView(e,{changeFn:y.onRowFilterChange.bind(y),isDisabled:function(e){return y.emptyMatchModes.indexOf(y.rowFilter[e]&&y.rowFilter[e].matchMode)>-1}}).rootNodes[0];y.rowFilterCompliedTl[t.getAttribute("data-col-identifier")]=t}))},getFilterWidget:function(e){return y.rowFilterCompliedTl[e]},setGridEditMode:function(e){y.ngZone.run((function(){y.isGridEditMode=e,u.$appDigest()}))},setGridState:function(e){y.isLoading="loading"===e},setActionRowIndex:function(e){y.gridOptions.isNavTypeScrollOrOndemand()&&(y.actionRowIndex=parseInt(e),y.setDataGridOption("actionRowIndex",y.actionRowIndex),_.isNaN(y.actionRowIndex)||(y.actionRowPage=Math.floor(y.actionRowIndex/y.pagesize)+1,y.setDataGridOption("actionRowPage",y.actionRowPage||y.gridOptions.actionRowPage)))},clearActionRowIndex:function(){y.isRowDeleted||!y.infScroll&&!y.onDemandLoad||y.clearActionRowVars()},noChangesDetected:function(){y.toggleMessage(!0,"info","No Changes Detected","")},redrawWidgets:function(){y.fieldDefs.forEach((function(e){u.triggerFn(e.inlineInstance&&e.inlineInstance.redraw),u.triggerFn(e.inlineInstanceNew&&e.inlineInstanceNew.redraw),u.triggerFn(e.filterInstance&&e.filterInstance.redraw)}))},searchHandler:y.searchSortHandler.bind(y),sortHandler:y.searchSortHandler.bind(y),timeoutCall:function(e,t){setTimeout(e,t)},runInNgZone:function(e){y.ngZone.run(e)},safeApply:function(){u.$appDigest()},setTouched:function(e){var t=y.ngform.controls[e];t&&t.markAsTouched()},clearForm:y.clearForm.bind(y),callLoadInlineWidgetData:function(){y.fullFieldDefs.forEach((function(e){_.isUndefined(e.isDataSetBound)&&u.triggerFn(e.loadInlineWidgetData&&e.loadInlineWidgetData.bind(e))}))},applyValidations:function(e,t){t?u.triggerFn(e.applyNewRowValidations&&e.applyNewRowValidations.bind(e)):u.triggerFn(e.applyValidations&&e.applyValidations.bind(e))},removeValidations:function(e){y.fullFieldDefs.forEach((function(t){t.readonly||"rowOperations"===t.binding||(e?u.triggerFn(t.removeNewRowValidations&&t.removeNewRowValidations.bind(t)):u.triggerFn(t.removeValidations&&t.removeValidations.bind(t)))}))}},y._selectedItemsExist=!1,y._onChange=function(){},y._onTouched=function(){},r.styler(y.nativeElement,y),y.ngform=n.group({}),y.addEventsToContext(y.context),[y.app.subscribe("check-state-persistence-options",(function(e){var t=_.get(y.datasource,"name");if(t||(t=r.extractDataSourceName(y.binddatasource)),_.get(e,"variable.name")===t&&y._pageLoad&&"none"!==y.getConfiguredState()){y._pageLoad=!1;var n=y.statePersistence.getWidgetState(y);n?e=y.handleStateParams(n,e):y.setDataGridOption("selectFirstRow",y.gridfirstrowselect)}})),y.app.subscribe("toggle-variable-state",(function(e){if(y.datasource&&y.datasource.execute(u.DataSource.Operation.IS_API_AWARE)&&u.isDataSourceEqual(e.variable,y.datasource)){if(y._pageLoad&&"none"!==y.getConfiguredState()){y._pageLoad=!1;var t=y.statePersistence.getWidgetState(y);t?e=y.handleStateParams(t,e):y.setDataGridOption("selectFirstRow",y.gridfirstrowselect)}u.isDefined(y.variableInflight)?y.debouncedHandleLoading(e):y.handleLoading(e)}})),y.app.subscribe("setup-cud-listener",(function(e){y.name===e&&(y._isDependent=!0,y.selectedItemChange$.pipe(m.debounceTime(250)).subscribe(y.triggerWMEvent.bind(y)))}))].forEach((function(e){return y.registerDestroyListener(e)})),y.deleteoktext=y.appLocale.LABEL_OK,y.deletecanceltext=y.appLocale.LABEL_CANCEL,y}return g(t,e),Object.defineProperty(t.prototype,"gridData",{get:function(){return this._gridData||[]},set:function(e){var t;if(this.isDataLoading=!1,!this.variableInflight||!_.isEmpty(e)){if(this.variableInflight=!1,this.gridOptions.isNavTypeScrollOrOndemand()){if(t=b(this.paginationService.updateFieldsOnPagination(this,e),2),this._gridData=t[0],this.currentPage=t[1],this.gridOptions.lastActionPerformed===this.gridOptions.ACTIONS.EDIT){var n=_.floor(this.actionRowIndex%this.pagesize);this._gridData.splice(this.actionRowIndex,1,e[n])}this.setDataGridOption("isLastPage",!!this.dataNavigator.isDisableNext),this.$element.find(".on-demand-datagrid").length||this.dataNavigator.isDisableNext||!this.onDemandLoad?this._gridData&&this._gridData.length&&(this.dataNavigator.isDisableNext||!this.isDataLoading)&&this.callDataGridMethod("hideLoadingIndicator",this.dataNavigator.isDisableNext,this.infScroll):this.gridOptions.addLoadMoreBtn()}else this._gridData=e;var i,o=0;if(this._onChange(this._gridData),this._onTouched(),u.isDefined(e)){if(this.gridOptions.bindScrollEvt(),this.isNavigationEnabled()&&this.dataNavigator.dn.currentPage&&(o=(this.dataNavigator.dn.currentPage-1)*(this.dataNavigator.maxResults||1)+1,this.setDataGridOption("startRowIndex",o)),!(i=this.callDataGridMethod("getOptions")))return;!i.colDefs.length&&this.fieldDefs.length&&this.setDataGridOption("colDefs",u.getClonedObject(this.fieldDefs)),this.isdynamictable||_.isEmpty(e)||!i.colDefs.length||this.invokeEventCallback("beforedatarender",{$data:this._gridData,$columns:this.columns,data:this._gridData,columns:this.columns}),this.setDataGridOption("data",u.getClonedObject(this._gridData))}}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selecteditem",{get:function(){return this.multiselect?u.getClonedObject(this.items):_.isEmpty(this.items)?{}:u.getClonedObject(this.items[0])},set:function(e){this.items.length=0,this.callDataGridMethod("selectRows",e)},enumerable:!1,configurable:!0}),t.prototype.onKeyPress=function(e){13===e.which&&this.invokeEventCallback("enterkeypress",{$event:e,$data:this.gridData})},t.prototype.ngAfterContentInit=function(){var t=this;e.prototype.ngAfterContentInit.call(this),this.headerConfig=this.headerConfig.filter(this.filterEmptyValues.bind(this)),_.remove(this.fieldDefs,(function(e){return void 0===e}));this._liveTableParent&&(this.isPartOfLiveGrid=!0),!this.readonlygrid&&this.editmode||("true"===this.readonlygrid?this.editmode="":this.isPartOfLiveGrid?this.editmode="inline"===this.isPartOfLiveGrid.formlayout?r.EDIT_MODE.FORM:r.EDIT_MODE.DIALOG:this.editmode=this.readonlygrid?r.EDIT_MODE.INLINE:""),this.gridOptions.colDefs=this.fullFieldDefs,this.gridOptions.rowActions=this.rowActions,this.gridOptions.headerConfig=this.headerConfig,this.gridOptions.rowClass=this.rowclass,this.gridOptions.editmode=this.editmode,this.gridOptions.formPosition=this.formposition,this.gridOptions.filtermode=this.filtermode,this.gridOptions.searchLabel=this.searchlabel,this.gridOptions.isMobile=u.isMobile(),this.gridOptions.name=this.name,this.gridOptions.securityUtils.pipeTransform=this.trustAsPipe,this.gridOptions.navigation=this.navigation,this.gridOptions.isdynamictable=this.isdynamictable,_.isEmpty(this.gridData)||(this.gridOptions.data=u.getClonedObject(this.gridData)),this.gridOptions.messages={selectField:this.appLocale.MESSAGE_SELECT_FIELD},this.datagridElement=$(this._tableElement.nativeElement),this.gridElement=this.$element,this.$element.css({position:"relative"}),_.forEach({showrowindex:"showRowIndex",multiselect:"multiselect",radioselect:"showRadioColumn",filternullrecords:"filterNullRecords",enablesort:"enableSort",showheader:"showHeader",enablecolumnselection:"enableColumnSelection",shownewrow:"showNewRow",gridfirstrowselect:"selectFirstRow"},(function(e,n){u.isDefined(t[n])&&(t.gridOptions[e]="true"===t[n]||!0===t[n])})),"none"!==this.statehandler&&(this.gridOptions.selectFirstRow=!1),this.renderOperationColumns(),this.gridOptions.colDefs=this.fieldDefs,this.datagridElement.datatable(this.gridOptions),this.callDataGridMethod("setStatus","loading",this.loadingdatamsg),this.applyProps.forEach((function(e){return t.callDataGridMethod.apply(t,w([],b(e)))})),this.editmode===r.EDIT_MODE.QUICK_EDIT&&(this.documentClickBind=this._documentClickBind.bind(this),document.addEventListener("click",this.documentClickBind))},t.prototype.getConfiguredState=function(){var e=this.statePersistence.computeMode(this.statehandler);return e&&e.toLowerCase()},t.prototype.handleStateParams=function(e,t){var n=this;return _.get(e,"selectedItem")&&(this._selectedItemsExist=!0),t.options=t.options||{},_.get(e,"pagination")?(t.options.page=e.pagination,_.get(e,"sort")&&(this.sortStateHandler(e),t.options.orderBy=_.get(e,"sort.field")+" "+_.get(e,"sort.direction")),_.get(e,"search")&&(setTimeout((function(){n.searchStateHandler(e)}),500),t.options.filterFields=this.getFilterFields(e.search))):(t.options.page=1,_.get(e,"search")&&(setTimeout((function(){n.searchStateHandler(e)}),500),t.options.filterFields=this.getFilterFields(e.search)),_.get(e,"sort")&&(this.sortStateHandler(e),t.options.orderBy=_.get(e,"sort.field")+" "+_.get(e,"sort.direction"))),t},t.prototype.triggerWMEvent=function(e){"dialog"!==this.editmode&&(u.$invokeWatchers(!0),this.app.notify("wm-event",{eventName:"selectedItemChange",widgetName:this.name,row:e,table:this}))},t.prototype.sortStateHandler=function(e){var t=this.datagridElement.find('th[data-col-field="'+_.get(e,"sort.field")+'"] .sort-icon');"asc"===_.get(e,"sort.direction")&&t.length?t.addClass("asc wi wi-long-arrow-up"):"desc"===_.get(e,"sort.direction")&&t.length&&t.addClass("desc wi wi-long-arrow-down")},t.prototype.searchStateHandler=function(e){var t=this;if(_.isArray(e.search))_.forEach(e.search,(function(e){if(t.rowFilter[e.field]&&(t.rowFilter[e.field].value=e.value,t.rowFilter[e.field].matchMode=e.matchMode,t.rowFilter[e.field].type=e.type,$(t.rowFilterCompliedTl[e.field]).length)){"integer"===e.type?parseInt(e.value):e.value;$(t.rowFilterCompliedTl[e.field]).find("input").val(e.value)}}));else{var n=this.datagridElement;n.find('[data-element="dgSearchText"]').val(e.search.value),n.find('[data-element="dgFilterValue"]').val(e.search.field)}},t.prototype.filterEmptyValues=function(e){return e.columns&&(e.columns=e.columns.filter(this.filterEmptyValues.bind(this))),void 0!==e},t.prototype.compareFilterExpressions=function(e,t){return!(e.length!==t.length||!_.isEqual(e,t))},t.prototype.setLastActionToFilterCriteria=function(){this.prevFilterExpression=_.get(this.datasource,"filterExpressions.rules")?u.getClonedObject(this.datasource.filterExpressions.rules):u.getClonedObject([].concat(this.datasource.dataBinding)),this.gridOptions.setLastActionPerformed(this.gridOptions.ACTIONS.FILTER_CRITERIA),this.gridOptions.setIsSearchTrigerred(!0)},t.prototype.setLastActionToDatasetUpdate=function(){this.gridOptions.setLastActionPerformed(this.gridOptions.ACTIONS.DATASET_UPDATE),this.gridOptions.setCurrentPage(1),this.gridOptions.setIsDatasetUpdated(!0)},t.prototype.checkIfVarFiltersApplied=function(){if(!_.isEmpty(_.get(this.datasource,"filterExpressions.rules"))||!_.isEmpty(_.get(this.datasource,"dataBinding"))){var e=_.get(this.datasource,"filterExpressions.rules")?this.datasource.filterExpressions.rules:[].concat(this.datasource.dataBinding);this.compareFilterExpressions(this.prevFilterExpression,e)||this.setLastActionToFilterCriteria()}},t.prototype.watchVariableDataSet=function(e){var t;if(this.gridOptions.isNavTypeScrollOrOndemand()&&this.checkIfVarFiltersApplied(),"wm.Variable"===_.get(this.datasource,"category")&&this._pageLoad&&"none"!==this.getConfiguredState()){var n=this.statePersistence.getWidgetState(this);this._pageLoad=!1,_.get(n,"selectedItem")?this._selectedItemsExist=!0:this.setDataGridOption("selectFirstRow",this.gridfirstrowselect),_.get(n,"search")&&(this.searchStateHandler(n),this.searchSortHandler(n.search,void 0,"search",!0)),_.get(n,"sort")&&(this.searchSortHandler(n.sort,void 0,"sort",!0),this.sortStateHandler(n)),_.get(n,"pagination")&&this.dataNavigator.pageChanged({page:n.pagination},!0)}if(!(this.dataNavigatorWatched&&_.isUndefined(e)&&this.__fullData)){this.variableInflight&&!this.infScroll&&this.callDataGridMethod("setStatus","loading",this.loadingdatamsg),(t=u.getValidJSON(e))&&(e=t);var i=this.getSortExpr(),o=i.split(" ");if(i&&o.length&&(this.sortInfo={direction:o[1],field:o[0]}),this.isDataValid()){if(e){if(this.shownavigation&&!this.dataNavigatorWatched)return void this.enablePageNavigation()}else this.resetPageNavigation(),this.variableInflight||this.callDataGridMethod("setStatus","nodata",this.nodatamessage),this.setDataGridOption("selectFirstRow",this.gridfirstrowselect);!this.isNavigationEnabled()&&e&&this.checkFiltersApplied(this.getSortExpr()),!_.isObject(e)||""===e||e&&""===e.dataValue?this.variableInflight||this.setGridData([]):e&&this.populateGridData(e)}}},t.prototype.ngOnDestroy=function(){document.removeEventListener("click",this.documentClickBind),this.navigatorResultWatch&&this.navigatorResultWatch.unsubscribe(),this.navigatorMaxResultWatch&&this.navigatorMaxResultWatch.unsubscribe(),e.prototype.ngOnDestroy.call(this)},t.prototype.addRowIndex=function(e){var t=u.getClonedObject(e),n=_.indexOf(this.gridOptions.data,e);return n<0?e:(t.$index=n+1,t.$isFirst=1===t.$index,t.$isLast=this.gridData.length===t.$index,t)},t.prototype.addEventsToContext=function(e){var t=this;e.addNewRow=function(){return t.addNewRow()},e.deleteRow=function(){return t.deleteRow()},e.editRow=function(){return t.editRow()}},t.prototype.execute=function(e,t){return![u.DataSource.Operation.IS_API_AWARE,u.DataSource.Operation.IS_PAGEABLE,u.DataSource.Operation.SUPPORTS_SERVER_FILTER].includes(e)&&(this.datasource?this.datasource.execute(e,t):{})},t.prototype.isNavigationEnabled=function(){return this.shownavigation&&this.dataNavigator&&this.dataNavigatorWatched},t.prototype.getClonedRowObject=function(e){var t=u.getClonedObject(e);return t.getProperty=function(e){return _.get(t,e)},t.$isFirst=1===t.$index,t.$isLast=this.gridData.length===t.$index,delete t.$$index,delete t.$$pk,t},t.prototype.handleLoading=function(e){this.variableInflight=e.active,e.active?this.callDataGridMethod("setStatus","loading",this.loadingdatamsg):!this.isGridEditMode&&_.isEmpty(this.dataset)?this.callDataGridMethod("setStatus","nodata",this.nodatamessage):this.callDataGridMethod("setStatus","ready")},t.prototype.setDisabledOnField=function(e,t,n){"new"===e||!t["primary-key"]||"assigned"!==t.generator||t["related-entity-name"]||t.period||(t[n].disabled=!0)},t.prototype.resetFormControl=function(e){e.markAsUntouched(),e.markAsPristine()},t.prototype.clearForm=function(e){var t=this,n=this.ngform.controls;_.keys(this.ngform.controls).forEach((function(i){!i.endsWith("_filter")&&(i.endsWith("_new")&&e||!i.endsWith("_new")&&!e)&&(n[i].setValue(""),t.resetFormControl(n[i]))}))},t.prototype.showFieldBasedOnScreenType=function(e){return u.isMobile()&&this.viewport.isMobileType?e.mobileDisplay:this.viewport.isTabletType?e.tabletDisplay:e.pcDisplay},t.prototype.isEmptyRecord=function(e){var t,n=this;return Object.keys(e).every((function(i,o){return t=e[i],!(n.fieldDefs.length&&u.isDefined(n.fieldDefs[o])&&n.showFieldBasedOnScreenType(n.fieldDefs[o])||!0)||(null==t||""===t)}))},t.prototype.removeEmptyRecords=function(e){var t=this,n=e,i=[];return n&&n.length&&(i=n.filter((function(e){return e&&!t.isEmptyRecord(e)}))),i},t.prototype.setGridData=function(e){var t=this.filternullrecords?this.removeEmptyRecords(e):e;"wm.Variable"===_.get(this.datasource,"category")&&(this.variableInflight=!1),this.variableInflight||(t&&0===t.length?this.callDataGridMethod("setStatus","nodata",this.nodatamessage):this.callDataGridMethod("setStatus","ready")),this.gridData=t},t.prototype.setDataGridOption=function(e,t,n){if(void 0===n&&(n=!1),this.datagridElement&&this.datagridElement.datatable&&this.datagridElement.datatable("instance")){var i={};!u.isDefined||_.isEqual(t,this.gridOptions[e])&&!n||(i[e]=t,this.datagridElement.datatable("option",i),this.gridOptions[e]=t)}},t.prototype.callDataGridMethod=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(this.datagridElement&&this.datagridElement.datatable("instance"))return this.datagridElement.datatable.apply(this.datagridElement,e);this.applyProps.set(e[1],e)},t.prototype.renderOperationColumns=function(){var e,t,n=r.getRowOperationsColumn(),i={name:n.field,field:n.field,isPredefined:!0};this.fieldDefs.length&&(e=_.find(this.fullFieldDefs,{field:R,type:"custom"}),_.remove(this.fieldDefs,{type:"custom",field:R}),_.remove(this.headerConfig,{field:n.field}),this.rowActions.length&&(e?(t=e.rowactionsposition?_.toNumber(e.rowactionsposition):this.fieldDefs.length,this.fieldDefs.splice(t,0,e),0===t?this.headerConfig.unshift(i):this.headerConfig.push(i)):(this.fieldDefs.push(n),this.headerConfig.push(i))),this.setDataGridOption("headerConfig",this.headerConfig))},t.prototype.enablePageNavigation=function(){var e=this;this.dataset&&this.binddataset&&this.dataNavigator&&(this.dataNavigatorWatched=!0,this.navigatorResultWatch&&this.navigatorResultWatch.unsubscribe(),this.navigatorResultWatch=this.dataNavigator.resultEmitter.subscribe((function(t){u.isDefined(t)?_.isEqual(e.dataset,t)?e.watchVariableDataSet(t):_.isArray(t)?e.widget.dataset=[].concat(t):_.isObject(t)?e.widget.dataset=_.extend({},t):e.widget.dataset=t:e.widget.dataset=void 0}),!0),this.navigatorMaxResultWatch&&this.navigatorMaxResultWatch.unsubscribe(),this.navigatorMaxResultWatch=this.dataNavigator.maxResultsEmitter.subscribe((function(t){e.pagesize=t})),this.__fullData=this.dataset,this.dataNavigator.widget.maxResults=this.pagesize||5,this.dataNavigator.options={maxResults:this.pagesize||5},this.removePropertyBinding("dataset"),this.dataNavigator.setBindDataSet(this.binddataset,this.viewParent,this.datasource,this.dataset,this.binddatasource,void 0,this.statehandler))},t.prototype.resetPageNavigation=function(){this.dataNavigator&&this.dataNavigator.resetPageNavigation()},t.prototype.isDataValid=function(){var e,t=this.dataset||{};return t.error&&(e=t.error),t.data&&t.data.error&&t.data.errorMessage&&(e=t.data.errorMessage),!e||(this.setGridData([]),this.callDataGridMethod("setStatus","error",e),!1)},t.prototype.populateGridData=function(e){var t,n=this;if(e=r.transformData(e,this.name),!this.isNavigationEnabled()&&this._isClientSearch?(t=u.getClonedObject(e),t=this.getSearchResult(t,this.filterInfo),t=this.getSortResult(t,this.sortInfo),this.serverData=t):this.serverData=e,this.isdynamictable?this.createGridColumns(this.serverData):this.setGridData(this.serverData),"none"!==this.getConfiguredState()&&this._selectedItemsExist&&e.length){var i=this.statePersistence.getWidgetState(this),o=void 0;_.get(i,"selectedItem")&&(o=i.selectedItem.filter((function(e){return e.page===n.dataNavigator.dn.currentPage})),this._selectedItemsExist=!1,o.length&&this.selecteditem.length!==i.selectedItem.length&&(_.isArray(this.selecteditem)?o.forEach((function(e){n.selectItem(e.index,void 0)})):this.selecteditem=o.map((function(e){return e.index}))))}},t.prototype.generateDynamicColumns=function(e){return v(this,void 0,void 0,(function(){var t,n,i,o=this;return y(this,(function(a){switch(a.label){case 0:return this.fieldDefs=[],this.filterTmpl._results=[],_.isEmpty(e)?[2]:(t="",e.forEach((function(e){var n="",i="";_.forEach(e,(function(e,t){_.isUndefined(e)||""===e||("customExpression"===t?i=e:n+=" "+t+'="'+e+'"')})),t+="<wm-table-column "+n+' tableName="'+o.name+o.$attrs.get("table_reference")+'">'+i+"</wm-table-column>"})),this.dynamicTableRef.clear(),this._dynamicContext||(this._dynamicContext=Object.create(this.viewParent),this._dynamicContext[this.getAttr("wmTable")]=this),this.noOfColumns=e.length,[4,this.dynamicComponentProvider.getComponentFactoryRef("app-table-dynamic-"+this.widgetId,t,{noCache:!0,transpile:!0})]);case 1:return n=a.sent(),i=this.dynamicTableRef.createComponent(n,0,this.inj),u.extendProto(i.instance,this._dynamicContext),this.$element.find(".dynamic-table-container")[0].appendChild(i.location.nativeElement),[2]}}))}))},t.prototype.prepareColDefs=function(e){var t,n,i=this,o=0,a=0;this.fieldDefs=[],this.headerConfig=[],this.columns={},n=e,t=r.prepareFieldDefs(n),_.forEach(t,(function(e){e.binding=e.field,e.caption=e.displayName,e.pcDisplay=!0,e.mobileDisplay=!0,e.tabletDisplay=!0,e.searchable=!0,e.showinfilter=!0,e.type="string",e.index=o,e.headerIndex=a,o++,a++})),t.forEach((function(e){i.columns[e.field]=e})),this.invokeEventCallback("beforedatarender",{$data:e,$columns:this.columns,data:e,columns:this.columns}),t=[],_.forEach(this.columns,(function(e){t.push(e)})),this.generateDynamicColumns(t)},t.prototype.createGridColumns=function(e){var t=e&&!e.error;t&&!_.isArray(e)&&(e=[e]),_.isEmpty(e)?this.setGridData(e):t&&(this.prepareColDefs(e),this.serverData=e,this.setGridData(this.serverData))},t.prototype.getSortExpr=function(){var e,t;return this.datasource&&this.datasource.execute(u.DataSource.Operation.IS_PAGEABLE)&&(t=this.datasource.execute(u.DataSource.Operation.GET_PAGING_OPTIONS),e=_.isEmpty(t)?"":r.getOrderByExpr(t.sort)),e||""},t.prototype.onPropertyChange=function(t,n,i){var o,a=this;switch(t){case"datasource":!1===n.startUpdate&&(this.variableInflight=!1,this.callDataGridMethod("setStatus","nodata",this.nodatamessage)),this.watchVariableDataSet(this.dataset),this.onDataSourceChange();break;case"dataset":if(this.gridOptions.isNavTypeScrollOrOndemand()&&1===this.gridOptions.getCurrentPage()&&this.gridOptions.setIsNextPageData(!1),this.binddatasource&&!this.datasource)return;this.parentList&&!this.datasource&&_.startsWith(this.binddataset,"item")&&(this.datasource=u.getDatasourceFromExpr(this.widget.$attrs.get("datasetboundexpr"),this)),this.gridOptions.isNavTypeScrollOrOndemand()&&(this.gridOptions.isNextPageData?this.gridOptions.setIsDataUpdatedByUser(!1):(this.gridOptions.setIsDataUpdatedByUser(!0),this.setLastActionToDatasetUpdate(),this.gridOptions.setIsNextPageData(!1))),"wm.Variable"===_.get(this.datasource,"category")&&this._pageLoad&&"none"!==this.getConfiguredState()||this.watchVariableDataSet(n);break;case"filtermode":this.setDataGridOption("filtermode",n);break;case"searchlabel":this.setDataGridOption("searchLabel",n);break;case"navigation":if("Advanced"===n)return void(this.navigation="Classic");"None"!==n&&(this.shownavigation=!0),this.setDataGridOption("navigation",this.navigation),this.onDemandLoad=n===r.NAVIGATION_TYPE.ONDEMAND,this.infScroll=n===r.NAVIGATION_TYPE.SCROLL,this.navControls=n;break;case"gridfirstrowselect":this.setDataGridOption("selectFirstRow",n);break;case"gridclass":this.callDataGridMethod("option","cssClassNames.grid",n);break;case"nodatamessage":this.callDataGridMethod("option","dataStates.nodata",n);break;case"loadingdatamsg":this.callDataGridMethod("option","dataStates.loading",n);break;case"loadingicon":this.callDataGridMethod("option","loadingicon",n);break;case"spacing":this.callDataGridMethod("option","spacing",n),this.navigationSize="condensed"===n?"small":"";break;case"exportformat":this.exportOptions=[],n&&_.forEach(_.split(n,","),(function(e){a.exportOptions.push({label:e,icon:E[e]})}));break;case"shownewrow":o=n||_.some(this.actions,(function(e){return _.includes(e.action,"addNewRow()")})),this.callDataGridMethod("option","actionsEnabled.new",o);break;case"pagesize":this.dataNavigator.options={maxResults:n},this.dataNavigator.widget.maxResults=n,this.dataNavigator.maxResults=n;break;case"ondemandmessage":n&&this.$element.find(".on-demand-datagrid > a").text(n);break;case"show":n?this.invokeEventCallback("show"):this.invokeEventCallback("hide");default:e.prototype.onPropertyChange.call(this,t,n,i)}},t.prototype.onDataSourceChange=function(){this.fieldDefs.forEach((function(e){u.triggerFn(e.onDataSourceChange&&e.onDataSourceChange.bind(e))}))},t.prototype.clearActionRowVars=function(){this.actionRowIndex=void 0,this.actionRowPage=void 0,this.setDataGridOption("actionRowIndex",void 0),this.setDataGridOption("actionRowPage",void 0)},t.prototype.onStyleChange=function(t,n,i){switch(t){case"width":this.callDataGridMethod("setGridDimensions","width",n);break;case"height":this.callDataGridMethod("setGridDimensions","height",n)}e.prototype.onStyleChange.call(this,t,n,i)},t.prototype.populateActions=function(){var e=this;this._actions.header=[],this._actions.footer=[],_.forEach(this.actions,(function(t){_.includes(t.position,"header")&&e._actions.header.push(t),_.includes(t.position,"footer")&&e._actions.footer.push(t)}))},t.prototype.renderDynamicFilterColumn=function(e){this.isdynamictable&&this.filterTmpl._results.push(e)},t.prototype.registerColumns=function(e,t){var n=this;if(u.isMobile()&&this.viewport.isMobileType){if(!e.mobileDisplay)return}else if(this.viewport.isTabletType){if(!e.tabletDisplay)return}else if(!e.pcDisplay)return;e["primary-key"]&&this.primaryKey.push(e.field),this.fieldDefs[t]=e;var i=this.fieldDefs.length;this.fullFieldDefs.push(e),this.rowFilter[e.field]={value:void 0},this.fieldDefs.forEach((function(e){n.columns[e.field]=e})),this.isdynamictable&&i===this.noOfColumns&&(this.renderOperationColumns(),this.setDataGridOption("colDefs",this.fieldDefs))},t.prototype.registerFormField=function(e,t){this.formfields[e]=t},t.prototype.registerActions=function(e){this.actions.push(e),this.populateActions()},t.prototype.registerRow=function(e,t){this.rowDef=e,this.rowInstance=t,this.callDataGridMethod("option","cssClassNames.rowExpandIcon",this.rowDef.expandicon),this.callDataGridMethod("option","cssClassNames.rowCollapseIcon",this.rowDef.collapseicon),this.gridOptions.rowExpansionEnabled=!0,this.gridOptions.rowDef=this.rowDef},t.prototype.registerRowActions=function(e){this.rowActions.push(e)},t.prototype.selectItem=function(e,t){t&&(this.serverData=t),_.isObject(e)&&(e=_.omitBy(e,(function(e){return _.isArray(e)&&_.isEmpty(e)}))),this.callDataGridMethod("selectRow",e,!0)},t.prototype.deselectItem=function(e){this.callDataGridMethod("deselectRow",e)},t.prototype.onDataNavigatorDataSetChange=function(e){var t;return this.__fullData=e,this.checkFiltersApplied(this.getSortExpr()),this._isClientSearch?(t=u.getClonedObject(this.__fullData),_.isObject(t)&&!_.isArray(t)&&(t=[t]),t=this.getSearchResult(t,this.filterInfo),t=this.getSortResult(t,this.sortInfo)):e},t.prototype.toggleMessage=function(e,t,n,i){e&&n&&this.app.notifyApp(n,t,i)},t.prototype.export=function(e){var t,n=_.isEmpty(this.sortInfo)?"":this.sortInfo.field+" "+this.sortInfo.direction,i={};this.fieldDefs.forEach((function(e){if(e.field!==R&&e.show){var t={header:e.displayName};e.exportexpression?t.expression=e.exportexpression:t.field=e.field,i[e.field]=t}})),t={matchMode:"anywhereignorecase",filterFields:this.getFilterFields(this.filterInfo),orderBy:n,exportType:e.label,logicalOp:"AND",exportSize:this.exportdatasize,columns:i},!1!==this.invokeEventCallback("beforeexport",{$data:t})&&(t.fields=_.values(t.columns),this.datasource.execute(u.DataSource.Operation.DOWNLOAD,{data:t}))},t.prototype.expandRow=function(e){this.callDataGridMethod("expandRow",e)},t.prototype.collapseRow=function(e){this.callDataGridMethod("collapseRow",e)},t.prototype._documentClickBind=function(e){var t=e.target;this.$element[0].contains(t)||e.target.doctype||T($(t))||this.callDataGridMethod("saveRow")},t.prototype._redraw=function(e){var t=this;e?this.datagridElement.datatable(this.gridOptions):setTimeout((function(){t.callDataGridMethod("setColGroupWidths"),t.callDataGridMethod("addOrRemoveScroll")}))},t.prototype.invokeActionEvent=function(e,t){u.$parseEvent(t)(this.viewParent,Object.assign(this.context,{$event:e}))},t.prototype.handleEvent=function(t,n,i,o){"select"!==n&&e.prototype.handleEvent.call(this,this.nativeElement,n,i,o)},t.prototype.triggerUploadEvent=function(e,t,n,i){var o={$event:e,row:i};this.columns[n]&&("change"===t&&(o.newVal=e.target.files,o.oldVal=this.columns[n]._oldUploadVal,this.columns[n]._oldUploadVal=o.newVal),this.columns[n].invokeEventCallback(t,o))},t.prototype.registerFormWidget=function(){},t.prototype.writeValue=function(){},t.prototype.registerOnChange=function(e){this._onChange=e},t.prototype.registerOnTouched=function(e){this._onTouched=e},t.prototype.ngOnDetach=function(){e.prototype.ngOnDetach.call(this),"wm.Variable"===_.get(this.datasource,"category")&&"none"!==this.getConfiguredState()?this._pageLoad=!1:this._pageLoad=!0},t}(r.StylableComponent);S.initializeProps=P(),S.decorators=[{type:t.Component,args:[{selector:"[wmTable]",template:'<div class="panel-heading" *ngIf="title || subheading || iconclass || exportOptions.length || _actions.header.length">\n <h3 class="panel-title">\n <div class="pull-left">\n <i class="app-icon panel-icon {{iconclass}}" *ngIf="iconclass"></i>\n </div>\n <div class="pull-left">\n <div class="heading" [innerHTML]="title"></div>\n <div class="description" [innerHTML]="subheading"></div>\n </div>\n <div class="panel-actions app-datagrid-actions" *ngIf="exportOptions.length || _actions.header.length">\n <ng-container *ngFor="let btn of _actions.header"\n [ngTemplateOutlet]="btn.widgetType === \'button\' ? buttonRef : anchorRef" [ngTemplateOutletContext]="{btn:btn}">\n </ng-container>\n <div wmMenu dropdown caption.bind="appLocale.LABEL_EXPORT" *ngIf="exportOptions.length" autoclose="always" attr.name="{{name}}-export"\n dataset.bind="exportOptions" select.event="export($item)" menuposition="down,left"></div>\n </div>\n </h3>\n</div>\n<div class="app-datagrid" #datagridElement></div>\n\n<div class="panel-footer clearfix" [hidden]="!_actions.footer.length && (!shownavigation || (onDemandLoad && dataNavigator.isDisableNext) || dataNavigator?.dataSize <= pagesize)">\n <div class="app-datagrid-paginator" [hidden]="(!dataNavigator?.dataSize && !dataNavigator.datasource?.pagination?.next) || !shownavigation || (onDemandLoad && dataNavigator.isDisableNext) || dataNavigator?.dataSize <= pagesize">\n <nav wmPagination show.bind="shownavigation" navigationalign.bind="navigationalign"\n navigationsize.bind="navigationSize"\n navigation.bind="navControls" showrecordcount.bind="showrecordcount" maxsize.bind="maxsize"\n boundarylinks.bind="boundarylinks"\n forceellipses.bind="forceellipses" directionlinks.bind="directionlinks"></nav>\n </div>\n <div class="app-datagrid-actions" *ngIf="_actions.footer.length">\n <ng-container *ngFor="let btn of _actions.footer"\n [ngTemplateOutlet]="btn.widgetType === \'button\' ? buttonRef : anchorRef" [ngTemplateOutletContext]="{btn:btn}">\n </ng-container>\n </div>\n</div>\n\n<ng-template #buttonRef let-btn="btn">\n <button wmButton caption.bind="btn.displayName" show.bind="btn.show" class.bind="btn.class" iconclass.bind="btn.iconclass" (click)="invokeActionEvent($event, btn.action)"\n [ngClass]="{\'btn-sm\': spacing === \'condensed\', \'disabled-new\': btn.key === \'addNewRow\' && (isGridEditMode || isLoading)}"\n type="button" shortcutkey.bind="btn.shortcutkey" tabindex.bind="btn.tabindex" hint.bind="btn.title" [attr.aria-label]="btn.displayName" disabled.bind="btn.disabled" conditionalclass.bind="btn.conditionalclass" conditionalstyle.bind="btn.conditionalstyle"></button>\n</ng-template>\n\n<ng-template #anchorRef let-btn="btn">\n <a wmAnchor caption.bind="btn.displayName" show.bind="btn.show" class.bind="btn.class" iconclass.bind="btn.iconclass" (click)="invokeActionEvent($event, btn.action)"\n [ngClass]="{\'btn-sm\': spacing === \'condensed\', \'disabled-new\': btn.key === \'addNewRow\' && (isGridEditMode || isLoading)}"\n shortcutkey.bind="btn.shortcutkey" tabindex.bind="btn.tabindex" hint.bind="btn.title"\n hyperlink.bind="btn.hyperlink" target.bind="btn.target" conditionalclass.bind="btn.conditionalclass" conditionalstyle.bind="btn.conditionalstyle"></a>\n</ng-template>\n\n<div hidden>\n <ng-container #multiColumnFilterView></ng-container>\n\n <ng-container #inlineEditView></ng-container>\n\n <ng-container #inlineEditNewView></ng-container>\n\n <ng-container #rowActionsView></ng-container>\n\n <ng-container #rowExpansionActionView></ng-container>\n\n <ng-container #customExprView></ng-container>\n\n <ng-container #dynamicTable></ng-container>\n\n <ng-container #rowDetailView></ng-container>\n\n <div class="dynamic-table-container"></div>\n</div>\n',providers:[r.provideAs(S,i.NG_VALUE_ACCESSOR,!0),r.provideAsWidgetRef(S)]}]}],S.ctorParameters=function(){return[{type:t.Injector},{type:i.FormBuilder},{type:u.App},{type:u.DynamicComponentRefProvider},{type:u.StatePersistence},{type:u.PaginationService},{type:u.Viewport},{type:p.ListComponent,decorators:[{type:t.Optional}]},{type:void 0,decorators:[{type:t.Attribute,args:["dataset.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["datasource.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["readonlygrid"]}]},{type:t.NgZone},{type:r.TrustAsPipe}]},S.propDecorators={dataNavigator:[{type:t.ViewChild,args:[d.PaginationComponent,{static:!0}]}],_tableElement:[{type:t.ViewChild,args:["datagridElement",{static:!0}]}],rowActionTmpl:[{type:t.ContentChildren,args:["rowActionTmpl"]}],rowActionsViewRef:[{type:t.ViewChild,args:["rowActionsView",{static:!0,read:t.ViewContainerRef}]}],filterTmpl:[{type:t.ContentChildren,args:["filterTmpl",{descendants:!0}]}],filterViewRef:[{type:t.ViewChild,args:["multiColumnFilterView",{static:!0,read:t.ViewContainerRef}]}],inlineWidgetTmpl:[{type:t.ContentChildren,args:["inlineWidgetTmpl",{descendants:!0}]}],inlineEditViewRef:[{type:t.ViewChild,args:["inlineEditView",{static:!0,read:t.ViewContainerRef}]}],inlineWidgetNewTmpl:[{type:t.ContentChildren,args:["inlineWidgetTmplNew",{descendants:!0}]}],inlineEditNewViewRef:[{type:t.ViewChild,args:["inlineEditNewView",{static:!0,read:t.ViewContainerRef}]}],customExprTmpl:[{type:t.ContentChildren,args:["customExprTmpl",{descendants:!0}]}],customExprViewRef:[{type:t.ViewChild,args:["customExprView",{static:!0,read:t.ViewContainerRef}]}],rowExpansionActionTmpl:[{type:t.ContentChildren,args:["rowExpansionActionTmpl"]}],rowExpansionTmpl:[{type:t.ContentChild,args:["rowExpansionTmpl"]}],rowDetailViewRef:[{type:t.ViewChild,args:["rowDetailView",{static:!0,read:t.ViewContainerRef}]}],rowExpansionActionViewRef:[{type:t.ViewChild,args:["rowExpansionActionView",{static:!0,read:t.ViewContainerRef}]}],dynamicTableRef:[{type:t.ViewChild,args:["dynamicTable",{static:!0,read:t.ViewContainerRef}]}],onKeyPress:[{type:t.HostListener,args:["keypress",["$event"]]}]};var C="new",I="edit",D="delete",x=function(){function e(e,t,n){this.table=e,this.dialogService=t,this.app=n,e.initiateSelectItem=this.initiateSelectItem.bind(this),e.updateVariable=this.updateVariable.bind(this),e.updateRecord=this.updateRecord.bind(this),e.deleteRecord=this.deleteRecord.bind(this),e.insertRecord=this.insertRecord.bind(this),e.editRow=this.editRow.bind(this),e.addNewRow=this.addNewRow.bind(this),e.addRow=this.addNewRow.bind(this),e.deleteRow=this.deleteRow.bind(this),e.onRecordDelete=this.onRecordDelete.bind(this),e.hideEditRow=this.hideEditRow.bind(this),e.saveRow=this.saveRow.bind(this),e.cancelRow=this.cancelRow.bind(this)}return e.prototype.selectItemOnSuccess=function(e,t,n){var i=this;setTimeout((function(){t||i.table.selectItem(e,i.table.dataset),u.triggerFn(n)}),250)},e.prototype.initiateSelectItem=function(e,t,n,i,o){var a=this;this.table.gridOptions.isNavTypeScrollOrOndemand()&&!this.table.dataNavigator.isDisableNext&&this.table.isNewRowInserted?this.table.isNewRowInserted=!1:("last"===e&&(i||(this.table.dataNavigator.dataSize+=1),this.table.isNavigationEnabled()||(e="current")),this.table.dataNavigator.calculatePagingValues(),this.table.dataNavigator.__fullData=this.table.__fullData,this.table.dataNavigator.navigatePage(e,null,!0,(function(){(a.table.isNavigationEnabled()||i)&&a.selectItemOnSuccess(t,n,o),"quickedit"!==a.table.editmode||n||a.table.callDataGridMethod("setActiveRow",t)})))},e.prototype.updateVariable=function(e,t){var n=this,i=this.table.datasource;if(i&&(i.execute(u.DataSource.Operation.FETCH_DISTINCT_VALUES),!this.table.isNavigationEnabled())){var o=this.table.sortInfo,a=o&&o.direction?o.field+" "+o.direction:"";r.refreshDataSource(i,{page:1,filterFields:this.table.getFilterFields(this.table.filterInfo),orderBy:a,matchMode:"anywhereignorecase"}).then((function(){u.$appDigest(),n.selectItemOnSuccess(e,!0,t)}))}},e.prototype.insertSuccessHandler=function(e,t){if(e.error)this.table.invokeEventCallback("error",{$event:t.event,$operation:C,$data:e.error}),this.table.onError||this.table.toggleMessage(!0,"error",this.table.errormessage||e.error),u.triggerFn(t.error,e);else{if(this.table.gridOptions.isNavTypeScrollOrOndemand()&&(this.table.isNewRowInserted=!0),t.event){var n=$(t.event.target).closest("tr");this.table.callDataGridMethod("hideRowEditMode",n)}this.table.onRowinsert||this.table.toggleMessage(!0,"success",this.table.insertmessage),this.table.datasource.execute(u.DataSource.Operation.SUPPORTS_CRUD)?(this.table.initiateSelectItem(this.table.getNavigationTargetBySortInfo(),e,void 0,!1,t.callBack),this.updateVariable(e,t.callBack)):this.table.datasource.execute(u.DataSource.Operation.IS_API_AWARE)||this.table.initiateSelectItem(this.table.getNavigationTargetBySortInfo(),e,void 0,!1,t.callBack),u.triggerFn(t.success,e),this.table.invokeEventCallback("rowinsert",{$event:t.event,$data:e,row:e})}},e.prototype.generatePath=function(e){var t,n,i=this.table.widget.$attrs.get("datasetboundexpr");if(_.startsWith(e,"item")&&i){_.startsWith(i,"Widgets.")&&(i=u.extractCurrentItemExpr(i,this.table));for(var o=this.table.$element.parents(".app-list-item"),a=_.map(o,(function(e){return _.parseInt($(e).attr("listitemindex"))})),r=a.length-1;r>=0;r--)i=i.replace("$i",a[r]);n=_.last(a),t=i.replace(/^Variables\..*\.dataSet([^.])*(\.|$)/g,"")}else{/^Variables\..*\.dataSet([\[][0-9]])/g.test(e)&&(n=_.parseInt(e.replace(/^Variables\..*\.dataSet([\[])/g,""))),t=e.replace(/^Variables\..*\.dataSet([^.])*(\.|$)/g,"")}return{path:t,index:n}},e.prototype.insertRecord=function(e){var t=this,n=this.table.datasource;if(n){var i=n.pagination&&n.pagination.number+1,o={row:e.row,skipNotification:!0,period:e.period};if(n.execute(u.DataSource.Operation.SUPPORTS_CRUD)||!n.execute(u.DataSource.Operation.IS_API_AWARE)||"wm.CrudVariable"===n.category){if(!n.execute(u.DataSource.Operation.IS_API_AWARE)){var a=this.generatePath(this.table.binddataset);return n.execute(u.DataSource.Operation.ADD_ITEM,{item:e.row,path:a.path,parentIndex:a.index}),void this.insertSuccessHandler(e.row,e)}n.execute(u.DataSource.Operation.INSERT_RECORD,o).then((function(o){t.insertSuccessHandler(o,e),"wm.CrudVariable"===n.category&&n.execute(u.DataSource.Operation.LIST_RECORDS,{skipToggleState:!0,operation:"list",page:i})}),(function(n){t.table.invokeEventCallback("error",{$event:e.event,$operation:C,$data:n}),t.table.onError||t.table.toggleMessage(!0,"error",t.table.errormessage||n),u.triggerFn(e.error,n),u.triggerFn(e.callBack,void 0,!0)}))}else this.table.invokeEventCallback("rowinsert",{$event:e.event,row:e.row})}},e.prototype.updateSuccessHandler=function(e,t){if(e.error)this.table.invokeEventCallback("error",{$event:t.event,$operation:I,$data:e.error}),this.table.onError||this.table.toggleMessage(!0,"error",this.table.errormessage||e.error),u.triggerFn(t.error,e);else{if(t.event){var n=$(t.event.target).closest("tr");this.table.callDataGridMethod("hideRowEditMode",n)}this.table.onRowupdate||this.table.toggleMessage(!0,"success",this.table.updatemessage),this.table.datasource.execute(u.DataSource.Operation.SUPPORTS_CRUD)?(this.table.initiateSelectItem("current",e,void 0,!1,t.callBack),this.updateVariable(e,t.callBack)):this.table.datasource.execute(u.DataSource.Operation.IS_API_AWARE)||this.table.initiateSelectItem("current",e,void 0,!1,t.callBack),u.triggerFn(t.success,e),this.table.invokeEventCallback("rowupdate",{$event:t.event,$data:e,row:e})}},e.prototype.updateRecord=function(e){var t=this,n=this.table.datasource;if(n){var i=n.pagination&&n.pagination.number+1,o={row:e.row,prevData:e.prevData,skipNotification:!0,period:e.period};if(n.execute(u.DataSource.Operation.SUPPORTS_CRUD)||!n.execute(u.DataSource.Operation.IS_API_AWARE)||"wm.CrudVariable"===n.category){if(!n.execute(u.DataSource.Operation.IS_API_AWARE)){var a=this.generatePath(this.table.binddataset);return n.execute(u.DataSource.Operation.SET_ITEM,{prevItem:e.prevData,item:e.row,path:a.path,parentIndex:a.index}),void this.updateSuccessHandler(e.row,e)}n.execute(u.DataSource.Operation.UPDATE_RECORD,o).then((function(o){t.updateSuccessHandler(o,e),"wm.CrudVariable"===n.category&&n.execute(u.DataSource.Operation.LIST_RECORDS,{skipToggleState:!0,operation:"list",page:i})}),(function(n){t.table.invokeEventCallback("error",{$event:e.event,$operation:I,$data:n}),t.table.onError||t.table.toggleMessage(!0,"error",t.table.errormessage||n),u.triggerFn(e.error,n),u.triggerFn(e.callBack,void 0,!0)}))}else this.table.invokeEventCallback("rowupdate",{$event:e.event,row:e.row})}},e.prototype.onRecordDelete=function(e){var t;this.table.dataNavigator&&(this.table.dataNavigator.dataSize-=1,this.table.dataNavigator.calculatePagingValues(),t=this.table.dataNavigator.pageCount<this.table.dataNavigator.dn.currentPage?"prev":void 0,this.table.dataNavigator.__fullData=this.table.__fullData,this.table.dataNavigator.navigatePage(t,null,!0,(function(){setTimeout((function(){u.triggerFn(e)}),void 0,!1)})))},e.prototype.deleteSuccessHandler=function(e,t,n,i){t&&t.error?this.table.onError||this.table.toggleMessage(!0,"error",this.table.errormessage||t.error):(this.onRecordDelete(i),this.table.datasource.execute(u.DataSource.Operation.SUPPORTS_CRUD)&&this.updateVariable(e,i),this.table.onRowdelete||this.table.toggleMessage(!0,"success",this.table.deletemessage),this.table.invokeEventCallback("rowdelete",{$event:n,$data:e,row:e}),this.table.invokeEventCallback("rowdeleted",{$event:n,$data:e,row:e}))},e.prototype.deleteFn=function(e){var t,n,i=this,o=this.table.datasource;if(o){if((this.table.onDemandLoad||this.table.infScroll)&&(this.table.isRowDeleted=!0),"wm.CrudVariable"===o.category&&(this.triggerWMEvent("resetEditMode"),o.pagination&&(t=o.pagination.last&&1===o.pagination.numberOfElements,n=t?o.pagination.number:o.pagination.number+1)),o.execute(u.DataSource.Operation.SUPPORTS_CRUD)||!o.execute(u.DataSource.Operation.IS_API_AWARE)||this.table._isDependent||"wm.CrudVariable"===o.category){if(!o.execute(u.DataSource.Operation.IS_API_AWARE)){var a=this.generatePath(this.table.binddataset);return o.execute(u.DataSource.Operation.REMOVE_ITEM,{item:e.row,path:a.path,parentIndex:a.index}),void this.deleteSuccessHandler(e.row,void 0,e.evt,e.callBack)}o.execute(u.DataSource.Operation.DELETE_RECORD,{row:e.row,skipNotification:!0,period:e.period}).then((function(t){i.deleteSuccessHandler(t,e.row,e.evt,e.callBack),"wm.CrudVariable"===o.category&&o.execute(u.DataSource.Operation.LIST_RECORDS,{skipToggleState:!0,operation:"list",page:n})}),(function(t){i.table.isRowDeleted&&(i.table.isRowDeleted=!1),u.triggerFn(e.callBack,void 0,!0),i.table.invokeEventCallback("error",{$event:e.evt,$operation:D,$data:t}),i.table.onError||i.table.toggleMessage(!0,"error",i.table.errormessage||t)}))}else this.table.invokeEventCallback("rowdelete",{$event:e.evt,row:e.row});u.triggerFn(e.cancelRowDeleteCallback)}},e.prototype.deleteRecord=function(e){var t=this;if(!this.table.confirmdelete)return this.deleteFn(e),void u.triggerFn(e.cancelRowDeleteCallback);this.dialogService.showAppConfirmDialog({title:this.app.appLocale.MESSAGE_DELETE_RECORD||"Delete Record",iconclass:"wi wi-delete fa-lg",message:this.table.confirmdelete,oktext:this.table.deleteoktext,canceltext:this.table.deletecanceltext,onOk:function(){t.deleteFn(e),t.dialogService.closeAppConfirmDialog()},onCancel:function(){u.triggerFn(e.cancelRowDeleteCallback),t.dialogService.closeAppConfirmDialog()},onOpen:function(){$(".cancel-action").focus()},onEscape:function(){u.triggerFn(e.cancelRowDeleteCallback)}})},e.prototype.editRow=function(e){var t,n=this;this.table._isDependent?this.triggerWMEvent("update"):(e&&e.target?this.table.callDataGridMethod("toggleEditRow",e,{selectRow:!0,action:"edit"}):"form"===this.table.editmode||"dialog"===this.table.editmode?(t=e||this.table.selectedItems[0],this.table.gridOptions.beforeRowUpdate(t)):setTimeout((function(){(t=n.table.datagridElement.find("tr.active")).length&&n.table.callDataGridMethod("toggleEditRow",void 0,{$row:t,action:"edit"})})),this.table._triggeredByUser=!0,this.table.gridOptions.setIsDataUpdatedByUser(!1))},e.prototype.addNewRow=function(){this.table.isGridEditMode||(this.table._triggeredByUser=!0,this.table.gridOptions.setIsDataUpdatedByUser(!1),this.table.callDataGridMethod("addNewRow"),this.table._liveTableParent?this.table._liveTableParent.addNewRow():this.table._isDependent&&this.triggerWMEvent("insert"))},e.prototype.triggerWMEvent=function(e,t){u.$invokeWatchers(!0),this.app.notify("wm-event",{eventName:e,widgetName:this.table.name,row:this.table.selecteditem,dataSource:t})},e.prototype.deleteRow=function(e){var t,n=this;e&&e.target?this.table.callDataGridMethod("deleteRowAndUpdateSelectAll",e):setTimeout((function(){t=e||n.table.selectedItems[0],n.deleteRecord({row:t})})),this.table._triggeredByUser=!0,this.table.gridOptions.setIsDataUpdatedByUser(!1)},e.prototype.hideEditRow=function(){var e=this.table.datagridElement.find("tr.row-editing");e.length&&this.table.callDataGridMethod("hideRowEditMode",e)},e.prototype.saveRow=function(){this.table.callDataGridMethod("saveRow")},e.prototype.cancelRow=function(){var e=this.table.datagridElement.find("tr.row-editing");e.length&&this.table.callDataGridMethod("cancelEdit",e)},e}();x.decorators=[{type:t.Directive,args:[{selector:"[wmTableCUD]"}]}],x.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Self},{type:t.Inject,args:[S]}]},{type:u.AbstractDialogService},{type:u.App}]};var N=["null","empty","nullorempty","isnotnull","isnotempty"],M=function(e,t){if(u.isDefined(e)&&""!==e)return u.isNumberType(t)?_.toNumber(e):t===u.DataType.DATETIME?moment(e).valueOf():_.toString(e).toLowerCase()},k=function(e,t,n){void 0===n&&(n=[]);var i,o=M(t.value,t.type);return!u.isDefined(o)&&!_.includes(N,t.matchMode)||u.isNumberType(t.type)&&_.isNull(t.value)?e:e=e.filter((function(e){var a;switch(t.field?i=M(_.get(e,t.field),t.type):(i=[],_.forEach(e,(function(t,o){if(_.includes(n,o))i.push(t);else{var a=_.filter(_.range(n.length),(function(e){return n[e].includes(o)}));_.forEach(a,(function(t){var o=_.get(e,n[t]);i.indexOf(o)<0&&i.push(o)}))}})),i=i.join(" ").toLowerCase()),t.matchMode){case"start":a=_.startsWith(i,o);break;case"end":a=_.endsWith(i,o);break;case"exact":a=_.isEqual(i,o);break;case"notequals":a=!_.isEqual(i,o);break;case"null":a=_.isNull(i);break;case"isnotnull":a=!_.isNull(i);break;case"empty":a=_.isEmpty(i);break;case"isnotempty":a=!_.isEmpty(i);break;case"nullorempty":a=_.isNull(i)||_.isEmpty(i);break;case"lessthan":a=i<o;break;case"lessthanequal":a=i<=o;break;case"greaterthan":a=i>o;break;case"greaterthanequal":a=i>=o;break;default:a=u.isNumberType(t.type)?_.isEqual(i,o):_.includes(i,o)}return a}))},L=function(e,t,n){n.forEach((function(n){e[n]={value:t.value,type:t.value.type,logicalOp:"OR"},t.matchMode&&(e[n].matchMode=t.matchMode)}))},F=function(e,t,n){void 0===n&&(n=[]);var i=t&&t.field;i?(e[i]={value:t.value,logicalOp:"AND"},t.matchMode&&(e[i].matchMode=t.matchMode)):L(e,t,n)},j=function(e,t){t.field&&(e[t.field]={value:t.value,matchMode:t.matchMode,type:t.type})},B=function(e,t){e.push({field:t.key?t.key:"",matchMode:t.matchMode,type:t.type,value:t.value})},G=function(){function e(e){this.table=e,e._searchSortHandler=this.searchSortHandler.bind(this),e.getSearchResult=this.getSearchResult.bind(this),e.getSortResult=this.getSortResult.bind(this),e.checkFiltersApplied=this.checkFiltersApplied.bind(this),e.getFilterFields=this.getFilterFields.bind(this),e.onRowFilterChange=this.onRowFilterChange.bind(this),e.onFilterConditionSelect=this.onFilterConditionSelect.bind(this),e.showClearIcon=this.showClearIcon.bind(this),e.clearRowFilter=this.clearRowFilter.bind(this),e.matchModeTypesMap=r.getMatchModeTypesMap(),e.matchModeMsgs=r.getMatchModeMsgs(e.appLocale),e.emptyMatchModes=N,e.getNavigationTargetBySortInfo=this.getNavigationTargetBySortInfo.bind(this),e.refreshData=this.refreshData.bind(this),e.clearFilter=this.clearFilter.bind(this),e.adjustContainer=this.adjustContainer.bind(this)}return e.prototype.adjustContainer=function(e){var t=this;setTimeout((function(){u.adjustContainerRightEdges($("bs-dropdown-container"),t.table.rowFilterCompliedTl[e],t.table,$("bs-dropdown-container .dropdown-menu"))}))},e.prototype.getNavigationTargetBySortInfo=function(){return this.table.sortInfo&&"desc"===this.table.sortInfo.direction&&_.includes(this.table.primaryKey,this.table.sortInfo.field)?"first":"last"},e.prototype.getTableVisibleCols=function(){var e=[];return _.forEach(this.table.columns,(function(t,n){"true"===_.toLower(_.toString(t.showinfilter))&&"rowOperations"!==n&&t.searchable&&e.push(n)})),e},e.prototype.invokeSetFilterfieldBasedOnFieldval=function(e,t){if(e.field)F(t,e);else if(!_.isEmpty(e)){var n=this.getTableVisibleCols();F(t,e,n)}},e.prototype.getFilterFields=function(e){var t=this;e=e||{};var n={};return _.isArray(e)?_.forEach(e,(function(e){t.invokeSetFilterfieldBasedOnFieldval(e,n)})):this.invokeSetFilterfieldBasedOnFieldval(e,n),n},e.prototype.getLogicalOperator=function(e){var t="";for(var n in e){t=e[n].logicalOp||"";break}return t},e.prototype.resetSortStatus=function(e){var t;!_.isEmpty(this.table.sortInfo)&&this.table.datasource&&(t=this.table.sortInfo.field+" "+this.table.sortInfo.direction,(e=this.table.datasource.execute(u.DataSource.Operation.GET_OPTIONS).orderBy||e)&&(e=_.head(_.split(e,","))),t!==e&&(this.table.callDataGridMethod("resetSortIcons"),this.table.sortInfo={},this.table.setDataGridOption("sortInfo",{})))},e.prototype.clearFilter=function(e){var t;this.table.filterInfo={},"multicolumn"===this.table.filtermode?(this.table.fieldDefs.forEach((function(e){e.resetFilter&&e.resetFilter()})),e||this.table.onRowFilterChange()):"search"===this.table.filtermode&&((t=this.table.datagridElement).find('[data-element="dgSearchText"]').val(""),t.find('[data-element="dgFilterValue"]').val(""),e||t.find(".app-search-button").trigger("click"))},e.prototype.checkFiltersApplied=function(e){if(this.table.datasource)return this.table.datasource.execute(u.DataSource.Operation.SUPPORTS_SERVER_FILTER)?(_.isEmpty(this.table.datasource.execute(u.DataSource.Operation.GET_OPTIONS).filterFields)&&this.clearFilter(!0),void this.resetSortStatus(e)):void(this.table.datasource.execute(u.DataSource.Operation.IS_PAGEABLE)&&this.resetSortStatus(e))},e.prototype.getSearchResult=function(e,t){var n=this.getTableVisibleCols();return t?(_.isArray(t)?t.forEach((function(t){e=k(e,t,n)})):e=k(e,t,n),e):e},e.prototype.getSortResult=function(e,t){return t&&t.direction&&(e=_.orderBy(e,t.field,t.direction)),e},e.prototype.handleClientSideSortSearch=function(e,t,n){var i;this.table._isClientSearch=!0,i=this.table.isNavigationEnabled()?u.getClonedObject(this.table.__fullData):u.getClonedObject(this.table.dataset),"search"===n?this.table.filterInfo=e:this.table.sortInfo=e,_.isObject(i)&&!_.isArray(i)&&(i=[i]),i=this.getSearchResult(i,this.table.filterInfo),i=this.getSortResult(i,this.table.sortInfo),this.table.serverData=i,"sort"===n&&this.table.invokeEventCallback("sort",{$event:t,$data:{data:this.table.serverData,sortDirection:this.table.sortInfo.direction,colDef:this.table.columns[this.table.sortInfo.field]}}),this.table.isNavigationEnabled()?(this.table.dataNavigator.dn.currentPage=1,this.table.dataNavigator.setPagingValues(i)):this.table.setGridData(this.table.serverData)},e.prototype.handleSinglePageSearch=function(e){this.table._isPageSearch=!0;var t=u.getClonedObject(this.table.gridData),n=this.table.datagridElement.find("tbody tr.app-datagrid-row");this.table.filterInfo=e,t=this.getSearchResult(t,e),_.forEach(this.table.gridData,(function(e,i){var o=$(n[i]);_.find(t,(function(t){return _.isEqual(t,e)}))?o.show():o.hide()})),t&&t.length?(this.table.callDataGridMethod("setStatus","ready"),this.table.gridfirstrowselect&&!this.table.multiselect&&this.table.callDataGridMethod("selectFirstRow",!0,!0)):(this.table.callDataGridMethod("setStatus","nodata",this.table.nodatamessage),this.table.selecteditem=void 0),this.table.callDataGridMethod("updateSelectAllCheckboxState")},e.prototype.handleServerSideSearch=function(e){var t=this;if(this.table.filterInfo=e,this.table.datasource){var n=this.table.sortInfo,i=n&&n.direction?n.field+" "+n.direction:"",o=this.getFilterFields(e),a=this.getLogicalOperator(o);r.refreshDataSource(this.table.datasource,{page:1,filterFields:o,orderBy:i,condition:a}).then((function(){u.$appDigest()}),(function(){t.table.toggleMessage(!0,"error",t.table.nodatamessage)}))}},e.prototype.handleSeverSideSort=function(e,t,n){var i=this;this.table.gridOptions.sortInfo.field=e.field,this.table.gridOptions.sortInfo.direction=e.direction,this.table.sortInfo=u.getClonedObject(e);var o=e&&e.direction?e.field+" "+e.direction:"",a=this.getFilterFields(this.table.filterInfo),s=this.getLogicalOperator(a);n||"none"===this.table.getConfiguredState()||this.table.statePersistence.removeWidgetState(this.table,"pagination"),r.refreshDataSource(this.table.datasource,{page:1,filterFields:a,orderBy:o,condition:s}).then((function(n){u.$appDigest();var o=n&&n.data?n.data:n;i.table.invokeEventCallback("sort",{$event:t,$data:{data:o,sortDirection:e.direction,colDef:i.table.columns[e.field]}})}))},e.prototype.searchHandler=function(e,t,n,i){var o;o=_.isArray(e)?e.filter((function(e){return void 0!==e.matchMode&&void 0!==e.value||void 0!==e.value&&""===e.field})):{field:e.field,value:e.value,type:e.type},"none"!==this.table.getConfiguredState()&&r.unsupportedStatePersistenceTypes.indexOf(this.table.navigation)<0?(_.isArray(e)&&o.length||e.value?(this.table.statePersistence.removeWidgetState(this.table,"search"),this.table.statePersistence.setWidgetState(this.table,{search:o})):this.table.statePersistence.removeWidgetState(this.table,"search"),i||(this.table.statePersistence.removeWidgetState(this.table,"pagination"),this.table.statePersistence.removeWidgetState(this.table,"selectedItem"))):console.warn("Retain State handling on Widget "+this.table.name+" is not supported for current pagination type.");var a=u.getClonedObject(e),s=this.table.datasource;if(s||this.table.dataset){var l={};_.isArray(a)?a.forEach((function(e){j(l,e)})):j(l,a),!1!==this.table.invokeEventCallback("beforefilter",{$event:t,$data:l,columns:l})&&(a=[],_.isEmpty(l)&&!_.isEmpty(o)?_.isArray(o)?_.forEach(o,(function(e){B(a,e)})):B(a,o):_.forEach(l,(function(e,t){a.push({field:t,matchMode:e.matchMode,type:e.type,value:e.value})})),s&&s.execute(u.DataSource.Operation.SUPPORTS_SERVER_FILTER)?this.handleServerSideSearch(a):s&&s.execute(u.DataSource.Operation.IS_API_AWARE)&&s.execute(u.DataSource.Operation.IS_PAGEABLE)?this.handleSinglePageSearch(a):this.handleClientSideSortSearch(a,t,n))}},e.prototype.sortHandler=function(e,t,n,i){var o=this.table.datasource;if(o||this.table.dataset){if(!i&&"none"!==this.table.getConfiguredState()&&r.unsupportedStatePersistenceTypes.indexOf(this.table.navigation)<0){var a={direction:e.direction,field:e.field};e.direction?this.table.statePersistence.setWidgetState(this.table,{sort:a}):this.table.statePersistence.removeWidgetState(this.table,"sort"),this.table.statePersistence.removeWidgetState(this.table,"selectedItem")}else console.warn("Retain State handling on Widget "+this.table.name+" is not supported for current pagination type.");o&&o.execute(u.DataSource.Operation.IS_SORTABLE)?this.handleSeverSideSort(e,t,i):this.handleClientSideSortSearch(e,t,n)}},e.prototype.setLastActionPerformedToSearchSort=function(){this.table.gridOptions.setLastActionPerformed(this.table.gridOptions.ACTIONS.SEARCH_OR_SORT),this.table.gridOptions.setIsSearchTrigerred(!0)},e.prototype.searchSortHandler=function(e,t,n,i){"change"===(t?t.type:"")&&"multicolumn"!==this.table.filtermode?t.stopPropagation():(this.setLastActionPerformedToSearchSort(),"search"===n?this.searchHandler(e,t,n,i):this.sortHandler(e,t,n,i))},e.prototype.showClearIcon=function(e){var t=this.table.rowFilter[e]&&this.table.rowFilter[e].value;return u.isDefined(t)&&""!==t&&null!==t},e.prototype.clearRowFilter=function(e){this.table.rowFilter&&this.table.rowFilter[e]&&(this.table.columns[e].resetFilter(),this.onRowFilterChange(e))},e.prototype.onFilterConditionSelect=function(e,t){var n=this;this.table.rowFilter[e]=this.table.rowFilter[e]||{},this.table.rowFilter[e].matchMode=t,_.includes(this.table.emptyMatchModes,t)?(this.table.columns[e].resetFilter(),this.table.onRowFilterChange()):u.isDefined(this.table.rowFilter[e].value)&&""!==this.table.rowFilter[e].value?this.table.onRowFilterChange():setTimeout((function(){n.table.columns[e].filterInstance.focus()}))},e.prototype.getFilterOnFieldValues=function(e){var t=this;if(this.table.datasource&&this.table.datasource.execute(u.DataSource.Operation.SUPPORTS_DISTINCT_API)){var n=e.field,i=this.table.fullFieldDefs,o=_.filter(i,{filteronfilter:n}),a=_.get(this.table.rowFilter,[n,"value"]);_.forEach(o,(function(e){var n=e.filteronfilter,i=e.field,o={},s=e.filterwidget;r.isDataSetWidget(s)&&n!==i&&!e.isFilterDataSetBound&&(o[n]=u.isDefined(a)&&""!==a&&null!==a?{value:a}:{},s===u.FormWidgetType.AUTOCOMPLETE&&e.filterInstance.dataoptions?e.filterInstance.dataoptions.filterFields=o:t.table.datasource.execute(u.DataSource.Operation.GET_DISTINCT_DATA_BY_FIELDS,{fields:i,filterFields:o}).then((function(t){e.filterdataset=t.data})))}))}},e.prototype.onRowFilterChange=function(e){var t=this,n=[],i=_.find(this.table.fullFieldDefs,{field:e});_.forEach(this.table.rowFilter,(function(e,o){(u.isDefined(e.value)&&""!==e.value||_.includes(t.table.emptyMatchModes,e.matchMode))&&(i&&o===i.field&&(e.type=e.type||i.type,e.matchMode=e.matchMode||_.get(t.table.matchModeTypesMap[e.type],0)),n.push({field:o,value:e.value,matchMode:e.matchMode,type:e.type}))})),this.table.gridOptions.searchHandler(n,void 0,"search"),i&&this.getFilterOnFieldValues(i)},e.prototype.refreshData=function(e){if(this.table.datasource){var t=e?this.table.dataNavigator.dn.currentPage:1,n=this.table.sortInfo,i=n&&n.direction?n.field+" "+n.direction:"",o=this.getFilterFields(this.table.filterInfo),a=this.getLogicalOperator(o);r.refreshDataSource(this.table.datasource,{page:t,filterFields:o,orderBy:i,condition:a})}},e}();G.decorators=[{type:t.Directive,args:[{selector:"[wmTableFilterSort]"}]}],G.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Self},{type:t.Inject,args:[S]}]}]};var V=function(){r.register("wm-table-action",new Map([["accessroles",r.PROP_STRING],["action",r.PROP_STRING],["caption",r.PROP_STRING],["class",r.PROP_STRING],["conditionalclass",r.PROP_ANY],["conditionalstyle",r.PROP_ANY],["disabled",Object.assign({value:!1},r.PROP_BOOLEAN)],["display-name",r.PROP_STRING],["hyperlink",r.PROP_STRING],["icon",r.PROP_STRING],["iconclass",r.PROP_STRING],["key",r.PROP_STRING],["position",Object.assign({value:"footer"},r.PROP_STRING)],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["title",r.PROP_STRING],["target",r.PROP_STRING],["widget-type",Object.assign({value:"button"},r.PROP_STRING)]]))},W={widgetType:"wm-table-action",hostClass:""},U=function(e){function t(t,n){var i=e.call(this,t,W)||this;return i.table=n,i}return g(t,e),t.prototype.populateAction=function(){this.buttonDef={key:this.key,displayName:this["display-name"]||this.caption||"",show:this.show,class:this.class||"",iconclass:this.iconclass||"",title:_.isUndefined(this.title)?this["display-name"]||"":this.title,action:this.action,accessroles:this.accessroles,shortcutkey:this.shortcutkey,disabled:this.disabled,tabindex:this.tabindex,icon:this.icon,position:this.position,widgetType:this["widget-type"],hyperlink:this.hyperlink,target:this.target||"",conditionalclass:this.conditionalclass||"",conditionalstyle:this.conditionalstyle||{}},this._propsInitialized=!0},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.populateAction(),this.table.registerActions(this.buttonDef)},t.prototype.onPropertyChange=function(e,t){this._propsInitialized&&("display-name"===e?this.buttonDef.displayName=t:this.buttonDef[e]=t)},t}(r.BaseComponent);U.initializeProps=V(),U.decorators=[{type:t.Directive,args:[{selector:"[wmTableAction]",providers:[r.provideAsWidgetRef(U)]}]}],U.ctorParameters=function(){return[{type:t.Injector},{type:S,decorators:[{type:t.Optional}]}]};var q=function(){r.register("wm-table-column",new Map([["accessroles",r.PROP_STRING],["autoclose",Object.assign({value:"outsideClick"},r.PROP_STRING)],["backgroundcolor",r.PROP_STRING],["binding",r.PROP_STRING],["caption",r.PROP_STRING],["checkedvalue",r.PROP_STRING],["col-class",r.PROP_STRING],["collapsible",r.PROP_BOOLEAN],["col-ng-class",r.PROP_STRING],["currencypattern",r.PROP_STRING],["customExpression",r.PROP_BOOLEAN],["dataentrymode",Object.assign({value:"default"},r.PROP_STRING)],["datafield",r.PROP_STRING],["dataoptions",r.PROP_ANY],["dataset",r.PROP_ANY],["datasource",r.PROP_STRING],["dateformat",r.PROP_STRING],["datepattern",r.PROP_STRING],["debouncetime",Object.assign({value:250},r.PROP_NUMBER)],["defaultvalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["displayfield",r.PROP_STRING],["displaylabel",r.PROP_STRING],["editdatepattern",r.PROP_STRING],["outputformat",r.PROP_STRING],["edit-widget-type",r.PROP_STRING],["editinputtype",r.PROP_STRING],["exportexpression",r.PROP_STRING],["filterdataset",r.PROP_STRING],["filterdatafield",r.PROP_STRING],["filterdisplayfield",r.PROP_STRING],["filterdisplaylabel",r.PROP_STRING],["filterexpressions",Object.assign({value:"{}"},r.PROP_STRING)],["filtersearchkey",r.PROP_STRING],["filter-on",r.PROP_STRING],["filteronfilter",r.PROP_STRING],["filterplaceholder",r.PROP_STRING],["filterwidget",r.PROP_STRING],["filterinputtype",r.PROP_STRING],["formatpattern",r.PROP_STRING],["custompipeformat",r.PROP_STRING],["fractionsize",r.PROP_STRING],["generator",r.PROP_STRING],["groupby",r.PROP_STRING],["limit",r.PROP_NUMBER],["match",r.PROP_STRING],["matchmode",r.PROP_STRING],["maxchars",r.PROP_NUMBER],["maxvalue",r.PROP_NUMBER],["step",r.PROP_NUMBER],["mobiledisplay",Object.assign({value:!0},r.PROP_BOOLEAN)],["minvalue",r.PROP_NUMBER],["maxdate",r.PROP_STRING],["mindate",r.PROP_STRING],["excludedays",r.PROP_STRING],["excludedates",r.PROP_STRING],["maxtime",r.PROP_STRING],["mintime",r.PROP_STRING],["pcdisplay",Object.assign({value:!0},r.PROP_BOOLEAN)],["period",r.PROP_BOOLEAN],["placeholder",r.PROP_STRING],["prefix",r.PROP_STRING],["primary-key",r.PROP_BOOLEAN],["readonly",r.PROP_BOOLEAN],["regexp",r.PROP_ANY],["related-entity-name",r.PROP_STRING],["required",r.PROP_BOOLEAN],["rowactionsposition",r.PROP_STRING],["searchkey",r.PROP_STRING],["searchable",Object.assign({value:!0},r.PROP_BOOLEAN)],["showinfilter",Object.assign({value:!1},r.PROP_BOOLEAN)],["suffix",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["showcount",r.PROP_BOOLEAN],["showdropdownon",Object.assign({value:"default"},r.PROP_STRING)],["sortable",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabletdisplay",Object.assign({value:!0},r.PROP_BOOLEAN)],["textalignment",Object.assign({value:"left"},r.PROP_STRING)],["textcolor",r.PROP_STRING],["type",Object.assign({value:"string"},r.PROP_STRING)],["uncheckedvalue",r.PROP_STRING],["validationmessage",r.PROP_STRING],["widget-type",r.PROP_STRING],["width",r.PROP_STRING]]))},z=function(){r.register("wm-table-column-group",new Map([["backgroundcolor",r.PROP_STRING],["caption",r.PROP_STRING],["col-class",r.PROP_STRING],["name",r.PROP_STRING],["textalignment",Object.assign({value:"center"},r.PROP_STRING)]]))},H={widgetType:"wm-table-column-group",hostClass:""},Y=function(e){function t(t,n,i){var o=e.call(this,t,H)||this;return o.group=n,o.table=i,o.config={},o}return g(t,e),t.prototype.populateConfig=function(){this.config={field:this.name,displayName:this.caption||"",columns:[],isGroup:!0,accessroles:this.accessroles,textAlignment:this.textalignment||"center",backgroundColor:this.backgroundcolor,class:this["col-class"]}},t.prototype.onPropertyChange=function(t,n,i){"caption"===t?(this.config.displayName=n||"",this.table.callDataGridMethod("setColumnProp",this.config.field,"displayName",n,!0)):e.prototype.onPropertyChange.call(this,t,n,i)},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.populateConfig();var t=parseInt(this.getAttr("headerIndex"),10),n=parseInt(this.getAttr("index"),10),i=this.group&&this.group.name;r.setHeaderConfigForTable(this.table.headerConfig,this.config,i,i?n:t)},t}(r.BaseComponent);Y.initializeProps=z(),Y.decorators=[{type:t.Directive,args:[{selector:"[wmTableColumnGroup]",providers:[r.provideAsWidgetRef(Y)]}]}],Y.ctorParameters=function(){return[{type:t.Injector},{type:Y,decorators:[{type:t.SkipSelf},{type:t.Optional}]},{type:S,decorators:[{type:t.Optional}]}]};var K={widgetType:"wm-table-column",hostClass:""},Q=["datafield","displayfield","placeholder","searchkey","matchmode","displaylabel","groupby","match","dateformat","showcount","collapsible","checkedvalue","uncheckedvalue","showdropdownon","dataentrymode","autoclose","dataset","outputformat"];Q=w(w([],b(Q)),b(["maxchars","regexp","minvalue","maxvalue","step","required","mindate","maxdate","excludedates","excludedays","mintime","maxtime"]));var Z=function(){function e(e){this.widget=e}return e.prototype.focus=function(){this.widget.focus()},e.prototype.setProperty=function(e,t){e="value"===e?"datavalue":e,this.widget[e]=t},e.prototype.getProperty=function(e){return e="value"===e?"datavalue":e,this.widget[e]},e}(),J=function(e){function t(t,n,i,o,a,r){var s=e.call(this,t,K)||this;return s.appDefaults=n,s.table=i,s.group=o,s.bindfilterdataset=a,s.binddataset=r,s.syncValidators=[],s.asyncValidators=[],s.observeOnFields=[],s.aggregate={sum:function(){return _.sum(s._getColumnData())},average:function(e){return void 0===e&&(e=2),_.round(_.mean(s._getColumnData()),e)},count:function(){return s._getColumnData().length},minimum:function(){return _.min(s._getColumnData())},maximum:function(){return _.max(s._getColumnData())},percent:function(e,t){return void 0===t&&(t=2),_.round(_.sum(s._getColumnData())/e*100,t)}},s.notifyForFields=[],s}return g(t,e),Object.defineProperty(t.prototype,"dataoptions",{get:function(){return this._dataoptions},set:function(e){this._dataoptions=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"datasource",{get:function(){return this._datasource},set:function(e){this._datasource=e},enumerable:!1,configurable:!0}),t.prototype.ngOnInit=function(){var t=this;e.prototype.ngOnInit.call(this),this.populateFieldDef();var n=parseInt(this.getAttr("index"),10),i=parseInt(this.getAttr("headerIndex"),10),o=this.group&&this.group.name;if(r.setHeaderConfigForTable(this.table.headerConfig,{field:this.field,displayName:this.displayName},o,o?n:i),this.table.registerColumns(this.widget,n),this._isRowFilter="multicolumn"===this.table.filtermode&&this.searchable,this._isInlineEditable=!this.readonly&&this.table.editmode!==r.EDIT_MODE.DIALOG&&this.table.editmode!==r.EDIT_MODE.FORM,this._isNewEditableRow=this._isInlineEditable&&this.table.editmode===r.EDIT_MODE.QUICK_EDIT&&this.table.shownewrow,this.setUpControls(),this._propsInitialized=!0,this.getFormControl()){var a=this.getFormControl().statusChanges.pipe(m.debounceTime(100)).subscribe((function(e){return t.onStatusChange(e,"inlineInstance")}));this.registerDestroyListener((function(){return a.unsubscribe()})),this.fieldValidations=new r.BaseFieldValidations(this,this.inlineInstance,this.editWidgetType,this.getFormControl(),this.table,"inlineInstance")}if(this._checkNewEditableRowControl()){var s=this.getFormControl("_new").statusChanges.pipe(m.debounceTime(100)).subscribe((function(e){return t.onStatusChange(e,"inlineInstanceNew")}));this.registerDestroyListener((function(){return s.unsubscribe()})),this.fieldValidations_new=new r.BaseFieldValidations(this,this.inlineInstanceNew,this.editWidgetType,this.getFormControl("_new"),this.table,"inlineInstanceNew")}},t.prototype.ngAfterContentInit=function(){var t=this;if(this._isRowFilter){var n=this._filterInstances.changes.subscribe((function(e){t.filterInstance=e.first&&e.first.widget,t.setUpFilterWidget()}));this.registerDestroyListener((function(){return n.unsubscribe()}))}if(this._isInlineEditable){var i=this._inlineInstances.changes.subscribe((function(e){t.inlineInstance=e.first&&e.first.widget,t.fieldValidations.formwidget=e.first,t.table.registerFormField(t.binding,new Z(t.inlineInstance)),t.setUpInlineWidget("inlineInstance")}));if(this.registerDestroyListener((function(){return i.unsubscribe()})),this._isNewEditableRow){var o=this._inlineInstancesNew.changes.subscribe((function(e){t.inlineInstanceNew=e.first&&e.first.widget,t.fieldValidations_new.formwidget=e.first,t.setUpInlineWidget("inlineInstanceNew")}));this.registerDestroyListener((function(){return o.unsubscribe()}))}}this.registerReadyStateListener((function(){t.key=t.field||t.binding})),e.prototype.ngAfterContentInit.call(this),this.table.isdynamictable&&this.table.inlineWidgetTmpl._results.push(this.inlineWidthTempRef)},t.prototype.ngAfterViewInit=function(){this.filterTemplateRef&&this.table.renderDynamicFilterColumn(this.filterTemplateRef)},t.prototype.applyValidations=function(){this.getFormControl()&&(this.syncValidators.length>0&&this.fieldValidations.setValidators(this.syncValidators),this.fieldValidations.setUpValidators(),this.asyncValidators.length>0&&this.fieldValidations.setAsyncValidators(this.asyncValidators),this.observeOnFields.length>0&&this.fieldValidations.observeOn(this.observeOnFields,"columns"))},t.prototype.removeValidations=function(){this.table.ngform.markAsUntouched();var e=this.getFormControl();e&&(e.clearValidators(),e.clearAsyncValidators(),e.updateValueAndValidity())},t.prototype.applyNewRowValidations=function(){this._checkNewEditableRowControl()&&(this.syncValidators.length>0&&this.fieldValidations_new.setValidators(this.syncValidators),this.fieldValidations_new.setUpValidators(),this.asyncValidators.length>0&&this.fieldValidations_new.setAsyncValidators(this.asyncValidators),this.observeOnFields.length>0&&this.fieldValidations_new.observeOn(this.observeOnFields,"columns"))},t.prototype.removeNewRowValidations=function(){if(this.table.ngform.markAsUntouched(),this._checkNewEditableRowControl()){var e=this.getFormControl("_new");e.clearValidators(),e.clearAsyncValidators(),e.updateValueAndValidity()}},t.prototype.addFormControl=function(e){var t=e?this.binding+e:this.binding;this.table.ngform.addControl(t,this.table.fb.control(""))},t.prototype.getFormControl=function(e){var t=e?this.binding+e:this.binding;return this.table.ngform.controls[t]},t.prototype._checkNewEditableRowControl=function(){return this._isNewEditableRow&&this.getFormControl("_new")},t.prototype.setUpControls=function(){var e=this;if(this._isInlineEditable){if(this.editWidgetType===u.FormWidgetType.UPLOAD)return;this.addFormControl();var t=this.getFormControl();if(t){var n=t.valueChanges.pipe(m.debounceTime(200)).subscribe((function(t){return e.onValueChange(t,"inlineInstance")}));this.registerDestroyListener((function(){return n.unsubscribe()}))}if(this._isNewEditableRow){this.addFormControl("_new");var i=this.getFormControl("_new");if(i){var o=i.valueChanges.pipe(m.debounceTime(200)).subscribe((function(t){return e.onValueChange(t,"inlineInstanceNew")}));this.registerDestroyListener((function(){return o.unsubscribe()}))}}}if(this._isRowFilter&&(this.addFormControl("_filter"),this.filterControl=this.getFormControl("_filter"),this.filterControl)){var a=this.filterControl.valueChanges.subscribe(this.onFilterValueChange.bind(this));this.registerDestroyListener((function(){return a.unsubscribe()}))}},t.prototype.resetFilter=function(){this.filterControl&&this.filterControl.setValue(""),this.filterwidget===u.FormWidgetType.AUTOCOMPLETE&&(this.filterInstance.query="",this.filterInstance.queryModel="")},t.prototype.onFilterValueChange=function(e){this.table.rowFilter[this.field].value=e},Object.defineProperty(t.prototype,"datavalue",{get:function(){return this[this.activeControlType]&&this[this.activeControlType].datavalue},set:function(e){var t=this.getFormControl("inlineInstanceNew"===this.activeControlType?"_new":void 0);t&&t&&this.editWidgetType!==u.FormWidgetType.UPLOAD&&t.setValue(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.datavalue},set:function(e){this.datavalue=e},enumerable:!1,configurable:!0}),t.prototype.onValueChange=function(e,t){null!==e&&r.applyFilterOnField(this.table.datasource,this.widget,this.table.fieldDefs,e,{widget:"edit-widget-type"}),this.table.ngform.touched&&(this.activeControlType=t,"inlineInstance"===t?(this.notifyChanges(),this.fieldValidations.setCustomValidationMessage()):this._isNewEditableRow&&(this.notifyChanges("_new"),this.fieldValidations_new.setCustomValidationMessage()))},t.prototype.loadFilterData=function(){var e=this;this._isRowFilter&&r.isDataSetWidget(this.filterwidget)&&!this.bindfilterdataset&&(this.table.datasource.execute(u.DataSource.Operation.SUPPORTS_DISTINCT_API)?(this.relatedEntityName&&(this.widget["is-related"]=!0,this.widget["lookup-type"]=this.relatedEntityName,this.widget["lookup-field"]=_.last(_.split(this.field,"."))),this.filterwidget===u.FormWidgetType.AUTOCOMPLETE?(this.filterInstance.dataoptions=r.getDistinctFieldProperties(this.table.datasource,this),this.filterInstance.datasource=this.table.datasource):r.getDistinctValues(this.table.datasource,this.widget,"filterwidget").then((function(t){e._filterDataSet=t.data,e.setFilterWidgetDataSet()}))):this.registerDestroyListener(u.$watch(this.table.binddataset,this.viewParent,{},(function(t){return e.widget.filterdataset=t}),r.getWatchIdentifier(this.widgetId,"filterdataset"))))},t.prototype.loadInlineWidgetData=function(){if(r.isDataSetWidget(this["edit-widget-type"])&&!this.binddataset&&!this.readonly){var e=this.table.datasource;if(this["related-entity-name"]&&this["primary-key"]){this.isDataSetBound=!0;var t=_.split(this.binding,".");this.showPendingSpinner=!0,r.fetchRelatedFieldData(e,this.widget,{relatedField:_.head(t),datafield:_.last(t),widget:"edit-widget-type"})}else e.execute(u.DataSource.Operation.SUPPORTS_DISTINCT_API)&&r.getDistinctValuesForField(e,this.widget,{widget:"edit-widget-type"})}},t.prototype.onDataSourceChange=function(){this.loadFilterData(),this.table.editmode===r.EDIT_MODE.QUICK_EDIT&&this.loadInlineWidgetData()},t.prototype.setFilterWidgetDataSet=function(){this.filterInstance&&(this.filterInstance.dataset=this._filterDataSet)},t.prototype.setUpFilterWidget=function(){var e=this;this.filterInstance.registerReadyStateListener((function(){if(r.isDataSetWidget(e.filterwidget)){var t=_.last(e.binding.split("."));e.filterInstance.dataset=e._filterDataSet,e.filterInstance.datafield=e.filterdatafield||t,e.filterInstance.displayfield=e.filterdisplayfield||t,e.filterwidget===u.FormWidgetType.AUTOCOMPLETE&&(e.filterInstance.displaylabel=e.filterdisplaylabel||t,e.filterInstance.searchkey=e.filtersearchkey||t)}e.filterwidget===u.FormWidgetType.TIME&&(e.filterInstance.timepattern=e.appDefaults.timeFormat||"hh:mm:ss a"),e.filterInstance.placeholder=e.filterplaceholder||""}))},t.prototype.notifyChanges=function(e){var t=this;_.forEach(this.notifyForFields,(function(n){e&&t._isNewEditableRow?n.fieldValidations_new.validate():n.fieldValidations.validate()}))},t.prototype.observeOn=function(e){this.observeOnFields=_.cloneDeep(e)},t.prototype.setUpValidators=function(){this.fieldValidations.setUpValidators(),this._checkNewEditableRowControl()&&this.fieldValidations_new.setUpValidators()},t.prototype.setAsyncValidators=function(e){this.asyncValidators=_.cloneDeep(e)},t.prototype.setValidators=function(e){this.syncValidators=_.cloneDeep(e)},t.prototype.boundFn=function(e){return e()},t.prototype.onStatusChange=function(e,t){this["showPendingSpinner"+("inlineInstance"===t?"":"New")]="PENDING"===e},t.prototype.setSummaryRowData=function(e){var t=e instanceof Array?e:[e];this._invokeSummaryRowData(t)},t.prototype._invokeSummaryRowData=function(e){var t=this;_.forEach(e,(function(e,n){var i=e;if(i instanceof Promise)i.then((function(e){t.table.callDataGridMethod("setSummaryRowDef",t.key,e,n,!0)}));else if(i.value&&i.value instanceof Promise){var o=i;i.value.then((function(e){o.value=e,t.table.callDataGridMethod("setSummaryRowDef",t.key,o,n,!0)}))}t.table.callDataGridMethod("setSummaryRowDef",t.key,i,n)}))},t.prototype._getColumnData=function(){return _.map(this.table.dataset,this.binding)},t.prototype.setInlineWidgetProp=function(e,t,n){"datepattern"===t&&this.editWidgetType===u.FormWidgetType.TIME&&(t="timepattern"),this[e]&&u.isDefined(n)&&(this[e][t]=n)},t.prototype.setUpInlineWidget=function(e){var t=this;this[e].registerReadyStateListener((function(){r.isDataSetWidget(t["edit-widget-type"])&&(t[e].dataset=t.dataset),Q.forEach((function(n){t.setInlineWidgetProp(e,n,t[n])})),t[e].datasource=t._datasource,t[e].dataoptions=t._dataoptions,t.setInlineWidgetProp(e,"datepattern",t.editdatepattern)}))},t.prototype.getStyleDef=function(){return"width: "+(this.width||"")+"; background-color: "+(this.backgroundcolor||"")+"; color: "+(this.textcolor||"")+";"},t.prototype.populateFieldDef=function(){if(this.width="px"===this.width?"":this.width||"",this.field=this.binding,this.displayName=this.caption||"",this.pcDisplay=this.pcdisplay,this.mobileDisplay=this.mobiledisplay,this.tabletDisplay=this.tabletdisplay,this.textAlignment=this.textalignment,this.backgroundColor=this.backgroundcolor,this.textColor=this.textcolor,this.primaryKey=this["primary-key"],this.relatedEntityName=this["related-entity-name"],this.style=this.getStyleDef(),this.class=this["col-class"],this.ngclass=this["col-ng-class"],this.formatpattern="toNumber"===this.formatpattern?"numberToString":this.formatpattern,this.searchable="blob"!==this.type&&"clob"!==this.type&&this.searchable,this.showinfilter=!this.nativeElement.hasAttribute("showinfilter")||this.table&&this.table.isdynamictable?this.show:this.nativeElement.getAttribute("showinfilter"),this.limit=this.limit?+this.limit:void 0,this.editWidgetType=this["edit-widget-type"]=this["edit-widget-type"]||r.getEditModeWidget(this),this.filterOn=this["filter-on"],this.readonly=u.isDefined(this.getAttr("readonly"))?"true"===this.getAttr("readonly"):this["related-entity-name"]?!this["primary-key"]:_.includes(["identity","uniqueid","sequence"],this.generator),this.filterwidget=this.filterwidget||r.getDataTableFilterWidget(this.type||"string"),this.isFilterDataSetBound=!!this.bindfilterdataset,this.defaultvalue=r.getDefaultValue(this.defaultvalue,this.type,this.editWidgetType),u.isDateTimeType(this.type)&&"toDate"===this.formatpattern&&!this.datepattern){var e=u.getDisplayDateTimeFormat(this.type);this.type===u.DataType.DATE?this.datepattern=this.appDefaults.dateFormat||e:this.type===u.DataType.TIME?this.datepattern=this.appDefaults.timeFormat||e:this.type!==u.DataType.TIMESTAMP&&this.type!==u.DataType.DATETIME||(this.datepattern=this.appDefaults.dateTimeFormat||e)}},t.prototype.onPropertyChange=function(t,n,i){if(this._propsInitialized){switch(t){case"caption":this.displayName=n||"",this.setProperty("displayName",this.displayName);break;case"defaultvalue":this.defaultvalue=r.getDefaultValue(this.defaultvalue,this.type,this.editWidgetType);break;case"show":this.table.redraw(!0),this.showinfilter=this.nativeElement.hasAttribute("showinfilter")?this.nativeElement.getAttribute("showinfilter"):n;break;case"filterdataset":this._filterDataSet=n,this.setFilterWidgetDataSet();break;case"editdatepattern":this.setInlineWidgetProp("inlineInstance","datepattern",n),this.setInlineWidgetProp("inlineInstanceNew","datepattern",n);break;case"showinfilter":this.showinfilter=n;break;default:Q.includes(t)&&(this.setInlineWidgetProp("inlineInstance",t,n),this.setInlineWidgetProp("inlineInstanceNew",t,n))}e.prototype.onPropertyChange.call(this,t,n,i)}},t.prototype.setProperty=function(e,t){switch(this[e]=t,e){case"displayName":this.table.callDataGridMethod("setColumnProp",this.field,e,t);break;default:this.table.redraw(!0)}},t}(r.BaseComponent);J.initializeProps=q(),J.decorators=[{type:t.Directive,args:[{selector:"[wmTableColumn]",providers:[r.provideAsWidgetRef(J)]}]}],J.ctorParameters=function(){return[{type:t.Injector},{type:u.AppDefaults},{type:S,decorators:[{type:t.Optional}]},{type:Y,decorators:[{type:t.Optional}]},{type:void 0,decorators:[{type:t.Attribute,args:["filterdataset.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["dataset.bind"]}]}]},J.propDecorators={_filterInstances:[{type:t.ContentChildren,args:["filterWidget"]}],_inlineInstances:[{type:t.ContentChildren,args:["inlineWidget"]}],_inlineInstancesNew:[{type:t.ContentChildren,args:["inlineWidgetNew"]}],customExprTmpl:[{type:t.ContentChild,args:["customExprTmpl"]}],inlineWidthTempRef:[{type:t.ContentChild,args:["inlineWidgetTmpl"]}],filterTemplateRef:[{type:t.ContentChild,args:["filterTmpl"]}]};var X=function(){r.register("wm-table-row",new Map([["class",r.PROP_STRING],["closeothers",Object.assign({value:!0},r.PROP_BOOLEAN)],["content",r.PROP_STRING],["columnwidth",Object.assign({value:"30px"},r.PROP_STRING)],["collapseicon",r.PROP_STRING],["expandicon",r.PROP_STRING],["height",r.PROP_STRING],["position",Object.assign({value:"0"},r.PROP_STRING)]]))},ee={widgetType:"wm-table-row",hostClass:""},te=function(e){function t(t,n){var i=e.call(this,t,ee)||this;return i.table=n,i}return g(t,e),t.prototype.populateConfig=function(){this.config={closeothers:this.closeothers,content:this.content,columnwidth:this.columnwidth,expandicon:this.expandicon,collapseicon:this.collapseicon,height:this.height,position:this.position}},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.populateConfig(),this.table.registerRow(this.config,this)},t.prototype.onPropertyChange=function(e,t){"content"===e&&this.config&&(this.config.content=this.content)},t}(r.BaseComponent);te.initializeProps=X(),te.decorators=[{type:t.Directive,args:[{selector:"[wmTableRow]",providers:[r.provideAsWidgetRef(te)]}]}],te.ctorParameters=function(){return[{type:t.Injector},{type:S,decorators:[{type:t.Optional},{type:t.SkipSelf}]}]};var ne=function(){r.register("wm-table-row-action",new Map([["accessroles",r.PROP_STRING],["action",r.PROP_STRING],["caption",r.PROP_STRING],["class ",Object.assign({value:"btn-secondary"},r.PROP_STRING)],["disabled",Object.assign({value:!1},r.PROP_BOOLEAN)],["display-name",r.PROP_STRING],["hyperlink",r.PROP_STRING],["iconclass",r.PROP_STRING],["key",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["target",r.PROP_STRING],["title",r.PROP_STRING],["widget-type",Object.assign({value:"button"},r.PROP_STRING)]]))},ie={widgetType:"wm-table-row-action",hostClass:""},oe=function(e){function t(t,n,i){var o=e.call(this,t,ie)||this;return o.table=n,i[0].editRow=function(e){return o.table.editRow(e)},i[0].deleteRow=function(e){return o.table.deleteRow(e)},i[0].addNewRow=function(e){return o.table.addNewRow(e)},o}return g(t,e),t.prototype.getTitle=function(){return _.isUndefined(this.title)?this["display-name"]||"":this.title},t.prototype.populateAction=function(){this.buttonDef={key:this.key,displayName:this["display-name"]||this.caption||"",show:this.show,class:this.class||"",iconclass:this.iconclass||"",title:this.getTitle(),action:this.action,accessroles:this.accessroles,disabled:this.disabled,tabindex:this.tabindex?+this.tabindex:void 0,widgetType:this["widget-type"]||"button",hyperlink:this.hyperlink,target:this.target||"",conditionalclass:this.conditionalclass||"",conditionalstyle:this.conditionalstyle||{}}},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.populateAction(),this.table.registerRowActions(this.buttonDef)},t}(r.BaseComponent);oe.initializeProps=ne(),oe.decorators=[{type:t.Directive,args:[{selector:"[wmTableRowAction]",providers:[r.provideAsWidgetRef(oe),{provide:r.Context,useValue:{},multi:!0}]}]}],oe.ctorParameters=function(){return[{type:t.Injector},{type:S,decorators:[{type:t.Optional}]},{type:Array,decorators:[{type:t.Self},{type:t.Inject,args:[r.Context]}]}]};var ae=[S,x,G,U,J,Y,te,oe],re=function(){};re.decorators=[{type:t.NgModule,args:[{imports:[s.BasicModule,a.BsDropdownModule,n.CommonModule,i.FormsModule,i.ReactiveFormsModule,l.InputModule,p.ListModule,c.MenuModule,d.PaginationModule,o.TooltipModule,r.WmComponentsModule],declarations:w([],b(ae)),exports:w([],b(ae)),entryComponents:[]}]}],e.TableActionDirective=U,e.TableCUDDirective=x,e.TableColumnDirective=J,e.TableColumnGroupDirective=Y,e.TableComponent=S,e.TableFilterSortDirective=G,e.TableModule=re,e.TableRowActionDirective=oe,e.TableRowDirective=te,e["\u0275a"]=P,e["\u0275b"]=V,e["\u0275c"]=z,e["\u0275d"]=q,e["\u0275e"]=X,e["\u0275f"]=ne,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@wm/components/base"),require("rxjs/operators"),require("@wm/core"),require("@wm/components/data/table")):"function"==typeof define&&define.amd?define("@wm/components/data/live-table",["exports","@angular/core","@angular/common","@wm/components/base","rxjs/operators","@wm/core","@wm/components/data/table"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.data=e.wm.components.data||{},e.wm.components.data.livetable={}),e.ng.core,e.ng.common,e.wm.components.base,e.rxjs.operators,e.wm.core,e.wm.components.data.table)}(this,(function(e,t,n,i,o,a,r){"use strict";
520
+ ***************************************************************************** */var f=function(e,t){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function g(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}f(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function v(e,t,n,i){return new(n||(n=Promise))((function(o,a){function r(e){try{l(i.next(e))}catch(e){a(e)}}function s(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}))}function y(e,t){var n,i,o,a,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],i=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}Object.create;function b(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,a=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return r}function w(e,t,n){if(n||2===arguments.length)for(var i,o=0,a=t.length;o<a;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var P=function(){r.register("wm-table",new Map([["boundarylinks",Object.assign({value:!1},r.PROP_BOOLEAN)],["class",r.PROP_STRING],["confirmdelete",Object.assign({value:"Are you sure you want to delete this?"},r.PROP_STRING)],["datasource",r.PROP_STRING],["dataset",r.PROP_ANY],["deletecanceltext",r.PROP_STRING],["deleteoktext",r.PROP_STRING],["deletemessage",Object.assign({value:"Record deleted successfully"},r.PROP_STRING)],["directionlinks",Object.assign({value:!0},r.PROP_BOOLEAN)],["editmode",r.PROP_STRING],["errorstyle",Object.assign({value:"hover"},r.PROP_STRING)],["enablecolumnselection",Object.assign({value:!1},r.PROP_BOOLEAN)],["enablesort",Object.assign({value:!0},r.PROP_BOOLEAN)],["errormessage",r.PROP_STRING],["exportformat",r.PROP_STRING],["exportdatasize",Object.assign({value:100},r.PROP_NUMBER)],["filtermode",r.PROP_STRING],["filternullrecords",Object.assign({value:!0},r.PROP_BOOLEAN)],["forceellipses",Object.assign({value:!0},r.PROP_BOOLEAN)],["formposition",r.PROP_STRING],["gridclass",Object.assign({value:"table-hover"},r.PROP_STRING)],["gridfirstrowselect",r.PROP_BOOLEAN],["iconclass",r.PROP_STRING],["insertmessage",Object.assign({value:"Record added successfully"},r.PROP_STRING)],["isdynamictable",r.PROP_BOOLEAN],["isrowexpansionenabled",r.PROP_BOOLEAN],["loadingdatamsg",Object.assign({value:"Loading..."},r.PROP_STRING)],["loadingicon",Object.assign({value:"fa fa-circle-o-notch fa-spin"},r.PROP_STRING)],["maxsize",Object.assign({value:5},r.PROP_NUMBER)],["multiselect",r.PROP_BOOLEAN],["name",r.PROP_STRING],["navigation",Object.assign({value:"Basic"},r.PROP_STRING)],["navigationalign",Object.assign({value:"left"},r.PROP_STRING)],["nodatamessage",Object.assign({value:"No data found."},r.PROP_STRING)],["ondemandmessage",Object.assign({value:"Load More"},r.PROP_STRING)],["pagesize",r.PROP_NUMBER],["radioselect",r.PROP_BOOLEAN],["rowclass",r.PROP_STRING],["rowngclass",r.PROP_STRING],["searchlabel",Object.assign({value:"Search"},r.PROP_STRING)],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["showheader",Object.assign({value:!0},r.PROP_BOOLEAN)],["shownewrow",Object.assign({value:!0},r.PROP_BOOLEAN)],["showrecordcount",r.PROP_BOOLEAN],["showrowindex",r.PROP_BOOLEAN],["spacing",Object.assign({value:"normal"},r.PROP_STRING)],["statehandler",Object.assign({value:"none"},r.PROP_STRING)],["subheading",r.PROP_STRING],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["title",r.PROP_STRING],["updatemessage",Object.assign({value:"Record updated successfully"},r.PROP_STRING)]]))},O={widgetType:"wm-table",hostClass:"app-grid app-panel panel"},E={EXCEL:"fa fa-file-excel-o",CSV:"fa fa-file-text-o"},R="rowOperations",A=function(){},T=function(e){var t=!1;[".dropdown-menu",".uib-typeahead-match",".modal-dialog",".toast"].forEach((function(n){if(e.closest(n).length)return t=!0,!1}));return t||["bsdatepickerdaydecorator"].forEach((function(n){if(e[0].hasAttribute(n))return t=!0,!1})),t},S=function(e){function t(t,n,i,o,a,s,l,c,p,d,f,g,v){var y=e.call(this,t,O)||this;return y.inj=t,y.fb=n,y.app=i,y.dynamicComponentProvider=o,y.statePersistence=a,y.paginationService=s,y.viewport=l,y.parentList=c,y.binddataset=p,y.binddatasource=d,y.readonlygrid=f,y.ngZone=g,y.trustAsPipe=v,y.rowActionsCompiledTl={},y.rowFilterCompliedTl={},y.inlineCompliedTl={},y.inlineNewCompliedTl={},y.customExprCompiledTl={},y.customExprCompiledSummaryTl={},y.rowDefInstances={},y.rowDefMap={},y.rowExpansionActionTl={},y.columns={},y.formfields={},y.enablesort=!0,y.primaryKey=[],y.selectedItems=[],y.selectedItemChange=new h.Subject,y.selectedItemChange$=y.selectedItemChange.asObservable(),y.actions=[],y._actions={header:[],footer:[]},y.exportOptions=[],y.headerConfig=[],y.items=[],y.rowActions=[],y.shownavigation=!1,y.documentClickBind=A,y.prevFilterExpression=[],y.fieldDefs=[],y.rowDef={},y.rowInstance={},y.fullFieldDefs=[],y.variableInflight=!0,y.applyProps=new Map,y.redraw=_.debounce(y._redraw,150),y.debouncedHandleLoading=_.debounce(y.handleLoading,350),y.rowFilter={},y._searchSortHandler=A,y.searchSortHandler=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];y._searchSortHandler.apply(y,e)},y.onRowFilterChange=A,y.onFilterConditionSelect=A,y.showClearIcon=A,y.clearRowFilter=A,y.adjustContainer=A,y._pageLoad=!0,y.gridOptions={data:[],colDefs:[],startRowIndex:1,sortInfo:{field:"",direction:""},filtermode:"",searchLabel:"",rowActions:[],headerConfig:[],rowClass:"",editmode:"",formPosition:"",isMobile:!1,rowExpansionEnabled:!1,rowDef:{position:"0"},name:"",messages:{selectField:"Select Field"},securityUtils:{pipeTransform:{}},navigation:"",isdynamictable:"",deletedRowIndex:-1,lastActionPerformed:"scroll",isSearchTrigerred:!1,isDatasetUpdated:!1,isDataUpdatedByUser:!1,isNextPageData:void 0,ACTIONS:{DELETE:"delete",EDIT:"edit",SEARCH_OR_SORT:"search_or_sort",DEFAULT:"scroll",FILTER_CRITERIA:"filter",DATASET_UPDATE:"dataset_update"},actionRowIndex:void 0,actionRowPage:void 0,isLastPage:!1,getCurrentPage:function(){return _.get(y.dataNavigator,"dn.currentPage")||1},setCurrentPage:function(e){_.set(y.dataNavigator,"dn.currentPage",e||1)},getDataSource:function(){return y.datasource},getPageSize:function(){return y.pagesize},setDeletedRowIndex:function(e){y.setDataGridOption("deletedRowIndex",e)},setLastActionPerformed:function(e){y.setDataGridOption("lastActionPerformed",e||y.gridOptions.lastActionPerformed)},isNavTypeScrollOrOndemand:function(){return"Scroll"===y.gridOptions.navigation||"On-Demand"===y.gridOptions.navigation},setIsSearchTrigerred:function(e){y.setDataGridOption("isSearchTrigerred",e)},setIsDatasetUpdated:function(e){y.setDataGridOption("isDatasetUpdated",e)},setIsNextPageData:function(e){y.setDataGridOption("isNextPageData",e)},setIsDataUpdatedByUser:function(e){y.setDataGridOption("isDataUpdatedByUser",e)},onDataRender:function(){y.ngZone.run((function(){y.gridData.length&&y.invokeEventCallback("datarender",{$data:y.gridData,data:y.gridData}),y.multiselect||(y.items.length=0),y.callDataGridMethod("selectRows",y.items),y.selectedItems=y.callDataGridMethod("getSelectedRows"),y.selectedItemChange.next(y.selectedItems),y._isPageSearch&&y.filterInfo&&y.searchSortHandler(y.filterInfo,void 0,"search")}))},onRowSelect:function(e,t){y.ngZone.run((function(){y.selectedItems=y.callDataGridMethod("getSelectedRows"),y.selectedItemChange.next(y.selectedItems);var n=y.addRowIndex(e);if(n.$index&&"none"!==y.getConfiguredState()&&y.dataNavigator&&r.unsupportedStatePersistenceTypes.indexOf(y.navigation)<0){var i={page:y.dataNavigator.dn.currentPage,index:n.$index-1},o=y.statePersistence.getWidgetState(y);_.get(o,"selectedItem")&&y.multiselect?(_.some(o.selectedItem,i)||o.selectedItem.push(i),y.statePersistence.setWidgetState(y,{selectedItem:o.selectedItem})):y.statePersistence.setWidgetState(y,{selectedItem:[i]})}else console.warn("Retain State handling on Widget "+y.name+" is not supported for current pagination type.");y.invokeEventCallback("rowselect",{$data:n,$event:t,row:n})}))},assignSelectedItems:function(e,t){y.ngZone.run((function(){y.multiselect?-1===_.findIndex(y.items,e)&&y.items.push(e):(y.items.length=0,y.items.push(e))}))},onRowDblClick:function(e,t){var n=y.addRowIndex(e);y.invokeEventCallback("rowdblclick",{$data:n,$event:t,row:n})},onRowDeselect:function(e,t){y.multiselect&&y.ngZone.run((function(){y.items=_.pullAllWith(y.items,[e],_.isEqual),y.selectedItems=y.callDataGridMethod("getSelectedRows"),y.invokeEventCallback("rowdeselect",{$data:e,$event:t,row:e});var n=y.addRowIndex(e);if("none"!==y.getConfiguredState()&&r.unsupportedStatePersistenceTypes.indexOf(y.navigation)<0){var i={page:y.dataNavigator.dn.currentPage,index:n.$index-1},o=y.statePersistence.getWidgetState(y);_.get(o,"selectedItem")&&(_.remove(o.selectedItem,(function(e){return _.isEqual(e,i)})),y.statePersistence.removeWidgetState(y,"selectedItem"),o.selectedItem.length>0&&y.statePersistence.setWidgetState(y,{selectedItem:o.selectedItem}))}else console.warn("Retain State handling on Widget "+y.name+" is not supported for current pagination type.")}))},callOnRowDeselectEvent:function(e,t){y.items=y.selectedItems=y.callDataGridMethod("getSelectedRows"),y.invokeEventCallback("rowdeselect",{$data:e,$event:t,row:e})},callOnRowClickEvent:function(e,t){y.ngZone.run((function(){if(t&&t.hasOwnProperty("originalEvent")){var n=y.addRowIndex(e);y.invokeEventCallback("rowclick",{$data:n,$event:t,row:n})}}))},closePopover:u.closePopover,onColumnSelect:function(e,t){y.selectedColumns=y.callDataGridMethod("getSelectedColumns"),y.invokeEventCallback("columnselect",{$data:e,$event:t})},onColumnDeselect:function(e,t){y.selectedColumns=y.callDataGridMethod("getSelectedColumns"),y.invokeEventCallback("columndeselect",{$data:e,$event:t})},onHeaderClick:function(e,t){y.invokeEventCallback("headerclick",{$event:t,$data:e,column:e})},onRowDelete:function(e,t,n,i,o){y.ngZone.run((function(){y.deleteRecord(_.extend({},o,{row:e,cancelRowDeleteCallback:t,evt:n,callBack:i}))}))},onRowInsert:function(e,t,n,i){y.insertRecord(_.extend({},i,{row:e,event:t,callBack:n}))},beforeRowUpdate:function(e,t){y._liveTableParent&&y._liveTableParent.updateRow(e,t),y.prevData=u.getClonedObject(e)},afterRowUpdate:function(e,t,n,i){y.updateRecord(_.extend({},i,{row:e,prevData:y.prevData,event:t,callBack:n}))},onBeforeRowUpdate:function(e,t,n){return y.invokeEventCallback("beforerowupdate",{$event:t,$data:e,row:e,options:n})},onBeforeRowInsert:function(e,t,n){return y.invokeEventCallback("beforerowinsert",{$event:t,$data:e,row:e,options:n})},onBeforeRowDelete:function(e,t,n){var i=y.addRowIndex(e);return y.invokeEventCallback("beforerowdelete",{$event:t,row:i,options:n})},onFormRender:function(e,t,n,i){var o=i?"inlineInstanceNew":"inlineInstance";setTimeout((function(){y.formWidgets={},y.fieldDefs.forEach((function(e){e[o]&&(y.formWidgets[e.field]=e[o],e[o].context&&(e[o].context.formWidgets=y.formWidgets),y.setDisabledOnField(n,e,o))})),y.invokeEventCallback("formrender",{$event:t,formWidgets:y.formWidgets,$operation:n})}),250)},onBeforeFormRender:function(e,t,n){return y.invokeEventCallback("beforeformrender",{$event:t,row:e,$operation:n})},registerRowNgClassWatcher:function(e,t){if(y.rowngclass){var n=y.getClonedRowObject(e),i=y.widgetId+"_rowNgClass_"+t;u.$unwatch(i),y.registerDestroyListener(u.$watch(y.rowngclass,y.viewParent,{row:n},(function(e,n){y.callDataGridMethod("applyRowNgClass",r.getConditionalClasses(e,n),t)}),i))}},registerColNgClassWatcher:function(e,t,n,i){if(t["col-ng-class"]){var o=y.getClonedRowObject(e),a=y.widgetId+"_colNgClass_"+n+"_"+i;u.$unwatch(a),y.registerDestroyListener(u.$watch(t["col-ng-class"],y.viewParent,{row:o},(function(e,t){y.callDataGridMethod("applyColNgClass",r.getConditionalClasses(e,t),n,i)}),a))}},clearCustomExpression:function(){y.customExprViewRef.clear(),y.customExprCompiledTl={},y.customExprCompiledSummaryTl={}},clearRowDetailExpression:function(){y.rowDetailViewRef.clear(),y.rowDefMap={},y.rowDefInstances={}},generateCustomExpressions:function(e,t,n){var i=y.getClonedRowObject(e),o=function(e){if(e){var o={},a={row:i,colDef:o};y.addEventsToContext(a);var r=y.customExprViewRef.createEmbeddedView(e,a).rootNodes[0],s=r.getAttribute("data-col-identifier");_.extend(o,y.columns[s]),n?y.customExprCompiledSummaryTl[s+t]=r:y.customExprCompiledTl[s+t]=r}};y.isdynamictable?y.fieldDefs.forEach((function(e){o(e.customExprTmpl)})):y.customExprTmpl.forEach(o.bind(y))},generateRowExpansionCell:function(e,t){var n=y.getClonedRowObject(e);y.rowExpansionActionTmpl.forEach((function(e){y.rowExpansionActionTl[t]=y.rowExpansionActionViewRef.createEmbeddedView(e,{row:n}).rootNodes}))},getRowExpansionAction:function(e){return y.rowExpansionActionTl[e]},generateRowDetailView:function(e,t,n,i,o,a){var r=y.getClonedRowObject(t),s=u.getClonedObject(y.rowDef);if(!1!==y.rowInstance.invokeEventCallback("beforerowexpand",{$event:e,$data:s,row:r})&&s.content)if(a(),y.rowDefMap[n]&&y.rowDefMap[n].content===s.content)y.rowInstance.invokeEventCallback("rowexpand",{$event:e,row:r,$data:y.rowDefInstances[n]});else{y.rowDefMap[n]=s,i.empty(),i.hide(),o.show();var l={row:r,rowDef:s,containerLoad:function(t){setTimeout((function(){o.hide(),i.show(),y.rowDefInstances[n]=t,y.rowInstance.invokeEventCallback("rowexpand",{$event:e,row:r,$data:t})}),500)}},c=y.rowDetailViewRef.createEmbeddedView(y.rowExpansionTmpl,l).rootNodes[0];i[0].appendChild(c),u.$appDigest()}},onBeforeRowCollapse:function(e,t,n){return y.rowInstance.invokeEventCallback("beforerowcollapse",{$event:e,row:t,$data:y.rowDefInstances[n]})},onRowCollapse:function(e,t){y.rowInstance.invokeEventCallback("rowcollapse",{$event:e,row:t})},getCustomExpression:function(e,t,n){return(n?y.customExprCompiledSummaryTl[e+t]:y.customExprCompiledTl[e+t])||""},clearRowActions:function(){y.rowActionsViewRef.clear(),y.rowActionsCompiledTl={},y.rowExpansionActionViewRef.clear(),y.rowExpansionActionTl={}},generateRowActions:function(e,t){var n=y.getClonedRowObject(e);y.rowActionsCompiledTl[t]=[],y.rowActionTmpl.forEach((function(e){var i;(i=y.rowActionsCompiledTl[t]).push.apply(i,w([],b(y.rowActionsViewRef.createEmbeddedView(e,{row:n}).rootNodes)))}))},getRowAction:function(e){return y.rowActionsCompiledTl[e]},generateInlineEditRow:function(e,t){var n=y.getClonedRowObject(e);if(t)return y.inlineEditNewViewRef.clear(),y.inlineNewCompliedTl={},y.inlineWidgetNewTmpl.forEach((function(e){var t,i={row:n,getControl:function(){return y.ngform.controls[t+"_new"]||{}},getValidationMessage:function(){return y.columns[t]&&y.columns[t].validationmessage},getPendingSpinnerStatusNew:function(){return y.columns[t]&&y.columns[t].showPendingSpinnerNew}},o=y.inlineEditNewViewRef.createEmbeddedView(e,i).rootNodes[0];t=o.getAttribute("data-col-identifier"),y.inlineNewCompliedTl[t]=o})),void y.clearForm(!0);y.inlineEditViewRef.clear(),y.inlineCompliedTl={},y.clearForm(),y.inlineWidgetTmpl.forEach((function(e){var t,i={row:n,getControl:function(){return y.ngform.controls[t]||{}},getValidationMessage:function(){return y.columns[t]&&y.columns[t].validationmessage},getPendingSpinnerStatus:function(){return y.columns[t]&&y.columns[t].showPendingSpinner}},o=y.inlineEditViewRef.createEmbeddedView(e,i).rootNodes[0];t=o.getAttribute("data-col-identifier"),y.inlineCompliedTl[t]=o}))},getInlineEditWidget:function(e,t,n){return n?(y.gridOptions.setFieldValue(e+"_new",t),y.inlineNewCompliedTl[e]):(y.gridOptions.setFieldValue(e,t),y.inlineCompliedTl[e])},setFieldValue:function(e,t){var n=y.ngform.controls&&y.ngform.controls[e];n&&n.setValue(t)},getFieldValue:function(e){var t=y.ngform.controls&&y.ngform.controls[e];return t&&t.value},addLoadMoreBtn:function(){y.callDataGridMethod("addLoadMoreBtn",y.ondemandmessage,y.loadingdatamsg,(function(e){y.gridOptions.setIsNextPageData(!0),y.gridOptions.setIsDataUpdatedByUser(!1),y.dataNavigator.navigatePage("next",e),y.isDataLoading=!0}))},bindScrollEvt:function(){y._gridData&&y._gridData.length&&y.infScroll&&setTimeout((function(){y.paginationService.bindScrollEvt(y,"tbody",r.DEBOUNCE_TIMES.PAGINATION_DEBOUNCE_TIME)}),0)},generateFilterRow:function(){y.filterViewRef.clear(),y.rowFilterCompliedTl={},y.filterTmpl.forEach((function(e){var t=y.filterViewRef.createEmbeddedView(e,{changeFn:y.onRowFilterChange.bind(y),isDisabled:function(e){return y.emptyMatchModes.indexOf(y.rowFilter[e]&&y.rowFilter[e].matchMode)>-1}}).rootNodes[0];y.rowFilterCompliedTl[t.getAttribute("data-col-identifier")]=t}))},getFilterWidget:function(e){return y.rowFilterCompliedTl[e]},setGridEditMode:function(e){y.ngZone.run((function(){y.isGridEditMode=e,u.$appDigest()}))},setGridState:function(e){y.isLoading="loading"===e},setActionRowIndex:function(e){y.gridOptions.isNavTypeScrollOrOndemand()&&(y.actionRowIndex=parseInt(e),y.setDataGridOption("actionRowIndex",y.actionRowIndex),_.isNaN(y.actionRowIndex)||(y.actionRowPage=Math.floor(y.actionRowIndex/y.pagesize)+1,y.setDataGridOption("actionRowPage",y.actionRowPage||y.gridOptions.actionRowPage)))},clearActionRowIndex:function(){y.isRowDeleted||!y.infScroll&&!y.onDemandLoad||y.clearActionRowVars()},noChangesDetected:function(){y.toggleMessage(!0,"info","No Changes Detected","")},redrawWidgets:function(){y.fieldDefs.forEach((function(e){u.triggerFn(e.inlineInstance&&e.inlineInstance.redraw),u.triggerFn(e.inlineInstanceNew&&e.inlineInstanceNew.redraw),u.triggerFn(e.filterInstance&&e.filterInstance.redraw)}))},searchHandler:y.searchSortHandler.bind(y),sortHandler:y.searchSortHandler.bind(y),timeoutCall:function(e,t){setTimeout(e,t)},runInNgZone:function(e){y.ngZone.run(e)},safeApply:function(){u.$appDigest()},setTouched:function(e){var t=y.ngform.controls[e];t&&t.markAsTouched()},clearForm:y.clearForm.bind(y),callLoadInlineWidgetData:function(){y.fullFieldDefs.forEach((function(e){_.isUndefined(e.isDataSetBound)&&u.triggerFn(e.loadInlineWidgetData&&e.loadInlineWidgetData.bind(e))}))},applyValidations:function(e,t){t?u.triggerFn(e.applyNewRowValidations&&e.applyNewRowValidations.bind(e)):u.triggerFn(e.applyValidations&&e.applyValidations.bind(e))},removeValidations:function(e){y.fullFieldDefs.forEach((function(t){t.readonly||"rowOperations"===t.binding||(e?u.triggerFn(t.removeNewRowValidations&&t.removeNewRowValidations.bind(t)):u.triggerFn(t.removeValidations&&t.removeValidations.bind(t)))}))}},y._selectedItemsExist=!1,y._onChange=function(){},y._onTouched=function(){},r.styler(y.nativeElement,y),y.ngform=n.group({}),y.addEventsToContext(y.context),[y.app.subscribe("check-state-persistence-options",(function(e){var t=_.get(y.datasource,"name");if(t||(t=r.extractDataSourceName(y.binddatasource)),_.get(e,"variable.name")===t&&y._pageLoad&&"none"!==y.getConfiguredState()){y._pageLoad=!1;var n=y.statePersistence.getWidgetState(y);n?e=y.handleStateParams(n,e):y.setDataGridOption("selectFirstRow",y.gridfirstrowselect)}})),y.app.subscribe("toggle-variable-state",(function(e){if(y.datasource&&y.datasource.execute(u.DataSource.Operation.IS_API_AWARE)&&u.isDataSourceEqual(e.variable,y.datasource)){if(y._pageLoad&&"none"!==y.getConfiguredState()){y._pageLoad=!1;var t=y.statePersistence.getWidgetState(y);t?e=y.handleStateParams(t,e):y.setDataGridOption("selectFirstRow",y.gridfirstrowselect)}u.isDefined(y.variableInflight)?y.debouncedHandleLoading(e):y.handleLoading(e)}})),y.app.subscribe("setup-cud-listener",(function(e){y.name===e&&(y._isDependent=!0,y.selectedItemChange$.pipe(m.debounceTime(250)).subscribe(y.triggerWMEvent.bind(y)))}))].forEach((function(e){return y.registerDestroyListener(e)})),y.deleteoktext=y.appLocale.LABEL_OK,y.deletecanceltext=y.appLocale.LABEL_CANCEL,y}return g(t,e),Object.defineProperty(t.prototype,"gridData",{get:function(){return this._gridData||[]},set:function(e){var t;if(this.isDataLoading=!1,!this.variableInflight||!_.isEmpty(e)){if(this.variableInflight=!1,e&&0===e.length?this.callDataGridMethod("setStatus","nodata",this.nodatamessage):this.callDataGridMethod("setStatus","ready"),this.gridOptions.isNavTypeScrollOrOndemand()){if(t=b(this.paginationService.updateFieldsOnPagination(this,e),2),this._gridData=t[0],this.currentPage=t[1],this.gridOptions.lastActionPerformed===this.gridOptions.ACTIONS.EDIT){var n=_.floor(this.actionRowIndex%this.pagesize);this._gridData.splice(this.actionRowIndex,1,e[n])}this.setDataGridOption("isLastPage",!!this.dataNavigator.isDisableNext),this.$element.find(".on-demand-datagrid").length||this.dataNavigator.isDisableNext||!this.onDemandLoad?this._gridData&&this._gridData.length&&(this.dataNavigator.isDisableNext||!this.isDataLoading)&&this.callDataGridMethod("hideLoadingIndicator",this.dataNavigator.isDisableNext,this.infScroll):this.gridOptions.addLoadMoreBtn()}else this._gridData=e;var i,o=0;if(this._onChange(this._gridData),this._onTouched(),u.isDefined(e)){if(this.gridOptions.bindScrollEvt(),this.isNavigationEnabled()&&this.dataNavigator.dn.currentPage&&(o=(this.dataNavigator.dn.currentPage-1)*(this.dataNavigator.maxResults||1)+1,this.setDataGridOption("startRowIndex",o)),!(i=this.callDataGridMethod("getOptions")))return;!i.colDefs.length&&this.fieldDefs.length&&this.setDataGridOption("colDefs",u.getClonedObject(this.fieldDefs)),this.isdynamictable||_.isEmpty(e)||!i.colDefs.length||this.invokeEventCallback("beforedatarender",{$data:this._gridData,$columns:this.columns,data:this._gridData,columns:this.columns}),this.setDataGridOption("data",u.getClonedObject(this._gridData))}}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selecteditem",{get:function(){return this.multiselect?u.getClonedObject(this.items):_.isEmpty(this.items)?{}:u.getClonedObject(this.items[0])},set:function(e){this.items.length=0,this.callDataGridMethod("selectRows",e)},enumerable:!1,configurable:!0}),t.prototype.onKeyPress=function(e){13===e.which&&this.invokeEventCallback("enterkeypress",{$event:e,$data:this.gridData})},t.prototype.ngAfterContentInit=function(){var t=this;e.prototype.ngAfterContentInit.call(this),this.headerConfig=this.headerConfig.filter(this.filterEmptyValues.bind(this)),_.remove(this.fieldDefs,(function(e){return void 0===e}));this._liveTableParent&&(this.isPartOfLiveGrid=!0),!this.readonlygrid&&this.editmode||("true"===this.readonlygrid?this.editmode="":this.isPartOfLiveGrid?this.editmode="inline"===this.isPartOfLiveGrid.formlayout?r.EDIT_MODE.FORM:r.EDIT_MODE.DIALOG:this.editmode=this.readonlygrid?r.EDIT_MODE.INLINE:""),this.gridOptions.colDefs=this.fullFieldDefs,this.gridOptions.rowActions=this.rowActions,this.gridOptions.headerConfig=this.headerConfig,this.gridOptions.rowClass=this.rowclass,this.gridOptions.editmode=this.editmode,this.gridOptions.formPosition=this.formposition,this.gridOptions.filtermode=this.filtermode,this.gridOptions.searchLabel=this.searchlabel,this.gridOptions.isMobile=u.isMobile(),this.gridOptions.name=this.name,this.gridOptions.securityUtils.pipeTransform=this.trustAsPipe,this.gridOptions.navigation=this.navigation,this.gridOptions.isdynamictable=this.isdynamictable,_.isEmpty(this.gridData)||(this.gridOptions.data=u.getClonedObject(this.gridData)),this.gridOptions.messages={selectField:this.appLocale.MESSAGE_SELECT_FIELD},this.datagridElement=$(this._tableElement.nativeElement),this.gridElement=this.$element,this.$element.css({position:"relative"}),_.forEach({showrowindex:"showRowIndex",multiselect:"multiselect",radioselect:"showRadioColumn",filternullrecords:"filterNullRecords",enablesort:"enableSort",showheader:"showHeader",enablecolumnselection:"enableColumnSelection",shownewrow:"showNewRow",gridfirstrowselect:"selectFirstRow"},(function(e,n){u.isDefined(t[n])&&(t.gridOptions[e]="true"===t[n]||!0===t[n])})),"none"!==this.statehandler&&(this.gridOptions.selectFirstRow=!1),this.renderOperationColumns(),this.gridOptions.colDefs=this.fieldDefs,this.datagridElement.datatable(this.gridOptions),this.callDataGridMethod("setStatus","loading",this.loadingdatamsg),this.applyProps.forEach((function(e){return t.callDataGridMethod.apply(t,w([],b(e)))})),this.editmode===r.EDIT_MODE.QUICK_EDIT&&(this.documentClickBind=this._documentClickBind.bind(this),document.addEventListener("click",this.documentClickBind))},t.prototype.getConfiguredState=function(){var e=this.statePersistence.computeMode(this.statehandler);return e&&e.toLowerCase()},t.prototype.handleStateParams=function(e,t){var n=this;return _.get(e,"selectedItem")&&(this._selectedItemsExist=!0),t.options=t.options||{},_.get(e,"pagination")?(t.options.page=e.pagination,_.get(e,"sort")&&(this.sortStateHandler(e),t.options.orderBy=_.get(e,"sort.field")+" "+_.get(e,"sort.direction")),_.get(e,"search")&&(setTimeout((function(){n.searchStateHandler(e)}),500),t.options.filterFields=this.getFilterFields(e.search))):(t.options.page=1,_.get(e,"search")&&(setTimeout((function(){n.searchStateHandler(e)}),500),t.options.filterFields=this.getFilterFields(e.search)),_.get(e,"sort")&&(this.sortStateHandler(e),t.options.orderBy=_.get(e,"sort.field")+" "+_.get(e,"sort.direction"))),t},t.prototype.triggerWMEvent=function(e){"dialog"!==this.editmode&&(u.$invokeWatchers(!0),this.app.notify("wm-event",{eventName:"selectedItemChange",widgetName:this.name,row:e,table:this}))},t.prototype.sortStateHandler=function(e){var t=this.datagridElement.find('th[data-col-field="'+_.get(e,"sort.field")+'"] .sort-icon');"asc"===_.get(e,"sort.direction")&&t.length?t.addClass("asc wi wi-long-arrow-up"):"desc"===_.get(e,"sort.direction")&&t.length&&t.addClass("desc wi wi-long-arrow-down")},t.prototype.searchStateHandler=function(e){var t=this;if(_.isArray(e.search))_.forEach(e.search,(function(e){if(t.rowFilter[e.field]&&(t.rowFilter[e.field].value=e.value,t.rowFilter[e.field].matchMode=e.matchMode,t.rowFilter[e.field].type=e.type,$(t.rowFilterCompliedTl[e.field]).length)){"integer"===e.type?parseInt(e.value):e.value;$(t.rowFilterCompliedTl[e.field]).find("input").val(e.value)}}));else{var n=this.datagridElement;n.find('[data-element="dgSearchText"]').val(e.search.value),n.find('[data-element="dgFilterValue"]').val(e.search.field)}},t.prototype.filterEmptyValues=function(e){return e.columns&&(e.columns=e.columns.filter(this.filterEmptyValues.bind(this))),void 0!==e},t.prototype.compareFilterExpressions=function(e,t){return!(e.length!==t.length||!_.isEqual(e,t))},t.prototype.setLastActionToFilterCriteria=function(){this.prevFilterExpression=_.get(this.datasource,"filterExpressions.rules")?u.getClonedObject(this.datasource.filterExpressions.rules):u.getClonedObject([].concat(this.datasource.dataBinding)),this.gridOptions.setLastActionPerformed(this.gridOptions.ACTIONS.FILTER_CRITERIA),this.gridOptions.setIsSearchTrigerred(!0)},t.prototype.setLastActionToDatasetUpdate=function(){this.gridOptions.setLastActionPerformed(this.gridOptions.ACTIONS.DATASET_UPDATE),this.gridOptions.setCurrentPage(1),this.gridOptions.setIsDatasetUpdated(!0)},t.prototype.checkIfVarFiltersApplied=function(){if(!_.isEmpty(_.get(this.datasource,"filterExpressions.rules"))||!_.isEmpty(_.get(this.datasource,"dataBinding"))){var e=_.get(this.datasource,"filterExpressions.rules")?this.datasource.filterExpressions.rules:[].concat(this.datasource.dataBinding);this.compareFilterExpressions(this.prevFilterExpression,e)||this.setLastActionToFilterCriteria()}},t.prototype.watchVariableDataSet=function(e){var t;if(this.gridOptions.isNavTypeScrollOrOndemand()&&this.checkIfVarFiltersApplied(),"wm.Variable"===_.get(this.datasource,"category")&&this._pageLoad&&"none"!==this.getConfiguredState()){var n=this.statePersistence.getWidgetState(this);this._pageLoad=!1,_.get(n,"selectedItem")?this._selectedItemsExist=!0:this.setDataGridOption("selectFirstRow",this.gridfirstrowselect),_.get(n,"search")&&(this.searchStateHandler(n),this.searchSortHandler(n.search,void 0,"search",!0)),_.get(n,"sort")&&(this.searchSortHandler(n.sort,void 0,"sort",!0),this.sortStateHandler(n)),_.get(n,"pagination")&&this.dataNavigator.pageChanged({page:n.pagination},!0)}if(!(this.dataNavigatorWatched&&_.isUndefined(e)&&this.__fullData)){this.variableInflight&&!this.infScroll&&this.callDataGridMethod("setStatus","loading",this.loadingdatamsg),(t=u.getValidJSON(e))&&(e=t);var i=this.getSortExpr(),o=i.split(" ");if(i&&o.length&&(this.sortInfo={direction:o[1],field:o[0]}),this.isDataValid()){if(e){if(this.shownavigation&&!this.dataNavigatorWatched)return void this.enablePageNavigation()}else this.resetPageNavigation(),this.variableInflight||this.callDataGridMethod("setStatus","nodata",this.nodatamessage),this.setDataGridOption("selectFirstRow",this.gridfirstrowselect);!this.isNavigationEnabled()&&e&&this.checkFiltersApplied(this.getSortExpr()),!_.isObject(e)||""===e||e&&""===e.dataValue?this.variableInflight||this.setGridData([]):e&&this.populateGridData(e)}}},t.prototype.ngOnDestroy=function(){document.removeEventListener("click",this.documentClickBind),this.navigatorResultWatch&&this.navigatorResultWatch.unsubscribe(),this.navigatorMaxResultWatch&&this.navigatorMaxResultWatch.unsubscribe(),e.prototype.ngOnDestroy.call(this)},t.prototype.addRowIndex=function(e){var t=u.getClonedObject(e),n=_.indexOf(this.gridOptions.data,e);return n<0?e:(t.$index=n+1,t.$isFirst=1===t.$index,t.$isLast=this.gridData.length===t.$index,t)},t.prototype.addEventsToContext=function(e){var t=this;e.addNewRow=function(){return t.addNewRow()},e.deleteRow=function(){return t.deleteRow()},e.editRow=function(){return t.editRow()}},t.prototype.execute=function(e,t){return![u.DataSource.Operation.IS_API_AWARE,u.DataSource.Operation.IS_PAGEABLE,u.DataSource.Operation.SUPPORTS_SERVER_FILTER].includes(e)&&(this.datasource?this.datasource.execute(e,t):{})},t.prototype.isNavigationEnabled=function(){return this.shownavigation&&this.dataNavigator&&this.dataNavigatorWatched},t.prototype.getClonedRowObject=function(e){var t=u.getClonedObject(e);return t.getProperty=function(e){return _.get(t,e)},t.$isFirst=1===t.$index,t.$isLast=this.gridData.length===t.$index,delete t.$$index,delete t.$$pk,t},t.prototype.handleLoading=function(e){this.variableInflight=e.active,e.active?this.callDataGridMethod("setStatus","loading",this.loadingdatamsg):!this.isGridEditMode&&_.isEmpty(this.dataset)?this.callDataGridMethod("setStatus","nodata",this.nodatamessage):this.callDataGridMethod("setStatus","ready")},t.prototype.setDisabledOnField=function(e,t,n){"new"===e||!t["primary-key"]||"assigned"!==t.generator||t["related-entity-name"]||t.period||(t[n].disabled=!0)},t.prototype.resetFormControl=function(e){e.markAsUntouched(),e.markAsPristine()},t.prototype.clearForm=function(e){var t=this,n=this.ngform.controls;_.keys(this.ngform.controls).forEach((function(i){!i.endsWith("_filter")&&(i.endsWith("_new")&&e||!i.endsWith("_new")&&!e)&&(n[i].setValue(""),t.resetFormControl(n[i]))}))},t.prototype.showFieldBasedOnScreenType=function(e){return u.isMobile()&&this.viewport.isMobileType?e.mobileDisplay:this.viewport.isTabletType?e.tabletDisplay:e.pcDisplay},t.prototype.isEmptyRecord=function(e){var t,n=this;return Object.keys(e).every((function(i,o){return t=e[i],!(n.fieldDefs.length&&u.isDefined(n.fieldDefs[o])&&n.showFieldBasedOnScreenType(n.fieldDefs[o])||!0)||(null==t||""===t)}))},t.prototype.removeEmptyRecords=function(e){var t=this,n=e,i=[];return n&&n.length&&(i=n.filter((function(e){return e&&!t.isEmptyRecord(e)}))),i},t.prototype.setGridData=function(e){var t=this.filternullrecords?this.removeEmptyRecords(e):e;"wm.Variable"===_.get(this.datasource,"category")&&(this.variableInflight=!1),this.variableInflight||(t&&0===t.length?this.callDataGridMethod("setStatus","nodata",this.nodatamessage):this.callDataGridMethod("setStatus","ready")),this.gridData=t},t.prototype.setDataGridOption=function(e,t,n){if(void 0===n&&(n=!1),this.datagridElement&&this.datagridElement.datatable&&this.datagridElement.datatable("instance")){var i={};!u.isDefined||_.isEqual(t,this.gridOptions[e])&&!n||(i[e]=t,this.datagridElement.datatable("option",i),this.gridOptions[e]=t)}},t.prototype.callDataGridMethod=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(this.datagridElement&&this.datagridElement.datatable("instance"))return this.datagridElement.datatable.apply(this.datagridElement,e);this.applyProps.set(e[1],e)},t.prototype.renderOperationColumns=function(){var e,t,n=r.getRowOperationsColumn(),i={name:n.field,field:n.field,isPredefined:!0};this.fieldDefs.length&&(e=_.find(this.fullFieldDefs,{field:R,type:"custom"}),_.remove(this.fieldDefs,{type:"custom",field:R}),_.remove(this.headerConfig,{field:n.field}),this.rowActions.length&&(e?(t=e.rowactionsposition?_.toNumber(e.rowactionsposition):this.fieldDefs.length,this.fieldDefs.splice(t,0,e),0===t?this.headerConfig.unshift(i):this.headerConfig.push(i)):(this.fieldDefs.push(n),this.headerConfig.push(i))),this.setDataGridOption("headerConfig",this.headerConfig))},t.prototype.enablePageNavigation=function(){var e=this;this.dataset&&this.binddataset&&this.dataNavigator&&(this.dataNavigatorWatched=!0,this.navigatorResultWatch&&this.navigatorResultWatch.unsubscribe(),this.navigatorResultWatch=this.dataNavigator.resultEmitter.subscribe((function(t){u.isDefined(t)?_.isEqual(e.dataset,t)?e.watchVariableDataSet(t):_.isArray(t)?e.widget.dataset=[].concat(t):_.isObject(t)?e.widget.dataset=_.extend({},t):e.widget.dataset=t:e.widget.dataset=void 0}),!0),this.navigatorMaxResultWatch&&this.navigatorMaxResultWatch.unsubscribe(),this.navigatorMaxResultWatch=this.dataNavigator.maxResultsEmitter.subscribe((function(t){e.pagesize=t})),this.__fullData=this.dataset,this.dataNavigator.widget.maxResults=this.pagesize||5,this.dataNavigator.options={maxResults:this.pagesize||5},this.removePropertyBinding("dataset"),this.dataNavigator.setBindDataSet(this.binddataset,this.viewParent,this.datasource,this.dataset,this.binddatasource,void 0,this.statehandler))},t.prototype.resetPageNavigation=function(){this.dataNavigator&&this.dataNavigator.resetPageNavigation()},t.prototype.isDataValid=function(){var e,t=this.dataset||{};return t.error&&(e=t.error),t.data&&t.data.error&&t.data.errorMessage&&(e=t.data.errorMessage),!e||(this.setGridData([]),this.callDataGridMethod("setStatus","error",e),!1)},t.prototype.populateGridData=function(e){var t,n=this;if(e=r.transformData(e,this.name),!this.isNavigationEnabled()&&this._isClientSearch?(t=u.getClonedObject(e),t=this.getSearchResult(t,this.filterInfo),t=this.getSortResult(t,this.sortInfo),this.serverData=t):this.serverData=e,this.isdynamictable?this.createGridColumns(this.serverData):this.setGridData(this.serverData),"none"!==this.getConfiguredState()&&this._selectedItemsExist&&e.length){var i=this.statePersistence.getWidgetState(this),o=void 0;_.get(i,"selectedItem")&&(o=i.selectedItem.filter((function(e){return e.page===n.dataNavigator.dn.currentPage})),this._selectedItemsExist=!1,o.length&&this.selecteditem.length!==i.selectedItem.length&&(_.isArray(this.selecteditem)?o.forEach((function(e){n.selectItem(e.index,void 0)})):this.selecteditem=o.map((function(e){return e.index}))))}},t.prototype.generateDynamicColumns=function(e){return v(this,void 0,void 0,(function(){var t,n,i,o=this;return y(this,(function(a){switch(a.label){case 0:return this.fieldDefs=[],this.filterTmpl._results=[],_.isEmpty(e)?[2]:(t="",e.forEach((function(e){var n="",i="";_.forEach(e,(function(e,t){_.isUndefined(e)||""===e||("customExpression"===t?i=e:n+=" "+t+'="'+e+'"')})),t+="<wm-table-column "+n+' tableName="'+o.name+o.$attrs.get("table_reference")+'">'+i+"</wm-table-column>"})),this.dynamicTableRef.clear(),this._dynamicContext||(this._dynamicContext=Object.create(this.viewParent),this._dynamicContext[this.getAttr("wmTable")]=this),this.noOfColumns=e.length,[4,this.dynamicComponentProvider.getComponentFactoryRef("app-table-dynamic-"+this.widgetId,t,{noCache:!0,transpile:!0})]);case 1:return n=a.sent(),i=this.dynamicTableRef.createComponent(n,0,this.inj),u.extendProto(i.instance,this._dynamicContext),this.$element.find(".dynamic-table-container")[0].appendChild(i.location.nativeElement),[2]}}))}))},t.prototype.prepareColDefs=function(e){var t,n,i=this,o=0,a=0;this.fieldDefs=[],this.headerConfig=[],this.columns={},n=e,t=r.prepareFieldDefs(n),_.forEach(t,(function(e){e.binding=e.field,e.caption=e.displayName,e.pcDisplay=!0,e.mobileDisplay=!0,e.tabletDisplay=!0,e.searchable=!0,e.showinfilter=!0,e.type="string",e.index=o,e.headerIndex=a,o++,a++})),t.forEach((function(e){i.columns[e.field]=e})),this.invokeEventCallback("beforedatarender",{$data:e,$columns:this.columns,data:e,columns:this.columns}),t=[],_.forEach(this.columns,(function(e){t.push(e)})),this.generateDynamicColumns(t)},t.prototype.createGridColumns=function(e){var t=e&&!e.error;t&&!_.isArray(e)&&(e=[e]),_.isEmpty(e)?this.setGridData(e):t&&(this.prepareColDefs(e),this.serverData=e,this.setGridData(this.serverData))},t.prototype.getSortExpr=function(){var e,t;return this.datasource&&this.datasource.execute(u.DataSource.Operation.IS_PAGEABLE)&&(t=this.datasource.execute(u.DataSource.Operation.GET_PAGING_OPTIONS),e=_.isEmpty(t)?"":r.getOrderByExpr(t.sort)),e||""},t.prototype.onPropertyChange=function(t,n,i){var o,a=this;switch(t){case"datasource":!1===n.startUpdate&&(this.variableInflight=!1,this.callDataGridMethod("setStatus","nodata",this.nodatamessage)),this.watchVariableDataSet(this.dataset),this.onDataSourceChange();break;case"dataset":if(this.gridOptions.isNavTypeScrollOrOndemand()&&1===this.gridOptions.getCurrentPage()&&this.gridOptions.setIsNextPageData(!1),this.binddatasource&&!this.datasource)return;this.parentList&&!this.datasource&&_.startsWith(this.binddataset,"item")&&(this.datasource=u.getDatasourceFromExpr(this.widget.$attrs.get("datasetboundexpr"),this)),this.gridOptions.isNavTypeScrollOrOndemand()&&(this.gridOptions.isNextPageData?this.gridOptions.setIsDataUpdatedByUser(!1):(this.gridOptions.setIsDataUpdatedByUser(!0),this.setLastActionToDatasetUpdate(),this.gridOptions.setIsNextPageData(!1))),"wm.Variable"===_.get(this.datasource,"category")&&this._pageLoad&&"none"!==this.getConfiguredState()||this.watchVariableDataSet(n);break;case"filtermode":this.setDataGridOption("filtermode",n);break;case"searchlabel":this.setDataGridOption("searchLabel",n);break;case"navigation":if("Advanced"===n)return void(this.navigation="Classic");"None"!==n&&(this.shownavigation=!0),this.setDataGridOption("navigation",this.navigation),this.onDemandLoad=n===r.NAVIGATION_TYPE.ONDEMAND,this.infScroll=n===r.NAVIGATION_TYPE.SCROLL,this.navControls=n;break;case"gridfirstrowselect":this.setDataGridOption("selectFirstRow",n);break;case"gridclass":this.callDataGridMethod("option","cssClassNames.grid",n);break;case"nodatamessage":this.callDataGridMethod("option","dataStates.nodata",n);break;case"loadingdatamsg":this.callDataGridMethod("option","dataStates.loading",n);break;case"loadingicon":this.callDataGridMethod("option","loadingicon",n);break;case"spacing":this.callDataGridMethod("option","spacing",n),this.navigationSize="condensed"===n?"small":"";break;case"exportformat":this.exportOptions=[],n&&_.forEach(_.split(n,","),(function(e){a.exportOptions.push({label:e,icon:E[e]})}));break;case"shownewrow":o=n||_.some(this.actions,(function(e){return _.includes(e.action,"addNewRow()")})),this.callDataGridMethod("option","actionsEnabled.new",o);break;case"pagesize":this.dataNavigator.options={maxResults:n},this.dataNavigator.widget.maxResults=n,this.dataNavigator.maxResults=n;break;case"ondemandmessage":n&&this.$element.find(".on-demand-datagrid > a").text(n);break;case"show":n?this.invokeEventCallback("show"):this.invokeEventCallback("hide");default:e.prototype.onPropertyChange.call(this,t,n,i)}},t.prototype.onDataSourceChange=function(){this.fieldDefs.forEach((function(e){u.triggerFn(e.onDataSourceChange&&e.onDataSourceChange.bind(e))}))},t.prototype.clearActionRowVars=function(){this.actionRowIndex=void 0,this.actionRowPage=void 0,this.setDataGridOption("actionRowIndex",void 0),this.setDataGridOption("actionRowPage",void 0)},t.prototype.onStyleChange=function(t,n,i){switch(t){case"width":this.callDataGridMethod("setGridDimensions","width",n);break;case"height":this.callDataGridMethod("setGridDimensions","height",n)}e.prototype.onStyleChange.call(this,t,n,i)},t.prototype.populateActions=function(){var e=this;this._actions.header=[],this._actions.footer=[],_.forEach(this.actions,(function(t){_.includes(t.position,"header")&&e._actions.header.push(t),_.includes(t.position,"footer")&&e._actions.footer.push(t)}))},t.prototype.renderDynamicFilterColumn=function(e){this.isdynamictable&&this.filterTmpl._results.push(e)},t.prototype.registerColumns=function(e,t){var n=this;if(u.isMobile()&&this.viewport.isMobileType){if(!e.mobileDisplay)return}else if(this.viewport.isTabletType){if(!e.tabletDisplay)return}else if(!e.pcDisplay)return;e["primary-key"]&&this.primaryKey.push(e.field),this.fieldDefs[t]=e;var i=this.fieldDefs.length;this.fullFieldDefs.push(e),this.rowFilter[e.field]={value:void 0},this.fieldDefs.forEach((function(e){n.columns[e.field]=e})),this.isdynamictable&&i===this.noOfColumns&&(this.renderOperationColumns(),this.setDataGridOption("colDefs",this.fieldDefs))},t.prototype.registerFormField=function(e,t){this.formfields[e]=t},t.prototype.registerActions=function(e){this.actions.push(e),this.populateActions()},t.prototype.registerRow=function(e,t){this.rowDef=e,this.rowInstance=t,this.callDataGridMethod("option","cssClassNames.rowExpandIcon",this.rowDef.expandicon),this.callDataGridMethod("option","cssClassNames.rowCollapseIcon",this.rowDef.collapseicon),this.gridOptions.rowExpansionEnabled=!0,this.gridOptions.rowDef=this.rowDef},t.prototype.registerRowActions=function(e){this.rowActions.push(e)},t.prototype.selectItem=function(e,t){t&&(this.serverData=t),_.isObject(e)&&(e=_.omitBy(e,(function(e){return _.isArray(e)&&_.isEmpty(e)}))),this.callDataGridMethod("selectRow",e,!0)},t.prototype.deselectItem=function(e){this.callDataGridMethod("deselectRow",e)},t.prototype.onDataNavigatorDataSetChange=function(e){var t;return this.__fullData=e,this.checkFiltersApplied(this.getSortExpr()),this._isClientSearch?(t=u.getClonedObject(this.__fullData),_.isObject(t)&&!_.isArray(t)&&(t=[t]),t=this.getSearchResult(t,this.filterInfo),t=this.getSortResult(t,this.sortInfo)):e},t.prototype.toggleMessage=function(e,t,n,i){e&&n&&this.app.notifyApp(n,t,i)},t.prototype.export=function(e){var t,n=_.isEmpty(this.sortInfo)?"":this.sortInfo.field+" "+this.sortInfo.direction,i={};this.fieldDefs.forEach((function(e){if(e.field!==R&&e.show){var t={header:e.displayName};e.exportexpression?t.expression=e.exportexpression:t.field=e.field,i[e.field]=t}})),t={matchMode:"anywhereignorecase",filterFields:this.getFilterFields(this.filterInfo),orderBy:n,exportType:e.label,logicalOp:"AND",exportSize:this.exportdatasize,columns:i},!1!==this.invokeEventCallback("beforeexport",{$data:t})&&(t.fields=_.values(t.columns),this.datasource.execute(u.DataSource.Operation.DOWNLOAD,{data:t}))},t.prototype.expandRow=function(e){this.callDataGridMethod("expandRow",e)},t.prototype.collapseRow=function(e){this.callDataGridMethod("collapseRow",e)},t.prototype._documentClickBind=function(e){var t=e.target;this.$element[0].contains(t)||e.target.doctype||T($(t))||this.callDataGridMethod("saveRow")},t.prototype._redraw=function(e){var t=this;e?this.datagridElement.datatable(this.gridOptions):setTimeout((function(){t.callDataGridMethod("setColGroupWidths"),t.callDataGridMethod("addOrRemoveScroll")}))},t.prototype.invokeActionEvent=function(e,t){u.$parseEvent(t)(this.viewParent,Object.assign(this.context,{$event:e}))},t.prototype.handleEvent=function(t,n,i,o){"select"!==n&&e.prototype.handleEvent.call(this,this.nativeElement,n,i,o)},t.prototype.triggerUploadEvent=function(e,t,n,i){var o={$event:e,row:i};this.columns[n]&&("change"===t&&(o.newVal=e.target.files,o.oldVal=this.columns[n]._oldUploadVal,this.columns[n]._oldUploadVal=o.newVal),this.columns[n].invokeEventCallback(t,o))},t.prototype.registerFormWidget=function(){},t.prototype.writeValue=function(){},t.prototype.registerOnChange=function(e){this._onChange=e},t.prototype.registerOnTouched=function(e){this._onTouched=e},t.prototype.ngOnDetach=function(){e.prototype.ngOnDetach.call(this),"wm.Variable"===_.get(this.datasource,"category")&&"none"!==this.getConfiguredState()?this._pageLoad=!1:this._pageLoad=!0},t}(r.StylableComponent);S.initializeProps=P(),S.decorators=[{type:t.Component,args:[{selector:"[wmTable]",template:'<div class="panel-heading" *ngIf="title || subheading || iconclass || exportOptions.length || _actions.header.length">\n <h3 class="panel-title">\n <div class="pull-left">\n <i class="app-icon panel-icon {{iconclass}}" *ngIf="iconclass"></i>\n </div>\n <div class="pull-left">\n <div class="heading" [innerHTML]="title"></div>\n <div class="description" [innerHTML]="subheading"></div>\n </div>\n <div class="panel-actions app-datagrid-actions" *ngIf="exportOptions.length || _actions.header.length">\n <ng-container *ngFor="let btn of _actions.header"\n [ngTemplateOutlet]="btn.widgetType === \'button\' ? buttonRef : anchorRef" [ngTemplateOutletContext]="{btn:btn}">\n </ng-container>\n <div wmMenu dropdown caption.bind="appLocale.LABEL_EXPORT" *ngIf="exportOptions.length" autoclose="always" attr.name="{{name}}-export"\n dataset.bind="exportOptions" select.event="export($item)" menuposition="down,left"></div>\n </div>\n </h3>\n</div>\n<div class="app-datagrid" #datagridElement></div>\n\n<div class="panel-footer clearfix" [hidden]="!_actions.footer.length && (!shownavigation || (onDemandLoad && dataNavigator.isDisableNext) || dataNavigator?.dataSize <= pagesize)">\n <div class="app-datagrid-paginator" [hidden]="(!dataNavigator?.dataSize && !dataNavigator.datasource?.pagination?.next) || !shownavigation || (onDemandLoad && dataNavigator.isDisableNext) || dataNavigator?.dataSize <= pagesize">\n <nav wmPagination show.bind="shownavigation" navigationalign.bind="navigationalign"\n navigationsize.bind="navigationSize"\n navigation.bind="navControls" showrecordcount.bind="showrecordcount" maxsize.bind="maxsize"\n boundarylinks.bind="boundarylinks"\n forceellipses.bind="forceellipses" directionlinks.bind="directionlinks"></nav>\n </div>\n <div class="app-datagrid-actions" *ngIf="_actions.footer.length">\n <ng-container *ngFor="let btn of _actions.footer"\n [ngTemplateOutlet]="btn.widgetType === \'button\' ? buttonRef : anchorRef" [ngTemplateOutletContext]="{btn:btn}">\n </ng-container>\n </div>\n</div>\n\n<ng-template #buttonRef let-btn="btn">\n <button wmButton caption.bind="btn.displayName" show.bind="btn.show" class.bind="btn.class" iconclass.bind="btn.iconclass" (click)="invokeActionEvent($event, btn.action)"\n [ngClass]="{\'btn-sm\': spacing === \'condensed\', \'disabled-new\': btn.key === \'addNewRow\' && (isGridEditMode || isLoading)}"\n type="button" shortcutkey.bind="btn.shortcutkey" tabindex.bind="btn.tabindex" hint.bind="btn.title" [attr.aria-label]="btn.displayName" disabled.bind="btn.disabled" conditionalclass.bind="btn.conditionalclass" conditionalstyle.bind="btn.conditionalstyle"></button>\n</ng-template>\n\n<ng-template #anchorRef let-btn="btn">\n <a wmAnchor caption.bind="btn.displayName" show.bind="btn.show" class.bind="btn.class" iconclass.bind="btn.iconclass" (click)="invokeActionEvent($event, btn.action)"\n [ngClass]="{\'btn-sm\': spacing === \'condensed\', \'disabled-new\': btn.key === \'addNewRow\' && (isGridEditMode || isLoading)}"\n shortcutkey.bind="btn.shortcutkey" tabindex.bind="btn.tabindex" hint.bind="btn.title"\n hyperlink.bind="btn.hyperlink" target.bind="btn.target" conditionalclass.bind="btn.conditionalclass" conditionalstyle.bind="btn.conditionalstyle"></a>\n</ng-template>\n\n<div hidden>\n <ng-container #multiColumnFilterView></ng-container>\n\n <ng-container #inlineEditView></ng-container>\n\n <ng-container #inlineEditNewView></ng-container>\n\n <ng-container #rowActionsView></ng-container>\n\n <ng-container #rowExpansionActionView></ng-container>\n\n <ng-container #customExprView></ng-container>\n\n <ng-container #dynamicTable></ng-container>\n\n <ng-container #rowDetailView></ng-container>\n\n <div class="dynamic-table-container"></div>\n</div>\n',providers:[r.provideAs(S,i.NG_VALUE_ACCESSOR,!0),r.provideAsWidgetRef(S)]}]}],S.ctorParameters=function(){return[{type:t.Injector},{type:i.FormBuilder},{type:u.App},{type:u.DynamicComponentRefProvider},{type:u.StatePersistence},{type:u.PaginationService},{type:u.Viewport},{type:p.ListComponent,decorators:[{type:t.Optional}]},{type:void 0,decorators:[{type:t.Attribute,args:["dataset.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["datasource.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["readonlygrid"]}]},{type:t.NgZone},{type:r.TrustAsPipe}]},S.propDecorators={dataNavigator:[{type:t.ViewChild,args:[d.PaginationComponent,{static:!0}]}],_tableElement:[{type:t.ViewChild,args:["datagridElement",{static:!0}]}],rowActionTmpl:[{type:t.ContentChildren,args:["rowActionTmpl"]}],rowActionsViewRef:[{type:t.ViewChild,args:["rowActionsView",{static:!0,read:t.ViewContainerRef}]}],filterTmpl:[{type:t.ContentChildren,args:["filterTmpl",{descendants:!0}]}],filterViewRef:[{type:t.ViewChild,args:["multiColumnFilterView",{static:!0,read:t.ViewContainerRef}]}],inlineWidgetTmpl:[{type:t.ContentChildren,args:["inlineWidgetTmpl",{descendants:!0}]}],inlineEditViewRef:[{type:t.ViewChild,args:["inlineEditView",{static:!0,read:t.ViewContainerRef}]}],inlineWidgetNewTmpl:[{type:t.ContentChildren,args:["inlineWidgetTmplNew",{descendants:!0}]}],inlineEditNewViewRef:[{type:t.ViewChild,args:["inlineEditNewView",{static:!0,read:t.ViewContainerRef}]}],customExprTmpl:[{type:t.ContentChildren,args:["customExprTmpl",{descendants:!0}]}],customExprViewRef:[{type:t.ViewChild,args:["customExprView",{static:!0,read:t.ViewContainerRef}]}],rowExpansionActionTmpl:[{type:t.ContentChildren,args:["rowExpansionActionTmpl"]}],rowExpansionTmpl:[{type:t.ContentChild,args:["rowExpansionTmpl"]}],rowDetailViewRef:[{type:t.ViewChild,args:["rowDetailView",{static:!0,read:t.ViewContainerRef}]}],rowExpansionActionViewRef:[{type:t.ViewChild,args:["rowExpansionActionView",{static:!0,read:t.ViewContainerRef}]}],dynamicTableRef:[{type:t.ViewChild,args:["dynamicTable",{static:!0,read:t.ViewContainerRef}]}],onKeyPress:[{type:t.HostListener,args:["keypress",["$event"]]}]};var C="new",I="edit",D="delete",x=function(){function e(e,t,n){this.table=e,this.dialogService=t,this.app=n,e.initiateSelectItem=this.initiateSelectItem.bind(this),e.updateVariable=this.updateVariable.bind(this),e.updateRecord=this.updateRecord.bind(this),e.deleteRecord=this.deleteRecord.bind(this),e.insertRecord=this.insertRecord.bind(this),e.editRow=this.editRow.bind(this),e.addNewRow=this.addNewRow.bind(this),e.addRow=this.addNewRow.bind(this),e.deleteRow=this.deleteRow.bind(this),e.onRecordDelete=this.onRecordDelete.bind(this),e.hideEditRow=this.hideEditRow.bind(this),e.saveRow=this.saveRow.bind(this),e.cancelRow=this.cancelRow.bind(this)}return e.prototype.selectItemOnSuccess=function(e,t,n){var i=this;setTimeout((function(){t||i.table.selectItem(e,i.table.dataset),u.triggerFn(n)}),250)},e.prototype.initiateSelectItem=function(e,t,n,i,o){var a=this;this.table.gridOptions.isNavTypeScrollOrOndemand()&&!this.table.dataNavigator.isDisableNext&&this.table.isNewRowInserted?this.table.isNewRowInserted=!1:("last"===e&&(i||(this.table.dataNavigator.dataSize+=1),this.table.isNavigationEnabled()||(e="current")),this.table.dataNavigator.calculatePagingValues(),this.table.dataNavigator.__fullData=this.table.__fullData,this.table.dataNavigator.navigatePage(e,null,!0,(function(){(a.table.isNavigationEnabled()||i)&&a.selectItemOnSuccess(t,n,o),"quickedit"!==a.table.editmode||n||a.table.callDataGridMethod("setActiveRow",t)})))},e.prototype.updateVariable=function(e,t){var n=this,i=this.table.datasource;if(i&&(i.execute(u.DataSource.Operation.FETCH_DISTINCT_VALUES),!this.table.isNavigationEnabled())){var o=this.table.sortInfo,a=o&&o.direction?o.field+" "+o.direction:"";r.refreshDataSource(i,{page:1,filterFields:this.table.getFilterFields(this.table.filterInfo),orderBy:a,matchMode:"anywhereignorecase"}).then((function(){u.$appDigest(),n.selectItemOnSuccess(e,!0,t)}))}},e.prototype.insertSuccessHandler=function(e,t){if(e.error)this.table.invokeEventCallback("error",{$event:t.event,$operation:C,$data:e.error}),this.table.onError||this.table.toggleMessage(!0,"error",this.table.errormessage||e.error),u.triggerFn(t.error,e);else{if(this.table.gridOptions.isNavTypeScrollOrOndemand()&&(this.table.isNewRowInserted=!0),t.event){var n=$(t.event.target).closest("tr");this.table.callDataGridMethod("hideRowEditMode",n)}this.table.onRowinsert||this.table.toggleMessage(!0,"success",this.table.insertmessage),this.table.datasource.execute(u.DataSource.Operation.SUPPORTS_CRUD)?(this.table.initiateSelectItem(this.table.getNavigationTargetBySortInfo(),e,void 0,!1,t.callBack),this.updateVariable(e,t.callBack)):this.table.datasource.execute(u.DataSource.Operation.IS_API_AWARE)||this.table.initiateSelectItem(this.table.getNavigationTargetBySortInfo(),e,void 0,!1,t.callBack),u.triggerFn(t.success,e),this.table.invokeEventCallback("rowinsert",{$event:t.event,$data:e,row:e})}},e.prototype.generatePath=function(e){var t,n,i=this.table.widget.$attrs.get("datasetboundexpr");if(_.startsWith(e,"item")&&i){_.startsWith(i,"Widgets.")&&(i=u.extractCurrentItemExpr(i,this.table));for(var o=this.table.$element.parents(".app-list-item"),a=_.map(o,(function(e){return _.parseInt($(e).attr("listitemindex"))})),r=a.length-1;r>=0;r--)i=i.replace("$i",a[r]);n=_.last(a),t=i.replace(/^Variables\..*\.dataSet([^.])*(\.|$)/g,"")}else{/^Variables\..*\.dataSet([\[][0-9]])/g.test(e)&&(n=_.parseInt(e.replace(/^Variables\..*\.dataSet([\[])/g,""))),t=e.replace(/^Variables\..*\.dataSet([^.])*(\.|$)/g,"")}return{path:t,index:n}},e.prototype.insertRecord=function(e){var t=this,n=this.table.datasource;if(n){var i=n.pagination&&n.pagination.number+1,o={row:e.row,skipNotification:!0,period:e.period};if(n.execute(u.DataSource.Operation.SUPPORTS_CRUD)||!n.execute(u.DataSource.Operation.IS_API_AWARE)||"wm.CrudVariable"===n.category){if(!n.execute(u.DataSource.Operation.IS_API_AWARE)){var a=this.generatePath(this.table.binddataset);return n.execute(u.DataSource.Operation.ADD_ITEM,{item:e.row,path:a.path,parentIndex:a.index}),void this.insertSuccessHandler(e.row,e)}n.execute(u.DataSource.Operation.INSERT_RECORD,o).then((function(o){t.insertSuccessHandler(o,e),"wm.CrudVariable"===n.category&&n.execute(u.DataSource.Operation.LIST_RECORDS,{skipToggleState:!0,operation:"list",page:i})}),(function(n){t.table.invokeEventCallback("error",{$event:e.event,$operation:C,$data:n}),t.table.onError||t.table.toggleMessage(!0,"error",t.table.errormessage||n),u.triggerFn(e.error,n),u.triggerFn(e.callBack,void 0,!0)}))}else this.table.invokeEventCallback("rowinsert",{$event:e.event,row:e.row})}},e.prototype.updateSuccessHandler=function(e,t){if(e.error)this.table.invokeEventCallback("error",{$event:t.event,$operation:I,$data:e.error}),this.table.onError||this.table.toggleMessage(!0,"error",this.table.errormessage||e.error),u.triggerFn(t.error,e);else{if(t.event){var n=$(t.event.target).closest("tr");this.table.callDataGridMethod("hideRowEditMode",n)}this.table.onRowupdate||this.table.toggleMessage(!0,"success",this.table.updatemessage),this.table.datasource.execute(u.DataSource.Operation.SUPPORTS_CRUD)?(this.table.initiateSelectItem("current",e,void 0,!1,t.callBack),this.updateVariable(e,t.callBack)):this.table.datasource.execute(u.DataSource.Operation.IS_API_AWARE)||this.table.initiateSelectItem("current",e,void 0,!1,t.callBack),u.triggerFn(t.success,e),this.table.invokeEventCallback("rowupdate",{$event:t.event,$data:e,row:e})}},e.prototype.updateRecord=function(e){var t=this,n=this.table.datasource;if(n){var i=n.pagination&&n.pagination.number+1,o={row:e.row,prevData:e.prevData,skipNotification:!0,period:e.period};if(n.execute(u.DataSource.Operation.SUPPORTS_CRUD)||!n.execute(u.DataSource.Operation.IS_API_AWARE)||"wm.CrudVariable"===n.category){if(!n.execute(u.DataSource.Operation.IS_API_AWARE)){var a=this.generatePath(this.table.binddataset);return n.execute(u.DataSource.Operation.SET_ITEM,{prevItem:e.prevData,item:e.row,path:a.path,parentIndex:a.index}),void this.updateSuccessHandler(e.row,e)}n.execute(u.DataSource.Operation.UPDATE_RECORD,o).then((function(o){t.updateSuccessHandler(o,e),"wm.CrudVariable"===n.category&&n.execute(u.DataSource.Operation.LIST_RECORDS,{skipToggleState:!0,operation:"list",page:i})}),(function(n){t.table.invokeEventCallback("error",{$event:e.event,$operation:I,$data:n}),t.table.onError||t.table.toggleMessage(!0,"error",t.table.errormessage||n),u.triggerFn(e.error,n),u.triggerFn(e.callBack,void 0,!0)}))}else this.table.invokeEventCallback("rowupdate",{$event:e.event,row:e.row})}},e.prototype.onRecordDelete=function(e){var t;this.table.dataNavigator&&(this.table.dataNavigator.dataSize-=1,this.table.dataNavigator.calculatePagingValues(),t=this.table.dataNavigator.pageCount<this.table.dataNavigator.dn.currentPage?"prev":void 0,this.table.dataNavigator.__fullData=this.table.__fullData,this.table.dataNavigator.navigatePage(t,null,!0,(function(){setTimeout((function(){u.triggerFn(e)}),void 0,!1)})))},e.prototype.deleteSuccessHandler=function(e,t,n,i){t&&t.error?this.table.onError||this.table.toggleMessage(!0,"error",this.table.errormessage||t.error):(this.onRecordDelete(i),this.table.datasource.execute(u.DataSource.Operation.SUPPORTS_CRUD)&&this.updateVariable(e,i),this.table.onRowdelete||this.table.toggleMessage(!0,"success",this.table.deletemessage),this.table.invokeEventCallback("rowdelete",{$event:n,$data:e,row:e}),this.table.invokeEventCallback("rowdeleted",{$event:n,$data:e,row:e}))},e.prototype.deleteFn=function(e){var t,n,i=this,o=this.table.datasource;if(o){if((this.table.onDemandLoad||this.table.infScroll)&&(this.table.isRowDeleted=!0),"wm.CrudVariable"===o.category&&(this.triggerWMEvent("resetEditMode"),o.pagination&&(t=o.pagination.last&&1===o.pagination.numberOfElements,n=t?o.pagination.number:o.pagination.number+1)),o.execute(u.DataSource.Operation.SUPPORTS_CRUD)||!o.execute(u.DataSource.Operation.IS_API_AWARE)||this.table._isDependent||"wm.CrudVariable"===o.category){if(!o.execute(u.DataSource.Operation.IS_API_AWARE)){var a=this.generatePath(this.table.binddataset);return o.execute(u.DataSource.Operation.REMOVE_ITEM,{item:e.row,path:a.path,parentIndex:a.index}),void this.deleteSuccessHandler(e.row,void 0,e.evt,e.callBack)}o.execute(u.DataSource.Operation.DELETE_RECORD,{row:e.row,skipNotification:!0,period:e.period}).then((function(t){i.deleteSuccessHandler(t,e.row,e.evt,e.callBack),"wm.CrudVariable"===o.category&&o.execute(u.DataSource.Operation.LIST_RECORDS,{skipToggleState:!0,operation:"list",page:n})}),(function(t){i.table.isRowDeleted&&(i.table.isRowDeleted=!1),u.triggerFn(e.callBack,void 0,!0),i.table.invokeEventCallback("error",{$event:e.evt,$operation:D,$data:t}),i.table.onError||i.table.toggleMessage(!0,"error",i.table.errormessage||t)}))}else this.table.invokeEventCallback("rowdelete",{$event:e.evt,row:e.row});u.triggerFn(e.cancelRowDeleteCallback)}},e.prototype.deleteRecord=function(e){var t=this;if(!this.table.confirmdelete)return this.deleteFn(e),void u.triggerFn(e.cancelRowDeleteCallback);this.dialogService.showAppConfirmDialog({title:this.app.appLocale.MESSAGE_DELETE_RECORD||"Delete Record",iconclass:"wi wi-delete fa-lg",message:this.table.confirmdelete,oktext:this.table.deleteoktext,canceltext:this.table.deletecanceltext,onOk:function(){t.deleteFn(e),t.dialogService.closeAppConfirmDialog()},onCancel:function(){u.triggerFn(e.cancelRowDeleteCallback),t.dialogService.closeAppConfirmDialog()},onOpen:function(){$(".cancel-action").focus()},onEscape:function(){u.triggerFn(e.cancelRowDeleteCallback)}})},e.prototype.editRow=function(e){var t,n=this;this.table._isDependent?this.triggerWMEvent("update"):(e&&e.target?this.table.callDataGridMethod("toggleEditRow",e,{selectRow:!0,action:"edit"}):"form"===this.table.editmode||"dialog"===this.table.editmode?(t=e||this.table.selectedItems[0],this.table.gridOptions.beforeRowUpdate(t)):setTimeout((function(){(t=n.table.datagridElement.find("tr.active")).length&&n.table.callDataGridMethod("toggleEditRow",void 0,{$row:t,action:"edit"})})),this.table._triggeredByUser=!0,this.table.gridOptions.setIsDataUpdatedByUser(!1))},e.prototype.addNewRow=function(){this.table.isGridEditMode||(this.table._triggeredByUser=!0,this.table.gridOptions.setIsDataUpdatedByUser(!1),this.table.callDataGridMethod("addNewRow"),this.table._liveTableParent?this.table._liveTableParent.addNewRow():this.table._isDependent&&this.triggerWMEvent("insert"))},e.prototype.triggerWMEvent=function(e,t){u.$invokeWatchers(!0),this.app.notify("wm-event",{eventName:e,widgetName:this.table.name,row:this.table.selecteditem,dataSource:t})},e.prototype.deleteRow=function(e){var t,n=this;e&&e.target?this.table.callDataGridMethod("deleteRowAndUpdateSelectAll",e):setTimeout((function(){t=e||n.table.selectedItems[0],n.deleteRecord({row:t})})),this.table._triggeredByUser=!0,this.table.gridOptions.setIsDataUpdatedByUser(!1)},e.prototype.hideEditRow=function(){var e=this.table.datagridElement.find("tr.row-editing");e.length&&this.table.callDataGridMethod("hideRowEditMode",e)},e.prototype.saveRow=function(){this.table.callDataGridMethod("saveRow")},e.prototype.cancelRow=function(){var e=this.table.datagridElement.find("tr.row-editing");e.length&&this.table.callDataGridMethod("cancelEdit",e)},e}();x.decorators=[{type:t.Directive,args:[{selector:"[wmTableCUD]"}]}],x.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Self},{type:t.Inject,args:[S]}]},{type:u.AbstractDialogService},{type:u.App}]};var N=["null","empty","nullorempty","isnotnull","isnotempty"],M=function(e,t){if(u.isDefined(e)&&""!==e)return u.isNumberType(t)?_.toNumber(e):t===u.DataType.DATETIME?moment(e).valueOf():_.toString(e).toLowerCase()},k=function(e,t,n){void 0===n&&(n=[]);var i,o=M(t.value,t.type);return!u.isDefined(o)&&!_.includes(N,t.matchMode)||u.isNumberType(t.type)&&_.isNull(t.value)?e:e=e.filter((function(e){var a;switch(t.field?i=M(_.get(e,t.field),t.type):(i=[],_.forEach(e,(function(t,o){if(_.includes(n,o))i.push(t);else{var a=_.filter(_.range(n.length),(function(e){return n[e].includes(o)}));_.forEach(a,(function(t){var o=_.get(e,n[t]);i.indexOf(o)<0&&i.push(o)}))}})),i=i.join(" ").toLowerCase()),t.matchMode){case"start":a=_.startsWith(i,o);break;case"end":a=_.endsWith(i,o);break;case"exact":a=_.isEqual(i,o);break;case"notequals":a=!_.isEqual(i,o);break;case"null":a=_.isNull(i);break;case"isnotnull":a=!_.isNull(i);break;case"empty":a=_.isEmpty(i);break;case"isnotempty":a=!_.isEmpty(i);break;case"nullorempty":a=_.isNull(i)||_.isEmpty(i);break;case"lessthan":a=i<o;break;case"lessthanequal":a=i<=o;break;case"greaterthan":a=i>o;break;case"greaterthanequal":a=i>=o;break;default:a=u.isNumberType(t.type)?_.isEqual(i,o):_.includes(i,o)}return a}))},L=function(e,t,n){n.forEach((function(n){e[n]={value:t.value,type:t.value.type,logicalOp:"OR"},t.matchMode&&(e[n].matchMode=t.matchMode)}))},F=function(e,t,n){void 0===n&&(n=[]);var i=t&&t.field;i?(e[i]={value:t.value,logicalOp:"AND"},t.matchMode&&(e[i].matchMode=t.matchMode)):L(e,t,n)},j=function(e,t){t.field&&(e[t.field]={value:t.value,matchMode:t.matchMode,type:t.type})},B=function(e,t){e.push({field:t.key?t.key:"",matchMode:t.matchMode,type:t.type,value:t.value})},G=function(){function e(e){this.table=e,e._searchSortHandler=this.searchSortHandler.bind(this),e.getSearchResult=this.getSearchResult.bind(this),e.getSortResult=this.getSortResult.bind(this),e.checkFiltersApplied=this.checkFiltersApplied.bind(this),e.getFilterFields=this.getFilterFields.bind(this),e.onRowFilterChange=this.onRowFilterChange.bind(this),e.onFilterConditionSelect=this.onFilterConditionSelect.bind(this),e.showClearIcon=this.showClearIcon.bind(this),e.clearRowFilter=this.clearRowFilter.bind(this),e.matchModeTypesMap=r.getMatchModeTypesMap(),e.matchModeMsgs=r.getMatchModeMsgs(e.appLocale),e.emptyMatchModes=N,e.getNavigationTargetBySortInfo=this.getNavigationTargetBySortInfo.bind(this),e.refreshData=this.refreshData.bind(this),e.clearFilter=this.clearFilter.bind(this),e.adjustContainer=this.adjustContainer.bind(this)}return e.prototype.adjustContainer=function(e){var t=this;setTimeout((function(){u.adjustContainerRightEdges($("bs-dropdown-container"),t.table.rowFilterCompliedTl[e],t.table,$("bs-dropdown-container .dropdown-menu"))}))},e.prototype.getNavigationTargetBySortInfo=function(){return this.table.sortInfo&&"desc"===this.table.sortInfo.direction&&_.includes(this.table.primaryKey,this.table.sortInfo.field)?"first":"last"},e.prototype.getTableVisibleCols=function(){var e=[];return _.forEach(this.table.columns,(function(t,n){"true"===_.toLower(_.toString(t.showinfilter))&&"rowOperations"!==n&&t.searchable&&e.push(n)})),e},e.prototype.invokeSetFilterfieldBasedOnFieldval=function(e,t){if(e.field)F(t,e);else if(!_.isEmpty(e)){var n=this.getTableVisibleCols();F(t,e,n)}},e.prototype.getFilterFields=function(e){var t=this;e=e||{};var n={};return _.isArray(e)?_.forEach(e,(function(e){t.invokeSetFilterfieldBasedOnFieldval(e,n)})):this.invokeSetFilterfieldBasedOnFieldval(e,n),n},e.prototype.getLogicalOperator=function(e){var t="";for(var n in e){t=e[n].logicalOp||"";break}return t},e.prototype.resetSortStatus=function(e){var t;!_.isEmpty(this.table.sortInfo)&&this.table.datasource&&(t=this.table.sortInfo.field+" "+this.table.sortInfo.direction,(e=this.table.datasource.execute(u.DataSource.Operation.GET_OPTIONS).orderBy||e)&&(e=_.head(_.split(e,","))),t!==e&&(this.table.callDataGridMethod("resetSortIcons"),this.table.sortInfo={},this.table.setDataGridOption("sortInfo",{})))},e.prototype.clearFilter=function(e){var t;this.table.filterInfo={},"multicolumn"===this.table.filtermode?(this.table.fieldDefs.forEach((function(e){e.resetFilter&&e.resetFilter()})),e||this.table.onRowFilterChange()):"search"===this.table.filtermode&&((t=this.table.datagridElement).find('[data-element="dgSearchText"]').val(""),t.find('[data-element="dgFilterValue"]').val(""),e||t.find(".app-search-button").trigger("click"))},e.prototype.checkFiltersApplied=function(e){if(this.table.datasource)return this.table.datasource.execute(u.DataSource.Operation.SUPPORTS_SERVER_FILTER)?(_.isEmpty(this.table.datasource.execute(u.DataSource.Operation.GET_OPTIONS).filterFields)&&this.clearFilter(!0),void this.resetSortStatus(e)):void(this.table.datasource.execute(u.DataSource.Operation.IS_PAGEABLE)&&this.resetSortStatus(e))},e.prototype.getSearchResult=function(e,t){var n=this.getTableVisibleCols();return t?(_.isArray(t)?t.forEach((function(t){e=k(e,t,n)})):e=k(e,t,n),e):e},e.prototype.getSortResult=function(e,t){return t&&t.direction&&(e=_.orderBy(e,t.field,t.direction)),e},e.prototype.handleClientSideSortSearch=function(e,t,n){var i;this.table._isClientSearch=!0,i=this.table.isNavigationEnabled()?u.getClonedObject(this.table.__fullData):u.getClonedObject(this.table.dataset),"search"===n?this.table.filterInfo=e:this.table.sortInfo=e,_.isObject(i)&&!_.isArray(i)&&(i=[i]),i=this.getSearchResult(i,this.table.filterInfo),i=this.getSortResult(i,this.table.sortInfo),this.table.serverData=i,"sort"===n&&this.table.invokeEventCallback("sort",{$event:t,$data:{data:this.table.serverData,sortDirection:this.table.sortInfo.direction,colDef:this.table.columns[this.table.sortInfo.field]}}),this.table.isNavigationEnabled()?(this.table.dataNavigator.dn.currentPage=1,this.table.dataNavigator.setPagingValues(i)):this.table.setGridData(this.table.serverData)},e.prototype.handleSinglePageSearch=function(e){this.table._isPageSearch=!0;var t=u.getClonedObject(this.table.gridData),n=this.table.datagridElement.find("tbody tr.app-datagrid-row");this.table.filterInfo=e,t=this.getSearchResult(t,e),_.forEach(this.table.gridData,(function(e,i){var o=$(n[i]);_.find(t,(function(t){return _.isEqual(t,e)}))?o.show():o.hide()})),t&&t.length?(this.table.callDataGridMethod("setStatus","ready"),this.table.gridfirstrowselect&&!this.table.multiselect&&this.table.callDataGridMethod("selectFirstRow",!0,!0)):(this.table.callDataGridMethod("setStatus","nodata",this.table.nodatamessage),this.table.selecteditem=void 0),this.table.callDataGridMethod("updateSelectAllCheckboxState")},e.prototype.handleServerSideSearch=function(e){var t=this;if(this.table.filterInfo=e,this.table.datasource){var n=this.table.sortInfo,i=n&&n.direction?n.field+" "+n.direction:"",o=this.getFilterFields(e),a=this.getLogicalOperator(o);r.refreshDataSource(this.table.datasource,{page:1,filterFields:o,orderBy:i,condition:a}).then((function(){u.$appDigest()}),(function(){t.table.toggleMessage(!0,"error",t.table.nodatamessage)}))}},e.prototype.handleSeverSideSort=function(e,t,n){var i=this;this.table.gridOptions.sortInfo.field=e.field,this.table.gridOptions.sortInfo.direction=e.direction,this.table.sortInfo=u.getClonedObject(e);var o=e&&e.direction?e.field+" "+e.direction:"",a=this.getFilterFields(this.table.filterInfo),s=this.getLogicalOperator(a);n||"none"===this.table.getConfiguredState()||this.table.statePersistence.removeWidgetState(this.table,"pagination"),r.refreshDataSource(this.table.datasource,{page:1,filterFields:a,orderBy:o,condition:s}).then((function(n){u.$appDigest();var o=n&&n.data?n.data:n;i.table.invokeEventCallback("sort",{$event:t,$data:{data:o,sortDirection:e.direction,colDef:i.table.columns[e.field]}})}))},e.prototype.searchHandler=function(e,t,n,i){var o;o=_.isArray(e)?e.filter((function(e){return void 0!==e.matchMode&&void 0!==e.value||void 0!==e.value&&""===e.field})):{field:e.field,value:e.value,type:e.type},"none"!==this.table.getConfiguredState()&&r.unsupportedStatePersistenceTypes.indexOf(this.table.navigation)<0?(_.isArray(e)&&o.length||e.value?(this.table.statePersistence.removeWidgetState(this.table,"search"),this.table.statePersistence.setWidgetState(this.table,{search:o})):this.table.statePersistence.removeWidgetState(this.table,"search"),i||(this.table.statePersistence.removeWidgetState(this.table,"pagination"),this.table.statePersistence.removeWidgetState(this.table,"selectedItem"))):console.warn("Retain State handling on Widget "+this.table.name+" is not supported for current pagination type.");var a=u.getClonedObject(e),s=this.table.datasource;if(s||this.table.dataset){var l={};_.isArray(a)?a.forEach((function(e){j(l,e)})):j(l,a),!1!==this.table.invokeEventCallback("beforefilter",{$event:t,$data:l,columns:l})&&(a=[],_.isEmpty(l)&&!_.isEmpty(o)?_.isArray(o)?_.forEach(o,(function(e){B(a,e)})):B(a,o):_.forEach(l,(function(e,t){a.push({field:t,matchMode:e.matchMode,type:e.type,value:e.value})})),s&&s.execute(u.DataSource.Operation.SUPPORTS_SERVER_FILTER)?this.handleServerSideSearch(a):s&&s.execute(u.DataSource.Operation.IS_API_AWARE)&&s.execute(u.DataSource.Operation.IS_PAGEABLE)?this.handleSinglePageSearch(a):this.handleClientSideSortSearch(a,t,n))}},e.prototype.sortHandler=function(e,t,n,i){var o=this.table.datasource;if(o||this.table.dataset){if(!i&&"none"!==this.table.getConfiguredState()&&r.unsupportedStatePersistenceTypes.indexOf(this.table.navigation)<0){var a={direction:e.direction,field:e.field};e.direction?this.table.statePersistence.setWidgetState(this.table,{sort:a}):this.table.statePersistence.removeWidgetState(this.table,"sort"),this.table.statePersistence.removeWidgetState(this.table,"selectedItem")}else console.warn("Retain State handling on Widget "+this.table.name+" is not supported for current pagination type.");o&&o.execute(u.DataSource.Operation.IS_SORTABLE)?this.handleSeverSideSort(e,t,i):this.handleClientSideSortSearch(e,t,n)}},e.prototype.setLastActionPerformedToSearchSort=function(){this.table.gridOptions.setLastActionPerformed(this.table.gridOptions.ACTIONS.SEARCH_OR_SORT),this.table.gridOptions.setIsSearchTrigerred(!0)},e.prototype.searchSortHandler=function(e,t,n,i){"change"===(t?t.type:"")&&"multicolumn"!==this.table.filtermode?t.stopPropagation():(this.setLastActionPerformedToSearchSort(),"search"===n?this.searchHandler(e,t,n,i):this.sortHandler(e,t,n,i))},e.prototype.showClearIcon=function(e){var t=this.table.rowFilter[e]&&this.table.rowFilter[e].value;return u.isDefined(t)&&""!==t&&null!==t},e.prototype.clearRowFilter=function(e){this.table.rowFilter&&this.table.rowFilter[e]&&(this.table.columns[e].resetFilter(),this.onRowFilterChange(e))},e.prototype.onFilterConditionSelect=function(e,t){var n=this;this.table.rowFilter[e]=this.table.rowFilter[e]||{},this.table.rowFilter[e].matchMode=t,_.includes(this.table.emptyMatchModes,t)?(this.table.columns[e].resetFilter(),this.table.onRowFilterChange()):u.isDefined(this.table.rowFilter[e].value)&&""!==this.table.rowFilter[e].value?this.table.onRowFilterChange():setTimeout((function(){n.table.columns[e].filterInstance.focus()}))},e.prototype.getFilterOnFieldValues=function(e){var t=this;if(this.table.datasource&&this.table.datasource.execute(u.DataSource.Operation.SUPPORTS_DISTINCT_API)){var n=e.field,i=this.table.fullFieldDefs,o=_.filter(i,{filteronfilter:n}),a=_.get(this.table.rowFilter,[n,"value"]);_.forEach(o,(function(e){var n=e.filteronfilter,i=e.field,o={},s=e.filterwidget;r.isDataSetWidget(s)&&n!==i&&!e.isFilterDataSetBound&&(o[n]=u.isDefined(a)&&""!==a&&null!==a?{value:a}:{},s===u.FormWidgetType.AUTOCOMPLETE&&e.filterInstance.dataoptions?e.filterInstance.dataoptions.filterFields=o:t.table.datasource.execute(u.DataSource.Operation.GET_DISTINCT_DATA_BY_FIELDS,{fields:i,filterFields:o}).then((function(t){e.filterdataset=t.data})))}))}},e.prototype.onRowFilterChange=function(e){var t=this,n=[],i=_.find(this.table.fullFieldDefs,{field:e});_.forEach(this.table.rowFilter,(function(e,o){(u.isDefined(e.value)&&""!==e.value||_.includes(t.table.emptyMatchModes,e.matchMode))&&(i&&o===i.field&&(e.type=e.type||i.type,e.matchMode=e.matchMode||_.get(t.table.matchModeTypesMap[e.type],0)),n.push({field:o,value:e.value,matchMode:e.matchMode,type:e.type}))})),this.table.gridOptions.searchHandler(n,void 0,"search"),i&&this.getFilterOnFieldValues(i)},e.prototype.refreshData=function(e){if(this.table.datasource){var t=e?this.table.dataNavigator.dn.currentPage:1,n=this.table.sortInfo,i=n&&n.direction?n.field+" "+n.direction:"",o=this.getFilterFields(this.table.filterInfo),a=this.getLogicalOperator(o);r.refreshDataSource(this.table.datasource,{page:t,filterFields:o,orderBy:i,condition:a})}},e}();G.decorators=[{type:t.Directive,args:[{selector:"[wmTableFilterSort]"}]}],G.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Self},{type:t.Inject,args:[S]}]}]};var V=function(){r.register("wm-table-action",new Map([["accessroles",r.PROP_STRING],["action",r.PROP_STRING],["caption",r.PROP_STRING],["class",r.PROP_STRING],["conditionalclass",r.PROP_ANY],["conditionalstyle",r.PROP_ANY],["disabled",Object.assign({value:!1},r.PROP_BOOLEAN)],["display-name",r.PROP_STRING],["hyperlink",r.PROP_STRING],["icon",r.PROP_STRING],["iconclass",r.PROP_STRING],["key",r.PROP_STRING],["position",Object.assign({value:"footer"},r.PROP_STRING)],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["title",r.PROP_STRING],["target",r.PROP_STRING],["widget-type",Object.assign({value:"button"},r.PROP_STRING)]]))},W={widgetType:"wm-table-action",hostClass:""},U=function(e){function t(t,n){var i=e.call(this,t,W)||this;return i.table=n,i}return g(t,e),t.prototype.populateAction=function(){this.buttonDef={key:this.key,displayName:this["display-name"]||this.caption||"",show:this.show,class:this.class||"",iconclass:this.iconclass||"",title:_.isUndefined(this.title)?this["display-name"]||"":this.title,action:this.action,accessroles:this.accessroles,shortcutkey:this.shortcutkey,disabled:this.disabled,tabindex:this.tabindex,icon:this.icon,position:this.position,widgetType:this["widget-type"],hyperlink:this.hyperlink,target:this.target||"",conditionalclass:this.conditionalclass||"",conditionalstyle:this.conditionalstyle||{}},this._propsInitialized=!0},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.populateAction(),this.table.registerActions(this.buttonDef)},t.prototype.onPropertyChange=function(e,t){this._propsInitialized&&("display-name"===e?this.buttonDef.displayName=t:this.buttonDef[e]=t)},t}(r.BaseComponent);U.initializeProps=V(),U.decorators=[{type:t.Directive,args:[{selector:"[wmTableAction]",providers:[r.provideAsWidgetRef(U)]}]}],U.ctorParameters=function(){return[{type:t.Injector},{type:S,decorators:[{type:t.Optional}]}]};var q=function(){r.register("wm-table-column",new Map([["accessroles",r.PROP_STRING],["autoclose",Object.assign({value:"outsideClick"},r.PROP_STRING)],["backgroundcolor",r.PROP_STRING],["binding",r.PROP_STRING],["caption",r.PROP_STRING],["checkedvalue",r.PROP_STRING],["col-class",r.PROP_STRING],["collapsible",r.PROP_BOOLEAN],["col-ng-class",r.PROP_STRING],["currencypattern",r.PROP_STRING],["customExpression",r.PROP_BOOLEAN],["dataentrymode",Object.assign({value:"default"},r.PROP_STRING)],["datafield",r.PROP_STRING],["dataoptions",r.PROP_ANY],["dataset",r.PROP_ANY],["datasource",r.PROP_STRING],["dateformat",r.PROP_STRING],["datepattern",r.PROP_STRING],["debouncetime",Object.assign({value:250},r.PROP_NUMBER)],["defaultvalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["displayfield",r.PROP_STRING],["displaylabel",r.PROP_STRING],["editdatepattern",r.PROP_STRING],["outputformat",r.PROP_STRING],["edit-widget-type",r.PROP_STRING],["editinputtype",r.PROP_STRING],["exportexpression",r.PROP_STRING],["filterdataset",r.PROP_STRING],["filterdatafield",r.PROP_STRING],["filterdisplayfield",r.PROP_STRING],["filterdisplaylabel",r.PROP_STRING],["filterexpressions",Object.assign({value:"{}"},r.PROP_STRING)],["filtersearchkey",r.PROP_STRING],["filter-on",r.PROP_STRING],["filteronfilter",r.PROP_STRING],["filterplaceholder",r.PROP_STRING],["filterwidget",r.PROP_STRING],["filterinputtype",r.PROP_STRING],["formatpattern",r.PROP_STRING],["custompipeformat",r.PROP_STRING],["fractionsize",r.PROP_STRING],["generator",r.PROP_STRING],["groupby",r.PROP_STRING],["limit",r.PROP_NUMBER],["match",r.PROP_STRING],["matchmode",r.PROP_STRING],["maxchars",r.PROP_NUMBER],["maxvalue",r.PROP_NUMBER],["step",r.PROP_NUMBER],["mobiledisplay",Object.assign({value:!0},r.PROP_BOOLEAN)],["minvalue",r.PROP_NUMBER],["maxdate",r.PROP_STRING],["mindate",r.PROP_STRING],["excludedays",r.PROP_STRING],["excludedates",r.PROP_STRING],["maxtime",r.PROP_STRING],["mintime",r.PROP_STRING],["pcdisplay",Object.assign({value:!0},r.PROP_BOOLEAN)],["period",r.PROP_BOOLEAN],["placeholder",r.PROP_STRING],["prefix",r.PROP_STRING],["primary-key",r.PROP_BOOLEAN],["readonly",r.PROP_BOOLEAN],["regexp",r.PROP_ANY],["related-entity-name",r.PROP_STRING],["required",r.PROP_BOOLEAN],["rowactionsposition",r.PROP_STRING],["searchkey",r.PROP_STRING],["searchable",Object.assign({value:!0},r.PROP_BOOLEAN)],["showinfilter",Object.assign({value:!1},r.PROP_BOOLEAN)],["suffix",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["showcount",r.PROP_BOOLEAN],["showdropdownon",Object.assign({value:"default"},r.PROP_STRING)],["sortable",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabletdisplay",Object.assign({value:!0},r.PROP_BOOLEAN)],["textalignment",Object.assign({value:"left"},r.PROP_STRING)],["textcolor",r.PROP_STRING],["type",Object.assign({value:"string"},r.PROP_STRING)],["uncheckedvalue",r.PROP_STRING],["validationmessage",r.PROP_STRING],["widget-type",r.PROP_STRING],["width",r.PROP_STRING]]))},z=function(){r.register("wm-table-column-group",new Map([["backgroundcolor",r.PROP_STRING],["caption",r.PROP_STRING],["col-class",r.PROP_STRING],["name",r.PROP_STRING],["textalignment",Object.assign({value:"center"},r.PROP_STRING)]]))},H={widgetType:"wm-table-column-group",hostClass:""},Y=function(e){function t(t,n,i){var o=e.call(this,t,H)||this;return o.group=n,o.table=i,o.config={},o}return g(t,e),t.prototype.populateConfig=function(){this.config={field:this.name,displayName:this.caption||"",columns:[],isGroup:!0,accessroles:this.accessroles,textAlignment:this.textalignment||"center",backgroundColor:this.backgroundcolor,class:this["col-class"]}},t.prototype.onPropertyChange=function(t,n,i){"caption"===t?(this.config.displayName=n||"",this.table.callDataGridMethod("setColumnProp",this.config.field,"displayName",n,!0)):e.prototype.onPropertyChange.call(this,t,n,i)},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.populateConfig();var t=parseInt(this.getAttr("headerIndex"),10),n=parseInt(this.getAttr("index"),10),i=this.group&&this.group.name;r.setHeaderConfigForTable(this.table.headerConfig,this.config,i,i?n:t)},t}(r.BaseComponent);Y.initializeProps=z(),Y.decorators=[{type:t.Directive,args:[{selector:"[wmTableColumnGroup]",providers:[r.provideAsWidgetRef(Y)]}]}],Y.ctorParameters=function(){return[{type:t.Injector},{type:Y,decorators:[{type:t.SkipSelf},{type:t.Optional}]},{type:S,decorators:[{type:t.Optional}]}]};var K={widgetType:"wm-table-column",hostClass:""},Q=["datafield","displayfield","placeholder","searchkey","matchmode","displaylabel","groupby","match","dateformat","showcount","collapsible","checkedvalue","uncheckedvalue","showdropdownon","dataentrymode","autoclose","dataset","outputformat"];Q=w(w([],b(Q)),b(["maxchars","regexp","minvalue","maxvalue","step","required","mindate","maxdate","excludedates","excludedays","mintime","maxtime"]));var Z=function(){function e(e){this.widget=e}return e.prototype.focus=function(){this.widget.focus()},e.prototype.setProperty=function(e,t){e="value"===e?"datavalue":e,this.widget[e]=t},e.prototype.getProperty=function(e){return e="value"===e?"datavalue":e,this.widget[e]},e}(),J=function(e){function t(t,n,i,o,a,r){var s=e.call(this,t,K)||this;return s.appDefaults=n,s.table=i,s.group=o,s.bindfilterdataset=a,s.binddataset=r,s.syncValidators=[],s.asyncValidators=[],s.observeOnFields=[],s.aggregate={sum:function(){return _.sum(s._getColumnData())},average:function(e){return void 0===e&&(e=2),_.round(_.mean(s._getColumnData()),e)},count:function(){return s._getColumnData().length},minimum:function(){return _.min(s._getColumnData())},maximum:function(){return _.max(s._getColumnData())},percent:function(e,t){return void 0===t&&(t=2),_.round(_.sum(s._getColumnData())/e*100,t)}},s.notifyForFields=[],s}return g(t,e),Object.defineProperty(t.prototype,"dataoptions",{get:function(){return this._dataoptions},set:function(e){this._dataoptions=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"datasource",{get:function(){return this._datasource},set:function(e){this._datasource=e},enumerable:!1,configurable:!0}),t.prototype.ngOnInit=function(){var t=this;e.prototype.ngOnInit.call(this),this.populateFieldDef();var n=parseInt(this.getAttr("index"),10),i=parseInt(this.getAttr("headerIndex"),10),o=this.group&&this.group.name;if(r.setHeaderConfigForTable(this.table.headerConfig,{field:this.field,displayName:this.displayName},o,o?n:i),this.table.registerColumns(this.widget,n),this._isRowFilter="multicolumn"===this.table.filtermode&&this.searchable,this._isInlineEditable=!this.readonly&&this.table.editmode!==r.EDIT_MODE.DIALOG&&this.table.editmode!==r.EDIT_MODE.FORM,this._isNewEditableRow=this._isInlineEditable&&this.table.editmode===r.EDIT_MODE.QUICK_EDIT&&this.table.shownewrow,this.setUpControls(),this._propsInitialized=!0,this.getFormControl()){var a=this.getFormControl().statusChanges.pipe(m.debounceTime(100)).subscribe((function(e){return t.onStatusChange(e,"inlineInstance")}));this.registerDestroyListener((function(){return a.unsubscribe()})),this.fieldValidations=new r.BaseFieldValidations(this,this.inlineInstance,this.editWidgetType,this.getFormControl(),this.table,"inlineInstance")}if(this._checkNewEditableRowControl()){var s=this.getFormControl("_new").statusChanges.pipe(m.debounceTime(100)).subscribe((function(e){return t.onStatusChange(e,"inlineInstanceNew")}));this.registerDestroyListener((function(){return s.unsubscribe()})),this.fieldValidations_new=new r.BaseFieldValidations(this,this.inlineInstanceNew,this.editWidgetType,this.getFormControl("_new"),this.table,"inlineInstanceNew")}},t.prototype.ngAfterContentInit=function(){var t=this;if(this._isRowFilter){var n=this._filterInstances.changes.subscribe((function(e){t.filterInstance=e.first&&e.first.widget,t.setUpFilterWidget()}));this.registerDestroyListener((function(){return n.unsubscribe()}))}if(this._isInlineEditable){var i=this._inlineInstances.changes.subscribe((function(e){t.inlineInstance=e.first&&e.first.widget,t.fieldValidations.formwidget=e.first,t.table.registerFormField(t.binding,new Z(t.inlineInstance)),t.setUpInlineWidget("inlineInstance")}));if(this.registerDestroyListener((function(){return i.unsubscribe()})),this._isNewEditableRow){var o=this._inlineInstancesNew.changes.subscribe((function(e){t.inlineInstanceNew=e.first&&e.first.widget,t.fieldValidations_new.formwidget=e.first,t.setUpInlineWidget("inlineInstanceNew")}));this.registerDestroyListener((function(){return o.unsubscribe()}))}}this.registerReadyStateListener((function(){t.key=t.field||t.binding})),e.prototype.ngAfterContentInit.call(this),this.table.isdynamictable&&this.table.inlineWidgetTmpl._results.push(this.inlineWidthTempRef)},t.prototype.ngAfterViewInit=function(){this.filterTemplateRef&&this.table.renderDynamicFilterColumn(this.filterTemplateRef)},t.prototype.applyValidations=function(){this.getFormControl()&&(this.syncValidators.length>0&&this.fieldValidations.setValidators(this.syncValidators),this.fieldValidations.setUpValidators(),this.asyncValidators.length>0&&this.fieldValidations.setAsyncValidators(this.asyncValidators),this.observeOnFields.length>0&&this.fieldValidations.observeOn(this.observeOnFields,"columns"))},t.prototype.removeValidations=function(){this.table.ngform.markAsUntouched();var e=this.getFormControl();e&&(e.clearValidators(),e.clearAsyncValidators(),e.updateValueAndValidity())},t.prototype.applyNewRowValidations=function(){this._checkNewEditableRowControl()&&(this.syncValidators.length>0&&this.fieldValidations_new.setValidators(this.syncValidators),this.fieldValidations_new.setUpValidators(),this.asyncValidators.length>0&&this.fieldValidations_new.setAsyncValidators(this.asyncValidators),this.observeOnFields.length>0&&this.fieldValidations_new.observeOn(this.observeOnFields,"columns"))},t.prototype.removeNewRowValidations=function(){if(this.table.ngform.markAsUntouched(),this._checkNewEditableRowControl()){var e=this.getFormControl("_new");e.clearValidators(),e.clearAsyncValidators(),e.updateValueAndValidity()}},t.prototype.addFormControl=function(e){var t=e?this.binding+e:this.binding;this.table.ngform.addControl(t,this.table.fb.control(""))},t.prototype.getFormControl=function(e){var t=e?this.binding+e:this.binding;return this.table.ngform.controls[t]},t.prototype._checkNewEditableRowControl=function(){return this._isNewEditableRow&&this.getFormControl("_new")},t.prototype.setUpControls=function(){var e=this;if(this._isInlineEditable){if(this.editWidgetType===u.FormWidgetType.UPLOAD)return;this.addFormControl();var t=this.getFormControl();if(t){var n=t.valueChanges.pipe(m.debounceTime(200)).subscribe((function(t){return e.onValueChange(t,"inlineInstance")}));this.registerDestroyListener((function(){return n.unsubscribe()}))}if(this._isNewEditableRow){this.addFormControl("_new");var i=this.getFormControl("_new");if(i){var o=i.valueChanges.pipe(m.debounceTime(200)).subscribe((function(t){return e.onValueChange(t,"inlineInstanceNew")}));this.registerDestroyListener((function(){return o.unsubscribe()}))}}}if(this._isRowFilter&&(this.addFormControl("_filter"),this.filterControl=this.getFormControl("_filter"),this.filterControl)){var a=this.filterControl.valueChanges.subscribe(this.onFilterValueChange.bind(this));this.registerDestroyListener((function(){return a.unsubscribe()}))}},t.prototype.resetFilter=function(){this.filterControl&&this.filterControl.setValue(""),this.filterwidget===u.FormWidgetType.AUTOCOMPLETE&&(this.filterInstance.query="",this.filterInstance.queryModel="")},t.prototype.onFilterValueChange=function(e){this.table.rowFilter[this.field].value=e},Object.defineProperty(t.prototype,"datavalue",{get:function(){return this[this.activeControlType]&&this[this.activeControlType].datavalue},set:function(e){var t=this.getFormControl("inlineInstanceNew"===this.activeControlType?"_new":void 0);t&&t&&this.editWidgetType!==u.FormWidgetType.UPLOAD&&t.setValue(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.datavalue},set:function(e){this.datavalue=e},enumerable:!1,configurable:!0}),t.prototype.onValueChange=function(e,t){null!==e&&r.applyFilterOnField(this.table.datasource,this.widget,this.table.fieldDefs,e,{widget:"edit-widget-type"}),this.table.ngform.touched&&(this.activeControlType=t,"inlineInstance"===t?(this.notifyChanges(),this.fieldValidations.setCustomValidationMessage()):this._isNewEditableRow&&(this.notifyChanges("_new"),this.fieldValidations_new.setCustomValidationMessage()))},t.prototype.loadFilterData=function(){var e=this;this._isRowFilter&&r.isDataSetWidget(this.filterwidget)&&!this.bindfilterdataset&&(this.table.datasource.execute(u.DataSource.Operation.SUPPORTS_DISTINCT_API)?(this.relatedEntityName&&(this.widget["is-related"]=!0,this.widget["lookup-type"]=this.relatedEntityName,this.widget["lookup-field"]=_.last(_.split(this.field,"."))),this.filterwidget===u.FormWidgetType.AUTOCOMPLETE?(this.filterInstance.dataoptions=r.getDistinctFieldProperties(this.table.datasource,this),this.filterInstance.datasource=this.table.datasource):r.getDistinctValues(this.table.datasource,this.widget,"filterwidget").then((function(t){e._filterDataSet=t.data,e.setFilterWidgetDataSet()}))):this.registerDestroyListener(u.$watch(this.table.binddataset,this.viewParent,{},(function(t){return e.widget.filterdataset=t}),r.getWatchIdentifier(this.widgetId,"filterdataset"))))},t.prototype.loadInlineWidgetData=function(){if(r.isDataSetWidget(this["edit-widget-type"])&&!this.binddataset&&!this.readonly){var e=this.table.datasource;if(this["related-entity-name"]&&this["primary-key"]){this.isDataSetBound=!0;var t=_.split(this.binding,".");this.showPendingSpinner=!0,r.fetchRelatedFieldData(e,this.widget,{relatedField:_.head(t),datafield:_.last(t),widget:"edit-widget-type"})}else e.execute(u.DataSource.Operation.SUPPORTS_DISTINCT_API)&&r.getDistinctValuesForField(e,this.widget,{widget:"edit-widget-type"})}},t.prototype.onDataSourceChange=function(){this.loadFilterData(),this.table.editmode===r.EDIT_MODE.QUICK_EDIT&&this.loadInlineWidgetData()},t.prototype.setFilterWidgetDataSet=function(){this.filterInstance&&(this.filterInstance.dataset=this._filterDataSet)},t.prototype.setUpFilterWidget=function(){var e=this;this.filterInstance.registerReadyStateListener((function(){if(r.isDataSetWidget(e.filterwidget)){var t=_.last(e.binding.split("."));e.filterInstance.dataset=e._filterDataSet,e.filterInstance.datafield=e.filterdatafield||t,e.filterInstance.displayfield=e.filterdisplayfield||t,e.filterwidget===u.FormWidgetType.AUTOCOMPLETE&&(e.filterInstance.displaylabel=e.filterdisplaylabel||t,e.filterInstance.searchkey=e.filtersearchkey||t)}e.filterwidget===u.FormWidgetType.TIME&&(e.filterInstance.timepattern=e.appDefaults.timeFormat||"hh:mm:ss a"),e.filterInstance.placeholder=e.filterplaceholder||""}))},t.prototype.notifyChanges=function(e){var t=this;_.forEach(this.notifyForFields,(function(n){e&&t._isNewEditableRow?n.fieldValidations_new.validate():n.fieldValidations.validate()}))},t.prototype.observeOn=function(e){this.observeOnFields=_.cloneDeep(e)},t.prototype.setUpValidators=function(){this.fieldValidations.setUpValidators(),this._checkNewEditableRowControl()&&this.fieldValidations_new.setUpValidators()},t.prototype.setAsyncValidators=function(e){this.asyncValidators=_.cloneDeep(e)},t.prototype.setValidators=function(e){this.syncValidators=_.cloneDeep(e)},t.prototype.boundFn=function(e){return e()},t.prototype.onStatusChange=function(e,t){this["showPendingSpinner"+("inlineInstance"===t?"":"New")]="PENDING"===e},t.prototype.setSummaryRowData=function(e){var t=e instanceof Array?e:[e];this._invokeSummaryRowData(t)},t.prototype._invokeSummaryRowData=function(e){var t=this;_.forEach(e,(function(e,n){var i=e;if(i instanceof Promise)i.then((function(e){t.table.callDataGridMethod("setSummaryRowDef",t.key,e,n,!0)}));else if(i.value&&i.value instanceof Promise){var o=i;i.value.then((function(e){o.value=e,t.table.callDataGridMethod("setSummaryRowDef",t.key,o,n,!0)}))}t.table.callDataGridMethod("setSummaryRowDef",t.key,i,n)}))},t.prototype._getColumnData=function(){return _.map(this.table.dataset,this.binding)},t.prototype.setInlineWidgetProp=function(e,t,n){"datepattern"===t&&this.editWidgetType===u.FormWidgetType.TIME&&(t="timepattern"),this[e]&&u.isDefined(n)&&(this[e][t]=n)},t.prototype.setUpInlineWidget=function(e){var t=this;this[e].registerReadyStateListener((function(){r.isDataSetWidget(t["edit-widget-type"])&&(t[e].dataset=t.dataset),Q.forEach((function(n){t.setInlineWidgetProp(e,n,t[n])})),t[e].datasource=t._datasource,t[e].dataoptions=t._dataoptions,t.setInlineWidgetProp(e,"datepattern",t.editdatepattern)}))},t.prototype.getStyleDef=function(){return"width: "+(this.width||"")+"; background-color: "+(this.backgroundcolor||"")+"; color: "+(this.textcolor||"")+";"},t.prototype.populateFieldDef=function(){if(this.width="px"===this.width?"":this.width||"",this.field=this.binding,this.displayName=this.caption||"",this.pcDisplay=this.pcdisplay,this.mobileDisplay=this.mobiledisplay,this.tabletDisplay=this.tabletdisplay,this.textAlignment=this.textalignment,this.backgroundColor=this.backgroundcolor,this.textColor=this.textcolor,this.primaryKey=this["primary-key"],this.relatedEntityName=this["related-entity-name"],this.style=this.getStyleDef(),this.class=this["col-class"],this.ngclass=this["col-ng-class"],this.formatpattern="toNumber"===this.formatpattern?"numberToString":this.formatpattern,this.searchable="blob"!==this.type&&"clob"!==this.type&&this.searchable,this.showinfilter=!this.nativeElement.hasAttribute("showinfilter")||this.table&&this.table.isdynamictable?this.show:this.nativeElement.getAttribute("showinfilter"),this.limit=this.limit?+this.limit:void 0,this.editWidgetType=this["edit-widget-type"]=this["edit-widget-type"]||r.getEditModeWidget(this),this.filterOn=this["filter-on"],this.readonly=u.isDefined(this.getAttr("readonly"))?"true"===this.getAttr("readonly"):this["related-entity-name"]?!this["primary-key"]:_.includes(["identity","uniqueid","sequence"],this.generator),this.filterwidget=this.filterwidget||r.getDataTableFilterWidget(this.type||"string"),this.isFilterDataSetBound=!!this.bindfilterdataset,this.defaultvalue=r.getDefaultValue(this.defaultvalue,this.type,this.editWidgetType),u.isDateTimeType(this.type)&&"toDate"===this.formatpattern&&!this.datepattern){var e=u.getDisplayDateTimeFormat(this.type);this.type===u.DataType.DATE?this.datepattern=this.appDefaults.dateFormat||e:this.type===u.DataType.TIME?this.datepattern=this.appDefaults.timeFormat||e:this.type!==u.DataType.TIMESTAMP&&this.type!==u.DataType.DATETIME||(this.datepattern=this.appDefaults.dateTimeFormat||e)}},t.prototype.onPropertyChange=function(t,n,i){if(this._propsInitialized){switch(t){case"caption":this.displayName=n||"",this.setProperty("displayName",this.displayName);break;case"defaultvalue":this.defaultvalue=r.getDefaultValue(this.defaultvalue,this.type,this.editWidgetType);break;case"show":this.table.redraw(!0),this.showinfilter=this.nativeElement.hasAttribute("showinfilter")?this.nativeElement.getAttribute("showinfilter"):n;break;case"filterdataset":this._filterDataSet=n,this.setFilterWidgetDataSet();break;case"editdatepattern":this.setInlineWidgetProp("inlineInstance","datepattern",n),this.setInlineWidgetProp("inlineInstanceNew","datepattern",n);break;case"showinfilter":this.showinfilter=n;break;default:Q.includes(t)&&(this.setInlineWidgetProp("inlineInstance",t,n),this.setInlineWidgetProp("inlineInstanceNew",t,n))}e.prototype.onPropertyChange.call(this,t,n,i)}},t.prototype.setProperty=function(e,t){switch(this[e]=t,e){case"displayName":this.table.callDataGridMethod("setColumnProp",this.field,e,t);break;default:this.table.redraw(!0)}},t}(r.BaseComponent);J.initializeProps=q(),J.decorators=[{type:t.Directive,args:[{selector:"[wmTableColumn]",providers:[r.provideAsWidgetRef(J)]}]}],J.ctorParameters=function(){return[{type:t.Injector},{type:u.AppDefaults},{type:S,decorators:[{type:t.Optional}]},{type:Y,decorators:[{type:t.Optional}]},{type:void 0,decorators:[{type:t.Attribute,args:["filterdataset.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["dataset.bind"]}]}]},J.propDecorators={_filterInstances:[{type:t.ContentChildren,args:["filterWidget"]}],_inlineInstances:[{type:t.ContentChildren,args:["inlineWidget"]}],_inlineInstancesNew:[{type:t.ContentChildren,args:["inlineWidgetNew"]}],customExprTmpl:[{type:t.ContentChild,args:["customExprTmpl"]}],inlineWidthTempRef:[{type:t.ContentChild,args:["inlineWidgetTmpl"]}],filterTemplateRef:[{type:t.ContentChild,args:["filterTmpl"]}]};var X=function(){r.register("wm-table-row",new Map([["class",r.PROP_STRING],["closeothers",Object.assign({value:!0},r.PROP_BOOLEAN)],["content",r.PROP_STRING],["columnwidth",Object.assign({value:"30px"},r.PROP_STRING)],["collapseicon",r.PROP_STRING],["expandicon",r.PROP_STRING],["height",r.PROP_STRING],["position",Object.assign({value:"0"},r.PROP_STRING)]]))},ee={widgetType:"wm-table-row",hostClass:""},te=function(e){function t(t,n){var i=e.call(this,t,ee)||this;return i.table=n,i}return g(t,e),t.prototype.populateConfig=function(){this.config={closeothers:this.closeothers,content:this.content,columnwidth:this.columnwidth,expandicon:this.expandicon,collapseicon:this.collapseicon,height:this.height,position:this.position}},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.populateConfig(),this.table.registerRow(this.config,this)},t.prototype.onPropertyChange=function(e,t){"content"===e&&this.config&&(this.config.content=this.content)},t}(r.BaseComponent);te.initializeProps=X(),te.decorators=[{type:t.Directive,args:[{selector:"[wmTableRow]",providers:[r.provideAsWidgetRef(te)]}]}],te.ctorParameters=function(){return[{type:t.Injector},{type:S,decorators:[{type:t.Optional},{type:t.SkipSelf}]}]};var ne=function(){r.register("wm-table-row-action",new Map([["accessroles",r.PROP_STRING],["action",r.PROP_STRING],["caption",r.PROP_STRING],["class ",Object.assign({value:"btn-secondary"},r.PROP_STRING)],["disabled",Object.assign({value:!1},r.PROP_BOOLEAN)],["display-name",r.PROP_STRING],["hyperlink",r.PROP_STRING],["iconclass",r.PROP_STRING],["key",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["target",r.PROP_STRING],["title",r.PROP_STRING],["widget-type",Object.assign({value:"button"},r.PROP_STRING)]]))},ie={widgetType:"wm-table-row-action",hostClass:""},oe=function(e){function t(t,n,i){var o=e.call(this,t,ie)||this;return o.table=n,i[0].editRow=function(e){return o.table.editRow(e)},i[0].deleteRow=function(e){return o.table.deleteRow(e)},i[0].addNewRow=function(e){return o.table.addNewRow(e)},o}return g(t,e),t.prototype.getTitle=function(){return _.isUndefined(this.title)?this["display-name"]||"":this.title},t.prototype.populateAction=function(){this.buttonDef={key:this.key,displayName:this["display-name"]||this.caption||"",show:this.show,class:this.class||"",iconclass:this.iconclass||"",title:this.getTitle(),action:this.action,accessroles:this.accessroles,disabled:this.disabled,tabindex:this.tabindex?+this.tabindex:void 0,widgetType:this["widget-type"]||"button",hyperlink:this.hyperlink,target:this.target||"",conditionalclass:this.conditionalclass||"",conditionalstyle:this.conditionalstyle||{}}},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.populateAction(),this.table.registerRowActions(this.buttonDef)},t}(r.BaseComponent);oe.initializeProps=ne(),oe.decorators=[{type:t.Directive,args:[{selector:"[wmTableRowAction]",providers:[r.provideAsWidgetRef(oe),{provide:r.Context,useValue:{},multi:!0}]}]}],oe.ctorParameters=function(){return[{type:t.Injector},{type:S,decorators:[{type:t.Optional}]},{type:Array,decorators:[{type:t.Self},{type:t.Inject,args:[r.Context]}]}]};var ae=[S,x,G,U,J,Y,te,oe],re=function(){};re.decorators=[{type:t.NgModule,args:[{imports:[s.BasicModule,a.BsDropdownModule,n.CommonModule,i.FormsModule,i.ReactiveFormsModule,l.InputModule,p.ListModule,c.MenuModule,d.PaginationModule,o.TooltipModule,r.WmComponentsModule],declarations:w([],b(ae)),exports:w([],b(ae)),entryComponents:[]}]}],e.TableActionDirective=U,e.TableCUDDirective=x,e.TableColumnDirective=J,e.TableColumnGroupDirective=Y,e.TableComponent=S,e.TableFilterSortDirective=G,e.TableModule=re,e.TableRowActionDirective=oe,e.TableRowDirective=te,e["\u0275a"]=P,e["\u0275b"]=V,e["\u0275c"]=z,e["\u0275d"]=q,e["\u0275e"]=X,e["\u0275f"]=ne,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@wm/components/base"),require("rxjs/operators"),require("@wm/core"),require("@wm/components/data/table")):"function"==typeof define&&define.amd?define("@wm/components/data/live-table",["exports","@angular/core","@angular/common","@wm/components/base","rxjs/operators","@wm/core","@wm/components/data/table"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.data=e.wm.components.data||{},e.wm.components.data.livetable={}),e.ng.core,e.ng.common,e.wm.components.base,e.rxjs.operators,e.wm.core,e.wm.components.data.table)}(this,(function(e,t,n,i,o,a,r){"use strict";
521
521
  /*! *****************************************************************************
522
522
  Copyright (c) Microsoft Corporation.
523
523
 
@@ -742,4 +742,4 @@ var c=function(e,t){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Arr
742
742
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
743
743
  PERFORMANCE OF THIS SOFTWARE.
744
744
  ***************************************************************************** */
745
- var Y=function(e,t){return(Y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function K(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Y(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function Q(e,t,n,i){return new(n||(n=Promise))((function(o,a){function r(e){try{l(i.next(e))}catch(e){a(e)}}function s(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}))}function Z(e,t){var n,i,o,a,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],i=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}Object.create;function J(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function X(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,a=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return r}function ee(e,t,n){if(n||2===arguments.length)for(var i,o=0,a=t.length;o<a;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var te=function(){function e(){this.fragments=0,this.fragmentsLoaded$=new l.Subject}return e.prototype.init=function(){var e=this;this.viewInit$.subscribe(o.noop,o.noop,(function(){e.isViewInitialized=!0,e.isReady()}))},e.prototype.registerFragment=function(){this.fragments++},e.prototype.resolveFragment=function(){this.fragments--,this.isReady()},e.prototype.isReady=function(){this.isViewInitialized&&!this.fragments&&(this.registerFragment=o.noop,this.resolveFragment=o.noop,this.fragmentsLoaded$.complete())},e}();te.decorators=[{type:t.Directive}],te.ctorParameters=function(){return[]};var ne={},ie=function(e){function t(){var t=e.apply(this,ee([],X(arguments)))||this;return t.compileContent=!1,t.destroy$=new l.Subject,t.viewInit$=new l.Subject,t}return K(t,e),t.prototype.getContainerWidgetInjector=function(){return this.containerWidget.inj||this.containerWidget.injector},t.prototype.init=function(){var t=this;this.App=this.injector.get(o.App),this.containerWidget=this.injector.get(c.WidgetRef),this.i18nService=this.injector.get(o.AbstractI18nService),this.scriptLoaderService=this.injector.get(o.ScriptLoaderService),this.Viewport=this.injector.get(o.Viewport),this.getContainerWidgetInjector().view.component.registerFragment&&this.getContainerWidgetInjector().view.component.registerFragment(),this.registerExpressions(),this.initUserScript(),this.registerWidgets(),this.initVariables(),this.activePageName=this.App.activePageName,this.registerPageParams(),this.defineI18nProps(),this.viewInit$.subscribe(o.noop,o.noop,(function(){t.pageParams=t.containerWidget.partialParams})),this.spa?this.pageDirective=this.injector.get(s.SpaPageDirective,null):this.pageDirective=this.injector.get(s.PageDirective,null),this.pageDirective&&(this.registerDestroyListener(this.pageDirective.subscribe("attach",(function(e){return t.ngOnAttach(e.refreshData)}))),this.registerDestroyListener(this.pageDirective.subscribe("detach",(function(){return t.ngOnDetach()})))),e.prototype.init.call(this)},t.prototype.registerWidgets=function(){"Common"===this.partialName?this.Widgets=ne:this.Widgets=Object.create(ne),this.containerWidget.Widgets=this.Widgets},t.prototype.registerDestroyListener=function(e){this.destroy$.subscribe(o.noop,o.noop,(function(){return e()}))},t.prototype.initUserScript=function(){try{this.getContainerWidgetInjector().view.component.prefabName&&(this.getContainerWidgetInjector().view.component.Prefab?this.Prefab=this.getContainerWidgetInjector().view.component.Prefab:this.Prefab=this.getContainerWidgetInjector().view.component),this.evalUserScript(this,this.App,this.injector.get(o.UtilsService))}catch(e){console.error("Error in evaluating partial ("+this.partialName+") script\n",e)}},t.prototype.initVariables=function(){var e=this,t=this.injector.get(r.VariablesService).register(this.partialName,this.getVariables(),this);this.Variables=Object.create(this.App.Variables),this.Actions=Object.create(this.App.Actions),this.containerWidget.Variables=this.Variables,this.containerWidget.Actions=this.Actions,Object.entries(t.Variables).forEach((function(t){var n=X(t,2),i=n[0],o=n[1];return e.Variables[i]=o})),Object.entries(t.Actions).forEach((function(t){var n=X(t,2),i=n[0],o=n[1];return e.Actions[i]=o})),this.viewInit$.subscribe(o.noop,o.noop,(function(){o.$invokeWatchers(!0,!0),t.callback(t.Variables).catch(o.noop),t.callback(t.Actions)}))},t.prototype.registerExpressions=function(){var e=this.getExpressions();_.each(e,(function(e,t){o.registerFnByExpr(t,e[0],e[1])}))},t.prototype.registerPageParams=function(){this.pageParams=this.containerWidget.partialParams},t.prototype.defineI18nProps=function(){this.appLocale=this.i18nService.getAppLocale()},t.prototype.invokeOnReady=function(){var e;this.containerWidget.userComponentParams&&(e=this.containerWidget.userComponentParams),this.onReady(e),this.getContainerWidgetInjector().view.component.resolveFragment&&this.getContainerWidgetInjector().view.component.resolveFragment()},t.prototype.loadScripts=function(){var e=this;return new Promise((function(t){var n,i=e.partialDirective.$element.attr("scripts-to-load");i?(n=e.scriptLoaderService).load.apply(n,ee([],X(i.split(",")))).then(t):t()}))},t.prototype.mute=function(){var e=function(e){e&&e.mute&&e.mute()};_.each(this.Widgets,e),_.each(this.Variables,e),_.each(this.Actions,e)},t.prototype.unmute=function(){var e=function(e){e&&e.unmute&&e.unmute()};_.each(this.Widgets,e),_.each(this.Variables,e),_.each(this.Actions,e)},t.prototype.ngAfterViewInit=function(){var e=this;this.loadScripts().then((function(){e.compileContent=!0,setTimeout((function(){e.viewInit$.complete(),e.fragmentsLoaded$.subscribe(o.noop,o.noop,(function(){return e.invokeOnReady()}))}),100)}))},t.prototype.ngOnDestroy=function(){this.destroy$.complete()},t.prototype.ngOnAttach=function(e){if(this.unmute(),e){var t=function(e){e&&e.startUpdate&&e.invoke&&e.invoke()};_.each(this.Variables,t),_.each(this.Actions,t)}_.each(this.Widgets,(function(e){return e&&e.ngOnAttach&&e.ngOnAttach()}))},t.prototype.ngOnDetach=function(){this.mute(),_.each(this.Widgets,(function(e){return e&&e.ngOnDetach&&e.ngOnDetach()}))},t.prototype.onReady=function(e){},t}(te);ie.decorators=[{type:t.Directive}],ie.propDecorators={partialDirective:[{type:t.ViewChild,args:[c.PartialDirective]}]};var oe="_cache_page",ae="REUSE_ROUTE_STRATEGY.MAX_CACHE_SIZE",re="REUSE_ROUTE_STRATEGY.MAX_CACHE_AGE",se=function(){function e(e,t){var n=this;this.maxCacheSize=e,this.maxCacheAge=t,this.paramsToIgnore=["wm_state",oe],this.getSize=function(e){return e?Object.keys(e).length:0},this.cache=new o.LRUCache(e,t,(function(e,t){n.currentRouteKey===e?n.cache.set(e,t):t.componentRef.destroy()}))}return e.prototype.getKey=function(e){var t=this,n=_.chain(e.queryParams).keys().filter((function(e){return!_.includes(t.paramsToIgnore,e)})).orderBy().map((function(t){return t+"="+e.queryParams[t]})).value().join("&"),i=e.params.pageName;return e.data.pageName&&""===e.routeConfig.path&&(i=e.data.pageName),i&&i+(n?"?"+n:"")},e.prototype.isSameQueryParams=function(e,t){try{var n=e.queryParams,i=t.queryParams,o=n?this.getSize(n):0,a=i?this.getSize(i):0;return 0===o&&0===a||o===a&&JSON.stringify(n)===JSON.stringify(i)}catch(e){return!1}},e.prototype.isCacheEnabled=function(e,t){var n=e.queryParams._cache_page;return _.isNil(n)?t:"true"===n||!0===n},e.prototype.shouldDetach=function(e){var t=this.getKey(e);return!!this.isCacheEnabled(e,!!e.data._cache_page)||(this.cache.delete(t),!1)},e.prototype.shouldAttach=function(e){var t=this.getKey(e);this.currentRouteKey=t;var n=this.cache.get(t);return!(!n||!this.isCacheEnabled(e,!!n._cache_page))||(this.cache.delete(t),!1)},e.prototype.store=function(e,t){if(t){var n=this.getKey(e);t._cache_page=!!e.data._cache_page,this.cache.set(n,t)}},e.prototype.retrieve=function(e){var t=this.getKey(e);return this.cache.get(t)},e.prototype.reset=function(e){var t,n,i=this;if(!e)return this.cache.clear();this.cache.delete(e);var o=e+="?",a=[];try{for(var r=J(this.cache.keys()),s=r.next();!s.done;s=r.next()){var l=s.value;l.startsWith(o)&&a.push(l)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}a.forEach((function(e){return i.cache.delete(e)}))},e}(),le=function(e){function t(t,n){return e.call(this,t,n)||this}return K(t,e),t.prototype.isSameRoute=function(e,t){if(e.routeConfig&&"prefab-preview"===e.routeConfig.path)return!1;var n=e.params,i=t.params,o=this.getSize(n),a=this.getSize(i);return 0===o&&0===a||o===a&&(n.pageName===i.pageName&&this.isSameQueryParams(e,t))},t.prototype.shouldReuseRoute=function(e,t){return this.isSameRoute(e,t)},t}(se);le.ctorParameters=function(){return[{type:Number,decorators:[{type:t.Inject,args:[ae]}]},{type:Number,decorators:[{type:t.Inject,args:[re]}]}]};var ce=function(e){function t(t,n){return e.call(this,t,n)||this}return K(t,e),t.prototype.isSameRoute=function(e,t){return!e.routeConfig&&!t.routeConfig||e.routeConfig===t.routeConfig&&(e.routeConfig!==t.routeConfig||(!(!e.data.layoutName||!t.data.layoutName)||this.isSameQueryParams(e,t)))},t.prototype.shouldReuseRoute=function(e,t){return this.isSameRoute(e,t)},t}(se);ce.ctorParameters=function(){return[{type:Number,decorators:[{type:t.Inject,args:[ae]}]},{type:Number,decorators:[{type:t.Inject,args:[re]}]}]};var pe=function(e){function t(){var t=e.apply(this,ee([],X(arguments)))||this;return t.startupVariablesLoaded=!1,t.pageTransitionCompleted=!1,t.destroy$=new l.Subject,t.viewInit$=new l.Subject,t.formatsByLocale={timezone:""},t}return K(t,e),t.prototype.init=function(){o.muteWatchers(),this.App=this.injector.get(o.App),this.route=this.injector.get(n.ActivatedRoute),this.appManager=this.injector.get(j),this.navigationService=this.injector.get(o.AbstractNavigationService),this.scriptLoaderService=this.injector.get(o.ScriptLoaderService),this.i18nService=this.injector.get(o.AbstractI18nService),this.router=this.injector.get(n.Router),this.Viewport=this.injector.get(o.Viewport),this.registerExpressions(),this.initUserScript(),this.registerWidgets(),this.initVariables(),this.App.lastActivePageName=this.App.activePageName,this.App.activePageName=this.pageName,this.App.activePage=this,this.activePageName=this.pageName,this.registerPageParams(),this.defineI18nProps(),e.prototype.init.call(this)},t.prototype.registerWidgets=function(){this.Widgets=Object.create(ne),this.App.Widgets=Object.create(this.Widgets)},t.prototype.initUserScript=function(){try{this.evalUserScript(this,this.App,this.injector.get(o.UtilsService))}catch(e){console.error("Error in evaluating page ("+this.pageName+") script\n",e)}},t.prototype.registerPageParams=function(){var e=this,t=this.route.queryParams.subscribe((function(t){return e.pageParams=e.App.pageParams=_.extend({},t)}));this.registerDestroyListener((function(){return t.unsubscribe()}))},t.prototype.registerDestroyListener=function(e){this.destroy$.subscribe(o.noop,o.noop,(function(){return e()}))},t.prototype.defineI18nProps=function(){this.appLocale=this.i18nService.getAppLocale()},t.prototype.initVariables=function(){var e=this,t=this.injector.get(r.VariablesService).register(this.pageName,this.getVariables(),this);this.Variables=Object.create(this.App.Variables),this.Actions=Object.create(this.App.Actions),Object.entries(t.Variables).forEach((function(t){var n=X(t,2),i=n[0],o=n[1];return e.Variables[i]=o})),Object.entries(t.Actions).forEach((function(t){var n=X(t,2),i=n[0],o=n[1];return e.Actions[i]=o}));var n=this.viewInit$.subscribe(o.noop,o.noop,(function(){e.appManager.isAppVariablesFired()||(t.callback(e.App.Variables).catch(o.noop).then((function(){e.appManager.notify("app-variables-data-loaded",{pageName:e.pageName})})),t.callback(e.App.Actions),e.appManager.appVariablesReady(),e.appManager.isAppVariablesFired(!0)),t.callback(t.Variables).catch(o.noop).then((function(){e.appManager.notify("page-variables-data-loaded",{pageName:e.pageName}),e.startupVariablesLoaded=!0,setTimeout((function(){e.showPageContent=!0}),100)})),t.callback(t.Actions),n.unsubscribe()}))},t.prototype.setTimezone=function(e){this.i18nService.setTimezone(e,this)},t.prototype.registerExpressions=function(){var e=this.getExpressions();_.each(e,(function(e,t){o.registerFnByExpr(t,e[0],e[1])}))},t.prototype.runPageTransition=function(e){var n=this;e=e||this.navigationService.getPageTransition();var i=t.lastPageSnapShot;return new Promise((function(t){if(e&&!e.startsWith("none")&&i){var o=i.parent(),a=function(n){!t||n&&n.pseudoElement||(o.off("animationend",a),o.removeClass(e),o.children().first().remove(),t(),t=null)};e="page-transition page-transition-"+e,i.addClass("page-exit"),n.$page.addClass("page-entry"),o.addClass(e),o.on("animationend",a),setTimeout(a,1e3)}else t()})).then((function(){n.$page&&n.$page.removeClass("page-entry"),i&&(i.remove(),t.lastPageSnapShot=null),n.pageTransitionCompleted=!0}))},t.prototype.invokeOnReady=function(){this.onReady(),this.appManager.notify("pageReady",{name:this.pageName,instance:this}),(this.App.onPageReady||o.noop)(this.pageName,this)},t.prototype.loadScripts=function(){var e=this;return new Promise((function(t){var n,i=e.pageDirective&&e.pageDirective.$element.attr("scripts-to-load");i?(n=e.scriptLoaderService).load.apply(n,ee([],X(i.split(",")))).then(t):t()}))},t.prototype.restoreLastPageSnapshot=function(){o.isMobileApp()&&t.lastPageSnapShot&&this.$page&&this.$page.parent().prepend(t.lastPageSnapShot)},t.prototype.savePageSnapShot=function(){t.lastPageSnapShot&&t.lastPageSnapShot.remove(),o.isMobileApp()&&this.$page&&(t.lastPageSnapShot=this.$page.clone(),this.$page.parents("app-root").prepend(t.lastPageSnapShot))},t.prototype.saveScrollPosition=function(){var e=function(t,n,i,o){void 0===i&&(i=!0),void 0===o&&(o=t),i&&t.children().each((function(t,i){return e($(i),n)}));var a=o.scrollLeft(),r=o.scrollTop();(a>0||r>0)&&t.attr(n,a+","+r)};e(this.$page,"data-scroll-position"),this.$page.attr("data-window-scroll-position",window.scrollX+","+window.scrollY)},t.prototype.restoreScrollPosition=function(){var e=function(t,n,i,o){void 0===i&&(i=!0),void 0===o&&(o=t);var a=(t.attr(n)||"").split(",");a.length>1&&(o.scrollLeft(a[0]),o.scrollTop(a[1])),t.removeAttr(n),i&&t.children().each((function(t,i){return e($(i),n)}))};e(this.$page,"data-scroll-position"),e(this.$page,"data-window-scroll-position",!1,$(window))},t.prototype.canDeactivate=function(){var e;return!1!==(e=this.onBeforePageLeave())&&(e=(this.App.onBeforePageLeave||o.noop)(this.App.activePageName,this.App.activePage)),void 0===e||e},t.prototype.ngAfterViewInit=function(){var e=this;this.route.snapshot.data._cache_page=this.canReuse(),this.pageDirective&&(this.$page=this.pageDirective.$element.parent(),o.isIos()&&this.$page.addClass("ios-page"),o.isAndroid()&&this.$page.addClass("android-page")),this.restoreLastPageSnapshot(),this.loadScripts().then((function(){e.runPageTransition().then((function(){e.compilePageContent=!0,setTimeout((function(){e.onPageContentReady=function(){e.fragmentsLoaded$.subscribe(o.noop,o.noop,(function(){e.invokeOnReady()})),o.unMuteWatchers(),e.viewInit$.complete(),e.onPageContentReady=o.noop}}),0)}))}))},t.prototype.ngOnDestroy=function(){this.savePageSnapShot(),this.destroy$.complete()},t.prototype.onReady=function(){},t.prototype.onBeforePageReady=function(){},t.prototype.onBeforePageLeave=function(){},t.prototype.onPageContentReady=function(){},t.prototype.canReuse=function(){return!(!this.pageDirective||!this.pageDirective.cache)},t.prototype.mute=function(){var e=function(e){e&&e.mute&&e.mute()};_.each(this.Widgets,e),_.each(this.Variables,e),_.each(this.Actions,e)},t.prototype.unmute=function(e){void 0===e&&(e=this);var t=function(e){e&&e.unmute&&e.unmute()};_.each(this.Widgets,t),_.each(this.Variables,t),_.each(this.Actions,t)},t.prototype.ngOnAttach=function(){var e=this;if(this.route.snapshot.data._cache_page=this.canReuse(),this.registerPageParams(),this.App.lastActivePageName=this.App.activePageName,this.App.activePageName=this.pageName,this.App.activePage=this,this.activePageName=this.pageName,this.restoreLastPageSnapshot(),this.unmute(),this.App.Widgets=Object.create(this.Widgets),this.pageDirective&&this.pageDirective.refreshdataonattach){var t=function(e){e&&e.startUpdate&&e.invoke&&e.invoke()};_.each(this.Variables,t),_.each(this.Actions,t)}this.runPageTransition().then((function(){setTimeout((function(){return e.restoreScrollPosition()}),100),_.each(e.Widgets,(function(e){return e&&e.ngOnAttach&&e.ngOnAttach()})),e.appManager.notify("pageAttach",{name:e.pageName,instance:e})}))},t.prototype.ngOnDetach=function(){this.saveScrollPosition(),this.savePageSnapShot(),this.mute(),_.each(this.Widgets,(function(e){return e&&e.ngOnDetach&&e.ngOnDetach()})),this.appManager.notify("pageDetach",{name:this.pageName,instance:this})},t.prototype.ngAfterContentInit=function(){this.onBeforePageReady()},t.clear=function(){t.lastPageSnapShot&&(t.lastPageSnapShot.remove(),t.lastPageSnapShot=null)},t}(te);pe.lastPageSnapShot=null,pe.decorators=[{type:t.Directive}],pe.propDecorators={pageDirective:[{type:t.ViewChild,args:[s.PageDirective]}],canDeactivate:[{type:t.HostListener,args:["window:beforeunload"]}]};var de=function(e){function t(){var t=e.apply(this,ee([],X(arguments)))||this;return t.compileContent=!1,t.destroy$=new l.Subject,t.viewInit$=new l.Subject,t}return K(t,e),t.prototype.getContainerWidgetInjector=function(){return this.containerWidget.inj||this.containerWidget.injector},t.prototype.init=function(){var t=this;this.App=this.injector.get(o.App),this.containerWidget=this.injector.get(c.WidgetRef),this.prefabMngr=this.injector.get(H),this.i18nService=this.injector.get(o.AbstractI18nService),this.scriptLoaderService=this.injector.get(o.ScriptLoaderService),this.Viewport=this.injector.get(o.Viewport),this.getContainerWidgetInjector().view.component.registerFragment&&this.getContainerWidgetInjector().view.component.registerFragment(),this.spa?this.pageDirective=this.injector.get(s.SpaPageDirective,null):this.pageDirective=this.injector.get(s.PageDirective,null),this.pageDirective&&(this.registerDestroyListener(this.pageDirective.subscribe("attach",(function(e){return t.ngOnAttach(e.refreshData)}))),this.registerDestroyListener(this.pageDirective.subscribe("detach",(function(){return t.ngOnDetach()})))),this.registerExpressions(),this.initUserScript(),this.registerWidgets(),this.initVariables(),this.registerProps(),this.defineI18nProps(),e.prototype.init.call(this)},t.prototype.registerWidgets=function(){this.Widgets={},this.Widgets={},this.containerWidget.Widgets=this.Widgets},t.prototype.initUserScript=function(){try{this.evalUserScript(this,this.App,this.injector.get(o.UtilsService))}catch(e){console.error("Error in evaluating prefab ("+this.prefabName+") script\n",e)}},t.prototype.registerChangeListeners=function(){this.containerWidget.registerPropertyChangeListener(this.onPropertyChange),this.containerWidget.registerStyleChangeListener(this.onPropertyChange)},t.prototype.registerDestroyListener=function(e){this.destroy$.subscribe(o.noop,o.noop,(function(){return e()}))},t.prototype.defineI18nProps=function(){this.appLocale=this.i18nService.getPrefabLocaleBundle(this.prefabName)},t.prototype.registerProps=function(){var e=this;this.prefabMngr.getConfig(this.prefabName).then((function(t){t&&(e.displayName=t.displayName,Object.entries(t.properties||{}).forEach((function(t){var n,i=X(t,2),a=i[0],r=i[1],s=_.trim(r.value);_.startsWith(s,"bind:")&&(n=s.replace("bind:","")),Object.defineProperty(e,a,{get:function(){return e.containerWidget[a]},set:function(t){return e.containerWidget.widget[a]=t}}),n&&e.registerDestroyListener(o.$watch(n,e,{},(function(t){return e.containerWidget.widget[a]=t})))})),Object.entries(t.events||{}).forEach((function(t){var n=X(t,2),i=n[0];n[1];e[i]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=i.substr(2).toLowerCase();e.containerWidget.invokeEventCallback(o,{$event:t[0],$data:t[1]})}})),Object.entries(t.methods||{}).forEach((function(t){var n=X(t,2),i=n[0];n[1];e.containerWidget[i]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{if(e[i])return e[i].apply(e,t)}catch(t){console.warn("error in executing prefab-"+e.prefabName+" method-"+i)}}}))),e.containerWidget.setProps(t),o.isIE()&&(e.containerWidget.widget=e.containerWidget.createProxy())}))},t.prototype.initVariables=function(){var e=this,t=this.injector.get(r.VariablesService).register(this.prefabName,this.getVariables(),this);this.Variables={},this.Actions={},this.containerWidget.Variables=this.Variables,this.containerWidget.Actions=this.Actions,Object.entries(t.Variables).forEach((function(t){var n=X(t,2),i=n[0],o=n[1];return e.Variables[i]=o})),Object.entries(t.Actions).forEach((function(t){var n=X(t,2),i=n[0],o=n[1];return e.Actions[i]=o})),this.viewInit$.subscribe(o.noop,o.noop,(function(){t.callback(t.Variables).catch(o.noop),t.callback(t.Actions)}))},t.prototype.registerExpressions=function(){var e=this.getExpressions();_.each(e,(function(e,t){o.registerFnByExpr(t,e[0],e[1])}))},t.prototype.invokeOnReady=function(){o.$invokeWatchers(!0,!0),this.onReady(),this.getContainerWidgetInjector().view.component.resolveFragment&&this.getContainerWidgetInjector().view.component.resolveFragment(),this.containerWidget.invokeEventCallback("load")},t.prototype.loadScripts=function(){var e=this;return new Promise((function(t){var n,i=e.prefabContainerDirective.$element.attr("scripts-to-load");i?(n=e.scriptLoaderService).load.apply(n,ee([],X(i.split(",")))).then(t):t()}))},t.prototype.mute=function(){var e=function(e){e&&e.mute&&e.mute()};_.each(this.Widgets,e),_.each(this.Variables,e),_.each(this.Actions,e)},t.prototype.unmute=function(){var e=function(e){e&&e.unmute&&e.unmute()};_.each(this.Widgets,e),_.each(this.Variables,e),_.each(this.Actions,e)},t.prototype.ngOnAttach=function(e){if(this.unmute(),e){var t=function(e){e&&e.startUpdate&&e.invoke&&e.invoke()};_.each(this.Variables,t),_.each(this.Actions,t)}_.each(this.Widgets,(function(e){return e&&e.ngOnAttach&&e.ngOnAttach()}))},t.prototype.ngOnDetach=function(){this.mute(),_.each(this.Widgets,(function(e){return e&&e.ngOnDetach&&e.ngOnDetach()}))},t.prototype.ngAfterViewInit=function(){var e=this;this.loadScripts().then((function(){e.compileContent=!0,e.registerChangeListeners(),setTimeout((function(){e.viewInit$.complete(),e.fragmentsLoaded$.subscribe(o.noop,o.noop,(function(){return e.invokeOnReady()}))}),100)}))},t.prototype.ngOnDestroy=function(){this.destroy$.complete()},t.prototype.onPropertyChange=function(){},t.prototype.onReady=function(){},t}(te);de.decorators=[{type:t.Directive}],de.propDecorators={prefabContainerDirective:[{type:t.ViewChild,args:[p.PrefabContainerDirective]}]};var ue=function(){function e(){}return e.prototype.registerExpressions=function(){var e=this.getExpressions();_.each(e,(function(e,t){o.registerFnByExpr(t,e[0],e[1])}))},e.prototype.overrideRouterOutlet=function(){var e=this,t=this.routerOutlet.attach,n=this.routerOutlet.detach;this.routerOutlet.attach=function(n){t.call(e.routerOutlet,n),n.instance.ngOnAttach()},this.routerOutlet.detach=function(){return n.call(e.routerOutlet)}},e.prototype.ngAfterViewInit=function(){var e=this;setTimeout((function(){e.overrideRouterOutlet()}),10)},e.prototype.init=function(){this.App=this.injector.get(o.App),this.App.activeLayoutName=this.layoutName,this.App.layoutPages=this.layoutPages,this.registerExpressions()},e.prototype.ngOnDestroy=function(){},e.prototype.canReuse=function(){},e.prototype.ngOnAttach=function(){},e.prototype.ngOnDetach=function(){},e.prototype.onActivate=function(e){_.extend(this,e)},e}();ue.decorators=[{type:t.Directive}],ue.propDecorators={routerOutlet:[{type:t.ViewChild,args:[n.RouterOutlet]}],pageDirective:[{type:t.ViewChild,args:[s.PageDirective]}]};var he,me=function(e){function t(){var t=e.apply(this,ee([],X(arguments)))||this;return t.startupVariablesLoaded=!1,t.pageTransitionCompleted=!1,t.destroy$=new l.Subject,t.viewInit$=new l.Subject,t.formatsByLocale={timezone:""},t}return K(t,e),t.prototype.init=function(){o.muteWatchers(),this.App=this.injector.get(o.App),this.route=this.injector.get(n.ActivatedRoute),this.appManager=this.injector.get(j),this.navigationService=this.injector.get(o.AbstractNavigationService),this.scriptLoaderService=this.injector.get(o.ScriptLoaderService),this.i18nService=this.injector.get(o.AbstractI18nService),this.router=this.injector.get(n.Router),this.Viewport=this.injector.get(o.Viewport),this.layoutDirective=this.injector.get(s.LayoutDirective),this.registerExpressions(),this.initUserScript(),this.registerWidgets(),this.initVariables(),this.App.lastActivePageName=this.App.activePageName,this.App.activePageName=this.pageName,this.App.activePage=this,this.activePageName=this.pageName,this.registerPageParams(),this.defineI18nProps(),e.prototype.init.call(this)},t.prototype.registerWidgets=function(){this.Widgets=Object.create(ne),this.App.Widgets=Object.create(this.Widgets)},t.prototype.initUserScript=function(){try{this.evalUserScript(this,this.App,this.injector.get(o.UtilsService))}catch(e){console.error("Error in evaluating page ("+this.pageName+") script\n",e)}},t.prototype.registerPageParams=function(){var e=this,t=this.route.queryParams.subscribe((function(t){return e.pageParams=e.App.pageParams=_.extend({},t)}));this.registerDestroyListener((function(){return t.unsubscribe()}))},t.prototype.registerDestroyListener=function(e){this.destroy$.subscribe(o.noop,o.noop,(function(){return e()}))},t.prototype.defineI18nProps=function(){this.appLocale=this.i18nService.getAppLocale()},t.prototype.initVariables=function(){var e=this,t=this.injector.get(r.VariablesService).register(this.pageName,this.getVariables(),this);this.Variables=Object.create(this.App.Variables),this.Actions=Object.create(this.App.Actions),Object.entries(t.Variables).forEach((function(t){var n=X(t,2),i=n[0],o=n[1];return e.Variables[i]=o})),Object.entries(t.Actions).forEach((function(t){var n=X(t,2),i=n[0],o=n[1];return e.Actions[i]=o}));var n=this.viewInit$.subscribe(o.noop,o.noop,(function(){e.appManager.isAppVariablesFired()||(t.callback(e.App.Variables).catch(o.noop).then((function(){e.appManager.notify("app-variables-data-loaded",{pageName:e.pageName})})),t.callback(e.App.Actions),e.appManager.appVariablesReady(),e.appManager.isAppVariablesFired(!0)),t.callback(t.Variables).catch(o.noop).then((function(){e.appManager.notify("page-variables-data-loaded",{pageName:e.pageName}),e.startupVariablesLoaded=!0,setTimeout((function(){e.showPageContent=!0}),100)})),t.callback(t.Actions),n.unsubscribe()}))},t.prototype.setTimezone=function(e){this.i18nService.setTimezone(e,this)},t.prototype.registerExpressions=function(){var e=this.getExpressions();_.each(e,(function(e,t){o.registerFnByExpr(t,e[0],e[1])}))},t.prototype.runPageTransition=function(e){var n=this;e=e||this.navigationService.getPageTransition();var i=t.lastPageSnapShot;return new Promise((function(t){if(e&&!e.startsWith("none")&&i){var o=i.parent(),a=function(n){!t||n&&n.pseudoElement||(o.off("animationend",a),o.removeClass(e),o.children().first().remove(),t(),t=null)};e="page-transition page-transition-"+e,i.addClass("page-exit"),n.$page.addClass("page-entry"),o.addClass(e),o.on("animationend",a),setTimeout(a,1e3)}else t()})).then((function(){n.$page&&n.$page.removeClass("page-entry"),i&&(i.remove(),t.lastPageSnapShot=null),n.pageTransitionCompleted=!0}))},t.prototype.invokeOnReady=function(){this.onReady(),this.appManager.notify("highlightActiveLink",{pageName:this.pageName}),this.appManager.notify("pageReady",{name:this.pageName,instance:this}),(this.App.onPageReady||o.noop)(this.pageName,this)},t.prototype.loadScripts=function(){var e=this;return new Promise((function(t){var n,i=e.spaPageDirective&&e.spaPageDirective.$element.attr("scripts-to-load");i?(n=e.scriptLoaderService).load.apply(n,ee([],X(i.split(",")))).then(t):t()}))},t.prototype.restoreLastPageSnapshot=function(){o.isMobileApp()&&t.lastPageSnapShot&&this.$page&&this.$page.parent().prepend(t.lastPageSnapShot)},t.prototype.savePageSnapShot=function(){t.lastPageSnapShot&&t.lastPageSnapShot.remove(),o.isMobileApp()&&this.$page&&(t.lastPageSnapShot=this.$page.clone(),this.$page.parents("app-root").prepend(t.lastPageSnapShot))},t.prototype.saveScrollPosition=function(){var e=function(t,n,i,o){void 0===i&&(i=!0),void 0===o&&(o=t),i&&t.children().each((function(t,i){return e($(i),n)}));var a=o.scrollLeft(),r=o.scrollTop();(a>0||r>0)&&t.attr(n,a+","+r)};e(this.$page,"data-scroll-position"),this.$page.attr("data-window-scroll-position",window.scrollX+","+window.scrollY)},t.prototype.restoreScrollPosition=function(){var e=function(t,n,i,o){void 0===i&&(i=!0),void 0===o&&(o=t);var a=(t.attr(n)||"").split(",");a.length>1&&(o.scrollLeft(a[0]),o.scrollTop(a[1])),t.removeAttr(n),i&&t.children().each((function(t,i){return e($(i),n)}))};e(this.$page,"data-scroll-position"),e(this.$page,"data-window-scroll-position",!1,$(window))},t.prototype.canDeactivate=function(){var e;return!1!==(e=this.onBeforePageLeave())&&(e=(this.App.onBeforePageLeave||o.noop)(this.App.activePageName,this.App.activePage)),void 0===e||e},t.prototype.ngAfterViewInit=function(){var e=this;this.route.snapshot.data._cache_page=this.canReuse(),this.layoutDirective&&(this.$page=this.layoutDirective.$element.parent(),o.isIos()&&this.$page.addClass("ios-page"),o.isAndroid()&&this.$page.addClass("android-page")),this.restoreLastPageSnapshot(),this.loadScripts().then((function(){e.runPageTransition().then((function(){e.compilePageContent=!0,setTimeout((function(){e.onPageContentReady=function(){e.fragmentsLoaded$.subscribe(o.noop,o.noop,(function(){e.invokeOnReady()})),o.unMuteWatchers(),e.viewInit$.complete(),e.onPageContentReady=o.noop}}),0)}))}))},t.prototype.ngOnDestroy=function(){this.savePageSnapShot(),this.destroy$.complete()},t.prototype.onReady=function(){},t.prototype.onBeforePageReady=function(){},t.prototype.onBeforePageLeave=function(){},t.prototype.onPageContentReady=function(){},t.prototype.canReuse=function(){return!(!this.spaPageDirective||!this.spaPageDirective.cache)},t.prototype.mute=function(){var e=function(e){e&&e.mute&&e.mute()};_.each(this.Widgets,e),_.each(this.Variables,e),_.each(this.Actions,e)},t.prototype.unmute=function(e){void 0===e&&(e=this);var t=function(e){e&&e.unmute&&e.unmute()};_.each(this.Widgets,t),_.each(this.Variables,t),_.each(this.Actions,t)},t.prototype.ngOnAttach=function(){var e=this;if(this.route.snapshot.data._cache_page=this.canReuse(),this.registerPageParams(),this.App.lastActivePageName=this.App.activePageName,this.App.activePageName=this.pageName,this.App.activePage=this,this.activePageName=this.pageName,this.restoreLastPageSnapshot(),this.unmute(),this.App.Widgets=Object.create(this.Widgets),this.spaPageDirective&&this.spaPageDirective.refreshdataonattach){var t=function(e){e&&e.startUpdate&&e.invoke&&e.invoke()};_.each(this.Variables,t),_.each(this.Actions,t)}this.runPageTransition().then((function(){setTimeout((function(){return e.restoreScrollPosition()}),100),_.each(e.Widgets,(function(e){return e&&e.ngOnAttach&&e.ngOnAttach()})),e.appManager.notify("pageAttach",{name:e.pageName,instance:e})})),this.appManager.notify("highlightActiveLink",{pageName:this.pageName})},t.prototype.ngOnDetach=function(){this.saveScrollPosition(),this.savePageSnapShot(),this.mute(),_.each(this.Widgets,(function(e){return e&&e.ngOnDetach&&e.ngOnDetach()})),this.appManager.notify("pageDetach",{name:this.pageName,instance:this})},t.prototype.ngAfterContentInit=function(){this.onBeforePageReady()},t.clear=function(){t.lastPageSnapShot&&(t.lastPageSnapShot.remove(),t.lastPageSnapShot=null)},t}(te);me.lastPageSnapShot=null,me.decorators=[{type:t.Directive}],me.propDecorators={spaPageDirective:[{type:t.ViewChild,args:[s.SpaPageDirective]}],canDeactivate:[{type:t.HostListener,args:["window:beforeunload"]}]},function(e){e.EVERYONE="Everyone",e.ANONYMOUS="Anonymous",e.AUTHENTICATED="Authenticated"}(he||(he={}));var fe=function(){function e(e,t,n,i){this.templateRef=e,this.viewContainerRef=t,this.securityService=n,this.inj=i,this.processed=!1;var o=this.securityService.get();this.securityEnabled=_.get(o,"securityEnabled"),this.isUserAuthenticated=_.get(o,"authenticated"),this.userRoles=_.get(o,"userInfo.userRoles")}return e.prototype.getWidgetRolesArrayFromStr=function(e){var t=/&#44;/g;return""===(e=e||"")?[]:_.split(e,",").map((function(e){return _.trim(e).replace(t,",")}))},e.prototype.matchRoles=function(e,t){return e.some((function(e){return _.includes(t,e)}))},e.prototype.hasAccessToWidget=function(e,t){return!!_.includes(e,he.EVERYONE)||(!(!_.includes(e,he.ANONYMOUS)||this.isUserAuthenticated)||(!(!_.includes(e,he.AUTHENTICATED)||!this.isUserAuthenticated)||this.isUserAuthenticated&&this.matchRoles(e,t)))},Object.defineProperty(e.prototype,"accessroles",{set:function(e){if(!this.processed){this.processed=!0;var t=this.getWidgetRolesArrayFromStr(e);!this.securityEnabled||this.hasAccessToWidget(t,this.userRoles)?this.viewContainerRef.createEmbeddedView(this.templateRef,this.inj.view.context):this.viewContainerRef.clear()}},enumerable:!1,configurable:!0}),e}();fe.decorators=[{type:t.Directive,args:[{selector:"[accessroles]"}]}],fe.ctorParameters=function(){return[{type:t.TemplateRef},{type:t.ViewContainerRef},{type:a.SecurityService},{type:t.Injector}]},fe.propDecorators={accessroles:[{type:t.Input}]};var ge=function(){};ge.decorators=[{type:t.Component,args:[{selector:"app-spinner",template:'\n <div class="app-spinner" [ngClass]="classname" *ngIf="show">\n <div class="spinner-message">\n <i class="spinner-image animated infinite fa fa-circle-o-notch fa-spin"></i>\n <div class="spinner-messages">\n <p *ngFor="let value of spinnermessages" [textContent]="value"></p>\n </div>\n </div>\n </div>\n '}]}],ge.ctorParameters=function(){return[]},ge.propDecorators={show:[{type:t.Input}],spinnermessages:[{type:t.Input}],classname:[{type:t.Input}],arialabel:[{type:t.Input}]};var ve=function(e){function t(t,n){var i=e.call(this,t,n)||this;return i.toastrService=t,i.toastPackage=n,i.watchers=[],i.params={},i.pagename=i.message||"",i.generateParams(),i}return K(t,e),t.prototype.generateParams=function(){var e=this;_.forEach(this.options.partialParams,(function(t){_.isString(t.value)&&0===t.value.indexOf("bind:")?e.watchers.push(o.$watch(t.value.substr(5),e.options.context,{},(function(n){e.params[t.name]=n,o.$appDigest()}))):e.params[t.name]=t.value}))},t.prototype.generateDynamicComponent=function(){return Q(this,void 0,void 0,(function(){var e;return Z(this,(function(t){return e=$(".parent-custom-toast"),this.customToastRef.clear(),e[0].appendChild(this.customToastRef.createEmbeddedView(this.customToastTmpl).rootNodes[0]),[2]}))}))},t.prototype.ngAfterViewInit=function(){this.generateDynamicComponent()},t.prototype.ngOnDestroy=function(){_.forEach(this.watchers,(function(e){return e()})),e.prototype.ngOnDestroy.call(this)},t}(h.Toast);ve.decorators=[{type:t.Component,args:[{selector:"[custom-toaster-component]",template:'\n <div class="parent-custom-toast"></div>\n <ng-container #customToast></ng-container>\n <ng-template #customToastTmpl>\n <div wmContainer partialContainer content.bind="pagename">\n <div *ngFor="let param of params | keyvalue" wmParam hidden\n [name]="param.key" [value]="param.value"></div>\n </div>\n </ng-template>',preserveWhitespaces:!1}]}],ve.ctorParameters=function(){return[{type:h.ToastrService},{type:h.ToastPackage}]},ve.propDecorators={customToastRef:[{type:t.ViewChild,args:["customToast",{static:!0,read:t.ViewContainerRef}]}],customToastTmpl:[{type:t.ViewChild,args:["customToastTmpl"]}]};var ye=function(){function e(e,t,n,i,o){this.route=e,this.securityService=t,this.router=n,this.app=i,this.appManger=o}return e.prototype.ngOnInit=function(){var e=this;this.app.isPrefabType?this.router.navigate(["prefab-preview"]):this.app.isApplicationType?this.securityService.getPageByLoggedInUser().then((function(t){e.router.navigate([t])})):(this.router.navigate([o.getWmProjectProperties().homePage]),this.appManger.postAppTypeInfo())},e}();ye.decorators=[{type:t.Component,args:[{selector:"app-empty-page",template:"<div></div>"}]}],ye.ctorParameters=function(){return[{type:n.ActivatedRoute},{type:a.SecurityService},{type:n.Router},{type:o.App},{type:j}]};var be=function(t,n,i,o,a,r,s){var l=this;this.componentInstance=t,this.vcRef=n,this.elRef=i,this.prefabMngr=o,this.resolver=a,this.injector=r,this.componentRefProvider=s;var c=this.componentInstance.prefabName;this.prefabMngr.loadDependencies(c).then((function(){return Q(l,void 0,void 0,(function(){var t,n;return Z(this,(function(i){switch(i.label){case 0:return[4,this.componentRefProvider.getComponentFactoryRef(c,e.ComponentType.PREFAB)];case 1:return(t=i.sent())&&(n=this.vcRef.createComponent(t,0,r),this.elRef.nativeElement.appendChild(n.location.nativeElement)),[2]}}))}))}))};be.decorators=[{type:t.Directive,args:[{selector:"[wmPrefab][prefabname]"}]}],be.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Self},{type:t.Inject,args:[c.WidgetRef]}]},{type:t.ViewContainerRef},{type:t.ElementRef},{type:H},{type:t.ComponentFactoryResolver},{type:t.Injector},{type:N}]};var we={DialogService:o.AbstractDialogService,i18nService:o.AbstractI18nService,statePersistence:o.StatePersistence,SpinnerService:o.AbstractSpinnerService,StatePersistenceService:o.StatePersistence,Viewport:o.Viewport,ToasterService:o.AbstractToasterService,Utils:o.UtilsService,CONSTANTS:o.ConstantService,FIELD_TYPE:o.FieldTypeService,FIELD_WIDGET:o.FieldWidgetService,DynamicComponentService:o.DynamicComponentRefProvider},Pe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},_e=function(){var e=this.httpService,t=function(t,n){var i=Array.from(arguments).slice(1);return Promise.resolve(e[t].apply(e,i))},n=function(){return t.apply(void 0,ee(["send"],X(Array.from(arguments))))};return["get","post","head","put","delete","jsonp","patch"].forEach((function(e){return n[e]=t.bind(void 0,e)})),n},Oe=function(){function e(e,t,n,i,a,r){this.inj=e,this.i18nService=t,this.statePersistence=n,this.httpService=i,this.securityService=a,this.routeReuseStrategy=r,this.Variables={},this.Actions={},this.onAppVariablesReady=Pe,this.onBeforeAppReady=Pe,this.onSessionTimeout=Pe,this.onPageReady=Pe,this.onBeforePageLeave=Pe,this.onBeforeServiceCall=Pe,this.onServiceSuccess=Pe,this.onServiceError=Pe,this.dynamicComponentContainerRef={},this.changeLocale=this.i18nService.setSelectedLocale.bind(this.i18nService),this.getSelectedLocale=this.i18nService.getSelectedLocale.bind(this.i18nService),this.setTimezone=this.i18nService.setTimezone.bind(this.i18nService),this.setwidgetLocale=this.i18nService.setwidgetLocale.bind(this.i18nService),this._eventNotifier=new o.EventNotifier,this.landingPageName=o.getWmProjectProperties().homePage;var s=o.getWmProjectProperties();this.projectName=s.name,this.isPrefabType="PREFAB"===s.type,this.isApplicationType="APPLICATION"===s.type,this.isTemplateBundleType="TEMPLATEBUNDLE"===s.type,this.targetPlatform=s.platformType,this.httpService.registerOnSessionTimeout(this.on401.bind(this)),this.appLocale=this.i18nService.getAppLocale(),this.httpService.setLocale(this.appLocale)}return e.prototype.reload=function(){window.location.reload()},e.prototype.clearPageCache=function(e){this.routeReuseStrategy instanceof se&&this.routeReuseStrategy.reset(e)},e.prototype.notify=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this._eventNotifier.notify.apply(this._eventNotifier,arguments)},e.prototype.getDependency=function(e){if(o.isString(e)){if("HttpService"===e)return _e.call(this);var t=we[e]&&this.inj.get(we[e]);return!t&&this.inj._providers&&_.forEach(this.inj._providers,(function(n){if(_.isObject(n)&&n.__proto__.constructor.SERVICE_NAME===e)return t=n,!1})),t}return this.inj.get(e)},e.prototype.on401=function(){var e=_.get(this.securityService.get(),"userInfo");_.isEmpty(e)||this.onSessionTimeout()},e.prototype.subscribe=function(e,t){return this._eventNotifier.subscribe(e,t)},e.prototype.notifyApp=function(e,t,n){var i=_.get(this,"Actions.appNotification"),a=-1!==["PROCESS_REJECTED_IN_QUEUE"].indexOf(e);if(i){if(a)return void console.warn("App Error",e);t=t||"success",e=i.getMessage()||e,i.invoke({message:e,title:o.isDefined(n)?n:t.toUpperCase(),class:t,duration:"ERROR"===t.toUpperCase()?0:void 0})}else console.warn('The default Action "appNotification" doesn\'t exist in the app. App notified following error:\n',e)},e.prototype.registerExpressions=function(e){_.each(e,(function(e,t){o.registerFnByExpr(t,e[0],e[1])}))},e}();Oe.decorators=[{type:t.Injectable}],Oe.ctorParameters=function(){return[{type:t.Injector},{type:o.AbstractI18nService},{type:o.StatePersistence},{type:o.AbstractHttpService},{type:a.SecurityService},{type:n.RouteReuseStrategy}]};var Ee=function(e){function t(t){var n=e.call(this)||this;return n.toaster=t,n}return K(t,e),t.prototype._showToaster=function(e,t,n,i){if(_.isNumber(i)&&(i={timeOut:i}),(i=i||{}).timeOut=o.isDefined(i.timeOut)?i.timeOut:0,i.enableHtml=o.isDefined(i.enableHtml),i.positionClass=i.positionClass||"toast-bottom-right",i.toastClass="toast",t||n){!i.bodyOutputType&&_.isObject(n)&&(n=JSON.stringify(n));var a=this.toaster[e];if(a)return a.call(this.toaster,n,t,i)}},t.prototype.success=function(e,t){return this._showToaster("success",e,t,{timeOut:5e3})},t.prototype.error=function(e,t){return this._showToaster("error",e,t,{timeOut:0})},t.prototype.info=function(e,t){return this._showToaster("info",e,t,{timeOut:0})},t.prototype.warn=function(e,t){return this._showToaster("warning",e,t,{timeOut:0})},t.prototype.show=function(e,t,n,i){return this._showToaster(e,t,n,i)},t.prototype.hide=function(e){e?this.toaster.clear(e.toastId):this.toaster.clear()},t.prototype.showCustom=function(e,t){if(e)return(t=t||{}).toastComponent=ve,t.toastClass="custom-toaster",t.timeOut=o.isDefined(t.timeOut)?t.timeOut:0,t.enableHtml=o.isDefined(t.enableHtml),t.positionClass=t.positionClass||"toast-bottom-right",t.toastClass="toast",this.toaster.show(e,"",t)},t.prototype.setToasterConfig=function(e){_.isObject(e)?_.merge(this.toaster.toastrConfig,e):console.warn("Please pass a valid options object, For Example : {maxOpened: 1, autoDismiss: true}")},t}(o.AbstractToasterService);Ee.decorators=[{type:t.Injectable}],Ee.ctorParameters=function(){return[{type:h.ToastrService}]};var Re=["ar","ar-001","ar-ae","ar-bh","ar-dz","ar-eg","ar-iq","ar-jo","ar-kw","ar-lb","ar-ly","ar-ma","ar-om","ar-qa","ar-sa","ar-sd","ar-sy","ar-tn","ar-ye","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","pnb","ps","sd","ug","ur","yi"],Ae=function(e){function t(t,n,i,o){var a=e.call(this)||this;return a.$http=t,a.bsLocaleService=n,a.appDefaults=i,a.inj=o,a.defaultSupportedLocale="en",a._isAngularLocaleLoaded=!1,a.formatsByLocale={timezone:"",number:""},a.appLocale={},a.prefabLocale=new Map,a}return K(t,e),Object.defineProperty(t.prototype,"app",{get:function(){return this.inj.get(o.App)},enumerable:!1,configurable:!0}),t.prototype.updateLocaleDirection=function(){var e="ltr";Re.includes(this.selectedLocale)&&(e="rtl"),o.setCSS(document.body,"direction",e)},t.prototype.init=function(){this.messages={},Object.setPrototypeOf(this.appLocale,this.messages)},t.prototype.getSelectedLocale=function(){return this.selectedLocale},t.prototype.getDefaultSupportedLocale=function(){return this.defaultSupportedLocale},t.prototype.getAppLocale=function(){return this.appLocale},t.prototype.getPrefabLocaleBundle=function(e){return this.prefabLocale.has(e)||this.prefabLocale.set(e,Object.create(this.appLocale)),this.prefabLocale.get(e)},t.prototype.extendPrefabMessages=function(e){var t=this;e.prefabMessages&&Object.keys(e.prefabMessages).forEach((function(n){var i=t.prefabLocale.get(n);i||(i=Object.create(t.appLocale),t.prefabLocale.set(n,i)),Object.assign(i,e.prefabMessages[n])}))},t.prototype.extendMessages=function(e){Object.assign(this.messages,e)},t.prototype.loadResource=function(e){return this.$http.get(e).toPromise().catch((function(){console.warn("error loading locale resource from "+e),Promise.resolve({})}))},t.prototype.loadAppLocaleBundle=function(){var e=this;this.loadResource("resources/i18n/"+this.selectedLocale+".json").then((function(t){e.extendMessages(t.messages),e.extendPrefabMessages(t),e.appDefaults.setFormats(t.formats)}))},t.prototype.loadMomentLocaleBundle=function(e){var t=this,n=o._WM_APP_PROJECT.cdnUrl||o._WM_APP_PROJECT.ngDest;if(this.selectedLocale!==this.defaultSupportedLocale){var i=n+"locales/moment/"+e+".js";o.loadScripts([i],!0).then((function(){moment.locale(t.selectedLocale);var n=moment.localeData(e);n=n&&n._config,w.defineLocale(t.selectedLocale,n),t.bsLocaleService.use(t.getSelectedLocale()||t.defaultSupportedLocale)}))}else moment.locale(this.defaultSupportedLocale)},t.prototype.loadAngularLocaleBundle=function(e){var t=this;return new Promise((function(n){var i=o._WM_APP_PROJECT.cdnUrl||o._WM_APP_PROJECT.ngDest;if(t.selectedLocale!==t.defaultSupportedLocale){var a=i+"locales/angular/global/"+e+".js";o.loadScripts([a],!0).then((function(){t._isAngularLocaleLoaded=!0,n()}),n)}else n()}))},t.prototype.loadCalendarLocaleBundle=function(e,t){void 0===t&&(t=!1);var n,i=o._WM_APP_PROJECT.cdnUrl||o._WM_APP_PROJECT.ngDest;return e?(n=i+"locales/fullcalendar/"+e+".js",t||!o.isMobile()&&!o.isMobileApp()&&this.selectedLocale!==this.defaultSupportedLocale?o.loadScripts([n],!0):void 0):Promise.resolve()},t.prototype.loadMomentTimeZoneBundle=function(e,t){var n=this;return new Promise((function(i){var a=(o._WM_APP_PROJECT.cdnUrl||o._WM_APP_PROJECT.ngDest)+"locales/moment-timezone/moment-timezone-with-data.js";o.loadScripts([a],!0).then((function(){var o=e,a=(e=o.timezone).indexOf("+");a>-1&&(a>0&&(e=e.substr(a)),o.timezone=_.find(moment.tz.names(),(function(t){return e===moment.tz(t).format("Z")})));var r=t&&t.formatsByLocale?t.formatsByLocale:n.formatsByLocale;Object.assign(r,o),i()}),i)}))},t.prototype.loadLocaleBundles=function(e){return e.moment&&this.loadMomentLocaleBundle(e.moment),e.fullCalendar&&window.FullCalendar&&this.loadCalendarLocaleBundle(e.fullCalendar),e.angular&&this.loadAppLocaleBundle(),this.loadAngularLocaleBundle(e.angular)},t.prototype.setTimezone=function(e,t){this.loadMomentTimeZoneBundle(e,t)},t.prototype.getTimezone=function(e){var t=_.get(this.app,"activePage.formatsByLocale.timezone"),n=_.get(e,"formatsByLocale.timezone");return n||(t||this.formatsByLocale.timezone)},t.prototype.getFormatsByLocale=function(){return this.formatsByLocale},t.prototype.setSelectedLocale=function(e){var t=this;_.isObject(e)&&(e=e.datavalue);var n=o.getWmProjectProperties().supportedLanguages[e],i=Object.keys(o.getWmProjectProperties().supportedLanguages);return _.includes(i,e)&&e&&e!==this.selectedLocale?(o.setSessionStorageItem("selectedLocale",e),this.selectedLocale=e,this.init(),this.loadLocaleBundles(n).then((function(){return t.updateLocaleDirection()}))):Promise.resolve()},t.prototype.deduceAppLocale=function(){var e=this.getAcceptedLanguages(),t=o.getWmProjectProperties().defaultLanguage;e.push(t);var n=o.getWmProjectProperties().preferBrowserLang;n=!n||("true"===n||!0===n);var i,a=Object.keys(o.getWmProjectProperties().supportedLanguages)||[this.defaultSupportedLocale],s=n?void 0:t;if(r.CONSTANTS.hasCordova){var l=[];_.forEach(e,(function(e){var t=_.find(a,(function(t){return e===t}))||_.find(a,(function(t){return e.startsWith(t)}));t&&l.push(t)})),i=l[0]}var c=o.getSessionStorageItem("selectedLocale")||s||i||_.intersection(e,a)[0]||this.defaultSupportedLocale;return a=a||[c],c||a[0]},t.prototype.loadDefaultLocale=function(){var e=this.deduceAppLocale();return this.setSelectedLocale(e)},t.prototype.getLocalizedMessage=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return o.replace(this.appLocale[e],t)},t.prototype.getAcceptedLanguages=function(){var e;return e=r.CONSTANTS.hasCordova?navigator.languages||[navigator.language]:(e=decodeURIComponent(o.getWmProjectProperties().preferredLanguage||"")).split(",").map((function(e){return e.split(";")[0]})),_.map(e,_.toLower)},t.prototype.initCalendarLocale=function(){return"en"!==this.selectedLocale?this.loadCalendarLocaleBundle(this.selectedLocale,!0):Promise.resolve()},t.prototype.isAngularLocaleLoaded=function(){return this._isAngularLocaleLoaded},t.prototype.setwidgetLocale=function(e){this.formatsByLocale.number=e.number},t.prototype.getwidgetLocale=function(){return this.formatsByLocale},t}(o.AbstractI18nService);Ae.decorators=[{type:t.Injectable}],Ae.ctorParameters=function(){return[{type:d.HttpClient},{type:P.BsLocaleService},{type:o.AppDefaults},{type:t.Injector}]};var Te=function(e){function t(){var t=e.call(this)||this;return t.spinnerId=0,t.messageSource=new l.Subject,t.messagesByContext={},t}return K(t,e),t.prototype.getMessageSource=function(){return this.messageSource},t.prototype.showContextSpinner=function(e,t,n){var i=$('[name="'+e+'"]');if(this.messagesByContext[e]=this.messagesByContext[e]||{},0!==Object.keys(this.messagesByContext[e]).length)this.messagesByContext[e][n]=t,this.messagesByContext[e].finalMessage=this.messagesByContext[e].finalMessage+" "+this.messagesByContext[e][n],i.find(".spinner-messages-container").html(this.messagesByContext[e].finalMessage);else{var o=$('<div class="app-spinner">\n <div class="spinner-message" aria-label="loading gif">\n <i class="spinner-image animated infinite fa fa-circle-o-notch fa-spin"></i>\n <div class="spinner-messages">\n <p class="spinner-messages-container"></p>\n </div>\n </div>\n </div>');this.messagesByContext[e][n]=t,this.messagesByContext[e].finalMessage=this.messagesByContext[e][n],o.find(".spinner-messages-container").html(this.messagesByContext[e].finalMessage),i.prepend(o)}return n},t.prototype.showAppSpinner=function(e,t){this.messagesByContext.page=this.messagesByContext.page||{},this.messagesByContext.page[t]=e,this.messageSource.next({show:!0,message:e,messages:_.values(this.messagesByContext.page)})},t.prototype.hideContextSpinner=function(e,t){delete this.messagesByContext[e][t],1===Object.keys(this.messagesByContext[e]).length&&(this.messagesByContext[e]={}),$('[name="'+e+'"]').find(".app-spinner").remove()},t.prototype.show=function(e,t,n,i,o){return t=t||++this.spinnerId,i&&"page"!==i?this.showContextSpinner(i,e,t):(this.showAppSpinner(e,t),t)},t.prototype.hide=function(e){var t=_.findKey(this.messagesByContext,(function(t){return _.includes(_.keys(t),e)}))||"page";if("page"===t)if(e){delete this.messagesByContext[t][e];var n=_.values(this.messagesByContext[t]);this.messageSource.next({show:!!n.length,messages:_.values(this.messagesByContext[t])})}else this.messagesByContext[t]={};else this.hideContextSpinner(t,e)},t}(o.AbstractSpinnerService);Te.decorators=[{type:t.Injectable}],Te.ctorParameters=function(){return[]};var Se="body >app-root",Ce=function(){function e(e,t,i){var o=this;this.app=e,this.router=t,this.zone=i,this.history=new De,this.isPageAddedToHistory=!1,this.router.events.subscribe((function(e){if(e instanceof n.NavigationStart){var t=e.url,i={},a=void 0;o.isPageAddedToHistory||(o.isPageAddedToHistory=!1,t.indexOf("?")>0?(t.substr(t.indexOf("?")+1).split("&").forEach((function(e){var t=e.split("=");i[t[0]]=t[1]})),a=t.substr(0,t.indexOf("?"))):a=t,"/"===a[0]&&(a=a.substr(1)),a&&(delete i.name,o.history.push(new Ie(a,i,o.transition))))}}))}return e.prototype.getPageTransition=function(){return _.isEmpty(this.transition)||_.isEqual("none",this.transition)?null:this.transition},e.prototype.goToPage=function(e,t){var n=this;this.transition=t.transition||"",this.history.getCurrentPage()&&(this.isPageAddedToHistory=!0),this.history.push(new Ie(e,t.urlParams,this.transition)),this.zone.run((function(){return n.router.navigate(["/"+e],{queryParams:t.urlParams})}))},e.prototype.goToPrevious=function(){this.history.getPagesCount()&&(this.transition=this.history.getCurrentPage().transition,_.isEmpty(this.transition)||(this.transition+="-exit"),this.history.pop(),this.isPageAddedToHistory=!0,window.history.back())},e.prototype.goToView=function(e,t,n){var i=this,o=(t=t||{}).pageName,a=t.transition||"",s=t.$event,l=this.app.activePage,c=n&&n._context&&n._context.prefabName;if(this.app.isPrefabType)this.goToElementView($(Se).find('[name="'+e+'"]'),e,o,n);else if(o===l.activePageName||c)c&&this.isPrefabWithNameExists(c)?this.goToElementView($('[prefabName="'+c+'"]').find('[name="'+e+'"]'),e,o,n):o&&o!==l.activePageName?this.app.notifyApp(r.CONSTANTS.WIDGET_DOESNT_EXIST,"error"):this.goToElementView($(Se).find('[name="'+e+'"]'),e,o,n);else if(this.isPartialWithNameExists(o))this.goToElementView($('[partialcontainer][content="'+o+'"]').find('[name="'+e+'"]'),e,o,n);else{this.goToPage(o,{viewName:e,$event:s,transition:a,urlParams:t.urlParams});var p=this.app.subscribe("pageReady",(function(t){i.goToElementView($(Se).find('[name="'+e+'"]'),e,o,n),p()}))}},e.prototype.goToElementView=function(e,t,n,i){var o,a,r=this,s=this.app.activePage;if(e.length)switch(this.app.isPrefabType||n!==s.activePageName||(e=this.getViewElementInActivePage(e)),(o=e[0].widget).widgetType){case"wm-accordionpane":this.showAncestors(e,i),o.expand();break;case"wm-tabpane":this.showAncestors(e,i),o.select();break;case"wm-segment-content":this.showAncestors(e,i),o.navigate();break;case"wm-panel":o.expanded=!0}else a=this.showAncestorDialog(t),setTimeout((function(){a&&r.goToElementView($('[name="'+t+'"]'),t,n,i)}))},e.prototype.getViewElementInActivePage=function(e){var t;return e.length>1&&(t=_.filter(e,(function(e){if(_.isEmpty($(e).closest('[data-role = "partial"]'))&&_.isEmpty($(e).closest("[wmprefabcontainer]")))return e})))&&(e=$(t)),e},e.prototype.isPartialWithNameExists=function(e){return $('[partialcontainer][content="'+e+'"]').length},e.prototype.isPrefabWithNameExists=function(e){return $('[prefabName="'+e+'"]').length},e.prototype.showAncestors=function(e,t){e.parents('[wm-navigable-element="true"]').toArray().reverse().forEach((function(e){var t=e.widget;switch(t.widgetType){case"wm-accordionpane":t.expand();break;case"wm-tabpane":t.select();break;case"wm-segment-content":t.navigate();break;case"wm-panel":t.expanded=!0}}))},e.prototype.showAncestorDialog=function(e){var t;return $("app-root [dialogtype]").each((function(){var n=$(this);if($(n.html()).find('[name="'+e+'"]').length)return t=n.attr("name"),!1})),t},e}();Ce.decorators=[{type:t.Injectable}],Ce.ctorParameters=function(){return[{type:o.App},{type:n.Router},{type:t.NgZone}]};var Ie=function(){function e(e,t,n){this.name=e,this.urlParams=t,this.transition=n,this.transition=_.isEmpty(this.transition)?null:this.transition}return e.prototype.isEqual=function(e){return e&&e.name===this.name&&_.isEqual(e.urlParams,this.urlParams)},e}(),De=function(){function e(){this.stack=[]}return e.prototype.getCurrentPage=function(){return this.currentPage},e.prototype.getPagesCount=function(){return this.stack.length},e.prototype.isLastVisitedPage=function(e){return this.getLastPage().isEqual(e)},e.prototype.push=function(e){this.currentPage&&this.stack.push(this.currentPage),this.currentPage=e},e.prototype.pop=function(){return this.currentPage=this.stack.pop(),this.currentPage},e.prototype.getLastPage=function(){return this.stack.length>0?this.stack[this.stack.length-1]:void 0},e}(),xe=function(){function e(){}return e.prototype.setFormats=function(e){var t=e.date,n=e.time,i=t&&n?t+" "+n:void 0,o=e.currency;this.dateFormat=t,this.timeFormat=n,this.dateTimeFormat=i,this.currencyCode=o},e}();xe.decorators=[{type:t.Injectable}],xe.ctorParameters=function(){return[]};var Ne=!1,Me=function(){function e(e,t){this.securityService=e,this.appManager=t}return e.prototype.loadSecurityConfig=function(){return Ne?Promise.resolve(!0):this.appManager.loadSecurityConfig().then((function(){return Ne=!0}))},e.prototype.isAuthenticated=function(){var e=this;return this.loadSecurityConfig().then((function(){return new Promise((function(t,n){e.securityService.isAuthenticated(t,n)}))}))},e.prototype.canActivate=function(e){var t=this;return this.isAuthenticated().then((function(n){return n?Promise.resolve(!0):(t.appManager.handle401(e.routeConfig.path,{queryParams:e.queryParams}),Promise.resolve(!1))}))},e}();Me.decorators=[{type:t.Injectable}],Me.ctorParameters=function(){return[{type:a.SecurityService},{type:j}]};var ke=function(){function e(e,t,n,i,o){this.securityService=e,this.authGuard=t,this.toasterService=n,this.app=i,this.appManager=o}return e.prototype.canActivate=function(e){var t=this,n=e.data.allowedRoles;return this.authGuard.isAuthenticated().then((function(i){if(i){var o=t.securityService.get().userInfo.userRoles;return _.intersection(n,o).length>0?Promise.resolve(!0):(t.appManager.notifyApp(t.app.appLocale.LABEL_ACCESS_DENIED||"Access Denied","error"),Promise.resolve(!1))}return t.appManager.handle401(e.routeConfig.path,{queryParams:e.queryParams}),Promise.resolve(!1)}))},e}();ke.decorators=[{type:t.Injectable}],ke.ctorParameters=function(){return[{type:a.SecurityService},{type:Me},{type:o.AbstractToasterService},{type:o.App},{type:j}]};var Le=function(){function e(e,t){this.app=e,this.appManager=t}return e.prototype.canActivate=function(e){return this.appManager.notifyApp(this.app.appLocale.MESSAGE_PAGE_NOT_FOUND||"The page you are trying to reach is not available","error"),Promise.resolve(!1)},e}();Le.decorators=[{type:t.Injectable}],Le.ctorParameters=function(){return[{type:o.App},{type:j}]};var Fe=!1,je=function(){function e(e,t,n,i){this.inj=e,this.app=t,this.utilService=n,this.appJsProvider=i,this.appManager=this.inj.get(j)}return e.prototype.resolve=function(){return Q(this,void 0,void 0,(function(){var e;return Z(this,(function(t){switch(t.label){case 0:if(Fe)return[2,!0];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.appJsProvider.getAppScriptFn()];case 2:return t.sent()(this.app,this.utilService,this.inj),[3,4];case 3:return e=t.sent(),console.warn("Error in executing app.js",e),[3,4];case 4:return Fe=!0,[2,!0]}}))}))},e}();je.decorators=[{type:t.Injectable}],je.ctorParameters=function(){return[{type:t.Injector},{type:o.App},{type:o.UtilsService},{type:k}]};var Be=!1,Ge=function(){function e(e,t,n){this.appManager=e,this.appJsProvider=t,this.customPipeManager=n}return e.prototype.resolve=function(){return!(!this.appManager.isPrefabType()&&!this.appManager.isTemplateBundleType())||(Be||(this.appJsProvider.loadFormatterConfigScript(this.loadedFormatterScript.bind(this)),Be=!0),Be)},e.prototype.loadedFormatterScript=function(e){try{var t=e;for(var n in t||console.warn("Please return valid formatter object"),t)this.customPipeManager.setCustomPipe(n,t[n])}catch(e){console.warn("Error in reading formatters.js",e)}},e}();Ge.decorators=[{type:t.Injectable}],Ge.ctorParameters=function(){return[{type:j},{type:F},{type:o.CustomPipeManager}]};var $e=function(){function e(e){this.i18nService=e}return e.prototype.resolve=function(){return this.i18nService.loadDefaultLocale()},e}();$e.decorators=[{type:t.Injectable}],$e.ctorParameters=function(){return[{type:o.AbstractI18nService}]};var Ve=function(){function e(e,n,a,r){var s,l=this;this.compiler=e,this.injector=n,this.domSanitizer=a,this.i18service=r,this._locale=o.getSessionStorageItem("selectedLocale")||"en",this.formatsByLocale=null===(s=this.i18service)||void 0===s?void 0:s.getwidgetLocale(),this.preparePipeMeta=function(e,t,n,i){return void 0===i&&(i=[]),{type:{reference:e,diDeps:i},name:t,pure:n}},this._pipeData=[this.preparePipeMeta(i.AsyncPipe,"async",!1,[t.ChangeDetectorRef]),this.preparePipeMeta(i.SlicePipe,"slice",!1),this.preparePipeMeta(i.PercentPipe,"percent",!0,[this._locale]),this.preparePipeMeta(i.I18nPluralPipe,"i18nPlural",!0,[i.NgLocalization]),this.preparePipeMeta(i.I18nSelectPipe,"i18nSelect",!0),this.preparePipeMeta(i.KeyValuePipe,"keyvalue",!1,[t.KeyValueDiffers]),this.preparePipeMeta(c.FileIconClassPipe,"fileIconClass",!0),this.preparePipeMeta(c.FileExtensionFromMimePipe,"fileExtensionFromMime",!0),this.preparePipeMeta(c.StateClassPipe,"stateClass",!0),this.preparePipeMeta(c.FileSizePipe,"filesize",!0),this.preparePipeMeta(c.FilterPipe,"filter",!0),this.preparePipeMeta(i.UpperCasePipe,"uppercase",!0),this.preparePipeMeta(i.LowerCasePipe,"lowercase",!0),this.preparePipeMeta(i.JsonPipe,"json",!1),this.preparePipeMeta(i.DecimalPipe,"number",!0,[this._locale]),this.preparePipeMeta(i.TitleCasePipe,"titlecase",!0),this.preparePipeMeta(i.CurrencyPipe,"currency",!0,[this._locale]),this.preparePipeMeta(i.DatePipe,"date",!0,[this._locale]),this.preparePipeMeta(c.ToDatePipe,"toDate",!0,[new i.DatePipe(this._locale)]),this.preparePipeMeta(c.ToNumberPipe,"toNumber",!0,[new i.DecimalPipe(this._locale),this.i18service]),this.preparePipeMeta(c.ToCurrencyPipe,"toCurrency",!0,[new i.DecimalPipe(this._locale),this.i18service]),this.preparePipeMeta(c.PrefixPipe,"prefix",!0),this.preparePipeMeta(c.SuffixPipe,"suffix",!0),this.preparePipeMeta(c.TimeFromNowPipe,"timeFromNow",!0),this.preparePipeMeta(c.NumberToStringPipe,"numberToString",!0,[new i.DecimalPipe(this._locale)]),this.preparePipeMeta(c.StringToNumberPipe,"stringToNumber",!0),this.preparePipeMeta(c.CustomPipe,"custom",!0,[this.injector.get(o.CustomPipeManager)]),this.preparePipeMeta(c.TrustAsPipe,"trustAs",!0,[this.domSanitizer]),this.preparePipeMeta(c.SanitizePipe,"sanitize",!0,[this.domSanitizer])],this._pipeMeta=new Map,this._pipeData.forEach((function(e){l._pipeMeta.set(e.name,e)}))}return e.prototype.unknownPipe=function(e){throw Error("The pipe '"+e+"' could not be found")},e.prototype.meta=function(e){var t=this._pipeMeta.get(e);return t||this.unknownPipe(e),t},e.prototype.getPipeNameVsIsPureMap=function(){var e=new Map;return this._pipeMeta.forEach((function(t,n){e.set(n,t.pure)})),e},e.prototype.resolveDep=function(e){return this.injector.get(e.token.identifier.reference)},e.prototype.getInstance=function(e){var t,n,i=this.meta(e).type,o=i.reference,a=i.diDeps;if(o||this.unknownPipe(e),a.length){var r=[];try{for(var s=J(a),l=s.next();!l.done;l=s.next()){var c=l.value;r.push(c)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return new(o.bind.apply(o,ee([void 0],X(r))))}return new o},e}();Ve.\u0275prov=C.\u0275\u0275defineInjectable({factory:function(){return new Ve(C.\u0275\u0275inject(C.Compiler),C.\u0275\u0275inject(C.INJECTOR),C.\u0275\u0275inject(D.DomSanitizer),C.\u0275\u0275inject(I.AbstractI18nService))},token:Ve,providedIn:"root"}),Ve.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],Ve.ctorParameters=function(){return[{type:t.Compiler},{type:t.Injector},{type:u.DomSanitizer},{type:o.AbstractI18nService}]};var We=function(){function e(e,t,i,a,r,s,l,c,p,d){var u,h=this;this.elRef=i,this.oAuthService=a,this.dialogService=r,this.spinnerService=s,this.router=c,this.app=p,this.appManager=d,this.startApp=!1,this.isApplicationType=!1,this.spinner={show:!1,messages:[],arialabel:""},this.isOAuthDialogOpen=!1,o.setPipeProvider(e),o.setNgZone(l),o.setAppRef(t),this.isApplicationType="APPLICATION"===o.getWmProjectProperties().type,this.appManager.beforeAppReady(),a.getOAuthProvidersAsObservable().subscribe((function(e){h.providersConfig=e,e.length?h.showOAuthDialog():h.closeOAuthDialog()})),this.spinnerService.getMessageSource().asObservable().subscribe((function(e){setTimeout((function(){h.spinner.show=e.show,h.spinner.messages=e.messages,h.spinner.arialabel=e.messages.toString()}))})),O.setTheme("bs3");var m=o.noop;this.router.events.subscribe((function(e){if(e instanceof n.NavigationStart){var t=e.url.split("?")[0];(t=t.substring(1))||(h.app.activeLayoutName="",h.app.layoutPages=[]),u=h.app.activeLayoutName&&h.app.layoutPages&&h.app.layoutPages.length&&h.app.layoutPages.includes(t)?h.spinnerService.show("","wmRouterOutlet","","wmRouterOutlet"):h.spinnerService.show("","globalSpinner");var i=document.querySelector("app-page-outlet");i&&o.addClass(i,"page-load-in-progress");var a=Date.now();m=function(){h.spinnerService.hide(u);var e=document.querySelector("app-page-outlet");e&&o.removeClass(e,"page-load-in-progress"),m=o.noop,h.app.activePageLoadTime=Date.now()-a}}else(e instanceof n.NavigationEnd||e instanceof n.NavigationCancel||e instanceof n.NavigationError)&&setTimeout((function(){m()}),1e3)})),this.appManager.subscribe("pageReady",(function(){m()})),this.appManager.subscribe("pageAttach",(function(){m()}))}return e.prototype.showOAuthDialog=function(){this.isOAuthDialogOpen||(this.isOAuthDialogOpen=!0,this.dialogService.open("oAuthLoginDialog",this))},e.prototype.closeOAuthDialog=function(){this.isOAuthDialogOpen&&(this.isOAuthDialogOpen=!1,this.dialogService.close("oAuthLoginDialog",this))},e.prototype.start=function(){var e=this;setTimeout((function(){e.startApp=!0})),setTimeout((function(){e.app.dynamicComponentContainerRef=e.dynamicComponentContainerRef,e.overrideRouterOutlet()}),10)},e.prototype.overrideRouterOutlet=function(){var e=this,t=this.routerOutlet.attach,n=this.routerOutlet.detach;this.routerOutlet.attach=function(n){t.call(e.routerOutlet,n),n.instance.ngOnAttach()},this.routerOutlet.detach=function(){return e.app.activePage.ngOnDetach(),n.call(e.routerOutlet)}},e.prototype.ngAfterViewInit=function(){var e=this;o.hasCordova()&&!window.wmDeviceReady?document.addEventListener("wmDeviceReady",(function(){return e.start()})):this.start()},e.prototype.ngDoCheck=function(){o.$invokeWatchers()},e}();We.decorators=[{type:t.Component,args:[{selector:"app-root",template:'<ng-container *ngIf="startApp">\n <router-outlet></router-outlet>\n <div wmContainer partialContainer content="Common" hidden class="ng-hide" *ngIf="isApplicationType"></div>\n <app-spinner name="globalspinner" classname="global-spinner" role="alert" aria-live="assertive" [attr.aria-label]="spinner.arialabel || \'Loading\'" [show]="spinner.show" [spinnermessages]="spinner.messages"></app-spinner>\n <div wmDialog name="oAuthLoginDialog" title="Application is requesting you to sign in with"\n close.event="closeOAuthDialog()">\n <ng-template #dialogBody>\n <ul class="list-items">\n <li class="list-item" *ngFor="let provider of providersConfig">\n <button class="btn" (click)="provider.invoke()">{{provider.name}}</button>\n </li>\n </ul>\n </ng-template>\n </div>\n <div wmConfirmDialog name="_app-confirm-dialog" title.bind="title" message.bind="message" oktext.bind="oktext"\n canceltext.bind="canceltext" closable="false" iconclass.bind="iconclass"\n escape.event="onEscape()" ok.event="onOk()" cancel.event="onCancel()" close.event="onClose()" opened.event="onOpen()"></div>\n <div wmAppExt></div>\n <i id="wm-mobile-display"></i>\n</ng-container>\n\x3c!--Dummy container to create the component dynamically--\x3e\n<ng-container #dynamicComponent></ng-container>\n',encapsulation:t.ViewEncapsulation.None}]}],We.ctorParameters=function(){return[{type:Ve},{type:t.ApplicationRef},{type:t.ElementRef},{type:b.OAuthService},{type:o.AbstractDialogService},{type:o.AbstractSpinnerService},{type:t.NgZone},{type:n.Router},{type:o.App},{type:j}]},We.propDecorators={routerOutlet:[{type:t.ViewChild,args:[n.RouterOutlet]}],dynamicComponentContainerRef:[{type:t.ViewChild,args:["dynamicComponent",{read:t.ViewContainerRef}]}]};var Ue=function(){function e(){this.wmHttpRequest=new y.WmHttpRequest,this.wmHttpResponse=new y.WmHttpResponse}return e.prototype.createSubject=function(){return new l.Subject},e.prototype.intercept=function(e,t){var n,i,o=this;if(r.appManager&&r.appManager.appOnBeforeServiceCall){var a=this.wmHttpRequest.angularToWmRequest(e);(n=r.appManager.appOnBeforeServiceCall(a))&&(n=this.wmHttpRequest.wmToAngularRequest(n),e=n)}return t.handle(e).pipe(E.tap((function(e){if(e&&4===e.type&&r.appManager&&r.appManager.appOnServiceSuccess){var t=o.wmHttpResponse.angularToWmResponse(e);(i=r.appManager.appOnServiceSuccess(t.body,t))&&(i=o.wmHttpResponse.wmToAngularResponse(i),_.extend(e,i))}}),(function(t){if(t._401Subscriber=o.createSubject(),r.httpService.isPlatformSessionTimeout(t)&&r.httpService.handleSessionTimeout(e,t._401Subscriber),r.appManager&&r.appManager.appOnServiceError){var n=o.wmHttpResponse.angularToWmResponse(t);(i=r.appManager.appOnServiceError(n.message,n))&&(i=o.wmHttpResponse.wmToAngularResponse(i),_.extend(t,i))}})))},e}();Ue.decorators=[{type:t.Injectable}],Ue.ctorParameters=function(){return[]};var qe="PREFAB",ze=function(){function e(e){var t=this;this.prefabManager=e,window.addEventListener("message",(function(e){if((e.data&&e.data.context)===qe){var n=e.data.action,i=e.data.payload;"init"===n?t.init():"set-property"===n?t.setProperty(i):"get-outbound-properties"===n?t.getOutboundProps():"invoke-script"===n&&t.invokeScript(i)}}))}return e.prototype.postMessage=function(e,t){var n={context:qe,action:e,payload:t};window.top.postMessage(n,"*")},e.prototype.setupEventListeners=function(){var e=this;this.prefabInstance.invokeEventCallback=function(t,n){void 0===n&&(n={}),e.postMessage("event-log",{name:t,data:n})}},e.prototype.init=function(){var e=this;this.previewMode=!0,this.prefabInstance.readyState.subscribe((function(){}),(function(){}),(function(){e.prefabManager.getConfig("__self__").then((function(t){e.config=t,e.postMessage("config",t),e.setupEventListeners()}))}))},e.prototype.setProperty=function(e){this.prefabInstance.widget[e.name]=e.value},e.prototype.isOutBoundProp=function(e){return"out-bound"===e.bindable||"in-out-bound"===e.bindable},e.prototype.getOutboundProps=function(){var e,t,n={};try{for(var i=J(Object.entries(this.config.properties||{})),o=i.next();!o.done;o=i.next()){var a=X(o.value,2),r=a[0],s=a[1];this.isOutBoundProp(s)&&(n[r]=this.prefabInstance.widget[r])}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}this.postMessage("outbound-properties",n)},e.prototype.invokeScript=function(e){var t="\n return "+e.script+";",n=new Function("Prefab",t)(this.prefabInstance);this.postMessage("method-output",{methodName:e.methodName,output:n})},e.prototype.ngAfterViewInit=function(){this.setupEventListeners(),this.postMessage("init")},e}();ze.decorators=[{type:t.Component,args:[{selector:"wm-prefab-preview",template:'\n <div class="prefab-preview row">\n <section wmPrefab name="prefab-preview" prefabname="__self__"></section>\n </div>\n '}]}],ze.ctorParameters=function(){return[{type:H}]},ze.propDecorators={prefabInstance:[{type:t.ViewChild,args:[p.PrefabDirective,{static:!0}]}]},A.initComponentsBuildTask();var He=new Map,Ye=function(e){var n=function(){};return n.decorators=[{type:t.NgModule,args:[{declarations:[e],imports:[wt],schemas:[t.CUSTOM_ELEMENTS_SCHEMA,t.NO_ERRORS_SCHEMA]}]}],n},Ke=function(e,n,i){void 0===i&&(i="");var o={template:n,styles:[i],encapsulation:t.ViewEncapsulation.None},a=function(){};return a.decorators=[{type:t.Component,args:[Object.assign(Object.assign({},o),{selector:e})]}],a},Qe=function(){function e(e,t,n){this.app=e,this.appManager=t,this.compiler=n,this.counter=1}return e.prototype.getComponentFactoryRef=function(e,t,n){return void 0===n&&(n={}),Q(this,void 0,void 0,(function(){var i,o,a;return Z(this,(function(r){return i=He.get(e),t=n.transpile?R.transpile(t).markup:t,i&&!n.noCache||(o=Ke(e,t,n.styles),a=Ye(o),i=this.compiler.compileModuleAndAllComponentsSync(a).componentFactories.filter((function(e){return e.componentType===o}))[0],He.set(e,i)),[2,i]}))}))},e.prototype.addComponent=function(e,t,n,i){return void 0===n&&(n={}),void 0===i&&(i={}),Q(this,void 0,void 0,(function(){var a,r;return Z(this,(function(s){switch(s.label){case 0:return i.transpile=!o.isDefined(i.transpile)||i.transpile,i.noCache=!o.isDefined(i.noCache)||i.noCache,i.selector=o.isDefined(i.selector)?i.selector:"wm-dynamic-component-"+this.counter++,[4,this.getComponentFactoryRef(i.selector,t,i)];case 1:return a=s.sent(),r=this.app.dynamicComponentContainerRef.createComponent(a,0,_.get(i,"inj")),o.extendProto(r.instance,n),e.appendChild(r.location.nativeElement),[2]}}))}))},e}();Qe.decorators=[{type:t.Injectable}],Qe.ctorParameters=function(){return[{type:o.App},{type:j},{type:t.Compiler}]};var Ze=function(){function e(){}return e.prototype.canDeactivate=function(e,t,n){return function(){var e;return!1!==(e=this.app.activePage&&this.app.activePage.onBeforePageLeave())&&(e=(this.app.onBeforePageLeave||o.noop)(this.app.activePageName,this.app.activePage)),void 0===e||e}.apply(e)},e}();Ze.decorators=[{type:t.Injectable}];var Je=function(){function e(){}return e.prototype.canDeactivate=function(e,t,n){return!e.canDeactivate||e.canDeactivate()},e}();Je.decorators=[{type:t.Injectable}];var Xe=function(){function e(){this._stylesSet=new Set}return e.prototype.addStyles=function(e){var t=this,n=new Set;e.forEach((function(e){t._stylesSet.has(e)||(t._stylesSet.add(e),n.add(e))})),this.onStylesAdded(n)},e.prototype.onStylesAdded=function(e){},e.prototype.getAllStyles=function(){return Array.from(this._stylesSet)},e}();Xe.decorators=[{type:t.Injectable}];var et=function(e){function t(t){var n=e.call(this)||this;return n._doc=t,n._hostNodes=new Map,n._hostNodes.set(t.head,[]),n}return K(t,e),t.prototype._addStylesToHost=function(e,t,n){var i,o=this,a=(null===(i=document.querySelector('meta[name="CSP-NONCE"]'))||void 0===i?void 0:i.getAttribute("content"))||"wm-csp-nonce";e.forEach((function(e){var i=o._doc.createElement("style");i.textContent=e,i.setAttribute("nonce",a),n.push(t.appendChild(i))}))},t.prototype.addHost=function(e){var t=[];this._addStylesToHost(this._stylesSet,e,t),this._hostNodes.set(e,t)},t.prototype.removeHost=function(e){var t=this._hostNodes.get(e);t&&t.forEach(tt),this._hostNodes.delete(e)},t.prototype.onStylesAdded=function(e){var t=this;this._hostNodes.forEach((function(n,i){t._addStylesToHost(e,i,n)}))},t.prototype.ngOnDestroy=function(){this._hostNodes.forEach((function(e){return e.forEach(tt)}))},t}(Xe);function tt(e){i["\u0275getDOM"]().remove(e)}et.decorators=[{type:t.Injectable}],et.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Inject,args:[i.DOCUMENT]}]}]};var nt={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/MathML/"},it=/%COMP%/g,ot="_nghost-%COMP%",at="_ngcontent-%COMP%";function rt(e,t,n){for(var i=0;i<t.length;i++){var o=t[i];Array.isArray(o)?rt(e,o,n):(o=o.replace(it,e),n.push(o))}return n}function st(e){return function(t){if("__ngUnwrap__"===t)return e;!1===e(t)&&(t.preventDefault(),t.returnValue=!1)}}var lt=function(){function e(e,t,n){this.eventManager=e,this.sharedStylesHost=t,this.appId=n,this.rendererByCompId=new Map,this.defaultRenderer=new ct(e)}return e.prototype.createRenderer=function(e,n){if(!e||!n)return this.defaultRenderer;switch(n.encapsulation){case t.ViewEncapsulation.Emulated:var i=this.rendererByCompId.get(n.id);return i||(i=new ut(this.eventManager,this.sharedStylesHost,n,this.appId),this.rendererByCompId.set(n.id,i)),i.applyToHost(e),i;case 1:case t.ViewEncapsulation.ShadowDom:return new ht(this.eventManager,this.sharedStylesHost,e,n);default:if(!this.rendererByCompId.has(n.id)){var o=rt(n.id,n.styles,[]);this.sharedStylesHost.addStyles(o),this.rendererByCompId.set(n.id,this.defaultRenderer)}return this.defaultRenderer}},e.prototype.begin=function(){},e.prototype.end=function(){},e}();lt.decorators=[{type:t.Injectable}],lt.ctorParameters=function(){return[{type:u.EventManager},{type:u["\u0275DomSharedStylesHost"]},{type:String,decorators:[{type:t.Inject,args:[t.APP_ID]}]}]};var ct=function(){function e(e){this.eventManager=e,this.data=Object.create(null),this.destroyNode=null}return e.prototype.destroy=function(){},e.prototype.createElement=function(e,t){return t?document.createElementNS(nt[t]||t,e):document.createElement(e)},e.prototype.createComment=function(e){return document.createComment(e)},e.prototype.createText=function(e){return document.createTextNode(e)},e.prototype.appendChild=function(e,t){(pt(e)?e.content:e).appendChild(t)},e.prototype.insertBefore=function(e,t,n){e&&(pt(e)?e.content:e).insertBefore(t,n)},e.prototype.removeChild=function(e,t){e&&e.removeChild(t)},e.prototype.selectRootElement=function(e,t){var n="string"==typeof e?document.querySelector(e):e;if(!n)throw new Error('The selector "'+e+'" did not match any elements');return t||(n.textContent=""),n},e.prototype.parentNode=function(e){return e.parentNode},e.prototype.nextSibling=function(e){return e.nextSibling},e.prototype.resetStyles=function(e){[].slice.call(e).forEach((function(t){e.style.removeProperty(t)}))},e.prototype.applyStyles=function(e,t){if(t)return t.split(";").forEach((function(t){var n,i,o=t.split(":");2===o.length&&(n=o[0].trim(),i=o[1].trim(),e.style[n]=i)})),t},e.prototype.setAttribute=function(e,t,n,i){if(i){t=i+":"+t;var o=nt[i];o?e.setAttributeNS(o,t,n):e.setAttribute(t,n)}else"style"===t?(this.resetStyles(e),this.applyStyles(e,n)):e.setAttribute(t,n)},e.prototype.removeAttribute=function(e,t,n){if(n){var i=nt[n];i?e.removeAttributeNS(i,t):e.removeAttribute(n+":"+t)}else e.removeAttribute(t)},e.prototype.addClass=function(e,t){e.classList.add(t)},e.prototype.removeClass=function(e,t){e.classList.remove(t)},e.prototype.setStyle=function(e,n,i,o){o&(t.RendererStyleFlags2.DashCase|t.RendererStyleFlags2.Important)?e.style.setProperty(n,i,o&t.RendererStyleFlags2.Important?"important":""):e.style[n]=i},e.prototype.removeStyle=function(e,n,i){i&t.RendererStyleFlags2.DashCase?e.style.removeProperty(n):e.style[n]=""},e.prototype.setProperty=function(e,t,n){e[t]=n},e.prototype.setValue=function(e,t){e.nodeValue=t},e.prototype.listen=function(e,t,n){return"string"==typeof e?this.eventManager.addGlobalEventListener(e,t,st(n)):this.eventManager.addEventListener(e,t,st(n))},e}();"@".charCodeAt(0);function pt(e){return"TEMPLATE"===e.tagName&&void 0!==e.content}var dt,ut=function(e){function t(t,n,i,o){var a=e.call(this,t)||this;a.component=i;var r,s=rt(o+"-"+i.id,i.styles,[]);return n.addStyles(s),a.contentAttr=(r=o+"-"+i.id,at.replace(it,r)),a.hostAttr=function(e){return ot.replace(it,e)}(o+"-"+i.id),a}return K(t,e),t.prototype.applyToHost=function(t){e.prototype.setAttribute.call(this,t,this.hostAttr,"")},t.prototype.createElement=function(t,n){var i=e.prototype.createElement.call(this,t,n);return e.prototype.setAttribute.call(this,i,this.contentAttr,""),i},t}(ct),ht=function(e){function t(t,n,i,o){var a=e.call(this,t)||this;a.sharedStylesHost=n,a.hostEl=i,a.shadowRoot=i.attachShadow({mode:"open"}),a.sharedStylesHost.addHost(a.shadowRoot);for(var r=rt(o.id,o.styles,[]),s=0;s<r.length;s++){var l=document.createElement("style");l.textContent=r[s],a.shadowRoot.appendChild(l)}return a}return K(t,e),t.prototype.nodeOrShadowRoot=function(e){return e===this.hostEl?this.shadowRoot:e},t.prototype.destroy=function(){this.sharedStylesHost.removeHost(this.shadowRoot)},t.prototype.appendChild=function(t,n){return e.prototype.appendChild.call(this,this.nodeOrShadowRoot(t),n)},t.prototype.insertBefore=function(t,n,i){return e.prototype.insertBefore.call(this,this.nodeOrShadowRoot(t),n,i)},t.prototype.removeChild=function(t,n){return e.prototype.removeChild.call(this,this.nodeOrShadowRoot(t),n)},t.prototype.parentNode=function(t){return this.nodeOrShadowRoot(e.prototype.parentNode.call(this,this.nodeOrShadowRoot(t)))},t}(ct),mt=function(){o._WM_APP_PROJECT.id=o.hasCordova()?_WM_APP_PROPERTIES.displayName:location.href.split("/")[3],o._WM_APP_PROJECT.cdnUrl=document.querySelector('[name="cdnUrl"]')&&document.querySelector('[name="cdnUrl"]').getAttribute("content"),o._WM_APP_PROJECT.ngDest="ng-bundle/"};function ft(e,t){return{provide:e,useValue:t}}function gt(e,t){var n=this;return function(){return Q(n,void 0,void 0,(function(){return Z(this,(function(n){switch(n.label){case 0:return mt(),[4,t.resolve()];case 1:return n.sent(),[2,e.loadDefaultLocale()]}}))}))}}function vt(e){return mt(),e.deduceAppLocale()}!function(e){e.IOS="ios",e.ANDROID="android"}(dt||(dt={}));var yt=[fe,ge,ve,be,We,ze,ye],bt=[f.ConfirmDialogModule,g.DesignDialogModule,m.DialogModule];$.fn.swipeAnimation.expressionEvaluator=o.$parseExpr;var wt=function(){function e(t,n,i){e.addCustomEventPolyfill(),this.getDeviceDetails().then((function(e){n.selectedViewPort={os:e.os,category:e.selectedDeviceCategory},i.update(e),n.notify("on-viewport-details",e.os)}))}return e.addCustomEventPolyfill=function(){if("function"==typeof window.CustomEvent)return!1;var e=function(e,t){t=t||{bubbles:!1,cancelable:!1,detail:null};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n};e.prototype=window.Event.prototype,window.CustomEvent=e},e.forRoot=function(){return{ngModule:e,providers:[{provide:o.App,useClass:Oe},{provide:o.AbstractToasterService,useClass:Ee},{provide:o.AbstractI18nService,useClass:Ae},{provide:o.AbstractSpinnerService,useClass:Te},{provide:o.AbstractNavigationService,useClass:Ce},{provide:o.AppDefaults,useClass:xe},{provide:o.DynamicComponentRefProvider,useClass:Qe},{provide:t.APP_INITIALIZER,useFactory:gt,deps:[o.AbstractI18nService,je],multi:!0},{provide:t.LOCALE_ID,useFactory:vt,deps:[o.AbstractI18nService]},{provide:d.HTTP_INTERCEPTORS,useClass:Ue,multi:!0},i.DecimalPipe,i.DatePipe,j,H,Me,ke,Le,Ze,je,Ge,$e,ft(ae,10),ft(re,1800)]}},e.prototype.getDeviceDetails=function(){return new Promise((function(e,t){window.top!==window?(window.top.postMessage({key:"on-load"},"*"),window.onmessage=function(t){var n=t.data;o.isObject(n)&&"switch-device"===n.key&&e(n.device)}):o.isIphone()||o.isIpod()||o.isIpad()?e({os:dt.IOS}):e({os:dt.ANDROID})}))},e}();wt.decorators=[{type:t.NgModule,args:[{declarations:yt,imports:[i.CommonModule,n.RouterModule,d.HttpClientModule,h.ToastrModule,c.WmComponentsModule,p.PrefabModule,v.MobileRuntimeModule,o.CoreModule,a.SecurityModule,b.OAuthModule,r.VariablesModule,y.HttpServiceModule,bt],exports:[yt,i.CommonModule,c.WmComponentsModule,v.MobileRuntimeModule,o.CoreModule,a.SecurityModule,b.OAuthModule,r.VariablesModule,y.HttpServiceModule,bt],providers:[{provide:u["\u0275DomSharedStylesHost"],useClass:et},{provide:u["\u0275DomRendererFactory2"],useClass:lt}],entryComponents:[ve]}]}],wt.ctorParameters=function(){return[{type:v.MobileRuntimeModule},{type:o.App},{type:o.Viewport}]};var Pt=[c.WmComponentsModule.forRoot(),v.MobileRuntimeModule.forRoot(),o.CoreModule.forRoot(),a.SecurityModule.forRoot(),b.OAuthModule.forRoot(),r.VariablesModule.forRoot(),y.HttpServiceModule.forRoot(),wt.forRoot()],_t=!1,Ot=function(){function e(e,t){this.appManager=e,this.appVariablesProvider=t}return e.prototype.resolve=function(){var e=this;return!!_t||Promise.all([this.appManager.loadSecurityConfig(),this.appManager.loadMetadata(),this.appVariablesProvider.getAppVariables()]).then((function(t){return e.appManager.loadAppVariables(t[2])})).then((function(){return _t=!0}))},e}();Ot.\u0275prov=C.\u0275\u0275defineInjectable({factory:function(){return new Ot(C.\u0275\u0275inject(j),C.\u0275\u0275inject(L))},token:Ot,providedIn:"root"}),Ot.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],Ot.ctorParameters=function(){return[{type:j},{type:L}]};var Et=!1,Rt=function(){function e(e){this.appManager=e}return e.prototype.resolve=function(){return Et||this.appManager.loadMetadata().then((function(){return Et=!0}))},e}();Rt.\u0275prov=C.\u0275\u0275defineInjectable({factory:function(){return new Rt(C.\u0275\u0275inject(j))},token:Rt,providedIn:"root"}),Rt.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],Rt.ctorParameters=function(){return[{type:j}]};var At=function(){function e(e){this.appManager=e,o.isMobileApp()||(this.loaded=this.appManager.isPrefabType()||this.appManager.isTemplateBundleType()||!o.getWmProjectProperties().securityEnabled)}return e.prototype.resolve=function(){var e=this;return this.loaded||this.appManager.loadSecurityConfig().then((function(){e.loaded=!0}))},e}();At.\u0275prov=C.\u0275\u0275defineInjectable({factory:function(){return new At(C.\u0275\u0275inject(j))},token:At,providedIn:"root"}),At.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],At.ctorParameters=function(){return[{type:j}]},e.AccessrolesDirective=fe,e.AppComponent=We,e.AppDefaultsService=xe,e.AppExtensionJSResolve=Ge,e.AppExtensionProvider=F,e.AppJSProvider=k,e.AppJSResolve=je,e.AppManagerService=j,e.AppRef=Oe,e.AppSpinnerComponent=ge,e.AppVariablesProvider=L,e.AppVariablesResolve=Ot,e.AuthGuard=Me,e.BaseLayoutComponent=ue,e.BasePageComponent=pe,e.BasePartialComponent=ie,e.BasePrefabComponent=de,e.BaseSpaPageComponent=me,e.CACHE_PAGE=oe,e.CanDeactivateNgPageGuard=Je,e.CanDeactivatePageGuard=Ze,e.ComponentRefProvider=N,e.CustomToasterComponent=ve,e.DynamicComponentRefProviderService=Qe,e.EmptyPageComponent=ye,e.FragmentMonitor=te,e.HttpCallInterceptor=Ue,e.I18nResolve=$e,e.I18nServiceImpl=Ae,e.InitializeApp=gt,e.MAX_CACHE_AGE=re,e.MAX_CACHE_SIZE=ae,e.MetadataResolve=Rt,e.NavigationServiceImpl=Ce,e.PageNotFoundGaurd=Le,e.PipeProvider=Ve,e.PrefabConfigProvider=M,e.PrefabDirective=be,e.PrefabManagerService=H,e.PrefabPreviewComponent=ze,e.REQUIRED_MODULES_FOR_DYNAMIC_COMPONENTS=bt,e.RoleGuard=ke,e.RuntimeBaseModule=wt,e.SecurityConfigResolve=At,e.SpinnerServiceImpl=Te,e.ToasterServiceImpl=Ee,e.WM_MODULES_FOR_ROOT=Pt,e.WmDefaultRouteReuseStrategy=se,e.WmNgRouteReuseStrategy=ce,e.WmRouteReuseStrategy=le,e.commonPartialWidgets=ne,e.getPrefabBaseUrl=G,e.getPrefabConfigUrl=function(e){return G(e)+"/config.json"},e.getPrefabMinJsonUrl=function(e){return G(e)+"/pages/Main/page.min.json"},e.getPrefabPartialJsonUrl=function(e,t){return G(e)+"/pages/"+t+"/page.min.json"},e.isPrefabInPreview=B,e.setAngularLocale=vt,e["\u02750"]=z,e["\u0275a"]=ft,e["\u0275b"]=Xe,e["\u0275c"]=et,e["\u0275d"]=lt,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/platform-browser-dynamic"),require("@angular/platform-browser"),require("@angular/common"),require("@angular/router"),require("@angular/common/http"),require("@angular/forms"),require("ngx-bootstrap/typeahead"),require("ngx-bootstrap/timepicker"),require("ngx-bootstrap/progressbar"),require("ngx-bootstrap/pagination"),require("ngx-bootstrap/modal"),require("ngx-bootstrap/tooltip"),require("ngx-bootstrap/datepicker"),require("ngx-bootstrap/dropdown"),require("ngx-bootstrap/popover"),require("ng-circle-progress"),require("ngx-toastr"),require("ngx-bootstrap/carousel"),require("@wm/core"),require("@wm/components/basic"),require("@wm/components/basic/progress"),require("@wm/components/basic/rich-text-editor"),require("@wm/components/basic/search"),require("@wm/components/basic/tree"),require("@wm/components/input"),require("@wm/components/input/calendar"),require("@wm/components/input/chips"),require("@wm/components/input/color-picker"),require("@wm/components/input/currency"),require("@wm/components/input/epoch"),require("@wm/components/input/file-upload"),require("@wm/components/input/rating"),require("@wm/components/input/slider"),require("@wm/mobile/runtime/dynamic"),require("@wm/components/data/card"),require("@wm/components/data/form"),require("@wm/components/data/list"),require("@wm/components/data/live-table"),require("@wm/components/data/pagination"),require("@wm/components/data/table"),require("@wm/components/chart"),require("@wm/components/containers/accordion"),require("@wm/components/containers/linear-layout"),require("@wm/components/containers/layout-grid"),require("@wm/components/containers/panel"),require("@wm/components/containers/tabs"),require("@wm/components/containers/tile"),require("@wm/components/containers/wizard"),require("@wm/components/dialogs/alert-dialog"),require("@wm/components/dialogs/iframe-dialog"),require("@wm/components/dialogs/login-dialog"),require("@wm/components/dialogs/partial-dialog"),require("@wm/components/navigation/breadcrumb"),require("@wm/components/navigation/menu"),require("@wm/components/navigation/navbar"),require("@wm/components/navigation/popover"),require("@wm/components/advanced/carousel"),require("@wm/components/advanced/login"),require("@wm/components/advanced/marquee"),require("@wm/components/page"),require("@wm/components/page/footer"),require("@wm/components/page/header"),require("@wm/components/page/left-panel"),require("@wm/components/page/right-panel"),require("@wm/components/page/top-nav"),require("@wm/components/prefab"),require("@wm/runtime/base"),require("@wm/variables"),require("@wm/security"),require("@wm/transpiler"),require("@angular/platform-browser/animations")):"function"==typeof define&&define.amd?define("@wm/runtime/dynamic",["exports","@angular/core","@angular/platform-browser-dynamic","@angular/platform-browser","@angular/common","@angular/router","@angular/common/http","@angular/forms","ngx-bootstrap/typeahead","ngx-bootstrap/timepicker","ngx-bootstrap/progressbar","ngx-bootstrap/pagination","ngx-bootstrap/modal","ngx-bootstrap/tooltip","ngx-bootstrap/datepicker","ngx-bootstrap/dropdown","ngx-bootstrap/popover","ng-circle-progress","ngx-toastr","ngx-bootstrap/carousel","@wm/core","@wm/components/basic","@wm/components/basic/progress","@wm/components/basic/rich-text-editor","@wm/components/basic/search","@wm/components/basic/tree","@wm/components/input","@wm/components/input/calendar","@wm/components/input/chips","@wm/components/input/color-picker","@wm/components/input/currency","@wm/components/input/epoch","@wm/components/input/file-upload","@wm/components/input/rating","@wm/components/input/slider","@wm/mobile/runtime/dynamic","@wm/components/data/card","@wm/components/data/form","@wm/components/data/list","@wm/components/data/live-table","@wm/components/data/pagination","@wm/components/data/table","@wm/components/chart","@wm/components/containers/accordion","@wm/components/containers/linear-layout","@wm/components/containers/layout-grid","@wm/components/containers/panel","@wm/components/containers/tabs","@wm/components/containers/tile","@wm/components/containers/wizard","@wm/components/dialogs/alert-dialog","@wm/components/dialogs/iframe-dialog","@wm/components/dialogs/login-dialog","@wm/components/dialogs/partial-dialog","@wm/components/navigation/breadcrumb","@wm/components/navigation/menu","@wm/components/navigation/navbar","@wm/components/navigation/popover","@wm/components/advanced/carousel","@wm/components/advanced/login","@wm/components/advanced/marquee","@wm/components/page","@wm/components/page/footer","@wm/components/page/header","@wm/components/page/left-panel","@wm/components/page/right-panel","@wm/components/page/top-nav","@wm/components/prefab","@wm/runtime/base","@wm/variables","@wm/security","@wm/transpiler","@angular/platform-browser/animations"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.runtime=e.wm.runtime||{},e.wm.runtime.dynamic={}),e.ng.core,e.ng.platformBrowserDynamic,e.ng.platformBrowser,e.ng.common,e.ng.router,e.ng.common.http,e.ng.forms,e["ngx-bootstrap"].typeahead,e["ngx-bootstrap"].timepicker,e["ngx-bootstrap"].progressbar,e["ngx-bootstrap"].pagination,e["ngx-bootstrap"].modal,e["ngx-bootstrap"].tooltip,e["ngx-bootstrap"].datepicker,e["ngx-bootstrap"].dropdown,e["ngx-bootstrap"].popover,e.ngCircleProgress,e.ngxToastr,e["ngx-bootstrap"].carousel,e.wm.core,e.wm.components.basic,e.wm.components.basic.progress,e.wm.components.basic.richtexteditor,e.wm.components.basic.search,e.wm.components.basic.tree,e.wm.components.input,e.wm.components.input.calendar,e.wm.components.input.chips,e.wm.components.input.colorpicker,e.wm.components.input.currency,e.wm.components.input.epoch,e.wm.components.input.fileupload,e.wm.components.input.rating,e.wm.components.input.slider,e.wm.mobile.runtime.dynamic,e.wm.components.data.card,e.wm.components.data.form,e.wm.components.data.list,e.wm.components.data.livetable,e.wm.components.data.pagination,e.wm.components.data.table,e.wm.components.chart,e.wm.components.containers.accordion,e.wm.components.containers.linearlayout,e.wm.components.containers.layoutgrid,e.wm.components.containers.panel,e.wm.components.containers.tabs,e.wm.components.containers.tile,e.wm.components.containers.wizard,e.wm.components.dialogs.alertdialog,e.wm.components.dialogs.iframedialog,e.wm.components.dialogs.logindialog,e.wm.components.dialogs.partialdialog,e.wm.components.navigation.breadcrumb,e.wm.components.navigation.menu,e.wm.components.navigation.navbar,e.wm.components.navigation.popover,e.wm.components.advanced.carousel,e.wm.components.advanced.login,e.wm.components.advanced.marquee,e.wm.components.page,e.wm.components.page.footer,e.wm.components.page.header,e.wm.components.page.leftpanel,e.wm.components.page.rightpanel,e.wm.components.page.topnav,e.wm.components.prefab,e.wm.runtime.base,e.wm.variables,e.wm.security,e.wm.transpiler,e.ng.platformBrowser.animations)}(this,(function(e,t,n,i,o,a,r,s,l,c,p,d,u,h,m,f,g,v,y,b,w,P,O,E,R,A,T,S,C,I,D,x,N,M,k,L,F,j,B,G,V,W,U,q,z,H,Y,K,Q,Z,J,X,ee,te,ne,ie,oe,ae,re,se,le,ce,pe,de,ue,he,me,fe,ge,ve,ye,be,we){"use strict";function Pe(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var _e=Pe(t),Oe=Pe(r),Ee=function(e,t){return(Ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function Re(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Ee(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function Ae(e,t,n,i){return new(n||(n=Promise))((function(o,a){function r(e){try{l(i.next(e))}catch(e){a(e)}}function s(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}))}function Te(e,t){var n,i,o,a,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],i=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}Object.create;function Se(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,a=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return r}function Ce(e,t,n){if(n||2===arguments.length)for(var i,o=0,a=t.length;o<a;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var Ie=function(){function e(e,t,n,i,o,a,r,s,l,c,p,d,u){this.injector=e,this.route=t,this.vcRef=n,this.appRef=i,this.metadataService=o,this.securityService=a,this.appManager=r,this.app=s,this.ngZone=l,this.elRef=c,this.spinnerService=p,this.componentRefProvider=d,this.router=u}return e.prototype.getTargetNode=function(){return this.elRef.nativeElement},e.prototype.resetViewContainer=function(){this.vcRef.clear(),this.getTargetNode().innerHTML=""},e.prototype.renderPage=function(e){var t=this,n=this.getTargetNode();this.appManager.loadAppVariables().then((function(){return Ae(t,void 0,void 0,(function(){var t,i;return Te(this,(function(o){switch(o.label){case 0:return[4,this.componentRefProvider.getComponentFactoryRef(e,ge.ComponentType.PAGE)];case 1:return(t=o.sent())?(i=this.vcRef.createComponent(t,0,this.injector),this.instance=i.instance,n.appendChild(i.location.nativeElement)):ge.BasePageComponent.clear(),this.vcRef.length>1&&this.vcRef.remove(1),[2]}}))}))}))},e.prototype.renderPrefabPreviewPage=function(){this.router.navigate(["prefab-preview"])},e.prototype.loadPage=function(e){var t=this;this.ngZone.run((function(){e&&t.renderPage(e)}))},e.prototype.ngOnInit=function(){var e=this;this.app.isPrefabType?this.renderPrefabPreviewPage():($(this.getTargetNode()).find(">div").first().remove(),this.subscription=this.route.params.subscribe((function(t){var n=t.pageName;e.loadPage(n)})))},e.prototype.ngOnDestroy=function(){this.vcRef.clear(),this.subscription&&this.subscription.unsubscribe()},e.prototype.ngOnAttach=function(){this.getTargetNode().appendChild(this.instance.$page[0]),this.instance.ngOnAttach()},e.prototype.ngOnDetach=function(){this.instance.ngOnDetach()},e}();Ie.decorators=[{type:t.Component,args:[{selector:"app-page-outlet",template:"<div></div>"}]}],Ie.ctorParameters=function(){return[{type:t.Injector},{type:a.ActivatedRoute},{type:t.ViewContainerRef},{type:t.ApplicationRef},{type:ve.MetadataService},{type:ye.SecurityService},{type:ge.AppManagerService},{type:w.App},{type:t.NgZone},{type:t.ElementRef},{type:w.AbstractSpinnerService},{type:ge.ComponentRefProvider},{type:a.Router}]};var De={securityConfig:ge.SecurityConfigResolve,metadata:ge.MetadataResolve,appMetaConfig:ge.AppExtensionJSResolve},xe=[{path:"",pathMatch:"full",resolve:De,component:ge.EmptyPageComponent},{path:"prefab-preview",pathMatch:"full",resolve:De,component:ge.PrefabPreviewComponent},{path:":pageName",pathMatch:"full",resolve:De,component:Ie,canDeactivate:[ge.CanDeactivatePageGuard]}],Ne=function(e){function t(t){var n=e.call(this)||this;return n.$http=t,n}return Re(t,e),t.prototype.getAppScriptFn=function(){return this.$http.get("./app.js",{responseType:"text"}).toPromise().then((function(e){return new Function("App","Utils","Injector",e)}))},t}(ge.AppJSProvider);Ne.\u0275prov=_e.\u0275\u0275defineInjectable({factory:function(){return new Ne(_e.\u0275\u0275inject(Oe.HttpClient))},token:Ne,providedIn:"root"}),Ne.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],Ne.ctorParameters=function(){return[{type:r.HttpClient}]};var Me=new Map,ke=function(){function e(e){this.$http=e}return e.prototype.get=function(e,t){var n=Me.get(e);return n?Promise.resolve(n):this.$http.get(e).then((function(n){return t&&Me.set(e,n),n}))},e.prototype.clearCache=function(){Me.clear()},e}();ke.decorators=[{type:t.Injectable}],ke.ctorParameters=function(){return[{type:w.AbstractHttpService}]};var Le=function(e){function t(t){var n=e.call(this)||this;return n.resourceManager=t,n}return Re(t,e),t.prototype.getAppVariables=function(){return Ae(this,void 0,void 0,(function(){return Te(this,(function(e){return[2,this.resourceManager.get("./app.variables.json")]}))}))},t}(ge.AppVariablesProvider);Le.\u0275prov=_e.\u0275\u0275defineInjectable({factory:function(){return new Le(_e.\u0275\u0275inject(ke))},token:Le,providedIn:"root"}),Le.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],Le.ctorParameters=function(){return[{type:ke}]};var Fe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Re(t,e),t.prototype.loadFormatterConfigScript=function(e){try{w.appendScriptToHead(e)}catch(e){console.warn("Error while loading the formatters.js file")}},t}(ge.AppExtensionProvider);Fe.\u0275prov=_e.\u0275\u0275defineInjectable({factory:function(){return new Fe},token:Fe,providedIn:"root"}),Fe.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}];var je=new Map;window.resourceCache=je;var Be=new Map;Be.set(ge.ComponentType.PAGE,new Map),Be.set(ge.ComponentType.PARTIAL,new Map),Be.set(ge.ComponentType.PREFAB,new Map);var Ge=function(e){return decodeURIComponent(e.replace(/\+/g," "))},$e=Ge,Ve=function(e,t,n){return t===ge.ComponentType.PAGE||t===ge.ComponentType.PARTIAL?n&&n.prefab?ge.getPrefabPartialJsonUrl(n.prefab,e):"./pages/"+e+"/page.min.json":t===ge.ComponentType.PREFAB?ge.getPrefabMinJsonUrl(e):void 0},We=Ve,Ue=new Map,qe=function(e,t,n,i,o,a){var r=Ue.get(t);("Partial"!==n||_.isUndefined(i.Prefab))&&r||(r=new Function(n,"App","Utils",e),Ue.set(t,r)),r(i,o,a)},ze=qe,He=function(){function e(){}return e.prototype.init=function(){},e}(),Ye=function(e){var n=function(){};return n.decorators=[{type:t.NgModule,args:[{declarations:[e],imports:[ge.RuntimeBaseModule],schemas:[t.CUSTOM_ELEMENTS_SCHEMA,t.NO_ERRORS_SCHEMA]}]}],n},Ke=Ye,Qe=function(e,n,i,o,a,r){var s={template:i,styles:[o],encapsulation:t.ViewEncapsulation.None},l=He,c="",p="";switch(n){case ge.ComponentType.PAGE:l=ge.BasePageComponent,c="app-page-"+e,p="Page";break;case ge.ComponentType.PARTIAL:l=ge.BasePartialComponent,c="app-partial-"+e,p="Partial";break;case ge.ComponentType.PREFAB:l=ge.BasePrefabComponent,c="app-prefab-"+e,p="Prefab"}var d=function(t){function i(i){var o=t.call(this)||this;switch(o.injector=i,n){case ge.ComponentType.PAGE:o.pageName=e;break;case ge.ComponentType.PARTIAL:o.partialName=e;break;case ge.ComponentType.PREFAB:o.prefabName=e}return t.prototype.init.call(o),o}return Re(i,t),i.prototype.evalUserScript=function(e,t,n){qe(a,c,p,e,t,n)},i.prototype.getVariables=function(){return JSON.parse(r)},i.prototype.getExpressions=function(){return{}},i}(l);return d.decorators=[{type:t.Component,args:[Object.assign(Object.assign({},s),{selector:c,providers:[{provide:w.UserDefinedExecutionContext,useExisting:d}]})]}],d.ctorParameters=function(){return[{type:t.Injector}]},d},Ze=Qe,Je=function(e){function t(t,n,i,o){var a=e.call(this)||this;return a.resouceMngr=t,a.app=n,a.appManager=i,a.compiler=o,a}return Re(t,e),t.prototype.loadResourcesOfFragment=function(e,t,n){var i=this,o=Ve(e,t,n),a=je.get(o);return a?Promise.resolve(a):this.resouceMngr.get(o,!0).then((function(n){var i=n.markup,a=n.script,r=n.styles,s=n.variables,l={markup:be.transpile(Ge(i)).markup,script:Ge(a),styles:be.scopeComponentStyles(e,t,Ge(r)),variables:w.getValidJSON(Ge(s))};return je.set(o,l),l}),(function(e){var t=e.details.status,n={404:i.app.appLocale.MESSAGE_PAGE_NOT_FOUND||"The page you are trying to reach is not available",403:i.app.appLocale.LABEL_ACCESS_DENIED||"Access Denied"};return Promise.reject(n[t])}))},t.prototype.getComponentFactoryRef=function(e,t,n){return Ae(this,void 0,void 0,(function(){var i,o,a,r=this;return Te(this,(function(s){return(i=Be.get(t))&&(a=n&&n.prefab?n.prefab+e:e,o=i.get(a))?[2,o]:[2,this.loadResourcesOfFragment(e,t,n).then((function(i){var a=i.markup,s=i.script,l=i.styles,c=i.variables,p=Qe(e,t,a,l,s,JSON.stringify(c)),d=Ye(p);o=r.compiler.compileModuleAndAllComponentsSync(d).componentFactories.filter((function(e){return e.componentType===p}))[0];var u=n&&n.prefab?n.prefab+e:e;return Be.get(t).set(u,o),o}),(function(e){if(e){var t="Error while loading page";console.log(t,e),r.appManager.notifyApp(_.isString(e)?e:t+", check browser console for error details","error")}}))]}))}))},t.prototype.clearComponentFactoryRefCache=function(){this.resouceMngr.clearCache(),je.clear(),Be.forEach((function(e){e.clear()}))},t}(ge.ComponentRefProvider);Je.decorators=[{type:t.Injectable}],Je.ctorParameters=function(){return[{type:ke},{type:w.App},{type:ge.AppManagerService},{type:t.Compiler}]};var Xe=new Map,et=function(e){function t(t){var n=e.call(this)||this;return n.resourceMngr=t,n}return Re(t,e),t.prototype.getConfig=function(e){var t=Xe.get(e);return t?Promise.resolve(t):this.resourceMngr.get(ge.getPrefabConfigUrl(e)).then((function(t){return Xe.set(e,t),t}))},t}(ge.PrefabConfigProvider);et.decorators=[{type:t.Injectable}],et.ctorParameters=function(){return[{type:ke}]};var tt=a.RouterModule.forRoot(xe,{useHash:!0,scrollPositionRestoration:"top"}),nt=y.ToastNoAnimationModule.forRoot({maxOpened:1,autoDismiss:!0}),it=r.HttpClientXsrfModule.withOptions({cookieName:"wm_xsrf_token",headerName:w.getWmProjectProperties().xsrf_header_name}),ot=u.ModalModule.forRoot(),at=m.BsDatepickerModule.forRoot(),rt=m.DatepickerModule.forRoot(),st=c.TimepickerModule.forRoot(),lt=f.BsDropdownModule.forRoot(),ct=d.PaginationModule.forRoot(),pt=l.TypeaheadModule.forRoot(),dt=p.ProgressbarModule.forRoot(),ut=b.CarouselModule.forRoot(),ht=g.PopoverModule.forRoot(),mt=v.NgCircleProgressModule.forRoot({}),ft=h.TooltipModule.forRoot(),gt=[m.BsDatepickerModule,m.DatepickerModule,c.TimepickerModule,f.BsDropdownModule,d.PaginationModule,l.TypeaheadModule,p.ProgressbarModule,b.CarouselModule,g.PopoverModule,v.NgCircleProgressModule,h.TooltipModule,P.BasicModule,O.ProgressModule,E.RichTextEditorModule,R.SearchModule,A.TreeModule,S.CalendarModule,C.ChipsModule,I.ColorPickerModule,D.CurrencyModule,x.EpochModule,N.FileUploadModule,T.InputModule,M.RatingModule,k.SliderModule,F.CardModule,j.FormModule,B.ListModule,G.LiveTableModule,V.PaginationModule,W.TableModule,U.ChartModule,q.AccordionModule,z.LinearLayoutModule,H.LayoutGridModule,Y.PanelModule,K.TabsModule,Q.TileModule,Z.WizardModule,J.AlertDialogModule,X.IframeDialogModule,ee.LoginDialogModule,te.PartialDialogModule,ne.BreadcrumbModule,ie.MenuModule,oe.NavbarModule,ae.PopoverModule,re.CarouselModule,se.LoginModule,le.MarqueeModule,ce.PageModule,pe.FooterModule,de.HeaderModule,ue.LeftPanelModule,he.RightPanelModule,me.TopNavModule,fe.PrefabModule];ge.REQUIRED_MODULES_FOR_DYNAMIC_COMPONENTS.push.apply(ge.REQUIRED_MODULES_FOR_DYNAMIC_COMPONENTS,Ce([],Se(gt))),ge.REQUIRED_MODULES_FOR_DYNAMIC_COMPONENTS.push.apply(ge.REQUIRED_MODULES_FOR_DYNAMIC_COMPONENTS,Ce([],Se(L.MOBILE_COMPONENT_MODULES_FOR_ROOT))),ge.REQUIRED_MODULES_FOR_DYNAMIC_COMPONENTS.push(s.FormsModule,s.ReactiveFormsModule);var vt=function(e,t,n){this.app=e,this.inj=t,this.componentRefProvider=n,window.cordova&&this.app.subscribe("userLoggedOut",this.componentRefProvider.clearComponentFactoryRefCache.bind(this.componentRefProvider))};vt.decorators=[{type:t.NgModule,args:[{declarations:[Ie],imports:[i.BrowserModule,we.BrowserAnimationsModule,o.CommonModule,a.RouterModule,r.HttpClientModule,ot,at,rt,st,lt,ct,pt,ft,dt,ut,ht,mt,tt,nt,it,L.MobileRuntimeDynamicModule,ge.WM_MODULES_FOR_ROOT],providers:[ke,{provide:ge.AppJSProvider,useClass:Ne},{provide:ge.AppVariablesProvider,useClass:Le},{provide:ge.AppExtensionProvider,useClass:Fe},{provide:ge.ComponentRefProvider,useClass:Je},{provide:w.PartialRefProvider,useClass:Je},{provide:ge.PrefabConfigProvider,useClass:et},{provide:a.RouteReuseStrategy,useClass:ge.WmRouteReuseStrategy}],bootstrap:[ge.AppComponent]}]}],vt.ctorParameters=function(){return[{type:w.App},{type:t.Injector},{type:ge.ComponentRefProvider}]};var yt="debugMode";"true"!==sessionStorage.getItem(yt)&&t.enableProdMode(),console.time("bootstrap"),document.addEventListener("DOMContentLoaded",(function(){new Promise((function(e){window.cordova?document.addEventListener("deviceready",e):e()})).then((function(){return n.platformBrowserDynamic().bootstrapModule(vt)})).then((function(e){var n=e.injector.get(t.ApplicationRef);window.addEventListener("unload",(function(){n.components.map((function(e){return e&&e.destroy()}))})),console.timeEnd("bootstrap")}),(function(e){return console.log(e)}))})),window.debugMode=function(e){_.isEmpty(e)&&(e=!0);var t=e?"true":"false";sessionStorage.getItem(yt)!==t&&(sessionStorage.setItem(yt,t),window.location.reload())};e.AppExtensionProviderService=Fe,e.AppJSProviderService=Ne,e.AppModule=vt,e.AppResourceManagerService=ke,e.AppVariablesProviderService=Le,e.ComponentRefProviderService=Je,e.PageWrapperComponent=Ie,e.PrefabConfigProviderService=et,e.bsDatePickerModule=at,e.bsDropdownModule=lt,e.carouselModule=ut,e.datepickerModule=rt,e.httpClientXsrfModule=it,e.modalModule=ot,e.ngCircleProgressModule=mt,e.paginationModule=ct,e.popoverModule=ht,e.progressbarModule=dt,e.routerModule=tt,e.timepickerModule=st,e.toastrModule=nt,e.tooltipModule=ft,e.typeaheadModule=pt,e["\u02750"]=$e,e["\u02751"]=We,e["\u02752"]=ze,e["\u02753"]=Ke,e["\u02754"]=Ze,e["\u0275a"]=xe,Object.defineProperty(e,"__esModule",{value:!0})}));
745
+ var Y=function(e,t){return(Y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function K(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Y(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function Q(e,t,n,i){return new(n||(n=Promise))((function(o,a){function r(e){try{l(i.next(e))}catch(e){a(e)}}function s(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}))}function Z(e,t){var n,i,o,a,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],i=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}Object.create;function J(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function X(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,a=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return r}function ee(e,t,n){if(n||2===arguments.length)for(var i,o=0,a=t.length;o<a;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var te=function(){function e(){this.fragments=0,this.fragmentsLoaded$=new l.Subject}return e.prototype.init=function(){var e=this;this.viewInit$.subscribe(o.noop,o.noop,(function(){e.isViewInitialized=!0,e.isReady()}))},e.prototype.registerFragment=function(){this.fragments++},e.prototype.resolveFragment=function(){this.fragments--,this.isReady()},e.prototype.isReady=function(){this.isViewInitialized&&!this.fragments&&(this.registerFragment=o.noop,this.resolveFragment=o.noop,this.fragmentsLoaded$.complete())},e}();te.decorators=[{type:t.Directive}],te.ctorParameters=function(){return[]};var ne={},ie=function(e){function t(){var t=e.apply(this,ee([],X(arguments)))||this;return t.compileContent=!1,t.destroy$=new l.Subject,t.viewInit$=new l.Subject,t}return K(t,e),t.prototype.getContainerWidgetInjector=function(){return this.containerWidget.inj||this.containerWidget.injector},t.prototype.init=function(){var t=this;this.App=this.injector.get(o.App),this.containerWidget=this.injector.get(c.WidgetRef),this.i18nService=this.injector.get(o.AbstractI18nService),this.scriptLoaderService=this.injector.get(o.ScriptLoaderService),this.Viewport=this.injector.get(o.Viewport),this.getContainerWidgetInjector().view.component.registerFragment&&this.getContainerWidgetInjector().view.component.registerFragment(),this.registerExpressions(),this.initUserScript(),this.registerWidgets(),this.initVariables(),this.activePageName=this.App.activePageName,this.registerPageParams(),this.defineI18nProps(),this.viewInit$.subscribe(o.noop,o.noop,(function(){t.pageParams=t.containerWidget.partialParams})),this.spa?this.pageDirective=this.injector.get(s.SpaPageDirective,null):this.pageDirective=this.injector.get(s.PageDirective,null),this.pageDirective&&(this.registerDestroyListener(this.pageDirective.subscribe("attach",(function(e){return t.ngOnAttach(e.refreshData)}))),this.registerDestroyListener(this.pageDirective.subscribe("detach",(function(){return t.ngOnDetach()})))),e.prototype.init.call(this)},t.prototype.registerWidgets=function(){"Common"===this.partialName?this.Widgets=ne:this.Widgets=Object.create(ne),this.containerWidget.Widgets=this.Widgets},t.prototype.registerDestroyListener=function(e){this.destroy$.subscribe(o.noop,o.noop,(function(){return e()}))},t.prototype.initUserScript=function(){try{this.getContainerWidgetInjector().view.component.prefabName&&(this.getContainerWidgetInjector().view.component.Prefab?this.Prefab=this.getContainerWidgetInjector().view.component.Prefab:this.Prefab=this.getContainerWidgetInjector().view.component),this.evalUserScript(this,this.App,this.injector.get(o.UtilsService))}catch(e){console.error("Error in evaluating partial ("+this.partialName+") script\n",e)}},t.prototype.initVariables=function(){var e=this,t=this.injector.get(r.VariablesService).register(this.partialName,this.getVariables(),this);this.Variables=Object.create(this.App.Variables),this.Actions=Object.create(this.App.Actions),this.containerWidget.Variables=this.Variables,this.containerWidget.Actions=this.Actions,Object.entries(t.Variables).forEach((function(t){var n=X(t,2),i=n[0],o=n[1];return e.Variables[i]=o})),Object.entries(t.Actions).forEach((function(t){var n=X(t,2),i=n[0],o=n[1];return e.Actions[i]=o})),this.viewInit$.subscribe(o.noop,o.noop,(function(){o.$invokeWatchers(!0,!0),t.callback(t.Variables).catch(o.noop),t.callback(t.Actions)}))},t.prototype.registerExpressions=function(){var e=this.getExpressions();_.each(e,(function(e,t){o.registerFnByExpr(t,e[0],e[1])}))},t.prototype.registerPageParams=function(){this.pageParams=this.containerWidget.partialParams},t.prototype.defineI18nProps=function(){this.appLocale=this.i18nService.getAppLocale()},t.prototype.invokeOnReady=function(){var e;this.containerWidget.userComponentParams&&(e=this.containerWidget.userComponentParams),this.onReady(e),this.getContainerWidgetInjector().view.component.resolveFragment&&this.getContainerWidgetInjector().view.component.resolveFragment()},t.prototype.loadScripts=function(){var e=this;return new Promise((function(t){var n,i=e.partialDirective.$element.attr("scripts-to-load");i?(n=e.scriptLoaderService).load.apply(n,ee([],X(i.split(",")))).then(t):t()}))},t.prototype.mute=function(){var e=function(e){e&&e.mute&&e.mute()};_.each(this.Widgets,e),_.each(this.Variables,e),_.each(this.Actions,e)},t.prototype.unmute=function(){var e=function(e){e&&e.unmute&&e.unmute()};_.each(this.Widgets,e),_.each(this.Variables,e),_.each(this.Actions,e)},t.prototype.ngAfterViewInit=function(){var e=this;this.loadScripts().then((function(){e.compileContent=!0,setTimeout((function(){e.viewInit$.complete(),e.fragmentsLoaded$.subscribe(o.noop,o.noop,(function(){return e.invokeOnReady()}))}),100)}))},t.prototype.ngOnDestroy=function(){this.destroy$.complete()},t.prototype.ngOnAttach=function(e){if(this.unmute(),e){var t=function(e){e&&e.startUpdate&&e.invoke&&e.invoke()};_.each(this.Variables,t),_.each(this.Actions,t)}_.each(this.Widgets,(function(e){return e&&e.ngOnAttach&&e.ngOnAttach()}))},t.prototype.ngOnDetach=function(){this.mute(),_.each(this.Widgets,(function(e){return e&&e.ngOnDetach&&e.ngOnDetach()}))},t.prototype.onReady=function(e){},t}(te);ie.decorators=[{type:t.Directive}],ie.propDecorators={partialDirective:[{type:t.ViewChild,args:[c.PartialDirective]}]};var oe="_cache_page",ae="REUSE_ROUTE_STRATEGY.MAX_CACHE_SIZE",re="REUSE_ROUTE_STRATEGY.MAX_CACHE_AGE",se=function(){function e(e,t){var n=this;this.maxCacheSize=e,this.maxCacheAge=t,this.paramsToIgnore=["wm_state",oe],this.getSize=function(e){return e?Object.keys(e).length:0},this.cache=new o.LRUCache(e,t,(function(e,t){n.currentRouteKey===e?n.cache.set(e,t):t.componentRef.destroy()}))}return e.prototype.getKey=function(e){var t=this,n=_.chain(e.queryParams).keys().filter((function(e){return!_.includes(t.paramsToIgnore,e)})).orderBy().map((function(t){return t+"="+e.queryParams[t]})).value().join("&"),i=e.params.pageName;return e.data.pageName&&""===e.routeConfig.path&&(i=e.data.pageName),i&&i+(n?"?"+n:"")},e.prototype.isSameQueryParams=function(e,t){try{var n=e.queryParams,i=t.queryParams,o=n?this.getSize(n):0,a=i?this.getSize(i):0;return 0===o&&0===a||o===a&&JSON.stringify(n)===JSON.stringify(i)}catch(e){return!1}},e.prototype.isCacheEnabled=function(e,t){var n=e.queryParams._cache_page;return _.isNil(n)?t:"true"===n||!0===n},e.prototype.shouldDetach=function(e){var t=this.getKey(e);return!!this.isCacheEnabled(e,!!e.data._cache_page)||(this.cache.delete(t),!1)},e.prototype.shouldAttach=function(e){var t=this.getKey(e);this.currentRouteKey=t;var n=this.cache.get(t);return!(!n||!this.isCacheEnabled(e,!!n._cache_page))||(this.cache.delete(t),!1)},e.prototype.store=function(e,t){if(t){var n=this.getKey(e);t._cache_page=!!e.data._cache_page,this.cache.set(n,t)}},e.prototype.retrieve=function(e){var t=this.getKey(e);return this.cache.get(t)},e.prototype.reset=function(e){var t,n,i=this;if(!e)return this.cache.clear();this.cache.delete(e);var o=e+="?",a=[];try{for(var r=J(this.cache.keys()),s=r.next();!s.done;s=r.next()){var l=s.value;l.startsWith(o)&&a.push(l)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}a.forEach((function(e){return i.cache.delete(e)}))},e}(),le=function(e){function t(t,n){return e.call(this,t,n)||this}return K(t,e),t.prototype.isSameRoute=function(e,t){if(e.routeConfig&&"prefab-preview"===e.routeConfig.path)return!1;var n=e.params,i=t.params,o=this.getSize(n),a=this.getSize(i);return 0===o&&0===a||o===a&&(n.pageName===i.pageName&&this.isSameQueryParams(e,t))},t.prototype.shouldReuseRoute=function(e,t){return this.isSameRoute(e,t)},t}(se);le.ctorParameters=function(){return[{type:Number,decorators:[{type:t.Inject,args:[ae]}]},{type:Number,decorators:[{type:t.Inject,args:[re]}]}]};var ce=function(e){function t(t,n){return e.call(this,t,n)||this}return K(t,e),t.prototype.isSameRoute=function(e,t){return!e.routeConfig&&!t.routeConfig||e.routeConfig===t.routeConfig&&(e.routeConfig!==t.routeConfig||(!(!e.data.layoutName||!t.data.layoutName)||this.isSameQueryParams(e,t)))},t.prototype.shouldReuseRoute=function(e,t){return this.isSameRoute(e,t)},t}(se);ce.ctorParameters=function(){return[{type:Number,decorators:[{type:t.Inject,args:[ae]}]},{type:Number,decorators:[{type:t.Inject,args:[re]}]}]};var pe=function(e){function t(){var t=e.apply(this,ee([],X(arguments)))||this;return t.startupVariablesLoaded=!1,t.pageTransitionCompleted=!1,t.destroy$=new l.Subject,t.viewInit$=new l.Subject,t.formatsByLocale={timezone:""},t}return K(t,e),t.prototype.init=function(){o.muteWatchers(),this.App=this.injector.get(o.App),this.route=this.injector.get(n.ActivatedRoute),this.appManager=this.injector.get(j),this.navigationService=this.injector.get(o.AbstractNavigationService),this.scriptLoaderService=this.injector.get(o.ScriptLoaderService),this.i18nService=this.injector.get(o.AbstractI18nService),this.router=this.injector.get(n.Router),this.Viewport=this.injector.get(o.Viewport),this.registerExpressions(),this.initUserScript(),this.registerWidgets(),this.initVariables(),this.App.lastActivePageName=this.App.activePageName,this.App.activePageName=this.pageName,this.App.activePage=this,this.activePageName=this.pageName,this.registerPageParams(),this.defineI18nProps(),e.prototype.init.call(this)},t.prototype.registerWidgets=function(){this.Widgets=Object.create(ne),this.App.Widgets=Object.create(this.Widgets)},t.prototype.initUserScript=function(){try{this.evalUserScript(this,this.App,this.injector.get(o.UtilsService))}catch(e){console.error("Error in evaluating page ("+this.pageName+") script\n",e)}},t.prototype.registerPageParams=function(){var e=this,t=this.route.queryParams.subscribe((function(t){return e.pageParams=e.App.pageParams=_.extend({},t)}));this.registerDestroyListener((function(){return t.unsubscribe()}))},t.prototype.registerDestroyListener=function(e){this.destroy$.subscribe(o.noop,o.noop,(function(){return e()}))},t.prototype.defineI18nProps=function(){this.appLocale=this.i18nService.getAppLocale()},t.prototype.initVariables=function(){var e=this,t=this.injector.get(r.VariablesService).register(this.pageName,this.getVariables(),this);this.Variables=Object.create(this.App.Variables),this.Actions=Object.create(this.App.Actions),Object.entries(t.Variables).forEach((function(t){var n=X(t,2),i=n[0],o=n[1];return e.Variables[i]=o})),Object.entries(t.Actions).forEach((function(t){var n=X(t,2),i=n[0],o=n[1];return e.Actions[i]=o}));var n=this.viewInit$.subscribe(o.noop,o.noop,(function(){e.appManager.isAppVariablesFired()||(t.callback(e.App.Variables).catch(o.noop).then((function(){e.appManager.notify("app-variables-data-loaded",{pageName:e.pageName})})),t.callback(e.App.Actions),e.appManager.appVariablesReady(),e.appManager.isAppVariablesFired(!0)),t.callback(t.Variables).catch(o.noop).then((function(){e.appManager.notify("page-variables-data-loaded",{pageName:e.pageName}),e.startupVariablesLoaded=!0,setTimeout((function(){e.showPageContent=!0}),100)})),t.callback(t.Actions),n.unsubscribe()}))},t.prototype.setTimezone=function(e){this.i18nService.setTimezone(e,this)},t.prototype.registerExpressions=function(){var e=this.getExpressions();_.each(e,(function(e,t){o.registerFnByExpr(t,e[0],e[1])}))},t.prototype.runPageTransition=function(e){var n=this;e=e||this.navigationService.getPageTransition();var i=t.lastPageSnapShot;return new Promise((function(t){if(e&&!e.startsWith("none")&&i){var o=i.parent(),a=function(n){!t||n&&n.pseudoElement||(o.off("animationend",a),o.removeClass(e),o.children().first().remove(),t(),t=null)};e="page-transition page-transition-"+e,i.addClass("page-exit"),n.$page.addClass("page-entry"),o.addClass(e),o.on("animationend",a),setTimeout(a,1e3)}else t()})).then((function(){n.$page&&n.$page.removeClass("page-entry"),i&&(i.remove(),t.lastPageSnapShot=null),n.pageTransitionCompleted=!0}))},t.prototype.invokeOnReady=function(){this.onReady(),this.appManager.notify("pageReady",{name:this.pageName,instance:this}),(this.App.onPageReady||o.noop)(this.pageName,this)},t.prototype.loadScripts=function(){var e=this;return new Promise((function(t){var n,i=e.pageDirective&&e.pageDirective.$element.attr("scripts-to-load");i?(n=e.scriptLoaderService).load.apply(n,ee([],X(i.split(",")))).then(t):t()}))},t.prototype.restoreLastPageSnapshot=function(){o.isMobileApp()&&t.lastPageSnapShot&&this.$page&&this.$page.parent().prepend(t.lastPageSnapShot)},t.prototype.savePageSnapShot=function(){t.lastPageSnapShot&&t.lastPageSnapShot.remove(),o.isMobileApp()&&this.$page&&(t.lastPageSnapShot=this.$page.clone(),this.$page.parents("app-root").prepend(t.lastPageSnapShot))},t.prototype.saveScrollPosition=function(){var e=function(t,n,i,o){void 0===i&&(i=!0),void 0===o&&(o=t),i&&t.children().each((function(t,i){return e($(i),n)}));var a=o.scrollLeft(),r=o.scrollTop();(a>0||r>0)&&t.attr(n,a+","+r)};e(this.$page,"data-scroll-position"),this.$page.attr("data-window-scroll-position",window.scrollX+","+window.scrollY)},t.prototype.restoreScrollPosition=function(){var e=function(t,n,i,o){void 0===i&&(i=!0),void 0===o&&(o=t);var a=(t.attr(n)||"").split(",");a.length>1&&(o.scrollLeft(a[0]),o.scrollTop(a[1])),t.removeAttr(n),i&&t.children().each((function(t,i){return e($(i),n)}))};e(this.$page,"data-scroll-position"),e(this.$page,"data-window-scroll-position",!1,$(window))},t.prototype.canDeactivate=function(){var e;return!1!==(e=this.onBeforePageLeave())&&(e=(this.App.onBeforePageLeave||o.noop)(this.App.activePageName,this.App.activePage)),void 0===e||e},t.prototype.ngAfterViewInit=function(){var e=this;this.route.snapshot.data._cache_page=this.canReuse(),this.pageDirective&&(this.$page=this.pageDirective.$element.parent(),o.isIos()&&this.$page.addClass("ios-page"),o.isAndroid()&&this.$page.addClass("android-page")),this.restoreLastPageSnapshot(),this.loadScripts().then((function(){e.runPageTransition().then((function(){e.compilePageContent=!0,setTimeout((function(){e.onPageContentReady=function(){e.fragmentsLoaded$.subscribe(o.noop,o.noop,(function(){e.invokeOnReady()})),o.unMuteWatchers(),e.viewInit$.complete(),e.onPageContentReady=o.noop}}),0)}))}))},t.prototype.ngOnDestroy=function(){this.savePageSnapShot(),this.destroy$.complete()},t.prototype.onReady=function(){},t.prototype.onBeforePageReady=function(){},t.prototype.onBeforePageLeave=function(){},t.prototype.onPageContentReady=function(){},t.prototype.canReuse=function(){return!(!this.pageDirective||!this.pageDirective.cache)},t.prototype.mute=function(){var e=function(e){e&&e.mute&&e.mute()};_.each(this.Widgets,e),_.each(this.Variables,e),_.each(this.Actions,e)},t.prototype.unmute=function(e){void 0===e&&(e=this);var t=function(e){e&&e.unmute&&e.unmute()};_.each(this.Widgets,t),_.each(this.Variables,t),_.each(this.Actions,t)},t.prototype.ngOnAttach=function(){var e=this;if(this.route.snapshot.data._cache_page=this.canReuse(),this.registerPageParams(),this.App.lastActivePageName=this.App.activePageName,this.App.activePageName=this.pageName,this.App.activePage=this,this.activePageName=this.pageName,this.restoreLastPageSnapshot(),this.unmute(),this.App.Widgets=Object.create(this.Widgets),this.pageDirective&&this.pageDirective.refreshdataonattach){var t=function(e){e&&e.startUpdate&&e.invoke&&e.invoke()};_.each(this.Variables,t),_.each(this.Actions,t)}this.runPageTransition().then((function(){setTimeout((function(){return e.restoreScrollPosition()}),100),_.each(e.Widgets,(function(e){return e&&e.ngOnAttach&&e.ngOnAttach()})),e.appManager.notify("pageAttach",{name:e.pageName,instance:e})}))},t.prototype.ngOnDetach=function(){this.saveScrollPosition(),this.savePageSnapShot(),this.mute(),_.each(this.Widgets,(function(e){return e&&e.ngOnDetach&&e.ngOnDetach()})),this.appManager.notify("pageDetach",{name:this.pageName,instance:this})},t.prototype.ngAfterContentInit=function(){this.onBeforePageReady()},t.clear=function(){t.lastPageSnapShot&&(t.lastPageSnapShot.remove(),t.lastPageSnapShot=null)},t}(te);pe.lastPageSnapShot=null,pe.decorators=[{type:t.Directive}],pe.propDecorators={pageDirective:[{type:t.ViewChild,args:[s.PageDirective]}],canDeactivate:[{type:t.HostListener,args:["window:beforeunload"]}]};var de=function(e){function t(){var t=e.apply(this,ee([],X(arguments)))||this;return t.compileContent=!1,t.destroy$=new l.Subject,t.viewInit$=new l.Subject,t}return K(t,e),t.prototype.getContainerWidgetInjector=function(){return this.containerWidget.inj||this.containerWidget.injector},t.prototype.init=function(){var t=this;this.App=this.injector.get(o.App),this.containerWidget=this.injector.get(c.WidgetRef),this.prefabMngr=this.injector.get(H),this.i18nService=this.injector.get(o.AbstractI18nService),this.scriptLoaderService=this.injector.get(o.ScriptLoaderService),this.Viewport=this.injector.get(o.Viewport),this.getContainerWidgetInjector().view.component.registerFragment&&this.getContainerWidgetInjector().view.component.registerFragment(),this.spa?this.pageDirective=this.injector.get(s.SpaPageDirective,null):this.pageDirective=this.injector.get(s.PageDirective,null),this.pageDirective&&(this.registerDestroyListener(this.pageDirective.subscribe("attach",(function(e){return t.ngOnAttach(e.refreshData)}))),this.registerDestroyListener(this.pageDirective.subscribe("detach",(function(){return t.ngOnDetach()})))),this.registerExpressions(),this.initUserScript(),this.registerWidgets(),this.initVariables(),this.registerProps(),this.defineI18nProps(),e.prototype.init.call(this)},t.prototype.registerWidgets=function(){this.Widgets={},this.Widgets={},this.containerWidget.Widgets=this.Widgets},t.prototype.initUserScript=function(){try{this.evalUserScript(this,this.App,this.injector.get(o.UtilsService))}catch(e){console.error("Error in evaluating prefab ("+this.prefabName+") script\n",e)}},t.prototype.registerChangeListeners=function(){this.containerWidget.registerPropertyChangeListener(this.onPropertyChange),this.containerWidget.registerStyleChangeListener(this.onPropertyChange)},t.prototype.registerDestroyListener=function(e){this.destroy$.subscribe(o.noop,o.noop,(function(){return e()}))},t.prototype.defineI18nProps=function(){this.appLocale=this.i18nService.getPrefabLocaleBundle(this.prefabName)},t.prototype.registerProps=function(){var e=this;this.prefabMngr.getConfig(this.prefabName).then((function(t){t&&(e.displayName=t.displayName,Object.entries(t.properties||{}).forEach((function(t){var n,i=X(t,2),a=i[0],r=i[1],s=_.trim(r.value);_.startsWith(s,"bind:")&&(n=s.replace("bind:","")),Object.defineProperty(e,a,{get:function(){return e.containerWidget[a]},set:function(t){return e.containerWidget.widget[a]=t}}),n&&e.registerDestroyListener(o.$watch(n,e,{},(function(t){return e.containerWidget.widget[a]=t})))})),Object.entries(t.events||{}).forEach((function(t){var n=X(t,2),i=n[0];n[1];e[i]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=i.substr(2).toLowerCase();e.containerWidget.invokeEventCallback(o,{$event:t[0],$data:t[1]})}})),Object.entries(t.methods||{}).forEach((function(t){var n=X(t,2),i=n[0];n[1];e.containerWidget[i]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{if(e[i])return e[i].apply(e,t)}catch(t){console.warn("error in executing prefab-"+e.prefabName+" method-"+i)}}}))),e.containerWidget.setProps(t),o.isIE()&&(e.containerWidget.widget=e.containerWidget.createProxy())}))},t.prototype.initVariables=function(){var e=this,t=this.injector.get(r.VariablesService).register(this.prefabName,this.getVariables(),this);this.Variables={},this.Actions={},this.containerWidget.Variables=this.Variables,this.containerWidget.Actions=this.Actions,Object.entries(t.Variables).forEach((function(t){var n=X(t,2),i=n[0],o=n[1];return e.Variables[i]=o})),Object.entries(t.Actions).forEach((function(t){var n=X(t,2),i=n[0],o=n[1];return e.Actions[i]=o})),this.viewInit$.subscribe(o.noop,o.noop,(function(){t.callback(t.Variables).catch(o.noop),t.callback(t.Actions)}))},t.prototype.registerExpressions=function(){var e=this.getExpressions();_.each(e,(function(e,t){o.registerFnByExpr(t,e[0],e[1])}))},t.prototype.invokeOnReady=function(){o.$invokeWatchers(!0,!0),this.onReady(),this.getContainerWidgetInjector().view.component.resolveFragment&&this.getContainerWidgetInjector().view.component.resolveFragment(),this.containerWidget.invokeEventCallback("load")},t.prototype.loadScripts=function(){var e=this;return new Promise((function(t){var n,i=e.prefabContainerDirective.$element.attr("scripts-to-load");i?(n=e.scriptLoaderService).load.apply(n,ee([],X(i.split(",")))).then(t):t()}))},t.prototype.mute=function(){var e=function(e){e&&e.mute&&e.mute()};_.each(this.Widgets,e),_.each(this.Variables,e),_.each(this.Actions,e)},t.prototype.unmute=function(){var e=function(e){e&&e.unmute&&e.unmute()};_.each(this.Widgets,e),_.each(this.Variables,e),_.each(this.Actions,e)},t.prototype.ngOnAttach=function(e){if(this.unmute(),e){var t=function(e){e&&e.startUpdate&&e.invoke&&e.invoke()};_.each(this.Variables,t),_.each(this.Actions,t)}_.each(this.Widgets,(function(e){return e&&e.ngOnAttach&&e.ngOnAttach()}))},t.prototype.ngOnDetach=function(){this.mute(),_.each(this.Widgets,(function(e){return e&&e.ngOnDetach&&e.ngOnDetach()}))},t.prototype.ngAfterViewInit=function(){var e=this;this.loadScripts().then((function(){e.compileContent=!0,e.registerChangeListeners(),setTimeout((function(){e.viewInit$.complete(),e.fragmentsLoaded$.subscribe(o.noop,o.noop,(function(){return e.invokeOnReady()}))}),100)}))},t.prototype.ngOnDestroy=function(){this.destroy$.complete()},t.prototype.onPropertyChange=function(){},t.prototype.onReady=function(){},t}(te);de.decorators=[{type:t.Directive}],de.propDecorators={prefabContainerDirective:[{type:t.ViewChild,args:[p.PrefabContainerDirective]}]};var ue=function(){function e(){}return e.prototype.registerExpressions=function(){var e=this.getExpressions();_.each(e,(function(e,t){o.registerFnByExpr(t,e[0],e[1])}))},e.prototype.overrideRouterOutlet=function(){var e=this,t=this.routerOutlet.attach,n=this.routerOutlet.detach;this.routerOutlet.attach=function(n){t.call(e.routerOutlet,n),n.instance.ngOnAttach()},this.routerOutlet.detach=function(){return n.call(e.routerOutlet)}},e.prototype.ngAfterViewInit=function(){var e=this;setTimeout((function(){e.overrideRouterOutlet()}),10)},e.prototype.init=function(){this.App=this.injector.get(o.App),this.App.activeLayoutName=this.layoutName,this.App.layoutPages=this.layoutPages,this.registerExpressions()},e.prototype.ngOnDestroy=function(){},e.prototype.canReuse=function(){},e.prototype.ngOnAttach=function(){},e.prototype.ngOnDetach=function(){},e.prototype.onActivate=function(e){_.extend(this,e)},e}();ue.decorators=[{type:t.Directive}],ue.propDecorators={routerOutlet:[{type:t.ViewChild,args:[n.RouterOutlet]}],pageDirective:[{type:t.ViewChild,args:[s.PageDirective]}]};var he,me=function(e){function t(){var t=e.apply(this,ee([],X(arguments)))||this;return t.startupVariablesLoaded=!1,t.pageTransitionCompleted=!1,t.destroy$=new l.Subject,t.viewInit$=new l.Subject,t.formatsByLocale={timezone:""},t}return K(t,e),t.prototype.init=function(){o.muteWatchers(),this.App=this.injector.get(o.App),this.route=this.injector.get(n.ActivatedRoute),this.appManager=this.injector.get(j),this.navigationService=this.injector.get(o.AbstractNavigationService),this.scriptLoaderService=this.injector.get(o.ScriptLoaderService),this.i18nService=this.injector.get(o.AbstractI18nService),this.router=this.injector.get(n.Router),this.Viewport=this.injector.get(o.Viewport),this.layoutDirective=this.injector.get(s.LayoutDirective),this.registerExpressions(),this.initUserScript(),this.registerWidgets(),this.initVariables(),this.App.lastActivePageName=this.App.activePageName,this.App.activePageName=this.pageName,this.App.activePage=this,this.activePageName=this.pageName,this.registerPageParams(),this.defineI18nProps(),e.prototype.init.call(this)},t.prototype.registerWidgets=function(){this.Widgets=Object.create(ne),this.App.Widgets=Object.create(this.Widgets)},t.prototype.initUserScript=function(){try{this.evalUserScript(this,this.App,this.injector.get(o.UtilsService))}catch(e){console.error("Error in evaluating page ("+this.pageName+") script\n",e)}},t.prototype.registerPageParams=function(){var e=this,t=this.route.queryParams.subscribe((function(t){return e.pageParams=e.App.pageParams=_.extend({},t)}));this.registerDestroyListener((function(){return t.unsubscribe()}))},t.prototype.registerDestroyListener=function(e){this.destroy$.subscribe(o.noop,o.noop,(function(){return e()}))},t.prototype.defineI18nProps=function(){this.appLocale=this.i18nService.getAppLocale()},t.prototype.initVariables=function(){var e=this,t=this.injector.get(r.VariablesService).register(this.pageName,this.getVariables(),this);this.Variables=Object.create(this.App.Variables),this.Actions=Object.create(this.App.Actions),Object.entries(t.Variables).forEach((function(t){var n=X(t,2),i=n[0],o=n[1];return e.Variables[i]=o})),Object.entries(t.Actions).forEach((function(t){var n=X(t,2),i=n[0],o=n[1];return e.Actions[i]=o}));var n=this.viewInit$.subscribe(o.noop,o.noop,(function(){e.appManager.isAppVariablesFired()||(t.callback(e.App.Variables).catch(o.noop).then((function(){e.appManager.notify("app-variables-data-loaded",{pageName:e.pageName})})),t.callback(e.App.Actions),e.appManager.appVariablesReady(),e.appManager.isAppVariablesFired(!0)),t.callback(t.Variables).catch(o.noop).then((function(){e.appManager.notify("page-variables-data-loaded",{pageName:e.pageName}),e.startupVariablesLoaded=!0,setTimeout((function(){e.showPageContent=!0}),100)})),t.callback(t.Actions),n.unsubscribe()}))},t.prototype.setTimezone=function(e){this.i18nService.setTimezone(e,this)},t.prototype.registerExpressions=function(){var e=this.getExpressions();_.each(e,(function(e,t){o.registerFnByExpr(t,e[0],e[1])}))},t.prototype.runPageTransition=function(e){var n=this;e=e||this.navigationService.getPageTransition();var i=t.lastPageSnapShot;return new Promise((function(t){if(e&&!e.startsWith("none")&&i){var o=i.parent(),a=function(n){!t||n&&n.pseudoElement||(o.off("animationend",a),o.removeClass(e),o.children().first().remove(),t(),t=null)};e="page-transition page-transition-"+e,i.addClass("page-exit"),n.$page.addClass("page-entry"),o.addClass(e),o.on("animationend",a),setTimeout(a,1e3)}else t()})).then((function(){n.$page&&n.$page.removeClass("page-entry"),i&&(i.remove(),t.lastPageSnapShot=null),n.pageTransitionCompleted=!0}))},t.prototype.invokeOnReady=function(){this.onReady(),this.appManager.notify("highlightActiveLink",{pageName:this.pageName}),this.appManager.notify("pageReady",{name:this.pageName,instance:this}),(this.App.onPageReady||o.noop)(this.pageName,this)},t.prototype.loadScripts=function(){var e=this;return new Promise((function(t){var n,i=e.spaPageDirective&&e.spaPageDirective.$element.attr("scripts-to-load");i?(n=e.scriptLoaderService).load.apply(n,ee([],X(i.split(",")))).then(t):t()}))},t.prototype.restoreLastPageSnapshot=function(){o.isMobileApp()&&t.lastPageSnapShot&&this.$page&&this.$page.parent().prepend(t.lastPageSnapShot)},t.prototype.savePageSnapShot=function(){t.lastPageSnapShot&&t.lastPageSnapShot.remove(),o.isMobileApp()&&this.$page&&(t.lastPageSnapShot=this.$page.clone(),this.$page.parents("app-root").prepend(t.lastPageSnapShot))},t.prototype.saveScrollPosition=function(){var e=function(t,n,i,o){void 0===i&&(i=!0),void 0===o&&(o=t),i&&t.children().each((function(t,i){return e($(i),n)}));var a=o.scrollLeft(),r=o.scrollTop();(a>0||r>0)&&t.attr(n,a+","+r)};e(this.$page,"data-scroll-position"),this.$page.attr("data-window-scroll-position",window.scrollX+","+window.scrollY)},t.prototype.restoreScrollPosition=function(){var e=function(t,n,i,o){void 0===i&&(i=!0),void 0===o&&(o=t);var a=(t.attr(n)||"").split(",");a.length>1&&(o.scrollLeft(a[0]),o.scrollTop(a[1])),t.removeAttr(n),i&&t.children().each((function(t,i){return e($(i),n)}))};e(this.$page,"data-scroll-position"),e(this.$page,"data-window-scroll-position",!1,$(window))},t.prototype.canDeactivate=function(){var e;return!1!==(e=this.onBeforePageLeave())&&(e=(this.App.onBeforePageLeave||o.noop)(this.App.activePageName,this.App.activePage)),void 0===e||e},t.prototype.ngAfterViewInit=function(){var e=this;this.route.snapshot.data._cache_page=this.canReuse(),this.layoutDirective&&(this.$page=this.layoutDirective.$element.parent(),o.isIos()&&this.$page.addClass("ios-page"),o.isAndroid()&&this.$page.addClass("android-page")),this.restoreLastPageSnapshot(),this.loadScripts().then((function(){e.runPageTransition().then((function(){e.compilePageContent=!0,setTimeout((function(){e.onPageContentReady=function(){e.fragmentsLoaded$.subscribe(o.noop,o.noop,(function(){e.invokeOnReady()})),o.unMuteWatchers(),e.viewInit$.complete(),e.onPageContentReady=o.noop}}),0)}))}))},t.prototype.ngOnDestroy=function(){this.savePageSnapShot(),this.destroy$.complete()},t.prototype.onReady=function(){},t.prototype.onBeforePageReady=function(){},t.prototype.onBeforePageLeave=function(){},t.prototype.onPageContentReady=function(){},t.prototype.canReuse=function(){return!(!this.spaPageDirective||!this.spaPageDirective.cache)},t.prototype.mute=function(){var e=function(e){e&&e.mute&&e.mute()};_.each(this.Widgets,e),_.each(this.Variables,e),_.each(this.Actions,e)},t.prototype.unmute=function(e){void 0===e&&(e=this);var t=function(e){e&&e.unmute&&e.unmute()};_.each(this.Widgets,t),_.each(this.Variables,t),_.each(this.Actions,t)},t.prototype.ngOnAttach=function(){var e=this;if(this.route.snapshot.data._cache_page=this.canReuse(),this.registerPageParams(),this.App.lastActivePageName=this.App.activePageName,this.App.activePageName=this.pageName,this.App.activePage=this,this.activePageName=this.pageName,this.restoreLastPageSnapshot(),this.unmute(),this.App.Widgets=Object.create(this.Widgets),this.spaPageDirective&&this.spaPageDirective.refreshdataonattach){var t=function(e){e&&e.startUpdate&&e.invoke&&e.invoke()};_.each(this.Variables,t),_.each(this.Actions,t)}this.runPageTransition().then((function(){setTimeout((function(){return e.restoreScrollPosition()}),100),_.each(e.Widgets,(function(e){return e&&e.ngOnAttach&&e.ngOnAttach()})),e.appManager.notify("pageAttach",{name:e.pageName,instance:e})})),this.appManager.notify("highlightActiveLink",{pageName:this.pageName})},t.prototype.ngOnDetach=function(){this.saveScrollPosition(),this.savePageSnapShot(),this.mute(),_.each(this.Widgets,(function(e){return e&&e.ngOnDetach&&e.ngOnDetach()})),this.appManager.notify("pageDetach",{name:this.pageName,instance:this})},t.prototype.ngAfterContentInit=function(){this.onBeforePageReady()},t.clear=function(){t.lastPageSnapShot&&(t.lastPageSnapShot.remove(),t.lastPageSnapShot=null)},t}(te);me.lastPageSnapShot=null,me.decorators=[{type:t.Directive}],me.propDecorators={spaPageDirective:[{type:t.ViewChild,args:[s.SpaPageDirective]}],canDeactivate:[{type:t.HostListener,args:["window:beforeunload"]}]},function(e){e.EVERYONE="Everyone",e.ANONYMOUS="Anonymous",e.AUTHENTICATED="Authenticated"}(he||(he={}));var fe=function(){function e(e,t,n,i){this.templateRef=e,this.viewContainerRef=t,this.securityService=n,this.inj=i,this.processed=!1;var o=this.securityService.get();this.securityEnabled=_.get(o,"securityEnabled"),this.isUserAuthenticated=_.get(o,"authenticated"),this.userRoles=_.get(o,"userInfo.userRoles")}return e.prototype.getWidgetRolesArrayFromStr=function(e){var t=/&#44;/g;return""===(e=e||"")?[]:_.split(e,",").map((function(e){return _.trim(e).replace(t,",")}))},e.prototype.matchRoles=function(e,t){return e.some((function(e){return _.includes(t,e)}))},e.prototype.hasAccessToWidget=function(e,t){return!!_.includes(e,he.EVERYONE)||(!(!_.includes(e,he.ANONYMOUS)||this.isUserAuthenticated)||(!(!_.includes(e,he.AUTHENTICATED)||!this.isUserAuthenticated)||this.isUserAuthenticated&&this.matchRoles(e,t)))},Object.defineProperty(e.prototype,"accessroles",{set:function(e){if(!this.processed){this.processed=!0;var t=this.getWidgetRolesArrayFromStr(e);!this.securityEnabled||this.hasAccessToWidget(t,this.userRoles)?this.viewContainerRef.createEmbeddedView(this.templateRef,this.inj.view.context):this.viewContainerRef.clear()}},enumerable:!1,configurable:!0}),e}();fe.decorators=[{type:t.Directive,args:[{selector:"[accessroles]"}]}],fe.ctorParameters=function(){return[{type:t.TemplateRef},{type:t.ViewContainerRef},{type:a.SecurityService},{type:t.Injector}]},fe.propDecorators={accessroles:[{type:t.Input}]};var ge=function(){};ge.decorators=[{type:t.Component,args:[{selector:"app-spinner",template:'\n <div class="app-spinner" [ngClass]="classname" *ngIf="show">\n <div class="spinner-message">\n <i class="spinner-image animated infinite fa fa-circle-o-notch fa-spin"></i>\n <div class="spinner-messages">\n <p *ngFor="let value of spinnermessages" [textContent]="value"></p>\n </div>\n </div>\n </div>\n '}]}],ge.ctorParameters=function(){return[]},ge.propDecorators={show:[{type:t.Input}],spinnermessages:[{type:t.Input}],classname:[{type:t.Input}],arialabel:[{type:t.Input}]};var ve=function(e){function t(t,n){var i=e.call(this,t,n)||this;return i.toastrService=t,i.toastPackage=n,i.watchers=[],i.params={},i.pagename=i.message||"",i.generateParams(),i}return K(t,e),t.prototype.generateParams=function(){var e=this;_.forEach(this.options.partialParams,(function(t){_.isString(t.value)&&0===t.value.indexOf("bind:")?e.watchers.push(o.$watch(t.value.substr(5),e.options.context,{},(function(n){e.params[t.name]=n,o.$appDigest()}))):e.params[t.name]=t.value}))},t.prototype.generateDynamicComponent=function(){return Q(this,void 0,void 0,(function(){var e;return Z(this,(function(t){return e=$(".parent-custom-toast"),this.customToastRef.clear(),e[0].appendChild(this.customToastRef.createEmbeddedView(this.customToastTmpl).rootNodes[0]),[2]}))}))},t.prototype.ngAfterViewInit=function(){this.generateDynamicComponent()},t.prototype.ngOnDestroy=function(){_.forEach(this.watchers,(function(e){return e()})),e.prototype.ngOnDestroy.call(this)},t}(h.Toast);ve.decorators=[{type:t.Component,args:[{selector:"[custom-toaster-component]",template:'\n <div class="parent-custom-toast"></div>\n <ng-container #customToast></ng-container>\n <ng-template #customToastTmpl>\n <div wmContainer partialContainer content.bind="pagename">\n <div *ngFor="let param of params | keyvalue" wmParam hidden\n [name]="param.key" [value]="param.value"></div>\n </div>\n </ng-template>',preserveWhitespaces:!1}]}],ve.ctorParameters=function(){return[{type:h.ToastrService},{type:h.ToastPackage}]},ve.propDecorators={customToastRef:[{type:t.ViewChild,args:["customToast",{static:!0,read:t.ViewContainerRef}]}],customToastTmpl:[{type:t.ViewChild,args:["customToastTmpl"]}]};var ye=function(){function e(e,t,n,i,o){this.route=e,this.securityService=t,this.router=n,this.app=i,this.appManger=o}return e.prototype.ngOnInit=function(){var e=this;this.app.isPrefabType?this.router.navigate(["prefab-preview"]):this.app.isApplicationType?this.securityService.getPageByLoggedInUser().then((function(t){e.router.navigate([t])})):(this.router.navigate([o.getWmProjectProperties().homePage]),this.appManger.postAppTypeInfo())},e}();ye.decorators=[{type:t.Component,args:[{selector:"app-empty-page",template:"<div></div>"}]}],ye.ctorParameters=function(){return[{type:n.ActivatedRoute},{type:a.SecurityService},{type:n.Router},{type:o.App},{type:j}]};var be=function(t,n,i,o,a,r,s){var l=this;this.componentInstance=t,this.vcRef=n,this.elRef=i,this.prefabMngr=o,this.resolver=a,this.injector=r,this.componentRefProvider=s;var c=this.componentInstance.prefabName;this.prefabMngr.loadDependencies(c).then((function(){return Q(l,void 0,void 0,(function(){var t,n;return Z(this,(function(i){switch(i.label){case 0:return[4,this.componentRefProvider.getComponentFactoryRef(c,e.ComponentType.PREFAB)];case 1:return(t=i.sent())&&(n=this.vcRef.createComponent(t,0,r),this.elRef.nativeElement.appendChild(n.location.nativeElement)),[2]}}))}))}))};be.decorators=[{type:t.Directive,args:[{selector:"[wmPrefab][prefabname]"}]}],be.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Self},{type:t.Inject,args:[c.WidgetRef]}]},{type:t.ViewContainerRef},{type:t.ElementRef},{type:H},{type:t.ComponentFactoryResolver},{type:t.Injector},{type:N}]};var we=function(){function e(e,n,a,r){var s,l=this;this.compiler=e,this.injector=n,this.domSanitizer=a,this.i18service=r,this._locale=o.getSessionStorageItem("selectedLocale")||"en",this.formatsByLocale=null===(s=this.i18service)||void 0===s?void 0:s.getwidgetLocale(),this.preparePipeMeta=function(e,t,n,i){return void 0===i&&(i=[]),{type:{reference:e,diDeps:i},name:t,pure:n}},this._pipeData=[this.preparePipeMeta(i.AsyncPipe,"async",!1,[t.ChangeDetectorRef]),this.preparePipeMeta(i.SlicePipe,"slice",!1),this.preparePipeMeta(i.PercentPipe,"percent",!0,[this._locale]),this.preparePipeMeta(i.I18nPluralPipe,"i18nPlural",!0,[i.NgLocalization]),this.preparePipeMeta(i.I18nSelectPipe,"i18nSelect",!0),this.preparePipeMeta(i.KeyValuePipe,"keyvalue",!1,[t.KeyValueDiffers]),this.preparePipeMeta(c.FileIconClassPipe,"fileIconClass",!0),this.preparePipeMeta(c.FileExtensionFromMimePipe,"fileExtensionFromMime",!0),this.preparePipeMeta(c.StateClassPipe,"stateClass",!0),this.preparePipeMeta(c.FileSizePipe,"filesize",!0),this.preparePipeMeta(c.FilterPipe,"filter",!0),this.preparePipeMeta(i.UpperCasePipe,"uppercase",!0),this.preparePipeMeta(i.LowerCasePipe,"lowercase",!0),this.preparePipeMeta(i.JsonPipe,"json",!1),this.preparePipeMeta(i.DecimalPipe,"number",!0,[this._locale]),this.preparePipeMeta(i.TitleCasePipe,"titlecase",!0),this.preparePipeMeta(i.CurrencyPipe,"currency",!0,[this._locale]),this.preparePipeMeta(i.DatePipe,"date",!0,[this._locale]),this.preparePipeMeta(c.ToDatePipe,"toDate",!0,[new i.DatePipe(this._locale)]),this.preparePipeMeta(c.ToNumberPipe,"toNumber",!0,[new i.DecimalPipe(this._locale),this.i18service]),this.preparePipeMeta(c.ToCurrencyPipe,"toCurrency",!0,[new i.DecimalPipe(this._locale),this.i18service]),this.preparePipeMeta(c.PrefixPipe,"prefix",!0),this.preparePipeMeta(c.SuffixPipe,"suffix",!0),this.preparePipeMeta(c.TimeFromNowPipe,"timeFromNow",!0),this.preparePipeMeta(c.NumberToStringPipe,"numberToString",!0,[new i.DecimalPipe(this._locale)]),this.preparePipeMeta(c.StringToNumberPipe,"stringToNumber",!0),this.preparePipeMeta(c.CustomPipe,"custom",!0,[this.injector.get(o.CustomPipeManager)]),this.preparePipeMeta(c.TrustAsPipe,"trustAs",!0,[this.domSanitizer]),this.preparePipeMeta(c.SanitizePipe,"sanitize",!0,[this.domSanitizer])],this._pipeMeta=new Map,this._pipeData.forEach((function(e){l._pipeMeta.set(e.name,e)}))}return e.prototype.unknownPipe=function(e){throw Error("The pipe '"+e+"' could not be found")},e.prototype.meta=function(e){var t=this._pipeMeta.get(e);return t||this.unknownPipe(e),t},e.prototype.getPipeNameVsIsPureMap=function(){var e=new Map;return this._pipeMeta.forEach((function(t,n){e.set(n,t.pure)})),e},e.prototype.resolveDep=function(e){return this.injector.get(e.token.identifier.reference)},e.prototype.getInstance=function(e){var t,n,i=this.meta(e).type,o=i.reference,a=i.diDeps;if(o||this.unknownPipe(e),a.length){var r=[];try{for(var s=J(a),l=s.next();!l.done;l=s.next()){var c=l.value;r.push(c)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return new(o.bind.apply(o,ee([void 0],X(r))))}return new o},e}();we.\u0275prov=C.\u0275\u0275defineInjectable({factory:function(){return new we(C.\u0275\u0275inject(C.Compiler),C.\u0275\u0275inject(C.INJECTOR),C.\u0275\u0275inject(D.DomSanitizer),C.\u0275\u0275inject(I.AbstractI18nService))},token:we,providedIn:"root"}),we.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],we.ctorParameters=function(){return[{type:t.Compiler},{type:t.Injector},{type:u.DomSanitizer},{type:o.AbstractI18nService}]};var Pe=function(){function e(e,t){this.pipeProvider=e,this.$app=t,this.supportedPipes=["toDate","toCurrency","prefix","suffix","numberToString","stringToNumber","timeFromNow","trustAs","sanitize"],this.$app.isApplicationType&&this.supportedPipes.push("custom")}return e.prototype.getPipe=function(e){if(this.supportedPipes.includes(e))return this.pipeProvider.getInstance(e);throw Error("The pipe '"+e+"' could not be found")},e}();Pe.\u0275prov=C.\u0275\u0275defineInjectable({factory:function(){return new Pe(C.\u0275\u0275inject(we),C.\u0275\u0275inject(I.App))},token:Pe,providedIn:"root"}),Pe.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],Pe.ctorParameters=function(){return[{type:we},{type:o.App}]};var _e={DialogService:o.AbstractDialogService,i18nService:o.AbstractI18nService,PipeService:Pe,statePersistence:o.StatePersistence,SpinnerService:o.AbstractSpinnerService,StatePersistenceService:o.StatePersistence,Viewport:o.Viewport,ToasterService:o.AbstractToasterService,Utils:o.UtilsService,CONSTANTS:o.ConstantService,FIELD_TYPE:o.FieldTypeService,FIELD_WIDGET:o.FieldWidgetService,DynamicComponentService:o.DynamicComponentRefProvider},Oe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},Ee=function(){var e=this.httpService,t=function(t,n){var i=Array.from(arguments).slice(1);return Promise.resolve(e[t].apply(e,i))},n=function(){return t.apply(void 0,ee(["send"],X(Array.from(arguments))))};return["get","post","head","put","delete","jsonp","patch"].forEach((function(e){return n[e]=t.bind(void 0,e)})),n},Re=function(){function e(e,t,n,i,a,r){this.inj=e,this.i18nService=t,this.statePersistence=n,this.httpService=i,this.securityService=a,this.routeReuseStrategy=r,this.Variables={},this.Actions={},this.onAppVariablesReady=Oe,this.onBeforeAppReady=Oe,this.onSessionTimeout=Oe,this.onPageReady=Oe,this.onBeforePageLeave=Oe,this.onBeforeServiceCall=Oe,this.onServiceSuccess=Oe,this.onServiceError=Oe,this.dynamicComponentContainerRef={},this.changeLocale=this.i18nService.setSelectedLocale.bind(this.i18nService),this.getSelectedLocale=this.i18nService.getSelectedLocale.bind(this.i18nService),this.setTimezone=this.i18nService.setTimezone.bind(this.i18nService),this.setwidgetLocale=this.i18nService.setwidgetLocale.bind(this.i18nService),this._eventNotifier=new o.EventNotifier,this.landingPageName=o.getWmProjectProperties().homePage;var s=o.getWmProjectProperties();this.projectName=s.name,this.isPrefabType="PREFAB"===s.type,this.isApplicationType="APPLICATION"===s.type,this.isTemplateBundleType="TEMPLATEBUNDLE"===s.type,this.targetPlatform=s.platformType,this.httpService.registerOnSessionTimeout(this.on401.bind(this)),this.appLocale=this.i18nService.getAppLocale(),this.httpService.setLocale(this.appLocale)}return e.prototype.reload=function(){window.location.reload()},e.prototype.clearPageCache=function(e){this.routeReuseStrategy instanceof se&&this.routeReuseStrategy.reset(e)},e.prototype.notify=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this._eventNotifier.notify.apply(this._eventNotifier,arguments)},e.prototype.getDependency=function(e){if(o.isString(e)){if("HttpService"===e)return Ee.call(this);var t=_e[e]&&this.inj.get(_e[e]);return!t&&this.inj._providers&&_.forEach(this.inj._providers,(function(n){if(_.isObject(n)&&n.__proto__.constructor.SERVICE_NAME===e)return t=n,!1})),t}return this.inj.get(e)},e.prototype.on401=function(){var e=_.get(this.securityService.get(),"userInfo");_.isEmpty(e)||this.onSessionTimeout()},e.prototype.subscribe=function(e,t){return this._eventNotifier.subscribe(e,t)},e.prototype.notifyApp=function(e,t,n){var i=_.get(this,"Actions.appNotification"),a=-1!==["PROCESS_REJECTED_IN_QUEUE"].indexOf(e);if(i){if(a)return void console.warn("App Error",e);t=t||"success",e=i.getMessage()||e,i.invoke({message:e,title:o.isDefined(n)?n:t.toUpperCase(),class:t,duration:"ERROR"===t.toUpperCase()?0:void 0})}else console.warn('The default Action "appNotification" doesn\'t exist in the app. App notified following error:\n',e)},e.prototype.registerExpressions=function(e){_.each(e,(function(e,t){o.registerFnByExpr(t,e[0],e[1])}))},e}();Re.decorators=[{type:t.Injectable}],Re.ctorParameters=function(){return[{type:t.Injector},{type:o.AbstractI18nService},{type:o.StatePersistence},{type:o.AbstractHttpService},{type:a.SecurityService},{type:n.RouteReuseStrategy}]};var Ae=function(e){function t(t){var n=e.call(this)||this;return n.toaster=t,n}return K(t,e),t.prototype._showToaster=function(e,t,n,i){if(_.isNumber(i)&&(i={timeOut:i}),(i=i||{}).timeOut=o.isDefined(i.timeOut)?i.timeOut:0,i.enableHtml=o.isDefined(i.enableHtml),i.positionClass=i.positionClass||"toast-bottom-right",i.toastClass="toast",t||n){!i.bodyOutputType&&_.isObject(n)&&(n=JSON.stringify(n));var a=this.toaster[e];if(a)return a.call(this.toaster,n,t,i)}},t.prototype.success=function(e,t){return this._showToaster("success",e,t,{timeOut:5e3})},t.prototype.error=function(e,t){return this._showToaster("error",e,t,{timeOut:0})},t.prototype.info=function(e,t){return this._showToaster("info",e,t,{timeOut:0})},t.prototype.warn=function(e,t){return this._showToaster("warning",e,t,{timeOut:0})},t.prototype.show=function(e,t,n,i){return this._showToaster(e,t,n,i)},t.prototype.hide=function(e){e?this.toaster.clear(e.toastId):this.toaster.clear()},t.prototype.showCustom=function(e,t){if(e)return(t=t||{}).toastComponent=ve,t.toastClass="custom-toaster",t.timeOut=o.isDefined(t.timeOut)?t.timeOut:0,t.enableHtml=o.isDefined(t.enableHtml),t.positionClass=t.positionClass||"toast-bottom-right",t.toastClass="toast",this.toaster.show(e,"",t)},t.prototype.setToasterConfig=function(e){_.isObject(e)?_.merge(this.toaster.toastrConfig,e):console.warn("Please pass a valid options object, For Example : {maxOpened: 1, autoDismiss: true}")},t}(o.AbstractToasterService);Ae.decorators=[{type:t.Injectable}],Ae.ctorParameters=function(){return[{type:h.ToastrService}]};var Te=["ar","ar-001","ar-ae","ar-bh","ar-dz","ar-eg","ar-iq","ar-jo","ar-kw","ar-lb","ar-ly","ar-ma","ar-om","ar-qa","ar-sa","ar-sd","ar-sy","ar-tn","ar-ye","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","pnb","ps","sd","ug","ur","yi"],Se=function(e){function t(t,n,i,o){var a=e.call(this)||this;return a.$http=t,a.bsLocaleService=n,a.appDefaults=i,a.inj=o,a.defaultSupportedLocale="en",a._isAngularLocaleLoaded=!1,a.formatsByLocale={timezone:"",number:""},a.appLocale={},a.prefabLocale=new Map,a}return K(t,e),Object.defineProperty(t.prototype,"app",{get:function(){return this.inj.get(o.App)},enumerable:!1,configurable:!0}),t.prototype.updateLocaleDirection=function(){var e="ltr";Te.includes(this.selectedLocale)&&(e="rtl"),o.setCSS(document.body,"direction",e)},t.prototype.init=function(){this.messages={},Object.setPrototypeOf(this.appLocale,this.messages)},t.prototype.getSelectedLocale=function(){return this.selectedLocale},t.prototype.getDefaultSupportedLocale=function(){return this.defaultSupportedLocale},t.prototype.getAppLocale=function(){return this.appLocale},t.prototype.getPrefabLocaleBundle=function(e){return this.prefabLocale.has(e)||this.prefabLocale.set(e,Object.create(this.appLocale)),this.prefabLocale.get(e)},t.prototype.extendPrefabMessages=function(e){var t=this;e.prefabMessages&&Object.keys(e.prefabMessages).forEach((function(n){var i=t.prefabLocale.get(n);i||(i=Object.create(t.appLocale),t.prefabLocale.set(n,i)),Object.assign(i,e.prefabMessages[n])}))},t.prototype.extendMessages=function(e){Object.assign(this.messages,e)},t.prototype.loadResource=function(e){return this.$http.get(e).toPromise().catch((function(){console.warn("error loading locale resource from "+e),Promise.resolve({})}))},t.prototype.loadAppLocaleBundle=function(){var e=this;this.loadResource("resources/i18n/"+this.selectedLocale+".json").then((function(t){e.extendMessages(t.messages),e.extendPrefabMessages(t),e.appDefaults.setFormats(t.formats)}))},t.prototype.loadMomentLocaleBundle=function(e){var t=this,n=o._WM_APP_PROJECT.cdnUrl||o._WM_APP_PROJECT.ngDest;if(this.selectedLocale!==this.defaultSupportedLocale){var i=n+"locales/moment/"+e+".js";o.loadScripts([i],!0).then((function(){moment.locale(t.selectedLocale);var n=moment.localeData(e);n=n&&n._config,w.defineLocale(t.selectedLocale,n),t.bsLocaleService.use(t.getSelectedLocale()||t.defaultSupportedLocale)}))}else moment.locale(this.defaultSupportedLocale)},t.prototype.loadAngularLocaleBundle=function(e){var t=this;return new Promise((function(n){var i=o._WM_APP_PROJECT.cdnUrl||o._WM_APP_PROJECT.ngDest;if(t.selectedLocale!==t.defaultSupportedLocale){var a=i+"locales/angular/global/"+e+".js";o.loadScripts([a],!0).then((function(){t._isAngularLocaleLoaded=!0,n()}),n)}else n()}))},t.prototype.loadCalendarLocaleBundle=function(e,t){void 0===t&&(t=!1);var n,i=o._WM_APP_PROJECT.cdnUrl||o._WM_APP_PROJECT.ngDest;return e?(n=i+"locales/fullcalendar/"+e+".js",t||!o.isMobile()&&!o.isMobileApp()&&this.selectedLocale!==this.defaultSupportedLocale?o.loadScripts([n],!0):void 0):Promise.resolve()},t.prototype.loadMomentTimeZoneBundle=function(e,t){var n=this;return new Promise((function(i){var a=(o._WM_APP_PROJECT.cdnUrl||o._WM_APP_PROJECT.ngDest)+"locales/moment-timezone/moment-timezone-with-data.js";o.loadScripts([a],!0).then((function(){var o=e,a=(e=o.timezone).indexOf("+");a>-1&&(a>0&&(e=e.substr(a)),o.timezone=_.find(moment.tz.names(),(function(t){return e===moment.tz(t).format("Z")})));var r=t&&t.formatsByLocale?t.formatsByLocale:n.formatsByLocale;Object.assign(r,o),i()}),i)}))},t.prototype.loadLocaleBundles=function(e){return e.moment&&this.loadMomentLocaleBundle(e.moment),e.fullCalendar&&window.FullCalendar&&this.loadCalendarLocaleBundle(e.fullCalendar),e.angular&&this.loadAppLocaleBundle(),this.loadAngularLocaleBundle(e.angular)},t.prototype.setTimezone=function(e,t){this.loadMomentTimeZoneBundle(e,t)},t.prototype.getTimezone=function(e){var t=_.get(this.app,"activePage.formatsByLocale.timezone"),n=_.get(e,"formatsByLocale.timezone");return n||(t||this.formatsByLocale.timezone)},t.prototype.getFormatsByLocale=function(){return this.formatsByLocale},t.prototype.setSelectedLocale=function(e){var t=this;_.isObject(e)&&(e=e.datavalue);var n=o.getWmProjectProperties().supportedLanguages[e],i=Object.keys(o.getWmProjectProperties().supportedLanguages);return _.includes(i,e)&&e&&e!==this.selectedLocale?(o.setSessionStorageItem("selectedLocale",e),this.selectedLocale=e,this.init(),this.loadLocaleBundles(n).then((function(){return t.updateLocaleDirection()}))):Promise.resolve()},t.prototype.deduceAppLocale=function(){var e=this.getAcceptedLanguages(),t=o.getWmProjectProperties().defaultLanguage;e.push(t);var n=o.getWmProjectProperties().preferBrowserLang;n=!n||("true"===n||!0===n);var i,a=Object.keys(o.getWmProjectProperties().supportedLanguages)||[this.defaultSupportedLocale],s=n?void 0:t;if(r.CONSTANTS.hasCordova){var l=[];_.forEach(e,(function(e){var t=_.find(a,(function(t){return e===t}))||_.find(a,(function(t){return e.startsWith(t)}));t&&l.push(t)})),i=l[0]}var c=o.getSessionStorageItem("selectedLocale")||s||i||_.intersection(e,a)[0]||this.defaultSupportedLocale;return a=a||[c],c||a[0]},t.prototype.loadDefaultLocale=function(){var e=this.deduceAppLocale();return this.setSelectedLocale(e)},t.prototype.getLocalizedMessage=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return o.replace(this.appLocale[e],t)},t.prototype.getAcceptedLanguages=function(){var e;return e=r.CONSTANTS.hasCordova?navigator.languages||[navigator.language]:(e=decodeURIComponent(o.getWmProjectProperties().preferredLanguage||"")).split(",").map((function(e){return e.split(";")[0]})),_.map(e,_.toLower)},t.prototype.initCalendarLocale=function(){return"en"!==this.selectedLocale?this.loadCalendarLocaleBundle(this.selectedLocale,!0):Promise.resolve()},t.prototype.isAngularLocaleLoaded=function(){return this._isAngularLocaleLoaded},t.prototype.setwidgetLocale=function(e){this.formatsByLocale.number=e.number},t.prototype.getwidgetLocale=function(){return this.formatsByLocale},t}(o.AbstractI18nService);Se.decorators=[{type:t.Injectable}],Se.ctorParameters=function(){return[{type:d.HttpClient},{type:P.BsLocaleService},{type:o.AppDefaults},{type:t.Injector}]};var Ce=function(e){function t(){var t=e.call(this)||this;return t.spinnerId=0,t.messageSource=new l.Subject,t.messagesByContext={},t}return K(t,e),t.prototype.getMessageSource=function(){return this.messageSource},t.prototype.showContextSpinner=function(e,t,n){var i=$('[name="'+e+'"]');if(this.messagesByContext[e]=this.messagesByContext[e]||{},0!==Object.keys(this.messagesByContext[e]).length)this.messagesByContext[e][n]=t,this.messagesByContext[e].finalMessage=this.messagesByContext[e].finalMessage+" "+this.messagesByContext[e][n],i.find(".spinner-messages-container").html(this.messagesByContext[e].finalMessage);else{var o=$('<div class="app-spinner">\n <div class="spinner-message" aria-label="loading gif">\n <i class="spinner-image animated infinite fa fa-circle-o-notch fa-spin"></i>\n <div class="spinner-messages">\n <p class="spinner-messages-container"></p>\n </div>\n </div>\n </div>');this.messagesByContext[e][n]=t,this.messagesByContext[e].finalMessage=this.messagesByContext[e][n],o.find(".spinner-messages-container").html(this.messagesByContext[e].finalMessage),i.prepend(o)}return n},t.prototype.showAppSpinner=function(e,t){this.messagesByContext.page=this.messagesByContext.page||{},this.messagesByContext.page[t]=e,this.messageSource.next({show:!0,message:e,messages:_.values(this.messagesByContext.page)})},t.prototype.hideContextSpinner=function(e,t){delete this.messagesByContext[e][t],1===Object.keys(this.messagesByContext[e]).length&&(this.messagesByContext[e]={}),$('[name="'+e+'"]').find(".app-spinner").remove()},t.prototype.show=function(e,t,n,i,o){return t=t||++this.spinnerId,i&&"page"!==i?this.showContextSpinner(i,e,t):(this.showAppSpinner(e,t),t)},t.prototype.hide=function(e){var t=_.findKey(this.messagesByContext,(function(t){return _.includes(_.keys(t),e)}))||"page";if("page"===t)if(e){delete this.messagesByContext[t][e];var n=_.values(this.messagesByContext[t]);this.messageSource.next({show:!!n.length,messages:_.values(this.messagesByContext[t])})}else this.messagesByContext[t]={};else this.hideContextSpinner(t,e)},t}(o.AbstractSpinnerService);Ce.decorators=[{type:t.Injectable}],Ce.ctorParameters=function(){return[]};var Ie="body >app-root",De=function(){function e(e,t,i){var o=this;this.app=e,this.router=t,this.zone=i,this.history=new Ne,this.isPageAddedToHistory=!1,this.router.events.subscribe((function(e){if(e instanceof n.NavigationStart){var t=e.url,i={},a=void 0;o.isPageAddedToHistory||(o.isPageAddedToHistory=!1,t.indexOf("?")>0?(t.substr(t.indexOf("?")+1).split("&").forEach((function(e){var t=e.split("=");i[t[0]]=t[1]})),a=t.substr(0,t.indexOf("?"))):a=t,"/"===a[0]&&(a=a.substr(1)),a&&(delete i.name,o.history.push(new xe(a,i,o.transition))))}}))}return e.prototype.getPageTransition=function(){return _.isEmpty(this.transition)||_.isEqual("none",this.transition)?null:this.transition},e.prototype.goToPage=function(e,t){var n=this;this.transition=t.transition||"",this.history.getCurrentPage()&&(this.isPageAddedToHistory=!0),this.history.push(new xe(e,t.urlParams,this.transition)),this.zone.run((function(){return n.router.navigate(["/"+e],{queryParams:t.urlParams})}))},e.prototype.goToPrevious=function(){this.history.getPagesCount()&&(this.transition=this.history.getCurrentPage().transition,_.isEmpty(this.transition)||(this.transition+="-exit"),this.history.pop(),this.isPageAddedToHistory=!0,window.history.back())},e.prototype.goToView=function(e,t,n){var i=this,o=(t=t||{}).pageName,a=t.transition||"",s=t.$event,l=this.app.activePage,c=n&&n._context&&n._context.prefabName;if(this.app.isPrefabType)this.goToElementView($(Ie).find('[name="'+e+'"]'),e,o,n);else if(o===l.activePageName||c)c&&this.isPrefabWithNameExists(c)?this.goToElementView($('[prefabName="'+c+'"]').find('[name="'+e+'"]'),e,o,n):o&&o!==l.activePageName?this.app.notifyApp(r.CONSTANTS.WIDGET_DOESNT_EXIST,"error"):this.goToElementView($(Ie).find('[name="'+e+'"]'),e,o,n);else if(this.isPartialWithNameExists(o))this.goToElementView($('[partialcontainer][content="'+o+'"]').find('[name="'+e+'"]'),e,o,n);else{this.goToPage(o,{viewName:e,$event:s,transition:a,urlParams:t.urlParams});var p=this.app.subscribe("pageReady",(function(t){i.goToElementView($(Ie).find('[name="'+e+'"]'),e,o,n),p()}))}},e.prototype.goToElementView=function(e,t,n,i){var o,a,r=this,s=this.app.activePage;if(e.length)switch(this.app.isPrefabType||n!==s.activePageName||(e=this.getViewElementInActivePage(e)),(o=e[0].widget).widgetType){case"wm-accordionpane":this.showAncestors(e,i),o.expand();break;case"wm-tabpane":this.showAncestors(e,i),o.select();break;case"wm-segment-content":this.showAncestors(e,i),o.navigate();break;case"wm-panel":o.expanded=!0}else a=this.showAncestorDialog(t),setTimeout((function(){a&&r.goToElementView($('[name="'+t+'"]'),t,n,i)}))},e.prototype.getViewElementInActivePage=function(e){var t;return e.length>1&&(t=_.filter(e,(function(e){if(_.isEmpty($(e).closest('[data-role = "partial"]'))&&_.isEmpty($(e).closest("[wmprefabcontainer]")))return e})))&&(e=$(t)),e},e.prototype.isPartialWithNameExists=function(e){return $('[partialcontainer][content="'+e+'"]').length},e.prototype.isPrefabWithNameExists=function(e){return $('[prefabName="'+e+'"]').length},e.prototype.showAncestors=function(e,t){e.parents('[wm-navigable-element="true"]').toArray().reverse().forEach((function(e){var t=e.widget;switch(t.widgetType){case"wm-accordionpane":t.expand();break;case"wm-tabpane":t.select();break;case"wm-segment-content":t.navigate();break;case"wm-panel":t.expanded=!0}}))},e.prototype.showAncestorDialog=function(e){var t;return $("app-root [dialogtype]").each((function(){var n=$(this);if($(n.html()).find('[name="'+e+'"]').length)return t=n.attr("name"),!1})),t},e}();De.decorators=[{type:t.Injectable}],De.ctorParameters=function(){return[{type:o.App},{type:n.Router},{type:t.NgZone}]};var xe=function(){function e(e,t,n){this.name=e,this.urlParams=t,this.transition=n,this.transition=_.isEmpty(this.transition)?null:this.transition}return e.prototype.isEqual=function(e){return e&&e.name===this.name&&_.isEqual(e.urlParams,this.urlParams)},e}(),Ne=function(){function e(){this.stack=[]}return e.prototype.getCurrentPage=function(){return this.currentPage},e.prototype.getPagesCount=function(){return this.stack.length},e.prototype.isLastVisitedPage=function(e){return this.getLastPage().isEqual(e)},e.prototype.push=function(e){this.currentPage&&this.stack.push(this.currentPage),this.currentPage=e},e.prototype.pop=function(){return this.currentPage=this.stack.pop(),this.currentPage},e.prototype.getLastPage=function(){return this.stack.length>0?this.stack[this.stack.length-1]:void 0},e}(),Me=function(){function e(){}return e.prototype.setFormats=function(e){var t=e.date,n=e.time,i=t&&n?t+" "+n:void 0,o=e.currency;this.dateFormat=t,this.timeFormat=n,this.dateTimeFormat=i,this.currencyCode=o},e}();Me.decorators=[{type:t.Injectable}],Me.ctorParameters=function(){return[]};var ke=!1,Le=function(){function e(e,t){this.securityService=e,this.appManager=t}return e.prototype.loadSecurityConfig=function(){return ke?Promise.resolve(!0):this.appManager.loadSecurityConfig().then((function(){return ke=!0}))},e.prototype.isAuthenticated=function(){var e=this;return this.loadSecurityConfig().then((function(){return new Promise((function(t,n){e.securityService.isAuthenticated(t,n)}))}))},e.prototype.canActivate=function(e){var t=this;return this.isAuthenticated().then((function(n){return n?Promise.resolve(!0):(t.appManager.handle401(e.routeConfig.path,{queryParams:e.queryParams}),Promise.resolve(!1))}))},e}();Le.decorators=[{type:t.Injectable}],Le.ctorParameters=function(){return[{type:a.SecurityService},{type:j}]};var Fe=function(){function e(e,t,n,i,o){this.securityService=e,this.authGuard=t,this.toasterService=n,this.app=i,this.appManager=o}return e.prototype.canActivate=function(e){var t=this,n=e.data.allowedRoles;return this.authGuard.isAuthenticated().then((function(i){if(i){var o=t.securityService.get().userInfo.userRoles;return _.intersection(n,o).length>0?Promise.resolve(!0):(t.appManager.notifyApp(t.app.appLocale.LABEL_ACCESS_DENIED||"Access Denied","error"),Promise.resolve(!1))}return t.appManager.handle401(e.routeConfig.path,{queryParams:e.queryParams}),Promise.resolve(!1)}))},e}();Fe.decorators=[{type:t.Injectable}],Fe.ctorParameters=function(){return[{type:a.SecurityService},{type:Le},{type:o.AbstractToasterService},{type:o.App},{type:j}]};var je=function(){function e(e,t){this.app=e,this.appManager=t}return e.prototype.canActivate=function(e){return this.appManager.notifyApp(this.app.appLocale.MESSAGE_PAGE_NOT_FOUND||"The page you are trying to reach is not available","error"),Promise.resolve(!1)},e}();je.decorators=[{type:t.Injectable}],je.ctorParameters=function(){return[{type:o.App},{type:j}]};var Be=!1,Ge=function(){function e(e,t,n,i){this.inj=e,this.app=t,this.utilService=n,this.appJsProvider=i,this.appManager=this.inj.get(j)}return e.prototype.resolve=function(){return Q(this,void 0,void 0,(function(){var e;return Z(this,(function(t){switch(t.label){case 0:if(Be)return[2,!0];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.appJsProvider.getAppScriptFn()];case 2:return t.sent()(this.app,this.utilService,this.inj),[3,4];case 3:return e=t.sent(),console.warn("Error in executing app.js",e),[3,4];case 4:return Be=!0,[2,!0]}}))}))},e}();Ge.decorators=[{type:t.Injectable}],Ge.ctorParameters=function(){return[{type:t.Injector},{type:o.App},{type:o.UtilsService},{type:k}]};var $e=!1,Ve=function(){function e(e,t,n){this.appManager=e,this.appJsProvider=t,this.customPipeManager=n}return e.prototype.resolve=function(){return!(!this.appManager.isPrefabType()&&!this.appManager.isTemplateBundleType())||($e||(this.appJsProvider.loadFormatterConfigScript(this.loadedFormatterScript.bind(this)),$e=!0),$e)},e.prototype.loadedFormatterScript=function(e){try{var t=e;for(var n in t||console.warn("Please return valid formatter object"),t)this.customPipeManager.setCustomPipe(n,t[n])}catch(e){console.warn("Error in reading formatters.js",e)}},e}();Ve.decorators=[{type:t.Injectable}],Ve.ctorParameters=function(){return[{type:j},{type:F},{type:o.CustomPipeManager}]};var We=function(){function e(e){this.i18nService=e}return e.prototype.resolve=function(){return this.i18nService.loadDefaultLocale()},e}();We.decorators=[{type:t.Injectable}],We.ctorParameters=function(){return[{type:o.AbstractI18nService}]};var Ue=function(){function e(e,t,i,a,r,s,l,c,p,d){var u,h=this;this.elRef=i,this.oAuthService=a,this.dialogService=r,this.spinnerService=s,this.router=c,this.app=p,this.appManager=d,this.startApp=!1,this.isApplicationType=!1,this.spinner={show:!1,messages:[],arialabel:""},this.isOAuthDialogOpen=!1,o.setPipeProvider(e),o.setNgZone(l),o.setAppRef(t),this.isApplicationType="APPLICATION"===o.getWmProjectProperties().type,this.appManager.beforeAppReady(),a.getOAuthProvidersAsObservable().subscribe((function(e){h.providersConfig=e,e.length?h.showOAuthDialog():h.closeOAuthDialog()})),this.spinnerService.getMessageSource().asObservable().subscribe((function(e){setTimeout((function(){h.spinner.show=e.show,h.spinner.messages=e.messages,h.spinner.arialabel=e.messages.toString()}))})),O.setTheme("bs3");var m=o.noop;this.router.events.subscribe((function(e){if(e instanceof n.NavigationStart){var t=e.url.split("?")[0];(t=t.substring(1))||(h.app.activeLayoutName="",h.app.layoutPages=[]),u=h.app.activeLayoutName&&h.app.layoutPages&&h.app.layoutPages.length&&h.app.layoutPages.includes(t)?h.spinnerService.show("","wmRouterOutlet","","wmRouterOutlet"):h.spinnerService.show("","globalSpinner");var i=document.querySelector("app-page-outlet");i&&o.addClass(i,"page-load-in-progress");var a=Date.now();m=function(){h.spinnerService.hide(u);var e=document.querySelector("app-page-outlet");e&&o.removeClass(e,"page-load-in-progress"),m=o.noop,h.app.activePageLoadTime=Date.now()-a}}else(e instanceof n.NavigationEnd||e instanceof n.NavigationCancel||e instanceof n.NavigationError)&&setTimeout((function(){m()}),1e3)})),this.appManager.subscribe("pageReady",(function(){m()})),this.appManager.subscribe("pageAttach",(function(){m()}))}return e.prototype.showOAuthDialog=function(){this.isOAuthDialogOpen||(this.isOAuthDialogOpen=!0,this.dialogService.open("oAuthLoginDialog",this))},e.prototype.closeOAuthDialog=function(){this.isOAuthDialogOpen&&(this.isOAuthDialogOpen=!1,this.dialogService.close("oAuthLoginDialog",this))},e.prototype.start=function(){var e=this;setTimeout((function(){e.startApp=!0})),setTimeout((function(){e.app.dynamicComponentContainerRef=e.dynamicComponentContainerRef,e.overrideRouterOutlet()}),10)},e.prototype.overrideRouterOutlet=function(){var e=this,t=this.routerOutlet.attach,n=this.routerOutlet.detach;this.routerOutlet.attach=function(n){t.call(e.routerOutlet,n),n.instance.ngOnAttach()},this.routerOutlet.detach=function(){return e.app.activePage.ngOnDetach(),n.call(e.routerOutlet)}},e.prototype.ngAfterViewInit=function(){var e=this;o.hasCordova()&&!window.wmDeviceReady?document.addEventListener("wmDeviceReady",(function(){return e.start()})):this.start()},e.prototype.ngDoCheck=function(){o.$invokeWatchers()},e}();Ue.decorators=[{type:t.Component,args:[{selector:"app-root",template:'<ng-container *ngIf="startApp">\n <router-outlet></router-outlet>\n <div wmContainer partialContainer content="Common" hidden class="ng-hide" *ngIf="isApplicationType"></div>\n <app-spinner name="globalspinner" classname="global-spinner" role="alert" aria-live="assertive" [attr.aria-label]="spinner.arialabel || \'Loading\'" [show]="spinner.show" [spinnermessages]="spinner.messages"></app-spinner>\n <div wmDialog name="oAuthLoginDialog" title="Application is requesting you to sign in with"\n close.event="closeOAuthDialog()">\n <ng-template #dialogBody>\n <ul class="list-items">\n <li class="list-item" *ngFor="let provider of providersConfig">\n <button class="btn" (click)="provider.invoke()">{{provider.name}}</button>\n </li>\n </ul>\n </ng-template>\n </div>\n <div wmConfirmDialog name="_app-confirm-dialog" title.bind="title" message.bind="message" oktext.bind="oktext"\n canceltext.bind="canceltext" closable="false" iconclass.bind="iconclass"\n escape.event="onEscape()" ok.event="onOk()" cancel.event="onCancel()" close.event="onClose()" opened.event="onOpen()"></div>\n <div wmAppExt></div>\n <i id="wm-mobile-display"></i>\n</ng-container>\n\x3c!--Dummy container to create the component dynamically--\x3e\n<ng-container #dynamicComponent></ng-container>\n',encapsulation:t.ViewEncapsulation.None}]}],Ue.ctorParameters=function(){return[{type:we},{type:t.ApplicationRef},{type:t.ElementRef},{type:b.OAuthService},{type:o.AbstractDialogService},{type:o.AbstractSpinnerService},{type:t.NgZone},{type:n.Router},{type:o.App},{type:j}]},Ue.propDecorators={routerOutlet:[{type:t.ViewChild,args:[n.RouterOutlet]}],dynamicComponentContainerRef:[{type:t.ViewChild,args:["dynamicComponent",{read:t.ViewContainerRef}]}]};var qe=function(){function e(){this.wmHttpRequest=new y.WmHttpRequest,this.wmHttpResponse=new y.WmHttpResponse}return e.prototype.createSubject=function(){return new l.Subject},e.prototype.intercept=function(e,t){var n,i,o=this;if(r.appManager&&r.appManager.appOnBeforeServiceCall){var a=this.wmHttpRequest.angularToWmRequest(e);(n=r.appManager.appOnBeforeServiceCall(a))&&(n=this.wmHttpRequest.wmToAngularRequest(n),e=n)}return t.handle(e).pipe(E.tap((function(e){if(e&&4===e.type&&r.appManager&&r.appManager.appOnServiceSuccess){var t=o.wmHttpResponse.angularToWmResponse(e);(i=r.appManager.appOnServiceSuccess(t.body,t))&&(i=o.wmHttpResponse.wmToAngularResponse(i),_.extend(e,i))}}),(function(t){if(t._401Subscriber=o.createSubject(),r.httpService.isPlatformSessionTimeout(t)&&r.httpService.handleSessionTimeout(e,t._401Subscriber),r.appManager&&r.appManager.appOnServiceError){var n=o.wmHttpResponse.angularToWmResponse(t);(i=r.appManager.appOnServiceError(n.message,n))&&(i=o.wmHttpResponse.wmToAngularResponse(i),_.extend(t,i))}})))},e}();qe.decorators=[{type:t.Injectable}],qe.ctorParameters=function(){return[]};var ze="PREFAB",He=function(){function e(e){var t=this;this.prefabManager=e,window.addEventListener("message",(function(e){if((e.data&&e.data.context)===ze){var n=e.data.action,i=e.data.payload;"init"===n?t.init():"set-property"===n?t.setProperty(i):"get-outbound-properties"===n?t.getOutboundProps():"invoke-script"===n&&t.invokeScript(i)}}))}return e.prototype.postMessage=function(e,t){var n={context:ze,action:e,payload:t};window.top.postMessage(n,"*")},e.prototype.setupEventListeners=function(){var e=this;this.prefabInstance.invokeEventCallback=function(t,n){void 0===n&&(n={}),e.postMessage("event-log",{name:t,data:n})}},e.prototype.init=function(){var e=this;this.previewMode=!0,this.prefabInstance.readyState.subscribe((function(){}),(function(){}),(function(){e.prefabManager.getConfig("__self__").then((function(t){e.config=t,e.postMessage("config",t),e.setupEventListeners()}))}))},e.prototype.setProperty=function(e){this.prefabInstance.widget[e.name]=e.value},e.prototype.isOutBoundProp=function(e){return"out-bound"===e.bindable||"in-out-bound"===e.bindable},e.prototype.getOutboundProps=function(){var e,t,n={};try{for(var i=J(Object.entries(this.config.properties||{})),o=i.next();!o.done;o=i.next()){var a=X(o.value,2),r=a[0],s=a[1];this.isOutBoundProp(s)&&(n[r]=this.prefabInstance.widget[r])}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}this.postMessage("outbound-properties",n)},e.prototype.invokeScript=function(e){var t="\n return "+e.script+";",n=new Function("Prefab",t)(this.prefabInstance);this.postMessage("method-output",{methodName:e.methodName,output:n})},e.prototype.ngAfterViewInit=function(){this.setupEventListeners(),this.postMessage("init")},e}();He.decorators=[{type:t.Component,args:[{selector:"wm-prefab-preview",template:'\n <div class="prefab-preview row">\n <section wmPrefab name="prefab-preview" prefabname="__self__"></section>\n </div>\n '}]}],He.ctorParameters=function(){return[{type:H}]},He.propDecorators={prefabInstance:[{type:t.ViewChild,args:[p.PrefabDirective,{static:!0}]}]},A.initComponentsBuildTask();var Ye=new Map,Ke=function(e){var n=function(){};return n.decorators=[{type:t.NgModule,args:[{declarations:[e],imports:[Pt],schemas:[t.CUSTOM_ELEMENTS_SCHEMA,t.NO_ERRORS_SCHEMA]}]}],n},Qe=function(e,n,i){void 0===i&&(i="");var o={template:n,styles:[i],encapsulation:t.ViewEncapsulation.None},a=function(){};return a.decorators=[{type:t.Component,args:[Object.assign(Object.assign({},o),{selector:e})]}],a},Ze=function(){function e(e,t,n){this.app=e,this.appManager=t,this.compiler=n,this.counter=1}return e.prototype.getComponentFactoryRef=function(e,t,n){return void 0===n&&(n={}),Q(this,void 0,void 0,(function(){var i,o,a;return Z(this,(function(r){return i=Ye.get(e),t=n.transpile?R.transpile(t).markup:t,i&&!n.noCache||(o=Qe(e,t,n.styles),a=Ke(o),i=this.compiler.compileModuleAndAllComponentsSync(a).componentFactories.filter((function(e){return e.componentType===o}))[0],Ye.set(e,i)),[2,i]}))}))},e.prototype.addComponent=function(e,t,n,i){return void 0===n&&(n={}),void 0===i&&(i={}),Q(this,void 0,void 0,(function(){var a,r;return Z(this,(function(s){switch(s.label){case 0:return i.transpile=!o.isDefined(i.transpile)||i.transpile,i.noCache=!o.isDefined(i.noCache)||i.noCache,i.selector=o.isDefined(i.selector)?i.selector:"wm-dynamic-component-"+this.counter++,[4,this.getComponentFactoryRef(i.selector,t,i)];case 1:return a=s.sent(),r=this.app.dynamicComponentContainerRef.createComponent(a,0,_.get(i,"inj")),o.extendProto(r.instance,n),e.appendChild(r.location.nativeElement),[2]}}))}))},e}();Ze.decorators=[{type:t.Injectable}],Ze.ctorParameters=function(){return[{type:o.App},{type:j},{type:t.Compiler}]};var Je=function(){function e(){}return e.prototype.canDeactivate=function(e,t,n){return function(){var e;return!1!==(e=this.app.activePage&&this.app.activePage.onBeforePageLeave())&&(e=(this.app.onBeforePageLeave||o.noop)(this.app.activePageName,this.app.activePage)),void 0===e||e}.apply(e)},e}();Je.decorators=[{type:t.Injectable}];var Xe=function(){function e(){}return e.prototype.canDeactivate=function(e,t,n){return!e.canDeactivate||e.canDeactivate()},e}();Xe.decorators=[{type:t.Injectable}];var et=function(){function e(){this._stylesSet=new Set}return e.prototype.addStyles=function(e){var t=this,n=new Set;e.forEach((function(e){t._stylesSet.has(e)||(t._stylesSet.add(e),n.add(e))})),this.onStylesAdded(n)},e.prototype.onStylesAdded=function(e){},e.prototype.getAllStyles=function(){return Array.from(this._stylesSet)},e}();et.decorators=[{type:t.Injectable}];var tt=function(e){function t(t){var n=e.call(this)||this;return n._doc=t,n._hostNodes=new Map,n._hostNodes.set(t.head,[]),n}return K(t,e),t.prototype._addStylesToHost=function(e,t,n){var i,o=this,a=(null===(i=document.querySelector('meta[name="CSP-NONCE"]'))||void 0===i?void 0:i.getAttribute("content"))||"wm-csp-nonce";e.forEach((function(e){var i=o._doc.createElement("style");i.textContent=e,i.setAttribute("nonce",a),n.push(t.appendChild(i))}))},t.prototype.addHost=function(e){var t=[];this._addStylesToHost(this._stylesSet,e,t),this._hostNodes.set(e,t)},t.prototype.removeHost=function(e){var t=this._hostNodes.get(e);t&&t.forEach(nt),this._hostNodes.delete(e)},t.prototype.onStylesAdded=function(e){var t=this;this._hostNodes.forEach((function(n,i){t._addStylesToHost(e,i,n)}))},t.prototype.ngOnDestroy=function(){this._hostNodes.forEach((function(e){return e.forEach(nt)}))},t}(et);function nt(e){i["\u0275getDOM"]().remove(e)}tt.decorators=[{type:t.Injectable}],tt.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Inject,args:[i.DOCUMENT]}]}]};var it={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/MathML/"},ot=/%COMP%/g,at="_nghost-%COMP%",rt="_ngcontent-%COMP%";function st(e,t,n){for(var i=0;i<t.length;i++){var o=t[i];Array.isArray(o)?st(e,o,n):(o=o.replace(ot,e),n.push(o))}return n}function lt(e){return function(t){if("__ngUnwrap__"===t)return e;!1===e(t)&&(t.preventDefault(),t.returnValue=!1)}}var ct=function(){function e(e,t,n){this.eventManager=e,this.sharedStylesHost=t,this.appId=n,this.rendererByCompId=new Map,this.defaultRenderer=new pt(e)}return e.prototype.createRenderer=function(e,n){if(!e||!n)return this.defaultRenderer;switch(n.encapsulation){case t.ViewEncapsulation.Emulated:var i=this.rendererByCompId.get(n.id);return i||(i=new ht(this.eventManager,this.sharedStylesHost,n,this.appId),this.rendererByCompId.set(n.id,i)),i.applyToHost(e),i;case 1:case t.ViewEncapsulation.ShadowDom:return new mt(this.eventManager,this.sharedStylesHost,e,n);default:if(!this.rendererByCompId.has(n.id)){var o=st(n.id,n.styles,[]);this.sharedStylesHost.addStyles(o),this.rendererByCompId.set(n.id,this.defaultRenderer)}return this.defaultRenderer}},e.prototype.begin=function(){},e.prototype.end=function(){},e}();ct.decorators=[{type:t.Injectable}],ct.ctorParameters=function(){return[{type:u.EventManager},{type:u["\u0275DomSharedStylesHost"]},{type:String,decorators:[{type:t.Inject,args:[t.APP_ID]}]}]};var pt=function(){function e(e){this.eventManager=e,this.data=Object.create(null),this.destroyNode=null}return e.prototype.destroy=function(){},e.prototype.createElement=function(e,t){return t?document.createElementNS(it[t]||t,e):document.createElement(e)},e.prototype.createComment=function(e){return document.createComment(e)},e.prototype.createText=function(e){return document.createTextNode(e)},e.prototype.appendChild=function(e,t){(dt(e)?e.content:e).appendChild(t)},e.prototype.insertBefore=function(e,t,n){e&&(dt(e)?e.content:e).insertBefore(t,n)},e.prototype.removeChild=function(e,t){e&&e.removeChild(t)},e.prototype.selectRootElement=function(e,t){var n="string"==typeof e?document.querySelector(e):e;if(!n)throw new Error('The selector "'+e+'" did not match any elements');return t||(n.textContent=""),n},e.prototype.parentNode=function(e){return e.parentNode},e.prototype.nextSibling=function(e){return e.nextSibling},e.prototype.resetStyles=function(e){[].slice.call(e).forEach((function(t){e.style.removeProperty(t)}))},e.prototype.applyStyles=function(e,t){if(t)return t.split(";").forEach((function(t){var n,i,o=t.split(":");2===o.length&&(n=o[0].trim(),i=o[1].trim(),e.style[n]=i)})),t},e.prototype.setAttribute=function(e,t,n,i){if(i){t=i+":"+t;var o=it[i];o?e.setAttributeNS(o,t,n):e.setAttribute(t,n)}else"style"===t?(this.resetStyles(e),this.applyStyles(e,n)):e.setAttribute(t,n)},e.prototype.removeAttribute=function(e,t,n){if(n){var i=it[n];i?e.removeAttributeNS(i,t):e.removeAttribute(n+":"+t)}else e.removeAttribute(t)},e.prototype.addClass=function(e,t){e.classList.add(t)},e.prototype.removeClass=function(e,t){e.classList.remove(t)},e.prototype.setStyle=function(e,n,i,o){o&(t.RendererStyleFlags2.DashCase|t.RendererStyleFlags2.Important)?e.style.setProperty(n,i,o&t.RendererStyleFlags2.Important?"important":""):e.style[n]=i},e.prototype.removeStyle=function(e,n,i){i&t.RendererStyleFlags2.DashCase?e.style.removeProperty(n):e.style[n]=""},e.prototype.setProperty=function(e,t,n){e[t]=n},e.prototype.setValue=function(e,t){e.nodeValue=t},e.prototype.listen=function(e,t,n){return"string"==typeof e?this.eventManager.addGlobalEventListener(e,t,lt(n)):this.eventManager.addEventListener(e,t,lt(n))},e}();"@".charCodeAt(0);function dt(e){return"TEMPLATE"===e.tagName&&void 0!==e.content}var ut,ht=function(e){function t(t,n,i,o){var a=e.call(this,t)||this;a.component=i;var r,s=st(o+"-"+i.id,i.styles,[]);return n.addStyles(s),a.contentAttr=(r=o+"-"+i.id,rt.replace(ot,r)),a.hostAttr=function(e){return at.replace(ot,e)}(o+"-"+i.id),a}return K(t,e),t.prototype.applyToHost=function(t){e.prototype.setAttribute.call(this,t,this.hostAttr,"")},t.prototype.createElement=function(t,n){var i=e.prototype.createElement.call(this,t,n);return e.prototype.setAttribute.call(this,i,this.contentAttr,""),i},t}(pt),mt=function(e){function t(t,n,i,o){var a=e.call(this,t)||this;a.sharedStylesHost=n,a.hostEl=i,a.shadowRoot=i.attachShadow({mode:"open"}),a.sharedStylesHost.addHost(a.shadowRoot);for(var r=st(o.id,o.styles,[]),s=0;s<r.length;s++){var l=document.createElement("style");l.textContent=r[s],a.shadowRoot.appendChild(l)}return a}return K(t,e),t.prototype.nodeOrShadowRoot=function(e){return e===this.hostEl?this.shadowRoot:e},t.prototype.destroy=function(){this.sharedStylesHost.removeHost(this.shadowRoot)},t.prototype.appendChild=function(t,n){return e.prototype.appendChild.call(this,this.nodeOrShadowRoot(t),n)},t.prototype.insertBefore=function(t,n,i){return e.prototype.insertBefore.call(this,this.nodeOrShadowRoot(t),n,i)},t.prototype.removeChild=function(t,n){return e.prototype.removeChild.call(this,this.nodeOrShadowRoot(t),n)},t.prototype.parentNode=function(t){return this.nodeOrShadowRoot(e.prototype.parentNode.call(this,this.nodeOrShadowRoot(t)))},t}(pt),ft=function(){o._WM_APP_PROJECT.id=o.hasCordova()?_WM_APP_PROPERTIES.displayName:location.href.split("/")[3],o._WM_APP_PROJECT.cdnUrl=document.querySelector('[name="cdnUrl"]')&&document.querySelector('[name="cdnUrl"]').getAttribute("content"),o._WM_APP_PROJECT.ngDest="ng-bundle/"};function gt(e,t){return{provide:e,useValue:t}}function vt(e,t){var n=this;return function(){return Q(n,void 0,void 0,(function(){return Z(this,(function(n){switch(n.label){case 0:return ft(),[4,t.resolve()];case 1:return n.sent(),[2,e.loadDefaultLocale()]}}))}))}}function yt(e){return ft(),e.deduceAppLocale()}!function(e){e.IOS="ios",e.ANDROID="android"}(ut||(ut={}));var bt=[fe,ge,ve,be,Ue,He,ye],wt=[f.ConfirmDialogModule,g.DesignDialogModule,m.DialogModule];$.fn.swipeAnimation.expressionEvaluator=o.$parseExpr;var Pt=function(){function e(t,n,i){e.addCustomEventPolyfill(),this.getDeviceDetails().then((function(e){n.selectedViewPort={os:e.os,category:e.selectedDeviceCategory},i.update(e),n.notify("on-viewport-details",e.os)}))}return e.addCustomEventPolyfill=function(){if("function"==typeof window.CustomEvent)return!1;var e=function(e,t){t=t||{bubbles:!1,cancelable:!1,detail:null};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n};e.prototype=window.Event.prototype,window.CustomEvent=e},e.forRoot=function(){return{ngModule:e,providers:[{provide:o.App,useClass:Re},{provide:o.AbstractToasterService,useClass:Ae},{provide:o.AbstractI18nService,useClass:Se},{provide:o.AbstractSpinnerService,useClass:Ce},{provide:o.AbstractNavigationService,useClass:De},{provide:o.AppDefaults,useClass:Me},{provide:o.DynamicComponentRefProvider,useClass:Ze},{provide:t.APP_INITIALIZER,useFactory:vt,deps:[o.AbstractI18nService,Ge],multi:!0},{provide:t.LOCALE_ID,useFactory:yt,deps:[o.AbstractI18nService]},{provide:d.HTTP_INTERCEPTORS,useClass:qe,multi:!0},Pe,i.DecimalPipe,i.DatePipe,j,H,Le,Fe,je,Je,Ge,Ve,We,gt(ae,10),gt(re,1800)]}},e.prototype.getDeviceDetails=function(){return new Promise((function(e,t){window.top!==window?(window.top.postMessage({key:"on-load"},"*"),window.onmessage=function(t){var n=t.data;o.isObject(n)&&"switch-device"===n.key&&e(n.device)}):o.isIphone()||o.isIpod()||o.isIpad()?e({os:ut.IOS}):e({os:ut.ANDROID})}))},e}();Pt.decorators=[{type:t.NgModule,args:[{declarations:bt,imports:[i.CommonModule,n.RouterModule,d.HttpClientModule,h.ToastrModule,c.WmComponentsModule,p.PrefabModule,v.MobileRuntimeModule,o.CoreModule,a.SecurityModule,b.OAuthModule,r.VariablesModule,y.HttpServiceModule,wt],exports:[bt,i.CommonModule,c.WmComponentsModule,v.MobileRuntimeModule,o.CoreModule,a.SecurityModule,b.OAuthModule,r.VariablesModule,y.HttpServiceModule,wt],providers:[{provide:u["\u0275DomSharedStylesHost"],useClass:tt},{provide:u["\u0275DomRendererFactory2"],useClass:ct}],entryComponents:[ve]}]}],Pt.ctorParameters=function(){return[{type:v.MobileRuntimeModule},{type:o.App},{type:o.Viewport}]};var _t=[c.WmComponentsModule.forRoot(),v.MobileRuntimeModule.forRoot(),o.CoreModule.forRoot(),a.SecurityModule.forRoot(),b.OAuthModule.forRoot(),r.VariablesModule.forRoot(),y.HttpServiceModule.forRoot(),Pt.forRoot()],Ot=!1,Et=function(){function e(e,t){this.appManager=e,this.appVariablesProvider=t}return e.prototype.resolve=function(){var e=this;return!!Ot||Promise.all([this.appManager.loadSecurityConfig(),this.appManager.loadMetadata(),this.appVariablesProvider.getAppVariables()]).then((function(t){return e.appManager.loadAppVariables(t[2])})).then((function(){return Ot=!0}))},e}();Et.\u0275prov=C.\u0275\u0275defineInjectable({factory:function(){return new Et(C.\u0275\u0275inject(j),C.\u0275\u0275inject(L))},token:Et,providedIn:"root"}),Et.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],Et.ctorParameters=function(){return[{type:j},{type:L}]};var Rt=!1,At=function(){function e(e){this.appManager=e}return e.prototype.resolve=function(){return Rt||this.appManager.loadMetadata().then((function(){return Rt=!0}))},e}();At.\u0275prov=C.\u0275\u0275defineInjectable({factory:function(){return new At(C.\u0275\u0275inject(j))},token:At,providedIn:"root"}),At.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],At.ctorParameters=function(){return[{type:j}]};var Tt=function(){function e(e){this.appManager=e,o.isMobileApp()||(this.loaded=this.appManager.isPrefabType()||this.appManager.isTemplateBundleType()||!o.getWmProjectProperties().securityEnabled)}return e.prototype.resolve=function(){var e=this;return this.loaded||this.appManager.loadSecurityConfig().then((function(){e.loaded=!0}))},e}();Tt.\u0275prov=C.\u0275\u0275defineInjectable({factory:function(){return new Tt(C.\u0275\u0275inject(j))},token:Tt,providedIn:"root"}),Tt.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],Tt.ctorParameters=function(){return[{type:j}]},e.AccessrolesDirective=fe,e.AppComponent=Ue,e.AppDefaultsService=Me,e.AppExtensionJSResolve=Ve,e.AppExtensionProvider=F,e.AppJSProvider=k,e.AppJSResolve=Ge,e.AppManagerService=j,e.AppRef=Re,e.AppSpinnerComponent=ge,e.AppVariablesProvider=L,e.AppVariablesResolve=Et,e.AuthGuard=Le,e.BaseLayoutComponent=ue,e.BasePageComponent=pe,e.BasePartialComponent=ie,e.BasePrefabComponent=de,e.BaseSpaPageComponent=me,e.CACHE_PAGE=oe,e.CanDeactivateNgPageGuard=Xe,e.CanDeactivatePageGuard=Je,e.ComponentRefProvider=N,e.CustomToasterComponent=ve,e.DynamicComponentRefProviderService=Ze,e.EmptyPageComponent=ye,e.FragmentMonitor=te,e.HttpCallInterceptor=qe,e.I18nResolve=We,e.I18nServiceImpl=Se,e.InitializeApp=vt,e.MAX_CACHE_AGE=re,e.MAX_CACHE_SIZE=ae,e.MetadataResolve=At,e.NavigationServiceImpl=De,e.PageNotFoundGaurd=je,e.PipeProvider=we,e.PipeService=Pe,e.PrefabConfigProvider=M,e.PrefabDirective=be,e.PrefabManagerService=H,e.PrefabPreviewComponent=He,e.REQUIRED_MODULES_FOR_DYNAMIC_COMPONENTS=wt,e.RoleGuard=Fe,e.RuntimeBaseModule=Pt,e.SecurityConfigResolve=Tt,e.SpinnerServiceImpl=Ce,e.ToasterServiceImpl=Ae,e.WM_MODULES_FOR_ROOT=_t,e.WmDefaultRouteReuseStrategy=se,e.WmNgRouteReuseStrategy=ce,e.WmRouteReuseStrategy=le,e.commonPartialWidgets=ne,e.getPrefabBaseUrl=G,e.getPrefabConfigUrl=function(e){return G(e)+"/config.json"},e.getPrefabMinJsonUrl=function(e){return G(e)+"/pages/Main/page.min.json"},e.getPrefabPartialJsonUrl=function(e,t){return G(e)+"/pages/"+t+"/page.min.json"},e.isPrefabInPreview=B,e.setAngularLocale=yt,e["\u02750"]=z,e["\u0275a"]=gt,e["\u0275b"]=et,e["\u0275c"]=tt,e["\u0275d"]=ct,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/platform-browser-dynamic"),require("@angular/platform-browser"),require("@angular/common"),require("@angular/router"),require("@angular/common/http"),require("@angular/forms"),require("ngx-bootstrap/typeahead"),require("ngx-bootstrap/timepicker"),require("ngx-bootstrap/progressbar"),require("ngx-bootstrap/pagination"),require("ngx-bootstrap/modal"),require("ngx-bootstrap/tooltip"),require("ngx-bootstrap/datepicker"),require("ngx-bootstrap/dropdown"),require("ngx-bootstrap/popover"),require("ng-circle-progress"),require("ngx-toastr"),require("ngx-bootstrap/carousel"),require("@wm/core"),require("@wm/components/basic"),require("@wm/components/basic/progress"),require("@wm/components/basic/rich-text-editor"),require("@wm/components/basic/search"),require("@wm/components/basic/tree"),require("@wm/components/input"),require("@wm/components/input/calendar"),require("@wm/components/input/chips"),require("@wm/components/input/color-picker"),require("@wm/components/input/currency"),require("@wm/components/input/epoch"),require("@wm/components/input/file-upload"),require("@wm/components/input/rating"),require("@wm/components/input/slider"),require("@wm/mobile/runtime/dynamic"),require("@wm/components/data/card"),require("@wm/components/data/form"),require("@wm/components/data/list"),require("@wm/components/data/live-table"),require("@wm/components/data/pagination"),require("@wm/components/data/table"),require("@wm/components/chart"),require("@wm/components/containers/accordion"),require("@wm/components/containers/linear-layout"),require("@wm/components/containers/layout-grid"),require("@wm/components/containers/panel"),require("@wm/components/containers/tabs"),require("@wm/components/containers/tile"),require("@wm/components/containers/wizard"),require("@wm/components/dialogs/alert-dialog"),require("@wm/components/dialogs/iframe-dialog"),require("@wm/components/dialogs/login-dialog"),require("@wm/components/dialogs/partial-dialog"),require("@wm/components/navigation/breadcrumb"),require("@wm/components/navigation/menu"),require("@wm/components/navigation/navbar"),require("@wm/components/navigation/popover"),require("@wm/components/advanced/carousel"),require("@wm/components/advanced/login"),require("@wm/components/advanced/marquee"),require("@wm/components/page"),require("@wm/components/page/footer"),require("@wm/components/page/header"),require("@wm/components/page/left-panel"),require("@wm/components/page/right-panel"),require("@wm/components/page/top-nav"),require("@wm/components/prefab"),require("@wm/runtime/base"),require("@wm/variables"),require("@wm/security"),require("@wm/transpiler"),require("@angular/platform-browser/animations")):"function"==typeof define&&define.amd?define("@wm/runtime/dynamic",["exports","@angular/core","@angular/platform-browser-dynamic","@angular/platform-browser","@angular/common","@angular/router","@angular/common/http","@angular/forms","ngx-bootstrap/typeahead","ngx-bootstrap/timepicker","ngx-bootstrap/progressbar","ngx-bootstrap/pagination","ngx-bootstrap/modal","ngx-bootstrap/tooltip","ngx-bootstrap/datepicker","ngx-bootstrap/dropdown","ngx-bootstrap/popover","ng-circle-progress","ngx-toastr","ngx-bootstrap/carousel","@wm/core","@wm/components/basic","@wm/components/basic/progress","@wm/components/basic/rich-text-editor","@wm/components/basic/search","@wm/components/basic/tree","@wm/components/input","@wm/components/input/calendar","@wm/components/input/chips","@wm/components/input/color-picker","@wm/components/input/currency","@wm/components/input/epoch","@wm/components/input/file-upload","@wm/components/input/rating","@wm/components/input/slider","@wm/mobile/runtime/dynamic","@wm/components/data/card","@wm/components/data/form","@wm/components/data/list","@wm/components/data/live-table","@wm/components/data/pagination","@wm/components/data/table","@wm/components/chart","@wm/components/containers/accordion","@wm/components/containers/linear-layout","@wm/components/containers/layout-grid","@wm/components/containers/panel","@wm/components/containers/tabs","@wm/components/containers/tile","@wm/components/containers/wizard","@wm/components/dialogs/alert-dialog","@wm/components/dialogs/iframe-dialog","@wm/components/dialogs/login-dialog","@wm/components/dialogs/partial-dialog","@wm/components/navigation/breadcrumb","@wm/components/navigation/menu","@wm/components/navigation/navbar","@wm/components/navigation/popover","@wm/components/advanced/carousel","@wm/components/advanced/login","@wm/components/advanced/marquee","@wm/components/page","@wm/components/page/footer","@wm/components/page/header","@wm/components/page/left-panel","@wm/components/page/right-panel","@wm/components/page/top-nav","@wm/components/prefab","@wm/runtime/base","@wm/variables","@wm/security","@wm/transpiler","@angular/platform-browser/animations"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.runtime=e.wm.runtime||{},e.wm.runtime.dynamic={}),e.ng.core,e.ng.platformBrowserDynamic,e.ng.platformBrowser,e.ng.common,e.ng.router,e.ng.common.http,e.ng.forms,e["ngx-bootstrap"].typeahead,e["ngx-bootstrap"].timepicker,e["ngx-bootstrap"].progressbar,e["ngx-bootstrap"].pagination,e["ngx-bootstrap"].modal,e["ngx-bootstrap"].tooltip,e["ngx-bootstrap"].datepicker,e["ngx-bootstrap"].dropdown,e["ngx-bootstrap"].popover,e.ngCircleProgress,e.ngxToastr,e["ngx-bootstrap"].carousel,e.wm.core,e.wm.components.basic,e.wm.components.basic.progress,e.wm.components.basic.richtexteditor,e.wm.components.basic.search,e.wm.components.basic.tree,e.wm.components.input,e.wm.components.input.calendar,e.wm.components.input.chips,e.wm.components.input.colorpicker,e.wm.components.input.currency,e.wm.components.input.epoch,e.wm.components.input.fileupload,e.wm.components.input.rating,e.wm.components.input.slider,e.wm.mobile.runtime.dynamic,e.wm.components.data.card,e.wm.components.data.form,e.wm.components.data.list,e.wm.components.data.livetable,e.wm.components.data.pagination,e.wm.components.data.table,e.wm.components.chart,e.wm.components.containers.accordion,e.wm.components.containers.linearlayout,e.wm.components.containers.layoutgrid,e.wm.components.containers.panel,e.wm.components.containers.tabs,e.wm.components.containers.tile,e.wm.components.containers.wizard,e.wm.components.dialogs.alertdialog,e.wm.components.dialogs.iframedialog,e.wm.components.dialogs.logindialog,e.wm.components.dialogs.partialdialog,e.wm.components.navigation.breadcrumb,e.wm.components.navigation.menu,e.wm.components.navigation.navbar,e.wm.components.navigation.popover,e.wm.components.advanced.carousel,e.wm.components.advanced.login,e.wm.components.advanced.marquee,e.wm.components.page,e.wm.components.page.footer,e.wm.components.page.header,e.wm.components.page.leftpanel,e.wm.components.page.rightpanel,e.wm.components.page.topnav,e.wm.components.prefab,e.wm.runtime.base,e.wm.variables,e.wm.security,e.wm.transpiler,e.ng.platformBrowser.animations)}(this,(function(e,t,n,i,o,a,r,s,l,c,p,d,u,h,m,f,g,v,y,b,w,P,O,E,R,A,T,S,C,I,D,x,N,M,k,L,F,j,B,G,V,W,U,q,z,H,Y,K,Q,Z,J,X,ee,te,ne,ie,oe,ae,re,se,le,ce,pe,de,ue,he,me,fe,ge,ve,ye,be,we){"use strict";function Pe(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var _e=Pe(t),Oe=Pe(r),Ee=function(e,t){return(Ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function Re(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Ee(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function Ae(e,t,n,i){return new(n||(n=Promise))((function(o,a){function r(e){try{l(i.next(e))}catch(e){a(e)}}function s(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}))}function Te(e,t){var n,i,o,a,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],i=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}Object.create;function Se(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,a=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return r}function Ce(e,t,n){if(n||2===arguments.length)for(var i,o=0,a=t.length;o<a;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var Ie=function(){function e(e,t,n,i,o,a,r,s,l,c,p,d,u){this.injector=e,this.route=t,this.vcRef=n,this.appRef=i,this.metadataService=o,this.securityService=a,this.appManager=r,this.app=s,this.ngZone=l,this.elRef=c,this.spinnerService=p,this.componentRefProvider=d,this.router=u}return e.prototype.getTargetNode=function(){return this.elRef.nativeElement},e.prototype.resetViewContainer=function(){this.vcRef.clear(),this.getTargetNode().innerHTML=""},e.prototype.renderPage=function(e){var t=this,n=this.getTargetNode();this.appManager.loadAppVariables().then((function(){return Ae(t,void 0,void 0,(function(){var t,i;return Te(this,(function(o){switch(o.label){case 0:return[4,this.componentRefProvider.getComponentFactoryRef(e,ge.ComponentType.PAGE)];case 1:return(t=o.sent())?(i=this.vcRef.createComponent(t,0,this.injector),this.instance=i.instance,n.appendChild(i.location.nativeElement)):ge.BasePageComponent.clear(),this.vcRef.length>1&&this.vcRef.remove(1),[2]}}))}))}))},e.prototype.renderPrefabPreviewPage=function(){this.router.navigate(["prefab-preview"])},e.prototype.loadPage=function(e){var t=this;this.ngZone.run((function(){e&&t.renderPage(e)}))},e.prototype.ngOnInit=function(){var e=this;this.app.isPrefabType?this.renderPrefabPreviewPage():($(this.getTargetNode()).find(">div").first().remove(),this.subscription=this.route.params.subscribe((function(t){var n=t.pageName;e.loadPage(n)})))},e.prototype.ngOnDestroy=function(){this.vcRef.clear(),this.subscription&&this.subscription.unsubscribe()},e.prototype.ngOnAttach=function(){this.getTargetNode().appendChild(this.instance.$page[0]),this.instance.ngOnAttach()},e.prototype.ngOnDetach=function(){this.instance.ngOnDetach()},e}();Ie.decorators=[{type:t.Component,args:[{selector:"app-page-outlet",template:"<div></div>"}]}],Ie.ctorParameters=function(){return[{type:t.Injector},{type:a.ActivatedRoute},{type:t.ViewContainerRef},{type:t.ApplicationRef},{type:ve.MetadataService},{type:ye.SecurityService},{type:ge.AppManagerService},{type:w.App},{type:t.NgZone},{type:t.ElementRef},{type:w.AbstractSpinnerService},{type:ge.ComponentRefProvider},{type:a.Router}]};var De={securityConfig:ge.SecurityConfigResolve,metadata:ge.MetadataResolve,appMetaConfig:ge.AppExtensionJSResolve},xe=[{path:"",pathMatch:"full",resolve:De,component:ge.EmptyPageComponent},{path:"prefab-preview",pathMatch:"full",resolve:De,component:ge.PrefabPreviewComponent},{path:":pageName",pathMatch:"full",resolve:De,component:Ie,canDeactivate:[ge.CanDeactivatePageGuard]}],Ne=function(e){function t(t){var n=e.call(this)||this;return n.$http=t,n}return Re(t,e),t.prototype.getAppScriptFn=function(){return this.$http.get("./app.js",{responseType:"text"}).toPromise().then((function(e){return new Function("App","Utils","Injector",e)}))},t}(ge.AppJSProvider);Ne.\u0275prov=_e.\u0275\u0275defineInjectable({factory:function(){return new Ne(_e.\u0275\u0275inject(Oe.HttpClient))},token:Ne,providedIn:"root"}),Ne.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],Ne.ctorParameters=function(){return[{type:r.HttpClient}]};var Me=new Map,ke=function(){function e(e){this.$http=e}return e.prototype.get=function(e,t){var n=Me.get(e);return n?Promise.resolve(n):this.$http.get(e).then((function(n){return t&&Me.set(e,n),n}))},e.prototype.clearCache=function(){Me.clear()},e}();ke.decorators=[{type:t.Injectable}],ke.ctorParameters=function(){return[{type:w.AbstractHttpService}]};var Le=function(e){function t(t){var n=e.call(this)||this;return n.resourceManager=t,n}return Re(t,e),t.prototype.getAppVariables=function(){return Ae(this,void 0,void 0,(function(){return Te(this,(function(e){return[2,this.resourceManager.get("./app.variables.json")]}))}))},t}(ge.AppVariablesProvider);Le.\u0275prov=_e.\u0275\u0275defineInjectable({factory:function(){return new Le(_e.\u0275\u0275inject(ke))},token:Le,providedIn:"root"}),Le.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],Le.ctorParameters=function(){return[{type:ke}]};var Fe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Re(t,e),t.prototype.loadFormatterConfigScript=function(e){try{w.appendScriptToHead(e)}catch(e){console.warn("Error while loading the formatters.js file")}},t}(ge.AppExtensionProvider);Fe.\u0275prov=_e.\u0275\u0275defineInjectable({factory:function(){return new Fe},token:Fe,providedIn:"root"}),Fe.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}];var je=new Map;window.resourceCache=je;var Be=new Map;Be.set(ge.ComponentType.PAGE,new Map),Be.set(ge.ComponentType.PARTIAL,new Map),Be.set(ge.ComponentType.PREFAB,new Map);var Ge=function(e){return decodeURIComponent(e.replace(/\+/g," "))},$e=Ge,Ve=function(e,t,n){return t===ge.ComponentType.PAGE||t===ge.ComponentType.PARTIAL?n&&n.prefab?ge.getPrefabPartialJsonUrl(n.prefab,e):"./pages/"+e+"/page.min.json":t===ge.ComponentType.PREFAB?ge.getPrefabMinJsonUrl(e):void 0},We=Ve,Ue=new Map,qe=function(e,t,n,i,o,a){var r=Ue.get(t);("Partial"!==n||_.isUndefined(i.Prefab))&&r||(r=new Function(n,"App","Utils",e),Ue.set(t,r)),r(i,o,a)},ze=qe,He=function(){function e(){}return e.prototype.init=function(){},e}(),Ye=function(e){var n=function(){};return n.decorators=[{type:t.NgModule,args:[{declarations:[e],imports:[ge.RuntimeBaseModule],schemas:[t.CUSTOM_ELEMENTS_SCHEMA,t.NO_ERRORS_SCHEMA]}]}],n},Ke=Ye,Qe=function(e,n,i,o,a,r){var s={template:i,styles:[o],encapsulation:t.ViewEncapsulation.None},l=He,c="",p="";switch(n){case ge.ComponentType.PAGE:l=ge.BasePageComponent,c="app-page-"+e,p="Page";break;case ge.ComponentType.PARTIAL:l=ge.BasePartialComponent,c="app-partial-"+e,p="Partial";break;case ge.ComponentType.PREFAB:l=ge.BasePrefabComponent,c="app-prefab-"+e,p="Prefab"}var d=function(t){function i(i){var o=t.call(this)||this;switch(o.injector=i,n){case ge.ComponentType.PAGE:o.pageName=e;break;case ge.ComponentType.PARTIAL:o.partialName=e;break;case ge.ComponentType.PREFAB:o.prefabName=e}return t.prototype.init.call(o),o}return Re(i,t),i.prototype.evalUserScript=function(e,t,n){qe(a,c,p,e,t,n)},i.prototype.getVariables=function(){return JSON.parse(r)},i.prototype.getExpressions=function(){return{}},i}(l);return d.decorators=[{type:t.Component,args:[Object.assign(Object.assign({},s),{selector:c,providers:[{provide:w.UserDefinedExecutionContext,useExisting:d}]})]}],d.ctorParameters=function(){return[{type:t.Injector}]},d},Ze=Qe,Je=function(e){function t(t,n,i,o){var a=e.call(this)||this;return a.resouceMngr=t,a.app=n,a.appManager=i,a.compiler=o,a}return Re(t,e),t.prototype.loadResourcesOfFragment=function(e,t,n){var i=this,o=Ve(e,t,n),a=je.get(o);return a?Promise.resolve(a):this.resouceMngr.get(o,!0).then((function(n){var i=n.markup,a=n.script,r=n.styles,s=n.variables,l={markup:be.transpile(Ge(i)).markup,script:Ge(a),styles:be.scopeComponentStyles(e,t,Ge(r)),variables:w.getValidJSON(Ge(s))};return je.set(o,l),l}),(function(e){var t=e.details.status,n={404:i.app.appLocale.MESSAGE_PAGE_NOT_FOUND||"The page you are trying to reach is not available",403:i.app.appLocale.LABEL_ACCESS_DENIED||"Access Denied"};return Promise.reject(n[t])}))},t.prototype.getComponentFactoryRef=function(e,t,n){return Ae(this,void 0,void 0,(function(){var i,o,a,r=this;return Te(this,(function(s){return(i=Be.get(t))&&(a=n&&n.prefab?n.prefab+e:e,o=i.get(a))?[2,o]:[2,this.loadResourcesOfFragment(e,t,n).then((function(i){var a=i.markup,s=i.script,l=i.styles,c=i.variables,p=Qe(e,t,a,l,s,JSON.stringify(c)),d=Ye(p);o=r.compiler.compileModuleAndAllComponentsSync(d).componentFactories.filter((function(e){return e.componentType===p}))[0];var u=n&&n.prefab?n.prefab+e:e;return Be.get(t).set(u,o),o}),(function(e){if(e){var t="Error while loading page";console.log(t,e),r.appManager.notifyApp(_.isString(e)?e:t+", check browser console for error details","error")}}))]}))}))},t.prototype.clearComponentFactoryRefCache=function(){this.resouceMngr.clearCache(),je.clear(),Be.forEach((function(e){e.clear()}))},t}(ge.ComponentRefProvider);Je.decorators=[{type:t.Injectable}],Je.ctorParameters=function(){return[{type:ke},{type:w.App},{type:ge.AppManagerService},{type:t.Compiler}]};var Xe=new Map,et=function(e){function t(t){var n=e.call(this)||this;return n.resourceMngr=t,n}return Re(t,e),t.prototype.getConfig=function(e){var t=Xe.get(e);return t?Promise.resolve(t):this.resourceMngr.get(ge.getPrefabConfigUrl(e)).then((function(t){return Xe.set(e,t),t}))},t}(ge.PrefabConfigProvider);et.decorators=[{type:t.Injectable}],et.ctorParameters=function(){return[{type:ke}]};var tt=a.RouterModule.forRoot(xe,{useHash:!0,scrollPositionRestoration:"top"}),nt=y.ToastNoAnimationModule.forRoot({maxOpened:1,autoDismiss:!0}),it=r.HttpClientXsrfModule.withOptions({cookieName:"wm_xsrf_token",headerName:w.getWmProjectProperties().xsrf_header_name}),ot=u.ModalModule.forRoot(),at=m.BsDatepickerModule.forRoot(),rt=m.DatepickerModule.forRoot(),st=c.TimepickerModule.forRoot(),lt=f.BsDropdownModule.forRoot(),ct=d.PaginationModule.forRoot(),pt=l.TypeaheadModule.forRoot(),dt=p.ProgressbarModule.forRoot(),ut=b.CarouselModule.forRoot(),ht=g.PopoverModule.forRoot(),mt=v.NgCircleProgressModule.forRoot({}),ft=h.TooltipModule.forRoot(),gt=[m.BsDatepickerModule,m.DatepickerModule,c.TimepickerModule,f.BsDropdownModule,d.PaginationModule,l.TypeaheadModule,p.ProgressbarModule,b.CarouselModule,g.PopoverModule,v.NgCircleProgressModule,h.TooltipModule,P.BasicModule,O.ProgressModule,E.RichTextEditorModule,R.SearchModule,A.TreeModule,S.CalendarModule,C.ChipsModule,I.ColorPickerModule,D.CurrencyModule,x.EpochModule,N.FileUploadModule,T.InputModule,M.RatingModule,k.SliderModule,F.CardModule,j.FormModule,B.ListModule,G.LiveTableModule,V.PaginationModule,W.TableModule,U.ChartModule,q.AccordionModule,z.LinearLayoutModule,H.LayoutGridModule,Y.PanelModule,K.TabsModule,Q.TileModule,Z.WizardModule,J.AlertDialogModule,X.IframeDialogModule,ee.LoginDialogModule,te.PartialDialogModule,ne.BreadcrumbModule,ie.MenuModule,oe.NavbarModule,ae.PopoverModule,re.CarouselModule,se.LoginModule,le.MarqueeModule,ce.PageModule,pe.FooterModule,de.HeaderModule,ue.LeftPanelModule,he.RightPanelModule,me.TopNavModule,fe.PrefabModule];ge.REQUIRED_MODULES_FOR_DYNAMIC_COMPONENTS.push.apply(ge.REQUIRED_MODULES_FOR_DYNAMIC_COMPONENTS,Ce([],Se(gt))),ge.REQUIRED_MODULES_FOR_DYNAMIC_COMPONENTS.push.apply(ge.REQUIRED_MODULES_FOR_DYNAMIC_COMPONENTS,Ce([],Se(L.MOBILE_COMPONENT_MODULES_FOR_ROOT))),ge.REQUIRED_MODULES_FOR_DYNAMIC_COMPONENTS.push(s.FormsModule,s.ReactiveFormsModule);var vt=function(e,t,n){this.app=e,this.inj=t,this.componentRefProvider=n,window.cordova&&this.app.subscribe("userLoggedOut",this.componentRefProvider.clearComponentFactoryRefCache.bind(this.componentRefProvider))};vt.decorators=[{type:t.NgModule,args:[{declarations:[Ie],imports:[i.BrowserModule,we.BrowserAnimationsModule,o.CommonModule,a.RouterModule,r.HttpClientModule,ot,at,rt,st,lt,ct,pt,ft,dt,ut,ht,mt,tt,nt,it,L.MobileRuntimeDynamicModule,ge.WM_MODULES_FOR_ROOT],providers:[ke,{provide:ge.AppJSProvider,useClass:Ne},{provide:ge.AppVariablesProvider,useClass:Le},{provide:ge.AppExtensionProvider,useClass:Fe},{provide:ge.ComponentRefProvider,useClass:Je},{provide:w.PartialRefProvider,useClass:Je},{provide:ge.PrefabConfigProvider,useClass:et},{provide:a.RouteReuseStrategy,useClass:ge.WmRouteReuseStrategy}],bootstrap:[ge.AppComponent]}]}],vt.ctorParameters=function(){return[{type:w.App},{type:t.Injector},{type:ge.ComponentRefProvider}]};var yt="debugMode";"true"!==sessionStorage.getItem(yt)&&t.enableProdMode(),console.time("bootstrap"),document.addEventListener("DOMContentLoaded",(function(){new Promise((function(e){window.cordova?document.addEventListener("deviceready",e):e()})).then((function(){return n.platformBrowserDynamic().bootstrapModule(vt)})).then((function(e){var n=e.injector.get(t.ApplicationRef);window.addEventListener("unload",(function(){n.components.map((function(e){return e&&e.destroy()}))})),console.timeEnd("bootstrap")}),(function(e){return console.log(e)}))})),window.debugMode=function(e){_.isEmpty(e)&&(e=!0);var t=e?"true":"false";sessionStorage.getItem(yt)!==t&&(sessionStorage.setItem(yt,t),window.location.reload())};e.AppExtensionProviderService=Fe,e.AppJSProviderService=Ne,e.AppModule=vt,e.AppResourceManagerService=ke,e.AppVariablesProviderService=Le,e.ComponentRefProviderService=Je,e.PageWrapperComponent=Ie,e.PrefabConfigProviderService=et,e.bsDatePickerModule=at,e.bsDropdownModule=lt,e.carouselModule=ut,e.datepickerModule=rt,e.httpClientXsrfModule=it,e.modalModule=ot,e.ngCircleProgressModule=mt,e.paginationModule=ct,e.popoverModule=ht,e.progressbarModule=dt,e.routerModule=tt,e.timepickerModule=st,e.toastrModule=nt,e.tooltipModule=ft,e.typeaheadModule=pt,e["\u02750"]=$e,e["\u02751"]=We,e["\u02752"]=ze,e["\u02753"]=Ke,e["\u02754"]=Ze,e["\u0275a"]=xe,Object.defineProperty(e,"__esModule",{value:!0})}));