@wavemaker/app-runtime-wm-build 11.4.3-next.25779 → 11.4.3-next.25781

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/compiler"),require("rxjs"),require("@angular/core"),require("@angular/common/http")):"function"==typeof define&&define.amd?define("@wm/core",["exports","@angular/compiler","rxjs","@angular/core","@angular/common/http"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.core={}),e.ng.compiler,e.rxjs,e.ng.core,e.ng.common.http)}(this,(function(e,t,n,i,o){"use strict";function r(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 a,s,l,c,p=r(i),u=r(o);e.FormWidgetType=void 0,(a=e.FormWidgetType||(e.FormWidgetType={})).AUTOCOMPLETE="autocomplete",a.CHECKBOX="checkbox",a.CHECKBOXSET="checkboxset",a.CHIPS="chips",a.COLORPICKER="colorpicker",a.CURRENCY="currency",a.DATE="date",a.DATETIME="datetime",a.NUMBER="number",a.PASSWORD="password",a.RADIOSET="radioset",a.RATING="rating",a.RICHTEXT="richtext",a.SELECT="select",a.TOGGLE="toggle",a.SLIDER="slider",a.SWITCH="switch",a.TEXT="text",a.TEXTAREA="textarea",a.TIME="time",a.TIMESTAMP="timestamp",a.TYPEAHEAD="typeahead",a.UPLOAD="upload",e.DataType=void 0,(s=e.DataType||(e.DataType={})).INTEGER="integer",s.BIG_INTEGER="big_integer",s.SHORT="short",s.FLOAT="float",s.BIG_DECIMAL="big_decimal",s.DOUBLE="double",s.LONG="long",s.BYTE="byte",s.STRING="string",s.CHARACTER="character",s.TEXT="text",s.DATE="date",s.TIME="time",s.TIMESTAMP="timestamp",s.DATETIME="datetime",s.LOCALDATETIME="localdatetime",s.BOOLEAN="boolean",s.LIST="list",s.CLOB="clob",s.BLOB="blob",e.MatchMode=void 0,(l=e.MatchMode||(e.MatchMode={})).BETWEEN="between",l.GREATER="greaterthanequal",l.LESSER="lessthanequal",l.NULL="null",l.EMPTY="empty",l.NULLOREMPTY="nullorempty",l.EQUALS="exact",e.DEFAULT_FORMATS=void 0,(c=e.DEFAULT_FORMATS||(e.DEFAULT_FORMATS={})).DATE="yyyy-MM-dd",c.TIME="HH:mm:ss",c.TIMESTAMP="timestamp",c.DATETIME="yyyy-MM-ddTHH:mm:ss",c.LOCALDATETIME="yyyy-MM-ddTHH:mm:ss",c.DATETIME_ORACLE="yyyy-MM-dd HH:mm:ss",c.DATE_TIME="yyyy-MM-dd HH:mm:ss";var d=function(e,t,n){var i="";return e.forEach((function(e,o){if(o&&o.endsWith(".event")){var r=o.split(".")[0];i=" "+i+" ("+r+')="'+(t?t+".":"")+"triggerUploadEvent($event, '"+r+"', '"+n+"', row)\" "}})),i},h=d,m=function(e,n,i){i=i.replace("bind:","");var o=e.attrs.find((function(e){return"datasetboundexpr"===e.name}));"dataset"!==n.name||o||e.attrs.push(new t.Attribute("datasetboundexpr",i,n.sourceSpan,n.keySpan,n.valueSpan,void 0,void 0))},f=m,g=function(e){var t=e.match(/(custom(\s*:))/g);return t&&t.length},v=function(e,t,n,i,o){void 0===i&&(i=""),void 0===o&&(o="item");var r,a,s,l=t.replace(/([^a-zA-Z0-9.])/g,"\\$1"),c=new RegExp("("+l+")(\\[0\\])?(.data\\[\\$i\\])?(.content\\[\\$i\\])?(\\[\\$i\\])?","g"),p={"wm-list":["itemclass","disableitem","dataset"]};n&&(r=new RegExp("(Widgets."+n+".currentItem)\\b","g"),a=new RegExp("(Widgets."+n+".currentItemWidgets)\\b","g"),s=new RegExp("(Widgets.(.*).(formWidgets|filterWidgets))\\b","g")),(_.isArray(e)?e:p[e.name]?[e]:e.children||[]).forEach((function(e){if(e.name){var l=e.name,u=new RegExp("bind:\\s*\\(*"+t+"\\)*\\.length\\)*");e.attrs.forEach((function(n){var d=n.value&&n.value.trim();_.startsWith(d,"bind:")&&((!p[l]||p[l]&&p[l].indexOf(n.name)>-1)&&_.includes(d,t)&&d!=="bind:"+t&&!u.test(d)&&(d=d.replace("bind:",""),m(e,n,d),d=d.replace(c,o),g(d="bind:"+d)&&r&&(d+=":"+r.exec(r.source)[0])),r&&r.test(d)&&((d.includes(".formWidgets")||d.includes(".filterWidgets"))&&(d=d.replace(s,"Widgets")),m(e,n,d),d=d.replace(r,o)),a&&a.test(d)&&(d=d.replace(a,i+"currentItemWidgets")),n.value=d)})),v(e.children,t,n,i,o)}}))},y=new Map([["display-name","caption"],["display-name.bind","caption.bind"],["title","hint"],["title.bind","hint.bind"],["show","show"],["show.bind","show.bind"],["disabled","disabled"],["disabled.bind","disabled.bind"],["hyperlink","hyperlink"],["hyperlink.bind","hyperlink.bind"],["target","target"],["conditionalclass.bind","conditionalclass.bind"],["conditionalstyle.bind","conditionalstyle.bind"]]),b=window.requestAnimationFrame,w=[],P=function(e){w.length||b((function(){w.forEach((function(e){return e()})),w.length=0})),w.push(e)},O=function(e,t,n){var i=function(t){return e.classList.remove(t)};(t=t||"").split(" ").forEach((function(e){e.length&&(n?i(e):P((function(){return i(e)})))}))},S=function(e,t,n){var i=function(t){return e.classList.add(t)};(t=t||"").split(" ").forEach((function(e){e.length&&(n?i(e):P((function(){return i(e)})))}))},E=function(e,t,n,i){var o=function(){return e.style[t]=n};i?o():P(o)},T=function(e,t,n,i){var o=function(){return e instanceof Element&&e.setAttribute(t,n)};i?o():P(o)};function C(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 A(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 R(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 I(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 N={};function x(){return window._WM_APP_PROPERTIES?window._WM_APP_PROPERTIES:N}var k,M,L,F=function(){function e(e){this.generator=function(e){var t;return A(this,(function(n){switch(n.label){case 0:t=1,n.label=1;case 1:return[4,""+e+t++];case 2:return n.sent(),[3,1];case 3:return[2]}}))}(e)}return e.prototype.nextUid=function(){return this.generator.next().value},e}(),j=function(e){return"string"==typeof e},B=function(e){return void 0!==e},G=function(e,t){return void 0===e?t:e},V=function(e,t){return void 0===e?t:void 0===t?e:e+t},U=function(e,t){return G(e,0)-G(t,0)},W=function(){},q=new Map,z=new Map,H=new Map,Y=function(e,t){return"object"!=typeof e&&"object"!=typeof t&&(e!=e&&t!=t||e===t)},K=function(e,t){var n=t.length,i=n>10;switch(n){case 10:if(i=!Y(e[9],t[9]))break;case 9:if(i=!Y(e[8],t[8]))break;case 8:if(i=!Y(e[7],t[7]))break;case 7:if(i=!Y(e[6],t[6]))break;case 6:if(i=!Y(e[5],t[5]))break;case 5:if(i=!Y(e[4],t[4]))break;case 4:if(i=!Y(e[3],t[3]))break;case 3:if(i=!Y(e[2],t[2]))break;case 2:if(i=!Y(e[1],t[1]))break;case 1:if(i=!Y(e[0],t[0]))break}return i},Q=function(e,t,n){for(var i=[],o=3;o<arguments.length;o++)i[o-3]=arguments[o];var r,a=t.get(n);if(a){var s=K(a.args,i);if(!s)return a.result}return a={args:i,result:r=e.transform.apply(e,D([],I(i)))},t.set(n,a),r},X=/[^ a-zA-Z0-9]/g,J=function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)},Z=function(){function e(e,t,n){this.ast=e,this.declarations=[],this.stmts=[],this.pipes=[],this.vIdx=0,this.exprType=t,this.pipeNameVsIsPureMap=n}return e.prototype.createVar=function(){var e="v"+this.vIdx++;return this.declarations.push(e),e},e.prototype.processImplicitReceiver=function(){return"ctx"},e.prototype.processLiteralPrimitive=function(){var e=this.cAst;return j(e.value)?'"'+e.value.replace(/"/g,'"').replace(X,J)+'"':e.value},e.prototype.processLiteralArray=function(){var e,t,n=this.cAst,i=this.cStmts,o=this.createVar(),r=[];try{for(var a=R(n.expressions),s=a.next();!s.done;s=a.next()){var l=s.value;r.push(this.build(l,i))}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}return i.push(o+"=["+r.join(",")+"]"),o},e.prototype.processLiteralMap=function(){var e,t,n=this.cAst,i=this.cStmts,o=this.createVar(),r=[];try{for(var a=R(n.values),s=a.next();!s.done;s=a.next()){var l=s.value;r.push(this.build(l,i))}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}return i.push(o+"={"+n.keys.map((function(e,t){return"'"+e.key+"':"+r[t]}))+"}"),o},e.prototype.processPropertyRead=function(){var e=this.cAst,t=this.cStmts,n=this.build(e.receiver,t),i=this.createVar();return t.push(i+"="+n+"&&"+n+"."+e.name),i},e.prototype.processKeyedRead=function(){var e=this.cAst,t=this.cStmts,n=this.build(e.key,t),i=this.build(e.receiver,t),o=this.createVar();return t.push(o+"="+i+"&&"+i+"["+n+"]"),o},e.prototype.processPrefixNot=function(){var e=this.cAst,t=this.cStmts,n=this.build(e.expression,t);return t.push(n+"=!"+n),n},e.prototype.handleBinaryPlus_Minus=function(){var e=this.cAst,t=this.cStmts,n=this.build(e.left,t),i=this.build(e.right,t),o=this.createVar(),r="+"===e.operation?"_plus":"_minus";return t.push(o+"="+r+"("+n+","+i+")"),o},e.prototype.handleBinaryAND_OR=function(){var e=this.cAst,t=this.cStmts,n=[],i=[],o=[],r=this.build(e.left,i),a=this.build(e.right,o),s=this.createVar();return"&&"===e.operation?n.push(i.join(";"),";"+s+"=false",";if("+r+"){",o.join(";"),";"+s+"="+a+";","}"):n.push(i.join(";"),";"+s+"="+r,";if(!"+r+"){",o.join(";"),";"+s+"="+a+";","}"),t.push(n.join("")),s},e.prototype.handleBinaryDefault=function(){var e=this.cAst,t=this.cStmts,n=this.build(e.left,t),i=this.build(e.right,t),o=this.createVar();return t.push(o+"="+n+e.operation+i),o},e.prototype.processBinary=function(){var e=this.cAst.operation;return"+"===e||"-"===e?this.handleBinaryPlus_Minus():"&&"===e||"||"===e?this.handleBinaryAND_OR():this.handleBinaryDefault()},e.prototype.processConditional=function(){var e=this.cAst,t=this.cStmts,n=this.build(e.condition,t),i=this.createVar(),o=[],r=[],a=[],s=this.build(e.trueExp,r),l=this.build(e.falseExp,a);return o.push("if("+n+"){",r.join(";"),";"+i+"="+s+";","}else{",a.join(";"),";"+i+"="+l+";","}"),t.push(o.join(" ")),i},e.prototype.processMethodCall=function(){var e,n,i=this.cAst,o=this.cStmts,r=[];try{for(var a=R(i.args),s=a.next();!s.done;s=a.next()){var l=s.value;r.push(this.build(l,o))}}catch(t){e={error:t}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}var c=this.build(i.receiver,o),p=this.createVar(),u=i.receiver instanceof t.ImplicitReceiver;return o.push(p+"= "+c+"&&"+c+"."+i.name+"&&"+c+"."+i.name+(u?".bind(_ctx)":"")+"("+r.join(",")+")"),p},e.prototype.processChain=function(){var e=this;return this.cAst.expressions.map((function(t){return e.build(t)})).join(";")},e.prototype.processPropertyWrite=function(){var e,n,i=this.cAst,o=this.cStmts;n=i.receiver instanceof t.ImplicitReceiver?"_ctx."+i.name:(e=this.build(i.receiver,o))+(e.length?".":"")+i.name;var r=this.build(i.value,o);o.push(n+"="+r)},e.prototype.processPipe=function(){var e,t,n=this.cAst,i=this.cStmts,o=this.createVar(),r=[],a=[],s=[],l=this.build(n.exp,i);try{for(var c=R(n.args),p=c.next();!p.done;p=c.next()){var u=p.value;r.push(this.build(u,s))}}catch(t){e={error:t}}finally{try{p&&!p.done&&(t=c.return)&&t.call(c)}finally{if(e)throw e.error}}var d="_p"+this.pipes.length;return this.pipes.push([n.name,d]),r.unshift(l),a.push(s.length?s.join(";")+";":"",this.pipeNameVsIsPureMap.get(n.name)?o+"=getPPVal("+d+',_ppc,"'+d+'",'+r+")":o+"="+d+".transform("+r+")"),i.push(a.join("")),o},e.prototype.build=function(e,n){return this.cAst=e,this.cStmts=n||this.stmts,e instanceof t.ImplicitReceiver?this.processImplicitReceiver():e instanceof t.LiteralPrimitive?this.processLiteralPrimitive():e instanceof t.LiteralArray?this.processLiteralArray():e instanceof t.LiteralMap?this.processLiteralMap():e instanceof t.PropertyRead?this.processPropertyRead():e instanceof t.PropertyWrite?this.processPropertyWrite():e instanceof t.KeyedRead?this.processKeyedRead():e instanceof t.PrefixNot?this.processPrefixNot():e instanceof t.Binary?this.processBinary():e instanceof t.Conditional?this.processConditional():e instanceof t.MethodCall?this.processMethodCall():e instanceof t.Chain?this.processChain():e instanceof t.BindingPipe?this.processPipe():void 0},e.prototype.extendCtxWithLocals=function(){var e=this.createVar();this.stmts.push(e+"=Object.assign({}, locals)","Object.setPrototypeOf("+e+", _ctx)","ctx="+e)},e.prototype.fnBody=function(){return this.declarations.push("ctx"),'"use strict";\nvar '+this.declarations.join(",")+";\n"+this.stmts.join(";")},e.prototype.fnArgs=function(){var e,t,n=["_plus","_minus","_isDef"];if(this.exprType===L.Binding){n.push("getPPVal","_ppc");try{for(var i=R(this.pipes),o=i.next();!o.done;o=i.next()){var r=I(o.value,2)[1];n.push(r)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}}return n.push("_ctx","locals"),n.join(",")},e.prototype.addReturnStmt=function(e){this.stmts.push("return "+e+";")},e.prototype.cleanup=function(){this.ast=this.cAst=this.stmts=this.cStmts=this.declarations=this.pipes=this.pipeNameVsIsPureMap=void 0},e.prototype.compile=function(e){if(this.extendCtxWithLocals(),this.addReturnStmt(this.build(this.ast)),e)return{fnBody:this.fnBody(),fnArgs:this.fnArgs(),pipes:this.pipes};var t,n=new Function(this.fnArgs(),this.fnBody());return this.exprType===L.Binding?(t=n.bind(void 0,V,U,B,Q)).usedPipes=this.pipes.slice(0):t=n.bind(void 0,V,U,B),this.cleanup(),t},e}(),ee=function(){return{transform:W}},te=function(){if(void 0!==k)return k;try{new Function,k=!1}catch(e){k=!0}return k};function ne(e,n){var i,o;if(!M)return console.log("set pipe provider"),W;if(!j(e))return W;if((e=e.trim()).endsWith(";")&&(e=e.slice(0,-1)),!e.length)return W;var r,a=q.get(e);if(a)return a;if(n||(r=le(e)),!r)if(te())r=function(t,n){var i=Object.assign({},n);return Object.setPrototypeOf(i,t),_.get(i,e)};else{var s=new t.Parser(new t.Lexer).parseBinding(e,"",0);if(s.errors.length)r=a=W;else{var l=M.getPipeNameVsIsPureMap();if(a=new Z(s.ast,L.Binding,l).compile(n),n)return a;if(a.usedPipes.length){var c=[],p=!1;try{for(var u=R(a.usedPipes),d=u.next();!d.done;d=u.next()){var h=I(d.value,1)[0],m=M.meta(h),f=void 0;m?(m.pure&&(p=!0,f=H.get(h)),f||(f=M.getInstance(h)),m.pure&&H.set(h,f)):f=ee,c.push(f)}}catch(e){i={error:e}}finally{try{d&&!d.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}c.unshift(p?new Map:void 0),r=a.bind.apply(a,D([void 0],I(c)))}else r=a.bind(void 0,void 0)}}return q.set(e,r),r}function ie(e,t,n){var i=Object.assign({},n);Object.setPrototypeOf(i,t);var o=e.split("("),r=o[0],a=_.get(t,r);if(a){var s=o[1].replace(")","");s=s.split(",");var l=[];return s.forEach((function(e){e=e&&e.trim(),l.push(_.get(i,e))})),a.bind(i).apply(void 0,D([],I(l)))}}function oe(e,n){if(!j(e))return W;if(!(e=e.trim()).length)return W;var i=z.get(e);if(i)return i;if(n||(i=ce(e)),!i)if(te())i=ie.bind(void 0,e);else{var o=new t.Parser(new t.Lexer).parseAction(e,"",0);if(o.errors.length)return W;i=new Z(o.ast,L.Action).compile(n)}return z.set(e,i),i}!function(e){e[e.Binding=0]="Binding",e[e.Action=1]="Action"}(L||(L={}));var re=new Map,ae=function(e){return re.get(e)},se=function(e,t){var n,i,o=ae(e);if(o){var r=o.usedPipes||[];if(o=t===L.Binding?o.bind(void 0,V,U,B,Q):o.bind(void 0,V,U,B),r.length){var a=[],s=!1;try{for(var l=R(r),c=l.next();!c.done;c=l.next()){var p=I(c.value,1)[0],u=M.meta(p),d=void 0;u?(u.pure&&(s=!0,d=H.get(p)),d||(d=M.getInstance(p)),u.pure&&H.set(p,d)):d=ee,a.push(d)}}catch(e){n={error:e}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}a.unshift(s?new Map:void 0),o=o.bind.apply(o,D([void 0],I(a)))}else t===L.Binding&&(o=o.bind(void 0,void 0));return o}},le=function(e){return se(e,L.Binding)},ce=function(e){return se(e,L.Action)},pe=new Map,ue=new F("watch-id-"),de={};Object.freeze(de);var he,me,fe,ge=!1,ve=function(e,t){var n;return void 0===t&&(t=50),function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];window.__zone_symbol__clearTimeout(n),n=window.__zone_symbol__setTimeout((function(){return e.apply(void 0,D([],I(i)))}),t)}},ye=function(e,t,n,i){var o,r=n;_.isArray(r)&&(o=r.map((function(e){return Vt(e,t)})),_.isArray(o[0])&&(o=_.flatten(o)),e(o,i))},be=function(e,t,n){var i="[$i]";if(!t)return{expr:e.replace(/\[\$i\]/g,"[0]"),listener:n};var o=e.lastIndexOf(i),r=e.substr(0,o).replace(i,"[0]"),a=e.substr(o+5),s=n;return a&&(s=ye.bind(void 0,n,a)),{expr:r,listener:s}},we=function(e,t,n,i,o,r,a,s){if(void 0===o&&(o=ue.nextUid()),void 0===r&&(r=!1),void 0===a&&(a={}),-1!==e.indexOf("[$i]")){var l=be(e,a&&a.arrayType,i);e=l.expr,i=l.listener}var c=ne(e);return pe.set(o,{fn:c.bind(e,t,n),listener:i,expr:e,last:de,doNotClone:r,isMuted:s}),function(){return Pe(o)}},Pe=function(e){return pe.delete(e)},_e=!1,Oe=window.requestAnimationFrame,Se=function(e){if(!ge||e){var t,n=1;do{t=!1,pe.forEach((function(e){if(!e.isMuted||!e.isMuted()){var n,i=e.fn,o=e.listener,r=e.last;try{n=i()}catch(t){console.warn("error in executing expression: '"+e.expr+"'")}_.isEqual(n,r)||(t=!0,_e=!0,e.last=n,_.isObject(n)&&!e.doNotClone&&!1!==n.__cloneable__&&(e.last=_.clone(n)),o(n,r),Ee())}})),n++}while(t&&n<5);t&&5===n&&console.warn("Number of watch cycles gone above set limit of: 5 ")}},Ee=function(){return _e=!1};window.watchRegistry=pe;var Te,Ce,Ae=ve((function(){fe=!0,me.run((function(){return Se()}))}),100),Re=(Te=!1,function(e){if(he)if(e)me.run((function(){return he.tick()})),Te=!1;else{if(Te)return;Te=!0,Oe((function(){me.run((function(){return he.tick()})),Te=!1}))}});e.ComponentType=void 0,(Ce=e.ComponentType||(e.ComponentType={}))[Ce.PAGE=0]="PAGE",Ce[Ce.PREFAB=1]="PREFAB",Ce[Ce.PARTIAL=2]="PARTIAL";var Ie,De=function(){};!function(e){e.LIST_RECORDS="listRecords",e.UPDATE_RECORD="updateRecord",e.INSERT_RECORD="insertRecord",e.DELETE_RECORD="deleteRecord",e.INVOKE="invoke",e.UPDATE="update",e.NOTIFY="notify",e.IS_API_AWARE="isApiAware",e.SUPPORTS_CRUD="supportsCRUD",e.SUPPORTS_DISTINCT_API="supportsDistinctAPI",e.IS_PAGEABLE="isPageable",e.IS_SORTABLE="isSortable",e.GET_OPERATION_TYPE="getOperationType",e.GET_RELATED_PRIMARY_KEYS="getRelatedTablePrimaryKeys",e.GET_ENTITY_NAME="getEntityName",e.SET_INPUT="setinput",e.GET_RELATED_TABLE_DATA="getRelatedTableData",e.GET_DISTINCT_DATA_BY_FIELDS="getDistinctDataByFields",e.GET_AGGREGATED_DATA="getAggregatedData",e.GET_MATCH_MODE="getMatchMode",e.DOWNLOAD="download",e.GET_NAME="getName",e.GET_PROPERTIES_MAP="getPropertiesMap",e.GET_PRIMARY_KEY="getPrimaryKey",e.GET_BLOB_URL="getBlobURL",e.SUPPORTS_SERVER_FILTER="supportsServerFilter",e.GET_OPTIONS="getOptions",e.SEARCH_RECORDS="searchRecords",e.GET_REQUEST_PARAMS="getRequestParams",e.GET_PAGING_OPTIONS="getPagingOptions",e.FETCH_DISTINCT_VALUES="fetchDistinctValues",e.GET_UNIQUE_IDENTIFIER="getUniqueIdentifier",e.GET_CONTEXT_IDENTIFIER="getContextIdentifier",e.IS_UPDATE_REQUIRED="isUpdateRequired",e.ADD_ITEM="addItem",e.SET_ITEM="setItem",e.REMOVE_ITEM="removeItem",e.IS_BOUND_TO_LOCALE="isBoundToLocale",e.GET_DEFAULT_LOCALE="getDefaultLocale",e.CANCEL="cancel",e.SET_PAGINATION="setPagination"}(Ie||(Ie={}));var Ne={Operation:Ie},xe=function(){},ke=function(){},Me=function(){},Le=function(){},Fe=function(){},je=function(){},Be=function(){},Ge=function(){},Ve=function(){},$e=function(){},Ue=function(){},We=window.navigator.userAgent,qe={SNAKE_CASE:/[A-Z]/g,ANDROID:/Android/i,IPHONE:/iPhone/i,IPOD:/iPod/i,IPAD:/iPad/i,MAC:/Mac/i,ANDROID_TABLET:/android|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i,MOBILE:/Mobile/i,WINDOWS:/Windows Phone/i,SUPPORTED_IMAGE_FORMAT:/\.(bmp|gif|jpe|jpg|jpeg|tif|tiff|pbm|png|ico)$/i,SUPPORTED_FILE_FORMAT:/\.(txt|js|css|html|script|properties|json|java|xml|smd|xmi|sql|log|wsdl|vm|ftl|jrxml|yml|yaml|md|less|jsp)$/i,SUPPORTED_AUDIO_FORMAT:/\.(mp3|ogg|webm|wma|3gp|wav|m4a)$/i,SUPPORTED_VIDEO_FORMAT:/\.(mp4|ogg|webm|wmv|mpeg|mpg|avi|mov)$/i,PAGE_RESOURCE_PATH:/^\/pages\/.*\.(js|css|html|json)$/,MIN_PAGE_RESOURCE_PATH:/.*(page.min.html)$/,VALID_EMAIL:/^[a-zA-Z][\w.+]+@[a-zA-Z_]+?\.[a-zA-Z.]{1,4}[a-zA-Z]$/,VALID_WEB_URL:/^(http[s]?:\/\/)(www\.){0,1}[a-zA-Z0-9=:?\/\.\-]+(\.[a-zA-Z]{2,5}[\.]{0,1})?/,VALID_WEBSOCKET_URL:/^(ws[s]?:\/\/)(www\.){0,1}[a-zA-Z0-9=:?\/\.\-]+(\.[a-zA-Z]{2,5}[\.]{0,1})?/,VALID_RELATIVE_URL:/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,REPLACE_PATTERN:/\$\{([^\}]+)\}/g,ZIP_FILE:/\.zip$/i,EXE_FILE:/\.exe$/i,NO_QUOTES_ALLOWED:/^[^'|"]*$/,NO_DOUBLE_QUOTES_ALLOWED:/^[^"]*$/,VALID_HTML:/<[a-z][\s\S]*>/i,VALID_PASSWORD:/^[0-9a-zA-Z-_.@&*!#$%]+$/,SPECIAL_CHARACTERS:/[^A-Z0-9a-z_]+/i,APP_SERVER_URL_FORMAT:/^(http[s]?:\/\/)(www\.){0,1}[a-zA-Z0-9\.\-]+([:]?[0-9]{2,5}|\.[a-zA-Z]{2,5}[\.]{0,1})\/+[^?#&=]+$/,JSON_DATE_FORMAT:/\d{4}-[0-1]\d-[0-3]\d(T[0-2]\d:[0-5]\d:[0-5]\d.\d{1,3}Z$)?/,DATA_URL:/^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s]*)\s*$/i,ISO_DATE_FORMAT:/(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})(\.\d+)?([+-]\d{2}:?\d{2}|Z)$/},ze=["int",e.DataType.INTEGER,e.DataType.FLOAT,e.DataType.DOUBLE,e.DataType.LONG,e.DataType.SHORT,e.DataType.BYTE,e.DataType.BIG_INTEGER,e.DataType.BIG_DECIMAL],He=new Date,Ye=function(e){return void 0!==e},Ke=function(e){return null!==e&&"object"==typeof e},Qe=function(e,t){return!(!e||"false"===e)||!!t&&e===t};var Xe=function(){return window.navigator.appVersion.indexOf("Trident/")>-1||window.navigator.userAgent.indexOf("MSIE")>-1},Je=function(){return qe.ANDROID.test(We)},Ze=function(){return qe.ANDROID_TABLET.test(We)&&!/Tablet PC 2.0/i.test(We)},et=function(){return qe.IPHONE.test(We)},tt=function(){return qe.IPOD.test(We)},nt=function(){return qe.IPAD.test(We)||window.navigator.maxTouchPoints&&window.navigator.maxTouchPoints>2&&qe.MAC.test(window.navigator.platform)},it=function(){return et()||tt()||nt()},ot=function(e,t){var n=e||"1366px",i=t||"1024px";return window.matchMedia("only screen and (min-device-width : "+n+") and (max-device-width : "+n+") and (min-device-height : "+i+") and (max-device-height : "+i+") and (min-width: "+n+") and (max-width: "+n+")").matches},rt=function(e,t){var n=e||"1366px",i=t||"1024px";return window.matchMedia("only screen and (min-device-width : "+i+") and (max-device-width : "+i+") and (min-device-height : "+n+") and (max-device-height : "+n+") and (min-width: "+i+") and (max-width: "+i+")").matches},at=function(){return Je()||it()||Ze()||$("#wm-mobile-display:visible").length>0},st=function(){return"MOBILE"===x().platformType&&"APPLICATION"===x().type},lt=function(){var e=window.navigator.userAgent.toLowerCase().match(/android\s([0-9\.]*)/);return e?e[1]:""},ct=function(){return Je()&&4===parseInt(lt(),10)},pt=function(e){var t=e.indexOf("?");return t>-1?(e=encodeURI(e.substring(0,t))+e.substring(t),e=ut(e)):e=encodeURI(e),e},ut=function(e){var t,n,i="";return(n=e.indexOf("?"))>-1&&(n+=1,(t=e.substring(n))&&(t.split("&").forEach((function(e){var t,n=_.includes(e,"=")?e.indexOf("="):e&&e.length,o=e.substr(0,n),r=e.substr(n+1);if(r||_.includes(e,"=")){try{t=decodeURIComponent(r)}catch(e){t=r}i+=o+"="+encodeURIComponent(t)+"&"}else i+=o+"&"})),i=i.slice(0,-1),e=e.replace(t,i))),e},dt=function(e){return e?e.charAt(0).toUpperCase()+e.substring(1):""},ht=function(e){return e===e.toUpperCase()?e:e.replace(qe.SNAKE_CASE,(function(e,t){return(t?" ":"")+e}))},mt=function(e,t,n){return e.substr(0,t)+n+e.substr(t+n.length)},ft=function(e){var t;return-1!==(t=e.indexOf("."))&&(e=mt(e,t+1,e.charAt(t+1).toUpperCase()),e=mt(e,t," ")),e},gt=function(e){return e=_.camelCase(e),e=dt(e),e=ht(e),e=ft(e)},vt=function(e){return e.split("-").join(" ")},yt=function(e,t){void 0===t&&(t=",");var n,i=[];return _.isArray(e)||(i=_.split(e,t)),n=_.map(i,gt),_.isArray(e)?n:n.join(t)},bt=function(e){var t=document.createElement("a");return t.href=e,""!==t.protocol&&(!qe.DATA_URL.test(e)&&(!!wt(location.href,"https://")&&("https:"!==t.protocol&&"wss:"!==t.protocol)))},wt=function(e,t,n){return!!e&&new RegExp("^"+t,n?"i":"").test(e)},Pt=function(e,t){var n;return n=_.attempt((function(){var n=Object.keys(e).map((function(e){return"var "+e+" = data['"+e+"'];"})).join(" ");return new Function("data",n+" return "+t)(e)})),_.isError(n)&&(n=_.get(e,t)),n},_t=function(e){return qe.SUPPORTED_IMAGE_FORMAT.test(e)},Ot=function(e){return qe.SUPPORTED_AUDIO_FORMAT.test(e)},St=function(e){return qe.SUPPORTED_VIDEO_FORMAT.test(e)},Et=function(e){return qe.VALID_WEB_URL.test(e)},Tt=function(e){return Et(e),e};function Ct(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var i=1,o=arguments.length,r=new Array(o-i);i<o;i++)r[i-1]=arguments[i];if(_.isFunction(e))return e.apply(null,r)}var At=function(e,t,n,i,o,r,a){if(t){if("timestamp"===n)return moment(t).valueOf();if("UTC"===n)return new Date(t).toISOString();if(i){var s=n.replaceAll("y","Y").replaceAll("d","D").replace("a","A");if(r)return moment(t).format(s);if("datetimestamp"===o)return t=dn(i,t),moment(t).format(s)}return e.transform(t,n,i,a)}},Rt=function(e){if("string"==typeof e){var t=e.match(qe.ISO_DATE_FORMAT);return!(!t||!t[4])||void 0}},It=function(e,t,n){if(t&&t.pattern&&"timestamp"!==t.pattern){var i=(t&&t.hasOwnProperty("isNativePicker")?_.get(t,"isNativePicker"):at())?"YYYY/MM/DD HH:mm:ss":Qt(t.pattern);e=moment(e,i).toDate()}if(_.isDate(e))return e;if(isNaN(e)||(e=parseInt(e,10)),moment(e).isValid()&&""!==e&&null!=e){var o=new Date(e);return _.isString(e)&&(o=n?dn(n,e):new Date(moment(moment(e).format()).valueOf())),"CURRENT_DATE"===e||isNaN(o.getDay())?He:o}},Dt=function(e,t,n,i,o,r,a,s){void 0===s&&(s=!1);var l=e,c=function(e){if(!t||!t.contains(e.target)&&t!==e.target)if(n.contains(e.target)){if($(e.target).is("input")&&!o)return;l.removeEventListener(i,c,s)}else 0===a&&l.removeEventListener(i,c,s),r()};l.addEventListener(i,c,s);return function(){l.removeEventListener(i,c,s)}},Nt=function(e){return _.cloneDeep(e)},xt=function(e,t,n){var i=_.get(document.forms,[e,t,"files"]);return n?_.map(i,_.identity):i&&i[0]};function kt(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}var Mt,Lt,Ft=function(){return kt()+"-"+kt()+"-"+kt()},jt=function(e,t){var n;return!e||!t||(n=e&&e.split(",").map(Function.prototype.call,String.prototype.trim),_.intersection(n,t.userRoles).length)},Bt=function(e){if(e)try{var t=parseInt(e,10);return Ke(e)||!isNaN(t)?e:JSON.parse(e)}catch(e){return}},Gt=function(e){var t=new X2JS({emptyNodeForm:"content",attributePrefix:"",enableToStringFunc:!1}).xml2js(e);return t&&(t=_.get(t,Object.keys(t)[0])),t},Vt=function(e,t,n){if(e&&t){if(!n)return _.get(e,t);var i,o=t.split("."),r=[];if(o.forEach((function(e){if(!o.length)return i=!0,!1;for(var t,n=e.match(/\w+/g);n.length;)t=n.shift(),r.push({key:t,value:n.length?[]:{}})})),!i)return r.forEach((function(t){var n=e[t.key];Ke(n)||(n=Bt(n))||(n=t.value),e[t.key]=n,e=n})),e}},$t=function(t){var n;return t?n=(n=(n=t&&t.substring(t.lastIndexOf(".")+1))&&n.toLowerCase())===e.DataType.LOCALDATETIME?e.DataType.DATETIME:n:e.DataType.STRING},Ut=function(e){return-1!==ze.indexOf($t(e).toLowerCase())},Wt=function(e){return!(!Ke(e)||_.isArray(e))&&0===Object.keys(e).length},qt=function(e){var t=$(e),n=t.offset().top,i=t.closest('[wmsmoothscroll="true"]');if(st()&&i.length){var o=_.get(i[0],"iscroll"),r=-(n-o.y);r=o.maxScrollY>r?o.maxScrollY:r,o.scrollTo(0,r)}else window.scroll({top:n,left:0,behavior:"smooth"})},zt=function(e){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)},Ht=function(e){var t=_.omit(e,"empty");return _.isEqual(_.keys({content:[],first:!0,last:!0,number:0,numberOfElements:10,size:20,sort:null,totalElements:10,totalPages:1}),_.keys(t).sort())},Yt=function(e,t,n){var i=qe.REPLACE_PATTERN;if(e)return n&&(i=/\{([^\}]+)\}/g),e.replace(i,(function(e,n){return _.get(t,n)}))},Kt=function(t){return _.includes(t,".")&&(t=_.toLower($t(t))),_.includes([e.DataType.DATE,e.DataType.TIME,e.DataType.TIMESTAMP,e.DataType.DATETIME,e.DataType.LOCALDATETIME],t)},Qt=function(e){return _.includes(e,"E")&&(e=_.replace(e,/E[,]?/g,"")),_.replace(e,/y*d*/g,(function(e){return e.toUpperCase()}))},Xt=Qt,Jt=function(e,t){var n=["AM","PM"],i=moment()._locale.meridiem();t&&t.meridians&&_.includes(n,i)&&_.forEach(t.meridians,(function(t,i){_.includes(e,t)&&(e=e.replace(t,n[i]))}));var o=(t&&t.hasOwnProperty("isNativePicker")?_.get(t,"isNativePicker"):at())?_.get(t,"pattern")||"YYYY/MM/DD HH:mm:ss":Qt(_.get(t,"pattern"))||"";return t&&t.pattern&&"timestamp"!==t.pattern&&(isNaN(new Date(e).getTime())?e=moment(e,o):(it()&&(e=moment(e).format("YYYY/MM/DD HH:mm:ss")),e=moment(new Date(e),o)),e=e.toDate()),moment(e,o).isValid()?(it()&&(e=moment(moment(e).valueOf()).format("YYYY/MM/DD HH:mm:ss")),e):(isNaN(e)?new Date(e).getTime()||(e=moment(moment().format("YYYY-MM-DD")+" "+e,"YYYY-MM-DD HH:mm:ss A")):e=parseInt(e,10),new Date(moment(e).valueOf()))},Zt=function(e,t){return e=Jt(e,t),new Date(e)},en=function(e,t){if(e instanceof Blob)return e;var n=Bt(e);return e=n&&n instanceof Object?new Blob([JSON.stringify(n)],{type:t||"application/json"}):new Blob([e],{type:t||"text/plain"})},tn=function(e,t,n){var i=_.isArray(n)?n:_.split(n,",");return i=_.map(i,_.trim),_.isEqualWith(e,t,(function(e,t){return _.every(i,(function(n){var i,o,r;return-1===_.indexOf(n,":")?i=o=_.trim(n):(r=_.split(n,":"),i=_.trim(r[0]),o=_.trim(r[1])),_.get(e,i)===_.get(t,o)}))}))},nn=function(e){return document.querySelector(e)},on=nn,rn=function(e){return!!nn('link[href="'+e+'"]')},an=rn,sn=function(e){var t=nn('link[href="'+e+'"]');t&&t.remove()},ln=function(e,t){if(!rn(e)){var n=document.createElement("link");return n.href=e,t&&t.name&&n.setAttribute(t.name,t.value),n.setAttribute("rel","stylesheet"),n.setAttribute("type","text/css"),document.head.appendChild(n),n}},cn=function(e){void 0===e&&(e=[]),Array.isArray(e)||(e=[e]),e.forEach(ln)},pn=function(e){return!!nn('script[src="'+e+'"], script[data-src="'+e+'"]')},un=pn,dn=function(e,t){return t?new Date(new Date(moment(t).tz(e).format()).toLocaleString("en-US",{timeZone:e})):new Date(new Date(moment().tz(e).format()).toLocaleString("en-US",{timeZone:e}))},hn=function(e,t,n){return void 0===n&&(n=!1),C(void 0,void 0,void 0,(function(){var i;return A(this,(function(o){return!(i=e.trim()).length||pn(i)?[2,Promise.resolve()]:t?[2,new Promise((function(e,t){var n=document.createElement("script");n.type="text/javascript",n.src=i,n.async=!1,n.readyState?n.onreadystatechange=function(){"loaded"!==n.readyState&&"complete"!==n.readyState||(n.onreadystatechange=null,e(!0))}:n.onload=function(){e(!0)},n.onerror=function(e){return t(e)},document.getElementsByTagName("head")[0].appendChild(n)}))]:n?[2,$.ajax({dataType:"script",cache:!0,url:e}).done((function(e){return e})).fail((function(e){return e}))]:[2,$.getScript(e).done((function(e){return e})).fail((function(e){return e}))]}))}))},mn=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=!0),C(void 0,void 0,void 0,(function(){var n,i,o,r,a,s;return A(this,(function(l){switch(l.label){case 0:l.trys.push([0,5,6,7]),n=R(e),i=n.next(),l.label=1;case 1:return i.done?[3,4]:(o=i.value,[4,hn(o,t)]);case 2:l.sent(),l.label=3;case 3:return i=n.next(),[3,1];case 4:return[3,7];case 5:return r=l.sent(),a={error:r},[3,7];case 6:try{i&&!i.done&&(s=n.return)&&s.call(n)}finally{if(a)throw a.error}return[7];case 7:return[2,Promise.resolve()]}}))}))},fn={},gn=function(e,t){var n=window.sessionStorage.getItem(fn.id);(n=n?JSON.parse(n):{})[e]=t,window.sessionStorage.setItem(fn.id,JSON.stringify(n))},vn=function(e){var t=window&&window.sessionStorage&&window.sessionStorage.getItem(fn.id);if(t)return(t=JSON.parse(t))[e]},yn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},bn=function(e){return _.isArray(e)},wn=function(e){return"string"==typeof e},Pn=function(e){return"number"==typeof e},_n=function(e){return"boolean"==typeof e},On=function(e){return new Promise((function(t,n){resolveLocalFileSystemURL(e,(function(i){i.file((function(i){var o=new FileReader;o.onloadend=function(){var n=new Blob([o.result],{type:i.type});t({blob:n,filepath:e})},o.onerror=n,o.readAsArrayBuffer(i)}))}),n)}))},Sn=function(){return!!window.cordova},En={INT_MAX_VALUE:2147483647},Tn=function(e,t){void 0===t&&(t="_self"),Sn()&&_.startsWith(e,"#")?location.hash=e:window.open(e,t)},Cn=function(e,t,n,i,o){return void 0===n&&(n=!1),$.ajax({type:"get",dataType:e,url:t,async:!n}).done((function(e){return i&&i(e)})).fail((function(e){return o&&o(e)}))},An=function(e){return e instanceof Promise?e:Promise.resolve(e)},Rn=function(e,t,n,i){void 0===i&&(i=function(){return Promise.resolve(!1)});var o=0,r=function(){if(o++,_.isFunction(e))return e()};return n=_.isNumber(n)&&n>0?n:0,t=_.isNumber(t)&&t>0?t:0,new Promise((function(e,a){var s=function(){var l=arguments;setTimeout((function(){An(i()).then((function(t){!1!==t&&(!n||o<=n)?An(r()).then(e,s):a(l)}),(function(){return a(l)}))}),t)};An(r()).then(e,s)}))},In=function(){var e={promise:null,reject:null,resolve:null,onAbort:function(){},isAborted:!1};return e.promise=new Promise((function(t,n){e.resolve=t,e.reject=n})),e.promise.abort=function(){Ct(e.onAbort),e.reject("aborted"),e.isAborted=!0},e},Dn=function(e,t){document.styleSheets[0].insertRule(e+" { "+t+" }")},Nn=function(e){var t={},n=e.indexOf("?");-1!==n&&_.split(e.substring(n+1,e.length),"&").forEach((function(e){e=_.split(e,"="),t[e[0]]=e[1]}));return t},xn=function(e){var t=(e=e.replace("#/","/")).indexOf("?");return-1!==t&&(e=e.substring(0,t)),e},kn=/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),Mn=function(){var e={promise:null,resolve:yn,reject:yn};return e.promise=new Promise((function(t,n){e.resolve=t,e.reject=n})),e},Ln=function(e,t,n,i){if(n=n||Mn(),0===(i=i||0)&&(e=_.filter(e,(function(e){return!(_.isUndefined(e)||_.isNull(e))}))),e&&i<e.length)try{An(e[i].apply(void 0,t)).then((function(){return Ln(e,t,n,i+1)}),n.reject)}catch(e){n.reject(e)}else n.resolve();return n.promise},Fn=function(e,t){return e.execute(Ne.Operation.GET_UNIQUE_IDENTIFIER)===t.execute(Ne.Operation.GET_UNIQUE_IDENTIFIER)&&_.isEqual(e.execute(Ne.Operation.GET_CONTEXT_IDENTIFIER),t.execute(Ne.Operation.GET_CONTEXT_IDENTIFIER))},jn=function(e,t){return e.execute(Ne.Operation.GET_CONTEXT_IDENTIFIER)===t},Bn=function(e,t,i){var o=e.registerDestroyListener?e.registerDestroyListener.bind(e):_.noop,r=new n.Subject,a=function(n,a){wt(n[a],"bind:")&&o(we(n[a].replace("bind:",""),e,{},i?i.invokeOnFiltertExpressionChange.bind(i,n,a):function(e,i){e===i&&_.isUndefined(e)||_.isUndefined(e)&&!_.isUndefined(i)||(_.includes(["blob","file"],n.type)||(e=Nt(e)),"dataBinding"===n.target?(t.rules=[],_.forEach(e,(function(e,i){t.rules.push({target:i,value:e,matchMode:n.matchMode||"startignorecase",required:!1,type:""})}))):n[a]=e,r.next({filterExpressions:t,newVal:e}))},void 0,!1,{arrayType:_.includes(["in","notin"],n.matchMode)}))},s=function(e){e.rules&&_.forEach(e.rules,(function(e,t){e.rules?s(e):("between"===e.matchMode&&a(e,"secondvalue"),a(e,"value"))}))};return s(t),r},Gn=function(e,t){for(var n=Object.getPrototypeOf(e);Object.getPrototypeOf(n).constructor!==Object;)if(t===(n=Object.getPrototypeOf(n)))return;Object.setPrototypeOf(n,t)},Vn=function(e){if(_.isString(e))return _.startsWith(e,"file:///")||/^data:image\/([a-z]{2,});base64,/.test(e)?e:e.replace(new RegExp("([^:]/)(/)+","g"),"$1")};$.cachedScript=(Mt=new Map,Lt=new Set,function(e){if(function(e){return Lt.has(e)}(e))return Promise.resolve();if(function(e){return Mt.has(e)}(e))return Mt.get(e);!function(e){var t,n,i=new Promise((function(e,i){t=e,n=i}));i.resolve=t,i.reject=n,Mt.set(e,i)}(e);var t={dataType:"script",cache:!0,url:e};return $.ajax(t).done((function(){return function(e){Lt.add(e),Mt.get(e).resolve(),Mt.delete(e)}(e)})),Mt.get(e)});var $n={DATE:"yyyy-MM-dd",TIME:"hh:mm a",TIMESTAMP:"yyyy-MM-dd hh:mm:ss a",DATETIME:"yyyy-MM-dd hh:mm:ss a"},Un=function(e){return $n[_.toUpper(e)]},Wn=function(e){var t=e.querySelectorAll("label.control-label"),n=e.querySelectorAll("[focus-target]");(n.length||(n=e.querySelectorAll("input, select, textarea")),t.length&&n.length)&&((o=$(n[0]).closest("[widget-id]").attr("widget-id"))&&(T(n[0],"id",o),T(t[0],"for",o)));var i=e.querySelectorAll("ul");if(t.length&&i.length&&("radiogroup"===i[0].getAttribute("role")||"group"===i[0].getAttribute("role"))){var o="wm-group-label-"+Ft();T(i[0],"aria-labelledby",o),T(t[0],"id",o)}},qn=function(e,t,n,i){(n._ngZone||n.ngZone).onStable.subscribe((function(){var t=Yn(e);t.m41<0&&(t.m41=0,Hn(e,t))}))},zn=function(e,t,n,i){var o,r=i?_.parseInt(i.css("width")):_.parseInt(e.css("width")),a=$(window).width()+window.scrollX,s=t.getBoundingClientRect(),l=s.right+window.scrollX;(n._ngZone||n.ngZone).onStable.subscribe((function(){var t=Yn(e);a-(l+s.width)<r&&((o=l-r)<0&&(o=0),t.m41=o,Hn(e,t))}))},Hn=function(e,t){var n="translate3d("+t.m41+"px, "+t.m42+"px, 0px)";e[0].style.webkitTransform=n,e[0].style.MozTransform=n,e[0].style.msTransform=n,e[0].style.OTransform=n,e[0].style.transform=n},Yn=function(e){return"undefined"==typeof WebKitCSSMatrix?new MSCSSMatrix(window.getComputedStyle(e[0]).transform):new WebKitCSSMatrix(window.getComputedStyle(e[0]).webkitTransform)},Kn=function(e){if(!e.closest(".app-popover").length){var t=document.querySelectorAll(".app-popover-wrapper");_.forEach(t,(function(e){e.widget.isOpen&&(e.widget.isOpen=!1)}))}},Qn=Re,Xn=function(e,t){var n=t.link,i=t.action,o=t.target;if(i&&(e.itemActionFn||(e.itemActionFn=oe(i)),e.itemActionFn(e.userDefinedExecutionContext,Object.create(t))),n)if(!n.startsWith("#/")||o&&"_self"!==o)Tn(n,o);else{var r=Nn(n);n=xn(n),(_.get(e,"route")||_.get(e,"menuRef.route")).navigate([n],{queryParams:r})}},Jn=function(e,t){var n=_.startsWith(e,"Variables."),i=_.startsWith(e,"Widgets."),o=e.split(".");if(n)return _.get(t.viewParent.Variables,o[1]);if(i){var r,a=_.get(t.viewParent.Widgets,o[1]),s=a.$attrs.get("datasetboundexpr");return r=!a.datasource&&s?s:a.binddataset,Jn(r,a)}},Zn=function(e,t){if(/^Widgets\..*\.currentItem/g.test(e)){var n=e.split("."),i=_.get(t.viewParent.Widgets,n[1]),o=i.$attrs.get("datasetboundexpr");if(!i.datasource&&o)return e=e.replace(/^Widgets\..*\.currentItem/g,o+"[$i]"),Zn(e,t);e=e.replace(/^Widgets\..*\.currentItem/g,i.binddataset+"[$i]")}return e},ei=function(e){var t=e.closest(".app-prefab");return t.length||(t=e.closest(".app-partial")),t.length||(t=e.closest(".app-spa-page")),t.length||(t=e.closest(".app-page")),t.length&&t.parent()[0].tagName},ti={REQUIRED:"required",MAXCHARS:"maxchars",MINVALUE:"minvalue",MAXVALUE:"maxvalue",REGEXP:"regexp",MINDATE:"mindate",MAXDATE:"maxdate",MINTIME:"mintime",MAXTIME:"maxtime",EXCLUDEDATES:"excludedates",EXCLUDEDAYS:"excludedays"},ni=function(e){if(_.isString(e)&&Sn()&&e.startsWith("file://")){if(it())return e.replace("file://","/_app_file_");if(Je()&&location.href.startsWith("http")){if(e.startsWith(cordova.file.applicationDirectory))return e.replace(cordova.file.applicationDirectory+"www","");if(e.startsWith("file://"))return e.replace("file://","/_app_file_")}}return e},ii=function(e){var t=document.createElement("script");t.onload=function(){e(WM_CUSTOM_FORMATTERS)},t.onerror=function(e){console.warn("Error while loading the file "+t.src+"\n"+e)},t.type="text/javascript",t.src="./extensions/formatters.js",document.head.appendChild(t)},oi=function(e,t){return _WM_APP_PROPERTIES.extra_settings&&_.get(_WM_APP_PROPERTIES.extra_settings,e)||t},ri=function(e){var t="";e.itemsperrow?isNaN(parseInt(e.itemsperrow,10))?(_.split(e.itemsperrow," ").forEach((function(e){var n=_.split(e,"-");e=n[0]+"-"+12/parseInt(n[1],10),t+=" col-"+e})),e.itemsPerRowClass=t.trim()):e.itemsPerRowClass="col-xs-"+12/parseInt(e.itemsperrow,10):e.itemsPerRowClass="col-xs-12"},ai=Object.freeze({__proto__:null,isDefined:Ye,isObject:Ke,toBoolean:Qe,isIE:Xe,isAndroid:Je,isAndroidTablet:Ze,isIphone:et,isIpod:tt,isIpad:nt,isIos:it,isLargeTabletLandscape:ot,isLargeTabletPortrait:rt,isMobile:at,isTablet:function(){var e=document.querySelector(".app-page").widget;return e&&e.viewParent.Viewport.isTabletType},isMobileApp:st,getAndroidVersion:lt,isKitkatDevice:ct,encodeUrl:pt,encodeUrlParams:ut,initCaps:dt,spaceSeparate:ht,replaceAt:mt,periodSeparate:ft,prettifyLabel:gt,deHyphenate:vt,prettifyLabels:yt,isInsecureContentRequest:bt,stringStartsWith:wt,getEvaluatedExprValue:Pt,isImageFile:_t,isAudioFile:Ot,isVideoFile:St,isValidWebURL:Et,getResourceURL:Tt,triggerFn:Ct,getFormattedDate:At,hasOffsetStr:Rt,getDateObj:It,addEventListenerOnElement:Dt,getClonedObject:Nt,getFiles:xt,generateGUId:Ft,validateAccessRoles:jt,getValidJSON:Bt,xmlToJson:Gt,findValueOf:Vt,extractType:$t,isNumberType:Ut,isEmptyObject:Wt,scrollToElement:qt,isElementInViewport:zt,isPageable:Ht,replace:Yt,isDateTimeType:Kt,getValidDateObject:Jt,getNativeDateObject:Zt,getBlob:en,isEqualWithFields:tn,loadStyleSheet:ln,loadStyleSheets:cn,getMomentLocaleObject:dn,loadScript:hn,loadScripts:mn,_WM_APP_PROJECT:fn,setSessionStorageItem:gn,getSessionStorageItem:vn,noop:yn,isArray:bn,isString:wn,isNumber:Pn,isBoolean:_n,convertToBlob:On,hasCordova:Sn,AppConstants:En,openLink:Tn,fetchContent:Cn,toPromise:An,retryIfFails:Rn,getAbortableDefer:In,createCSSRule:Dn,getUrlParams:Nn,getRouteNameFromLink:xn,isAppleProduct:kn,defer:Mn,executePromiseChain:Ln,isDataSourceEqual:Fn,validateDataSourceCtx:jn,processFilterExpBindNode:Bn,extendProto:Gn,removeExtraSlashes:Vn,getDisplayDateTimeFormat:Un,addForIdAttributes:Wn,adjustContainerPosition:qn,adjustContainerRightEdges:zn,setTranslation3dPosition:Hn,getWebkitTraslationMatrix:Yn,closePopover:Kn,detectChanges:Qn,triggerItemAction:Xn,getDatasourceFromExpr:Jn,extractCurrentItemExpr:Zn,findRootContainer:ei,VALIDATOR:ti,transformFileURI:ni,appendScriptToHead:ii,getAppSetting:oi,setListClass:ri,"\u02750":Xt,"\u02751":on,"\u02752":an,"\u02753":sn,"\u02754":un}),si=function(){function e(e){void 0===e&&(e=!0),this._subject=new n.Subject,this._isInitialized=!1,this._eventsBeforeInit=[],e&&this.start()}return e.prototype.notify=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this._isInitialized?this._subject.next({name:e,data:t}):this._eventsBeforeInit.push({name:e,data:t})},e.prototype.start=function(){var e=this;this._isInitialized||(this._isInitialized=!0,this._eventsBeforeInit.forEach((function(t){return e._subject.next(t)})))},e.prototype.subscribe=function(e,t){var n;return e&&t?(n=this._subject.subscribe((function(n){n&&Ke(n)&&n.name===e&&t.apply(void 0,n.data)})),function(){n.unsubscribe()}):yn},e.prototype.destroy=function(){this._subject.complete()},e}(),li=768,ci=1200,pi=function(){function e(){var e=this;this.orientation={isPortrait:!1,isLandscape:!1},this.isMobileType=!1,this.isTabletType=!1,this._eventNotifier=new si(!0),this.setScreenType(),window.addEventListener("resize",this.resizeFn.bind(this));var t=window.matchMedia("(orientation: portrait)");t.matches?this.orientation.isPortrait=!0:this.orientation.isLandscape=!0,t.addEventListener&&t.addEventListener("change",(function(t){return e.orientationChange(t,!t.matches)}))}return e.prototype.update=function(e){this.selectedViewPort=e,this.setScreenType()},e.prototype.orientationChange=function(e,t){t!==this.orientation.isLandscape&&(this.orientation.isPortrait=!t,this.orientation.isLandscape=t,this.notify("orientationchange",{$event:e,data:{isPortrait:!t,isLandscape:t}}))},e.prototype.resizeFn=function(e){this.setScreenType(),this.orientationChange(e,this.screenWidth>=this.screenHeight),this.notify("resize",{$event:e,data:{screenWidth:this.screenWidth,screenHeight:this.screenHeight}})},e.prototype.subscribe=function(e,t){return this._eventNotifier.subscribe(e,t)},e.prototype.notify=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this._eventNotifier.notify.apply(this._eventNotifier,arguments)},e.prototype.setScreenType=function(){var e=document.querySelector(".wm-app");this.screenWidth=e.clientWidth,this.screenHeight=e.clientHeight;this.screenWidth<this.screenHeight?this.screenWidth:this.screenHeight,this.screenWidth>this.screenHeight?this.screenWidth:this.screenHeight;if(this.isTabletType=!1,this.isMobileType=!1,_.get(this.selectedViewPort,"deviceCategory")){var t=this.selectedViewPort.deviceCategory;"Tab"===t?this.isTabletType=!0:"Smartphone"===t&&(this.isMobileType=!0)}else parseInt(getComputedStyle(document.documentElement).getPropertyValue("--screen-xs"))||480,li=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--screen-sm"))||768,ci=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--screen-lg"))||1200,this.screenWidth>=ci?(this.isTabletType=Je()||it()||Ze(),this.isMobileType=!1):this.screenWidth>=li?(this.type=1,this.isTabletType=!0):(this.type=0,this.isMobileType=!0)},e.prototype.ngOnDestroy=function(){this._eventNotifier.destroy(),window.removeEventListener("resize",this.resizeFn)},e}();pi.\u0275prov=p.\u0275\u0275defineInjectable({factory:function(){return new pi},token:pi,providedIn:"root"}),pi.decorators=[{type:i.Injectable,args:[{providedIn:"root"}]}],pi.ctorParameters=function(){return[]};var ui=function(){this.MATCH_MODES={STARTS_WITH_IGNORE_CASE:"startignorecase",STARTS_WITH:"start",ENDS_WITH_IGNORE_CASE:"endignorecase",ENDS_WITH:"end",CONTAINS:"anywhere",CONTAINS_IGNORE_CASE:"anywhereignorecase",IS_EQUAL_WITH_IGNORE_CASE:"exactignorecase",IS_EQUAL:"exact"},this.VALIDATOR=ti};ui.\u0275prov=p.\u0275\u0275defineInjectable({factory:function(){return new ui},token:ui,providedIn:"root"}),ui.decorators=[{type:i.Injectable,args:[{providedIn:"root"}]}];var di=function(){_.assign(this,ai)};di.\u0275prov=p.\u0275\u0275defineInjectable({factory:function(){return new di},token:di,providedIn:"root"}),di.decorators=[{type:i.Injectable,args:[{providedIn:"root"}]}],di.ctorParameters=function(){return[]};var hi=function(){_.assign(this,{INTEGER:"integer",BIG_INTEGER:"big_integer",SHORT:"short",FLOAT:"float",BIG_DECIMAL:"big_decimal",DOUBLE:"double",LONG:"long",BYTE:"byte",STRING:"string",CHARACTER:"character",TEXT:"text",DATE:"date",TIME:"time",TIMESTAMP:"timestamp",DATETIME:"datetime",BOOLEAN:"boolean",LIST:"list",CLOB:"clob",BLOB:"blob"})};hi.\u0275prov=p.\u0275\u0275defineInjectable({factory:function(){return new hi},token:hi,providedIn:"root"}),hi.decorators=[{type:i.Injectable,args:[{providedIn:"root"}]}],hi.ctorParameters=function(){return[]};var mi=function(){_.assign(this,{TEXT:"text",NUMBER:"number",TEXTAREA:"textarea",PASSWORD:"password",CHECKBOX:"checkbox",SLIDER:"slider",RICHTEXT:"richtext",CURRENCY:"currency",SWITCH:"switch",SELECT:"select",CHECKBOXSET:"checkboxset",RADIOSET:"radioset",DATE:"date",TIME:"time",TIMESTAMP:"timestamp",UPLOAD:"upload",RATING:"rating",DATETIME:"datetime",AUTOCOMPLETE:"autocomplete",CHIPS:"chips",COLORPICKER:"colorpicker"})};mi.\u0275prov=p.\u0275\u0275defineInjectable({factory:function(){return new mi},token:mi,providedIn:"root"}),mi.decorators=[{type:i.Injectable,args:[{providedIn:"root"}]}],mi.ctorParameters=function(){return[]};var fi=[],gi=function(){function e(e){var t=this;this.http=e,this.scripts={},fi.forEach((function(e){t.scripts[e.name]={loaded:!1,src:e.src}}))}return e.prototype.load=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t&&t.length?Promise.resolve().then((function(){return e.pathMappings||e.loadPathMappings()})).then((function(){return Promise.all(t.map((function(t){return e.loadScript(t)})))})):Promise.resolve()},e.prototype.loadPathMappings=function(){var e=this,t=(fn.cdnUrl||fn.ngDest)+"path_mapping.json";return this.http.get(t).toPromise().then((function(t){e.pathMappings=t}),(function(){e.pathMappings={}}))},e.prototype.loadScript=function(e){var t=this;return new Promise((function(n,i){if(t.scripts[e]&&t.scripts[e].loaded)n({script:e,loaded:!0});else{t.scripts[e]||(t.scripts[e]={loaded:!1,src:e});var o=document.createElement("script");o.type="text/javascript",o.async=!1;var r=t.scripts[e].src;(r=t.pathMappings[r]||r).startsWith("http")?o.src=r:o.src=(fn.cdnUrl||fn.ngDest)+r,o.readyState?o.onreadystatechange=function(){"loaded"!==o.readyState&&"complete"!==o.readyState||(o.onreadystatechange=null,t.scripts[e].loaded=!0,n({script:e,loaded:!0}))}:o.onload=function(){t.scripts[e].loaded=!0,n({script:e,loaded:!0})},o.onerror=function(t){return n({script:e,loaded:!1,status:"Loaded"})},document.getElementsByTagName("head")[0].appendChild(o)}}))},e}();gi.\u0275prov=p.\u0275\u0275defineInjectable({factory:function(){return new gi(p.\u0275\u0275inject(u.HttpClient))},token:gi,providedIn:"root"}),gi.decorators=[{type:i.Injectable,args:[{providedIn:"root"}]}],gi.ctorParameters=function(){return[{type:o.HttpClient}]};var vi=function(){function e(){this.customPipes=new Map}return e.prototype.setCustomPipe=function(e,t){this.customPipes.set(e,t)},e.prototype.getCustomPipe=function(e){return this.customPipes.get(e)},e.prototype.hasCustomPipe=function(e){return this.customPipes.has(e)},e}();vi.\u0275prov=p.\u0275\u0275defineInjectable({factory:function(){return new vi},token:vi,providedIn:"root"}),vi.decorators=[{type:i.Injectable,args:[{providedIn:"root"}]}];var yi=function(){function e(){this.HISTORY_HANDLER="replace",this.HISTORY_HANDLER_TYPES={push:"pushState",replace:"replaceState"},this.WIDGET_STATE_KEY="ws"}return e.prototype.setHistoryHandler=function(e){Object.keys(this.HISTORY_HANDLER_TYPES).indexOf(e)>-1&&(this.HISTORY_HANDLER=e)},e.prototype.getNestedPath=function(e,t,n){var i=n||t;return e&&(e.prefabName||e.partialName)?(i=(i=i.length>0?i+"."+(e.prefabName||e.partialName):e.prefabName||e.partialName)+"."+e.containerWidget.name,this.getNestedPath(e.containerWidget.viewParent,t,i)):i.split(".").reverse().join(".")},e.prototype.getStateInformation=function(e){var t;if("url"===e.toLowerCase()){if(t=decodeURIComponent(window.location.href).match(/(wm_state=).*?(&|$)/))return t=t[0].replace("wm_state=",""),this.uriToJson(t)}else"localstorage"===e.toLowerCase()?t=localStorage.getItem(window.location.pathname.replace(/\//g,"")+"_wm_state"):"sessionstorage"===e.toLowerCase()&&(t=sessionStorage.getItem(window.location.pathname.replace(/\//g,"")+"_wm_state"));if(t)return JSON.parse(t)},e.prototype.getWidgetState=function(e,t){if(t=t||this.computeMode(e.statehandler)){var n=this.getStateInformation(t);if(n&&e&&e.getAppInstance().activePageName&&("localstorage"===t.toLowerCase()||"sessionstorage"===t.toLowerCase())&&(n=n[e.getAppInstance().activePageName]),_.get(n,this.WIDGET_STATE_KEY)){var i=this.getNestedPath(e.viewParent,e.getWidget().name);return n[this.WIDGET_STATE_KEY][i]}}},e.prototype.computeMode=function(e){return e?e&&"none"===e.toLowerCase()?void 0:e.toLowerCase():"url"},e.prototype.setWidgetState=function(e,t,n){var i=this.getNestedPath(e.viewParent,e.getWidget().name);(n=n||this.computeMode(e.statehandler))&&this.setStateParams(this.WIDGET_STATE_KEY,i,t,n,e)},e.prototype.removeWidgetState=function(e,t,n){if(n=n||this.computeMode(e.statehandler)){var i=this.getNestedPath(e.viewParent,e.getWidget().name);this.removeStateParam(this.WIDGET_STATE_KEY,i,t,n,e)}},e.prototype.setStateVariable=function(e,t,n){(n=n||this.computeMode(n))&&this.setStateParams("",e,t,n)},e.prototype.getStateVariable=function(e,t){if(t=t||this.computeMode(t)){var n=this.getStateInformation(t);return n?n[e]:void 0}},e.prototype.removeStateVariable=function(e,t){(t=t||this.computeMode(t))&&this.removeStateParam("",e,null,t)},e.prototype.setStateParams=function(e,t,n,i,o){var r,a,s,l,c,p=this.getStateInformation(i);c=o&&p&&o.getAppInstance().activePageName&&("localstorage"===i.toLowerCase()||"sessionstorage"===i.toLowerCase())?p[o.getAppInstance().activePageName]:_.clone(p),e?(c&&!c[e]?c[e]={}:c||((r={})[e]={},c=r),_.isObject(n)&&!_.isArray(n)?(c[e][t]=c[e][t]||{},_.merge(c[e][t],n)):c[e][t]=n):(c&&!c[t]?c[t]={}:c||((a={})[t]={},c=a),_.isObject(n)&&!_.isArray(n)?(c[t]=c[t]||{},_.merge(c[t],n)):c[t]=n),o&&o.getAppInstance().activePageName&&("localstorage"===i.toLowerCase()||"sessionstorage"===i.toLowerCase())&&(p?(p[o.getAppInstance().activePageName]=c,c=p):((s={})[o.getAppInstance().activePageName]=c,c=s));var u=decodeURIComponent(window.location.href);u.indexOf("?")<0?u+="?wm_state=":u.indexOf("wm_state")<0&&(u+="&wm_state="),l=u.replace(/(wm_state=).*?(&|$)/,"$1"+this.jsonToUri(c)+"$2"),"localstorage"!==i.toLowerCase()?"sessionstorage"!==i.toLowerCase()?decodeURIComponent(window.location.href)!==decodeURIComponent(l)&&("push"===this.HISTORY_HANDLER?window.history.pushState({path:l},"",l):"replace"===this.HISTORY_HANDLER&&window.history.replaceState({path:l},"",l)):sessionStorage.setItem(window.location.pathname.replace(/\//g,"")+"_wm_state",JSON.stringify(c)):localStorage.setItem(window.location.pathname.replace(/\//g,"")+"_wm_state",JSON.stringify(c))},e.prototype.removeStateParam=function(e,t,n,i,o){var r,a,s="",l=this.getStateInformation(i);if(a=o&&l&&o.getAppInstance().activePageName&&("localstorage"===i.toLowerCase()||"sessionstorage"===i.toLowerCase())?l[o.getAppInstance().activePageName]:_.clone(l),_.get(a,[e])||_.get(a,t))if(_.get(a,e+"."+t)||a&&a[e]&&a[e][t]?(n?delete a[e][t][n]:delete a[e][t],_.isEmpty(a[e][t])&&delete a[e][t],_.isEmpty(a[e])&&delete a[e]):!e&&_.get(a,t)&&delete a[t],o&&o.getAppInstance().activePageName&&("localstorage"===i.toLowerCase()||"sessionstorage"===i.toLowerCase())&&(l?(l[o.getAppInstance().activePageName]=a,a=l):((r={})[o.getAppInstance().activePageName]=a,a=r)),"localstorage"!==i.toLowerCase())if("sessionstorage"!==i.toLowerCase()){var c=decodeURIComponent(window.location.href);_.isEmpty(a)?(s=c.replace(/(wm_state=).*?(&|$)/,"$2"),_.includes(["&","?"],s.charAt(s.length-1))&&(s=s.replace(s.charAt(s.length-1),""))):s=c.replace(/(wm_state=).*?(&|$)/,"$1"+this.jsonToUri(a)+"$2"),window.history.replaceState({path:s},"",s)}else sessionStorage.setItem(window.location.pathname.replace(/\//g,"")+"_wm_state",JSON.stringify(a));else localStorage.setItem(window.location.pathname.replace(/\//g,"")+"_wm_state",JSON.stringify(a))},e.prototype.jsonToUri=function(e){return encodeURIComponent(JSON.stringify(e).replace(/[()'~_!*]/g,(function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})).replace(/\{/g,"(").replace(/\}/g,")").replace(/"/g,"'").replace(/\:/g,"~").replace(/,/g,"_").replace(/\[/g,"!").replace(/\]/g,"*"))},e.prototype.uriToJson=function(e){var t;try{t=JSON.parse(decodeURIComponent(e).replace(/\(/g,"{").replace(/\)/g,"}").replace(/'/g,'"').replace(/~/g,":").replace(/_/g,",").replace(/\!/g,"[").replace(/\*/g,"]"))}catch(e){console.warn(e)}return t},e}();yi.\u0275prov=p.\u0275\u0275defineInjectable({factory:function(){return new yi},token:yi,providedIn:"root"}),yi.decorators=[{type:i.Injectable,args:[{providedIn:"root"}]}];var bi=function(){function e(){}return e.prototype.updateFieldsOnPagination=function(e,t){var n,i="wm-table"===e.widgetType?e.gridData:e.fieldDefs;"wm-table"===e.widgetType&&e.gridOptions.isNavTypeScrollOrOndemand()&&-1!==e.gridOptions.deletedRowIndex&&(i.splice(e.gridOptions.deletedRowIndex,1),e.gridOptions.setDeletedRowIndex(-1)),"wm-table"!==e.widgetType||!e.gridOptions.isNavTypeScrollOrOndemand()||e.gridOptions.lastActionPerformed!==e.gridOptions.ACTIONS.SEARCH_OR_SORT&&e.gridOptions.lastActionPerformed!==e.gridOptions.ACTIONS.FILTER_CRITERIA&&e.gridOptions.lastActionPerformed!==e.gridOptions.ACTIONS.DATASET_UPDATE||(i=[],e.gridOptions.setCurrentPage(1)),n="wm-table"===e.widgetType&&e.gridOptions.showviewlessbutton&&"viewless"===e.gridOptions.mode?e.gridOptions.getCurrentPage():e.currentPage;var o=e.dataNavigator,r=e.pagesize;if(!Ye(i)||o.isFirstPage())i=[],n=1;else if(i.length/r<=o.pageCount){var a=void 0,s=[];if(i.length===n*r&&n+1===o.dn.currentPage)s=t,n++;else if(i.length<n*r){i.length===(n-1)*r&&n-1===o.dn.currentPage?t=[]:o.dataSize<n*r?a=o.dataSize-i.length:(a=n*r-i.length,n++);var l=t.length-a;s=t.slice(l)}else i.length===n*r&&n===o.dn.currentPage&&(s=[]);t=s}return[i="wm-table"!==e.widgetType||e.gridOptions.lastActionPerformed!==e.gridOptions.ACTIONS.DELETE&&e.gridOptions.lastActionPerformed!==e.gridOptions.ACTIONS.EDIT?D(D([],I(i)),I(t)):this.getUniqueRecordsInFieldDef(i,t),n]},e.prototype.getUniqueRecordsInFieldDef=function(e,t){var n=!1;return e.length?t.forEach((function(t){n=!1,e.forEach((function(e){_.isEqual(t,e)&&(n=!0)})),!1===n&&e.push(t)})):e=t,e},e.prototype.bindScrollEvt=function(e,t,n){var i,o,r=this,a=e.dataNavigator,s=e.$element.find(t),l=s.children().first(),c=this,p=0;l.length&&((o=(i=l.scrollParent(!1))[0]===document?document.body:i[0]).scrollHeight>o.clientHeight?(i.each((function(e,t){p=t===document?t.body.scrollTop||$(window).scrollTop():t.scrollTop})).off("scroll.scroll_evt").on("scroll.scroll_evt",(function(t){var i,o,r,s=t.target;s=s===document?s.scrollingElement||document.body:s,"wm-table"===e.widgetType&&e.gridOptions.isNavTypeScrollOrOndemand()&&t.stopPropagation(),i=s.clientHeight,o=s.scrollHeight,r=s===document.body?$(window).scrollTop():s.scrollTop,p<r&&.9*o<r+i&&($(this).off("scroll.scroll_evt"),c.debouncedFetchNextDatasetOnScroll(a,n,e)()),p=r})),s.off("wheel.scroll_evt")):s.on("wheel.scroll_evt",(function(t){"wm-table"===e.widgetType&&e.gridOptions.isNavTypeScrollOrOndemand()&&t.stopPropagation(),t.originalEvent.deltaY>0&&(s.off("wheel.scroll_evt"),r.debouncedFetchNextDatasetOnScroll(a,n,e)())})))},e.prototype.debouncedFetchNextDatasetOnScroll=function(e,t,n){var i=this;return _.debounce((function(){return i.fetchNextDatasetOnScroll(e,n)}),t)},e.prototype.fetchNextDatasetOnScroll=function(e,t){t.variableInflight||("wm-table"===t.widgetType&&(t.gridOptions.setIsNextPageData(!0),t.gridOptions.setIsDataUpdatedByUser(!1)),e.navigatePage("next"))},e.prototype.bindIScrollEvt=function(e,t){var n=this,i=e.$element,o=e.dataNavigator,r=e.app,a=i.closest('[wmsmoothscroll="true"]');if(_.get(a[0],"iscroll"))this.setIscrollHandlers(a[0],o,t);else{var s=r.subscribe("iscroll-update",(function(e){!_.isEmpty(e)&&e.isSameNode(a[0])&&(n.setIscrollHandlers(a[0],o,t),s())}));r.notify("no-iscroll",a[0])}},e.prototype.setIscrollHandlers=function(e,t,n){var i=this,o=0,r=_.get(e.iscroll,"wrapper"),a=e.iscroll;e.iscroll.on("scrollEnd",(function(){var s=r.clientHeight,l=r.scrollHeight,c=Math.abs(e.iscroll.y);o<c&&.9*l<c+s&&(i.debouncedFetchNextDatasetOnScroll(t,n,parent)(),a.indicatorRefresh&&a.indicatorRefresh()),o=c}))},e}();bi.\u0275prov=p.\u0275\u0275defineInjectable({factory:function(){return new bi},token:bi,providedIn:"root"}),bi.decorators=[{type:i.Injectable,args:[{providedIn:"root"}]}];var wi=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[]}},e}();wi.decorators=[{type:i.NgModule,args:[{declarations:[],imports:[o.HttpClientModule],providers:[],bootstrap:[]}]}];var Pi=function(){function e(e,t,n){var i=this;void 0===e&&(e=100),void 0===t&&(t=60),this.maxSize=e,this.maxAge=t,this.onEvict=n,this.cache=new Map,this.evictQueue=[""],this.evictQueue.shift(),this.maxAge>0&&(this.maxAge<=30&&console.warn("Cache age "+this.maxAge+"s is very less. Keep it atleast 30s."),this.maxAge=1e3*this.maxAge,setInterval((function(){var e=Date.now()-i.maxAge,t=i.evictQueue.filter((function(t){return i.cache.get(t).lastAccessedTime<=e}));i.evict(t.length)}),this.maxAge))}return e.prototype.addToEvictQueue=function(e){var t=this.evictQueue.findIndex((function(t){return t===e}));t>=0&&this.evictQueue.splice(t,1),this.evictQueue.push(e)},e.prototype.evict=function(e){void 0===e&&(e=1);for(var t=0;t<e;t++)this.delete(this.evictQueue[0])},e.prototype.keys=function(){return this.cache.keys()},e.prototype.set=function(e,t){if(!_.isNil(t)){var n={instance:t,lastAccessedTime:Date.now()};this.cache.set(e,n),this.addToEvictQueue(e),this.evict(this.evictQueue.length-this.maxSize)}},e.prototype.get=function(e){var t=this.cache.get(e);return t?(t.lastAccessedTime=Date.now(),this.addToEvictQueue(e),t.instance):null},e.prototype.delete=function(e){if(e&&this.cache.has(e)){var t=this.cache.get(e);this.cache.delete(e),this.onEvict&&this.onEvict(e,t.instance);var n=this.evictQueue.findIndex((function(t){return t===e}));n>=0&&this.evictQueue.splice(n,1)}},e.prototype.has=function(e){return this.cache.has(e)},e.prototype.size=function(){return this.evictQueue.length},e.prototype.clear=function(){this.evict(this.evictQueue.length)},e}();e.$appDigest=Re,e.$invokeWatchers=function(e,t){if(e)Se(t);else{if(fe)return void(fe=!1);Ae()}},e.$parseEvent=oe,e.$parseExpr=ne,e.$unwatch=Pe,e.$watch=we,e.AbstractDialogService=ke,e.AbstractHttpService=Me,e.AbstractI18nService=Le,e.AbstractNavigationService=Ge,e.AbstractSpinnerService=je,e.AbstractToasterService=Fe,e.App=xe,e.AppConstants=En,e.AppDefaults=Ve,e.CURRENCY_INFO={USD:{symbol:"$",name:"US Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"USD",name_plural:"US dollars"},CAD:{symbol:"CA$",name:"Canadian Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"CAD",name_plural:"Canadian dollars"},EUR:{symbol:"\u20ac",name:"Euro",symbol_native:"\u20ac",decimal_digits:2,rounding:0,code:"EUR",name_plural:"euros"},AED:{symbol:"AED",name:"United Arab Emirates Dirham",symbol_native:"\u062f.\u0625.\u200f",decimal_digits:2,rounding:0,code:"AED",name_plural:"UAE dirhams"},AFN:{symbol:"Af",name:"Afghan Afghani",symbol_native:"\u060b",decimal_digits:0,rounding:0,code:"AFN",name_plural:"Afghan Afghanis"},ALL:{symbol:"ALL",name:"Albanian Lek",symbol_native:"Lek",decimal_digits:0,rounding:0,code:"ALL",name_plural:"Albanian lek\xeb"},AMD:{symbol:"AMD",name:"Armenian Dram",symbol_native:"\u0564\u0580.",decimal_digits:0,rounding:0,code:"AMD",name_plural:"Armenian drams"},ARS:{symbol:"AR$",name:"Argentine Peso",symbol_native:"$",decimal_digits:2,rounding:0,code:"ARS",name_plural:"Argentine pesos"},AUD:{symbol:"AU$",name:"Australian Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"AUD",name_plural:"Australian dollars"},AZN:{symbol:"man.",name:"Azerbaijani Manat",symbol_native:"\u043c\u0430\u043d.",decimal_digits:2,rounding:0,code:"AZN",name_plural:"Azerbaijani manats"},BAM:{symbol:"KM",name:"Bosnia-Herzegovina Convertible Mark",symbol_native:"KM",decimal_digits:2,rounding:0,code:"BAM",name_plural:"Bosnia-Herzegovina convertible marks"},BDT:{symbol:"Tk",name:"Bangladeshi Taka",symbol_native:"\u09f3",decimal_digits:2,rounding:0,code:"BDT",name_plural:"Bangladeshi takas"},BGN:{symbol:"BGN",name:"Bulgarian Lev",symbol_native:"\u043b\u0432.",decimal_digits:2,rounding:0,code:"BGN",name_plural:"Bulgarian leva"},BHD:{symbol:"BD",name:"Bahraini Dinar",symbol_native:"\u062f.\u0628.\u200f",decimal_digits:3,rounding:0,code:"BHD",name_plural:"Bahraini dinars"},BIF:{symbol:"FBu",name:"Burundian Franc",symbol_native:"FBu",decimal_digits:0,rounding:0,code:"BIF",name_plural:"Burundian francs"},BND:{symbol:"BN$",name:"Brunei Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"BND",name_plural:"Brunei dollars"},BOB:{symbol:"Bs",name:"Bolivian Boliviano",symbol_native:"Bs",decimal_digits:2,rounding:0,code:"BOB",name_plural:"Bolivian bolivianos"},BRL:{symbol:"R$",name:"Brazilian Real",symbol_native:"R$",decimal_digits:2,rounding:0,code:"BRL",name_plural:"Brazilian reals"},BWP:{symbol:"BWP",name:"Botswanan Pula",symbol_native:"P",decimal_digits:2,rounding:0,code:"BWP",name_plural:"Botswanan pulas"},BYR:{symbol:"BYR",name:"Belarusian Ruble",symbol_native:"BYR",decimal_digits:0,rounding:0,code:"BYR",name_plural:"Belarusian rubles"},BZD:{symbol:"BZ$",name:"Belize Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"BZD",name_plural:"Belize dollars"},CDF:{symbol:"CDF",name:"Congolese Franc",symbol_native:"FrCD",decimal_digits:2,rounding:0,code:"CDF",name_plural:"Congolese francs"},CHF:{symbol:"CHF",name:"Swiss Franc",symbol_native:"CHF",decimal_digits:2,rounding:.05,code:"CHF",name_plural:"Swiss francs"},CLP:{symbol:"CL$",name:"Chilean Peso",symbol_native:"$",decimal_digits:0,rounding:0,code:"CLP",name_plural:"Chilean pesos"},CNY:{symbol:"CN\xa5",name:"Chinese Yuan",symbol_native:"CN\xa5",decimal_digits:2,rounding:0,code:"CNY",name_plural:"Chinese yuan"},COP:{symbol:"CO$",name:"Colombian Peso",symbol_native:"$",decimal_digits:0,rounding:0,code:"COP",name_plural:"Colombian pesos"},CRC:{symbol:"\u20a1",name:"Costa Rican Col\xf3n",symbol_native:"\u20a1",decimal_digits:0,rounding:0,code:"CRC",name_plural:"Costa Rican col\xf3ns"},CVE:{symbol:"CV$",name:"Cape Verdean Escudo",symbol_native:"CV$",decimal_digits:2,rounding:0,code:"CVE",name_plural:"Cape Verdean escudos"},CZK:{symbol:"K\u010d",name:"Czech Republic Koruna",symbol_native:"K\u010d",decimal_digits:2,rounding:0,code:"CZK",name_plural:"Czech Republic korunas"},DJF:{symbol:"Fdj",name:"Djiboutian Franc",symbol_native:"Fdj",decimal_digits:0,rounding:0,code:"DJF",name_plural:"Djiboutian francs"},DKK:{symbol:"Dkr",name:"Danish Krone",symbol_native:"kr",decimal_digits:2,rounding:0,code:"DKK",name_plural:"Danish kroner"},DOP:{symbol:"RD$",name:"Dominican Peso",symbol_native:"RD$",decimal_digits:2,rounding:0,code:"DOP",name_plural:"Dominican pesos"},DZD:{symbol:"DA",name:"Algerian Dinar",symbol_native:"\u062f.\u062c.\u200f",decimal_digits:2,rounding:0,code:"DZD",name_plural:"Algerian dinars"},EEK:{symbol:"Ekr",name:"Estonian Kroon",symbol_native:"kr",decimal_digits:2,rounding:0,code:"EEK",name_plural:"Estonian kroons"},EGP:{symbol:"EGP",name:"Egyptian Pound",symbol_native:"\u062c.\u0645.\u200f",decimal_digits:2,rounding:0,code:"EGP",name_plural:"Egyptian pounds"},ERN:{symbol:"Nfk",name:"Eritrean Nakfa",symbol_native:"Nfk",decimal_digits:2,rounding:0,code:"ERN",name_plural:"Eritrean nakfas"},ETB:{symbol:"Br",name:"Ethiopian Birr",symbol_native:"Br",decimal_digits:2,rounding:0,code:"ETB",name_plural:"Ethiopian birrs"},GBP:{symbol:"\xa3",name:"British Pound Sterling",symbol_native:"\xa3",decimal_digits:2,rounding:0,code:"GBP",name_plural:"British pounds sterling"},GEL:{symbol:"GEL",name:"Georgian Lari",symbol_native:"GEL",decimal_digits:2,rounding:0,code:"GEL",name_plural:"Georgian laris"},GHS:{symbol:"GH\u20b5",name:"Ghanaian Cedi",symbol_native:"GH\u20b5",decimal_digits:2,rounding:0,code:"GHS",name_plural:"Ghanaian cedis"},GNF:{symbol:"FG",name:"Guinean Franc",symbol_native:"FG",decimal_digits:0,rounding:0,code:"GNF",name_plural:"Guinean francs"},GTQ:{symbol:"GTQ",name:"Guatemalan Quetzal",symbol_native:"Q",decimal_digits:2,rounding:0,code:"GTQ",name_plural:"Guatemalan quetzals"},HKD:{symbol:"HK$",name:"Hong Kong Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"HKD",name_plural:"Hong Kong dollars"},HNL:{symbol:"HNL",name:"Honduran Lempira",symbol_native:"L",decimal_digits:2,rounding:0,code:"HNL",name_plural:"Honduran lempiras"},HRK:{symbol:"kn",name:"Croatian Kuna",symbol_native:"kn",decimal_digits:2,rounding:0,code:"HRK",name_plural:"Croatian kunas"},HUF:{symbol:"Ft",name:"Hungarian Forint",symbol_native:"Ft",decimal_digits:0,rounding:0,code:"HUF",name_plural:"Hungarian forints"},IDR:{symbol:"Rp",name:"Indonesian Rupiah",symbol_native:"Rp",decimal_digits:0,rounding:0,code:"IDR",name_plural:"Indonesian rupiahs"},ILS:{symbol:"\u20aa",name:"Israeli New Sheqel",symbol_native:"\u20aa",decimal_digits:2,rounding:0,code:"ILS",name_plural:"Israeli new sheqels"},INR:{symbol:"\u20b9",name:"Indian Rupee",symbol_native:"\u099f\u0995\u09be",decimal_digits:2,rounding:0,code:"INR",name_plural:"Indian rupees"},IQD:{symbol:"IQD",name:"Iraqi Dinar",symbol_native:"\u062f.\u0639.\u200f",decimal_digits:0,rounding:0,code:"IQD",name_plural:"Iraqi dinars"},IRR:{symbol:"IRR",name:"Iranian Rial",symbol_native:"\ufdfc",decimal_digits:0,rounding:0,code:"IRR",name_plural:"Iranian rials"},ISK:{symbol:"Ikr",name:"Icelandic Kr\xf3na",symbol_native:"kr",decimal_digits:0,rounding:0,code:"ISK",name_plural:"Icelandic kr\xf3nur"},JMD:{symbol:"J$",name:"Jamaican Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"JMD",name_plural:"Jamaican dollars"},JOD:{symbol:"JD",name:"Jordanian Dinar",symbol_native:"\u062f.\u0623.\u200f",decimal_digits:3,rounding:0,code:"JOD",name_plural:"Jordanian dinars"},JPY:{symbol:"\xa5",name:"Japanese Yen",symbol_native:"\uffe5",decimal_digits:0,rounding:0,code:"JPY",name_plural:"Japanese yen"},KES:{symbol:"Ksh",name:"Kenyan Shilling",symbol_native:"Ksh",decimal_digits:2,rounding:0,code:"KES",name_plural:"Kenyan shillings"},KHR:{symbol:"KHR",name:"Cambodian Riel",symbol_native:"\u17db",decimal_digits:2,rounding:0,code:"KHR",name_plural:"Cambodian riels"},KMF:{symbol:"CF",name:"Comorian Franc",symbol_native:"FC",decimal_digits:0,rounding:0,code:"KMF",name_plural:"Comorian francs"},KRW:{symbol:"\u20a9",name:"South Korean Won",symbol_native:"\u20a9",decimal_digits:0,rounding:0,code:"KRW",name_plural:"South Korean won"},KWD:{symbol:"KD",name:"Kuwaiti Dinar",symbol_native:"\u062f.\u0643.\u200f",decimal_digits:3,rounding:0,code:"KWD",name_plural:"Kuwaiti dinars"},KZT:{symbol:"KZT",name:"Kazakhstani Tenge",symbol_native:"\u0442\u04a3\u0433.",decimal_digits:2,rounding:0,code:"KZT",name_plural:"Kazakhstani tenges"},LBP:{symbol:"LB\xa3",name:"Lebanese Pound",symbol_native:"\u0644.\u0644.\u200f",decimal_digits:0,rounding:0,code:"LBP",name_plural:"Lebanese pounds"},LKR:{symbol:"SLRs",name:"Sri Lankan Rupee",symbol_native:"SL Re",decimal_digits:2,rounding:0,code:"LKR",name_plural:"Sri Lankan rupees"},LTL:{symbol:"Lt",name:"Lithuanian Litas",symbol_native:"Lt",decimal_digits:2,rounding:0,code:"LTL",name_plural:"Lithuanian litai"},LVL:{symbol:"Ls",name:"Latvian Lats",symbol_native:"Ls",decimal_digits:2,rounding:0,code:"LVL",name_plural:"Latvian lati"},LYD:{symbol:"LD",name:"Libyan Dinar",symbol_native:"\u062f.\u0644.\u200f",decimal_digits:3,rounding:0,code:"LYD",name_plural:"Libyan dinars"},MAD:{symbol:"MAD",name:"Moroccan Dirham",symbol_native:"\u062f.\u0645.\u200f",decimal_digits:2,rounding:0,code:"MAD",name_plural:"Moroccan dirhams"},MDL:{symbol:"MDL",name:"Moldovan Leu",symbol_native:"MDL",decimal_digits:2,rounding:0,code:"MDL",name_plural:"Moldovan lei"},MGA:{symbol:"MGA",name:"Malagasy Ariary",symbol_native:"MGA",decimal_digits:0,rounding:0,code:"MGA",name_plural:"Malagasy Ariaries"},MKD:{symbol:"MKD",name:"Macedonian Denar",symbol_native:"MKD",decimal_digits:2,rounding:0,code:"MKD",name_plural:"Macedonian denari"},MMK:{symbol:"MMK",name:"Myanma Kyat",symbol_native:"K",decimal_digits:0,rounding:0,code:"MMK",name_plural:"Myanma kyats"},MOP:{symbol:"MOP$",name:"Macanese Pataca",symbol_native:"MOP$",decimal_digits:2,rounding:0,code:"MOP",name_plural:"Macanese patacas"},MUR:{symbol:"MURs",name:"Mauritian Rupee",symbol_native:"MURs",decimal_digits:0,rounding:0,code:"MUR",name_plural:"Mauritian rupees"},MXN:{symbol:"MX$",name:"Mexican Peso",symbol_native:"$",decimal_digits:2,rounding:0,code:"MXN",name_plural:"Mexican pesos"},MYR:{symbol:"RM",name:"Malaysian Ringgit",symbol_native:"RM",decimal_digits:2,rounding:0,code:"MYR",name_plural:"Malaysian ringgits"},MZN:{symbol:"MTn",name:"Mozambican Metical",symbol_native:"MTn",decimal_digits:2,rounding:0,code:"MZN",name_plural:"Mozambican meticals"},NAD:{symbol:"N$",name:"Namibian Dollar",symbol_native:"N$",decimal_digits:2,rounding:0,code:"NAD",name_plural:"Namibian dollars"},NGN:{symbol:"\u20a6",name:"Nigerian Naira",symbol_native:"\u20a6",decimal_digits:2,rounding:0,code:"NGN",name_plural:"Nigerian nairas"},NIO:{symbol:"C$",name:"Nicaraguan C\xf3rdoba",symbol_native:"C$",decimal_digits:2,rounding:0,code:"NIO",name_plural:"Nicaraguan c\xf3rdobas"},NOK:{symbol:"Nkr",name:"Norwegian Krone",symbol_native:"kr",decimal_digits:2,rounding:0,code:"NOK",name_plural:"Norwegian kroner"},NPR:{symbol:"NPRs",name:"Nepalese Rupee",symbol_native:"\u0928\u0947\u0930\u0942",decimal_digits:2,rounding:0,code:"NPR",name_plural:"Nepalese rupees"},NZD:{symbol:"NZ$",name:"New Zealand Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"NZD",name_plural:"New Zealand dollars"},OMR:{symbol:"OMR",name:"Omani Rial",symbol_native:"\u0631.\u0639.\u200f",decimal_digits:3,rounding:0,code:"OMR",name_plural:"Omani rials"},PAB:{symbol:"B/.",name:"Panamanian Balboa",symbol_native:"B/.",decimal_digits:2,rounding:0,code:"PAB",name_plural:"Panamanian balboas"},PEN:{symbol:"S/.",name:"Peruvian Nuevo Sol",symbol_native:"S/.",decimal_digits:2,rounding:0,code:"PEN",name_plural:"Peruvian nuevos soles"},PHP:{symbol:"\u20b1",name:"Philippine Peso",symbol_native:"\u20b1",decimal_digits:2,rounding:0,code:"PHP",name_plural:"Philippine pesos"},PKR:{symbol:"PKRs",name:"Pakistani Rupee",symbol_native:"\u20a8",decimal_digits:0,rounding:0,code:"PKR",name_plural:"Pakistani rupees"},PLN:{symbol:"z\u0142",name:"Polish Zloty",symbol_native:"z\u0142",decimal_digits:2,rounding:0,code:"PLN",name_plural:"Polish zlotys"},PYG:{symbol:"\u20b2",name:"Paraguayan Guarani",symbol_native:"\u20b2",decimal_digits:0,rounding:0,code:"PYG",name_plural:"Paraguayan guaranis"},QAR:{symbol:"QR",name:"Qatari Rial",symbol_native:"\u0631.\u0642.\u200f",decimal_digits:2,rounding:0,code:"QAR",name_plural:"Qatari rials"},RON:{symbol:"RON",name:"Romanian Leu",symbol_native:"RON",decimal_digits:2,rounding:0,code:"RON",name_plural:"Romanian lei"},RSD:{symbol:"din.",name:"Serbian Dinar",symbol_native:"\u0434\u0438\u043d.",decimal_digits:0,rounding:0,code:"RSD",name_plural:"Serbian dinars"},RUB:{symbol:"RUB",name:"Russian Ruble",symbol_native:"\u0440\u0443\u0431.",decimal_digits:2,rounding:0,code:"RUB",name_plural:"Russian rubles"},RWF:{symbol:"RWF",name:"Rwandan Franc",symbol_native:"FR",decimal_digits:0,rounding:0,code:"RWF",name_plural:"Rwandan francs"},SAR:{symbol:"SR",name:"Saudi Riyal",symbol_native:"\u0631.\u0633.\u200f",decimal_digits:2,rounding:0,code:"SAR",name_plural:"Saudi riyals"},SDG:{symbol:"SDG",name:"Sudanese Pound",symbol_native:"SDG",decimal_digits:2,rounding:0,code:"SDG",name_plural:"Sudanese pounds"},SEK:{symbol:"Skr",name:"Swedish Krona",symbol_native:"kr",decimal_digits:2,rounding:0,code:"SEK",name_plural:"Swedish kronor"},SGD:{symbol:"S$",name:"Singapore Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"SGD",name_plural:"Singapore dollars"},SOS:{symbol:"Ssh",name:"Somali Shilling",symbol_native:"Ssh",decimal_digits:0,rounding:0,code:"SOS",name_plural:"Somali shillings"},SYP:{symbol:"SY\xa3",name:"Syrian Pound",symbol_native:"\u0644.\u0633.\u200f",decimal_digits:0,rounding:0,code:"SYP",name_plural:"Syrian pounds"},THB:{symbol:"\u0e3f",name:"Thai Baht",symbol_native:"\u0e3f",decimal_digits:2,rounding:0,code:"THB",name_plural:"Thai baht"},TND:{symbol:"DT",name:"Tunisian Dinar",symbol_native:"\u062f.\u062a.\u200f",decimal_digits:3,rounding:0,code:"TND",name_plural:"Tunisian dinars"},TOP:{symbol:"T$",name:"Tongan Pa\u02bbanga",symbol_native:"T$",decimal_digits:2,rounding:0,code:"TOP",name_plural:"Tongan pa\u02bbanga"},TRY:{symbol:"TL",name:"Turkish Lira",symbol_native:"TL",decimal_digits:2,rounding:0,code:"TRY",name_plural:"Turkish Lira"},TTD:{symbol:"TT$",name:"Trinidad and Tobago Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"TTD",name_plural:"Trinidad and Tobago dollars"},TWD:{symbol:"NT$",name:"New Taiwan Dollar",symbol_native:"NT$",decimal_digits:2,rounding:0,code:"TWD",name_plural:"New Taiwan dollars"},TZS:{symbol:"TSh",name:"Tanzanian Shilling",symbol_native:"TSh",decimal_digits:0,rounding:0,code:"TZS",name_plural:"Tanzanian shillings"},UAH:{symbol:"\u20b4",name:"Ukrainian Hryvnia",symbol_native:"\u20b4",decimal_digits:2,rounding:0,code:"UAH",name_plural:"Ukrainian hryvnias"},UGX:{symbol:"USh",name:"Ugandan Shilling",symbol_native:"USh",decimal_digits:0,rounding:0,code:"UGX",name_plural:"Ugandan shillings"},UYU:{symbol:"$U",name:"Uruguayan Peso",symbol_native:"$",decimal_digits:2,rounding:0,code:"UYU",name_plural:"Uruguayan pesos"},UZS:{symbol:"UZS",name:"Uzbekistan Som",symbol_native:"UZS",decimal_digits:0,rounding:0,code:"UZS",name_plural:"Uzbekistan som"},VEF:{symbol:"Bs.F.",name:"Venezuelan Bol\xedvar",symbol_native:"Bs.F.",decimal_digits:2,rounding:0,code:"VEF",name_plural:"Venezuelan bol\xedvars"},VND:{symbol:"\u20ab",name:"Vietnamese Dong",symbol_native:"\u20ab",decimal_digits:0,rounding:0,code:"VND",name_plural:"Vietnamese dong"},XAF:{symbol:"FCFA",name:"CFA Franc BEAC",symbol_native:"FCFA",decimal_digits:0,rounding:0,code:"XAF",name_plural:"CFA francs BEAC"},XOF:{symbol:"CFA",name:"CFA Franc BCEAO",symbol_native:"CFA",decimal_digits:0,rounding:0,code:"XOF",name_plural:"CFA francs BCEAO"},YER:{symbol:"YR",name:"Yemeni Rial",symbol_native:"\u0631.\u064a.\u200f",decimal_digits:0,rounding:0,code:"YER",name_plural:"Yemeni rials"},ZAR:{symbol:"R",name:"South African Rand",symbol_native:"R",decimal_digits:2,rounding:0,code:"ZAR",name_plural:"South African rand"},ZMK:{symbol:"ZK",name:"Zambian Kwacha",symbol_native:"ZK",decimal_digits:0,rounding:0,code:"ZMK",name_plural:"Zambian kwachas"}},e.ConstantService=ui,e.CoreModule=wi,e.CustomPipeManager=vi,e.DataSource=Ne,e.DynamicComponentRefProvider=$e,e.EventNotifier=si,e.FIRST_TIME_WATCH=de,e.FieldTypeService=hi,e.FieldWidgetService=mi,e.IDGenerator=F,e.IDataSource=De,e.LRUCache=Pi,e.PaginationService=bi,e.PartialRefProvider=Ue,e.ScriptLoaderService=gi,e.ScriptStore=fi,e.StatePersistence=yi,e.UserDefinedExecutionContext=Be,e.UtilsService=di,e.VALIDATOR=ti,e.Viewport=pi,e._WM_APP_PROJECT=fn,e.addClass=S,e.addEventListenerOnElement=Dt,e.addForIdAttributes=Wn,e.adjustContainerPosition=qn,e.adjustContainerRightEdges=zn,e.appendNode=function(e,t,n){var i=function(){return t.appendChild(e)};n?i():P(i)},e.appendScriptToHead=ii,e.checkIsCustomPipeExpression=g,e.closePopover=Kn,e.convertToBlob=On,e.createCSSRule=Dn,e.createElement=function(e,t,n){var i=document.createElement(e);return t&&Object.keys(t).forEach((function(e){T(i,e,t[e],n)})),i},e.deHyphenate=vt,e.debounce=ve,e.defer=Mn,e.detectChanges=Qn,e.encodeUrl=pt,e.encodeUrlParams=ut,e.executePromiseChain=Ln,e.extendProto=Gn,e.extractCurrentItemExpr=Zn,e.extractType=$t,e.fetchContent=Cn,e.findRootContainer=ei,e.findValueOf=Vt,e.generateGUId=Ft,e.getAbortableDefer=In,e.getAndroidVersion=lt,e.getAppSetting=oi,e.getBlob=en,e.getClonedObject=Nt,e.getDatasourceFromExpr=Jn,e.getDateObj=It,e.getDisplayDateTimeFormat=Un,e.getEvaluatedExprValue=Pt,e.getFiles=xt,e.getFnByExpr=ae,e.getFnForBindExpr=le,e.getFnForEventExpr=ce,e.getFormWidgetTemplate=function(t,n,i,o){var r;void 0===o&&(o={});var a=i.get("updateon"),s=a?'updateon="'+a+'"':"";switch(t){case e.FormWidgetType.AUTOCOMPLETE:case e.FormWidgetType.TYPEAHEAD:r='<div wmSearch type="autocomplete" debouncetime="'+i.get("debouncetime")+'" '+n+"></div>";break;case e.FormWidgetType.CHECKBOX:r="<div wmCheckbox "+n+" "+("true"===i.get("required")?"required=true":"")+"></div>";break;case e.FormWidgetType.CHECKBOXSET:r='<ul role="group" wmCheckboxset '+n+" "+("true"===i.get("required")?"required=true":"")+"></ul>";break;case e.FormWidgetType.CHIPS:r='<ul wmChips role="input" debouncetime="'+i.get("debouncetime")+'" '+n+"></ul>";break;case e.FormWidgetType.COLORPICKER:r="<div wmColorPicker "+("true"===i.get("required")?"required=true":"")+" "+n+"></div>";break;case e.FormWidgetType.CURRENCY:r="<div wmCurrency "+("true"===i.get("required")?"required=true":"")+" "+s+" "+n+"></div>";break;case e.FormWidgetType.DATE:r="<div wmDate "+("true"===i.get("required")?"required=true":"")+' dataentrymode="'+i.get("dataentrymode")+'" '+n+"></div>";break;case e.FormWidgetType.DATETIME:r="<div wmDateTime "+("true"===i.get("required")?"required=true":"")+' dataentrymode="'+i.get("dataentrymode")+'" '+n+"></div>";break;case e.FormWidgetType.NUMBER:r="<div wmNumber "+n+" "+("true"===i.get("required")?"required=true":"")+' type="number" aria-label="Only numbers" '+s+"></div>";break;case e.FormWidgetType.PASSWORD:r="<wm-input "+n+" "+("true"===i.get("required")?"required=true":"")+' type="password" aria-label="Enter password" '+s+"></wm-input>";break;case e.FormWidgetType.RADIOSET:r='<ul role="radiogroup" wmRadioset '+n+"></ul>";break;case e.FormWidgetType.RATING:r="<div wmRating "+n+"></div>";break;case e.FormWidgetType.RICHTEXT:r='<div wmRichTextEditor role="textbox" '+n+"></div>";break;case e.FormWidgetType.SELECT:r="<wm-select "+("true"===i.get("required")?"required=true":"")+" "+n+"></wm-select>";break;case e.FormWidgetType.TOGGLE:r="<div wmCheckbox "+n+" "+("true"===i.get("required")?"required=true":"")+' type="toggle" role="checkbox" aria-label="Toggle button"></div>';break;case e.FormWidgetType.SLIDER:r="<div wmSlider "+n+"></div>";break;case e.FormWidgetType.SWITCH:r="<div wmSwitch "+n+"></div>";break;case e.FormWidgetType.TEXT:var l=o.inputType||"inputtype";r="<wm-input "+n+" "+("true"===i.get("required")?"required=true":"")+' type="'+(i.get(l)||"text")+'" '+s+"></wm-input>";break;case e.FormWidgetType.TEXTAREA:r="<wm-textarea "+n+" "+("true"===i.get("required")?"required=true":"")+' role="textbox" '+s+"></wm-textarea>";break;case e.FormWidgetType.TIME:r="<div wmTime "+("true"===i.get("required")?"required=true":"")+' dataentrymode="'+i.get("dataentrymode")+'" '+n+"></div>";break;case e.FormWidgetType.TIMESTAMP:r="<div wmDateTime "+("true"===i.get("required")?"required=true":"")+' dataentrymode="'+i.get("dataentrymode")+'" '+n+' role="input"></div>';break;case e.FormWidgetType.UPLOAD:var c=o.counter,p=o.pCounter,u=o.uploadProps,h=d(i,c,u&&u.name);r=u?'<form name="'+u.formName+'" '+n+'>\n <input focus-target class="file-upload" type="file" name="'+u.name+'" '+h+"/>\n </form>":'<a class="form-control-static" href="{{'+c+'.href}}" target="_blank" *ngIf="'+c+".filetype === 'image' && "+c+'.href">\n <img style="height:2em" class="wi wi-file" [src]="'+c+'.href"/></a>\n <a class="form-control-static" target="_blank" href="{{'+c+'.href}}" *ngIf="'+c+".filetype !== 'image' && "+c+'.href">\n <i class="wi wi-file"></i></a>\n <input '+n+' class="app-blob-upload" [ngClass]="{\'file-readonly\': '+c+'.readonly}" '+h+'\n [required]="'+c+'.required" type="file" name="'+(i.get("key")||i.get("name"))+'_formWidget" [readonly]="'+c+'.readonly"\n [class.hidden]="!'+p+'.isUpdateMode" [accept]="'+c+'.permitted">';break;default:r="<wm-input "+n+" "+("true"===i.get("required")?"required=true":"")+' type="text" '+s+"></wm-input>"}return r},e.getFormattedDate=At,e.getMomentLocaleObject=dn,e.getNativeDateObject=Zt,e.getNgModelAttr=function(e){return e.has("formControlName")||e.has("formControlName.bind")?"":"ngModel"},e.getRequiredFormWidget=function(t){switch(t){case e.FormWidgetType.AUTOCOMPLETE:case e.FormWidgetType.TYPEAHEAD:return"wm-search";case e.FormWidgetType.CHIPS:return"wm-chips";case e.FormWidgetType.COLORPICKER:return"wm-colorpicker";case e.FormWidgetType.CURRENCY:return"wm-currency";case e.FormWidgetType.DATE:return"wm-date";case e.FormWidgetType.DATETIME:return"wm-datetime";case e.FormWidgetType.TIME:case e.FormWidgetType.TIMESTAMP:return"wm-time";case e.FormWidgetType.RATING:return"wm-rating";case e.FormWidgetType.RICHTEXT:return"wm-richtexteditor";case e.FormWidgetType.SLIDER:return"wm-slider";default:return"wm-text"}},e.getResourceURL=Tt,e.getRouteNameFromLink=xn,e.getRowActionAttrs=function(e){var t="";return e.forEach((function(e,n){var i=y.get(n);i&&(t+=i+'="'+e+'" ')})),t},e.getSessionStorageItem=vn,e.getUrlParams=Nn,e.getValidDateObject=Jt,e.getValidJSON=Bt,e.getWebkitTraslationMatrix=Yn,e.getWmProjectProperties=x,e.hasCordova=Sn,e.hasOffsetStr=Rt,e.initCaps=dt,e.insertAfter=function(e,t,n){var i=function(){return t.parentNode.insertBefore(e,t.nextSibling)};n?i():P(i)},e.insertBefore=function(e,t,n){var i=function(){return t.parentNode.insertBefore(e,t)};n?i():P(i)},e.isAndroid=Je,e.isAndroidTablet=Ze,e.isAppleProduct=kn,e.isArray=bn,e.isAudioFile=Ot,e.isBoolean=_n,e.isChangeFromWatch=function(){return _e},e.isDataSourceEqual=Fn,e.isDateTimeType=Kt,e.isDefined=Ye,e.isElementInViewport=zt,e.isEmptyObject=Wt,e.isEqualWithFields=tn,e.isFirstTimeChange=function(e){return e===de},e.isIE=Xe,e.isImageFile=_t,e.isInsecureContentRequest=bt,e.isIos=it,e.isIpad=nt,e.isIphone=et,e.isIpod=tt,e.isKitkatDevice=ct,e.isLargeTabletLandscape=ot,e.isLargeTabletPortrait=rt,e.isMobile=at,e.isMobileApp=st,e.isNumber=Pn,e.isNumberType=Ut,e.isObject=Ke,e.isPageable=Ht,e.isString=wn,e.isValidWebURL=Et,e.isVideoFile=St,e.loadScript=hn,e.loadScripts=mn,e.loadStyleSheet=ln,e.loadStyleSheets=cn,e.muteWatchers=function(){ge=!0},e.noop=yn,e.openLink=Tn,e.periodSeparate=ft,e.prettifyLabel=gt,e.prettifyLabels=yt,e.processFilterExpBindNode=Bn,e.registerFnByExpr=function(e,t,n){t.usedPipes=n||[],re.set(e,t)},e.removeAttr=function(e,t,n){var i=function(){return e.removeAttribute(t)};n?i():P(i)},e.removeClass=O,e.removeExtraSlashes=Vn,e.removeNode=function(e,t){var n=function(){return e.remove()};t?n():P(n)},e.replace=Yt,e.replaceAt=mt,e.resetChangeFromWatch=Ee,e.retryIfFails=Rn,e.scrollToElement=qt,e.setAppRef=function(e){he=e},e.setAttr=T,e.setCSS=E,e.setCSSFromObj=function(e,t,n){Object.keys(t||{}).forEach((function(i){return E(e,i,t[i],n)}))},e.setHtml=function(e,t,n){var i=function(){return e.innerHTML=t};n?i():P(i)},e.setListClass=ri,e.setNgZone=function(e){return me=e},e.setPipeProvider=function(e){M=e},e.setProperty=function(e,t,n,i){var o=function(){return e[t]=n};i?o():P(o)},e.setSessionStorageItem=gn,e.setTranslation3dPosition=Hn,e.setWmProjectProperties=function(e){Object.setPrototypeOf(N,e)},e.spaceSeparate=ht,e.stringStartsWith=wt,e.switchClass=function(e,t,n,i){void 0===t&&(t=""),void 0===n&&(n=""),O(e,n,i),S(e,t,i)},e.toBoolean=Qe,e.toDimension=function(e){return e==+e?e+"px":e},e.toPromise=An,e.toggleClass=function(e,t,n,i){n?S(e,t,i):O(e,t,i)},e.transformFileURI=ni,e.triggerFn=Ct,e.triggerItemAction=Xn,e.unMuteWatchers=function(){ge=!1,Se()},e.updateTemplateAttrs=v,e.validateAccessRoles=jt,e.validateDataSourceCtx=jn,e.xmlToJson=Gt,e["\u02750"]=h,e["\u02751"]=f,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define("@wm/swipey",["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).swipey={})}(this,(function(e){"use strict";var t=function(){function e(){this._isGesturesEnabled=!0}return e.prototype.bindEvents=function(){return window.PointerEvent?["pointer"]:["touch"]},e.prototype.bounds=function(e,t){return{}},e.prototype.context=function(){return{}},e.prototype.direction=function(){return $.fn.swipey.DIRECTIONS.HORIZONTAL},e.prototype.setGesturesEnabled=function(e){this._isGesturesEnabled=e},e.prototype.isGesturesEnabled=function(){return this._isGesturesEnabled},e.prototype.goToLower=function(e){this._$ele.swipeAnimation("gotoLower",e)},e.prototype.goToUpper=function(e){this._$ele.swipeAnimation("gotoUpper",e)},e.prototype.onAnimation=function(e,t){},e.prototype.onUpper=function(e){},e.prototype.onLower=function(e){},e.prototype.threshold=function(){return 30},e.prototype.init=function(e,t){this._$ele=e,e.swipeAnimation({animation:this.animation(),target:t,bounds:this.bounds.bind(this),bindEvents:this.bindEvents(),context:this.context.bind(this),direction:this.direction(),enableGestures:this.isGesturesEnabled.bind(this),onAnimation:this.onAnimation.bind(this),onLower:this.onLower.bind(this),onUpper:this.onUpper.bind(this),threshold:this.threshold(),disableMouse:!0})},e}();e.SwipeAnimation=t,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/compiler"),require("@wm/core")):"function"==typeof define&&define.amd?define("@wm/transpiler",["exports","@angular/compiler","@wm/core"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.transpiler={}),e.ng.compiler,e.wm.core)}(this,(function(e,t,n){"use strict";
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/compiler"),require("rxjs"),require("@angular/core"),require("@angular/common/http")):"function"==typeof define&&define.amd?define("@wm/core",["exports","@angular/compiler","rxjs","@angular/core","@angular/common/http"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.core={}),e.ng.compiler,e.rxjs,e.ng.core,e.ng.common.http)}(this,(function(e,t,n,i,o){"use strict";function r(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 a,s,l,c,p=r(i),u=r(o);e.FormWidgetType=void 0,(a=e.FormWidgetType||(e.FormWidgetType={})).AUTOCOMPLETE="autocomplete",a.CHECKBOX="checkbox",a.CHECKBOXSET="checkboxset",a.CHIPS="chips",a.COLORPICKER="colorpicker",a.CURRENCY="currency",a.DATE="date",a.DATETIME="datetime",a.NUMBER="number",a.PASSWORD="password",a.RADIOSET="radioset",a.RATING="rating",a.RICHTEXT="richtext",a.SELECT="select",a.TOGGLE="toggle",a.SLIDER="slider",a.SWITCH="switch",a.TEXT="text",a.TEXTAREA="textarea",a.TIME="time",a.TIMESTAMP="timestamp",a.TYPEAHEAD="typeahead",a.UPLOAD="upload",e.DataType=void 0,(s=e.DataType||(e.DataType={})).INTEGER="integer",s.BIG_INTEGER="big_integer",s.SHORT="short",s.FLOAT="float",s.BIG_DECIMAL="big_decimal",s.DOUBLE="double",s.LONG="long",s.BYTE="byte",s.STRING="string",s.CHARACTER="character",s.TEXT="text",s.DATE="date",s.TIME="time",s.TIMESTAMP="timestamp",s.DATETIME="datetime",s.LOCALDATETIME="localdatetime",s.BOOLEAN="boolean",s.LIST="list",s.CLOB="clob",s.BLOB="blob",e.MatchMode=void 0,(l=e.MatchMode||(e.MatchMode={})).BETWEEN="between",l.GREATER="greaterthanequal",l.LESSER="lessthanequal",l.NULL="null",l.EMPTY="empty",l.NULLOREMPTY="nullorempty",l.EQUALS="exact",e.DEFAULT_FORMATS=void 0,(c=e.DEFAULT_FORMATS||(e.DEFAULT_FORMATS={})).DATE="yyyy-MM-dd",c.TIME="HH:mm:ss",c.TIMESTAMP="timestamp",c.DATETIME="yyyy-MM-ddTHH:mm:ss",c.LOCALDATETIME="yyyy-MM-ddTHH:mm:ss",c.DATETIME_ORACLE="yyyy-MM-dd HH:mm:ss",c.DATE_TIME="yyyy-MM-dd HH:mm:ss";var d=function(e,t,n){var i="";return e.forEach((function(e,o){if(o&&o.endsWith(".event")){var r=o.split(".")[0];i=" "+i+" ("+r+')="'+(t?t+".":"")+"triggerUploadEvent($event, '"+r+"', '"+n+"', row)\" "}})),i},h=d,m=function(e,n,i){i=i.replace("bind:","");var o=e.attrs.find((function(e){return"datasetboundexpr"===e.name}));"dataset"!==n.name||o||e.attrs.push(new t.Attribute("datasetboundexpr",i,n.sourceSpan,n.keySpan,n.valueSpan,void 0,void 0))},f=m,g=function(e){var t=e.match(/(custom(\s*:))/g);return t&&t.length},v=function(e,t,n,i,o){void 0===i&&(i=""),void 0===o&&(o="item");var r,a,s,l=t.replace(/([^a-zA-Z0-9.])/g,"\\$1"),c=new RegExp("("+l+")(\\[0\\])?(.data\\[\\$i\\])?(.content\\[\\$i\\])?(\\[\\$i\\])?","g"),p={"wm-list":["itemclass","disableitem","dataset"]};n&&(r=new RegExp("(Widgets."+n+".currentItem)\\b","g"),a=new RegExp("(Widgets."+n+".currentItemWidgets)\\b","g"),s=new RegExp("(Widgets.(.*).(formWidgets|filterWidgets))\\b","g")),(_.isArray(e)?e:p[e.name]?[e]:e.children||[]).forEach((function(e){if(e.name){var l=e.name,u=new RegExp("bind:\\s*\\(*"+t+"\\)*\\.length\\)*");e.attrs.forEach((function(n){var d=n.value&&n.value.trim();_.startsWith(d,"bind:")&&((!p[l]||p[l]&&p[l].indexOf(n.name)>-1)&&_.includes(d,t)&&d!=="bind:"+t&&!u.test(d)&&(d=d.replace("bind:",""),m(e,n,d),d=d.replace(c,o),g(d="bind:"+d)&&r&&(d+=":"+r.exec(r.source)[0])),r&&r.test(d)&&((d.includes(".formWidgets")||d.includes(".filterWidgets"))&&(d=d.replace(s,"Widgets")),m(e,n,d),d=d.replace(r,o)),a&&a.test(d)&&(d=d.replace(a,i+"currentItemWidgets")),n.value=d)})),v(e.children,t,n,i,o)}}))},y=new Map([["display-name","caption"],["display-name.bind","caption.bind"],["title","hint"],["title.bind","hint.bind"],["show","show"],["show.bind","show.bind"],["disabled","disabled"],["disabled.bind","disabled.bind"],["hyperlink","hyperlink"],["hyperlink.bind","hyperlink.bind"],["target","target"],["conditionalclass.bind","conditionalclass.bind"],["conditionalstyle.bind","conditionalstyle.bind"]]),b=window.requestAnimationFrame,w=[],P=function(e){w.length||b((function(){w.forEach((function(e){return e()})),w.length=0})),w.push(e)},O=function(e,t,n){var i=function(t){return e.classList.remove(t)};(t=t||"").split(" ").forEach((function(e){e.length&&(n?i(e):P((function(){return i(e)})))}))},S=function(e,t,n){var i=function(t){return e.classList.add(t)};(t=t||"").split(" ").forEach((function(e){e.length&&(n?i(e):P((function(){return i(e)})))}))},E=function(e,t,n,i){var o=function(){return e.style[t]=n};i?o():P(o)},T=function(e,t,n,i){var o=function(){return e instanceof Element&&e.setAttribute(t,n)};i?o():P(o)};function C(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 A(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 R(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 I(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 N={};function x(){return window._WM_APP_PROPERTIES?window._WM_APP_PROPERTIES:N}var k,M,L,F=function(){function e(e){this.generator=function(e){var t;return A(this,(function(n){switch(n.label){case 0:t=1,n.label=1;case 1:return[4,""+e+t++];case 2:return n.sent(),[3,1];case 3:return[2]}}))}(e)}return e.prototype.nextUid=function(){return this.generator.next().value},e}(),j=function(e){return"string"==typeof e},B=function(e){return void 0!==e},G=function(e,t){return void 0===e?t:e},V=function(e,t){return void 0===e?t:void 0===t?e:e+t},U=function(e,t){return G(e,0)-G(t,0)},W=function(){},q=new Map,z=new Map,H=new Map,Y=function(e,t){return"object"!=typeof e&&"object"!=typeof t&&(e!=e&&t!=t||e===t)},K=function(e,t){var n=t.length,i=n>10;switch(n){case 10:if(i=!Y(e[9],t[9]))break;case 9:if(i=!Y(e[8],t[8]))break;case 8:if(i=!Y(e[7],t[7]))break;case 7:if(i=!Y(e[6],t[6]))break;case 6:if(i=!Y(e[5],t[5]))break;case 5:if(i=!Y(e[4],t[4]))break;case 4:if(i=!Y(e[3],t[3]))break;case 3:if(i=!Y(e[2],t[2]))break;case 2:if(i=!Y(e[1],t[1]))break;case 1:if(i=!Y(e[0],t[0]))break}return i},Q=function(e,t,n){for(var i=[],o=3;o<arguments.length;o++)i[o-3]=arguments[o];var r,a=t.get(n);if(a){var s=K(a.args,i);if(!s)return a.result}return a={args:i,result:r=e.transform.apply(e,D([],I(i)))},t.set(n,a),r},X=/[^ a-zA-Z0-9]/g,J=function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)},Z=function(){function e(e,t,n){this.ast=e,this.declarations=[],this.stmts=[],this.pipes=[],this.vIdx=0,this.exprType=t,this.pipeNameVsIsPureMap=n}return e.prototype.createVar=function(){var e="v"+this.vIdx++;return this.declarations.push(e),e},e.prototype.processImplicitReceiver=function(){return"ctx"},e.prototype.processLiteralPrimitive=function(){var e=this.cAst;return j(e.value)?'"'+e.value.replace(/"/g,'"').replace(X,J)+'"':e.value},e.prototype.processLiteralArray=function(){var e,t,n=this.cAst,i=this.cStmts,o=this.createVar(),r=[];try{for(var a=R(n.expressions),s=a.next();!s.done;s=a.next()){var l=s.value;r.push(this.build(l,i))}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}return i.push(o+"=["+r.join(",")+"]"),o},e.prototype.processLiteralMap=function(){var e,t,n=this.cAst,i=this.cStmts,o=this.createVar(),r=[];try{for(var a=R(n.values),s=a.next();!s.done;s=a.next()){var l=s.value;r.push(this.build(l,i))}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}return i.push(o+"={"+n.keys.map((function(e,t){return"'"+e.key+"':"+r[t]}))+"}"),o},e.prototype.processPropertyRead=function(){var e=this.cAst,t=this.cStmts,n=this.build(e.receiver,t),i=this.createVar();return t.push(i+"="+n+"&&"+n+"."+e.name),i},e.prototype.processKeyedRead=function(){var e=this.cAst,t=this.cStmts,n=this.build(e.key,t),i=this.build(e.receiver,t),o=this.createVar();return t.push(o+"="+i+"&&"+i+"["+n+"]"),o},e.prototype.processPrefixNot=function(){var e=this.cAst,t=this.cStmts,n=this.build(e.expression,t);return t.push(n+"=!"+n),n},e.prototype.handleBinaryPlus_Minus=function(){var e=this.cAst,t=this.cStmts,n=this.build(e.left,t),i=this.build(e.right,t),o=this.createVar(),r="+"===e.operation?"_plus":"_minus";return t.push(o+"="+r+"("+n+","+i+")"),o},e.prototype.handleBinaryAND_OR=function(){var e=this.cAst,t=this.cStmts,n=[],i=[],o=[],r=this.build(e.left,i),a=this.build(e.right,o),s=this.createVar();return"&&"===e.operation?n.push(i.join(";"),";"+s+"=false",";if("+r+"){",o.join(";"),";"+s+"="+a+";","}"):n.push(i.join(";"),";"+s+"="+r,";if(!"+r+"){",o.join(";"),";"+s+"="+a+";","}"),t.push(n.join("")),s},e.prototype.handleBinaryDefault=function(){var e=this.cAst,t=this.cStmts,n=this.build(e.left,t),i=this.build(e.right,t),o=this.createVar();return t.push(o+"="+n+e.operation+i),o},e.prototype.processBinary=function(){var e=this.cAst.operation;return"+"===e||"-"===e?this.handleBinaryPlus_Minus():"&&"===e||"||"===e?this.handleBinaryAND_OR():this.handleBinaryDefault()},e.prototype.processConditional=function(){var e=this.cAst,t=this.cStmts,n=this.build(e.condition,t),i=this.createVar(),o=[],r=[],a=[],s=this.build(e.trueExp,r),l=this.build(e.falseExp,a);return o.push("if("+n+"){",r.join(";"),";"+i+"="+s+";","}else{",a.join(";"),";"+i+"="+l+";","}"),t.push(o.join(" ")),i},e.prototype.processMethodCall=function(){var e,n,i=this.cAst,o=this.cStmts,r=[];try{for(var a=R(i.args),s=a.next();!s.done;s=a.next()){var l=s.value;r.push(this.build(l,o))}}catch(t){e={error:t}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}var c=this.build(i.receiver,o),p=this.createVar(),u=i.receiver instanceof t.ImplicitReceiver;return o.push(p+"= "+c+"&&"+c+"."+i.name+"&&"+c+"."+i.name+(u?".bind(_ctx)":"")+"("+r.join(",")+")"),p},e.prototype.processChain=function(){var e=this;return this.cAst.expressions.map((function(t){return e.build(t)})).join(";")},e.prototype.processPropertyWrite=function(){var e,n,i=this.cAst,o=this.cStmts;n=i.receiver instanceof t.ImplicitReceiver?"_ctx."+i.name:(e=this.build(i.receiver,o))+(e.length?".":"")+i.name;var r=this.build(i.value,o);o.push(n+"="+r)},e.prototype.processPipe=function(){var e,t,n=this.cAst,i=this.cStmts,o=this.createVar(),r=[],a=[],s=[],l=this.build(n.exp,i);try{for(var c=R(n.args),p=c.next();!p.done;p=c.next()){var u=p.value;r.push(this.build(u,s))}}catch(t){e={error:t}}finally{try{p&&!p.done&&(t=c.return)&&t.call(c)}finally{if(e)throw e.error}}var d="_p"+this.pipes.length;return this.pipes.push([n.name,d]),r.unshift(l),a.push(s.length?s.join(";")+";":"",this.pipeNameVsIsPureMap.get(n.name)?o+"=getPPVal("+d+',_ppc,"'+d+'",'+r+")":o+"="+d+".transform("+r+")"),i.push(a.join("")),o},e.prototype.build=function(e,n){return this.cAst=e,this.cStmts=n||this.stmts,e instanceof t.ImplicitReceiver?this.processImplicitReceiver():e instanceof t.LiteralPrimitive?this.processLiteralPrimitive():e instanceof t.LiteralArray?this.processLiteralArray():e instanceof t.LiteralMap?this.processLiteralMap():e instanceof t.PropertyRead?this.processPropertyRead():e instanceof t.PropertyWrite?this.processPropertyWrite():e instanceof t.KeyedRead?this.processKeyedRead():e instanceof t.PrefixNot?this.processPrefixNot():e instanceof t.Binary?this.processBinary():e instanceof t.Conditional?this.processConditional():e instanceof t.MethodCall?this.processMethodCall():e instanceof t.Chain?this.processChain():e instanceof t.BindingPipe?this.processPipe():void 0},e.prototype.extendCtxWithLocals=function(){var e=this.createVar();this.stmts.push(e+"=Object.assign({}, locals)","Object.setPrototypeOf("+e+", _ctx)","ctx="+e)},e.prototype.fnBody=function(){return this.declarations.push("ctx"),'"use strict";\nvar '+this.declarations.join(",")+";\n"+this.stmts.join(";")},e.prototype.fnArgs=function(){var e,t,n=["_plus","_minus","_isDef"];if(this.exprType===L.Binding){n.push("getPPVal","_ppc");try{for(var i=R(this.pipes),o=i.next();!o.done;o=i.next()){var r=I(o.value,2)[1];n.push(r)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}}return n.push("_ctx","locals"),n.join(",")},e.prototype.addReturnStmt=function(e){this.stmts.push("return "+e+";")},e.prototype.cleanup=function(){this.ast=this.cAst=this.stmts=this.cStmts=this.declarations=this.pipes=this.pipeNameVsIsPureMap=void 0},e.prototype.compile=function(e){if(this.extendCtxWithLocals(),this.addReturnStmt(this.build(this.ast)),e)return{fnBody:this.fnBody(),fnArgs:this.fnArgs(),pipes:this.pipes};var t,n=new Function(this.fnArgs(),this.fnBody());return this.exprType===L.Binding?(t=n.bind(void 0,V,U,B,Q)).usedPipes=this.pipes.slice(0):t=n.bind(void 0,V,U,B),this.cleanup(),t},e}(),ee=function(){return{transform:W}},te=function(){if(void 0!==k)return k;try{new Function,k=!1}catch(e){k=!0}return k};function ne(e,n){var i,o;if(!M)return console.log("set pipe provider"),W;if(!j(e))return W;if((e=e.trim()).endsWith(";")&&(e=e.slice(0,-1)),!e.length)return W;var r,a=q.get(e);if(a)return a;if(n||(r=le(e)),!r)if(te())r=function(t,n){var i=Object.assign({},n);return Object.setPrototypeOf(i,t),_.get(i,e)};else{var s=new t.Parser(new t.Lexer).parseBinding(e,"",0);if(s.errors.length)r=a=W;else{var l=M.getPipeNameVsIsPureMap();if(a=new Z(s.ast,L.Binding,l).compile(n),n)return a;if(a.usedPipes.length){var c=[],p=!1;try{for(var u=R(a.usedPipes),d=u.next();!d.done;d=u.next()){var h=I(d.value,1)[0],m=M.meta(h),f=void 0;m?(m.pure&&(p=!0,f=H.get(h)),f||(f=M.getInstance(h)),m.pure&&H.set(h,f)):f=ee,c.push(f)}}catch(e){i={error:e}}finally{try{d&&!d.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}c.unshift(p?new Map:void 0),r=a.bind.apply(a,D([void 0],I(c)))}else r=a.bind(void 0,void 0)}}return q.set(e,r),r}function ie(e,t,n){var i=Object.assign({},n);Object.setPrototypeOf(i,t);var o=e.split("("),r=o[0],a=_.get(t,r);if(a){var s=o[1].replace(")","");s=s.split(",");var l=[];return s.forEach((function(e){e=e&&e.trim(),l.push(_.get(i,e))})),a.bind(i).apply(void 0,D([],I(l)))}}function oe(e,n){if(!j(e))return W;if(!(e=e.trim()).length)return W;var i=z.get(e);if(i)return i;if(n||(i=ce(e)),!i)if(te())i=ie.bind(void 0,e);else{var o=new t.Parser(new t.Lexer).parseAction(e,"",0);if(o.errors.length)return W;i=new Z(o.ast,L.Action).compile(n)}return z.set(e,i),i}!function(e){e[e.Binding=0]="Binding",e[e.Action=1]="Action"}(L||(L={}));var re=new Map,ae=function(e){return re.get(e)},se=function(e,t){var n,i,o=ae(e);if(o){var r=o.usedPipes||[];if(o=t===L.Binding?o.bind(void 0,V,U,B,Q):o.bind(void 0,V,U,B),r.length){var a=[],s=!1;try{for(var l=R(r),c=l.next();!c.done;c=l.next()){var p=I(c.value,1)[0],u=M.meta(p),d=void 0;u?(u.pure&&(s=!0,d=H.get(p)),d||(d=M.getInstance(p)),u.pure&&H.set(p,d)):d=ee,a.push(d)}}catch(e){n={error:e}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}a.unshift(s?new Map:void 0),o=o.bind.apply(o,D([void 0],I(a)))}else t===L.Binding&&(o=o.bind(void 0,void 0));return o}},le=function(e){return se(e,L.Binding)},ce=function(e){return se(e,L.Action)},pe=new Map,ue=new F("watch-id-"),de={};Object.freeze(de);var he,me,fe,ge=!1,ve=function(e,t){var n;return void 0===t&&(t=50),function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];window.__zone_symbol__clearTimeout(n),n=window.__zone_symbol__setTimeout((function(){return e.apply(void 0,D([],I(i)))}),t)}},ye=function(e,t,n,i){var o,r=n;_.isArray(r)&&(o=r.map((function(e){return Vt(e,t)})),_.isArray(o[0])&&(o=_.flatten(o)),e(o,i))},be=function(e,t,n){var i="[$i]";if(!t)return{expr:e.replace(/\[\$i\]/g,"[0]"),listener:n};var o=e.lastIndexOf(i),r=e.substr(0,o).replace(i,"[0]"),a=e.substr(o+5),s=n;return a&&(s=ye.bind(void 0,n,a)),{expr:r,listener:s}},we=function(e,t,n,i,o,r,a,s){if(void 0===o&&(o=ue.nextUid()),void 0===r&&(r=!1),void 0===a&&(a={}),-1!==e.indexOf("[$i]")){var l=be(e,a&&(a.arrayType||a.isList),i);e=l.expr,i=l.listener}var c=ne(e);return pe.set(o,{fn:c.bind(e,t,n),listener:i,expr:e,last:de,doNotClone:r,isMuted:s}),function(){return Pe(o)}},Pe=function(e){return pe.delete(e)},_e=!1,Oe=window.requestAnimationFrame,Se=function(e){if(!ge||e){var t,n=1;do{t=!1,pe.forEach((function(e){if(!e.isMuted||!e.isMuted()){var n,i=e.fn,o=e.listener,r=e.last;try{n=i()}catch(t){console.warn("error in executing expression: '"+e.expr+"'")}_.isEqual(n,r)||(t=!0,_e=!0,e.last=n,_.isObject(n)&&!e.doNotClone&&!1!==n.__cloneable__&&(e.last=_.clone(n)),o(n,r),Ee())}})),n++}while(t&&n<5);t&&5===n&&console.warn("Number of watch cycles gone above set limit of: 5 ")}},Ee=function(){return _e=!1};window.watchRegistry=pe;var Te,Ce,Ae=ve((function(){fe=!0,me.run((function(){return Se()}))}),100),Re=(Te=!1,function(e){if(he)if(e)me.run((function(){return he.tick()})),Te=!1;else{if(Te)return;Te=!0,Oe((function(){me.run((function(){return he.tick()})),Te=!1}))}});e.ComponentType=void 0,(Ce=e.ComponentType||(e.ComponentType={}))[Ce.PAGE=0]="PAGE",Ce[Ce.PREFAB=1]="PREFAB",Ce[Ce.PARTIAL=2]="PARTIAL";var Ie,De=function(){};!function(e){e.LIST_RECORDS="listRecords",e.UPDATE_RECORD="updateRecord",e.INSERT_RECORD="insertRecord",e.DELETE_RECORD="deleteRecord",e.INVOKE="invoke",e.UPDATE="update",e.NOTIFY="notify",e.IS_API_AWARE="isApiAware",e.SUPPORTS_CRUD="supportsCRUD",e.SUPPORTS_DISTINCT_API="supportsDistinctAPI",e.IS_PAGEABLE="isPageable",e.IS_SORTABLE="isSortable",e.GET_OPERATION_TYPE="getOperationType",e.GET_RELATED_PRIMARY_KEYS="getRelatedTablePrimaryKeys",e.GET_ENTITY_NAME="getEntityName",e.SET_INPUT="setinput",e.GET_RELATED_TABLE_DATA="getRelatedTableData",e.GET_DISTINCT_DATA_BY_FIELDS="getDistinctDataByFields",e.GET_AGGREGATED_DATA="getAggregatedData",e.GET_MATCH_MODE="getMatchMode",e.DOWNLOAD="download",e.GET_NAME="getName",e.GET_PROPERTIES_MAP="getPropertiesMap",e.GET_PRIMARY_KEY="getPrimaryKey",e.GET_BLOB_URL="getBlobURL",e.SUPPORTS_SERVER_FILTER="supportsServerFilter",e.GET_OPTIONS="getOptions",e.SEARCH_RECORDS="searchRecords",e.GET_REQUEST_PARAMS="getRequestParams",e.GET_PAGING_OPTIONS="getPagingOptions",e.FETCH_DISTINCT_VALUES="fetchDistinctValues",e.GET_UNIQUE_IDENTIFIER="getUniqueIdentifier",e.GET_CONTEXT_IDENTIFIER="getContextIdentifier",e.IS_UPDATE_REQUIRED="isUpdateRequired",e.ADD_ITEM="addItem",e.SET_ITEM="setItem",e.REMOVE_ITEM="removeItem",e.IS_BOUND_TO_LOCALE="isBoundToLocale",e.GET_DEFAULT_LOCALE="getDefaultLocale",e.CANCEL="cancel",e.SET_PAGINATION="setPagination"}(Ie||(Ie={}));var Ne={Operation:Ie},xe=function(){},ke=function(){},Me=function(){},Le=function(){},Fe=function(){},je=function(){},Be=function(){},Ge=function(){},Ve=function(){},$e=function(){},Ue=function(){},We=window.navigator.userAgent,qe={SNAKE_CASE:/[A-Z]/g,ANDROID:/Android/i,IPHONE:/iPhone/i,IPOD:/iPod/i,IPAD:/iPad/i,MAC:/Mac/i,ANDROID_TABLET:/android|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i,MOBILE:/Mobile/i,WINDOWS:/Windows Phone/i,SUPPORTED_IMAGE_FORMAT:/\.(bmp|gif|jpe|jpg|jpeg|tif|tiff|pbm|png|ico)$/i,SUPPORTED_FILE_FORMAT:/\.(txt|js|css|html|script|properties|json|java|xml|smd|xmi|sql|log|wsdl|vm|ftl|jrxml|yml|yaml|md|less|jsp)$/i,SUPPORTED_AUDIO_FORMAT:/\.(mp3|ogg|webm|wma|3gp|wav|m4a)$/i,SUPPORTED_VIDEO_FORMAT:/\.(mp4|ogg|webm|wmv|mpeg|mpg|avi|mov)$/i,PAGE_RESOURCE_PATH:/^\/pages\/.*\.(js|css|html|json)$/,MIN_PAGE_RESOURCE_PATH:/.*(page.min.html)$/,VALID_EMAIL:/^[a-zA-Z][\w.+]+@[a-zA-Z_]+?\.[a-zA-Z.]{1,4}[a-zA-Z]$/,VALID_WEB_URL:/^(http[s]?:\/\/)(www\.){0,1}[a-zA-Z0-9=:?\/\.\-]+(\.[a-zA-Z]{2,5}[\.]{0,1})?/,VALID_WEBSOCKET_URL:/^(ws[s]?:\/\/)(www\.){0,1}[a-zA-Z0-9=:?\/\.\-]+(\.[a-zA-Z]{2,5}[\.]{0,1})?/,VALID_RELATIVE_URL:/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,REPLACE_PATTERN:/\$\{([^\}]+)\}/g,ZIP_FILE:/\.zip$/i,EXE_FILE:/\.exe$/i,NO_QUOTES_ALLOWED:/^[^'|"]*$/,NO_DOUBLE_QUOTES_ALLOWED:/^[^"]*$/,VALID_HTML:/<[a-z][\s\S]*>/i,VALID_PASSWORD:/^[0-9a-zA-Z-_.@&*!#$%]+$/,SPECIAL_CHARACTERS:/[^A-Z0-9a-z_]+/i,APP_SERVER_URL_FORMAT:/^(http[s]?:\/\/)(www\.){0,1}[a-zA-Z0-9\.\-]+([:]?[0-9]{2,5}|\.[a-zA-Z]{2,5}[\.]{0,1})\/+[^?#&=]+$/,JSON_DATE_FORMAT:/\d{4}-[0-1]\d-[0-3]\d(T[0-2]\d:[0-5]\d:[0-5]\d.\d{1,3}Z$)?/,DATA_URL:/^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s]*)\s*$/i,ISO_DATE_FORMAT:/(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})(\.\d+)?([+-]\d{2}:?\d{2}|Z)$/},ze=["int",e.DataType.INTEGER,e.DataType.FLOAT,e.DataType.DOUBLE,e.DataType.LONG,e.DataType.SHORT,e.DataType.BYTE,e.DataType.BIG_INTEGER,e.DataType.BIG_DECIMAL],He=new Date,Ye=function(e){return void 0!==e},Ke=function(e){return null!==e&&"object"==typeof e},Qe=function(e,t){return!(!e||"false"===e)||!!t&&e===t};var Xe=function(){return window.navigator.appVersion.indexOf("Trident/")>-1||window.navigator.userAgent.indexOf("MSIE")>-1},Je=function(){return qe.ANDROID.test(We)},Ze=function(){return qe.ANDROID_TABLET.test(We)&&!/Tablet PC 2.0/i.test(We)},et=function(){return qe.IPHONE.test(We)},tt=function(){return qe.IPOD.test(We)},nt=function(){return qe.IPAD.test(We)||window.navigator.maxTouchPoints&&window.navigator.maxTouchPoints>2&&qe.MAC.test(window.navigator.platform)},it=function(){return et()||tt()||nt()},ot=function(e,t){var n=e||"1366px",i=t||"1024px";return window.matchMedia("only screen and (min-device-width : "+n+") and (max-device-width : "+n+") and (min-device-height : "+i+") and (max-device-height : "+i+") and (min-width: "+n+") and (max-width: "+n+")").matches},rt=function(e,t){var n=e||"1366px",i=t||"1024px";return window.matchMedia("only screen and (min-device-width : "+i+") and (max-device-width : "+i+") and (min-device-height : "+n+") and (max-device-height : "+n+") and (min-width: "+i+") and (max-width: "+i+")").matches},at=function(){return Je()||it()||Ze()||$("#wm-mobile-display:visible").length>0},st=function(){return"MOBILE"===x().platformType&&"APPLICATION"===x().type},lt=function(){var e=window.navigator.userAgent.toLowerCase().match(/android\s([0-9\.]*)/);return e?e[1]:""},ct=function(){return Je()&&4===parseInt(lt(),10)},pt=function(e){var t=e.indexOf("?");return t>-1?(e=encodeURI(e.substring(0,t))+e.substring(t),e=ut(e)):e=encodeURI(e),e},ut=function(e){var t,n,i="";return(n=e.indexOf("?"))>-1&&(n+=1,(t=e.substring(n))&&(t.split("&").forEach((function(e){var t,n=_.includes(e,"=")?e.indexOf("="):e&&e.length,o=e.substr(0,n),r=e.substr(n+1);if(r||_.includes(e,"=")){try{t=decodeURIComponent(r)}catch(e){t=r}i+=o+"="+encodeURIComponent(t)+"&"}else i+=o+"&"})),i=i.slice(0,-1),e=e.replace(t,i))),e},dt=function(e){return e?e.charAt(0).toUpperCase()+e.substring(1):""},ht=function(e){return e===e.toUpperCase()?e:e.replace(qe.SNAKE_CASE,(function(e,t){return(t?" ":"")+e}))},mt=function(e,t,n){return e.substr(0,t)+n+e.substr(t+n.length)},ft=function(e){var t;return-1!==(t=e.indexOf("."))&&(e=mt(e,t+1,e.charAt(t+1).toUpperCase()),e=mt(e,t," ")),e},gt=function(e){return e=_.camelCase(e),e=dt(e),e=ht(e),e=ft(e)},vt=function(e){return e.split("-").join(" ")},yt=function(e,t){void 0===t&&(t=",");var n,i=[];return _.isArray(e)||(i=_.split(e,t)),n=_.map(i,gt),_.isArray(e)?n:n.join(t)},bt=function(e){var t=document.createElement("a");return t.href=e,""!==t.protocol&&(!qe.DATA_URL.test(e)&&(!!wt(location.href,"https://")&&("https:"!==t.protocol&&"wss:"!==t.protocol)))},wt=function(e,t,n){return!!e&&new RegExp("^"+t,n?"i":"").test(e)},Pt=function(e,t){var n;return n=_.attempt((function(){var n=Object.keys(e).map((function(e){return"var "+e+" = data['"+e+"'];"})).join(" ");return new Function("data",n+" return "+t)(e)})),_.isError(n)&&(n=_.get(e,t)),n},_t=function(e){return qe.SUPPORTED_IMAGE_FORMAT.test(e)},Ot=function(e){return qe.SUPPORTED_AUDIO_FORMAT.test(e)},St=function(e){return qe.SUPPORTED_VIDEO_FORMAT.test(e)},Et=function(e){return qe.VALID_WEB_URL.test(e)},Tt=function(e){return Et(e),e};function Ct(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var i=1,o=arguments.length,r=new Array(o-i);i<o;i++)r[i-1]=arguments[i];if(_.isFunction(e))return e.apply(null,r)}var At=function(e,t,n,i,o,r,a){if(t){if("timestamp"===n)return moment(t).valueOf();if("UTC"===n)return new Date(t).toISOString();if(i){var s=n.replaceAll("y","Y").replaceAll("d","D").replace("a","A");if(r)return moment(t).format(s);if("datetimestamp"===o)return t=dn(i,t),moment(t).format(s)}return e.transform(t,n,i,a)}},Rt=function(e){if("string"==typeof e){var t=e.match(qe.ISO_DATE_FORMAT);return!(!t||!t[4])||void 0}},It=function(e,t,n){if(t&&t.pattern&&"timestamp"!==t.pattern){var i=(t&&t.hasOwnProperty("isNativePicker")?_.get(t,"isNativePicker"):at())?"YYYY/MM/DD HH:mm:ss":Qt(t.pattern);e=moment(e,i).toDate()}if(_.isDate(e))return e;if(isNaN(e)||(e=parseInt(e,10)),moment(e).isValid()&&""!==e&&null!=e){var o=new Date(e);return _.isString(e)&&(o=n?dn(n,e):new Date(moment(moment(e).format()).valueOf())),"CURRENT_DATE"===e||isNaN(o.getDay())?He:o}},Dt=function(e,t,n,i,o,r,a,s){void 0===s&&(s=!1);var l=e,c=function(e){if(!t||!t.contains(e.target)&&t!==e.target)if(n.contains(e.target)){if($(e.target).is("input")&&!o)return;l.removeEventListener(i,c,s)}else 0===a&&l.removeEventListener(i,c,s),r()};l.addEventListener(i,c,s);return function(){l.removeEventListener(i,c,s)}},Nt=function(e){return _.cloneDeep(e)},xt=function(e,t,n){var i=_.get(document.forms,[e,t,"files"]);return n?_.map(i,_.identity):i&&i[0]};function kt(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}var Mt,Lt,Ft=function(){return kt()+"-"+kt()+"-"+kt()},jt=function(e,t){var n;return!e||!t||(n=e&&e.split(",").map(Function.prototype.call,String.prototype.trim),_.intersection(n,t.userRoles).length)},Bt=function(e){if(e)try{var t=parseInt(e,10);return Ke(e)||!isNaN(t)?e:JSON.parse(e)}catch(e){return}},Gt=function(e){var t=new X2JS({emptyNodeForm:"content",attributePrefix:"",enableToStringFunc:!1}).xml2js(e);return t&&(t=_.get(t,Object.keys(t)[0])),t},Vt=function(e,t,n){if(e&&t){if(!n)return _.get(e,t);var i,o=t.split("."),r=[];if(o.forEach((function(e){if(!o.length)return i=!0,!1;for(var t,n=e.match(/\w+/g);n.length;)t=n.shift(),r.push({key:t,value:n.length?[]:{}})})),!i)return r.forEach((function(t){var n=e[t.key];Ke(n)||(n=Bt(n))||(n=t.value),e[t.key]=n,e=n})),e}},$t=function(t){var n;return t?n=(n=(n=t&&t.substring(t.lastIndexOf(".")+1))&&n.toLowerCase())===e.DataType.LOCALDATETIME?e.DataType.DATETIME:n:e.DataType.STRING},Ut=function(e){return-1!==ze.indexOf($t(e).toLowerCase())},Wt=function(e){return!(!Ke(e)||_.isArray(e))&&0===Object.keys(e).length},qt=function(e){var t=$(e),n=t.offset().top,i=t.closest('[wmsmoothscroll="true"]');if(st()&&i.length){var o=_.get(i[0],"iscroll"),r=-(n-o.y);r=o.maxScrollY>r?o.maxScrollY:r,o.scrollTo(0,r)}else window.scroll({top:n,left:0,behavior:"smooth"})},zt=function(e){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)},Ht=function(e){var t=_.omit(e,"empty");return _.isEqual(_.keys({content:[],first:!0,last:!0,number:0,numberOfElements:10,size:20,sort:null,totalElements:10,totalPages:1}),_.keys(t).sort())},Yt=function(e,t,n){var i=qe.REPLACE_PATTERN;if(e)return n&&(i=/\{([^\}]+)\}/g),e.replace(i,(function(e,n){return _.get(t,n)}))},Kt=function(t){return _.includes(t,".")&&(t=_.toLower($t(t))),_.includes([e.DataType.DATE,e.DataType.TIME,e.DataType.TIMESTAMP,e.DataType.DATETIME,e.DataType.LOCALDATETIME],t)},Qt=function(e){return _.includes(e,"E")&&(e=_.replace(e,/E[,]?/g,"")),_.replace(e,/y*d*/g,(function(e){return e.toUpperCase()}))},Xt=Qt,Jt=function(e,t){var n=["AM","PM"],i=moment()._locale.meridiem();t&&t.meridians&&_.includes(n,i)&&_.forEach(t.meridians,(function(t,i){_.includes(e,t)&&(e=e.replace(t,n[i]))}));var o=(t&&t.hasOwnProperty("isNativePicker")?_.get(t,"isNativePicker"):at())?_.get(t,"pattern")||"YYYY/MM/DD HH:mm:ss":Qt(_.get(t,"pattern"))||"";return t&&t.pattern&&"timestamp"!==t.pattern&&(isNaN(new Date(e).getTime())?e=moment(e,o):(it()&&(e=moment(e).format("YYYY/MM/DD HH:mm:ss")),e=moment(new Date(e),o)),e=e.toDate()),moment(e,o).isValid()?(it()&&(e=moment(moment(e).valueOf()).format("YYYY/MM/DD HH:mm:ss")),e):(isNaN(e)?new Date(e).getTime()||(e=moment(moment().format("YYYY-MM-DD")+" "+e,"YYYY-MM-DD HH:mm:ss A")):e=parseInt(e,10),new Date(moment(e).valueOf()))},Zt=function(e,t){return e=Jt(e,t),new Date(e)},en=function(e,t){if(e instanceof Blob)return e;var n=Bt(e);return e=n&&n instanceof Object?new Blob([JSON.stringify(n)],{type:t||"application/json"}):new Blob([e],{type:t||"text/plain"})},tn=function(e,t,n){var i=_.isArray(n)?n:_.split(n,",");return i=_.map(i,_.trim),_.isEqualWith(e,t,(function(e,t){return _.every(i,(function(n){var i,o,r;return-1===_.indexOf(n,":")?i=o=_.trim(n):(r=_.split(n,":"),i=_.trim(r[0]),o=_.trim(r[1])),_.get(e,i)===_.get(t,o)}))}))},nn=function(e){return document.querySelector(e)},on=nn,rn=function(e){return!!nn('link[href="'+e+'"]')},an=rn,sn=function(e){var t=nn('link[href="'+e+'"]');t&&t.remove()},ln=function(e,t){if(!rn(e)){var n=document.createElement("link");return n.href=e,t&&t.name&&n.setAttribute(t.name,t.value),n.setAttribute("rel","stylesheet"),n.setAttribute("type","text/css"),document.head.appendChild(n),n}},cn=function(e){void 0===e&&(e=[]),Array.isArray(e)||(e=[e]),e.forEach(ln)},pn=function(e){return!!nn('script[src="'+e+'"], script[data-src="'+e+'"]')},un=pn,dn=function(e,t){return t?new Date(new Date(moment(t).tz(e).format()).toLocaleString("en-US",{timeZone:e})):new Date(new Date(moment().tz(e).format()).toLocaleString("en-US",{timeZone:e}))},hn=function(e,t,n){return void 0===n&&(n=!1),C(void 0,void 0,void 0,(function(){var i;return A(this,(function(o){return!(i=e.trim()).length||pn(i)?[2,Promise.resolve()]:t?[2,new Promise((function(e,t){var n=document.createElement("script");n.type="text/javascript",n.src=i,n.async=!1,n.readyState?n.onreadystatechange=function(){"loaded"!==n.readyState&&"complete"!==n.readyState||(n.onreadystatechange=null,e(!0))}:n.onload=function(){e(!0)},n.onerror=function(e){return t(e)},document.getElementsByTagName("head")[0].appendChild(n)}))]:n?[2,$.ajax({dataType:"script",cache:!0,url:e}).done((function(e){return e})).fail((function(e){return e}))]:[2,$.getScript(e).done((function(e){return e})).fail((function(e){return e}))]}))}))},mn=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=!0),C(void 0,void 0,void 0,(function(){var n,i,o,r,a,s;return A(this,(function(l){switch(l.label){case 0:l.trys.push([0,5,6,7]),n=R(e),i=n.next(),l.label=1;case 1:return i.done?[3,4]:(o=i.value,[4,hn(o,t)]);case 2:l.sent(),l.label=3;case 3:return i=n.next(),[3,1];case 4:return[3,7];case 5:return r=l.sent(),a={error:r},[3,7];case 6:try{i&&!i.done&&(s=n.return)&&s.call(n)}finally{if(a)throw a.error}return[7];case 7:return[2,Promise.resolve()]}}))}))},fn={},gn=function(e,t){var n=window.sessionStorage.getItem(fn.id);(n=n?JSON.parse(n):{})[e]=t,window.sessionStorage.setItem(fn.id,JSON.stringify(n))},vn=function(e){var t=window&&window.sessionStorage&&window.sessionStorage.getItem(fn.id);if(t)return(t=JSON.parse(t))[e]},yn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},bn=function(e){return _.isArray(e)},wn=function(e){return"string"==typeof e},Pn=function(e){return"number"==typeof e},_n=function(e){return"boolean"==typeof e},On=function(e){return new Promise((function(t,n){resolveLocalFileSystemURL(e,(function(i){i.file((function(i){var o=new FileReader;o.onloadend=function(){var n=new Blob([o.result],{type:i.type});t({blob:n,filepath:e})},o.onerror=n,o.readAsArrayBuffer(i)}))}),n)}))},Sn=function(){return!!window.cordova},En={INT_MAX_VALUE:2147483647},Tn=function(e,t){void 0===t&&(t="_self"),Sn()&&_.startsWith(e,"#")?location.hash=e:window.open(e,t)},Cn=function(e,t,n,i,o){return void 0===n&&(n=!1),$.ajax({type:"get",dataType:e,url:t,async:!n}).done((function(e){return i&&i(e)})).fail((function(e){return o&&o(e)}))},An=function(e){return e instanceof Promise?e:Promise.resolve(e)},Rn=function(e,t,n,i){void 0===i&&(i=function(){return Promise.resolve(!1)});var o=0,r=function(){if(o++,_.isFunction(e))return e()};return n=_.isNumber(n)&&n>0?n:0,t=_.isNumber(t)&&t>0?t:0,new Promise((function(e,a){var s=function(){var l=arguments;setTimeout((function(){An(i()).then((function(t){!1!==t&&(!n||o<=n)?An(r()).then(e,s):a(l)}),(function(){return a(l)}))}),t)};An(r()).then(e,s)}))},In=function(){var e={promise:null,reject:null,resolve:null,onAbort:function(){},isAborted:!1};return e.promise=new Promise((function(t,n){e.resolve=t,e.reject=n})),e.promise.abort=function(){Ct(e.onAbort),e.reject("aborted"),e.isAborted=!0},e},Dn=function(e,t){document.styleSheets[0].insertRule(e+" { "+t+" }")},Nn=function(e){var t={},n=e.indexOf("?");-1!==n&&_.split(e.substring(n+1,e.length),"&").forEach((function(e){e=_.split(e,"="),t[e[0]]=e[1]}));return t},xn=function(e){var t=(e=e.replace("#/","/")).indexOf("?");return-1!==t&&(e=e.substring(0,t)),e},kn=/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),Mn=function(){var e={promise:null,resolve:yn,reject:yn};return e.promise=new Promise((function(t,n){e.resolve=t,e.reject=n})),e},Ln=function(e,t,n,i){if(n=n||Mn(),0===(i=i||0)&&(e=_.filter(e,(function(e){return!(_.isUndefined(e)||_.isNull(e))}))),e&&i<e.length)try{An(e[i].apply(void 0,t)).then((function(){return Ln(e,t,n,i+1)}),n.reject)}catch(e){n.reject(e)}else n.resolve();return n.promise},Fn=function(e,t){return e.execute(Ne.Operation.GET_UNIQUE_IDENTIFIER)===t.execute(Ne.Operation.GET_UNIQUE_IDENTIFIER)&&_.isEqual(e.execute(Ne.Operation.GET_CONTEXT_IDENTIFIER),t.execute(Ne.Operation.GET_CONTEXT_IDENTIFIER))},jn=function(e,t){return e.execute(Ne.Operation.GET_CONTEXT_IDENTIFIER)===t},Bn=function(e,t,i){var o=e.registerDestroyListener?e.registerDestroyListener.bind(e):_.noop,r=new n.Subject,a=function(n,a){wt(n[a],"bind:")&&o(we(n[a].replace("bind:",""),e,{},i?i.invokeOnFiltertExpressionChange.bind(i,n,a):function(e,i){e===i&&_.isUndefined(e)||_.isUndefined(e)&&!_.isUndefined(i)||(_.includes(["blob","file"],n.type)||(e=Nt(e)),"dataBinding"===n.target?(t.rules=[],_.forEach(e,(function(e,i){t.rules.push({target:i,value:e,matchMode:n.matchMode||"startignorecase",required:!1,type:""})}))):n[a]=e,r.next({filterExpressions:t,newVal:e}))},void 0,!1,{arrayType:_.includes(["in","notin"],n.matchMode)}))},s=function(e){e.rules&&_.forEach(e.rules,(function(e,t){e.rules?s(e):("between"===e.matchMode&&a(e,"secondvalue"),a(e,"value"))}))};return s(t),r},Gn=function(e,t){for(var n=Object.getPrototypeOf(e);Object.getPrototypeOf(n).constructor!==Object;)if(t===(n=Object.getPrototypeOf(n)))return;Object.setPrototypeOf(n,t)},Vn=function(e){if(_.isString(e))return _.startsWith(e,"file:///")||/^data:image\/([a-z]{2,});base64,/.test(e)?e:e.replace(new RegExp("([^:]/)(/)+","g"),"$1")};$.cachedScript=(Mt=new Map,Lt=new Set,function(e){if(function(e){return Lt.has(e)}(e))return Promise.resolve();if(function(e){return Mt.has(e)}(e))return Mt.get(e);!function(e){var t,n,i=new Promise((function(e,i){t=e,n=i}));i.resolve=t,i.reject=n,Mt.set(e,i)}(e);var t={dataType:"script",cache:!0,url:e};return $.ajax(t).done((function(){return function(e){Lt.add(e),Mt.get(e).resolve(),Mt.delete(e)}(e)})),Mt.get(e)});var $n={DATE:"yyyy-MM-dd",TIME:"hh:mm a",TIMESTAMP:"yyyy-MM-dd hh:mm:ss a",DATETIME:"yyyy-MM-dd hh:mm:ss a"},Un=function(e){return $n[_.toUpper(e)]},Wn=function(e){var t=e.querySelectorAll("label.control-label"),n=e.querySelectorAll("[focus-target]");(n.length||(n=e.querySelectorAll("input, select, textarea")),t.length&&n.length)&&((o=$(n[0]).closest("[widget-id]").attr("widget-id"))&&(T(n[0],"id",o),T(t[0],"for",o)));var i=e.querySelectorAll("ul");if(t.length&&i.length&&("radiogroup"===i[0].getAttribute("role")||"group"===i[0].getAttribute("role"))){var o="wm-group-label-"+Ft();T(i[0],"aria-labelledby",o),T(t[0],"id",o)}},qn=function(e,t,n,i){(n._ngZone||n.ngZone).onStable.subscribe((function(){var t=Yn(e);t.m41<0&&(t.m41=0,Hn(e,t))}))},zn=function(e,t,n,i){var o,r=i?_.parseInt(i.css("width")):_.parseInt(e.css("width")),a=$(window).width()+window.scrollX,s=t.getBoundingClientRect(),l=s.right+window.scrollX;(n._ngZone||n.ngZone).onStable.subscribe((function(){var t=Yn(e);a-(l+s.width)<r&&((o=l-r)<0&&(o=0),t.m41=o,Hn(e,t))}))},Hn=function(e,t){var n="translate3d("+t.m41+"px, "+t.m42+"px, 0px)";e[0].style.webkitTransform=n,e[0].style.MozTransform=n,e[0].style.msTransform=n,e[0].style.OTransform=n,e[0].style.transform=n},Yn=function(e){return"undefined"==typeof WebKitCSSMatrix?new MSCSSMatrix(window.getComputedStyle(e[0]).transform):new WebKitCSSMatrix(window.getComputedStyle(e[0]).webkitTransform)},Kn=function(e){if(!e.closest(".app-popover").length){var t=document.querySelectorAll(".app-popover-wrapper");_.forEach(t,(function(e){e.widget.isOpen&&(e.widget.isOpen=!1)}))}},Qn=Re,Xn=function(e,t){var n=t.link,i=t.action,o=t.target;if(i&&(e.itemActionFn||(e.itemActionFn=oe(i)),e.itemActionFn(e.userDefinedExecutionContext,Object.create(t))),n)if(!n.startsWith("#/")||o&&"_self"!==o)Tn(n,o);else{var r=Nn(n);n=xn(n),(_.get(e,"route")||_.get(e,"menuRef.route")).navigate([n],{queryParams:r})}},Jn=function(e,t){var n=_.startsWith(e,"Variables."),i=_.startsWith(e,"Widgets."),o=e.split(".");if(n)return _.get(t.viewParent.Variables,o[1]);if(i){var r,a=_.get(t.viewParent.Widgets,o[1]),s=a.$attrs.get("datasetboundexpr");return r=!a.datasource&&s?s:a.binddataset,Jn(r,a)}},Zn=function(e,t){if(/^Widgets\..*\.currentItem/g.test(e)){var n=e.split("."),i=_.get(t.viewParent.Widgets,n[1]),o=i.$attrs.get("datasetboundexpr");if(!i.datasource&&o)return e=e.replace(/^Widgets\..*\.currentItem/g,o+"[$i]"),Zn(e,t);e=e.replace(/^Widgets\..*\.currentItem/g,i.binddataset+"[$i]")}return e},ei=function(e){var t=e.closest(".app-prefab");return t.length||(t=e.closest(".app-partial")),t.length||(t=e.closest(".app-spa-page")),t.length||(t=e.closest(".app-page")),t.length&&t.parent()[0].tagName},ti={REQUIRED:"required",MAXCHARS:"maxchars",MINVALUE:"minvalue",MAXVALUE:"maxvalue",REGEXP:"regexp",MINDATE:"mindate",MAXDATE:"maxdate",MINTIME:"mintime",MAXTIME:"maxtime",EXCLUDEDATES:"excludedates",EXCLUDEDAYS:"excludedays"},ni=function(e){if(_.isString(e)&&Sn()&&e.startsWith("file://")){if(it())return e.replace("file://","/_app_file_");if(Je()&&location.href.startsWith("http")){if(e.startsWith(cordova.file.applicationDirectory))return e.replace(cordova.file.applicationDirectory+"www","");if(e.startsWith("file://"))return e.replace("file://","/_app_file_")}}return e},ii=function(e){var t=document.createElement("script");t.onload=function(){e(WM_CUSTOM_FORMATTERS)},t.onerror=function(e){console.warn("Error while loading the file "+t.src+"\n"+e)},t.type="text/javascript",t.src="./extensions/formatters.js",document.head.appendChild(t)},oi=function(e,t){return _WM_APP_PROPERTIES.extra_settings&&_.get(_WM_APP_PROPERTIES.extra_settings,e)||t},ri=function(e){var t="";e.itemsperrow?isNaN(parseInt(e.itemsperrow,10))?(_.split(e.itemsperrow," ").forEach((function(e){var n=_.split(e,"-");e=n[0]+"-"+12/parseInt(n[1],10),t+=" col-"+e})),e.itemsPerRowClass=t.trim()):e.itemsPerRowClass="col-xs-"+12/parseInt(e.itemsperrow,10):e.itemsPerRowClass="col-xs-12"},ai=Object.freeze({__proto__:null,isDefined:Ye,isObject:Ke,toBoolean:Qe,isIE:Xe,isAndroid:Je,isAndroidTablet:Ze,isIphone:et,isIpod:tt,isIpad:nt,isIos:it,isLargeTabletLandscape:ot,isLargeTabletPortrait:rt,isMobile:at,isTablet:function(){var e=document.querySelector(".app-page").widget;return e&&e.viewParent.Viewport.isTabletType},isMobileApp:st,getAndroidVersion:lt,isKitkatDevice:ct,encodeUrl:pt,encodeUrlParams:ut,initCaps:dt,spaceSeparate:ht,replaceAt:mt,periodSeparate:ft,prettifyLabel:gt,deHyphenate:vt,prettifyLabels:yt,isInsecureContentRequest:bt,stringStartsWith:wt,getEvaluatedExprValue:Pt,isImageFile:_t,isAudioFile:Ot,isVideoFile:St,isValidWebURL:Et,getResourceURL:Tt,triggerFn:Ct,getFormattedDate:At,hasOffsetStr:Rt,getDateObj:It,addEventListenerOnElement:Dt,getClonedObject:Nt,getFiles:xt,generateGUId:Ft,validateAccessRoles:jt,getValidJSON:Bt,xmlToJson:Gt,findValueOf:Vt,extractType:$t,isNumberType:Ut,isEmptyObject:Wt,scrollToElement:qt,isElementInViewport:zt,isPageable:Ht,replace:Yt,isDateTimeType:Kt,getValidDateObject:Jt,getNativeDateObject:Zt,getBlob:en,isEqualWithFields:tn,loadStyleSheet:ln,loadStyleSheets:cn,getMomentLocaleObject:dn,loadScript:hn,loadScripts:mn,_WM_APP_PROJECT:fn,setSessionStorageItem:gn,getSessionStorageItem:vn,noop:yn,isArray:bn,isString:wn,isNumber:Pn,isBoolean:_n,convertToBlob:On,hasCordova:Sn,AppConstants:En,openLink:Tn,fetchContent:Cn,toPromise:An,retryIfFails:Rn,getAbortableDefer:In,createCSSRule:Dn,getUrlParams:Nn,getRouteNameFromLink:xn,isAppleProduct:kn,defer:Mn,executePromiseChain:Ln,isDataSourceEqual:Fn,validateDataSourceCtx:jn,processFilterExpBindNode:Bn,extendProto:Gn,removeExtraSlashes:Vn,getDisplayDateTimeFormat:Un,addForIdAttributes:Wn,adjustContainerPosition:qn,adjustContainerRightEdges:zn,setTranslation3dPosition:Hn,getWebkitTraslationMatrix:Yn,closePopover:Kn,detectChanges:Qn,triggerItemAction:Xn,getDatasourceFromExpr:Jn,extractCurrentItemExpr:Zn,findRootContainer:ei,VALIDATOR:ti,transformFileURI:ni,appendScriptToHead:ii,getAppSetting:oi,setListClass:ri,"\u02750":Xt,"\u02751":on,"\u02752":an,"\u02753":sn,"\u02754":un}),si=function(){function e(e){void 0===e&&(e=!0),this._subject=new n.Subject,this._isInitialized=!1,this._eventsBeforeInit=[],e&&this.start()}return e.prototype.notify=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this._isInitialized?this._subject.next({name:e,data:t}):this._eventsBeforeInit.push({name:e,data:t})},e.prototype.start=function(){var e=this;this._isInitialized||(this._isInitialized=!0,this._eventsBeforeInit.forEach((function(t){return e._subject.next(t)})))},e.prototype.subscribe=function(e,t){var n;return e&&t?(n=this._subject.subscribe((function(n){n&&Ke(n)&&n.name===e&&t.apply(void 0,n.data)})),function(){n.unsubscribe()}):yn},e.prototype.destroy=function(){this._subject.complete()},e}(),li=768,ci=1200,pi=function(){function e(){var e=this;this.orientation={isPortrait:!1,isLandscape:!1},this.isMobileType=!1,this.isTabletType=!1,this._eventNotifier=new si(!0),this.setScreenType(),window.addEventListener("resize",this.resizeFn.bind(this));var t=window.matchMedia("(orientation: portrait)");t.matches?this.orientation.isPortrait=!0:this.orientation.isLandscape=!0,t.addEventListener&&t.addEventListener("change",(function(t){return e.orientationChange(t,!t.matches)}))}return e.prototype.update=function(e){this.selectedViewPort=e,this.setScreenType()},e.prototype.orientationChange=function(e,t){t!==this.orientation.isLandscape&&(this.orientation.isPortrait=!t,this.orientation.isLandscape=t,this.notify("orientationchange",{$event:e,data:{isPortrait:!t,isLandscape:t}}))},e.prototype.resizeFn=function(e){this.setScreenType(),this.orientationChange(e,this.screenWidth>=this.screenHeight),this.notify("resize",{$event:e,data:{screenWidth:this.screenWidth,screenHeight:this.screenHeight}})},e.prototype.subscribe=function(e,t){return this._eventNotifier.subscribe(e,t)},e.prototype.notify=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this._eventNotifier.notify.apply(this._eventNotifier,arguments)},e.prototype.setScreenType=function(){var e=document.querySelector(".wm-app");this.screenWidth=e.clientWidth,this.screenHeight=e.clientHeight;this.screenWidth<this.screenHeight?this.screenWidth:this.screenHeight,this.screenWidth>this.screenHeight?this.screenWidth:this.screenHeight;if(this.isTabletType=!1,this.isMobileType=!1,_.get(this.selectedViewPort,"deviceCategory")){var t=this.selectedViewPort.deviceCategory;"Tab"===t?this.isTabletType=!0:"Smartphone"===t&&(this.isMobileType=!0)}else parseInt(getComputedStyle(document.documentElement).getPropertyValue("--screen-xs"))||480,li=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--screen-sm"))||768,ci=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--screen-lg"))||1200,this.screenWidth>=ci?(this.isTabletType=Je()||it()||Ze(),this.isMobileType=!1):this.screenWidth>=li?(this.type=1,this.isTabletType=!0):(this.type=0,this.isMobileType=!0)},e.prototype.ngOnDestroy=function(){this._eventNotifier.destroy(),window.removeEventListener("resize",this.resizeFn)},e}();pi.\u0275prov=p.\u0275\u0275defineInjectable({factory:function(){return new pi},token:pi,providedIn:"root"}),pi.decorators=[{type:i.Injectable,args:[{providedIn:"root"}]}],pi.ctorParameters=function(){return[]};var ui=function(){this.MATCH_MODES={STARTS_WITH_IGNORE_CASE:"startignorecase",STARTS_WITH:"start",ENDS_WITH_IGNORE_CASE:"endignorecase",ENDS_WITH:"end",CONTAINS:"anywhere",CONTAINS_IGNORE_CASE:"anywhereignorecase",IS_EQUAL_WITH_IGNORE_CASE:"exactignorecase",IS_EQUAL:"exact"},this.VALIDATOR=ti};ui.\u0275prov=p.\u0275\u0275defineInjectable({factory:function(){return new ui},token:ui,providedIn:"root"}),ui.decorators=[{type:i.Injectable,args:[{providedIn:"root"}]}];var di=function(){_.assign(this,ai)};di.\u0275prov=p.\u0275\u0275defineInjectable({factory:function(){return new di},token:di,providedIn:"root"}),di.decorators=[{type:i.Injectable,args:[{providedIn:"root"}]}],di.ctorParameters=function(){return[]};var hi=function(){_.assign(this,{INTEGER:"integer",BIG_INTEGER:"big_integer",SHORT:"short",FLOAT:"float",BIG_DECIMAL:"big_decimal",DOUBLE:"double",LONG:"long",BYTE:"byte",STRING:"string",CHARACTER:"character",TEXT:"text",DATE:"date",TIME:"time",TIMESTAMP:"timestamp",DATETIME:"datetime",BOOLEAN:"boolean",LIST:"list",CLOB:"clob",BLOB:"blob"})};hi.\u0275prov=p.\u0275\u0275defineInjectable({factory:function(){return new hi},token:hi,providedIn:"root"}),hi.decorators=[{type:i.Injectable,args:[{providedIn:"root"}]}],hi.ctorParameters=function(){return[]};var mi=function(){_.assign(this,{TEXT:"text",NUMBER:"number",TEXTAREA:"textarea",PASSWORD:"password",CHECKBOX:"checkbox",SLIDER:"slider",RICHTEXT:"richtext",CURRENCY:"currency",SWITCH:"switch",SELECT:"select",CHECKBOXSET:"checkboxset",RADIOSET:"radioset",DATE:"date",TIME:"time",TIMESTAMP:"timestamp",UPLOAD:"upload",RATING:"rating",DATETIME:"datetime",AUTOCOMPLETE:"autocomplete",CHIPS:"chips",COLORPICKER:"colorpicker"})};mi.\u0275prov=p.\u0275\u0275defineInjectable({factory:function(){return new mi},token:mi,providedIn:"root"}),mi.decorators=[{type:i.Injectable,args:[{providedIn:"root"}]}],mi.ctorParameters=function(){return[]};var fi=[],gi=function(){function e(e){var t=this;this.http=e,this.scripts={},fi.forEach((function(e){t.scripts[e.name]={loaded:!1,src:e.src}}))}return e.prototype.load=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t&&t.length?Promise.resolve().then((function(){return e.pathMappings||e.loadPathMappings()})).then((function(){return Promise.all(t.map((function(t){return e.loadScript(t)})))})):Promise.resolve()},e.prototype.loadPathMappings=function(){var e=this,t=(fn.cdnUrl||fn.ngDest)+"path_mapping.json";return this.http.get(t).toPromise().then((function(t){e.pathMappings=t}),(function(){e.pathMappings={}}))},e.prototype.loadScript=function(e){var t=this;return new Promise((function(n,i){if(t.scripts[e]&&t.scripts[e].loaded)n({script:e,loaded:!0});else{t.scripts[e]||(t.scripts[e]={loaded:!1,src:e});var o=document.createElement("script");o.type="text/javascript",o.async=!1;var r=t.scripts[e].src;(r=t.pathMappings[r]||r).startsWith("http")?o.src=r:o.src=(fn.cdnUrl||fn.ngDest)+r,o.readyState?o.onreadystatechange=function(){"loaded"!==o.readyState&&"complete"!==o.readyState||(o.onreadystatechange=null,t.scripts[e].loaded=!0,n({script:e,loaded:!0}))}:o.onload=function(){t.scripts[e].loaded=!0,n({script:e,loaded:!0})},o.onerror=function(t){return n({script:e,loaded:!1,status:"Loaded"})},document.getElementsByTagName("head")[0].appendChild(o)}}))},e}();gi.\u0275prov=p.\u0275\u0275defineInjectable({factory:function(){return new gi(p.\u0275\u0275inject(u.HttpClient))},token:gi,providedIn:"root"}),gi.decorators=[{type:i.Injectable,args:[{providedIn:"root"}]}],gi.ctorParameters=function(){return[{type:o.HttpClient}]};var vi=function(){function e(){this.customPipes=new Map}return e.prototype.setCustomPipe=function(e,t){this.customPipes.set(e,t)},e.prototype.getCustomPipe=function(e){return this.customPipes.get(e)},e.prototype.hasCustomPipe=function(e){return this.customPipes.has(e)},e}();vi.\u0275prov=p.\u0275\u0275defineInjectable({factory:function(){return new vi},token:vi,providedIn:"root"}),vi.decorators=[{type:i.Injectable,args:[{providedIn:"root"}]}];var yi=function(){function e(){this.HISTORY_HANDLER="replace",this.HISTORY_HANDLER_TYPES={push:"pushState",replace:"replaceState"},this.WIDGET_STATE_KEY="ws"}return e.prototype.setHistoryHandler=function(e){Object.keys(this.HISTORY_HANDLER_TYPES).indexOf(e)>-1&&(this.HISTORY_HANDLER=e)},e.prototype.getNestedPath=function(e,t,n){var i=n||t;return e&&(e.prefabName||e.partialName)?(i=(i=i.length>0?i+"."+(e.prefabName||e.partialName):e.prefabName||e.partialName)+"."+e.containerWidget.name,this.getNestedPath(e.containerWidget.viewParent,t,i)):i.split(".").reverse().join(".")},e.prototype.getStateInformation=function(e){var t;if("url"===e.toLowerCase()){if(t=decodeURIComponent(window.location.href).match(/(wm_state=).*?(&|$)/))return t=t[0].replace("wm_state=",""),this.uriToJson(t)}else"localstorage"===e.toLowerCase()?t=localStorage.getItem(window.location.pathname.replace(/\//g,"")+"_wm_state"):"sessionstorage"===e.toLowerCase()&&(t=sessionStorage.getItem(window.location.pathname.replace(/\//g,"")+"_wm_state"));if(t)return JSON.parse(t)},e.prototype.getWidgetState=function(e,t){if(t=t||this.computeMode(e.statehandler)){var n=this.getStateInformation(t);if(n&&e&&e.getAppInstance().activePageName&&("localstorage"===t.toLowerCase()||"sessionstorage"===t.toLowerCase())&&(n=n[e.getAppInstance().activePageName]),_.get(n,this.WIDGET_STATE_KEY)){var i=this.getNestedPath(e.viewParent,e.getWidget().name);return n[this.WIDGET_STATE_KEY][i]}}},e.prototype.computeMode=function(e){return e?e&&"none"===e.toLowerCase()?void 0:e.toLowerCase():"url"},e.prototype.setWidgetState=function(e,t,n){var i=this.getNestedPath(e.viewParent,e.getWidget().name);(n=n||this.computeMode(e.statehandler))&&this.setStateParams(this.WIDGET_STATE_KEY,i,t,n,e)},e.prototype.removeWidgetState=function(e,t,n){if(n=n||this.computeMode(e.statehandler)){var i=this.getNestedPath(e.viewParent,e.getWidget().name);this.removeStateParam(this.WIDGET_STATE_KEY,i,t,n,e)}},e.prototype.setStateVariable=function(e,t,n){(n=n||this.computeMode(n))&&this.setStateParams("",e,t,n)},e.prototype.getStateVariable=function(e,t){if(t=t||this.computeMode(t)){var n=this.getStateInformation(t);return n?n[e]:void 0}},e.prototype.removeStateVariable=function(e,t){(t=t||this.computeMode(t))&&this.removeStateParam("",e,null,t)},e.prototype.setStateParams=function(e,t,n,i,o){var r,a,s,l,c,p=this.getStateInformation(i);c=o&&p&&o.getAppInstance().activePageName&&("localstorage"===i.toLowerCase()||"sessionstorage"===i.toLowerCase())?p[o.getAppInstance().activePageName]:_.clone(p),e?(c&&!c[e]?c[e]={}:c||((r={})[e]={},c=r),_.isObject(n)&&!_.isArray(n)?(c[e][t]=c[e][t]||{},_.merge(c[e][t],n)):c[e][t]=n):(c&&!c[t]?c[t]={}:c||((a={})[t]={},c=a),_.isObject(n)&&!_.isArray(n)?(c[t]=c[t]||{},_.merge(c[t],n)):c[t]=n),o&&o.getAppInstance().activePageName&&("localstorage"===i.toLowerCase()||"sessionstorage"===i.toLowerCase())&&(p?(p[o.getAppInstance().activePageName]=c,c=p):((s={})[o.getAppInstance().activePageName]=c,c=s));var u=decodeURIComponent(window.location.href);u.indexOf("?")<0?u+="?wm_state=":u.indexOf("wm_state")<0&&(u+="&wm_state="),l=u.replace(/(wm_state=).*?(&|$)/,"$1"+this.jsonToUri(c)+"$2"),"localstorage"!==i.toLowerCase()?"sessionstorage"!==i.toLowerCase()?decodeURIComponent(window.location.href)!==decodeURIComponent(l)&&("push"===this.HISTORY_HANDLER?window.history.pushState({path:l},"",l):"replace"===this.HISTORY_HANDLER&&window.history.replaceState({path:l},"",l)):sessionStorage.setItem(window.location.pathname.replace(/\//g,"")+"_wm_state",JSON.stringify(c)):localStorage.setItem(window.location.pathname.replace(/\//g,"")+"_wm_state",JSON.stringify(c))},e.prototype.removeStateParam=function(e,t,n,i,o){var r,a,s="",l=this.getStateInformation(i);if(a=o&&l&&o.getAppInstance().activePageName&&("localstorage"===i.toLowerCase()||"sessionstorage"===i.toLowerCase())?l[o.getAppInstance().activePageName]:_.clone(l),_.get(a,[e])||_.get(a,t))if(_.get(a,e+"."+t)||a&&a[e]&&a[e][t]?(n?delete a[e][t][n]:delete a[e][t],_.isEmpty(a[e][t])&&delete a[e][t],_.isEmpty(a[e])&&delete a[e]):!e&&_.get(a,t)&&delete a[t],o&&o.getAppInstance().activePageName&&("localstorage"===i.toLowerCase()||"sessionstorage"===i.toLowerCase())&&(l?(l[o.getAppInstance().activePageName]=a,a=l):((r={})[o.getAppInstance().activePageName]=a,a=r)),"localstorage"!==i.toLowerCase())if("sessionstorage"!==i.toLowerCase()){var c=decodeURIComponent(window.location.href);_.isEmpty(a)?(s=c.replace(/(wm_state=).*?(&|$)/,"$2"),_.includes(["&","?"],s.charAt(s.length-1))&&(s=s.replace(s.charAt(s.length-1),""))):s=c.replace(/(wm_state=).*?(&|$)/,"$1"+this.jsonToUri(a)+"$2"),window.history.replaceState({path:s},"",s)}else sessionStorage.setItem(window.location.pathname.replace(/\//g,"")+"_wm_state",JSON.stringify(a));else localStorage.setItem(window.location.pathname.replace(/\//g,"")+"_wm_state",JSON.stringify(a))},e.prototype.jsonToUri=function(e){return encodeURIComponent(JSON.stringify(e).replace(/[()'~_!*]/g,(function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})).replace(/\{/g,"(").replace(/\}/g,")").replace(/"/g,"'").replace(/\:/g,"~").replace(/,/g,"_").replace(/\[/g,"!").replace(/\]/g,"*"))},e.prototype.uriToJson=function(e){var t;try{t=JSON.parse(decodeURIComponent(e).replace(/\(/g,"{").replace(/\)/g,"}").replace(/'/g,'"').replace(/~/g,":").replace(/_/g,",").replace(/\!/g,"[").replace(/\*/g,"]"))}catch(e){console.warn(e)}return t},e}();yi.\u0275prov=p.\u0275\u0275defineInjectable({factory:function(){return new yi},token:yi,providedIn:"root"}),yi.decorators=[{type:i.Injectable,args:[{providedIn:"root"}]}];var bi=function(){function e(){}return e.prototype.updateFieldsOnPagination=function(e,t){var n,i="wm-table"===e.widgetType?e.gridData:e.fieldDefs;"wm-table"===e.widgetType&&e.gridOptions.isNavTypeScrollOrOndemand()&&-1!==e.gridOptions.deletedRowIndex&&(i.splice(e.gridOptions.deletedRowIndex,1),e.gridOptions.setDeletedRowIndex(-1)),"wm-table"!==e.widgetType||!e.gridOptions.isNavTypeScrollOrOndemand()||e.gridOptions.lastActionPerformed!==e.gridOptions.ACTIONS.SEARCH_OR_SORT&&e.gridOptions.lastActionPerformed!==e.gridOptions.ACTIONS.FILTER_CRITERIA&&e.gridOptions.lastActionPerformed!==e.gridOptions.ACTIONS.DATASET_UPDATE||(i=[],e.gridOptions.setCurrentPage(1)),n="wm-table"===e.widgetType&&e.gridOptions.showviewlessbutton&&"viewless"===e.gridOptions.mode?e.gridOptions.getCurrentPage():e.currentPage;var o=e.dataNavigator,r=e.pagesize;if(!Ye(i)||o.isFirstPage())i=[],n=1;else if(i.length/r<=o.pageCount){var a=void 0,s=[];if(i.length===n*r&&n+1===o.dn.currentPage)s=t,n++;else if(i.length<n*r){i.length===(n-1)*r&&n-1===o.dn.currentPage?t=[]:o.dataSize<n*r?a=o.dataSize-i.length:(a=n*r-i.length,n++);var l=t.length-a;s=t.slice(l)}else i.length===n*r&&n===o.dn.currentPage&&(s=[]);t=s}return[i="wm-table"!==e.widgetType||e.gridOptions.lastActionPerformed!==e.gridOptions.ACTIONS.DELETE&&e.gridOptions.lastActionPerformed!==e.gridOptions.ACTIONS.EDIT?D(D([],I(i)),I(t)):this.getUniqueRecordsInFieldDef(i,t),n]},e.prototype.getUniqueRecordsInFieldDef=function(e,t){var n=!1;return e.length?t.forEach((function(t){n=!1,e.forEach((function(e){_.isEqual(t,e)&&(n=!0)})),!1===n&&e.push(t)})):e=t,e},e.prototype.bindScrollEvt=function(e,t,n){var i,o,r=this,a=e.dataNavigator,s=e.$element.find(t),l=s.children().first(),c=this,p=0;l.length&&((o=(i=l.scrollParent(!1))[0]===document?document.body:i[0]).scrollHeight>o.clientHeight?(i.each((function(e,t){p=t===document?t.body.scrollTop||$(window).scrollTop():t.scrollTop})).off("scroll.scroll_evt").on("scroll.scroll_evt",(function(t){var i,o,r,s=t.target;s=s===document?s.scrollingElement||document.body:s,"wm-table"===e.widgetType&&e.gridOptions.isNavTypeScrollOrOndemand()&&t.stopPropagation(),i=s.clientHeight,o=s.scrollHeight,r=s===document.body?$(window).scrollTop():s.scrollTop,p<r&&.9*o<r+i&&($(this).off("scroll.scroll_evt"),c.debouncedFetchNextDatasetOnScroll(a,n,e)()),p=r})),s.off("wheel.scroll_evt")):s.on("wheel.scroll_evt",(function(t){"wm-table"===e.widgetType&&e.gridOptions.isNavTypeScrollOrOndemand()&&t.stopPropagation(),t.originalEvent.deltaY>0&&(s.off("wheel.scroll_evt"),r.debouncedFetchNextDatasetOnScroll(a,n,e)())})))},e.prototype.debouncedFetchNextDatasetOnScroll=function(e,t,n){var i=this;return _.debounce((function(){return i.fetchNextDatasetOnScroll(e,n)}),t)},e.prototype.fetchNextDatasetOnScroll=function(e,t){t.variableInflight||("wm-table"===t.widgetType&&(t.gridOptions.setIsNextPageData(!0),t.gridOptions.setIsDataUpdatedByUser(!1)),e.navigatePage("next"))},e.prototype.bindIScrollEvt=function(e,t){var n=this,i=e.$element,o=e.dataNavigator,r=e.app,a=i.closest('[wmsmoothscroll="true"]');if(_.get(a[0],"iscroll"))this.setIscrollHandlers(a[0],o,t);else{var s=r.subscribe("iscroll-update",(function(e){!_.isEmpty(e)&&e.isSameNode(a[0])&&(n.setIscrollHandlers(a[0],o,t),s())}));r.notify("no-iscroll",a[0])}},e.prototype.setIscrollHandlers=function(e,t,n){var i=this,o=0,r=_.get(e.iscroll,"wrapper"),a=e.iscroll;e.iscroll.on("scrollEnd",(function(){var s=r.clientHeight,l=r.scrollHeight,c=Math.abs(e.iscroll.y);o<c&&.9*l<c+s&&(i.debouncedFetchNextDatasetOnScroll(t,n,parent)(),a.indicatorRefresh&&a.indicatorRefresh()),o=c}))},e}();bi.\u0275prov=p.\u0275\u0275defineInjectable({factory:function(){return new bi},token:bi,providedIn:"root"}),bi.decorators=[{type:i.Injectable,args:[{providedIn:"root"}]}];var wi=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[]}},e}();wi.decorators=[{type:i.NgModule,args:[{declarations:[],imports:[o.HttpClientModule],providers:[],bootstrap:[]}]}];var Pi=function(){function e(e,t,n){var i=this;void 0===e&&(e=100),void 0===t&&(t=60),this.maxSize=e,this.maxAge=t,this.onEvict=n,this.cache=new Map,this.evictQueue=[""],this.evictQueue.shift(),this.maxAge>0&&(this.maxAge<=30&&console.warn("Cache age "+this.maxAge+"s is very less. Keep it atleast 30s."),this.maxAge=1e3*this.maxAge,setInterval((function(){var e=Date.now()-i.maxAge,t=i.evictQueue.filter((function(t){return i.cache.get(t).lastAccessedTime<=e}));i.evict(t.length)}),this.maxAge))}return e.prototype.addToEvictQueue=function(e){var t=this.evictQueue.findIndex((function(t){return t===e}));t>=0&&this.evictQueue.splice(t,1),this.evictQueue.push(e)},e.prototype.evict=function(e){void 0===e&&(e=1);for(var t=0;t<e;t++)this.delete(this.evictQueue[0])},e.prototype.keys=function(){return this.cache.keys()},e.prototype.set=function(e,t){if(!_.isNil(t)){var n={instance:t,lastAccessedTime:Date.now()};this.cache.set(e,n),this.addToEvictQueue(e),this.evict(this.evictQueue.length-this.maxSize)}},e.prototype.get=function(e){var t=this.cache.get(e);return t?(t.lastAccessedTime=Date.now(),this.addToEvictQueue(e),t.instance):null},e.prototype.delete=function(e){if(e&&this.cache.has(e)){var t=this.cache.get(e);this.cache.delete(e),this.onEvict&&this.onEvict(e,t.instance);var n=this.evictQueue.findIndex((function(t){return t===e}));n>=0&&this.evictQueue.splice(n,1)}},e.prototype.has=function(e){return this.cache.has(e)},e.prototype.size=function(){return this.evictQueue.length},e.prototype.clear=function(){this.evict(this.evictQueue.length)},e}();e.$appDigest=Re,e.$invokeWatchers=function(e,t){if(e)Se(t);else{if(fe)return void(fe=!1);Ae()}},e.$parseEvent=oe,e.$parseExpr=ne,e.$unwatch=Pe,e.$watch=we,e.AbstractDialogService=ke,e.AbstractHttpService=Me,e.AbstractI18nService=Le,e.AbstractNavigationService=Ge,e.AbstractSpinnerService=je,e.AbstractToasterService=Fe,e.App=xe,e.AppConstants=En,e.AppDefaults=Ve,e.CURRENCY_INFO={USD:{symbol:"$",name:"US Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"USD",name_plural:"US dollars"},CAD:{symbol:"CA$",name:"Canadian Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"CAD",name_plural:"Canadian dollars"},EUR:{symbol:"\u20ac",name:"Euro",symbol_native:"\u20ac",decimal_digits:2,rounding:0,code:"EUR",name_plural:"euros"},AED:{symbol:"AED",name:"United Arab Emirates Dirham",symbol_native:"\u062f.\u0625.\u200f",decimal_digits:2,rounding:0,code:"AED",name_plural:"UAE dirhams"},AFN:{symbol:"Af",name:"Afghan Afghani",symbol_native:"\u060b",decimal_digits:0,rounding:0,code:"AFN",name_plural:"Afghan Afghanis"},ALL:{symbol:"ALL",name:"Albanian Lek",symbol_native:"Lek",decimal_digits:0,rounding:0,code:"ALL",name_plural:"Albanian lek\xeb"},AMD:{symbol:"AMD",name:"Armenian Dram",symbol_native:"\u0564\u0580.",decimal_digits:0,rounding:0,code:"AMD",name_plural:"Armenian drams"},ARS:{symbol:"AR$",name:"Argentine Peso",symbol_native:"$",decimal_digits:2,rounding:0,code:"ARS",name_plural:"Argentine pesos"},AUD:{symbol:"AU$",name:"Australian Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"AUD",name_plural:"Australian dollars"},AZN:{symbol:"man.",name:"Azerbaijani Manat",symbol_native:"\u043c\u0430\u043d.",decimal_digits:2,rounding:0,code:"AZN",name_plural:"Azerbaijani manats"},BAM:{symbol:"KM",name:"Bosnia-Herzegovina Convertible Mark",symbol_native:"KM",decimal_digits:2,rounding:0,code:"BAM",name_plural:"Bosnia-Herzegovina convertible marks"},BDT:{symbol:"Tk",name:"Bangladeshi Taka",symbol_native:"\u09f3",decimal_digits:2,rounding:0,code:"BDT",name_plural:"Bangladeshi takas"},BGN:{symbol:"BGN",name:"Bulgarian Lev",symbol_native:"\u043b\u0432.",decimal_digits:2,rounding:0,code:"BGN",name_plural:"Bulgarian leva"},BHD:{symbol:"BD",name:"Bahraini Dinar",symbol_native:"\u062f.\u0628.\u200f",decimal_digits:3,rounding:0,code:"BHD",name_plural:"Bahraini dinars"},BIF:{symbol:"FBu",name:"Burundian Franc",symbol_native:"FBu",decimal_digits:0,rounding:0,code:"BIF",name_plural:"Burundian francs"},BND:{symbol:"BN$",name:"Brunei Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"BND",name_plural:"Brunei dollars"},BOB:{symbol:"Bs",name:"Bolivian Boliviano",symbol_native:"Bs",decimal_digits:2,rounding:0,code:"BOB",name_plural:"Bolivian bolivianos"},BRL:{symbol:"R$",name:"Brazilian Real",symbol_native:"R$",decimal_digits:2,rounding:0,code:"BRL",name_plural:"Brazilian reals"},BWP:{symbol:"BWP",name:"Botswanan Pula",symbol_native:"P",decimal_digits:2,rounding:0,code:"BWP",name_plural:"Botswanan pulas"},BYR:{symbol:"BYR",name:"Belarusian Ruble",symbol_native:"BYR",decimal_digits:0,rounding:0,code:"BYR",name_plural:"Belarusian rubles"},BZD:{symbol:"BZ$",name:"Belize Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"BZD",name_plural:"Belize dollars"},CDF:{symbol:"CDF",name:"Congolese Franc",symbol_native:"FrCD",decimal_digits:2,rounding:0,code:"CDF",name_plural:"Congolese francs"},CHF:{symbol:"CHF",name:"Swiss Franc",symbol_native:"CHF",decimal_digits:2,rounding:.05,code:"CHF",name_plural:"Swiss francs"},CLP:{symbol:"CL$",name:"Chilean Peso",symbol_native:"$",decimal_digits:0,rounding:0,code:"CLP",name_plural:"Chilean pesos"},CNY:{symbol:"CN\xa5",name:"Chinese Yuan",symbol_native:"CN\xa5",decimal_digits:2,rounding:0,code:"CNY",name_plural:"Chinese yuan"},COP:{symbol:"CO$",name:"Colombian Peso",symbol_native:"$",decimal_digits:0,rounding:0,code:"COP",name_plural:"Colombian pesos"},CRC:{symbol:"\u20a1",name:"Costa Rican Col\xf3n",symbol_native:"\u20a1",decimal_digits:0,rounding:0,code:"CRC",name_plural:"Costa Rican col\xf3ns"},CVE:{symbol:"CV$",name:"Cape Verdean Escudo",symbol_native:"CV$",decimal_digits:2,rounding:0,code:"CVE",name_plural:"Cape Verdean escudos"},CZK:{symbol:"K\u010d",name:"Czech Republic Koruna",symbol_native:"K\u010d",decimal_digits:2,rounding:0,code:"CZK",name_plural:"Czech Republic korunas"},DJF:{symbol:"Fdj",name:"Djiboutian Franc",symbol_native:"Fdj",decimal_digits:0,rounding:0,code:"DJF",name_plural:"Djiboutian francs"},DKK:{symbol:"Dkr",name:"Danish Krone",symbol_native:"kr",decimal_digits:2,rounding:0,code:"DKK",name_plural:"Danish kroner"},DOP:{symbol:"RD$",name:"Dominican Peso",symbol_native:"RD$",decimal_digits:2,rounding:0,code:"DOP",name_plural:"Dominican pesos"},DZD:{symbol:"DA",name:"Algerian Dinar",symbol_native:"\u062f.\u062c.\u200f",decimal_digits:2,rounding:0,code:"DZD",name_plural:"Algerian dinars"},EEK:{symbol:"Ekr",name:"Estonian Kroon",symbol_native:"kr",decimal_digits:2,rounding:0,code:"EEK",name_plural:"Estonian kroons"},EGP:{symbol:"EGP",name:"Egyptian Pound",symbol_native:"\u062c.\u0645.\u200f",decimal_digits:2,rounding:0,code:"EGP",name_plural:"Egyptian pounds"},ERN:{symbol:"Nfk",name:"Eritrean Nakfa",symbol_native:"Nfk",decimal_digits:2,rounding:0,code:"ERN",name_plural:"Eritrean nakfas"},ETB:{symbol:"Br",name:"Ethiopian Birr",symbol_native:"Br",decimal_digits:2,rounding:0,code:"ETB",name_plural:"Ethiopian birrs"},GBP:{symbol:"\xa3",name:"British Pound Sterling",symbol_native:"\xa3",decimal_digits:2,rounding:0,code:"GBP",name_plural:"British pounds sterling"},GEL:{symbol:"GEL",name:"Georgian Lari",symbol_native:"GEL",decimal_digits:2,rounding:0,code:"GEL",name_plural:"Georgian laris"},GHS:{symbol:"GH\u20b5",name:"Ghanaian Cedi",symbol_native:"GH\u20b5",decimal_digits:2,rounding:0,code:"GHS",name_plural:"Ghanaian cedis"},GNF:{symbol:"FG",name:"Guinean Franc",symbol_native:"FG",decimal_digits:0,rounding:0,code:"GNF",name_plural:"Guinean francs"},GTQ:{symbol:"GTQ",name:"Guatemalan Quetzal",symbol_native:"Q",decimal_digits:2,rounding:0,code:"GTQ",name_plural:"Guatemalan quetzals"},HKD:{symbol:"HK$",name:"Hong Kong Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"HKD",name_plural:"Hong Kong dollars"},HNL:{symbol:"HNL",name:"Honduran Lempira",symbol_native:"L",decimal_digits:2,rounding:0,code:"HNL",name_plural:"Honduran lempiras"},HRK:{symbol:"kn",name:"Croatian Kuna",symbol_native:"kn",decimal_digits:2,rounding:0,code:"HRK",name_plural:"Croatian kunas"},HUF:{symbol:"Ft",name:"Hungarian Forint",symbol_native:"Ft",decimal_digits:0,rounding:0,code:"HUF",name_plural:"Hungarian forints"},IDR:{symbol:"Rp",name:"Indonesian Rupiah",symbol_native:"Rp",decimal_digits:0,rounding:0,code:"IDR",name_plural:"Indonesian rupiahs"},ILS:{symbol:"\u20aa",name:"Israeli New Sheqel",symbol_native:"\u20aa",decimal_digits:2,rounding:0,code:"ILS",name_plural:"Israeli new sheqels"},INR:{symbol:"\u20b9",name:"Indian Rupee",symbol_native:"\u099f\u0995\u09be",decimal_digits:2,rounding:0,code:"INR",name_plural:"Indian rupees"},IQD:{symbol:"IQD",name:"Iraqi Dinar",symbol_native:"\u062f.\u0639.\u200f",decimal_digits:0,rounding:0,code:"IQD",name_plural:"Iraqi dinars"},IRR:{symbol:"IRR",name:"Iranian Rial",symbol_native:"\ufdfc",decimal_digits:0,rounding:0,code:"IRR",name_plural:"Iranian rials"},ISK:{symbol:"Ikr",name:"Icelandic Kr\xf3na",symbol_native:"kr",decimal_digits:0,rounding:0,code:"ISK",name_plural:"Icelandic kr\xf3nur"},JMD:{symbol:"J$",name:"Jamaican Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"JMD",name_plural:"Jamaican dollars"},JOD:{symbol:"JD",name:"Jordanian Dinar",symbol_native:"\u062f.\u0623.\u200f",decimal_digits:3,rounding:0,code:"JOD",name_plural:"Jordanian dinars"},JPY:{symbol:"\xa5",name:"Japanese Yen",symbol_native:"\uffe5",decimal_digits:0,rounding:0,code:"JPY",name_plural:"Japanese yen"},KES:{symbol:"Ksh",name:"Kenyan Shilling",symbol_native:"Ksh",decimal_digits:2,rounding:0,code:"KES",name_plural:"Kenyan shillings"},KHR:{symbol:"KHR",name:"Cambodian Riel",symbol_native:"\u17db",decimal_digits:2,rounding:0,code:"KHR",name_plural:"Cambodian riels"},KMF:{symbol:"CF",name:"Comorian Franc",symbol_native:"FC",decimal_digits:0,rounding:0,code:"KMF",name_plural:"Comorian francs"},KRW:{symbol:"\u20a9",name:"South Korean Won",symbol_native:"\u20a9",decimal_digits:0,rounding:0,code:"KRW",name_plural:"South Korean won"},KWD:{symbol:"KD",name:"Kuwaiti Dinar",symbol_native:"\u062f.\u0643.\u200f",decimal_digits:3,rounding:0,code:"KWD",name_plural:"Kuwaiti dinars"},KZT:{symbol:"KZT",name:"Kazakhstani Tenge",symbol_native:"\u0442\u04a3\u0433.",decimal_digits:2,rounding:0,code:"KZT",name_plural:"Kazakhstani tenges"},LBP:{symbol:"LB\xa3",name:"Lebanese Pound",symbol_native:"\u0644.\u0644.\u200f",decimal_digits:0,rounding:0,code:"LBP",name_plural:"Lebanese pounds"},LKR:{symbol:"SLRs",name:"Sri Lankan Rupee",symbol_native:"SL Re",decimal_digits:2,rounding:0,code:"LKR",name_plural:"Sri Lankan rupees"},LTL:{symbol:"Lt",name:"Lithuanian Litas",symbol_native:"Lt",decimal_digits:2,rounding:0,code:"LTL",name_plural:"Lithuanian litai"},LVL:{symbol:"Ls",name:"Latvian Lats",symbol_native:"Ls",decimal_digits:2,rounding:0,code:"LVL",name_plural:"Latvian lati"},LYD:{symbol:"LD",name:"Libyan Dinar",symbol_native:"\u062f.\u0644.\u200f",decimal_digits:3,rounding:0,code:"LYD",name_plural:"Libyan dinars"},MAD:{symbol:"MAD",name:"Moroccan Dirham",symbol_native:"\u062f.\u0645.\u200f",decimal_digits:2,rounding:0,code:"MAD",name_plural:"Moroccan dirhams"},MDL:{symbol:"MDL",name:"Moldovan Leu",symbol_native:"MDL",decimal_digits:2,rounding:0,code:"MDL",name_plural:"Moldovan lei"},MGA:{symbol:"MGA",name:"Malagasy Ariary",symbol_native:"MGA",decimal_digits:0,rounding:0,code:"MGA",name_plural:"Malagasy Ariaries"},MKD:{symbol:"MKD",name:"Macedonian Denar",symbol_native:"MKD",decimal_digits:2,rounding:0,code:"MKD",name_plural:"Macedonian denari"},MMK:{symbol:"MMK",name:"Myanma Kyat",symbol_native:"K",decimal_digits:0,rounding:0,code:"MMK",name_plural:"Myanma kyats"},MOP:{symbol:"MOP$",name:"Macanese Pataca",symbol_native:"MOP$",decimal_digits:2,rounding:0,code:"MOP",name_plural:"Macanese patacas"},MUR:{symbol:"MURs",name:"Mauritian Rupee",symbol_native:"MURs",decimal_digits:0,rounding:0,code:"MUR",name_plural:"Mauritian rupees"},MXN:{symbol:"MX$",name:"Mexican Peso",symbol_native:"$",decimal_digits:2,rounding:0,code:"MXN",name_plural:"Mexican pesos"},MYR:{symbol:"RM",name:"Malaysian Ringgit",symbol_native:"RM",decimal_digits:2,rounding:0,code:"MYR",name_plural:"Malaysian ringgits"},MZN:{symbol:"MTn",name:"Mozambican Metical",symbol_native:"MTn",decimal_digits:2,rounding:0,code:"MZN",name_plural:"Mozambican meticals"},NAD:{symbol:"N$",name:"Namibian Dollar",symbol_native:"N$",decimal_digits:2,rounding:0,code:"NAD",name_plural:"Namibian dollars"},NGN:{symbol:"\u20a6",name:"Nigerian Naira",symbol_native:"\u20a6",decimal_digits:2,rounding:0,code:"NGN",name_plural:"Nigerian nairas"},NIO:{symbol:"C$",name:"Nicaraguan C\xf3rdoba",symbol_native:"C$",decimal_digits:2,rounding:0,code:"NIO",name_plural:"Nicaraguan c\xf3rdobas"},NOK:{symbol:"Nkr",name:"Norwegian Krone",symbol_native:"kr",decimal_digits:2,rounding:0,code:"NOK",name_plural:"Norwegian kroner"},NPR:{symbol:"NPRs",name:"Nepalese Rupee",symbol_native:"\u0928\u0947\u0930\u0942",decimal_digits:2,rounding:0,code:"NPR",name_plural:"Nepalese rupees"},NZD:{symbol:"NZ$",name:"New Zealand Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"NZD",name_plural:"New Zealand dollars"},OMR:{symbol:"OMR",name:"Omani Rial",symbol_native:"\u0631.\u0639.\u200f",decimal_digits:3,rounding:0,code:"OMR",name_plural:"Omani rials"},PAB:{symbol:"B/.",name:"Panamanian Balboa",symbol_native:"B/.",decimal_digits:2,rounding:0,code:"PAB",name_plural:"Panamanian balboas"},PEN:{symbol:"S/.",name:"Peruvian Nuevo Sol",symbol_native:"S/.",decimal_digits:2,rounding:0,code:"PEN",name_plural:"Peruvian nuevos soles"},PHP:{symbol:"\u20b1",name:"Philippine Peso",symbol_native:"\u20b1",decimal_digits:2,rounding:0,code:"PHP",name_plural:"Philippine pesos"},PKR:{symbol:"PKRs",name:"Pakistani Rupee",symbol_native:"\u20a8",decimal_digits:0,rounding:0,code:"PKR",name_plural:"Pakistani rupees"},PLN:{symbol:"z\u0142",name:"Polish Zloty",symbol_native:"z\u0142",decimal_digits:2,rounding:0,code:"PLN",name_plural:"Polish zlotys"},PYG:{symbol:"\u20b2",name:"Paraguayan Guarani",symbol_native:"\u20b2",decimal_digits:0,rounding:0,code:"PYG",name_plural:"Paraguayan guaranis"},QAR:{symbol:"QR",name:"Qatari Rial",symbol_native:"\u0631.\u0642.\u200f",decimal_digits:2,rounding:0,code:"QAR",name_plural:"Qatari rials"},RON:{symbol:"RON",name:"Romanian Leu",symbol_native:"RON",decimal_digits:2,rounding:0,code:"RON",name_plural:"Romanian lei"},RSD:{symbol:"din.",name:"Serbian Dinar",symbol_native:"\u0434\u0438\u043d.",decimal_digits:0,rounding:0,code:"RSD",name_plural:"Serbian dinars"},RUB:{symbol:"RUB",name:"Russian Ruble",symbol_native:"\u0440\u0443\u0431.",decimal_digits:2,rounding:0,code:"RUB",name_plural:"Russian rubles"},RWF:{symbol:"RWF",name:"Rwandan Franc",symbol_native:"FR",decimal_digits:0,rounding:0,code:"RWF",name_plural:"Rwandan francs"},SAR:{symbol:"SR",name:"Saudi Riyal",symbol_native:"\u0631.\u0633.\u200f",decimal_digits:2,rounding:0,code:"SAR",name_plural:"Saudi riyals"},SDG:{symbol:"SDG",name:"Sudanese Pound",symbol_native:"SDG",decimal_digits:2,rounding:0,code:"SDG",name_plural:"Sudanese pounds"},SEK:{symbol:"Skr",name:"Swedish Krona",symbol_native:"kr",decimal_digits:2,rounding:0,code:"SEK",name_plural:"Swedish kronor"},SGD:{symbol:"S$",name:"Singapore Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"SGD",name_plural:"Singapore dollars"},SOS:{symbol:"Ssh",name:"Somali Shilling",symbol_native:"Ssh",decimal_digits:0,rounding:0,code:"SOS",name_plural:"Somali shillings"},SYP:{symbol:"SY\xa3",name:"Syrian Pound",symbol_native:"\u0644.\u0633.\u200f",decimal_digits:0,rounding:0,code:"SYP",name_plural:"Syrian pounds"},THB:{symbol:"\u0e3f",name:"Thai Baht",symbol_native:"\u0e3f",decimal_digits:2,rounding:0,code:"THB",name_plural:"Thai baht"},TND:{symbol:"DT",name:"Tunisian Dinar",symbol_native:"\u062f.\u062a.\u200f",decimal_digits:3,rounding:0,code:"TND",name_plural:"Tunisian dinars"},TOP:{symbol:"T$",name:"Tongan Pa\u02bbanga",symbol_native:"T$",decimal_digits:2,rounding:0,code:"TOP",name_plural:"Tongan pa\u02bbanga"},TRY:{symbol:"TL",name:"Turkish Lira",symbol_native:"TL",decimal_digits:2,rounding:0,code:"TRY",name_plural:"Turkish Lira"},TTD:{symbol:"TT$",name:"Trinidad and Tobago Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"TTD",name_plural:"Trinidad and Tobago dollars"},TWD:{symbol:"NT$",name:"New Taiwan Dollar",symbol_native:"NT$",decimal_digits:2,rounding:0,code:"TWD",name_plural:"New Taiwan dollars"},TZS:{symbol:"TSh",name:"Tanzanian Shilling",symbol_native:"TSh",decimal_digits:0,rounding:0,code:"TZS",name_plural:"Tanzanian shillings"},UAH:{symbol:"\u20b4",name:"Ukrainian Hryvnia",symbol_native:"\u20b4",decimal_digits:2,rounding:0,code:"UAH",name_plural:"Ukrainian hryvnias"},UGX:{symbol:"USh",name:"Ugandan Shilling",symbol_native:"USh",decimal_digits:0,rounding:0,code:"UGX",name_plural:"Ugandan shillings"},UYU:{symbol:"$U",name:"Uruguayan Peso",symbol_native:"$",decimal_digits:2,rounding:0,code:"UYU",name_plural:"Uruguayan pesos"},UZS:{symbol:"UZS",name:"Uzbekistan Som",symbol_native:"UZS",decimal_digits:0,rounding:0,code:"UZS",name_plural:"Uzbekistan som"},VEF:{symbol:"Bs.F.",name:"Venezuelan Bol\xedvar",symbol_native:"Bs.F.",decimal_digits:2,rounding:0,code:"VEF",name_plural:"Venezuelan bol\xedvars"},VND:{symbol:"\u20ab",name:"Vietnamese Dong",symbol_native:"\u20ab",decimal_digits:0,rounding:0,code:"VND",name_plural:"Vietnamese dong"},XAF:{symbol:"FCFA",name:"CFA Franc BEAC",symbol_native:"FCFA",decimal_digits:0,rounding:0,code:"XAF",name_plural:"CFA francs BEAC"},XOF:{symbol:"CFA",name:"CFA Franc BCEAO",symbol_native:"CFA",decimal_digits:0,rounding:0,code:"XOF",name_plural:"CFA francs BCEAO"},YER:{symbol:"YR",name:"Yemeni Rial",symbol_native:"\u0631.\u064a.\u200f",decimal_digits:0,rounding:0,code:"YER",name_plural:"Yemeni rials"},ZAR:{symbol:"R",name:"South African Rand",symbol_native:"R",decimal_digits:2,rounding:0,code:"ZAR",name_plural:"South African rand"},ZMK:{symbol:"ZK",name:"Zambian Kwacha",symbol_native:"ZK",decimal_digits:0,rounding:0,code:"ZMK",name_plural:"Zambian kwachas"}},e.ConstantService=ui,e.CoreModule=wi,e.CustomPipeManager=vi,e.DataSource=Ne,e.DynamicComponentRefProvider=$e,e.EventNotifier=si,e.FIRST_TIME_WATCH=de,e.FieldTypeService=hi,e.FieldWidgetService=mi,e.IDGenerator=F,e.IDataSource=De,e.LRUCache=Pi,e.PaginationService=bi,e.PartialRefProvider=Ue,e.ScriptLoaderService=gi,e.ScriptStore=fi,e.StatePersistence=yi,e.UserDefinedExecutionContext=Be,e.UtilsService=di,e.VALIDATOR=ti,e.Viewport=pi,e._WM_APP_PROJECT=fn,e.addClass=S,e.addEventListenerOnElement=Dt,e.addForIdAttributes=Wn,e.adjustContainerPosition=qn,e.adjustContainerRightEdges=zn,e.appendNode=function(e,t,n){var i=function(){return t.appendChild(e)};n?i():P(i)},e.appendScriptToHead=ii,e.checkIsCustomPipeExpression=g,e.closePopover=Kn,e.convertToBlob=On,e.createCSSRule=Dn,e.createElement=function(e,t,n){var i=document.createElement(e);return t&&Object.keys(t).forEach((function(e){T(i,e,t[e],n)})),i},e.deHyphenate=vt,e.debounce=ve,e.defer=Mn,e.detectChanges=Qn,e.encodeUrl=pt,e.encodeUrlParams=ut,e.executePromiseChain=Ln,e.extendProto=Gn,e.extractCurrentItemExpr=Zn,e.extractType=$t,e.fetchContent=Cn,e.findRootContainer=ei,e.findValueOf=Vt,e.generateGUId=Ft,e.getAbortableDefer=In,e.getAndroidVersion=lt,e.getAppSetting=oi,e.getBlob=en,e.getClonedObject=Nt,e.getDatasourceFromExpr=Jn,e.getDateObj=It,e.getDisplayDateTimeFormat=Un,e.getEvaluatedExprValue=Pt,e.getFiles=xt,e.getFnByExpr=ae,e.getFnForBindExpr=le,e.getFnForEventExpr=ce,e.getFormWidgetTemplate=function(t,n,i,o){var r;void 0===o&&(o={});var a=i.get("updateon"),s=a?'updateon="'+a+'"':"";switch(t){case e.FormWidgetType.AUTOCOMPLETE:case e.FormWidgetType.TYPEAHEAD:r='<div wmSearch type="autocomplete" debouncetime="'+i.get("debouncetime")+'" '+n+"></div>";break;case e.FormWidgetType.CHECKBOX:r="<div wmCheckbox "+n+" "+("true"===i.get("required")?"required=true":"")+"></div>";break;case e.FormWidgetType.CHECKBOXSET:r='<ul role="group" wmCheckboxset '+n+" "+("true"===i.get("required")?"required=true":"")+"></ul>";break;case e.FormWidgetType.CHIPS:r='<ul wmChips role="input" debouncetime="'+i.get("debouncetime")+'" '+n+"></ul>";break;case e.FormWidgetType.COLORPICKER:r="<div wmColorPicker "+("true"===i.get("required")?"required=true":"")+" "+n+"></div>";break;case e.FormWidgetType.CURRENCY:r="<div wmCurrency "+("true"===i.get("required")?"required=true":"")+" "+s+" "+n+"></div>";break;case e.FormWidgetType.DATE:r="<div wmDate "+("true"===i.get("required")?"required=true":"")+' dataentrymode="'+i.get("dataentrymode")+'" '+n+"></div>";break;case e.FormWidgetType.DATETIME:r="<div wmDateTime "+("true"===i.get("required")?"required=true":"")+' dataentrymode="'+i.get("dataentrymode")+'" '+n+"></div>";break;case e.FormWidgetType.NUMBER:r="<div wmNumber "+n+" "+("true"===i.get("required")?"required=true":"")+' type="number" aria-label="Only numbers" '+s+"></div>";break;case e.FormWidgetType.PASSWORD:r="<wm-input "+n+" "+("true"===i.get("required")?"required=true":"")+' type="password" aria-label="Enter password" '+s+"></wm-input>";break;case e.FormWidgetType.RADIOSET:r='<ul role="radiogroup" wmRadioset '+n+"></ul>";break;case e.FormWidgetType.RATING:r="<div wmRating "+n+"></div>";break;case e.FormWidgetType.RICHTEXT:r='<div wmRichTextEditor role="textbox" '+n+"></div>";break;case e.FormWidgetType.SELECT:r="<wm-select "+("true"===i.get("required")?"required=true":"")+" "+n+"></wm-select>";break;case e.FormWidgetType.TOGGLE:r="<div wmCheckbox "+n+" "+("true"===i.get("required")?"required=true":"")+' type="toggle" role="checkbox" aria-label="Toggle button"></div>';break;case e.FormWidgetType.SLIDER:r="<div wmSlider "+n+"></div>";break;case e.FormWidgetType.SWITCH:r="<div wmSwitch "+n+"></div>";break;case e.FormWidgetType.TEXT:var l=o.inputType||"inputtype";r="<wm-input "+n+" "+("true"===i.get("required")?"required=true":"")+' type="'+(i.get(l)||"text")+'" '+s+"></wm-input>";break;case e.FormWidgetType.TEXTAREA:r="<wm-textarea "+n+" "+("true"===i.get("required")?"required=true":"")+' role="textbox" '+s+"></wm-textarea>";break;case e.FormWidgetType.TIME:r="<div wmTime "+("true"===i.get("required")?"required=true":"")+' dataentrymode="'+i.get("dataentrymode")+'" '+n+"></div>";break;case e.FormWidgetType.TIMESTAMP:r="<div wmDateTime "+("true"===i.get("required")?"required=true":"")+' dataentrymode="'+i.get("dataentrymode")+'" '+n+' role="input"></div>';break;case e.FormWidgetType.UPLOAD:var c=o.counter,p=o.pCounter,u=o.uploadProps,h=d(i,c,u&&u.name);r=u?'<form name="'+u.formName+'" '+n+'>\n <input focus-target class="file-upload" type="file" name="'+u.name+'" '+h+"/>\n </form>":'<a class="form-control-static" href="{{'+c+'.href}}" target="_blank" *ngIf="'+c+".filetype === 'image' && "+c+'.href">\n <img style="height:2em" class="wi wi-file" [src]="'+c+'.href"/></a>\n <a class="form-control-static" target="_blank" href="{{'+c+'.href}}" *ngIf="'+c+".filetype !== 'image' && "+c+'.href">\n <i class="wi wi-file"></i></a>\n <input '+n+' class="app-blob-upload" [ngClass]="{\'file-readonly\': '+c+'.readonly}" '+h+'\n [required]="'+c+'.required" type="file" name="'+(i.get("key")||i.get("name"))+'_formWidget" [readonly]="'+c+'.readonly"\n [class.hidden]="!'+p+'.isUpdateMode" [accept]="'+c+'.permitted">';break;default:r="<wm-input "+n+" "+("true"===i.get("required")?"required=true":"")+' type="text" '+s+"></wm-input>"}return r},e.getFormattedDate=At,e.getMomentLocaleObject=dn,e.getNativeDateObject=Zt,e.getNgModelAttr=function(e){return e.has("formControlName")||e.has("formControlName.bind")?"":"ngModel"},e.getRequiredFormWidget=function(t){switch(t){case e.FormWidgetType.AUTOCOMPLETE:case e.FormWidgetType.TYPEAHEAD:return"wm-search";case e.FormWidgetType.CHIPS:return"wm-chips";case e.FormWidgetType.COLORPICKER:return"wm-colorpicker";case e.FormWidgetType.CURRENCY:return"wm-currency";case e.FormWidgetType.DATE:return"wm-date";case e.FormWidgetType.DATETIME:return"wm-datetime";case e.FormWidgetType.TIME:case e.FormWidgetType.TIMESTAMP:return"wm-time";case e.FormWidgetType.RATING:return"wm-rating";case e.FormWidgetType.RICHTEXT:return"wm-richtexteditor";case e.FormWidgetType.SLIDER:return"wm-slider";default:return"wm-text"}},e.getResourceURL=Tt,e.getRouteNameFromLink=xn,e.getRowActionAttrs=function(e){var t="";return e.forEach((function(e,n){var i=y.get(n);i&&(t+=i+'="'+e+'" ')})),t},e.getSessionStorageItem=vn,e.getUrlParams=Nn,e.getValidDateObject=Jt,e.getValidJSON=Bt,e.getWebkitTraslationMatrix=Yn,e.getWmProjectProperties=x,e.hasCordova=Sn,e.hasOffsetStr=Rt,e.initCaps=dt,e.insertAfter=function(e,t,n){var i=function(){return t.parentNode.insertBefore(e,t.nextSibling)};n?i():P(i)},e.insertBefore=function(e,t,n){var i=function(){return t.parentNode.insertBefore(e,t)};n?i():P(i)},e.isAndroid=Je,e.isAndroidTablet=Ze,e.isAppleProduct=kn,e.isArray=bn,e.isAudioFile=Ot,e.isBoolean=_n,e.isChangeFromWatch=function(){return _e},e.isDataSourceEqual=Fn,e.isDateTimeType=Kt,e.isDefined=Ye,e.isElementInViewport=zt,e.isEmptyObject=Wt,e.isEqualWithFields=tn,e.isFirstTimeChange=function(e){return e===de},e.isIE=Xe,e.isImageFile=_t,e.isInsecureContentRequest=bt,e.isIos=it,e.isIpad=nt,e.isIphone=et,e.isIpod=tt,e.isKitkatDevice=ct,e.isLargeTabletLandscape=ot,e.isLargeTabletPortrait=rt,e.isMobile=at,e.isMobileApp=st,e.isNumber=Pn,e.isNumberType=Ut,e.isObject=Ke,e.isPageable=Ht,e.isString=wn,e.isValidWebURL=Et,e.isVideoFile=St,e.loadScript=hn,e.loadScripts=mn,e.loadStyleSheet=ln,e.loadStyleSheets=cn,e.muteWatchers=function(){ge=!0},e.noop=yn,e.openLink=Tn,e.periodSeparate=ft,e.prettifyLabel=gt,e.prettifyLabels=yt,e.processFilterExpBindNode=Bn,e.registerFnByExpr=function(e,t,n){t.usedPipes=n||[],re.set(e,t)},e.removeAttr=function(e,t,n){var i=function(){return e.removeAttribute(t)};n?i():P(i)},e.removeClass=O,e.removeExtraSlashes=Vn,e.removeNode=function(e,t){var n=function(){return e.remove()};t?n():P(n)},e.replace=Yt,e.replaceAt=mt,e.resetChangeFromWatch=Ee,e.retryIfFails=Rn,e.scrollToElement=qt,e.setAppRef=function(e){he=e},e.setAttr=T,e.setCSS=E,e.setCSSFromObj=function(e,t,n){Object.keys(t||{}).forEach((function(i){return E(e,i,t[i],n)}))},e.setHtml=function(e,t,n){var i=function(){return e.innerHTML=t};n?i():P(i)},e.setListClass=ri,e.setNgZone=function(e){return me=e},e.setPipeProvider=function(e){M=e},e.setProperty=function(e,t,n,i){var o=function(){return e[t]=n};i?o():P(o)},e.setSessionStorageItem=gn,e.setTranslation3dPosition=Hn,e.setWmProjectProperties=function(e){Object.setPrototypeOf(N,e)},e.spaceSeparate=ht,e.stringStartsWith=wt,e.switchClass=function(e,t,n,i){void 0===t&&(t=""),void 0===n&&(n=""),O(e,n,i),S(e,t,i)},e.toBoolean=Qe,e.toDimension=function(e){return e==+e?e+"px":e},e.toPromise=An,e.toggleClass=function(e,t,n,i){n?S(e,t,i):O(e,t,i)},e.transformFileURI=ni,e.triggerFn=Ct,e.triggerItemAction=Xn,e.unMuteWatchers=function(){ge=!1,Se()},e.updateTemplateAttrs=v,e.validateAccessRoles=jt,e.validateDataSourceCtx=jn,e.xmlToJson=Gt,e["\u02750"]=h,e["\u02751"]=f,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define("@wm/swipey",["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).swipey={})}(this,(function(e){"use strict";var t=function(){function e(){this._isGesturesEnabled=!0}return e.prototype.bindEvents=function(){return window.PointerEvent?["pointer"]:["touch"]},e.prototype.bounds=function(e,t){return{}},e.prototype.context=function(){return{}},e.prototype.direction=function(){return $.fn.swipey.DIRECTIONS.HORIZONTAL},e.prototype.setGesturesEnabled=function(e){this._isGesturesEnabled=e},e.prototype.isGesturesEnabled=function(){return this._isGesturesEnabled},e.prototype.goToLower=function(e){this._$ele.swipeAnimation("gotoLower",e)},e.prototype.goToUpper=function(e){this._$ele.swipeAnimation("gotoUpper",e)},e.prototype.onAnimation=function(e,t){},e.prototype.onUpper=function(e){},e.prototype.onLower=function(e){},e.prototype.threshold=function(){return 30},e.prototype.init=function(e,t){this._$ele=e,e.swipeAnimation({animation:this.animation(),target:t,bounds:this.bounds.bind(this),bindEvents:this.bindEvents(),context:this.context.bind(this),direction:this.direction(),enableGestures:this.isGesturesEnabled.bind(this),onAnimation:this.onAnimation.bind(this),onLower:this.onLower.bind(this),onUpper:this.onUpper.bind(this),threshold:this.threshold(),disableMouse:!0})},e}();e.SwipeAnimation=t,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/compiler"),require("@wm/core")):"function"==typeof define&&define.amd?define("@wm/transpiler",["exports","@angular/compiler","@wm/core"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.transpiler={}),e.ng.compiler,e.wm.core)}(this,(function(e,t,n){"use strict";
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -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:!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.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:!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";
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),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=i.registerDestroyListener(n.$watch(s.replace("bind:",""),i,{},o.invokeOnParamChange.bind(o,e),void 0,void 0,e,(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