@wavemaker/app-runtime-wm-build 11.5.0-next.30508 → 11.5.0-next.40002
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.
- app-runtime-wm-build/package.json +1 -1
- app-runtime-wm-build/wmapp/scripts/wm-libs.js +1 -1
- app-runtime-wm-build/wmapp/scripts/wm-libs.min.js +1 -1
- app-runtime-wm-build/wmapp/scripts/wm-loader.js +9 -28
- app-runtime-wm-build/wmapp/scripts/wm-loader.min.js +5 -5
- app-runtime-wm-build/wmapp/styles/css/wm-style.css +1 -1
- app-runtime-wm-build/wmmobile/scripts/wm-libs.js +1 -1
- app-runtime-wm-build/wmmobile/scripts/wm-libs.min.js +1 -1
- app-runtime-wm-build/wmmobile/scripts/wm-mobileloader.js +9 -28
- app-runtime-wm-build/wmmobile/scripts/wm-mobileloader.min.js +5 -5
- app-runtime-wm-build/wmmobile/styles/css/wm-style.css +1 -1
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
27
27
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
28
28
|
PERFORMANCE OF THIS SOFTWARE.
|
|
29
|
-
***************************************************************************** */var s=function(e,t){return(s=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 l(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}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}Object.create;function c(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}var p;Object.create;!function(e){e[e.Sent=0]="Sent",e[e.UploadProgress=1]="UploadProgress",e[e.ResponseHeader=2]="ResponseHeader",e[e.DownloadProgress=3]="DownloadProgress",e[e.Response=4]="Response",e[e.User=5]="User"}(p||(p={}));var u=function(e){function t(t){var n=e.call(this)||this;return n.httpClient=t,n.nonBodyTypeMethods=["GET","DELETE","HEAD","OPTIONS","JSONP"],n.sessionTimeoutObservable=new r.Subject,n.sessionTimeoutQueue=[],n}return l(t,e),t.prototype.handleSessionTimeout=function(e,t){this.sessionTimeoutQueue.push({requestInfo:e,sub401:t}),this.on401()},t.prototype.generateRequest=function(e){var t,n,r=new i.HttpHeaders,a=new i.HttpParams,s=e.headers,l=e.params,p=e.responseType,u=e.withCredentials;e.isDirectCall||(r=r.append("X-Requested-With","XMLHttpRequest")),s&&Object.entries(s).forEach((function(e){var t=c(e,2),n=t[0],i=t[1];(o.isNumber(i)||o.isBoolean(i))&&(i=i.toString()),r=r.append(n,i)})),l&&Object.entries(l).forEach((function(e){var t=c(e,2),n=t[0],i=t[1];return a=a.append(n,i)}));var d={headers:r,params:a,responseType:p,withCredentials:u};return _.includes(this.nonBodyTypeMethods,e.method&&e.method.toUpperCase())&&void 0===e.data?(t=d,n=null):(t=e.data,n=d),new i.HttpRequest(e.method,e.url,t,n)},t.prototype.sendCallAsObservable=function(e,t){var n=this.generateRequest(e);return this.httpClient.request(n)},t.prototype.sendCall=function(e,t,n){var i=this;return new Promise((function(o,r){t._observable=i.sendCallAsObservable(e,n).subscribe((function(e){e&&e.type&&o(e)}),(function(e){r(e)}))}))},t.prototype.send=function(e){var t=this,n=this.generateRequest(e);return new Promise((function(e,i){t.httpClient.request(n).toPromise().then((function(t){e(t)}),(function(n){if(t.isPlatformSessionTimeout(n))n._401Subscriber.asObservable().subscribe((function(t){e(t)}),(function(e){i(e)}));else{var o=a.getErrMessage(n,t.getLocale());i({error:o,details:n})}}))}))},t.prototype.cancel=function(e,t){e._observable&&e._observable.unsubscribe(),t&&t._uploadProgress&&t._uploadProgress.unsubscribe()},t.prototype.setLocale=function(e){this.localeObject=e},t.prototype.getLocale=function(){return this.localeObject},t.prototype.getHeader=function(e,t){return e.headers.get(t)},t.prototype.isPlatformSessionTimeout=function(e){return 401===e.status&&"Session Not Found"===this.getHeader(e,"x-wm-login-errormessage")},t.prototype.get=function(e,t){return(t=t||{}).url=e,t.method="get",this.send(t).then((function(e){return e.body}))},t.prototype.post=function(e,t,n){return(n=n||{}).url=e,n.method="post",n.data=t,this.send(n)},t.prototype.put=function(e,t,n){return(n=n||{}).url=e,n.method="put",n.data=t,this.send(n)},t.prototype.patch=function(e,t,n){return(n=n||{}).url=e,n.method="patch",n.data=t,this.send(n)},t.prototype.delete=function(e,t){return(t=t||{}).url=e,t.method="delete",this.send(t)},t.prototype.head=function(e,t){return(t=t||{}).url=e,t.method="head",this.send(t)},t.prototype.jsonp=function(e,t){return(t=t||{}).url=e,t.method="jsonp",this.send(t)},t.prototype.upload=function(e,t,n){var o=new i.HttpRequest("POST",e,t,{reportProgress:!0});return this.httpClient.request(o)},t.prototype.uploadFile=function(e,t,n,i){var o=this;return new Promise((function(r,a){n.request=o.upload(e,t,i).subscribe((function(e){if(e.type===p.UploadProgress){var t=Math.round(100*e.loaded/e.total);i.notify(t)}e.type===p.Response&&r(e.body)}),(function(e){a(e)}))}))},t.prototype.registerOnSessionTimeout=function(e){this.sessionTimeoutObservable.asObservable().subscribe(e)},t.prototype.on401=function(){this.sessionTimeoutObservable.next()},t.prototype.pushToSessionFailureQueue=function(e){this.sessionTimeoutQueue.push({callback:e})},t.prototype.executeSessionFailureRequests=function(){var e=this.sessionTimeoutQueue,t=this;t.sessionTimeoutQueue=[],e.forEach((function(e){_.isFunction(e.callback)?e.callback():(e.requestInfo.headers.headers.delete("x-wm-xsrf-token"),t.httpClient.request(e.requestInfo).subscribe((function(t){t&&t.type&&e.sub401&&e.sub401.next(t)}),(function(t){e.sub401.error(t)})))}))},t}(o.AbstractHttpService);u.decorators=[{type:t.Injectable}],u.ctorParameters=function(){return[{type:i.HttpClient}]};var d=function(){function e(){this.headers=[]}return e.prototype.wmToAngularRequest=function(e){var t;return(t=(t=new i.HttpRequest(e.method,e.url)).clone()).body=e.body,t.method=e.method,t.responseType=e.responseType,t.reportProgress=e.reportProgress,t.urlWithParams=e.url,t.withCredentials=e.withCredentials,e.headers.forEach((function(e,n){t.headers=t.headers.append(n,e)})),t},e.prototype.angularToWmRequest=function(t){var n=new e,i=new Map;return n.body=t.body,n.method=t.method,n.responseType=t.responseType,n.reportProgress=t.reportProgress,n.url=t.urlWithParams,n.withCredentials=t.withCredentials,t.headers.keys().forEach((function(e){i.set(e,t.headers.headers.get(e.toLowerCase())[0])})),n.headers=i,n},e}(),h=function(e){function t(){return e.call(this)||this}return l(t,e),t.prototype.wmToAngularResponse=function(e){var t;return(t=(t=new i.HttpResponse).clone()).body=e.body,t.error=e.error,t.message=e.message,t.url=e.url,t.ok=e.ok,t.status=e.status,t.statusText=e.statusText,e.headers.forEach((function(e,n){t.headers=t.headers.append(n,e)})),t},t.prototype.angularToWmResponse=function(e){var n,i=new Map;return(n=new t).body=e.body,n.error=e.error,n.message=e.message,n.url=e.url,n.ok=e.ok,n.status=e.status,n.statusText=e.statusText,e.headers.keys().forEach((function(t){i.set(t,e.headers.headers.get(t.toLowerCase())[0])})),n.headers=i,n},t}(d),m=function(){function e(){}return e.forRoot=function(){return{ngModule:n.CommonModule,providers:[{provide:o.AbstractHttpService,useClass:u}]}},e}();m.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.HttpClientModule],declarations:[]}]}],e.HttpServiceImpl=u,e.HttpServiceModule=m,e.WmHttpRequest=d,e.WmHttpResponse=h,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("rxjs"),require("@wm/core")):"function"==typeof define&&define.amd?define("@wm/oAuth",["exports","@angular/core","rxjs","@wm/core"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.oAuth={}),e.ng.core,e.rxjs,e.wm.core)}(this,(function(e,t,n,i){"use strict";var o,r,a=".access_token",s="pkce",l="implicit",c=function(e){var t,n,i,o=e.urlParams;if(i={url:"services/oauth2/:providerId/authorizationUrl",method:"GET"},e.config)for(var r in i.url=(e.config.url||"")+i.url,i.method=e.config.method||i.method,i.headers=i.headers||{},e.config.headers)t=e.config.headers[r],i.headers[r]=t;if(o)for(n in o)o.hasOwnProperty(n)&&(t=o[n],_.isUndefined(t)||null===t||(i.url=i.url.replace(new RegExp(":"+n,"g"),t)));return e.params&&(i.params=e.params),_.isUndefined(e.data)||(i.data=e.data),e.dataParams&&(i.data.params=e.dataParams),e.headers&&(i.headers=e.headers),i.byPassResult=e.byPassResult,i.isDirectCall=e.isDirectCall,i.isExtURL=e.isExtURL,i.preventMultiple=e.preventMultiple,i.responseType=e.responseType,i},p={},u="WM_RUN_",d="width=400,height=600",h=function(e){var t=m(e);localStorage.removeItem(t)};function m(e){return u+i._WM_APP_PROJECT.id+"_"+e+a}function f(e,t){var n=m(e);localStorage.setItem(n,t)}function g(e,t,n,i,l,c){var p=e+a,u=localStorage.getItem(p);if((!i||i.origin===window.location.origin)&&u)if(P(c,s)){var d="client_id="+c.clientId+"&code="+u+"&grant_type=authorization_code&code_verifier="+o+"&redirect_uri="+r;l.send({method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},url:c.accessTokenUrl,data:d}).then((function(i){v(e,t,n,p,i.body.access_token)}))}else v(e,t,n,p,u)}function v(e,t,n,i,o){n(e),localStorage.removeItem(i),f(e,o),window.removeEventListener("message",p[e]),setTimeout((function(){delete p[e],t&&t(o)}))}function y(e,t,n,i,o,r){var s;s="dummy_key",localStorage.setItem(s,s),localStorage.removeItem(s);var l=moment.duration(moment().format("HH:mm"),"HH:mm").subtract(i),c=C(e,!0);c?(o.accesstoken_retrieved=!0,f(e,c),localStorage.removeItem(e+a),r(e),t&&t()):l.minutes()>1&&t&&!o.accesstoken_retrieved?t("error"):setTimeout((function(){y(e,t,n,i,o,r)}),3e3)}function b(e,t,n,i){e&&p[t]&&(e.closed?P(i,s)||(window.removeEventListener("message",p[t]),delete p[t],n&&n("error")):setTimeout(b.bind(void 0,e,t,n,i),3e3))}function w(e,t,n,i,o,r,a,s,c){P(r,l)&&(e=E(t,r,a,null,s,c)),window.open(e,"_blank",d),y(t,n,i,moment.duration(moment().format("HH:mm"),"HH:mm"),{accesstoken_retrieved:!1},o)}function P(e,t){var n=_.get(e,"oauth2Flow");return n=n?n.toLowerCase():n,t===s&&!0===_.get(e,"oAuth2Pkce.enabled")&&(n=s),n===t}function O(e,t,n,i,r,a,c,p,u){if(P(r,l))S(e=E(t,r,a,null,c,p),t,n,i,r,a,c,p,u);else if(P(r,s)){v=new Uint32Array(28),window.crypto.getRandomValues(v),o=Array.from(v,(function(e){return("0"+e.toString(16)).substr(-2)})).join("");if("plain"===_.get(r,"oAuth2Pkce.challengeMethod"))S(e=E(t,r,a,o,c,p),t,n,i,r,a,c,p,u);else{var d=(m=o,f=(new TextEncoder).encode(m),(g=new jsSHA("SHA-256","UINT8ARRAY",{encoding:"UTF8"})).update(f),g.getHash("ARRAYBUFFER"));h=d,S(e=E(t,r,a,btoa(String.fromCharCode.apply(null,new Uint8Array(h))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""),c,p),t,n,i,r,a,c,p,u)}}else S(e,t,n,i,r,a,c,p,u);var h,m,f,g,v}function S(e,t,n,o,r,s,l,c,u){var h;i.hasCordova()?(window.open(e,"_system"),window.OAuthInMobile(t).then((function(e){var i=t+a;e?(localStorage.setItem(i,e),g(t,n,o,null,u,r)):n("error")}))):(h=window.open(e,"_blank",d),function(e,t,n,i,o){p[e]=g.bind(void 0,e,t,n,null,i,o),window.addEventListener("message",p[e],!1)}(t,n,o,u,r),b(h,t,n,r))}function E(e,t,n,o,c,p){r=window.location.href.split("/#/")[0]+"/oAuthCallback.html";var u,d=t.clientId,h=t.scopes.map((function(e){return e.name})).join(" ");!0===i.getWmProjectProperties().isTestRuntime&&(r=location.protocol+"//"+window.location.host+"/studio/oAuthCallback.html"),"MOBILE"===n&&(r=p+"oAuthCallback.html");var m=P(t,l)?l:s;u={providerId:e,suffix:a,requestSourceType:n,flow:m,scheme:c};var f,g=t.authorizationUrl.split("?");f=1===g.length?"?":g.length>1&&""!==g[1]?"&":"";var v,y=t.authorizationUrl+f+"client_id="+d+"&redirect_uri="+r+"&state="+encodeURIComponent(JSON.stringify(u))+"&scope="+encodeURIComponent(h);m===l?v=y+"&response_type="+(t.responseType?t.responseType:"token"):v=y+"&response_type=code&code_challenge="+o+"&code_challenge_method="+_.get(t,"oAuth2Pkce.challengeMethod");return v}function T(e,t,n,o,r,a,c,p,u,d,h){var m=P(p,l)||P(p,s)?e:e.body;a({name:t,url:m,invoke:function(){i.isIE()?w(e,t,n,o,c,p,u,d,h):O(m,t,n,c,p,u,d,h,r)}})}var C=function(e,t){var n=m(e);return t?localStorage.getItem(e+a):localStorage.getItem(n)},A=function(e,t,n,o,r,a,p,u,d,h){var m="WEB";if(e)i.isIE()?w(e,t,n,o,p):O(e,t,n,p,u,m,r);else{if(i.hasCordova()&&(m="MOBILE"),!P(u,l)&&!P(u,s))return function(e,t){var n=c({target:"oauthConfiguration",action:"getAuthorizationUrl",urlParams:{projectId:i._WM_APP_PROJECT.id,providerId:e.providerId},params:{requestSourceType:e.requestSourceType}});return t.send(n)}({providerId:t,requestSourceType:m},r).then((function(e){T(e,t,n,o,r,a,p,u,m,d,h)}));T(e,t,n,o,r,a,p,u,m,d,h)}},R=function(){function e(e){this.httpService=e,this.providers=new n.Subject,this.providersConfig=[]}return e.prototype.getOAuthProvidersAsObservable=function(){return this.providers.asObservable()},e.prototype.addProviderConfig=function(e){_.find(this.providersConfig,{name:e.name})||this.providersConfig.push(e),this.providers.next(this.providersConfig)},e.prototype.removeProviderConfig=function(e){_.remove(this.providersConfig,(function(t){return t.name===e})),this.providers.next(this.providersConfig)},e.prototype.perfromOAuthorization=function(e,t,n,i,o,r,a){A(e,t,n,i,this.httpService,this.addProviderConfig.bind(this),this.removeProviderConfig.bind(this),o,r,a)},e.prototype.getAccessToken=function(e,t){return C(e,t)},e.prototype.removeAccessToken=function(e){h(e)},e}();R.decorators=[{type:t.Injectable}],R.ctorParameters=function(){return[{type:i.AbstractHttpService}]};var I=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[R]}},e}();I.decorators=[{type:t.NgModule,args:[{}]}],e.OAuthModule=I,e.OAuthService=R,e.getAccessToken=C,e.parseConfig=c,e.performAuthorization=A,e.removeAccessToken=h,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@angular/router"),require("@wm/core")):"function"==typeof define&&define.amd?define("@wm/security",["exports","@angular/core","@angular/common","@angular/router","@wm/core"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.security={}),e.ng.core,e.ng.common,e.ng.router,e.wm.core)}(this,(function(e,t,n,i,o){"use strict";var r="wm_xsrf_token",a=function(){function e(e,t,n,i,o){this.injector=e,this.$http=t,this.routerService=n,this.activatedRoute=i,this._location=o,this.requestQueue={}}return e.prototype.isLoaded=function(){return this.config},e.prototype.get=function(){return this.config},e.prototype.load=function(e){var t=this;return this.loadPromise?this.loadPromise:!e&&this.config?Promise.resolve(this.config):(this.loadPromise=new Promise((function(e,n){t.$http.send({url:"./services/security/info",method:"GET"}).then((function(n){t.config=n.body,t.lastLoggedInUser=o.getClonedObject(t.loggedInUser),t.loggedInUser=t.config.userInfo,e(n.body)})).catch((function(e){n(e)})).finally((function(){t.loadPromise=null}))})),this.loadPromise)},e.prototype.getWebConfig=function(e,t){this.get()?o.triggerFn(e,this.get()):this.load().then((function(t){o.triggerFn(e,t)}),t)},e.prototype.getConfig=function(e,t){function n(e,t,n){_.forEach(this.requestQueue[e],(function(e){return o.triggerFn(e[t],n)})),this.requestQueue[e]=null}this.get()?o.triggerFn(e,this.get()):(this.requestQueue.config=this.requestQueue.config||[],this.requestQueue.config.push({success:e,error:t}),this.requestQueue.config.length>1||o.hasCordova()||this.getWebConfig(function(e){e.homePage=o.getWmProjectProperties().homePage,e.userInfo,this.config=e,this.lastLoggedInUser=o.getClonedObject(this.loggedInUser),this.loggedInUser=e.userInfo,n.call(this,"config","success",this.get())}.bind(this),function(e){n.call(this,"config","error",e)}.bind(this)))},e.prototype.getLastLoggedInUsername=function(){return this.lastLoggedInUser&&this.lastLoggedInUser.userName},e.prototype.getCurrentRoutePage=function(){var e=this._location.path(),t=e.indexOf("?");return t=-1===t?e.length:t-1,e.substr(1,t)},e.prototype.getCurrentRouteQueryParam=function(e){var t;return this.activatedRoute.queryParams.subscribe((function(n){t=n[e]})),t},e.prototype.isNoPageLoaded=function(){return!_.isEmpty(this.getCurrentRoutePage())},e.prototype.getPageByLoggedInUser=function(){var e=this;return new Promise((function(t){var n;e.getConfig((function(i){i.securityEnabled&&i.authenticated?(n=i.userInfo.landingPage||o.getWmProjectProperties().homePage,e.isXsrfEnabled()):n=o.getWmProjectProperties().homePage,t(n)}),(function(){t(o.getWmProjectProperties().homePage)}))}))},e.prototype.loadPageByUserRole=function(e){var t=this;return this.getPageByLoggedInUser().then((function(n){(t.isNoPageLoaded()||e)&&(t.getCurrentRoutePage()===n?window.location.reload():t.routerService.navigate(["/"+n]))}))},e.prototype.navigateOnLogin=function(){this.loadPageByUserRole(!0)},e.prototype.getRedirectPage=function(e,t){var n,i=o.getWmProjectProperties().homePage,r=_.get(e,"loginConfig.pageName"),a=t||this.getCurrentRoutePage();return a!==i&&a!==r||(n=this.getCurrentRouteQueryParam("redirectTo"),a=_.isEmpty(n)?void 0:n),a},e.prototype.getRedirectedRouteQueryParams=function(){var e={};return this.activatedRoute.queryParams.subscribe((function(t){_.forEach(t,(function(t,n){e[n]=t}))})),e},e.prototype.getQueryString=function(e){var t=[];return _.forEach(e,(function(e,n){t.push(n+"="+e)})),_.join(t,"&")},e.prototype.appLogin=function(e,t,n){var i=this,a="";return _.each(e,(function(e,t){a+=(a?"&":"")+encodeURIComponent(t)+"="+encodeURIComponent(e)})),this.$http.send({method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},url:"j_spring_security_check",data:a}).then((function(e){var n=e.body?e.body.wm_xsrf_token:"";n&&o.hasCordova()&&localStorage.setItem(r,n||""),i.injector.get(o.App).notify("userLoggedIn",{}),o.triggerFn(t,e)}),n)},e.prototype.isAuthenticated=function(e,t){this.getConfig((function(t){o.triggerFn(e,t.authenticated)}),t)},e.prototype.appLogout=function(e,t){var n=this;return this.$http.send({target:"Security",url:"j_spring_security_logout",method:"POST",responseType:"text",byPassResult:!0}).then((function(t){_.set(n.get(),"authenticated",!1),_.set(n.get(),"userInfo",null),n.injector.get(o.App).notify("userLoggedOut",{}),o.triggerFn(e,t)}),t)},e.prototype.getCookieByName=function(e){return"cookie"},e.prototype.isXsrfEnabled=function(){return o.hasCordova()?localStorage.getItem(r):this.getCookieByName(r)},e.prototype.onUserLogin=function(){var e=this;return new Promise((function(t,n){e.getConfig((function(n){if(n.securityEnabled)if(n.authenticated)t();else var i=e.injector.get(o.App).subscribe("userLoggedIn",(function(){t(),i()}));else t()}),n)}))},e.prototype.getLoggedInUser=function(){var e=this;return new Promise((function(t,n){e.getConfig((function(e){e&&e.userInfo?t(e.userInfo):n()}),n)}))},e.prototype.authInBrowser=function(){return Promise.reject("This authInBrowser should not be called")},e}();a.decorators=[{type:t.Injectable}],a.ctorParameters=function(){return[{type:t.Injector},{type:o.AbstractHttpService},{type:i.Router},{type:i.ActivatedRoute},{type:n.Location}]};var s=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[a]}},e}();s.decorators=[{type:t.NgModule,args:[{}]}],e.SecurityModule=s,e.SecurityService=a,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/core"),require("@wm/security"),require("@wavemaker/focus-trap/dist/focus-trap"),require("@angular/platform-browser"),require("rxjs"),require("rxjs/operators"),require("@angular/forms"),require("@swipey")):"function"==typeof define&&define.amd?define("@wm/components/base",["exports","@angular/core","@angular/common","@wm/core","@wm/security","@wavemaker/focus-trap/dist/focus-trap","@angular/platform-browser","rxjs","rxjs/operators","@angular/forms","@swipey"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.base={}),e.ng.core,e.ng.common,e.wm.core,e.wm.security,e.focusTrap,e.ng.platformBrowser,e.rxjs,e.rxjs.operators,e.ng.forms,e.swipey)}(this,(function(e,t,n,i,o,r,a,s,l,c,p){"use strict";
|
|
29
|
+
***************************************************************************** */var s=function(e,t){return(s=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 l(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}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}Object.create;function c(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}var p;Object.create;!function(e){e[e.Sent=0]="Sent",e[e.UploadProgress=1]="UploadProgress",e[e.ResponseHeader=2]="ResponseHeader",e[e.DownloadProgress=3]="DownloadProgress",e[e.Response=4]="Response",e[e.User=5]="User"}(p||(p={}));var u=function(e){function t(t){var n=e.call(this)||this;return n.httpClient=t,n.nonBodyTypeMethods=["GET","DELETE","HEAD","OPTIONS","JSONP"],n.sessionTimeoutObservable=new r.Subject,n.sessionTimeoutQueue=[],n}return l(t,e),t.prototype.handleSessionTimeout=function(e,t){this.sessionTimeoutQueue.push({requestInfo:e,sub401:t}),this.on401()},t.prototype.generateRequest=function(e){var t,n,r=new i.HttpHeaders,a=new i.HttpParams,s=e.headers,l=e.params,p=e.responseType,u=e.withCredentials;e.isDirectCall||(r=r.append("X-Requested-With","XMLHttpRequest")),s&&Object.entries(s).forEach((function(e){var t=c(e,2),n=t[0],i=t[1];(o.isNumber(i)||o.isBoolean(i))&&(i=i.toString()),r=r.append(n,i)})),l&&Object.entries(l).forEach((function(e){var t=c(e,2),n=t[0],i=t[1];return a=a.append(n,i)}));var d={headers:r,params:a,responseType:p,withCredentials:u};return _.includes(this.nonBodyTypeMethods,e.method&&e.method.toUpperCase())&&void 0===e.data?(t=d,n=null):(t=e.data,n=d),new i.HttpRequest(e.method,e.url,t,n)},t.prototype.sendCallAsObservable=function(e){var t=this.generateRequest(e);return this.httpClient.request(t)},t.prototype.sendCall=function(e,t){var n=this;return new Promise((function(i,o){t._observable=n.sendCallAsObservable(e).subscribe((function(e){e&&e.type&&i(e)}),(function(e){o(e)}))}))},t.prototype.send=function(e){var t=this,n=this.generateRequest(e);return new Promise((function(e,i){t.httpClient.request(n).toPromise().then((function(t){e(t)}),(function(n){if(t.isPlatformSessionTimeout(n))n._401Subscriber.asObservable().subscribe((function(t){e(t)}),(function(e){i(e)}));else{var o=a.getErrMessage(n,t.getLocale());i({error:o,details:n})}}))}))},t.prototype.cancel=function(e,t){e._observable&&e._observable.unsubscribe(),t&&t._uploadProgress&&t._uploadProgress.unsubscribe()},t.prototype.setLocale=function(e){this.localeObject=e},t.prototype.getLocale=function(){return this.localeObject},t.prototype.getHeader=function(e,t){return e.headers.get(t)},t.prototype.isPlatformSessionTimeout=function(e){return 401===e.status&&"Session Not Found"===this.getHeader(e,"x-wm-login-errormessage")},t.prototype.get=function(e,t){return(t=t||{}).url=e,t.method="get",this.send(t).then((function(e){return e.body}))},t.prototype.post=function(e,t,n){return(n=n||{}).url=e,n.method="post",n.data=t,this.send(n)},t.prototype.put=function(e,t,n){return(n=n||{}).url=e,n.method="put",n.data=t,this.send(n)},t.prototype.patch=function(e,t,n){return(n=n||{}).url=e,n.method="patch",n.data=t,this.send(n)},t.prototype.delete=function(e,t){return(t=t||{}).url=e,t.method="delete",this.send(t)},t.prototype.head=function(e,t){return(t=t||{}).url=e,t.method="head",this.send(t)},t.prototype.jsonp=function(e,t){return(t=t||{}).url=e,t.method="jsonp",this.send(t)},t.prototype.upload=function(e,t,n){var o=new i.HttpRequest("POST",e,t,{reportProgress:!0});return this.httpClient.request(o)},t.prototype.uploadFile=function(e,t,n,i){var o=this;return new Promise((function(r,a){n.request=o.upload(e,t,i).subscribe((function(e){if(e.type===p.UploadProgress){var t=Math.round(100*e.loaded/e.total);i.notify(t)}e.type===p.Response&&r(e.body)}),(function(e){a(e)}))}))},t.prototype.registerOnSessionTimeout=function(e){this.sessionTimeoutObservable.asObservable().subscribe(e)},t.prototype.on401=function(){this.sessionTimeoutObservable.next()},t.prototype.pushToSessionFailureQueue=function(e){this.sessionTimeoutQueue.push({callback:e})},t.prototype.executeSessionFailureRequests=function(){var e=this.sessionTimeoutQueue,t=this;t.sessionTimeoutQueue=[],e.forEach((function(e){_.isFunction(e.callback)?e.callback():(e.requestInfo.headers.headers.delete("x-wm-xsrf-token"),t.httpClient.request(e.requestInfo).subscribe((function(t){t&&t.type&&e.sub401&&e.sub401.next(t)}),(function(t){e.sub401.error(t)})))}))},t}(o.AbstractHttpService);u.decorators=[{type:t.Injectable}],u.ctorParameters=function(){return[{type:i.HttpClient}]};var d=function(){function e(){this.headers=[]}return e.prototype.wmToAngularRequest=function(e){var t;return(t=(t=new i.HttpRequest(e.method,e.url)).clone()).body=e.body,t.method=e.method,t.responseType=e.responseType,t.reportProgress=e.reportProgress,t.urlWithParams=e.url,t.withCredentials=e.withCredentials,e.headers.forEach((function(e,n){t.headers=t.headers.append(n,e)})),t},e.prototype.angularToWmRequest=function(t){var n=new e,i=new Map;return n.body=t.body,n.method=t.method,n.responseType=t.responseType,n.reportProgress=t.reportProgress,n.url=t.urlWithParams,n.withCredentials=t.withCredentials,t.headers.keys().forEach((function(e){i.set(e,t.headers.headers.get(e.toLowerCase())[0])})),n.headers=i,n},e}(),h=function(e){function t(){return e.call(this)||this}return l(t,e),t.prototype.wmToAngularResponse=function(e){var t;return(t=(t=new i.HttpResponse).clone()).body=e.body,t.error=e.error,t.message=e.message,t.url=e.url,t.ok=e.ok,t.status=e.status,t.statusText=e.statusText,e.headers.forEach((function(e,n){t.headers=t.headers.append(n,e)})),t},t.prototype.angularToWmResponse=function(e){var n,i=new Map;return(n=new t).body=e.body,n.error=e.error,n.message=e.message,n.url=e.url,n.ok=e.ok,n.status=e.status,n.statusText=e.statusText,e.headers.keys().forEach((function(t){i.set(t,e.headers.headers.get(t.toLowerCase())[0])})),n.headers=i,n},t}(d),m=function(){function e(){}return e.forRoot=function(){return{ngModule:n.CommonModule,providers:[{provide:o.AbstractHttpService,useClass:u}]}},e}();m.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.HttpClientModule],declarations:[]}]}],e.HttpServiceImpl=u,e.HttpServiceModule=m,e.WmHttpRequest=d,e.WmHttpResponse=h,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("rxjs"),require("@wm/core")):"function"==typeof define&&define.amd?define("@wm/oAuth",["exports","@angular/core","rxjs","@wm/core"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.oAuth={}),e.ng.core,e.rxjs,e.wm.core)}(this,(function(e,t,n,i){"use strict";var o,r,a=".access_token",s="pkce",l="implicit",c=function(e){var t,n,i,o=e.urlParams;if(i={url:"services/oauth2/:providerId/authorizationUrl",method:"GET"},e.config)for(var r in i.url=(e.config.url||"")+i.url,i.method=e.config.method||i.method,i.headers=i.headers||{},e.config.headers)t=e.config.headers[r],i.headers[r]=t;if(o)for(n in o)o.hasOwnProperty(n)&&(t=o[n],_.isUndefined(t)||null===t||(i.url=i.url.replace(new RegExp(":"+n,"g"),t)));return e.params&&(i.params=e.params),_.isUndefined(e.data)||(i.data=e.data),e.dataParams&&(i.data.params=e.dataParams),e.headers&&(i.headers=e.headers),i.byPassResult=e.byPassResult,i.isDirectCall=e.isDirectCall,i.isExtURL=e.isExtURL,i.preventMultiple=e.preventMultiple,i.responseType=e.responseType,i},p={},u="WM_RUN_",d="width=400,height=600",h=function(e){var t=m(e);localStorage.removeItem(t)};function m(e){return u+i._WM_APP_PROJECT.id+"_"+e+a}function f(e,t){var n=m(e);localStorage.setItem(n,t)}function g(e,t,n,i,l,c){var p=e+a,u=localStorage.getItem(p);if((!i||i.origin===window.location.origin)&&u)if(P(c,s)){var d="client_id="+c.clientId+"&code="+u+"&grant_type=authorization_code&code_verifier="+o+"&redirect_uri="+r;l.send({method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},url:c.accessTokenUrl,data:d}).then((function(i){v(e,t,n,p,i.body.access_token)}))}else v(e,t,n,p,u)}function v(e,t,n,i,o){n(e),localStorage.removeItem(i),f(e,o),window.removeEventListener("message",p[e]),setTimeout((function(){delete p[e],t&&t(o)}))}function y(e,t,n,i,o,r){var s;s="dummy_key",localStorage.setItem(s,s),localStorage.removeItem(s);var l=moment.duration(moment().format("HH:mm"),"HH:mm").subtract(i),c=C(e,!0);c?(o.accesstoken_retrieved=!0,f(e,c),localStorage.removeItem(e+a),r(e),t&&t()):l.minutes()>1&&t&&!o.accesstoken_retrieved?t("error"):setTimeout((function(){y(e,t,n,i,o,r)}),3e3)}function b(e,t,n,i){e&&p[t]&&(e.closed?P(i,s)||(window.removeEventListener("message",p[t]),delete p[t],n&&n("error")):setTimeout(b.bind(void 0,e,t,n,i),3e3))}function w(e,t,n,i,o,r,a,s,c){P(r,l)&&(e=E(t,r,a,null,s,c)),window.open(e,"_blank",d),y(t,n,i,moment.duration(moment().format("HH:mm"),"HH:mm"),{accesstoken_retrieved:!1},o)}function P(e,t){var n=_.get(e,"oauth2Flow");return n=n?n.toLowerCase():n,t===s&&!0===_.get(e,"oAuth2Pkce.enabled")&&(n=s),n===t}function O(e,t,n,i,r,a,c,p,u){if(P(r,l))S(e=E(t,r,a,null,c,p),t,n,i,r,a,c,p,u);else if(P(r,s)){v=new Uint32Array(28),window.crypto.getRandomValues(v),o=Array.from(v,(function(e){return("0"+e.toString(16)).substr(-2)})).join("");if("plain"===_.get(r,"oAuth2Pkce.challengeMethod"))S(e=E(t,r,a,o,c,p),t,n,i,r,a,c,p,u);else{var d=(m=o,f=(new TextEncoder).encode(m),(g=new jsSHA("SHA-256","UINT8ARRAY",{encoding:"UTF8"})).update(f),g.getHash("ARRAYBUFFER"));h=d,S(e=E(t,r,a,btoa(String.fromCharCode.apply(null,new Uint8Array(h))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""),c,p),t,n,i,r,a,c,p,u)}}else S(e,t,n,i,r,a,c,p,u);var h,m,f,g,v}function S(e,t,n,o,r,s,l,c,u){var h;i.hasCordova()?(window.open(e,"_system"),window.OAuthInMobile(t).then((function(e){var i=t+a;e?(localStorage.setItem(i,e),g(t,n,o,null,u,r)):n("error")}))):(h=window.open(e,"_blank",d),function(e,t,n,i,o){p[e]=g.bind(void 0,e,t,n,null,i,o),window.addEventListener("message",p[e],!1)}(t,n,o,u,r),b(h,t,n,r))}function E(e,t,n,o,c,p){r=window.location.href.split("/#/")[0]+"/oAuthCallback.html";var u,d=t.clientId,h=t.scopes.map((function(e){return e.name})).join(" ");!0===i.getWmProjectProperties().isTestRuntime&&(r=location.protocol+"//"+window.location.host+"/studio/oAuthCallback.html"),"MOBILE"===n&&(r=p+"oAuthCallback.html");var m=P(t,l)?l:s;u={providerId:e,suffix:a,requestSourceType:n,flow:m,scheme:c};var f,g=t.authorizationUrl.split("?");f=1===g.length?"?":g.length>1&&""!==g[1]?"&":"";var v,y=t.authorizationUrl+f+"client_id="+d+"&redirect_uri="+r+"&state="+encodeURIComponent(JSON.stringify(u))+"&scope="+encodeURIComponent(h);m===l?v=y+"&response_type="+(t.responseType?t.responseType:"token"):v=y+"&response_type=code&code_challenge="+o+"&code_challenge_method="+_.get(t,"oAuth2Pkce.challengeMethod");return v}function T(e,t,n,o,r,a,c,p,u,d,h){var m=P(p,l)||P(p,s)?e:e.body;a({name:t,url:m,invoke:function(){i.isIE()?w(e,t,n,o,c,p,u,d,h):O(m,t,n,c,p,u,d,h,r)}})}var C=function(e,t){var n=m(e);return t?localStorage.getItem(e+a):localStorage.getItem(n)},A=function(e,t,n,o,r,a,p,u,d,h){var m="WEB";if(e)i.isIE()?w(e,t,n,o,p):O(e,t,n,p,u,m,r);else{if(i.hasCordova()&&(m="MOBILE"),!P(u,l)&&!P(u,s))return function(e,t){var n=c({target:"oauthConfiguration",action:"getAuthorizationUrl",urlParams:{projectId:i._WM_APP_PROJECT.id,providerId:e.providerId},params:{requestSourceType:e.requestSourceType}});return t.send(n)}({providerId:t,requestSourceType:m},r).then((function(e){T(e,t,n,o,r,a,p,u,m,d,h)}));T(e,t,n,o,r,a,p,u,m,d,h)}},R=function(){function e(e){this.httpService=e,this.providers=new n.Subject,this.providersConfig=[]}return e.prototype.getOAuthProvidersAsObservable=function(){return this.providers.asObservable()},e.prototype.addProviderConfig=function(e){_.find(this.providersConfig,{name:e.name})||this.providersConfig.push(e),this.providers.next(this.providersConfig)},e.prototype.removeProviderConfig=function(e){_.remove(this.providersConfig,(function(t){return t.name===e})),this.providers.next(this.providersConfig)},e.prototype.perfromOAuthorization=function(e,t,n,i,o,r,a){A(e,t,n,i,this.httpService,this.addProviderConfig.bind(this),this.removeProviderConfig.bind(this),o,r,a)},e.prototype.getAccessToken=function(e,t){return C(e,t)},e.prototype.removeAccessToken=function(e){h(e)},e}();R.decorators=[{type:t.Injectable}],R.ctorParameters=function(){return[{type:i.AbstractHttpService}]};var I=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[R]}},e}();I.decorators=[{type:t.NgModule,args:[{}]}],e.OAuthModule=I,e.OAuthService=R,e.getAccessToken=C,e.parseConfig=c,e.performAuthorization=A,e.removeAccessToken=h,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@angular/router"),require("@wm/core")):"function"==typeof define&&define.amd?define("@wm/security",["exports","@angular/core","@angular/common","@angular/router","@wm/core"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.security={}),e.ng.core,e.ng.common,e.ng.router,e.wm.core)}(this,(function(e,t,n,i,o){"use strict";var r="wm_xsrf_token",a=function(){function e(e,t,n,i,o){this.injector=e,this.$http=t,this.routerService=n,this.activatedRoute=i,this._location=o,this.requestQueue={}}return e.prototype.isLoaded=function(){return this.config},e.prototype.get=function(){return this.config},e.prototype.load=function(e){var t=this;return this.loadPromise?this.loadPromise:!e&&this.config?Promise.resolve(this.config):(this.loadPromise=new Promise((function(e,n){t.$http.send({url:"./services/security/info",method:"GET"}).then((function(n){t.config=n.body,t.lastLoggedInUser=o.getClonedObject(t.loggedInUser),t.loggedInUser=t.config.userInfo,e(n.body)})).catch((function(e){n(e)})).finally((function(){t.loadPromise=null}))})),this.loadPromise)},e.prototype.getWebConfig=function(e,t){this.get()?o.triggerFn(e,this.get()):this.load().then((function(t){o.triggerFn(e,t)}),t)},e.prototype.getConfig=function(e,t){function n(e,t,n){_.forEach(this.requestQueue[e],(function(e){return o.triggerFn(e[t],n)})),this.requestQueue[e]=null}this.get()?o.triggerFn(e,this.get()):(this.requestQueue.config=this.requestQueue.config||[],this.requestQueue.config.push({success:e,error:t}),this.requestQueue.config.length>1||o.hasCordova()||this.getWebConfig(function(e){e.homePage=o.getWmProjectProperties().homePage,e.userInfo,this.config=e,this.lastLoggedInUser=o.getClonedObject(this.loggedInUser),this.loggedInUser=e.userInfo,n.call(this,"config","success",this.get())}.bind(this),function(e){n.call(this,"config","error",e)}.bind(this)))},e.prototype.getLastLoggedInUsername=function(){return this.lastLoggedInUser&&this.lastLoggedInUser.userName},e.prototype.getCurrentRoutePage=function(){var e=this._location.path(),t=e.indexOf("?");return t=-1===t?e.length:t-1,e.substr(1,t)},e.prototype.getCurrentRouteQueryParam=function(e){var t;return this.activatedRoute.queryParams.subscribe((function(n){t=n[e]})),t},e.prototype.isNoPageLoaded=function(){return!_.isEmpty(this.getCurrentRoutePage())},e.prototype.getPageByLoggedInUser=function(){var e=this;return new Promise((function(t){var n;e.getConfig((function(i){i.securityEnabled&&i.authenticated?(n=i.userInfo.landingPage||o.getWmProjectProperties().homePage,e.isXsrfEnabled()):n=o.getWmProjectProperties().homePage,t(n)}),(function(){t(o.getWmProjectProperties().homePage)}))}))},e.prototype.loadPageByUserRole=function(e){var t=this;return this.getPageByLoggedInUser().then((function(n){(t.isNoPageLoaded()||e)&&(t.getCurrentRoutePage()===n?window.location.reload():t.routerService.navigate(["/"+n]))}))},e.prototype.navigateOnLogin=function(){this.loadPageByUserRole(!0)},e.prototype.getRedirectPage=function(e,t){var n,i=o.getWmProjectProperties().homePage,r=_.get(e,"loginConfig.pageName"),a=t||this.getCurrentRoutePage();return a!==i&&a!==r||(n=this.getCurrentRouteQueryParam("redirectTo"),a=_.isEmpty(n)?void 0:n),a},e.prototype.getRedirectedRouteQueryParams=function(){var e={};return this.activatedRoute.queryParams.subscribe((function(t){_.forEach(t,(function(t,n){e[n]=t}))})),e},e.prototype.getQueryString=function(e){var t=[];return _.forEach(e,(function(e,n){t.push(n+"="+e)})),_.join(t,"&")},e.prototype.appLogin=function(e,t,n){var i=this,a="";return _.each(e,(function(e,t){a+=(a?"&":"")+encodeURIComponent(t)+"="+encodeURIComponent(e)})),this.$http.send({method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},url:"j_spring_security_check",data:a}).then((function(e){var n=e.body?e.body.wm_xsrf_token:"";n&&o.hasCordova()&&localStorage.setItem(r,n||""),i.injector.get(o.App).notify("userLoggedIn",{}),o.triggerFn(t,e)}),n)},e.prototype.isAuthenticated=function(e,t){this.getConfig((function(t){o.triggerFn(e,t.authenticated)}),t)},e.prototype.appLogout=function(e,t){var n=this;return this.$http.send({target:"Security",url:"j_spring_security_logout",method:"POST",responseType:"text",byPassResult:!0}).then((function(t){_.set(n.get(),"authenticated",!1),_.set(n.get(),"userInfo",null),n.injector.get(o.App).notify("userLoggedOut",{}),o.triggerFn(e,t)}),t)},e.prototype.getCookieByName=function(e){return"cookie"},e.prototype.isXsrfEnabled=function(){return o.hasCordova()?localStorage.getItem(r):this.getCookieByName(r)},e.prototype.onUserLogin=function(){var e=this;return new Promise((function(t,n){e.getConfig((function(n){if(n.securityEnabled)if(n.authenticated)t();else var i=e.injector.get(o.App).subscribe("userLoggedIn",(function(){t(),i()}));else t()}),n)}))},e.prototype.getLoggedInUser=function(){var e=this;return new Promise((function(t,n){e.getConfig((function(e){e&&e.userInfo?t(e.userInfo):n()}),n)}))},e.prototype.authInBrowser=function(){return Promise.reject("This authInBrowser should not be called")},e}();a.decorators=[{type:t.Injectable}],a.ctorParameters=function(){return[{type:t.Injector},{type:o.AbstractHttpService},{type:i.Router},{type:i.ActivatedRoute},{type:n.Location}]};var s=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[a]}},e}();s.decorators=[{type:t.NgModule,args:[{}]}],e.SecurityModule=s,e.SecurityService=a,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/core"),require("@wm/security"),require("@wavemaker/focus-trap/dist/focus-trap"),require("@angular/platform-browser"),require("rxjs"),require("rxjs/operators"),require("@angular/forms"),require("@swipey")):"function"==typeof define&&define.amd?define("@wm/components/base",["exports","@angular/core","@angular/common","@wm/core","@wm/security","@wavemaker/focus-trap/dist/focus-trap","@angular/platform-browser","rxjs","rxjs/operators","@angular/forms","@swipey"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.base={}),e.ng.core,e.ng.common,e.wm.core,e.wm.security,e.focusTrap,e.ng.platformBrowser,e.rxjs,e.rxjs.operators,e.ng.forms,e.swipey)}(this,(function(e,t,n,i,o,r,a,s,l,c,p){"use strict";
|
|
30
30
|
/*! *****************************************************************************
|
|
31
31
|
Copyright (c) Microsoft Corporation.
|
|
32
32
|
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
41
41
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
42
42
|
PERFORMANCE OF THIS SOFTWARE.
|
|
43
|
-
***************************************************************************** */var u=function(e,t){return(u=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 d(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}u(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function h(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{l(i.next(e))}catch(e){r(e)}}function s(e){try{l(i.throw(e))}catch(e){r(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(a,s)}l((i=i.apply(e,t||[])).next())}))}function m(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}}Object.create;function f(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 g(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function v(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o<r;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 y=function(){},b=function(){},w=new t.InjectionToken("Context Provider Reference"),P=new Set([i.FormWidgetType.SELECT,i.FormWidgetType.CHECKBOXSET,i.FormWidgetType.RADIOSET,i.FormWidgetType.SWITCH,i.FormWidgetType.AUTOCOMPLETE,i.FormWidgetType.CHIPS,i.FormWidgetType.TYPEAHEAD,i.FormWidgetType.RATING]),O=function(e){var t,n,i,o,r,a,s,l,c,p="";for(e=e.replace(/\$\[data\[\$i\]/g,"$[__1"),i=0;i<e.length;i++)if(t=e[i],n=e[i+1],"$"===t&&"["===n){for(a=1,c=!1,s=!1,o=i+2;o<e.length;o++)if(" "!==(r=e[o])&&(c||(s='"'===e[o]||"'"===e[o],c=!0),"["===r?a++:"]"===r&&a--,!a)){l=e.substring(i+2,o),p+=s?"__1["+l+"]":l;break}i=o}else p+=t;return p},S=function(e,t){var n;return t?(t.replace(/\[(\w+)\]/g,".$1").split(".").forEach((function(t){n=n&&n[t]||(_.isNull(e)?e:e[t])})),n):e},E=function(e,t,n){var o,r=t.field,a=t.expression,s=t.bindExpression;return s?(o=s.replace("bind:",""),i.checkIsCustomPipeExpression(o)&&(o+=": __1"),o=O(o)):o=a||r,s||a?i.$parseExpr(o)(n,Object.assign({},e,{__1:e})):_.get(e,r)},T=function(e,t){return!(!e||!t)&&(t=-1===t.indexOf("?")?t:t.substring(0,t.indexOf("?")),e=-1===e.indexOf("?")?e:e.substring(0,e.indexOf("?")),new RegExp("^(#/|#)"+t+"$").test(e))},C=function(e,t){return e.some((function(e){return!!T(e.link,t)||(e.children?C(e.children,t):void 0)}))},A=function(e){return P.has(e)},R=function(e,t,n){return i.isValidWebURL(e)||(e||(e=n||"resources/images/imagelists/default-image.png"),e=t?i.encodeUrl(e):e,i.stringStartsWith(e,"services/prefabs")),e},I=function(e){return""===e||"none"===e?e:"url("+R(e)+")"};function D(e,n,i){return{provide:n,useExisting:t.forwardRef((function(){return e})),multi:i}}function N(e){return D(e,y)}var x,k=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.join("_")},M={number:["number","integer","big_integer","short","float","big_decimal","double","long","byte"],string:["string","text"],character:["character"],date:["date","time","timestamp","datetime"]},L={number:["exact","notequals","lessthan","lessthanequal","greaterthan","greaterthanequal","null","isnotnull"],string:["anywhereignorecase","anywhere","startignorecase","start","endignorecase","end","exactignorecase","exact","notequalsignorecase","notequals","null","isnotnull","empty","isnotempty","nullorempty"],character:["exactignorecase","exact","notequalsignorecase","notequals","null","isnotnull","empty","isnotempty","nullorempty"],date:["exact","lessthan","lessthanequal","greaterthan","greaterthanequal","null","notequals","isnotnull"]},F={boolean:["exact","null","isnotnull"],clob:[],blob:[]},j=function(e){var t=[];return _.isArray(e)?(e.forEach((function(e){t=t.concat(j(e))})),t):_.isObject(e)?(_.forEach(e,(function(e,n){e&&(t=t.concat(n.split(" ")))})),t):void 0},B=function(e,t){var n,i,o=e.toAdd||e,r=e.toRemove||t;return _.isObject(e)?(n=_.isArray(o)?o:j(o||[]),i=r?_.isArray(r)?r:j(r):[]):(n=o?[o]:[],i=r?[r]:[]),{toAdd:n,toRemove:i}},G=function(e,t,n,o){var r,a,s,l,c,p;o||(o={}),_.forEach(e,(function(e,u){_.includes(u,".")&&(l=_.split(u,"."),a=l[0],s=l[1],p=!0),o.noModifyTitle?r=u:_.isString(u)?(r=i.prettifyLabel(u),r=i.deHyphenate(r),r=n?i.initCaps(n)+" "+r:r):r=u,u=n?n+"."+u:u,c=p?(c=_.split(r," ")).length>1?c[c.length-2]+" "+c[c.length-1]:c[0]:r;var d=o.setBindingField?{displayName:c,field:u,relatedTable:a,relatedField:s||r}:{displayName:c,relatedTable:a,relatedField:s||r};if(!_.isObject(e)||_.isArray(e)&&!e[0]){if(o.upperBound&&o.columnCount===o.upperBound)return;t.terminals.push(d),o.columnCount+=1}else o.columnCount!==o.upperBound&&t.objects.push(d),_.isArray(e)&&e[0]?G(e[0],t,u+"[0]",o):G(e,t,u,o)}))},V=function(e){var t;return _.isArray(e)?_.isObject(e[0])?(t=i.getClonedObject(e[0]),_.forEach(e,(function(e,n){if(n+1>=10)return!1;_.assignWith(t,e,(function(e,t){return null==e?t:e}))}))):t=e[0]:t=e,t};e.APPLY_STYLES_TYPE=void 0,(x=e.APPLY_STYLES_TYPE||(e.APPLY_STYLES_TYPE={}))[x.CONTAINER=0]="CONTAINER",x[x.SCROLLABLE_CONTAINER=1]="SCROLLABLE_CONTAINER",x[x.INNER_SHELL=2]="INNER_SHELL",x[x.SHELL=3]="SHELL";var U={backgroundattachment:"backgroundAttachment",backgroundcolor:"backgroundColor",backgroundgradient:"backgroundGradient",backgroundimage:"backgroundImage",backgroundposition:"backgroundPosition",backgroundrepeat:"backgroundRepeat",backgroundsize:"backgroundSize",bordercolor:"borderColor",borderradius:"borderRadius",borderstyle:"borderStyle",borderwidth:"borderWidth",borderbottomwidth:"borderBottomWidth",borderleftwidth:"borderLeftWidth",borderrightwidth:"borderRightWidth",bordertopwidth:"borderTopWidth",color:"color",cursor:"cursor",display:"display",fontsize:"fontSize",fontfamily:"fontFamily",fontstyle:"fontStyle",fontunit:"fontunit",fontvariant:"fontVariant",fontweight:"fontWeight",height:"height",horizontalalign:"textAlign",lineheight:"lineHeight",margin:"margin",marginbottom:"marginBottom",marginleft:"marginLeft",marginright:"marginRight",margintop:"marginTop",opacity:"opacity",overflow:"overflow",padding:"padding",paddingbottom:"paddingBottom",paddingleft:"paddingLeft",paddingright:"paddingRight",paddingtop:"paddingTop",picturesource:"backgroundImage",textalign:"textAlign",textdecoration:"textDecoration",verticalalign:"verticalAlign",visibility:"visibility",whitespace:"whiteSpace",width:"width",wordbreak:"wordbreak",zindex:"zIndex"},W=function(e){return!!U[e]},q={height:!0,overflow:!0,padding:!0,paddingbottom:!0,paddingleft:!0,paddingright:!0,paddingtop:!0},z={textalign:!0},H={textalign:!0,width:!0};function Y(t,n,o,r){var a=Object.create(null);r&&r.forEach((function(e){return a[e]=!0})),n.registerStyleChangeListener((function(r,s){if(!(a[r]||o===e.APPLY_STYLES_TYPE.SHELL&&q[r])){if(o===e.APPLY_STYLES_TYPE.INNER_SHELL){if(!q[r])return;"height"===r&&i.setCSS(t,"overflow",s?"auto":"")}if(o!==e.APPLY_STYLES_TYPE.CONTAINER||!z[r]){if(o===e.APPLY_STYLES_TYPE.SCROLLABLE_CONTAINER){if(H[r])return;"height"===r&&i.setCSS(t,"overflow",s?"auto":"")}"fontsize"===r||"fontunit"===r?i.setCSS(t,"fontSize",""===n.fontsize?"":n.fontsize+(n.fontunit||"px")):"backgroundimage"===r?i.setCSS(t,"backgroundImage",n.picturesource||I(s)):U[r]&&i.setCSS(t,U[r],s)}}}))}var K,Q="wm-form-field-",X=function(){var e=new Map;for(var t in i.FormWidgetType)e.set(Q+i.FormWidgetType[t],new Map);return e}(),J=function(e){return X.get(e)},Z=function(e,t){X.set(e,t),window.WM_LOADED_COMPONENTS=v(v([],g(window.WM_LOADED_COMPONENTS||[])),[e])};e.PROP_TYPE=void 0,(K=e.PROP_TYPE||(e.PROP_TYPE={}))[K.BOOLEAN=1]="BOOLEAN",K[K.NUMBER=2]="NUMBER",K[K.STRING=3]="STRING";var ee={type:e.PROP_TYPE.STRING},te={type:e.PROP_TYPE.NUMBER},ne={type:e.PROP_TYPE.BOOLEAN},ie={arrayType:!0},oe=function(){Z("wm-container",new Map([["animation",ee],["class",ee],["conditionalclass",ie],["conditionalstyle",ie],["content",ee],["name",ee],["show",Object.assign({value:!0},ne)]]))},re=new Map,ae=new i.IDGenerator("widget-id"),se=new Map([["tap","click"]]),le={BLOCK:"block",INLINE_BLOCK:"inline-block",INLINE:"inline"},ce=new Set(["readonly","autofocus","disabled","startchecked","multiple","selected","required","controls","autoplay","loop","muted","show"]),pe=function(e){return ce.has(e)},ue=new Set(["width","height","iconheight","iconwidth","popoverwidth","popoverheight","imagewidth","imageheight"]),de=function(e){return ue.has(e)},he=function(t,n,o){return o===e.PROP_TYPE.BOOLEAN?i.toBoolean(n,pe(t)&&t):o===e.PROP_TYPE.NUMBER?+n:n},me=function(e,t,n){var o=e.widgetId,r=e[t];i.isChangeFromWatch()||i.$unwatch(k(o,t)),i.resetChangeFromWatch();var a=J(e.getWidgetSubType()).get(t);if(a){var s=a.type;s&&(n=he(t,n,s))}if(n!==r||i.isObject(n)||i.isObject(r)){if(de(t))n=i.toDimension(n);else if(_.startsWith(n,"resources/")){var l=e;void 0===l._parentPrefab_&&(l._parentPrefab_=e.$element.parent().closest('[prefabname][prefabname!="__self__"]').attr("prefabname")||""),l._parentPrefab_?n="./app/prefabs/"+l._parentPrefab_+"/"+n:a&&n!=a.value&&(n="./"+n)}e[t]=n,W(t)?e.notifyStyleChange(t,n,r):("conditionalclass"===t&&(n=B(n,r)),a&&e.notifyPropertyChange(t,n,r)),i.$appDigest()}},fe={set:function(e,t,n){return me(e,t,n),!0},get:function(e,t){var n=e[t];return _.isFunction(n)?n.bind(e):n}},ge=window.requestAnimationFrame,ve=[],ye=function(e){ve.length||ge((function(){ve.forEach((function(e){return e()})),ve.length=0})),ve.push(e)},be=function(){function e(){}return e.create=function(e,t,n){if(window.Proxy)return new Proxy(e,fe);var i=Object.create(e);return ye((function(){for(var t in e)_.isFunction(e[t])&&"constructor"!==t&&"super"!==t&&!_.startsWith(t,"ng")&&(e[t]=e[t].bind(e))})),Object.keys(U).forEach((function(t){Object.defineProperty(i,t,{get:function(){return e[t]},set:function(n){return me(e,t,n)}})})),n&&n.forEach((function(t,n){Object.defineProperty(i,n,{get:function(){return e[n]},set:function(t){return me(e,n,t)}})})),i},e}(),we=function(e,t,n){t&&t.length&&i.removeClass(n,_.join(t," ")),e&&e.length&&i.addClass(n,_.join(e," "))},Pe=function(e,t,n){t&&_.isObject(t)&&Object.keys(t||{}).forEach((function(e){i.setCSS(n,e,"")}));e&&_.isObject(e)&&i.setCSSFromObj(n,e)},_e=function(){function e(e,n,o){var r=this;this.inj=e,this.isAttached=!1,this.styleChange=new s.ReplaySubject,this.propertyChange=new s.Subject,this.readyState=new s.Subject,this.destroy=new s.Subject,this.eventHandlers=new Map,this.toBeSetupEventsQueue=[],this.__cloneable__=!1,this.$attrs=new Map,this.isMuted=!1;var l=e.get(t.ElementRef);this.nativeElement=l.nativeElement,this.widgetType=n.widgetType,this.widgetSubType=n.widgetSubType||n.widgetType,this.viewParent=e.view.component,this.displayType=n.displayType||le.BLOCK,this.context=e.view.context,this.widget=this.createProxy(),this.eventManager=e.get(a.EventManager),this.nativeElement.widget=this.widget,this.appLocale=e.get(i.App).appLocale||{},this.initContext(),n.hostClass&&i.addClass(this.nativeElement,n.hostClass),this.widgetId=this.generateWidgetId(),i.setAttr(this.nativeElement,"widget-id",this.widgetId,!0),this.registerStyleChangeListener(this.onStyleChange,this),this.registerPropertyChangeListener(this.onPropertyChange,this),o?(this.delayedInit=!0,o.then((function(){r.initWidget(),r.setInitProps()}))):this.initWidget()}return Object.defineProperty(e.prototype,"$element",{get:function(){return $(this.nativeElement)},enumerable:!1,configurable:!0}),e.prototype.getNativeElement=function(){return this.nativeElement},e.prototype.getWidgetType=function(){return this.widgetType},e.prototype.getWidgetSubType=function(){return this.widgetSubType},e.prototype.getWidget=function(){return this.widget},e.prototype.setProperty=function(e,t){this.widget[e]=t},e.prototype.getViewParent=function(){return this.viewParent},e.prototype.notifyStyleChange=function(e,t,n){this.styleChange.next({key:e,nv:t,ov:n})},e.prototype.notifyPropertyChange=function(e,t,n){this.propertyChange.next({key:e,nv:t,ov:n})},e.prototype.registerStyleChangeListener=function(e,t){t&&(e=e.bind(t)),this.styleChange.subscribe((function(t){var n=t.key,i=t.nv,o=t.ov;return e(n,i,o)}))},e.prototype.registerReadyStateListener=function(e,t){t&&(e=e.bind(t)),this.readyState.isStopped?e():this.readyState.subscribe((function(){return e()}))},e.prototype.registerPropertyChangeListener=function(e,t){t&&(e=e.bind(t)),this.propertyChange.subscribe((function(t){var n=t.key,i=t.nv,o=t.ov;return e(n,i,o)}))},e.prototype.registerDestroyListener=function(e,t){t&&(e=e.bind(t)),this.destroy.subscribe((function(){}),(function(){}),(function(){return e()}))},e.prototype.getDisplayType=function(){return this.displayType},e.prototype.createProxy=function(){return be.create(this,this.widgetSubType,J(this.widgetSubType))},e.prototype.initContext=function(){var e=this.inj.view.context,t=this.inj.get(w,{});if(this.viewParent!==e?this.context=e:this.context={},t){var n={};_.isArray(t)?_.forEach(t,(function(e){Object.assign(n,e)})):n=t,this.context=Object.assign({},n,this.context)}},e.prototype.setWidgetProperty=function(e,t){this.widget[e]=t},e.prototype.getAttr=function(e){return this.$attrs.get(e)},e.prototype.getAppInstance=function(){return this.inj.get(i.App)},e.prototype.generateWidgetId=function(){return ae.nextUid()},e.prototype.onPropertyChange=function(e,t,n){if("show"===e)this.nativeElement.hidden=!t;else if("hint"===e)i.isMobileApp()||i.setAttr(this.nativeElement,"title",t);else if("class"===e){i.switchClass(this.nativeElement,t,n);var o=t.match(/(\W|^)(h([0-6]))(?=\s|$)/);o&&(i.setAttr(this.nativeElement,"role","heading"),i.setAttr(this.nativeElement,"aria-level",o[3]))}else if("name"===e||"tabindex"===e)i.setAttr(this.nativeElement,e,t),"name"===e&&t&&function(e,t,n,o){i.isDefined(e.Widgets)&&(o&&(e.Widgets[o]=void 0),n&&(e.Widgets[n]=t))}(this.viewParent,this.widget,t,n);else if("conditionalclass"===e)we(t.toAdd,t.toRemove,this.nativeElement);else if("autoplay"===e){var r="wm-audio"===this.widgetType?"audio":"video";this.nativeElement.querySelector(r).load()}else"conditionalstyle"===e?Pe(t,n,this.nativeElement):"animation"===e?i.addClass(this.nativeElement,"animated "+t):"disabled"===e&&(!0===t?i.setAttr(this.nativeElement,"disabled","true",!0):i.removeAttr(this.nativeElement,"disabled",!0))},e.prototype.onStyleChange=function(e,t,n){},e.prototype.registerWidget=function(e){var t,n,o,r,a;this.registerDestroyListener((t=this.widget,n=this.viewParent,o=this.widgetId,r=e,a=!1,re.set(o,t),r&&i.isDefined(n.Widgets)&&(a=!0,n.Widgets[r]=t),function(){re.delete(o),a&&(n.Widgets[r]=void 0)}))},e.prototype.getMappedEventName=function(e){return se.get(e)||e},e.prototype.handleEvent=function(e,t,n,i,o){this.eventManager.addEventListener(e,t,(function(e){if(i.$event=e,"delayed"!==o)return n();setTimeout((function(){return n()}),150)}))},e.prototype.processEventAttr=function(e,t,n){var o=this,r=i.$parseEvent(t),a=this.context;a.widget=this.widget;var s=r.bind(void 0,this.viewParent,a),l=function(){var t;i.$invokeWatchers(!0);try{if(a.$event=a.$event||new window.CustomEvent(e),!((t=s())instanceof Promise))return t;t.then((function(e){return e}),(function(e){return e}))}catch(e){console.error(e)}};this.eventHandlers.set(this.getMappedEventName(e),{callback:l,locals:a}),this[_.camelCase("on-"+e)]=l,this.toBeSetupEventsQueue.push((function(){o.handleEvent(o.nativeElement,o.getMappedEventName(e),l,a,n)}))},e.prototype.processBindAttr=function(e,t){var n=this;this.initState.delete(e),this.registerDestroyListener(i.$watch(t,this.viewParent,this.context,(function(t){return n.widget[e]=t}),k(this.widgetId,e),"datasource"===e,this.widgetProps.get(e),(function(){return n.isMuted})))},e.prototype.removePropertyBinding=function(e){i.$unwatch(k(this.widgetId,e))},e.prototype.invokeEventCallback=function(e,t){var n=this.eventHandlers.get(e);if(n){var i=n.callback,o=n.locals||{};if(i)return i(Object.assign(o,t))}},e.prototype.processAttr=function(e,t){var n=e.split("."),o=n[0],r=n[1],a=n[2],s=n.length;"bind"===r?("show"===o&&(this.nativeElement.hidden=!0),this.processBindAttr(o,t)):"event"===r?this.processEventAttr(o,t,a):1===s&&("class"===e?i.removeClass(this.nativeElement,t):"tabindex"!==e&&"name"!==e||i.removeAttr(this.nativeElement,e),this.initState.set(o,t))},e.prototype.processAttrs=function(){var e,t,n=this.inj.elDef;try{for(var i=f(n.element.attrs),o=i.next();!o.done;o=i.next()){var r=g(o.value,3),a=r[1],s=r[2];this.$attrs.set(a,s),this.processAttr(a,s)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}},e.prototype.initWidget=function(){var e=this;this.initState=new Map;var t=J(this.widgetSubType);t.forEach((function(t,n){i.isDefined(t.value)&&e.initState.set(n,t.value)})),this.widgetProps=t,this.processAttrs(),this.registerWidget(this.initState.get("name"))},e.prototype.setInitProps=function(){var e=this;this.initState.get("name")&&(this.widget.name=this.initState.get("name")),this.initState.forEach((function(t,n){(e.widgetProps.get(n)||W(n))&&"name"!==n&&(e.widget[n]=t)})),this.initState.clear(),this.initState=void 0,this.readyState.next(),this.readyState.complete()},e.prototype.hasEventCallback=function(e){return this.eventHandlers.has(e)},e.prototype.focus=function(){var e=this.$element[0].querySelector("[focus-target]");e||(e=this.$element[0]),e.focus()},e.prototype.execute=function(e,t){},e.prototype.mute=function(){this.isMuted=!0},e.prototype.unmute=function(){this.isMuted=!1},e.prototype.ngOnAttach=function(){this.isAttached=!0},e.prototype.ngOnDetach=function(){this.isAttached=!1},e.prototype.ngOnInit=function(){this.delayedInit||this.setInitProps()},e.prototype.ngAfterViewInit=function(){var e,t;if(this.toBeSetupEventsQueue.length)try{for(var n=f(this.toBeSetupEventsQueue),i=n.next();!i.done;i=n.next()){(0,i.value)()}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}this.toBeSetupEventsQueue.length=0,this.isAttached=!0},e.prototype.ngAfterContentInit=function(){},e.prototype.ngOnDestroy=function(){this.isDestroyed=!0,this.widget=Object.create(null),this.styleChange.complete(),this.propertyChange.complete(),this.destroy.complete(),this.isAttached=!1},e}();_e.decorators=[{type:t.Injectable}],_e.ctorParameters=function(){return[{type:t.Injector},{type:void 0},{type:Promise}]};var Oe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return d(t,e),t}(_e);Oe.decorators=[{type:t.Injectable}];var Se=function(e){this.redraw=function(){var t=e.$element.closest("[wmtabpane]"),n=e.$element.closest("[wmaccordionpane]").find(".panel-heading");if(!(t.length&&!t.hasClass("active")||n.length&&!n.hasClass("active")))return e.redraw&&e.redraw()}};Se.decorators=[{type:t.Directive,args:[{selector:"[redrawable]"}]}],Se.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Self},{type:t.Inject,args:[y]}]}]};var Ee=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return d(t,e),t.prototype.updateRedrawableComponents=function(e){var t=this;_.pickBy(e,(function(e){e&&e.nativeElement&&e.nativeElement.hasAttribute("redrawable")&&!_.includes(t.reDrawableComponents._results,e)&&t.reDrawableComponents._results.push(e),e&&e.Widgets&&t.updateRedrawableComponents(e.Widgets)}))},t.prototype.redrawChildren=function(){var e=this;this.content&&this.Widgets&&this.updateRedrawableComponents(this.Widgets),setTimeout((function(){e.reDrawableComponents&&e.reDrawableComponents.forEach((function(e){return e.redraw()}))}),100)},t.prototype.onPropertyChange=function(t,n,i){e.prototype.onPropertyChange.call(this,t,n,i),"show"===t&&n&&this.redrawChildren()},t}(Oe);Ee.decorators=[{type:t.Directive}],Ee.propDecorators={reDrawableComponents:[{type:t.ContentChildren,args:[Se,{descendants:!0}]}]};var Te="app-container",Ce={widgetType:"wm-container",hostClass:Te},Ae=function(t){function n(n){var o=t.call(this,n,Ce)||this;return i.addClass(o.nativeElement,Te),Y(o.nativeElement,o,e.APPLY_STYLES_TYPE.CONTAINER),o}return d(n,t),n}(Ee);Ae.initializeProps=oe(),Ae.decorators=[{type:t.Directive,args:[{selector:"[wmContainer]",providers:[N(Ae)]}]}],Ae.ctorParameters=function(){return[{type:t.Injector}]};var Re=function(){function e(){}return e.prototype.transform=function(e,t,n){return i.transformFileURI(R(e,t,n))},e}();Re.decorators=[{type:t.Pipe,args:[{name:"image"}]}];var Ie=function(){Z("wm-item-template",new Map([["content",ee]]))},De={widgetType:"wm-item-template"},Ne=function(e){function t(t,n,i){var o=e.call(this,t,De)||this;return o.app=i,o.nativeElement=n.nativeElement,o.context=t.view.context,o}return d(t,e),Object.defineProperty(t.prototype,"$index",{get:function(){return this.context.index},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wmItemTemplate",{set:function(e){this.widget.content=e},enumerable:!1,configurable:!0}),t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.partialParams.item=this.userComponentParams.dataObject},t}(Oe);Ne.initializeProps=Ie(),Ne.decorators=[{type:t.Directive,args:[{selector:"[wmItemTemplate]",exportAs:"itemTemplateRef",providers:[N(Ne)]}]}],Ne.ctorParameters=function(){return[{type:t.Injector},{type:t.ElementRef},{type:i.App}]},Ne.propDecorators={userComponentParams:[{type:t.Input}],wmItemTemplate:[{type:t.Input}]};var xe=function(){Z("wm-repeat-template",new Map([["show",ne]]))},ke={widgetType:"wm-repeat-template",hostClass:"app-repeat-item"},Me=function(e){function t(t){var n=e.call(this,t,ke)||this;return Y(n.nativeElement,n),n}return d(t,e),t}(Oe);Me.initializeProps=xe(),Me.decorators=[{type:t.Directive,args:[{selector:"[wmRepeatTemplate]"}]}],Me.ctorParameters=function(){return[{type:t.Injector}]};var Le=function(){function e(e,t,n){this.templateRef=t,this.viewContainer=n,this.viewParent=e.view.component,this.context=e.view.context}return Object.defineProperty(e.prototype,"lazyLoad",{set:function(e){var t=this;this.unSubscribeFn=i.$watch(e,this.viewParent,this.context,(function(e){!t.embeddedView&&e&&(t.embeddedView=t.viewContainer.createEmbeddedView(t.templateRef,t.context),t.unSubscribeFn())}))},enumerable:!1,configurable:!0}),e.prototype.ngOnDestroy=function(){this.unSubscribeFn()},e}();Le.decorators=[{type:t.Directive,args:[{selector:"[lazyLoad]"}]}],Le.ctorParameters=function(){return[{type:t.Injector},{type:t.TemplateRef},{type:t.ViewContainerRef}]},Le.propDecorators={lazyLoad:[{type:t.Input}]};var Fe=function(){Z("wm-message",new Map([["animation",ee],["caption",Object.assign({value:"Message"},ee)],["class",ee],["hideclose",Object.assign({value:!1},ne)],["name",ee],["show",Object.assign({value:!0},ne)],["type",Object.assign({value:"success"},ee)]]))},je={widgetType:"wm-message",hostClass:"alert app-message"},Be=function(e){function t(t){var n=e.call(this,t,je)||this;return n.messageClass="",n.messageIconClass="",n.type="",Y(n.nativeElement,n),n}return d(t,e),t.prototype.showMessage=function(e,t){e&&(this.caption=e),t&&this.setWidgetProperty("type",t),this.setWidgetProperty("show",!0)},t.prototype.hideMessage=function(){this.setWidgetProperty("show",!1)},t.prototype.dismiss=function(e){this.hideMessage(),this.invokeEventCallback("close",{$event:e})},t.prototype.onMessageTypeChange=function(e){var t,n;switch(e){case"success":t="alert-success",n="wm-sl-l sl-check";break;case"error":t="alert-danger",n="wi wi-cancel";break;case"warn":case"warning":t="alert-warning",n="wm-sl-l sl-alarm-bell";break;case"info":t="alert-info",n="wi wi-info";break;case"loading":t="alert-info alert-loading",n="fa fa-spinner fa-spin"}i.switchClass(this.nativeElement,t,this.messageClass),this.messageClass=t,this.messageIconClass=n},t.prototype.onPropertyChange=function(t,n,i){"type"===t?this.onMessageTypeChange(n):e.prototype.onPropertyChange.call(this,t,n,i)},t}(Oe);Be.initializeProps=Fe(),Be.decorators=[{type:t.Component,args:[{selector:"[wmMessage]",template:'<i aria-hidden="true" [title]="type + \'Alert\'" class="icon {{type}} {{messageIconClass}}"></i>\n<span [innerHtml]="caption"></span>\n<button title="Close" type="button" class="btn-transparent close" [hidden]="hideclose" (click)="dismiss($event)" aria-label="Close">\n <span aria-hidden="true">×</span>\n</button>\n',providers:[N(Be)],exportAs:"wmMessage"}]}],Be.ctorParameters=function(){return[{type:t.Injector}]};var Ge=function(){Z("wm-partial",new Map([["name",ee]]))},Ve={widgetType:"wm-partial",hostClass:"app-partial clearfix"},$e=function(e){function t(t,n){var i=e.call(this,t,Ve)||this;return i.viewport=n,i.registerDestroyListener(i.viewport.subscribe("resize",(function(e){return i.callback("resize",e)}))),i.registerDestroyListener(i.viewport.subscribe("orientationchange",(function(e){return i.callback("orientationchange",e)}))),i}return d(t,e),t.prototype.callback=function(e,t){t=_.assign({widget:this},t),this.invokeEventCallback(e,t)},t.prototype.ngOnAttach=function(){this.callback("attach")},t.prototype.ngOnDetach=function(){this.callback("detach")},t.prototype.ngOnDestroy=function(){this.callback("destroy")},t}(Oe);$e.initializeProps=Ge(),$e.decorators=[{type:t.Directive,args:[{selector:"[wmPartial]",providers:[N($e)]}]}],$e.ctorParameters=function(){return[{type:t.Injector},{type:i.Viewport}]};var Ue=function(){function e(e){this.widgetRef=e,this.widgetRef.partialParams={},this.widgetRef.pageParams=this.widgetRef.partialParams,this.widgetRef.params$=new s.Subject}return e.prototype.registerParams=function(e,t,n,o){var r=this;this.widgetRef.partialParams[e]=t,!t&&n?this.widgetRef.registerDestroyListener(i.$watch(n,this.widgetRef.getViewParent(),_.get(this.widgetRef,"context"),(function(t){r.widgetRef.partialParams[e]=t,r.widgetRef.params$.next()}))):this.widgetRef.params$.next()},e}();Ue.decorators=[{type:t.Directive,args:[{selector:"[partialContainer]"}]}],Ue.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Self},{type:t.Inject,args:[y]}]}]};var We=function(){function e(e,t,n){this.bindValue=e,this.type=t,this.partialParamsProvider=n}return e.prototype.ngOnInit=function(){this.partialParamsProvider.registerParams(this.name,this.value,this.bindValue,this.type)},e}();We.decorators=[{type:t.Directive,args:[{selector:"[wmParam]"}]}],We.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Attribute,args:["value.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["type"]}]},{type:Ue}]},We.propDecorators={name:[{type:t.Input}],value:[{type:t.Input}]};var qe=function(){function e(e,t,n,o,r,a,s,c){var p=this;this.componentInstance=e,this.vcRef=t,this.elRef=n,this.inj=o,this.app=r,this.resolver=s,this.partialRefProvider=c,this.contentInitialized=!1,this.renderPartial=_.debounce(this._renderPartial,200),e.registerPropertyChangeListener((function(t,n,o){"content"===t&&(e.$lazyLoad?e.$lazyLoad=function(){p.renderPartial(n),e.$lazyLoad=i.noop}:p.renderPartial(n))}));var u=e.params$.pipe(l.filter((function(){return p.contentInitialized})),l.debounceTime(200)).subscribe((function(){return p.renderPartial(e.content)}));e.registerDestroyListener((function(){return u.unsubscribe()}))}return Object.defineProperty(e.prototype,"name",{get:function(){return this.componentInstance.name},enumerable:!1,configurable:!0}),e.prototype._renderPartial=function(e){return h(this,void 0,void 0,(function(){var t,n,o,r,a=this;return m(this,(function(s){switch(s.label){case 0:return this.vcRef.clear(),i.$invokeWatchers(!0),(t=$(this.elRef.nativeElement).closest(".app-prefab")).length?n=t.attr("prefabname"):this.componentInstance.viewParent&&(n=this.componentInstance.viewParent.prefabName),[4,this.partialRefProvider.getComponentFactoryRef(e,i.ComponentType.PARTIAL,{prefab:n})];case 1:return(o=s.sent())&&((r=this.vcRef.createComponent(o,0,this.inj))&&r._component&&n&&(r._component.prefabName=n),this.$target||(this.$target=this.elRef.nativeElement.querySelector("[partial-container-target]")||this.elRef.nativeElement),this.$target.innerHTML="",this.$target.appendChild(r.location.nativeElement),this.contentInitialized=!0,setTimeout((function(){return a.onLoadSuccess()}),200)),[2]}}))}))},e.prototype.onLoadSuccess=function(){this.componentInstance.invokeEventCallback("load"),this.app.notify("partialLoaded")},e}();qe.decorators=[{type:t.Directive,args:[{selector:"[partialContainer]"}]}],qe.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Self},{type:t.Inject,args:[y]}]},{type:t.ViewContainerRef},{type:t.ElementRef},{type:t.Injector},{type:i.App},{type:String,decorators:[{type:t.Attribute,args:["content"]}]},{type:t.ComponentFactoryResolver},{type:i.PartialRefProvider}]};var ze=function(){function e(e,t,n,i,o){this.elRef=e,this.widget=t,this.viewContainerRef=n,this.templateRef=o,this.context=i.view.context,window.addEventListener("resize",this.onResize.bind(this))}return Object.defineProperty(e.prototype,"showInDevice",{set:function(e){this.devices=e.split(","),this.onResize()},enumerable:!1,configurable:!0}),e.prototype.onResize=function(e){var t=getComputedStyle(document.documentElement).getPropertyValue("--screen-lg")||"1200px",n=getComputedStyle(document.documentElement).getPropertyValue("--screen-md")||"992px",o=getComputedStyle(document.documentElement).getPropertyValue("--screen-sm")||"768px",r=getComputedStyle(document.documentElement).getPropertyValue("--screen-lg-tab-landscape")||"1366px",a=getComputedStyle(document.documentElement).getPropertyValue("--screen-lg-tab-portrait")||"1024px",s=parseFloat(t)-1+"px",l=parseFloat(n)-1+"px",c=parseFloat(o)-1+"px";this.devices.indexOf("lg")>-1&&window.matchMedia("(min-width: "+t+")").matches&&!i.isLargeTabletLandscape(r,a)||this.devices.indexOf("md")>-1&&(i.isLargeTabletLandscape(r,a)||window.matchMedia("(min-width: "+n+") and (max-width: "+s+")").matches&&!i.isLargeTabletPortrait(r,a))||this.devices.indexOf("sm")>-1&&(window.matchMedia("(min-width: "+o+") and (max-width: "+l+")").matches||i.isLargeTabletPortrait(r,a))||this.devices.indexOf("xs")>-1&&window.matchMedia("(max-width: "+c+")").matches||this.devices.indexOf("all")>-1?this.embeddedView||(this.embeddedView=this.viewContainerRef.createEmbeddedView(this.templateRef,this.context)):(this.viewContainerRef.clear(),this.embeddedView="")},e.prototype.ngOnDestroy=function(){window.removeEventListener("resize",this.onResize)},e}();ze.decorators=[{type:t.Directive,args:[{selector:"[showInDevice]"}]}],ze.ctorParameters=function(){return[{type:t.ElementRef},{type:_e,decorators:[{type:t.Inject,args:[y]}]},{type:t.ViewContainerRef},{type:t.Injector},{type:t.TemplateRef}]},ze.propDecorators={showInDevice:[{type:t.Input}]};var He=function(){function e(e,t,n){this._isEnabled=!1,this._lastScrollY=-1,this._waitRefreshTill=-1,this.pendingIscrolls=[],this._$el=$(t.nativeElement),this.app=n}return e.prototype.ngOnInit=function(){var e=this;this.cancelSubscription=this.app.subscribe("no-iscroll",(function(t){e.pendingIscrolls.push(t)}))},e.prototype.ngDoCheck=function(){this._isEnabled?this._smoothScrollInstance?this.refreshIScroll():this._smoothScrollInstance=this.applySmoothScroll():this._smoothScrollInstance&&this._smoothScrollInstance.destroy&&this._smoothScrollInstance.destroy()},e.prototype.ngOnDestroy=function(){this._smoothScrollInstance&&this._smoothScrollInstance.destroy&&this._smoothScrollInstance.destroy(),this.cancelSubscription&&this.cancelSubscription()},Object.defineProperty(e.prototype,"wmSmoothscroll",{set:function(e){this._isEnabled=!0===e||"true"===e,this._isEnabled?this._smoothScrollInstance||(this._smoothScrollInstance=this.applySmoothScroll()):this.ngOnDestroy()},enumerable:!1,configurable:!0}),e.prototype.applySmoothScroll=function(e,t){var n=this;if(!i.isMobileApp()||i.isKitkatDevice())return null;var o={scrollbars:!0,preventDefault:!1,momentum:!0,bounce:!1,mouseWheel:!0,disablePointer:!0,disableTouch:!1,disableMouse:!1},r=this._$el[0];if(!r.children.length)return null;this._$el.addClass("smoothscroll-wrapper"),r.onscroll=function(e){e.target.iscroll&&e.target.scrollTop&&(e.target.iscroll.scrollTo(e.target.iscroll.x,e.target.iscroll.y-e.target.scrollTop),e.target.scrollTop=0)},t&&"INPUT"===t.tagName&&t.focus(),e&&(o.fadeScrollbars=!0);var a=new IScroll(r,o);if(e){_.forEach(e,(function(e,t){_.forEach(e,(function(e){a.on(t,e)}))}));var s=this;a.on("scrollStart",(function(){this._scrolling=!0,i.isMobileApp()&&s.app.notify("iscroll-start",{})})),a.on("scrollEnd",(function(){this._scrolling=!1})),a.refresh()}return this.app.notify("iscroll-start",{}),a.indicatorRefresh=function(){var e,t=n._$el[0].iscroll.indicators;if(t.length)for(e=0;e<t.length;e++)t[e].refresh()},this._$el[0].iscroll=a,_.forEach(this.pendingIscrolls,(function(e,t){if(e.isSameNode(n._$el[0]))return n.app.notify("iscroll-update",{el:e}),void n.pendingIscrolls.splice(t,1)})),this.app.notify("iscroll-update",{}),{iScroll:a,destroy:function(){a.destroy(),$(a.scroller).css({"transition-timing-function":"","transition-duration":"",transform:""}),a=null,delete r.iscroll}}},e.prototype.refreshIScroll=function(){var e=this._smoothScrollInstance.iScroll;if(!(e._scrolling||this._waitRefreshTill>Date.now())){if(e.wrapper&&!_.includes(e.wrapper.children[0].classList,"smoothscroll-container")&&e.wrapper.scrollHeight>e.wrapper.clientHeight){var t=e._events,n=document.activeElement;$(e.wrapper.children).wrapAll('<div class="smoothscroll-container"></div>'),this._smoothScrollInstance.destroy(),this._smoothScrollInstance=this.applySmoothScroll(t,n)}this._lastScrollY!==this._$el[0].iscroll.maxScrollY?(Ye(this._smoothScrollInstance.iScroll),this._lastScrollY=this._$el[0].iscroll.maxScrollY):this._smoothScrollInstance.iScroll.refresh(),this._waitRefreshTill=Date.now()+500}},e}();He.decorators=[{type:t.Directive,args:[{selector:"[wmSmoothscroll]"}]}],He.ctorParameters=function(){return[{type:t.Injector},{type:t.ElementRef},{type:i.App}]},He.propDecorators={wmSmoothscroll:[{type:t.Input}]};var Ye=function(e){var t=!e&&$(".smoothscroll-container");e&&e.wrapper&&e.wrapper.contains(document.activeElement)&&"INPUT"===document.activeElement.tagName&&$(document.activeElement).offset().top+document.activeElement.clientHeight>.9*window.innerHeight&&document.activeElement.scrollIntoView({behavior:"auto",block:"end",inline:"end"}),e?(e.indicatorRefresh&&e.indicatorRefresh(),e.refresh&&e.refresh()):t.length&&t.parent().each((function(e,t){t.iscroll.indicatorRefresh(),t.iscroll.refresh()}))},Ke=Ye;window.addEventListener("resize",i.debounce(Ye,200));var Qe=function(){function e(e){this.elRef=e}return Object.defineProperty(e.prototype,"textContent",{set:function(e){var t=e;null==e&&(t=""),this.elRef.nativeElement.textContent=t},enumerable:!1,configurable:!0}),e}();Qe.decorators=[{type:t.Directive,args:[{selector:"[textContent]"}]}],Qe.ctorParameters=function(){return[{type:t.ElementRef}]},Qe.propDecorators={textContent:[{type:t.Input}]};var Xe=function(e){return _.isDate(e)||isNaN(e)||(e=parseInt(e,10)),moment(e).valueOf()||moment((new Date).toDateString()+" "+e).valueOf()},Je=function(){function e(e){this.decimalPipe=e}return e.prototype.transform=function(e,t,n,i,o,r,a,s){n=o&&!a?"1."+r.length+"-16":n;var l=s?s.number:void 0;return this.decimalPipe.transform(e,n,i||l||t)},e}();Je.decorators=[{type:t.Pipe,args:[{name:"trailingZeroDecimalPipe"}]}],Je.ctorParameters=function(){return[{type:n.DecimalPipe}]};var Ze=function(){function e(e,t){this.datePipe=e,this.i18nService=t}return e.prototype.transform=function(e,t,n,o){var r;if("null"===e||""===e)return"";if(!i.isDefined(e))return"";if(r=Xe(e)){if("timestamp"===t)return r;if("UTC"===t)return new Date(r).toISOString();var a=this.i18nService?this.i18nService.getTimezone(o):n;return a&&(e===r||i.hasOffsetStr(e))?moment(r).tz(a).format(t.replaceAll("y","Y").replaceAll("d","D").replace("a","A")):this.datePipe.transform(r,t)}return""},e}();Ze.decorators=[{type:t.Pipe,args:[{name:"toDate"}]}],Ze.ctorParameters=function(){return[{type:n.DatePipe},{type:i.AbstractI18nService}]};var et=function(){function e(e,t){this.decimalPipe=e,this.i18nService=t}return e.prototype.transform=function(e,t){if(t&&!String(t).match(/^(\d+)?\.((\d+)(-(\d+))?)?$/)&&(t="1."+t+"-"+t),!_.isNaN(+e)){var n=this.i18nService&&this.i18nService.getwidgetLocale()?this.i18nService.getwidgetLocale():void 0,i=n?n.number:null;return this.decimalPipe.transform(e,t,i)}},e}();et.decorators=[{type:t.Pipe,args:[{name:"toNumber"}]}],et.ctorParameters=function(){return[{type:n.DecimalPipe},{type:i.AbstractI18nService,decorators:[{type:t.Inject,args:[i.AbstractI18nService]}]}]};var tt=function(){function e(e,t){this.decimalPipe=e,this.i18nService=t}return e.prototype.transform=function(e,t,n){var o=(i.CURRENCY_INFO[t]||{}).symbol||t||"",r=new et(this.decimalPipe,this.i18nService).transform(e,n),a=_.startsWith(r,"-");return a&&(r=r.replace("-","")),r?a?"-"+o+r:o+r:""},e}();tt.decorators=[{type:t.Pipe,args:[{name:"toCurrency"}]}],tt.ctorParameters=function(){return[{type:n.DecimalPipe},{type:i.AbstractI18nService,decorators:[{type:t.Inject,args:[i.AbstractI18nService]}]}]};var nt=function(){function e(){}return e.prototype.transform=function(e,t){return _.isUndefined(e)||null===e||""===e?e:(t||"")+e},e}();nt.decorators=[{type:t.Pipe,args:[{name:"prefix"}]}];var it=function(){function e(){}return e.prototype.transform=function(e,t){return _.isUndefined(e)||null===e||""===e?e:e+(t||"")},e}();it.decorators=[{type:t.Pipe,args:[{name:"suffix"}]}];var ot=function(){function e(e){this.custmeUserPipe=e}return e.prototype.transform=function(e,t){for(var n=[],i=2;i<arguments.length;i++)n.push(arguments[i]);var o=this.custmeUserPipe.getCustomPipe(t);if(!o||!_.isFunction(o.formatter))return console.warn("formatter is not defined, please check the custom pipes documentation"),e;try{return o.formatter.apply(o,v([e],g(n)))}catch(n){return console.error("Pipe name: "+t,n),e}},e}();ot.decorators=[{type:t.Pipe,args:[{name:"custom"}]}],ot.ctorParameters=function(){return[{type:i.CustomPipeManager}]};var rt=function(){function e(){}return e.prototype.transform=function(e){var t;if(i.isDefined(e))return(t=Xe(e))?moment(t).fromNow():void 0},e}();rt.decorators=[{type:t.Pipe,args:[{name:"timeFromNow"}]}];var at=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return d(t,e),t}(et);at.decorators=[{type:t.Pipe,args:[{name:"numberToString"}]}];var st=function(){function e(){}return e.prototype.transform=function(e){return Number(e)||void 0},e}();st.decorators=[{type:t.Pipe,args:[{name:"stringToNumber"}]}];var lt=function(){function e(){}return e.prototype.transform=function(e,t,n){return e?_.isObject(t)?_.filter(e,t):_.filter(e,(function(e){return _.includes(e[t],n)})):[]},e}();lt.decorators=[{type:t.Pipe,args:[{name:"filter"}]}];var ct=function(){function e(){}return e.prototype.transform=function(e,t){for(var n=0;e>=1024;)e/=1024,n++;return e.toFixed(+t)+" "+["bytes","KB","MB","GB","TB","PB"][n]},e}();ct.decorators=[{type:t.Pipe,args:[{name:"filesize"}]}];var pt=function(){function e(){}return e.prototype.transform=function(e){return"fa "+({zip:"fa-file-zip-o",pdf:"fa-file-pdf-o",rar:"fa-file-archive-o",txt:"fa-file-text-o",ppt:"fa-file-powerpoint-o",pot:"fa-file-powerpoint-o",pps:"fa-file-powerpoint-o",pptx:"fa-file-powerpoint-o",potx:"fa-file-powerpoint-o",ppsx:"fa-file-powerpoint-o",mpg:"fa-file-movie-o",mp4:"fa-file-movie-o",mov:"fa-file-movie-o",avi:"fa-file-movie-o",mp3:"fa-file-audio-o",docx:"fa-file-word-o",js:"fa-file-code-o",md:"fa-file-code-o",html:"fa-file-code-o",css:"fa-file-code-o",xlsx:"fa-file-excel-o",png:"fa-file-image-o",jpg:"fa-file-image-o",jpeg:"fa-file-image-o",file:"fa-file-o",default:"fa-file-o"}[e]||"fa-file-o")},e}();pt.decorators=[{type:t.Pipe,args:[{name:"fileIconClass"}]}];var ut=function(){function e(){}return e.prototype.transform=function(e){return{success:"wi wi-done text-success",error:"wi wi-error text-danger"}[e.toLowerCase()]},e}();ut.decorators=[{type:t.Pipe,args:[{name:"stateClass"}]}];var dt=function(){function e(){}return e.prototype.transform=function(e){return{"audio/aac":".aac","application/x-abiword":".abw","application/vnd.android.package-archive":".apk","video/x-msvideo":".avi","application/vnd.amazon.ebook":".azw","application/octet-stream":".bin","image/bmp":".bmp","application/x-bzip":".bz","application/x-bzip2":".bz2","application/x-csh":".csh","text/css":".css","text/csv":".csv","application/msword":".doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":".docx","application/vnd.ms-fontobject":".eot","application/epub+zip":".epub","application/ecmascript":".es","image/gif":".gif","text/html":".html","image/x-icon":".ico","text/calendar":".ics","application/java-archive":".jar","image/jpeg":[".jpeg",".jpg"],"application/javascript":".js","application/json":".json","audio/midi":".mid","audio/x-midi":".midi","video/mpeg":".mpeg","application/vnd.apple.installer+xml":"mpkg","application/vnd.oasis.opendocument.presentation":".odp","application/vnd.oasis.opendocument.spreadsheet":".ods","application/vnd.oasis.opendocument.text":".odt","audio/ogg":".oga","video/ogg":".ogv","application/ogg":".ogx","font/otf":".otf","image/png":".png","application/pdf":".pdf","application/vnd.ms-powerpoint":".ppt","application/vnd.openxmlformats-officedocument.presentationml.presentation":".pptx","application/x-rar-compressed":".rar","application/rtf":".rtf","application/x-sh":".sh","image/svg+xml":".svg","application/x-shockwave-flash":".swf","application/x-tar":".tar","image/tiff":".tiff","application/typescript":".ts","font/ttf":".ttf","text/plain":".txt","application/vnd.visio":".vsd","audio/wav":".wav","audio/webm":".weba","video/webm":".webm","image/webp":".webp","font/woff":".woff","font/woff2":".woff2","application/xhtml+xml":".xhtml","application/vnd.ms-excel":".xls","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":".xlsx","application/xml":".xml","application/vnd.mozilla.xul+xml":".xul","application/zip":".zip","video/3gpp":".3gp","audio/3gpp":".3gp","video/3gpp2":".3g2","audio/3gpp2":".3g2","application/x-7z-compressed":".7z"}[e]},e}();dt.decorators=[{type:t.Pipe,args:[{name:"fileExtensionFromMime"}]}];var ht=function(){function e(e){this.domSanitizer=e}return e.prototype.transform=function(e,n){if(null==e)return"";switch(n){case"html":case t.SecurityContext.HTML:return this.domSanitizer.bypassSecurityTrustHtml(e);case"style":case t.SecurityContext.STYLE:return this.domSanitizer.bypassSecurityTrustStyle(e);case"script":case t.SecurityContext.SCRIPT:return this.domSanitizer.bypassSecurityTrustScript(e);case"url":case t.SecurityContext.URL:return this.domSanitizer.bypassSecurityTrustUrl(e);case"resource":case t.SecurityContext.RESOURCE_URL:return this.domSanitizer.bypassSecurityTrustResourceUrl(e)}},e}();ht.decorators=[{type:t.Pipe,args:[{name:"trustAs"}]}],ht.ctorParameters=function(){return[{type:a.DomSanitizer}]};var mt=[],ft=[],gt=function(){function e(){this.dialogRefsCollection=new Map,this.appConfirmDialog="_app-confirm-dialog"}return e.prototype.register=function(e,t,n){e&&(this.dialogRefsCollection.get(e)?this.dialogRefsCollection.get(e).set(n,t):this.dialogRefsCollection.set(e,new Map([[n,t]])))},e.prototype.getDialogRefsCollection=function(){return this.dialogRefsCollection},e.prototype.deRegister=function(e,t){e&&this.dialogRefsCollection.get(e)&&this.dialogRefsCollection.get(e).delete(t)},e.prototype.getDialogRef=function(e,t){var n,i=this.dialogRefsCollection.get(e);return t?(n=i.get(t))||(t.pageName||t.partialName||t.prefabName?console.error('No dialog with the name "'+e+'" found in the given scope.'):i.forEach((function(t,i){i&&"Common"===i.partialName?n=t:console.error('No dialog with the name "'+e+'" found in the App scope.')}))):1===i.size?n=i.entries().next().value[1]:console.error("There are multiple instances of this dialog name. Please provide the Page/Partial/App instance in which the dialog exists."),n},e.prototype.open=function(e,t,n){var i=this.getDialogRef(e,t);i&&i.open(n)},e.prototype.close=function(e,t,n){var i=this.getDialogRef(e,t);i&&(i.closeCallBackFn=n,i.close())},e.prototype.closeAllDialogs=function(){_.forEach(mt.reverse(),(function(e){e.close()}))},e.prototype.showAppConfirmDialog=function(e){this.open(this.getAppConfirmDialog(),void 0,e)},e.prototype.closeAppConfirmDialog=function(){this.close(this.getAppConfirmDialog())},e.prototype.getAppConfirmDialog=function(){return this.appConfirmDialog},e.prototype.setAppConfirmDialog=function(e){this.appConfirmDialog=e},e.prototype.addToOpenedDialogs=function(e){mt.push(e)},e.prototype.getLastOpenedDialog=function(){return mt[mt.length-1]},e.prototype.removeFromOpenedDialogs=function(e){(-1!==mt.indexOf(e)&&mt.splice(mt.indexOf(e),1),0===mt.length&&(i.isMobile()||i.isMobileApp()))&&$("body > app-root")[0].removeAttribute("aria-hidden")},e.prototype.getOpenedDialogs=function(){return mt},e.prototype.addToClosedDialogs=function(e){ft.push(e)},e.prototype.removeFromClosedDialogs=function(e){-1!==ft.indexOf(e)&&ft.splice(ft.indexOf(e),1)},e.prototype.getDialogRefFromClosedDialogs=function(){return ft[ft.length-1]},e}();gt.decorators=[{type:t.Injectable}],gt.ctorParameters=function(){return[]};var vt=function(){function e(e){this.domSanitizer=e}return e.prototype.transform=function(e,n){if(null==e)return"";switch(n){case"html":case t.SecurityContext.HTML:return this.domSanitizer.sanitize(t.SecurityContext.HTML,e);case"style":case t.SecurityContext.STYLE:return this.domSanitizer.sanitize(t.SecurityContext.STYLE,e);case"script":case t.SecurityContext.SCRIPT:return this.domSanitizer.sanitize(t.SecurityContext.SCRIPT,e);case"url":case t.SecurityContext.URL:return this.domSanitizer.sanitize(t.SecurityContext.URL,e);case"resource":case t.SecurityContext.RESOURCE_URL:return this.domSanitizer.sanitize(t.SecurityContext.RESOURCE_URL,e);case"none":case t.SecurityContext.NONE:return this.domSanitizer.sanitize(t.SecurityContext.NONE,e)}},e}();vt.decorators=[{type:t.Pipe,args:[{name:"sanitize"}]}],vt.ctorParameters=function(){return[{type:a.DomSanitizer}]};var yt=[Ae,Ne,Me,Le,Be,$e,Ue,We,qe,Se,ze,He,Qe],bt=[Ze,pt,dt,lt,ct,et,tt,nt,it,rt,at,ut,st,Je,ht,Re,ot,vt],wt=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[Ze,lt,Je,ht,Re,ot,vt,n.Location,{provide:i.AbstractDialogService,useClass:gt}]}},e}();wt.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,o.SecurityModule],declarations:v(v([],g(yt)),g(bt)),exports:v(v([],g(yt)),g(bt))}]}];var Pt,_t=function(){};e.Live_Operations=void 0,(Pt=e.Live_Operations||(e.Live_Operations={})).INSERT="insert",Pt.UPDATE="update",Pt.DELETE="delete",Pt.READ="read";var Ot="All Fields",St={EMPTY_KEY:"EMPTY_NULL_FILTER",EMPTY_VALUE:"No Value",LABEL_KEY:"key",LABEL_VALUE:"value",NULL_EMPTY:["null","empty"],NULL:"null",EMPTY:"empty"};function Et(e){return _.includes([i.FormWidgetType.AUTOCOMPLETE,i.FormWidgetType.TYPEAHEAD,i.FormWidgetType.CHIPS],e)}var Tt=function(e,t,n){var o=i.debounce((function(){_.isFunction(n)&&n(t)}),300);o();var r=t?_.isObject(t)?t:JSON.parse(t):{},a=e.registerDestroyListener?e.registerDestroyListener.bind(e):_.noop,s=i.processFilterExpBindNode(e,r).subscribe((function(e){t=JSON.stringify(e.filterExpressions),o()}));a((function(){return s.unsubscribe()}))},Ct=function(e,t){var n,o={};return t["is-related"]?(o.tableName=t["lookup-type"],n=t["lookup-field"],o.distinctField=n,o.aliasColumn=n.replace(".","$"),o.filterExpr=t.filterexpressions?_.isObject(t.filterexpressions)?t.filterexpressions:JSON.parse(t.filterexpressions):{}):(o.tableName=e.execute(i.DataSource.Operation.GET_ENTITY_NAME),n=t.field||t.key,o.distinctField=n,o.aliasColumn=n),o};function At(e,t,n){var o;return new Promise((function(r,a){!A(t[n])||t.isDataSetBound&&"filterwidget"!==n||(o=Ct(e,t),e.execute(i.DataSource.Operation.GET_DISTINCT_DATA_BY_FIELDS,{fields:o.distinctField,entityName:o.tableName,pagesize:t.limit,filterExpr:t.filterexpressions?JSON.parse(t.filterexpressions):{}}).then((function(e){r({field:t,data:e.data,aliasColumn:o.aliasColumn})}),a))}))}function Rt(e,t){if(Et(e[t.widget]))return e.datafield=t.aliasColumn||St.LABEL_KEY,e.searchkey=t.distinctField||St.LABEL_KEY,void(e.displaylabel=e.displayfield=t.aliasColumn||St.LABEL_VALUE);e.datafield=St.LABEL_KEY,e.displayfield=St.LABEL_VALUE}function It(e,t,n){var o=[i.FormWidgetType.SELECT,i.FormWidgetType.RADIOSET],r={},a=[];n.isEnableEmptyFilter&&_.includes(o,e[n.widget])&&!e["is-range"]&&!e.multiple&&(r[St.LABEL_KEY]=St.EMPTY_KEY,r[St.LABEL_VALUE]=n.EMPTY_VALUE||St.EMPTY_VALUE,a.push(r)),_.each(t,(function(e){var t=e[n.aliasColumn],i={};null!==t&&""!==t&&(i[St.LABEL_KEY]=t,i[St.LABEL_VALUE]=t,a.push(i))})),Rt(e,n),e.dataset=a}function Dt(e,t,n){if(e&&t&&!t.isDataSetBound)if(Et(t[n.widget])){var i=Ct(e,t);t.dataoptions=i,Rt(t,Object.assign(n||{},i)),t.datasource=e}else Tt(t.viewParent,t.filterexpressions,(function(i){t.filterexpressions=i,At(e,t,n.widget).then((function(e){It(e.field,e.data,{aliasColumn:e.aliasColumn,widget:n.widget,isEnableEmptyFilter:Mt(n.enableemptyfilter),EMPTY_VALUE:n.EMPTY_VALUE})}))}))}function Nt(e){return i.isDefined(e)&&""!==e&&null!==e}function xt(e,t){var n;return Nt(e)&&Nt(t)?n=[e,t]:Nt(e)?n=e:Nt(t)&&(n=t),n}function kt(e,t){var n;return Nt(e)&&Nt(t)?n=i.MatchMode.BETWEEN:Nt(e)?n=i.MatchMode.GREATER:Nt(t)&&(n=i.MatchMode.LESSER),n}function Mt(e){return e&&_.intersection(e.split(","),St.NULL_EMPTY).length>0}function Lt(e){var t,n=_.split(e,",");return 2===_.intersection(n,St.NULL_EMPTY).length?t=i.MatchMode.NULLOREMPTY:_.includes(n,St.NULL)?t=i.MatchMode.NULL:_.includes(n,St.EMPTY)&&(t=i.MatchMode.EMPTY),t}var Ft=function(e){return _.isUndefined(e)||_.isNull(e)?[]:(_.isString(e)&&(e=e.split(",").map(Function.prototype.call,String.prototype.trim)),_.isArray(e)||(e=[e]),e)};var jt,Bt=moment.localeData(),Gt=i.getClonedObject(Bt._calendar),Vt=Bt._calendarDay||{lastDay:"[Yesterday]",lastWeek:"[Last] dddd",nextDay:"[Tomorrow]",nextWeek:"dddd",sameDay:"[Today]",sameElse:"L"},$t="alphabet",Ut="Others",Wt={HOUR:"hour",DAY:"day",WEEK:"week",MONTH:"month",YEAR:"year"},qt="yyyy-MM-dd",zt="w 'Week', yyyy",Ht="MMM, yyyy",Yt="YYYY",Kt="hh:mm a",Qt=function(e,t,n){if(!t)return _.cloneDeep(e);var i=t.split(","),o=[],r=[];return i.forEach((function(e){var t=e.split(":");o.push(n?n+"."+t[0]:t[0]),r.push(t[1])})),_.orderBy(e,o,r)},Xt=function(e){return _.isString(e)&&(e=_.split(e,",").map((function(e){return e.trim()}))),e},Jt=function(e){return"wm-search"===e},Zt=function(e,t,n,o){if(e&&Jt(e.widgetType))if(e.groupby)if(_.includes(e.groupby,"(")){var r=i.$parseEvent(e.groupby);n.groupby=r(t,{row:n.dataObject||n})}else n.groupby=rn(e.groupby,e.match,o,e.dateformat,e.datePipe,e.appDefaults,n);else n.groupby=""},en=function(e,t,n){var i=[];return _.forEach(_.keys(e),(function(o,r){var a=Qt(e[o],n,"dataObject");i.push({key:o,data:_.sortBy(a,(function(e){return e._groupIndex=r+1,_.get(e,t)||_.get(e.dataObject,t)}))})})),i},tn=function(e,t,n,i,o,r,a,s){n===Wt.DAY&&(Bt._calendar=Vt),e=_.orderBy(e,(function(e){var n=_.get(a?e[a]:e,t);if(n)return _.toLower(n)}));var l=_.groupBy(e,rn.bind(void 0,t,n,a,o,r,s));return Bt._calendar=Gt,l},nn=function(e,t,n,o){return"timestamp"===t?e:i.getFormattedDate(o,e,t||n)},on=function(e,t,n,i,o){var r,a=moment(e),s=n,l=moment(),c=function(){return"["+nn(this.valueOf(),s,qt,i)+"]"};switch(t){case Wt.HOUR:s=s||o.timeFormat,a.isValid()||(a=moment((new Date).toDateString()+" "+e)).isValid()&&(Bt._calendar.sameDay=function(){return"["+nn(this.valueOf(),s,Kt,i)+"]"}),a=a.startOf("hour"),Bt._calendar.sameElse=c,r=a.calendar(l);break;case Wt.WEEK:r=nn(a.valueOf(),s,zt,i);break;case Wt.MONTH:r=nn(a.valueOf(),s,Ht,i);break;case Wt.YEAR:r=a.format(Yt);break;case Wt.DAY:s=s||o.dateFormat,a=a.startOf("day"),Bt._calendar.sameElse=c,r=a.calendar(l)}return"Invalid date"===r?Ut:r},rn=function(e,t,n,i,o,r,a){var s=_.get(n?a[n]:a,e);return _.isUndefined(s)||_.isNull(s)||""===s.toString().trim()?Ut:(t===$t&&(s=s.substr(0,1)),_.includes(_.values(Wt),t)&&(s=on(s,t,i,o,r)),s)},an=function(){},sn="default",ln="label",cn=function(e,t,n,i){_.forEach(e,(function(e){_.get(e,"isGroup")&&(e.field===n?e.columns[i]=t:cn(e.columns,t,n,i))}))},pn=function(e){return"true"===e||"false"!==e&&(/^\d+$/.test(e)?+e:e)},un={integer:["number","text","select","checkboxset","radioset","rating","slider","currency","autocomplete","chips"],big_integer:["number","text","select","checkboxset","radioset","rating","slider","currency","autocomplete","chips"],short:["number","text","select","checkboxset","radioset","slider","currency","autocomplete","chips"],float:["number","text","select","checkboxset","radioset","slider","currency","autocomplete","chips"],big_decimal:["number","text","select","checkboxset","radioset","slider","currency","autocomplete","chips"],number:["number","text","select","checkboxset","radioset","slider","currency","autocomplete","chips"],double:["number","text","select","checkboxset","radioset","slider","currency","autocomplete","chips"],long:["number","text","select","checkboxset","radioset","rating","slider","currency","autocomplete","chips"],byte:["number","text","select","checkboxset","radioset","slider","currency","autocomplete","chips"],string:["text","number","textarea","password","richtext","select","checkboxset","radioset","date","time","timestamp","switch","currency","autocomplete","chips","colorpicker"],character:["text","number","textarea","password","richtext","select","checkboxset","radioset","switch","currency","autocomplete","chips"],text:["text","number","textarea","password","richtext","select","checkboxset","radioset","date","time","timestamp","switch","currency","autocomplete","chips","colorpicker"],date:["date","text","number","select","checkboxset","radioset","autocomplete","chips"],time:["time","text","number","select","checkboxset","radioset","autocomplete","chips"],timestamp:["timestamp","text","number","select","checkboxset","radioset","autocomplete","chips"],datetime:["datetime","text","select","checkboxset","radioset","autocomplete","chips"],boolean:["checkbox","radioset","toggle","select"],list:["select","radioset","checkboxset","switch","autocomplete","chips"],clob:["text","textarea","richtext"],blob:["upload"],file:["upload"],custom:["text","number","textarea","password","checkbox","toggle","slider","richtext","currency","switch","select","checkboxset","radioset","date","time","timestamp","rating","datetime","autocomplete","chips","colorpicker"]},dn=function(e){if(e)return/^(\/|#\/|#)(?!\W).*/.test(e)?"#/"+(e=_.first(e.match(/[\w]+.*/g))||""):_.startsWith(e,"www.")?"//"+e:e},hn=function(e){function t(t,n){var i=e.call(this,t,n)||this;return i.nodes=[],i.nodes$=new s.Subject,i._resetNodes=_.debounce(i.resetNodes,50),i.securityService=i.inj.get(o.SecurityService),i.binditemlabel=i.nativeElement.getAttribute("itemlabel.bind"),i.binditemicon=i.nativeElement.getAttribute("itemicon.bind"),i.binditemaction=i.nativeElement.getAttribute("itemaction.bind"),i.binditembadge=i.nativeElement.getAttribute("itembadge.bind"),i.binditemchildren=i.nativeElement.getAttribute("itemchildren.bind"),i.binditemid=i.nativeElement.getAttribute("itemid.bind"),i.binditemlink=i.nativeElement.getAttribute("itemlink.bind"),i.binditemtarget=i.nativeElement.getAttribute("itemtarget.bind"),i.binduserrole=i.nativeElement.getAttribute("userrole.bind"),i.bindisactive=i.nativeElement.getAttribute("isactive.bind"),i}return d(t,e),t.prototype.getNode=function(e,t){var n=this.viewParent.pageScope||this.viewParent,o=E(t,{field:this.itemchildren,bindExpression:this.binditemchildren},n)||_.get(t,e.childrenField),r={action:E(t,{field:this.itemaction,bindExpression:this.binditemaction},n)||_.get(t,e.actionField),badge:E(t,{field:this.itembadge,bindExpression:this.binditembadge},n)||_.get(t,e.badgeField),children:Array.isArray(o)?this.getNodes(o):[],class:_.get(t,e.classField),disabled:t.disabled,icon:E(t,{field:this.itemicon,bindExpression:this.binditemicon},n)||_.get(t,e.iconField),id:E(t,{field:this.itemid,bindExpression:this.binditemid},n)||_.get(t,e.idField),label:E(t,{field:this.itemlabel,bindExpression:this.binditemlabel},n)||_.get(t,e.labelField),link:dn(E(t,{field:this.itemlink,bindExpression:this.binditemlink},n)||_.get(t,e.linkField)),target:dn(E(t,{field:this.itemtarget,bindExpression:this.binditemtarget},n)||_.get(t,e.targetField)),role:E(t,{field:this.userrole,bindExpression:this.binduserrole},n),isactive:E(t,{field:this.isactive,bindExpression:this.bindisactive},n),value:this.datafield?"All Fields"===this.datafield?t:i.findValueOf(t,this.datafield):t};return _.omitBy(r,_.isUndefined)},t.prototype.resetItemFieldMap=function(){this._itemFieldMap=null},t.prototype.getItemFieldsMap=function(){return this._itemFieldMap||(this._itemFieldMap={idField:this.itemid||"itemid",iconField:this.itemicon||"icon",labelField:this.itemlabel||"label",linkField:this.itemlink||"link",targetField:this.itemtarget||"target",badgeField:this.itembadge||"badge",childrenField:this.itemchildren||"children",classField:this.itemclass||"class",actionField:this.itemaction||"action",isactiveField:this.isactive||"isactive"}),this._itemFieldMap},t.prototype.prepareNodeDataSet=function(e){return(e=Ft(e)).map((function(e){return i.isObject(e)?e:{label:e,value:e}}))},t.prototype.getNodes=function(e){var t=this;void 0===e&&(e=this.dataset||{});var n=Qt(this.prepareNodeDataSet(e),this.orderby)||[];if(n.length){var o=this.userrole,r=this.getItemFieldsMap();n=n.reduce((function(e,n){return i.validateAccessRoles(n[o],t.securityService.loggedInUser)&&e.push(t.getNode(r,n)),e}),[])}return n},t.prototype.resetNodes=function(){this.resetItemFieldMap(),this.nodes=this.getNodes(),i.$appDigest(),this.nodes$.next()},t.prototype.onPropertyChange=function(t,n,i){switch(t){case"dataset":case"itemicon":case"itemlabel":case"itemlink":case"itemtarget":case"itemclass":case"itemchildren":case"isactive":case"orderby":this._resetNodes()}e.prototype.onPropertyChange.call(this,t,n,i)},t}(Oe),mn={pattern:"regexp",max:"maxvalue",min:"minvalue",required:"required",maxlength:"maxchars",mindate:"mindate",maxdate:"maxdate",excludedates:"excludedates",excludedays:"excludedays",invalidNumber:"invalidNumber"},fn=function(){function e(e,t,n,i,o,r){this.instance=e,this.formwidget=t,this.widgettype=n,this.widgetControl=i,this.widgetContext=o,this.defaultValidatorMessages=[],r&&(this.tableFieldType=r)}return e.prototype.getDefaultValidators=function(){var e=[];return this.instance.required&&!1!==this.instance.show&&(this.widgettype===i.FormWidgetType.CHECKBOX||this.widgettype===i.FormWidgetType.TOGGLE?e.push(c.Validators.requiredTrue):e.push(c.Validators.required)),this.instance.maxchars&&e.push(c.Validators.maxLength(this.instance.maxchars)),this.instance.minvalue&&e.push(c.Validators.min(this.instance.minvalue)),this.instance.maxvalue&&this.widgettype!==i.FormWidgetType.RATING&&e.push(c.Validators.max(this.instance.maxvalue)),this.instance.regexp&&e.push(c.Validators.pattern(this.instance.regexp)),this.formwidget&&_.isFunction(this.formwidget.validate)&&e.push(this.formwidget.validate.bind(this.formwidget)),e},e.prototype.setUpValidators=function(e){if(!this.hasValidators&&(this.instance._validators=this.getDefaultValidators(),e&&this.instance._validators.push(e),this.widgetContext.ngform)){this.widgetControl.setValidators(this.instance._validators);var t={};this.formwidget&&this.instance.value===this.formwidget.prevDatavalue&&(t.emitEvent=!1),this.widgetControl.updateValueAndValidity(t)}},e.prototype.getPromiseList=function(e){var t=this,n=[];return _.forEach(e,(function(e,i){var o=e;e instanceof Function&&e.bind&&(o=e(t.widgetControl,t.widgetContext)),o instanceof Promise&&n.push(o)})),n},e.prototype.setAsyncValidators=function(e){var t=this;if(this._asyncValidatorFn=function(){return function(){return Promise.all(t.getPromiseList(e)).then((function(){return t.instance.validationmessage="",null}),(function(e){if(e.hasOwnProperty("errorMessage"))t.instance.validationmessage=_.get(e,"errorMessage");else{var n=_.keys(e);t.instance.validationmessage=e[n[0]].toString()}return e})).then((function(e){var n=function(){setTimeout((function(){"PENDING"===t.widgetControl.status?n():t.instance.onStatusChange(t.widgetControl.status,t.tableFieldType)}),100)};return n(),e}))}},this.widgetControl.setAsyncValidators([this._asyncValidatorFn()]),this.widgetContext.ngform.touched){var n={};this.formwidget&&this.instance.value===this.formwidget.prevDatavalue&&(n.emitEvent=!1),this.widgetControl.updateValueAndValidity(n)}},e.prototype.isDefaultValidator=function(e){return _.get(i.VALIDATOR,_.toUpper(e))},e.prototype.setDefaultValidator=function(e,t){t&&t instanceof Function?this.watchDefaultValidatorExpr(t.bind(void 0,this.widgetControl,this.widgetContext),e):(this.instance.widget[e]=t,this.instance[e]=t)},e.prototype.setValidators=function(e){var t=this,n=_.cloneDeep(e);this.hasValidators=!0,this._syncValidators=[],_.forEach(n,(function(e,i){if(e&&e instanceof Function)n[i]=e.bind(void 0,t.widgetControl,t.widgetContext),t._syncValidators.push(n[i]);else{var o=_.get(e,"type");if(t.defaultValidatorMessages[o]=_.get(e,"errorMessage"),t.isDefaultValidator(o)){var r=_.get(e,"validator");t.setDefaultValidator(o,r),n[i]=""}}})),this._syncValidators=_.filter(n,(function(e){if(e)return e})),this.applyDefaultValidators()},e.prototype.observeOn=function(e,t){var n=this;_.forEach(e,(function(e){var i=_.find(n.widgetContext[t],{key:e});i&&(i.notifyForFields||(i.notifyForFields=[]),i.notifyForFields.push(n.instance))}))},e.prototype.validate=function(){if(this.applyDefaultValidators(),this._asyncValidatorFn){var e={};this.formwidget&&this.instance.value===this.formwidget.prevDatavalue&&(e.emitEvent=!1),this.widgetControl.setAsyncValidators([this._asyncValidatorFn()]),this.widgetControl.updateValueAndValidity(e)}this.widgetContext.ngform.touched&&this.widgetControl.markAsTouched()},e.prototype.watchDefaultValidatorExpr=function(e,t){var n=this,o=this.instance.widgetId+"_"+t+"_formField";i.$unwatch(o),this.instance.registerDestroyListener(i.$watch("boundFn(fn)",_.extend(this.instance,this.instance.viewParent),{fn:e},(function(e,i){n.instance.widget[t]=e,n.applyDefaultValidators()}),o))},e.prototype.applyDefaultValidators=function(){var e=this.getDefaultValidators(),t={};this.formwidget&&this.instance.value===this.formwidget.prevDatavalue&&(t.emitEvent=!1),this.widgetControl.setValidators(_.concat(this._syncValidators||[],e)),this.widgetControl.updateValueAndValidity(t),this.setCustomValidationMessage()},e.prototype.setCustomValidationMessage=function(){var e=this.widgetControl&&this.widgetControl.errors;if(e)if(e.hasOwnProperty("errorMessage"))this.instance.validationmessage=_.get(e,"errorMessage");else{var t=_.keys(e)[0],n=_.get(mn,t)||this.formwidget.validateType;if(n){var i=_.get(this.defaultValidatorMessages,n)||this.instance.validationmessage;this.instance.validationmessage=i&&i instanceof Function?i(this.widgetControl,this.widgetContext):i}else this.instance.validationmessage=""}},e}(),gn=function(e){function t(t,n,o){var r=e.call(this)||this;r.$el=t,r.app=n,r.onPullToRefresh=o,r.count=0;return r.$el.prepend('<div class="refresh-container"></div>'),r.infoContainer=r.$el.find(".refresh-container"),i.isIos()&&r.infoContainer.addClass("ios-refresh-container"),r.init(r.$el),r}return d(t,e),t.prototype.threshold=function(){return 10},t.prototype.direction=function(){return $.fn.swipey.DIRECTIONS.VERTICAL},t.prototype.subscribe=function(){var e=this;this.cancelSubscription=this.app.subscribe("toggle-variable-state",(function(t){t.active&&e.animationInProgress?(e.count++,e.wait()):e.count>0&&e.count--,!e.count&&e.animationInProgress&&e.stopAnimation()}))},t.prototype.bounds=function(e,t){var n=this.$el[0].iscroll;return t<0||n&&!isNaN(n.y)&&0!==n.y?{lower:void 0,upper:void 0}:(this.spinner||(this.spinner=i.isIos()?new yn(this.infoContainer):new vn(this.infoContainer),this.subscribe()),{lower:0,center:0,upper:i.isIos()?0:150,strict:!i.isIos()})},t.prototype.context=function(){var e=this;return this.infoContainer.show(),i.isIos()&&this.infoContainer.addClass("entry"),{spin:function(t){e.spinner.setRotation(2*t)}}},t.prototype.animation=function(){return i.isIos()?{css:{transform:"translate3d(0, ${{$D + $d}}px, 0)",spin:"${{spin($d)}}"}}:{target:this.infoContainer,css:{transform:"translate3d(0, ${{$D + $d}}px, 0)",spin:"${{spin($d)}}",opacity:"${{min(($D + $d) / 100, 1)}}"}}},t.prototype.onAnimation=function(){var e=this;this.animationInProgress=!0,this.spinner.start(),this.onPullToRefresh&&this.onPullToRefresh(),setTimeout((function(){e.runAnimation||e.stopAnimation()}))},t.prototype.stopAnimation=function(){var e=this;setTimeout((function(){e.runAnimation=!1,e.animationInProgress=!1,e.spinner.stop(),e.infoContainer.hide(),i.setCSS(e.infoContainer[0],"transform","none"),i.isIos()||i.setCSS(e.infoContainer[0],"opacity",0),e.infoContainer.removeClass("entry")}),800)},t.prototype.wait=function(){this.runAnimation=!0},t}(p.SwipeAnimation),vn=function(){function e(e,t){this.$el=e,this.options=t||{}}return e.prototype.polarToCartesian=function(e,t,n,i){var o=(i-90)*Math.PI/180;return{x:e+n*Math.cos(o),y:t+n*Math.sin(o)}},e.prototype.describeArc=function(e,t,n,i,o){var r=this.polarToCartesian(e,t,n,o),a=this.polarToCartesian(e,t,n,i),s=o-i<=180?"0":"1";return["M",r.x,r.y,"A",n,n,0,s,0,a.x,a.y,"L",a.x,a.y].join(" ")},e.prototype.init=function(){if(!this.initialized){var e=$('<svg><path id="arc1"/></svg>'),t=$('<div class="android-spinner"></div>');t.append(e),this.$el.append(t),this.cx=t.outerWidth()/2,this.cy=t.outerHeight()/2,this.r=.6*this.cx,this.path=t.find("path"),this.initialized=!0,this.container=t}},e.prototype.setRotation=function(e){this.init(),this.path.attr("d",this.describeArc(this.cx,this.cy,this.r,0,e))},e.prototype.start=function(){var e=this;this.init();var t=this,n=this.options.time||1800,i=0;this.container.addClass("spin"),this.intervalId=setInterval((function(){var n;n=(i+=10)>720?i=0:i>360?720-i:i,t.path.attr("d",e.describeArc(t.cx,t.cy,t.r,0,n))}),10*n/360)},e.prototype.stop=function(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=0),this.container.removeClass("spin")},e}(),yn=function(){function e(e){this.$el=e}return e.prototype.init=function(){if(!this.svg){var e=$('<div class="ios-spinner"><svg></svg></div>'),t=e.find("svg");this.$el.append(e);for(var n=e.width(),i=0;i<12;i++)t[0].innerHTML+='<line y1="'+.15*n+'" y2="'+.3*n+'"\n transform="translate('+.5*n+", "+.5*n+") rotate("+30*i+')">\n </line>';e.append(t),this.svg=t}},e.prototype.setRotation=function(e){this.init(),this.svg.css("transform","rotateZ( "+30*Math.round(e/30)+"deg)")},e.prototype.start=function(){var e=this;this.init();var t=0;this.intervalId=setInterval((function(){t+=10,e.setRotation(t)}),20)},e.prototype.stop=function(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=0)},e}(),bn=this;!function(e){e.LEFT_PANEL="page-left-panel",e.RIGHT_PANEL="page-right-panel",e.SWIPE_ELEM="page-left-panel-icon",e.CONTENT="app-content-column",e.HEADER="page-header",e.SEARCH="app-search"}(jt||(jt={}));var wn=function(e){return"[data-role='"+e+"']"},Pn=(wn("pageContainer"),function(e,t){"string"==typeof e&&(e=document.querySelector(e)),e&&(e.removeEventListener("click",t),e.addEventListener("click",t))}),_n=function(e,t){if(i.isMobile()){if(e)try{e.widget.collapse()}catch(e){}t&&i.setCSS(t,"display","none")}},On=function(e,t,n,i){void 0===i&&(i=!1),i||Pn(t,_n.bind(bn,e,n))},Sn=function(e,t){Pn(wn(jt.SWIPE_ELEM),(function(){e&&(e.widget.toggle(),e.classList.contains("visible")&&t&&i.setCSS(t,"display","none"))}))},En=function(e){Pn(e,_n)},Tn=function(e,t){"none"===$(e).css("display")?(_n(t),i.setCSS(e,"display","inline-table")):_n(t,e)},Cn=function(e,t){$(e).each((function(e,n){var i=$('<a class="app-header-action"><i class="wi wi-search"></i></a>');$(n).before(i),Pn(i,(function(){return Tn(n,t)}))}))};e.ALLFIELDS=Ot,e.AUTOCLOSE_TYPE={OUTSIDECLICK:"outsideClick",ALWAYS:"always",DISABLED:"disabled"},e.BaseComponent=_e,e.BaseContainerComponent=Ee,e.BaseFieldValidations=fn,e.ContainerDirective=Ae,e.Context=w,e.CustomPipe=ot,e.DEBOUNCE_TIMES={PAGINATION_DEBOUNCE_TIME:250},e.DISPLAY_TYPE=le,e.DataSetItem=an,e.DatasetAwareNavComponent=hn,e.DialogRef=b,e.DialogServiceImpl=gt,e.EDIT_MODE={QUICK_EDIT:"quickedit",INLINE:"inline",FORM:"form",DIALOG:"dialog"},e.EVENTS_MAP=se,e.FileExtensionFromMimePipe=dt,e.FileIconClassPipe=pt,e.FileSizePipe=ct,e.FilterPipe=lt,e.INPUTMODE={FINANCIAL:"financial",NATURAL:"natural"},e.ImagePipe=Re,e.ItemTemplateDirective=Ne,e.LIVE_CONSTANTS=St,e.LazyLoadDirective=Le,e.MessageComponent=Be,e.NAVIGATION_TYPE={ADVANCED:"Advanced",BASIC:"Basic",CLASSIC:"Classic",INLINE:"Inline",NONE:"None",ONDEMAND:"On-Demand",PAGER:"Pager",SCROLL:"Scroll"},e.NumberToStringPipe=at,e.PROP_ANY=ie,e.PROP_BOOLEAN=ne,e.PROP_NUMBER=te,e.PROP_STRING=ee,e.PartialContainerDirective=qe,e.PartialDirective=$e,e.PartialParamDirective=We,e.PartialParamHandlerDirective=Ue,e.PrefixPipe=nt,e.PullToRefresh=gn,e.RedrawableDirective=Se,e.RepeatTemplateDirective=Me,e.SanitizePipe=vt,e.ShowInDeviceDirective=ze,e.SmoothScrollDirective=He,e.StateClassPipe=ut,e.StringToNumberPipe=st,e.StylableComponent=Oe,e.SuffixPipe=it,e.TextContentDirective=Qe,e.TimeFromNowPipe=rt,e.ToCurrencyPipe=tt,e.ToDatePipe=Ze,e.ToNumberPipe=et,e.TrailingZeroDecimalPipe=Je,e.TrustAsPipe=ht,e.WidgetRef=y,e.WmComponentsModule=wt,e.applyFilterOnField=function(e,t,n,o,r){void 0===r&&(r={});var a=t.field||t.key,s=_.filter(n,{"filter-on":a});o=t["is-range"]?xt(t.minValue,t.maxValue):i.isDefined(o)?o:t.value,!e||r.isFirst&&(_.isUndefined(o)||""===o)||_.forEach(s,(function(n){var a,s,l,c=n.field||n.key,p=t["lookup-field"]||t._primaryKey,u=n["edit-widget-type"]||n.widgettype,d={},h=n["filter-on"];A(u)&&!n.isDataSetBound&&h!==c&&(t&&t["is-related"]&&(h+="."+p),i.isDefined(o)?(l=t["is-range"]?kt(t.minValue,t.maxValue):Mt(r.enableemptyfilter)&&o===St.EMPTY_KEY?Lt(r.enableemptyfilter):i.MatchMode.EQUALS,a=_.isObject(o)&&!_.isArray(o)?o[p]:o,d[h]={value:a,matchMode:l}):d={},s=c,Et(u)&&n.dataoptions?n.dataoptions.filterFields=d:e.execute(i.DataSource.Operation.GET_DISTINCT_DATA_BY_FIELDS,{fields:s,filterFields:d,pagesize:n.limit}).then((function(e){It(n,e.data,{aliasColumn:s,widget:r.widget||"widgettype",isEnableEmptyFilter:Mt(r.enableemptyfilter),EMPTY_VALUE:r.EMPTY_VALUE})}),_t))}))},e.configureDnD=function(e,t,n,i,o){var r=Object.assign({containment:e,delay:100,opacity:.8,helper:"clone",zIndex:1050,tolerance:"pointer",start:n,update:i,sort:o},t);e.sortable(r)},e.convertDataToObject=Xt,e.createArrayFrom=Ft,e.extractDataAsArray=function(e){return _.isUndefined(e)||_.isNull(e)||""===_.trim(e)?[]:(_.isString(e)&&(e=_.split(e,",").map((function(e){return e.trim()}))),_.isArray(e)||(e=[e]),e)},e.extractDataSourceName=function(e){if(e){var t,n=e.split(".");return n.length>1&&"Variables"===n[0]&&(t=n[1]),t}},e.fetchDistinctValues=function(e,t,n){_.isEmpty(t)||t.forEach((function(t){Dt(e,t,n)}))},e.fetchRelatedFieldData=function(e,t,n){var o,r,a=n.relatedField,s=n.datafield;e&&(o=e.execute(i.DataSource.Operation.GET_RELATED_PRIMARY_KEYS,a),t.datafield=s,t._primaryKey=_.isEmpty(o)?void 0:o[0],t.compareby=o&&o.join(","),r=s===Ot?void 0:s,t.displayfield=r=t.displayfield||r||t._primaryKey,Et(t[n.widget])?(t.dataoptions={relatedField:a,filterExpr:t.filterexpressions?t.filterexpressions:{}},t.datasource=e,t.searchkey=t.searchkey||r,t.displaylabel=t.displayfield=t.displaylabel||r,t.showPendingSpinner&&(t.showPendingSpinner=!1)):Tt(t.viewParent,t.filterexpressions,(function(n){t.filterexpressions=n,e.execute(i.DataSource.Operation.GET_RELATED_TABLE_DATA,{relatedField:a,pagesize:t.limit,orderBy:t.orderby?_.replace(t.orderby,/:/g," "):"",filterFields:{},filterExpr:t.filterexpressions?t.filterexpressions:{}}).then((function(e){t.dataset=e.data,t.displayfield=t.displayfield||_.head(_.keys(_.get(e,"[0]"))),t.showPendingSpinner&&(t.showPendingSpinner=!1)}),_t)})))},e.filterDate=nn,e.getBackGroundImageUrl=I,e.getConditionalClasses=B,e.getContainerTargetClass=function(e){return".wm-app"},e.getDataTableFilterWidget=function(e){var t=un[e]&&un[e][0];return e===i.DataType.BOOLEAN&&(t=i.FormWidgetType.SELECT),_.includes([i.FormWidgetType.TEXT,i.FormWidgetType.NUMBER,i.FormWidgetType.SELECT,i.FormWidgetType.AUTOCOMPLETE,i.FormWidgetType.DATE,i.FormWidgetType.TIME,i.FormWidgetType.DATETIME],t)?t:i.FormWidgetType.TEXT},e.getDefaultValue=function(e,t,n){return n?n===i.FormWidgetType.NUMBER||n===i.FormWidgetType.SLIDER||n===i.FormWidgetType.CURRENCY?isNaN(Number(e))?null:Number(e):n===i.FormWidgetType.CHECKBOX||n===i.FormWidgetType.TOGGLE?pn(e):e:i.isNumberType(t)?isNaN(Number(e))?null:Number(e):t===i.DataType.BOOLEAN?pn(e):e},e.getDefaultViewModeWidget=function(e){return _.includes(["checkbox","toggle","rating"],e)?sn:ln},e.getDistinctFieldProperties=Ct,e.getDistinctValues=At,e.getDistinctValuesForField=Dt,e.getEditModeWidget=function(e){return e["related-entity-name"]&&e["primary-key"]?i.FormWidgetType.SELECT:un[e.type]&&un[e.type][0]||i.FormWidgetType.TEXT},e.getEmptyMatchMode=Lt,e.getEnableEmptyFilter=Mt,e.getEvaluatedData=E,e.getFieldLayoutConfig=function(e,t,n){var o="",r="";return"top"===(t=t||"top")||"floating"===t?n&&"android"===n||!i.isMobileApp()||i.isAndroid()?o=r="col-xs-12":i.isMobileApp()&&(o="col-xs-4",r="col-xs-8"):e&&_.forEach(_.split(e," "),(function(e){var t,n,i=_.split(e,"-"),a=i[0];t=parseInt(i[1],10),o+=" col-"+a+"-"+t,r+=" col-"+a+"-"+(n=(n=12-t)<=0?12:n)})),{captionCls:o,widgetCls:r}},e.getFieldTypeWidgetTypesMap=function(){return un},e.getImageUrl=R,e.getKeyboardFocusableElements=function(e){var t=e.querySelectorAll("a, button, input, textarea, select, details, iframe, embed, object, summary dialog, audio[controls], video[controls], [contenteditable]");return Array.from(t).filter((function(e){return!e.hasAttribute("disabled")&&!e.hasAttribute("hidden")&&(!e.hasAttribute("tabindex")||e.hasAttribute("tabindex")&&!e.getAttribute("tabindex").startsWith("-"))}))},e.getMatchModeMsgs=function(e){return{start:e.LABEL_STARTS_WITH,startignorecase:e.LABEL_STARTS_WITH_IGNORECASE,end:e.LABEL_ENDS_WITH,endignorecase:e.LABEL_ENDS_WITH_IGNORECASE,anywhere:e.LABEL_CONTAINS,anywhereignorecase:e.LABEL_CONTAINS_IGNORECASE,exact:e.LABEL_IS_EQUAL_TO,exactignorecase:e.LABEL_IS_EQUAL_TO_IGNORECASE,notequals:e.LABEL_IS_NOT_EQUAL_TO,notequalsignorecase:e.LABEL_IS_NOT_EQUAL_TO_IGNORECASE,lessthan:e.LABEL_LESS_THAN,lessthanequal:e.LABEL_LESS_THAN_OR_EQUALS_TO,greaterthan:e.LABEL_GREATER_THAN,greaterthanequal:e.LABEL_GREATER_THAN_OR_EQUALS_TO,null:e.LABEL_IS_NULL,isnotnull:e.LABEL_IS_NOT_NULL,empty:e.LABEL_IS_EMPTY,isnotempty:e.LABEL_IS_NOT_EMPTY,nullorempty:e.LABEL_IS_NULL_OR_EMPTY,in:e.LABEL_IN,notin:e.LABEL_NOT_IN,between:e.LABEL_BETWEEN}},e.getMatchModeTypesMap=function(e){return e&&(L.number.push("in","notin","between"),L.date.push("between"),L.string.push("in","notin"),L.character.push("in","notin")),_.forEach(M,(function(e,t){_.forEach(e,(function(e){F[e]=L[t]}))})),F.default=_.union(L.number,L.string,L.character,L.date,L.date),F},e.getObjValueByKey=S,e.getOrderByExpr=function(e){e=e||[];var t=[];return _.forEach(e,(function(e){e.direction&&t.push(e.property+" "+e.direction.toLowerCase())})),_.join(t,",")},e.getOrderedDataset=Qt,e.getRangeFieldValue=xt,e.getRangeMatchMode=kt,e.getRowOperationsColumn=function(){return{field:"rowOperations",type:"custom",displayName:"Actions",width:"120px",readonly:!0,sortable:!1,searchable:!1,resizable:!1,selectable:!1,show:!0,operations:[],opConfig:{},pcDisplay:!0,mobileDisplay:!0,tabletDisplay:!0,include:!0,isRowOperation:!0}},e.getUniqObjsByDataField=function(e,t,n,i){var o,r=t===Ot;return o=r?_.uniqWith(e,_.isEqual):_.uniqBy(e,"key"),!n||i?o:_.filter(o,(function(e){return(r||_.trim(e.key))&&_.trim(e.label)}))},e.getWatchIdentifier=k,e.getWidgetPropsByType=J,e.groupData=function(e,t,n,o,r,a,s,l,c){var p={};if(_.includes(n,"(")){var u=i.$parseEvent(n);p=_.groupBy(t,(function(t){return u(e.viewParent,{row:t.dataObject||t})}))}else p=tn(t,n,o,r,a,s,l,c);return en(p,n,r)},e.handleHeaderClick=function(e){var t=$(e.target).closest(".item-group"),n=t.find("li.list-group-header .app-icon");n.hasClass("wi-chevron-down")?n.removeClass("wi-chevron-down").addClass("wi-chevron-up"):n.removeClass("wi-chevron-up").addClass("wi-chevron-down"),t.find(".group-list-item").toggle()},e.hasLinkToCurrentPage=C,e.interpolateBindExpressions=Tt,e.isActiveNavItem=T,e.isBooleanAttr=pe,e.isDataSetWidget=A,e.isDimensionProp=de,e.isStyle=W,e.parseValueByType=function(e,t,n,o){return n?n===i.FormWidgetType.NUMBER||n===i.FormWidgetType.SLIDER||n===i.FormWidgetType.CURRENCY?isNaN(Number(e))?null:o?e:Number(e):n===i.FormWidgetType.CHECKBOX||n===i.FormWidgetType.TOGGLE?pn(e):e:i.isNumberType(t)?isNaN(Number(e))?null:Number(e):t===i.DataType.BOOLEAN?pn(e):e},e.performDataOperation=function(t,n,o){return new Promise((function(r,a){if(t.execute(i.DataSource.Operation.SUPPORTS_CRUD)){var s=void 0;switch(o.operationType){case e.Live_Operations.UPDATE:s=i.DataSource.Operation.UPDATE_RECORD;break;case e.Live_Operations.INSERT:s=i.DataSource.Operation.INSERT_RECORD;break;case e.Live_Operations.DELETE:s=i.DataSource.Operation.DELETE_RECORD}t.execute(s,n).then((function(e){return function(e,t,n){e.error?n(e):t(e)}(e,r,a)}),a)}else if(t.execute(i.DataSource.Operation.IS_API_AWARE))if("wm.CrudVariable"===t.category){var l="insert"===o.operationType?"create":"delete"===o.operationType?"delete":"update";t.execute(i.DataSource.Operation.INVOKE,{skipNotification:!0,operation:l,inputFields:n}).then(r,a)}else t.execute(i.DataSource.Operation.SET_INPUT,n),t.execute(i.DataSource.Operation.INVOKE,{skipNotification:!0}).then(r,a);else r(n)}))},e.prepareFieldDefs=function(e,t){var n,i={objects:[],terminals:[]};if(e||(e=[]),t||(t={}),t.setBindingField=!0,t.columnCount=0,n=V(e),G(n,i,"",t),!t||t&&!t.filter)return i.terminals;switch(t.filter){case"all":return i;case"objects":return i.objects;case"terminals":return i.terminals}return i},e.propNameCSSKeyMap=U,e.provideAs=D,e.provideAsDialogRef=function(e){return D(e,b)},e.provideAsWidgetRef=N,e.refreshDataSource=function(e,t){return new Promise((function(n,o){e?e.execute(i.DataSource.Operation.LIST_RECORDS,{filterFields:t.filterFields||{},orderBy:t.orderBy,page:t.page||1,logicalOp:t.condition||""}).then(n,o):o()}))},e.register=Z,e.registerFormWidget=function(e,t){var n=Q+e,i=X.get(n);i&&t.forEach((function(e,t){return i.set(t,e)}))},e.setFocusTrap=function(e,t,n){return r.createFocusTrap(e,{onActivate:function(){return e.classList.add("is-active")},onDeactivate:function(){return e.classList.remove("is-active")},allowOutsideClick:t,setReturnFocus:n})},e.setHeaderConfig=cn,e.setHeaderConfigForTable=function(e,t,n,i){n?cn(e,t,n,i):e[i]=t},e.setItemByCompare=function(e,t,n){_.forEach(e,(function(e){if(i.isEqualWithFields(e.value,t,n))return e.selected=!0,!1}))},e.styler=Y,e.toggleAllHeaders=function(e){var t=$(e.nativeElement).find(".item-group");t.find(".group-list-item").toggle();var n=t.find("li.list-group-header .app-icon");n&&_.forEach(n,(function(e){(e=$(e)).hasClass("wi-chevron-down")?e.removeClass("wi-chevron-down").addClass("wi-chevron-up"):e.removeClass("wi-chevron-up").addClass("wi-chevron-down")}))},e.transformData=function(e,t){var n,i,o,r,a,s,l;return e=e||[],_.isArray(e)?_.isString(e[0])&&(i=[],_.forEach(e,(function(e){(n={})[t.split(".").join("-")]=e,i.push(n)})),e=i):(_.isString(e)&&(o=t.substring(t.indexOf(".")+1,t.length).split("."),r=[],a=o.length,l=s={},o.forEach((function(t,n){r.forEach((function(e){l=s[e]})),l[t]=n===a-1?e:{},r.push(t)})),e=s),e=[e]),e},e.transformDataWithKeys=function(e){var t=[];if(_.isObject(e[0])||_.isObject(e)&&!(e instanceof Array)){var n=Object.keys(e[0]||e);_.forEach(n,(function(e,n){t.push({key:e,label:e,value:e,index:n+1})}))}return t},e.transformFormData=function(e,t,n,o,r,a){var s=[];if(t){if(t=Xt(t),_.isUndefined(r)&&(r=1),_.isString(t))(t=t.split(",").map((function(e){return e.trim()}))).forEach((function(t,n){var o={key:t,value:t,label:i.isDefined(t)&&null!==t?t.toString():"",index:r+n};Zt(a,e,o,"value"),s.push(o)}));else if(_.isArray(t)&&!_.isObject(t[0]))t.forEach((function(t,n){var o={key:t,value:t,label:i.isDefined(t)&&null!==t?t.toString():"",index:r+n};Zt(a,e,o,"value"),s.push(o)}));else if(t instanceof Array||!_.isObject(t))n||(n=Ot),t.forEach((function(t,l){var c=n===Ot?r+l:S(t,n);if(!_.isUndefined(c)&&!_.isNull(c)){var p=E(t,{field:o.displayField,expression:o.displayExpr,bindExpression:o.bindDisplayExpr},e),u={key:c,label:i.isDefined(p)&&null!==p?p.toString():"",value:n===Ot?t:c,dataObject:t,index:r+l};(o.displayImgSrc||o.bindDisplayImgSrc)&&(u.imgSrc=E(t,{expression:o.displayImgSrc,bindExpression:o.bindDisplayImgSrc},e)),Zt(a,e,u,"dataObject"),s.push(u)}}));else{_.forEach(t,(function(n,o){var l={key:_.trim(o),value:o,label:i.isDefined(n)&&null!==n?n.toString():"",index:r,dataObject:t};Zt(a,e,l,"value"),s.push(l)}))}return s}},e.unsupportedStatePersistenceTypes=["On-Demand","Scroll"],e.updateDeviceView=function(e,t){void 0===t&&(t=!1);var n=e.querySelector(wn(jt.LEFT_PANEL)),i=e.querySelector(wn(jt.RIGHT_PANEL)),o=e.querySelector(wn(jt.HEADER)),r=o&&o.querySelector("."+jt.SEARCH),a=e.querySelector("."+jt.CONTENT);On(n,a,r,t),n?Sn(n,r):$(o).find(wn(jt.SWIPE_ELEM)).remove(),i&&En(i),r&&Cn(r,n)},e["\u02750"]=Ke,e["\u0275a"]=oe,e["\u0275b"]=Ie,e["\u0275c"]=xe,e["\u0275d"]=Fe,e["\u0275e"]=Ge,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@wm/transpiler"),require("@wm/core"),require("@angular/compiler")):"function"==typeof define&&define.amd?define("@wm/buildTask",["exports","@wm/transpiler","@wm/core","@angular/compiler"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.buildTask={}),e.wm.transpiler,e.wm.core,e.ng.compiler)}(this,(function(e,t,n,i){"use strict";var o=new n.IDGenerator("wm_carousel_ref_"),r=function(e){return e.attrs.find((function(e){return"type"===e.name&&"dynamic"===e.value}))},a=r;t.register("wm-carousel",(function(){return{pre:function(e,n){var i=o.nextUid();return n.set("carousel_ref",i),'<div class="app-carousel carousel"><carousel wmCarousel #'+i+'="wmCarousel" '+t.getAttrMarkup(e)+' interval="0" [ngClass]="'+i+'.navigationClass">'},post:function(){return"</carousel></div>"},template:function(e){if(r(e)){var i=e.attrs.find((function(e){return"dataset"===e.name})),o=e.attrs.find((function(e){return"name"===e.name}));if(!i)return;var a=t.getBoundToExpr(i.value);if(!a)return;n.updateTemplateAttrs(e,a,o.value)}},provide:function(e,t){var n=new Map;return n.set("carousel_ref",t.get("carousel_ref")),n}}}));var s=Object.freeze({__proto__:null,default:function(){},"\u02750":a}),l=1;t.register("wm-carousel-content",(function(){return{pre:function(e){return"<slide wmCarouselTemplate "+t.getAttrMarkup(e)+">"},post:function(){return"</slide>"}}})),t.register("wm-carousel-template",(function(){return{requires:["wm-carousel"],pre:function(e,n,i){var o=i.get("carousel_ref");return'<div *ngIf="!'+o+'.fieldDefs">{{'+o+".nodatamessage}}</div>\n <"+"slide wmCarouselTemplate "+t.getAttrMarkup(e)+' *ngFor="let item of '+o+'.fieldDefs; let i = index;">\n <ng-container [ngTemplateOutlet]="carouselTempRef'+l+'" [ngTemplateOutletContext]="{item:item, index:i}"></ng-container>\n </'+"slide>\n <ng-template #carouselTempRef"+l+++' let-item="item" let-index="index">'},post:function(){return"</ng-template>"}}}));var c=Object.freeze({__proto__:null,default:function(){}});t.register("wm-login",(function(){return{pre:function(e){return"<div wmLogin "+t.getAttrMarkup(e)+' eventsource.bind="Actions.loginAction">'},post:function(){return"</div>"},provide:function(){var e=new Map;return e.set("isLogin",!0),e}}}));var p=Object.freeze({__proto__:null,default:function(){}});t.register("wm-marquee",(function(){return{pre:function(e){return'<marquee onmouseover="this.stop();" onmouseout="this.start();" wmMarquee role="marquee" aria-live="off" '+t.getAttrMarkup(e)+">"},post:function(){return"</marquee>"}}}));var u=Object.freeze({__proto__:null,default:function(){}}),d=new n.IDGenerator("wm_anchor");t.register("wm-anchor",(function(){return{pre:function(e){var n=d.nextUid();return"<a wmAnchor #"+n+'="wmAnchor" role="link" data-identifier="anchor" [attr.aria-label]="'+n+".hint || "+n+'.caption" '+t.getAttrMarkup(e)+">"},post:function(){return"</a>"}}}));var h=Object.freeze({__proto__:null,default:function(){}});t.register("wm-audio",(function(){return{pre:function(e){return"<div wmAudio "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var m=Object.freeze({__proto__:null,default:function(){}}),f=new n.IDGenerator("wm_html");t.register("wm-html",(function(){return{pre:function(e){var n=f.nextUid();return"<div wmHtml #"+n+'="wmHtml" [attr.aria-label]="'+n+".hint || 'HTML content'\" "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var g=Object.freeze({__proto__:null,default:function(){}});t.register("wm-icon",(function(){return{pre:function(e){return'<span wmIcon aria-hidden="true" '+t.getAttrMarkup(e)+">"},post:function(){return"</span>"}}}));var v=Object.freeze({__proto__:null,default:function(){}});t.register("wm-iframe",(function(){return{pre:function(e){return"<div wmIframe "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var y=Object.freeze({__proto__:null,default:function(){}}),b=new n.IDGenerator("wm_label");t.register("wm-label",(function(){return{pre:function(e){var n=b.nextUid();return"<label wmLabel #"+n+'="wmLabel" [attr.aria-label]="'+n+'.hint" '+t.getAttrMarkup(e)+">"},post:function(){return"</label>"}}}));var w=Object.freeze({__proto__:null,default:function(){}}),P=new n.IDGenerator("wm_picture");t.register("wm-picture",(function(){return{pre:function(e){var n=P.nextUid();return"<img wmPicture #"+n+'="wmPicture" alt="image" wmImageCache="'+(e.get("offline")||"true")+'" [attr.aria-label]="'+n+".hint || 'Image'\" "+t.getAttrMarkup(e)+">"}}}));var O=Object.freeze({__proto__:null,default:function(){}}),S=new n.IDGenerator("wm_spinner");t.register("wm-spinner",(function(){return{pre:function(e){var n=S.nextUid();return"<div wmSpinner #"+n+'="wmSpinner" role="alert" [attr.aria-label]="'+n+'.hint || \'Loading...\'" aria-live="assertive" aria-busy="true" '+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var E=Object.freeze({__proto__:null,default:function(){}}),T=function(e,t){return e.attrs.find((function(e){return e.name===t}))},C=T,A=function(e,t){var n=T(e,t);if(n)return n.value},R=A,I=function(e){return new RegExp("bind:("+e+"|"+e+"\\[\\$i])\\.","g")},D=I;t.register("wm-progress-bar",(function(){return{template:function(e){var n=A(e,"dataset"),i=t.getBoundToExpr(n);if(i){var o=A(e,"type"),r=A(e,"datavalue"),a=I(i);o&&o.includes(i)&&(o=o.replace(a,""),T(e,"type").value=o),r&&r.includes(i)&&(r=r.replace(a,""),T(e,"datavalue").value=r)}},pre:function(e){return"<div wmProgressBar "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var N=Object.freeze({__proto__:null,default:function(){},"\u02750":C,"\u02751":R,"\u02752":D});t.register("wm-progress-circle",(function(){return{pre:function(e){return"<div wmProgressCircle "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var x=Object.freeze({__proto__:null,default:function(){}}),k=new n.IDGenerator("wm_richtexteditor");t.register("wm-richtexteditor",(function(){return{pre:function(e){var n=k.nextUid();return"<div wmRichTextEditor #"+n+'="wmRichTextEditor" role="textbox" [attr.aria-label]="'+n+".hint || 'Richtext editor'\" "+t.getFormMarkupAttr(e)+">"},post:function(){return"</div>"}}}));var M=Object.freeze({__proto__:null,default:function(){}});t.register("wm-search",(function(){return{pre:function(e){return"<div wmSearch "+t.getFormMarkupAttr(e)+" "+n.getNgModelAttr(e)+">"},post:function(){return"</div>"}}}));var L=Object.freeze({__proto__:null,default:function(){}});t.register("wm-tree",(function(){return{pre:function(e){return'<ul wmTree class="ztree" '+t.getAttrMarkup(e)+">"},post:function(){return"</ul>"}}}));var F=Object.freeze({__proto__:null});t.register("wm-card",(function(){return{pre:function(e){return"<div wmCard "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var j=Object.freeze({__proto__:null,default:function(){}});t.register("wm-card-content",(function(){return{pre:function(e){return"<div wmCardContent partialContainer "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var B=Object.freeze({__proto__:null,default:function(){}});t.register("wm-card-actions",(function(){return{pre:function(e){return"<div wmCardActions "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var G=Object.freeze({__proto__:null,default:function(){}});t.register("wm-card-footer",(function(){return{pre:function(e){return"<div wmCardFooter "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var V=Object.freeze({__proto__:null,default:function(){}});t.register("wm-chart",(function(){return{pre:function(e){return'<div wmChart redrawable aria-label="'+e.get("type")+' Chart" '+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var $=Object.freeze({__proto__:null,default:function(){}}),U=new n.IDGenerator("wm_accordion_ref_"),W=function(e){return e.attrs.find((function(e){return"type"===e.name&&"dynamic"===e.value}))},q=W;t.register("wm-accordion",(function(){return{pre:function(e,n){var i=U.nextUid();return n.set("accordion_ref",i),"<div wmAccordion #"+i+'="wmAccordion" role="tablist" aria-multiselectable="true" '+t.getAttrMarkup(e)+">"},post:function(){return"</div>"},template:function(e,i){if(W(e)){var o=e.attrs.find((function(e){return"dataset"===e.name})),r=e.attrs.find((function(e){return"name"===e.name}));if(!o)return;var a=t.getBoundToExpr(o.value);if(!a)return;n.updateTemplateAttrs(e,a,r.value)}},provide:function(e,t){var n=new Map;return n.set("accordion_ref",t.get("accordion_ref")),n}}}));var z=Object.freeze({__proto__:null,default:function(){},"\u02750":q}),H=new n.IDGenerator("wm_accordionpane");t.register("wm-accordionpane",(function(){return{pre:function(e){var n=H.nextUid();return"<div #"+n+'="wmAccordionPane" [attr.aria-expanded]="'+n+'.isActive" wmAccordionPane partialContainer wm-navigable-element="true" role="tab" '+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var Y=Object.freeze({__proto__:null,default:function(){}});t.register("wm-container",(function(){return{pre:function(e){return'<div wmContainer partialContainer wmSmoothscroll="'+(e.get("smoothscroll")||"false")+'" '+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var K=Object.freeze({__proto__:null,default:function(){}});t.register("wm-gridcolumn",(function(){return{pre:function(e){return"<div wmLayoutGridColumn "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var Q=Object.freeze({__proto__:null,default:function(){}});t.register("wm-gridrow",(function(){return{pre:function(e){return"<div wmLayoutGridRow "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var X=Object.freeze({__proto__:null,default:function(){}});t.register("wm-layoutgrid",(function(){return{pre:function(e){return"<div wmLayoutGrid "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var J=Object.freeze({__proto__:null,default:function(){}}),Z=new n.IDGenerator("wm_panel");t.register("wm-panel",(function(){return{pre:function(e){return"<div wmPanel #"+Z.nextUid()+'="wmPanel" partialContainer wm-navigable-element="true" '+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}})),t.register("wm-panel-footer",(function(){return{pre:function(e){return"<div wmPanelFooter "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var ee=Object.freeze({__proto__:null,default:function(){}});t.register("wm-segmented-control",(function(){return{pre:function(e){return"<div wmSegmentedControl "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var te=Object.freeze({__proto__:null,default:function(){}});t.register("wm-segment-content",(function(){return{pre:function(e){return"<li wmSegmentContent partialContainer wmSmoothscroll="+(e.get("smoothscroll")||"false")+' wm-navigable-element="true" '+t.getAttrMarkup(e)+">"},post:function(){return"</li>"}}}));var ne=Object.freeze({__proto__:null,default:function(){}}),ie=1;t.register("wm-repeat-template",(function(){return{requires:["wm-accordion","wm-tabs"],pre:function(e,n,i,o){var r=i&&i.get("accordion_ref")||o&&o.get("tabs_ref");if(r)return'<div *ngIf="'+r+".fieldDefs && !"+r+'.fieldDefs.length">{{'+r+".nodatamessage}}</div>\n <div wmRepeatTemplate "+t.getAttrMarkup(e)+' *ngFor="let item of '+r+'.fieldDefs; let i = index;">\n <ng-container [ngTemplateOutlet]="widgetRef'+ie+'" [ngTemplateOutletContext]="{item:item, index:i}"></ng-container>\n </div>\n <ng-template #widgetRef'+ie+++' let-item="item" let-index="index">'},post:function(){return"</ng-template>"}}}));var oe=Object.freeze({__proto__:null,default:function(){}}),re=new n.IDGenerator("wm_tabs_ref_"),ae=function(e){return e.attrs.find((function(e){return"type"===e.name&&"dynamic"===e.value}))},se=ae;t.register("wm-tabs",(function(){return{pre:function(e,n){var i=re.nextUid();return n.set("tabs_ref",i),"<div wmTabs #"+i+'="wmTabs" '+t.getAttrMarkup(e)+">"},post:function(){return"</div>"},template:function(e,i){if(ae(e)){var o=e.attrs.find((function(e){return"dataset"===e.name})),r=e.attrs.find((function(e){return"name"===e.name}));if(!o)return;var a=t.getBoundToExpr(o.value);if(!a)return;n.updateTemplateAttrs(e,a,r.value)}},provide:function(e,t){var n=new Map;return n.set("tabs_ref",t.get("tabs_ref")),n}}}));var le=Object.freeze({__proto__:null,default:function(){},"\u02750":se});t.register("wm-tabpane",(function(){return{pre:function(e){return"<div wmTabPane partialContainer "+t.getAttrMarkup(e)+' wm-navigable-element="true" role="tabpanel">'},post:function(){return"</div>"}}}));var ce=Object.freeze({__proto__:null,default:function(){}});t.register("wm-tile",(function(){return{pre:function(e){return'<div wmTile aria-describedby="Tile" wm-navigable-element="true" '+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var pe=Object.freeze({__proto__:null,default:function(){}});t.register("wm-wizard",(function(){return{pre:function(e){return'<div wmWizard role="tablist" '+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var ue=Object.freeze({__proto__:null,default:function(){}}),de=new n.IDGenerator("wizard_step_id_");t.register("wm-wizardstep",(function(){return{pre:function(e){var n=de.nextUid();return"<form wmWizardStep #"+n+'="wmWizardStep" '+t.getAttrMarkup(e)+'>\n <ng-template [ngIf]="'+n+'.isInitialized">'},post:function(){return"</ng-template></form>"}}}));var he=Object.freeze({__proto__:null,default:function(){}}),me=new n.IDGenerator("wm_barcodescanner");t.register("wm-barcodescanner",(function(){return{pre:function(e){var n=me.nextUid();return"<button wmBarcodescanner #"+n+'="wmBarcodescanner" [attr.aria-label]="'+n+".hint || 'Barcode scanner'\" "+t.getAttrMarkup(e)+">"},post:function(){return"</button>"}}}));var fe=Object.freeze({__proto__:null,default:function(){}}),ge=new n.IDGenerator("wm_camera");t.register("wm-camera",(function(){return{pre:function(e){var n=ge.nextUid();return"<button type='button' wmCamera #"+n+'="wmCamera" [attr.aria-label]="'+n+".hint || 'Camera'\" "+t.getAttrMarkup(e)+">"},post:function(){return"</button>"}}}));var ve=Object.freeze({__proto__:null,default:function(){}});t.register("wm-alertdialog",(function(){return{pre:function(e){return'<div wmAlertDialog role="alertdialog" wm-navigable-element="true" '+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var ye=Object.freeze({__proto__:null,default:function(){}});t.register("wm-confirmdialog",(function(){return{pre:function(e){return'<div wmConfirmDialog wm-navigable-element="true" '+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var be=Object.freeze({__proto__:null,default:function(){}});t.register("wm-dialogactions",(function(){return{pre:function(e){return'<ng-template #dialogFooter><div wmDialogFooter data-identfier="actions" '+t.getAttrMarkup(e)+">"},post:function(){return"</div></ng-template>"}}}));var we=Object.freeze({__proto__:null,default:function(){}});t.register("wm-dialog",(function(){return{pre:function(e){return"<div wmDialog "+t.getAttrMarkup(e)+' aria-modal="true" role="dialog" wm-navigable-element="true"><ng-template #dialogBody>'},post:function(){return"</ng-template></div>"}}})),t.register("wm-view",(function(){return{pre:function(e){return""},post:function(){return""}}}));var Pe=Object.freeze({__proto__:null,default:function(){}});t.register("wm-iframedialog",(function(){return{pre:function(e){return'<div wmIframeDialog wm-navigable-element="true" '+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var _e=Object.freeze({__proto__:null,default:function(){}});t.register("wm-logindialog",(function(){return{pre:function(e){return"<div wmDialog wmLoginDialog "+t.getAttrMarkup(e)+' eventsource.bind="Actions.loginAction" wm-navigable-element="true"><ng-template #dialogBody>'},post:function(){return"</ng-template></div>"}}}));var Oe=Object.freeze({__proto__:null,default:function(){}});t.register("wm-pagedialog",(function(){return{pre:function(e,n){var i=e.get("content");e.delete("content");var o=e.get("content.bind");e.delete("content.bind");var r=e.get("load.event");e.delete("load.event");var a="",s="";r&&(a='load.event="'+r+'"'),o?s='content.bind="'+o+'"':i&&(s='content="'+i+'"');var l="";return s&&(n.set("hasPartialContent",!0),l+="<ng-template><div wmContainer #partial partialContainer "+s+' width="100%" height="100%" '+a+">"),"<div wmPartialDialog "+t.getAttrMarkup(e)+">"+l},post:function(e,t){var n="";return t.get("hasPartialContent")&&(n="</div></ng-template>"),n+"</div>"}}}));var Se=Object.freeze({__proto__:null,default:function(){}}),Ee="quickedit",Te="form",Ce="dialog",Ae={integer:["number","text","select","checkboxset","radioset","rating","slider","currency","autocomplete","chips"],big_integer:["number","text","select","checkboxset","radioset","rating","slider","currency","autocomplete","chips"],short:["number","text","select","checkboxset","radioset","slider","currency","autocomplete","chips"],float:["number","text","select","checkboxset","radioset","slider","currency","autocomplete","chips"],big_decimal:["number","text","select","checkboxset","radioset","slider","currency","autocomplete","chips"],number:["number","text","select","checkboxset","radioset","slider","currency","autocomplete","chips"],double:["number","text","select","checkboxset","radioset","slider","currency","autocomplete","chips"],long:["number","text","select","checkboxset","radioset","rating","slider","currency","autocomplete","chips"],byte:["number","text","select","checkboxset","radioset","slider","currency","autocomplete","chips"],string:["text","number","textarea","password","richtext","select","checkboxset","radioset","date","time","timestamp","switch","currency","autocomplete","chips","colorpicker"],character:["text","number","textarea","password","richtext","select","checkboxset","radioset","switch","currency","autocomplete","chips"],text:["text","number","textarea","password","richtext","select","checkboxset","radioset","date","time","timestamp","switch","currency","autocomplete","chips","colorpicker"],date:["date","text","number","select","checkboxset","radioset","autocomplete","chips"],time:["time","text","number","select","checkboxset","radioset","autocomplete","chips"],timestamp:["timestamp","text","number","select","checkboxset","radioset","autocomplete","chips"],datetime:["datetime","text","select","checkboxset","radioset","autocomplete","chips"],boolean:["checkbox","radioset","toggle","select"],list:["select","radioset","checkboxset","switch","autocomplete","chips"],clob:["text","textarea","richtext"],blob:["upload"],file:["upload"],custom:["text","number","textarea","password","checkbox","toggle","slider","richtext","currency","switch","select","checkboxset","radioset","date","time","timestamp","rating","datetime","autocomplete","chips","colorpicker"]},Re=new Set([n.FormWidgetType.SELECT,n.FormWidgetType.CHECKBOXSET,n.FormWidgetType.RADIOSET,n.FormWidgetType.SWITCH,n.FormWidgetType.AUTOCOMPLETE,n.FormWidgetType.CHIPS,n.FormWidgetType.TYPEAHEAD,n.FormWidgetType.RATING]),Ie=function(e){var t=Ae[e]&&Ae[e][0];return e===n.DataType.BOOLEAN&&(t=n.FormWidgetType.SELECT),[n.FormWidgetType.TEXT,n.FormWidgetType.NUMBER,n.FormWidgetType.SELECT,n.FormWidgetType.AUTOCOMPLETE,n.FormWidgetType.DATE,n.FormWidgetType.TIME,n.FormWidgetType.DATETIME].includes(t)?t:n.FormWidgetType.TEXT},De=new n.IDGenerator("formfield_"),Ne=function(e){var n=new Map;return e.has("focus.event")||e.set("focus.event",""),e.has("blur.event")||e.set("blur.event",""),e.forEach((function(t,i){i.endsWith(".event")&&("focus.event"===i?t="_onFocusField($event);"+t:"blur.event"===i&&(t="_onBlurField($event);"+t),n.set(i,t),e.delete(i))})),t.getFormMarkupAttr(n)},xe=Ne,ke=new Map([[n.FormWidgetType.SELECT,["Select Min value","Select Max value","Select value"]],[n.FormWidgetType.DATETIME,["Select Min date time","Select Max date time","Select date time"]],[n.FormWidgetType.TIME,["Select Min time","Select Max time","Select time"]],[n.FormWidgetType.DATE,["Select Min date","Select Max date","Select date"]],[n.FormWidgetType.TEXTAREA,["","","Enter value"]],[n.FormWidgetType.RICHTEXT,["","","Enter value"]],[n.FormWidgetType.COLORPICKER,["Select Color","Select Color","Select Color"]],[n.FormWidgetType.CHIPS,["","","Type here..."]],[n.FormWidgetType.PASSWORD,["Enter Min value","Enter Max value","Enter value"]],[n.FormWidgetType.NUMBER,["Enter Min value","Enter Max value","Enter value"]],[n.FormWidgetType.TEXT,["Enter Min value","Enter Max value","Enter value"]],[n.FormWidgetType.CURRENCY,["Enter Min value","Enter Max value","Enter value"]],[n.FormWidgetType.AUTOCOMPLETE,["","","Search"]]]),Me=function(e,t,n){var i=1===n?"maxplaceholder":"placeholder",o=e.get(i);o||""===o||(o=ke.get(t)&&ke.get(t)[n])&&e.set(i,o)},Le=Me,Fe=function(e,t){var i=e.get("name"),o=(e.get("key")||i||"").trim(),r=t.isMaxWidget?'formControlName="'+o+'_max"':t.isInList?'[formControlName]="'+t.counter+'._fieldName"':'formControlName="'+o+'"',a=t.isMaxWidget?"#formWidgetMax":"#formWidget",s=i?t.isMaxWidget?'name="'+i+'_formWidgetMax"':'name="'+i+'_formWidget"':"",l='[ngClass]="'+e.get("ngclass")+'"',c='[class.hidden]="!'+t.pCounter+".isUpdateMode && "+t.counter+".viewmodewidget !== 'default'\" "+r+" "+t.eventsTmpl+" "+l+" "+a+" "+s;return n.getFormWidgetTemplate(t.widgetType,c,e,{counter:t.counter,pCounter:t.pCounter})},je=Fe,Be=function(e,t,i,o,r,a){if(!("true"===e.get("is-range")))return Fe(e,{widgetType:t,eventsTmpl:i,counter:o,pCounter:r,isInList:a});var s=n.isMobileApp()?"col-xs-6":"col-sm-6";return'<div class="'+s+'">'+Fe(e,{widgetType:t,eventsTmpl:i,counter:o,pCounter:r})+'</div>\n <div class="'+s+'">'+Fe(e,{widgetType:t,eventsTmpl:i,counter:o,pCounter:r,isMaxWidget:!0})+"</div>"},Ge=Be,Ve=function(e,t,i){if("true"===e.get("is-related"))return i+".getDisplayExpr()";if(t===n.FormWidgetType.PASSWORD)return"'********'";var o,r=i+".value";return t===n.FormWidgetType.DATETIME||t===n.FormWidgetType.TIMESTAMP?r+=" | toDate:"+i+".formWidget.datepattern || 'yyyy-MM-dd hh:mm:ss a'":t===n.FormWidgetType.TIME?r+=" | toDate:"+i+".formWidget.timepattern || 'hh:mm a'":t===n.FormWidgetType.DATE?r+=" | toDate:"+i+".formWidget.datepattern || 'yyyy-MMM-dd'":t===n.FormWidgetType.RATING||t===n.FormWidgetType.UPLOAD?"":(o=t,Re.has(o)&&"All Fields"===e.get("datafield")?i+".getDisplayExpr()":i+".getCaption()")},$e=Ve,Ue=function(e){return{requires:["wm-form","wm-liveform","wm-livefilter","wm-list"],pre:function(i,o,r,a,s,l){var c=De.nextUid(),p=r||a||s,u=p&&p.get("form_reference")||"form",d=i.get("widget")||n.FormWidgetType.TEXT,h=e?"form-field":"filter-field",m="wmform-field-error-"+n.generateGUId(),f=e?'<p *ngIf="'+c+"._control?.invalid && "+c+"._control?.touched && "+u+'.isUpdateMode"\n class="help-block text-danger" aria-hidden="false" role="alert"\n aria-live="assertive" [attr.aria-label]="'+c+'.validationmessage" id="'+m+'"><span aria-hidden="true" [textContent]="'+c+'.validationmessage"></span></p>':"",g=d===n.FormWidgetType.UPLOAD?"":Ne(i),v=n.isMobileApp()?"col-xs-12":"col-sm-12",y=u===(l&&l.get("parent_form_reference"));return i.set("__validationId",m),i.set("__widgetType",d),i.delete("widget"),o.set("counter",c),"true"===i.get("is-range")?(Me(i,d,0),Me(i,d,1)):Me(i,d,2),'<div data-role="'+h+'" [formGroup]="'+u+'.ngform" wmFormField captionPosition #'+c+'="wmFormField" widgettype="'+d+'" '+t.getFormMarkupAttr(i)+'>\n <div class="live-field form-group app-composite-widget clearfix caption-{{'+u+'.captionposition}}" widget="'+d+'">\n <label [hidden]="!'+c+'.displayname" class="app-label control-label formfield-label {{'+u+'._captionClass}}"\n [ngStyle]="{width: '+u+".captionsize}\" [ngClass]=\"{'text-danger': "+c+"._control?.invalid && "+c+"._control?.touched && "+u+".isUpdateMode,\n required: "+u+".isUpdateMode && "+c+'.required}" [textContent]="'+c+'.displayname"> </label>\n <div [ngClass]="'+c+".displayname ? "+u+"._widgetClass : '"+v+'\'">\n <label class="form-control-static app-label"\n [hidden]="'+u+".isUpdateMode || "+c+".viewmodewidget === 'default' || "+c+".widgettype === 'upload'\" [innerHTML]=\""+Ve(i,d,c)+'"></label>\n '+Be(i,d,g,c,u,y)+'\n <span aria-hidden="true" *ngIf="'+c+'.showPendingSpinner" class="form-field-spinner fa fa-circle-o-notch fa-spin form-control-feedback"></span>\n <p *ngIf="!('+c+"._control?.invalid && "+c+"._control?.touched) && "+u+'.isUpdateMode"\n class="help-block" aria-hidden="true" role="alert" aria-live="polite" [textContent]="'+c+'.hint"></p>\n '+f+"\n </div>\n </div>"},post:function(){return"</div>"},provide:function(e,t){var n=new Map;return n.set("form_reference",t.get("counter")),n},imports:function(e){var t=n.getRequiredFormWidget(e.get("__widgetType")||e.get("type"));return e.delete("__widgetType"),[t,"wm-form"]}}},We=Ue;t.register("wm-form-field",Ue.bind(this,!0)),t.register("wm-filter-field",Ue.bind(this,!1));var qe=Object.freeze({__proto__:null,default:function(){},"\u02750":xe,"\u02751":Le,"\u02752":je,"\u02753":Ge,"\u02754":$e,"\u02755":We}),ze=function(e){return{pre:function(n){return'<div wmFormAction name="'+(n.get("name")||n.get("key"))+'" '+t.getAttrMarkup(n)+" "+e+">"},post:function(){return"</div>"}}},He=ze;t.register("wm-form-action",ze.bind(this,"")),t.register("wm-filter-action",ze.bind(this,' update-mode="true" '));var Ye,Ke=Object.freeze({__proto__:null,default:function(){},"\u02750":He}),Qe=new n.IDGenerator("form_"),Xe=new Set(["wm-text","wm-textarea","wm-checkbox","wm-slider","wm-richtexteditor","wm-currency","wm-switch","wm-select","wm-checkboxset","wm-radioset","wm-date","wm-time","wm-timestamp","wm-upload","wm-rating","wm-datetime","wm-search","wm-chips","wm-colorpicker","wm-table"]),Je=function(e){void 0===e&&(e=[]),e.forEach((function(e){if("wm-form-field"===e.name&&Ye++,Xe.has(e.name)){var t=e.attrs.find((function(e){return"key"===e.name||"name"===e.name}));if(!(t=t&&t.value)){var n=e.attrs.find((function(e){return"datavalue"===e.name}));if(n&&n.value){(n=n.value.match(/\((.*)\)/))&&n.length>1&&(t=n[1].replace(/["']/g,""))}}e.attrs.push(new i.Attribute("formControlName",t,1,1,1,void 0,void 0)),e.attrs.push(new i.Attribute("wmFormWidget","",1,1,1,void 0,void 0))}Je(e.children)}))},Ze=Je,et=function(e){if(e.get("formdata.bind")){var n=t.getDataSource(e.get("formdata.bind"));n&&e.set("formdatasource.bind",n)}},tt=et,nt=function(e){return void 0===e&&(e=""),{requires:["wm-livetable","wm-login"],template:function(e){Ye=0,Je(e.children)},pre:function(n,i,o,r){var a,s,l=r&&r.get("isLogin")?"app-login":"",c=Qe.nextUid(),p=n.get("dependson")?'dependson="'+n.get("dependson")+'"':"",u="page"===n.get("formlayout")?"app-device-liveform panel liveform-inline":"";n.delete("dependson");var d='<form wmForm data-role="'+l+'" '+e+" #"+c+' ngNativeValidate [formGroup]="'+c+'.ngform" [noValidate]="'+c+".validationtype !== 'html'\"\n class=\""+u+'" [class]="'+c+'.captionAlignClass" [autocomplete]="'+c+".autocomplete ? 'on' : 'off'\" captionposition="+n.get("captionposition");if(n.set("numberOfFields",""+Ye),i.set("counter",c),et(n),"dialog"===n.get("formlayout")){s=o?o.get("liveform_dialog_id"):"liveform_dialog_id_"+c,n.set("dialogId",s);var h=new Map;return["title","title.bind","iconclass","iconclass.bind","width"].forEach((function(e){n.get(e)&&h.set(e,n.get(e))})),n.set("width","100%"),a=t.getAttrMarkup(n),'<div data-identifier="liveform" init-widget class="app-liveform liveform-dialog" '+p+' dialogid="'+s+'">\n <div wmDialog class="app-liveform-dialog" name="'+s+'" role="form" '+t.getAttrMarkup(h)+' modal="true">\n <ng-template #dialogBody>\n '+d+" "+a+">"}var m="",f="";if("page"===n.get("formlayout")){var g="device_liveform_header_"+c,v=new Map;v.set("title",n.get("title")),v.set("backbtnclick.event",n.get("backbtnclick.event")),f='<ng-template #buttonRef let-btn="btn">\n <button wmButton name="{{btn.key}}" class="navbar-btn btn-primary btn-transparent" iconclass.bind="btn.iconclass" show.bind="btn.show"\n (click)="'+c+'.invokeActionEvent($event, btn.action)" type.bind="btn.type" hint.bind="btn.title" shortcutkey.bind="btn.shortcutkey" disabled.bind="btn.disabled"\n tabindex.bind="btn.tabindex" [class.hidden]="btn.updateMode ? !'+c+".isUpdateMode : "+c+'.isUpdateMode"></button>\n </ng-template>',m='<header wmMobileNavbar name="'+g+'" '+t.getAttrMarkup(v)+'>\n <ng-container *ngFor="let btn of '+c+'.buttonArray" [ngTemplateOutlet]="buttonRef" [ngTemplateOutletContext]="{btn:btn}">\n </ng-container>\n </header>\n <div class="form-elements panel-body" >'}return d+" "+(a=t.getAttrMarkup(n))+" "+p+">\n "+f+" "+m},post:function(e){return"dialog"===e.get("formlayout")?"</form></ng-template></div></div>":"page"===e.get("formlayout")?"</div></form>":"</form>"},provide:function(e,t){var n=new Map;return n.set("form_reference",t.get("counter")),n}}},it=nt;t.register("wm-form",nt),t.register("wm-liveform",(function(){return nt("wmLiveForm")})),t.register("wm-livefilter",(function(){return nt("wmLiveFilter")}));var ot=Object.freeze({__proto__:null,default:function(){},"\u02750":Ze,"\u02751":tt,"\u02752":it});t.register("wm-calendar",(function(){return{pre:function(e){return'<div wmCalendar redrawable style="width:100%" aria-label="'+(e.get("view")?e.get("view")+" view":"month view")+'" '+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var rt=Object.freeze({__proto__:null,default:function(){}});t.register("wm-chips",(function(){return{pre:function(e){return'<ul wmChips role="listbox" '+t.getAttrMarkup(e)+" "+n.getNgModelAttr(e)+">"},post:function(){return"</ul>"}}}));var at=Object.freeze({__proto__:null,default:function(){}});t.register("wm-colorpicker",(function(){return{pre:function(e){return"<div wmColorPicker "+t.getAttrMarkup(e)+' role="input" '+t.getChildAttrs(e)+" "+n.getNgModelAttr(e)+">"},post:function(){return"</div>"}}}));var st=Object.freeze({__proto__:null,default:function(){}});t.register("wm-currency",(function(){return{pre:function(e){return"<div wmCurrency "+t.getAttrMarkup(e)+' role="input" '+t.getChildAttrs(e)+" "+n.getNgModelAttr(e)+">"},post:function(){return"</div>"}}}));var lt=Object.freeze({__proto__:null,default:function(){}});t.register("wm-buttongroup",(function(){return{pre:function(e){return'<div wmButtonGroup role="group" aria-labelledby="button group" '+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var ct=Object.freeze({__proto__:null,default:function(){}}),pt=new n.IDGenerator("wm_button");t.register("wm-button",(function(){return{pre:function(e){var n=pt.nextUid();return"<button wmButton #"+n+'="wmButton" [attr.aria-label]="'+n+".hint || "+n+'.caption" '+t.getAttrMarkup(e)+">"},post:function(){return"</button>"}}}));var ut=Object.freeze({__proto__:null,default:function(){}});t.register("wm-checkbox",(function(){return{pre:function(e){return"<div wmCheckbox "+t.getFormMarkupAttr(e)+" "+t.getChildAttrs(e)+" "+n.getNgModelAttr(e)+">"},post:function(){return"</div>"}}}));var dt=Object.freeze({__proto__:null,default:function(){}});t.register("wm-checkboxset",(function(){return{pre:function(e){return'<ul role="group" wmCheckboxset '+t.getFormMarkupAttr(e)+" "+t.getChildAttrs(e)+" "+n.getNgModelAttr(e)+">"},post:function(){return"</ul>"}}}));var ht=Object.freeze({__proto__:null,default:function(){}});t.register("wm-composite",(function(){return{pre:function(e){return"<div wmComposite captionPosition "+t.setChildAttrs(e)+" "+t.getAttrMarkup(e)+">"},post:function(){return"</div"+t.clearChildAttrs()+">"}}}));var mt=Object.freeze({__proto__:null,default:function(){}});t.register("wm-number",(function(){return{pre:function(e){return"<div wmNumber "+t.getFormMarkupAttr(e)+" "+t.getChildAttrs(e)+" "+n.getNgModelAttr(e)+">"},post:function(){return"</div>"}}}));var ft=Object.freeze({__proto__:null,default:function(){}});t.register("wm-radioset",(function(){return{pre:function(e){return'<ul role="radiogroup" wmRadioset '+t.getFormMarkupAttr(e)+" "+t.getChildAttrs(e)+" "+n.getNgModelAttr(e)+">"},post:function(){return"</ul>"}}}));var gt=Object.freeze({__proto__:null,default:function(){}});t.register("wm-select",(function(){return{pre:function(e){return"<wm-select "+t.getFormMarkupAttr(e)+" "+t.getChildAttrs(e)+" "+n.getNgModelAttr(e)+">"},post:function(){return"</wm-select>"}}}));var vt=Object.freeze({__proto__:null,default:function(){}}),yt=new n.IDGenerator("wm_switch");t.register("wm-switch",(function(){return{pre:function(e){var i=yt.nextUid();return"<div wmSwitch #"+i+'="wmSwitch" [attr.aria-label]="'+i+".hint || 'Switch button'\" "+t.getFormMarkupAttr(e)+" "+n.getNgModelAttr(e)+">"},post:function(){return"</div>"}}}));var bt=Object.freeze({__proto__:null,default:function(){}});t.register("wm-text",(function(){return{pre:function(e){return"<wm-input "+t.getFormMarkupAttr(e)+" "+t.getChildAttrs(e)+" "+n.getNgModelAttr(e)+">"},post:function(){return"</wm-input>"}}}));var wt=Object.freeze({__proto__:null,default:function(){}});t.register("wm-textarea",(function(){return{pre:function(e){return"<wm-textarea "+t.getFormMarkupAttr(e)+" "+t.getChildAttrs(e)+" "+n.getNgModelAttr(e)+">"},post:function(){return"</wm-textarea>"}}}));var Pt=Object.freeze({__proto__:null,default:function(){}});t.register("wm-datetime",(function(){return{pre:function(e){return"<div wmDateTime "+t.getFormMarkupAttr(e)+" "+t.getChildAttrs(e)+" "+n.getNgModelAttr(e)+">"},post:function(){return"</div>"}}}));var _t=Object.freeze({__proto__:null,default:function(){}});t.register("wm-date",(function(){return{pre:function(e){return"<div wmDate "+t.getFormMarkupAttr(e)+" "+t.getChildAttrs(e)+" "+n.getNgModelAttr(e)+">"},post:function(){return"</div>"}}}));var Ot=Object.freeze({__proto__:null,default:function(){}});t.register("wm-time",(function(){return{pre:function(e){return"<div wmTime "+t.getFormMarkupAttr(e)+" "+t.getChildAttrs(e)+" "+n.getNgModelAttr(e)+">"},post:function(){return"</div>"}}}));var St=Object.freeze({__proto__:null,default:function(){}});t.register("wm-fileupload",(function(){return{pre:function(e){if(e.get("select.event")){var n=t.getDataSource(e.get("select.event"));e.set("datasource.bind",n)}return"<div wmFileUpload "+t.getAttrMarkup(e)+' role="input">'},post:function(){return"</div>"}}}));var Et=Object.freeze({__proto__:null,default:function(){}});t.register("wm-rating",(function(){return{pre:function(e){return"<div wmRating "+t.getFormMarkupAttr(e)+" "+n.getNgModelAttr(e)+">"},post:function(){return"</div>"}}}));var Tt=Object.freeze({__proto__:null,default:function(){}});t.register("wm-slider",(function(){return{pre:function(e){return"<div wmSlider "+t.getAttrMarkup(e)+" "+n.getNgModelAttr(e)+">"},post:function(){return"</div>"}}}));var Ct=Object.freeze({__proto__:null,default:function(){}});function At(e,t,n,o){var r=e.attrs.find((function(e){return e.name===t}));r&&n.attrs.push(new i.Attribute(o,r.value,r.sourceSpan,r.keySpan,r.valueSpan,void 0,void 0))}t.register("wm-media-list",(function(){return{template:function(e){var t,n=e.attrs.find((function(e){return"dataset"===e.name})),o=function(e){void 0===e&&(e=[]),e.forEach((function(e){e.name&&"wm-list"!==e.name&&(e.attrs.forEach((function(e){e.value.startsWith("bind:"+t+".data[$i]")?e.value=e.value.replace(t+".data[$i]","item"):e.value.startsWith("bind:"+t)&&(e.value=e.value.replace(t,"item"))})),o(e.children))}))};n&&n.value.startsWith("bind:")&&(t=n.value.replace("bind:","")),t&&o(e.children);var r=e.children.find((function(e){return e instanceof i.Element&&"wm-media-template"===e.name}));null!=r&&(At(r,"width",e,"thumbnailwidth"),At(r,"height",e,"thumbnailheight"))},pre:function(e){return"<div wmMediaList "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var Rt=Object.freeze({__proto__:null,default:function(){}});t.register("wm-media-template",(function(){return{pre:function(){return'<ng-template #mediaListTemplate let-item="item" let-index="index">'},post:function(){return"</ng-template>"}}}));var It=Object.freeze({__proto__:null,default:function(){}});t.register("wm-list",(function(){return{requires:["wm-form","wm-liveform"],template:function(e){var i=e.attrs.find((function(e){return"dataset"===e.name})),o=e.attrs.find((function(e){return"name"===e.name}));if(i){var r=t.getBoundToExpr(i.value);r&&n.updateTemplateAttrs(e,r,o.value,"itemRef.")}},pre:function(e,n,i,o){var r=i||o;return n.set("form_reference",r&&r.get("form_reference")),"<div wmList wmLiveActions "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"},provide:function(e,t){var n=new Map;return n.set("parent_form_reference",t.get("form_reference")),n}}})),t.register("wm-listtemplate",(function(){return{pre:function(){return'<ng-template #listTemplate let-item="item" let-$index="$index" let-itemRef="itemRef" let-$first="$first" let-$last="$last" let-currentItemWidgets="currentItemWidgets" >'},post:function(){return"</ng-template>"}}})),t.register("wm-list-action-template",(function(){return{template:function(e){e.attrs.find((function(e){return"position"===e.name})).value;e.children.filter((function(e){return e instanceof i.Element&&"wm-button"===e.name})).forEach((function(t){var n,o,r,a;n="position",o=t,r="swipe-position",(a=e.attrs.find((function(e){return e.name===n})))&&o.attrs.push(new i.Attribute(r,a.value,a.sourceSpan,a.keySpan,a.valueSpan,void 0,void 0))}))},pre:function(e,n){return"left"===e.get("position")?'<ng-template #listLeftActionTemplate>\n <li class="app-list-item-action-panel app-list-item-left-action-panel actionMenu" '+t.getAttrMarkup(e)+">":"right"===e.get("position")?'<ng-template #listRightActionTemplate>\n <li class="app-list-item-action-panel app-list-item-right-action-panel actionMenu" '+t.getAttrMarkup(e)+">":void 0},post:function(){return"</li></ng-template>"}}}));var Dt=Object.freeze({__proto__:null,default:function(){}}),Nt=new n.IDGenerator("liveform_dialog_id_");t.register("wm-livetable",(function(){return{pre:function(e,n){var i=Nt.nextUid();return n.set("counter",i),"<div wmLiveTable "+t.getAttrMarkup(e)+' dialogid="'+i+'">'},post:function(){return"</div>"},provide:function(e,t){var n=new Map;return n.set("liveform_dialog_id",t.get("counter")),n}}}));var xt=Object.freeze({__proto__:null,default:function(){}}),kt=new n.IDGenerator("wm_message");t.register("wm-message",(function(){return{pre:function(e){return'<p wmMessage tabindex="0" #'+kt.nextUid()+'="wmMessage" '+t.getAttrMarkup(e)+">"},post:function(){return"</p>"}}}));var Mt=Object.freeze({__proto__:null,default:function(){}});t.register("wm-breadcrumb",(function(){return{pre:function(e){return"<ol wmBreadcrumb "+t.getAttrMarkup(e)+">"},post:function(){return"</ol>"}}}));var Lt=Object.freeze({__proto__:null,default:function(){}});t.register("wm-menu",(function(){return{pre:function(e){return"<div wmMenu dropdown "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var Ft=Object.freeze({__proto__:null,default:function(){}});t.register("wm-nav-item",(function(){return{pre:function(e){return'<li wmNavItem role="listitem" '+t.getAttrMarkup(e)+">"},post:function(){return"</li>"}}}));var jt=Object.freeze({__proto__:null,default:function(){}});t.register("wm-nav",(function(){return{pre:function(e){return'<ul wmNav data-element-type="wmNav" data-role="page-header" role="list" '+t.getAttrMarkup(e)+">"},post:function(){return"</ul>"}}}));var Bt=Object.freeze({__proto__:null,default:function(){}});t.register("wm-navbar",(function(){return{pre:function(e){return'<nav wmNavbar data-element-type="wmNavbar" role="navigation" '+t.getAttrMarkup(e)+">"},post:function(){return"</nav>"}}}));var Gt=Object.freeze({__proto__:null,default:function(){}});t.register("wm-popover",(function(){return{requires:["wm-table"],pre:function(e,n,i){var o;if("inline"!==e.get("contentsource")){var r=e.get("content"),a=e.get("content.bind"),s="";r?s='content="'+r+'"':a&&(s='content.bind="'+a+'"'),o="<div wmContainer #partial partialContainer "+s+">",n.set("hasPopoverContent",!0)}var l="<wm-popover wmPopover "+t.getAttrMarkup(e)+">";return l+="<ng-template "+(i?'let-row="row"':"")+'><div tabindex="0" class="popover-start sr-only" aria-label="">popover content start</div>',o&&(l+=""+(o||"")),l},post:function(e,t){var n="";return t.get("hasPopoverContent")&&(n+="</div>"),n+'<div tabindex="0" class="popover-end sr-only" aria-label="">popover content ended</div></ng-template></'+"wm-popover>"}}}));var Vt=Object.freeze({__proto__:null,default:function(){}}),$t=function(e,t){return e&&e.children.find((function(e){return e instanceof i.Element&&e.name===t}))},Ut=$t,Wt=function(e){return new i.Element(e,[],[],Qt,Qt,Qt)},qt=Wt,zt=function(e,t,n){var o=new i.Attribute(t,n,Qt,Qt,Qt,void 0,void 0);e.attrs.push(o)},Ht=zt,Yt=function(e,t){var n;if(t)return _.forEach(t.children,(function(t){return t instanceof i.Element&&(t.name===e?n=t:t.children&&(n=Yt(e,t))),!n})),n},Kt=Yt,Qt={},Xt=new n.IDGenerator("wm_page");t.register("wm-page",(function(){return{template:function(e){var t=$t($t(e,"wm-content"),"wm-page-content");if(t||(t=Yt("wm-page-content",Yt("wm-content",e))),t){var o=Wt("ng-container");if(zt(o,"*ngIf","compilePageContent"),o.children=o.children.concat(t.children),o.children.push(new i.Text("{{onPageContentReady()}}",null,void 0,void 0)),t.children=[o],n.isMobileApp()){var r=Wt("div");zt(r,"wmPageContentLoader",""),zt(r,"*ngIf","!showPageContent"),t.children.push(r)}}},pre:function(e){var n=Xt.nextUid();return"<div wmPage #"+n+'="wmPage" data-role="pageContainer" [attr.aria-label]="'+n+'.hint" '+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var Jt=Object.freeze({__proto__:null,default:function(){},"\u02750":Ut,"\u02751":qt,"\u02752":Ht,"\u02753":Kt}),Zt=new n.IDGenerator("wm_layout");t.register("wm-layout",(function(){return{pre:function(e){var n=Zt.nextUid();return"<div wmLayout #"+n+'="wmLayout" data-role="pageContainer" [attr.aria-label]="'+n+".hint || 'Main page content'\" "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var en=Object.freeze({__proto__:null,default:function(){}}),tn="router-outlet";t.register("wm-router-outlet",(function(){return{pre:function(e){return'<div wmRouterOutlet name="wmRouterOutlet" '+t.getAttrMarkup(e)+"><"+tn+' (activate)="onActivate($event)">'},post:function(){return"</router-outlet></div>"}}}));var nn=Object.freeze({__proto__:null,default:function(){}});t.register("wm-pagination",(function(){return{pre:function(e){return'<nav wmPagination data-identifier="pagination" aria-label="Page navigation" '+t.getAttrMarkup(e)+">"},post:function(){return"</nav>"}}}));var on=Object.freeze({__proto__:null,default:function(){}});t.register("wm-content",(function(){return{pre:function(e){return'<main wmContent data-role="page-content" role="main" '+t.getAttrMarkup(e)+">"},post:function(){return"</main>"}}}));var rn=Object.freeze({__proto__:null,default:function(){}}),an=new n.IDGenerator("wm_footer");t.register("wm-footer",(function(){return{pre:function(e){var n=an.nextUid();return"<footer wmFooter #"+n+'="wmFooter" partialContainer data-role="page-footer" role="contentinfo" [attr.aria-label]="'+n+".hint || 'Page footer'\" "+t.getAttrMarkup(e)+">"},post:function(){return"</footer>"}}}));var sn=Object.freeze({__proto__:null,default:function(){}}),ln=new n.IDGenerator("wm_header");t.register("wm-header",(function(){return{pre:function(e){var n=ln.nextUid();return"<header wmHeader #"+n+'="wmHeader" partialContainer data-role="page-header" role="banner" [attr.aria-label]="'+n+".hint || 'Page header'\" "+t.getAttrMarkup(e)+">"},post:function(){return"</header>"}}}));var cn=Object.freeze({__proto__:null,default:function(){}}),pn=new n.IDGenerator("wm_left_panel");t.register("wm-left-panel",(function(){return{pre:function(e){var n=pn.nextUid();return"<aside wmLeftPanel #"+n+'="wmLeftPanel" partialContainer data-role="page-left-panel" [attr.aria-label]="'+n+".hint || 'Left navigation panel'\" wmSmoothscroll=\""+(e.get("smoothscroll")||"false")+'" '+t.getAttrMarkup(e)+">"},post:function(){return"</aside>"}}}));var un=Object.freeze({__proto__:null,default:function(){}});t.register("wm-mobile-navbar",(function(){return{pre:function(e){return"<header wmMobileNavbar "+t.getAttrMarkup(e)+">"},post:function(){return"</header>"}}}));var dn=Object.freeze({__proto__:null,default:function(){}}),hn=new n.IDGenerator("wm_right_panel");t.register("wm-right-panel",(function(){return{pre:function(e){var n=hn.nextUid();return"<aside wmRightPanel #"+n+'="wmRightPanel" partialContainer data-role="page-right-panel" role="complementary" [attr.aria-label]="'+n+".hint || 'Right navigation panel'\" "+t.getAttrMarkup(e)+">"},post:function(){return"</aside>"}}}));var mn=Object.freeze({__proto__:null,default:function(){}});Object.create;function fn(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.")}Object.create;var gn=function(e){return new i.Element(e,[],[],wn,wn,wn)},vn=gn,yn=function(e,t,n){var o=new i.Attribute(t,n,wn,wn,wn,void 0,void 0);e.attrs.push(o)},bn=yn,wn={};t.register("wm-page-content",(function(){return{template:function(e){var t,n;try{for(var o=fn(e.attrs),r=o.next();!r.done;r=o.next()){var a=r.value;if("spa"===a.name&&"true"===a.value){var s=gn("ng-container");yn(s,"*ngIf","compilePageContent"),s.children=s.children.concat(e.children),s.children.push(new i.Text("{{onPageContentReady()}}",null,void 0,void 0)),e.children=[s];break}}}catch(e){t={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}},pre:function(e){return"<div wmPageContent "+(e.get("spa")?"wmSpaPage":"")+' wmSmoothscroll="'+(e.get("smoothscroll")||"false")+'" '+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var Pn=Object.freeze({__proto__:null,default:function(){},"\u02750":vn,"\u02751":bn});t.register("wm-mobile-tabbar",(function(){return{pre:function(e){return"<div wmMobileTabbar "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var _n=Object.freeze({__proto__:null,default:function(){}}),On=new n.IDGenerator("wm_top_nav");t.register("wm-top-nav",(function(){return{pre:function(e){var n=On.nextUid();return"<section wmTopNav #"+n+'="wmTopNav" partialContainer data-role="page-topnav" role="navigation" [attr.aria-label]="'+n+".hint || 'Second level navigation'\" "+t.getAttrMarkup(e)+">"},post:function(){return"</section>"}}}));var Sn=Object.freeze({__proto__:null,default:function(){}}),En={},Tn=function(e){return new i.Element(e,[],[],En,En,En)},Cn=Tn,An=function(e,t,n){var o=new i.Attribute(t,n,En,En,En,void 0,void 0);e.attrs.push(o)},Rn=An;t.register("wm-partial",(function(){return{template:function(e){var t=Tn("ng-container");An(t,"*ngIf","compileContent"),t.children=t.children.concat(e.children),e.children.length=0,e.children.push(t)},pre:function(e){return'<section wmPartial data-role="partial" '+t.getAttrMarkup(e)+">"},post:function(){return"</section>"}}}));var In=Object.freeze({__proto__:null,default:function(){},"\u02750":Cn,"\u02751":Rn});t.register("wm-param",(function(){return{pre:function(e){return"<div wmParam hidden "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var Dn=Object.freeze({__proto__:null,default:function(){}});t.register("wm-prefab",(function(){return{pre:function(e){return'<section wmPrefab redrawable data-role="perfab" '+t.getAttrMarkup(e)+">"},post:function(){return"</section>"}}}));var Nn=Object.freeze({__proto__:null,default:function(){}}),xn={},kn=function(e){return new i.Element(e,[],[],xn,xn,xn)},Mn=kn,Ln=function(e,t,n){var o=new i.Attribute(t,n,xn,xn,xn,void 0,void 0);e.attrs.push(o)},Fn=Ln;t.register("wm-prefab-container",(function(){return{template:function(e){var t=kn("ng-container");Ln(t,"*ngIf","compileContent"),t.children=t.children.concat(e.children),e.children.length=0,e.children.push(t)},pre:function(e){return"<div wmPrefabContainer "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var jn=Object.freeze({__proto__:null,default:function(){},"\u02750":Mn,"\u02751":Fn});t.register("wm-table-action",(function(){return{pre:function(e){return'<div name="'+(e.get("name")||e.get("key"))+'" wmTableAction '+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var Bn=Object.freeze({__proto__:null,default:function(){}});t.register("wm-table-column-group",(function(){return{pre:function(e){return"<div wmTableColumnGroup "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var Gn=Object.freeze({__proto__:null,default:function(){}}),Vn=new n.IDGenerator("data_table_form_"),$n=new Set(["wm-text","wm-textarea","wm-checkbox","wm-slider","wm-currency","wm-switch","wm-select","wm-checkboxset","wm-radioset","wm-date","wm-time","wm-timestamp","wm-rating","wm-datetime","wm-search","wm-chips","wm-colorpicker"]),Un=function(e){void 0===e&&(e=[]);e.forEach((function(e){if($n.has(e.name)){if("wm-checkbox"===e.name&&e.attrs.filter((function(e){return"formControlName"===e.name})).length)return;e.attrs.push(new i.Attribute("[ngModelOptions]","{standalone: true}",1,1,1,void 0,void 0))}Un(e.children)}))},Wn=Un,qn=function(e,i){var o,r,a=e.get("filterwidget")||Ie(e.get("type")||n.DataType.STRING),s=e.get("binding"),l=e.get("type")||"string",c=e.get("filterdataset.bind");if("autocomplete"===e.get("filterwidget")){if(c)o='dataset.bind="'+c+'" datasource.bind="'+t.getDataSource(c)+'"';r="submit.event=\"changeFn('"+s+"')\""}var p='#filterWidget formControlName="'+s+'_filter" '+o+" "+r+" change.event=\"changeFn('"+s+"')\"\n disabled.bind=\"isDisabled('"+s+"')\"";return'<ng-template #filterTmpl let-changeFn="changeFn" let-isDisabled="isDisabled">\n <div class="input-group '+a+'" data-col-identifier="'+s+'">\n '+(""+n.getFormWidgetTemplate(a,p,e,{inputType:"filterinputtype"}))+'\n <span class="input-group-addon filter-clear-icon" *ngIf="'+i+".showClearIcon('"+s+'\')">\n <button class="btn-transparent btn app-button" aria-label="Clear button" type="button" (click)="'+i+".clearRowFilter('"+s+'\')">\n <i class="app-icon wi wi-clear" aria-hidden="true"></i>\n </button>\n </span>\n <span class="input-group-addon" dropdown container="body" (onShown)="'+i+".adjustContainer('"+s+'\');">\n <button class="btn-transparent btn app-button" type="button" dropdownToggle><i class="app-icon wi wi-filter-list"></i></button>\n <ul class="matchmode-dropdown dropdown-menu" *dropdownMenu>\n <li *ngFor="let matchMode of '+i+".matchModeTypesMap['"+l+'\']"\n [ngClass]="{active: matchMode === ('+i+".rowFilter['"+s+"'].matchMode || "+i+".matchModeTypesMap['"+l+'\'][0])}">\n <a href="javascript:void(0);" (click)="'+i+".onFilterConditionSelect('"+s+'\', matchMode)" [innerText]="'+i+'.matchModeMsgs[matchMode]"></a>\n </li>\n </ul>\n </span>\n </div></ng-template>'},zn=qn,Hn=function(e){var t="";return e.forEach((function(e,n){n.endsWith(".event")&&(t+=n+'="'+e+'" ')})),t},Yn=Hn,Kn=function(e){var n=new Map;return["disabled","disabled.bind"].forEach((function(t){e.get(t)&&(n.set(t,e.get(t)),e.delete(t))})),t.getAttrMarkup(n)},Qn=Kn,Xn=function(e,t,i,o){var r,a={},s=e.get("binding"),l=e.get("edit-widget-type")||((r={type:e.get("type"),"related-entity-name":e.get("related-entity-name"),"primary-key":e.get("primary-key")})["related-entity-name"]&&r["primary-key"]?n.FormWidgetType.SELECT:Ae[r.type]&&Ae[r.type][0]||n.FormWidgetType.TEXT),c="",p="",u="";l===n.FormWidgetType.UPLOAD?(a.uploadProps={formName:Vn.nextUid(),name:s},a.counter=o):(c=t?"#inlineWidgetNew":"#inlineWidget",p=t?'formControlName="'+s+'_new"':'formControlName="'+s+'"',u="wmFormWidget"),a.inputType="editinputtype";var d=t?"#inlineWidgetTmplNew":"#inlineWidgetTmpl",h=c+" "+u+' key="'+s+'" data-field-name="'+s+'" '+p+" "+(l===n.FormWidgetType.UPLOAD?"":Hn(e))+" "+Kn(e),m=t?"getPendingSpinnerStatusNew":"getPendingSpinnerStatus";return"<ng-template "+d+' let-row="row" let-getControl="getControl" let-getValidationMessage="getValidationMessage" let-'+m+'="'+m+'">\n <div data-col-identifier="'+s+'" >\n '+n.getFormWidgetTemplate(l,h,e,a)+"\n "+Zn(i)+'\n <div class="overlay" *ngIf="'+m+'()"><span aria-hidden="true" class="form-field-spinner fa fa-circle-o-notch fa-spin form-control-feedback"></span></div>\n <span class="sr-only" *ngIf="getValidationMessage()">{{getValidationMessage()}}</span>\n </div>\n </ng-template>'},Jn=Xn,Zn=function(e){var t="";switch(e){case"bottom":t='<span class="help-block text-danger" *ngIf="getValidationMessage() && getControl() && getControl().invalid && getControl().touched">{{getValidationMessage()}}</span>';break;case"hover":default:t='<span placement="top" container="body" tooltip="{{getValidationMessage()}}" class="text-danger wi wi-error"\n *ngIf="getValidationMessage() && getControl() && getControl().invalid && getControl().touched">\n </span>'}return t},ei=Zn,ti=function(e){var t="row.getProperty('"+e.get("binding")+"')",i=e.get("custompipeformat")||e.get("formatpattern"),o="";switch(!n.isDateTimeType(e.get("type"))||i&&"None"!==i||(e.set("formatpattern","toDate"),e.delete("datepattern"),i="toDate"),i){case"toDate":o="{{"+t+" | toDate: colDef.datepattern}}";break;case"toCurrency":e.get("currencypattern")&&(o="{{"+t+" | toCurrency: '"+e.get("currencypattern"),e.get("fractionsize")?o+="': "+e.get("fractionsize")+"}}":o+="'}}");break;case"numberToString":e.get("fractionsize")&&(o="{{"+t+" | numberToString: '"+e.get("fractionsize")+"'}}");break;case"stringToNumber":o="{{"+t+" | stringToNumber}}";break;case"timeFromNow":o="{{"+t+" | timeFromNow}}";break;case"prefix":e.get("prefix")&&(o="{{"+t+" | prefix: '"+e.get("prefix")+"'}}");break;case"suffix":e.get("suffix")&&(o="{{"+t+" | suffix: '"+e.get("suffix")+"'}}");break;default:n.checkIsCustomPipeExpression(i)&&(o="{{"+t+" | "+i+" : row}}")}return o},ni=ti;t.register("wm-table-column",(function(){return{requires:["wm-table"],template:function(e,t){if(e.children.length){if(1===e.children.length&&e.children[0]instanceof i.Text&&0===e.children[0].value.trim().length)return;t.set("customExpression",!0),Un(e.children)}},pre:function(e,i,o){var r="",a="",s="",l="";if(o){var c=o.get("table_reference");r="multicolumn"===o.get("filtermode")&&"false"!==e.get("searchable")?qn(e,c):"";var p=o.get("editmode"),u=p!==Ce&&p!==Te&&"true"!==e.get("readonly");a=u?Xn(e,!1,o.get("errorstyle"),c):"",s=u&&p===Ee&&"false"!==o.get("shownewrow")?Xn(e,!0,e.get("errorstyle")):"",l=' [formGroup]="'+c+'.ngform" '}var d=e.get("formatpattern"),h='<ng-template #customExprTmpl let-row="row" let-colDef="colDef" let-editRow="editRow" let-deleteRow="deleteRow" let-addNewRow="addNewRow">',m="",f="";return i.get("customExpression")?(e.set("customExpression","true"),m=h+'<div data-col-identifier="'+e.get("binding")+'">'):(d&&"None"!==d||n.isDateTimeType(e.get("type")))&&(f=ti(e))&&(i.set("customExpression",!0),e.set("customExpression","true"),m=h+'<div data-col-identifier="'+e.get("binding")+'" title="'+f+'">'+f),"<div wmTableColumn "+t.getAttrMarkup(e)+" "+l+">\n "+r+"\n "+a+"\n "+s+"\n "+m},post:function(e,t){var n="";return t.get("customExpression")&&(n="</div></ng-template>"),n+"</div>"},imports:function(e){var t=e.get("edit-widget-type"),i=e.get("filterwidget")||Ie(e.get("type")||n.DataType.STRING);return[n.getRequiredFormWidget(t),n.getRequiredFormWidget(i),"wm-table"]}}}));var ii=Object.freeze({__proto__:null,default:function(){},"\u02750":Wn,"\u02751":zn,"\u02752":Yn,"\u02753":Qn,"\u02754":Jn,"\u02755":ei,"\u02756":ni}),oi=function(e){var t="anchor"===e.get("widget-type")?"a":"button",i="anchor"===e.get("widget-type")?"wmAnchor":"wmButton",o=e.get("display-name")||e.get("title")||"Collapse/Expand";return'<ng-template #rowExpansionActionTmpl let-row="row">\n <'+t+" "+i+"\n "+n.getRowActionAttrs(e)+'\n class="'+e.get("class")+' row-expansion-button"\n iconclass="'+e.get("collapseicon")+'"\n type="button" aria-label="'+o+'"></'+t+">\n </ng-template>"},ri=oi;t.register("wm-table-row",(function(){return{pre:function(e){return"<div wmTableRow "+t.getAttrMarkup(e)+">\n "+oi(e)+'\n <ng-template #rowExpansionTmpl let-row="row" let-rowDef="rowDef" let-containerLoad="containerLoad">\n <div wmContainer partialContainer content.bind="rowDef.content" load.event="containerLoad(widget)"\n [ngStyle]="{\'height\': rowDef.height, \'overflow-y\': \'auto\'}">\n <div *ngFor="let param of rowDef.partialParams | keyvalue" wmParam hidden\n [name]="param.key" [value]="param.value"></div>'},post:function(){return"</div></ng-template></div>"}}}));var ai=Object.freeze({__proto__:null,default:function(){},"\u02750":ri}),si=function(){return'<button type="button" aria-label="Save edit icon" class="save row-action-button btn app-button btn-transparent save-edit-row-button hidden" title="Save">\n <i class="wi wi-done" aria-hidden="true"></i>\n </button>\n <button type="button" aria-label="Cancel edit icon" class="cancel row-action-button btn app-button btn-transparent cancel-edit-row-button hidden" title="Cancel">\n <i class="wi wi-cancel" aria-hidden="true"></i>\n </button>'},li=si,ci=function(e){var t=e.get("action"),i=t?' click.event.delayed="'+t+'" ':"",o=t&&t.includes("editRow(")?'<button type="button" aria-label="Save edit icon" class="save row-action-button btn app-button btn-transparent save-edit-row-button hidden" title="Save">\n <i class="wi wi-done" aria-hidden="true"></i>\n </button>\n <button type="button" aria-label="Cancel edit icon" class="cancel row-action-button btn app-button btn-transparent cancel-edit-row-button hidden" title="Cancel">\n <i class="wi wi-cancel" aria-hidden="true"></i>\n </button>':"",r=t?t.includes("editRow(")?"edit edit-row-button":t.includes("deleteRow(")?"delete delete-row-button":"":"",a=e.get("tabindex")?'tabindex="'+e.get("tabindex")+'"':"",s="anchor"===e.get("widget-type")?"a":"button";return'<ng-template #rowActionTmpl let-row="row">\n <'+s+" "+("anchor"===e.get("widget-type")?"wmAnchor":"wmButton")+' data-action-key="'+e.get("key")+'"\n '+n.getRowActionAttrs(e)+'\n class="row-action row-action-button '+e.get("class")+" "+r+'"\n iconclass="'+e.get("iconclass")+'"\n '+i+"\n "+a+'\n type="button"></'+s+">\n "+o+"\n </ng-template>"},pi=ci;t.register("wm-table-row-action",(function(){return{pre:function(e){return"<div wmTableRowAction "+t.getAttrMarkup(e)+">\n "+ci(e)},post:function(){return"</div>"}}}));var ui=Object.freeze({__proto__:null,default:function(){},"\u02750":li,"\u02751":pi}),di=new n.IDGenerator("table_"),hi=0;function mi(e,t){var n=0;e.forEach((function(e){var o=e.name,r=void 0!==t?t:n;"wm-table-column"!==o&&"wm-table-column-group"!==o||(e.attrs.push(new i.Attribute("index",""+hi,1,1,1,void 0,void 0)),e.attrs.push(new i.Attribute("headerIndex",""+r,1,1,1,void 0,void 0)),"wm-table-column-group"===o&&mi(e.children,n),hi++,n++)}))}t.register("wm-table",(function(){return{template:function(e,i){if(e.children.length){var o=e.children.some((function(e){return"wm-table-column"===e.name||"wm-table-column-group"===e.name}));mi(e.children),i.set("isdynamictable",o?"false":"true");var r=e.children.some((function(e){return"wm-table-row"===e.name}));i.set("isrowexpansionenabled",r?"true":"false")}else i.set("isdynamictable","true");var a=e.attrs.find((function(e){return"dataset"===e.name})),s=e.attrs.find((function(e){return"name"===e.name}));if(a){var l=t.getBoundToExpr(a.value);l&&n.updateTemplateAttrs(e,l,s.value,"","row")}},pre:function(e,n){var i=di.nextUid();return n.set("counter",i),e.set("isdynamictable",n.get("isdynamictable")),e.set("isrowexpansionenabled",n.get("isrowexpansionenabled")),e.set("table_reference",i),'<div wmTable="'+i+'" wmTableFilterSort wmTableCUD #'+i+' data-identifier="table" '+t.getAttrMarkup(e)+">"},post:function(){return"</div>"},provide:function(e,t){var n=new Map;return n.set("table_reference",t.get("counter")),n.set("filtermode",e.get("filtermode")),n.set("errorstyle",e.get("errorstyle")),n.set("editmode",e.get("editmode")),n.set("shownewrow",e.get("shownewrow")),n}}}));var fi=Object.freeze({__proto__:null,default:function(){}});t.register("wm-video",(function(){return{pre:function(e){return"<div wmVideo "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var gi=Object.freeze({__proto__:null,default:function(){}}),vi="parentLinearLayout.spacing";t.register("wm-linearlayout",(function(){return{requires:["wm-linearlayout"],pre:function(e,n,i){var o=e.get("spacing");return e.set("spacing",o&&"0"!==o||!i?o:i.get(vi)),"<div wmLinearLayout "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"},provide:function(e,t){var n=new Map;return n.set(vi,e.get("spacing")),n}}}));var yi=Object.freeze({__proto__:null,default:function(){}});t.register("wm-linearlayoutitem",(function(){return{pre:function(e){return"<div wmLinearLayoutItem "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var bi=Object.freeze({__proto__:null,default:function(){}});e.accordionBuild=z,e.accordionPaneBuild=Y,e.alertDlgBuild=ye,e.anchorBuild=h,e.audioBuild=m,e.barcodeScannerBuild=fe,e.breadcrumbBuild=Lt,e.buttonBuild=ut,e.buttonGroupBuild=ct,e.calendarBuild=rt,e.cameraBuild=ve,e.cardActionsBuild=G,e.cardBuild=j,e.cardContentBuild=B,e.cardFooterBuild=V,e.carouselBuild=s,e.carouselTemplateBuild=c,e.chartBuild=$,e.checkboxBuild=dt,e.checkboxSetBuild=ht,e.chipsBuild=at,e.colorPickerBuild=st,e.compositeBuild=mt,e.confirmDlgBuild=be,e.containerBuild=K,e.contentBuild=rn,e.currencyBuild=lt,e.dateBuild=Ot,e.dateTimeBuild=_t,e.dlgBuild=Pe,e.dlgFooterBuild=we,e.fileUploadBuild=Et,e.footerBuild=sn,e.formActionBuild=Ke,e.formBuild=ot,e.formFieldBuild=qe,e.headerBuild=cn,e.htmlBuild=g,e.iconBuild=v,e.iframeBuild=y,e.iframeDlgBuild=_e,e.initComponentsBuildTask=function(){},e.labelBuild=w,e.layoutBuild=en,e.leftPanelBuild=un,e.lgBuild=J,e.lgcolBuild=Q,e.lgrowBuild=X,e.linearLayoutBuild=yi,e.linearLayoutItemBuild=bi,e.listBuild=Dt,e.liveTableBuild=xt,e.loginBuild=p,e.loginDlgBuild=Oe,e.marqueeBuild=u,e.mediaListBuild=Rt,e.mediaListItemBuild=It,e.menuBuild=Ft,e.messageBuild=Mt,e.mobileNavbarBuild=dn,e.navBuild=Bt,e.navItemBuild=jt,e.navbarBuild=Gt,e.numberBuild=ft,e.pageBuild=Jt,e.pageContentBuild=Pn,e.paginationBuild=on,e.panelBuild=ee,e.partialBuild=In,e.partialDlgBuild=Se,e.partialParamBuild=Dn,e.pictureBuild=O,e.popoverBuild=Vt,e.prefabBuild=Nn,e.prefabContainerBuild=jn,e.progressBarBuild=N,e.progressCircleBuild=x,e.radiosetBuild=gt,e.ratingBuild=Tt,e.repeatTemplateBuild=oe,e.rightPanelBuild=mn,e.routerOutletBuild=nn,e.rteBuild=M,e.searchBuild=L,e.segContentBuild=ne,e.segControlBuild=te,e.selectBuild=vt,e.sliderBuild=Ct,e.spinnerBuild=E,e.switchBuild=bt,e.tabBarBuild=_n,e.tabPaneBuild=ce,e.tableActionBuild=Bn,e.tableBuild=fi,e.tableColumnBuild=ii,e.tableColumnGroupBuild=Gn,e.tableRowActionBuild=ui,e.tableRowBuild=ai,e.tabsBuild=le,e.textAreaBuild=Pt,e.textBuild=wt,e.tileBuild=pe,e.timeBuild=St,e.topNavBuild=Sn,e.treeBuild=F,e.videoBuild=gi,e.wizardBuild=ue,e.wizardStepBuild=he,Object.keys(t).forEach((function(n){"default"===n||e.hasOwnProperty(n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})),Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@angular/forms"),require("angular-imask"),require("@wm/components/base"),require("@wm/core"),require("rxjs")):"function"==typeof define&&define.amd?define("@wm/components/input",["exports","@angular/core","@angular/common","@angular/forms","angular-imask","@wm/components/base","@wm/core","rxjs"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.input={}),e.ng.core,e.ng.common,e.ng.forms,e["angular-imask"],e.wm.components.base,e.wm.core,e.rxjs)}(this,(function(e,t,n,i,o,r,a,s){"use strict";
|
|
43
|
+
***************************************************************************** */var u=function(e,t){return(u=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 d(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}u(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function h(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{l(i.next(e))}catch(e){r(e)}}function s(e){try{l(i.throw(e))}catch(e){r(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(a,s)}l((i=i.apply(e,t||[])).next())}))}function m(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}}Object.create;function f(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 g(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function v(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o<r;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 y=function(){},b=function(){},w=new t.InjectionToken("Context Provider Reference"),P=new Set([i.FormWidgetType.SELECT,i.FormWidgetType.CHECKBOXSET,i.FormWidgetType.RADIOSET,i.FormWidgetType.SWITCH,i.FormWidgetType.AUTOCOMPLETE,i.FormWidgetType.CHIPS,i.FormWidgetType.TYPEAHEAD,i.FormWidgetType.RATING]),O=function(e){var t,n,i,o,r,a,s,l,c,p="";for(e=e.replace(/\$\[data\[\$i\]/g,"$[__1"),i=0;i<e.length;i++)if(t=e[i],n=e[i+1],"$"===t&&"["===n){for(a=1,c=!1,s=!1,o=i+2;o<e.length;o++)if(" "!==(r=e[o])&&(c||(s='"'===e[o]||"'"===e[o],c=!0),"["===r?a++:"]"===r&&a--,!a)){l=e.substring(i+2,o),p+=s?"__1["+l+"]":l;break}i=o}else p+=t;return p},S=function(e,t){var n;return t?(t.replace(/\[(\w+)\]/g,".$1").split(".").forEach((function(t){n=n&&n[t]||(_.isNull(e)?e:e[t])})),n):e},E=function(e,t,n){var o,r=t.field,a=t.expression,s=t.bindExpression;return s?(o=s.replace("bind:",""),i.checkIsCustomPipeExpression(o)&&(o+=": __1"),o=O(o)):o=a||r,s||a?i.$parseExpr(o)(n,Object.assign({},e,{__1:e})):_.get(e,r)},T=function(e,t){return!(!e||!t)&&(t=-1===t.indexOf("?")?t:t.substring(0,t.indexOf("?")),e=-1===e.indexOf("?")?e:e.substring(0,e.indexOf("?")),new RegExp("^(#/|#)"+t+"$").test(e))},C=function(e,t){return e.some((function(e){return!!T(e.link,t)||(e.children?C(e.children,t):void 0)}))},A=function(e){return P.has(e)},R=function(e,t,n){return i.isValidWebURL(e)||(e||(e=n||"resources/images/imagelists/default-image.png"),e=t?i.encodeUrl(e):e,i.stringStartsWith(e,"services/prefabs")),e},I=function(e){return""===e||"none"===e?e:"url("+R(e)+")"};function D(e,n,i){return{provide:n,useExisting:t.forwardRef((function(){return e})),multi:i}}function N(e){return D(e,y)}var x,k=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.join("_")},M={number:["number","integer","big_integer","short","float","big_decimal","double","long","byte"],string:["string","text"],character:["character"],date:["date","time","timestamp","datetime"]},L={number:["exact","notequals","lessthan","lessthanequal","greaterthan","greaterthanequal","null","isnotnull"],string:["anywhereignorecase","anywhere","startignorecase","start","endignorecase","end","exactignorecase","exact","notequalsignorecase","notequals","null","isnotnull","empty","isnotempty","nullorempty"],character:["exactignorecase","exact","notequalsignorecase","notequals","null","isnotnull","empty","isnotempty","nullorempty"],date:["exact","lessthan","lessthanequal","greaterthan","greaterthanequal","null","notequals","isnotnull"]},F={boolean:["exact","null","isnotnull"],clob:[],blob:[]},j=function(e){var t=[];return _.isArray(e)?(e.forEach((function(e){t=t.concat(j(e))})),t):_.isObject(e)?(_.forEach(e,(function(e,n){e&&(t=t.concat(n.split(" ")))})),t):void 0},B=function(e,t){var n,i,o=e.toAdd||e,r=e.toRemove||t;return _.isObject(e)?(n=_.isArray(o)?o:j(o||[]),i=r?_.isArray(r)?r:j(r):[]):(n=o?[o]:[],i=r?[r]:[]),{toAdd:n,toRemove:i}},G=function(e,t,n,o){var r,a,s,l,c,p;o||(o={}),_.forEach(e,(function(e,u){_.includes(u,".")&&(l=_.split(u,"."),a=l[0],s=l[1],p=!0),o.noModifyTitle?r=u:_.isString(u)?(r=i.prettifyLabel(u),r=i.deHyphenate(r),r=n?i.initCaps(n)+" "+r:r):r=u,u=n?n+"."+u:u,c=p?(c=_.split(r," ")).length>1?c[c.length-2]+" "+c[c.length-1]:c[0]:r;var d=o.setBindingField?{displayName:c,field:u,relatedTable:a,relatedField:s||r}:{displayName:c,relatedTable:a,relatedField:s||r};if(!_.isObject(e)||_.isArray(e)&&!e[0]){if(o.upperBound&&o.columnCount===o.upperBound)return;t.terminals.push(d),o.columnCount+=1}else o.columnCount!==o.upperBound&&t.objects.push(d),_.isArray(e)&&e[0]?G(e[0],t,u+"[0]",o):G(e,t,u,o)}))},V=function(e){var t;return _.isArray(e)?_.isObject(e[0])?(t=i.getClonedObject(e[0]),_.forEach(e,(function(e,n){if(n+1>=10)return!1;_.assignWith(t,e,(function(e,t){return null==e?t:e}))}))):t=e[0]:t=e,t};e.APPLY_STYLES_TYPE=void 0,(x=e.APPLY_STYLES_TYPE||(e.APPLY_STYLES_TYPE={}))[x.CONTAINER=0]="CONTAINER",x[x.SCROLLABLE_CONTAINER=1]="SCROLLABLE_CONTAINER",x[x.INNER_SHELL=2]="INNER_SHELL",x[x.SHELL=3]="SHELL";var U={backgroundattachment:"backgroundAttachment",backgroundcolor:"backgroundColor",backgroundgradient:"backgroundGradient",backgroundimage:"backgroundImage",backgroundposition:"backgroundPosition",backgroundrepeat:"backgroundRepeat",backgroundsize:"backgroundSize",bordercolor:"borderColor",borderradius:"borderRadius",borderstyle:"borderStyle",borderwidth:"borderWidth",borderbottomwidth:"borderBottomWidth",borderleftwidth:"borderLeftWidth",borderrightwidth:"borderRightWidth",bordertopwidth:"borderTopWidth",color:"color",cursor:"cursor",display:"display",fontsize:"fontSize",fontfamily:"fontFamily",fontstyle:"fontStyle",fontunit:"fontunit",fontvariant:"fontVariant",fontweight:"fontWeight",height:"height",horizontalalign:"textAlign",lineheight:"lineHeight",margin:"margin",marginbottom:"marginBottom",marginleft:"marginLeft",marginright:"marginRight",margintop:"marginTop",opacity:"opacity",overflow:"overflow",padding:"padding",paddingbottom:"paddingBottom",paddingleft:"paddingLeft",paddingright:"paddingRight",paddingtop:"paddingTop",picturesource:"backgroundImage",textalign:"textAlign",textdecoration:"textDecoration",verticalalign:"verticalAlign",visibility:"visibility",whitespace:"whiteSpace",width:"width",wordbreak:"wordbreak",zindex:"zIndex"},W=function(e){return!!U[e]},q={height:!0,overflow:!0,padding:!0,paddingbottom:!0,paddingleft:!0,paddingright:!0,paddingtop:!0},z={textalign:!0},H={textalign:!0,width:!0};function Y(t,n,o,r){var a=Object.create(null);r&&r.forEach((function(e){return a[e]=!0})),n.registerStyleChangeListener((function(r,s){if(!(a[r]||o===e.APPLY_STYLES_TYPE.SHELL&&q[r])){if(o===e.APPLY_STYLES_TYPE.INNER_SHELL){if(!q[r])return;"height"===r&&i.setCSS(t,"overflow",s?"auto":"")}if(o!==e.APPLY_STYLES_TYPE.CONTAINER||!z[r]){if(o===e.APPLY_STYLES_TYPE.SCROLLABLE_CONTAINER){if(H[r])return;"height"===r&&i.setCSS(t,"overflow",s?"auto":"")}"fontsize"===r||"fontunit"===r?i.setCSS(t,"fontSize",""===n.fontsize?"":n.fontsize+(n.fontunit||"px")):"backgroundimage"===r?i.setCSS(t,"backgroundImage",n.picturesource||I(s)):U[r]&&i.setCSS(t,U[r],s)}}}))}var K,Q="wm-form-field-",X=function(){var e=new Map;for(var t in i.FormWidgetType)e.set(Q+i.FormWidgetType[t],new Map);return e}(),J=function(e){return X.get(e)},Z=function(e,t){X.set(e,t),window.WM_LOADED_COMPONENTS=v(v([],g(window.WM_LOADED_COMPONENTS||[])),[e])};e.PROP_TYPE=void 0,(K=e.PROP_TYPE||(e.PROP_TYPE={}))[K.BOOLEAN=1]="BOOLEAN",K[K.NUMBER=2]="NUMBER",K[K.STRING=3]="STRING";var ee={type:e.PROP_TYPE.STRING},te={type:e.PROP_TYPE.NUMBER},ne={type:e.PROP_TYPE.BOOLEAN},ie={arrayType:!0},oe=function(){Z("wm-container",new Map([["animation",ee],["class",ee],["conditionalclass",ie],["conditionalstyle",ie],["content",ee],["name",ee],["show",Object.assign({value:!0},ne)]]))},re=new Map,ae=new i.IDGenerator("widget-id"),se=new Map([["tap","click"]]),le={BLOCK:"block",INLINE_BLOCK:"inline-block",INLINE:"inline"},ce=new Set(["readonly","autofocus","disabled","startchecked","multiple","selected","required","controls","autoplay","loop","muted","show"]),pe=function(e){return ce.has(e)},ue=new Set(["width","height","iconheight","iconwidth","popoverwidth","popoverheight","imagewidth","imageheight"]),de=function(e){return ue.has(e)},he=function(t,n,o){return o===e.PROP_TYPE.BOOLEAN?i.toBoolean(n,pe(t)&&t):o===e.PROP_TYPE.NUMBER?+n:n},me=function(e,t,n){var o=e.widgetId,r=e[t];i.isChangeFromWatch()||i.$unwatch(k(o,t)),i.resetChangeFromWatch();var a=J(e.getWidgetSubType()).get(t);if(a){var s=a.type;s&&(n=he(t,n,s))}if(n!==r||i.isObject(n)||i.isObject(r)){if(de(t))n=i.toDimension(n);else if(_.startsWith(n,"resources/")){var l=e;void 0===l._parentPrefab_&&(l._parentPrefab_=e.$element.parent().closest('[prefabname][prefabname!="__self__"]').attr("prefabname")||""),l._parentPrefab_?n="./app/prefabs/"+l._parentPrefab_+"/"+n:a&&n!=a.value&&(n="./"+n)}e[t]=n,W(t)?e.notifyStyleChange(t,n,r):("conditionalclass"===t&&(n=B(n,r)),a&&e.notifyPropertyChange(t,n,r)),i.$appDigest()}},fe={set:function(e,t,n){return me(e,t,n),!0},get:function(e,t){var n=e[t];return _.isFunction(n)?n.bind(e):n}},ge=window.requestAnimationFrame,ve=[],ye=function(e){ve.length||ge((function(){ve.forEach((function(e){return e()})),ve.length=0})),ve.push(e)},be=function(){function e(){}return e.create=function(e,t,n){if(window.Proxy)return new Proxy(e,fe);var i=Object.create(e);return ye((function(){for(var t in e)_.isFunction(e[t])&&"constructor"!==t&&"super"!==t&&!_.startsWith(t,"ng")&&(e[t]=e[t].bind(e))})),Object.keys(U).forEach((function(t){Object.defineProperty(i,t,{get:function(){return e[t]},set:function(n){return me(e,t,n)}})})),n&&n.forEach((function(t,n){Object.defineProperty(i,n,{get:function(){return e[n]},set:function(t){return me(e,n,t)}})})),i},e}(),we=function(e,t,n){t&&t.length&&i.removeClass(n,_.join(t," ")),e&&e.length&&i.addClass(n,_.join(e," "))},Pe=function(e,t,n){t&&_.isObject(t)&&Object.keys(t||{}).forEach((function(e){i.setCSS(n,e,"")}));e&&_.isObject(e)&&i.setCSSFromObj(n,e)},_e=function(){function e(e,n,o){var r=this;this.inj=e,this.isAttached=!1,this.styleChange=new s.ReplaySubject,this.propertyChange=new s.Subject,this.readyState=new s.Subject,this.destroy=new s.Subject,this.eventHandlers=new Map,this.toBeSetupEventsQueue=[],this.__cloneable__=!1,this.$attrs=new Map,this.isMuted=!1;var l=e.get(t.ElementRef);this.nativeElement=l.nativeElement,this.widgetType=n.widgetType,this.widgetSubType=n.widgetSubType||n.widgetType,this.viewParent=e.view.component,this.displayType=n.displayType||le.BLOCK,this.context=e.view.context,this.widget=this.createProxy(),this.eventManager=e.get(a.EventManager),this.nativeElement.widget=this.widget,this.appLocale=e.get(i.App).appLocale||{},this.initContext(),n.hostClass&&i.addClass(this.nativeElement,n.hostClass),this.widgetId=this.generateWidgetId(),i.setAttr(this.nativeElement,"widget-id",this.widgetId,!0),this.registerStyleChangeListener(this.onStyleChange,this),this.registerPropertyChangeListener(this.onPropertyChange,this),o?(this.delayedInit=!0,o.then((function(){r.initWidget(),r.setInitProps()}))):this.initWidget()}return Object.defineProperty(e.prototype,"$element",{get:function(){return $(this.nativeElement)},enumerable:!1,configurable:!0}),e.prototype.getNativeElement=function(){return this.nativeElement},e.prototype.getWidgetType=function(){return this.widgetType},e.prototype.getWidgetSubType=function(){return this.widgetSubType},e.prototype.getWidget=function(){return this.widget},e.prototype.setProperty=function(e,t){this.widget[e]=t},e.prototype.getViewParent=function(){return this.viewParent},e.prototype.notifyStyleChange=function(e,t,n){this.styleChange.next({key:e,nv:t,ov:n})},e.prototype.notifyPropertyChange=function(e,t,n){this.propertyChange.next({key:e,nv:t,ov:n})},e.prototype.registerStyleChangeListener=function(e,t){t&&(e=e.bind(t)),this.styleChange.subscribe((function(t){var n=t.key,i=t.nv,o=t.ov;return e(n,i,o)}))},e.prototype.registerReadyStateListener=function(e,t){t&&(e=e.bind(t)),this.readyState.isStopped?e():this.readyState.subscribe((function(){return e()}))},e.prototype.registerPropertyChangeListener=function(e,t){t&&(e=e.bind(t)),this.propertyChange.subscribe((function(t){var n=t.key,i=t.nv,o=t.ov;return e(n,i,o)}))},e.prototype.registerDestroyListener=function(e,t){t&&(e=e.bind(t)),this.destroy.subscribe((function(){}),(function(){}),(function(){return e()}))},e.prototype.getDisplayType=function(){return this.displayType},e.prototype.createProxy=function(){return be.create(this,this.widgetSubType,J(this.widgetSubType))},e.prototype.initContext=function(){var e=this.inj.view.context,t=this.inj.get(w,{});if(this.viewParent!==e?this.context=e:this.context={},t){var n={};_.isArray(t)?_.forEach(t,(function(e){Object.assign(n,e)})):n=t,this.context=Object.assign({},n,this.context)}},e.prototype.setWidgetProperty=function(e,t){this.widget[e]=t},e.prototype.getAttr=function(e){return this.$attrs.get(e)},e.prototype.getAppInstance=function(){return this.inj.get(i.App)},e.prototype.generateWidgetId=function(){return ae.nextUid()},e.prototype.onPropertyChange=function(e,t,n){if("show"===e)this.nativeElement.hidden=!t;else if("hint"===e)i.isMobileApp()||i.setAttr(this.nativeElement,"title",t);else if("class"===e){i.switchClass(this.nativeElement,t,n);var o=t.match(/(\W|^)(h([0-6]))(?=\s|$)/);o&&(i.setAttr(this.nativeElement,"role","heading"),i.setAttr(this.nativeElement,"aria-level",o[3]))}else if("name"===e||"tabindex"===e)i.setAttr(this.nativeElement,e,t),"name"===e&&t&&function(e,t,n,o){i.isDefined(e.Widgets)&&(o&&(e.Widgets[o]=void 0),n&&(e.Widgets[n]=t))}(this.viewParent,this.widget,t,n);else if("conditionalclass"===e)we(t.toAdd,t.toRemove,this.nativeElement);else if("autoplay"===e){var r="wm-audio"===this.widgetType?"audio":"video";this.nativeElement.querySelector(r).load()}else"conditionalstyle"===e?Pe(t,n,this.nativeElement):"animation"===e?i.addClass(this.nativeElement,"animated "+t):"disabled"===e&&(!0===t?i.setAttr(this.nativeElement,"disabled","true",!0):i.removeAttr(this.nativeElement,"disabled",!0))},e.prototype.onStyleChange=function(e,t,n){},e.prototype.registerWidget=function(e){var t,n,o,r,a;this.registerDestroyListener((t=this.widget,n=this.viewParent,o=this.widgetId,r=e,a=!1,re.set(o,t),r&&i.isDefined(n.Widgets)&&(a=!0,n.Widgets[r]=t),function(){re.delete(o),a&&(n.Widgets[r]=void 0)}))},e.prototype.getMappedEventName=function(e){return se.get(e)||e},e.prototype.handleEvent=function(e,t,n,i,o){this.eventManager.addEventListener(e,t,(function(e){if(i.$event=e,"delayed"!==o)return n();setTimeout((function(){return n()}),150)}))},e.prototype.processEventAttr=function(e,t,n){var o=this,r=i.$parseEvent(t),a=this.context;a.widget=this.widget;var s=r.bind(void 0,this.viewParent,a),l=function(){var t;i.$invokeWatchers(!0);try{if(a.$event=a.$event||new window.CustomEvent(e),!((t=s())instanceof Promise))return t;t.then((function(e){return e}),(function(e){return e}))}catch(e){console.error(e)}};this.eventHandlers.set(this.getMappedEventName(e),{callback:l,locals:a}),this[_.camelCase("on-"+e)]=l,this.toBeSetupEventsQueue.push((function(){o.handleEvent(o.nativeElement,o.getMappedEventName(e),l,a,n)}))},e.prototype.processBindAttr=function(e,t){var n=this;this.initState.delete(e),this.registerDestroyListener(i.$watch(t,this.viewParent,this.context,(function(t){return n.widget[e]=t}),k(this.widgetId,e),"datasource"===e,this.widgetProps.get(e),(function(){return n.isMuted})))},e.prototype.removePropertyBinding=function(e){i.$unwatch(k(this.widgetId,e))},e.prototype.invokeEventCallback=function(e,t){var n=this.eventHandlers.get(e);if(n){var i=n.callback,o=n.locals||{};if(i)return i(Object.assign(o,t))}},e.prototype.processAttr=function(e,t){var n=e.split("."),o=n[0],r=n[1],a=n[2],s=n.length;"bind"===r?("show"===o&&(this.nativeElement.hidden=!0),this.processBindAttr(o,t)):"event"===r?this.processEventAttr(o,t,a):1===s&&("class"===e?i.removeClass(this.nativeElement,t):"tabindex"!==e&&"name"!==e||i.removeAttr(this.nativeElement,e),this.initState.set(o,t))},e.prototype.processAttrs=function(){var e,t,n=this.inj.elDef;try{for(var i=f(n.element.attrs),o=i.next();!o.done;o=i.next()){var r=g(o.value,3),a=r[1],s=r[2];this.$attrs.set(a,s),this.processAttr(a,s)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}},e.prototype.initWidget=function(){var e=this;this.initState=new Map;var t=J(this.widgetSubType);t.forEach((function(t,n){i.isDefined(t.value)&&e.initState.set(n,t.value)})),this.widgetProps=t,this.processAttrs(),this.registerWidget(this.initState.get("name"))},e.prototype.setInitProps=function(){var e=this;this.initState.get("name")&&(this.widget.name=this.initState.get("name")),this.initState.forEach((function(t,n){(e.widgetProps.get(n)||W(n))&&"name"!==n&&(e.widget[n]=t)})),this.initState.clear(),this.initState=void 0,this.readyState.next(),this.readyState.complete()},e.prototype.hasEventCallback=function(e){return this.eventHandlers.has(e)},e.prototype.focus=function(){var e=this.$element[0].querySelector("[focus-target]");e||(e=this.$element[0]),e.focus()},e.prototype.execute=function(e,t){},e.prototype.mute=function(){this.isMuted=!0},e.prototype.unmute=function(){this.isMuted=!1},e.prototype.ngOnAttach=function(){this.isAttached=!0},e.prototype.ngOnDetach=function(){this.isAttached=!1},e.prototype.ngOnInit=function(){this.delayedInit||this.setInitProps()},e.prototype.ngAfterViewInit=function(){var e,t;if(this.toBeSetupEventsQueue.length)try{for(var n=f(this.toBeSetupEventsQueue),i=n.next();!i.done;i=n.next()){(0,i.value)()}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}this.toBeSetupEventsQueue.length=0,this.isAttached=!0},e.prototype.ngAfterContentInit=function(){},e.prototype.ngOnDestroy=function(){this.isDestroyed=!0,this.widget=Object.create(null),this.styleChange.complete(),this.propertyChange.complete(),this.destroy.complete(),this.isAttached=!1},e}();_e.decorators=[{type:t.Injectable}],_e.ctorParameters=function(){return[{type:t.Injector},{type:void 0},{type:Promise}]};var Oe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return d(t,e),t}(_e);Oe.decorators=[{type:t.Injectable}];var Se=function(e){this.redraw=function(){var t=e.$element.closest("[wmtabpane]"),n=e.$element.closest("[wmaccordionpane]").find(".panel-heading");if(!(t.length&&!t.hasClass("active")||n.length&&!n.hasClass("active")))return e.redraw&&e.redraw()}};Se.decorators=[{type:t.Directive,args:[{selector:"[redrawable]"}]}],Se.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Self},{type:t.Inject,args:[y]}]}]};var Ee=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return d(t,e),t.prototype.updateRedrawableComponents=function(e){var t=this;_.pickBy(e,(function(e){e&&e.nativeElement&&e.nativeElement.hasAttribute("redrawable")&&!_.includes(t.reDrawableComponents._results,e)&&t.reDrawableComponents._results.push(e),e&&e.Widgets&&t.updateRedrawableComponents(e.Widgets)}))},t.prototype.redrawChildren=function(){var e=this;this.content&&this.Widgets&&this.updateRedrawableComponents(this.Widgets),setTimeout((function(){e.reDrawableComponents&&e.reDrawableComponents.forEach((function(e){return e.redraw()}))}),100)},t.prototype.onPropertyChange=function(t,n,i){e.prototype.onPropertyChange.call(this,t,n,i),"show"===t&&n&&this.redrawChildren()},t}(Oe);Ee.decorators=[{type:t.Directive}],Ee.propDecorators={reDrawableComponents:[{type:t.ContentChildren,args:[Se,{descendants:!0}]}]};var Te="app-container",Ce={widgetType:"wm-container",hostClass:Te},Ae=function(t){function n(n){var o=t.call(this,n,Ce)||this;return i.addClass(o.nativeElement,Te),Y(o.nativeElement,o,e.APPLY_STYLES_TYPE.CONTAINER),o}return d(n,t),n}(Ee);Ae.initializeProps=oe(),Ae.decorators=[{type:t.Directive,args:[{selector:"[wmContainer]",providers:[N(Ae)]}]}],Ae.ctorParameters=function(){return[{type:t.Injector}]};var Re=function(){function e(){}return e.prototype.transform=function(e,t,n){return i.transformFileURI(R(e,t,n))},e}();Re.decorators=[{type:t.Pipe,args:[{name:"image"}]}];var Ie=function(){Z("wm-item-template",new Map([["content",ee]]))},De={widgetType:"wm-item-template"},Ne=function(e){function t(t,n,i){var o=e.call(this,t,De)||this;return o.app=i,o.nativeElement=n.nativeElement,o.context=t.view.context,o}return d(t,e),Object.defineProperty(t.prototype,"$index",{get:function(){return this.context.index},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wmItemTemplate",{set:function(e){this.widget.content=e},enumerable:!1,configurable:!0}),t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.partialParams.item=this.userComponentParams.dataObject},t}(Oe);Ne.initializeProps=Ie(),Ne.decorators=[{type:t.Directive,args:[{selector:"[wmItemTemplate]",exportAs:"itemTemplateRef",providers:[N(Ne)]}]}],Ne.ctorParameters=function(){return[{type:t.Injector},{type:t.ElementRef},{type:i.App}]},Ne.propDecorators={userComponentParams:[{type:t.Input}],wmItemTemplate:[{type:t.Input}]};var xe=function(){Z("wm-repeat-template",new Map([["show",ne]]))},ke={widgetType:"wm-repeat-template",hostClass:"app-repeat-item"},Me=function(e){function t(t){var n=e.call(this,t,ke)||this;return Y(n.nativeElement,n),n}return d(t,e),t}(Oe);Me.initializeProps=xe(),Me.decorators=[{type:t.Directive,args:[{selector:"[wmRepeatTemplate]"}]}],Me.ctorParameters=function(){return[{type:t.Injector}]};var Le=function(){function e(e,t,n){this.templateRef=t,this.viewContainer=n,this.viewParent=e.view.component,this.context=e.view.context}return Object.defineProperty(e.prototype,"lazyLoad",{set:function(e){var t=this;this.unSubscribeFn=i.$watch(e,this.viewParent,this.context,(function(e){!t.embeddedView&&e&&(t.embeddedView=t.viewContainer.createEmbeddedView(t.templateRef,t.context),t.unSubscribeFn())}))},enumerable:!1,configurable:!0}),e.prototype.ngOnDestroy=function(){this.unSubscribeFn()},e}();Le.decorators=[{type:t.Directive,args:[{selector:"[lazyLoad]"}]}],Le.ctorParameters=function(){return[{type:t.Injector},{type:t.TemplateRef},{type:t.ViewContainerRef}]},Le.propDecorators={lazyLoad:[{type:t.Input}]};var Fe=function(){Z("wm-message",new Map([["animation",ee],["caption",Object.assign({value:"Message"},ee)],["class",ee],["hideclose",Object.assign({value:!1},ne)],["name",ee],["show",Object.assign({value:!0},ne)],["type",Object.assign({value:"success"},ee)]]))},je={widgetType:"wm-message",hostClass:"alert app-message"},Be=function(e){function t(t){var n=e.call(this,t,je)||this;return n.messageClass="",n.messageIconClass="",n.type="",Y(n.nativeElement,n),n}return d(t,e),t.prototype.showMessage=function(e,t){e&&(this.caption=e),t&&this.setWidgetProperty("type",t),this.setWidgetProperty("show",!0)},t.prototype.hideMessage=function(){this.setWidgetProperty("show",!1)},t.prototype.dismiss=function(e){this.hideMessage(),this.invokeEventCallback("close",{$event:e})},t.prototype.onMessageTypeChange=function(e){var t,n;switch(e){case"success":t="alert-success",n="wm-sl-l sl-check";break;case"error":t="alert-danger",n="wi wi-cancel";break;case"warn":case"warning":t="alert-warning",n="wm-sl-l sl-alarm-bell";break;case"info":t="alert-info",n="wi wi-info";break;case"loading":t="alert-info alert-loading",n="fa fa-spinner fa-spin"}i.switchClass(this.nativeElement,t,this.messageClass),this.messageClass=t,this.messageIconClass=n},t.prototype.onPropertyChange=function(t,n,i){"type"===t?this.onMessageTypeChange(n):e.prototype.onPropertyChange.call(this,t,n,i)},t}(Oe);Be.initializeProps=Fe(),Be.decorators=[{type:t.Component,args:[{selector:"[wmMessage]",template:'<i aria-hidden="true" [title]="type + \'Alert\'" class="icon {{type}} {{messageIconClass}}"></i>\n<span [innerHtml]="caption"></span>\n<button title="Close" type="button" class="btn-transparent close" [hidden]="hideclose" (click)="dismiss($event)" aria-label="Close">\n <span aria-hidden="true">×</span>\n</button>\n',providers:[N(Be)],exportAs:"wmMessage"}]}],Be.ctorParameters=function(){return[{type:t.Injector}]};var Ge=function(){Z("wm-partial",new Map([["name",ee]]))},Ve={widgetType:"wm-partial",hostClass:"app-partial clearfix"},$e=function(e){function t(t,n){var i=e.call(this,t,Ve)||this;return i.viewport=n,i.registerDestroyListener(i.viewport.subscribe("resize",(function(e){return i.callback("resize",e)}))),i.registerDestroyListener(i.viewport.subscribe("orientationchange",(function(e){return i.callback("orientationchange",e)}))),i}return d(t,e),t.prototype.callback=function(e,t){t=_.assign({widget:this},t),this.invokeEventCallback(e,t)},t.prototype.ngOnAttach=function(){this.callback("attach")},t.prototype.ngOnDetach=function(){this.callback("detach")},t.prototype.ngOnDestroy=function(){this.callback("destroy")},t}(Oe);$e.initializeProps=Ge(),$e.decorators=[{type:t.Directive,args:[{selector:"[wmPartial]",providers:[N($e)]}]}],$e.ctorParameters=function(){return[{type:t.Injector},{type:i.Viewport}]};var Ue=function(){function e(e){this.widgetRef=e,this.widgetRef.partialParams={},this.widgetRef.pageParams=this.widgetRef.partialParams,this.widgetRef.params$=new s.Subject}return e.prototype.registerParams=function(e,t,n,o){var r=this;this.widgetRef.partialParams[e]=t,!t&&n?this.widgetRef.registerDestroyListener(i.$watch(n,this.widgetRef.getViewParent(),_.get(this.widgetRef,"context"),(function(t){r.widgetRef.partialParams[e]=t,r.widgetRef.params$.next()}))):this.widgetRef.params$.next()},e}();Ue.decorators=[{type:t.Directive,args:[{selector:"[partialContainer]"}]}],Ue.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Self},{type:t.Inject,args:[y]}]}]};var We=function(){function e(e,t,n){this.bindValue=e,this.type=t,this.partialParamsProvider=n}return e.prototype.ngOnInit=function(){this.partialParamsProvider.registerParams(this.name,this.value,this.bindValue,this.type)},e}();We.decorators=[{type:t.Directive,args:[{selector:"[wmParam]"}]}],We.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Attribute,args:["value.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["type"]}]},{type:Ue}]},We.propDecorators={name:[{type:t.Input}],value:[{type:t.Input}]};var qe=function(){function e(e,t,n,o,r,a,s,c){var p=this;this.componentInstance=e,this.vcRef=t,this.elRef=n,this.inj=o,this.app=r,this.resolver=s,this.partialRefProvider=c,this.contentInitialized=!1,this.renderPartial=_.debounce(this._renderPartial,200),e.registerPropertyChangeListener((function(t,n,o){"content"===t&&(e.$lazyLoad?e.$lazyLoad=function(){p.renderPartial(n),e.$lazyLoad=i.noop}:p.renderPartial(n))}));var u=e.params$.pipe(l.filter((function(){return p.contentInitialized})),l.debounceTime(200)).subscribe((function(){return p.renderPartial(e.content)}));e.registerDestroyListener((function(){return u.unsubscribe()}))}return Object.defineProperty(e.prototype,"name",{get:function(){return this.componentInstance.name},enumerable:!1,configurable:!0}),e.prototype._renderPartial=function(e){return h(this,void 0,void 0,(function(){var t,n,o,r,a=this;return m(this,(function(s){switch(s.label){case 0:return this.vcRef.clear(),i.$invokeWatchers(!0),(t=$(this.elRef.nativeElement).closest(".app-prefab")).length?n=t.attr("prefabname"):this.componentInstance.viewParent&&(n=this.componentInstance.viewParent.prefabName),[4,this.partialRefProvider.getComponentFactoryRef(e,i.ComponentType.PARTIAL,{prefab:n})];case 1:return(o=s.sent())&&((r=this.vcRef.createComponent(o,0,this.inj))&&r._component&&n&&(r._component.prefabName=n),this.$target||(this.$target=this.elRef.nativeElement.querySelector("[partial-container-target]")||this.elRef.nativeElement),this.$target.innerHTML="",this.$target.appendChild(r.location.nativeElement),this.contentInitialized=!0,setTimeout((function(){return a.onLoadSuccess()}),200)),[2]}}))}))},e.prototype.onLoadSuccess=function(){this.componentInstance.invokeEventCallback("load"),this.app.notify("partialLoaded")},e}();qe.decorators=[{type:t.Directive,args:[{selector:"[partialContainer]"}]}],qe.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Self},{type:t.Inject,args:[y]}]},{type:t.ViewContainerRef},{type:t.ElementRef},{type:t.Injector},{type:i.App},{type:String,decorators:[{type:t.Attribute,args:["content"]}]},{type:t.ComponentFactoryResolver},{type:i.PartialRefProvider}]};var ze=function(){function e(e,t,n,i,o){this.elRef=e,this.widget=t,this.viewContainerRef=n,this.templateRef=o,this.context=i.view.context,window.addEventListener("resize",this.onResize.bind(this))}return Object.defineProperty(e.prototype,"showInDevice",{set:function(e){this.devices=e.split(","),this.onResize()},enumerable:!1,configurable:!0}),e.prototype.onResize=function(e){var t=getComputedStyle(document.documentElement).getPropertyValue("--screen-lg")||"1200px",n=getComputedStyle(document.documentElement).getPropertyValue("--screen-md")||"992px",o=getComputedStyle(document.documentElement).getPropertyValue("--screen-sm")||"768px",r=getComputedStyle(document.documentElement).getPropertyValue("--screen-lg-tab-landscape")||"1366px",a=getComputedStyle(document.documentElement).getPropertyValue("--screen-lg-tab-portrait")||"1024px",s=parseFloat(t)-1+"px",l=parseFloat(n)-1+"px",c=parseFloat(o)-1+"px";this.devices.indexOf("lg")>-1&&window.matchMedia("(min-width: "+t+")").matches&&!i.isLargeTabletLandscape(r,a)||this.devices.indexOf("md")>-1&&(i.isLargeTabletLandscape(r,a)||window.matchMedia("(min-width: "+n+") and (max-width: "+s+")").matches&&!i.isLargeTabletPortrait(r,a))||this.devices.indexOf("sm")>-1&&(window.matchMedia("(min-width: "+o+") and (max-width: "+l+")").matches||i.isLargeTabletPortrait(r,a))||this.devices.indexOf("xs")>-1&&window.matchMedia("(max-width: "+c+")").matches||this.devices.indexOf("all")>-1?this.embeddedView||(this.embeddedView=this.viewContainerRef.createEmbeddedView(this.templateRef,this.context)):(this.viewContainerRef.clear(),this.embeddedView="")},e.prototype.ngOnDestroy=function(){window.removeEventListener("resize",this.onResize)},e}();ze.decorators=[{type:t.Directive,args:[{selector:"[showInDevice]"}]}],ze.ctorParameters=function(){return[{type:t.ElementRef},{type:_e,decorators:[{type:t.Inject,args:[y]}]},{type:t.ViewContainerRef},{type:t.Injector},{type:t.TemplateRef}]},ze.propDecorators={showInDevice:[{type:t.Input}]};var He=function(){function e(e,t,n){this._isEnabled=!1,this._lastScrollY=-1,this._waitRefreshTill=-1,this.pendingIscrolls=[],this._$el=$(t.nativeElement),this.app=n}return e.prototype.ngOnInit=function(){var e=this;this.cancelSubscription=this.app.subscribe("no-iscroll",(function(t){e.pendingIscrolls.push(t)}))},e.prototype.ngDoCheck=function(){this._isEnabled?this._smoothScrollInstance?this.refreshIScroll():this._smoothScrollInstance=this.applySmoothScroll():this._smoothScrollInstance&&this._smoothScrollInstance.destroy&&this._smoothScrollInstance.destroy()},e.prototype.ngOnDestroy=function(){this._smoothScrollInstance&&this._smoothScrollInstance.destroy&&this._smoothScrollInstance.destroy(),this.cancelSubscription&&this.cancelSubscription()},Object.defineProperty(e.prototype,"wmSmoothscroll",{set:function(e){this._isEnabled=!0===e||"true"===e,this._isEnabled?this._smoothScrollInstance||(this._smoothScrollInstance=this.applySmoothScroll()):this.ngOnDestroy()},enumerable:!1,configurable:!0}),e.prototype.applySmoothScroll=function(e,t){var n=this;if(!i.isMobileApp()||i.isKitkatDevice())return null;var o={scrollbars:!0,preventDefault:!1,momentum:!0,bounce:!1,mouseWheel:!0,disablePointer:!0,disableTouch:!1,disableMouse:!1},r=this._$el[0];if(!r.children.length)return null;this._$el.addClass("smoothscroll-wrapper"),r.onscroll=function(e){e.target.iscroll&&e.target.scrollTop&&(e.target.iscroll.scrollTo(e.target.iscroll.x,e.target.iscroll.y-e.target.scrollTop),e.target.scrollTop=0)},t&&"INPUT"===t.tagName&&t.focus(),e&&(o.fadeScrollbars=!0);var a=new IScroll(r,o);if(e){_.forEach(e,(function(e,t){_.forEach(e,(function(e){a.on(t,e)}))}));var s=this;a.on("scrollStart",(function(){this._scrolling=!0,i.isMobileApp()&&s.app.notify("iscroll-start",{})})),a.on("scrollEnd",(function(){this._scrolling=!1})),a.refresh()}return this.app.notify("iscroll-start",{}),a.indicatorRefresh=function(){var e,t=n._$el[0].iscroll.indicators;if(t.length)for(e=0;e<t.length;e++)t[e].refresh()},this._$el[0].iscroll=a,_.forEach(this.pendingIscrolls,(function(e,t){if(e.isSameNode(n._$el[0]))return n.app.notify("iscroll-update",{el:e}),void n.pendingIscrolls.splice(t,1)})),this.app.notify("iscroll-update",{}),{iScroll:a,destroy:function(){a.destroy(),$(a.scroller).css({"transition-timing-function":"","transition-duration":"",transform:""}),a=null,delete r.iscroll}}},e.prototype.refreshIScroll=function(){var e=this._smoothScrollInstance.iScroll;if(!(e._scrolling||this._waitRefreshTill>Date.now())){if(e.wrapper&&!_.includes(e.wrapper.children[0].classList,"smoothscroll-container")&&e.wrapper.scrollHeight>e.wrapper.clientHeight){var t=e._events,n=document.activeElement;$(e.wrapper.children).wrapAll('<div class="smoothscroll-container"></div>'),this._smoothScrollInstance.destroy(),this._smoothScrollInstance=this.applySmoothScroll(t,n)}this._lastScrollY!==this._$el[0].iscroll.maxScrollY?(Ye(this._smoothScrollInstance.iScroll),this._lastScrollY=this._$el[0].iscroll.maxScrollY):this._smoothScrollInstance.iScroll.refresh(),this._waitRefreshTill=Date.now()+500}},e}();He.decorators=[{type:t.Directive,args:[{selector:"[wmSmoothscroll]"}]}],He.ctorParameters=function(){return[{type:t.Injector},{type:t.ElementRef},{type:i.App}]},He.propDecorators={wmSmoothscroll:[{type:t.Input}]};var Ye=function(e){var t=!e&&$(".smoothscroll-container");e&&e.wrapper&&e.wrapper.contains(document.activeElement)&&"INPUT"===document.activeElement.tagName&&$(document.activeElement).offset().top+document.activeElement.clientHeight>.9*window.innerHeight&&document.activeElement.scrollIntoView({behavior:"auto",block:"end",inline:"end"}),e?(e.indicatorRefresh&&e.indicatorRefresh(),e.refresh&&e.refresh()):t.length&&t.parent().each((function(e,t){t.iscroll.indicatorRefresh(),t.iscroll.refresh()}))},Ke=Ye;window.addEventListener("resize",i.debounce(Ye,200));var Qe=function(){function e(e){this.elRef=e}return Object.defineProperty(e.prototype,"textContent",{set:function(e){var t=e;null==e&&(t=""),this.elRef.nativeElement.textContent=t},enumerable:!1,configurable:!0}),e}();Qe.decorators=[{type:t.Directive,args:[{selector:"[textContent]"}]}],Qe.ctorParameters=function(){return[{type:t.ElementRef}]},Qe.propDecorators={textContent:[{type:t.Input}]};var Xe=function(e){return _.isDate(e)||isNaN(e)||(e=parseInt(e,10)),moment(e).valueOf()||moment((new Date).toDateString()+" "+e).valueOf()},Je=function(){function e(e){this.decimalPipe=e}return e.prototype.transform=function(e,t,n,i,o,r,a,s){n=o&&!a?"1."+r.length+"-16":n;var l=s?s.number:void 0;return this.decimalPipe.transform(e,n,i||l||t)},e}();Je.decorators=[{type:t.Pipe,args:[{name:"trailingZeroDecimalPipe"}]}],Je.ctorParameters=function(){return[{type:n.DecimalPipe}]};var Ze=function(){function e(e,t){this.datePipe=e,this.i18nService=t}return e.prototype.transform=function(e,t,n,o){var r;if("null"===e||""===e)return"";if(!i.isDefined(e))return"";if(r=Xe(e)){if("timestamp"===t)return r;if("UTC"===t)return new Date(r).toISOString();var a=this.i18nService?this.i18nService.getTimezone(o):n;return a&&(e===r||i.hasOffsetStr(e))?moment(r).tz(a).format(t.replaceAll("y","Y").replaceAll("d","D").replace("a","A")):this.datePipe.transform(r,t)}return""},e}();Ze.decorators=[{type:t.Pipe,args:[{name:"toDate"}]}],Ze.ctorParameters=function(){return[{type:n.DatePipe},{type:i.AbstractI18nService}]};var et=function(){function e(e,t){this.decimalPipe=e,this.i18nService=t}return e.prototype.transform=function(e,t){if(t&&!String(t).match(/^(\d+)?\.((\d+)(-(\d+))?)?$/)&&(t="1."+t+"-"+t),!_.isNaN(+e)){var n=this.i18nService&&this.i18nService.getwidgetLocale()?this.i18nService.getwidgetLocale():void 0,i=n?n.number:null;return this.decimalPipe.transform(e,t,i)}},e}();et.decorators=[{type:t.Pipe,args:[{name:"toNumber"}]}],et.ctorParameters=function(){return[{type:n.DecimalPipe},{type:i.AbstractI18nService,decorators:[{type:t.Inject,args:[i.AbstractI18nService]}]}]};var tt=function(){function e(e,t){this.decimalPipe=e,this.i18nService=t}return e.prototype.transform=function(e,t,n){var o=(i.CURRENCY_INFO[t]||{}).symbol||t||"",r=new et(this.decimalPipe,this.i18nService).transform(e,n),a=_.startsWith(r,"-");return a&&(r=r.replace("-","")),r?a?"-"+o+r:o+r:""},e}();tt.decorators=[{type:t.Pipe,args:[{name:"toCurrency"}]}],tt.ctorParameters=function(){return[{type:n.DecimalPipe},{type:i.AbstractI18nService,decorators:[{type:t.Inject,args:[i.AbstractI18nService]}]}]};var nt=function(){function e(){}return e.prototype.transform=function(e,t){return _.isUndefined(e)||null===e||""===e?e:(t||"")+e},e}();nt.decorators=[{type:t.Pipe,args:[{name:"prefix"}]}];var it=function(){function e(){}return e.prototype.transform=function(e,t){return _.isUndefined(e)||null===e||""===e?e:e+(t||"")},e}();it.decorators=[{type:t.Pipe,args:[{name:"suffix"}]}];var ot=function(){function e(e){this.custmeUserPipe=e}return e.prototype.transform=function(e,t){for(var n=[],i=2;i<arguments.length;i++)n.push(arguments[i]);var o=this.custmeUserPipe.getCustomPipe(t);if(!o||!_.isFunction(o.formatter))return console.warn("formatter is not defined, please check the custom pipes documentation"),e;try{return o.formatter.apply(o,v([e],g(n)))}catch(n){return console.error("Pipe name: "+t,n),e}},e}();ot.decorators=[{type:t.Pipe,args:[{name:"custom"}]}],ot.ctorParameters=function(){return[{type:i.CustomPipeManager}]};var rt=function(){function e(){}return e.prototype.transform=function(e){var t;if(i.isDefined(e))return(t=Xe(e))?moment(t).fromNow():void 0},e}();rt.decorators=[{type:t.Pipe,args:[{name:"timeFromNow"}]}];var at=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return d(t,e),t}(et);at.decorators=[{type:t.Pipe,args:[{name:"numberToString"}]}];var st=function(){function e(){}return e.prototype.transform=function(e){return Number(e)||void 0},e}();st.decorators=[{type:t.Pipe,args:[{name:"stringToNumber"}]}];var lt=function(){function e(){}return e.prototype.transform=function(e,t,n){return e?_.isObject(t)?_.filter(e,t):_.filter(e,(function(e){return _.includes(e[t],n)})):[]},e}();lt.decorators=[{type:t.Pipe,args:[{name:"filter"}]}];var ct=function(){function e(){}return e.prototype.transform=function(e,t){for(var n=0;e>=1024;)e/=1024,n++;return e.toFixed(+t)+" "+["bytes","KB","MB","GB","TB","PB"][n]},e}();ct.decorators=[{type:t.Pipe,args:[{name:"filesize"}]}];var pt=function(){function e(){}return e.prototype.transform=function(e){return"fa "+({zip:"fa-file-zip-o",pdf:"fa-file-pdf-o",rar:"fa-file-archive-o",txt:"fa-file-text-o",ppt:"fa-file-powerpoint-o",pot:"fa-file-powerpoint-o",pps:"fa-file-powerpoint-o",pptx:"fa-file-powerpoint-o",potx:"fa-file-powerpoint-o",ppsx:"fa-file-powerpoint-o",mpg:"fa-file-movie-o",mp4:"fa-file-movie-o",mov:"fa-file-movie-o",avi:"fa-file-movie-o",mp3:"fa-file-audio-o",docx:"fa-file-word-o",js:"fa-file-code-o",md:"fa-file-code-o",html:"fa-file-code-o",css:"fa-file-code-o",xlsx:"fa-file-excel-o",png:"fa-file-image-o",jpg:"fa-file-image-o",jpeg:"fa-file-image-o",file:"fa-file-o",default:"fa-file-o"}[e]||"fa-file-o")},e}();pt.decorators=[{type:t.Pipe,args:[{name:"fileIconClass"}]}];var ut=function(){function e(){}return e.prototype.transform=function(e){return{success:"wi wi-done text-success",error:"wi wi-error text-danger"}[e.toLowerCase()]},e}();ut.decorators=[{type:t.Pipe,args:[{name:"stateClass"}]}];var dt=function(){function e(){}return e.prototype.transform=function(e){return{"audio/aac":".aac","application/x-abiword":".abw","application/vnd.android.package-archive":".apk","video/x-msvideo":".avi","application/vnd.amazon.ebook":".azw","application/octet-stream":".bin","image/bmp":".bmp","application/x-bzip":".bz","application/x-bzip2":".bz2","application/x-csh":".csh","text/css":".css","text/csv":".csv","application/msword":".doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":".docx","application/vnd.ms-fontobject":".eot","application/epub+zip":".epub","application/ecmascript":".es","image/gif":".gif","text/html":".html","image/x-icon":".ico","text/calendar":".ics","application/java-archive":".jar","image/jpeg":[".jpeg",".jpg"],"application/javascript":".js","application/json":".json","audio/midi":".mid","audio/x-midi":".midi","video/mpeg":".mpeg","application/vnd.apple.installer+xml":"mpkg","application/vnd.oasis.opendocument.presentation":".odp","application/vnd.oasis.opendocument.spreadsheet":".ods","application/vnd.oasis.opendocument.text":".odt","audio/ogg":".oga","video/ogg":".ogv","application/ogg":".ogx","font/otf":".otf","image/png":".png","application/pdf":".pdf","application/vnd.ms-powerpoint":".ppt","application/vnd.openxmlformats-officedocument.presentationml.presentation":".pptx","application/x-rar-compressed":".rar","application/rtf":".rtf","application/x-sh":".sh","image/svg+xml":".svg","application/x-shockwave-flash":".swf","application/x-tar":".tar","image/tiff":".tiff","application/typescript":".ts","font/ttf":".ttf","text/plain":".txt","application/vnd.visio":".vsd","audio/wav":".wav","audio/webm":".weba","video/webm":".webm","image/webp":".webp","font/woff":".woff","font/woff2":".woff2","application/xhtml+xml":".xhtml","application/vnd.ms-excel":".xls","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":".xlsx","application/xml":".xml","application/vnd.mozilla.xul+xml":".xul","application/zip":".zip","video/3gpp":".3gp","audio/3gpp":".3gp","video/3gpp2":".3g2","audio/3gpp2":".3g2","application/x-7z-compressed":".7z"}[e]},e}();dt.decorators=[{type:t.Pipe,args:[{name:"fileExtensionFromMime"}]}];var ht=function(){function e(e){this.domSanitizer=e}return e.prototype.transform=function(e,n){if(null==e)return"";switch(n){case"html":case t.SecurityContext.HTML:return this.domSanitizer.bypassSecurityTrustHtml(e);case"style":case t.SecurityContext.STYLE:return this.domSanitizer.bypassSecurityTrustStyle(e);case"script":case t.SecurityContext.SCRIPT:return this.domSanitizer.bypassSecurityTrustScript(e);case"url":case t.SecurityContext.URL:return this.domSanitizer.bypassSecurityTrustUrl(e);case"resource":case t.SecurityContext.RESOURCE_URL:return this.domSanitizer.bypassSecurityTrustResourceUrl(e)}},e}();ht.decorators=[{type:t.Pipe,args:[{name:"trustAs"}]}],ht.ctorParameters=function(){return[{type:a.DomSanitizer}]};var mt=[],ft=[],gt=function(){function e(){this.dialogRefsCollection=new Map,this.appConfirmDialog="_app-confirm-dialog"}return e.prototype.register=function(e,t,n){e&&(this.dialogRefsCollection.get(e)?this.dialogRefsCollection.get(e).set(n,t):this.dialogRefsCollection.set(e,new Map([[n,t]])))},e.prototype.getDialogRefsCollection=function(){return this.dialogRefsCollection},e.prototype.deRegister=function(e,t){e&&this.dialogRefsCollection.get(e)&&this.dialogRefsCollection.get(e).delete(t)},e.prototype.getDialogRef=function(e,t){var n,i=this.dialogRefsCollection.get(e);return t?(n=i.get(t))||(t.pageName||t.partialName||t.prefabName?console.error('No dialog with the name "'+e+'" found in the given scope.'):i.forEach((function(t,i){i&&"Common"===i.partialName?n=t:console.error('No dialog with the name "'+e+'" found in the App scope.')}))):1===i.size?n=i.entries().next().value[1]:console.error("There are multiple instances of this dialog name. Please provide the Page/Partial/App instance in which the dialog exists."),n},e.prototype.open=function(e,t,n){var i=this.getDialogRef(e,t);i&&i.open(n)},e.prototype.close=function(e,t,n){var i=this.getDialogRef(e,t);i&&(i.closeCallBackFn=n,i.close())},e.prototype.closeAllDialogs=function(){_.forEach(mt.reverse(),(function(e){e.close()}))},e.prototype.showAppConfirmDialog=function(e){this.open(this.getAppConfirmDialog(),void 0,e)},e.prototype.closeAppConfirmDialog=function(){this.close(this.getAppConfirmDialog())},e.prototype.getAppConfirmDialog=function(){return this.appConfirmDialog},e.prototype.setAppConfirmDialog=function(e){this.appConfirmDialog=e},e.prototype.addToOpenedDialogs=function(e){mt.push(e)},e.prototype.getLastOpenedDialog=function(){return mt[mt.length-1]},e.prototype.removeFromOpenedDialogs=function(e){(-1!==mt.indexOf(e)&&mt.splice(mt.indexOf(e),1),0===mt.length&&(i.isMobile()||i.isMobileApp()))&&$("body > app-root")[0].removeAttribute("aria-hidden")},e.prototype.getOpenedDialogs=function(){return mt},e.prototype.addToClosedDialogs=function(e){ft.push(e)},e.prototype.removeFromClosedDialogs=function(e){-1!==ft.indexOf(e)&&ft.splice(ft.indexOf(e),1)},e.prototype.getDialogRefFromClosedDialogs=function(){return ft[ft.length-1]},e}();gt.decorators=[{type:t.Injectable}],gt.ctorParameters=function(){return[]};var vt=function(){function e(e){this.domSanitizer=e}return e.prototype.transform=function(e,n){if(null==e)return"";switch(n){case"html":case t.SecurityContext.HTML:return this.domSanitizer.sanitize(t.SecurityContext.HTML,e);case"style":case t.SecurityContext.STYLE:return this.domSanitizer.sanitize(t.SecurityContext.STYLE,e);case"script":case t.SecurityContext.SCRIPT:return this.domSanitizer.sanitize(t.SecurityContext.SCRIPT,e);case"url":case t.SecurityContext.URL:return this.domSanitizer.sanitize(t.SecurityContext.URL,e);case"resource":case t.SecurityContext.RESOURCE_URL:return this.domSanitizer.sanitize(t.SecurityContext.RESOURCE_URL,e);case"none":case t.SecurityContext.NONE:return this.domSanitizer.sanitize(t.SecurityContext.NONE,e)}},e}();vt.decorators=[{type:t.Pipe,args:[{name:"sanitize"}]}],vt.ctorParameters=function(){return[{type:a.DomSanitizer}]};var yt=[Ae,Ne,Me,Le,Be,$e,Ue,We,qe,Se,ze,He,Qe],bt=[Ze,pt,dt,lt,ct,et,tt,nt,it,rt,at,ut,st,Je,ht,Re,ot,vt],wt=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[Ze,lt,Je,ht,Re,ot,vt,n.Location,{provide:i.AbstractDialogService,useClass:gt}]}},e}();wt.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,o.SecurityModule],declarations:v(v([],g(yt)),g(bt)),exports:v(v([],g(yt)),g(bt))}]}];var Pt,_t=function(){};e.Live_Operations=void 0,(Pt=e.Live_Operations||(e.Live_Operations={})).INSERT="insert",Pt.UPDATE="update",Pt.DELETE="delete",Pt.READ="read";var Ot="All Fields",St={EMPTY_KEY:"EMPTY_NULL_FILTER",EMPTY_VALUE:"No Value",LABEL_KEY:"key",LABEL_VALUE:"value",NULL_EMPTY:["null","empty"],NULL:"null",EMPTY:"empty"};function Et(e){return _.includes([i.FormWidgetType.AUTOCOMPLETE,i.FormWidgetType.TYPEAHEAD,i.FormWidgetType.CHIPS],e)}var Tt=function(e,t,n){var o=i.debounce((function(){_.isFunction(n)&&n(t)}),300);o();var r=t?_.isObject(t)?t:JSON.parse(t):{},a=e.registerDestroyListener?e.registerDestroyListener.bind(e):_.noop,s=i.processFilterExpBindNode(e,r).subscribe((function(e){t=JSON.stringify(e.filterExpressions),o()}));a((function(){return s.unsubscribe()}))},Ct=function(e,t){var n,o={};return t["is-related"]?(o.tableName=t["lookup-type"],n=t["lookup-field"],o.distinctField=n,o.aliasColumn=n.replace(".","$"),o.filterExpr=t.filterexpressions?_.isObject(t.filterexpressions)?t.filterexpressions:JSON.parse(t.filterexpressions):{}):(o.tableName=e.execute(i.DataSource.Operation.GET_ENTITY_NAME),n=t.field||t.key,o.distinctField=n,o.aliasColumn=n),o};function At(e,t,n){var o;return new Promise((function(r,a){!A(t[n])||t.isDataSetBound&&"filterwidget"!==n||(o=Ct(e,t),e.execute(i.DataSource.Operation.GET_DISTINCT_DATA_BY_FIELDS,{fields:o.distinctField,entityName:o.tableName,pagesize:t.limit,filterExpr:t.filterexpressions?JSON.parse(t.filterexpressions):{}}).then((function(e){r({field:t,data:e.data,aliasColumn:o.aliasColumn})}),a))}))}function Rt(e,t){if(Et(e[t.widget]))return e.datafield=t.aliasColumn||St.LABEL_KEY,e.searchkey=t.distinctField||St.LABEL_KEY,void(e.displaylabel=e.displayfield=t.aliasColumn||St.LABEL_VALUE);e.datafield=St.LABEL_KEY,e.displayfield=St.LABEL_VALUE}function It(e,t,n){var o=[i.FormWidgetType.SELECT,i.FormWidgetType.RADIOSET],r={},a=[];n.isEnableEmptyFilter&&_.includes(o,e[n.widget])&&!e["is-range"]&&!e.multiple&&(r[St.LABEL_KEY]=St.EMPTY_KEY,r[St.LABEL_VALUE]=n.EMPTY_VALUE||St.EMPTY_VALUE,a.push(r)),_.each(t,(function(e){var t=e[n.aliasColumn],i={};null!==t&&""!==t&&(i[St.LABEL_KEY]=t,i[St.LABEL_VALUE]=t,a.push(i))})),Rt(e,n),e.dataset=a}function Dt(e,t,n){if(e&&t&&!t.isDataSetBound)if(Et(t[n.widget])){var i=Ct(e,t);t.dataoptions=i,Rt(t,Object.assign(n||{},i)),t.datasource=e}else Tt(t.viewParent,t.filterexpressions,(function(i){t.filterexpressions=i,At(e,t,n.widget).then((function(e){It(e.field,e.data,{aliasColumn:e.aliasColumn,widget:n.widget,isEnableEmptyFilter:Mt(n.enableemptyfilter),EMPTY_VALUE:n.EMPTY_VALUE})}))}))}function Nt(e){return i.isDefined(e)&&""!==e&&null!==e}function xt(e,t){var n;return Nt(e)&&Nt(t)?n=[e,t]:Nt(e)?n=e:Nt(t)&&(n=t),n}function kt(e,t){var n;return Nt(e)&&Nt(t)?n=i.MatchMode.BETWEEN:Nt(e)?n=i.MatchMode.GREATER:Nt(t)&&(n=i.MatchMode.LESSER),n}function Mt(e){return e&&_.intersection(e.split(","),St.NULL_EMPTY).length>0}function Lt(e){var t,n=_.split(e,",");return 2===_.intersection(n,St.NULL_EMPTY).length?t=i.MatchMode.NULLOREMPTY:_.includes(n,St.NULL)?t=i.MatchMode.NULL:_.includes(n,St.EMPTY)&&(t=i.MatchMode.EMPTY),t}var Ft=function(e){return _.isUndefined(e)||_.isNull(e)?[]:(_.isString(e)&&(e=e.split(",").map(Function.prototype.call,String.prototype.trim)),_.isArray(e)||(e=[e]),e)};var jt,Bt=moment.localeData(),Gt=i.getClonedObject(Bt._calendar),Vt=Bt._calendarDay||{lastDay:"[Yesterday]",lastWeek:"[Last] dddd",nextDay:"[Tomorrow]",nextWeek:"dddd",sameDay:"[Today]",sameElse:"L"},$t="alphabet",Ut="Others",Wt={HOUR:"hour",DAY:"day",WEEK:"week",MONTH:"month",YEAR:"year"},qt="yyyy-MM-dd",zt="w 'Week', yyyy",Ht="MMM, yyyy",Yt="YYYY",Kt="hh:mm a",Qt=function(e,t,n){if(!t)return _.cloneDeep(e);var i=t.split(","),o=[],r=[];return i.forEach((function(e){var t=e.split(":");o.push(n?n+"."+t[0]:t[0]),r.push(t[1])})),_.orderBy(e,o,r)},Xt=function(e){return _.isString(e)&&(e=_.split(e,",").map((function(e){return e.trim()}))),e},Jt=function(e){return"wm-search"===e},Zt=function(e,t,n,o){if(e&&Jt(e.widgetType))if(e.groupby)if(_.includes(e.groupby,"(")){var r=i.$parseEvent(e.groupby);n.groupby=r(t,{row:n.dataObject||n})}else n.groupby=rn(e.groupby,e.match,o,e.dateformat,e.datePipe,e.appDefaults,n);else n.groupby=""},en=function(e,t,n){var i=[];return _.forEach(_.keys(e),(function(o,r){var a=Qt(e[o],n,"dataObject");i.push({key:o,data:_.sortBy(a,(function(e){return e._groupIndex=r+1,_.get(e,t)||_.get(e.dataObject,t)}))})})),i},tn=function(e,t,n,i,o,r,a,s){n===Wt.DAY&&(Bt._calendar=Vt),e=_.orderBy(e,(function(e){var n=_.get(a?e[a]:e,t);if(n)return _.toLower(n)}));var l=_.groupBy(e,rn.bind(void 0,t,n,a,o,r,s));return Bt._calendar=Gt,l},nn=function(e,t,n,o){return"timestamp"===t?e:i.getFormattedDate(o,e,t||n)},on=function(e,t,n,i,o){var r,a=moment(e),s=n,l=moment(),c=function(){return"["+nn(this.valueOf(),s,qt,i)+"]"};switch(t){case Wt.HOUR:s=s||o.timeFormat,a.isValid()||(a=moment((new Date).toDateString()+" "+e)).isValid()&&(Bt._calendar.sameDay=function(){return"["+nn(this.valueOf(),s,Kt,i)+"]"}),a=a.startOf("hour"),Bt._calendar.sameElse=c,r=a.calendar(l);break;case Wt.WEEK:r=nn(a.valueOf(),s,zt,i);break;case Wt.MONTH:r=nn(a.valueOf(),s,Ht,i);break;case Wt.YEAR:r=a.format(Yt);break;case Wt.DAY:s=s||o.dateFormat,a=a.startOf("day"),Bt._calendar.sameElse=c,r=a.calendar(l)}return"Invalid date"===r?Ut:r},rn=function(e,t,n,i,o,r,a){var s=_.get(n?a[n]:a,e);return _.isUndefined(s)||_.isNull(s)||""===s.toString().trim()?Ut:(t===$t&&(s=s.substr(0,1)),_.includes(_.values(Wt),t)&&(s=on(s,t,i,o,r)),s)},an=function(){},sn="default",ln="label",cn=function(e,t,n,i){_.forEach(e,(function(e){_.get(e,"isGroup")&&(e.field===n?e.columns[i]=t:cn(e.columns,t,n,i))}))},pn=function(e){return"true"===e||"false"!==e&&(/^\d+$/.test(e)?+e:e)},un={integer:["number","text","select","checkboxset","radioset","rating","slider","currency","autocomplete","chips"],big_integer:["number","text","select","checkboxset","radioset","rating","slider","currency","autocomplete","chips"],short:["number","text","select","checkboxset","radioset","slider","currency","autocomplete","chips"],float:["number","text","select","checkboxset","radioset","slider","currency","autocomplete","chips"],big_decimal:["number","text","select","checkboxset","radioset","slider","currency","autocomplete","chips"],number:["number","text","select","checkboxset","radioset","slider","currency","autocomplete","chips"],double:["number","text","select","checkboxset","radioset","slider","currency","autocomplete","chips"],long:["number","text","select","checkboxset","radioset","rating","slider","currency","autocomplete","chips"],byte:["number","text","select","checkboxset","radioset","slider","currency","autocomplete","chips"],string:["text","number","textarea","password","richtext","select","checkboxset","radioset","date","time","timestamp","switch","currency","autocomplete","chips","colorpicker"],character:["text","number","textarea","password","richtext","select","checkboxset","radioset","switch","currency","autocomplete","chips"],text:["text","number","textarea","password","richtext","select","checkboxset","radioset","date","time","timestamp","switch","currency","autocomplete","chips","colorpicker"],date:["date","text","number","select","checkboxset","radioset","autocomplete","chips"],time:["time","text","number","select","checkboxset","radioset","autocomplete","chips"],timestamp:["timestamp","text","number","select","checkboxset","radioset","autocomplete","chips"],datetime:["datetime","text","select","checkboxset","radioset","autocomplete","chips"],boolean:["checkbox","radioset","toggle","select"],list:["select","radioset","checkboxset","switch","autocomplete","chips"],clob:["text","textarea","richtext"],blob:["upload"],file:["upload"],custom:["text","number","textarea","password","checkbox","toggle","slider","richtext","currency","switch","select","checkboxset","radioset","date","time","timestamp","rating","datetime","autocomplete","chips","colorpicker"]},dn=function(e){if(e)return/^(\/|#\/|#)(?!\W).*/.test(e)?"#/"+(e=_.first(e.match(/[\w]+.*/g))||""):_.startsWith(e,"www.")?"//"+e:e},hn=function(e){function t(t,n){var i=e.call(this,t,n)||this;return i.nodes=[],i.nodes$=new s.Subject,i._resetNodes=_.debounce(i.resetNodes,50),i.securityService=i.inj.get(o.SecurityService),i.binditemlabel=i.nativeElement.getAttribute("itemlabel.bind"),i.binditemicon=i.nativeElement.getAttribute("itemicon.bind"),i.binditemaction=i.nativeElement.getAttribute("itemaction.bind"),i.binditembadge=i.nativeElement.getAttribute("itembadge.bind"),i.binditemchildren=i.nativeElement.getAttribute("itemchildren.bind"),i.binditemid=i.nativeElement.getAttribute("itemid.bind"),i.binditemlink=i.nativeElement.getAttribute("itemlink.bind"),i.binditemtarget=i.nativeElement.getAttribute("itemtarget.bind"),i.binduserrole=i.nativeElement.getAttribute("userrole.bind"),i.bindisactive=i.nativeElement.getAttribute("isactive.bind"),i}return d(t,e),t.prototype.getNode=function(e,t){var n=this.viewParent.pageScope||this.viewParent,o=E(t,{field:this.itemchildren,bindExpression:this.binditemchildren},n)||_.get(t,e.childrenField),r={action:E(t,{field:this.itemaction,bindExpression:this.binditemaction},n)||_.get(t,e.actionField),badge:E(t,{field:this.itembadge,bindExpression:this.binditembadge},n)||_.get(t,e.badgeField),children:Array.isArray(o)?this.getNodes(o):[],class:_.get(t,e.classField),disabled:t.disabled,icon:E(t,{field:this.itemicon,bindExpression:this.binditemicon},n)||_.get(t,e.iconField),id:E(t,{field:this.itemid,bindExpression:this.binditemid},n)||_.get(t,e.idField),label:E(t,{field:this.itemlabel,bindExpression:this.binditemlabel},n)||_.get(t,e.labelField),link:dn(E(t,{field:this.itemlink,bindExpression:this.binditemlink},n)||_.get(t,e.linkField)),target:dn(E(t,{field:this.itemtarget,bindExpression:this.binditemtarget},n)||_.get(t,e.targetField)),role:E(t,{field:this.userrole,bindExpression:this.binduserrole},n),isactive:E(t,{field:this.isactive,bindExpression:this.bindisactive},n),value:this.datafield?"All Fields"===this.datafield?t:i.findValueOf(t,this.datafield):t};return _.omitBy(r,_.isUndefined)},t.prototype.resetItemFieldMap=function(){this._itemFieldMap=null},t.prototype.getItemFieldsMap=function(){return this._itemFieldMap||(this._itemFieldMap={idField:this.itemid||"itemid",iconField:this.itemicon||"icon",labelField:this.itemlabel||"label",linkField:this.itemlink||"link",targetField:this.itemtarget||"target",badgeField:this.itembadge||"badge",childrenField:this.itemchildren||"children",classField:this.itemclass||"class",actionField:this.itemaction||"action",isactiveField:this.isactive||"isactive"}),this._itemFieldMap},t.prototype.prepareNodeDataSet=function(e){return(e=Ft(e)).map((function(e){return i.isObject(e)?e:{label:e,value:e}}))},t.prototype.getNodes=function(e){var t=this;void 0===e&&(e=this.dataset||{});var n=Qt(this.prepareNodeDataSet(e),this.orderby)||[];if(n.length){var o=this.userrole,r=this.getItemFieldsMap();n=n.reduce((function(e,n){return i.validateAccessRoles(n[o],t.securityService.loggedInUser)&&e.push(t.getNode(r,n)),e}),[])}return n},t.prototype.resetNodes=function(){this.resetItemFieldMap(),this.nodes=this.getNodes(),i.$appDigest(),this.nodes$.next()},t.prototype.onPropertyChange=function(t,n,i){switch(t){case"dataset":case"itemicon":case"itemlabel":case"itemlink":case"itemtarget":case"itemclass":case"itemchildren":case"isactive":case"orderby":this._resetNodes()}e.prototype.onPropertyChange.call(this,t,n,i)},t}(Oe),mn={pattern:"regexp",max:"maxvalue",min:"minvalue",required:"required",maxlength:"maxchars",mindate:"mindate",maxdate:"maxdate",excludedates:"excludedates",excludedays:"excludedays",invalidNumber:"invalidNumber"},fn=function(){function e(e,t,n,i,o,r){this.instance=e,this.formwidget=t,this.widgettype=n,this.widgetControl=i,this.widgetContext=o,this.defaultValidatorMessages=[],r&&(this.tableFieldType=r)}return e.prototype.getDefaultValidators=function(){var e=[];return this.instance.required&&!1!==this.instance.show&&(this.widgettype===i.FormWidgetType.CHECKBOX||this.widgettype===i.FormWidgetType.TOGGLE?e.push(c.Validators.requiredTrue):e.push(c.Validators.required)),this.instance.maxchars&&e.push(c.Validators.maxLength(this.instance.maxchars)),this.instance.minvalue&&e.push(c.Validators.min(this.instance.minvalue)),this.instance.maxvalue&&this.widgettype!==i.FormWidgetType.RATING&&e.push(c.Validators.max(this.instance.maxvalue)),this.instance.regexp&&e.push(c.Validators.pattern(this.instance.regexp)),this.formwidget&&_.isFunction(this.formwidget.validate)&&e.push(this.formwidget.validate.bind(this.formwidget)),e},e.prototype.setUpValidators=function(e){if(!this.hasValidators&&(this.instance._validators=this.getDefaultValidators(),e&&this.instance._validators.push(e),this.widgetContext.ngform)){this.widgetControl.setValidators(this.instance._validators);var t={};this.formwidget&&this.instance.value===this.formwidget.prevDatavalue&&(t.emitEvent=!1),this.widgetControl.updateValueAndValidity(t)}},e.prototype.getPromiseList=function(e){var t=this,n=[];return _.forEach(e,(function(e,i){var o=e;e instanceof Function&&e.bind&&(o=e(t.widgetControl,t.widgetContext)),o instanceof Promise&&n.push(o)})),n},e.prototype.setAsyncValidators=function(e){var t=this;this._asyncValidatorFn=function(){return function(){return Promise.all(t.getPromiseList(e)).then((function(){return t.instance.validationmessage="",null}),(function(e){if(e.hasOwnProperty("errorMessage"))t.instance.validationmessage=_.get(e,"errorMessage");else{var n=_.keys(e);t.instance.validationmessage=e[n[0]].toString()}return e})).then((function(e){var n=function(){setTimeout((function(){"PENDING"===t.widgetControl.status?n():t.instance.onStatusChange(t.widgetControl.status,t.tableFieldType)}),100)};return n(),e}))}},this.widgetControl.setAsyncValidators([this._asyncValidatorFn()]),this.widgetContext.ngform.touched&&this.widgetControl.updateValueAndValidity()},e.prototype.isDefaultValidator=function(e){return _.get(i.VALIDATOR,_.toUpper(e))},e.prototype.setDefaultValidator=function(e,t){t&&t instanceof Function?this.watchDefaultValidatorExpr(t.bind(void 0,this.widgetControl,this.widgetContext),e):(this.instance.widget[e]=t,this.instance[e]=t)},e.prototype.setValidators=function(e){var t=this,n=_.cloneDeep(e);this.hasValidators=!0,this._syncValidators=[],_.forEach(n,(function(e,i){if(e&&e instanceof Function)n[i]=e.bind(void 0,t.widgetControl,t.widgetContext),t._syncValidators.push(n[i]);else{var o=_.get(e,"type");if(t.defaultValidatorMessages[o]=_.get(e,"errorMessage"),t.isDefaultValidator(o)){var r=_.get(e,"validator");t.setDefaultValidator(o,r),n[i]=""}}})),this._syncValidators=_.filter(n,(function(e){if(e)return e})),this.applyDefaultValidators()},e.prototype.observeOn=function(e,t){var n=this;_.forEach(e,(function(e){var i=_.find(n.widgetContext[t],{key:e});i&&(i.notifyForFields||(i.notifyForFields=[]),i.notifyForFields.push(n.instance))}))},e.prototype.validate=function(){this.applyDefaultValidators(),this._asyncValidatorFn&&(this.widgetControl.setAsyncValidators([this._asyncValidatorFn()]),this.widgetControl.updateValueAndValidity()),this.widgetContext.ngform.touched&&this.widgetControl.markAsTouched()},e.prototype.watchDefaultValidatorExpr=function(e,t){var n=this,o=this.instance.widgetId+"_"+t+"_formField";i.$unwatch(o),this.instance.registerDestroyListener(i.$watch("boundFn(fn)",_.extend(this.instance,this.instance.viewParent),{fn:e},(function(e,i){n.instance.widget[t]=e,n.applyDefaultValidators()}),o))},e.prototype.applyDefaultValidators=function(){var e=this.getDefaultValidators();this.widgetControl.setValidators(_.concat(this._syncValidators||[],e)),this.widgetControl.updateValueAndValidity(),this.setCustomValidationMessage()},e.prototype.setCustomValidationMessage=function(){var e=this.widgetControl&&this.widgetControl.errors;if(e)if(e.hasOwnProperty("errorMessage"))this.instance.validationmessage=_.get(e,"errorMessage");else{var t=_.keys(e)[0],n=_.get(mn,t)||this.formwidget.validateType;if(n){var i=_.get(this.defaultValidatorMessages,n)||this.instance.validationmessage;this.instance.validationmessage=i&&i instanceof Function?i(this.widgetControl,this.widgetContext):i}else this.instance.validationmessage=""}},e}(),gn=function(e){function t(t,n,o){var r=e.call(this)||this;r.$el=t,r.app=n,r.onPullToRefresh=o,r.count=0;return r.$el.prepend('<div class="refresh-container"></div>'),r.infoContainer=r.$el.find(".refresh-container"),i.isIos()&&r.infoContainer.addClass("ios-refresh-container"),r.init(r.$el),r}return d(t,e),t.prototype.threshold=function(){return 10},t.prototype.direction=function(){return $.fn.swipey.DIRECTIONS.VERTICAL},t.prototype.subscribe=function(){var e=this;this.cancelSubscription=this.app.subscribe("toggle-variable-state",(function(t){t.active&&e.animationInProgress?(e.count++,e.wait()):e.count>0&&e.count--,!e.count&&e.animationInProgress&&e.stopAnimation()}))},t.prototype.bounds=function(e,t){var n=this.$el[0].iscroll;return t<0||n&&!isNaN(n.y)&&0!==n.y?{lower:void 0,upper:void 0}:(this.spinner||(this.spinner=i.isIos()?new yn(this.infoContainer):new vn(this.infoContainer),this.subscribe()),{lower:0,center:0,upper:i.isIos()?0:150,strict:!i.isIos()})},t.prototype.context=function(){var e=this;return this.infoContainer.show(),i.isIos()&&this.infoContainer.addClass("entry"),{spin:function(t){e.spinner.setRotation(2*t)}}},t.prototype.animation=function(){return i.isIos()?{css:{transform:"translate3d(0, ${{$D + $d}}px, 0)",spin:"${{spin($d)}}"}}:{target:this.infoContainer,css:{transform:"translate3d(0, ${{$D + $d}}px, 0)",spin:"${{spin($d)}}",opacity:"${{min(($D + $d) / 100, 1)}}"}}},t.prototype.onAnimation=function(){var e=this;this.animationInProgress=!0,this.spinner.start(),this.onPullToRefresh&&this.onPullToRefresh(),setTimeout((function(){e.runAnimation||e.stopAnimation()}))},t.prototype.stopAnimation=function(){var e=this;setTimeout((function(){e.runAnimation=!1,e.animationInProgress=!1,e.spinner.stop(),e.infoContainer.hide(),i.setCSS(e.infoContainer[0],"transform","none"),i.isIos()||i.setCSS(e.infoContainer[0],"opacity",0),e.infoContainer.removeClass("entry")}),800)},t.prototype.wait=function(){this.runAnimation=!0},t}(p.SwipeAnimation),vn=function(){function e(e,t){this.$el=e,this.options=t||{}}return e.prototype.polarToCartesian=function(e,t,n,i){var o=(i-90)*Math.PI/180;return{x:e+n*Math.cos(o),y:t+n*Math.sin(o)}},e.prototype.describeArc=function(e,t,n,i,o){var r=this.polarToCartesian(e,t,n,o),a=this.polarToCartesian(e,t,n,i),s=o-i<=180?"0":"1";return["M",r.x,r.y,"A",n,n,0,s,0,a.x,a.y,"L",a.x,a.y].join(" ")},e.prototype.init=function(){if(!this.initialized){var e=$('<svg><path id="arc1"/></svg>'),t=$('<div class="android-spinner"></div>');t.append(e),this.$el.append(t),this.cx=t.outerWidth()/2,this.cy=t.outerHeight()/2,this.r=.6*this.cx,this.path=t.find("path"),this.initialized=!0,this.container=t}},e.prototype.setRotation=function(e){this.init(),this.path.attr("d",this.describeArc(this.cx,this.cy,this.r,0,e))},e.prototype.start=function(){var e=this;this.init();var t=this,n=this.options.time||1800,i=0;this.container.addClass("spin"),this.intervalId=setInterval((function(){var n;n=(i+=10)>720?i=0:i>360?720-i:i,t.path.attr("d",e.describeArc(t.cx,t.cy,t.r,0,n))}),10*n/360)},e.prototype.stop=function(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=0),this.container.removeClass("spin")},e}(),yn=function(){function e(e){this.$el=e}return e.prototype.init=function(){if(!this.svg){var e=$('<div class="ios-spinner"><svg></svg></div>'),t=e.find("svg");this.$el.append(e);for(var n=e.width(),i=0;i<12;i++)t[0].innerHTML+='<line y1="'+.15*n+'" y2="'+.3*n+'"\n transform="translate('+.5*n+", "+.5*n+") rotate("+30*i+')">\n </line>';e.append(t),this.svg=t}},e.prototype.setRotation=function(e){this.init(),this.svg.css("transform","rotateZ( "+30*Math.round(e/30)+"deg)")},e.prototype.start=function(){var e=this;this.init();var t=0;this.intervalId=setInterval((function(){t+=10,e.setRotation(t)}),20)},e.prototype.stop=function(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=0)},e}(),bn=this;!function(e){e.LEFT_PANEL="page-left-panel",e.RIGHT_PANEL="page-right-panel",e.SWIPE_ELEM="page-left-panel-icon",e.CONTENT="app-content-column",e.HEADER="page-header",e.SEARCH="app-search"}(jt||(jt={}));var wn=function(e){return"[data-role='"+e+"']"},Pn=(wn("pageContainer"),function(e,t){"string"==typeof e&&(e=document.querySelector(e)),e&&(e.removeEventListener("click",t),e.addEventListener("click",t))}),_n=function(e,t){if(i.isMobile()){if(e)try{e.widget.collapse()}catch(e){}t&&i.setCSS(t,"display","none")}},On=function(e,t,n,i){void 0===i&&(i=!1),i||Pn(t,_n.bind(bn,e,n))},Sn=function(e,t){Pn(wn(jt.SWIPE_ELEM),(function(){e&&(e.widget.toggle(),e.classList.contains("visible")&&t&&i.setCSS(t,"display","none"))}))},En=function(e){Pn(e,_n)},Tn=function(e,t){"none"===$(e).css("display")?(_n(t),i.setCSS(e,"display","inline-table")):_n(t,e)},Cn=function(e,t){$(e).each((function(e,n){var i=$('<a class="app-header-action"><i class="wi wi-search"></i></a>');$(n).before(i),Pn(i,(function(){return Tn(n,t)}))}))};e.ALLFIELDS=Ot,e.AUTOCLOSE_TYPE={OUTSIDECLICK:"outsideClick",ALWAYS:"always",DISABLED:"disabled"},e.BaseComponent=_e,e.BaseContainerComponent=Ee,e.BaseFieldValidations=fn,e.ContainerDirective=Ae,e.Context=w,e.CustomPipe=ot,e.DEBOUNCE_TIMES={PAGINATION_DEBOUNCE_TIME:250},e.DISPLAY_TYPE=le,e.DataSetItem=an,e.DatasetAwareNavComponent=hn,e.DialogRef=b,e.DialogServiceImpl=gt,e.EDIT_MODE={QUICK_EDIT:"quickedit",INLINE:"inline",FORM:"form",DIALOG:"dialog"},e.EVENTS_MAP=se,e.FileExtensionFromMimePipe=dt,e.FileIconClassPipe=pt,e.FileSizePipe=ct,e.FilterPipe=lt,e.INPUTMODE={FINANCIAL:"financial",NATURAL:"natural"},e.ImagePipe=Re,e.ItemTemplateDirective=Ne,e.LIVE_CONSTANTS=St,e.LazyLoadDirective=Le,e.MessageComponent=Be,e.NAVIGATION_TYPE={ADVANCED:"Advanced",BASIC:"Basic",CLASSIC:"Classic",INLINE:"Inline",NONE:"None",ONDEMAND:"On-Demand",PAGER:"Pager",SCROLL:"Scroll"},e.NumberToStringPipe=at,e.PROP_ANY=ie,e.PROP_BOOLEAN=ne,e.PROP_NUMBER=te,e.PROP_STRING=ee,e.PartialContainerDirective=qe,e.PartialDirective=$e,e.PartialParamDirective=We,e.PartialParamHandlerDirective=Ue,e.PrefixPipe=nt,e.PullToRefresh=gn,e.RedrawableDirective=Se,e.RepeatTemplateDirective=Me,e.SanitizePipe=vt,e.ShowInDeviceDirective=ze,e.SmoothScrollDirective=He,e.StateClassPipe=ut,e.StringToNumberPipe=st,e.StylableComponent=Oe,e.SuffixPipe=it,e.TextContentDirective=Qe,e.TimeFromNowPipe=rt,e.ToCurrencyPipe=tt,e.ToDatePipe=Ze,e.ToNumberPipe=et,e.TrailingZeroDecimalPipe=Je,e.TrustAsPipe=ht,e.WidgetRef=y,e.WmComponentsModule=wt,e.applyFilterOnField=function(e,t,n,o,r){void 0===r&&(r={});var a=t.field||t.key,s=_.filter(n,{"filter-on":a});o=t["is-range"]?xt(t.minValue,t.maxValue):i.isDefined(o)?o:t.value,!e||r.isFirst&&(_.isUndefined(o)||""===o)||_.forEach(s,(function(n){var a,s,l,c=n.field||n.key,p=t["lookup-field"]||t._primaryKey,u=n["edit-widget-type"]||n.widgettype,d={},h=n["filter-on"];A(u)&&!n.isDataSetBound&&h!==c&&(t&&t["is-related"]&&(h+="."+p),i.isDefined(o)?(l=t["is-range"]?kt(t.minValue,t.maxValue):Mt(r.enableemptyfilter)&&o===St.EMPTY_KEY?Lt(r.enableemptyfilter):i.MatchMode.EQUALS,a=_.isObject(o)&&!_.isArray(o)?o[p]:o,d[h]={value:a,matchMode:l}):d={},s=c,Et(u)&&n.dataoptions?n.dataoptions.filterFields=d:e.execute(i.DataSource.Operation.GET_DISTINCT_DATA_BY_FIELDS,{fields:s,filterFields:d,pagesize:n.limit}).then((function(e){It(n,e.data,{aliasColumn:s,widget:r.widget||"widgettype",isEnableEmptyFilter:Mt(r.enableemptyfilter),EMPTY_VALUE:r.EMPTY_VALUE})}),_t))}))},e.configureDnD=function(e,t,n,i,o){var r=Object.assign({containment:e,delay:100,opacity:.8,helper:"clone",zIndex:1050,tolerance:"pointer",start:n,update:i,sort:o},t);e.sortable(r)},e.convertDataToObject=Xt,e.createArrayFrom=Ft,e.extractDataAsArray=function(e){return _.isUndefined(e)||_.isNull(e)||""===_.trim(e)?[]:(_.isString(e)&&(e=_.split(e,",").map((function(e){return e.trim()}))),_.isArray(e)||(e=[e]),e)},e.extractDataSourceName=function(e){if(e){var t,n=e.split(".");return n.length>1&&"Variables"===n[0]&&(t=n[1]),t}},e.fetchDistinctValues=function(e,t,n){_.isEmpty(t)||t.forEach((function(t){Dt(e,t,n)}))},e.fetchRelatedFieldData=function(e,t,n){var o,r,a=n.relatedField,s=n.datafield;e&&(o=e.execute(i.DataSource.Operation.GET_RELATED_PRIMARY_KEYS,a),t.datafield=s,t._primaryKey=_.isEmpty(o)?void 0:o[0],t.compareby=o&&o.join(","),r=s===Ot?void 0:s,t.displayfield=r=t.displayfield||r||t._primaryKey,Et(t[n.widget])?(t.dataoptions={relatedField:a,filterExpr:t.filterexpressions?t.filterexpressions:{}},t.datasource=e,t.searchkey=t.searchkey||r,t.displaylabel=t.displayfield=t.displaylabel||r,t.showPendingSpinner&&(t.showPendingSpinner=!1)):Tt(t.viewParent,t.filterexpressions,(function(n){t.filterexpressions=n,e.execute(i.DataSource.Operation.GET_RELATED_TABLE_DATA,{relatedField:a,pagesize:t.limit,orderBy:t.orderby?_.replace(t.orderby,/:/g," "):"",filterFields:{},filterExpr:t.filterexpressions?t.filterexpressions:{}}).then((function(e){t.dataset=e.data,t.displayfield=t.displayfield||_.head(_.keys(_.get(e,"[0]"))),t.showPendingSpinner&&(t.showPendingSpinner=!1)}),_t)})))},e.filterDate=nn,e.getBackGroundImageUrl=I,e.getConditionalClasses=B,e.getContainerTargetClass=function(e){return".wm-app"},e.getDataTableFilterWidget=function(e){var t=un[e]&&un[e][0];return e===i.DataType.BOOLEAN&&(t=i.FormWidgetType.SELECT),_.includes([i.FormWidgetType.TEXT,i.FormWidgetType.NUMBER,i.FormWidgetType.SELECT,i.FormWidgetType.AUTOCOMPLETE,i.FormWidgetType.DATE,i.FormWidgetType.TIME,i.FormWidgetType.DATETIME],t)?t:i.FormWidgetType.TEXT},e.getDefaultValue=function(e,t,n){return n?n===i.FormWidgetType.NUMBER||n===i.FormWidgetType.SLIDER||n===i.FormWidgetType.CURRENCY?isNaN(Number(e))?null:Number(e):n===i.FormWidgetType.CHECKBOX||n===i.FormWidgetType.TOGGLE?pn(e):e:i.isNumberType(t)?isNaN(Number(e))?null:Number(e):t===i.DataType.BOOLEAN?pn(e):e},e.getDefaultViewModeWidget=function(e){return _.includes(["checkbox","toggle","rating"],e)?sn:ln},e.getDistinctFieldProperties=Ct,e.getDistinctValues=At,e.getDistinctValuesForField=Dt,e.getEditModeWidget=function(e){return e["related-entity-name"]&&e["primary-key"]?i.FormWidgetType.SELECT:un[e.type]&&un[e.type][0]||i.FormWidgetType.TEXT},e.getEmptyMatchMode=Lt,e.getEnableEmptyFilter=Mt,e.getEvaluatedData=E,e.getFieldLayoutConfig=function(e,t,n){var o="",r="";return"top"===(t=t||"top")||"floating"===t?n&&"android"===n||!i.isMobileApp()||i.isAndroid()?o=r="col-xs-12":i.isMobileApp()&&(o="col-xs-4",r="col-xs-8"):e&&_.forEach(_.split(e," "),(function(e){var t,n,i=_.split(e,"-"),a=i[0];t=parseInt(i[1],10),o+=" col-"+a+"-"+t,r+=" col-"+a+"-"+(n=(n=12-t)<=0?12:n)})),{captionCls:o,widgetCls:r}},e.getFieldTypeWidgetTypesMap=function(){return un},e.getImageUrl=R,e.getKeyboardFocusableElements=function(e){var t=e.querySelectorAll("a, button, input, textarea, select, details, iframe, embed, object, summary dialog, audio[controls], video[controls], [contenteditable]");return Array.from(t).filter((function(e){return!e.hasAttribute("disabled")&&!e.hasAttribute("hidden")&&(!e.hasAttribute("tabindex")||e.hasAttribute("tabindex")&&!e.getAttribute("tabindex").startsWith("-"))}))},e.getMatchModeMsgs=function(e){return{start:e.LABEL_STARTS_WITH,startignorecase:e.LABEL_STARTS_WITH_IGNORECASE,end:e.LABEL_ENDS_WITH,endignorecase:e.LABEL_ENDS_WITH_IGNORECASE,anywhere:e.LABEL_CONTAINS,anywhereignorecase:e.LABEL_CONTAINS_IGNORECASE,exact:e.LABEL_IS_EQUAL_TO,exactignorecase:e.LABEL_IS_EQUAL_TO_IGNORECASE,notequals:e.LABEL_IS_NOT_EQUAL_TO,notequalsignorecase:e.LABEL_IS_NOT_EQUAL_TO_IGNORECASE,lessthan:e.LABEL_LESS_THAN,lessthanequal:e.LABEL_LESS_THAN_OR_EQUALS_TO,greaterthan:e.LABEL_GREATER_THAN,greaterthanequal:e.LABEL_GREATER_THAN_OR_EQUALS_TO,null:e.LABEL_IS_NULL,isnotnull:e.LABEL_IS_NOT_NULL,empty:e.LABEL_IS_EMPTY,isnotempty:e.LABEL_IS_NOT_EMPTY,nullorempty:e.LABEL_IS_NULL_OR_EMPTY,in:e.LABEL_IN,notin:e.LABEL_NOT_IN,between:e.LABEL_BETWEEN}},e.getMatchModeTypesMap=function(e){return e&&(L.number.push("in","notin","between"),L.date.push("between"),L.string.push("in","notin"),L.character.push("in","notin")),_.forEach(M,(function(e,t){_.forEach(e,(function(e){F[e]=L[t]}))})),F.default=_.union(L.number,L.string,L.character,L.date,L.date),F},e.getObjValueByKey=S,e.getOrderByExpr=function(e){e=e||[];var t=[];return _.forEach(e,(function(e){e.direction&&t.push(e.property+" "+e.direction.toLowerCase())})),_.join(t,",")},e.getOrderedDataset=Qt,e.getRangeFieldValue=xt,e.getRangeMatchMode=kt,e.getRowOperationsColumn=function(){return{field:"rowOperations",type:"custom",displayName:"Actions",width:"120px",readonly:!0,sortable:!1,searchable:!1,resizable:!1,selectable:!1,show:!0,operations:[],opConfig:{},pcDisplay:!0,mobileDisplay:!0,tabletDisplay:!0,include:!0,isRowOperation:!0}},e.getUniqObjsByDataField=function(e,t,n,i){var o,r=t===Ot;return o=r?_.uniqWith(e,_.isEqual):_.uniqBy(e,"key"),!n||i?o:_.filter(o,(function(e){return(r||_.trim(e.key))&&_.trim(e.label)}))},e.getWatchIdentifier=k,e.getWidgetPropsByType=J,e.groupData=function(e,t,n,o,r,a,s,l,c){var p={};if(_.includes(n,"(")){var u=i.$parseEvent(n);p=_.groupBy(t,(function(t){return u(e.viewParent,{row:t.dataObject||t})}))}else p=tn(t,n,o,r,a,s,l,c);return en(p,n,r)},e.handleHeaderClick=function(e){var t=$(e.target).closest(".item-group"),n=t.find("li.list-group-header .app-icon");n.hasClass("wi-chevron-down")?n.removeClass("wi-chevron-down").addClass("wi-chevron-up"):n.removeClass("wi-chevron-up").addClass("wi-chevron-down"),t.find(".group-list-item").toggle()},e.hasLinkToCurrentPage=C,e.interpolateBindExpressions=Tt,e.isActiveNavItem=T,e.isBooleanAttr=pe,e.isDataSetWidget=A,e.isDimensionProp=de,e.isStyle=W,e.parseValueByType=function(e,t,n,o){return n?n===i.FormWidgetType.NUMBER||n===i.FormWidgetType.SLIDER||n===i.FormWidgetType.CURRENCY?isNaN(Number(e))?null:o?e:Number(e):n===i.FormWidgetType.CHECKBOX||n===i.FormWidgetType.TOGGLE?pn(e):e:i.isNumberType(t)?isNaN(Number(e))?null:Number(e):t===i.DataType.BOOLEAN?pn(e):e},e.performDataOperation=function(t,n,o){return new Promise((function(r,a){if(t.execute(i.DataSource.Operation.SUPPORTS_CRUD)){var s=void 0;switch(o.operationType){case e.Live_Operations.UPDATE:s=i.DataSource.Operation.UPDATE_RECORD;break;case e.Live_Operations.INSERT:s=i.DataSource.Operation.INSERT_RECORD;break;case e.Live_Operations.DELETE:s=i.DataSource.Operation.DELETE_RECORD}t.execute(s,n).then((function(e){return function(e,t,n){e.error?n(e):t(e)}(e,r,a)}),a)}else if(t.execute(i.DataSource.Operation.IS_API_AWARE))if("wm.CrudVariable"===t.category){var l="insert"===o.operationType?"create":"delete"===o.operationType?"delete":"update";t.execute(i.DataSource.Operation.INVOKE,{skipNotification:!0,operation:l,inputFields:n}).then(r,a)}else t.execute(i.DataSource.Operation.SET_INPUT,n),t.execute(i.DataSource.Operation.INVOKE,{skipNotification:!0}).then(r,a);else r(n)}))},e.prepareFieldDefs=function(e,t){var n,i={objects:[],terminals:[]};if(e||(e=[]),t||(t={}),t.setBindingField=!0,t.columnCount=0,n=V(e),G(n,i,"",t),!t||t&&!t.filter)return i.terminals;switch(t.filter){case"all":return i;case"objects":return i.objects;case"terminals":return i.terminals}return i},e.propNameCSSKeyMap=U,e.provideAs=D,e.provideAsDialogRef=function(e){return D(e,b)},e.provideAsWidgetRef=N,e.refreshDataSource=function(e,t){return new Promise((function(n,o){e?e.execute(i.DataSource.Operation.LIST_RECORDS,{filterFields:t.filterFields||{},orderBy:t.orderBy,page:t.page||1,logicalOp:t.condition||""}).then(n,o):o()}))},e.register=Z,e.registerFormWidget=function(e,t){var n=Q+e,i=X.get(n);i&&t.forEach((function(e,t){return i.set(t,e)}))},e.setFocusTrap=function(e,t,n){return r.createFocusTrap(e,{onActivate:function(){return e.classList.add("is-active")},onDeactivate:function(){return e.classList.remove("is-active")},allowOutsideClick:t,setReturnFocus:n})},e.setHeaderConfig=cn,e.setHeaderConfigForTable=function(e,t,n,i){n?cn(e,t,n,i):e[i]=t},e.setItemByCompare=function(e,t,n){_.forEach(e,(function(e){if(i.isEqualWithFields(e.value,t,n))return e.selected=!0,!1}))},e.styler=Y,e.toggleAllHeaders=function(e){var t=$(e.nativeElement).find(".item-group");t.find(".group-list-item").toggle();var n=t.find("li.list-group-header .app-icon");n&&_.forEach(n,(function(e){(e=$(e)).hasClass("wi-chevron-down")?e.removeClass("wi-chevron-down").addClass("wi-chevron-up"):e.removeClass("wi-chevron-up").addClass("wi-chevron-down")}))},e.transformData=function(e,t){var n,i,o,r,a,s,l;return e=e||[],_.isArray(e)?_.isString(e[0])&&(i=[],_.forEach(e,(function(e){(n={})[t.split(".").join("-")]=e,i.push(n)})),e=i):(_.isString(e)&&(o=t.substring(t.indexOf(".")+1,t.length).split("."),r=[],a=o.length,l=s={},o.forEach((function(t,n){r.forEach((function(e){l=s[e]})),l[t]=n===a-1?e:{},r.push(t)})),e=s),e=[e]),e},e.transformDataWithKeys=function(e){var t=[];if(_.isObject(e[0])||_.isObject(e)&&!(e instanceof Array)){var n=Object.keys(e[0]||e);_.forEach(n,(function(e,n){t.push({key:e,label:e,value:e,index:n+1})}))}return t},e.transformFormData=function(e,t,n,o,r,a){var s=[];if(t){if(t=Xt(t),_.isUndefined(r)&&(r=1),_.isString(t))(t=t.split(",").map((function(e){return e.trim()}))).forEach((function(t,n){var o={key:t,value:t,label:i.isDefined(t)&&null!==t?t.toString():"",index:r+n};Zt(a,e,o,"value"),s.push(o)}));else if(_.isArray(t)&&!_.isObject(t[0]))t.forEach((function(t,n){var o={key:t,value:t,label:i.isDefined(t)&&null!==t?t.toString():"",index:r+n};Zt(a,e,o,"value"),s.push(o)}));else if(t instanceof Array||!_.isObject(t))n||(n=Ot),t.forEach((function(t,l){var c=n===Ot?r+l:S(t,n);if(!_.isUndefined(c)&&!_.isNull(c)){var p=E(t,{field:o.displayField,expression:o.displayExpr,bindExpression:o.bindDisplayExpr},e),u={key:c,label:i.isDefined(p)&&null!==p?p.toString():"",value:n===Ot?t:c,dataObject:t,index:r+l};(o.displayImgSrc||o.bindDisplayImgSrc)&&(u.imgSrc=E(t,{expression:o.displayImgSrc,bindExpression:o.bindDisplayImgSrc},e)),Zt(a,e,u,"dataObject"),s.push(u)}}));else{_.forEach(t,(function(n,o){var l={key:_.trim(o),value:o,label:i.isDefined(n)&&null!==n?n.toString():"",index:r,dataObject:t};Zt(a,e,l,"value"),s.push(l)}))}return s}},e.unsupportedStatePersistenceTypes=["On-Demand","Scroll"],e.updateDeviceView=function(e,t){void 0===t&&(t=!1);var n=e.querySelector(wn(jt.LEFT_PANEL)),i=e.querySelector(wn(jt.RIGHT_PANEL)),o=e.querySelector(wn(jt.HEADER)),r=o&&o.querySelector("."+jt.SEARCH),a=e.querySelector("."+jt.CONTENT);On(n,a,r,t),n?Sn(n,r):$(o).find(wn(jt.SWIPE_ELEM)).remove(),i&&En(i),r&&Cn(r,n)},e["\u02750"]=Ke,e["\u0275a"]=oe,e["\u0275b"]=Ie,e["\u0275c"]=xe,e["\u0275d"]=Fe,e["\u0275e"]=Ge,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@wm/transpiler"),require("@wm/core"),require("@angular/compiler")):"function"==typeof define&&define.amd?define("@wm/buildTask",["exports","@wm/transpiler","@wm/core","@angular/compiler"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.buildTask={}),e.wm.transpiler,e.wm.core,e.ng.compiler)}(this,(function(e,t,n,i){"use strict";var o=new n.IDGenerator("wm_carousel_ref_"),r=function(e){return e.attrs.find((function(e){return"type"===e.name&&"dynamic"===e.value}))},a=r;t.register("wm-carousel",(function(){return{pre:function(e,n){var i=o.nextUid();return n.set("carousel_ref",i),'<div class="app-carousel carousel"><carousel wmCarousel #'+i+'="wmCarousel" '+t.getAttrMarkup(e)+' interval="0" [ngClass]="'+i+'.navigationClass">'},post:function(){return"</carousel></div>"},template:function(e){if(r(e)){var i=e.attrs.find((function(e){return"dataset"===e.name})),o=e.attrs.find((function(e){return"name"===e.name}));if(!i)return;var a=t.getBoundToExpr(i.value);if(!a)return;n.updateTemplateAttrs(e,a,o.value)}},provide:function(e,t){var n=new Map;return n.set("carousel_ref",t.get("carousel_ref")),n}}}));var s=Object.freeze({__proto__:null,default:function(){},"\u02750":a}),l=1;t.register("wm-carousel-content",(function(){return{pre:function(e){return"<slide wmCarouselTemplate "+t.getAttrMarkup(e)+">"},post:function(){return"</slide>"}}})),t.register("wm-carousel-template",(function(){return{requires:["wm-carousel"],pre:function(e,n,i){var o=i.get("carousel_ref");return'<div *ngIf="!'+o+'.fieldDefs">{{'+o+".nodatamessage}}</div>\n <"+"slide wmCarouselTemplate "+t.getAttrMarkup(e)+' *ngFor="let item of '+o+'.fieldDefs; let i = index;">\n <ng-container [ngTemplateOutlet]="carouselTempRef'+l+'" [ngTemplateOutletContext]="{item:item, index:i}"></ng-container>\n </'+"slide>\n <ng-template #carouselTempRef"+l+++' let-item="item" let-index="index">'},post:function(){return"</ng-template>"}}}));var c=Object.freeze({__proto__:null,default:function(){}});t.register("wm-login",(function(){return{pre:function(e){return"<div wmLogin "+t.getAttrMarkup(e)+' eventsource.bind="Actions.loginAction">'},post:function(){return"</div>"},provide:function(){var e=new Map;return e.set("isLogin",!0),e}}}));var p=Object.freeze({__proto__:null,default:function(){}});t.register("wm-marquee",(function(){return{pre:function(e){return'<marquee onmouseover="this.stop();" onmouseout="this.start();" wmMarquee role="marquee" aria-live="off" '+t.getAttrMarkup(e)+">"},post:function(){return"</marquee>"}}}));var u=Object.freeze({__proto__:null,default:function(){}}),d=new n.IDGenerator("wm_anchor");t.register("wm-anchor",(function(){return{pre:function(e){var n=d.nextUid();return"<a wmAnchor #"+n+'="wmAnchor" role="link" data-identifier="anchor" [attr.aria-label]="'+n+".hint || "+n+'.caption" '+t.getAttrMarkup(e)+">"},post:function(){return"</a>"}}}));var h=Object.freeze({__proto__:null,default:function(){}});t.register("wm-audio",(function(){return{pre:function(e){return"<div wmAudio "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var m=Object.freeze({__proto__:null,default:function(){}}),f=new n.IDGenerator("wm_html");t.register("wm-html",(function(){return{pre:function(e){var n=f.nextUid();return"<div wmHtml #"+n+'="wmHtml" [attr.aria-label]="'+n+".hint || 'HTML content'\" "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var g=Object.freeze({__proto__:null,default:function(){}});t.register("wm-icon",(function(){return{pre:function(e){return'<span wmIcon aria-hidden="true" '+t.getAttrMarkup(e)+">"},post:function(){return"</span>"}}}));var v=Object.freeze({__proto__:null,default:function(){}});t.register("wm-iframe",(function(){return{pre:function(e){return"<div wmIframe "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var y=Object.freeze({__proto__:null,default:function(){}}),b=new n.IDGenerator("wm_label");t.register("wm-label",(function(){return{pre:function(e){var n=b.nextUid();return"<label wmLabel #"+n+'="wmLabel" [attr.aria-label]="'+n+'.hint" '+t.getAttrMarkup(e)+">"},post:function(){return"</label>"}}}));var w=Object.freeze({__proto__:null,default:function(){}}),P=new n.IDGenerator("wm_picture");t.register("wm-picture",(function(){return{pre:function(e){var n=P.nextUid();return"<img wmPicture #"+n+'="wmPicture" alt="image" wmImageCache="'+(e.get("offline")||"true")+'" [attr.aria-label]="'+n+".hint || 'Image'\" "+t.getAttrMarkup(e)+">"}}}));var O=Object.freeze({__proto__:null,default:function(){}}),S=new n.IDGenerator("wm_spinner");t.register("wm-spinner",(function(){return{pre:function(e){var n=S.nextUid();return"<div wmSpinner #"+n+'="wmSpinner" role="alert" [attr.aria-label]="'+n+'.hint || \'Loading...\'" aria-live="assertive" aria-busy="true" '+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var E=Object.freeze({__proto__:null,default:function(){}}),T=function(e,t){return e.attrs.find((function(e){return e.name===t}))},C=T,A=function(e,t){var n=T(e,t);if(n)return n.value},R=A,I=function(e){return new RegExp("bind:("+e+"|"+e+"\\[\\$i])\\.","g")},D=I;t.register("wm-progress-bar",(function(){return{template:function(e){var n=A(e,"dataset"),i=t.getBoundToExpr(n);if(i){var o=A(e,"type"),r=A(e,"datavalue"),a=I(i);o&&o.includes(i)&&(o=o.replace(a,""),T(e,"type").value=o),r&&r.includes(i)&&(r=r.replace(a,""),T(e,"datavalue").value=r)}},pre:function(e){return"<div wmProgressBar "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var N=Object.freeze({__proto__:null,default:function(){},"\u02750":C,"\u02751":R,"\u02752":D});t.register("wm-progress-circle",(function(){return{pre:function(e){return"<div wmProgressCircle "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var x=Object.freeze({__proto__:null,default:function(){}}),k=new n.IDGenerator("wm_richtexteditor");t.register("wm-richtexteditor",(function(){return{pre:function(e){var n=k.nextUid();return"<div wmRichTextEditor #"+n+'="wmRichTextEditor" role="textbox" [attr.aria-label]="'+n+".hint || 'Richtext editor'\" "+t.getFormMarkupAttr(e)+">"},post:function(){return"</div>"}}}));var M=Object.freeze({__proto__:null,default:function(){}});t.register("wm-search",(function(){return{pre:function(e){return"<div wmSearch "+t.getFormMarkupAttr(e)+" "+n.getNgModelAttr(e)+">"},post:function(){return"</div>"}}}));var L=Object.freeze({__proto__:null,default:function(){}});t.register("wm-tree",(function(){return{pre:function(e){return'<ul wmTree class="ztree" '+t.getAttrMarkup(e)+">"},post:function(){return"</ul>"}}}));var F=Object.freeze({__proto__:null});t.register("wm-card",(function(){return{pre:function(e){return"<div wmCard "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var j=Object.freeze({__proto__:null,default:function(){}});t.register("wm-card-content",(function(){return{pre:function(e){return"<div wmCardContent partialContainer "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var B=Object.freeze({__proto__:null,default:function(){}});t.register("wm-card-actions",(function(){return{pre:function(e){return"<div wmCardActions "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var G=Object.freeze({__proto__:null,default:function(){}});t.register("wm-card-footer",(function(){return{pre:function(e){return"<div wmCardFooter "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var V=Object.freeze({__proto__:null,default:function(){}});t.register("wm-chart",(function(){return{pre:function(e){return'<div wmChart redrawable aria-label="'+e.get("type")+' Chart" '+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var $=Object.freeze({__proto__:null,default:function(){}}),U=new n.IDGenerator("wm_accordion_ref_"),W=function(e){return e.attrs.find((function(e){return"type"===e.name&&"dynamic"===e.value}))},q=W;t.register("wm-accordion",(function(){return{pre:function(e,n){var i=U.nextUid();return n.set("accordion_ref",i),"<div wmAccordion #"+i+'="wmAccordion" role="tablist" aria-multiselectable="true" '+t.getAttrMarkup(e)+">"},post:function(){return"</div>"},template:function(e,i){if(W(e)){var o=e.attrs.find((function(e){return"dataset"===e.name})),r=e.attrs.find((function(e){return"name"===e.name}));if(!o)return;var a=t.getBoundToExpr(o.value);if(!a)return;n.updateTemplateAttrs(e,a,r.value)}},provide:function(e,t){var n=new Map;return n.set("accordion_ref",t.get("accordion_ref")),n}}}));var z=Object.freeze({__proto__:null,default:function(){},"\u02750":q}),H=new n.IDGenerator("wm_accordionpane");t.register("wm-accordionpane",(function(){return{pre:function(e){var n=H.nextUid();return"<div #"+n+'="wmAccordionPane" [attr.aria-expanded]="'+n+'.isActive" wmAccordionPane partialContainer wm-navigable-element="true" role="tab" '+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var Y=Object.freeze({__proto__:null,default:function(){}});t.register("wm-container",(function(){return{pre:function(e){return'<div wmContainer partialContainer wmSmoothscroll="'+(e.get("smoothscroll")||"false")+'" '+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var K=Object.freeze({__proto__:null,default:function(){}});t.register("wm-gridcolumn",(function(){return{pre:function(e){return"<div wmLayoutGridColumn "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var Q=Object.freeze({__proto__:null,default:function(){}});t.register("wm-gridrow",(function(){return{pre:function(e){return"<div wmLayoutGridRow "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var X=Object.freeze({__proto__:null,default:function(){}});t.register("wm-layoutgrid",(function(){return{pre:function(e){return"<div wmLayoutGrid "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var J=Object.freeze({__proto__:null,default:function(){}}),Z=new n.IDGenerator("wm_panel");t.register("wm-panel",(function(){return{pre:function(e){return"<div wmPanel #"+Z.nextUid()+'="wmPanel" partialContainer wm-navigable-element="true" '+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}})),t.register("wm-panel-footer",(function(){return{pre:function(e){return"<div wmPanelFooter "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var ee=Object.freeze({__proto__:null,default:function(){}});t.register("wm-segmented-control",(function(){return{pre:function(e){return"<div wmSegmentedControl "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var te=Object.freeze({__proto__:null,default:function(){}});t.register("wm-segment-content",(function(){return{pre:function(e){return"<li wmSegmentContent partialContainer wmSmoothscroll="+(e.get("smoothscroll")||"false")+' wm-navigable-element="true" '+t.getAttrMarkup(e)+">"},post:function(){return"</li>"}}}));var ne=Object.freeze({__proto__:null,default:function(){}}),ie=1;t.register("wm-repeat-template",(function(){return{requires:["wm-accordion","wm-tabs"],pre:function(e,n,i,o){var r=i&&i.get("accordion_ref")||o&&o.get("tabs_ref");if(r)return'<div *ngIf="'+r+".fieldDefs && !"+r+'.fieldDefs.length">{{'+r+".nodatamessage}}</div>\n <div wmRepeatTemplate "+t.getAttrMarkup(e)+' *ngFor="let item of '+r+'.fieldDefs; let i = index;">\n <ng-container [ngTemplateOutlet]="widgetRef'+ie+'" [ngTemplateOutletContext]="{item:item, index:i}"></ng-container>\n </div>\n <ng-template #widgetRef'+ie+++' let-item="item" let-index="index">'},post:function(){return"</ng-template>"}}}));var oe=Object.freeze({__proto__:null,default:function(){}}),re=new n.IDGenerator("wm_tabs_ref_"),ae=function(e){return e.attrs.find((function(e){return"type"===e.name&&"dynamic"===e.value}))},se=ae;t.register("wm-tabs",(function(){return{pre:function(e,n){var i=re.nextUid();return n.set("tabs_ref",i),"<div wmTabs #"+i+'="wmTabs" '+t.getAttrMarkup(e)+">"},post:function(){return"</div>"},template:function(e,i){if(ae(e)){var o=e.attrs.find((function(e){return"dataset"===e.name})),r=e.attrs.find((function(e){return"name"===e.name}));if(!o)return;var a=t.getBoundToExpr(o.value);if(!a)return;n.updateTemplateAttrs(e,a,r.value)}},provide:function(e,t){var n=new Map;return n.set("tabs_ref",t.get("tabs_ref")),n}}}));var le=Object.freeze({__proto__:null,default:function(){},"\u02750":se});t.register("wm-tabpane",(function(){return{pre:function(e){return"<div wmTabPane partialContainer "+t.getAttrMarkup(e)+' wm-navigable-element="true" role="tabpanel">'},post:function(){return"</div>"}}}));var ce=Object.freeze({__proto__:null,default:function(){}});t.register("wm-tile",(function(){return{pre:function(e){return'<div wmTile aria-describedby="Tile" wm-navigable-element="true" '+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var pe=Object.freeze({__proto__:null,default:function(){}});t.register("wm-wizard",(function(){return{pre:function(e){return'<div wmWizard role="tablist" '+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var ue=Object.freeze({__proto__:null,default:function(){}}),de=new n.IDGenerator("wizard_step_id_");t.register("wm-wizardstep",(function(){return{pre:function(e){var n=de.nextUid();return"<form wmWizardStep #"+n+'="wmWizardStep" '+t.getAttrMarkup(e)+'>\n <ng-template [ngIf]="'+n+'.isInitialized">'},post:function(){return"</ng-template></form>"}}}));var he=Object.freeze({__proto__:null,default:function(){}}),me=new n.IDGenerator("wm_barcodescanner");t.register("wm-barcodescanner",(function(){return{pre:function(e){var n=me.nextUid();return"<button wmBarcodescanner #"+n+'="wmBarcodescanner" [attr.aria-label]="'+n+".hint || 'Barcode scanner'\" "+t.getAttrMarkup(e)+">"},post:function(){return"</button>"}}}));var fe=Object.freeze({__proto__:null,default:function(){}}),ge=new n.IDGenerator("wm_camera");t.register("wm-camera",(function(){return{pre:function(e){var n=ge.nextUid();return"<button type='button' wmCamera #"+n+'="wmCamera" [attr.aria-label]="'+n+".hint || 'Camera'\" "+t.getAttrMarkup(e)+">"},post:function(){return"</button>"}}}));var ve=Object.freeze({__proto__:null,default:function(){}});t.register("wm-alertdialog",(function(){return{pre:function(e){return'<div wmAlertDialog role="alertdialog" wm-navigable-element="true" '+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var ye=Object.freeze({__proto__:null,default:function(){}});t.register("wm-confirmdialog",(function(){return{pre:function(e){return'<div wmConfirmDialog wm-navigable-element="true" '+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var be=Object.freeze({__proto__:null,default:function(){}});t.register("wm-dialogactions",(function(){return{pre:function(e){return'<ng-template #dialogFooter><div wmDialogFooter data-identfier="actions" '+t.getAttrMarkup(e)+">"},post:function(){return"</div></ng-template>"}}}));var we=Object.freeze({__proto__:null,default:function(){}});t.register("wm-dialog",(function(){return{pre:function(e){return"<div wmDialog "+t.getAttrMarkup(e)+' aria-modal="true" role="dialog" wm-navigable-element="true"><ng-template #dialogBody>'},post:function(){return"</ng-template></div>"}}})),t.register("wm-view",(function(){return{pre:function(e){return""},post:function(){return""}}}));var Pe=Object.freeze({__proto__:null,default:function(){}});t.register("wm-iframedialog",(function(){return{pre:function(e){return'<div wmIframeDialog wm-navigable-element="true" '+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var _e=Object.freeze({__proto__:null,default:function(){}});t.register("wm-logindialog",(function(){return{pre:function(e){return"<div wmDialog wmLoginDialog "+t.getAttrMarkup(e)+' eventsource.bind="Actions.loginAction" wm-navigable-element="true"><ng-template #dialogBody>'},post:function(){return"</ng-template></div>"}}}));var Oe=Object.freeze({__proto__:null,default:function(){}});t.register("wm-pagedialog",(function(){return{pre:function(e,n){var i=e.get("content");e.delete("content");var o=e.get("content.bind");e.delete("content.bind");var r=e.get("load.event");e.delete("load.event");var a="",s="";r&&(a='load.event="'+r+'"'),o?s='content.bind="'+o+'"':i&&(s='content="'+i+'"');var l="";return s&&(n.set("hasPartialContent",!0),l+="<ng-template><div wmContainer #partial partialContainer "+s+' width="100%" height="100%" '+a+">"),"<div wmPartialDialog "+t.getAttrMarkup(e)+">"+l},post:function(e,t){var n="";return t.get("hasPartialContent")&&(n="</div></ng-template>"),n+"</div>"}}}));var Se=Object.freeze({__proto__:null,default:function(){}}),Ee="quickedit",Te="form",Ce="dialog",Ae={integer:["number","text","select","checkboxset","radioset","rating","slider","currency","autocomplete","chips"],big_integer:["number","text","select","checkboxset","radioset","rating","slider","currency","autocomplete","chips"],short:["number","text","select","checkboxset","radioset","slider","currency","autocomplete","chips"],float:["number","text","select","checkboxset","radioset","slider","currency","autocomplete","chips"],big_decimal:["number","text","select","checkboxset","radioset","slider","currency","autocomplete","chips"],number:["number","text","select","checkboxset","radioset","slider","currency","autocomplete","chips"],double:["number","text","select","checkboxset","radioset","slider","currency","autocomplete","chips"],long:["number","text","select","checkboxset","radioset","rating","slider","currency","autocomplete","chips"],byte:["number","text","select","checkboxset","radioset","slider","currency","autocomplete","chips"],string:["text","number","textarea","password","richtext","select","checkboxset","radioset","date","time","timestamp","switch","currency","autocomplete","chips","colorpicker"],character:["text","number","textarea","password","richtext","select","checkboxset","radioset","switch","currency","autocomplete","chips"],text:["text","number","textarea","password","richtext","select","checkboxset","radioset","date","time","timestamp","switch","currency","autocomplete","chips","colorpicker"],date:["date","text","number","select","checkboxset","radioset","autocomplete","chips"],time:["time","text","number","select","checkboxset","radioset","autocomplete","chips"],timestamp:["timestamp","text","number","select","checkboxset","radioset","autocomplete","chips"],datetime:["datetime","text","select","checkboxset","radioset","autocomplete","chips"],boolean:["checkbox","radioset","toggle","select"],list:["select","radioset","checkboxset","switch","autocomplete","chips"],clob:["text","textarea","richtext"],blob:["upload"],file:["upload"],custom:["text","number","textarea","password","checkbox","toggle","slider","richtext","currency","switch","select","checkboxset","radioset","date","time","timestamp","rating","datetime","autocomplete","chips","colorpicker"]},Re=new Set([n.FormWidgetType.SELECT,n.FormWidgetType.CHECKBOXSET,n.FormWidgetType.RADIOSET,n.FormWidgetType.SWITCH,n.FormWidgetType.AUTOCOMPLETE,n.FormWidgetType.CHIPS,n.FormWidgetType.TYPEAHEAD,n.FormWidgetType.RATING]),Ie=function(e){var t=Ae[e]&&Ae[e][0];return e===n.DataType.BOOLEAN&&(t=n.FormWidgetType.SELECT),[n.FormWidgetType.TEXT,n.FormWidgetType.NUMBER,n.FormWidgetType.SELECT,n.FormWidgetType.AUTOCOMPLETE,n.FormWidgetType.DATE,n.FormWidgetType.TIME,n.FormWidgetType.DATETIME].includes(t)?t:n.FormWidgetType.TEXT},De=new n.IDGenerator("formfield_"),Ne=function(e){var n=new Map;return e.has("focus.event")||e.set("focus.event",""),e.has("blur.event")||e.set("blur.event",""),e.forEach((function(t,i){i.endsWith(".event")&&("focus.event"===i?t="_onFocusField($event);"+t:"blur.event"===i&&(t="_onBlurField($event);"+t),n.set(i,t),e.delete(i))})),t.getFormMarkupAttr(n)},xe=Ne,ke=new Map([[n.FormWidgetType.SELECT,["Select Min value","Select Max value","Select value"]],[n.FormWidgetType.DATETIME,["Select Min date time","Select Max date time","Select date time"]],[n.FormWidgetType.TIME,["Select Min time","Select Max time","Select time"]],[n.FormWidgetType.DATE,["Select Min date","Select Max date","Select date"]],[n.FormWidgetType.TEXTAREA,["","","Enter value"]],[n.FormWidgetType.RICHTEXT,["","","Enter value"]],[n.FormWidgetType.COLORPICKER,["Select Color","Select Color","Select Color"]],[n.FormWidgetType.CHIPS,["","","Type here..."]],[n.FormWidgetType.PASSWORD,["Enter Min value","Enter Max value","Enter value"]],[n.FormWidgetType.NUMBER,["Enter Min value","Enter Max value","Enter value"]],[n.FormWidgetType.TEXT,["Enter Min value","Enter Max value","Enter value"]],[n.FormWidgetType.CURRENCY,["Enter Min value","Enter Max value","Enter value"]],[n.FormWidgetType.AUTOCOMPLETE,["","","Search"]]]),Me=function(e,t,n){var i=1===n?"maxplaceholder":"placeholder",o=e.get(i);o||""===o||(o=ke.get(t)&&ke.get(t)[n])&&e.set(i,o)},Le=Me,Fe=function(e,t){var i=e.get("name"),o=(e.get("key")||i||"").trim(),r=t.isMaxWidget?'formControlName="'+o+'_max"':t.isInList?'[formControlName]="'+t.counter+'._fieldName"':'formControlName="'+o+'"',a=t.isMaxWidget?"#formWidgetMax":"#formWidget",s=i?t.isMaxWidget?'name="'+i+'_formWidgetMax"':'name="'+i+'_formWidget"':"",l='[ngClass]="'+e.get("ngclass")+'"',c='[class.hidden]="!'+t.pCounter+".isUpdateMode && "+t.counter+".viewmodewidget !== 'default'\" "+r+" "+t.eventsTmpl+" "+l+" "+a+" "+s;return n.getFormWidgetTemplate(t.widgetType,c,e,{counter:t.counter,pCounter:t.pCounter})},je=Fe,Be=function(e,t,i,o,r,a){if(!("true"===e.get("is-range")))return Fe(e,{widgetType:t,eventsTmpl:i,counter:o,pCounter:r,isInList:a});var s=n.isMobileApp()?"col-xs-6":"col-sm-6";return'<div class="'+s+'">'+Fe(e,{widgetType:t,eventsTmpl:i,counter:o,pCounter:r})+'</div>\n <div class="'+s+'">'+Fe(e,{widgetType:t,eventsTmpl:i,counter:o,pCounter:r,isMaxWidget:!0})+"</div>"},Ge=Be,Ve=function(e,t,i){if("true"===e.get("is-related"))return i+".getDisplayExpr()";if(t===n.FormWidgetType.PASSWORD)return"'********'";var o,r=i+".value";return t===n.FormWidgetType.DATETIME||t===n.FormWidgetType.TIMESTAMP?r+=" | toDate:"+i+".formWidget.datepattern || 'yyyy-MM-dd hh:mm:ss a'":t===n.FormWidgetType.TIME?r+=" | toDate:"+i+".formWidget.timepattern || 'hh:mm a'":t===n.FormWidgetType.DATE?r+=" | toDate:"+i+".formWidget.datepattern || 'yyyy-MMM-dd'":t===n.FormWidgetType.RATING||t===n.FormWidgetType.UPLOAD?"":(o=t,Re.has(o)&&"All Fields"===e.get("datafield")?i+".getDisplayExpr()":i+".getCaption()")},$e=Ve,Ue=function(e){return{requires:["wm-form","wm-liveform","wm-livefilter","wm-list"],pre:function(i,o,r,a,s,l){var c=De.nextUid(),p=r||a||s,u=p&&p.get("form_reference")||"form",d=i.get("widget")||n.FormWidgetType.TEXT,h=e?"form-field":"filter-field",m="wmform-field-error-"+n.generateGUId(),f=e?'<p *ngIf="'+c+"._control?.invalid && "+c+"._control?.touched && "+u+'.isUpdateMode"\n class="help-block text-danger" aria-hidden="false" role="alert"\n aria-live="assertive" [attr.aria-label]="'+c+'.validationmessage" id="'+m+'"><span aria-hidden="true" [textContent]="'+c+'.validationmessage"></span></p>':"",g=d===n.FormWidgetType.UPLOAD?"":Ne(i),v=n.isMobileApp()?"col-xs-12":"col-sm-12",y=u===(l&&l.get("parent_form_reference"));return i.set("__validationId",m),i.set("__widgetType",d),i.delete("widget"),o.set("counter",c),"true"===i.get("is-range")?(Me(i,d,0),Me(i,d,1)):Me(i,d,2),'<div data-role="'+h+'" [formGroup]="'+u+'.ngform" wmFormField captionPosition #'+c+'="wmFormField" widgettype="'+d+'" '+t.getFormMarkupAttr(i)+'>\n <div class="live-field form-group app-composite-widget clearfix caption-{{'+u+'.captionposition}}" widget="'+d+'">\n <label [hidden]="!'+c+'.displayname" class="app-label control-label formfield-label {{'+u+'._captionClass}}"\n [ngStyle]="{width: '+u+".captionsize}\" [ngClass]=\"{'text-danger': "+c+"._control?.invalid && "+c+"._control?.touched && "+u+".isUpdateMode,\n required: "+u+".isUpdateMode && "+c+'.required}" [textContent]="'+c+'.displayname"> </label>\n <div [ngClass]="'+c+".displayname ? "+u+"._widgetClass : '"+v+'\'">\n <label class="form-control-static app-label"\n [hidden]="'+u+".isUpdateMode || "+c+".viewmodewidget === 'default' || "+c+".widgettype === 'upload'\" [innerHTML]=\""+Ve(i,d,c)+'"></label>\n '+Be(i,d,g,c,u,y)+'\n <span aria-hidden="true" *ngIf="'+c+'.showPendingSpinner" class="form-field-spinner fa fa-circle-o-notch fa-spin form-control-feedback"></span>\n <p *ngIf="!('+c+"._control?.invalid && "+c+"._control?.touched) && "+u+'.isUpdateMode"\n class="help-block" aria-hidden="true" role="alert" aria-live="polite" [textContent]="'+c+'.hint"></p>\n '+f+"\n </div>\n </div>"},post:function(){return"</div>"},provide:function(e,t){var n=new Map;return n.set("form_reference",t.get("counter")),n},imports:function(e){var t=n.getRequiredFormWidget(e.get("__widgetType")||e.get("type"));return e.delete("__widgetType"),[t,"wm-form"]}}},We=Ue;t.register("wm-form-field",Ue.bind(this,!0)),t.register("wm-filter-field",Ue.bind(this,!1));var qe=Object.freeze({__proto__:null,default:function(){},"\u02750":xe,"\u02751":Le,"\u02752":je,"\u02753":Ge,"\u02754":$e,"\u02755":We}),ze=function(e){return{pre:function(n){return'<div wmFormAction name="'+(n.get("name")||n.get("key"))+'" '+t.getAttrMarkup(n)+" "+e+">"},post:function(){return"</div>"}}},He=ze;t.register("wm-form-action",ze.bind(this,"")),t.register("wm-filter-action",ze.bind(this,' update-mode="true" '));var Ye,Ke=Object.freeze({__proto__:null,default:function(){},"\u02750":He}),Qe=new n.IDGenerator("form_"),Xe=new Set(["wm-text","wm-textarea","wm-checkbox","wm-slider","wm-richtexteditor","wm-currency","wm-switch","wm-select","wm-checkboxset","wm-radioset","wm-date","wm-time","wm-timestamp","wm-upload","wm-rating","wm-datetime","wm-search","wm-chips","wm-colorpicker","wm-table"]),Je=function(e){void 0===e&&(e=[]),e.forEach((function(e){if("wm-form-field"===e.name&&Ye++,Xe.has(e.name)){var t=e.attrs.find((function(e){return"key"===e.name||"name"===e.name}));if(!(t=t&&t.value)){var n=e.attrs.find((function(e){return"datavalue"===e.name}));if(n&&n.value){(n=n.value.match(/\((.*)\)/))&&n.length>1&&(t=n[1].replace(/["']/g,""))}}e.attrs.push(new i.Attribute("formControlName",t,1,1,1,void 0,void 0)),e.attrs.push(new i.Attribute("wmFormWidget","",1,1,1,void 0,void 0))}Je(e.children)}))},Ze=Je,et=function(e){if(e.get("formdata.bind")){var n=t.getDataSource(e.get("formdata.bind"));n&&e.set("formdatasource.bind",n)}},tt=et,nt=function(e){return void 0===e&&(e=""),{requires:["wm-livetable","wm-login"],template:function(e){Ye=0,Je(e.children)},pre:function(n,i,o,r){var a,s,l=r&&r.get("isLogin")?"app-login":"",c=Qe.nextUid(),p=n.get("dependson")?'dependson="'+n.get("dependson")+'"':"",u="page"===n.get("formlayout")?"app-device-liveform panel liveform-inline":"";n.delete("dependson");var d='<form wmForm data-role="'+l+'" '+e+" #"+c+' ngNativeValidate [formGroup]="'+c+'.ngform" [noValidate]="'+c+".validationtype !== 'html'\"\n class=\""+u+'" [class]="'+c+'.captionAlignClass" [autocomplete]="'+c+".autocomplete ? 'on' : 'off'\" captionposition="+n.get("captionposition");if(n.set("numberOfFields",""+Ye),i.set("counter",c),et(n),"dialog"===n.get("formlayout")){s=o?o.get("liveform_dialog_id"):"liveform_dialog_id_"+c,n.set("dialogId",s);var h=new Map;return["title","title.bind","iconclass","iconclass.bind","width"].forEach((function(e){n.get(e)&&h.set(e,n.get(e))})),n.set("width","100%"),a=t.getAttrMarkup(n),'<div data-identifier="liveform" init-widget class="app-liveform liveform-dialog" '+p+' dialogid="'+s+'">\n <div wmDialog class="app-liveform-dialog" name="'+s+'" role="form" '+t.getAttrMarkup(h)+' modal="true">\n <ng-template #dialogBody>\n '+d+" "+a+">"}var m="",f="";if("page"===n.get("formlayout")){var g="device_liveform_header_"+c,v=new Map;v.set("title",n.get("title")),v.set("backbtnclick.event",n.get("backbtnclick.event")),f='<ng-template #buttonRef let-btn="btn">\n <button wmButton name="{{btn.key}}" class="navbar-btn btn-primary btn-transparent" iconclass.bind="btn.iconclass" show.bind="btn.show"\n (click)="'+c+'.invokeActionEvent($event, btn.action)" type.bind="btn.type" hint.bind="btn.title" shortcutkey.bind="btn.shortcutkey" disabled.bind="btn.disabled"\n tabindex.bind="btn.tabindex" [class.hidden]="btn.updateMode ? !'+c+".isUpdateMode : "+c+'.isUpdateMode"></button>\n </ng-template>',m='<header wmMobileNavbar name="'+g+'" '+t.getAttrMarkup(v)+'>\n <ng-container *ngFor="let btn of '+c+'.buttonArray" [ngTemplateOutlet]="buttonRef" [ngTemplateOutletContext]="{btn:btn}">\n </ng-container>\n </header>\n <div class="form-elements panel-body" >'}return d+" "+(a=t.getAttrMarkup(n))+" "+p+">\n "+f+" "+m},post:function(e){return"dialog"===e.get("formlayout")?"</form></ng-template></div></div>":"page"===e.get("formlayout")?"</div></form>":"</form>"},provide:function(e,t){var n=new Map;return n.set("form_reference",t.get("counter")),n}}},it=nt;t.register("wm-form",nt),t.register("wm-liveform",(function(){return nt("wmLiveForm")})),t.register("wm-livefilter",(function(){return nt("wmLiveFilter")}));var ot=Object.freeze({__proto__:null,default:function(){},"\u02750":Ze,"\u02751":tt,"\u02752":it});t.register("wm-calendar",(function(){return{pre:function(e){return'<div wmCalendar redrawable style="width:100%" aria-label="'+(e.get("view")?e.get("view")+" view":"month view")+'" '+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var rt=Object.freeze({__proto__:null,default:function(){}});t.register("wm-chips",(function(){return{pre:function(e){return'<ul wmChips role="listbox" '+t.getAttrMarkup(e)+" "+n.getNgModelAttr(e)+">"},post:function(){return"</ul>"}}}));var at=Object.freeze({__proto__:null,default:function(){}});t.register("wm-colorpicker",(function(){return{pre:function(e){return"<div wmColorPicker "+t.getAttrMarkup(e)+' role="input" '+t.getChildAttrs(e)+" "+n.getNgModelAttr(e)+">"},post:function(){return"</div>"}}}));var st=Object.freeze({__proto__:null,default:function(){}});t.register("wm-currency",(function(){return{pre:function(e){return"<div wmCurrency "+t.getAttrMarkup(e)+' role="input" '+t.getChildAttrs(e)+" "+n.getNgModelAttr(e)+">"},post:function(){return"</div>"}}}));var lt=Object.freeze({__proto__:null,default:function(){}});t.register("wm-buttongroup",(function(){return{pre:function(e){return'<div wmButtonGroup role="group" aria-labelledby="button group" '+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var ct=Object.freeze({__proto__:null,default:function(){}}),pt=new n.IDGenerator("wm_button");t.register("wm-button",(function(){return{pre:function(e){var n=pt.nextUid();return"<button wmButton #"+n+'="wmButton" [attr.aria-label]="'+n+".hint || "+n+'.caption" '+t.getAttrMarkup(e)+">"},post:function(){return"</button>"}}}));var ut=Object.freeze({__proto__:null,default:function(){}});t.register("wm-checkbox",(function(){return{pre:function(e){return"<div wmCheckbox "+t.getFormMarkupAttr(e)+" "+t.getChildAttrs(e)+" "+n.getNgModelAttr(e)+">"},post:function(){return"</div>"}}}));var dt=Object.freeze({__proto__:null,default:function(){}});t.register("wm-checkboxset",(function(){return{pre:function(e){return'<ul role="group" wmCheckboxset '+t.getFormMarkupAttr(e)+" "+t.getChildAttrs(e)+" "+n.getNgModelAttr(e)+">"},post:function(){return"</ul>"}}}));var ht=Object.freeze({__proto__:null,default:function(){}});t.register("wm-composite",(function(){return{pre:function(e){return"<div wmComposite captionPosition "+t.setChildAttrs(e)+" "+t.getAttrMarkup(e)+">"},post:function(){return"</div"+t.clearChildAttrs()+">"}}}));var mt=Object.freeze({__proto__:null,default:function(){}});t.register("wm-number",(function(){return{pre:function(e){return"<div wmNumber "+t.getFormMarkupAttr(e)+" "+t.getChildAttrs(e)+" "+n.getNgModelAttr(e)+">"},post:function(){return"</div>"}}}));var ft=Object.freeze({__proto__:null,default:function(){}});t.register("wm-radioset",(function(){return{pre:function(e){return'<ul role="radiogroup" wmRadioset '+t.getFormMarkupAttr(e)+" "+t.getChildAttrs(e)+" "+n.getNgModelAttr(e)+">"},post:function(){return"</ul>"}}}));var gt=Object.freeze({__proto__:null,default:function(){}});t.register("wm-select",(function(){return{pre:function(e){return"<wm-select "+t.getFormMarkupAttr(e)+" "+t.getChildAttrs(e)+" "+n.getNgModelAttr(e)+">"},post:function(){return"</wm-select>"}}}));var vt=Object.freeze({__proto__:null,default:function(){}}),yt=new n.IDGenerator("wm_switch");t.register("wm-switch",(function(){return{pre:function(e){var i=yt.nextUid();return"<div wmSwitch #"+i+'="wmSwitch" [attr.aria-label]="'+i+".hint || 'Switch button'\" "+t.getFormMarkupAttr(e)+" "+n.getNgModelAttr(e)+">"},post:function(){return"</div>"}}}));var bt=Object.freeze({__proto__:null,default:function(){}});t.register("wm-text",(function(){return{pre:function(e){return"<wm-input "+t.getFormMarkupAttr(e)+" "+t.getChildAttrs(e)+" "+n.getNgModelAttr(e)+">"},post:function(){return"</wm-input>"}}}));var wt=Object.freeze({__proto__:null,default:function(){}});t.register("wm-textarea",(function(){return{pre:function(e){return"<wm-textarea "+t.getFormMarkupAttr(e)+" "+t.getChildAttrs(e)+" "+n.getNgModelAttr(e)+">"},post:function(){return"</wm-textarea>"}}}));var Pt=Object.freeze({__proto__:null,default:function(){}});t.register("wm-datetime",(function(){return{pre:function(e){return"<div wmDateTime "+t.getFormMarkupAttr(e)+" "+t.getChildAttrs(e)+" "+n.getNgModelAttr(e)+">"},post:function(){return"</div>"}}}));var _t=Object.freeze({__proto__:null,default:function(){}});t.register("wm-date",(function(){return{pre:function(e){return"<div wmDate "+t.getFormMarkupAttr(e)+" "+t.getChildAttrs(e)+" "+n.getNgModelAttr(e)+">"},post:function(){return"</div>"}}}));var Ot=Object.freeze({__proto__:null,default:function(){}});t.register("wm-time",(function(){return{pre:function(e){return"<div wmTime "+t.getFormMarkupAttr(e)+" "+t.getChildAttrs(e)+" "+n.getNgModelAttr(e)+">"},post:function(){return"</div>"}}}));var St=Object.freeze({__proto__:null,default:function(){}});t.register("wm-fileupload",(function(){return{pre:function(e){if(e.get("select.event")){var n=t.getDataSource(e.get("select.event"));e.set("datasource.bind",n)}return"<div wmFileUpload "+t.getAttrMarkup(e)+' role="input">'},post:function(){return"</div>"}}}));var Et=Object.freeze({__proto__:null,default:function(){}});t.register("wm-rating",(function(){return{pre:function(e){return"<div wmRating "+t.getFormMarkupAttr(e)+" "+n.getNgModelAttr(e)+">"},post:function(){return"</div>"}}}));var Tt=Object.freeze({__proto__:null,default:function(){}});t.register("wm-slider",(function(){return{pre:function(e){return"<div wmSlider "+t.getAttrMarkup(e)+" "+n.getNgModelAttr(e)+">"},post:function(){return"</div>"}}}));var Ct=Object.freeze({__proto__:null,default:function(){}});function At(e,t,n,o){var r=e.attrs.find((function(e){return e.name===t}));r&&n.attrs.push(new i.Attribute(o,r.value,r.sourceSpan,r.keySpan,r.valueSpan,void 0,void 0))}t.register("wm-media-list",(function(){return{template:function(e){var t,n=e.attrs.find((function(e){return"dataset"===e.name})),o=function(e){void 0===e&&(e=[]),e.forEach((function(e){e.name&&"wm-list"!==e.name&&(e.attrs.forEach((function(e){e.value.startsWith("bind:"+t+".data[$i]")?e.value=e.value.replace(t+".data[$i]","item"):e.value.startsWith("bind:"+t)&&(e.value=e.value.replace(t,"item"))})),o(e.children))}))};n&&n.value.startsWith("bind:")&&(t=n.value.replace("bind:","")),t&&o(e.children);var r=e.children.find((function(e){return e instanceof i.Element&&"wm-media-template"===e.name}));null!=r&&(At(r,"width",e,"thumbnailwidth"),At(r,"height",e,"thumbnailheight"))},pre:function(e){return"<div wmMediaList "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var Rt=Object.freeze({__proto__:null,default:function(){}});t.register("wm-media-template",(function(){return{pre:function(){return'<ng-template #mediaListTemplate let-item="item" let-index="index">'},post:function(){return"</ng-template>"}}}));var It=Object.freeze({__proto__:null,default:function(){}});t.register("wm-list",(function(){return{requires:["wm-form","wm-liveform"],template:function(e){var i=e.attrs.find((function(e){return"dataset"===e.name})),o=e.attrs.find((function(e){return"name"===e.name}));if(i){var r=t.getBoundToExpr(i.value);r&&n.updateTemplateAttrs(e,r,o.value,"itemRef.")}},pre:function(e,n,i,o){var r=i||o;return n.set("form_reference",r&&r.get("form_reference")),"<div wmList wmLiveActions "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"},provide:function(e,t){var n=new Map;return n.set("parent_form_reference",t.get("form_reference")),n}}})),t.register("wm-listtemplate",(function(){return{pre:function(){return'<ng-template #listTemplate let-item="item" let-$index="$index" let-itemRef="itemRef" let-$first="$first" let-$last="$last" let-currentItemWidgets="currentItemWidgets" >'},post:function(){return"</ng-template>"}}})),t.register("wm-list-action-template",(function(){return{template:function(e){e.attrs.find((function(e){return"position"===e.name})).value;e.children.filter((function(e){return e instanceof i.Element&&"wm-button"===e.name})).forEach((function(t){var n,o,r,a;n="position",o=t,r="swipe-position",(a=e.attrs.find((function(e){return e.name===n})))&&o.attrs.push(new i.Attribute(r,a.value,a.sourceSpan,a.keySpan,a.valueSpan,void 0,void 0))}))},pre:function(e,n){return"left"===e.get("position")?'<ng-template #listLeftActionTemplate>\n <li class="app-list-item-action-panel app-list-item-left-action-panel actionMenu" '+t.getAttrMarkup(e)+">":"right"===e.get("position")?'<ng-template #listRightActionTemplate>\n <li class="app-list-item-action-panel app-list-item-right-action-panel actionMenu" '+t.getAttrMarkup(e)+">":void 0},post:function(){return"</li></ng-template>"}}}));var Dt=Object.freeze({__proto__:null,default:function(){}}),Nt=new n.IDGenerator("liveform_dialog_id_");t.register("wm-livetable",(function(){return{pre:function(e,n){var i=Nt.nextUid();return n.set("counter",i),"<div wmLiveTable "+t.getAttrMarkup(e)+' dialogid="'+i+'">'},post:function(){return"</div>"},provide:function(e,t){var n=new Map;return n.set("liveform_dialog_id",t.get("counter")),n}}}));var xt=Object.freeze({__proto__:null,default:function(){}}),kt=new n.IDGenerator("wm_message");t.register("wm-message",(function(){return{pre:function(e){return'<p wmMessage tabindex="0" #'+kt.nextUid()+'="wmMessage" '+t.getAttrMarkup(e)+">"},post:function(){return"</p>"}}}));var Mt=Object.freeze({__proto__:null,default:function(){}});t.register("wm-breadcrumb",(function(){return{pre:function(e){return"<ol wmBreadcrumb "+t.getAttrMarkup(e)+">"},post:function(){return"</ol>"}}}));var Lt=Object.freeze({__proto__:null,default:function(){}});t.register("wm-menu",(function(){return{pre:function(e){return"<div wmMenu dropdown "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var Ft=Object.freeze({__proto__:null,default:function(){}});t.register("wm-nav-item",(function(){return{pre:function(e){return'<li wmNavItem role="listitem" '+t.getAttrMarkup(e)+">"},post:function(){return"</li>"}}}));var jt=Object.freeze({__proto__:null,default:function(){}});t.register("wm-nav",(function(){return{pre:function(e){return'<ul wmNav data-element-type="wmNav" data-role="page-header" role="list" '+t.getAttrMarkup(e)+">"},post:function(){return"</ul>"}}}));var Bt=Object.freeze({__proto__:null,default:function(){}});t.register("wm-navbar",(function(){return{pre:function(e){return'<nav wmNavbar data-element-type="wmNavbar" role="navigation" '+t.getAttrMarkup(e)+">"},post:function(){return"</nav>"}}}));var Gt=Object.freeze({__proto__:null,default:function(){}});t.register("wm-popover",(function(){return{requires:["wm-table"],pre:function(e,n,i){var o;if("inline"!==e.get("contentsource")){var r=e.get("content"),a=e.get("content.bind"),s="";r?s='content="'+r+'"':a&&(s='content.bind="'+a+'"'),o="<div wmContainer #partial partialContainer "+s+">",n.set("hasPopoverContent",!0)}var l="<wm-popover wmPopover "+t.getAttrMarkup(e)+">";return l+="<ng-template "+(i?'let-row="row"':"")+'><div tabindex="0" class="popover-start sr-only" aria-label="">popover content start</div>',o&&(l+=""+(o||"")),l},post:function(e,t){var n="";return t.get("hasPopoverContent")&&(n+="</div>"),n+'<div tabindex="0" class="popover-end sr-only" aria-label="">popover content ended</div></ng-template></'+"wm-popover>"}}}));var Vt=Object.freeze({__proto__:null,default:function(){}}),$t=function(e,t){return e&&e.children.find((function(e){return e instanceof i.Element&&e.name===t}))},Ut=$t,Wt=function(e){return new i.Element(e,[],[],Qt,Qt,Qt)},qt=Wt,zt=function(e,t,n){var o=new i.Attribute(t,n,Qt,Qt,Qt,void 0,void 0);e.attrs.push(o)},Ht=zt,Yt=function(e,t){var n;if(t)return _.forEach(t.children,(function(t){return t instanceof i.Element&&(t.name===e?n=t:t.children&&(n=Yt(e,t))),!n})),n},Kt=Yt,Qt={},Xt=new n.IDGenerator("wm_page");t.register("wm-page",(function(){return{template:function(e){var t=$t($t(e,"wm-content"),"wm-page-content");if(t||(t=Yt("wm-page-content",Yt("wm-content",e))),t){var o=Wt("ng-container");if(zt(o,"*ngIf","compilePageContent"),o.children=o.children.concat(t.children),o.children.push(new i.Text("{{onPageContentReady()}}",null,void 0,void 0)),t.children=[o],n.isMobileApp()){var r=Wt("div");zt(r,"wmPageContentLoader",""),zt(r,"*ngIf","!showPageContent"),t.children.push(r)}}},pre:function(e){var n=Xt.nextUid();return"<div wmPage #"+n+'="wmPage" data-role="pageContainer" [attr.aria-label]="'+n+'.hint" '+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var Jt=Object.freeze({__proto__:null,default:function(){},"\u02750":Ut,"\u02751":qt,"\u02752":Ht,"\u02753":Kt}),Zt=new n.IDGenerator("wm_layout");t.register("wm-layout",(function(){return{pre:function(e){var n=Zt.nextUid();return"<div wmLayout #"+n+'="wmLayout" data-role="pageContainer" [attr.aria-label]="'+n+".hint || 'Main page content'\" "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var en=Object.freeze({__proto__:null,default:function(){}}),tn="router-outlet";t.register("wm-router-outlet",(function(){return{pre:function(e){return'<div wmRouterOutlet name="wmRouterOutlet" '+t.getAttrMarkup(e)+"><"+tn+' (activate)="onActivate($event)">'},post:function(){return"</router-outlet></div>"}}}));var nn=Object.freeze({__proto__:null,default:function(){}});t.register("wm-pagination",(function(){return{pre:function(e){return'<nav wmPagination data-identifier="pagination" aria-label="Page navigation" '+t.getAttrMarkup(e)+">"},post:function(){return"</nav>"}}}));var on=Object.freeze({__proto__:null,default:function(){}});t.register("wm-content",(function(){return{pre:function(e){return'<main wmContent data-role="page-content" role="main" '+t.getAttrMarkup(e)+">"},post:function(){return"</main>"}}}));var rn=Object.freeze({__proto__:null,default:function(){}}),an=new n.IDGenerator("wm_footer");t.register("wm-footer",(function(){return{pre:function(e){var n=an.nextUid();return"<footer wmFooter #"+n+'="wmFooter" partialContainer data-role="page-footer" role="contentinfo" [attr.aria-label]="'+n+".hint || 'Page footer'\" "+t.getAttrMarkup(e)+">"},post:function(){return"</footer>"}}}));var sn=Object.freeze({__proto__:null,default:function(){}}),ln=new n.IDGenerator("wm_header");t.register("wm-header",(function(){return{pre:function(e){var n=ln.nextUid();return"<header wmHeader #"+n+'="wmHeader" partialContainer data-role="page-header" role="banner" [attr.aria-label]="'+n+".hint || 'Page header'\" "+t.getAttrMarkup(e)+">"},post:function(){return"</header>"}}}));var cn=Object.freeze({__proto__:null,default:function(){}}),pn=new n.IDGenerator("wm_left_panel");t.register("wm-left-panel",(function(){return{pre:function(e){var n=pn.nextUid();return"<aside wmLeftPanel #"+n+'="wmLeftPanel" partialContainer data-role="page-left-panel" [attr.aria-label]="'+n+".hint || 'Left navigation panel'\" wmSmoothscroll=\""+(e.get("smoothscroll")||"false")+'" '+t.getAttrMarkup(e)+">"},post:function(){return"</aside>"}}}));var un=Object.freeze({__proto__:null,default:function(){}});t.register("wm-mobile-navbar",(function(){return{pre:function(e){return"<header wmMobileNavbar "+t.getAttrMarkup(e)+">"},post:function(){return"</header>"}}}));var dn=Object.freeze({__proto__:null,default:function(){}}),hn=new n.IDGenerator("wm_right_panel");t.register("wm-right-panel",(function(){return{pre:function(e){var n=hn.nextUid();return"<aside wmRightPanel #"+n+'="wmRightPanel" partialContainer data-role="page-right-panel" role="complementary" [attr.aria-label]="'+n+".hint || 'Right navigation panel'\" "+t.getAttrMarkup(e)+">"},post:function(){return"</aside>"}}}));var mn=Object.freeze({__proto__:null,default:function(){}});Object.create;function fn(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.")}Object.create;var gn=function(e){return new i.Element(e,[],[],wn,wn,wn)},vn=gn,yn=function(e,t,n){var o=new i.Attribute(t,n,wn,wn,wn,void 0,void 0);e.attrs.push(o)},bn=yn,wn={};t.register("wm-page-content",(function(){return{template:function(e){var t,n;try{for(var o=fn(e.attrs),r=o.next();!r.done;r=o.next()){var a=r.value;if("spa"===a.name&&"true"===a.value){var s=gn("ng-container");yn(s,"*ngIf","compilePageContent"),s.children=s.children.concat(e.children),s.children.push(new i.Text("{{onPageContentReady()}}",null,void 0,void 0)),e.children=[s];break}}}catch(e){t={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}},pre:function(e){return"<div wmPageContent "+(e.get("spa")?"wmSpaPage":"")+' wmSmoothscroll="'+(e.get("smoothscroll")||"false")+'" '+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var Pn=Object.freeze({__proto__:null,default:function(){},"\u02750":vn,"\u02751":bn});t.register("wm-mobile-tabbar",(function(){return{pre:function(e){return"<div wmMobileTabbar "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var _n=Object.freeze({__proto__:null,default:function(){}}),On=new n.IDGenerator("wm_top_nav");t.register("wm-top-nav",(function(){return{pre:function(e){var n=On.nextUid();return"<section wmTopNav #"+n+'="wmTopNav" partialContainer data-role="page-topnav" role="navigation" [attr.aria-label]="'+n+".hint || 'Second level navigation'\" "+t.getAttrMarkup(e)+">"},post:function(){return"</section>"}}}));var Sn=Object.freeze({__proto__:null,default:function(){}}),En={},Tn=function(e){return new i.Element(e,[],[],En,En,En)},Cn=Tn,An=function(e,t,n){var o=new i.Attribute(t,n,En,En,En,void 0,void 0);e.attrs.push(o)},Rn=An;t.register("wm-partial",(function(){return{template:function(e){var t=Tn("ng-container");An(t,"*ngIf","compileContent"),t.children=t.children.concat(e.children),e.children.length=0,e.children.push(t)},pre:function(e){return'<section wmPartial data-role="partial" '+t.getAttrMarkup(e)+">"},post:function(){return"</section>"}}}));var In=Object.freeze({__proto__:null,default:function(){},"\u02750":Cn,"\u02751":Rn});t.register("wm-param",(function(){return{pre:function(e){return"<div wmParam hidden "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var Dn=Object.freeze({__proto__:null,default:function(){}});t.register("wm-prefab",(function(){return{pre:function(e){return'<section wmPrefab redrawable data-role="perfab" '+t.getAttrMarkup(e)+">"},post:function(){return"</section>"}}}));var Nn=Object.freeze({__proto__:null,default:function(){}}),xn={},kn=function(e){return new i.Element(e,[],[],xn,xn,xn)},Mn=kn,Ln=function(e,t,n){var o=new i.Attribute(t,n,xn,xn,xn,void 0,void 0);e.attrs.push(o)},Fn=Ln;t.register("wm-prefab-container",(function(){return{template:function(e){var t=kn("ng-container");Ln(t,"*ngIf","compileContent"),t.children=t.children.concat(e.children),e.children.length=0,e.children.push(t)},pre:function(e){return"<div wmPrefabContainer "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var jn=Object.freeze({__proto__:null,default:function(){},"\u02750":Mn,"\u02751":Fn});t.register("wm-table-action",(function(){return{pre:function(e){return'<div name="'+(e.get("name")||e.get("key"))+'" wmTableAction '+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var Bn=Object.freeze({__proto__:null,default:function(){}});t.register("wm-table-column-group",(function(){return{pre:function(e){return"<div wmTableColumnGroup "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var Gn=Object.freeze({__proto__:null,default:function(){}}),Vn=new n.IDGenerator("data_table_form_"),$n=new Set(["wm-text","wm-textarea","wm-checkbox","wm-slider","wm-currency","wm-switch","wm-select","wm-checkboxset","wm-radioset","wm-date","wm-time","wm-timestamp","wm-rating","wm-datetime","wm-search","wm-chips","wm-colorpicker"]),Un=function(e){void 0===e&&(e=[]);e.forEach((function(e){if($n.has(e.name)){if("wm-checkbox"===e.name&&e.attrs.filter((function(e){return"formControlName"===e.name})).length)return;e.attrs.push(new i.Attribute("[ngModelOptions]","{standalone: true}",1,1,1,void 0,void 0))}Un(e.children)}))},Wn=Un,qn=function(e,i){var o,r,a=e.get("filterwidget")||Ie(e.get("type")||n.DataType.STRING),s=e.get("binding"),l=e.get("type")||"string",c=e.get("filterdataset.bind");if("autocomplete"===e.get("filterwidget")){if(c)o='dataset.bind="'+c+'" datasource.bind="'+t.getDataSource(c)+'"';r="submit.event=\"changeFn('"+s+"')\""}var p='#filterWidget formControlName="'+s+'_filter" '+o+" "+r+" change.event=\"changeFn('"+s+"')\"\n disabled.bind=\"isDisabled('"+s+"')\"";return'<ng-template #filterTmpl let-changeFn="changeFn" let-isDisabled="isDisabled">\n <div class="input-group '+a+'" data-col-identifier="'+s+'">\n '+(""+n.getFormWidgetTemplate(a,p,e,{inputType:"filterinputtype"}))+'\n <span class="input-group-addon filter-clear-icon" *ngIf="'+i+".showClearIcon('"+s+'\')">\n <button class="btn-transparent btn app-button" aria-label="Clear button" type="button" (click)="'+i+".clearRowFilter('"+s+'\')">\n <i class="app-icon wi wi-clear" aria-hidden="true"></i>\n </button>\n </span>\n <span class="input-group-addon" dropdown container="body" (onShown)="'+i+".adjustContainer('"+s+'\');">\n <button class="btn-transparent btn app-button" type="button" dropdownToggle><i class="app-icon wi wi-filter-list"></i></button>\n <ul class="matchmode-dropdown dropdown-menu" *dropdownMenu>\n <li *ngFor="let matchMode of '+i+".matchModeTypesMap['"+l+'\']"\n [ngClass]="{active: matchMode === ('+i+".rowFilter['"+s+"'].matchMode || "+i+".matchModeTypesMap['"+l+'\'][0])}">\n <a href="javascript:void(0);" (click)="'+i+".onFilterConditionSelect('"+s+'\', matchMode)" [innerText]="'+i+'.matchModeMsgs[matchMode]"></a>\n </li>\n </ul>\n </span>\n </div></ng-template>'},zn=qn,Hn=function(e){var t="";return e.forEach((function(e,n){n.endsWith(".event")&&(t+=n+'="'+e+'" ')})),t},Yn=Hn,Kn=function(e){var n=new Map;return["disabled","disabled.bind"].forEach((function(t){e.get(t)&&(n.set(t,e.get(t)),e.delete(t))})),t.getAttrMarkup(n)},Qn=Kn,Xn=function(e,t,i,o){var r,a={},s=e.get("binding"),l=e.get("edit-widget-type")||((r={type:e.get("type"),"related-entity-name":e.get("related-entity-name"),"primary-key":e.get("primary-key")})["related-entity-name"]&&r["primary-key"]?n.FormWidgetType.SELECT:Ae[r.type]&&Ae[r.type][0]||n.FormWidgetType.TEXT),c="",p="",u="";l===n.FormWidgetType.UPLOAD?(a.uploadProps={formName:Vn.nextUid(),name:s},a.counter=o):(c=t?"#inlineWidgetNew":"#inlineWidget",p=t?'formControlName="'+s+'_new"':'formControlName="'+s+'"',u="wmFormWidget"),a.inputType="editinputtype";var d=t?"#inlineWidgetTmplNew":"#inlineWidgetTmpl",h=c+" "+u+' key="'+s+'" data-field-name="'+s+'" '+p+" "+(l===n.FormWidgetType.UPLOAD?"":Hn(e))+" "+Kn(e),m=t?"getPendingSpinnerStatusNew":"getPendingSpinnerStatus";return"<ng-template "+d+' let-row="row" let-getControl="getControl" let-getValidationMessage="getValidationMessage" let-'+m+'="'+m+'">\n <div data-col-identifier="'+s+'" >\n '+n.getFormWidgetTemplate(l,h,e,a)+"\n "+Zn(i)+'\n <div class="overlay" *ngIf="'+m+'()"><span aria-hidden="true" class="form-field-spinner fa fa-circle-o-notch fa-spin form-control-feedback"></span></div>\n <span class="sr-only" *ngIf="getValidationMessage()">{{getValidationMessage()}}</span>\n </div>\n </ng-template>'},Jn=Xn,Zn=function(e){var t="";switch(e){case"bottom":t='<span class="help-block text-danger" *ngIf="getValidationMessage() && getControl() && getControl().invalid && getControl().touched">{{getValidationMessage()}}</span>';break;case"hover":default:t='<span placement="top" container="body" tooltip="{{getValidationMessage()}}" class="text-danger wi wi-error"\n *ngIf="getValidationMessage() && getControl() && getControl().invalid && getControl().touched">\n </span>'}return t},ei=Zn,ti=function(e){var t="row.getProperty('"+e.get("binding")+"')",i=e.get("custompipeformat")||e.get("formatpattern"),o="";switch(!n.isDateTimeType(e.get("type"))||i&&"None"!==i||(e.set("formatpattern","toDate"),e.delete("datepattern"),i="toDate"),i){case"toDate":o="{{"+t+" | toDate: colDef.datepattern}}";break;case"toCurrency":e.get("currencypattern")&&(o="{{"+t+" | toCurrency: '"+e.get("currencypattern"),e.get("fractionsize")?o+="': "+e.get("fractionsize")+"}}":o+="'}}");break;case"numberToString":e.get("fractionsize")&&(o="{{"+t+" | numberToString: '"+e.get("fractionsize")+"'}}");break;case"stringToNumber":o="{{"+t+" | stringToNumber}}";break;case"timeFromNow":o="{{"+t+" | timeFromNow}}";break;case"prefix":e.get("prefix")&&(o="{{"+t+" | prefix: '"+e.get("prefix")+"'}}");break;case"suffix":e.get("suffix")&&(o="{{"+t+" | suffix: '"+e.get("suffix")+"'}}");break;default:n.checkIsCustomPipeExpression(i)&&(o="{{"+t+" | "+i+" : row}}")}return o},ni=ti;t.register("wm-table-column",(function(){return{requires:["wm-table"],template:function(e,t){if(e.children.length){if(1===e.children.length&&e.children[0]instanceof i.Text&&0===e.children[0].value.trim().length)return;t.set("customExpression",!0),Un(e.children)}},pre:function(e,i,o){var r="",a="",s="",l="";if(o){var c=o.get("table_reference");r="multicolumn"===o.get("filtermode")&&"false"!==e.get("searchable")?qn(e,c):"";var p=o.get("editmode"),u=p!==Ce&&p!==Te&&"true"!==e.get("readonly");a=u?Xn(e,!1,o.get("errorstyle"),c):"",s=u&&p===Ee&&"false"!==o.get("shownewrow")?Xn(e,!0,e.get("errorstyle")):"",l=' [formGroup]="'+c+'.ngform" '}var d=e.get("formatpattern"),h='<ng-template #customExprTmpl let-row="row" let-colDef="colDef" let-editRow="editRow" let-deleteRow="deleteRow" let-addNewRow="addNewRow">',m="",f="";return i.get("customExpression")?(e.set("customExpression","true"),m=h+'<div data-col-identifier="'+e.get("binding")+'">'):(d&&"None"!==d||n.isDateTimeType(e.get("type")))&&(f=ti(e))&&(i.set("customExpression",!0),e.set("customExpression","true"),m=h+'<div data-col-identifier="'+e.get("binding")+'" title="'+f+'">'+f),"<div wmTableColumn "+t.getAttrMarkup(e)+" "+l+">\n "+r+"\n "+a+"\n "+s+"\n "+m},post:function(e,t){var n="";return t.get("customExpression")&&(n="</div></ng-template>"),n+"</div>"},imports:function(e){var t=e.get("edit-widget-type"),i=e.get("filterwidget")||Ie(e.get("type")||n.DataType.STRING);return[n.getRequiredFormWidget(t),n.getRequiredFormWidget(i),"wm-table"]}}}));var ii=Object.freeze({__proto__:null,default:function(){},"\u02750":Wn,"\u02751":zn,"\u02752":Yn,"\u02753":Qn,"\u02754":Jn,"\u02755":ei,"\u02756":ni}),oi=function(e){var t="anchor"===e.get("widget-type")?"a":"button",i="anchor"===e.get("widget-type")?"wmAnchor":"wmButton",o=e.get("display-name")||e.get("title")||"Collapse/Expand";return'<ng-template #rowExpansionActionTmpl let-row="row">\n <'+t+" "+i+"\n "+n.getRowActionAttrs(e)+'\n class="'+e.get("class")+' row-expansion-button"\n iconclass="'+e.get("collapseicon")+'"\n type="button" aria-label="'+o+'"></'+t+">\n </ng-template>"},ri=oi;t.register("wm-table-row",(function(){return{pre:function(e){return"<div wmTableRow "+t.getAttrMarkup(e)+">\n "+oi(e)+'\n <ng-template #rowExpansionTmpl let-row="row" let-rowDef="rowDef" let-containerLoad="containerLoad">\n <div wmContainer partialContainer content.bind="rowDef.content" load.event="containerLoad(widget)"\n [ngStyle]="{\'height\': rowDef.height, \'overflow-y\': \'auto\'}">\n <div *ngFor="let param of rowDef.partialParams | keyvalue" wmParam hidden\n [name]="param.key" [value]="param.value"></div>'},post:function(){return"</div></ng-template></div>"}}}));var ai=Object.freeze({__proto__:null,default:function(){},"\u02750":ri}),si=function(){return'<button type="button" aria-label="Save edit icon" class="save row-action-button btn app-button btn-transparent save-edit-row-button hidden" title="Save">\n <i class="wi wi-done" aria-hidden="true"></i>\n </button>\n <button type="button" aria-label="Cancel edit icon" class="cancel row-action-button btn app-button btn-transparent cancel-edit-row-button hidden" title="Cancel">\n <i class="wi wi-cancel" aria-hidden="true"></i>\n </button>'},li=si,ci=function(e){var t=e.get("action"),i=t?' click.event.delayed="'+t+'" ':"",o=t&&t.includes("editRow(")?'<button type="button" aria-label="Save edit icon" class="save row-action-button btn app-button btn-transparent save-edit-row-button hidden" title="Save">\n <i class="wi wi-done" aria-hidden="true"></i>\n </button>\n <button type="button" aria-label="Cancel edit icon" class="cancel row-action-button btn app-button btn-transparent cancel-edit-row-button hidden" title="Cancel">\n <i class="wi wi-cancel" aria-hidden="true"></i>\n </button>':"",r=t?t.includes("editRow(")?"edit edit-row-button":t.includes("deleteRow(")?"delete delete-row-button":"":"",a=e.get("tabindex")?'tabindex="'+e.get("tabindex")+'"':"",s="anchor"===e.get("widget-type")?"a":"button";return'<ng-template #rowActionTmpl let-row="row">\n <'+s+" "+("anchor"===e.get("widget-type")?"wmAnchor":"wmButton")+' data-action-key="'+e.get("key")+'"\n '+n.getRowActionAttrs(e)+'\n class="row-action row-action-button '+e.get("class")+" "+r+'"\n iconclass="'+e.get("iconclass")+'"\n '+i+"\n "+a+'\n type="button"></'+s+">\n "+o+"\n </ng-template>"},pi=ci;t.register("wm-table-row-action",(function(){return{pre:function(e){return"<div wmTableRowAction "+t.getAttrMarkup(e)+">\n "+ci(e)},post:function(){return"</div>"}}}));var ui=Object.freeze({__proto__:null,default:function(){},"\u02750":li,"\u02751":pi}),di=new n.IDGenerator("table_"),hi=0;function mi(e,t){var n=0;e.forEach((function(e){var o=e.name,r=void 0!==t?t:n;"wm-table-column"!==o&&"wm-table-column-group"!==o||(e.attrs.push(new i.Attribute("index",""+hi,1,1,1,void 0,void 0)),e.attrs.push(new i.Attribute("headerIndex",""+r,1,1,1,void 0,void 0)),"wm-table-column-group"===o&&mi(e.children,n),hi++,n++)}))}t.register("wm-table",(function(){return{template:function(e,i){if(e.children.length){var o=e.children.some((function(e){return"wm-table-column"===e.name||"wm-table-column-group"===e.name}));mi(e.children),i.set("isdynamictable",o?"false":"true");var r=e.children.some((function(e){return"wm-table-row"===e.name}));i.set("isrowexpansionenabled",r?"true":"false")}else i.set("isdynamictable","true");var a=e.attrs.find((function(e){return"dataset"===e.name})),s=e.attrs.find((function(e){return"name"===e.name}));if(a){var l=t.getBoundToExpr(a.value);l&&n.updateTemplateAttrs(e,l,s.value,"","row")}},pre:function(e,n){var i=di.nextUid();return n.set("counter",i),e.set("isdynamictable",n.get("isdynamictable")),e.set("isrowexpansionenabled",n.get("isrowexpansionenabled")),e.set("table_reference",i),'<div wmTable="'+i+'" wmTableFilterSort wmTableCUD #'+i+' data-identifier="table" '+t.getAttrMarkup(e)+">"},post:function(){return"</div>"},provide:function(e,t){var n=new Map;return n.set("table_reference",t.get("counter")),n.set("filtermode",e.get("filtermode")),n.set("errorstyle",e.get("errorstyle")),n.set("editmode",e.get("editmode")),n.set("shownewrow",e.get("shownewrow")),n}}}));var fi=Object.freeze({__proto__:null,default:function(){}});t.register("wm-video",(function(){return{pre:function(e){return"<div wmVideo "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var gi=Object.freeze({__proto__:null,default:function(){}}),vi="parentLinearLayout.spacing";t.register("wm-linearlayout",(function(){return{requires:["wm-linearlayout"],pre:function(e,n,i){var o=e.get("spacing");return e.set("spacing",o&&"0"!==o||!i?o:i.get(vi)),"<div wmLinearLayout "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"},provide:function(e,t){var n=new Map;return n.set(vi,e.get("spacing")),n}}}));var yi=Object.freeze({__proto__:null,default:function(){}});t.register("wm-linearlayoutitem",(function(){return{pre:function(e){return"<div wmLinearLayoutItem "+t.getAttrMarkup(e)+">"},post:function(){return"</div>"}}}));var bi=Object.freeze({__proto__:null,default:function(){}});e.accordionBuild=z,e.accordionPaneBuild=Y,e.alertDlgBuild=ye,e.anchorBuild=h,e.audioBuild=m,e.barcodeScannerBuild=fe,e.breadcrumbBuild=Lt,e.buttonBuild=ut,e.buttonGroupBuild=ct,e.calendarBuild=rt,e.cameraBuild=ve,e.cardActionsBuild=G,e.cardBuild=j,e.cardContentBuild=B,e.cardFooterBuild=V,e.carouselBuild=s,e.carouselTemplateBuild=c,e.chartBuild=$,e.checkboxBuild=dt,e.checkboxSetBuild=ht,e.chipsBuild=at,e.colorPickerBuild=st,e.compositeBuild=mt,e.confirmDlgBuild=be,e.containerBuild=K,e.contentBuild=rn,e.currencyBuild=lt,e.dateBuild=Ot,e.dateTimeBuild=_t,e.dlgBuild=Pe,e.dlgFooterBuild=we,e.fileUploadBuild=Et,e.footerBuild=sn,e.formActionBuild=Ke,e.formBuild=ot,e.formFieldBuild=qe,e.headerBuild=cn,e.htmlBuild=g,e.iconBuild=v,e.iframeBuild=y,e.iframeDlgBuild=_e,e.initComponentsBuildTask=function(){},e.labelBuild=w,e.layoutBuild=en,e.leftPanelBuild=un,e.lgBuild=J,e.lgcolBuild=Q,e.lgrowBuild=X,e.linearLayoutBuild=yi,e.linearLayoutItemBuild=bi,e.listBuild=Dt,e.liveTableBuild=xt,e.loginBuild=p,e.loginDlgBuild=Oe,e.marqueeBuild=u,e.mediaListBuild=Rt,e.mediaListItemBuild=It,e.menuBuild=Ft,e.messageBuild=Mt,e.mobileNavbarBuild=dn,e.navBuild=Bt,e.navItemBuild=jt,e.navbarBuild=Gt,e.numberBuild=ft,e.pageBuild=Jt,e.pageContentBuild=Pn,e.paginationBuild=on,e.panelBuild=ee,e.partialBuild=In,e.partialDlgBuild=Se,e.partialParamBuild=Dn,e.pictureBuild=O,e.popoverBuild=Vt,e.prefabBuild=Nn,e.prefabContainerBuild=jn,e.progressBarBuild=N,e.progressCircleBuild=x,e.radiosetBuild=gt,e.ratingBuild=Tt,e.repeatTemplateBuild=oe,e.rightPanelBuild=mn,e.routerOutletBuild=nn,e.rteBuild=M,e.searchBuild=L,e.segContentBuild=ne,e.segControlBuild=te,e.selectBuild=vt,e.sliderBuild=Ct,e.spinnerBuild=E,e.switchBuild=bt,e.tabBarBuild=_n,e.tabPaneBuild=ce,e.tableActionBuild=Bn,e.tableBuild=fi,e.tableColumnBuild=ii,e.tableColumnGroupBuild=Gn,e.tableRowActionBuild=ui,e.tableRowBuild=ai,e.tabsBuild=le,e.textAreaBuild=Pt,e.textBuild=wt,e.tileBuild=pe,e.timeBuild=St,e.topNavBuild=Sn,e.treeBuild=F,e.videoBuild=gi,e.wizardBuild=ue,e.wizardStepBuild=he,Object.keys(t).forEach((function(n){"default"===n||e.hasOwnProperty(n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})),Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@angular/forms"),require("angular-imask"),require("@wm/components/base"),require("@wm/core"),require("rxjs")):"function"==typeof define&&define.amd?define("@wm/components/input",["exports","@angular/core","@angular/common","@angular/forms","angular-imask","@wm/components/base","@wm/core","rxjs"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.input={}),e.ng.core,e.ng.common,e.ng.forms,e["angular-imask"],e.wm.components.base,e.wm.core,e.rxjs)}(this,(function(e,t,n,i,o,r,a,s){"use strict";
|
|
44
44
|
/*! *****************************************************************************
|
|
45
45
|
Copyright (c) Microsoft Corporation.
|
|
46
46
|
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
111
111
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
112
112
|
PERFORMANCE OF THIS SOFTWARE.
|
|
113
|
-
***************************************************************************** */var p=function(e,t){return(p=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)};Object.create;function u(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function d(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o<r;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 h=new Map([["casesensitive",Object.assign({value:!1},r.PROP_BOOLEAN)],["class",r.PROP_STRING],["datacompletemsg",Object.assign({value:"No more data to load"},r.PROP_STRING)],["datafield",Object.assign({value:"All Fields"},r.PROP_STRING)],["dataoptions",r.PROP_ANY],["dataset",r.PROP_ANY],["datasource",r.PROP_ANY],["datavalue",r.PROP_STRING],["datavaluesource",r.PROP_ANY],["dateformat",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["displayimagesrc",r.PROP_STRING],["displaylabel",r.PROP_STRING],["displayexpression",r.PROP_STRING],["dropup",r.PROP_BOOLEAN],["groupby",r.PROP_STRING],["hint",r.PROP_STRING],["imagewidth",Object.assign({value:"16px"},r.PROP_STRING)],["limit",r.PROP_NUMBER],["loadingdatamsg",Object.assign({value:"Loading items..."},r.PROP_STRING)],["match",r.PROP_STRING],["matchmode",r.PROP_STRING],["minchars",r.PROP_NUMBER],["name",r.PROP_STRING],["navsearchbar",Object.assign({value:!1},r.PROP_BOOLEAN)],["orderby",r.PROP_STRING],["placeholder",Object.assign({value:"Search"},r.PROP_STRING)],["position",r.PROP_STRING],["query",r.PROP_STRING],["readonly",r.PROP_BOOLEAN],["required",r.PROP_BOOLEAN],["searchkey",r.PROP_STRING],["searchon",Object.assign({value:"typing"},r.PROP_STRING)],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["showclear",Object.assign({value:!1},r.PROP_BOOLEAN)],["showsearchicon",r.PROP_BOOLEAN],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["type",Object.assign({value:"search"},r.PROP_STRING)],["debouncetime",Object.assign({value:250},r.PROP_NUMBER)],["width",r.PROP_STRING]]),m=function(){r.register("wm-search",h),r.registerFormWidget(l.FormWidgetType.AUTOCOMPLETE,new Map(h)),r.registerFormWidget(l.FormWidgetType.TYPEAHEAD,new Map(h))},f=function(){function e(){}return e.prototype.applyFilter=function(e,t,n){return e=_.isNumber(e)?e.toString():e,_.includes(n,"start")?_.startsWith(e,t):_.includes(n,"end")?_.endsWith(e,t):_.includes(n,"exact")?_.isEqual(e,t):_.includes(e,t)},e.prototype.filter=function(e){var t=this,n=e.dataset,i=e.casesensitive,o=e.matchMode;o&&!_.includes(o,"ignorecase")&&(i=!0);var r,a=e.query;return new Promise((function(s,l){if(e.searchKey){var c=_.split(e.searchKey,",");r=_.filter(e.dataset,(function(e){return c.some((function(n){var r=_.get(e,n),s=a;return i||(r=_.toLower(_.toString(r)),s=_.toLower(_.toString(s))),t.applyFilter(r,s,o)}))}))}else r=_.isArray(n)&&_.isObject(n[0])?_.filter(n,(function(e){var n=_.values(e).join(" ");return i||(n=_.toLower(n),a=_.toLower(a)),t.applyFilter(n,a)})):_.filter(n,(function(e){return i||(e=_.toLower(e),a=_.toLower(a)),t.applyFilter(e,a,o)}));s({data:r,hasMoreData:!1,isLastPage:!0})}))},e}(),g=function(){function e(){}return e.prototype.filter=function(e){var t=this;return this.filterData(e).then((function(n){return t.onFilterSuccess(e,n)}),(function(){return t.onFilterFailure()}))},e.prototype.filterData=function(e){if(e.dataoptions){var t=e.dataoptions,n=e.datasource.execute(l.DataSource.Operation.GET_REQUEST_PARAMS,e);if(t.relatedField)return new Promise((function(i,o){r.interpolateBindExpressions(e.viewParent,t.filterExpr,(function(r){n.filterExpr=t.filterExpr=r,t.filterExpr=r,e.datasource.execute(l.DataSource.Operation.GET_RELATED_TABLE_DATA,_.assign({relatedField:t.relatedField},n)).then(i,o)}))}));if(t.distinctField)return e.datasource.execute(l.DataSource.Operation.GET_DISTINCT_DATA_BY_FIELDS,{pagesize:e.limit||e.pagesize,page:e.page,fields:t.distinctField,entityName:t.tableName,filterFields:_.assign(t.filterFields,n.filterFields),filterExpr:l.getClonedObject(t.filterExpr||{})})}return e.datasource.execute(l.DataSource.Operation.SEARCH_RECORDS,e)},e.prototype.isLast=function(e,t,n,i){return t===l.AppConstants.INT_MAX_VALUE?0!==i&&i<n:e===(t>n?Math.ceil(t/n):t<0?0:1)},e.prototype.getTransformedData=function(e,t){var n=e.operation+"Result",i=t[n];if(i){var o={};_.set(o,n,i),t=[o]}else t=[t];return t},e.prototype.onFilterFailure=function(){return[]},e.prototype.isLastPageForDistinctApi=function(e,t,n,i){return t>1&&!i&&_.isEmpty(e)&&n===l.AppConstants.INT_MAX_VALUE},e.prototype.onFilterSuccess=function(e,t){var n,i,o,r,a=this,s=t.data,c=_.split(e.binddataset,"."),p=_.slice(c,_.indexOf(c,"dataSet")+1).join(".");return new Promise((function(c,u){var d=t.pagination;if(e.datasource.execute(l.DataSource.Operation.IS_PAGEABLE)&&(o=d.number+1,i=a.isLast(o,e.limit>0&&e.limit||d.totalElements,d.size,d.numberOfElements),r=!0,a.isLastPageForDistinctApi(s,o,d.totalElements,i)))c({data:[],isLastPage:i=!0,hasMoreData:o>1,isPaginatedData:r,page:o});else{if(p){if(_.isArray(s)){var h=p.lastIndexOf("[$i]");if(h>-1){var m=p.substr(h+5);n=s.map((function(e){return l.findValueOf(e,m)}))}}else _.isObject(s)&&(n=_.get(s,p));s=n||s}_.isArray(s)||(s=a.getTransformedData(e.datasource,s)),s.length?c({data:s,isLastPage:i,hasMoreData:o>1,isPaginatedData:r,page:o}):c({data:[],isLastPage:i,hasMoreData:o>1,isPaginatedData:r,page:o})}}))},e}(),v=function(){function e(){}return e.prototype.filter=function(t){var n=this,i=t.datasource&&t.datasource.execute(l.DataSource.Operation.IS_UPDATE_REQUIRED,t.hasData);return(!t.isLocalFilter&&(t.dataoptions||t.datasource&&t.datasource.execute(l.DataSource.Operation.IS_API_AWARE)&&t.searchKey&&i)?e.remoteDataProvider.filter(t):e.localDataProvider.filter(t)).then((function(e){return n.updateDataset=t.datasource&&!t.datasource.execute(l.DataSource.Operation.SUPPORTS_CRUD)&&i,n.hasMoreData=e.hasMoreData,n.isLastPage=e.isLastPage,n.page=e.page,n.isPaginatedData=e.isPaginatedData,e}))},e}();v.remoteDataProvider=new g,v.localDataProvider=new f;var y={widgetType:"wm-search",hostClass:"input-group"},b=function(e){function t(t,n,i,o){var r=e.call(this,t,y)||this;r.binddatavalue=i,r.binddataset=o,r.query="",r.page=1,r.allowempty=!1,r.app=n,l.addClass(r.nativeElement,"app-search",!0),r.typeaheadDataSource=a.Observable.create((function(e){r.listenQuery&&(r._defaultQueryInvoked=!1,r._loadingItems=!0,e.next(r.query)),r.lastSelectedIndex&&(r.typeahead._container=void 0)})).pipe(s.filter((function(){return r._loadingItems=!1,0===r.minchars||r.query&&r.query.length>=r.minchars})),s.mergeMap((function(e){return r.getDataSourceAsObservable(e)}))),r.dataProvider=new v;var c=r.datavalue$.subscribe((function(e){var t=_.isArray(e)?e[0]:e;if(null===t||""===t)return r._modelByValue="",r.query=r.queryModel="",void(r._lastResult=void 0);r._unsubscribeDv||(r._defaultQueryInvoked=!1,_.isObject(e)||r.prevDatavalue===e||(r._modelByKey=void 0,r.query=r.queryModel=""),r.updateByDatavalue(e)),r.showClosebtn=""!==r.query}));r.registerDestroyListener((function(){return c.unsubscribe()}));var p=r.dataset$.subscribe((function(){r.startIndex=r.datasetItems.length,r._lastResult=void 0;var e=r.datavalue||r.toBeProcessedDatavalue;l.isDefined(e)&&r.updateByDataset(e)}));return r.registerDestroyListener((function(){return p.unsubscribe()})),r}return function(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}p(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),Object.defineProperty(t.prototype,"datasource",{get:function(){return this._datasource},set:function(e){this._datasource=e;var t=this.datavalue||this.toBeProcessedDatavalue;this.updateByDatavalue(t)},enumerable:!1,configurable:!0}),t.prototype.clearSearch=function(e,t){this.query="",this.onInputChange(e),this.dataProvider.isLastPage=!1,this.listenQuery=!1,t&&(this.listenQuery=!0,this._unsubscribeDv=!1,this.loadMoreData()),this.invokeEventCallback("clearsearch"),this._loadingItems=!1,e&&this.$element.find(".app-search-input").focus()},t.prototype.clearText=function(){this.query="",this.showClosebtn=!1},t.prototype.closeSearch=function(){this._loadingItems=!1,this.page=1,this.insertAtIndex(this.elIndex),this.elIndex=void 0,this.parentEl=void 0,this.$element.removeClass("full-screen"),this._domUpdated&&(this._domUpdated=!1),this.listenQuery=!1,this._unsubscribeDv=!0,this.typeahead.hide()},t.prototype.renderMobileAutoComplete=function(){l.isDefined(this.elIndex)||(this.parentEl=this.$element.parent(),this.elIndex=this.parentEl.children().index(this.$element)),this.$element.hasClass("full-screen")||(this._domUpdated=!0,this.$element.addClass("full-screen"),"inline"===this.position&&this.$element.addClass(this.position)),this.$element.hasClass("full-screen")&&this.$element.find(".app-search-input").focus()},t.prototype.getDataSourceAsObservable=function(e){if(this._lastQuery===e&&!_.get(this.dataoptions,"filterFields")&&l.isDefined(this._lastResult))return this._loadingItems=!1,a.of(this._lastResult);if("autocomplete"===this.type&&this.searchkey&&this.query&&this.datavalue){var t=[],n=_.split(this.searchkey,","),i=void 0;if(this.binddisplaylabel&&1===(t=_.split(this.binddisplaylabel,"+")).length)if(_.includes(t[0],"|"))i=!0;else{i=/\[(.*?)\]/.exec(t[0])[1]}if(t.length>1||i&&!_.includes(n,i)||this.displayexpression&&!_.includes(n,this.displayexpression))return this._loadingItems=!1,a.of([])}return this._lastQuery=this.query,a.from(this.getDataSource(e))},t.prototype.handleEvent=function(t,n,i,o){_.includes(["blur","focus","select","submit","change"],n)||e.prototype.handleEvent.call(this,t,n,i,o)},t.prototype.highlight=function(e,t){if(this.typeaheadContainer)return e.value=e.item.label.toString(),this.typeaheadContainer.highlight(e,t)},t.prototype.insertAtIndex=function(e){0===e?this.parentEl.prepend(this.$element):this.parentEl.children().eq(e).length?this.$element.insertBefore(this.parentEl.children().eq(e)):this.$element.insertAfter(this.parentEl.children().eq(e-1))},t.prototype.isMobileAutoComplete=function(){return"autocomplete"===this.type&&l.isMobile()},t.prototype.isQueryEntered=function(){return this.showclear&&this.showClosebtn},t.prototype.loadMoreData=function(e){this.dataProvider.isLastPage||(this.page=e?this.page+1:this.page,this.isScrolled=!0,this._loadingItems=!0,e&&(this._lastQuery=void 0),this.typeahead.onInput({target:{value:_.trim(this.query)||"0"}}))},t.prototype.onFocusOut=function(){this._unsubscribeDv=!1,this._loadingItems=!1,this.page=1,!this._domUpdated&&this._isOpen&&(this.listenQuery=!1),this._isOpen=!1,this._domUpdated&&this.typeahead&&this.typeahead._container&&(this.typeahead._container.isFocused=!0)},t.prototype.onInputChange=function(e){this.result=[],this.page=1,this.listenQuery=this.isUpdateOnKeyPress(),this._modelByValue=void 0,""===this.query?(this.queryModel="",this._modelByValue="",this.updatePrevDatavalue(this._lastQuery),this.invokeOnChange(this._modelByValue,{},!0),this.invokeEventCallback("clear",{$event:e}),e&&9!==e.which&&this.invokeEventCallback("submit",{$event:e})):this.invokeEventCallback("change",{$event:e,newVal:this._modelByValue||this.query,oldVal:this.prevDatavalue}),this.showClosebtn=""!==this.query},t.prototype.handleEnterEvent=function(e){_.get(this.typeahead,"matches.length")||this.onSearchSelect(e)},t.prototype.onSearchSelect=function(e){var t,n,i,o=(null===(n=null===(t=this.typeaheadContainer)||void 0===t?void 0:t.active)||void 0===n?void 0:n.value)===this.query;if(this.typeaheadContainer&&this.typeaheadContainer.active&&o&&(i=this.typeaheadContainer.active.item),e=this.eventData(e,i||{}),!this.isUpdateOnKeyPress())return this.listenQuery=!0,void this.typeahead.onInput({target:{value:this.query}});this.typeaheadContainer&&this.liElements.length&&o?this.typeaheadContainer.selectActiveMatch():(this.queryModel=this.query,this.invokeEventCallback("submit",{$event:e}))},t.prototype.invokeOnBeforeServiceCall=function(e){this.invokeEventCallback("beforeservicecall",{inputData:e})},t.prototype.onDropdownOpen=function(){var e=this;if(this.clearData&&this.typeahead.hide(),_.debounce((function(){e._isOpen=!0,e.typeaheadContainer=e.typeahead._container||e.typeahead._typeahead.instance,e.typeaheadContainer.liElements=e.liElements,e.typeaheadContainer.ulElement=e.ulElement,l.adjustContainerPosition($("typeahead-container"),e.nativeElement,e.typeahead._typeahead,$("typeahead-container .dropdown-menu"))}))(),this.isMobileAutoComplete()){this.$element.hasClass("full-screen")||this.renderMobileAutoComplete();var t=this.dropdownEl.closest("typeahead-container");t.insertAfter(this.$element.find("input").first());var n=this.$element.closest(".app-content").height();t.css({position:"relative",top:0,height:n+"px"}),this.showClosebtn=this.query&&""!==this.query,_.isUndefined(this.dataProvider.isLastPage)||this.dataProvider.isLastPage||this.triggerSearch()}},t.prototype.selectNext=function(){var e=this.typeaheadContainer.matches;if(e){var t=e.indexOf(this.typeaheadContainer.active);!this._loadingItems&&!this.dataProvider.isLastPage&&t+1>e.length-1&&(this.lastSelectedIndex=t,this.loadMoreData(!0))}},t.prototype.setLastActiveMatchAsSelected=function(){this.lastSelectedIndex&&(this.typeaheadContainer._active=this.typeaheadContainer.matches[this.lastSelectedIndex],this.typeaheadContainer.nextActiveMatch(),this.lastSelectedIndex=void 0)},t.prototype.triggerSearch=function(){if(!this.dataProvider.isLastPage&&this.$element.hasClass("full-screen")){var e=this.dropdownEl,t=e.find("li").last();t.length&&e.length&&e.height()+e.position().top>t.height()+t.position().top&&this.loadMoreData(!0)}},t.prototype.isUpdateOnKeyPress=function(){return"typing"===this.searchon},t.prototype.debounceDefaultQuery=function(e){var t=this;this._defaultQueryInvoked=!0,this.getDataSource(e,!0).then((function(e){e.length?(t.queryModel=e,t._lastQuery=t.query=t.queryModel[0].label||"",t._modelByValue=t.queryModel[0].value,t._modelByKey=t.queryModel[0].key,t.showClosebtn=""!==t.query):(t._modelByValue=void 0,t.queryModel=void 0,t.query=""),t.clearData&&_.get(t.typeahead,"_typeahead.isShown")&&t.typeahead.hide()}))},t.prototype.updateByDatavalue=function(e){this.updateByDataset(e),this.updateByDataSource(e)},t.prototype.updateByDataSource=function(e){if(l.isDefined(e)&&!_.isObject(e)&&this.datasource&&!l.isDefined(this._modelByKey)&&this.datafield!==r.ALLFIELDS){if(l.isDefined(this.queryModel)&&!_.isEmpty(this.queryModel))return void this.updateDatavalueFromQueryModel();!this._defaultQueryInvoked&&this.datasource.execute(l.DataSource.Operation.SUPPORTS_CRUD)&&this.debounceDefaultQuery(e)}},t.prototype.updateDatavalueFromQueryModel=function(){l.isDefined(this.queryModel)&&(this._modelByValue=_.isArray(this.queryModel)?this.queryModel[0].value:this.queryModel,this._modelByKey=_.isArray(this.queryModel)?this.queryModel[0].key:this.queryModel,this.toBeProcessedDatavalue=void 0)},t.prototype.updateByDataset=function(e){if(!this._defaultQueryInvoked||!this.searchkey){var t=_.find(this.datasetItems,(function(t){return _.isObject(t.value)?_.isEqual(t.value,e):_.toString(t.value).toLowerCase()===_.toString(e).toLowerCase()}));if(t)this.queryModel=[t];else if(this.datafield===r.ALLFIELDS&&_.isObject(e))this.queryModel=this.getTransformedData(r.extractDataAsArray(e));else if(this.prevDatavalue!==e)return this.queryModel=void 0,void(this.query="");this.updateDatavalueFromQueryModel(),this._lastQuery=this.query=l.isDefined(this.queryModel)&&this.queryModel.length?_.get(this.queryModel[0],"label"):"",this.showClosebtn=""!==this.query}},t.prototype.handleFocus=function(e){"search"===this.type&&this.query===this._lastQuery&&this._lastResult&&this.typeahead.keyUpEventEmitter.emit(this.query)},t.prototype.notifySubscriber=function(){var e=$(this.nativeElement).closest(".app-composite-widget.caption-floating");e.length>0&&this.app.notify("captionPositionAnimate",{displayVal:!0,nativeEl:e})},t.prototype.getDataSource=function(e,t,n){var i=this;if(t&&this.datafield===r.ALLFIELDS)return this._loadingItems=!1,Promise.resolve([]);var o={dataset:this.dataset?r.convertDataToObject(this.dataset):void 0,binddataset:this.binddataset,datasource:this.datasource,datafield:this.datafield,hasData:this.dataset&&this.dataset.length,query:e,isLocalFilter:!this.searchkey,searchKey:t?this.datafield:this.searchkey,matchMode:t?"startignorecase":this.matchmode,casesensitive:this.casesensitive,isformfield:this.isformfield,orderby:this.orderby,limit:this.limit,pagesize:this.pagesize,page:this.page,onBeforeservicecall:this.invokeOnBeforeServiceCall.bind(this)};return this.dataoptions&&(o.dataoptions=this.dataoptions,o.viewParent=this.viewParent),this._loadingItems=!0,this.dataProvider.filter(o).then((function(e){e=e.data||e,l.isDefined(i.dataset)&&i.dataset.length||!i.dataProvider.updateDataset||(i.dataset=e),i.dataProvider.hasMoreData?i.formattedDataset=i.formattedDataset.concat(e):i.formattedDataset=e,i.formattedDataset.length>20&&!l.isDefined(i.limit)&&(i.typeahead.typeaheadOptionsLimit=i.formattedDataset.length),i._isOpen&&i.isMobileAutoComplete()&&!_.isUndefined(i.dataProvider.isLastPage)&&!i.dataProvider.isLastPage&&i.triggerSearch();var t=i.getTransformedData(i.formattedDataset,n);return i.result=_.map(t,"value"),t}),(function(e){return i._loadingItems=!1,[]})).then((function(t){return i.isScrolled&&(_.debounce((function(){i.setLastActiveMatchAsSelected()}),30)(),i.isScrolled=!1),t.length||(i._modelByValue=void 0,i.queryModel=e),i._unsubscribeDv&&(t=[]),i._loadingItems=!1,i._lastResult=t,t}))},t.prototype.getContext=function(e){return e&&_.get(e,"widget")?this.getContext(e.viewParent):e},t.prototype.getTransformedData=function(e,t,n){l.isDefined(t)&&t++;var i=r.transformFormData(this.getContext(this.viewParent),e,this.datafield,{displayField:this.displaylabel||this.displayfield,displayExpr:n?"":this.displayexpression,bindDisplayExpr:n?"":this.binddisplaylabel,bindDisplayImgSrc:this.binddisplayimagesrc,displayImgSrc:this.displayimagesrc},t,this);return r.getUniqObjsByDataField(i,this.datafield,this.displayfield||this.displaylabel,l.toBoolean(this.allowempty))},t.prototype.onScroll=function(e,t){var n=e.scrollHeight,i=e.clientHeight;!this._loadingItems&&!this.dataProvider.isLastPage&&e.scrollTop+i>=n&&this.loadMoreData(!0)},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),l.isDefined(this.minchars)||("autocomplete"===this.type?this.minchars=0:this.minchars=1),this.listenQuery=this.isUpdateOnKeyPress(),this.showsearchicon=l.isDefined(this.showsearchicon)?this.showsearchicon:"search"===this.type},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),r.styler(this.nativeElement,this),this.containerTarget=r.getContainerTargetClass(this.nativeElement)},t.prototype.eventData=function(e,t){return e&&(e.data={item:t.dataObject,model:t.value,label:t.label,query:this.query}),e},t.prototype.typeaheadOnSelect=function(e,t){var n=e.item;this.queryModel=n,n.selected=!0,this.query=n.label,this.showClosebtn=""!==this.query,t=t||this.$typeaheadEvent,this._modelByKey=n.key,this._modelByValue=n.value,t=this.eventData(t,n),this.invokeOnTouched(),this.invokeOnChange(this.datavalue,t||{}),this.datavalue!==this.prevDatavalue&&this.updateBoundVariable(this.datavalue),this.$element.hasClass("full-screen")&&this.closeSearch(),this.invokeEventCallback("select",{$event:t,selectedValue:this.datavalue}),this.invokeEventCallback("submit",{$event:t}),this.updatePrevDatavalue(this.datavalue)},t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("autocomplete"===this.type&&"displaylabel"===t&&this.displaylabel&&(!this.displayexpression||this.displayexpression&&!this.datasource)&&(this.displayexpression=this.displaylabel,this.displaylabel=void 0),"displaylabel"===t&&this.dataoptions&&null===this.binddisplaylabel&&(this.query=_.get(this._modelByValue,n)||this._modelByValue),"disabled"===t&&(!1===n?this.clearData=!1:(this.clearData=!0,_.get(this.typeahead,"_typeahead.isShown")&&this.typeahead.hide())),e.prototype.onPropertyChange.call(this,t,n,i))},t}(c.DatasetAwareFormComponent);b.initializeProps=m(),b.decorators=[{type:t.Component,args:[{selector:"[wmSearch]",template:'<ng-template #customItemTemplate let-model="item" let-index="index" let-query="query" let-match="match">\n \x3c!-- Default item template --\x3e\n <a *ngIf="!content">\n <img *ngIf="model.imgSrc" [src]="model.imgSrc" alt="Search" [style.width]="imagewidth">\n <span [title]="model.label" [innerHtml]="highlight(match, query) || model.label"></span>\n </a>\n \x3c!-- Custom partial template --\x3e\n <a *ngIf="content" [ngClass]="{customTemplate: content}" partialContainer [wmItemTemplate]="content" [userComponentParams]="match.item">\n <div partial-container-target></div>\n </a>\n</ng-template>\n\n<ng-template #customListTemplate let-matches="matches" let-itemTemplate="itemTemplate" let-query="query">\n <ul #ulElement class="app-search dropdown-menu" scrollable>\n <li #liElements *ngFor="let match of matches" [ngClass]="{active: typeaheadContainer && typeaheadContainer.isActive(match), \'list-group-header\': match && match.isHeader()}"\n (mouseenter)="typeaheadContainer.selectActive(match);"\n (click)="match && !match.isHeader() && typeaheadContainer.selectMatch(match, $event); $typeaheadEvent = $event; notifySubscriber();">\n \x3c!-- itemTemplate comes from the <input> --\x3e\n <h4 *ngIf="match.isHeader()" class="group-title">{{match.value}}</h4>\n <ng-container *ngIf="!match.isHeader()" [ngTemplateOutlet]="itemTemplate"\n [ngTemplateOutletContext]="{item: match.item, index: i, match: match, query: query}">\n </ng-container>\n </li>\n <div class="status" [hidden]="_loadingItems || !(datacompletemsg && dataProvider.isLastPage)">\n <span [textContent]="datacompletemsg"></span>\n </div>\n <div class="status" [hidden]="!_loadingItems">\n <i class="fa fa-circle-o-notch fa-spin"></i>\n <span [textContent]="loadingdatamsg"></span>\n </div>\n </ul>\n</ng-template>\n\n\x3c!--This template is for search inside mobile navbar.--\x3e\n<ng-container *ngIf="navsearchbar; else searchTemplate">\n <input [title]="query || \'\'" type="text" class="app-textbox form-control list-of-objs app-search-input" [placeholder]="placeholder || \'\'"\n focus-target\n container="body"\n [disabled]="disabled"\n autocomplete="off"\n [(ngModel)]="query"\n [readonly]="readonly"\n [disabled]="disabled"\n [typeahead]="typeaheadDataSource"\n [typeaheadWaitMs]="debouncetime"\n [typeaheadItemTemplate]="customItemTemplate"\n [optionsListTemplate]="customListTemplate"\n (input)="onInputChange($event)"\n (keydown)="listenQuery = true"\n (keydown.enter)="$typeaheadEvent = $event;handleEnterEvent($event)"\n (keydown.arrowdown)="selectNext($event)"\n (blur)="invokeOnTouched($event)"\n (click)="handleFocus($event);"\n (focus)="_unsubscribeDv = false; listenQuery = true; handleFocus($event); invokeOnFocus($event);"\n (focusout)="onFocusOut()"\n [typeaheadMinLength]="minchars"\n [typeaheadOptionsLimit]="limit"\n (typeaheadLoading)="_loadingItems"\n (typeaheadOnSelect)="typeaheadOnSelect($event)"\n typeaheadOptionField="label"\n [typeaheadGroupField]="groupby ? \'groupby\' : null"\n [typeaheadAsync]="true"\n [typeaheadScrollable]="true"\n [adaptivePosition]="true"\n [typeaheadOptionsInScrollableView]="optionslimitinscrollableview"\n [dropup]="dropup"\n [tabindex]="tabindex"\n [attr.name]="name"\n [attr.aria-label]="hint || \'Search field\'"/>\n <i class="btn-close wi wi-cancel" [hidden]="!showClosebtn" (click)="clearSearch($event);"></i>\n</ng-container>\n\x3c!--This template is for both web and fullscreen mode in mobile.--\x3e\n<ng-template #searchTemplate>\n <span class="wi wi-arrow-left form-control-feedback back-btn" aria-hidden="true" (click)="closeSearch()"></span>\n <span class="sr-only">Back button</span>\n <input [title]="query || \'\'" type="text" class="app-textbox form-control list-of-objs app-search-input" [placeholder]="placeholder || \'\'"\n focus-target\n [container]="containerTarget || \'body\'"\n [disabled]="disabled"\n autocomplete="off"\n [(ngModel)]="query"\n [readonly]="readonly"\n [typeahead]="typeaheadDataSource"\n [typeaheadWaitMs]="debouncetime"\n [typeaheadItemTemplate]="customItemTemplate"\n [optionsListTemplate]="customListTemplate"\n (input)="onInputChange($event)"\n (keydown)="listenQuery = true"\n (keydown.enter)="$typeaheadEvent = $event;handleEnterEvent($event)"\n (keydown.arrowdown)="selectNext($event)"\n (blur)="invokeOnTouched($event); onFocusOut()"\n (click)="handleFocus($event);"\n (focus)="_unsubscribeDv = false; listenQuery = true; handleFocus($event); invokeOnFocus($event)"\n [typeaheadMinLength]="minchars"\n [typeaheadOptionsLimit]="limit"\n (typeaheadLoading)="_loadingItems"\n (typeaheadOnSelect)="typeaheadOnSelect($event)"\n typeaheadOptionField="label"\n [typeaheadGroupField]="groupby ? \'groupby\' : null"\n [typeaheadAsync]="true"\n [typeaheadScrollable]="true"\n [adaptivePosition]="true"\n [typeaheadOptionsInScrollableView]="optionslimitinscrollableview"\n [tabindex]="tabindex"\n [dropup]="dropup"\n [attr.name]="name"\n [attr.aria-label]="hint || \'Search field\'">\n <input class="model-holder" ng-model="proxyModel" ng-required="required" tabindex="-1" aria-hidden="true">\n <span *ngIf="_loadingItems" aria-hidden="true" class="fa fa-circle-o-notch fa-spin form-control-feedback"></span>\n <span class="wi wi-close form-control-feedback clear-btn" [ngClass]="{\'show-btn\': isQueryEntered()}" (click)="clearSearch($event, true)"></span>\n <span class="sr-only">Clear button</span>\n <span *ngIf="showsearchicon" class="input-group-addon" aria-label="search icon" [ngClass]="{\'disabled\': disabled}">\n <form>\n <button title="Search" [disabled]="disabled" class="app-search-button wm-sl-l sl-search" type="submit"\n (click)="onSearchSelect($event)"></button>\n </form>\n </span>\n</ng-template>\n',providers:[r.provideAs(b,i.NG_VALUE_ACCESSOR,!0),r.provideAs(b,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(b)]}]}],b.ctorParameters=function(){return[{type:t.Injector},{type:l.App},{type:void 0,decorators:[{type:t.Attribute,args:["datavalue.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["dataset.bind"]}]}]},b.propDecorators={typeahead:[{type:t.ViewChild,args:[o.TypeaheadDirective]}],ulElement:[{type:t.ViewChild,args:["ulElement"]}],liElements:[{type:t.ViewChildren,args:["liElements"]}]};var w=function(){function e(e,n){this.searchRef=n,this.elementRef=e.get(t.ElementRef)}return e.prototype.ngAfterContentInit=function(){this.elementRef.nativeElement.addEventListener("scroll",this.notifyParent.bind(this)),this.searchRef.dropdownEl=$(this.elementRef.nativeElement),this.searchRef.onDropdownOpen()},e.prototype.ngAfterViewInit=function(){if(!this.searchRef.isMobileAutoComplete()){var e=this.searchRef.$element.find("input").first();this.searchRef.dropdownEl.width(e.outerWidth())}},e.prototype.notifyParent=function(e){this.searchRef.onScroll(this.elementRef.nativeElement,e)},e}();w.decorators=[{type:t.Directive,args:[{selector:"[scrollable]"}]}],w.ctorParameters=function(){return[{type:t.Injector},{type:b}]};var P=[b,w],O=function(){};O.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,o.TypeaheadModule,r.WmComponentsModule],declarations:d([],u(P)),exports:d([],u(P)),entryComponents:[]}]}],e.ScrollableDirective=w,e.SearchComponent=b,e.SearchModule=O,e["\u0275a"]=m,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("@wm/core")):"function"==typeof define&&define.amd?define("@wm/components/basic/tree",["exports","@angular/core","@angular/common","@wm/components/base","@wm/core"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.basic=e.wm.components.basic||{},e.wm.components.basic.tree={}),e.ng.core,e.ng.common,e.wm.components.base,e.wm.core)}(this,(function(e,t,n,i,o){"use strict";
|
|
113
|
+
***************************************************************************** */var p=function(e,t){return(p=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)};Object.create;function u(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function d(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o<r;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 h=new Map([["casesensitive",Object.assign({value:!1},r.PROP_BOOLEAN)],["class",r.PROP_STRING],["datacompletemsg",Object.assign({value:"No more data to load"},r.PROP_STRING)],["datafield",Object.assign({value:"All Fields"},r.PROP_STRING)],["dataoptions",r.PROP_ANY],["dataset",r.PROP_ANY],["datasource",r.PROP_ANY],["datavalue",r.PROP_STRING],["datavaluesource",r.PROP_ANY],["dateformat",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["displayimagesrc",r.PROP_STRING],["displaylabel",r.PROP_STRING],["displayexpression",r.PROP_STRING],["dropup",r.PROP_BOOLEAN],["groupby",r.PROP_STRING],["hint",r.PROP_STRING],["imagewidth",Object.assign({value:"16px"},r.PROP_STRING)],["limit",r.PROP_NUMBER],["loadingdatamsg",Object.assign({value:"Loading items..."},r.PROP_STRING)],["match",r.PROP_STRING],["matchmode",r.PROP_STRING],["minchars",r.PROP_NUMBER],["name",r.PROP_STRING],["navsearchbar",Object.assign({value:!1},r.PROP_BOOLEAN)],["orderby",r.PROP_STRING],["placeholder",Object.assign({value:"Search"},r.PROP_STRING)],["position",r.PROP_STRING],["query",r.PROP_STRING],["readonly",r.PROP_BOOLEAN],["required",r.PROP_BOOLEAN],["searchkey",r.PROP_STRING],["searchon",Object.assign({value:"typing"},r.PROP_STRING)],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["showclear",Object.assign({value:!1},r.PROP_BOOLEAN)],["showsearchicon",r.PROP_BOOLEAN],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["type",Object.assign({value:"search"},r.PROP_STRING)],["debouncetime",Object.assign({value:250},r.PROP_NUMBER)],["width",r.PROP_STRING]]),m=function(){r.register("wm-search",h),r.registerFormWidget(l.FormWidgetType.AUTOCOMPLETE,new Map(h)),r.registerFormWidget(l.FormWidgetType.TYPEAHEAD,new Map(h))},f=function(){function e(){}return e.prototype.applyFilter=function(e,t,n){return e=_.isNumber(e)?e.toString():e,_.includes(n,"start")?_.startsWith(e,t):_.includes(n,"end")?_.endsWith(e,t):_.includes(n,"exact")?_.isEqual(e,t):_.includes(e,t)},e.prototype.filter=function(e){var t=this,n=e.dataset,i=e.casesensitive,o=e.matchMode;o&&!_.includes(o,"ignorecase")&&(i=!0);var r,a=e.query;return new Promise((function(s,l){if(e.searchKey){var c=_.split(e.searchKey,",");r=_.filter(e.dataset,(function(e){return c.some((function(n){var r=_.get(e,n),s=a;return i||(r=_.toLower(_.toString(r)),s=_.toLower(_.toString(s))),t.applyFilter(r,s,o)}))}))}else r=_.isArray(n)&&_.isObject(n[0])?_.filter(n,(function(e){var n=_.values(e).join(" ");return i||(n=_.toLower(n),a=_.toLower(a)),t.applyFilter(n,a)})):_.filter(n,(function(e){return i||(e=_.toLower(e),a=_.toLower(a)),t.applyFilter(e,a,o)}));s({data:r,hasMoreData:!1,isLastPage:!0})}))},e}(),g=function(){function e(){}return e.prototype.filter=function(e){var t=this;return this.filterData(e).then((function(n){return t.onFilterSuccess(e,n)}),(function(){return t.onFilterFailure()}))},e.prototype.filterData=function(e){if(e.dataoptions){var t=e.dataoptions,n=e.datasource.execute(l.DataSource.Operation.GET_REQUEST_PARAMS,e);if(t.relatedField)return new Promise((function(i,o){r.interpolateBindExpressions(e.viewParent,t.filterExpr,(function(r){n.filterExpr=t.filterExpr=r,t.filterExpr=r,e.datasource.execute(l.DataSource.Operation.GET_RELATED_TABLE_DATA,_.assign({relatedField:t.relatedField},n)).then(i,o)}))}));if(t.distinctField)return e.datasource.execute(l.DataSource.Operation.GET_DISTINCT_DATA_BY_FIELDS,{pagesize:e.limit||e.pagesize,page:e.page,fields:t.distinctField,entityName:t.tableName,filterFields:_.assign(t.filterFields,n.filterFields),filterExpr:l.getClonedObject(t.filterExpr||{})})}return e.datasource.execute(l.DataSource.Operation.SEARCH_RECORDS,e)},e.prototype.isLast=function(e,t,n,i){return t===l.AppConstants.INT_MAX_VALUE?0!==i&&i<n:e===(t>n?Math.ceil(t/n):t<0?0:1)},e.prototype.getTransformedData=function(e,t){var n=e.operation+"Result",i=t[n];if(i){var o={};_.set(o,n,i),t=[o]}else t=[t];return t},e.prototype.onFilterFailure=function(){return[]},e.prototype.isLastPageForDistinctApi=function(e,t,n,i){return t>1&&!i&&_.isEmpty(e)&&n===l.AppConstants.INT_MAX_VALUE},e.prototype.onFilterSuccess=function(e,t){var n,i,o,r,a=this,s=t.data,c=_.split(e.binddataset,"."),p=_.slice(c,_.indexOf(c,"dataSet")+1).join(".");return new Promise((function(c,u){var d=t.pagination;if(e.datasource.execute(l.DataSource.Operation.IS_PAGEABLE)&&(o=d.number+1,i=a.isLast(o,e.limit>0&&e.limit||d.totalElements,d.size,d.numberOfElements),r=!0,a.isLastPageForDistinctApi(s,o,d.totalElements,i)))c({data:[],isLastPage:i=!0,hasMoreData:o>1,isPaginatedData:r,page:o});else{if(p){if(_.isArray(s)){var h=p.lastIndexOf("[$i]");if(h>-1){var m=p.substr(h+5);n=s.map((function(e){return l.findValueOf(e,m)}))}}else _.isObject(s)&&(n=_.get(s,p));s=n||s}_.isArray(s)||(s=a.getTransformedData(e.datasource,s)),s.length?c({data:s,isLastPage:i,hasMoreData:o>1,isPaginatedData:r,page:o}):c({data:[],isLastPage:i,hasMoreData:o>1,isPaginatedData:r,page:o})}}))},e}(),v=function(){function e(){}return e.prototype.filter=function(t){var n=this,i=t.datasource&&t.datasource.execute(l.DataSource.Operation.IS_UPDATE_REQUIRED,t.hasData);return(!t.isLocalFilter&&(t.dataoptions||t.datasource&&t.datasource.execute(l.DataSource.Operation.IS_API_AWARE)&&t.searchKey&&i)?e.remoteDataProvider.filter(t):e.localDataProvider.filter(t)).then((function(e){return n.updateDataset=t.datasource&&!t.datasource.execute(l.DataSource.Operation.SUPPORTS_CRUD)&&i,n.hasMoreData=e.hasMoreData,n.isLastPage=e.isLastPage,n.page=e.page,n.isPaginatedData=e.isPaginatedData,e}))},e}();v.remoteDataProvider=new g,v.localDataProvider=new f;var y={widgetType:"wm-search",hostClass:"input-group"},b=function(e){function t(t,n,i,o){var r=e.call(this,t,y)||this;r.binddatavalue=i,r.binddataset=o,r.query="",r.page=1,r.allowempty=!1,r.app=n,l.addClass(r.nativeElement,"app-search",!0),r.typeaheadDataSource=a.Observable.create((function(e){r.listenQuery&&(r._defaultQueryInvoked=!1,r._loadingItems=!0,e.next(r.query)),r.lastSelectedIndex&&(r.typeahead._container=void 0)})).pipe(s.filter((function(){return r._loadingItems=!1,0===r.minchars||r.query&&r.query.length>=r.minchars})),s.mergeMap((function(e){return r.getDataSourceAsObservable(e)}))),r.dataProvider=new v;var c=r.datavalue$.subscribe((function(e){var t=_.isArray(e)?e[0]:e;if(null===t||""===t)return r._modelByValue="",r.query=r.queryModel="",void(r._lastResult=void 0);r._unsubscribeDv||(r._defaultQueryInvoked=!1,_.isObject(e)||r.prevDatavalue===e||(r._modelByKey=void 0,r.query=r.queryModel=""),r.updateByDatavalue(e)),r.showClosebtn=""!==r.query}));r.registerDestroyListener((function(){return c.unsubscribe()}));var p=r.dataset$.subscribe((function(){r.startIndex=r.datasetItems.length,r._lastResult=void 0;var e=r.datavalue||r.toBeProcessedDatavalue;l.isDefined(e)&&r.updateByDataset(e)}));return r.registerDestroyListener((function(){return p.unsubscribe()})),r}return function(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}p(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),Object.defineProperty(t.prototype,"datasource",{get:function(){return this._datasource},set:function(e){this._datasource=e;var t=this.datavalue||this.toBeProcessedDatavalue;this.updateByDatavalue(t)},enumerable:!1,configurable:!0}),t.prototype.clearSearch=function(e,t){this.query="",this.onInputChange(e),this.dataProvider.isLastPage=!1,this.listenQuery=!1,t&&(this.listenQuery=!0,this._unsubscribeDv=!1,this.loadMoreData()),this.invokeEventCallback("clearsearch"),this._loadingItems=!1,e&&this.$element.find(".app-search-input").focus()},t.prototype.clearText=function(){this.query="",this.showClosebtn=!1},t.prototype.closeSearch=function(){this._loadingItems=!1,this.page=1,this.insertAtIndex(this.elIndex),this.elIndex=void 0,this.parentEl=void 0,this.$element.removeClass("full-screen"),this._domUpdated&&(this._domUpdated=!1),this.listenQuery=!1,this._unsubscribeDv=!0,this.typeahead.hide()},t.prototype.renderMobileAutoComplete=function(){l.isDefined(this.elIndex)||(this.parentEl=this.$element.parent(),this.elIndex=this.parentEl.children().index(this.$element)),this.$element.hasClass("full-screen")||(this._domUpdated=!0,this.$element.addClass("full-screen"),"inline"===this.position&&this.$element.addClass(this.position)),this.$element.hasClass("full-screen")&&this.$element.find(".app-search-input").focus()},t.prototype.getDataSourceAsObservable=function(e){if(this._lastQuery===e&&!_.get(this.dataoptions,"filterFields")&&l.isDefined(this._lastResult))return this._loadingItems=!1,a.of(this._lastResult);if("autocomplete"===this.type&&this.searchkey&&this.query&&this.datavalue){var t=[],n=_.split(this.searchkey,","),i=void 0;if(this.binddisplaylabel&&1===(t=_.split(this.binddisplaylabel,"+")).length)if(_.includes(t[0],"|"))i=!0;else{i=/\[(.*?)\]/.exec(t[0])[1]}if(t.length>1||i&&!_.includes(n,i)||this.displayexpression&&!_.includes(n,this.displayexpression))return this._loadingItems=!1,a.of([])}return this._lastQuery=this.query,a.from(this.getDataSource(e))},t.prototype.handleEvent=function(t,n,i,o){_.includes(["blur","focus","select","submit","change"],n)||e.prototype.handleEvent.call(this,t,n,i,o)},t.prototype.highlight=function(e,t){if(this.typeaheadContainer)return e.value=e.item.label.toString(),this.typeaheadContainer.highlight(e,t)},t.prototype.insertAtIndex=function(e){0===e?this.parentEl.prepend(this.$element):this.parentEl.children().eq(e).length?this.$element.insertBefore(this.parentEl.children().eq(e)):this.$element.insertAfter(this.parentEl.children().eq(e-1))},t.prototype.isMobileAutoComplete=function(){return"autocomplete"===this.type&&l.isMobile()},t.prototype.isQueryEntered=function(){return this.showclear&&this.showClosebtn},t.prototype.loadMoreData=function(e){this.dataProvider.isLastPage||(this.page=e?this.page+1:this.page,this.isScrolled=!0,this._loadingItems=!0,e&&(this._lastQuery=void 0),this.typeahead.onInput({target:{value:_.trim(this.query)||"0"}}))},t.prototype.onFocusOut=function(){this._unsubscribeDv=!1,this._loadingItems=!1,this.page=1,!this._domUpdated&&this._isOpen&&(this.listenQuery=!1),this._isOpen=!1,this._domUpdated&&this.typeahead&&this.typeahead._container&&(this.typeahead._container.isFocused=!0)},t.prototype.onInputChange=function(e){this.result=[],this.page=1,this.listenQuery=this.isUpdateOnKeyPress(),this._modelByValue=void 0,""===this.query?(this.queryModel="",this._modelByValue="",this.updatePrevDatavalue(this._lastQuery),this.invokeOnChange(this._modelByValue,{},!0),this.invokeEventCallback("clear",{$event:e}),e&&9!==e.which&&this.invokeEventCallback("submit",{$event:e})):this.invokeEventCallback("change",{$event:e,newVal:this._modelByValue||this.query,oldVal:this.prevDatavalue}),this.showClosebtn=""!==this.query},t.prototype.handleEnterEvent=function(e){_.get(this.typeahead,"matches.length")||this.onSearchSelect(e)},t.prototype.onSearchSelect=function(e){var t,n,i,o=(null===(n=null===(t=this.typeaheadContainer)||void 0===t?void 0:t.active)||void 0===n?void 0:n.value)===this.query;if(this.typeaheadContainer&&this.typeaheadContainer.active&&o&&(i=this.typeaheadContainer.active.item),e=this.eventData(e,i||{}),!this.isUpdateOnKeyPress())return this.listenQuery=!0,void this.typeahead.onInput({target:{value:this.query}});this.typeaheadContainer&&this.liElements.length&&o?this.typeaheadContainer.selectActiveMatch():(this.queryModel=this.query,this.invokeEventCallback("submit",{$event:e}))},t.prototype.invokeOnBeforeServiceCall=function(e){this.invokeEventCallback("beforeservicecall",{inputData:e})},t.prototype.onDropdownOpen=function(){var e=this;if(this.clearData&&this.typeahead.hide(),_.debounce((function(){e._isOpen=!0,e.typeaheadContainer=e.typeahead._container||e.typeahead._typeahead.instance,e.typeaheadContainer.liElements=e.liElements,e.typeaheadContainer.ulElement=e.ulElement,l.adjustContainerPosition($("typeahead-container"),e.nativeElement,e.typeahead._typeahead,$("typeahead-container .dropdown-menu"))}))(),this.isMobileAutoComplete()){this.$element.hasClass("full-screen")||this.renderMobileAutoComplete();var t=this.dropdownEl.closest("typeahead-container");t.insertAfter(this.$element.find("input").first());var n=this.$element.closest(".app-content").height();t.css({position:"relative",top:0,height:n+"px"}),this.showClosebtn=this.query&&""!==this.query,_.isUndefined(this.dataProvider.isLastPage)||this.dataProvider.isLastPage||this.triggerSearch()}},t.prototype.selectNext=function(){var e=this.typeaheadContainer.matches;if(e){var t=e.indexOf(this.typeaheadContainer.active);!this._loadingItems&&!this.dataProvider.isLastPage&&t+1>e.length-1&&(this.lastSelectedIndex=t,this.loadMoreData(!0))}},t.prototype.setLastActiveMatchAsSelected=function(){this.lastSelectedIndex&&(this.typeaheadContainer._active=this.typeaheadContainer.matches[this.lastSelectedIndex],this.typeaheadContainer.nextActiveMatch(),this.lastSelectedIndex=void 0)},t.prototype.triggerSearch=function(){if(!this.dataProvider.isLastPage&&this.$element.hasClass("full-screen")){var e=this.dropdownEl,t=e.find("li").last();t.length&&e.length&&e.height()+e.position().top>t.height()+t.position().top&&this.loadMoreData(!0)}},t.prototype.isUpdateOnKeyPress=function(){return"typing"===this.searchon},t.prototype.debounceDefaultQuery=function(e){var t=this;this._defaultQueryInvoked=!0,this.getDataSource(e,!0).then((function(e){e.length?(t.queryModel=e,t._lastQuery=t.query=t.queryModel[0].label||"",t._modelByValue=t.queryModel[0].value,t._modelByKey=t.queryModel[0].key,t.showClosebtn=""!==t.query):(t._modelByValue=void 0,t.queryModel=void 0,t.query=""),t.clearData&&_.get(t.typeahead,"_typeahead.isShown")&&t.typeahead.hide()}))},t.prototype.updateByDatavalue=function(e){this.updateByDataset(e),this.updateByDataSource(e)},t.prototype.updateByDataSource=function(e){if(l.isDefined(e)&&!_.isObject(e)&&this.datasource&&!l.isDefined(this._modelByKey)&&this.datafield!==r.ALLFIELDS){if(l.isDefined(this.queryModel)&&!_.isEmpty(this.queryModel))return void this.updateDatavalueFromQueryModel();!this._defaultQueryInvoked&&this.datasource.execute(l.DataSource.Operation.SUPPORTS_CRUD)&&this.debounceDefaultQuery(e)}},t.prototype.updateDatavalueFromQueryModel=function(){l.isDefined(this.queryModel)&&(this._modelByValue=_.isArray(this.queryModel)?this.queryModel[0].value:this.queryModel,this._modelByKey=_.isArray(this.queryModel)?this.queryModel[0].key:this.queryModel,this.toBeProcessedDatavalue=void 0)},t.prototype.updateByDataset=function(e){if(!this._defaultQueryInvoked||!this.searchkey){var t=_.find(this.datasetItems,(function(t){return _.isObject(t.value)?_.isEqual(t.value,e):_.toString(t.value).toLowerCase()===_.toString(e).toLowerCase()}));if(t)this.queryModel=[t];else if(this.datafield===r.ALLFIELDS&&_.isObject(e))this.queryModel=this.getTransformedData(r.extractDataAsArray(e));else if(this.prevDatavalue!==e)return this.queryModel=void 0,void(this.query="");this.updateDatavalueFromQueryModel(),this._lastQuery=this.query=l.isDefined(this.queryModel)&&this.queryModel.length?_.get(this.queryModel[0],"label"):"",this.showClosebtn=""!==this.query}},t.prototype.handleFocus=function(e){"search"===this.type&&this.query===this._lastQuery&&this._lastResult&&this.typeahead.keyUpEventEmitter.emit(this.query)},t.prototype.notifySubscriber=function(){var e=$(this.nativeElement).closest(".app-composite-widget.caption-floating");e.length>0&&this.app.notify("captionPositionAnimate",{displayVal:!0,nativeEl:e})},t.prototype.getDataSource=function(e,t,n){var i=this;if(t&&this.datafield===r.ALLFIELDS)return this._loadingItems=!1,Promise.resolve([]);var o={dataset:this.dataset?r.convertDataToObject(this.dataset):void 0,binddataset:this.binddataset,datasource:this.datasource,datafield:this.datafield,hasData:this.dataset&&this.dataset.length,query:e,isLocalFilter:!this.searchkey,searchKey:t?this.datafield:this.searchkey,matchMode:t?"startignorecase":this.matchmode,casesensitive:this.casesensitive,isformfield:this.isformfield,orderby:this.orderby,limit:this.limit,pagesize:this.pagesize,page:this.page,onBeforeservicecall:this.invokeOnBeforeServiceCall.bind(this)};return this.dataoptions&&(o.dataoptions=this.dataoptions,o.viewParent=this.viewParent),this._loadingItems=!0,this.dataProvider.filter(o).then((function(e){e=e.data||e,l.isDefined(i.dataset)&&i.dataset.length||!i.dataProvider.updateDataset||(i.dataset=e),i.dataProvider.hasMoreData?i.formattedDataset=i.formattedDataset.concat(e):i.formattedDataset=e,i.formattedDataset.length>20&&!l.isDefined(i.limit)&&(i.typeahead.typeaheadOptionsLimit=i.formattedDataset.length),i._isOpen&&i.isMobileAutoComplete()&&!_.isUndefined(i.dataProvider.isLastPage)&&!i.dataProvider.isLastPage&&i.triggerSearch();var t=i.getTransformedData(i.formattedDataset,n);return i.result=_.map(t,"value"),t}),(function(e){return i._loadingItems=!1,[]})).then((function(t){return i.isScrolled&&(_.debounce((function(){i.setLastActiveMatchAsSelected()}),30)(),i.isScrolled=!1),t.length||(i._modelByValue=void 0,i.queryModel=e),i._unsubscribeDv&&(t=[]),i._loadingItems=!1,i._lastResult=t,t}))},t.prototype.getContext=function(e){return e&&_.get(e,"widget")?this.getContext(e.viewParent):e},t.prototype.getTransformedData=function(e,t,n){l.isDefined(t)&&t++;var i=r.transformFormData(this.getContext(this.viewParent),e,this.datafield,{displayField:this.displaylabel||this.displayfield,displayExpr:n?"":this.displayexpression,bindDisplayExpr:n?"":this.binddisplaylabel,bindDisplayImgSrc:this.binddisplayimagesrc,displayImgSrc:this.displayimagesrc},t,this);return r.getUniqObjsByDataField(i,this.datafield,this.displayfield||this.displaylabel,l.toBoolean(this.allowempty))},t.prototype.onScroll=function(e,t){var n=e.scrollHeight,i=e.clientHeight;!this._loadingItems&&!this.dataProvider.isLastPage&&e.scrollTop+i>=n&&this.loadMoreData(!0)},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),l.isDefined(this.minchars)||("autocomplete"===this.type?this.minchars=0:this.minchars=1),this.listenQuery=this.isUpdateOnKeyPress(),this.showsearchicon=l.isDefined(this.showsearchicon)?this.showsearchicon:"search"===this.type},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),r.styler(this.nativeElement,this),this.containerTarget=r.getContainerTargetClass(this.nativeElement)},t.prototype.eventData=function(e,t){return e&&(e.data={item:t.dataObject,model:t.value,label:t.label,query:this.query}),e},t.prototype.typeaheadOnSelect=function(e,t){var n=e.item;this.queryModel=n,n.selected=!0,this.query=n.label,this.showClosebtn=""!==this.query,t=t||this.$typeaheadEvent,this._modelByKey=n.key,this._modelByValue=n.value,t=this.eventData(t,n),this.invokeOnTouched(),this.invokeOnChange(this.datavalue,t||{}),this.datavalue!==this.prevDatavalue&&this.updateBoundVariable(this.datavalue),this.$element.hasClass("full-screen")&&this.closeSearch(),this.invokeEventCallback("select",{$event:t,selectedValue:this.datavalue}),this.invokeEventCallback("submit",{$event:t}),this.updatePrevDatavalue(this.datavalue)},t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("autocomplete"===this.type&&"displaylabel"===t&&this.displaylabel&&(!this.displayexpression||this.displayexpression&&!this.datasource)&&(this.displayexpression=this.displaylabel,this.displaylabel=void 0),"displaylabel"===t&&this.dataoptions&&null===this.binddisplaylabel&&(this.query=_.get(this._modelByValue,n)||this._modelByValue),"disabled"===t&&(!1===n?this.clearData=!1:(this.clearData=!0,_.get(this.typeahead,"_typeahead.isShown")&&this.typeahead.hide())),e.prototype.onPropertyChange.call(this,t,n,i))},t}(c.DatasetAwareFormComponent);b.initializeProps=m(),b.decorators=[{type:t.Component,args:[{selector:"[wmSearch]",template:'<ng-template #customItemTemplate let-model="item" let-index="index" let-query="query" let-match="match">\n \x3c!-- Default item template --\x3e\n <a *ngIf="!content">\n <img *ngIf="model.imgSrc" [src]="model.imgSrc" alt="Search" [style.width]="imagewidth">\n <span [title]="model.label" [innerHtml]="highlight(match, query) || model.label"></span>\n </a>\n \x3c!-- Custom partial template --\x3e\n <a *ngIf="content" [ngClass]="{customTemplate: content}" partialContainer [wmItemTemplate]="content" [userComponentParams]="match.item">\n <div partial-container-target></div>\n </a>\n</ng-template>\n\n<ng-template #customListTemplate let-matches="matches" let-itemTemplate="itemTemplate" let-query="query">\n <ul #ulElement class="app-search dropdown-menu" scrollable>\n <li #liElements *ngFor="let match of matches" [ngClass]="{active: typeaheadContainer && typeaheadContainer.isActive(match), \'list-group-header\': match && match.isHeader()}"\n (mouseenter)="typeaheadContainer.selectActive(match);"\n (click)="match && !match.isHeader() && typeaheadContainer.selectMatch(match, $event); $typeaheadEvent = $event; notifySubscriber();">\n \x3c!-- itemTemplate comes from the <input> --\x3e\n <h4 *ngIf="match.isHeader()" class="group-title">{{match.value}}</h4>\n <ng-container *ngIf="!match.isHeader()" [ngTemplateOutlet]="itemTemplate"\n [ngTemplateOutletContext]="{item: match.item, index: i, match: match, query: query}">\n </ng-container>\n </li>\n <div class="status" [hidden]="_loadingItems || !(datacompletemsg && dataProvider.isLastPage)">\n <span [textContent]="datacompletemsg"></span>\n </div>\n <div class="status" [hidden]="!_loadingItems">\n <i class="fa fa-circle-o-notch fa-spin"></i>\n <span [textContent]="loadingdatamsg"></span>\n </div>\n </ul>\n</ng-template>\n\n\x3c!--This template is for search inside mobile navbar.--\x3e\n<ng-container *ngIf="navsearchbar; else searchTemplate">\n <input [title]="query || \'\'" type="text" class="app-textbox form-control list-of-objs app-search-input" [placeholder]="placeholder || \'\'"\n focus-target\n container="body"\n [disabled]="disabled"\n autocomplete="off"\n [(ngModel)]="query"\n [readonly]="readonly"\n [disabled]="disabled"\n [typeahead]="typeaheadDataSource"\n [typeaheadWaitMs]="debouncetime"\n [typeaheadItemTemplate]="customItemTemplate"\n [optionsListTemplate]="customListTemplate"\n (input)="onInputChange($event)"\n (keydown)="listenQuery = true"\n (keydown.enter)="$typeaheadEvent = $event;handleEnterEvent($event)"\n (keydown.arrowdown)="selectNext($event)"\n (blur)="invokeOnTouched($event)"\n (click)="handleFocus($event);"\n (focus)="_unsubscribeDv = false; listenQuery = true; handleFocus($event); invokeOnFocus($event);"\n (focusout)="onFocusOut()"\n [typeaheadMinLength]="minchars"\n [typeaheadOptionsLimit]="limit"\n (typeaheadLoading)="_loadingItems"\n (typeaheadOnSelect)="typeaheadOnSelect($event)"\n typeaheadOptionField="label"\n [typeaheadGroupField]="groupby ? \'groupby\' : null"\n [typeaheadAsync]="true"\n [typeaheadScrollable]="true"\n [typeaheadOptionsInScrollableView]="optionslimitinscrollableview"\n [dropup]="dropup"\n [tabindex]="tabindex"\n [attr.name]="name"\n [attr.aria-label]="hint || \'Search field\'"/>\n <i class="btn-close wi wi-cancel" [hidden]="!showClosebtn" (click)="clearSearch($event);"></i>\n</ng-container>\n\x3c!--This template is for both web and fullscreen mode in mobile.--\x3e\n<ng-template #searchTemplate>\n <span class="wi wi-arrow-left form-control-feedback back-btn" aria-hidden="true" (click)="closeSearch()"></span>\n <span class="sr-only">Back button</span>\n <input [title]="query || \'\'" type="text" class="app-textbox form-control list-of-objs app-search-input" [placeholder]="placeholder || \'\'"\n focus-target\n [container]="containerTarget || \'body\'"\n [disabled]="disabled"\n autocomplete="off"\n [(ngModel)]="query"\n [readonly]="readonly"\n [typeahead]="typeaheadDataSource"\n [typeaheadWaitMs]="debouncetime"\n [typeaheadItemTemplate]="customItemTemplate"\n [optionsListTemplate]="customListTemplate"\n (input)="onInputChange($event)"\n (keydown)="listenQuery = true"\n (keydown.enter)="$typeaheadEvent = $event;handleEnterEvent($event)"\n (keydown.arrowdown)="selectNext($event)"\n (blur)="invokeOnTouched($event); onFocusOut()"\n (click)="handleFocus($event);"\n (focus)="_unsubscribeDv = false; listenQuery = true; handleFocus($event); invokeOnFocus($event)"\n [typeaheadMinLength]="minchars"\n [typeaheadOptionsLimit]="limit"\n (typeaheadLoading)="_loadingItems"\n (typeaheadOnSelect)="typeaheadOnSelect($event)"\n typeaheadOptionField="label"\n [typeaheadGroupField]="groupby ? \'groupby\' : null"\n [typeaheadAsync]="true"\n [typeaheadScrollable]="true"\n [typeaheadOptionsInScrollableView]="optionslimitinscrollableview"\n [tabindex]="tabindex"\n [dropup]="dropup"\n [attr.name]="name"\n [attr.aria-label]="hint || \'Search field\'">\n <input class="model-holder" ng-model="proxyModel" ng-required="required" tabindex="-1" aria-hidden="true">\n <span *ngIf="_loadingItems" aria-hidden="true" class="fa fa-circle-o-notch fa-spin form-control-feedback"></span>\n <span class="wi wi-close form-control-feedback clear-btn" [ngClass]="{\'show-btn\': isQueryEntered()}" (click)="clearSearch($event, true)"></span>\n <span class="sr-only">Clear button</span>\n <span *ngIf="showsearchicon" class="input-group-addon" aria-label="search icon" [ngClass]="{\'disabled\': disabled}">\n <form>\n <button title="Search" [disabled]="disabled" class="app-search-button wm-sl-l sl-search" type="submit"\n (click)="onSearchSelect($event)"></button>\n </form>\n </span>\n</ng-template>\n',providers:[r.provideAs(b,i.NG_VALUE_ACCESSOR,!0),r.provideAs(b,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(b)]}]}],b.ctorParameters=function(){return[{type:t.Injector},{type:l.App},{type:void 0,decorators:[{type:t.Attribute,args:["datavalue.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["dataset.bind"]}]}]},b.propDecorators={typeahead:[{type:t.ViewChild,args:[o.TypeaheadDirective]}],ulElement:[{type:t.ViewChild,args:["ulElement"]}],liElements:[{type:t.ViewChildren,args:["liElements"]}]};var w=function(){function e(e,n){this.searchRef=n,this.elementRef=e.get(t.ElementRef)}return e.prototype.ngAfterContentInit=function(){this.elementRef.nativeElement.addEventListener("scroll",this.notifyParent.bind(this)),this.searchRef.dropdownEl=$(this.elementRef.nativeElement),this.searchRef.onDropdownOpen()},e.prototype.ngAfterViewInit=function(){if(!this.searchRef.isMobileAutoComplete()){var e=this.searchRef.$element.find("input").first();this.searchRef.dropdownEl.width(e.outerWidth())}},e.prototype.notifyParent=function(e){this.searchRef.onScroll(this.elementRef.nativeElement,e)},e}();w.decorators=[{type:t.Directive,args:[{selector:"[scrollable]"}]}],w.ctorParameters=function(){return[{type:t.Injector},{type:b}]};var P=[b,w],O=function(){};O.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,o.TypeaheadModule,r.WmComponentsModule],declarations:d([],u(P)),exports:d([],u(P)),entryComponents:[]}]}],e.ScrollableDirective=w,e.SearchComponent=b,e.SearchModule=O,e["\u0275a"]=m,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("@wm/core")):"function"==typeof define&&define.amd?define("@wm/components/basic/tree",["exports","@angular/core","@angular/common","@wm/components/base","@wm/core"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.basic=e.wm.components.basic||{},e.wm.components.basic.tree={}),e.ng.core,e.ng.common,e.wm.components.base,e.wm.core)}(this,(function(e,t,n,i,o){"use strict";
|
|
114
114
|
/*! *****************************************************************************
|
|
115
115
|
Copyright (c) Microsoft Corporation.
|
|
116
116
|
|
|
@@ -194,7 +194,7 @@
|
|
|
194
194
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
195
195
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
196
196
|
PERFORMANCE OF THIS SOFTWARE.
|
|
197
|
-
***************************************************************************** */var d=function(e,t){return(d=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 h(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}d(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}Object.create;function m(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function f(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o<r;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 g=function(){function e(e,n){this.inj=e,this.bsModalService=n,this.isDateOpen=!0,this.isTimeOpen=!1,this.mode="DATE_TIME",this.placement="MODAL",this.change=new t.EventEmitter,this._value=new Date,this.changedValue=null,this.appLocale=e.get(c.App).appLocale||{}}return Object.defineProperty(e.prototype,"value",{set:function(e){e=e||new Date,this._value=e,this.changedValue=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bsDatepickerConfig",{get:function(){return this._bsDatepickerConfig},set:function(e){this._bsDatepickerConfig=e,this._bsDatepickerConfig.showClearButton=!1,this._bsDatepickerConfig.showTodayButton=!1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"excludedDaysToDisable",{set:function(e){this._bsDatepickerConfig.daysDisabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"displayFormat",{get:function(){if(this._displayFormat)return this._displayFormat},set:function(e){e&&(this._displayFormat=e.replace(/y/g,"Y").replace(/d/g,"D").replace("a","A"))},enumerable:!1,configurable:!0}),e.prototype.validateSelectedDate=function(){var e,t,n,i,o;if(!this.changedValue)return!0;var r=moment(this.changedValue),a=null===(e=this._bsDatepickerConfig)||void 0===e?void 0:e.minDate,s=null===(t=this._bsDatepickerConfig)||void 0===t?void 0:t.maxDate;if(a&&("DATE"===this.mode&&moment(a).startOf("day").toDate()>this.changedValue||"DATE"!==this.mode&&a>this.changedValue))return!1;if(s&&("DATE"===this.mode&&moment(s).endOf("day").toDate()<this.changedValue||"DATE"!==this.mode&&s<this.changedValue))return!1;if((null===(i=null===(n=this._bsDatepickerConfig)||void 0===n?void 0:n.daysDisabled)||void 0===i?void 0:i.indexOf(r.day()))>=0)return!1;var l=r.startOf("day").toDate().getTime();return!(null===(o=this.excludedDatesToDisable)||void 0===o?void 0:o.find((function(e){return e.getTime()===l})))},e.prototype.hightlightToday=function(){var e=(new Date).getDate().toString();_.filter($("body>modal-container .date-picker-modal span:contains("+e+")").not(".is-other-month,.current-date"),(function(t){$(t).text()===e&&$(t).addClass("current-date text-info")}))},e.prototype.hideOnClick=function(){var e=this;$("body>modal-container .date-picker-modal .app-datetime-picker").click((function(e){return e.stopPropagation()})),$("body>modal-container .date-picker-modal").click((function(){return e.onCancelClick()}))},e.prototype.getDateLabel=function(){return moment(this.changedValue).format(this.displayFormat)},e.prototype.openDatePicker=function(){this.isTimeOpen=!1,this.isDateOpen=!0},e.prototype.openTimePicker=function(){this.isTimeOpen=!0,this.isDateOpen=!1},e.prototype.onDateUpdate=function(e){var t=this.changedValue;"DATE"===this.mode?(e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0)):t&&e&&(e.setHours(t.getHours()),e.setMinutes(t.getMinutes()),e.setSeconds(t.getSeconds()),e.setMilliseconds(t.getMilliseconds())),this.changedValue=e,"DATE"===this.mode&&t!==e&&this.validateSelectedDate()&&this.onOkClick()},e.prototype.onTimeUpdate=function(e){this.changedValue=e},e.prototype.show=function(){var e=this;this.reset(),this.modalRef=this.bsModalService.show(this.datetimepickerTemplate,{animated:!0,backdrop:"static",class:"date-picker-modal modal-dialog-centered"}),setTimeout((function(){e.hideOnClick()}),500)},e.prototype.clear=function(){this.changedValue=null,this.triggerChange(),this.hideModal()},e.prototype.setToday=function(){var e=moment().startOf("day").toDate();this.onDateUpdate(e)},e.prototype.reset=function(){this.changedValue=this._value},e.prototype.hideModal=function(){var e;(null===(e=this.modalRef)||void 0===e?void 0:e.id)&&this.bsModalService.hide(this.modalRef.id)},e.prototype.onCancelClick=function(){this.changedValue=this._value,this.hideModal()},e.prototype.onOkClick=function(){this.validateSelectedDate()&&this.triggerChange(),this.hideModal()},e.prototype.triggerChange=function(){this.value!==this.changedValue&&this.change.emit(this.changedValue)},e.prototype.ngAfterViewInit=function(){},e.prototype.ngOnDestroy=function(){this.hideModal()},e}();g.decorators=[{type:t.Component,args:[{selector:"wm-datetimepicker",template:'\n <ng-template #datetimepickerTemplate>\n <div class="app-datetime-picker">\n <div class="modal-body">\n <div class="mobile-datetime-picker-options">\n\n </div>\n <bs-datepicker-inline\n [bsConfig]="bsDatepickerConfig"\n [datesDisabled]="excludedDatesToDisable"\n bsDatepicker\n [bsValue]="changedValue"\n (bsValueChange)="onDateUpdate($event)"\n *ngIf="mode === \'DATE_TIME\' || mode === \'DATE\'">\n </bs-datepicker-inline>\n <wm-timepicker\n [value]="changedValue"\n [min]="minTime"\n [max]="maxTime"\n (change)="onTimeUpdate($event)"\n *ngIf="mode === \'DATE_TIME\' || mode === \'TIME\'"></wm-timepicker>\n <span class="text-primary date-picker-value">\n {{getDateLabel()}}\n </span>\n </div>\n <div class="modal-footer">\n <button\n *ngIf="mode === \'DATE_TIME\' || mode === \'DATE\'"\n class="btn btn-secondary today-btn"\n (click)="setToday()">{{appLocale.LABEL_TODAY_DATE || "Today" }}</button>\n <button\n class="btn btn-primary pull-right ok-btn"\n *ngIf="mode === \'DATE_TIME\' || mode === \'TIME\'"\n (click)="onOkClick()">{{appLocale.LABEL_OK || "Ok" }}</button>\n <button\n class="btn btn-secondary pull-right clear-btn"\n (click)="clear()">{{appLocale.LABEL_CLEAR_DATE || "Clear" }}</button>\n </div>\n </div>\n </ng-template>\n '}]}],g.ctorParameters=function(){return[{type:t.Injector},{type:u.BsModalService}]},g.propDecorators={datetimepickerTemplate:[{type:t.ViewChild,args:["datetimepickerTemplate",{static:!0}]}],mode:[{type:t.Input}],placement:[{type:t.Input}],_bsDatepickerConfig:[{type:t.Input,args:["config"]}],minTime:[{type:t.Input}],maxTime:[{type:t.Input}],_displayFormat:[{type:t.Input}],change:[{type:t.Output}],excludedDatesToDisable:[{type:t.Input}],value:[{type:t.Input}],bsDatepickerConfig:[{type:t.Input,args:["config"]}],excludedDaysToDisable:[{type:t.Input}],displayFormat:[{type:t.Input}]};var v=function(){function e(e){this.inj=e,this.options={hour:[],minute:[],second:[],meridian:["AM","PM"]},this.value=new Date,this.min=null,this.max=null,this.change=new t.EventEmitter,this.options.hour=this.populateNumbers(0,23),this.options.minute=this.populateNumbers(0,59),this.options.second=this.populateNumbers(0,59)}return e.prototype.populateNumbers=function(e,t){for(var n=[],i=e;i<=t;i++)n.push({label:(i<10?"0":"")+i,value:i});return n},e.prototype.set=function(e,t){e.index;var n=e.value;"HOUR"===t?this.value=moment(this.value).hour(parseInt(n)).toDate():"MINUTE"===t?this.value=moment(this.value).minute(parseInt(n)).toDate():"SECOND"===t?this.value=moment(this.value).second(parseInt(n)).toDate():"MERIDIAN"===t&&(this.value=moment(this.value).minute(n).toDate()),this.min&&this.value<this.min&&(this.value=this.min),this.max&&this.value>this.max&&(this.value=this.max),this.change.emit(this.value)},Object.defineProperty(e.prototype,"hour",{get:function(){return moment(this.value).hour()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minute",{get:function(){return moment(this.value).minute()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"second",{get:function(){return moment(this.value).second()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"meridian",{get:function(){return"AM"},enumerable:!1,configurable:!0}),e.prototype.onDateUpdate=function(e){},e.prototype.ngAfterViewInit=function(){},e}();v.decorators=[{type:t.Component,args:[{selector:"wm-timepicker",template:'\n <wm-pickergroup>\n <wm-picker\n [options]="options.hour"\n [selectedValue]="hour"\n (change)="set($event, \'HOUR\')"></wm-picker>\n <span class="app-time-separator">:</span>\n <wm-picker\n [options]="options.minute"\n [selectedValue]="minute"\n (change)="set($event, \'MINUTE\')"></wm-picker>\n <span class="app-time-separator">:</span>\n <wm-picker\n [options]="options.minute"\n [selectedValue]="second"\n (change)="set($event, \'SECOND\')"></wm-picker>\n </wm-pickergroup>\n '}]}],v.ctorParameters=function(){return[{type:t.Injector}]},v.propDecorators={value:[{type:t.Input}],min:[{type:t.Input}],max:[{type:t.Input}],change:[{type:t.Output}]};var y="CURRENT_DATE",b=["January","February","March","April","May","June","July","August","September","October","November","December"],w="default",P="default";function O(e){return Object.assign(new a.TimepickerConfig,{meridians:n.getLocaleDayPeriods(e.getSelectedLocale(),n.FormStyle.Format,n.TranslationWidth.Abbreviated)})}var S=function(e){function t(t,i){var r=e.call(this,t,i)||this;return r.isReadOnly=!1,r.clicked=!1,r.formatsByLocale={timezone:""},r._dateOptions=new o.BsDatepickerConfig,r.i18nService=r.inj.get(c.AbstractI18nService),r.invokeEventCallback("beforeload"),r.datePipe=r.inj.get(s.ToDatePipe),r.selectedLocale=r.i18nService.getSelectedLocale(),r._dateOptions.todayPosition="left",r._dateOptions.clearPosition="right",r.meridians=n.getLocaleDayPeriods(r.selectedLocale,n.FormStyle.Format,n.TranslationWidth.Abbreviated),r.loadNativeDateInput=c.isMobile()&&!r.showcustompicker,r.cancelLocaleChangeSubscription=r.getAppInstance().subscribe("locale-changed",(function(e){r.datePipe.datePipe.locale=e.angular,r._dateOptions.todayButtonLabel=r.i18nService.getLocalizedMessage("LABEL_TODAY_DATE"),r._dateOptions.clearButtonLabel=r.i18nService.getLocalizedMessage("LABEL_CLEAR_DATE")})),r}return h(t,e),Object.defineProperty(t.prototype,"timeZone",{get:function(){return this.inj.get(c.AbstractI18nService).getTimezone(this)},enumerable:!1,configurable:!0}),t.prototype.isDropDownDisplayEnabledOnInput=function(e){return e===w},t.prototype.isDataEntryModeEnabledOnInput=function(e){return e===P},t.prototype.showValidation=function(e,t,n,i){if(n)return console.warn("min max date validation failed ",i),$(e.target).val(t)},t.prototype.resetDisplayInput=function(){$(this.nativeElement).find(".display-input").val("")},t.prototype.validate=function(e){return this.invalidDateTimeFormat?{invalidDateTimeFormat:{valid:!1}}:!_.isUndefined(this.dateNotInRange)&&this.dateNotInRange?{dateNotInRange:{valid:!1}}:!_.isUndefined(this.timeNotInRange)&&this.timeNotInRange?{timeNotInRange:{valid:!1}}:this.show&&this.required?e.value?null:{required:!0}:(this.validateType="",null)},t.prototype.formatValidation=function(e,t,n){var i=this.datepattern||this.timepattern,o=this.timeZone,r=c.getFormattedDate(this.datePipe,e,i,o,null,null,this);if(t=t.trim())if("timestamp"===i){if(!_.isNaN(t)&&_.parseInt(t)!==r)return this.invalidDateTimeFormat=!0,this.validateType="incorrectformat",this.invokeOnChange(this.datavalue,void 0,!1),!1}else if(n&&(t=c.getFormattedDate(this.datePipe,t,i,o)),t!==r)return this.invalidDateTimeFormat=!0,this.validateType="incorrectformat",this.invokeOnChange(this.datavalue,void 0,!1),!1;return!0},t.prototype.minDateMaxDateValidationOnInput=function(e,t,n,i){var o=this;if(e){var r=e;e=moment(e).startOf("day").toDate();var a=moment(c.getDateObj(this.mindate)).startOf("day").toDate(),s=moment(c.getDateObj(this.maxdate)).startOf("day").toDate();if(this.mindate&&e<a){var l=this.appLocale.LABEL_MINDATE_VALIDATION_MESSAGE+" "+this.mindate+".";return this.invokeOnChange(this.datavalue,void 0,!1),i&&c.getFormattedDate(this.datePipe,a,this.datepattern,this.timeZone,null,null,this)===n?$(t.target).val(n):(this.dateNotInRange=!0,this.validateType="mindate",this.showValidation(t,n,i,l))}if(this.maxdate&&e>s){l=this.appLocale.LABEL_MAXDATE_VALIDATION_MESSAGE+" "+this.maxdate+".";return this.invokeOnChange(this.datavalue,void 0,!1),i&&c.getFormattedDate(this.datePipe,s,this.datepattern,this.timeZone,null,null,this)===n?$(t.target).val(n):(this.dateNotInRange=!0,this.validateType="maxdate",this.showValidation(t,n,i,l))}if(this.excludedates){if((c.isString(this.excludedates)?_.split(this.excludedates,","):this.excludedates).map((function(e){return c.getFormattedDate(o.datePipe,e,o.datepattern,o.timeZone,null,null,o)})).indexOf(c.getFormattedDate(this.datePipe,r,this.datepattern,this.timeZone,null,null,this))>-1)return this.dateNotInRange=!0,this.validateType="excludedates",void this.invokeOnChange(this.datavalue,void 0,!1)}if(this.excludedays){var p=_.split(this.excludedays,","),u=_.get(r,"getDay")?r.getDay():r;if(p.indexOf(u.toString())>-1)return this.dateNotInRange=!0,this.validateType="excludedays",void this.invokeOnChange(this.datavalue,void 0,!1)}}i||(this.dateNotInRange=!1,this.invokeOnChange(this.datavalue,void 0,!1))},t.prototype.hightlightToday=function(){var e=(new Date).getDate().toString();_.filter($("span:contains("+e+")").not(".is-other-month"),(function(t){$(t).text()===e&&$(t).addClass("current-date text-info")}))},t.prototype.isOtheryear=function(e){return 0===e.getMonth()&&11===this.activeDate.getMonth()||11===e.getMonth()&&0===this.activeDate.getMonth()},t.prototype.setActiveDateFocus=function(e,t){var n=this;this.setNextData(e);var i=this.activeDate.getMonth();t||(e.getMonth()<i?this.isOtheryear(e)?this.goToOtherMonthOryear("next","days"):this.goToOtherMonthOryear("previous","days"):e.getMonth()>i&&(this.isOtheryear(e)?this.goToOtherMonthOryear("previous","days"):this.goToOtherMonthOryear("next","days"))),setTimeout((function(){var t=e.getDate().toString();_.filter($("span:contains("+t+")").not(".is-other-month"),(function(i){$(i).text()===t&&($(i).hasClass("selected")&&$(i).parent().attr("aria-selected","true"),$(i).attr("aria-label",moment(e).format("dddd, MMMM Do YYYY")),$("[bsdatepickerdaydecorator]").not(".is-other-month").attr("tabindex","-1"),$(i).attr("tabindex","0"),$(i).focus(),n.activeDate=e)})),e.getMonth()===(new Date).getMonth()&&e.getFullYear()===(new Date).getFullYear()&&n.hightlightToday()}))},t.prototype.goToOtherMonthOryear=function(e,t){var n=$(".bs-datepicker-head ."+e);n.attr("disabled")||(n.trigger("click"),"days"===t?this.loadDays():"month"===t?this.loadMonths():"year"===t&&this.loadYears())},t.prototype.getMonth=function(e,t){var n=new Date(e),i=n.getMonth(),o=n.getFullYear(),r=new Date(o,i+=t),a=r.toLocaleString("en-US",{month:"long"});return{date:r,fullMonth:a}},t.prototype.addDatepickerMouseEvents=function(){var e=this,t=$(".bs-datepicker-head");t.find(".previous").click((function(t){e.next=e.getMonth(e.activeDate,0),e.prev=e.getMonth(e.activeDate,-2),e.clicked=!0,t.originalEvent&&e.setFocusForDate(-1);var n=e.getMonth(e.activeDate,-1);$(".bs-datepicker-head .previous").prepend('<p aria-hidden="false" class="sr-only">Changed to Previous Month, '+n.fullMonth+" and year "+n.date.getFullYear()+"</p>"),setTimeout((function(){$(".bs-datepicker-head .previous").focus()}))})),t.find(".next").click((function(t){e.next=e.getMonth(e.activeDate,2),e.prev=e.getMonth(e.activeDate,0),e.clicked=!0,t.originalEvent&&e.setFocusForDate(1);var n=e.getMonth(e.activeDate,1);$(".bs-datepicker-head .next").prepend('<p aria-hidden="false" class="sr-only">Changed to Next Month, '+n.fullMonth+" and year "+n.date.getFullYear()+"</p>"),setTimeout((function(){$(".bs-datepicker-head .next").focus()}))})),t.find(".current").click((function(t){t.originalEvent&&e.setFocusForCurrentMonthOryear()})),$(".bs-datepicker-body, .bs-datepicker-action-buttons").click((function(t){t.stopPropagation(),t.originalEvent&&e.setFocusForMonthOrDay()})),this.clicked||(t.find(".next").attr("aria-label","Next Month, "+this.next.fullMonth+" "+this.next.date.getFullYear()),t.find(".previous").attr("aria-label","Previous Month, "+this.prev.fullMonth+" "+this.prev.date.getFullYear()))},t.prototype.setFocusForMonthOrDay=function(){var e=$(".bs-datepicker-head .current").first().text(),t=$(".bs-datepicker-body");if(t.find("table.months").length>0){_.parseInt(e)!==this.activeDate.getFullYear()&&this.loadMonths();var n=new Date(_.parseInt(e),this.activeDate.getMonth(),this.activeDate.getDate());this.setActiveMonthFocus(n,!0)}else if(t.find("table.days").length>0){var i=b.indexOf(e);i!==this.activeDate.getMonth()&&this.loadDays();n=new Date(this.activeDate.getFullYear(),i,1);this.setActiveDateFocus(n,!0)}},t.prototype.setFocusForCurrentMonthOryear=function(){var e=$(".bs-datepicker-body");e.find("table.months").length>0?(this.loadMonths(),this.setActiveMonthFocus(this.activeDate,!0)):e.find("table.years").length>0&&(this.loadYears(),this.setActiveYearFocus(this.activeDate,!0))},t.prototype.setFocusForDate=function(e){var t=$(".bs-datepicker-body");if(t.find("table.months").length>0){this.loadMonths();var n=new Date(this.activeDate.getFullYear()+e,0,this.activeDate.getDate());this.setActiveMonthFocus(n,!0)}else if(t.find("table.years").length>0){this.loadYears();var i=t.find("table.years span").first().text();n=new Date(_.parseInt(i),this.activeDate.getMonth(),this.activeDate.getDate());this.setActiveYearFocus(n,!0)}else if(t.find("table.days").length>0){this.loadDays();n=new Date(this.activeDate.getFullYear(),this.activeDate.getMonth()+e,1);this.setActiveDateFocus(n,!0)}},t.prototype.addDatepickerKeyboardEvents=function(e,t){var n=this;this.keyEventPluginInstance=e.keyEventPlugin.constructor,this.elementScope=e;var i=document.querySelector("."+e.dateContainerCls);c.setAttr(i,"tabindex","0"),i.onkeydown=function(e){if("escape"===n.keyEventPluginInstance.getEventFullKey(e)){n.elementScope.hideDatepickerDropdown();var t=n.elementScope.nativeElement.querySelector(".display-input");setTimeout((function(){return t.focus()}))}},this.loadDays(),this.setActiveDateFocus(this.activeDate)},t.prototype.setNextData=function(e){this.next=this.getMonth(e,1),this.prev=this.getMonth(e,-1)},t.prototype.loadDays=function(){var e=this;setTimeout((function(){$("[bsdatepickerdaydecorator]").not(".is-other-month").attr("tabindex","0"),e.addKeyBoardEventsForDays(),e.addDatepickerMouseEvents()}))},t.prototype.addKeyBoardEventsForDays=function(){var e=this;$(".bs-datepicker-body").keydown((function(t){var n,i=e.keyEventPluginInstance.getEventFullKey(t);if("arrowdown"===i)t.preventDefault(),n=moment(e.activeDate).add(7,"days").toDate(),e.setActiveDateFocus(n);else if("arrowup"===i)t.preventDefault(),n=moment(e.activeDate).add(-7,"days").toDate(),e.setActiveDateFocus(n);else if("arrowleft"===i)n=moment(e.activeDate).add(-1,"days").toDate(),e.setActiveDateFocus(n);else if("arrowright"===i)n=moment(e.activeDate).add(1,"days").toDate(),e.setActiveDateFocus(n);else if("pageup"===i)t.preventDefault(),n=moment(e.activeDate).add(-1,"month").toDate(),e.setActiveDateFocus(n);else if("pagedown"===i)t.preventDefault(),n=moment(e.activeDate).add(1,"month").toDate(),e.setActiveDateFocus(n);else if("control.arrowup"===i)$(".bs-datepicker-head .current").first().click(),e.loadMonths(),e.setActiveMonthFocus(e.activeDate);else if("enter"===i){if($(document.activeElement).hasClass("disabled"))return;$(document.activeElement).click(),e.elementScope.hideDatepickerDropdown();var o=e.elementScope.nativeElement.querySelector(".display-input");setTimeout((function(){return o.focus()}))}})),this.focusBlurDatePickerHeadButtons()},t.prototype.focusBlurDatePickerHeadButtons=function(){var e=$(".bs-datepicker-head button");e.on("focus",(function(){$(this).css("background-color","#9AA0A3")})),e.on("blur",(function(){$(this).css("background-color","")}))},t.prototype.loadMonths=function(){var e=this;setTimeout((function(){e.addKeyBoardEventsForMonths(),e.addDatepickerMouseEvents()}))},t.prototype.addKeyBoardEventsForMonths=function(){var e=this;$(".bs-datepicker-body").keydown((function(t){var n,i=e.keyEventPluginInstance.getEventFullKey(t);if("arrowdown"===i)t.preventDefault(),n=moment(e.activeDate).add(3,"month").toDate(),e.setActiveMonthFocus(n);else if("arrowup"===i)t.preventDefault(),n=moment(e.activeDate).add(-3,"month").toDate(),e.setActiveMonthFocus(n);else if("arrowleft"===i)n=moment(e.activeDate).add(-1,"month").toDate(),e.setActiveMonthFocus(n);else if("arrowright"===i)n=moment(e.activeDate).add(1,"month").toDate(),e.setActiveMonthFocus(n);else if("control.arrowup"===i)$(".bs-datepicker-head .current").first().click(),e.loadYears(),e.setActiveYearFocus(e.activeDate);else if("control.arrowdown"===i||"enter"===i){if($(document.activeElement).parent().hasClass("disabled"))return;$(document.activeElement).click(),e.loadDays();var o=new Date(e.activeDate.getFullYear(),e.activeDate.getMonth(),1);e.setActiveDateFocus(o)}})),this.focusBlurDatePickerHeadButtons()},t.prototype.loadYears=function(){var e=this;setTimeout((function(){e.addKeyBoardEventsForYears(),e.addDatepickerMouseEvents()}))},t.prototype.setActiveMonthFocus=function(e,t){var n=this;this.setNextData(e);var i=b[e.getMonth()];t||(e.getFullYear()<this.activeDate.getFullYear()?this.goToOtherMonthOryear("previous","month"):e.getFullYear()>this.activeDate.getFullYear()&&this.goToOtherMonthOryear("next","month")),setTimeout((function(){$(".bs-datepicker-body table.months span").attr("tabindex","-1"),$(".bs-datepicker-body table.months span:contains("+i+")").attr("tabindex","0"),$(".bs-datepicker-body table.months span:contains("+i+")").focus(),n.activeDate=e}))},t.prototype.addKeyBoardEventsForYears=function(){var e=this;$(".bs-datepicker-body").keydown((function(t){var n,i=e.keyEventPluginInstance.getEventFullKey(t);if("arrowdown"===i)t.preventDefault(),n=moment(e.activeDate).add(4,"year").toDate(),e.setActiveYearFocus(n);else if("arrowup"===i)t.preventDefault(),n=moment(e.activeDate).add(-4,"year").toDate(),e.setActiveYearFocus(n);else if("arrowleft"===i)n=moment(e.activeDate).add(-1,"year").toDate(),e.setActiveYearFocus(n);else if("arrowright"===i)n=moment(e.activeDate).add(1,"year").toDate(),e.setActiveYearFocus(n);else if("control.arrowdown"===i||"enter"===i){if($(document.activeElement).parent().hasClass("disabled"))return;$(document.activeElement).click(),e.loadMonths(),e.setActiveMonthFocus(e.activeDate)}})),this.focusBlurDatePickerHeadButtons()},t.prototype.setActiveYearFocus=function(e,t){var n=this,i=e.getFullYear(),o=$(".bs-datepicker-body table.years span"),r=o.first().text(),a=o.last().text();t||(e.getFullYear()<_.parseInt(r)?this.goToOtherMonthOryear("previous","year"):e.getFullYear()>_.parseInt(a)&&this.goToOtherMonthOryear("next","year")),setTimeout((function(){$(".bs-datepicker-body table.years span").attr("tabindex","-1"),$(".bs-datepicker-body table.years span:contains("+i+")").attr("tabindex","0"),$(".bs-datepicker-body table.years span:contains("+i+")").focus(),n.activeDate=e}))},t.prototype.focusTimePickerPopover=function(e){this.keyEventPluginInstance=e.keyEventPlugin.constructor,this.elementScope=e,this.elementScope.ngZone.runOutsideAngular((function(){setTimeout((function(){$("timepicker .form-group").first().find("> input.form-control").focus()}))}))},t.prototype.bindTimePickerKeyboardEvents=function(){var e=this;setTimeout((function(){var t=$("body").find("> bs-dropdown-container timepicker");t.attr("tabindex",0),e.addEventsOnTimePicker(t)}))},t.prototype.focusOnInputEl=function(){var e=this;$(this.nativeElement).closest(".caption-floating").length>0&&setTimeout((function(){$(e.nativeElement).find(".app-textbox").focus()}),100)},t.prototype.isValidDate=function(e){return e&&e instanceof Date&&!isNaN(e.getTime())},t.prototype.timeFormatValidation=function(){var e=$(this.nativeElement).find("input").val(),t=c.getNativeDateObject(e,{meridians:this.meridians,pattern:this.datepattern});this.formatValidation(t,e)&&(this.invalidDateTimeFormat=!1,this.invokeOnChange(this.datavalue,void 0,!1))},t.prototype.updateTimeValue=function(e,t){var n=this;e.length<2?setTimeout((function(){"minutes"===t?n.bsTimePicker.updateMinutes("00"):n.bsTimePicker.updateSeconds("00")}),500):"minutes"===t?this.bsTimePicker.updateMinutes("00"):this.bsTimePicker.updateSeconds("00")},t.prototype.addEventsOnTimePicker=function(e){var t=this,n=e.find(".bs-timepicker-field");n.first().on("keyup",(function(e){var i=e.target.value;_.forEach(n,(function(n,o){if(e.target!==n&&""===n.value&&i.length){var r=1===o?"minutes":"seconds";t.updateTimeValue(i,r)}}))})),this.removeKeyupListener=function(){n.first().off("keyup")},e.on("keydown",(function(e){var n,i,o=$(e.target),r=o.parent(),a=t.elementScope,s=t.keyEventPluginInstance.getEventFullKey(e);if("escape"===s&&a.hideTimepickerDropdown(),o.hasClass("bs-timepicker-field")){if(r.is(":first-child")?"shift.tab"!==s&&"enter"!==s&&"escape"!==s||(a.setIsTimeOpen(!1),t.focus(),n=!0,i=!0):r.is(":last-child")||r.next().next().find("button.disabled").length?"tab"!==s&&"escape"!==s&&"enter"!==s||(a.setIsTimeOpen(!1),t.focus(),n=!0,i=!0):"enter"!==s&&"escape"!==s||(a.setIsTimeOpen(!1),t.focus(),n=!0,i=!0),n&&e.stopPropagation(),i&&e.preventDefault(),a.mintime&&a.maxtime&&!t.isValidDate(a.bsTimeValue)&&("arrowdown"===s?a.bsTimeValue=a.maxTime:"arrowup"===s&&(a.bsTimeValue=a.minTime)),"tab"===s){t.invalidDateTimeFormat=!1,t.invokeOnChange(t.datavalue,void 0,!1);var l=t.datepattern||t.timepattern;c.getFormattedDate(a.datePipe,a.bsTimeValue,l,t.timeZone,null,null,t)===a.displayValue&&$(t.nativeElement).find(".display-input").val(a.displayValue)}"arrowdown"!==s&&"arrowup"!==s||t.timeFormatValidation()}else o.hasClass("btn-default")&&("tab"!==s&&"escape"!==s||(a.setIsTimeOpen(!1),t.focus()))})),e.find("a").on("click",(function(e){var n=t.elementScope,i=$(e.target);n.mintime&&n.maxtime&&!t.isValidDate(n.bsTimeValue)&&(i.find("span").hasClass("bs-chevron-down")?n.bsTimeValue=n.maxTime:i.find("span").hasClass("bs-chevron-up")&&(n.bsTimeValue=n.minTime)),t.timeFormatValidation()}))},t.prototype.updateFormat=function(e){"datepattern"===e?(this._dateOptions.dateInputFormat=this.datepattern,this.showseconds=_.includes(this.datepattern,"s"),this.ismeridian=_.includes(this.datepattern,"h")):"timepattern"===e&&(this.showseconds=_.includes(this.timepattern,"s"),this.ismeridian=_.includes(this.timepattern,"h"))},t.prototype.getMobileInput=function(){return this.nativeElement.querySelector(".mobile-input")},t.prototype.onDateTimeInputBlur=function(){var e=this.getMobileInput();if(e&&!c.hasCordova()){for(var t=this.nativeElement.children,n=0;n<t.length;n++)t[n].classList.remove("add-opacity");e.classList.remove("remove-opacity")}},t.prototype.onDateTimeInputFocus=function(e){if(void 0===e&&(e=!1),this.loadNativeDateInput){var t=this.getMobileInput();if(!e||c.hasCordova())t&&this._triggeredByUser&&(t.focus(),t.click());else{for(var n=this.nativeElement.children,i=0;i<n.length;i++)n[i].classList.add("add-opacity");t.classList.add("remove-opacity")}}},t.prototype.getCordovaPluginDatePickerApi=function(){if(c.isIos())return _.get(window,"cordova.wavemaker.datePicker.selectDate")},t.prototype.showDatePickerModal=function(){this.datetimepickerComponent.show()},t.prototype.blurDateInput=function(e){var t=this.nativeElement.querySelector(".display-input");e&&setTimeout((function(){return t.blur()}))},t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("required"!==t?"datepattern"===t?this.updateFormat(t):"showweeks"===t?this._dateOptions.showWeekNumbers=n:"mindate"===t?(this._dateOptions.minDate=n===y?this.mindate=new Date:c.getDateObj(n),this.minDateMaxDateValidationOnInput(this.datavalue)):"maxdate"===t?(this._dateOptions.maxDate=n===y?this.maxdate=new Date:c.getDateObj(n),this.minDateMaxDateValidationOnInput(this.datavalue)):"excludedates"===t||"excludedays"===t?(this.excludedays&&(this.excludedDaysToDisable=_.split(this.excludedays,",").map((function(e){return+e}))),this.excludedates&&(this.excludedDatesToDisable=this.excludedates,c.isString(this.excludedates)&&(this.excludedDatesToDisable=_.split(this.excludedates,",")),this.excludedDatesToDisable=this.excludedDatesToDisable.map((function(e){return c.getDateObj(e)}))),this.minDateMaxDateValidationOnInput(this.datavalue)):"selectfromothermonth"===t?this._dateOptions.selectFromOtherMonth=n:"todaybutton"===t?this._dateOptions.showTodayButton=n:"clearbutton"===t?this._dateOptions.showClearButton=n:"todaybuttonlabel"===t?this._dateOptions.todayButtonLabel=this.i18nService.getLocalizedMessage(n)||n:"clearbuttonlabel"===t?this._dateOptions.clearButtonLabel=this.i18nService.getLocalizedMessage(n)||n:"showcustompicker"===t?this.loadNativeDateInput=c.isMobile()&&!this.showcustompicker:"adaptiveposition"===t?this._dateOptions.adaptivePosition=n:e.prototype.onPropertyChange.call(this,t,n,i):this._onChange(this.datavalue))},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),this.containerTarget=s.getContainerTargetClass(this.nativeElement),this.isReadOnly="undefined"!=this.dataentrymode&&!this.isDataEntryModeEnabledOnInput(this.dataentrymode);var t=this.getMobileInput();t&&setTimeout((function(){t.style.width="100%",t.style.height="100%"}))},t.prototype.ngOnDestroy=function(){this.dateOnShowSubscription&&this.dateOnShowSubscription.unsubscribe(),this.cancelLocaleChangeSubscription&&this.cancelLocaleChangeSubscription(),e.prototype.ngOnDestroy.call(this)},t.prototype.ngOnDetach=function(){var e;null===(e=this.datetimepickerComponent)||void 0===e||e.hideModal()},t.prototype.setTimezone=function(e){this.i18nService.setTimezone(e,this)},t}(p.BaseFormCustomComponent);S.decorators=[{type:t.Directive}],S.ctorParameters=function(){return[{type:t.Injector},null]},S.propDecorators={bsDropdown:[{type:t.ViewChild,args:[r.BsDropdownDirective]}],bsTimePicker:[{type:t.ViewChild,args:[a.TimepickerComponent]}],datetimepickerComponent:[{type:t.ViewChild,args:[g]}]};var E=new Map([["autofocus",s.PROP_BOOLEAN],["class",s.PROP_STRING],["dataentrymode",Object.assign({value:"default"},s.PROP_STRING)],["datavaluesource",s.PROP_ANY],["datavalue",s.PROP_STRING],["datepattern",s.PROP_STRING],["disabled",s.PROP_BOOLEAN],["excludedays",s.PROP_STRING],["excludedates",s.PROP_STRING],["hint",s.PROP_STRING],["maxdate",s.PROP_STRING],["mindate",s.PROP_STRING],["name",s.PROP_STRING],["outputformat",Object.assign({value:"yyyy-MM-dd"},s.PROP_STRING)],["placeholder",Object.assign({value:"Select Date"},s.PROP_STRING)],["readonly",s.PROP_BOOLEAN],["required",s.PROP_BOOLEAN],["shortcutkey",s.PROP_STRING],["show",Object.assign({value:!0},s.PROP_BOOLEAN)],["showdropdownon",Object.assign({value:"default"},s.PROP_STRING)],["showbuttonbar",Object.assign({value:!0},s.PROP_BOOLEAN)],["showcustompicker",Object.assign({value:!1},s.PROP_BOOLEAN)],["showindevice",Object.assign({displayType:"inline-block",value:"all"},s.PROP_STRING)],["showweeks",Object.assign({value:!1},s.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},s.PROP_NUMBER)],["selectfromothermonth",Object.assign({value:!0},s.PROP_BOOLEAN)],["todaybutton",Object.assign({value:!0},s.PROP_BOOLEAN)],["clearbutton",Object.assign({value:!0},s.PROP_BOOLEAN)],["adaptiveposition",Object.assign({value:!0},s.PROP_BOOLEAN)],["todaybuttonlabel",Object.assign({value:"LABEL_TODAY_DATE"},s.PROP_STRING)],["clearbuttonlabel",Object.assign({value:"LABEL_CLEAR_DATE"},s.PROP_STRING)]]),T=function(){s.register("wm-date",E),s.registerFormWidget(c.FormWidgetType.DATE,new Map(E))},C={widgetType:"wm-date",hostClass:"app-date input-group"},A=function(e){function t(t,n,i,o){var r=e.call(this,t,C)||this;return r.cdRef=n,r.appDefaults=i,r.isOpen=!1,r.isEnterPressedOnDateInput=!1,s.styler(r.nativeElement,r),r.keyEventPlugin=o[1],r.dateContainerCls="app-date-"+r.widgetId,r._dateOptions.containerClass="app-date "+r.dateContainerCls,r._dateOptions.showWeekNumbers=!1,r._bsDefaultLoadCheck=!0,r.datepattern=r.appDefaults.dateFormat||c.getDisplayDateTimeFormat(c.FormWidgetType.DATE),r.updateFormat("datepattern"),r}return h(t,e),Object.defineProperty(t.prototype,"timestamp",{get:function(){return this.bsDataValue?this.bsDataValue.valueOf():void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dateInputFormat",{get:function(){return this._dateOptions.dateInputFormat||"yyyy-MM-dd"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"displayValue",{get:function(){return c.getFormattedDate(this.datePipe,this.bsDataValue,this.dateInputFormat,this.timeZone,null,this.isCurrentDate,this)||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nativeDisplayValue",{get:function(){return c.getFormattedDate(this.datePipe,this.bsDataValue,"yyyy-MM-dd",this.timeZone,null,this.isCurrentDate,this)||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"datavalue",{get:function(){return c.getFormattedDate(this.datePipe,this.bsDataValue,this.outputformat,this.timeZone,null,this.isCurrentDate,this)||""},set:function(e){var t=this;"CURRENT_DATE"===e?(setTimeout((function(){t.bsDataValue=t.timeZone?c.getMomentLocaleObject(t.timeZone):new Date}),50),this.isCurrentDate=!0):(this.bsDataValue=e?c.getDateObj(e,{isNativePicker:this.loadNativeDateInput},this.timeZone):void 0,this.isCurrentDate=!1),this.invokeOnChange(this.datavalue,void 0,!0),this.cdRef.detectChanges()},enumerable:!1,configurable:!0}),t.prototype.onDisplayDateChange=function(e,t){if(void 0===t&&(t=!1),this.datepattern=this.appDefaults.dateFormat||c.getDisplayDateTimeFormat(c.FormWidgetType.DATE),this.updateFormat("datepattern"),this.isEnterPressedOnDateInput)this.isEnterPressedOnDateInput=!1;else{var n=c.getDateObj(e.target.value,{pattern:this.datepattern,isNativePicker:t});this.formatValidation(n,e.target.value,t)&&(t&&this.minDateMaxDateValidationOnInput(n,e,this.displayValue,t)||this.setDataValue(n))}},t.prototype.setDataValue=function(e){this.invalidDateTimeFormat=!1,this.minDateMaxDateValidationOnInput(e),c.getFormattedDate(this.datePipe,e,this.dateInputFormat,this.timeZone,null,this.isCurrentDate,this)===this.displayValue&&$(this.nativeElement).find(".display-input").val(this.displayValue),this.bsDataValue=e||void 0,this.invokeOnChange(this.datavalue,{},!0)},t.prototype.onDatePickerOpen=function(){this.isOpen=!0,this.bsDataValue?this.activeDate=this.bsDataValue:this.activeDate=new Date,this.bsDataValue||this.hightlightToday(),this.$element.find(".model-holder").width("1px"),$("bs-datepicker-container").attr("aria-label","Use Arrow keys to navigate dates, Choose Date from datepicker"),$(".bs-calendar-container").removeAttr("role");var e=$(".bs-datepicker-container")[0];this.focusTrap=s.setFocusTrap(e,!0),this.focusTrap.activate(),this.addDatepickerKeyboardEvents(this,!1),c.adjustContainerPosition($("bs-datepicker-container"),this.nativeElement,this.bsDatePickerDirective._datepicker),c.adjustContainerRightEdges($("bs-datepicker-container"),this.nativeElement,this.bsDatePickerDirective._datepicker)},t.prototype.onInputBlur=function(e){$(e.relatedTarget).hasClass("current-date")||(this.invokeOnTouched(),this.invokeEventCallback("blur",{$event:e}))},t.prototype.hideDatepickerDropdown=function(){var e;this.invokeOnTouched(),this.isOpen=!1,null===(e=this.focusTrap)||void 0===e||e.deactivate(),this.isEnterPressedOnDateInput=!1,this.deregisterEventListener&&this.deregisterEventListener(),this.blurDateInput(this.isOpen)},t.prototype.handleEvent=function(t,n,i,o){_.includes(["blur","focus","change","click"],n)||e.prototype.handleEvent.call(this,t,n,i,o)},t.prototype.toggleDpDropdown=function(e,t){void 0===t&&(t=!1),this.loadNativeDateInput&&(t||this.onDateTimeInputFocus()),"click"===e.type&&this.invokeEventCallback("click",{$event:e}),e.target&&$(e.target).is("input")&&!this.isDropDownDisplayEnabledOnInput(this.showdropdownon)?e.stopPropagation():(this.bsDatePickerDirective.toggle(),this.addBodyClickListener(this.bsDatePickerDirective.isOpen))},t.prototype.addBodyClickListener=function(e){var t=this;if(e){var n=document.querySelector("body");setTimeout((function(){var e=n.querySelector("."+t.dateContainerCls);t.deregisterEventListener=c.addEventListenerOnElement(n,e,t.nativeElement,"click",t.isDropDownDisplayEnabledOnInput(t.showdropdownon),(function(){t.isOpen=!1}),0,!0)}),350)}},t.prototype.onDisplayKeydown=function(e){if(this.datepattern=this.appDefaults.dateFormat||c.getDisplayDateTimeFormat(c.FormWidgetType.DATE),this.updateFormat("datepattern"),this.isDropDownDisplayEnabledOnInput(this.showdropdownon))if(e.stopPropagation(),"enter"===this.keyEventPlugin.constructor.getEventFullKey(e)){var t=c.getDateObj(e.target.value,{pattern:this.datepattern});e.preventDefault();var n=c.getFormattedDate(this.datePipe,t,this.dateInputFormat,this.timeZone,null,this.isCurrentDate,this),i=e.target.value.trim();i&&"timestamp"===this.datepattern?_.isNaN(i)||_.parseInt(i)===n||(this.invalidDateTimeFormat=!0,this.invokeOnChange(this.datavalue,e,!1)):i&&i!==n?(this.invalidDateTimeFormat=!0,this.invokeOnChange(this.datavalue,e,!1)):(this.invalidDateTimeFormat=!1,this.isEnterPressedOnDateInput=!0,this.bsDatePickerDirective.bsValue=e.target.value?t:""),this.toggleDpDropdown(e)}else this.hideDatepickerDropdown();else this.hideDatepickerDropdown()},t.prototype.onDateChange=function(e){this.datepattern=this.appDefaults.dateFormat||c.getDisplayDateTimeFormat(c.FormWidgetType.DATE),this.updateFormat("datepattern"),this._bsDefaultLoadCheck?this._bsDefaultLoadCheck=!1:this.setDataValue(e)},t}(S);A.initializeProps=T(),A.decorators=[{type:t.Component,args:[{selector:"[wmDate]",template:' <input class="form-control app-textbox app-dateinput display-input"\n focus-target\n type="text"\n [name]="name"\n [tabindex]="loadNativeDateInput ? \'-1\' : tabindex"\n [attr.aria-hidden]="!!loadNativeDateInput"\n [value]="displayValue"\n (click)="toggleDpDropdown($event, true)"\n (focus)="onDateTimeInputFocus(); invokeOnFocus($event);"\n (blur)="onInputBlur($event)"\n [disabled]="disabled || readonly"\n [autofocus]="autofocus"\n [required]="required"\n [readOnly]="isReadOnly"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint"\n (change)="onDisplayDateChange($event)"\n (keydown)="this._triggeredByUser = true; onDisplayKeydown($event);">\n\n <span class="input-group-btn">\n <button type="button"\n class="btn btn-default btn-time"\n [tabindex]="loadNativeDateInput ? \'-1\' : tabindex"\n [attr.aria-hidden]="!!loadNativeDateInput"\n [disabled]="disabled || readonly"\n [attr.aria-label]="displayValue ? \'Change Date \' + displayValue : \'Choose date by pressing enter\'"\n aria-haspopup="true"\n aria-expanded="false"\n (click)="toggleDpDropdown($event, false)">\n <i aria-hidden="true"\n class="app-icon wm-sl-l sl-calendar"></i>\n </button>\n </span>\n <div style="width: 0;display: inline-block;">\n <input class="model-holder"\n aria-label="datepicker dropdownmenu"\n aria-controls="date"\n [tabindex]="-1"\n [attr.aria-hidden]="!!loadNativeDateInput"\n [container]="containerTarget || \'body\'"\n [bsConfig]="_dateOptions"\n [isOpen]="isOpen"\n #datepicker="bsDatepicker"\n bsDatepicker\n [daysDisabled]="excludedDaysToDisable"\n [datesDisabled]="excludedDatesToDisable"\n placement="bottom right"\n [isDisabled]="disabled || readonly"\n [bsValue]="bsDataValue"\n (onShown)="onDatePickerOpen()"\n (onHidden)="hideDatepickerDropdown()"\n (bsValueChange)="onDateChange($event)">\n</div>\n\n<ng-template [ngIf]="loadNativeDateInput">\n <wm-datetimepicker\n dateTimePicker\n mode="DATE"\n [config]="_dateOptions"\n [placement]="modal"\n [excludedDaysToDisable]="excludedDaysToDisable"\n [excludedDatesToDisable]="excludedDatesToDisable"\n [displayFormat]="dateInputFormat"\n [value]="bsDataValue"\n (change)="onDateChange($event)">\n </wm-datetimepicker>\n <div class="mobile-input mobile-datepicker-container"\n [tabindex]="tabindex || 0"\n (focus)="onDateTimeInputFocus(true); invokeOnFocus($event);"\n (blur)="onDateTimeInputBlur(); invokeOnTouched($event)"\n [attr.aria-label]="displayValue ? \'Change Date\' + displayValue : \'Choose Date\'"\n (click)="!(disabled || readonly || isCurrentDate) && showDatePickerModal()">\n </div>\n</ng-template>\n',providers:[s.provideAs(A,i.NG_VALUE_ACCESSOR,!0),s.provideAs(A,i.NG_VALIDATORS,!0),s.provideAsWidgetRef(A)]}]}],A.ctorParameters=function(){return[{type:t.Injector},{type:t.ChangeDetectorRef},{type:c.AppDefaults},{type:void 0,decorators:[{type:t.Inject,args:[l.EVENT_MANAGER_PLUGINS]}]}]},A.propDecorators={bsDatePickerDirective:[{type:t.ViewChild,args:[o.BsDatepickerDirective]}]};var R=new Map([["autofocus",s.PROP_BOOLEAN],["class",s.PROP_STRING],["dataentrymode",Object.assign({value:"default"},s.PROP_STRING)],["datavaluesource",s.PROP_ANY],["datavalue",s.PROP_STRING],["datepattern",s.PROP_STRING],["disabled",s.PROP_BOOLEAN],["excludedays",s.PROP_STRING],["excludedates",s.PROP_STRING],["hint",s.PROP_STRING],["hourstep",Object.assign({value:1},s.PROP_NUMBER)],["maxdate",s.PROP_STRING],["mindate",s.PROP_STRING],["minutestep",Object.assign({value:15},s.PROP_NUMBER)],["name",s.PROP_STRING],["outputformat",Object.assign({value:"timestamp"},s.PROP_STRING)],["placeholder",Object.assign({value:"Select date time"},s.PROP_STRING)],["readonly",s.PROP_BOOLEAN],["required",s.PROP_BOOLEAN],["secondsstep",Object.assign({value:1},s.PROP_NUMBER)],["shortcutkey",s.PROP_STRING],["show",Object.assign({value:!0},s.PROP_BOOLEAN)],["showdropdownon",Object.assign({value:"default"},s.PROP_STRING)],["showbuttonbar",s.PROP_BOOLEAN],["showcustompicker",Object.assign({value:!1},s.PROP_BOOLEAN)],["showindevice",Object.assign({displayType:"inline-block",value:"all"},s.PROP_STRING)],["showweeks",s.PROP_BOOLEAN],["tabindex",Object.assign({value:0},s.PROP_NUMBER)],["timestamp",s.PROP_STRING],["selectfromothermonth",Object.assign({value:!0},s.PROP_BOOLEAN)],["todaybutton",Object.assign({value:!0},s.PROP_BOOLEAN)],["clearbutton",Object.assign({value:!0},s.PROP_BOOLEAN)],["adaptiveposition",Object.assign({value:!0},s.PROP_BOOLEAN)],["todaybuttonlabel",Object.assign({value:"LABEL_TODAY_DATE"},s.PROP_STRING)],["clearbuttonlabel",Object.assign({value:"LABEL_CLEAR_DATE"},s.PROP_STRING)]]),I=function(){s.register("wm-datetime",R),s.registerFormWidget(c.FormWidgetType.DATETIME,new Map(R)),s.registerFormWidget(c.FormWidgetType.TIMESTAMP,new Map(R))},D={widgetType:"wm-datetime",hostClass:"app-datetime input-group"},N="CURRENT_DATE",x=O,k=function(e){function t(t,n,i,o,r,a){var l=e.call(this,t,D)||this;return l.ngZone=n,l.cdRef=i,l.appDefaults=o,l.isEnterPressedOnDateInput=!1,l.isTimeOpen=!1,l.isDateOpen=!1,l.isCurrentDate=!1,l._debouncedOnChange=_.debounce(l.invokeOnChange,10),l.registerDestroyListener((function(){return l.clearTimeInterval()})),s.styler(l.nativeElement,l),l.app=r,l.keyEventPlugin=a[1],l.dateContainerCls="app-date-"+l.widgetId,l._dateOptions.containerClass="app-date "+l.dateContainerCls,l._dateOptions.showWeekNumbers=!1,l.datepattern=l.appDefaults.dateTimeFormat||c.getDisplayDateTimeFormat(c.FormWidgetType.DATETIME),l.updateFormat("datepattern"),l}return h(t,e),Object.defineProperty(t.prototype,"timestamp",{get:function(){return this.proxyModel?this.proxyModel.valueOf():void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dateInputFormat",{get:function(){return this._dateOptions.dateInputFormat||"yyyy-MM-ddTHH:mm:ss"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"displayValue",{get:function(){return c.getFormattedDate(this.datePipe,this.proxyModel,this.dateInputFormat,this.timeZone,this.key,this.isCurrentDate,this)||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nativeDisplayValue",{get:function(){return c.getFormattedDate(this.datePipe,this.proxyModel,"yyyy-MM-ddTHH:mm:ss",this.timeZone,this.key,this.isCurrentDate,this)||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"datavalue",{get:function(){return this.isCurrentDate&&!this.proxyModel?N:c.getFormattedDate(this.datePipe,this.proxyModel,this.outputformat,this.timeZone,null,null,this)},set:function(e){e===N?(this.isCurrentDate=!0,this.setTimeInterval()):(this.proxyModel=e?c.getDateObj(e,{isNativePicker:this.loadNativeDateInput},this.timeZone):void 0,this.clearTimeInterval(),this.isCurrentDate=!1),this.bsTimeValue=this.bsDateValue=this.proxyModel,this.cdRef.detectChanges()},enumerable:!1,configurable:!0}),t.prototype.setTimeInterval=function(){var e=this;this.timeinterval||(this.timeinterval=setInterval((function(){var t=e.timeZone?c.getMomentLocaleObject(e.timeZone):new Date;e.onModelUpdate(t)}),1e3))},t.prototype.clearTimeInterval=function(){this.timeinterval&&(clearInterval(this.timeinterval),this.timeinterval=null)},t.prototype.toggleTimePicker=function(e,t){this.loadNativeDateInput?this.onDateTimeInputFocus():(this.isTimeOpen=e,t&&"click"===t.type&&this.invokeEventCallback("click",{$event:t}),this.addTimepickerClickListener(this.isTimeOpen))},t.prototype.addTimepickerClickListener=function(e){var t=this;if(e){var n=document.querySelector("body");setTimeout((function(){var e=$(n).find(">bs-dropdown-container .dropdown-menu").get(0);t.deregisterTimepickeEventListener=c.addEventListenerOnElement(n,e,t.nativeElement,"click",t.isDropDownDisplayEnabledOnInput(t.showdropdownon),(function(){t.toggleTimePicker(!1)}),0,!0)}),350)}},t.prototype.setIsTimeOpen=function(e){this.isTimeOpen=e},t.prototype.hideTimepickerDropdown=function(){this.invokeOnTouched(),this.toggleTimePicker(!1),this.deregisterTimepickeEventListener&&this.deregisterTimepickeEventListener();var e=$(this.nativeElement).closest(".app-composite-widget.caption-floating");e.length>0&&this.app.notify("captionPositionAnimate",{displayVal:this.displayValue,nativeEl:e})},t.prototype.onTimepickerOpen=function(){var e=document.querySelectorAll("timepicker");_.forEach(e,(function(e){c.addClass(e.parentElement,"app-datetime",!0)})),this.bsDatePickerDirective.hide(),this.focusTimePickerPopover(this),this.bindTimePickerKeyboardEvents(),c.adjustContainerPosition($("bs-dropdown-container"),this.nativeElement,this.bsDropdown._dropdown,$("bs-dropdown-container .dropdown-menu")),c.adjustContainerRightEdges($("bs-dropdown-container"),this.nativeElement,this.bsDropdown._dropdown,$("bs-dropdown-container .dropdown-menu"))},t.prototype.onDatePickerOpen=function(){this.isDateOpen=!this.isDateOpen,this.toggleTimePicker(!1),this.$element.find(".model-holder").width("1px"),$("bs-datepicker-container").attr("aria-label","Use Arrow keys to navigate dates, Choose Date from datepicker"),$(".bs-calendar-container").removeAttr("role");var e=$(".bs-datepicker-container")[0];this.focusTrap=s.setFocusTrap(e,!0),this.focusTrap.activate(),this.bsDateValue?this.activeDate=this.bsDateValue:this.activeDate=new Date,this.bsDateValue||this.hightlightToday(),this.addDatepickerKeyboardEvents(this,!0),c.adjustContainerPosition($("bs-datepicker-container"),this.nativeElement,this.bsDatePickerDirective._datepicker)},t.prototype.onModelUpdate=function(e,t){if("date"===t&&(this.invalidDateTimeFormat=!1,c.getFormattedDate(this.datePipe,e,this.dateInputFormat,this.timeZone,this.key,this.isCurrentDate,this)===this.displayValue&&$(this.nativeElement).find(".display-input").val(this.displayValue)),this.minDateMaxDateValidationOnInput(e),!e)return this.bsDateValue&&this.bsTimePicker&&(""===this.bsTimePicker.hours||""===this.bsTimePicker.minutes||""===this.bsTimePicker.seconds)?this.bsDateValue=this.bsTimeValue=this.proxyModel=moment(this.bsDateValue).startOf("day").toDate():this.bsDateValue=this.bsTimeValue=this.proxyModel=void 0,void((e!==this.datavalue||!this.datavalue&&this.prevDatavalue)&&this._debouncedOnChange(this.datavalue,{},!0));"date"===t&&this.isDateOpen&&this.toggleTimePicker(!0),this.proxyModel=e,this.proxyModel&&(this.bsDateValue=this.bsTimeValue=e),this._debouncedOnChange(this.datavalue,{},!0),this.cdRef.detectChanges();var n=$(".bs-timepicker-field");if(this.timeZone&&"datetimestamp"===this.key&&n.length){var i=c.getFormattedDate(this.datePipe,e,this.getTimePattern(),this.timeZone,this.key,null,this);this.updateTimepickerFields(i,n)}},t.prototype.getTimePattern=function(){var e,t=this.datepattern.toLowerCase().indexOf("h"),n=this.datepattern.toLowerCase().indexOf(":ss");(n>-1||(n=this.datepattern.toLowerCase().indexOf(":mm"))>-1)&&(n+=3);var i=this.datepattern.toLowerCase().indexOf("a");return e=this.datepattern.substr(t,n),i>-1&&(e+=" a"),e},t.prototype.updateTimepickerFields=function(e,t){for(var n,i=$("timepicker button.text-center"),o=e.split(" "),r=o[0].split(":"),a=0;a<t.length;a++)t[a].value=r[a];(null===(n=null==i?void 0:i.html())||void 0===n?void 0:n.trim())!==o[1]&&i.text(o[1])},t.prototype.preventTpClose=function(e){e.stopImmediatePropagation()},t.prototype.toggleDpDropdown=function(e,t){void 0===t&&(t=!1),this.loadNativeDateInput?t||this.onDateTimeInputFocus():("click"===e.type&&this.invokeEventCallback("click",{$event:e}),e.target&&$(e.target).is("input")&&!this.isDropDownDisplayEnabledOnInput(this.showdropdownon)?e.stopPropagation():(this.bsDatePickerDirective.toggle(),this.addBodyClickListener(this.bsDatePickerDirective.isOpen)))},t.prototype.addBodyClickListener=function(e){var t=this;if(e){var n=document.querySelector("body");setTimeout((function(){var e=n.querySelector("."+t.dateContainerCls);t.deregisterDatepickerEventListener=c.addEventListenerOnElement(n,e,t.nativeElement,"click",t.isDropDownDisplayEnabledOnInput(t.showdropdownon),(function(){t.bsDatePickerDirective.hide()}),0,!0)}),350)}},t.prototype.hideDatepickerDropdown=function(){var e;this.isDateOpen=!1,null===(e=this.focusTrap)||void 0===e||e.deactivate(),this.invokeOnTouched(),this.bsDatePickerDirective.hide(),this.bsDateValue&&this.toggleTimePicker(!0),this.isEnterPressedOnDateInput=!1,this.deregisterDatepickerEventListener&&this.deregisterDatepickerEventListener();var t=$(this.nativeElement).closest(".app-composite-widget.caption-floating");t.length>0&&this.app.notify("captionPositionAnimate",{displayVal:this.displayValue,nativeEl:t}),this.blurDateInput(this.isDateOpen)},t.prototype.onDateChange=function(e,t){if(this.isEnterPressedOnDateInput)this.isEnterPressedOnDateInput=!1;else{var n=e.target.value.trim();n=n?c.getNativeDateObject(n,{pattern:this.loadNativeDateInput?this.outputformat:this.datepattern,meridians:this.meridians,isNativePicker:this.loadNativeDateInput}):void 0,this.formatValidation(n,e.target.value,t)&&(t&&this.minDateMaxDateValidationOnInput(n,e,this.displayValue,t)||(this.invalidDateTimeFormat=!1,this.onModelUpdate(n)))}},t.prototype.onDisplayKeydown=function(e){if(this.isDropDownDisplayEnabledOnInput(this.showdropdownon)){e.stopPropagation();var t=e.target.value.trim(),n=this.keyEventPlugin.constructor.getEventFullKey(e);if("enter"===n||"arrowdown"===n){t=t?c.getNativeDateObject(t,{pattern:this.loadNativeDateInput?this.outputformat:this.datepattern,meridians:this.meridians}):void 0,e.preventDefault();var i=c.getFormattedDate(this.datePipe,t,this.dateInputFormat,this.timeZone,this.key,this.isCurrentDate,this),o=e.target.value.trim();o&&"timestamp"===this.datepattern?_.isNaN(o)||_.parseInt(o)===i||(this.invalidDateTimeFormat=!0,this.invokeOnChange(this.datavalue,e,!1)):o&&o!==i?(this.invalidDateTimeFormat=!0,this.invokeOnChange(this.datavalue,e,!1)):(this.invalidDateTimeFormat=!1,this.isEnterPressedOnDateInput=!0,this.bsDatePickerDirective.bsValue=t),this.toggleDpDropdown(e)}else this.hideDatepickerDropdown(),this.hideTimepickerDropdown()}else this.hideDatepickerDropdown(),this.hideTimepickerDropdown()},t.prototype.isValid=function(e){if(!e){var t=$(this.nativeElement).find("input").val(),n=c.getNativeDateObject(t,{pattern:this.loadNativeDateInput?this.outputformat:this.datepattern,meridians:this.meridians,isNativePicker:this.loadNativeDateInput});if(!this.formatValidation(n,t))return}},t.prototype.handleEvent=function(t,n,i,o){_.includes(["blur","focus","change","click"],n)||e.prototype.handleEvent.call(this,t,n,i,o)},t.prototype.onInputBlur=function(e){$(e.relatedTarget).hasClass("current-date")||(this.invokeOnTouched(),this.invokeEventCallback("blur",{$event:e}))},t}(S);k.initializeProps=I(),k.decorators=[{type:t.Component,args:[{selector:"[wmDateTime]",template:' <div dropdown\n [isOpen]="isTimeOpen"\n autoClose="false"\n [container]="\'body\'"\n (onShown)="onTimepickerOpen()"\n style="display: inherit;">\n <input class="form-control app-textbox display-input"\n [attr.aria-label]="hint"\n focus-target\n [name]="name"\n [tabindex]="loadNativeDateInput ? \'-1\' : tabindex"\n [attr.aria-hidden]="!!loadNativeDateInput"\n type="text"\n [value]="displayValue"\n (click)="toggleDpDropdown($event, true)"\n (focus)="onDateTimeInputFocus(); invokeOnFocus($event);"\n (blur)="onInputBlur($event)"\n (change)="onDateChange($event)"\n [autofocus]="autofocus"\n [disabled]="disabled || readonly || isCurrentDate"\n [required]="required"\n [readOnly]="isReadOnly"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n (keydown)="this._triggeredByUser = true; onDisplayKeydown($event)">\n\n <span class="input-group-btn">\n <button type="button"\n class="btn btn-default btn-date"\n [tabindex]="loadNativeDateInput ? \'-1\' : tabindex"\n [attr.aria-hidden]="!!loadNativeDateInput"\n [disabled]="disabled || readonly || isCurrentDate"\n [attr.aria-label]="displayValue ? \'Change Date \' + displayValue : \'Choose date by pressing enter\'"\n aria-haspopup="true"\n aria-expanded="false"\n (click)="toggleDpDropdown($event, false)">\n <i aria-hidden="true"\n class="app-icon wm-sl-l sl-calendar"></i>\n </button>\n <button type="button"\n class="btn btn-default btn-time"\n [tabindex]="loadNativeDateInput ? \'-1\' : tabindex"\n [attr.aria-hidden]="!!loadNativeDateInput"\n [disabled]="disabled || readonly || isCurrentDate"\n aria-label="Select time"\n aria-haspopup="true"\n aria-expanded="false"\n (click)="toggleTimePicker(!isTimeOpen, $event)">\n <i aria-hidden="true"\n class="app-icon wm-sl-l sl-time"></i>\n </button>\n </span>\n <div style="width: 0;display: inline-block;">\n <input class="model-holder"\n aria-label="datepicker dropdownmenu"\n aria-controls="date"\n focus-target\n [tabindex]="-1"\n [attr.aria-hidden]="!!loadNativeDateInput"\n [container]="containerTarget || \'body\'"\n [bsConfig]="_dateOptions"\n [isOpen]="isDateOpen"\n placement="bottom right"\n (onShown)="onDatePickerOpen()"\n (onHidden)="hideDatepickerDropdown()"\n [daysDisabled]="excludedDaysToDisable"\n [datesDisabled]="excludedDatesToDisable"\n #datepicker=bsDatepicker\n bsDatepicker\n [isDisabled]="disabled || readonly || isCurrentDate"\n [bsValue]="bsDateValue"\n (bsValueChange)="onModelUpdate($event, \'date\')">\n </div>\n <div *dropdownMenu\n class="dropdown-menu"\n aria-label="timepicker dropdown"\n aria-controls="time"\n (click)="preventTpClose($event)">\n <timepicker class="model-holder"\n [showMeridian]="ismeridian"\n [readonlyInput]="disabled || readonly || isCurrentDate"\n [(ngModel)]="bsTimeValue"\n [min]="minTime"\n [max]="maxTime"\n [hourStep]="hourstep"\n [minuteStep]="minutestep"\n [secondsStep]="secondsstep"\n [mousewheel]="true"\n [arrowkeys]="true"\n (isValid)="isValid($event)"\n [showSeconds]="showseconds"\n (ngModelChange)="onModelUpdate($event, \'time\')"></timepicker>\n </div>\n </div>\n<ng-template [ngIf]="loadNativeDateInput">\n <wm-datetimepicker\n dateTimePicker\n [config]="_dateOptions"\n [placement]="modal"\n [excludedDaysToDisable]="excludedDaysToDisable"\n [excludedDatesToDisable]="excludedDatesToDisable"\n [displayFormat]="dateInputFormat"\n [value]="bsDateValue"\n (change)="onModelUpdate($event, \'date\')">\n </wm-datetimepicker>\n <div class="mobile-input mobile-datepicker-container"\n [tabindex]="tabindex || 0"\n (focus)="onDateTimeInputFocus(true); invokeOnFocus($event)"\n (blur)="onDateTimeInputBlur(); invokeOnTouched($event)"\n (click)="!(disabled || readonly || isCurrentDate) && showDatePickerModal()">\n </div>\n</ng-template>\n',providers:[s.provideAs(k,i.NG_VALUE_ACCESSOR,!0),s.provideAs(k,i.NG_VALIDATORS,!0),s.provideAsWidgetRef(k),{provide:a.TimepickerConfig,deps:[c.AbstractI18nService],useFactory:x}]}]}],k.ctorParameters=function(){return[{type:t.Injector},{type:t.NgZone},{type:t.ChangeDetectorRef},{type:c.AppDefaults},{type:c.App},{type:void 0,decorators:[{type:t.Inject,args:[l.EVENT_MANAGER_PLUGINS]}]}]},k.propDecorators={bsDatePickerDirective:[{type:t.ViewChild,args:[o.BsDatepickerDirective]}]};var M=new Map([["autofocus",s.PROP_BOOLEAN],["class",s.PROP_STRING],["dataentrymode",Object.assign({value:"default"},s.PROP_STRING)],["datavaluesource",s.PROP_ANY],["datavalue",s.PROP_STRING],["disabled",s.PROP_BOOLEAN],["hint",s.PROP_STRING],["hourstep",Object.assign({value:1},s.PROP_NUMBER)],["maxtime",s.PROP_STRING],["mintime",s.PROP_STRING],["minutestep",Object.assign({value:15},s.PROP_NUMBER)],["name",s.PROP_STRING],["outputformat",Object.assign({value:"HH:mm:ss"},s.PROP_STRING)],["placeholder",Object.assign({value:"Select time"},s.PROP_STRING)],["readonly",s.PROP_BOOLEAN],["required",s.PROP_BOOLEAN],["shortcutkey",s.PROP_STRING],["show",Object.assign({value:!0},s.PROP_BOOLEAN)],["showdropdownon",Object.assign({value:"default"},s.PROP_STRING)],["showcustompicker",Object.assign({value:!1},s.PROP_BOOLEAN)],["secondsstep",Object.assign({value:1},s.PROP_NUMBER)],["tabindex",Object.assign({value:0},s.PROP_NUMBER)],["timepattern",s.PROP_STRING],["timestamp",s.PROP_STRING]]),L=function(){s.register("wm-time",M),s.registerFormWidget(c.FormWidgetType.TIME,new Map(M))},F="CURRENT_TIME",j={widgetType:"wm-time",hostClass:"input-group app-timeinput"},B=O,G=function(e){function t(t,n,i,o,r){var a=e.call(this,t,j)||this;return a.ngZone=n,a.appDefaults=i,a.status={isopen:!1},a.keyEventPlugin=r[1],s.styler(a.nativeElement,a),a.registerDestroyListener((function(){return a.clearTimeInterval()})),a.timepattern=a.appDefaults.timeFormat||c.getDisplayDateTimeFormat(c.FormWidgetType.TIME),a.updateFormat("timepattern"),a.app=o,a}return h(t,e),Object.defineProperty(t.prototype,"timestamp",{get:function(){return this.bsTimeValue?this.bsTimeValue.valueOf():void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"datavalue",{get:function(){return this.isCurrentTime&&!this.bsTimeValue?F:c.getFormattedDate(this.datePipe,this.bsTimeValue,this.outputformat,this.timeZone,null,null,this)||""},set:function(e){e?e===F?(this.isCurrentTime=!0,this.setTimeInterval()):(this.clearTimeInterval(),this.bsTimeValue=c.getNativeDateObject(e,{pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput}),this.isCurrentTime=!1,this.mintimeMaxtimeValidation()):(this.bsTimeValue=void 0,this.clearTimeInterval(),this.isCurrentTime=!1),this.invokeOnChange(this.datavalue),c.$appDigest()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"displayValue",{get:function(){return c.getFormattedDate(this.datePipe,this.bsTimeValue,this.timepattern,this.timeZone,null,null,this)||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nativeDisplayValue",{get:function(){return c.getFormattedDate(this.datePipe,this.bsTimeValue,"HH:mm:ss",this.timeZone,null,null,this)||""},enumerable:!1,configurable:!0}),t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("timepattern"===t&&this.updateFormat("timepattern"),"mintime"===t?(this.minTime=c.getNativeDateObject(n,{pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput}),this.mintimeMaxtimeValidation()):"maxtime"===t?(this.maxTime=c.getNativeDateObject(n,{pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput}),this.mintimeMaxtimeValidation()):e.prototype.onPropertyChange.call(this,t,n,i))},t.prototype.setValidateType=function(e,t,n){this.timeNotInRange&&(n<e?this.validateType="mintime":n>t&&(this.validateType="maxtime"))},t.prototype.mintimeMaxtimeValidation=function(){this.timeNotInRange=this.minTime&&this.maxTime&&(this.bsTimeValue<this.minTime||this.bsTimeValue>this.maxTime),this.setValidateType(this.minTime,this.maxTime,this.bsTimeValue),this.invokeOnChange(this.datavalue,void 0,!1)},t.prototype.toggleDropdown=function(e,t){var n=this;void 0===t&&(t=!1),this.loadNativeDateInput?t||this.onDateTimeInputFocus():("click"===e.type&&this.invokeEventCallback("click",{$event:e}),e.target&&$(e.target).is("input")&&!this.isDropDownDisplayEnabledOnInput(this.showdropdownon)||(this.ngZone.run((function(){n.status.isopen=!n.status.isopen})),this.addBodyClickListener(this.status.isopen)))},t.prototype.preventTpClose=function(e){e.stopImmediatePropagation();var t=$(this.nativeElement).closest(".app-composite-widget.caption-floating");t.length>0&&this.app.notify("captionPositionAnimate",{displayVal:this.displayValue,nativeEl:t})},t.prototype.addBodyClickListener=function(e){var t=this;if(e){var n=document.querySelector("body");setTimeout((function(){var e=$(n).find(">bs-dropdown-container .dropdown-menu").get(0);t.deregisterEventListener=c.addEventListenerOnElement(n,e,t.nativeElement,"click",t.isDropDownDisplayEnabledOnInput(t.showdropdownon),(function(){t.status.isopen=!1}),0,!0)}),350)}},t.prototype.onDisplayKeydown=function(e){if(this.isDropDownDisplayEnabledOnInput(this.showdropdownon)){e.stopPropagation();var t=this.keyEventPlugin.constructor.getEventFullKey(e);"enter"===t||"arrowdown"===t?(e.preventDefault(),this.toggleDropdown(e)):this.hideTimepickerDropdown()}else this.hideTimepickerDropdown()},t.prototype.onDisplayTimeChange=function(e){var t=c.getNativeDateObject(e.target.value,{meridians:this.meridians,pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput});this.formatValidation(t,e.target.value)&&(this.invalidDateTimeFormat=!1,this.onTimeChange(t))},t.prototype.onInputBlur=function(e){$(e.relatedTarget).hasClass("bs-timepicker-field")||(this.invokeOnTouched(),this.invokeEventCallback("blur",{$event:e}))},t.prototype.onTimeChange=function(e,t){var n,i,o;t&&(e=c.getNativeDateObject(e.target.value,{pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput})),e?(this.bsTimeValue=e,this.timeNotInRange=this.minTime&&this.maxTime&&(e<this.minTime||e>this.maxTime),this.setValidateType(this.minTime,this.maxTime,e)):(this.bsTimePicker&&this.bsTimePicker.min&&this.bsTimePicker.max&&(o=moment(new Date(this.bsTimePicker.min)).format("A"),moment(new Date(this.bsTimePicker.max)).format("A"),n=this.bsTimePicker.hours+":"+(this.bsTimePicker.minutes||0)+":"+(this.bsTimePicker.seconds||0)+(this.bsTimePicker.showMeridian?" "+o:""),i=c.getNativeDateObject(n,{pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput}),this.bsTimePicker.meridian=o,this.timeNotInRange=this.bsTimePicker.min>i||this.bsTimePicker.max<i,this.setValidateType(this.bsTimePicker.min,this.bsTimePicker.max,i)),this.bsTimeValue=i),this.invokeOnTouched(),this.invokeOnChange(this.datavalue,{},!0)},t.prototype.setTimeInterval=function(){var e=this;this.timeinterval||(this.timeinterval=setInterval((function(){var t=e.timeZone?c.getMomentLocaleObject(e.timeZone):new Date;t.setSeconds(t.getSeconds()+1),e.datavalue=F,e.onTimeChange(t)}),1e3))},t.prototype.clearTimeInterval=function(){this.timeinterval&&(clearInterval(this.timeinterval),this.timeinterval=null)},t.prototype.setIsTimeOpen=function(e){this.status.isopen=e},t.prototype.handleEvent=function(t,n,i,o){_.includes(["blur","focus","change","click"],n)||e.prototype.handleEvent.call(this,t,n,i,o)},t.prototype.hideTimepickerDropdown=function(){this.invokeOnTouched(),this.status.isopen=!1,this.deregisterEventListener&&this.deregisterEventListener(),this.removeKeyupListener();var e=$(this.nativeElement).closest(".app-composite-widget.caption-floating");e.length>0&&this.app.notify("captionPositionAnimate",{displayVal:this.displayValue,nativeEl:e}),this.blurDateInput(!0)},t.prototype.isValid=function(e){if(!e){var t=$(this.nativeElement).find("input").val(),n=c.getNativeDateObject(t,{meridians:this.meridians,pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput});if(!this.formatValidation(n,t))return}},t.prototype.onShown=function(){var e=document.querySelectorAll("timepicker");_.forEach(e,(function(e){c.addClass(e.parentElement,"app-datetime",!0)})),this.focusTimePickerPopover(this),this.bindTimePickerKeyboardEvents(),c.adjustContainerPosition($("bs-dropdown-container"),this.nativeElement,this.bsDropdown._dropdown,$("bs-dropdown-container .dropdown-menu"))},t.prototype.assignModel=function(){this.displayInputElem||(this.displayInputElem=this.getMobileInput()),this.displayInputElem.value=_.get(this,"nativeDisplayValue")},t}(S);G.initializeProps=L(),G.decorators=[{type:t.Component,args:[{selector:"[wmTime]",template:' <div dropdown [isOpen]="status.isopen" (onShown)="onShown()" (onHidden)="hideTimepickerDropdown()" [container]="\'body\'" style="display: inherit">\n <input class="form-control app-textbox display-input" [attr.aria-label]="hint"\n focus-target\n [tabindex]="tabindex"\n [name]="name"\n type="text"\n role="timer"\n [value]="displayValue"\n [disabled]="disabled || readonly || isCurrentTime"\n [autofocus]="autofocus"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-atomic]="isCurrentTime ? \'true\' : \'false\'"\n [required]="required"\n [readOnly]="isReadOnly"\n (click)="toggleDropdown($event, true)"\n (focus)="onDateTimeInputFocus(); invokeOnFocus($event);"\n (blur)="onInputBlur($event)"\n (change)="onDisplayTimeChange($event)"\n (keydown)="this._triggeredByUser = true; onDisplayKeydown($event)">\n <span class="input-group-btn dropdown-toggle">\n <button type="button" class="btn btn-default btn-date" [tabindex]="tabindex" [disabled]="disabled || readonly || isCurrentTime" aria-label="Select time" aria-haspopup="true" aria-expanded="false" (click)="toggleDropdown($event, false)"><i aria-hidden="true" class="app-icon wm-sl-l sl-time"></i></button>\n </span>\n <div *dropdownMenu class="dropdown-menu" (click)="preventTpClose($event)">\n <timepicker class="model-holder"\n [showMeridian]="ismeridian"\n [readonlyInput]="isDisabled"\n [(ngModel)]="bsTimeValue"\n [disabled]="disabled || readonly || isCurrentTime"\n [min]="minTime"\n [max]="maxTime"\n [hourStep]="hourstep"\n [minuteStep]="minutestep"\n [secondsStep]="secondsstep"\n [mousewheel]="true"\n [arrowkeys]="true"\n (isValid)="isValid($event)"\n [showSeconds]="showseconds" (ngModelChange)="onTimeChange($event)"></timepicker>\n </div>\n </div>\n<ng-template [ngIf]="loadNativeDateInput">\n <wm-datetimepicker\n dateTimePicker\n mode="TIME"\n [minTime]="minTime"\n [maxTime]="maxTime"\n [placement]="modal"\n [displayFormat]="timepattern"\n [value]="bsTimeValue"\n (change)="onTimeChange($event)">\n </wm-datetimepicker>\n <div class="mobile-input mobile-datepicker-container"\n tabindex="1000000"\n (focus)="onDateTimeInputFocus(true); invokeOnFocus($event); assignModel()"\n (blur)="onDateTimeInputBlur(); invokeOnTouched($event)"\n (click)="!(disabled || readonly || isCurrentTime) && showDatePickerModal()">\n </div>\n</ng-template>\n',providers:[s.provideAs(G,i.NG_VALUE_ACCESSOR,!0),s.provideAs(G,i.NG_VALIDATORS,!0),s.provideAsWidgetRef(G),{provide:a.TimepickerConfig,deps:[c.AbstractI18nService],useFactory:B}]}]}],G.ctorParameters=function(){return[{type:t.Injector},{type:t.NgZone},{type:c.AppDefaults},{type:c.App},{type:void 0,decorators:[{type:t.Inject,args:[l.EVENT_MANAGER_PLUGINS]}]}]};var V=function(){};V.decorators=[{type:t.Component,args:[{selector:"wm-pickergroup",template:'\n <div class="app-picker-group">\n <ng-content></ng-content>\n </div>\n '}]}];var U=function(){function e(e){this.inj=e,this.change=new t.EventEmitter,this._selectedIndex=0,this._options=[],this.noOfEmptyElements=2,this.$el=$(e.get(t.ElementRef).nativeElement)}return Object.defineProperty(e.prototype,"selectedValue",{get:function(){return this._selectedValue},set:function(e){this._selectedValue=e,this.reRender()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return this._options},set:function(e){this._options=e.map((function(e){return{label:e.label,value:void 0!==e.value?e.value:e.label}})),this.reRender()},enumerable:!1,configurable:!0}),e.prototype.reRender=function(){var e,t=this;this._selectedIndex=this.options.findIndex((function(e){return e.value===t.selectedValue})),null===(e=this.pickerAnimator)||void 0===e||e.select(this._selectedIndex+this.noOfEmptyElements)},Object.defineProperty(e.prototype,"selectedIndex",{get:function(){return this._selectedIndex},set:function(e){this._selectedIndex=e,this._selectedValue=this.options[e].value,this.change.emit(this.options[e])},enumerable:!1,configurable:!0}),e.prototype.ngAfterViewInit=function(){this.pickerAnimator=new W(this)},e}();U.decorators=[{type:t.Component,args:[{selector:"wm-picker",template:'\n <div class="app-picker">\n <div class="app-picker-option-container">\n <div class="app-picker-option app-picker-empty-option">E</div>\n <div class="app-picker-option app-picker-empty-option">E</div>\n <div *ngFor="let option of options; index as i;" class="app-picker-option">\n {{option.label}}\n </div>\n <div class="app-picker-option app-picker-empty-option">E</div>\n <div class="app-picker-option app-picker-empty-option">E</div>\n </div>\n <div class="app-picker-ruler"></div>\n </div>\n '}]}],U.ctorParameters=function(){return[{type:t.Injector}]},U.propDecorators={change:[{type:t.Output}],selectedValue:[{type:t.Input}],options:[{type:t.Input}]};var W=function(){function e(e){var t=this;this.picker=e;var n=e.selectedIndex+e.noOfEmptyElements,i=function(e){return n+Math.floor(e/16)};this.select(n),this.getElement().swipey({direction:$.fn.swipey.DIRECTIONS.VERTICAL,threshold:10,target:e.$el,onSwipe:function(e,n){t.select(i(-1*n.length))},onSwipeEnd:function(o,r){var a=i(-1*r.length);t.select(a),n=e.selectedIndex+e.noOfEmptyElements}})}return e.prototype.getElement=function(){return this.picker.$el.find(".app-picker-option-container:first")},e.prototype.getOptionElements=function(){return this.getElement().find(".app-picker-option")},e.prototype.select=function(e){var t=this.getOptionElements();if(!(e<this.picker.noOfEmptyElements||e>=t.length-this.picker.noOfEmptyElements)){this.getElement().find(".app-picker-option.app-picker-option-selected").removeClass("app-picker-option-selected"),t.eq(e).addClass("app-picker-option-selected"),this.picker.selectedIndex=e-this.picker.noOfEmptyElements;var n=e-this.picker.noOfEmptyElements,i=e+this.picker.noOfEmptyElements;t.each((function(t,o){if(t>=n&&t<=i){var r=30*(t-e),a=1-.3*Math.abs(t-e);$(o).css({transform:"perspective(500px) rotateX("+r+"deg)",opacity:a}).show()}else $(o).hide()}))}},e}(),q=[A,k,G,g,v,U,V],z=function(){};z.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,o.BsDatepickerModule,r.BsDropdownModule,i.FormsModule,a.TimepickerModule,s.WmComponentsModule],declarations:f([],m(q)),exports:f([],m(q)),entryComponents:[]}]}],e.DateComponent=A,e.DatetimeComponent=k,e.EpochModule=z,e.TimeComponent=G,e["\u02750"]=x,e["\u0275a"]=O,e["\u0275b"]=S,e["\u0275c"]=g,e["\u0275d"]=v,e["\u0275e"]=T,e["\u0275f"]=I,e["\u0275g"]=L,e["\u0275h"]=V,e["\u0275i"]=U,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"),require("@wm/core")):"function"==typeof define&&define.amd?define("@wm/components/input/file-upload",["exports","@angular/core","@angular/common","@wm/components/base","rxjs","@wm/core"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.input=e.wm.components.input||{},e.wm.components.input.fileupload={}),e.ng.core,e.ng.common,e.wm.components.base,e.rxjs,e.wm.core)}(this,(function(e,t,n,i,o,r){"use strict";
|
|
197
|
+
***************************************************************************** */var d=function(e,t){return(d=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 h(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}d(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}Object.create;function m(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function f(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o<r;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 g=function(){function e(e,n){this.inj=e,this.bsModalService=n,this.isDateOpen=!0,this.isTimeOpen=!1,this.mode="DATE_TIME",this.placement="MODAL",this.change=new t.EventEmitter,this._value=new Date,this.changedValue=null,this.appLocale=e.get(c.App).appLocale||{}}return Object.defineProperty(e.prototype,"value",{set:function(e){e=e||new Date,this._value=e,this.changedValue=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bsDatepickerConfig",{get:function(){return this._bsDatepickerConfig},set:function(e){this._bsDatepickerConfig=e,this._bsDatepickerConfig.showClearButton=!1,this._bsDatepickerConfig.showTodayButton=!1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"excludedDaysToDisable",{set:function(e){this._bsDatepickerConfig.daysDisabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"displayFormat",{get:function(){if(this._displayFormat)return this._displayFormat},set:function(e){e&&(this._displayFormat=e.replace(/y/g,"Y").replace(/d/g,"D").replace("a","A"))},enumerable:!1,configurable:!0}),e.prototype.validateSelectedDate=function(){var e,t,n,i,o;if(!this.changedValue)return!0;var r=moment(this.changedValue),a=null===(e=this._bsDatepickerConfig)||void 0===e?void 0:e.minDate,s=null===(t=this._bsDatepickerConfig)||void 0===t?void 0:t.maxDate;if(a&&("DATE"===this.mode&&moment(a).startOf("day").toDate()>this.changedValue||"DATE"!==this.mode&&a>this.changedValue))return!1;if(s&&("DATE"===this.mode&&moment(s).endOf("day").toDate()<this.changedValue||"DATE"!==this.mode&&s<this.changedValue))return!1;if((null===(i=null===(n=this._bsDatepickerConfig)||void 0===n?void 0:n.daysDisabled)||void 0===i?void 0:i.indexOf(r.day()))>=0)return!1;var l=r.startOf("day").toDate().getTime();return!(null===(o=this.excludedDatesToDisable)||void 0===o?void 0:o.find((function(e){return e.getTime()===l})))},e.prototype.hightlightToday=function(){var e=(new Date).getDate().toString();_.filter($("body>modal-container .date-picker-modal span:contains("+e+")").not(".is-other-month,.current-date"),(function(t){$(t).text()===e&&$(t).addClass("current-date text-info")}))},e.prototype.hideOnClick=function(){var e=this;$("body>modal-container .date-picker-modal .app-datetime-picker").click((function(e){return e.stopPropagation()})),$("body>modal-container .date-picker-modal").click((function(){return e.onCancelClick()}))},e.prototype.getDateLabel=function(){return moment(this.changedValue).format(this.displayFormat)},e.prototype.openDatePicker=function(){this.isTimeOpen=!1,this.isDateOpen=!0},e.prototype.openTimePicker=function(){this.isTimeOpen=!0,this.isDateOpen=!1},e.prototype.onDateUpdate=function(e){var t=this.changedValue;"DATE"===this.mode?(e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0)):t&&e&&(e.setHours(t.getHours()),e.setMinutes(t.getMinutes()),e.setSeconds(t.getSeconds()),e.setMilliseconds(t.getMilliseconds())),this.changedValue=e,"DATE"===this.mode&&t!==e&&this.validateSelectedDate()&&this.onOkClick()},e.prototype.onTimeUpdate=function(e){this.changedValue=e},e.prototype.show=function(){var e=this;this.reset(),this.modalRef=this.bsModalService.show(this.datetimepickerTemplate,{animated:!0,backdrop:"static",class:"date-picker-modal modal-dialog-centered"}),setTimeout((function(){e.hideOnClick()}),500)},e.prototype.clear=function(){this.changedValue=null,this.triggerChange(),this.hideModal()},e.prototype.setToday=function(){var e=moment().startOf("day").toDate();this.onDateUpdate(e)},e.prototype.reset=function(){this.changedValue=this._value},e.prototype.hideModal=function(){var e;(null===(e=this.modalRef)||void 0===e?void 0:e.id)&&this.bsModalService.hide(this.modalRef.id)},e.prototype.onCancelClick=function(){this.changedValue=this._value,this.hideModal()},e.prototype.onOkClick=function(){this.validateSelectedDate()&&this.triggerChange(),this.hideModal()},e.prototype.triggerChange=function(){this.value!==this.changedValue&&this.change.emit(this.changedValue)},e.prototype.ngAfterViewInit=function(){},e.prototype.ngOnDestroy=function(){this.hideModal()},e}();g.decorators=[{type:t.Component,args:[{selector:"wm-datetimepicker",template:'\n <ng-template #datetimepickerTemplate>\n <div class="app-datetime-picker">\n <div class="modal-body">\n <div class="mobile-datetime-picker-options">\n\n </div>\n <bs-datepicker-inline\n [bsConfig]="bsDatepickerConfig"\n [datesDisabled]="excludedDatesToDisable"\n bsDatepicker\n [bsValue]="changedValue"\n (bsValueChange)="onDateUpdate($event)"\n *ngIf="mode === \'DATE_TIME\' || mode === \'DATE\'">\n </bs-datepicker-inline>\n <wm-timepicker\n [value]="changedValue"\n [min]="minTime"\n [max]="maxTime"\n (change)="onTimeUpdate($event)"\n *ngIf="mode === \'DATE_TIME\' || mode === \'TIME\'"></wm-timepicker>\n <span class="text-primary date-picker-value">\n {{getDateLabel()}}\n </span>\n </div>\n <div class="modal-footer">\n <button\n *ngIf="mode === \'DATE_TIME\' || mode === \'DATE\'"\n class="btn btn-secondary today-btn"\n (click)="setToday()">{{appLocale.LABEL_TODAY_DATE || "Today" }}</button>\n <button\n class="btn btn-primary pull-right ok-btn"\n *ngIf="mode === \'DATE_TIME\' || mode === \'TIME\'"\n (click)="onOkClick()">{{appLocale.LABEL_OK || "Ok" }}</button>\n <button\n class="btn btn-secondary pull-right clear-btn"\n (click)="clear()">{{appLocale.LABEL_CLEAR_DATE || "Clear" }}</button>\n </div>\n </div>\n </ng-template>\n '}]}],g.ctorParameters=function(){return[{type:t.Injector},{type:u.BsModalService}]},g.propDecorators={datetimepickerTemplate:[{type:t.ViewChild,args:["datetimepickerTemplate",{static:!0}]}],mode:[{type:t.Input}],placement:[{type:t.Input}],_bsDatepickerConfig:[{type:t.Input,args:["config"]}],minTime:[{type:t.Input}],maxTime:[{type:t.Input}],_displayFormat:[{type:t.Input}],change:[{type:t.Output}],excludedDatesToDisable:[{type:t.Input}],value:[{type:t.Input}],bsDatepickerConfig:[{type:t.Input,args:["config"]}],excludedDaysToDisable:[{type:t.Input}],displayFormat:[{type:t.Input}]};var v=function(){function e(e){this.inj=e,this.options={hour:[],minute:[],second:[],meridian:["AM","PM"]},this.value=new Date,this.min=null,this.max=null,this.change=new t.EventEmitter,this.options.hour=this.populateNumbers(0,23),this.options.minute=this.populateNumbers(0,59),this.options.second=this.populateNumbers(0,59)}return e.prototype.populateNumbers=function(e,t){for(var n=[],i=e;i<=t;i++)n.push({label:(i<10?"0":"")+i,value:i});return n},e.prototype.set=function(e,t){e.index;var n=e.value;"HOUR"===t?this.value=moment(this.value).hour(parseInt(n)).toDate():"MINUTE"===t?this.value=moment(this.value).minute(parseInt(n)).toDate():"SECOND"===t?this.value=moment(this.value).second(parseInt(n)).toDate():"MERIDIAN"===t&&(this.value=moment(this.value).minute(n).toDate()),this.min&&this.value<this.min&&(this.value=this.min),this.max&&this.value>this.max&&(this.value=this.max),this.change.emit(this.value)},Object.defineProperty(e.prototype,"hour",{get:function(){return moment(this.value).hour()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minute",{get:function(){return moment(this.value).minute()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"second",{get:function(){return moment(this.value).second()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"meridian",{get:function(){return"AM"},enumerable:!1,configurable:!0}),e.prototype.onDateUpdate=function(e){},e.prototype.ngAfterViewInit=function(){},e}();v.decorators=[{type:t.Component,args:[{selector:"wm-timepicker",template:'\n <wm-pickergroup>\n <wm-picker\n [options]="options.hour"\n [selectedValue]="hour"\n (change)="set($event, \'HOUR\')"></wm-picker>\n <span class="app-time-separator">:</span>\n <wm-picker\n [options]="options.minute"\n [selectedValue]="minute"\n (change)="set($event, \'MINUTE\')"></wm-picker>\n <span class="app-time-separator">:</span>\n <wm-picker\n [options]="options.minute"\n [selectedValue]="second"\n (change)="set($event, \'SECOND\')"></wm-picker>\n </wm-pickergroup>\n '}]}],v.ctorParameters=function(){return[{type:t.Injector}]},v.propDecorators={value:[{type:t.Input}],min:[{type:t.Input}],max:[{type:t.Input}],change:[{type:t.Output}]};var y="CURRENT_DATE",b=["January","February","March","April","May","June","July","August","September","October","November","December"],w="default",P="default";function O(e){return Object.assign(new a.TimepickerConfig,{meridians:n.getLocaleDayPeriods(e.getSelectedLocale(),n.FormStyle.Format,n.TranslationWidth.Abbreviated)})}var S=function(e){function t(t,i){var r=e.call(this,t,i)||this;return r.isReadOnly=!1,r.clicked=!1,r.formatsByLocale={timezone:""},r._dateOptions=new o.BsDatepickerConfig,r.i18nService=r.inj.get(c.AbstractI18nService),r.invokeEventCallback("beforeload"),r.datePipe=r.inj.get(s.ToDatePipe),r.selectedLocale=r.i18nService.getSelectedLocale(),r._dateOptions.todayPosition="left",r._dateOptions.clearPosition="right",r.meridians=n.getLocaleDayPeriods(r.selectedLocale,n.FormStyle.Format,n.TranslationWidth.Abbreviated),r.loadNativeDateInput=c.isMobile()&&!r.showcustompicker,r.cancelLocaleChangeSubscription=r.getAppInstance().subscribe("locale-changed",(function(e){r.datePipe.datePipe.locale=e.angular,r._dateOptions.todayButtonLabel=r.i18nService.getLocalizedMessage("LABEL_TODAY_DATE"),r._dateOptions.clearButtonLabel=r.i18nService.getLocalizedMessage("LABEL_CLEAR_DATE")})),r}return h(t,e),Object.defineProperty(t.prototype,"timeZone",{get:function(){return this.inj.get(c.AbstractI18nService).getTimezone(this)},enumerable:!1,configurable:!0}),t.prototype.isDropDownDisplayEnabledOnInput=function(e){return e===w},t.prototype.isDataEntryModeEnabledOnInput=function(e){return e===P},t.prototype.showValidation=function(e,t,n,i){if(n)return console.warn("min max date validation failed ",i),$(e.target).val(t)},t.prototype.resetDisplayInput=function(){$(this.nativeElement).find(".display-input").val("")},t.prototype.validate=function(e){return this.invalidDateTimeFormat?{invalidDateTimeFormat:{valid:!1}}:!_.isUndefined(this.dateNotInRange)&&this.dateNotInRange?{dateNotInRange:{valid:!1}}:!_.isUndefined(this.timeNotInRange)&&this.timeNotInRange?{timeNotInRange:{valid:!1}}:this.show&&this.required?e.value?null:{required:!0}:(this.validateType="",null)},t.prototype.formatValidation=function(e,t,n){var i=this.datepattern||this.timepattern,o=this.timeZone,r=c.getFormattedDate(this.datePipe,e,i,o,null,null,this);if(t=t.trim())if("timestamp"===i){if(!_.isNaN(t)&&_.parseInt(t)!==r)return this.invalidDateTimeFormat=!0,this.validateType="incorrectformat",this.invokeOnChange(this.datavalue,void 0,!1),!1}else if(n&&(t=c.getFormattedDate(this.datePipe,t,i,o)),t!==r)return this.invalidDateTimeFormat=!0,this.validateType="incorrectformat",this.invokeOnChange(this.datavalue,void 0,!1),!1;return!0},t.prototype.minDateMaxDateValidationOnInput=function(e,t,n,i){var o=this;if(e){var r=e;e=moment(e).startOf("day").toDate();var a=moment(c.getDateObj(this.mindate)).startOf("day").toDate(),s=moment(c.getDateObj(this.maxdate)).startOf("day").toDate();if(this.mindate&&e<a){var l=this.appLocale.LABEL_MINDATE_VALIDATION_MESSAGE+" "+this.mindate+".";return this.invokeOnChange(this.datavalue,void 0,!1),i&&c.getFormattedDate(this.datePipe,a,this.datepattern,this.timeZone,null,null,this)===n?$(t.target).val(n):(this.dateNotInRange=!0,this.validateType="mindate",this.showValidation(t,n,i,l))}if(this.maxdate&&e>s){l=this.appLocale.LABEL_MAXDATE_VALIDATION_MESSAGE+" "+this.maxdate+".";return this.invokeOnChange(this.datavalue,void 0,!1),i&&c.getFormattedDate(this.datePipe,s,this.datepattern,this.timeZone,null,null,this)===n?$(t.target).val(n):(this.dateNotInRange=!0,this.validateType="maxdate",this.showValidation(t,n,i,l))}if(this.excludedates){if((c.isString(this.excludedates)?_.split(this.excludedates,","):this.excludedates).map((function(e){return c.getFormattedDate(o.datePipe,e,o.datepattern,o.timeZone,null,null,o)})).indexOf(c.getFormattedDate(this.datePipe,r,this.datepattern,this.timeZone,null,null,this))>-1)return this.dateNotInRange=!0,this.validateType="excludedates",void this.invokeOnChange(this.datavalue,void 0,!1)}if(this.excludedays){var p=_.split(this.excludedays,","),u=_.get(r,"getDay")?r.getDay():r;if(p.indexOf(u.toString())>-1)return this.dateNotInRange=!0,this.validateType="excludedays",void this.invokeOnChange(this.datavalue,void 0,!1)}}i||(this.dateNotInRange=!1,this.invokeOnChange(this.datavalue,void 0,!1))},t.prototype.hightlightToday=function(){var e=(new Date).getDate().toString();_.filter($("span:contains("+e+")").not(".is-other-month"),(function(t){$(t).text()===e&&$(t).addClass("current-date text-info")}))},t.prototype.isOtheryear=function(e){return 0===e.getMonth()&&11===this.activeDate.getMonth()||11===e.getMonth()&&0===this.activeDate.getMonth()},t.prototype.setActiveDateFocus=function(e,t){var n=this;this.setNextData(e);var i=this.activeDate.getMonth();t||(e.getMonth()<i?this.isOtheryear(e)?this.goToOtherMonthOryear("next","days"):this.goToOtherMonthOryear("previous","days"):e.getMonth()>i&&(this.isOtheryear(e)?this.goToOtherMonthOryear("previous","days"):this.goToOtherMonthOryear("next","days"))),setTimeout((function(){var t=e.getDate().toString();_.filter($("span:contains("+t+")").not(".is-other-month"),(function(i){$(i).text()===t&&($(i).hasClass("selected")&&$(i).parent().attr("aria-selected","true"),$(i).attr("aria-label",moment(e).format("dddd, MMMM Do YYYY")),$("[bsdatepickerdaydecorator]").not(".is-other-month").attr("tabindex","-1"),$(i).attr("tabindex","0"),$(i).focus(),n.activeDate=e)})),e.getMonth()===(new Date).getMonth()&&e.getFullYear()===(new Date).getFullYear()&&n.hightlightToday()}))},t.prototype.goToOtherMonthOryear=function(e,t){var n=$(".bs-datepicker-head ."+e);n.attr("disabled")||(n.trigger("click"),"days"===t?this.loadDays():"month"===t?this.loadMonths():"year"===t&&this.loadYears())},t.prototype.getMonth=function(e,t){var n=new Date(e),i=n.getMonth(),o=n.getFullYear(),r=new Date(o,i+=t),a=r.toLocaleString("en-US",{month:"long"});return{date:r,fullMonth:a}},t.prototype.addDatepickerMouseEvents=function(){var e=this,t=$(".bs-datepicker-head");t.find(".previous").click((function(t){e.next=e.getMonth(e.activeDate,0),e.prev=e.getMonth(e.activeDate,-2),e.clicked=!0,t.originalEvent&&e.setFocusForDate(-1);var n=e.getMonth(e.activeDate,-1);$(".bs-datepicker-head .previous").prepend('<p aria-hidden="false" class="sr-only">Changed to Previous Month, '+n.fullMonth+" and year "+n.date.getFullYear()+"</p>"),setTimeout((function(){$(".bs-datepicker-head .previous").focus()}))})),t.find(".next").click((function(t){e.next=e.getMonth(e.activeDate,2),e.prev=e.getMonth(e.activeDate,0),e.clicked=!0,t.originalEvent&&e.setFocusForDate(1);var n=e.getMonth(e.activeDate,1);$(".bs-datepicker-head .next").prepend('<p aria-hidden="false" class="sr-only">Changed to Next Month, '+n.fullMonth+" and year "+n.date.getFullYear()+"</p>"),setTimeout((function(){$(".bs-datepicker-head .next").focus()}))})),t.find(".current").click((function(t){t.originalEvent&&e.setFocusForCurrentMonthOryear()})),$(".bs-datepicker-body, .bs-datepicker-action-buttons").click((function(t){t.stopPropagation(),t.originalEvent&&e.setFocusForMonthOrDay()})),this.clicked||(t.find(".next").attr("aria-label","Next Month, "+this.next.fullMonth+" "+this.next.date.getFullYear()),t.find(".previous").attr("aria-label","Previous Month, "+this.prev.fullMonth+" "+this.prev.date.getFullYear()))},t.prototype.setFocusForMonthOrDay=function(){var e=$(".bs-datepicker-head .current").first().text(),t=$(".bs-datepicker-body");if(t.find("table.months").length>0){_.parseInt(e)!==this.activeDate.getFullYear()&&this.loadMonths();var n=new Date(_.parseInt(e),this.activeDate.getMonth(),this.activeDate.getDate());this.setActiveMonthFocus(n,!0)}else if(t.find("table.days").length>0){var i=b.indexOf(e);i!==this.activeDate.getMonth()&&this.loadDays();n=new Date(this.activeDate.getFullYear(),i,1);this.setActiveDateFocus(n,!0)}},t.prototype.setFocusForCurrentMonthOryear=function(){var e=$(".bs-datepicker-body");e.find("table.months").length>0?(this.loadMonths(),this.setActiveMonthFocus(this.activeDate,!0)):e.find("table.years").length>0&&(this.loadYears(),this.setActiveYearFocus(this.activeDate,!0))},t.prototype.setFocusForDate=function(e){var t=$(".bs-datepicker-body");if(t.find("table.months").length>0){this.loadMonths();var n=new Date(this.activeDate.getFullYear()+e,0,this.activeDate.getDate());this.setActiveMonthFocus(n,!0)}else if(t.find("table.years").length>0){this.loadYears();var i=t.find("table.years span").first().text();n=new Date(_.parseInt(i),this.activeDate.getMonth(),this.activeDate.getDate());this.setActiveYearFocus(n,!0)}else if(t.find("table.days").length>0){this.loadDays();n=new Date(this.activeDate.getFullYear(),this.activeDate.getMonth()+e,1);this.setActiveDateFocus(n,!0)}},t.prototype.addDatepickerKeyboardEvents=function(e,t){var n=this;this.keyEventPluginInstance=e.keyEventPlugin.constructor,this.elementScope=e;var i=document.querySelector("."+e.dateContainerCls);c.setAttr(i,"tabindex","0"),i.onkeydown=function(e){if("escape"===n.keyEventPluginInstance.getEventFullKey(e)){n.elementScope.hideDatepickerDropdown();var t=n.elementScope.nativeElement.querySelector(".display-input");setTimeout((function(){return t.focus()}))}},this.loadDays(),this.setActiveDateFocus(this.activeDate)},t.prototype.setNextData=function(e){this.next=this.getMonth(e,1),this.prev=this.getMonth(e,-1)},t.prototype.loadDays=function(){var e=this;setTimeout((function(){$("[bsdatepickerdaydecorator]").not(".is-other-month").attr("tabindex","0"),e.addKeyBoardEventsForDays(),e.addDatepickerMouseEvents()}))},t.prototype.addKeyBoardEventsForDays=function(){var e=this;$(".bs-datepicker-body").keydown((function(t){var n,i=e.keyEventPluginInstance.getEventFullKey(t);if("arrowdown"===i)t.preventDefault(),n=moment(e.activeDate).add(7,"days").toDate(),e.setActiveDateFocus(n);else if("arrowup"===i)t.preventDefault(),n=moment(e.activeDate).add(-7,"days").toDate(),e.setActiveDateFocus(n);else if("arrowleft"===i)n=moment(e.activeDate).add(-1,"days").toDate(),e.setActiveDateFocus(n);else if("arrowright"===i)n=moment(e.activeDate).add(1,"days").toDate(),e.setActiveDateFocus(n);else if("pageup"===i)t.preventDefault(),n=moment(e.activeDate).add(-1,"month").toDate(),e.setActiveDateFocus(n);else if("pagedown"===i)t.preventDefault(),n=moment(e.activeDate).add(1,"month").toDate(),e.setActiveDateFocus(n);else if("control.arrowup"===i)$(".bs-datepicker-head .current").first().click(),e.loadMonths(),e.setActiveMonthFocus(e.activeDate);else if("enter"===i){if($(document.activeElement).hasClass("disabled"))return;$(document.activeElement).click(),e.elementScope.hideDatepickerDropdown();var o=e.elementScope.nativeElement.querySelector(".display-input");setTimeout((function(){return o.focus()}))}})),this.focusBlurDatePickerHeadButtons()},t.prototype.focusBlurDatePickerHeadButtons=function(){var e=$(".bs-datepicker-head button");e.on("focus",(function(){$(this).css("background-color","#9AA0A3")})),e.on("blur",(function(){$(this).css("background-color","")}))},t.prototype.loadMonths=function(){var e=this;setTimeout((function(){e.addKeyBoardEventsForMonths(),e.addDatepickerMouseEvents()}))},t.prototype.addKeyBoardEventsForMonths=function(){var e=this;$(".bs-datepicker-body").keydown((function(t){var n,i=e.keyEventPluginInstance.getEventFullKey(t);if("arrowdown"===i)t.preventDefault(),n=moment(e.activeDate).add(3,"month").toDate(),e.setActiveMonthFocus(n);else if("arrowup"===i)t.preventDefault(),n=moment(e.activeDate).add(-3,"month").toDate(),e.setActiveMonthFocus(n);else if("arrowleft"===i)n=moment(e.activeDate).add(-1,"month").toDate(),e.setActiveMonthFocus(n);else if("arrowright"===i)n=moment(e.activeDate).add(1,"month").toDate(),e.setActiveMonthFocus(n);else if("control.arrowup"===i)$(".bs-datepicker-head .current").first().click(),e.loadYears(),e.setActiveYearFocus(e.activeDate);else if("control.arrowdown"===i||"enter"===i){if($(document.activeElement).parent().hasClass("disabled"))return;$(document.activeElement).click(),e.loadDays();var o=new Date(e.activeDate.getFullYear(),e.activeDate.getMonth(),1);e.setActiveDateFocus(o)}})),this.focusBlurDatePickerHeadButtons()},t.prototype.loadYears=function(){var e=this;setTimeout((function(){e.addKeyBoardEventsForYears(),e.addDatepickerMouseEvents()}))},t.prototype.setActiveMonthFocus=function(e,t){var n=this;this.setNextData(e);var i=b[e.getMonth()];t||(e.getFullYear()<this.activeDate.getFullYear()?this.goToOtherMonthOryear("previous","month"):e.getFullYear()>this.activeDate.getFullYear()&&this.goToOtherMonthOryear("next","month")),setTimeout((function(){$(".bs-datepicker-body table.months span").attr("tabindex","-1"),$(".bs-datepicker-body table.months span:contains("+i+")").attr("tabindex","0"),$(".bs-datepicker-body table.months span:contains("+i+")").focus(),n.activeDate=e}))},t.prototype.addKeyBoardEventsForYears=function(){var e=this;$(".bs-datepicker-body").keydown((function(t){var n,i=e.keyEventPluginInstance.getEventFullKey(t);if("arrowdown"===i)t.preventDefault(),n=moment(e.activeDate).add(4,"year").toDate(),e.setActiveYearFocus(n);else if("arrowup"===i)t.preventDefault(),n=moment(e.activeDate).add(-4,"year").toDate(),e.setActiveYearFocus(n);else if("arrowleft"===i)n=moment(e.activeDate).add(-1,"year").toDate(),e.setActiveYearFocus(n);else if("arrowright"===i)n=moment(e.activeDate).add(1,"year").toDate(),e.setActiveYearFocus(n);else if("control.arrowdown"===i||"enter"===i){if($(document.activeElement).parent().hasClass("disabled"))return;$(document.activeElement).click(),e.loadMonths(),e.setActiveMonthFocus(e.activeDate)}})),this.focusBlurDatePickerHeadButtons()},t.prototype.setActiveYearFocus=function(e,t){var n=this,i=e.getFullYear(),o=$(".bs-datepicker-body table.years span"),r=o.first().text(),a=o.last().text();t||(e.getFullYear()<_.parseInt(r)?this.goToOtherMonthOryear("previous","year"):e.getFullYear()>_.parseInt(a)&&this.goToOtherMonthOryear("next","year")),setTimeout((function(){$(".bs-datepicker-body table.years span").attr("tabindex","-1"),$(".bs-datepicker-body table.years span:contains("+i+")").attr("tabindex","0"),$(".bs-datepicker-body table.years span:contains("+i+")").focus(),n.activeDate=e}))},t.prototype.focusTimePickerPopover=function(e){this.keyEventPluginInstance=e.keyEventPlugin.constructor,this.elementScope=e,this.elementScope.ngZone.runOutsideAngular((function(){setTimeout((function(){$("timepicker .form-group").first().find("> input.form-control").focus()}))}))},t.prototype.bindTimePickerKeyboardEvents=function(){var e=this;setTimeout((function(){var t=$("body").find("> bs-dropdown-container timepicker");t.attr("tabindex",0),e.addEventsOnTimePicker(t)}))},t.prototype.focusOnInputEl=function(){var e=this;$(this.nativeElement).closest(".caption-floating").length>0&&setTimeout((function(){$(e.nativeElement).find(".app-textbox").focus()}),100)},t.prototype.isValidDate=function(e){return e&&e instanceof Date&&!isNaN(e.getTime())},t.prototype.timeFormatValidation=function(){var e=$(this.nativeElement).find("input").val(),t=c.getNativeDateObject(e,{meridians:this.meridians,pattern:this.datepattern});this.formatValidation(t,e)&&(this.invalidDateTimeFormat=!1,this.invokeOnChange(this.datavalue,void 0,!1))},t.prototype.updateTimeValue=function(e,t){var n=this;e.length<2?setTimeout((function(){"minutes"===t?n.bsTimePicker.updateMinutes("00"):n.bsTimePicker.updateSeconds("00")}),500):"minutes"===t?this.bsTimePicker.updateMinutes("00"):this.bsTimePicker.updateSeconds("00")},t.prototype.addEventsOnTimePicker=function(e){var t=this,n=e.find(".bs-timepicker-field");n.first().on("keyup",(function(e){var i=e.target.value;_.forEach(n,(function(n,o){if(e.target!==n&&""===n.value&&i.length){var r=1===o?"minutes":"seconds";t.updateTimeValue(i,r)}}))})),this.removeKeyupListener=function(){n.first().off("keyup")},e.on("keydown",(function(e){var n,i,o=$(e.target),r=o.parent(),a=t.elementScope,s=t.keyEventPluginInstance.getEventFullKey(e);if("escape"===s&&a.hideTimepickerDropdown(),o.hasClass("bs-timepicker-field")){if(r.is(":first-child")?"shift.tab"!==s&&"enter"!==s&&"escape"!==s||(a.setIsTimeOpen(!1),t.focus(),n=!0,i=!0):r.is(":last-child")||r.next().next().find("button.disabled").length?"tab"!==s&&"escape"!==s&&"enter"!==s||(a.setIsTimeOpen(!1),t.focus(),n=!0,i=!0):"enter"!==s&&"escape"!==s||(a.setIsTimeOpen(!1),t.focus(),n=!0,i=!0),n&&e.stopPropagation(),i&&e.preventDefault(),a.mintime&&a.maxtime&&!t.isValidDate(a.bsTimeValue)&&("arrowdown"===s?a.bsTimeValue=a.maxTime:"arrowup"===s&&(a.bsTimeValue=a.minTime)),"tab"===s){t.invalidDateTimeFormat=!1,t.invokeOnChange(t.datavalue,void 0,!1);var l=t.datepattern||t.timepattern;c.getFormattedDate(a.datePipe,a.bsTimeValue,l,t.timeZone,null,null,t)===a.displayValue&&$(t.nativeElement).find(".display-input").val(a.displayValue)}"arrowdown"!==s&&"arrowup"!==s||t.timeFormatValidation()}else o.hasClass("btn-default")&&("tab"!==s&&"escape"!==s||(a.setIsTimeOpen(!1),t.focus()))})),e.find("a").on("click",(function(e){var n=t.elementScope,i=$(e.target);n.mintime&&n.maxtime&&!t.isValidDate(n.bsTimeValue)&&(i.find("span").hasClass("bs-chevron-down")?n.bsTimeValue=n.maxTime:i.find("span").hasClass("bs-chevron-up")&&(n.bsTimeValue=n.minTime)),t.timeFormatValidation()}))},t.prototype.updateFormat=function(e){"datepattern"===e?(this._dateOptions.dateInputFormat=this.datepattern,this.showseconds=_.includes(this.datepattern,"s"),this.ismeridian=_.includes(this.datepattern,"h")):"timepattern"===e&&(this.showseconds=_.includes(this.timepattern,"s"),this.ismeridian=_.includes(this.timepattern,"h"))},t.prototype.getMobileInput=function(){return this.nativeElement.querySelector(".mobile-input")},t.prototype.onDateTimeInputBlur=function(){var e=this.getMobileInput();if(e&&!c.hasCordova()){for(var t=this.nativeElement.children,n=0;n<t.length;n++)t[n].classList.remove("add-opacity");e.classList.remove("remove-opacity")}},t.prototype.onDateTimeInputFocus=function(e){if(void 0===e&&(e=!1),this.loadNativeDateInput){var t=this.getMobileInput();if(!e||c.hasCordova())t&&this._triggeredByUser&&(t.focus(),t.click());else{for(var n=this.nativeElement.children,i=0;i<n.length;i++)n[i].classList.add("add-opacity");t.classList.add("remove-opacity")}}},t.prototype.getCordovaPluginDatePickerApi=function(){if(c.isIos())return _.get(window,"cordova.wavemaker.datePicker.selectDate")},t.prototype.showDatePickerModal=function(){this.datetimepickerComponent.show()},t.prototype.blurDateInput=function(e){var t=this.nativeElement.querySelector(".display-input");e&&setTimeout((function(){return t.blur()}))},t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("required"!==t?"datepattern"===t?this.updateFormat(t):"showweeks"===t?this._dateOptions.showWeekNumbers=n:"mindate"===t?(this._dateOptions.minDate=n===y?this.mindate=new Date:c.getDateObj(n),this.minDateMaxDateValidationOnInput(this.datavalue)):"maxdate"===t?(this._dateOptions.maxDate=n===y?this.maxdate=new Date:c.getDateObj(n),this.minDateMaxDateValidationOnInput(this.datavalue)):"excludedates"===t||"excludedays"===t?(this.excludedays&&(this.excludedDaysToDisable=_.split(this.excludedays,",").map((function(e){return+e}))),this.excludedates&&(this.excludedDatesToDisable=this.excludedates,c.isString(this.excludedates)&&(this.excludedDatesToDisable=_.split(this.excludedates,",")),this.excludedDatesToDisable=this.excludedDatesToDisable.map((function(e){return c.getDateObj(e)}))),this.minDateMaxDateValidationOnInput(this.datavalue)):"selectfromothermonth"===t?this._dateOptions.selectFromOtherMonth=n:"todaybutton"===t?this._dateOptions.showTodayButton=n:"clearbutton"===t?this._dateOptions.showClearButton=n:"todaybuttonlabel"===t?this._dateOptions.todayButtonLabel=this.i18nService.getLocalizedMessage(n)||n:"clearbuttonlabel"===t?this._dateOptions.clearButtonLabel=this.i18nService.getLocalizedMessage(n)||n:"showcustompicker"===t?this.loadNativeDateInput=c.isMobile()&&!this.showcustompicker:"adaptiveposition"===t?this._dateOptions.adaptivePosition=n:e.prototype.onPropertyChange.call(this,t,n,i):this._onChange(this.datavalue))},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),this.containerTarget=s.getContainerTargetClass(this.nativeElement),this.isReadOnly="undefined"!=this.dataentrymode&&!this.isDataEntryModeEnabledOnInput(this.dataentrymode);var t=this.getMobileInput();t&&setTimeout((function(){t.style.width="100%",t.style.height="100%"}))},t.prototype.ngOnDestroy=function(){this.dateOnShowSubscription&&this.dateOnShowSubscription.unsubscribe(),this.cancelLocaleChangeSubscription&&this.cancelLocaleChangeSubscription(),e.prototype.ngOnDestroy.call(this)},t.prototype.ngOnDetach=function(){var e;null===(e=this.datetimepickerComponent)||void 0===e||e.hideModal()},t.prototype.setTimezone=function(e){this.i18nService.setTimezone(e,this)},t}(p.BaseFormCustomComponent);S.decorators=[{type:t.Directive}],S.ctorParameters=function(){return[{type:t.Injector},null]},S.propDecorators={bsDropdown:[{type:t.ViewChild,args:[r.BsDropdownDirective]}],bsTimePicker:[{type:t.ViewChild,args:[a.TimepickerComponent]}],datetimepickerComponent:[{type:t.ViewChild,args:[g]}]};var E=new Map([["autofocus",s.PROP_BOOLEAN],["class",s.PROP_STRING],["dataentrymode",Object.assign({value:"default"},s.PROP_STRING)],["datavaluesource",s.PROP_ANY],["datavalue",s.PROP_STRING],["datepattern",s.PROP_STRING],["disabled",s.PROP_BOOLEAN],["excludedays",s.PROP_STRING],["excludedates",s.PROP_STRING],["hint",s.PROP_STRING],["maxdate",s.PROP_STRING],["mindate",s.PROP_STRING],["name",s.PROP_STRING],["outputformat",Object.assign({value:"yyyy-MM-dd"},s.PROP_STRING)],["placeholder",Object.assign({value:"Select Date"},s.PROP_STRING)],["readonly",s.PROP_BOOLEAN],["required",s.PROP_BOOLEAN],["shortcutkey",s.PROP_STRING],["show",Object.assign({value:!0},s.PROP_BOOLEAN)],["showdropdownon",Object.assign({value:"default"},s.PROP_STRING)],["showbuttonbar",Object.assign({value:!0},s.PROP_BOOLEAN)],["showcustompicker",Object.assign({value:!1},s.PROP_BOOLEAN)],["showindevice",Object.assign({displayType:"inline-block",value:"all"},s.PROP_STRING)],["showweeks",Object.assign({value:!1},s.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},s.PROP_NUMBER)],["selectfromothermonth",Object.assign({value:!0},s.PROP_BOOLEAN)],["todaybutton",Object.assign({value:!0},s.PROP_BOOLEAN)],["clearbutton",Object.assign({value:!0},s.PROP_BOOLEAN)],["adaptiveposition",Object.assign({value:!1},s.PROP_BOOLEAN)],["todaybuttonlabel",Object.assign({value:"LABEL_TODAY_DATE"},s.PROP_STRING)],["clearbuttonlabel",Object.assign({value:"LABEL_CLEAR_DATE"},s.PROP_STRING)]]),T=function(){s.register("wm-date",E),s.registerFormWidget(c.FormWidgetType.DATE,new Map(E))},C={widgetType:"wm-date",hostClass:"app-date input-group"},A=function(e){function t(t,n,i,o){var r=e.call(this,t,C)||this;return r.cdRef=n,r.appDefaults=i,r.isOpen=!1,r.isEnterPressedOnDateInput=!1,s.styler(r.nativeElement,r),r.keyEventPlugin=o[1],r.dateContainerCls="app-date-"+r.widgetId,r._dateOptions.containerClass="app-date "+r.dateContainerCls,r._dateOptions.showWeekNumbers=!1,r._bsDefaultLoadCheck=!0,r.datepattern=r.appDefaults.dateFormat||c.getDisplayDateTimeFormat(c.FormWidgetType.DATE),r.updateFormat("datepattern"),r}return h(t,e),Object.defineProperty(t.prototype,"timestamp",{get:function(){return this.bsDataValue?this.bsDataValue.valueOf():void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dateInputFormat",{get:function(){return this._dateOptions.dateInputFormat||"yyyy-MM-dd"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"displayValue",{get:function(){return c.getFormattedDate(this.datePipe,this.bsDataValue,this.dateInputFormat,this.timeZone,null,this.isCurrentDate,this)||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nativeDisplayValue",{get:function(){return c.getFormattedDate(this.datePipe,this.bsDataValue,"yyyy-MM-dd",this.timeZone,null,this.isCurrentDate,this)||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"datavalue",{get:function(){return c.getFormattedDate(this.datePipe,this.bsDataValue,this.outputformat,this.timeZone,null,this.isCurrentDate,this)||""},set:function(e){var t=this;"CURRENT_DATE"===e?(setTimeout((function(){t.bsDataValue=t.timeZone?c.getMomentLocaleObject(t.timeZone):new Date}),50),this.isCurrentDate=!0):(this.bsDataValue=e?c.getDateObj(e,{isNativePicker:this.loadNativeDateInput},this.timeZone):void 0,this.isCurrentDate=!1),this.invokeOnChange(this.datavalue,void 0,!0),this.cdRef.detectChanges()},enumerable:!1,configurable:!0}),t.prototype.onDisplayDateChange=function(e,t){if(void 0===t&&(t=!1),this.isEnterPressedOnDateInput)this.isEnterPressedOnDateInput=!1;else{var n=c.getDateObj(e.target.value,{pattern:this.datepattern,isNativePicker:t});this.formatValidation(n,e.target.value,t)&&(t&&this.minDateMaxDateValidationOnInput(n,e,this.displayValue,t)||this.setDataValue(n))}},t.prototype.setDataValue=function(e){this.invalidDateTimeFormat=!1,this.minDateMaxDateValidationOnInput(e),c.getFormattedDate(this.datePipe,e,this.dateInputFormat,this.timeZone,null,this.isCurrentDate,this)===this.displayValue&&$(this.nativeElement).find(".display-input").val(this.displayValue),this.bsDataValue=e||void 0,this.invokeOnChange(this.datavalue,{},!0)},t.prototype.onDatePickerOpen=function(){this.isOpen=!0,this.bsDataValue?this.activeDate=this.bsDataValue:this.activeDate=new Date,this.bsDataValue||this.hightlightToday(),this.$element.find(".model-holder").width("1px"),$("bs-datepicker-container").attr("aria-label","Use Arrow keys to navigate dates, Choose Date from datepicker"),$(".bs-calendar-container").removeAttr("role");var e=$(".bs-datepicker-container")[0];this.focusTrap=s.setFocusTrap(e,!0),this.focusTrap.activate(),this.addDatepickerKeyboardEvents(this,!1),c.adjustContainerPosition($("bs-datepicker-container"),this.nativeElement,this.bsDatePickerDirective._datepicker),c.adjustContainerRightEdges($("bs-datepicker-container"),this.nativeElement,this.bsDatePickerDirective._datepicker)},t.prototype.onInputBlur=function(e){$(e.relatedTarget).hasClass("current-date")||(this.invokeOnTouched(),this.invokeEventCallback("blur",{$event:e}))},t.prototype.hideDatepickerDropdown=function(){var e;this.invokeOnTouched(),this.isOpen=!1,null===(e=this.focusTrap)||void 0===e||e.deactivate(),this.isEnterPressedOnDateInput=!1,this.deregisterEventListener&&this.deregisterEventListener(),this.blurDateInput(this.isOpen)},t.prototype.handleEvent=function(t,n,i,o){_.includes(["blur","focus","change","click"],n)||e.prototype.handleEvent.call(this,t,n,i,o)},t.prototype.toggleDpDropdown=function(e,t){void 0===t&&(t=!1),this.loadNativeDateInput&&(t||this.onDateTimeInputFocus()),"click"===e.type&&this.invokeEventCallback("click",{$event:e}),e.target&&$(e.target).is("input")&&!this.isDropDownDisplayEnabledOnInput(this.showdropdownon)?e.stopPropagation():(this.bsDatePickerDirective.toggle(),this.addBodyClickListener(this.bsDatePickerDirective.isOpen))},t.prototype.addBodyClickListener=function(e){var t=this;if(e){var n=document.querySelector("body");setTimeout((function(){var e=n.querySelector("."+t.dateContainerCls);t.deregisterEventListener=c.addEventListenerOnElement(n,e,t.nativeElement,"click",t.isDropDownDisplayEnabledOnInput(t.showdropdownon),(function(){t.isOpen=!1}),0,!0)}),350)}},t.prototype.onDisplayKeydown=function(e){if(this.isDropDownDisplayEnabledOnInput(this.showdropdownon))if(e.stopPropagation(),"enter"===this.keyEventPlugin.constructor.getEventFullKey(e)){var t=c.getDateObj(e.target.value,{pattern:this.datepattern});e.preventDefault();var n=c.getFormattedDate(this.datePipe,t,this.dateInputFormat,this.timeZone,null,this.isCurrentDate,this),i=e.target.value.trim();i&&"timestamp"===this.datepattern?_.isNaN(i)||_.parseInt(i)===n||(this.invalidDateTimeFormat=!0,this.invokeOnChange(this.datavalue,e,!1)):i&&i!==n?(this.invalidDateTimeFormat=!0,this.invokeOnChange(this.datavalue,e,!1)):(this.invalidDateTimeFormat=!1,this.isEnterPressedOnDateInput=!0,this.bsDatePickerDirective.bsValue=e.target.value?t:""),this.toggleDpDropdown(e)}else this.hideDatepickerDropdown();else this.hideDatepickerDropdown()},t.prototype.onDateChange=function(e){this._bsDefaultLoadCheck?this._bsDefaultLoadCheck=!1:this.setDataValue(e)},t}(S);A.initializeProps=T(),A.decorators=[{type:t.Component,args:[{selector:"[wmDate]",template:' <input class="form-control app-textbox app-dateinput display-input"\n focus-target\n type="text"\n [name]="name"\n [tabindex]="loadNativeDateInput ? \'-1\' : tabindex"\n [attr.aria-hidden]="!!loadNativeDateInput"\n [value]="displayValue"\n (click)="toggleDpDropdown($event, true)"\n (focus)="onDateTimeInputFocus(); invokeOnFocus($event);"\n (blur)="onInputBlur($event)"\n [disabled]="disabled || readonly"\n [autofocus]="autofocus"\n [required]="required"\n [readOnly]="isReadOnly"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint"\n (change)="onDisplayDateChange($event)"\n (keydown)="this._triggeredByUser = true; onDisplayKeydown($event);">\n\n <span class="input-group-btn">\n <button type="button"\n class="btn btn-default btn-time"\n [tabindex]="loadNativeDateInput ? \'-1\' : tabindex"\n [attr.aria-hidden]="!!loadNativeDateInput"\n [disabled]="disabled || readonly"\n [attr.aria-label]="displayValue ? \'Change Date \' + displayValue : \'Choose date by pressing enter\'"\n aria-haspopup="true"\n aria-expanded="false"\n (click)="toggleDpDropdown($event, false)">\n <i aria-hidden="true"\n class="app-icon wm-sl-l sl-calendar"></i>\n </button>\n </span>\n <div style="width: 0;display: inline-block;">\n <input class="model-holder"\n aria-label="datepicker dropdownmenu"\n aria-controls="date"\n [tabindex]="-1"\n [attr.aria-hidden]="!!loadNativeDateInput"\n [container]="containerTarget || \'body\'"\n [bsConfig]="_dateOptions"\n [isOpen]="isOpen"\n #datepicker="bsDatepicker"\n bsDatepicker\n [daysDisabled]="excludedDaysToDisable"\n [datesDisabled]="excludedDatesToDisable"\n placement="bottom right"\n [isDisabled]="disabled || readonly"\n [bsValue]="bsDataValue"\n (onShown)="onDatePickerOpen()"\n (onHidden)="hideDatepickerDropdown()"\n (bsValueChange)="onDateChange($event)">\n</div>\n\n<ng-template [ngIf]="loadNativeDateInput">\n <wm-datetimepicker\n dateTimePicker\n mode="DATE"\n [config]="_dateOptions"\n [placement]="modal"\n [excludedDaysToDisable]="excludedDaysToDisable"\n [excludedDatesToDisable]="excludedDatesToDisable"\n [displayFormat]="dateInputFormat"\n [value]="bsDataValue"\n (change)="onDateChange($event)">\n </wm-datetimepicker>\n <div class="mobile-input mobile-datepicker-container"\n [tabindex]="tabindex || 0"\n (focus)="onDateTimeInputFocus(true); invokeOnFocus($event);"\n (blur)="onDateTimeInputBlur(); invokeOnTouched($event)"\n [attr.aria-label]="displayValue ? \'Change Date\' + displayValue : \'Choose Date\'"\n (click)="!(disabled || readonly || isCurrentDate) && showDatePickerModal()">\n </div>\n</ng-template>\n',providers:[s.provideAs(A,i.NG_VALUE_ACCESSOR,!0),s.provideAs(A,i.NG_VALIDATORS,!0),s.provideAsWidgetRef(A)]}]}],A.ctorParameters=function(){return[{type:t.Injector},{type:t.ChangeDetectorRef},{type:c.AppDefaults},{type:void 0,decorators:[{type:t.Inject,args:[l.EVENT_MANAGER_PLUGINS]}]}]},A.propDecorators={bsDatePickerDirective:[{type:t.ViewChild,args:[o.BsDatepickerDirective]}]};var R=new Map([["autofocus",s.PROP_BOOLEAN],["class",s.PROP_STRING],["dataentrymode",Object.assign({value:"default"},s.PROP_STRING)],["datavaluesource",s.PROP_ANY],["datavalue",s.PROP_STRING],["datepattern",s.PROP_STRING],["disabled",s.PROP_BOOLEAN],["excludedays",s.PROP_STRING],["excludedates",s.PROP_STRING],["hint",s.PROP_STRING],["hourstep",Object.assign({value:1},s.PROP_NUMBER)],["maxdate",s.PROP_STRING],["mindate",s.PROP_STRING],["minutestep",Object.assign({value:15},s.PROP_NUMBER)],["name",s.PROP_STRING],["outputformat",Object.assign({value:"timestamp"},s.PROP_STRING)],["placeholder",Object.assign({value:"Select date time"},s.PROP_STRING)],["readonly",s.PROP_BOOLEAN],["required",s.PROP_BOOLEAN],["secondsstep",Object.assign({value:1},s.PROP_NUMBER)],["shortcutkey",s.PROP_STRING],["show",Object.assign({value:!0},s.PROP_BOOLEAN)],["showdropdownon",Object.assign({value:"default"},s.PROP_STRING)],["showbuttonbar",s.PROP_BOOLEAN],["showcustompicker",Object.assign({value:!1},s.PROP_BOOLEAN)],["showindevice",Object.assign({displayType:"inline-block",value:"all"},s.PROP_STRING)],["showweeks",s.PROP_BOOLEAN],["tabindex",Object.assign({value:0},s.PROP_NUMBER)],["timestamp",s.PROP_STRING],["selectfromothermonth",Object.assign({value:!0},s.PROP_BOOLEAN)],["todaybutton",Object.assign({value:!0},s.PROP_BOOLEAN)],["clearbutton",Object.assign({value:!0},s.PROP_BOOLEAN)],["adaptiveposition",Object.assign({value:!1},s.PROP_BOOLEAN)],["todaybuttonlabel",Object.assign({value:"LABEL_TODAY_DATE"},s.PROP_STRING)],["clearbuttonlabel",Object.assign({value:"LABEL_CLEAR_DATE"},s.PROP_STRING)]]),I=function(){s.register("wm-datetime",R),s.registerFormWidget(c.FormWidgetType.DATETIME,new Map(R)),s.registerFormWidget(c.FormWidgetType.TIMESTAMP,new Map(R))},D={widgetType:"wm-datetime",hostClass:"app-datetime input-group"},N="CURRENT_DATE",x=O,k=function(e){function t(t,n,i,o,r,a){var l=e.call(this,t,D)||this;return l.ngZone=n,l.cdRef=i,l.appDefaults=o,l.isEnterPressedOnDateInput=!1,l.isTimeOpen=!1,l.isDateOpen=!1,l.isCurrentDate=!1,l._debouncedOnChange=_.debounce(l.invokeOnChange,10),l.registerDestroyListener((function(){return l.clearTimeInterval()})),s.styler(l.nativeElement,l),l.app=r,l.keyEventPlugin=a[1],l.dateContainerCls="app-date-"+l.widgetId,l._dateOptions.containerClass="app-date "+l.dateContainerCls,l._dateOptions.showWeekNumbers=!1,l.datepattern=l.appDefaults.dateTimeFormat||c.getDisplayDateTimeFormat(c.FormWidgetType.DATETIME),l.updateFormat("datepattern"),l}return h(t,e),Object.defineProperty(t.prototype,"timestamp",{get:function(){return this.proxyModel?this.proxyModel.valueOf():void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dateInputFormat",{get:function(){return this._dateOptions.dateInputFormat||"yyyy-MM-ddTHH:mm:ss"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"displayValue",{get:function(){return c.getFormattedDate(this.datePipe,this.proxyModel,this.dateInputFormat,this.timeZone,this.key,this.isCurrentDate,this)||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nativeDisplayValue",{get:function(){return c.getFormattedDate(this.datePipe,this.proxyModel,"yyyy-MM-ddTHH:mm:ss",this.timeZone,this.key,this.isCurrentDate,this)||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"datavalue",{get:function(){return this.isCurrentDate&&!this.proxyModel?N:c.getFormattedDate(this.datePipe,this.proxyModel,this.outputformat,this.timeZone,null,null,this)},set:function(e){e===N?(this.isCurrentDate=!0,this.setTimeInterval()):(this.proxyModel=e?c.getDateObj(e,{isNativePicker:this.loadNativeDateInput},this.timeZone):void 0,this.clearTimeInterval(),this.isCurrentDate=!1),this.bsTimeValue=this.bsDateValue=this.proxyModel,this.cdRef.detectChanges()},enumerable:!1,configurable:!0}),t.prototype.setTimeInterval=function(){var e=this;this.timeinterval||(this.timeinterval=setInterval((function(){var t=e.timeZone?c.getMomentLocaleObject(e.timeZone):new Date;e.onModelUpdate(t)}),1e3))},t.prototype.clearTimeInterval=function(){this.timeinterval&&(clearInterval(this.timeinterval),this.timeinterval=null)},t.prototype.toggleTimePicker=function(e,t){this.loadNativeDateInput?this.onDateTimeInputFocus():(this.isTimeOpen=e,t&&"click"===t.type&&this.invokeEventCallback("click",{$event:t}),this.addTimepickerClickListener(this.isTimeOpen))},t.prototype.addTimepickerClickListener=function(e){var t=this;if(e){var n=document.querySelector("body");setTimeout((function(){var e=$(n).find(">bs-dropdown-container .dropdown-menu").get(0);t.deregisterTimepickeEventListener=c.addEventListenerOnElement(n,e,t.nativeElement,"click",t.isDropDownDisplayEnabledOnInput(t.showdropdownon),(function(){t.toggleTimePicker(!1)}),0,!0)}),350)}},t.prototype.setIsTimeOpen=function(e){this.isTimeOpen=e},t.prototype.hideTimepickerDropdown=function(){this.invokeOnTouched(),this.toggleTimePicker(!1),this.deregisterTimepickeEventListener&&this.deregisterTimepickeEventListener();var e=$(this.nativeElement).closest(".app-composite-widget.caption-floating");e.length>0&&this.app.notify("captionPositionAnimate",{displayVal:this.displayValue,nativeEl:e})},t.prototype.onTimepickerOpen=function(){var e=document.querySelectorAll("timepicker");_.forEach(e,(function(e){c.addClass(e.parentElement,"app-datetime",!0)})),this.bsDatePickerDirective.hide(),this.focusTimePickerPopover(this),this.bindTimePickerKeyboardEvents(),c.adjustContainerPosition($("bs-dropdown-container"),this.nativeElement,this.bsDropdown._dropdown,$("bs-dropdown-container .dropdown-menu")),c.adjustContainerRightEdges($("bs-dropdown-container"),this.nativeElement,this.bsDropdown._dropdown,$("bs-dropdown-container .dropdown-menu"))},t.prototype.onDatePickerOpen=function(){this.isDateOpen=!this.isDateOpen,this.toggleTimePicker(!1),this.$element.find(".model-holder").width("1px"),$("bs-datepicker-container").attr("aria-label","Use Arrow keys to navigate dates, Choose Date from datepicker"),$(".bs-calendar-container").removeAttr("role");var e=$(".bs-datepicker-container")[0];this.focusTrap=s.setFocusTrap(e,!0),this.focusTrap.activate(),this.bsDateValue?this.activeDate=this.bsDateValue:this.activeDate=new Date,this.bsDateValue||this.hightlightToday(),this.addDatepickerKeyboardEvents(this,!0),c.adjustContainerPosition($("bs-datepicker-container"),this.nativeElement,this.bsDatePickerDirective._datepicker)},t.prototype.onModelUpdate=function(e,t){if("date"===t&&(this.invalidDateTimeFormat=!1,c.getFormattedDate(this.datePipe,e,this.dateInputFormat,this.timeZone,this.key,this.isCurrentDate,this)===this.displayValue&&$(this.nativeElement).find(".display-input").val(this.displayValue)),this.minDateMaxDateValidationOnInput(e),!e)return this.bsDateValue&&this.bsTimePicker&&(""===this.bsTimePicker.hours||""===this.bsTimePicker.minutes||""===this.bsTimePicker.seconds)?this.bsDateValue=this.bsTimeValue=this.proxyModel=moment(this.bsDateValue).startOf("day").toDate():this.bsDateValue=this.bsTimeValue=this.proxyModel=void 0,void((e!==this.datavalue||!this.datavalue&&this.prevDatavalue)&&this._debouncedOnChange(this.datavalue,{},!0));"date"===t&&this.isDateOpen&&this.toggleTimePicker(!0),this.proxyModel=e,this.proxyModel&&(this.bsDateValue=this.bsTimeValue=e),this._debouncedOnChange(this.datavalue,{},!0),this.cdRef.detectChanges();var n=$(".bs-timepicker-field");if(this.timeZone&&"datetimestamp"===this.key&&n.length){var i=c.getFormattedDate(this.datePipe,e,this.getTimePattern(),this.timeZone,this.key,null,this);this.updateTimepickerFields(i,n)}},t.prototype.getTimePattern=function(){var e,t=this.datepattern.toLowerCase().indexOf("h"),n=this.datepattern.toLowerCase().indexOf(":ss");(n>-1||(n=this.datepattern.toLowerCase().indexOf(":mm"))>-1)&&(n+=3);var i=this.datepattern.toLowerCase().indexOf("a");return e=this.datepattern.substr(t,n),i>-1&&(e+=" a"),e},t.prototype.updateTimepickerFields=function(e,t){for(var n,i=$("timepicker button.text-center"),o=e.split(" "),r=o[0].split(":"),a=0;a<t.length;a++)t[a].value=r[a];(null===(n=null==i?void 0:i.html())||void 0===n?void 0:n.trim())!==o[1]&&i.text(o[1])},t.prototype.preventTpClose=function(e){e.stopImmediatePropagation()},t.prototype.toggleDpDropdown=function(e,t){void 0===t&&(t=!1),this.loadNativeDateInput?t||this.onDateTimeInputFocus():("click"===e.type&&this.invokeEventCallback("click",{$event:e}),e.target&&$(e.target).is("input")&&!this.isDropDownDisplayEnabledOnInput(this.showdropdownon)?e.stopPropagation():(this.bsDatePickerDirective.toggle(),this.addBodyClickListener(this.bsDatePickerDirective.isOpen)))},t.prototype.addBodyClickListener=function(e){var t=this;if(e){var n=document.querySelector("body");setTimeout((function(){var e=n.querySelector("."+t.dateContainerCls);t.deregisterDatepickerEventListener=c.addEventListenerOnElement(n,e,t.nativeElement,"click",t.isDropDownDisplayEnabledOnInput(t.showdropdownon),(function(){t.bsDatePickerDirective.hide()}),0,!0)}),350)}},t.prototype.hideDatepickerDropdown=function(){var e;this.isDateOpen=!1,null===(e=this.focusTrap)||void 0===e||e.deactivate(),this.invokeOnTouched(),this.bsDatePickerDirective.hide(),this.bsDateValue&&this.toggleTimePicker(!0),this.isEnterPressedOnDateInput=!1,this.deregisterDatepickerEventListener&&this.deregisterDatepickerEventListener();var t=$(this.nativeElement).closest(".app-composite-widget.caption-floating");t.length>0&&this.app.notify("captionPositionAnimate",{displayVal:this.displayValue,nativeEl:t}),this.blurDateInput(this.isDateOpen)},t.prototype.onDateChange=function(e,t){if(this.isEnterPressedOnDateInput)this.isEnterPressedOnDateInput=!1;else{var n=e.target.value.trim();n=n?c.getNativeDateObject(n,{pattern:this.loadNativeDateInput?this.outputformat:this.datepattern,meridians:this.meridians,isNativePicker:this.loadNativeDateInput}):void 0,this.formatValidation(n,e.target.value,t)&&(t&&this.minDateMaxDateValidationOnInput(n,e,this.displayValue,t)||(this.invalidDateTimeFormat=!1,this.onModelUpdate(n)))}},t.prototype.onDisplayKeydown=function(e){if(this.isDropDownDisplayEnabledOnInput(this.showdropdownon)){e.stopPropagation();var t=e.target.value.trim(),n=this.keyEventPlugin.constructor.getEventFullKey(e);if("enter"===n||"arrowdown"===n){t=t?c.getNativeDateObject(t,{pattern:this.loadNativeDateInput?this.outputformat:this.datepattern,meridians:this.meridians}):void 0,e.preventDefault();var i=c.getFormattedDate(this.datePipe,t,this.dateInputFormat,this.timeZone,this.key,this.isCurrentDate,this),o=e.target.value.trim();o&&"timestamp"===this.datepattern?_.isNaN(o)||_.parseInt(o)===i||(this.invalidDateTimeFormat=!0,this.invokeOnChange(this.datavalue,e,!1)):o&&o!==i?(this.invalidDateTimeFormat=!0,this.invokeOnChange(this.datavalue,e,!1)):(this.invalidDateTimeFormat=!1,this.isEnterPressedOnDateInput=!0,this.bsDatePickerDirective.bsValue=t),this.toggleDpDropdown(e)}else this.hideDatepickerDropdown(),this.hideTimepickerDropdown()}else this.hideDatepickerDropdown(),this.hideTimepickerDropdown()},t.prototype.isValid=function(e){if(!e){var t=$(this.nativeElement).find("input").val(),n=c.getNativeDateObject(t,{pattern:this.loadNativeDateInput?this.outputformat:this.datepattern,meridians:this.meridians,isNativePicker:this.loadNativeDateInput});if(!this.formatValidation(n,t))return}},t.prototype.handleEvent=function(t,n,i,o){_.includes(["blur","focus","change","click"],n)||e.prototype.handleEvent.call(this,t,n,i,o)},t.prototype.onInputBlur=function(e){$(e.relatedTarget).hasClass("current-date")||(this.invokeOnTouched(),this.invokeEventCallback("blur",{$event:e}))},t}(S);k.initializeProps=I(),k.decorators=[{type:t.Component,args:[{selector:"[wmDateTime]",template:' <div dropdown\n [isOpen]="isTimeOpen"\n autoClose="false"\n [container]="\'body\'"\n (onShown)="onTimepickerOpen()"\n style="display: inherit;">\n <input class="form-control app-textbox display-input"\n [attr.aria-label]="hint"\n focus-target\n [name]="name"\n [tabindex]="loadNativeDateInput ? \'-1\' : tabindex"\n [attr.aria-hidden]="!!loadNativeDateInput"\n type="text"\n [value]="displayValue"\n (click)="toggleDpDropdown($event, true)"\n (focus)="onDateTimeInputFocus(); invokeOnFocus($event);"\n (blur)="onInputBlur($event)"\n (change)="onDateChange($event)"\n [autofocus]="autofocus"\n [disabled]="disabled || readonly || isCurrentDate"\n [required]="required"\n [readOnly]="isReadOnly"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n (keydown)="this._triggeredByUser = true; onDisplayKeydown($event)">\n\n <span class="input-group-btn">\n <button type="button"\n class="btn btn-default btn-date"\n [tabindex]="loadNativeDateInput ? \'-1\' : tabindex"\n [attr.aria-hidden]="!!loadNativeDateInput"\n [disabled]="disabled || readonly || isCurrentDate"\n [attr.aria-label]="displayValue ? \'Change Date \' + displayValue : \'Choose date by pressing enter\'"\n aria-haspopup="true"\n aria-expanded="false"\n (click)="toggleDpDropdown($event, false)">\n <i aria-hidden="true"\n class="app-icon wm-sl-l sl-calendar"></i>\n </button>\n <button type="button"\n class="btn btn-default btn-time"\n [tabindex]="loadNativeDateInput ? \'-1\' : tabindex"\n [attr.aria-hidden]="!!loadNativeDateInput"\n [disabled]="disabled || readonly || isCurrentDate"\n aria-label="Select time"\n aria-haspopup="true"\n aria-expanded="false"\n (click)="toggleTimePicker(!isTimeOpen, $event)">\n <i aria-hidden="true"\n class="app-icon wm-sl-l sl-time"></i>\n </button>\n </span>\n <div style="width: 0;display: inline-block;">\n <input class="model-holder"\n aria-label="datepicker dropdownmenu"\n aria-controls="date"\n focus-target\n [tabindex]="-1"\n [attr.aria-hidden]="!!loadNativeDateInput"\n [container]="containerTarget || \'body\'"\n [bsConfig]="_dateOptions"\n [isOpen]="isDateOpen"\n placement="bottom right"\n (onShown)="onDatePickerOpen()"\n (onHidden)="hideDatepickerDropdown()"\n [daysDisabled]="excludedDaysToDisable"\n [datesDisabled]="excludedDatesToDisable"\n #datepicker=bsDatepicker\n bsDatepicker\n [isDisabled]="disabled || readonly || isCurrentDate"\n [bsValue]="bsDateValue"\n (bsValueChange)="onModelUpdate($event, \'date\')">\n </div>\n <div *dropdownMenu\n class="dropdown-menu"\n aria-label="timepicker dropdown"\n aria-controls="time"\n (click)="preventTpClose($event)">\n <timepicker class="model-holder"\n [showMeridian]="ismeridian"\n [readonlyInput]="disabled || readonly || isCurrentDate"\n [(ngModel)]="bsTimeValue"\n [min]="minTime"\n [max]="maxTime"\n [hourStep]="hourstep"\n [minuteStep]="minutestep"\n [secondsStep]="secondsstep"\n [mousewheel]="true"\n [arrowkeys]="true"\n (isValid)="isValid($event)"\n [showSeconds]="showseconds"\n (ngModelChange)="onModelUpdate($event, \'time\')"></timepicker>\n </div>\n </div>\n<ng-template [ngIf]="loadNativeDateInput">\n <wm-datetimepicker\n dateTimePicker\n [config]="_dateOptions"\n [placement]="modal"\n [excludedDaysToDisable]="excludedDaysToDisable"\n [excludedDatesToDisable]="excludedDatesToDisable"\n [displayFormat]="dateInputFormat"\n [value]="bsDateValue"\n (change)="onModelUpdate($event, \'date\')">\n </wm-datetimepicker>\n <div class="mobile-input mobile-datepicker-container"\n [tabindex]="tabindex || 0"\n (focus)="onDateTimeInputFocus(true); invokeOnFocus($event)"\n (blur)="onDateTimeInputBlur(); invokeOnTouched($event)"\n (click)="!(disabled || readonly || isCurrentDate) && showDatePickerModal()">\n </div>\n</ng-template>\n',providers:[s.provideAs(k,i.NG_VALUE_ACCESSOR,!0),s.provideAs(k,i.NG_VALIDATORS,!0),s.provideAsWidgetRef(k),{provide:a.TimepickerConfig,deps:[c.AbstractI18nService],useFactory:x}]}]}],k.ctorParameters=function(){return[{type:t.Injector},{type:t.NgZone},{type:t.ChangeDetectorRef},{type:c.AppDefaults},{type:c.App},{type:void 0,decorators:[{type:t.Inject,args:[l.EVENT_MANAGER_PLUGINS]}]}]},k.propDecorators={bsDatePickerDirective:[{type:t.ViewChild,args:[o.BsDatepickerDirective]}]};var M=new Map([["autofocus",s.PROP_BOOLEAN],["class",s.PROP_STRING],["dataentrymode",Object.assign({value:"default"},s.PROP_STRING)],["datavaluesource",s.PROP_ANY],["datavalue",s.PROP_STRING],["disabled",s.PROP_BOOLEAN],["hint",s.PROP_STRING],["hourstep",Object.assign({value:1},s.PROP_NUMBER)],["maxtime",s.PROP_STRING],["mintime",s.PROP_STRING],["minutestep",Object.assign({value:15},s.PROP_NUMBER)],["name",s.PROP_STRING],["outputformat",Object.assign({value:"HH:mm:ss"},s.PROP_STRING)],["placeholder",Object.assign({value:"Select time"},s.PROP_STRING)],["readonly",s.PROP_BOOLEAN],["required",s.PROP_BOOLEAN],["shortcutkey",s.PROP_STRING],["show",Object.assign({value:!0},s.PROP_BOOLEAN)],["showdropdownon",Object.assign({value:"default"},s.PROP_STRING)],["showcustompicker",Object.assign({value:!1},s.PROP_BOOLEAN)],["secondsstep",Object.assign({value:1},s.PROP_NUMBER)],["tabindex",Object.assign({value:0},s.PROP_NUMBER)],["timepattern",s.PROP_STRING],["timestamp",s.PROP_STRING]]),L=function(){s.register("wm-time",M),s.registerFormWidget(c.FormWidgetType.TIME,new Map(M))},F="CURRENT_TIME",j={widgetType:"wm-time",hostClass:"input-group app-timeinput"},B=O,G=function(e){function t(t,n,i,o,r){var a=e.call(this,t,j)||this;return a.ngZone=n,a.appDefaults=i,a.status={isopen:!1},a.keyEventPlugin=r[1],s.styler(a.nativeElement,a),a.registerDestroyListener((function(){return a.clearTimeInterval()})),a.timepattern=a.appDefaults.timeFormat||c.getDisplayDateTimeFormat(c.FormWidgetType.TIME),a.updateFormat("timepattern"),a.app=o,a}return h(t,e),Object.defineProperty(t.prototype,"timestamp",{get:function(){return this.bsTimeValue?this.bsTimeValue.valueOf():void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"datavalue",{get:function(){return this.isCurrentTime&&!this.bsTimeValue?F:c.getFormattedDate(this.datePipe,this.bsTimeValue,this.outputformat,this.timeZone,null,null,this)||""},set:function(e){e?e===F?(this.isCurrentTime=!0,this.setTimeInterval()):(this.clearTimeInterval(),this.bsTimeValue=c.getNativeDateObject(e,{pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput}),this.isCurrentTime=!1,this.mintimeMaxtimeValidation()):(this.bsTimeValue=void 0,this.clearTimeInterval(),this.isCurrentTime=!1),this.invokeOnChange(this.datavalue),c.$appDigest()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"displayValue",{get:function(){return c.getFormattedDate(this.datePipe,this.bsTimeValue,this.timepattern,this.timeZone,null,null,this)||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nativeDisplayValue",{get:function(){return c.getFormattedDate(this.datePipe,this.bsTimeValue,"HH:mm:ss",this.timeZone,null,null,this)||""},enumerable:!1,configurable:!0}),t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("timepattern"===t&&this.updateFormat("timepattern"),"mintime"===t?(this.minTime=c.getNativeDateObject(n,{pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput}),this.mintimeMaxtimeValidation()):"maxtime"===t?(this.maxTime=c.getNativeDateObject(n,{pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput}),this.mintimeMaxtimeValidation()):e.prototype.onPropertyChange.call(this,t,n,i))},t.prototype.setValidateType=function(e,t,n){this.timeNotInRange&&(n<e?this.validateType="mintime":n>t&&(this.validateType="maxtime"))},t.prototype.mintimeMaxtimeValidation=function(){this.timeNotInRange=this.minTime&&this.maxTime&&(this.bsTimeValue<this.minTime||this.bsTimeValue>this.maxTime),this.setValidateType(this.minTime,this.maxTime,this.bsTimeValue),this.invokeOnChange(this.datavalue,void 0,!1)},t.prototype.toggleDropdown=function(e,t){var n=this;void 0===t&&(t=!1),this.loadNativeDateInput?t||this.onDateTimeInputFocus():("click"===e.type&&this.invokeEventCallback("click",{$event:e}),e.target&&$(e.target).is("input")&&!this.isDropDownDisplayEnabledOnInput(this.showdropdownon)||(this.ngZone.run((function(){n.status.isopen=!n.status.isopen})),this.addBodyClickListener(this.status.isopen)))},t.prototype.preventTpClose=function(e){e.stopImmediatePropagation();var t=$(this.nativeElement).closest(".app-composite-widget.caption-floating");t.length>0&&this.app.notify("captionPositionAnimate",{displayVal:this.displayValue,nativeEl:t})},t.prototype.addBodyClickListener=function(e){var t=this;if(e){var n=document.querySelector("body");setTimeout((function(){var e=$(n).find(">bs-dropdown-container .dropdown-menu").get(0);t.deregisterEventListener=c.addEventListenerOnElement(n,e,t.nativeElement,"click",t.isDropDownDisplayEnabledOnInput(t.showdropdownon),(function(){t.status.isopen=!1}),0,!0)}),350)}},t.prototype.onDisplayKeydown=function(e){if(this.isDropDownDisplayEnabledOnInput(this.showdropdownon)){e.stopPropagation();var t=this.keyEventPlugin.constructor.getEventFullKey(e);"enter"===t||"arrowdown"===t?(e.preventDefault(),this.toggleDropdown(e)):this.hideTimepickerDropdown()}else this.hideTimepickerDropdown()},t.prototype.onDisplayTimeChange=function(e){var t=c.getNativeDateObject(e.target.value,{meridians:this.meridians,pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput});this.formatValidation(t,e.target.value)&&(this.invalidDateTimeFormat=!1,this.onTimeChange(t))},t.prototype.onInputBlur=function(e){$(e.relatedTarget).hasClass("bs-timepicker-field")||(this.invokeOnTouched(),this.invokeEventCallback("blur",{$event:e}))},t.prototype.onTimeChange=function(e,t){var n,i,o;t&&(e=c.getNativeDateObject(e.target.value,{pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput})),e?(this.bsTimeValue=e,this.timeNotInRange=this.minTime&&this.maxTime&&(e<this.minTime||e>this.maxTime),this.setValidateType(this.minTime,this.maxTime,e)):(this.bsTimePicker&&this.bsTimePicker.min&&this.bsTimePicker.max&&(o=moment(new Date(this.bsTimePicker.min)).format("A"),moment(new Date(this.bsTimePicker.max)).format("A"),n=this.bsTimePicker.hours+":"+(this.bsTimePicker.minutes||0)+":"+(this.bsTimePicker.seconds||0)+(this.bsTimePicker.showMeridian?" "+o:""),i=c.getNativeDateObject(n,{pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput}),this.bsTimePicker.meridian=o,this.timeNotInRange=this.bsTimePicker.min>i||this.bsTimePicker.max<i,this.setValidateType(this.bsTimePicker.min,this.bsTimePicker.max,i)),this.bsTimeValue=i),this.invokeOnTouched(),this.invokeOnChange(this.datavalue,{},!0)},t.prototype.setTimeInterval=function(){var e=this;this.timeinterval||(this.timeinterval=setInterval((function(){var t=e.timeZone?c.getMomentLocaleObject(e.timeZone):new Date;t.setSeconds(t.getSeconds()+1),e.datavalue=F,e.onTimeChange(t)}),1e3))},t.prototype.clearTimeInterval=function(){this.timeinterval&&(clearInterval(this.timeinterval),this.timeinterval=null)},t.prototype.setIsTimeOpen=function(e){this.status.isopen=e},t.prototype.handleEvent=function(t,n,i,o){_.includes(["blur","focus","change","click"],n)||e.prototype.handleEvent.call(this,t,n,i,o)},t.prototype.hideTimepickerDropdown=function(){this.invokeOnTouched(),this.status.isopen=!1,this.deregisterEventListener&&this.deregisterEventListener(),this.removeKeyupListener();var e=$(this.nativeElement).closest(".app-composite-widget.caption-floating");e.length>0&&this.app.notify("captionPositionAnimate",{displayVal:this.displayValue,nativeEl:e}),this.blurDateInput(!0)},t.prototype.isValid=function(e){if(!e){var t=$(this.nativeElement).find("input").val(),n=c.getNativeDateObject(t,{meridians:this.meridians,pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput});if(!this.formatValidation(n,t))return}},t.prototype.onShown=function(){var e=document.querySelectorAll("timepicker");_.forEach(e,(function(e){c.addClass(e.parentElement,"app-datetime",!0)})),this.focusTimePickerPopover(this),this.bindTimePickerKeyboardEvents(),c.adjustContainerPosition($("bs-dropdown-container"),this.nativeElement,this.bsDropdown._dropdown,$("bs-dropdown-container .dropdown-menu"))},t.prototype.assignModel=function(){this.displayInputElem||(this.displayInputElem=this.getMobileInput()),this.displayInputElem.value=_.get(this,"nativeDisplayValue")},t}(S);G.initializeProps=L(),G.decorators=[{type:t.Component,args:[{selector:"[wmTime]",template:' <div dropdown [isOpen]="status.isopen" (onShown)="onShown()" (onHidden)="hideTimepickerDropdown()" [container]="\'body\'" style="display: inherit">\n <input class="form-control app-textbox display-input" [attr.aria-label]="hint"\n focus-target\n [tabindex]="tabindex"\n [name]="name"\n type="text"\n role="timer"\n [value]="displayValue"\n [disabled]="disabled || readonly || isCurrentTime"\n [autofocus]="autofocus"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-atomic]="isCurrentTime ? \'true\' : \'false\'"\n [required]="required"\n [readOnly]="isReadOnly"\n (click)="toggleDropdown($event, true)"\n (focus)="onDateTimeInputFocus(); invokeOnFocus($event);"\n (blur)="onInputBlur($event)"\n (change)="onDisplayTimeChange($event)"\n (keydown)="this._triggeredByUser = true; onDisplayKeydown($event)">\n <span class="input-group-btn dropdown-toggle">\n <button type="button" class="btn btn-default btn-date" [tabindex]="tabindex" [disabled]="disabled || readonly || isCurrentTime" aria-label="Select time" aria-haspopup="true" aria-expanded="false" (click)="toggleDropdown($event, false)"><i aria-hidden="true" class="app-icon wm-sl-l sl-time"></i></button>\n </span>\n <div *dropdownMenu class="dropdown-menu" (click)="preventTpClose($event)">\n <timepicker class="model-holder"\n [showMeridian]="ismeridian"\n [readonlyInput]="isDisabled"\n [(ngModel)]="bsTimeValue"\n [disabled]="disabled || readonly || isCurrentTime"\n [min]="minTime"\n [max]="maxTime"\n [hourStep]="hourstep"\n [minuteStep]="minutestep"\n [secondsStep]="secondsstep"\n [mousewheel]="true"\n [arrowkeys]="true"\n (isValid)="isValid($event)"\n [showSeconds]="showseconds" (ngModelChange)="onTimeChange($event)"></timepicker>\n </div>\n </div>\n<ng-template [ngIf]="loadNativeDateInput">\n <wm-datetimepicker\n dateTimePicker\n mode="TIME"\n [minTime]="minTime"\n [maxTime]="maxTime"\n [placement]="modal"\n [displayFormat]="timepattern"\n [value]="bsTimeValue"\n (change)="onTimeChange($event)">\n </wm-datetimepicker>\n <div class="mobile-input mobile-datepicker-container"\n tabindex="1000000"\n (focus)="onDateTimeInputFocus(true); invokeOnFocus($event); assignModel()"\n (blur)="onDateTimeInputBlur(); invokeOnTouched($event)"\n (click)="!(disabled || readonly || isCurrentTime) && showDatePickerModal()">\n </div>\n</ng-template>\n',providers:[s.provideAs(G,i.NG_VALUE_ACCESSOR,!0),s.provideAs(G,i.NG_VALIDATORS,!0),s.provideAsWidgetRef(G),{provide:a.TimepickerConfig,deps:[c.AbstractI18nService],useFactory:B}]}]}],G.ctorParameters=function(){return[{type:t.Injector},{type:t.NgZone},{type:c.AppDefaults},{type:c.App},{type:void 0,decorators:[{type:t.Inject,args:[l.EVENT_MANAGER_PLUGINS]}]}]};var V=function(){};V.decorators=[{type:t.Component,args:[{selector:"wm-pickergroup",template:'\n <div class="app-picker-group">\n <ng-content></ng-content>\n </div>\n '}]}];var U=function(){function e(e){this.inj=e,this.change=new t.EventEmitter,this._selectedIndex=0,this._options=[],this.noOfEmptyElements=2,this.$el=$(e.get(t.ElementRef).nativeElement)}return Object.defineProperty(e.prototype,"selectedValue",{get:function(){return this._selectedValue},set:function(e){this._selectedValue=e,this.reRender()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return this._options},set:function(e){this._options=e.map((function(e){return{label:e.label,value:void 0!==e.value?e.value:e.label}})),this.reRender()},enumerable:!1,configurable:!0}),e.prototype.reRender=function(){var e,t=this;this._selectedIndex=this.options.findIndex((function(e){return e.value===t.selectedValue})),null===(e=this.pickerAnimator)||void 0===e||e.select(this._selectedIndex+this.noOfEmptyElements)},Object.defineProperty(e.prototype,"selectedIndex",{get:function(){return this._selectedIndex},set:function(e){this._selectedIndex=e,this._selectedValue=this.options[e].value,this.change.emit(this.options[e])},enumerable:!1,configurable:!0}),e.prototype.ngAfterViewInit=function(){this.pickerAnimator=new W(this)},e}();U.decorators=[{type:t.Component,args:[{selector:"wm-picker",template:'\n <div class="app-picker">\n <div class="app-picker-option-container">\n <div class="app-picker-option app-picker-empty-option">E</div>\n <div class="app-picker-option app-picker-empty-option">E</div>\n <div *ngFor="let option of options; index as i;" class="app-picker-option">\n {{option.label}}\n </div>\n <div class="app-picker-option app-picker-empty-option">E</div>\n <div class="app-picker-option app-picker-empty-option">E</div>\n </div>\n <div class="app-picker-ruler"></div>\n </div>\n '}]}],U.ctorParameters=function(){return[{type:t.Injector}]},U.propDecorators={change:[{type:t.Output}],selectedValue:[{type:t.Input}],options:[{type:t.Input}]};var W=function(){function e(e){var t=this;this.picker=e;var n=e.selectedIndex+e.noOfEmptyElements,i=function(e){return n+Math.floor(e/16)};this.select(n),this.getElement().swipey({direction:$.fn.swipey.DIRECTIONS.VERTICAL,threshold:10,target:e.$el,onSwipe:function(e,n){t.select(i(-1*n.length))},onSwipeEnd:function(o,r){var a=i(-1*r.length);t.select(a),n=e.selectedIndex+e.noOfEmptyElements}})}return e.prototype.getElement=function(){return this.picker.$el.find(".app-picker-option-container:first")},e.prototype.getOptionElements=function(){return this.getElement().find(".app-picker-option")},e.prototype.select=function(e){var t=this.getOptionElements();if(!(e<this.picker.noOfEmptyElements||e>=t.length-this.picker.noOfEmptyElements)){this.getElement().find(".app-picker-option.app-picker-option-selected").removeClass("app-picker-option-selected"),t.eq(e).addClass("app-picker-option-selected"),this.picker.selectedIndex=e-this.picker.noOfEmptyElements;var n=e-this.picker.noOfEmptyElements,i=e+this.picker.noOfEmptyElements;t.each((function(t,o){if(t>=n&&t<=i){var r=30*(t-e),a=1-.3*Math.abs(t-e);$(o).css({transform:"perspective(500px) rotateX("+r+"deg)",opacity:a}).show()}else $(o).hide()}))}},e}(),q=[A,k,G,g,v,U,V],z=function(){};z.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,o.BsDatepickerModule,r.BsDropdownModule,i.FormsModule,a.TimepickerModule,s.WmComponentsModule],declarations:f([],m(q)),exports:f([],m(q)),entryComponents:[]}]}],e.DateComponent=A,e.DatetimeComponent=k,e.EpochModule=z,e.TimeComponent=G,e["\u02750"]=x,e["\u0275a"]=O,e["\u0275b"]=S,e["\u0275c"]=g,e["\u0275d"]=v,e["\u0275e"]=T,e["\u0275f"]=I,e["\u0275g"]=L,e["\u0275h"]=V,e["\u0275i"]=U,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"),require("@wm/core")):"function"==typeof define&&define.amd?define("@wm/components/input/file-upload",["exports","@angular/core","@angular/common","@wm/components/base","rxjs","@wm/core"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.input=e.wm.components.input||{},e.wm.components.input.fileupload={}),e.ng.core,e.ng.common,e.wm.components.base,e.rxjs,e.wm.core)}(this,(function(e,t,n,i,o,r){"use strict";
|
|
198
198
|
/*! *****************************************************************************
|
|
199
199
|
Copyright (c) Microsoft Corporation.
|
|
200
200
|
|
|
@@ -827,7 +827,7 @@ var b=function(e,t){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Arr
|
|
|
827
827
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
828
828
|
PERFORMANCE OF THIS SOFTWARE.
|
|
829
829
|
***************************************************************************** */
|
|
830
|
-
var p=function(e,t){return(p=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)};Object.create;function u(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function d(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o<r;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 h,m=function(){n.register("wm-media-list",new Map([["class",n.PROP_STRING],["dataset",n.PROP_ANY],["layout",Object.assign({value:"Single-row"},n.PROP_STRING)],["mediaurl",n.PROP_STRING],["name",n.PROP_STRING],["offline",Object.assign({value:!0},n.PROP_BOOLEAN)],["show",Object.assign({value:!0},n.PROP_BOOLEAN)],["thumbnailheight",Object.assign({value:"100pt"},n.PROP_STRING)],["thumbnailwidth",Object.assign({value:"100pt"},n.PROP_STRING)],["thumbnailurl",n.PROP_STRING]]))},f={widgetType:"wm-media-list",hostClass:"app-medialist"};!function(e){e.SINGLE_ROW="Single-row",e.MULTI_ROW="Multi-row"}(h||(h={}));var g=function(e){function t(t){var i=e.call(this,t,f)||this;return i.selectedMediaIndex=-1,n.styler(i.nativeElement,i,n.APPLY_STYLES_TYPE.SCROLLABLE_CONTAINER),i}return function(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}p(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.appendToBody=function(){var e=this;return this.$fullScreenEle||setTimeout((function(){e.$fullScreenEle=e.$element.find(">.app-media-fullscreen"),e.$fullScreenEle.appendTo("body")}),100),!0},t.prototype.onPropertyChange=function(t,n,o){"dataset"===t?this.onDataChange(n):"layout"===t?n===h.SINGLE_ROW?i.addClass(this.nativeElement,"singlerow"):i.removeClass(this.nativeElement,"singlerow"):e.prototype.onPropertyChange.call(this,t,n,o)},t.prototype.exitFullScreen=function(){this.selectedMediaIndex=-1,this.$fullScreenEle.appendTo(this.$element),this.$fullScreenEle=null,i.$appDigest()},t.prototype.getPicTitle=function(){return this.selectedMediaIndex+1+"/"+this.fieldDefs.length},t.prototype.showFullScreen=function(e){this.selectedMediaIndex=e,i.$appDigest()},t.prototype.showNext=function(){this.selectedMediaIndex<this.fieldDefs.length-1&&(this.selectedMediaIndex++,i.$appDigest())},t.prototype.getSrc=function(e){return e?this.fieldDefs[this.selectedMediaIndex][e]:""},t.prototype.showPrev=function(){this.selectedMediaIndex>0&&(this.selectedMediaIndex--,i.$appDigest())},t.prototype.onDataChange=function(e){e?(i.isObject(e)&&!i.isArray(e)&&(e=[e]),this.binddataset||i.isString(e)&&(e=e.split(",")),i.isArray(e)&&this.updateFieldDefs(e)):this.updateFieldDefs([])},t.prototype.updateFieldDefs=function(e){var t=this;this.fieldDefs=e,e.forEach((function(e){e.mediaUrlVal=n.getEvaluatedData(e,{field:t.mediaurl},t.viewParent),e.thumbnailUrlVal=n.getEvaluatedData(e,t.thumbnailurl,t.viewParent)})),this.fieldDefs=e},t.prototype.listTrackByFn=function(e){return e},t}(n.StylableComponent);g.initializeProps=m(),g.decorators=[{type:t.Component,args:[{selector:"[wmMediaList]",template:'<ul class="list-unstyled list-inline app-media-thumbnail">\n <li *ngFor="let item of fieldDefs; index as index;" [ngStyle]="{width: thumbnailwidth, height: thumbnailheight}" (click)="showFullScreen(index)">\n <div class="thumbnail">\n <ng-container [ngTemplateOutlet]="imgTemplate"\n [ngTemplateOutletContext]="{src: item.thumbnailUrlVal, class: \'thumbnail-image\'}">\n </ng-container>\n <div class="thumbnail-details">\n <ng-container [ngTemplateOutlet]="mediaListTemplate" [ngTemplateOutletContext]="{item:item, index:index}" [wmMediaListItem]="item">\n </ng-container>\n </div>\n </div>\n </li>\n</ul>\n<div class="app-media-fullscreen" *ngIf="selectedMediaIndex >= 0 && appendToBody()">\n <header wmMobileNavbar\n backbutton="true"\n backbtnclick.event="exitFullScreen()"\n showLeftnavbtn="false"\n backbuttoniconclass.event="wi wi-chevron-left"\n title.bind="getPicTitle()">\n </header>\n <div wmContent>\n <div wmPageContent>\n <div class="media-content">\n <div class="image-container" (swipeleft)="showNext()" (swiperight)="showPrev()">\n <ng-container [ngTemplateOutlet]="imgTemplate"\n [ngTemplateOutletContext]="{field: \'mediaUrlVal\', class: \'center-block\'}">\n </ng-container>\n <a class="app-media-fullscreen-nav-control left" [hidden]="!(selectedMediaIndex > 0)" (click)="showPrev()">\n <i class="wi wi-chevron-left"></i>\n </a>\n <a class="app-media-fullscreen-nav-control right" [hidden]="!(selectedMediaIndex < fieldDefs.length-1)" (click)="showNext()">\n <i class="wi wi-chevron-right"></i>\n </a>\n </div>\n </div>\n </div>\n </div>\n</div>\n\n<ng-template #imgTemplate let-src="src" let-classname="class" let-field="field">\n <img wmPicture class="{{classname}}" picturesource.bind="src || getSrc(field)" wmImageCache="{{offline}}" />\n</ng-template>\n',providers:[n.provideAsWidgetRef(g)]}]}],g.ctorParameters=function(){return[{type:t.Injector}]},g.propDecorators={mediaListTemplate:[{type:t.ContentChild,args:["mediaListTemplate"]}]};var v=[c,g],y=function(){};y.decorators=[{type:t.NgModule,args:[{imports:[l.BasicModule,o.CommonModule,r.BasicModule,a.MobileNavbarModule,s.PageModule,n.WmComponentsModule],declarations:d([],u(v)),exports:d([],u(v)),entryComponents:[]}]}],e.MediaListComponent=g,e.MediaListItemDirective=c,e.MediaListModule=y,e["\u0275a"]=m,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@wavemaker/variables"),require("@wm/core"),require("angular2-websocket/angular2-websocket"),require("@metrichor/jmespath"),require("@angular/core"),require("@angular/router"),require("@wm/oAuth"),require("@wm/security"),require("@angular/common"),require("@angular/common/http"),require("ngx-toastr"),require("@wm/http")):"function"==typeof define&&define.amd?define("@wm/variables",["exports","@wavemaker/variables","@wm/core","angular2-websocket/angular2-websocket","@metrichor/jmespath","@angular/core","@angular/router","@wm/oAuth","@wm/security","@angular/common","@angular/common/http","ngx-toastr","@wm/http"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.variables={}),e.wm_common_variables,e.wm.core,e.angularWebSocket,e.jmespath,e.ng.core,e.ng.router,e.wm.oAuth,e.wm.security,e.ng.common,e.ng.common.http,e.ngxToastr,e.wm.http)}(this,(function(e,t,n,i,o,r,a,s,l,c,p,u,d){"use strict";var h={hasCordova:void 0!==window.cordova,isStudioMode:!1,isRunMode:!0,XSRF_COOKIE_NAME:"wm_xsrf_token",DEFAULT_TIMER_DELAY:500,WIDGET_DOESNT_EXIST:"The widget you're trying to navigate to doesn't exist on this page"},m={CATEGORY:{MODEL:"wm.Variable",LIVE:"wm.LiveVariable",CRUD:"wm.CrudVariable",SERVICE:"wm.ServiceVariable",WEBSOCKET:"wm.WebSocketVariable",NAVIGATION:"wm.NavigationVariable",NOTIFICATION:"wm.NotificationVariable",TIMER:"wm.TimerVariable",LOGIN:"wm.LoginVariable",LOGOUT:"wm.LogoutVariable",DEVICE:"wm.DeviceVariable"},EVENTS:["onBefore","onBeforeUpdate","onResult","onBeforeOpen","onOpen","onBeforeMessageSend","onMessageReceive","onProgress","onError","onBeforeDatasetReady","onCanUpdate","onClick","onHide","onOk","onCancel","onBeforeClose","onClose","onTimerFire","onSuccess","onOnline","onOffline"],EVENT:{CAN_UPDATE:"onCanUpdate",BEFORE:"onBefore",BEFORE_UPDATE:"onBeforeUpdate",PREPARE_SETDATA:"onBeforeDatasetReady",RESULT:"onResult",ERROR:"onError",ABORT:"onAbort",PROGRESS:"onProgress",CLICK:"onClick",HIDE:"onHide",OK:"onOk",CANCEL:"onCancel",CLOSE:"onClose",TIMER_FIRE:"onTimerFire",SUCCESS:"onSuccess",BEFORE_OPEN:"onBeforeOpen",OPEN:"onOpen",BEFORE_SEND:"onBeforeMessageSend",MESSAGE_RECEIVE:"onMessageReceive",BEFORE_CLOSE:"onBeforeClose"},OWNER:{APP:"App",PAGE:"Page"},REST_SUPPORTED_SERVICES:["JavaService","SoapService","FeedService","RestService","SecurityServiceType","DataService","WebSocketService","OpenAPIService"],PAGINATION_PARAMS:["page","size","sort"],REST_SERVICE:{BASE_PATH_KEY:"x-WM-BASE_PATH",RELATIVE_PATH_KEY:"x-WM-RELATIVE_PATH",OAUTH_PROVIDER_KEY:"x-WM-PROVIDER_ID",AUTH_HDR_KEY:"Authorization",SECURITY_DEFN:{BASIC:"basic",OAUTH2:"oauth2"},AUTH_TYPE:{BASIC:"BASIC",OAUTH:"OAUTH2",NONE:"NONE"},CONTENT_TYPE_KEY:"x-WM-CONTENT_TYPE",ACCESSTOKEN_PLACEHOLDER:{LEFT:"",RIGHT:".access_token"},ERR_TYPE:{NO_ACCESSTOKEN:"missing_accesstoken",NO_CREDENTIALS:"no_credentials",METADATA_MISSING:"metadata_missing",CRUD_OPERATION_MISSING:"crud_operation_missing",USER_UNAUTHORISED:"user_unauthorised",REQUIRED_FIELD_MISSING:"required_field_missing"},ERR_MSG:{NO_ACCESSTOKEN:"Access token missing",NO_CREDENTIALS:"No credentials present",METADATA_MISSING:'Metadata missing for "$variable"',USER_UNAUTHORISED:"Unauthorized User",CRUD_OPERATION_MISSING:'Operation "$operation" not allowed for "$variable"',REQUIRED_FIELD_MISSING:'Required field(s) missing: "${0}"'},UNCLOAKED_HEADERS:["CONTENT-TYPE","ACCEPT","CONTENT-LENGTH","ACCEPT-ENCODING","ACCEPT-LANGUAGE"],PREFIX:{AUTH_HDR_VAL:{BASIC:"Basic",OAUTH:"Bearer"},CLOAK_HEADER_KEY:"X-WM-"}},SERVICE_TYPE:{JAVA:"JavaService",REST:"RestService",SOAP:"SoapService",FEED:"FeedService",DATA:"DataService",SECURITY:"SecurityServiceType",WEBSOCKET:"WebSocketService",OPENAPI:"OpenAPIService"},CONTROLLER_TYPE:{QUERY:"QueryExecution",PROCEDURE:"ProcedureExecution"},HTTP_STATUS_CODE:{CORS_FAILURE:-1,UNAUTHORIZED:401,FORBIDDEN:403},EXPORT_TYPES_MAP:{EXCEL:".xlsx",CSV:".csv"},DEFAULT_VAR:{NOTIFICATION:"appNotification"}},f={NON_BODY_HTTP_METHODS:["GET","HEAD"],CONTENT_TYPES:{FORM_URL_ENCODED:"application/x-www-form-urlencoded",MULTIPART_FORMDATA:"multipart/form-data",OCTET_STREAM:"application/octet-stream"}},g={WM_DATA_JSON:"wm_data_json",WM_HTTP_JSON:"wm_httpRequestDetails"},v=t.$rootScope,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 b(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)}Object.create;function w(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function P(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o<r;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 O={EXCEL:".xlsx",CSV:".csv"};e.appManager=void 0,e.httpService=void 0,e.metadataService=void 0,e.navigationService=void 0,e.routerService=void 0,e.toasterService=void 0,e.oauthService=void 0,e.securityService=void 0,e.dialogService=void 0;var S=/^\[("|')[\w\W]*(\1)\]$/,E=new Map,T=new Map,C=function(e,t){var n,i,o=_.noop;T.has(e)&&(o=T.get(e).cancel),o(),n=_.debounce((function(){(i=e[t]())instanceof Promise&&i.catch(_.noop)}),100),T.set(e,n),n()},A=function(e,t,n,i,o){switch(i.category){case m.CATEGORY.LIVE:"read"===i.operation?("dataBinding"===e?_.forEach(t,(function(e,t){i.filterFields[t]={value:e}})):i.filterFields[e]={value:t,type:n},i.autoUpdate&&!_.isUndefined(t)&&_.isFunction(i.listRecords)&&!o&&C(i,"listRecords")):("dataBinding"===e?i.inputFields=t:i.inputFields[e]=t,i.autoUpdate&&!_.isUndefined(t)&&_.isFunction(i[i.operation+"Record"])&&!o&&C(i,i.operation+"Record"));break;case m.CATEGORY.CRUD:"list"===i.operationType&&i.autoUpdate&&!_.isUndefined(t)&&_.isFunction(i.invoke)&&!o&&C(i,"invoke");break;case m.CATEGORY.SERVICE:case m.CATEGORY.LOGIN:i.autoUpdate&&!_.isUndefined(t)&&_.isFunction(i.invoke)&&!o&&C(i,"invoke");break;case m.CATEGORY.DEVICE:i[e]=t,i.autoUpdate&&!_.isUndefined(t)&&_.isFunction(i.invoke)&&!o&&C(i,"invoke")}},R=function(t,n){switch(t){case"appManager":e.appManager=n;break;case"http":e.httpService=n;break;case"metadata":e.metadataService=n;break;case"navigationService":e.navigationService=n;break;case"router":e.routerService=n;break;case"toaster":e.toasterService=n;break;case"oAuth":e.oauthService=n;break;case"security":e.securityService=n;break;case"dialog":e.dialogService=n}},I=function(e,t,i,o,r){var a,s=t[e],l=t._context;e!==m.EVENT.ERROR||r||s||(a=l.Actions[m.DEFAULT_VAR.NOTIFICATION])&&(i=a.getMessage()||i,i=_.isString(i)?i:"An error has occured. Please check the app logs.",a.invoke({message:i},void 0,void 0));var c=n.$parseEvent(t[e]);return e===m.EVENT.BEFORE_UPDATE?"wm.LiveVariable"===t.category&&"read"===t.operation?c(t._context,{variable:t,dataFilter:i,options:o}):c(t._context,{variable:t,inputData:i,options:o}):c(t._context,{variable:t,data:i,options:o})},D=function(e){setTimeout((function(){n.triggerFn(e)}),500)},N=function(e,t,i,o){var r,a,s,l,c,p="",u=t.get("Content-Disposition");if(u&&-1!==u.indexOf("attachment")&&null!==(r=/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(u))&&r[1]&&(p=r[1].replace(/['"]/g,"")),a=t.get("Content-Type"),s=new Blob([e],{type:a}),void 0!==window.navigator.msSaveBlob)window.navigator.msSaveBlob(s,p)?D(i):n.triggerFn(o);else{if(l=window.URL||window.webkitURL,c=l.createObjectURL(s),p){var d,h=document.createElement("a");void 0===h.download?((d=new FileReader).onloadend=function(){var e=d.result.replace(/^data:[^;]*;/,"data:attachment/file;");window.open(e,"_blank")||(window.location.href=e)},d.onload=D.bind(void 0,i),d.onerror=o,d.readAsDataURL(s)):(h.href=c,h.download=p,document.body.appendChild(h),h.click(),D(i))}else window.open(c,"_blank")||(window.location.href=c),D(i);setTimeout((function(){l.revokeObjectURL(c)}),100)}},x=function(e,t){e=_.split(e,"&"),_.forEach(e,(function(e){e=_.split(e,"="),t[e[0]]=decodeURIComponent(_.join(_.slice(e,1),"="))}))},k=function(e,t){"/"===e.url[1]&&"/"===e.url[2]&&(e.url=e.url.slice(0,1)+e.url.slice(2));var i,o,r,a="",s="fileDownloadIFrame",l="fileDownloadForm",c="Content-Type",p=e.url,u=_.get(e.headers,c),d=_.pickBy(e.headers,(function(e,t){return t!==c}));(i=$("#"+s)).length&&i.first().remove(),i=$('<iframe id="'+s+'" name="'+s+'" class="ng-hide"></iframe>'),(o=$('<form id="'+l+'" name="'+l+'"></form>')).attr({target:i.attr("name"),action:p,method:e.method,enctype:u}),a+=-1!==p.indexOf("?")?p.substring(p.indexOf("?")+1):"",a+=u===f.CONTENT_TYPES.FORM_URL_ENCODED?(a?"&":"")+e.dataParams:"",_.includes(f.NON_BODY_HTTP_METHODS,_.toUpper(e.method))&&x(a,d),x(e.data,d),_.forEach(d,(function(e,t){(r=$('<input type="hidden">')).attr({name:t,value:e}),o.append(r)})),$("body").append(i),setTimeout((function(){i.contents().find("body").append(o),o.submit(),n.triggerFn(t)}),100)},M=function(t,i,o){var r=t.url,a=t.method,s=t.dataParams||t.data,l=t.headers;l["Content-Type"]=l["Content-Type"]||"application/x-www-form-urlencoded",e.httpService.send({target:"WebService",action:"invokeRuntimeRestCall",method:a,url:r,headers:l,data:s,responseType:"arraybuffer"}).then((function(e){setTimeout((function(){N(e.body,e.headers,i,o)}),900)}),(function(e){n.triggerFn(o,e)}))},L=function(){return!!h.hasCordova&&localStorage.getItem(h.XSRF_COOKIE_NAME)},F=function(e,t,i){var o,r=e.target,a=i[t];return S.test(r)?o=a:(r=r.substr(0,r.lastIndexOf(".")),o=e.target===t?i:r?n.findValueOf(a,r,!0):a),o},j=function(e){return S.test(e)?e.replace(/^(\[["'])|(["']\])$/g,""):e.split(".").pop()},B=function(e,t,n,i,o,r){var a=j(e),s=F(t,n,i);o=_.isUndefined(o)?t.value:o,s&&(s[a]=o),A(a,o,t.type,i,r)},G=function(e,t,n){var i,o=_.keys(_.get(E.get(n),[n.name,t])),r=j(e);(i=_.filter(o,(function(e){return e!==r&&_.includes(e,r)||(r===t||"dataBinding"===r)&&e!==r}))).length&&_.forEach(i,(function(e){B(e,{target:e},t,n,_.get(E.get(n),[n.name,t,e]))}))},V=function(e,t,i,o){var r=e.target,a=F(e,i,o),s=j(r),l=t.registerDestroyListener?t.registerDestroyListener.bind(t):_.noop;if(n.stringStartsWith(e.value,"bind:")){l(n.$watch(e.value.replace("bind:",""),t,{},(function(t,l){t===l&&_.isUndefined(t)||!(!_.isUndefined(t)||_.isUndefined(l)&&_.isUndefined(a[s]))||(_.includes(["blob","file"],e.type)||(t=n.getClonedObject(t)),B(r,e,i,o,t),E.has(o)||E.set(o,{}),_.set(E.get(o),[o.name,i,r],t),_.isObject(t)&&G(r,i,o))}),void 0,void 0,void 0,(function(){return o.isMuted})))}else _.isUndefined(e.value)||(B(r,e,i,o,e.value,!0),i!==s&&(E.has(o)||E.set(o,{}),_.set(E.get(o),[o.name,i,r],e.value)))},U=function(e,t,n,i){i=i||"dataBinding";var o=e[n=n||"dataBinding"];e[n]={},e["_bind"+n]=o,o&&_.isArray(o)&&o.forEach((function(n){"wm.Variable"===e.category&&"dataBinding"===n.target&&(n.target="dataSet"),V(n,t,i,e)}))},W=function(t,n,i,o,r){if(h.hasCordova){var a=void 0;i&&(a=O[i]),e.appManager.notify("device-file-download",{url:t.url,name:n,extension:a,headers:t.headers,successCb:o,errorCb:r})}else!_.isEmpty(t.headers)||L()?M(t,o,r):k(t,o)},q=function(){return window.File&&window.FileReader&&window.FileList&&window.Blob},z=C,H=function(e){return n.DEFAULT_FORMATS[_.toUpper(e)]},Y=function(t,i){var o;return _.isDate(t)?o=t.getTime():(isNaN(t)||(t=parseInt(t,10)),o=t&&moment(t).valueOf()),isNaN(o)&&i!==n.DataType.TIME||i===n.DataType.TIMESTAMP?o:(i!==n.DataType.TIME||o||(o=moment((new Date).toDateString()+" "+t).valueOf()),t&&e.appManager.getPipe("date").transform(o,H(i)))},K=function(e,t){return _.includes(t,".")&&(t=_.toLower(n.extractType(t))),_.isArray(e)?_.map(e,(function(e){return Y(e,t)})):Y(e,t)};var Q=function(){function t(){}return t.prototype.initBinding=function(e,t,n){U(e,e._context,t,n)},t.prototype.notifyInflight=function(t,n,i){e.appManager.notify("toggle-variable-state",{variable:t,active:n,data:i})},t}(),X=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return b(i,t),i.prototype.invoke=function(t,i){!function(t,i){var o;t.dataSet=i&&i.data||t.dataSet;var r=t.dataBinding.pageName||t.pageName,a=t.operation,s=_.clone(t.dataSet),l=_.isNil(null==i?void 0:i.cacheable)?t.cacheable:i.cacheable;switch(i=i||{},_.isNil(l)||n.isString(l)&&""===l.trim()||(s._cache_page=l),a){case"goToPreviousPage":e.navigationService.goToPrevious();break;case"gotoPage":e.navigationService.goToPage(r,{transition:t.pageTransitions,$event:i.$event,urlParams:s,cacheable:t.cacheable});break;case"gotoView":o=t.dataBinding&&t.dataBinding.viewName||t.viewName;break;case"gotoTab":o=t.dataBinding&&t.dataBinding.tabName||t.tabName;break;case"gotoAccordion":o=t.dataBinding&&t.dataBinding.accordionName||t.accordionName;break;case"gotoSegment":o=t.dataBinding&&t.dataBinding.segmentName||t.segmentName}o&&e.navigationService.goToView(o,{pageName:r,transition:t.pageTransitions,$event:i.$event,urlParams:s},t)}(t,i)},i}(Q),J=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return b(i,t),i.prototype.onToasterClick=function(e){I("onClick",e,"")},i.prototype.onToasterHide=function(e){I("onHide",e,"")},i.prototype.notifyViaToaster=function(t,n){var i,o=(n.class||t.dataBinding.class||"info").toLowerCase(),r=n.message||t.dataBinding.text,a=n.title,s="toast-"+(n.position||t.dataBinding.toasterPosition||"bottom right").replace(" ","-"),l=t.dataBinding.page,c=parseInt(n.duration||t.dataBinding.duration,null);c||(c=0!==c&&"success"===o?3e3:0),i=t.dataBinding.content&&"page"===t.dataBinding.content&&l?e.toasterService.showCustom(l,{positionClass:s,timeOut:c,partialParams:t._binddataSet,context:t._context}):e.toasterService.show(o,a,r||null,{positionClass:s,timeOut:c,enableHtml:!0}),t.onClick&&i.onTap.subscribe(this.onToasterClick.bind(this,t)),t.onHide&&i.onHidden.subscribe(this.onToasterHide.bind(this,t))},i.prototype.getDialogConfig=function(t,n,i,o){return{title:n.title||t.dataBinding.title,text:n.message||t.dataBinding.text,okButtonText:n.okButtonText||t.dataBinding.okButtonText||"OK",cancelButtonText:n.cancelButtonText||t.dataBinding.cancelButtonText||"CANCEL",alerttype:n.alerttype||t.dataBinding.alerttype||"information",onOk:function(){e.dialogService.close(i,void 0,o)},onCancel:function(){I("onCancel",t,n.data),e.dialogService.close(i,void 0)},onClose:function(){I("onClose",t,n.data)}}},i.prototype.notifyViaDialog=function(t,i){var o="PREFAB"===n.getWmProjectProperties().type,r=(o?"Prefab":"Common")+_.capitalize(t.operation)+"Dialog",a=this.getDialogConfig(t,i,r,(function(){return I("onOk",t,i.data)}));a=o?a:{notification:a},e.dialogService.open(r,void 0,a)},i.prototype.notify=function(e,t,n,i){t=t||{},"toast"===e.operation?this.notifyViaToaster(e,t):this.notifyViaDialog(e,t)},i.prototype.getMessage=function(e){return e.dataBinding.text},i.prototype.setMessage=function(e,t){return _.isString(t)&&(e.dataBinding.text=t),e.dataBinding.text},i.prototype.getOkButtonText=function(e){return e.dataBinding.okButtonText},i.prototype.setOkButtonText=function(e,t){return _.isString(t)&&(e.dataBinding.okButtonText=t),e.dataBinding.okButtonText},i.prototype.getToasterDuration=function(e){return e.dataBinding.duration},i.prototype.setToasterDuration=function(e,t){return e.dataBinding.duration=t,e.dataBinding.duration},i.prototype.getToasterClass=function(e){return e.dataBinding.class},i.prototype.setToasterClass=function(e,t){return _.isString(t)&&(e.dataBinding.class=t),e.dataBinding.class},i.prototype.getToasterPosition=function(e){return e.dataBinding.class},i.prototype.setToasterPosition=function(e,t){return _.isString(t)&&(e.dataBinding.position=t),e.dataBinding.position},i.prototype.getAlertType=function(e){return e.dataBinding.alerttype},i.prototype.setAlertType=function(e,t){return _.isString(t)&&(e.dataBinding.alerttype=t),e.dataBinding.alerttype},i.prototype.getCancelButtonText=function(e){return e.dataBinding.cancelButtonText},i.prototype.setCancelButtonText=function(e,t){return _.isString(t)&&(e.dataBinding.cancelButtonText=t),e.dataBinding.cancelButtonText},i}(Q),Z=function(){function t(){}return t.prototype.initBinding=function(e,t,n){U(e,e._context,t,n)},t.prototype.notifyInflight=function(t,n,i,o){e.appManager.notify("toggle-variable-state",{variable:t,active:n,data:i,options:o})},t.prototype.setRequestTrackId=function(e,t){var n,i=null===(n=null==e?void 0:e.headers)||void 0===n?void 0:n.get("x-wm-request-track-id");i&&(t._requestTrackId=i)},t.prototype.httpCall=function(t,n,i){var o=this;return new Promise((function(r,a){n._observable=e.httpService.sendCallAsObservable(t,i).subscribe((function(e){e&&e.type&&(o.setRequestTrackId(e,n),r(e))}),(function(t){o.setRequestTrackId(t,n),e.httpService.isPlatformSessionTimeout(t)?(o.notifyInflight(n,!1,t),t._401Subscriber.asObservable().subscribe((function(e){return r(e)}),(function(e){return a(e)}))):a(t)}))}))},t.prototype.prepareCallbackOptions=function(e,t){var n={};return n.xhrObj=e,t&&_.extend(n,t),n},t}(),ee=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return b(i,t),i.prototype.validate=function(e){var t,n,i;for(n in["rememberme","remembermecheck"].forEach((function(t){_.isBoolean(e[t])&&(i=t)})),e[i=i||"j_rememberme"]=!!_.isBoolean(e[i])&&e[i],e)if(e.hasOwnProperty(n)&&(""===e[n]||void 0===e[n])){t="Please provide required credentials";break}return t},i.prototype.migrateOldParams=function(e){var t={},n={usernametext:"j_username",username:"j_username",passwordtext:"j_password",password:"j_password",remembermecheck:"j_rememberme",rememberme:"j_rememberme"};return _.each(e,(function(e,i){n[i]?t[n[i]]=e:t[i]=e})),t},i.prototype.redirectToAppBasePath=function(){e.routerService.navigate(["/"]).then((function(e){e&&window.location.reload()}))},i.prototype.login=function(t,i,o,r){var a,s=this,l=(i=i||{}).loginInfo||i.input||t.dataBinding,c=this.validate(l);if(c)return n.triggerFn(r,c),void I("onError",t,c);var p=n.getClonedObject(l),u=I(m.EVENT.BEFORE_UPDATE,t,p);if(_.isObject(u))p=u;else if(!1===u)return void n.triggerFn(r);p=this.migrateOldParams(p);var d=_.get(e.securityService.get(),"userInfo.userName");this.notifyInflight(t,!0),t.promise=e.securityService.appLogin(p,(function(i){e.dialogService.close("CommonLoginDialog"),e.appManager.reloadAppData().then((function(r){I(m.EVENT.RESULT,t,_.get(r,"userInfo")),(a=I(m.EVENT.PREPARE_SETDATA,t,_.get(r,"userInfo")))&&_.set(r,"userInfo",a),s.notifyInflight(t,!1,i),n.triggerFn(o),setTimeout((function(){if(I(m.EVENT.SUCCESS,t,_.get(r,"userInfo")),t.useDefaultSuccessHandler){var n=d===p.j_username;d&&!n||e.appManager.executeSessionFailureRequests();var i=e.securityService.getCurrentRouteQueryParam("redirectTo"),o=e.appManager.noRedirect(),a=e.securityService.getRedirectedRouteQueryParams();if(a.redirectTo&&delete a.redirectTo,e.appManager.noRedirect(!1),d)if(_.isEmpty(i)){var l=e.securityService.get(),c=_.get(l,"loginConfig.sessionTimeout.type")||"PAGE";n&&"DIALOG"===c||s.redirectToAppBasePath()}else d===p.j_username?e.routerService.navigate(["/"+i],{queryParams:a}):s.redirectToAppBasePath();else _.isEmpty(i)?o||e.routerService.navigate(["/"]):e.routerService.navigate(["/"+i],{queryParams:a})}I(m.EVENT.CAN_UPDATE,t,_.get(r,"userInfo"))}))}))}),(function(e){I(m.EVENT.RESULT,t,e),s.notifyInflight(t,!1,e);var i=e.error||"Invalid credentials.",o=e.details;h.isRunMode&&I("onError",t,i,o,!0),n.triggerFn(r,i,o),I(m.EVENT.CAN_UPDATE,t,e)}))},i}(Q),te=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return b(i,t),i.prototype.logout=function(t,i,o,r){var a,s,l,c=this;a=function(e,i,o){h.isStudioMode||I("onError",t,e,o),n.triggerFn(r,e,o)},!1!==I(m.EVENT.BEFORE_UPDATE,t,null)?e.securityService.isAuthenticated((function(i){i?(c.notifyInflight(t,!0),t.promise=e.securityService.appLogout((function(i){var r=i.body;r=n.getValidJSON(r),e.appManager.reloadAppData().then((function(){c.notifyInflight(t,!1,r),I(m.EVENT.RESULT,t,r),(l=I(m.EVENT.PREPARE_SETDATA,t,r))&&(r=l),setTimeout((function(){I(m.EVENT.SUCCESS,t,r),I(m.EVENT.CAN_UPDATE,t,r)}))})),r&&r.result?window.location.href=r.result:t.useDefaultSuccessHandler&&((s=t.redirectTo)&&"login.html"!==s&&"index.html"!==s||(s=""),e.routerService.navigate(["/"+s]),window.cordova||setTimeout((function(){window.location.reload()}))),n.triggerFn(o)}),a)):a("No authenticated user to logout.")}),(function(e){c.notifyInflight(t,!1,e),a(e)})):n.triggerFn(r)},i}(Q),ne=function(e){function t(){var t=e.apply(this,P([],w(arguments)))||this;return t.serviceRegistry=new Map,t}return b(t,e),t.prototype.invoke=function(e,t){var n=this,i=this.serviceRegistry.get(e.service);return null==i?(I("onError",e,null),Promise.reject("Could not find service '"+i+"'")):(this.notifyInflight(e,!0),i.invoke(e,t).then((function(t){return n.notifyInflight(e,!1,t),t}),(function(t){return n.notifyInflight(e,!1,t),Promise.reject(t)})))},t.prototype.registerService=function(e){this.serviceRegistry.set(e.name,e)},t}(Z),ie=function(){function e(){}return e.setPaginationQueryParams=function(e,t,n){t.parameters.forEach((function(t){var i;i="offset"===n.type||n.input.offset?"offset":"page",t.name===n.input[i].split(".")[0]?t.sampleValue=e.pagination.page:t.name===n.input.size.split(".")[0]&&(t.sampleValue=e.pagination.size)}))},e.setVariablePagination=function(e,t,n){e.pagination||(e.pagination={empty:!1}),e.pagination.size=t.size,e.pagination.page=t.page||0,e.pagination.totalElements=t.totalElements,e.pagination.numberOfElements=e.pagination.size,e.pagination.number=n.page?n.page-1:0,e.pagination.totalPages=e.pagination.totalElements/e.pagination.size,e.pagination.totalElements%e.pagination.size==0?e.pagination.totalPages=parseInt(e.pagination.totalPages):e.pagination.totalPages=parseInt(e.pagination.totalPages)+1,t.next?(e.pagination.next=t.next,e.pagination.prev=t.prev,e.pagination.last=!t.next,e.pagination.first=!t.prev):(e.pagination.first=e.pagination.page<=1,e.pagination.last=""===t.hasMoreItems?!(e.pagination.page<e.pagination.totalPages):!t.hasMoreItems)},e.setPaginationItems=function(e,t,n,i,r){var a;if(_.startsWith(e,"$body")){var s=e.replace("$body.","");try{n[i]=o.jmespath.search(t,s)}catch(t){console.warn(e+" expression needs to be corrected as per JMES guidelines")}}else if(_.startsWith(e,"$header")){var l=e.replace("$header.",""),c=Object.fromEntries(r.headers),p=l.split(".");try{n[i]=o.jmespath.search(c,p[0].toLowerCase())}catch(t){console.warn(e+" expression needs to be corrected as per JMES guidelines")}if(null===(a=n[i])||void 0===a?void 0:a.length){var u=n[i].join();if(1===p.length)n[i]=u;else{var d=p.slice(1).join("."),h=JSON.parse(u);/[!@#$%^&*()+\=\[\]{};':"\\|,<>\/?]+/.test(d)&&(d="headerResp."+d);try{n[i]=o.jmespath.search(h,d)}catch(t){console.warn(e+" expression needs to be corrected as per JMES guidelines")}}}}},e.getPaginationInfo=function(e,t){return(null==e?void 0:e.paginationInfo)?e.paginationInfo:t._paginationConfig},e.checkPaginationAtQuery=function(e,t,n){var i,o=this.getPaginationInfo(e,t);if(n&&n.page&&(null==o?void 0:o.input.size)&&t.pagination){var r;r="offset"===o.type||o.input.offset?"offset":"page";var a=o.input[r].split(".")[0],s=_.find(e.parameters,(function(e){return e.name===a}));!_.isEmpty(t.dataBinding)&&s&&"query"===s.parameterType&&((null===(i=o.output)||void 0===i?void 0:i.page)||"offset"===o.type?t.pagination.page=this.getOffsetInfo(t,n):t.pagination.page=n.page,this.setPaginationQueryParams(t,e,o))}},e.getOffsetInfo=function(e,t){return e.pagination.size*(t.page?t.page-1:1)},e.setPaginationAtReq=function(e,t,n,i,o,r,a){var s,l={},c={};s="offset"===e.type||e.input.offset?"offset":"page";var p=e.input[s].split(".")[0],u=_.find(t.parameters,(function(e){return e.name===p}));if("header"===(null==u?void 0:u.parameterType))_.set(l,e.input[s],n.pagination.page),_.set(l,e.input.size,n.pagination.size),i[p]=JSON.stringify(l[p]),c.headers=i;else if("body"===(null==u?void 0:u.parameterType)){var d=JSON.parse(u.sampleValue),h=e.input[s].split(".")[1];if(d&&d[h]){var m=e.input[s].split(".").splice(1).join(".");"offset"!==s?_.set(l,m,n.pagination.page):_.set(l,m,this.getOffsetInfo(n,a)),_.set(l,e.input.size.split(".").splice(1).join("."),n.pagination.size),d[h]=l[h],o=JSON.stringify(d),c.requestBody=o}}else if(n.pagination.next&&u)if("path"===u.parameterType){var f=t.relativePath.split("/"),g="{"+u.name+"}",v=f.indexOf(g),y=void 0;y=n.pagination.isNext?n.pagination.next.split("/"):n.pagination.prev.split("/");var b=void 0,w=void 0;t.directPath?((b=(w=new URL(r)).pathname.split("/"))[v]=y[v],w.pathname=b.join("/"),r=w.href,c.url=r):((b=r.split("/"))[v+1]=y[v],r=b.join("/"),c.url=r)}else if("query"===u.parameterType){f=r.split("?"),y=void 0;y=n.pagination.isNext?n.pagination.next.split("?"):n.pagination.prev.split("?"),f[1]=y[1],r=f.join("?"),c.url=r}return c},e.setParameterVal=function(e,t,n,i){var o=this.getPaginationInfo(n,i).input[e].split(".")[0],r=_.find(n.parameters,(function(e){return e.name===o}));t[e]=_.result(r,"sampleValue")},e.generatePaginationRes=function(e,t,n,i,o,r){var a={},s=t.output;if(null==s?void 0:s.next)s&&(this.setPaginationItems(s.next,n,a,"next",i),this.setPaginationItems(s.prev,n,a,"prev",i));else{if((null==s?void 0:s.size)?this.setPaginationItems(s.size,n,a,"size",i):this.setParameterVal("size",a,e,r),(null==s?void 0:s.page)?this.setPaginationItems(s.page,n,a,"page",i):"offset"!==t.type&&this.setParameterVal("page",a,e,r),_.startsWith(null==s?void 0:s.totalElements,"$minValue")){var l=s.totalElements.replace("$minValue=",""),c=a.page?a.page:o.page,p=a.size*c;!r.pagination||r.pagination.totalElements>p?a.totalElements=parseInt(l):a.totalElements=p+1}else(null==s?void 0:s.totalElements)?this.setPaginationItems(s.totalElements,n,a,"totalElements",i):"offset"===t.type||t.input.offset?a.totalElements=a.size*(o.page?o.page:1)+1:a.totalElements=a.size*a.page+1;(null==s?void 0:s.hasMoreItems)?this.setPaginationItems(s.hasMoreItems,n,a,"hasMoreItems",i):a.hasMoreItems=""}return a},e}(),oe=function(e){return _.includes(["QueryExecution","ProcedureExecution"],e.controller)&&_.includes(["put","post"],e.operationType)},re=function(e,t){return e===m.CONTROLLER_TYPE.QUERY&&t===m.SERVICE_TYPE.DATA},ae=function(e,t,i){var o=_.toLower(n.extractType(_.get(t,"items.type")||t.type)),r=h.isStudioMode?t["x-WM-CONTENT_TYPE"]:t.contentType;if(q())return"file"===o||"string"!==r&&r?_.isArray(i)&&"file"===o?_.forEach(i,(function(i){e.append(t.name,i&&i.content||n.getBlob(i),i.name)})):e.append(t.name,n.getBlob(i,r),i&&i.name):(_.isObject(i)&&(i=JSON.stringify(i)),e.append(t.name,i)),e},se=function(e,t){var i,o={},r=[];return _.forEach(t,(function(t){i=_.get(e,t.name),_.isUndefined(i)||""===i||null===i||t.readOnly?t.required&&r.push(t.name||t.id):(i=n.isDateTimeType(t.type)?K(i,t.type):i,_.isArray(i)&&"string"===_.toLower(n.extractType(t.type))&&(i=_.join(i,",")),o[t.name]=i)})),{requestBody:o,missingParams:r}},le=function(e){var t={},n=m.REST_SERVICE.UNCLOAKED_HEADERS,i=m.REST_SERVICE.PREFIX.CLOAK_HEADER_KEY;return _.forEach(e,(function(e,o){_.includes(n,o.toUpperCase())?t[o]=e:t[i+o]=e})),t},ce=function(){function t(){}return t.constructRequestParams=function(t,i,o,r){if(t=t||{},null===i)return{error:{type:m.REST_SERVICE.ERR_TYPE.USER_UNAUTHORISED,message:m.REST_SERVICE.ERR_MSG.USER_UNAUTHORISED,field:"_wmServiceOperationInfo"}};if(_.isEmpty(i))return{error:{type:m.REST_SERVICE.ERR_TYPE.METADATA_MISSING,message:m.REST_SERVICE.ERR_MSG.METADATA_MISSING,field:"_wmServiceOperationInfo"}};if(i&&i.invalid)return{error:{type:m.REST_SERVICE.ERR_TYPE.CRUD_OPERATION_MISSING,message:m.REST_SERVICE.ERR_MSG.CRUD_OPERATION_MISSING,field:"_wmServiceOperationInfo"}};var a,s,l,c,p,u,d,y,b,w,P,O,S,E,T,C,A,R=i.directPath||"",I=i.basePath?i.basePath+i.relativePath:i.relativePath,D=oe(t),N="",x={},k=[],M=null;function L(){return b||(b=new FormData)}if(S=_.get(i.securityDefinitions,"0"))switch(S.type){case m.REST_SERVICE.SECURITY_DEFN.OAUTH2:if(C=S[m.REST_SERVICE.OAUTH_PROVIDER_KEY],A=null,!(E=e.oauthService.getAccessToken(C,A)))return{error:{type:m.REST_SERVICE.ERR_TYPE.NO_ACCESSTOKEN,message:m.REST_SERVICE.ERR_MSG.NO_ACCESSTOKEN},securityDefnObj:S};x[m.REST_SERVICE.AUTH_HDR_KEY]=m.REST_SERVICE.PREFIX.AUTH_HDR_VAL.OAUTH+" "+E;break;case m.REST_SERVICE.SECURITY_DEFN.BASIC:if(u=o.wm_auth_username,d=o.wm_auth_password,!u||!d)return{error:{type:m.REST_SERVICE.ERR_TYPE.NO_CREDENTIALS,message:m.REST_SERVICE.ERR_MSG.NO_CREDENTIALS},securityDefnObj:S};x[m.REST_SERVICE.AUTH_HDR_KEY]=m.REST_SERVICE.PREFIX.AUTH_HDR_VAL.BASIC+" "+btoa(u+":"+d),M={type:m.REST_SERVICE.AUTH_TYPE.BASIC}}if(ie.checkPaginationAtQuery(i,t,r),i.proxySettings=i.proxySettings||{web:!0,mobile:!1},y=i.httpMethod||i.methodType,w=h.hasCordova?i.proxySettings.mobile:i.proxySettings.web,T=i.proxySettings.withCredentials,l=w?I:R,_.forEach(i.parameters,(function(e){function r(){o?(P=o[e.name]&&_.isObject(o[e.name])?o[e.name]:o,O=_.get(i,["definitions",e.type])):(P=c||{},O=e.children)}var c=e.sampleValue;if(n.isDefined(c)&&null!==c&&""!==c||D&&"file"!==e.type)switch(t.serviceType===m.SERVICE_TYPE.DATA&&n.isDateTimeType(e.type)&&(c=K(c,e.type)),_.isArray(c)&&"string"===_.toLower(n.extractType(e.type))&&t.serviceType===m.SERVICE_TYPE.DATA&&(c=_.join(c,",")),e.parameterType.toUpperCase()){case"QUERY":if(_.isNull(c)&&re(t.controller,t.serviceType))break;N?N+="&"+e.name+"="+encodeURIComponent(c):N="?"+e.name+"="+encodeURIComponent(c);break;case"PATH":p=new RegExp("\\s*\\{\\s*"+e.name+"(:\\.\\+)?\\s*\\}\\s*"),l=l.replace(p,c);break;case"HEADER":x[e.name]=c;break;case"BODY":D?(r(),a=se(P,O),s=a.requestBody,k=_.concat(k,a.missingParams)):s=c;break;case"FORMDATA":D&&e.name===g.WM_DATA_JSON?(r(),a=se(P,O),s=ae(L(),e,a.requestBody),k=_.concat(k,a.missingParams)):s=ae(L(),e,c)}else e.required&&k.push(e.name||e.id)})),k.length)return{error:{type:m.REST_SERVICE.ERR_TYPE.REQUIRED_FIELD_MISSING,field:k.join(","),message:n.replace(m.REST_SERVICE.ERR_MSG.REQUIRED_FIELD_MISSING,[k.join(",")]),skipDefaultNotification:!0}};_.includes(f.NON_BODY_HTTP_METHODS,_.toUpper(y))||i.consumes&&i.consumes[0]===f.CONTENT_TYPES.MULTIPART_FORMDATA||(x["Content-Type"]=i.consumes&&i.consumes[0]||"application/json"),_.includes(i.consumes,f.CONTENT_TYPES.FORM_URL_ENCODED)&&!_.includes(f.NON_BODY_HTTP_METHODS,(y||"").toUpperCase())?(N&&(s=(s?s+"&":"")+N.substring(1)),x["Content-Type"]=f.CONTENT_TYPES.FORM_URL_ENCODED):l+=N,w&&(x=t.serviceType!==m.SERVICE_TYPE.REST&&t.serviceType!==m.SERVICE_TYPE.OPENAPI||i.skipCloakHeaders?x:le(x),t.getPrefabName()&&-1!==m.REST_SUPPORTED_SERVICES.indexOf(t.serviceType)?(l="prefabs/"+t.getPrefabName()+l,c="invokePrefabRestService"):t.getPrefabName()||(l="services"+l),l=v.project.deployedUrl+l);var F=ie.getPaginationInfo(i,t);if(F&&t.pagination){var j=ie.setPaginationAtReq(F,i,t,x,s,l,r);j&&(j.headers?x=j.headers:j.requestBody?s=j.requestBody:j.url&&(l=j.url))}return{projectID:v.project.id,url:l,target:c,method:y,headers:x,data:s,authDetails:M,isDirectCall:!w,isExtURL:t.serviceType===m.SERVICE_TYPE.REST,withCredentials:T}},t.isFileUploadRequest=function(e){return"FileService"===e.service&&"uploadFile"===e.operation},t.excludePaginationParams=function(e){return _.map(_.reject(e,(function(e){return _.includes(m.PAGINATION_PARAMS,e.name)})),(function(e){return e.name}))},t}(),pe=function(t){function o(){var e=t.apply(this,P([],w(arguments)))||this;return e.scope_var_socket_map=new Map,e.PROPERTY={SERVICE:"service",DATA_UPDATE_STRATEGY:"dataUpdateStrategy",DATA_LIMIT:"dataLimit"},e.DATA_UPDATE_STRATEGY={REFRESH:"refresh",PREPEND:"prepend",APPEND:"append"},e}return b(o,t),o.prototype.shouldAppendData=function(e){return(e=e||this)[this.PROPERTY.DATA_UPDATE_STRATEGY]!==this.DATA_UPDATE_STRATEGY.REFRESH},o.prototype.shouldAppendLast=function(e){return e[this.PROPERTY.DATA_UPDATE_STRATEGY]===this.DATA_UPDATE_STRATEGY.APPEND},o.prototype.getDataLimit=function(e){return e.dataLimit},o.prototype.getURL=function(t){var n,i=t.getPrefabName(),o=i?_.get(e.metadataService.getByOperationId(t.operationId,i),"wmServiceOperationInfo"):_.get(e.metadataService.getByOperationId(t.operationId),"wmServiceOperationInfo"),r=t.dataBinding;if(_.forEach(o.parameters,(function(e){e.sampleValue=r[e.name]})),$.extend(o,{skipCloakHeaders:!0}),!(n=ce.constructRequestParams(t,o,r)).error||!n.error.message)return n.url;this._onSocketError(t,{data:n.error.message})},o.prototype._onSocketMessage=function(e,t){var i,o,r,a,s,l=_.get(t,"data");l=n.getValidJSON(l)||n.xmlToJson(l)||l,i=I(m.EVENT.MESSAGE_RECEIVE,e,l,t),l=n.isDefined(i)?i:l,this.shouldAppendData(e)?(e.dataSet=e.dataSet||[],o=e.dataSet.length,r=this.getDataLimit(e),a=this.shouldAppendLast(e),r&&o>=r&&(a?e.dataSet.shift():e.dataSet.pop()),s=a?o:0,e.dataSet.splice(s,0,l)):e.dataSet=n.isDefined(i)?i:l},o.prototype._onBeforeSend=function(e,t){return I(m.EVENT.BEFORE_SEND,e,t)},o.prototype._onBeforeSocketClose=function(e,t){return I(m.EVENT.BEFORE_CLOSE,e,_.get(t,"data"),t)},o.prototype._onBeforeSocketOpen=function(e,t){return I(m.EVENT.BEFORE_OPEN,e,_.get(t,"data"),t)},o.prototype._onSocketOpen=function(e,t){e._socketConnected=!0,I(m.EVENT.OPEN,e,_.get(t,"data"),t)},o.prototype.freeSocket=function(e){this.scope_var_socket_map.set(e,void 0)},o.prototype._onSocketClose=function(e,t){e._socketConnected=!1,this.freeSocket(e),I(m.EVENT.CLOSE,e,_.get(t,"data"),t)},o.prototype._onSocketError=function(e,t){e._socketConnected=!1,this.freeSocket(e),I(m.EVENT.ERROR,e,_.get(t,"data")||"Error while connecting with "+e.service,t)},o.prototype.getSocket=function(e){var t=this.getURL(e),o=this.scope_var_socket_map.get(e);return o||(h.hasCordova||!n.isInsecureContentRequest(t)?((o=new i.$WebSocket(t)).onOpen(this._onSocketOpen.bind(this,e)),o.onError(this._onSocketError.bind(this,e)),o.onMessage(this._onSocketMessage.bind(this,e)),o.onClose(this._onSocketClose.bind(this,e)),this.scope_var_socket_map.set(e,o),e._socket=o,o):void n.triggerFn(this._onSocketError.bind(this,e)))},o.prototype.open=function(e,t,i){var o;if(!1!==this._onBeforeSocketOpen(e))return o=this.getSocket(e),n.triggerFn(t),o;n.triggerFn(i)},o.prototype.close=function(e){var t=this._onBeforeSocketClose(e),n=this.getSocket(e);!1!==t&&n.close()},o.prototype.send=function(e,t){var i,o=this.getSocket(e);t=t||_.get(e,"dataBinding.RequestBody"),!1!==(i=this._onBeforeSend(e,t))&&(t=n.isDefined(i)?i:t,t=n.isObject(t)?JSON.stringify(t):t,o.send(t,0))},o}(Z),ue=new Map,de={Variable:Z,Action:Q,"wm.NavigationVariable":X,"wm.NotificationVariable":J,"wm.LoginVariable":ee,"wm.LogoutVariable":te,"wm.DeviceVariable":ne,"wm.WebSocketVariable":pe},he=function(){function e(){}return e.get=function(e){return ue.has(e)?ue.get(e):ue.set(e,new de[e]).get(e)},e}(),me=function(){function e(){}return e.prototype.invoke=function(e,t){var i=this.operations.find((function(t){return t.name===e.operation}));if(null==i)return I(m.EVENT.ERROR,e,null),Promise.reject("Could not find operation '"+e.operation+"' in service '"+this.name+"'");if(n.hasCordova()){var o=new Map;return void 0!==e.dataBinding&&(Object.entries(e).forEach((function(e){o.set(e[0],e[1])})),Object.entries(e.dataBinding).forEach((function(e){o.set(e[0],e[1])}))),i.invoke(e,t,o).then((function(t){return e.dataSet=t,n.$invokeWatchers(!0),I(m.EVENT.SUCCESS,e,t),t}),(function(t){return e.dataSet={},n.$invokeWatchers(!0),I(m.EVENT.ERROR,e,null),t}))}return Promise.resolve().then((function(){return I(m.EVENT.SUCCESS,e,i.model),i.model}))},e}(),fe=function(){return he.get(m.CATEGORY.DEVICE)},ge=function(e){function t(t){var n=e.call(this)||this;return Object.assign(n,t),n}return b(t,e),t.prototype.init=function(){fe().initBinding(this)},t.prototype.invoke=function(e,t,n){fe().invoke(this,e).then(t,n)},t}(t.ApiAwareVariable),ve=function(){return he.get(m.CATEGORY.NAVIGATION)},ye=function(e){function t(t){var n=e.call(this)||this;return Object.assign(n,t),n}return b(t,e),t.prototype.invoke=function(e){ve().invoke(this,e)},t.prototype.navigate=function(e){this.invoke(e)},t.prototype.init=function(){ve().initBinding(this,"dataBinding","dataBinding"),ve().initBinding(this,"dataSet","dataSet")},t}(t.BaseAction),be=function(){return he.get(m.CATEGORY.NOTIFICATION)},we=function(e){function t(t){var n=e.call(this)||this;return Object.assign(n,t),n}return b(t,e),t.prototype.execute=function(t,i){var o=this,r=e.prototype.execute.call(this,t,i);return n.isDefined(r)?r:new Promise((function(e,r){switch(t){case n.DataSource.Operation.INVOKE:o.invoke(i,e,r);break;case n.DataSource.Operation.NOTIFY:o.notify(i,e,r);break;default:r(t+" operation is not supported on this data source")}}))},t.prototype.notify=function(e,t,n){be().notify(this,e,t,n)},t.prototype.invoke=function(e,t,n){this.notify(e,t,n)},t.prototype.getMessage=function(){return be().getMessage(this)},t.prototype.setMessage=function(e){return be().setMessage(this,e)},t.prototype.clearMessage=function(){return be().setMessage(this,"")},t.prototype.getOkButtonText=function(){return be().getOkButtonText(this)},t.prototype.setOkButtonText=function(e){return be().setOkButtonText(this,e)},t.prototype.getToasterDuration=function(){return be().getToasterDuration(this)},t.prototype.setToasterDuration=function(e){return be().setToasterDuration(this,e)},t.prototype.getToasterClass=function(){return be().getToasterClass(this)},t.prototype.setToasterClass=function(e){return be().setToasterClass(this,e)},t.prototype.getToasterPosition=function(){return be().getToasterPosition(this)},t.prototype.setToasterPosition=function(e){return be().setToasterPosition(this,e)},t.prototype.getAlertType=function(){return be().getAlertType(this)},t.prototype.setAlertType=function(e){return be().setAlertType(this,e)},t.prototype.getCancelButtonText=function(){return be().getCancelButtonText(this)},t.prototype.setCancelButtonText=function(e){return be().setCancelButtonText(this,e)},t.prototype.init=function(){be().initBinding(this,"dataBinding","dataBinding"),be().initBinding(this,"dataSet","dataSet")},t}(t.BaseAction),Pe=function(){return he.get(m.CATEGORY.LOGIN)},_e=function(e){function t(t){var n=e.call(this)||this;return Object.assign(n,t),n}return b(t,e),t.prototype.login=function(e,t,n){return Pe().login(this,e,t,n)},t.prototype.invoke=function(e,t,n){return this.login(e,t,n)},t.prototype.cancel=function(){},t.prototype.init=function(){Pe().initBinding(this,"dataBinding","dataBinding")},t}(t.BaseAction),Oe=function(){return he.get(m.CATEGORY.LOGOUT)},Se=function(e){function t(t){var n=e.call(this)||this;return Object.assign(n,t),n}return b(t,e),t.prototype.logout=function(e,t,n){Oe().logout(this,e,t,n)},t.prototype.invoke=function(e,t,n){this.logout(e,t,n)},t.prototype.cancel=function(){},t}(t.BaseAction),Ee=function(){return he.get(m.CATEGORY.WEBSOCKET)},Te=function(e){function t(t){var n=e.call(this)||this;return Object.assign(n,t),n}return b(t,e),t.prototype.open=function(e,t){return Ee().open(this,e,t)},t.prototype.close=function(){return Ee().close(this)},t.prototype.update=function(){return Ee().update(this)},t.prototype.send=function(e){return Ee().send(this,e)},t.prototype.cancel=function(){return this.close()},t.prototype.invoke=function(e,t,n){this.open(t,n)},t.prototype.init=function(){Ee().initBinding(this)},t}(t.ApiAwareVariable),Ce=function(){function e(){}return e.create=function(e,n){var i;switch(e.category){case t.VARIABLE_CONSTANTS.CATEGORY.MODEL:i=new t.ModelVariable(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.SERVICE:i=new t.ServiceVariable(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.LIVE:i=new t.LiveVariable(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.CRUD:i=new t.CrudVariable(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.DEVICE:i=new ge(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.NAVIGATION:i=new ye(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.NOTIFICATION:i=new we(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.LOGIN:i=new _e(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.LOGOUT:i=new Se(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.TIMER:i=new t.TimerAction(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.WEBSOCKET:i=new Te(e)}return i._context=n,i.__cloneable__=!1,i},e}(),Ae=function(){function e(e){this.$http=e,this.CONTEXT_APP="app"}return e.prototype.isLoaded=function(){return!!this.metadataMap&&this.metadataMap.has(this.CONTEXT_APP)},e.prototype.load=function(e){var t,i=this;return t=n.hasCordova()?"metadata/"+(e?"prefabs/"+e+"/":"app/")+"service-definitions.json":"./services/"+(e?"prefabs/"+e+"/":"")+"servicedefs",new Promise((function(n,o){i.$http.send({url:t,method:"GET"}).then((function(t){i.metadataMap=i.metadataMap||new Map,i.providerMap=i.providerMap||new Map,t.body=t.body||{},i.metadataMap.set(e||i.CONTEXT_APP,t.body.serviceDefs),t.body.securityDefinitions&&i.providerMap.set(e||i.CONTEXT_APP,t.body.securityDefinitions.oauthProvider),n(t.body.serviceDefs)}),o)}))},e.prototype.getByOperationId=function(e,t){t=t||this.CONTEXT_APP;var n=this.metadataMap.get(t);return n&&n[e]},e.prototype.getByProviderId=function(e,t){t=t||this.CONTEXT_APP;var n=this.providerMap.get(t);return n&&n[e]},e.prototype.getByCrudId=function(e,t){t=t||this.CONTEXT_APP;var n=this.metadataMap.get(t),i=[];for(var o in n)n[o]&&n[o].crudOperationId===e&&i.push(n[o]);return i},e}();Ae.decorators=[{type:r.Injectable}],Ae.ctorParameters=function(){return[{type:n.AbstractHttpService}]};var Re=function(){function t(){}return t.prototype.format=function(t,n){return e.appManager.getPipe("date").transform(t,n)},t}(),Ie=function(){function e(e,n,i,o,r,a,s,l){this.httpService=e,this.metadataService=n,this.navigationService=i,this.routerService=o,this.toasterService=r,this.oAuthService=a,this.securityService=s,this.dialogService=l,R("http",this.httpService),R("metadata",this.metadataService),R("navigationService",this.navigationService),R("router",this.routerService),R("toaster",this.toasterService),R("oAuth",this.oAuthService),R("security",this.securityService),R("dialog",this.dialogService),t.wmSetDependency("oAuth",this.oAuthService),t.wmSetDependency("security",this.securityService),t.wmSetDependency("metadata",this.metadataService),t.wmSetDependency("http",this.httpService)}return e.prototype.bulkCancel=function(e){Object.keys(e).forEach((function(t){var n=e[t];_.isFunction(n.cancel)&&n.cancel()}))},e.prototype.triggerStartUpdate=function(e){return Promise.all(Object.keys(e).map((function(t){return e[t]})).filter((function(e){return(null==e?void 0:e.startUpdate)&&e.invoke})).map((function(e){return e.invoke()})))},e.prototype.processBindExp=function(e,i,o){var r=t.getTarget(o),a=t.getTargetNodeKey(e.target),s=_.isArray(e.value)?e.value[0]:e.value;return s&&(s.startsWith&&s.startsWith("bind:")?s=n.$watch(s.replace("bind:",""),i,{},o.invokeOnParamChange.bind(o,e),void 0,void 0,void 0,(function(){return o.isMuted})):_.isUndefined(e.value)||(t.setValueToNode(e.target,e,r,o,e.value,!0),r!==a&&(t.internalBoundNodeMap.has(o)||t.internalBoundNodeMap.set(o,{}),_.set(t.internalBoundNodeMap.get(o),[o.name,r,e.target],e.value)))),{name:e.target,value:s}},e.prototype.processBinding=function(e,t,n,i){var o=this;i=i||"dataBinding";var r=e[n=n||"dataBinding"];e[n]={},e["_bind"+n]=r,r&&_.isArray(r)&&r.forEach((function(n){"wm.Variable"===e.category&&"dataBinding"===n.target&&(n.target="dataSet"),o.processBindExp(n,t,e)}))},e.prototype.isVariableSeperated=function(e,t){return"wm.Variable"===e[t].category||"wm.ServiceVariable"===e[t].category||"wm.LiveVariable"===e[t].category||"wm.CrudVariable"===e[t].category},e.prototype.getBindSourceTarget=function(e){return"wm.LiveVariable"===e.category?"read"===e.operation?"filterFields":"inputFields":"wm.ModelVariable"===e.category?"dataSet":"dataBinding"},e.prototype.register=function(e,i,o){var r,a=this,s={Variables:{},Actions:{},callback:this.triggerStartUpdate};for(var l in i){if((r=Ce.create(i[l],o)).init(),this.isVariableSeperated(i,l)&&(this.processBinding(r,o,"dataBinding",this.getBindSourceTarget(r)),r.httpService=this.httpService,r.dateFormatter=new Re,r.subscribe("afterInvoke",(function(){return n.$invokeWatchers(!0)})),"wm.LiveVariable"===r.category&&"read"===r.operation&&n.processFilterExpBindNode(r._context,r.filterExpressions,r),"wm.CrudVariable"!==r.category&&"wm.ServiceVariable"!==r.category||(r.simulateFileDownload=W)),this.isVariableSeperated(i,l)||"wm.TimerVariable"===i[l].category)for(var c in m.EVENT)r[m.EVENT[c]]&&(r[m.EVENT[c]]=n.$parseEvent(r[m.EVENT[c]]));r instanceof t.BaseAction?s.Actions[l]=r:s.Variables[l]=r}return o.registerDestroyListener&&o.registerDestroyListener((function(){a.bulkCancel(s.Variables),a.bulkCancel(s.Actions)})),s},e.prototype.destroy=function(){},e.prototype.registerDependency=function(e,n){R(e,n),t.wmSetDependency(e,n)},e}();Ie.decorators=[{type:r.Injectable}],Ie.ctorParameters=function(){return[{type:n.AbstractHttpService},{type:Ae},{type:n.AbstractNavigationService},{type:a.Router},{type:n.AbstractToasterService},{type:s.OAuthService},{type:l.SecurityService},{type:n.AbstractDialogService}]};var De=u.ToastrModule.forRoot({maxOpened:1,autoDismiss:!0}),Ne=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[Ie,Ae,c.Location,{provide:c.LocationStrategy,useClass:c.HashLocationStrategy}]}},e}();Ne.decorators=[{type:r.NgModule,args:[{imports:[c.CommonModule,De,p.HttpClientModule,d.HttpServiceModule,s.OAuthModule,l.SecurityModule],declarations:[]}]}],e.$rootScope=v,e.CONSTANTS=h,e.DB_CONSTANTS={DATABASE_MATCH_MODES:{like:"LIKE",start:"STARTING_WITH",startignorecase:"STARTING_WITH_IGNORECASE",end:"ENDING_WITH",endignorecase:"ENDING_WITH_IGNORECASE",anywhere:"CONTAINING",anywhereignorecase:"CONTAINING_IGNORECASE",nowhere:"DOES_NOT_CONTAIN",nowhereignorecase:"DOES_NOT_CONTAIN_IGNORECASE",exact:"EQUALS",exactignorecase:"EQUALS_IGNORECASE",notequals:"NOT_EQUALS",notequalsignorecase:"NOT_EQUALS_IGNORECASE",between:"BETWEEN",in:"IN",notin:"NOTIN",lessthan:"LESS_THAN",lessthanequal:"LESS_THAN_OR_EQUALS",greaterthan:"GREATER_THAN",greaterthanequal:"GREATER_THAN_OR_EQUALS",null:"NULL",isnotnull:"IS_NOT_NULL",empty:"EMPTY",isnotempty:"IS_NOT_EMPTY",nullorempty:"NULL_OR_EMPTY"},DATABASE_EMPTY_MATCH_MODES:["NULL","IS_NOT_NULL","EMPTY","IS_NOT_EMPTY","NULL_OR_EMPTY"],DATABASE_RANGE_MATCH_MODES:["IN","NOTIN","BETWEEN","LESS_THAN","LESS_THAN_OR_EQUALS","GREATER_THAN","GREATER_THAN_OR_EQUALS","NOT_EQUALS"],DATABASE_NULL_EMPTY_MATCH:{NULL:"NULL",IS_NOT_NULL:"IS_NOT_NULL",EMPTY:"NULL",IS_NOT_EMPTY:"IS_NOT_NULL",NULL_OR_EMPTY:"NULL"},DATABASE_MATCH_MODES_WITH_QUERY:{LIKE:"${0} like ${1}",STARTING_WITH:"${0} like ${1}",STARTING_WITH_IGNORECASE:"${0} like ${1}",ENDING_WITH:"${0} like ${1}",ENDING_WITH_IGNORECASE:"${0} like ${1}",CONTAINING:"${0} like ${1}",CONTAINING_IGNORECASE:"${0} like ${1}",DOES_NOT_CONTAIN:"${0} not like ${1}",DOES_NOT_CONTAIN_IGNORECASE:"${0} not like ${1}",EQUALS:"${0}=${1}",EQUALS_IGNORECASE:"${0}=${1}",NOT_EQUALS:"${0}!=${1}",NOT_EQUALS_IGNORECASE:"${0}!=${1}",BETWEEN:"${0} between ${1}",IN:"${0} in ${1}",NOTIN:"${0} not in ${1}",LESS_THAN:"${0}<${1}",LESS_THAN_OR_EQUALS:"${0}<=${1}",GREATER_THAN:"${0}>${1}",GREATER_THAN_OR_EQUALS:"${0}>=${1}",NULL:"${0} is null",IS_NOT_NULL:"${0} is not null",EMPTY:"${0}=''",IS_NOT_EMPTY:"${0}<>''",NULL_OR_EMPTY:"${0} is null or ${0}=''"},DATABASE_STRING_MODES:["LIKE","STARTING_WITH","STARTING_WITH_IGNORECASE","ENDING_WITH","ENDING_WITH_IGNORECASE","CONTAINING","CONTAINING_IGNORECASE","DOES_NOT_CONTAIN","DOES_NOT_CONTAIN_IGNORECASE","EQUALS","EQUALS_IGNORECASE","NOT_EQUALS","NOT_EQUALS_IGNORECASE"]},e.DeviceVariableManager=ne,e.DeviceVariableService=me,e.Formatter=Re,e.MetadataService=Ae,e.SWAGGER_CONSTANTS=g,e.VARIABLE_CONSTANTS=m,e.VARIABLE_URLS={DATABASE:{searchTableData:{url:"/:service/:dataModelName/:entityName/search?page=:page&size=:size&:sort",method:"POST"},searchTableDataWithQuery:{url:"/:service/:dataModelName/:entityName/filter?page=:page&size=:size&:sort",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"}},readTableData:{url:"/:service/:dataModelName/:entityName?page=:page&size=:size&:sort",method:"GET"},insertTableData:{url:"/:service/:dataModelName/:entityName",method:"POST"},insertMultiPartTableData:{url:"/:service/:dataModelName/:entityName",method:"POST",headers:{}},updateTableData:{url:"/:service/:dataModelName/:entityName/:id",method:"PUT"},updateMultiPartTableData:{url:"/:service/:dataModelName/:entityName/:id",method:"POST",headers:{}},deleteTableData:{url:"/:service/:dataModelName/:entityName/:id",method:"DELETE"},updateCompositeTableData:{url:"/:service/:dataModelName/:entityName/composite-id?:id",method:"PUT"},periodUpdateCompositeTableData:{url:"/:service/:dataModelName/:entityName/composite-id/periods?:id",method:"PUT"},updateMultiPartCompositeTableData:{url:"/:service/:dataModelName/:entityName/composite-id?:id",method:"POST",headers:{}},deleteCompositeTableData:{url:"/:service/:dataModelName/:entityName/composite-id?:id",method:"DELETE"},periodDeleteCompositeTableData:{url:"/:service/:dataModelName/:entityName/composite-id/periods?:id",method:"DELETE"},getDistinctDataByFields:{url:"/:service/:dataModelName/:entityName/aggregations?page=:page&size=:size&:sort",method:"POST"},exportTableData:{url:"/services/:dataModelName/:entityName/export?:sort",method:"POST"},readTableRelatedData:{url:"/:service/:dataModelName/:entityName/:id/:relatedFieldName?page=:page&size=:size&:sort",method:"GET"},executeNamedQuery:{url:"/:service/:dataModelName/queryExecutor/queries/:queryName?page=:page&size=:size&:queryParams",method:"GET"},executeCustomQuery:{url:"/:service/:dataModelName/queries/execute?page=:page&size=:size",method:"POST"},executeAggregateQuery:{url:"/services/:dataModelName/:entityName/aggregations?page=:page&size=:size&sort=:sort",method:"POST"},executeNamedProcedure:{url:"/:service/:dataModelName/procedureExecutor/procedure/execute/:procedureName?page=:page&size=:size&:procedureParams",method:"GET"},countTableDataWithQuery:{url:"/:service/:dataModelName/:entityName/count?:queryParams",method:"GET"}},oauthConfiguration:{getAuthorizationUrl:{url:"services/oauth2/:providerId/authorizationUrl",method:"GET"}}},e.VariableManagerFactory=he,e.VariablesModule=Ne,e.VariablesService=Ie,e.WS_CONSTANTS=f,e.debounceVariableCall=z,e.formatDate=K,e.formatExportExpression=function(e){return _.forEach(e,(function(e){e.expression&&(e.expression="${"+e.expression+"}")})),e},e.getEvaluatedOrderBy=function(e,t){var n,i;return!t||_.isEmpty(t)?e:e?(e=_.split(e,","),t=_.split(t,","),n=_.map(t,(function(e){return _.split(_.trim(e)," ")[0]})),_.remove(e,(function(e){return _.includes(n,_.split(_.trim(e)," ")[0])})),i=e.length?","+_.join(e,","):"",_.join(t,",")+i):t},e.initiateCallback=I,e.isFileUploadSupported=q,e.processBinding=U,e.setDependency=R,e.setInput=function(e,t,i,o){e=e||{};var r,a,s={};if(_.isObject(o))switch(o.type){case"file":i=n.getBlob(i,o.contentType);break;case"number":i=_.isNumber(i)?i:parseInt(i,10)}return _.isObject(t)?s=t:t.indexOf(".")>-1?(a=(r=t.split(".")).pop(),e=n.findValueOf(e,r.join("."),!0),s[t=a]=i):s[t]=i,_.forEach(s,(function(t,n){e[n]=t})),e},e.simulateFileDownload=W,e.toastrModule=De,e["\u0275a"]=Z,e["\u0275b"]=Q,e["\u0275c"]=X,e["\u0275d"]=J,e["\u0275e"]=ee,e["\u0275f"]=te,e["\u0275g"]=pe,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@awesome-cordova-plugins/file/ngx"),require("@wm/core"),require("@wm/mobile/core"),require("@wm/security"),require("@awesome-cordova-plugins/app-version/ngx"),require("@awesome-cordova-plugins/sqlite/ngx"),require("@wm/variables"),require("@awesome-cordova-plugins/app-version/ngx/index"),require("@awesome-cordova-plugins/file/ngx/index"),require("@awesome-cordova-plugins/sqlite/ngx/index"),require("rxjs"),require("@wavemaker/variables")):"function"==typeof define&&define.amd?define("@wm/mobile/offline",["exports","@angular/core","@angular/common","@awesome-cordova-plugins/file/ngx","@wm/core","@wm/mobile/core","@wm/security","@awesome-cordova-plugins/app-version/ngx","@awesome-cordova-plugins/sqlite/ngx","@wm/variables","@awesome-cordova-plugins/app-version/ngx/index","@awesome-cordova-plugins/file/ngx/index","@awesome-cordova-plugins/sqlite/ngx/index","rxjs","@wavemaker/variables"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.mobile=e.wm.mobile||{},e.wm.mobile.offline={}),e.ng.core,e.ng.common,e.awesomeCordova.plugins,e.wm.core,e.wm.mobile.core,e.wm.security,e.awesomeCordova.plugins,e.awesomeCordova.plugins,e.wm.variables,e.awesomeCordova.plugins,e.awesomeCordova.plugins,e.awesomeCordova.plugins,e.rxjs,e.wm_common_variables)}(this,(function(e,t,n,i,o,r,a,s,l,c,p,u,d,h,m){"use strict";function f(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 g=f(t),v=f(o),y=f(r),b=f(a),w=f(p),P=f(u),O=f(d),S=function(){function e(){}return e.prototype.get=function(e){return this.fetchEntry(e).then((function(e){var t;return e&&e.length>0&&(t=e[0].value)&&(t=JSON.parse(t)),t}))},e.prototype.init=function(e){this.store=e},e.prototype.put=function(e,t){var n=this;return t&&(t=JSON.stringify(t)),this.fetchEntry(e).then((function(i){return i&&i.length>0?n.store.save({id:i[0].id,key:e,value:t}):n.store.add({key:e,value:t})}))},e.prototype.remove=function(e){var t=this;return this.fetchEntry(e).then((function(e){if(e&&e.length>0)return t.store.delete(e[0].id)}))},e.prototype.fetchEntry=function(e){var t=[{attributeName:"key",attributeValue:e,attributeType:"STRING",filterCondition:"EQUALS"}];return this.store.filter(t)},e}();S.SERVICE_NAME="LocalKeyValueService",S.\u0275prov=g.\u0275\u0275defineInjectable({factory:function(){return new S},token:S,providedIn:"root"}),S.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}];var E,T="WM_LOCAL_OFFLINE_CALL",C=function(e){if(e)return'"'+(e=e.replace(/"/g,'""'))+'"'},A=function(e){var t=[],n=[];return _.forEach(e.columns,(function(e){t.push(C(e.name)),n.push("?")})),"INSERT INTO "+C(e.name)+" ("+t.join(",")+") VALUES ("+n.join(",")+")"},R=function(e){var t=[],n=[];return _.forEach(e.columns,(function(e){t.push(C(e.name)),n.push("?")})),"REPLACE INTO "+C(e.name)+" ("+t.join(",")+") VALUES ("+n.join(",")+")"},I=function(e){var t=_.find(e.columns,"primaryKey");return t?"DELETE FROM "+C(e.name)+" WHERE "+C(t.name)+" = ?":""},D=function(e){var t=[],n=[];return e.columns.forEach((function(i){var o;t.push(C(e.name)+"."+C(i.name)+" as "+i.fieldName),i.foreignRelations&&i.foreignRelations.forEach((function(r){o=r.sourceFieldName,_.forEach(r.dataMapper,(function(e,n){t.push(o+"."+C(e.name)+" as '"+n+"'")})),n.push(" LEFT JOIN "+C(r.targetTable)+" "+o+"\n ON "+o+"."+C(r.targetColumn)+" = "+C(e.name)+"."+C(i.name))}))})),"SELECT "+t.join(",")+" FROM "+C(e.name)+" "+n.join(" ")},N=function(e){var t=[];return e.columns.forEach((function(n){var i;n.foreignRelations&&n.foreignRelations.forEach((function(o){i=o.sourceFieldName,t.push(" LEFT JOIN "+C(o.targetTable)+" "+i+"\n ON "+i+"."+C(o.targetColumn)+" = "+C(e.name)+"."+C(n.name))}))})),"SELECT count(*) as count FROM "+C(e.name)+" "+t.join(" ")},x=function(e,t){var n,i=e.fieldToColumnMapping,o=e.entitySchema.name;return!_.isEmpty(t)&&_.isString(t)?" WHERE "+t:(t&&(n=t.map((function(e){var t=i[e.attributeName],n=e.filterCondition,r=e.attributeValue,a="=";return"STRING"===e.attributeType?("STARTING_WITH"===n?(r+="%",a="like"):"ENDING_WITH"===n?(r="%"+r,a="like"):"CONTAINING"===n&&(r="%"+r+"%",a="like"),r="'"+r+"'"):"BOOLEAN"===e.attributeType&&(r=!0===r?1:0),C(o)+"."+C(t)+" "+a+" "+r}))),n&&n.length>0?" WHERE "+n.join(" AND "):"")},k=function(e,t){return t?" ORDER BY "+_.map(t.split(","),(function(t){var n=_.trim(t).split(" ");return n[0]=C(e.entitySchema.name)+"."+C(e.fieldToColumnMapping[n[0]]),n.join(" ")})).join(","):""},M=function(e){return" LIMIT "+((e=e||{}).limit||100)+" OFFSET "+(e.offset||0)},L=function(e,t){return e.columns.forEach((function(e){var n=t[e.fieldName];e.foreignRelations?e.foreignRelations.forEach((function(e){var n=null;_.forEach(e.dataMapper,(function(e,i){var r=t[i];o.isDefined(r)&&null!==r&&""!==r&&((n=n||{})[e.fieldName]=t[i]),delete t[i]})),t[e.sourceFieldName]=n})):"boolean"!==e.sqlType||_.isNil(n)||(t[e.fieldName]=1===n)})),t},F=function(e,t){var n=e[t.fieldName];return t.foreignRelations&&t.foreignRelations.some((function(t){return!(!t.targetEntity||!e[t.sourceFieldName])&&(n=e[t.sourceFieldName][t.targetFieldName],!0)})),_.isNil(n)?t.defaultValue:"boolean"===t.sqlType?!0===n?1:0:n},j=function(e,t){var n={};return e.entitySchema.columns.forEach((function(e){return n[e.name]=F(t,e)})),n},B=function(){function e(e,t,n,i,o){var r=this;this.deviceFileService=e,this.entitySchema=t,this.file=n,this.localDbManagementService=i,this.sqliteObject=o,this.fieldToColumnMapping={},this.primaryKeyField=_.find(this.entitySchema.columns,"primaryKey"),this.primaryKeyName=this.primaryKeyField?this.primaryKeyField.fieldName:void 0,this.entitySchema.columns.forEach((function(e){r.fieldToColumnMapping[e.fieldName]=e.name,e.foreignRelations&&e.foreignRelations.forEach((function(t){r.fieldToColumnMapping[t.targetPath]=e.name,_.forEach(t.dataMapper,(function(e,n){r.fieldToColumnMapping[n]=t.sourceFieldName+"."+e.name}))}))})),this.insertRecordSqlTemplate=A(this.entitySchema),this.replaceRecordSqlTemplate=R(this.entitySchema),this.deleteRecordTemplate=I(this.entitySchema),this.selectSqlTemplate=D(this.entitySchema),this.countQuery=N(this.entitySchema)}return e.prototype.add=function(e){if(this.primaryKeyName){var t=e[this.primaryKeyName];if("number"===this.primaryKeyField.sqlType&&(!o.isDefined(t)||_.isString(t)&&_.isEmpty(_.trim(t))))if("identity"===this.primaryKeyField.generatorType)e[this.primaryKeyName]=this.localDbManagementService.nextIdCount();else{var n=this.getValue(e,this.primaryKeyName);e[this.primaryKeyName]=n}}var i=j(this,e),r=this.entitySchema.columns.map((function(e){return i[e.name]}));return this.sqliteObject.executeSql(this.insertRecordSqlTemplate,r).then((function(e){return e.insertId}))},e.prototype.clear=function(){return this.sqliteObject.executeSql("DELETE FROM "+C(this.entitySchema.name))},e.prototype.create=function(){var e=this;return this.sqliteObject.executeSql(this.createTableSql(this.entitySchema)).then((function(){return e}))},e.prototype.count=function(e){var t=this.countQuery+x(this,e);return this.sqliteObject.executeSql(t).then((function(e){return e.rows.item(0).count}))},e.prototype.deserialize=function(e){return this.deserializeMapToFormData(e)},e.prototype.filter=function(e,t,n){var i=this,o=this.selectSqlTemplate;return o+=x(this,e),o+=k(this,t),o+=M(n),this.sqliteObject.executeSql(o).then((function(e){for(var t=[],n=e.rows.length,o=0;o<n;o++)t.push(L(i.entitySchema,e.rows.item(o)));return t}))},e.prototype.refresh=function(e){var t=this.primaryKeyName,n=this.getValue(e,t);return n?this.get(n):Promise.resolve(e)},e.prototype.delete=function(e){return this.sqliteObject.executeSql(this.deleteRecordTemplate,[e])},e.prototype.get=function(e){var t=[{attributeName:this.primaryKeyName,filterCondition:"=",attributeValue:e,attributeType:this.primaryKeyField.sqlType.toUpperCase()}];return this.filter(t).then((function(e){return e&&1===e.length?e[0]:void 0}))},e.prototype.getValue=function(e,t){var n=this.entitySchema.columns.find((function(e){return e.fieldName===t}));return F(e,n)},e.prototype.save=function(e){return this.saveAll([e])},e.prototype.saveAll=function(e){var t=this;e=_.filter(e,null);var n=_.map(e,(function(e){var n=j(t,e),i=t.entitySchema.columns.map((function(e){return n[e.name]}));return[t.replaceRecordSqlTemplate,i]}));return this.sqliteObject.sqlBatch(n)},e.prototype.serialize=function(e){return this.serializeFormDataToMap(e)},e.prototype.saveBlobToFile=function(e){var t=this.deviceFileService.appendToFileName(e.name),n=this.deviceFileService.getUploadDirectory();return this.file.writeFile(n,t,e).then((function(){return{name:e.name,type:e.type,lastModified:e.lastModified,lastModifiedDate:e.lastModifiedDate,size:e.size,wmLocalPath:n+"/"+t}}))},e.prototype.serializeFormDataToMap=function(e){var t=this,n=_.filter(this.entitySchema.columns,{sqlType:"blob"}),i=[],o={};return e&&"function"==typeof e.append&&e.rowData?_.forEach(e.rowData,(function(e,r){e&&_.find(n,{fieldName:r})?i.push(t.saveBlobToFile(e).then((function(e){o[r]=e}))):o[r]=e})):o=e,Promise.all(i).then((function(){return o}))},e.prototype.deserializeMapToFormData=function(e){var t=new FormData,n=this.entitySchema.columns.filter((function(e){return"blob"===e.sqlType})),i=[];return _.forEach(n,(function(n){var r=e[n.fieldName];r&&r.wmLocalPath&&(i.push(o.convertToBlob(r.wmLocalPath).then((function(e){return t.append(n.fieldName,e.blob,r.name)}))),e[n.fieldName]="")})),t.append(c.SWAGGER_CONSTANTS.WM_DATA_JSON,new Blob([JSON.stringify(e)],{type:"application/json"})),Promise.all(i).then((function(){return t}))},e.prototype.createTableSql=function(e){var t=_.reduce(e.columns,(function(e,t){var n=C(t.name);return t.primaryKey&&("number"===t.sqlType&&"databaseIdentity"===t.generatorType?n+=" INTEGER PRIMARY KEY AUTOINCREMENT":n+=" PRIMARY KEY"),e?e+","+n:n}),!1);return"CREATE TABLE IF NOT EXISTS "+C(e.name)+" ("+t+")"},e}(),G=function(){this.schema={name:"",isInternal:!1,entities:new Map},this.stores=new Map,this.queries=new Map},V=function(e,t){this.name=e,this.fieldName=t,this.primaryKey=!1,this.fieldName=this.fieldName||this.name};!function(e){e.LIVE="LIVE",e.BUNDLED="BUNDLED",e.APP_START="APP_START"}(E||(E={}));var U="localDBStore.nextIdCount",W="www/metadata/app",q={name:"wavemaker",version:1,isInternal:!0,tables:[{name:"key_value",entityName:"key-value",columns:[{fieldName:"id",name:"id",generatorType:"databaseIdentity",sqlType:"number",primaryKey:!0},{fieldName:"key",name:"key"},{name:"value",fieldName:"value"}]},{name:"offlineChangeLog",entityName:"offlineChangeLog",columns:[{fieldName:"id",name:"id",generatorType:"databaseIdentity",sqlType:"number",primaryKey:!0},{name:"service",fieldName:"service"},{name:"operation",fieldName:"operation"},{name:"params",fieldName:"params"},{name:"timestamp",fieldName:"timestamp"},{name:"hasError",fieldName:"hasError"},{name:"errorMessage",fieldName:"errorMessage"}]}]},z=function(){function e(e,t,n,i,o,r,a){var s=this;this.appVersion=e,this.deviceService=t,this.deviceFileService=n,this.file=i,this.localKeyValueService=o,this.securityService=r,this.sqlite=a,this.callbacks=[],this._logSql=!1,this.nextId=1e11,this.systemProperties={USER_ID:{name:"USER_ID",value:function(){return s.securityService.getLoggedInUser().then((function(e){return e.userId}))}},USER_NAME:{name:"USER_NAME",value:function(){return s.securityService.getLoggedInUser().then((function(e){return e.userName}))}},DATE_TIME:{name:"DATE_TIME",value:function(){return moment().format("YYYY-MM-DDThh:mm:ss")}},DATE:{name:"CURRENT_DATE",value:function(){return moment().format("YYYY-MM-DD")}},TIME:{name:"TIME",value:function(){return moment().format("hh:mm:ss")}}}}return e.prototype.close=function(){var e=this;return new Promise((function(t,n){setTimeout((function(){var i=_.map(_.values(e.databases),(function(e){return e.sqliteObject.close()}));Promise.all(i).then(t,n)}),1e3)}))},e.prototype.nextIdCount=function(){return this.nextId=this.nextId+1,this.localKeyValueService.put(U,this.nextId),this.nextId},e.prototype.executeNamedQuery=function(e,t,n){var i,r,a=this;return this.databases[e]&&this.databases[e].queries[t]?(i=this.databases[e].queries[t],r=_.chain(i.params).filter((function(e){return"PROMPT"!==e.variableType})).forEach((function(e){var t=a.systemProperties[e.variableType].value(e.name,n);return o.toPromise(t).then((function(t){return n[e.name]=t}))})).value(),Promise.all(r).then((function(){return n=_.map(i.params,(function(e){return"string"==typeof n[e.name]||e.type!==o.DataType.DATETIME&&e.type!==o.DataType.LOCALDATETIME?e.type===o.DataType.BOOLEAN?a.convertBoolToInt(n[e.name]):n[e.name]:c.formatDate(n[e.name],e.type)})),a.executeSQLQuery(e,i.query,n).then((function(e){var t,n;return _.isEmpty(e.rows)||(t=e.rows[0],n=_.find(i.response.properties,(function(e){return!t.hasOwnProperty(e.fieldName)})),_.isUndefined(n)||(e.rows=_.map(e.rows,(function(e){var t={},n={};return _.forEach(e,(function(e,t){return n[t.toUpperCase()]=e})),_.forEach(i.response.properties,(function(i){var r=o.extractType(i.fieldType.typeRef),s=(o.DEFAULT_FORMATS[_.toUpper(r)],e[i.name]);!s||"string"==typeof s||r!==o.DataType.DATETIME&&r!==o.DataType.LOCALDATETIME&&r!==o.DataType.DATE||(moment(s).isValid()?e[i.name]=c.formatDate(s,r):moment(s,"HH:mm").isValid()&&(e[i.name]=moment().format("YYYY-MM-DD")+"T"+s)),r===o.DataType.BOOLEAN&&(e[i.name]=a.convertIntToBool(s)),n[i.nameInUpperCase]=e[i.name],t[i.name]=e[i.name],t[i.fieldName]=e[i.fieldName]||n[i.nameInUpperCase]})),t})))),e}))}))):Promise.reject("Query by name ' "+t+" ' Not Found")},e.prototype.exportDB=function(){var e=this;return new Promise((function(t,n){var i,r="offline_temp_"+_.now(),a=cordova.file.cacheDirectory+r+"/",s={app:null,OS:"",createdOn:0};i=o.isIos()?cordova.file.documentsDirectory:cordova.file.externalRootDirectory+"Download/",e.file.createDir(cordova.file.cacheDirectory,r,!1).then((function(){return e.file.copyDir(e.dbInstallParentDirectory,e.dbInstallDirectoryName,a,"databases").then((function(){return e.getAppInfo()})).then((function(e){return s.app=e,o.isIos()?s.OS="IOS":o.isAndroid()&&(s.OS="ANDROID"),s.createdOn=_.now(),s})).then((function(){return o.executePromiseChain(e.getCallbacksFor("preExport"),[a,s])})).then((function(){return e.file.writeFile(a,"META.json",JSON.stringify(s))}))})).then((function(){var t=s.app.name;return t=t.replace(/\s+/g,"_"),e.deviceFileService.newFileName(i,t+"_offline_data.zip").then((function(e){return new Promise((function(t,n){Zeep.zip({from:a,to:i+e},(function(){return t(i+e)}),n)}))}))})).then(t,n).catch(o.noop).then((function(){return e.deviceFileService.removeDir(cordova.file.cacheDirectory+r)}))}))},e.prototype.getStore=function(e,t){var n=this;return new Promise((function(i,o){n.databases[e]&&i(n.databases[e].stores[t]),o("store with name'"+t+"' in datamodel '"+e+"' is not found")}))},e.prototype.importDB=function(e,t){var n=this;return new Promise((function(i,r){var a,s="offline_temp_"+_.now(),l=cordova.file.cacheDirectory+s+"/";n.file.createDir(cordova.file.cacheDirectory,s,!1).then((function(){return new Promise((function(t,n){Zeep.unzip({from:e,to:l},t,n)}))})).then((function(){return n.file.readAsText(l,"META.json").then((function(e){return a=JSON.parse(e),n.getAppInfo()})).then((function(e){return a.app?a.app.packageName!==e.packageName?Promise.reject("database zip of app with same package name can only be imported"):void 0:Promise.reject("meta information is not found in zip")}))})).then((function(){var e;return n.close().then((function(){if(t)return n.exportDB().then((function(t){return e=t}))})).then((function(){return n.deviceFileService.removeDir(n.dbInstallDirectory)})).then((function(){return n.file.copyDir(l,"databases",n.dbInstallParentDirectory,n.dbInstallDirectoryName)})).then((function(){return n.databases=null,n.loadDatabases()})).then((function(){return o.executePromiseChain(n.getCallbacksFor("postImport"),[l,a])})).then((function(){if(e)return n.deviceFileService.removeFile(e)}),(function(t){return e?n.importDB(e,!1).then((function(){return n.deviceFileService.removeFile(e),Promise.reject(t)})):Promise.reject(t)}))})).then(i,r).catch(o.noop).then((function(){return n.deviceFileService.removeDir(cordova.file.cacheDirectory+s)}))}))},e.prototype.isOperationAllowed=function(e,t,n){return this.getStore(e,t).then((function(e){return!!e&&("READ"===n?e.entitySchema.pushConfig.readEnabled:"INSERT"===n?e.entitySchema.pushConfig.insertEnabled:"UPDATE"===n?e.entitySchema.pushConfig.updateEnabled:"DELETE"===n&&e.entitySchema.pushConfig.deleteEnabled)})).catch((function(){return!1}))},e.prototype.loadDatabases=function(){var e=this,t=!1;return this.databases?Promise.resolve(this.databases):(o.isIos()?(this.dbInstallDirectoryName="LocalDatabase",this.dbInstallParentDirectory=cordova.file.applicationStorageDirectory+"Library/"):(this.dbInstallDirectoryName="databases",this.dbInstallParentDirectory=cordova.file.applicationStorageDirectory),this.dbInstallDirectory=this.dbInstallParentDirectory+this.dbInstallDirectoryName,this.databases=new Map,this.setUpDatabases().then((function(e){return t=e})).then((function(){return e.loadDBSchemas()})).then((function(t){return e.loadNamedQueries(t)})).then((function(t){return e.loadOfflineConfig(t)})).then((function(t){return Promise.all(_.map(t,(function(t){return e.openDatabase(t).then((function(n){e.databases[t.schema.name]=n}))})))})).then((function(){return e.getStore("wavemaker","key-value").then((function(t){return e.localKeyValueService.init(t),e.localKeyValueService.get(U).then((function(t){e.nextId=t||e.nextId}))}))})).then((function(){return t?e.normalizeData().then((function(){return e.disableForeignKeys()})).then((function(){return e.deviceService.getAppBuildTime()})).then((function(t){return o.executePromiseChain(_.map(e.callbacks,"onDbCreate"),[{databases:e.databases,dbCreatedOn:_.now(),dbSeedCreatedOn:t}])})).then((function(){return e.databases})):e.databases})))},e.prototype.registerCallback=function(e){this.callbacks.push(e)},e.prototype.setLogSQl=function(e){this._logSql=e},e.prototype.cleanAndCopyDatabases=function(){var e=this,t=cordova.file.applicationDirectory+W;return this.file.createDir(this.dbInstallParentDirectory,this.dbInstallDirectoryName,!1).catch(o.noop).then((function(){return e.deviceFileService.listFiles(e.dbInstallDirectory,/.+\.db$/)})).then((function(t){if(t&&t.length>0)return Promise.all(t.map((function(t){if("wavemaker.db"!==t.name)return e.file.removeFile(e.dbInstallDirectory,t.name)})))})).then((function(){return e.deviceFileService.listFiles(t,/.+\.db$/)})).then((function(n){if(n&&n.length>0)return e.file.createDir(e.dbInstallParentDirectory,e.dbInstallDirectoryName,!1).catch(o.noop).then((function(){return Promise.all(n.map((function(n){return e.file.copyFile(t,n.name,e.dbInstallDirectory,n.name)})))}))}))},e.prototype.compactEntitySchema=function(e,t,n){var i=n[t.entityName];return i.entityName=t.entityName,i.name=t.name,i.columns=[],t.columns.forEach((function(e){var t=e.columnValue?e.columnValue.defaultValue:"",n=e.sqlType;t="number"!==n||e.primaryKey?"boolean"===n?_.isEmpty(t)?null:"true"===t?1:0:_.isEmpty(t)?null:t:_.isEmpty(t)?null:_.parseInt(t),i.columns.push({name:e.name,fieldName:e.fieldName,generatorType:e.generatorType,sqlType:e.sqlType,primaryKey:e.primaryKey,defaultValue:t})})),_.forEach(t.relations,(function(t){var n,o,r,a,s;if(("ManyToOne"===t.cardinality||"OneToOne"===t.cardinality)&&(o=_.find(e.tables,(function(e){return e.name===t.targetTable})),s=t.mappings[0],o)){o=o.entityName,a=s.sourceColumn,r=i.columns.find((function(e){return e.name===a})),n=e.tables.find((function(e){return e.name===t.targetTable}));var l={sourceFieldName:t.fieldName,targetEntity:o,targetTable:t.targetTable,targetColumn:s.targetColumn,targetPath:"",dataMapper:[],targetFieldName:n.columns.find((function(e){return e.name===s.targetColumn})).fieldName};l.targetPath=l.sourceFieldName+"."+l.targetFieldName,l.dataMapper=_.chain(n.columns).keyBy((function(e){return l.sourceFieldName+"."+e.fieldName})).mapValues((function(e){return new V(e.name,e.fieldName)})).value(),r.foreignRelations=r.foreignRelations||[],r.foreignRelations.push(l)}})),i},e.prototype.compactQueries=function(e){var t=this,n=new Map;return _.forEach(e.queries,(function(e){var i,o;e.nativeSql&&"SELECT"===e.type&&(i=_.isEmpty(e.offlineQueryString)?e.queryString:e.offlineQueryString,(o=_.map(t.extractQueryParams(i),(function(t){var n=_.find(e.parameters,{name:t});return{name:n.name,type:n.type,variableType:n.variableType}}))).forEach((function(e){return i=_.replace(i,":"+e.name,"?")})),n[e.name]={name:e.name,query:i,params:o,response:{properties:_.map(e.response.properties,(function(e){return e.nameInUpperCase=e.name.toUpperCase(),e}))}})})),n},e.prototype.compactSchema=function(e){var t=this,n=new G,i=new Map;return e.tables.forEach((function(e){i[e.entityName]={}})),e.tables.forEach((function(n){t.compactEntitySchema(e,n,i)})),n.schema.name=e.name,n.schema.isInternal=e.isInternal,n.schema.entities=i,n},e.prototype.convertBoolToInt=function(e){return"true"===_.toString(e)?1:0},e.prototype.convertIntToBool=function(e){return!!e},e.prototype.disableForeignKeys=function(){var e=this;return Promise.all(_.map(this.databases,(function(t){return e.executeSQLQuery(t.schema.name,"PRAGMA foreign_keys = OFF")})))},e.prototype.executeSQLQuery=function(e,t,n,i){var o=this.databases[e];return o?o.sqliteObject.executeSql(t,n,i).then((function(e){for(var t=[],n=e.rows,i=0;i<n.length;i++)t.push(n.item(i));return{rowsAffected:e.rowsAffected,rows:t}})):Promise.reject("No Database with name "+e+" found")},e.prototype.extractQueryParams=function(e){var t;return(t=e.match(/[^"'\w\\]:\s*\w+\s*/g)||[]).length?t.map((function(e){return/[=|\W]/g.test(e)?e.replace(/\W/g,"").trim():e.trim()})):null},e.prototype.getAppInfo=function(){var e=this,t={name:"",packageName:"",versionNumber:"",versionCode:null};return this.appVersion.getPackageName().then((function(n){return t.packageName=n,e.appVersion.getAppName()})).then((function(n){return t.name=n,e.appVersion.getVersionNumber()})).then((function(n){return t.versionNumber=n,e.appVersion.getVersionCode()})).then((function(e){return t.versionCode=e,t}))},e.prototype.getCallbacksFor=function(e){return this.callbacks.map((function(t){return t[e]?t[e].bind(t):null}))},e.prototype.getMetaInfo=function(e){var t=cordova.file.applicationDirectory+W+"/";return this.deviceFileService.listFiles(t,e).then((function(e){return Promise.all(_.map(e,(function(e){return new Promise((function(n,i){$.getJSON(o.transformFileURI(t)+e.name,(function(e){return n(e)}))}))})))}))},e.prototype.isBundled=function(e,t){return this.getStore(e,t).then((function(e){return e.entitySchema.pullConfig.pullType===E.BUNDLED}))},e.prototype.loadDBSchemas=function(){var e=this;return this.getMetaInfo(/.+_dataModel\.json$/).then((function(t){var n=new Map;return(t=o.isArray(t)?t:[t]).push(q),t.map((function(t){return e.compactSchema(t)})).forEach((function(e){n[e.schema.name]=e})),n}))},e.prototype.loadNamedQueries=function(e){var t=this;return this.getMetaInfo(/.+_query\.json$/).then((function(n){return(n=_.isArray(n)?n:[n]).map((function(n){return e[n.name].queries=t.compactQueries(n)})),e}))},e.prototype.loadOfflineConfig=function(e){return this.getMetaInfo(/.+_offline\.json$/).then((function(t){return _.forEach(t,(function(t){_.forEach(t.entities,(function(n){var i=_.find(e[t.name].schema.entities,(function(e){return e.name===n.name}));_.assignIn(i,n)}))})),e}))},e.prototype.logSql=function(e){var t=this,n=console,i=e.executeSql;e.executeSql=function(o,r,a){var s=_.now();return i.call(e,o,r).then((function(e){if(a||t._logSql){for(var i=[],l=e.rows.length,c=0;c<l;c++)i.push(e.rows.item(c));n.debug('SQL "%s" with params %O took [%d ms]. And the result is %O',o,r,_.now()-s,i)}return e}),(function(e){return n.error('SQL "%s" with params %O failed with error message %s',o,r,e.message),Promise.reject(e)}))}},e.prototype.normalizeBooleanData=function(e,t,n){var i=this,o="update "+C(t)+" set "+C(n)+" = 1 where "+C(n)+" = 'true'",r="update "+C(t)+" set "+C(n)+" = 0\n where "+C(n)+" is not null and "+C(n)+" != 1";return this.executeSQLQuery(e,o).then((function(){return i.executeSQLQuery(e,r)}))},e.prototype.normalizeData=function(){var e=this;return Promise.all(_.map(this.databases,(function(t){return Promise.all(_.map(t.schema.entities,(function(n){return Promise.all(_.map(n.columns,(function(i){if("boolean"===i.sqlType)return e.normalizeBooleanData(t.schema.name,n.name,i.name)})))})))})))},e.prototype.openDatabase=function(e){var t=this;return this.sqlite.create({name:e.schema.name+".db",location:"default"}).then((function(n){e.sqliteObject=n,t.logSql(n);var i=_.map(e.schema.entities,(function(e){return new B(t.deviceFileService,e,t.file,t,n).create()}));return Promise.all(i).then((function(t){return _.forEach(t,(function(t){e.stores[t.entitySchema.entityName]=t})),e}))}))},e.prototype.setUpDatabases=function(){var e=this;return this.deviceService.getAppBuildTime().then((function(t){var n=e.deviceService.getEntry("database")||{};return(!n.lastBuildTime||n.lastBuildTime!==t)&&e.cleanAndCopyDatabases().then((function(){return n.lastBuildTime=t,e.deviceService.storeEntry("database",n)})).then((function(){return!0}))}))},e}();z.SERVICE_NAME="LocalDBManagementService",z.\u0275prov=g.\u0275\u0275defineInjectable({factory:function(){return new z(g.\u0275\u0275inject(w.AppVersion),g.\u0275\u0275inject(y.DeviceService),g.\u0275\u0275inject(y.DeviceFileService),g.\u0275\u0275inject(P.File),g.\u0275\u0275inject(S),g.\u0275\u0275inject(b.SecurityService),g.\u0275\u0275inject(O.SQLite))},token:z,providedIn:"root"}),z.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],z.ctorParameters=function(){return[{type:s.AppVersion},{type:r.DeviceService},{type:r.DeviceFileService},{type:i.File},{type:S},{type:a.SecurityService},{type:l.SQLite}]};var H=function(){},Y="changeLogService.flushContext",K="changeLogService.lastPushInfo",Q=function(){function e(e,t,n,i){this.localDBManagementService=e,this.localKeyValueService=t,this.pushService=n,this.networkService=i,this.workers=[],this.currentPushInfo={},this.addWorker(new X(this,this.localKeyValueService,this.currentPushInfo))}return e.prototype.add=function(e,t,n){var i=this,r={service:e,operation:t,params:n,hasError:0};return o.executePromiseChain(this.getWorkers("transformParamsToMap"),[r]).then((function(){return o.executePromiseChain(i.getWorkers("onAddCall"),[r])})).then((function(){return r.params=JSON.stringify(r.params),i.getStore().then((function(e){return e.add(r)})).then(o.noop)}))},e.prototype.addWorker=function(e){this.workers.push(e)},e.prototype.clearLog=function(){return this.getStore().then((function(e){return e.clear()}))},e.prototype.flush=function(e){var t,n=this;return this.deferredFlush||(this.deferredFlush=o.getAbortableDefer(),this.createContext().then((function(e){return n.flushContext=e,o.executePromiseChain(n.getWorkers("preFlush"),[n.flushContext])})).then((function(){return t=n._flush(e),n.deferredFlush.onAbort=function(){return t.abort()},t})).catch(o.noop).then((function(){Promise.resolve().then((function(){if(n.currentPushInfo.totalTaskCount===n.currentPushInfo.completedTaskCount)return n.flushContext.clear().then((function(){return n.flushContext=null}))})).then((function(){e.complete(),n.currentPushInfo.failedTaskCount>0?n.deferredFlush.reject(n.currentPushInfo):n.deferredFlush.resolve(n.currentPushInfo),n.deferredFlush=null})).then((function(){return o.executePromiseChain(n.getWorkers("postFlush"),[n.currentPushInfo,n.flushContext])}))}))),this.deferredFlush.promise},e.prototype.getChanges=function(){return this.getStore().then((function(e){return e.filter(void 0,"id",{offset:0,limit:500})})).then((function(e){return e.forEach((function(e){e.params=JSON.parse(e.params)})),e}))},e.prototype.getErrors=function(){return this.getStore().then((function(e){return e.filter([{attributeName:"hasError",attributeValue:1,attributeType:"NUMBER",filterCondition:"EQUALS"}])}))},e.prototype.getLastPushInfo=function(){return this.localKeyValueService.get(K).then((function(e){return o.isString(e.startTime)&&(e.startTime=new Date(e.startTime)),o.isString(e.endTime)&&(e.endTime=new Date(e.endTime)),e}))},e.prototype.getLogLength=function(){return this.getStore().then((function(e){return e.count([{attributeName:"hasError",attributeValue:0,attributeType:"NUMBER",filterCondition:"EQUALS"}])}))},e.prototype.getStore=function(){return this.localDBManagementService.getStore("wavemaker","offlineChangeLog")},e.prototype.isFlushInProgress=function(){return!(_.isUndefined(this.deferredFlush)||_.isNull(this.deferredFlush))},e.prototype.stop=function(){var e=this;return new Promise((function(t){e.deferredFlush?(e.deferredFlush.promise.catch().then(t),e.deferredFlush.promise.abort()):t()}))},e.prototype.createContext=function(){var e=this;return this.localKeyValueService.get(Y).then((function(t){return t=t||{},{clear:function(){return t={},e.localKeyValueService.remove(Y)},get:function(e){var n=t[e];return n||(n={},t[e]=n),n},save:function(){return e.localKeyValueService.put(Y,t)}}}))},e.prototype._flush=function(e,t){var n=this;return(t=t||o.getAbortableDefer()).isAborted?Promise.resolve():(this.getNextChange().then((function(e){if(e)return e.params=JSON.parse(e.params),n.flushChange(e)})).then((function(i){if(e.next(n.currentPushInfo),i)return n.getStore().then((function(e){return e.delete(i.id)})).then((function(){return n._flush(e,t)}));t.resolve()}),(function(i){if(n.networkService.isConnected())i.hasError=1,i.params=JSON.stringify(i.params),n.getStore().then((function(e){return e.save(i)})).then((function(){return n._flush(e,t)}));else{var o=n.networkService.onConnect();t.promise.catch((function(){o&&o.abort()})),o.then((function(){n._flush(e,t),o=null}))}})),t.promise)},e.prototype.flushChange=function(e){var t=this,n=this;return o.executePromiseChain(this.getWorkers("preCall"),[e]).then((function(){return e.hasError?Promise.reject(e.errorMessage):""})).then((function(){return o.executePromiseChain(t.getWorkers("transformParamsFromMap"),[e])})).then((function(){return t.pushService.push(e)})).then((function(){return o.executePromiseChain(_.reverse(n.getWorkers("postCallSuccess")),[e,arguments]).then((function(){return e}))})).catch((function(){return n.networkService.isConnected()?o.executePromiseChain(_.reverse(n.getWorkers("postCallError")),[e,arguments]).catch(o.noop).then((function(){return Promise.reject(e)})):Promise.reject(e)}))},e.prototype.getNextChange=function(){var e=[{attributeName:"hasError",attributeValue:0,attributeType:"NUMBER",filterCondition:"EQUALS"}];return this.getStore().then((function(t){return t.filter(e,"id",{offset:0,limit:1})})).then((function(e){return e&&e[0]}))},e.prototype.getWorkers=function(e){return _.map(this.workers,(function(t){return t[e]&&t[e].bind(t)}))},e}();Q.SERVICE_NAME="ChangeLogService",Q.\u0275prov=g.\u0275\u0275defineInjectable({factory:function(){return new Q(g.\u0275\u0275inject(z),g.\u0275\u0275inject(S),g.\u0275\u0275inject(H),g.\u0275\u0275inject(y.NetworkService))},token:Q,providedIn:"root"}),Q.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],Q.ctorParameters=function(){return[{type:z},{type:S},{type:H},{type:r.NetworkService}]};var X=function(){function e(e,t,n){this.changeLogService=e,this.localKeyValueService=t,this.pushInfo=n,this.logger=window.console}return e.prototype.onAddCall=function(e){this.logger.debug("Added the following call %o to log.",e)},e.prototype.preFlush=function(e){var t=this;return this.pushInfo.totalTaskCount=0,this.pushInfo.successfulTaskCount=0,this.pushInfo.failedTaskCount=0,this.pushInfo.completedTaskCount=0,this.pushInfo.inProgress=!0,this.pushInfo.startTime=new Date,this.flushContext=e,this.logger.debug("Starting flush"),this.changeLogService.getStore().then((function(e){return e.count([{attributeName:"hasError",attributeValue:0,attributeType:"NUMBER",filterCondition:"EQUALS"}])})).then((function(e){return t.pushInfo.totalTaskCount=e}))},e.prototype.postFlush=function(e,t){this.logger.debug("flush completed. {Success : %i , Error : %i , completed : %i, total : %i }.",this.pushInfo.successfulTaskCount,this.pushInfo.failedTaskCount,this.pushInfo.completedTaskCount,this.pushInfo.totalTaskCount),this.pushInfo.inProgress=!1,this.pushInfo.endTime=new Date,this.localKeyValueService.put(K,this.pushInfo),this.flushContext=null},e.prototype.preCall=function(e){this.logger.debug("%i. Invoking call %o",1+this.pushInfo.completedTaskCount,e)},e.prototype.postCallError=function(e,t){return this.pushInfo.completedTaskCount++,this.pushInfo.failedTaskCount++,this.logger.error("call failed with the response %o.",t),this.flushContext.save()},e.prototype.postCallSuccess=function(e,t){return this.pushInfo.completedTaskCount++,this.pushInfo.successfulTaskCount++,this.logger.debug("call returned the following response %o.",t),this.flushContext.save()},e}(),J=function(){function e(e){this.localDBManagementService=e,this.searchTableData=this.readTableData.bind(this),this.searchTableDataWithQuery=this.readTableData.bind(this),this.getDistinctDataByFields=this.readTableData.bind(this)}return e.prototype.getStore=function(e){return this.localDBManagementService.getStore(e.dataModelName,e.entityName)},e.prototype.insertTableData=function(e,t,n,i){void 0===i&&(i={}),this.getStore(e).then((function(n){var o=n.primaryKeyField&&"identity"===n.primaryKeyField.generatorType;return!1!==_.get(i,"resetPrimaryKey")&&o&&e.data[n.primaryKeyName]&&delete e.data[n.primaryKeyName],n.add(e.data).then((function(){n.refresh(e.data).then(t)}))})).catch(n)},e.prototype.insertMultiPartTableData=function(e,t,n,i){var o=this;void 0===i&&(i={}),this.getStore(e).then((function(r){r.serialize(e.data).then((function(r){e.data=r,o.insertTableData(e,t,n,i)}))})).catch(n)},e.prototype.updateTableData=function(e,t,n){this.getStore(e).then((function(n){return n.save(e.data).then((function(){n.refresh(e.data).then(t)}))})).catch(n)},e.prototype.updateMultiPartTableData=function(e,t,n){var i=e.data&&e.data.rowData||e.data;this.getStore(e).then((function(e){return e.save(i)})).then((function(){t&&t(i)})).catch(n)},e.prototype.deleteTableData=function(e,t,n){this.getStore(e).then((function(n){var i=n.primaryKeyField,o=e[i.fieldName]||e[i.name]||e.data&&e.data[i.fieldName]||e.id;n.delete(o).then(t)})).catch(n)},e.prototype.readTableData=function(e,t,n){var i=this;this.getStore(e).then((function(n){var o=e.filter((function(e,t){i.convertFieldNameToColumnName(n,e,t)}),!0);return o=o.replace(/wm_bool\('true'\)/g,1).replace(/wm_bool\('false'\)/g,0),n.count(o).then((function(i){var r=e.sort.split("=")[1];return n.filter(o,r,{offset:(e.page-1)*e.size,limit:e.size}).then((function(n){var o=Math.ceil(i/e.size);t({content:n,first:1===e.page,last:e.page===o,number:e.page-1,numberOfElements:n.length,size:e.size,sort:{sorted:!!r,unsorted:!r},totalElements:i,totalPages:o})}))}))})).catch(n)},e.prototype.escapeName=function(e){return e?'"'+(e=e.replace(/"/g,'""')).replace(/\./g,'"."')+'"':e},e.prototype.getColumnName=function(e,t){if(e.fieldToColumnMapping[t]){var n=this.escapeName(e.fieldToColumnMapping[t]);return n.indexOf(".")<0?this.escapeName(e.entitySchema.name)+"."+n:n}return t},e.prototype.convertFieldNameToColumnName=function(e,t,n){var i=this;_.forEach(t.rules,(function(t){t.rules?i.convertFieldNameToColumnName(e,t):t.target=i.getColumnName(e,t.target)})),n&&n.filterFields&&(n.filterFields=_.mapKeys(n.filterFields,(function(t,n){return i.getColumnName(e,n)})))},e}();J.SERVICE_NAME="LocalDbService",J.\u0275prov=g.\u0275\u0275defineInjectable({factory:function(){return new J(g.\u0275\u0275inject(z))},token:J,providedIn:"root"}),J.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],J.ctorParameters=function(){return[{type:z}]};var Z=function(){function e(){this.logger=window.console}return e.prototype.preFlush=function(e){this.fileStore=e.get("offlineFileUpload")},e.prototype.preCall=function(e){var t=this;"DatabaseService"===e.service&&(e.params.data=_.mapValues(e.params.data,(function(e){var n=t.fileStore[e];return n?(t.logger.debug("swapped file path from %s -> %s",e,n),n):e})))},e.prototype.postCallSuccess=function(e,t){if("OfflineFileUploadService"===e.service&&"uploadToServer"===e.operation){var n=JSON.parse(t[0].text)[0];this.fileStore[e.params.file]=n.path,this.fileStore[e.params.file+"?inline"]=n.inlinePath}},e}(),ee=function(){function e(e,t,n,i){this.changeLogService=e,this.deviceFileService=t,this.localDBManagementService=n,this.file=i}return e.prototype.preExport=function(e,t){var n=this.deviceFileService.getUploadDirectory(),i=n.lastIndexOf("/"),o=n.substring(0,i+1),r=n.substring(i+1);return t.uploadDir=n,this.file.copyDir(o,r,e,"uploads")},e.prototype.postImport=function(e,t){var n=this,i=this.deviceFileService.getUploadDirectory(),r=i.lastIndexOf("/"),a=i.substring(0,r+1),s=i.substring(r+1);return this.uploadDir=i,this.file.checkDir(e,"uploads").then((function(){return n.deviceFileService.removeDir(i).then((function(){return n.file.copyDir(e,"uploads",a,s)})).then((function(){return n.updateChanges(t)}))}),o.noop)},e.prototype.getChanges=function(e,t){return this.changeLogService.getStore().then((function(n){return n.filter([],"id",{offset:(e-1)*t,limit:t})}))},e.prototype.updateDBChange=function(e,t,n){var i=this,o={},r=e.params.entityName,a=e.params.dataModelName;e.params.data=_.mapValues(e.params.data,(function(e,i){var r=e,a=!1;return _.isString(e)?(r=_.replace(e,t,n),a=!_.isEqual(r,e)):_.isObject(e)&&e.wmLocalPath&&(r=_.replace(e.wmLocalPath,t,n),a=!_.isEqual(r,e.wmLocalPath)),a&&(o[i]=r),r})),_.isEmpty(o)||this.localDBManagementService.getStore(a,r).then((function(t){if(t.primaryKeyField&&"identity"===t.primaryKeyField.generatorType){var n=t.primaryKeyName,i=e.params.data[n];return t.get(i).then((function(e){return t.save(_.assignIn(e,o))}))}})).then((function(){return e.params=JSON.stringify(e.params),i.changeLogService.getStore().then((function(t){return t.save(e)}))}))},e.prototype.updateChange=function(e,t){return e.params=JSON.parse(e.params),"OfflineFileUploadService"===e.service&&"uploadToServer"===e.operation?(e.params.file=_.replace(e.params.file,t.uploadDir,this.uploadDir),e.params=JSON.stringify(e.params),this.changeLogService.getStore().then((function(t){return t.save(e)}))):"DatabaseService"===e.service?this.updateDBChange(e,t.uploadDir,this.uploadDir):void 0},e.prototype.updateChanges=function(e,t){var n=this;void 0===t&&(t=1);return this.getChanges(t,10).then((function(t){if(t&&t.length>0)return Promise.all(t.map((function(t){return n.updateChange(t,e)})))})).then((function(i){if(i&&10===i.length)return n.updateChanges(e,t+1)}))},e}(),te=function(){function e(e){this.localDBManagementService=e}return e.prototype.preFlush=function(e){this.errorStore=e.get("errorBlockerStore")},e.prototype.preCall=function(e){var t=this;if(e&&"DatabaseService"===e.service){var n=e.params.entityName,i=e.params.dataModelName;switch(e.operation){case"insertTableData":case"insertMultiPartTableData":case"updateTableData":case"updateMultiPartTableData":return this.localDBManagementService.getStore(i,n).then((function(o){t.blockCall(o,e,i,n,e.params.data)}));case"deleteTableData":return this.localDBManagementService.getStore(i,n).then((function(o){t.blockCall(o,e,i,n,e.params)}))}}},e.prototype.postCallSuccess=function(e){var t=this;if(e&&"DatabaseService"===e.service){var n=e.params.entityName,i=e.params.dataModelName;return this.localDBManagementService.getStore(i,n).then((function(o){var r=e.dataLocalId||e.params.data[o.primaryKeyName];_.isUndefined(r)||_.isNull(r)||t.removeError(i,n,r)}))}},e.prototype.postCallError=function(e){var t=this;if(e&&"DatabaseService"===e.service){var n=e.params.entityName,i=e.params.dataModelName;return this.localDBManagementService.getStore(i,n).then((function(o){var r=e.dataLocalId||e.params.data&&e.params.data[o.primaryKeyName]||e.params[o.primaryKeyName]||e.params.id;_.isUndefined(r)||_.isNull(r)||t.recordError(i,n,r)}))}},e.prototype.blockCall=function(e,t,n,i,o){var r=this;0===t.hasError&&(this.checkForPreviousError(e,t,n,i,o),e.entitySchema.columns.forEach((function(i){i.foreignRelations&&i.foreignRelations.some((function(a){return o[a.sourceFieldName]?r.blockCall(e,t,n,a.targetEntity,o[a.sourceFieldName]):o[i.fieldName]&&r.checkForPreviousError(e,t,n,a.targetEntity,o,i.fieldName),1===t.hasError}))})))},e.prototype.checkForPreviousError=function(e,t,n,i,o,r){var a=r||e.primaryKeyName;this.hasError(n,i,o[a])&&(t.hasError=1,t.errorMessage="Blocked call due to error in previous call of entity [ "+i+" ] with id [ "+o[a]+" ]")},e.prototype.hasError=function(e,t,n){return!!(this.errorStore[e]&&this.errorStore[e][t]&&this.errorStore[e][t][n])},e.prototype.removeError=function(e,t,n){this.errorStore[e]&&this.errorStore[e][t]&&this.errorStore[e][t][n]&&delete this.errorStore[e][t][n]},e.prototype.recordError=function(e,t,n){this.errorStore[e]=this.errorStore[e]||{},this.errorStore[e][t]=this.errorStore[e][t]||{},this.errorStore[e][t][n]=!0},e}(),ne=function(){function e(e){this.localDBManagementService=e,this.logger=window.console}return e.prototype.preFlush=function(e){this.idStore=e.get("idConflictResolution")},e.prototype.preCall=function(e){var t=this;if(e&&"DatabaseService"===e.service){var n=e.params.entityName,i=e.params.dataModelName;switch(e.operation){case"insertTableData":case"insertMultiPartTableData":return e.params.skipLocalDB=!0,this.localDBManagementService.getStore(i,n).then((function(r){var a=r.primaryKeyName;return a&&(t.transactionLocalId=e.params.data[a],e.dataLocalId=t.transactionLocalId),t.exchangeIds(r,i,n,e.params.data).then((function(){if(r.primaryKeyField&&"identity"===r.primaryKeyField.generatorType)delete e.params.data[a];else{var s=r.getValue(e.params.data,r.primaryKeyName);o.isDefined(s)&&(e.params.data[a]=s,null!==t.transactionLocalId&&t.pushIdToStore(i,n,t.transactionLocalId,s)),t.transactionLocalId=null}}))}));case"updateTableData":case"updateMultiPartTableData":case"deleteTableData":return this.localDBManagementService.getStore(i,n).then((function(o){if(t.exchangeId(o,i,n,e.params,"id"),e.params.data)return t.exchangeIds(o,i,n,e.params.data)}))}}},e.prototype.postCallSuccess=function(e,t){var n=this;if(e&&"DatabaseService"===e.service&&("insertTableData"===e.operation||"insertMultiPartTableData"===e.operation)&&this.transactionLocalId){var i=t[0].body,r=e.params.entityName,a=e.params.dataModelName;return this.localDBManagementService.getStore(a,r).then((function(e){return n.pushIdToStore(a,r,n.transactionLocalId,i[e.primaryKeyName]),e.delete(n.transactionLocalId).catch(o.noop).then((function(){return n.transactionLocalId=null,e.save(i)}))}))}},e.prototype.postCallError=function(e){var t=this;if(e&&"DatabaseService"===e.service&&("insertTableData"===e.operation||"insertMultiPartTableData"===e.operation)&&this.transactionLocalId){var n=e.params.entityName,i=e.params.dataModelName;return this.localDBManagementService.getStore(i,n).then((function(n){e.params.data[n.primaryKeyName]=t.transactionLocalId}))}},e.prototype.getEntityIdStore=function(e,t){return this.idStore[e]=this.idStore[e]||{},this.idStore[e][t]=this.idStore[e][t]||{},this.idStore[e][t]},e.prototype.pushIdToStore=function(e,t,n,i){n!==i&&(this.getEntityIdStore(e,t)[n]=i,this.logger.debug("Conflict found for entity (%s) with local id (%i) and remote Id (%i)",t,n,i))},e.prototype.logResolution=function(e,t,n){this.logger.debug("Conflict resolved found for entity (%s) with local id (%i) and remote Id (%i)",e,t,n)},e.prototype.exchangeId=function(e,t,n,i,o){var r=o||e.primaryKeyName,a=this.getEntityIdStore(t,n);if(i&&r){for(var s=i[r],l=s;a[l];)l=a[l];l!==s&&(i[r]=l,this.logResolution(n,s,l))}},e.prototype.exchangeIds=function(e,t,n,i){var o=this;this.exchangeId(e,t,n,i);var r=[];return e.entitySchema.columns.forEach((function(n){n.foreignRelations&&n.foreignRelations.forEach((function(a){i[n.fieldName]&&o.exchangeId(e,t,a.targetEntity,i,n.fieldName),i[a.sourceFieldName]&&r.push(o.localDBManagementService.getStore(t,a.targetEntity).then((function(e){return o.exchangeIds(e,t,a.targetEntity,i[a.sourceFieldName])})))}))})),Promise.all(r)},e}();ne.decorators=[{type:t.Injectable}],ne.ctorParameters=function(){return[{type:z}]};var ie=function(){function e(e,t){this.deviceFileService=e,this.localDBManagementService=t}return e.prototype.postCallSuccess=function(e){var t=this;if(e&&"DatabaseService"===e.service)switch(e.operation){case"insertMultiPartTableData":case"updateMultiPartTableData":_.forEach(e.params.data,(function(e){_.isObject(e)&&e.wmLocalPath&&t.deviceFileService.removeFile(e.wmLocalPath)}))}},e.prototype.transformParamsFromMap=function(e){if(e&&"DatabaseService"===e.service)switch(e.operation){case"insertMultiPartTableData":case"updateMultiPartTableData":return this.localDBManagementService.getStore(e.params.dataModelName,e.params.entityName).then((function(t){return t.deserialize(e.params.data).then((function(t){e.params.data=t}))}))}},e.prototype.transformParamsToMap=function(e){if(e&&"DatabaseService"===e.service)switch(e.operation){case"insertMultiPartTableData":case"updateMultiPartTableData":return this.localDBManagementService.getStore(e.params.dataModelName,e.params.entityName).then((function(t){return t.serialize(e.params.data).then((function(n){return e.params.data=n,t.save(_.mapValues(n,(function(e){return _.isObject(e)&&e.wmLocalPath||e}))),n}))}))}},e}(),oe=[{name:"insertTableData",type:"INSERT"},{name:"insertMultiPartTableData",type:"INSERT"},{name:"updateTableData",type:"UPDATE"},{name:"updateMultiPartTableData",type:"UPDATE"},{name:"deleteTableData",type:"DELETE"},{name:"readTableData",type:"READ",saveResponse:!0},{name:"searchTableData",type:"READ",saveResponse:!0},{name:"searchTableDataWithQuery",type:"READ",saveResponse:!0},{name:"getDistinctDataByFields",type:"READ",saveResponse:!1}],re=!1,ae=function(){function e(e,t,n,i,o){this.changeLogService=e,this.httpService=t,this.localDBManagementService=n,this.networkService=i,this.offlineDBService=o,this.onlineDBService=m.LVService}return e.prototype.add=function(){var e=this;if(!re){re=!0;var t=this.httpService.sendCallAsObservable;t&&(this.httpService.sendCallAsObservable=function(n,i){!i&&_.get(n,"url")&&(i={url:n.url});var o=_.clone(i.url);i=_.extend(i,n);var r=_.find(oe,{name:_.get(i,"operation")});return e.networkService.isConnected()||i.onlyOnline||!r||!i.dataModelName?h.from(e.remoteDBcall(r,t,i)):h.from(e.localDBManagementService.isOperationAllowed(i.dataModelName,i.entityName,r.type).then((function(n){var a;return n?Promise.resolve().then((function(){if(!i.isCascadingStopped&&("insertTableData"===r.name||"updateTableData"===r.name))return e.prepareToCascade(i).then((function(e){return a=e}))})).then((function(){return new Promise((function(t,n){e.localDBcall(r,i,t,n,o)}))})).then((function(t){return a?a.cascade().then((function(){return e.getStore(i).then((function(e){return e.refresh(t.body)})).then((function(e){return t&&t.body&&(t.body=e),t}))})):t})):e.remoteDBcall(r,t,i)})))})}},e.prototype.getStore=function(e){return this.localDBManagementService.getStore(e.dataModelName,e.entityName)},e.prototype.hasBlob=function(e){return!!_.filter(e.entitySchema.columns,{sqlType:"blob"}).length},e.prototype.localDBcall=function(e,t,n,i,r){var a=this;return new Promise((function(n,i){a.offlineDBService[e.name](t,(function(i){if("READ"!==e.type)return t.onlyOnline=!0,t.url=r,a.changeLogService.add("DatabaseService",e.name,t).then((function(){return n(i)}));n(i)}))})).then((function(e){return e={body:e,type:T},o.triggerFn(n,e),e}),i)},e.prototype.remoteDBcall=function(e,t,n){var i=this;return new Promise((function(r,a){t.call(i.httpService,n).subscribe((function(t){t&&t.type&&(n.skipLocalDB||i.offlineDBService.getStore(n).then((function(r){"READ"===e.type&&e.saveResponse?r.saveAll(t.body.content):"INSERT"===e.type?((n=_.clone(n)).data=_.clone(t.body),i.offlineDBService[e.name](n,o.noop,o.noop,{resetPrimaryKey:!1})):i.offlineDBService[e.name](n,o.noop,o.noop)})).catch(o.noop),r(t))}),(function(e){a(e)}))}))},e.prototype.prepareToCascade=function(e){var t=this;return this.getStore(e).then((function(n){var i=[];return _.forEach(e.data,(function(o,r){var a,s,l;if(_.isObject(o)&&!_.isArray(o)&&(a=n.entitySchema.columns.find((function(e){return e.primaryKey&&e.foreignRelations&&(s=e.foreignRelations.find((function(e){return e.sourceFieldName===r}))),!!s}))),a){(l=_.cloneDeep(e)).entityName=s.targetEntity,l.data=o;var c=t.getStore(l).then((function(i){var o=e.data,a=i.entitySchema.columns.find((function(e){return e.name===s.targetColumn}));if(a&&a.foreignRelations){var c=a.foreignRelations.find((function(e){return e.targetTable===n.entitySchema.name})).sourceFieldName;l.data[c]=o}return o[r]=null,l.onlyOnline=!1,l.isCascadingStopped=!0,l.hasBlob=t.hasBlob(i),l.url="",function(){return Promise.resolve().then((function(){var e=i.getValue(l.data,i.primaryKeyField.fieldName);return e?i.get(e):null})).then((function(e){var n;return n=e?l.hasBlob?"updateMultiPartTableData":"updateTableData":l.hasBlob?"insertMultiPartTableData":"insertTableData",t.onlineDBService[n](l).toPromise()}))}}));i.push(c)}})),Promise.all(i).then((function(e){return{cascade:function(){return Promise.all(e.map((function(e){return e()})))}}}))}))},e}(),se=!1,le=function(){function e(e,t,n,i,o,r){this.changeLogService=e,this.deviceFileService=t,this.deviceFileUploadService=n,this.file=i,this.networkService=o,this.uploadDir=r}return e.prototype.add=function(){var e=this;if(!se){se=!0;var t=this.deviceFileUploadService.upload;this.deviceFileUploadService.uploadToServer=t,this.deviceFileUploadService.upload=function(n,i,o,r,a,s){return e.networkService.isConnected()?t.call(e.deviceFileUploadService,n,i,o,r,a,s):e.uploadLater(n,i,o,r,a,s).then((function(e){return{text:JSON.stringify(e),headers:null,response:e}}))}}},e.prototype.uploadLater=function(e,t,n,i,o,r){var a=this,s=n.lastIndexOf("/"),l=n.substring(0,s),c=n.substring(s+1),p=this.deviceFileService.appendToFileName(c),u=this.uploadDir+"/"+p;return this.file.copyFile(l,c,this.uploadDir,p).then((function(){return a.changeLogService.add("OfflineFileUploadService","uploadToServer",{file:u,ftOptions:{fileKey:t,fileName:i},params:o,headers:r,serverUrl:e,deleteOnUpload:!0})})).then((function(){return[{fileName:c,path:u,length:0,success:!0,inlinePath:u+"?inline"}]}))},e}(),ce=/^\d+(\.\d+)?$/,pe=!1,ue=function(){function e(e,t,n,i){this.changeLogService=e,this.httpService=t,this.localDBManagementService=n,this.networkService=i}return e.prototype.add=function(){var e=this;if(!pe){pe=!0;var t=this.httpService.sendCallAsObservable;this.httpService.sendCallAsObservable=function(n,i){return!i&&_.get(n,"url")&&(i={url:n.url}),!e.networkService.isConnected()&&i.url.indexOf("/queryExecutor/")>0?h.from(e.executeLocally(i)):t.call(e.httpService,n,i)}}},e.prototype.executeLocally=function(e){var t=this,n=e.url,i=n.indexOf("?")>0,o=this.substring(n,"services/","/queryExecutor"),r=this.substring(n,"queries/",i?"?":void 0),a=i?this.getHttpParamMap(this.substring(n,"?",void 0)):{},s=this.getHttpParamMap(e.dataParams),l=_.extend(a,s);return this.localDBManagementService.executeNamedQuery(o,r,l).then((function(n){var i=n.rows;return n.rowsAffected?t.changeLogService.add("WebService","invokeJavaService",e).then((function(){return n.rowsAffected})):{type:T,body:{totalPages:i&&i.length>0?1:0,totalElements:i.length,first:!0,sort:null,numberOfElements:i.length,last:!0,size:e.size,number:0,content:i}}}))},e.prototype.substring=function(e,t,n){if(t){var i=e.indexOf(t)+t.length,o=n?e.indexOf(n):void 0;return e.substring(i,o)}},e.prototype.getHttpParamMap=function(e){var t={};return e&&(e=decodeURIComponent(e)).split("&").forEach((function(e){var n=e.split("=");_.isEmpty(_.trim(n[1]))||!ce.test(n[1])?t[n[0]]=n[1]:t[n[0]]=parseInt(n[1],10)})),t},e}(),de="logged-in-user.info",he=!1,me=function(){function e(e,t,n,i,o){var r=this;this.app=e,this.file=t,this.deviceService=n,this.networkService=i,this.securityService=o,this.saveSecurityConfigLocally=_.debounce((function(e){r._saveSecurityConfigLocally(e)}),1e3)}return e.prototype.add=function(){var e=this;if(!he){he=!0;var t=this.securityService.load,n=this.securityService.appLogout;this.securityService.load=function(n){return new Promise((function(i,o){e.networkService.isConnected()?t.call(e.securityService,n).then((function(t){e.securityConfig=t,e.saveSecurityConfigLocally(t),i(e.securityConfig)}),o):e.readLocalSecurityConfig().then((function(t){return void 0===t&&(t={}),e.securityConfig=t,e.securityService.config=t,t}),(function(){return t.call(e.securityConfig)})).then(i,o)}))},this.securityService.appLogout=function(t,i){e.securityConfig={authenticated:!1,loggedOut:!0,securityEnabled:e.securityConfig&&e.securityConfig.securityEnabled,loggedOutOffline:!e.networkService.isConnected(),loginConfig:e.securityConfig&&e.securityConfig.loginConfig,userInfo:null},e._saveSecurityConfigLocally(e.securityConfig).catch(o.noop).then((function(){e.networkService.isConnected()?n.call(e.securityService,t,i):location.assign(window.location.origin+window.location.pathname)}))},this.securityService.isAuthenticated=function(t){o.triggerFn(t,!0===e.securityConfig.authenticated)},this.deviceService.whenReady().then((function(){return e.clearLastLoggedInUser()})),this.app.subscribe("onNetworkStateChange",(function(t){t.isConnected&&e.clearLastLoggedInUser()}))}},e.prototype._saveSecurityConfigLocally=function(e){return this.file.writeFile(cordova.file.dataDirectory,de,JSON.stringify(e),{replace:!0})},e.prototype.clearLastLoggedInUser=function(){var e=this;return this.readLocalSecurityConfig().then((function(t){t&&t.loggedOutOffline?e.securityService.appLogout(null,null):e.networkService.isConnected()||(e.securityConfig=t||{})}))},e.prototype.readLocalSecurityConfig=function(){var e=this;return new Promise((function(t,n){var i=cordova.file.dataDirectory;e.file.checkFile(i,de).then((function(){return e.readFileAsTxt(i,de).then(t,n)}),(function(){var i=cordova.file.applicationDirectory+"www/metadata/app";return e.readFileAsTxt(i,"security-config.json").then(t,n)}))}))},e.prototype.readFileAsTxt=function(e,t){return this.file.readAsText(e,t).then(JSON.parse).catch(o.noop)},e}(),fe=function(){function e(t,n,i,r,a,s,l,c,p,u,d){o.hasCordova()&&e.initialize(t,n,i,r,a,s,l,c,p,u,d)}return e.initialize=function(e,t,n,i,r,a,s,l,c,p,u){this.initialized||(n.addStartUpService({getServiceName:function(){return"OfflineStartupService"},start:function(){return window.SQLitePlugin?(l.setLogSQl("true"===sessionStorage.getItem("wm.logSql")||"true"===sessionStorage.getItem("debugMode")),window.logSql=function(e){void 0===e&&(e=!0),l.setLogSQl(e),sessionStorage.setItem("wm.logSql",e?"true":"false")},window.executeLocalSql=function(e,t,n){l.executeSQLQuery(e,t,n,!0)},l.loadDatabases().then((function(){t.addWorker(new ne(l)),t.addWorker(new te(l)),t.addWorker(new Z),t.addWorker(new ie(i,l)),new ae(t,s,l,p,c).add(),new le(t,i,r,a,p,i.getUploadDirectory()).add(),new ue(t,s,l,p).add(),l.registerCallback(new ee(t,i,l,a)),t.addWorker({onAddCall:function(){p.isConnected()||p.disableAutoConnect()},postFlush:function(e){e.totalTaskCount>0&&l.close().catch(o.noop).then((function(){location.assign(window.location.origin+window.location.pathname)}))}})}))):Promise.resolve()}}),new me(e,a,n,p,u).add())},e}();fe.initialized=!1,fe.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],declarations:[],exports:[],providers:[],entryComponents:[]}]}],fe.ctorParameters=function(){return[{type:o.App},{type:Q},{type:r.DeviceService},{type:r.DeviceFileService},{type:r.DeviceFileUploadService},{type:i.File},{type:o.AbstractHttpService},{type:z},{type:J},{type:r.NetworkService},{type:a.SecurityService}]};var ge=function(){function e(e){this.deviceFileUploadService=e}return e.prototype.getPromiseFromObs=function(e){return new Promise((function(t,n){e.subscribe((function(e){e&&e.type&&t(e)}),n)}))},e.prototype.push=function(e){var t=e.params;switch(e.service){case"DatabaseService":switch(e.operation){case"insertTableData":return this.getPromiseFromObs(m.LVService.insertTableData(e.params,null,null));case"insertMultiPartTableData":return this.getPromiseFromObs(m.LVService.insertMultiPartTableData(e.params,null,null));case"updateTableData":return this.getPromiseFromObs(m.LVService.updateTableData(e.params,null,null));case"updateMultiPartTableData":return this.getPromiseFromObs(m.LVService.updateMultiPartTableData(e.params,null,null));case"deleteTableData":return this.getPromiseFromObs(m.LVService.deleteTableData(e.params,null,null))}case"OfflineFileUploadService":if("uploadToServer"===e.operation)return this.deviceFileUploadService.uploadToServer.call(this.deviceFileUploadService,t.serverUrl,t.ftOptions.fileKey,t.file,t.ftOptions.fileName,t.params,t.headers)}return Promise.reject(e.service+" service with operation "+e.operation+" is not supported for push.")},e}();ge.decorators=[{type:t.Injectable}],ge.ctorParameters=function(){return[{type:r.DeviceFileUploadService}]};var ve="localDBManager.lastPullInfo",ye=function(){var e={};return{start:function(e){e.$$pullProcessId="PULL_"+_.now()},add:function(t,n){var i=t.$$pullProcessId;e[i]||(e[i]=[]),e[i].push(n)},remove:function(t,n){var i=t.$$pullProcessId;_.remove(e[i],n),_.isEmpty(e[i])&&delete e[i]},abort:function(t){var n=t.$$pullProcessId;return e[n]&&(_.forEach(e[n],(function(e){e&&e.abort&&e.abort()})),delete e[n]),t.$$isMarkedToAbort=!0,t.catch((function(){return"cancelled"}))}}},be=ye(),we=function(){function e(e,t,n,i){var o=this;this.app=e,this.localDBManagementService=t,this.localKeyValueService=n,this.networkService=i,this.localDBManagementService.registerCallback({onDbCreate:function(e){o.localKeyValueService.put(ve,{databases:[],totalRecordsToPull:0,totalPulledRecordCount:0,startTime:new Date(0),endTime:new Date(e.dbSeedCreatedOn)})}})}return e.prototype.addDeltaCriteria=function(e,t,n){var i,o=this,r=e.schema.entities[t],a=r.pullConfig.deltaFieldName,s=_.find(r.columns,{fieldName:a})||{};return _.isEmpty(a)?Promise.resolve(n):this.localDBManagementService.isBundled(e.schema.name,t).then((function(e){return i=e})).then((function(){return o.getLastPullInfo()})).then((function(o){var r=o&&o.startTime&&o.startTime.getTime(),l=_.find(o&&o.databases,{name:e.schema.name}),c=_.find(l&&l.entities,{entityName:t})||{};return!r&&i&&(r=o&&o.endTime&&o.endTime.getTime(),c.query=n),c.query===n&&r>0&&(_.isEmpty(n)?n="":n+=" AND ","datetime"===s.sqlType?n+=a+" > '"+moment(r).utc().format("YYYY-MM-DDTHH:mm:ss")+"'":n+=a+" > "+r),n}),(function(){return Promise.resolve(n)}))},e.prototype.copyDataFromRemoteDBToLocalDB=function(e,t,n,i,r){var a,s=this,l=e.stores[t],c=e.schema.entities[t],p={entityName:t,totalRecordsToPull:0,pulledRecordCount:0},u=0,d=!1;return new Promise((function(h,m){s.prepareQuery(e,t).then((function(n){return p.query=n,s.addDeltaCriteria(e,t,n)})).then((function(e){return n&&p.query===e?l.clear().then((function(){return e})):e})).then((function(t){return a=_.isEmpty(t)?"":"q="+t,s.getTotalRecordsToPull(e,c,a,i)})).then((function(n){var m=c.pullConfig.size||100,f=Math.ceil(n/m);p.totalRecordsToPull=n;var g=c.pullConfig.orderBy;g=(_.isEmpty(g)?"":g+",")+l.primaryKeyName,r.next(p);var v={next:function(e){u++,e=_.slice(e,0,p.totalRecordsToPull-p.pulledRecordCount),l.saveAll(e).then((function(){p.pulledRecordCount+=e?e.length:0,r.next(p)})).catch(o.noop).then((function(){0===--u&&d&&h(p)}))},error:null,complete:null};return s._pullEntityData(e,t,a,g,f,m,1,i,void 0,v)})).then(null,m).catch(o.noop).then((function(){d=!0,0===u&&h(p)}))}))},e.prototype.evalIfBind=function(e){return _.startsWith(e,"bind:")?(e=e.replace(/\[\$\i\]/g,"[0]"),o.$parseExpr(e.replace("bind:",""))(this.app)):e},e.prototype.executeDatabaseCountQuery=function(e){return new Promise((function(t,n){m.LVService.countTableDataWithQuery(e,null,null).subscribe((function(e){return t(e.body)}),n)}))},e.prototype.executeDatabaseSearchQuery=function(e){return new Promise((function(t,n){return m.LVService.searchTableDataWithQuery(e,null,null).subscribe((function(e){return t(e&&e.body&&e.body.content)}),n)}))},e.prototype.getTotalRecordsToPull=function(e,t,n,i){var o=this,r={dataModelName:e.schema.name,entityName:t.entityName,queryParams:n};return this.retryIfNetworkFails((function(){return o.executeDatabaseCountQuery(r).then((function(e){var n=e,i=_.parseInt(t.pullConfig.maxNumberOfRecords);return _.isNaN(i)||i<=0||n<i?n:i}))}),i)},e.prototype.prepareQuery=function(e,t){var n,i=this,o=e.schema.entities[t];return this.localDBManagementService.isBundled(e.schema.name,t).then((function(e){var t=!1;if(e||_.isEmpty(o.pullConfig.query)){if(n=_.cloneDeep(o.pullConfig.filter),n=_.map(n,(function(e){return e.attributeValue=i.evalIfBind(e.attributeValue),t=t||_.isNil(e.attributeValue),e})),t)return Promise.reject("Null criteria values are present");n=_.sortBy(n,"attributeName"),n=m.LiveVariableUtils.getSearchQuery(n," AND ",!0)}else n=i.evalIfBind(o.pullConfig.query);return _.isNil(n)?Promise.resolve(null):Promise.resolve(encodeURIComponent(n))}))},e.prototype._pullDbData=function(e,t,n,i){var o=this,r=e.schema.name,a={name:e.schema.name,entities:[],totalRecordsToPull:0,pulledRecordCount:0,completedTaskCount:0,totalTaskCount:0},s=[];return _.forEach(e.schema.entities,(function(e){s.push(o.localDBManagementService.getStore(r,e.entityName))})),new Promise((function(r,l){Promise.all(s).then((function(s){var c=[];s.forEach((function(e){var t=e.entitySchema.pullConfig,n=t.pullType;(n===E.APP_START||n===E.BUNDLED&&t.deltaFieldName)&&c.push(e.entitySchema)}));var p=_.chain(c).map((function(r){var s={next:function(e){var t=_.findIndex(a.entities,{entityName:e.entityName});t>=0?a.entities[t]=e:a.entities.push(e),a.pulledRecordCount=_.reduce(a.entities,(function(e,t){return e+t.pulledRecordCount}),0),a.totalRecordsToPull=_.reduce(a.entities,(function(e,t){return e+t.totalRecordsToPull}),0),i.next(a)},error:null,complete:null};return o.copyDataFromRemoteDBToLocalDB(e,r.entityName,t,n,s).then((function(e){return a.completedTaskCount++,i.next(a),e}),null)})).value();a.totalTaskCount=p.length,i.next(a),Promise.all(p).then(r,l)}))}))},e.prototype._pullEntityData=function(e,t,n,i,r,a,s,l,c,p){var u=this,d=e.schema.name;if(c||(c=o.defer()),s>r)return c.resolve();var h={dataModelName:d,entityName:t,page:s,size:a,data:n,sort:i,onlyOnline:!0,skipLocalDB:!0};return this.retryIfNetworkFails((function(){return u.executeDatabaseSearchQuery(h)}),l).then((function(o){p.next(o),u._pullEntityData(e,t,n,i,r,a,s+1,l,c,p)}),c.reject),c.promise},e.prototype.retryIfNetworkFails=function(e,t){if(t.$$isMarkedToAbort)return Promise.reject("aborted");var n=this.networkService.retryIfNetworkFails(e);return be.add(t,n),n.catch(o.noop).then((function(){be.remove(t,n)})),n},e.prototype.cancel=function(e){return be.abort(e)},e.prototype.getDb=function(e){return this.localDBManagementService.loadDatabases().then((function(t){return _.find(t,{name:e})||Promise.reject("Local database ("+e+") not found")}))},e.prototype.getLastPullInfo=function(){return this.localKeyValueService.get(ve).then((function(e){return _.isString(e.startTime)&&(e.startTime=new Date(e.startTime)),_.isString(e.endTime)&&(e.endTime=new Date(e.endTime)),e}))},e.prototype.pullAllDbData=function(e,t){var n=this,i=o.getAbortableDefer(),r={completedTaskCount:0,totalTaskCount:0,inProgress:!0,databases:[],totalRecordsToPull:0,totalPulledRecordCount:0,startTime:new Date,endTime:new Date};return this.localDBManagementService.loadDatabases().then((function(o){var a=_.chain(o).filter((function(e){return!e.schema.isInternal})).map((function(o){be.start(i.promise);var a={next:function(e){var n=_.findIndex(r.databases,{name:e.name});n>=0?r.databases[n]=e:r.databases.push(e),r.totalTaskCount=_.reduce(r.databases,(function(e,t){return e+t.totalTaskCount}),0),r.completedTaskCount=_.reduce(r.databases,(function(e,t){return e+t.completedTaskCount}),0),r.totalPulledRecordCount=_.reduce(r.databases,(function(e,t){return e+t.pulledRecordCount}),0),r.totalRecordsToPull=_.reduce(r.databases,(function(e,t){return e+t.totalRecordsToPull}),0),t.next(r)},error:null,complete:null};return n._pullDbData(o,e,i.promise,a)})).value();return Promise.all(a)})).then((function(){r.endTime=new Date,r.inProgress=!1,n.localKeyValueService.put(ve,r),i.resolve(r)}),i.reject),i.promise},e.prototype.pullDbData=function(e,t,n){var i=this,r=o.getAbortableDefer();return this.getDb(e).then((function(e){return i._pullDbData(e,t,r.promise,n)})).then(r.resolve,r.reject),r.promise},e.prototype.pullEntityData=function(e,t,n,i){var r=this,a=o.getAbortableDefer();return this.getDb(e).then((function(e){return r.copyDataFromRemoteDBToLocalDB(e,t,n,a.promise,i)})).then(a.resolve,a.reject),a.promise},e}();we.SERVICE_NAME="LocalDBDataPullService",we.\u0275prov=g.\u0275\u0275defineInjectable({factory:function(){return new we(g.\u0275\u0275inject(v.App),g.\u0275\u0275inject(z),g.\u0275\u0275inject(S),g.\u0275\u0275inject(y.NetworkService))},token:we,providedIn:"root"}),we.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],we.ctorParameters=function(){return[{type:o.App},{type:z},{type:S},{type:r.NetworkService}]},e.CONTEXT_KEY=Y,e.ChangeLogService=Q,e.LAST_PUSH_INFO_KEY=K,e.LocalDBDataPullService=we,e.LocalDBManagementService=z,e.LocalDbService=J,e.OfflineModule=fe,e.PushService=H,e.PushServiceImpl=ge,e["\u02750"]=ye,e["\u0275a"]=S,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@awesome-cordova-plugins/app-version/ngx"),require("@awesome-cordova-plugins/barcode-scanner/ngx"),require("@awesome-cordova-plugins/calendar/ngx"),require("@awesome-cordova-plugins/camera/ngx"),require("@awesome-cordova-plugins/device/ngx"),require("@awesome-cordova-plugins/media-capture/ngx"),require("@awesome-cordova-plugins/geolocation/ngx"),require("@awesome-cordova-plugins/vibration/ngx"),require("@awesome-cordova-plugins/location-accuracy/ngx"),require("@awesome-cordova-plugins/diagnostic/ngx"),require("@wm/core"),require("@wm/mobile/core"),require("@wm/mobile/offline"),require("@wm/security"),require("@wm/variables"),require("@wm/mobile/components/basic")):"function"==typeof define&&define.amd?define("@wm/mobile/variables",["exports","@angular/core","@awesome-cordova-plugins/app-version/ngx","@awesome-cordova-plugins/barcode-scanner/ngx","@awesome-cordova-plugins/calendar/ngx","@awesome-cordova-plugins/camera/ngx","@awesome-cordova-plugins/device/ngx","@awesome-cordova-plugins/media-capture/ngx","@awesome-cordova-plugins/geolocation/ngx","@awesome-cordova-plugins/vibration/ngx","@awesome-cordova-plugins/location-accuracy/ngx","@awesome-cordova-plugins/diagnostic/ngx","@wm/core","@wm/mobile/core","@wm/mobile/offline","@wm/security","@wm/variables","@wm/mobile/components/basic"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.mobile=e.wm.mobile||{},e.wm.mobile.variables={}),e.ng.core,e.awesomeCordova.plugins,e.awesomeCordova.plugins,e.awesomeCordova.plugins,e.awesomeCordova.plugins,e.awesomeCordova.plugins,e.awesomeCordova.plugins,e.awesomeCordova.plugins,e.awesomeCordova.plugins,e.awesomeCordova.plugins,e.awesomeCordova.plugins,e.wm.core,e.wm.mobile.core,e.wm.mobile.offline,e.wm.security,e.wm.variables,e.wm.mobile.components.basic)}(this,(function(e,t,n,i,o,r,a,s,l,c,p,u,d,h,m,f,g,v){"use strict";
|
|
830
|
+
var p=function(e,t){return(p=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)};Object.create;function u(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function d(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o<r;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 h,m=function(){n.register("wm-media-list",new Map([["class",n.PROP_STRING],["dataset",n.PROP_ANY],["layout",Object.assign({value:"Single-row"},n.PROP_STRING)],["mediaurl",n.PROP_STRING],["name",n.PROP_STRING],["offline",Object.assign({value:!0},n.PROP_BOOLEAN)],["show",Object.assign({value:!0},n.PROP_BOOLEAN)],["thumbnailheight",Object.assign({value:"100pt"},n.PROP_STRING)],["thumbnailwidth",Object.assign({value:"100pt"},n.PROP_STRING)],["thumbnailurl",n.PROP_STRING]]))},f={widgetType:"wm-media-list",hostClass:"app-medialist"};!function(e){e.SINGLE_ROW="Single-row",e.MULTI_ROW="Multi-row"}(h||(h={}));var g=function(e){function t(t){var i=e.call(this,t,f)||this;return i.selectedMediaIndex=-1,n.styler(i.nativeElement,i,n.APPLY_STYLES_TYPE.SCROLLABLE_CONTAINER),i}return function(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}p(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.appendToBody=function(){var e=this;return this.$fullScreenEle||setTimeout((function(){e.$fullScreenEle=e.$element.find(">.app-media-fullscreen"),e.$fullScreenEle.appendTo("body")}),100),!0},t.prototype.onPropertyChange=function(t,n,o){"dataset"===t?this.onDataChange(n):"layout"===t?n===h.SINGLE_ROW?i.addClass(this.nativeElement,"singlerow"):i.removeClass(this.nativeElement,"singlerow"):e.prototype.onPropertyChange.call(this,t,n,o)},t.prototype.exitFullScreen=function(){this.selectedMediaIndex=-1,this.$fullScreenEle.appendTo(this.$element),this.$fullScreenEle=null,i.$appDigest()},t.prototype.getPicTitle=function(){return this.selectedMediaIndex+1+"/"+this.fieldDefs.length},t.prototype.showFullScreen=function(e){this.selectedMediaIndex=e,i.$appDigest()},t.prototype.showNext=function(){this.selectedMediaIndex<this.fieldDefs.length-1&&(this.selectedMediaIndex++,i.$appDigest())},t.prototype.getSrc=function(e){return e?this.fieldDefs[this.selectedMediaIndex][e]:""},t.prototype.showPrev=function(){this.selectedMediaIndex>0&&(this.selectedMediaIndex--,i.$appDigest())},t.prototype.onDataChange=function(e){e?(i.isObject(e)&&!i.isArray(e)&&(e=[e]),this.binddataset||i.isString(e)&&(e=e.split(",")),i.isArray(e)&&this.updateFieldDefs(e)):this.updateFieldDefs([])},t.prototype.updateFieldDefs=function(e){var t=this;this.fieldDefs=e,e.forEach((function(e){e.mediaUrlVal=n.getEvaluatedData(e,{field:t.mediaurl},t.viewParent),e.thumbnailUrlVal=n.getEvaluatedData(e,t.thumbnailurl,t.viewParent)})),this.fieldDefs=e},t.prototype.listTrackByFn=function(e){return e},t}(n.StylableComponent);g.initializeProps=m(),g.decorators=[{type:t.Component,args:[{selector:"[wmMediaList]",template:'<ul class="list-unstyled list-inline app-media-thumbnail">\n <li *ngFor="let item of fieldDefs; index as index;" [ngStyle]="{width: thumbnailwidth, height: thumbnailheight}" (click)="showFullScreen(index)">\n <div class="thumbnail">\n <ng-container [ngTemplateOutlet]="imgTemplate"\n [ngTemplateOutletContext]="{src: item.thumbnailUrlVal, class: \'thumbnail-image\'}">\n </ng-container>\n <div class="thumbnail-details">\n <ng-container [ngTemplateOutlet]="mediaListTemplate" [ngTemplateOutletContext]="{item:item, index:index}" [wmMediaListItem]="item">\n </ng-container>\n </div>\n </div>\n </li>\n</ul>\n<div class="app-media-fullscreen" *ngIf="selectedMediaIndex >= 0 && appendToBody()">\n <header wmMobileNavbar\n backbutton="true"\n backbtnclick.event="exitFullScreen()"\n showLeftnavbtn="false"\n backbuttoniconclass.event="wi wi-chevron-left"\n title.bind="getPicTitle()">\n </header>\n <div wmContent>\n <div wmPageContent>\n <div class="media-content">\n <div class="image-container" (swipeleft)="showNext()" (swiperight)="showPrev()">\n <ng-container [ngTemplateOutlet]="imgTemplate"\n [ngTemplateOutletContext]="{field: \'mediaUrlVal\', class: \'center-block\'}">\n </ng-container>\n <a class="app-media-fullscreen-nav-control left" [hidden]="!(selectedMediaIndex > 0)" (click)="showPrev()">\n <i class="wi wi-chevron-left"></i>\n </a>\n <a class="app-media-fullscreen-nav-control right" [hidden]="!(selectedMediaIndex < fieldDefs.length-1)" (click)="showNext()">\n <i class="wi wi-chevron-right"></i>\n </a>\n </div>\n </div>\n </div>\n </div>\n</div>\n\n<ng-template #imgTemplate let-src="src" let-classname="class" let-field="field">\n <img wmPicture class="{{classname}}" picturesource.bind="src || getSrc(field)" wmImageCache="{{offline}}" />\n</ng-template>\n',providers:[n.provideAsWidgetRef(g)]}]}],g.ctorParameters=function(){return[{type:t.Injector}]},g.propDecorators={mediaListTemplate:[{type:t.ContentChild,args:["mediaListTemplate"]}]};var v=[c,g],y=function(){};y.decorators=[{type:t.NgModule,args:[{imports:[l.BasicModule,o.CommonModule,r.BasicModule,a.MobileNavbarModule,s.PageModule,n.WmComponentsModule],declarations:d([],u(v)),exports:d([],u(v)),entryComponents:[]}]}],e.MediaListComponent=g,e.MediaListItemDirective=c,e.MediaListModule=y,e["\u0275a"]=m,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@wavemaker/variables"),require("@wm/core"),require("angular2-websocket/angular2-websocket"),require("@metrichor/jmespath"),require("@angular/core"),require("@angular/router"),require("@wm/oAuth"),require("@wm/security"),require("@angular/common"),require("@angular/common/http"),require("ngx-toastr"),require("@wm/http")):"function"==typeof define&&define.amd?define("@wm/variables",["exports","@wavemaker/variables","@wm/core","angular2-websocket/angular2-websocket","@metrichor/jmespath","@angular/core","@angular/router","@wm/oAuth","@wm/security","@angular/common","@angular/common/http","ngx-toastr","@wm/http"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.variables={}),e.wm_common_variables,e.wm.core,e.angularWebSocket,e.jmespath,e.ng.core,e.ng.router,e.wm.oAuth,e.wm.security,e.ng.common,e.ng.common.http,e.ngxToastr,e.wm.http)}(this,(function(e,t,n,i,o,r,a,s,l,c,p,u,d){"use strict";var h={hasCordova:void 0!==window.cordova,isStudioMode:!1,isRunMode:!0,XSRF_COOKIE_NAME:"wm_xsrf_token",DEFAULT_TIMER_DELAY:500,WIDGET_DOESNT_EXIST:"The widget you're trying to navigate to doesn't exist on this page"},m={CATEGORY:{MODEL:"wm.Variable",LIVE:"wm.LiveVariable",CRUD:"wm.CrudVariable",SERVICE:"wm.ServiceVariable",WEBSOCKET:"wm.WebSocketVariable",NAVIGATION:"wm.NavigationVariable",NOTIFICATION:"wm.NotificationVariable",TIMER:"wm.TimerVariable",LOGIN:"wm.LoginVariable",LOGOUT:"wm.LogoutVariable",DEVICE:"wm.DeviceVariable"},EVENTS:["onBefore","onBeforeUpdate","onResult","onBeforeOpen","onOpen","onBeforeMessageSend","onMessageReceive","onProgress","onError","onBeforeDatasetReady","onCanUpdate","onClick","onHide","onOk","onCancel","onBeforeClose","onClose","onTimerFire","onSuccess","onOnline","onOffline"],EVENT:{CAN_UPDATE:"onCanUpdate",BEFORE:"onBefore",BEFORE_UPDATE:"onBeforeUpdate",PREPARE_SETDATA:"onBeforeDatasetReady",RESULT:"onResult",ERROR:"onError",ABORT:"onAbort",PROGRESS:"onProgress",CLICK:"onClick",HIDE:"onHide",OK:"onOk",CANCEL:"onCancel",CLOSE:"onClose",TIMER_FIRE:"onTimerFire",SUCCESS:"onSuccess",BEFORE_OPEN:"onBeforeOpen",OPEN:"onOpen",BEFORE_SEND:"onBeforeMessageSend",MESSAGE_RECEIVE:"onMessageReceive",BEFORE_CLOSE:"onBeforeClose"},OWNER:{APP:"App",PAGE:"Page"},REST_SUPPORTED_SERVICES:["JavaService","SoapService","FeedService","RestService","SecurityServiceType","DataService","WebSocketService","OpenAPIService"],PAGINATION_PARAMS:["page","size","sort"],REST_SERVICE:{BASE_PATH_KEY:"x-WM-BASE_PATH",RELATIVE_PATH_KEY:"x-WM-RELATIVE_PATH",OAUTH_PROVIDER_KEY:"x-WM-PROVIDER_ID",AUTH_HDR_KEY:"Authorization",SECURITY_DEFN:{BASIC:"basic",OAUTH2:"oauth2"},AUTH_TYPE:{BASIC:"BASIC",OAUTH:"OAUTH2",NONE:"NONE"},CONTENT_TYPE_KEY:"x-WM-CONTENT_TYPE",ACCESSTOKEN_PLACEHOLDER:{LEFT:"",RIGHT:".access_token"},ERR_TYPE:{NO_ACCESSTOKEN:"missing_accesstoken",NO_CREDENTIALS:"no_credentials",METADATA_MISSING:"metadata_missing",CRUD_OPERATION_MISSING:"crud_operation_missing",USER_UNAUTHORISED:"user_unauthorised",REQUIRED_FIELD_MISSING:"required_field_missing"},ERR_MSG:{NO_ACCESSTOKEN:"Access token missing",NO_CREDENTIALS:"No credentials present",METADATA_MISSING:'Metadata missing for "$variable"',USER_UNAUTHORISED:"Unauthorized User",CRUD_OPERATION_MISSING:'Operation "$operation" not allowed for "$variable"',REQUIRED_FIELD_MISSING:'Required field(s) missing: "${0}"'},UNCLOAKED_HEADERS:["CONTENT-TYPE","ACCEPT","CONTENT-LENGTH","ACCEPT-ENCODING","ACCEPT-LANGUAGE"],PREFIX:{AUTH_HDR_VAL:{BASIC:"Basic",OAUTH:"Bearer"},CLOAK_HEADER_KEY:"X-WM-"}},SERVICE_TYPE:{JAVA:"JavaService",REST:"RestService",SOAP:"SoapService",FEED:"FeedService",DATA:"DataService",SECURITY:"SecurityServiceType",WEBSOCKET:"WebSocketService",OPENAPI:"OpenAPIService"},CONTROLLER_TYPE:{QUERY:"QueryExecution",PROCEDURE:"ProcedureExecution"},HTTP_STATUS_CODE:{CORS_FAILURE:-1,UNAUTHORIZED:401,FORBIDDEN:403},EXPORT_TYPES_MAP:{EXCEL:".xlsx",CSV:".csv"},DEFAULT_VAR:{NOTIFICATION:"appNotification"}},f={NON_BODY_HTTP_METHODS:["GET","HEAD"],CONTENT_TYPES:{FORM_URL_ENCODED:"application/x-www-form-urlencoded",MULTIPART_FORMDATA:"multipart/form-data",OCTET_STREAM:"application/octet-stream"}},g={WM_DATA_JSON:"wm_data_json",WM_HTTP_JSON:"wm_httpRequestDetails"},v=t.$rootScope,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 b(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)}Object.create;function w(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function P(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o<r;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 O={EXCEL:".xlsx",CSV:".csv"};e.appManager=void 0,e.httpService=void 0,e.metadataService=void 0,e.navigationService=void 0,e.routerService=void 0,e.toasterService=void 0,e.oauthService=void 0,e.securityService=void 0,e.dialogService=void 0;var S=/^\[("|')[\w\W]*(\1)\]$/,E=new Map,T=new Map,C=function(e,t){var n,i,o=_.noop;T.has(e)&&(o=T.get(e).cancel),o(),n=_.debounce((function(){(i=e[t]())instanceof Promise&&i.catch(_.noop)}),100),T.set(e,n),n()},A=function(e,t,n,i,o){switch(i.category){case m.CATEGORY.LIVE:"read"===i.operation?("dataBinding"===e?_.forEach(t,(function(e,t){i.filterFields[t]={value:e}})):i.filterFields[e]={value:t,type:n},i.autoUpdate&&!_.isUndefined(t)&&_.isFunction(i.listRecords)&&!o&&C(i,"listRecords")):("dataBinding"===e?i.inputFields=t:i.inputFields[e]=t,i.autoUpdate&&!_.isUndefined(t)&&_.isFunction(i[i.operation+"Record"])&&!o&&C(i,i.operation+"Record"));break;case m.CATEGORY.CRUD:"list"===i.operationType&&i.autoUpdate&&!_.isUndefined(t)&&_.isFunction(i.invoke)&&!o&&C(i,"invoke");break;case m.CATEGORY.SERVICE:case m.CATEGORY.LOGIN:i.autoUpdate&&!_.isUndefined(t)&&_.isFunction(i.invoke)&&!o&&C(i,"invoke");break;case m.CATEGORY.DEVICE:i[e]=t,i.autoUpdate&&!_.isUndefined(t)&&_.isFunction(i.invoke)&&!o&&C(i,"invoke")}},R=function(t,n){switch(t){case"appManager":e.appManager=n;break;case"http":e.httpService=n;break;case"metadata":e.metadataService=n;break;case"navigationService":e.navigationService=n;break;case"router":e.routerService=n;break;case"toaster":e.toasterService=n;break;case"oAuth":e.oauthService=n;break;case"security":e.securityService=n;break;case"dialog":e.dialogService=n}},I=function(e,t,i,o,r){var a,s=t[e],l=t._context;e!==m.EVENT.ERROR||r||s||(a=l.Actions[m.DEFAULT_VAR.NOTIFICATION])&&(i=a.getMessage()||i,i=_.isString(i)?i:"An error has occured. Please check the app logs.",a.invoke({message:i},void 0,void 0));var c=n.$parseEvent(t[e]);return e===m.EVENT.BEFORE_UPDATE?"wm.LiveVariable"===t.category&&"read"===t.operation?c(t._context,{variable:t,dataFilter:i,options:o}):c(t._context,{variable:t,inputData:i,options:o}):c(t._context,{variable:t,data:i,options:o})},D=function(e){setTimeout((function(){n.triggerFn(e)}),500)},N=function(e,t,i,o){var r,a,s,l,c,p="",u=t.get("Content-Disposition");if(u&&-1!==u.indexOf("attachment")&&null!==(r=/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(u))&&r[1]&&(p=r[1].replace(/['"]/g,"")),a=t.get("Content-Type"),s=new Blob([e],{type:a}),void 0!==window.navigator.msSaveBlob)window.navigator.msSaveBlob(s,p)?D(i):n.triggerFn(o);else{if(l=window.URL||window.webkitURL,c=l.createObjectURL(s),p){var d,h=document.createElement("a");void 0===h.download?((d=new FileReader).onloadend=function(){var e=d.result.replace(/^data:[^;]*;/,"data:attachment/file;");window.open(e,"_blank")||(window.location.href=e)},d.onload=D.bind(void 0,i),d.onerror=o,d.readAsDataURL(s)):(h.href=c,h.download=p,document.body.appendChild(h),h.click(),D(i))}else window.open(c,"_blank")||(window.location.href=c),D(i);setTimeout((function(){l.revokeObjectURL(c)}),100)}},x=function(e,t){e=_.split(e,"&"),_.forEach(e,(function(e){e=_.split(e,"="),t[e[0]]=decodeURIComponent(_.join(_.slice(e,1),"="))}))},k=function(e,t){"/"===e.url[1]&&"/"===e.url[2]&&(e.url=e.url.slice(0,1)+e.url.slice(2));var i,o,r,a="",s="fileDownloadIFrame",l="fileDownloadForm",c="Content-Type",p=e.url,u=_.get(e.headers,c),d=_.pickBy(e.headers,(function(e,t){return t!==c}));(i=$("#"+s)).length&&i.first().remove(),i=$('<iframe id="'+s+'" name="'+s+'" class="ng-hide"></iframe>'),(o=$('<form id="'+l+'" name="'+l+'"></form>')).attr({target:i.attr("name"),action:p,method:e.method,enctype:u}),a+=-1!==p.indexOf("?")?p.substring(p.indexOf("?")+1):"",a+=u===f.CONTENT_TYPES.FORM_URL_ENCODED?(a?"&":"")+e.dataParams:"",_.includes(f.NON_BODY_HTTP_METHODS,_.toUpper(e.method))&&x(a,d),x(e.data,d),_.forEach(d,(function(e,t){(r=$('<input type="hidden">')).attr({name:t,value:e}),o.append(r)})),$("body").append(i),setTimeout((function(){i.contents().find("body").append(o),o.submit(),n.triggerFn(t)}),100)},M=function(t,i,o){var r=t.url,a=t.method,s=t.dataParams||t.data,l=t.headers;l["Content-Type"]=l["Content-Type"]||"application/x-www-form-urlencoded",e.httpService.send({target:"WebService",action:"invokeRuntimeRestCall",method:a,url:r,headers:l,data:s,responseType:"arraybuffer"}).then((function(e){setTimeout((function(){N(e.body,e.headers,i,o)}),900)}),(function(e){n.triggerFn(o,e)}))},L=function(){return!!h.hasCordova&&localStorage.getItem(h.XSRF_COOKIE_NAME)},F=function(e,t,i){var o,r=e.target,a=i[t];return S.test(r)?o=a:(r=r.substr(0,r.lastIndexOf(".")),o=e.target===t?i:r?n.findValueOf(a,r,!0):a),o},j=function(e){return S.test(e)?e.replace(/^(\[["'])|(["']\])$/g,""):e.split(".").pop()},B=function(e,t,n,i,o,r){var a=j(e),s=F(t,n,i);o=_.isUndefined(o)?t.value:o,s&&(s[a]=o),A(a,o,t.type,i,r)},G=function(e,t,n){var i,o=_.keys(_.get(E.get(n),[n.name,t])),r=j(e);(i=_.filter(o,(function(e){return e!==r&&_.includes(e,r)||(r===t||"dataBinding"===r)&&e!==r}))).length&&_.forEach(i,(function(e){B(e,{target:e},t,n,_.get(E.get(n),[n.name,t,e]))}))},V=function(e,t,i,o){var r=e.target,a=F(e,i,o),s=j(r),l=t.registerDestroyListener?t.registerDestroyListener.bind(t):_.noop;if(n.stringStartsWith(e.value,"bind:")){l(n.$watch(e.value.replace("bind:",""),t,{},(function(t,l){t===l&&_.isUndefined(t)||!(!_.isUndefined(t)||_.isUndefined(l)&&_.isUndefined(a[s]))||(_.includes(["blob","file"],e.type)||(t=n.getClonedObject(t)),B(r,e,i,o,t),E.has(o)||E.set(o,{}),_.set(E.get(o),[o.name,i,r],t),_.isObject(t)&&G(r,i,o))}),void 0,void 0,void 0,(function(){return o.isMuted})))}else _.isUndefined(e.value)||(B(r,e,i,o,e.value,!0),i!==s&&(E.has(o)||E.set(o,{}),_.set(E.get(o),[o.name,i,r],e.value)))},U=function(e,t,n,i){i=i||"dataBinding";var o=e[n=n||"dataBinding"];e[n]={},e["_bind"+n]=o,o&&_.isArray(o)&&o.forEach((function(n){"wm.Variable"===e.category&&"dataBinding"===n.target&&(n.target="dataSet"),V(n,t,i,e)}))},W=function(t,n,i,o,r){if(h.hasCordova){var a=void 0;i&&(a=O[i]),e.appManager.notify("device-file-download",{url:t.url,name:n,extension:a,headers:t.headers,successCb:o,errorCb:r})}else!_.isEmpty(t.headers)||L()?M(t,o,r):k(t,o)},q=function(){return window.File&&window.FileReader&&window.FileList&&window.Blob},z=C,H=function(e){return n.DEFAULT_FORMATS[_.toUpper(e)]},Y=function(t,i){var o;return _.isDate(t)?o=t.getTime():(isNaN(t)||(t=parseInt(t,10)),o=t&&moment(t).valueOf()),isNaN(o)&&i!==n.DataType.TIME||i===n.DataType.TIMESTAMP?o:(i!==n.DataType.TIME||o||(o=moment((new Date).toDateString()+" "+t).valueOf()),t&&e.appManager.getPipe("date").transform(o,H(i)))},K=function(e,t){return _.includes(t,".")&&(t=_.toLower(n.extractType(t))),_.isArray(e)?_.map(e,(function(e){return Y(e,t)})):Y(e,t)};var Q=function(){function t(){}return t.prototype.initBinding=function(e,t,n){U(e,e._context,t,n)},t.prototype.notifyInflight=function(t,n,i){e.appManager.notify("toggle-variable-state",{variable:t,active:n,data:i})},t}(),X=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return b(i,t),i.prototype.invoke=function(t,i){!function(t,i){var o;t.dataSet=i&&i.data||t.dataSet;var r=t.dataBinding.pageName||t.pageName,a=t.operation,s=_.clone(t.dataSet),l=_.isNil(null==i?void 0:i.cacheable)?t.cacheable:i.cacheable;switch(i=i||{},_.isNil(l)||n.isString(l)&&""===l.trim()||(s._cache_page=l),a){case"goToPreviousPage":e.navigationService.goToPrevious();break;case"gotoPage":e.navigationService.goToPage(r,{transition:t.pageTransitions,$event:i.$event,urlParams:s,cacheable:t.cacheable});break;case"gotoView":o=t.dataBinding&&t.dataBinding.viewName||t.viewName;break;case"gotoTab":o=t.dataBinding&&t.dataBinding.tabName||t.tabName;break;case"gotoAccordion":o=t.dataBinding&&t.dataBinding.accordionName||t.accordionName;break;case"gotoSegment":o=t.dataBinding&&t.dataBinding.segmentName||t.segmentName}o&&e.navigationService.goToView(o,{pageName:r,transition:t.pageTransitions,$event:i.$event,urlParams:s},t)}(t,i)},i}(Q),J=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return b(i,t),i.prototype.onToasterClick=function(e){I("onClick",e,"")},i.prototype.onToasterHide=function(e){I("onHide",e,"")},i.prototype.notifyViaToaster=function(t,n){var i,o=(n.class||t.dataBinding.class||"info").toLowerCase(),r=n.message||t.dataBinding.text,a=n.title,s="toast-"+(n.position||t.dataBinding.toasterPosition||"bottom right").replace(" ","-"),l=t.dataBinding.page,c=parseInt(n.duration||t.dataBinding.duration,null);c||(c=0!==c&&"success"===o?3e3:0),i=t.dataBinding.content&&"page"===t.dataBinding.content&&l?e.toasterService.showCustom(l,{positionClass:s,timeOut:c,partialParams:t._binddataSet,context:t._context}):e.toasterService.show(o,a,r||null,{positionClass:s,timeOut:c,enableHtml:!0}),t.onClick&&i.onTap.subscribe(this.onToasterClick.bind(this,t)),t.onHide&&i.onHidden.subscribe(this.onToasterHide.bind(this,t))},i.prototype.getDialogConfig=function(t,n,i,o){return{title:n.title||t.dataBinding.title,text:n.message||t.dataBinding.text,okButtonText:n.okButtonText||t.dataBinding.okButtonText||"OK",cancelButtonText:n.cancelButtonText||t.dataBinding.cancelButtonText||"CANCEL",alerttype:n.alerttype||t.dataBinding.alerttype||"information",onOk:function(){e.dialogService.close(i,void 0,o)},onCancel:function(){I("onCancel",t,n.data),e.dialogService.close(i,void 0)},onClose:function(){I("onClose",t,n.data)}}},i.prototype.notifyViaDialog=function(t,i){var o="PREFAB"===n.getWmProjectProperties().type,r=(o?"Prefab":"Common")+_.capitalize(t.operation)+"Dialog",a=this.getDialogConfig(t,i,r,(function(){return I("onOk",t,i.data)}));a=o?a:{notification:a},e.dialogService.open(r,void 0,a)},i.prototype.notify=function(e,t,n,i){t=t||{},"toast"===e.operation?this.notifyViaToaster(e,t):this.notifyViaDialog(e,t)},i.prototype.getMessage=function(e){return e.dataBinding.text},i.prototype.setMessage=function(e,t){return _.isString(t)&&(e.dataBinding.text=t),e.dataBinding.text},i.prototype.getOkButtonText=function(e){return e.dataBinding.okButtonText},i.prototype.setOkButtonText=function(e,t){return _.isString(t)&&(e.dataBinding.okButtonText=t),e.dataBinding.okButtonText},i.prototype.getToasterDuration=function(e){return e.dataBinding.duration},i.prototype.setToasterDuration=function(e,t){return e.dataBinding.duration=t,e.dataBinding.duration},i.prototype.getToasterClass=function(e){return e.dataBinding.class},i.prototype.setToasterClass=function(e,t){return _.isString(t)&&(e.dataBinding.class=t),e.dataBinding.class},i.prototype.getToasterPosition=function(e){return e.dataBinding.class},i.prototype.setToasterPosition=function(e,t){return _.isString(t)&&(e.dataBinding.position=t),e.dataBinding.position},i.prototype.getAlertType=function(e){return e.dataBinding.alerttype},i.prototype.setAlertType=function(e,t){return _.isString(t)&&(e.dataBinding.alerttype=t),e.dataBinding.alerttype},i.prototype.getCancelButtonText=function(e){return e.dataBinding.cancelButtonText},i.prototype.setCancelButtonText=function(e,t){return _.isString(t)&&(e.dataBinding.cancelButtonText=t),e.dataBinding.cancelButtonText},i}(Q),Z=function(){function t(){}return t.prototype.initBinding=function(e,t,n){U(e,e._context,t,n)},t.prototype.notifyInflight=function(t,n,i,o){e.appManager.notify("toggle-variable-state",{variable:t,active:n,data:i,options:o})},t.prototype.setRequestTrackId=function(e,t){var n,i=null===(n=null==e?void 0:e.headers)||void 0===n?void 0:n.get("x-wm-request-track-id");i&&(t._requestTrackId=i)},t.prototype.httpCall=function(t,n,i){var o=this;return new Promise((function(r,a){n._observable=e.httpService.sendCallAsObservable(t,i).subscribe((function(e){e&&e.type&&(o.setRequestTrackId(e,n),r(e))}),(function(t){o.setRequestTrackId(t,n),e.httpService.isPlatformSessionTimeout(t)?(o.notifyInflight(n,!1,t),t._401Subscriber.asObservable().subscribe((function(e){return r(e)}),(function(e){return a(e)}))):a(t)}))}))},t.prototype.prepareCallbackOptions=function(e,t){var n={};return n.xhrObj=e,t&&_.extend(n,t),n},t}(),ee=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return b(i,t),i.prototype.validate=function(e){var t,n,i;for(n in["rememberme","remembermecheck"].forEach((function(t){_.isBoolean(e[t])&&(i=t)})),e[i=i||"j_rememberme"]=!!_.isBoolean(e[i])&&e[i],e)if(e.hasOwnProperty(n)&&(""===e[n]||void 0===e[n])){t="Please provide required credentials";break}return t},i.prototype.migrateOldParams=function(e){var t={},n={usernametext:"j_username",username:"j_username",passwordtext:"j_password",password:"j_password",remembermecheck:"j_rememberme",rememberme:"j_rememberme"};return _.each(e,(function(e,i){n[i]?t[n[i]]=e:t[i]=e})),t},i.prototype.redirectToAppBasePath=function(){e.routerService.navigate(["/"]).then((function(e){e&&window.location.reload()}))},i.prototype.login=function(t,i,o,r){var a,s=this,l=(i=i||{}).loginInfo||i.input||t.dataBinding,c=this.validate(l);if(c)return n.triggerFn(r,c),void I("onError",t,c);var p=n.getClonedObject(l),u=I(m.EVENT.BEFORE_UPDATE,t,p);if(_.isObject(u))p=u;else if(!1===u)return void n.triggerFn(r);p=this.migrateOldParams(p);var d=_.get(e.securityService.get(),"userInfo.userName");this.notifyInflight(t,!0),t.promise=e.securityService.appLogin(p,(function(i){e.dialogService.close("CommonLoginDialog"),e.appManager.reloadAppData().then((function(r){I(m.EVENT.RESULT,t,_.get(r,"userInfo")),(a=I(m.EVENT.PREPARE_SETDATA,t,_.get(r,"userInfo")))&&_.set(r,"userInfo",a),s.notifyInflight(t,!1,i),n.triggerFn(o),setTimeout((function(){if(I(m.EVENT.SUCCESS,t,_.get(r,"userInfo")),t.useDefaultSuccessHandler){var n=d===p.j_username;d&&!n||e.appManager.executeSessionFailureRequests();var i=e.securityService.getCurrentRouteQueryParam("redirectTo"),o=e.appManager.noRedirect(),a=e.securityService.getRedirectedRouteQueryParams();if(a.redirectTo&&delete a.redirectTo,e.appManager.noRedirect(!1),d)if(_.isEmpty(i)){var l=e.securityService.get(),c=_.get(l,"loginConfig.sessionTimeout.type")||"PAGE";n&&"DIALOG"===c||s.redirectToAppBasePath()}else d===p.j_username?e.routerService.navigate(["/"+i],{queryParams:a}):s.redirectToAppBasePath();else _.isEmpty(i)?o||e.routerService.navigate(["/"]):e.routerService.navigate(["/"+i],{queryParams:a})}I(m.EVENT.CAN_UPDATE,t,_.get(r,"userInfo"))}))}))}),(function(e){I(m.EVENT.RESULT,t,e),s.notifyInflight(t,!1,e);var i=e.error||"Invalid credentials.",o=e.details;h.isRunMode&&I("onError",t,i,o,!0),n.triggerFn(r,i,o),I(m.EVENT.CAN_UPDATE,t,e)}))},i}(Q),te=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return b(i,t),i.prototype.logout=function(t,i,o,r){var a,s,l,c=this;a=function(e,i,o){h.isStudioMode||I("onError",t,e,o),n.triggerFn(r,e,o)},!1!==I(m.EVENT.BEFORE_UPDATE,t,null)?e.securityService.isAuthenticated((function(i){i?(c.notifyInflight(t,!0),t.promise=e.securityService.appLogout((function(i){var r=i.body;r=n.getValidJSON(r),e.appManager.reloadAppData().then((function(){c.notifyInflight(t,!1,r),I(m.EVENT.RESULT,t,r),(l=I(m.EVENT.PREPARE_SETDATA,t,r))&&(r=l),setTimeout((function(){I(m.EVENT.SUCCESS,t,r),I(m.EVENT.CAN_UPDATE,t,r)}))})),r&&r.result?window.location.href=r.result:t.useDefaultSuccessHandler&&((s=t.redirectTo)&&"login.html"!==s&&"index.html"!==s||(s=""),e.routerService.navigate(["/"+s]),window.cordova||setTimeout((function(){window.location.reload()}))),n.triggerFn(o)}),a)):a("No authenticated user to logout.")}),(function(e){c.notifyInflight(t,!1,e),a(e)})):n.triggerFn(r)},i}(Q),ne=function(e){function t(){var t=e.apply(this,P([],w(arguments)))||this;return t.serviceRegistry=new Map,t}return b(t,e),t.prototype.invoke=function(e,t){var n=this,i=this.serviceRegistry.get(e.service);return null==i?(I("onError",e,null),Promise.reject("Could not find service '"+i+"'")):(this.notifyInflight(e,!0),i.invoke(e,t).then((function(t){return n.notifyInflight(e,!1,t),t}),(function(t){return n.notifyInflight(e,!1,t),Promise.reject(t)})))},t.prototype.registerService=function(e){this.serviceRegistry.set(e.name,e)},t}(Z),ie=function(){function e(){}return e.setPaginationQueryParams=function(e,t,n){t.parameters.forEach((function(t){var i;i="offset"===n.type||n.input.offset?"offset":"page",t.name===n.input[i].split(".")[0]?t.sampleValue=e.pagination.page:t.name===n.input.size.split(".")[0]&&(t.sampleValue=e.pagination.size)}))},e.setVariablePagination=function(e,t,n){e.pagination||(e.pagination={empty:!1}),e.pagination.size=t.size,e.pagination.page=t.page||0,e.pagination.totalElements=t.totalElements,e.pagination.numberOfElements=e.pagination.size,e.pagination.number=n.page?n.page-1:0,e.pagination.totalPages=e.pagination.totalElements/e.pagination.size,e.pagination.totalElements%e.pagination.size==0?e.pagination.totalPages=parseInt(e.pagination.totalPages):e.pagination.totalPages=parseInt(e.pagination.totalPages)+1,t.next?(e.pagination.next=t.next,e.pagination.prev=t.prev,e.pagination.last=!t.next,e.pagination.first=!t.prev):(e.pagination.first=e.pagination.page<=1,e.pagination.last=""===t.hasMoreItems?!(e.pagination.page<e.pagination.totalPages):!t.hasMoreItems)},e.setPaginationItems=function(e,t,n,i,r){var a;if(_.startsWith(e,"$body")){var s=e.replace("$body.","");try{n[i]=o.jmespath.search(t,s)}catch(t){console.warn(e+" expression needs to be corrected as per JMES guidelines")}}else if(_.startsWith(e,"$header")){var l=e.replace("$header.",""),c=Object.fromEntries(r.headers),p=l.split(".");try{n[i]=o.jmespath.search(c,p[0].toLowerCase())}catch(t){console.warn(e+" expression needs to be corrected as per JMES guidelines")}if(null===(a=n[i])||void 0===a?void 0:a.length){var u=n[i].join();if(1===p.length)n[i]=u;else{var d=p.slice(1).join("."),h=JSON.parse(u);/[!@#$%^&*()+\=\[\]{};':"\\|,<>\/?]+/.test(d)&&(d="headerResp."+d);try{n[i]=o.jmespath.search(h,d)}catch(t){console.warn(e+" expression needs to be corrected as per JMES guidelines")}}}}},e.getPaginationInfo=function(e,t){return(null==e?void 0:e.paginationInfo)?e.paginationInfo:t._paginationConfig},e.checkPaginationAtQuery=function(e,t,n){var i,o=this.getPaginationInfo(e,t);if(n&&n.page&&(null==o?void 0:o.input.size)&&t.pagination){var r;r="offset"===o.type||o.input.offset?"offset":"page";var a=o.input[r].split(".")[0],s=_.find(e.parameters,(function(e){return e.name===a}));!_.isEmpty(t.dataBinding)&&s&&"query"===s.parameterType&&((null===(i=o.output)||void 0===i?void 0:i.page)||"offset"===o.type?t.pagination.page=this.getOffsetInfo(t,n):t.pagination.page=n.page,this.setPaginationQueryParams(t,e,o))}},e.getOffsetInfo=function(e,t){return e.pagination.size*(t.page?t.page-1:1)},e.setPaginationAtReq=function(e,t,n,i,o,r,a){var s,l={},c={};s="offset"===e.type||e.input.offset?"offset":"page";var p=e.input[s].split(".")[0],u=_.find(t.parameters,(function(e){return e.name===p}));if("header"===(null==u?void 0:u.parameterType))_.set(l,e.input[s],n.pagination.page),_.set(l,e.input.size,n.pagination.size),i[p]=JSON.stringify(l[p]),c.headers=i;else if("body"===(null==u?void 0:u.parameterType)){var d=JSON.parse(u.sampleValue),h=e.input[s].split(".")[1];if(d&&d[h]){var m=e.input[s].split(".").splice(1).join(".");"offset"!==s?_.set(l,m,n.pagination.page):_.set(l,m,this.getOffsetInfo(n,a)),_.set(l,e.input.size.split(".").splice(1).join("."),n.pagination.size),d[h]=l[h],o=JSON.stringify(d),c.requestBody=o}}else if(n.pagination.next&&u)if("path"===u.parameterType){var f=t.relativePath.split("/"),g="{"+u.name+"}",v=f.indexOf(g),y=void 0;y=n.pagination.isNext?n.pagination.next.split("/"):n.pagination.prev.split("/");var b=void 0,w=void 0;t.directPath?((b=(w=new URL(r)).pathname.split("/"))[v]=y[v],w.pathname=b.join("/"),r=w.href,c.url=r):((b=r.split("/"))[v+1]=y[v],r=b.join("/"),c.url=r)}else if("query"===u.parameterType){f=r.split("?"),y=void 0;y=n.pagination.isNext?n.pagination.next.split("?"):n.pagination.prev.split("?"),f[1]=y[1],r=f.join("?"),c.url=r}return c},e.setParameterVal=function(e,t,n,i){var o=this.getPaginationInfo(n,i).input[e].split(".")[0],r=_.find(n.parameters,(function(e){return e.name===o}));t[e]=_.result(r,"sampleValue")},e.generatePaginationRes=function(e,t,n,i,o,r){var a={},s=t.output;if(null==s?void 0:s.next)s&&(this.setPaginationItems(s.next,n,a,"next",i),this.setPaginationItems(s.prev,n,a,"prev",i));else{if((null==s?void 0:s.size)?this.setPaginationItems(s.size,n,a,"size",i):this.setParameterVal("size",a,e,r),(null==s?void 0:s.page)?this.setPaginationItems(s.page,n,a,"page",i):"offset"!==t.type&&this.setParameterVal("page",a,e,r),_.startsWith(null==s?void 0:s.totalElements,"$minValue")){var l=s.totalElements.replace("$minValue=",""),c=a.page?a.page:o.page,p=a.size*c;!r.pagination||r.pagination.totalElements>p?a.totalElements=parseInt(l):a.totalElements=p+1}else(null==s?void 0:s.totalElements)?this.setPaginationItems(s.totalElements,n,a,"totalElements",i):"offset"===t.type||t.input.offset?a.totalElements=a.size*(o.page?o.page:1)+1:a.totalElements=a.size*a.page+1;(null==s?void 0:s.hasMoreItems)?this.setPaginationItems(s.hasMoreItems,n,a,"hasMoreItems",i):a.hasMoreItems=""}return a},e}(),oe=function(e){return _.includes(["QueryExecution","ProcedureExecution"],e.controller)&&_.includes(["put","post"],e.operationType)},re=function(e,t){return e===m.CONTROLLER_TYPE.QUERY&&t===m.SERVICE_TYPE.DATA},ae=function(e,t,i){var o=_.toLower(n.extractType(_.get(t,"items.type")||t.type)),r=h.isStudioMode?t["x-WM-CONTENT_TYPE"]:t.contentType;if(q())return"file"===o||"string"!==r&&r?_.isArray(i)&&"file"===o?_.forEach(i,(function(i){e.append(t.name,i&&i.content||n.getBlob(i),i.name)})):e.append(t.name,n.getBlob(i,r),i&&i.name):(_.isObject(i)&&(i=JSON.stringify(i)),e.append(t.name,i)),e},se=function(e,t){var i,o={},r=[];return _.forEach(t,(function(t){i=_.get(e,t.name),_.isUndefined(i)||""===i||null===i||t.readOnly?t.required&&r.push(t.name||t.id):(i=n.isDateTimeType(t.type)?K(i,t.type):i,_.isArray(i)&&"string"===_.toLower(n.extractType(t.type))&&(i=_.join(i,",")),o[t.name]=i)})),{requestBody:o,missingParams:r}},le=function(e){var t={},n=m.REST_SERVICE.UNCLOAKED_HEADERS,i=m.REST_SERVICE.PREFIX.CLOAK_HEADER_KEY;return _.forEach(e,(function(e,o){_.includes(n,o.toUpperCase())?t[o]=e:t[i+o]=e})),t},ce=function(){function t(){}return t.constructRequestParams=function(t,i,o,r){if(t=t||{},null===i)return{error:{type:m.REST_SERVICE.ERR_TYPE.USER_UNAUTHORISED,message:m.REST_SERVICE.ERR_MSG.USER_UNAUTHORISED,field:"_wmServiceOperationInfo"}};if(_.isEmpty(i))return{error:{type:m.REST_SERVICE.ERR_TYPE.METADATA_MISSING,message:m.REST_SERVICE.ERR_MSG.METADATA_MISSING,field:"_wmServiceOperationInfo"}};if(i&&i.invalid)return{error:{type:m.REST_SERVICE.ERR_TYPE.CRUD_OPERATION_MISSING,message:m.REST_SERVICE.ERR_MSG.CRUD_OPERATION_MISSING,field:"_wmServiceOperationInfo"}};var a,s,l,c,p,u,d,y,b,w,P,O,S,E,T,C,A,R=i.directPath||"",I=i.basePath?i.basePath+i.relativePath:i.relativePath,D=oe(t),N="",x={},k=[],M=null;function L(){return b||(b=new FormData)}if(S=_.get(i.securityDefinitions,"0"))switch(S.type){case m.REST_SERVICE.SECURITY_DEFN.OAUTH2:if(C=S[m.REST_SERVICE.OAUTH_PROVIDER_KEY],A=null,!(E=e.oauthService.getAccessToken(C,A)))return{error:{type:m.REST_SERVICE.ERR_TYPE.NO_ACCESSTOKEN,message:m.REST_SERVICE.ERR_MSG.NO_ACCESSTOKEN},securityDefnObj:S};x[m.REST_SERVICE.AUTH_HDR_KEY]=m.REST_SERVICE.PREFIX.AUTH_HDR_VAL.OAUTH+" "+E;break;case m.REST_SERVICE.SECURITY_DEFN.BASIC:if(u=o.wm_auth_username,d=o.wm_auth_password,!u||!d)return{error:{type:m.REST_SERVICE.ERR_TYPE.NO_CREDENTIALS,message:m.REST_SERVICE.ERR_MSG.NO_CREDENTIALS},securityDefnObj:S};x[m.REST_SERVICE.AUTH_HDR_KEY]=m.REST_SERVICE.PREFIX.AUTH_HDR_VAL.BASIC+" "+btoa(u+":"+d),M={type:m.REST_SERVICE.AUTH_TYPE.BASIC}}if(ie.checkPaginationAtQuery(i,t,r),i.proxySettings=i.proxySettings||{web:!0,mobile:!1},y=i.httpMethod||i.methodType,w=h.hasCordova?i.proxySettings.mobile:i.proxySettings.web,T=i.proxySettings.withCredentials,l=w?I:R,_.forEach(i.parameters,(function(e){function r(){o?(P=o[e.name]&&_.isObject(o[e.name])?o[e.name]:o,O=_.get(i,["definitions",e.type])):(P=c||{},O=e.children)}var c=e.sampleValue;if(n.isDefined(c)&&null!==c&&""!==c||D&&"file"!==e.type)switch(t.serviceType===m.SERVICE_TYPE.DATA&&n.isDateTimeType(e.type)&&(c=K(c,e.type)),_.isArray(c)&&"string"===_.toLower(n.extractType(e.type))&&t.serviceType===m.SERVICE_TYPE.DATA&&(c=_.join(c,",")),e.parameterType.toUpperCase()){case"QUERY":if(_.isNull(c)&&re(t.controller,t.serviceType))break;N?N+="&"+e.name+"="+encodeURIComponent(c):N="?"+e.name+"="+encodeURIComponent(c);break;case"PATH":p=new RegExp("\\s*\\{\\s*"+e.name+"(:\\.\\+)?\\s*\\}\\s*"),l=l.replace(p,c);break;case"HEADER":x[e.name]=c;break;case"BODY":D?(r(),a=se(P,O),s=a.requestBody,k=_.concat(k,a.missingParams)):s=c;break;case"FORMDATA":D&&e.name===g.WM_DATA_JSON?(r(),a=se(P,O),s=ae(L(),e,a.requestBody),k=_.concat(k,a.missingParams)):s=ae(L(),e,c)}else e.required&&k.push(e.name||e.id)})),k.length)return{error:{type:m.REST_SERVICE.ERR_TYPE.REQUIRED_FIELD_MISSING,field:k.join(","),message:n.replace(m.REST_SERVICE.ERR_MSG.REQUIRED_FIELD_MISSING,[k.join(",")]),skipDefaultNotification:!0}};_.includes(f.NON_BODY_HTTP_METHODS,_.toUpper(y))||i.consumes&&i.consumes[0]===f.CONTENT_TYPES.MULTIPART_FORMDATA||(x["Content-Type"]=i.consumes&&i.consumes[0]||"application/json"),_.includes(i.consumes,f.CONTENT_TYPES.FORM_URL_ENCODED)&&!_.includes(f.NON_BODY_HTTP_METHODS,(y||"").toUpperCase())?(N&&(s=(s?s+"&":"")+N.substring(1)),x["Content-Type"]=f.CONTENT_TYPES.FORM_URL_ENCODED):l+=N,w&&(x=t.serviceType!==m.SERVICE_TYPE.REST&&t.serviceType!==m.SERVICE_TYPE.OPENAPI||i.skipCloakHeaders?x:le(x),t.getPrefabName()&&-1!==m.REST_SUPPORTED_SERVICES.indexOf(t.serviceType)?(l="prefabs/"+t.getPrefabName()+l,c="invokePrefabRestService"):t.getPrefabName()||(l="services"+l),l=v.project.deployedUrl+l);var F=ie.getPaginationInfo(i,t);if(F&&t.pagination){var j=ie.setPaginationAtReq(F,i,t,x,s,l,r);j&&(j.headers?x=j.headers:j.requestBody?s=j.requestBody:j.url&&(l=j.url))}return{projectID:v.project.id,url:l,target:c,method:y,headers:x,data:s,authDetails:M,isDirectCall:!w,isExtURL:t.serviceType===m.SERVICE_TYPE.REST,withCredentials:T}},t.isFileUploadRequest=function(e){return"FileService"===e.service&&"uploadFile"===e.operation},t.excludePaginationParams=function(e){return _.map(_.reject(e,(function(e){return _.includes(m.PAGINATION_PARAMS,e.name)})),(function(e){return e.name}))},t}(),pe=function(t){function o(){var e=t.apply(this,P([],w(arguments)))||this;return e.scope_var_socket_map=new Map,e.PROPERTY={SERVICE:"service",DATA_UPDATE_STRATEGY:"dataUpdateStrategy",DATA_LIMIT:"dataLimit"},e.DATA_UPDATE_STRATEGY={REFRESH:"refresh",PREPEND:"prepend",APPEND:"append"},e}return b(o,t),o.prototype.shouldAppendData=function(e){return(e=e||this)[this.PROPERTY.DATA_UPDATE_STRATEGY]!==this.DATA_UPDATE_STRATEGY.REFRESH},o.prototype.shouldAppendLast=function(e){return e[this.PROPERTY.DATA_UPDATE_STRATEGY]===this.DATA_UPDATE_STRATEGY.APPEND},o.prototype.getDataLimit=function(e){return e.dataLimit},o.prototype.getURL=function(t){var n,i=t.getPrefabName(),o=i?_.get(e.metadataService.getByOperationId(t.operationId,i),"wmServiceOperationInfo"):_.get(e.metadataService.getByOperationId(t.operationId),"wmServiceOperationInfo"),r=t.dataBinding;if(_.forEach(o.parameters,(function(e){e.sampleValue=r[e.name]})),$.extend(o,{skipCloakHeaders:!0}),!(n=ce.constructRequestParams(t,o,r)).error||!n.error.message)return n.url;this._onSocketError(t,{data:n.error.message})},o.prototype._onSocketMessage=function(e,t){var i,o,r,a,s,l=_.get(t,"data");l=n.getValidJSON(l)||n.xmlToJson(l)||l,i=I(m.EVENT.MESSAGE_RECEIVE,e,l,t),l=n.isDefined(i)?i:l,this.shouldAppendData(e)?(e.dataSet=e.dataSet||[],o=e.dataSet.length,r=this.getDataLimit(e),a=this.shouldAppendLast(e),r&&o>=r&&(a?e.dataSet.shift():e.dataSet.pop()),s=a?o:0,e.dataSet.splice(s,0,l)):e.dataSet=n.isDefined(i)?i:l},o.prototype._onBeforeSend=function(e,t){return I(m.EVENT.BEFORE_SEND,e,t)},o.prototype._onBeforeSocketClose=function(e,t){return I(m.EVENT.BEFORE_CLOSE,e,_.get(t,"data"),t)},o.prototype._onBeforeSocketOpen=function(e,t){return I(m.EVENT.BEFORE_OPEN,e,_.get(t,"data"),t)},o.prototype._onSocketOpen=function(e,t){e._socketConnected=!0,I(m.EVENT.OPEN,e,_.get(t,"data"),t)},o.prototype.freeSocket=function(e){this.scope_var_socket_map.set(e,void 0)},o.prototype._onSocketClose=function(e,t){e._socketConnected=!1,this.freeSocket(e),I(m.EVENT.CLOSE,e,_.get(t,"data"),t)},o.prototype._onSocketError=function(e,t){e._socketConnected=!1,this.freeSocket(e),I(m.EVENT.ERROR,e,_.get(t,"data")||"Error while connecting with "+e.service,t)},o.prototype.getSocket=function(e){var t=this.getURL(e),o=this.scope_var_socket_map.get(e);return o||(h.hasCordova||!n.isInsecureContentRequest(t)?((o=new i.$WebSocket(t)).onOpen(this._onSocketOpen.bind(this,e)),o.onError(this._onSocketError.bind(this,e)),o.onMessage(this._onSocketMessage.bind(this,e)),o.onClose(this._onSocketClose.bind(this,e)),this.scope_var_socket_map.set(e,o),e._socket=o,o):void n.triggerFn(this._onSocketError.bind(this,e)))},o.prototype.open=function(e,t,i){var o;if(!1!==this._onBeforeSocketOpen(e))return o=this.getSocket(e),n.triggerFn(t),o;n.triggerFn(i)},o.prototype.close=function(e){var t=this._onBeforeSocketClose(e),n=this.getSocket(e);!1!==t&&n.close()},o.prototype.send=function(e,t){var i,o=this.getSocket(e);t=t||_.get(e,"dataBinding.RequestBody"),!1!==(i=this._onBeforeSend(e,t))&&(t=n.isDefined(i)?i:t,t=n.isObject(t)?JSON.stringify(t):t,o.send(t,0))},o}(Z),ue=new Map,de={Variable:Z,Action:Q,"wm.NavigationVariable":X,"wm.NotificationVariable":J,"wm.LoginVariable":ee,"wm.LogoutVariable":te,"wm.DeviceVariable":ne,"wm.WebSocketVariable":pe},he=function(){function e(){}return e.get=function(e){return ue.has(e)?ue.get(e):ue.set(e,new de[e]).get(e)},e}(),me=function(){function e(){}return e.prototype.invoke=function(e,t){var i=this.operations.find((function(t){return t.name===e.operation}));if(null==i)return I(m.EVENT.ERROR,e,null),Promise.reject("Could not find operation '"+e.operation+"' in service '"+this.name+"'");if(n.hasCordova()){var o=new Map;return void 0!==e.dataBinding&&(Object.entries(e).forEach((function(e){o.set(e[0],e[1])})),Object.entries(e.dataBinding).forEach((function(e){o.set(e[0],e[1])}))),i.invoke(e,t,o).then((function(t){return e.dataSet=t,n.$invokeWatchers(!0),I(m.EVENT.SUCCESS,e,t),t}),(function(t){return e.dataSet={},n.$invokeWatchers(!0),I(m.EVENT.ERROR,e,null),t}))}return Promise.resolve().then((function(){return I(m.EVENT.SUCCESS,e,i.model),i.model}))},e}(),fe=function(){return he.get(m.CATEGORY.DEVICE)},ge=function(e){function t(t){var n=e.call(this)||this;return Object.assign(n,t),n}return b(t,e),t.prototype.init=function(){fe().initBinding(this)},t.prototype.invoke=function(e,t,n){fe().invoke(this,e).then(t,n)},t}(t.ApiAwareVariable),ve=function(){return he.get(m.CATEGORY.NAVIGATION)},ye=function(e){function t(t){var n=e.call(this)||this;return Object.assign(n,t),n}return b(t,e),t.prototype.invoke=function(e){ve().invoke(this,e)},t.prototype.navigate=function(e){this.invoke(e)},t.prototype.init=function(){ve().initBinding(this,"dataBinding","dataBinding"),ve().initBinding(this,"dataSet","dataSet")},t}(t.BaseAction),be=function(){return he.get(m.CATEGORY.NOTIFICATION)},we=function(e){function t(t){var n=e.call(this)||this;return Object.assign(n,t),n}return b(t,e),t.prototype.execute=function(t,i){var o=this,r=e.prototype.execute.call(this,t,i);return n.isDefined(r)?r:new Promise((function(e,r){switch(t){case n.DataSource.Operation.INVOKE:o.invoke(i,e,r);break;case n.DataSource.Operation.NOTIFY:o.notify(i,e,r);break;default:r(t+" operation is not supported on this data source")}}))},t.prototype.notify=function(e,t,n){be().notify(this,e,t,n)},t.prototype.invoke=function(e,t,n){this.notify(e,t,n)},t.prototype.getMessage=function(){return be().getMessage(this)},t.prototype.setMessage=function(e){return be().setMessage(this,e)},t.prototype.clearMessage=function(){return be().setMessage(this,"")},t.prototype.getOkButtonText=function(){return be().getOkButtonText(this)},t.prototype.setOkButtonText=function(e){return be().setOkButtonText(this,e)},t.prototype.getToasterDuration=function(){return be().getToasterDuration(this)},t.prototype.setToasterDuration=function(e){return be().setToasterDuration(this,e)},t.prototype.getToasterClass=function(){return be().getToasterClass(this)},t.prototype.setToasterClass=function(e){return be().setToasterClass(this,e)},t.prototype.getToasterPosition=function(){return be().getToasterPosition(this)},t.prototype.setToasterPosition=function(e){return be().setToasterPosition(this,e)},t.prototype.getAlertType=function(){return be().getAlertType(this)},t.prototype.setAlertType=function(e){return be().setAlertType(this,e)},t.prototype.getCancelButtonText=function(){return be().getCancelButtonText(this)},t.prototype.setCancelButtonText=function(e){return be().setCancelButtonText(this,e)},t.prototype.init=function(){be().initBinding(this,"dataBinding","dataBinding"),be().initBinding(this,"dataSet","dataSet")},t}(t.BaseAction),Pe=function(){return he.get(m.CATEGORY.LOGIN)},_e=function(e){function t(t){var n=e.call(this)||this;return Object.assign(n,t),n}return b(t,e),t.prototype.login=function(e,t,n){return Pe().login(this,e,t,n)},t.prototype.invoke=function(e,t,n){return this.login(e,t,n)},t.prototype.cancel=function(){},t.prototype.init=function(){Pe().initBinding(this,"dataBinding","dataBinding")},t}(t.BaseAction),Oe=function(){return he.get(m.CATEGORY.LOGOUT)},Se=function(e){function t(t){var n=e.call(this)||this;return Object.assign(n,t),n}return b(t,e),t.prototype.logout=function(e,t,n){Oe().logout(this,e,t,n)},t.prototype.invoke=function(e,t,n){this.logout(e,t,n)},t.prototype.cancel=function(){},t}(t.BaseAction),Ee=function(){return he.get(m.CATEGORY.WEBSOCKET)},Te=function(e){function t(t){var n=e.call(this)||this;return Object.assign(n,t),n}return b(t,e),t.prototype.open=function(e,t){return Ee().open(this,e,t)},t.prototype.close=function(){return Ee().close(this)},t.prototype.update=function(){return Ee().update(this)},t.prototype.send=function(e){return Ee().send(this,e)},t.prototype.cancel=function(){return this.close()},t.prototype.invoke=function(e,t,n){this.open(t,n)},t.prototype.init=function(){Ee().initBinding(this)},t}(t.ApiAwareVariable),Ce=function(){function e(){}return e.create=function(e,n){var i;switch(e.category){case t.VARIABLE_CONSTANTS.CATEGORY.MODEL:i=new t.ModelVariable(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.SERVICE:i=new t.ServiceVariable(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.LIVE:i=new t.LiveVariable(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.CRUD:i=new t.CrudVariable(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.DEVICE:i=new ge(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.NAVIGATION:i=new ye(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.NOTIFICATION:i=new we(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.LOGIN:i=new _e(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.LOGOUT:i=new Se(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.TIMER:i=new t.TimerAction(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.WEBSOCKET:i=new Te(e)}return i._context=n,i.__cloneable__=!1,i},e}(),Ae=function(){function e(e){this.$http=e,this.CONTEXT_APP="app"}return e.prototype.isLoaded=function(){return!!this.metadataMap&&this.metadataMap.has(this.CONTEXT_APP)},e.prototype.load=function(e){var t,i=this;return t=n.hasCordova()?"metadata/"+(e?"prefabs/"+e+"/":"app/")+"service-definitions.json":"./services/"+(e?"prefabs/"+e+"/":"")+"servicedefs",new Promise((function(n,o){i.$http.send({url:t,method:"GET"}).then((function(t){i.metadataMap=i.metadataMap||new Map,i.providerMap=i.providerMap||new Map,t.body=t.body||{},i.metadataMap.set(e||i.CONTEXT_APP,t.body.serviceDefs),t.body.securityDefinitions&&i.providerMap.set(e||i.CONTEXT_APP,t.body.securityDefinitions.oauthProvider),n(t.body.serviceDefs)}),o)}))},e.prototype.getByOperationId=function(e,t){t=t||this.CONTEXT_APP;var n=this.metadataMap.get(t);return n&&n[e]},e.prototype.getByProviderId=function(e,t){t=t||this.CONTEXT_APP;var n=this.providerMap.get(t);return n&&n[e]},e.prototype.getByCrudId=function(e,t){t=t||this.CONTEXT_APP;var n=this.metadataMap.get(t),i=[];for(var o in n)n[o]&&n[o].crudOperationId===e&&i.push(n[o]);return i},e}();Ae.decorators=[{type:r.Injectable}],Ae.ctorParameters=function(){return[{type:n.AbstractHttpService}]};var Re=function(){function t(){}return t.prototype.format=function(t,n){return e.appManager.getPipe("date").transform(t,n)},t}(),Ie=function(){function e(e,n,i,o,r,a,s,l){this.httpService=e,this.metadataService=n,this.navigationService=i,this.routerService=o,this.toasterService=r,this.oAuthService=a,this.securityService=s,this.dialogService=l,R("http",this.httpService),R("metadata",this.metadataService),R("navigationService",this.navigationService),R("router",this.routerService),R("toaster",this.toasterService),R("oAuth",this.oAuthService),R("security",this.securityService),R("dialog",this.dialogService),t.wmSetDependency("oAuth",this.oAuthService),t.wmSetDependency("security",this.securityService),t.wmSetDependency("metadata",this.metadataService)}return e.prototype.bulkCancel=function(e){Object.keys(e).forEach((function(t){var n=e[t];_.isFunction(n.cancel)&&n.cancel()}))},e.prototype.triggerStartUpdate=function(e){return Promise.all(Object.keys(e).map((function(t){return e[t]})).filter((function(e){return(null==e?void 0:e.startUpdate)&&e.invoke})).map((function(e){return e.invoke()})))},e.prototype.processBindExp=function(e,i,o){var r=t.getTarget(o),a=t.getTargetNodeKey(e.target),s=_.isArray(e.value)?e.value[0]:e.value;return s&&(s.startsWith&&s.startsWith("bind:")?s=n.$watch(s.replace("bind:",""),i,{},o.invokeOnParamChange.bind(o,e),void 0,void 0,void 0,(function(){return o.isMuted})):_.isUndefined(e.value)||(t.setValueToNode(e.target,e,r,o,e.value,!0),r!==a&&(t.internalBoundNodeMap.has(o)||t.internalBoundNodeMap.set(o,{}),_.set(t.internalBoundNodeMap.get(o),[o.name,r,e.target],e.value)))),{name:e.target,value:s}},e.prototype.processBinding=function(e,t,n,i){var o=this;i=i||"dataBinding";var r=e[n=n||"dataBinding"];e[n]={},e["_bind"+n]=r,r&&_.isArray(r)&&r.forEach((function(n){"wm.Variable"===e.category&&"dataBinding"===n.target&&(n.target="dataSet"),o.processBindExp(n,t,e)}))},e.prototype.isVariableSeperated=function(e,t){return"wm.Variable"===e[t].category||"wm.ServiceVariable"===e[t].category||"wm.LiveVariable"===e[t].category||"wm.CrudVariable"===e[t].category},e.prototype.getBindSourceTarget=function(e){return"wm.LiveVariable"===e.category?"read"===e.operation?"filterFields":"inputFields":"wm.ModelVariable"===e.category?"dataSet":"dataBinding"},e.prototype.register=function(e,i,o){var r,a=this,s={Variables:{},Actions:{},callback:this.triggerStartUpdate};for(var l in i){if((r=Ce.create(i[l],o)).init(),this.isVariableSeperated(i,l)&&(this.processBinding(r,o,"dataBinding",this.getBindSourceTarget(r)),r.httpService=this.httpService,r.dateFormatter=new Re,r.subscribe("afterInvoke",(function(){return n.$invokeWatchers(!0)})),"wm.LiveVariable"===r.category&&"read"===r.operation&&n.processFilterExpBindNode(r._context,r.filterExpressions,r),"wm.CrudVariable"!==r.category&&"wm.ServiceVariable"!==r.category||(r.simulateFileDownload=W)),this.isVariableSeperated(i,l)||"wm.TimerVariable"===i[l].category)for(var c in m.EVENT)r[m.EVENT[c]]&&(r[m.EVENT[c]]=n.$parseEvent(r[m.EVENT[c]]));r instanceof t.BaseAction?s.Actions[l]=r:s.Variables[l]=r}return o.registerDestroyListener&&o.registerDestroyListener((function(){a.bulkCancel(s.Variables),a.bulkCancel(s.Actions)})),s},e.prototype.destroy=function(){},e.prototype.registerDependency=function(e,n){R(e,n),t.wmSetDependency(e,n)},e}();Ie.decorators=[{type:r.Injectable}],Ie.ctorParameters=function(){return[{type:n.AbstractHttpService},{type:Ae},{type:n.AbstractNavigationService},{type:a.Router},{type:n.AbstractToasterService},{type:s.OAuthService},{type:l.SecurityService},{type:n.AbstractDialogService}]};var De=u.ToastrModule.forRoot({maxOpened:1,autoDismiss:!0}),Ne=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[Ie,Ae,c.Location,{provide:c.LocationStrategy,useClass:c.HashLocationStrategy}]}},e}();Ne.decorators=[{type:r.NgModule,args:[{imports:[c.CommonModule,De,p.HttpClientModule,d.HttpServiceModule,s.OAuthModule,l.SecurityModule],declarations:[]}]}],e.$rootScope=v,e.CONSTANTS=h,e.DB_CONSTANTS={DATABASE_MATCH_MODES:{like:"LIKE",start:"STARTING_WITH",startignorecase:"STARTING_WITH_IGNORECASE",end:"ENDING_WITH",endignorecase:"ENDING_WITH_IGNORECASE",anywhere:"CONTAINING",anywhereignorecase:"CONTAINING_IGNORECASE",nowhere:"DOES_NOT_CONTAIN",nowhereignorecase:"DOES_NOT_CONTAIN_IGNORECASE",exact:"EQUALS",exactignorecase:"EQUALS_IGNORECASE",notequals:"NOT_EQUALS",notequalsignorecase:"NOT_EQUALS_IGNORECASE",between:"BETWEEN",in:"IN",notin:"NOTIN",lessthan:"LESS_THAN",lessthanequal:"LESS_THAN_OR_EQUALS",greaterthan:"GREATER_THAN",greaterthanequal:"GREATER_THAN_OR_EQUALS",null:"NULL",isnotnull:"IS_NOT_NULL",empty:"EMPTY",isnotempty:"IS_NOT_EMPTY",nullorempty:"NULL_OR_EMPTY"},DATABASE_EMPTY_MATCH_MODES:["NULL","IS_NOT_NULL","EMPTY","IS_NOT_EMPTY","NULL_OR_EMPTY"],DATABASE_RANGE_MATCH_MODES:["IN","NOTIN","BETWEEN","LESS_THAN","LESS_THAN_OR_EQUALS","GREATER_THAN","GREATER_THAN_OR_EQUALS","NOT_EQUALS"],DATABASE_NULL_EMPTY_MATCH:{NULL:"NULL",IS_NOT_NULL:"IS_NOT_NULL",EMPTY:"NULL",IS_NOT_EMPTY:"IS_NOT_NULL",NULL_OR_EMPTY:"NULL"},DATABASE_MATCH_MODES_WITH_QUERY:{LIKE:"${0} like ${1}",STARTING_WITH:"${0} like ${1}",STARTING_WITH_IGNORECASE:"${0} like ${1}",ENDING_WITH:"${0} like ${1}",ENDING_WITH_IGNORECASE:"${0} like ${1}",CONTAINING:"${0} like ${1}",CONTAINING_IGNORECASE:"${0} like ${1}",DOES_NOT_CONTAIN:"${0} not like ${1}",DOES_NOT_CONTAIN_IGNORECASE:"${0} not like ${1}",EQUALS:"${0}=${1}",EQUALS_IGNORECASE:"${0}=${1}",NOT_EQUALS:"${0}!=${1}",NOT_EQUALS_IGNORECASE:"${0}!=${1}",BETWEEN:"${0} between ${1}",IN:"${0} in ${1}",NOTIN:"${0} not in ${1}",LESS_THAN:"${0}<${1}",LESS_THAN_OR_EQUALS:"${0}<=${1}",GREATER_THAN:"${0}>${1}",GREATER_THAN_OR_EQUALS:"${0}>=${1}",NULL:"${0} is null",IS_NOT_NULL:"${0} is not null",EMPTY:"${0}=''",IS_NOT_EMPTY:"${0}<>''",NULL_OR_EMPTY:"${0} is null or ${0}=''"},DATABASE_STRING_MODES:["LIKE","STARTING_WITH","STARTING_WITH_IGNORECASE","ENDING_WITH","ENDING_WITH_IGNORECASE","CONTAINING","CONTAINING_IGNORECASE","DOES_NOT_CONTAIN","DOES_NOT_CONTAIN_IGNORECASE","EQUALS","EQUALS_IGNORECASE","NOT_EQUALS","NOT_EQUALS_IGNORECASE"]},e.DeviceVariableManager=ne,e.DeviceVariableService=me,e.Formatter=Re,e.MetadataService=Ae,e.SWAGGER_CONSTANTS=g,e.VARIABLE_CONSTANTS=m,e.VARIABLE_URLS={DATABASE:{searchTableData:{url:"/:service/:dataModelName/:entityName/search?page=:page&size=:size&:sort",method:"POST"},searchTableDataWithQuery:{url:"/:service/:dataModelName/:entityName/filter?page=:page&size=:size&:sort",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"}},readTableData:{url:"/:service/:dataModelName/:entityName?page=:page&size=:size&:sort",method:"GET"},insertTableData:{url:"/:service/:dataModelName/:entityName",method:"POST"},insertMultiPartTableData:{url:"/:service/:dataModelName/:entityName",method:"POST",headers:{}},updateTableData:{url:"/:service/:dataModelName/:entityName/:id",method:"PUT"},updateMultiPartTableData:{url:"/:service/:dataModelName/:entityName/:id",method:"POST",headers:{}},deleteTableData:{url:"/:service/:dataModelName/:entityName/:id",method:"DELETE"},updateCompositeTableData:{url:"/:service/:dataModelName/:entityName/composite-id?:id",method:"PUT"},periodUpdateCompositeTableData:{url:"/:service/:dataModelName/:entityName/composite-id/periods?:id",method:"PUT"},updateMultiPartCompositeTableData:{url:"/:service/:dataModelName/:entityName/composite-id?:id",method:"POST",headers:{}},deleteCompositeTableData:{url:"/:service/:dataModelName/:entityName/composite-id?:id",method:"DELETE"},periodDeleteCompositeTableData:{url:"/:service/:dataModelName/:entityName/composite-id/periods?:id",method:"DELETE"},getDistinctDataByFields:{url:"/:service/:dataModelName/:entityName/aggregations?page=:page&size=:size&:sort",method:"POST"},exportTableData:{url:"/services/:dataModelName/:entityName/export?:sort",method:"POST"},readTableRelatedData:{url:"/:service/:dataModelName/:entityName/:id/:relatedFieldName?page=:page&size=:size&:sort",method:"GET"},executeNamedQuery:{url:"/:service/:dataModelName/queryExecutor/queries/:queryName?page=:page&size=:size&:queryParams",method:"GET"},executeCustomQuery:{url:"/:service/:dataModelName/queries/execute?page=:page&size=:size",method:"POST"},executeAggregateQuery:{url:"/services/:dataModelName/:entityName/aggregations?page=:page&size=:size&sort=:sort",method:"POST"},executeNamedProcedure:{url:"/:service/:dataModelName/procedureExecutor/procedure/execute/:procedureName?page=:page&size=:size&:procedureParams",method:"GET"},countTableDataWithQuery:{url:"/:service/:dataModelName/:entityName/count?:queryParams",method:"GET"}},oauthConfiguration:{getAuthorizationUrl:{url:"services/oauth2/:providerId/authorizationUrl",method:"GET"}}},e.VariableManagerFactory=he,e.VariablesModule=Ne,e.VariablesService=Ie,e.WS_CONSTANTS=f,e.debounceVariableCall=z,e.formatDate=K,e.formatExportExpression=function(e){return _.forEach(e,(function(e){e.expression&&(e.expression="${"+e.expression+"}")})),e},e.getEvaluatedOrderBy=function(e,t){var n,i;return!t||_.isEmpty(t)?e:e?(e=_.split(e,","),t=_.split(t,","),n=_.map(t,(function(e){return _.split(_.trim(e)," ")[0]})),_.remove(e,(function(e){return _.includes(n,_.split(_.trim(e)," ")[0])})),i=e.length?","+_.join(e,","):"",_.join(t,",")+i):t},e.initiateCallback=I,e.isFileUploadSupported=q,e.processBinding=U,e.setDependency=R,e.setInput=function(e,t,i,o){e=e||{};var r,a,s={};if(_.isObject(o))switch(o.type){case"file":i=n.getBlob(i,o.contentType);break;case"number":i=_.isNumber(i)?i:parseInt(i,10)}return _.isObject(t)?s=t:t.indexOf(".")>-1?(a=(r=t.split(".")).pop(),e=n.findValueOf(e,r.join("."),!0),s[t=a]=i):s[t]=i,_.forEach(s,(function(t,n){e[n]=t})),e},e.simulateFileDownload=W,e.toastrModule=De,e["\u0275a"]=Z,e["\u0275b"]=Q,e["\u0275c"]=X,e["\u0275d"]=J,e["\u0275e"]=ee,e["\u0275f"]=te,e["\u0275g"]=pe,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@awesome-cordova-plugins/file/ngx"),require("@wm/core"),require("@wm/mobile/core"),require("@wm/security"),require("@awesome-cordova-plugins/app-version/ngx"),require("@awesome-cordova-plugins/sqlite/ngx"),require("@wm/variables"),require("@awesome-cordova-plugins/app-version/ngx/index"),require("@awesome-cordova-plugins/file/ngx/index"),require("@awesome-cordova-plugins/sqlite/ngx/index"),require("rxjs"),require("@wavemaker/variables")):"function"==typeof define&&define.amd?define("@wm/mobile/offline",["exports","@angular/core","@angular/common","@awesome-cordova-plugins/file/ngx","@wm/core","@wm/mobile/core","@wm/security","@awesome-cordova-plugins/app-version/ngx","@awesome-cordova-plugins/sqlite/ngx","@wm/variables","@awesome-cordova-plugins/app-version/ngx/index","@awesome-cordova-plugins/file/ngx/index","@awesome-cordova-plugins/sqlite/ngx/index","rxjs","@wavemaker/variables"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.mobile=e.wm.mobile||{},e.wm.mobile.offline={}),e.ng.core,e.ng.common,e.awesomeCordova.plugins,e.wm.core,e.wm.mobile.core,e.wm.security,e.awesomeCordova.plugins,e.awesomeCordova.plugins,e.wm.variables,e.awesomeCordova.plugins,e.awesomeCordova.plugins,e.awesomeCordova.plugins,e.rxjs,e.wm_common_variables)}(this,(function(e,t,n,i,o,r,a,s,l,c,p,u,d,h,m){"use strict";function f(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 g=f(t),v=f(o),y=f(r),b=f(a),w=f(p),P=f(u),O=f(d),S=function(){function e(){}return e.prototype.get=function(e){return this.fetchEntry(e).then((function(e){var t;return e&&e.length>0&&(t=e[0].value)&&(t=JSON.parse(t)),t}))},e.prototype.init=function(e){this.store=e},e.prototype.put=function(e,t){var n=this;return t&&(t=JSON.stringify(t)),this.fetchEntry(e).then((function(i){return i&&i.length>0?n.store.save({id:i[0].id,key:e,value:t}):n.store.add({key:e,value:t})}))},e.prototype.remove=function(e){var t=this;return this.fetchEntry(e).then((function(e){if(e&&e.length>0)return t.store.delete(e[0].id)}))},e.prototype.fetchEntry=function(e){var t=[{attributeName:"key",attributeValue:e,attributeType:"STRING",filterCondition:"EQUALS"}];return this.store.filter(t)},e}();S.SERVICE_NAME="LocalKeyValueService",S.\u0275prov=g.\u0275\u0275defineInjectable({factory:function(){return new S},token:S,providedIn:"root"}),S.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}];var E,T="WM_LOCAL_OFFLINE_CALL",C=function(e){if(e)return'"'+(e=e.replace(/"/g,'""'))+'"'},A=function(e){var t=[],n=[];return _.forEach(e.columns,(function(e){t.push(C(e.name)),n.push("?")})),"INSERT INTO "+C(e.name)+" ("+t.join(",")+") VALUES ("+n.join(",")+")"},R=function(e){var t=[],n=[];return _.forEach(e.columns,(function(e){t.push(C(e.name)),n.push("?")})),"REPLACE INTO "+C(e.name)+" ("+t.join(",")+") VALUES ("+n.join(",")+")"},I=function(e){var t=_.find(e.columns,"primaryKey");return t?"DELETE FROM "+C(e.name)+" WHERE "+C(t.name)+" = ?":""},D=function(e){var t=[],n=[];return e.columns.forEach((function(i){var o;t.push(C(e.name)+"."+C(i.name)+" as "+i.fieldName),i.foreignRelations&&i.foreignRelations.forEach((function(r){o=r.sourceFieldName,_.forEach(r.dataMapper,(function(e,n){t.push(o+"."+C(e.name)+" as '"+n+"'")})),n.push(" LEFT JOIN "+C(r.targetTable)+" "+o+"\n ON "+o+"."+C(r.targetColumn)+" = "+C(e.name)+"."+C(i.name))}))})),"SELECT "+t.join(",")+" FROM "+C(e.name)+" "+n.join(" ")},N=function(e){var t=[];return e.columns.forEach((function(n){var i;n.foreignRelations&&n.foreignRelations.forEach((function(o){i=o.sourceFieldName,t.push(" LEFT JOIN "+C(o.targetTable)+" "+i+"\n ON "+i+"."+C(o.targetColumn)+" = "+C(e.name)+"."+C(n.name))}))})),"SELECT count(*) as count FROM "+C(e.name)+" "+t.join(" ")},x=function(e,t){var n,i=e.fieldToColumnMapping,o=e.entitySchema.name;return!_.isEmpty(t)&&_.isString(t)?" WHERE "+t:(t&&(n=t.map((function(e){var t=i[e.attributeName],n=e.filterCondition,r=e.attributeValue,a="=";return"STRING"===e.attributeType?("STARTING_WITH"===n?(r+="%",a="like"):"ENDING_WITH"===n?(r="%"+r,a="like"):"CONTAINING"===n&&(r="%"+r+"%",a="like"),r="'"+r+"'"):"BOOLEAN"===e.attributeType&&(r=!0===r?1:0),C(o)+"."+C(t)+" "+a+" "+r}))),n&&n.length>0?" WHERE "+n.join(" AND "):"")},k=function(e,t){return t?" ORDER BY "+_.map(t.split(","),(function(t){var n=_.trim(t).split(" ");return n[0]=C(e.entitySchema.name)+"."+C(e.fieldToColumnMapping[n[0]]),n.join(" ")})).join(","):""},M=function(e){return" LIMIT "+((e=e||{}).limit||100)+" OFFSET "+(e.offset||0)},L=function(e,t){return e.columns.forEach((function(e){var n=t[e.fieldName];e.foreignRelations?e.foreignRelations.forEach((function(e){var n=null;_.forEach(e.dataMapper,(function(e,i){var r=t[i];o.isDefined(r)&&null!==r&&""!==r&&((n=n||{})[e.fieldName]=t[i]),delete t[i]})),t[e.sourceFieldName]=n})):"boolean"!==e.sqlType||_.isNil(n)||(t[e.fieldName]=1===n)})),t},F=function(e,t){var n=e[t.fieldName];return t.foreignRelations&&t.foreignRelations.some((function(t){return!(!t.targetEntity||!e[t.sourceFieldName])&&(n=e[t.sourceFieldName][t.targetFieldName],!0)})),_.isNil(n)?t.defaultValue:"boolean"===t.sqlType?!0===n?1:0:n},j=function(e,t){var n={};return e.entitySchema.columns.forEach((function(e){return n[e.name]=F(t,e)})),n},B=function(){function e(e,t,n,i,o){var r=this;this.deviceFileService=e,this.entitySchema=t,this.file=n,this.localDbManagementService=i,this.sqliteObject=o,this.fieldToColumnMapping={},this.primaryKeyField=_.find(this.entitySchema.columns,"primaryKey"),this.primaryKeyName=this.primaryKeyField?this.primaryKeyField.fieldName:void 0,this.entitySchema.columns.forEach((function(e){r.fieldToColumnMapping[e.fieldName]=e.name,e.foreignRelations&&e.foreignRelations.forEach((function(t){r.fieldToColumnMapping[t.targetPath]=e.name,_.forEach(t.dataMapper,(function(e,n){r.fieldToColumnMapping[n]=t.sourceFieldName+"."+e.name}))}))})),this.insertRecordSqlTemplate=A(this.entitySchema),this.replaceRecordSqlTemplate=R(this.entitySchema),this.deleteRecordTemplate=I(this.entitySchema),this.selectSqlTemplate=D(this.entitySchema),this.countQuery=N(this.entitySchema)}return e.prototype.add=function(e){if(this.primaryKeyName){var t=e[this.primaryKeyName];if("number"===this.primaryKeyField.sqlType&&(!o.isDefined(t)||_.isString(t)&&_.isEmpty(_.trim(t))))if("identity"===this.primaryKeyField.generatorType)e[this.primaryKeyName]=this.localDbManagementService.nextIdCount();else{var n=this.getValue(e,this.primaryKeyName);e[this.primaryKeyName]=n}}var i=j(this,e),r=this.entitySchema.columns.map((function(e){return i[e.name]}));return this.sqliteObject.executeSql(this.insertRecordSqlTemplate,r).then((function(e){return e.insertId}))},e.prototype.clear=function(){return this.sqliteObject.executeSql("DELETE FROM "+C(this.entitySchema.name))},e.prototype.create=function(){var e=this;return this.sqliteObject.executeSql(this.createTableSql(this.entitySchema)).then((function(){return e}))},e.prototype.count=function(e){var t=this.countQuery+x(this,e);return this.sqliteObject.executeSql(t).then((function(e){return e.rows.item(0).count}))},e.prototype.deserialize=function(e){return this.deserializeMapToFormData(e)},e.prototype.filter=function(e,t,n){var i=this,o=this.selectSqlTemplate;return o+=x(this,e),o+=k(this,t),o+=M(n),this.sqliteObject.executeSql(o).then((function(e){for(var t=[],n=e.rows.length,o=0;o<n;o++)t.push(L(i.entitySchema,e.rows.item(o)));return t}))},e.prototype.refresh=function(e){var t=this.primaryKeyName,n=this.getValue(e,t);return n?this.get(n):Promise.resolve(e)},e.prototype.delete=function(e){return this.sqliteObject.executeSql(this.deleteRecordTemplate,[e])},e.prototype.get=function(e){var t=[{attributeName:this.primaryKeyName,filterCondition:"=",attributeValue:e,attributeType:this.primaryKeyField.sqlType.toUpperCase()}];return this.filter(t).then((function(e){return e&&1===e.length?e[0]:void 0}))},e.prototype.getValue=function(e,t){var n=this.entitySchema.columns.find((function(e){return e.fieldName===t}));return F(e,n)},e.prototype.save=function(e){return this.saveAll([e])},e.prototype.saveAll=function(e){var t=this;e=_.filter(e,null);var n=_.map(e,(function(e){var n=j(t,e),i=t.entitySchema.columns.map((function(e){return n[e.name]}));return[t.replaceRecordSqlTemplate,i]}));return this.sqliteObject.sqlBatch(n)},e.prototype.serialize=function(e){return this.serializeFormDataToMap(e)},e.prototype.saveBlobToFile=function(e){var t=this.deviceFileService.appendToFileName(e.name),n=this.deviceFileService.getUploadDirectory();return this.file.writeFile(n,t,e).then((function(){return{name:e.name,type:e.type,lastModified:e.lastModified,lastModifiedDate:e.lastModifiedDate,size:e.size,wmLocalPath:n+"/"+t}}))},e.prototype.serializeFormDataToMap=function(e){var t=this,n=_.filter(this.entitySchema.columns,{sqlType:"blob"}),i=[],o={};return e&&"function"==typeof e.append&&e.rowData?_.forEach(e.rowData,(function(e,r){e&&_.find(n,{fieldName:r})?i.push(t.saveBlobToFile(e).then((function(e){o[r]=e}))):o[r]=e})):o=e,Promise.all(i).then((function(){return o}))},e.prototype.deserializeMapToFormData=function(e){var t=new FormData,n=this.entitySchema.columns.filter((function(e){return"blob"===e.sqlType})),i=[];return _.forEach(n,(function(n){var r=e[n.fieldName];r&&r.wmLocalPath&&(i.push(o.convertToBlob(r.wmLocalPath).then((function(e){return t.append(n.fieldName,e.blob,r.name)}))),e[n.fieldName]="")})),t.append(c.SWAGGER_CONSTANTS.WM_DATA_JSON,new Blob([JSON.stringify(e)],{type:"application/json"})),Promise.all(i).then((function(){return t}))},e.prototype.createTableSql=function(e){var t=_.reduce(e.columns,(function(e,t){var n=C(t.name);return t.primaryKey&&("number"===t.sqlType&&"databaseIdentity"===t.generatorType?n+=" INTEGER PRIMARY KEY AUTOINCREMENT":n+=" PRIMARY KEY"),e?e+","+n:n}),!1);return"CREATE TABLE IF NOT EXISTS "+C(e.name)+" ("+t+")"},e}(),G=function(){this.schema={name:"",isInternal:!1,entities:new Map},this.stores=new Map,this.queries=new Map},V=function(e,t){this.name=e,this.fieldName=t,this.primaryKey=!1,this.fieldName=this.fieldName||this.name};!function(e){e.LIVE="LIVE",e.BUNDLED="BUNDLED",e.APP_START="APP_START"}(E||(E={}));var U="localDBStore.nextIdCount",W="www/metadata/app",q={name:"wavemaker",version:1,isInternal:!0,tables:[{name:"key_value",entityName:"key-value",columns:[{fieldName:"id",name:"id",generatorType:"databaseIdentity",sqlType:"number",primaryKey:!0},{fieldName:"key",name:"key"},{name:"value",fieldName:"value"}]},{name:"offlineChangeLog",entityName:"offlineChangeLog",columns:[{fieldName:"id",name:"id",generatorType:"databaseIdentity",sqlType:"number",primaryKey:!0},{name:"service",fieldName:"service"},{name:"operation",fieldName:"operation"},{name:"params",fieldName:"params"},{name:"timestamp",fieldName:"timestamp"},{name:"hasError",fieldName:"hasError"},{name:"errorMessage",fieldName:"errorMessage"}]}]},z=function(){function e(e,t,n,i,o,r,a){var s=this;this.appVersion=e,this.deviceService=t,this.deviceFileService=n,this.file=i,this.localKeyValueService=o,this.securityService=r,this.sqlite=a,this.callbacks=[],this._logSql=!1,this.nextId=1e11,this.systemProperties={USER_ID:{name:"USER_ID",value:function(){return s.securityService.getLoggedInUser().then((function(e){return e.userId}))}},USER_NAME:{name:"USER_NAME",value:function(){return s.securityService.getLoggedInUser().then((function(e){return e.userName}))}},DATE_TIME:{name:"DATE_TIME",value:function(){return moment().format("YYYY-MM-DDThh:mm:ss")}},DATE:{name:"CURRENT_DATE",value:function(){return moment().format("YYYY-MM-DD")}},TIME:{name:"TIME",value:function(){return moment().format("hh:mm:ss")}}}}return e.prototype.close=function(){var e=this;return new Promise((function(t,n){setTimeout((function(){var i=_.map(_.values(e.databases),(function(e){return e.sqliteObject.close()}));Promise.all(i).then(t,n)}),1e3)}))},e.prototype.nextIdCount=function(){return this.nextId=this.nextId+1,this.localKeyValueService.put(U,this.nextId),this.nextId},e.prototype.executeNamedQuery=function(e,t,n){var i,r,a=this;return this.databases[e]&&this.databases[e].queries[t]?(i=this.databases[e].queries[t],r=_.chain(i.params).filter((function(e){return"PROMPT"!==e.variableType})).forEach((function(e){var t=a.systemProperties[e.variableType].value(e.name,n);return o.toPromise(t).then((function(t){return n[e.name]=t}))})).value(),Promise.all(r).then((function(){return n=_.map(i.params,(function(e){return"string"==typeof n[e.name]||e.type!==o.DataType.DATETIME&&e.type!==o.DataType.LOCALDATETIME?e.type===o.DataType.BOOLEAN?a.convertBoolToInt(n[e.name]):n[e.name]:c.formatDate(n[e.name],e.type)})),a.executeSQLQuery(e,i.query,n).then((function(e){var t,n;return _.isEmpty(e.rows)||(t=e.rows[0],n=_.find(i.response.properties,(function(e){return!t.hasOwnProperty(e.fieldName)})),_.isUndefined(n)||(e.rows=_.map(e.rows,(function(e){var t={},n={};return _.forEach(e,(function(e,t){return n[t.toUpperCase()]=e})),_.forEach(i.response.properties,(function(i){var r=o.extractType(i.fieldType.typeRef),s=(o.DEFAULT_FORMATS[_.toUpper(r)],e[i.name]);!s||"string"==typeof s||r!==o.DataType.DATETIME&&r!==o.DataType.LOCALDATETIME&&r!==o.DataType.DATE||(moment(s).isValid()?e[i.name]=c.formatDate(s,r):moment(s,"HH:mm").isValid()&&(e[i.name]=moment().format("YYYY-MM-DD")+"T"+s)),r===o.DataType.BOOLEAN&&(e[i.name]=a.convertIntToBool(s)),n[i.nameInUpperCase]=e[i.name],t[i.name]=e[i.name],t[i.fieldName]=e[i.fieldName]||n[i.nameInUpperCase]})),t})))),e}))}))):Promise.reject("Query by name ' "+t+" ' Not Found")},e.prototype.exportDB=function(){var e=this;return new Promise((function(t,n){var i,r="offline_temp_"+_.now(),a=cordova.file.cacheDirectory+r+"/",s={app:null,OS:"",createdOn:0};i=o.isIos()?cordova.file.documentsDirectory:cordova.file.externalRootDirectory+"Download/",e.file.createDir(cordova.file.cacheDirectory,r,!1).then((function(){return e.file.copyDir(e.dbInstallParentDirectory,e.dbInstallDirectoryName,a,"databases").then((function(){return e.getAppInfo()})).then((function(e){return s.app=e,o.isIos()?s.OS="IOS":o.isAndroid()&&(s.OS="ANDROID"),s.createdOn=_.now(),s})).then((function(){return o.executePromiseChain(e.getCallbacksFor("preExport"),[a,s])})).then((function(){return e.file.writeFile(a,"META.json",JSON.stringify(s))}))})).then((function(){var t=s.app.name;return t=t.replace(/\s+/g,"_"),e.deviceFileService.newFileName(i,t+"_offline_data.zip").then((function(e){return new Promise((function(t,n){Zeep.zip({from:a,to:i+e},(function(){return t(i+e)}),n)}))}))})).then(t,n).catch(o.noop).then((function(){return e.deviceFileService.removeDir(cordova.file.cacheDirectory+r)}))}))},e.prototype.getStore=function(e,t){var n=this;return new Promise((function(i,o){n.databases[e]&&i(n.databases[e].stores[t]),o("store with name'"+t+"' in datamodel '"+e+"' is not found")}))},e.prototype.importDB=function(e,t){var n=this;return new Promise((function(i,r){var a,s="offline_temp_"+_.now(),l=cordova.file.cacheDirectory+s+"/";n.file.createDir(cordova.file.cacheDirectory,s,!1).then((function(){return new Promise((function(t,n){Zeep.unzip({from:e,to:l},t,n)}))})).then((function(){return n.file.readAsText(l,"META.json").then((function(e){return a=JSON.parse(e),n.getAppInfo()})).then((function(e){return a.app?a.app.packageName!==e.packageName?Promise.reject("database zip of app with same package name can only be imported"):void 0:Promise.reject("meta information is not found in zip")}))})).then((function(){var e;return n.close().then((function(){if(t)return n.exportDB().then((function(t){return e=t}))})).then((function(){return n.deviceFileService.removeDir(n.dbInstallDirectory)})).then((function(){return n.file.copyDir(l,"databases",n.dbInstallParentDirectory,n.dbInstallDirectoryName)})).then((function(){return n.databases=null,n.loadDatabases()})).then((function(){return o.executePromiseChain(n.getCallbacksFor("postImport"),[l,a])})).then((function(){if(e)return n.deviceFileService.removeFile(e)}),(function(t){return e?n.importDB(e,!1).then((function(){return n.deviceFileService.removeFile(e),Promise.reject(t)})):Promise.reject(t)}))})).then(i,r).catch(o.noop).then((function(){return n.deviceFileService.removeDir(cordova.file.cacheDirectory+s)}))}))},e.prototype.isOperationAllowed=function(e,t,n){return this.getStore(e,t).then((function(e){return!!e&&("READ"===n?e.entitySchema.pushConfig.readEnabled:"INSERT"===n?e.entitySchema.pushConfig.insertEnabled:"UPDATE"===n?e.entitySchema.pushConfig.updateEnabled:"DELETE"===n&&e.entitySchema.pushConfig.deleteEnabled)})).catch((function(){return!1}))},e.prototype.loadDatabases=function(){var e=this,t=!1;return this.databases?Promise.resolve(this.databases):(o.isIos()?(this.dbInstallDirectoryName="LocalDatabase",this.dbInstallParentDirectory=cordova.file.applicationStorageDirectory+"Library/"):(this.dbInstallDirectoryName="databases",this.dbInstallParentDirectory=cordova.file.applicationStorageDirectory),this.dbInstallDirectory=this.dbInstallParentDirectory+this.dbInstallDirectoryName,this.databases=new Map,this.setUpDatabases().then((function(e){return t=e})).then((function(){return e.loadDBSchemas()})).then((function(t){return e.loadNamedQueries(t)})).then((function(t){return e.loadOfflineConfig(t)})).then((function(t){return Promise.all(_.map(t,(function(t){return e.openDatabase(t).then((function(n){e.databases[t.schema.name]=n}))})))})).then((function(){return e.getStore("wavemaker","key-value").then((function(t){return e.localKeyValueService.init(t),e.localKeyValueService.get(U).then((function(t){e.nextId=t||e.nextId}))}))})).then((function(){return t?e.normalizeData().then((function(){return e.disableForeignKeys()})).then((function(){return e.deviceService.getAppBuildTime()})).then((function(t){return o.executePromiseChain(_.map(e.callbacks,"onDbCreate"),[{databases:e.databases,dbCreatedOn:_.now(),dbSeedCreatedOn:t}])})).then((function(){return e.databases})):e.databases})))},e.prototype.registerCallback=function(e){this.callbacks.push(e)},e.prototype.setLogSQl=function(e){this._logSql=e},e.prototype.cleanAndCopyDatabases=function(){var e=this,t=cordova.file.applicationDirectory+W;return this.file.createDir(this.dbInstallParentDirectory,this.dbInstallDirectoryName,!1).catch(o.noop).then((function(){return e.deviceFileService.listFiles(e.dbInstallDirectory,/.+\.db$/)})).then((function(t){if(t&&t.length>0)return Promise.all(t.map((function(t){if("wavemaker.db"!==t.name)return e.file.removeFile(e.dbInstallDirectory,t.name)})))})).then((function(){return e.deviceFileService.listFiles(t,/.+\.db$/)})).then((function(n){if(n&&n.length>0)return e.file.createDir(e.dbInstallParentDirectory,e.dbInstallDirectoryName,!1).catch(o.noop).then((function(){return Promise.all(n.map((function(n){return e.file.copyFile(t,n.name,e.dbInstallDirectory,n.name)})))}))}))},e.prototype.compactEntitySchema=function(e,t,n){var i=n[t.entityName];return i.entityName=t.entityName,i.name=t.name,i.columns=[],t.columns.forEach((function(e){var t=e.columnValue?e.columnValue.defaultValue:"",n=e.sqlType;t="number"!==n||e.primaryKey?"boolean"===n?_.isEmpty(t)?null:"true"===t?1:0:_.isEmpty(t)?null:t:_.isEmpty(t)?null:_.parseInt(t),i.columns.push({name:e.name,fieldName:e.fieldName,generatorType:e.generatorType,sqlType:e.sqlType,primaryKey:e.primaryKey,defaultValue:t})})),_.forEach(t.relations,(function(t){var n,o,r,a,s;if(("ManyToOne"===t.cardinality||"OneToOne"===t.cardinality)&&(o=_.find(e.tables,(function(e){return e.name===t.targetTable})),s=t.mappings[0],o)){o=o.entityName,a=s.sourceColumn,r=i.columns.find((function(e){return e.name===a})),n=e.tables.find((function(e){return e.name===t.targetTable}));var l={sourceFieldName:t.fieldName,targetEntity:o,targetTable:t.targetTable,targetColumn:s.targetColumn,targetPath:"",dataMapper:[],targetFieldName:n.columns.find((function(e){return e.name===s.targetColumn})).fieldName};l.targetPath=l.sourceFieldName+"."+l.targetFieldName,l.dataMapper=_.chain(n.columns).keyBy((function(e){return l.sourceFieldName+"."+e.fieldName})).mapValues((function(e){return new V(e.name,e.fieldName)})).value(),r.foreignRelations=r.foreignRelations||[],r.foreignRelations.push(l)}})),i},e.prototype.compactQueries=function(e){var t=this,n=new Map;return _.forEach(e.queries,(function(e){var i,o;e.nativeSql&&"SELECT"===e.type&&(i=_.isEmpty(e.offlineQueryString)?e.queryString:e.offlineQueryString,(o=_.map(t.extractQueryParams(i),(function(t){var n=_.find(e.parameters,{name:t});return{name:n.name,type:n.type,variableType:n.variableType}}))).forEach((function(e){return i=_.replace(i,":"+e.name,"?")})),n[e.name]={name:e.name,query:i,params:o,response:{properties:_.map(e.response.properties,(function(e){return e.nameInUpperCase=e.name.toUpperCase(),e}))}})})),n},e.prototype.compactSchema=function(e){var t=this,n=new G,i=new Map;return e.tables.forEach((function(e){i[e.entityName]={}})),e.tables.forEach((function(n){t.compactEntitySchema(e,n,i)})),n.schema.name=e.name,n.schema.isInternal=e.isInternal,n.schema.entities=i,n},e.prototype.convertBoolToInt=function(e){return"true"===_.toString(e)?1:0},e.prototype.convertIntToBool=function(e){return!!e},e.prototype.disableForeignKeys=function(){var e=this;return Promise.all(_.map(this.databases,(function(t){return e.executeSQLQuery(t.schema.name,"PRAGMA foreign_keys = OFF")})))},e.prototype.executeSQLQuery=function(e,t,n,i){var o=this.databases[e];return o?o.sqliteObject.executeSql(t,n,i).then((function(e){for(var t=[],n=e.rows,i=0;i<n.length;i++)t.push(n.item(i));return{rowsAffected:e.rowsAffected,rows:t}})):Promise.reject("No Database with name "+e+" found")},e.prototype.extractQueryParams=function(e){var t;return(t=e.match(/[^"'\w\\]:\s*\w+\s*/g)||[]).length?t.map((function(e){return/[=|\W]/g.test(e)?e.replace(/\W/g,"").trim():e.trim()})):null},e.prototype.getAppInfo=function(){var e=this,t={name:"",packageName:"",versionNumber:"",versionCode:null};return this.appVersion.getPackageName().then((function(n){return t.packageName=n,e.appVersion.getAppName()})).then((function(n){return t.name=n,e.appVersion.getVersionNumber()})).then((function(n){return t.versionNumber=n,e.appVersion.getVersionCode()})).then((function(e){return t.versionCode=e,t}))},e.prototype.getCallbacksFor=function(e){return this.callbacks.map((function(t){return t[e]?t[e].bind(t):null}))},e.prototype.getMetaInfo=function(e){var t=cordova.file.applicationDirectory+W+"/";return this.deviceFileService.listFiles(t,e).then((function(e){return Promise.all(_.map(e,(function(e){return new Promise((function(n,i){$.getJSON(o.transformFileURI(t)+e.name,(function(e){return n(e)}))}))})))}))},e.prototype.isBundled=function(e,t){return this.getStore(e,t).then((function(e){return e.entitySchema.pullConfig.pullType===E.BUNDLED}))},e.prototype.loadDBSchemas=function(){var e=this;return this.getMetaInfo(/.+_dataModel\.json$/).then((function(t){var n=new Map;return(t=o.isArray(t)?t:[t]).push(q),t.map((function(t){return e.compactSchema(t)})).forEach((function(e){n[e.schema.name]=e})),n}))},e.prototype.loadNamedQueries=function(e){var t=this;return this.getMetaInfo(/.+_query\.json$/).then((function(n){return(n=_.isArray(n)?n:[n]).map((function(n){return e[n.name].queries=t.compactQueries(n)})),e}))},e.prototype.loadOfflineConfig=function(e){return this.getMetaInfo(/.+_offline\.json$/).then((function(t){return _.forEach(t,(function(t){_.forEach(t.entities,(function(n){var i=_.find(e[t.name].schema.entities,(function(e){return e.name===n.name}));_.assignIn(i,n)}))})),e}))},e.prototype.logSql=function(e){var t=this,n=console,i=e.executeSql;e.executeSql=function(o,r,a){var s=_.now();return i.call(e,o,r).then((function(e){if(a||t._logSql){for(var i=[],l=e.rows.length,c=0;c<l;c++)i.push(e.rows.item(c));n.debug('SQL "%s" with params %O took [%d ms]. And the result is %O',o,r,_.now()-s,i)}return e}),(function(e){return n.error('SQL "%s" with params %O failed with error message %s',o,r,e.message),Promise.reject(e)}))}},e.prototype.normalizeBooleanData=function(e,t,n){var i=this,o="update "+C(t)+" set "+C(n)+" = 1 where "+C(n)+" = 'true'",r="update "+C(t)+" set "+C(n)+" = 0\n where "+C(n)+" is not null and "+C(n)+" != 1";return this.executeSQLQuery(e,o).then((function(){return i.executeSQLQuery(e,r)}))},e.prototype.normalizeData=function(){var e=this;return Promise.all(_.map(this.databases,(function(t){return Promise.all(_.map(t.schema.entities,(function(n){return Promise.all(_.map(n.columns,(function(i){if("boolean"===i.sqlType)return e.normalizeBooleanData(t.schema.name,n.name,i.name)})))})))})))},e.prototype.openDatabase=function(e){var t=this;return this.sqlite.create({name:e.schema.name+".db",location:"default"}).then((function(n){e.sqliteObject=n,t.logSql(n);var i=_.map(e.schema.entities,(function(e){return new B(t.deviceFileService,e,t.file,t,n).create()}));return Promise.all(i).then((function(t){return _.forEach(t,(function(t){e.stores[t.entitySchema.entityName]=t})),e}))}))},e.prototype.setUpDatabases=function(){var e=this;return this.deviceService.getAppBuildTime().then((function(t){var n=e.deviceService.getEntry("database")||{};return(!n.lastBuildTime||n.lastBuildTime!==t)&&e.cleanAndCopyDatabases().then((function(){return n.lastBuildTime=t,e.deviceService.storeEntry("database",n)})).then((function(){return!0}))}))},e}();z.SERVICE_NAME="LocalDBManagementService",z.\u0275prov=g.\u0275\u0275defineInjectable({factory:function(){return new z(g.\u0275\u0275inject(w.AppVersion),g.\u0275\u0275inject(y.DeviceService),g.\u0275\u0275inject(y.DeviceFileService),g.\u0275\u0275inject(P.File),g.\u0275\u0275inject(S),g.\u0275\u0275inject(b.SecurityService),g.\u0275\u0275inject(O.SQLite))},token:z,providedIn:"root"}),z.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],z.ctorParameters=function(){return[{type:s.AppVersion},{type:r.DeviceService},{type:r.DeviceFileService},{type:i.File},{type:S},{type:a.SecurityService},{type:l.SQLite}]};var H=function(){},Y="changeLogService.flushContext",K="changeLogService.lastPushInfo",Q=function(){function e(e,t,n,i){this.localDBManagementService=e,this.localKeyValueService=t,this.pushService=n,this.networkService=i,this.workers=[],this.currentPushInfo={},this.addWorker(new X(this,this.localKeyValueService,this.currentPushInfo))}return e.prototype.add=function(e,t,n){var i=this,r={service:e,operation:t,params:n,hasError:0};return o.executePromiseChain(this.getWorkers("transformParamsToMap"),[r]).then((function(){return o.executePromiseChain(i.getWorkers("onAddCall"),[r])})).then((function(){return r.params=JSON.stringify(r.params),i.getStore().then((function(e){return e.add(r)})).then(o.noop)}))},e.prototype.addWorker=function(e){this.workers.push(e)},e.prototype.clearLog=function(){return this.getStore().then((function(e){return e.clear()}))},e.prototype.flush=function(e){var t,n=this;return this.deferredFlush||(this.deferredFlush=o.getAbortableDefer(),this.createContext().then((function(e){return n.flushContext=e,o.executePromiseChain(n.getWorkers("preFlush"),[n.flushContext])})).then((function(){return t=n._flush(e),n.deferredFlush.onAbort=function(){return t.abort()},t})).catch(o.noop).then((function(){Promise.resolve().then((function(){if(n.currentPushInfo.totalTaskCount===n.currentPushInfo.completedTaskCount)return n.flushContext.clear().then((function(){return n.flushContext=null}))})).then((function(){e.complete(),n.currentPushInfo.failedTaskCount>0?n.deferredFlush.reject(n.currentPushInfo):n.deferredFlush.resolve(n.currentPushInfo),n.deferredFlush=null})).then((function(){return o.executePromiseChain(n.getWorkers("postFlush"),[n.currentPushInfo,n.flushContext])}))}))),this.deferredFlush.promise},e.prototype.getChanges=function(){return this.getStore().then((function(e){return e.filter(void 0,"id",{offset:0,limit:500})})).then((function(e){return e.forEach((function(e){e.params=JSON.parse(e.params)})),e}))},e.prototype.getErrors=function(){return this.getStore().then((function(e){return e.filter([{attributeName:"hasError",attributeValue:1,attributeType:"NUMBER",filterCondition:"EQUALS"}])}))},e.prototype.getLastPushInfo=function(){return this.localKeyValueService.get(K).then((function(e){return o.isString(e.startTime)&&(e.startTime=new Date(e.startTime)),o.isString(e.endTime)&&(e.endTime=new Date(e.endTime)),e}))},e.prototype.getLogLength=function(){return this.getStore().then((function(e){return e.count([{attributeName:"hasError",attributeValue:0,attributeType:"NUMBER",filterCondition:"EQUALS"}])}))},e.prototype.getStore=function(){return this.localDBManagementService.getStore("wavemaker","offlineChangeLog")},e.prototype.isFlushInProgress=function(){return!(_.isUndefined(this.deferredFlush)||_.isNull(this.deferredFlush))},e.prototype.stop=function(){var e=this;return new Promise((function(t){e.deferredFlush?(e.deferredFlush.promise.catch().then(t),e.deferredFlush.promise.abort()):t()}))},e.prototype.createContext=function(){var e=this;return this.localKeyValueService.get(Y).then((function(t){return t=t||{},{clear:function(){return t={},e.localKeyValueService.remove(Y)},get:function(e){var n=t[e];return n||(n={},t[e]=n),n},save:function(){return e.localKeyValueService.put(Y,t)}}}))},e.prototype._flush=function(e,t){var n=this;return(t=t||o.getAbortableDefer()).isAborted?Promise.resolve():(this.getNextChange().then((function(e){if(e)return e.params=JSON.parse(e.params),n.flushChange(e)})).then((function(i){if(e.next(n.currentPushInfo),i)return n.getStore().then((function(e){return e.delete(i.id)})).then((function(){return n._flush(e,t)}));t.resolve()}),(function(i){if(n.networkService.isConnected())i.hasError=1,i.params=JSON.stringify(i.params),n.getStore().then((function(e){return e.save(i)})).then((function(){return n._flush(e,t)}));else{var o=n.networkService.onConnect();t.promise.catch((function(){o&&o.abort()})),o.then((function(){n._flush(e,t),o=null}))}})),t.promise)},e.prototype.flushChange=function(e){var t=this,n=this;return o.executePromiseChain(this.getWorkers("preCall"),[e]).then((function(){return e.hasError?Promise.reject(e.errorMessage):""})).then((function(){return o.executePromiseChain(t.getWorkers("transformParamsFromMap"),[e])})).then((function(){return t.pushService.push(e)})).then((function(){return o.executePromiseChain(_.reverse(n.getWorkers("postCallSuccess")),[e,arguments]).then((function(){return e}))})).catch((function(){return n.networkService.isConnected()?o.executePromiseChain(_.reverse(n.getWorkers("postCallError")),[e,arguments]).catch(o.noop).then((function(){return Promise.reject(e)})):Promise.reject(e)}))},e.prototype.getNextChange=function(){var e=[{attributeName:"hasError",attributeValue:0,attributeType:"NUMBER",filterCondition:"EQUALS"}];return this.getStore().then((function(t){return t.filter(e,"id",{offset:0,limit:1})})).then((function(e){return e&&e[0]}))},e.prototype.getWorkers=function(e){return _.map(this.workers,(function(t){return t[e]&&t[e].bind(t)}))},e}();Q.SERVICE_NAME="ChangeLogService",Q.\u0275prov=g.\u0275\u0275defineInjectable({factory:function(){return new Q(g.\u0275\u0275inject(z),g.\u0275\u0275inject(S),g.\u0275\u0275inject(H),g.\u0275\u0275inject(y.NetworkService))},token:Q,providedIn:"root"}),Q.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],Q.ctorParameters=function(){return[{type:z},{type:S},{type:H},{type:r.NetworkService}]};var X=function(){function e(e,t,n){this.changeLogService=e,this.localKeyValueService=t,this.pushInfo=n,this.logger=window.console}return e.prototype.onAddCall=function(e){this.logger.debug("Added the following call %o to log.",e)},e.prototype.preFlush=function(e){var t=this;return this.pushInfo.totalTaskCount=0,this.pushInfo.successfulTaskCount=0,this.pushInfo.failedTaskCount=0,this.pushInfo.completedTaskCount=0,this.pushInfo.inProgress=!0,this.pushInfo.startTime=new Date,this.flushContext=e,this.logger.debug("Starting flush"),this.changeLogService.getStore().then((function(e){return e.count([{attributeName:"hasError",attributeValue:0,attributeType:"NUMBER",filterCondition:"EQUALS"}])})).then((function(e){return t.pushInfo.totalTaskCount=e}))},e.prototype.postFlush=function(e,t){this.logger.debug("flush completed. {Success : %i , Error : %i , completed : %i, total : %i }.",this.pushInfo.successfulTaskCount,this.pushInfo.failedTaskCount,this.pushInfo.completedTaskCount,this.pushInfo.totalTaskCount),this.pushInfo.inProgress=!1,this.pushInfo.endTime=new Date,this.localKeyValueService.put(K,this.pushInfo),this.flushContext=null},e.prototype.preCall=function(e){this.logger.debug("%i. Invoking call %o",1+this.pushInfo.completedTaskCount,e)},e.prototype.postCallError=function(e,t){return this.pushInfo.completedTaskCount++,this.pushInfo.failedTaskCount++,this.logger.error("call failed with the response %o.",t),this.flushContext.save()},e.prototype.postCallSuccess=function(e,t){return this.pushInfo.completedTaskCount++,this.pushInfo.successfulTaskCount++,this.logger.debug("call returned the following response %o.",t),this.flushContext.save()},e}(),J=function(){function e(e){this.localDBManagementService=e,this.searchTableData=this.readTableData.bind(this),this.searchTableDataWithQuery=this.readTableData.bind(this),this.getDistinctDataByFields=this.readTableData.bind(this)}return e.prototype.getStore=function(e){return this.localDBManagementService.getStore(e.dataModelName,e.entityName)},e.prototype.insertTableData=function(e,t,n,i){void 0===i&&(i={}),this.getStore(e).then((function(n){var o=n.primaryKeyField&&"identity"===n.primaryKeyField.generatorType;return!1!==_.get(i,"resetPrimaryKey")&&o&&e.data[n.primaryKeyName]&&delete e.data[n.primaryKeyName],n.add(e.data).then((function(){n.refresh(e.data).then(t)}))})).catch(n)},e.prototype.insertMultiPartTableData=function(e,t,n,i){var o=this;void 0===i&&(i={}),this.getStore(e).then((function(r){r.serialize(e.data).then((function(r){e.data=r,o.insertTableData(e,t,n,i)}))})).catch(n)},e.prototype.updateTableData=function(e,t,n){this.getStore(e).then((function(n){return n.save(e.data).then((function(){n.refresh(e.data).then(t)}))})).catch(n)},e.prototype.updateMultiPartTableData=function(e,t,n){var i=e.data&&e.data.rowData||e.data;this.getStore(e).then((function(e){return e.save(i)})).then((function(){t&&t(i)})).catch(n)},e.prototype.deleteTableData=function(e,t,n){this.getStore(e).then((function(n){var i=n.primaryKeyField,o=e[i.fieldName]||e[i.name]||e.data&&e.data[i.fieldName]||e.id;n.delete(o).then(t)})).catch(n)},e.prototype.readTableData=function(e,t,n){var i=this;this.getStore(e).then((function(n){var o=e.filter((function(e,t){i.convertFieldNameToColumnName(n,e,t)}),!0);return o=o.replace(/wm_bool\('true'\)/g,1).replace(/wm_bool\('false'\)/g,0),n.count(o).then((function(i){var r=e.sort.split("=")[1];return n.filter(o,r,{offset:(e.page-1)*e.size,limit:e.size}).then((function(n){var o=Math.ceil(i/e.size);t({content:n,first:1===e.page,last:e.page===o,number:e.page-1,numberOfElements:n.length,size:e.size,sort:{sorted:!!r,unsorted:!r},totalElements:i,totalPages:o})}))}))})).catch(n)},e.prototype.escapeName=function(e){return e?'"'+(e=e.replace(/"/g,'""')).replace(/\./g,'"."')+'"':e},e.prototype.getColumnName=function(e,t){if(e.fieldToColumnMapping[t]){var n=this.escapeName(e.fieldToColumnMapping[t]);return n.indexOf(".")<0?this.escapeName(e.entitySchema.name)+"."+n:n}return t},e.prototype.convertFieldNameToColumnName=function(e,t,n){var i=this;_.forEach(t.rules,(function(t){t.rules?i.convertFieldNameToColumnName(e,t):t.target=i.getColumnName(e,t.target)})),n&&n.filterFields&&(n.filterFields=_.mapKeys(n.filterFields,(function(t,n){return i.getColumnName(e,n)})))},e}();J.SERVICE_NAME="LocalDbService",J.\u0275prov=g.\u0275\u0275defineInjectable({factory:function(){return new J(g.\u0275\u0275inject(z))},token:J,providedIn:"root"}),J.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],J.ctorParameters=function(){return[{type:z}]};var Z=function(){function e(){this.logger=window.console}return e.prototype.preFlush=function(e){this.fileStore=e.get("offlineFileUpload")},e.prototype.preCall=function(e){var t=this;"DatabaseService"===e.service&&(e.params.data=_.mapValues(e.params.data,(function(e){var n=t.fileStore[e];return n?(t.logger.debug("swapped file path from %s -> %s",e,n),n):e})))},e.prototype.postCallSuccess=function(e,t){if("OfflineFileUploadService"===e.service&&"uploadToServer"===e.operation){var n=JSON.parse(t[0].text)[0];this.fileStore[e.params.file]=n.path,this.fileStore[e.params.file+"?inline"]=n.inlinePath}},e}(),ee=function(){function e(e,t,n,i){this.changeLogService=e,this.deviceFileService=t,this.localDBManagementService=n,this.file=i}return e.prototype.preExport=function(e,t){var n=this.deviceFileService.getUploadDirectory(),i=n.lastIndexOf("/"),o=n.substring(0,i+1),r=n.substring(i+1);return t.uploadDir=n,this.file.copyDir(o,r,e,"uploads")},e.prototype.postImport=function(e,t){var n=this,i=this.deviceFileService.getUploadDirectory(),r=i.lastIndexOf("/"),a=i.substring(0,r+1),s=i.substring(r+1);return this.uploadDir=i,this.file.checkDir(e,"uploads").then((function(){return n.deviceFileService.removeDir(i).then((function(){return n.file.copyDir(e,"uploads",a,s)})).then((function(){return n.updateChanges(t)}))}),o.noop)},e.prototype.getChanges=function(e,t){return this.changeLogService.getStore().then((function(n){return n.filter([],"id",{offset:(e-1)*t,limit:t})}))},e.prototype.updateDBChange=function(e,t,n){var i=this,o={},r=e.params.entityName,a=e.params.dataModelName;e.params.data=_.mapValues(e.params.data,(function(e,i){var r=e,a=!1;return _.isString(e)?(r=_.replace(e,t,n),a=!_.isEqual(r,e)):_.isObject(e)&&e.wmLocalPath&&(r=_.replace(e.wmLocalPath,t,n),a=!_.isEqual(r,e.wmLocalPath)),a&&(o[i]=r),r})),_.isEmpty(o)||this.localDBManagementService.getStore(a,r).then((function(t){if(t.primaryKeyField&&"identity"===t.primaryKeyField.generatorType){var n=t.primaryKeyName,i=e.params.data[n];return t.get(i).then((function(e){return t.save(_.assignIn(e,o))}))}})).then((function(){return e.params=JSON.stringify(e.params),i.changeLogService.getStore().then((function(t){return t.save(e)}))}))},e.prototype.updateChange=function(e,t){return e.params=JSON.parse(e.params),"OfflineFileUploadService"===e.service&&"uploadToServer"===e.operation?(e.params.file=_.replace(e.params.file,t.uploadDir,this.uploadDir),e.params=JSON.stringify(e.params),this.changeLogService.getStore().then((function(t){return t.save(e)}))):"DatabaseService"===e.service?this.updateDBChange(e,t.uploadDir,this.uploadDir):void 0},e.prototype.updateChanges=function(e,t){var n=this;void 0===t&&(t=1);return this.getChanges(t,10).then((function(t){if(t&&t.length>0)return Promise.all(t.map((function(t){return n.updateChange(t,e)})))})).then((function(i){if(i&&10===i.length)return n.updateChanges(e,t+1)}))},e}(),te=function(){function e(e){this.localDBManagementService=e}return e.prototype.preFlush=function(e){this.errorStore=e.get("errorBlockerStore")},e.prototype.preCall=function(e){var t=this;if(e&&"DatabaseService"===e.service){var n=e.params.entityName,i=e.params.dataModelName;switch(e.operation){case"insertTableData":case"insertMultiPartTableData":case"updateTableData":case"updateMultiPartTableData":return this.localDBManagementService.getStore(i,n).then((function(o){t.blockCall(o,e,i,n,e.params.data)}));case"deleteTableData":return this.localDBManagementService.getStore(i,n).then((function(o){t.blockCall(o,e,i,n,e.params)}))}}},e.prototype.postCallSuccess=function(e){var t=this;if(e&&"DatabaseService"===e.service){var n=e.params.entityName,i=e.params.dataModelName;return this.localDBManagementService.getStore(i,n).then((function(o){var r=e.dataLocalId||e.params.data[o.primaryKeyName];_.isUndefined(r)||_.isNull(r)||t.removeError(i,n,r)}))}},e.prototype.postCallError=function(e){var t=this;if(e&&"DatabaseService"===e.service){var n=e.params.entityName,i=e.params.dataModelName;return this.localDBManagementService.getStore(i,n).then((function(o){var r=e.dataLocalId||e.params.data&&e.params.data[o.primaryKeyName]||e.params[o.primaryKeyName]||e.params.id;_.isUndefined(r)||_.isNull(r)||t.recordError(i,n,r)}))}},e.prototype.blockCall=function(e,t,n,i,o){var r=this;0===t.hasError&&(this.checkForPreviousError(e,t,n,i,o),e.entitySchema.columns.forEach((function(i){i.foreignRelations&&i.foreignRelations.some((function(a){return o[a.sourceFieldName]?r.blockCall(e,t,n,a.targetEntity,o[a.sourceFieldName]):o[i.fieldName]&&r.checkForPreviousError(e,t,n,a.targetEntity,o,i.fieldName),1===t.hasError}))})))},e.prototype.checkForPreviousError=function(e,t,n,i,o,r){var a=r||e.primaryKeyName;this.hasError(n,i,o[a])&&(t.hasError=1,t.errorMessage="Blocked call due to error in previous call of entity [ "+i+" ] with id [ "+o[a]+" ]")},e.prototype.hasError=function(e,t,n){return!!(this.errorStore[e]&&this.errorStore[e][t]&&this.errorStore[e][t][n])},e.prototype.removeError=function(e,t,n){this.errorStore[e]&&this.errorStore[e][t]&&this.errorStore[e][t][n]&&delete this.errorStore[e][t][n]},e.prototype.recordError=function(e,t,n){this.errorStore[e]=this.errorStore[e]||{},this.errorStore[e][t]=this.errorStore[e][t]||{},this.errorStore[e][t][n]=!0},e}(),ne=function(){function e(e){this.localDBManagementService=e,this.logger=window.console}return e.prototype.preFlush=function(e){this.idStore=e.get("idConflictResolution")},e.prototype.preCall=function(e){var t=this;if(e&&"DatabaseService"===e.service){var n=e.params.entityName,i=e.params.dataModelName;switch(e.operation){case"insertTableData":case"insertMultiPartTableData":return e.params.skipLocalDB=!0,this.localDBManagementService.getStore(i,n).then((function(r){var a=r.primaryKeyName;return a&&(t.transactionLocalId=e.params.data[a],e.dataLocalId=t.transactionLocalId),t.exchangeIds(r,i,n,e.params.data).then((function(){if(r.primaryKeyField&&"identity"===r.primaryKeyField.generatorType)delete e.params.data[a];else{var s=r.getValue(e.params.data,r.primaryKeyName);o.isDefined(s)&&(e.params.data[a]=s,null!==t.transactionLocalId&&t.pushIdToStore(i,n,t.transactionLocalId,s)),t.transactionLocalId=null}}))}));case"updateTableData":case"updateMultiPartTableData":case"deleteTableData":return this.localDBManagementService.getStore(i,n).then((function(o){if(t.exchangeId(o,i,n,e.params,"id"),e.params.data)return t.exchangeIds(o,i,n,e.params.data)}))}}},e.prototype.postCallSuccess=function(e,t){var n=this;if(e&&"DatabaseService"===e.service&&("insertTableData"===e.operation||"insertMultiPartTableData"===e.operation)&&this.transactionLocalId){var i=t[0].body,r=e.params.entityName,a=e.params.dataModelName;return this.localDBManagementService.getStore(a,r).then((function(e){return n.pushIdToStore(a,r,n.transactionLocalId,i[e.primaryKeyName]),e.delete(n.transactionLocalId).catch(o.noop).then((function(){return n.transactionLocalId=null,e.save(i)}))}))}},e.prototype.postCallError=function(e){var t=this;if(e&&"DatabaseService"===e.service&&("insertTableData"===e.operation||"insertMultiPartTableData"===e.operation)&&this.transactionLocalId){var n=e.params.entityName,i=e.params.dataModelName;return this.localDBManagementService.getStore(i,n).then((function(n){e.params.data[n.primaryKeyName]=t.transactionLocalId}))}},e.prototype.getEntityIdStore=function(e,t){return this.idStore[e]=this.idStore[e]||{},this.idStore[e][t]=this.idStore[e][t]||{},this.idStore[e][t]},e.prototype.pushIdToStore=function(e,t,n,i){n!==i&&(this.getEntityIdStore(e,t)[n]=i,this.logger.debug("Conflict found for entity (%s) with local id (%i) and remote Id (%i)",t,n,i))},e.prototype.logResolution=function(e,t,n){this.logger.debug("Conflict resolved found for entity (%s) with local id (%i) and remote Id (%i)",e,t,n)},e.prototype.exchangeId=function(e,t,n,i,o){var r=o||e.primaryKeyName,a=this.getEntityIdStore(t,n);if(i&&r){for(var s=i[r],l=s;a[l];)l=a[l];l!==s&&(i[r]=l,this.logResolution(n,s,l))}},e.prototype.exchangeIds=function(e,t,n,i){var o=this;this.exchangeId(e,t,n,i);var r=[];return e.entitySchema.columns.forEach((function(n){n.foreignRelations&&n.foreignRelations.forEach((function(a){i[n.fieldName]&&o.exchangeId(e,t,a.targetEntity,i,n.fieldName),i[a.sourceFieldName]&&r.push(o.localDBManagementService.getStore(t,a.targetEntity).then((function(e){return o.exchangeIds(e,t,a.targetEntity,i[a.sourceFieldName])})))}))})),Promise.all(r)},e}();ne.decorators=[{type:t.Injectable}],ne.ctorParameters=function(){return[{type:z}]};var ie=function(){function e(e,t){this.deviceFileService=e,this.localDBManagementService=t}return e.prototype.postCallSuccess=function(e){var t=this;if(e&&"DatabaseService"===e.service)switch(e.operation){case"insertMultiPartTableData":case"updateMultiPartTableData":_.forEach(e.params.data,(function(e){_.isObject(e)&&e.wmLocalPath&&t.deviceFileService.removeFile(e.wmLocalPath)}))}},e.prototype.transformParamsFromMap=function(e){if(e&&"DatabaseService"===e.service)switch(e.operation){case"insertMultiPartTableData":case"updateMultiPartTableData":return this.localDBManagementService.getStore(e.params.dataModelName,e.params.entityName).then((function(t){return t.deserialize(e.params.data).then((function(t){e.params.data=t}))}))}},e.prototype.transformParamsToMap=function(e){if(e&&"DatabaseService"===e.service)switch(e.operation){case"insertMultiPartTableData":case"updateMultiPartTableData":return this.localDBManagementService.getStore(e.params.dataModelName,e.params.entityName).then((function(t){return t.serialize(e.params.data).then((function(n){return e.params.data=n,t.save(_.mapValues(n,(function(e){return _.isObject(e)&&e.wmLocalPath||e}))),n}))}))}},e}(),oe=[{name:"insertTableData",type:"INSERT"},{name:"insertMultiPartTableData",type:"INSERT"},{name:"updateTableData",type:"UPDATE"},{name:"updateMultiPartTableData",type:"UPDATE"},{name:"deleteTableData",type:"DELETE"},{name:"readTableData",type:"READ",saveResponse:!0},{name:"searchTableData",type:"READ",saveResponse:!0},{name:"searchTableDataWithQuery",type:"READ",saveResponse:!0},{name:"getDistinctDataByFields",type:"READ",saveResponse:!1}],re=!1,ae=function(){function e(e,t,n,i,o){this.changeLogService=e,this.httpService=t,this.localDBManagementService=n,this.networkService=i,this.offlineDBService=o,this.onlineDBService=m.LVService}return e.prototype.add=function(){var e=this;if(!re){re=!0;var t=this.httpService.sendCallAsObservable;t&&(this.httpService.sendCallAsObservable=function(n,i){!i&&_.get(n,"url")&&(i={url:n.url});var o=_.clone(i.url);i=_.extend(i,n);var r=_.find(oe,{name:_.get(i,"operation")});return e.networkService.isConnected()||i.onlyOnline||!r||!i.dataModelName?h.from(e.remoteDBcall(r,t,i)):h.from(e.localDBManagementService.isOperationAllowed(i.dataModelName,i.entityName,r.type).then((function(n){var a;return n?Promise.resolve().then((function(){if(!i.isCascadingStopped&&("insertTableData"===r.name||"updateTableData"===r.name))return e.prepareToCascade(i).then((function(e){return a=e}))})).then((function(){return new Promise((function(t,n){e.localDBcall(r,i,t,n,o)}))})).then((function(t){return a?a.cascade().then((function(){return e.getStore(i).then((function(e){return e.refresh(t.body)})).then((function(e){return t&&t.body&&(t.body=e),t}))})):t})):e.remoteDBcall(r,t,i)})))})}},e.prototype.getStore=function(e){return this.localDBManagementService.getStore(e.dataModelName,e.entityName)},e.prototype.hasBlob=function(e){return!!_.filter(e.entitySchema.columns,{sqlType:"blob"}).length},e.prototype.localDBcall=function(e,t,n,i,r){var a=this;return new Promise((function(n,i){a.offlineDBService[e.name](t,(function(i){if("READ"!==e.type)return t.onlyOnline=!0,t.url=r,a.changeLogService.add("DatabaseService",e.name,t).then((function(){return n(i)}));n(i)}))})).then((function(e){return e={body:e,type:T},o.triggerFn(n,e),e}),i)},e.prototype.remoteDBcall=function(e,t,n){var i=this;return new Promise((function(r,a){t.call(i.httpService,n).subscribe((function(t){t&&t.type&&(n.skipLocalDB||i.offlineDBService.getStore(n).then((function(r){"READ"===e.type&&e.saveResponse?r.saveAll(t.body.content):"INSERT"===e.type?((n=_.clone(n)).data=_.clone(t.body),i.offlineDBService[e.name](n,o.noop,o.noop,{resetPrimaryKey:!1})):i.offlineDBService[e.name](n,o.noop,o.noop)})).catch(o.noop),r(t))}),(function(e){a(e)}))}))},e.prototype.prepareToCascade=function(e){var t=this;return this.getStore(e).then((function(n){var i=[];return _.forEach(e.data,(function(o,r){var a,s,l;if(_.isObject(o)&&!_.isArray(o)&&(a=n.entitySchema.columns.find((function(e){return e.primaryKey&&e.foreignRelations&&(s=e.foreignRelations.find((function(e){return e.sourceFieldName===r}))),!!s}))),a){(l=_.cloneDeep(e)).entityName=s.targetEntity,l.data=o;var c=t.getStore(l).then((function(i){var o=e.data,a=i.entitySchema.columns.find((function(e){return e.name===s.targetColumn}));if(a&&a.foreignRelations){var c=a.foreignRelations.find((function(e){return e.targetTable===n.entitySchema.name})).sourceFieldName;l.data[c]=o}return o[r]=null,l.onlyOnline=!1,l.isCascadingStopped=!0,l.hasBlob=t.hasBlob(i),l.url="",function(){return Promise.resolve().then((function(){var e=i.getValue(l.data,i.primaryKeyField.fieldName);return e?i.get(e):null})).then((function(e){var n;return n=e?l.hasBlob?"updateMultiPartTableData":"updateTableData":l.hasBlob?"insertMultiPartTableData":"insertTableData",t.onlineDBService[n](l).toPromise()}))}}));i.push(c)}})),Promise.all(i).then((function(e){return{cascade:function(){return Promise.all(e.map((function(e){return e()})))}}}))}))},e}(),se=!1,le=function(){function e(e,t,n,i,o,r){this.changeLogService=e,this.deviceFileService=t,this.deviceFileUploadService=n,this.file=i,this.networkService=o,this.uploadDir=r}return e.prototype.add=function(){var e=this;if(!se){se=!0;var t=this.deviceFileUploadService.upload;this.deviceFileUploadService.uploadToServer=t,this.deviceFileUploadService.upload=function(n,i,o,r,a,s){return e.networkService.isConnected()?t.call(e.deviceFileUploadService,n,i,o,r,a,s):e.uploadLater(n,i,o,r,a,s).then((function(e){return{text:JSON.stringify(e),headers:null,response:e}}))}}},e.prototype.uploadLater=function(e,t,n,i,o,r){var a=this,s=n.lastIndexOf("/"),l=n.substring(0,s),c=n.substring(s+1),p=this.deviceFileService.appendToFileName(c),u=this.uploadDir+"/"+p;return this.file.copyFile(l,c,this.uploadDir,p).then((function(){return a.changeLogService.add("OfflineFileUploadService","uploadToServer",{file:u,ftOptions:{fileKey:t,fileName:i},params:o,headers:r,serverUrl:e,deleteOnUpload:!0})})).then((function(){return[{fileName:c,path:u,length:0,success:!0,inlinePath:u+"?inline"}]}))},e}(),ce=/^\d+(\.\d+)?$/,pe=!1,ue=function(){function e(e,t,n,i){this.changeLogService=e,this.httpService=t,this.localDBManagementService=n,this.networkService=i}return e.prototype.add=function(){var e=this;if(!pe){pe=!0;var t=this.httpService.sendCallAsObservable;this.httpService.sendCallAsObservable=function(n,i){return!i&&_.get(n,"url")&&(i={url:n.url}),!e.networkService.isConnected()&&i.url.indexOf("/queryExecutor/")>0?h.from(e.executeLocally(i)):t.call(e.httpService,n,i)}}},e.prototype.executeLocally=function(e){var t=this,n=e.url,i=n.indexOf("?")>0,o=this.substring(n,"services/","/queryExecutor"),r=this.substring(n,"queries/",i?"?":void 0),a=i?this.getHttpParamMap(this.substring(n,"?",void 0)):{},s=this.getHttpParamMap(e.dataParams),l=_.extend(a,s);return this.localDBManagementService.executeNamedQuery(o,r,l).then((function(n){var i=n.rows;return n.rowsAffected?t.changeLogService.add("WebService","invokeJavaService",e).then((function(){return n.rowsAffected})):{type:T,body:{totalPages:i&&i.length>0?1:0,totalElements:i.length,first:!0,sort:null,numberOfElements:i.length,last:!0,size:e.size,number:0,content:i}}}))},e.prototype.substring=function(e,t,n){if(t){var i=e.indexOf(t)+t.length,o=n?e.indexOf(n):void 0;return e.substring(i,o)}},e.prototype.getHttpParamMap=function(e){var t={};return e&&(e=decodeURIComponent(e)).split("&").forEach((function(e){var n=e.split("=");_.isEmpty(_.trim(n[1]))||!ce.test(n[1])?t[n[0]]=n[1]:t[n[0]]=parseInt(n[1],10)})),t},e}(),de="logged-in-user.info",he=!1,me=function(){function e(e,t,n,i,o){var r=this;this.app=e,this.file=t,this.deviceService=n,this.networkService=i,this.securityService=o,this.saveSecurityConfigLocally=_.debounce((function(e){r._saveSecurityConfigLocally(e)}),1e3)}return e.prototype.add=function(){var e=this;if(!he){he=!0;var t=this.securityService.load,n=this.securityService.appLogout;this.securityService.load=function(n){return new Promise((function(i,o){e.networkService.isConnected()?t.call(e.securityService,n).then((function(t){e.securityConfig=t,e.saveSecurityConfigLocally(t),i(e.securityConfig)}),o):e.readLocalSecurityConfig().then((function(t){return void 0===t&&(t={}),e.securityConfig=t,e.securityService.config=t,t}),(function(){return t.call(e.securityConfig)})).then(i,o)}))},this.securityService.appLogout=function(t,i){e.securityConfig={authenticated:!1,loggedOut:!0,securityEnabled:e.securityConfig&&e.securityConfig.securityEnabled,loggedOutOffline:!e.networkService.isConnected(),loginConfig:e.securityConfig&&e.securityConfig.loginConfig,userInfo:null},e._saveSecurityConfigLocally(e.securityConfig).catch(o.noop).then((function(){e.networkService.isConnected()?n.call(e.securityService,t,i):location.assign(window.location.origin+window.location.pathname)}))},this.securityService.isAuthenticated=function(t){o.triggerFn(t,!0===e.securityConfig.authenticated)},this.deviceService.whenReady().then((function(){return e.clearLastLoggedInUser()})),this.app.subscribe("onNetworkStateChange",(function(t){t.isConnected&&e.clearLastLoggedInUser()}))}},e.prototype._saveSecurityConfigLocally=function(e){return this.file.writeFile(cordova.file.dataDirectory,de,JSON.stringify(e),{replace:!0})},e.prototype.clearLastLoggedInUser=function(){var e=this;return this.readLocalSecurityConfig().then((function(t){t&&t.loggedOutOffline?e.securityService.appLogout(null,null):e.networkService.isConnected()||(e.securityConfig=t||{})}))},e.prototype.readLocalSecurityConfig=function(){var e=this;return new Promise((function(t,n){var i=cordova.file.dataDirectory;e.file.checkFile(i,de).then((function(){return e.readFileAsTxt(i,de).then(t,n)}),(function(){var i=cordova.file.applicationDirectory+"www/metadata/app";return e.readFileAsTxt(i,"security-config.json").then(t,n)}))}))},e.prototype.readFileAsTxt=function(e,t){return this.file.readAsText(e,t).then(JSON.parse).catch(o.noop)},e}(),fe=function(){function e(t,n,i,r,a,s,l,c,p,u,d){o.hasCordova()&&e.initialize(t,n,i,r,a,s,l,c,p,u,d)}return e.initialize=function(e,t,n,i,r,a,s,l,c,p,u){this.initialized||(n.addStartUpService({getServiceName:function(){return"OfflineStartupService"},start:function(){return window.SQLitePlugin?(l.setLogSQl("true"===sessionStorage.getItem("wm.logSql")||"true"===sessionStorage.getItem("debugMode")),window.logSql=function(e){void 0===e&&(e=!0),l.setLogSQl(e),sessionStorage.setItem("wm.logSql",e?"true":"false")},window.executeLocalSql=function(e,t,n){l.executeSQLQuery(e,t,n,!0)},l.loadDatabases().then((function(){t.addWorker(new ne(l)),t.addWorker(new te(l)),t.addWorker(new Z),t.addWorker(new ie(i,l)),new ae(t,s,l,p,c).add(),new le(t,i,r,a,p,i.getUploadDirectory()).add(),new ue(t,s,l,p).add(),l.registerCallback(new ee(t,i,l,a)),t.addWorker({onAddCall:function(){p.isConnected()||p.disableAutoConnect()},postFlush:function(e){e.totalTaskCount>0&&l.close().catch(o.noop).then((function(){location.assign(window.location.origin+window.location.pathname)}))}})}))):Promise.resolve()}}),new me(e,a,n,p,u).add())},e}();fe.initialized=!1,fe.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],declarations:[],exports:[],providers:[],entryComponents:[]}]}],fe.ctorParameters=function(){return[{type:o.App},{type:Q},{type:r.DeviceService},{type:r.DeviceFileService},{type:r.DeviceFileUploadService},{type:i.File},{type:o.AbstractHttpService},{type:z},{type:J},{type:r.NetworkService},{type:a.SecurityService}]};var ge=function(){function e(e){this.deviceFileUploadService=e}return e.prototype.getPromiseFromObs=function(e){return new Promise((function(t,n){e.subscribe((function(e){e&&e.type&&t(e)}),n)}))},e.prototype.push=function(e){var t=e.params;switch(e.service){case"DatabaseService":switch(e.operation){case"insertTableData":return this.getPromiseFromObs(m.LVService.insertTableData(e.params,null,null));case"insertMultiPartTableData":return this.getPromiseFromObs(m.LVService.insertMultiPartTableData(e.params,null,null));case"updateTableData":return this.getPromiseFromObs(m.LVService.updateTableData(e.params,null,null));case"updateMultiPartTableData":return this.getPromiseFromObs(m.LVService.updateMultiPartTableData(e.params,null,null));case"deleteTableData":return this.getPromiseFromObs(m.LVService.deleteTableData(e.params,null,null))}case"OfflineFileUploadService":if("uploadToServer"===e.operation)return this.deviceFileUploadService.uploadToServer.call(this.deviceFileUploadService,t.serverUrl,t.ftOptions.fileKey,t.file,t.ftOptions.fileName,t.params,t.headers)}return Promise.reject(e.service+" service with operation "+e.operation+" is not supported for push.")},e}();ge.decorators=[{type:t.Injectable}],ge.ctorParameters=function(){return[{type:r.DeviceFileUploadService}]};var ve="localDBManager.lastPullInfo",ye=function(){var e={};return{start:function(e){e.$$pullProcessId="PULL_"+_.now()},add:function(t,n){var i=t.$$pullProcessId;e[i]||(e[i]=[]),e[i].push(n)},remove:function(t,n){var i=t.$$pullProcessId;_.remove(e[i],n),_.isEmpty(e[i])&&delete e[i]},abort:function(t){var n=t.$$pullProcessId;return e[n]&&(_.forEach(e[n],(function(e){e&&e.abort&&e.abort()})),delete e[n]),t.$$isMarkedToAbort=!0,t.catch((function(){return"cancelled"}))}}},be=ye(),we=function(){function e(e,t,n,i){var o=this;this.app=e,this.localDBManagementService=t,this.localKeyValueService=n,this.networkService=i,this.localDBManagementService.registerCallback({onDbCreate:function(e){o.localKeyValueService.put(ve,{databases:[],totalRecordsToPull:0,totalPulledRecordCount:0,startTime:new Date(0),endTime:new Date(e.dbSeedCreatedOn)})}})}return e.prototype.addDeltaCriteria=function(e,t,n){var i,o=this,r=e.schema.entities[t],a=r.pullConfig.deltaFieldName,s=_.find(r.columns,{fieldName:a})||{};return _.isEmpty(a)?Promise.resolve(n):this.localDBManagementService.isBundled(e.schema.name,t).then((function(e){return i=e})).then((function(){return o.getLastPullInfo()})).then((function(o){var r=o&&o.startTime&&o.startTime.getTime(),l=_.find(o&&o.databases,{name:e.schema.name}),c=_.find(l&&l.entities,{entityName:t})||{};return!r&&i&&(r=o&&o.endTime&&o.endTime.getTime(),c.query=n),c.query===n&&r>0&&(_.isEmpty(n)?n="":n+=" AND ","datetime"===s.sqlType?n+=a+" > '"+moment(r).utc().format("YYYY-MM-DDTHH:mm:ss")+"'":n+=a+" > "+r),n}),(function(){return Promise.resolve(n)}))},e.prototype.copyDataFromRemoteDBToLocalDB=function(e,t,n,i,r){var a,s=this,l=e.stores[t],c=e.schema.entities[t],p={entityName:t,totalRecordsToPull:0,pulledRecordCount:0},u=0,d=!1;return new Promise((function(h,m){s.prepareQuery(e,t).then((function(n){return p.query=n,s.addDeltaCriteria(e,t,n)})).then((function(e){return n&&p.query===e?l.clear().then((function(){return e})):e})).then((function(t){return a=_.isEmpty(t)?"":"q="+t,s.getTotalRecordsToPull(e,c,a,i)})).then((function(n){var m=c.pullConfig.size||100,f=Math.ceil(n/m);p.totalRecordsToPull=n;var g=c.pullConfig.orderBy;g=(_.isEmpty(g)?"":g+",")+l.primaryKeyName,r.next(p);var v={next:function(e){u++,e=_.slice(e,0,p.totalRecordsToPull-p.pulledRecordCount),l.saveAll(e).then((function(){p.pulledRecordCount+=e?e.length:0,r.next(p)})).catch(o.noop).then((function(){0===--u&&d&&h(p)}))},error:null,complete:null};return s._pullEntityData(e,t,a,g,f,m,1,i,void 0,v)})).then(null,m).catch(o.noop).then((function(){d=!0,0===u&&h(p)}))}))},e.prototype.evalIfBind=function(e){return _.startsWith(e,"bind:")?(e=e.replace(/\[\$\i\]/g,"[0]"),o.$parseExpr(e.replace("bind:",""))(this.app)):e},e.prototype.executeDatabaseCountQuery=function(e){return new Promise((function(t,n){m.LVService.countTableDataWithQuery(e,null,null).subscribe((function(e){return t(e.body)}),n)}))},e.prototype.executeDatabaseSearchQuery=function(e){return new Promise((function(t,n){return m.LVService.searchTableDataWithQuery(e,null,null).subscribe((function(e){return t(e&&e.body&&e.body.content)}),n)}))},e.prototype.getTotalRecordsToPull=function(e,t,n,i){var o=this,r={dataModelName:e.schema.name,entityName:t.entityName,queryParams:n};return this.retryIfNetworkFails((function(){return o.executeDatabaseCountQuery(r).then((function(e){var n=e,i=_.parseInt(t.pullConfig.maxNumberOfRecords);return _.isNaN(i)||i<=0||n<i?n:i}))}),i)},e.prototype.prepareQuery=function(e,t){var n,i=this,o=e.schema.entities[t];return this.localDBManagementService.isBundled(e.schema.name,t).then((function(e){var t=!1;if(e||_.isEmpty(o.pullConfig.query)){if(n=_.cloneDeep(o.pullConfig.filter),n=_.map(n,(function(e){return e.attributeValue=i.evalIfBind(e.attributeValue),t=t||_.isNil(e.attributeValue),e})),t)return Promise.reject("Null criteria values are present");n=_.sortBy(n,"attributeName"),n=m.LiveVariableUtils.getSearchQuery(n," AND ",!0)}else n=i.evalIfBind(o.pullConfig.query);return _.isNil(n)?Promise.resolve(null):Promise.resolve(encodeURIComponent(n))}))},e.prototype._pullDbData=function(e,t,n,i){var o=this,r=e.schema.name,a={name:e.schema.name,entities:[],totalRecordsToPull:0,pulledRecordCount:0,completedTaskCount:0,totalTaskCount:0},s=[];return _.forEach(e.schema.entities,(function(e){s.push(o.localDBManagementService.getStore(r,e.entityName))})),new Promise((function(r,l){Promise.all(s).then((function(s){var c=[];s.forEach((function(e){var t=e.entitySchema.pullConfig,n=t.pullType;(n===E.APP_START||n===E.BUNDLED&&t.deltaFieldName)&&c.push(e.entitySchema)}));var p=_.chain(c).map((function(r){var s={next:function(e){var t=_.findIndex(a.entities,{entityName:e.entityName});t>=0?a.entities[t]=e:a.entities.push(e),a.pulledRecordCount=_.reduce(a.entities,(function(e,t){return e+t.pulledRecordCount}),0),a.totalRecordsToPull=_.reduce(a.entities,(function(e,t){return e+t.totalRecordsToPull}),0),i.next(a)},error:null,complete:null};return o.copyDataFromRemoteDBToLocalDB(e,r.entityName,t,n,s).then((function(e){return a.completedTaskCount++,i.next(a),e}),null)})).value();a.totalTaskCount=p.length,i.next(a),Promise.all(p).then(r,l)}))}))},e.prototype._pullEntityData=function(e,t,n,i,r,a,s,l,c,p){var u=this,d=e.schema.name;if(c||(c=o.defer()),s>r)return c.resolve();var h={dataModelName:d,entityName:t,page:s,size:a,data:n,sort:i,onlyOnline:!0,skipLocalDB:!0};return this.retryIfNetworkFails((function(){return u.executeDatabaseSearchQuery(h)}),l).then((function(o){p.next(o),u._pullEntityData(e,t,n,i,r,a,s+1,l,c,p)}),c.reject),c.promise},e.prototype.retryIfNetworkFails=function(e,t){if(t.$$isMarkedToAbort)return Promise.reject("aborted");var n=this.networkService.retryIfNetworkFails(e);return be.add(t,n),n.catch(o.noop).then((function(){be.remove(t,n)})),n},e.prototype.cancel=function(e){return be.abort(e)},e.prototype.getDb=function(e){return this.localDBManagementService.loadDatabases().then((function(t){return _.find(t,{name:e})||Promise.reject("Local database ("+e+") not found")}))},e.prototype.getLastPullInfo=function(){return this.localKeyValueService.get(ve).then((function(e){return _.isString(e.startTime)&&(e.startTime=new Date(e.startTime)),_.isString(e.endTime)&&(e.endTime=new Date(e.endTime)),e}))},e.prototype.pullAllDbData=function(e,t){var n=this,i=o.getAbortableDefer(),r={completedTaskCount:0,totalTaskCount:0,inProgress:!0,databases:[],totalRecordsToPull:0,totalPulledRecordCount:0,startTime:new Date,endTime:new Date};return this.localDBManagementService.loadDatabases().then((function(o){var a=_.chain(o).filter((function(e){return!e.schema.isInternal})).map((function(o){be.start(i.promise);var a={next:function(e){var n=_.findIndex(r.databases,{name:e.name});n>=0?r.databases[n]=e:r.databases.push(e),r.totalTaskCount=_.reduce(r.databases,(function(e,t){return e+t.totalTaskCount}),0),r.completedTaskCount=_.reduce(r.databases,(function(e,t){return e+t.completedTaskCount}),0),r.totalPulledRecordCount=_.reduce(r.databases,(function(e,t){return e+t.pulledRecordCount}),0),r.totalRecordsToPull=_.reduce(r.databases,(function(e,t){return e+t.totalRecordsToPull}),0),t.next(r)},error:null,complete:null};return n._pullDbData(o,e,i.promise,a)})).value();return Promise.all(a)})).then((function(){r.endTime=new Date,r.inProgress=!1,n.localKeyValueService.put(ve,r),i.resolve(r)}),i.reject),i.promise},e.prototype.pullDbData=function(e,t,n){var i=this,r=o.getAbortableDefer();return this.getDb(e).then((function(e){return i._pullDbData(e,t,r.promise,n)})).then(r.resolve,r.reject),r.promise},e.prototype.pullEntityData=function(e,t,n,i){var r=this,a=o.getAbortableDefer();return this.getDb(e).then((function(e){return r.copyDataFromRemoteDBToLocalDB(e,t,n,a.promise,i)})).then(a.resolve,a.reject),a.promise},e}();we.SERVICE_NAME="LocalDBDataPullService",we.\u0275prov=g.\u0275\u0275defineInjectable({factory:function(){return new we(g.\u0275\u0275inject(v.App),g.\u0275\u0275inject(z),g.\u0275\u0275inject(S),g.\u0275\u0275inject(y.NetworkService))},token:we,providedIn:"root"}),we.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],we.ctorParameters=function(){return[{type:o.App},{type:z},{type:S},{type:r.NetworkService}]},e.CONTEXT_KEY=Y,e.ChangeLogService=Q,e.LAST_PUSH_INFO_KEY=K,e.LocalDBDataPullService=we,e.LocalDBManagementService=z,e.LocalDbService=J,e.OfflineModule=fe,e.PushService=H,e.PushServiceImpl=ge,e["\u02750"]=ye,e["\u0275a"]=S,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@awesome-cordova-plugins/app-version/ngx"),require("@awesome-cordova-plugins/barcode-scanner/ngx"),require("@awesome-cordova-plugins/calendar/ngx"),require("@awesome-cordova-plugins/camera/ngx"),require("@awesome-cordova-plugins/device/ngx"),require("@awesome-cordova-plugins/media-capture/ngx"),require("@awesome-cordova-plugins/geolocation/ngx"),require("@awesome-cordova-plugins/vibration/ngx"),require("@awesome-cordova-plugins/location-accuracy/ngx"),require("@awesome-cordova-plugins/diagnostic/ngx"),require("@wm/core"),require("@wm/mobile/core"),require("@wm/mobile/offline"),require("@wm/security"),require("@wm/variables"),require("@wm/mobile/components/basic")):"function"==typeof define&&define.amd?define("@wm/mobile/variables",["exports","@angular/core","@awesome-cordova-plugins/app-version/ngx","@awesome-cordova-plugins/barcode-scanner/ngx","@awesome-cordova-plugins/calendar/ngx","@awesome-cordova-plugins/camera/ngx","@awesome-cordova-plugins/device/ngx","@awesome-cordova-plugins/media-capture/ngx","@awesome-cordova-plugins/geolocation/ngx","@awesome-cordova-plugins/vibration/ngx","@awesome-cordova-plugins/location-accuracy/ngx","@awesome-cordova-plugins/diagnostic/ngx","@wm/core","@wm/mobile/core","@wm/mobile/offline","@wm/security","@wm/variables","@wm/mobile/components/basic"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.mobile=e.wm.mobile||{},e.wm.mobile.variables={}),e.ng.core,e.awesomeCordova.plugins,e.awesomeCordova.plugins,e.awesomeCordova.plugins,e.awesomeCordova.plugins,e.awesomeCordova.plugins,e.awesomeCordova.plugins,e.awesomeCordova.plugins,e.awesomeCordova.plugins,e.awesomeCordova.plugins,e.awesomeCordova.plugins,e.wm.core,e.wm.mobile.core,e.wm.mobile.offline,e.wm.security,e.wm.variables,e.wm.mobile.components.basic)}(this,(function(e,t,n,i,o,r,a,s,l,c,p,u,d,h,m,f,g,v){"use strict";
|
|
831
831
|
/*! *****************************************************************************
|
|
832
832
|
Copyright (c) Microsoft Corporation.
|
|
833
833
|
|