@wavemaker/app-runtime-wm-build 11.5.4-rc.5523 → 11.5.4-rc.5622
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- app-runtime-wm-build/package.json +1 -1
- app-runtime-wm-build/wmapp/scripts/wm-libs.js +2 -2
- app-runtime-wm-build/wmapp/scripts/wm-libs.min.js +2 -2
- app-runtime-wm-build/wmapp/scripts/wm-loader.js +1 -1
- app-runtime-wm-build/wmapp/scripts/wm-loader.min.js +1 -1
- app-runtime-wm-build/wmmobile/scripts/wm-libs.js +2 -2
- app-runtime-wm-build/wmmobile/scripts/wm-libs.min.js +2 -2
- app-runtime-wm-build/wmmobile/scripts/wm-mobileloader.js +1 -1
- app-runtime-wm-build/wmmobile/scripts/wm-mobileloader.min.js +2 -2
|
@@ -970,7 +970,7 @@ var FullCalendar=function(e){"use strict";var t=function(e,n){return(t=Object.se
|
|
|
970
970
|
*
|
|
971
971
|
* Copyright (c) 2016 Jorik Tangelder;
|
|
972
972
|
* Licensed under the MIT license */
|
|
973
|
-
!function(a,b,c,d){"use strict";function e(a,b,c){return setTimeout(j(a,c),b)}function f(a,b,c){return Array.isArray(a)?(g(a,c[b],c),!0):!1}function g(a,b,c){var e;if(a)if(a.forEach)a.forEach(b,c);else if(a.length!==d)for(e=0;e<a.length;)b.call(c,a[e],e,a),e++;else for(e in a)a.hasOwnProperty(e)&&b.call(c,a[e],e,a)}function h(b,c,d){var e="DEPRECATED METHOD: "+c+"\n"+d+" AT \n";return function(){var c=new Error("get-stack-trace"),d=c&&c.stack?c.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",f=a.console&&(a.console.warn||a.console.log);return f&&f.call(a.console,e,d),b.apply(this,arguments)}}function i(a,b,c){var d,e=b.prototype;d=a.prototype=Object.create(e),d.constructor=a,d._super=e,c&&la(d,c)}function j(a,b){return function(){return a.apply(b,arguments)}}function k(a,b){return typeof a==oa?a.apply(b?b[0]||d:d,b):a}function l(a,b){return a===d?b:a}function m(a,b,c){g(q(b),(function(b){a.addEventListener(b,c,!1)}))}function n(a,b,c){g(q(b),(function(b){a.removeEventListener(b,c,!1)}))}function o(a,b){for(;a;){if(a==b)return!0;a=a.parentNode}return!1}function p(a,b){return a.indexOf(b)>-1}function q(a){return a.trim().split(/\s+/g)}function r(a,b,c){if(a.indexOf&&!c)return a.indexOf(b);for(var d=0;d<a.length;){if(c&&a[d][c]==b||!c&&a[d]===b)return d;d++}return-1}function s(a){return Array.prototype.slice.call(a,0)}function t(a,b,c){for(var d=[],e=[],f=0;f<a.length;){var g=b?a[f][b]:a[f];r(e,g)<0&&d.push(a[f]),e[f]=g,f++}return c&&(d=b?d.sort((function(a,c){return a[b]>c[b]})):d.sort()),d}function u(a,b){for(var c,e,f=b[0].toUpperCase()+b.slice(1),g=0;g<ma.length;){if(c=ma[g],e=c?c+f:b,e in a)return e;g++}return d}function v(){return ua++}function w(b){var c=b.ownerDocument||b;return c.defaultView||c.parentWindow||a}function x(a,b){var c=this;this.manager=a,this.callback=b,this.element=a.element,this.target=a.options.inputTarget,this.domHandler=function(b){k(a.options.enable,[a])&&c.handler(b)},this.init()}function y(a){var b,c=a.options.inputClass;return new(b=c?c:xa?M:ya?P:wa?R:L)(a,z)}function z(a,b,c){var d=c.pointers.length,e=c.changedPointers.length,f=b&Ea&&d-e===0,g=b&(Ga|Ha)&&d-e===0;c.isFirst=!!f,c.isFinal=!!g,f&&(a.session={}),c.eventType=b,A(a,c),a.emit("hammer.input",c),a.recognize(c),a.session.prevInput=c}function A(a,b){var c=a.session,d=b.pointers,e=d.length;c.firstInput||(c.firstInput=D(b)),e>1&&!c.firstMultiple?c.firstMultiple=D(b):1===e&&(c.firstMultiple=!1);var f=c.firstInput,g=c.firstMultiple,h=g?g.center:f.center,i=b.center=E(d);b.timeStamp=ra(),b.deltaTime=b.timeStamp-f.timeStamp,b.angle=I(h,i),b.distance=H(h,i),B(c,b),b.offsetDirection=G(b.deltaX,b.deltaY);var j=F(b.deltaTime,b.deltaX,b.deltaY);b.overallVelocityX=j.x,b.overallVelocityY=j.y,b.overallVelocity=qa(j.x)>qa(j.y)?j.x:j.y,b.scale=g?K(g.pointers,d):1,b.rotation=g?J(g.pointers,d):0,b.maxPointers=c.prevInput?b.pointers.length>c.prevInput.maxPointers?b.pointers.length:c.prevInput.maxPointers:b.pointers.length,C(c,b);var k=a.element;o(b.srcEvent.target,k)&&(k=b.srcEvent.target),b.target=k}function B(a,b){var c=b.center,d=a.offsetDelta||{},e=a.prevDelta||{},f=a.prevInput||{};b.eventType!==Ea&&f.eventType!==Ga||(e=a.prevDelta={x:f.deltaX||0,y:f.deltaY||0},d=a.offsetDelta={x:c.x,y:c.y}),b.deltaX=e.x+(c.x-d.x),b.deltaY=e.y+(c.y-d.y)}function C(a,b){var c,e,f,g,h=a.lastInterval||b,i=b.timeStamp-h.timeStamp;if(b.eventType!=Ha&&(i>Da||h.velocity===d)){var j=b.deltaX-h.deltaX,k=b.deltaY-h.deltaY,l=F(i,j,k);e=l.x,f=l.y,c=qa(l.x)>qa(l.y)?l.x:l.y,g=G(j,k),a.lastInterval=b}else c=h.velocity,e=h.velocityX,f=h.velocityY,g=h.direction;b.velocity=c,b.velocityX=e,b.velocityY=f,b.direction=g}function D(a){for(var b=[],c=0;c<a.pointers.length;)b[c]={clientX:pa(a.pointers[c].clientX),clientY:pa(a.pointers[c].clientY)},c++;return{timeStamp:ra(),pointers:b,center:E(b),deltaX:a.deltaX,deltaY:a.deltaY}}function E(a){var b=a.length;if(1===b)return{x:pa(a[0].clientX),y:pa(a[0].clientY)};for(var c=0,d=0,e=0;b>e;)c+=a[e].clientX,d+=a[e].clientY,e++;return{x:pa(c/b),y:pa(d/b)}}function F(a,b,c){return{x:b/a||0,y:c/a||0}}function G(a,b){return a===b?Ia:qa(a)>=qa(b)?0>a?Ja:Ka:0>b?La:Ma}function H(a,b,c){c||(c=Qa);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return Math.sqrt(d*d+e*e)}function I(a,b,c){c||(c=Qa);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return 180*Math.atan2(e,d)/Math.PI}function J(a,b){return I(b[1],b[0],Ra)+I(a[1],a[0],Ra)}function K(a,b){return H(b[0],b[1],Ra)/H(a[0],a[1],Ra)}function L(){this.evEl=Ta,this.evWin=Ua,this.pressed=!1,x.apply(this,arguments)}function M(){this.evEl=Xa,this.evWin=Ya,x.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function N(){this.evTarget=$a,this.evWin=_a,this.started=!1,x.apply(this,arguments)}function O(a,b){var c=s(a.touches),d=s(a.changedTouches);return b&(Ga|Ha)&&(c=t(c.concat(d),"identifier",!0)),[c,d]}function P(){this.evTarget=bb,this.targetIds={},x.apply(this,arguments)}function Q(a,b){var c=s(a.touches),d=this.targetIds;if(b&(Ea|Fa)&&1===c.length)return d[c[0].identifier]=!0,[c,c];var e,f,g=s(a.changedTouches),h=[],i=this.target;if(f=c.filter((function(a){return o(a.target,i)})),b===Ea)for(e=0;e<f.length;)d[f[e].identifier]=!0,e++;for(e=0;e<g.length;)d[g[e].identifier]&&h.push(g[e]),b&(Ga|Ha)&&delete d[g[e].identifier],e++;return h.length?[t(f.concat(h),"identifier",!0),h]:void 0}function R(){x.apply(this,arguments);var a=j(this.handler,this);this.touch=new P(this.manager,a),this.mouse=new L(this.manager,a),this.primaryTouch=null,this.lastTouches=[]}function S(a,b){a&Ea?(this.primaryTouch=b.changedPointers[0].identifier,T.call(this,b)):a&(Ga|Ha)&&T.call(this,b)}function T(a){var b=a.changedPointers[0];if(b.identifier===this.primaryTouch){var c={x:b.clientX,y:b.clientY};this.lastTouches.push(c);var d=this.lastTouches,e=function(){var a=d.indexOf(c);a>-1&&d.splice(a,1)};setTimeout(e,cb)}}function U(a){for(var b=a.srcEvent.clientX,c=a.srcEvent.clientY,d=0;d<this.lastTouches.length;d++){var e=this.lastTouches[d],f=Math.abs(b-e.x),g=Math.abs(c-e.y);if(db>=f&&db>=g)return!0}return!1}function V(a,b){this.manager=a,this.set(b)}function W(a){if(p(a,jb))return jb;var b=p(a,kb),c=p(a,lb);return b&&c?jb:b||c?b?kb:lb:p(a,ib)?ib:hb}function X(){if(!fb)return!1;var b={},c=a.CSS&&a.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(d){b[d]=c?a.CSS.supports("touch-action",d):!0})),b}function Y(a){this.options=la({},this.defaults,a||{}),this.id=v(),this.manager=null,this.options.enable=l(this.options.enable,!0),this.state=nb,this.simultaneous={},this.requireFail=[]}function Z(a){return a&sb?"cancel":a&qb?"end":a&pb?"move":a&ob?"start":""}function $(a){return a==Ma?"down":a==La?"up":a==Ja?"left":a==Ka?"right":""}function _(a,b){var c=b.manager;return c?c.get(a):a}function aa(){Y.apply(this,arguments)}function ba(){aa.apply(this,arguments),this.pX=null,this.pY=null}function ca(){aa.apply(this,arguments)}function da(){Y.apply(this,arguments),this._timer=null,this._input=null}function ea(){aa.apply(this,arguments)}function fa(){aa.apply(this,arguments)}function ga(){Y.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function ha(a,b){return b=b||{},b.recognizers=l(b.recognizers,ha.defaults.preset),new ia(a,b)}function ia(a,b){this.options=la({},ha.defaults,b||{}),this.options.inputTarget=this.options.inputTarget||a,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=a,this.input=y(this),this.touchAction=new V(this,this.options.touchAction),ja(this,!0),g(this.options.recognizers,(function(a){var b=this.add(new a[0](a[1]));a[2]&&b.recognizeWith(a[2]),a[3]&&b.requireFailure(a[3])}),this)}function ja(a,b){var c=a.element;if(c.style){var d;g(a.options.cssProps,(function(e,f){d=u(c.style,f),b?(a.oldCssProps[d]=c.style[d],c.style[d]=e):c.style[d]=a.oldCssProps[d]||""})),b||(a.oldCssProps={})}}function ka(a,c){var d=b.createEvent("Event");d.initEvent(a,!0,!0),d.gesture=c,c.target.dispatchEvent(d)}var la,ma=["","webkit","Moz","MS","ms","o"],na=b.createElement("div"),oa="function",pa=Math.round,qa=Math.abs,ra=Date.now;la="function"!=typeof Object.assign?function(a){if(a===d||null===a)throw new TypeError("Cannot convert undefined or null to object");for(var b=Object(a),c=1;c<arguments.length;c++){var e=arguments[c];if(e!==d&&null!==e)for(var f in e)e.hasOwnProperty(f)&&(b[f]=e[f])}return b}:Object.assign;var sa=h((function(a,b,c){for(var e=Object.keys(b),f=0;f<e.length;)(!c||c&&a[e[f]]===d)&&(a[e[f]]=b[e[f]]),f++;return a}),"extend","Use `assign`."),ta=h((function(a,b){return sa(a,b,!0)}),"merge","Use `assign`."),ua=1,va=/mobile|tablet|ip(ad|hone|od)|android/i,wa="ontouchstart"in a,xa=u(a,"PointerEvent")!==d,ya=wa&&va.test(navigator.userAgent),za="touch",Aa="pen",Ba="mouse",Ca="kinect",Da=25,Ea=1,Fa=2,Ga=4,Ha=8,Ia=1,Ja=2,Ka=4,La=8,Ma=16,Na=Ja|Ka,Oa=La|Ma,Pa=Na|Oa,Qa=["x","y"],Ra=["clientX","clientY"];x.prototype={handler:function(){},init:function(){this.evEl&&m(this.element,this.evEl,this.domHandler),this.evTarget&&m(this.target,this.evTarget,this.domHandler),this.evWin&&m(w(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&n(this.element,this.evEl,this.domHandler),this.evTarget&&n(this.target,this.evTarget,this.domHandler),this.evWin&&n(w(this.element),this.evWin,this.domHandler)}};var Sa={mousedown:Ea,mousemove:Fa,mouseup:Ga},Ta="mousedown",Ua="mousemove mouseup";i(L,x,{handler:function(a){var b=Sa[a.type];b&Ea&&0===a.button&&(this.pressed=!0),b&Fa&&1!==a.which&&(b=Ga),this.pressed&&(b&Ga&&(this.pressed=!1),this.callback(this.manager,b,{pointers:[a],changedPointers:[a],pointerType:Ba,srcEvent:a}))}});var Va={pointerdown:Ea,pointermove:Fa,pointerup:Ga,pointercancel:Ha,pointerout:Ha},Wa={2:za,3:Aa,4:Ba,5:Ca},Xa="pointerdown",Ya="pointermove pointerup pointercancel";a.MSPointerEvent&&!a.PointerEvent&&(Xa="MSPointerDown",Ya="MSPointerMove MSPointerUp MSPointerCancel"),i(M,x,{handler:function(a){var b=this.store,c=!1,d=a.type.toLowerCase().replace("ms",""),e=Va[d],f=Wa[a.pointerType]||a.pointerType,g=f==za,h=r(b,a.pointerId,"pointerId");e&Ea&&(0===a.button||g)?0>h&&(b.push(a),h=b.length-1):e&(Ga|Ha)&&(c=!0),0>h||(b[h]=a,this.callback(this.manager,e,{pointers:b,changedPointers:[a],pointerType:f,srcEvent:a}),c&&b.splice(h,1))}});var Za={touchstart:Ea,touchmove:Fa,touchend:Ga,touchcancel:Ha},$a="touchstart",_a="touchstart touchmove touchend touchcancel";i(N,x,{handler:function(a){var b=Za[a.type];if(b===Ea&&(this.started=!0),this.started){var c=O.call(this,a,b);b&(Ga|Ha)&&c[0].length-c[1].length===0&&(this.started=!1),this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:za,srcEvent:a})}}});var ab={touchstart:Ea,touchmove:Fa,touchend:Ga,touchcancel:Ha},bb="touchstart touchmove touchend touchcancel";i(P,x,{handler:function(a){var b=ab[a.type],c=Q.call(this,a,b);c&&this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:za,srcEvent:a})}});var cb=2500,db=25;i(R,x,{handler:function(a,b,c){var d=c.pointerType==za,e=c.pointerType==Ba;if(!(e&&c.sourceCapabilities&&c.sourceCapabilities.firesTouchEvents)){if(d)S.call(this,b,c);else if(e&&U.call(this,c))return;this.callback(a,b,c)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var eb=u(na.style,"touchAction"),fb=eb!==d,gb="compute",hb="auto",ib="manipulation",jb="none",kb="pan-x",lb="pan-y",mb=X();V.prototype={set:function(a){a==gb&&(a=this.compute()),fb&&this.manager.element.style&&mb[a]&&(this.manager.element.style[eb]=a),this.actions=a.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var a=[];return g(this.manager.recognizers,(function(b){k(b.options.enable,[b])&&(a=a.concat(b.getTouchAction()))})),W(a.join(" "))},preventDefaults:function(a){var b=a.srcEvent,c=a.offsetDirection;if(this.manager.session.prevented)return void b.preventDefault();var d=this.actions,e=p(d,jb)&&!mb[jb],f=p(d,lb)&&!mb[lb],g=p(d,kb)&&!mb[kb];if(e){var h=1===a.pointers.length,i=a.distance<2,j=a.deltaTime<250;if(h&&i&&j)return}return g&&f?void 0:e||f&&c&Na||g&&c&Oa?this.preventSrc(b):void 0},preventSrc:function(a){this.manager.session.prevented=!0,a.preventDefault()}};var nb=1,ob=2,pb=4,qb=8,rb=qb,sb=16,tb=32;Y.prototype={defaults:{},set:function(a){return la(this.options,a),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(a){if(f(a,"recognizeWith",this))return this;var b=this.simultaneous;return a=_(a,this),b[a.id]||(b[a.id]=a,a.recognizeWith(this)),this},dropRecognizeWith:function(a){return f(a,"dropRecognizeWith",this)?this:(a=_(a,this),delete this.simultaneous[a.id],this)},requireFailure:function(a){if(f(a,"requireFailure",this))return this;var b=this.requireFail;return a=_(a,this),-1===r(b,a)&&(b.push(a),a.requireFailure(this)),this},dropRequireFailure:function(a){if(f(a,"dropRequireFailure",this))return this;a=_(a,this);var b=r(this.requireFail,a);return b>-1&&this.requireFail.splice(b,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(a){return!!this.simultaneous[a.id]},emit:function(a){function b(b){c.manager.emit(b,a)}var c=this,d=this.state;qb>d&&b(c.options.event+Z(d)),b(c.options.event),a.additionalEvent&&b(a.additionalEvent),d>=qb&&b(c.options.event+Z(d))},tryEmit:function(a){return this.canEmit()?this.emit(a):void(this.state=tb)},canEmit:function(){for(var a=0;a<this.requireFail.length;){if(!(this.requireFail[a].state&(tb|nb)))return!1;a++}return!0},recognize:function(a){var b=la({},a);return k(this.options.enable,[this,b])?(this.state&(rb|sb|tb)&&(this.state=nb),this.state=this.process(b),void(this.state&(ob|pb|qb|sb)&&this.tryEmit(b))):(this.reset(),void(this.state=tb))},process:function(a){},getTouchAction:function(){},reset:function(){}},i(aa,Y,{defaults:{pointers:1},attrTest:function(a){var b=this.options.pointers;return 0===b||a.pointers.length===b},process:function(a){var b=this.state,c=a.eventType,d=b&(ob|pb),e=this.attrTest(a);return d&&(c&Ha||!e)?b|sb:d||e?c&Ga?b|qb:b&ob?b|pb:ob:tb}}),i(ba,aa,{defaults:{event:"pan",threshold:10,pointers:1,direction:Pa},getTouchAction:function(){var a=this.options.direction,b=[];return a&Na&&b.push(lb),a&Oa&&b.push(kb),b},directionTest:function(a){var b=this.options,c=!0,d=a.distance,e=a.direction,f=a.deltaX,g=a.deltaY;return e&b.direction||(b.direction&Na?(e=0===f?Ia:0>f?Ja:Ka,c=f!=this.pX,d=Math.abs(a.deltaX)):(e=0===g?Ia:0>g?La:Ma,c=g!=this.pY,d=Math.abs(a.deltaY))),a.direction=e,c&&d>b.threshold&&e&b.direction},attrTest:function(a){return aa.prototype.attrTest.call(this,a)&&(this.state&ob||!(this.state&ob)&&this.directionTest(a))},emit:function(a){this.pX=a.deltaX,this.pY=a.deltaY;var b=$(a.direction);b&&(a.additionalEvent=this.options.event+b),this._super.emit.call(this,a)}}),i(ca,aa,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[jb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.scale-1)>this.options.threshold||this.state&ob)},emit:function(a){if(1!==a.scale){var b=a.scale<1?"in":"out";a.additionalEvent=this.options.event+b}this._super.emit.call(this,a)}}),i(da,Y,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[hb]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,f=a.deltaTime>b.time;if(this._input=a,!d||!c||a.eventType&(Ga|Ha)&&!f)this.reset();else if(a.eventType&Ea)this.reset(),this._timer=e((function(){this.state=rb,this.tryEmit()}),b.time,this);else if(a.eventType&Ga)return rb;return tb},reset:function(){clearTimeout(this._timer)},emit:function(a){this.state===rb&&(a&&a.eventType&Ga?this.manager.emit(this.options.event+"up",a):(this._input.timeStamp=ra(),this.manager.emit(this.options.event,this._input)))}}),i(ea,aa,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[jb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.rotation)>this.options.threshold||this.state&ob)}}),i(fa,aa,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Na|Oa,pointers:1},getTouchAction:function(){return ba.prototype.getTouchAction.call(this)},attrTest:function(a){var b,c=this.options.direction;return c&(Na|Oa)?b=a.overallVelocity:c&Na?b=a.overallVelocityX:c&Oa&&(b=a.overallVelocityY),this._super.attrTest.call(this,a)&&c&a.offsetDirection&&a.distance>this.options.threshold&&a.maxPointers==this.options.pointers&&qa(b)>this.options.velocity&&a.eventType&Ga},emit:function(a){var b=$(a.offsetDirection);b&&this.manager.emit(this.options.event+b,a),this.manager.emit(this.options.event,a)}}),i(ga,Y,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ib]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,f=a.deltaTime<b.time;if(this.reset(),a.eventType&Ea&&0===this.count)return this.failTimeout();if(d&&f&&c){if(a.eventType!=Ga)return this.failTimeout();var g=this.pTime?a.timeStamp-this.pTime<b.interval:!0,h=!this.pCenter||H(this.pCenter,a.center)<b.posThreshold;this.pTime=a.timeStamp,this.pCenter=a.center,h&&g?this.count+=1:this.count=1,this._input=a;var i=this.count%b.taps;if(0===i)return this.hasRequireFailures()?(this._timer=e((function(){this.state=rb,this.tryEmit()}),b.interval,this),ob):rb}return tb},failTimeout:function(){return this._timer=e((function(){this.state=tb}),this.options.interval,this),tb},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==rb&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),ha.VERSION="2.0.7",ha.defaults={domEvents:!1,touchAction:gb,enable:!0,inputTarget:null,inputClass:null,preset:[[ea,{enable:!1}],[ca,{enable:!1},["rotate"]],[fa,{direction:Na}],[ba,{direction:Na},["swipe"]],[ga],[ga,{event:"doubletap",taps:2},["tap"]],[da]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var ub=1,vb=2;ia.prototype={set:function(a){return la(this.options,a),a.touchAction&&this.touchAction.update(),a.inputTarget&&(this.input.destroy(),this.input.target=a.inputTarget,this.input.init()),this},stop:function(a){this.session.stopped=a?vb:ub},recognize:function(a){var b=this.session;if(!b.stopped){this.touchAction.preventDefaults(a);var c,d=this.recognizers,e=b.curRecognizer;(!e||e&&e.state&rb)&&(e=b.curRecognizer=null);for(var f=0;f<d.length;)c=d[f],b.stopped===vb||e&&c!=e&&!c.canRecognizeWith(e)?c.reset():c.recognize(a),!e&&c.state&(ob|pb|qb)&&(e=b.curRecognizer=c),f++}},get:function(a){if(a instanceof Y)return a;for(var b=this.recognizers,c=0;c<b.length;c++)if(b[c].options.event==a)return b[c];return null},add:function(a){if(f(a,"add",this))return this;var b=this.get(a.options.event);return b&&this.remove(b),this.recognizers.push(a),a.manager=this,this.touchAction.update(),a},remove:function(a){if(f(a,"remove",this))return this;if(a=this.get(a)){var b=this.recognizers,c=r(b,a);-1!==c&&(b.splice(c,1),this.touchAction.update())}return this},on:function(a,b){if(a!==d&&b!==d){var c=this.handlers;return g(q(a),(function(a){c[a]=c[a]||[],c[a].push(b)})),this}},off:function(a,b){if(a!==d){var c=this.handlers;return g(q(a),(function(a){b?c[a]&&c[a].splice(r(c[a],b),1):delete c[a]})),this}},emit:function(a,b){this.options.domEvents&&ka(a,b);var c=this.handlers[a]&&this.handlers[a].slice();if(c&&c.length){b.type=a,b.preventDefault=function(){b.srcEvent.preventDefault()};for(var d=0;d<c.length;)c[d](b),d++}},destroy:function(){this.element&&ja(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},la(ha,{INPUT_START:Ea,INPUT_MOVE:Fa,INPUT_END:Ga,INPUT_CANCEL:Ha,STATE_POSSIBLE:nb,STATE_BEGAN:ob,STATE_CHANGED:pb,STATE_ENDED:qb,STATE_RECOGNIZED:rb,STATE_CANCELLED:sb,STATE_FAILED:tb,DIRECTION_NONE:Ia,DIRECTION_LEFT:Ja,DIRECTION_RIGHT:Ka,DIRECTION_UP:La,DIRECTION_DOWN:Ma,DIRECTION_HORIZONTAL:Na,DIRECTION_VERTICAL:Oa,DIRECTION_ALL:Pa,Manager:ia,Input:x,TouchAction:V,TouchInput:P,MouseInput:L,PointerEventInput:M,TouchMouseInput:R,SingleTouchInput:N,Recognizer:Y,AttrRecognizer:aa,Tap:ga,Pan:ba,Swipe:fa,Pinch:ca,Rotate:ea,Press:da,on:m,off:n,each:g,merge:ta,extend:sa,assign:la,inherit:i,bindFn:j,prefixed:u});var wb="undefined"!=typeof a?a:"undefined"!=typeof self?self:{};wb.Hammer=ha,"function"==typeof define&&define.amd?define((function(){return ha})):"undefined"!=typeof module&&module.exports?module.exports=ha:a[c]=ha}(window,document,"Hammer");"use strict";$.widget("wm.datatable",{options:{data:[],statusMsg:"",colDefs:[],rowActions:[],headerConfig:[],sortInfo:{field:"",direction:""},isMobile:false,enableSort:true,filtermode:"",filteronkeypress:false,activeRow:undefined,height:"100%",showHeader:true,selectFirstRow:false,showNewRow:true,showRowIndex:false,enableRowSelection:true,enableColumnSelection:false,multiselect:false,filterNullRecords:true,navigation:"",isdynamictable:"",cssClassNames:{tableRow:"app-datagrid-row",headerCell:"app-datagrid-header-cell",groupHeaderCell:"app-datagrid-group-header-cell",tableCell:"app-datagrid-cell",grid:"",gridDefault:"table",gridBody:"app-datagrid-body",gridFooter:"app-datagrid-footer",deleteRow:"danger",ascIcon:"wi wi-long-arrow-up",descIcon:"wi wi-long-arrow-down",selectedColumn:"selected-column",rowExpandIcon:"wi wi-minus-square",rowCollapseIcon:"wi wi-plus-square",gridRowExpansionClass:"table-row-expansion",expandedRowClass:"expanded"},dataStates:{loading:"Loading...",ready:"",error:"An error occurred in loading the data.",nodata:"No data found."},messages:{selectField:"Select Field"},loadingicon:"",startRowIndex:1,editmode:"",actionsEnabled:{edit:true,new:true},rowExpansionEnabled:false,rowDef:{position:"0",closeothers:false,columnwidth:"30px"},summaryRow:false,summaryRowDefs:[],summaryRowDefsObject:[],searchHandler:function(){},sortHandler:function(){}},customColumnDefs:{checkbox:{field:"checkbox",type:"custom",displayName:"",sortable:false,searchable:false,resizable:false,selectable:false,readonly:true,style:"width: 50px; text-align: center;",textAlignment:"center",isMultiSelectCol:true,show:true},radio:{field:"radio",type:"custom",displayName:"",sortable:false,searchable:false,resizable:false,selectable:false,readonly:true,style:"width: 50px; text-align: center;",textAlignment:"center",show:true},__expand:{field:"__expand",type:"custom",displayName:"",sortable:false,searchable:false,resizable:false,selectable:false,readonly:true,style:"text-align: center;",textAlignment:"center",show:true,width:"30px"},rowIndex:{field:"rowIndex",type:"custom",displayName:"S. No.",sortable:false,searchable:false,selectable:false,readonly:true,style:"text-align: left;",textAlignment:"left",show:true}},CONSTANTS:{QUICK_EDIT:"quickedit",INLINE:"inline",FORM:"form",DIALOG:"dialog",SEARCH:"search",MULTI_COLUMN:"multicolumn"},Utils:{random:function(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)},isDefined:function(value){return value!==undefined},isObject:function(value){return value!==null&&typeof value==="object"},getObjectIndex:function(data,obj){var matchIndex=-1;if(!Array.isArray(data)){return-1}data.some((function(data,index){if(_.isEqual(data,obj)){matchIndex=index;return true}}));return matchIndex},generateGuid:function(){var random=this.random;return random()+random()+"-"+random()+"-"+random()+"-"+random()+"-"+random()+random()+random()},isValidHtml:function(htm){var validHtmlRegex=/<[a-z][\s\S]*>/i;return validHtmlRegex.test(htm)},isMac:function(){return navigator.platform.toUpperCase().indexOf("MAC")>=0},isDeleteKey:function(event){return this.isMac()&&event.which===8||event.which===46}},_setStyles:function($el,styleString){if(!styleString){return}var styles=styleString.split(";");styles.forEach((function(styleBit){var parts=styleBit.split(":");var property,value;if(parts.length===2){property=parts[0].trim();value=parts[1].trim();$el.css(property,value)}}));return styleString},_getColumnSortDirection:function(field){var sortInfo=this.options.sortInfo;return field===sortInfo.field?sortInfo.direction:""},_toggleSpacingClasses:function(value){switch(value){case"normal":this.tableContainer.removeClass("table-condensed");if(this.gridSearch){this.gridSearch.find(".form-group").removeClass("form-group-sm");this.gridSearch.find("select").removeClass("input-sm");this.gridSearch.find(".input-group").removeClass("input-group-sm")}break;case"condensed":this.tableContainer.addClass("table-condensed");if(this.gridSearch){this.gridSearch.find(".form-group").addClass("form-group-sm");this.gridSearch.find("select").addClass("input-sm");this.gridSearch.find(".input-group").addClass("input-group-sm")}break}},_getColSpan:function(cols){var colSpan=0,self=this;_.forEach(cols,(function(col){var colDef;if(col.isGroup){colSpan+=self._getColSpan(col.columns)}else{colDef=_.find(self.preparedHeaderData,{field:col.field});colSpan=!_.isUndefined(colDef.show)&&!colDef.show?colSpan:colSpan+1}}));return colSpan},_setColSpan:function(config){var self=this;_.forEach(config,(function(col){if(col.isGroup){col.colspan=self._getColSpan(col.columns);self.gridHeaderElement.find('th[data-col-group="'+col.field+'"]').attr("colspan",col.colspan);self._setColSpan(col.columns)}}))},_getHeaderTemplate:function(){var $colgroup=$("<colgroup></colgroup>"),$htm=this.gridHeaderElement.empty(),isDefined=this.Utils.isDefined,sortInfo=this.options.sortInfo,sortField=sortInfo.field,self=this,rowTemplates=[],headerConfig=this.options.headerConfig,headerGroupClass=self.options.cssClassNames.groupHeaderCell,$row;function generateHeaderCell(value,index){var id=index,field=value.field,headerLabel=self.Utils.isDefined(value.displayName)?value.displayName:field||"",titleLabel=headerLabel,sortEnabled=self.options.enableSort&&(_.isUndefined(value.show)||value.show)&&(_.isUndefined(value.sortable)||value.sortable),headerClasses=self.options.cssClassNames.headerCell,sortClass,tl="",$th,$col,$sortSpan,$sortIcon;headerLabel=!self.Utils.isDefined(headerLabel)||headerLabel===""?" ":headerLabel;$col=$("<col/>");if(value.style){self._setStyles($col,value.style)}$colgroup.append($col);if(isDefined(value.class)){headerClasses+=" "+value.class}if(value.selected){headerClasses+=" "+self.options.cssClassNames.selectedColumn+" "}if(field==="checkbox"||field==="radio"){headerClasses+=" grid-col-small"}tl+="<th";if((_.isUndefined(value.resizable)||value.resizable)&&(_.isUndefined(value.show)||value.show)){tl+=" data-col-resizable"}if(self.options.enableColumnSelection&&(_.isUndefined(value.selectable)||value.selectable)){tl+=" data-col-selectable"}if(sortEnabled){tl+=" data-col-sortable"}tl+="></th>";$th=$(tl);$th.attr({"data-col-id":id,"data-col-field":field,title:titleLabel});self._setStyles($th,"text-align: "+value.textAlignment);$th.addClass(headerClasses);if(field==="checkbox"){$th.append('<input type="checkbox" />')}$th.append('<span class="header-data">'+headerLabel+"</span>");if(sortEnabled){$sortSpan=$('<span class="sort-buttons-container"></span>');$sortIcon=$('<i class="sort-icon"></i>');if(sortField&&sortField===value.field&&sortInfo.direction){sortClass=sortInfo.direction==="asc"?self.options.cssClassNames.ascIcon:self.options.cssClassNames.descIcon;$sortSpan.addClass("active");$sortIcon.addClass(sortClass+" "+sortInfo.direction)}$th.append($sortSpan.append($sortIcon))}return $th}function generateRow(cols,i){var $thList=[];_.forEach(cols,(function(col){var index,value,classes,styles,$groupTl;if(col.columns&&col.columns.length){$groupTl=$("<th></th>");classes=headerGroupClass+" "+(col.class||"");styles="text-align: "+col.textAlignment+";background-color: "+(col.backgroundColor||"")+";";$groupTl.attr({"data-col-group":col.field,class:classes,title:col.displayName});self._setStyles($groupTl,styles);$groupTl.append('<span class="header-data">'+col.displayName+"</span>");$thList.push($groupTl);generateRow(col.columns,i+1)}else{index=_.findIndex(self.preparedHeaderData,{field:col.field});value=self.preparedHeaderData[index];if(value){$thList.push(generateHeaderCell(value,index))}}}));rowTemplates[i]=rowTemplates[i]||[];rowTemplates[i]=rowTemplates[i].concat($thList)}if(_.isEmpty(headerConfig)){$row=$("<tr></tr>");self.preparedHeaderData.forEach((function(value,index){$row.append(generateHeaderCell(value,index))}));$htm.append($row)}else{generateRow(headerConfig,0);rowTemplates.forEach((function($thList,index){$row=$('<tr role="row" tabindex="0"></tr>');var rowSpan=rowTemplates.length-index;$thList.forEach((function($th){if(rowSpan>1&&$th.hasClass("app-datagrid-header-cell")){$th.attr("rowspan",rowSpan)}$row.append($th)}));$htm.append($row)}))}return{colgroup:$colgroup,header:$htm}},_getSearchEl:function(){var htm,sel='<select name="wm-datatable" data-element="dgFilterValue" '+'class="form-control app-select">'+'<option value="" selected class="placeholder">'+this.options.messages.selectField+"</option>",searchLabel=this.Utils.isDefined(this.options.searchLabel)&&this.options.searchLabel.length?this.options.searchLabel:"";this.options.colDefs.forEach((function(colDef,index){if(colDef.field!=="none"&&colDef.field!=="rowOperations"&&colDef.searchable&&_.toString(colDef.showinfilter)!=="false"){sel+='<option value="'+colDef.field+'" data-coldef-index="'+index+'">'+(colDef.displayName||colDef.field)+"</option>"}}));sel+="</select>";htm='<form class="form-search form-inline" onsubmit="return false;"><div class="form-group">'+'<input type="text" data-element="dgSearchText" class="form-control app-textbox" value="" placeholder="'+searchLabel+'"/>'+'</div><div class="input-append input-group">'+sel+'<span class="input-group-addon"><button type="button" data-element="dgSearchButton" class="app-search-button" title="'+searchLabel+'">'+'<i class="wi wi-search"></i>'+"</button></span>"+"</div>"+"</div></form>";var $htm=$(htm);this._setStyles($htm.find('[data-element="dgSearchText"]'),"display: inline-block;");return $htm},_appendRowExpansionButtons:function($htm){var self=this;$htm.find("[data-identifier='rowExpansionButtons']").each((function(index){var _rowData,$row,rowId,rowIndex=index;$row=$(this).closest("tr.app-datagrid-row");rowId=parseInt($row.attr("data-row-id"),10);_rowData=_.clone(self.options.data[rowId]);_rowData.$index=rowIndex+1;self.options.generateRowExpansionCell(_rowData,rowIndex);$(this).empty().append(self.options.getRowExpansionAction(rowIndex))}))},setSummaryRowDef:function(key,data,rowIndex,refreshIndicator){this.options.summaryRow=true;if(this.options.summaryRowDefs[rowIndex]==undefined){this.options.summaryRowDefs[rowIndex]={};this.options.summaryRowDefsObject[rowIndex]={}}this.options.summaryRowDefsObject[rowIndex][key]=data;this.options.summaryRowDefs[rowIndex][key]=data&&data.value?data.value:data;if(refreshIndicator)this.refreshGridData()},_getSummaryRowTemplate:function(){var self=this,$tfoot=$('<tfoot class="'+this.options.cssClassNames.gridFooter+'"></tfoot>');this._setStyles($tfoot,"border-top: 3px solid #eee;");_.forEach(this.options.summaryRowDefs,(function(row,index){row.$$pk=index;$tfoot.append(self._getRowTemplate(row,index,true))}));return $tfoot},getPageStartIndex:function(){var currentPage=this.options.getCurrentPage(),pagesize=this.options.getPageSize();var isPrevPageUpdated=this.options.actionRowPage<currentPage;var pageIndex=isPrevPageUpdated?this.options.actionRowPage:currentPage;return(pageIndex-1)*pagesize},_getPreparedDataForInfiniteScroll:function($tbody,preparedData){preparedData=preparedData.filter((function(row,index){var isExists=$tbody.find("tr.app-datagrid-row[data-row-id="+row.$$pk+"]");if(!isExists.length){return row}}));return preparedData},_updateTrData:function($tbody){var editedRow,updatedRowData,self=this;editedRow=$tbody.find("tr.app-datagrid-row[data-row-id="+self.options.actionRowIndex+"]");updatedRowData=self.preparedData[self.options.actionRowIndex];self.options.generateCustomExpressions(updatedRowData,self.options.actionRowIndex);var rowTemplate=self._getRowTemplate(updatedRowData,self.options.actionRowIndex);editedRow.replaceWith(rowTemplate[0])},_handleCRUDForInfiniteScroll:function($tbody){var self=this;if((self.options.lastActionPerformed===self.options.ACTIONS.SEARCH_OR_SORT||self.options.lastActionPerformed===self.options.ACTIONS.FILTER_CRITERIA||self.options.lastActionPerformed===self.options.ACTIONS.DATASET_UPDATE)&&(self.options.isSearchTrigerred||self.options.isDatasetUpdated||self.options.isDataUpdatedByUser)){$tbody.html("");if(this.options.navigation==="On-Demand"&&!this.options.isLastPage)this.element.find(".on-demand-datagrid").show();self.options.clearCustomExpression();self.options.clearRowDetailExpression();self.options.setIsSearchTrigerred(false);self.options.setIsDatasetUpdated(false)}else if(self.options.lastActionPerformed===self.options.ACTIONS.EDIT&&self.options.actionRowIndex!==undefined&&self.options.editmode!==this.CONSTANTS.QUICK_EDIT){self._updateTrData($tbody)}},_getGridTemplate:function(){var self=this,preparedData,$tbody,pageStartIndex=self.getPageStartIndex(),startRowIndex=self.options.startRowIndex,isScrollorOnDemand=self.options.isNavTypeScrollOrOndemand();if(isScrollorOnDemand){$tbody=this.gridElement;if(this.renderTableOnViewLess){$tbody=this.gridElement.empty();this.hideLoadingIndicator();this.renderTableOnViewLess=false}}else{$tbody=this.gridElement.empty()}if(isScrollorOnDemand){this._handleCRUDForInfiniteScroll($tbody);if(self.options.lastActionPerformed===self.options.ACTIONS.DELETE){startRowIndex=self.options.actionRowIndex+1}preparedData=this._getPreparedDataForInfiniteScroll($tbody,this.preparedData.slice(pageStartIndex))}else{this.options.clearCustomExpression();this.options.clearRowDetailExpression();preparedData=this.preparedData}_.forEach(preparedData,(function(row,index){var _row=_.clone(row),rowIndex=isScrollorOnDemand?startRowIndex+index-1:index,rowTemplate;_row.$index=rowIndex+1;self.options.generateCustomExpressions(_row,rowIndex);self.options.registerRowNgClassWatcher(_row,rowIndex);rowTemplate=self._getRowTemplate(row,rowIndex);$tbody.append(rowTemplate);if(self.options.rowExpansionEnabled){var rowHeight=self.options.rowDef.height;var rowPosition=self.options.rowDef.position;var colSpanLength=_.filter(self.preparedHeaderData,(function(c){return c.show})).length-1;var $tr=$('<tr class="app-datagrid-detail-row" tabindex="0" role="row" data-row-id="'+row.$$pk+'"><td></td><td colspan="'+colSpanLength+'" class="app-datagrid-row-details-cell">'+'<div class="row-overlay"><div class="row-status"><i class="'+self.options.loadingicon+'"></i></div></div><div class="details-section"></div>'+"</td></tr>");if(rowPosition==="-1"){$tr=$('<tr class="app-datagrid-detail-row" tabindex="0" role="row" data-row-id="'+row.$$pk+'"><td colspan="'+colSpanLength+'" class="app-datagrid-row-details-cell">'+'<div class="row-overlay"><div class="row-status"><i class="'+self.options.loadingicon+'"></i></div></div><div class="details-section"></div>'+"</td><td></td></tr>")}if(rowHeight){$tr.find("div.row-overlay").css("min-height",rowHeight)}$tr.css("display","none");$tr.find(".details-section").css("display","none");$tbody.append($tr)}}));if(!this.options.isdynamictable){this.options.setLastActionPerformed(this.options.ACTIONS.DEFAULT);this.options.setIsDataUpdatedByUser(false);this.options.clearActionRowIndex()}return $tbody},_getRowTemplate:function(row,rowIndex,summaryRow){var $htm,self=this,gridOptions=self.options;$htm=$('<tr role="row" tabindex="0" class="'+gridOptions.cssClassNames.tableRow+" "+(gridOptions.rowClass||"")+'" data-row-id="'+row.$$pk+'"></tr>');this.preparedHeaderData.forEach((function(current,colIndex){$htm.append(self._getColumnTemplate(row,colIndex,current,rowIndex,summaryRow))}));return $htm},_getRowActionsColumnDefIndex:function(){var i,len=this.preparedHeaderData.length;for(i=0;i<len;i+=1){if(this.preparedHeaderData[i].field==="rowOperations"){return i}}return-1},_getRowActionsColumnDef:function(){var index=this._getRowActionsColumnDefIndex();if(index!==-1){return this.preparedHeaderData[index]}return null},_getCheckboxTemplate:function(row,isMultiSelectCol){var checked=row._checked===true?" checked":"",disabled=row.disabed?" disabled":"",chkBoxName=isMultiSelectCol?"gridMultiSelect":"";return'<input name="'+chkBoxName+'" type="checkbox"'+checked+disabled+"/>"},_getRadioTemplate:function(row){var checked=row._checked===true?" checked":"",disabled=row.disabed?" disabled":"";return'<input type="radio" rowSelectInput name="" value=""'+checked+disabled+"/>"},_getColumnTemplate:function(row,colId,colDef,rowIndex,summaryRow){var $htm,columnValue,columnValueObject,cellPreloader='<div class="overlay"><span aria-hidden="true" class="form-field-spinner fa fa-circle-o-notch fa-spin form-control-feedback"></span></div>',customExpressionHtml,innerTmpl,classes=this.options.cssClassNames.tableCell+" "+(colDef.class||""),colExpression=colDef.customExpression,styles="text-align: "+colDef.textAlignment+";position: relative;";$htm=$('<td class="'+classes+'" data-col-id="'+colId+'" role="cell"></td>');this._setStyles($htm,styles);columnValue=_.get(row,colDef.field);if(summaryRow){columnValueObject=this.options.summaryRowDefsObject[rowIndex][colDef.field];if(columnValueObject instanceof Object){if(columnValueObject.class){$htm.addClass(columnValueObject.class)}}if(columnValue instanceof Promise){customExpressionHtml=cellPreloader;$htm.html(customExpressionHtml)}else{innerTmpl=_.isUndefined(columnValue)||columnValue===null?"":columnValue;$htm.html(innerTmpl)}}else if(colExpression){$htm.html(this.options.getCustomExpression(colDef.field,rowIndex))}else{if(colDef.type!=="custom"){columnValue=_.get(row,colDef.field);if(this.options.filterNullRecords&&columnValue===null||_.isUndefined(columnValue)){columnValue=""}$htm.attr("title",columnValue);$htm.text(""+columnValue)}else{switch(colDef.field){case"checkbox":innerTmpl=this._getCheckboxTemplate(row,colDef.isMultiSelectCol);break;case"__expand":innerTmpl='<span class="row-expansion-column" data-identifier="rowExpansionButtons"></span>';break;case"radio":innerTmpl=this._getRadioTemplate(row);break;case"rowOperations":innerTmpl='<span class="actions-column" data-identifier="actionButtons"></span>';break;case"rowIndex":innerTmpl=row.$$index;break;case"none":innerTmpl="";break;default:innerTmpl=_.isUndefined(columnValue)||columnValue===null?"":columnValue}$htm.html(innerTmpl)}}row.$index=rowIndex+1;this.options.registerColNgClassWatcher(row,colDef,rowIndex,colId);return $htm},_getEventTemplate:function(colDef){var events=_.filter(_.keys(colDef),(function(key){return _.startsWith(key,"on")})),changeEvt,template="";changeEvt=colDef.editWidgetType==="autocomplete"?"onSubmit":"onChange";events=_.union(events,[changeEvt]);_.forEach(events,(function(eventName){template+=" "+_.kebabCase(eventName)+'="';if(eventName==="onSubmit"||eventName==="onChange"){template+="_"+eventName+"Field($event, $scope, newVal, oldVal);"}template+=(colDef[eventName]||"")+'" '}));return template},_insertFieldInHeaderConfig:function(headerConfig,fieldName,position){var index=_.findIndex(headerConfig,{field:position}),self=this;if(index===-1){_.forEach(headerConfig,(function(config){if(config.isGroup){self._insertFieldInHeaderConfig(config.columns,fieldName,position)}}))}else{headerConfig.splice(index+1,0,{field:fieldName,isPredefined:true})}},setHeaderConfigForDefaultFields:function(name,position){if(_.isEmpty(this.options.headerConfig)){return}var fieldName=this.customColumnDefs[name].field;_.remove(this.options.headerConfig,{field:fieldName});if(position==="0"){this.options.headerConfig.unshift({field:fieldName,isPredefined:true})}else if(position==="-1"){this.options.headerConfig.push({field:fieldName,isPredefined:true})}else{this._insertFieldInHeaderConfig(this.options.headerConfig,fieldName,position)}},setDefaultColsData:function(header){if(_.isEmpty(this.preparedHeaderData)){return}var rowExpandPosition,rowExpandCol;if(this.options.rowExpansionEnabled){rowExpandPosition=this.options.rowDef.position;rowExpandCol=_.clone(this.customColumnDefs.__expand);rowExpandCol.width=this.options.rowDef.columnwidth;if(header){if(rowExpandPosition==="-1"){this.preparedHeaderData.push(rowExpandCol)}else if(rowExpandPosition==="0"){this.preparedHeaderData.unshift(rowExpandCol)}else{var index=_.findIndex(this.preparedHeaderData,{field:rowExpandPosition});this.preparedHeaderData.splice(index+1,0,rowExpandCol)}}this.setHeaderConfigForDefaultFields("__expand",rowExpandPosition)}if(this.options.showRowIndex){if(header){this.preparedHeaderData.unshift(this.customColumnDefs.rowIndex)}this.setHeaderConfigForDefaultFields("rowIndex","0")}if(this.options.multiselect){if(header){this.preparedHeaderData.unshift(this.customColumnDefs.checkbox)}this.setHeaderConfigForDefaultFields("checkbox","0")}if(!this.options.multiselect&&this.options.showRadioColumn){if(header){this.preparedHeaderData.unshift(this.customColumnDefs.radio)}this.setHeaderConfigForDefaultFields("radio","0")}},_prepareHeaderData:function(){this.preparedHeaderData=[];$.extend(this.preparedHeaderData,this.options.colDefs);this.setDefaultColsData(true)},_generateCustomColDefs:function(){var colDefs=[],generatedColDefs={};function generateColumnDef(key){if(!generatedColDefs[key]){var colDef={type:"string",field:key};colDefs.push(colDef);generatedColDefs[key]=true}}this.options.data.forEach((function(item){_.keys(item).forEach(generateColumnDef)}));this.options.colDefs=colDefs;this._prepareHeaderData()},_prepareData:function(){var data=[],colDefs=this.options.colDefs,self=this,gridData=[],pageStartIndex=self.getPageStartIndex(),isObject=this.Utils.isObject,isDefined=this.Utils.isDefined;if(!this.options.colDefs.length&&this.options.data.length){this._generateCustomColDefs()}gridData=this.options.isNavTypeScrollOrOndemand()?this.options.data.slice(pageStartIndex):this.options.data;gridData.forEach((function(item,i){var rowData=$.extend(true,{},item);colDefs.forEach((function(colDef){if(!colDef.field){return}var fields=colDef.field.split("."),text=item,j,len=fields.length,key,isArray;for(j=0;j<len;j++){key=fields[j];isArray=undefined;if(key.indexOf("[0]")!==-1){key=key.replace("[0]","");isArray=true}if(isObject(text)&&!isArray){text=_.get(text,key)}else if(isArray){text=_.get(text,key+"[0]")}else{text=undefined;break}}if(isDefined(text)){rowData[colDef.field]=text}else if(fields.length>1&&_.has(item,colDef.field)){rowData[colDef.field]=item[colDef.field]}}));rowData.$$index=pageStartIndex+i+1;rowData.$$pk=self.options.isNavTypeScrollOrOndemand()?pageStartIndex+i:i;data.push(rowData)}));if(self.options.isNavTypeScrollOrOndemand()){if(self.options.isSearchTrigerred&&!self.emptySearch||self.options.isDatasetUpdated){self.preparedData=data}else if(self.preparedData.length){data.forEach((function(rowData,index){var rowId=pageStartIndex+index;if(self.preparedData[rowId]&&rowData.$$index===self.preparedData[rowId].$$index){self.preparedData[rowId]=rowData}else{self.preparedData.push(rowData)}}))}else{self.preparedData.push(...data)}}else{self.preparedData=data}},_reselectColumns:function(){var selectedColumns=[],self=this;if(this.gridHeaderElement&&this.options.enableColumnSelection){selectedColumns=this.gridHeaderElement.find("th."+this.options.cssClassNames.selectedColumn);if(selectedColumns.length){selectedColumns.each((function(){self.columnSelectionHandler(undefined,$(this))}))}}if(this.options.multiselect){this.updateSelectAllCheckboxState()}},_create:function(){$.extend(this,{dataStatus:{message:"",state:"ready"},preparedData:[],preparedHeaderData:[],dataStatusContainer:null,gridContainer:null,gridElement:null,gridHeader:null,gridBody:null,columnClickInfo:{},gridFooter:null,gridSearch:null,tableId:null,searchObj:{field:"",value:"",event:null},compiledCellTemplates:{}});this._setStatus=_.debounce((function(isCreated){this.__setStatus(isCreated)}),100);this._debounceOnEnter=_.debounce((function($target,$row,quickEdit,event){this._onEnter($target,$row,quickEdit,event)}),150);this.options.summaryRow=false;this.options.summaryRowDefs=[];this._prepareHeaderData();this._prepareData();this._render(true)},_setGridEditMode:function(val){if(_.isFunction(this.options.setGridEditMode)){this.options.setGridEditMode(val)}},_refreshGrid:function(){this._prepareHeaderData();this._prepareData();this._render();this.addOrRemoveScroll();this._setGridEditMode(false)},refreshGrid:function(){window.clearTimeout(this.refreshGridTimeout);this.refreshGridTimeout=window.setTimeout(this._refreshGrid.bind(this),50)},callRenderGridForInfiniteScroll:function(){this.gridFooter.remove();var $alwaysNewRow=this.gridElement.find("> tr.app-datagrid-row.always-new-row");if($alwaysNewRow.length){$alwaysNewRow.remove()}this._renderGrid(undefined)},refreshGridData:function(){this._prepareData();if(!this.options.isNavTypeScrollOrOndemand()){this.gridFooter.remove();this._renderGrid()}else{this.callRenderGridForInfiniteScroll()}this._reselectColumns();this.addOrRemoveScroll();this._setGridEditMode(false);this.toggleNewRowActions(false)},setDefaultRowData:function(rowData){_.forEach(this.preparedHeaderData,(function(colDef){rowData[colDef.field]=colDef.defaultvalue}))},addNewRow:function(skipFocus,alwaysNewRow){var rowId=this.gridElement.find("> tr.app-datagrid-row:visible").length||99999,self=this,rowData={},$row,$gridBody,$alwaysNewRow;if(!alwaysNewRow&&_.isFunction(this.options.beforeRowInsert)){this.options.beforeRowInsert()}$gridBody=this.gridElement;$alwaysNewRow=$gridBody.find("> tr.app-datagrid-row.always-new-row");if($alwaysNewRow.length){this.setFocusOnElement(undefined,$alwaysNewRow);if(this.options.editmode===this.CONSTANTS.QUICK_EDIT){var $qTarget=$alwaysNewRow.find("input").length>0?$($alwaysNewRow.find("input")[0]):null;if($qTarget!==null){var event=$.Event("keydown");event.which=13;$qTarget.trigger(event)}}return}rowData.$index=rowId;rowData.$$pk=rowId;if(this.options.editmode!==this.CONSTANTS.FORM&&this.options.editmode!==this.CONSTANTS.DIALOG){$row=$(this._getRowTemplate(rowData,rowData.$index));if(!this.preparedData.length){this.setStatus("ready",this.dataStatus.ready)}if(this.options.formPosition==="top"){$gridBody.prepend($row)}else{$gridBody.append($row)}this._appendRowActions($row,true,rowData);this.attachEventHandlers($row);if(alwaysNewRow||this.options.editmode!==this.CONSTANTS.QUICK_EDIT){$row.find(".delete-row-button").hide();if(alwaysNewRow){$row.find(".edit-row-button").hide()}}this._findAndReplaceCompiledTemplates();if(alwaysNewRow){this.setDefaultRowData(rowData);$row.addClass("always-new-row").addClass("row-editing");this.options.runInNgZone((function(){self.makeRowEditable($row,rowData,true)}))}else{$row.trigger("click",[undefined,{action:"edit",operation:"new",skipFocus:skipFocus}])}this.updateSelectAllCheckboxState();this.addOrRemoveScroll();this.options.timeoutCall((function(){self.setColGroupWidths()}),100)}},addLoadMoreBtn:function(onDemandMsg,loadingdatamsg,cb,infScroll){var $btnEl;if(!this.options.isLastPage||infScroll){var self=this;var $parenEl=$('<div class="on-demand-datagrid"><a class="app-button btn btn-block on-demand-load-btn"></a></div>');$btnEl=$parenEl.find("a");$btnEl.append(onDemandMsg);this.element.find(".app-grid-header-inner").append($parenEl);if(infScroll){if(this.element.find(".on-demand-load-btn").length){this.element.find(".on-demand-load-btn").text(this.options.viewlessmessage)}}$btnEl.on("click",(function(e){var lastPage=self.options.getCurrentPage()==self.options.getPageCount();if(!lastPage){self.showLoadingIndicator(loadingdatamsg,false)}if(!self.options.showviewlessbutton){$btnEl.hide()}if(infScroll){if(lastPage){self.element.find(".on-demand-datagrid").remove()}}if(lastPage&&self.options.showviewlessbutton){$btnEl.hide();self.renderTableOnViewLess=true;self.renderPaginationOnViewLess=true;self.options.enableNavigation();self._renderGrid()}if(cb&&typeof cb==="function"){cb(e)}}))}},showLoadingIndicator:function(loadingdatamsg,infScroll){var hasLoadingEl=this.element.find(".loading-data-msg");var $dataGrid=this.element.find(".on-demand-datagrid");if(hasLoadingEl.length&&!infScroll){hasLoadingEl.show()}else if(infScroll&&$dataGrid.length){$dataGrid.show()}else{var $loadingEl=$('<div class="loading-data-msg spin-icon-in-center"><span><i class="app-icon panel-icon fa-spin '+this.options.loadingicon+'"></i>'+'<span class="sr-only">Loading</span><span class="loading-text"></span></span></div>');$loadingEl.find(".loading-text").html(loadingdatamsg);if($dataGrid.length){$dataGrid.append($loadingEl)}else{var gridEl=$('<div class="on-demand-datagrid">'+$loadingEl[0].outerHTML+"</div>");this.element.find(".app-grid-header-inner").append(gridEl)}}},hideLoadingIndicator:function(showLoadBtn,infScroll){if(!showLoadBtn&&!infScroll){this.element.find(".loading-data-msg").hide();this.element.find(".on-demand-load-btn").text(this.options.ondemandmessage);this.element.find(".on-demand-load-btn").show()}else if(this.options.getCurrentPage()==this.options.getPageCount()&&this.options.showviewlessbutton){this.element.find(".on-demand-load-btn").show().text(this.options.viewlessmessage);this.element.find(".loading-data-msg").hide();if(infScroll){if(!this.element.find(".on-demand-load-btn").length){this.options.addLoadMoreBtn()}this.element.find(".loading-data-msg").hide()}}else{this.element.find(".on-demand-datagrid").hide()}},getSelectedRows:function(){this.getSelectedColumns();var selectedRowsData=[],self=this;this.preparedData.forEach((function(data,i){if(data._selected){selectedRowsData.push(self.options.data[i])}}));return selectedRowsData},selectRows:function(rows){var self=this;self.gridElement.find("tr.app-datagrid-row").each((function(index){if(self.preparedData[index]&&self.preparedData[index]._selected===true){$(this).trigger("click",[$(this),{skipSingleCheck:true}])}}));if(_.isArray(rows)){_.forEach(rows,(function(row){self.selectRow(row,true)}))}else{self.selectRow(rows,true)}},toggleRowFilter:function(show){if(this.options.filtermode===this.CONSTANTS.MULTI_COLUMN&&this.gridSearch){if(show){this.gridSearch.show()}else{this.gridSearch.hide()}}},setColGroupWidths:function(){var self=this,headerCols=this.options.isMobile?this.tableContainer.find("col"):this.tableContainer.find("col"),bodyCols=this.tableContainer.find("col"),headerCells=this.options.showHeader?this.gridContainer.find("th.app-datagrid-header-cell"):this.gridElement.find("tr.app-datagrid-row").first().find("td"),colLength=this.preparedHeaderData.length,scrollLeft=this.gridElement.parent().prop("scrollLeft");if(!headerCols.length&&!headerCells.length){return}this._setColSpan(this.options.headerConfig);this.toggleRowFilter();var definedColWidth=0;var colsLen=headerCols.length;headerCols.each((function(){var eachColWidth=$(this).width();if(eachColWidth){definedColWidth=definedColWidth+eachColWidth;colsLen=colsLen-1}}));headerCells.each((function(){var id=Number($(this).attr("data-col-id")),colDef=self.preparedHeaderData[id],$headerCell=self.gridContainer.find('th[data-col-id="'+id+'"]'),$tdCell=self.gridElement.find('td.app-datagrid-cell[data-col-id="'+id+'"]'),$footCell=self.tableContainer.find('tfoot tr.app-datagrid-row td.app-datagrid-cell[data-col-id="'+id+'"]'),$headerCol=$(headerCols[id]),$bodyCol=$(bodyCols[id]),definedWidth,width;if(!colDef){return}definedWidth=colDef.width;if(!_.isUndefined(colDef.show)&&!colDef.show){$headerCell.hide();$tdCell.hide();$headerCol.hide();$bodyCol.hide();$footCell.hide()}else{$headerCell.show();$tdCell.show();$headerCol.show();$bodyCol.show();$footCell.show()}if($headerCol.length&&$headerCol[0].style.width==="90px"){width=_.isUndefined(definedWidth)?"":definedWidth;$headerCol.css("width",width);$bodyCol.css("width",width)}}));headerCells.each((function(){var $header=$(this),id=Number($header.attr("data-col-id")),colDef=self.preparedHeaderData[id],definedWidth,width,tempWidth,$headerCol;if(!colDef){return}definedWidth=colDef.width;if(!_.isUndefined(colDef.show)&&!colDef.show){width=0}else{if($header.hasClass("grid-col-small")){width=50}else{if(_.isUndefined(definedWidth)||definedWidth===""||_.includes(definedWidth,"%")){$headerCol=$(headerCols[id]);if($headerCol.length){tempWidth=$headerCol[0].style.width;if(tempWidth===""||tempWidth==="0px"||tempWidth==="90px"||_.includes(tempWidth,"%")){width=$header.width();if(width<=0){var currentNode=$header;var elemWidth=width;var padding=0;while(elemWidth<=0){currentNode=currentNode.parent();elemWidth=currentNode.width();if(currentNode.find("table").length){padding=padding+parseFloat(currentNode.css("padding-left"))+parseFloat(currentNode.css("padding-right"))}}if(elemWidth>0){if(padding){elemWidth=elemWidth-padding}if(_.includes(tempWidth,"%")){var widthPercent=parseInt(tempWidth);var pixelWidth=elemWidth*(widthPercent/100);width=pixelWidth}else{var parentWidth=definedColWidth&&definedColWidth>0?elemWidth-definedColWidth:elemWidth;var totalCols=colsLen?colsLen:headerCols.length;width=parentWidth/totalCols;width=width>90?colLength===id+1?width-17:width:90}}else{width=width>90?colLength===id+1?width-17:width:90}}else{width=width>90?colLength===id+1?width-17:width:90}}else{width=tempWidth}}}else{width=definedWidth}}}$(headerCols[id]).css("width",width);$(bodyCols[id]).css("width",width)}));this.toggleRowFilter(true);this.gridElement.parent().prop("scrollLeft",scrollLeft);this.gridHeaderElement.parent().prop("scrollLeft",scrollLeft)},getSelectedColumns:function(){var selectedColsData={},headerData=[],self=this,multiSelectColIndex,radioColIndex,colIndex;$.extend(headerData,this.preparedHeaderData);if(this.options.multiselect){headerData.some((function(item,i){if(item.field==="checkbox"){multiSelectColIndex=i;return true}}));headerData.splice(multiSelectColIndex,1)}else if(this.options.showRadioColumn){headerData.some((function(item,i){if(item.field==="radio"){radioColIndex=i;return true}}));headerData.splice(radioColIndex,1)}if(this.options.showRowIndex){headerData.some((function(item,i){if(item.field==="rowIndex"){colIndex=i;return true}}));headerData.splice(colIndex,1)}headerData.forEach((function(colDef){var field=colDef.field;if(colDef.selected){selectedColsData[field]={colDef:colDef,colData:self.options.data.map((function(data){return data[field]}))}}}));return selectedColsData},_setOption:function(key,value){this._super(key,value);switch(key){case"showHeader":this._toggleHeader();this._toggleSearch();this.setColGroupWidths();this.addOrRemoveScroll();break;case"filtermode":this._toggleSearch();break;case"searchLabel":if(this.gridSearch){this.gridSearch.find('[data-element="dgSearchText"]').attr("placeholder",value);this.gridSearch.find('[data-element="dgSearchButton"]').attr("title",value)}break;case"selectFirstRow":this.selectFirstRow(value);break;case"data":if(!this.isResetSortIconsDone){this.setSortIconDefault()}this.refreshGridData();break;case"dataStates":if(this.dataStatus.state==="nodata"){this.setStatus("nodata",this.dataStatus.nodata)}else if(this.dataStatus.state==="loading"){this.setStatus("loading")}break;case"loadingicon":this.dataStatusContainer.find("i").removeClass().addClass(this.options.loadingicon);break;case"colDefs":if(this.options.isNavTypeScrollOrOndemand()&&this.options.isNextPageData){this.tableContainer.find("colgroup").remove();this._prepareHeaderData();this.setColGroupWidths();this._renderHeader();this._renderSearch();this.attachEventHandlers(this.gridElement);this._reselectColumns();this.addOrRemoveScroll();break}case"multiselect":case"showRadioColumn":case"rowActions":case"filterNullRecords":case"showRowIndex":this.refreshGrid();break;case"cssClassNames":var gridClass=this.options.cssClassNames.gridDefault+" "+this.options.cssClassNames.grid;if(this.options.rowExpansionEnabled){gridClass=gridClass+" "+this.options.cssClassNames.gridRowExpansionClass}this.tableContainer.attr("class",gridClass);if(this.options.spacing==="condensed"){this._toggleSpacingClasses("condensed")}break;case"spacing":this._toggleSpacingClasses(value);break;case"messages":this.gridSearch&&this.gridSearch.find("option.placeholder").text(value&&value.selectField);break}},getOptions:function(){return this.options},_toggleHeader:function(){if(this.gridHeaderElement){this.gridHeaderElement.empty()}if(this.tableContainer){this.tableContainer.find("colgroup").remove();this.tableContainer.find("thead").remove()}this.setDefaultColsData();if(this.options.showHeader){this._renderHeader()}},_toggleSearch:function(){if(this.gridSearch){this.gridSearch.remove()}if(this.options.filtermode===this.CONSTANTS.SEARCH){this._renderSearch()}else if(this.options.filtermode===this.CONSTANTS.MULTI_COLUMN){this._renderRowFilter();this.setColGroupWidths()}},selectFirstRow:function(value,visible){var $row,id;if(visible&&this.gridElement.find("tr").is(":visible")){this.__setStatus();$row=this.gridElement.find("tr.app-datagrid-row:visible:not(.always-new-row)").first()}else{$row=this.gridElement.find("tr.app-datagrid-row:not(.always-new-row)").first()}id=$row.attr("data-row-id");if($row.length&&this.preparedData.length){this.preparedData[id]._selected=!value;$row[0].click()}},selectRow:function(row,value){var rowIndex=_.isNumber(row)?row:this.Utils.getObjectIndex(this.options.data,row),selector,$row;if(rowIndex!==-1){selector="tr.app-datagrid-row[data-row-id="+rowIndex+"]";$row=this.gridElement.find(selector);if($row.length){this.preparedData[rowIndex]._selected=!value}if(value){$row.trigger("click")}else{this.toggleRowSelection($row,value);this.options.callOnRowDeselectEvent(this.preparedData[rowIndex])}}},deselectRow:function(row){this.selectRow(row,false)},toggleRowSelection:function($row,selected,e,isSelectAll){if(!$row.length){return}var rowId=$row.attr("data-row-id"),$checkbox,$radio;if(!this.preparedData[rowId]){return}this.preparedData[rowId]._selected=selected;if(selected){$row.addClass("active")}else{$row.removeClass("active")}if(this.options.showRadioColumn){$radio=$row.find("td input[rowSelectInput]:radio:not(:disabled)");$radio.prop("checked",selected);this.preparedData[rowId]._checked=selected}if(this.options.multiselect){$checkbox=$row.find('td input[name="gridMultiSelect"]:checkbox:not(:disabled)');$checkbox.prop("checked",selected);this.preparedData[rowId]._checked=selected;if(!isSelectAll){this.updateSelectAllCheckboxState()}}else{this._deselectPreviousSelection($row,e)}},updateSelectAllCheckboxState:function(){if(!this.options.showHeader||!this.options.multiselect){return}this.__setStatus();var $headerCheckbox=this.gridHeaderElement.find("th.app-datagrid-header-cell input:checkbox"),$tbody=this.gridElement,checkedItemsLength=$tbody.find('tr.app-datagrid-row:visible input[name="gridMultiSelect"]:checkbox:checked').length,visibleRowsLength=$tbody.find("tr.app-datagrid-row:visible").length;if(!visibleRowsLength){$headerCheckbox.prop("checked",false);return}if(checkedItemsLength===visibleRowsLength){$headerCheckbox.prop("checked",true)}else{$headerCheckbox.prop("checked",false)}},rowClickHandlerOnCapture:function(e,$row,options){if(this.getColInfo(e)&&e.target.type!="checkbox"){return}$row=$row||$(e.target).closest("tr.app-datagrid-row");var gridRow=this.gridElement.find($row);if(gridRow.length&&gridRow.closest("tbody").attr("id")===this.gridElement.attr("id")){var rowId=$row.attr("data-row-id");var rowData=this.preparedData[rowId];var data=this.options.data[rowId];this.options.assignSelectedItems(data,e)}},rowSelectionHandler:function(e,$row,options){if(this.getColInfo(e)&&e.target.type!="checkbox"){return}options=options||{};var rowId,rowData,data,selected,self=this,action=options.action,$target=$(e.target),isQuickEdit=this.options.editmode===this.CONSTANTS.QUICK_EDIT;function callRowSelectionEvents(){if(selected&&_.isFunction(self.options.onRowSelect)){self.options.onRowSelect(data,e)}if(!selected&&_.isFunction(self.options.onRowDeselect)){self.options.onRowDeselect(data,e)}}$row=$row||$target.closest("tr.app-datagrid-row");if(action||isQuickEdit&&($target.hasClass("app-datagrid-cell")||$target.closest("td.app-datagrid-cell").length)&&!$row.hasClass("always-new-row")){options.action=options.action||"edit";if(options.operation==="new"||self.options.actionsEnabled.edit){self.toggleEditRow(e,options)}if(options.skipSelect){return}}rowId=$row.attr("data-row-id");rowData=this.preparedData[rowId];data=this.options.data[rowId];selected=rowData&&rowData._selected||false;if(!options.skipSingleCheck&&($row.hasClass("active")&&!this.options.multiselect||!rowData)){if(!isQuickEdit&&options.operation!=="new"){callRowSelectionEvents()}return}this.options.callOnRowClickEvent(data,e);selected=!selected;this.toggleRowSelection($row,selected,e);callRowSelectionEvents()},rowDblClickHandler:function(e,$row){e.stopPropagation();$row=$row||$(e.target).closest("tr.app-datagrid-row");var rowData,rowId=$row.attr("data-row-id");rowData=this.preparedData[rowId];if(!rowData){return}if(_.isFunction(this.options.onRowDblClick)){this.options.onRowDblClick(rowData,e)}},closePopover:function(){this.options.closePopover(this.element)},headerClickHandler:function(e){var $th=$(e.target).closest("th.app-datagrid-header-cell"),id=$th.attr("data-col-id");this.closePopover();this.options.onHeaderClick(this.preparedHeaderData[id],e)},columnSelectionHandler:function(e,$headerCell){if(e){e.stopImmediatePropagation()}var $th=e?$(e.target).closest("th.app-datagrid-header-cell"):$headerCell,id=$th.attr("data-col-id"),colDef=this.preparedHeaderData[id],field=colDef.field,selector='td[data-col-id="'+id+'"]',$column=this.gridElement.find(selector),selected=$column.data("selected")||false,colInfo={colDef:colDef,data:this.options.data.map((function(data){return data[field]})),sortDirection:this._getColumnSortDirection(colDef.field)},selectedClass=this.options.cssClassNames.selectedColumn;selected=!selected;colDef.selected=selected;$column.data("selected",selected);if(selected){$column.addClass(selectedClass);$th.addClass(selectedClass);if(_.isFunction(this.options.onColumnSelect)&&e){this.options.onColumnSelect(colInfo,e)}}else{$column.removeClass(selectedClass);$th.removeClass(selectedClass);if(_.isFunction(this.options.onColumnDeselect)&&e){this.options.onColumnDeselect(colInfo,e)}}},getTextValue:function(fieldName,alwaysNewRow){return this.options.getFieldValue(alwaysNewRow?fieldName+"_new":fieldName)},getUploadedFiles:function($el,fieldName){return _.get(document.forms,[$el.find("form").attr("name"),fieldName,"files",0])},isDataModified:function($editableElements,rowData,alwaysNewRow){var isDataChanged=false,self=this;function getEpoch(val){return val?moment(val).valueOf():val}$editableElements.each((function(){var $el=$(this),colId=$el.attr("data-col-id"),colDef=self.preparedHeaderData[colId],text=self.getTextValue(colDef.field,alwaysNewRow),originalData=_.get(rowData,colDef.field);if(colDef.editWidgetType==="upload"){isDataChanged=self.getUploadedFiles($el,colDef.field)instanceof File}else{if(!self.Utils.isDefined(text)&&(originalData===null||originalData===undefined)){isDataChanged=false}else{if(colDef.editWidgetType==="datetime"){isDataChanged=!(getEpoch(originalData)===getEpoch(text))}else{isDataChanged=!(originalData==text)}}}if(isDataChanged){return!isDataChanged}}));return isDataChanged},focusActiveRow:function(){this.gridElement.find("tr.app-datagrid-row.active").focus()},focusNewRow:function(){var newRow=this.gridElement.find("tr.always-new-row");var newRowInputs=newRow&&newRow.find("input")||[];newRowInputs.length&&newRowInputs[0].focus()},disableActions:function(val){var $deleteBtns=this.gridElement.find(".delete-row-button"),$editBtns=this.gridElement.find(".edit-row-button");if(val){$editBtns.addClass("disabled-action");$deleteBtns.addClass("disabled-action")}else{$editBtns.removeClass("disabled-action");$deleteBtns.removeClass("disabled-action")}},setFocusOnElement:function(e,$el,skipDelay){var $firstEl,$target=e&&$(e.target),$focusEl;if($target&&$target.hasClass("app-datagrid-cell")){$firstEl=$target.find("input")}else{if(!$el){$el=$target.closest("tr.app-datagrid-row").find("td.cell-editing")}else if($el.hasClass("app-datagrid-row")){$el=$el.find("td.cell-editing")}$firstEl=$($el).first().find("input");if(!$firstEl.length){$firstEl=$($el).first().find("textarea")}if(!$firstEl.length){$firstEl=$($el).first().find("select")}}if($firstEl.length){$focusEl=$firstEl.first();if(skipDelay){$focusEl.focus();$focusEl.select()}else{this.options.timeoutCall((function(){$focusEl.focus();$focusEl.select()}))}}},removeNewRow:function($row){this.disableActions(false);this._setGridEditMode(false);if($row.hasClass("always-new-row")){return}$row.attr("data-removed",true);$row.remove();if(!this.preparedData.length){this.setStatus("nodata",this.dataStatus.nodata)}this.addOrRemoveScroll();this.toggleNewRowActions(false)},saveRow:function(callBack){this.gridElement.find("tr.app-datagrid-row.row-editing:not(.always-new-row)").each((function(){$(this).trigger("click",[undefined,{action:"save",skipSelect:true,noMsg:true,success:callBack}])}))},makeRowEditable:function($row,rowData,alwaysNewRow){var self=this,$originalElements=$row.find("td.app-datagrid-cell"),rowId=parseInt($row.attr("data-row-id"),10),$editableElements,_rowData=_.clone(rowData);_rowData.$index=rowId+1;this.options.removeValidations(alwaysNewRow);this.options.generateInlineEditRow(_rowData,alwaysNewRow);$originalElements.each((function(){var $el=$(this),cellText=$el.text(),id=$el.attr("data-col-id"),colDef=self.preparedHeaderData[id],value,editableTemplate;if(!colDef.readonly){value=_.get(rowData,colDef.field);editableTemplate=self.options.getInlineEditWidget(colDef.field,value,alwaysNewRow);if(!(colDef.customExpression||colDef.formatpattern&&colDef.formatpattern!=="None")){$el.addClass("cell-editing").html(editableTemplate).data("originalText",cellText)}else{$el.addClass("cell-editing editable-expression").data("originalValue",{rowIndex:rowId,fieldName:colDef.field});$el.addClass("cell-editing editable-expression").html(editableTemplate).data("originalText",cellText)}$el.addClass("form-group");if(colDef.binding!=="rowOperations"){self.options.timeoutCall((function(){self.options.applyValidations(colDef,alwaysNewRow);if(colDef.required){$el.addClass("required-field")}}))}else if(colDef.required){$el.addClass("required-field")}}}));$editableElements=$row.find("td.cell-editing");$editableElements.on("click",(function(e){e.stopPropagation()}));$editableElements.on("keydown",(function(e){if((e.which===38||e.which===40)&&(e.currentTarget&&!e.currentTarget.closest(".always-new-row"))){e.stopPropagation()}}))},toggleNewRowActions:function(saveInd){var self=this,$gridActions=$(this.element).siblings("div.panel-footer, div.panel-heading").find("div.app-datagrid-actions"),$newRow=this.gridElement.find("tr.app-datagrid-row.row-editing"),$newRowButton=$gridActions.find("i.wi-plus").closest(".app-button");if(this.options.editmode===this.CONSTANTS.INLINE&&(this.options.rowActions.length===0||!_.some(this.options.rowActions,{action:"editRow($event)"}))){if(saveInd){$gridActions.append('<button type="button" wmbutton="" class="btn app-button btn-default cancelNewRow" tabindex="0" accesskey="" title="Cancel">'+'<i aria-hidden="true" class="app-icon wi wi-cancel"></i>'+'<span class="sr-only">Cancel Icon</span><span class="btn-caption">Cancel</span>'+"</button>"+'<button type="button" wmbutton="" class="btn app-button btn-primary saveNewRow" tabindex="0" accesskey="" title="Save">'+'<i aria-hidden="true" class="app-icon wi wi-done"></i>'+'<span class="sr-only">Save Icon</span><span class="btn-caption">Save</span>'+"</button>");$gridActions.find(".cancelNewRow").on("click",(function(event){self.toggleEditRow(event,{action:"cancel",$row:$newRow})}));$gridActions.find(".saveNewRow").on("click",(function(event){self.toggleEditRow(event,{action:"save",$row:$newRow})}));$newRowButton.hide()}else{$("typeahead-container").removeClass("open");$gridActions.find(".cancelNewRow").remove();$gridActions.find(".saveNewRow").remove();$newRowButton.show()}}},_isNewRow:function($row){var rowId=parseInt($row.attr("data-row-id"),10);return rowId>=this.preparedData.length||$row.hasClass("always-new-row")},toggleEditRow:function(e,options){options=options||{};if(e){e.stopPropagation()}this.closePopover();var $row=options.$row||$(e.target).closest("tr.app-datagrid-row"),$editButton=$row.find(".edit-row-button"),$cancelButton=$row.find(".cancel-edit-row-button"),$saveButton=$row.find(".save-edit-row-button"),$deleteButton=$row.find(".delete-row-button"),rowData=_.cloneDeep(this.options.data[$row.attr("data-row-id")])||{},self=this,action,isNewRow,$editableElements,isDataChanged=false,isValid,$requiredEls,alwaysNewRow=$row.hasClass("always-new-row"),advancedEdit=self.options.editmode===self.CONSTANTS.QUICK_EDIT,editOptions={};this.options.setActionRowIndex($row.attr("data-row-id"));this.options.setLastActionPerformed(this.options.ACTIONS.EDIT);function onSaveSuccess(skipFocus,error){if(_.isFunction(options.success)){options.success(skipFocus,error)}if(!advancedEdit||self.options.actionsEnabled.edit){self.focusActiveRow()}}if($row.attr("data-removed")==="true"){return}if(options.selectRow){this.selectRow(rowData,true)}e=e||{};e.data=e.data||{};action=e.data.action||options.action;if(action==="edit"){if(this.options.editmode===this.CONSTANTS.INLINE){this.options.callLoadInlineWidgetData()}if(advancedEdit&&self.gridElement.find("tr.app-datagrid-row.row-editing:not(.always-new-row)").length){self.saveRow((function(skipFocus,error){self.editSuccessHandler(skipFocus,error,e,$row,true)}));return}$row.addClass("row-editing");if(_.isFunction(this.options.beforeRowUpdate)){this.options.beforeRowUpdate(rowData,e)}if(self.options.editmode===self.CONSTANTS.FORM||self.options.editmode===self.CONSTANTS.DIALOG){return}if(options.operation==="new"){self.setDefaultRowData(rowData);self.toggleNewRowActions(true)}if(_.isFunction(this.options.onBeforeFormRender)){isValid=this.options.onBeforeFormRender(rowData,e,options.operation||action);if(isValid===false){return}}this._setGridEditMode(true);this.disableActions(true);$deleteButton.removeClass("disabled-action");this.options.runInNgZone((function(){self.makeRowEditable($row,rowData)}));$editButton.addClass("hidden");$cancelButton.removeClass("hidden");$saveButton.removeClass("hidden");$editableElements=$row.find("td.cell-editing");if(!options.skipFocus&&$editableElements){this.options.timeoutCall((function(){self.setFocusOnElement(e,$editableElements)}))}if(_.isFunction(this.options.onFormRender)){this.options.onFormRender($row,e,options.operation||action,$row.hasClass("always-new-row"))}}else{$editableElements=$row.find("td.cell-editing");isNewRow=self._isNewRow($row);if(action==="save"){if(isNewRow){isDataChanged=true}else{isDataChanged=this.isDataModified($editableElements,rowData,alwaysNewRow)}if(isDataChanged){$editableElements.each((function(){var $el=$(this),colId=$el.attr("data-col-id"),colDef=self.preparedHeaderData[colId],fields=_.split(colDef.field,"."),text;text=self.getTextValue(colDef.field,alwaysNewRow);if(fields.length===1&&colDef.editWidgetType==="upload"){_.set(rowData,colDef.field,self.getUploadedFiles($el,colDef.field))}else{text=(fields.length===1||isNewRow)&&text===""?undefined:text;if(self.Utils.isDefined(text)){text=text==="null"?null:text;if(text===null){if(fields.length>1){_.set(rowData,fields[0],text)}else{if(!isNewRow){_.set(rowData,colDef.field,"")}}}else{_.set(rowData,colDef.field,text)}}else{if(fields.length===1&&!isNewRow){_.set(rowData,colDef.field,text)}}}}));if($editableElements.find(".ng-pending").length>0){setTimeout(this.toggleEditRow.bind(this,e,options),200);return}$requiredEls=$editableElements.find(".ng-invalid");if($requiredEls.length>0){$requiredEls.each((function(index){var $invalidTd=$(this).closest("td.app-datagrid-cell");if(index===0){$invalidTd.find("[focus-target]").focus()}self.options.setTouched($invalidTd.find("[formcontrolname]").attr("formcontrolname"))}));if(_.isFunction(options.success)){options.success(false,true)}return}if(isNewRow&&advancedEdit&&_.isEmpty(rowData)){self.removeNewRow($row);if(_.isFunction(options.success)){options.success(false,undefined,true)}return}if(isNewRow){if(_.isFunction(this.options.onBeforeRowInsert)){isValid=this.options.onBeforeRowInsert(rowData,e,editOptions);if(isValid===false){return}}this.options.onRowInsert(rowData,e,onSaveSuccess,editOptions);self.toggleNewRowActions(false);if(!$row.hasClass("always-new-row")&&self.options.isNavTypeScrollOrOndemand()){self.removeNewRow($row)}}else{if(_.isFunction(this.options.onBeforeRowUpdate)){isValid=this.options.onBeforeRowUpdate(rowData,e,editOptions);if(isValid===false){return}}this.options.afterRowUpdate(rowData,e,onSaveSuccess,editOptions)}}else{this.cancelEdit($row);if(!options.noMsg){this.options.noChangesDetected()}if(_.isFunction(options.success)){options.success(false)}}}else{if(isNewRow){self.removeNewRow($row);return}this.cancelEdit($row)}}this.addOrRemoveScroll()},cancelEdit:function($row){var self=this,$editableElements=$row.find("td.cell-editing"),$cancelButton=$row.find(".cancel-edit-row-button"),$saveButton=$row.find(".save-edit-row-button"),$editButton=$row.find(".edit-row-button");this.options.clearActionRowIndex();this.disableActions(false);$row.removeClass("row-editing");$editableElements.off("click");$editableElements.each((function(){var $el=$(this),value=$el.data("originalValue");$el.removeClass("datetime-wrapper cell-editing required-field form-group");if(!value){$el.text($el.data("originalText")||"")}else{$el.html(self.options.getCustomExpression(value.fieldName,value.rowIndex))}}));$("typeahead-container").removeClass("open");$editButton.removeClass("hidden");$cancelButton.addClass("hidden");$saveButton.addClass("hidden");this._setGridEditMode(false)},closeEditedRow:function(){var $row=this.gridElement.find("tr.app-datagrid-row.row-editing");if($row.length){if(this._isNewRow($row)){this.removeNewRow($row)}else{this.cancelEdit($row)}}},hideRowEditMode:function($row){if($row.hasClass("always-new-row")&&this.options.isNavTypeScrollOrOndemand()){this.resetNewRow($row);return}var $editableElements=$row.find("td.cell-editing"),$editButton=$row.find(".edit-row-button"),$cancelButton=$row.find(".cancel-edit-row-button"),$saveButton=$row.find(".save-edit-row-button"),self=this;$row.removeClass("row-editing");$editableElements.off("click");this.disableActions(false);this._setGridEditMode(false);$editableElements.each((function(){var $el=$(this),value=$el.data("originalValue"),text,colDef;$el.removeClass("datetime-wrapper cell-editing required-field form-group");if(!value){colDef=self.preparedHeaderData[$el.attr("data-col-id")];text=self.getTextValue(colDef.field);$el.text(self.Utils.isDefined(text)?text:"")}else{$el.html(self.options.getCustomExpression(value.fieldName,value.rowIndex))}}));$editButton.removeClass("hidden");$cancelButton.addClass("hidden");$saveButton.addClass("hidden");this.addOrRemoveScroll()},deleteRow:function(e){e.stopPropagation();var $row=$(e.target).closest("tr.app-datagrid-row"),rowId=$row.attr("data-row-id"),rowData=this.options.data[rowId],isNewRow=this._isNewRow($row),className,isActiveRow,isValid,options={},self=this;this.options.setActionRowIndex(rowId);this.options.setLastActionPerformed(this.options.ACTIONS.DELETE);if(_.isFunction(this.options.beforeRowDelete)){this.options.beforeRowDelete(rowData,e)}if(isNewRow){this.disableActions(false);this._setGridEditMode(false);$row.attr("data-removed",true);$row.remove();if(!this.preparedData.length){this.setStatus("nodata",this.dataStatus.nodata)}this.addOrRemoveScroll();return}if(_.isFunction(this.options.onBeforeRowDelete)){isValid=this.options.onBeforeRowDelete(rowData,e,options);if(isValid===false){return}}if(_.isFunction(this.options.onRowDelete)){className=this.options.cssClassNames.deleteRow;isActiveRow=$row.attr("class").indexOf("active")!==-1;if(isActiveRow){$row.removeClass("active")}$row.addClass(className);this.options.onRowDelete(rowData,(function(){if(isActiveRow){$row.addClass("active")}$row.removeClass(className);self.addOrRemoveScroll()}),e,(function(skipFocus,error){if(self.options.isNavTypeScrollOrOndemand()){var rowId=+$(e.target).closest("tr.app-datagrid-row").attr("data-row-id");var $row=self.gridElement.find('tr.app-datagrid-row[data-row-id="'+rowId+'"]');self.options.setDeletedRowIndex(rowId);self.preparedData.splice(rowId,1);self.options.data.splice(rowId,1);self.gridElement.find("tr.app-datagrid-row:gt("+rowId+")").each((function(index,row){if(!$row.is(":last-child")&&!$(row).hasClass("always-new-row")){$(row).attr("data-row-id",rowId);self.preparedData[rowId].$$pk--;self.preparedData[rowId].$$index--;self.preparedData[rowId].$index--;rowId++}}));$row.remove()}if(self.options.editmode!==self.CONSTANTS.QUICK_EDIT||!($(e.target).hasClass("delete-row-button")||self.Utils.isDeleteKey(e))){return}self.__setStatus();var rowID,$nextRow;if(error){return}rowID=+$(e.target).closest("tr.app-datagrid-row").attr("data-row-id");$nextRow=self.gridElement.find('tr.app-datagrid-row[data-row-id="'+rowID+'"]');if(!$nextRow.length){$nextRow=self.gridElement.find('tr.app-datagrid-row[data-row-id="'+(rowID-1)+'"]')}$nextRow.trigger("click",[undefined,{action:"edit",skipFocus:skipFocus}])}),options)}},deleteRowAndUpdateSelectAll:function(e){this.deleteRow(e);this.updateSelectAllCheckboxState()},_deselectPreviousSelection:function($row,e){var selectedRows=this.gridElement.find("tr.app-datagrid-row.active"),rowId=$row.attr("data-row-id"),self=this;selectedRows.each((function(){var id=$(this).attr("data-row-id"),preparedData=self.preparedData[id];if(id!==rowId&&preparedData){$(this).find("input[rowSelectInput]:radio").prop("checked",false);preparedData._selected=preparedData._checked=false;$(this).removeClass("active");self.options.callOnRowDeselectEvent(preparedData,e)}}))},resetSortIcons:function($el){this.isResetSortIconsDone=true;var $sortContainer;if(!$el&&this.gridHeaderElement){$sortContainer=this.gridHeaderElement.find(".sort-buttons-container.active");$el=$sortContainer.find("i.sort-icon");$sortContainer.removeClass("active")}$el.removeClass("desc asc").removeClass(this.options.cssClassNames.descIcon).removeClass(this.options.cssClassNames.ascIcon)},setSortIconDefault:function(){const sortInfo=this.options.sortInfo,$e=this.tableContainer,$th=$e.find("[data-col-field='"+sortInfo.field+"']"),$sortContainer=$th.find(".sort-buttons-container"),$sortIcon=$sortContainer.find("i.sort-icon"),direction=sortInfo.direction;if(direction==="asc"){$sortIcon.addClass(direction+" "+this.options.cssClassNames.ascIcon);$sortContainer.addClass("active")}else if(direction==="desc"){$sortIcon.addClass(direction+" "+this.options.cssClassNames.descIcon);$sortContainer.addClass("active")}},sortHandler:function(e){e.stopImmediatePropagation();if($(e.target).hasClass("header-data")&&this.options.enableColumnSelection){this.headerClickHandler(e)}var $e=$(e.target),$th=$e.closest("th.app-datagrid-header-cell"),id=$th.attr("data-col-id"),$sortContainer=$th.find(".sort-buttons-container"),$sortIcon=$sortContainer.find("i.sort-icon"),direction=$sortIcon.hasClass("asc")?"desc":"asc",sortInfo=this.options.sortInfo,$previousSortMarker=this.gridHeaderElement.find(".sort-buttons-container.active"),field=$th.attr("data-col-field"),$previousSortedColumn,$previousSortIcon,colId,colDef;this.resetSortIcons($sortIcon);$sortIcon.addClass(direction);if(direction==="asc"){$sortIcon.addClass(this.options.cssClassNames.ascIcon);$sortContainer.addClass("active")}else if(direction==="desc"){$sortIcon.addClass(this.options.cssClassNames.descIcon);$sortContainer.addClass("active")}if($previousSortMarker.length){$previousSortedColumn=$previousSortMarker.closest("th.app-datagrid-header-cell");colId=$previousSortedColumn.attr("data-col-id");colDef=this.preparedHeaderData[colId];$previousSortIcon=$previousSortMarker.find("i.sort-icon");if(colDef.field!==field){$previousSortMarker.removeClass("active");this.resetSortIcons($previousSortIcon)}colDef.sortInfo={sorted:false,direction:""}}sortInfo.direction=direction;sortInfo.field=field;if(direction!==""){this.preparedHeaderData[id].sortInfo={sorted:true,direction:direction}}this._setGridEditMode(false);this.closeEditedRow();this.options.sortHandler.call(this,this.options.sortInfo,e,"sort")},processUpDownKeys:function(event,$row,direction){var self=this;var rowData=$row.find("input").val();if($row.hasClass("row-editing")&&self.options.editmode===self.CONSTANTS.QUICK_EDIT&&rowData){self.toggleEditRow(event,{action:"save",noMsg:true,success:function(skipFocus,error){self.editSuccessHandler(skipFocus,error,event,$row,true,direction)}})}else{$row=direction==="down"?$row.next():$row.prev();if(this.options.rowExpansionEnabled&&!$row.is(":visible")){$row=direction==="down"?$row.next():$row.prev()}$row.focus()}},resetNewRow:function($row){var rowData={},self=this;this.options.clearForm(true);self.setDefaultRowData(rowData);$row.find("[data-field-name]").each((function(){var $input=$(this),fieldName=$input.attr("data-field-name")+"_new";self.options.setFieldValue(fieldName,rowData[$input.attr("data-field-name")]||"")}));self.options.safeApply();self.setFocusOnElement(undefined,$row,true)},_onEnter:function($target,$row,quickEdit,event){var self=this;if($target.is("button")){return}if(quickEdit&&$target.hasClass("app-datagrid-row")&&!$target.hasClass("row-editing")){$row.trigger("click",[undefined,{action:"edit"}])}else{if($row.hasClass("row-editing")&&$target.closest("[data-field-name]").length){$target.blur();self.toggleEditRow(event,{action:"save",success:function(skipFocus,error){if(error){$target.focus()}else{self.focusActiveRow();self.focusNewRow()}}})}else{$row.trigger("click");if(quickEdit&&$target.hasClass("always-new-row")&&$target.hasClass("row-editing")){self.focusNewRow()}}}if(!$target.is("button")){event.stopPropagation()}},onKeyDown:function(event){var $target=$(event.target),$row=$target.closest("tr.app-datagrid-row"),self=this,quickEdit=this.options.editmode===this.CONSTANTS.QUICK_EDIT,isNewRow;if(this.options.rowExpansionEnabled&&!$row.length){$row=$target.closest("tr.app-datagrid-detail-row")}if(this.Utils.isDeleteKey(event)){if(!this.options.actionsEnabled.delete||$target.is("input")||$target.hasClass("form-control")){return}this.deleteRow(event);return}if(event.which===27){isNewRow=this._isNewRow($row);if(isNewRow&&$row.hasClass("always-new-row")){$target.blur();self.resetNewRow($row)}else{$row.trigger("click",[undefined,{action:"cancel"}])}if(!isNewRow){$row.focus()}return}if(event.which===13){event.stopPropagation();this._debounceOnEnter($target,$row,quickEdit,event);return}if(event.which===38){this.processUpDownKeys(event,$row,"up");return}if(event.which===40){this.processUpDownKeys(event,$row,"down")}},editSuccessHandler:function(skipFocus,error,e,$row,isSameRow,direction){var self=this,rowID,$nextRow;self.__setStatus();if(error){self.setFocusOnElement(e);return}rowID=+$row.attr("data-row-id");if(direction){rowID=direction==="down"?++rowID:--rowID;$nextRow=self.gridElement.find('tr.app-datagrid-row[data-row-id="'+rowID+'"]');if($nextRow.length){$nextRow.focus()}else{$row.focus()}return}if(!isSameRow&&!_.isUndefined(isSameRow)){rowID++}$nextRow=self.gridElement.find('tr.app-datagrid-row[data-row-id="'+rowID+'"]');if($nextRow.hasClass("always-new-row")){if(self.options.formPosition!=="top"||$row.hasClass("always-new-row")){self.addNewRow(skipFocus)}}else if($nextRow.length){$nextRow.trigger("click",[undefined,{action:"edit",skipFocus:skipFocus,skipSelect:self.options.multiselect}])}else if(self.options.actionsEnabled.new){self.addNewRow(skipFocus)}},isLastColumn:function($target){var $cell=$target.closest("td.app-datagrid-cell"),$editCells;if($cell.is(":last-child")){return true}if($cell.hasClass("cell-editing")){$editCells=$cell.closest("tr.app-datagrid-row").find(".cell-editing").has('> :not([disabled="disabled"])');return $cell.attr("data-col-id")===$editCells.last().attr("data-col-id")}return false},getColInfo:function(event){var row=$(event.target).closest("tr.app-datagrid-row");var rowId=row.attr("data-row-id");var column=$(event.target).closest("td.app-datagrid-cell");var colId=column.attr("data-col-id");if(this.columnClickInfo&&this.columnClickInfo[rowId]&&this.columnClickInfo[rowId][colId]){return this.columnClickInfo[rowId][colId]}return false},attachEventHandlers:function($htm){var $header=this.gridHeaderElement,self=this;if(this.options.enableRowSelection){$htm[0].removeEventListener("click",this.rowClickHandlerOnCapture.bind(this));$htm.off();$htm[0].addEventListener("click",this.rowClickHandlerOnCapture.bind(this));$htm.on("click",this.rowSelectionHandler.bind(this));$htm.on("click","td *",(function(event){if(event.target.type!="checkbox"){var row=$(event.target).closest("tr.app-datagrid-row");var rowId=row.attr("data-row-id");var column=$(event.target).closest("td.app-datagrid-cell");var colId=column.attr("data-col-id");self.columnClickInfo[rowId]={};self.columnClickInfo[rowId][colId]=true}}));$htm.on("dblclick",this.rowDblClickHandler.bind(this));$htm.on("keydown",this.onKeyDown.bind(this))}if($header){if(this.options.enableColumnSelection){$header.find("th[data-col-selectable]").off("click",this.columnSelectionHandler.bind(this));$header.find("th[data-col-selectable]").on("click",this.columnSelectionHandler.bind(this))}else{$header.find("th[data-col-selectable]").off("click")}if(this.options.enableSort){if(this.options.enableColumnSelection){$header.find("th[data-col-sortable] .header-data").off("click",this.sortHandler.bind(this));$header.find("th[data-col-sortable] .header-data").on("click",this.sortHandler.bind(this))}else{$header.find("th[data-col-sortable]").off("click",this.sortHandler.bind(this));$header.find("th[data-col-sortable]").on("click",this.sortHandler.bind(this))}}else{if(this.options.enableColumnSelection){$header.find("th[data-col-sortable] .header-data").off("click")}else{$header.find("th[data-col-sortable]").off("click")}}}if(this.options.rowActions.length){$htm.find(".cancel-edit-row-button").off("click");$htm.find(".save-edit-row-button").off("click");$htm.find(".cancel-edit-row-button").on("click",{action:"cancel"},this.toggleEditRow.bind(this));$htm.find(".save-edit-row-button").on("click",{action:"save"},this.toggleEditRow.bind(this))}if(self.options.editmode===self.CONSTANTS.QUICK_EDIT){$htm.on("focusout","tr.app-datagrid-row",(function(e){var $target=$(e.target),$row=$target.closest("tr.app-datagrid-row"),$relatedTarget=$(e.relatedTarget),isLastColumn=self.isLastColumn($target,$relatedTarget),isTargetRowAction=$target.closest("span.actions-column").length>0,isRelatedTargetRowAction=$relatedTarget.closest("span.actions-column").length>0,isTargetGridAction=$relatedTarget.closest("div.app-datagrid-actions").length>0,isRelatedTargetGridAction=$relatedTarget.closest("div.app-datagrid-actions").length>0,invalidTargets='.row-editing:not(".always-new-row"), .row-action-button, .app-datagrid-cell, .caption, button.btn-time, button.btn-date';function isInvalidTarget(){if(!$relatedTarget.closest(".app-grid").length){return true}return $relatedTarget.is(invalidTargets)}if($relatedTarget.is("tr.app-datagrid-row")){if($relatedTarget.attr("data-row-id")===$row.attr("data-row-id")){return}}if(isRelatedTargetRowAction||$row.hasClass("danger")||isRelatedTargetGridAction||isTargetRowAction&&isRelatedTargetRowAction||isTargetRowAction&&e.relatedTarget===null||isInvalidTarget()||$relatedTarget.attr("focus-target")===""){return}if(!isTargetGridAction&&!isTargetRowAction){if(!isLastColumn||isLastColumn&&e.relatedTarget===null||$target.hasClass("file-upload")){return}}self.options.timeoutCall((function(){self.toggleEditRow(e,{action:"save",noMsg:true,success:function(skipFocus,error,isNewRow){if(!isNewRow){self.editSuccessHandler(skipFocus,error,e,$row)}}})}))}))}$htm.find('[data-identifier="rowExpansionButtons"]').off("click");$htm.find('[data-identifier="rowExpansionButtons"]').on("click",(function(e){var $row=$(e.target).closest("tr.app-datagrid-row");if($(this).find(".app-button").attr("disabled")){return}self.toggleExpandRow(+$row.attr("data-row-id"),undefined,e)}))},expandRow:function(rowId){this.toggleExpandRow(rowId,true)},collapseRow:function(rowId){this.toggleExpandRow(rowId,false)},_collapseRow:function(e,rowData,rowId,$nextDetailRow,$icon){var self=this,$tbody=self.gridElement,$row=$($tbody.find('> tr.app-datagrid-row[data-row-id="'+rowId+'"]'));$row.removeClass(self.options.cssClassNames.expandedRowClass);$row.find("button, a").attr("aria-expanded","false").attr("aria-live","polite");if(this.options.onBeforeRowCollapse(e,rowData,rowId)===false){return}if($icon.length&&$icon.hasClass(this.options.cssClassNames.rowExpandIcon)){$icon.removeClass(this.options.cssClassNames.rowExpandIcon).addClass(this.options.cssClassNames.rowCollapseIcon)}$nextDetailRow.hide();this.options.onRowCollapse(e,rowData)},toggleExpandRow:function(rowId,isExpand,e){var self=this,$tbody=self.gridElement,$row=$($tbody.find('> tr.app-datagrid-row[data-row-id="'+rowId+'"]')),rowData=_.clone(self.options.data[rowId]),$nextDetailRow=$row.next("tr.app-datagrid-detail-row"),isClosed=!$nextDetailRow.is(":visible"),$icon=$row.find('[data-identifier="rowExpansionButtons"] i.app-icon');rowData.$index=rowId+1;if(isExpand&&!isClosed){return}if(isExpand===false&&isClosed){return}if(isClosed){$row.addClass(self.options.cssClassNames.expandedRowClass);$row.find("button, a").attr("aria-expanded","true");if(e&&self.preparedData[rowId]._selected){e.stopPropagation()}if(self.options.rowDef.closeothers){$tbody.find("> tr.app-datagrid-detail-row:visible").each((function(){var $otherDetailRow=$(this),$otherIcon=$otherDetailRow.prev("tr.app-datagrid-row").find('[data-identifier="rowExpansionButtons"] i.app-icon'),otherRowId=+$otherDetailRow.attr("data-row-id"),otherRowData=self.options.data[otherRowId];$otherDetailRow.hide();self._collapseRow(e,otherRowData,otherRowId,$otherDetailRow,$otherIcon)}))}self.options.generateRowDetailView(e,rowData,rowId,$nextDetailRow.find("td.app-datagrid-row-details-cell .details-section"),$nextDetailRow.find("td.app-datagrid-row-details-cell .row-overlay"),(function(){if($icon.length&&$icon.hasClass(self.options.cssClassNames.rowCollapseIcon)){$icon.removeClass(self.options.cssClassNames.rowCollapseIcon).addClass(self.options.cssClassNames.rowExpandIcon)}$nextDetailRow.show()}))}else{self._collapseRow(e,rowData,rowId,$nextDetailRow,$icon)}},_findAndReplaceCompiledTemplates:function(){if(!this.gridElement){return}var $compiledCells=this.gridElement.find("td[data-compiled-template]"),self=this;$compiledCells.each((function(){var $cell=$(this),id=$cell.attr("data-compiled-template");$cell.replaceWith(self.compiledCellTemplates[id])}))},_renderSearch:function(){var $htm=$(this._getSearchEl()),self=this,$searchBox;function search(e){e.stopPropagation();var searchText=$htm.find('[data-element="dgSearchText"]')[0].value,$filterField=$htm.find('[data-element="dgFilterValue"]'),field=$filterField[0].value,colDefIndex=$htm.find("option:selected").attr("data-coldef-index"),colDef=self.options.colDefs[colDefIndex],type=colDef&&colDef.type?colDef.type:"";self.searchObj={field:field,value:searchText,type:type,event:e};self.options.searchHandler.call(self,self.searchObj,e,"search")}this.element.find(".form-search").remove();$htm.insertBefore(this.gridContainer);this.gridSearch=this.element.find(".form-search");$searchBox=this.gridSearch.find('[data-element="dgSearchText"]');this.gridSearch.find(".app-search-button").on("click",search);this.gridSearch.find('[data-element="dgFilterValue"]').on("change",(function(e){if(self.dataStatusContainer.find(".status").text()===self.options.dataStates.nodata){search(e)}}));$searchBox.on("keyup",(function(e){e.stopPropagation();if(!$(this).val()){self.emptySearch=true;if(self.searchObj.value){self.searchObj.value="";search(e)}}else{self.emptySearch=false}if(e.which===13||self.options.filteronkeypress){search(e)}}))},_renderRowFilter:function(){var $row=$('<tr class="filter-row"></tr>'),self=this,$headerElement=this.options.isMobile&&!this.options.showHeader?this.gridElement:this.gridHeaderElement;$headerElement.find(".filter-row").remove();this.options.generateFilterRow();this.preparedHeaderData.forEach((function(field,index){var fieldName=field.field,$th=$('<th data-col-id="'+index+'"></th>');if(!field.searchable){$row.append($th);return}$th.append(self.options.getFilterWidget(fieldName));$row.append($th)}),this);if(this.options.showHeader){this.gridHeaderElement.append($row)}else{if(this.options.isMobile){$headerElement.empty().append($row)}else{$headerElement.empty().append($row)}}this.gridSearch=$headerElement.find(".filter-row")},_renderHeader:function(){var headerTemplate=this._getHeaderTemplate(),$colgroup=headerTemplate.colgroup,self=this,$header;this.gridElement.parent().scroll((function(){self.gridHeaderElement.parent().prop("scrollLeft",this.scrollLeft)}));if(!this.options.showHeader){this.tableContainer.append($colgroup);this.gridHeaderElement.hide();return}else{this.gridHeaderElement.show()}$header=headerTemplate.header;function toggleSelectAll(e){var $checkboxes=$('tr.app-datagrid-row:visible td input[name="gridMultiSelect"]:checkbox',self.gridElement),checked=this.checked;$checkboxes.prop("checked",checked);$checkboxes.each((function(){var $row=$(this).closest("tr.app-datagrid-row"),rowId=$row.attr("data-row-id"),rowData=self.options.data[rowId];self.options.assignSelectedItems(rowData,e);self.toggleRowSelection($row,checked,e,true);if(checked&&_.isFunction(self.options.onRowSelect)){self.options.onRowSelect(rowData,e)}if(!checked&&_.isFunction(self.options.onRowDeselect)){self.options.onRowDeselect(rowData,e)}}))}var headerCells=$header.find("th.app-datagrid-header-cell");var headerCols=$colgroup.find("col");headerCells.each((function(){var id=Number($(this).attr("data-col-id")),colDef=self.preparedHeaderData[id],$headerCol=$(headerCols[id]);if(!colDef){return}if(!_.isUndefined(colDef.show)&&!colDef.show){$(this).hide();$headerCol.hide()}}));if(this.options.isMobile){this.tableContainer.append($colgroup)}else{this.tableContainer.append($colgroup)}$header.on("click",".app-datagrid-header-cell input:checkbox",toggleSelectAll);if(_.isFunction(this.options.onHeaderClick)){this.gridHeaderElement.find("th.app-datagrid-header-cell").on("click",this.headerClickHandler.bind(this))}if(!this.options.isMobile&&this.gridHeaderElement.length){this.gridHeaderElement.find("th[data-col-resizable]").resizable({handles:"e",minWidth:50,resize:function(evt,ui){var $colElement,$colHeaderElement,$cellElements,colIndex=+ui.helper.attr("data-col-id")+1,originalWidth=ui.helper.width(),newWidth=ui.size.width,originalTableWidth,newTableWidth;$colHeaderElement=self.tableContainer.find("colgroup > col:nth-child("+colIndex+")");$colElement=self.tableContainer.find("colgroup > col:nth-child("+colIndex+")");$cellElements=self.gridElement.find("tr.app-datagrid-row > td:nth-child("+colIndex+") > div");$colElement.width(newWidth);$colHeaderElement.width(newWidth);$cellElements.width(newWidth);$(this).css("height","auto");if(newWidth>ui.originalSize.width){originalTableWidth=self.gridHeaderElement.width();newTableWidth=originalTableWidth+newWidth-originalWidth;self.gridHeaderElement.width(newTableWidth);self.gridElement.width(newTableWidth)}self.addOrRemoveScroll();self.options.redrawWidgets()}})}if(!this.isResetSortIconsDone){this.setSortIconDefault()}},addOrRemoveScroll:function(){var gridContent=this.gridContainer.find("tbody"),gridHeader=this.gridContainer.find(".table-header");if(gridContent.scrollHeight>gridContent.clientHeight&&!this.Utils.isMac()){gridHeader.addClass("scroll-visible")}else{gridHeader.removeClass("scroll-visible")}},_handleCustomEvents:function(e,options){this.options.handleCustomEvents(e,options)},_setActionsEnabled:function(){var self=this;_.forEach(this.options.rowActions,(function(def){if(_.includes(def.action,"editRow(")){self.options.actionsEnabled.edit=true}else if(_.includes(def.action,"deleteRow(")){self.options.actionsEnabled.delete=true}}))},_appendRowActions:function($htm,isNewRow,rowData){var self,rowOperationsCol=this._getRowActionsColumnDef();if(this.options.rowActions.length||rowOperationsCol){this._setActionsEnabled();self=this;$htm.find("[data-identifier='actionButtons']").each((function(index){var _rowData,$row,rowId,rowIndex=index;if(isNewRow){_rowData=rowData}else{$row=$(this).closest("tr.app-datagrid-row");rowId=parseInt($row.attr("data-row-id"),10);_rowData=_.clone(self.options.data[rowId]);_rowData.$index=rowIndex+1}self.options.generateRowActions(_rowData,rowIndex);$(this).empty().append(self.options.getRowAction(rowIndex))}))}},_renderGrid:function(isCreated){var $htm,isScrollorOnDemand=this.options.isNavTypeScrollOrOndemand(),pageStartIndex=this.getPageStartIndex();$("table.table-bordered").parents(".app-grid-header-inner").addClass("table_border");if(isScrollorOnDemand){var $tbody=this.gridElement;var template=this._getGridTemplate();$htm=$(template);if(template&&!$tbody.length){this.gridElement.append($htm)}}else{var templates=this._getGridTemplate();$htm=$(templates);if(templates){this.gridElement.append($htm)}}if(this.options.summaryRow){var $summaryRowHtm=$(this._getSummaryRowTemplate());this.tableContainer.find("tfoot").remove();if(this.options.data.length){this.tableContainer.append($summaryRowHtm)}}if(!this.options.data.length&&this.dataStatus.state==="nodata"){this.setStatus("nodata")}else{this.dataStatus.state=this.dataStatus.state||"loading";this.dataStatus.message=this.dataStatus.message||this.options.dataStates.loading;this.setStatus(this.dataStatus.state,this.dataStatus.message,isCreated)}this.gridBody=this.gridElement.find("tbody");this.gridFooter=this.tableContainer.find("tfoot");this._findAndReplaceCompiledTemplates();this.options.clearRowActions();this._appendRowExpansionButtons($htm);this._appendRowActions($htm);this.attachEventHandlers($htm);this.__setStatus(isCreated);if(this.options.editmode===this.CONSTANTS.QUICK_EDIT&&this.options.showNewRow){this.addNewRow(false,true)}if(isCreated){this._setColSpan(this.options.headerConfig)}if(_.isFunction(this.options.onDataRender)){this.options.onDataRender()}if(!isCreated&&this.options.selectFirstRow){if(this.options.multiselect){this.options.selectFirstRow=false}if(this.gridElement.find("tr.app-datagrid-row.active").length<=0){this.selectFirstRow(true,true)}}},_render:function(isCreated){if(!this.tableId){this.tableId=this.Utils.generateGuid()}var overflow=this.options.isNavTypeScrollOrOndemand()&&(this.options.height==="100%"||this.options.height==="auto")?"hidden":"auto";var statusContainer='<div class="overlay">'+'<div class="status"><i class="'+this.options.loadingicon+'"></i><span class="message"></span></div>'+"</div>",table='<div class="table-container table-responsive">'+'<div class="app-grid-header">'+'<div class="app-grid-header-inner">'+'<table tabindex="0" class="'+this.options.cssClassNames.gridDefault+" "+this.options.cssClassNames.grid+'">'+'<thead tabindex="0" class="table-header thead-sticky" id="table_header_'+this.tableId+'">'+'</thead><tbody class="app-grid-content app-datagrid-body" id="table_'+this.tableId+'">'+"</tbody></table>"+"</div></div></div>",$statusContainer=$(statusContainer),$tableContainer=this.element.find(".table-container");this.gridContainer=$(table);this.gridHeaderElement=this.gridContainer.find(".table-header");this._setStyles($statusContainer.find("div.overlay"),"display:none");this._setStyles(this.gridContainer.find("div.app-grid-header-inner"),"height:"+this.options.height+"; overflow: auto;");this.tableContainer=this.gridContainer.find("table");this.gridElement=this.gridContainer.find(".app-grid-content");if(this.options.isNavTypeScrollOrOndemand()&&(!$tableContainer.length||!this.options.isNextPageData)||!this.options.isNavTypeScrollOrOndemand()){this.element.find(".table-container").remove();this.element.append(this.gridContainer)}this.options.setIsNextPageData(false);if(!this.gridContainer.find(".overlay").length){this.dataStatusContainer=$(statusContainer);this.gridContainer.append(this.dataStatusContainer)}if(this.gridHeaderElement){this.gridHeaderElement.empty();this.gridElement.find("colgroup").remove()}this._renderHeader();if(this.options.filtermode===this.CONSTANTS.SEARCH&&(_.isEmpty(this.searchObj)||this.searchObj&&!this.searchObj.field&&!this.searchObj.value)){this._renderSearch()}else if(this.options.filtermode===this.CONSTANTS.MULTI_COLUMN){this._renderRowFilter()}if(this.options.spacing==="condensed"){this._toggleSpacingClasses("condensed")}this._renderGrid(isCreated);this.addNavigationControls()},addNavigationControls:function(){if(this.options.isdynamictable){this.element.find(".on-demand-datagrid").remove();if(this.options.navigation==="On-Demand"&&!this.element.find(".on-demand-datagrid").length){this.options.addLoadMoreBtn()}else if(this.options.navigation==="Scroll"){this.options.bindScrollEvt()}}},__setStatus:function(isCreated){var loadingIndicator=this.dataStatusContainer.find("i"),state=this.dataStatus.state,isScrollOrOndemand=this.options.isNavTypeScrollOrOndemand();this.dataStatusContainer.find(".message").text(this.dataStatus.message);if(state==="loading"){loadingIndicator.removeClass("hidden")}else{loadingIndicator.addClass("hidden")}if(state==="ready"){this.dataStatusContainer.hide()}else{if(this.options.isNavTypeScrollOrOndemand()&&(state==="nodata"||this.options.getCurrentPage()==this.options.getPageCount()&&!this.options.showviewlessbutton)){this.element.find(".on-demand-datagrid a").hide()}this.dataStatusContainer.show()}if(state==="nodata"||state==="loading"||state==="error"){if(this.options.height==="100%"||this.options.height==="auto"){if(state==="nodata"){this.dataStatusContainer.css("height","auto");this.dataStatus.contentHeight=0}else if(this.options.isNavTypeScrollOrOndemand()&&this.options.getCurrentPage()>1){this.dataStatusContainer.hide()}else{this.dataStatus.height=this.dataStatus.height||this.dataStatusContainer.outerHeight();this.dataStatus.contentHeight=this.gridElement.outerHeight()||this.dataStatus.contentHeight;this.dataStatusContainer.css("height",this.dataStatus.height>this.dataStatus.contentHeight?"auto":this.dataStatus.contentHeight)}}if(!isScrollOrOndemand||isScrollOrOndemand&&this.options.getCurrentPage()===1){this.gridContainer.addClass("show-msg")}}else{this.gridContainer.removeClass("show-msg");if(this.options.editmode===this.CONSTANTS.QUICK_EDIT){if(this.options.activeRow){this.attachHandlersToActiveRow(this.options.activeRow)}this.options.activeRow=undefined}}if(!isCreated){this.setColGroupWidths()}this.addOrRemoveScroll()},attachHandlersToActiveRow(rowObj){var rowIndex=this.Utils.getObjectIndex(this.options.data,rowObj);var row=this.gridElement.find("tr.app-datagrid-row[data-row-id="+rowIndex+"]");if(!row.length){return}else if(!row.hasClass("active")){row.addClass("active")}this.focusActiveRow();this.attachEventHandlers(row)},setActiveRow(row){this.options.activeRow=row},setStatus:function(state,message,isCreated){var $newRow;if(state==="nodata"){$newRow=this.gridElement&&this.gridElement.find("tr.app-datagrid-row.always-new-row");state=$newRow&&$newRow.length?"ready":state}this.dataStatus.state=state;this.options.setGridState(state);this.dataStatus.message=message||this.options.dataStates[state];if(this._setStatusCalled){this._setStatus(isCreated)}else{this.__setStatus(isCreated);this._setStatusCalled=true}},setGridDimensions:function(key,value){if(value.indexOf("px")===-1&&value.indexOf("%")===-1&&value.indexOf("em")===-1&&value!="auto"){value=value+"px"}this.options[key]=value;if(key==="height"){var elements=this.gridHeaderElement.find("th");this.gridContainer.find(".app-grid-header-inner").css(key,value);if(this.options.isNavTypeScrollOrOndemand()&&(this.options.height!="100%"&&this.options.height!="auto")){this.gridContainer.find(".app-grid-header-inner").css("overflow","auto")}this.dataStatusContainer.css(key,value)}this.addOrRemoveScroll()},setColumnProp:function(fieldName,property,val,isGroup){var $col;if(property==="displayName"){if(isGroup){$col=this.gridHeaderElement.find('th[data-col-group="'+fieldName+'"]')}else{$col=this.gridHeaderElement.find('th[data-col-field="'+fieldName+'"]')}$col.attr("title",val);$col.find(".header-data").html(val);if(this.options.filtermode===this.CONSTANTS.SEARCH&&this.gridSearch){this.gridSearch.find('select option[value="'+fieldName+'"]').text(val)}}},applyRowNgClass:function(val,index){var $row=this.gridElement.find('tr.app-datagrid-row[data-row-id="'+index+'"]');$row.removeClass(val.toRemove);$row.addClass(val.toAdd)},applyColNgClass:function(val,rowIndex,colIndex){var $cell=this.gridElement.find('tr.app-datagrid-row[data-row-id="'+rowIndex+'"] td.app-datagrid-cell[data-col-id="'+colIndex+'"]');$cell.removeClass(val.toRemove);$cell.addClass(val.toAdd)},_destroy:function(){this.element.text("");window.clearTimeout(this.refreshGridTimeout)}});(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?factory(exports,require("rxjs")):typeof define==="function"&&define.amd?define(["exports","rxjs"],factory):(global=typeof globalThis!=="undefined"?globalThis:global||self,factory((global.awesomeCordova=global.awesomeCordova||{},global.awesomeCordova.core={}),global.rxjs))})(this,(function(exports,rxjs){"use strict";function checkReady(){if(typeof process==="undefined"){var win_1=typeof window!=="undefined"?window:{};var DEVICE_READY_TIMEOUT_1=5e3;var before_1=Date.now();var didFireReady_1=false;win_1.document.addEventListener("deviceready",(function(){console.log("Ionic Native: deviceready event fired after "+(Date.now()-before_1)+" ms");didFireReady_1=true}));setTimeout((function(){if(!didFireReady_1&&win_1.cordova){console.warn("Ionic Native: deviceready did not fire within "+DEVICE_READY_TIMEOUT_1+"ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.")}}),DEVICE_READY_TIMEOUT_1)}}var ERR_CORDOVA_NOT_AVAILABLE={error:"cordova_not_available"};var ERR_PLUGIN_NOT_INSTALLED={error:"plugin_not_installed"};function getPromise(callback){var tryNativePromise=function(){if(Promise){return new Promise((function(resolve,reject){callback(resolve,reject)}))}else{console.error("No Promise support or polyfill found. To enable Ionic Native support, please add the es6-promise polyfill before this script, or run with a library like Angular or on a recent browser.")}};if(typeof window!=="undefined"&&window.angular){var doc=window.document;var injector=window.angular.element(doc.querySelector("[ng-app]")||doc.body).injector();if(injector){var $q=injector.get("$q");return $q((function(resolve,reject){callback(resolve,reject)}))}console.warn("Angular 1 was detected but $q couldn't be retrieved. This is usually when the app is not bootstrapped on the html or body tag. Falling back to native promises which won't trigger an automatic digest when promises resolve.")}return tryNativePromise()}function wrapPromise(pluginObj,methodName,args,opts){if(opts===void 0){opts={}}var pluginResult,rej;var p=getPromise((function(resolve,reject){if(opts.destruct){pluginResult=callCordovaPlugin(pluginObj,methodName,args,opts,(function(){var args=[];for(var _i=0;_i<arguments.length;_i++){args[_i]=arguments[_i]}return resolve(args)}),(function(){var args=[];for(var _i=0;_i<arguments.length;_i++){args[_i]=arguments[_i]}return reject(args)}))}else{pluginResult=callCordovaPlugin(pluginObj,methodName,args,opts,resolve,reject)}rej=reject}));if(pluginResult&&pluginResult.error){p.catch((function(){}));typeof rej==="function"&&rej(pluginResult.error)}return p}function wrapOtherPromise(pluginObj,methodName,args,opts){if(opts===void 0){opts={}}return getPromise((function(resolve,reject){var pluginResult=callCordovaPlugin(pluginObj,methodName,args,opts);if(pluginResult){if(pluginResult.error){reject(pluginResult.error)}else if(pluginResult.then){pluginResult.then(resolve).catch(reject)}}else{reject({error:"unexpected_error"})}}))}function wrapObservable(pluginObj,methodName,args,opts){if(opts===void 0){opts={}}return new rxjs.Observable((function(observer){var pluginResult;if(opts.destruct){pluginResult=callCordovaPlugin(pluginObj,methodName,args,opts,(function(){var args=[];for(var _i=0;_i<arguments.length;_i++){args[_i]=arguments[_i]}return observer.next(args)}),(function(){var args=[];for(var _i=0;_i<arguments.length;_i++){args[_i]=arguments[_i]}return observer.error(args)}))}else{pluginResult=callCordovaPlugin(pluginObj,methodName,args,opts,observer.next.bind(observer),observer.error.bind(observer))}if(pluginResult&&pluginResult.error){observer.error(pluginResult.error);observer.complete()}return function(){try{if(opts.clearFunction){if(opts.clearWithArgs){return callCordovaPlugin(pluginObj,opts.clearFunction,args,opts,observer.next.bind(observer),observer.error.bind(observer))}return callCordovaPlugin(pluginObj,opts.clearFunction,[])}}catch(e){console.warn("Unable to clear the previous observable watch for",pluginObj.constructor.getPluginName(),methodName);console.warn(e)}}}))}function wrapEventObservable(event,element){element=typeof window!=="undefined"&&element?get$1(window,element):element||(typeof window!=="undefined"?window:{});return rxjs.fromEvent(element,event)}function checkAvailability(plugin,methodName,pluginName){var pluginRef,pluginPackage;if(typeof plugin==="string"){pluginRef=plugin}else{pluginRef=plugin.constructor.getPluginRef();pluginName=plugin.constructor.getPluginName();pluginPackage=plugin.constructor.getPluginInstallName()}var pluginInstance=getPlugin(pluginRef);if(!pluginInstance||!!methodName&&typeof pluginInstance[methodName]==="undefined"){if(typeof window==="undefined"||!window.cordova){cordovaWarn(pluginName,methodName);return ERR_CORDOVA_NOT_AVAILABLE}pluginWarn(pluginName,pluginPackage,methodName);return ERR_PLUGIN_NOT_INSTALLED}return true}function instanceAvailability(pluginObj,methodName){return pluginObj._objectInstance&&(!methodName||typeof pluginObj._objectInstance[methodName]!=="undefined")}function setIndex(args,opts,resolve,reject){if(opts===void 0){opts={}}if(opts.sync){return args}if(opts.callbackOrder==="reverse"){args.unshift(reject);args.unshift(resolve)}else if(opts.callbackStyle==="node"){args.push((function(err,result){if(err){reject(err)}else{resolve(result)}}))}else if(opts.callbackStyle==="object"&&opts.successName&&opts.errorName){var obj={};obj[opts.successName]=resolve;obj[opts.errorName]=reject;args.push(obj)}else if(typeof opts.successIndex!=="undefined"||typeof opts.errorIndex!=="undefined"){var setSuccessIndex=function(){if(opts.successIndex>args.length){args[opts.successIndex]=resolve}else{args.splice(opts.successIndex,0,resolve)}};var setErrorIndex=function(){if(opts.errorIndex>args.length){args[opts.errorIndex]=reject}else{args.splice(opts.errorIndex,0,reject)}};if(opts.successIndex>opts.errorIndex){setErrorIndex();setSuccessIndex()}else{setSuccessIndex();setErrorIndex()}}else{args.push(resolve);args.push(reject)}return args}function callCordovaPlugin(pluginObj,methodName,args,opts,resolve,reject){if(opts===void 0){opts={}}args=setIndex(args,opts,resolve,reject);var availabilityCheck=checkAvailability(pluginObj,methodName);if(availabilityCheck===true){var pluginInstance=getPlugin(pluginObj.constructor.getPluginRef());return pluginInstance[methodName].apply(pluginInstance,args)}else{return availabilityCheck}}function callInstance(pluginObj,methodName,args,opts,resolve,reject){if(opts===void 0){opts={}}args=setIndex(args,opts,resolve,reject);if(instanceAvailability(pluginObj,methodName)){return pluginObj._objectInstance[methodName].apply(pluginObj._objectInstance,args)}}function getPlugin(pluginRef){if(typeof window!=="undefined"){return get$1(window,pluginRef)}return null}function get$1(element,path){var paths=path.split(".");var obj=element;for(var i=0;i<paths.length;i++){if(!obj){return null}obj=obj[paths[i]]}return obj}function pluginWarn(pluginName,plugin,method){if(method){console.warn("Native: tried calling "+pluginName+"."+method+", but the "+pluginName+" plugin is not installed.")}else{console.warn("Native: tried accessing the "+pluginName+" plugin but it's not installed.")}if(plugin){console.warn("Install the "+pluginName+" plugin: 'ionic cordova plugin add "+plugin+"'")}}function cordovaWarn(pluginName,method){if(typeof process==="undefined"){if(method){console.warn("Native: tried calling "+pluginName+"."+method+", but Cordova is not available. Make sure to include cordova.js or run in a device/simulator")}else{console.warn("Native: tried accessing the "+pluginName+" plugin but Cordova is not available. Make sure to include cordova.js or run in a device/simulator")}}}var wrap=function(pluginObj,methodName,opts){if(opts===void 0){opts={}}return function(){var args=[];for(var _i=0;_i<arguments.length;_i++){args[_i]=arguments[_i]}if(opts.sync){return callCordovaPlugin(pluginObj,methodName,args,opts)}else if(opts.observable){return wrapObservable(pluginObj,methodName,args,opts)}else if(opts.eventObservable&&opts.event){return wrapEventObservable(opts.event,opts.element)}else if(opts.otherPromise){return wrapOtherPromise(pluginObj,methodName,args,opts)}else{return wrapPromise(pluginObj,methodName,args,opts)}}};function wrapInstance(pluginObj,methodName,opts){if(opts===void 0){opts={}}return function(){var args=[];for(var _i=0;_i<arguments.length;_i++){args[_i]=arguments[_i]}if(opts.sync){return callInstance(pluginObj,methodName,args,opts)}else if(opts.observable){return new rxjs.Observable((function(observer){var pluginResult;if(opts.destruct){pluginResult=callInstance(pluginObj,methodName,args,opts,(function(){var args=[];for(var _i=0;_i<arguments.length;_i++){args[_i]=arguments[_i]}return observer.next(args)}),(function(){var args=[];for(var _i=0;_i<arguments.length;_i++){args[_i]=arguments[_i]}return observer.error(args)}))}else{pluginResult=callInstance(pluginObj,methodName,args,opts,observer.next.bind(observer),observer.error.bind(observer))}if(pluginResult&&pluginResult.error){observer.error(pluginResult.error)}return function(){try{if(opts.clearWithArgs){return callInstance(pluginObj,opts.clearFunction,args,opts,observer.next.bind(observer),observer.error.bind(observer))}return callInstance(pluginObj,opts.clearFunction,[])}catch(e){console.warn("Unable to clear the previous observable watch for",pluginObj.constructor.getPluginName(),methodName);console.warn(e)}}}))}else if(opts.otherPromise){return getPromise((function(resolve,reject){var result;if(opts.destruct){result=callInstance(pluginObj,methodName,args,opts,(function(){var args=[];for(var _i=0;_i<arguments.length;_i++){args[_i]=arguments[_i]}return resolve(args)}),(function(){var args=[];for(var _i=0;_i<arguments.length;_i++){args[_i]=arguments[_i]}return reject(args)}))}else{result=callInstance(pluginObj,methodName,args,opts,resolve,reject)}if(result&&result.then){result.then(resolve,reject)}else{reject()}}))}else{var pluginResult_1,rej_1;var p=getPromise((function(resolve,reject){if(opts.destruct){pluginResult_1=callInstance(pluginObj,methodName,args,opts,(function(){var args=[];for(var _i=0;_i<arguments.length;_i++){args[_i]=arguments[_i]}return resolve(args)}),(function(){var args=[];for(var _i=0;_i<arguments.length;_i++){args[_i]=arguments[_i]}return reject(args)}))}else{pluginResult_1=callInstance(pluginObj,methodName,args,opts,resolve,reject)}rej_1=reject}));if(pluginResult_1&&pluginResult_1.error){p.catch((function(){}));typeof rej_1==="function"&&rej_1(pluginResult_1.error)}return p}}}function get(element,path){var paths=path.split(".");var obj=element;for(var i=0;i<paths.length;i++){if(!obj){return null}obj=obj[paths[i]]}return obj}var AwesomeCordovaNativePlugin=function(){function AwesomeCordovaNativePlugin(){}AwesomeCordovaNativePlugin.installed=function(){var isAvailable=checkAvailability(this.pluginRef)===true;return isAvailable};AwesomeCordovaNativePlugin.getPlugin=function(){if(typeof window!=="undefined"){return get(window,this.pluginRef)}return null};AwesomeCordovaNativePlugin.getPluginName=function(){var pluginName=this.pluginName;return pluginName};AwesomeCordovaNativePlugin.getPluginRef=function(){var pluginRef=this.pluginRef;return pluginRef};AwesomeCordovaNativePlugin.getPluginInstallName=function(){var plugin=this.plugin;return plugin};AwesomeCordovaNativePlugin.getSupportedPlatforms=function(){var platform=this.platforms;return platform};AwesomeCordovaNativePlugin.pluginName="";AwesomeCordovaNativePlugin.pluginRef="";AwesomeCordovaNativePlugin.plugin="";AwesomeCordovaNativePlugin.repo="";AwesomeCordovaNativePlugin.platforms=[];AwesomeCordovaNativePlugin.install="";return AwesomeCordovaNativePlugin}();function cordova(pluginObj,methodName,config,args){return wrap(pluginObj,methodName,config).apply(this,args)}function overrideFunction(pluginObj,methodName){return new rxjs.Observable((function(observer){var availabilityCheck=checkAvailability(pluginObj,methodName);if(availabilityCheck===true){var pluginInstance_1=getPlugin(pluginObj.constructor.getPluginRef());pluginInstance_1[methodName]=observer.next.bind(observer);return function(){return pluginInstance_1[methodName]=function(){}}}else{observer.error(availabilityCheck);observer.complete()}}))}function cordovaFunctionOverride(pluginObj,methodName,args){return overrideFunction(pluginObj,methodName)}function cordovaInstance(pluginObj,methodName,config,args){args=Array.from(args);return wrapInstance(pluginObj,methodName,config).apply(this,args)}function cordovaPropertyGet(pluginObj,key){if(checkAvailability(pluginObj,key)===true){return getPlugin(pluginObj.constructor.getPluginRef())[key]}return null}function cordovaPropertySet(pluginObj,key,value){if(checkAvailability(pluginObj,key)===true){getPlugin(pluginObj.constructor.getPluginRef())[key]=value}}function instancePropertyGet(pluginObj,key){if(pluginObj._objectInstance&&pluginObj._objectInstance[key]){return pluginObj._objectInstance[key]}return null}function instancePropertySet(pluginObj,key,value){if(pluginObj._objectInstance){pluginObj._objectInstance[key]=value}}checkReady();window.rxjs._throw=window.rxjs.throwError;exports.AwesomeCordovaNativePlugin=AwesomeCordovaNativePlugin;exports.checkAvailability=checkAvailability;exports.cordova=cordova;exports.cordovaFunctionOverride=cordovaFunctionOverride;exports.cordovaInstance=cordovaInstance;exports.cordovaPropertyGet=cordovaPropertyGet;exports.cordovaPropertySet=cordovaPropertySet;exports.getPromise=getPromise;exports.instanceAvailability=instanceAvailability;exports.instancePropertyGet=instancePropertyGet;exports.instancePropertySet=instancePropertySet;exports.wrap=wrap}));(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?module.exports=factory(require("tslib"),require("@angular/core"),require("@awesome-cordova-plugins/core"),require("rxjs"),require("rxjs/operators")):typeof define==="function"&&define.amd?define(["tslib","@angular/core","@awesome-cordova-plugins/core","rxjs","rxjs/operators"],factory):(global=typeof globalThis!=="undefined"?globalThis:global||self,global.awesomeCordova=global.awesomeCordova||{},global.awesomeCordova.plugins=factory(global.tslib,global.ng.core,global.awesomeCordova.core,global.rxjs,global.rxjs.operators))})(this,(function(tslib,core$1,core,rxjs,operators){"use strict";var AppVersion=function(_super){tslib.__extends(AppVersion,_super);function AppVersion(){return _super!==null&&_super.apply(this,arguments)||this}AppVersion.prototype.getAppName=function(){return core.cordova(this,"getAppName",{},arguments)};AppVersion.prototype.getPackageName=function(){return core.cordova(this,"getPackageName",{},arguments)};AppVersion.prototype.getVersionCode=function(){return core.cordova(this,"getVersionCode",{},arguments)};AppVersion.prototype.getVersionNumber=function(){return core.cordova(this,"getVersionNumber",{},arguments)};AppVersion.pluginName="AppVersion";AppVersion.plugin="cordova-plugin-app-version";AppVersion.pluginRef="cordova.getAppVersion";AppVersion.repo="https://github.com/whiteoctober/cordova-plugin-app-version";AppVersion.platforms=["Android","iOS","Windows"];AppVersion.decorators=[{type:core$1.Injectable}];return AppVersion}(core.AwesomeCordovaNativePlugin);var AppVersion$1=Object.freeze({__proto__:null,AppVersion:AppVersion});var BarcodeScanner=function(_super){tslib.__extends(BarcodeScanner,_super);function BarcodeScanner(){var _this=_super!==null&&_super.apply(this,arguments)||this;_this.Encode={TEXT_TYPE:"TEXT_TYPE",EMAIL_TYPE:"EMAIL_TYPE",PHONE_TYPE:"PHONE_TYPE",SMS_TYPE:"SMS_TYPE"};return _this}BarcodeScanner.prototype.scan=function(options){return core.cordova(this,"scan",{callbackOrder:"reverse"},arguments)};BarcodeScanner.prototype.encode=function(type,data){return core.cordova(this,"encode",{},arguments)};BarcodeScanner.pluginName="BarcodeScanner";BarcodeScanner.plugin="phonegap-plugin-barcodescanner";BarcodeScanner.pluginRef="cordova.plugins.barcodeScanner";BarcodeScanner.repo="https://github.com/phonegap/phonegap-plugin-barcodescanner";BarcodeScanner.platforms=["Android","BlackBerry 10","Browser","iOS","Windows"];BarcodeScanner.decorators=[{type:core$1.Injectable}];return BarcodeScanner}(core.AwesomeCordovaNativePlugin);var BarcodeScanner$1=Object.freeze({__proto__:null,BarcodeScanner:BarcodeScanner});var Calendar=function(_super){tslib.__extends(Calendar,_super);function Calendar(){return _super!==null&&_super.apply(this,arguments)||this}Calendar.prototype.hasReadWritePermission=function(){return core.cordova(this,"hasReadWritePermission",{},arguments)};Calendar.prototype.hasReadPermission=function(){return core.cordova(this,"hasReadPermission",{},arguments)};Calendar.prototype.hasWritePermission=function(){return core.cordova(this,"hasWritePermission",{},arguments)};Calendar.prototype.requestWritePermission=function(){return core.cordova(this,"requestWritePermission",{},arguments)};Calendar.prototype.requestReadPermission=function(){return core.cordova(this,"requestReadPermission",{},arguments)};Calendar.prototype.requestReadWritePermission=function(){return core.cordova(this,"requestReadWritePermission",{},arguments)};Calendar.prototype.createCalendar=function(nameOrOptions){return core.cordova(this,"createCalendar",{},arguments)};Calendar.prototype.deleteCalendar=function(name){return core.cordova(this,"deleteCalendar",{},arguments)};Calendar.prototype.getCalendarOptions=function(){return core.cordova(this,"getCalendarOptions",{sync:true},arguments)};Calendar.prototype.getCreateCalendarOptions=function(){return core.cordova(this,"getCreateCalendarOptions",{sync:true},arguments)};Calendar.prototype.createEvent=function(title,location,notes,startDate,endDate){return core.cordova(this,"createEvent",{},arguments)};Calendar.prototype.createEventWithOptions=function(title,location,notes,startDate,endDate,options){return core.cordova(this,"createEventWithOptions",{},arguments)};Calendar.prototype.createEventInteractively=function(title,location,notes,startDate,endDate){return core.cordova(this,"createEventInteractively",{},arguments)};Calendar.prototype.createEventInteractivelyWithOptions=function(title,location,notes,startDate,endDate,options){return core.cordova(this,"createEventInteractivelyWithOptions",{},arguments)};Calendar.prototype.findEvent=function(title,location,notes,startDate,endDate){return core.cordova(this,"findEvent",{},arguments)};Calendar.prototype.findEventWithOptions=function(title,location,notes,startDate,endDate,options){return core.cordova(this,"findEventWithOptions",{},arguments)};Calendar.prototype.listEventsInRange=function(startDate,endDate){return core.cordova(this,"listEventsInRange",{platforms:["Android"]},arguments)};Calendar.prototype.listCalendars=function(){return core.cordova(this,"listCalendars",{},arguments)};Calendar.prototype.findAllEventsInNamedCalendar=function(calendarName){return core.cordova(this,"findAllEventsInNamedCalendar",{platforms:["iOS"]},arguments)};Calendar.prototype.modifyEvent=function(title,location,notes,startDate,endDate,newTitle,newLocation,newNotes,newStartDate,newEndDate){return core.cordova(this,"modifyEvent",{platforms:["iOS"]},arguments)};Calendar.prototype.modifyEventWithOptions=function(title,location,notes,startDate,endDate,newTitle,newLocation,newNotes,newStartDate,newEndDate,filterOptions,newOptions){return core.cordova(this,"modifyEventWithOptions",{platforms:["iOS"]},arguments)};Calendar.prototype.deleteEvent=function(title,location,notes,startDate,endDate){return core.cordova(this,"deleteEvent",{},arguments)};Calendar.prototype.deleteEventFromNamedCalendar=function(title,location,notes,startDate,endDate,calendarName){return core.cordova(this,"deleteEventFromNamedCalendar",{platforms:["iOS"]},arguments)};Calendar.prototype.deleteEventById=function(id,fromDate){return core.cordova(this,"deleteEventById",{},arguments)};Calendar.prototype.openCalendar=function(date){return core.cordova(this,"openCalendar",{},arguments)};Calendar.pluginName="Calendar";Calendar.plugin="cordova-plugin-calendar";Calendar.pluginRef="plugins.calendar";Calendar.repo="https://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin";Calendar.platforms=["Android","iOS"];Calendar.decorators=[{type:core$1.Injectable}];return Calendar}(core.AwesomeCordovaNativePlugin);var Calendar$1=Object.freeze({__proto__:null,Calendar:Calendar});var DestinationType;(function(DestinationType){DestinationType[DestinationType["DATA_URL"]=0]="DATA_URL";DestinationType[DestinationType["FILE_URL"]=1]="FILE_URL";DestinationType[DestinationType["NATIVE_URI"]=2]="NATIVE_URI"})(DestinationType||(DestinationType={}));var EncodingType;(function(EncodingType){EncodingType[EncodingType["JPEG"]=0]="JPEG";EncodingType[EncodingType["PNG"]=1]="PNG"})(EncodingType||(EncodingType={}));var MediaType;(function(MediaType){MediaType[MediaType["PICTURE"]=0]="PICTURE";MediaType[MediaType["VIDEO"]=1]="VIDEO";MediaType[MediaType["ALLMEDIA"]=2]="ALLMEDIA"})(MediaType||(MediaType={}));var PictureSourceType;(function(PictureSourceType){PictureSourceType[PictureSourceType["PHOTOLIBRARY"]=0]="PHOTOLIBRARY";PictureSourceType[PictureSourceType["CAMERA"]=1]="CAMERA";PictureSourceType[PictureSourceType["SAVEDPHOTOALBUM"]=2]="SAVEDPHOTOALBUM"})(PictureSourceType||(PictureSourceType={}));var PopoverArrowDirection;(function(PopoverArrowDirection){PopoverArrowDirection[PopoverArrowDirection["ARROW_UP"]=1]="ARROW_UP";PopoverArrowDirection[PopoverArrowDirection["ARROW_DOWN"]=2]="ARROW_DOWN";PopoverArrowDirection[PopoverArrowDirection["ARROW_LEFT"]=3]="ARROW_LEFT";PopoverArrowDirection[PopoverArrowDirection["ARROW_RIGHT"]=4]="ARROW_RIGHT";PopoverArrowDirection[PopoverArrowDirection["ARROW_ANY"]=5]="ARROW_ANY"})(PopoverArrowDirection||(PopoverArrowDirection={}));var Direction;(function(Direction){Direction[Direction["BACK"]=0]="BACK";Direction[Direction["FRONT"]=1]="FRONT"})(Direction||(Direction={}));var Camera=function(_super){tslib.__extends(Camera,_super);function Camera(){var _this=_super!==null&&_super.apply(this,arguments)||this;_this.DestinationType={DATA_URL:0,FILE_URI:1,NATIVE_URI:2};_this.EncodingType={JPEG:0,PNG:1};_this.MediaType={PICTURE:0,VIDEO:1,ALLMEDIA:2};_this.PictureSourceType={PHOTOLIBRARY:0,CAMERA:1,SAVEDPHOTOALBUM:2};_this.PopoverArrowDirection={ARROW_UP:1,ARROW_DOWN:2,ARROW_LEFT:4,ARROW_RIGHT:8,ARROW_ANY:15};_this.Direction={BACK:0,FRONT:1};return _this}Camera.prototype.getPicture=function(options){return core.cordova(this,"getPicture",{callbackOrder:"reverse"},arguments)};Camera.prototype.cleanup=function(){return core.cordova(this,"cleanup",{platforms:["iOS"]},arguments)};Camera.pluginName="Camera";Camera.plugin="cordova-plugin-camera";Camera.pluginRef="navigator.camera";Camera.repo="https://github.com/apache/cordova-plugin-camera";Camera.platforms=["Android","Browser","iOS","Windows"];Camera.decorators=[{type:core$1.Injectable}];return Camera}(core.AwesomeCordovaNativePlugin);var Camera$1=Object.freeze({__proto__:null,Camera:Camera,get DestinationType(){return DestinationType},get Direction(){return Direction},get EncodingType(){return EncodingType},get MediaType(){return MediaType},get PictureSourceType(){return PictureSourceType},get PopoverArrowDirection(){return PopoverArrowDirection}});var Device=function(_super){tslib.__extends(Device,_super);function Device(){return _super!==null&&_super.apply(this,arguments)||this}Object.defineProperty(Device.prototype,"cordova",{get:function(){return core.cordovaPropertyGet(this,"cordova")},set:function(value){core.cordovaPropertySet(this,"cordova",value)},enumerable:false,configurable:true});Object.defineProperty(Device.prototype,"model",{get:function(){return core.cordovaPropertyGet(this,"model")},set:function(value){core.cordovaPropertySet(this,"model",value)},enumerable:false,configurable:true});Object.defineProperty(Device.prototype,"platform",{get:function(){return core.cordovaPropertyGet(this,"platform")},set:function(value){core.cordovaPropertySet(this,"platform",value)},enumerable:false,configurable:true});Object.defineProperty(Device.prototype,"uuid",{get:function(){return core.cordovaPropertyGet(this,"uuid")},set:function(value){core.cordovaPropertySet(this,"uuid",value)},enumerable:false,configurable:true});Object.defineProperty(Device.prototype,"version",{get:function(){return core.cordovaPropertyGet(this,"version")},set:function(value){core.cordovaPropertySet(this,"version",value)},enumerable:false,configurable:true});Object.defineProperty(Device.prototype,"manufacturer",{get:function(){return core.cordovaPropertyGet(this,"manufacturer")},set:function(value){core.cordovaPropertySet(this,"manufacturer",value)},enumerable:false,configurable:true});Object.defineProperty(Device.prototype,"isVirtual",{get:function(){return core.cordovaPropertyGet(this,"isVirtual")},set:function(value){core.cordovaPropertySet(this,"isVirtual",value)},enumerable:false,configurable:true});Object.defineProperty(Device.prototype,"serial",{get:function(){return core.cordovaPropertyGet(this,"serial")},set:function(value){core.cordovaPropertySet(this,"serial",value)},enumerable:false,configurable:true});Device.pluginName="Device";Device.plugin="cordova-plugin-device";Device.pluginRef="device";Device.repo="https://github.com/apache/cordova-plugin-device";Device.platforms=["Android","Browser","iOS","macOS","Windows"];Device.decorators=[{type:core$1.Injectable}];return Device}(core.AwesomeCordovaNativePlugin);var Device$1=Object.freeze({__proto__:null,Device:Device});var File=function(_super){tslib.__extends(File,_super);function File(){var _this=_super!==null&&_super.apply(this,arguments)||this;_this.cordovaFileError={1:"NOT_FOUND_ERR",2:"SECURITY_ERR",3:"ABORT_ERR",4:"NOT_READABLE_ERR",5:"ENCODING_ERR",6:"NO_MODIFICATION_ALLOWED_ERR",7:"INVALID_STATE_ERR",8:"SYNTAX_ERR",9:"INVALID_MODIFICATION_ERR",10:"QUOTA_EXCEEDED_ERR",11:"TYPE_MISMATCH_ERR",12:"PATH_EXISTS_ERR",13:"WRONG_ENTRY_TYPE",14:"DIR_READ_ERR"};return _this}File.prototype.getFreeDiskSpace=function(){var _this=this;return function(){if(core.checkAvailability(_this)===true){return core.getPromise((function(resolve,reject){cordova.exec(resolve,reject,"File","getFreeDiskSpace",[])}))}}()};File.prototype.checkDir=function(path,dir){var _this=this;return function(){if(core.checkAvailability(_this)===true){if(/^\//.test(dir)){var err=new FileError(5);err.message="directory cannot start with /";return Promise.reject(err)}var fullPath=path+dir;return _this.resolveDirectoryUrl(fullPath).then((function(){return true}))}}()};File.prototype.createDir=function(path,dirName,replace){var _this=this;return function(){if(core.checkAvailability(_this)===true){if(/^\//.test(dirName)){var err=new FileError(5);err.message="directory cannot start with /";return Promise.reject(err)}var options={create:true};if(!replace){options.exclusive=true}return _this.resolveDirectoryUrl(path).then((function(fse){return _this.getDirectory(fse,dirName,options)}))}}()};File.prototype.removeDir=function(path,dirName){var _this=this;return function(){if(core.checkAvailability(_this)===true){if(/^\//.test(dirName)){var err=new FileError(5);err.message="directory cannot start with /";return Promise.reject(err)}return _this.resolveDirectoryUrl(path).then((function(fse){return _this.getDirectory(fse,dirName,{create:false})})).then((function(de){return _this.remove(de)}))}}()};File.prototype.moveDir=function(path,dirName,newPath,newDirName){var _this=this;return function(){if(core.checkAvailability(_this)===true){newDirName=newDirName||dirName;if(/^\//.test(newDirName)){var err=new FileError(5);err.message="directory cannot start with /";return Promise.reject(err)}return _this.resolveDirectoryUrl(path).then((function(fse){return _this.getDirectory(fse,dirName,{create:false})})).then((function(srcde){return _this.resolveDirectoryUrl(newPath).then((function(destenation){return _this.move(srcde,destenation,newDirName)}))}))}}()};File.prototype.copyDir=function(path,dirName,newPath,newDirName){var _this=this;return function(){if(core.checkAvailability(_this)===true){if(/^\//.test(newDirName)){var err=new FileError(5);err.message="directory cannot start with /";return Promise.reject(err)}return _this.resolveDirectoryUrl(path).then((function(fse){return _this.getDirectory(fse,dirName,{create:false})})).then((function(srcde){return _this.resolveDirectoryUrl(newPath).then((function(deste){return _this.copy(srcde,deste,newDirName)}))}))}}()};File.prototype.listDir=function(path,dirName){var _this=this;return function(){if(core.checkAvailability(_this)===true){if(/^\//.test(dirName)){var err=new FileError(5);err.message="directory cannot start with /";return Promise.reject(err)}return _this.resolveDirectoryUrl(path).then((function(fse){return _this.getDirectory(fse,dirName,{create:false,exclusive:false})})).then((function(de){var reader=de.createReader();return _this.readEntries(reader)}))}}()};File.prototype.removeRecursively=function(path,dirName){var _this=this;return function(){if(core.checkAvailability(_this)===true){if(/^\//.test(dirName)){var err=new FileError(5);err.message="directory cannot start with /";return Promise.reject(err)}return _this.resolveDirectoryUrl(path).then((function(fse){return _this.getDirectory(fse,dirName,{create:false})})).then((function(de){return _this.rimraf(de)}))}}()};File.prototype.checkFile=function(path,file){var _this=this;return function(){if(core.checkAvailability(_this)===true){if(/^\//.test(file)){var err=new FileError(5);err.message="file cannot start with /";return Promise.reject(err)}return _this.resolveLocalFilesystemUrl(path+file).then((function(fse){if(fse.isFile){return true}else{var err=new FileError(13);err.message="input is not a file";return Promise.reject(err)}}))}}()};File.prototype.createFile=function(path,fileName,replace){var _this=this;return function(){if(core.checkAvailability(_this)===true){if(/^\//.test(fileName)){var err=new FileError(5);err.message="file-name cannot start with /";return Promise.reject(err)}var options={create:true};if(!replace){options.exclusive=true}return _this.resolveDirectoryUrl(path).then((function(fse){return _this.getFile(fse,fileName,options)}))}}()};File.prototype.removeFile=function(path,fileName){var _this=this;return function(){if(core.checkAvailability(_this)===true){if(/^\//.test(fileName)){var err=new FileError(5);err.message="file-name cannot start with /";return Promise.reject(err)}return _this.resolveDirectoryUrl(path).then((function(fse){return _this.getFile(fse,fileName,{create:false})})).then((function(fe){return _this.remove(fe)}))}}()};File.prototype.writeFile=function(path,fileName,text,options){var _this=this;if(options===void 0){options={}}return function(){if(core.checkAvailability(_this)===true){if(/^\//.test(fileName)){var err=new FileError(5);err.message="file-name cannot start with /";return Promise.reject(err)}var getFileOpts={create:!options.append,exclusive:!options.replace};return _this.resolveDirectoryUrl(path).then((function(directoryEntry){return _this.getFile(directoryEntry,fileName,getFileOpts)})).then((function(fileEntry){return _this.writeFileEntry(fileEntry,text,options)}))}}()};File.prototype.writeFileEntry=function(fe,text,options){var _this=this;return this.createWriter(fe).then((function(writer){if(options.append){writer.seek(writer.length)}if(options.truncate){writer.truncate(options.truncate)}return _this.write(writer,text)})).then((function(){return fe}))};File.prototype.writeExistingFile=function(path,fileName,text){var _this=this;return function(){if(core.checkAvailability(_this)===true){return _this.writeFile(path,fileName,text,{replace:true})}}()};File.prototype.readAsText=function(path,file){var _this=this;return function(){if(core.checkAvailability(_this)===true){return _this.readFile(path,file,"Text")}}()};File.prototype.readAsDataURL=function(path,file){var _this=this;return function(){if(core.checkAvailability(_this)===true){return _this.readFile(path,file,"DataURL")}}()};File.prototype.readAsBinaryString=function(path,file){var _this=this;return function(){if(core.checkAvailability(_this)===true){return _this.readFile(path,file,"BinaryString")}}()};File.prototype.readAsArrayBuffer=function(path,file){var _this=this;return function(){if(core.checkAvailability(_this)===true){return _this.readFile(path,file,"ArrayBuffer")}}()};File.prototype.moveFile=function(path,fileName,newPath,newFileName){var _this=this;return function(){if(core.checkAvailability(_this)===true){newFileName=newFileName||fileName;if(/^\//.test(newFileName)){var err=new FileError(5);err.message="file name cannot start with /";return Promise.reject(err)}return _this.resolveDirectoryUrl(path).then((function(fse){return _this.getFile(fse,fileName,{create:false})})).then((function(srcfe){return _this.resolveDirectoryUrl(newPath).then((function(deste){return _this.move(srcfe,deste,newFileName)}))}))}}()};File.prototype.copyFile=function(path,fileName,newPath,newFileName){var _this=this;return function(){if(core.checkAvailability(_this)===true){newFileName=newFileName||fileName;if(/^\//.test(newFileName)){var err=new FileError(5);err.message="file name cannot start with /";return Promise.reject(err)}return _this.resolveDirectoryUrl(path).then((function(fse){return _this.getFile(fse,fileName,{create:false})})).then((function(srcfe){return _this.resolveDirectoryUrl(newPath).then((function(deste){return _this.copy(srcfe,deste,newFileName)}))}))}}()};File.prototype.fillErrorMessage=function(err){try{err.message=this.cordovaFileError[err.code]}catch(e){}};File.prototype.resolveLocalFilesystemUrl=function(fileUrl){var _this=this;return function(){if(core.checkAvailability(_this)===true){return core.getPromise((function(resolve,reject){try{window.resolveLocalFileSystemURL(fileUrl,(function(entry){resolve(entry)}),(function(err){_this.fillErrorMessage(err);reject(err)}))}catch(xc){_this.fillErrorMessage(xc);reject(xc)}}))}}()};File.prototype.resolveDirectoryUrl=function(directoryUrl){var _this=this;return function(){if(core.checkAvailability(_this)===true){return _this.resolveLocalFilesystemUrl(directoryUrl).then((function(de){if(de.isDirectory){return de}else{var err=new FileError(13);err.message="input is not a directory";return Promise.reject(err)}}))}}()};File.prototype.getDirectory=function(directoryEntry,directoryName,flags){var _this=this;return function(){if(core.checkAvailability(_this)===true){return new Promise((function(resolve,reject){try{directoryEntry.getDirectory(directoryName,flags,(function(de){resolve(de)}),(function(err){_this.fillErrorMessage(err);reject(err)}))}catch(xc){_this.fillErrorMessage(xc);reject(xc)}}))}}()};File.prototype.getFile=function(directoryEntry,fileName,flags){var _this=this;return function(){if(core.checkAvailability(_this)===true){return new Promise((function(resolve,reject){try{directoryEntry.getFile(fileName,flags,resolve,(function(err){_this.fillErrorMessage(err);reject(err)}))}catch(xc){_this.fillErrorMessage(xc);reject(xc)}}))}}()};File.prototype.readFile=function(path,file,readAs){var _this=this;if(/^\//.test(file)){var err=new FileError(5);err.message="file-name cannot start with /";return Promise.reject(err)}return this.resolveDirectoryUrl(path).then((function(directoryEntry){return _this.getFile(directoryEntry,file,{create:false})})).then((function(fileEntry){var reader=new FileReader;return core.getPromise((function(resolve,reject){reader.onloadend=function(){if(reader.result!==undefined||reader.result!==null){resolve(reader.result)}else if(reader.error!==undefined||reader.error!==null){reject(reader.error)}else{reject({code:null,message:"READER_ONLOADEND_ERR"})}};fileEntry.file((function(file){reader["readAs"+readAs].call(reader,file)}),(function(error){reject(error)}))}))}))};File.prototype.remove=function(fe){var _this=this;return new Promise((function(resolve,reject){fe.remove((function(){resolve({success:true,fileRemoved:fe})}),(function(err){_this.fillErrorMessage(err);reject(err)}))}))};File.prototype.move=function(srce,destdir,newName){var _this=this;return new Promise((function(resolve,reject){srce.moveTo(destdir,newName,(function(deste){resolve(deste)}),(function(err){_this.fillErrorMessage(err);reject(err)}))}))};File.prototype.copy=function(srce,destdir,newName){var _this=this;return new Promise((function(resolve,reject){srce.copyTo(destdir,newName,(function(deste){resolve(deste)}),(function(err){_this.fillErrorMessage(err);reject(err)}))}))};File.prototype.readEntries=function(dr){var _this=this;return new Promise((function(resolve,reject){dr.readEntries((function(entries){resolve(entries)}),(function(err){_this.fillErrorMessage(err);reject(err)}))}))};File.prototype.rimraf=function(de){var _this=this;return new Promise((function(resolve,reject){de.removeRecursively((function(){resolve({success:true,fileRemoved:de})}),(function(err){_this.fillErrorMessage(err);reject(err)}))}))};File.prototype.createWriter=function(fe){var _this=this;return new Promise((function(resolve,reject){fe.createWriter((function(writer){resolve(writer)}),(function(err){_this.fillErrorMessage(err);reject(err)}))}))};File.prototype.write=function(writer,gu){if(gu instanceof Blob){return this.writeFileInChunks(writer,gu)}return new Promise((function(resolve,reject){writer.onwriteend=function(evt){if(writer.error){reject(writer.error)}else{resolve(evt)}};writer.write(gu)}))};File.prototype.writeFileInChunks=function(writer,file){var BLOCK_SIZE=1024*1024;var writtenSize=0;function writeNextChunk(){var size=Math.min(BLOCK_SIZE,file.size-writtenSize);var chunk=file.slice(writtenSize,writtenSize+size);writtenSize+=size;writer.write(chunk)}return core.getPromise((function(resolve,reject){writer.onerror=reject;writer.onwrite=function(){if(writtenSize<file.size){writeNextChunk()}else{resolve()}};writeNextChunk()}))};Object.defineProperty(File.prototype,"applicationDirectory",{get:function(){return core.cordovaPropertyGet(this,"applicationDirectory")},set:function(value){core.cordovaPropertySet(this,"applicationDirectory",value)},enumerable:false,configurable:true});Object.defineProperty(File.prototype,"applicationStorageDirectory",{get:function(){return core.cordovaPropertyGet(this,"applicationStorageDirectory")},set:function(value){core.cordovaPropertySet(this,"applicationStorageDirectory",value)},enumerable:false,configurable:true});Object.defineProperty(File.prototype,"dataDirectory",{get:function(){return core.cordovaPropertyGet(this,"dataDirectory")},set:function(value){core.cordovaPropertySet(this,"dataDirectory",value)},enumerable:false,configurable:true});Object.defineProperty(File.prototype,"cacheDirectory",{get:function(){return core.cordovaPropertyGet(this,"cacheDirectory")},set:function(value){core.cordovaPropertySet(this,"cacheDirectory",value)},enumerable:false,configurable:true});Object.defineProperty(File.prototype,"externalApplicationStorageDirectory",{get:function(){return core.cordovaPropertyGet(this,"externalApplicationStorageDirectory")},set:function(value){core.cordovaPropertySet(this,"externalApplicationStorageDirectory",value)},enumerable:false,configurable:true});Object.defineProperty(File.prototype,"externalDataDirectory",{get:function(){return core.cordovaPropertyGet(this,"externalDataDirectory")},set:function(value){core.cordovaPropertySet(this,"externalDataDirectory",value)},enumerable:false,configurable:true});Object.defineProperty(File.prototype,"externalCacheDirectory",{get:function(){return core.cordovaPropertyGet(this,"externalCacheDirectory")},set:function(value){core.cordovaPropertySet(this,"externalCacheDirectory",value)},enumerable:false,configurable:true});Object.defineProperty(File.prototype,"externalRootDirectory",{get:function(){return core.cordovaPropertyGet(this,"externalRootDirectory")},set:function(value){core.cordovaPropertySet(this,"externalRootDirectory",value)},enumerable:false,configurable:true});Object.defineProperty(File.prototype,"tempDirectory",{get:function(){return core.cordovaPropertyGet(this,"tempDirectory")},set:function(value){core.cordovaPropertySet(this,"tempDirectory",value)},enumerable:false,configurable:true});Object.defineProperty(File.prototype,"syncedDataDirectory",{get:function(){return core.cordovaPropertyGet(this,"syncedDataDirectory")},set:function(value){core.cordovaPropertySet(this,"syncedDataDirectory",value)},enumerable:false,configurable:true});Object.defineProperty(File.prototype,"documentsDirectory",{get:function(){return core.cordovaPropertyGet(this,"documentsDirectory")},set:function(value){core.cordovaPropertySet(this,"documentsDirectory",value)},enumerable:false,configurable:true});Object.defineProperty(File.prototype,"sharedDirectory",{get:function(){return core.cordovaPropertyGet(this,"sharedDirectory")},set:function(value){core.cordovaPropertySet(this,"sharedDirectory",value)},enumerable:false,configurable:true});File.pluginName="File";File.plugin="cordova-plugin-file";File.pluginRef="cordova.file";File.repo="https://github.com/apache/cordova-plugin-file";File.platforms=["Android","Browser","iOS","macOS","Windows"];File.decorators=[{type:core$1.Injectable}];return File}(core.AwesomeCordovaNativePlugin);var File$1=Object.freeze({__proto__:null,File:File});var FileOpener=function(_super){tslib.__extends(FileOpener,_super);function FileOpener(){return _super!==null&&_super.apply(this,arguments)||this}FileOpener.prototype.open=function(filePath,fileMIMEType){return core.cordova(this,"open",{callbackStyle:"object",successName:"success",errorName:"error"},arguments)};FileOpener.prototype.uninstall=function(packageId){return core.cordova(this,"uninstall",{callbackStyle:"object",successName:"success",errorName:"error"},arguments)};FileOpener.prototype.appIsInstalled=function(packageId){return core.cordova(this,"appIsInstalled",{callbackStyle:"object",successName:"success",errorName:"error"},arguments)};FileOpener.prototype.showOpenWithDialog=function(filePath,fileMIMEType){return core.cordova(this,"showOpenWithDialog",{callbackStyle:"object",successName:"success",errorName:"error"},arguments)};FileOpener.pluginName="FileOpener";FileOpener.plugin="cordova-plugin-file-opener2";FileOpener.pluginRef="cordova.plugins.fileOpener2";FileOpener.repo="https://github.com/pwlin/cordova-plugin-file-opener2";FileOpener.platforms=["Android","iOS","Windows","Windows Phone 8"];FileOpener.decorators=[{type:core$1.Injectable}];return FileOpener}(core.AwesomeCordovaNativePlugin);var FileOpener$1=Object.freeze({__proto__:null,FileOpener:FileOpener});var Geolocation=function(_super){tslib.__extends(Geolocation,_super);function Geolocation(){return _super!==null&&_super.apply(this,arguments)||this}Geolocation.prototype.getCurrentPosition=function(options){return core.cordova(this,"getCurrentPosition",{callbackOrder:"reverse"},arguments)};Geolocation.prototype.watchPosition=function(options){return new rxjs.Observable((function(observer){var watchId=navigator.geolocation.watchPosition(observer.next.bind(observer),observer.next.bind(observer),options);return function(){return navigator.geolocation.clearWatch(watchId)}}))};Geolocation.pluginName="Geolocation";Geolocation.plugin="cordova-plugin-geolocation";Geolocation.pluginRef="navigator.geolocation";Geolocation.repo="https://github.com/apache/cordova-plugin-geolocation";Geolocation.install='ionic cordova plugin add cordova-plugin-geolocation --variable GEOLOCATION_USAGE_DESCRIPTION="To locate you"';Geolocation.installVariables=["GEOLOCATION_USAGE_DESCRIPTION"];Geolocation.platforms=["Amazon Fire OS","Android","Browser","iOS","Windows"];Geolocation.decorators=[{type:core$1.Injectable}];return Geolocation}(core.AwesomeCordovaNativePlugin);var GeoLocation=Object.freeze({__proto__:null,Geolocation:Geolocation});var MediaCapture=function(_super){tslib.__extends(MediaCapture,_super);function MediaCapture(){return _super!==null&&_super.apply(this,arguments)||this}MediaCapture.prototype.captureAudio=function(options){return core.cordova(this,"captureAudio",{callbackOrder:"reverse"},arguments)};MediaCapture.prototype.captureImage=function(options){return core.cordova(this,"captureImage",{callbackOrder:"reverse"},arguments)};MediaCapture.prototype.captureVideo=function(options){return core.cordova(this,"captureVideo",{callbackOrder:"reverse"},arguments)};MediaCapture.prototype.onPendingCaptureResult=function(){return core.cordova(this,"onPendingCaptureResult",{eventObservable:true,event:"pendingcaptureresult"},arguments)};MediaCapture.prototype.onPendingCaptureError=function(){return core.cordova(this,"onPendingCaptureError",{eventObservable:true,event:"pendingcaptureerror"},arguments)};Object.defineProperty(MediaCapture.prototype,"supportedImageModes",{get:function(){return core.cordovaPropertyGet(this,"supportedImageModes")},set:function(value){core.cordovaPropertySet(this,"supportedImageModes",value)},enumerable:false,configurable:true});Object.defineProperty(MediaCapture.prototype,"supportedAudioModes",{get:function(){return core.cordovaPropertyGet(this,"supportedAudioModes")},set:function(value){core.cordovaPropertySet(this,"supportedAudioModes",value)},enumerable:false,configurable:true});Object.defineProperty(MediaCapture.prototype,"supportedVideoModes",{get:function(){return core.cordovaPropertyGet(this,"supportedVideoModes")},set:function(value){core.cordovaPropertySet(this,"supportedVideoModes",value)},enumerable:false,configurable:true});MediaCapture.pluginName="MediaCapture";MediaCapture.plugin="cordova-plugin-media-capture";MediaCapture.pluginRef="navigator.device.capture";MediaCapture.repo="https://github.com/apache/cordova-plugin-media-capture";MediaCapture.platforms=["Android","Browser","iOS","Windows"];MediaCapture.decorators=[{type:core$1.Injectable}];return MediaCapture}(core.AwesomeCordovaNativePlugin);var MediaCapture$1=Object.freeze({__proto__:null,MediaCapture:MediaCapture});var Connection;(function(Connection){Connection["UNKNOWN"]="unknown";Connection["ETHERNET"]="ethernet";Connection["WIFI"]="wifi";Connection["CELL_2G"]="2g";Connection["CELL_3G"]="3g";Connection["CELL_4G"]="4g";Connection["CELL"]="cellular";Connection["NONE"]="none"})(Connection||(Connection={}));var Network=function(_super){tslib.__extends(Network,_super);function Network(){var _this=_super!==null&&_super.apply(this,arguments)||this;_this.Connection={UNKNOWN:"unknown",ETHERNET:"ethernet",WIFI:"wifi",CELL_2G:"2g",CELL_3G:"3g",CELL_4G:"4g",CELL:"cellular",NONE:"none"};return _this}Network.prototype.onChange=function(){var _this=this;return function(){if(core.checkAvailability(_this)===true){return rxjs.merge(_this.onConnect().pipe(operators.mapTo("connected")),_this.onDisconnect().pipe(operators.mapTo("disconnected")))}}()};Network.prototype.onDisconnect=function(){return core.cordova(this,"onDisconnect",{eventObservable:true,event:"offline",element:"document"},arguments)};Network.prototype.onConnect=function(){return core.cordova(this,"onConnect",{eventObservable:true,event:"online",element:"document"},arguments)};Object.defineProperty(Network.prototype,"type",{get:function(){return core.cordovaPropertyGet(this,"type")},set:function(value){core.cordovaPropertySet(this,"type",value)},enumerable:false,configurable:true});Object.defineProperty(Network.prototype,"downlinkMax",{get:function(){return core.cordovaPropertyGet(this,"downlinkMax")},set:function(value){core.cordovaPropertySet(this,"downlinkMax",value)},enumerable:false,configurable:true});Network.pluginName="Network";Network.plugin="cordova-plugin-network-information";Network.pluginRef="navigator.connection";Network.repo="https://github.com/apache/cordova-plugin-network-information";Network.platforms=["Amazon Fire OS","Android","Browser","iOS","Windows"];Network.decorators=[{type:core$1.Injectable}];return Network}(core.AwesomeCordovaNativePlugin);var Network$1=Object.freeze({__proto__:null,get Connection(){return Connection},Network:Network});var SQLiteObject=function(){function SQLiteObject(_objectInstance){this._objectInstance=_objectInstance}SQLiteObject.prototype.addTransaction=function(transaction){return core.cordovaInstance(this,"addTransaction",{sync:true},arguments)};SQLiteObject.prototype.transaction=function(fn){return core.cordovaInstance(this,"transaction",{successIndex:2,errorIndex:1},arguments)};SQLiteObject.prototype.readTransaction=function(fn){return core.cordovaInstance(this,"readTransaction",{},arguments)};SQLiteObject.prototype.startNextTransaction=function(){return core.cordovaInstance(this,"startNextTransaction",{sync:true},arguments)};SQLiteObject.prototype.open=function(){return core.cordovaInstance(this,"open",{},arguments)};SQLiteObject.prototype.close=function(){return core.cordovaInstance(this,"close",{},arguments)};SQLiteObject.prototype.executeSql=function(statement,params){return core.cordovaInstance(this,"executeSql",{},arguments)};SQLiteObject.prototype.sqlBatch=function(sqlStatements){return core.cordovaInstance(this,"sqlBatch",{},arguments)};SQLiteObject.prototype.abortallPendingTransactions=function(){return core.cordovaInstance(this,"abortallPendingTransactions",{sync:true},arguments)};Object.defineProperty(SQLiteObject.prototype,"databaseFeatures",{get:function(){return core.instancePropertyGet(this,"databaseFeatures")},set:function(value){core.instancePropertySet(this,"databaseFeatures",value)},enumerable:false,configurable:true});Object.defineProperty(SQLiteObject.prototype,"openDBs",{get:function(){return core.instancePropertyGet(this,"openDBs")},set:function(value){core.instancePropertySet(this,"openDBs",value)},enumerable:false,configurable:true});return SQLiteObject}();var SQLite=function(_super){tslib.__extends(SQLite,_super);function SQLite(){return _super!==null&&_super.apply(this,arguments)||this}SQLite.prototype.create=function(config){var _this=this;return function(){if(core.checkAvailability(_this)===true){return new Promise((function(resolve,reject){sqlitePlugin.openDatabase(config,(function(db){return resolve(new SQLiteObject(db))}),reject)}))}}()};SQLite.prototype.echoTest=function(){return core.cordova(this,"echoTest",{},arguments)};SQLite.prototype.selfTest=function(){return core.cordova(this,"selfTest",{},arguments)};SQLite.prototype.deleteDatabase=function(config){return core.cordova(this,"deleteDatabase",{},arguments)};SQLite.pluginName="SQLite";SQLite.pluginRef="sqlitePlugin";SQLite.plugin="cordova-sqlite-storage";SQLite.repo="https://github.com/litehelpers/Cordova-sqlite-storage";SQLite.platforms=["Android","iOS","macOS","Windows"];SQLite.decorators=[{type:core$1.Injectable}];return SQLite}(core.AwesomeCordovaNativePlugin);var Sqlite=Object.freeze({__proto__:null,SQLite:SQLite,SQLiteObject:SQLiteObject});var Vibration=function(_super){tslib.__extends(Vibration,_super);function Vibration(){return _super!==null&&_super.apply(this,arguments)||this}Vibration.prototype.vibrate=function(time){return core.cordova(this,"vibrate",{sync:true},arguments)};Vibration.pluginName="Vibration";Vibration.plugin="cordova-plugin-vibration";Vibration.pluginRef="navigator";Vibration.repo="https://github.com/apache/cordova-plugin-vibration";Vibration.platforms=["Android","iOS","Windows"];Vibration.decorators=[{type:core$1.Injectable}];return Vibration}(core.AwesomeCordovaNativePlugin);var Vibration$1=Object.freeze({__proto__:null,Vibration:Vibration});var LocationAccuracy=function(_super){tslib.__extends(LocationAccuracy,_super);function LocationAccuracy(){var _this=_super!==null&&_super.apply(this,arguments)||this;_this.REQUEST_PRIORITY_NO_POWER=0;_this.REQUEST_PRIORITY_LOW_POWER=1;_this.REQUEST_PRIORITY_BALANCED_POWER_ACCURACY=2;_this.REQUEST_PRIORITY_HIGH_ACCURACY=3;_this.SUCCESS_SETTINGS_SATISFIED=0;_this.SUCCESS_USER_AGREED=1;_this.ERROR_ALREADY_REQUESTING=-1;_this.ERROR_INVALID_ACTION=0;_this.ERROR_INVALID_ACCURACY=1;_this.ERROR_EXCEPTION=1;_this.ERROR_CANNOT_CHANGE_ACCURACY=3;_this.ERROR_USER_DISAGREED=4;_this.ERROR_GOOGLE_API_CONNECTION_FAILED=4;return _this}LocationAccuracy.prototype.canRequest=function(){return core.cordova(this,"canRequest",{},arguments)};LocationAccuracy.prototype.isRequesting=function(){return core.cordova(this,"isRequesting",{},arguments)};LocationAccuracy.prototype.request=function(accuracy){return core.cordova(this,"request",{callbackOrder:"reverse"},arguments)};LocationAccuracy.pluginName="LocationAccuracy";LocationAccuracy.plugin="cordova-plugin-request-location-accuracy";LocationAccuracy.pluginRef="cordova.plugins.locationAccuracy";LocationAccuracy.repo="https://github.com/dpa99c/cordova-plugin-request-location-accuracy";LocationAccuracy.platforms=["Android","iOS"];LocationAccuracy.decorators=[{type:core$1.Injectable}];return LocationAccuracy}(core.AwesomeCordovaNativePlugin);var LocationAccuracy$1=Object.freeze({__proto__:null,LocationAccuracy:LocationAccuracy});var Diagnostic=function(_super){tslib.__extends(Diagnostic,_super);function Diagnostic(){var _this=_super!==null&&_super.apply(this,arguments)||this;_this.permission={READ_CALENDAR:"READ_CALENDAR",WRITE_CALENDAR:"WRITE_CALENDAR",CAMERA:"CAMERA",READ_CONTACTS:"READ_CONTACTS",WRITE_CONTACTS:"WRITE_CONTACTS",GET_ACCOUNTS:"GET_ACCOUNTS",ACCESS_FINE_LOCATION:"ACCESS_FINE_LOCATION",ACCESS_COARSE_LOCATION:"ACCESS_COARSE_LOCATION",RECORD_AUDIO:"RECORD_AUDIO",READ_PHONE_STATE:"READ_PHONE_STATE",CALL_PHONE:"CALL_PHONE",ADD_VOICEMAIL:"ADD_VOICEMAIL",USE_SIP:"USE_SIP",PROCESS_OUTGOING_CALLS:"PROCESS_OUTGOING_CALLS",READ_CALL_LOG:"READ_CALL_LOG",WRITE_CALL_LOG:"WRITE_CALL_LOG",SEND_SMS:"SEND_SMS",RECEIVE_SMS:"RECEIVE_SMS",READ_SMS:"READ_SMS",RECEIVE_WAP_PUSH:"RECEIVE_WAP_PUSH",RECEIVE_MMS:"RECEIVE_MMS",WRITE_EXTERNAL_STORAGE:"WRITE_EXTERNAL_STORAGE",READ_EXTERNAL_STORAGE:"READ_EXTERNAL_STORAGE",BODY_SENSORS:"BODY_SENSORS"};_this.locationAuthorizationMode={ALWAYS:"always",WHEN_IN_USE:"when_in_use"};_this.permissionGroups={CALENDAR:["READ_CALENDAR","WRITE_CALENDAR"],CAMERA:["CAMERA"],CONTACTS:["READ_CONTACTS","WRITE_CONTACTS","GET_ACCOUNTS"],LOCATION:["ACCESS_FINE_LOCATION","ACCESS_COARSE_LOCATION"],MICROPHONE:["RECORD_AUDIO"],PHONE:["READ_PHONE_STATE","CALL_PHONE","ADD_VOICEMAIL","USE_SIP","PROCESS_OUTGOING_CALLS","READ_CALL_LOG","WRITE_CALL_LOG"],SENSORS:["BODY_SENSORS"],SMS:["SEND_SMS","RECEIVE_SMS","READ_SMS","RECEIVE_WAP_PUSH","RECEIVE_MMS"],STORAGE:["READ_EXTERNAL_STORAGE","WRITE_EXTERNAL_STORAGE"]};_this.locationMode={HIGH_ACCURACY:"high_accuracy",DEVICE_ONLY:"device_only",BATTERY_SAVING:"battery_saving",LOCATION_OFF:"location_off"};_this.bluetoothState={UNKNOWN:"unknown",RESETTING:"resetting",UNSUPPORTED:"unsupported",UNAUTHORIZED:"unauthorized",POWERED_OFF:"powered_off",POWERED_ON:"powered_on",POWERING_OFF:"powering_off",POWERING_ON:"powering_on"};return _this}Diagnostic.prototype.isLocationAvailable=function(){return core.cordova(this,"isLocationAvailable",{},arguments)};Diagnostic.prototype.isWifiAvailable=function(){return core.cordova(this,"isWifiAvailable",{},arguments)};Diagnostic.prototype.isCameraAvailable=function(externalStorage){return core.cordova(this,"isCameraAvailable",{callbackOrder:"reverse"},arguments)};Diagnostic.prototype.isBluetoothAvailable=function(){return core.cordova(this,"isBluetoothAvailable",{},arguments)};Diagnostic.prototype.switchToLocationSettings=function(){return core.cordova(this,"switchToLocationSettings",{sync:true,platforms:["Android","Windows 10","iOS"]},arguments)};Diagnostic.prototype.switchToMobileDataSettings=function(){return core.cordova(this,"switchToMobileDataSettings",{sync:true,platforms:["Android","Windows 10"]},arguments)};Diagnostic.prototype.switchToBluetoothSettings=function(){return core.cordova(this,"switchToBluetoothSettings",{sync:true,platforms:["Android","Windows 10"]},arguments)};Diagnostic.prototype.switchToWifiSettings=function(){return core.cordova(this,"switchToWifiSettings",{sync:true,platforms:["Android","Windows 10"]},arguments)};Diagnostic.prototype.isWifiEnabled=function(){return core.cordova(this,"isWifiEnabled",{platforms:["Android","Windows 10"]},arguments)};Diagnostic.prototype.setWifiState=function(state){return core.cordova(this,"setWifiState",{callbackOrder:"reverse",platforms:["Android","Windows 10"]},arguments)};Diagnostic.prototype.setBluetoothState=function(state){return core.cordova(this,"setBluetoothState",{callbackOrder:"reverse",platforms:["Android","Windows 10"]},arguments)};Diagnostic.prototype.isLocationEnabled=function(){return core.cordova(this,"isLocationEnabled",{platforms:["Android","iOS"]},arguments)};Diagnostic.prototype.isLocationAuthorized=function(){return core.cordova(this,"isLocationAuthorized",{},arguments)};Diagnostic.prototype.getLocationAuthorizationStatus=function(){return core.cordova(this,"getLocationAuthorizationStatus",{platforms:["Android","iOS"]},arguments)};Diagnostic.prototype.requestLocationAuthorization=function(mode){return core.cordova(this,"requestLocationAuthorization",{platforms:["Android","iOS"],callbackOrder:"reverse"},arguments)};Diagnostic.prototype.isCameraPresent=function(){return core.cordova(this,"isCameraPresent",{platforms:["Android","iOS"]},arguments)};Diagnostic.prototype.isCameraAuthorized=function(externalStorage){return core.cordova(this,"isCameraAuthorized",{platforms:["Android","iOS"],callbackOrder:"reverse"},arguments)};Diagnostic.prototype.getCameraAuthorizationStatus=function(externalStorage){return core.cordova(this,"getCameraAuthorizationStatus",{platforms:["Android","iOS"],callbackOrder:"reverse"},arguments)};Diagnostic.prototype.requestCameraAuthorization=function(externalStorage){return core.cordova(this,"requestCameraAuthorization",{platforms:["Android","iOS"],callbackOrder:"reverse"},arguments)};Diagnostic.prototype.isMicrophoneAuthorized=function(){return core.cordova(this,"isMicrophoneAuthorized",{platforms:["Android","iOS"]},arguments)};Diagnostic.prototype.getMicrophoneAuthorizationStatus=function(){return core.cordova(this,"getMicrophoneAuthorizationStatus",{platforms:["Android","iOS"]},arguments)};Diagnostic.prototype.requestMicrophoneAuthorization=function(){return core.cordova(this,"requestMicrophoneAuthorization",{platforms:["Android","iOS"]},arguments)};Diagnostic.prototype.isContactsAuthorized=function(){return core.cordova(this,"isContactsAuthorized",{platforms:["Android","iOS"]},arguments)};Diagnostic.prototype.getContactsAuthorizationStatus=function(){return core.cordova(this,"getContactsAuthorizationStatus",{platforms:["Android","iOS"]},arguments)};Diagnostic.prototype.requestContactsAuthorization=function(){return core.cordova(this,"requestContactsAuthorization",{platforms:["Android","iOS"]},arguments)};Diagnostic.prototype.isCalendarAuthorized=function(){return core.cordova(this,"isCalendarAuthorized",{platforms:["Android","iOS"]},arguments)};Diagnostic.prototype.getCalendarAuthorizationStatus=function(){return core.cordova(this,"getCalendarAuthorizationStatus",{platforms:["Android","iOS"]},arguments)};Diagnostic.prototype.requestCalendarAuthorization=function(){return core.cordova(this,"requestCalendarAuthorization",{platforms:["Android","iOS"]},arguments)};Diagnostic.prototype.switchToSettings=function(){return core.cordova(this,"switchToSettings",{platforms:["Android","iOS"]},arguments)};Diagnostic.prototype.getBluetoothState=function(){return core.cordova(this,"getBluetoothState",{platforms:["Android","iOS"]},arguments)};Diagnostic.prototype.registerBluetoothStateChangeHandler=function(handler){return core.cordova(this,"registerBluetoothStateChangeHandler",{platforms:["Android","iOS"],sync:true},arguments)};Diagnostic.prototype.registerLocationStateChangeHandler=function(handler){return core.cordova(this,"registerLocationStateChangeHandler",{platforms:["Android","iOS"],sync:true},arguments)};Diagnostic.prototype.isGpsLocationAvailable=function(){return core.cordova(this,"isGpsLocationAvailable",{platforms:["Android"]},arguments)};Diagnostic.prototype.isGpsLocationEnabled=function(){return core.cordova(this,"isGpsLocationEnabled",{platforms:["Android"]},arguments)};Diagnostic.prototype.isNetworkLocationAvailable=function(){return core.cordova(this,"isNetworkLocationAvailable",{platforms:["Android"]},arguments)};Diagnostic.prototype.isNetworkLocationEnabled=function(){return core.cordova(this,"isNetworkLocationEnabled",{platforms:["Android"]},arguments)};Diagnostic.prototype.getLocationMode=function(){return core.cordova(this,"getLocationMode",{platforms:["Android"]},arguments)};Diagnostic.prototype.getPermissionAuthorizationStatus=function(permission){return core.cordova(this,"getPermissionAuthorizationStatus",{platforms:["Android"],callbackOrder:"reverse"},arguments)};Diagnostic.prototype.getPermissionsAuthorizationStatus=function(permissions){return core.cordova(this,"getPermissionsAuthorizationStatus",{platforms:["Android"],callbackOrder:"reverse"},arguments)};Diagnostic.prototype.requestRuntimePermission=function(permission){return core.cordova(this,"requestRuntimePermission",{platforms:["Android"],callbackOrder:"reverse"},arguments)};Diagnostic.prototype.requestRuntimePermissions=function(permissions){return core.cordova(this,"requestRuntimePermissions",{platforms:["Android"],callbackOrder:"reverse"},arguments)};Diagnostic.prototype.isRequestingPermission=function(){return core.cordova(this,"isRequestingPermission",{sync:true},arguments)};Diagnostic.prototype.registerPermissionRequestCompleteHandler=function(handler){return core.cordova(this,"registerPermissionRequestCompleteHandler",{sync:true},arguments)};Diagnostic.prototype.isBluetoothEnabled=function(){return core.cordova(this,"isBluetoothEnabled",{platforms:["Android"]},arguments)};Diagnostic.prototype.hasBluetoothSupport=function(){return core.cordova(this,"hasBluetoothSupport",{platforms:["Android"]},arguments)};Diagnostic.prototype.hasBluetoothLESupport=function(){return core.cordova(this,"hasBluetoothLESupport",{platforms:["Android"]},arguments)};Diagnostic.prototype.hasBluetoothLEPeripheralSupport=function(){return core.cordova(this,"hasBluetoothLEPeripheralSupport",{platforms:["Android"]},arguments)};Diagnostic.prototype.isExternalStorageAuthorized=function(){return core.cordova(this,"isExternalStorageAuthorized",{platforms:["Android"]},arguments)};Diagnostic.prototype.getExternalStorageAuthorizationStatus=function(){return core.cordova(this,"getExternalStorageAuthorizationStatus",{platforms:["Android"]},arguments)};Diagnostic.prototype.requestExternalStorageAuthorization=function(){return core.cordova(this,"requestExternalStorageAuthorization",{platforms:["Android"]},arguments)};Diagnostic.prototype.getExternalSdCardDetails=function(){return core.cordova(this,"getExternalSdCardDetails",{platforms:["Android"]},arguments)};Diagnostic.prototype.switchToWirelessSettings=function(){return core.cordova(this,"switchToWirelessSettings",{platforms:["Android"],sync:true},arguments)};Diagnostic.prototype.switchToNFCSettings=function(){return core.cordova(this,"switchToNFCSettings",{platforms:["Android"],sync:true},arguments)};Diagnostic.prototype.isNFCPresent=function(){return core.cordova(this,"isNFCPresent",{platforms:["Android"]},arguments)};Diagnostic.prototype.isNFCEnabled=function(){return core.cordova(this,"isNFCEnabled",{platforms:["Android"]},arguments)};Diagnostic.prototype.isNFCAvailable=function(){return core.cordova(this,"isNFCAvailable",{platforms:["Android"]},arguments)};Diagnostic.prototype.registerNFCStateChangeHandler=function(handler){return core.cordova(this,"registerNFCStateChangeHandler",{platforms:["Android"],sync:true},arguments)};Diagnostic.prototype.isDataRoamingEnabled=function(){return core.cordova(this,"isDataRoamingEnabled",{platforms:["Android"]},arguments)};Diagnostic.prototype.isADBModeEnabled=function(){return core.cordova(this,"isADBModeEnabled",{platforms:["Android"]},arguments)};Diagnostic.prototype.isDeviceRooted=function(){return core.cordova(this,"isDeviceRooted",{platforms:["Android"]},arguments)};Diagnostic.prototype.isCameraRollAuthorized=function(){return core.cordova(this,"isCameraRollAuthorized",{platforms:["iOS"]},arguments)};Diagnostic.prototype.getCameraRollAuthorizationStatus=function(){return core.cordova(this,"getCameraRollAuthorizationStatus",{platforms:["iOS"]},arguments)};Diagnostic.prototype.requestCameraRollAuthorization=function(){return core.cordova(this,"requestCameraRollAuthorization",{platforms:["iOS"]},arguments)};Diagnostic.prototype.isRemoteNotificationsEnabled=function(){return core.cordova(this,"isRemoteNotificationsEnabled",{platforms:["iOS","Android"]},arguments)};Diagnostic.prototype.isRegisteredForRemoteNotifications=function(){return core.cordova(this,"isRegisteredForRemoteNotifications",{platforms:["iOS"]},arguments)};Diagnostic.prototype.getRemoteNotificationsAuthorizationStatus=function(){return core.cordova(this,"getRemoteNotificationsAuthorizationStatus",{platforms:["iOS"]},arguments)};Diagnostic.prototype.requestRemoteNotificationsAuthorization=function(types,omitRegistration){return core.cordova(this,"requestRemoteNotificationsAuthorization",{platforms:["iOS"]},arguments)};Diagnostic.prototype.getRemoteNotificationTypes=function(){return core.cordova(this,"getRemoteNotificationTypes",{platforms:["iOS"]},arguments)};Diagnostic.prototype.isRemindersAuthorized=function(){return core.cordova(this,"isRemindersAuthorized",{platforms:["iOS"]},arguments)};Diagnostic.prototype.getRemindersAuthorizationStatus=function(){return core.cordova(this,"getRemindersAuthorizationStatus",{platforms:["iOS"]},arguments)};Diagnostic.prototype.requestRemindersAuthorization=function(){return core.cordova(this,"requestRemindersAuthorization",{platforms:["iOS"]},arguments)};Diagnostic.prototype.isBackgroundRefreshAuthorized=function(){return core.cordova(this,"isBackgroundRefreshAuthorized",{platforms:["iOS"]},arguments)};Diagnostic.prototype.getBackgroundRefreshStatus=function(){return core.cordova(this,"getBackgroundRefreshStatus",{platforms:["iOS"]},arguments)};Diagnostic.prototype.requestBluetoothAuthorization=function(){return core.cordova(this,"requestBluetoothAuthorization",{platforms:["iOS"]},arguments)};Diagnostic.prototype.isMotionAvailable=function(){return core.cordova(this,"isMotionAvailable",{platforms:["iOS"]},arguments)};Diagnostic.prototype.isMotionRequestOutcomeAvailable=function(){return core.cordova(this,"isMotionRequestOutcomeAvailable",{platforms:["iOS"]},arguments)};Diagnostic.prototype.requestMotionAuthorization=function(){return core.cordova(this,"requestMotionAuthorization",{platforms:["iOS"]},arguments)};Diagnostic.prototype.getMotionAuthorizationStatus=function(){return core.cordova(this,"getMotionAuthorizationStatus",{platforms:["iOS"]},arguments)};Diagnostic.prototype.getLocationAccuracyAuthorization=function(){return core.cordova(this,"getLocationAccuracyAuthorization",{platform:["iOS"]},arguments)};Diagnostic.prototype.requestTemporaryFullAccuracyAuthorization=function(purpose){return core.cordova(this,"requestTemporaryFullAccuracyAuthorization",{platforms:["iOS"]},arguments)};Diagnostic.prototype.registerLocationAccuracyAuthorizationChangeHandler=function(handler){return core.cordova(this,"registerLocationAccuracyAuthorizationChangeHandler",{platforms:["iOS"],sync:true},arguments)};Object.defineProperty(Diagnostic.prototype,"permissionStatus",{get:function(){return core.cordovaPropertyGet(this,"permissionStatus")},set:function(value){core.cordovaPropertySet(this,"permissionStatus",value)},enumerable:false,configurable:true});Object.defineProperty(Diagnostic.prototype,"NFCState",{get:function(){return core.cordovaPropertyGet(this,"NFCState")},set:function(value){core.cordovaPropertySet(this,"NFCState",value)},enumerable:false,configurable:true});Object.defineProperty(Diagnostic.prototype,"motionStatus",{get:function(){return core.cordovaPropertyGet(this,"motionStatus")},set:function(value){core.cordovaPropertySet(this,"motionStatus",value)},enumerable:false,configurable:true});Diagnostic.pluginName="Diagnostic";Diagnostic.plugin="cordova.plugins.diagnostic";Diagnostic.pluginRef="cordova.plugins.diagnostic";Diagnostic.repo="https://github.com/dpa99c/cordova-diagnostic-plugin";Diagnostic.platforms=["Android","iOS","Windows"];Diagnostic.decorators=[{type:core$1.Injectable}];return Diagnostic}(core.AwesomeCordovaNativePlugin);var Diagnostic$1=Object.freeze({__proto__:null,Diagnostic:Diagnostic});var awesomeCordovaPlugins={...AppVersion$1,...BarcodeScanner$1,...Calendar$1,...Camera$1,...Device$1,...File$1,...FileOpener$1,...GeoLocation,...MediaCapture$1,...Network$1,...Sqlite,...Vibration$1,...LocationAccuracy$1,...Diagnostic$1};return awesomeCordovaPlugins}));/*! iScroll v5.2.0 ~ (c) 2008-2016 Matteo Spinelli ~ http://cubiq.org/license */
|
|
973
|
+
!function(a,b,c,d){"use strict";function e(a,b,c){return setTimeout(j(a,c),b)}function f(a,b,c){return Array.isArray(a)?(g(a,c[b],c),!0):!1}function g(a,b,c){var e;if(a)if(a.forEach)a.forEach(b,c);else if(a.length!==d)for(e=0;e<a.length;)b.call(c,a[e],e,a),e++;else for(e in a)a.hasOwnProperty(e)&&b.call(c,a[e],e,a)}function h(b,c,d){var e="DEPRECATED METHOD: "+c+"\n"+d+" AT \n";return function(){var c=new Error("get-stack-trace"),d=c&&c.stack?c.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",f=a.console&&(a.console.warn||a.console.log);return f&&f.call(a.console,e,d),b.apply(this,arguments)}}function i(a,b,c){var d,e=b.prototype;d=a.prototype=Object.create(e),d.constructor=a,d._super=e,c&&la(d,c)}function j(a,b){return function(){return a.apply(b,arguments)}}function k(a,b){return typeof a==oa?a.apply(b?b[0]||d:d,b):a}function l(a,b){return a===d?b:a}function m(a,b,c){g(q(b),(function(b){a.addEventListener(b,c,!1)}))}function n(a,b,c){g(q(b),(function(b){a.removeEventListener(b,c,!1)}))}function o(a,b){for(;a;){if(a==b)return!0;a=a.parentNode}return!1}function p(a,b){return a.indexOf(b)>-1}function q(a){return a.trim().split(/\s+/g)}function r(a,b,c){if(a.indexOf&&!c)return a.indexOf(b);for(var d=0;d<a.length;){if(c&&a[d][c]==b||!c&&a[d]===b)return d;d++}return-1}function s(a){return Array.prototype.slice.call(a,0)}function t(a,b,c){for(var d=[],e=[],f=0;f<a.length;){var g=b?a[f][b]:a[f];r(e,g)<0&&d.push(a[f]),e[f]=g,f++}return c&&(d=b?d.sort((function(a,c){return a[b]>c[b]})):d.sort()),d}function u(a,b){for(var c,e,f=b[0].toUpperCase()+b.slice(1),g=0;g<ma.length;){if(c=ma[g],e=c?c+f:b,e in a)return e;g++}return d}function v(){return ua++}function w(b){var c=b.ownerDocument||b;return c.defaultView||c.parentWindow||a}function x(a,b){var c=this;this.manager=a,this.callback=b,this.element=a.element,this.target=a.options.inputTarget,this.domHandler=function(b){k(a.options.enable,[a])&&c.handler(b)},this.init()}function y(a){var b,c=a.options.inputClass;return new(b=c?c:xa?M:ya?P:wa?R:L)(a,z)}function z(a,b,c){var d=c.pointers.length,e=c.changedPointers.length,f=b&Ea&&d-e===0,g=b&(Ga|Ha)&&d-e===0;c.isFirst=!!f,c.isFinal=!!g,f&&(a.session={}),c.eventType=b,A(a,c),a.emit("hammer.input",c),a.recognize(c),a.session.prevInput=c}function A(a,b){var c=a.session,d=b.pointers,e=d.length;c.firstInput||(c.firstInput=D(b)),e>1&&!c.firstMultiple?c.firstMultiple=D(b):1===e&&(c.firstMultiple=!1);var f=c.firstInput,g=c.firstMultiple,h=g?g.center:f.center,i=b.center=E(d);b.timeStamp=ra(),b.deltaTime=b.timeStamp-f.timeStamp,b.angle=I(h,i),b.distance=H(h,i),B(c,b),b.offsetDirection=G(b.deltaX,b.deltaY);var j=F(b.deltaTime,b.deltaX,b.deltaY);b.overallVelocityX=j.x,b.overallVelocityY=j.y,b.overallVelocity=qa(j.x)>qa(j.y)?j.x:j.y,b.scale=g?K(g.pointers,d):1,b.rotation=g?J(g.pointers,d):0,b.maxPointers=c.prevInput?b.pointers.length>c.prevInput.maxPointers?b.pointers.length:c.prevInput.maxPointers:b.pointers.length,C(c,b);var k=a.element;o(b.srcEvent.target,k)&&(k=b.srcEvent.target),b.target=k}function B(a,b){var c=b.center,d=a.offsetDelta||{},e=a.prevDelta||{},f=a.prevInput||{};b.eventType!==Ea&&f.eventType!==Ga||(e=a.prevDelta={x:f.deltaX||0,y:f.deltaY||0},d=a.offsetDelta={x:c.x,y:c.y}),b.deltaX=e.x+(c.x-d.x),b.deltaY=e.y+(c.y-d.y)}function C(a,b){var c,e,f,g,h=a.lastInterval||b,i=b.timeStamp-h.timeStamp;if(b.eventType!=Ha&&(i>Da||h.velocity===d)){var j=b.deltaX-h.deltaX,k=b.deltaY-h.deltaY,l=F(i,j,k);e=l.x,f=l.y,c=qa(l.x)>qa(l.y)?l.x:l.y,g=G(j,k),a.lastInterval=b}else c=h.velocity,e=h.velocityX,f=h.velocityY,g=h.direction;b.velocity=c,b.velocityX=e,b.velocityY=f,b.direction=g}function D(a){for(var b=[],c=0;c<a.pointers.length;)b[c]={clientX:pa(a.pointers[c].clientX),clientY:pa(a.pointers[c].clientY)},c++;return{timeStamp:ra(),pointers:b,center:E(b),deltaX:a.deltaX,deltaY:a.deltaY}}function E(a){var b=a.length;if(1===b)return{x:pa(a[0].clientX),y:pa(a[0].clientY)};for(var c=0,d=0,e=0;b>e;)c+=a[e].clientX,d+=a[e].clientY,e++;return{x:pa(c/b),y:pa(d/b)}}function F(a,b,c){return{x:b/a||0,y:c/a||0}}function G(a,b){return a===b?Ia:qa(a)>=qa(b)?0>a?Ja:Ka:0>b?La:Ma}function H(a,b,c){c||(c=Qa);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return Math.sqrt(d*d+e*e)}function I(a,b,c){c||(c=Qa);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return 180*Math.atan2(e,d)/Math.PI}function J(a,b){return I(b[1],b[0],Ra)+I(a[1],a[0],Ra)}function K(a,b){return H(b[0],b[1],Ra)/H(a[0],a[1],Ra)}function L(){this.evEl=Ta,this.evWin=Ua,this.pressed=!1,x.apply(this,arguments)}function M(){this.evEl=Xa,this.evWin=Ya,x.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function N(){this.evTarget=$a,this.evWin=_a,this.started=!1,x.apply(this,arguments)}function O(a,b){var c=s(a.touches),d=s(a.changedTouches);return b&(Ga|Ha)&&(c=t(c.concat(d),"identifier",!0)),[c,d]}function P(){this.evTarget=bb,this.targetIds={},x.apply(this,arguments)}function Q(a,b){var c=s(a.touches),d=this.targetIds;if(b&(Ea|Fa)&&1===c.length)return d[c[0].identifier]=!0,[c,c];var e,f,g=s(a.changedTouches),h=[],i=this.target;if(f=c.filter((function(a){return o(a.target,i)})),b===Ea)for(e=0;e<f.length;)d[f[e].identifier]=!0,e++;for(e=0;e<g.length;)d[g[e].identifier]&&h.push(g[e]),b&(Ga|Ha)&&delete d[g[e].identifier],e++;return h.length?[t(f.concat(h),"identifier",!0),h]:void 0}function R(){x.apply(this,arguments);var a=j(this.handler,this);this.touch=new P(this.manager,a),this.mouse=new L(this.manager,a),this.primaryTouch=null,this.lastTouches=[]}function S(a,b){a&Ea?(this.primaryTouch=b.changedPointers[0].identifier,T.call(this,b)):a&(Ga|Ha)&&T.call(this,b)}function T(a){var b=a.changedPointers[0];if(b.identifier===this.primaryTouch){var c={x:b.clientX,y:b.clientY};this.lastTouches.push(c);var d=this.lastTouches,e=function(){var a=d.indexOf(c);a>-1&&d.splice(a,1)};setTimeout(e,cb)}}function U(a){for(var b=a.srcEvent.clientX,c=a.srcEvent.clientY,d=0;d<this.lastTouches.length;d++){var e=this.lastTouches[d],f=Math.abs(b-e.x),g=Math.abs(c-e.y);if(db>=f&&db>=g)return!0}return!1}function V(a,b){this.manager=a,this.set(b)}function W(a){if(p(a,jb))return jb;var b=p(a,kb),c=p(a,lb);return b&&c?jb:b||c?b?kb:lb:p(a,ib)?ib:hb}function X(){if(!fb)return!1;var b={},c=a.CSS&&a.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(d){b[d]=c?a.CSS.supports("touch-action",d):!0})),b}function Y(a){this.options=la({},this.defaults,a||{}),this.id=v(),this.manager=null,this.options.enable=l(this.options.enable,!0),this.state=nb,this.simultaneous={},this.requireFail=[]}function Z(a){return a&sb?"cancel":a&qb?"end":a&pb?"move":a&ob?"start":""}function $(a){return a==Ma?"down":a==La?"up":a==Ja?"left":a==Ka?"right":""}function _(a,b){var c=b.manager;return c?c.get(a):a}function aa(){Y.apply(this,arguments)}function ba(){aa.apply(this,arguments),this.pX=null,this.pY=null}function ca(){aa.apply(this,arguments)}function da(){Y.apply(this,arguments),this._timer=null,this._input=null}function ea(){aa.apply(this,arguments)}function fa(){aa.apply(this,arguments)}function ga(){Y.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function ha(a,b){return b=b||{},b.recognizers=l(b.recognizers,ha.defaults.preset),new ia(a,b)}function ia(a,b){this.options=la({},ha.defaults,b||{}),this.options.inputTarget=this.options.inputTarget||a,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=a,this.input=y(this),this.touchAction=new V(this,this.options.touchAction),ja(this,!0),g(this.options.recognizers,(function(a){var b=this.add(new a[0](a[1]));a[2]&&b.recognizeWith(a[2]),a[3]&&b.requireFailure(a[3])}),this)}function ja(a,b){var c=a.element;if(c.style){var d;g(a.options.cssProps,(function(e,f){d=u(c.style,f),b?(a.oldCssProps[d]=c.style[d],c.style[d]=e):c.style[d]=a.oldCssProps[d]||""})),b||(a.oldCssProps={})}}function ka(a,c){var d=b.createEvent("Event");d.initEvent(a,!0,!0),d.gesture=c,c.target.dispatchEvent(d)}var la,ma=["","webkit","Moz","MS","ms","o"],na=b.createElement("div"),oa="function",pa=Math.round,qa=Math.abs,ra=Date.now;la="function"!=typeof Object.assign?function(a){if(a===d||null===a)throw new TypeError("Cannot convert undefined or null to object");for(var b=Object(a),c=1;c<arguments.length;c++){var e=arguments[c];if(e!==d&&null!==e)for(var f in e)e.hasOwnProperty(f)&&(b[f]=e[f])}return b}:Object.assign;var sa=h((function(a,b,c){for(var e=Object.keys(b),f=0;f<e.length;)(!c||c&&a[e[f]]===d)&&(a[e[f]]=b[e[f]]),f++;return a}),"extend","Use `assign`."),ta=h((function(a,b){return sa(a,b,!0)}),"merge","Use `assign`."),ua=1,va=/mobile|tablet|ip(ad|hone|od)|android/i,wa="ontouchstart"in a,xa=u(a,"PointerEvent")!==d,ya=wa&&va.test(navigator.userAgent),za="touch",Aa="pen",Ba="mouse",Ca="kinect",Da=25,Ea=1,Fa=2,Ga=4,Ha=8,Ia=1,Ja=2,Ka=4,La=8,Ma=16,Na=Ja|Ka,Oa=La|Ma,Pa=Na|Oa,Qa=["x","y"],Ra=["clientX","clientY"];x.prototype={handler:function(){},init:function(){this.evEl&&m(this.element,this.evEl,this.domHandler),this.evTarget&&m(this.target,this.evTarget,this.domHandler),this.evWin&&m(w(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&n(this.element,this.evEl,this.domHandler),this.evTarget&&n(this.target,this.evTarget,this.domHandler),this.evWin&&n(w(this.element),this.evWin,this.domHandler)}};var Sa={mousedown:Ea,mousemove:Fa,mouseup:Ga},Ta="mousedown",Ua="mousemove mouseup";i(L,x,{handler:function(a){var b=Sa[a.type];b&Ea&&0===a.button&&(this.pressed=!0),b&Fa&&1!==a.which&&(b=Ga),this.pressed&&(b&Ga&&(this.pressed=!1),this.callback(this.manager,b,{pointers:[a],changedPointers:[a],pointerType:Ba,srcEvent:a}))}});var Va={pointerdown:Ea,pointermove:Fa,pointerup:Ga,pointercancel:Ha,pointerout:Ha},Wa={2:za,3:Aa,4:Ba,5:Ca},Xa="pointerdown",Ya="pointermove pointerup pointercancel";a.MSPointerEvent&&!a.PointerEvent&&(Xa="MSPointerDown",Ya="MSPointerMove MSPointerUp MSPointerCancel"),i(M,x,{handler:function(a){var b=this.store,c=!1,d=a.type.toLowerCase().replace("ms",""),e=Va[d],f=Wa[a.pointerType]||a.pointerType,g=f==za,h=r(b,a.pointerId,"pointerId");e&Ea&&(0===a.button||g)?0>h&&(b.push(a),h=b.length-1):e&(Ga|Ha)&&(c=!0),0>h||(b[h]=a,this.callback(this.manager,e,{pointers:b,changedPointers:[a],pointerType:f,srcEvent:a}),c&&b.splice(h,1))}});var Za={touchstart:Ea,touchmove:Fa,touchend:Ga,touchcancel:Ha},$a="touchstart",_a="touchstart touchmove touchend touchcancel";i(N,x,{handler:function(a){var b=Za[a.type];if(b===Ea&&(this.started=!0),this.started){var c=O.call(this,a,b);b&(Ga|Ha)&&c[0].length-c[1].length===0&&(this.started=!1),this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:za,srcEvent:a})}}});var ab={touchstart:Ea,touchmove:Fa,touchend:Ga,touchcancel:Ha},bb="touchstart touchmove touchend touchcancel";i(P,x,{handler:function(a){var b=ab[a.type],c=Q.call(this,a,b);c&&this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:za,srcEvent:a})}});var cb=2500,db=25;i(R,x,{handler:function(a,b,c){var d=c.pointerType==za,e=c.pointerType==Ba;if(!(e&&c.sourceCapabilities&&c.sourceCapabilities.firesTouchEvents)){if(d)S.call(this,b,c);else if(e&&U.call(this,c))return;this.callback(a,b,c)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var eb=u(na.style,"touchAction"),fb=eb!==d,gb="compute",hb="auto",ib="manipulation",jb="none",kb="pan-x",lb="pan-y",mb=X();V.prototype={set:function(a){a==gb&&(a=this.compute()),fb&&this.manager.element.style&&mb[a]&&(this.manager.element.style[eb]=a),this.actions=a.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var a=[];return g(this.manager.recognizers,(function(b){k(b.options.enable,[b])&&(a=a.concat(b.getTouchAction()))})),W(a.join(" "))},preventDefaults:function(a){var b=a.srcEvent,c=a.offsetDirection;if(this.manager.session.prevented)return void b.preventDefault();var d=this.actions,e=p(d,jb)&&!mb[jb],f=p(d,lb)&&!mb[lb],g=p(d,kb)&&!mb[kb];if(e){var h=1===a.pointers.length,i=a.distance<2,j=a.deltaTime<250;if(h&&i&&j)return}return g&&f?void 0:e||f&&c&Na||g&&c&Oa?this.preventSrc(b):void 0},preventSrc:function(a){this.manager.session.prevented=!0,a.preventDefault()}};var nb=1,ob=2,pb=4,qb=8,rb=qb,sb=16,tb=32;Y.prototype={defaults:{},set:function(a){return la(this.options,a),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(a){if(f(a,"recognizeWith",this))return this;var b=this.simultaneous;return a=_(a,this),b[a.id]||(b[a.id]=a,a.recognizeWith(this)),this},dropRecognizeWith:function(a){return f(a,"dropRecognizeWith",this)?this:(a=_(a,this),delete this.simultaneous[a.id],this)},requireFailure:function(a){if(f(a,"requireFailure",this))return this;var b=this.requireFail;return a=_(a,this),-1===r(b,a)&&(b.push(a),a.requireFailure(this)),this},dropRequireFailure:function(a){if(f(a,"dropRequireFailure",this))return this;a=_(a,this);var b=r(this.requireFail,a);return b>-1&&this.requireFail.splice(b,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(a){return!!this.simultaneous[a.id]},emit:function(a){function b(b){c.manager.emit(b,a)}var c=this,d=this.state;qb>d&&b(c.options.event+Z(d)),b(c.options.event),a.additionalEvent&&b(a.additionalEvent),d>=qb&&b(c.options.event+Z(d))},tryEmit:function(a){return this.canEmit()?this.emit(a):void(this.state=tb)},canEmit:function(){for(var a=0;a<this.requireFail.length;){if(!(this.requireFail[a].state&(tb|nb)))return!1;a++}return!0},recognize:function(a){var b=la({},a);return k(this.options.enable,[this,b])?(this.state&(rb|sb|tb)&&(this.state=nb),this.state=this.process(b),void(this.state&(ob|pb|qb|sb)&&this.tryEmit(b))):(this.reset(),void(this.state=tb))},process:function(a){},getTouchAction:function(){},reset:function(){}},i(aa,Y,{defaults:{pointers:1},attrTest:function(a){var b=this.options.pointers;return 0===b||a.pointers.length===b},process:function(a){var b=this.state,c=a.eventType,d=b&(ob|pb),e=this.attrTest(a);return d&&(c&Ha||!e)?b|sb:d||e?c&Ga?b|qb:b&ob?b|pb:ob:tb}}),i(ba,aa,{defaults:{event:"pan",threshold:10,pointers:1,direction:Pa},getTouchAction:function(){var a=this.options.direction,b=[];return a&Na&&b.push(lb),a&Oa&&b.push(kb),b},directionTest:function(a){var b=this.options,c=!0,d=a.distance,e=a.direction,f=a.deltaX,g=a.deltaY;return e&b.direction||(b.direction&Na?(e=0===f?Ia:0>f?Ja:Ka,c=f!=this.pX,d=Math.abs(a.deltaX)):(e=0===g?Ia:0>g?La:Ma,c=g!=this.pY,d=Math.abs(a.deltaY))),a.direction=e,c&&d>b.threshold&&e&b.direction},attrTest:function(a){return aa.prototype.attrTest.call(this,a)&&(this.state&ob||!(this.state&ob)&&this.directionTest(a))},emit:function(a){this.pX=a.deltaX,this.pY=a.deltaY;var b=$(a.direction);b&&(a.additionalEvent=this.options.event+b),this._super.emit.call(this,a)}}),i(ca,aa,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[jb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.scale-1)>this.options.threshold||this.state&ob)},emit:function(a){if(1!==a.scale){var b=a.scale<1?"in":"out";a.additionalEvent=this.options.event+b}this._super.emit.call(this,a)}}),i(da,Y,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[hb]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,f=a.deltaTime>b.time;if(this._input=a,!d||!c||a.eventType&(Ga|Ha)&&!f)this.reset();else if(a.eventType&Ea)this.reset(),this._timer=e((function(){this.state=rb,this.tryEmit()}),b.time,this);else if(a.eventType&Ga)return rb;return tb},reset:function(){clearTimeout(this._timer)},emit:function(a){this.state===rb&&(a&&a.eventType&Ga?this.manager.emit(this.options.event+"up",a):(this._input.timeStamp=ra(),this.manager.emit(this.options.event,this._input)))}}),i(ea,aa,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[jb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.rotation)>this.options.threshold||this.state&ob)}}),i(fa,aa,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Na|Oa,pointers:1},getTouchAction:function(){return ba.prototype.getTouchAction.call(this)},attrTest:function(a){var b,c=this.options.direction;return c&(Na|Oa)?b=a.overallVelocity:c&Na?b=a.overallVelocityX:c&Oa&&(b=a.overallVelocityY),this._super.attrTest.call(this,a)&&c&a.offsetDirection&&a.distance>this.options.threshold&&a.maxPointers==this.options.pointers&&qa(b)>this.options.velocity&&a.eventType&Ga},emit:function(a){var b=$(a.offsetDirection);b&&this.manager.emit(this.options.event+b,a),this.manager.emit(this.options.event,a)}}),i(ga,Y,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ib]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,f=a.deltaTime<b.time;if(this.reset(),a.eventType&Ea&&0===this.count)return this.failTimeout();if(d&&f&&c){if(a.eventType!=Ga)return this.failTimeout();var g=this.pTime?a.timeStamp-this.pTime<b.interval:!0,h=!this.pCenter||H(this.pCenter,a.center)<b.posThreshold;this.pTime=a.timeStamp,this.pCenter=a.center,h&&g?this.count+=1:this.count=1,this._input=a;var i=this.count%b.taps;if(0===i)return this.hasRequireFailures()?(this._timer=e((function(){this.state=rb,this.tryEmit()}),b.interval,this),ob):rb}return tb},failTimeout:function(){return this._timer=e((function(){this.state=tb}),this.options.interval,this),tb},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==rb&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),ha.VERSION="2.0.7",ha.defaults={domEvents:!1,touchAction:gb,enable:!0,inputTarget:null,inputClass:null,preset:[[ea,{enable:!1}],[ca,{enable:!1},["rotate"]],[fa,{direction:Na}],[ba,{direction:Na},["swipe"]],[ga],[ga,{event:"doubletap",taps:2},["tap"]],[da]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var ub=1,vb=2;ia.prototype={set:function(a){return la(this.options,a),a.touchAction&&this.touchAction.update(),a.inputTarget&&(this.input.destroy(),this.input.target=a.inputTarget,this.input.init()),this},stop:function(a){this.session.stopped=a?vb:ub},recognize:function(a){var b=this.session;if(!b.stopped){this.touchAction.preventDefaults(a);var c,d=this.recognizers,e=b.curRecognizer;(!e||e&&e.state&rb)&&(e=b.curRecognizer=null);for(var f=0;f<d.length;)c=d[f],b.stopped===vb||e&&c!=e&&!c.canRecognizeWith(e)?c.reset():c.recognize(a),!e&&c.state&(ob|pb|qb)&&(e=b.curRecognizer=c),f++}},get:function(a){if(a instanceof Y)return a;for(var b=this.recognizers,c=0;c<b.length;c++)if(b[c].options.event==a)return b[c];return null},add:function(a){if(f(a,"add",this))return this;var b=this.get(a.options.event);return b&&this.remove(b),this.recognizers.push(a),a.manager=this,this.touchAction.update(),a},remove:function(a){if(f(a,"remove",this))return this;if(a=this.get(a)){var b=this.recognizers,c=r(b,a);-1!==c&&(b.splice(c,1),this.touchAction.update())}return this},on:function(a,b){if(a!==d&&b!==d){var c=this.handlers;return g(q(a),(function(a){c[a]=c[a]||[],c[a].push(b)})),this}},off:function(a,b){if(a!==d){var c=this.handlers;return g(q(a),(function(a){b?c[a]&&c[a].splice(r(c[a],b),1):delete c[a]})),this}},emit:function(a,b){this.options.domEvents&&ka(a,b);var c=this.handlers[a]&&this.handlers[a].slice();if(c&&c.length){b.type=a,b.preventDefault=function(){b.srcEvent.preventDefault()};for(var d=0;d<c.length;)c[d](b),d++}},destroy:function(){this.element&&ja(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},la(ha,{INPUT_START:Ea,INPUT_MOVE:Fa,INPUT_END:Ga,INPUT_CANCEL:Ha,STATE_POSSIBLE:nb,STATE_BEGAN:ob,STATE_CHANGED:pb,STATE_ENDED:qb,STATE_RECOGNIZED:rb,STATE_CANCELLED:sb,STATE_FAILED:tb,DIRECTION_NONE:Ia,DIRECTION_LEFT:Ja,DIRECTION_RIGHT:Ka,DIRECTION_UP:La,DIRECTION_DOWN:Ma,DIRECTION_HORIZONTAL:Na,DIRECTION_VERTICAL:Oa,DIRECTION_ALL:Pa,Manager:ia,Input:x,TouchAction:V,TouchInput:P,MouseInput:L,PointerEventInput:M,TouchMouseInput:R,SingleTouchInput:N,Recognizer:Y,AttrRecognizer:aa,Tap:ga,Pan:ba,Swipe:fa,Pinch:ca,Rotate:ea,Press:da,on:m,off:n,each:g,merge:ta,extend:sa,assign:la,inherit:i,bindFn:j,prefixed:u});var wb="undefined"!=typeof a?a:"undefined"!=typeof self?self:{};wb.Hammer=ha,"function"==typeof define&&define.amd?define((function(){return ha})):"undefined"!=typeof module&&module.exports?module.exports=ha:a[c]=ha}(window,document,"Hammer");"use strict";$.widget("wm.datatable",{options:{data:[],statusMsg:"",colDefs:[],rowActions:[],headerConfig:[],sortInfo:{field:"",direction:""},isMobile:false,enableSort:true,filtermode:"",activeRow:undefined,height:"100%",showHeader:true,selectFirstRow:false,showNewRow:true,showRowIndex:false,enableRowSelection:true,enableColumnSelection:false,multiselect:false,filterNullRecords:true,navigation:"",isdynamictable:"",cssClassNames:{tableRow:"app-datagrid-row",headerCell:"app-datagrid-header-cell",groupHeaderCell:"app-datagrid-group-header-cell",tableCell:"app-datagrid-cell",grid:"",gridDefault:"table",gridBody:"app-datagrid-body",gridFooter:"app-datagrid-footer",deleteRow:"danger",ascIcon:"wi wi-long-arrow-up",descIcon:"wi wi-long-arrow-down",selectedColumn:"selected-column",rowExpandIcon:"wi wi-minus-square",rowCollapseIcon:"wi wi-plus-square",gridRowExpansionClass:"table-row-expansion",expandedRowClass:"expanded"},dataStates:{loading:"Loading...",ready:"",error:"An error occurred in loading the data.",nodata:"No data found."},messages:{selectField:"Select Field"},loadingicon:"",startRowIndex:1,editmode:"",actionsEnabled:{edit:true,new:true},rowExpansionEnabled:false,rowDef:{position:"0",closeothers:false,columnwidth:"30px"},summaryRow:false,summaryRowDefs:[],summaryRowDefsObject:[],searchHandler:function(){},sortHandler:function(){}},customColumnDefs:{checkbox:{field:"checkbox",type:"custom",displayName:"",sortable:false,searchable:false,resizable:false,selectable:false,readonly:true,style:"width: 50px; text-align: center;",textAlignment:"center",isMultiSelectCol:true,show:true},radio:{field:"radio",type:"custom",displayName:"",sortable:false,searchable:false,resizable:false,selectable:false,readonly:true,style:"width: 50px; text-align: center;",textAlignment:"center",show:true},__expand:{field:"__expand",type:"custom",displayName:"",sortable:false,searchable:false,resizable:false,selectable:false,readonly:true,style:"text-align: center;",textAlignment:"center",show:true,width:"30px"},rowIndex:{field:"rowIndex",type:"custom",displayName:"S. No.",sortable:false,searchable:false,selectable:false,readonly:true,style:"text-align: left;",textAlignment:"left",show:true}},CONSTANTS:{QUICK_EDIT:"quickedit",INLINE:"inline",FORM:"form",DIALOG:"dialog",SEARCH:"search",MULTI_COLUMN:"multicolumn"},Utils:{random:function(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)},isDefined:function(value){return value!==undefined},isObject:function(value){return value!==null&&typeof value==="object"},getObjectIndex:function(data,obj){var matchIndex=-1;if(!Array.isArray(data)){return-1}data.some((function(data,index){if(_.isEqual(data,obj)){matchIndex=index;return true}}));return matchIndex},generateGuid:function(){var random=this.random;return random()+random()+"-"+random()+"-"+random()+"-"+random()+"-"+random()+random()+random()},isValidHtml:function(htm){var validHtmlRegex=/<[a-z][\s\S]*>/i;return validHtmlRegex.test(htm)},isMac:function(){return navigator.platform.toUpperCase().indexOf("MAC")>=0},isDeleteKey:function(event){return this.isMac()&&event.which===8||event.which===46}},_setStyles:function($el,styleString){if(!styleString){return}var styles=styleString.split(";");styles.forEach((function(styleBit){var parts=styleBit.split(":");var property,value;if(parts.length===2){property=parts[0].trim();value=parts[1].trim();$el.css(property,value)}}));return styleString},_getColumnSortDirection:function(field){var sortInfo=this.options.sortInfo;return field===sortInfo.field?sortInfo.direction:""},_toggleSpacingClasses:function(value){switch(value){case"normal":this.tableContainer.removeClass("table-condensed");if(this.gridSearch){this.gridSearch.find(".form-group").removeClass("form-group-sm");this.gridSearch.find("select").removeClass("input-sm");this.gridSearch.find(".input-group").removeClass("input-group-sm")}break;case"condensed":this.tableContainer.addClass("table-condensed");if(this.gridSearch){this.gridSearch.find(".form-group").addClass("form-group-sm");this.gridSearch.find("select").addClass("input-sm");this.gridSearch.find(".input-group").addClass("input-group-sm")}break}},_getColSpan:function(cols){var colSpan=0,self=this;_.forEach(cols,(function(col){var colDef;if(col.isGroup){colSpan+=self._getColSpan(col.columns)}else{colDef=_.find(self.preparedHeaderData,{field:col.field});colSpan=!_.isUndefined(colDef.show)&&!colDef.show?colSpan:colSpan+1}}));return colSpan},_setColSpan:function(config){var self=this;_.forEach(config,(function(col){if(col.isGroup){col.colspan=self._getColSpan(col.columns);self.gridHeaderElement.find('th[data-col-group="'+col.field+'"]').attr("colspan",col.colspan);self._setColSpan(col.columns)}}))},_getHeaderTemplate:function(){var $colgroup=$("<colgroup></colgroup>"),$htm=this.gridHeaderElement.empty(),isDefined=this.Utils.isDefined,sortInfo=this.options.sortInfo,sortField=sortInfo.field,self=this,rowTemplates=[],headerConfig=this.options.headerConfig,headerGroupClass=self.options.cssClassNames.groupHeaderCell,$row;function generateHeaderCell(value,index){var id=index,field=value.field,headerLabel=self.Utils.isDefined(value.displayName)?value.displayName:field||"",titleLabel=headerLabel,sortEnabled=self.options.enableSort&&(_.isUndefined(value.show)||value.show)&&(_.isUndefined(value.sortable)||value.sortable),headerClasses=self.options.cssClassNames.headerCell,sortClass,tl="",$th,$col,$sortSpan,$sortIcon;headerLabel=!self.Utils.isDefined(headerLabel)||headerLabel===""?" ":headerLabel;$col=$("<col/>");if(value.style){self._setStyles($col,value.style)}$colgroup.append($col);if(isDefined(value.class)){headerClasses+=" "+value.class}if(value.selected){headerClasses+=" "+self.options.cssClassNames.selectedColumn+" "}if(field==="checkbox"||field==="radio"){headerClasses+=" grid-col-small"}tl+="<th";if((_.isUndefined(value.resizable)||value.resizable)&&(_.isUndefined(value.show)||value.show)){tl+=" data-col-resizable"}if(self.options.enableColumnSelection&&(_.isUndefined(value.selectable)||value.selectable)){tl+=" data-col-selectable"}if(sortEnabled){tl+=" data-col-sortable"}tl+="></th>";$th=$(tl);$th.attr({"data-col-id":id,"data-col-field":field,title:titleLabel});self._setStyles($th,"text-align: "+value.textAlignment);$th.addClass(headerClasses);if(field==="checkbox"){$th.append('<input type="checkbox" />')}$th.append('<span class="header-data">'+headerLabel+"</span>");if(sortEnabled){$sortSpan=$('<span class="sort-buttons-container"></span>');$sortIcon=$('<i class="sort-icon"></i>');if(sortField&&sortField===value.field&&sortInfo.direction){sortClass=sortInfo.direction==="asc"?self.options.cssClassNames.ascIcon:self.options.cssClassNames.descIcon;$sortSpan.addClass("active");$sortIcon.addClass(sortClass+" "+sortInfo.direction)}$th.append($sortSpan.append($sortIcon))}return $th}function generateRow(cols,i){var $thList=[];_.forEach(cols,(function(col){var index,value,classes,styles,$groupTl;if(col.columns&&col.columns.length){$groupTl=$("<th></th>");classes=headerGroupClass+" "+(col.class||"");styles="text-align: "+col.textAlignment+";background-color: "+(col.backgroundColor||"")+";";$groupTl.attr({"data-col-group":col.field,class:classes,title:col.displayName});self._setStyles($groupTl,styles);$groupTl.append('<span class="header-data">'+col.displayName+"</span>");$thList.push($groupTl);generateRow(col.columns,i+1)}else{index=_.findIndex(self.preparedHeaderData,{field:col.field});value=self.preparedHeaderData[index];if(value){$thList.push(generateHeaderCell(value,index))}}}));rowTemplates[i]=rowTemplates[i]||[];rowTemplates[i]=rowTemplates[i].concat($thList)}if(_.isEmpty(headerConfig)){$row=$("<tr></tr>");self.preparedHeaderData.forEach((function(value,index){$row.append(generateHeaderCell(value,index))}));$htm.append($row)}else{generateRow(headerConfig,0);rowTemplates.forEach((function($thList,index){$row=$('<tr role="row" tabindex="0"></tr>');var rowSpan=rowTemplates.length-index;$thList.forEach((function($th){if(rowSpan>1&&$th.hasClass("app-datagrid-header-cell")){$th.attr("rowspan",rowSpan)}$row.append($th)}));$htm.append($row)}))}return{colgroup:$colgroup,header:$htm}},_getSearchEl:function(){var htm,sel='<select name="wm-datatable" data-element="dgFilterValue" '+'class="form-control app-select">'+'<option value="" selected class="placeholder">'+this.options.messages.selectField+"</option>",searchLabel=this.Utils.isDefined(this.options.searchLabel)&&this.options.searchLabel.length?this.options.searchLabel:"";this.options.colDefs.forEach((function(colDef,index){if(colDef.field!=="none"&&colDef.field!=="rowOperations"&&colDef.searchable&&_.toString(colDef.showinfilter)!=="false"){sel+='<option value="'+colDef.field+'" data-coldef-index="'+index+'">'+(colDef.displayName||colDef.field)+"</option>"}}));sel+="</select>";htm='<form class="form-search form-inline" onsubmit="return false;"><div class="form-group">'+'<input type="text" data-element="dgSearchText" class="form-control app-textbox" value="" placeholder="'+searchLabel+'"/>'+'</div><div class="input-append input-group">'+sel+'<span class="input-group-addon"><button type="button" data-element="dgSearchButton" class="app-search-button" title="'+searchLabel+'">'+'<i class="wi wi-search"></i>'+"</button></span>"+"</div>"+"</div></form>";var $htm=$(htm);this._setStyles($htm.find('[data-element="dgSearchText"]'),"display: inline-block;");return $htm},_appendRowExpansionButtons:function($htm){var self=this;$htm.find("[data-identifier='rowExpansionButtons']").each((function(index){var _rowData,$row,rowId,rowIndex=index;$row=$(this).closest("tr.app-datagrid-row");rowId=parseInt($row.attr("data-row-id"),10);_rowData=_.clone(self.options.data[rowId]);_rowData.$index=rowIndex+1;self.options.generateRowExpansionCell(_rowData,rowIndex);$(this).empty().append(self.options.getRowExpansionAction(rowIndex))}))},setSummaryRowDef:function(key,data,rowIndex,refreshIndicator){this.options.summaryRow=true;if(this.options.summaryRowDefs[rowIndex]==undefined){this.options.summaryRowDefs[rowIndex]={};this.options.summaryRowDefsObject[rowIndex]={}}this.options.summaryRowDefsObject[rowIndex][key]=data;this.options.summaryRowDefs[rowIndex][key]=data&&data.value?data.value:data;if(refreshIndicator)this.refreshGridData()},_getSummaryRowTemplate:function(){var self=this,$tfoot=$('<tfoot class="'+this.options.cssClassNames.gridFooter+'"></tfoot>');this._setStyles($tfoot,"border-top: 3px solid #eee;");_.forEach(this.options.summaryRowDefs,(function(row,index){row.$$pk=index;$tfoot.append(self._getRowTemplate(row,index,true))}));return $tfoot},getPageStartIndex:function(){var currentPage=this.options.getCurrentPage(),pagesize=this.options.getPageSize();var isPrevPageUpdated=this.options.actionRowPage<currentPage;var pageIndex=isPrevPageUpdated?this.options.actionRowPage:currentPage;return(pageIndex-1)*pagesize},_getPreparedDataForInfiniteScroll:function($tbody,preparedData){preparedData=preparedData.filter((function(row,index){var isExists=$tbody.find("tr.app-datagrid-row[data-row-id="+row.$$pk+"]");if(!isExists.length){return row}}));return preparedData},_updateTrData:function($tbody){var editedRow,updatedRowData,self=this;editedRow=$tbody.find("tr.app-datagrid-row[data-row-id="+self.options.actionRowIndex+"]");updatedRowData=self.preparedData[self.options.actionRowIndex];self.options.generateCustomExpressions(updatedRowData,self.options.actionRowIndex);var rowTemplate=self._getRowTemplate(updatedRowData,self.options.actionRowIndex);editedRow.replaceWith(rowTemplate[0])},_handleCRUDForInfiniteScroll:function($tbody){var self=this;if((self.options.lastActionPerformed===self.options.ACTIONS.SEARCH_OR_SORT||self.options.lastActionPerformed===self.options.ACTIONS.FILTER_CRITERIA||self.options.lastActionPerformed===self.options.ACTIONS.DATASET_UPDATE)&&(self.options.isSearchTrigerred||self.options.isDatasetUpdated||self.options.isDataUpdatedByUser)){$tbody.html("");if(this.options.navigation==="On-Demand"&&!this.options.isLastPage)this.element.find(".on-demand-datagrid").show();self.options.clearCustomExpression();self.options.clearRowDetailExpression();self.options.setIsSearchTrigerred(false);self.options.setIsDatasetUpdated(false)}else if(self.options.lastActionPerformed===self.options.ACTIONS.EDIT&&self.options.actionRowIndex!==undefined&&self.options.editmode!==this.CONSTANTS.QUICK_EDIT){self._updateTrData($tbody)}},_getGridTemplate:function(){var self=this,preparedData,$tbody,pageStartIndex=self.getPageStartIndex(),startRowIndex=self.options.startRowIndex,isScrollorOnDemand=self.options.isNavTypeScrollOrOndemand();if(isScrollorOnDemand){$tbody=this.gridElement;if(this.renderTableOnViewLess){$tbody=this.gridElement.empty();this.hideLoadingIndicator();this.renderTableOnViewLess=false}}else{$tbody=this.gridElement.empty()}if(isScrollorOnDemand){this._handleCRUDForInfiniteScroll($tbody);if(self.options.lastActionPerformed===self.options.ACTIONS.DELETE){startRowIndex=self.options.actionRowIndex+1}preparedData=this._getPreparedDataForInfiniteScroll($tbody,this.preparedData.slice(pageStartIndex))}else{this.options.clearCustomExpression();this.options.clearRowDetailExpression();preparedData=this.preparedData}_.forEach(preparedData,(function(row,index){var _row=_.clone(row),rowIndex=isScrollorOnDemand?startRowIndex+index-1:index,rowTemplate;_row.$index=rowIndex+1;self.options.generateCustomExpressions(_row,rowIndex);self.options.registerRowNgClassWatcher(_row,rowIndex);rowTemplate=self._getRowTemplate(row,rowIndex);$tbody.append(rowTemplate);if(self.options.rowExpansionEnabled){var rowHeight=self.options.rowDef.height;var rowPosition=self.options.rowDef.position;var colSpanLength=_.filter(self.preparedHeaderData,(function(c){return c.show})).length-1;var $tr=$('<tr class="app-datagrid-detail-row" tabindex="0" role="row" data-row-id="'+row.$$pk+'"><td></td><td colspan="'+colSpanLength+'" class="app-datagrid-row-details-cell">'+'<div class="row-overlay"><div class="row-status"><i class="'+self.options.loadingicon+'"></i></div></div><div class="details-section"></div>'+"</td></tr>");if(rowPosition==="-1"){$tr=$('<tr class="app-datagrid-detail-row" tabindex="0" role="row" data-row-id="'+row.$$pk+'"><td colspan="'+colSpanLength+'" class="app-datagrid-row-details-cell">'+'<div class="row-overlay"><div class="row-status"><i class="'+self.options.loadingicon+'"></i></div></div><div class="details-section"></div>'+"</td><td></td></tr>")}if(rowHeight){$tr.find("div.row-overlay").css("min-height",rowHeight)}$tr.css("display","none");$tr.find(".details-section").css("display","none");$tbody.append($tr)}}));if(!this.options.isdynamictable){this.options.setLastActionPerformed(this.options.ACTIONS.DEFAULT);this.options.setIsDataUpdatedByUser(false);this.options.clearActionRowIndex()}return $tbody},_getRowTemplate:function(row,rowIndex,summaryRow){var $htm,self=this,gridOptions=self.options;$htm=$('<tr role="row" tabindex="0" class="'+gridOptions.cssClassNames.tableRow+" "+(gridOptions.rowClass||"")+'" data-row-id="'+row.$$pk+'"></tr>');this.preparedHeaderData.forEach((function(current,colIndex){$htm.append(self._getColumnTemplate(row,colIndex,current,rowIndex,summaryRow))}));return $htm},_getRowActionsColumnDefIndex:function(){var i,len=this.preparedHeaderData.length;for(i=0;i<len;i+=1){if(this.preparedHeaderData[i].field==="rowOperations"){return i}}return-1},_getRowActionsColumnDef:function(){var index=this._getRowActionsColumnDefIndex();if(index!==-1){return this.preparedHeaderData[index]}return null},_getCheckboxTemplate:function(row,isMultiSelectCol){var checked=row._checked===true?" checked":"",disabled=row.disabed?" disabled":"",chkBoxName=isMultiSelectCol?"gridMultiSelect":"";return'<input name="'+chkBoxName+'" type="checkbox"'+checked+disabled+"/>"},_getRadioTemplate:function(row){var checked=row._checked===true?" checked":"",disabled=row.disabed?" disabled":"";return'<input type="radio" rowSelectInput name="" value=""'+checked+disabled+"/>"},_getColumnTemplate:function(row,colId,colDef,rowIndex,summaryRow){var $htm,columnValue,columnValueObject,cellPreloader='<div class="overlay"><span aria-hidden="true" class="form-field-spinner fa fa-circle-o-notch fa-spin form-control-feedback"></span></div>',customExpressionHtml,innerTmpl,classes=this.options.cssClassNames.tableCell+" "+(colDef.class||""),colExpression=colDef.customExpression,styles="text-align: "+colDef.textAlignment+";position: relative;";$htm=$('<td class="'+classes+'" data-col-id="'+colId+'" role="cell"></td>');this._setStyles($htm,styles);columnValue=_.get(row,colDef.field);if(summaryRow){columnValueObject=this.options.summaryRowDefsObject[rowIndex][colDef.field];if(columnValueObject instanceof Object){if(columnValueObject.class){$htm.addClass(columnValueObject.class)}}if(columnValue instanceof Promise){customExpressionHtml=cellPreloader;$htm.html(customExpressionHtml)}else{innerTmpl=_.isUndefined(columnValue)||columnValue===null?"":columnValue;$htm.html(innerTmpl)}}else if(colExpression){$htm.html(this.options.getCustomExpression(colDef.field,rowIndex))}else{if(colDef.type!=="custom"){columnValue=_.get(row,colDef.field);if(this.options.filterNullRecords&&columnValue===null||_.isUndefined(columnValue)){columnValue=""}$htm.attr("title",columnValue);$htm.text(""+columnValue)}else{switch(colDef.field){case"checkbox":innerTmpl=this._getCheckboxTemplate(row,colDef.isMultiSelectCol);break;case"__expand":innerTmpl='<span class="row-expansion-column" data-identifier="rowExpansionButtons"></span>';break;case"radio":innerTmpl=this._getRadioTemplate(row);break;case"rowOperations":innerTmpl='<span class="actions-column" data-identifier="actionButtons"></span>';break;case"rowIndex":innerTmpl=row.$$index;break;case"none":innerTmpl="";break;default:innerTmpl=_.isUndefined(columnValue)||columnValue===null?"":columnValue}$htm.html(innerTmpl)}}row.$index=rowIndex+1;this.options.registerColNgClassWatcher(row,colDef,rowIndex,colId);return $htm},_getEventTemplate:function(colDef){var events=_.filter(_.keys(colDef),(function(key){return _.startsWith(key,"on")})),changeEvt,template="";changeEvt=colDef.editWidgetType==="autocomplete"?"onSubmit":"onChange";events=_.union(events,[changeEvt]);_.forEach(events,(function(eventName){template+=" "+_.kebabCase(eventName)+'="';if(eventName==="onSubmit"||eventName==="onChange"){template+="_"+eventName+"Field($event, $scope, newVal, oldVal);"}template+=(colDef[eventName]||"")+'" '}));return template},_insertFieldInHeaderConfig:function(headerConfig,fieldName,position){var index=_.findIndex(headerConfig,{field:position}),self=this;if(index===-1){_.forEach(headerConfig,(function(config){if(config.isGroup){self._insertFieldInHeaderConfig(config.columns,fieldName,position)}}))}else{headerConfig.splice(index+1,0,{field:fieldName,isPredefined:true})}},setHeaderConfigForDefaultFields:function(name,position){if(_.isEmpty(this.options.headerConfig)){return}var fieldName=this.customColumnDefs[name].field;_.remove(this.options.headerConfig,{field:fieldName});if(position==="0"){this.options.headerConfig.unshift({field:fieldName,isPredefined:true})}else if(position==="-1"){this.options.headerConfig.push({field:fieldName,isPredefined:true})}else{this._insertFieldInHeaderConfig(this.options.headerConfig,fieldName,position)}},setDefaultColsData:function(header){if(_.isEmpty(this.preparedHeaderData)){return}var rowExpandPosition,rowExpandCol;if(this.options.rowExpansionEnabled){rowExpandPosition=this.options.rowDef.position;rowExpandCol=_.clone(this.customColumnDefs.__expand);rowExpandCol.width=this.options.rowDef.columnwidth;if(header){if(rowExpandPosition==="-1"){this.preparedHeaderData.push(rowExpandCol)}else if(rowExpandPosition==="0"){this.preparedHeaderData.unshift(rowExpandCol)}else{var index=_.findIndex(this.preparedHeaderData,{field:rowExpandPosition});this.preparedHeaderData.splice(index+1,0,rowExpandCol)}}this.setHeaderConfigForDefaultFields("__expand",rowExpandPosition)}if(this.options.showRowIndex){if(header){this.preparedHeaderData.unshift(this.customColumnDefs.rowIndex)}this.setHeaderConfigForDefaultFields("rowIndex","0")}if(this.options.multiselect){if(header){this.preparedHeaderData.unshift(this.customColumnDefs.checkbox)}this.setHeaderConfigForDefaultFields("checkbox","0")}if(!this.options.multiselect&&this.options.showRadioColumn){if(header){this.preparedHeaderData.unshift(this.customColumnDefs.radio)}this.setHeaderConfigForDefaultFields("radio","0")}},_prepareHeaderData:function(){this.preparedHeaderData=[];$.extend(this.preparedHeaderData,this.options.colDefs);this.setDefaultColsData(true)},_generateCustomColDefs:function(){var colDefs=[],generatedColDefs={};function generateColumnDef(key){if(!generatedColDefs[key]){var colDef={type:"string",field:key};colDefs.push(colDef);generatedColDefs[key]=true}}this.options.data.forEach((function(item){_.keys(item).forEach(generateColumnDef)}));this.options.colDefs=colDefs;this._prepareHeaderData()},_prepareData:function(){var data=[],colDefs=this.options.colDefs,self=this,gridData=[],pageStartIndex=self.getPageStartIndex(),isObject=this.Utils.isObject,isDefined=this.Utils.isDefined;if(!this.options.colDefs.length&&this.options.data.length){this._generateCustomColDefs()}gridData=this.options.isNavTypeScrollOrOndemand()?this.options.data.slice(pageStartIndex):this.options.data;gridData.forEach((function(item,i){var rowData=$.extend(true,{},item);colDefs.forEach((function(colDef){if(!colDef.field){return}var fields=colDef.field.split("."),text=item,j,len=fields.length,key,isArray;for(j=0;j<len;j++){key=fields[j];isArray=undefined;if(key.indexOf("[0]")!==-1){key=key.replace("[0]","");isArray=true}if(isObject(text)&&!isArray){text=_.get(text,key)}else if(isArray){text=_.get(text,key+"[0]")}else{text=undefined;break}}if(isDefined(text)){rowData[colDef.field]=text}else if(fields.length>1&&_.has(item,colDef.field)){rowData[colDef.field]=item[colDef.field]}}));rowData.$$index=pageStartIndex+i+1;rowData.$$pk=self.options.isNavTypeScrollOrOndemand()?pageStartIndex+i:i;data.push(rowData)}));if(self.options.isNavTypeScrollOrOndemand()){if(self.options.isSearchTrigerred&&!self.emptySearch||self.options.isDatasetUpdated){self.preparedData=data}else if(self.preparedData.length){data.forEach((function(rowData,index){var rowId=pageStartIndex+index;if(self.preparedData[rowId]&&rowData.$$index===self.preparedData[rowId].$$index){self.preparedData[rowId]=rowData}else{self.preparedData.push(rowData)}}))}else{self.preparedData.push(...data)}}else{self.preparedData=data}},_reselectColumns:function(){var selectedColumns=[],self=this;if(this.gridHeaderElement&&this.options.enableColumnSelection){selectedColumns=this.gridHeaderElement.find("th."+this.options.cssClassNames.selectedColumn);if(selectedColumns.length){selectedColumns.each((function(){self.columnSelectionHandler(undefined,$(this))}))}}if(this.options.multiselect){this.updateSelectAllCheckboxState()}},_create:function(){$.extend(this,{dataStatus:{message:"",state:"ready"},preparedData:[],preparedHeaderData:[],dataStatusContainer:null,gridContainer:null,gridElement:null,gridHeader:null,gridBody:null,gridFooter:null,gridSearch:null,tableId:null,searchObj:{field:"",value:"",event:null},compiledCellTemplates:{}});this._setStatus=_.debounce((function(isCreated){this.__setStatus(isCreated)}),100);this._debounceOnEnter=_.debounce((function($target,$row,quickEdit,event){this._onEnter($target,$row,quickEdit,event)}),150);this.options.summaryRow=false;this.options.summaryRowDefs=[];this._prepareHeaderData();this._prepareData();this._render(true)},_setGridEditMode:function(val){if(_.isFunction(this.options.setGridEditMode)){this.options.setGridEditMode(val)}},_refreshGrid:function(){this._prepareHeaderData();this._prepareData();this._render();this.addOrRemoveScroll();this._setGridEditMode(false)},refreshGrid:function(){window.clearTimeout(this.refreshGridTimeout);this.refreshGridTimeout=window.setTimeout(this._refreshGrid.bind(this),50)},callRenderGridForInfiniteScroll:function(){this.gridFooter.remove();var $alwaysNewRow=this.gridElement.find("> tr.app-datagrid-row.always-new-row");if($alwaysNewRow.length){$alwaysNewRow.remove()}this._renderGrid(undefined)},refreshGridData:function(){this._prepareData();if(!this.options.isNavTypeScrollOrOndemand()){this.gridFooter.remove();this._renderGrid()}else{this.callRenderGridForInfiniteScroll()}this._reselectColumns();this.addOrRemoveScroll();this._setGridEditMode(false);this.toggleNewRowActions(false)},setDefaultRowData:function(rowData){_.forEach(this.preparedHeaderData,(function(colDef){rowData[colDef.field]=colDef.defaultvalue}))},addNewRow:function(skipFocus,alwaysNewRow){var rowId=this.gridElement.find("> tr.app-datagrid-row:visible").length||99999,self=this,rowData={},$row,$gridBody,$alwaysNewRow;if(!alwaysNewRow&&_.isFunction(this.options.beforeRowInsert)){this.options.beforeRowInsert()}$gridBody=this.gridElement;$alwaysNewRow=$gridBody.find("> tr.app-datagrid-row.always-new-row");if($alwaysNewRow.length){this.setFocusOnElement(undefined,$alwaysNewRow);if(this.options.editmode===this.CONSTANTS.QUICK_EDIT){var $qTarget=$alwaysNewRow.find("input").length>0?$($alwaysNewRow.find("input")[0]):null;if($qTarget!==null){var event=$.Event("keydown");event.which=13;$qTarget.trigger(event)}}return}rowData.$index=rowId;rowData.$$pk=rowId;if(this.options.editmode!==this.CONSTANTS.FORM&&this.options.editmode!==this.CONSTANTS.DIALOG){$row=$(this._getRowTemplate(rowData,rowData.$index));if(!this.preparedData.length){this.setStatus("ready",this.dataStatus.ready)}if(this.options.formPosition==="top"){$gridBody.prepend($row)}else{$gridBody.append($row)}this._appendRowActions($row,true,rowData);this.attachEventHandlers($row);if(alwaysNewRow||this.options.editmode!==this.CONSTANTS.QUICK_EDIT){$row.find(".delete-row-button").hide();if(alwaysNewRow){$row.find(".edit-row-button").hide()}}this._findAndReplaceCompiledTemplates();if(alwaysNewRow){this.setDefaultRowData(rowData);$row.addClass("always-new-row").addClass("row-editing");this.options.runInNgZone((function(){self.makeRowEditable($row,rowData,true)}))}else{$row.trigger("click",[undefined,{action:"edit",operation:"new",skipFocus:skipFocus}])}this.updateSelectAllCheckboxState();this.addOrRemoveScroll();this.options.timeoutCall((function(){self.setColGroupWidths()}),100)}},addLoadMoreBtn:function(onDemandMsg,loadingdatamsg,cb,infScroll){var $btnEl;if(!this.options.isLastPage||infScroll){var self=this;var $parenEl=$('<div class="on-demand-datagrid"><a class="app-button btn btn-block on-demand-load-btn"></a></div>');$btnEl=$parenEl.find("a");$btnEl.append(onDemandMsg);this.element.find(".app-grid-header-inner").append($parenEl);if(infScroll){if(this.element.find(".on-demand-load-btn").length){this.element.find(".on-demand-load-btn").text(this.options.viewlessmessage)}}$btnEl.on("click",(function(e){var lastPage=self.options.getCurrentPage()==self.options.getPageCount();if(!lastPage){self.showLoadingIndicator(loadingdatamsg,false)}if(!self.options.showviewlessbutton){$btnEl.hide()}if(infScroll){if(lastPage){self.element.find(".on-demand-datagrid").remove()}}if(lastPage&&self.options.showviewlessbutton){$btnEl.hide();self.renderTableOnViewLess=true;self.renderPaginationOnViewLess=true;self.options.enableNavigation();self._renderGrid()}if(cb&&typeof cb==="function"){cb(e)}}))}},showLoadingIndicator:function(loadingdatamsg,infScroll){var hasLoadingEl=this.element.find(".loading-data-msg");var $dataGrid=this.element.find(".on-demand-datagrid");if(hasLoadingEl.length&&!infScroll){hasLoadingEl.show()}else if(infScroll&&$dataGrid.length){$dataGrid.show()}else{var $loadingEl=$('<div class="loading-data-msg spin-icon-in-center"><span><i class="app-icon panel-icon fa-spin '+this.options.loadingicon+'"></i>'+'<span class="sr-only">Loading</span><span class="loading-text"></span></span></div>');$loadingEl.find(".loading-text").html(loadingdatamsg);if($dataGrid.length){$dataGrid.append($loadingEl)}else{var gridEl=$('<div class="on-demand-datagrid">'+$loadingEl[0].outerHTML+"</div>");this.element.find(".app-grid-header-inner").append(gridEl)}}},hideLoadingIndicator:function(showLoadBtn,infScroll){if(!showLoadBtn&&!infScroll){this.element.find(".loading-data-msg").hide();this.element.find(".on-demand-load-btn").text(this.options.ondemandmessage);this.element.find(".on-demand-load-btn").show()}else if(this.options.getCurrentPage()==this.options.getPageCount()&&this.options.showviewlessbutton){this.element.find(".on-demand-load-btn").show().text(this.options.viewlessmessage);this.element.find(".loading-data-msg").hide();if(infScroll){if(!this.element.find(".on-demand-load-btn").length){this.options.addLoadMoreBtn()}this.element.find(".loading-data-msg").hide()}}else{this.element.find(".on-demand-datagrid").hide()}},getSelectedRows:function(){this.getSelectedColumns();var selectedRowsData=[],self=this;this.preparedData.forEach((function(data,i){if(data._selected){selectedRowsData.push(self.options.data[i])}}));return selectedRowsData},selectRows:function(rows){var self=this;self.gridElement.find("tr.app-datagrid-row").each((function(index){if(self.preparedData[index]&&self.preparedData[index]._selected===true){$(this).trigger("click",[$(this),{skipSingleCheck:true}])}}));if(_.isArray(rows)){_.forEach(rows,(function(row){self.selectRow(row,true)}))}else{self.selectRow(rows,true)}},toggleRowFilter:function(show){if(this.options.filtermode===this.CONSTANTS.MULTI_COLUMN&&this.gridSearch){if(show){this.gridSearch.show()}else{this.gridSearch.hide()}}},setColGroupWidths:function(){var self=this,headerCols=this.options.isMobile?this.tableContainer.find("col"):this.tableContainer.find("col"),bodyCols=this.tableContainer.find("col"),headerCells=this.options.showHeader?this.gridContainer.find("th.app-datagrid-header-cell"):this.gridElement.find("tr.app-datagrid-row").first().find("td"),colLength=this.preparedHeaderData.length,scrollLeft=this.gridElement.parent().prop("scrollLeft");if(!headerCols.length&&!headerCells.length){return}this._setColSpan(this.options.headerConfig);this.toggleRowFilter();var definedColWidth=0;var colsLen=headerCols.length;headerCols.each((function(){var eachColWidth=$(this).width();if(eachColWidth){definedColWidth=definedColWidth+eachColWidth;colsLen=colsLen-1}}));headerCells.each((function(){var id=Number($(this).attr("data-col-id")),colDef=self.preparedHeaderData[id],$headerCell=self.gridContainer.find('th[data-col-id="'+id+'"]'),$tdCell=self.gridElement.find('td.app-datagrid-cell[data-col-id="'+id+'"]'),$footCell=self.tableContainer.find('tfoot tr.app-datagrid-row td.app-datagrid-cell[data-col-id="'+id+'"]'),$headerCol=$(headerCols[id]),$bodyCol=$(bodyCols[id]),definedWidth,width;if(!colDef){return}definedWidth=colDef.width;if(!_.isUndefined(colDef.show)&&!colDef.show){$headerCell.hide();$tdCell.hide();$headerCol.hide();$bodyCol.hide();$footCell.hide()}else{$headerCell.show();$tdCell.show();$headerCol.show();$bodyCol.show();$footCell.show()}if($headerCol.length&&$headerCol[0].style.width==="90px"){width=_.isUndefined(definedWidth)?"":definedWidth;$headerCol.css("width",width);$bodyCol.css("width",width)}}));headerCells.each((function(){var $header=$(this),id=Number($header.attr("data-col-id")),colDef=self.preparedHeaderData[id],definedWidth,width,tempWidth,$headerCol;if(!colDef){return}definedWidth=colDef.width;if(!_.isUndefined(colDef.show)&&!colDef.show){width=0}else{if($header.hasClass("grid-col-small")){width=50}else{if(_.isUndefined(definedWidth)||definedWidth===""||_.includes(definedWidth,"%")){$headerCol=$(headerCols[id]);if($headerCol.length){tempWidth=$headerCol[0].style.width;if(tempWidth===""||tempWidth==="0px"||tempWidth==="90px"||_.includes(tempWidth,"%")){width=$header.width();if(width<=0){var currentNode=$header;var elemWidth=width;var padding=0;while(elemWidth<=0){currentNode=currentNode.parent();elemWidth=currentNode.width();if(currentNode.find("table").length){padding=padding+parseFloat(currentNode.css("padding-left"))+parseFloat(currentNode.css("padding-right"))}}if(elemWidth>0){if(padding){elemWidth=elemWidth-padding}if(_.includes(tempWidth,"%")){var widthPercent=parseInt(tempWidth);var pixelWidth=elemWidth*(widthPercent/100);width=pixelWidth}else{var parentWidth=definedColWidth&&definedColWidth>0?elemWidth-definedColWidth:elemWidth;var totalCols=colsLen?colsLen:headerCols.length;width=parentWidth/totalCols;width=width>90?colLength===id+1?width-17:width:90}}else{width=width>90?colLength===id+1?width-17:width:90}}else{width=width>90?colLength===id+1?width-17:width:90}}else{width=tempWidth}}}else{width=definedWidth}}}$(headerCols[id]).css("width",width);$(bodyCols[id]).css("width",width)}));this.toggleRowFilter(true);this.gridElement.parent().prop("scrollLeft",scrollLeft);this.gridHeaderElement.parent().prop("scrollLeft",scrollLeft)},getSelectedColumns:function(){var selectedColsData={},headerData=[],self=this,multiSelectColIndex,radioColIndex,colIndex;$.extend(headerData,this.preparedHeaderData);if(this.options.multiselect){headerData.some((function(item,i){if(item.field==="checkbox"){multiSelectColIndex=i;return true}}));headerData.splice(multiSelectColIndex,1)}else if(this.options.showRadioColumn){headerData.some((function(item,i){if(item.field==="radio"){radioColIndex=i;return true}}));headerData.splice(radioColIndex,1)}if(this.options.showRowIndex){headerData.some((function(item,i){if(item.field==="rowIndex"){colIndex=i;return true}}));headerData.splice(colIndex,1)}headerData.forEach((function(colDef){var field=colDef.field;if(colDef.selected){selectedColsData[field]={colDef:colDef,colData:self.options.data.map((function(data){return data[field]}))}}}));return selectedColsData},_setOption:function(key,value){this._super(key,value);switch(key){case"showHeader":this._toggleHeader();this._toggleSearch();this.setColGroupWidths();this.addOrRemoveScroll();break;case"filtermode":this._toggleSearch();break;case"searchLabel":if(this.gridSearch){this.gridSearch.find('[data-element="dgSearchText"]').attr("placeholder",value);this.gridSearch.find('[data-element="dgSearchButton"]').attr("title",value)}break;case"selectFirstRow":this.selectFirstRow(value);break;case"data":if(!this.isResetSortIconsDone){this.setSortIconDefault()}this.refreshGridData();break;case"dataStates":if(this.dataStatus.state==="nodata"){this.setStatus("nodata",this.dataStatus.nodata)}else if(this.dataStatus.state==="loading"){this.setStatus("loading")}break;case"loadingicon":this.dataStatusContainer.find("i").removeClass().addClass(this.options.loadingicon);break;case"colDefs":if(this.options.isNavTypeScrollOrOndemand()&&this.options.isNextPageData){this.tableContainer.find("colgroup").remove();this._prepareHeaderData();this.setColGroupWidths();this._renderHeader();this._renderSearch();this.attachEventHandlers(this.gridElement);this._reselectColumns();this.addOrRemoveScroll();break}case"multiselect":case"showRadioColumn":case"rowActions":case"filterNullRecords":case"showRowIndex":this.refreshGrid();break;case"cssClassNames":var gridClass=this.options.cssClassNames.gridDefault+" "+this.options.cssClassNames.grid;if(this.options.rowExpansionEnabled){gridClass=gridClass+" "+this.options.cssClassNames.gridRowExpansionClass}this.tableContainer.attr("class",gridClass);if(this.options.spacing==="condensed"){this._toggleSpacingClasses("condensed")}break;case"spacing":this._toggleSpacingClasses(value);break;case"messages":this.gridSearch&&this.gridSearch.find("option.placeholder").text(value&&value.selectField);break}},getOptions:function(){return this.options},_toggleHeader:function(){if(this.gridHeaderElement){this.gridHeaderElement.empty()}if(this.tableContainer){this.tableContainer.find("colgroup").remove();this.tableContainer.find("thead").remove()}this.setDefaultColsData();if(this.options.showHeader){this._renderHeader()}},_toggleSearch:function(){if(this.gridSearch){this.gridSearch.remove()}if(this.options.filtermode===this.CONSTANTS.SEARCH){this._renderSearch()}else if(this.options.filtermode===this.CONSTANTS.MULTI_COLUMN){this._renderRowFilter();this.setColGroupWidths()}},selectFirstRow:function(value,visible){var $row,id;if(visible&&this.gridElement.find("tr").is(":visible")){this.__setStatus();$row=this.gridElement.find("tr.app-datagrid-row:visible:not(.always-new-row)").first()}else{$row=this.gridElement.find("tr.app-datagrid-row:not(.always-new-row)").first()}id=$row.attr("data-row-id");if($row.length&&this.preparedData.length){this.preparedData[id]._selected=!value;$row[0].click()}},selectRow:function(row,value){var rowIndex=_.isNumber(row)?row:this.Utils.getObjectIndex(this.options.data,row),selector,$row;if(rowIndex!==-1){selector="tr.app-datagrid-row[data-row-id="+rowIndex+"]";$row=this.gridElement.find(selector);if($row.length){this.preparedData[rowIndex]._selected=!value}if(value){$row.trigger("click")}else{this.toggleRowSelection($row,value);this.options.callOnRowDeselectEvent(this.preparedData[rowIndex])}}},deselectRow:function(row){this.selectRow(row,false)},toggleRowSelection:function($row,selected,e,isSelectAll){if(!$row.length){return}var rowId=$row.attr("data-row-id"),$checkbox,$radio;if(!this.preparedData[rowId]){return}this.preparedData[rowId]._selected=selected;if(selected){$row.addClass("active")}else{$row.removeClass("active")}if(this.options.showRadioColumn){$radio=$row.find("td input[rowSelectInput]:radio:not(:disabled)");$radio.prop("checked",selected);this.preparedData[rowId]._checked=selected}if(this.options.multiselect){$checkbox=$row.find('td input[name="gridMultiSelect"]:checkbox:not(:disabled)');$checkbox.prop("checked",selected);this.preparedData[rowId]._checked=selected;if(!isSelectAll){this.updateSelectAllCheckboxState()}}else{this._deselectPreviousSelection($row,e)}},updateSelectAllCheckboxState:function(){if(!this.options.showHeader||!this.options.multiselect){return}this.__setStatus();var $headerCheckbox=this.gridHeaderElement.find("th.app-datagrid-header-cell input:checkbox"),$tbody=this.gridElement,checkedItemsLength=$tbody.find('tr.app-datagrid-row:visible input[name="gridMultiSelect"]:checkbox:checked').length,visibleRowsLength=$tbody.find("tr.app-datagrid-row:visible").length;if(!visibleRowsLength){$headerCheckbox.prop("checked",false);return}if(checkedItemsLength===visibleRowsLength){$headerCheckbox.prop("checked",true)}else{$headerCheckbox.prop("checked",false)}},rowClickHandlerOnCapture:function(e,$row,options){$row=$row||$(e.target).closest("tr.app-datagrid-row");var gridRow=this.gridElement.find($row);if(gridRow.length&&gridRow.closest("tbody").attr("id")===this.gridElement.attr("id")){var rowId=$row.attr("data-row-id");var rowData=this.preparedData[rowId];var data=this.options.data[rowId];this.options.assignSelectedItems(data,e)}},rowSelectionHandler:function(e,$row,options){options=options||{};var rowId,rowData,data,selected,self=this,action=options.action,$target=$(e.target),isQuickEdit=this.options.editmode===this.CONSTANTS.QUICK_EDIT;function callRowSelectionEvents(){if(selected&&_.isFunction(self.options.onRowSelect)){self.options.onRowSelect(data,e)}if(!selected&&_.isFunction(self.options.onRowDeselect)){self.options.onRowDeselect(data,e)}}$row=$row||$target.closest("tr.app-datagrid-row");if(action||isQuickEdit&&($target.hasClass("app-datagrid-cell")||$target.closest("td.app-datagrid-cell").length)&&!$row.hasClass("always-new-row")){options.action=options.action||"edit";if(options.operation==="new"||self.options.actionsEnabled.edit){self.toggleEditRow(e,options)}if(options.skipSelect){return}}rowId=$row.attr("data-row-id");rowData=this.preparedData[rowId];data=this.options.data[rowId];selected=rowData&&rowData._selected||false;if(!options.skipSingleCheck&&($row.hasClass("active")&&!this.options.multiselect||!rowData)){if(!isQuickEdit&&options.operation!=="new"){callRowSelectionEvents()}return}this.options.callOnRowClickEvent(data,e);selected=!selected;this.toggleRowSelection($row,selected,e);callRowSelectionEvents()},rowDblClickHandler:function(e,$row){e.stopPropagation();$row=$row||$(e.target).closest("tr.app-datagrid-row");var rowData,rowId=$row.attr("data-row-id");rowData=this.preparedData[rowId];if(!rowData){return}if(_.isFunction(this.options.onRowDblClick)){this.options.onRowDblClick(rowData,e)}},closePopover:function(){this.options.closePopover(this.element)},headerClickHandler:function(e){var $th=$(e.target).closest("th.app-datagrid-header-cell"),id=$th.attr("data-col-id");this.closePopover();this.options.onHeaderClick(this.preparedHeaderData[id],e)},columnSelectionHandler:function(e,$headerCell){if(e){e.stopImmediatePropagation()}var $th=e?$(e.target).closest("th.app-datagrid-header-cell"):$headerCell,id=$th.attr("data-col-id"),colDef=this.preparedHeaderData[id],field=colDef.field,selector='td[data-col-id="'+id+'"]',$column=this.gridElement.find(selector),selected=$column.data("selected")||false,colInfo={colDef:colDef,data:this.options.data.map((function(data){return data[field]})),sortDirection:this._getColumnSortDirection(colDef.field)},selectedClass=this.options.cssClassNames.selectedColumn;selected=!selected;colDef.selected=selected;$column.data("selected",selected);if(selected){$column.addClass(selectedClass);$th.addClass(selectedClass);if(_.isFunction(this.options.onColumnSelect)&&e){this.options.onColumnSelect(colInfo,e)}}else{$column.removeClass(selectedClass);$th.removeClass(selectedClass);if(_.isFunction(this.options.onColumnDeselect)&&e){this.options.onColumnDeselect(colInfo,e)}}},getTextValue:function(fieldName,alwaysNewRow){return this.options.getFieldValue(alwaysNewRow?fieldName+"_new":fieldName)},getUploadedFiles:function($el,fieldName){return _.get(document.forms,[$el.find("form").attr("name"),fieldName,"files",0])},isDataModified:function($editableElements,rowData,alwaysNewRow){var isDataChanged=false,self=this;function getEpoch(val){return val?moment(val).valueOf():val}$editableElements.each((function(){var $el=$(this),colId=$el.attr("data-col-id"),colDef=self.preparedHeaderData[colId],text=self.getTextValue(colDef.field,alwaysNewRow),originalData=_.get(rowData,colDef.field);if(colDef.editWidgetType==="upload"){isDataChanged=self.getUploadedFiles($el,colDef.field)instanceof File}else{if(!self.Utils.isDefined(text)&&(originalData===null||originalData===undefined)){isDataChanged=false}else{if(colDef.editWidgetType==="datetime"){isDataChanged=!(getEpoch(originalData)===getEpoch(text))}else{isDataChanged=!(originalData==text)}}}if(isDataChanged){return!isDataChanged}}));return isDataChanged},focusActiveRow:function(){this.gridElement.find("tr.app-datagrid-row.active").focus()},focusNewRow:function(){var newRow=this.gridElement.find("tr.always-new-row");var newRowInputs=newRow&&newRow.find("input")||[];newRowInputs.length&&newRowInputs[0].focus()},disableActions:function(val){var $deleteBtns=this.gridElement.find(".delete-row-button"),$editBtns=this.gridElement.find(".edit-row-button");if(val){$editBtns.addClass("disabled-action");$deleteBtns.addClass("disabled-action")}else{$editBtns.removeClass("disabled-action");$deleteBtns.removeClass("disabled-action")}},setFocusOnElement:function(e,$el,skipDelay){var $firstEl,$target=e&&$(e.target),$focusEl;if($target&&$target.hasClass("app-datagrid-cell")){$firstEl=$target.find("input")}else{if(!$el){$el=$target.closest("tr.app-datagrid-row").find("td.cell-editing")}else if($el.hasClass("app-datagrid-row")){$el=$el.find("td.cell-editing")}$firstEl=$($el).first().find("input");if(!$firstEl.length){$firstEl=$($el).first().find("textarea")}if(!$firstEl.length){$firstEl=$($el).first().find("select")}}if($firstEl.length){$focusEl=$firstEl.first();if(skipDelay){$focusEl.focus();$focusEl.select()}else{this.options.timeoutCall((function(){$focusEl.focus();$focusEl.select()}))}}},removeNewRow:function($row){this.disableActions(false);this._setGridEditMode(false);if($row.hasClass("always-new-row")){return}$row.attr("data-removed",true);$row.remove();if(!this.preparedData.length){this.setStatus("nodata",this.dataStatus.nodata)}this.addOrRemoveScroll();this.toggleNewRowActions(false)},saveRow:function(callBack){this.gridElement.find("tr.app-datagrid-row.row-editing:not(.always-new-row)").each((function(){$(this).trigger("click",[undefined,{action:"save",skipSelect:true,noMsg:true,success:callBack}])}))},makeRowEditable:function($row,rowData,alwaysNewRow){var self=this,$originalElements=$row.find("td.app-datagrid-cell"),rowId=parseInt($row.attr("data-row-id"),10),$editableElements,_rowData=_.clone(rowData);_rowData.$index=rowId+1;this.options.removeValidations(alwaysNewRow);this.options.generateInlineEditRow(_rowData,alwaysNewRow);$originalElements.each((function(){var $el=$(this),cellText=$el.text(),id=$el.attr("data-col-id"),colDef=self.preparedHeaderData[id],value,editableTemplate;if(!colDef.readonly){value=_.get(rowData,colDef.field);editableTemplate=self.options.getInlineEditWidget(colDef.field,value,alwaysNewRow);if(!(colDef.customExpression||colDef.formatpattern&&colDef.formatpattern!=="None")){$el.addClass("cell-editing").html(editableTemplate).data("originalText",cellText)}else{$el.addClass("cell-editing editable-expression").data("originalValue",{rowIndex:rowId,fieldName:colDef.field});$el.addClass("cell-editing editable-expression").html(editableTemplate).data("originalText",cellText)}$el.addClass("form-group");if(colDef.binding!=="rowOperations"){self.options.timeoutCall((function(){self.options.applyValidations(colDef,alwaysNewRow);if(colDef.required){$el.addClass("required-field")}}))}else if(colDef.required){$el.addClass("required-field")}}}));$editableElements=$row.find("td.cell-editing");$editableElements.on("click",(function(e){e.stopPropagation()}));$editableElements.on("keydown",(function(e){if((e.which===38||e.which===40)&&(e.currentTarget&&!e.currentTarget.closest(".always-new-row"))){e.stopPropagation()}}))},toggleNewRowActions:function(saveInd){var self=this,$gridActions=$(this.element).siblings("div.panel-footer, div.panel-heading").find("div.app-datagrid-actions"),$newRow=this.gridElement.find("tr.app-datagrid-row.row-editing"),$newRowButton=$gridActions.find("i.wi-plus").closest(".app-button");if(this.options.editmode===this.CONSTANTS.INLINE&&(this.options.rowActions.length===0||!_.some(this.options.rowActions,{action:"editRow($event)"}))){if(saveInd){$gridActions.append('<button type="button" wmbutton="" class="btn app-button btn-default cancelNewRow" tabindex="0" accesskey="" title="Cancel">'+'<i aria-hidden="true" class="app-icon wi wi-cancel"></i>'+'<span class="sr-only">Cancel Icon</span><span class="btn-caption">Cancel</span>'+"</button>"+'<button type="button" wmbutton="" class="btn app-button btn-primary saveNewRow" tabindex="0" accesskey="" title="Save">'+'<i aria-hidden="true" class="app-icon wi wi-done"></i>'+'<span class="sr-only">Save Icon</span><span class="btn-caption">Save</span>'+"</button>");$gridActions.find(".cancelNewRow").on("click",(function(event){self.toggleEditRow(event,{action:"cancel",$row:$newRow})}));$gridActions.find(".saveNewRow").on("click",(function(event){self.toggleEditRow(event,{action:"save",$row:$newRow})}));$newRowButton.hide()}else{$("typeahead-container").removeClass("open");$gridActions.find(".cancelNewRow").remove();$gridActions.find(".saveNewRow").remove();$newRowButton.show()}}},_isNewRow:function($row){var rowId=parseInt($row.attr("data-row-id"),10);return rowId>=this.preparedData.length||$row.hasClass("always-new-row")},toggleEditRow:function(e,options){options=options||{};if(e){e.stopPropagation()}this.closePopover();var $row=options.$row||$(e.target).closest("tr.app-datagrid-row"),$editButton=$row.find(".edit-row-button"),$cancelButton=$row.find(".cancel-edit-row-button"),$saveButton=$row.find(".save-edit-row-button"),$deleteButton=$row.find(".delete-row-button"),rowData=_.cloneDeep(this.options.data[$row.attr("data-row-id")])||{},self=this,action,isNewRow,$editableElements,isDataChanged=false,isValid,$requiredEls,alwaysNewRow=$row.hasClass("always-new-row"),advancedEdit=self.options.editmode===self.CONSTANTS.QUICK_EDIT,editOptions={};this.options.setActionRowIndex($row.attr("data-row-id"));this.options.setLastActionPerformed(this.options.ACTIONS.EDIT);function onSaveSuccess(skipFocus,error){if(_.isFunction(options.success)){options.success(skipFocus,error)}if(!advancedEdit||self.options.actionsEnabled.edit){self.focusActiveRow()}}if($row.attr("data-removed")==="true"){return}if(options.selectRow){this.selectRow(rowData,true)}e=e||{};e.data=e.data||{};action=e.data.action||options.action;if(action==="edit"){if(this.options.editmode===this.CONSTANTS.INLINE){this.options.callLoadInlineWidgetData()}if(advancedEdit&&self.gridElement.find("tr.app-datagrid-row.row-editing:not(.always-new-row)").length){self.saveRow((function(skipFocus,error){self.editSuccessHandler(skipFocus,error,e,$row,true)}));return}$row.addClass("row-editing");if(_.isFunction(this.options.beforeRowUpdate)){this.options.beforeRowUpdate(rowData,e)}if(self.options.editmode===self.CONSTANTS.FORM||self.options.editmode===self.CONSTANTS.DIALOG){return}if(options.operation==="new"){self.setDefaultRowData(rowData);self.toggleNewRowActions(true)}if(_.isFunction(this.options.onBeforeFormRender)){isValid=this.options.onBeforeFormRender(rowData,e,options.operation||action);if(isValid===false){return}}this._setGridEditMode(true);this.disableActions(true);$deleteButton.removeClass("disabled-action");this.options.runInNgZone((function(){self.makeRowEditable($row,rowData)}));$editButton.addClass("hidden");$cancelButton.removeClass("hidden");$saveButton.removeClass("hidden");$editableElements=$row.find("td.cell-editing");if(!options.skipFocus&&$editableElements){this.options.timeoutCall((function(){self.setFocusOnElement(e,$editableElements)}))}if(_.isFunction(this.options.onFormRender)){this.options.onFormRender($row,e,options.operation||action,$row.hasClass("always-new-row"))}}else{$editableElements=$row.find("td.cell-editing");isNewRow=self._isNewRow($row);if(action==="save"){if(isNewRow){isDataChanged=true}else{isDataChanged=this.isDataModified($editableElements,rowData,alwaysNewRow)}if(isDataChanged){$editableElements.each((function(){var $el=$(this),colId=$el.attr("data-col-id"),colDef=self.preparedHeaderData[colId],fields=_.split(colDef.field,"."),text;text=self.getTextValue(colDef.field,alwaysNewRow);if(fields.length===1&&colDef.editWidgetType==="upload"){_.set(rowData,colDef.field,self.getUploadedFiles($el,colDef.field))}else{text=(fields.length===1||isNewRow)&&text===""?undefined:text;if(self.Utils.isDefined(text)){text=text==="null"?null:text;if(text===null){if(fields.length>1){_.set(rowData,fields[0],text)}else{if(!isNewRow){_.set(rowData,colDef.field,"")}}}else{_.set(rowData,colDef.field,text)}}else{if(fields.length===1&&!isNewRow){_.set(rowData,colDef.field,text)}}}}));if($editableElements.find(".ng-pending").length>0){setTimeout(this.toggleEditRow.bind(this,e,options),200);return}$requiredEls=$editableElements.find(".ng-invalid");if($requiredEls.length>0){$requiredEls.each((function(index){var $invalidTd=$(this).closest("td.app-datagrid-cell");if(index===0){$invalidTd.find("[focus-target]").focus()}self.options.setTouched($invalidTd.find("[formcontrolname]").attr("formcontrolname"))}));if(_.isFunction(options.success)){options.success(false,true)}return}if(isNewRow&&advancedEdit&&_.isEmpty(rowData)){self.removeNewRow($row);if(_.isFunction(options.success)){options.success(false,undefined,true)}return}if(isNewRow){if(_.isFunction(this.options.onBeforeRowInsert)){isValid=this.options.onBeforeRowInsert(rowData,e,editOptions);if(isValid===false){return}}this.options.onRowInsert(rowData,e,onSaveSuccess,editOptions);self.toggleNewRowActions(false);if(!$row.hasClass("always-new-row")&&self.options.isNavTypeScrollOrOndemand()){self.removeNewRow($row)}}else{if(_.isFunction(this.options.onBeforeRowUpdate)){isValid=this.options.onBeforeRowUpdate(rowData,e,editOptions);if(isValid===false){return}}this.options.afterRowUpdate(rowData,e,onSaveSuccess,editOptions)}}else{this.cancelEdit($row);if(!options.noMsg){this.options.noChangesDetected()}if(_.isFunction(options.success)){options.success(false)}}}else{if(isNewRow){self.removeNewRow($row);return}this.cancelEdit($row)}}this.addOrRemoveScroll()},cancelEdit:function($row){var self=this,$editableElements=$row.find("td.cell-editing"),$cancelButton=$row.find(".cancel-edit-row-button"),$saveButton=$row.find(".save-edit-row-button"),$editButton=$row.find(".edit-row-button");this.options.clearActionRowIndex();this.disableActions(false);$row.removeClass("row-editing");$editableElements.off("click");$editableElements.each((function(){var $el=$(this),value=$el.data("originalValue");$el.removeClass("datetime-wrapper cell-editing required-field form-group");if(!value){$el.text($el.data("originalText")||"")}else{$el.html(self.options.getCustomExpression(value.fieldName,value.rowIndex))}}));$("typeahead-container").removeClass("open");$editButton.removeClass("hidden");$cancelButton.addClass("hidden");$saveButton.addClass("hidden");this._setGridEditMode(false)},closeEditedRow:function(){var $row=this.gridElement.find("tr.app-datagrid-row.row-editing");if($row.length){if(this._isNewRow($row)){this.removeNewRow($row)}else{this.cancelEdit($row)}}},hideRowEditMode:function($row){if($row.hasClass("always-new-row")&&this.options.isNavTypeScrollOrOndemand()){this.resetNewRow($row);return}var $editableElements=$row.find("td.cell-editing"),$editButton=$row.find(".edit-row-button"),$cancelButton=$row.find(".cancel-edit-row-button"),$saveButton=$row.find(".save-edit-row-button"),self=this;$row.removeClass("row-editing");$editableElements.off("click");this.disableActions(false);this._setGridEditMode(false);$editableElements.each((function(){var $el=$(this),value=$el.data("originalValue"),text,colDef;$el.removeClass("datetime-wrapper cell-editing required-field form-group");if(!value){colDef=self.preparedHeaderData[$el.attr("data-col-id")];text=self.getTextValue(colDef.field);$el.text(self.Utils.isDefined(text)?text:"")}else{$el.html(self.options.getCustomExpression(value.fieldName,value.rowIndex))}}));$editButton.removeClass("hidden");$cancelButton.addClass("hidden");$saveButton.addClass("hidden");this.addOrRemoveScroll()},deleteRow:function(e){e.stopPropagation();var $row=$(e.target).closest("tr.app-datagrid-row"),rowId=$row.attr("data-row-id"),rowData=this.options.data[rowId],isNewRow=this._isNewRow($row),className,isActiveRow,isValid,options={},self=this;this.options.setActionRowIndex(rowId);this.options.setLastActionPerformed(this.options.ACTIONS.DELETE);if(_.isFunction(this.options.beforeRowDelete)){this.options.beforeRowDelete(rowData,e)}if(isNewRow){this.disableActions(false);this._setGridEditMode(false);$row.attr("data-removed",true);$row.remove();if(!this.preparedData.length){this.setStatus("nodata",this.dataStatus.nodata)}this.addOrRemoveScroll();return}if(_.isFunction(this.options.onBeforeRowDelete)){isValid=this.options.onBeforeRowDelete(rowData,e,options);if(isValid===false){return}}if(_.isFunction(this.options.onRowDelete)){className=this.options.cssClassNames.deleteRow;isActiveRow=$row.attr("class").indexOf("active")!==-1;if(isActiveRow){$row.removeClass("active")}$row.addClass(className);this.options.onRowDelete(rowData,(function(){if(isActiveRow){$row.addClass("active")}$row.removeClass(className);self.addOrRemoveScroll()}),e,(function(skipFocus,error){if(self.options.isNavTypeScrollOrOndemand()){var rowId=+$(e.target).closest("tr.app-datagrid-row").attr("data-row-id");var $row=self.gridElement.find('tr.app-datagrid-row[data-row-id="'+rowId+'"]');self.options.setDeletedRowIndex(rowId);self.preparedData.splice(rowId,1);self.options.data.splice(rowId,1);self.gridElement.find("tr.app-datagrid-row:gt("+rowId+")").each((function(index,row){if(!$row.is(":last-child")&&!$(row).hasClass("always-new-row")){$(row).attr("data-row-id",rowId);self.preparedData[rowId].$$pk--;self.preparedData[rowId].$$index--;self.preparedData[rowId].$index--;rowId++}}));$row.remove()}if(self.options.editmode!==self.CONSTANTS.QUICK_EDIT||!($(e.target).hasClass("delete-row-button")||self.Utils.isDeleteKey(e))){return}self.__setStatus();var rowID,$nextRow;if(error){return}rowID=+$(e.target).closest("tr.app-datagrid-row").attr("data-row-id");$nextRow=self.gridElement.find('tr.app-datagrid-row[data-row-id="'+rowID+'"]');if(!$nextRow.length){$nextRow=self.gridElement.find('tr.app-datagrid-row[data-row-id="'+(rowID-1)+'"]')}$nextRow.trigger("click",[undefined,{action:"edit",skipFocus:skipFocus}])}),options)}},deleteRowAndUpdateSelectAll:function(e){this.deleteRow(e);this.updateSelectAllCheckboxState()},_deselectPreviousSelection:function($row,e){var selectedRows=this.gridElement.find("tr.app-datagrid-row.active"),rowId=$row.attr("data-row-id"),self=this;selectedRows.each((function(){var id=$(this).attr("data-row-id"),preparedData=self.preparedData[id];if(id!==rowId&&preparedData){$(this).find("input[rowSelectInput]:radio").prop("checked",false);preparedData._selected=preparedData._checked=false;$(this).removeClass("active");self.options.callOnRowDeselectEvent(preparedData,e)}}))},resetSortIcons:function($el){this.isResetSortIconsDone=true;var $sortContainer;if(!$el&&this.gridHeaderElement){$sortContainer=this.gridHeaderElement.find(".sort-buttons-container.active");$el=$sortContainer.find("i.sort-icon");$sortContainer.removeClass("active")}$el.removeClass("desc asc").removeClass(this.options.cssClassNames.descIcon).removeClass(this.options.cssClassNames.ascIcon)},setSortIconDefault:function(){const sortInfo=this.options.sortInfo,$e=this.tableContainer,$th=$e.find("[data-col-field='"+sortInfo.field+"']"),$sortContainer=$th.find(".sort-buttons-container"),$sortIcon=$sortContainer.find("i.sort-icon"),direction=sortInfo.direction;if(direction==="asc"){$sortIcon.addClass(direction+" "+this.options.cssClassNames.ascIcon);$sortContainer.addClass("active")}else if(direction==="desc"){$sortIcon.addClass(direction+" "+this.options.cssClassNames.descIcon);$sortContainer.addClass("active")}},sortHandler:function(e){e.stopImmediatePropagation();if($(e.target).hasClass("header-data")&&this.options.enableColumnSelection){this.headerClickHandler(e)}var $e=$(e.target),$th=$e.closest("th.app-datagrid-header-cell"),id=$th.attr("data-col-id"),$sortContainer=$th.find(".sort-buttons-container"),$sortIcon=$sortContainer.find("i.sort-icon"),direction=$sortIcon.hasClass("asc")?"desc":"asc",sortInfo=this.options.sortInfo,$previousSortMarker=this.gridHeaderElement.find(".sort-buttons-container.active"),field=$th.attr("data-col-field"),$previousSortedColumn,$previousSortIcon,colId,colDef;this.resetSortIcons($sortIcon);$sortIcon.addClass(direction);if(direction==="asc"){$sortIcon.addClass(this.options.cssClassNames.ascIcon);$sortContainer.addClass("active")}else if(direction==="desc"){$sortIcon.addClass(this.options.cssClassNames.descIcon);$sortContainer.addClass("active")}if($previousSortMarker.length){$previousSortedColumn=$previousSortMarker.closest("th.app-datagrid-header-cell");colId=$previousSortedColumn.attr("data-col-id");colDef=this.preparedHeaderData[colId];$previousSortIcon=$previousSortMarker.find("i.sort-icon");if(colDef.field!==field){$previousSortMarker.removeClass("active");this.resetSortIcons($previousSortIcon)}colDef.sortInfo={sorted:false,direction:""}}sortInfo.direction=direction;sortInfo.field=field;if(direction!==""){this.preparedHeaderData[id].sortInfo={sorted:true,direction:direction}}this._setGridEditMode(false);this.closeEditedRow();this.options.sortHandler.call(this,this.options.sortInfo,e,"sort")},processUpDownKeys:function(event,$row,direction){var self=this;var rowData=$row.find("input").val();if($row.hasClass("row-editing")&&self.options.editmode===self.CONSTANTS.QUICK_EDIT&&rowData){self.toggleEditRow(event,{action:"save",noMsg:true,success:function(skipFocus,error){self.editSuccessHandler(skipFocus,error,event,$row,true,direction)}})}else{$row=direction==="down"?$row.next():$row.prev();if(this.options.rowExpansionEnabled&&!$row.is(":visible")){$row=direction==="down"?$row.next():$row.prev()}$row.focus()}},resetNewRow:function($row){var rowData={},self=this;this.options.clearForm(true);self.setDefaultRowData(rowData);$row.find("[data-field-name]").each((function(){var $input=$(this),fieldName=$input.attr("data-field-name")+"_new";self.options.setFieldValue(fieldName,rowData[$input.attr("data-field-name")]||"")}));self.options.safeApply();self.setFocusOnElement(undefined,$row,true)},_onEnter:function($target,$row,quickEdit,event){var self=this;if($target.is("button")){return}if(quickEdit&&$target.hasClass("app-datagrid-row")&&!$target.hasClass("row-editing")){$row.trigger("click",[undefined,{action:"edit"}])}else{if($row.hasClass("row-editing")&&$target.closest("[data-field-name]").length){$target.blur();self.toggleEditRow(event,{action:"save",success:function(skipFocus,error){if(error){$target.focus()}else{self.focusActiveRow();self.focusNewRow()}}})}else{$row.trigger("click");if(quickEdit&&$target.hasClass("always-new-row")&&$target.hasClass("row-editing")){self.focusNewRow()}}}if(!$target.is("button")){event.stopPropagation()}},onKeyDown:function(event){var $target=$(event.target),$row=$target.closest("tr.app-datagrid-row"),self=this,quickEdit=this.options.editmode===this.CONSTANTS.QUICK_EDIT,isNewRow;if(this.options.rowExpansionEnabled&&!$row.length){$row=$target.closest("tr.app-datagrid-detail-row")}if(this.Utils.isDeleteKey(event)){if(!this.options.actionsEnabled.delete||$target.is("input")||$target.hasClass("form-control")){return}this.deleteRow(event);return}if(event.which===27){isNewRow=this._isNewRow($row);if(isNewRow&&$row.hasClass("always-new-row")){$target.blur();self.resetNewRow($row)}else{$row.trigger("click",[undefined,{action:"cancel"}])}if(!isNewRow){$row.focus()}return}if(event.which===13){event.stopPropagation();this._debounceOnEnter($target,$row,quickEdit,event);return}if(event.which===38){this.processUpDownKeys(event,$row,"up");return}if(event.which===40){this.processUpDownKeys(event,$row,"down")}},editSuccessHandler:function(skipFocus,error,e,$row,isSameRow,direction){var self=this,rowID,$nextRow;self.__setStatus();if(error){self.setFocusOnElement(e);return}rowID=+$row.attr("data-row-id");if(direction){rowID=direction==="down"?++rowID:--rowID;$nextRow=self.gridElement.find('tr.app-datagrid-row[data-row-id="'+rowID+'"]');if($nextRow.length){$nextRow.focus()}else{$row.focus()}return}if(!isSameRow&&!_.isUndefined(isSameRow)){rowID++}$nextRow=self.gridElement.find('tr.app-datagrid-row[data-row-id="'+rowID+'"]');if($nextRow.hasClass("always-new-row")){if(self.options.formPosition!=="top"||$row.hasClass("always-new-row")){self.addNewRow(skipFocus)}}else if($nextRow.length){$nextRow.trigger("click",[undefined,{action:"edit",skipFocus:skipFocus,skipSelect:self.options.multiselect}])}else if(self.options.actionsEnabled.new){self.addNewRow(skipFocus)}},isLastColumn:function($target){var $cell=$target.closest("td.app-datagrid-cell"),$editCells;if($cell.is(":last-child")){return true}if($cell.hasClass("cell-editing")){$editCells=$cell.closest("tr.app-datagrid-row").find(".cell-editing").has('> :not([disabled="disabled"])');return $cell.attr("data-col-id")===$editCells.last().attr("data-col-id")}return false},attachEventHandlers:function($htm){var $header=this.gridHeaderElement,self=this;if(this.options.enableRowSelection){$htm[0].removeEventListener("click",this.rowClickHandlerOnCapture.bind(this),true);$htm.off();$htm[0].addEventListener("click",this.rowClickHandlerOnCapture.bind(this),true);$htm.on("click",this.rowSelectionHandler.bind(this));$htm.on("dblclick",this.rowDblClickHandler.bind(this));$htm.on("keydown",this.onKeyDown.bind(this))}if($header){if(this.options.enableColumnSelection){$header.find("th[data-col-selectable]").off("click",this.columnSelectionHandler.bind(this));$header.find("th[data-col-selectable]").on("click",this.columnSelectionHandler.bind(this))}else{$header.find("th[data-col-selectable]").off("click")}if(this.options.enableSort){if(this.options.enableColumnSelection){$header.find("th[data-col-sortable] .header-data").off("click",this.sortHandler.bind(this));$header.find("th[data-col-sortable] .header-data").on("click",this.sortHandler.bind(this))}else{$header.find("th[data-col-sortable]").off("click",this.sortHandler.bind(this));$header.find("th[data-col-sortable]").on("click",this.sortHandler.bind(this))}}else{if(this.options.enableColumnSelection){$header.find("th[data-col-sortable] .header-data").off("click")}else{$header.find("th[data-col-sortable]").off("click")}}}if(this.options.rowActions.length){$htm.find(".cancel-edit-row-button").off("click");$htm.find(".save-edit-row-button").off("click");$htm.find(".cancel-edit-row-button").on("click",{action:"cancel"},this.toggleEditRow.bind(this));$htm.find(".save-edit-row-button").on("click",{action:"save"},this.toggleEditRow.bind(this))}if(self.options.editmode===self.CONSTANTS.QUICK_EDIT){$htm.on("focusout","tr.app-datagrid-row",(function(e){var $target=$(e.target),$row=$target.closest("tr.app-datagrid-row"),$relatedTarget=$(e.relatedTarget),isLastColumn=self.isLastColumn($target,$relatedTarget),isTargetRowAction=$target.closest("span.actions-column").length>0,isRelatedTargetRowAction=$relatedTarget.closest("span.actions-column").length>0,isTargetGridAction=$relatedTarget.closest("div.app-datagrid-actions").length>0,isRelatedTargetGridAction=$relatedTarget.closest("div.app-datagrid-actions").length>0,invalidTargets='.row-editing:not(".always-new-row"), .row-action-button, .app-datagrid-cell, .caption, button.btn-time, button.btn-date';function isInvalidTarget(){if(!$relatedTarget.closest(".app-grid").length){return true}return $relatedTarget.is(invalidTargets)}if($relatedTarget.is("tr.app-datagrid-row")){if($relatedTarget.attr("data-row-id")===$row.attr("data-row-id")){return}}if(isRelatedTargetRowAction||$row.hasClass("danger")||isRelatedTargetGridAction||isTargetRowAction&&isRelatedTargetRowAction||isTargetRowAction&&e.relatedTarget===null||isInvalidTarget()||$relatedTarget.attr("focus-target")===""){return}if(!isTargetGridAction&&!isTargetRowAction){if(!isLastColumn||isLastColumn&&e.relatedTarget===null||$target.hasClass("file-upload")){return}}self.options.timeoutCall((function(){self.toggleEditRow(e,{action:"save",noMsg:true,success:function(skipFocus,error,isNewRow){if(!isNewRow){self.editSuccessHandler(skipFocus,error,e,$row)}}})}))}))}$htm.find('[data-identifier="rowExpansionButtons"]').off("click");$htm.find('[data-identifier="rowExpansionButtons"]').on("click",(function(e){var $row=$(e.target).closest("tr.app-datagrid-row");if($(this).find(".app-button").attr("disabled")){return}self.toggleExpandRow(+$row.attr("data-row-id"),undefined,e)}))},expandRow:function(rowId){this.toggleExpandRow(rowId,true)},collapseRow:function(rowId){this.toggleExpandRow(rowId,false)},_collapseRow:function(e,rowData,rowId,$nextDetailRow,$icon){var self=this,$tbody=self.gridElement,$row=$($tbody.find('> tr.app-datagrid-row[data-row-id="'+rowId+'"]'));$row.removeClass(self.options.cssClassNames.expandedRowClass);$row.find("button, a").attr("aria-expanded","false").attr("aria-live","polite");if(this.options.onBeforeRowCollapse(e,rowData,rowId)===false){return}if($icon.length&&$icon.hasClass(this.options.cssClassNames.rowExpandIcon)){$icon.removeClass(this.options.cssClassNames.rowExpandIcon).addClass(this.options.cssClassNames.rowCollapseIcon)}$nextDetailRow.hide();this.options.onRowCollapse(e,rowData)},toggleExpandRow:function(rowId,isExpand,e){var self=this,$tbody=self.gridElement,$row=$($tbody.find('> tr.app-datagrid-row[data-row-id="'+rowId+'"]')),rowData=_.clone(self.options.data[rowId]),$nextDetailRow=$row.next("tr.app-datagrid-detail-row"),isClosed=!$nextDetailRow.is(":visible"),$icon=$row.find('[data-identifier="rowExpansionButtons"] i.app-icon');rowData.$index=rowId+1;if(isExpand&&!isClosed){return}if(isExpand===false&&isClosed){return}if(isClosed){$row.addClass(self.options.cssClassNames.expandedRowClass);$row.find("button, a").attr("aria-expanded","true");if(e&&self.preparedData[rowId]._selected){e.stopPropagation()}if(self.options.rowDef.closeothers){$tbody.find("> tr.app-datagrid-detail-row:visible").each((function(){var $otherDetailRow=$(this),$otherIcon=$otherDetailRow.prev("tr.app-datagrid-row").find('[data-identifier="rowExpansionButtons"] i.app-icon'),otherRowId=+$otherDetailRow.attr("data-row-id"),otherRowData=self.options.data[otherRowId];$otherDetailRow.hide();self._collapseRow(e,otherRowData,otherRowId,$otherDetailRow,$otherIcon)}))}self.options.generateRowDetailView(e,rowData,rowId,$nextDetailRow.find("td.app-datagrid-row-details-cell .details-section"),$nextDetailRow.find("td.app-datagrid-row-details-cell .row-overlay"),(function(){if($icon.length&&$icon.hasClass(self.options.cssClassNames.rowCollapseIcon)){$icon.removeClass(self.options.cssClassNames.rowCollapseIcon).addClass(self.options.cssClassNames.rowExpandIcon)}$nextDetailRow.show()}))}else{self._collapseRow(e,rowData,rowId,$nextDetailRow,$icon)}},_findAndReplaceCompiledTemplates:function(){if(!this.gridElement){return}var $compiledCells=this.gridElement.find("td[data-compiled-template]"),self=this;$compiledCells.each((function(){var $cell=$(this),id=$cell.attr("data-compiled-template");$cell.replaceWith(self.compiledCellTemplates[id])}))},_renderSearch:function(){var $htm=$(this._getSearchEl()),self=this,$searchBox;function search(e){e.stopPropagation();var searchText=$htm.find('[data-element="dgSearchText"]')[0].value,$filterField=$htm.find('[data-element="dgFilterValue"]'),field=$filterField[0].value,colDefIndex=$htm.find("option:selected").attr("data-coldef-index"),colDef=self.options.colDefs[colDefIndex],type=colDef&&colDef.type?colDef.type:"";self.searchObj={field:field,value:searchText,type:type,event:e};self.options.searchHandler.call(self,self.searchObj,e,"search")}this.element.find(".form-search").remove();$htm.insertBefore(this.gridContainer);this.gridSearch=this.element.find(".form-search");$searchBox=this.gridSearch.find('[data-element="dgSearchText"]');this.gridSearch.find(".app-search-button").on("click",search);this.gridSearch.find('[data-element="dgFilterValue"]').on("change",(function(e){if(self.dataStatusContainer.find(".status").text()===self.options.dataStates.nodata){search(e)}}));$searchBox.on("keyup",(function(e){e.stopPropagation();if(!$(this).val()){self.emptySearch=true;if(self.searchObj.value){self.searchObj.value="";search(e)}}else{self.emptySearch=false}if(e.which===13){search(e)}}))},_renderRowFilter:function(){var $row=$('<tr class="filter-row"></tr>'),self=this,$headerElement=this.options.isMobile&&!this.options.showHeader?this.gridElement:this.gridHeaderElement;$headerElement.find(".filter-row").remove();this.options.generateFilterRow();this.preparedHeaderData.forEach((function(field,index){var fieldName=field.field,$th=$('<th data-col-id="'+index+'"></th>');if(!field.searchable){$row.append($th);return}$th.append(self.options.getFilterWidget(fieldName));$row.append($th)}),this);if(this.options.showHeader){this.gridHeaderElement.append($row)}else{if(this.options.isMobile){$headerElement.empty().append($row)}else{$headerElement.empty().append($row)}}this.gridSearch=$headerElement.find(".filter-row")},_renderHeader:function(){var headerTemplate=this._getHeaderTemplate(),$colgroup=headerTemplate.colgroup,self=this,$header;this.gridElement.parent().scroll((function(){self.gridHeaderElement.parent().prop("scrollLeft",this.scrollLeft)}));if(!this.options.showHeader){this.tableContainer.append($colgroup);this.gridHeaderElement.hide();return}else{this.gridHeaderElement.show()}$header=headerTemplate.header;function toggleSelectAll(e){var $checkboxes=$('tr.app-datagrid-row:visible td input[name="gridMultiSelect"]:checkbox',self.gridElement),checked=this.checked;$checkboxes.prop("checked",checked);$checkboxes.each((function(){var $row=$(this).closest("tr.app-datagrid-row"),rowId=$row.attr("data-row-id"),rowData=self.options.data[rowId];self.options.assignSelectedItems(rowData,e);self.toggleRowSelection($row,checked,e,true);if(checked&&_.isFunction(self.options.onRowSelect)){self.options.onRowSelect(rowData,e)}if(!checked&&_.isFunction(self.options.onRowDeselect)){self.options.onRowDeselect(rowData,e)}}))}var headerCells=$header.find("th.app-datagrid-header-cell");var headerCols=$colgroup.find("col");headerCells.each((function(){var id=Number($(this).attr("data-col-id")),colDef=self.preparedHeaderData[id],$headerCol=$(headerCols[id]);if(!colDef){return}if(!_.isUndefined(colDef.show)&&!colDef.show){$(this).hide();$headerCol.hide()}}));if(this.options.isMobile){this.tableContainer.append($colgroup)}else{this.tableContainer.append($colgroup)}$header.on("click",".app-datagrid-header-cell input:checkbox",toggleSelectAll);if(_.isFunction(this.options.onHeaderClick)){this.gridHeaderElement.find("th.app-datagrid-header-cell").on("click",this.headerClickHandler.bind(this))}if(!this.options.isMobile&&this.gridHeaderElement.length){this.gridHeaderElement.find("th[data-col-resizable]").resizable({handles:"e",minWidth:50,resize:function(evt,ui){var $colElement,$colHeaderElement,$cellElements,colIndex=+ui.helper.attr("data-col-id")+1,originalWidth=ui.helper.width(),newWidth=ui.size.width,originalTableWidth,newTableWidth;$colHeaderElement=self.tableContainer.find("colgroup > col:nth-child("+colIndex+")");$colElement=self.tableContainer.find("colgroup > col:nth-child("+colIndex+")");$cellElements=self.gridElement.find("tr.app-datagrid-row > td:nth-child("+colIndex+") > div");$colElement.width(newWidth);$colHeaderElement.width(newWidth);$cellElements.width(newWidth);$(this).css("height","auto");if(newWidth>ui.originalSize.width){originalTableWidth=self.gridHeaderElement.width();newTableWidth=originalTableWidth+newWidth-originalWidth;self.gridHeaderElement.width(newTableWidth);self.gridElement.width(newTableWidth)}self.addOrRemoveScroll();self.options.redrawWidgets()}})}if(!this.isResetSortIconsDone){this.setSortIconDefault()}},addOrRemoveScroll:function(){var gridContent=this.gridContainer.find("tbody"),gridHeader=this.gridContainer.find(".table-header");if(gridContent.scrollHeight>gridContent.clientHeight&&!this.Utils.isMac()){gridHeader.addClass("scroll-visible")}else{gridHeader.removeClass("scroll-visible")}},_handleCustomEvents:function(e,options){this.options.handleCustomEvents(e,options)},_setActionsEnabled:function(){var self=this;_.forEach(this.options.rowActions,(function(def){if(_.includes(def.action,"editRow(")){self.options.actionsEnabled.edit=true}else if(_.includes(def.action,"deleteRow(")){self.options.actionsEnabled.delete=true}}))},_appendRowActions:function($htm,isNewRow,rowData){var self,rowOperationsCol=this._getRowActionsColumnDef();if(this.options.rowActions.length||rowOperationsCol){this._setActionsEnabled();self=this;$htm.find("[data-identifier='actionButtons']").each((function(index){var _rowData,$row,rowId,rowIndex=index;if(isNewRow){_rowData=rowData}else{$row=$(this).closest("tr.app-datagrid-row");rowId=parseInt($row.attr("data-row-id"),10);_rowData=_.clone(self.options.data[rowId]);_rowData.$index=rowIndex+1}self.options.generateRowActions(_rowData,rowIndex);$(this).empty().append(self.options.getRowAction(rowIndex))}))}},_renderGrid:function(isCreated){var $htm,isScrollorOnDemand=this.options.isNavTypeScrollOrOndemand(),pageStartIndex=this.getPageStartIndex();$("table.table-bordered").parents(".app-grid-header-inner").addClass("table_border");if(isScrollorOnDemand){var $tbody=this.gridElement;var template=this._getGridTemplate();$htm=$(template);if(template&&!$tbody.length){this.gridElement.append($htm)}}else{var templates=this._getGridTemplate();$htm=$(templates);if(templates){this.gridElement.append($htm)}}if(this.options.summaryRow){var $summaryRowHtm=$(this._getSummaryRowTemplate());this.tableContainer.find("tfoot").remove();if(this.options.data.length){this.tableContainer.append($summaryRowHtm)}}if(!this.options.data.length&&this.dataStatus.state==="nodata"){this.setStatus("nodata")}else{this.dataStatus.state=this.dataStatus.state||"loading";this.dataStatus.message=this.dataStatus.message||this.options.dataStates.loading;this.setStatus(this.dataStatus.state,this.dataStatus.message,isCreated)}this.gridBody=this.gridElement.find("tbody");this.gridFooter=this.tableContainer.find("tfoot");this._findAndReplaceCompiledTemplates();this.options.clearRowActions();this._appendRowExpansionButtons($htm);this._appendRowActions($htm);this.attachEventHandlers($htm);this.__setStatus(isCreated);if(this.options.editmode===this.CONSTANTS.QUICK_EDIT&&this.options.showNewRow){this.addNewRow(false,true)}if(isCreated){this._setColSpan(this.options.headerConfig)}if(_.isFunction(this.options.onDataRender)){this.options.onDataRender()}if(!isCreated&&this.options.selectFirstRow){if(this.options.multiselect){this.options.selectFirstRow=false}if(this.gridElement.find("tr.app-datagrid-row.active").length<=0){this.selectFirstRow(true,true)}}},_render:function(isCreated){if(!this.tableId){this.tableId=this.Utils.generateGuid()}var overflow=this.options.isNavTypeScrollOrOndemand()&&(this.options.height==="100%"||this.options.height==="auto")?"hidden":"auto";var statusContainer='<div class="overlay">'+'<div class="status"><i class="'+this.options.loadingicon+'"></i><span class="message"></span></div>'+"</div>",table='<div class="table-container table-responsive">'+'<div class="app-grid-header">'+'<div class="app-grid-header-inner">'+'<table tabindex="0" class="'+this.options.cssClassNames.gridDefault+" "+this.options.cssClassNames.grid+'">'+'<thead tabindex="0" class="table-header thead-sticky" id="table_header_'+this.tableId+'">'+'</thead><tbody class="app-grid-content app-datagrid-body" id="table_'+this.tableId+'">'+"</tbody></table>"+"</div></div></div>",$statusContainer=$(statusContainer),$tableContainer=this.element.find(".table-container");this.gridContainer=$(table);this.gridHeaderElement=this.gridContainer.find(".table-header");this._setStyles($statusContainer.find("div.overlay"),"display:none");this._setStyles(this.gridContainer.find("div.app-grid-header-inner"),"height:"+this.options.height+"; overflow: auto;");this.tableContainer=this.gridContainer.find("table");this.gridElement=this.gridContainer.find(".app-grid-content");if(this.options.isNavTypeScrollOrOndemand()&&(!$tableContainer.length||!this.options.isNextPageData)||!this.options.isNavTypeScrollOrOndemand()){this.element.find(".table-container").remove();this.element.append(this.gridContainer)}this.options.setIsNextPageData(false);if(!this.gridContainer.find(".overlay").length){this.dataStatusContainer=$(statusContainer);this.gridContainer.append(this.dataStatusContainer)}if(this.gridHeaderElement){this.gridHeaderElement.empty();this.gridElement.find("colgroup").remove()}this._renderHeader();if(this.options.filtermode===this.CONSTANTS.SEARCH&&(_.isEmpty(this.searchObj)||this.searchObj&&!this.searchObj.field&&!this.searchObj.value)){this._renderSearch()}else if(this.options.filtermode===this.CONSTANTS.MULTI_COLUMN){this._renderRowFilter()}if(this.options.spacing==="condensed"){this._toggleSpacingClasses("condensed")}this._renderGrid(isCreated);this.addNavigationControls()},addNavigationControls:function(){if(this.options.isdynamictable){this.element.find(".on-demand-datagrid").remove();if(this.options.navigation==="On-Demand"&&!this.element.find(".on-demand-datagrid").length){this.options.addLoadMoreBtn()}else if(this.options.navigation==="Scroll"){this.options.bindScrollEvt()}}},__setStatus:function(isCreated){var loadingIndicator=this.dataStatusContainer.find("i"),state=this.dataStatus.state,isScrollOrOndemand=this.options.isNavTypeScrollOrOndemand();this.dataStatusContainer.find(".message").text(this.dataStatus.message);if(state==="loading"){loadingIndicator.removeClass("hidden")}else{loadingIndicator.addClass("hidden")}if(state==="ready"){this.dataStatusContainer.hide()}else{if(this.options.isNavTypeScrollOrOndemand()&&(state==="nodata"||this.options.getCurrentPage()==this.options.getPageCount()&&!this.options.showviewlessbutton)){this.element.find(".on-demand-datagrid a").hide()}this.dataStatusContainer.show()}if(state==="nodata"||state==="loading"||state==="error"){if(this.options.height==="100%"||this.options.height==="auto"){if(state==="nodata"){this.dataStatusContainer.css("height","auto");this.dataStatus.contentHeight=0}else if(this.options.isNavTypeScrollOrOndemand()&&this.options.getCurrentPage()>1){this.dataStatusContainer.hide()}else{this.dataStatus.height=this.dataStatus.height||this.dataStatusContainer.outerHeight();this.dataStatus.contentHeight=this.gridElement.outerHeight()||this.dataStatus.contentHeight;this.dataStatusContainer.css("height",this.dataStatus.height>this.dataStatus.contentHeight?"auto":this.dataStatus.contentHeight)}}if(!isScrollOrOndemand||isScrollOrOndemand&&this.options.getCurrentPage()===1){this.gridContainer.addClass("show-msg")}}else{this.gridContainer.removeClass("show-msg");if(this.options.editmode===this.CONSTANTS.QUICK_EDIT){if(this.options.activeRow){this.attachHandlersToActiveRow(this.options.activeRow)}this.options.activeRow=undefined}}if(!isCreated){this.setColGroupWidths()}this.addOrRemoveScroll()},attachHandlersToActiveRow(rowObj){var rowIndex=this.Utils.getObjectIndex(this.options.data,rowObj);var row=this.gridElement.find("tr.app-datagrid-row[data-row-id="+rowIndex+"]");if(!row.length){return}else if(!row.hasClass("active")){row.addClass("active")}this.focusActiveRow();this.attachEventHandlers(row)},setActiveRow(row){this.options.activeRow=row},setStatus:function(state,message,isCreated){var $newRow;if(state==="nodata"){$newRow=this.gridElement&&this.gridElement.find("tr.app-datagrid-row.always-new-row");state=$newRow&&$newRow.length?"ready":state}this.dataStatus.state=state;this.options.setGridState(state);this.dataStatus.message=message||this.options.dataStates[state];if(this._setStatusCalled){this._setStatus(isCreated)}else{this.__setStatus(isCreated);this._setStatusCalled=true}},setGridDimensions:function(key,value){if(value.indexOf("px")===-1&&value.indexOf("%")===-1&&value.indexOf("em")===-1&&value!="auto"){value=value+"px"}this.options[key]=value;if(key==="height"){var elements=this.gridHeaderElement.find("th");this.gridContainer.find(".app-grid-header-inner").css(key,value);if(this.options.isNavTypeScrollOrOndemand()&&(this.options.height!="100%"&&this.options.height!="auto")){this.gridContainer.find(".app-grid-header-inner").css("overflow","auto")}this.dataStatusContainer.css(key,value)}this.addOrRemoveScroll()},setColumnProp:function(fieldName,property,val,isGroup){var $col;if(property==="displayName"){if(isGroup){$col=this.gridHeaderElement.find('th[data-col-group="'+fieldName+'"]')}else{$col=this.gridHeaderElement.find('th[data-col-field="'+fieldName+'"]')}$col.attr("title",val);$col.find(".header-data").html(val);if(this.options.filtermode===this.CONSTANTS.SEARCH&&this.gridSearch){this.gridSearch.find('select option[value="'+fieldName+'"]').text(val)}}},applyRowNgClass:function(val,index){var $row=this.gridElement.find('tr.app-datagrid-row[data-row-id="'+index+'"]');$row.removeClass(val.toRemove);$row.addClass(val.toAdd)},applyColNgClass:function(val,rowIndex,colIndex){var $cell=this.gridElement.find('tr.app-datagrid-row[data-row-id="'+rowIndex+'"] td.app-datagrid-cell[data-col-id="'+colIndex+'"]');$cell.removeClass(val.toRemove);$cell.addClass(val.toAdd)},_destroy:function(){this.element.text("");window.clearTimeout(this.refreshGridTimeout)}});(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?factory(exports,require("rxjs")):typeof define==="function"&&define.amd?define(["exports","rxjs"],factory):(global=typeof globalThis!=="undefined"?globalThis:global||self,factory((global.awesomeCordova=global.awesomeCordova||{},global.awesomeCordova.core={}),global.rxjs))})(this,(function(exports,rxjs){"use strict";function checkReady(){if(typeof process==="undefined"){var win_1=typeof window!=="undefined"?window:{};var DEVICE_READY_TIMEOUT_1=5e3;var before_1=Date.now();var didFireReady_1=false;win_1.document.addEventListener("deviceready",(function(){console.log("Ionic Native: deviceready event fired after "+(Date.now()-before_1)+" ms");didFireReady_1=true}));setTimeout((function(){if(!didFireReady_1&&win_1.cordova){console.warn("Ionic Native: deviceready did not fire within "+DEVICE_READY_TIMEOUT_1+"ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.")}}),DEVICE_READY_TIMEOUT_1)}}var ERR_CORDOVA_NOT_AVAILABLE={error:"cordova_not_available"};var ERR_PLUGIN_NOT_INSTALLED={error:"plugin_not_installed"};function getPromise(callback){var tryNativePromise=function(){if(Promise){return new Promise((function(resolve,reject){callback(resolve,reject)}))}else{console.error("No Promise support or polyfill found. To enable Ionic Native support, please add the es6-promise polyfill before this script, or run with a library like Angular or on a recent browser.")}};if(typeof window!=="undefined"&&window.angular){var doc=window.document;var injector=window.angular.element(doc.querySelector("[ng-app]")||doc.body).injector();if(injector){var $q=injector.get("$q");return $q((function(resolve,reject){callback(resolve,reject)}))}console.warn("Angular 1 was detected but $q couldn't be retrieved. This is usually when the app is not bootstrapped on the html or body tag. Falling back to native promises which won't trigger an automatic digest when promises resolve.")}return tryNativePromise()}function wrapPromise(pluginObj,methodName,args,opts){if(opts===void 0){opts={}}var pluginResult,rej;var p=getPromise((function(resolve,reject){if(opts.destruct){pluginResult=callCordovaPlugin(pluginObj,methodName,args,opts,(function(){var args=[];for(var _i=0;_i<arguments.length;_i++){args[_i]=arguments[_i]}return resolve(args)}),(function(){var args=[];for(var _i=0;_i<arguments.length;_i++){args[_i]=arguments[_i]}return reject(args)}))}else{pluginResult=callCordovaPlugin(pluginObj,methodName,args,opts,resolve,reject)}rej=reject}));if(pluginResult&&pluginResult.error){p.catch((function(){}));typeof rej==="function"&&rej(pluginResult.error)}return p}function wrapOtherPromise(pluginObj,methodName,args,opts){if(opts===void 0){opts={}}return getPromise((function(resolve,reject){var pluginResult=callCordovaPlugin(pluginObj,methodName,args,opts);if(pluginResult){if(pluginResult.error){reject(pluginResult.error)}else if(pluginResult.then){pluginResult.then(resolve).catch(reject)}}else{reject({error:"unexpected_error"})}}))}function wrapObservable(pluginObj,methodName,args,opts){if(opts===void 0){opts={}}return new rxjs.Observable((function(observer){var pluginResult;if(opts.destruct){pluginResult=callCordovaPlugin(pluginObj,methodName,args,opts,(function(){var args=[];for(var _i=0;_i<arguments.length;_i++){args[_i]=arguments[_i]}return observer.next(args)}),(function(){var args=[];for(var _i=0;_i<arguments.length;_i++){args[_i]=arguments[_i]}return observer.error(args)}))}else{pluginResult=callCordovaPlugin(pluginObj,methodName,args,opts,observer.next.bind(observer),observer.error.bind(observer))}if(pluginResult&&pluginResult.error){observer.error(pluginResult.error);observer.complete()}return function(){try{if(opts.clearFunction){if(opts.clearWithArgs){return callCordovaPlugin(pluginObj,opts.clearFunction,args,opts,observer.next.bind(observer),observer.error.bind(observer))}return callCordovaPlugin(pluginObj,opts.clearFunction,[])}}catch(e){console.warn("Unable to clear the previous observable watch for",pluginObj.constructor.getPluginName(),methodName);console.warn(e)}}}))}function wrapEventObservable(event,element){element=typeof window!=="undefined"&&element?get$1(window,element):element||(typeof window!=="undefined"?window:{});return rxjs.fromEvent(element,event)}function checkAvailability(plugin,methodName,pluginName){var pluginRef,pluginPackage;if(typeof plugin==="string"){pluginRef=plugin}else{pluginRef=plugin.constructor.getPluginRef();pluginName=plugin.constructor.getPluginName();pluginPackage=plugin.constructor.getPluginInstallName()}var pluginInstance=getPlugin(pluginRef);if(!pluginInstance||!!methodName&&typeof pluginInstance[methodName]==="undefined"){if(typeof window==="undefined"||!window.cordova){cordovaWarn(pluginName,methodName);return ERR_CORDOVA_NOT_AVAILABLE}pluginWarn(pluginName,pluginPackage,methodName);return ERR_PLUGIN_NOT_INSTALLED}return true}function instanceAvailability(pluginObj,methodName){return pluginObj._objectInstance&&(!methodName||typeof pluginObj._objectInstance[methodName]!=="undefined")}function setIndex(args,opts,resolve,reject){if(opts===void 0){opts={}}if(opts.sync){return args}if(opts.callbackOrder==="reverse"){args.unshift(reject);args.unshift(resolve)}else if(opts.callbackStyle==="node"){args.push((function(err,result){if(err){reject(err)}else{resolve(result)}}))}else if(opts.callbackStyle==="object"&&opts.successName&&opts.errorName){var obj={};obj[opts.successName]=resolve;obj[opts.errorName]=reject;args.push(obj)}else if(typeof opts.successIndex!=="undefined"||typeof opts.errorIndex!=="undefined"){var setSuccessIndex=function(){if(opts.successIndex>args.length){args[opts.successIndex]=resolve}else{args.splice(opts.successIndex,0,resolve)}};var setErrorIndex=function(){if(opts.errorIndex>args.length){args[opts.errorIndex]=reject}else{args.splice(opts.errorIndex,0,reject)}};if(opts.successIndex>opts.errorIndex){setErrorIndex();setSuccessIndex()}else{setSuccessIndex();setErrorIndex()}}else{args.push(resolve);args.push(reject)}return args}function callCordovaPlugin(pluginObj,methodName,args,opts,resolve,reject){if(opts===void 0){opts={}}args=setIndex(args,opts,resolve,reject);var availabilityCheck=checkAvailability(pluginObj,methodName);if(availabilityCheck===true){var pluginInstance=getPlugin(pluginObj.constructor.getPluginRef());return pluginInstance[methodName].apply(pluginInstance,args)}else{return availabilityCheck}}function callInstance(pluginObj,methodName,args,opts,resolve,reject){if(opts===void 0){opts={}}args=setIndex(args,opts,resolve,reject);if(instanceAvailability(pluginObj,methodName)){return pluginObj._objectInstance[methodName].apply(pluginObj._objectInstance,args)}}function getPlugin(pluginRef){if(typeof window!=="undefined"){return get$1(window,pluginRef)}return null}function get$1(element,path){var paths=path.split(".");var obj=element;for(var i=0;i<paths.length;i++){if(!obj){return null}obj=obj[paths[i]]}return obj}function pluginWarn(pluginName,plugin,method){if(method){console.warn("Native: tried calling "+pluginName+"."+method+", but the "+pluginName+" plugin is not installed.")}else{console.warn("Native: tried accessing the "+pluginName+" plugin but it's not installed.")}if(plugin){console.warn("Install the "+pluginName+" plugin: 'ionic cordova plugin add "+plugin+"'")}}function cordovaWarn(pluginName,method){if(typeof process==="undefined"){if(method){console.warn("Native: tried calling "+pluginName+"."+method+", but Cordova is not available. Make sure to include cordova.js or run in a device/simulator")}else{console.warn("Native: tried accessing the "+pluginName+" plugin but Cordova is not available. Make sure to include cordova.js or run in a device/simulator")}}}var wrap=function(pluginObj,methodName,opts){if(opts===void 0){opts={}}return function(){var args=[];for(var _i=0;_i<arguments.length;_i++){args[_i]=arguments[_i]}if(opts.sync){return callCordovaPlugin(pluginObj,methodName,args,opts)}else if(opts.observable){return wrapObservable(pluginObj,methodName,args,opts)}else if(opts.eventObservable&&opts.event){return wrapEventObservable(opts.event,opts.element)}else if(opts.otherPromise){return wrapOtherPromise(pluginObj,methodName,args,opts)}else{return wrapPromise(pluginObj,methodName,args,opts)}}};function wrapInstance(pluginObj,methodName,opts){if(opts===void 0){opts={}}return function(){var args=[];for(var _i=0;_i<arguments.length;_i++){args[_i]=arguments[_i]}if(opts.sync){return callInstance(pluginObj,methodName,args,opts)}else if(opts.observable){return new rxjs.Observable((function(observer){var pluginResult;if(opts.destruct){pluginResult=callInstance(pluginObj,methodName,args,opts,(function(){var args=[];for(var _i=0;_i<arguments.length;_i++){args[_i]=arguments[_i]}return observer.next(args)}),(function(){var args=[];for(var _i=0;_i<arguments.length;_i++){args[_i]=arguments[_i]}return observer.error(args)}))}else{pluginResult=callInstance(pluginObj,methodName,args,opts,observer.next.bind(observer),observer.error.bind(observer))}if(pluginResult&&pluginResult.error){observer.error(pluginResult.error)}return function(){try{if(opts.clearWithArgs){return callInstance(pluginObj,opts.clearFunction,args,opts,observer.next.bind(observer),observer.error.bind(observer))}return callInstance(pluginObj,opts.clearFunction,[])}catch(e){console.warn("Unable to clear the previous observable watch for",pluginObj.constructor.getPluginName(),methodName);console.warn(e)}}}))}else if(opts.otherPromise){return getPromise((function(resolve,reject){var result;if(opts.destruct){result=callInstance(pluginObj,methodName,args,opts,(function(){var args=[];for(var _i=0;_i<arguments.length;_i++){args[_i]=arguments[_i]}return resolve(args)}),(function(){var args=[];for(var _i=0;_i<arguments.length;_i++){args[_i]=arguments[_i]}return reject(args)}))}else{result=callInstance(pluginObj,methodName,args,opts,resolve,reject)}if(result&&result.then){result.then(resolve,reject)}else{reject()}}))}else{var pluginResult_1,rej_1;var p=getPromise((function(resolve,reject){if(opts.destruct){pluginResult_1=callInstance(pluginObj,methodName,args,opts,(function(){var args=[];for(var _i=0;_i<arguments.length;_i++){args[_i]=arguments[_i]}return resolve(args)}),(function(){var args=[];for(var _i=0;_i<arguments.length;_i++){args[_i]=arguments[_i]}return reject(args)}))}else{pluginResult_1=callInstance(pluginObj,methodName,args,opts,resolve,reject)}rej_1=reject}));if(pluginResult_1&&pluginResult_1.error){p.catch((function(){}));typeof rej_1==="function"&&rej_1(pluginResult_1.error)}return p}}}function get(element,path){var paths=path.split(".");var obj=element;for(var i=0;i<paths.length;i++){if(!obj){return null}obj=obj[paths[i]]}return obj}var AwesomeCordovaNativePlugin=function(){function AwesomeCordovaNativePlugin(){}AwesomeCordovaNativePlugin.installed=function(){var isAvailable=checkAvailability(this.pluginRef)===true;return isAvailable};AwesomeCordovaNativePlugin.getPlugin=function(){if(typeof window!=="undefined"){return get(window,this.pluginRef)}return null};AwesomeCordovaNativePlugin.getPluginName=function(){var pluginName=this.pluginName;return pluginName};AwesomeCordovaNativePlugin.getPluginRef=function(){var pluginRef=this.pluginRef;return pluginRef};AwesomeCordovaNativePlugin.getPluginInstallName=function(){var plugin=this.plugin;return plugin};AwesomeCordovaNativePlugin.getSupportedPlatforms=function(){var platform=this.platforms;return platform};AwesomeCordovaNativePlugin.pluginName="";AwesomeCordovaNativePlugin.pluginRef="";AwesomeCordovaNativePlugin.plugin="";AwesomeCordovaNativePlugin.repo="";AwesomeCordovaNativePlugin.platforms=[];AwesomeCordovaNativePlugin.install="";return AwesomeCordovaNativePlugin}();function cordova(pluginObj,methodName,config,args){return wrap(pluginObj,methodName,config).apply(this,args)}function overrideFunction(pluginObj,methodName){return new rxjs.Observable((function(observer){var availabilityCheck=checkAvailability(pluginObj,methodName);if(availabilityCheck===true){var pluginInstance_1=getPlugin(pluginObj.constructor.getPluginRef());pluginInstance_1[methodName]=observer.next.bind(observer);return function(){return pluginInstance_1[methodName]=function(){}}}else{observer.error(availabilityCheck);observer.complete()}}))}function cordovaFunctionOverride(pluginObj,methodName,args){return overrideFunction(pluginObj,methodName)}function cordovaInstance(pluginObj,methodName,config,args){args=Array.from(args);return wrapInstance(pluginObj,methodName,config).apply(this,args)}function cordovaPropertyGet(pluginObj,key){if(checkAvailability(pluginObj,key)===true){return getPlugin(pluginObj.constructor.getPluginRef())[key]}return null}function cordovaPropertySet(pluginObj,key,value){if(checkAvailability(pluginObj,key)===true){getPlugin(pluginObj.constructor.getPluginRef())[key]=value}}function instancePropertyGet(pluginObj,key){if(pluginObj._objectInstance&&pluginObj._objectInstance[key]){return pluginObj._objectInstance[key]}return null}function instancePropertySet(pluginObj,key,value){if(pluginObj._objectInstance){pluginObj._objectInstance[key]=value}}checkReady();window.rxjs._throw=window.rxjs.throwError;exports.AwesomeCordovaNativePlugin=AwesomeCordovaNativePlugin;exports.checkAvailability=checkAvailability;exports.cordova=cordova;exports.cordovaFunctionOverride=cordovaFunctionOverride;exports.cordovaInstance=cordovaInstance;exports.cordovaPropertyGet=cordovaPropertyGet;exports.cordovaPropertySet=cordovaPropertySet;exports.getPromise=getPromise;exports.instanceAvailability=instanceAvailability;exports.instancePropertyGet=instancePropertyGet;exports.instancePropertySet=instancePropertySet;exports.wrap=wrap}));(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?module.exports=factory(require("tslib"),require("@angular/core"),require("@awesome-cordova-plugins/core"),require("rxjs"),require("rxjs/operators")):typeof define==="function"&&define.amd?define(["tslib","@angular/core","@awesome-cordova-plugins/core","rxjs","rxjs/operators"],factory):(global=typeof globalThis!=="undefined"?globalThis:global||self,global.awesomeCordova=global.awesomeCordova||{},global.awesomeCordova.plugins=factory(global.tslib,global.ng.core,global.awesomeCordova.core,global.rxjs,global.rxjs.operators))})(this,(function(tslib,core$1,core,rxjs,operators){"use strict";var AppVersion=function(_super){tslib.__extends(AppVersion,_super);function AppVersion(){return _super!==null&&_super.apply(this,arguments)||this}AppVersion.prototype.getAppName=function(){return core.cordova(this,"getAppName",{},arguments)};AppVersion.prototype.getPackageName=function(){return core.cordova(this,"getPackageName",{},arguments)};AppVersion.prototype.getVersionCode=function(){return core.cordova(this,"getVersionCode",{},arguments)};AppVersion.prototype.getVersionNumber=function(){return core.cordova(this,"getVersionNumber",{},arguments)};AppVersion.pluginName="AppVersion";AppVersion.plugin="cordova-plugin-app-version";AppVersion.pluginRef="cordova.getAppVersion";AppVersion.repo="https://github.com/whiteoctober/cordova-plugin-app-version";AppVersion.platforms=["Android","iOS","Windows"];AppVersion.decorators=[{type:core$1.Injectable}];return AppVersion}(core.AwesomeCordovaNativePlugin);var AppVersion$1=Object.freeze({__proto__:null,AppVersion:AppVersion});var BarcodeScanner=function(_super){tslib.__extends(BarcodeScanner,_super);function BarcodeScanner(){var _this=_super!==null&&_super.apply(this,arguments)||this;_this.Encode={TEXT_TYPE:"TEXT_TYPE",EMAIL_TYPE:"EMAIL_TYPE",PHONE_TYPE:"PHONE_TYPE",SMS_TYPE:"SMS_TYPE"};return _this}BarcodeScanner.prototype.scan=function(options){return core.cordova(this,"scan",{callbackOrder:"reverse"},arguments)};BarcodeScanner.prototype.encode=function(type,data){return core.cordova(this,"encode",{},arguments)};BarcodeScanner.pluginName="BarcodeScanner";BarcodeScanner.plugin="phonegap-plugin-barcodescanner";BarcodeScanner.pluginRef="cordova.plugins.barcodeScanner";BarcodeScanner.repo="https://github.com/phonegap/phonegap-plugin-barcodescanner";BarcodeScanner.platforms=["Android","BlackBerry 10","Browser","iOS","Windows"];BarcodeScanner.decorators=[{type:core$1.Injectable}];return BarcodeScanner}(core.AwesomeCordovaNativePlugin);var BarcodeScanner$1=Object.freeze({__proto__:null,BarcodeScanner:BarcodeScanner});var Calendar=function(_super){tslib.__extends(Calendar,_super);function Calendar(){return _super!==null&&_super.apply(this,arguments)||this}Calendar.prototype.hasReadWritePermission=function(){return core.cordova(this,"hasReadWritePermission",{},arguments)};Calendar.prototype.hasReadPermission=function(){return core.cordova(this,"hasReadPermission",{},arguments)};Calendar.prototype.hasWritePermission=function(){return core.cordova(this,"hasWritePermission",{},arguments)};Calendar.prototype.requestWritePermission=function(){return core.cordova(this,"requestWritePermission",{},arguments)};Calendar.prototype.requestReadPermission=function(){return core.cordova(this,"requestReadPermission",{},arguments)};Calendar.prototype.requestReadWritePermission=function(){return core.cordova(this,"requestReadWritePermission",{},arguments)};Calendar.prototype.createCalendar=function(nameOrOptions){return core.cordova(this,"createCalendar",{},arguments)};Calendar.prototype.deleteCalendar=function(name){return core.cordova(this,"deleteCalendar",{},arguments)};Calendar.prototype.getCalendarOptions=function(){return core.cordova(this,"getCalendarOptions",{sync:true},arguments)};Calendar.prototype.getCreateCalendarOptions=function(){return core.cordova(this,"getCreateCalendarOptions",{sync:true},arguments)};Calendar.prototype.createEvent=function(title,location,notes,startDate,endDate){return core.cordova(this,"createEvent",{},arguments)};Calendar.prototype.createEventWithOptions=function(title,location,notes,startDate,endDate,options){return core.cordova(this,"createEventWithOptions",{},arguments)};Calendar.prototype.createEventInteractively=function(title,location,notes,startDate,endDate){return core.cordova(this,"createEventInteractively",{},arguments)};Calendar.prototype.createEventInteractivelyWithOptions=function(title,location,notes,startDate,endDate,options){return core.cordova(this,"createEventInteractivelyWithOptions",{},arguments)};Calendar.prototype.findEvent=function(title,location,notes,startDate,endDate){return core.cordova(this,"findEvent",{},arguments)};Calendar.prototype.findEventWithOptions=function(title,location,notes,startDate,endDate,options){return core.cordova(this,"findEventWithOptions",{},arguments)};Calendar.prototype.listEventsInRange=function(startDate,endDate){return core.cordova(this,"listEventsInRange",{platforms:["Android"]},arguments)};Calendar.prototype.listCalendars=function(){return core.cordova(this,"listCalendars",{},arguments)};Calendar.prototype.findAllEventsInNamedCalendar=function(calendarName){return core.cordova(this,"findAllEventsInNamedCalendar",{platforms:["iOS"]},arguments)};Calendar.prototype.modifyEvent=function(title,location,notes,startDate,endDate,newTitle,newLocation,newNotes,newStartDate,newEndDate){return core.cordova(this,"modifyEvent",{platforms:["iOS"]},arguments)};Calendar.prototype.modifyEventWithOptions=function(title,location,notes,startDate,endDate,newTitle,newLocation,newNotes,newStartDate,newEndDate,filterOptions,newOptions){return core.cordova(this,"modifyEventWithOptions",{platforms:["iOS"]},arguments)};Calendar.prototype.deleteEvent=function(title,location,notes,startDate,endDate){return core.cordova(this,"deleteEvent",{},arguments)};Calendar.prototype.deleteEventFromNamedCalendar=function(title,location,notes,startDate,endDate,calendarName){return core.cordova(this,"deleteEventFromNamedCalendar",{platforms:["iOS"]},arguments)};Calendar.prototype.deleteEventById=function(id,fromDate){return core.cordova(this,"deleteEventById",{},arguments)};Calendar.prototype.openCalendar=function(date){return core.cordova(this,"openCalendar",{},arguments)};Calendar.pluginName="Calendar";Calendar.plugin="cordova-plugin-calendar";Calendar.pluginRef="plugins.calendar";Calendar.repo="https://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin";Calendar.platforms=["Android","iOS"];Calendar.decorators=[{type:core$1.Injectable}];return Calendar}(core.AwesomeCordovaNativePlugin);var Calendar$1=Object.freeze({__proto__:null,Calendar:Calendar});var DestinationType;(function(DestinationType){DestinationType[DestinationType["DATA_URL"]=0]="DATA_URL";DestinationType[DestinationType["FILE_URL"]=1]="FILE_URL";DestinationType[DestinationType["NATIVE_URI"]=2]="NATIVE_URI"})(DestinationType||(DestinationType={}));var EncodingType;(function(EncodingType){EncodingType[EncodingType["JPEG"]=0]="JPEG";EncodingType[EncodingType["PNG"]=1]="PNG"})(EncodingType||(EncodingType={}));var MediaType;(function(MediaType){MediaType[MediaType["PICTURE"]=0]="PICTURE";MediaType[MediaType["VIDEO"]=1]="VIDEO";MediaType[MediaType["ALLMEDIA"]=2]="ALLMEDIA"})(MediaType||(MediaType={}));var PictureSourceType;(function(PictureSourceType){PictureSourceType[PictureSourceType["PHOTOLIBRARY"]=0]="PHOTOLIBRARY";PictureSourceType[PictureSourceType["CAMERA"]=1]="CAMERA";PictureSourceType[PictureSourceType["SAVEDPHOTOALBUM"]=2]="SAVEDPHOTOALBUM"})(PictureSourceType||(PictureSourceType={}));var PopoverArrowDirection;(function(PopoverArrowDirection){PopoverArrowDirection[PopoverArrowDirection["ARROW_UP"]=1]="ARROW_UP";PopoverArrowDirection[PopoverArrowDirection["ARROW_DOWN"]=2]="ARROW_DOWN";PopoverArrowDirection[PopoverArrowDirection["ARROW_LEFT"]=3]="ARROW_LEFT";PopoverArrowDirection[PopoverArrowDirection["ARROW_RIGHT"]=4]="ARROW_RIGHT";PopoverArrowDirection[PopoverArrowDirection["ARROW_ANY"]=5]="ARROW_ANY"})(PopoverArrowDirection||(PopoverArrowDirection={}));var Direction;(function(Direction){Direction[Direction["BACK"]=0]="BACK";Direction[Direction["FRONT"]=1]="FRONT"})(Direction||(Direction={}));var Camera=function(_super){tslib.__extends(Camera,_super);function Camera(){var _this=_super!==null&&_super.apply(this,arguments)||this;_this.DestinationType={DATA_URL:0,FILE_URI:1,NATIVE_URI:2};_this.EncodingType={JPEG:0,PNG:1};_this.MediaType={PICTURE:0,VIDEO:1,ALLMEDIA:2};_this.PictureSourceType={PHOTOLIBRARY:0,CAMERA:1,SAVEDPHOTOALBUM:2};_this.PopoverArrowDirection={ARROW_UP:1,ARROW_DOWN:2,ARROW_LEFT:4,ARROW_RIGHT:8,ARROW_ANY:15};_this.Direction={BACK:0,FRONT:1};return _this}Camera.prototype.getPicture=function(options){return core.cordova(this,"getPicture",{callbackOrder:"reverse"},arguments)};Camera.prototype.cleanup=function(){return core.cordova(this,"cleanup",{platforms:["iOS"]},arguments)};Camera.pluginName="Camera";Camera.plugin="cordova-plugin-camera";Camera.pluginRef="navigator.camera";Camera.repo="https://github.com/apache/cordova-plugin-camera";Camera.platforms=["Android","Browser","iOS","Windows"];Camera.decorators=[{type:core$1.Injectable}];return Camera}(core.AwesomeCordovaNativePlugin);var Camera$1=Object.freeze({__proto__:null,Camera:Camera,get DestinationType(){return DestinationType},get Direction(){return Direction},get EncodingType(){return EncodingType},get MediaType(){return MediaType},get PictureSourceType(){return PictureSourceType},get PopoverArrowDirection(){return PopoverArrowDirection}});var Device=function(_super){tslib.__extends(Device,_super);function Device(){return _super!==null&&_super.apply(this,arguments)||this}Object.defineProperty(Device.prototype,"cordova",{get:function(){return core.cordovaPropertyGet(this,"cordova")},set:function(value){core.cordovaPropertySet(this,"cordova",value)},enumerable:false,configurable:true});Object.defineProperty(Device.prototype,"model",{get:function(){return core.cordovaPropertyGet(this,"model")},set:function(value){core.cordovaPropertySet(this,"model",value)},enumerable:false,configurable:true});Object.defineProperty(Device.prototype,"platform",{get:function(){return core.cordovaPropertyGet(this,"platform")},set:function(value){core.cordovaPropertySet(this,"platform",value)},enumerable:false,configurable:true});Object.defineProperty(Device.prototype,"uuid",{get:function(){return core.cordovaPropertyGet(this,"uuid")},set:function(value){core.cordovaPropertySet(this,"uuid",value)},enumerable:false,configurable:true});Object.defineProperty(Device.prototype,"version",{get:function(){return core.cordovaPropertyGet(this,"version")},set:function(value){core.cordovaPropertySet(this,"version",value)},enumerable:false,configurable:true});Object.defineProperty(Device.prototype,"manufacturer",{get:function(){return core.cordovaPropertyGet(this,"manufacturer")},set:function(value){core.cordovaPropertySet(this,"manufacturer",value)},enumerable:false,configurable:true});Object.defineProperty(Device.prototype,"isVirtual",{get:function(){return core.cordovaPropertyGet(this,"isVirtual")},set:function(value){core.cordovaPropertySet(this,"isVirtual",value)},enumerable:false,configurable:true});Object.defineProperty(Device.prototype,"serial",{get:function(){return core.cordovaPropertyGet(this,"serial")},set:function(value){core.cordovaPropertySet(this,"serial",value)},enumerable:false,configurable:true});Device.pluginName="Device";Device.plugin="cordova-plugin-device";Device.pluginRef="device";Device.repo="https://github.com/apache/cordova-plugin-device";Device.platforms=["Android","Browser","iOS","macOS","Windows"];Device.decorators=[{type:core$1.Injectable}];return Device}(core.AwesomeCordovaNativePlugin);var Device$1=Object.freeze({__proto__:null,Device:Device});var File=function(_super){tslib.__extends(File,_super);function File(){var _this=_super!==null&&_super.apply(this,arguments)||this;_this.cordovaFileError={1:"NOT_FOUND_ERR",2:"SECURITY_ERR",3:"ABORT_ERR",4:"NOT_READABLE_ERR",5:"ENCODING_ERR",6:"NO_MODIFICATION_ALLOWED_ERR",7:"INVALID_STATE_ERR",8:"SYNTAX_ERR",9:"INVALID_MODIFICATION_ERR",10:"QUOTA_EXCEEDED_ERR",11:"TYPE_MISMATCH_ERR",12:"PATH_EXISTS_ERR",13:"WRONG_ENTRY_TYPE",14:"DIR_READ_ERR"};return _this}File.prototype.getFreeDiskSpace=function(){var _this=this;return function(){if(core.checkAvailability(_this)===true){return core.getPromise((function(resolve,reject){cordova.exec(resolve,reject,"File","getFreeDiskSpace",[])}))}}()};File.prototype.checkDir=function(path,dir){var _this=this;return function(){if(core.checkAvailability(_this)===true){if(/^\//.test(dir)){var err=new FileError(5);err.message="directory cannot start with /";return Promise.reject(err)}var fullPath=path+dir;return _this.resolveDirectoryUrl(fullPath).then((function(){return true}))}}()};File.prototype.createDir=function(path,dirName,replace){var _this=this;return function(){if(core.checkAvailability(_this)===true){if(/^\//.test(dirName)){var err=new FileError(5);err.message="directory cannot start with /";return Promise.reject(err)}var options={create:true};if(!replace){options.exclusive=true}return _this.resolveDirectoryUrl(path).then((function(fse){return _this.getDirectory(fse,dirName,options)}))}}()};File.prototype.removeDir=function(path,dirName){var _this=this;return function(){if(core.checkAvailability(_this)===true){if(/^\//.test(dirName)){var err=new FileError(5);err.message="directory cannot start with /";return Promise.reject(err)}return _this.resolveDirectoryUrl(path).then((function(fse){return _this.getDirectory(fse,dirName,{create:false})})).then((function(de){return _this.remove(de)}))}}()};File.prototype.moveDir=function(path,dirName,newPath,newDirName){var _this=this;return function(){if(core.checkAvailability(_this)===true){newDirName=newDirName||dirName;if(/^\//.test(newDirName)){var err=new FileError(5);err.message="directory cannot start with /";return Promise.reject(err)}return _this.resolveDirectoryUrl(path).then((function(fse){return _this.getDirectory(fse,dirName,{create:false})})).then((function(srcde){return _this.resolveDirectoryUrl(newPath).then((function(destenation){return _this.move(srcde,destenation,newDirName)}))}))}}()};File.prototype.copyDir=function(path,dirName,newPath,newDirName){var _this=this;return function(){if(core.checkAvailability(_this)===true){if(/^\//.test(newDirName)){var err=new FileError(5);err.message="directory cannot start with /";return Promise.reject(err)}return _this.resolveDirectoryUrl(path).then((function(fse){return _this.getDirectory(fse,dirName,{create:false})})).then((function(srcde){return _this.resolveDirectoryUrl(newPath).then((function(deste){return _this.copy(srcde,deste,newDirName)}))}))}}()};File.prototype.listDir=function(path,dirName){var _this=this;return function(){if(core.checkAvailability(_this)===true){if(/^\//.test(dirName)){var err=new FileError(5);err.message="directory cannot start with /";return Promise.reject(err)}return _this.resolveDirectoryUrl(path).then((function(fse){return _this.getDirectory(fse,dirName,{create:false,exclusive:false})})).then((function(de){var reader=de.createReader();return _this.readEntries(reader)}))}}()};File.prototype.removeRecursively=function(path,dirName){var _this=this;return function(){if(core.checkAvailability(_this)===true){if(/^\//.test(dirName)){var err=new FileError(5);err.message="directory cannot start with /";return Promise.reject(err)}return _this.resolveDirectoryUrl(path).then((function(fse){return _this.getDirectory(fse,dirName,{create:false})})).then((function(de){return _this.rimraf(de)}))}}()};File.prototype.checkFile=function(path,file){var _this=this;return function(){if(core.checkAvailability(_this)===true){if(/^\//.test(file)){var err=new FileError(5);err.message="file cannot start with /";return Promise.reject(err)}return _this.resolveLocalFilesystemUrl(path+file).then((function(fse){if(fse.isFile){return true}else{var err=new FileError(13);err.message="input is not a file";return Promise.reject(err)}}))}}()};File.prototype.createFile=function(path,fileName,replace){var _this=this;return function(){if(core.checkAvailability(_this)===true){if(/^\//.test(fileName)){var err=new FileError(5);err.message="file-name cannot start with /";return Promise.reject(err)}var options={create:true};if(!replace){options.exclusive=true}return _this.resolveDirectoryUrl(path).then((function(fse){return _this.getFile(fse,fileName,options)}))}}()};File.prototype.removeFile=function(path,fileName){var _this=this;return function(){if(core.checkAvailability(_this)===true){if(/^\//.test(fileName)){var err=new FileError(5);err.message="file-name cannot start with /";return Promise.reject(err)}return _this.resolveDirectoryUrl(path).then((function(fse){return _this.getFile(fse,fileName,{create:false})})).then((function(fe){return _this.remove(fe)}))}}()};File.prototype.writeFile=function(path,fileName,text,options){var _this=this;if(options===void 0){options={}}return function(){if(core.checkAvailability(_this)===true){if(/^\//.test(fileName)){var err=new FileError(5);err.message="file-name cannot start with /";return Promise.reject(err)}var getFileOpts={create:!options.append,exclusive:!options.replace};return _this.resolveDirectoryUrl(path).then((function(directoryEntry){return _this.getFile(directoryEntry,fileName,getFileOpts)})).then((function(fileEntry){return _this.writeFileEntry(fileEntry,text,options)}))}}()};File.prototype.writeFileEntry=function(fe,text,options){var _this=this;return this.createWriter(fe).then((function(writer){if(options.append){writer.seek(writer.length)}if(options.truncate){writer.truncate(options.truncate)}return _this.write(writer,text)})).then((function(){return fe}))};File.prototype.writeExistingFile=function(path,fileName,text){var _this=this;return function(){if(core.checkAvailability(_this)===true){return _this.writeFile(path,fileName,text,{replace:true})}}()};File.prototype.readAsText=function(path,file){var _this=this;return function(){if(core.checkAvailability(_this)===true){return _this.readFile(path,file,"Text")}}()};File.prototype.readAsDataURL=function(path,file){var _this=this;return function(){if(core.checkAvailability(_this)===true){return _this.readFile(path,file,"DataURL")}}()};File.prototype.readAsBinaryString=function(path,file){var _this=this;return function(){if(core.checkAvailability(_this)===true){return _this.readFile(path,file,"BinaryString")}}()};File.prototype.readAsArrayBuffer=function(path,file){var _this=this;return function(){if(core.checkAvailability(_this)===true){return _this.readFile(path,file,"ArrayBuffer")}}()};File.prototype.moveFile=function(path,fileName,newPath,newFileName){var _this=this;return function(){if(core.checkAvailability(_this)===true){newFileName=newFileName||fileName;if(/^\//.test(newFileName)){var err=new FileError(5);err.message="file name cannot start with /";return Promise.reject(err)}return _this.resolveDirectoryUrl(path).then((function(fse){return _this.getFile(fse,fileName,{create:false})})).then((function(srcfe){return _this.resolveDirectoryUrl(newPath).then((function(deste){return _this.move(srcfe,deste,newFileName)}))}))}}()};File.prototype.copyFile=function(path,fileName,newPath,newFileName){var _this=this;return function(){if(core.checkAvailability(_this)===true){newFileName=newFileName||fileName;if(/^\//.test(newFileName)){var err=new FileError(5);err.message="file name cannot start with /";return Promise.reject(err)}return _this.resolveDirectoryUrl(path).then((function(fse){return _this.getFile(fse,fileName,{create:false})})).then((function(srcfe){return _this.resolveDirectoryUrl(newPath).then((function(deste){return _this.copy(srcfe,deste,newFileName)}))}))}}()};File.prototype.fillErrorMessage=function(err){try{err.message=this.cordovaFileError[err.code]}catch(e){}};File.prototype.resolveLocalFilesystemUrl=function(fileUrl){var _this=this;return function(){if(core.checkAvailability(_this)===true){return core.getPromise((function(resolve,reject){try{window.resolveLocalFileSystemURL(fileUrl,(function(entry){resolve(entry)}),(function(err){_this.fillErrorMessage(err);reject(err)}))}catch(xc){_this.fillErrorMessage(xc);reject(xc)}}))}}()};File.prototype.resolveDirectoryUrl=function(directoryUrl){var _this=this;return function(){if(core.checkAvailability(_this)===true){return _this.resolveLocalFilesystemUrl(directoryUrl).then((function(de){if(de.isDirectory){return de}else{var err=new FileError(13);err.message="input is not a directory";return Promise.reject(err)}}))}}()};File.prototype.getDirectory=function(directoryEntry,directoryName,flags){var _this=this;return function(){if(core.checkAvailability(_this)===true){return new Promise((function(resolve,reject){try{directoryEntry.getDirectory(directoryName,flags,(function(de){resolve(de)}),(function(err){_this.fillErrorMessage(err);reject(err)}))}catch(xc){_this.fillErrorMessage(xc);reject(xc)}}))}}()};File.prototype.getFile=function(directoryEntry,fileName,flags){var _this=this;return function(){if(core.checkAvailability(_this)===true){return new Promise((function(resolve,reject){try{directoryEntry.getFile(fileName,flags,resolve,(function(err){_this.fillErrorMessage(err);reject(err)}))}catch(xc){_this.fillErrorMessage(xc);reject(xc)}}))}}()};File.prototype.readFile=function(path,file,readAs){var _this=this;if(/^\//.test(file)){var err=new FileError(5);err.message="file-name cannot start with /";return Promise.reject(err)}return this.resolveDirectoryUrl(path).then((function(directoryEntry){return _this.getFile(directoryEntry,file,{create:false})})).then((function(fileEntry){var reader=new FileReader;return core.getPromise((function(resolve,reject){reader.onloadend=function(){if(reader.result!==undefined||reader.result!==null){resolve(reader.result)}else if(reader.error!==undefined||reader.error!==null){reject(reader.error)}else{reject({code:null,message:"READER_ONLOADEND_ERR"})}};fileEntry.file((function(file){reader["readAs"+readAs].call(reader,file)}),(function(error){reject(error)}))}))}))};File.prototype.remove=function(fe){var _this=this;return new Promise((function(resolve,reject){fe.remove((function(){resolve({success:true,fileRemoved:fe})}),(function(err){_this.fillErrorMessage(err);reject(err)}))}))};File.prototype.move=function(srce,destdir,newName){var _this=this;return new Promise((function(resolve,reject){srce.moveTo(destdir,newName,(function(deste){resolve(deste)}),(function(err){_this.fillErrorMessage(err);reject(err)}))}))};File.prototype.copy=function(srce,destdir,newName){var _this=this;return new Promise((function(resolve,reject){srce.copyTo(destdir,newName,(function(deste){resolve(deste)}),(function(err){_this.fillErrorMessage(err);reject(err)}))}))};File.prototype.readEntries=function(dr){var _this=this;return new Promise((function(resolve,reject){dr.readEntries((function(entries){resolve(entries)}),(function(err){_this.fillErrorMessage(err);reject(err)}))}))};File.prototype.rimraf=function(de){var _this=this;return new Promise((function(resolve,reject){de.removeRecursively((function(){resolve({success:true,fileRemoved:de})}),(function(err){_this.fillErrorMessage(err);reject(err)}))}))};File.prototype.createWriter=function(fe){var _this=this;return new Promise((function(resolve,reject){fe.createWriter((function(writer){resolve(writer)}),(function(err){_this.fillErrorMessage(err);reject(err)}))}))};File.prototype.write=function(writer,gu){if(gu instanceof Blob){return this.writeFileInChunks(writer,gu)}return new Promise((function(resolve,reject){writer.onwriteend=function(evt){if(writer.error){reject(writer.error)}else{resolve(evt)}};writer.write(gu)}))};File.prototype.writeFileInChunks=function(writer,file){var BLOCK_SIZE=1024*1024;var writtenSize=0;function writeNextChunk(){var size=Math.min(BLOCK_SIZE,file.size-writtenSize);var chunk=file.slice(writtenSize,writtenSize+size);writtenSize+=size;writer.write(chunk)}return core.getPromise((function(resolve,reject){writer.onerror=reject;writer.onwrite=function(){if(writtenSize<file.size){writeNextChunk()}else{resolve()}};writeNextChunk()}))};Object.defineProperty(File.prototype,"applicationDirectory",{get:function(){return core.cordovaPropertyGet(this,"applicationDirectory")},set:function(value){core.cordovaPropertySet(this,"applicationDirectory",value)},enumerable:false,configurable:true});Object.defineProperty(File.prototype,"applicationStorageDirectory",{get:function(){return core.cordovaPropertyGet(this,"applicationStorageDirectory")},set:function(value){core.cordovaPropertySet(this,"applicationStorageDirectory",value)},enumerable:false,configurable:true});Object.defineProperty(File.prototype,"dataDirectory",{get:function(){return core.cordovaPropertyGet(this,"dataDirectory")},set:function(value){core.cordovaPropertySet(this,"dataDirectory",value)},enumerable:false,configurable:true});Object.defineProperty(File.prototype,"cacheDirectory",{get:function(){return core.cordovaPropertyGet(this,"cacheDirectory")},set:function(value){core.cordovaPropertySet(this,"cacheDirectory",value)},enumerable:false,configurable:true});Object.defineProperty(File.prototype,"externalApplicationStorageDirectory",{get:function(){return core.cordovaPropertyGet(this,"externalApplicationStorageDirectory")},set:function(value){core.cordovaPropertySet(this,"externalApplicationStorageDirectory",value)},enumerable:false,configurable:true});Object.defineProperty(File.prototype,"externalDataDirectory",{get:function(){return core.cordovaPropertyGet(this,"externalDataDirectory")},set:function(value){core.cordovaPropertySet(this,"externalDataDirectory",value)},enumerable:false,configurable:true});Object.defineProperty(File.prototype,"externalCacheDirectory",{get:function(){return core.cordovaPropertyGet(this,"externalCacheDirectory")},set:function(value){core.cordovaPropertySet(this,"externalCacheDirectory",value)},enumerable:false,configurable:true});Object.defineProperty(File.prototype,"externalRootDirectory",{get:function(){return core.cordovaPropertyGet(this,"externalRootDirectory")},set:function(value){core.cordovaPropertySet(this,"externalRootDirectory",value)},enumerable:false,configurable:true});Object.defineProperty(File.prototype,"tempDirectory",{get:function(){return core.cordovaPropertyGet(this,"tempDirectory")},set:function(value){core.cordovaPropertySet(this,"tempDirectory",value)},enumerable:false,configurable:true});Object.defineProperty(File.prototype,"syncedDataDirectory",{get:function(){return core.cordovaPropertyGet(this,"syncedDataDirectory")},set:function(value){core.cordovaPropertySet(this,"syncedDataDirectory",value)},enumerable:false,configurable:true});Object.defineProperty(File.prototype,"documentsDirectory",{get:function(){return core.cordovaPropertyGet(this,"documentsDirectory")},set:function(value){core.cordovaPropertySet(this,"documentsDirectory",value)},enumerable:false,configurable:true});Object.defineProperty(File.prototype,"sharedDirectory",{get:function(){return core.cordovaPropertyGet(this,"sharedDirectory")},set:function(value){core.cordovaPropertySet(this,"sharedDirectory",value)},enumerable:false,configurable:true});File.pluginName="File";File.plugin="cordova-plugin-file";File.pluginRef="cordova.file";File.repo="https://github.com/apache/cordova-plugin-file";File.platforms=["Android","Browser","iOS","macOS","Windows"];File.decorators=[{type:core$1.Injectable}];return File}(core.AwesomeCordovaNativePlugin);var File$1=Object.freeze({__proto__:null,File:File});var FileOpener=function(_super){tslib.__extends(FileOpener,_super);function FileOpener(){return _super!==null&&_super.apply(this,arguments)||this}FileOpener.prototype.open=function(filePath,fileMIMEType){return core.cordova(this,"open",{callbackStyle:"object",successName:"success",errorName:"error"},arguments)};FileOpener.prototype.uninstall=function(packageId){return core.cordova(this,"uninstall",{callbackStyle:"object",successName:"success",errorName:"error"},arguments)};FileOpener.prototype.appIsInstalled=function(packageId){return core.cordova(this,"appIsInstalled",{callbackStyle:"object",successName:"success",errorName:"error"},arguments)};FileOpener.prototype.showOpenWithDialog=function(filePath,fileMIMEType){return core.cordova(this,"showOpenWithDialog",{callbackStyle:"object",successName:"success",errorName:"error"},arguments)};FileOpener.pluginName="FileOpener";FileOpener.plugin="cordova-plugin-file-opener2";FileOpener.pluginRef="cordova.plugins.fileOpener2";FileOpener.repo="https://github.com/pwlin/cordova-plugin-file-opener2";FileOpener.platforms=["Android","iOS","Windows","Windows Phone 8"];FileOpener.decorators=[{type:core$1.Injectable}];return FileOpener}(core.AwesomeCordovaNativePlugin);var FileOpener$1=Object.freeze({__proto__:null,FileOpener:FileOpener});var Geolocation=function(_super){tslib.__extends(Geolocation,_super);function Geolocation(){return _super!==null&&_super.apply(this,arguments)||this}Geolocation.prototype.getCurrentPosition=function(options){return core.cordova(this,"getCurrentPosition",{callbackOrder:"reverse"},arguments)};Geolocation.prototype.watchPosition=function(options){return new rxjs.Observable((function(observer){var watchId=navigator.geolocation.watchPosition(observer.next.bind(observer),observer.next.bind(observer),options);return function(){return navigator.geolocation.clearWatch(watchId)}}))};Geolocation.pluginName="Geolocation";Geolocation.plugin="cordova-plugin-geolocation";Geolocation.pluginRef="navigator.geolocation";Geolocation.repo="https://github.com/apache/cordova-plugin-geolocation";Geolocation.install='ionic cordova plugin add cordova-plugin-geolocation --variable GEOLOCATION_USAGE_DESCRIPTION="To locate you"';Geolocation.installVariables=["GEOLOCATION_USAGE_DESCRIPTION"];Geolocation.platforms=["Amazon Fire OS","Android","Browser","iOS","Windows"];Geolocation.decorators=[{type:core$1.Injectable}];return Geolocation}(core.AwesomeCordovaNativePlugin);var GeoLocation=Object.freeze({__proto__:null,Geolocation:Geolocation});var MediaCapture=function(_super){tslib.__extends(MediaCapture,_super);function MediaCapture(){return _super!==null&&_super.apply(this,arguments)||this}MediaCapture.prototype.captureAudio=function(options){return core.cordova(this,"captureAudio",{callbackOrder:"reverse"},arguments)};MediaCapture.prototype.captureImage=function(options){return core.cordova(this,"captureImage",{callbackOrder:"reverse"},arguments)};MediaCapture.prototype.captureVideo=function(options){return core.cordova(this,"captureVideo",{callbackOrder:"reverse"},arguments)};MediaCapture.prototype.onPendingCaptureResult=function(){return core.cordova(this,"onPendingCaptureResult",{eventObservable:true,event:"pendingcaptureresult"},arguments)};MediaCapture.prototype.onPendingCaptureError=function(){return core.cordova(this,"onPendingCaptureError",{eventObservable:true,event:"pendingcaptureerror"},arguments)};Object.defineProperty(MediaCapture.prototype,"supportedImageModes",{get:function(){return core.cordovaPropertyGet(this,"supportedImageModes")},set:function(value){core.cordovaPropertySet(this,"supportedImageModes",value)},enumerable:false,configurable:true});Object.defineProperty(MediaCapture.prototype,"supportedAudioModes",{get:function(){return core.cordovaPropertyGet(this,"supportedAudioModes")},set:function(value){core.cordovaPropertySet(this,"supportedAudioModes",value)},enumerable:false,configurable:true});Object.defineProperty(MediaCapture.prototype,"supportedVideoModes",{get:function(){return core.cordovaPropertyGet(this,"supportedVideoModes")},set:function(value){core.cordovaPropertySet(this,"supportedVideoModes",value)},enumerable:false,configurable:true});MediaCapture.pluginName="MediaCapture";MediaCapture.plugin="cordova-plugin-media-capture";MediaCapture.pluginRef="navigator.device.capture";MediaCapture.repo="https://github.com/apache/cordova-plugin-media-capture";MediaCapture.platforms=["Android","Browser","iOS","Windows"];MediaCapture.decorators=[{type:core$1.Injectable}];return MediaCapture}(core.AwesomeCordovaNativePlugin);var MediaCapture$1=Object.freeze({__proto__:null,MediaCapture:MediaCapture});var Connection;(function(Connection){Connection["UNKNOWN"]="unknown";Connection["ETHERNET"]="ethernet";Connection["WIFI"]="wifi";Connection["CELL_2G"]="2g";Connection["CELL_3G"]="3g";Connection["CELL_4G"]="4g";Connection["CELL"]="cellular";Connection["NONE"]="none"})(Connection||(Connection={}));var Network=function(_super){tslib.__extends(Network,_super);function Network(){var _this=_super!==null&&_super.apply(this,arguments)||this;_this.Connection={UNKNOWN:"unknown",ETHERNET:"ethernet",WIFI:"wifi",CELL_2G:"2g",CELL_3G:"3g",CELL_4G:"4g",CELL:"cellular",NONE:"none"};return _this}Network.prototype.onChange=function(){var _this=this;return function(){if(core.checkAvailability(_this)===true){return rxjs.merge(_this.onConnect().pipe(operators.mapTo("connected")),_this.onDisconnect().pipe(operators.mapTo("disconnected")))}}()};Network.prototype.onDisconnect=function(){return core.cordova(this,"onDisconnect",{eventObservable:true,event:"offline",element:"document"},arguments)};Network.prototype.onConnect=function(){return core.cordova(this,"onConnect",{eventObservable:true,event:"online",element:"document"},arguments)};Object.defineProperty(Network.prototype,"type",{get:function(){return core.cordovaPropertyGet(this,"type")},set:function(value){core.cordovaPropertySet(this,"type",value)},enumerable:false,configurable:true});Object.defineProperty(Network.prototype,"downlinkMax",{get:function(){return core.cordovaPropertyGet(this,"downlinkMax")},set:function(value){core.cordovaPropertySet(this,"downlinkMax",value)},enumerable:false,configurable:true});Network.pluginName="Network";Network.plugin="cordova-plugin-network-information";Network.pluginRef="navigator.connection";Network.repo="https://github.com/apache/cordova-plugin-network-information";Network.platforms=["Amazon Fire OS","Android","Browser","iOS","Windows"];Network.decorators=[{type:core$1.Injectable}];return Network}(core.AwesomeCordovaNativePlugin);var Network$1=Object.freeze({__proto__:null,get Connection(){return Connection},Network:Network});var SQLiteObject=function(){function SQLiteObject(_objectInstance){this._objectInstance=_objectInstance}SQLiteObject.prototype.addTransaction=function(transaction){return core.cordovaInstance(this,"addTransaction",{sync:true},arguments)};SQLiteObject.prototype.transaction=function(fn){return core.cordovaInstance(this,"transaction",{successIndex:2,errorIndex:1},arguments)};SQLiteObject.prototype.readTransaction=function(fn){return core.cordovaInstance(this,"readTransaction",{},arguments)};SQLiteObject.prototype.startNextTransaction=function(){return core.cordovaInstance(this,"startNextTransaction",{sync:true},arguments)};SQLiteObject.prototype.open=function(){return core.cordovaInstance(this,"open",{},arguments)};SQLiteObject.prototype.close=function(){return core.cordovaInstance(this,"close",{},arguments)};SQLiteObject.prototype.executeSql=function(statement,params){return core.cordovaInstance(this,"executeSql",{},arguments)};SQLiteObject.prototype.sqlBatch=function(sqlStatements){return core.cordovaInstance(this,"sqlBatch",{},arguments)};SQLiteObject.prototype.abortallPendingTransactions=function(){return core.cordovaInstance(this,"abortallPendingTransactions",{sync:true},arguments)};Object.defineProperty(SQLiteObject.prototype,"databaseFeatures",{get:function(){return core.instancePropertyGet(this,"databaseFeatures")},set:function(value){core.instancePropertySet(this,"databaseFeatures",value)},enumerable:false,configurable:true});Object.defineProperty(SQLiteObject.prototype,"openDBs",{get:function(){return core.instancePropertyGet(this,"openDBs")},set:function(value){core.instancePropertySet(this,"openDBs",value)},enumerable:false,configurable:true});return SQLiteObject}();var SQLite=function(_super){tslib.__extends(SQLite,_super);function SQLite(){return _super!==null&&_super.apply(this,arguments)||this}SQLite.prototype.create=function(config){var _this=this;return function(){if(core.checkAvailability(_this)===true){return new Promise((function(resolve,reject){sqlitePlugin.openDatabase(config,(function(db){return resolve(new SQLiteObject(db))}),reject)}))}}()};SQLite.prototype.echoTest=function(){return core.cordova(this,"echoTest",{},arguments)};SQLite.prototype.selfTest=function(){return core.cordova(this,"selfTest",{},arguments)};SQLite.prototype.deleteDatabase=function(config){return core.cordova(this,"deleteDatabase",{},arguments)};SQLite.pluginName="SQLite";SQLite.pluginRef="sqlitePlugin";SQLite.plugin="cordova-sqlite-storage";SQLite.repo="https://github.com/litehelpers/Cordova-sqlite-storage";SQLite.platforms=["Android","iOS","macOS","Windows"];SQLite.decorators=[{type:core$1.Injectable}];return SQLite}(core.AwesomeCordovaNativePlugin);var Sqlite=Object.freeze({__proto__:null,SQLite:SQLite,SQLiteObject:SQLiteObject});var Vibration=function(_super){tslib.__extends(Vibration,_super);function Vibration(){return _super!==null&&_super.apply(this,arguments)||this}Vibration.prototype.vibrate=function(time){return core.cordova(this,"vibrate",{sync:true},arguments)};Vibration.pluginName="Vibration";Vibration.plugin="cordova-plugin-vibration";Vibration.pluginRef="navigator";Vibration.repo="https://github.com/apache/cordova-plugin-vibration";Vibration.platforms=["Android","iOS","Windows"];Vibration.decorators=[{type:core$1.Injectable}];return Vibration}(core.AwesomeCordovaNativePlugin);var Vibration$1=Object.freeze({__proto__:null,Vibration:Vibration});var LocationAccuracy=function(_super){tslib.__extends(LocationAccuracy,_super);function LocationAccuracy(){var _this=_super!==null&&_super.apply(this,arguments)||this;_this.REQUEST_PRIORITY_NO_POWER=0;_this.REQUEST_PRIORITY_LOW_POWER=1;_this.REQUEST_PRIORITY_BALANCED_POWER_ACCURACY=2;_this.REQUEST_PRIORITY_HIGH_ACCURACY=3;_this.SUCCESS_SETTINGS_SATISFIED=0;_this.SUCCESS_USER_AGREED=1;_this.ERROR_ALREADY_REQUESTING=-1;_this.ERROR_INVALID_ACTION=0;_this.ERROR_INVALID_ACCURACY=1;_this.ERROR_EXCEPTION=1;_this.ERROR_CANNOT_CHANGE_ACCURACY=3;_this.ERROR_USER_DISAGREED=4;_this.ERROR_GOOGLE_API_CONNECTION_FAILED=4;return _this}LocationAccuracy.prototype.canRequest=function(){return core.cordova(this,"canRequest",{},arguments)};LocationAccuracy.prototype.isRequesting=function(){return core.cordova(this,"isRequesting",{},arguments)};LocationAccuracy.prototype.request=function(accuracy){return core.cordova(this,"request",{callbackOrder:"reverse"},arguments)};LocationAccuracy.pluginName="LocationAccuracy";LocationAccuracy.plugin="cordova-plugin-request-location-accuracy";LocationAccuracy.pluginRef="cordova.plugins.locationAccuracy";LocationAccuracy.repo="https://github.com/dpa99c/cordova-plugin-request-location-accuracy";LocationAccuracy.platforms=["Android","iOS"];LocationAccuracy.decorators=[{type:core$1.Injectable}];return LocationAccuracy}(core.AwesomeCordovaNativePlugin);var LocationAccuracy$1=Object.freeze({__proto__:null,LocationAccuracy:LocationAccuracy});var Diagnostic=function(_super){tslib.__extends(Diagnostic,_super);function Diagnostic(){var _this=_super!==null&&_super.apply(this,arguments)||this;_this.permission={READ_CALENDAR:"READ_CALENDAR",WRITE_CALENDAR:"WRITE_CALENDAR",CAMERA:"CAMERA",READ_CONTACTS:"READ_CONTACTS",WRITE_CONTACTS:"WRITE_CONTACTS",GET_ACCOUNTS:"GET_ACCOUNTS",ACCESS_FINE_LOCATION:"ACCESS_FINE_LOCATION",ACCESS_COARSE_LOCATION:"ACCESS_COARSE_LOCATION",RECORD_AUDIO:"RECORD_AUDIO",READ_PHONE_STATE:"READ_PHONE_STATE",CALL_PHONE:"CALL_PHONE",ADD_VOICEMAIL:"ADD_VOICEMAIL",USE_SIP:"USE_SIP",PROCESS_OUTGOING_CALLS:"PROCESS_OUTGOING_CALLS",READ_CALL_LOG:"READ_CALL_LOG",WRITE_CALL_LOG:"WRITE_CALL_LOG",SEND_SMS:"SEND_SMS",RECEIVE_SMS:"RECEIVE_SMS",READ_SMS:"READ_SMS",RECEIVE_WAP_PUSH:"RECEIVE_WAP_PUSH",RECEIVE_MMS:"RECEIVE_MMS",WRITE_EXTERNAL_STORAGE:"WRITE_EXTERNAL_STORAGE",READ_EXTERNAL_STORAGE:"READ_EXTERNAL_STORAGE",BODY_SENSORS:"BODY_SENSORS"};_this.locationAuthorizationMode={ALWAYS:"always",WHEN_IN_USE:"when_in_use"};_this.permissionGroups={CALENDAR:["READ_CALENDAR","WRITE_CALENDAR"],CAMERA:["CAMERA"],CONTACTS:["READ_CONTACTS","WRITE_CONTACTS","GET_ACCOUNTS"],LOCATION:["ACCESS_FINE_LOCATION","ACCESS_COARSE_LOCATION"],MICROPHONE:["RECORD_AUDIO"],PHONE:["READ_PHONE_STATE","CALL_PHONE","ADD_VOICEMAIL","USE_SIP","PROCESS_OUTGOING_CALLS","READ_CALL_LOG","WRITE_CALL_LOG"],SENSORS:["BODY_SENSORS"],SMS:["SEND_SMS","RECEIVE_SMS","READ_SMS","RECEIVE_WAP_PUSH","RECEIVE_MMS"],STORAGE:["READ_EXTERNAL_STORAGE","WRITE_EXTERNAL_STORAGE"]};_this.locationMode={HIGH_ACCURACY:"high_accuracy",DEVICE_ONLY:"device_only",BATTERY_SAVING:"battery_saving",LOCATION_OFF:"location_off"};_this.bluetoothState={UNKNOWN:"unknown",RESETTING:"resetting",UNSUPPORTED:"unsupported",UNAUTHORIZED:"unauthorized",POWERED_OFF:"powered_off",POWERED_ON:"powered_on",POWERING_OFF:"powering_off",POWERING_ON:"powering_on"};return _this}Diagnostic.prototype.isLocationAvailable=function(){return core.cordova(this,"isLocationAvailable",{},arguments)};Diagnostic.prototype.isWifiAvailable=function(){return core.cordova(this,"isWifiAvailable",{},arguments)};Diagnostic.prototype.isCameraAvailable=function(externalStorage){return core.cordova(this,"isCameraAvailable",{callbackOrder:"reverse"},arguments)};Diagnostic.prototype.isBluetoothAvailable=function(){return core.cordova(this,"isBluetoothAvailable",{},arguments)};Diagnostic.prototype.switchToLocationSettings=function(){return core.cordova(this,"switchToLocationSettings",{sync:true,platforms:["Android","Windows 10","iOS"]},arguments)};Diagnostic.prototype.switchToMobileDataSettings=function(){return core.cordova(this,"switchToMobileDataSettings",{sync:true,platforms:["Android","Windows 10"]},arguments)};Diagnostic.prototype.switchToBluetoothSettings=function(){return core.cordova(this,"switchToBluetoothSettings",{sync:true,platforms:["Android","Windows 10"]},arguments)};Diagnostic.prototype.switchToWifiSettings=function(){return core.cordova(this,"switchToWifiSettings",{sync:true,platforms:["Android","Windows 10"]},arguments)};Diagnostic.prototype.isWifiEnabled=function(){return core.cordova(this,"isWifiEnabled",{platforms:["Android","Windows 10"]},arguments)};Diagnostic.prototype.setWifiState=function(state){return core.cordova(this,"setWifiState",{callbackOrder:"reverse",platforms:["Android","Windows 10"]},arguments)};Diagnostic.prototype.setBluetoothState=function(state){return core.cordova(this,"setBluetoothState",{callbackOrder:"reverse",platforms:["Android","Windows 10"]},arguments)};Diagnostic.prototype.isLocationEnabled=function(){return core.cordova(this,"isLocationEnabled",{platforms:["Android","iOS"]},arguments)};Diagnostic.prototype.isLocationAuthorized=function(){return core.cordova(this,"isLocationAuthorized",{},arguments)};Diagnostic.prototype.getLocationAuthorizationStatus=function(){return core.cordova(this,"getLocationAuthorizationStatus",{platforms:["Android","iOS"]},arguments)};Diagnostic.prototype.requestLocationAuthorization=function(mode){return core.cordova(this,"requestLocationAuthorization",{platforms:["Android","iOS"],callbackOrder:"reverse"},arguments)};Diagnostic.prototype.isCameraPresent=function(){return core.cordova(this,"isCameraPresent",{platforms:["Android","iOS"]},arguments)};Diagnostic.prototype.isCameraAuthorized=function(externalStorage){return core.cordova(this,"isCameraAuthorized",{platforms:["Android","iOS"],callbackOrder:"reverse"},arguments)};Diagnostic.prototype.getCameraAuthorizationStatus=function(externalStorage){return core.cordova(this,"getCameraAuthorizationStatus",{platforms:["Android","iOS"],callbackOrder:"reverse"},arguments)};Diagnostic.prototype.requestCameraAuthorization=function(externalStorage){return core.cordova(this,"requestCameraAuthorization",{platforms:["Android","iOS"],callbackOrder:"reverse"},arguments)};Diagnostic.prototype.isMicrophoneAuthorized=function(){return core.cordova(this,"isMicrophoneAuthorized",{platforms:["Android","iOS"]},arguments)};Diagnostic.prototype.getMicrophoneAuthorizationStatus=function(){return core.cordova(this,"getMicrophoneAuthorizationStatus",{platforms:["Android","iOS"]},arguments)};Diagnostic.prototype.requestMicrophoneAuthorization=function(){return core.cordova(this,"requestMicrophoneAuthorization",{platforms:["Android","iOS"]},arguments)};Diagnostic.prototype.isContactsAuthorized=function(){return core.cordova(this,"isContactsAuthorized",{platforms:["Android","iOS"]},arguments)};Diagnostic.prototype.getContactsAuthorizationStatus=function(){return core.cordova(this,"getContactsAuthorizationStatus",{platforms:["Android","iOS"]},arguments)};Diagnostic.prototype.requestContactsAuthorization=function(){return core.cordova(this,"requestContactsAuthorization",{platforms:["Android","iOS"]},arguments)};Diagnostic.prototype.isCalendarAuthorized=function(){return core.cordova(this,"isCalendarAuthorized",{platforms:["Android","iOS"]},arguments)};Diagnostic.prototype.getCalendarAuthorizationStatus=function(){return core.cordova(this,"getCalendarAuthorizationStatus",{platforms:["Android","iOS"]},arguments)};Diagnostic.prototype.requestCalendarAuthorization=function(){return core.cordova(this,"requestCalendarAuthorization",{platforms:["Android","iOS"]},arguments)};Diagnostic.prototype.switchToSettings=function(){return core.cordova(this,"switchToSettings",{platforms:["Android","iOS"]},arguments)};Diagnostic.prototype.getBluetoothState=function(){return core.cordova(this,"getBluetoothState",{platforms:["Android","iOS"]},arguments)};Diagnostic.prototype.registerBluetoothStateChangeHandler=function(handler){return core.cordova(this,"registerBluetoothStateChangeHandler",{platforms:["Android","iOS"],sync:true},arguments)};Diagnostic.prototype.registerLocationStateChangeHandler=function(handler){return core.cordova(this,"registerLocationStateChangeHandler",{platforms:["Android","iOS"],sync:true},arguments)};Diagnostic.prototype.isGpsLocationAvailable=function(){return core.cordova(this,"isGpsLocationAvailable",{platforms:["Android"]},arguments)};Diagnostic.prototype.isGpsLocationEnabled=function(){return core.cordova(this,"isGpsLocationEnabled",{platforms:["Android"]},arguments)};Diagnostic.prototype.isNetworkLocationAvailable=function(){return core.cordova(this,"isNetworkLocationAvailable",{platforms:["Android"]},arguments)};Diagnostic.prototype.isNetworkLocationEnabled=function(){return core.cordova(this,"isNetworkLocationEnabled",{platforms:["Android"]},arguments)};Diagnostic.prototype.getLocationMode=function(){return core.cordova(this,"getLocationMode",{platforms:["Android"]},arguments)};Diagnostic.prototype.getPermissionAuthorizationStatus=function(permission){return core.cordova(this,"getPermissionAuthorizationStatus",{platforms:["Android"],callbackOrder:"reverse"},arguments)};Diagnostic.prototype.getPermissionsAuthorizationStatus=function(permissions){return core.cordova(this,"getPermissionsAuthorizationStatus",{platforms:["Android"],callbackOrder:"reverse"},arguments)};Diagnostic.prototype.requestRuntimePermission=function(permission){return core.cordova(this,"requestRuntimePermission",{platforms:["Android"],callbackOrder:"reverse"},arguments)};Diagnostic.prototype.requestRuntimePermissions=function(permissions){return core.cordova(this,"requestRuntimePermissions",{platforms:["Android"],callbackOrder:"reverse"},arguments)};Diagnostic.prototype.isRequestingPermission=function(){return core.cordova(this,"isRequestingPermission",{sync:true},arguments)};Diagnostic.prototype.registerPermissionRequestCompleteHandler=function(handler){return core.cordova(this,"registerPermissionRequestCompleteHandler",{sync:true},arguments)};Diagnostic.prototype.isBluetoothEnabled=function(){return core.cordova(this,"isBluetoothEnabled",{platforms:["Android"]},arguments)};Diagnostic.prototype.hasBluetoothSupport=function(){return core.cordova(this,"hasBluetoothSupport",{platforms:["Android"]},arguments)};Diagnostic.prototype.hasBluetoothLESupport=function(){return core.cordova(this,"hasBluetoothLESupport",{platforms:["Android"]},arguments)};Diagnostic.prototype.hasBluetoothLEPeripheralSupport=function(){return core.cordova(this,"hasBluetoothLEPeripheralSupport",{platforms:["Android"]},arguments)};Diagnostic.prototype.isExternalStorageAuthorized=function(){return core.cordova(this,"isExternalStorageAuthorized",{platforms:["Android"]},arguments)};Diagnostic.prototype.getExternalStorageAuthorizationStatus=function(){return core.cordova(this,"getExternalStorageAuthorizationStatus",{platforms:["Android"]},arguments)};Diagnostic.prototype.requestExternalStorageAuthorization=function(){return core.cordova(this,"requestExternalStorageAuthorization",{platforms:["Android"]},arguments)};Diagnostic.prototype.getExternalSdCardDetails=function(){return core.cordova(this,"getExternalSdCardDetails",{platforms:["Android"]},arguments)};Diagnostic.prototype.switchToWirelessSettings=function(){return core.cordova(this,"switchToWirelessSettings",{platforms:["Android"],sync:true},arguments)};Diagnostic.prototype.switchToNFCSettings=function(){return core.cordova(this,"switchToNFCSettings",{platforms:["Android"],sync:true},arguments)};Diagnostic.prototype.isNFCPresent=function(){return core.cordova(this,"isNFCPresent",{platforms:["Android"]},arguments)};Diagnostic.prototype.isNFCEnabled=function(){return core.cordova(this,"isNFCEnabled",{platforms:["Android"]},arguments)};Diagnostic.prototype.isNFCAvailable=function(){return core.cordova(this,"isNFCAvailable",{platforms:["Android"]},arguments)};Diagnostic.prototype.registerNFCStateChangeHandler=function(handler){return core.cordova(this,"registerNFCStateChangeHandler",{platforms:["Android"],sync:true},arguments)};Diagnostic.prototype.isDataRoamingEnabled=function(){return core.cordova(this,"isDataRoamingEnabled",{platforms:["Android"]},arguments)};Diagnostic.prototype.isADBModeEnabled=function(){return core.cordova(this,"isADBModeEnabled",{platforms:["Android"]},arguments)};Diagnostic.prototype.isDeviceRooted=function(){return core.cordova(this,"isDeviceRooted",{platforms:["Android"]},arguments)};Diagnostic.prototype.isCameraRollAuthorized=function(){return core.cordova(this,"isCameraRollAuthorized",{platforms:["iOS"]},arguments)};Diagnostic.prototype.getCameraRollAuthorizationStatus=function(){return core.cordova(this,"getCameraRollAuthorizationStatus",{platforms:["iOS"]},arguments)};Diagnostic.prototype.requestCameraRollAuthorization=function(){return core.cordova(this,"requestCameraRollAuthorization",{platforms:["iOS"]},arguments)};Diagnostic.prototype.isRemoteNotificationsEnabled=function(){return core.cordova(this,"isRemoteNotificationsEnabled",{platforms:["iOS","Android"]},arguments)};Diagnostic.prototype.isRegisteredForRemoteNotifications=function(){return core.cordova(this,"isRegisteredForRemoteNotifications",{platforms:["iOS"]},arguments)};Diagnostic.prototype.getRemoteNotificationsAuthorizationStatus=function(){return core.cordova(this,"getRemoteNotificationsAuthorizationStatus",{platforms:["iOS"]},arguments)};Diagnostic.prototype.requestRemoteNotificationsAuthorization=function(types,omitRegistration){return core.cordova(this,"requestRemoteNotificationsAuthorization",{platforms:["iOS"]},arguments)};Diagnostic.prototype.getRemoteNotificationTypes=function(){return core.cordova(this,"getRemoteNotificationTypes",{platforms:["iOS"]},arguments)};Diagnostic.prototype.isRemindersAuthorized=function(){return core.cordova(this,"isRemindersAuthorized",{platforms:["iOS"]},arguments)};Diagnostic.prototype.getRemindersAuthorizationStatus=function(){return core.cordova(this,"getRemindersAuthorizationStatus",{platforms:["iOS"]},arguments)};Diagnostic.prototype.requestRemindersAuthorization=function(){return core.cordova(this,"requestRemindersAuthorization",{platforms:["iOS"]},arguments)};Diagnostic.prototype.isBackgroundRefreshAuthorized=function(){return core.cordova(this,"isBackgroundRefreshAuthorized",{platforms:["iOS"]},arguments)};Diagnostic.prototype.getBackgroundRefreshStatus=function(){return core.cordova(this,"getBackgroundRefreshStatus",{platforms:["iOS"]},arguments)};Diagnostic.prototype.requestBluetoothAuthorization=function(){return core.cordova(this,"requestBluetoothAuthorization",{platforms:["iOS"]},arguments)};Diagnostic.prototype.isMotionAvailable=function(){return core.cordova(this,"isMotionAvailable",{platforms:["iOS"]},arguments)};Diagnostic.prototype.isMotionRequestOutcomeAvailable=function(){return core.cordova(this,"isMotionRequestOutcomeAvailable",{platforms:["iOS"]},arguments)};Diagnostic.prototype.requestMotionAuthorization=function(){return core.cordova(this,"requestMotionAuthorization",{platforms:["iOS"]},arguments)};Diagnostic.prototype.getMotionAuthorizationStatus=function(){return core.cordova(this,"getMotionAuthorizationStatus",{platforms:["iOS"]},arguments)};Diagnostic.prototype.getLocationAccuracyAuthorization=function(){return core.cordova(this,"getLocationAccuracyAuthorization",{platform:["iOS"]},arguments)};Diagnostic.prototype.requestTemporaryFullAccuracyAuthorization=function(purpose){return core.cordova(this,"requestTemporaryFullAccuracyAuthorization",{platforms:["iOS"]},arguments)};Diagnostic.prototype.registerLocationAccuracyAuthorizationChangeHandler=function(handler){return core.cordova(this,"registerLocationAccuracyAuthorizationChangeHandler",{platforms:["iOS"],sync:true},arguments)};Object.defineProperty(Diagnostic.prototype,"permissionStatus",{get:function(){return core.cordovaPropertyGet(this,"permissionStatus")},set:function(value){core.cordovaPropertySet(this,"permissionStatus",value)},enumerable:false,configurable:true});Object.defineProperty(Diagnostic.prototype,"NFCState",{get:function(){return core.cordovaPropertyGet(this,"NFCState")},set:function(value){core.cordovaPropertySet(this,"NFCState",value)},enumerable:false,configurable:true});Object.defineProperty(Diagnostic.prototype,"motionStatus",{get:function(){return core.cordovaPropertyGet(this,"motionStatus")},set:function(value){core.cordovaPropertySet(this,"motionStatus",value)},enumerable:false,configurable:true});Diagnostic.pluginName="Diagnostic";Diagnostic.plugin="cordova.plugins.diagnostic";Diagnostic.pluginRef="cordova.plugins.diagnostic";Diagnostic.repo="https://github.com/dpa99c/cordova-diagnostic-plugin";Diagnostic.platforms=["Android","iOS","Windows"];Diagnostic.decorators=[{type:core$1.Injectable}];return Diagnostic}(core.AwesomeCordovaNativePlugin);var Diagnostic$1=Object.freeze({__proto__:null,Diagnostic:Diagnostic});var awesomeCordovaPlugins={...AppVersion$1,...BarcodeScanner$1,...Calendar$1,...Camera$1,...Device$1,...File$1,...FileOpener$1,...GeoLocation,...MediaCapture$1,...Network$1,...Sqlite,...Vibration$1,...LocationAccuracy$1,...Diagnostic$1};return awesomeCordovaPlugins}));/*! iScroll v5.2.0 ~ (c) 2008-2016 Matteo Spinelli ~ http://cubiq.org/license */
|
|
974
974
|
(function(window,document,Math){var rAF=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(callback){window.setTimeout(callback,1e3/60)};var utils=function(){var me={};var _elementStyle=document.createElement("div").style;var _vendor=function(){var vendors=["t","webkitT","MozT","msT","OT"],transform,i=0,l=vendors.length;for(;i<l;i++){transform=vendors[i]+"ransform";if(transform in _elementStyle)return vendors[i].substr(0,vendors[i].length-1)}return false}();function _prefixStyle(style){if(_vendor===false)return false;if(_vendor==="")return style;return _vendor+style.charAt(0).toUpperCase()+style.substr(1)}me.getTime=Date.now||function getTime(){return(new Date).getTime()};me.extend=function(target,obj){for(var i in obj){target[i]=obj[i]}};me.addEvent=function(el,type,fn,capture){el.addEventListener(type,fn,!!capture)};me.removeEvent=function(el,type,fn,capture){el.removeEventListener(type,fn,!!capture)};me.prefixPointerEvent=function(pointerEvent){return window.MSPointerEvent?"MSPointer"+pointerEvent.charAt(7).toUpperCase()+pointerEvent.substr(8):pointerEvent};me.momentum=function(current,start,time,lowerMargin,wrapperSize,deceleration){var distance=current-start,speed=Math.abs(distance)/time,destination,duration;deceleration=deceleration===undefined?6e-4:deceleration;destination=current+speed*speed/(2*deceleration)*(distance<0?-1:1);duration=speed/deceleration;if(destination<lowerMargin){destination=wrapperSize?lowerMargin-wrapperSize/2.5*(speed/8):lowerMargin;distance=Math.abs(destination-current);duration=distance/speed}else if(destination>0){destination=wrapperSize?wrapperSize/2.5*(speed/8):0;distance=Math.abs(current)+destination;duration=distance/speed}return{destination:Math.round(destination),duration:duration}};var _transform=_prefixStyle("transform");me.extend(me,{hasTransform:_transform!==false,hasPerspective:_prefixStyle("perspective")in _elementStyle,hasTouch:"ontouchstart"in window,hasPointer:!!(window.PointerEvent||window.MSPointerEvent),hasTransition:_prefixStyle("transition")in _elementStyle});me.isBadAndroid=function(){var appVersion=window.navigator.appVersion;if(/Android/.test(appVersion)&&!/Chrome\/\d/.test(appVersion)){var safariVersion=appVersion.match(/Safari\/(\d+.\d)/);if(safariVersion&&typeof safariVersion==="object"&&safariVersion.length>=2){return parseFloat(safariVersion[1])<535.19}else{return true}}else{return false}}();me.extend(me.style={},{transform:_transform,transitionTimingFunction:_prefixStyle("transitionTimingFunction"),transitionDuration:_prefixStyle("transitionDuration"),transitionDelay:_prefixStyle("transitionDelay"),transformOrigin:_prefixStyle("transformOrigin")});me.hasClass=function(e,c){var re=new RegExp("(^|\\s)"+c+"(\\s|$)");return re.test(e.className)};me.addClass=function(e,c){if(me.hasClass(e,c)){return}var newclass=e.className.split(" ");newclass.push(c);e.className=newclass.join(" ")};me.removeClass=function(e,c){if(!me.hasClass(e,c)){return}var re=new RegExp("(^|\\s)"+c+"(\\s|$)","g");e.className=e.className.replace(re," ")};me.offset=function(el){var left=-el.offsetLeft,top=-el.offsetTop;while(el=el.offsetParent){left-=el.offsetLeft;top-=el.offsetTop}return{left:left,top:top}};me.preventDefaultException=function(el,exceptions){for(var i in exceptions){if(exceptions[i].test(el[i])){return true}}return false};me.extend(me.eventType={},{touchstart:1,touchmove:1,touchend:1,mousedown:2,mousemove:2,mouseup:2,pointerdown:3,pointermove:3,pointerup:3,MSPointerDown:3,MSPointerMove:3,MSPointerUp:3});me.extend(me.ease={},{quadratic:{style:"cubic-bezier(0.25, 0.46, 0.45, 0.94)",fn:function(k){return k*(2-k)}},circular:{style:"cubic-bezier(0.1, 0.57, 0.1, 1)",fn:function(k){return Math.sqrt(1- --k*k)}},back:{style:"cubic-bezier(0.175, 0.885, 0.32, 1.275)",fn:function(k){var b=4;return(k=k-1)*k*((b+1)*k+b)+1}},bounce:{style:"",fn:function(k){if((k/=1)<1/2.75){return 7.5625*k*k}else if(k<2/2.75){return 7.5625*(k-=1.5/2.75)*k+.75}else if(k<2.5/2.75){return 7.5625*(k-=2.25/2.75)*k+.9375}else{return 7.5625*(k-=2.625/2.75)*k+.984375}}},elastic:{style:"",fn:function(k){var f=.22,e=.4;if(k===0){return 0}if(k==1){return 1}return e*Math.pow(2,-10*k)*Math.sin((k-f/4)*(2*Math.PI)/f)+1}}});me.tap=function(e,eventName){var ev=document.createEvent("Event");ev.initEvent(eventName,true,true);ev.pageX=e.pageX;ev.pageY=e.pageY;e.target.dispatchEvent(ev)};me.click=function(e){var target=e.target,ev;if(!/(SELECT|INPUT|TEXTAREA)/i.test(target.tagName)){ev=document.createEvent("MouseEvents");ev.initMouseEvent("click",true,true,e.view,1,target.screenX,target.screenY,target.clientX,target.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,0,null);ev._constructed=true;target.dispatchEvent(ev)}};return me}();function IScroll(el,options){this.wrapper=typeof el=="string"?document.querySelector(el):el;this.scroller=this.wrapper.children[0];this.scrollerStyle=this.scroller.style;this.options={resizeScrollbars:true,mouseWheelSpeed:20,snapThreshold:.334,disablePointer:!utils.hasPointer,disableTouch:utils.hasPointer||!utils.hasTouch,disableMouse:utils.hasPointer||utils.hasTouch,startX:0,startY:0,scrollY:true,directionLockThreshold:5,momentum:true,bounce:true,bounceTime:600,bounceEasing:"",preventDefault:true,preventDefaultException:{tagName:/^(INPUT|TEXTAREA|BUTTON|SELECT)$/},HWCompositing:true,useTransition:true,useTransform:true,bindToWrapper:typeof window.onmousedown==="undefined"};for(var i in options){this.options[i]=options[i]}this.translateZ=this.options.HWCompositing&&utils.hasPerspective?" translateZ(0)":"";this.options.useTransition=utils.hasTransition&&this.options.useTransition;this.options.useTransform=utils.hasTransform&&this.options.useTransform;this.options.eventPassthrough=this.options.eventPassthrough===true?"vertical":this.options.eventPassthrough;this.options.preventDefault=!this.options.eventPassthrough&&this.options.preventDefault;this.options.scrollY=this.options.eventPassthrough=="vertical"?false:this.options.scrollY;this.options.scrollX=this.options.eventPassthrough=="horizontal"?false:this.options.scrollX;this.options.freeScroll=this.options.freeScroll&&!this.options.eventPassthrough;this.options.directionLockThreshold=this.options.eventPassthrough?0:this.options.directionLockThreshold;this.options.bounceEasing=typeof this.options.bounceEasing=="string"?utils.ease[this.options.bounceEasing]||utils.ease.circular:this.options.bounceEasing;this.options.resizePolling=this.options.resizePolling===undefined?60:this.options.resizePolling;if(this.options.tap===true){this.options.tap="tap"}if(this.options.shrinkScrollbars=="scale"){this.options.useTransition=false}this.options.invertWheelDirection=this.options.invertWheelDirection?-1:1;this.x=0;this.y=0;this.directionX=0;this.directionY=0;this._events={};this._init();this.refresh();this.scrollTo(this.options.startX,this.options.startY);this.enable()}IScroll.prototype={version:"5.2.0",_init:function(){this._initEvents();if(this.options.scrollbars||this.options.indicators){this._initIndicators()}if(this.options.mouseWheel){this._initWheel()}if(this.options.snap){this._initSnap()}if(this.options.keyBindings){this._initKeys()}},destroy:function(){this._initEvents(true);clearTimeout(this.resizeTimeout);this.resizeTimeout=null;this._execEvent("destroy")},_transitionEnd:function(e){if(e.target!=this.scroller||!this.isInTransition){return}this._transitionTime();if(!this.resetPosition(this.options.bounceTime)){this.isInTransition=false;this._execEvent("scrollEnd")}},_start:function(e){if(utils.eventType[e.type]!=1){var button;if(!e.which){button=e.button<2?0:e.button==4?1:2}else{button=e.button}if(button!==0){return}}if(!this.enabled||this.initiated&&utils.eventType[e.type]!==this.initiated){return}if(this.options.preventDefault&&!utils.isBadAndroid&&!utils.preventDefaultException(e.target,this.options.preventDefaultException)){e.preventDefault()}var point=e.touches?e.touches[0]:e,pos;this.initiated=utils.eventType[e.type];this.moved=false;this.distX=0;this.distY=0;this.directionX=0;this.directionY=0;this.directionLocked=0;this.startTime=utils.getTime();if(this.options.useTransition&&this.isInTransition){this._transitionTime();this.isInTransition=false;pos=this.getComputedPosition();this._translate(Math.round(pos.x),Math.round(pos.y));this._execEvent("scrollEnd")}else if(!this.options.useTransition&&this.isAnimating){this.isAnimating=false;this._execEvent("scrollEnd")}this.startX=this.x;this.startY=this.y;this.absStartX=this.x;this.absStartY=this.y;this.pointX=point.pageX;this.pointY=point.pageY;this._execEvent("beforeScrollStart")},_move:function(e){if(!this.enabled||utils.eventType[e.type]!==this.initiated){return}if(this.options.preventDefault){e.preventDefault()}var point=e.touches?e.touches[0]:e,deltaX=point.pageX-this.pointX,deltaY=point.pageY-this.pointY,timestamp=utils.getTime(),newX,newY,absDistX,absDistY;this.pointX=point.pageX;this.pointY=point.pageY;this.distX+=deltaX;this.distY+=deltaY;absDistX=Math.abs(this.distX);absDistY=Math.abs(this.distY);if(timestamp-this.endTime>300&&(absDistX<10&&absDistY<10)){return}if(!this.directionLocked&&!this.options.freeScroll){if(absDistX>absDistY+this.options.directionLockThreshold){this.directionLocked="h"}else if(absDistY>=absDistX+this.options.directionLockThreshold){this.directionLocked="v"}else{this.directionLocked="n"}}if(this.directionLocked=="h"){if(this.options.eventPassthrough=="vertical"){e.preventDefault()}else if(this.options.eventPassthrough=="horizontal"){this.initiated=false;return}deltaY=0}else if(this.directionLocked=="v"){if(this.options.eventPassthrough=="horizontal"){e.preventDefault()}else if(this.options.eventPassthrough=="vertical"){this.initiated=false;return}deltaX=0}deltaX=this.hasHorizontalScroll?deltaX:0;deltaY=this.hasVerticalScroll?deltaY:0;newX=this.x+deltaX;newY=this.y+deltaY;if(newX>0||newX<this.maxScrollX){newX=this.options.bounce?this.x+deltaX/3:newX>0?0:this.maxScrollX}if(newY>0||newY<this.maxScrollY){newY=this.options.bounce?this.y+deltaY/3:newY>0?0:this.maxScrollY}this.directionX=deltaX>0?-1:deltaX<0?1:0;this.directionY=deltaY>0?-1:deltaY<0?1:0;if(!this.moved){this._execEvent("scrollStart")}this.moved=true;this._translate(newX,newY);if(timestamp-this.startTime>300){this.startTime=timestamp;this.startX=this.x;this.startY=this.y}},_end:function(e){if(!this.enabled||utils.eventType[e.type]!==this.initiated){return}if(this.options.preventDefault&&!utils.preventDefaultException(e.target,this.options.preventDefaultException)){e.preventDefault()}var point=e.changedTouches?e.changedTouches[0]:e,momentumX,momentumY,duration=utils.getTime()-this.startTime,newX=Math.round(this.x),newY=Math.round(this.y),distanceX=Math.abs(newX-this.startX),distanceY=Math.abs(newY-this.startY),time=0,easing="";this.isInTransition=0;this.initiated=0;this.endTime=utils.getTime();if(this.resetPosition(this.options.bounceTime)){return}this.scrollTo(newX,newY);if(!this.moved){if(this.options.tap){utils.tap(e,this.options.tap)}if(this.options.click){utils.click(e)}this._execEvent("scrollCancel");return}if(this._events.flick&&duration<200&&distanceX<100&&distanceY<100){this._execEvent("flick");return}if(this.options.momentum&&duration<300){momentumX=this.hasHorizontalScroll?utils.momentum(this.x,this.startX,duration,this.maxScrollX,this.options.bounce?this.wrapperWidth:0,this.options.deceleration):{destination:newX,duration:0};momentumY=this.hasVerticalScroll?utils.momentum(this.y,this.startY,duration,this.maxScrollY,this.options.bounce?this.wrapperHeight:0,this.options.deceleration):{destination:newY,duration:0};newX=momentumX.destination;newY=momentumY.destination;time=Math.max(momentumX.duration,momentumY.duration);this.isInTransition=1}if(this.options.snap){var snap=this._nearestSnap(newX,newY);this.currentPage=snap;time=this.options.snapSpeed||Math.max(Math.max(Math.min(Math.abs(newX-snap.x),1e3),Math.min(Math.abs(newY-snap.y),1e3)),300);newX=snap.x;newY=snap.y;this.directionX=0;this.directionY=0;easing=this.options.bounceEasing}if(newX!=this.x||newY!=this.y){if(newX>0||newX<this.maxScrollX||newY>0||newY<this.maxScrollY){easing=utils.ease.quadratic}this.scrollTo(newX,newY,time,easing);return}this._execEvent("scrollEnd")},_resize:function(){var that=this;clearTimeout(this.resizeTimeout);this.resizeTimeout=setTimeout((function(){that.refresh()}),this.options.resizePolling)},resetPosition:function(time){var x=this.x,y=this.y;time=time||0;if(!this.hasHorizontalScroll||this.x>0){x=0}else if(this.x<this.maxScrollX){x=this.maxScrollX}if(!this.hasVerticalScroll||this.y>0){y=0}else if(this.y<this.maxScrollY){y=this.maxScrollY}if(x==this.x&&y==this.y){return false}this.scrollTo(x,y,time,this.options.bounceEasing);return true},disable:function(){this.enabled=false},enable:function(){this.enabled=true},refresh:function(){var rf=this.wrapper.offsetHeight;this.wrapperWidth=this.wrapper.clientWidth;this.wrapperHeight=this.wrapper.clientHeight;this.scrollerWidth=this.scroller.offsetWidth;this.scrollerHeight=this.scroller.offsetHeight;this.maxScrollX=this.wrapperWidth-this.scrollerWidth;this.maxScrollY=this.wrapperHeight-this.scrollerHeight;this.hasHorizontalScroll=this.options.scrollX&&this.maxScrollX<0;this.hasVerticalScroll=this.options.scrollY&&this.maxScrollY<0;if(!this.hasHorizontalScroll){this.maxScrollX=0;this.scrollerWidth=this.wrapperWidth}if(!this.hasVerticalScroll){this.maxScrollY=0;this.scrollerHeight=this.wrapperHeight}this.endTime=0;this.directionX=0;this.directionY=0;this.wrapperOffset=utils.offset(this.wrapper);this._execEvent("refresh");this.resetPosition()},on:function(type,fn){if(!this._events[type]){this._events[type]=[]}this._events[type].push(fn)},off:function(type,fn){if(!this._events[type]){return}var index=this._events[type].indexOf(fn);if(index>-1){this._events[type].splice(index,1)}},_execEvent:function(type){if(!this._events[type]){return}var i=0,l=this._events[type].length;if(!l){return}for(;i<l;i++){this._events[type][i].apply(this,[].slice.call(arguments,1))}},scrollBy:function(x,y,time,easing){x=this.x+x;y=this.y+y;time=time||0;this.scrollTo(x,y,time,easing)},scrollTo:function(x,y,time,easing){easing=easing||utils.ease.circular;this.isInTransition=this.options.useTransition&&time>0;var transitionType=this.options.useTransition&&easing.style;if(!time||transitionType){if(transitionType){this._transitionTimingFunction(easing.style);this._transitionTime(time)}this._translate(x,y)}else{this._animate(x,y,time,easing.fn)}},scrollToElement:function(el,time,offsetX,offsetY,easing){el=el.nodeType?el:this.scroller.querySelector(el);if(!el){return}var pos=utils.offset(el);pos.left-=this.wrapperOffset.left;pos.top-=this.wrapperOffset.top;if(offsetX===true){offsetX=Math.round(el.offsetWidth/2-this.wrapper.offsetWidth/2)}if(offsetY===true){offsetY=Math.round(el.offsetHeight/2-this.wrapper.offsetHeight/2)}pos.left-=offsetX||0;pos.top-=offsetY||0;pos.left=pos.left>0?0:pos.left<this.maxScrollX?this.maxScrollX:pos.left;pos.top=pos.top>0?0:pos.top<this.maxScrollY?this.maxScrollY:pos.top;time=time===undefined||time===null||time==="auto"?Math.max(Math.abs(this.x-pos.left),Math.abs(this.y-pos.top)):time;this.scrollTo(pos.left,pos.top,time,easing)},_transitionTime:function(time){time=time||0;var durationProp=utils.style.transitionDuration;this.scrollerStyle[durationProp]=time+"ms";if(!time&&utils.isBadAndroid){this.scrollerStyle[durationProp]="0.0001ms";var self=this;rAF((function(){if(self.scrollerStyle[durationProp]==="0.0001ms"){self.scrollerStyle[durationProp]="0s"}}))}if(this.indicators){for(var i=this.indicators.length;i--;){this.indicators[i].transitionTime(time)}}},_transitionTimingFunction:function(easing){this.scrollerStyle[utils.style.transitionTimingFunction]=easing;if(this.indicators){for(var i=this.indicators.length;i--;){this.indicators[i].transitionTimingFunction(easing)}}},_translate:function(x,y){if(this.options.useTransform){this.scrollerStyle[utils.style.transform]="translate("+x+"px,"+y+"px)"+this.translateZ}else{x=Math.round(x);y=Math.round(y);this.scrollerStyle.left=x+"px";this.scrollerStyle.top=y+"px"}this.x=x;this.y=y;if(this.indicators){for(var i=this.indicators.length;i--;){this.indicators[i].updatePosition()}}},_initEvents:function(remove){var eventType=remove?utils.removeEvent:utils.addEvent,target=this.options.bindToWrapper?this.wrapper:window;eventType(window,"orientationchange",this);eventType(window,"resize",this);if(this.options.click){eventType(this.wrapper,"click",this,true)}if(!this.options.disableMouse){eventType(this.wrapper,"mousedown",this);eventType(target,"mousemove",this);eventType(target,"mousecancel",this);eventType(target,"mouseup",this)}if(utils.hasPointer&&!this.options.disablePointer){eventType(this.wrapper,utils.prefixPointerEvent("pointerdown"),this);eventType(target,utils.prefixPointerEvent("pointermove"),this);eventType(target,utils.prefixPointerEvent("pointercancel"),this);eventType(target,utils.prefixPointerEvent("pointerup"),this)}if(utils.hasTouch&&!this.options.disableTouch){eventType(this.wrapper,"touchstart",this);eventType(target,"touchmove",this);eventType(target,"touchcancel",this);eventType(target,"touchend",this)}eventType(this.scroller,"transitionend",this);eventType(this.scroller,"webkitTransitionEnd",this);eventType(this.scroller,"oTransitionEnd",this);eventType(this.scroller,"MSTransitionEnd",this)},getComputedPosition:function(){var matrix=window.getComputedStyle(this.scroller,null),x,y;if(this.options.useTransform){matrix=matrix[utils.style.transform].split(")")[0].split(", ");x=+(matrix[12]||matrix[4]);y=+(matrix[13]||matrix[5])}else{x=+matrix.left.replace(/[^-\d.]/g,"");y=+matrix.top.replace(/[^-\d.]/g,"")}return{x:x,y:y}},_initIndicators:function(){var interactive=this.options.interactiveScrollbars,customStyle=typeof this.options.scrollbars!="string",indicators=[],indicator;var that=this;this.indicators=[];if(this.options.scrollbars){if(this.options.scrollY){indicator={el:createDefaultScrollbar("v",interactive,this.options.scrollbars),interactive:interactive,defaultScrollbars:true,customStyle:customStyle,resize:this.options.resizeScrollbars,shrink:this.options.shrinkScrollbars,fade:this.options.fadeScrollbars,listenX:false};this.wrapper.appendChild(indicator.el);indicators.push(indicator)}if(this.options.scrollX){indicator={el:createDefaultScrollbar("h",interactive,this.options.scrollbars),interactive:interactive,defaultScrollbars:true,customStyle:customStyle,resize:this.options.resizeScrollbars,shrink:this.options.shrinkScrollbars,fade:this.options.fadeScrollbars,listenY:false};this.wrapper.appendChild(indicator.el);indicators.push(indicator)}}if(this.options.indicators){indicators=indicators.concat(this.options.indicators)}for(var i=indicators.length;i--;){this.indicators.push(new Indicator(this,indicators[i]))}function _indicatorsMap(fn){if(that.indicators){for(var i=that.indicators.length;i--;){fn.call(that.indicators[i])}}}if(this.options.fadeScrollbars){this.on("scrollEnd",(function(){_indicatorsMap((function(){this.fade()}))}));this.on("scrollCancel",(function(){_indicatorsMap((function(){this.fade()}))}));this.on("scrollStart",(function(){_indicatorsMap((function(){this.fade(1)}))}));this.on("beforeScrollStart",(function(){_indicatorsMap((function(){this.fade(1,true)}))}))}this.on("refresh",(function(){_indicatorsMap((function(){this.refresh()}))}));this.on("destroy",(function(){_indicatorsMap((function(){this.destroy()}));delete this.indicators}))},_initWheel:function(){utils.addEvent(this.wrapper,"wheel",this);utils.addEvent(this.wrapper,"mousewheel",this);utils.addEvent(this.wrapper,"DOMMouseScroll",this);this.on("destroy",(function(){clearTimeout(this.wheelTimeout);this.wheelTimeout=null;utils.removeEvent(this.wrapper,"wheel",this);utils.removeEvent(this.wrapper,"mousewheel",this);utils.removeEvent(this.wrapper,"DOMMouseScroll",this)}))},_wheel:function(e){if(!this.enabled){return}e.preventDefault();var wheelDeltaX,wheelDeltaY,newX,newY,that=this;if(this.wheelTimeout===undefined){that._execEvent("scrollStart")}clearTimeout(this.wheelTimeout);this.wheelTimeout=setTimeout((function(){if(!that.options.snap){that._execEvent("scrollEnd")}that.wheelTimeout=undefined}),400);if("deltaX"in e){if(e.deltaMode===1){wheelDeltaX=-e.deltaX*this.options.mouseWheelSpeed;wheelDeltaY=-e.deltaY*this.options.mouseWheelSpeed}else{wheelDeltaX=-e.deltaX;wheelDeltaY=-e.deltaY}}else if("wheelDeltaX"in e){wheelDeltaX=e.wheelDeltaX/120*this.options.mouseWheelSpeed;wheelDeltaY=e.wheelDeltaY/120*this.options.mouseWheelSpeed}else if("wheelDelta"in e){wheelDeltaX=wheelDeltaY=e.wheelDelta/120*this.options.mouseWheelSpeed}else if("detail"in e){wheelDeltaX=wheelDeltaY=-e.detail/3*this.options.mouseWheelSpeed}else{return}wheelDeltaX*=this.options.invertWheelDirection;wheelDeltaY*=this.options.invertWheelDirection;if(!this.hasVerticalScroll){wheelDeltaX=wheelDeltaY;wheelDeltaY=0}if(this.options.snap){newX=this.currentPage.pageX;newY=this.currentPage.pageY;if(wheelDeltaX>0){newX--}else if(wheelDeltaX<0){newX++}if(wheelDeltaY>0){newY--}else if(wheelDeltaY<0){newY++}this.goToPage(newX,newY);return}newX=this.x+Math.round(this.hasHorizontalScroll?wheelDeltaX:0);newY=this.y+Math.round(this.hasVerticalScroll?wheelDeltaY:0);this.directionX=wheelDeltaX>0?-1:wheelDeltaX<0?1:0;this.directionY=wheelDeltaY>0?-1:wheelDeltaY<0?1:0;if(newX>0){newX=0}else if(newX<this.maxScrollX){newX=this.maxScrollX}if(newY>0){newY=0}else if(newY<this.maxScrollY){newY=this.maxScrollY}this.scrollTo(newX,newY,0)},_initSnap:function(){this.currentPage={};if(typeof this.options.snap=="string"){this.options.snap=this.scroller.querySelectorAll(this.options.snap)}this.on("refresh",(function(){var i=0,l,m=0,n,cx,cy,x=0,y,stepX=this.options.snapStepX||this.wrapperWidth,stepY=this.options.snapStepY||this.wrapperHeight,el;this.pages=[];if(!this.wrapperWidth||!this.wrapperHeight||!this.scrollerWidth||!this.scrollerHeight){return}if(this.options.snap===true){cx=Math.round(stepX/2);cy=Math.round(stepY/2);while(x>-this.scrollerWidth){this.pages[i]=[];l=0;y=0;while(y>-this.scrollerHeight){this.pages[i][l]={x:Math.max(x,this.maxScrollX),y:Math.max(y,this.maxScrollY),width:stepX,height:stepY,cx:x-cx,cy:y-cy};y-=stepY;l++}x-=stepX;i++}}else{el=this.options.snap;l=el.length;n=-1;for(;i<l;i++){if(i===0||el[i].offsetLeft<=el[i-1].offsetLeft){m=0;n++}if(!this.pages[m]){this.pages[m]=[]}x=Math.max(-el[i].offsetLeft,this.maxScrollX);y=Math.max(-el[i].offsetTop,this.maxScrollY);cx=x-Math.round(el[i].offsetWidth/2);cy=y-Math.round(el[i].offsetHeight/2);this.pages[m][n]={x:x,y:y,width:el[i].offsetWidth,height:el[i].offsetHeight,cx:cx,cy:cy};if(x>this.maxScrollX){m++}}}this.goToPage(this.currentPage.pageX||0,this.currentPage.pageY||0,0);if(this.options.snapThreshold%1===0){this.snapThresholdX=this.options.snapThreshold;this.snapThresholdY=this.options.snapThreshold}else{this.snapThresholdX=Math.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].width*this.options.snapThreshold);this.snapThresholdY=Math.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].height*this.options.snapThreshold)}}));this.on("flick",(function(){var time=this.options.snapSpeed||Math.max(Math.max(Math.min(Math.abs(this.x-this.startX),1e3),Math.min(Math.abs(this.y-this.startY),1e3)),300);this.goToPage(this.currentPage.pageX+this.directionX,this.currentPage.pageY+this.directionY,time)}))},_nearestSnap:function(x,y){if(!this.pages.length){return{x:0,y:0,pageX:0,pageY:0}}var i=0,l=this.pages.length,m=0;if(Math.abs(x-this.absStartX)<this.snapThresholdX&&Math.abs(y-this.absStartY)<this.snapThresholdY){return this.currentPage}if(x>0){x=0}else if(x<this.maxScrollX){x=this.maxScrollX}if(y>0){y=0}else if(y<this.maxScrollY){y=this.maxScrollY}for(;i<l;i++){if(x>=this.pages[i][0].cx){x=this.pages[i][0].x;break}}l=this.pages[i].length;for(;m<l;m++){if(y>=this.pages[0][m].cy){y=this.pages[0][m].y;break}}if(i==this.currentPage.pageX){i+=this.directionX;if(i<0){i=0}else if(i>=this.pages.length){i=this.pages.length-1}x=this.pages[i][0].x}if(m==this.currentPage.pageY){m+=this.directionY;if(m<0){m=0}else if(m>=this.pages[0].length){m=this.pages[0].length-1}y=this.pages[0][m].y}return{x:x,y:y,pageX:i,pageY:m}},goToPage:function(x,y,time,easing){easing=easing||this.options.bounceEasing;if(x>=this.pages.length){x=this.pages.length-1}else if(x<0){x=0}if(y>=this.pages[x].length){y=this.pages[x].length-1}else if(y<0){y=0}var posX=this.pages[x][y].x,posY=this.pages[x][y].y;time=time===undefined?this.options.snapSpeed||Math.max(Math.max(Math.min(Math.abs(posX-this.x),1e3),Math.min(Math.abs(posY-this.y),1e3)),300):time;this.currentPage={x:posX,y:posY,pageX:x,pageY:y};this.scrollTo(posX,posY,time,easing)},next:function(time,easing){var x=this.currentPage.pageX,y=this.currentPage.pageY;x++;if(x>=this.pages.length&&this.hasVerticalScroll){x=0;y++}this.goToPage(x,y,time,easing)},prev:function(time,easing){var x=this.currentPage.pageX,y=this.currentPage.pageY;x--;if(x<0&&this.hasVerticalScroll){x=0;y--}this.goToPage(x,y,time,easing)},_initKeys:function(e){var keys={pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40};var i;if(typeof this.options.keyBindings=="object"){for(i in this.options.keyBindings){if(typeof this.options.keyBindings[i]=="string"){this.options.keyBindings[i]=this.options.keyBindings[i].toUpperCase().charCodeAt(0)}}}else{this.options.keyBindings={}}for(i in keys){this.options.keyBindings[i]=this.options.keyBindings[i]||keys[i]}utils.addEvent(window,"keydown",this);this.on("destroy",(function(){utils.removeEvent(window,"keydown",this)}))},_key:function(e){if(!this.enabled){return}var snap=this.options.snap,newX=snap?this.currentPage.pageX:this.x,newY=snap?this.currentPage.pageY:this.y,now=utils.getTime(),prevTime=this.keyTime||0,acceleration=.25,pos;if(this.options.useTransition&&this.isInTransition){pos=this.getComputedPosition();this._translate(Math.round(pos.x),Math.round(pos.y));this.isInTransition=false}this.keyAcceleration=now-prevTime<200?Math.min(this.keyAcceleration+acceleration,50):0;switch(e.keyCode){case this.options.keyBindings.pageUp:if(this.hasHorizontalScroll&&!this.hasVerticalScroll){newX+=snap?1:this.wrapperWidth}else{newY+=snap?1:this.wrapperHeight}break;case this.options.keyBindings.pageDown:if(this.hasHorizontalScroll&&!this.hasVerticalScroll){newX-=snap?1:this.wrapperWidth}else{newY-=snap?1:this.wrapperHeight}break;case this.options.keyBindings.end:newX=snap?this.pages.length-1:this.maxScrollX;newY=snap?this.pages[0].length-1:this.maxScrollY;break;case this.options.keyBindings.home:newX=0;newY=0;break;case this.options.keyBindings.left:newX+=snap?-1:5+this.keyAcceleration>>0;break;case this.options.keyBindings.up:newY+=snap?1:5+this.keyAcceleration>>0;break;case this.options.keyBindings.right:newX-=snap?-1:5+this.keyAcceleration>>0;break;case this.options.keyBindings.down:newY-=snap?1:5+this.keyAcceleration>>0;break;default:return}if(snap){this.goToPage(newX,newY);return}if(newX>0){newX=0;this.keyAcceleration=0}else if(newX<this.maxScrollX){newX=this.maxScrollX;this.keyAcceleration=0}if(newY>0){newY=0;this.keyAcceleration=0}else if(newY<this.maxScrollY){newY=this.maxScrollY;this.keyAcceleration=0}this.scrollTo(newX,newY,0);this.keyTime=now},_animate:function(destX,destY,duration,easingFn){var that=this,startX=this.x,startY=this.y,startTime=utils.getTime(),destTime=startTime+duration;function step(){var now=utils.getTime(),newX,newY,easing;if(now>=destTime){that.isAnimating=false;that._translate(destX,destY);if(!that.resetPosition(that.options.bounceTime)){that._execEvent("scrollEnd")}return}now=(now-startTime)/duration;easing=easingFn(now);newX=(destX-startX)*easing+startX;newY=(destY-startY)*easing+startY;that._translate(newX,newY);if(that.isAnimating){rAF(step)}}this.isAnimating=true;step()},handleEvent:function(e){switch(e.type){case"touchstart":case"pointerdown":case"MSPointerDown":case"mousedown":this._start(e);break;case"touchmove":case"pointermove":case"MSPointerMove":case"mousemove":this._move(e);break;case"touchend":case"pointerup":case"MSPointerUp":case"mouseup":case"touchcancel":case"pointercancel":case"MSPointerCancel":case"mousecancel":this._end(e);break;case"orientationchange":case"resize":this._resize();break;case"transitionend":case"webkitTransitionEnd":case"oTransitionEnd":case"MSTransitionEnd":this._transitionEnd(e);break;case"wheel":case"DOMMouseScroll":case"mousewheel":this._wheel(e);break;case"keydown":this._key(e);break;case"click":if(this.enabled&&!e._constructed){e.preventDefault();e.stopPropagation()}break}}};function createDefaultScrollbar(direction,interactive,type){var scrollbar=document.createElement("div"),indicator=document.createElement("div");if(type===true){scrollbar.style.cssText="position:absolute;z-index:9999";indicator.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:absolute;background:rgba(0,0,0,0.5);border:1px solid rgba(255,255,255,0.9);border-radius:3px"}indicator.className="iScrollIndicator";if(direction=="h"){if(type===true){scrollbar.style.cssText+=";height:7px;left:2px;right:2px;bottom:0";indicator.style.height="100%"}scrollbar.className="iScrollHorizontalScrollbar"}else{if(type===true){scrollbar.style.cssText+=";width:7px;bottom:2px;top:2px;right:1px";indicator.style.width="100%"}scrollbar.className="iScrollVerticalScrollbar"}scrollbar.style.cssText+=";overflow:hidden";if(!interactive){scrollbar.style.pointerEvents="none"}scrollbar.appendChild(indicator);return scrollbar}function Indicator(scroller,options){this.wrapper=typeof options.el=="string"?document.querySelector(options.el):options.el;this.wrapperStyle=this.wrapper.style;this.indicator=this.wrapper.children[0];this.indicatorStyle=this.indicator.style;this.scroller=scroller;this.options={listenX:true,listenY:true,interactive:false,resize:true,defaultScrollbars:false,shrink:false,fade:false,speedRatioX:0,speedRatioY:0};for(var i in options){this.options[i]=options[i]}this.sizeRatioX=1;this.sizeRatioY=1;this.maxPosX=0;this.maxPosY=0;if(this.options.interactive){if(!this.options.disableTouch){utils.addEvent(this.indicator,"touchstart",this);utils.addEvent(window,"touchend",this)}if(!this.options.disablePointer){utils.addEvent(this.indicator,utils.prefixPointerEvent("pointerdown"),this);utils.addEvent(window,utils.prefixPointerEvent("pointerup"),this)}if(!this.options.disableMouse){utils.addEvent(this.indicator,"mousedown",this);utils.addEvent(window,"mouseup",this)}}if(this.options.fade){this.wrapperStyle[utils.style.transform]=this.scroller.translateZ;var durationProp=utils.style.transitionDuration;this.wrapperStyle[durationProp]=utils.isBadAndroid?"0.0001ms":"0ms";var self=this;if(utils.isBadAndroid){rAF((function(){if(self.wrapperStyle[durationProp]==="0.0001ms"){self.wrapperStyle[durationProp]="0s"}}))}this.wrapperStyle.opacity="0"}}Indicator.prototype={handleEvent:function(e){switch(e.type){case"touchstart":case"pointerdown":case"MSPointerDown":case"mousedown":this._start(e);break;case"touchmove":case"pointermove":case"MSPointerMove":case"mousemove":this._move(e);break;case"touchend":case"pointerup":case"MSPointerUp":case"mouseup":case"touchcancel":case"pointercancel":case"MSPointerCancel":case"mousecancel":this._end(e);break}},destroy:function(){if(this.options.fadeScrollbars){clearTimeout(this.fadeTimeout);this.fadeTimeout=null}if(this.options.interactive){utils.removeEvent(this.indicator,"touchstart",this);utils.removeEvent(this.indicator,utils.prefixPointerEvent("pointerdown"),this);utils.removeEvent(this.indicator,"mousedown",this);utils.removeEvent(window,"touchmove",this);utils.removeEvent(window,utils.prefixPointerEvent("pointermove"),this);utils.removeEvent(window,"mousemove",this);utils.removeEvent(window,"touchend",this);utils.removeEvent(window,utils.prefixPointerEvent("pointerup"),this);utils.removeEvent(window,"mouseup",this)}if(this.options.defaultScrollbars){this.wrapper.parentNode.removeChild(this.wrapper)}},_start:function(e){var point=e.touches?e.touches[0]:e;e.preventDefault();e.stopPropagation();this.transitionTime();this.initiated=true;this.moved=false;this.lastPointX=point.pageX;this.lastPointY=point.pageY;this.startTime=utils.getTime();if(!this.options.disableTouch){utils.addEvent(window,"touchmove",this)}if(!this.options.disablePointer){utils.addEvent(window,utils.prefixPointerEvent("pointermove"),this)}if(!this.options.disableMouse){utils.addEvent(window,"mousemove",this)}this.scroller._execEvent("beforeScrollStart")},_move:function(e){var point=e.touches?e.touches[0]:e,deltaX,deltaY,newX,newY,timestamp=utils.getTime();if(!this.moved){this.scroller._execEvent("scrollStart")}this.moved=true;deltaX=point.pageX-this.lastPointX;this.lastPointX=point.pageX;deltaY=point.pageY-this.lastPointY;this.lastPointY=point.pageY;newX=this.x+deltaX;newY=this.y+deltaY;this._pos(newX,newY);e.preventDefault();e.stopPropagation()},_end:function(e){if(!this.initiated){return}this.initiated=false;e.preventDefault();e.stopPropagation();utils.removeEvent(window,"touchmove",this);utils.removeEvent(window,utils.prefixPointerEvent("pointermove"),this);utils.removeEvent(window,"mousemove",this);if(this.scroller.options.snap){var snap=this.scroller._nearestSnap(this.scroller.x,this.scroller.y);var time=this.options.snapSpeed||Math.max(Math.max(Math.min(Math.abs(this.scroller.x-snap.x),1e3),Math.min(Math.abs(this.scroller.y-snap.y),1e3)),300);if(this.scroller.x!=snap.x||this.scroller.y!=snap.y){this.scroller.directionX=0;this.scroller.directionY=0;this.scroller.currentPage=snap;this.scroller.scrollTo(snap.x,snap.y,time,this.scroller.options.bounceEasing)}}if(this.moved){this.scroller._execEvent("scrollEnd")}},transitionTime:function(time){time=time||0;var durationProp=utils.style.transitionDuration;this.indicatorStyle[durationProp]=time+"ms";if(!time&&utils.isBadAndroid){this.indicatorStyle[durationProp]="0.0001ms";var self=this;rAF((function(){if(self.indicatorStyle[durationProp]==="0.0001ms"){self.indicatorStyle[durationProp]="0s"}}))}},transitionTimingFunction:function(easing){this.indicatorStyle[utils.style.transitionTimingFunction]=easing},refresh:function(){this.transitionTime();if(this.options.listenX&&!this.options.listenY){this.indicatorStyle.display=this.scroller.hasHorizontalScroll?"block":"none"}else if(this.options.listenY&&!this.options.listenX){this.indicatorStyle.display=this.scroller.hasVerticalScroll?"block":"none"}else{this.indicatorStyle.display=this.scroller.hasHorizontalScroll||this.scroller.hasVerticalScroll?"block":"none"}if(this.scroller.hasHorizontalScroll&&this.scroller.hasVerticalScroll){utils.addClass(this.wrapper,"iScrollBothScrollbars");utils.removeClass(this.wrapper,"iScrollLoneScrollbar");if(this.options.defaultScrollbars&&this.options.customStyle){if(this.options.listenX){this.wrapper.style.right="8px"}else{this.wrapper.style.bottom="8px"}}}else{utils.removeClass(this.wrapper,"iScrollBothScrollbars");utils.addClass(this.wrapper,"iScrollLoneScrollbar");if(this.options.defaultScrollbars&&this.options.customStyle){if(this.options.listenX){this.wrapper.style.right="2px"}else{this.wrapper.style.bottom="2px"}}}var r=this.wrapper.offsetHeight;if(this.options.listenX){this.wrapperWidth=this.wrapper.clientWidth;if(this.options.resize){this.indicatorWidth=Math.max(Math.round(this.wrapperWidth*this.wrapperWidth/(this.scroller.scrollerWidth||this.wrapperWidth||1)),8);this.indicatorStyle.width=this.indicatorWidth+"px"}else{this.indicatorWidth=this.indicator.clientWidth}this.maxPosX=this.wrapperWidth-this.indicatorWidth;if(this.options.shrink=="clip"){this.minBoundaryX=-this.indicatorWidth+8;this.maxBoundaryX=this.wrapperWidth-8}else{this.minBoundaryX=0;this.maxBoundaryX=this.maxPosX}this.sizeRatioX=this.options.speedRatioX||this.scroller.maxScrollX&&this.maxPosX/this.scroller.maxScrollX}if(this.options.listenY){this.wrapperHeight=this.wrapper.clientHeight;if(this.options.resize){this.indicatorHeight=Math.max(Math.round(this.wrapperHeight*this.wrapperHeight/(this.scroller.scrollerHeight||this.wrapperHeight||1)),8);this.indicatorStyle.height=this.indicatorHeight+"px"}else{this.indicatorHeight=this.indicator.clientHeight}this.maxPosY=this.wrapperHeight-this.indicatorHeight;if(this.options.shrink=="clip"){this.minBoundaryY=-this.indicatorHeight+8;this.maxBoundaryY=this.wrapperHeight-8}else{this.minBoundaryY=0;this.maxBoundaryY=this.maxPosY}this.maxPosY=this.wrapperHeight-this.indicatorHeight;this.sizeRatioY=this.options.speedRatioY||this.scroller.maxScrollY&&this.maxPosY/this.scroller.maxScrollY}this.updatePosition()},updatePosition:function(){var x=this.options.listenX&&Math.round(this.sizeRatioX*this.scroller.x)||0,y=this.options.listenY&&Math.round(this.sizeRatioY*this.scroller.y)||0;if(!this.options.ignoreBoundaries){if(x<this.minBoundaryX){if(this.options.shrink=="scale"){this.width=Math.max(this.indicatorWidth+x,8);this.indicatorStyle.width=this.width+"px"}x=this.minBoundaryX}else if(x>this.maxBoundaryX){if(this.options.shrink=="scale"){this.width=Math.max(this.indicatorWidth-(x-this.maxPosX),8);this.indicatorStyle.width=this.width+"px";x=this.maxPosX+this.indicatorWidth-this.width}else{x=this.maxBoundaryX}}else if(this.options.shrink=="scale"&&this.width!=this.indicatorWidth){this.width=this.indicatorWidth;this.indicatorStyle.width=this.width+"px"}if(y<this.minBoundaryY){if(this.options.shrink=="scale"){this.height=Math.max(this.indicatorHeight+y*3,8);this.indicatorStyle.height=this.height+"px"}y=this.minBoundaryY}else if(y>this.maxBoundaryY){if(this.options.shrink=="scale"){this.height=Math.max(this.indicatorHeight-(y-this.maxPosY)*3,8);this.indicatorStyle.height=this.height+"px";y=this.maxPosY+this.indicatorHeight-this.height}else{y=this.maxBoundaryY}}else if(this.options.shrink=="scale"&&this.height!=this.indicatorHeight){this.height=this.indicatorHeight;this.indicatorStyle.height=this.height+"px"}}this.x=x;this.y=y;if(this.scroller.options.useTransform){this.indicatorStyle[utils.style.transform]="translate("+x+"px,"+y+"px)"+this.scroller.translateZ}else{this.indicatorStyle.left=x+"px";this.indicatorStyle.top=y+"px"}},_pos:function(x,y){if(x<0){x=0}else if(x>this.maxPosX){x=this.maxPosX}if(y<0){y=0}else if(y>this.maxPosY){y=this.maxPosY}x=this.options.listenX?Math.round(x/this.sizeRatioX):this.scroller.x;y=this.options.listenY?Math.round(y/this.sizeRatioY):this.scroller.y;this.scroller.scrollTo(x,y)},fade:function(val,hold){if(hold&&!this.visible){return}clearTimeout(this.fadeTimeout);this.fadeTimeout=null;var time=val?250:500,delay=val?0:300;val=val?"1":"0";this.wrapperStyle[utils.style.transitionDuration]=time+"ms";this.fadeTimeout=setTimeout(function(val){this.wrapperStyle.opacity=val;this.visible=+val}.bind(this,val),delay)}};IScroll.utils=utils;if(typeof module!="undefined"&&module.exports){module.exports=IScroll}else if(typeof define=="function"&&define.amd){define((function(){return IScroll}))}else{window.IScroll=IScroll}})(window,document,Math);(function(factory){var registeredInModuleLoader=false;if(typeof define==="function"&&define.amd){define(factory);registeredInModuleLoader=true}if(typeof exports==="object"){module.exports=factory();registeredInModuleLoader=true}if(!registeredInModuleLoader){var OldCookies=window.Cookies;var api=window.Cookies=factory();api.noConflict=function(){window.Cookies=OldCookies;return api}}})((function(){function extend(){var i=0;var result={};for(;i<arguments.length;i++){var attributes=arguments[i];for(var key in attributes){result[key]=attributes[key]}}return result}function init(converter){function api(key,value,attributes){var result;if(typeof document==="undefined"){return}if(arguments.length>1){attributes=extend({path:"/"},api.defaults,attributes);if(typeof attributes.expires==="number"){var expires=new Date;expires.setMilliseconds(expires.getMilliseconds()+attributes.expires*864e5);attributes.expires=expires}attributes.expires=attributes.expires?attributes.expires.toUTCString():"";try{result=JSON.stringify(value);if(/^[\{\[]/.test(result)){value=result}}catch(e){}if(!converter.write){value=encodeURIComponent(String(value)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)}else{value=converter.write(value,key)}key=encodeURIComponent(String(key));key=key.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent);key=key.replace(/[\(\)]/g,escape);var stringifiedAttributes="";for(var attributeName in attributes){if(!attributes[attributeName]){continue}stringifiedAttributes+="; "+attributeName;if(attributes[attributeName]===true){continue}stringifiedAttributes+="="+attributes[attributeName]}return document.cookie=key+"="+value+stringifiedAttributes}if(!key){result={}}var cookies=document.cookie?document.cookie.split("; "):[];var rdecode=/(%[0-9A-Z]{2})+/g;var i=0;for(;i<cookies.length;i++){var parts=cookies[i].split("=");var cookie=parts.slice(1).join("=");if(!this.json&&cookie.charAt(0)==='"'){cookie=cookie.slice(1,-1)}try{var name=parts[0].replace(rdecode,decodeURIComponent);cookie=converter.read?converter.read(cookie,name):converter(cookie,name)||cookie.replace(rdecode,decodeURIComponent);if(this.json){try{cookie=JSON.parse(cookie)}catch(e){}}if(key===name){result=cookie;break}if(!key){result[name]=cookie}}catch(e){}}return result}api.set=api;api.get=function(key){return api.call(api,key)};api.getJSON=function(){return api.apply({json:true},[].slice.call(arguments))};api.defaults={};api.remove=function(key,attributes){api(key,"",extend(attributes,{expires:-1}))};api.withConverter=init;return api}return init((function(){}))}));"use strict";window.requestAnimationFrame=function(){"use strict";return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimaitonFrame||function(callback){window.setTimeout(callback,1e3/60)}}();(function($){"use strict";var DIRECTIONS={NONE:0,HORIZONTAL:1,LEFT_TO_RIGHT:2,RIGHT_TO_LEFT:3,VERTICAL:4,TOP_TO_DOWN:5,DOWN_TO_TOP:6};var abs=Math.abs;var max=Math.max;var TAG_WHITE_LIST=["INPUT","SELECT","OPTION"];var SwipeTracer;var activeEventProcessor;var swipeMask=$("<div></div>");swipeMask.css({"background-color":"rgba(0, 0, 0, 0)",position:"fixed",top:0,width:"100vw",height:"100vh","z-index":1e5});var touchMoveListeners=[];var touchEndListeners=[];var pointerId=null;var onTouch=function(e){if(e&&(e.pointerId&&e.pointerId!==pointerId||e.touches&&e.touches.length>1)){onTouchEnd(e)}$.each(touchMoveListeners,(function(i,fn){return fn(e)}))};var onTouchEnd=function(e){pointerId=null;$.each(touchEndListeners,(function(i,fn){return fn(e)}));touchMoveListeners.length=0;touchEndListeners.length=0};function addEventListener(target,event,callback){(target.__zone_symbol__addEventListener||target.addEventListener).call(target,event,callback,{passive:true})}function iOSversion(){if(/iP(hone|od|ad)/.test(navigator.platform)){var v=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);return parseInt(v[1],10)}}if(window["PointerEvent"]&&iOSversion()>=13){addEventListener(document,"pointerdown",(function(e){if(pointerId&&pointerId!==e.pointerId){onTouchEnd(e)}else{pointerId=e.pointerId}}));addEventListener(document,"pointermove",onTouch);addEventListener(document,"pointerup",onTouchEnd);addEventListener(document,"pointercancel",onTouchEnd)}else{addEventListener(document,"mousemove",onTouch);addEventListener(document,"touchmove",onTouch);addEventListener(document,"mouseup",onTouchEnd);addEventListener(document,"touchcancel",onTouchEnd);addEventListener(document,"touchend",onTouchEnd)}function ScrollObserver(parent,child,direction){var elementsToObserve=function(array){var iter=child;while(iter){array.push({$ele:$(iter),last:{scrollLeft:iter.iscroll?iter.iscroll.x:iter.scrollLeft,scrollTop:iter.iscroll?iter.iscroll.y:iter.scrollTop}});iter=iter.parentElement}return array}([]);function isVerticalScroll(){var result;$.each(elementsToObserve,(function(){if(this.$ele[0].iscroll){if(!isNaN(this.$ele[0].iscroll.y)&&this.$ele[0].iscroll.y!==0){result=true}}else if(this.$ele[0].scrollTop!==0){result=true}}));return result}function isHorizontalScroll(){var result;$.each(elementsToObserve,(function(){if(this.$ele[0].iscroll){if(!isNaN(this.$ele[0].iscroll.x)&&this.$ele[0].iscroll.x!==0){result=true}}else if(this.$ele[0].scrollLeft!==0){result=true}}));return result}this.hasSrcolled=function(){if(direction===$.fn.swipey.DIRECTIONS.VERTICAL){return isVerticalScroll()}if(direction===$.fn.swipey.DIRECTIONS.HORIZONTAL){return isHorizontalScroll()}}}function SwipeEventSmoother(){var queue=[];var isProcessing=false;var time;function process(){if(queue.length>0){try{queue.shift()()}catch(e){console.error("Function invocation failed",e)}window.requestAnimationFrame(process)}else{isProcessing=false}}this.push=function(fn){queue.push(fn)};this.process=function(){if(!isProcessing){isProcessing=true;process()}}}activeEventProcessor=new SwipeEventSmoother;function getTouchEvent(event){if(event.originalEvent&&event.originalEvent.pointerType!=="mouse"){return event.originalEvent}return event.originalEvent&&event.originalEvent.touches&&event.originalEvent.touches[0]||event&&event.touches&&event.touches[0]||event}function computeDistance(startPoint,endPoint,direction){var distance=0,deltaX,deltaY;if(direction===DIRECTIONS.HORIZONTAL){distance=endPoint.x-startPoint.x}else if(direction===DIRECTIONS.LEFT_TO_RIGHT){distance=max(endPoint.x-startPoint.x,0)}else if(direction===DIRECTIONS.RIGHT_TO_LEFT){distance=max(startPoint.x-endPoint.x,0)}else if(direction===DIRECTIONS.VERTICAL){distance=endPoint.y-startPoint.y}else if(direction===DIRECTIONS.TOP_TO_DOWN){distance=max(endPoint.y-startPoint.y,0)}else if(direction===DIRECTIONS.DOWN_TO_TOP){distance=max(startPoint.y-endPoint.y,0)}else{deltaX=endPoint.x-startPoint.x;deltaY=endPoint.y-startPoint.y;distance=max(abs(deltaX),abs(deltaY));if(deltaX<0&&abs(deltaX)===distance||deltaY<0&&abs(deltaY)===distance){distance=-distance}}return distance}function onActiveSwipe(event,settings){var touch=getTouchEvent(event);var startPoint=settings.data.path[0];var point={x:touch.pageX,y:touch.pageY};var distance=computeDistance(startPoint,point,settings.direction);var eventSplits=[];var increment;var limit;settings.renderInProgress=false;if(distance!==settings.lastDistance){increment=(distance<settings.lastDistance?-1:1)*30;limit=distance-settings.lastDistance;for(var i=increment;increment>0&&i<=limit||increment<0&&i>=limit;i+=increment){eventSplits.push(i+settings.lastDistance)}if(limit%increment!==0){eventSplits.push(limit%abs(increment)+(eventSplits.length===0?settings.lastDistance:eventSplits[eventSplits.length-1]))}settings.lastDistance=distance;$.each(eventSplits,(function(){var d=this;activeEventProcessor.push((function(){settings.data.length=d;settings.data.totalLength+=abs(d);settings.data.velocity=abs(settings.data.totalLength/(Date.now()-settings.data.startTime));settings.data.path.push(point);if(settings.onSwipe.call(settings.target,event,settings.data)===false){onActiveSwipeEnd(event,settings)}SwipeTracer.onSwipe(event,settings.data)}))}));activeEventProcessor.process()}}function onActiveSwipeEnd(event,settings){var touch=getTouchEvent(event);if(touch){settings.data.path.push({x:touch.pageX,y:touch.pageY})}activeEventProcessor.push((function(){SwipeTracer.onSwipeEnd(event,settings.data);settings.onSwipeEnd.call(settings.target,event,settings.data)}));activeEventProcessor.process()}function listenActiveSwipe(event,settings){var touch=getTouchEvent(event);var swipeHandler;var swipeEndHandler;var passiveDistance;var passiveSwipeStartPoint=settings.data.path[0];var activeSwipeStartPoint={x:touch.pageX,y:touch.pageY};passiveDistance=computeDistance(passiveSwipeStartPoint,activeSwipeStartPoint,settings.direction);settings.data.length=passiveDistance<0?-1:1;settings.lastDistance=settings.data.length;settings.data.path=[activeSwipeStartPoint];settings.data.totalLength=abs(settings.data.length);settings.data.startTime=Date.now();if(settings.onSwipeStart.call(settings.target,event,settings.data)===false){return false}swipeMask.appendTo($("body"));swipeHandler=function(em){onActiveSwipe(em,settings)};swipeEndHandler=function(ee){swipeMask.remove();onActiveSwipeEnd(ee,settings)};touchMoveListeners=[];touchMoveListeners.push(swipeHandler);touchEndListeners=[];touchEndListeners.push(swipeEndHandler);SwipeTracer.onSwipeStart(event,settings.data);return true}function isThresholdAngleReached(startPoint,endPoint,direction){if(direction===DIRECTIONS.HORIZONTAL){if(Math.abs((endPoint.y-startPoint.y)/(endPoint.x-startPoint.x))<=.36397023426){return true}}else if(direction===DIRECTIONS.VERTICAL){if(Math.abs((endPoint.y-startPoint.y)/(endPoint.x-startPoint.x))>=2.74747741945){return true}}return false}function isThresholdReached(touch,settings){var startPoint=settings.data.path[0];var endPoint={x:touch.pageX,y:touch.pageY};var distance=computeDistance(startPoint,endPoint,settings.direction);return abs(distance)>settings.threshold&&isThresholdAngleReached(startPoint,endPoint,settings.direction)}function listenPassiveSwipe(touch,settings){var passiveSwipeHandler;settings.scrollObserver=new ScrollObserver(event.currentTarget,event.target,settings.direction);passiveSwipeHandler=function(em){if(isThresholdReached(getTouchEvent(em),settings)){if(settings.scrollObserver.hasSrcolled()||listenActiveSwipe(em,settings)){return false}}};touchMoveListeners.push(passiveSwipeHandler);settings.data={path:[{x:touch.pageX,y:touch.pageY}]}}function bind(settings){var events=settings.bindEvents;var listenFor="";if(_.includes(events,"touch")){listenFor+="touchstart"}else if(_.includes(events,"mouse")){listenFor+="mousedown"}else if(_.includes(events,"pointer")){listenFor+="pointerdown"}if(!listenFor){return}addEventListener(settings.target[0],listenFor,(function(es){if(settings.disableMouse&&es.pointerType==="mouse"){return}if(es.pointerType!=="mouse"&&es.MSPOINTER_TYPE_MOUSE&&es.pointerType!==es.MSPOINTER_TYPE_MOUSE){if(TAG_WHITE_LIST.indexOf(es.target.tagName)<0){es.preventDefault()}else{return}}var touch=getTouchEvent(es);if(touch){listenPassiveSwipe(touch,settings)}}))}$.fn.swipey=function(settings){this.each((function(){bind($.extend({direction:DIRECTIONS.NONE,target:$(this),bindEvents:["touch","mouse"],swipeTarget:document,threshold:30,onSwipeStart:$.noop,onSwipe:$.noop,onSwipeEnd:$.noop,disableMouse:true},settings))}));return this};SwipeTracer={onSwipeStart:function(e,data){if($.fn.swipey.trace){var $svg='<svg height="100vh" width="100vw" id ="canvas">'+' <path stroke="rgba(0, 0, 0, 0.5)" stroke-linecap="round" stroke-width="20" fill-opacity="0" '+' stroke-opacity="0.8" d="M'+data.path[0].x+" "+data.path[0].y+' " />'+" </svg>";$svg.css({position:"fixed",top:0,left:0,width:"100vw",height:"100vh","z-index":1e4});$("body").append($svg);data.tracer={pathd:$("#canvas path")}}},onSwipe:function(e,data){if(data.tracer){var d=data.tracer.pathd.attr("d");var p=data.path[data.path.length-1];data.tracer.pathd.attr("d",d+" L"+p.x+" "+p.y+" ")}},onSwipeEnd:function(e,data){if(data.tracer){var firstPoint=data.path[0];var expected_1=[firstPoint,{y:firstPoint.y-50},{x:firstPoint.x+50},{y:firstPoint.y+50}];var trace_1=0;_.forEach(data.path,(function(p){var ep;if(trace_1!==expected_1.length){ep=expected_1[trace_1];if((!ep.x||ep.x<=p.x)&&(!ep.y||ep.y<=p.y)){trace_1++}}}));setTimeout((function(){$("body >#canvas").remove()}),500)}}};$.fn.swipey.DIRECTIONS=DIRECTIONS})(jQuery);(function($){var $parse;var expressionRegex=/\$\{\{[a-zA-Z\+-/%\.\*\s\(\)\d,\\'"\$_]*\}\}/;function getParseService(){if($.fn.swipeAnimation.expressionEvaluator){return $.fn.swipeAnimation.expressionEvaluator}if(window.exprEval&&window.exprEval.Parser){return function(exp){var parser=(new window.exprEval.Parser).parse(exp);return function(context){return parser.evaluate(context)}}}}function compile(script){var tArr=[];var match;$parse=$parse||getParseService();if(_.isFunction(script)){return script}else if($parse){while((match=expressionRegex.exec(script))!==null){var expression=match[0];var prefix=script.substring(0,match.index);script=script.substring(match.index+expression.length);expression=expression.substring(3,expression.length-2);tArr.push(prefix);tArr.push($parse(expression).bind({}))}tArr.push(script);return function(){var args=arguments;return _.map(tArr,(function(v){return _.isFunction(v)?v.apply(undefined,args):v})).join("")}}}function getObject(obj,$ele,args){if(_.isFunction(obj)){return obj.apply($ele,args)}return obj}function VelocityComputator(){var lastDistance=0;var lastTime=0;var v=0;return{addDistance:function(d){var currentTime=Date.now();if(Math.abs(d-lastDistance)>10&¤tTime!==lastTime){v=(d-lastDistance)/(currentTime-lastTime);lastDistance=d;lastTime=currentTime}if(v<0){v=Math.min(v,-1)}else{v=Math.max(v,1)}return this},getVelocity:function(){return v},getTime:function(d){return Math.abs(d/v)}}}function calculateBounds($el,settings,args){var centerVal=0;var bounds=getObject(settings.bounds,$el,args);if(!_.isUndefined(bounds.center)){centerVal=bounds.center}if(!_.isUndefined(bounds.lower)){bounds.lower=bounds.lower+centerVal}if(!_.isUndefined(bounds.upper)){bounds.upper=bounds.upper+centerVal}return bounds}function retrieveTargets(settings){_.forEach(settings.animation,(function(a){if(_.isFunction(a.target)||a.targetFn){a.targetFn=_.isUndefined(a.targetFn)?a.target:a.targetFn;a.target=a.targetFn()}}))}function SettingsProperty(){this.setSettings=function(settings,$el){$el.data("swipeAnimationDefaults",settings)};this.getSettings=function($el){return $el.data("swipeAnimationDefaults")}}function animate(settings,metaData,time,$el,distanceMoved,e){_.forEach(settings.animation,(function(a){if(!a.target){return}if(a.target.length>1){a.target.each((function(i){metaData.$i=i;$(this).css(_.mapValues(a.css,(function(v,k){return v(metaData)})))}))}else{metaData.$i=0;a.target.css(_.mapValues(a.css,(function(v,k){return v(metaData)})))}a.target.css({transition:"all ease-out "+time+"ms"});a.target.one("webkitTransitionEnd transitionend",(function(){a.target.css({transition:""})}))}));setTimeout((function(){window.requestAnimationFrame((function(){if(metaData.$D===metaData.bounds.lower){settings.onLower.call($el,e)}else if(metaData.$D===metaData.bounds.upper){settings.onUpper.call($el,e)}settings.onAnimation(e,distanceMoved)}))}),time)}var methods={gotoUpper:function(){swipeToEnd(this,"upper",arguments[1])},gotoLower:function(time){swipeToEnd(this,"lower",arguments[1])}};function swipeToEnd($ele,moveTo,time){var settingsObj=new SettingsProperty;var settings=settingsObj.getSettings($ele);var metaData={};var bounds=calculateBounds($ele,settings);var context;retrieveTargets(settings);time=time||300;context=getObject(settings.context,$ele);metaData=_.extend({},context);metaData.$d=0;metaData.$D=moveTo==="lower"?bounds.lower:bounds.upper;metaData.bounds=bounds;animate(settings,metaData,time,$ele)}function addSwipey($ele,settings){var state={$D:0};var baseContext={max:Math.max,min:Math.min,abs:Math.abs};if(!_.isArray(settings.animation)){var target=settings.animation.target||$ele;var css=settings.animation.css||settings.animation;delete css[$ele];settings.animation=[{target:target,css:css}]}_.forEach(settings.animation,(function(a){a.css=_.mapValues(a.css,(function(v,k){return compile(v)}))}));var settingsObj=new SettingsProperty;settingsObj.setSettings(settings,$ele);$ele.swipey({direction:settings.direction,threshold:settings.threshold,bindEvents:settings.bindEvents,target:settings.target,onSwipeStart:function(e,data){var cd;state.$d=0;state.bounds=calculateBounds(this,settings,[e,data.length]);if(!_.isUndefined(state.bounds.center)){state.$D=state.bounds.center}else{state.$D=0}cd=state.$D+data.length;state.bounds.strictLower=!(state.bounds.strict===false||state.bounds.strictLower===false);state.bounds.strictUpper=!(state.bounds.strict===false||state.bounds.strictUpper===false);if(!settings.enableGestures()||state.bounds.strictLower&&(_.isUndefined(state.bounds.lower)&&data.length<0||!_.isUndefined(state.bounds.lower)&&state.bounds.lower>cd)||state.bounds.strictUpper&&(_.isUndefined(state.bounds.upper)&&data.length>0||!_.isUndefined(state.bounds.upper)&&state.bounds.upper<cd)){return false}state.vc=VelocityComputator();state.context=_.extend(baseContext,getObject(settings.context,$ele));state.localState=_.extend({},state.context);retrieveTargets(settings);_.forEach(settings.animation,(function(a){if(a.target){a.target.css({transition:"none"})}}))},onSwipe:function(e,data){var localState=state.localState;var cd=state.$D+data.length;localState.$d=data.length;localState.$D=state.$D;if(state.bounds.strictLower&&!_.isUndefined(state.bounds.lower)&&state.bounds.lower>cd){localState.$d=state.bounds.lower-state.$D}else if(state.bounds.strictUpper&&!_.isUndefined(state.bounds.upper)&&state.bounds.upper<cd){localState.$d=state.bounds.upper-state.$D}state.vc.addDistance(data.length);_.forEach(settings.animation,(function(a){if(a.target){if(a.target.length>1){a.target.each((function(i){localState.$i=i;$(this).css(_.mapValues(a.css,(function(v,k){return v(localState)})))}))}else{localState.$i=0;a.target.css(_.mapValues(a.css,(function(v,k){return v(localState)})))}}}))},onSwipeEnd:function(e,data){var localState=state.localState;var cd=state.$D+data.length;var v=state.vc.getVelocity();var time;localState.$d=data.length;localState.$D=state.$D;if(!_.isUndefined(state.bounds.lower)&&v<=0&&state.$D>cd){localState.$D=state.bounds.lower}else if(!_.isUndefined(state.bounds.upper)&&v>=0&&state.$D<cd){localState.$D=state.bounds.upper}localState.$d=0;localState.bounds=state.bounds;state.$D=localState.$D;time=state.vc.getTime(localState.$D-cd);animate(settings,localState,time,$ele,cd,e)}})}$.fn.swipeAnimation=function(settings){if(methods[settings]){return methods[settings].apply(this,arguments)}this.each((function(){addSwipey($(this),$.extend({direction:$.fn.swipey.DIRECTIONS.HORIZONTAL,target:$(this),threshold:30,enableGestures:function(){return true},bindEvents:["touch"],bounds:{},context:{},animation:{},onLower:$.noop,onUpper:$.noop,onAnimation:$.noop},settings))}));return this}})(jQuery);
|
|
975
975
|
/*!
|
|
976
976
|
* jQuery UI Touch Punch 0.2.3
|
|
@@ -1809,7 +1809,7 @@ hooks.version="2.30.1";setHookCallback(createLocal);hooks.fn=proto;hooks.min=min
|
|
|
1809
1809
|
\***********************************/function(module,exports){var __WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;(function(root,factory){"use strict";if(true){!(__WEBPACK_AMD_DEFINE_ARRAY__=[],__WEBPACK_AMD_DEFINE_FACTORY__=factory,__WEBPACK_AMD_DEFINE_RESULT__=typeof __WEBPACK_AMD_DEFINE_FACTORY__==="function"?__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__):__WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_RESULT__!==undefined&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__))}else{}})(this,(function(CustomDOMParser){"use strict";return function X2JS(config){var VERSION="3.4.4";config=config||{};function initConfigDefaults(){config.arrayAccessForm=config.arrayAccessForm||"none";config.emptyNodeForm=config.emptyNodeForm||"text";config.jsAttributeFilter=config.jsAttributeFilter;config.jsAttributeConverter=config.jsAttributeConverter;config.attributeConverters=config.attributeConverters||[];config.datetimeAccessFormPaths=config.datetimeAccessFormPaths||[];config.arrayAccessFormPaths=config.arrayAccessFormPaths||[];config.xmldomOptions=config.xmldomOptions||{};if(config.enableToStringFunc===undefined){config.enableToStringFunc=true}if(config.skipEmptyTextNodesForObj===undefined){config.skipEmptyTextNodesForObj=true}if(config.stripWhitespaces===undefined){config.stripWhitespaces=true}if(config.useDoubleQuotes===undefined){config.useDoubleQuotes=true}if(config.ignoreRoot===undefined){config.ignoreRoot=false}if(config.escapeMode===undefined){config.escapeMode=true}if(config.attributePrefix===undefined){config.attributePrefix="_"}if(config.selfClosingElements===undefined){config.selfClosingElements=true}if(config.keepCData===undefined){config.keepCData=false}if(config.keepText===undefined){config.keepText=false}if(config.jsDateUTC===undefined){config.jsDateUTC=false}}function initRequiredPolyfills(){function pad(number){var r=String(number);if(r.length===1){r="0"+r}return r}if(typeof String.prototype.trim!=="function"){String.prototype.trim=function trim(){return this.replace(/^\s+|^\n+|(\s|\n)+$/g,"")}}if(typeof Date.prototype.toISOString!=="function"){Date.prototype.toISOString=function toISOString(){var MS_IN_S=1e3;return this.getUTCFullYear()+"-"+pad(this.getUTCMonth()+1)+"-"+pad(this.getUTCDate())+"T"+pad(this.getUTCHours())+":"+pad(this.getUTCMinutes())+":"+pad(this.getUTCSeconds())+"."+String((this.getUTCMilliseconds()/MS_IN_S).toFixed(3)).slice(2,5)+"Z"}}}initConfigDefaults();initRequiredPolyfills();var DOMNodeTypes={ELEMENT_NODE:1,TEXT_NODE:3,CDATA_SECTION_NODE:4,COMMENT_NODE:8,DOCUMENT_NODE:9};function getDomNodeLocalName(domNode){var localName=domNode.localName;if(localName==null){localName=domNode.baseName}if(localName==null||localName===""){localName=domNode.nodeName}return localName}function getDomNodeNamespacePrefix(node){return node.prefix}function escapeXmlChars(str){if(typeof str==="string")return str.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");else return str}function unescapeXmlChars(str){return str.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/&/g,"&")}function ensureProperArrayAccessForm(element,childName,elementPath){switch(config.arrayAccessForm){case"property":if(!(element[childName]instanceof Array))element[childName+"_asArray"]=[element[childName]];else element[childName+"_asArray"]=element[childName];break}if(!(element[childName]instanceof Array)&&config.arrayAccessFormPaths.length>0){var match=false;for(var i=0;i<config.arrayAccessFormPaths.length;i++){var arrayPath=config.arrayAccessFormPaths[i];if(typeof arrayPath==="string"){if(arrayPath===elementPath){match=true;break}}else if(arrayPath instanceof RegExp){if(arrayPath.test(elementPath)){match=true;break}}else if(typeof arrayPath==="function"){if(arrayPath(childName,elementPath)){match=true;break}}}if(match)element[childName]=[element[childName]]}}function xmlDateTimeToDate(prop){var MINUTES_PER_HOUR=60;var bits=prop.split(/[-T:+Z]/g);var d=new Date(bits[0],bits[1]-1,bits[2]);var secondBits=bits[5].split(".");d.setHours(bits[3],bits[4],secondBits[0]);if(secondBits.length>1)d.setMilliseconds(secondBits[1]);if(bits[6]&&bits[7]){var offsetMinutes=bits[6]*MINUTES_PER_HOUR+Number(bits[7]);var sign=/\d\d-\d\d:\d\d$/.test(prop)?"-":"+";offsetMinutes=0+(sign==="-"?-1*offsetMinutes:offsetMinutes);d.setMinutes(d.getMinutes()-offsetMinutes-d.getTimezoneOffset())}else if(prop.indexOf("Z",prop.length-1)!==-1){d=new Date(Date.UTC(d.getFullYear(),d.getMonth(),d.getDate(),d.getHours(),d.getMinutes(),d.getSeconds(),d.getMilliseconds()))}return d}function convertToDateIfRequired(value,childName,fullPath){if(config.datetimeAccessFormPaths.length>0){var pathWithoutTextNode=fullPath.split(".#")[0];for(var i=0;i<config.datetimeAccessFormPaths.length;i++){var candidatePath=config.datetimeAccessFormPaths[i];if(typeof candidatePath==="string"){if(candidatePath===pathWithoutTextNode)return xmlDateTimeToDate(value)}else if(candidatePath instanceof RegExp){if(candidatePath.test(pathWithoutTextNode))return xmlDateTimeToDate(value)}else if(typeof candidatePath==="function"){if(candidatePath(pathWithoutTextNode))return xmlDateTimeToDate(value)}}}return value}function deserializeRootElementChildren(rootElement){var result={};var children=rootElement.childNodes;for(var i=0;i<children.length;i++){var child=children.item(i);if(child.nodeType===DOMNodeTypes.ELEMENT_NODE){var childName=getDomNodeLocalName(child);if(config.ignoreRoot)result=deserializeDomChildren(child,childName);else result[childName]=deserializeDomChildren(child,childName)}}return result}function deserializeElementChildren(element,elementPath){var result={};result.__cnt=0;var nodeChildren=element.childNodes;for(var iChild=0;iChild<nodeChildren.length;iChild++){var child=nodeChildren.item(iChild);var childName=getDomNodeLocalName(child);if(child.nodeType===DOMNodeTypes.COMMENT_NODE)continue;result.__cnt++;if(result[childName]==null){result[childName]=deserializeDomChildren(child,elementPath+"."+childName);ensureProperArrayAccessForm(result,childName,elementPath+"."+childName)}else{if(!(result[childName]instanceof Array)){result[childName]=[result[childName]];ensureProperArrayAccessForm(result,childName,elementPath+"."+childName)}result[childName][result[childName].length]=deserializeDomChildren(child,elementPath+"."+childName)}}for(var iAttribute=0;iAttribute<element.attributes.length;iAttribute++){var attribute=element.attributes.item(iAttribute);result.__cnt++;var adjustedValue=attribute.value;for(var iConverter=0;iConverter<config.attributeConverters.length;iConverter++){var converter=config.attributeConverters[iConverter];if(converter.test.call(null,attribute.name,attribute.value))adjustedValue=converter.convert.call(null,attribute.name,attribute.value)}result[config.attributePrefix+attribute.name]=adjustedValue}var namespacePrefix=getDomNodeNamespacePrefix(element);if(namespacePrefix){result.__cnt++;result.__prefix=namespacePrefix}if(result["#text"]){result.__text=result["#text"];if(result.__text instanceof Array){result.__text=result.__text.join("\n")}if(config.escapeMode)result.__text=unescapeXmlChars(result.__text);if(config.stripWhitespaces)result.__text=result.__text.trim();delete result["#text"];if(config.arrayAccessForm==="property")delete result["#text_asArray"];result.__text=convertToDateIfRequired(result.__text,"#text",elementPath+".#text")}if(result.hasOwnProperty("#cdata-section")){result.__cdata=result["#cdata-section"];delete result["#cdata-section"];if(config.arrayAccessForm==="property")delete result["#cdata-section_asArray"]}if(result.__cnt===1&&result.__text&&!config.keepText){result=result.__text}else if(result.__cnt===0&&config.emptyNodeForm==="text"){result=""}else if(result.__cnt>1&&result.__text!==undefined&&config.skipEmptyTextNodesForObj){if(config.stripWhitespaces&&result.__text===""||result.__text.trim()===""){delete result.__text}}delete result.__cnt;if(!config.keepCData&&(!result.hasOwnProperty("__text")&&result.hasOwnProperty("__cdata")&&Object.keys(result).length===1)){return result.__cdata?result.__cdata:""}if(config.enableToStringFunc&&(result.__text||result.__cdata)){result.toString=function toString(){return(this.__text?this.__text:"")+(this.__cdata?this.__cdata:"")}}return result}function deserializeDomChildren(node,parentPath){if(node.nodeType===DOMNodeTypes.DOCUMENT_NODE){return deserializeRootElementChildren(node)}else if(node.nodeType===DOMNodeTypes.ELEMENT_NODE){return deserializeElementChildren(node,parentPath)}else if(node.nodeType===DOMNodeTypes.TEXT_NODE||node.nodeType===DOMNodeTypes.CDATA_SECTION_NODE){return node.nodeValue}else{return null}}function serializeStartTag(jsObject,elementName,attributeNames,selfClosing){var resultStr="<"+(jsObject&&jsObject.__prefix?jsObject.__prefix+":":"")+elementName;if(attributeNames){for(var i=0;i<attributeNames.length;i++){var attributeName=attributeNames[i];var attributeValue=jsObject[attributeName];if(config.escapeMode)attributeValue=escapeXmlChars(attributeValue);resultStr+=" "+attributeName.substr(config.attributePrefix.length)+"=";if(config.useDoubleQuotes)resultStr+='"'+attributeValue+'"';else resultStr+="'"+attributeValue+"'"}}if(!selfClosing)resultStr+=">";else resultStr+=" />";return resultStr}function serializeEndTag(jsObject,elementName){return"</"+(jsObject&&jsObject.__prefix?jsObject.__prefix+":":"")+elementName+">"}function endsWith(str,suffix){return str.indexOf(suffix,str.length-suffix.length)!==-1}function isSpecialProperty(jsonObj,propertyName){if(config.arrayAccessForm==="property"&&endsWith(propertyName.toString(),"_asArray")||propertyName.toString().indexOf(config.attributePrefix)===0||propertyName.toString().indexOf("__")===0||jsonObj[propertyName]instanceof Function)return true;else return false}function getDataElementCount(jsObject){var count=0;if(jsObject instanceof Object){for(var propertyName in jsObject){if(isSpecialProperty(jsObject,propertyName))continue;count++}}return count}function getDataAttributeNames(jsObject){var names=[];if(jsObject instanceof Object){for(var attributeName in jsObject){if(attributeName.toString().indexOf("__")===-1&&attributeName.toString().indexOf(config.attributePrefix)===0){names.push(attributeName)}}}return names}function serializeComplexTextNodeContents(textNode){var result="";if(textNode.__cdata){result+="<![CDATA["+textNode.__cdata+"]]>"}if(textNode.__text||typeof textNode.__text==="number"||typeof textNode.__text==="boolean"){if(config.escapeMode)result+=escapeXmlChars(textNode.__text);else result+=textNode.__text}return result}function serializeTextNodeContents(textNode){var result="";if(textNode instanceof Object){result+=serializeComplexTextNodeContents(textNode)}else if(textNode!==null){if(config.escapeMode)result+=escapeXmlChars(textNode);else result+=textNode}return result}function serializeArray(elementArray,elementName,attributes){var result="";if(elementArray.length===0){result+=serializeStartTag(elementArray,elementName,attributes,true)}else{for(var i=0;i<elementArray.length;i++){result+=serializeJavaScriptObject(elementArray[i],elementName,getDataAttributeNames(elementArray[i]))}}return result}function serializeJavaScriptObject(element,elementName,attributes){var result="";if(config.jsAttributeFilter&&config.jsAttributeFilter.call(null,elementName,element)){return result}if(config.jsAttributeConverter){element=config.jsAttributeConverter.call(null,elementName,element)}if((element===undefined||element===null||element==="")&&config.selfClosingElements){result+=serializeStartTag(element,elementName,attributes,true)}else if(typeof element==="object"){if(Object.prototype.toString.call(element)==="[object Array]"){result+=serializeArray(element,elementName,attributes)}else if(element instanceof Date){result+=serializeStartTag(element,elementName,attributes,false);result+=config.jsDateUTC?element.toUTCString():element.toISOString();result+=serializeEndTag(element,elementName)}else{var childElementCount=getDataElementCount(element);if(childElementCount>0||typeof element.__text==="number"||typeof element.__text==="boolean"||element.__text||element.__cdata){result+=serializeStartTag(element,elementName,attributes,false);result+=serializeJavaScriptObjectChildren(element);result+=serializeEndTag(element,elementName)}else if(config.selfClosingElements){result+=serializeStartTag(element,elementName,attributes,true)}else{result+=serializeStartTag(element,elementName,attributes,false);result+=serializeEndTag(element,elementName)}}}else{result+=serializeStartTag(element,elementName,attributes,false);result+=serializeTextNodeContents(element);result+=serializeEndTag(element,elementName)}return result}function serializeJavaScriptObjectChildren(jsObject){var result="";var elementCount=getDataElementCount(jsObject);if(elementCount>0){for(var elementName in jsObject){if(isSpecialProperty(jsObject,elementName))continue;var element=jsObject[elementName];var attributes=getDataAttributeNames(element);result+=serializeJavaScriptObject(element,elementName,attributes)}}result+=serializeTextNodeContents(jsObject);return result}function parseXml(xml){if(xml===undefined){return null}if(typeof xml!=="string"){return null}var parser=null;var domNode=null;if(CustomDOMParser){parser=new CustomDOMParser(config.xmldomOptions);domNode=parser.parseFromString(xml,"text/xml")}else if(window&&window.DOMParser){parser=new window.DOMParser;var parsererrorNS=null;var isIEParser=window.ActiveXObject||"ActiveXObject"in window;if(!isIEParser&&document.all&&!document.addEventListener){try{parsererrorNS=parser.parseFromString("INVALID","text/xml").childNodes[0].namespaceURI}catch(err){parsererrorNS=null}}try{domNode=parser.parseFromString(xml,"text/xml");if(parsererrorNS!==null&&domNode.getElementsByTagNameNS(parsererrorNS,"parsererror").length>0){domNode=null}}catch(err){domNode=null}}else{if(xml.indexOf("<?")===0){xml=xml.substr(xml.indexOf("?>")+2)}domNode=new ActiveXObject("Microsoft.XMLDOM");domNode.async="false";domNode.loadXML(xml)}return domNode}this.asArray=function asArray(prop){if(prop===undefined||prop===null){return[]}else if(prop instanceof Array){return prop}else{return[prop]}};this.toXmlDateTime=function toXmlDateTime(dt){if(dt instanceof Date){return dt.toISOString()}else if(typeof dt==="number"){return new Date(dt).toISOString()}else{return null}};this.asDateTime=function asDateTime(prop){if(typeof prop==="string"){return xmlDateTimeToDate(prop)}else{return prop}};this.xml2dom=function xml2dom(xml){return parseXml(xml)};this.dom2js=function dom2js(domNode){return deserializeDomChildren(domNode,null)};this.js2dom=function js2dom(jsObject){var xml=this.js2xml(jsObject);return parseXml(xml)};this.xml2js=function xml2js(xml){var domNode=parseXml(xml);if(domNode!=null)return this.dom2js(domNode);else return null};this.js2xml=function js2xml(jsObject){return serializeJavaScriptObjectChildren(jsObject)};this.getVersion=function getVersion(){return VERSION}}}))}};var __webpack_module_cache__={};function __webpack_require__(moduleId){var cachedModule=__webpack_module_cache__[moduleId];if(cachedModule!==undefined){return cachedModule.exports}var module=__webpack_module_cache__[moduleId]={id:moduleId,loaded:false,exports:{}};__webpack_modules__[moduleId].call(module.exports,module,module.exports,__webpack_require__);module.loaded=true;return module.exports}(()=>{__webpack_require__.n=module=>{var getter=module&&module.__esModule?()=>module["default"]:()=>module;__webpack_require__.d(getter,{a:getter});return getter}})();(()=>{__webpack_require__.d=(exports,definition)=>{for(var key in definition){if(__webpack_require__.o(definition,key)&&!__webpack_require__.o(exports,key)){Object.defineProperty(exports,key,{enumerable:true,get:definition[key]})}}}})();(()=>{__webpack_require__.g=function(){if(typeof globalThis==="object")return globalThis;try{return this||new Function("return this")()}catch(e){if(typeof window==="object")return window}}()})();(()=>{__webpack_require__.o=(obj,prop)=>Object.prototype.hasOwnProperty.call(obj,prop)})();(()=>{__webpack_require__.r=exports=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(exports,"__esModule",{value:true})}})();(()=>{__webpack_require__.nmd=module=>{module.paths=[];if(!module.children)module.children=[];return module}})();var __webpack_exports__={};(()=>{"use strict";
|
|
1810
1810
|
/*!******************!*\
|
|
1811
1811
|
!*** ./index.ts ***!
|
|
1812
|
-
\******************/__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{$rootScope:()=>_src_constants_variables_constants__WEBPACK_IMPORTED_MODULE_0__.$rootScope,ApiAwareVariable:()=>_src_model_variable_api_aware_variable__WEBPACK_IMPORTED_MODULE_3__.ApiAwareVariable,BaseAction:()=>_src_model_base_action__WEBPACK_IMPORTED_MODULE_2__.BaseAction,CONSTANTS:()=>_src_constants_variables_constants__WEBPACK_IMPORTED_MODULE_0__.CONSTANTS,CrudVariable:()=>_src_model_variable_crud_variable__WEBPACK_IMPORTED_MODULE_7__.CrudVariable,DB_CONSTANTS:()=>_src_constants_variables_constants__WEBPACK_IMPORTED_MODULE_0__.DB_CONSTANTS,LVService:()=>_src_util_variable_live_variable_http_utils__WEBPACK_IMPORTED_MODULE_10__.LVService,LiveVariable:()=>_src_model_variable_live_variable__WEBPACK_IMPORTED_MODULE_8__.LiveVariable,LiveVariableUtils:()=>_src_util_variable_live_variable_utils__WEBPACK_IMPORTED_MODULE_11__.LiveVariableUtils,ModelVariable:()=>_src_model_variable_model_variable__WEBPACK_IMPORTED_MODULE_5__.ModelVariable,SWAGGER_CONSTANTS:()=>_src_constants_variables_constants__WEBPACK_IMPORTED_MODULE_0__.SWAGGER_CONSTANTS,ServiceVariable:()=>_src_model_variable_service_variable__WEBPACK_IMPORTED_MODULE_6__.ServiceVariable,TEST:()=>TEST,TimerAction:()=>_src_model_action_timer_action__WEBPACK_IMPORTED_MODULE_4__.TimerAction,VARIABLE_CONSTANTS:()=>_src_constants_variables_constants__WEBPACK_IMPORTED_MODULE_0__.VARIABLE_CONSTANTS,VARIABLE_URLS:()=>_src_constants_variables_constants__WEBPACK_IMPORTED_MODULE_0__.VARIABLE_URLS,WS_CONSTANTS:()=>_src_constants_variables_constants__WEBPACK_IMPORTED_MODULE_0__.WS_CONSTANTS,appManager:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.appManager,debounceVariableCall:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.debounceVariableCall,decodeData:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.decodeData,dialogService:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.dialogService,formatDate:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.formatDate,formatExportExpression:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.formatExportExpression,generateConnectionParams:()=>_src_util_variable_live_variable_http_utils__WEBPACK_IMPORTED_MODULE_10__.generateConnectionParams,getBlob:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.getBlob,getErrMessage:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.getErrMessage,getEvaluatedOrderBy:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.getEvaluatedOrderBy,getTarget:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.getTarget,getTargetNodeKey:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.getTargetNodeKey,getTargetObj:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.getTargetObj,httpService:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.httpService,initiateCallback:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.initiateCallback,internalBoundNodeMap:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.internalBoundNodeMap,isFileUploadSupported:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.isFileUploadSupported,metadataService:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.metadataService,navigationService:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.navigationService,oauthService:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.oauthService,parseConfig:()=>_src_util_variable_live_variable_http_utils__WEBPACK_IMPORTED_MODULE_10__.parseConfig,routerService:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.routerService,securityService:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.securityService,setInput:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.setInput,setValueToNode:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.setValueToNode,toasterService:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.toasterService,updateInternalNodes:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.updateInternalNodes,wmSetDependency:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.wmSetDependency});var _src_constants_variables_constants__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(/*! ./src/constants/variables.constants */"./src/constants/variables.constants.ts");var _src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(/*! ./src/util/variable/variables.utils */"./src/util/variable/variables.utils.ts");var _src_model_base_action__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(/*! ./src/model/base-action */"./src/model/base-action.ts");var _src_model_variable_api_aware_variable__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(/*! ./src/model/variable/api-aware-variable */"./src/model/variable/api-aware-variable.ts");var _src_model_action_timer_action__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(/*! ./src/model/action/timer-action */"./src/model/action/timer-action.ts");var _src_model_variable_model_variable__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(/*! ./src/model/variable/model-variable */"./src/model/variable/model-variable.ts");var _src_model_variable_service_variable__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(/*! ./src/model/variable/service-variable */"./src/model/variable/service-variable.ts");var _src_model_variable_crud_variable__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(/*! ./src/model/variable/crud-variable */"./src/model/variable/crud-variable.ts");var _src_model_variable_live_variable__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(/*! ./src/model/variable/live-variable */"./src/model/variable/live-variable.ts");var _src_types_http_client_service__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(/*! ./src/types/http-client.service */"./src/types/http-client.service.ts");var _src_util_variable_live_variable_http_utils__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(/*! ./src/util/variable/live-variable.http.utils */"./src/util/variable/live-variable.http.utils.ts");var _src_util_variable_live_variable_utils__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(/*! ./src/util/variable/live-variable.utils */"./src/util/variable/live-variable.utils.ts");var _src_types_date_formatter__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(/*! ./src/types/date-formatter */"./src/types/date-formatter.ts");var TEST="hello from variables"})();return __webpack_exports__})()));(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?factory(exports):typeof define==="function"&&define.amd?define(["exports"],factory):(global=typeof globalThis!=="undefined"?globalThis:global||self,factory(global.jmespath={}))})(this,(function(exports){"use strict";const isObject=obj=>obj!==null&&Object.prototype.toString.call(obj)==="[object Object]";const strictDeepEqual=(first,second)=>{if(first===second){return true}if(typeof first!==typeof second){return false}if(Array.isArray(first)&&Array.isArray(second)){if(first.length!==second.length){return false}for(let i=0;i<first.length;i+=1){if(!strictDeepEqual(first[i],second[i])){return false}}return true}if(isObject(first)&&isObject(second)){const firstEntries=Object.entries(first);const secondKeys=new Set(Object.keys(second));if(firstEntries.length!==secondKeys.size){return false}for(const[key,value]of firstEntries){if(!strictDeepEqual(value,second[key])){return false}secondKeys.delete(key)}return secondKeys.size===0}return false};const isFalse=obj=>{if(obj===""||obj===false||obj===null||obj===undefined){return true}if(Array.isArray(obj)&&obj.length===0){return true}if(isObject(obj)){for(const key in obj){if(obj.hasOwnProperty(key)){return false}}return true}return false};const isAlpha=ch=>ch>="a"&&ch<="z"||ch>="A"&&ch<="Z"||ch==="_";const isNum=ch=>ch>="0"&&ch<="9"||ch==="-";const isAlphaNum=ch=>ch>="a"&&ch<="z"||ch>="A"&&ch<="Z"||ch>="0"&&ch<="9"||ch==="_";var Token;(function(Token){Token["TOK_EOF"]="EOF";Token["TOK_UNQUOTEDIDENTIFIER"]="UnquotedIdentifier";Token["TOK_QUOTEDIDENTIFIER"]="QuotedIdentifier";Token["TOK_RBRACKET"]="Rbracket";Token["TOK_RPAREN"]="Rparen";Token["TOK_COMMA"]="Comma";Token["TOK_COLON"]="Colon";Token["TOK_RBRACE"]="Rbrace";Token["TOK_NUMBER"]="Number";Token["TOK_CURRENT"]="Current";Token["TOK_ROOT"]="Root";Token["TOK_EXPREF"]="Expref";Token["TOK_PIPE"]="Pipe";Token["TOK_OR"]="Or";Token["TOK_AND"]="And";Token["TOK_EQ"]="EQ";Token["TOK_GT"]="GT";Token["TOK_LT"]="LT";Token["TOK_GTE"]="GTE";Token["TOK_LTE"]="LTE";Token["TOK_NE"]="NE";Token["TOK_FLATTEN"]="Flatten";Token["TOK_STAR"]="Star";Token["TOK_FILTER"]="Filter";Token["TOK_DOT"]="Dot";Token["TOK_NOT"]="Not";Token["TOK_LBRACE"]="Lbrace";Token["TOK_LBRACKET"]="Lbracket";Token["TOK_LPAREN"]="Lparen";Token["TOK_LITERAL"]="Literal"})(Token||(Token={}));const basicTokens={"(":Token.TOK_LPAREN,")":Token.TOK_RPAREN,"*":Token.TOK_STAR,",":Token.TOK_COMMA,".":Token.TOK_DOT,":":Token.TOK_COLON,"@":Token.TOK_CURRENT,["$"]:Token.TOK_ROOT,"]":Token.TOK_RBRACKET,"{":Token.TOK_LBRACE,"}":Token.TOK_RBRACE};const operatorStartToken={"!":true,"<":true,"=":true,">":true};const skipChars={"\t":true,"\n":true,"\r":true," ":true};class StreamLexer{constructor(){this._current=0}tokenize(stream){const tokens=[];this._current=0;let start;let identifier;let token;while(this._current<stream.length){if(isAlpha(stream[this._current])){start=this._current;identifier=this.consumeUnquotedIdentifier(stream);tokens.push({start:start,type:Token.TOK_UNQUOTEDIDENTIFIER,value:identifier})}else if(basicTokens[stream[this._current]]!==undefined){tokens.push({start:this._current,type:basicTokens[stream[this._current]],value:stream[this._current]});this._current+=1}else if(isNum(stream[this._current])){token=this.consumeNumber(stream);tokens.push(token)}else if(stream[this._current]==="["){token=this.consumeLBracket(stream);tokens.push(token)}else if(stream[this._current]==='"'){start=this._current;identifier=this.consumeQuotedIdentifier(stream);tokens.push({start:start,type:Token.TOK_QUOTEDIDENTIFIER,value:identifier})}else if(stream[this._current]===`'`){start=this._current;identifier=this.consumeRawStringLiteral(stream);tokens.push({start:start,type:Token.TOK_LITERAL,value:identifier})}else if(stream[this._current]==="`"){start=this._current;const literal=this.consumeLiteral(stream);tokens.push({start:start,type:Token.TOK_LITERAL,value:literal})}else if(operatorStartToken[stream[this._current]]!==undefined){token=this.consumeOperator(stream);token&&tokens.push(token)}else if(skipChars[stream[this._current]]!==undefined){this._current+=1}else if(stream[this._current]==="&"){start=this._current;this._current+=1;if(stream[this._current]==="&"){this._current+=1;tokens.push({start:start,type:Token.TOK_AND,value:"&&"})}else{tokens.push({start:start,type:Token.TOK_EXPREF,value:"&"})}}else if(stream[this._current]==="|"){start=this._current;this._current+=1;if(stream[this._current]==="|"){this._current+=1;tokens.push({start:start,type:Token.TOK_OR,value:"||"})}else{tokens.push({start:start,type:Token.TOK_PIPE,value:"|"})}}else{const error=new Error(`Unknown character: ${stream[this._current]}`);error.name="LexerError";throw error}}return tokens}consumeUnquotedIdentifier(stream){const start=this._current;this._current+=1;while(this._current<stream.length&&isAlphaNum(stream[this._current])){this._current+=1}return stream.slice(start,this._current)}consumeQuotedIdentifier(stream){const start=this._current;this._current+=1;const maxLength=stream.length;while(stream[this._current]!=='"'&&this._current<maxLength){let current=this._current;if(stream[current]==="\\"&&(stream[current+1]==="\\"||stream[current+1]==='"')){current+=2}else{current+=1}this._current=current}this._current+=1;return JSON.parse(stream.slice(start,this._current))}consumeRawStringLiteral(stream){const start=this._current;this._current+=1;const maxLength=stream.length;while(stream[this._current]!==`'`&&this._current<maxLength){let current=this._current;if(stream[current]==="\\"&&(stream[current+1]==="\\"||stream[current+1]===`'`)){current+=2}else{current+=1}this._current=current}this._current+=1;const literal=stream.slice(start+1,this._current-1);return literal.replace(`\\'`,`'`)}consumeNumber(stream){const start=this._current;this._current+=1;const maxLength=stream.length;while(isNum(stream[this._current])&&this._current<maxLength){this._current+=1}const value=parseInt(stream.slice(start,this._current),10);return{start:start,value:value,type:Token.TOK_NUMBER}}consumeLBracket(stream){const start=this._current;this._current+=1;if(stream[this._current]==="?"){this._current+=1;return{start:start,type:Token.TOK_FILTER,value:"[?"}}if(stream[this._current]==="]"){this._current+=1;return{start:start,type:Token.TOK_FLATTEN,value:"[]"}}return{start:start,type:Token.TOK_LBRACKET,value:"["}}consumeOperator(stream){const start=this._current;const startingChar=stream[start];this._current+=1;if(startingChar==="!"){if(stream[this._current]==="="){this._current+=1;return{start:start,type:Token.TOK_NE,value:"!="}}return{start:start,type:Token.TOK_NOT,value:"!"}}if(startingChar==="<"){if(stream[this._current]==="="){this._current+=1;return{start:start,type:Token.TOK_LTE,value:"<="}}return{start:start,type:Token.TOK_LT,value:"<"}}if(startingChar===">"){if(stream[this._current]==="="){this._current+=1;return{start:start,type:Token.TOK_GTE,value:">="}}return{start:start,type:Token.TOK_GT,value:">"}}if(startingChar==="="&&stream[this._current]==="="){this._current+=1;return{start:start,type:Token.TOK_EQ,value:"=="}}}consumeLiteral(stream){this._current+=1;const start=this._current;const maxLength=stream.length;while(stream[this._current]!=="`"&&this._current<maxLength){let current=this._current;if(stream[current]==="\\"&&(stream[current+1]==="\\"||stream[current+1]==="`")){current+=2}else{current+=1}this._current=current}let literalString=stream.slice(start,this._current).trimLeft();literalString=literalString.replace("\\`","`");const literal=this.looksLikeJSON(literalString)?JSON.parse(literalString):JSON.parse(`"${literalString}"`);this._current+=1;return literal}looksLikeJSON(literalString){const startingChars='[{"';const jsonLiterals=["true","false","null"];const numberLooking="-0123456789";if(literalString===""){return false}if(startingChars.includes(literalString[0])){return true}if(jsonLiterals.includes(literalString)){return true}if(numberLooking.includes(literalString[0])){try{JSON.parse(literalString);return true}catch(ex){return false}}return false}}const Lexer=new StreamLexer;const bindingPower={[Token.TOK_EOF]:0,[Token.TOK_UNQUOTEDIDENTIFIER]:0,[Token.TOK_QUOTEDIDENTIFIER]:0,[Token.TOK_RBRACKET]:0,[Token.TOK_RPAREN]:0,[Token.TOK_COMMA]:0,[Token.TOK_RBRACE]:0,[Token.TOK_NUMBER]:0,[Token.TOK_CURRENT]:0,[Token.TOK_EXPREF]:0,[Token.TOK_ROOT]:0,[Token.TOK_PIPE]:1,[Token.TOK_OR]:2,[Token.TOK_AND]:3,[Token.TOK_EQ]:5,[Token.TOK_GT]:5,[Token.TOK_LT]:5,[Token.TOK_GTE]:5,[Token.TOK_LTE]:5,[Token.TOK_NE]:5,[Token.TOK_FLATTEN]:9,[Token.TOK_STAR]:20,[Token.TOK_FILTER]:21,[Token.TOK_DOT]:40,[Token.TOK_NOT]:45,[Token.TOK_LBRACE]:50,[Token.TOK_LBRACKET]:55,[Token.TOK_LPAREN]:60};class TokenParser{constructor(){this.index=0;this.tokens=[]}parse(expression){this.loadTokens(expression);this.index=0;const ast=this.expression(0);if(this.lookahead(0)!==Token.TOK_EOF){const token=this.lookaheadToken(0);this.errorToken(token,`Unexpected token type: ${token.type}, value: ${token.value}`)}return ast}loadTokens(expression){this.tokens=[...Lexer.tokenize(expression),{type:Token.TOK_EOF,value:"",start:expression.length}]}expression(rbp){const leftToken=this.lookaheadToken(0);this.advance();let left=this.nud(leftToken);let currentTokenType=this.lookahead(0);while(rbp<bindingPower[currentTokenType]){this.advance();left=this.led(currentTokenType,left);currentTokenType=this.lookahead(0)}return left}lookahead(offset){return this.tokens[this.index+offset].type}lookaheadToken(offset){return this.tokens[this.index+offset]}advance(){this.index+=1}nud(token){let left;let right;let expression;switch(token.type){case Token.TOK_LITERAL:return{type:"Literal",value:token.value};case Token.TOK_UNQUOTEDIDENTIFIER:return{type:"Field",name:token.value};case Token.TOK_QUOTEDIDENTIFIER:const node={type:"Field",name:token.value};if(this.lookahead(0)===Token.TOK_LPAREN){throw new Error("Quoted identifier not allowed for function names.")}else{return node}case Token.TOK_NOT:right=this.expression(bindingPower.Not);return{type:"NotExpression",children:[right]};case Token.TOK_STAR:left={type:"Identity"};right=this.lookahead(0)===Token.TOK_RBRACKET&&{type:"Identity"}||this.parseProjectionRHS(bindingPower.Star);return{type:"ValueProjection",children:[left,right]};case Token.TOK_FILTER:return this.led(token.type,{type:"Identity"});case Token.TOK_LBRACE:return this.parseMultiselectHash();case Token.TOK_FLATTEN:left={type:Token.TOK_FLATTEN,children:[{type:"Identity"}]};right=this.parseProjectionRHS(bindingPower.Flatten);return{type:"Projection",children:[left,right]};case Token.TOK_LBRACKET:if(this.lookahead(0)===Token.TOK_NUMBER||this.lookahead(0)===Token.TOK_COLON){right=this.parseIndexExpression();return this.projectIfSlice({type:"Identity"},right)}if(this.lookahead(0)===Token.TOK_STAR&&this.lookahead(1)===Token.TOK_RBRACKET){this.advance();this.advance();right=this.parseProjectionRHS(bindingPower.Star);return{children:[{type:"Identity"},right],type:"Projection"}}return this.parseMultiselectList();case Token.TOK_CURRENT:return{type:Token.TOK_CURRENT};case Token.TOK_ROOT:return{type:Token.TOK_ROOT};case Token.TOK_EXPREF:expression=this.expression(bindingPower.Expref);return{type:"ExpressionReference",children:[expression]};case Token.TOK_LPAREN:const args=[];while(this.lookahead(0)!==Token.TOK_RPAREN){if(this.lookahead(0)===Token.TOK_CURRENT){expression={type:Token.TOK_CURRENT};this.advance()}else{expression=this.expression(0)}args.push(expression)}this.match(Token.TOK_RPAREN);return args[0];default:this.errorToken(token)}}led(tokenName,left){let right;switch(tokenName){case Token.TOK_DOT:const rbp=bindingPower.Dot;if(this.lookahead(0)!==Token.TOK_STAR){right=this.parseDotRHS(rbp);return{type:"Subexpression",children:[left,right]}}this.advance();right=this.parseProjectionRHS(rbp);return{type:"ValueProjection",children:[left,right]};case Token.TOK_PIPE:right=this.expression(bindingPower.Pipe);return{type:Token.TOK_PIPE,children:[left,right]};case Token.TOK_OR:right=this.expression(bindingPower.Or);return{type:"OrExpression",children:[left,right]};case Token.TOK_AND:right=this.expression(bindingPower.And);return{type:"AndExpression",children:[left,right]};case Token.TOK_LPAREN:const name=left.name;const args=[];let expression;while(this.lookahead(0)!==Token.TOK_RPAREN){if(this.lookahead(0)===Token.TOK_CURRENT){expression={type:Token.TOK_CURRENT};this.advance()}else{expression=this.expression(0)}if(this.lookahead(0)===Token.TOK_COMMA){this.match(Token.TOK_COMMA)}args.push(expression)}this.match(Token.TOK_RPAREN);const node={name:name,type:"Function",children:args};return node;case Token.TOK_FILTER:const condition=this.expression(0);this.match(Token.TOK_RBRACKET);right=this.lookahead(0)===Token.TOK_FLATTEN&&{type:"Identity"}||this.parseProjectionRHS(bindingPower.Filter);return{type:"FilterProjection",children:[left,right,condition]};case Token.TOK_FLATTEN:const leftNode={type:Token.TOK_FLATTEN,children:[left]};const rightNode=this.parseProjectionRHS(bindingPower.Flatten);return{type:"Projection",children:[leftNode,rightNode]};case Token.TOK_EQ:case Token.TOK_NE:case Token.TOK_GT:case Token.TOK_GTE:case Token.TOK_LT:case Token.TOK_LTE:return this.parseComparator(left,tokenName);case Token.TOK_LBRACKET:const token=this.lookaheadToken(0);if(token.type===Token.TOK_NUMBER||token.type===Token.TOK_COLON){right=this.parseIndexExpression();return this.projectIfSlice(left,right)}this.match(Token.TOK_STAR);this.match(Token.TOK_RBRACKET);right=this.parseProjectionRHS(bindingPower.Star);return{type:"Projection",children:[left,right]};default:return this.errorToken(this.lookaheadToken(0))}}match(tokenType){if(this.lookahead(0)===tokenType){this.advance();return}else{const token=this.lookaheadToken(0);this.errorToken(token,`Expected ${tokenType}, got: ${token.type}`)}}errorToken(token,message=""){const error=new Error(message||`Invalid token (${token.type}): "${token.value}"`);error.name="ParserError";throw error}parseIndexExpression(){if(this.lookahead(0)===Token.TOK_COLON||this.lookahead(1)===Token.TOK_COLON){return this.parseSliceExpression()}const node={type:"Index",value:this.lookaheadToken(0).value};this.advance();this.match(Token.TOK_RBRACKET);return node}projectIfSlice(left,right){const indexExpr={type:"IndexExpression",children:[left,right]};if(right.type==="Slice"){return{children:[indexExpr,this.parseProjectionRHS(bindingPower.Star)],type:"Projection"}}return indexExpr}parseSliceExpression(){const parts=[null,null,null];let index=0;let currentTokenType=this.lookahead(0);while(currentTokenType!==Token.TOK_RBRACKET&&index<3){if(currentTokenType===Token.TOK_COLON){index+=1;this.advance()}else if(currentTokenType===Token.TOK_NUMBER){parts[index]=this.lookaheadToken(0).value;this.advance()}else{const token=this.lookaheadToken(0);this.errorToken(token,`Syntax error, unexpected token: ${token.value}(${token.type})`)}currentTokenType=this.lookahead(0)}this.match(Token.TOK_RBRACKET);return{children:parts,type:"Slice"}}parseComparator(left,comparator){const right=this.expression(bindingPower[comparator]);return{type:"Comparator",name:comparator,children:[left,right]}}parseDotRHS(rbp){const lookahead=this.lookahead(0);const exprTokens=[Token.TOK_UNQUOTEDIDENTIFIER,Token.TOK_QUOTEDIDENTIFIER,Token.TOK_STAR];if(exprTokens.includes(lookahead)){return this.expression(rbp)}if(lookahead===Token.TOK_LBRACKET){this.match(Token.TOK_LBRACKET);return this.parseMultiselectList()}if(lookahead===Token.TOK_LBRACE){this.match(Token.TOK_LBRACE);return this.parseMultiselectHash()}const token=this.lookaheadToken(0);this.errorToken(token,`Syntax error, unexpected token: ${token.value}(${token.type})`)}parseProjectionRHS(rbp){if(bindingPower[this.lookahead(0)]<10){return{type:"Identity"}}if(this.lookahead(0)===Token.TOK_LBRACKET){return this.expression(rbp)}if(this.lookahead(0)===Token.TOK_FILTER){return this.expression(rbp)}if(this.lookahead(0)===Token.TOK_DOT){this.match(Token.TOK_DOT);return this.parseDotRHS(rbp)}const token=this.lookaheadToken(0);this.errorToken(token,`Syntax error, unexpected token: ${token.value}(${token.type})`)}parseMultiselectList(){const expressions=[];while(this.lookahead(0)!==Token.TOK_RBRACKET){const expression=this.expression(0);expressions.push(expression);if(this.lookahead(0)===Token.TOK_COMMA){this.match(Token.TOK_COMMA);if(this.lookahead(0)===Token.TOK_RBRACKET){throw new Error("Unexpected token Rbracket")}}}this.match(Token.TOK_RBRACKET);return{type:"MultiSelectList",children:expressions}}parseMultiselectHash(){const pairs=[];const identifierTypes=[Token.TOK_UNQUOTEDIDENTIFIER,Token.TOK_QUOTEDIDENTIFIER];let keyToken;let keyName;let value;for(;;){keyToken=this.lookaheadToken(0);if(!identifierTypes.includes(keyToken.type)){throw new Error(`Expecting an identifier token, got: ${keyToken.type}`)}keyName=keyToken.value;this.advance();this.match(Token.TOK_COLON);value=this.expression(0);pairs.push({value:value,type:"KeyValuePair",name:keyName});if(this.lookahead(0)===Token.TOK_COMMA){this.match(Token.TOK_COMMA)}else if(this.lookahead(0)===Token.TOK_RBRACE){this.match(Token.TOK_RBRACE);break}}return{type:"MultiSelectHash",children:pairs}}}const Parser=new TokenParser;var InputArgument;(function(InputArgument){InputArgument[InputArgument["TYPE_NUMBER"]=0]="TYPE_NUMBER";InputArgument[InputArgument["TYPE_ANY"]=1]="TYPE_ANY";InputArgument[InputArgument["TYPE_STRING"]=2]="TYPE_STRING";InputArgument[InputArgument["TYPE_ARRAY"]=3]="TYPE_ARRAY";InputArgument[InputArgument["TYPE_OBJECT"]=4]="TYPE_OBJECT";InputArgument[InputArgument["TYPE_BOOLEAN"]=5]="TYPE_BOOLEAN";InputArgument[InputArgument["TYPE_EXPREF"]=6]="TYPE_EXPREF";InputArgument[InputArgument["TYPE_NULL"]=7]="TYPE_NULL";InputArgument[InputArgument["TYPE_ARRAY_NUMBER"]=8]="TYPE_ARRAY_NUMBER";InputArgument[InputArgument["TYPE_ARRAY_STRING"]=9]="TYPE_ARRAY_STRING"})(InputArgument||(InputArgument={}));class Runtime{constructor(interpreter){this.TYPE_NAME_TABLE={[InputArgument.TYPE_NUMBER]:"number",[InputArgument.TYPE_ANY]:"any",[InputArgument.TYPE_STRING]:"string",[InputArgument.TYPE_ARRAY]:"array",[InputArgument.TYPE_OBJECT]:"object",[InputArgument.TYPE_BOOLEAN]:"boolean",[InputArgument.TYPE_EXPREF]:"expression",[InputArgument.TYPE_NULL]:"null",[InputArgument.TYPE_ARRAY_NUMBER]:"Array<number>",[InputArgument.TYPE_ARRAY_STRING]:"Array<string>"};this.functionAbs=([inputValue])=>Math.abs(inputValue);this.functionAvg=([inputArray])=>{let sum=0;for(let i=0;i<inputArray.length;i+=1){sum+=inputArray[i]}return sum/inputArray.length};this.functionCeil=([inputValue])=>Math.ceil(inputValue);this.functionContains=resolvedArgs=>{const[searchable,searchValue]=resolvedArgs;return searchable.includes(searchValue)};this.functionEndsWith=resolvedArgs=>{const[searchStr,suffix]=resolvedArgs;return searchStr.includes(suffix,searchStr.length-suffix.length)};this.functionFloor=([inputValue])=>Math.floor(inputValue);this.functionJoin=resolvedArgs=>{const[joinChar,listJoin]=resolvedArgs;return listJoin.join(joinChar)};this.functionKeys=([inputObject])=>Object.keys(inputObject);this.functionLength=([inputValue])=>{if(!isObject(inputValue)){return inputValue.length}return Object.keys(inputValue).length};this.functionMap=resolvedArgs=>{if(!this._interpreter){return[]}const mapped=[];const interpreter=this._interpreter;const exprefNode=resolvedArgs[0];const elements=resolvedArgs[1];for(let i=0;i<elements.length;i+=1){mapped.push(interpreter.visit(exprefNode,elements[i]))}return mapped};this.functionMax=([inputValue])=>{if(!inputValue.length){return null}const typeName=this.getTypeName(inputValue[0]);if(typeName===InputArgument.TYPE_NUMBER){return Math.max(...inputValue)}const elements=inputValue;let maxElement=elements[0];for(let i=1;i<elements.length;i+=1){if(maxElement.localeCompare(elements[i])<0){maxElement=elements[i]}}return maxElement};this.functionMaxBy=resolvedArgs=>{const exprefNode=resolvedArgs[1];const resolvedArray=resolvedArgs[0];const keyFunction=this.createKeyFunction(exprefNode,[InputArgument.TYPE_NUMBER,InputArgument.TYPE_STRING]);let maxNumber=-Infinity;let maxRecord;let current;for(let i=0;i<resolvedArray.length;i+=1){current=keyFunction&&keyFunction(resolvedArray[i]);if(current!==undefined&¤t>maxNumber){maxNumber=current;maxRecord=resolvedArray[i]}}return maxRecord};this.functionMerge=resolvedArgs=>{let merged={};for(let i=0;i<resolvedArgs.length;i+=1){const current=resolvedArgs[i];merged=Object.assign(merged,current)}return merged};this.functionMin=([inputValue])=>{if(!inputValue.length){return null}const typeName=this.getTypeName(inputValue[0]);if(typeName===InputArgument.TYPE_NUMBER){return Math.min(...inputValue)}const elements=inputValue;let minElement=elements[0];for(let i=1;i<elements.length;i+=1){if(elements[i].localeCompare(minElement)<0){minElement=elements[i]}}return minElement};this.functionMinBy=resolvedArgs=>{const exprefNode=resolvedArgs[1];const resolvedArray=resolvedArgs[0];const keyFunction=this.createKeyFunction(exprefNode,[InputArgument.TYPE_NUMBER,InputArgument.TYPE_STRING]);let minNumber=Infinity;let minRecord;let current;for(let i=0;i<resolvedArray.length;i+=1){current=keyFunction&&keyFunction(resolvedArray[i]);if(current!==undefined&¤t<minNumber){minNumber=current;minRecord=resolvedArray[i]}}return minRecord};this.functionNotNull=resolvedArgs=>{for(let i=0;i<resolvedArgs.length;i+=1){if(this.getTypeName(resolvedArgs[i])!==InputArgument.TYPE_NULL){return resolvedArgs[i]}}return null};this.functionReverse=([inputValue])=>{const typeName=this.getTypeName(inputValue);if(typeName===InputArgument.TYPE_STRING){const originalStr=inputValue;let reversedStr="";for(let i=originalStr.length-1;i>=0;i-=1){reversedStr+=originalStr[i]}return reversedStr}const reversedArray=inputValue.slice(0);reversedArray.reverse();return reversedArray};this.functionSort=([inputValue])=>[...inputValue].sort();this.functionSortBy=resolvedArgs=>{if(!this._interpreter){return[]}const sortedArray=resolvedArgs[0].slice(0);if(sortedArray.length===0){return sortedArray}const interpreter=this._interpreter;const exprefNode=resolvedArgs[1];const requiredType=this.getTypeName(interpreter.visit(exprefNode,sortedArray[0]));if(requiredType!==undefined&&![InputArgument.TYPE_NUMBER,InputArgument.TYPE_STRING].includes(requiredType)){throw new Error(`TypeError: unexpected type (${this.TYPE_NAME_TABLE[requiredType]})`)}const decorated=[];for(let i=0;i<sortedArray.length;i+=1){decorated.push([i,sortedArray[i]])}decorated.sort(((a,b)=>{const exprA=interpreter.visit(exprefNode,a[1]);const exprB=interpreter.visit(exprefNode,b[1]);if(this.getTypeName(exprA)!==requiredType){throw new Error(`TypeError: expected (${this.TYPE_NAME_TABLE[requiredType]}), received ${this.TYPE_NAME_TABLE[this.getTypeName(exprA)]}`)}else if(this.getTypeName(exprB)!==requiredType){throw new Error(`TypeError: expected (${this.TYPE_NAME_TABLE[requiredType]}), received ${this.TYPE_NAME_TABLE[this.getTypeName(exprB)]}`)}if(exprA>exprB){return 1}return exprA<exprB?-1:a[0]-b[0]}));for(let j=0;j<decorated.length;j+=1){sortedArray[j]=decorated[j][1]}return sortedArray};this.functionStartsWith=([searchable,searchStr])=>searchable.startsWith(searchStr);this.functionSum=([inputValue])=>inputValue.reduce(((x,y)=>x+y),0);this.functionToArray=([inputValue])=>{if(this.getTypeName(inputValue)===InputArgument.TYPE_ARRAY){return inputValue}return[inputValue]};this.functionToNumber=([inputValue])=>{const typeName=this.getTypeName(inputValue);let convertedValue;if(typeName===InputArgument.TYPE_NUMBER){return inputValue}if(typeName===InputArgument.TYPE_STRING){convertedValue=+inputValue;if(!isNaN(convertedValue)){return convertedValue}}return null};this.functionToString=([inputValue])=>{if(this.getTypeName(inputValue)===InputArgument.TYPE_STRING){return inputValue}return JSON.stringify(inputValue)};this.functionType=([inputValue])=>{switch(this.getTypeName(inputValue)){case InputArgument.TYPE_NUMBER:return"number";case InputArgument.TYPE_STRING:return"string";case InputArgument.TYPE_ARRAY:return"array";case InputArgument.TYPE_OBJECT:return"object";case InputArgument.TYPE_BOOLEAN:return"boolean";case InputArgument.TYPE_EXPREF:return"expref";case InputArgument.TYPE_NULL:return"null";default:return}};this.functionValues=([inputObject])=>Object.values(inputObject);this.functionTable={abs:{_func:this.functionAbs,_signature:[{types:[InputArgument.TYPE_NUMBER]}]},avg:{_func:this.functionAvg,_signature:[{types:[InputArgument.TYPE_ARRAY_NUMBER]}]},ceil:{_func:this.functionCeil,_signature:[{types:[InputArgument.TYPE_NUMBER]}]},contains:{_func:this.functionContains,_signature:[{types:[InputArgument.TYPE_STRING,InputArgument.TYPE_ARRAY]},{types:[InputArgument.TYPE_ANY]}]},ends_with:{_func:this.functionEndsWith,_signature:[{types:[InputArgument.TYPE_STRING]},{types:[InputArgument.TYPE_STRING]}]},floor:{_func:this.functionFloor,_signature:[{types:[InputArgument.TYPE_NUMBER]}]},join:{_func:this.functionJoin,_signature:[{types:[InputArgument.TYPE_STRING]},{types:[InputArgument.TYPE_ARRAY_STRING]}]},keys:{_func:this.functionKeys,_signature:[{types:[InputArgument.TYPE_OBJECT]}]},length:{_func:this.functionLength,_signature:[{types:[InputArgument.TYPE_STRING,InputArgument.TYPE_ARRAY,InputArgument.TYPE_OBJECT]}]},map:{_func:this.functionMap,_signature:[{types:[InputArgument.TYPE_EXPREF]},{types:[InputArgument.TYPE_ARRAY]}]},max:{_func:this.functionMax,_signature:[{types:[InputArgument.TYPE_ARRAY_NUMBER,InputArgument.TYPE_ARRAY_STRING]}]},max_by:{_func:this.functionMaxBy,_signature:[{types:[InputArgument.TYPE_ARRAY]},{types:[InputArgument.TYPE_EXPREF]}]},merge:{_func:this.functionMerge,_signature:[{types:[InputArgument.TYPE_OBJECT],variadic:true}]},min:{_func:this.functionMin,_signature:[{types:[InputArgument.TYPE_ARRAY_NUMBER,InputArgument.TYPE_ARRAY_STRING]}]},min_by:{_func:this.functionMinBy,_signature:[{types:[InputArgument.TYPE_ARRAY]},{types:[InputArgument.TYPE_EXPREF]}]},not_null:{_func:this.functionNotNull,_signature:[{types:[InputArgument.TYPE_ANY],variadic:true}]},reverse:{_func:this.functionReverse,_signature:[{types:[InputArgument.TYPE_STRING,InputArgument.TYPE_ARRAY]}]},sort:{_func:this.functionSort,_signature:[{types:[InputArgument.TYPE_ARRAY_STRING,InputArgument.TYPE_ARRAY_NUMBER]}]},sort_by:{_func:this.functionSortBy,_signature:[{types:[InputArgument.TYPE_ARRAY]},{types:[InputArgument.TYPE_EXPREF]}]},starts_with:{_func:this.functionStartsWith,_signature:[{types:[InputArgument.TYPE_STRING]},{types:[InputArgument.TYPE_STRING]}]},sum:{_func:this.functionSum,_signature:[{types:[InputArgument.TYPE_ARRAY_NUMBER]}]},to_array:{_func:this.functionToArray,_signature:[{types:[InputArgument.TYPE_ANY]}]},to_number:{_func:this.functionToNumber,_signature:[{types:[InputArgument.TYPE_ANY]}]},to_string:{_func:this.functionToString,_signature:[{types:[InputArgument.TYPE_ANY]}]},type:{_func:this.functionType,_signature:[{types:[InputArgument.TYPE_ANY]}]},values:{_func:this.functionValues,_signature:[{types:[InputArgument.TYPE_OBJECT]}]}};this._interpreter=interpreter}registerFunction(name,customFunction,signature){if(name in this.functionTable){throw new Error(`Function already defined: ${name}()`)}this.functionTable[name]={_func:customFunction.bind(this),_signature:signature}}callFunction(name,resolvedArgs){const functionEntry=this.functionTable[name];if(functionEntry===undefined){throw new Error(`Unknown function: ${name}()`)}this.validateArgs(name,resolvedArgs,functionEntry._signature);return functionEntry._func.call(this,resolvedArgs)}validateInputSignatures(name,signature){for(let i=0;i<signature.length;i+=1){if("variadic"in signature[i]&&i!==signature.length-1){throw new Error(`ArgumentError: ${name}() 'variadic' argument ${i+1} must occur last`)}}}validateArgs(name,args,signature){var _a,_b;let pluralized;this.validateInputSignatures(name,signature);const numberOfRequiredArgs=signature.filter((argSignature=>{var _a;return(_a=!argSignature.optional)!==null&&_a!==void 0?_a:false})).length;const lastArgIsVariadic=(_b=(_a=signature[signature.length-1])===null||_a===void 0?void 0:_a.variadic)!==null&&_b!==void 0?_b:false;const tooFewArgs=args.length<numberOfRequiredArgs;const tooManyArgs=args.length>signature.length;const tooFewModifier=tooFewArgs&&(!lastArgIsVariadic&&numberOfRequiredArgs>1||lastArgIsVariadic)?"at least ":"";if(lastArgIsVariadic&&tooFewArgs||!lastArgIsVariadic&&(tooFewArgs||tooManyArgs)){pluralized=signature.length>1;throw new Error(`ArgumentError: ${name}() takes ${tooFewModifier}${numberOfRequiredArgs} argument${pluralized&&"s"||""} but received ${args.length}`)}let currentSpec;let actualType;let typeMatched;for(let i=0;i<signature.length;i+=1){typeMatched=false;currentSpec=signature[i].types;actualType=this.getTypeName(args[i]);let j;for(j=0;j<currentSpec.length;j+=1){if(actualType!==undefined&&this.typeMatches(actualType,currentSpec[j],args[i])){typeMatched=true;break}}if(!typeMatched&&actualType!==undefined){const expected=currentSpec.map((typeIdentifier=>this.TYPE_NAME_TABLE[typeIdentifier])).join(" | ");throw new Error(`TypeError: ${name}() expected argument ${i+1} to be type (${expected}) but received type ${this.TYPE_NAME_TABLE[actualType]} instead.`)}}}typeMatches(actual,expected,argValue){if(expected===InputArgument.TYPE_ANY){return true}if(expected===InputArgument.TYPE_ARRAY_STRING||expected===InputArgument.TYPE_ARRAY_NUMBER||expected===InputArgument.TYPE_ARRAY){if(expected===InputArgument.TYPE_ARRAY){return actual===InputArgument.TYPE_ARRAY}if(actual===InputArgument.TYPE_ARRAY){let subtype;if(expected===InputArgument.TYPE_ARRAY_NUMBER){subtype=InputArgument.TYPE_NUMBER}else if(expected===InputArgument.TYPE_ARRAY_STRING){subtype=InputArgument.TYPE_STRING}for(let i=0;i<argValue.length;i+=1){const typeName=this.getTypeName(argValue[i]);if(typeName!==undefined&&subtype!==undefined&&!this.typeMatches(typeName,subtype,argValue[i])){return false}}return true}}else{return actual===expected}return false}getTypeName(obj){switch(Object.prototype.toString.call(obj)){case"[object String]":return InputArgument.TYPE_STRING;case"[object Number]":return InputArgument.TYPE_NUMBER;case"[object Array]":return InputArgument.TYPE_ARRAY;case"[object Boolean]":return InputArgument.TYPE_BOOLEAN;case"[object Null]":return InputArgument.TYPE_NULL;case"[object Object]":if(obj.jmespathType===Token.TOK_EXPREF){return InputArgument.TYPE_EXPREF}return InputArgument.TYPE_OBJECT;default:return}}createKeyFunction(exprefNode,allowedTypes){if(!this._interpreter){return}const interpreter=this._interpreter;const keyFunc=x=>{const current=interpreter.visit(exprefNode,x);if(!allowedTypes.includes(this.getTypeName(current))){const msg=`TypeError: expected one of (${allowedTypes.map((t=>this.TYPE_NAME_TABLE[t])).join(" | ")}), received ${this.TYPE_NAME_TABLE[this.getTypeName(current)]}`;throw new Error(msg)}return current};return keyFunc}}class TreeInterpreter$1{constructor(){this._rootValue=null;this.runtime=new Runtime(this)}search(node,value){this._rootValue=value;return this.visit(node,value)}visit(node,value){let matched;let current;let result;let first;let second;let field;let left;let right;let collected;let i;let base;switch(node.type){case"Field":if(value===null){return null}if(isObject(value)){field=value[node.name];if(field===undefined){return null}return field}return null;case"Subexpression":result=this.visit(node.children[0],value);for(i=1;i<node.children.length;i+=1){result=this.visit(node.children[1],result);if(result===null){return null}}return result;case"IndexExpression":left=this.visit(node.children[0],value);right=this.visit(node.children[1],left);return right;case"Index":if(!Array.isArray(value)){return null}let index=node.value;if(index<0){index=value.length+index}result=value[index];if(result===undefined){result=null}return result;case"Slice":if(!Array.isArray(value)){return null}const sliceParams=[...node.children];const computed=this.computeSliceParams(value.length,sliceParams);const[start,stop,step]=computed;result=[];if(step>0){for(i=start;i<stop;i+=step){result.push(value[i])}}else{for(i=start;i>stop;i+=step){result.push(value[i])}}return result;case"Projection":base=this.visit(node.children[0],value);if(!Array.isArray(base)){return null}collected=[];for(i=0;i<base.length;i+=1){current=this.visit(node.children[1],base[i]);if(current!==null){collected.push(current)}}return collected;case"ValueProjection":base=this.visit(node.children[0],value);if(!isObject(base)){return null}collected=[];const values=Object.values(base);for(i=0;i<values.length;i+=1){current=this.visit(node.children[1],values[i]);if(current!==null){collected.push(current)}}return collected;case"FilterProjection":base=this.visit(node.children[0],value);if(!Array.isArray(base)){return null}const filtered=[];const finalResults=[];for(i=0;i<base.length;i+=1){matched=this.visit(node.children[2],base[i]);if(!isFalse(matched)){filtered.push(base[i])}}for(let j=0;j<filtered.length;j+=1){current=this.visit(node.children[1],filtered[j]);if(current!==null){finalResults.push(current)}}return finalResults;case"Comparator":first=this.visit(node.children[0],value);second=this.visit(node.children[1],value);switch(node.name){case Token.TOK_EQ:result=strictDeepEqual(first,second);break;case Token.TOK_NE:result=!strictDeepEqual(first,second);break;case Token.TOK_GT:result=first>second;break;case Token.TOK_GTE:result=first>=second;break;case Token.TOK_LT:result=first<second;break;case Token.TOK_LTE:result=first<=second;break;default:throw new Error(`Unknown comparator: ${node.name}`)}return result;case Token.TOK_FLATTEN:const original=this.visit(node.children[0],value);if(!Array.isArray(original)){return null}let merged=[];for(i=0;i<original.length;i+=1){current=original[i];if(Array.isArray(current)){merged=[...merged,...current]}else{merged.push(current)}}return merged;case"Identity":return value;case"MultiSelectList":if(value===null){return null}collected=[];for(i=0;i<node.children.length;i+=1){collected.push(this.visit(node.children[i],value))}return collected;case"MultiSelectHash":if(value===null){return null}collected={};let child;for(i=0;i<node.children.length;i+=1){child=node.children[i];collected[child.name]=this.visit(child.value,value)}return collected;case"OrExpression":matched=this.visit(node.children[0],value);if(isFalse(matched)){matched=this.visit(node.children[1],value)}return matched;case"AndExpression":first=this.visit(node.children[0],value);if(isFalse(first)){return first}return this.visit(node.children[1],value);case"NotExpression":first=this.visit(node.children[0],value);return isFalse(first);case"Literal":return node.value;case Token.TOK_PIPE:left=this.visit(node.children[0],value);return this.visit(node.children[1],left);case Token.TOK_CURRENT:return value;case Token.TOK_ROOT:return this._rootValue;case"Function":const resolvedArgs=[];for(let j=0;j<node.children.length;j+=1){resolvedArgs.push(this.visit(node.children[j],value))}return this.runtime.callFunction(node.name,resolvedArgs);case"ExpressionReference":const refNode=node.children[0];refNode.jmespathType=Token.TOK_EXPREF;return refNode;default:throw new Error(`Unknown node type: ${node.type}`)}}computeSliceParams(arrayLength,sliceParams){let[start,stop,step]=sliceParams;if(step===null){step=1}else if(step===0){const error=new Error("Invalid slice, step cannot be 0");error.name="RuntimeError";throw error}const stepValueNegative=step<0?true:false;start=start===null?stepValueNegative?arrayLength-1:0:this.capSliceRange(arrayLength,start,step);stop=stop===null?stepValueNegative?-1:arrayLength:this.capSliceRange(arrayLength,stop,step);return[start,stop,step]}capSliceRange(arrayLength,actualValue,step){let nextActualValue=actualValue;if(nextActualValue<0){nextActualValue+=arrayLength;if(nextActualValue<0){nextActualValue=step<0?-1:0}}else if(nextActualValue>=arrayLength){nextActualValue=step<0?arrayLength-1:arrayLength}return nextActualValue}}const TreeInterpreterInstance=new TreeInterpreter$1;const TYPE_ANY=InputArgument.TYPE_ANY;const TYPE_ARRAY=InputArgument.TYPE_ARRAY;const TYPE_ARRAY_NUMBER=InputArgument.TYPE_ARRAY_NUMBER;const TYPE_ARRAY_STRING=InputArgument.TYPE_ARRAY_STRING;const TYPE_BOOLEAN=InputArgument.TYPE_BOOLEAN;const TYPE_EXPREF=InputArgument.TYPE_EXPREF;const TYPE_NULL=InputArgument.TYPE_NULL;const TYPE_NUMBER=InputArgument.TYPE_NUMBER;const TYPE_OBJECT=InputArgument.TYPE_OBJECT;const TYPE_STRING=InputArgument.TYPE_STRING;function compile(expression){const nodeTree=Parser.parse(expression);return nodeTree}function tokenize(expression){return Lexer.tokenize(expression)}const registerFunction=(functionName,customFunction,signature)=>{TreeInterpreterInstance.runtime.registerFunction(functionName,customFunction,signature)};function search(data,expression){const nodeTree=Parser.parse(expression);return TreeInterpreterInstance.search(nodeTree,data)}const TreeInterpreter=TreeInterpreterInstance;const jmespath={compile:compile,registerFunction:registerFunction,search:search,tokenize:tokenize,TreeInterpreter:TreeInterpreter,TYPE_ANY:TYPE_ANY,TYPE_ARRAY_NUMBER:TYPE_ARRAY_NUMBER,TYPE_ARRAY_STRING:TYPE_ARRAY_STRING,TYPE_ARRAY:TYPE_ARRAY,TYPE_BOOLEAN:TYPE_BOOLEAN,TYPE_EXPREF:TYPE_EXPREF,TYPE_NULL:TYPE_NULL,TYPE_NUMBER:TYPE_NUMBER,TYPE_OBJECT:TYPE_OBJECT,TYPE_STRING:TYPE_STRING};exports.TYPE_ANY=TYPE_ANY;exports.TYPE_ARRAY=TYPE_ARRAY;exports.TYPE_ARRAY_NUMBER=TYPE_ARRAY_NUMBER;exports.TYPE_ARRAY_STRING=TYPE_ARRAY_STRING;exports.TYPE_BOOLEAN=TYPE_BOOLEAN;exports.TYPE_EXPREF=TYPE_EXPREF;exports.TYPE_NULL=TYPE_NULL;exports.TYPE_NUMBER=TYPE_NUMBER;exports.TYPE_OBJECT=TYPE_OBJECT;exports.TYPE_STRING=TYPE_STRING;exports.TreeInterpreter=TreeInterpreter;exports.compile=compile;exports.default=jmespath;exports.jmespath=jmespath;exports.registerFunction=registerFunction;exports.search=search;exports.tokenize=tokenize;Object.defineProperty(exports,"__esModule",{value:true})}));(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?factory(exports,require("@angular/common"),require("@angular/core"),require("@angular/forms"),require("imask")):typeof define==="function"&&define.amd?define(["exports","@angular/common","@angular/core","@angular/forms","imask"],factory):(global=typeof globalThis!=="undefined"?globalThis:global||self,factory(global.angularIMask={},global.ng.common,global.ng.core,global.ng.forms,global.IMask))})(this,(function(exports,common,i0,forms,IMask){"use strict";function _interopNamespaceDefault(e){var n=Object.create(null);if(e){Object.keys(e).forEach((function(k){if(k!=="default"){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}})}}))}n.default=e;return Object.freeze(n)}var i0__namespace=_interopNamespaceDefault(i0);class DefaultImaskFactory{create(el,opts){return IMask(el,opts)}}DefaultImaskFactory.\u0275fac=i0__namespace.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"15.2.9",ngImport:i0__namespace,type:DefaultImaskFactory,deps:[],target:i0__namespace.\u0275\u0275FactoryTarget.Injectable});DefaultImaskFactory.\u0275prov=i0__namespace.\u0275\u0275ngDeclareInjectable({minVersion:"12.0.0",version:"15.2.9",ngImport:i0__namespace,type:DefaultImaskFactory,providedIn:"root"});i0__namespace.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"15.2.9",ngImport:i0__namespace,type:DefaultImaskFactory,decorators:[{type:i0.Injectable,args:[{providedIn:"root"}]}]});const IMASK_FACTORY=new i0.InjectionToken("IMASK_FACTORY",{providedIn:"root",factory:()=>i0.inject(DefaultImaskFactory)});const MASKEDINPUT_VALUE_ACCESSOR={provide:forms.NG_VALUE_ACCESSOR,useExisting:i0.forwardRef((()=>IMaskDirective)),multi:true};const DEFAULT_IMASK_ELEMENT=elementRef=>elementRef.nativeElement;class IMaskDirective{constructor(){var _a;this.onTouched=()=>{};this.onChange=()=>{};this._viewInitialized=false;this._composing=false;this._writing=false;this._elementRef=i0.inject(i0.ElementRef);this._renderer=i0.inject(i0.Renderer2);this._factory=i0.inject(IMASK_FACTORY);this._platformId=i0.inject(i0.PLATFORM_ID);this._compositionMode=(_a=i0.inject(forms.COMPOSITION_BUFFER_MODE,{optional:true}))!==null&&_a!==void 0?_a:!this._isAndroid();this.imaskElement=DEFAULT_IMASK_ELEMENT;this.accept=new i0.EventEmitter;this.complete=new i0.EventEmitter}get element(){return this.imaskElement(this._elementRef,this)}get maskValue(){if(!this.maskRef)return this.element.value;if(this.unmask==="typed")return this.maskRef.typedValue;if(this.unmask)return this.maskRef.unmaskedValue;return this.maskRef.value}set maskValue(value){if(this.maskRef){if(this.unmask==="typed")this.maskRef.typedValue=value;else if(this.unmask)this.maskRef.unmaskedValue=value;else this.maskRef.value=value}else{this._renderer.setProperty(this.element,"value",value)}}ngAfterViewInit(){if(this.imask)this.initMask();this._viewInitialized=true}ngOnChanges(changes){if(changes["elementRef"]&&!this.imaskElement)this.imaskElement=DEFAULT_IMASK_ELEMENT;if(!changes["imask"]||!this._viewInitialized)return;if(this.imask){if(this.maskRef)this.maskRef.updateOptions(this.imask);else{this.initMask();this.onChange(this.maskValue)}}else{this.destroyMask()}}destroyMask(){if(this.maskRef){this.maskRef.destroy();delete this.maskRef}}ngOnDestroy(){this.destroyMask();this.accept.complete();this.complete.complete()}beginWrite(value){this._writing=true;this._writingValue=value}endWrite(){this._writing=false;return this._writingValue}writeValue(value){value=value==null&&this.unmask!=="typed"?"":value;if(this.maskRef){this.beginWrite(value);this.maskValue=value;this.endWrite()}else{this._renderer.setProperty(this.element,"value",value);this._initialValue=value}}_onAccept(){const value=this.maskValue;if(this._writing&&value===this.endWrite())return;this.onChange(value);this.accept.emit(value)}_onComplete(){this.complete.emit(this.maskValue)}initMask(){this.maskRef=this._factory.create(this.element,this.imask).on("accept",this._onAccept.bind(this)).on("complete",this._onComplete.bind(this));if(this._initialValue!=null)this.writeValue(this._initialValue);delete this._initialValue}setDisabledState(isDisabled){this._renderer.setProperty(this.element,"disabled",isDisabled)}registerOnChange(fn){this.onChange=fn}registerOnTouched(fn){this.onTouched=fn}_handleInput(value){if(this.maskRef)return;if(!this._compositionMode||this._compositionMode&&!this._composing){this.onChange(value)}}_compositionStart(){this._composing=true}_compositionEnd(value){this._composing=false;this._compositionMode&&this._handleInput(value)}_isAndroid(){return common.isPlatformBrowser(this._platformId)&&/android (\d+)/.test(navigator.userAgent.toLowerCase())}}IMaskDirective.\u0275fac=i0__namespace.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"15.2.9",ngImport:i0__namespace,type:IMaskDirective,deps:[],target:i0__namespace.\u0275\u0275FactoryTarget.Directive});IMaskDirective.\u0275dir=i0__namespace.\u0275\u0275ngDeclareDirective({minVersion:"14.0.0",version:"15.2.9",type:IMaskDirective,isStandalone:true,selector:"[imask]",inputs:{imask:"imask",unmask:"unmask",imaskElement:"imaskElement"},outputs:{accept:"accept",complete:"complete"},host:{listeners:{input:"_handleInput($event.target.value)",blur:"onTouched()",compositionstart:"_compositionStart()",compositionend:"_compositionEnd($event.target.value)"}},providers:[MASKEDINPUT_VALUE_ACCESSOR],exportAs:["imask"],usesOnChanges:true,ngImport:i0__namespace});i0__namespace.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"15.2.9",ngImport:i0__namespace,type:IMaskDirective,decorators:[{type:i0.Directive,args:[{selector:"[imask]",standalone:true,exportAs:"imask",host:{"(input)":"_handleInput($event.target.value)","(blur)":"onTouched()","(compositionstart)":"_compositionStart()","(compositionend)":"_compositionEnd($event.target.value)"},providers:[MASKEDINPUT_VALUE_ACCESSOR]}]}],propDecorators:{imask:[{type:i0.Input}],unmask:[{type:i0.Input}],imaskElement:[{type:i0.Input}],accept:[{type:i0.Output}],complete:[{type:i0.Output}]}});class IMaskPipe{transform(...args){return IMask.pipe(...args)}}IMaskPipe.\u0275fac=i0__namespace.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"15.2.9",ngImport:i0__namespace,type:IMaskPipe,deps:[],target:i0__namespace.\u0275\u0275FactoryTarget.Pipe});IMaskPipe.\u0275pipe=i0__namespace.\u0275\u0275ngDeclarePipe({minVersion:"14.0.0",version:"15.2.9",ngImport:i0__namespace,type:IMaskPipe,isStandalone:true,name:"imask"});i0__namespace.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"15.2.9",ngImport:i0__namespace,type:IMaskPipe,decorators:[{type:i0.Pipe,args:[{name:"imask",standalone:true}]}]});class IMaskModule{}IMaskModule.\u0275fac=i0__namespace.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"15.2.9",ngImport:i0__namespace,type:IMaskModule,deps:[],target:i0__namespace.\u0275\u0275FactoryTarget.NgModule});IMaskModule.\u0275mod=i0__namespace.\u0275\u0275ngDeclareNgModule({minVersion:"14.0.0",version:"15.2.9",ngImport:i0__namespace,type:IMaskModule,imports:[IMaskDirective,IMaskPipe],exports:[IMaskDirective,IMaskPipe]});IMaskModule.\u0275inj=i0__namespace.\u0275\u0275ngDeclareInjector({minVersion:"12.0.0",version:"15.2.9",ngImport:i0__namespace,type:IMaskModule});i0__namespace.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"15.2.9",ngImport:i0__namespace,type:IMaskModule,decorators:[{type:i0.NgModule,args:[{imports:[IMaskDirective,IMaskPipe],exports:[IMaskDirective,IMaskPipe]}]}]});Object.defineProperty(exports,"PIPE_TYPE",{enumerable:true,get:function(){return IMask.PIPE_TYPE}});Object.defineProperty(exports,"pipe",{enumerable:true,get:function(){return IMask.pipe}});exports.DEFAULT_IMASK_ELEMENT=DEFAULT_IMASK_ELEMENT;exports.DefaultImaskFactory=DefaultImaskFactory;exports.IMASK_FACTORY=IMASK_FACTORY;exports.IMaskDirective=IMaskDirective;exports.IMaskModule=IMaskModule;exports.IMaskPipe=IMaskPipe;exports.MASKEDINPUT_VALUE_ACCESSOR=MASKEDINPUT_VALUE_ACCESSOR}));
|
|
1812
|
+
\******************/__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{$rootScope:()=>_src_constants_variables_constants__WEBPACK_IMPORTED_MODULE_0__.$rootScope,ApiAwareVariable:()=>_src_model_variable_api_aware_variable__WEBPACK_IMPORTED_MODULE_3__.ApiAwareVariable,BaseAction:()=>_src_model_base_action__WEBPACK_IMPORTED_MODULE_2__.BaseAction,CONSTANTS:()=>_src_constants_variables_constants__WEBPACK_IMPORTED_MODULE_0__.CONSTANTS,CrudVariable:()=>_src_model_variable_crud_variable__WEBPACK_IMPORTED_MODULE_7__.CrudVariable,DB_CONSTANTS:()=>_src_constants_variables_constants__WEBPACK_IMPORTED_MODULE_0__.DB_CONSTANTS,LVService:()=>_src_util_variable_live_variable_http_utils__WEBPACK_IMPORTED_MODULE_10__.LVService,LiveVariable:()=>_src_model_variable_live_variable__WEBPACK_IMPORTED_MODULE_8__.LiveVariable,LiveVariableUtils:()=>_src_util_variable_live_variable_utils__WEBPACK_IMPORTED_MODULE_11__.LiveVariableUtils,ModelVariable:()=>_src_model_variable_model_variable__WEBPACK_IMPORTED_MODULE_5__.ModelVariable,SWAGGER_CONSTANTS:()=>_src_constants_variables_constants__WEBPACK_IMPORTED_MODULE_0__.SWAGGER_CONSTANTS,ServiceVariable:()=>_src_model_variable_service_variable__WEBPACK_IMPORTED_MODULE_6__.ServiceVariable,TEST:()=>TEST,TimerAction:()=>_src_model_action_timer_action__WEBPACK_IMPORTED_MODULE_4__.TimerAction,VARIABLE_CONSTANTS:()=>_src_constants_variables_constants__WEBPACK_IMPORTED_MODULE_0__.VARIABLE_CONSTANTS,VARIABLE_URLS:()=>_src_constants_variables_constants__WEBPACK_IMPORTED_MODULE_0__.VARIABLE_URLS,WS_CONSTANTS:()=>_src_constants_variables_constants__WEBPACK_IMPORTED_MODULE_0__.WS_CONSTANTS,appManager:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.appManager,debounceVariableCall:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.debounceVariableCall,decodeData:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.decodeData,dialogService:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.dialogService,formatDate:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.formatDate,formatExportExpression:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.formatExportExpression,generateConnectionParams:()=>_src_util_variable_live_variable_http_utils__WEBPACK_IMPORTED_MODULE_10__.generateConnectionParams,getBlob:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.getBlob,getErrMessage:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.getErrMessage,getEvaluatedOrderBy:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.getEvaluatedOrderBy,getTarget:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.getTarget,getTargetNodeKey:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.getTargetNodeKey,getTargetObj:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.getTargetObj,httpService:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.httpService,initiateCallback:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.initiateCallback,internalBoundNodeMap:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.internalBoundNodeMap,isFileUploadSupported:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.isFileUploadSupported,metadataService:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.metadataService,navigationService:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.navigationService,oauthService:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.oauthService,parseConfig:()=>_src_util_variable_live_variable_http_utils__WEBPACK_IMPORTED_MODULE_10__.parseConfig,routerService:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.routerService,securityService:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.securityService,setInput:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.setInput,setValueToNode:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.setValueToNode,toasterService:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.toasterService,updateInternalNodes:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.updateInternalNodes,wmSetDependency:()=>_src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__.wmSetDependency});var _src_constants_variables_constants__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(/*! ./src/constants/variables.constants */"./src/constants/variables.constants.ts");var _src_util_variable_variables_utils__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(/*! ./src/util/variable/variables.utils */"./src/util/variable/variables.utils.ts");var _src_model_base_action__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(/*! ./src/model/base-action */"./src/model/base-action.ts");var _src_model_variable_api_aware_variable__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(/*! ./src/model/variable/api-aware-variable */"./src/model/variable/api-aware-variable.ts");var _src_model_action_timer_action__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(/*! ./src/model/action/timer-action */"./src/model/action/timer-action.ts");var _src_model_variable_model_variable__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(/*! ./src/model/variable/model-variable */"./src/model/variable/model-variable.ts");var _src_model_variable_service_variable__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(/*! ./src/model/variable/service-variable */"./src/model/variable/service-variable.ts");var _src_model_variable_crud_variable__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(/*! ./src/model/variable/crud-variable */"./src/model/variable/crud-variable.ts");var _src_model_variable_live_variable__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(/*! ./src/model/variable/live-variable */"./src/model/variable/live-variable.ts");var _src_types_http_client_service__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(/*! ./src/types/http-client.service */"./src/types/http-client.service.ts");var _src_util_variable_live_variable_http_utils__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(/*! ./src/util/variable/live-variable.http.utils */"./src/util/variable/live-variable.http.utils.ts");var _src_util_variable_live_variable_utils__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(/*! ./src/util/variable/live-variable.utils */"./src/util/variable/live-variable.utils.ts");var _src_types_date_formatter__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(/*! ./src/types/date-formatter */"./src/types/date-formatter.ts");var TEST="hello from variables"})();return __webpack_exports__})()));(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?factory(exports):typeof define==="function"&&define.amd?define(["exports"],factory):(global=typeof globalThis!=="undefined"?globalThis:global||self,factory(global.jmespath={}))})(this,(function(exports){"use strict";const isObject=obj=>obj!==null&&Object.prototype.toString.call(obj)==="[object Object]";const strictDeepEqual=(first,second)=>{if(first===second){return true}if(typeof first!==typeof second){return false}if(Array.isArray(first)&&Array.isArray(second)){if(first.length!==second.length){return false}for(let i=0;i<first.length;i+=1){if(!strictDeepEqual(first[i],second[i])){return false}}return true}if(isObject(first)&&isObject(second)){const firstEntries=Object.entries(first);const secondKeys=new Set(Object.keys(second));if(firstEntries.length!==secondKeys.size){return false}for(const[key,value]of firstEntries){if(!strictDeepEqual(value,second[key])){return false}secondKeys.delete(key)}return secondKeys.size===0}return false};const isFalse=obj=>{if(obj===""||obj===false||obj===null||obj===undefined){return true}if(Array.isArray(obj)&&obj.length===0){return true}if(isObject(obj)){for(const key in obj){if(obj.hasOwnProperty(key)){return false}}return true}return false};const isAlpha=ch=>ch>="a"&&ch<="z"||ch>="A"&&ch<="Z"||ch==="_";const isNum=ch=>ch>="0"&&ch<="9"||ch==="-";const isAlphaNum=ch=>ch>="a"&&ch<="z"||ch>="A"&&ch<="Z"||ch>="0"&&ch<="9"||ch==="_";var Token;(function(Token){Token["TOK_EOF"]="EOF";Token["TOK_UNQUOTEDIDENTIFIER"]="UnquotedIdentifier";Token["TOK_QUOTEDIDENTIFIER"]="QuotedIdentifier";Token["TOK_RBRACKET"]="Rbracket";Token["TOK_RPAREN"]="Rparen";Token["TOK_COMMA"]="Comma";Token["TOK_COLON"]="Colon";Token["TOK_RBRACE"]="Rbrace";Token["TOK_NUMBER"]="Number";Token["TOK_CURRENT"]="Current";Token["TOK_ROOT"]="Root";Token["TOK_EXPREF"]="Expref";Token["TOK_PIPE"]="Pipe";Token["TOK_OR"]="Or";Token["TOK_AND"]="And";Token["TOK_EQ"]="EQ";Token["TOK_GT"]="GT";Token["TOK_LT"]="LT";Token["TOK_GTE"]="GTE";Token["TOK_LTE"]="LTE";Token["TOK_NE"]="NE";Token["TOK_FLATTEN"]="Flatten";Token["TOK_STAR"]="Star";Token["TOK_FILTER"]="Filter";Token["TOK_DOT"]="Dot";Token["TOK_NOT"]="Not";Token["TOK_LBRACE"]="Lbrace";Token["TOK_LBRACKET"]="Lbracket";Token["TOK_LPAREN"]="Lparen";Token["TOK_LITERAL"]="Literal"})(Token||(Token={}));const basicTokens={"(":Token.TOK_LPAREN,")":Token.TOK_RPAREN,"*":Token.TOK_STAR,",":Token.TOK_COMMA,".":Token.TOK_DOT,":":Token.TOK_COLON,"@":Token.TOK_CURRENT,["$"]:Token.TOK_ROOT,"]":Token.TOK_RBRACKET,"{":Token.TOK_LBRACE,"}":Token.TOK_RBRACE};const operatorStartToken={"!":true,"<":true,"=":true,">":true};const skipChars={"\t":true,"\n":true,"\r":true," ":true};class StreamLexer{constructor(){this._current=0}tokenize(stream){const tokens=[];this._current=0;let start;let identifier;let token;while(this._current<stream.length){if(isAlpha(stream[this._current])){start=this._current;identifier=this.consumeUnquotedIdentifier(stream);tokens.push({start:start,type:Token.TOK_UNQUOTEDIDENTIFIER,value:identifier})}else if(basicTokens[stream[this._current]]!==undefined){tokens.push({start:this._current,type:basicTokens[stream[this._current]],value:stream[this._current]});this._current+=1}else if(isNum(stream[this._current])){token=this.consumeNumber(stream);tokens.push(token)}else if(stream[this._current]==="["){token=this.consumeLBracket(stream);tokens.push(token)}else if(stream[this._current]==='"'){start=this._current;identifier=this.consumeQuotedIdentifier(stream);tokens.push({start:start,type:Token.TOK_QUOTEDIDENTIFIER,value:identifier})}else if(stream[this._current]===`'`){start=this._current;identifier=this.consumeRawStringLiteral(stream);tokens.push({start:start,type:Token.TOK_LITERAL,value:identifier})}else if(stream[this._current]==="`"){start=this._current;const literal=this.consumeLiteral(stream);tokens.push({start:start,type:Token.TOK_LITERAL,value:literal})}else if(operatorStartToken[stream[this._current]]!==undefined){token=this.consumeOperator(stream);token&&tokens.push(token)}else if(skipChars[stream[this._current]]!==undefined){this._current+=1}else if(stream[this._current]==="&"){start=this._current;this._current+=1;if(stream[this._current]==="&"){this._current+=1;tokens.push({start:start,type:Token.TOK_AND,value:"&&"})}else{tokens.push({start:start,type:Token.TOK_EXPREF,value:"&"})}}else if(stream[this._current]==="|"){start=this._current;this._current+=1;if(stream[this._current]==="|"){this._current+=1;tokens.push({start:start,type:Token.TOK_OR,value:"||"})}else{tokens.push({start:start,type:Token.TOK_PIPE,value:"|"})}}else{const error=new Error(`Unknown character: ${stream[this._current]}`);error.name="LexerError";throw error}}return tokens}consumeUnquotedIdentifier(stream){const start=this._current;this._current+=1;while(this._current<stream.length&&isAlphaNum(stream[this._current])){this._current+=1}return stream.slice(start,this._current)}consumeQuotedIdentifier(stream){const start=this._current;this._current+=1;const maxLength=stream.length;while(stream[this._current]!=='"'&&this._current<maxLength){let current=this._current;if(stream[current]==="\\"&&(stream[current+1]==="\\"||stream[current+1]==='"')){current+=2}else{current+=1}this._current=current}this._current+=1;return JSON.parse(stream.slice(start,this._current))}consumeRawStringLiteral(stream){const start=this._current;this._current+=1;const maxLength=stream.length;while(stream[this._current]!==`'`&&this._current<maxLength){let current=this._current;if(stream[current]==="\\"&&(stream[current+1]==="\\"||stream[current+1]===`'`)){current+=2}else{current+=1}this._current=current}this._current+=1;const literal=stream.slice(start+1,this._current-1);return literal.replace(`\\'`,`'`)}consumeNumber(stream){const start=this._current;this._current+=1;const maxLength=stream.length;while(isNum(stream[this._current])&&this._current<maxLength){this._current+=1}const value=parseInt(stream.slice(start,this._current),10);return{start:start,value:value,type:Token.TOK_NUMBER}}consumeLBracket(stream){const start=this._current;this._current+=1;if(stream[this._current]==="?"){this._current+=1;return{start:start,type:Token.TOK_FILTER,value:"[?"}}if(stream[this._current]==="]"){this._current+=1;return{start:start,type:Token.TOK_FLATTEN,value:"[]"}}return{start:start,type:Token.TOK_LBRACKET,value:"["}}consumeOperator(stream){const start=this._current;const startingChar=stream[start];this._current+=1;if(startingChar==="!"){if(stream[this._current]==="="){this._current+=1;return{start:start,type:Token.TOK_NE,value:"!="}}return{start:start,type:Token.TOK_NOT,value:"!"}}if(startingChar==="<"){if(stream[this._current]==="="){this._current+=1;return{start:start,type:Token.TOK_LTE,value:"<="}}return{start:start,type:Token.TOK_LT,value:"<"}}if(startingChar===">"){if(stream[this._current]==="="){this._current+=1;return{start:start,type:Token.TOK_GTE,value:">="}}return{start:start,type:Token.TOK_GT,value:">"}}if(startingChar==="="&&stream[this._current]==="="){this._current+=1;return{start:start,type:Token.TOK_EQ,value:"=="}}}consumeLiteral(stream){this._current+=1;const start=this._current;const maxLength=stream.length;while(stream[this._current]!=="`"&&this._current<maxLength){let current=this._current;if(stream[current]==="\\"&&(stream[current+1]==="\\"||stream[current+1]==="`")){current+=2}else{current+=1}this._current=current}let literalString=stream.slice(start,this._current).trimLeft();literalString=literalString.replace("\\`","`");const literal=this.looksLikeJSON(literalString)?JSON.parse(literalString):JSON.parse(`"${literalString}"`);this._current+=1;return literal}looksLikeJSON(literalString){const startingChars='[{"';const jsonLiterals=["true","false","null"];const numberLooking="-0123456789";if(literalString===""){return false}if(startingChars.includes(literalString[0])){return true}if(jsonLiterals.includes(literalString)){return true}if(numberLooking.includes(literalString[0])){try{JSON.parse(literalString);return true}catch(ex){return false}}return false}}const Lexer=new StreamLexer;const bindingPower={[Token.TOK_EOF]:0,[Token.TOK_UNQUOTEDIDENTIFIER]:0,[Token.TOK_QUOTEDIDENTIFIER]:0,[Token.TOK_RBRACKET]:0,[Token.TOK_RPAREN]:0,[Token.TOK_COMMA]:0,[Token.TOK_RBRACE]:0,[Token.TOK_NUMBER]:0,[Token.TOK_CURRENT]:0,[Token.TOK_EXPREF]:0,[Token.TOK_ROOT]:0,[Token.TOK_PIPE]:1,[Token.TOK_OR]:2,[Token.TOK_AND]:3,[Token.TOK_EQ]:5,[Token.TOK_GT]:5,[Token.TOK_LT]:5,[Token.TOK_GTE]:5,[Token.TOK_LTE]:5,[Token.TOK_NE]:5,[Token.TOK_FLATTEN]:9,[Token.TOK_STAR]:20,[Token.TOK_FILTER]:21,[Token.TOK_DOT]:40,[Token.TOK_NOT]:45,[Token.TOK_LBRACE]:50,[Token.TOK_LBRACKET]:55,[Token.TOK_LPAREN]:60};class TokenParser{constructor(){this.index=0;this.tokens=[]}parse(expression){this.loadTokens(expression);this.index=0;const ast=this.expression(0);if(this.lookahead(0)!==Token.TOK_EOF){const token=this.lookaheadToken(0);this.errorToken(token,`Unexpected token type: ${token.type}, value: ${token.value}`)}return ast}loadTokens(expression){this.tokens=[...Lexer.tokenize(expression),{type:Token.TOK_EOF,value:"",start:expression.length}]}expression(rbp){const leftToken=this.lookaheadToken(0);this.advance();let left=this.nud(leftToken);let currentTokenType=this.lookahead(0);while(rbp<bindingPower[currentTokenType]){this.advance();left=this.led(currentTokenType,left);currentTokenType=this.lookahead(0)}return left}lookahead(offset){return this.tokens[this.index+offset].type}lookaheadToken(offset){return this.tokens[this.index+offset]}advance(){this.index+=1}nud(token){let left;let right;let expression;switch(token.type){case Token.TOK_LITERAL:return{type:"Literal",value:token.value};case Token.TOK_UNQUOTEDIDENTIFIER:return{type:"Field",name:token.value};case Token.TOK_QUOTEDIDENTIFIER:const node={type:"Field",name:token.value};if(this.lookahead(0)===Token.TOK_LPAREN){throw new Error("Quoted identifier not allowed for function names.")}else{return node}case Token.TOK_NOT:right=this.expression(bindingPower.Not);return{type:"NotExpression",children:[right]};case Token.TOK_STAR:left={type:"Identity"};right=this.lookahead(0)===Token.TOK_RBRACKET&&{type:"Identity"}||this.parseProjectionRHS(bindingPower.Star);return{type:"ValueProjection",children:[left,right]};case Token.TOK_FILTER:return this.led(token.type,{type:"Identity"});case Token.TOK_LBRACE:return this.parseMultiselectHash();case Token.TOK_FLATTEN:left={type:Token.TOK_FLATTEN,children:[{type:"Identity"}]};right=this.parseProjectionRHS(bindingPower.Flatten);return{type:"Projection",children:[left,right]};case Token.TOK_LBRACKET:if(this.lookahead(0)===Token.TOK_NUMBER||this.lookahead(0)===Token.TOK_COLON){right=this.parseIndexExpression();return this.projectIfSlice({type:"Identity"},right)}if(this.lookahead(0)===Token.TOK_STAR&&this.lookahead(1)===Token.TOK_RBRACKET){this.advance();this.advance();right=this.parseProjectionRHS(bindingPower.Star);return{children:[{type:"Identity"},right],type:"Projection"}}return this.parseMultiselectList();case Token.TOK_CURRENT:return{type:Token.TOK_CURRENT};case Token.TOK_ROOT:return{type:Token.TOK_ROOT};case Token.TOK_EXPREF:expression=this.expression(bindingPower.Expref);return{type:"ExpressionReference",children:[expression]};case Token.TOK_LPAREN:const args=[];while(this.lookahead(0)!==Token.TOK_RPAREN){if(this.lookahead(0)===Token.TOK_CURRENT){expression={type:Token.TOK_CURRENT};this.advance()}else{expression=this.expression(0)}args.push(expression)}this.match(Token.TOK_RPAREN);return args[0];default:this.errorToken(token)}}led(tokenName,left){let right;switch(tokenName){case Token.TOK_DOT:const rbp=bindingPower.Dot;if(this.lookahead(0)!==Token.TOK_STAR){right=this.parseDotRHS(rbp);return{type:"Subexpression",children:[left,right]}}this.advance();right=this.parseProjectionRHS(rbp);return{type:"ValueProjection",children:[left,right]};case Token.TOK_PIPE:right=this.expression(bindingPower.Pipe);return{type:Token.TOK_PIPE,children:[left,right]};case Token.TOK_OR:right=this.expression(bindingPower.Or);return{type:"OrExpression",children:[left,right]};case Token.TOK_AND:right=this.expression(bindingPower.And);return{type:"AndExpression",children:[left,right]};case Token.TOK_LPAREN:const name=left.name;const args=[];let expression;while(this.lookahead(0)!==Token.TOK_RPAREN){if(this.lookahead(0)===Token.TOK_CURRENT){expression={type:Token.TOK_CURRENT};this.advance()}else{expression=this.expression(0)}if(this.lookahead(0)===Token.TOK_COMMA){this.match(Token.TOK_COMMA)}args.push(expression)}this.match(Token.TOK_RPAREN);const node={name:name,type:"Function",children:args};return node;case Token.TOK_FILTER:const condition=this.expression(0);this.match(Token.TOK_RBRACKET);right=this.lookahead(0)===Token.TOK_FLATTEN&&{type:"Identity"}||this.parseProjectionRHS(bindingPower.Filter);return{type:"FilterProjection",children:[left,right,condition]};case Token.TOK_FLATTEN:const leftNode={type:Token.TOK_FLATTEN,children:[left]};const rightNode=this.parseProjectionRHS(bindingPower.Flatten);return{type:"Projection",children:[leftNode,rightNode]};case Token.TOK_EQ:case Token.TOK_NE:case Token.TOK_GT:case Token.TOK_GTE:case Token.TOK_LT:case Token.TOK_LTE:return this.parseComparator(left,tokenName);case Token.TOK_LBRACKET:const token=this.lookaheadToken(0);if(token.type===Token.TOK_NUMBER||token.type===Token.TOK_COLON){right=this.parseIndexExpression();return this.projectIfSlice(left,right)}this.match(Token.TOK_STAR);this.match(Token.TOK_RBRACKET);right=this.parseProjectionRHS(bindingPower.Star);return{type:"Projection",children:[left,right]};default:return this.errorToken(this.lookaheadToken(0))}}match(tokenType){if(this.lookahead(0)===tokenType){this.advance();return}else{const token=this.lookaheadToken(0);this.errorToken(token,`Expected ${tokenType}, got: ${token.type}`)}}errorToken(token,message=""){const error=new Error(message||`Invalid token (${token.type}): "${token.value}"`);error.name="ParserError";throw error}parseIndexExpression(){if(this.lookahead(0)===Token.TOK_COLON||this.lookahead(1)===Token.TOK_COLON){return this.parseSliceExpression()}const node={type:"Index",value:this.lookaheadToken(0).value};this.advance();this.match(Token.TOK_RBRACKET);return node}projectIfSlice(left,right){const indexExpr={type:"IndexExpression",children:[left,right]};if(right.type==="Slice"){return{children:[indexExpr,this.parseProjectionRHS(bindingPower.Star)],type:"Projection"}}return indexExpr}parseSliceExpression(){const parts=[null,null,null];let index=0;let currentTokenType=this.lookahead(0);while(currentTokenType!==Token.TOK_RBRACKET&&index<3){if(currentTokenType===Token.TOK_COLON){index+=1;this.advance()}else if(currentTokenType===Token.TOK_NUMBER){parts[index]=this.lookaheadToken(0).value;this.advance()}else{const token=this.lookaheadToken(0);this.errorToken(token,`Syntax error, unexpected token: ${token.value}(${token.type})`)}currentTokenType=this.lookahead(0)}this.match(Token.TOK_RBRACKET);return{children:parts,type:"Slice"}}parseComparator(left,comparator){const right=this.expression(bindingPower[comparator]);return{type:"Comparator",name:comparator,children:[left,right]}}parseDotRHS(rbp){const lookahead=this.lookahead(0);const exprTokens=[Token.TOK_UNQUOTEDIDENTIFIER,Token.TOK_QUOTEDIDENTIFIER,Token.TOK_STAR];if(exprTokens.includes(lookahead)){return this.expression(rbp)}if(lookahead===Token.TOK_LBRACKET){this.match(Token.TOK_LBRACKET);return this.parseMultiselectList()}if(lookahead===Token.TOK_LBRACE){this.match(Token.TOK_LBRACE);return this.parseMultiselectHash()}const token=this.lookaheadToken(0);this.errorToken(token,`Syntax error, unexpected token: ${token.value}(${token.type})`)}parseProjectionRHS(rbp){if(bindingPower[this.lookahead(0)]<10){return{type:"Identity"}}if(this.lookahead(0)===Token.TOK_LBRACKET){return this.expression(rbp)}if(this.lookahead(0)===Token.TOK_FILTER){return this.expression(rbp)}if(this.lookahead(0)===Token.TOK_DOT){this.match(Token.TOK_DOT);return this.parseDotRHS(rbp)}const token=this.lookaheadToken(0);this.errorToken(token,`Syntax error, unexpected token: ${token.value}(${token.type})`)}parseMultiselectList(){const expressions=[];while(this.lookahead(0)!==Token.TOK_RBRACKET){const expression=this.expression(0);expressions.push(expression);if(this.lookahead(0)===Token.TOK_COMMA){this.match(Token.TOK_COMMA);if(this.lookahead(0)===Token.TOK_RBRACKET){throw new Error("Unexpected token Rbracket")}}}this.match(Token.TOK_RBRACKET);return{type:"MultiSelectList",children:expressions}}parseMultiselectHash(){const pairs=[];const identifierTypes=[Token.TOK_UNQUOTEDIDENTIFIER,Token.TOK_QUOTEDIDENTIFIER];let keyToken;let keyName;let value;for(;;){keyToken=this.lookaheadToken(0);if(!identifierTypes.includes(keyToken.type)){throw new Error(`Expecting an identifier token, got: ${keyToken.type}`)}keyName=keyToken.value;this.advance();this.match(Token.TOK_COLON);value=this.expression(0);pairs.push({value:value,type:"KeyValuePair",name:keyName});if(this.lookahead(0)===Token.TOK_COMMA){this.match(Token.TOK_COMMA)}else if(this.lookahead(0)===Token.TOK_RBRACE){this.match(Token.TOK_RBRACE);break}}return{type:"MultiSelectHash",children:pairs}}}const Parser=new TokenParser;var InputArgument;(function(InputArgument){InputArgument[InputArgument["TYPE_NUMBER"]=0]="TYPE_NUMBER";InputArgument[InputArgument["TYPE_ANY"]=1]="TYPE_ANY";InputArgument[InputArgument["TYPE_STRING"]=2]="TYPE_STRING";InputArgument[InputArgument["TYPE_ARRAY"]=3]="TYPE_ARRAY";InputArgument[InputArgument["TYPE_OBJECT"]=4]="TYPE_OBJECT";InputArgument[InputArgument["TYPE_BOOLEAN"]=5]="TYPE_BOOLEAN";InputArgument[InputArgument["TYPE_EXPREF"]=6]="TYPE_EXPREF";InputArgument[InputArgument["TYPE_NULL"]=7]="TYPE_NULL";InputArgument[InputArgument["TYPE_ARRAY_NUMBER"]=8]="TYPE_ARRAY_NUMBER";InputArgument[InputArgument["TYPE_ARRAY_STRING"]=9]="TYPE_ARRAY_STRING"})(InputArgument||(InputArgument={}));class Runtime{constructor(interpreter){this.TYPE_NAME_TABLE={[InputArgument.TYPE_NUMBER]:"number",[InputArgument.TYPE_ANY]:"any",[InputArgument.TYPE_STRING]:"string",[InputArgument.TYPE_ARRAY]:"array",[InputArgument.TYPE_OBJECT]:"object",[InputArgument.TYPE_BOOLEAN]:"boolean",[InputArgument.TYPE_EXPREF]:"expression",[InputArgument.TYPE_NULL]:"null",[InputArgument.TYPE_ARRAY_NUMBER]:"Array<number>",[InputArgument.TYPE_ARRAY_STRING]:"Array<string>"};this.functionAbs=([inputValue])=>Math.abs(inputValue);this.functionAvg=([inputArray])=>{let sum=0;for(let i=0;i<inputArray.length;i+=1){sum+=inputArray[i]}return sum/inputArray.length};this.functionCeil=([inputValue])=>Math.ceil(inputValue);this.functionContains=resolvedArgs=>{const[searchable,searchValue]=resolvedArgs;return searchable.includes(searchValue)};this.functionEndsWith=resolvedArgs=>{const[searchStr,suffix]=resolvedArgs;return searchStr.includes(suffix,searchStr.length-suffix.length)};this.functionFloor=([inputValue])=>Math.floor(inputValue);this.functionJoin=resolvedArgs=>{const[joinChar,listJoin]=resolvedArgs;return listJoin.join(joinChar)};this.functionKeys=([inputObject])=>Object.keys(inputObject);this.functionLength=([inputValue])=>{if(!isObject(inputValue)){return inputValue.length}return Object.keys(inputValue).length};this.functionMap=resolvedArgs=>{if(!this._interpreter){return[]}const mapped=[];const interpreter=this._interpreter;const exprefNode=resolvedArgs[0];const elements=resolvedArgs[1];for(let i=0;i<elements.length;i+=1){mapped.push(interpreter.visit(exprefNode,elements[i]))}return mapped};this.functionMax=([inputValue])=>{if(!inputValue.length){return null}const typeName=this.getTypeName(inputValue[0]);if(typeName===InputArgument.TYPE_NUMBER){return Math.max(...inputValue)}const elements=inputValue;let maxElement=elements[0];for(let i=1;i<elements.length;i+=1){if(maxElement.localeCompare(elements[i])<0){maxElement=elements[i]}}return maxElement};this.functionMaxBy=resolvedArgs=>{const exprefNode=resolvedArgs[1];const resolvedArray=resolvedArgs[0];const keyFunction=this.createKeyFunction(exprefNode,[InputArgument.TYPE_NUMBER,InputArgument.TYPE_STRING]);let maxNumber=-Infinity;let maxRecord;let current;for(let i=0;i<resolvedArray.length;i+=1){current=keyFunction&&keyFunction(resolvedArray[i]);if(current!==undefined&¤t>maxNumber){maxNumber=current;maxRecord=resolvedArray[i]}}return maxRecord};this.functionMerge=resolvedArgs=>{let merged={};for(let i=0;i<resolvedArgs.length;i+=1){const current=resolvedArgs[i];merged=Object.assign(merged,current)}return merged};this.functionMin=([inputValue])=>{if(!inputValue.length){return null}const typeName=this.getTypeName(inputValue[0]);if(typeName===InputArgument.TYPE_NUMBER){return Math.min(...inputValue)}const elements=inputValue;let minElement=elements[0];for(let i=1;i<elements.length;i+=1){if(elements[i].localeCompare(minElement)<0){minElement=elements[i]}}return minElement};this.functionMinBy=resolvedArgs=>{const exprefNode=resolvedArgs[1];const resolvedArray=resolvedArgs[0];const keyFunction=this.createKeyFunction(exprefNode,[InputArgument.TYPE_NUMBER,InputArgument.TYPE_STRING]);let minNumber=Infinity;let minRecord;let current;for(let i=0;i<resolvedArray.length;i+=1){current=keyFunction&&keyFunction(resolvedArray[i]);if(current!==undefined&¤t<minNumber){minNumber=current;minRecord=resolvedArray[i]}}return minRecord};this.functionNotNull=resolvedArgs=>{for(let i=0;i<resolvedArgs.length;i+=1){if(this.getTypeName(resolvedArgs[i])!==InputArgument.TYPE_NULL){return resolvedArgs[i]}}return null};this.functionReverse=([inputValue])=>{const typeName=this.getTypeName(inputValue);if(typeName===InputArgument.TYPE_STRING){const originalStr=inputValue;let reversedStr="";for(let i=originalStr.length-1;i>=0;i-=1){reversedStr+=originalStr[i]}return reversedStr}const reversedArray=inputValue.slice(0);reversedArray.reverse();return reversedArray};this.functionSort=([inputValue])=>[...inputValue].sort();this.functionSortBy=resolvedArgs=>{if(!this._interpreter){return[]}const sortedArray=resolvedArgs[0].slice(0);if(sortedArray.length===0){return sortedArray}const interpreter=this._interpreter;const exprefNode=resolvedArgs[1];const requiredType=this.getTypeName(interpreter.visit(exprefNode,sortedArray[0]));if(requiredType!==undefined&&![InputArgument.TYPE_NUMBER,InputArgument.TYPE_STRING].includes(requiredType)){throw new Error(`TypeError: unexpected type (${this.TYPE_NAME_TABLE[requiredType]})`)}const decorated=[];for(let i=0;i<sortedArray.length;i+=1){decorated.push([i,sortedArray[i]])}decorated.sort(((a,b)=>{const exprA=interpreter.visit(exprefNode,a[1]);const exprB=interpreter.visit(exprefNode,b[1]);if(this.getTypeName(exprA)!==requiredType){throw new Error(`TypeError: expected (${this.TYPE_NAME_TABLE[requiredType]}), received ${this.TYPE_NAME_TABLE[this.getTypeName(exprA)]}`)}else if(this.getTypeName(exprB)!==requiredType){throw new Error(`TypeError: expected (${this.TYPE_NAME_TABLE[requiredType]}), received ${this.TYPE_NAME_TABLE[this.getTypeName(exprB)]}`)}if(exprA>exprB){return 1}return exprA<exprB?-1:a[0]-b[0]}));for(let j=0;j<decorated.length;j+=1){sortedArray[j]=decorated[j][1]}return sortedArray};this.functionStartsWith=([searchable,searchStr])=>searchable.startsWith(searchStr);this.functionSum=([inputValue])=>inputValue.reduce(((x,y)=>x+y),0);this.functionToArray=([inputValue])=>{if(this.getTypeName(inputValue)===InputArgument.TYPE_ARRAY){return inputValue}return[inputValue]};this.functionToNumber=([inputValue])=>{const typeName=this.getTypeName(inputValue);let convertedValue;if(typeName===InputArgument.TYPE_NUMBER){return inputValue}if(typeName===InputArgument.TYPE_STRING){convertedValue=+inputValue;if(!isNaN(convertedValue)){return convertedValue}}return null};this.functionToString=([inputValue])=>{if(this.getTypeName(inputValue)===InputArgument.TYPE_STRING){return inputValue}return JSON.stringify(inputValue)};this.functionType=([inputValue])=>{switch(this.getTypeName(inputValue)){case InputArgument.TYPE_NUMBER:return"number";case InputArgument.TYPE_STRING:return"string";case InputArgument.TYPE_ARRAY:return"array";case InputArgument.TYPE_OBJECT:return"object";case InputArgument.TYPE_BOOLEAN:return"boolean";case InputArgument.TYPE_EXPREF:return"expref";case InputArgument.TYPE_NULL:return"null";default:return}};this.functionValues=([inputObject])=>Object.values(inputObject);this.functionTable={abs:{_func:this.functionAbs,_signature:[{types:[InputArgument.TYPE_NUMBER]}]},avg:{_func:this.functionAvg,_signature:[{types:[InputArgument.TYPE_ARRAY_NUMBER]}]},ceil:{_func:this.functionCeil,_signature:[{types:[InputArgument.TYPE_NUMBER]}]},contains:{_func:this.functionContains,_signature:[{types:[InputArgument.TYPE_STRING,InputArgument.TYPE_ARRAY]},{types:[InputArgument.TYPE_ANY]}]},ends_with:{_func:this.functionEndsWith,_signature:[{types:[InputArgument.TYPE_STRING]},{types:[InputArgument.TYPE_STRING]}]},floor:{_func:this.functionFloor,_signature:[{types:[InputArgument.TYPE_NUMBER]}]},join:{_func:this.functionJoin,_signature:[{types:[InputArgument.TYPE_STRING]},{types:[InputArgument.TYPE_ARRAY_STRING]}]},keys:{_func:this.functionKeys,_signature:[{types:[InputArgument.TYPE_OBJECT]}]},length:{_func:this.functionLength,_signature:[{types:[InputArgument.TYPE_STRING,InputArgument.TYPE_ARRAY,InputArgument.TYPE_OBJECT]}]},map:{_func:this.functionMap,_signature:[{types:[InputArgument.TYPE_EXPREF]},{types:[InputArgument.TYPE_ARRAY]}]},max:{_func:this.functionMax,_signature:[{types:[InputArgument.TYPE_ARRAY_NUMBER,InputArgument.TYPE_ARRAY_STRING]}]},max_by:{_func:this.functionMaxBy,_signature:[{types:[InputArgument.TYPE_ARRAY]},{types:[InputArgument.TYPE_EXPREF]}]},merge:{_func:this.functionMerge,_signature:[{types:[InputArgument.TYPE_OBJECT],variadic:true}]},min:{_func:this.functionMin,_signature:[{types:[InputArgument.TYPE_ARRAY_NUMBER,InputArgument.TYPE_ARRAY_STRING]}]},min_by:{_func:this.functionMinBy,_signature:[{types:[InputArgument.TYPE_ARRAY]},{types:[InputArgument.TYPE_EXPREF]}]},not_null:{_func:this.functionNotNull,_signature:[{types:[InputArgument.TYPE_ANY],variadic:true}]},reverse:{_func:this.functionReverse,_signature:[{types:[InputArgument.TYPE_STRING,InputArgument.TYPE_ARRAY]}]},sort:{_func:this.functionSort,_signature:[{types:[InputArgument.TYPE_ARRAY_STRING,InputArgument.TYPE_ARRAY_NUMBER]}]},sort_by:{_func:this.functionSortBy,_signature:[{types:[InputArgument.TYPE_ARRAY]},{types:[InputArgument.TYPE_EXPREF]}]},starts_with:{_func:this.functionStartsWith,_signature:[{types:[InputArgument.TYPE_STRING]},{types:[InputArgument.TYPE_STRING]}]},sum:{_func:this.functionSum,_signature:[{types:[InputArgument.TYPE_ARRAY_NUMBER]}]},to_array:{_func:this.functionToArray,_signature:[{types:[InputArgument.TYPE_ANY]}]},to_number:{_func:this.functionToNumber,_signature:[{types:[InputArgument.TYPE_ANY]}]},to_string:{_func:this.functionToString,_signature:[{types:[InputArgument.TYPE_ANY]}]},type:{_func:this.functionType,_signature:[{types:[InputArgument.TYPE_ANY]}]},values:{_func:this.functionValues,_signature:[{types:[InputArgument.TYPE_OBJECT]}]}};this._interpreter=interpreter}registerFunction(name,customFunction,signature){if(name in this.functionTable){throw new Error(`Function already defined: ${name}()`)}this.functionTable[name]={_func:customFunction.bind(this),_signature:signature}}callFunction(name,resolvedArgs){const functionEntry=this.functionTable[name];if(functionEntry===undefined){throw new Error(`Unknown function: ${name}()`)}this.validateArgs(name,resolvedArgs,functionEntry._signature);return functionEntry._func.call(this,resolvedArgs)}validateInputSignatures(name,signature){for(let i=0;i<signature.length;i+=1){if("variadic"in signature[i]&&i!==signature.length-1){throw new Error(`ArgumentError: ${name}() 'variadic' argument ${i+1} must occur last`)}}}validateArgs(name,args,signature){var _a,_b;let pluralized;this.validateInputSignatures(name,signature);const numberOfRequiredArgs=signature.filter((argSignature=>{var _a;return(_a=!argSignature.optional)!==null&&_a!==void 0?_a:false})).length;const lastArgIsVariadic=(_b=(_a=signature[signature.length-1])===null||_a===void 0?void 0:_a.variadic)!==null&&_b!==void 0?_b:false;const tooFewArgs=args.length<numberOfRequiredArgs;const tooManyArgs=args.length>signature.length;const tooFewModifier=tooFewArgs&&(!lastArgIsVariadic&&numberOfRequiredArgs>1||lastArgIsVariadic)?"at least ":"";if(lastArgIsVariadic&&tooFewArgs||!lastArgIsVariadic&&(tooFewArgs||tooManyArgs)){pluralized=signature.length>1;throw new Error(`ArgumentError: ${name}() takes ${tooFewModifier}${numberOfRequiredArgs} argument${pluralized&&"s"||""} but received ${args.length}`)}let currentSpec;let actualType;let typeMatched;for(let i=0;i<signature.length;i+=1){typeMatched=false;currentSpec=signature[i].types;actualType=this.getTypeName(args[i]);let j;for(j=0;j<currentSpec.length;j+=1){if(actualType!==undefined&&this.typeMatches(actualType,currentSpec[j],args[i])){typeMatched=true;break}}if(!typeMatched&&actualType!==undefined){const expected=currentSpec.map((typeIdentifier=>this.TYPE_NAME_TABLE[typeIdentifier])).join(" | ");throw new Error(`TypeError: ${name}() expected argument ${i+1} to be type (${expected}) but received type ${this.TYPE_NAME_TABLE[actualType]} instead.`)}}}typeMatches(actual,expected,argValue){if(expected===InputArgument.TYPE_ANY){return true}if(expected===InputArgument.TYPE_ARRAY_STRING||expected===InputArgument.TYPE_ARRAY_NUMBER||expected===InputArgument.TYPE_ARRAY){if(expected===InputArgument.TYPE_ARRAY){return actual===InputArgument.TYPE_ARRAY}if(actual===InputArgument.TYPE_ARRAY){let subtype;if(expected===InputArgument.TYPE_ARRAY_NUMBER){subtype=InputArgument.TYPE_NUMBER}else if(expected===InputArgument.TYPE_ARRAY_STRING){subtype=InputArgument.TYPE_STRING}for(let i=0;i<argValue.length;i+=1){const typeName=this.getTypeName(argValue[i]);if(typeName!==undefined&&subtype!==undefined&&!this.typeMatches(typeName,subtype,argValue[i])){return false}}return true}}else{return actual===expected}return false}getTypeName(obj){switch(Object.prototype.toString.call(obj)){case"[object String]":return InputArgument.TYPE_STRING;case"[object Number]":return InputArgument.TYPE_NUMBER;case"[object Array]":return InputArgument.TYPE_ARRAY;case"[object Boolean]":return InputArgument.TYPE_BOOLEAN;case"[object Null]":return InputArgument.TYPE_NULL;case"[object Object]":if(obj.jmespathType===Token.TOK_EXPREF){return InputArgument.TYPE_EXPREF}return InputArgument.TYPE_OBJECT;default:return}}createKeyFunction(exprefNode,allowedTypes){if(!this._interpreter){return}const interpreter=this._interpreter;const keyFunc=x=>{const current=interpreter.visit(exprefNode,x);if(!allowedTypes.includes(this.getTypeName(current))){const msg=`TypeError: expected one of (${allowedTypes.map((t=>this.TYPE_NAME_TABLE[t])).join(" | ")}), received ${this.TYPE_NAME_TABLE[this.getTypeName(current)]}`;throw new Error(msg)}return current};return keyFunc}}class TreeInterpreter$1{constructor(){this._rootValue=null;this.runtime=new Runtime(this)}search(node,value){this._rootValue=value;return this.visit(node,value)}visit(node,value){let matched;let current;let result;let first;let second;let field;let left;let right;let collected;let i;let base;switch(node.type){case"Field":if(value===null){return null}if(isObject(value)){field=value[node.name];if(field===undefined){return null}return field}return null;case"Subexpression":result=this.visit(node.children[0],value);for(i=1;i<node.children.length;i+=1){result=this.visit(node.children[1],result);if(result===null){return null}}return result;case"IndexExpression":left=this.visit(node.children[0],value);right=this.visit(node.children[1],left);return right;case"Index":if(!Array.isArray(value)){return null}let index=node.value;if(index<0){index=value.length+index}result=value[index];if(result===undefined){result=null}return result;case"Slice":if(!Array.isArray(value)){return null}const sliceParams=[...node.children];const computed=this.computeSliceParams(value.length,sliceParams);const[start,stop,step]=computed;result=[];if(step>0){for(i=start;i<stop;i+=step){result.push(value[i])}}else{for(i=start;i>stop;i+=step){result.push(value[i])}}return result;case"Projection":base=this.visit(node.children[0],value);if(!Array.isArray(base)){return null}collected=[];for(i=0;i<base.length;i+=1){current=this.visit(node.children[1],base[i]);if(current!==null){collected.push(current)}}return collected;case"ValueProjection":base=this.visit(node.children[0],value);if(!isObject(base)){return null}collected=[];const values=Object.values(base);for(i=0;i<values.length;i+=1){current=this.visit(node.children[1],values[i]);if(current!==null){collected.push(current)}}return collected;case"FilterProjection":base=this.visit(node.children[0],value);if(!Array.isArray(base)){return null}const filtered=[];const finalResults=[];for(i=0;i<base.length;i+=1){matched=this.visit(node.children[2],base[i]);if(!isFalse(matched)){filtered.push(base[i])}}for(let j=0;j<filtered.length;j+=1){current=this.visit(node.children[1],filtered[j]);if(current!==null){finalResults.push(current)}}return finalResults;case"Comparator":first=this.visit(node.children[0],value);second=this.visit(node.children[1],value);switch(node.name){case Token.TOK_EQ:result=strictDeepEqual(first,second);break;case Token.TOK_NE:result=!strictDeepEqual(first,second);break;case Token.TOK_GT:result=first>second;break;case Token.TOK_GTE:result=first>=second;break;case Token.TOK_LT:result=first<second;break;case Token.TOK_LTE:result=first<=second;break;default:throw new Error(`Unknown comparator: ${node.name}`)}return result;case Token.TOK_FLATTEN:const original=this.visit(node.children[0],value);if(!Array.isArray(original)){return null}let merged=[];for(i=0;i<original.length;i+=1){current=original[i];if(Array.isArray(current)){merged=[...merged,...current]}else{merged.push(current)}}return merged;case"Identity":return value;case"MultiSelectList":if(value===null){return null}collected=[];for(i=0;i<node.children.length;i+=1){collected.push(this.visit(node.children[i],value))}return collected;case"MultiSelectHash":if(value===null){return null}collected={};let child;for(i=0;i<node.children.length;i+=1){child=node.children[i];collected[child.name]=this.visit(child.value,value)}return collected;case"OrExpression":matched=this.visit(node.children[0],value);if(isFalse(matched)){matched=this.visit(node.children[1],value)}return matched;case"AndExpression":first=this.visit(node.children[0],value);if(isFalse(first)){return first}return this.visit(node.children[1],value);case"NotExpression":first=this.visit(node.children[0],value);return isFalse(first);case"Literal":return node.value;case Token.TOK_PIPE:left=this.visit(node.children[0],value);return this.visit(node.children[1],left);case Token.TOK_CURRENT:return value;case Token.TOK_ROOT:return this._rootValue;case"Function":const resolvedArgs=[];for(let j=0;j<node.children.length;j+=1){resolvedArgs.push(this.visit(node.children[j],value))}return this.runtime.callFunction(node.name,resolvedArgs);case"ExpressionReference":const refNode=node.children[0];refNode.jmespathType=Token.TOK_EXPREF;return refNode;default:throw new Error(`Unknown node type: ${node.type}`)}}computeSliceParams(arrayLength,sliceParams){let[start,stop,step]=sliceParams;if(step===null){step=1}else if(step===0){const error=new Error("Invalid slice, step cannot be 0");error.name="RuntimeError";throw error}const stepValueNegative=step<0?true:false;start=start===null?stepValueNegative?arrayLength-1:0:this.capSliceRange(arrayLength,start,step);stop=stop===null?stepValueNegative?-1:arrayLength:this.capSliceRange(arrayLength,stop,step);return[start,stop,step]}capSliceRange(arrayLength,actualValue,step){let nextActualValue=actualValue;if(nextActualValue<0){nextActualValue+=arrayLength;if(nextActualValue<0){nextActualValue=step<0?-1:0}}else if(nextActualValue>=arrayLength){nextActualValue=step<0?arrayLength-1:arrayLength}return nextActualValue}}const TreeInterpreterInstance=new TreeInterpreter$1;const TYPE_ANY=InputArgument.TYPE_ANY;const TYPE_ARRAY=InputArgument.TYPE_ARRAY;const TYPE_ARRAY_NUMBER=InputArgument.TYPE_ARRAY_NUMBER;const TYPE_ARRAY_STRING=InputArgument.TYPE_ARRAY_STRING;const TYPE_BOOLEAN=InputArgument.TYPE_BOOLEAN;const TYPE_EXPREF=InputArgument.TYPE_EXPREF;const TYPE_NULL=InputArgument.TYPE_NULL;const TYPE_NUMBER=InputArgument.TYPE_NUMBER;const TYPE_OBJECT=InputArgument.TYPE_OBJECT;const TYPE_STRING=InputArgument.TYPE_STRING;function compile(expression){const nodeTree=Parser.parse(expression);return nodeTree}function tokenize(expression){return Lexer.tokenize(expression)}const registerFunction=(functionName,customFunction,signature)=>{TreeInterpreterInstance.runtime.registerFunction(functionName,customFunction,signature)};function search(data,expression){const nodeTree=Parser.parse(expression);return TreeInterpreterInstance.search(nodeTree,data)}const TreeInterpreter=TreeInterpreterInstance;const jmespath={compile:compile,registerFunction:registerFunction,search:search,tokenize:tokenize,TreeInterpreter:TreeInterpreter,TYPE_ANY:TYPE_ANY,TYPE_ARRAY_NUMBER:TYPE_ARRAY_NUMBER,TYPE_ARRAY_STRING:TYPE_ARRAY_STRING,TYPE_ARRAY:TYPE_ARRAY,TYPE_BOOLEAN:TYPE_BOOLEAN,TYPE_EXPREF:TYPE_EXPREF,TYPE_NULL:TYPE_NULL,TYPE_NUMBER:TYPE_NUMBER,TYPE_OBJECT:TYPE_OBJECT,TYPE_STRING:TYPE_STRING};exports.TYPE_ANY=TYPE_ANY;exports.TYPE_ARRAY=TYPE_ARRAY;exports.TYPE_ARRAY_NUMBER=TYPE_ARRAY_NUMBER;exports.TYPE_ARRAY_STRING=TYPE_ARRAY_STRING;exports.TYPE_BOOLEAN=TYPE_BOOLEAN;exports.TYPE_EXPREF=TYPE_EXPREF;exports.TYPE_NULL=TYPE_NULL;exports.TYPE_NUMBER=TYPE_NUMBER;exports.TYPE_OBJECT=TYPE_OBJECT;exports.TYPE_STRING=TYPE_STRING;exports.TreeInterpreter=TreeInterpreter;exports.compile=compile;exports.default=jmespath;exports.jmespath=jmespath;exports.registerFunction=registerFunction;exports.search=search;exports.tokenize=tokenize;Object.defineProperty(exports,"__esModule",{value:true})}));(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?factory(exports,require("@angular/common"),require("@angular/core"),require("@angular/forms"),require("imask")):typeof define==="function"&&define.amd?define(["exports","@angular/common","@angular/core","@angular/forms","imask"],factory):(global=typeof globalThis!=="undefined"?globalThis:global||self,factory(global.angularIMask={},global.ng.common,global.ng.core,global.ng.forms,global.IMask))})(this,(function(exports,common,i0,forms,IMask){"use strict";function _interopNamespaceDefault(e){var n=Object.create(null);if(e){Object.keys(e).forEach((function(k){if(k!=="default"){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}})}}))}n.default=e;return Object.freeze(n)}var i0__namespace=_interopNamespaceDefault(i0);class IMaskFactory{}IMaskFactory.\u0275fac=i0__namespace.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"13.1.3",ngImport:i0__namespace,type:IMaskFactory,deps:[],target:i0__namespace.\u0275\u0275FactoryTarget.Injectable});IMaskFactory.\u0275prov=i0__namespace.\u0275\u0275ngDeclareInjectable({minVersion:"12.0.0",version:"13.1.3",ngImport:i0__namespace,type:IMaskFactory,providedIn:"root"});i0__namespace.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"13.1.3",ngImport:i0__namespace,type:IMaskFactory,decorators:[{type:i0.Injectable,args:[{providedIn:"root"}]}]});const MASKEDINPUT_VALUE_ACCESSOR={provide:forms.NG_VALUE_ACCESSOR,useExisting:i0.forwardRef((()=>IMaskDirective)),multi:true};const DEFAULT_IMASK_ELEMENT=elementRef=>elementRef.nativeElement;class IMaskDirective{constructor(_elementRef,_renderer,_factory,_platformId,_compositionMode){this._elementRef=_elementRef;this._renderer=_renderer;this._factory=_factory;this._platformId=_platformId;this._compositionMode=_compositionMode;this.onTouched=()=>{};this.onChange=()=>{};this.imaskElement=DEFAULT_IMASK_ELEMENT;this.accept=new i0.EventEmitter;this.complete=new i0.EventEmitter;this._viewInitialized=false;this._composing=false;this._writing=false;if(this._compositionMode==null){this._compositionMode=!this._isAndroid()}}get element(){return this.imaskElement(this._elementRef,this)}get maskValue(){if(!this.maskRef)return this.element.value;if(this.unmask==="typed")return this.maskRef.typedValue;if(this.unmask)return this.maskRef.unmaskedValue;return this.maskRef.value}set maskValue(value){if(this.maskRef){if(this.unmask==="typed")this.maskRef.typedValue=value;else if(this.unmask)this.maskRef.unmaskedValue=value;else this.maskRef.value=value}else{this._renderer.setProperty(this.element,"value",value)}}ngAfterViewInit(){if(this.imask)this.initMask();this._viewInitialized=true}ngOnChanges(changes){if(changes.elementRef&&!this.imaskElement)this.imaskElement=DEFAULT_IMASK_ELEMENT;if(!changes.imask||!this._viewInitialized)return;if(this.imask){if(this.maskRef)this.maskRef.updateOptions(this.imask);else{this.initMask();this.onChange(this.maskValue)}}else{this.destroyMask()}}destroyMask(){if(this.maskRef){this.maskRef.destroy();delete this.maskRef}}ngOnDestroy(){this.destroyMask();this.accept.complete();this.complete.complete()}beginWrite(value){this._writing=true;this._writingValue=value}endWrite(){this._writing=false;return this._writingValue}writeValue(value){value=value==null?"":value;if(this.maskRef){this.beginWrite(value);if(this.maskValue!==value||typeof value!=="string"&&this.maskRef.value===""&&!this.maskRef.el.isActive){this.maskValue=value}}else{this._renderer.setProperty(this.element,"value",value)}}_onAccept(){const value=this.maskValue;if(this._writing&&value===this.endWrite())return;this.onChange(value);this.accept.emit(value)}_onComplete(){this.complete.emit(this.maskValue)}initMask(){this.maskRef=this._factory.create(this.element,this.imask).on("accept",this._onAccept.bind(this)).on("complete",this._onComplete.bind(this))}setDisabledState(isDisabled){this._renderer.setProperty(this.element,"disabled",isDisabled)}registerOnChange(fn){this.onChange=fn}registerOnTouched(fn){this.onTouched=fn}_handleInput(value){if(this.maskRef)return;if(!this._compositionMode||this._compositionMode&&!this._composing){this.onChange(value)}}_compositionStart(){this._composing=true}_compositionEnd(value){this._composing=false;this._compositionMode&&this._handleInput(value)}_isAndroid(){return common.isPlatformBrowser(this._platformId)&&/android (\d+)/.test(navigator.userAgent.toLowerCase())}}IMaskDirective.\u0275fac=i0__namespace.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"13.1.3",ngImport:i0__namespace,type:IMaskDirective,deps:[{token:i0__namespace.ElementRef},{token:i0__namespace.Renderer2},{token:IMaskFactory},{token:i0.PLATFORM_ID},{token:forms.COMPOSITION_BUFFER_MODE,optional:true}],target:i0__namespace.\u0275\u0275FactoryTarget.Directive});IMaskDirective.\u0275dir=i0__namespace.\u0275\u0275ngDeclareDirective({minVersion:"12.0.0",version:"13.1.3",type:IMaskDirective,selector:"[imask]",inputs:{imask:"imask",unmask:"unmask",imaskElement:"imaskElement"},outputs:{accept:"accept",complete:"complete"},host:{listeners:{input:"_handleInput($event.target.value)",blur:"onTouched()",compositionstart:"_compositionStart()",compositionend:"_compositionEnd($event.target.value)"}},providers:[MASKEDINPUT_VALUE_ACCESSOR],exportAs:["imask"],usesOnChanges:true,ngImport:i0__namespace});i0__namespace.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"13.1.3",ngImport:i0__namespace,type:IMaskDirective,decorators:[{type:i0.Directive,args:[{selector:"[imask]",exportAs:"imask",host:{"(input)":"_handleInput($event.target.value)","(blur)":"onTouched()","(compositionstart)":"_compositionStart()","(compositionend)":"_compositionEnd($event.target.value)"},providers:[MASKEDINPUT_VALUE_ACCESSOR]}]}],ctorParameters:function(){return[{type:i0__namespace.ElementRef},{type:i0__namespace.Renderer2},{type:IMaskFactory},{type:undefined,decorators:[{type:i0.Inject,args:[i0.PLATFORM_ID]}]},{type:undefined,decorators:[{type:i0.Optional},{type:i0.Inject,args:[forms.COMPOSITION_BUFFER_MODE]}]}]},propDecorators:{imask:[{type:i0.Input}],unmask:[{type:i0.Input}],imaskElement:[{type:i0.Input}],accept:[{type:i0.Output}],complete:[{type:i0.Output}]}});class IMaskPipe{transform(...args){return IMask.pipe(...args)}}IMaskPipe.\u0275fac=i0__namespace.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"13.1.3",ngImport:i0__namespace,type:IMaskPipe,deps:[],target:i0__namespace.\u0275\u0275FactoryTarget.Pipe});IMaskPipe.\u0275pipe=i0__namespace.\u0275\u0275ngDeclarePipe({minVersion:"12.0.0",version:"13.1.3",ngImport:i0__namespace,type:IMaskPipe,name:"imask"});i0__namespace.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"13.1.3",ngImport:i0__namespace,type:IMaskPipe,decorators:[{type:i0.Pipe,args:[{name:"imask"}]}]});class DefaultImaskFactory{create(el,opts){return IMask(el,opts)}}DefaultImaskFactory.\u0275fac=i0__namespace.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"13.1.3",ngImport:i0__namespace,type:DefaultImaskFactory,deps:[],target:i0__namespace.\u0275\u0275FactoryTarget.Injectable});DefaultImaskFactory.\u0275prov=i0__namespace.\u0275\u0275ngDeclareInjectable({minVersion:"12.0.0",version:"13.1.3",ngImport:i0__namespace,type:DefaultImaskFactory,providedIn:"root"});i0__namespace.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"13.1.3",ngImport:i0__namespace,type:DefaultImaskFactory,decorators:[{type:i0.Injectable,args:[{providedIn:"root"}]}]});class IMaskDirectiveModule{}IMaskDirectiveModule.\u0275fac=i0__namespace.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"13.1.3",ngImport:i0__namespace,type:IMaskDirectiveModule,deps:[],target:i0__namespace.\u0275\u0275FactoryTarget.NgModule});IMaskDirectiveModule.\u0275mod=i0__namespace.\u0275\u0275ngDeclareNgModule({minVersion:"12.0.0",version:"13.1.3",ngImport:i0__namespace,type:IMaskDirectiveModule,declarations:[IMaskDirective],imports:[common.CommonModule],exports:[IMaskDirective]});IMaskDirectiveModule.\u0275inj=i0__namespace.\u0275\u0275ngDeclareInjector({minVersion:"12.0.0",version:"13.1.3",ngImport:i0__namespace,type:IMaskDirectiveModule,providers:[{provide:IMaskFactory,useClass:DefaultImaskFactory}],imports:[[common.CommonModule]]});i0__namespace.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"13.1.3",ngImport:i0__namespace,type:IMaskDirectiveModule,decorators:[{type:i0.NgModule,args:[{imports:[common.CommonModule],declarations:[IMaskDirective],providers:[{provide:IMaskFactory,useClass:DefaultImaskFactory}],exports:[IMaskDirective]}]}]});class IMaskModule{}IMaskModule.\u0275fac=i0__namespace.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"13.1.3",ngImport:i0__namespace,type:IMaskModule,deps:[],target:i0__namespace.\u0275\u0275FactoryTarget.NgModule});IMaskModule.\u0275mod=i0__namespace.\u0275\u0275ngDeclareNgModule({minVersion:"12.0.0",version:"13.1.3",ngImport:i0__namespace,type:IMaskModule,declarations:[IMaskPipe],imports:[common.CommonModule,IMaskDirectiveModule],exports:[IMaskPipe,IMaskDirectiveModule]});IMaskModule.\u0275inj=i0__namespace.\u0275\u0275ngDeclareInjector({minVersion:"12.0.0",version:"13.1.3",ngImport:i0__namespace,type:IMaskModule,imports:[[common.CommonModule,IMaskDirectiveModule],IMaskDirectiveModule]});i0__namespace.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"13.1.3",ngImport:i0__namespace,type:IMaskModule,decorators:[{type:i0.NgModule,args:[{imports:[common.CommonModule,IMaskDirectiveModule],declarations:[IMaskPipe],exports:[IMaskPipe,IMaskDirectiveModule]}]}]});Object.defineProperty(exports,"PIPE_TYPE",{enumerable:true,get:function(){return IMask.PIPE_TYPE}});Object.defineProperty(exports,"pipe",{enumerable:true,get:function(){return IMask.pipe}});exports.IMaskDirective=IMaskDirective;exports.IMaskDirectiveModule=IMaskDirectiveModule;exports.IMaskFactory=IMaskFactory;exports.IMaskModule=IMaskModule;exports.IMaskPipe=IMaskPipe;exports.MASKEDINPUT_VALUE_ACCESSOR=MASKEDINPUT_VALUE_ACCESSOR}));
|
|
1813
1813
|
/*!
|
|
1814
1814
|
* tabbable 6.2.0
|
|
1815
1815
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|